diff --git a/.travis.yml b/.travis.yml index 578df911eb..5eabb0ba71 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,19 +3,15 @@ notifications: email: false before_install: npm config set progress=false && npm i -g npm@latest --no-audit install: npm ci --no-audit -cache: - directories: - - node_modules jobs: include: - node_js: lts/* script: - - if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then ./scripts/check-pr.sh; fi + - if [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ "$TRAVIS_PULL_REQUEST_BRANCH" != "dev" ]; then ./scripts/check-pr.sh; fi - npm run all - if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then - cd $TRAVIS_BUILD_DIR/tests/allocators/arena && npm run build && cd .. && npm test arena && - cd $TRAVIS_BUILD_DIR/tests/allocators/buddy && npm run build && cd .. && npm test buddy && - cd $TRAVIS_BUILD_DIR/tests/allocators/tlsf && npm run build && cd .. && npm test tlsf; + cd $TRAVIS_BUILD_DIR/tests/allocators/rt-full && npm run build && cd .. && npm test rt-full && + cd $TRAVIS_BUILD_DIR/tests/allocators/rt-stub && npm run build && cd .. && npm test rt-stub; fi env: Runs the tests on node.js LTS, also tests allocators - node_js: node @@ -24,7 +20,7 @@ jobs: env: Runs the tests on node.js stable - node_js: node script: - - npm run clean && npm run test:compiler + - npm run clean && npm run test:compiler rt/flags threads env: - Runs experimental tests on node.js v8-canary using - ASC_FEATURES="simd,threads" diff --git a/README.md b/README.md index 6fadcc2a8b..2dff5e70e6 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,9 @@ [![Build Status](https://travis-ci.org/AssemblyScript/assemblyscript.svg?branch=master)](https://travis-ci.org/AssemblyScript/assemblyscript) -**AssemblyScript** compiles strictly typed [TypeScript](http://www.typescriptlang.org) (basically JavaScript with types) to [WebAssembly](http://webassembly.org) using [Binaryen](https://github.com/WebAssembly/binaryen). It generates lean and mean WebAssembly modules while being just an `npm install` away. +**AssemblyScript** compiles a strict subset of [TypeScript](http://www.typescriptlang.org) (basically JavaScript with types) to [WebAssembly](http://webassembly.org) using [Binaryen](https://github.com/WebAssembly/binaryen). It generates lean and mean WebAssembly modules while being just an `npm install` away. -Try it out in [WebAssembly Studio](https://webassembly.studio)! +Check out the [documentation](https://docs.assemblyscript.org) or try it out in [WebAssembly Studio](https://webassembly.studio)! --- @@ -43,60 +43,20 @@ Motivation > I do think [compiling TypeScript into WASM] is tremendously useful. It allows JavaScript developers to create WASM modules without having to learn C. – Colin Eberhardt, [Exploring different approaches to building WebAssembly modules](http://blog.scottlogic.com/2017/10/17/wasm-mandelbrot.html) (Oct 17, 2017) -Getting started ---------------- +Instructions +------------ -All the details are provided in the [AssemblyScript wiki](https://github.com/AssemblyScript/assemblyscript/wiki) - make sure to pay it a visit. With that being said, the easiest way to get started with AssemblyScript is to point npm at the GitHub repository (for now) - -``` -$> npm install --save-dev AssemblyScript/assemblyscript -``` - -followed by [scaffolding](https://github.com/AssemblyScript/assemblyscript/wiki/Using-the-CLI#scaffolding-with-asinit) a new project including the necessary configuration files, for example in the current directory: - -``` -$> npx asinit . -``` - -Once the project is set up, it's just a matter of using your existing [TypeScript tooling](https://code.visualstudio.com) while coding, and [using the CLI](https://github.com/AssemblyScript/assemblyscript/wiki/Using-the-CLI) to build to WebAssembly, either manually, or using (and maybe modifying) the generated build task in the generated `package.json`: - -``` -$> npm run asbuild -``` - -The CLI API can also [be used programmatically](./cli). - -If you rather prefer an installation suitable for development, pretty much the same can be achieved by cloning the GitHub repository instead: +For general usage instructions, please refer to the [documentation](https://docs.assemblyscript.org) instead. The following sets up a *development environment* of the compiler, for example if you plan to make a pull request: ``` $> git clone https://github.com/AssemblyScript/assemblyscript.git $> cd assemblyscript $> npm install $> npm link +$> npm clean ``` -**Note** that a fresh clone of the compiler will use the distribution files in `dist/`, but it can also run [the sources](./src) directly through ts-node after an `npm run clean`, which is useful in development. This condition can also be checked by running `asc -v` (it is running the sources if it states `-dev`). - -Examples --------- - -* **[Conway's Game of Life](./examples/game-of-life)** [ [demo](https://assemblyscript.github.io/assemblyscript/examples/game-of-life) | [fiddle](https://webassembly.studio/?f=gvuw4enb3qk) ]
- Continuously updates the cellular automaton and visualizes its state on a canvas. - -* **[Mandelbrot Set](./examples/mandelbrot)** [ [demo](https://assemblyscript.github.io/assemblyscript/examples/mandelbrot) | [fiddle](https://webassembly.studio/?f=m6hbiw9wyq) ]
- Renders the Mandelbrot set to a canvas. - -* **[i64 polyfill](./examples/i64-polyfill)**
- Exposes WebAssembly's i64 operations to JavaScript using 32-bit integers (low and high bits). - -* **[PSON decoder](./examples/pson)**
- A simple decoder for the PSON binary format. - -* **[WASM parser](./lib/parse)**
- A WebAssembly binary parser in WebAssembly. - -* **[N-body system](./examples/n-body)** [ [demo](https://assemblyscript.github.io/assemblyscript/examples/n-body) ]
- An implementation of the N-body system from the [Computer Language Benchmarks Game](https://benchmarksgame-team.pages.debian.net/benchmarksgame/). +Note that a fresh clone of the compiler will use the distribution files in `dist/`, but after an `npm clean` it will run [the sources](./src) directly through ts-node, which is useful in development. This condition can also be checked by running `asc -v` (it is running the sources if it states `-dev`). Also please see our [contribution guidelines](./CONTRIBUTING.md) before making your first pull request. Building -------- diff --git a/cli/asc.js b/cli/asc.js index 151a6c1322..de2f71ec63 100644 --- a/cli/asc.js +++ b/cli/asc.js @@ -22,6 +22,8 @@ const optionsUtil = require("./util/options"); const mkdirp = require("./util/mkdirp"); const EOL = process.platform === "win32" ? "\r\n" : "\n"; +// global.Binaryen = require("../lib/binaryen"); + // Emscripten adds an `uncaughtException` listener to Binaryen that results in an additional // useless code fragment on top of an actual error. suppress this: if (process.removeAllListeners) process.removeAllListeners("uncaughtException"); @@ -68,7 +70,7 @@ exports.sourceMapRoot = "assemblyscript:///"; exports.libraryPrefix = assemblyscript.LIBRARY_PREFIX; /** Default Binaryen optimization level. */ -exports.defaultOptimizeLevel = 2; +exports.defaultOptimizeLevel = 3; /** Default Binaryen shrink level. */ exports.defaultShrinkLevel = 1; @@ -228,30 +230,18 @@ exports.main = function main(argv, options, callback) { var parser = null; // Include library files - if (!args.noLib) { - Object.keys(exports.libraryFiles).forEach(libPath => { - if (libPath.indexOf("/") >= 0) return; // in sub-directory: imported on demand - stats.parseCount++; - stats.parseTime += measure(() => { - parser = assemblyscript.parseFile( - exports.libraryFiles[libPath], - exports.libraryPrefix + libPath + ".ts", - false, - parser - ); - }); - }); - } else { // always include builtins + Object.keys(exports.libraryFiles).forEach(libPath => { + if (libPath.indexOf("/") >= 0) return; // in sub-directory: imported on demand stats.parseCount++; stats.parseTime += measure(() => { parser = assemblyscript.parseFile( - exports.libraryFiles["builtins"], - exports.libraryPrefix + "builtins.ts", + exports.libraryFiles[libPath], + exports.libraryPrefix + libPath + ".ts", false, parser ); }); - } + }); const customLibDirs = []; if (args.lib) { let lib = args.lib; @@ -287,6 +277,7 @@ exports.main = function main(argv, options, callback) { function parseBacklog() { var sourcePath, sourceText; while ((sourcePath = parser.nextFile()) != null) { + sourceText = null; // Load library file if explicitly requested if (sourcePath.startsWith(exports.libraryPrefix)) { @@ -335,12 +326,12 @@ exports.main = function main(argv, options, callback) { } else { for (let i = 0, k = customLibDirs.length; i < k; ++i) { const dir = customLibDirs[i]; - sourceText = readFile(plainName + ".ts", customLibDirs[i]); + sourceText = readFile(plainName + ".ts", dir); if (sourceText !== null) { sourcePath = exports.libraryPrefix + plainName + ".ts"; break; } else { - sourceText = readFile(indexName + ".ts", customLibDirs[i]); + sourceText = readFile(indexName + ".ts", dir); if (sourceText !== null) { sourcePath = exports.libraryPrefix + indexName + ".ts"; break; @@ -364,6 +355,26 @@ exports.main = function main(argv, options, callback) { } } + // Include runtime template before entry files so its setup runs first + { + let runtimeName = String(args.runtime); + let runtimePath = "rt/index-" + runtimeName; + let runtimeText = exports.libraryFiles[runtimePath]; + if (runtimeText == null) { + runtimePath = runtimeName; + runtimeText = readFile(runtimePath + ".ts", baseDir); + if (runtimeText == null) { + return callback(Error("Runtime '" + runtimeName + "' not found.")); + } + } else { + runtimePath = "~lib/" + runtimePath; + } + stats.parseCount++; + stats.parseTime += measure(() => { + parser = assemblyscript.parseFile(runtimeText, runtimePath, true, parser); + }); + } + // Include entry files for (let i = 0, k = argv.length; i < k; ++i) { const filename = argv[i]; @@ -387,11 +398,18 @@ exports.main = function main(argv, options, callback) { stats.parseTime += measure(() => { parser = assemblyscript.parseFile(sourceText, sourcePath, true, parser); }); + } + + // Parse entry files + { let code = parseBacklog(); if (code) return code; } + // Call afterParse transform hook applyTransform("afterParse", parser); + + // Parse additional files, if any { let code = parseBacklog(); if (code) return code; @@ -423,17 +441,16 @@ exports.main = function main(argv, options, callback) { assemblyscript.setImportMemory(compilerOptions, args.importMemory); assemblyscript.setSharedMemory(compilerOptions, args.sharedMemory); assemblyscript.setImportTable(compilerOptions, args.importTable); + assemblyscript.setExplicitStart(compilerOptions, args.explicitStart); assemblyscript.setMemoryBase(compilerOptions, args.memoryBase >>> 0); assemblyscript.setSourceMap(compilerOptions, args.sourceMap != null); assemblyscript.setOptimizeLevelHints(compilerOptions, optimizeLevel, shrinkLevel); - if (!args.noLib) { - // Initialize default aliases - assemblyscript.setGlobalAlias(compilerOptions, "Math", "NativeMath"); - assemblyscript.setGlobalAlias(compilerOptions, "Mathf", "NativeMathf"); - assemblyscript.setGlobalAlias(compilerOptions, "abort", "~lib/env/abort"); - assemblyscript.setGlobalAlias(compilerOptions, "trace", "~lib/env/trace"); - } + // Initialize default aliases + assemblyscript.setGlobalAlias(compilerOptions, "Math", "NativeMath"); + assemblyscript.setGlobalAlias(compilerOptions, "Mathf", "NativeMathf"); + assemblyscript.setGlobalAlias(compilerOptions, "abort", "~lib/builtins/abort"); + assemblyscript.setGlobalAlias(compilerOptions, "trace", "~lib/builtins/trace"); // Add or override aliases if specified if (args.use) { @@ -463,15 +480,13 @@ exports.main = function main(argv, options, callback) { var module; stats.compileCount++; - (() => { - try { - stats.compileTime += measure(() => { - module = assemblyscript.compileProgram(program, compilerOptions); - }); - } catch (e) { - return callback(e); - } - })(); + try { + stats.compileTime += measure(() => { + module = assemblyscript.compileProgram(program, compilerOptions); + }); + } catch (e) { + return callback(e); + } if (checkDiagnostics(parser, stderr)) { if (module) module.dispose(); return callback(Error("Compile error")); @@ -697,6 +712,9 @@ exports.main = function main(argv, options, callback) { if (args.measure) { printStats(stats, stderr); } + if (args.printrtti) { + printRTTI(program, stderr); + } return callback(null); function readFileNode(filename, baseDir) { @@ -833,6 +851,15 @@ function printStats(stats, output) { exports.printStats = printStats; +/** Prints runtime type information. */ +function printRTTI(program, output) { + if (!output) output = process.stderr; + output.write("# Runtime type information (RTTI)\n"); + output.write(assemblyscript.buildRTTI(program)); +} + +exports.printRTTI = printRTTI; + var allocBuffer = typeof global !== "undefined" && global.Buffer ? global.Buffer.allocUnsafe || function(len) { return new global.Buffer(len); } : function(len) { return new Uint8Array(len) }; diff --git a/cli/asc.json b/cli/asc.json index 523d2416f9..2c98bb2428 100644 --- a/cli/asc.json +++ b/cli/asc.json @@ -13,7 +13,7 @@ "description": [ "Optimizes the module. Also has the usual shorthands:", "", - " -O Uses defaults. Equivalent to -O2s", + " -O Uses defaults. Equivalent to -O3s", " -O0 Equivalent to --optimizeLevel 0", " -O1 Equivalent to --optimizeLevel 1", " -O2 Equivalent to --optimizeLevel 2", @@ -81,6 +81,19 @@ ], "type": "s" }, + "runtime": { + "description": [ + "Specifies the runtime implementation to include in the program.", + "", + " full Default runtime based on TLSF and reference counting.", + " half Same as 'full', but not exported to the host.", + " stub Minimal stub implementation without free/GC support.", + " none Same as 'stub', but not exported to the host.", + "" + ], + "type": "s", + "default": "full" + }, "debug": { "description": "Enables debug information in emitted binaries.", "type": "b", @@ -116,8 +129,8 @@ "type": "b", "default": false }, - "noLib": { - "description": "Does not include the shipped standard library.", + "explicitStart": { + "description": "Exports an explicit start function to be called manually.", "type": "b", "default": false }, @@ -177,6 +190,11 @@ "type": "b", "default": false }, + "printrtti": { + "description": "Prints the module's runtime type information to stderr.", + "type": "b", + "default": false + }, "noColors": { "description": "Disables terminal colors.", "type": "b", diff --git a/dist/asc.js b/dist/asc.js index e06a1b2cb4..f65a8e197f 100644 --- a/dist/asc.js +++ b/dist/asc.js @@ -1,2 +1,2 @@ -!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(function(){try{return require("assemblyscript")}catch(e){}}()):"function"==typeof define&&define.amd?define(["assemblyscript"],n):"object"==typeof exports?exports.asc=n(function(){try{return require("assemblyscript")}catch(e){}}()):e.asc=n(e.assemblyscript)}("undefined"!=typeof self?self:this,function(__WEBPACK_EXTERNAL_MODULE__10__){return function(e){var n={};function t(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,t),r.l=!0,r.exports}return t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:i})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(t.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var r in e)t.d(i,r,function(n){return e[n]}.bind(null,r));return i},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=4)}([function(e,n,t){var i,r;n.nextTick=function(e){setTimeout(e,0)},n.platform=n.arch=n.execPath=n.title="browser",n.pid=1,n.browser=!0,n.env={},n.argv=[],n.binding=function(e){throw new Error("No such module. (Possibly not yet loaded)")},r="/",n.cwd=function(){return r},n.chdir=function(e){i||(i=t(1)),r=i.resolve(e,r)},n.exit=n.kill=n.umask=n.dlopen=n.uptime=n.memoryUsage=n.uvCounters=function(){},n.features={}},function(e,n,t){(function(e){function t(e,n){for(var t=0,i=e.length-1;i>=0;i--){var r=e[i];"."===r?e.splice(i,1):".."===r?(e.splice(i,1),t++):t&&(e.splice(i,1),t--)}if(n)for(;t--;t)e.unshift("..");return e}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,r=function(e){return i.exec(e).slice(1)};function a(e,n){if(e.filter)return e.filter(n);for(var t=[],i=0;i=-1&&!i;r--){var o=r>=0?arguments[r]:e.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(n=o+"/"+n,i="/"===o.charAt(0))}return(i?"/":"")+(n=t(a(n.split("/"),function(e){return!!e}),!i).join("/"))||"."},n.normalize=function(e){var i=n.isAbsolute(e),r="/"===o(e,-1);return(e=t(a(e.split("/"),function(e){return!!e}),!i).join("/"))||i||(e="."),e&&r&&(e+="/"),(i?"/":"")+e},n.isAbsolute=function(e){return"/"===e.charAt(0)},n.join=function(){var e=Array.prototype.slice.call(arguments,0);return n.normalize(a(e,function(e,n){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},n.relative=function(e,t){function i(e){for(var n=0;n=0&&""===e[t];t--);return n>t?[]:e.slice(n,t-n+1)}e=n.resolve(e).substr(1),t=n.resolve(t).substr(1);for(var r=i(e.split("/")),a=i(t.split("/")),o=Math.min(r.length,a.length),s=o,l=0;l{try{assemblyscript=__webpack_require__(10)}catch(e){try{__webpack_require__(!function(){var e=new Error("Cannot find module 'ts-node'");throw e.code="MODULE_NOT_FOUND",e}()).register({project:path.join(".","..","src","tsconfig.json")}),__webpack_require__(!function(){var e=new Error("Cannot find module '../src/glue/js'");throw e.code="MODULE_NOT_FOUND",e}()),assemblyscript=__webpack_require__(!function(){var e=new Error("Cannot find module '../src'");throw e.code="MODULE_NOT_FOUND",e}()),isDev=!0}catch(e_ts){try{assemblyscript=eval("require('./assemblyscript')")}catch(e){throw e.stack=e_ts.stack+"\n---\n"+e.stack,e}}}})(),exports.isBundle=!0,exports.isDev=isDev,exports.version=exports.isBundle?"0.6.0":__webpack_require__(!function(){var e=new Error("Cannot find module '../package.json'");throw e.code="MODULE_NOT_FOUND",e}()).version,exports.options=__webpack_require__(11),exports.sourceMapRoot="assemblyscript:///",exports.libraryPrefix=assemblyscript.LIBRARY_PREFIX,exports.defaultOptimizeLevel=2,exports.defaultShrinkLevel=1,exports.libraryFiles=exports.isBundle?Object({"allocator/arena":'/**\n * Arena Memory Allocator\n *\n * Provides a `memory.reset` function to reset the heap to its initial state. A user has to make\n * sure that there are no more references to cleared memory afterwards. Always aligns to 8 bytes.\n *\n * @module std/assembly/allocator/arena\n *//***/\n\nimport { AL_MASK, MAX_SIZE_32 } from "../internal/allocator";\n\nvar startOffset: usize = (HEAP_BASE + AL_MASK) & ~AL_MASK;\nvar offset: usize = startOffset;\n\n// Memory allocator interface\n\n@global export function __memory_allocate(size: usize): usize {\n if (size > MAX_SIZE_32) unreachable();\n var ptr = offset;\n var newPtr = (ptr + max(size, 1) + AL_MASK) & ~AL_MASK;\n var pagesBefore = memory.size();\n if (newPtr > pagesBefore << 16) {\n let pagesNeeded = ((newPtr - ptr + 0xffff) & ~0xffff) >>> 16;\n let pagesWanted = max(pagesBefore, pagesNeeded); // double memory\n if (memory.grow(pagesWanted) < 0) {\n if (memory.grow(pagesNeeded) < 0) {\n unreachable(); // out of memory\n }\n }\n }\n offset = newPtr;\n return ptr;\n}\n\n@global export function __memory_free(ptr: usize): void { /* nop */ }\n\n@global export function __memory_reset(): void {\n offset = startOffset;\n}\n',"allocator/buddy":'/**\n * Buddy Memory Allocator.\n * @module std/assembly/allocator/buddy\n *//***/\n\n/*\n Copyright 2018 Evan Wallace\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the "Software"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n*/// see: https://github.com/evanw/buddy-malloc\n\n/*\n * This file implements a buddy memory allocator, which is an allocator that\n * allocates memory within a fixed linear address range. It spans the address\n * range with a binary tree that tracks free space. Both "malloc" and "free"\n * are O(log N) time where N is the maximum possible number of allocations.\n *\n * The "buddy" term comes from how the tree is used. When memory is allocated,\n * nodes in the tree are split recursively until a node of the appropriate size\n * is reached. Every split results in two child nodes, each of which is the\n * buddy of the other. When a node is freed, the node and its buddy can be\n * merged again if the buddy is also free. This makes the memory available\n * for larger allocations again.\n */\n\n/*\n * Every allocation needs an 8-byte header to store the allocation size while\n * staying 8-byte aligned. The address returned by "malloc" is the address\n * right after this header (i.e. the size occupies the 8 bytes before the\n * returned address).\n */\nconst HEADER_SIZE: usize = 8;\n\n/*\n * The minimum allocation size is 16 bytes because we have an 8-byte header and\n * we need to stay 8-byte aligned.\n */\nconst MIN_ALLOC_LOG2: usize = 4;\nconst MIN_ALLOC: usize = 1 << MIN_ALLOC_LOG2;\n\n/*\n * The maximum allocation size is currently set to 2gb. This is the total size\n * of the heap. It\'s technically also the maximum allocation size because the\n * heap could consist of a single allocation of this size. But of course real\n * heaps will have multiple allocations, so the real maximum allocation limit\n * is at most 1gb.\n */\nconst MAX_ALLOC_LOG2: usize = 30; // 31;\nconst MAX_ALLOC: usize = 1 << MAX_ALLOC_LOG2;\n\n/*\n * Allocations are done in powers of two starting from MIN_ALLOC and ending at\n * MAX_ALLOC inclusive. Each allocation size has a bucket that stores the free\n * list for that allocation size.\n *\n * Given a bucket index, the size of the allocations in that bucket can be\n * found with "(size_t)1 << (MAX_ALLOC_LOG2 - bucket)".\n */\nconst BUCKET_COUNT: usize = MAX_ALLOC_LOG2 - MIN_ALLOC_LOG2 + 1;\n\n/*\n * Free lists are stored as circular doubly-linked lists. Every possible\n * allocation size has an associated free list that is threaded through all\n * currently free blocks of that size. That means MIN_ALLOC must be at least\n * "sizeof(list_t)". MIN_ALLOC is currently 16 bytes, so this will be true for\n * both 32-bit and 64-bit.\n */\n@unmanaged\nclass List {\n prev: List;\n next: List;\n static readonly SIZE: usize = 2 * sizeof();\n}\n\n/*\n * Each bucket corresponds to a certain allocation size and stores a free list\n * for that size. The bucket at index 0 corresponds to an allocation size of\n * MAX_ALLOC (i.e. the whole address space).\n */\nvar BUCKETS_START: usize = HEAP_BASE;\nvar BUCKETS_END: usize = BUCKETS_START + BUCKET_COUNT * List.SIZE;\n\nfunction buckets$get(index: usize): List {\n assert(index < BUCKET_COUNT);\n return changetype(BUCKETS_START + index * List.SIZE);\n}\n\n/*\n * We could initialize the allocator by giving it one free block the size of\n * the entire address space. However, this would cause us to instantly reserve\n * half of the entire address space on the first allocation, since the first\n * split would store a free list entry at the start of the right child of the\n * root. Instead, we have the tree start out small and grow the size of the\n * tree as we use more memory. The size of the tree is tracked by this value.\n */\nvar bucket_limit: usize;\n\n/*\n * This array represents a linearized binary tree of bits. Every possible\n * allocation larger than MIN_ALLOC has a node in this tree (and therefore a\n * bit in this array).\n *\n * Given the index for a node, lineraized binary trees allow you to traverse to\n * the parent node or the child nodes just by doing simple arithmetic on the\n * index:\n *\n * - Move to parent: index = (index - 1) / 2;\n * - Move to left child: index = index * 2 + 1;\n * - Move to right child: index = index * 2 + 2;\n * - Move to sibling: index = ((index - 1) ^ 1) + 1;\n *\n * Each node in this tree can be in one of several states:\n *\n * - UNUSED (both children are UNUSED)\n * - SPLIT (one child is UNUSED and the other child isn\'t)\n * - USED (neither children are UNUSED)\n *\n * These states take two bits to store. However, it turns out we have enough\n * information to distinguish between UNUSED and USED from context, so we only\n * need to store SPLIT or not, which only takes a single bit.\n *\n * Note that we don\'t need to store any nodes for allocations of size MIN_ALLOC\n * since we only ever care about parent nodes.\n */\nconst SPLIT_COUNT: usize = (1 << (BUCKET_COUNT - 1)) / 8;\nvar NODE_IS_SPLIT_START: usize = BUCKETS_END;\nvar NODE_IS_SPLIT_END: usize = NODE_IS_SPLIT_START + SPLIT_COUNT * sizeof();\n\nfunction node_is_split$get(index: usize): i32 {\n assert(index < SPLIT_COUNT);\n return load(NODE_IS_SPLIT_START + index);\n}\n\nfunction node_is_split$set(index: usize, state: i32): void {\n assert(index < SPLIT_COUNT);\n store(NODE_IS_SPLIT_START + index, state);\n}\n\n/*\n * This is the starting address of the address range for this allocator. Every\n * returned allocation will be an offset of this pointer from 0 to MAX_ALLOC.\n */\nvar base_ptr: usize;\n\n/*\n * This is the maximum address that has ever been used by the allocator. It\'s\n * used to know when to call "brk" to request more memory from the kernel.\n */\nvar max_ptr: usize;\n\n/*\n * Make sure all addresses before "new_value" are valid and can be used. Memory\n * is allocated in a 2gb address range but that memory is not reserved up\n * front. It\'s only reserved when it\'s needed by calling this function. This\n * will return false if the memory could not be reserved.\n */\nfunction update_max_ptr(new_value: usize): i32 {\n if (new_value > max_ptr) {\n // if (brk(new_value)) {\n // return 0;\n // }\n let oldPages = memory.size();\n let newPages = (((new_value + 0xffff) & ~0xffff) >>> 16);\n assert(newPages > oldPages);\n if (memory.grow(newPages - oldPages) < 0) {\n return 0;\n }\n // max_ptr = new_value;\n max_ptr = newPages << 16;\n }\n return 1;\n}\n\n/*\n * Initialize a list to empty. Because these are circular lists, an "empty"\n * list is an entry where both links point to itself. This makes insertion\n * and removal simpler because they don\'t need any branches.\n */\nfunction list_init(list: List): void {\n list.prev = list;\n list.next = list;\n}\n\n/*\n * Append the provided entry to the end of the list. This assumes the entry\n * isn\'t in a list already because it overwrites the linked list pointers.\n */\nfunction list_push(list: List, entry: List): void {\n var prev = list.prev;\n entry.prev = prev;\n entry.next = list;\n prev.next = entry;\n list.prev = entry;\n}\n\n/*\n * Remove the provided entry from whichever list it\'s currently in. This\n * assumes that the entry is in a list. You don\'t need to provide the list\n * because the lists are circular, so the list\'s pointers will automatically\n * be updated if the first or last entries are removed.\n */\nfunction list_remove(entry: List): void {\n var prev = entry.prev;\n var next = entry.next;\n prev.next = next;\n next.prev = prev;\n}\n\n/*\n * Remove and return the first entry in the list or NULL if the list is empty.\n */\nfunction list_pop(list: List): List | null {\n var back = list.prev;\n if (back == list) return null;\n list_remove(back);\n return back;\n}\n\n/*\n * This maps from the index of a node to the address of memory that node\n * represents. The bucket can be derived from the index using a loop but is\n * required to be provided here since having them means we can avoid the loop\n * and have this function return in constant time.\n */\nfunction ptr_for_node(index: usize, bucket: usize): usize {\n return base_ptr + ((index - (1 << bucket) + 1) << (MAX_ALLOC_LOG2 - bucket));\n}\n\n/*\n * This maps from an address of memory to the node that represents that\n * address. There are often many nodes that all map to the same address, so\n * the bucket is needed to uniquely identify a node.\n */\nfunction node_for_ptr(ptr: usize, bucket: usize): usize {\n return ((ptr - base_ptr) >> (MAX_ALLOC_LOG2 - bucket)) + (1 << bucket) - 1;\n}\n\n/*\n * Given the index of a node, this returns the "is split" flag of the parent.\n */\nfunction parent_is_split(index: usize): bool {\n index = (index - 1) / 2;\n return ((node_is_split$get(index / 8) >>> (index % 8)) & 1) == 1;\n}\n\n/*\n * Given the index of a node, this flips the "is split" flag of the parent.\n */\nfunction flip_parent_is_split(index: usize): void {\n index = (index - 1) / 2;\n var indexDiv8 = index / 8;\n node_is_split$set(indexDiv8,\n node_is_split$get(indexDiv8) ^ (1 << (index % 8))\n );\n}\n\n/*\n * Given the requested size passed to "malloc", this function returns the index\n * of the smallest bucket that can fit that size.\n */\nfunction bucket_for_request(request: usize): usize {\n var bucket = BUCKET_COUNT - 1;\n var size = MIN_ALLOC;\n\n while (size < request) {\n bucket--;\n size *= 2;\n }\n\n return bucket;\n}\n\n/*\n * The tree is always rooted at the current bucket limit. This call grows the\n * tree by repeatedly doubling it in size until the root lies at the provided\n * bucket index. Each doubling lowers the bucket limit by 1.\n */\nfunction lower_bucket_limit(bucket: usize): u32 {\n while (bucket < bucket_limit) {\n let root = node_for_ptr(base_ptr, bucket_limit);\n let right_child: usize;\n\n /*\n * If the parent isn\'t SPLIT, that means the node at the current bucket\n * limit is UNUSED and our address space is entirely free. In that case,\n * clear the root free list, increase the bucket limit, and add a single\n * block with the newly-expanded address space to the new root free list.\n */\n if (!parent_is_split(root)) {\n list_remove(changetype(base_ptr));\n list_init(buckets$get(--bucket_limit));\n list_push(buckets$get(bucket_limit), changetype(base_ptr));\n continue;\n }\n\n /*\n * Otherwise, the tree is currently in use. Create a parent node for the\n * current root node in the SPLIT state with a right child on the free\n * list. Make sure to reserve the memory for the free list entry before\n * writing to it. Note that we do not need to flip the "is split" flag for\n * our current parent because it\'s already on (we know because we just\n * checked it above).\n */\n right_child = ptr_for_node(root + 1, bucket_limit);\n if (!update_max_ptr(right_child + List.SIZE)) {\n return 0;\n }\n list_push(buckets$get(bucket_limit), changetype(right_child));\n list_init(buckets$get(--bucket_limit));\n\n /*\n * Set the grandparent\'s SPLIT flag so if we need to lower the bucket limit\n * again, we\'ll know that the new root node we just added is in use.\n */\n root = (root - 1) / 2;\n if (root != 0) {\n flip_parent_is_split(root);\n }\n }\n\n return 1;\n}\n\n// Memory allocator interface\n\n@global export function __memory_allocate(request: usize): usize {\n var original_bucket: usize, bucket: usize;\n\n /*\n * Make sure it\'s possible for an allocation of this size to succeed. There\'s\n * a hard-coded limit on the maximum allocation size because of the way this\n * allocator works.\n */\n if (request > MAX_ALLOC - HEADER_SIZE) unreachable();\n\n /*\n * Initialize our global state if this is the first call to "malloc". At the\n * beginning, the tree has a single node that represents the smallest\n * possible allocation size. More memory will be reserved later as needed.\n */\n if (base_ptr == 0) {\n // base_ptr = max_ptr = (uint8_t *)sbrk(0);\n base_ptr = (NODE_IS_SPLIT_END + 7) & ~7; // must be aligned\n max_ptr = memory.size() << 16; // must grow first\n bucket_limit = BUCKET_COUNT - 1;\n if (!update_max_ptr(base_ptr + List.SIZE)) {\n return 0;\n }\n list_init(buckets$get(BUCKET_COUNT - 1));\n list_push(buckets$get(BUCKET_COUNT - 1), changetype(base_ptr));\n }\n\n /*\n * Find the smallest bucket that will fit this request. This doesn\'t check\n * that there\'s space for the request yet.\n */\n bucket = bucket_for_request(request + HEADER_SIZE);\n original_bucket = bucket;\n\n /*\n * Search for a bucket with a non-empty free list that\'s as large or larger\n * than what we need. If there isn\'t an exact match, we\'ll need to split a\n * larger one to get a match.\n */\n while (bucket + 1 != 0) {\n let size: usize, bytes_needed: usize, i: usize;\n let ptr: usize;\n\n /*\n * We may need to grow the tree to be able to fit an allocation of this\n * size. Try to grow the tree and stop here if we can\'t.\n */\n if (!lower_bucket_limit(bucket)) {\n return 0;\n }\n\n /*\n * Try to pop a block off the free list for this bucket. If the free list\n * is empty, we\'re going to have to split a larger block instead.\n */\n ptr = changetype(list_pop(buckets$get(bucket)));\n if (!ptr) {\n /*\n * If we\'re not at the root of the tree or it\'s impossible to grow the\n * tree any more, continue on to the next bucket.\n */\n if (bucket != bucket_limit || bucket == 0) {\n bucket--;\n continue;\n }\n\n /*\n * Otherwise, grow the tree one more level and then pop a block off the\n * free list again. Since we know the root of the tree is used (because\n * the free list was empty), this will add a parent above this node in\n * the SPLIT state and then add the new right child node to the free list\n * for this bucket. Popping the free list will give us this right child.\n */\n if (!lower_bucket_limit(bucket - 1)) {\n return 0;\n }\n ptr = changetype(list_pop(buckets$get(bucket)));\n }\n\n /*\n * Try to expand the address space first before going any further. If we\n * have run out of space, put this block back on the free list and fail.\n */\n size = 1 << (MAX_ALLOC_LOG2 - bucket);\n bytes_needed = bucket < original_bucket ? size / 2 + List.SIZE : size;\n if (!update_max_ptr(ptr + bytes_needed)) {\n list_push(buckets$get(bucket), changetype(ptr));\n return 0;\n }\n\n /*\n * If we got a node off the free list, change the node from UNUSED to USED.\n * This involves flipping our parent\'s "is split" bit because that bit is\n * the exclusive-or of the UNUSED flags of both children, and our UNUSED\n * flag (which isn\'t ever stored explicitly) has just changed.\n *\n * Note that we shouldn\'t ever need to flip the "is split" bit of our\n * grandparent because we know our buddy is USED so it\'s impossible for our\n * grandparent to be UNUSED (if our buddy chunk was UNUSED, our parent\n * wouldn\'t ever have been split in the first place).\n */\n i = node_for_ptr(ptr, bucket);\n if (i != 0) {\n flip_parent_is_split(i);\n }\n\n /*\n * If the node we got is larger than we need, split it down to the correct\n * size and put the new unused child nodes on the free list in the\n * corresponding bucket. This is done by repeatedly moving to the left\n * child, splitting the parent, and then adding the right child to the free\n * list.\n */\n while (bucket < original_bucket) {\n i = i * 2 + 1;\n bucket++;\n flip_parent_is_split(i);\n list_push(\n buckets$get(bucket),\n changetype(ptr_for_node(i + 1, bucket))\n );\n }\n\n /*\n * Now that we have a memory address, write the block header (just the size\n * of the allocation) and return the address immediately after the header.\n */\n store(ptr, request);\n return ptr + HEADER_SIZE;\n }\n\n return 0;\n}\n\n@global export function __memory_free(ptr: usize): void {\n var bucket: usize, i: usize;\n\n /*\n * Ignore any attempts to free a NULL pointer.\n */\n if (!ptr) {\n return;\n }\n\n /*\n * We were given the address returned by "malloc" so get back to the actual\n * address of the node by subtracting off the size of the block header. Then\n * look up the index of the node corresponding to this address.\n */\n ptr = ptr - HEADER_SIZE;\n bucket = bucket_for_request(load(ptr) + HEADER_SIZE);\n i = node_for_ptr(ptr, bucket);\n\n /*\n * Traverse up to the root node, flipping USED blocks to UNUSED and merging\n * UNUSED buddies together into a single UNUSED parent.\n */\n while (i != 0) {\n /*\n * Change this node from UNUSED to USED. This involves flipping our\n * parent\'s "is split" bit because that bit is the exclusive-or of the\n * UNUSED flags of both children, and our UNUSED flag (which isn\'t ever\n * stored explicitly) has just changed.\n */\n flip_parent_is_split(i);\n\n /*\n * If the parent is now SPLIT, that means our buddy is USED, so don\'t merge\n * with it. Instead, stop the iteration here and add ourselves to the free\n * list for our bucket.\n *\n * Also stop here if we\'re at the current root node, even if that root node\n * is now UNUSED. Root nodes don\'t have a buddy so we can\'t merge with one.\n */\n if (parent_is_split(i) || bucket == bucket_limit) {\n break;\n }\n\n /*\n * If we get here, we know our buddy is UNUSED. In this case we should\n * merge with that buddy and continue traversing up to the root node. We\n * need to remove the buddy from its free list here but we don\'t need to\n * add the merged parent to its free list yet. That will be done once after\n * this loop is finished.\n */\n list_remove(changetype(ptr_for_node(((i - 1) ^ 1) + 1, bucket)));\n i = (i - 1) / 2;\n bucket--;\n }\n\n /*\n * Add ourselves to the free list for our bucket. We add to the back of the\n * list because "malloc" takes from the back of the list and we want a "free"\n * followed by a "malloc" of the same size to ideally use the same address\n * for better memory locality.\n */\n list_push(buckets$get(bucket), changetype(ptr_for_node(i, bucket)));\n}\n',"allocator/emscripten":"/**\n * Emscripten Memory Allocator.\n *\n * Uses Emscripten's exported _malloc and _free implementations, i.e., when linking with\n * Emscripten-compiled programs that already provide these. Differs from 'system' in that their\n * names are prefixed with an underscore.\n *\n * @module std/assembly/allocator/emscripten\n *//***/\n\ndeclare function _malloc(size: usize): usize;\ndeclare function _free(ptr: usize): void;\n\n// Memory allocator interface\n\n@global export function __memory_allocate(size: usize): usize {\n return _malloc(size);\n}\n\n@global export function __memory_free(ptr: usize): void {\n _free(ptr);\n}\n","allocator/system":"/**\n * System Memory Allocator.\n *\n * Uses the environment's malloc and free implementations, i.e., when linking with other C-like\n * programs that already provide these.\n *\n * @module std/assembly/allocator/system\n *//***/\n\ndeclare function malloc(size: usize): usize;\ndeclare function free(ptr: usize): void;\n\n// Memory allocator interface\n\n@global export function __memory_allocate(size: usize): usize {\n return malloc(size);\n}\n\n@global export function __memory_free(ptr: usize): void {\n free(ptr);\n}\n","allocator/tlsf":"/**\n * Two-Level Segregate Fit Memory Allocator.\n *\n * A general purpose dynamic memory allocator specifically designed to meet real-time requirements.\n * Always aligns to 8 bytes.\n *\n * @module std/assembly/allocator/tlsf\n *//***/\n\n// ╒══════════════ Block size interpretation (32-bit) ═════════════╕\n// 3 2 1\n// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits\n// ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┼─┴─┴─┴─┴─╫─┴─┴─┤\n// │ | FL │ SB = SL + AL │ ◄─ usize\n// └───────────────────────────────────────────────┴─────────╨─────┘\n// FL: first level, SL: second level, AL: alignment, SB: small block\n\nimport {\n AL_BITS,\n AL_SIZE,\n AL_MASK\n} from \"../internal/allocator\";\n\nconst SL_BITS: u32 = 5;\nconst SL_SIZE: usize = 1 << SL_BITS;\n\nconst SB_BITS: usize = (SL_BITS + AL_BITS);\nconst SB_SIZE: usize = 1 << SB_BITS;\n\nconst FL_BITS: u32 = (sizeof() == sizeof()\n ? 30 // ^= up to 1GB per block\n : 32 // ^= up to 4GB per block\n) - SB_BITS;\n\n// ╒════════════════ Block structure layout (32-bit) ══════════════╕\n// 3 2 1\n// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits\n// ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┼─┼─┤\n// │ size │L│F│ ◄─┐ info\n// ╞═══════════════════════════════════════════════════════════╧═╧═╡ │ ┐\n// │ if free: ◄ prev │ ◄─┤ usize\n// ├───────────────────────────────────────────────────────────────┤ │\n// │ if free: next ► │ ◄─┤\n// ├───────────────────────────────────────────────────────────────┤ │\n// │ ... unused free space >= 0 ... │ │ = 0\n// ├ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┤ │\n// │ if free: jump ▲ │ ◄─┘\n// └───────────────────────────────────────────────────────────────┘ MIN SIZE ┘\n// F: FREE, L: LEFT_FREE\n\n/** Tag indicating that this block is free. */\nconst FREE: usize = 1 << 0;\n/** Tag indicating that this block's left block is free. */\nconst LEFT_FREE: usize = 1 << 1;\n/** Mask to obtain all tags. */\nconst TAGS: usize = FREE | LEFT_FREE;\n\n/** Block structure. */\n@unmanaged\nclass Block {\n\n /** Info field holding this block's size and tags. */\n info: usize;\n\n /** End offset of the {@link Block#info} field. User data starts here. */\n static readonly INFO: usize = (sizeof() + AL_MASK) & ~AL_MASK;\n\n /** Previous free block, if any. Only valid if free. */\n prev: Block | null;\n /** Next free block, if any. Only valid if free. */\n next: Block | null;\n\n /** Minimum size of a block, excluding {@link Block#info}. */\n static readonly MIN_SIZE: usize = (3 * sizeof() + AL_MASK) & ~AL_MASK;// prev + next + jump\n\n /** Maximum size of a used block, excluding {@link Block#info}. */\n static readonly MAX_SIZE: usize = 1 << (FL_BITS + SB_BITS);\n\n /** Gets this block's left (free) block in memory. */\n get left(): Block {\n assert(this.info & LEFT_FREE); // must be free to contain a jump\n return assert(\n load(changetype(this) - sizeof())\n ); // can't be null\n }\n\n /** Gets this block's right block in memory. */\n get right(): Block {\n assert(this.info & ~TAGS); // can't skip beyond the tail block\n return assert(\n changetype(\n changetype(this) + Block.INFO + (this.info & ~TAGS)\n )\n ); // can't be null\n }\n}\n\n// ╒════════════════ Root structure layout (32-bit) ═══════════════╕\n// 3 2 1\n// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits\n// ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┤ ┐\n// │ 0 | flMap S│ ◄────┐\n// ╞═══════════════════════════════════════════════════════════════╡ │\n// │ slMap[0] S │ ◄─┐ │\n// ├───────────────────────────────────────────────────────────────┤ │ │\n// │ slMap[1] │ ◄─┤ │\n// ├───────────────────────────────────────────────────────────────┤ u32 │\n// │ ... │ ◄─┤ │\n// ├───────────────────────────────────────────────────────────────┤ │ │\n// │ slMap[22] P │ ◄─┘ │\n// ╞═══════════════════════════════════════════════════════════════╡ usize\n// │ head[0] │ ◄────┤\n// ├───────────────────────────────────────────────────────────────┤ │\n// │ ... │ ◄────┤\n// ├───────────────────────────────────────────────────────────────┤ │\n// │ head[736] │ ◄────┤\n// ╞═══════════════════════════════════════════════════════════════╡ │\n// │ tailRef │ ◄────┘\n// └───────────────────────────────────────────────────────────────┘ SIZE ┘\n// S: Small blocks map, P: Possibly padded if 64-bit\n\nassert((1 << SL_BITS) <= 32); // second level must fit into 32 bits\n\n/** Root structure. */\n@unmanaged\nclass Root {\n\n /** First level bitmap. */\n flMap: usize = 0;\n\n /** Start offset of second level maps. */\n private static readonly SL_START: usize = sizeof();\n\n // Using *one* SL map per *FL bit*\n\n /** Gets the second level map for the specified first level. */\n getSLMap(fl: usize): u32 {\n assert(fl < FL_BITS); // fl out of range\n return load(changetype(this) + fl * 4, Root.SL_START);\n }\n\n /** Sets the second level map for the specified first level. */\n setSLMap(fl: usize, value: u32): void {\n assert(fl < FL_BITS); // fl out of range\n store(changetype(this) + fl * 4, value, Root.SL_START);\n }\n\n /** End offset of second level maps. */\n private static readonly SL_END: usize = Root.SL_START + FL_BITS * 4;\n\n // Using *number bits per SL* heads per *FL bit*\n\n /** Start offset of FL/SL heads. */\n private static readonly HL_START: usize = (Root.SL_END + AL_MASK) & ~AL_MASK;\n\n /** Gets the head of the specified first and second level index. */\n getHead(fl: usize, sl: u32): Block | null {\n assert(fl < FL_BITS); // fl out of range\n assert(sl < SL_SIZE); // sl out of range\n return changetype(load(\n changetype(this) + (fl * SL_SIZE + sl) * sizeof()\n , Root.HL_START));\n }\n\n /** Sets the head of the specified first and second level index. */\n setHead(fl: usize, sl: u32, value: Block | null): void {\n assert(fl < FL_BITS); // fl out of range\n assert(sl < SL_SIZE); // sl out of range\n store(\n changetype(this) + (fl * SL_SIZE + sl) * sizeof()\n , changetype(value)\n , Root.HL_START);\n }\n\n /** End offset of FL/SL heads. */\n private static readonly HL_END: usize = (\n Root.HL_START + FL_BITS * SL_SIZE * sizeof()\n );\n\n get tailRef(): usize { return load(0, Root.HL_END); }\n set tailRef(value: usize) { store(0, value, Root.HL_END); }\n\n /** Total size of the {@link Root} structure. */\n static readonly SIZE: usize = Root.HL_END + sizeof();\n\n /** Inserts a previously used block back into the free list. */\n insert(block: Block): void {\n // check as much as possible here to prevent invalid free blocks\n assert(block); // cannot be null\n var blockInfo = block.info;\n assert(blockInfo & FREE); // must be free\n var size: usize;\n assert(\n (size = block.info & ~TAGS) >= Block.MIN_SIZE && size < Block.MAX_SIZE\n ); // must be valid, not necessary to compute yet if noAssert=true\n\n var right: Block = assert(block.right); // can't be null\n var rightInfo = right.info;\n\n // merge with right block if also free\n if (rightInfo & FREE) {\n this.remove(right);\n block.info = (blockInfo += Block.INFO + (rightInfo & ~TAGS));\n right = block.right;\n rightInfo = right.info;\n // jump is set below\n }\n\n // merge with left block if also free\n if (blockInfo & LEFT_FREE) {\n let left: Block = assert(block.left); // can't be null\n let leftInfo = left.info;\n assert(leftInfo & FREE); // must be free according to tags\n this.remove(left);\n left.info = (leftInfo += Block.INFO + (blockInfo & ~TAGS));\n block = left;\n blockInfo = leftInfo;\n // jump is set below\n }\n\n right.info = rightInfo | LEFT_FREE;\n this.setJump(block, right);\n // right is no longer used now, hence rightInfo is not synced\n\n size = blockInfo & ~TAGS;\n assert(size >= Block.MIN_SIZE && size < Block.MAX_SIZE); // must be valid\n\n // mapping_insert\n var fl: usize, sl: u32;\n if (size < SB_SIZE) {\n fl = 0;\n sl = (size / AL_SIZE);\n } else {\n fl = fls(size);\n sl = ((size >> (fl - SL_BITS)) ^ (1 << SL_BITS));\n fl -= SB_BITS - 1;\n }\n\n // perform insertion\n var head = this.getHead(fl, sl);\n block.prev = null;\n block.next = head;\n if (head) head.prev = block;\n this.setHead(fl, sl, block);\n\n // update first and second level maps\n this.flMap |= (1 << fl);\n this.setSLMap(fl, this.getSLMap(fl) | (1 << sl));\n }\n\n /**\n * Removes a free block from FL/SL maps. Does not alter left/jump because it\n * is likely that splitting is performed afterwards, invalidating any changes\n * again.\n */\n private remove(block: Block): void {\n var blockInfo = block.info;\n assert(blockInfo & FREE); // must be free\n var size = blockInfo & ~TAGS;\n assert(size >= Block.MIN_SIZE && size < Block.MAX_SIZE); // must be valid\n\n // mapping_insert\n var fl: usize, sl: u32;\n if (size < SB_SIZE) {\n fl = 0;\n sl = (size / AL_SIZE);\n } else {\n fl = fls(size);\n sl = ((size >> (fl - SL_BITS)) ^ (1 << SL_BITS));\n fl -= SB_BITS - 1;\n }\n\n // link previous and next free block\n var prev = block.prev;\n var next = block.next;\n if (prev) prev.next = next;\n if (next) next.prev = prev;\n\n // update head if we are removing it\n if (block == this.getHead(fl, sl)) {\n this.setHead(fl, sl, next);\n\n // clear second level map if head is empty now\n if (!next) {\n let slMap = this.getSLMap(fl);\n this.setSLMap(fl, slMap &= ~(1 << sl));\n\n // clear first level map if second level is empty now\n if (!slMap) this.flMap &= ~(1 << fl);\n }\n }\n }\n\n /** Searches for a free block of at least the specified size. */\n search(size: usize): Block | null {\n assert(size >= Block.MIN_SIZE && size < Block.MAX_SIZE);\n\n // mapping_search\n var fl: usize, sl: u32;\n if (size < SB_SIZE) {\n fl = 0;\n sl = (size / AL_SIZE);\n } else {\n // (*) size += (1 << (fls(size) - SL_BITS)) - 1;\n fl = fls(size);\n sl = ((size >> (fl - SL_BITS)) ^ (1 << SL_BITS));\n fl -= SB_BITS - 1;\n // (*) instead of rounding up, use next second level list for better fit\n if (sl < SL_SIZE - 1) ++sl;\n else ++fl, sl = 0;\n }\n\n // search second level\n var slMap = this.getSLMap(fl) & (~0 << sl);\n var head: Block | null;\n if (!slMap) {\n // search next larger first level\n let flMap = this.flMap & (~0 << (fl + 1));\n if (!flMap) {\n head = null;\n } else {\n fl = ffs(flMap);\n slMap = assert(this.getSLMap(fl)); // can't be zero if fl points here\n head = this.getHead(fl, ffs(slMap));\n }\n } else {\n head = this.getHead(fl, ffs(slMap));\n }\n return head;\n }\n\n /** Links a free left with its right block in memory. */\n private setJump(left: Block, right: Block): void {\n assert(left.info & FREE); // must be free\n assert(left.right == right); // right block must match\n assert(right.info & LEFT_FREE); // right block must be tagged as LEFT_FREE\n store(\n changetype(right) - sizeof()\n , left); // last word in left block's (free) data region\n }\n\n /**\n * Uses the specified free block, removing it from internal maps and\n * splitting it if possible, and returns its data pointer.\n */\n use(block: Block, size: usize): usize {\n var blockInfo = block.info;\n assert(blockInfo & FREE); // must be free so we can use it\n assert(size >= Block.MIN_SIZE && size < Block.MAX_SIZE); // must be valid\n assert(!(size & AL_MASK)); // size must be aligned so the new block is\n\n this.remove(block);\n\n // split if the block can hold another MIN_SIZE block\n var remaining = (blockInfo & ~TAGS) - size;\n if (remaining >= Block.INFO + Block.MIN_SIZE) {\n block.info = size | (blockInfo & LEFT_FREE); // also discards FREE\n\n let spare = changetype(\n changetype(block) + Block.INFO + size\n );\n spare.info = (remaining - Block.INFO) | FREE; // not LEFT_FREE\n this.insert(spare); // also sets jump\n\n // otherwise tag block as no longer FREE and right as no longer LEFT_FREE\n } else {\n block.info = blockInfo & ~FREE;\n let right: Block = assert(block.right); // can't be null (tail)\n right.info &= ~LEFT_FREE;\n }\n\n return changetype(block) + Block.INFO;\n }\n\n /** Adds more memory to the pool. */\n addMemory(start: usize, end: usize): bool {\n assert(start <= end);\n assert(!(start & AL_MASK)); // must be aligned\n assert(!(end & AL_MASK)); // must be aligned\n\n var tailRef = this.tailRef;\n var tailInfo: usize = 0;\n if (tailRef) {\n assert(start >= tailRef + sizeof()); // starts after tail\n\n // merge with current tail if adjacent\n if (start - Block.INFO == tailRef) {\n start -= Block.INFO;\n tailInfo = changetype(tailRef).info;\n }\n\n } else {\n assert(start >= changetype(this) + Root.SIZE); // starts after root\n }\n\n // check if size is large enough for a free block and the tail block\n var size = end - start;\n if (size < Block.INFO + Block.MIN_SIZE + Block.INFO) {\n return false;\n }\n\n // left size is total minus its own and the zero-length tail's header\n var leftSize = size - 2 * Block.INFO;\n var left = changetype(start);\n left.info = leftSize | FREE | (tailInfo & LEFT_FREE);\n left.prev = null;\n left.next = null;\n\n // tail is a zero-length used block\n var tail = changetype(start + size - Block.INFO);\n tail.info = 0 | LEFT_FREE;\n this.tailRef = changetype(tail);\n\n this.insert(left); // also merges with free left before tail / sets jump\n\n return true;\n }\n}\n\n/** Determines the first (LSB to MSB) set bit's index of a word. */\nfunction ffs(word: T): T {\n assert(word != 0); // word cannot be 0\n return ctz(word); // differs from ffs only for 0\n}\n\n/** Determines the last (LSB to MSB) set bit's index of a word. */\nfunction fls(word: T): T {\n assert(word != 0); // word cannot be 0\n const inv: T = (sizeof() << 3) - 1;\n return inv - clz(word);\n}\n\n/** Reference to the initialized {@link Root} structure, once initialized. */\nvar ROOT: Root = changetype(0);\n\n// Memory allocator interface\n\n/** Allocates a chunk of memory. */\n@global export function __memory_allocate(size: usize): usize {\n\n // initialize if necessary\n var root = ROOT;\n if (!root) {\n let rootOffset = (HEAP_BASE + AL_MASK) & ~AL_MASK;\n let pagesBefore = memory.size();\n let pagesNeeded = ((((rootOffset + Root.SIZE) + 0xffff) & ~0xffff) >>> 16);\n if (pagesNeeded > pagesBefore && memory.grow(pagesNeeded - pagesBefore) < 0) unreachable();\n ROOT = root = changetype(rootOffset);\n root.tailRef = 0;\n root.flMap = 0;\n for (let fl: usize = 0; fl < FL_BITS; ++fl) {\n root.setSLMap(fl, 0);\n for (let sl: u32 = 0; sl < SL_SIZE; ++sl) {\n root.setHead(fl, sl, null);\n }\n }\n root.addMemory((rootOffset + Root.SIZE + AL_MASK) & ~AL_MASK, memory.size() << 16);\n }\n\n // search for a suitable block\n if (size > Block.MAX_SIZE) unreachable();\n\n // 32-bit MAX_SIZE is 1 << 30 and itself aligned, hence the following can't overflow MAX_SIZE\n size = max((size + AL_MASK) & ~AL_MASK, Block.MIN_SIZE);\n\n var block = root.search(size);\n if (!block) {\n\n // request more memory\n let pagesBefore = memory.size();\n let pagesNeeded = (((size + 0xffff) & ~0xffff) >>> 16);\n let pagesWanted = max(pagesBefore, pagesNeeded); // double memory\n if (memory.grow(pagesWanted) < 0) {\n if (memory.grow(pagesNeeded) < 0) {\n unreachable(); // out of memory\n }\n }\n let pagesAfter = memory.size();\n root.addMemory(pagesBefore << 16, pagesAfter << 16);\n block = assert(root.search(size)); // must be found now\n }\n\n assert((block.info & ~TAGS) >= size);\n return root.use(block, size);\n}\n\n/** Frees the chunk of memory at the specified address. */\n@global export function __memory_free(data: usize): void {\n if (data) {\n let root = ROOT;\n if (root) {\n let block = changetype(data - Block.INFO);\n let blockInfo = block.info;\n assert(!(blockInfo & FREE)); // must be used\n block.info = blockInfo | FREE;\n root.insert(changetype(data - Block.INFO));\n }\n }\n}\n\n@global export function __memory_reset(): void {\n unreachable();\n}\n",array:'import {\n MAX_BLENGTH,\n HEADER_SIZE,\n allocateUnsafe,\n reallocateUnsafe,\n LOAD,\n STORE\n} from "./internal/arraybuffer";\n\nimport {\n allocateUnsafe as allocateUnsafeString,\n freeUnsafe as freeUnsafeString,\n copyUnsafe as copyUnsafeString\n} from "./internal/string";\n\nimport {\n COMPARATOR,\n SORT\n} from "./internal/sort";\n\nimport {\n itoa,\n dtoa,\n itoa_stream,\n dtoa_stream,\n MAX_DOUBLE_LENGTH\n} from "./internal/number";\n\nimport {\n isArray as builtin_isArray\n} from "./builtins";\n\nexport class Array {\n [key: number]: T; // compatibility only\n\n /* @internal */ buffer_: ArrayBuffer;\n /* @internal */ length_: i32;\n\n @inline static isArray(value: U): bool {\n return builtin_isArray(value) && value !== null;\n }\n\n constructor(length: i32 = 0) {\n const MAX_LENGTH = MAX_BLENGTH >>> alignof();\n if (length > MAX_LENGTH) throw new RangeError("Invalid array length");\n var byteLength = length << alignof();\n var buffer = allocateUnsafe(byteLength);\n this.buffer_ = buffer;\n this.length_ = length;\n memory.fill(\n changetype(buffer) + HEADER_SIZE,\n 0,\n byteLength\n );\n }\n\n @inline\n get length(): i32 {\n return this.length_;\n }\n\n set length(length: i32) {\n var buffer = this.buffer_;\n var capacity = buffer.byteLength >>> alignof();\n if (length > capacity) {\n const MAX_LENGTH = MAX_BLENGTH >>> alignof();\n if (length > MAX_LENGTH) throw new RangeError("Invalid array length");\n buffer = reallocateUnsafe(buffer, length << alignof());\n this.buffer_ = buffer;\n }\n this.length_ = length;\n }\n\n every(callbackfn: (element: T, index: i32, array: Array) => bool): bool {\n for (let index = 0, length = this.length_; index < min(length, this.length_); ++index) {\n if (!callbackfn(LOAD(this.buffer_, index), index, this)) return false;\n }\n return true;\n }\n\n findIndex(predicate: (element: T, index: i32, array: Array) => bool): i32 {\n for (let index = 0, length = this.length_; index < min(length, this.length_); ++index) {\n if (predicate(LOAD(this.buffer_, index), index, this)) return index;\n }\n return -1;\n }\n\n @operator("[]")\n private __get(index: i32): T {\n var buffer = this.buffer_;\n return index < (buffer.byteLength >>> alignof())\n ? LOAD(buffer, index)\n : unreachable();\n }\n\n @operator("{}")\n private __unchecked_get(index: i32): T {\n return LOAD(this.buffer_, index);\n }\n\n @operator("[]=")\n private __set(index: i32, value: T): void {\n var buffer = this.buffer_;\n var capacity = buffer.byteLength >>> alignof();\n if (index >= capacity) {\n const MAX_LENGTH = MAX_BLENGTH >>> alignof();\n if (index >= MAX_LENGTH) throw new Error("Invalid array length");\n buffer = reallocateUnsafe(buffer, (index + 1) << alignof());\n this.buffer_ = buffer;\n this.length_ = index + 1;\n }\n STORE(buffer, index, value);\n if (isManaged()) __gc_link(changetype(this), changetype(value)); // tslint:disable-line\n }\n\n @operator("{}=")\n private __unchecked_set(index: i32, value: T): void {\n STORE(this.buffer_, index, value);\n if (isManaged()) __gc_link(changetype(this), changetype(value)); // tslint:disable-line\n }\n\n fill(value: T, start: i32 = 0, end: i32 = i32.MAX_VALUE): this {\n var buffer = this.buffer_;\n var len = this.length_;\n\n start = start < 0 ? max(len + start, 0) : min(start, len);\n end = end < 0 ? max(len + end, 0) : min(end, len);\n\n if (sizeof() == 1) {\n if (start < end) {\n memory.fill(\n changetype(buffer) + start + HEADER_SIZE,\n value,\n (end - start)\n );\n }\n } else {\n for (; start < end; ++start) {\n STORE(buffer, start, value);\n }\n }\n return this;\n }\n\n @inline\n includes(searchElement: T, fromIndex: i32 = 0): bool {\n return this.indexOf(searchElement, fromIndex) >= 0;\n }\n\n indexOf(searchElement: T, fromIndex: i32 = 0): i32 {\n var length = this.length_;\n if (length == 0 || fromIndex >= length) return -1;\n if (fromIndex < 0) fromIndex = max(length + fromIndex, 0);\n var buffer = this.buffer_;\n while (fromIndex < length) {\n if (LOAD(buffer, fromIndex) == searchElement) return fromIndex;\n ++fromIndex;\n }\n return -1;\n }\n\n lastIndexOf(searchElement: T, fromIndex: i32 = this.length_): i32 {\n var length = this.length_;\n if (length == 0) return -1;\n if (fromIndex < 0) fromIndex = length + fromIndex; // no need to clamp\n else if (fromIndex >= length) fromIndex = length - 1;\n var buffer = this.buffer_;\n while (fromIndex >= 0) { // ^\n if (LOAD(buffer, fromIndex) == searchElement) return fromIndex;\n --fromIndex;\n }\n return -1;\n }\n\n push(element: T): i32 {\n var length = this.length_;\n var buffer = this.buffer_;\n var capacity = buffer.byteLength >>> alignof();\n var newLength = length + 1; // safe only if length is checked\n if (length >= capacity) {\n const MAX_LENGTH = MAX_BLENGTH >>> alignof();\n if (length >= MAX_LENGTH) throw new Error("Invalid array length");\n buffer = reallocateUnsafe(buffer, newLength << alignof());\n this.buffer_ = buffer;\n }\n this.length_ = newLength;\n STORE(buffer, length, element);\n if (isManaged()) __gc_link(changetype(this), changetype(element)); // tslint:disable-line\n return newLength;\n }\n\n concat(items: Array): Array {\n var thisLen = this.length_;\n var otherLen = select(0, items.length_, items === null);\n var outLen = thisLen + otherLen;\n var out = new Array(outLen);\n\n if (thisLen) {\n memory.copy(\n changetype(out.buffer_) + HEADER_SIZE,\n changetype(this.buffer_) + HEADER_SIZE,\n thisLen << alignof()\n );\n }\n if (otherLen) {\n memory.copy(\n changetype(out.buffer_) + HEADER_SIZE + (thisLen << alignof()),\n changetype(items.buffer_) + HEADER_SIZE,\n otherLen << alignof()\n );\n }\n return out;\n }\n\n copyWithin(target: i32, start: i32, end: i32 = i32.MAX_VALUE): this {\n var buffer = this.buffer_;\n var len = this.length_;\n\n end = min(end, len);\n var to = target < 0 ? max(len + target, 0) : min(target, len);\n var from = start < 0 ? max(len + start, 0) : min(start, len);\n var last = end < 0 ? max(len + end, 0) : min(end, len);\n var count = min(last - from, len - to);\n\n if (from < to && to < (from + count)) {\n from += count - 1;\n to += count - 1;\n while (count) {\n STORE(buffer, to, LOAD(buffer, from));\n --from, --to, --count;\n }\n } else {\n memory.copy(\n changetype(buffer) + HEADER_SIZE + (to << alignof()),\n changetype(buffer) + HEADER_SIZE + (from << alignof()),\n count << alignof()\n );\n }\n return this;\n }\n\n pop(): T {\n var length = this.length_;\n if (length < 1) throw new RangeError("Array is empty");\n var element = LOAD(this.buffer_, --length);\n this.length_ = length;\n return element;\n }\n\n forEach(callbackfn: (value: T, index: i32, array: Array) => void): void {\n for (let index = 0, length = this.length_; index < min(length, this.length_); ++index) {\n callbackfn(LOAD(this.buffer_, index), index, this);\n }\n }\n\n map(callbackfn: (value: T, index: i32, array: Array) => U): Array {\n var length = this.length_;\n var result = new Array(length);\n var buffer = result.buffer_;\n for (let index = 0; index < min(length, this.length_); ++index) {\n STORE(buffer, index, callbackfn(LOAD(this.buffer_, index), index, this));\n }\n return result;\n }\n\n filter(callbackfn: (value: T, index: i32, array: Array) => bool): Array {\n var result = new Array();\n for (let index = 0, length = this.length_; index < min(length, this.length_); ++index) {\n let value = LOAD(this.buffer_, index);\n if (callbackfn(value, index, this)) result.push(value);\n }\n return result;\n }\n\n reduce(\n callbackfn: (previousValue: U, currentValue: T, currentIndex: i32, array: Array) => U,\n initialValue: U\n ): U {\n var accum = initialValue;\n for (let index = 0, length = this.length_; index < min(length, this.length_); ++index) {\n accum = callbackfn(accum, LOAD(this.buffer_, index), index, this);\n }\n return accum;\n }\n\n reduceRight(\n callbackfn: (previousValue: U, currentValue: T, currentIndex: i32, array: Array) => U,\n initialValue: U\n ): U {\n var accum = initialValue;\n for (let index = this.length_ - 1; index >= 0; --index) {\n accum = callbackfn(accum, LOAD(this.buffer_, index), index, this);\n }\n return accum;\n }\n\n shift(): T {\n var length = this.length_;\n if (length < 1) throw new RangeError("Array is empty");\n var buffer = this.buffer_;\n var element = LOAD(buffer, 0);\n var lastIndex = length - 1;\n memory.copy(\n changetype(buffer) + HEADER_SIZE,\n changetype(buffer) + HEADER_SIZE + sizeof(),\n lastIndex << alignof()\n );\n STORE(buffer, lastIndex, null);\n this.length_ = lastIndex;\n return element;\n }\n\n some(callbackfn: (element: T, index: i32, array: Array) => bool): bool {\n for (let index = 0, length = this.length_; index < min(length, this.length_); ++index) {\n if (callbackfn(LOAD(this.buffer_, index), index, this)) return true;\n }\n return false;\n }\n\n unshift(element: T): i32 {\n var buffer = this.buffer_;\n var capacity = buffer.byteLength >>> alignof();\n var length = this.length_;\n var newLength = length + 1; // safe only if length is checked\n if (length >= capacity) {\n const MAX_LENGTH = MAX_BLENGTH >>> alignof();\n if (length >= MAX_LENGTH) throw new Error("Invalid array length");\n buffer = reallocateUnsafe(buffer, newLength << alignof());\n capacity = buffer.byteLength >>> alignof();\n this.buffer_ = buffer;\n }\n memory.copy(\n changetype(buffer) + HEADER_SIZE + sizeof(),\n changetype(buffer) + HEADER_SIZE,\n (capacity - 1) << alignof()\n );\n STORE(buffer, 0, element);\n this.length_ = newLength;\n if (isManaged()) __gc_link(changetype(this), changetype(element)); // tslint:disable-line\n return newLength;\n }\n\n slice(begin: i32 = 0, end: i32 = i32.MAX_VALUE): Array {\n var len = this.length_;\n begin = begin < 0 ? max(begin + len, 0) : min(begin, len);\n end = end < 0 ? max(end + len, 0) : min(end, len);\n len = max(end - begin, 0);\n var sliced = new Array(len);\n if (len) {\n memory.copy(\n changetype(sliced.buffer_) + HEADER_SIZE,\n changetype(this.buffer_) + HEADER_SIZE + (begin << alignof()),\n len << alignof()\n );\n }\n return sliced;\n }\n\n splice(start: i32, deleteCount: i32 = i32.MAX_VALUE): Array {\n var length = this.length_;\n start = start < 0 ? max(length + start, 0) : min(start, length);\n deleteCount = max(min(deleteCount, length - start), 0);\n var buffer = this.buffer_;\n var spliced = new Array(deleteCount);\n var source = changetype(buffer) + HEADER_SIZE + (start << alignof());\n memory.copy(\n changetype(spliced.buffer_) + HEADER_SIZE,\n source,\n deleteCount << alignof()\n );\n var offset = start + deleteCount;\n if (length != offset) {\n memory.copy(\n source,\n changetype(buffer) + HEADER_SIZE + (offset << alignof()),\n (length - offset) << alignof()\n );\n }\n this.length_ = length - deleteCount;\n return spliced;\n }\n\n reverse(): Array {\n var buffer = this.buffer_;\n for (let front = 0, back = this.length_ - 1; front < back; ++front, --back) {\n let temp = LOAD(buffer, front);\n STORE(buffer, front, LOAD(buffer, back));\n STORE(buffer, back, temp);\n }\n return this;\n }\n\n sort(comparator: (a: T, b: T) => i32 = COMPARATOR()): this {\n // TODO remove this when flow will allow trackcing null\n assert(comparator); // The comparison function must be a function\n\n var length = this.length_;\n if (length <= 1) return this;\n var buffer = this.buffer_;\n if (length == 2) {\n let a = LOAD(buffer, 1); // a = arr[1]\n let b = LOAD(buffer, 0); // b = arr[0]\n if (comparator(a, b) < 0) {\n STORE(buffer, 1, b); // arr[1] = b;\n STORE(buffer, 0, a); // arr[0] = a;\n }\n return this;\n }\n SORT(buffer, 0, length, comparator);\n return this;\n }\n\n join(separator: string = ","): string {\n var lastIndex = this.length_ - 1;\n if (lastIndex < 0) return "";\n var result = "";\n var value: T;\n var buffer = this.buffer_;\n var sepLen = separator.length;\n var hasSeparator = sepLen != 0;\n if (value instanceof bool) {\n if (!lastIndex) return select("true", "false", LOAD(buffer, 0));\n\n let valueLen = 5; // max possible length of element len("false")\n let estLen = (valueLen + sepLen) * lastIndex + valueLen;\n let result = allocateUnsafeString(estLen);\n let offset = 0;\n for (let i = 0; i < lastIndex; ++i) {\n value = LOAD(buffer, i);\n valueLen = 4 + (!value);\n copyUnsafeString(result, offset, select("true", "false", value), 0, valueLen);\n offset += valueLen;\n if (hasSeparator) {\n copyUnsafeString(result, offset, changetype(separator), 0, sepLen);\n offset += sepLen;\n }\n }\n value = LOAD(buffer, lastIndex);\n valueLen = 4 + (!value);\n copyUnsafeString(result, offset, select("true", "false", value), 0, valueLen);\n offset += valueLen;\n\n let out = result;\n if (estLen > offset) {\n out = result.substring(0, offset);\n freeUnsafeString(result);\n }\n return out;\n } else if (isInteger()) {\n if (!lastIndex) return changetype(itoa(LOAD(buffer, 0)));\n\n const valueLen = (sizeof() <= 4 ? 10 : 20) + isSigned();\n let estLen = (valueLen + sepLen) * lastIndex + valueLen;\n let result = allocateUnsafeString(estLen);\n let offset = 0;\n for (let i = 0; i < lastIndex; ++i) {\n value = LOAD(buffer, i);\n offset += itoa_stream(changetype(result), offset, value);\n if (hasSeparator) {\n copyUnsafeString(result, offset, separator, 0, sepLen);\n offset += sepLen;\n }\n }\n value = LOAD(buffer, lastIndex);\n offset += itoa_stream(changetype(result), offset, value);\n let out = result;\n if (estLen > offset) {\n out = result.substring(0, offset);\n freeUnsafeString(result);\n }\n return out;\n } else if (isFloat()) {\n if (!lastIndex) return changetype(dtoa(LOAD(buffer, 0)));\n\n const valueLen = MAX_DOUBLE_LENGTH;\n let estLen = (valueLen + sepLen) * lastIndex + valueLen;\n let result = allocateUnsafeString(estLen);\n let offset = 0;\n for (let i = 0; i < lastIndex; ++i) {\n value = LOAD(buffer, i);\n offset += dtoa_stream(changetype(result), offset, value);\n if (hasSeparator) {\n copyUnsafeString(result, offset, separator, 0, sepLen);\n offset += sepLen;\n }\n }\n value = LOAD(buffer, lastIndex);\n offset += dtoa_stream(changetype(result), offset, value);\n let out = result;\n if (estLen > offset) {\n out = result.substring(0, offset);\n freeUnsafeString(result);\n }\n return out;\n } else if (isString()) {\n if (!lastIndex) return LOAD(buffer, 0);\n\n let estLen = 0;\n for (let i = 0, len = lastIndex + 1; i < len; ++i) {\n estLen += LOAD(buffer, i).length;\n }\n let offset = 0;\n let result = allocateUnsafeString(estLen + sepLen * lastIndex);\n for (let i = 0; i < lastIndex; ++i) {\n value = LOAD(buffer, i);\n if (value) {\n let valueLen = value.length; // tslint:disable-line:no-unsafe-any\n copyUnsafeString(result, offset, value, 0, valueLen); // tslint:disable-line:no-unsafe-any\n offset += valueLen; // tslint:disable-line:no-unsafe-any\n }\n if (hasSeparator) {\n copyUnsafeString(result, offset, separator, 0, sepLen);\n offset += sepLen;\n }\n }\n value = LOAD(buffer, lastIndex);\n if (value) {\n let valueLen = value.length; // tslint:disable-line:no-unsafe-any\n copyUnsafeString(result, offset, value, 0, valueLen); // tslint:disable-line:no-unsafe-any\n }\n return result;\n } else if (isArray()) {\n if (!lastIndex) {\n value = LOAD(buffer, 0);\n return value ? value.join(separator) : ""; // tslint:disable-line:no-unsafe-any\n }\n for (let i = 0; i < lastIndex; ++i) {\n value = LOAD(buffer, i);\n if (value) result += value.join(separator); // tslint:disable-line:no-unsafe-any\n if (hasSeparator) result += separator;\n }\n value = LOAD(buffer, lastIndex);\n if (value) result += value.join(separator); // tslint:disable-line:no-unsafe-any\n return result;\n } else if (isReference()) { // References\n if (!lastIndex) return "[object Object]";\n const valueLen = 15; // max possible length of element len("[object Object]")\n let estLen = (valueLen + sepLen) * lastIndex + valueLen;\n let result = allocateUnsafeString(estLen);\n let offset = 0;\n for (let i = 0; i < lastIndex; ++i) {\n value = LOAD(buffer, i);\n if (value) {\n copyUnsafeString(result, offset, changetype("[object Object]"), 0, valueLen);\n offset += valueLen;\n }\n if (hasSeparator) {\n copyUnsafeString(result, offset, changetype(separator), 0, sepLen);\n offset += sepLen;\n }\n }\n if (LOAD(buffer, lastIndex)) {\n copyUnsafeString(result, offset, changetype("[object Object]"), 0, valueLen);\n offset += valueLen;\n }\n let out = result;\n if (estLen > offset) {\n out = result.substring(0, offset);\n freeUnsafeString(result);\n }\n return out;\n } else {\n assert(false); // Unsupported generic typename\n }\n }\n\n @inline\n toString(): string {\n return this.join();\n }\n\n private __gc(): void {\n var buffer = this.buffer_;\n __gc_mark(changetype(buffer)); // tslint:disable-line\n if (isManaged()) {\n let offset: usize = 0;\n let end = this.length_ << alignof();\n while (offset < end) {\n __gc_mark(load(changetype(buffer) + offset, HEADER_SIZE)); // tslint:disable-line\n offset += sizeof();\n }\n }\n }\n}\n',arraybuffer:'import {\n HEADER_SIZE,\n MAX_BLENGTH,\n allocateUnsafe\n} from "./internal/arraybuffer";\n\nimport {\n Uint8ClampedArray,\n Uint8Array,\n Int8Array,\n Uint16Array,\n Int16Array,\n Uint32Array,\n Int32Array,\n Uint64Array,\n Int64Array\n} from "./typedarray";\n\nimport {\n DataView\n} from "./dataview";\n\n@sealed\nexport class ArrayBuffer {\n\n readonly byteLength: i32; // capped to [0, MAX_LENGTH]\n\n @inline static isView(value: T): bool {\n if (value === null) return false;\n if (value instanceof Uint8ClampedArray) return true;\n if (value instanceof Uint8Array) return true;\n if (value instanceof Int8Array) return true;\n if (value instanceof Uint16Array) return true;\n if (value instanceof Int16Array) return true;\n if (value instanceof Uint32Array) return true;\n if (value instanceof Int32Array) return true;\n if (value instanceof Uint64Array) return true;\n if (value instanceof Int64Array) return true;\n if (value instanceof DataView) return true;\n return false;\n }\n\n // @unsafe\n @inline get data(): usize { return changetype(this) + HEADER_SIZE; }\n\n constructor(length: i32, unsafe: bool = false) {\n if (length > MAX_BLENGTH) throw new RangeError("Invalid array buffer length");\n var buffer = allocateUnsafe(length);\n if (!unsafe) memory.fill(changetype(buffer) + HEADER_SIZE, 0, length);\n return buffer;\n }\n\n slice(begin: i32 = 0, end: i32 = MAX_BLENGTH): ArrayBuffer {\n var len = this.byteLength;\n begin = begin < 0 ? max(len + begin, 0) : min(begin, len);\n end = end < 0 ? max(len + end, 0) : min(end, len);\n len = max(end - begin, 0);\n var buffer = allocateUnsafe(len);\n memory.copy(\n changetype(buffer) + HEADER_SIZE,\n changetype(this) + HEADER_SIZE + begin,\n len\n );\n return buffer;\n }\n\n toString(): string {\n return "[object ArrayBuffer]";\n }\n}\n',"bindings/Date":"export declare function UTC(\n // NOTE: Using i32 below saves us a f64.convert_s instruction and moves the responsibility for\n // converting the value to the WASM/JS boundary.\n year: i32,\n month: i32,\n day: i32,\n hour: i32,\n minute: i32,\n second: i32,\n millisecond: f64\n): f64;\nexport declare function now(): f64;\n","bindings/Math":"export declare const E: f64;\nexport declare const LN2: f64;\nexport declare const LN10: f64;\nexport declare const LOG2E: f64;\nexport declare const LOG10E: f64;\nexport declare const PI: f64;\nexport declare const SQRT1_2: f64;\nexport declare const SQRT2: f64;\n\nexport declare function abs(x: f64): f64;\nexport declare function acos(x: f64): f64;\nexport declare function acosh(x: f64): f64;\nexport declare function asin(x: f64): f64;\nexport declare function asinh(x: f64): f64;\nexport declare function atan(x: f64): f64;\nexport declare function atan2(y: f64, x: f64): f64;\nexport declare function atanh(x: f64): f64;\nexport declare function cbrt(x: f64): f64;\nexport declare function ceil(x: f64): f64;\nexport declare function clz32(x: f64): f64;\nexport declare function cos(x: f64): f64;\nexport declare function cosh(x: f64): f64;\nexport declare function exp(x: f64): f64;\nexport declare function expm1(x: f64): f64;\nexport declare function floor(x: f64): f64;\nexport declare function fround(x: f64): f32;\nexport declare function hypot(value1: f64, value2: f64): f64; // TODO: rest\nexport declare function imul(a: f64, b: f64): f64;\nexport declare function log(x: f64): f64;\nexport declare function log10(x: f64): f64;\nexport declare function log1p(x: f64): f64;\nexport declare function log2(x: f64): f64;\nexport declare function max(value1: f64, value2: f64): f64; // TODO: rest\nexport declare function min(value1: f64, value2: f64): f64; // TODO: rest\nexport declare function pow(base: f64, exponent: f64): f64;\nexport declare function random(): f64;\nexport declare function round(x: f64): f64;\nexport declare function sign(x: f64): f64;\nexport declare function sin(x: f64): f64;\nexport declare function sinh(x: f64): f64;\nexport declare function sqrt(x: f64): f64;\nexport declare function tan(x: f64): f64;\nexport declare function tanh(x: f64): f64;\nexport declare function trunc(x: f64): f64;\n","bindings/wasi_unstable":"// see: https://wasi.dev\n\n/* tslint:disable:max-line-length */\n\n// helper types to be more explicit\ntype char = u8;\ntype ptr = usize; // all pointers are usize'd\ntype struct = T; // structs are references already in AS\n\n/** Read command-line argument data. */\nexport declare function args_get(\n /** Input: Pointer to a buffer to write the argument pointers. */\n argv: ptr>,\n /** Input: Pointer to a buffer to write the argument string data. */\n argv_buf: ptr\n): errno;\n\n/** Return command-line argument data sizes. */\nexport declare function args_sizes_get(\n /** Output: Number of arguments. */\n argc: ptr,\n /** Output: Size of the argument string data. */\n argv_buf_size: ptr\n): errno;\n\n/** Return the resolution of a clock. */\nexport declare function clock_res_get(\n /** Input: The clock for which to return the resolution. */\n clock: clockid,\n /** Output: The resolution of the clock. */\n resolution: ptr\n): errno;\n\n/** Return the time value of a clock. */\nexport declare function clock_time_get(\n /** Input: Cock for which to return the time. */\n clock: clockid,\n /** Input: Maximum lag (exclusive) that the returned time value may have, compared to its actual value. */\n precision: timestamp,\n /** Output: Time value of the clock. */\n time: ptr\n): errno;\n\n/** Read environment variable data. */\nexport declare function environ_get(\n /** Input: Pointer to a buffer to write the environment variable pointers. */\n environ: ptr,\n /** Input: Pointer to a buffer to write the environment variable string data. */\n environ_buf: usize\n): errno;\n\n/** Return command-line argument data sizes. */\nexport declare function environ_sizes_get(\n /** Output: The number of environment variables. */\n environ_count: ptr,\n /** Output: The size of the environment variable string data. */\n environ_buf_size: ptr\n): errno;\n\n/** Provide file advisory information on a file descriptor. */\nexport declare function fd_advise(\n /** Input: The file descriptor for the file for which to provide file advisory information. */\n fd: fd,\n /** Input: The offset within the file to which the advisory applies. */\n offset: filesize,\n /** Input: The length of the region to which the advisory applies. */\n len: filesize,\n /** Input: The advice. */\n advice: advice\n): errno;\n\n/** Provide file advisory information on a file descriptor. */\nexport declare function fd_allocate(\n /** Input: The file descriptor for the file in which to allocate space. */\n fd: fd,\n /** Input: The offset at which to start the allocation. */\n offset: filesize,\n /** Input: The length of the area that is allocated. */\n len: filesize\n): errno;\n\n/** Close a file descriptor. */\nexport declare function fd_close(\n /** Input: The file descriptor to close. */\n fd: fd\n): errno;\n\n/** Synchronize the data of a file to disk. */\nexport declare function fd_datasync(\n /** Input: The file descriptor of the file to synchronize to disk. */\n fd: fd\n): errno;\n\n/** Get the attributes of a file descriptor. */\nexport declare function fd_fdstat_get(\n /** Input: The file descriptor to inspect. */\n fd: fd,\n /** Input: The buffer where the file descriptor's attributes are stored. */\n buf: struct\n): errno;\n\n/** Adjust the flags associated with a file descriptor. */\nexport declare function fd_fdstat_set_flags(\n /** Input: The file descriptor to operate on. */\n fd: fd,\n /** Input: The desired values of the file descriptor flags. */\n flags: fdflags\n): errno;\n\n/** Adjust the rights associated with a file descriptor. */\nexport declare function fd_fdstat_set_rights(\n /** Input: The file descriptor to operate on. */\n fd: fd,\n /** Input: The desired rights of the file descriptor. */\n fs_rights_base: rights,\n /** Input: The desired rights of the file descriptor. */\n fs_rights_inheriting: rights\n): errno;\n\n/** Return the attributes of an open file. */\nexport declare function fd_filestat_get(\n /** Input: The file descriptor to inspect. */\n fd: fd,\n /** Input: The buffer where the file's attributes are stored. */\n buf: struct\n): errno;\n\n/** Adjust the size of an open file. If this increases the file's size, the extra bytes are filled with zeros. */\nexport declare function fd_filestat_set_size(\n /** Input: A file descriptor for the file to adjust. */\n fd: fd,\n /** Input: The desired file size. */\n size: filesize\n): errno;\n\n/** Adjust the timestamps of an open file or directory. */\nexport declare function fd_filestat_set_times(\n /** Input: The file descriptor to operate on. */\n fd: fd,\n /** Input: The desired values of the data access timestamp. */\n st_atim: timestamp,\n /** Input: The desired values of the data modification timestamp. */\n st_mtim: timestamp,\n /** Input: A bitmask indicating which timestamps to adjust. */\n fstflags: fstflags\n): errno;\n\n/** Read from a file descriptor, without using and updating the file descriptor's offset. */\nexport declare function fd_pread(\n /** Input: The file descriptor from which to read data. */\n fd: fd,\n /** Input: List of scatter/gather vectors in which to store data. */\n iovs: ptr>,\n /** Input: Length of the list of scatter/gather vectors in which to store data. */\n iovs_len: usize,\n /** Input: The offset within the file at which to read. */\n offset: filesize,\n /** Output: The number of bytes read. */\n nread: ptr\n): errno;\n\n/** Return a description of the given preopened file descriptor. */\nexport declare function fd_prestat_get(\n /** Input: The file descriptor about which to retrieve information. */\n fd: fd,\n /** Input: The buffer where the description is stored. */\n buf: struct\n): errno;\n\n/** Return a description of the given preopened file descriptor. */\nexport declare function fd_prestat_dir_name(\n /** Input: The file descriptor about which to retrieve information. */\n fd: fd,\n /** Input: Buffer into which to write the preopened directory name. */\n path: ptr,\n /** Input: Length of the buffer into which to write the preopened directory name. */\n path_len: usize\n): errno;\n\n/** Write to a file descriptor, without using and updating the file descriptor's offset. */\nexport declare function fd_pwrite(\n /** Input: The file descriptor to which to write data. */\n fd: fd,\n /** Input: List of scatter/gather vectors from which to retrieve data. */\n iovs: ptr>,\n /** Input: Length of the list of scatter/gather vectors from which to retrieve data. */\n iovs_len: usize,\n /** Input: The offset within the file at which to write. */\n offset: filesize,\n /** Output: The number of bytes written. */\n nwritten: ptr\n): errno;\n\n/** Read from a file descriptor. */\nexport declare function fd_read(\n /** Input: The file descriptor from which to read data. */\n fd: fd,\n /** Input: List of scatter/gather vectors to which to store data. */\n iovs: ptr>,\n /** Input: Length of the list of scatter/gather vectors to which to store data. */\n iovs_len: usize,\n /** Output: The number of bytes read. */\n nread: ptr\n): errno;\n\n/** Read directory entries from a directory. */\nexport declare function fd_readdir(\n /** Input: Directory from which to read the directory entries. */\n fd: fd,\n /** Input: Buffer where directory entries are stored. */\n buf: ptr>,\n /** Input: Length of the buffer where directory entries are stored. */\n buf_len: usize,\n /** Input: Location within the directory to start reading. */\n cookie: dircookie,\n /** Output: Number of bytes stored in the read buffer. If less than the size of the read buffer, the end of the directory has been reached. */\n buf_used: ptr\n): errno;\n\n/** Atomically replace a file descriptor by renumbering another file descriptor. */\nexport declare function fd_renumber(\n /** Input: The file descriptor to renumber. */\n from: fd,\n /** Input: The file descriptor to overwrite. */\n to: fd\n): errno;\n\n/** Move the offset of a file descriptor. */\nexport declare function fd_seek(\n /** Input: The file descriptor to operate on. */\n fd: fd,\n /** Input: The number of bytes to move. */\n offset: filedelta,\n /** Input: The base from which the offset is relative. */\n whence: whence,\n /** Output: The new offset of the file descriptor, relative to the start of the file. */\n newoffset: ptr\n): errno;\n\n/** Synchronize the data and metadata of a file to disk. */\nexport declare function fd_sync(\n /** Input: The file descriptor of the file containing the data and metadata to synchronize to disk. */\n fd: fd\n): errno;\n\n/** Return the current offset of a file descriptor. */\nexport declare function fd_tell(\n /** Input: The file descriptor to inspect. */\n fd: fd,\n /** Output: The current offset of the file descriptor, relative to the start of the file. */\n newoffset: ptr\n): errno;\n\n/** Write to a file descriptor. */\nexport declare function fd_write(\n /** Input: The file descriptor to which to write data. */\n fd: fd,\n /** Input: List of scatter/gather vectors from which to retrieve data. */\n iovs: ptr>,\n /** Input: List of scatter/gather vectors from which to retrieve data. */\n iovs_len: usize,\n /** Output: The number of bytes written. */\n nwritten: ptr\n): errno;\n\n/* Create a directory. */\nexport declare function path_create_directory(\n /** Input: The working directory at which the resolution of the path starts. */\n fd: fd,\n /** Input: The path at which to create the directory. */\n path: ptr,\n /** Input: The path at which to create the directory. */\n path_len: usize\n): errno;\n\n/** Return the attributes of a file or directory. */\nexport declare function path_filestat_get(\n /** Input: The working directory at which the resolution of the path starts. */\n fd: fd,\n /** Input: Flags determining the method of how the path is resolved. */\n flags: lookupflags,\n /** Input: The path of the file or directory to inspect. */\n path: ptr,\n /** Input: The path of the file or directory to inspect. */\n path_len: usize,\n /** Input: The buffer where the file's attributes are stored. */\n buf: struct\n): errno;\n\n/** Adjust the timestamps of a file or directory. */\nexport declare function path_filestat_set_times(\n /** Input: The working directory at which the resolution of the path starts. */\n fd: fd,\n /** Input: Flags determining the method of how the path is resolved. */\n flags: lookupflags,\n /** Input: The path of the file or directory to operate on. */\n path: ptr,\n /** Input: The path of the file or directory to operate on. */\n path_len: usize,\n /** Input: The desired values of the data access timestamp. */\n st_atim: timestamp,\n /** Input: The desired values of the data modification timestamp. */\n st_mtim: timestamp,\n /** Input: A bitmask indicating which timestamps to adjust. */\n fstflags: fstflags\n): errno;\n\n/** Create a hard link. */\nexport declare function path_link(\n /** Input: The working directory at which the resolution of the old path starts. */\n old_fd: fd,\n /** Input: Flags determining the method of how the path is resolved. */\n old_flags: lookupflags,\n /** Input: The source path from which to link. */\n old_path: ptr,\n /** Input: The source path from which to link. */\n old_path_len: usize,\n /** Input: The working directory at which the resolution of the new path starts. */\n new_fd: fd,\n /** Input: The destination path at which to create the hard link. */\n new_path: ptr,\n /** Input: The length of the destination path at which to create the hard link. */\n new_path_len: usize\n): errno;\n\n/** Open a file or directory. */\nexport declare function path_open(\n /** Input: The working directory at which the resolution of the path starts. */\n dirfd: fd,\n /** Input: Flags determining the method of how the path is resolved. */\n dirflags: lookupflags,\n /** Input: The path of the file or directory to open. */\n path: ptr,\n /** Input: The length of the path of the file or directory to open. */\n path_len: usize,\n /** Input: The method by which to open the file. */\n oflags: oflags,\n /** Input: The initial base rights that apply to operations using the file descriptor itself. */\n fs_rights_base: rights,\n /** Input: The initial inheriting rights that apply to file descriptors derived from it. */\n fs_rights_inheriting: rights,\n /** Input: The initial flags of the file descriptor. */\n fs_flags: fdflags,\n /** Output: The file descriptor of the file that has been opened. */\n fd: ptr\n): errno;\n\n/** Read the contents of a symbolic link. */\nexport declare function path_readlink(\n /** Input: The working directory at which the resolution of the path starts. */\n fd: fd,\n /** Input: The path of the symbolic link from which to read. */\n path: ptr,\n /** Input: The length of the path of the symbolic link from which to read. */\n path_len: usize,\n /** Input: The buffer to which to write the contents of the symbolic link. */\n buf: ptr,\n /** Input: The length of the buffer to which to write the contents of the symbolic link. */\n buf_len: usize,\n /** Output: The number of bytes placed in the buffer. */\n buf_used: ptr\n): errno;\n\n/** Remove a directory. */\nexport declare function path_remove_directory(\n /** Input: The working directory at which the resolution of the path starts. */\n fd: fd,\n /** Input: The path to a directory to remove. */\n path: ptr,\n /** Input: The length of the path to a directory to remove. */\n path_len: usize\n): errno;\n\n/** Rename a file or directory. */\nexport declare function path_rename(\n /** Input: The working directory at which the resolution of the old path starts. */\n old_fd: fd,\n /** Input: The source path of the file or directory to rename. */\n old_path: ptr,\n /** Input: The length of the source path of the file or directory to rename. */\n old_path_len: usize,\n /** Input: The working directory at which the resolution of the new path starts. */\n new_fd: fd,\n /** Input: The destination path to which to rename the file or directory. */\n new_path: ptr,\n /** Input: The length of the destination path to which to rename the file or directory. */\n new_path_len: usize\n): errno;\n\n/** Create a symbolic link. */\nexport declare function path_symlink(\n /** Input: The contents of the symbolic link. */\n old_path: ptr,\n /** Input: The length of the contents of the symbolic link. */\n old_path_len: usize,\n /** Input: The working directory at which the resolution of the path starts. */\n fd: fd,\n /** Input: The destination path at which to create the symbolic link. */\n new_path: ptr,\n /** Input: The length of the destination path at which to create the symbolic link. */\n new_path_len: usize\n): errno;\n\n/** Unlink a file. */\nexport declare function path_unlink_file(\n /** Input: The working directory at which the resolution of the path starts. */\n fd: fd,\n /** Input: The path to a file to unlink. */\n path: ptr,\n /** Input: The length of the path to a file to unlink. */\n path_len: usize\n): errno;\n\n/** Concurrently poll for the occurrence of a set of events. */\nexport declare function poll_oneoff(\n /** Input: The events to which to subscribe. */\n in_: ptr>,\n /** Input: The events that have occurred. */\n out: ptr>,\n /** Input: Both the number of subscriptions and events. */\n nsubscriptions: usize,\n /** Output: The number of events stored. */\n nevents: ptr\n): errno;\n\n/** Terminate the process normally. An exit code of 0 indicates successful termination of the program. The meanings of other values is dependent on the environment. */\nexport declare function proc_exit(\n /** Input: The exit code returned by the process. */\n rval: u32\n): void;\n\n/** Send a signal to the process of the calling thread. */\nexport declare function proc_raise(\n /** Input: The signal condition to trigger. */\n sig: signal\n): errno;\n\n/** Write high-quality random data into a buffer. */\nexport declare function random_get(\n /** Input: The buffer to fill with random data. */\n buf: usize,\n /** Input: The length of the buffer to fill with random data. */\n buf_len: usize\n): errno;\n\n/** Temporarily yield execution of the calling thread. */\nexport declare function sched_yield(): errno;\n\n/** Receive a message from a socket. */\nexport declare function sock_recv(\n /** Input: The socket on which to receive data. */\n sock: fd,\n /** Input: List of scatter/gather vectors to which to store data. */\n ri_data: ptr>,\n /** Input: The length of the list of scatter/gather vectors to which to store data. */\n ri_data_len: usize,\n /** Input: Message flags. */\n ri_flags: riflags,\n /** Output: Number of bytes stored in `ri_data`. */\n ro_datalen: ptr,\n /** Output: Message flags. */\n ro_flags: ptr\n): errno;\n\n/** Send a message on a socket. */\nexport declare function sock_send(\n /** Input: The socket on which to send data. */\n sock: fd,\n /** Input: List of scatter/gather vectors to which to retrieve data */\n si_data: ptr>,\n /** Input: The length of the list of scatter/gather vectors to which to retrieve data */\n si_data_len: usize,\n /** Input: Message flags. */\n si_flags: siflags,\n /** Output: Number of bytes transmitted. */\n so_datalen: ptr\n): errno;\n\n/** Shut down socket send and receive channels. */\nexport declare function sock_shutdown(\n /** Input: The socket on which to shutdown channels. */\n sock: fd,\n /** Input: Which channels on the socket to shut down. */\n how: sdflags\n): errno;\n\n// === Types ======================================================================================\n\n/** File or memory access pattern advisory information. */\nexport namespace advice {\n /** The application has no advice to give on its behavior with respect to the specified data. */\n // @ts-ignore: decorator\n @inline\n export const NORMAL: advice = 0;\n /** The application expects to access the specified data sequentially from lower offsets to higher offsets. */\n // @ts-ignore: decorator\n @inline\n export const SEQUENTIAL : advice = 1;\n /** The application expects to access the specified data in a random order. */\n // @ts-ignore: decorator\n @inline\n export const RANDOM: advice = 2;\n /** The application expects to access the specified data in the near future. */\n // @ts-ignore: decorator\n @inline\n export const WILLNEED: advice = 3;\n /** The application expects that it will not access the specified data in the near future. */\n // @ts-ignore: decorator\n @inline\n export const DONTNEED: advice = 4;\n /** The application expects to access the specified data once and then not reuse it thereafter. */\n // @ts-ignore: decorator\n @inline\n export const NOREUSE: advice = 5;\n}\nexport type advice = u8;\n\n/** Identifiers for clocks. */\nexport namespace clockid {\n /** The clock measuring real time. Time value zero corresponds with 1970-01-01T00:00:00Z. */\n // @ts-ignore: decorator\n @inline\n export const REALTIME: clockid = 0;\n /** The store-wide monotonic clock. Absolute value has no meaning. */\n // @ts-ignore: decorator\n @inline\n export const MONOTONIC: clockid = 1;\n /** The CPU-time clock associated with the current process. */\n // @ts-ignore: decorator\n @inline\n export const PROCESS_CPUTIME_ID: clockid = 2;\n /** The CPU-time clock associated with the current thread. */\n // @ts-ignore: decorator\n @inline\n export const THREAD_CPUTIME_ID: clockid = 3;\n}\nexport type clockid = u32;\n\n/** Identifier for a device containing a file system. Can be used in combination with `inode` to uniquely identify a file or directory in the filesystem. */\nexport type device = u64;\n\n/** A reference to the offset of a directory entry. */\nexport type dircookie = u64;\n\n/** A directory entry. */\n@unmanaged export class dirent {\n /** The offset of the next directory entry stored in this directory. */\n next: dircookie;\n /** The serial number of the file referred to by this directory entry. */\n ino: inode;\n /** The length of the name of the directory entry. */\n namlen: u32;\n /** The type of the file referred to by this directory entry. */\n type: filetype;\n private __padding0: u16;\n}\n\n/** Error codes returned by functions. */\nexport namespace errno {\n /** No error occurred. System call completed successfully. */\n // @ts-ignore: decorator\n @inline\n export const SUCCESS: errno = 0;\n /** Argument list too long. */\n // @ts-ignore: decorator\n @inline\n export const TOOBIG: errno = 1;\n /** Permission denied. */\n // @ts-ignore: decorator\n @inline\n export const ACCES: errno = 2;\n /** Address in use. */\n // @ts-ignore: decorator\n @inline\n export const ADDRINUSE: errno = 3;\n /** Address not available. */\n // @ts-ignore: decorator\n @inline\n export const ADDRNOTAVAIL: errno = 4;\n /** Address family not supported. */\n // @ts-ignore: decorator\n @inline\n export const AFNOSUPPORT: errno = 5;\n /** Resource unavailable, or operation would block. */\n // @ts-ignore: decorator\n @inline\n export const AGAIN: errno = 6;\n /** Connection already in progress. */\n // @ts-ignore: decorator\n @inline\n export const ALREADY: errno = 7;\n /** Bad file descriptor. */\n // @ts-ignore: decorator\n @inline\n export const BADF: errno = 8;\n /** Bad message. */\n // @ts-ignore: decorator\n @inline\n export const BADMSG: errno = 9;\n /** Device or resource busy. */\n // @ts-ignore: decorator\n @inline\n export const BUSY: errno = 10;\n /** Operation canceled. */\n // @ts-ignore: decorator\n @inline\n export const CANCELED: errno = 11;\n /** No child processes. */\n // @ts-ignore: decorator\n @inline\n export const CHILD: errno = 12;\n /** Connection aborted. */\n // @ts-ignore: decorator\n @inline\n export const CONNABORTED: errno = 13;\n /** Connection refused. */\n // @ts-ignore: decorator\n @inline\n export const CONNREFUSED: errno = 14;\n /** Connection reset. */\n // @ts-ignore: decorator\n @inline\n export const CONNRESET: errno = 15;\n /** Resource deadlock would occur. */\n // @ts-ignore: decorator\n @inline\n export const DEADLK: errno = 16;\n /** Destination address required. */\n // @ts-ignore: decorator\n @inline\n export const DESTADDRREQ: errno = 17;\n /** Mathematics argument out of domain of function. */\n // @ts-ignore: decorator\n @inline\n export const DOM: errno = 18;\n /** Reserved. */\n // @ts-ignore: decorator\n @inline\n export const DQUOT: errno = 19;\n /** File exists. */\n // @ts-ignore: decorator\n @inline\n export const EXIST: errno = 20;\n /** Bad address. */\n // @ts-ignore: decorator\n @inline\n export const FAULT: errno = 21;\n /** File too large. */\n // @ts-ignore: decorator\n @inline\n export const FBIG: errno = 22;\n /** Host is unreachable. */\n // @ts-ignore: decorator\n @inline\n export const HOSTUNREACH: errno = 23;\n /** Identifier removed. */\n // @ts-ignore: decorator\n @inline\n export const IDRM: errno = 24;\n /** Illegal byte sequence. */\n // @ts-ignore: decorator\n @inline\n export const ILSEQ: errno = 25;\n /** Operation in progress. */\n // @ts-ignore: decorator\n @inline\n export const INPROGRESS: errno = 26;\n /** Interrupted function. */\n // @ts-ignore: decorator\n @inline\n export const INTR: errno = 27;\n /** Invalid argument. */\n // @ts-ignore: decorator\n @inline\n export const INVAL: errno = 28;\n /** I/O error. */\n // @ts-ignore: decorator\n @inline\n export const IO: errno = 29;\n /** Socket is connected. */\n // @ts-ignore: decorator\n @inline\n export const ISCONN: errno = 30;\n /** Is a directory. */\n // @ts-ignore: decorator\n @inline\n export const ISDIR: errno = 31;\n /** Too many levels of symbolic links. */\n // @ts-ignore: decorator\n @inline\n export const LOOP: errno = 32;\n /** File descriptor value too large. */\n // @ts-ignore: decorator\n @inline\n export const MFILE: errno = 33;\n /** Too many links. */\n // @ts-ignore: decorator\n @inline\n export const MLINK: errno = 34;\n /** Message too large. */\n // @ts-ignore: decorator\n @inline\n export const MSGSIZE: errno = 35;\n /** Reserved. */\n // @ts-ignore: decorator\n @inline\n export const MULTIHOP: errno = 36;\n /** Filename too long. */\n // @ts-ignore: decorator\n @inline\n export const NAMETOOLONG: errno = 37;\n /** Network is down. */\n // @ts-ignore: decorator\n @inline\n export const NETDOWN: errno = 38;\n /** Connection aborted by network. */\n // @ts-ignore: decorator\n @inline\n export const NETRESET: errno = 39;\n /** Network unreachable. */\n // @ts-ignore: decorator\n @inline\n export const NETUNREACH: errno = 40;\n /** Too many files open in system. */\n // @ts-ignore: decorator\n @inline\n export const NFILE: errno = 41;\n /** No buffer space available. */\n // @ts-ignore: decorator\n @inline\n export const NOBUFS: errno = 42;\n /** No such device. */\n // @ts-ignore: decorator\n @inline\n export const NODEV: errno = 43;\n /** No such file or directory. */\n // @ts-ignore: decorator\n @inline\n export const NOENT: errno = 44;\n /** Executable file format error. */\n // @ts-ignore: decorator\n @inline\n export const NOEXEC: errno = 45;\n /** No locks available. */\n // @ts-ignore: decorator\n @inline\n export const NOLCK: errno = 46;\n /** Reserved. */\n // @ts-ignore: decorator\n @inline\n export const NOLINK: errno = 47;\n /** Not enough space. */\n // @ts-ignore: decorator\n @inline\n export const NOMEM: errno = 48;\n /** No message of the desired type. */\n // @ts-ignore: decorator\n @inline\n export const NOMSG: errno = 49;\n /** Protocol not available. */\n // @ts-ignore: decorator\n @inline\n export const NOPROTOOPT: errno = 50;\n /** No space left on device. */\n // @ts-ignore: decorator\n @inline\n export const NOSPC: errno = 51;\n /** Function not supported. */\n // @ts-ignore: decorator\n @inline\n export const NOSYS: errno = 52;\n /** The socket is not connected. */\n // @ts-ignore: decorator\n @inline\n export const NOTCONN: errno = 53;\n /** Not a directory or a symbolic link to a directory. */\n // @ts-ignore: decorator\n @inline\n export const NOTDIR: errno = 54;\n /** Directory not empty. */\n // @ts-ignore: decorator\n @inline\n export const NOTEMPTY: errno = 55;\n /** State not recoverable. */\n // @ts-ignore: decorator\n @inline\n export const NOTRECOVERABLE: errno = 56;\n /** Not a socket. */\n // @ts-ignore: decorator\n @inline\n export const NOTSOCK: errno = 57;\n /** Not supported, or operation not supported on socket. */\n // @ts-ignore: decorator\n @inline\n export const NOTSUP: errno = 58;\n /** Inappropriate I/O control operation. */\n // @ts-ignore: decorator\n @inline\n export const NOTTY: errno = 59;\n /** No such device or address. */\n // @ts-ignore: decorator\n @inline\n export const NXIO: errno = 60;\n /** Value too large to be stored in data type. */\n // @ts-ignore: decorator\n @inline\n export const OVERFLOW: errno = 61;\n /** Previous owner died. */\n // @ts-ignore: decorator\n @inline\n export const OWNERDEAD: errno = 62;\n /** Operation not permitted. */\n // @ts-ignore: decorator\n @inline\n export const PERM: errno = 63;\n /** Broken pipe. */\n // @ts-ignore: decorator\n @inline\n export const PIPE: errno = 64;\n /** Protocol error. */\n // @ts-ignore: decorator\n @inline\n export const PROTO: errno = 65;\n /** Protocol not supported. */\n // @ts-ignore: decorator\n @inline\n export const PROTONOSUPPORT: errno = 66;\n /** Protocol wrong type for socket. */\n // @ts-ignore: decorator\n @inline\n export const PROTOTYPE: errno = 67;\n /** Result too large. */\n // @ts-ignore: decorator\n @inline\n export const RANGE: errno = 68;\n /** Read-only file system. */\n // @ts-ignore: decorator\n @inline\n export const ROFS: errno = 69;\n /** Invalid seek. */\n // @ts-ignore: decorator\n @inline\n export const SPIPE: errno = 70;\n /** No such process. */\n // @ts-ignore: decorator\n @inline\n export const SRCH: errno = 71;\n /** Reserved. */\n // @ts-ignore: decorator\n @inline\n export const STALE: errno = 72;\n /** Connection timed out. */\n // @ts-ignore: decorator\n @inline\n export const TIMEDOUT: errno = 73;\n /** Text file busy. */\n // @ts-ignore: decorator\n @inline\n export const TXTBSY: errno = 74;\n /** Cross-device link. */\n // @ts-ignore: decorator\n @inline\n export const XDEV: errno = 75;\n /** Extension: Capabilities insufficient. */\n // @ts-ignore: decorator\n @inline\n export const NOTCAPABLE: errno = 76;\n}\nexport type errno = u16;\n\n/** An event that occurred. */\n@unmanaged export abstract class event {\n /** User-provided value that got attached to `subscription#userdata`. */\n userdata: userdata;\n /** If non-zero, an error that occurred while processing the subscription request. */\n error: errno;\n /* The type of the event that occurred. */\n type: eventtype;\n private __padding0: u16;\n}\n\n/** An event that occurred when type is `eventtype.FD_READ` or `eventtype.FD_WRITE`. */\n@unmanaged export class rwevent extends event {\n /* The number of bytes available for reading or writing. */\n nbytes: filesize;\n /* The state of the file descriptor. */\n flags: eventrwflags;\n private __padding1: u32;\n}\n\n/** The state of the file descriptor subscribed to with `eventtype.FD_READ` or `eventtype.FD_WRITE`. */\nexport namespace eventrwflags {\n /** The peer of this socket has closed or disconnected. */\n // @ts-ignore: decorator\n @inline\n export const HANGUP: eventrwflags = 1;\n}\nexport type eventrwflags = u16;\n\n/** Type of a subscription to an event or its occurrence. */\nexport namespace eventtype {\n /** The time value of clock has reached the timestamp. */\n // @ts-ignore: decorator\n @inline\n export const CLOCK: eventtype = 0;\n /** File descriptor has data available for reading. */\n // @ts-ignore: decorator\n @inline\n export const FD_READ: eventtype = 1;\n /** File descriptor has capacity available for writing */\n // @ts-ignore: decorator\n @inline\n export const FD_WRITE: eventtype = 2;\n}\nexport type eventtype = u8;\n\n/** Exit code generated by a process when exiting. */\nexport type exitcode = u32;\n\n/** A file descriptor number. */\nexport type fd = u32;\n\n/** File descriptor flags. */\nexport namespace fdflags {\n /** Append mode: Data written to the file is always appended to the file's end. */\n // @ts-ignore: decorator\n @inline\n export const APPEND: fdflags = 1;\n /** Write according to synchronized I/O data integrity completion. Only the data stored in the file is synchronized. */\n // @ts-ignore: decorator\n @inline\n export const DSYNC: fdflags = 2;\n /** Non-blocking mode. */\n // @ts-ignore: decorator\n @inline\n export const NONBLOCK: fdflags = 4;\n /** Synchronized read I/O operations. */\n // @ts-ignore: decorator\n @inline\n export const RSYNC: fdflags = 8;\n /** Write according to synchronized I/O file integrity completion. */\n // @ts-ignore: decorator\n @inline\n export const SYNC: fdflags = 16;\n}\nexport type fdflags = u16;\n\n/** File descriptor attributes. */\n@unmanaged export class fdstat {\n /** File type. */\n filetype: filetype;\n /** File descriptor flags. */\n flags: fdflags;\n /** Rights that apply to this file descriptor. */\n rights_base: rights;\n /** Maximum set of rights that may be installed on new file descriptors that are created through this file descriptor, e.g., through `path_open`. */\n rights_inheriting: rights;\n}\n\n/** Relative offset within a file. */\nexport type filedelta = i64;\n\n/** Non-negative file size or length of a region within a file. */\nexport type filesize = u64;\n\n/** File attributes. */\n@unmanaged export class filestat {\n /** Device ID of device containing the file. */\n dev: device;\n /** File serial number. */\n ino: inode;\n /** File type. */\n filetype: filetype;\n /** Number of hard links to the file. */\n nlink: linkcount;\n /** For regular files, the file size in bytes. For symbolic links, the length in bytes of the pathname contained in the symbolic link. */\n size: filesize;\n /** Last data access timestamp. */\n atim: timestamp;\n /** Last data modification timestamp. */\n mtim: timestamp;\n /** Last file status change timestamp. */\n ctim: timestamp;\n}\n\n/** The type of a file descriptor or file. */\nexport namespace filetype {\n /** The type of the file descriptor or file is unknown or is different from any of the other types specified. */\n // @ts-ignore: decorator\n @inline\n export const UNKNOWN: filetype = 0;\n /** The file descriptor or file refers to a block device inode. */\n // @ts-ignore: decorator\n @inline\n export const BLOCK_DEVICE: filetype = 1;\n /** The file descriptor or file refers to a character device inode. */\n // @ts-ignore: decorator\n @inline\n export const CHARACTER_DEVICE: filetype = 2;\n /** The file descriptor or file refers to a directory inode. */\n // @ts-ignore: decorator\n @inline\n export const DIRECTORY: filetype = 3;\n /** The file descriptor or file refers to a regular file inode. */\n // @ts-ignore: decorator\n @inline\n export const REGULAR_FILE: filetype = 4;\n /** The file descriptor or file refers to a datagram socket. */\n // @ts-ignore: decorator\n @inline\n export const SOCKET_DGRAM: filetype = 5;\n /** The file descriptor or file refers to a byte-stream socket. */\n // @ts-ignore: decorator\n @inline\n export const SOCKET_STREAM: filetype = 6;\n /** The file refers to a symbolic link inode. */\n // @ts-ignore: decorator\n @inline\n export const SYMBOLIC_LINK: filetype = 7;\n}\nexport type filetype = u8;\n\n/** Which file time attributes to adjust. */\nexport namespace fstflags {\n /** Adjust the last data access timestamp to the value stored in `filestat#st_atim`. */\n // @ts-ignore: decorator\n @inline\n export const SET_ATIM: fstflags = 1;\n /** Adjust the last data access timestamp to the time of clock `clockid.REALTIME`. */\n // @ts-ignore: decorator\n @inline\n export const SET_ATIM_NOW: fstflags = 2;\n /** Adjust the last data modification timestamp to the value stored in `filestat#st_mtim`. */\n // @ts-ignore: decorator\n @inline\n export const SET_MTIM: fstflags = 4;\n /** Adjust the last data modification timestamp to the time of clock `clockid.REALTIME`. */\n // @ts-ignore: decorator\n @inline\n export const SET_MTIM_NOW: fstflags = 8;\n}\nexport type fstflags = u16;\n\n/** File serial number that is unique within its file system. */\nexport type inode = u64;\n\n/** A region of memory for scatter/gather reads. */\n@unmanaged export class iovec {\n /** The address of the buffer to be filled. */\n buf: usize;\n /** The length of the buffer to be filled. */\n buf_len: usize;\n}\n\n/** Number of hard links to an inode. */\nexport type linkcount = u32;\n\n/** Flags determining the method of how paths are resolved. */\nexport namespace lookupflags {\n /** As long as the resolved path corresponds to a symbolic link, it is expanded. */\n // @ts-ignore: decorator\n @inline\n export const SYMLINK_FOLLOW: lookupflags = 1;\n}\nexport type lookupflags = u32;\n\n/** Open flags. */\nexport namespace oflags {\n /** Create file if it does not exist. */\n // @ts-ignore: decorator\n @inline\n export const CREAT: oflags = 1;\n /** Fail if not a directory. */\n // @ts-ignore: decorator\n @inline\n export const DIRECTORY: oflags = 2;\n /** Fail if file already exists. */\n // @ts-ignore: decorator\n @inline\n export const EXCL: oflags = 4;\n /** Truncate file to size 0. */\n // @ts-ignore: decorator\n @inline\n export const TRUNC: oflags = 8;\n}\nexport type oflags = u16;\n\n// TODO: undocumented\nexport namespace preopentype {\n // @ts-ignore: decorator\n @inline\n export const DIR: preopentype = 0;\n}\nexport type preopentype = u8;\n\n// TODO: undocumented\nexport abstract class prestat {\n type: preopentype;\n}\n\n// TODO: undocumented\nexport class dirprestat extends prestat {\n name_len: usize;\n}\n\n/** Flags provided to `sock_recv`. */\nexport namespace riflags {\n /** Returns the message without removing it from the socket's receive queue. */\n // @ts-ignore: decorator\n @inline\n export const PEEK: riflags = 1;\n /** On byte-stream sockets, block until the full amount of data can be returned. */\n // @ts-ignore: decorator\n @inline\n export const WAITALL: riflags = 2;\n}\nexport type riflags = u16;\n\n/** File descriptor rights, determining which actions may be performed. */\nexport namespace rights {\n /** The right to invoke `fd_datasync`. */\n // @ts-ignore: decorator\n @inline\n export const FD_DATASYNC: rights = 1;\n /** The right to invoke `fd_read` and `sock_recv`. */\n // @ts-ignore: decorator\n @inline\n export const FD_READ: rights = 2;\n /** The right to invoke `fd_seek`. This flag implies `rights.FD_TELL`. */\n // @ts-ignore: decorator\n @inline\n export const FD_SEEK: rights = 4;\n /** The right to invoke `fd_fdstat_set_flags`. */\n // @ts-ignore: decorator\n @inline\n export const FD_FDSTAT_SET_FLAGS: rights = 8;\n /** The right to invoke `fd_sync`. */\n // @ts-ignore: decorator\n @inline\n export const FD_SYNC: rights = 16;\n /** The right to invoke `fd_seek` in such a way that the file offset remains unaltered (i.e., `whence.CUR` with offset zero), or to invoke `fd_tell`). */\n // @ts-ignore: decorator\n @inline\n export const FD_TELL: rights = 32;\n /** The right to invoke `fd_write` and `sock_send`. If `rights.FD_SEEK` is set, includes the right to invoke `fd_pwrite`. */\n // @ts-ignore: decorator\n @inline\n export const FD_WRITE: rights = 64;\n /** The right to invoke `fd_advise`. */\n // @ts-ignore: decorator\n @inline\n export const FD_ADVISE: rights = 128;\n /** The right to invoke `fd_allocate`. */\n // @ts-ignore: decorator\n @inline\n export const FD_ALLOCATE: rights = 256;\n /** The right to invoke `path_create_directory`. */\n // @ts-ignore: decorator\n @inline\n export const PATH_CREATE_DIRECTORY: rights = 512;\n /** If `rights.PATH_OPEN` is set, the right to invoke `path_open` with `oflags.CREAT`. */\n // @ts-ignore: decorator\n @inline\n export const PATH_CREATE_FILE: rights = 1024;\n /** The right to invoke `path_link` with the file descriptor as the source directory. */\n // @ts-ignore: decorator\n @inline\n export const PATH_LINK_SOURCE: rights = 2048;\n /** The right to invoke `path_link` with the file descriptor as the target directory. */\n // @ts-ignore: decorator\n @inline\n export const PATH_LINK_TARGET: rights = 4096;\n /** The right to invoke `path_open`. */\n // @ts-ignore: decorator\n @inline\n export const PATH_OPEN: rights = 8192;\n /** The right to invoke `fd_readdir`. */\n // @ts-ignore: decorator\n @inline\n export const FD_READDIR: rights = 16384;\n /** The right to invoke `path_readlink`. */\n // @ts-ignore: decorator\n @inline\n export const PATH_READLINK: rights = 32768;\n /** The right to invoke `path_rename` with the file descriptor as the source directory. */\n // @ts-ignore: decorator\n @inline\n export const PATH_RENAME_SOURCE: rights = 65536;\n /** The right to invoke `path_rename` with the file descriptor as the target directory. */\n // @ts-ignore: decorator\n @inline\n export const PATH_RENAME_TARGET: rights = 131072;\n /** The right to invoke `path_filestat_get`. */\n // @ts-ignore: decorator\n @inline\n export const PATH_FILESTAT_GET: rights = 262144;\n /** The right to change a file's size (there is no `path_filestat_set_size`). If `rights.PATH_OPEN` is set, includes the right to invoke `path_open` with `oflags.TRUNC`. */\n // @ts-ignore: decorator\n @inline\n export const PATH_FILESTAT_SET_SIZE: rights = 524288;\n /** The right to invoke `path_filestat_set_times`. */\n // @ts-ignore: decorator\n @inline\n export const PATH_FILESTAT_SET_TIMES: rights = 1048576;\n /** The right to invoke `fd_filestat_get`. */\n // @ts-ignore: decorator\n @inline\n export const FD_FILESTAT_GET: rights = 2097152;\n /** The right to invoke `fd_filestat_set_size`. */\n // @ts-ignore: decorator\n @inline\n export const FD_FILESTAT_SET_SIZE: rights = 4194304;\n /** The right to invoke `fd_filestat_set_times`. */\n // @ts-ignore: decorator\n @inline\n export const FD_FILESTAT_SET_TIMES: rights = 8388608;\n /** The right to invoke `path_symlink`. */\n // @ts-ignore: decorator\n @inline\n export const RIGHT_PATH_SYMLINK: rights = 16777216;\n /** The right to invoke `path_remove_directory`. */\n // @ts-ignore: decorator\n @inline\n export const PATH_REMOVE_DIRECTORY: rights = 33554432;\n /** The right to invoke `path_unlink_file`. */\n // @ts-ignore: decorator\n @inline\n export const PATH_UNLINK_FILE: rights = 67108864;\n /** If `rights.FD_READ` is set, includes the right to invoke `poll_oneoff` to subscribe to `eventtype.FD_READ`. If `rights.FD_WRITE` is set, includes the right to invoke `poll_oneoff` to subscribe to `eventtype.FD_WRITE`. */\n // @ts-ignore: decorator\n @inline\n export const POLL_FD_READWRITE: rights = 134217728;\n /** The right to invoke `sock_shutdown`. */\n // @ts-ignore: decorator\n @inline\n export const SOCK_SHUTDOWN: rights = 268435456;\n}\nexport type rights = u64;\n\n/** Flags returned by `sock_recv`. */\nexport namespace roflags {\n /** Message data has been truncated. */\n // @ts-ignore: decorator\n @inline\n export const DATA_TRUNCATED: roflags = 1;\n}\nexport type roflags = u16;\n\n/** Which channels on a socket to shut down. */\nexport namespace sdflags {\n /** Disables further receive operations. */\n // @ts-ignore: decorator\n @inline\n export const RD: sdflags = 1;\n /** Disables further send operations. */\n // @ts-ignore: decorator\n @inline\n export const WR: sdflags = 2;\n}\nexport type sdflags = u8;\n\n/** Flags provided to `sock_send`. */\nexport namespace siflags {\n // As there are currently no flags defined, it must be set to zero.\n}\nexport type siflags = u16;\n\n/** Signal condition. */\nexport namespace signal {\n /** Hangup. */\n // @ts-ignore: decorator\n @inline\n export const HUP: signal = 1;\n /** Terminate interrupt signal. */\n // @ts-ignore: decorator\n @inline\n export const INT: signal = 2;\n /** Terminal quit signal. */\n // @ts-ignore: decorator\n @inline\n export const QUIT: signal = 3;\n /** Illegal instruction. */\n // @ts-ignore: decorator\n @inline\n export const ILL: signal = 4;\n /** Trace/breakpoint trap. */\n // @ts-ignore: decorator\n @inline\n export const TRAP: signal = 5;\n /** Process abort signal. */\n // @ts-ignore: decorator\n @inline\n export const ABRT: signal = 6;\n /** Access to an undefined portion of a memory object. */\n // @ts-ignore: decorator\n @inline\n export const BUS: signal = 7;\n /** Erroneous arithmetic operation. */\n // @ts-ignore: decorator\n @inline\n export const FPE: signal = 8;\n /** Kill. */\n // @ts-ignore: decorator\n @inline\n export const KILL: signal = 9;\n /** User-defined signal 1. */\n // @ts-ignore: decorator\n @inline\n export const USR1: signal = 10;\n /** Invalid memory reference. */\n // @ts-ignore: decorator\n @inline\n export const SEGV: signal = 11;\n /** User-defined signal 2. */\n // @ts-ignore: decorator\n @inline\n export const USR2: signal = 12;\n /** Write on a pipe with no one to read it. */\n // @ts-ignore: decorator\n @inline\n export const PIPE: signal = 13;\n /** Alarm clock. */\n // @ts-ignore: decorator\n @inline\n export const ALRM: signal = 14;\n /** Termination signal. */\n // @ts-ignore: decorator\n @inline\n export const TERM: signal = 15;\n /** Child process terminated, stopped, or continued. */\n // @ts-ignore: decorator\n @inline\n export const CHLD: signal = 16;\n /** Continue executing, if stopped. */\n // @ts-ignore: decorator\n @inline\n export const CONT: signal = 17;\n /** Stop executing. */\n // @ts-ignore: decorator\n @inline\n export const STOP: signal = 18;\n /** Terminal stop signal. */\n // @ts-ignore: decorator\n @inline\n export const TSTP: signal = 19;\n /** Background process attempting read. */\n // @ts-ignore: decorator\n @inline\n export const TTIN: signal = 20;\n /** Background process attempting write. */\n // @ts-ignore: decorator\n @inline\n export const TTOU: signal = 21;\n /** High bandwidth data is available at a socket. */\n // @ts-ignore: decorator\n @inline\n export const URG: signal = 22;\n /** CPU time limit exceeded. */\n // @ts-ignore: decorator\n @inline\n export const XCPU: signal = 23;\n /** File size limit exceeded. */\n // @ts-ignore: decorator\n @inline\n export const XFSZ: signal = 24;\n /** Virtual timer expired. */\n // @ts-ignore: decorator\n @inline\n export const VTALRM: signal = 25;\n // @ts-ignore: decorator\n @inline\n export const PROF: signal = 26;\n // @ts-ignore: decorator\n @inline\n export const WINCH: signal = 27;\n // @ts-ignore: decorator\n @inline\n export const POLL: signal = 28;\n // @ts-ignore: decorator\n @inline\n export const PWR: signal = 29;\n /** Bad system call. */\n // @ts-ignore: decorator\n @inline\n export const SYS: signal = 30;\n}\nexport type signal = u8;\n\n/** Flags determining how to interpret the timestamp provided in `subscription_t::u.clock.timeout. */\nexport namespace subclockflags {\n /** If set, treat the timestamp provided in `clocksubscription` as an absolute timestamp. */\n // @ts-ignore: decorator\n @inline\n export const ABSTIME: subclockflags = 1;\n}\nexport type subclockflags = u16;\n\n/** Subscription to an event. */\n@unmanaged export abstract class subscription {\n /** User-provided value that is attached to the subscription. */\n userdata: userdata;\n /** The type of the event to which to subscribe. */\n type: eventtype;\n private __padding0: u32;\n}\n\n/* Subscription to an event of type `eventtype.CLOCK`.**/\n@unmanaged export class clocksubscription extends subscription {\n /** The user-defined unique identifier of the clock. */\n identifier: userdata;\n /** The clock against which to compare the timestamp. */\n clock_id: clockid;\n /** The absolute or relative timestamp. */\n timeout: timestamp;\n /** The amount of time that the implementation may wait additionally to coalesce with other events. */\n precision: timestamp;\n /** Flags specifying whether the timeout is absolute or relative. */\n flags: subclockflags;\n private __padding1: u32;\n}\n\n/* Subscription to an event of type `eventtype.FD_READ` or `eventtype.FD_WRITE`.**/\n@unmanaged export class fdsubscription extends subscription {\n /** The file descriptor on which to wait for it to become ready for reading or writing. */\n fd: fd;\n}\n\n/** Timestamp in nanoseconds. */\nexport type timestamp = u64;\n\n/** User-provided value that may be attached to objects that is retained when extracted from the implementation. */\nexport type userdata = u64;\n\n/** The position relative to which to set the offset of the file descriptor. */\nexport namespace whence {\n /** Seek relative to current position. */\n // @ts-ignore: decorator\n @inline\n export const CUR: whence = 0;\n /** Seek relative to end-of-file. */\n // @ts-ignore: decorator\n @inline\n export const END: whence = 1;\n /** Seek relative to start-of-file. */\n // @ts-ignore: decorator\n @inline\n export const SET: whence = 2;\n}\nexport type whence = u8;\n","bindings/wasi":'export * from "./wasi_unstable";\n',builtins:"/* tslint:disable */\n\n@builtin @inline export const NaN: f64 = 0 / 0;\n@builtin @inline export const Infinity: f64 = 1 / 0;\n\n@builtin export declare function isInteger(value?: T): bool;\n@builtin export declare function isFloat(value?: T): bool;\n@builtin export declare function isSigned(value?: T): bool;\n@builtin export declare function isReference(value?: T): bool;\n@builtin export declare function isString(value?: T): bool;\n@builtin export declare function isArray(value?: T): bool;\n@builtin export declare function isArrayLike(value?: T): bool;\n@builtin export declare function isFunction(value?: T): bool;\n@builtin export declare function isNullable(value?: T): bool;\n@builtin export declare function isDefined(expression: void): bool;\n@builtin export declare function isConstant(expression: void): bool;\n@builtin export declare function isManaged(value?: T): bool;\n@inline export function isNaN(value: T): bool { return value != value; }\n@inline export function isFinite(value: T): bool { return value - value == 0; }\n\n@builtin export declare function clz(value: T): T;\n@builtin export declare function ctz(value: T): T;\n@builtin export declare function popcnt(value: T): T;\n@builtin export declare function rotl(value: T, shift: T): T;\n@builtin export declare function rotr(value: T, shift: T): T;\n@builtin export declare function abs(value: T): T;\n@builtin export declare function max(left: T, right: T): T;\n@builtin export declare function min(left: T, right: T): T;\n@builtin export declare function ceil(value: T): T;\n@builtin export declare function floor(value: T): T;\n@builtin export declare function copysign(left: T, right: T): T;\n@builtin export declare function nearest(value: T): T;\n@builtin export declare function reinterpret(value: void): T;\n@builtin export declare function sqrt(value: T): T;\n@builtin export declare function trunc(value: T): T;\n@builtin export declare function load(offset: usize, immOffset?: usize, immAlign?: usize): T;\n@builtin export declare function store(offset: usize, value: void, immOffset?: usize, immAlign?: usize): void;\n@builtin export declare function sizeof(): usize; // | u32 / u64\n@builtin export declare function alignof(): usize; // | u32 / u64\n@builtin export declare function offsetof(fieldName?: string): usize; // | u32 / u64\n@builtin export declare function select(ifTrue: T, ifFalse: T, condition: bool): T;\n@builtin export declare function unreachable(): void;\n@builtin export declare function changetype(value: void): T;\n@builtin export declare function assert(isTrueish: T, message?: string): T;\n@builtin export declare function unchecked(expr: T): T;\n@builtin export declare function call_indirect(target: void, ...args: void[]): T;\n@builtin export declare function instantiate(...args: void[]): T;\n\nexport namespace atomic {\n @builtin export declare function load(offset: usize, immOffset?: usize): T;\n @builtin export declare function store(offset: usize, value: T, immOffset?: usize): void;\n @builtin export declare function add(ptr: usize, value: T, immOffset?: usize): T;\n @builtin export declare function sub(ptr: usize, value: T, immOffset?: usize): T;\n @builtin export declare function and(ptr: usize, value: T, immOffset?: usize): T;\n @builtin export declare function or(ptr: usize, value: T, immOffset?: usize): T;\n @builtin export declare function xor(ptr: usize, value: T, immOffset?: usize): T;\n @builtin export declare function xchg(ptr: usize, value: T, immOffset?: usize): T;\n @builtin export declare function cmpxchg(ptr: usize, expected: T, replacement: T, immOffset?: usize): T;\n @builtin export declare function wait(ptr: usize, expected: T, timeout: i64): AtomicWaitResult;\n @builtin export declare function notify(ptr: usize, count: i32): i32;\n}\n\n@lazy export const enum AtomicWaitResult {\n OK = 0,\n NOT_EQUAL = 1,\n TIMED_OUT = 2\n}\n\n@builtin export declare function i8(value: void): i8;\nexport namespace i8 {\n @lazy export const MIN_VALUE: i8 = -128;\n @lazy export const MAX_VALUE: i8 = 127;\n}\n\n@builtin export declare function i16(value: void): i16;\nexport namespace i16 {\n @lazy export const MIN_VALUE: i16 = -32768;\n @lazy export const MAX_VALUE: i16 = 32767;\n}\n\n@builtin export declare function i32(value: void): i32;\nexport namespace i32 {\n @lazy export const MIN_VALUE: i32 = -2147483648;\n @lazy export const MAX_VALUE: i32 = 2147483647;\n @builtin export declare function clz(value: i32): i32;\n @builtin export declare function ctz(value: i32): i32;\n @builtin export declare function popcnt(value: i32): i32;\n @builtin export declare function rotl(value: i32, shift: i32): i32;\n @builtin export declare function rotr(value: i32, shift: i32): i32;\n @builtin export declare function reinterpret_f32(value: f32): i32;\n @builtin export declare function load8_s(offset: usize, immOffset?: usize, immAlign?: usize): i32;\n @builtin export declare function load8_u(offset: usize, immOffset?: usize, immAlign?: usize): i32;\n @builtin export declare function load16_s(offset: usize, immOffset?: usize, immAlign?: usize): i32;\n @builtin export declare function load16_u(offset: usize, immOffset?: usize, immAlign?: usize): i32;\n @builtin export declare function load(offset: usize, immOffset?: usize, immAlign?: usize): i32;\n @builtin export declare function store8(offset: usize, value: i32, immOffset?: usize, immAlign?: usize): void;\n @builtin export declare function store16(offset: usize, value: i32, immOffset?: usize, immAlign?: usize): void;\n @builtin export declare function store(offset: usize, value: i32, immOffset?: usize, immAlign?: usize): void;\n \n export namespace atomic {\n @builtin export declare function load8_u(offset: usize, immOffset?: usize): i32;\n @builtin export declare function load16_u(offset: usize, immOffset?: usize): i32;\n @builtin export declare function load(offset: usize, immOffset?: usize): i32;\n @builtin export declare function store8(offset: usize, value: i32, immOffset?: usize): void;\n @builtin export declare function store16(offset: usize, value: i32, immOffset?: usize): void;\n @builtin export declare function store(offset: usize, value: i32, immOffset?: usize): void;\n @builtin export declare function wait(ptr: usize, expected: i32, timeout: i64): AtomicWaitResult;\n\n export namespace rmw8 {\n @builtin export declare function add_u(offset: usize, value: i32, immOffset?: usize): i32;\n @builtin export declare function sub_u(offset: usize, value: i32, immOffset?: usize): i32;\n @builtin export declare function and_u(offset: usize, value: i32, immOffset?: usize): i32;\n @builtin export declare function or_u(offset: usize, value: i32, immOffset?: usize): i32;\n @builtin export declare function xor_u(offset: usize, value: i32, immOffset?: usize): i32;\n @builtin export declare function xchg_u(offset: usize, value: i32, immOffset?: usize): i32;\n @builtin export declare function cmpxchg_u(offset: usize, expected: i32, replacement: i32, immOffset?: usize): i32;\n }\n export namespace rmw16 {\n @builtin export declare function add_u(offset: usize, value: i32, immOffset?: usize): i32;\n @builtin export declare function sub_u(offset: usize, value: i32, immOffset?: usize): i32;\n @builtin export declare function and_u(offset: usize, value: i32, immOffset?: usize): i32;\n @builtin export declare function or_u(offset: usize, value: i32, immOffset?: usize): i32;\n @builtin export declare function xor_u(offset: usize, value: i32, immOffset?: usize): i32;\n @builtin export declare function xchg_u(offset: usize, value: i32, immOffset?: usize): i32;\n @builtin export declare function cmpxchg_u(offset: usize, expected: i32, replacement: i32, immOffset?: usize): i32;\n }\n export namespace rmw {\n @builtin export declare function add(offset: usize, value: i32, immOffset?: usize): i32;\n @builtin export declare function sub(offset: usize, value: i32, immOffset?: usize): i32;\n @builtin export declare function and(offset: usize, value: i32, immOffset?: usize): i32;\n @builtin export declare function or(offset: usize, value: i32, immOffset?: usize): i32;\n @builtin export declare function xor(offset: usize, value: i32, immOffset?: usize): i32;\n @builtin export declare function xchg(offset: usize, value: i32, immOffset?: usize): i32;\n @builtin export declare function cmpxchg(offset: usize, expected: i32, replacement: i32, immOffset?: usize): i32;\n }\n }\n}\n\n@builtin export declare function i64(value: void): i64;\nexport namespace i64 {\n @lazy export const MIN_VALUE: i64 = -9223372036854775808;\n @lazy export const MAX_VALUE: i64 = 9223372036854775807;\n @builtin export declare function clz(value: i64): i64;\n @builtin export declare function ctz(value: i64): i64;\n @builtin export declare function load8_s(offset: usize, immOffset?: usize, immAlign?: usize): i64;\n @builtin export declare function load8_u(offset: usize, immOffset?: usize, immAlign?: usize): i64;\n @builtin export declare function load16_s(offset: usize, immOffset?: usize, immAlign?: usize): i64;\n @builtin export declare function load16_u(offset: usize, immOffset?: usize, immAlign?: usize): i64;\n @builtin export declare function load32_s(offset: usize, immOffset?: usize, immAlign?: usize): i64;\n @builtin export declare function load32_u(offset: usize, immOffset?: usize, immAlign?: usize): i64;\n @builtin export declare function load(offset: usize, immOffset?: usize): i64;\n @builtin export declare function popcnt(value: i64): i64;\n @builtin export declare function rotl(value: i64, shift: i64): i64;\n @builtin export declare function rotr(value: i64, shift: i64): i64;\n @builtin export declare function reinterpret_f64(value: f64): i64;\n @builtin export declare function store8(offset: usize, value: i64, immOffset?: usize, immAlign?: usize): void;\n @builtin export declare function store16(offset: usize, value: i64, immOffset?: usize, immAlign?: usize): void;\n @builtin export declare function store32(offset: usize, value: i64, immOffset?: usize, immAlign?: usize): void;\n @builtin export declare function store(offset: usize, value: i64, immOffset?: usize, immAlign?: usize): void;\n\n export namespace atomic {\n @builtin export declare function load8_u(offset: usize, immOffset?: usize): i64;\n @builtin export declare function load16_u(offset: usize, immOffset?: usize): i64;\n @builtin export declare function load32_u(offset: usize, immOffset?: usize): i64;\n @builtin export declare function load(offset: usize, immOffset?: usize): i64;\n @builtin export declare function store8(offset: usize, value: i64, immOffset?: usize): void;\n @builtin export declare function store16(offset: usize, value: i64, immOffset?: usize): void;\n @builtin export declare function store32(offset: usize, value: i64, immOffset?: usize): void;\n @builtin export declare function store(offset: usize, value: i64, immOffset?: usize): void;\n @builtin export declare function wait(ptr: usize, expected: i64, timeout: i64): AtomicWaitResult;\n\n export namespace rmw8 {\n @builtin export declare function add_u(offset: usize, value: i64, immOffset?: usize): i64;\n @builtin export declare function sub_u(offset: usize, value: i64, immOffset?: usize): i64;\n @builtin export declare function and_u(offset: usize, value: i64, immOffset?: usize): i64;\n @builtin export declare function or_u(offset: usize, value: i64, immOffset?: usize): i64;\n @builtin export declare function xor_u(offset: usize, value: i64, immOffset?: usize): i64;\n @builtin export declare function xchg_u(offset: usize, value: i64, immOffset?: usize): i64;\n @builtin export declare function cmpxchg_u(offset: usize, expected: i64, replacement: i64, immOffset?: usize): i64;\n }\n export namespace rmw16 {\n @builtin export declare function add_u(offset: usize, value: i64, immOffset?: usize): i64;\n @builtin export declare function sub_u(offset: usize, value: i64, immOffset?: usize): i64;\n @builtin export declare function and_u(offset: usize, value: i64, immOffset?: usize): i64;\n @builtin export declare function or_u(offset: usize, value: i64, immOffset?: usize): i64;\n @builtin export declare function xor_u(offset: usize, value: i64, immOffset?: usize): i64;\n @builtin export declare function xchg_u(offset: usize, value: i64, immOffset?: usize): i64;\n @builtin export declare function cmpxchg_u(offset: usize, expected: i64, replacement: i64, immOffset?: usize): i64;\n }\n export namespace rmw32 {\n @builtin export declare function add_u(offset: usize, value: i64, immOffset?: usize): i64;\n @builtin export declare function sub_u(offset: usize, value: i64, immOffset?: usize): i64;\n @builtin export declare function and_u(offset: usize, value: i64, immOffset?: usize): i64;\n @builtin export declare function or_u(offset: usize, value: i64, immOffset?: usize): i64;\n @builtin export declare function xor_u(offset: usize, value: i64, immOffset?: usize): i64;\n @builtin export declare function xchg_u(offset: usize, value: i64, immOffset?: usize): i64;\n @builtin export declare function cmpxchg_u(offset: usize, expected: i64, replacement: i64, immOffset?: usize): i64;\n }\n export namespace rmw {\n @builtin export declare function add(offset: usize, value: i64, immOffset?: usize): i64;\n @builtin export declare function sub(offset: usize, value: i64, immOffset?: usize): i64;\n @builtin export declare function and(offset: usize, value: i64, immOffset?: usize): i64;\n @builtin export declare function or(offset: usize, value: i64, immOffset?: usize): i64;\n @builtin export declare function xor(offset: usize, value: i64, immOffset?: usize): i64;\n @builtin export declare function xchg(offset: usize, value: i64, immOffset?: usize): i64;\n @builtin export declare function cmpxchg(offset: usize, expected: i64, replacement: i64, immOffset?: usize): i64;\n }\n }\n}\n\n@builtin export declare function isize(value: void): isize;\nexport namespace isize {\n @lazy export const MIN_VALUE: isize = sizeof() == sizeof()\n ? -2147483648\n : -9223372036854775808;\n @lazy export const MAX_VALUE: isize = sizeof() == sizeof()\n ? 2147483647\n : 9223372036854775807;\n}\n\n@builtin export declare function u8(value: void): u8;\nexport namespace u8 {\n @lazy export const MIN_VALUE: u8 = 0;\n @lazy export const MAX_VALUE: u8 = 255;\n}\n\n@builtin export declare function u16(value: void): u16;\nexport namespace u16 {\n @lazy export const MIN_VALUE: u16 = 0;\n @lazy export const MAX_VALUE: u16 = 65535;\n}\n\n@builtin export declare function u32(value: void): u32;\nexport namespace u32 {\n @lazy export const MIN_VALUE: u32 = 0;\n @lazy export const MAX_VALUE: u32 = 4294967295;\n}\n\n@builtin export declare function u64(value: void): u64;\nexport namespace u64 {\n @lazy export const MIN_VALUE: u64 = 0;\n @lazy export const MAX_VALUE: u64 = 18446744073709551615;\n}\n\n@builtin export declare function usize(value: void): usize;\nexport namespace usize {\n @lazy export const MIN_VALUE: usize = 0;\n @lazy export const MAX_VALUE: usize = sizeof() == sizeof()\n ? 4294967295\n : 18446744073709551615;\n}\n\n@builtin export declare function bool(value: void): bool;\nexport namespace bool {\n @lazy export const MIN_VALUE: bool = false;\n @lazy export const MAX_VALUE: bool = true;\n}\n\n@builtin export declare function f32(value: void): f32;\nexport namespace f32 {\n @lazy export const EPSILON = reinterpret(0x34000000); // 0x1p-23f\n @lazy export const MIN_VALUE = reinterpret(0x00000001); // 0x0.000001p+0f\n @lazy export const MAX_VALUE = reinterpret(0x7F7FFFFF); // 0x1.fffffep+127f\n @lazy export const MIN_NORMAL_VALUE = reinterpret(0x00800000); // 0x1p-126f\n @lazy export const MIN_SAFE_INTEGER: f32 = -16777215;\n @lazy export const MAX_SAFE_INTEGER: f32 = 16777215;\n @builtin export declare function abs(value: f32): f32;\n @builtin export declare function ceil(value: f32): f32;\n @builtin export declare function copysign(x: f32, y: f32): f32;\n @builtin export declare function floor(value: f32): f32;\n @builtin export declare function load(offset: usize, immOffset?: usize, immAlign?: usize): f32;\n @builtin export declare function max(left: f32, right: f32): f32;\n @builtin export declare function min(left: f32, right: f32): f32;\n @builtin export declare function nearest(value: f32): f32;\n @builtin export declare function reinterpret_i32(value: i32): f32;\n @builtin export declare function sqrt(value: f32): f32;\n @builtin export declare function store(offset: usize, value: f32, immOffset?: usize, immAlign?: usize): void;\n @builtin export declare function trunc(value: f32): f32;\n}\n\n@builtin export declare function f64(value: void): f64;\nexport namespace f64 {\n @lazy export const EPSILON = reinterpret(0x3CB0000000000000); // 0x1p-52\n @lazy export const MIN_VALUE = reinterpret(0x0000000000000001); // 0x0.0000000000001p+0\n @lazy export const MAX_VALUE = reinterpret(0x7FEFFFFFFFFFFFFF); // 0x1.fffffffffffffp+1023\n @lazy export const MIN_NORMAL_VALUE = reinterpret(0x0010000000000000); // 0x1p-1022\n @lazy export const MIN_SAFE_INTEGER: f64 = -9007199254740991;\n @lazy export const MAX_SAFE_INTEGER: f64 = 9007199254740991;\n @builtin export declare function abs(value: f64): f64;\n @builtin export declare function ceil(value: f64): f64;\n @builtin export declare function copysign(x: f64, y: f64): f64;\n @builtin export declare function floor(value: f64): f64;\n @builtin export declare function load(offset: usize, immOffset?: usize, immAlign?: usize): f64;\n @builtin export declare function max(left: f64, right: f64): f64;\n @builtin export declare function min(left: f64, right: f64): f64;\n @builtin export declare function nearest(value: f64): f64;\n @builtin export declare function reinterpret_i64(value: i64): f64;\n @builtin export declare function sqrt(value: f64): f64;\n @builtin export declare function store(offset: usize, value: f64, immOffset?: usize, immAlign?: usize): void;\n @builtin export declare function trunc(value: f64): f64;\n}\n\n@builtin export declare function v128(a: i8, b: i8, c: i8, d: i8, e: i8, f: i8, g: i8, h: i8, i: i8, j: i8, k: i8, l: i8, m: i8, n: i8, o: i8, p: i8): v128;\nexport namespace v128 {\n @builtin export declare function splat(x: T): v128;\n @builtin export declare function extract_lane(x: v128, idx: u8): T;\n @builtin export declare function replace_lane(x: v128, idx: u8, value: T): v128;\n @builtin export declare function shuffle(a: v128, b: v128, ...lanes: u8[]): v128;\n @builtin export declare function load(offset: usize, immOffset?: usize, immAlign?: usize): v128;\n @builtin export declare function store(offset: usize, value: v128, immOffset?: usize, immAlign?: usize): void;\n @builtin export declare function add(a: v128, b: v128): v128;\n @builtin export declare function sub(a: v128, b: v128): v128;\n @builtin export declare function mul(a: v128, b: v128): v128; // except i64\n @builtin export declare function div(a: v128, b: v128): v128; // f32, f64 only\n @builtin export declare function neg(a: v128): v128;\n @builtin export declare function add_saturate(a: v128, b: v128): v128;\n @builtin export declare function sub_saturate(a: v128, b: v128): v128;\n @builtin export declare function shl(a: v128, b: i32): v128;\n @builtin export declare function shr(a: v128, b: i32): v128;\n @builtin export declare function and(a: v128, b: v128): v128;\n @builtin export declare function or(a: v128, b: v128): v128;\n @builtin export declare function xor(a: v128, b: v128): v128;\n @builtin export declare function not(a: v128): v128;\n @builtin export declare function bitselect(v1: v128, v2: v128, c: v128): v128;\n @builtin export declare function any_true(a: v128): bool;\n @builtin export declare function all_true(a: v128): bool;\n @builtin export declare function min(a: v128, b: v128): v128; // f32, f64 only\n @builtin export declare function max(a: v128, b: v128): v128; // f32, f64 only\n @builtin export declare function abs(a: v128): v128; // f32, f64 only\n @builtin export declare function sqrt(a: v128): v128; // f32, f64 only\n @builtin export declare function eq(a: v128, b: v128): v128;\n @builtin export declare function ne(a: v128, b: v128): v128;\n @builtin export declare function lt(a: v128, b: v128): v128;\n @builtin export declare function le(a: v128, b: v128): v128;\n @builtin export declare function gt(a: v128, b: v128): v128;\n @builtin export declare function ge(a: v128, b: v128): v128;\n @builtin export declare function convert(a: v128): v128;\n @builtin export declare function trunc(a: v128): v128;\n}\n\n@builtin export declare function i8x16(a: i8, b: i8, c: i8, d: i8, e: i8, f: i8, g: i8, h: i8, i: i8, j: i8, k: i8, l: i8, m: i8, n: i8, o: i8, p: i8): v128;\nexport namespace i8x16 {\n @builtin export declare function splat(x: i8): v128;\n @builtin export declare function extract_lane_s(x: v128, idx: u8): i8;\n @builtin export declare function extract_lane_u(x: v128, idx: u8): u8;\n @builtin export declare function replace_lane(x: v128, idx: u8, value: i8): v128;\n @builtin export declare function add(a: v128, b: v128): v128;\n @builtin export declare function sub(a: v128, b: v128): v128;\n @builtin export declare function mul(a: v128, b: v128): v128;\n @builtin export declare function neg(a: v128): v128;\n @builtin export declare function add_saturate_s(a: v128, b: v128): v128;\n @builtin export declare function add_saturate_u(a: v128, b: v128): v128;\n @builtin export declare function sub_saturate_s(a: v128, b: v128): v128;\n @builtin export declare function sub_saturate_u(a: v128, b: v128): v128;\n @builtin export declare function shl(a: v128, b: i32): v128;\n @builtin export declare function shr_s(a: v128, b: i32): v128;\n @builtin export declare function shr_u(a: v128, b: i32): v128;\n @builtin export declare function any_true(a: v128): bool;\n @builtin export declare function all_true(a: v128): bool;\n @builtin export declare function eq(a: v128, b: v128): v128;\n @builtin export declare function ne(a: v128, b: v128): v128;\n @builtin export declare function lt_s(a: v128, b: v128): v128;\n @builtin export declare function lt_u(a: v128, b: v128): v128;\n @builtin export declare function le_s(a: v128, b: v128): v128;\n @builtin export declare function le_u(a: v128, b: v128): v128;\n @builtin export declare function gt_s(a: v128, b: v128): v128;\n @builtin export declare function gt_u(a: v128, b: v128): v128;\n @builtin export declare function ge_s(a: v128, b: v128): v128;\n @builtin export declare function ge_u(a: v128, b: v128): v128;\n}\n\n@builtin export declare function i16x8(a: i16, b: i16, c: i16, d: i16, e: i16, f: i16, g: i16, h: i16): v128;\nexport namespace i16x8 {\n @builtin export declare function splat(x: i16): v128;\n @builtin export declare function extract_lane_s(x: v128, idx: u8): i16;\n @builtin export declare function extract_lane_u(x: v128, idx: u8): u16;\n @builtin export declare function replace_lane(x: v128, idx: u8, value: i16): v128;\n @builtin export declare function add(a: v128, b: v128): v128;\n @builtin export declare function sub(a: v128, b: v128): v128;\n @builtin export declare function mul(a: v128, b: v128): v128;\n @builtin export declare function neg(a: v128): v128;\n @builtin export declare function add_saturate_s(a: v128, b: v128): v128;\n @builtin export declare function add_saturate_u(a: v128, b: v128): v128;\n @builtin export declare function sub_saturate_s(a: v128, b: v128): v128;\n @builtin export declare function sub_saturate_u(a: v128, b: v128): v128;\n @builtin export declare function shl(a: v128, b: i32): v128;\n @builtin export declare function shr_s(a: v128, b: i32): v128;\n @builtin export declare function shr_u(a: v128, b: i32): v128;\n @builtin export declare function any_true(a: v128): bool;\n @builtin export declare function all_true(a: v128): bool;\n @builtin export declare function eq(a: v128, b: v128): v128;\n @builtin export declare function ne(a: v128, b: v128): v128;\n @builtin export declare function lt_s(a: v128, b: v128): v128;\n @builtin export declare function lt_u(a: v128, b: v128): v128;\n @builtin export declare function le_s(a: v128, b: v128): v128;\n @builtin export declare function le_u(a: v128, b: v128): v128;\n @builtin export declare function gt_s(a: v128, b: v128): v128;\n @builtin export declare function gt_u(a: v128, b: v128): v128;\n @builtin export declare function ge_s(a: v128, b: v128): v128;\n @builtin export declare function ge_u(a: v128, b: v128): v128;\n}\n\n@builtin export declare function i32x4(a: i32, b: i32, c: i32, d: i32): v128;\nexport namespace i32x4 {\n @builtin export declare function splat(x: i32): v128;\n @builtin export declare function extract_lane(x: v128, idx: u8): i32;\n @builtin export declare function replace_lane(x: v128, idx: u8, value: i32): v128;\n @builtin export declare function add(a: v128, b: v128): v128;\n @builtin export declare function sub(a: v128, b: v128): v128;\n @builtin export declare function mul(a: v128, b: v128): v128;\n @builtin export declare function neg(a: v128): v128;\n @builtin export declare function shl(a: v128, b: i32): v128;\n @builtin export declare function shr_s(a: v128, b: i32): v128;\n @builtin export declare function shr_u(a: v128, b: i32): v128;\n @builtin export declare function any_true(a: v128): bool;\n @builtin export declare function all_true(a: v128): bool;\n @builtin export declare function eq(a: v128, b: v128): v128;\n @builtin export declare function ne(a: v128, b: v128): v128;\n @builtin export declare function lt_s(a: v128, b: v128): v128;\n @builtin export declare function lt_u(a: v128, b: v128): v128;\n @builtin export declare function le_s(a: v128, b: v128): v128;\n @builtin export declare function le_u(a: v128, b: v128): v128;\n @builtin export declare function gt_s(a: v128, b: v128): v128;\n @builtin export declare function gt_u(a: v128, b: v128): v128;\n @builtin export declare function ge_s(a: v128, b: v128): v128;\n @builtin export declare function ge_u(a: v128, b: v128): v128;\n @builtin export declare function trunc_s_f32x4_sat(a: v128): v128;\n @builtin export declare function trunc_u_f32x4_sat(a: v128): v128;\n}\n\n@builtin export declare function i64x2(a: i64, b: i64): v128;\nexport namespace i64x2 {\n @builtin export declare function splat(x: i64): v128;\n @builtin export declare function extract_lane(x: v128, idx: u8): i64;\n @builtin export declare function replace_lane(x: v128, idx: u8, value: i64): v128;\n @builtin export declare function add(a: v128, b: v128): v128;\n @builtin export declare function sub(a: v128, b: v128): v128;\n @builtin export declare function mul(a: v128, b: v128): v128;\n @builtin export declare function neg(a: v128): v128;\n @builtin export declare function shl(a: v128, b: i32): v128;\n @builtin export declare function shr_s(a: v128, b: i32): v128;\n @builtin export declare function shr_u(a: v128, b: i32): v128;\n @builtin export declare function any_true(a: v128): bool;\n @builtin export declare function all_true(a: v128): bool;\n @builtin export declare function trunc_s_f64x2_sat(a: v128): v128;\n @builtin export declare function trunc_u_f64x2_sat(a: v128): v128;\n}\n\n@builtin export declare function f32x4(a: f32, b: f32, c: f32, d: f32): v128;\nexport namespace f32x4 {\n @builtin export declare function splat(x: f32): v128;\n @builtin export declare function extract_lane(x: v128, idx: u8): f32;\n @builtin export declare function replace_lane(x: v128, idx: u8, value: f32): v128;\n @builtin export declare function add(a: v128, b: v128): v128;\n @builtin export declare function sub(a: v128, b: v128): v128;\n @builtin export declare function mul(a: v128, b: v128): v128;\n @builtin export declare function div(a: v128, b: v128): v128;\n @builtin export declare function neg(a: v128): v128;\n @builtin export declare function min(a: v128, b: v128): v128;\n @builtin export declare function max(a: v128, b: v128): v128;\n @builtin export declare function abs(a: v128): v128;\n @builtin export declare function sqrt(a: v128): v128;\n @builtin export declare function eq(a: v128, b: v128): v128;\n @builtin export declare function ne(a: v128, b: v128): v128;\n @builtin export declare function lt(a: v128, b: v128): v128;\n @builtin export declare function le(a: v128, b: v128): v128;\n @builtin export declare function gt(a: v128, b: v128): v128;\n @builtin export declare function ge(a: v128, b: v128): v128;\n @builtin export declare function convert_s_i32x4(a: v128): v128;\n @builtin export declare function convert_u_i32x4(a: v128): v128;\n}\n\n@builtin export declare function f64x2(a: f64, b: f64): v128;\nexport namespace f64x2 {\n @builtin export declare function splat(x: f64): v128;\n @builtin export declare function extract_lane(x: v128, idx: u8): f64;\n @builtin export declare function replace_lane(x: v128, idx: u8, value: f64): v128;\n @builtin export declare function add(a: v128, b: v128): v128;\n @builtin export declare function sub(a: v128, b: v128): v128;\n @builtin export declare function mul(a: v128, b: v128): v128;\n @builtin export declare function div(a: v128, b: v128): v128;\n @builtin export declare function neg(a: v128): v128;\n @builtin export declare function min(a: v128, b: v128): v128;\n @builtin export declare function max(a: v128, b: v128): v128;\n @builtin export declare function abs(a: v128): v128;\n @builtin export declare function sqrt(a: v128): v128;\n @builtin export declare function eq(a: v128, b: v128): v128;\n @builtin export declare function ne(a: v128, b: v128): v128;\n @builtin export declare function lt(a: v128, b: v128): v128;\n @builtin export declare function le(a: v128, b: v128): v128;\n @builtin export declare function gt(a: v128, b: v128): v128;\n @builtin export declare function ge(a: v128, b: v128): v128;\n @builtin export declare function convert_s_i64x2(a: v128): v128;\n @builtin export declare function convert_u_i64x2(a: v128): v128;\n}\n\nexport namespace v8x16 {\n @builtin export declare function shuffle(a: v128, b: v128, l0: u8, l1: u8, l2: u8, l3: u8, l4: u8, l5: u8, l6: u8, l7: u8, l8: u8, l9: u8, l10: u8, l11: u8, l12: u8, l13: u8, l14: u8, l15: u8): v128;\n}\n\n@builtin export declare function start(): void;\n","collector/itcm":'/**\n * Incremental Tri-Color-Marking Garbage Collector.\n *\n * @module std/assembly/collector/itcm\n *//***/\n\n// Largely based on Bach Le\'s μgc, see: https://github.com/bullno1/ugc\n\n@inline const TRACE = false;\n\n/** Size of a managed object header. */\n@inline export const HEADER_SIZE: usize = (offsetof() + AL_MASK) & ~AL_MASK;\n\nimport { AL_MASK, MAX_SIZE_32 } from "../internal/allocator";\nimport { iterateRoots } from "../gc";\n\n/** Collector states. */\nconst enum State {\n /** Not yet initialized. */\n INIT = 0,\n /** Currently transitioning from SWEEP to MARK state. */\n IDLE = 1,\n /** Currently marking reachable objects. */\n MARK = 2,\n /** Currently sweeping unreachable objects. */\n SWEEP = 3\n}\n\n/** Current collector state. */\nvar state = State.INIT;\n/** Current white color value. */\nvar white = 0;\n\n// From and to spaces\nvar fromSpace: ManagedObjectList;\nvar toSpace: ManagedObjectList;\nvar iter: ManagedObject;\n\n// ╒═══════════════ Managed object layout (32-bit) ════════════════╕\n// 3 2 1\n// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits\n// ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┼─┼─┴─┤ ┐\n// │ next │0│ C │ ◄─┐ = nextWithColor\n// ├─────────────────────────────────────────────────────────┴─┴───┤ │ usize\n// │ prev │ ◄─┘\n// ├───────────────────────────────────────────────────────────────┤\n// │ hookFn │\n// ╞═══════════════════════════════════════════════════════════════╡ SIZE ┘ ◄─ user-space reference\n// │ ... data ... │\n// └───────────────────────────────────────────────────────────────┘\n// C: color\n\n/** Represents a managed object in memory, consisting of a header followed by the object\'s data. */\n@unmanaged class ManagedObject {\n\n /** Pointer to the next object with color flags stored in the alignment bits. */\n nextWithColor: usize;\n\n /** Pointer to the previous object. */\n prev: ManagedObject;\n\n /** Class-specific hook function called with the user-space reference. */\n hookFn: (ref: usize) => void;\n\n /** Gets the pointer to the next object. */\n get next(): ManagedObject {\n return changetype(this.nextWithColor & ~3);\n }\n\n /** Sets the pointer to the next object. */\n set next(obj: ManagedObject) {\n this.nextWithColor = changetype(obj) | (this.nextWithColor & 3);\n }\n\n /** Gets this object\'s color. */\n get color(): i32 {\n return this.nextWithColor & 3;\n }\n\n /** Sets this object\'s color. */\n set color(color: i32) {\n this.nextWithColor = (this.nextWithColor & ~3) | color;\n }\n\n /** Unlinks this object from its list. */\n unlink(): void {\n var next = this.next;\n var prev = this.prev;\n if (TRACE) trace(" unlink", 3, objToRef(prev), objToRef(this), objToRef(next));\n next.prev = prev;\n prev.next = next;\n }\n\n /** Marks this object as gray, that is reachable with unscanned children. */\n makeGray(): void {\n if (TRACE) trace(" makeGray", 1, objToRef(this));\n const gray = 2;\n if (this == iter) iter = this.prev;\n this.unlink();\n toSpace.push(this);\n this.nextWithColor = (this.nextWithColor & ~3) | gray;\n }\n}\n\n/** A list of managed objects. Used for the from and to spaces. */\n@unmanaged class ManagedObjectList extends ManagedObject {\n\n /** Inserts an object. */\n push(obj: ManagedObject): void {\n var prev = this.prev;\n if (TRACE) trace(" push", 3, objToRef(prev), objToRef(obj), objToRef(this));\n obj.next = this;\n obj.prev = prev;\n prev.next = obj;\n this.prev = obj;\n }\n\n /** Clears this list. */\n clear(): void {\n if (TRACE) trace(" clear", 1, objToRef(this));\n this.nextWithColor = changetype(this);\n this.prev = this;\n }\n}\n\n/** Performs a single step according to the current state. */\nfunction step(): void {\n var obj: ManagedObject;\n switch (state) {\n case State.INIT: {\n if (TRACE) trace("gc~step/INIT");\n fromSpace = changetype(memory.allocate(HEADER_SIZE));\n fromSpace.hookFn = changetype<(ref: usize) => void>(-1); // would error\n fromSpace.clear();\n toSpace = changetype(memory.allocate(HEADER_SIZE));\n toSpace.hookFn = changetype<(ref: usize) => void>(-1); // would error\n toSpace.clear();\n iter = toSpace;\n state = State.IDLE;\n if (TRACE) trace("gc~state = IDLE");\n // fall-through\n }\n case State.IDLE: {\n if (TRACE) trace("gc~step/IDLE");\n iterateRoots(__gc_mark);\n state = State.MARK;\n if (TRACE) trace("gc~state = MARK");\n break;\n }\n case State.MARK: {\n obj = iter.next;\n if (obj !== toSpace) {\n if (TRACE) trace("gc~step/MARK iterate", 1, objToRef(obj));\n iter = obj;\n obj.color = !white;\n // if (TRACE) {\n // trace(" next/prev/hook", 3,\n // changetype(obj.next),\n // changetype(obj.prev),\n // changetype(obj.hookFn)\n // );\n // }\n obj.hookFn(objToRef(obj));\n } else {\n if (TRACE) trace("gc~step/MARK finish");\n iterateRoots(__gc_mark);\n obj = iter.next;\n if (obj === toSpace) {\n let from = fromSpace;\n fromSpace = toSpace;\n toSpace = from;\n white = !white;\n iter = from.next;\n state = State.SWEEP;\n if (TRACE) trace("gc~state = SWEEP");\n }\n }\n break;\n }\n case State.SWEEP: {\n obj = iter;\n if (obj !== toSpace) {\n if (TRACE) trace("gc~step/SWEEP free", 1, objToRef(obj));\n iter = obj.next;\n if (changetype(obj) >= HEAP_BASE) memory.free(changetype(obj));\n } else {\n if (TRACE) trace("gc~step/SWEEP finish");\n toSpace.clear();\n state = State.IDLE;\n if (TRACE) trace("gc~state = IDLE");\n }\n break;\n }\n }\n}\n\n@inline function refToObj(ref: usize): ManagedObject {\n return changetype(ref - HEADER_SIZE);\n}\n\n@inline function objToRef(obj: ManagedObject): usize {\n return changetype(obj) + HEADER_SIZE;\n}\n\n// Garbage collector interface\n\n@global export function __gc_allocate(\n size: usize,\n markFn: (ref: usize) => void\n): usize {\n if (TRACE) trace("gc.allocate", 1, size);\n if (size > MAX_SIZE_32 - HEADER_SIZE) unreachable();\n step(); // also makes sure it\'s initialized\n var obj = changetype(memory.allocate(HEADER_SIZE + size));\n obj.hookFn = markFn;\n obj.color = white;\n fromSpace.push(obj);\n return objToRef(obj);\n}\n\n@global export function __gc_link(parentRef: usize, childRef: usize): void {\n if (TRACE) trace("gc.link", 2, parentRef, childRef);\n var parent = refToObj(parentRef);\n if (parent.color == !white && refToObj(childRef).color == white) parent.makeGray();\n}\n\n@global export function __gc_mark(ref: usize): void {\n if (TRACE) trace("gc.mark", 1, ref);\n if (ref) {\n let obj = refToObj(ref);\n if (obj.color == white) obj.makeGray();\n }\n}\n\n@global export function __gc_collect(): void {\n if (TRACE) trace("gc.collect");\n // begin collecting if not yet collecting\n switch (state) {\n case State.INIT:\n case State.IDLE: step();\n }\n // finish the cycle\n while (state != State.IDLE) step();\n}\n',dataview:'import {\n HEADER_SIZE,\n MAX_BLENGTH\n} from "./internal/arraybuffer";\n\nexport class DataView {\n\n constructor(\n readonly buffer: ArrayBuffer,\n readonly byteOffset: i32 = 0,\n readonly byteLength: i32 = i32.MIN_VALUE // FIXME\n ) {\n if (byteLength === i32.MIN_VALUE) byteLength = buffer.byteLength - byteOffset; // FIXME\n if (byteOffset > MAX_BLENGTH) throw new RangeError("Invalid byteOffset");\n if (byteLength > MAX_BLENGTH) throw new RangeError("Invalid byteLength");\n if (byteOffset + byteLength > buffer.byteLength) throw new RangeError("Invalid length");\n }\n\n getFloat32(byteOffset: i32, littleEndian: boolean = false): f32 {\n checkOffset(byteOffset, 4, this.byteLength);\n return littleEndian\n ? load(changetype(this.buffer) + this.byteOffset + byteOffset, HEADER_SIZE)\n : reinterpret(\n bswap(\n load(changetype(this.buffer) + this.byteOffset + byteOffset, HEADER_SIZE)\n )\n );\n }\n\n getFloat64(byteOffset: i32, littleEndian: boolean = false): f64 {\n checkOffset(byteOffset, 8, this.byteLength);\n return littleEndian\n ? load(changetype(this.buffer) + this.byteOffset + byteOffset, HEADER_SIZE)\n : reinterpret(\n bswap(\n load(changetype(this.buffer) + this.byteOffset + byteOffset, HEADER_SIZE)\n )\n );\n }\n\n getInt8(byteOffset: i32): i8 {\n checkOffset(byteOffset, 1, this.byteLength);\n return load(changetype(this.buffer) + this.byteOffset + byteOffset, HEADER_SIZE);\n }\n\n getInt16(byteOffset: i32, littleEndian: boolean = false): i16 {\n checkOffset(byteOffset, 2, this.byteLength);\n var result: i16 = load(changetype(this.buffer) + this.byteOffset + byteOffset, HEADER_SIZE);\n return littleEndian ? result : bswap(result);\n }\n\n getInt32(byteOffset: i32, littleEndian: boolean = false): i32 {\n checkOffset(byteOffset, 4, this.byteLength);\n var result = load(changetype(this.buffer) + this.byteOffset + byteOffset, HEADER_SIZE);\n return littleEndian ? result : bswap(result);\n }\n\n getUint8(byteOffset: i32): u8 {\n checkOffset(byteOffset, 1, this.byteLength);\n return load(changetype(this.buffer) + this.byteOffset + byteOffset, HEADER_SIZE);\n }\n\n getUint16(byteOffset: i32, littleEndian: boolean = false): u16 {\n checkOffset(byteOffset, 2, this.byteLength);\n var result: u16 = load(changetype(this.buffer) + this.byteOffset + byteOffset, HEADER_SIZE);\n return littleEndian ? result : bswap(result);\n }\n\n getUint32(byteOffset: i32, littleEndian: boolean = false): u32 {\n checkOffset(byteOffset, 4, this.byteLength);\n var result = load(changetype(this.buffer) + this.byteOffset + byteOffset, HEADER_SIZE);\n return littleEndian ? result : bswap(result);\n }\n\n setFloat32(byteOffset: i32, value: f32, littleEndian: boolean = false): void {\n checkOffset(byteOffset, 4, this.byteLength);\n if (littleEndian) {\n store(changetype(this.buffer) + this.byteOffset + byteOffset, value, HEADER_SIZE);\n } else {\n store(changetype(this.buffer) + this.byteOffset + byteOffset,\n bswap(\n reinterpret(value)\n ),\n HEADER_SIZE\n );\n }\n }\n\n setFloat64(byteOffset: i32, value: f64, littleEndian: boolean = false): void {\n checkOffset(byteOffset, 8, this.byteLength);\n if (littleEndian) {\n store(changetype(this.buffer) + this.byteOffset + byteOffset, value, HEADER_SIZE);\n } else {\n store(changetype(this.buffer) + this.byteOffset + byteOffset,\n bswap(\n reinterpret(value)\n ),\n HEADER_SIZE\n );\n }\n }\n\n setInt8(byteOffset: i32, value: i8): void {\n checkOffset(byteOffset, 1, this.byteLength);\n store(changetype(this.buffer) + this.byteOffset + byteOffset, value, HEADER_SIZE);\n }\n\n setInt16(byteOffset: i32, value: i16, littleEndian: boolean = false): void {\n checkOffset(byteOffset, 2, this.byteLength);\n store(\n changetype(this.buffer) + this.byteOffset + byteOffset,\n littleEndian ? value : bswap(value),\n HEADER_SIZE\n );\n }\n\n setInt32(byteOffset: i32, value: i32, littleEndian: boolean = false): void {\n checkOffset(byteOffset, 4, this.byteLength);\n store(\n changetype(this.buffer) + this.byteOffset + byteOffset,\n littleEndian ? value : bswap(value),\n HEADER_SIZE\n );\n }\n\n setUint8(byteOffset: i32, value: u8): void {\n checkOffset(byteOffset, 1, this.byteLength);\n store(changetype(this.buffer) + this.byteOffset + byteOffset, value, HEADER_SIZE);\n }\n\n setUint16(byteOffset: i32, value: u16, littleEndian: boolean = false): void {\n checkOffset(byteOffset, 2, this.byteLength);\n store(\n changetype(this.buffer) + this.byteOffset + byteOffset,\n littleEndian ? value : bswap(value),\n HEADER_SIZE\n );\n }\n\n setUint32(byteOffset: i32, value: u32, littleEndian: boolean = false): void {\n checkOffset(byteOffset, 4, this.byteLength);\n store(\n changetype(this.buffer) + this.byteOffset + byteOffset,\n littleEndian ? value : bswap(value),\n HEADER_SIZE\n );\n }\n\n // Non-standard additions that make sense in WebAssembly, but won\'t work in JS:\n\n getInt64(byteOffset: i32, littleEndian: boolean = false): i64 {\n checkOffset(byteOffset, 8, this.byteLength);\n var result = load(changetype(this.buffer) + this.byteOffset + byteOffset, HEADER_SIZE);\n return littleEndian ? result : bswap(result);\n }\n\n getUint64(byteOffset: i32, littleEndian: boolean = false): u64 {\n checkOffset(byteOffset, 8, this.byteLength);\n var result = load(changetype(this.buffer) + this.byteOffset + byteOffset, HEADER_SIZE);\n return littleEndian ? result : bswap(result);\n }\n\n setInt64(byteOffset: i32, value: i64, littleEndian: boolean = false): void {\n checkOffset(byteOffset, 8, this.byteLength);\n store(\n changetype(this.buffer) + this.byteOffset + byteOffset,\n littleEndian ? value : bswap(value),\n HEADER_SIZE\n );\n }\n\n setUint64(byteOffset: i32, value: u64, littleEndian: boolean = false): void {\n checkOffset(byteOffset, 8, this.byteLength);\n store(\n changetype(this.buffer) + this.byteOffset + byteOffset,\n littleEndian ? value : bswap(value),\n HEADER_SIZE\n );\n }\n\n toString(): string {\n return "[object DataView]";\n }\n}\n\n@inline function checkOffset(byteOffset: i32, n: i32, byteLength: i32): void {\n // n and byteLength must be known to be in bounds\n if (byteOffset > MAX_BLENGTH || byteOffset + n > byteLength) throw new Error("Offset out of bounds");\n}\n',date:'import {\n UTC as Date_UTC,\n now as Date_now\n} from "./bindings/Date";\n\nexport class Date {\n\n @inline static UTC(\n year: i32,\n month: i32 = 0,\n day: i32 = 1,\n hour: i32 = 0,\n minute: i32 = 0,\n second: i32 = 0,\n millisecond: i64 = 0\n ): i64 {\n return Date_UTC(year, month, day, hour, minute, second, millisecond);\n }\n\n @inline static now(): i64 {\n return Date_now();\n }\n\n private value: i64;\n\n constructor(value: i64) {\n this.value = value;\n }\n\n getTime(): i64 {\n return this.value;\n }\n\n setTime(value: i64): i64 {\n this.value = value;\n return value;\n }\n}\n',diagnostics:"/* tslint:disable */\n\n@builtin export declare function ERROR(message?: void): void;\n@builtin export declare function WARNING(message?: void): void;\n@builtin export declare function INFO(message?: void): void;\n",env:"declare function abort(\n message?: string | null,\n fileName?: string | null,\n lineNumber?: u32,\n columnNumber?: u32\n): void;\n\ndeclare function trace(\n message: string,\n n?: i32,\n a0?: f64,\n a1?: f64,\n a2?: f64,\n a3?: f64,\n a4?: f64\n): void;\n",error:'export class Error {\n\n name: string = "Error";\n stack: string = ""; // TODO\n\n constructor(\n public message: string = ""\n ) {}\n\n toString(): string {\n var message = this.message;\n return message.length\n ? this.name + ": " + message\n : this.name;\n }\n}\n\nexport class RangeError extends Error {\n constructor(message: string = "") {\n super(message);\n this.name = "RangeError";\n }\n}\n\nexport class TypeError extends Error {\n constructor(message: string = "") {\n super(message);\n this.name = "TypeError";\n }\n}\n\nexport class SyntaxError extends Error {\n constructor(message: string = "") {\n super(message);\n this.name = "SyntaxError";\n }\n}\n',gc:"/* tslint:disable */\n\n@builtin export declare function iterateRoots(fn: (ref: usize) => void): void;\n\nexport namespace gc {\n\n export function collect(): void {\n if (isDefined(__gc_collect)) { __gc_collect(); return; }\n WARNING(\"Calling 'gc.collect' requires a garbage collector to be present.\");\n unreachable();\n }\n}\n","internal/allocator":"/** Number of alignment bits. */\n@inline export const AL_BITS: u32 = 3;\n/** Number of possible alignment values. */\n@inline export const AL_SIZE: usize = 1 << AL_BITS;\n/** Mask to obtain just the alignment bits. */\n@inline export const AL_MASK: usize = AL_SIZE - 1;\n/** Maximum 32-bit allocation size. */\n@inline export const MAX_SIZE_32: usize = 1 << 30; // 1GB\n","internal/arraybuffer":'import {\n AL_MASK,\n MAX_SIZE_32\n } from "./allocator";\n\n/** Size of an ArrayBuffer header. */\n@inline export const HEADER_SIZE: usize = (offsetof() + AL_MASK) & ~AL_MASK;\n/** Maximum byte length of an ArrayBuffer. */\n@inline export const MAX_BLENGTH: i32 = MAX_SIZE_32 - HEADER_SIZE;\n\nfunction computeSize(byteLength: i32): usize {\n // round up to power of 2, with HEADER_SIZE=8:\n // 0 -> 2^3 = 8\n // 1..8 -> 2^4 = 16\n // 9..24 -> 2^5 = 32\n // ...\n // MAX_LENGTH -> 2^30 = 0x40000000 (MAX_SIZE_32)\n return 1 << (32 - clz(byteLength + HEADER_SIZE - 1));\n}\n\n// Low-level utility\n\nfunction __gc(ref: usize): void {}\n\nexport function allocateUnsafe(byteLength: i32): ArrayBuffer {\n assert(byteLength <= MAX_BLENGTH);\n var buffer: usize;\n if (isManaged()) {\n buffer = __gc_allocate(computeSize(byteLength), __gc); // tslint:disable-line\n } else {\n buffer = memory.allocate(computeSize(byteLength));\n }\n store(buffer, byteLength, offsetof("byteLength"));\n return changetype(buffer);\n}\n\nexport function reallocateUnsafe(buffer: ArrayBuffer, newByteLength: i32): ArrayBuffer {\n var oldByteLength = buffer.byteLength;\n if (newByteLength > oldByteLength) {\n assert(newByteLength <= MAX_BLENGTH);\n if (newByteLength <= (computeSize(oldByteLength) - HEADER_SIZE)) { // fast path: zero out additional space\n store(changetype(buffer), newByteLength, offsetof("byteLength"));\n } else { // slow path: copy to new buffer\n let newBuffer = allocateUnsafe(newByteLength);\n memory.copy(\n changetype(newBuffer) + HEADER_SIZE,\n changetype(buffer) + HEADER_SIZE,\n oldByteLength\n );\n if (!isManaged()) {\n memory.free(changetype(buffer));\n }\n buffer = newBuffer;\n }\n memory.fill(\n changetype(buffer) + HEADER_SIZE + oldByteLength,\n 0,\n (newByteLength - oldByteLength)\n );\n } else if (newByteLength < oldByteLength) { // fast path: override size\n // TBD: worth to copy and release if size is significantly less than before?\n assert(newByteLength >= 0);\n store(changetype(buffer), newByteLength, offsetof("byteLength"));\n }\n return buffer;\n}\n\n// The helpers below use two different types in order to emit loads and stores that load respectively\n// store one type to/from memory while returning/taking the desired output/input type. This allows to\n// emit instructions like\n//\n// * `i32.load8` ^= `load(...)` that reads an i8 but returns an i32, or\n// * `i64.load32_s` ^= `load(...)`) that reads a 32-bit as a 64-bit integer\n//\n// without having to emit an additional instruction for conversion purposes. The second parameter\n// can be omitted for references and other loads and stores that simply return the exact type.\n\n@inline export function LOAD(buffer: ArrayBuffer, index: i32, byteOffset: i32 = 0): TOut {\n return load(changetype(buffer) + (index << alignof()) + byteOffset, HEADER_SIZE);\n}\n\n@inline export function STORE(buffer: ArrayBuffer, index: i32, value: TIn, byteOffset: i32 = 0): void {\n store(changetype(buffer) + (index << alignof()) + byteOffset, value, HEADER_SIZE);\n}\n',"internal/hash":'import {\n HEADER_SIZE\n} from "./string";\n\n/** Computes the 32-bit hash of a value of any type. */\n@inline\nexport function HASH(key: T): u32 {\n // branch-level tree-shaking makes this a `(return (call ...))`\n if (isString(key)) {\n return hashStr(key);\n } else if (isReference()) {\n if (sizeof() == 4) return hash32(changetype(key));\n if (sizeof() == 8) return hash64(changetype(key));\n } else if (isFloat()) {\n if (sizeof() == 4) return hash32(reinterpret(key));\n if (sizeof() == 8) return hash64(reinterpret(key));\n } else {\n if (sizeof() == 1) return hash8 (key);\n if (sizeof() == 2) return hash16(key);\n if (sizeof() == 4) return hash32(key);\n if (sizeof() == 8) return hash64(key);\n }\n unreachable();\n}\n\n// FNV-1a 32-bit as a starting point, see: http://isthe.com/chongo/tech/comp/fnv/\n\n@inline const FNV_OFFSET: u32 = 2166136261;\n@inline const FNV_PRIME: u32 = 16777619;\n\nfunction hash8(key: u32): u32 {\n return (FNV_OFFSET ^ key) * FNV_PRIME;\n}\n\nfunction hash16(key: u32): u32 {\n var v = FNV_OFFSET;\n v = (v ^ ( key & 0xff)) * FNV_PRIME;\n v = (v ^ ( key >> 8 )) * FNV_PRIME;\n return v;\n}\n\nfunction hash32(key: u32): u32 {\n var v = FNV_OFFSET;\n v = (v ^ ( key & 0xff)) * FNV_PRIME;\n v = (v ^ ((key >> 8) & 0xff)) * FNV_PRIME;\n v = (v ^ ((key >> 16) & 0xff)) * FNV_PRIME;\n v = (v ^ ( key >> 24 )) * FNV_PRIME;\n return v;\n}\n\nfunction hash64(key: u64): u32 {\n var l = key;\n var h = (key >>> 32);\n var v = FNV_OFFSET;\n v = (v ^ ( l & 0xff)) * FNV_PRIME;\n v = (v ^ ((l >> 8) & 0xff)) * FNV_PRIME;\n v = (v ^ ((l >> 16) & 0xff)) * FNV_PRIME;\n v = (v ^ ( l >> 24 )) * FNV_PRIME;\n v = (v ^ ( h & 0xff)) * FNV_PRIME;\n v = (v ^ ((h >> 8) & 0xff)) * FNV_PRIME;\n v = (v ^ ((h >> 16) & 0xff)) * FNV_PRIME;\n v = (v ^ ( h >> 24 )) * FNV_PRIME;\n return v;\n}\n\nfunction hashStr(key: string): u32 {\n var v = FNV_OFFSET;\n for (let i: usize = 0, k: usize = key.length << 1; i < k; ++i) {\n v = (v ^ load(changetype(key) + i, HEADER_SIZE)) * FNV_PRIME;\n }\n return v;\n}\n',"internal/memory":"// this function will go away once `memory.copy` becomes an intrinsic\nexport function memcpy(dest: usize, src: usize, n: usize): void { // see: musl/src/string/memcpy.c\n var w: u32, x: u32;\n\n // copy 1 byte each until src is aligned to 4 bytes\n while (n && (src & 3)) {\n store(dest++, load(src++));\n n--;\n }\n\n // if dst is aligned to 4 bytes as well, copy 4 bytes each\n if ((dest & 3) == 0) {\n while (n >= 16) {\n store(dest , load(src ));\n store(dest + 4, load(src + 4));\n store(dest + 8, load(src + 8));\n store(dest + 12, load(src + 12));\n src += 16; dest += 16; n -= 16;\n }\n if (n & 8) {\n store(dest , load(src ));\n store(dest + 4, load(src + 4));\n dest += 8; src += 8;\n }\n if (n & 4) {\n store(dest, load(src));\n dest += 4; src += 4;\n }\n if (n & 2) { // drop to 2 bytes each\n store(dest, load(src));\n dest += 2; src += 2;\n }\n if (n & 1) { // drop to 1 byte\n store(dest++, load(src++));\n }\n return;\n }\n\n // if dst is not aligned to 4 bytes, use alternating shifts to copy 4 bytes each\n // doing shifts if faster when copying enough bytes (here: 32 or more)\n if (n >= 32) {\n switch (dest & 3) {\n // known to be != 0\n case 1: {\n w = load(src);\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n n -= 3;\n while (n >= 17) {\n x = load(src + 1);\n store(dest, w >> 24 | x << 8);\n w = load(src + 5);\n store(dest + 4, x >> 24 | w << 8);\n x = load(src + 9);\n store(dest + 8, w >> 24 | x << 8);\n w = load(src + 13);\n store(dest + 12, x >> 24 | w << 8);\n src += 16; dest += 16; n -= 16;\n }\n break;\n }\n case 2: {\n w = load(src);\n store(dest++, load(src++));\n store(dest++, load(src++));\n n -= 2;\n while (n >= 18) {\n x = load(src + 2);\n store(dest, w >> 16 | x << 16);\n w = load(src + 6);\n store(dest + 4, x >> 16 | w << 16);\n x = load(src + 10);\n store(dest + 8, w >> 16 | x << 16);\n w = load(src + 14);\n store(dest + 12, x >> 16 | w << 16);\n src += 16; dest += 16; n -= 16;\n }\n break;\n }\n case 3: {\n w = load(src);\n store(dest++, load(src++));\n n -= 1;\n while (n >= 19) {\n x = load(src + 3);\n store(dest, w >> 8 | x << 24);\n w = load(src + 7);\n store(dest + 4, x >> 8 | w << 24);\n x = load(src + 11);\n store(dest + 8, w >> 8 | x << 24);\n w = load(src + 15);\n store(dest + 12, x >> 8 | w << 24);\n src += 16; dest += 16; n -= 16;\n }\n break;\n }\n }\n }\n\n // copy remaining bytes one by one\n if (n & 16) {\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n }\n if (n & 8) {\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n }\n if (n & 4) {\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n }\n if (n & 2) {\n store(dest++, load(src++));\n store(dest++, load(src++));\n }\n if (n & 1) {\n store(dest++, load(src++));\n }\n}\n\n// this function will go away once `memory.copy` becomes an intrinsic\nexport function memmove(dest: usize, src: usize, n: usize): void { // see: musl/src/string/memmove.c\n if (dest === src) return;\n if (src + n <= dest || dest + n <= src) {\n memcpy(dest, src, n);\n return;\n }\n if (dest < src) {\n if ((src & 7) == (dest & 7)) {\n while (dest & 7) {\n if (!n) return;\n --n;\n store(dest++, load(src++));\n }\n while (n >= 8) {\n store(dest, load(src));\n n -= 8;\n dest += 8;\n src += 8;\n }\n }\n while (n) {\n store(dest++, load(src++));\n --n;\n }\n } else {\n if ((src & 7) == (dest & 7)) {\n while ((dest + n) & 7) {\n if (!n) return;\n store(dest + --n, load(src + n));\n }\n while (n >= 8) {\n n -= 8;\n store(dest + n, load(src + n));\n }\n }\n while (n) {\n store(dest + --n, load(src + n));\n }\n }\n}\n\n// this function will go away once `memory.fill` becomes an intrinsic\nexport function memset(dest: usize, c: u8, n: usize): void { // see: musl/src/string/memset\n\n // fill head and tail with minimal branching\n if (!n) return;\n store(dest, c);\n store(dest + n - 1, c);\n if (n <= 2) return;\n\n store(dest + 1, c);\n store(dest + 2, c);\n store(dest + n - 2, c);\n store(dest + n - 3, c);\n if (n <= 6) return;\n store(dest + 3, c);\n store(dest + n - 4, c);\n if (n <= 8) return;\n\n // advance pointer to align it at 4-byte boundary\n var k: usize = -dest & 3;\n dest += k;\n n -= k;\n n &= -4;\n\n var c32: u32 = -1 / 255 * c;\n\n // fill head/tail up to 28 bytes each in preparation\n store(dest, c32);\n store(dest + n - 4, c32);\n if (n <= 8) return;\n store(dest + 4, c32);\n store(dest + 8, c32);\n store(dest + n - 12, c32);\n store(dest + n - 8, c32);\n if (n <= 24) return;\n store(dest + 12, c32);\n store(dest + 16, c32);\n store(dest + 20, c32);\n store(dest + 24, c32);\n store(dest + n - 28, c32);\n store(dest + n - 24, c32);\n store(dest + n - 20, c32);\n store(dest + n - 16, c32);\n\n // align to a multiple of 8\n k = 24 + (dest & 4);\n dest += k;\n n -= k;\n\n // copy 32 bytes each\n var c64: u64 = c32 | (c32 << 32);\n while (n >= 32) {\n store(dest, c64);\n store(dest + 8, c64);\n store(dest + 16, c64);\n store(dest + 24, c64);\n n -= 32;\n dest += 32;\n }\n}\n\nexport function memcmp(vl: usize, vr: usize, n: usize): i32 { // see: musl/src/string/memcmp.c\n if (vl == vr) return 0;\n while (n != 0 && load(vl) == load(vr)) {\n n--; vl++; vr++;\n }\n return n ? load(vl) - load(vr) : 0;\n}\n","internal/number":'import {\n CharCode,\n allocateUnsafe as allocateUnsafeString,\n freeUnsafe as freeUnsafeString,\n HEADER_SIZE as STRING_HEADER_SIZE\n} from "./string";\n\nimport {\n LOAD\n} from "./arraybuffer";\n\n@inline export const MAX_DOUBLE_LENGTH = 28;\n\n@lazy @inline const POWERS10: u32[] = [\n 1,\n 10,\n 100,\n 1000,\n 10000,\n 100000,\n 1000000,\n 10000000,\n 100000000,\n 1000000000\n];\n\n/*\n Lookup table for pairwise char codes in range [0-99]\n\n "00", "01", "02", "03", "04", "05", "06", "07", "08", "09",\n "10", "11", "12", "13", "14", "15", "16", "17", "18", "19",\n "20", "21", "22", "23", "24", "25", "26", "27", "28", "29",\n "30", "31", "32", "33", "34", "35", "36", "37", "38", "39",\n "40", "41", "42", "43", "44", "45", "46", "47", "48", "49",\n "50", "51", "52", "53", "54", "55", "56", "57", "58", "59",\n "60", "61", "62", "63", "64", "65", "66", "67", "68", "69",\n "70", "71", "72", "73", "74", "75", "76", "77", "78", "79",\n "80", "81", "82", "83", "84", "85", "86", "87", "88", "89",\n "90", "91", "92", "93", "94", "95", "96", "97", "98", "99"\n*/\n@lazy @inline const DIGITS: u32[] = [\n 0x00300030, 0x00310030, 0x00320030, 0x00330030, 0x00340030,\n 0x00350030, 0x00360030, 0x00370030, 0x00380030, 0x00390030,\n 0x00300031, 0x00310031, 0x00320031, 0x00330031, 0x00340031,\n 0x00350031, 0x00360031, 0x00370031, 0x00380031, 0x00390031,\n 0x00300032, 0x00310032, 0x00320032, 0x00330032, 0x00340032,\n 0x00350032, 0x00360032, 0x00370032, 0x00380032, 0x00390032,\n 0x00300033, 0x00310033, 0x00320033, 0x00330033, 0x00340033,\n 0x00350033, 0x00360033, 0x00370033, 0x00380033, 0x00390033,\n 0x00300034, 0x00310034, 0x00320034, 0x00330034, 0x00340034,\n 0x00350034, 0x00360034, 0x00370034, 0x00380034, 0x00390034,\n 0x00300035, 0x00310035, 0x00320035, 0x00330035, 0x00340035,\n 0x00350035, 0x00360035, 0x00370035, 0x00380035, 0x00390035,\n 0x00300036, 0x00310036, 0x00320036, 0x00330036, 0x00340036,\n 0x00350036, 0x00360036, 0x00370036, 0x00380036, 0x00390036,\n 0x00300037, 0x00310037, 0x00320037, 0x00330037, 0x00340037,\n 0x00350037, 0x00360037, 0x00370037, 0x00380037, 0x00390037,\n 0x00300038, 0x00310038, 0x00320038, 0x00330038, 0x00340038,\n 0x00350038, 0x00360038, 0x00370038, 0x00380038, 0x00390038,\n 0x00300039, 0x00310039, 0x00320039, 0x00330039, 0x00340039,\n 0x00350039, 0x00360039, 0x00370039, 0x00380039, 0x00390039\n];\n\n@lazy @inline const EXP_POWERS: i16[] = [\n -1220, -1193, -1166, -1140, -1113, -1087, -1060, -1034, -1007, -980,\n -954, -927, -901, -874, -847, -821, -794, -768, -741, -715,\n -688, -661, -635, -608, -582, -555, -529, -502, -475, -449,\n -422, -396, -369, -343, -316, -289, -263, -236, -210, -183,\n -157, -130, -103, -77, -50, -24, 3, 30, 56, 83,\n 109, 136, 162, 189, 216, 242, 269, 295, 322, 348,\n 375, 402, 428, 455, 481, 508, 534, 561, 588, 614,\n 641, 667, 694, 720, 747, 774, 800, 827, 853, 880,\n 907, 933, 960, 986, 1013, 1039, 1066\n];\n\n// 1e-348, 1e-340, ..., 1e340\n@lazy @inline const FRC_POWERS: u64[] = [\n 0xFA8FD5A0081C0288, 0xBAAEE17FA23EBF76, 0x8B16FB203055AC76, 0xCF42894A5DCE35EA,\n 0x9A6BB0AA55653B2D, 0xE61ACF033D1A45DF, 0xAB70FE17C79AC6CA, 0xFF77B1FCBEBCDC4F,\n 0xBE5691EF416BD60C, 0x8DD01FAD907FFC3C, 0xD3515C2831559A83, 0x9D71AC8FADA6C9B5,\n 0xEA9C227723EE8BCB, 0xAECC49914078536D, 0x823C12795DB6CE57, 0xC21094364DFB5637,\n 0x9096EA6F3848984F, 0xD77485CB25823AC7, 0xA086CFCD97BF97F4, 0xEF340A98172AACE5,\n 0xB23867FB2A35B28E, 0x84C8D4DFD2C63F3B, 0xC5DD44271AD3CDBA, 0x936B9FCEBB25C996,\n 0xDBAC6C247D62A584, 0xA3AB66580D5FDAF6, 0xF3E2F893DEC3F126, 0xB5B5ADA8AAFF80B8,\n 0x87625F056C7C4A8B, 0xC9BCFF6034C13053, 0x964E858C91BA2655, 0xDFF9772470297EBD,\n 0xA6DFBD9FB8E5B88F, 0xF8A95FCF88747D94, 0xB94470938FA89BCF, 0x8A08F0F8BF0F156B,\n 0xCDB02555653131B6, 0x993FE2C6D07B7FAC, 0xE45C10C42A2B3B06, 0xAA242499697392D3,\n 0xFD87B5F28300CA0E, 0xBCE5086492111AEB, 0x8CBCCC096F5088CC, 0xD1B71758E219652C,\n 0x9C40000000000000, 0xE8D4A51000000000, 0xAD78EBC5AC620000, 0x813F3978F8940984,\n 0xC097CE7BC90715B3, 0x8F7E32CE7BEA5C70, 0xD5D238A4ABE98068, 0x9F4F2726179A2245,\n 0xED63A231D4C4FB27, 0xB0DE65388CC8ADA8, 0x83C7088E1AAB65DB, 0xC45D1DF942711D9A,\n 0x924D692CA61BE758, 0xDA01EE641A708DEA, 0xA26DA3999AEF774A, 0xF209787BB47D6B85,\n 0xB454E4A179DD1877, 0x865B86925B9BC5C2, 0xC83553C5C8965D3D, 0x952AB45CFA97A0B3,\n 0xDE469FBD99A05FE3, 0xA59BC234DB398C25, 0xF6C69A72A3989F5C, 0xB7DCBF5354E9BECE,\n 0x88FCF317F22241E2, 0xCC20CE9BD35C78A5, 0x98165AF37B2153DF, 0xE2A0B5DC971F303A,\n 0xA8D9D1535CE3B396, 0xFB9B7CD9A4A7443C, 0xBB764C4CA7A44410, 0x8BAB8EEFB6409C1A,\n 0xD01FEF10A657842C, 0x9B10A4E5E9913129, 0xE7109BFBA19C0C9D, 0xAC2820D9623BF429,\n 0x80444B5E7AA7CF85, 0xBF21E44003ACDD2D, 0x8E679C2F5E44FF8F, 0xD433179D9C8CB841,\n 0x9E19DB92B4E31BA9, 0xEB96BF6EBADF77D9, 0xAF87023B9BF0EE6B\n];\n\n// Count number of decimals for u32 values\n// In our case input value always non-zero so we can simplify some parts\nexport function decimalCount32(value: u32): u32 {\n if (ASC_SHRINK_LEVEL >= 1) {\n let l: u32 = 32 - clz(value); // log2\n let t = l * 1233 >>> 12; // log10\n\n let lutbuf = POWERS10.buffer_;\n let power = LOAD(lutbuf, t);\n t -= (value < power);\n return t + 1;\n } else {\n if (value < 100000) {\n if (value < 100) {\n return select(1, 2, value < 10);\n } else {\n let m = select(4, 5, value < 10000);\n return select(3, m, value < 1000);\n }\n } else {\n if (value < 10000000) {\n return select(6, 7, value < 1000000);\n } else {\n let m = select(9, 10, value < 1000000000);\n return select(8, m, value < 100000000);\n }\n }\n }\n}\n\n// Count number of decimals for u64 values\n// In our case input value always greater than 2^32-1 so we can skip some parts\nexport function decimalCount64(value: u64): u32 {\n if (ASC_SHRINK_LEVEL >= 1) {\n let l: u32 = 64 - clz(value); // log2\n let t = l * 1233 >>> 12; // log10\n\n let lutbuf = POWERS10.buffer_;\n let power = LOAD(lutbuf, t - 10);\n t -= (value < 10000000000 * power);\n return t + 1;\n } else {\n if (value < 1000000000000000) {\n if (value < 1000000000000) {\n return select(11, 12, value < 100000000000);\n } else {\n let m = select(14, 15, value < 100000000000000);\n return select(13, m, value < 10000000000000);\n }\n } else {\n if (value < 100000000000000000) {\n return select(16, 17, value < 10000000000000000);\n } else {\n let m = select(19, 20, value < 10000000000000000000);\n return select(18, m, value < 1000000000000000000);\n }\n }\n }\n}\n\nfunction utoa32_lut(buffer: usize, num: u32, offset: usize): void {\n var lutbuf = DIGITS.buffer_;\n\n while (num >= 10000) {\n // in most VMs i32/u32 div and modulo by constant can be shared and simplificate\n let t = num / 10000;\n let r = num % 10000;\n num = t;\n\n let d1 = r / 100;\n let d2 = r % 100;\n\n let digits1 = LOAD(lutbuf, d1);\n let digits2 = LOAD(lutbuf, d2);\n\n offset -= 4;\n store(buffer + (offset << 1), digits1 | (digits2 << 32), STRING_HEADER_SIZE);\n }\n\n if (num >= 100) {\n let t = num / 100;\n let d1 = num % 100;\n num = t;\n offset -= 2;\n let digits = LOAD(lutbuf, d1);\n store(buffer + (offset << 1), digits, STRING_HEADER_SIZE);\n }\n\n if (num >= 10) {\n offset -= 2;\n let digits = LOAD(lutbuf, num);\n store(buffer + (offset << 1), digits, STRING_HEADER_SIZE);\n } else {\n offset -= 1;\n let digit = CharCode._0 + num;\n store(buffer + (offset << 1), digit, STRING_HEADER_SIZE);\n }\n}\n\nfunction utoa64_lut(buffer: usize, num: u64, offset: usize): void {\n var lutbuf = DIGITS.buffer_;\n\n while (num >= 100000000) {\n let t = num / 100000000;\n let r = (num - t * 100000000);\n num = t;\n\n let b = r / 10000;\n let c = r % 10000;\n\n let b1 = b / 100;\n let b2 = b % 100;\n let c1 = c / 100;\n let c2 = c % 100;\n\n let digits1 = LOAD(lutbuf, c1);\n let digits2 = LOAD(lutbuf, c2);\n\n offset -= 4;\n store(buffer + (offset << 1), digits1 | (digits2 << 32), STRING_HEADER_SIZE);\n\n digits1 = LOAD(lutbuf, b1);\n digits2 = LOAD(lutbuf, b2);\n\n offset -= 4;\n store(buffer + (offset << 1), digits1 | (digits2 << 32), STRING_HEADER_SIZE);\n }\n\n utoa32_lut(buffer, num, offset);\n}\n\nfunction utoa_simple(buffer: usize, num: T, offset: usize): void {\n do {\n let t = num / 10;\n let r = (num % 10);\n num = t;\n offset -= 1;\n store(buffer + (offset << 1), CharCode._0 + r, STRING_HEADER_SIZE);\n } while (num);\n}\n\n@inline\nexport function utoa32_core(buffer: usize, num: u32, offset: u32): void {\n if (ASC_SHRINK_LEVEL >= 1) {\n utoa_simple(buffer, num, offset);\n } else {\n utoa32_lut(buffer, num, offset);\n }\n}\n\n@inline\nexport function utoa64_core(buffer: usize, num: u64, offset: u32): void {\n if (ASC_SHRINK_LEVEL >= 1) {\n utoa_simple(buffer, num, offset);\n } else {\n utoa64_lut(buffer, num, offset);\n }\n}\n\nexport function utoa32(value: u32): String {\n if (!value) return "0";\n\n var decimals = decimalCount32(value);\n var buffer = allocateUnsafeString(decimals);\n\n utoa32_core(changetype(buffer), value, decimals);\n return buffer;\n}\n\nexport function itoa32(value: i32): String {\n if (!value) return "0";\n\n var sign = value < 0;\n if (sign) value = -value;\n\n var decimals = decimalCount32(value) + sign;\n var buffer = allocateUnsafeString(decimals);\n\n utoa32_core(changetype(buffer), value, decimals);\n if (sign) store(changetype(buffer), CharCode.MINUS, STRING_HEADER_SIZE);\n\n return buffer;\n}\n\nexport function utoa64(value: u64): String {\n if (!value) return "0";\n\n var buffer: String;\n if (value <= u32.MAX_VALUE) {\n let val32 = value;\n let decimals = decimalCount32(val32);\n buffer = allocateUnsafeString(decimals);\n utoa32_core(changetype(buffer), val32, decimals);\n } else {\n let decimals = decimalCount64(value);\n buffer = allocateUnsafeString(decimals);\n utoa64_core(changetype(buffer), value, decimals);\n }\n return buffer;\n}\n\nexport function itoa64(value: i64): String {\n if (!value) return "0";\n\n var sign = value < 0;\n if (sign) value = -value;\n\n var buffer: String;\n if (value <= u32.MAX_VALUE) {\n let val32 = value;\n let decimals = decimalCount32(val32) + sign;\n buffer = allocateUnsafeString(decimals);\n utoa32_core(changetype(buffer), val32, decimals);\n } else {\n let decimals = decimalCount64(value) + sign;\n buffer = allocateUnsafeString(decimals);\n utoa64_core(changetype(buffer), value, decimals);\n }\n if (sign) store(changetype(buffer), CharCode.MINUS, STRING_HEADER_SIZE);\n\n return buffer;\n}\n\nexport function itoa(value: T): String {\n if (!isInteger()) {\n assert(false); // unexpecteble non-integer generic type\n } else {\n if (isSigned()) {\n if (sizeof() <= 4) {\n return itoa32(value);\n } else {\n return itoa64(value);\n }\n } else {\n if (sizeof() <= 4) {\n return utoa32(value);\n } else {\n return utoa64(value);\n }\n }\n }\n}\n\n@lazy var _K: i32 = 0;\n// @lazy var _frc: u64 = 0;\n@lazy var _exp: i32 = 0;\n@lazy var _frc_minus: u64 = 0;\n@lazy var _frc_plus: u64 = 0;\n@lazy var _frc_pow: u64 = 0;\n@lazy var _exp_pow: i32 = 0;\n\n@inline\nfunction umul64f(u: u64, v: u64): u64 {\n var u0 = u & 0xFFFFFFFF;\n var v0 = v & 0xFFFFFFFF;\n\n var u1 = u >> 32;\n var v1 = v >> 32;\n\n var l = u0 * v0;\n var t = u1 * v0 + (l >> 32);\n var w = u0 * v1 + (t & 0xFFFFFFFF);\n\n w += 0x7FFFFFFF; // rounding\n\n t >>= 32;\n w >>= 32;\n\n return u1 * v1 + t + w;\n}\n\n@inline\nfunction umul64e(e1: i32, e2: i32): i32 {\n return e1 + e2 + 64; // where 64 is significand size\n}\n\n@inline\nfunction normalizedBoundaries(f: u64, e: i32): void {\n var frc = (f << 1) + 1;\n var exp = e - 1;\n var off = clz(frc);\n frc <<= off;\n exp -= off;\n\n var m = 1 + (f == 0x0010000000000000);\n\n _frc_plus = frc;\n _frc_minus = ((f << m) - 1) << e - m - exp;\n _exp = exp;\n}\n\n@inline\nfunction grisuRound(buffer: usize, len: i32, delta: u64, rest: u64, ten_kappa: u64, wp_w: u64): void {\n var lastp = buffer + ((len - 1) << 1);\n var digit = load(lastp, STRING_HEADER_SIZE);\n while (\n rest < wp_w &&\n delta - rest >= ten_kappa && (\n rest + ten_kappa < wp_w ||\n wp_w - rest > rest + ten_kappa - wp_w\n )\n ) {\n --digit;\n rest += ten_kappa;\n }\n store(lastp, digit, STRING_HEADER_SIZE);\n}\n\n@inline\nfunction getCachedPower(minExp: i32): void {\n const c = reinterpret(0x3FD34413509F79FE); // 1 / lg(10) = 0.30102999566398114\n var dk = (-61 - minExp) * c + 347;\t // dk must be positive, so can do ceiling in positive\n var k = dk;\n k += (k != dk); // conversion with ceil\n\n var index = (k >> 3) + 1;\n _K = 348 - (index << 3);\t// decimal exponent no need lookup table\n var frcPowers = FRC_POWERS.buffer_;\n var expPowers = EXP_POWERS.buffer_;\n _frc_pow = LOAD(frcPowers, index);\n _exp_pow = LOAD(expPowers, index);\n}\n\n@inline\nfunction grisu2(value: f64, buffer: usize, sign: i32): i32 {\n\n // frexp routine\n var uv = reinterpret(value);\n var exp = ((uv & 0x7FF0000000000000) >>> 52);\n var sid = uv & 0x000FFFFFFFFFFFFF;\n var frc = ((exp != 0) << 52) + sid;\n exp = select(exp, 1, exp != 0) - (0x3FF + 52);\n\n normalizedBoundaries(frc, exp);\n getCachedPower(_exp);\n\n // normalize\n var off = clz(frc);\n frc <<= off;\n exp -= off;\n\n var frc_pow = _frc_pow;\n var exp_pow = _exp_pow;\n\n var w_frc = umul64f(frc, frc_pow);\n var w_exp = umul64e(exp, exp_pow);\n\n var wp_frc = umul64f(_frc_plus, frc_pow) - 1;\n var wp_exp = umul64e(_exp, exp_pow);\n\n var wm_frc = umul64f(_frc_minus, frc_pow) + 1;\n var delta = wp_frc - wm_frc;\n\n return genDigits(buffer, w_frc, w_exp, wp_frc, wp_exp, delta, sign);\n}\n\nfunction genDigits(buffer: usize, w_frc: u64, w_exp: i32, mp_frc: u64, mp_exp: i32, delta: u64, sign: i32): i32 {\n var one_exp = -mp_exp;\n var one_frc = (1) << one_exp;\n var mask = one_frc - 1;\n\n var wp_w_frc = mp_frc - w_frc;\n var wp_w_exp = mp_exp;\n\n var p1 = (mp_frc >> one_exp);\n var p2 = mp_frc & mask;\n\n var kappa = decimalCount32(p1);\n var len = sign;\n\n var powers10 = POWERS10.buffer_;\n\n while (kappa > 0) {\n let d: u32;\n switch (kappa) {\n case 10: { d = p1 / 1000000000; p1 %= 1000000000; break; }\n case 9: { d = p1 / 100000000; p1 %= 100000000; break; }\n case 8: { d = p1 / 10000000; p1 %= 10000000; break; }\n case 7: { d = p1 / 1000000; p1 %= 1000000; break; }\n case 6: { d = p1 / 100000; p1 %= 100000; break; }\n case 5: { d = p1 / 10000; p1 %= 10000; break; }\n case 4: { d = p1 / 1000; p1 %= 1000; break; }\n case 3: { d = p1 / 100; p1 %= 100; break; }\n case 2: { d = p1 / 10; p1 %= 10; break; }\n case 1: { d = p1; p1 = 0; break; }\n default: { d = 0; break; }\n }\n\n if (d | len) store(buffer + (len++ << 1), CharCode._0 + d, STRING_HEADER_SIZE);\n\n --kappa;\n let tmp = ((p1) << one_exp) + p2;\n if (tmp <= delta) {\n _K += kappa;\n grisuRound(buffer, len, delta, tmp, LOAD(powers10, kappa) << one_exp, wp_w_frc);\n return len;\n }\n }\n\n while (1) {\n p2 *= 10;\n delta *= 10;\n\n let d = p2 >> one_exp;\n if (d | len) store(buffer + (len++ << 1), CharCode._0 + d, STRING_HEADER_SIZE);\n\n p2 &= mask;\n --kappa;\n if (p2 < delta) {\n _K += kappa;\n wp_w_frc *= LOAD(powers10, -kappa);\n grisuRound(buffer, len, delta, p2, one_frc, wp_w_frc);\n return len;\n }\n }\n\n return len;\n}\n\n@inline\nfunction genExponent(buffer: usize, k: i32): i32 {\n var sign = k < 0;\n if (sign) k = -k;\n var decimals = decimalCount32(k) + 1;\n utoa32_core(buffer, k, decimals);\n store(buffer, select(CharCode.MINUS, CharCode.PLUS, sign), STRING_HEADER_SIZE);\n return decimals;\n}\n\nfunction prettify(buffer: usize, length: i32, k: i32): i32 {\n if (!k) {\n store(buffer + (length << 1), CharCode.DOT | (CharCode._0 << 16), STRING_HEADER_SIZE);\n return length + 2;\n }\n\n var kk = length + k;\n if (length <= kk && kk <= 21) {\n // 1234e7 -> 12340000000\n for (let i = length; i < kk; ++i) {\n store(buffer + (i << 1), CharCode._0, STRING_HEADER_SIZE);\n }\n store(buffer + (kk << 1), CharCode.DOT | (CharCode._0 << 16), STRING_HEADER_SIZE);\n return kk + 2;\n } else if (kk > 0 && kk <= 21) {\n // 1234e-2 -> 12.34\n let ptr = buffer + (kk << 1);\n memory.copy(\n ptr + STRING_HEADER_SIZE + 2,\n ptr + STRING_HEADER_SIZE,\n -k << 1\n );\n store(buffer + (kk << 1), CharCode.DOT, STRING_HEADER_SIZE);\n return length + 1;\n } else if (-6 < kk && kk <= 0) {\n // 1234e-6 -> 0.001234\n let offset = 2 - kk;\n memory.copy(\n buffer + STRING_HEADER_SIZE + (offset << 1),\n buffer + STRING_HEADER_SIZE,\n length << 1\n );\n store(buffer, CharCode._0 | (CharCode.DOT << 16), STRING_HEADER_SIZE);\n for (let i = 2; i < offset; ++i) {\n store(buffer + (i << 1), CharCode._0, STRING_HEADER_SIZE);\n }\n return length + offset;\n } else if (length == 1) {\n // 1e30\n store(buffer, CharCode.e, STRING_HEADER_SIZE + 2);\n length = genExponent(buffer + 4, kk - 1);\n return length + 2;\n } else {\n let len = length << 1;\n memory.copy(\n buffer + STRING_HEADER_SIZE + 4,\n buffer + STRING_HEADER_SIZE + 2,\n len - 2\n );\n store(buffer, CharCode.DOT, STRING_HEADER_SIZE + 2);\n store(buffer + len, CharCode.e, STRING_HEADER_SIZE + 2);\n length += genExponent(buffer + len + 4, kk - 1);\n return length + 2;\n }\n}\n\nexport function dtoa_core(buffer: usize, value: f64): i32 {\n var sign = (value < 0);\n if (sign) {\n value = -value;\n store(buffer, CharCode.MINUS, STRING_HEADER_SIZE);\n }\n // assert(value > 0 && value <= 1.7976931348623157e308);\n var len = grisu2(value, buffer, sign);\n len = prettify(buffer + (sign << 1), len - sign, _K);\n return len + sign;\n}\n\nexport function dtoa(value: f64): String {\n if (value == 0) return "0.0";\n if (!isFinite(value)) {\n if (isNaN(value)) return "NaN";\n return select("-Infinity", "Infinity", value < 0);\n }\n var buffer = allocateUnsafeString(MAX_DOUBLE_LENGTH);\n var length = dtoa_core(changetype(buffer), value);\n var result = buffer.substring(0, length);\n freeUnsafeString(buffer);\n return result;\n}\n\nexport function itoa_stream(buffer: usize, offset: usize, value: T): u32 {\n buffer += (offset << 1);\n if (!value) {\n store(buffer, CharCode._0, STRING_HEADER_SIZE);\n return 1;\n }\n var decimals: u32 = 0;\n if (isSigned()) {\n let sign = value < 0;\n if (sign) value = -value;\n if (sizeof() <= 4) {\n decimals = decimalCount32(value) + sign;\n utoa32_core(buffer, value, decimals);\n } else {\n if (value <= u32.MAX_VALUE) {\n let val32 = value;\n decimals = decimalCount32(val32) + sign;\n utoa32_core(buffer, val32, decimals);\n } else {\n decimals = decimalCount64(value) + sign;\n utoa64_core(buffer, value, decimals);\n }\n }\n if (sign) store(buffer, CharCode.MINUS, STRING_HEADER_SIZE);\n } else {\n if (sizeof() <= 4) {\n decimals = decimalCount32(value);\n utoa32_core(buffer, value, decimals);\n } else {\n if (value <= u32.MAX_VALUE) {\n let val32 = value;\n decimals = decimalCount32(val32);\n utoa32_core(buffer, val32, decimals);\n } else {\n decimals = decimalCount64(value);\n utoa64_core(buffer, value, decimals);\n }\n }\n }\n return decimals;\n}\n\nexport function dtoa_stream(buffer: usize, offset: usize, value: f64): u32 {\n buffer += (offset << 1);\n if (value == 0.0) {\n store(buffer, CharCode._0, STRING_HEADER_SIZE + 0);\n store(buffer, CharCode.DOT, STRING_HEADER_SIZE + 2);\n store(buffer, CharCode._0, STRING_HEADER_SIZE + 4);\n return 3;\n }\n if (!isFinite(value)) {\n if (isNaN(value)) {\n store(buffer, CharCode.N, STRING_HEADER_SIZE + 0);\n store(buffer, CharCode.a, STRING_HEADER_SIZE + 2);\n store(buffer, CharCode.N, STRING_HEADER_SIZE + 4);\n return 3;\n } else {\n let sign = (value < 0);\n let len = 8 + sign;\n let source = changetype(select("-Infinity", "Infinity", sign));\n memory.copy(buffer + STRING_HEADER_SIZE, source + STRING_HEADER_SIZE, len << 1);\n return len;\n }\n }\n return dtoa_core(buffer, value);\n}\n',"internal/sort":"import {\n LOAD,\n STORE\n} from \"./arraybuffer\";\n\nimport {\n compareUnsafe\n} from \"./string\";\n\n/** Obtains the default comparator for the specified value type. */\n@inline\nexport function COMPARATOR(): (a: T, b: T) => i32 {\n if (isInteger()) {\n if (isSigned() && sizeof() <= 4) {\n return (a: T, b: T): i32 => ((a - b));\n } else {\n return (a: T, b: T): i32 => ((a > b) - (a < b));\n }\n } else if (isFloat()) {\n if (sizeof() == 4) {\n return (a: T, b: T): i32 => {\n var ia = reinterpret(a);\n var ib = reinterpret(b);\n ia ^= (ia >> 31) >>> 1;\n ib ^= (ib >> 31) >>> 1;\n return (ia > ib) - (ia < ib);\n };\n } else {\n return (a: T, b: T): i32 => {\n var ia = reinterpret(a);\n var ib = reinterpret(b);\n ia ^= (ia >> 63) >>> 1;\n ib ^= (ib >> 63) >>> 1;\n return (ia > ib) - (ia < ib);\n };\n }\n } else if (isString()) {\n return (a: T, b: T): i32 => {\n if (a === b || a === null || b === null) return 0;\n var alen = (a).length;\n var blen = (b).length;\n if (!alen && !blen) return 0;\n if (!alen) return -1;\n if (!blen) return 1;\n return compareUnsafe(a, 0, b, 0, min(alen, blen));\n };\n } else {\n return (a: T, b: T): i32 => ((a > b) - (a < b));\n }\n}\n\n@inline\nexport function SORT(\n buffer: ArrayBuffer,\n byteOffset: i32,\n length: i32,\n comparator: (a: T, b: T) => i32\n): void {\n if (isReference()) {\n // TODO replace this to faster stable sort (TimSort) when it implemented\n insertionSort(buffer, byteOffset, length, comparator);\n } else {\n if (length < 256) {\n insertionSort(buffer, byteOffset, length, comparator);\n } else {\n weakHeapSort(buffer, byteOffset, length, comparator);\n }\n }\n}\n\n/** Sorts an Array with the 'Insertion Sort' algorithm. */\nfunction insertionSort(\n buffer: ArrayBuffer,\n byteOffset: i32,\n length: i32,\n comparator: (a: T, b: T) => i32\n): void {\n for (let i = 0; i < length; i++) {\n let a = LOAD(buffer, i, byteOffset); // a = arr[i]\n let j = i - 1;\n while (j >= 0) {\n let b = LOAD(buffer, j, byteOffset); // b = arr[j]\n if (comparator(a, b) < 0) {\n STORE(buffer, j-- + 1, b, byteOffset); // arr[j + 1] = b\n } else break;\n }\n STORE(buffer, j + 1, a, byteOffset); // arr[j + 1] = a\n }\n}\n\n/** Sorts an Array with the 'Weak Heap Sort' algorithm. */\nfunction weakHeapSort(\n buffer: ArrayBuffer,\n byteOffset: i32,\n length: i32,\n comparator: (a: T, b: T) => i32\n): void {\n const shift32 = alignof();\n\n var bitsetSize = (length + 31) >> 5 << shift32;\n var bitset = memory.allocate(bitsetSize); // indexed in 32-bit chunks below\n memory.fill(bitset, 0, bitsetSize);\n\n // see: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.21.1863&rep=rep1&type=pdf\n\n for (let i = length - 1; i > 0; i--) {\n let j = i;\n while ((j & 1) == (load(bitset + (j >> 6 << shift32)) >> (j >> 1 & 31) & 1)) j >>= 1;\n\n let p = j >> 1;\n let a = LOAD(buffer, p, byteOffset); // a = arr[p]\n let b = LOAD(buffer, i, byteOffset); // b = arr[i]\n if (comparator(a, b) < 0) {\n store(\n bitset + (i >> 5 << shift32),\n load(bitset + (i >> 5 << shift32)) ^ (1 << (i & 31))\n );\n STORE(buffer, i, a, byteOffset); // arr[i] = a\n STORE(buffer, p, b, byteOffset); // arr[p] = b\n }\n }\n\n for (let i = length - 1; i >= 2; i--) {\n let a = LOAD(buffer, 0, byteOffset);\n STORE(buffer, 0, LOAD(buffer, i, byteOffset), byteOffset);\n STORE(buffer, i, a, byteOffset);\n\n let x = 1, y: i32;\n while ((y = (x << 1) + ((load(bitset + (x >> 5 << shift32)) >> (x & 31)) & 1)) < i) x = y;\n\n while (x > 0) {\n a = LOAD(buffer, 0, byteOffset); // a = arr[0]\n let b = LOAD(buffer, x, byteOffset); // b = arr[x]\n\n if (comparator(a, b) < 0) {\n store(\n bitset + (x >> 5 << shift32),\n load(bitset + (x >> 5 << shift32)) ^ (1 << (x & 31))\n );\n STORE(buffer, x, a, byteOffset); // arr[x] = a\n STORE(buffer, 0, b, byteOffset); // arr[0] = b\n }\n x >>= 1;\n }\n }\n\n memory.free(bitset);\n\n var t = LOAD(buffer, 1, byteOffset); // t = arr[1]\n STORE(buffer, 1, LOAD(buffer, 0, byteOffset), byteOffset);\n STORE(buffer, 0, t, byteOffset); // arr[0] = t\n}\n","internal/string":'import { MAX_SIZE_32 } from "./allocator";\nimport { String } from "../string";\n\n/** Size of a String header. */\n@inline export const HEADER_SIZE = (offsetof() + 1) & ~1; // 2 byte aligned\n/** Maximum length of a String. */\n@inline export const MAX_LENGTH = (MAX_SIZE_32 - HEADER_SIZE) >>> 1;\n\n// Low-level utility\n\nfunction __gc(ref: usize): void {}\n\nexport function allocateUnsafe(length: i32): String {\n assert(length > 0 && length <= MAX_LENGTH);\n var buffer: usize;\n if (isManaged()) {\n buffer = __gc_allocate(HEADER_SIZE + (length << 1), __gc); // tslint:disable-line\n } else {\n buffer = memory.allocate(HEADER_SIZE + (length << 1));\n }\n store(buffer, length);\n return changetype(buffer);\n}\n\n@inline\nexport function freeUnsafe(buffer: String): void {\n if (!isManaged()) {\n assert(buffer);\n memory.free(changetype(buffer));\n }\n}\n\nexport function copyUnsafe(dest: String, destOffset: usize, src: String, srcOffset: usize, len: usize): void {\n memory.copy(\n changetype(dest) + (destOffset << 1) + HEADER_SIZE,\n changetype(src) + (srcOffset << 1) + HEADER_SIZE,\n len << 1\n );\n}\n\nexport function compareUnsafe(str1: String, offset1: usize, str2: String, offset2: usize, len: usize): i32 {\n var cmp: i32 = 0;\n var ptr1 = changetype(str1) + (offset1 << 1);\n var ptr2 = changetype(str2) + (offset2 << 1);\n while (len && !(cmp = load(ptr1, HEADER_SIZE) - load(ptr2, HEADER_SIZE))) {\n --len, ptr1 += 2, ptr2 += 2;\n }\n return cmp;\n}\n\nexport function repeatUnsafe(dest: String, destOffset: usize, src: String, count: i32): void {\n var length = src.length;\n if (ASC_SHRINK_LEVEL > 1) {\n let strLen = length << 1;\n let to = changetype(dest) + HEADER_SIZE + (destOffset << 1);\n let from = changetype(src) + HEADER_SIZE;\n for (let i = 0, len = strLen * count; i < len; i += strLen) {\n memory.copy(to + i, from, strLen);\n }\n } else {\n switch (length) {\n case 0: break;\n case 1: {\n let cc = load(changetype(src), HEADER_SIZE);\n let out = changetype(dest) + (destOffset << 1);\n for (let i = 0; i < count; ++i) {\n store(out + (i << 1), cc, HEADER_SIZE);\n }\n break;\n }\n case 2: {\n let cc = load(changetype(src), HEADER_SIZE);\n let out = changetype(dest) + (destOffset << 1);\n for (let i = 0; i < count; ++i) {\n store(out + (i << 2), cc, HEADER_SIZE);\n }\n break;\n }\n case 3: {\n let cc1 = load(changetype(src), HEADER_SIZE + 0);\n let cc2 = load(changetype(src), HEADER_SIZE + 4);\n let out = changetype(dest) + (destOffset << 1);\n for (let i = 0; i < count; ++i) {\n store(out + (i << 2), cc1, HEADER_SIZE + 0);\n store(out + (i << 1), cc2, HEADER_SIZE + 4);\n }\n break;\n }\n case 4: {\n let cc = load(changetype(src), HEADER_SIZE);\n let out = changetype(dest) + (destOffset << 1);\n for (let i = 0; i < count; ++i) {\n store(out + (i << 3), cc, HEADER_SIZE);\n }\n break;\n }\n default: {\n let strLen = length << 1;\n let to = changetype(dest) + HEADER_SIZE + (destOffset << 1);\n let from = changetype(src) + HEADER_SIZE;\n for (let i = 0, len = strLen * count; i < len; i += strLen) {\n memory.copy(to + i, from, strLen);\n }\n break;\n }\n }\n }\n}\n\n// Helpers\n\n@inline export const enum CharCode {\n PLUS = 0x2B,\n MINUS = 0x2D,\n DOT = 0x2E,\n _0 = 0x30,\n _1 = 0x31,\n _2 = 0x32,\n _3 = 0x33,\n _4 = 0x34,\n _5 = 0x35,\n _6 = 0x36,\n _7 = 0x37,\n _8 = 0x38,\n _9 = 0x39,\n A = 0x41,\n B = 0x42,\n E = 0x45,\n N = 0x4E,\n O = 0x4F,\n X = 0x58,\n Z = 0x5a,\n a = 0x61,\n b = 0x62,\n e = 0x65,\n n = 0x6E,\n o = 0x6F,\n x = 0x78,\n z = 0x7A\n}\n\nexport function isWhiteSpaceOrLineTerminator(c: u16): bool {\n switch (c) {\n case 9: // \n case 10: // \n case 13: // \n case 11: // \n case 12: // \n case 32: // \n case 160: // \n case 8232: // \n case 8233: // \n case 65279: return true; // \n default: return false;\n }\n}\n\n/** Parses a string to an integer (usually), using the specified radix. */\nexport function parse(str: String, radix: i32 = 0): T {\n var len: i32 = str.length;\n if (!len) return NaN;\n\n var ptr = changetype(str) /* + HEAD -> offset */;\n var code = load(ptr, HEADER_SIZE);\n\n // determine sign\n var sign: T;\n if (code == CharCode.MINUS) {\n if (!--len) return NaN;\n code = load(ptr += 2, HEADER_SIZE);\n sign = -1;\n } else if (code == CharCode.PLUS) {\n if (!--len) return NaN;\n code = load(ptr += 2, HEADER_SIZE);\n sign = 1;\n } else {\n sign = 1;\n }\n\n // determine radix\n if (!radix) {\n if (code == CharCode._0 && len > 2) {\n switch (load(ptr + 2, HEADER_SIZE)) {\n case CharCode.B:\n case CharCode.b: {\n ptr += 4; len -= 2;\n radix = 2;\n break;\n }\n case CharCode.O:\n case CharCode.o: {\n ptr += 4; len -= 2;\n radix = 8;\n break;\n }\n case CharCode.X:\n case CharCode.x: {\n ptr += 4; len -= 2;\n radix = 16;\n break;\n }\n default: radix = 10;\n }\n } else radix = 10;\n } else if (radix < 2 || radix > 36) {\n return NaN;\n }\n\n // calculate value\n var num: T = 0;\n while (len--) {\n code = load(ptr, HEADER_SIZE);\n if (code >= CharCode._0 && code <= CharCode._9) {\n code -= CharCode._0;\n } else if (code >= CharCode.A && code <= CharCode.Z) {\n code -= CharCode.A - 10;\n } else if (code >= CharCode.a && code <= CharCode.z) {\n code -= CharCode.a - 10;\n } else break;\n if (code >= radix) break;\n num = (num * radix) + code;\n ptr += 2;\n }\n return sign * num;\n}\n',"internal/typedarray":'import {\n HEADER_SIZE as AB_HEADER_SIZE,\n MAX_BLENGTH as AB_MAX_BLENGTH,\n allocateUnsafe,\n LOAD,\n STORE\n} from "./arraybuffer";\n\nimport {\n SORT as SORT_IMPL\n} from "./sort";\n\n/** Typed array base class. Not a global object. */\nexport abstract class TypedArray {\n [key: number]: T; // compatibility only\n\n readonly buffer: ArrayBuffer;\n readonly byteOffset: i32;\n readonly byteLength: i32;\n\n constructor(length: i32) {\n const MAX_LENGTH = AB_MAX_BLENGTH / sizeof();\n if (length > MAX_LENGTH) throw new RangeError("Invalid typed array length");\n var byteLength = length << alignof();\n var buffer = allocateUnsafe(byteLength);\n memory.fill(changetype(buffer) + AB_HEADER_SIZE, 0, byteLength);\n this.buffer = buffer;\n this.byteOffset = 0;\n this.byteLength = byteLength;\n }\n\n @inline\n get length(): i32 {\n return this.byteLength >>> alignof();\n }\n\n @operator("[]")\n protected __get(index: i32): T {\n if (index >= (this.byteLength >>> alignof())) throw new Error("Index out of bounds");\n return LOAD(this.buffer, index, this.byteOffset);\n }\n\n @inline @operator("{}")\n protected __unchecked_get(index: i32): T {\n return LOAD(this.buffer, index, this.byteOffset);\n }\n\n @operator("[]=")\n protected __set(index: i32, value: native): void {\n if (index >= (this.byteLength >>> alignof())) throw new Error("Index out of bounds");\n STORE>(this.buffer, index, value, this.byteOffset);\n }\n\n @inline @operator("{}=")\n protected __unchecked_set(index: i32, value: native): void {\n STORE>(this.buffer, index, value, this.byteOffset);\n }\n\n // copyWithin(target: i32, start: i32, end: i32 = this.length): this\n}\n\n@inline\nexport function FILL, T extends number>(\n array: TArray,\n value: native,\n start: i32,\n end: i32\n): TArray {\n var buffer = array.buffer;\n var byteOffset = array.byteOffset;\n var len = array.length;\n start = start < 0 ? max(len + start, 0) : min(start, len);\n end = end < 0 ? max(len + end, 0) : min(end, len);\n if (sizeof() == 1) {\n if (start < end) {\n memory.fill(\n changetype(buffer) + start + byteOffset + AB_HEADER_SIZE,\n value,\n (end - start)\n );\n }\n } else {\n for (; start < end; ++start) {\n STORE>(buffer, start, value, byteOffset);\n }\n }\n return array;\n}\n\n@inline\nexport function SORT, T>(\n array: TArray,\n comparator: (a: T, b: T) => i32\n): TArray {\n var byteOffset = array.byteOffset;\n var length = array.length;\n if (length <= 1) return array;\n var buffer = array.buffer;\n if (length == 2) {\n let a = LOAD(buffer, 1, byteOffset);\n let b = LOAD(buffer, 0, byteOffset);\n if (comparator(a, b) < 0) {\n STORE(buffer, 1, b, byteOffset);\n STORE(buffer, 0, a, byteOffset);\n }\n return array;\n }\n SORT_IMPL(buffer, byteOffset, length, comparator);\n return array;\n}\n\n@inline\nexport function SUBARRAY, T>(\n array: TArray,\n begin: i32,\n end: i32\n): TArray {\n var length = array.length;\n if (begin < 0) begin = max(length + begin, 0);\n else begin = min(begin, length);\n if (end < 0) end = max(length + end, begin);\n else end = max(min(end, length), begin);\n var slice = memory.allocate(offsetof());\n store(slice, array.buffer, offsetof("buffer"));\n store(slice, array.byteOffset + (begin << alignof()), offsetof("byteOffset"));\n store(slice, (end - begin) << alignof(), offsetof("byteLength"));\n return changetype(slice);\n}\n\n@inline\nexport function REDUCE, T, TRet>(\n array: TArray,\n callbackfn: (accumulator: TRet, value: T, index: i32, array: TArray) => TRet,\n initialValue: TRet\n): TRet {\n var length = array.length;\n var buffer = array.buffer;\n var byteOffset = array.byteOffset;\n for (let i = 0; i < length; i++) {\n initialValue = callbackfn(\n initialValue,\n LOAD(buffer, i, byteOffset),\n i,\n array,\n );\n }\n return initialValue;\n}\n\n@inline\nexport function REDUCE_RIGHT, T, TRet>(\n array: TArray,\n callbackfn: (accumulator: TRet, value: T, index: i32, array: TArray) => TRet,\n initialValue: TRet\n): TRet {\n var buffer = array.buffer;\n var byteOffset = array.byteOffset;\n for (let i = array.length - 1; i >= 0; i--) {\n initialValue = callbackfn(\n initialValue,\n LOAD(buffer, i, byteOffset),\n i,\n array,\n );\n }\n return initialValue;\n}\n\n@inline\nexport function MAP, T>(\n array: TArray,\n callbackfn: (value: T, index: i32, self: TArray) => T,\n): TArray {\n var length = array.length;\n var buffer = array.buffer;\n var byteOffset = array.byteOffset;\n var result = instantiate(length);\n var resultBuffer = result.buffer;\n for (let i = 0; i < length; i++) {\n STORE>(resultBuffer, i, >callbackfn(LOAD(buffer, i, byteOffset), i, array));\n }\n\n return result;\n}\n\n@inline\nexport function FIND_INDEX, T>(\n array: TArray,\n callbackfn: (value: T, index: i32, array: TArray) => bool,\n): i32 {\n var length = array.length;\n var buffer = array.buffer;\n var byteOffset = array.byteOffset;\n for (let i = 0; i < length; i++) {\n if (callbackfn(LOAD(buffer, i, byteOffset), i, array)) {\n return i;\n }\n }\n return -1;\n}\n\n@inline\nexport function SOME, T>(\n array: TArray,\n callbackfn: (value: T, index: i32, array: TArray) => bool,\n): bool {\n var length = array.length;\n var buffer = array.buffer;\n var byteOffset = array.byteOffset;\n for (let i = 0; i < length; i++) {\n if (callbackfn(LOAD(buffer, i, byteOffset), i, array)) {\n return true;\n }\n }\n return false;\n}\n\n@inline\nexport function EVERY, T>(\n array: TArray,\n callbackfn: (value: T, index: i32, array: TArray) => bool,\n): bool {\n var length = array.length;\n var buffer = array.buffer;\n var byteOffset = array.byteOffset;\n for (let i = 0; i < length; i++) {\n if (callbackfn(LOAD(buffer, i, byteOffset), i, array)) {\n continue;\n }\n return false;\n }\n return true;\n}\n\n@inline\nexport function FOREACH, T>(\n array: TArray,\n callbackfn: (value: T, index: i32, array: TArray) => void,\n): void {\n var length = array.length;\n var buffer = array.buffer;\n var byteOffset = array.byteOffset;\n for (let i = 0; i < length; i++) {\n callbackfn(LOAD(buffer, i, byteOffset), i, array);\n }\n}\n\n@inline\nexport function REVERSE, T>(array: TArray): TArray {\n var buffer = array.buffer;\n var byteOffset = array.byteOffset;\n\n for (let front = 0, back = array.length - 1; front < back; ++front, --back) {\n let temp = LOAD(buffer, front, byteOffset);\n STORE(buffer, front, LOAD(buffer, back, byteOffset), byteOffset);\n STORE(buffer, back, temp, byteOffset);\n }\n return array;\n}\n',iterator:"export abstract class Iterable {\n // ?\n}\n\n@sealed\nexport abstract class Iterator {\n\n // private constructor(iterable: Iterable) {\n // }\n\n // TODO: these need to evaluate the classId at the respective reference in order to obtain the\n // next value, i.e. arrays work differently than maps. we'd then have:\n //\n // ╒═══════════════════ Iterator layout (32-bit) ══════════════════╕\n // 3 2 1\n // 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits\n // ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┤\n // │ index │\n // ├─────────────────────────────────────────────────────────┬───┬─┤\n // │ reference │ 0 │D│\n // └─────────────────────────────────────────────────────────┴───┴─┘\n // D: Done flag\n\n // get value(this: u64): T {\n // ?\n // }\n\n // next(this: u64): Iterator {\n // ?\n // }\n\n done(this: u64): bool {\n return (this & 1);\n }\n}\n",map:'import {\n HEADER_SIZE as HEADER_SIZE_AB\n} from "./internal/arraybuffer";\n\nimport {\n HASH\n} from "./internal/hash";\n\n// A deterministic hash map based on CloseTable from https://github.com/jorendorff/dht\n\n@inline const INITIAL_CAPACITY = 4;\n@inline const FILL_FACTOR: f64 = 8 / 3;\n@inline const FREE_FACTOR: f64 = 3 / 4;\n\n/** Structure of a map entry. */\n@unmanaged class MapEntry {\n key: K;\n value: V;\n taggedNext: usize; // LSB=1 indicates EMPTY\n}\n\n/** Empty bit. */\n@inline const EMPTY: usize = 1 << 0;\n\n/** Size of a bucket. */\n@inline const BUCKET_SIZE = sizeof();\n\n/** Computes the alignment of an entry. */\n@inline function ENTRY_ALIGN(): usize {\n // can align to 4 instead of 8 if 32-bit and K/V is <= 32-bits\n const maxkv = sizeof() > sizeof() ? sizeof() : sizeof();\n const align = (maxkv > sizeof() ? maxkv : sizeof()) - 1;\n return align;\n}\n\n/** Computes the aligned size of an entry. */\n@inline function ENTRY_SIZE(): usize {\n const align = ENTRY_ALIGN();\n const size = (offsetof>() + align) & ~align;\n return size;\n}\n\nexport class Map {\n\n // buckets holding references to the respective first entry within\n private buckets: ArrayBuffer; // usize[bucketsMask + 1]\n private bucketsMask: u32;\n\n // entries in insertion order\n private entries: ArrayBuffer; // MapEntry[entriesCapacity]\n private entriesCapacity: i32;\n private entriesOffset: i32;\n private entriesCount: i32;\n\n get size(): i32 { return this.entriesCount; }\n\n constructor() { this.clear(); }\n\n clear(): void {\n const bucketsSize = INITIAL_CAPACITY * BUCKET_SIZE;\n this.buckets = new ArrayBuffer(bucketsSize);\n this.bucketsMask = INITIAL_CAPACITY - 1;\n const entriesSize = INITIAL_CAPACITY * ENTRY_SIZE();\n this.entries = new ArrayBuffer(entriesSize, true);\n this.entriesCapacity = INITIAL_CAPACITY;\n this.entriesOffset = 0;\n this.entriesCount = 0;\n }\n\n private find(key: K, hashCode: u32): MapEntry | null {\n var entry = load>(\n changetype(this.buckets) + (hashCode & this.bucketsMask) * BUCKET_SIZE,\n HEADER_SIZE_AB\n );\n while (entry) {\n if (!(entry.taggedNext & EMPTY) && entry.key == key) return entry;\n entry = changetype>(entry.taggedNext & ~EMPTY);\n }\n return null;\n }\n\n has(key: K): bool {\n return this.find(key, HASH(key)) !== null;\n }\n\n get(key: K): V {\n var entry = this.find(key, HASH(key));\n return entry ? entry.value : unreachable();\n }\n\n set(key: K, value: V): void {\n var hashCode = HASH(key);\n var entry = this.find(key, hashCode);\n if (entry) {\n entry.value = value;\n } else {\n // check if rehashing is necessary\n if (this.entriesOffset == this.entriesCapacity) {\n this.rehash(\n this.entriesCount < (this.entriesCapacity * FREE_FACTOR)\n ? this.bucketsMask // just rehash if 1/4+ entries are empty\n : (this.bucketsMask << 1) | 1 // grow capacity to next 2^N\n );\n }\n // append new entry\n let entries = this.entries;\n entry = changetype>(\n changetype(entries) + HEADER_SIZE_AB + this.entriesOffset++ * ENTRY_SIZE()\n );\n entry.key = key;\n entry.value = value;\n ++this.entriesCount;\n // link with previous entry in bucket\n let bucketPtrBase = changetype(this.buckets) + (hashCode & this.bucketsMask) * BUCKET_SIZE;\n entry.taggedNext = load(bucketPtrBase, HEADER_SIZE_AB);\n store(bucketPtrBase, changetype(entry), HEADER_SIZE_AB);\n if (isManaged()) __gc_link(changetype(this), changetype(key)); // tslint:disable-line\n if (isManaged()) __gc_link(changetype(this), changetype(value)); // tslint:disable-line\n }\n }\n\n delete(key: K): bool {\n var entry = this.find(key, HASH(key));\n if (!entry) return false;\n entry.taggedNext |= EMPTY;\n --this.entriesCount;\n // check if rehashing is appropriate\n var halfBucketsMask = this.bucketsMask >> 1;\n if (\n halfBucketsMask + 1 >= max(INITIAL_CAPACITY, this.entriesCount) &&\n this.entriesCount < (this.entriesCapacity * FREE_FACTOR)\n ) this.rehash(halfBucketsMask);\n return true;\n }\n\n private rehash(newBucketsMask: u32): void {\n var newBucketsCapacity = (newBucketsMask + 1);\n var newBuckets = new ArrayBuffer(newBucketsCapacity * BUCKET_SIZE);\n var newEntriesCapacity = (newBucketsCapacity * FILL_FACTOR);\n var newEntries = new ArrayBuffer(newEntriesCapacity * ENTRY_SIZE(), true);\n\n // copy old entries to new entries\n var oldPtr = changetype(this.entries) + HEADER_SIZE_AB;\n var oldEnd = oldPtr + this.entriesOffset * ENTRY_SIZE();\n var newPtr = changetype(newEntries) + HEADER_SIZE_AB;\n while (oldPtr != oldEnd) {\n let oldEntry = changetype>(oldPtr);\n if (!(oldEntry.taggedNext & EMPTY)) {\n let newEntry = changetype>(newPtr);\n newEntry.key = oldEntry.key;\n newEntry.value = oldEntry.value;\n let newBucketIndex = HASH(oldEntry.key) & newBucketsMask;\n let newBucketPtrBase = changetype(newBuckets) + newBucketIndex * BUCKET_SIZE;\n newEntry.taggedNext = load(newBucketPtrBase, HEADER_SIZE_AB);\n store(newBucketPtrBase, newPtr, HEADER_SIZE_AB);\n newPtr += ENTRY_SIZE();\n }\n oldPtr += ENTRY_SIZE();\n }\n\n this.buckets = newBuckets;\n this.bucketsMask = newBucketsMask;\n this.entries = newEntries;\n this.entriesCapacity = newEntriesCapacity;\n this.entriesOffset = this.entriesCount;\n }\n\n toString(): string {\n return "[object Map]";\n }\n\n private __gc(): void {\n __gc_mark(changetype(this.buckets)); // tslint:disable-line\n var entries = this.entries;\n __gc_mark(changetype(entries)); // tslint:disable-line\n if (isManaged() || isManaged()) {\n let offset: usize = 0;\n let end: usize = this.entriesOffset * ENTRY_SIZE();\n while (offset < end) {\n let entry = changetype>(\n changetype(entries) + HEADER_SIZE_AB + offset * ENTRY_SIZE()\n );\n if (!(entry.taggedNext & EMPTY)) {\n if (isManaged()) __gc_mark(changetype(entry.key)); // tslint:disable-line\n if (isManaged()) __gc_mark(changetype(entry.value)); // tslint:disable-line\n }\n offset += ENTRY_SIZE();\n }\n }\n }\n}\n',math:'import * as JSMath from "./bindings/Math";\nexport { JSMath };\n\nimport {\n abs as builtin_abs,\n ceil as builtin_ceil,\n clz as builtin_clz,\n copysign as builtin_copysign,\n floor as builtin_floor,\n max as builtin_max,\n min as builtin_min,\n sqrt as builtin_sqrt,\n trunc as builtin_trunc\n} from "./builtins";\n\n// SUN COPYRIGHT NOTICE\n//\n// Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.\n// Developed at SunPro, a Sun Microsystems, Inc. business.\n// Permission to use, copy, modify, and distribute this software\n// is freely granted, provided that this notice is preserved.\n//\n// Applies to all functions marked with a comment referring here.\n\n// TODO: sin, cos, tan for Math namespace\n\n/** @internal */\nfunction R(z: f64): f64 { // Rational approximation of (asin(x)-x)/x^3\n const // see: musl/src/math/asin.c and SUN COPYRIGHT NOTICE above\n pS0 = reinterpret(0x3FC5555555555555), // 1.66666666666666657415e-01\n pS1 = reinterpret(0xBFD4D61203EB6F7D), // -3.25565818622400915405e-01\n pS2 = reinterpret(0x3FC9C1550E884455), // 2.01212532134862925881e-01\n pS3 = reinterpret(0xBFA48228B5688F3B), // -4.00555345006794114027e-02\n pS4 = reinterpret(0x3F49EFE07501B288), // 7.91534994289814532176e-04\n pS5 = reinterpret(0x3F023DE10DFDF709), // 3.47933107596021167570e-05\n qS1 = reinterpret(0xC0033A271C8A2D4B), // -2.40339491173441421878e+00\n qS2 = reinterpret(0x40002AE59C598AC8), // 2.02094576023350569471e+00\n qS3 = reinterpret(0xBFE6066C1B8D0159), // -6.88283971605453293030e-01\n qS4 = reinterpret(0x3FB3B8C5B12E9282); // 7.70381505559019352791e-02\n var p = z * (pS0 + z * (pS1 + z * (pS2 + z * (pS3 + z * (pS4 + z * pS5)))));\n var q = 1.0 + z * (qS1 + z * (qS2 + z * (qS3 + z * qS4)));\n return p / q;\n}\n\n@inline function expo2(x: f64): f64 { // exp(x)/2 for x >= log(DBL_MAX)\n const // see: musl/src/math/__expo2.c\n k = 2043,\n kln2 = reinterpret(0x40962066151ADD8B); // 0x1.62066151add8bp+10\n var scale = reinterpret(((0x3FF + k / 2) << 20) << 32);\n return NativeMath.exp(x - kln2) * scale * scale;\n}\n\n/** @internal */\n@lazy var random_seeded = false;\n@lazy var random_state0_64: u64;\n@lazy var random_state1_64: u64;\n@lazy var random_state0_32: u32;\n@lazy var random_state1_32: u32;\n\nfunction murmurHash3(h: u64): u64 { // Force all bits of a hash block to avalanche\n h ^= h >> 33; // see: https://github.com/aappleby/smhasher\n h *= 0xFF51AFD7ED558CCD;\n h ^= h >> 33;\n h *= 0xC4CEB9FE1A85EC53;\n h ^= h >> 33;\n return h;\n}\n\nfunction splitMix32(h: u32): u32 {\n h += 0x6D2B79F5;\n h = (h ^ (h >> 15)) * (h | 1);\n h ^= h + (h ^ (h >> 7)) * (h | 61);\n return h ^ (h >> 14);\n}\n\nexport namespace NativeMath {\n\n @lazy export const E = reinterpret(0x4005BF0A8B145769); // 2.7182818284590452354\n @lazy export const LN2 = reinterpret(0x3FE62E42FEFA39EF); // 0.69314718055994530942\n @lazy export const LN10 = reinterpret(0x40026BB1BBB55516); // 2.30258509299404568402\n @lazy export const LOG2E = reinterpret(0x3FF71547652B82FE); // 1.4426950408889634074\n @lazy export const LOG10E = reinterpret(0x3FDBCB7B1526E50E); // 0.43429448190325182765\n @lazy export const PI = reinterpret(0x400921FB54442D18); // 3.14159265358979323846\n @lazy export const SQRT1_2 = reinterpret(0x3FE6A09E667F3BCD); // 0.70710678118654752440\n @lazy export const SQRT2 = reinterpret(0x3FF6A09E667F3BCD); // 1.41421356237309504880\n\n @inline\n export function abs(x: f64): f64 {\n return builtin_abs(x);\n }\n\n export function acos(x: f64): f64 { // see: musl/src/math/acos.c and SUN COPYRIGHT NOTICE above\n const\n pio2_hi = reinterpret(0x3FF921FB54442D18), // 1.57079632679489655800e+00\n pio2_lo = reinterpret(0x3C91A62633145C07), // 6.12323399573676603587e-17\n Ox1p_120f = reinterpret(0x03800000);\n var hx = (reinterpret(x) >> 32);\n var ix = hx & 0x7FFFFFFF;\n if (ix >= 0x3FF00000) {\n let lx = reinterpret(x);\n if ((ix - 0x3FF00000 | lx) == 0) {\n if (hx >> 31) return 2 * pio2_hi + Ox1p_120f;\n return 0;\n }\n return 0 / (x - x);\n }\n if (ix < 0x3FE00000) {\n if (ix <= 0x3C600000) return pio2_hi + Ox1p_120f;\n return pio2_hi - (x - (pio2_lo - x * R(x * x)));\n }\n var s: f64, w: f64, z: f64;\n if (hx >> 31) {\n // z = (1.0 + x) * 0.5;\n z = 0.5 + x * 0.5;\n s = builtin_sqrt(z);\n w = R(z) * s - pio2_lo;\n return 2 * (pio2_hi - (s + w));\n }\n // z = (1.0 - x) * 0.5;\n z = 0.5 - x * 0.5;\n s = builtin_sqrt(z);\n var df = reinterpret(reinterpret(s) & 0xFFFFFFFF00000000);\n var c = (z - df * df) / (s + df);\n w = R(z) * s + c;\n return 2 * (df + w);\n }\n\n export function acosh(x: f64): f64 { // see: musl/src/math/acosh.c\n const s = reinterpret(0x3FE62E42FEFA39EF);\n var e = reinterpret(x) >> 52 & 0x7FF;\n if (e < 0x3FF + 1) return log1p(x - 1 + builtin_sqrt((x - 1) * (x - 1) + 2 * (x - 1)));\n if (e < 0x3FF + 26) return log(2 * x - 1 / (x + builtin_sqrt(x * x - 1)));\n return log(x) + s;\n }\n\n export function asin(x: f64): f64 { // see: musl/src/math/asin.c and SUN COPYRIGHT NOTICE above\n const\n pio2_hi = reinterpret(0x3FF921FB54442D18), // 1.57079632679489655800e+00\n pio2_lo = reinterpret(0x3C91A62633145C07), // 6.12323399573676603587e-17\n Ox1p_120f = reinterpret(0x03800000);\n var hx = (reinterpret(x) >> 32);\n var ix = hx & 0x7FFFFFFF;\n if (ix >= 0x3FF00000) {\n let lx = reinterpret(x);\n if ((ix - 0x3FF00000 | lx) == 0) return x * pio2_hi + Ox1p_120f;\n return 0 / (x - x);\n }\n if (ix < 0x3FE00000) {\n if (ix < 0x3E500000 && ix >= 0x00100000) return x;\n return x + x * R(x * x);\n }\n // var z = (1.0 - builtin_abs(x)) * 0.5;\n var z = 0.5 - builtin_abs(x) * 0.5;\n var s = builtin_sqrt(z);\n var r = R(z);\n if (ix >= 0x3FEF3333) x = pio2_hi - (2 * (s + s * r) - pio2_lo);\n else {\n let f = reinterpret(reinterpret(s) & 0xFFFFFFFF00000000);\n let c = (z - f * f) / (s + f);\n x = 0.5 * pio2_hi - (2 * s * r - (pio2_lo - 2 * c) - (0.5 * pio2_hi - 2 * f));\n }\n if (hx >> 31) return -x;\n return x;\n }\n\n export function asinh(x: f64): f64 { // see: musl/src/math/asinh.c\n const c = reinterpret(0x3FE62E42FEFA39EF); // 0.693147180559945309417232121458176568\n var u = reinterpret(x);\n var e = u >> 52 & 0x7FF;\n var y = reinterpret(u & 0x7FFFFFFFFFFFFFFF);\n if (e >= 0x3FF + 26) y = log(y) + c;\n else if (e >= 0x3FF + 1) y = log(2 * y + 1 / (builtin_sqrt(y * y + 1) + y));\n else if (e >= 0x3FF - 26) y = log1p(y + y * y / (builtin_sqrt(y * y + 1) + 1));\n return builtin_copysign(y, x);\n }\n\n export function atan(x: f64): f64 { // see musl/src/math/atan.c and SUN COPYRIGHT NOTICE above\n const\n atanhi0 = reinterpret(0x3FDDAC670561BB4F), // 4.63647609000806093515e-01\n atanhi1 = reinterpret(0x3FE921FB54442D18), // 7.85398163397448278999e-01\n atanhi2 = reinterpret(0x3FEF730BD281F69B), // 9.82793723247329054082e-01\n atanhi3 = reinterpret(0x3FF921FB54442D18), // 1.57079632679489655800e+00\n atanlo0 = reinterpret(0x3C7A2B7F222F65E2), // 2.26987774529616870924e-17\n atanlo1 = reinterpret(0x3C81A62633145C07), // 3.06161699786838301793e-17\n atanlo2 = reinterpret(0x3C7007887AF0CBBD), // 1.39033110312309984516e-17\n atanlo3 = reinterpret(0x3C91A62633145C07), // 6.12323399573676603587e-17\n aT0 = reinterpret(0x3FD555555555550D), // 3.33333333333329318027e-01\n aT1 = reinterpret(0xBFC999999998EBC4), // -1.99999999998764832476e-01\n aT2 = reinterpret(0x3FC24924920083FF), // 1.42857142725034663711e-01\n aT3 = reinterpret(0xBFBC71C6FE231671), // -1.11111104054623557880e-01,\n aT4 = reinterpret(0x3FB745CDC54C206E), // 9.09088713343650656196e-02\n aT5 = reinterpret(0xBFB3B0F2AF749A6D), // -7.69187620504482999495e-02\n aT6 = reinterpret(0x3FB10D66A0D03D51), // 6.66107313738753120669e-02\n aT7 = reinterpret(0xBFADDE2D52DEFD9A), // -5.83357013379057348645e-02\n aT8 = reinterpret(0x3FA97B4B24760DEB), // 4.97687799461593236017e-02\n aT9 = reinterpret(0xBFA2B4442C6A6C2F), // -3.65315727442169155270e-02\n aT10 = reinterpret(0x3F90AD3AE322DA11), // 1.62858201153657823623e-02\n Ox1p_120f = reinterpret(0x03800000);\n var ix = (reinterpret(x) >> 32);\n var sx = x;\n ix &= 0x7FFFFFFF;\n var z: f64;\n if (ix >= 0x44100000) {\n if (isNaN(x)) return x;\n z = atanhi3 + Ox1p_120f;\n return builtin_copysign(z, sx);\n }\n var id: i32;\n if (ix < 0x3FDC0000) {\n if (ix < 0x3E400000) return x;\n id = -1;\n } else {\n x = builtin_abs(x);\n if (ix < 0x3FF30000) {\n if (ix < 0x3FE60000) {\n id = 0;\n x = (2.0 * x - 1.0) / (2.0 + x);\n } else {\n id = 1;\n x = (x - 1.0) / (x + 1.0);\n }\n } else {\n if (ix < 0x40038000) {\n id = 2;\n x = (x - 1.5) / (1.0 + 1.5 * x);\n } else {\n id = 3;\n x = -1.0 / x;\n }\n }\n }\n z = x * x;\n var w = z * z;\n var s1 = z * (aT0 + w * (aT2 + w * (aT4 + w * (aT6 + w * (aT8 + w * aT10)))));\n var s2 = w * (aT1 + w * (aT3 + w * (aT5 + w * (aT7 + w * aT9))));\n var s3 = x * (s1 + s2);\n if (id < 0) return x - s3;\n switch (id) {\n case 0: { z = atanhi0 - ((s3 - atanlo0) - x); break; }\n case 1: { z = atanhi1 - ((s3 - atanlo1) - x); break; }\n case 2: { z = atanhi2 - ((s3 - atanlo2) - x); break; }\n case 3: { z = atanhi3 - ((s3 - atanlo3) - x); break; }\n default: unreachable();\n }\n return builtin_copysign(z, sx);\n }\n\n export function atanh(x: f64): f64 { // see: musl/src/math/atanh.c\n var u = reinterpret(x);\n var e = u >> 52 & 0x7FF;\n var s = u >> 63;\n u &= 0x7FFFFFFFFFFFFFFF;\n var y = reinterpret(u);\n if (e < 0x3FF - 1) {\n if (e >= 0x3FF - 32) y = 0.5 * log1p(2 * y + 2 * y * y / (1 - y));\n } else {\n y = 0.5 * log1p(2 * (y / (1 - y)));\n }\n return builtin_copysign(y, x);\n }\n\n export function atan2(y: f64, x: f64): f64 { // see: musl/src/math/atan2.c and SUN COPYRIGHT NOTICE above\n const pi_lo = reinterpret(0x3CA1A62633145C07); // 1.2246467991473531772E-16\n if (isNaN(x) || isNaN(y)) return x + y;\n var u = reinterpret(x);\n var ix = (u >> 32);\n var lx = u;\n u = reinterpret(y);\n var iy = (u >> 32);\n var ly = u;\n if ((ix - 0x3FF00000 | lx) == 0) return atan(y);\n var m = ((iy >> 31) & 1) | ((ix >> 30) & 2);\n ix = ix & 0x7FFFFFFF;\n iy = iy & 0x7FFFFFFF;\n if ((iy | ly) == 0) {\n switch (m) {\n case 0:\n case 1: return y;\n case 2: return PI;\n case 3: return -PI;\n }\n }\n if ((ix | lx) == 0) return m & 1 ? -PI / 2 : PI / 2;\n if (ix == 0x7FF00000) {\n if (iy == 0x7FF00000) {\n switch (m) {\n case 0: return PI / 4;\n case 1: return -PI / 4;\n case 2: return 3 * PI / 4;\n case 3: return -3 * PI / 4;\n }\n } else {\n switch (m) {\n case 0: return 0.0;\n case 1: return -0.0;\n case 2: return PI;\n case 3: return -PI;\n }\n }\n }\n var z: f64;\n if (ix + (64 << 20) < iy || iy == 0x7FF00000) return m & 1 ? -PI / 2 : PI / 2;\n if ((m & 2) && iy + (64 << 20) < ix) z = 0;\n else z = atan(builtin_abs(y / x));\n switch (m) {\n case 0: return z;\n case 1: return -z;\n case 2: return PI - (z - pi_lo);\n case 3: return (z - pi_lo) - PI;\n }\n unreachable();\n return 0;\n }\n\n export function cbrt(x: f64): f64 { // see: musl/src/math/cbrt.c and SUN COPYRIGHT NOTICE above\n const\n B1 = 715094163,\n B2 = 696219795,\n P0 = reinterpret(0x3FFE03E60F61E692), // 1.87595182427177009643\n P1 = reinterpret(0xBFFE28E092F02420), // -1.88497979543377169875\n P2 = reinterpret(0x3FF9F1604A49D6C2), // 1.621429720105354466140\n P3 = reinterpret(0xBFE844CBBEE751D9), // -0.758397934778766047437\n P4 = reinterpret(0x3FC2B000D4E4EDD7), // 0.145996192886612446982\n Ox1p54 = reinterpret(0x4350000000000000);\n var u = reinterpret(x);\n var hx = (u >> 32) & 0x7FFFFFFF;\n if (hx >= 0x7FF00000) return x + x;\n if (hx < 0x00100000) {\n u = reinterpret(x * Ox1p54);\n hx = (u >> 32) & 0x7FFFFFFF;\n if (hx == 0) return x;\n hx = hx / 3 + B2;\n } else {\n hx = hx / 3 + B1;\n }\n u &= 1 << 63;\n u |= hx << 32;\n var t = reinterpret(u);\n var r = (t * t) * (t / x);\n t = t * ((P0 + r * (P1 + r * P2)) + ((r * r) * r) * (P3 + r * P4));\n t = reinterpret((reinterpret(t) + 0x80000000) & 0xFFFFFFFFC0000000);\n var s = t * t;\n r = x / s;\n r = (r - t) / (2 * t + r);\n t = t + t * r;\n return t;\n }\n\n @inline\n export function ceil(x: f64): f64 {\n return builtin_ceil(x);\n }\n\n export function clz32(x: f64): f64 {\n if (!isFinite(x)) return 32;\n /*\n * Wasm (MVP) and JS have different approaches for double->int conversions.\n *\n * For emulate JS conversion behavior and avoid trapping from wasm we should modulate by MAX_INT\n * our float-point arguments before actual convertion to integers.\n */\n return builtin_clz(\n (x - 4294967296 * builtin_floor(x * (1.0 / 4294967296)))\n );\n }\n\n export function cos(x: f64): f64 { // TODO\n unreachable();\n return 0;\n }\n\n export function cosh(x: f64): f64 { // see: musl/src/math/cosh.c\n var u = reinterpret(x);\n u &= 0x7FFFFFFFFFFFFFFF;\n x = reinterpret(u);\n var w = (u >> 32);\n var t: f64;\n if (w < 0x3FE62E42) {\n if (w < 0x3FF00000 - (26 << 20)) return 1;\n t = expm1(x);\n // return 1 + t * t / (2 * (1 + t));\n return 1 + t * t / (2 + 2 * t);\n }\n if (w < 0x40862E42) {\n t = exp(x);\n return 0.5 * (t + 1 / t);\n }\n t = expo2(x);\n return t;\n }\n\n export function exp(x: f64): f64 { // see: musl/src/math/exp.c and SUN COPYRIGHT NOTICE above\n const\n ln2hi = reinterpret(0x3FE62E42FEE00000), // 6.93147180369123816490e-01\n ln2lo = reinterpret(0x3DEA39EF35793C76), // 1.90821492927058770002e-10\n invln2 = reinterpret(0x3FF71547652B82FE), // 1.44269504088896338700e+00\n P1 = reinterpret(0x3FC555555555553E), // 1.66666666666666019037e-01\n P2 = reinterpret(0xBF66C16C16BEBD93), // -2.77777777770155933842e-03\n P3 = reinterpret(0x3F11566AAF25DE2C), // 6.61375632143793436117e-05\n P4 = reinterpret(0xBEBBBD41C5D26BF1), // -1.65339022054652515390e-06\n P5 = reinterpret(0x3E66376972BEA4D0), // 4.13813679705723846039e-08\n overflow = reinterpret(0x40862E42FEFA39EF), // 709.782712893383973096\n underflow = reinterpret(0xC0874910D52D3051), // -745.13321910194110842\n Ox1p1023 = reinterpret(0x7FE0000000000000);\n var hx = (reinterpret(x) >> 32);\n var sign_ = (hx >> 31);\n hx &= 0x7FFFFFFF;\n if (hx >= 0x4086232B) {\n if (isNaN(x)) return x;\n if (x > overflow) return x * Ox1p1023;\n if (x < underflow) return 0;\n }\n var hi: f64, lo: f64 = 0;\n var k = 0;\n if (hx > 0x3FD62E42) {\n if (hx >= 0x3FF0A2B2) {\n k = (invln2 * x + builtin_copysign(0.5, x));\n } else {\n k = 1 - (sign_ << 1);\n }\n hi = x - k * ln2hi;\n lo = k * ln2lo;\n x = hi - lo;\n } else if (hx > 0x3E300000) {\n hi = x;\n } else return 1.0 + x;\n var xs = x * x;\n // var c = x - xp2 * (P1 + xp2 * (P2 + xp2 * (P3 + xp2 * (P4 + xp2 * P5))));\n var xq = xs * xs;\n var c = x - (xs * P1 + xq * ((P2 + xs * P3) + xq * (P4 + xs * P5)));\n var y = 1.0 + (x * c / (2 - c) - lo + hi);\n if (k == 0) return y;\n return scalbn(y, k);\n }\n\n export function expm1(x: f64): f64 { // see: musl/src/math/expm1.c and SUN COPYRIGHT NOTICE above\n const\n o_threshold = reinterpret(0x40862E42FEFA39EF), // 7.09782712893383973096e+02\n ln2_hi = reinterpret(0x3FE62E42FEE00000), // 6.93147180369123816490e-01\n ln2_lo = reinterpret(0x3DEA39EF35793C76), // 1.90821492927058770002e-10\n invln2 = reinterpret(0x3FF71547652B82FE), // 1.44269504088896338700e+00\n Q1 = reinterpret(0xBFA11111111110F4), // -3.33333333333331316428e-02\n Q2 = reinterpret(0x3F5A01A019FE5585), // 1.58730158725481460165e-03\n Q3 = reinterpret(0xBF14CE199EAADBB7), // -7.93650757867487942473e-05\n Q4 = reinterpret(0x3ED0CFCA86E65239), // 4.00821782732936239552e-06\n Q5 = reinterpret(0xBE8AFDB76E09C32D), // -2.01099218183624371326e-07\n Ox1p1023 = reinterpret(0x7FE0000000000000);\n var u = reinterpret(x);\n var hx = (u >> 32 & 0x7FFFFFFF);\n var k = 0, sign_ = (u >> 63);\n if (hx >= 0x4043687A) {\n if (isNaN(x)) return x;\n if (sign_) return -1;\n if (x > o_threshold) return x * Ox1p1023;\n }\n var c = 0.0, t: f64;\n if (hx > 0x3FD62E42) {\n k = select(\n 1 - (sign_ << 1),\n (invln2 * x + builtin_copysign(0.5, x)),\n hx < 0x3FF0A2B2\n );\n t = k;\n let hi = x - t * ln2_hi;\n let lo = t * ln2_lo;\n x = hi - lo;\n c = (hi - x) - lo;\n } else if (hx < 0x3C900000) return x;\n var hfx = 0.5 * x;\n var hxs = x * hfx;\n // var r1 = 1.0 + hxs * (Q1 + hxs * (Q2 + hxs * (Q3 + hxs * (Q4 + hxs * Q5))));\n var hxq = hxs * hxs;\n var r1 = (1.0 + hxs * Q1) + hxq * ((Q2 + hxs * Q3) + hxq * (Q4 + hxs * Q5));\n t = 3.0 - r1 * hfx;\n var e = hxs * ((r1 - t) / (6.0 - x * t));\n if (k == 0) return x - (x * e - hxs);\n e = x * (e - c) - c;\n e -= hxs;\n if (k == -1) return 0.5 * (x - e) - 0.5;\n if (k == 1) {\n if (x < -0.25) return -2.0 * (e - (x + 0.5));\n return 1.0 + 2.0 * (x - e);\n }\n u = (0x3FF + k) << 52;\n var twopk = reinterpret(u);\n var y: f64;\n if (k < 0 || k > 56) {\n y = x - e + 1.0;\n if (k == 1024) y = y * 2.0 * Ox1p1023;\n else y = y * twopk;\n return y - 1.0;\n }\n u = (0x3FF - k) << 52;\n y = reinterpret(u);\n if (k < 20) y = (1 - y) - e;\n else y = 1 - (e + y);\n return (x + y) * twopk;\n }\n\n @inline\n export function floor(x: f64): f64 {\n return builtin_floor(x);\n }\n\n @inline\n export function fround(x: f64): f32 {\n return x;\n }\n\n export function hypot(x: f64, y: f64): f64 { // see: musl/src/math/hypot.c\n const\n SPLIT = reinterpret(0x41A0000000000000) + 1, // 0x1p27 + 1\n Ox1p700 = reinterpret(0x6BB0000000000000),\n Ox1p_700 = reinterpret(0x1430000000000000);\n var ux = reinterpret(x);\n var uy = reinterpret(y);\n ux &= 0x7FFFFFFFFFFFFFFF;\n uy &= 0x7FFFFFFFFFFFFFFF;\n if (ux < uy) {\n let ut = ux;\n ux = uy;\n uy = ut;\n }\n var ex = (ux >> 52);\n var ey = (uy >> 52);\n y = reinterpret(uy);\n if (ey == 0x7FF) return y;\n x = reinterpret(ux);\n if (ex == 0x7FF || uy == 0) return x;\n if (ex - ey > 64) return x + y;\n var z = 1.0;\n if (ex > 0x3FF + 510) {\n z = Ox1p700;\n x *= Ox1p_700;\n y *= Ox1p_700;\n } else if (ey < 0x3FF - 450) {\n z = Ox1p_700;\n x *= Ox1p700;\n y *= Ox1p700;\n }\n var c = x * SPLIT;\n var h = x - c + c;\n var l = x - h;\n var hx = x * x;\n var lx = h * h - hx + (2 * h + l) * l;\n c = y * SPLIT;\n h = y - c + c;\n l = y - h;\n var hy = y * y;\n var ly = h * h - hy + (2 * h + l) * l;\n return z * builtin_sqrt(ly + lx + hy + hx);\n }\n\n export function imul(x: f64, y: f64): f64 {\n /*\n * Wasm (MVP) and JS have different approaches for double->int conversions.\n *\n * For emulate JS conversion behavior and avoid trapping from wasm we should modulate by MAX_INT\n * our float-point arguments before actual convertion to integers.\n */\n if (!isFinite(x + y)) return 0;\n const inv32 = 1.0 / 4294967296;\n return (\n (x - 4294967296 * builtin_floor(x * inv32)) *\n (y - 4294967296 * builtin_floor(y * inv32))\n );\n }\n\n export function log(x: f64): f64 { // see: musl/src/math/log.c and SUN COPYRIGHT NOTICE above\n const\n ln2_hi = reinterpret(0x3FE62E42FEE00000), // 6.93147180369123816490e-01\n ln2_lo = reinterpret(0x3DEA39EF35793C76), // 1.90821492927058770002e-10\n Lg1 = reinterpret(0x3FE5555555555593), // 6.666666666666735130e-01\n Lg2 = reinterpret(0x3FD999999997FA04), // 3.999999999940941908e-01\n Lg3 = reinterpret(0x3FD2492494229359), // 2.857142874366239149e-01\n Lg4 = reinterpret(0x3FCC71C51D8E78AF), // 2.222219843214978396e-01\n Lg5 = reinterpret(0x3FC7466496CB03DE), // 1.818357216161805012e-01\n Lg6 = reinterpret(0x3FC39A09D078C69F), // 1.531383769920937332e-01\n Lg7 = reinterpret(0x3FC2F112DF3E5244), // 1.479819860511658591e-01\n Ox1p54 = reinterpret(0x4350000000000000);\n var u = reinterpret(x);\n var hx = (u >> 32);\n var k = 0;\n if (hx < 0x00100000 || (hx >> 31)) {\n if (u << 1 == 0) return -1 / (x * x);\n if (hx >> 31) return (x - x) / 0.0;\n k -= 54;\n x *= Ox1p54;\n u = reinterpret(x);\n hx = (u >> 32);\n } else if (hx >= 0x7FF00000) return x;\n else if (hx == 0x3FF00000 && u << 32 == 0) return 0;\n hx += 0x3FF00000 - 0x3FE6A09E;\n k += (hx >> 20) - 0x3FF;\n hx = (hx & 0x000FFFFF) + 0x3FE6A09E;\n u = hx << 32 | (u & 0xFFFFFFFF);\n x = reinterpret(u);\n var f = x - 1.0;\n var hfsq = 0.5 * f * f;\n var s = f / (2.0 + f);\n var z = s * s;\n var w = z * z;\n var t1 = w * (Lg2 + w * (Lg4 + w * Lg6));\n var t2 = z * (Lg1 + w * (Lg3 + w * (Lg5 + w * Lg7)));\n var r = t2 + t1;\n var dk = k;\n return s * (hfsq + r) + dk * ln2_lo - hfsq + f + dk * ln2_hi;\n }\n\n export function log10(x: f64): f64 { // see: musl/src/math/log10.c and SUN COPYRIGHT NOTICE above\n const\n ivln10hi = reinterpret(0x3FDBCB7B15200000), // 4.34294481878168880939e-01\n ivln10lo = reinterpret(0x3DBB9438CA9AADD5), // 2.50829467116452752298e-11\n log10_2hi = reinterpret(0x3FD34413509F6000), // 3.01029995663611771306e-01\n log10_2lo = reinterpret(0x3D59FEF311F12B36), // 3.69423907715893078616e-13\n Lg1 = reinterpret(0x3FE5555555555593), // 6.666666666666735130e-01\n Lg2 = reinterpret(0x3FD999999997FA04), // 3.999999999940941908e-01\n Lg3 = reinterpret(0x3FD2492494229359), // 2.857142874366239149e-01\n Lg4 = reinterpret(0x3FCC71C51D8E78AF), // 2.222219843214978396e-01\n Lg5 = reinterpret(0x3FC7466496CB03DE), // 1.818357216161805012e-01\n Lg6 = reinterpret(0x3FC39A09D078C69F), // 1.531383769920937332e-01\n Lg7 = reinterpret(0x3FC2F112DF3E5244), // 1.479819860511658591e-01\n Ox1p54 = reinterpret(0x4350000000000000);\n var u = reinterpret(x);\n var hx = (u >> 32);\n var k = 0;\n if (hx < 0x00100000 || (hx >> 31)) {\n if (u << 1 == 0) return -1 / (x * x);\n if (hx >> 31) return (x - x) / 0.0;\n k -= 54;\n x *= Ox1p54;\n u = reinterpret(x);\n hx = (u >> 32);\n } else if (hx >= 0x7FF00000) return x;\n else if (hx == 0x3FF00000 && u << 32 == 0) return 0;\n hx += 0x3FF00000 - 0x3FE6A09E;\n k += (hx >> 20) - 0x3FF;\n hx = (hx & 0x000FFFFF) + 0x3FE6A09E;\n u = hx << 32 | (u & 0xFFFFFFFF);\n x = reinterpret(u);\n var f = x - 1.0;\n var hfsq = 0.5 * f * f;\n var s = f / (2.0 + f);\n var z = s * s;\n var w = z * z;\n var t1 = w * (Lg2 + w * (Lg4 + w * Lg6));\n var t2 = z * (Lg1 + w * (Lg3 + w * (Lg5 + w * Lg7)));\n var r = t2 + t1;\n var hi = f - hfsq;\n u = reinterpret(hi);\n u &= 0xFFFFFFFF00000000;\n hi = reinterpret(u);\n var lo = f - hi - hfsq + s * (hfsq + r);\n var val_hi = hi * ivln10hi;\n var dk = k;\n var y = dk * log10_2hi;\n var val_lo = dk * log10_2lo + (lo + hi) * ivln10lo + lo * ivln10hi;\n w = y + val_hi;\n val_lo += (y - w) + val_hi;\n return val_lo + w;\n }\n\n export function log1p(x: f64): f64 { // see: musl/src/math/log1p.c and SUN COPYRIGHT NOTICE above\n const\n ln2_hi = reinterpret(0x3FE62E42FEE00000), // 6.93147180369123816490e-01\n ln2_lo = reinterpret(0x3DEA39EF35793C76), // 1.90821492927058770002e-10\n Lg1 = reinterpret(0x3FE5555555555593), // 6.666666666666735130e-01\n Lg2 = reinterpret(0x3FD999999997FA04), // 3.999999999940941908e-01\n Lg3 = reinterpret(0x3FD2492494229359), // 2.857142874366239149e-01\n Lg4 = reinterpret(0x3FCC71C51D8E78AF), // 2.222219843214978396e-01\n Lg5 = reinterpret(0x3FC7466496CB03DE), // 1.818357216161805012e-01\n Lg6 = reinterpret(0x3FC39A09D078C69F), // 1.531383769920937332e-01\n Lg7 = reinterpret(0x3FC2F112DF3E5244); // 1.479819860511658591e-01\n var u = reinterpret(x);\n var hx = (u >> 32);\n var k = 1;\n var c = 0.0, f = 0.0;\n if (hx < 0x3FDA827A || (hx >> 31)) {\n if (hx >= 0xBFF00000) {\n if (x == -1) return x / 0.0;\n return (x - x) / 0.0;\n }\n if (hx << 1 < 0x3CA00000 << 1) return x;\n if (hx <= 0xBFD2BEC4) {\n k = 0;\n c = 0;\n f = x;\n }\n } else if (hx >= 0x7FF00000) return x;\n if (k) {\n u = reinterpret(1 + x);\n let hu = (u >> 32);\n hu += 0x3FF00000 - 0x3FE6A09E;\n k = (hu >> 20) - 0x3FF;\n if (k < 54) {\n let uf = reinterpret(u);\n c = k >= 2 ? 1 - (uf - x) : x - (uf - 1);\n c /= uf;\n } else c = 0;\n hu = (hu & 0x000FFFFF) + 0x3FE6A09E;\n u = hu << 32 | (u & 0xFFFFFFFF);\n f = reinterpret(u) - 1;\n }\n var hfsq = 0.5 * f * f;\n var s = f / (2.0 + f);\n var z = s * s;\n var w = z * z;\n var t1 = w * (Lg2 + w * (Lg4 + w * Lg6));\n var t2 = z * (Lg1 + w * (Lg3 + w * (Lg5 + w * Lg7)));\n var r = t2 + t1;\n var dk = k;\n return s * (hfsq + r) + (dk * ln2_lo + c) - hfsq + f + dk * ln2_hi;\n }\n\n export function log2(x: f64): f64 { // see: musl/src/math/log2.c and SUN COPYRIGHT NOTICE above\n const\n ivln2hi = reinterpret(0x3FF7154765200000), // 1.44269504072144627571e+00\n ivln2lo = reinterpret(0x3DE705FC2EEFA200), // 1.67517131648865118353e-10\n Lg1 = reinterpret(0x3FE5555555555593), // 6.666666666666735130e-01\n Lg2 = reinterpret(0x3FD999999997FA04), // 3.999999999940941908e-01\n Lg3 = reinterpret(0x3FD2492494229359), // 2.857142874366239149e-01\n Lg4 = reinterpret(0x3FCC71C51D8E78AF), // 2.222219843214978396e-01\n Lg5 = reinterpret(0x3FC7466496CB03DE), // 1.818357216161805012e-01\n Lg6 = reinterpret(0x3FC39A09D078C69F), // 1.531383769920937332e-01\n Lg7 = reinterpret(0x3FC2F112DF3E5244), // 1.479819860511658591e-01\n Ox1p54 = reinterpret(0x4350000000000000);\n var u = reinterpret(x);\n var hx = (u >> 32);\n var k = 0;\n if (hx < 0x00100000 || (hx >> 31)) {\n if (u << 1 == 0) return -1 / (x * x);\n if (hx >> 31) return (x - x) / 0.0;\n k -= 54;\n x *= Ox1p54;\n u = reinterpret(x);\n hx = (u >> 32);\n } else if (hx >= 0x7FF00000) return x;\n else if (hx == 0x3FF00000 && u << 32 == 0) return 0;\n hx += 0x3FF00000 - 0x3FE6A09E;\n k += (hx >> 20) - 0x3FF;\n hx = (hx & 0x000FFFFF) + 0x3FE6A09E;\n u = hx << 32 | (u & 0xFFFFFFFF);\n x = reinterpret(u);\n var f = x - 1.0;\n var hfsq = 0.5 * f * f;\n var s = f / (2.0 + f);\n var z = s * s;\n var w = z * z;\n var t1 = w * (Lg2 + w * (Lg4 + w * Lg6));\n var t2 = z * (Lg1 + w * (Lg3 + w * (Lg5 + w * Lg7)));\n var r = t2 + t1;\n var hi = f - hfsq;\n u = reinterpret(hi);\n u &= 0xFFFFFFFF00000000;\n hi = reinterpret(u);\n var lo = f - hi - hfsq + s * (hfsq + r);\n var val_hi = hi * ivln2hi;\n var val_lo = (lo + hi) * ivln2lo + lo * ivln2hi;\n var y = k;\n w = y + val_hi;\n val_lo += (y - w) + val_hi;\n val_hi = w;\n return val_lo + val_hi;\n }\n\n @inline\n export function max(value1: f64, value2: f64): f64 {\n return builtin_max(value1, value2);\n }\n\n @inline\n export function min(value1: f64, value2: f64): f64 {\n return builtin_min(value1, value2);\n }\n\n export function pow(x: f64, y: f64): f64 { // see: musl/src/math/pow.c and SUN COPYRIGHT NOTICE above\n const\n dp_h1 = reinterpret(0x3FE2B80340000000), // 5.84962487220764160156e-01\n dp_l1 = reinterpret(0x3E4CFDEB43CFD006), // 1.35003920212974897128e-08\n two53 = reinterpret(0x4340000000000000), // 9007199254740992.0\n huge = reinterpret(0x7E37E43C8800759C), // 1e+300\n tiny = reinterpret(0x01A56E1FC2F8F359), // 1e-300\n L1 = reinterpret(0x3FE3333333333303), // 5.99999999999994648725e-01\n L2 = reinterpret(0x3FDB6DB6DB6FABFF), // 4.28571428578550184252e-01\n L3 = reinterpret(0x3FD55555518F264D), // 3.33333329818377432918e-01\n L4 = reinterpret(0x3FD17460A91D4101), // 2.72728123808534006489e-01\n L5 = reinterpret(0x3FCD864A93C9DB65), // 2.30660745775561754067e-01\n L6 = reinterpret(0x3FCA7E284A454EEF), // 2.06975017800338417784e-01\n P1 = reinterpret(0x3FC555555555553E), // 1.66666666666666019037e-01\n P2 = reinterpret(0xBF66C16C16BEBD93), // -2.77777777770155933842e-03\n P3 = reinterpret(0x3F11566AAF25DE2C), // 6.61375632143793436117e-05\n P4 = reinterpret(0xBEBBBD41C5D26BF1), // -1.65339022054652515390e-06\n P5 = reinterpret(0x3E66376972BEA4D0), // 4.13813679705723846039e-08\n lg2 = reinterpret(0x3FE62E42FEFA39EF), // 6.93147180559945286227e-01\n lg2_h = reinterpret(0x3FE62E4300000000), // 6.93147182464599609375e-01\n lg2_l = reinterpret(0xBE205C610CA86C39), // -1.90465429995776804525e-09\n ovt = reinterpret(0x3C971547652B82FE), // 8.0085662595372944372e-017\n cp = reinterpret(0x3FEEC709DC3A03FD), // 9.61796693925975554329e-01\n cp_h = reinterpret(0x3FEEC709E0000000), // 9.61796700954437255859e-01\n cp_l = reinterpret(0xBE3E2FE0145B01F5), // -7.02846165095275826516e-09\n ivln2 = reinterpret(0x3FF71547652B82FE), // 1.44269504088896338700e+00\n ivln2_h = reinterpret(0x3FF7154760000000), // 1.44269502162933349609e+00\n ivln2_l = reinterpret(0x3E54AE0BF85DDF44), // 1.92596299112661746887e-08\n inv3 = reinterpret(0x3FD5555555555555); // 0.3333333333333333333333\n var u_ = reinterpret(x);\n var hx = (u_ >> 32);\n var lx = u_;\n u_ = reinterpret(y);\n var hy = (u_ >> 32);\n var ly = u_;\n var ix = hx & 0x7FFFFFFF;\n var iy = hy & 0x7FFFFFFF;\n if ((iy | ly) == 0) return 1.0; // x**0 = 1, even if x is NaN\n // if (hx == 0x3FF00000 && lx == 0) return 1.0; // C: 1**y = 1, even if y is NaN, JS: NaN\n if ( // NaN if either arg is NaN\n ix > 0x7FF00000 || (ix == 0x7FF00000 && lx != 0) ||\n iy > 0x7FF00000 || (iy == 0x7FF00000 && ly != 0)\n ) return x + y;\n var yisint = 0, k: i32;\n if (hx < 0) {\n if (iy >= 0x43400000) yisint = 2;\n else if (iy >= 0x3FF00000) {\n k = (iy >> 20) - 0x3FF;\n let kcond = k > 20;\n let offset = select(52, 20, kcond) - k;\n let Ly = select(ly, iy, kcond);\n let jj = Ly >> offset;\n if ((jj << offset) == Ly) yisint = 2 - (jj & 1);\n }\n }\n if (ly == 0) {\n if (iy == 0x7FF00000) { // y is +-inf\n if (((ix - 0x3FF00000) | lx) == 0) return NaN; // C: (-1)**+-inf is 1, JS: NaN\n else if (ix >= 0x3FF00000) return hy >= 0 ? y : 0.0; // (|x|>1)**+-inf = inf,0\n else return hy >= 0 ? 0.0 : -y; // (|x|<1)**+-inf = 0,inf\n }\n if (iy == 0x3FF00000) {\n if (hy >= 0) return x;\n return 1 / x;\n }\n if (hy == 0x40000000) return x * x;\n if (hy == 0x3FE00000) {\n if (hx >= 0) return builtin_sqrt(x);\n }\n }\n var ax = builtin_abs(x), z: f64;\n if (lx == 0) {\n if (ix == 0 || ix == 0x7FF00000 || ix == 0x3FF00000) {\n z = ax;\n if (hy < 0) z = 1.0 / z;\n if (hx < 0) {\n if (((ix - 0x3FF00000) | yisint) == 0) {\n let d = z - z;\n z = d / d;\n } else if (yisint == 1) z = -z;\n }\n return z;\n }\n }\n var s = 1.0;\n if (hx < 0) {\n if (yisint == 0) {\n let d = x - x;\n return d / d;\n }\n if (yisint == 1) s = -1.0;\n }\n var t1: f64, t2: f64, p_h: f64, p_l: f64, r: f64, t: f64, u: f64, v: f64, w: f64;\n var j: i32, n: i32;\n if (iy > 0x41E00000) {\n if (iy > 0x43F00000) {\n if (ix <= 0x3FEFFFFF) return hy < 0 ? huge * huge : tiny * tiny;\n if (ix >= 0x3FF00000) return hy > 0 ? huge * huge : tiny * tiny;\n }\n if (ix < 0x3FEFFFFF) return hy < 0 ? s * huge * huge : s * tiny * tiny;\n if (ix > 0x3FF00000) return hy > 0 ? s * huge * huge : s * tiny * tiny;\n t = ax - 1.0;\n w = (t * t) * (0.5 - t * (inv3 - t * 0.25));\n u = ivln2_h * t;\n v = t * ivln2_l - w * ivln2;\n t1 = u + v;\n t1 = reinterpret(reinterpret(t1) & 0xFFFFFFFF00000000);\n t2 = v - (t1 - u);\n } else {\n let ss: f64, s2: f64, s_h: f64, s_l: f64, t_h: f64, t_l: f64;\n n = 0;\n if (ix < 0x00100000) {\n ax *= two53;\n n -= 53;\n ix = (reinterpret(ax) >> 32);\n }\n n += (ix >> 20) - 0x3FF;\n j = ix & 0x000FFFFF;\n ix = j | 0x3FF00000;\n if (j <= 0x3988E) k = 0;\n else if (j < 0xBB67A) k = 1;\n else {\n k = 0;\n n += 1;\n ix -= 0x00100000;\n }\n ax = reinterpret(reinterpret(ax) & 0xFFFFFFFF | (ix << 32));\n let bp = select(1.5, 1.0, k); // k ? 1.5 : 1.0\n u = ax - bp;\n v = 1.0 / (ax + bp);\n ss = u * v;\n s_h = ss;\n s_h = reinterpret(reinterpret(s_h) & 0xFFFFFFFF00000000);\n t_h = reinterpret((((ix >> 1) | 0x20000000) + 0x00080000 + (k << 18)) << 32);\n t_l = ax - (t_h - bp);\n s_l = v * ((u - s_h * t_h) - s_h * t_l);\n s2 = ss * ss;\n r = s2 * s2 * (L1 + s2 * (L2 + s2 * (L3 + s2 * (L4 + s2 * (L5 + s2 * L6)))));\n r += s_l * (s_h + ss);\n s2 = s_h * s_h;\n t_h = 3.0 + s2 + r;\n t_h = reinterpret(reinterpret(t_h) & 0xFFFFFFFF00000000);\n t_l = r - ((t_h - 3.0) - s2);\n u = s_h * t_h;\n v = s_l * t_h + t_l * ss;\n p_h = u + v;\n p_h = reinterpret(reinterpret(p_h) & 0xFFFFFFFF00000000);\n p_l = v - (p_h - u);\n let z_h = cp_h * p_h;\n let dp_l = select(dp_l1, 0.0, k);\n let z_l = cp_l * p_h + p_l * cp + dp_l;\n t = n;\n let dp_h = select(dp_h1, 0.0, k);\n t1 = ((z_h + z_l) + dp_h) + t;\n t1 = reinterpret(reinterpret(t1) & 0xFFFFFFFF00000000);\n t2 = z_l - (((t1 - t) - dp_h) - z_h);\n }\n var y1 = y;\n y1 = reinterpret(reinterpret(y1) & 0xFFFFFFFF00000000);\n p_l = (y - y1) * t1 + y * t2;\n p_h = y1 * t1;\n z = p_l + p_h;\n u_ = reinterpret(z);\n j = (u_ >> 32);\n var i = u_;\n if (j >= 0x40900000) {\n if (((j - 0x40900000) | i) != 0) return s * huge * huge;\n if (p_l + ovt > z - p_h) return s * huge * huge;\n } else if ((j & 0x7FFFFFFF) >= 0x4090CC00) {\n if (((j - 0xC090CC00) | i) != 0) return s * tiny * tiny;\n if (p_l <= z - p_h) return s * tiny * tiny;\n }\n i = j & 0x7FFFFFFF;\n k = (i >> 20) - 0x3FF;\n n = 0;\n if (i > 0x3FE00000) {\n n = j + (0x00100000 >> (k + 1));\n k = ((n & 0x7FFFFFFF) >> 20) - 0x3FF;\n t = 0.0;\n t = reinterpret((n & ~(0x000FFFFF >> k)) << 32);\n n = ((n & 0x000FFFFF) | 0x00100000) >> (20 - k);\n if (j < 0) n = -n;\n p_h -= t;\n }\n t = p_l + p_h;\n t = reinterpret(reinterpret(t) & 0xFFFFFFFF00000000);\n u = t * lg2_h;\n v = (p_l - (t - p_h)) * lg2 + t * lg2_l;\n z = u + v;\n w = v - (z - u);\n t = z * z;\n t1 = z - t * (P1 + t * (P2 + t * (P3 + t * (P4 + t * P5))));\n r = (z * t1) / (t1 - 2.0) - (w + z * w);\n z = 1.0 - (r - z);\n j = (reinterpret(z) >> 32);\n j += n << 20;\n if ((j >> 20) <= 0) z = scalbn(z, n);\n else z = reinterpret(reinterpret(z) & 0xFFFFFFFF | (j << 32));\n return s * z;\n }\n\n export function seedRandom(value: i64): void {\n assert(value);\n random_seeded = true;\n random_state0_64 = murmurHash3(value);\n random_state1_64 = murmurHash3(~random_state0_64);\n random_state0_32 = splitMix32(value);\n random_state1_32 = splitMix32(random_state0_32);\n }\n\n export function random(): f64 { // see: v8/src/base/random-number-generator.cc\n if (!random_seeded) throw new Error("PRNG must be seeded.");\n var s1 = random_state0_64;\n var s0 = random_state1_64;\n random_state0_64 = s0;\n s1 ^= s1 << 23;\n s1 ^= s1 >> 17;\n s1 ^= s0;\n s1 ^= s0 >> 26;\n random_state1_64 = s1;\n var r = ((s0 + s1) & 0x000FFFFFFFFFFFFF) | 0x3FF0000000000000;\n return reinterpret(r) - 1;\n }\n\n @inline\n export function round(x: f64): f64 {\n return builtin_copysign(builtin_floor(x + 0.5), x);\n }\n\n @inline\n export function sign(x: f64): f64 {\n if (ASC_SHRINK_LEVEL > 0) {\n return builtin_abs(x) > 0 ? builtin_copysign(1, x) : x;\n } else {\n return x > 0 ? 1 : x < 0 ? -1 : x;\n }\n }\n\n @inline\n export function signbit(x: f64): bool {\n // In ECMAScript all NaN values are indistinguishable from each other\n // so we need handle NaN and negative NaN in similar way\n return ((reinterpret(x) >>> 63) & (x == x));\n }\n\n export function sin(x: f64): f64 { // TODO\n unreachable();\n return 0;\n }\n\n export function sinh(x: f64): f64 { // see: musl/src/math/sinh.c\n var u = reinterpret(x) & 0x7FFFFFFFFFFFFFFF;\n var absx = reinterpret(u);\n var w = (u >> 32);\n var t: f64;\n var h = builtin_copysign(0.5, x);\n if (w < 0x40862E42) {\n t = expm1(absx);\n if (w < 0x3FF00000) {\n if (w < 0x3FF00000 - (26 << 20)) return x;\n return h * (2 * t - t * t / (t + 1));\n }\n return h * (t + t / (t + 1));\n }\n t = 2 * h * expo2(absx);\n return t;\n }\n\n @inline\n export function sqrt(x: f64): f64 {\n return builtin_sqrt(x);\n }\n\n export function tan(x: f64): f64 { // TODO\n unreachable();\n return 0;\n }\n\n export function tanh(x: f64): f64 { // see: musl/src/math/tanh.c\n var u = reinterpret(x);\n u &= 0x7FFFFFFFFFFFFFFF;\n var y = reinterpret(u);\n var w = (u >> 32);\n var t: f64;\n if (w > 0x3FE193EA) {\n if (w > 0x40340000) {\n t = 1 - 0 / y;\n } else {\n t = expm1(2 * y);\n t = 1 - 2 / (t + 2);\n }\n } else if (w > 0x3FD058AE) {\n t = expm1(2 * y);\n t = t / (t + 2);\n } else if (w >= 0x00100000) {\n t = expm1(-2 * y);\n t = -t / (t + 2);\n } else t = y;\n return builtin_copysign(t, x);\n }\n\n @inline\n export function trunc(x: f64): f64 {\n return builtin_trunc(x);\n }\n\n export function scalbn(x: f64, n: i32): f64 { // see: https://git.musl-libc.org/cgit/musl/tree/src/math/scalbn.c\n const\n Ox1p53 = reinterpret(0x4340000000000000),\n Ox1p1023 = reinterpret(0x7FE0000000000000),\n Ox1p_1022 = reinterpret(0x0010000000000000);\n var y = x;\n if (n > 1023) {\n y *= Ox1p1023;\n n -= 1023;\n if (n > 1023) {\n y *= Ox1p1023;\n n = builtin_min(n - 1023, 1023);\n }\n } else if (n < -1022) {\n /* make sure final n < -53 to avoid double\n rounding in the subnormal range */\n y *= Ox1p_1022 * Ox1p53;\n n += 1022 - 53;\n if (n < -1022) {\n y *= Ox1p_1022 * Ox1p53;\n n = builtin_max(n + 1022 - 53, -1022);\n }\n }\n return y * reinterpret((0x3FF + n) << 52);\n }\n\n export function mod(x: f64, y: f64): f64 { // see: musl/src/math/fmod.c\n var ux = reinterpret(x);\n var uy = reinterpret(y);\n var ex = (ux >> 52 & 0x7FF);\n var ey = (uy >> 52 & 0x7FF);\n var sx = ux >> 63;\n var uy1 = uy << 1;\n if (uy1 == 0 || ex == 0x7FF || isNaN(y)) {\n let m = x * y;\n return m / m;\n }\n var ux1 = ux << 1;\n if (ux1 <= uy1) {\n if (ux1 == uy1) return 0 * x;\n return x;\n }\n if (!ex) {\n ex -= builtin_clz(ux << 12);\n ux <<= -ex + 1;\n } else {\n ux &= -1 >> 12;\n ux |= 1 << 52;\n }\n if (!ey) {\n ey -= builtin_clz(uy << 12);\n uy <<= -ey + 1;\n } else {\n uy &= -1 >> 12;\n uy |= 1 << 52;\n }\n while (ex > ey) {\n if (ux >= uy) {\n if (ux == uy) return 0 * x;\n ux -= uy;\n }\n ux <<= 1;\n --ex;\n }\n if (ux >= uy) {\n if (ux == uy) return 0 * x;\n ux -= uy;\n }\n // for (; !(ux >> 52); ux <<= 1) --ex;\n var shift = builtin_clz(ux << 11);\n ex -= shift;\n ux <<= shift;\n if (ex > 0) {\n ux -= 1 << 52;\n ux |= ex << 52;\n } else {\n ux >>= -ex + 1;\n }\n ux |= sx << 63;\n return reinterpret(ux);\n }\n\n export function rem(x: f64, y: f64): f64 { // see: musl/src/math/remquo.c\n var ux = reinterpret(x);\n var uy = reinterpret(y);\n var ex = (ux >> 52 & 0x7FF);\n var ey = (uy >> 52 & 0x7FF);\n var sx = (ux >> 63);\n if (uy << 1 == 0 || ex == 0x7FF || isNaN(y)) {\n let m = x * y;\n return m / m;\n }\n if (ux << 1 == 0) return x;\n var uxi = ux;\n if (!ex) {\n ex -= builtin_clz(uxi << 12);\n uxi <<= -ex + 1;\n } else {\n uxi &= -1 >> 12;\n uxi |= 1 << 52;\n }\n if (!ey) {\n ey -= builtin_clz(uy << 12);\n uy <<= -ey + 1;\n } else {\n uy &= -1 >> 12;\n uy |= 1 << 52;\n }\n var q: u32 = 0;\n do {\n if (ex < ey) {\n if (ex + 1 == ey) break; // goto end\n return x;\n }\n while (ex > ey) {\n if (uxi >= uy) {\n uxi -= uy;\n ++q;\n }\n uxi <<= 1;\n q <<= 1;\n --ex;\n }\n if (uxi >= uy) {\n uxi -= uy;\n ++q;\n }\n if (uxi == 0) ex = -60;\n else {\n let shift = builtin_clz(uxi << 11);\n ex -= shift;\n uxi <<= shift;\n }\n break;\n } while (false);\n // end:\n if (ex > 0) {\n uxi -= 1 << 52;\n uxi |= ex << 52;\n } else {\n uxi >>= -ex + 1;\n }\n x = reinterpret(uxi);\n y = builtin_abs(y);\n var x2 = x + x;\n if (ex == ey || (ex + 1 == ey && (x2 > y || (x2 == y && (q & 1))))) {\n x -= y;\n // ++q;\n }\n return sx ? -x : x;\n }\n}\n\n/** @internal */\n@lazy var rempio2f_y: f64;\n@lazy const PIO2_TABLE: u64[] = [\n 0xA2F9836E4E441529,\n 0xFC2757D1F534DDC0,\n 0xDB6295993C439041,\n 0xFE5163ABDEBBC561\n];\n\n/** @internal */\nfunction Rf(z: f32): f32 { // Rational approximation of (asin(x)-x)/x^3\n const // see: musl/src/math/asinf.c and SUN COPYRIGHT NOTICE above\n pS0 = reinterpret(0x3E2AAA75), // 1.6666586697e-01f\n pS1 = reinterpret(0xBD2F13BA), // -4.2743422091e-02f\n pS2 = reinterpret(0xBC0DD36B), // -8.6563630030e-03f\n qS1 = reinterpret(0xBF34E5AE); // -7.0662963390e-01f\n var p = z * (pS0 + z * (pS1 + z * pS2));\n var q: f32 = 1 + z * qS1;\n return p / q;\n}\n\n@inline function expo2f(x: f32): f32 { // exp(x)/2 for x >= log(DBL_MAX)\n const // see: musl/src/math/__expo2f.c\n k = 235,\n kln2 = reinterpret(0x4322E3BC); // 0x1.45c778p+7f\n var scale = reinterpret((0x7F + (k >> 1)) << 23);\n return NativeMathf.exp(x - kln2) * scale * scale;\n}\n\n@inline /** @internal */\nfunction pio2_large_quot(x: f32, u: i32): i32 { // see: jdh8/metallic/blob/master/src/math/float/rem_pio2f.c\n const coeff = reinterpret(0x3BF921FB54442D18); // π * 0x1p-65 = 8.51530395021638647334e-20\n const bits = PIO2_TABLE;\n\n var offset = (u >> 23) - 152;\n var index = offset >> 6;\n var shift = offset & 63;\n\n var b0 = unchecked(bits[index + 0]);\n var b1 = unchecked(bits[index + 1]);\n var lo: u64;\n\n if (shift > 32) {\n let b2 = unchecked(bits[index + 2]);\n lo = b2 >> (96 - shift);\n lo |= b1 << (shift - 32);\n } else {\n lo = b1 >> (32 - shift);\n }\n\n var hi = (b1 >> (64 - shift)) | (b0 << shift);\n var mantissa: u64 = (u & 0x007FFFFF) | 0x00800000;\n var product: u64 = mantissa * hi + (mantissa * lo >> 32);\n var r: i64 = product << 2;\n var q: i32 = ((product >> 62) + (r >>> 63));\n rempio2f_y = copysign(coeff, x) * r;\n return q;\n}\n\n@inline /** @internal */\nfunction rempio2f(x: f32, u: u32, sign: i32): i32 { // see: jdh8/metallic/blob/master/src/math/float/rem_pio2f.c\n const pi2hi = reinterpret(0x3FF921FB50000000); // 1.57079631090164184570\n const pi2lo = reinterpret(0x3E5110B4611A6263); // 1.58932547735281966916e-8\n const _2_pi = reinterpret(0x3FE45F306DC9C883); // 0.63661977236758134308\n\n if (u < 0x4DC90FDB) { /* π * 0x1p28 */\n let q = nearest(x * _2_pi);\n rempio2f_y = x - q * pi2hi - q * pi2lo;\n return q;\n }\n\n var q = pio2_large_quot(x, u);\n return select(-q, q, sign);\n}\n\n/* |sin(x)/x - s(x)| < 2**-37.5 (~[-4.89e-12, 4.824e-12]). */\n@inline /** @internal */\nfunction sin_kernf(x: f64): f32 { // see: musl/tree/src/math/__sindf.c\n const S1 = reinterpret(0xBFC5555554CBAC77); // -0x15555554cbac77.0p-55\n const S2 = reinterpret(0x3F811110896EFBB2); // 0x111110896efbb2.0p-59\n const S3 = reinterpret(0xBF2A00F9E2CAE774); // -0x1a00f9e2cae774.0p-65\n const S4 = reinterpret(0x3EC6CD878C3B46A7); // 0x16cd878c3b46a7.0p-71\n\n var z = x * x;\n var w = z * z;\n var r = S3 + z * S4;\n var s = z * x;\n return ((x + s * (S1 + z * S2)) + s * w * r);\n}\n\n/* |cos(x) - c(x)| < 2**-34.1 (~[-5.37e-11, 5.295e-11]). */\n@inline /** @internal */\nfunction cos_kernf(x: f64): f32 { // see: musl/tree/src/math/__cosdf.c\n const C0 = reinterpret(0xBFDFFFFFFD0C5E81); // -0x1ffffffd0c5e81.0p-54\n const C1 = reinterpret(0x3FA55553E1053A42); // 0x155553e1053a42.0p-57\n const C2 = reinterpret(0xBF56C087E80F1E27); // -0x16c087e80f1e27.0p-62\n const C3 = reinterpret(0x3EF99342E0EE5069); // 0x199342e0ee5069.0p-68\n\n var z = x * x;\n var w = z * z;\n var r = C2 + z * C3;\n return (((1 + z * C0) + w * C1) + (w * z) * r);\n}\n\n/* |tan(x)/x - t(x)| < 2**-25.5 (~[-2e-08, 2e-08]). */\n@inline /** @internal */\nfunction tan_kernf(x: f64, odd: i32): f32 { // see: musl/tree/src/math/__tandf.c\n\n const T0 = reinterpret(0x3FD5554D3418C99F); /* 0x15554d3418c99f.0p-54 */\n const T1 = reinterpret(0x3FC112FD38999F72); /* 0x1112fd38999f72.0p-55 */\n const T2 = reinterpret(0x3FAB54C91D865AFE); /* 0x1b54c91d865afe.0p-57 */\n const T3 = reinterpret(0x3F991DF3908C33CE); /* 0x191df3908c33ce.0p-58 */\n const T4 = reinterpret(0x3F685DADFCECF44E); /* 0x185dadfcecf44e.0p-61 */\n const T5 = reinterpret(0x3F8362B9BF971BCD); /* 0x1362b9bf971bcd.0p-59 */\n\n var z = x * x;\n var r = T4 + z * T5;\n var t = T2 + z * T3;\n var w = z * z;\n var s = z * x;\n var u = T0 + z * T1;\n\n r = (x + s * u) + (s * w) * (t + w * r);\n return (odd ? -1 / r : r);\n}\n\nexport namespace NativeMathf {\n\n @lazy export const E = NativeMath.E;\n @lazy export const LN2 = NativeMath.LN2;\n @lazy export const LN10 = NativeMath.LN10;\n @lazy export const LOG2E = NativeMath.LOG2E;\n @lazy export const LOG10E = NativeMath.LOG10E;\n @lazy export const PI = NativeMath.PI;\n @lazy export const SQRT1_2 = NativeMath.SQRT1_2;\n @lazy export const SQRT2 = NativeMath.SQRT2;\n\n /** Used as return values from Mathf.sincos */\n @lazy export var sincos_sin: f32 = 0;\n @lazy export var sincos_cos: f32 = 0;\n\n @inline\n export function abs(x: f32): f32 {\n return builtin_abs(x);\n }\n\n export function acos(x: f32): f32 { // see: musl/src/math/acosf.c and SUN COPYRIGHT NOTICE above\n const\n pio2_hi = reinterpret(0x3FC90FDA), // 1.5707962513e+00f\n pio2_lo = reinterpret(0x33A22168), // 7.5497894159e-08f\n Ox1p_120f = reinterpret(0x03800000);\n var hx = reinterpret(x);\n var ix = hx & 0x7FFFFFFF;\n if (ix >= 0x3F800000) {\n if (ix == 0x3F800000) {\n if (hx >> 31) return 2 * pio2_hi + Ox1p_120f;\n return 0;\n }\n return 0 / (x - x);\n }\n if (ix < 0x3F000000) {\n if (ix <= 0x32800000) return pio2_hi + Ox1p_120f;\n return pio2_hi - (x - (pio2_lo - x * Rf(x * x)));\n }\n var z: f32, w: f32, s: f32;\n if (hx >> 31) {\n // z = (1 + x) * 0.5;\n z = 0.5 + x * 0.5;\n s = builtin_sqrt(z);\n w = Rf(z) * s - pio2_lo;\n return 2 * (pio2_hi - (s + w));\n }\n // z = (1 - x) * 0.5;\n z = 0.5 - x * 0.5;\n s = builtin_sqrt(z);\n hx = reinterpret(s);\n var df = reinterpret(hx & 0xFFFFF000);\n var c = (z - df * df) / (s + df);\n w = Rf(z) * s + c;\n return 2 * (df + w);\n }\n\n export function acosh(x: f32): f32 { // see: musl/src/math/acoshf.c\n const s = reinterpret(0x3F317218); // 0.693147180559945309417232121458176568f\n var u = reinterpret(x);\n var a = u & 0x7FFFFFFF;\n if (a < 0x3F800000 + (1 << 23)) {\n let xm1 = x - 1;\n return log1p(xm1 + builtin_sqrt(xm1 * (xm1 + 2)));\n }\n if (a < 0x3F800000 + (12 << 23)) return log(2 * x - 1 / (x + builtin_sqrt(x * x - 1)));\n return log(x) + s;\n }\n\n export function asin(x: f32): f32 { // see: musl/src/math/asinf.c and SUN COPYRIGHT NOTICE above\n const\n pio2 = reinterpret(0x3FC90FDB), // 1.570796326794896558e+00f\n Ox1p_120f = reinterpret(0x03800000);\n var sx = x;\n var hx = reinterpret(x) & 0x7FFFFFFF;\n if (hx >= 0x3F800000) {\n if (hx == 0x3F800000) return x * pio2 + Ox1p_120f;\n return 0 / (x - x);\n }\n if (hx < 0x3F000000) {\n if (hx < 0x39800000 && hx >= 0x00800000) return x;\n return x + x * Rf(x * x);\n }\n // var z: f32 = (1 - builtin_abs(x)) * 0.5;\n var z: f32 = 0.5 - builtin_abs(x) * 0.5;\n var s = builtin_sqrt(z); // sic\n x = (pio2 - 2 * (s + s * Rf(z)));\n return builtin_copysign(x, sx);\n }\n\n export function asinh(x: f32): f32 { // see: musl/src/math/asinhf.c\n const c = reinterpret(0x3F317218); // 0.693147180559945309417232121458176568f\n var u = reinterpret(x) & 0x7FFFFFFF;\n var y = reinterpret(u);\n if (u >= 0x3F800000 + (12 << 23)) y = log(y) + c;\n else if (u >= 0x3F800000 + (1 << 23)) y = log(2 * y + 1 / (builtin_sqrt(y * y + 1) + y));\n else if (u >= 0x3F800000 - (12 << 23)) y = log1p(y + y * y / (builtin_sqrt(y * y + 1) + 1));\n return builtin_copysign(y, x);\n }\n\n export function atan(x: f32): f32 { // see: musl/src/math/atanf.c and SUN COPYRIGHT NOTICE above\n const\n atanhi0 = reinterpret(0x3EED6338), // 4.6364760399e-01f\n atanhi1 = reinterpret(0x3F490FDA), // 7.8539812565e-01f\n atanhi2 = reinterpret(0x3F7B985E), // 9.8279368877e-01f\n atanhi3 = reinterpret(0x3FC90FDA), // 1.5707962513e+00f\n atanlo0 = reinterpret(0x31AC3769), // 5.0121582440e-09f\n atanlo1 = reinterpret(0x33222168), // 3.7748947079e-08f\n atanlo2 = reinterpret(0x33140FB4), // 3.4473217170e-08f\n atanlo3 = reinterpret(0x33A22168), // 7.5497894159e-08f\n aT0 = reinterpret(0x3EAAAAA9), // 3.3333328366e-01f\n aT1 = reinterpret(0xBE4CCA98), // -1.9999158382e-01f\n aT2 = reinterpret(0x3E11F50D), // 1.4253635705e-01f\n aT3 = reinterpret(0xBDDA1247), // -1.0648017377e-01f\n aT4 = reinterpret(0x3D7CAC25), // 6.1687607318e-02f\n Ox1p_120f = reinterpret(0x03800000);\n var ix = reinterpret(x);\n var sx = x;\n ix &= 0x7FFFFFFF;\n var z: f32;\n if (ix >= 0x4C800000) {\n if (isNaN(x)) return x;\n z = atanhi3 + Ox1p_120f;\n return builtin_copysign(z, sx);\n }\n var id: i32;\n if (ix < 0x3EE00000) {\n if (ix < 0x39800000) return x;\n id = -1;\n } else {\n x = builtin_abs(x);\n if (ix < 0x3F980000) {\n if (ix < 0x3F300000) {\n id = 0;\n x = (2.0 * x - 1.0) / (2.0 + x);\n } else {\n id = 1;\n x = (x - 1.0) / (x + 1.0);\n }\n } else {\n if (ix < 0x401C0000) {\n id = 2;\n x = (x - 1.5) / (1.0 + 1.5 * x);\n } else {\n id = 3;\n x = -1.0 / x;\n }\n }\n }\n z = x * x;\n var w = z * z;\n var s1 = z * (aT0 + w * (aT2 + w * aT4));\n var s2 = w * (aT1 + w * aT3);\n var s3 = x * (s1 + s2);\n if (id < 0) return x - s3;\n switch (id) {\n case 0: { z = atanhi0 - ((s3 - atanlo0) - x); break; }\n case 1: { z = atanhi1 - ((s3 - atanlo1) - x); break; }\n case 2: { z = atanhi2 - ((s3 - atanlo2) - x); break; }\n case 3: { z = atanhi3 - ((s3 - atanlo3) - x); break; }\n default: unreachable();\n }\n return builtin_copysign(z, sx);\n }\n\n export function atanh(x: f32): f32 { // see: musl/src/math/atanhf.c\n var u = reinterpret(x);\n u &= 0x7FFFFFFF;\n var y = reinterpret(u);\n if (u < 0x3F800000 - (1 << 23)) {\n if (u >= 0x3F800000 - (32 << 23)) y = 0.5 * log1p(2 * y * (1.0 + y / (1 - y)));\n } else y = 0.5 * log1p(2 * (y / (1 - y)));\n return builtin_copysign(y, x);\n }\n\n export function atan2(y: f32, x: f32): f32 { // see: musl/src/math/atan2f.c and SUN COPYRIGHT NOTICE above\n const\n pi = reinterpret(0x40490FDB), // 3.1415927410e+00f\n pi_lo = reinterpret(0xB3BBBD2E); // -8.7422776573e-08f\n if (isNaN(x) || isNaN(y)) return x + y;\n var ix = reinterpret(x);\n var iy = reinterpret(y);\n if (ix == 0x3F800000) return atan(y);\n var m = (((iy >> 31) & 1) | ((ix >> 30) & 2));\n ix &= 0x7FFFFFFF;\n iy &= 0x7FFFFFFF;\n if (iy == 0) {\n switch (m) {\n case 0:\n case 1: return y;\n case 2: return pi;\n case 3: return -pi;\n }\n }\n if (ix == 0) return m & 1 ? -pi / 2 : pi / 2;\n if (ix == 0x7F800000) {\n if (iy == 0x7F800000) {\n switch (m) {\n case 0: return pi / 4;\n case 1: return -pi / 4;\n case 2: return 3 * pi / 4;\n case 3: return -3 * pi / 4;\n }\n } else {\n switch (m) {\n case 0: return 0;\n case 1: return -0;\n case 2: return pi;\n case 3: return -pi;\n }\n }\n }\n if (ix + (26 << 23) < iy || iy == 0x7F800000) return m & 1 ? -pi / 2 : pi / 2;\n var z: f32;\n if ((m & 2) && iy + (26 << 23) < ix) z = 0.0;\n else z = atan(builtin_abs(y / x));\n switch (m) {\n case 0: return z;\n case 1: return -z;\n case 2: return pi - (z - pi_lo);\n case 3: return (z - pi_lo) - pi;\n }\n unreachable();\n return 0;\n }\n\n export function cbrt(x: f32): f32 { // see: musl/src/math/cbrtf.c and SUN COPYRIGHT NOTICE above\n const\n B1 = 709958130,\n B2 = 642849266,\n Ox1p24f = reinterpret(0x4B800000);\n var u = reinterpret(x);\n var hx = u & 0x7FFFFFFF;\n if (hx >= 0x7F800000) return x + x;\n if (hx < 0x00800000) {\n if (hx == 0) return x;\n u = reinterpret(x * Ox1p24f);\n hx = u & 0x7FFFFFFF;\n hx = hx / 3 + B2;\n } else {\n hx = hx / 3 + B1;\n }\n u &= 0x80000000;\n u |= hx;\n var t = reinterpret(u);\n var r = t * t * t;\n t = t * (x + x + r) / (x + r + r);\n r = t * t * t;\n t = t * (x + x + r) / (x + r + r);\n return t;\n }\n\n @inline\n export function ceil(x: f32): f32 {\n return builtin_ceil(x);\n }\n\n export function clz32(x: f32): f32 {\n if (!isFinite(x)) return 32;\n return builtin_clz(\n (x - 4294967296 * builtin_floor(x * (1.0 / 4294967296)))\n );\n }\n\n export function cos(x: f32): f32 { // see: musl/src/math/cosf.c\n const c1pio2 = reinterpret(0x3FF921FB54442D18); // M_PI_2 * 1\n const c2pio2 = reinterpret(0x400921FB54442D18); // M_PI_2 * 2\n const c3pio2 = reinterpret(0x4012D97C7F3321D2); // M_PI_2 * 3\n const c4pio2 = reinterpret(0x401921FB54442D18); // M_PI_2 * 4\n\n var ix = reinterpret(x);\n var sign = ix >> 31;\n ix &= 0x7FFFFFFF;\n\n if (ix <= 0x3f490fda) { /* |x| ~<= π/4 */\n if (ix < 0x39800000) { /* |x| < 2**-12 */\n /* raise inexact if x != 0 */\n return 1;\n }\n return cos_kernf(x);\n }\n\n if (ASC_SHRINK_LEVEL < 1) {\n if (ix <= 0x407b53d1) { /* |x| ~<= 5π/4 */\n if (ix > 0x4016cbe3) { /* |x| ~> 3π/4 */\n return -cos_kernf(sign ? x + c2pio2 : x - c2pio2);\n } else {\n return sign ? sin_kernf(x + c1pio2) : sin_kernf(c1pio2 - x);\n }\n }\n if (ix <= 0x40e231d5) { /* |x| ~<= 9π/4 */\n if (ix > 0x40afeddf) { /* |x| ~> 7π/4 */\n return cos_kernf(sign ? x + c4pio2 : x - c4pio2);\n } else {\n return sign ? sin_kernf(-x - c3pio2) : sin_kernf(x - c3pio2);\n }\n }\n }\n\n /* cos(Inf or NaN) is NaN */\n if (ix >= 0x7f800000) return x - x;\n\n /* general argument reduction needed */\n var n = rempio2f(x, ix, sign);\n var y = rempio2f_y;\n\n var t = n & 1 ? sin_kernf(y) : cos_kernf(y);\n return (n + 1) & 2 ? -t : t;\n }\n\n export function cosh(x: f32): f32 { // see: musl/src/math/coshf.c\n var u = reinterpret(x);\n u &= 0x7FFFFFFF;\n x = reinterpret(u);\n if (u < 0x3F317217) {\n if (u < 0x3F800000 - (12 << 23)) return 1;\n let t = expm1(x);\n // return 1 + t * t / (2 * (1 + t));\n return 1 + t * t / (2 + 2 * t);\n }\n if (u < 0x42B17217) {\n let t = exp(x);\n // return 0.5 * (t + 1 / t);\n return 0.5 * t + 0.5 / t;\n }\n return expo2f(x);\n }\n\n @inline\n export function floor(x: f32): f32 {\n return builtin_floor(x);\n }\n\n export function exp(x: f32): f32 { // see: musl/src/math/expf.c and SUN COPYRIGHT NOTICE above\n const\n ln2hi = reinterpret(0x3F317200), // 6.9314575195e-1f\n ln2lo = reinterpret(0x35BFBE8E), // 1.4286067653e-6f\n invln2 = reinterpret(0x3FB8AA3B), // 1.4426950216e+0f\n P1 = reinterpret(0x3E2AAA8F), // 1.6666625440e-1f\n P2 = reinterpret(0xBB355215), // -2.7667332906e-3f\n Ox1p127f = reinterpret(0x7F000000);\n var hx = reinterpret(x);\n var sign_ = (hx >> 31);\n hx &= 0x7FFFFFFF;\n if (hx >= 0x42AEAC50) {\n if (hx >= 0x42B17218) {\n if (!sign_) return x * Ox1p127f;\n else if (hx >= 0x42CFF1B5) return 0;\n }\n }\n var hi: f32, lo: f32;\n var k: i32;\n if (hx > 0x3EB17218) {\n if (hx > 0x3F851592) {\n k = (invln2 * x + builtin_copysign(0.5, x));\n } else {\n k = 1 - (sign_ << 1);\n }\n hi = x - k * ln2hi;\n lo = k * ln2lo;\n x = hi - lo;\n } else if (hx > 0x39000000) {\n k = 0;\n hi = x;\n lo = 0;\n } else {\n return 1 + x;\n }\n var xx = x * x;\n var c = x - xx * (P1 + xx * P2);\n var y: f32 = 1 + (x * c / (2 - c) - lo + hi);\n if (k == 0) return y;\n return scalbn(y, k);\n }\n\n export function expm1(x: f32): f32 { // see: musl/src/math/expm1f.c and SUN COPYRIGHT NOTICE above\n const\n o_threshold = reinterpret(0x42B17180), // 8.8721679688e+01f\n ln2_hi = reinterpret(0x3F317180), // 6.9313812256e-01f\n ln2_lo = reinterpret(0x3717F7D1), // 9.0580006145e-06f\n invln2 = reinterpret(0x3FB8AA3B), // 1.4426950216e+00f\n Q1 = reinterpret(0xBD088868), // -3.3333212137e-02f\n Q2 = reinterpret(0x3ACF3010), // 1.5807170421e-03f\n Ox1p127f = reinterpret(0x7F000000);\n var u = reinterpret(x);\n var hx = u & 0x7FFFFFFF;\n var sign_ = (u >> 31);\n if (hx >= 0x4195B844) {\n if (hx > 0x7F800000) return x;\n if (sign_) return -1;\n if (x > o_threshold) {\n x *= Ox1p127f;\n return x;\n }\n }\n var c: f32 = 0.0, t: f32, k: i32;\n if (hx > 0x3EB17218) {\n k = select(\n 1 - (sign_ << 1),\n (invln2 * x + builtin_copysign(0.5, x)),\n hx < 0x3F851592\n );\n t = k;\n let hi = x - t * ln2_hi;\n let lo = t * ln2_lo;\n x = hi - lo;\n c = (hi - x) - lo;\n } else if (hx < 0x33000000) {\n return x;\n } else k = 0;\n var hfx: f32 = 0.5 * x;\n var hxs: f32 = x * hfx;\n var r1: f32 = 1.0 + hxs * (Q1 + hxs * Q2);\n t = 3.0 - r1 * hfx;\n var e = hxs * ((r1 - t) / (6.0 - x * t));\n if (k == 0) return x - (x * e - hxs);\n e = x * (e - c) - c;\n e -= hxs;\n if (k == -1) return 0.5 * (x - e) - 0.5;\n if (k == 1) {\n if (x < -0.25) return -2.0 * (e - (x + 0.5));\n return 1.0 + 2.0 * (x - e);\n }\n u = (0x7F + k) << 23;\n var twopk = reinterpret(u);\n var y: f32;\n if (k < 0 || k > 56) {\n y = x - e + 1.0;\n if (k == 128) y = y * 2.0 * Ox1p127f;\n else y = y * twopk;\n return y - 1.0;\n }\n u = (0x7F - k) << 23;\n y = reinterpret(u);\n if (k < 20) y = (1 - y) - e;\n else y = 1 - (e + y);\n return (x + y) * twopk;\n }\n\n @inline\n export function fround(x: f32): f32 {\n return x;\n }\n\n export function hypot(x: f32, y: f32): f32 { // see: musl/src/math/hypotf.c\n const\n Ox1p90f = reinterpret(0x6C800000),\n Ox1p_90f = reinterpret(0x12800000);\n var ux = reinterpret(x);\n var uy = reinterpret(y);\n ux &= 0x7FFFFFFF;\n uy &= 0x7FFFFFFF;\n if (ux < uy) {\n let ut = ux;\n ux = uy;\n uy = ut;\n }\n x = reinterpret(ux);\n y = reinterpret(uy);\n if (uy == 0xFF << 23) return y;\n if (ux >= 0xFF << 23 || uy == 0 || ux - uy >= 25 << 23) return x + y;\n var z: f32 = 1;\n if (ux >= (0x7F + 60) << 23) {\n z = Ox1p90f;\n x *= Ox1p_90f;\n y *= Ox1p_90f;\n } else if (uy < (0x7F - 60) << 23) {\n z = Ox1p_90f;\n x *= Ox1p90f;\n y *= Ox1p90f;\n }\n return z * builtin_sqrt((x * x + y * y));\n }\n\n @inline\n export function imul(x: f32, y: f32): f32 {\n /*\n * Wasm (MVP) and JS have different approaches for double->int conversions.\n *\n * For emulate JS conversion behavior and avoid trapping from wasm we should modulate by MAX_INT\n * our float-point arguments before actual convertion to integers.\n */\n if (!isFinite(x + y)) return 0;\n const inv32 = 1.0 / 4294967296;\n return (\n (x - 4294967296 * builtin_floor(x * inv32)) *\n (y - 4294967296 * builtin_floor(y * inv32))\n );\n }\n\n export function log(x: f32): f32 { // see: musl/src/math/logf.c and SUN COPYRIGHT NOTICE above\n const\n ln2_hi = reinterpret(0x3F317180), // 6.9313812256e-01f\n ln2_lo = reinterpret(0x3717F7D1), // 9.0580006145e-06f\n Lg1 = reinterpret(0x3F2AAAAA), // 0xaaaaaa.0p-24f\n Lg2 = reinterpret(0x3ECCCE13), // 0xccce13.0p-25f\n Lg3 = reinterpret(0x3E91E9EE), // 0x91e9ee.0p-25f\n Lg4 = reinterpret(0x3E789E26), // 0xf89e26.0p-26f\n Ox1p25f = reinterpret(0x4C000000);\n var u = reinterpret(x);\n var k = 0;\n if (u < 0x00800000 || (u >> 31)) {\n if (u << 1 == 0) return -1 / (x * x);\n if (u >> 31) return (x - x) / 0;\n k -= 25;\n x *= Ox1p25f;\n u = reinterpret(x);\n } else if (u >= 0x7F800000) return x;\n else if (u == 0x3F800000) return 0;\n u += 0x3F800000 - 0x3F3504F3;\n k += (u >> 23) - 0x7F;\n u = (u & 0x007FFFFF) + 0x3F3504F3;\n x = reinterpret(u);\n var f = x - 1.0;\n var s = f / (2.0 + f);\n var z = s * s;\n var w = z * z;\n var t1 = w * (Lg2 + w * Lg4);\n var t2 = z * (Lg1 + w * Lg3);\n var r = t2 + t1;\n var hfsq = 0.5 * f * f;\n var dk = k;\n return s * (hfsq + r) + dk * ln2_lo - hfsq + f + dk * ln2_hi;\n }\n\n export function log10(x: f32): f32 { // see: musl/src/math/log10f.c and SUN COPYRIGHT NOTICE above\n const\n ivln10hi = reinterpret(0x3EDE6000), // 4.3432617188e-01f\n ivln10lo = reinterpret(0xB804EAD9), // -3.1689971365e-05f\n log10_2hi = reinterpret(0x3E9A2080), // 3.0102920532e-01f\n log10_2lo = reinterpret(0x355427DB), // 7.9034151668e-07f\n Lg1 = reinterpret(0x3F2AAAAA), // 0xaaaaaa.0p-24f, 0.66666662693f\n Lg2 = reinterpret(0x3ECCCE13), // 0xccce13.0p-25f, 0.40000972152f\n Lg3 = reinterpret(0x3E91E9EE), // 0x91e9ee.0p-25f, 0.28498786688f\n Lg4 = reinterpret(0x3E789E26), // 0xf89e26.0p-26f, 0.24279078841f\n Ox1p25f = reinterpret(0x4C000000);\n var ix = reinterpret(x);\n var k = 0;\n if (ix < 0x00800000 || (ix >> 31)) {\n if (ix << 1 == 0) return -1 / (x * x);\n if (ix >> 31) return (x - x) / 0.0;\n k -= 25;\n x *= Ox1p25f;\n ix = reinterpret(x);\n } else if (ix >= 0x7F800000) return x;\n else if (ix == 0x3F800000) return 0;\n ix += 0x3F800000 - 0x3F3504F3;\n k += (ix >> 23) - 0x7F;\n ix = (ix & 0x007FFFFF) + 0x3F3504F3;\n x = reinterpret(ix);\n var f = x - 1.0;\n var s = f / (2.0 + f);\n var z = s * s;\n var w = z * z;\n var t1 = w * (Lg2 + w * Lg4);\n var t2 = z * (Lg1 + w * Lg3);\n var r = t2 + t1;\n var hfsq: f32 = 0.5 * f * f;\n var hi = f - hfsq;\n ix = reinterpret(hi);\n ix &= 0xFFFFF000;\n hi = reinterpret(ix);\n var lo = f - hi - hfsq + s * (hfsq + r);\n var dk = k;\n return dk * log10_2lo + (lo + hi) * ivln10lo + lo * ivln10hi + hi * ivln10hi + dk * log10_2hi;\n }\n\n export function log1p(x: f32): f32 { // see: musl/src/math/log1pf.c and SUN COPYRIGHT NOTICE above\n const\n ln2_hi = reinterpret(0x3F317180), // 6.9313812256e-01\n ln2_lo = reinterpret(0x3717F7D1), // 9.0580006145e-06\n Lg1 = reinterpret(0x3F2AAAAA), // 0xaaaaaa.0p-24f, 0.66666662693f\n Lg2 = reinterpret(0x3ECCCE13), // 0xccce13.0p-25f, 0.40000972152f\n Lg3 = reinterpret(0x3E91E9EE), // 0x91e9ee.0p-25f, 0.28498786688f\n Lg4 = reinterpret(0x3E789E26); // 0xf89e26.0p-26f, 0.24279078841f\n var ix = reinterpret(x);\n var c: f32 = 0, f: f32 = 0;\n var k: i32 = 1;\n if (ix < 0x3ED413D0 || (ix >> 31)) {\n if (ix >= 0xBF800000) {\n if (x == -1) return x / 0.0;\n return (x - x) / 0.0;\n }\n if (ix << 1 < 0x33800000 << 1) return x;\n if (ix <= 0xBE95F619) {\n k = 0;\n c = 0;\n f = x;\n }\n } else if (ix >= 0x7F800000) return x;\n if (k) {\n let uf: f32 = 1 + x;\n let iu = reinterpret(uf);\n iu += 0x3F800000 - 0x3F3504F3;\n k = (iu >> 23) - 0x7F;\n if (k < 25) {\n c = k >= 2 ? 1 - (uf - x) : x - (uf - 1);\n c /= uf;\n } else c = 0;\n iu = (iu & 0x007FFFFF) + 0x3F3504F3;\n f = reinterpret(iu) - 1;\n }\n var s = f / (2.0 + f);\n var z = s * s;\n var w = z * z;\n var t1 = w * (Lg2 + w * Lg4);\n var t2 = z * (Lg1 + w * Lg3);\n var r = t2 + t1;\n var hfsq: f32 = 0.5 * f * f;\n var dk = k;\n return s * (hfsq + r) + (dk * ln2_lo + c) - hfsq + f + dk * ln2_hi;\n }\n\n export function log2(x: f32): f32 { // see: musl/src/math/log2f.c and SUN COPYRIGHT NOTICE above\n const\n ivln2hi = reinterpret(0x3FB8B000), // 1.4428710938e+00f\n ivln2lo = reinterpret(0xB9389AD4), // -1.7605285393e-04\n Lg1 = reinterpret(0x3F2AAAAA), // 0xaaaaaa.0p-24f, 0.66666662693f\n Lg2 = reinterpret(0x3ECCCE13), // 0xccce13.0p-25f, 0.40000972152f\n Lg3 = reinterpret(0x3E91E9EE), // 0x91e9ee.0p-25f, 0.28498786688f\n Lg4 = reinterpret(0x3E789E26), // 0xf89e26.0p-26f, 0.24279078841f\n Ox1p25f = reinterpret(0x4C000000);\n var ix = reinterpret(x);\n var k: i32 = 0;\n if (ix < 0x00800000 || (ix >> 31)) {\n if (ix << 1 == 0) return -1 / (x * x);\n if (ix >> 31) return (x - x) / 0.0;\n k -= 25;\n x *= Ox1p25f;\n ix = reinterpret(x);\n } else if (ix >= 0x7F800000) return x;\n else if (ix == 0x3F800000) return 0;\n ix += 0x3F800000 - 0x3F3504F3;\n k += (ix >> 23) - 0x7F;\n ix = (ix & 0x007FFFFF) + 0x3F3504F3;\n x = reinterpret(ix);\n var f = x - 1.0;\n var s = f / (2.0 + f);\n var z = s * s;\n var w = z * z;\n var t1 = w * (Lg2 + w * Lg4);\n var t2 = z * (Lg1 + w * Lg3);\n var r = t2 + t1;\n var hfsq: f32 = 0.5 * f * f;\n var hi = f - hfsq;\n var u = reinterpret(hi);\n u &= 0xFFFFF000;\n hi = reinterpret(u);\n var lo: f32 = f - hi - hfsq + s * (hfsq + r);\n var dk = k;\n return (lo + hi) * ivln2lo + lo * ivln2hi + hi * ivln2hi + dk;\n }\n\n @inline\n export function max(value1: f32, value2: f32): f32 {\n return builtin_max(value1, value2);\n }\n\n @inline\n export function min(value1: f32, value2: f32): f32 {\n return builtin_min(value1, value2);\n }\n\n export function pow(x: f32, y: f32): f32 { // see: musl/src/math/powf.c and SUN COPYRIGHT NOTICE above\n const\n dp_h1 = reinterpret(0x3F15C000), // 5.84960938e-01f\n dp_l1 = reinterpret(0x35D1CFDC), // 1.56322085e-06f\n two24 = reinterpret(0x4B800000), // 16777216f\n huge = reinterpret(0x7149F2CA), // 1.0e+30f\n tiny = reinterpret(0x0DA24260), // 1.0e-30f\n L1 = reinterpret(0x3F19999A), // 6.0000002384e-01f\n L2 = reinterpret(0x3EDB6DB7), // 4.2857143283e-01f\n L3 = reinterpret(0x3EAAAAAB), // 3.3333334327e-01f\n L4 = reinterpret(0x3E8BA305), // 2.7272811532e-01f\n L5 = reinterpret(0x3E6C3255), // 2.3066075146e-01f\n L6 = reinterpret(0x3E53F142), // 2.0697501302e-01f\n P1 = reinterpret(0x3E2AAAAB), // 1.6666667163e-01f\n P2 = reinterpret(0xBB360B61), // -2.7777778450e-03f\n P3 = reinterpret(0x388AB355), // 6.6137559770e-05f\n P4 = reinterpret(0xB5DDEA0E), // -1.6533901999e-06f\n P5 = reinterpret(0x3331BB4C), // 4.1381369442e-08f\n lg2 = reinterpret(0x3F317218), // 6.9314718246e-01f\n lg2_h = reinterpret(0x3F317200), // 6.93145752e-01f\n lg2_l = reinterpret(0x35BFBE8C), // 1.42860654e-06f\n ovt = reinterpret(0x3338AA3C), // 4.2995665694e-08f\n cp = reinterpret(0x3F76384F), // 9.6179670095e-01\n cp_h = reinterpret(0x3F764000), // 9.6191406250e-01\n cp_l = reinterpret(0xB8F623C6), // -1.1736857402e-04\n ivln2 = reinterpret(0x3FB8AA3B), // 1.4426950216e+00\n ivln2_h = reinterpret(0x3FB8AA00), // 1.4426879883e+00\n ivln2_l = reinterpret(0x36ECA570), // 7.0526075433e-06\n inv3 = reinterpret(0x3EAAAAAB); // 0.333333333333\n var hx = reinterpret(x);\n var hy = reinterpret(y);\n var ix = hx & 0x7FFFFFFF;\n var iy = hy & 0x7FFFFFFF;\n if (iy == 0) return 1.0; // x**0 = 1, even if x is NaN\n // if (hx == 0x3F800000) return 1.0; // C: 1**y = 1, even if y is NaN, JS: NaN\n if (ix > 0x7F800000 || iy > 0x7F800000) return x + y; // NaN if either arg is NaN\n var yisint = 0, j: i32, k: i32;\n if (hx < 0) {\n if (iy >= 0x4B800000) yisint = 2;\n else if (iy >= 0x3F800000) {\n k = (iy >> 23) - 0x7F;\n let ki = 23 - k;\n j = iy >> ki;\n if ((j << ki) == iy) yisint = 2 - (j & 1);\n }\n }\n if (iy == 0x7F800000) { // y is +-inf\n if (ix == 0x3F800000) return NaN; // C: (-1)**+-inf is 1, JS: NaN\n else if (ix > 0x3F800000) return hy >= 0 ? y : 0.0; // (|x|>1)**+-inf = inf,0\n else return hy >= 0 ? 0.0 : -y; // (|x|<1)**+-inf = 0,inf\n }\n if (iy == 0x3F800000) return hy >= 0 ? x : 1.0 / x;\n if (hy == 0x40000000) return x * x;\n if (hy == 0x3F000000) {\n if (hx >= 0) return builtin_sqrt(x);\n }\n var ax = builtin_abs(x);\n var z: f32;\n if (ix == 0x7F800000 || ix == 0 || ix == 0x3F800000) {\n z = ax;\n if (hy < 0) z = 1.0 / z;\n if (hx < 0) {\n if (((ix - 0x3F800000) | yisint) == 0) {\n let d = z - z;\n z = d / d;\n }\n else if (yisint == 1) z = -z;\n }\n return z;\n }\n var sn = 1.0;\n if (hx < 0) {\n if (yisint == 0) {\n let d = x - x;\n return d / d;\n }\n if (yisint == 1) sn = -1.0;\n }\n var t1: f32, t2: f32, r: f32, s: f32, t: f32, u: f32, v: f32, w: f32, p_h: f32, p_l: f32;\n var n: i32, is: i32;\n if (iy > 0x4D000000) {\n if (ix < 0x3F7FFFF8) return hy < 0 ? sn * huge * huge : sn * tiny * tiny;\n if (ix > 0x3F800007) return hy > 0 ? sn * huge * huge : sn * tiny * tiny;\n t = ax - 1;\n w = (t * t) * (0.5 - t * (inv3 - t * 0.25));\n u = ivln2_h * t;\n v = t * ivln2_l - w * ivln2;\n t1 = u + v;\n is = reinterpret(t1);\n t1 = reinterpret(is & 0xFFFFF000);\n t2 = v - (t1 - u);\n } else {\n let s2: f32, s_h: f32, s_l: f32, t_h: f32, t_l: f32;\n n = 0;\n if (ix < 0x00800000) {\n ax *= two24;\n n -= 24;\n ix = reinterpret(ax);\n }\n n += (ix >> 23) - 0x7F;\n j = ix & 0x007FFFFF;\n ix = j | 0x3F800000;\n if (j <= 0x1CC471) k = 0;\n else if (j < 0x5DB3D7) k = 1;\n else {\n k = 0;\n n += 1;\n ix -= 0x00800000;\n }\n ax = reinterpret(ix);\n let bp = select(1.5, 1.0, k); // k ? 1.5 : 1.0\n u = ax - bp;\n v = 1.0 / (ax + bp);\n s = u * v;\n s_h = s;\n is = reinterpret(s_h);\n s_h = reinterpret(is & 0xFFFFF000);\n is = ((ix >> 1) & 0xFFFFF000) | 0x20000000;\n t_h = reinterpret(is + 0x00400000 + (k << 21));\n t_l = ax - (t_h - bp);\n s_l = v * ((u - s_h * t_h) - s_h * t_l);\n s2 = s * s;\n r = s2 * s2 * (L1 + s2 * (L2 + s2 * (L3 + s2 * (L4 + s2 * (L5 + s2 * L6)))));\n r += s_l * (s_h + s);\n s2 = s_h * s_h;\n t_h = 3.0 + s2 + r;\n is = reinterpret(t_h);\n t_h = reinterpret(is & 0xFFFFF000);\n t_l = r - ((t_h - 3.0) - s2);\n u = s_h * t_h;\n v = s_l * t_h + t_l * s;\n p_h = u + v;\n is = reinterpret(p_h);\n p_h = reinterpret(is & 0xFFFFF000);\n p_l = v - (p_h - u);\n let z_h = cp_h * p_h;\n let dp_l = select(dp_l1, 0.0, k);\n let z_l = cp_l * p_h + p_l * cp + dp_l;\n t = n;\n let dp_h = select(dp_h1, 0.0, k);\n t1 = (((z_h + z_l) + dp_h) + t);\n is = reinterpret(t1);\n t1 = reinterpret(is & 0xFFFFF000);\n t2 = z_l - (((t1 - t) - dp_h) - z_h);\n }\n is = reinterpret(y);\n var y1 = reinterpret(is & 0xFFFFF000);\n p_l = (y - y1) * t1 + y * t2;\n p_h = y1 * t1;\n z = p_l + p_h;\n j = reinterpret(z);\n if (j > 0x43000000) {\n return sn * huge * huge;\n } else if (j == 0x43000000) {\n if (p_l + ovt > z - p_h) return sn * huge * huge;\n } else if ((j & 0x7FFFFFFF) > 0x43160000) {\n return sn * tiny * tiny;\n } else if (j == 0xC3160000) {\n if (p_l <= z - p_h) return sn * tiny * tiny;\n }\n var i = j & 0x7FFFFFFF;\n k = (i >> 23) - 0x7F;\n n = 0;\n if (i > 0x3F000000) {\n n = j + (0x00800000 >> (k + 1));\n k = ((n & 0x7FFFFFFF) >> 23) - 0x7F;\n t = reinterpret(n & ~(0x007FFFFF >> k));\n n = ((n & 0x007FFFFF) | 0x00800000) >> (23 - k);\n if (j < 0) n = -n;\n p_h -= t;\n }\n t = p_l + p_h;\n is = reinterpret(t);\n t = reinterpret(is & 0xFFFF8000);\n u = t * lg2_h;\n v = (p_l - (t - p_h)) * lg2 + t * lg2_l;\n z = u + v;\n w = v - (z - u);\n t = z * z;\n t1 = z - t * (P1 + t * (P2 + t * (P3 + t * (P4 + t * P5))));\n r = (z * t1) / (t1 - 2.0) - (w + z * w);\n z = 1.0 - (r - z);\n j = reinterpret(z);\n j += n << 23;\n if ((j >> 23) <= 0) z = scalbn(z, n);\n else z = reinterpret(j);\n return sn * z;\n }\n\n @inline\n export function seedRandom(value: i64): void {\n NativeMath.seedRandom(value);\n }\n\n // Using xoroshiro64starstar from http://xoshiro.di.unimi.it/xoroshiro64starstar.c\n export function random(): f32 {\n if (!random_seeded) throw new Error("PRNG must be seeded.");\n\n var s0 = random_state0_32;\n var s1 = random_state1_32;\n var r = rotl(s0 * 0x9E3779BB, 5) * 5;\n\n s1 ^= s0;\n random_state0_32 = rotl(s0, 26) ^ s1 ^ (s1 << 9);\n random_state1_32 = rotl(s1, 13);\n\n return reinterpret((r >> 9) | (127 << 23)) - 1.0;\n }\n\n @inline\n export function round(x: f32): f32 {\n return builtin_copysign(builtin_floor(x + 0.5), x);\n }\n\n @inline\n export function sign(x: f32): f32 {\n if (ASC_SHRINK_LEVEL > 0) {\n return builtin_abs(x) > 0 ? builtin_copysign(1, x) : x;\n } else {\n return x > 0 ? 1 : x < 0 ? -1 : x;\n }\n }\n\n @inline\n export function signbit(x: f32): bool {\n return ((reinterpret(x) >>> 31) & (x == x));\n }\n\n export function sin(x: f32): f32 { // see: musl/src/math/sinf.c\n const s1pio2 = reinterpret(0x3FF921FB54442D18); // M_PI_2 * 1\n const s2pio2 = reinterpret(0x400921FB54442D18); // M_PI_2 * 2\n const s3pio2 = reinterpret(0x4012D97C7F3321D2); // M_PI_2 * 3\n const s4pio2 = reinterpret(0x401921FB54442D18); // M_PI_2 * 4\n\n var ix = reinterpret(x);\n var sign = ix >> 31;\n ix &= 0x7FFFFFFF;\n\n if (ix <= 0x3f490fda) { /* |x| ~<= π/4 */\n if (ix < 0x39800000) { /* |x| < 2**-12 */\n return x;\n }\n return sin_kernf(x);\n }\n\n if (ASC_SHRINK_LEVEL < 1) {\n if (ix <= 0x407b53d1) { /* |x| ~<= 5π/4 */\n if (ix <= 0x4016cbe3) { /* |x| ~<= 3π/4 */\n return sign ? -cos_kernf(x + s1pio2) : cos_kernf(x - s1pio2);\n }\n return sin_kernf(-(sign ? x + s2pio2 : x - s2pio2));\n }\n\n if (ix <= 0x40e231d5) { /* |x| ~<= 9π/4 */\n if (ix <= 0x40afeddf) { /* |x| ~<= 7π/4 */\n return sign ? cos_kernf(x + s3pio2) : -cos_kernf(x - s3pio2);\n }\n return sin_kernf(sign ? x + s4pio2 : x - s4pio2);\n }\n }\n\n /* sin(Inf or NaN) is NaN */\n if (ix >= 0x7f800000) return x - x;\n\n var n = rempio2f(x, ix, sign);\n var y = rempio2f_y;\n\n var t = n & 1 ? cos_kernf(y) : sin_kernf(y);\n return n & 2 ? -t : t;\n }\n\n export function sinh(x: f32): f32 { // see: musl/src/math/sinhf.c\n var u = reinterpret(x) & 0x7FFFFFFF;\n var absx = reinterpret(u);\n var t: f32;\n var h = builtin_copysign(0.5, x);\n if (u < 0x42B17217) {\n t = expm1(absx);\n if (u < 0x3F800000) {\n if (u < 0x3F800000 - (12 << 23)) return x;\n return h * (2 * t - t * t / (t + 1));\n }\n return h * (t + t / (t + 1));\n }\n t = 2 * h * expo2f(absx);\n return t;\n }\n\n @inline\n export function sqrt(x: f32): f32 {\n return builtin_sqrt(x);\n }\n\n export function tan(x: f32): f32 { // see: musl/src/math/tanf.c\n const t1pio2 = reinterpret(0x3FF921FB54442D18); // 1 * M_PI_2\n const t2pio2 = reinterpret(0x400921FB54442D18); // 2 * M_PI_2\n const t3pio2 = reinterpret(0x4012D97C7F3321D2); // 3 * M_PI_2\n const t4pio2 = reinterpret(0x401921FB54442D18); // 4 * M_PI_2\n\n var ix = reinterpret(x);\n var sign = ix >> 31;\n ix &= 0x7FFFFFFF;\n\n if (ix <= 0x3f490fda) { /* |x| ~<= π/4 */\n if (ix < 0x39800000) { /* |x| < 2**-12 */\n return x;\n }\n return tan_kernf(x, 0);\n }\n\n if (ASC_SHRINK_LEVEL < 1) {\n if (ix <= 0x407b53d1) { /* |x| ~<= 5π/4 */\n if (ix <= 0x4016cbe3) { /* |x| ~<= 3π/4 */\n return tan_kernf((sign ? x + t1pio2 : x - t1pio2), 1);\n } else {\n return tan_kernf((sign ? x + t2pio2 : x - t2pio2), 0);\n }\n }\n if (ix <= 0x40e231d5) { /* |x| ~<= 9π/4 */\n if (ix <= 0x40afeddf) { /* |x| ~<= 7π/4 */\n return tan_kernf((sign ? x + t3pio2 : x - t3pio2), 1);\n } else {\n return tan_kernf((sign ? x + t4pio2 : x - t4pio2), 0);\n }\n }\n }\n\n /* tan(Inf or NaN) is NaN */\n if (ix >= 0x7f800000) return x - x;\n\n /* argument reduction */\n var n = rempio2f(x, ix, sign);\n var y = rempio2f_y;\n return tan_kernf(y, n & 1);\n }\n\n export function tanh(x: f32): f32 { // see: musl/src/math/tanhf.c\n var u = reinterpret(x);\n u &= 0x7FFFFFFF;\n var y = reinterpret(u);\n var t: f32;\n if (u > 0x3F0C9F54) {\n if (u > 0x41200000) t = 1 + 0 / y;\n else {\n t = expm1(2 * y);\n t = 1 - 2 / (t + 2);\n }\n } else if (u > 0x3E82C578) {\n t = expm1(2 * y);\n t = t / (t + 2);\n } else if (u >= 0x00800000) {\n t = expm1(-2 * y);\n t = -t / (t + 2);\n } else t = y;\n return builtin_copysign(t, x);\n }\n\n @inline\n export function trunc(x: f32): f32 {\n return builtin_trunc(x);\n }\n\n export function scalbn(x: f32, n: i32): f32 { // see: https://git.musl-libc.org/cgit/musl/tree/src/math/scalbnf.c\n const\n Ox1p24f = reinterpret(0x4B800000),\n Ox1p127f = reinterpret(0x7F000000),\n Ox1p_126f = reinterpret(0x00800000);\n var y = x;\n if (n > 127) {\n y *= Ox1p127f;\n n -= 127;\n if (n > 127) {\n y *= Ox1p127f;\n n = builtin_min(n - 127, 127);\n }\n } else if (n < -126) {\n y *= Ox1p_126f * Ox1p24f;\n n += 126 - 24;\n if (n < -126) {\n y *= Ox1p_126f * Ox1p24f;\n n = builtin_max(n + 126 - 24, -126);\n }\n }\n return y * reinterpret((0x7F + n) << 23);\n }\n\n export function mod(x: f32, y: f32): f32 { // see: musl/src/math/fmodf.c\n var ux = reinterpret(x);\n var uy = reinterpret(y);\n var ex = (ux >> 23 & 0xFF);\n var ey = (uy >> 23 & 0xFF);\n var sx = ux & 0x80000000;\n var uy1 = uy << 1;\n if (uy1 == 0 || ex == 0xFF || isNaN(y)) {\n let m = x * y;\n return m / m;\n }\n var ux1 = ux << 1;\n if (ux1 <= uy1) {\n if (ux1 == uy1) return 0 * x;\n return x;\n }\n if (!ex) {\n ex -= builtin_clz(ux << 9);\n ux <<= -ex + 1;\n } else {\n ux &= -1 >> 9;\n ux |= 1 << 23;\n }\n if (!ey) {\n ey -= builtin_clz(uy << 9);\n uy <<= -ey + 1;\n } else {\n uy &= -1 >> 9;\n uy |= 1 << 23;\n }\n while (ex > ey) {\n if (ux >= uy) {\n if (ux == uy) return 0 * x;\n ux -= uy;\n }\n ux <<= 1;\n --ex;\n }\n if (ux >= uy) {\n if (ux == uy) return 0 * x;\n ux -= uy;\n }\n // for (; !(ux >> 23); ux <<= 1) --ex;\n var shift = builtin_clz(ux << 8);\n ex -= shift;\n ux <<= shift;\n if (ex > 0) {\n ux -= 1 << 23;\n ux |= ex << 23;\n } else {\n ux >>= -ex + 1;\n }\n ux |= sx;\n return reinterpret(ux);\n }\n\n export function rem(x: f32, y: f32): f32 { // see: musl/src/math/remquof.c\n var ux = reinterpret(x);\n var uy = reinterpret(y);\n var ex = (ux >> 23 & 0xFF);\n var ey = (uy >> 23 & 0xFF);\n var sx = (ux >> 31);\n var uxi = ux;\n if (uy << 1 == 0 || ex == 0xFF || isNaN(y)) return (x * y) / (x * y);\n if (ux << 1 == 0) return x;\n if (!ex) {\n ex -= builtin_clz(uxi << 9);\n uxi <<= -ex + 1;\n } else {\n uxi &= -1 >> 9;\n uxi |= 1 << 23;\n }\n if (!ey) {\n ey -= builtin_clz(uy << 9);\n uy <<= -ey + 1;\n } else {\n uy &= -1 >> 9;\n uy |= 1 << 23;\n }\n var q = 0;\n do {\n if (ex < ey) {\n if (ex + 1 == ey) break; // goto end\n return x;\n }\n while (ex > ey) {\n if (uxi >= uy) {\n uxi -= uy;\n ++q;\n }\n uxi <<= 1;\n q <<= 1;\n --ex;\n }\n if (uxi >= uy) {\n uxi -= uy;\n ++q;\n }\n if (uxi == 0) ex = -30;\n else {\n let shift = builtin_clz(uxi << 8);\n ex -= shift;\n uxi <<= shift;\n }\n break;\n } while (false);\n // end\n if (ex > 0) {\n uxi -= 1 << 23;\n uxi |= ex << 23;\n } else {\n uxi >>= -ex + 1;\n }\n x = reinterpret(uxi);\n y = builtin_abs(y);\n var x2 = x + x;\n if (ex == ey || (ex + 1 == ey && (x2 > y || (x2 == y && (q & 1))))) {\n x -= y;\n // q++;\n }\n return sx ? -x : x;\n }\n\n export function sincos(x: f32): void { // see: musl/tree/src/math/sincosf.c\n const s1pio2 = reinterpret(0x3FF921FB54442D18); // 1 * M_PI_2\n const s2pio2 = reinterpret(0x400921FB54442D18); // 2 * M_PI_2\n const s3pio2 = reinterpret(0x4012D97C7F3321D2); // 3 * M_PI_2\n const s4pio2 = reinterpret(0x401921FB54442D18); // 4 * M_PI_2\n\n var ix = reinterpret(x);\n var sign = ix >> 31;\n ix &= 0x7fffffff;\n\n if (ix <= 0x3f490fda) { /* |x| ~<= π/4 */\n if (ix < 0x39800000) { /* |x| < 2**-12 */\n sincos_s32 = x;\n sincos_c32 = 1;\n return;\n }\n sincos_s32 = sin_kernf(x);\n sincos_c32 = cos_kernf(x);\n return;\n }\n\n if (ASC_SHRINK_LEVEL < 1) {\n if (ix <= 0x407b53d1) { /* |x| ~<= 5π/4 */\n if (ix <= 0x4016cbe3) { /* |x| ~<= 3π/4 */\n if (sign) {\n sincos_s32 = -cos_kernf(x + s1pio2);\n sincos_c32 = sin_kernf(x + s1pio2);\n } else {\n sincos_s32 = cos_kernf(s1pio2 - x);\n sincos_c32 = sin_kernf(s1pio2 - x);\n }\n return;\n }\n /* -sin(x + c) is not correct if x+c could be 0: -0 vs +0 */\n sincos_s32 = -sin_kernf(sign ? x + s2pio2 : x - s2pio2);\n sincos_c32 = -cos_kernf(sign ? x + s2pio2 : x - s2pio2);\n return;\n }\n\n if (ix <= 0x40e231d5) { /* |x| ~<= 9π/4 */\n if (ix <= 0x40afeddf) { /* |x| ~<= 7π/4 */\n if (sign) {\n sincos_s32 = cos_kernf(x + s3pio2);\n sincos_c32 = -sin_kernf(x + s3pio2);\n } else {\n sincos_s32 = -cos_kernf(x - s3pio2);\n sincos_c32 = sin_kernf(x - s3pio2);\n }\n return;\n }\n sincos_s32 = sin_kernf(sign ? x + s4pio2 : x - s4pio2);\n sincos_c32 = cos_kernf(sign ? x + s4pio2 : x - s4pio2);\n return;\n }\n }\n\n /* sin(Inf or NaN) is NaN */\n if (ix >= 0x7f800000) {\n let xx = x - x;\n sincos_s32 = xx;\n sincos_c32 = xx;\n return;\n }\n\n /* general argument reduction needed */\n var n = rempio2f(x, ix, sign);\n var y = rempio2f_y;\n var s = sin_kernf(y);\n var c = cos_kernf(y);\n\n switch (n & 3) {\n case 0: {\n sincos_s32 = s;\n sincos_c32 = c;\n break;\n }\n case 1: {\n sincos_s32 = c;\n sincos_c32 = -s;\n break;\n }\n case 2: {\n sincos_s32 = -s;\n sincos_c32 = -c;\n break;\n }\n case 3:\n default: {\n sincos_s32 = -c;\n sincos_c32 = s;\n break;\n }\n }\n }\n}\n\nexport function ipow32(x: i32, e: i32): i32 {\n var out = 1;\n if (ASC_SHRINK_LEVEL < 1) {\n if (e < 0) return 0;\n\n switch (e) {\n case 0: return 1;\n case 1: return x;\n case 2: return x * x;\n }\n\n let log = 32 - clz(e);\n if (log <= 5) {\n // 32 = 2 ^ 5, so need only five cases.\n // But some extra cases needs for properly overflowing\n switch (log) {\n case 5: {\n if (e & 1) out *= x;\n e >>= 1;\n x *= x;\n }\n case 4: {\n if (e & 1) out *= x;\n e >>= 1;\n x *= x;\n }\n case 3: {\n if (e & 1) out *= x;\n e >>= 1;\n x *= x;\n }\n case 2: {\n if (e & 1) out *= x;\n e >>= 1;\n x *= x;\n }\n case 1: {\n if (e & 1) out *= x;\n }\n }\n return out;\n }\n }\n\n while (e > 0) {\n if (e & 1) out *= x;\n e >>= 1;\n x *= x;\n }\n return out;\n}\n\nexport function ipow64(x: i64, e: i32): i64 {\n var out: i64 = 1;\n if (ASC_SHRINK_LEVEL < 1) {\n if (e < 0) return 0;\n switch (e) {\n case 0: return 1;\n case 1: return x;\n case 2: return x * x;\n }\n\n let log = 32 - clz(e);\n if (log <= 6) {\n // 64 = 2 ^ 6, so need only six cases.\n // But some extra cases needs for properly overflowing\n switch (log) {\n case 6: {\n if (e & 1) out *= x;\n e >>= 1;\n x *= x;\n }\n case 5: {\n if (e & 1) out *= x;\n e >>= 1;\n x *= x;\n }\n case 4: {\n if (e & 1) out *= x;\n e >>= 1;\n x *= x;\n }\n case 3: {\n if (e & 1) out *= x;\n e >>= 1;\n x *= x;\n }\n case 2: {\n if (e & 1) out *= x;\n e >>= 1;\n x *= x;\n }\n case 1: {\n if (e & 1) out *= x;\n }\n }\n return out;\n }\n }\n\n while (e > 0) {\n if (e & 1) out *= x;\n e >>= 1;\n x *= x;\n }\n return out;\n}\n\nexport function ipow32f(x: f32, e: i32): f32 {\n var sign = e >> 31;\n e = (e + sign) ^ sign; // abs(e)\n var out: f32 = 1;\n while (e) {\n out *= select(x, 1.0, e & 1);\n e >>= 1;\n x *= x;\n }\n return sign ? 1.0 / out : out;\n}\n\nexport function ipow64f(x: f64, e: i32): f64 {\n var sign = e >> 31;\n e = (e + sign) ^ sign; // abs(e)\n var out = 1.0;\n while (e) {\n out *= select(x, 1.0, e & 1);\n e >>= 1;\n x *= x;\n }\n return sign ? 1.0 / out : out;\n}\n',memory:'import { memcmp, memmove, memset } from "./internal/memory";\n\n@builtin export declare const HEAP_BASE: usize; // tslint:disable-line\n\n/* tslint:disable */\n\nexport namespace memory {\n\n @builtin export declare function size(): i32;\n\n @builtin export declare function grow(pages: i32): i32;\n\n @builtin @inline\n export function fill(dest: usize, c: u8, n: usize): void { // see: musl/src/string/memset\n memset(dest, c, n); // fallback if "bulk-memory" isn\'t enabled\n }\n\n @builtin @inline\n export function copy(dest: usize, src: usize, n: usize): void { // see: musl/src/string/memmove.c\n memmove(dest, src, n); // fallback if "bulk-memory" isn\'t enabled\n }\n\n @inline export function compare(vl: usize, vr: usize, n: usize): i32 { // see: musl/src/string/memcmp.c\n return memcmp(vl, vr, n);\n }\n\n // Passive segments\n\n // export function init(segmentIndex: u32, srcOffset: usize, dstOffset: usize, n: usize): void {\n // __memory_init(segmentIndex, srcOffset, dstOffset);\n // }\n\n // export function drop(segmentIndex: u32): void {\n // __memory_drop(segmentIndex);\n // }\n\n // Allocator\n\n @inline export function allocate(size: usize): usize {\n if (isDefined(__memory_allocate)) return __memory_allocate(size);\n WARNING("Calling \'memory.allocate\' requires a memory manager to be present.");\n return unreachable();\n }\n\n @inline export function free(ptr: usize): void {\n if (isDefined(__memory_free)) { __memory_free(ptr); return; }\n WARNING("Calling \'memory.free\' requires a memory manager to be present.");\n unreachable();\n }\n\n @inline export function reset(): void {\n if (isDefined(__memory_reset)) { __memory_reset(); return; }\n unreachable();\n }\n}\n',number:'import {\n itoa,\n dtoa\n} from "./internal/number";\n\nimport {\n isNaN as builtin_isNaN,\n isFinite as builtin_isFinite\n} from "./builtins";\n\n@sealed\nexport abstract class I8 {\n\n @lazy static readonly MIN_VALUE: i8 = i8.MIN_VALUE;\n @lazy static readonly MAX_VALUE: i8 = i8.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): i8 {\n return parseI32(value, radix);\n }\n\n toString(this: i8): String {\n // TODO: radix\n return itoa(this);\n }\n}\n\n@sealed\nexport abstract class I16 {\n\n @lazy static readonly MIN_VALUE: i16 = i16.MIN_VALUE;\n @lazy static readonly MAX_VALUE: i16 = i16.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): i16 {\n return parseI32(value, radix);\n }\n\n toString(this: i16): String {\n // TODO: radix\n return itoa(this);\n }\n}\n\n@sealed\nexport abstract class I32 {\n\n @lazy static readonly MIN_VALUE: i32 = i32.MIN_VALUE;\n @lazy static readonly MAX_VALUE: i32 = i32.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): i32 {\n return parseI32(value, radix);\n }\n\n toString(this: i32): String {\n // TODO: radix\n return itoa(this);\n }\n}\n\n@sealed\nexport abstract class I64 {\n\n @lazy static readonly MIN_VALUE: i64 = i64.MIN_VALUE;\n @lazy static readonly MAX_VALUE: i64 = i64.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): i64 {\n return parseI64(value, radix);\n }\n\n toString(this: i64): String {\n // TODO: radix\n return itoa(this);\n }\n}\n\n@sealed\nexport abstract class Isize {\n\n @lazy static readonly MIN_VALUE: isize = isize.MIN_VALUE;\n @lazy static readonly MAX_VALUE: isize = isize.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): isize {\n return parseI64(value, radix);\n }\n\n toString(this: isize): String {\n // TODO: radix\n return itoa(this);\n }\n}\n\n@sealed\nexport abstract class U8 {\n\n @lazy static readonly MIN_VALUE: u8 = u8.MIN_VALUE;\n @lazy static readonly MAX_VALUE: u8 = u8.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): u8 {\n return parseI32(value, radix);\n }\n\n toString(this: u8): String {\n // TODO: radix\n return itoa(this);\n }\n}\n\n@sealed\nexport abstract class U16 {\n\n @lazy static readonly MIN_VALUE: u16 = u16.MIN_VALUE;\n @lazy static readonly MAX_VALUE: u16 = u16.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): u16 {\n return parseI32(value, radix);\n }\n\n toString(this: u16): String {\n // TODO: radix\n return itoa(this);\n }\n}\n\n@sealed\nexport abstract class U32 {\n\n @lazy static readonly MIN_VALUE: u32 = u32.MIN_VALUE;\n @lazy static readonly MAX_VALUE: u32 = u32.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): u32 {\n return parseI32(value, radix);\n }\n\n toString(this: u32): String {\n // TODO: radix\n return itoa(this);\n }\n}\n\n@sealed\nexport abstract class U64 {\n\n @lazy static readonly MIN_VALUE: u64 = u64.MIN_VALUE;\n @lazy static readonly MAX_VALUE: u64 = u64.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): u64 {\n return parseI64(value, radix);\n }\n\n toString(this: u64): String {\n // TODO: radix\n return itoa(this);\n }\n}\n\n@sealed\nexport abstract class Usize {\n\n @lazy static readonly MIN_VALUE: usize = usize.MIN_VALUE;\n @lazy static readonly MAX_VALUE: usize = usize.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): usize {\n return parseI64(value, radix);\n }\n\n toString(this: usize): String {\n // TODO: radix\n return itoa(this);\n }\n}\n\n@sealed\nexport abstract class Bool {\n\n @lazy static readonly MIN_VALUE: bool = bool.MIN_VALUE;\n @lazy static readonly MAX_VALUE: bool = bool.MAX_VALUE;\n\n toString(this: bool): String {\n // TODO: radix?\n return this ? "true" : "false";\n }\n}\n\nexport { Bool as Boolean };\n\n@sealed\nexport abstract class F32 {\n\n @lazy static readonly EPSILON: f32 = f32.EPSILON;\n @lazy static readonly MIN_VALUE: f32 = f32.MIN_VALUE;\n @lazy static readonly MAX_VALUE: f32 = f32.MAX_VALUE;\n @lazy static readonly MIN_SAFE_INTEGER: f32 = f32.MIN_SAFE_INTEGER;\n @lazy static readonly MAX_SAFE_INTEGER: f32 = f32.MAX_SAFE_INTEGER;\n @lazy static readonly POSITIVE_INFINITY: f32 = Infinity;\n @lazy static readonly NEGATIVE_INFINITY: f32 = -Infinity;\n @lazy static readonly NaN: f32 = NaN;\n\n static isNaN(value: f32): bool {\n return isNaN(value);\n }\n\n static isFinite(value: f32): bool {\n return isFinite(value);\n }\n\n static isSafeInteger(value: f32): bool {\n return abs(value) <= f32.MAX_SAFE_INTEGER && trunc(value) == value;\n }\n\n static isInteger(value: f32): bool {\n return isFinite(value) && trunc(value) == value;\n }\n\n static parseInt(value: string, radix: i32 = 0): f32 {\n return parseI64(value, radix);\n }\n\n static parseFloat(value: string): f32 {\n return parseFloat(value);\n }\n\n toString(this: f32): String {\n // TODO: radix\n return dtoa(this);\n }\n}\n\n@sealed\nexport abstract class F64 {\n\n @lazy static readonly EPSILON: f64 = f64.EPSILON;\n @lazy static readonly MIN_VALUE: f64 = f64.MIN_VALUE;\n @lazy static readonly MAX_VALUE: f64 = f64.MAX_VALUE;\n @lazy static readonly MIN_SAFE_INTEGER: f64 = f64.MIN_SAFE_INTEGER;\n @lazy static readonly MAX_SAFE_INTEGER: f64 = f64.MAX_SAFE_INTEGER;\n @lazy static readonly POSITIVE_INFINITY: f64 = Infinity;\n @lazy static readonly NEGATIVE_INFINITY: f64 = -Infinity;\n @lazy static readonly NaN: f64 = NaN;\n\n static isNaN(value: f64): bool {\n return builtin_isNaN(value);\n }\n\n static isFinite(value: f64): bool {\n return builtin_isFinite(value);\n }\n\n static isSafeInteger(value: f64): bool {\n return abs(value) <= f64.MAX_SAFE_INTEGER && trunc(value) == value;\n }\n\n static isInteger(value: f64): bool {\n return builtin_isFinite(value) && trunc(value) == value;\n }\n\n static parseInt(value: string, radix: i32 = 0): f64 {\n return parseI64(value, radix);\n }\n\n static parseFloat(value: string): f64 {\n return parseFloat(value);\n }\n\n toString(this: f64): String {\n // TODO: radix\n return dtoa(this);\n }\n}\n\nexport { F64 as Number };\n',polyfills:"export function bswap(value: T): T {\n if (isInteger()) {\n if (sizeof() == 2) {\n return ((value << 8) | ((value >> 8) & 0x00FF));\n }\n if (sizeof() == 4) {\n return (\n rotl(value & 0xFF00FF00, 8) |\n rotr(value & 0x00FF00FF, 8)\n );\n }\n if (sizeof() == 8) {\n let a = (value >> 8) & 0x00FF00FF00FF00FF;\n let b = (value & 0x00FF00FF00FF00FF) << 8;\n let v = a | b;\n\n a = (v >> 16) & 0x0000FFFF0000FFFF;\n b = (v & 0x0000FFFF0000FFFF) << 16;\n\n return rotr(a | b, 32);\n }\n return value;\n }\n assert(false);\n return value;\n}\n\n@inline\nexport function bswap16(value: T): T {\n if (isInteger() && sizeof() <= 4) {\n if (sizeof() == 2) {\n return ((value << 8) | ((value >> 8) & 0x00FF));\n } else if (sizeof() == 4) {\n return (((value << 8) & 0xFF00) | ((value >> 8) & 0x00FF) | (value & 0xFFFF0000));\n }\n return value;\n }\n assert(false);\n return value;\n}\n",regexp:'export class RegExp {\n\n // @binding(CALL_NEW, [ STRING, STRING], OBJECT_HANDLE)\n constructor(pattern: string, flags: string = "") { throw new Error("unreachable"); }\n\n // @binding(CALL_THIS, [ STRING ], PASS_THRU)\n test(search: string): bool { throw new Error("unreachable"); }\n\n // @binding(CALL_THIS, [], STRING)\n toString(): string { throw new Error("unreachable"); }\n\n}\n',set:'import {\n HEADER_SIZE as HEADER_SIZE_AB\n} from "./internal/arraybuffer";\n\nimport {\n HASH\n} from "./internal/hash";\n\n// A deterministic hash set based on CloseTable from https://github.com/jorendorff/dht\n\n@inline const INITIAL_CAPACITY = 4;\n@inline const FILL_FACTOR: f64 = 8 / 3;\n@inline const FREE_FACTOR: f64 = 3 / 4;\n\n/** Structure of a set entry. */\n@unmanaged class SetEntry {\n key: K;\n taggedNext: usize; // LSB=1 indicates EMPTY\n}\n\n/** Empty bit. */\n@inline const EMPTY: usize = 1 << 0;\n\n/** Size of a bucket. */\n@inline const BUCKET_SIZE = sizeof();\n\n/** Computes the alignment of an entry. */\n@inline function ENTRY_ALIGN(): usize {\n // can align to 4 instead of 8 if 32-bit and K is <= 32-bits\n const align = (sizeof() > sizeof() ? sizeof() : sizeof()) - 1;\n return align;\n}\n\n/** Computes the aligned size of an entry. */\n@inline function ENTRY_SIZE(): usize {\n const align = ENTRY_ALIGN();\n const size = (offsetof>() + align) & ~align;\n return size;\n}\n\nexport class Set {\n\n // buckets holding references to the respective first entry within\n private buckets: ArrayBuffer; // usize[bucketsMask + 1]\n private bucketsMask: u32;\n\n // entries in insertion order\n private entries: ArrayBuffer; // SetEntry[entriesCapacity]\n private entriesCapacity: i32;\n private entriesOffset: i32;\n private entriesCount: i32;\n\n get size(): i32 { return this.entriesCount; }\n\n constructor() { this.clear(); }\n\n clear(): void {\n const bucketsSize = INITIAL_CAPACITY * BUCKET_SIZE;\n this.buckets = new ArrayBuffer(bucketsSize);\n this.bucketsMask = INITIAL_CAPACITY - 1;\n const entriesSize = INITIAL_CAPACITY * ENTRY_SIZE();\n this.entries = new ArrayBuffer(entriesSize, true);\n this.entriesCapacity = INITIAL_CAPACITY;\n this.entriesOffset = 0;\n this.entriesCount = 0;\n }\n\n private find(key: K, hashCode: u32): SetEntry | null {\n var entry = load>(\n changetype(this.buckets) + (hashCode & this.bucketsMask) * BUCKET_SIZE,\n HEADER_SIZE_AB\n );\n while (entry) {\n if (!(entry.taggedNext & EMPTY) && entry.key == key) return entry;\n entry = changetype>(entry.taggedNext & ~EMPTY);\n }\n return null;\n }\n\n has(key: K): bool {\n return this.find(key, HASH(key)) !== null;\n }\n\n add(key: K): void {\n var hashCode = HASH(key);\n var entry = this.find(key, hashCode);\n if (!entry) {\n // check if rehashing is necessary\n if (this.entriesOffset == this.entriesCapacity) {\n this.rehash(\n this.entriesCount < (this.entriesCapacity * FREE_FACTOR)\n ? this.bucketsMask // just rehash if 1/4+ entries are empty\n : (this.bucketsMask << 1) | 1 // grow capacity to next 2^N\n );\n }\n // append new entry\n let entries = this.entries;\n entry = changetype>(\n changetype(entries) + HEADER_SIZE_AB + this.entriesOffset++ * ENTRY_SIZE()\n );\n entry.key = key;\n ++this.entriesCount;\n // link with previous entry in bucket\n let bucketPtrBase = changetype(this.buckets) + (hashCode & this.bucketsMask) * BUCKET_SIZE;\n entry.taggedNext = load(bucketPtrBase, HEADER_SIZE_AB);\n store(bucketPtrBase, changetype(entry), HEADER_SIZE_AB);\n if (isManaged()) __gc_link(changetype(this), changetype(key)); // tslint:disable-line\n }\n }\n\n delete(key: K): bool {\n var entry = this.find(key, HASH(key));\n if (!entry) return false;\n entry.taggedNext |= EMPTY;\n --this.entriesCount;\n // check if rehashing is appropriate\n var halfBucketsMask = this.bucketsMask >> 1;\n if (\n halfBucketsMask + 1 >= max(INITIAL_CAPACITY, this.entriesCount) &&\n this.entriesCount < (this.entriesCapacity * FREE_FACTOR)\n ) this.rehash(halfBucketsMask);\n return true;\n }\n\n private rehash(newBucketsMask: u32): void {\n var newBucketsCapacity = (newBucketsMask + 1);\n var newBuckets = new ArrayBuffer(newBucketsCapacity * BUCKET_SIZE);\n var newEntriesCapacity = (newBucketsCapacity * FILL_FACTOR);\n var newEntries = new ArrayBuffer(newEntriesCapacity * ENTRY_SIZE(), true);\n\n // copy old entries to new entries\n var oldPtr = changetype(this.entries) + HEADER_SIZE_AB;\n var oldEnd = oldPtr + this.entriesOffset * ENTRY_SIZE();\n var newPtr = changetype(newEntries) + HEADER_SIZE_AB;\n while (oldPtr != oldEnd) {\n let oldEntry = changetype>(oldPtr);\n if (!(oldEntry.taggedNext & EMPTY)) {\n let newEntry = changetype>(newPtr);\n newEntry.key = oldEntry.key;\n let newBucketIndex = HASH(oldEntry.key) & newBucketsMask;\n let newBucketPtrBase = changetype(newBuckets) + newBucketIndex * BUCKET_SIZE;\n newEntry.taggedNext = load(newBucketPtrBase, HEADER_SIZE_AB);\n store(newBucketPtrBase, newPtr, HEADER_SIZE_AB);\n newPtr += ENTRY_SIZE();\n }\n oldPtr += ENTRY_SIZE();\n }\n\n this.buckets = newBuckets;\n this.bucketsMask = newBucketsMask;\n this.entries = newEntries;\n this.entriesCapacity = newEntriesCapacity;\n this.entriesOffset = this.entriesCount;\n }\n\n toString(): string {\n return "[object Set]";\n }\n\n private __gc(): void {\n __gc_mark(changetype(this.buckets)); // tslint:disable-line\n var entries = this.entries;\n __gc_mark(changetype(entries)); // tslint:disable-line\n if (isManaged()) {\n let offset: usize = 0;\n let end: usize = this.entriesOffset * ENTRY_SIZE();\n while (offset < end) {\n let entry = changetype>(\n changetype(entries) + HEADER_SIZE_AB + offset * ENTRY_SIZE()\n );\n if (!(entry.taggedNext & EMPTY)) __gc_mark(changetype(entry.key)); // tslint:disable-line\n offset += ENTRY_SIZE();\n }\n }\n }\n}\n',string:'import {\n HEADER_SIZE,\n MAX_LENGTH,\n allocateUnsafe,\n compareUnsafe,\n repeatUnsafe,\n copyUnsafe,\n isWhiteSpaceOrLineTerminator,\n CharCode,\n parse\n} from "./internal/string";\n\nimport {\n STORE\n} from "./internal/arraybuffer";\n\n@sealed\nexport class String {\n\n readonly length: i32; // capped to [0, MAX_LENGTH]\n\n // TODO Add and handle second argument\n static fromCharCode(code: i32): String {\n var out = allocateUnsafe(1);\n store(\n changetype(out),\n code,\n HEADER_SIZE\n );\n return out;\n }\n\n static fromCodePoint(code: i32): String {\n assert(code <= 0x10FFFF);\n var sur = code > 0xFFFF;\n var out = allocateUnsafe(sur + 1);\n if (!sur) {\n store(\n changetype(out),\n code,\n HEADER_SIZE\n );\n } else {\n code -= 0x10000;\n let hi: u32 = (code >>> 10) + 0xD800;\n let lo: u32 = (code & 0x3FF) + 0xDC00;\n store(\n changetype(out),\n (hi << 16) | lo,\n HEADER_SIZE\n );\n }\n return out;\n }\n\n @operator("[]")\n charAt(pos: i32): String {\n assert(this !== null);\n\n if (pos >= this.length) return changetype("");\n\n var out = allocateUnsafe(1);\n store(\n changetype(out),\n load(\n changetype(this) + (pos << 1),\n HEADER_SIZE\n ),\n HEADER_SIZE\n );\n return out;\n }\n\n charCodeAt(pos: i32): i32 {\n assert(this !== null);\n if (pos >= this.length) return -1; // (NaN)\n\n return load(\n changetype(this) + (pos << 1),\n HEADER_SIZE\n );\n }\n\n codePointAt(pos: i32): i32 {\n assert(this !== null);\n if (pos >= this.length) return -1; // (undefined)\n\n var first = load(\n changetype(this) + (pos << 1),\n HEADER_SIZE\n );\n if (first < 0xD800 || first > 0xDBFF || pos + 1 == this.length) {\n return first;\n }\n var second = load(\n changetype(this) + ((pos + 1) << 1),\n HEADER_SIZE\n );\n if (second < 0xDC00 || second > 0xDFFF) return first;\n return ((first - 0xD800) << 10) + (second - 0xDC00) + 0x10000;\n }\n\n @operator("+")\n private static __concat(left: String, right: String): String {\n if (!changetype(left)) left = changetype("null");\n return left.concat(right);\n }\n\n concat(other: String): String {\n assert(this !== null);\n if (other === null) other = changetype("null");\n\n var thisLen: isize = this.length;\n var otherLen: isize = other.length;\n var outLen: usize = thisLen + otherLen;\n if (outLen == 0) return changetype("");\n var out = allocateUnsafe(outLen);\n copyUnsafe(out, 0, this, 0, thisLen);\n copyUnsafe(out, thisLen, other, 0, otherLen);\n return out;\n }\n\n endsWith(searchString: String, endPosition: i32 = MAX_LENGTH): bool {\n assert(this !== null);\n if (searchString === null) return false;\n var end = min(max(endPosition, 0), this.length);\n var searchLength: isize = searchString.length;\n var start: isize = end - searchLength;\n if (start < 0) return false;\n return !compareUnsafe(this, start, searchString, 0, searchLength);\n }\n\n @operator("==")\n private static __eq(left: String, right: String): bool {\n if (left === right) return true;\n if (left === null || right === null) return false;\n\n var leftLength = left.length;\n if (leftLength != right.length) return false;\n\n return !compareUnsafe(left, 0, right, 0, leftLength);\n }\n\n @operator.prefix("!")\n private static __not(str: String): bool {\n return str === null || !str.length;\n }\n\n @operator("!=")\n private static __ne(left: String, right: String): bool {\n return !this.__eq(left, right);\n }\n\n @operator(">")\n private static __gt(left: String, right: String): bool {\n if (left === right || left === null || right === null) return false;\n\n var leftLength = left.length;\n var rightLength = right.length;\n\n if (!leftLength) return false;\n if (!rightLength) return true;\n\n var length = min(leftLength, rightLength);\n return compareUnsafe(left, 0, right, 0, length) > 0;\n }\n\n @operator(">=")\n private static __gte(left: String, right: String): bool {\n return !this.__lt(left, right);\n }\n\n @operator("<")\n private static __lt(left: String, right: String): bool {\n if (left === right || left === null || right === null) return false;\n\n var leftLength = left.length;\n var rightLength = right.length;\n\n if (!rightLength) return false;\n if (!leftLength) return true;\n\n var length = min(leftLength, rightLength);\n return compareUnsafe(left, 0, right, 0, length) < 0;\n }\n\n @operator("<=")\n private static __lte(left: String, right: String): bool {\n return !this.__gt(left, right);\n }\n\n @inline\n includes(searchString: String, position: i32 = 0): bool {\n return this.indexOf(searchString, position) != -1;\n }\n\n indexOf(searchString: String, fromIndex: i32 = 0): i32 {\n assert(this !== null);\n if (searchString === null) searchString = changetype("null");\n\n var searchLen: isize = searchString.length;\n if (!searchLen) return 0;\n var len: isize = this.length;\n if (!len) return -1;\n var start = min(max(fromIndex, 0), len);\n len -= searchLen;\n for (let k: isize = start; k <= len; ++k) {\n if (!compareUnsafe(this, k, searchString, 0, searchLen)) return k;\n }\n return -1;\n }\n\n lastIndexOf(searchString: String, fromIndex: i32 = i32.MAX_VALUE): i32 {\n assert(this !== null);\n if (searchString === null) searchString = changetype("null");\n\n var len: isize = this.length;\n var searchLen: isize = searchString.length;\n if (!searchLen) return len;\n if (!len) return -1;\n var start = min(max(fromIndex, 0), len - searchLen);\n for (let k = start; k >= 0; --k) {\n if (!compareUnsafe(this, k, searchString, 0, searchLen)) return k;\n }\n return -1;\n }\n\n startsWith(searchString: String, position: i32 = 0): bool {\n assert(this !== null);\n if (searchString === null) searchString = changetype("null");\n\n var pos: isize = position;\n var len: isize = this.length;\n var start = min(max(pos, 0), len);\n var searchLength: isize = searchString.length;\n if (searchLength + start > len) return false;\n return !compareUnsafe(this, start, searchString, 0, searchLength);\n }\n\n substr(start: i32, length: i32 = i32.MAX_VALUE): String {\n assert(this !== null);\n var intStart: isize = start;\n var end: isize = length;\n var size: isize = this.length;\n if (intStart < 0) intStart = max(size + intStart, 0);\n var resultLength = min(max(end, 0), size - intStart);\n if (resultLength <= 0) return changetype("");\n var out = allocateUnsafe(resultLength);\n copyUnsafe(out, 0, this, intStart, resultLength);\n return out;\n }\n\n substring(start: i32, end: i32 = i32.MAX_VALUE): String {\n assert(this !== null);\n var len = this.length;\n var finalStart = min(max(start, 0), len);\n var finalEnd = min(max(end, 0), len);\n var from = min(finalStart, finalEnd);\n var to = max(finalStart, finalEnd);\n len = to - from;\n if (!len) return changetype("");\n if (!from && to == this.length) return this;\n var out = allocateUnsafe(len);\n copyUnsafe(out, 0, this, from, len);\n return out;\n }\n\n trim(): String {\n assert(this !== null);\n var length: usize = this.length;\n\n while (\n length &&\n isWhiteSpaceOrLineTerminator(\n load(changetype(this) + (length << 1), HEADER_SIZE)\n )\n ) {\n --length;\n }\n var start: usize = 0;\n while (\n start < length &&\n isWhiteSpaceOrLineTerminator(\n load(changetype(this) + (start << 1), HEADER_SIZE)\n )\n ) {\n ++start, --length;\n }\n if (!length) return changetype("");\n if (!start && length == this.length) return this;\n var out = allocateUnsafe(length);\n copyUnsafe(out, 0, this, start, length);\n return out;\n }\n\n @inline\n trimLeft(): String {\n return this.trimStart();\n }\n\n @inline\n trimRight(): String {\n return this.trimEnd();\n }\n\n trimStart(): String {\n assert(this !== null);\n var start: isize = 0;\n var len: isize = this.length;\n while (\n start < len &&\n isWhiteSpaceOrLineTerminator(\n load(changetype(this) + (start << 1), HEADER_SIZE)\n )\n ) {\n ++start;\n }\n if (!start) return this;\n var outLen = len - start;\n if (!outLen) return changetype("");\n var out = allocateUnsafe(outLen);\n copyUnsafe(out, 0, this, start, outLen);\n return out;\n }\n\n trimEnd(): String {\n assert(this !== null);\n var len: isize = this.length;\n while (\n len > 0 &&\n isWhiteSpaceOrLineTerminator(\n load(changetype(this) + (len << 1), HEADER_SIZE)\n )\n ) {\n --len;\n }\n if (len <= 0) return changetype("");\n if (len == this.length) return this;\n var out = allocateUnsafe(len);\n copyUnsafe(out, 0, this, 0, len);\n return out;\n }\n\n padStart(targetLength: i32, padString: String = changetype(" ")): String {\n assert(this !== null);\n var length = this.length;\n var padLen = padString.length;\n if (targetLength < length || !padLen) return this;\n var len = targetLength - length;\n var out = allocateUnsafe(targetLength);\n if (len > padLen) {\n let count = (len - 1) / padLen;\n let base = count * padLen;\n let rest = len - base;\n repeatUnsafe(out, 0, padString, count);\n if (rest) copyUnsafe(out, base, padString, 0, rest);\n } else {\n copyUnsafe(out, 0, padString, 0, len);\n }\n if (length) copyUnsafe(out, len, this, 0, length);\n return out;\n }\n\n padEnd(targetLength: i32, padString: String = changetype(" ")): String {\n assert(this !== null);\n var length = this.length;\n var padLen = padString.length;\n if (targetLength < length || !padLen) return this;\n var len = targetLength - length;\n var out = allocateUnsafe(targetLength);\n if (length) copyUnsafe(out, 0, this, 0, length);\n if (len > padLen) {\n let count = (len - 1) / padLen;\n let base = count * padLen;\n let rest = len - base;\n repeatUnsafe(out, length, padString, count);\n if (rest) copyUnsafe(out, base + length, padString, 0, rest);\n } else {\n copyUnsafe(out, length, padString, 0, len);\n }\n return out;\n }\n\n repeat(count: i32 = 0): String {\n assert(this !== null);\n var length = this.length;\n\n // Most browsers can\'t handle strings 1 << 28 chars or longer\n if (count < 0 || length * count > (1 << 28)) {\n throw new RangeError("Invalid count value");\n }\n\n if (count == 0 || !length) return changetype("");\n if (count == 1) return this;\n\n var result = allocateUnsafe(length * count);\n repeatUnsafe(result, 0, this, count);\n return result;\n }\n\n slice(beginIndex: i32, endIndex: i32 = i32.MAX_VALUE): String {\n var len = this.length;\n var begin = beginIndex < 0 ? max(beginIndex + len, 0) : min(beginIndex, len);\n var end = endIndex < 0 ? max(endIndex + len, 0) : min(endIndex, len);\n len = end - begin;\n if (len <= 0) return changetype("");\n var out = allocateUnsafe(len);\n copyUnsafe(out, 0, this, begin, len);\n return out;\n }\n\n split(separator: String = null, limit: i32 = i32.MAX_VALUE): String[] {\n assert(this !== null);\n if (!limit) return new Array();\n if (separator === null) return [this];\n var length: isize = this.length;\n var sepLen: isize = separator.length;\n if (limit < 0) limit = i32.MAX_VALUE;\n if (!sepLen) {\n if (!length) return new Array();\n // split by chars\n length = min(length, limit);\n let result = new Array(length);\n let buffer = result.buffer_;\n for (let i: isize = 0; i < length; ++i) {\n let char = allocateUnsafe(1);\n store(\n changetype(char),\n load(\n changetype(this) + (i << 1),\n HEADER_SIZE\n ),\n HEADER_SIZE\n );\n STORE(buffer, i, char);\n }\n return result;\n } else if (!length) {\n let result = new Array(1);\n unchecked(result[0] = changetype(""));\n return result;\n }\n var result = new Array();\n var end = 0, start = 0, i = 0;\n while ((end = this.indexOf(separator, start)) != -1) {\n let len = end - start;\n if (len > 0) {\n let out = allocateUnsafe(len);\n copyUnsafe(out, 0, this, start, len);\n result.push(out);\n } else {\n result.push(changetype(""));\n }\n if (++i == limit) return result;\n start = end + sepLen;\n }\n if (!start) {\n let result = new Array(1);\n unchecked(result[0] = this);\n return result;\n }\n var len = length - start;\n if (len > 0) {\n let out = allocateUnsafe(len);\n copyUnsafe(out, 0, this, start, len);\n result.push(out);\n } else {\n result.push(changetype(""));\n }\n return result;\n }\n\n toString(): String {\n return this;\n }\n\n get lengthUTF8(): i32 {\n var len = 1; // null terminated\n var pos: usize = 0;\n var end = this.length;\n while (pos < end) {\n let c = load(changetype(this) + (pos << 1), HEADER_SIZE);\n if (c < 128) {\n len += 1; ++pos;\n } else if (c < 2048) {\n len += 2; ++pos;\n } else {\n if (\n (c & 0xFC00) == 0xD800 && pos + 1 < end &&\n (load(changetype(this) + ((pos + 1) << 1), HEADER_SIZE) & 0xFC00) == 0xDC00\n ) {\n len += 4; pos += 2;\n } else {\n len += 3; ++pos;\n }\n }\n }\n return len;\n }\n\n static fromUTF8(ptr: usize, len: usize): String {\n if (len < 1) return changetype("");\n var ptrPos = 0;\n var buf = memory.allocate(len << 1);\n var bufPos = 0;\n while (ptrPos < len) {\n let cp = load(ptr + ptrPos++);\n if (cp < 128) {\n store(buf + bufPos, cp);\n bufPos += 2;\n } else if (cp > 191 && cp < 224) {\n assert(ptrPos + 1 <= len);\n store(buf + bufPos, (cp & 31) << 6 | load(ptr + ptrPos++) & 63);\n bufPos += 2;\n } else if (cp > 239 && cp < 365) {\n assert(ptrPos + 3 <= len);\n cp = (\n (cp & 7) << 18 |\n (load(ptr + ptrPos++) & 63) << 12 |\n (load(ptr + ptrPos++) & 63) << 6 |\n load(ptr + ptrPos++) & 63\n ) - 0x10000;\n store(buf + bufPos, 0xD800 + (cp >> 10));\n bufPos += 2;\n store(buf + bufPos, 0xDC00 + (cp & 1023));\n bufPos += 2;\n } else {\n assert(ptrPos + 2 <= len);\n store(buf + bufPos,\n (cp & 15) << 12 |\n (load(ptr + ptrPos++) & 63) << 6 |\n load(ptr + ptrPos++) & 63\n );\n bufPos += 2;\n }\n }\n assert(ptrPos == len);\n var str = allocateUnsafe((bufPos >> 1));\n memory.copy(changetype(str) + HEADER_SIZE, buf, bufPos);\n memory.free(buf);\n return str;\n }\n\n toUTF8(): usize {\n var buf = memory.allocate(this.lengthUTF8);\n var pos: usize = 0;\n var end = this.length;\n var off: usize = 0;\n while (pos < end) {\n let c1 = load(changetype(this) + (pos << 1), HEADER_SIZE);\n if (c1 < 128) {\n store(buf + off, c1);\n ++off; ++pos;\n } else if (c1 < 2048) {\n let ptr = buf + off;\n store(ptr, c1 >> 6 | 192);\n store(ptr, c1 & 63 | 128, 1);\n off += 2; ++pos;\n } else {\n let ptr = buf + off;\n if ((c1 & 0xFC00) == 0xD800 && pos + 1 < end) {\n let c2 = load(changetype(this) + ((pos + 1) << 1), HEADER_SIZE);\n if ((c2 & 0xFC00) == 0xDC00) {\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\n store(ptr, c1 >> 18 | 240);\n store(ptr, c1 >> 12 & 63 | 128, 1);\n store(ptr, c1 >> 6 & 63 | 128, 2);\n store(ptr, c1 & 63 | 128, 3);\n off += 4; pos += 2;\n continue;\n }\n }\n store(ptr, c1 >> 12 | 224);\n store(ptr, c1 >> 6 & 63 | 128, 1);\n store(ptr, c1 & 63 | 128, 2);\n off += 3; ++pos;\n }\n }\n store(buf + off, 0);\n return buf;\n }\n}\n\nexport type string = String;\n\nexport function parseInt(str: String, radix: i32 = 0): f64 {\n return parse(str, radix);\n}\n\nexport function parseI32(str: String, radix: i32 = 0): i32 {\n return parse(str, radix);\n}\n\nexport function parseI64(str: String, radix: i32 = 0): i64 {\n return parse(str, radix);\n}\n\n// FIXME: naive implementation\nexport function parseFloat(str: String): f64 {\n var len: i32 = str.length;\n if (!len) return NaN;\n\n var ptr = changetype(str) /* + HEAD -> offset */;\n var code = load(ptr, HEADER_SIZE);\n\n // determine sign\n var sign: f64;\n if (code == CharCode.MINUS) {\n if (!--len) return NaN;\n code = load(ptr += 2, HEADER_SIZE);\n sign = -1;\n } else if (code == CharCode.PLUS) {\n if (!--len) return NaN;\n code = load(ptr += 2, HEADER_SIZE);\n sign = 1;\n } else {\n sign = 1;\n }\n\n // calculate value\n var num: f64 = 0;\n while (len--) {\n code = load(ptr, HEADER_SIZE);\n if (code == CharCode.DOT) {\n ptr += 2;\n let fac: f64 = 0.1; // precision :(\n while (len--) {\n code = load(ptr, HEADER_SIZE);\n if (code == CharCode.E || code == CharCode.e) {\n assert(false); // TODO\n }\n code -= CharCode._0;\n if (code > 9) break;\n num += code * fac;\n fac *= 0.1;\n ptr += 2;\n }\n break;\n }\n code -= CharCode._0;\n if (code >= 10) break;\n num = (num * 10) + code;\n ptr += 2;\n }\n return sign * num;\n}\n',symbol:'import { Map } from "./map";\n\n@lazy var stringToId: Map;\n@lazy var idToString: Map;\n@lazy var nextId: usize = 12; // Symbol.unscopables + 1\n\n@unmanaged export class symbol {\n toString(): string {\n var id = changetype(this);\n var str = "";\n switch (id) {\n case 1: { str = "hasInstance"; break; }\n case 2: { str = "isConcatSpreadable"; break; }\n case 3: { str = "isRegExp"; break; }\n case 4: { str = "match"; break; }\n case 5: { str = "replace"; break; }\n case 6: { str = "search"; break; }\n case 7: { str = "species"; break; }\n case 8: { str = "split"; break; }\n case 9: { str = "toPrimitive"; break; }\n case 10: { str = "toStringTag"; break; }\n case 11: { str = "unscopables"; break; }\n default: {\n if (idToString !== null && idToString.has(id)) str = idToString.get(id);\n break;\n }\n }\n return "Symbol(" + str + ")";\n }\n}\n\nexport function Symbol(description: string | null = null): symbol {\n var id = nextId++;\n if (!id) unreachable(); // out of ids\n return changetype(id);\n}\n\nexport namespace Symbol {\n\n // well-known symbols\n @lazy export const hasInstance = changetype(1);\n @lazy export const isConcatSpreadable = changetype(2);\n @lazy export const isRegExp = changetype(3);\n @lazy export const iterator = changetype(3);\n @lazy export const match = changetype(4);\n @lazy export const replace = changetype(5);\n @lazy export const search = changetype(6);\n @lazy export const species = changetype(7);\n @lazy export const split = changetype(8);\n @lazy export const toPrimitive = changetype(9);\n @lazy export const toStringTag = changetype(10);\n @lazy export const unscopables = changetype(11);\n\n /* tslint:disable */// not valid TS\n export function for(key: string): symbol {\n if (!stringToId) { stringToId = new Map(); idToString = new Map(); }\n else if (stringToId.has(key)) return changetype(stringToId.get(key));\n var id = nextId++;\n if (!id) unreachable(); // out of ids\n stringToId.set(key, id);\n idToString.set(id, key);\n return changetype(id);\n }\n /* tslint:enable */\n\n export function keyFor(sym: symbol): string | null {\n return idToString !== null && idToString.has(changetype(sym))\n ? idToString.get(changetype(sym))\n : null;\n }\n}\n',table:"export namespace table {\n\n // export function copy(dst: u32, src: u32, n: u32): void {\n // __table_copy(dst, src, n);\n // }\n\n // Passive elements\n\n // export function init(elementIndex: u32, srcOffset: u32, dstOffset: u32, n: u32): void {\n // __table_init(elementIndex, srcOffset, dstOffset, n);\n // }\n\n // export function drop(elementIndex: u32): void {\n // __table_drop(elementIndex);\n // }\n}\n",typedarray:"import {\n TypedArray,\n FILL,\n SORT,\n SUBARRAY,\n REDUCE,\n REDUCE_RIGHT,\n MAP,\n FIND_INDEX,\n SOME,\n EVERY,\n FOREACH,\n REVERSE,\n} from \"./internal/typedarray\";\n\nimport {\n COMPARATOR\n} from \"./internal/sort\";\n\nfunction clampToByte(value: i32): i32 {\n return ~(value >> 31) & (((255 - value) >> 31) | value); // & 255\n}\n\nexport class Int8Array extends TypedArray {\n @lazy static readonly BYTES_PER_ELEMENT: usize = sizeof();\n\n fill(value: i32, start: i32 = 0, end: i32 = i32.MAX_VALUE): Int8Array {\n return FILL(this, value, start, end);\n }\n\n sort(comparator: (a: i8, b: i8) => i32 = COMPARATOR()): Int8Array {\n return SORT(this, comparator);\n }\n\n subarray(begin: i32 = 0, end: i32 = 0x7fffffff): Int8Array {\n return SUBARRAY(this, begin, end);\n }\n\n reduce(\n callbackfn: (accumulator: T, value: i8, index: i32, array: Int8Array) => T,\n initialValue: T,\n ): T {\n return REDUCE(this, callbackfn, initialValue);\n }\n\n reduceRight(\n callbackfn: (accumulator: T, value: i8, index: i32, array: Int8Array) => T,\n initialValue: T,\n ): T {\n return REDUCE_RIGHT(this, callbackfn, initialValue);\n }\n\n map(callbackfn: (value: i8, index: i32, self: Int8Array) => i8): Int8Array {\n return MAP(this, callbackfn);\n }\n\n findIndex(callbackfn: (value: i8, index: i32, self: Int8Array) => bool): i32 {\n return FIND_INDEX(this, callbackfn);\n }\n\n some(callbackfn: (value: i8, index: i32, self: Int8Array) => bool): bool {\n return SOME(this, callbackfn);\n }\n\n every(callbackfn: (value: i8, index: i32, self: Int8Array) => bool): bool {\n return EVERY(this, callbackfn);\n }\n\n forEach(callbackfn: (value: i8, index: i32, self: Int8Array) => void): void {\n FOREACH(this, callbackfn);\n }\n\n reverse(): this {\n return REVERSE(this);\n }\n}\n\nexport class Uint8Array extends TypedArray {\n @lazy static readonly BYTES_PER_ELEMENT: usize = sizeof();\n\n fill(value: u32, start: i32 = 0, end: i32 = i32.MAX_VALUE): Uint8Array {\n return FILL(this, value, start, end);\n }\n\n sort(comparator: (a: u8, b: u8) => i32 = COMPARATOR()): Uint8Array {\n return SORT(this, comparator);\n }\n\n subarray(begin: i32 = 0, end: i32 = 0x7fffffff): Uint8Array {\n return SUBARRAY(this, begin, end);\n }\n\n reduce(\n callbackfn: (accumulator: T, value: u8, index: i32, array: Uint8Array) => T,\n initialValue: T,\n ): T {\n return REDUCE(this, callbackfn, initialValue);\n }\n\n reduceRight(\n callbackfn: (accumulator: T, value: u8, index: i32, array: Uint8Array) => T,\n initialValue: T,\n ): T {\n return REDUCE_RIGHT(this, callbackfn, initialValue);\n }\n\n map(callbackfn: (value: u8, index: i32, self: Uint8Array) => u8): Uint8Array {\n return MAP(this, callbackfn);\n }\n\n findIndex(callbackfn: (value: u8, index: i32, self: Uint8Array) => bool): i32 {\n return FIND_INDEX(this, callbackfn);\n }\n\n some(callbackfn: (value: u8, index: i32, self: Uint8Array) => bool): bool {\n return SOME(this, callbackfn);\n }\n\n every(callbackfn: (value: u8, index: i32, self: Uint8Array) => bool): bool {\n return EVERY(this, callbackfn);\n }\n\n forEach(callbackfn: (value: u8, index: i32, self: Uint8Array) => void): void {\n FOREACH(this, callbackfn);\n }\n\n reverse(): this {\n return REVERSE(this);\n }\n}\n\nexport class Uint8ClampedArray extends Uint8Array {\n @lazy static readonly BYTES_PER_ELEMENT: usize = sizeof();\n\n @inline @operator(\"[]=\")\n protected __set(index: i32, value: i32): void {\n super.__set(index, clampToByte(value));\n }\n\n @inline @operator(\"{}=\")\n protected __unchecked_set(index: i32, value: i32): void {\n super.__unchecked_set(index, clampToByte(value));\n }\n\n fill(value: u32, start: i32 = 0, end: i32 = i32.MAX_VALUE): Uint8ClampedArray {\n return changetype(super.fill(value, start, end)); // safe because '.fill' reuses 'this'\n }\n\n sort(comparator: (a: u8, b: u8) => i32 = COMPARATOR()): Uint8ClampedArray {\n return changetype(super.sort(comparator)); // safe because '.sort' reuses 'this'\n }\n\n subarray(begin: i32 = 0, end: i32 = 0x7fffffff): Uint8ClampedArray {\n return SUBARRAY(this, begin, end);\n }\n\n reduce(\n callbackfn: (accumulator: T, value: u8, index: i32, array: Uint8ClampedArray) => T,\n initialValue: T,\n ): T {\n return REDUCE(this, callbackfn, initialValue);\n }\n\n reduceRight(\n callbackfn: (accumulator: T, value: u8, index: i32, array: Uint8ClampedArray) => T,\n initialValue: T,\n ): T {\n return REDUCE_RIGHT(this, callbackfn, initialValue);\n }\n\n map(callbackfn: (value: u8, index: i32, self: Uint8ClampedArray) => u8): Uint8ClampedArray {\n return MAP(this, callbackfn);\n }\n\n findIndex(callbackfn: (value: u8, index: i32, self: Uint8ClampedArray) => bool): i32 {\n return FIND_INDEX(this, callbackfn);\n }\n\n some(callbackfn: (value: u8, index: i32, self: Uint8ClampedArray) => bool): bool {\n return SOME(this, callbackfn);\n }\n\n every(callbackfn: (value: u8, index: i32, self: Uint8ClampedArray) => bool): bool {\n return EVERY(this, callbackfn);\n }\n\n forEach(callbackfn: (value: u8, index: i32, self: Uint8ClampedArray) => void): void {\n FOREACH(this, callbackfn);\n }\n\n reverse(): this {\n return REVERSE(this);\n }\n}\n\nexport class Int16Array extends TypedArray {\n @lazy static readonly BYTES_PER_ELEMENT: usize = sizeof();\n\n fill(value: i32, start: i32 = 0, end: i32 = i32.MAX_VALUE): Int16Array {\n return FILL(this, value, start, end);\n }\n\n sort(comparator: (a: i16, b: i16) => i32 = COMPARATOR()): Int16Array {\n return SORT(this, comparator);\n }\n\n subarray(begin: i32 = 0, end: i32 = 0x7fffffff): Int16Array {\n return SUBARRAY(this, begin, end);\n }\n\n reduce(\n callbackfn: (accumulator: T, value: i16, index: i32, array: Int16Array) => T,\n initialValue: T,\n ): T {\n return REDUCE(this, callbackfn, initialValue);\n }\n\n reduceRight(\n callbackfn: (accumulator: T, value: i16, index: i32, array: Int16Array) => T,\n initialValue: T,\n ): T {\n return REDUCE_RIGHT(this, callbackfn, initialValue);\n }\n\n map(callbackfn: (value: i16, index: i32, self: Int16Array) => i16): Int16Array {\n return MAP(this, callbackfn);\n }\n\n findIndex(callbackfn: (value: i16, index: i32, self: Int16Array) => bool): i32 {\n return FIND_INDEX(this, callbackfn);\n }\n\n some(callbackfn: (value: i16, index: i32, self: Int16Array) => bool): bool {\n return SOME(this, callbackfn);\n }\n\n every(callbackfn: (value: i16, index: i32, self: Int16Array) => bool): bool {\n return EVERY(this, callbackfn);\n }\n\n forEach(callbackfn: (value: i16, index: i32, self: Int16Array) => void): void {\n FOREACH(this, callbackfn);\n }\n\n reverse(): this {\n return REVERSE(this);\n }\n}\n\nexport class Uint16Array extends TypedArray {\n @lazy static readonly BYTES_PER_ELEMENT: usize = sizeof();\n\n fill(value: u32, start: i32 = 0, end: i32 = i32.MAX_VALUE): Uint16Array {\n return FILL(this, value, start, end);\n }\n\n sort(comparator: (a: u16, b: u16) => i32 = COMPARATOR()): Uint16Array {\n return SORT(this, comparator);\n }\n\n subarray(begin: i32 = 0, end: i32 = 0x7fffffff): Uint16Array {\n return SUBARRAY(this, begin, end);\n }\n\n reduce(\n callbackfn: (accumulator: T, value: u16, index: i32, array: Uint16Array) => T,\n initialValue: T,\n ): T {\n return REDUCE(this, callbackfn, initialValue);\n }\n\n reduceRight(\n callbackfn: (accumulator: T, value: u16, index: i32, array: Uint16Array) => T,\n initialValue: T,\n ): T {\n return REDUCE_RIGHT(this, callbackfn, initialValue);\n }\n\n map(callbackfn: (value: u16, index: i32, self: Uint16Array) => u16): Uint16Array {\n return MAP(this, callbackfn);\n }\n\n findIndex(callbackfn: (value: u16, index: i32, self: Uint16Array) => bool): i32 {\n return FIND_INDEX(this, callbackfn);\n }\n\n some(callbackfn: (value: u16, index: i32, self: Uint16Array) => bool): bool {\n return SOME(this, callbackfn);\n }\n\n every(callbackfn: (value: u16, index: i32, self: Uint16Array) => bool): bool {\n return EVERY(this, callbackfn);\n }\n\n forEach(callbackfn: (value: u16, index: i32, self: Uint16Array) => void): void {\n FOREACH(this, callbackfn);\n }\n\n reverse(): this {\n return REVERSE(this);\n }\n}\n\nexport class Int32Array extends TypedArray {\n @lazy static readonly BYTES_PER_ELEMENT: usize = sizeof();\n\n fill(value: i32, start: i32 = 0, end: i32 = i32.MAX_VALUE): Int32Array {\n return FILL(this, value, start, end);\n }\n\n sort(comparator: (a: i32, b: i32) => i32 = COMPARATOR()): Int32Array {\n return SORT(this, comparator);\n }\n\n subarray(begin: i32 = 0, end: i32 = 0x7fffffff): Int32Array {\n return SUBARRAY(this, begin, end);\n }\n\n reduce(\n callbackfn: (accumulator: T, value: i32, index: i32, array: Int32Array) => T,\n initialValue: T,\n ): T {\n return REDUCE(this, callbackfn, initialValue);\n }\n\n reduceRight(\n callbackfn: (accumulator: T, value: i32, index: i32, array: Int32Array) => T,\n initialValue: T,\n ): T {\n return REDUCE_RIGHT(this, callbackfn, initialValue);\n }\n\n map(callbackfn: (value: i32, index: i32, self: Int32Array) => i32): Int32Array {\n return MAP(this, callbackfn);\n }\n\n findIndex(callbackfn: (value: i32, index: i32, self: Int32Array) => bool): i32 {\n return FIND_INDEX(this, callbackfn);\n }\n\n some(callbackfn: (value: i32, index: i32, self: Int32Array) => bool): bool {\n return SOME(this, callbackfn);\n }\n\n every(callbackfn: (value: i32, index: i32, self: Int32Array) => bool): bool {\n return EVERY(this, callbackfn);\n }\n\n forEach(callbackfn: (value: i32, index: i32, self: Int32Array) => void): void {\n FOREACH(this, callbackfn);\n }\n\n reverse(): this {\n return REVERSE(this);\n }\n}\n\nexport class Uint32Array extends TypedArray {\n @lazy static readonly BYTES_PER_ELEMENT: usize = sizeof();\n\n fill(value: u32, start: i32 = 0, end: i32 = i32.MAX_VALUE): Uint32Array {\n return FILL(this, value, start, end);\n }\n\n sort(comparator: (a: u32, b: u32) => i32 = COMPARATOR()): Uint32Array {\n return SORT(this, comparator);\n }\n\n subarray(begin: i32 = 0, end: i32 = 0x7fffffff): Uint32Array {\n return SUBARRAY(this, begin, end);\n }\n\n reduce(\n callbackfn: (accumulator: T, value: u32, index: i32, array: Uint32Array) => T,\n initialValue: T,\n ): T {\n return REDUCE(this, callbackfn, initialValue);\n }\n\n reduceRight(\n callbackfn: (accumulator: T, value: u32, index: i32, array: Uint32Array) => T,\n initialValue: T,\n ): T {\n return REDUCE_RIGHT(this, callbackfn, initialValue);\n }\n\n map(callbackfn: (value: u32, index: i32, self: Uint32Array) => u32): Uint32Array {\n return MAP(this, callbackfn);\n }\n\n findIndex(callbackfn: (value: u32, index: i32, self: Uint32Array) => bool): i32 {\n return FIND_INDEX(this, callbackfn);\n }\n\n some(callbackfn: (value: u32, index: i32, self: Uint32Array) => bool): bool {\n return SOME(this, callbackfn);\n }\n\n every(callbackfn: (value: u32, index: i32, self: Uint32Array) => bool): bool {\n return EVERY(this, callbackfn);\n }\n\n forEach(callbackfn: (value: u32, index: i32, self: Uint32Array) => void): void {\n FOREACH(this, callbackfn);\n }\n\n reverse(): this {\n return REVERSE(this);\n }\n}\n\nexport class Int64Array extends TypedArray {\n @lazy static readonly BYTES_PER_ELEMENT: usize = sizeof();\n\n fill(value: i64, start: i32 = 0, end: i32 = i32.MAX_VALUE): Int64Array {\n return FILL(this, value, start, end);\n }\n\n sort(comparator: (a: i64, b: i64) => i32 = COMPARATOR()): Int64Array {\n return SORT(this, comparator);\n }\n\n subarray(begin: i32 = 0, end: i32 = 0x7fffffff): Int64Array {\n return SUBARRAY(this, begin, end);\n }\n\n reduce(\n callbackfn: (accumulator: T, value: i64, index: i32, array: Int64Array) => T,\n initialValue: T,\n ): T {\n return REDUCE(this, callbackfn, initialValue);\n }\n\n reduceRight(\n callbackfn: (accumulator: T, value: i64, index: i32, array: Int64Array) => T,\n initialValue: T,\n ): T {\n return REDUCE_RIGHT(this, callbackfn, initialValue);\n }\n\n map(callbackfn: (value: i64, index: i32, self: Int64Array) => i64): Int64Array {\n return MAP(this, callbackfn);\n }\n\n findIndex(callbackfn: (value: i64, index: i32, self: Int64Array) => bool): i32 {\n return FIND_INDEX(this, callbackfn);\n }\n\n some(callbackfn: (value: i64, index: i32, self: Int64Array) => bool): bool {\n return SOME(this, callbackfn);\n }\n\n every(callbackfn: (value: i64, index: i32, self: Int64Array) => bool): bool {\n return EVERY(this, callbackfn);\n }\n\n forEach(callbackfn: (value: i64, index: i32, self: Int64Array) => void): void {\n FOREACH(this, callbackfn);\n }\n\n reverse(): this {\n return REVERSE(this);\n }\n}\n\nexport class Uint64Array extends TypedArray {\n @lazy static readonly BYTES_PER_ELEMENT: usize = sizeof();\n\n fill(value: u64, start: i32 = 0, end: i32 = i32.MAX_VALUE): Uint64Array {\n return FILL(this, value, start, end);\n }\n\n sort(comparator: (a: u64, b: u64) => i32 = COMPARATOR()): Uint64Array {\n return SORT(this, comparator);\n }\n\n subarray(begin: i32 = 0, end: i32 = 0x7fffffff): Uint64Array {\n return SUBARRAY(this, begin, end);\n }\n\n reduce(\n callbackfn: (accumulator: T, value: u64, index: i32, array: Uint64Array) => T,\n initialValue: T,\n ): T {\n return REDUCE(this, callbackfn, initialValue);\n }\n\n reduceRight(\n callbackfn: (accumulator: T, value: u64, index: i32, array: Uint64Array) => T,\n initialValue: T,\n ): T {\n return REDUCE_RIGHT(this, callbackfn, initialValue);\n }\n\n map(callbackfn: (value: u64, index: i32, self: Uint64Array) => u64): Uint64Array {\n return MAP(this, callbackfn);\n }\n\n findIndex(callbackfn: (value: u64, index: i32, self: Uint64Array) => bool): i32 {\n return FIND_INDEX(this, callbackfn);\n }\n\n some(callbackfn: (value: u64, index: i32, self: Uint64Array) => bool): bool {\n return SOME(this, callbackfn);\n }\n\n every(callbackfn: (value: u64, index: i32, self: Uint64Array) => bool): bool {\n return EVERY(this, callbackfn);\n }\n\n forEach(callbackfn: (value: u64, index: i32, self: Uint64Array) => void): void {\n FOREACH(this, callbackfn);\n }\n\n reverse(): this {\n return REVERSE(this);\n }\n}\n\nexport class Float32Array extends TypedArray {\n @lazy static readonly BYTES_PER_ELEMENT: usize = sizeof();\n\n fill(value: f32, start: i32 = 0, end: i32 = i32.MAX_VALUE): Float32Array {\n return FILL(this, value, start, end);\n }\n\n sort(comparator: (a: f32, b: f32) => i32 = COMPARATOR()): Float32Array {\n return SORT(this, comparator);\n }\n\n subarray(begin: i32 = 0, end: i32 = 0x7fffffff): Float32Array {\n return SUBARRAY(this, begin, end);\n }\n\n reduce(\n callbackfn: (accumulator: T, value: f32, index: i32, array: Float32Array) => T,\n initialValue: T,\n ): T {\n return REDUCE(this, callbackfn, initialValue);\n }\n\n reduceRight(\n callbackfn: (accumulator: T, value: f32, index: i32, array: Float32Array) => T,\n initialValue: T,\n ): T {\n return REDUCE_RIGHT(this, callbackfn, initialValue);\n }\n\n map(callbackfn: (value: f32, index: i32, self: Float32Array) => f32): Float32Array {\n return MAP(this, callbackfn);\n }\n\n findIndex(callbackfn: (value: f32, index: i32, self: Float32Array) => bool): i32 {\n return FIND_INDEX(this, callbackfn);\n }\n\n some(callbackfn: (value: f32, index: i32, self: Float32Array) => bool): bool {\n return SOME(this, callbackfn);\n }\n\n every(callbackfn: (value: f32, index: i32, self: Float32Array) => bool): bool {\n return EVERY(this, callbackfn);\n }\n\n forEach(callbackfn: (value: f32, index: i32, self: Float32Array) => void): void {\n FOREACH(this, callbackfn);\n }\n\n reverse(): this {\n return REVERSE(this);\n }\n}\n\nexport class Float64Array extends TypedArray {\n @lazy static readonly BYTES_PER_ELEMENT: usize = sizeof();\n\n fill(value: f64, start: i32 = 0, end: i32 = i32.MAX_VALUE): Float64Array {\n return FILL(this, value, start, end);\n }\n\n sort(comparator: (a: f64, b: f64) => i32 = COMPARATOR()): Float64Array {\n return SORT(this, comparator);\n }\n\n subarray(begin: i32 = 0, end: i32 = 0x7fffffff): Float64Array {\n return SUBARRAY(this, begin, end);\n }\n\n reduce(\n callbackfn: (accumulator: T, value: f64, index: i32, array: Float64Array) => T,\n initialValue: T,\n ): T {\n return REDUCE(this, callbackfn, initialValue);\n }\n\n reduceRight(\n callbackfn: (accumulator: T, value: f64, index: i32, array: Float64Array) => T,\n initialValue: T,\n ): T {\n return REDUCE_RIGHT(this, callbackfn, initialValue);\n }\n\n map(callbackfn: (value: f64, index: i32, self: Float64Array) => f64): Float64Array {\n return MAP(this, callbackfn);\n }\n\n findIndex(callbackfn: (value: f64, index: i32, self: Float64Array) => bool): i32 {\n return FIND_INDEX(this, callbackfn);\n }\n\n some(callbackfn: (value: f64, index: i32, self: Float64Array) => bool): bool {\n return SOME(this, callbackfn);\n }\n\n every(callbackfn: (value: f64, index: i32, self: Float64Array) => bool): bool {\n return EVERY(this, callbackfn);\n }\n\n forEach(callbackfn: (value: f64, index: i32, self: Float64Array) => void): void {\n FOREACH(this, callbackfn);\n }\n\n reverse(): this {\n return REVERSE(this);\n }\n}\n",vector:"@sealed\nexport abstract class V128 {\n}\n"}):(()=>{const e=path.join(".","..","std","assembly"),n=__webpack_require__(!function(){var e=new Error("Cannot find module 'glob'");throw e.code="MODULE_NOT_FOUND",e}()).sync("**/!(*.d).ts",{cwd:e}),t={};return n.forEach(n=>t[n.replace(/\.ts$/,"")]=fs.readFileSync(path.join(e,n),"utf8")),t})(),exports.definitionFiles=exports.isBundle?Object({assembly:'/**\n * Environment definitions for compiling AssemblyScript to WebAssembly using asc.\n * @module std/assembly\n *//***/\n\n/// \n\n// Types\n\n/** An 8-bit signed integer. */\ndeclare type i8 = number;\n/** A 16-bit signed integer. */\ndeclare type i16 = number;\n/** A 32-bit signed integer. */\ndeclare type i32 = number;\n/** A 64-bit signed integer. */\ndeclare type i64 = number;\n/** A 32-bit signed integer when targeting 32-bit WebAssembly or a 64-bit signed integer when targeting 64-bit WebAssembly. */\ndeclare type isize = number;\n/** An 8-bit unsigned integer. */\ndeclare type u8 = number;\n/** A 16-bit unsigned integer. */\ndeclare type u16 = number;\n/** A 32-bit unsigned integer. */\ndeclare type u32 = number;\n/** A 64-bit unsigned integer. */\ndeclare type u64 = number;\n/** A 32-bit unsigned integer when targeting 32-bit WebAssembly or a 64-bit unsigned integer when targeting 64-bit WebAssembly. */\ndeclare type usize = number;\n/** A 1-bit unsigned integer. */\ndeclare type bool = boolean | number;\n/** A 32-bit float. */\ndeclare type f32 = number;\n/** A 64-bit float. */\ndeclare type f64 = number;\n/** A 128-bit vector. */\ndeclare type v128 = object;\n\n// Compiler hints\n\n/** Compiler target. 0 = JS, 1 = WASM32, 2 = WASM64. */\ndeclare const ASC_TARGET: i32;\n/** Provided noAssert option. */\ndeclare const ASC_NO_ASSERT: bool;\n/** Provided memoryBase option. */\ndeclare const ASC_MEMORY_BASE: i32;\n/** Provided optimizeLevel option. */\ndeclare const ASC_OPTIMIZE_LEVEL: i32;\n/** Provided shrinkLevel option. */\ndeclare const ASC_SHRINK_LEVEL: i32;\n/** Whether the mutable global feature is enabled. */\ndeclare const ASC_FEATURE_MUTABLE_GLOBAL: bool;\n/** Whether the sign extension feature is enabled. */\ndeclare const ASC_FEATURE_SIGN_EXTENSION: bool;\n/** Whether the bulk memory feature is enabled. */\ndeclare const ASC_FEATURE_BULK_MEMORY: bool;\n/** Whether the SIMD feature is enabled. */\ndeclare const ASC_FEATURE_SIMD: bool;\n/** Whether the threads feature is enabled. */\ndeclare const ASC_FEATURE_THREADS: bool;\n\n// Builtins\n\n/** Performs the sign-agnostic count leading zero bits operation on a 32-bit or 64-bit integer. All zero bits are considered leading if the value is zero. */\ndeclare function clz(value: T): T;\n/** Performs the sign-agnostic count tailing zero bits operation on a 32-bit or 64-bit integer. All zero bits are considered trailing if the value is zero. */\ndeclare function ctz(value: T): T;\n/** Performs the sign-agnostic count number of one bits operation on a 32-bit or 64-bit integer. */\ndeclare function popcnt(value: T): T;\n/** Performs the sign-agnostic rotate left operation on a 32-bit or 64-bit integer. */\ndeclare function rotl(value: T, shift: T): T;\n/** Performs the sign-agnostic rotate right operation on a 32-bit or 64-bit integer. */\ndeclare function rotr(value: T, shift: T): T;\n/** Computes the absolute value of an integer or float. */\ndeclare function abs(value: T): T;\n/** Determines the maximum of two integers or floats. If either operand is `NaN`, returns `NaN`. */\ndeclare function max(left: T, right: T): T;\n/** Determines the minimum of two integers or floats. If either operand is `NaN`, returns `NaN`. */\ndeclare function min(left: T, right: T): T;\n/** Performs the ceiling operation on a 32-bit or 64-bit float. */\ndeclare function ceil(value: T): T;\n/** Composes a 32-bit or 64-bit float from the magnitude of `x` and the sign of `y`. */\ndeclare function copysign(x: T, y: T): T;\n/** Performs the floor operation on a 32-bit or 64-bit float. */\ndeclare function floor(value: T): T;\n/** Rounds to the nearest integer tied to even of a 32-bit or 64-bit float. */\ndeclare function nearest(value: T): T;\n/** Reinterprets the bits of the specified value as type `T`. Valid reinterpretations are u32/i32 to/from f32 and u64/i64 to/from f64. */\ndeclare function reinterpret(value: number): T;\n/** Selects one of two pre-evaluated values depending on the condition. */\ndeclare function select(ifTrue: T, ifFalse: T, condition: bool): T;\n/** Calculates the square root of a 32-bit or 64-bit float. */\ndeclare function sqrt(value: T): T;\n/** Rounds to the nearest integer towards zero of a 32-bit or 64-bit float. */\ndeclare function trunc(value: T): T;\n/** Loads a value of the specified type from memory. Equivalent to dereferncing a pointer in other languages. */\ndeclare function load(ptr: usize, immOffset?: usize, immAlign?: usize): T;\n/** Stores a value of the specified type to memory. Equivalent to dereferencing a pointer in other languages when assigning a value. */\ndeclare function store(ptr: usize, value: any, immOffset?: usize, immAlign?: usize): void;\n/** Emits an unreachable operation that results in a runtime error when executed. Both a statement and an expression of any type. */\ndeclare function unreachable(): any; // sic\n\n/** NaN (not a number) as a 32-bit or 64-bit float depending on context. */\ndeclare const NaN: f32 | f64;\n/** Positive infinity as a 32-bit or 64-bit float depending on context. */\ndeclare const Infinity: f32 | f64;\n/** Heap base offset. */\ndeclare const HEAP_BASE: usize;\n/** Determines the byte size of the specified underlying core type. Compiles to a constant. */\ndeclare function sizeof(): usize;\n/** Determines the alignment (log2) of the specified underlying core type. Compiles to a constant. */\ndeclare function alignof(): usize;\n/** Determines the offset of the specified field within the given class type. Returns the class type\'s end offset if field name has been omitted. Compiles to a constant. */\ndeclare function offsetof(fieldName?: string): usize;\n/** Changes the type of any value of `usize` kind to another one of `usize` kind. Useful for casting class instances to their pointer values and vice-versa. Beware that this is unsafe.*/\ndeclare function changetype(value: any): T;\n/** Explicitly requests no bounds checks on the provided expression. Useful for array accesses. */\ndeclare function unchecked(value: T): T;\n/** Emits a `call_indirect` instruction, calling the specified function in the function table by index with the specified arguments. Does result in a runtime error if the arguments do not match the called function. */\ndeclare function call_indirect(target: Function | u32, ...args: any[]): T;\n/** Instantiates a new instance of `T` using the specified constructor arguments. */\ndeclare function instantiate(...args: any[]): T;\n/** Tests if a 32-bit or 64-bit float is `NaN`. */\ndeclare function isNaN(value: T): bool;\n/** Tests if a 32-bit or 64-bit float is finite, that is not `NaN` or +/-`Infinity`. */\ndeclare function isFinite(value: T): bool;\n/** Tests if the specified type *or* expression is of an integer type and not a reference. Compiles to a constant. */\ndeclare function isInteger(value?: any): value is number;\n/** Tests if the specified type *or* expression is of a float type. Compiles to a constant. */\ndeclare function isFloat(value?: any): value is number;\n/** Tests if the specified type *or* expression can represent negative numbers. Compiles to a constant. */\ndeclare function isSigned(value?: any): value is number;\n/** Tests if the specified type *or* expression is of a reference type. Compiles to a constant. */\ndeclare function isReference(value?: any): value is object | string;\n/** Tests if the specified type *or* expression can be used as a string. Compiles to a constant. */\ndeclare function isString(value?: any): value is string | String;\n/** Tests if the specified type *or* expression can be used as an array. Compiles to a constant. */\ndeclare function isArray(value?: any): value is Array;\n/** Tests if the specified type *or* expression can be used as an array like object. Compiles to a constant. */\ndeclare function isArrayLike(value?: any): value is ArrayLike;\n/** Tests if the specified type *or* expression is of a function type. Compiles to a constant. */\ndeclare function isFunction(value?: any): value is (...args: any) => any;\n/** Tests if the specified type *or* expression is of a nullable reference type. Compiles to a constant. */\ndeclare function isNullable(value?: any): bool;\n/** Tests if the specified expression resolves to a defined element. Compiles to a constant. */\ndeclare function isDefined(expression: any): bool;\n/** Tests if the specified expression evaluates to a constant value. Compiles to a constant. */\ndeclare function isConstant(expression: any): bool;\n/** Tests if the specified type *or* expression is of a managed type. Compiles to a constant. */\ndeclare function isManaged(value?: any): bool;\n/** Traps if the specified value is not true-ish, otherwise returns the (non-nullable) value. */\ndeclare function assert(isTrueish: T, message?: string): T & object; // any better way to model `: T != null`?\n/** Parses an integer string to a 64-bit float. */\ndeclare function parseInt(str: string, radix?: i32): f64;\n/** Parses an integer string to a 32-bit integer. */\ndeclare function parseI32(str: string, radix?: i32): i32;\n/** Parses an integer string to a 64-bit integer. */\ndeclare function parseI64(str: string, radix?: i32): i64;\n/** Parses a string to a 64-bit float. */\ndeclare function parseFloat(str: string): f64;\n/** Returns the 64-bit floating-point remainder of `x/y`. */\ndeclare function fmod(x: f64, y: f64): f64;\n/** Returns the 32-bit floating-point remainder of `x/y`. */\ndeclare function fmodf(x: f32, y: f32): f32;\n\n/** Atomic operations. */\ndeclare namespace atomic {\n /** Atomically loads an integer value from memory and returns it. */\n export function load(offset: usize, immOffset?: usize): T;\n /** Atomically stores an integer value to memory. */\n export function store(offset: usize, value: T, immOffset?: usize): void;\n /** Atomically adds an integer value in memory. */\n export function add(ptr: usize, value: T, immOffset?: usize): T;\n /** Atomically subtracts an integer value in memory. */\n export function sub(ptr: usize, value: T, immOffset?: usize): T;\n /** Atomically performs a bitwise AND operation on an integer value in memory. */\n export function and(ptr: usize, value: T, immOffset?: usize): T;\n /** Atomically performs a bitwise OR operation on an integer value in memory. */\n export function or(ptr: usize, value: T, immOffset?: usize): T;\n /** Atomically performs a bitwise XOR operation on an integer value in memory. */\n export function xor(ptr: usize, value: T, immOffset?: usize): T;\n /** Atomically exchanges an integer value in memory. */\n export function xchg(ptr: usize, value: T, immOffset?: usize): T;\n /** Atomically compares and exchanges an integer value in memory if the condition is met. */\n export function cmpxchg(ptr: usize, expected: T, replacement: T, immOffset?: usize): T;\n /** Performs a wait operation on an address in memory suspending this agent if the integer condition is met. */\n export function wait(ptr: usize, expected: T, timeout: i64): AtomicWaitResult;\n /** Performs a notify operation on an address in memory waking up suspended agents. */\n export function notify(ptr: usize, count: i32): i32;\n}\n\n/** Describes the result of an atomic wait operation. */\ndeclare enum AtomicWaitResult {\n /** Woken by another agent. */\n OK,\n /** Loaded value did not match the expected value. */\n NOT_EQUAL,\n /** Not woken before the timeout expired. */\n TIMED_OUT\n}\n\n/** Converts any other numeric value to an 8-bit signed integer. */\ndeclare function i8(value: i8 | i16 | i32 | i64 | isize | u8 | u16 | u32 | u64 | usize | bool | f32 | f64): i8;\ndeclare namespace i8 {\n /** Smallest representable value. */\n export const MIN_VALUE: i8;\n /** Largest representable value. */\n export const MAX_VALUE: i8;\n}\n/** Converts any other numeric value to a 16-bit signed integer. */\ndeclare function i16(value: i8 | i16 | i32 | i64 | isize | u8 | u16 | u32 | u64 | usize | bool | f32 | f64): i8;\ndeclare namespace i16 {\n /** Smallest representable value. */\n export const MIN_VALUE: i16;\n /** Largest representable value. */\n export const MAX_VALUE: i16;\n}\n/** Converts any other numeric value to a 32-bit signed integer. */\ndeclare function i32(value: i8 | i16 | i32 | i64 | isize | u8 | u16 | u32 | u64 | usize | bool | f32 | f64): i32;\ndeclare namespace i32 {\n /** Smallest representable value. */\n export const MIN_VALUE: i32;\n /** Largest representable value. */\n export const MAX_VALUE: i32;\n /** Loads an 8-bit signed integer value from memory and returns it as a 32-bit integer. */\n export function load8_s(offset: usize, immOffset?: usize, immAlign?: usize): i32;\n /** Loads an 8-bit unsigned integer value from memory and returns it as a 32-bit integer. */\n export function load8_u(offset: usize, immOffset?: usize, immAlign?: usize): i32;\n /** Loads a 16-bit signed integer value from memory and returns it as a 32-bit integer. */\n export function load16_s(offset: usize, immOffset?: usize, immAlign?: usize): i32;\n /** Loads a 16-bit unsigned integer value from memory and returns it as a 32-bit integer. */\n export function load16_u(offset: usize, immOffset?: usize, immAlign?: usize): i32;\n /** Loads a 32-bit integer value from memory. */\n export function load(offset: usize, immOffset?: usize, immAlign?: usize): i32;\n /** Stores a 32-bit integer value to memory as an 8-bit integer. */\n export function store8(offset: usize, value: i32, immOffset?: usize, immAlign?: usize): void;\n /** Stores a 32-bit integer value to memory as a 16-bit integer. */\n export function store16(offset: usize, value: i32, immOffset?: usize, immAlign?: usize): void;\n /** Stores a 32-bit integer value to memory. */\n export function store(offset: usize, value: i32, immOffset?: usize, immAlign?: usize): void;\n /** Atomic 32-bit integer operations. */\n export namespace atomic {\n /** Atomically loads an 8-bit unsigned integer value from memory and returns it as a 32-bit integer. */\n export function load8_u(offset: usize, immOffset?: usize): i32;\n /** Atomically loads a 16-bit unsigned integer value from memory and returns it as a 32-bit integer. */\n export function load16_u(offset: usize, immOffset?: usize): i32;\n /** Atomically loads a 32-bit integer value from memory and returns it. */\n export function load(offset: usize, immOffset?: usize): i32;\n /** Atomically stores a 32-bit integer value to memory as an 8-bit integer. */\n export function store8(offset: usize, value: i32, immOffset?: usize): void;\n /** Atomically stores a 32-bit integer value to memory as a 16-bit integer. */\n export function store16(offset: usize, value: i32, immOffset?: usize): void;\n /** Atomically stores a 32-bit integer value to memory. */\n export function store(offset: usize, value: i32, immOffset?: usize): void;\n /** Performs a wait operation on a 32-bit integer value in memory suspending this agent if the condition is met. */\n export function wait(ptr: usize, expected: i32, timeout: i64): AtomicWaitResult;\n /** Atomic 32-bit integer read-modify-write operations on 8-bit values. */\n export namespace rmw8 {\n /** Atomically adds an 8-bit unsigned integer value in memory. */\n export function add_u(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically subtracts an 8-bit unsigned integer value in memory. */\n export function sub_u(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically performs a bitwise AND operation an 8-bit unsigned integer value in memory. */\n export function and_u(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically performs a bitwise OR operation an 8-bit unsigned integer value in memory. */\n export function or_u(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically performs a bitwise XOR operation an 8-bit unsigned integer value in memory. */\n export function xor_u(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically exchanges an 8-bit unsigned integer value in memory. */\n export function xchg_u(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically compares and exchanges an 8-bit unsigned integer value in memory if the condition is met. */\n export function cmpxchg_u(offset: usize, expected: i32, replacement: i32, immOffset?: usize): i32;\n }\n /** Atomic 32-bit integer read-modify-write operations on 16-bit values. */\n export namespace rmw16 {\n /** Atomically adds a 16-bit unsigned integer value in memory. */\n export function add_u(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically adds a 16-bit unsigned integer value in memory. */\n export function sub_u(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically performs a bitwise AND operation a 16-bit unsigned integer value in memory. */\n export function and_u(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically performs a bitwise OR operation a 16-bit unsigned integer value in memory. */\n export function or_u(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically performs a bitwise XOR operation a 16-bit unsigned integer value in memory. */\n export function xor_u(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically exchanges a 16-bit unsigned integer value in memory. */\n export function xchg_u(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically compares and exchanges a 16-bit unsigned integer value in memory if the condition is met. */\n export function cmpxchg_u(offset: usize, expected: i32, replacement: i32, immOffset?: usize): i32;\n }\n /** Atomic 32-bit integer read-modify-write operations. */\n export namespace rmw {\n /** Atomically adds a 32-bit integer value in memory. */\n export function add(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically subtracts a 32-bit integer value in memory. */\n export function sub(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically performs a bitwise AND operation a 32-bit integer value in memory. */\n export function and(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically performs a bitwise OR operation a 32-bit integer value in memory. */\n export function or(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically performs a bitwise XOR operation a 32-bit integer value in memory. */\n export function xor(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically exchanges a 32-bit integer value in memory. */\n export function xchg(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically compares and exchanges a 32-bit integer value in memory if the condition is met. */\n export function cmpxchg(offset: usize, expected: i32, replacement: i32, immOffset?: usize): i32;\n }\n }\n}\n/** Converts any other numeric value to a 64-bit signed integer. */\ndeclare function i64(value: i8 | i16 | i32 | i64 | isize | u8 | u16 | u32 | u64 | usize | bool | f32 | f64): i64;\ndeclare namespace i64 {\n /** Smallest representable value. */\n export const MIN_VALUE: i64;\n /** Largest representable value. */\n export const MAX_VALUE: i64;\n /** Loads an 8-bit signed integer value from memory and returns it as a 64-bit integer. */\n export function load8_s(offset: usize, immOffset?: usize, immAlign?: usize): i64;\n /** Loads an 8-bit unsigned integer value from memory and returns it as a 64-bit integer. */\n export function load8_u(offset: usize, immOffset?: usize, immAlign?: usize): i64;\n /** Loads a 16-bit signed integer value from memory and returns it as a 64-bit integer. */\n export function load16_s(offset: usize, immOffset?: usize, immAlign?: usize): i64;\n /** Loads a 16-bit unsigned integer value from memory and returns it as a 64-bit integer. */\n export function load16_u(offset: usize, immOffset?: usize, immAlign?: usize): i64;\n /** Loads a 32-bit signed integer value from memory and returns it as a 64-bit integer. */\n export function load32_s(offset: usize, immOffset?: usize, immAlign?: usize): i64;\n /** Loads a 32-bit unsigned integer value from memory and returns it as a 64-bit integer. */\n export function load32_u(offset: usize, immOffset?: usize, immAlign?: usize): i64;\n /** Loads a 64-bit unsigned integer value from memory. */\n export function load(offset: usize, immOffset?: usize, immAlign?: usize): i64;\n /** Stores a 64-bit integer value to memory as an 8-bit integer. */\n export function store8(offset: usize, value: i64, immOffset?: usize, immAlign?: usize): void;\n /** Stores a 64-bit integer value to memory as a 16-bit integer. */\n export function store16(offset: usize, value: i64, immOffset?: usize, immAlign?: usize): void;\n /** Stores a 64-bit integer value to memory as a 32-bit integer. */\n export function store32(offset: usize, value: i64, immOffset?: usize, immAlign?: usize): void;\n /** Stores a 64-bit integer value to memory. */\n export function store(offset: usize, value: i64, immOffset?: usize, immAlign?: usize): void;\n /** Atomic 64-bit integer operations. */\n export namespace atomic {\n /** Atomically loads an 8-bit unsigned integer value from memory and returns it as a 64-bit integer. */\n export function load8_u(offset: usize, immOffset?: usize): i64;\n /** Atomically loads a 16-bit unsigned integer value from memory and returns it as a 64-bit integer. */\n export function load16_u(offset: usize, immOffset?: usize): i64;\n /** Atomically loads a 32-bit unsigned integer value from memory and returns it as a 64-bit integer. */\n export function load32_u(offset: usize, immOffset?: usize): i64;\n /** Atomically loads a 64-bit integer value from memory and returns it. */\n export function load(offset: usize, immOffset?: usize): i64;\n /** Atomically stores a 64-bit integer value to memory as an 8-bit integer. */\n export function store8(offset: usize, value: i64, immOffset?: usize): void;\n /** Atomically stores a 64-bit integer value to memory as a 16-bit integer. */\n export function store16(offset: usize, value: i64, immOffset?: usize): void;\n /** Atomically stores a 64-bit integer value to memory as a 32-bit integer. */\n export function store32(offset: usize, value: i64, immOffset?: usize): void;\n /** Atomically stores a 64-bit integer value to memory. */\n export function store(offset: usize, value: i64, immOffset?: usize): void;\n /** Performs a wait operation on a 64-bit integer value in memory suspending this agent if the condition is met. */\n export function wait(ptr: usize, expected: i64, timeout: i64): AtomicWaitResult;\n /** Atomic 64-bit integer read-modify-write operations on 8-bit values. */\n export namespace rmw8 {\n /** Atomically adds an 8-bit unsigned integer value in memory. */\n export function add_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically subtracts an 8-bit unsigned integer value in memory. */\n export function sub_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically performs a bitwise AND operation on an 8-bit unsigned integer value in memory. */\n export function and_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically performs a bitwise OR operation on an 8-bit unsigned integer value in memory. */\n export function or_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically performs a bitwise XOR operation on an 8-bit unsigned integer value in memory. */\n export function xor_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically exchanges an 8-bit unsigned integer value in memory. */\n export function xchg_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically compares and exchanges an 8-bit unsigned integer value in memory if the condition is met. */\n export function cmpxchg_u(offset: usize, expected: i64, replacement: i64, immOffset?: usize): i64;\n }\n /** Atomic 64-bit integer read-modify-write operations on 16-bit values. */\n export namespace rmw16 {\n /** Atomically adds a 16-bit unsigned integer value in memory. */\n export function add_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically subtracts a 16-bit unsigned integer value in memory. */\n export function sub_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically performs a bitwise AND operation on a 16-bit unsigned integer value in memory. */\n export function and_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically performs a bitwise OR operation on a 16-bit unsigned integer value in memory. */\n export function or_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically performs a bitwise XOR operation on a 16-bit unsigned integer value in memory. */\n export function xor_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically exchanges a 16-bit unsigned integer value in memory. */\n export function xchg_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically compares and exchanges a 16-bit unsigned integer value in memory if the condition is met. */\n export function cmpxchg_u(offset: usize, expected: i64, replacement: i64, immOffset?: usize): i64;\n }\n /** Atomic 64-bit integer read-modify-write operations on 32-bit values. */\n export namespace rmw32 {\n /** Atomically adds a 32-bit unsigned integer value in memory. */\n export function add_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically subtracts a 32-bit unsigned integer value in memory. */\n export function sub_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically performs a bitwise AND operation on a 32-bit unsigned integer value in memory. */\n export function and_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically performs a bitwise OR operation on a 32-bit unsigned integer value in memory. */\n export function or_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically performs a bitwise XOR operation on a 32-bit unsigned integer value in memory. */\n export function xor_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically exchanges a 32-bit unsigned integer value in memory. */\n export function xchg_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically compares and exchanges a 32-bit unsigned integer value in memory if the condition is met. */\n export function cmpxchg_u(offset: usize, expected: i64, replacement: i64, immOffset?: usize): i64;\n }\n /** Atomic 64-bit integer read-modify-write operations. */\n export namespace rmw {\n /** Atomically adds a 64-bit integer value in memory. */\n export function add(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically subtracts a 64-bit integer value in memory. */\n export function sub(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically performs a bitwise AND operation on a 64-bit integer value in memory. */\n export function and(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically performs a bitwise OR operation on a 64-bit integer value in memory. */\n export function or(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically performs a bitwise XOR operation on a 64-bit integer value in memory. */\n export function xor(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically exchanges a 64-bit integer value in memory. */\n export function xchg(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically compares and exchanges a 64-bit integer value in memory if the condition is met. */\n export function cmpxchg(offset: usize, expected: i64, replacement: i64, immOffset?: usize): i64;\n }\n }\n}\n/** Converts any other numeric value to a 32-bit (in WASM32) respectivel 64-bit (in WASM64) signed integer. */\ndeclare var isize: typeof i32 | typeof i64;\n/** Converts any other numeric value to an 8-bit unsigned integer. */\ndeclare function u8(value: i8 | i16 | i32 | i64 | isize | u8 | u16 | u32 | u64 | usize | bool | f32 | f64): i8;\ndeclare namespace u8 {\n /** Smallest representable value. */\n export const MIN_VALUE: u8;\n /** Largest representable value. */\n export const MAX_VALUE: u8;\n}\n/** Converts any other numeric value to a 16-bit unsigned integer. */\ndeclare function u16(value: i8 | i16 | i32 | i64 | isize | u8 | u16 | u32 | u64 | usize | bool | f32 | f64): i8;\ndeclare namespace u16 {\n /** Smallest representable value. */\n export const MIN_VALUE: u16;\n /** Largest representable value. */\n export const MAX_VALUE: u16;\n}\n/** Converts any other numeric value to a 32-bit unsigned integer. */\ndeclare function u32(value: i8 | i16 | i32 | i64 | isize | u8 | u16 | u32 | u64 | usize | bool | f32 | f64): i32;\ndeclare namespace u32 {\n /** Smallest representable value. */\n export const MIN_VALUE: u32;\n /** Largest representable value. */\n export const MAX_VALUE: u32;\n}\n/** Converts any other numeric value to a 64-bit unsigned integer. */\ndeclare function u64(value: i8 | i16 | i32 | i64 | isize | u8 | u16 | u32 | u64 | usize | bool | f32 | f64): i64;\ndeclare namespace u64 {\n /** Smallest representable value. */\n export const MIN_VALUE: u64;\n /** Largest representable value. */\n export const MAX_VALUE: u64;\n}\n/** Converts any other numeric value to a 32-bit (in WASM32) respectivel 64-bit (in WASM64) unsigned integer. */\ndeclare var usize: typeof u32 | typeof u64;\n/** Converts any other numeric value to a 1-bit unsigned integer. */\ndeclare function bool(value: i8 | i16 | i32 | i64 | isize | u8 | u16 | u32 | u64 | usize | bool | f32 | f64): bool;\ndeclare namespace bool {\n /** Smallest representable value. */\n export const MIN_VALUE: bool;\n /** Largest representable value. */\n export const MAX_VALUE: bool;\n}\n/** Converts any other numeric value to a 32-bit float. */\ndeclare function f32(value: i8 | i16 | i32 | i64 | isize | u8 | u16 | u32 | u64 | usize | bool | f32 | f64): f32;\ndeclare namespace f32 {\n /** Smallest representable value. */\n export const MIN_VALUE: f32;\n /** Largest representable value. */\n export const MAX_VALUE: f32;\n /** Smallest normalized positive value. */\n export const MIN_POSITIVE_VALUE: f32;\n /** Smallest safely representable integer value. */\n export const MIN_SAFE_INTEGER: f32;\n /** Largest safely representable integer value. */\n export const MAX_SAFE_INTEGER: f32;\n /** Difference between 1 and the smallest representable value greater than 1. */\n export const EPSILON: f32;\n /** Loads a 32-bit float from memory. */\n export function load(offset: usize, immOffset?: usize, immAlign?: usize): f32;\n /** Stores a 32-bit float to memory. */\n export function store(offset: usize, value: f32, immOffset?: usize, immAlign?: usize): void;\n}\n/** Converts any other numeric value to a 64-bit float. */\ndeclare function f64(value: i8 | i16 | i32 | i64 | isize | u8 | u16 | u32 | u64 | usize | bool | f32 | f64): f64;\ndeclare namespace f64 {\n /** Smallest representable value. */\n export const MIN_VALUE: f64;\n /** Largest representable value. */\n export const MAX_VALUE: f64;\n /** Smallest normalized positive value. */\n export const MIN_POSITIVE_VALUE: f64;\n /** Smallest safely representable integer value. */\n export const MIN_SAFE_INTEGER: f64;\n /** Largest safely representable integer value. */\n export const MAX_SAFE_INTEGER: f64;\n /** Difference between 1 and the smallest representable value greater than 1. */\n export const EPSILON: f64;\n /** Loads a 64-bit float from memory. */\n export function load(offset: usize, immOffset?: usize, immAlign?: usize): f64;\n /** Stores a 64-bit float to memory. */\n export function store(offset: usize, value: f64, immOffset?: usize, immAlign?: usize): void;\n}\n/** Initializes a 128-bit vector from sixteen 8-bit integer values. Arguments must be compile-time constants. */\ndeclare function v128(a: i8, b: i8, c: i8, d: i8, e: i8, f: i8, g: i8, h: i8, i: i8, j: i8, k: i8, l: i8, m: i8, n: i8, o: i8, p: i8): v128;\ndeclare namespace v128 {\n /** Creates a 128-bit vector with identical lanes. */\n export function splat(x: T): v128;\n /** Extracts one lane from a 128-bit vector as a scalar. */\n export function extract_lane(x: v128, idx: u8): T;\n /** Replaces one lane in a 128-bit vector. */\n export function replace_lane(x: v128, idx: u8, value: T): v128;\n /** Selects lanes from either 128-bit vector according to the specified lane indexes. */\n export function shuffle(a: v128, b: v128, ...lanes: u8[]): v128;\n /** Loads a 128-bit vector from memory. */\n export function load(offset: usize, immOffset?: usize, immAlign?: usize): v128;\n /** Stores a 128-bit vector to memory. */\n export function store(offset: usize, value: v128, immOffset?: usize, immAlign?: usize): void;\n /** Adds each lane of two 128-bit vectors. */\n export function add(a: v128, b: v128): v128;\n /** Subtracts each lane of two 128-bit vectors. */\n export function sub(a: v128, b: v128): v128;\n /** Multiplies each lane of two 128-bit vectors. */\n export function mul(a: v128, b: v128): v128; // except i64\n /** Divides each lane of two 128-bit vectors. */\n export function div(a: v128, b: v128): v128;\n /** Negates each lane of a 128-bit vector */\n export function neg(a: v128): v128;\n /** Adds each lane of two 128-bit vectors using saturation. */\n export function add_saturate(a: v128, b: v128): v128;\n /** Subtracts each lane of two 128-bit vectors using saturation. */\n export function sub_saturate(a: v128, b: v128): v128;\n /** Performs a bitwise left shift on each lane of a 128-bit vector by a scalar. */\n export function shl(a: v128, b: i32): v128;\n /** Performs a bitwise right shift on each lane of a 128-bit vector by a scalar. */\n export function shr(a: v128, b: i32): v128;\n /** Performs the bitwise AND operation on each lane of two 128-bit vectors. */\n export function and(a: v128, b: v128): v128;\n /** Performs the bitwise OR operation on each lane of two 128-bit vectors. */\n export function or(a: v128, b: v128): v128;\n /** Performs the bitwise XOR operation on each lane of two 128-bit vectors. */\n export function xor(a: v128, b: v128): v128;\n /** Performs the bitwise NOT operation on each lane of a 128-bit vector. */\n export function not(a: v128): v128;\n /** Selects bits of either 128-bit vector according to the specified mask. */\n export function bitselect(v1: v128, v2: v128, mask: v128): v128;\n /** Reduces a 128-bit vector to a scalar indicating whether any lane is considered `true`. */\n export function any_true(a: v128): bool;\n /** Reduces a 128-bit vector to a scalar indicating whether all lanes are considered `true`. */\n export function all_true(a: v128): bool;\n /** Computes the minimum of each lane of two 128-bit vectors. */\n export function min(a: v128, b: v128): v128;\n /** Computes the maximum of each lane of two 128-bit vectors. */\n export function max(a: v128, b: v128): v128;\n /** Computes the absolute value of each lane of a 128-bit vector. */\n export function abs(a: v128): v128;\n /** Computes the square root of each lane of a 128-bit vector. */\n export function sqrt(a: v128): v128;\n /** Computes which lanes of two 128-bit vectors are equal. */\n export function eq(a: v128, b: v128): v128;\n /** Computes which lanes of two 128-bit vectors are not equal. */\n export function ne(a: v128, b: v128): v128;\n /** Computes which lanes of the first 128-bit vector are less than those of the second. */\n export function lt(a: v128, b: v128): v128;\n /** Computes which lanes of the first 128-bit vector are less than or equal those of the second. */\n export function le(a: v128, b: v128): v128;\n /** Computes which lanes of the first 128-bit vector are greater than those of the second. */\n export function gt(a: v128, b: v128): v128;\n /** Computes which lanes of the first 128-bit vector are greater than or equal those of the second. */\n export function ge(a: v128, b: v128): v128;\n /** Converts each lane of a 128-bit vector from integer to floating point. */\n export function convert(a: v128): v128;\n /** Truncates each lane of a 128-bit vector from floating point to integer with saturation. */\n export function trunc(a: v128): v128;\n}\n/** Initializes a 128-bit vector from sixteen 8-bit integer values. Arguments must be compile-time constants. */\ndeclare function i8x16(a: i8, b: i8, c: i8, d: i8, e: i8, f: i8, g: i8, h: i8, i: i8, j: i8, k: i8, l: i8, m: i8, n: i8, o: i8, p: i8): v128;\ndeclare namespace i8x16 {\n /** Creates a vector with sixteen identical 8-bit integer lanes. */\n export function splat(x: i8): v128;\n /** Extracts one 8-bit integer lane from a 128-bit vector as a signed scalar. */\n export function extract_lane_s(x: v128, idx: u8): i8;\n /** Extracts one 8-bit integer lane from a 128-bit vector as an unsigned scalar. */\n export function extract_lane_u(x: v128, idx: u8): u8;\n /** Replaces one 8-bit integer lane in a 128-bit vector. */\n export function replace_lane(x: v128, idx: u8, value: i8): v128;\n /** Adds each 8-bit integer lane of two 128-bit vectors. */\n export function add(a: v128, b: v128): v128;\n /** Subtracts each 8-bit integer lane of two 128-bit vectors. */\n export function sub(a: v128, b: v128): v128;\n /** Multiplies each 8-bit integer lane of two 128-bit vectors. */\n export function mul(a: v128, b: v128): v128;\n /** Negates each 8-bit integer lane of a 128-bit vector. */\n export function neg(a: v128): v128;\n /** Adds each 8-bit integer lane of two 128-bit vectors using signed saturation. */\n export function add_saturate_s(a: v128, b: v128): v128;\n /** Adds each 8-bit integer lane of two 128-bit vectors using unsigned saturation. */\n export function add_saturate_u(a: v128, b: v128): v128;\n /** Subtracts each 8-bit integer lane of two 128-bit vectors using signed saturation. */\n export function sub_saturate_s(a: v128, b: v128): v128;\n /** Subtracts each 8-bit integer lane of two 128-bit vectors using unsigned saturation. */\n export function sub_saturate_u(a: v128, b: v128): v128;\n /** Performs a bitwise left shift on each 8-bit integer lane of a 128-bit vector by a scalar. */\n export function shl(a: v128, b: i32): v128;\n /** Performs a bitwise arithmetic right shift on each 8-bit integer lane of a 128-bit vector by a scalar. */\n export function shr_s(a: v128, b: i32): v128;\n /** Performs a bitwise logical right shift on each 8-bit integer lane of a 128-bit vector by a scalar. */\n export function shr_u(a: v128, b: i32): v128;\n /** Reduces a 128-bit vector to a scalar indicating whether any 8-bit integer lane is considered `true`. */\n export function any_true(a: v128): bool;\n /** Reduces a 128-bit vector to a scalar indicating whether all 8-bit integer lanes are considered `true`. */\n export function all_true(a: v128): bool;\n /** Computes which 8-bit integer lanes of two 128-bit vectors are equal. */\n export function eq(a: v128, b: v128): v128;\n /** Computes which 8-bit integer lanes of two 128-bit vectors are not equal. */\n export function ne(a: v128, b: v128): v128;\n /** Computes which 8-bit signed integer lanes of the first 128-bit vector are less than those of the second. */\n export function lt_s(a: v128, b: v128): v128;\n /** Computes which 8-bit unsigned integer lanes of the first 128-bit vector are less than those of the second. */\n export function lt_u(a: v128, b: v128): v128;\n /** Computes which 8-bit signed integer lanes of the first 128-bit vector are less than or equal those of the second. */\n export function le_s(a: v128, b: v128): v128;\n /** Computes which 8-bit unsigned integer lanes of the first 128-bit vector are less than or equal those of the second. */\n export function le_u(a: v128, b: v128): v128;\n /** Computes which 8-bit signed integer lanes of the first 128-bit vector are greater than those of the second. */\n export function gt_s(a: v128, b: v128): v128;\n /** Computes which 8-bit unsigned integer lanes of the first 128-bit vector are greater than those of the second. */\n export function gt_u(a: v128, b: v128): v128;\n /** Computes which 8-bit signed integer lanes of the first 128-bit vector are greater than or equal those of the second. */\n export function ge_s(a: v128, b: v128): v128;\n /** Computes which 8-bit unsigned integer lanes of the first 128-bit vector are greater than or equal those of the second. */\n export function ge_u(a: v128, b: v128): v128;\n}\n/** Initializes a 128-bit vector from eight 16-bit integer values. Arguments must be compile-time constants. */\ndeclare function i16x8(a: i16, b: i16, c: i16, d: i16, e: i16, f: i16, g: i16, h: i16): v128;\ndeclare namespace i16x8 {\n /** Creates a vector with eight identical 16-bit integer lanes. */\n export function splat(x: i16): v128;\n /** Extracts one 16-bit integer lane from a 128-bit vector as a signed scalar. */\n export function extract_lane_s(x: v128, idx: u8): i16;\n /** Extracts one 16-bit integer lane from a 128-bit vector as an unsigned scalar. */\n export function extract_lane_u(x: v128, idx: u8): u16;\n /** Replaces one 16-bit integer lane in a 128-bit vector. */\n export function replace_lane(x: v128, idx: u8, value: i16): v128;\n /** Adds each 16-bit integer lane of two 128-bit vectors. */\n export function add(a: v128, b: v128): v128;\n /** Subtracts each 16-bit integer lane of two 128-bit vectors. */\n export function sub(a: v128, b: v128): v128;\n /** Multiplies each 16-bit integer lane of two 128-bit vectors. */\n export function mul(a: v128, b: v128): v128;\n /** Negates each 16-bit integer lane of a 128-bit vector. */\n export function neg(a: v128): v128;\n /** Adds each 16-bit integer lane of two 128-bit vectors using signed saturation. */\n export function add_saturate_s(a: v128, b: v128): v128;\n /** Adds each 16-bit integer lane of two 128-bit vectors using unsigned saturation. */\n export function add_saturate_u(a: v128, b: v128): v128;\n /** Subtracts each 16-bit integer lane of two 128-bit vectors using signed saturation. */\n export function sub_saturate_s(a: v128, b: v128): v128;\n /** Subtracts each 16-bit integer lane of two 128-bit vectors using unsigned saturation. */\n export function sub_saturate_u(a: v128, b: v128): v128;\n /** Performs a bitwise left shift on each 16-bit integer lane of a 128-bit vector by a scalar. */\n export function shl(a: v128, b: i32): v128;\n /** Performs a bitwise arithmetic right shift each 16-bit integer lane of a 128-bit vector by a scalar. */\n export function shr_s(a: v128, b: i32): v128;\n /** Performs a bitwise logical right shift on each 16-bit integer lane of a 128-bit vector by a scalar. */\n export function shr_u(a: v128, b: i32): v128;\n /** Reduces a 128-bit vector to a scalar indicating whether any 16-bit integer lane is considered `true`. */\n export function any_true(a: v128): bool;\n /** Reduces a 128-bit vector to a scalar indicating whether all 16-bit integer lanes are considered `true`. */\n export function all_true(a: v128): bool;\n /** Computes which 16-bit integer lanes of two 128-bit vectors are equal. */\n export function eq(a: v128, b: v128): v128;\n /** Computes which 16-bit integer lanes of two 128-bit vectors are not equal. */\n export function ne(a: v128, b: v128): v128;\n /** Computes which 16-bit signed integer lanes of the first 128-bit vector are less than those of the second. */\n export function lt_s(a: v128, b: v128): v128;\n /** Computes which 16-bit unsigned integer lanes of the first 128-bit vector are less than those of the second. */\n export function lt_u(a: v128, b: v128): v128;\n /** Computes which 16-bit signed integer lanes of the first 128-bit vector are less than or equal those of the second. */\n export function le_s(a: v128, b: v128): v128;\n /** Computes which 16-bit unsigned integer lanes of the first 128-bit vector are less than or equal those of the second. */\n export function le_u(a: v128, b: v128): v128;\n /** Computes which 16-bit signed integer lanes of the first 128-bit vector are greater than those of the second. */\n export function gt_s(a: v128, b: v128): v128;\n /** Computes which 16-bit unsigned integer lanes of the first 128-bit vector are greater than those of the second. */\n export function gt_u(a: v128, b: v128): v128;\n /** Computes which 16-bit signed integer lanes of the first 128-bit vector are greater than or equal those of the second. */\n export function ge_s(a: v128, b: v128): v128;\n /** Computes which 16-bit unsigned integer lanes of the first 128-bit vector are greater than or equal those of the second. */\n export function ge_u(a: v128, b: v128): v128;\n}\n/** Initializes a 128-bit vector from four 32-bit integer values. Arguments must be compile-time constants. */\ndeclare function i32x4(a: i32, b: i32, c: i32, d: i32): v128;\ndeclare namespace i32x4 {\n /** Creates a 128-bit vector with four identical 32-bit integer lanes. */\n export function splat(x: i32): v128;\n /** Extracts one 32-bit integer lane from a 128-bit vector as a scalar. */\n export function extract_lane(x: v128, idx: u8): i32;\n /** Replaces one 32-bit integer lane in a 128-bit vector. */\n export function replace_lane(x: v128, idx: u8, value: i32): v128;\n /** Adds each 32-bit integer lane of two 128-bit vectors. */\n export function add(a: v128, b: v128): v128;\n /** Subtracts each 32-bit integer lane of two 128-bit vectors. */\n export function sub(a: v128, b: v128): v128;\n /** Multiplies each 32-bit integer lane of two 128-bit vectors. */\n export function mul(a: v128, b: v128): v128;\n /** Negates each 32-bit integer lane of a 128-bit vector. */\n export function neg(a: v128): v128;\n /** Performs a bitwise left shift on each 32-bit integer lane of a 128-bit vector by a scalar. */\n export function shl(a: v128, b: i32): v128;\n /** Performs a bitwise arithmetic right shift on each 32-bit integer lane of a 128-bit vector by a scalar. */\n export function shr_s(a: v128, b: i32): v128;\n /** Performs a bitwise logical right shift on each 32-bit integer lane of a 128-bit vector by a scalar. */\n export function shr_u(a: v128, b: i32): v128;\n /** Reduces a 128-bit vector to a scalar indicating whether any 32-bit integer lane is considered `true`. */\n export function any_true(a: v128): bool;\n /** Reduces a 128-bit vector to a scalar indicating whether all 32-bit integer lanes are considered `true`. */\n export function all_true(a: v128): bool;\n /** Computes which 32-bit integer lanes of two 128-bit vectors are equal. */\n export function eq(a: v128, b: v128): v128;\n /** Computes which 32-bit integer lanes of two 128-bit vectors are not equal. */\n export function ne(a: v128, b: v128): v128;\n /** Computes which 32-bit signed integer lanes of the first 128-bit vector are less than those of the second. */\n export function lt_s(a: v128, b: v128): v128;\n /** Computes which 32-bit unsigned integer lanes of the first 128-bit vector are less than those of the second. */\n export function lt_u(a: v128, b: v128): v128;\n /** Computes which 32-bit signed integer lanes of the first 128-bit vector are less than or equal those of the second. */\n export function le_s(a: v128, b: v128): v128;\n /** Computes which 32-bit unsigned integer lanes of the first 128-bit vector are less than or equal those of the second. */\n export function le_u(a: v128, b: v128): v128;\n /** Computes which 32-bit signed integer lanes of the first 128-bit vector are greater than those of the second. */\n export function gt_s(a: v128, b: v128): v128;\n /** Computes which 32-bit unsigned integer lanes of the first 128-bit vector are greater than those of the second. */\n export function gt_u(a: v128, b: v128): v128;\n /** Computes which 32-bit signed integer lanes of the first 128-bit vector are greater than or equal those of the second. */\n export function ge_s(a: v128, b: v128): v128;\n /** Computes which 32-bit unsigned integer lanes of the first 128-bit vector are greater than or equal those of the second. */\n export function ge_u(a: v128, b: v128): v128;\n /** Truncates each 32-bit float lane of a 128-bit vector to a signed integer with saturation. */\n export function trunc_s_f32x4_sat(a: v128): v128;\n /** Truncates each 32-bit float lane of a 128-bit vector to an unsigned integer with saturation. */\n export function trunc_u_f32x4_sat(a: v128): v128;\n}\n/** Initializes a 128-bit vector from two 64-bit integer values. Arguments must be compile-time constants. */\ndeclare function i64x2(a: i64, b: i64): v128;\ndeclare namespace i64x2 {\n /** Creates a 128-bit vector with two identical 64-bit integer lanes. */\n export function splat(x: i64): v128;\n /** Extracts one 64-bit integer lane from a 128-bit vector as a scalar. */\n export function extract_lane(x: v128, idx: u8): i64;\n /** Replaces one 64-bit integer lane in a 128-bit vector. */\n export function replace_lane(x: v128, idx: u8, value: i64): v128;\n /** Adds each 64-bit integer lane of two 128-bit vectors. */\n export function add(a: v128, b: v128): v128;\n /** Subtracts each 64-bit integer lane of two 128-bit vectors. */\n export function sub(a: v128, b: v128): v128;\n /** Multiplies each 64-bit integer lane of two 128-bit vectors. */\n export function mul(a: v128, b: v128): v128;\n /** Negates each 64-bit integer lane of a 128-bit vector. */\n export function neg(a: v128): v128;\n /** Performs a bitwise left shift on each 64-bit integer lane of a 128-bit vector by a scalar. */\n export function shl(a: v128, b: i32): v128;\n /** Performs a bitwise arithmetic right shift on each 64-bit integer lane of a 128-bit vector by a scalar. */\n export function shr_s(a: v128, b: i32): v128;\n /** Performs a bitwise logical right shift on each 64-bit integer lane of a 128-bit vector by a scalar. */\n export function shr_u(a: v128, b: i32): v128;\n /** Reduces a 128-bit vector to a scalar indicating whether any 64-bit integer lane is considered `true`. */\n export function any_true(a: v128): bool;\n /** Reduces a 128-bit vector to a scalar indicating whether all 64-bit integer lanes are considered `true`. */\n export function all_true(a: v128): bool;\n /** Truncates each 64-bit float lane of a 128-bit vector to a signed integer with saturation. */\n export function trunc_s_f64x2_sat(a: v128): v128;\n /** Truncates each 64-bit float lane of a 128-bit vector to an unsigned integer with saturation. */\n export function trunc_u_f64x2_sat(a: v128): v128;\n}\n/** Initializes a 128-bit vector from four 32-bit float values. Arguments must be compile-time constants. */\ndeclare function f32x4(a: f32, b: f32, c: f32, d: f32): v128;\ndeclare namespace f32x4 {\n /** Creates a 128-bit vector with four identical 32-bit float lanes. */\n export function splat(x: f32): v128;\n /** Extracts one 32-bit float lane from a 128-bit vector as a scalar. */\n export function extract_lane(x: v128, idx: u8): f32;\n /** Replaces one 32-bit float lane in a 128-bit vector. */\n export function replace_lane(x: v128, idx: u8, value: f32): v128;\n /** Adds each 32-bit float lane of two 128-bit vectors. */\n export function add(a: v128, b: v128): v128;\n /** Subtracts each 32-bit float lane of two 128-bit vectors. */\n export function sub(a: v128, b: v128): v128;\n /** Multiplies each 32-bit float lane of two 128-bit vectors. */\n export function mul(a: v128, b: v128): v128;\n /** Divides each 32-bit float lane of two 128-bit vectors. */\n export function div(a: v128, b: v128): v128;\n /** Negates each 32-bit float lane of a 128-bit vector. */\n export function neg(a: v128): v128;\n /** Computes the minimum of each 32-bit float lane of two 128-bit vectors. */\n export function min(a: v128, b: v128): v128;\n /** Computes the maximum of each 32-bit float lane of two 128-bit vectors. */\n export function max(a: v128, b: v128): v128;\n /** Computes the absolute value of each 32-bit float lane of a 128-bit vector. */\n export function abs(a: v128): v128;\n /** Computes the square root of each 32-bit float lane of a 128-bit vector. */\n export function sqrt(a: v128): v128;\n /** Computes which 32-bit float lanes of two 128-bit vectors are equal. */\n export function eq(a: v128, b: v128): v128;\n /** Computes which 32-bit float lanes of two 128-bit vectors are not equal. */\n export function ne(a: v128, b: v128): v128;\n /** Computes which 32-bit float lanes of the first 128-bit vector are less than those of the second. */\n export function lt(a: v128, b: v128): v128;\n /** Computes which 32-bit float lanes of the first 128-bit vector are less than or equal those of the second. */\n export function le(a: v128, b: v128): v128;\n /** Computes which 32-bit float lanes of the first 128-bit vector are greater than those of the second. */\n export function gt(a: v128, b: v128): v128;\n /** Computes which 32-bit float lanes of the first 128-bit vector are greater than or equal those of the second. */\n export function ge(a: v128, b: v128): v128;\n /** Converts each 32-bit signed integer lane of a 128-bit vector to floating point. */\n export function convert_s_i32x4(a: v128): v128;\n /** Converts each 32-bit unsigned integer lane of a 128-bit vector to floating point. */\n export function convert_u_i32x4(a: v128): v128;\n}\n/** Initializes a 128-bit vector from two 64-bit float values. Arguments must be compile-time constants. */\ndeclare function f64x2(a: f64, b: f64): v128;\ndeclare namespace f64x2 {\n /** Creates a 128-bit vector with two identical 64-bit float lanes. */\n export function splat(x: f64): v128;\n /** Extracts one 64-bit float lane from a 128-bit vector as a scalar. */\n export function extract_lane(x: v128, idx: u8): f64;\n /** Replaces one 64-bit float lane in a 128-bit vector. */\n export function replace_lane(x: v128, idx: u8, value: f64): v128;\n /** Adds each 64-bit float lane of two 128-bit vectors. */\n export function add(a: v128, b: v128): v128;\n /** Subtracts each 64-bit float lane of two 128-bit vectors. */\n export function sub(a: v128, b: v128): v128;\n /** Multiplies each 64-bit float lane of two 128-bit vectors. */\n export function mul(a: v128, b: v128): v128;\n /** Divides each 64-bit float lane of two 128-bit vectors. */\n export function div(a: v128, b: v128): v128;\n /** Negates each 64-bit float lane of a 128-bit vector. */\n export function neg(a: v128): v128;\n /** Computes the minimum of each 64-bit float lane of two 128-bit vectors. */\n export function min(a: v128, b: v128): v128;\n /** Computes the maximum of each 64-bit float lane of two 128-bit vectors. */\n export function max(a: v128, b: v128): v128;\n /** Computes the absolute value of each 64-bit float lane of a 128-bit vector. */\n export function abs(a: v128): v128;\n /** Computes the square root of each 64-bit float lane of a 128-bit vector. */\n export function sqrt(a: v128): v128;\n /** Computes which 64-bit float lanes of two 128-bit vectors are equal. */\n export function eq(a: v128, b: v128): v128;\n /** Computes which 64-bit float lanes of two 128-bit vectors are not equal. */\n export function ne(a: v128, b: v128): v128;\n /** Computes which 64-bit float lanes of the first 128-bit vector are less than those of the second. */\n export function lt(a: v128, b: v128): v128;\n /** Computes which 64-bit float lanes of the first 128-bit vector are less than or equal those of the second. */\n export function le(a: v128, b: v128): v128;\n /** Computes which 64-bit float lanes of the first 128-bit vector are greater than those of the second. */\n export function gt(a: v128, b: v128): v128;\n /** Computes which 64-bit float lanes of the first 128-bit vector are greater than or equal those of the second. */\n export function ge(a: v128, b: v128): v128;\n /** Converts each 64-bit signed integer lane of a 128-bit vector to floating point. */\n export function convert_s_i64x2(a: v128): v128;\n /** Converts each 64-bit unsigned integer lane of a 128-bit vector to floating point. */\n export function convert_u_i64x2(a: v128): v128;\n}\ndeclare namespace v8x16 {\n /** Selects 8-bit lanes from either 128-bit vector according to the specified lane indexes. */\n export function shuffle(a: v128, b: v128, l0: u8, l1: u8, l2: u8, l3: u8, l4: u8, l5: u8, l6: u8, l7: u8, l8: u8, l9: u8, l10: u8, l11: u8, l12: u8, l13: u8, l14: u8, l15: u8): v128;\n}\n/** Macro type evaluating to the underlying native WebAssembly type. */\ndeclare type native = T;\n\n/** Pseudo-class representing the backing class of integer types. */\ndeclare class _Integer {\n /** Smallest representable value. */\n static readonly MIN_VALUE: number;\n /** Largest representable value. */\n static readonly MAX_VALUE: number;\n /** Converts a string to an integer of this type. */\n static parseInt(value: string, radix?: number): number;\n /** Converts this integer to a string. */\n toString(): string;\n}\n\n/** Pseudo-class representing the backing class of floating-point types. */\ndeclare class _Float {\n /** Difference between 1 and the smallest representable value greater than 1. */\n static readonly EPSILON: f32 | f64;\n /** Smallest representable value. */\n static readonly MIN_VALUE: f32 | f64;\n /** Largest representable value. */\n static readonly MAX_VALUE: f32 | f64;\n /** Smallest safely representable integer value. */\n static readonly MIN_SAFE_INTEGER: f32 | f64;\n /** Largest safely representable integer value. */\n static readonly MAX_SAFE_INTEGER: f32 | f64;\n /** Value representing positive infinity. */\n static readonly POSITIVE_INFINITY: f32 | f64;\n /** Value representing negative infinity. */\n static readonly NEGATIVE_INFINITY: f32 | f64;\n /** Value representing \'not a number\'. */\n static readonly NaN: f32 | f64;\n /** Returns a boolean value that indicates whether a value is the reserved value NaN (not a number). */\n static isNaN(value: f32 | f64): bool;\n /** Returns true if passed value is finite. */\n static isFinite(value: f32 | f64): bool;\n /** Returns true if the value passed is a safe integer. */\n static isSafeInteger(value: f32 | f64): bool;\n /** Returns true if the value passed is an integer, false otherwise. */\n static isInteger(value: f32 | f64): bool;\n /** Converts a string to an integer. */\n static parseInt(value: string, radix?: i32): f32 | f64;\n /** Converts a string to a floating-point number. */\n static parseFloat(value: string): f32 | f64;\n /** Converts this floating-point number to a string. */\n toString(this: f64): string;\n}\n\n/** Backing class of signed 8-bit integers. */\ndeclare const I8: typeof _Integer;\n/** Backing class of signed 16-bit integers. */\ndeclare const I16: typeof _Integer;\n/** Backing class of signed 32-bit integers. */\ndeclare const I32: typeof _Integer;\n/** Backing class of signed 64-bit integers. */\ndeclare const I64: typeof _Integer;\n/** Backing class of signed size integers. */\ndeclare const Isize: typeof _Integer;\n/** Backing class of unsigned 8-bit integers. */\ndeclare const U8: typeof _Integer;\n/** Backing class of unsigned 16-bit integers. */\ndeclare const U16: typeof _Integer;\n/** Backing class of unsigned 32-bit integers. */\ndeclare const U32: typeof _Integer;\n/** Backing class of unsigned 64-bit integers. */\ndeclare const U64: typeof _Integer;\n/** Backing class of unsigned size integers. */\ndeclare const Usize: typeof _Integer;\n/** Backing class of 32-bit floating-point values. */\ndeclare const F32: typeof _Float;\n/** Backing class of 64-bit floating-point values. */\ndeclare const F64: typeof _Float;\n\n// User-defined diagnostic macros\n\n/** Emits a user-defined diagnostic error when encountered. */\ndeclare function ERROR(message?: any): void;\n/** Emits a user-defined diagnostic warning when encountered. */\ndeclare function WARNING(message?: any): void;\n/** Emits a user-defined diagnostic info when encountered. */\ndeclare function INFO(message?: any): void;\n\n// Polyfills\n\n/** Performs the sign-agnostic reverse bytes **/\ndeclare function bswap(value: T): T;\n/** Performs the sign-agnostic reverse bytes only for last 16-bit **/\ndeclare function bswap16(value: T): T;\n\n// Standard library\n\n/** Memory operations. */\ndeclare namespace memory {\n /** Returns the current memory size in units of pages. One page is 64kb. */\n export function size(): i32;\n /** Grows linear memory by a given unsigned delta of pages. One page is 64kb. Returns the previous memory size in units of pages or `-1` on failure. */\n export function grow(value: i32): i32;\n /** Sets n bytes beginning at the specified destination in memory to the specified byte value. */\n export function fill(dst: usize, value: u8, count: usize): void;\n /** Copies n bytes from the specified source to the specified destination in memory. These regions may overlap. */\n export function copy(dst: usize, src: usize, n: usize): void;\n /** Copies elements from a passive element segment to a table. */\n // export function init(segmentIndex: u32, srcOffset: usize, dstOffset: usize, n: usize): void;\n /** Prevents further use of a passive element segment. */\n // export function drop(segmentIndex: u32): void;\n /** Copies elements from one region of a table to another region. */\n export function allocate(size: usize): usize;\n /** Disposes a chunk of memory by its pointer. */\n export function free(ptr: usize): void;\n /** Compares two chunks of memory. Returns `0` if equal, otherwise the difference of the first differing bytes. */\n export function compare(vl: usize, vr: usize, n: usize): i32;\n /** Resets the allocator to its initial state, if supported. */\n export function reset(): void;\n}\n\n/** Garbage collector operations. */\ndeclare namespace gc {\n /** Allocates a managed object identified by its visitor function. */\n export function allocate(size: usize, visitFn: (ref: usize) => void): usize;\n /** Performs a full garbage collection cycle. */\n export function collect(): void;\n}\n\n/** Table operations. */\ndeclare namespace table {\n /** Copies elements from a passive element segment to a table. */\n // export function init(elementIndex: u32, srcOffset: u32, dstOffset: u32, n: u32): void;\n /** Prevents further use of a passive element segment. */\n // export function drop(elementIndex: u32): void;\n /** Copies elements from one region of a table to another region. */\n // export function copy(dest: u32, src: u32, n: u32): void;\n}\n\n/** Class representing a generic, fixed-length raw binary data buffer. */\ndeclare class ArrayBuffer {\n /** The size, in bytes, of the array. */\n readonly byteLength: i32;\n /** Unsafe pointer to the start of the data in memory. */\n readonly data: usize;\n /** Returns true if value is one of the ArrayBuffer views, such as typed array or a DataView **/\n static isView(value: T): bool;\n /** Constructs a new array buffer of the given length in bytes. */\n constructor(length: i32, unsafe?: bool);\n /** Returns a copy of this array buffer\'s bytes from begin, inclusive, up to end, exclusive. */\n slice(begin?: i32, end?: i32): ArrayBuffer;\n /** Returns a string representation of ArrayBuffer. */\n toString(): string;\n}\n\n/** The `DataView` view provides a low-level interface for reading and writing multiple number types in a binary `ArrayBuffer`, without having to care about the platform\'s endianness. */\ndeclare class DataView {\n /** The `buffer` accessor property represents the `ArrayBuffer` or `SharedArrayBuffer` referenced by the `DataView` at construction time. */\n readonly buffer: ArrayBuffer;\n /** The `byteLength` accessor property represents the length (in bytes) of this view from the start of its `ArrayBuffer` or `SharedArrayBuffer`. */\n readonly byteLength: i32;\n /** The `byteOffset` accessor property represents the offset (in bytes) of this view from the start of its `ArrayBuffer` or `SharedArrayBuffer`. */\n readonly byteOffset: i32;\n /** Constructs a new `DataView` with the given properties */\n constructor(buffer: ArrayBuffer, byteOffset?: i32, byteLength?: i32);\n /** The `getFloat32()` method gets a signed 32-bit float (float) at the specified byte offset from the start of the `DataView`. */\n getFloat32(byteOffset: i32, littleEndian?: boolean): f32;\n /** The `getFloat64()` method gets a signed 64-bit float (double) at the specified byte offset from the start of the `DataView`. */\n getFloat64(byteOffset: i32, littleEndian?: boolean): f64;\n /** The `getInt8()` method gets a signed 8-bit integer (byte) at the specified byte offset from the start of the `DataView`. */\n getInt8(byteOffset: i32): i8;\n /** The `getInt16()` method gets a signed 16-bit integer (short) at the specified byte offset from the start of the `DataView`. */\n getInt16(byteOffset: i32, littleEndian?: boolean): i16;\n /** The `getInt32()` method gets a signed 32-bit integer (long) at the specified byte offset from the start of the `DataView`. */\n getInt32(byteOffset: i32, littleEndian?: boolean): i32;\n /** The `getInt64()` method gets a signed 64-bit integer (long long) at the specified byte offset from the start of the `DataView`. */\n getInt64(byteOffset: i32, littleEndian?: boolean): i64;\n /** The `getUint8()` method gets an unsigned 8-bit integer (unsigned byte) at the specified byte offset from the start of the `DataView`. */\n getUint8(byteOffset: i32): u8;\n /** The `getUint16()` method gets an unsigned 16-bit integer (unsigned short) at the specified byte offset from the start of the `DataView`. */\n getUint16(byteOffset: i32, littleEndian?: boolean): u16;\n /** The `getUint32()` method gets an unsigned 32-bit integer (unsigned long) at the specified byte offset from the start of the `DataView`. */\n getUint32(byteOffset: i32, littleEndian?: boolean): u32;\n /** The `getUint64()` method gets an unsigned 64-bit integer (unsigned long long) at the specified byte offset from the start of the `DataView`. */\n getUint64(byteOffset: i32, littleEndian?: boolean): u64;\n /** The `setFloat32()` method stores a signed 32-bit float (float) value at the specified byte offset from the start of the `DataView`. */\n setFloat32(byteOffset: i32, value: f32, littleEndian?: boolean): void;\n /** The `setFloat64()` method stores a signed 64-bit float (double) value at the specified byte offset from the start of the `DataView`. */\n setFloat64(byteOffset: i32, value: f64, littleEndian?: boolean): void;\n /** The `setInt8()` method stores a signed 8-bit integer (byte) value at the specified byte offset from the start of the `DataView`. */\n setInt8(byteOffset: i32, value: i8): void;\n /** The `setInt16()` method stores a signed 16-bit integer (short) value at the specified byte offset from the start of the `DataView`. */\n setInt16(byteOffset: i32, value: i16, littleEndian?: boolean): void;\n /** The `setInt32()` method stores a signed 32-bit integer (long) value at the specified byte offset from the start of the `DataView`. */\n setInt32(byteOffset: i32, value: i32, littleEndian?: boolean): void;\n /** The `setInt64()` method stores a signed 64-bit integer (long long) value at the specified byte offset from the start of the `DataView`. */\n setInt64(byteOffset: i32, value: i64, littleEndian?: boolean): void;\n /** The `setUint8()` method stores an unsigned 8-bit integer (byte) value at the specified byte offset from the start of the `DataView`. */\n setUint8(byteOffset: i32, value: u8): void;\n /** The `setUint16()` method stores an unsigned 16-bit integer (unsigned short) value at the specified byte offset from the start of the `DataView`. */\n setUint16(byteOffset: i32, value: u16, littleEndian?: boolean): void;\n /** The `setUint32()` method stores an unsigned 32-bit integer (unsigned long) value at the specified byte offset from the start of the `DataView`. */\n setUint32(byteOffset: i32, value: u32, littleEndian?: boolean): void;\n /** The `setUint64()` method stores an unsigned 64-bit integer (unsigned long long) value at the specified byte offset from the start of the `DataView`. */\n setUint64(byteOffset: i32, value: u64, littleEndian?: boolean): void;\n /** Returns a string representation of DataView. */\n toString(): string;\n}\n\ninterface ArrayLike {\n length: i32;\n // [key: number]: T;\n}\n\n/** Interface for a typed view on an array buffer. */\ninterface ArrayBufferView {\n [key: number]: T;\n /** The {@link ArrayBuffer} referenced by this view. */\n readonly buffer: ArrayBuffer;\n /** The offset in bytes from the start of the referenced {@link ArrayBuffer}. */\n readonly byteOffset: i32;\n /** The length in bytes from the start of the referenced {@link ArrayBuffer}. */\n readonly byteLength: i32;\n}\n\n/* @internal */\ndeclare abstract class TypedArray implements ArrayBufferView {\n [key: number]: T;\n /** Number of bytes per element. */\n static readonly BYTES_PER_ELEMENT: usize;\n /** Constructs a new typed array. */\n constructor(length: i32);\n /** The {@link ArrayBuffer} referenced by this view. */\n readonly buffer: ArrayBuffer;\n /** The offset in bytes from the start of the referenced {@link ArrayBuffer}. */\n readonly byteOffset: i32;\n /** The length in bytes from the start of the referenced {@link ArrayBuffer}. */\n readonly byteLength: i32;\n /** The length (in elements). */\n readonly length: i32;\n /** Returns a new TypedArray of this type on the same ArrayBuffer from begin inclusive to end exclusive. */\n subarray(begin?: i32, end?: i32): this;\n /** The reduce() method applies a function against an accumulator and each value of the typed array (from left-to-right) has to reduce it to a single value. This method has the same algorithm as Array.prototype.reduce(). */\n reduce(\n callbackfn: (accumulator: W, value: T, index: i32, self: this) => W,\n initialValue: W,\n ): W;\n /** The reduceRight() method applies a function against an accumulator and each value of the typed array (from left-to-right) has to reduce it to a single value, starting from the end of the array. This method has the same algorithm as Array.prototype.reduceRight(). */\n reduceRight(\n callbackfn: (accumulator: W, value: T, index: i32, self: this) => W,\n initialValue: W,\n ): W;\n /** The some() method tests whether some element in the typed array passes the test implemented by the provided function. This method has the same algorithm as Array.prototype.some().*/\n some(callbackfn: (value: T, index: i32, self: this) => bool): bool;\n /** The map() method creates a new typed array with the results of calling a provided function on every element in this typed array. This method has the same algorithm as Array.prototype.map().*/\n map(callbackfn: (value: T, index: i32, self: this) => T): this;\n /** The sort() method sorts the elements of a typed array numerically in place and returns the typed array. This method has the same algorithm as Array.prototype.sort(), except that sorts the values numerically instead of as strings. TypedArray is one of the typed array types here. */\n sort(callback?: (a: T, b: T) => i32): this;\n /** The fill() method fills all the elements of a typed array from a start index to an end index with a static value. This method has the same algorithm as Array.prototype.fill(). */\n fill(value: T, start?: i32, end?: i32): this;\n /** The findIndex() method returns an index in the typed array, if an element in the typed array satisfies the provided testing function. Otherwise -1 is returned. See also the find() [not implemented] method, which returns the value of a found element in the typed array instead of its index. */\n findIndex(callbackfn: (value: T, index: i32, self: this) => bool): i32;\n /** The every() method tests whether all elements in the typed array pass the test implemented by the provided function. This method has the same algorithm as Array.prototype.every(). */\n every(callbackfn: (value: T, index: i32, self: this) => bool): bool;\n /** The forEach() method executes a provided function once per array element. This method has the same algorithm as Array.prototype.forEach().*/\n forEach(callbackfn: (value: T, index: i32, self: this) => void): void;\n /** The reverse() method reverses a typed array in place. The first typed array element becomes the last and the last becomes the first. This method has the same algorithm as Array.prototype.reverse(). */\n reverse(): this;\n}\n\n/** An array of twos-complement 8-bit signed integers. */\ndeclare class Int8Array extends TypedArray {}\n/** An array of 8-bit unsigned integers. */\ndeclare class Uint8Array extends TypedArray {}\n/** A clamped array of 8-bit unsigned integers. */\ndeclare class Uint8ClampedArray extends TypedArray {}\n/** An array of twos-complement 16-bit signed integers. */\ndeclare class Int16Array extends TypedArray {}\n/** An array of 16-bit unsigned integers. */\ndeclare class Uint16Array extends TypedArray {}\n/** An array of twos-complement 32-bit signed integers. */\ndeclare class Int32Array extends TypedArray {}\n/** An array of 32-bit unsigned integers. */\ndeclare class Uint32Array extends TypedArray {}\n/** An array of twos-complement 64-bit signed integers. */\ndeclare class Int64Array extends TypedArray {}\n/** An array of 64-bit unsigned integers. */\ndeclare class Uint64Array extends TypedArray {}\n/** An array of 32-bit floating point numbers. */\ndeclare class Float32Array extends TypedArray {}\n/** An array of 64-bit floating point numbers. */\ndeclare class Float64Array extends TypedArray {}\n\n/** Class representing a sequence of values of type `T`. */\ndeclare class Array {\n\n static isArray(value: any): value is Array;\n\n [key: number]: T;\n /** Current length of the array. */\n length: i32;\n /** Constructs a new array. */\n constructor(capacity?: i32);\n\n fill(value: T, start?: i32, end?: i32): this;\n every(callbackfn: (element: T, index: i32, array?: Array) => bool): bool;\n findIndex(predicate: (element: T, index: i32, array?: Array) => bool): i32;\n includes(searchElement: T, fromIndex?: i32): bool;\n indexOf(searchElement: T, fromIndex?: i32): i32;\n lastIndexOf(searchElement: T, fromIndex?: i32): i32;\n push(element: T): i32;\n concat(items: T[]): T[];\n copyWithin(target: i32, start: i32, end?: i32): this;\n pop(): T;\n forEach(callbackfn: (value: T, index: i32, array: Array) => void): void;\n map(callbackfn: (value: T, index: i32, array: Array) => U): Array;\n filter(callbackfn: (value: T, index: i32, array: Array) => bool): Array;\n reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: i32, array: Array) => U, initialValue: U): U;\n reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: i32, array: Array) => U, initialValue: U): U;\n shift(): T;\n some(callbackfn: (element: T, index: i32, array?: Array) => bool): bool;\n unshift(element: T): i32;\n slice(from: i32, to?: i32): Array;\n splice(start: i32, deleteCount?: i32): Array;\n sort(comparator?: (a: T, b: T) => i32): this;\n join(separator?: string): string;\n reverse(): T[];\n toString(): string;\n}\n\n/** Class representing a sequence of characters. */\ndeclare class String {\n\n static fromCharCode(ls: i32, hs?: i32): string;\n static fromCharCodes(arr: u16[]): string;\n static fromCodePoint(code: i32): string;\n static fromCodePoints(arr: i32[]): string;\n\n readonly length: i32;\n readonly lengthUTF8: i32;\n\n charAt(index: u32): string;\n charCodeAt(index: u32): u16;\n concat(other: string): string;\n endsWith(other: string): bool;\n indexOf(other: string, fromIndex?: i32): u32;\n lastIndexOf(other: string, fromIndex?: i32): i32;\n includes(other: string): bool;\n startsWith(other: string): bool;\n substr(start: u32, length?: u32): string;\n substring(start: u32, end?: u32): string;\n trim(): string;\n trimLeft(): string;\n trimRight(): string;\n trimStart(): string;\n trimEnd(): string;\n padStart(targetLength: i32, padString?: string): string;\n padEnd(targetLength: i32, padString?: string): string;\n repeat(count?: i32): string;\n slice(beginIndex: i32, endIndex?: i32): string;\n split(separator?: string, limit?: i32): string[];\n toString(): string;\n static fromUTF8(ptr: usize, len: usize): string;\n toUTF8(): usize;\n}\n\n/** Class for representing a runtime error. Base class of all errors. */\ndeclare class Error {\n\n /** Error name. */\n name: string;\n\n /** Message provided on construction. */\n message: string;\n\n /** Stack trace. */\n stack?: string;\n\n /** Constructs a new error, optionally with a message. */\n constructor(message?: string);\n\n /** Method returns a string representing the specified Error class. */\n toString(): string;\n}\n\n/** Class for indicating an error when a value is not in the set or range of allowed values. */\ndeclare class RangeError extends Error { }\n\n/** Class for indicating an error when a value is not of the expected type. */\ndeclare class TypeError extends Error { }\n\n/** Class for indicating an error when trying to interpret syntactically invalid code. */\ndeclare class SyntaxError extends Error { }\n\ninterface Boolean {}\ninterface Function {}\ninterface IArguments {}\ninterface Number {}\ninterface Object {}\ninterface RegExp {}\n\ndeclare class Map {\n readonly size: i32;\n has(key: K): bool;\n set(key: K, value: V): void;\n get(key: K): V;\n delete(key: K): bool;\n clear(): void;\n toString(): string;\n}\n\ndeclare class Set {\n readonly size: i32;\n has(value: T): bool;\n add(value: T): void;\n delete(value: T): bool;\n clear(): void;\n toString(): string;\n}\n\ninterface SymbolConstructor {\n readonly hasInstance: symbol;\n readonly isConcatSpreadable: symbol;\n readonly isRegExp: symbol;\n readonly iterator: symbol;\n readonly match: symbol;\n readonly replace: symbol;\n readonly search: symbol;\n readonly species: symbol;\n readonly split: symbol;\n readonly toPrimitive: symbol;\n readonly toStringTag: symbol;\n readonly unscopables: symbol;\n (description?: string | null): symbol;\n for(key: string): symbol;\n keyFor(sym: symbol): string | null;\n}\n\ndeclare const Symbol: SymbolConstructor;\n\ninterface IMath {\n /** The base of natural logarithms, e, approximately 2.718. */\n readonly E: T;\n /** The natural logarithm of 2, approximately 0.693. */\n readonly LN2: T;\n /** The natural logarithm of 10, approximately 2.302. */\n readonly LN10: T;\n /** The base 2 logarithm of e, approximately 1.442. */\n readonly LOG2E: T;\n /** The base 10 logarithm of e, approximately 0.434. */\n readonly LOG10E: T;\n /** The ratio of the circumference of a circle to its diameter, approximately 3.14159. */\n readonly PI: T;\n /** The square root of 1/2, approximately 0.707. */\n readonly SQRT1_2: T;\n /** The square root of 2, approximately 1.414. */\n readonly SQRT2: T;\n /** Returns the absolute value of `x`. */\n abs(x: T): T;\n /** Returns the arccosine (in radians) of `x`. */\n acos(x: T): T;\n /** Returns the hyperbolic arc-cosine of `x`. */\n acosh(x: T): T;\n /** Returns the arcsine (in radians) of `x` */\n asin(x: T): T;\n /** Returns the hyperbolic arcsine of `x`. */\n asinh(x: T): T;\n /** Returns the arctangent (in radians) of `x`. */\n atan(x: T): T;\n /** Returns the arctangent of the quotient of its arguments. */\n atan2(y: T, x: T): T;\n /** Returns the hyperbolic arctangent of `x`. */\n atanh(x: T): T;\n /** Returns the cube root of `x`. */\n cbrt(x: T): T;\n /** Returns the smallest integer greater than or equal to `x`. */\n ceil(x: T): T;\n /** Returns the number of leading zero bits in the 32-bit binary representation of `x`. */\n clz32(x: T): T;\n /** Returns the cosine (in radians) of `x`. */\n cos(x: T): T;\n /** Returns the hyperbolic cosine of `x`. */\n cosh(x: T): T;\n /** Returns e to the power of `x`. */\n exp(x: T): T;\n /** Returns e to the power of `x`, minus 1. */\n expm1(x: T): T;\n /** Returns the largest integer less than or equal to `x`. */\n floor(x: T): T;\n /** Returns the nearest 32-bit single precision float representation of `x`. */\n fround(x: T): f32;\n /** Returns the square root of the sum of squares of its arguments. */\n hypot(value1: T, value2: T): T; // TODO: rest\n /** Returns the result of the C-like 32-bit multiplication of `a` and `b`. */\n imul(a: T, b: T): T;\n /** Returns the natural logarithm (base e) of `x`. */\n log(x: T): T;\n /** Returns the base 10 logarithm of `x`. */\n log10(x: T): T;\n /** Returns the natural logarithm (base e) of 1 + `x`. */\n log1p(x: T): T;\n /** Returns the base 2 logarithm of `x`. */\n log2(x: T): T;\n /** Returns the largest-valued number of its arguments. */\n max(value1: T, value2: T): T; // TODO: rest\n /** Returns the lowest-valued number of its arguments. */\n min(value1: T, value2: T): T; // TODO: rest\n /** Returns `base` to the power of `exponent`. */\n pow(base: T, exponent: T): T;\n /** Returns a pseudo-random number in the range from 0.0 inclusive up to but not including 1.0. */\n random(): T;\n /** Returns the value of `x` rounded to the nearest integer. */\n round(x: T): T;\n /** Returns the sign of `x`, indicating whether the number is positive, negative or zero. */\n sign(x: T): T;\n /** Returns whether the sign bit of `x` is set */\n signbit(x: T): bool;\n /** Returns the sine of `x`. */\n sin(x: T): T;\n /** Returns the hyperbolic sine of `x`. */\n sinh(x: T): T;\n /** Returns the square root of `x`. */\n sqrt(x: T): T;\n /** Returns the tangent of `x`. */\n tan(x: T): T;\n /** Returns the hyperbolic tangent of `x`. */\n tanh(x: T): T;\n /** Returns the integer part of `x` by removing any fractional digits. */\n trunc(x: T): T;\n}\n\ninterface INativeMath extends IMath {\n /** Contains sin value produced after Math/Mathf.sincos */\n sincos_sin: T;\n /** Contains cos value produced after Math/Mathf.sincos */\n sincos_cos: T;\n /** Seeds the random number generator. */\n seedRandom(value: i64): void;\n /** Returns the floating-point remainder of `x / y` (rounded towards zero). */\n mod(x: T, y: T): T;\n /** Returns the floating-point remainder of `x / y` (rounded to nearest). */\n rem(x: T, y: T): T;\n /** Returns sin and cos simultaneously for same angle. Results stored to `sincos_s32/64` and `sincos_c32/64` globals */\n sincos(x: T): void;\n}\n\n/** Double precision math imported from JavaScript. */\ndeclare const JSMath: IMath;\n/** Double precision math implemented natively. */\ndeclare const NativeMath: INativeMath;\n/** Single precision math implemented natively. */\ndeclare const NativeMathf: INativeMath;\n/** Alias of {@link NativeMath} or {@link JSMath} respectively. Defaults to `NativeMath`. */\ndeclare const Math: IMath;\n/** Alias of {@link NativeMathf} or {@link JSMath} respectively. Defaults to `NativeMathf`. */\ndeclare const Mathf: IMath;\n\ndeclare class Date {\n /** Returns the UTC timestamp in milliseconds of the specified date. */\n static UTC(\n year: i32,\n month: i32,\n day: i32,\n hour: i32,\n minute: i32,\n second: i32,\n millisecond: i32\n ): i64;\n /** Returns the current UTC timestamp in milliseconds. */\n static now(): i64;\n /** Constructs a new date object from an UTC timestamp in milliseconds. */\n constructor(value: i64);\n /** Returns the UTC timestamp of this date in milliseconds. */\n getTime(): i64;\n /** Sets the UTC timestamp of this date in milliseconds. */\n setTime(value: i64): i64;\n}\n\n/** Environmental tracing function for debugging purposes. */\ndeclare function trace(msg: string, n?: i32, a0?: f64, a1?: f64, a2?: f64, a3?: f64, a4?: f64): void;\n\n// Decorators\n\ninterface TypedPropertyDescriptor {\n configurable?: boolean;\n enumerable?: boolean;\n writable?: boolean;\n value?: T;\n get?(): T;\n set?(value: T): void;\n}\n\n/** Annotates an element as a program global. */\ndeclare function global(\n target: any,\n propertyKey: string,\n descriptor: TypedPropertyDescriptor\n): TypedPropertyDescriptor | void;\n\n/** Annotates a method as a binary operator overload for the specified `token`. */\ndeclare function operator(token:\n "[]" | "[]=" | "{}" | "{}=" | "==" | "!=" | ">" | "<" | "<=" | ">=" |\n ">>" | ">>>" | "<<" | "&" | "|" | "^" | "+" | "-" | "*" | "**" | "/" | "%"\n): (\n target: any,\n propertyKey: string,\n descriptor: TypedPropertyDescriptor\n) => TypedPropertyDescriptor | void;\n\ndeclare namespace operator {\n /** Annotates a method as a binary operator overload for the specified `token`. */\n export function binary(token:\n "[]" | "[]=" | "{}" | "{}=" | "==" | "!=" | ">" | "<" | "<=" | ">=" |\n ">>" | ">>>" | "<<" | "&" | "|" | "^" | "+" | "-" | "*" | "**" | "/" | "%"\n ): (\n target: any,\n propertyKey: string,\n descriptor: TypedPropertyDescriptor\n ) => TypedPropertyDescriptor | void;\n /** Annotates a method as an unary prefix operator overload for the specified `token`. */\n export function prefix(token: "!" | "~" | "+" | "-" | "++" | "--"): (\n target: any,\n propertyKey: string,\n descriptor: TypedPropertyDescriptor\n ) => TypedPropertyDescriptor | void;\n /** Annotates a method as an unary postfix operator overload for the specified `token`. */\n export function postfix(token: "++" | "--"): (\n target: any,\n propertyKey: string,\n descriptor: TypedPropertyDescriptor\n ) => TypedPropertyDescriptor | void;\n}\n\n/** Annotates a class as being unmanaged with limited capabilities. */\ndeclare function unmanaged(constructor: Function): void;\n\n/** Annotates a class as being sealed / non-derivable. */\ndeclare function sealed(constructor: Function): void;\n\n/** Annotates a method, function or constant global as always inlined. */\ndeclare function inline(\n target: any,\n propertyKey: string,\n descriptor: TypedPropertyDescriptor\n): TypedPropertyDescriptor | void;\n\n/** Annotates an explicit external name of a function or global. */\ndeclare function external(namespace: string, name: string): (\n target: any,\n propertyKey: string,\n descriptor: TypedPropertyDescriptor\n) => TypedPropertyDescriptor | void;\n\n/** Annotates a global for lazy compilation. */\ndeclare function lazy(\n target: any,\n propertyKey: string,\n descriptor: TypedPropertyDescriptor\n): TypedPropertyDescriptor | void;\n\n/** Annotates a function as the explicit start function. */\ndeclare function start(\n target: any,\n propertyKey: string,\n descriptor: TypedPropertyDescriptor\n): TypedPropertyDescriptor | void;\n',portable:"/**\n * Environment definitions for compiling AssemblyScript to JavaScript using tsc.\n *\n * Note that semantic differences require additional explicit conversions for full compatibility.\n * For example, when casting an i32 to an u8, doing `(someI32 & 0xff)` will yield the same\n * result when compiling to WebAssembly or JS while `someI32` alone does nothing in JS.\n *\n * Note that i64's are not portable (JS numbers are IEEE754 doubles with a maximum safe integer\n * value of 2^53-1) and instead require a compatibility layer to work in JS as well, as for example\n * {@link glue/js/i64} respectively {@link glue/wasm/i64}.\n *\n * @module std/portable\n *//***/\n\n/// \n\n// Types\n\ndeclare type bool = boolean;\ndeclare type i8 = number;\ndeclare type i16 = number;\ndeclare type i32 = number;\ndeclare type isize = number;\ndeclare type u8 = number;\ndeclare type u16 = number;\ndeclare type u32 = number;\ndeclare type usize = number;\ndeclare type f32 = number;\ndeclare type f64 = number;\n\n// Compiler hints\n\n/** Compiler target. 0 = JS, 1 = WASM32, 2 = WASM64. */\ndeclare const ASC_TARGET: i32;\n/** Provided noAssert option. */\ndeclare const ASC_NO_ASSERT: bool;\n/** Provided memoryBase option. */\ndeclare const ASC_MEMORY_BASE: i32;\n/** Provided optimizeLevel option. */\ndeclare const ASC_OPTIMIZE_LEVEL: i32;\n/** Provided shrinkLevel option. */\ndeclare const ASC_SHRINK_LEVEL: i32;\n/** Whether the mutable global feature is enabled. */\ndeclare const ASC_FEATURE_MUTABLE_GLOBAL: bool;\n/** Whether the sign extension feature is enabled. */\ndeclare const ASC_FEATURE_SIGN_EXTENSION: bool;\n\n// Builtins\n\n/** Performs the sign-agnostic count leading zero bits operation on a 32-bit integer. All zero bits are considered leading if the value is zero. */\ndeclare function clz(value: T): T;\n/** Performs the sign-agnostic count tailing zero bits operation on a 32-bit integer. All zero bits are considered trailing if the value is zero. */\ndeclare function ctz(value: T): T;\n/** Performs the sign-agnostic count number of one bits operation on a 32-bit integer. */\ndeclare function popcnt(value: T): T;\n/** Performs the sign-agnostic rotate left operation on a 32-bit integer. */\ndeclare function rotl(value: T, shift: T): T;\n/** Performs the sign-agnostic rotate right operation on a 32-bit integer. */\ndeclare function rotr(value: T, shift: T): T;\n/** Computes the absolute value of an integer or float. */\ndeclare function abs(value: T): T;\n/** Determines the maximum of two integers or floats. If either operand is `NaN`, returns `NaN`. */\ndeclare function max(left: T, right: T): T;\n/** Determines the minimum of two integers or floats. If either operand is `NaN`, returns `NaN`. */\ndeclare function min(left: T, right: T): T;\n/** Composes a 32-bit or 64-bit float from the magnitude of `x` and the sign of `y`. */\ndeclare function copysign(x: T, y: T): T;\n/** Performs the ceiling operation on a 32-bit or 64-bit float. */\ndeclare function ceil(value: T): T;\n/** Performs the floor operation on a 32-bit or 64-bit float. */\ndeclare function floor(value: T): T;\n/** Rounds to the nearest integer tied to even of a 32-bit or 64-bit float. */\ndeclare function nearest(value: T): T;\n/** Selects one of two pre-evaluated values depending on the condition. */\ndeclare function select(ifTrue: T, ifFalse: T, condition: bool): T;\n/** Calculates the square root of a 32-bit or 64-bit float. */\ndeclare function sqrt(value: T): T;\n/** Rounds to the nearest integer towards zero of a 32-bit or 64-bit float. */\ndeclare function trunc(value: T): T;\n/** Loads a value of the specified type from memory. Type must be `u8`. */\ndeclare function load(ptr: usize, constantOffset?: usize): T;\n/** Stores a value of the specified type to memory. Type must be `u8`. */\ndeclare function store(ptr: usize, value: T, constantOffset?: usize): void;\n/** Emits an unreachable operation that results in a runtime error when executed. */\ndeclare function unreachable(): any; // sic\n\n/** NaN (not a number) as a 32-bit or 64-bit float depending on context. */\ndeclare const NaN: f32 | f64;\n/** Positive infinity as a 32-bit or 64-bit float depending on context. */\ndeclare const Infinity: f32 | f64;\n/** Changes the type of any value of `usize` kind to another one of `usize` kind. Useful for casting class instances to their pointer values and vice-versa. Beware that this is unsafe.*/\ndeclare function changetype(value: any): T;\n/** Explicitly requests no bounds checks on the provided expression. Useful for array accesses. */\ndeclare function unchecked(value: T): T;\n/** Tests if a 32-bit or 64-bit float is `NaN`. */\ndeclare function isNaN(value: T): bool;\n/** Tests if a 32-bit or 64-bit float is finite, that is not `NaN` or +/-`Infinity`. */\ndeclare function isFinite(value: T): bool;\n/** Tests if the specified value is a valid integer. Can't distinguish an integer from an integral float. */\ndeclare function isInteger(value: any): value is number;\n/** Tests if the specified value is a valid float. Can't distinguish a float from an integer. */\ndeclare function isFloat(value: any): value is number;\n/** Tests if the specified value is of a nullable reference type. */\ndeclare function isNullable(value: any): bool;\n/** Tests if the specified value is of a reference type. */\ndeclare function isReference(value: any): value is object | string;\n/** Tests if the specified value is of a function type */\ndeclare function isFunction(value: any): value is Function;\n/** Tests if the specified value can be used as a string. */\ndeclare function isString(value: any): value is string | String;\n/** Tests if the specified value can be used as an array. */\ndeclare function isArray(value: any): value is Array;\n/** Tests if the specified type *or* expression can be used as an array like object. */\ndeclare function isArrayLike(value: any): value is ArrayLike;\n/** Tests if the specified expression resolves to a defined element. */\ndeclare function isDefined(expression: any): bool;\n/** Tests if the specified expression evaluates to a constant value. */\ndeclare function isConstant(expression: any): bool;\n/** Traps if the specified value is not true-ish, otherwise returns the value. */\ndeclare function assert(isTrueish: T | null, message?: string): T;\n/** Parses an integer string to a 64-bit float. */\ndeclare function parseInt(str: string, radix?: i32): f64;\n/** Parses an integer string to a 32-bit integer. */\ndeclare function parseI32(str: string, radix?: i32): i32;\n/** Parses a floating point string to a 64-bit float. */\ndeclare function parseFloat(str: string): f64;\n/** Returns the 64-bit floating-point remainder of `x/y`. */\ndeclare function fmod(x: f64, y: f64): f64;\n/** Returns the 32-bit floating-point remainder of `x/y`. */\ndeclare function fmodf(x: f32, y: f32): f32;\n\n/** Converts any other numeric value to an 8-bit signed integer. */\ndeclare function i8(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): i8;\ndeclare namespace i8 {\n /** Smallest representable value. */\n export const MIN_VALUE: i8;\n /** Largest representable value. */\n export const MAX_VALUE: i8;\n /** Converts a string to a floating-point number and cast to target integer after. */\n export function parseFloat(string: string): i8;\n /** Converts A string to an integer. */\n export function parseInt(string: string, radix?: i32): i8;\n}\n/** Converts any other numeric value to a 16-bit signed integer. */\ndeclare function i16(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): i8;\ndeclare namespace i16 {\n /** Smallest representable value. */\n export const MIN_VALUE: i16;\n /** Largest representable value. */\n export const MAX_VALUE: i16;\n /** Converts a string to a floating-point number and cast to target integer after. */\n export function parseFloat(string: string): i16;\n /** Converts A string to an integer. */\n export function parseInt(string: string, radix?: i32): i16;\n}\n/** Converts any other numeric value to a 32-bit signed integer. */\ndeclare function i32(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): i32;\ndeclare namespace i32 {\n /** Smallest representable value. */\n export const MIN_VALUE: i32;\n /** Largest representable value. */\n export const MAX_VALUE: i32;\n /** Converts a string to a floating-point number and cast to target integer after. */\n export function parseFloat(string: string): i32;\n /** Converts A string to an integer. */\n export function parseInt(string: string, radix?: i32): i32;\n}\n/** Converts any other numeric value to a 32-bit (in WASM32) respectivel 64-bit (in WASM64) signed integer. */\ndeclare function isize(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): isize;\ndeclare namespace isize {\n /** Smallest representable value. */\n export const MIN_VALUE: isize;\n /** Largest representable value. */\n export const MAX_VALUE: isize;\n /** Converts a string to a floating-point number and cast to target integer after. */\n export function parseFloat(string: string): isize;\n /** Converts A string to an integer. */\n export function parseInt(string: string, radix?: i32): isize;\n}\n/** Converts any other numeric value to an 8-bit unsigned integer. */\ndeclare function u8(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): i8;\ndeclare namespace u8 {\n /** Smallest representable value. */\n export const MIN_VALUE: u8;\n /** Largest representable value. */\n export const MAX_VALUE: u8;\n /** Converts a string to a floating-point number and cast to target integer after. */\n export function parseFloat(string: string): u8;\n /** Converts A string to an integer. */\n export function parseInt(string: string, radix?: i32): u8;\n}\n/** Converts any other numeric value to a 16-bit unsigned integer. */\ndeclare function u16(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): i8;\ndeclare namespace u16 {\n /** Smallest representable value. */\n export const MIN_VALUE: u16;\n /** Largest representable value. */\n export const MAX_VALUE: u16;\n /** Converts a string to a floating-point number and cast to target integer after. */\n export function parseFloat(string: string): u16;\n /** Converts A string to an integer. */\n export function parseInt(string: string, radix?: i32): u16;\n}\n/** Converts any other numeric value to a 32-bit unsigned integer. */\ndeclare function u32(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): i32;\ndeclare namespace u32 {\n /** Smallest representable value. */\n export const MIN_VALUE: u32;\n /** Largest representable value. */\n export const MAX_VALUE: u32;\n /** Converts a string to a floating-point number and cast to target integer after. */\n export function parseFloat(string: string): u32;\n /** Converts A string to an integer. */\n export function parseInt(string: string, radix?: i32): u32;\n}\n/** Converts any other numeric value to a 32-bit (in WASM32) respectivel 64-bit (in WASM64) unsigned integer. */\ndeclare function usize(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): isize;\ndeclare namespace usize {\n /** Smallest representable value. */\n export const MIN_VALUE: usize;\n /** Largest representable value. */\n export const MAX_VALUE: usize;\n /** Converts a string to a floating-point number and cast to target integer after. */\n export function parseFloat(string: string): usize;\n /** Converts A string to an integer. */\n export function parseInt(string: string, radix?: i32): usize;\n}\n/** Converts any other numeric value to a 1-bit unsigned integer. */\ndeclare function bool(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): bool;\ndeclare namespace bool {\n /** Smallest representable value. */\n export const MIN_VALUE: bool;\n /** Largest representable value. */\n export const MAX_VALUE: bool;\n}\n/** Converts any other numeric value to a 32-bit float. */\ndeclare function f32(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): f32;\ndeclare namespace f32 {\n /** Smallest representable value. */\n export const MIN_VALUE: f32;\n /** Largest representable value. */\n export const MAX_VALUE: f32;\n /** Smallest normalized positive value. */\n export const MIN_POSITIVE_VALUE: f32;\n /** Smallest safely representable integer value. */\n export const MIN_SAFE_INTEGER: f32;\n /** Largest safely representable integer value. */\n export const MAX_SAFE_INTEGER: f32;\n /** Difference between 1 and the smallest representable value greater than 1. */\n export const EPSILON: f32;\n /** Returns a boolean value that indicates whether a value is the reserved value NaN (not a number). */\n export function isNaN(value: f32): bool;\n /** Returns true if passed value is finite. */\n export function isFinite(value: f32): bool;\n /** Returns true if the value passed is a safe integer. */\n export function isSafeInteger(value: f32): bool;\n /** Returns true if the value passed is an integer, false otherwise. */\n export function isInteger(value: f32): bool;\n /** Converts a string to a floating-point number. */\n export function parseFloat(string: string): f32;\n /** Converts A string to an integer. */\n export function parseInt(string: string, radix?: i32): f32;\n}\n/** Converts any other numeric value to a 64-bit float. */\ndeclare function f64(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): f64;\ndeclare namespace f64 {\n /** Smallest representable value. */\n export const MIN_VALUE: f64;\n /** Largest representable value. */\n export const MAX_VALUE: f64;\n /** Smallest normalized positive value. */\n export const MIN_POSITIVE_VALUE: f64;\n /** Smallest safely representable integer value. */\n export const MIN_SAFE_INTEGER: f64;\n /** Largest safely representable integer value. */\n export const MAX_SAFE_INTEGER: f64;\n /** Difference between 1 and the smallest representable value greater than 1. */\n export const EPSILON: f64;\n /** Returns a boolean value that indicates whether a value is the reserved value NaN (not a number). */\n export function isNaN(value: f32): bool;\n /** Returns true if passed value is finite. */\n export function isFinite(value: f32): bool;\n /** Returns true if the value passed is a safe integer. */\n export function isSafeInteger(value: f64): bool;\n /** Returns true if the value passed is an integer, false otherwise. */\n export function isInteger(value: f64): bool;\n /** Converts a string to a floating-point number. */\n export function parseFloat(string: string): f64;\n /** Converts A string to an integer. */\n export function parseInt(string: string, radix?: i32): f64;\n}\n\n// Polyfills\n\n/** [Polyfill] Performs the sign-agnostic reverse bytes **/\ndeclare function bswap(value: T): T;\n/** [Polyfill] Performs the sign-agnostic reverse bytes only for last 16-bit **/\ndeclare function bswap16(value: T): T;\n\n// Standard library\n\n/** Memory operations. */\ndeclare namespace memory {\n /** Allocates a chunk of memory of the specified size and returns a pointer to it. */\n function allocate(size: usize): usize;\n /** Disposes a chunk of memory by its pointer. */\n function free(ptr: usize): void;\n /** Copies n bytes from the specified source to the specified destination in memory. These regions may overlap. */\n function copy(dst: usize, src: usize, n: usize): void;\n /** Fills size bytes from from the specified destination by same value in memory. */\n function fill(dst: usize, value: u8, size: usize): void;\n /** Resets the allocator to its initial state, if supported. */\n function reset(): void;\n}\n\n/** Class representing a generic, fixed-length raw binary data buffer. */\ndeclare class ArrayBuffer {\n /** The size, in bytes, of the array. */\n readonly byteLength: i32;\n /** Returns true if value is one of the ArrayBuffer views, such as typed array or a DataView **/\n static isView(value: T): bool;\n /** Constructs a new array buffer of the given length in bytes. */\n constructor(length: i32);\n /** Returns a copy of this array buffer's bytes from begin, inclusive, up to end, exclusive. */\n slice(begin?: i32, end?: i32): ArrayBuffer;\n /** Returns a string representation of ArrayBuffer. */\n toString(): string;\n}\n\n/** The `DataView` view provides a low-level interface for reading and writing multiple number types in a binary `ArrayBuffer`, without having to care about the platform's endianness. */\ndeclare class DataView {\n /** The `buffer` accessor property represents the `ArrayBuffer` or `SharedArrayBuffer` referenced by the `DataView` at construction time. */\n readonly buffer: ArrayBuffer;\n /** The `byteLength` accessor property represents the length (in bytes) of this view from the start of its `ArrayBuffer` or `SharedArrayBuffer`. */\n readonly byteLength: i32;\n /** The `byteOffset` accessor property represents the offset (in bytes) of this view from the start of its `ArrayBuffer` or `SharedArrayBuffer`. */\n readonly byteOffset: i32;\n /** Constructs a new `DataView` with the given properties */\n constructor(buffer: ArrayBuffer, byteOffset?: i32, byteLength?: i32);\n /** The `getFloat32()` method gets a signed 32-bit float (float) at the specified byte offset from the start of the `DataView`. */\n getFloat32(byteOffset: i32, littleEndian?: boolean): f32;\n /** The `getFloat64()` method gets a signed 64-bit float (double) at the specified byte offset from the start of the `DataView`. */\n getFloat64(byteOffset: i32, littleEndian?: boolean): f64;\n /** The `getInt8()` method gets a signed 8-bit integer (byte) at the specified byte offset from the start of the `DataView`. */\n getInt8(byteOffset: i32): i8;\n /** The `getInt16()` method gets a signed 16-bit integer (short) at the specified byte offset from the start of the `DataView`. */\n getInt16(byteOffset: i32, littleEndian?: boolean): i16;\n /** The `getInt32()` method gets a signed 32-bit integer (long) at the specified byte offset from the start of the `DataView`. */\n getInt32(byteOffset: i32, littleEndian?: boolean): i32;\n /** The `getUint8()` method gets an unsigned 8-bit integer (unsigned byte) at the specified byte offset from the start of the `DataView`. */\n getUint8(byteOffset: i32): u8;\n /** The `getUint16()` method gets an unsigned 16-bit integer (unsigned short) at the specified byte offset from the start of the `DataView`. */\n getUint16(byteOffset: i32, littleEndian?: boolean): u16;\n /** The `getUint32()` method gets an unsigned 32-bit integer (unsigned long) at the specified byte offset from the start of the `DataView`. */\n getUint32(byteOffset: i32, littleEndian?: boolean): u32;\n /** The `setFloat32()` method stores a signed 32-bit float (float) value at the specified byte offset from the start of the `DataView`. */\n setFloat32(byteOffset: i32, value: f32, littleEndian?: boolean): void;\n /** The `setFloat64()` method stores a signed 64-bit float (double) value at the specified byte offset from the start of the `DataView`. */\n setFloat64(byteOffset: i32, value: f64, littleEndian?: boolean): void;\n /** The `setInt8()` method stores a signed 8-bit integer (byte) value at the specified byte offset from the start of the `DataView`. */\n setInt8(byteOffset: i32, value: i8): void;\n /** The `setInt16()` method stores a signed 16-bit integer (short) value at the specified byte offset from the start of the `DataView`. */\n setInt16(byteOffset: i32, value: i16, littleEndian?: boolean): void;\n /** The `setInt32()` method stores a signed 32-bit integer (long) value at the specified byte offset from the start of the `DataView`. */\n setInt32(byteOffset: i32, value: i32, littleEndian?: boolean): void;\n /** The `setUint8()` method stores an unsigned 8-bit integer (byte) value at the specified byte offset from the start of the `DataView`. */\n setUint8(byteOffset: i32, value: u8): void;\n /** The `setUint16()` method stores an unsigned 16-bit integer (unsigned short) value at the specified byte offset from the start of the `DataView`. */\n setUint16(byteOffset: i32, value: u16, littleEndian?: boolean): void;\n /** The `setUint32()` method stores an unsigned 32-bit integer (unsigned long) value at the specified byte offset from the start of the `DataView`. */\n setUint32(byteOffset: i32, value: u32, littleEndian?: boolean): void;\n /** Returns a string representation of DataView. */\n toString(): string;\n}\n\ndeclare class Array {\n\n static isArray(value: any): value is Array;\n\n [key: number]: T;\n length: i32;\n constructor(capacity?: i32);\n\n fill(value: T, start?: i32, end?: i32): this;\n every(callbackfn: (element: T, index: i32, array?: Array) => bool): bool;\n findIndex(predicate: (element: T, index: i32, array?: Array) => bool): i32;\n includes(searchElement: T, fromIndex?: i32): bool;\n indexOf(searchElement: T, fromIndex?: i32): i32;\n lastIndexOf(searchElement: T, fromIndex?: i32): i32;\n push(element: T): i32;\n concat(items: T[]): T[];\n copyWithin(target: i32, start: i32, end?: i32): this;\n pop(): T;\n forEach(callbackfn: (value: T, index: i32, array: Array) => void): void;\n map(callbackfn: (value: T, index: i32, array: Array) => U): Array;\n filter(callbackfn: (value: T, index: i32, array: Array) => bool): Array;\n reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: i32, array: Array) => U, initialValue: U): U;\n reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: i32, array: Array) => U, initialValue: U): U;\n shift(): T;\n some(callbackfn: (element: T, index: i32, array?: Array) => bool): bool;\n unshift(element: T): i32;\n slice(from?: i32, to?: i32): Array;\n splice(start: i32, deleteCount?: i32): Array;\n sort(comparator?: (a: T, b: T) => i32): this;\n join(separator?: string): string;\n reverse(): T[];\n toString(): string;\n}\n\ndeclare class Uint8Array extends Array {}\ndeclare class Uint8ClampedArray extends Array {}\ndeclare class Uint16Array extends Array {}\ndeclare class Uint32Array extends Array {}\ndeclare class Int8Array extends Array {}\ndeclare class Int16Array extends Array {}\ndeclare class Int32Array extends Array {}\ndeclare class Float32Array extends Array {}\ndeclare class Float64Array extends Array {}\n\ninterface ArrayLike {\n length: i32;\n [key: number]: T;\n}\n\n/** Interface for a typed view on an array buffer. */\ninterface ArrayBufferView {\n [key: number]: T;\n /** The {@link ArrayBuffer} referenced by this view. */\n readonly buffer: ArrayBuffer;\n /** The offset in bytes from the start of the referenced {@link ArrayBuffer}. */\n readonly byteOffset: i32;\n /** The length in bytes from the start of the referenced {@link ArrayBuffer}. */\n readonly byteLength: i32;\n}\n\ndeclare class String {\n\n static fromCharCode(ls: i32, hs?: i32): string;\n static fromCharCodes(arr: u16[]): string;\n static fromCodePoint(code: i32): string;\n static fromCodePoints(arr: i32[]): string;\n\n readonly length: i32;\n\n private constructor();\n\n charAt(index: i32): string;\n charCodeAt(index: i32): i32;\n concat(other: string): string;\n indexOf(other: string, fromIndex?: i32): i32;\n lastIndexOf(other: string, fromIndex?: i32): i32;\n includes(other: string): bool;\n startsWith(other: string): bool;\n endsWith(other: string): bool;\n substr(start: u32, length?: u32): string;\n substring(from: i32, to?: i32): string;\n trim(): string;\n trimLeft(): string;\n trimRight(): string;\n trimStart(): string;\n trimEnd(): string;\n padStart(targetLength: i32, padString?: string): string;\n padEnd(targetLength: i32, padString?: string): string;\n replace(search: string, replacement: string): string;\n repeat(count?: i32): string;\n slice(beginIndex: i32, endIndex?: i32): string;\n split(separator?: string, limit?: i32): string[];\n toString(): string;\n}\n\ninterface Boolean {}\n\ndeclare class Number {\n private constructor();\n toString(radix?: i32): string;\n}\n\ninterface Object {}\n\ninterface Function {}\n\ninterface RegExp {}\n\ninterface IArguments {}\n\n/** Class for representing a runtime error. Base class of all errors. */\ndeclare class Error {\n\n /** Error name. */\n name: string;\n\n /** Message provided on construction. */\n message: string;\n\n /** Stack trace. */\n stack?: string;\n\n /** Constructs a new error, optionally with a message. */\n constructor(message?: string);\n\n /** Method returns a string representing the specified Error class. */\n toString(): string;\n}\n\n/** Class for indicating an error when a value is not in the set or range of allowed values. */\ndeclare class RangeError extends Error { }\n\n/** Class for indicating an error when a value is not of the expected type. */\ndeclare class TypeError extends Error { }\n\n/** Class for indicating an error when trying to interpret syntactically invalid code. */\ndeclare class SyntaxError extends Error { }\n\ndeclare class Set {\n constructor(entries?: T[]);\n readonly size: i32;\n has(value: T): bool;\n add(value: T): void;\n delete(value: T): bool;\n clear(): void;\n toString(): string;\n [Symbol.iterator](): Iterator;\n}\n\ndeclare class Map {\n constructor(entries?: [K, V][]);\n readonly size: i32;\n set(key: K, value: V): void;\n has(key: K): bool;\n get(key: K): V | null;\n clear(): void;\n entries(): Iterable<[K, V]>;\n keys(): Iterable;\n values(): Iterable;\n delete(key: K): bool;\n toString(): string;\n [Symbol.iterator](): Iterator<[K,V]>;\n}\n\ninterface SymbolConstructor {\n readonly hasInstance: symbol;\n readonly isConcatSpreadable: symbol;\n readonly isRegExp: symbol;\n readonly iterator: symbol;\n readonly match: symbol;\n readonly replace: symbol;\n readonly search: symbol;\n readonly species: symbol;\n readonly split: symbol;\n readonly toPrimitive: symbol;\n readonly toStringTag: symbol;\n readonly unscopables: symbol;\n (description?: string | null): symbol;\n for(key: string): symbol;\n keyFor(sym: symbol): string | null;\n}\ndeclare const Symbol: SymbolConstructor;\n\ninterface Iterable {\n [Symbol.iterator](): Iterator;\n}\n\ninterface Iterator {}\n\ninterface IMath {\n readonly E: f64;\n readonly LN2: f64;\n readonly LN10: f64;\n readonly LOG2E: f64;\n readonly LOG10E: f64;\n readonly PI: f64;\n readonly SQRT1_2: f64;\n readonly SQRT2: f64;\n\n sincos_sin: f64;\n sincos_cos: f64;\n\n abs(x: f64): f64;\n acos(x: f64): f64;\n acosh(x: f64): f64;\n asin(x: f64): f64;\n asinh(x: f64): f64;\n atan(x: f64): f64;\n atan2(y: f64, x: f64): f64;\n atanh(x: f64): f64;\n cbrt(x: f64): f64;\n ceil(x: f64): f64;\n clz32(x: f64): i32;\n cos(x: f64): f64;\n cosh(x: f64): f64;\n exp(x: f64): f64;\n expm1(x: f64): f64;\n floor(x: f64): f64;\n fround(x: f64): f32;\n hypot(value1: f64, value2: f64): f64; // TODO: see std/math\n imul(a: f64, b: f64): i32;\n log(x: f64): f64;\n log10(x: f64): f64;\n log1p(x: f64): f64;\n log2(x: f64): f64;\n max(value1: f64, value2: f64): f64; // TODO: see std/math\n min(value1: f64, value2: f64): f64; // TODO: see std/math\n pow(base: f64, exponent: f64): f64;\n random(): f64;\n round(x: f64): f64;\n sign(x: f64): f64;\n signbit(x: f64): bool;\n sin(x: f64): f64;\n sincos(x: f64): f64;\n sinh(x: f64): f64;\n sqrt(x: f64): f64;\n tan(x: f64): f64;\n tanh(x: f64): f64;\n trunc(x: f64): f64;\n}\n\ndeclare const Math: IMath;\ndeclare const Mathf: IMath;\ndeclare const JSMath: IMath;\n\ndeclare class Date {\n /** Returns the UTC timestamp in milliseconds of the specified date. */\n static UTC(\n year: i32,\n month: i32,\n day: i32,\n hour: i32,\n minute: i32,\n second: i32,\n millisecond: i32\n ): number;\n /** Returns the current UTC timestamp in milliseconds. */\n static now(): number;\n /** Constructs a new date object from an UTC timestamp in milliseconds. */\n constructor(value: number);\n /** Returns the UTC timestamp of this date in milliseconds. */\n getTime(): number;\n /** Sets the UTC timestamp of this date in milliseconds. */\n setTime(value: number): number;\n}\n\ndeclare namespace console {\n /** @deprecated */\n function log(message: string): void;\n}\n"}):(()=>{const e=path.join(".","..","std");return{assembly:fs.readFileSync(path.join(e,"assembly","index.d.ts"),"utf8"),portable:fs.readFileSync(path.join(e,"portable","index.d.ts"),"utf8")}})(),exports.compileString=((e,n)=>{"string"==typeof e&&(e={"input.ts":e});const t=Object.create({stdout:createMemoryStream(),stderr:createMemoryStream()});var i=["--binaryFile","binary","--textFile","text"];return Object.keys(n||{}).forEach(e=>{var t=n[e];Array.isArray(t)?t.forEach(n=>i.push("--"+e,String(n))):i.push("--"+e,String(t))}),exports.main(i.concat(Object.keys(e)),{stdout:t.stdout,stderr:t.stderr,readFile:n=>e.hasOwnProperty(n)?e[n]:null,writeFile:(e,n)=>t[e]=n,listFiles:()=>[]}),t}),exports.main=function(e,n,t){"function"==typeof n?(t=n,n={}):n||(n={});const i=n.stdout||process.stdout,r=n.stderr||process.stderr,a=n.readFile||F,o=n.writeFile||z,s=n.listFiles||I,l=n.stats||createStats();if(!i)throw Error("'options.stdout' must be specified");if(!r)throw Error("'options.stderr' must be specified");const f=optionsUtil.parse(e,exports.options),u=f.options;if(e=f.arguments,u.noColors?colorsUtil.stdout.supported=colorsUtil.stderr.supported=!1:(colorsUtil.stdout=colorsUtil.from(i),colorsUtil.stderr=colorsUtil.from(r)),f.unknown.length&&f.unknown.forEach(e=>{r.write(colorsUtil.stderr.yellow("WARN: ")+"Unknown option '"+e+"'"+EOL)}),f.trailing.length&&r.write(colorsUtil.stderr.yellow("WARN: ")+"Unsupported trailing arguments: "+f.trailing.join(" ")+EOL),t||(t=function(e){var n=0;return e&&(r.write(colorsUtil.stderr.red("ERROR: ")+e.stack.replace(/^ERROR: /i,"")+EOL),n=1),n}),u.version)return i.write("Version "+exports.version+(isDev?"-dev":"")+EOL),t(null);if(u.help||!e.length){var c=u.help?i:r,p=u.help?colorsUtil.stdout:colorsUtil.stderr;return c.write([p.white("SYNTAX")," "+p.cyan("asc")+" [entryFile ...] [options]","",p.white("EXAMPLES")," "+p.cyan("asc")+" hello.ts"," "+p.cyan("asc")+" hello.ts -b hello.wasm -t hello.wat"," "+p.cyan("asc")+" hello1.ts hello2.ts -b -O > hello.wasm","",p.white("OPTIONS")].concat(optionsUtil.help(exports.options,24,EOL)).join(EOL)+EOL),t(null)}if(!fs.readFileSync){if(a===F)throw Error("'options.readFile' must be specified");if(o===z)throw Error("'options.writeFile' must be specified");if(s===I)throw Error("'options.listFiles' must be specified")}const d=u.baseDir?path.resolve(u.baseDir):".",h=[];u.transform&&u.transform.forEach(e=>h.push(__webpack_require__(12)(path.isAbsolute(e=e.trim())?e:path.join(process.cwd(),e))));var x=null;u.noLib?(l.parseCount++,l.parseTime+=measure(()=>{x=assemblyscript.parseFile(exports.libraryFiles.builtins,exports.libraryPrefix+"builtins.ts",!1,x)})):Object.keys(exports.libraryFiles).forEach(e=>{e.indexOf("/")>=0||(l.parseCount++,l.parseTime+=measure(()=>{x=assemblyscript.parseFile(exports.libraryFiles[e],exports.libraryPrefix+e+".ts",!1,x)}))});const b=[];if(u.lib){let e=u.lib;"string"==typeof e&&(e=e.split(",")),Array.prototype.push.apply(b,e.map(e=>e.trim()));for(let e=0,n=b.length;e{x=assemblyscript.parseFile(o,exports.libraryPrefix+r,!1,x)})}}}function g(){for(var e,n;null!=(e=x.nextFile());){if(e.startsWith(exports.libraryPrefix)){const t=e.substring(exports.libraryPrefix.length),i=e.substring(exports.libraryPrefix.length)+"/index";if(exports.libraryFiles.hasOwnProperty(t))n=exports.libraryFiles[t],e=exports.libraryPrefix+t+".ts";else if(exports.libraryFiles.hasOwnProperty(i))n=exports.libraryFiles[i],e=exports.libraryPrefix+i+".ts";else for(let r=0,o=b.length;r{assemblyscript.parseFile(n,e,!1,x)})}if(checkDiagnostics(x,r))return t(Error("Parse error"))}for(let n=0,i=e.length;n{x=assemblyscript.parseFile(o,r,!0,x)});let s=g();if(s)return s}!function(e,...n){h.forEach(t=>{"function"==typeof t[e]&&t[e](...n)})}("afterParse",x);{let e=g();if(e)return e}const v=assemblyscript.finishParsing(x);var m=0,y=0;u.optimize&&(m=exports.defaultOptimizeLevel,y=exports.defaultShrinkLevel),"number"==typeof u.optimizeLevel&&(m=u.optimizeLevel),"number"==typeof u.shrinkLevel&&(y=u.shrinkLevel),m=Math.min(Math.max(m,0),3),y=Math.min(Math.max(y,0),2);const _=assemblyscript.createOptions();if(assemblyscript.setTarget(_,0),assemblyscript.setNoAssert(_,u.noAssert),assemblyscript.setImportMemory(_,u.importMemory),assemblyscript.setSharedMemory(_,u.sharedMemory),assemblyscript.setImportTable(_,u.importTable),assemblyscript.setMemoryBase(_,u.memoryBase>>>0),assemblyscript.setSourceMap(_,null!=u.sourceMap),assemblyscript.setOptimizeLevelHints(_,m,y),u.noLib||(assemblyscript.setGlobalAlias(_,"Math","NativeMath"),assemblyscript.setGlobalAlias(_,"Mathf","NativeMathf"),assemblyscript.setGlobalAlias(_,"abort","~lib/env/abort"),assemblyscript.setGlobalAlias(_,"trace","~lib/env/trace")),u.use){let e=u.use;for(let n=0,i=e.length;n{try{l.compileTime+=measure(()=>{E=assemblyscript.compileProgram(v,_)})}catch(e){return t(e)}})(),checkDiagnostics(x,r))return E&&E.dispose(),t(Error("Compile error"));if(u.validate&&(l.validateCount++,l.validateTime+=measure(()=>{if(!E.validate())return E.dispose(),t(Error("Validate error"))})),"clamp"===u.trapMode)l.optimizeCount++,l.optimizeTime+=measure(()=>{E.runPasses(["trap-mode-clamp"])});else if("js"===u.trapMode)l.optimizeCount++,l.optimizeTime+=measure(()=>{E.runPasses(["trap-mode-js"])});else if("allow"!==u.trapMode)return E.dispose(),t(Error("Unsupported trap mode"));(m>=3||y>=2)&&(m=4),E.setOptimizeLevel(m),E.setShrinkLevel(y),E.setDebugInfo(u.debug);var A=[];if(u.runPasses&&("string"==typeof u.runPasses&&(u.runPasses=u.runPasses.split(",")),u.runPasses.length&&u.runPasses.forEach(e=>{A.indexOf(e)<0&&A.push(e)})),(m>0||y>0)&&(l.optimizeCount++,l.optimizeTime+=measure(()=>{E.optimize()})),A.length&&(l.optimizeCount++,l.optimizeTime+=measure(()=>{E.runPasses(A.map(e=>e.trim()))})),!u.noEmit){let e=!1,n=!1;if(null!=u.outFile&&(/\.was?t$/.test(u.outFile)&&null==u.textFile?u.textFile=u.outFile:/\.js$/.test(u.outFile)&&null==u.asmjsFile?u.asmjsFile=u.outFile:null==u.binaryFile&&(u.binaryFile=u.outFile)),null!=u.binaryFile){let i,s=null!=u.sourceMap?u.sourceMap.length?u.sourceMap:path.basename(u.binaryFile)+".map":null;if(l.emitCount++,l.emitTime+=measure(()=>{i=E.toBinary(s)}),u.binaryFile.length?o(u.binaryFile,i.output,d):(S(i.output),e=!0),n=!0,null!=i.sourceMap)if(u.binaryFile.length){let e=JSON.parse(i.sourceMap);e.sourceRoot=exports.sourceMapRoot,e.sources.forEach((n,i)=>{let r=null;if(n.startsWith(exports.libraryPrefix)){let e=n.substring(exports.libraryPrefix.length).replace(/\.ts$/,"");if(exports.libraryFiles.hasOwnProperty(e))r=exports.libraryFiles[e];else for(let e=0,t=b.length;e{t=E.toAsmjs()}),o(u.asmjsFile,t,d)):e||(l.emitCount++,l.emitTime+=measure(()=>{t=E.toAsmjs()}),S(t),e=!0),n=!0}if(null!=u.idlFile){let t;u.idlFile.length?(l.emitCount++,l.emitTime+=measure(()=>{t=assemblyscript.buildIDL(v)}),o(u.idlFile,t,d)):e||(l.emitCount++,l.emitTime+=measure(()=>{t=assemblyscript.buildIDL(v)}),S(t),e=!0),n=!0}if(null!=u.tsdFile){let t;u.tsdFile.length?(l.emitCount++,l.emitTime+=measure(()=>{t=assemblyscript.buildTSD(v)}),o(u.tsdFile,t,d)):e||(l.emitCount++,l.emitTime+=measure(()=>{t=assemblyscript.buildTSD(v)}),S(t),e=!0),n=!0}if(null!=u.textFile||!n){let n;u.textFile&&u.textFile.length?(l.emitCount++,l.emitTime+=measure(()=>{n=E.toText()}),o(u.textFile,n,d)):e||(l.emitCount++,l.emitTime+=measure(()=>{n=E.toText()}),S(n))}}return E.dispose(),u.measure&&printStats(l,r),t(null);function F(e,n){try{let t;return l.readCount++,l.readTime+=measure(()=>{t=fs.readFileSync(path.join(n,e),{encoding:"utf8"})}),t}catch(e){return null}}function z(e,n,t){try{return l.writeCount++,l.writeTime+=measure(()=>{mkdirp(path.join(t,path.dirname(e))),"string"==typeof n?fs.writeFileSync(path.join(t,e),n,{encoding:"utf8"}):fs.writeFileSync(path.join(t,e),n)}),!0}catch(e){return!1}}function I(e,n){var t;try{return l.readTime+=measure(()=>{t=fs.readdirSync(path.join(n,e)).filter(e=>/^(?!.*\.d\.ts$).*\.ts$/.test(e))}),t}catch(e){return[]}}function S(e){S.used||(l.writeCount++,S.used=!0),l.writeTime+=measure(()=>{"string"==typeof e?i.write(e,{encoding:"utf8"}):i.write(e)})}},exports.checkDiagnostics=checkDiagnostics,exports.createStats=createStats,process.hrtime||(process.hrtime=__webpack_require__(13)),exports.measure=measure,exports.formatTime=formatTime,exports.printStats=printStats;var allocBuffer=void 0!==global&&global.Buffer?global.Buffer.allocUnsafe||function(e){return new global.Buffer(e)}:function(e){return new Uint8Array(e)};function createMemoryStream(e){var n=[];return n.write=function(n){if(e&&e(n),"string"==typeof n){let e=allocBuffer(utf8.length(n));utf8.write(n,e,0),n=e}this.push(n)},n.reset=function(){n.length=0},n.toBuffer=function(){for(var e=0,n=0,t=this.length;n191&&i<224?a[o++]=(31&i)<<6|63&e[n++]:i>239&&i<365?(i=((7&i)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,a[o++]=55296+(i>>10),a[o++]=56320+(1023&i)):a[o++]=(15&i)<<12|(63&e[n++])<<6|63&e[n++],o>8191&&((r||(r=[])).push(String.fromCharCode.apply(String,a)),o=0);return r?(o&&r.push(String.fromCharCode.apply(String,a.slice(0,o))),r.join("")):String.fromCharCode.apply(String,a.slice(0,o))},i.write=function(e,n,t){for(var i,r,a=t,o=0;o>6|192,n[t++]=63&i|128):55296==(64512&i)&&56320==(64512&(r=e.charCodeAt(o+1)))?(i=65536+((1023&i)<<10)+(1023&r),++o,n[t++]=i>>18|240,n[t++]=i>>12&63|128,n[t++]=i>>6&63|128,n[t++]=63&i|128):(n[t++]=i>>12|224,n[t++]=i>>6&63|128,n[t++]=63&i|128);return t-a}},function(e,n,t){(function(e){var t=void 0!==e&&e||{},i=t.env&&"CI"in t.env;function r(e,t){var r=t||{};return r.supported=e&&!!e.isTTY||i,r.gray=(e=>r.supported?n.GRAY+e+n.RESET:e),r.red=(e=>r.supported?n.RED+e+n.RESET:e),r.green=(e=>r.supported?n.GREEN+e+n.RESET:e),r.yellow=(e=>r.supported?n.YELLOW+e+n.RESET:e),r.blue=(e=>r.supported?n.BLUE+e+n.RESET:e),r.magenta=(e=>r.supported?n.MAGENTA+e+n.RESET:e),r.cyan=(e=>r.supported?n.CYAN+e+n.RESET:e),r.white=(e=>r.supported?n.WHITE+e+n.RESET:e),r}n.stdout=r(t.stdout,n),n.stderr=r(t.stderr),n.from=r,n.GRAY="",n.RED="",n.GREEN="",n.YELLOW="",n.BLUE="",n.MAGENTA="",n.CYAN="",n.WHITE="",n.RESET=""}).call(this,t(0))},function(e,n){n.parse=function(e,n){var t={},i=[],arguments=[],r=[],a={};Object.keys(n).forEach(e=>{if(!e.startsWith(" ")){var i=n[e];null!=i.alias&&("string"==typeof i.alias?a[i.alias]=e:Array.isArray(i.alias)&&i.alias.forEach(n=>a[n]=e)),null!=i.default&&(t[e]=i.default)}});for(var o=0,s=(e=e.slice()).length;ot[e]=s.value[e])}else i.push(r)}for(;o{var o=e[n];if(null!=o.description){for(var s="";s.length{for(let n=0;n=0;r--){var i=n[r];"."===i?n.splice(r,1):".."===i?(n.splice(r,1),t++):t&&(n.splice(r,1),t--)}if(e)for(;t--;t)n.unshift("..");return n}var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,i=function(n){return r.exec(n).slice(1)};function o(n,e){if(n.filter)return n.filter(e);for(var t=[],r=0;r=-1&&!r;i--){var a=i>=0?arguments[i]:n.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(e=a+"/"+e,r="/"===a.charAt(0))}return(r?"/":"")+(e=t(o(e.split("/"),function(n){return!!n}),!r).join("/"))||"."},e.normalize=function(n){var r=e.isAbsolute(n),i="/"===a(n,-1);return(n=t(o(n.split("/"),function(n){return!!n}),!r).join("/"))||r||(n="."),n&&i&&(n+="/"),(r?"/":"")+n},e.isAbsolute=function(n){return"/"===n.charAt(0)},e.join=function(){var n=Array.prototype.slice.call(arguments,0);return e.normalize(o(n,function(n,e){if("string"!=typeof n)throw new TypeError("Arguments to path.join must be strings");return n}).join("/"))},e.relative=function(n,t){function r(n){for(var e=0;e=0&&""===n[t];t--);return e>t?[]:n.slice(e,t-e+1)}n=e.resolve(n).substr(1),t=e.resolve(t).substr(1);for(var i=r(n.split("/")),o=r(t.split("/")),a=Math.min(i.length,o.length),s=a,l=0;l{try{assemblyscript=__webpack_require__(10)}catch(e){try{__webpack_require__(!function(){var n=new Error("Cannot find module 'ts-node'");throw n.code="MODULE_NOT_FOUND",n}()).register({project:path.join(".","..","src","tsconfig.json")}),__webpack_require__(!function(){var n=new Error("Cannot find module '../src/glue/js'");throw n.code="MODULE_NOT_FOUND",n}()),assemblyscript=__webpack_require__(!function(){var n=new Error("Cannot find module '../src'");throw n.code="MODULE_NOT_FOUND",n}()),isDev=!0}catch(e_ts){try{assemblyscript=eval("require('./assemblyscript')")}catch(n){throw n.stack=e_ts.stack+"\n---\n"+n.stack,n}}}})(),exports.isBundle=!0,exports.isDev=isDev,exports.version=exports.isBundle?"0.7.0":__webpack_require__(!function(){var n=new Error("Cannot find module '../package.json'");throw n.code="MODULE_NOT_FOUND",n}()).version,exports.options=__webpack_require__(11),exports.sourceMapRoot="assemblyscript:///",exports.libraryPrefix=assemblyscript.LIBRARY_PREFIX,exports.defaultOptimizeLevel=3,exports.defaultShrinkLevel=1,exports.libraryFiles=exports.isBundle?Object({array:'/// \n\nimport { BLOCK_MAXSIZE } from "./rt/common";\nimport { COMPARATOR, SORT } from "./util/sort";\nimport { ArrayBuffer, ArrayBufferView } from "./arraybuffer";\nimport { itoa, dtoa, itoa_stream, dtoa_stream, MAX_DOUBLE_LENGTH } from "./util/number";\nimport { idof, isArray as builtin_isArray } from "./builtins";\nimport { E_INDEXOUTOFRANGE, E_INVALIDLENGTH, E_EMPTYARRAY, E_HOLEYARRAY } from "./util/error";\n\n/** Ensures that the given array has _at least_ the specified backing size. */\nfunction ensureSize(array: usize, minSize: usize, alignLog2: u32): void {\n var oldCapacity = changetype(array).dataLength;\n if (minSize > oldCapacity >>> alignLog2) {\n if (minSize > BLOCK_MAXSIZE >>> alignLog2) throw new RangeError(E_INVALIDLENGTH);\n let oldData = changetype(changetype(array).data);\n let newCapacity = minSize << alignLog2;\n let newData = __realloc(oldData, newCapacity);\n memory.fill(newData + oldCapacity, 0, newCapacity - oldCapacity);\n if (newData !== oldData) { // oldData has been free\'d\n store(changetype(array), __retain(newData), offsetof("data"));\n changetype(array).dataStart = newData;\n }\n changetype(array).dataLength = newCapacity;\n }\n}\n\nexport class Array extends ArrayBufferView {\n [key: number]: T;\n\n // Implementing ArrayBufferView isn\'t strictly necessary here but is done to allow glue code\n // to work with typed and normal arrays interchangeably. Technically, normal arrays do not need\n // `dataStart` (equals `data`) and `dataLength` (equals computed `data.byteLength`).\n\n // Also note that Array with non-nullable T must guard against implicit null values whenever\n // length is modified in a way that a null value would exist. Otherwise, the compiler wouldn\'t be\n // able to guarantee type-safety anymore. For lack of a better word, such an array is "holey".\n\n private length_: i32;\n\n static isArray(value: U): bool {\n return builtin_isArray(value) && value !== null;\n }\n\n static create(capacity: i32 = 0): Array {\n if (capacity > BLOCK_MAXSIZE >>> alignof()) throw new RangeError(E_INVALIDLENGTH);\n var array = changetype>(__allocArray(capacity, alignof(), idof())); // retains\n changetype>(array).length_ = 0; // safe even if T is a non-nullable reference\n memory.fill(array.dataStart, 0, array.dataLength);\n return array;\n }\n\n constructor(length: i32 = 0) {\n super(length, alignof());\n if (isReference()) {\n if (!isNullable()) {\n if (length) throw new Error(E_HOLEYARRAY);\n }\n }\n this.length_ = length;\n }\n\n @unsafe get buffer(): ArrayBuffer {\n return this.data;\n }\n\n get length(): i32 {\n return this.length_;\n }\n\n set length(newLength: i32) {\n var oldLength = this.length_;\n if (isReference()) {\n if (!isNullable()) {\n if (newLength > oldLength) throw new Error(E_HOLEYARRAY);\n }\n }\n ensureSize(changetype(this), newLength, alignof());\n if (isManaged()) { // release no longer used refs\n if (oldLength > newLength) {\n let dataStart = this.dataStart;\n do __release(load(dataStart + (--oldLength << alignof())));\n while (oldLength > newLength);\n // no need to zero memory on shrink -> is zeroed on grow\n }\n }\n this.length_ = newLength;\n }\n\n every(fn: (value: T, index: i32, array: Array) => bool): bool {\n for (let index = 0, length = this.length_; index < min(length, this.length_); ++index) {\n if (!fn(load(this.dataStart + (index << alignof())), index, this)) return false;\n }\n return true;\n }\n\n findIndex(predicate: (value: T, index: i32, array: Array) => bool): i32 {\n for (let index = 0, length = this.length_; index < min(length, this.length_); ++index) {\n if (predicate(load(this.dataStart + (index << alignof())), index, this)) return index;\n }\n return -1;\n }\n\n @operator("[]") private __get(index: i32): T {\n if (isReference()) {\n if (!isNullable()) {\n if (index >= this.length_) throw new Error(E_HOLEYARRAY);\n }\n }\n if (index >= this.dataLength >>> alignof()) throw new RangeError(E_INDEXOUTOFRANGE);\n return this.__unchecked_get(index);\n }\n\n @operator("{}") private __unchecked_get(index: i32): T {\n return load(this.dataStart + (index << alignof()));\n }\n\n @operator("[]=") private __set(index: i32, value: T): void {\n var length = this.length_;\n if (isReference()) {\n if (!isNullable()) {\n if (index > length) throw new Error(E_HOLEYARRAY);\n }\n }\n ensureSize(changetype(this), index + 1, alignof());\n this.__unchecked_set(index, value);\n if (index >= length) this.length_ = index + 1;\n }\n\n @operator("{}=") private __unchecked_set(index: i32, value: T): void {\n if (isManaged()) {\n let offset = this.dataStart + (index << alignof());\n let oldRef: usize = load(offset);\n if (changetype(value) != oldRef) {\n store(offset, __retain(changetype(value)));\n __release(oldRef);\n }\n } else {\n store(this.dataStart + (index << alignof()), value);\n }\n }\n\n fill(value: T, start: i32 = 0, end: i32 = i32.MAX_VALUE): this {\n var dataStart = this.dataStart;\n var length = this.length_;\n start = start < 0 ? max(length + start, 0) : min(start, length);\n end = end < 0 ? max(length + end, 0) : min(end, length);\n if (isManaged()) {\n for (; start < end; ++start) {\n let oldRef: usize = load(dataStart + (start << alignof()));\n if (changetype(value) != oldRef) {\n store(dataStart + (start << alignof()), __retain(changetype(value)));\n __release(oldRef);\n }\n }\n } else if (sizeof() == 1) {\n if (start < end) {\n memory.fill(\n dataStart + start,\n u8(value),\n (end - start)\n );\n }\n } else {\n for (; start < end; ++start) {\n store(dataStart + (start << alignof()), value);\n }\n }\n return this;\n }\n\n includes(value: T, fromIndex: i32 = 0): bool {\n return this.indexOf(value, fromIndex) >= 0;\n }\n\n indexOf(value: T, fromIndex: i32 = 0): i32 {\n var length = this.length_;\n if (length == 0 || fromIndex >= length) return -1;\n if (fromIndex < 0) fromIndex = max(length + fromIndex, 0);\n var dataStart = this.dataStart;\n while (fromIndex < length) {\n if (load(dataStart + (fromIndex << alignof())) == value) return fromIndex;\n ++fromIndex;\n }\n return -1;\n }\n\n lastIndexOf(value: T, fromIndex: i32 = this.length_): i32 {\n var length = this.length_;\n if (length == 0) return -1;\n if (fromIndex < 0) fromIndex = length + fromIndex;\n else if (fromIndex >= length) fromIndex = length - 1;\n var dataStart = this.dataStart;\n while (fromIndex >= 0) {\n if (load(dataStart + (fromIndex << alignof())) == value) return fromIndex;\n --fromIndex;\n }\n return -1;\n }\n\n push(value: T): i32 {\n var length = this.length_;\n var newLength = length + 1;\n ensureSize(changetype(this), newLength, alignof());\n if (isManaged()) {\n store(this.dataStart + (length << alignof()), __retain(changetype(value)));\n } else {\n store(this.dataStart + (length << alignof()), value);\n }\n this.length_ = newLength;\n return newLength;\n }\n\n concat(other: Array): Array {\n var thisLen = this.length_;\n var otherLen = select(0, other.length_, other === null);\n var outLen = thisLen + otherLen;\n if (outLen > BLOCK_MAXSIZE >>> alignof()) throw new Error(E_INVALIDLENGTH);\n var out = changetype>(__allocArray(outLen, alignof(), idof>())); // retains\n var outStart = out.dataStart;\n var thisSize = thisLen << alignof();\n if (isManaged()) {\n let thisStart = this.dataStart;\n for (let offset: usize = 0; offset < thisSize; offset += sizeof()) {\n let ref = load(thisStart + offset);\n store(outStart + offset, __retain(ref));\n }\n outStart += thisSize;\n let otherStart = other.dataStart;\n let otherSize = otherLen << alignof();\n for (let offset: usize = 0; offset < otherSize; offset += sizeof()) {\n let ref = load(otherStart + offset);\n store(outStart + offset, __retain(ref));\n }\n } else {\n memory.copy(outStart, this.dataStart, thisSize);\n memory.copy(outStart + thisSize, other.dataStart, otherLen << alignof());\n }\n return out;\n }\n\n copyWithin(target: i32, start: i32, end: i32 = i32.MAX_VALUE): this {\n var dataStart = this.dataStart;\n var len = this.length_;\n\n end = min(end, len);\n var to = target < 0 ? max(len + target, 0) : min(target, len);\n var from = start < 0 ? max(len + start, 0) : min(start, len);\n var last = end < 0 ? max(len + end, 0) : min(end, len);\n var count = min(last - from, len - to);\n\n if (isManaged()) {\n if (from < to && to < (from + count)) { // right to left\n from += count - 1;\n to += count - 1;\n while (count) {\n let oldRef: usize = load(dataStart + (to << alignof()));\n let newRef: usize = load(dataStart + (from << alignof()));\n if (newRef != oldRef) {\n store(dataStart + (to << alignof()), __retain(newRef));\n __release(oldRef);\n }\n --from, --to, --count;\n }\n } else { // left to right\n while (count) {\n let oldRef: usize = load(dataStart + (to << alignof()));\n let newRef: usize = load(dataStart + (from << alignof()));\n if (newRef != oldRef) {\n store(dataStart + (to << alignof()), __retain(newRef));\n __release(oldRef);\n }\n ++from, ++to, --count;\n }\n }\n } else {\n memory.copy( // is memmove\n dataStart + (to << alignof()),\n dataStart + (from << alignof()),\n count << alignof()\n );\n }\n return this;\n }\n\n pop(): T {\n var length = this.length_;\n if (length < 1) throw new RangeError(E_EMPTYARRAY);\n var element = load(this.dataStart + ((--length) << alignof()));\n this.length_ = length;\n return element; // no need to retain -> is moved\n }\n\n forEach(fn: (value: T, index: i32, array: Array) => void): void {\n for (let index = 0, length = this.length_; index < min(length, this.length_); ++index) {\n fn(load(this.dataStart + (index << alignof())), index, this);\n }\n }\n\n map(fn: (value: T, index: i32, array: Array) => U): Array {\n var length = this.length_;\n var out = changetype>(__allocArray(length, alignof(), idof>())); // retains\n var outStart = out.dataStart;\n for (let index = 0; index < min(length, this.length_); ++index) {\n let result = fn(load(this.dataStart + (index << alignof())), index, this); // retains\n if (isManaged()) {\n store(outStart + (index << alignof()), __retain(changetype(result)));\n } else {\n store(outStart + (index << alignof()), result);\n }\n // releases result\n }\n return out;\n }\n\n filter(fn: (value: T, index: i32, array: Array) => bool): Array {\n var result = changetype>(__allocArray(0, alignof(), idof>())); // retains\n for (let index = 0, length = this.length_; index < min(length, this.length_); ++index) {\n let value = load(this.dataStart + (index << alignof()));\n if (fn(value, index, this)) result.push(value);\n }\n return result;\n }\n\n reduce(\n fn: (previousValue: U, currentValue: T, currentIndex: i32, array: Array) => U,\n initialValue: U\n ): U {\n var accum = initialValue;\n for (let index = 0, length = this.length_; index < min(length, this.length_); ++index) {\n accum = fn(accum, load(this.dataStart + (index << alignof())), index, this);\n }\n return accum;\n }\n\n reduceRight(\n fn: (previousValue: U, currentValue: T, currentIndex: i32, array: Array) => U,\n initialValue: U\n ): U {\n var accum = initialValue;\n for (let index = this.length_ - 1; index >= 0; --index) {\n accum = fn(accum, load(this.dataStart + (index << alignof())), index, this);\n }\n return accum;\n }\n\n shift(): T {\n var length = this.length_;\n if (length < 1) throw new RangeError(E_EMPTYARRAY);\n var base = this.dataStart;\n var element = load(base);\n var lastIndex = length - 1;\n memory.copy(\n base,\n base + sizeof(),\n lastIndex << alignof()\n );\n store(base + (lastIndex << alignof()),\n // @ts-ignore: cast\n null\n );\n this.length_ = lastIndex;\n return element; // no need to retain -> is moved\n }\n\n some(fn: (value: T, index: i32, array: Array) => bool): bool {\n for (let index = 0, length = this.length_; index < min(length, this.length_); ++index) {\n if (fn(load(this.dataStart + (index << alignof())), index, this)) return true;\n }\n return false;\n }\n\n unshift(value: T): i32 {\n var newLength = this.length_ + 1;\n ensureSize(changetype(this), newLength, alignof());\n var dataStart = this.dataStart;\n memory.copy(\n dataStart + sizeof(),\n dataStart,\n (newLength - 1) << alignof()\n );\n if (isManaged()) {\n store(dataStart, __retain(changetype(value)));\n } else {\n store(dataStart, value);\n }\n this.length_ = newLength;\n return newLength;\n }\n\n slice(start: i32 = 0, end: i32 = i32.MAX_VALUE): Array {\n var length = this.length_;\n start = start < 0 ? max(start + length, 0) : min(start, length);\n end = end < 0 ? max(end + length, 0) : min(end , length);\n length = max(end - start, 0);\n var slice = changetype>(__allocArray(length, alignof(), idof>())); // retains\n var sliceBase = slice.dataStart;\n var thisBase = this.dataStart + (start << alignof());\n if (isManaged()) {\n let off = 0;\n let end = length << alignof();\n while (off < end) {\n let ref = load(thisBase + off);\n store(sliceBase + off, __retain(ref));\n off += sizeof();\n }\n } else {\n memory.copy(sliceBase, thisBase, length << alignof());\n }\n return slice;\n }\n\n splice(start: i32, deleteCount: i32 = i32.MAX_VALUE): Array {\n var length = this.length_;\n start = start < 0 ? max(length + start, 0) : min(start, length);\n deleteCount = max(min(deleteCount, length - start), 0);\n var result = changetype>(__allocArray(deleteCount, alignof(), idof>())); // retains\n var resultStart = result.dataStart;\n var thisStart = this.dataStart;\n var thisBase = thisStart + (start << alignof());\n if (isManaged()) {\n for (let i = 0; i < deleteCount; ++i) {\n store(resultStart + (i << alignof()),\n load(thisBase + (i << alignof()))\n );\n // no need to retain -> is moved\n }\n } else {\n memory.copy(\n resultStart,\n thisBase,\n deleteCount << alignof()\n );\n }\n var offset = start + deleteCount;\n if (length != offset) {\n memory.copy(\n thisBase,\n thisStart + (offset << alignof()),\n (length - offset) << alignof()\n );\n }\n this.length_ = length - deleteCount;\n return result;\n }\n\n reverse(): Array {\n var length = this.length_;\n if (length) {\n let front = this.dataStart;\n let back = this.dataStart + ((length - 1) << alignof());\n while (front < back) {\n let temp = load(front);\n store(front, load(back));\n store(back, temp);\n front += sizeof();\n back -= sizeof();\n }\n }\n return this;\n }\n\n sort(comparator: (a: T, b: T) => i32 = COMPARATOR()): this {\n var length = this.length_;\n if (length <= 1) return this;\n var base = this.dataStart;\n if (length == 2) {\n let a: T = load(base, sizeof()); // a = arr[1]\n let b: T = load(base); // b = arr[0]\n if (comparator(a, b) < 0) {\n store(base, b, sizeof()); // arr[1] = b;\n store(base, a); // arr[0] = a;\n }\n return this;\n }\n SORT(base, length, comparator);\n return this;\n }\n\n join(separator: string = ","): string {\n if (isBoolean()) return this.join_bool(separator);\n if (isInteger()) return this.join_int(separator);\n if (isFloat()) return this.join_flt(separator);\n if (isString()) return this.join_str(separator);\n if (isArray()) return this.join_arr(separator);\n if (isReference()) return this.join_ref(separator);\n ERROR("unspported element type");\n return unreachable();\n }\n\n private join_bool(separator: string = ","): string {\n var lastIndex = this.length_ - 1;\n if (lastIndex < 0) return "";\n var dataStart = this.dataStart;\n if (!lastIndex) return select("true", "false", load(dataStart));\n\n var sepLen = separator.length;\n var valueLen = 5; // max possible length of element len("false")\n var estLen = (valueLen + sepLen) * lastIndex + valueLen;\n var result = changetype(__alloc(estLen << 1, idof())); // retains\n var offset = 0;\n var value: bool;\n for (let i = 0; i < lastIndex; ++i) {\n value = load(dataStart + i);\n valueLen = 4 + i32(!value);\n memory.copy(\n changetype(result) + (offset << 1),\n changetype(select("true", "false", value)),\n valueLen << 1\n );\n offset += valueLen;\n if (sepLen) {\n memory.copy(\n changetype(result) + (offset << 1),\n changetype(separator),\n sepLen << 1\n );\n offset += sepLen;\n }\n }\n value = load(dataStart + lastIndex);\n valueLen = 4 + i32(!value);\n memory.copy(\n changetype(result) + (offset << 1),\n changetype(select("true", "false", value)),\n valueLen << 1\n );\n offset += valueLen;\n\n if (estLen > offset) return result.substring(0, offset);\n return result;\n }\n\n private join_int(separator: string = ","): string {\n var lastIndex = this.length_ - 1;\n if (lastIndex < 0) return "";\n var dataStart = this.dataStart;\n // @ts-ignore: type\n if (!lastIndex) return changetype(itoa(load(dataStart))); // retains\n\n var sepLen = separator.length;\n const valueLen = (sizeof() <= 4 ? 10 : 20) + i32(isSigned());\n var estLen = (valueLen + sepLen) * lastIndex + valueLen;\n var result = changetype(__alloc(estLen << 1, idof())); // retains\n var offset = 0;\n var value: T;\n for (let i = 0; i < lastIndex; ++i) {\n value = load(dataStart + (i << alignof()));\n // @ts-ignore: type\n offset += itoa_stream(changetype(result), offset, value);\n if (sepLen) {\n memory.copy(\n changetype(result) + (offset << 1),\n changetype(separator),\n sepLen << 1\n );\n offset += sepLen;\n }\n }\n value = load(dataStart + (lastIndex << alignof()));\n // @ts-ignore: type\n offset += itoa_stream(changetype(result), offset, value);\n if (estLen > offset) return result.substring(0, offset);\n return result;\n }\n\n private join_flt(separator: string = ","): string {\n var lastIndex = this.length_ - 1;\n if (lastIndex < 0) return "";\n var dataStart = this.dataStart;\n if (!lastIndex) {\n return changetype(dtoa(\n // @ts-ignore: type\n load(dataStart))\n ); // retains\n }\n\n const valueLen = MAX_DOUBLE_LENGTH;\n var sepLen = separator.length;\n var estLen = (valueLen + sepLen) * lastIndex + valueLen;\n var result = changetype(__alloc(estLen << 1, idof())); // retains\n var offset = 0;\n var value: T;\n for (let i = 0; i < lastIndex; ++i) {\n value = load(dataStart + (i << alignof()));\n offset += dtoa_stream(changetype(result), offset,\n // @ts-ignore: type\n value\n );\n if (sepLen) {\n memory.copy(\n changetype(result) + (offset << 1),\n changetype(separator),\n sepLen << 1\n );\n offset += sepLen;\n }\n }\n value = load(dataStart + (lastIndex << alignof()));\n offset += dtoa_stream(changetype(result), offset,\n // @ts-ignore: type\n value\n );\n if (estLen > offset) return result.substring(0, offset);\n return result;\n }\n\n private join_str(separator: string = ","): string {\n var lastIndex = this.length_ - 1;\n if (lastIndex < 0) return "";\n var dataStart = this.dataStart;\n if (!lastIndex) return load(dataStart);\n\n var sepLen = separator.length;\n var estLen = 0;\n var value: string | null;\n for (let i = 0, len = lastIndex + 1; i < len; ++i) {\n value = load(dataStart + (i << alignof()));\n if (value !== null) estLen += value.length;\n }\n var offset = 0;\n var result = changetype(__alloc((estLen + sepLen * lastIndex) << 1, idof())); // retains\n for (let i = 0; i < lastIndex; ++i) {\n value = load(dataStart + (i << alignof()));\n if (value !== null) {\n let valueLen = changetype(value).length;\n memory.copy(\n changetype(result) + (offset << 1),\n changetype(value),\n valueLen << 1\n );\n offset += valueLen;\n }\n if (sepLen) {\n memory.copy(\n changetype(result) + (offset << 1),\n changetype(separator),\n sepLen << 1\n );\n offset += sepLen;\n }\n }\n value = load(dataStart + (lastIndex << alignof()));\n if (value !== null) {\n memory.copy(\n changetype(result) + (offset << 1),\n changetype(value),\n changetype(value).length << 1\n );\n }\n return result;\n }\n\n private join_arr(separator: string = ","): string {\n var lastIndex = this.length_ - 1;\n if (lastIndex < 0) return "";\n\n var result = "";\n var sepLen = separator.length;\n var base = this.dataStart;\n var value: T;\n if (!lastIndex) {\n value = load(base);\n // @ts-ignore: type\n return value ? value.join(separator) : "";\n }\n for (let i = 0; i < lastIndex; ++i) {\n value = load(base + (i << alignof()));\n // @ts-ignore: type\n if (value) result += value.join(separator);\n if (sepLen) result += separator;\n }\n value = load(base + (lastIndex << alignof()));\n // @ts-ignore: type\n if (value) result += value.join(separator);\n return result; // registered by concatenation (FIXME: lots of garbage)\n }\n\n private join_ref(separator: string = ","): string {\n var lastIndex = this.length_ - 1;\n if (lastIndex < 0) return "";\n var base = this.dataStart;\n if (!lastIndex) return "[object Object]";\n\n const valueLen = 15; // max possible length of element len("[object Object]")\n var sepLen = separator.length;\n var estLen = (valueLen + sepLen) * lastIndex + valueLen;\n var result = changetype(__alloc(estLen << 1, idof()));\n var offset = 0;\n var value: T;\n for (let i = 0; i < lastIndex; ++i) {\n value = load(base + (i << alignof()));\n if (value) {\n memory.copy(\n changetype(result) + (offset << 1),\n changetype("[object Object]"),\n valueLen << 1\n );\n offset += valueLen;\n }\n if (sepLen) {\n memory.copy(\n changetype(result) + (offset << 1),\n changetype(separator),\n sepLen << 1\n );\n offset += sepLen;\n }\n }\n if (load(base + (lastIndex << alignof()))) {\n memory.copy(\n changetype(result) + (offset << 1),\n changetype("[object Object]"),\n valueLen << 1\n );\n offset += valueLen;\n }\n if (estLen > offset) return result.substring(0, offset);\n return result;\n }\n\n toString(): string {\n return this.join();\n }\n\n // RT integration\n\n @unsafe private __visit_impl(cookie: u32): void {\n if (isManaged()) {\n let cur = this.dataStart;\n let end = cur + (this.length_ << alignof());\n while (cur < end) {\n let val = load(cur);\n if (val) __visit(val, cookie);\n cur += sizeof();\n }\n }\n // automatically visits ArrayBufferView (.data) next\n }\n}\n',arraybuffer:'/// \n\nimport { BLOCK, BLOCK_MAXSIZE, BLOCK_OVERHEAD } from "./rt/common";\nimport { idof } from "./builtins";\nimport { E_INVALIDLENGTH } from "./util/error";\n\nexport abstract class ArrayBufferView {\n\n @unsafe data: ArrayBuffer;\n @unsafe dataStart: usize;\n @unsafe dataLength: u32;\n\n protected constructor(length: i32, alignLog2: i32) {\n if (length > BLOCK_MAXSIZE >>> alignLog2) throw new RangeError(E_INVALIDLENGTH);\n var buffer = __alloc(length = length << alignLog2, idof());\n this.data = changetype(buffer); // retains\n this.dataStart = buffer;\n this.dataLength = length;\n }\n\n get byteOffset(): i32 {\n return (this.dataStart - changetype(this.data));\n }\n\n get byteLength(): i32 {\n return this.dataLength;\n }\n\n get length(): i32 {\n ERROR("missing implementation: subclasses must implement ArrayBufferView#length");\n return unreachable();\n }\n}\n\n@sealed export class ArrayBuffer {\n\n static isView(value: T): bool {\n if (value) {\n if (value instanceof Int8Array) return true;\n if (value instanceof Uint8Array) return true;\n if (value instanceof Uint8ClampedArray) return true;\n if (value instanceof Int16Array) return true;\n if (value instanceof Uint16Array) return true;\n if (value instanceof Int32Array) return true;\n if (value instanceof Uint32Array) return true;\n if (value instanceof Int64Array) return true;\n if (value instanceof Uint64Array) return true;\n if (value instanceof Float32Array) return true;\n if (value instanceof Float64Array) return true;\n if (value instanceof DataView) return true;\n }\n return false;\n }\n\n constructor(length: i32) {\n if (length > BLOCK_MAXSIZE) throw new RangeError(E_INVALIDLENGTH);\n var buffer = __alloc(length, idof());\n memory.fill(buffer, 0, length);\n return changetype(buffer); // retains\n }\n\n get byteLength(): i32 {\n return changetype(changetype(this) - BLOCK_OVERHEAD).rtSize;\n }\n\n slice(begin: i32 = 0, end: i32 = BLOCK_MAXSIZE): ArrayBuffer {\n var length = this.byteLength;\n begin = begin < 0 ? max(length + begin, 0) : min(begin, length);\n end = end < 0 ? max(length + end , 0) : min(end , length);\n var outSize = max(end - begin, 0);\n var out = __alloc(outSize, idof());\n memory.copy(out, changetype(this) + begin, outSize);\n return changetype(out); // retains\n }\n\n toString(): string {\n return "[object ArrayBuffer]";\n }\n}\n',"bindings/Date":"export declare function UTC(\n // NOTE: Using i32 below saves us a f64.convert_s instruction and moves the responsibility for\n // converting the value to the WASM/JS boundary.\n year: i32,\n month: i32,\n day: i32,\n hour: i32,\n minute: i32,\n second: i32,\n millisecond: f64\n): f64;\nexport declare function now(): f64;\n","bindings/Math":"export declare const E: f64;\nexport declare const LN2: f64;\nexport declare const LN10: f64;\nexport declare const LOG2E: f64;\nexport declare const LOG10E: f64;\nexport declare const PI: f64;\nexport declare const SQRT1_2: f64;\nexport declare const SQRT2: f64;\n\nexport declare function abs(x: f64): f64;\nexport declare function acos(x: f64): f64;\nexport declare function acosh(x: f64): f64;\nexport declare function asin(x: f64): f64;\nexport declare function asinh(x: f64): f64;\nexport declare function atan(x: f64): f64;\nexport declare function atan2(y: f64, x: f64): f64;\nexport declare function atanh(x: f64): f64;\nexport declare function cbrt(x: f64): f64;\nexport declare function ceil(x: f64): f64;\nexport declare function clz32(x: f64): f64;\nexport declare function cos(x: f64): f64;\nexport declare function cosh(x: f64): f64;\nexport declare function exp(x: f64): f64;\nexport declare function expm1(x: f64): f64;\nexport declare function floor(x: f64): f64;\nexport declare function fround(x: f64): f32;\nexport declare function hypot(value1: f64, value2: f64): f64; // TODO: rest\nexport declare function imul(a: f64, b: f64): f64;\nexport declare function log(x: f64): f64;\nexport declare function log10(x: f64): f64;\nexport declare function log1p(x: f64): f64;\nexport declare function log2(x: f64): f64;\nexport declare function max(value1: f64, value2: f64): f64; // TODO: rest\nexport declare function min(value1: f64, value2: f64): f64; // TODO: rest\nexport declare function pow(base: f64, exponent: f64): f64;\nexport declare function random(): f64;\nexport declare function round(x: f64): f64;\nexport declare function sign(x: f64): f64;\nexport declare function sin(x: f64): f64;\nexport declare function sinh(x: f64): f64;\nexport declare function sqrt(x: f64): f64;\nexport declare function tan(x: f64): f64;\nexport declare function tanh(x: f64): f64;\nexport declare function trunc(x: f64): f64;\n","bindings/wasi_unstable":"// see: https://wasi.dev\n\n/* tslint:disable:max-line-length */\n\n// helper types to be more explicit\ntype char = u8;\ntype ptr = usize; // all pointers are usize'd\ntype struct = T; // structs are references already in AS\n\n/** Read command-line argument data. */\nexport declare function args_get(\n /** Input: Pointer to a buffer to write the argument pointers. */\n argv: ptr>,\n /** Input: Pointer to a buffer to write the argument string data. */\n argv_buf: ptr\n): errno;\n\n/** Return command-line argument data sizes. */\nexport declare function args_sizes_get(\n /** Output: Number of arguments. */\n argc: ptr,\n /** Output: Size of the argument string data. */\n argv_buf_size: ptr\n): errno;\n\n/** Return the resolution of a clock. */\nexport declare function clock_res_get(\n /** Input: The clock for which to return the resolution. */\n clock: clockid,\n /** Output: The resolution of the clock. */\n resolution: ptr\n): errno;\n\n/** Return the time value of a clock. */\nexport declare function clock_time_get(\n /** Input: Cock for which to return the time. */\n clock: clockid,\n /** Input: Maximum lag (exclusive) that the returned time value may have, compared to its actual value. */\n precision: timestamp,\n /** Output: Time value of the clock. */\n time: ptr\n): errno;\n\n/** Read environment variable data. */\nexport declare function environ_get(\n /** Input: Pointer to a buffer to write the environment variable pointers. */\n environ: ptr,\n /** Input: Pointer to a buffer to write the environment variable string data. */\n environ_buf: usize\n): errno;\n\n/** Return command-line argument data sizes. */\nexport declare function environ_sizes_get(\n /** Output: The number of environment variables. */\n environ_count: ptr,\n /** Output: The size of the environment variable string data. */\n environ_buf_size: ptr\n): errno;\n\n/** Provide file advisory information on a file descriptor. */\nexport declare function fd_advise(\n /** Input: The file descriptor for the file for which to provide file advisory information. */\n fd: fd,\n /** Input: The offset within the file to which the advisory applies. */\n offset: filesize,\n /** Input: The length of the region to which the advisory applies. */\n len: filesize,\n /** Input: The advice. */\n advice: advice\n): errno;\n\n/** Provide file advisory information on a file descriptor. */\nexport declare function fd_allocate(\n /** Input: The file descriptor for the file in which to allocate space. */\n fd: fd,\n /** Input: The offset at which to start the allocation. */\n offset: filesize,\n /** Input: The length of the area that is allocated. */\n len: filesize\n): errno;\n\n/** Close a file descriptor. */\nexport declare function fd_close(\n /** Input: The file descriptor to close. */\n fd: fd\n): errno;\n\n/** Synchronize the data of a file to disk. */\nexport declare function fd_datasync(\n /** Input: The file descriptor of the file to synchronize to disk. */\n fd: fd\n): errno;\n\n/** Get the attributes of a file descriptor. */\nexport declare function fd_fdstat_get(\n /** Input: The file descriptor to inspect. */\n fd: fd,\n /** Input: The buffer where the file descriptor's attributes are stored. */\n buf: struct\n): errno;\n\n/** Adjust the flags associated with a file descriptor. */\nexport declare function fd_fdstat_set_flags(\n /** Input: The file descriptor to operate on. */\n fd: fd,\n /** Input: The desired values of the file descriptor flags. */\n flags: fdflags\n): errno;\n\n/** Adjust the rights associated with a file descriptor. */\nexport declare function fd_fdstat_set_rights(\n /** Input: The file descriptor to operate on. */\n fd: fd,\n /** Input: The desired rights of the file descriptor. */\n fs_rights_base: rights,\n /** Input: The desired rights of the file descriptor. */\n fs_rights_inheriting: rights\n): errno;\n\n/** Return the attributes of an open file. */\nexport declare function fd_filestat_get(\n /** Input: The file descriptor to inspect. */\n fd: fd,\n /** Input: The buffer where the file's attributes are stored. */\n buf: struct\n): errno;\n\n/** Adjust the size of an open file. If this increases the file's size, the extra bytes are filled with zeros. */\nexport declare function fd_filestat_set_size(\n /** Input: A file descriptor for the file to adjust. */\n fd: fd,\n /** Input: The desired file size. */\n size: filesize\n): errno;\n\n/** Adjust the timestamps of an open file or directory. */\nexport declare function fd_filestat_set_times(\n /** Input: The file descriptor to operate on. */\n fd: fd,\n /** Input: The desired values of the data access timestamp. */\n st_atim: timestamp,\n /** Input: The desired values of the data modification timestamp. */\n st_mtim: timestamp,\n /** Input: A bitmask indicating which timestamps to adjust. */\n fstflags: fstflags\n): errno;\n\n/** Read from a file descriptor, without using and updating the file descriptor's offset. */\nexport declare function fd_pread(\n /** Input: The file descriptor from which to read data. */\n fd: fd,\n /** Input: List of scatter/gather vectors in which to store data. */\n iovs: ptr>,\n /** Input: Length of the list of scatter/gather vectors in which to store data. */\n iovs_len: usize,\n /** Input: The offset within the file at which to read. */\n offset: filesize,\n /** Output: The number of bytes read. */\n nread: ptr\n): errno;\n\n/** Return a description of the given preopened file descriptor. */\nexport declare function fd_prestat_get(\n /** Input: The file descriptor about which to retrieve information. */\n fd: fd,\n /** Input: The buffer where the description is stored. */\n buf: struct\n): errno;\n\n/** Return a description of the given preopened file descriptor. */\nexport declare function fd_prestat_dir_name(\n /** Input: The file descriptor about which to retrieve information. */\n fd: fd,\n /** Input: Buffer into which to write the preopened directory name. */\n path: ptr,\n /** Input: Length of the buffer into which to write the preopened directory name. */\n path_len: usize\n): errno;\n\n/** Write to a file descriptor, without using and updating the file descriptor's offset. */\nexport declare function fd_pwrite(\n /** Input: The file descriptor to which to write data. */\n fd: fd,\n /** Input: List of scatter/gather vectors from which to retrieve data. */\n iovs: ptr>,\n /** Input: Length of the list of scatter/gather vectors from which to retrieve data. */\n iovs_len: usize,\n /** Input: The offset within the file at which to write. */\n offset: filesize,\n /** Output: The number of bytes written. */\n nwritten: ptr\n): errno;\n\n/** Read from a file descriptor. */\nexport declare function fd_read(\n /** Input: The file descriptor from which to read data. */\n fd: fd,\n /** Input: List of scatter/gather vectors to which to store data. */\n iovs: ptr>,\n /** Input: Length of the list of scatter/gather vectors to which to store data. */\n iovs_len: usize,\n /** Output: The number of bytes read. */\n nread: ptr\n): errno;\n\n/** Read directory entries from a directory. */\nexport declare function fd_readdir(\n /** Input: Directory from which to read the directory entries. */\n fd: fd,\n /** Input: Buffer where directory entries are stored. */\n buf: ptr>,\n /** Input: Length of the buffer where directory entries are stored. */\n buf_len: usize,\n /** Input: Location within the directory to start reading. */\n cookie: dircookie,\n /** Output: Number of bytes stored in the read buffer. If less than the size of the read buffer, the end of the directory has been reached. */\n buf_used: ptr\n): errno;\n\n/** Atomically replace a file descriptor by renumbering another file descriptor. */\nexport declare function fd_renumber(\n /** Input: The file descriptor to renumber. */\n from: fd,\n /** Input: The file descriptor to overwrite. */\n to: fd\n): errno;\n\n/** Move the offset of a file descriptor. */\nexport declare function fd_seek(\n /** Input: The file descriptor to operate on. */\n fd: fd,\n /** Input: The number of bytes to move. */\n offset: filedelta,\n /** Input: The base from which the offset is relative. */\n whence: whence,\n /** Output: The new offset of the file descriptor, relative to the start of the file. */\n newoffset: ptr\n): errno;\n\n/** Synchronize the data and metadata of a file to disk. */\nexport declare function fd_sync(\n /** Input: The file descriptor of the file containing the data and metadata to synchronize to disk. */\n fd: fd\n): errno;\n\n/** Return the current offset of a file descriptor. */\nexport declare function fd_tell(\n /** Input: The file descriptor to inspect. */\n fd: fd,\n /** Output: The current offset of the file descriptor, relative to the start of the file. */\n newoffset: ptr\n): errno;\n\n/** Write to a file descriptor. */\nexport declare function fd_write(\n /** Input: The file descriptor to which to write data. */\n fd: fd,\n /** Input: List of scatter/gather vectors from which to retrieve data. */\n iovs: ptr>,\n /** Input: List of scatter/gather vectors from which to retrieve data. */\n iovs_len: usize,\n /** Output: The number of bytes written. */\n nwritten: ptr\n): errno;\n\n/* Create a directory. */\nexport declare function path_create_directory(\n /** Input: The working directory at which the resolution of the path starts. */\n fd: fd,\n /** Input: The path at which to create the directory. */\n path: ptr,\n /** Input: The path at which to create the directory. */\n path_len: usize\n): errno;\n\n/** Return the attributes of a file or directory. */\nexport declare function path_filestat_get(\n /** Input: The working directory at which the resolution of the path starts. */\n fd: fd,\n /** Input: Flags determining the method of how the path is resolved. */\n flags: lookupflags,\n /** Input: The path of the file or directory to inspect. */\n path: ptr,\n /** Input: The path of the file or directory to inspect. */\n path_len: usize,\n /** Input: The buffer where the file's attributes are stored. */\n buf: struct\n): errno;\n\n/** Adjust the timestamps of a file or directory. */\nexport declare function path_filestat_set_times(\n /** Input: The working directory at which the resolution of the path starts. */\n fd: fd,\n /** Input: Flags determining the method of how the path is resolved. */\n flags: lookupflags,\n /** Input: The path of the file or directory to operate on. */\n path: ptr,\n /** Input: The path of the file or directory to operate on. */\n path_len: usize,\n /** Input: The desired values of the data access timestamp. */\n st_atim: timestamp,\n /** Input: The desired values of the data modification timestamp. */\n st_mtim: timestamp,\n /** Input: A bitmask indicating which timestamps to adjust. */\n fstflags: fstflags\n): errno;\n\n/** Create a hard link. */\nexport declare function path_link(\n /** Input: The working directory at which the resolution of the old path starts. */\n old_fd: fd,\n /** Input: Flags determining the method of how the path is resolved. */\n old_flags: lookupflags,\n /** Input: The source path from which to link. */\n old_path: ptr,\n /** Input: The source path from which to link. */\n old_path_len: usize,\n /** Input: The working directory at which the resolution of the new path starts. */\n new_fd: fd,\n /** Input: The destination path at which to create the hard link. */\n new_path: ptr,\n /** Input: The length of the destination path at which to create the hard link. */\n new_path_len: usize\n): errno;\n\n/** Open a file or directory. */\nexport declare function path_open(\n /** Input: The working directory at which the resolution of the path starts. */\n dirfd: fd,\n /** Input: Flags determining the method of how the path is resolved. */\n dirflags: lookupflags,\n /** Input: The path of the file or directory to open. */\n path: ptr,\n /** Input: The length of the path of the file or directory to open. */\n path_len: usize,\n /** Input: The method by which to open the file. */\n oflags: oflags,\n /** Input: The initial base rights that apply to operations using the file descriptor itself. */\n fs_rights_base: rights,\n /** Input: The initial inheriting rights that apply to file descriptors derived from it. */\n fs_rights_inheriting: rights,\n /** Input: The initial flags of the file descriptor. */\n fs_flags: fdflags,\n /** Output: The file descriptor of the file that has been opened. */\n fd: ptr\n): errno;\n\n/** Read the contents of a symbolic link. */\nexport declare function path_readlink(\n /** Input: The working directory at which the resolution of the path starts. */\n fd: fd,\n /** Input: The path of the symbolic link from which to read. */\n path: ptr,\n /** Input: The length of the path of the symbolic link from which to read. */\n path_len: usize,\n /** Input: The buffer to which to write the contents of the symbolic link. */\n buf: ptr,\n /** Input: The length of the buffer to which to write the contents of the symbolic link. */\n buf_len: usize,\n /** Output: The number of bytes placed in the buffer. */\n buf_used: ptr\n): errno;\n\n/** Remove a directory. */\nexport declare function path_remove_directory(\n /** Input: The working directory at which the resolution of the path starts. */\n fd: fd,\n /** Input: The path to a directory to remove. */\n path: ptr,\n /** Input: The length of the path to a directory to remove. */\n path_len: usize\n): errno;\n\n/** Rename a file or directory. */\nexport declare function path_rename(\n /** Input: The working directory at which the resolution of the old path starts. */\n old_fd: fd,\n /** Input: The source path of the file or directory to rename. */\n old_path: ptr,\n /** Input: The length of the source path of the file or directory to rename. */\n old_path_len: usize,\n /** Input: The working directory at which the resolution of the new path starts. */\n new_fd: fd,\n /** Input: The destination path to which to rename the file or directory. */\n new_path: ptr,\n /** Input: The length of the destination path to which to rename the file or directory. */\n new_path_len: usize\n): errno;\n\n/** Create a symbolic link. */\nexport declare function path_symlink(\n /** Input: The contents of the symbolic link. */\n old_path: ptr,\n /** Input: The length of the contents of the symbolic link. */\n old_path_len: usize,\n /** Input: The working directory at which the resolution of the path starts. */\n fd: fd,\n /** Input: The destination path at which to create the symbolic link. */\n new_path: ptr,\n /** Input: The length of the destination path at which to create the symbolic link. */\n new_path_len: usize\n): errno;\n\n/** Unlink a file. */\nexport declare function path_unlink_file(\n /** Input: The working directory at which the resolution of the path starts. */\n fd: fd,\n /** Input: The path to a file to unlink. */\n path: ptr,\n /** Input: The length of the path to a file to unlink. */\n path_len: usize\n): errno;\n\n/** Concurrently poll for the occurrence of a set of events. */\nexport declare function poll_oneoff(\n /** Input: The events to which to subscribe. */\n in_: ptr>,\n /** Input: The events that have occurred. */\n out: ptr>,\n /** Input: Both the number of subscriptions and events. */\n nsubscriptions: usize,\n /** Output: The number of events stored. */\n nevents: ptr\n): errno;\n\n/** Terminate the process normally. An exit code of 0 indicates successful termination of the program. The meanings of other values is dependent on the environment. */\nexport declare function proc_exit(\n /** Input: The exit code returned by the process. */\n rval: u32\n): void;\n\n/** Send a signal to the process of the calling thread. */\nexport declare function proc_raise(\n /** Input: The signal condition to trigger. */\n sig: signal\n): errno;\n\n/** Write high-quality random data into a buffer. */\nexport declare function random_get(\n /** Input: The buffer to fill with random data. */\n buf: usize,\n /** Input: The length of the buffer to fill with random data. */\n buf_len: usize\n): errno;\n\n/** Temporarily yield execution of the calling thread. */\nexport declare function sched_yield(): errno;\n\n/** Receive a message from a socket. */\nexport declare function sock_recv(\n /** Input: The socket on which to receive data. */\n sock: fd,\n /** Input: List of scatter/gather vectors to which to store data. */\n ri_data: ptr>,\n /** Input: The length of the list of scatter/gather vectors to which to store data. */\n ri_data_len: usize,\n /** Input: Message flags. */\n ri_flags: riflags,\n /** Output: Number of bytes stored in `ri_data`. */\n ro_datalen: ptr,\n /** Output: Message flags. */\n ro_flags: ptr\n): errno;\n\n/** Send a message on a socket. */\nexport declare function sock_send(\n /** Input: The socket on which to send data. */\n sock: fd,\n /** Input: List of scatter/gather vectors to which to retrieve data */\n si_data: ptr>,\n /** Input: The length of the list of scatter/gather vectors to which to retrieve data */\n si_data_len: usize,\n /** Input: Message flags. */\n si_flags: siflags,\n /** Output: Number of bytes transmitted. */\n so_datalen: ptr\n): errno;\n\n/** Shut down socket send and receive channels. */\nexport declare function sock_shutdown(\n /** Input: The socket on which to shutdown channels. */\n sock: fd,\n /** Input: Which channels on the socket to shut down. */\n how: sdflags\n): errno;\n\n// === Types ======================================================================================\n\n/** File or memory access pattern advisory information. */\nexport namespace advice {\n /** The application has no advice to give on its behavior with respect to the specified data. */\n // @ts-ignore: decorator\n @inline\n export const NORMAL: advice = 0;\n /** The application expects to access the specified data sequentially from lower offsets to higher offsets. */\n // @ts-ignore: decorator\n @inline\n export const SEQUENTIAL : advice = 1;\n /** The application expects to access the specified data in a random order. */\n // @ts-ignore: decorator\n @inline\n export const RANDOM: advice = 2;\n /** The application expects to access the specified data in the near future. */\n // @ts-ignore: decorator\n @inline\n export const WILLNEED: advice = 3;\n /** The application expects that it will not access the specified data in the near future. */\n // @ts-ignore: decorator\n @inline\n export const DONTNEED: advice = 4;\n /** The application expects to access the specified data once and then not reuse it thereafter. */\n // @ts-ignore: decorator\n @inline\n export const NOREUSE: advice = 5;\n}\nexport type advice = u8;\n\n/** Identifiers for clocks. */\nexport namespace clockid {\n /** The clock measuring real time. Time value zero corresponds with 1970-01-01T00:00:00Z. */\n // @ts-ignore: decorator\n @inline\n export const REALTIME: clockid = 0;\n /** The store-wide monotonic clock. Absolute value has no meaning. */\n // @ts-ignore: decorator\n @inline\n export const MONOTONIC: clockid = 1;\n /** The CPU-time clock associated with the current process. */\n // @ts-ignore: decorator\n @inline\n export const PROCESS_CPUTIME_ID: clockid = 2;\n /** The CPU-time clock associated with the current thread. */\n // @ts-ignore: decorator\n @inline\n export const THREAD_CPUTIME_ID: clockid = 3;\n}\nexport type clockid = u32;\n\n/** Identifier for a device containing a file system. Can be used in combination with `inode` to uniquely identify a file or directory in the filesystem. */\nexport type device = u64;\n\n/** A reference to the offset of a directory entry. */\nexport type dircookie = u64;\n\n/** A directory entry. */\n@unmanaged export class dirent {\n /** The offset of the next directory entry stored in this directory. */\n next: dircookie;\n /** The serial number of the file referred to by this directory entry. */\n ino: inode;\n /** The length of the name of the directory entry. */\n namlen: u32;\n /** The type of the file referred to by this directory entry. */\n type: filetype;\n private __padding0: u16;\n}\n\n/** Error codes returned by functions. */\nexport namespace errno {\n /** No error occurred. System call completed successfully. */\n // @ts-ignore: decorator\n @inline\n export const SUCCESS: errno = 0;\n /** Argument list too long. */\n // @ts-ignore: decorator\n @inline\n export const TOOBIG: errno = 1;\n /** Permission denied. */\n // @ts-ignore: decorator\n @inline\n export const ACCES: errno = 2;\n /** Address in use. */\n // @ts-ignore: decorator\n @inline\n export const ADDRINUSE: errno = 3;\n /** Address not available. */\n // @ts-ignore: decorator\n @inline\n export const ADDRNOTAVAIL: errno = 4;\n /** Address family not supported. */\n // @ts-ignore: decorator\n @inline\n export const AFNOSUPPORT: errno = 5;\n /** Resource unavailable, or operation would block. */\n // @ts-ignore: decorator\n @inline\n export const AGAIN: errno = 6;\n /** Connection already in progress. */\n // @ts-ignore: decorator\n @inline\n export const ALREADY: errno = 7;\n /** Bad file descriptor. */\n // @ts-ignore: decorator\n @inline\n export const BADF: errno = 8;\n /** Bad message. */\n // @ts-ignore: decorator\n @inline\n export const BADMSG: errno = 9;\n /** Device or resource busy. */\n // @ts-ignore: decorator\n @inline\n export const BUSY: errno = 10;\n /** Operation canceled. */\n // @ts-ignore: decorator\n @inline\n export const CANCELED: errno = 11;\n /** No child processes. */\n // @ts-ignore: decorator\n @inline\n export const CHILD: errno = 12;\n /** Connection aborted. */\n // @ts-ignore: decorator\n @inline\n export const CONNABORTED: errno = 13;\n /** Connection refused. */\n // @ts-ignore: decorator\n @inline\n export const CONNREFUSED: errno = 14;\n /** Connection reset. */\n // @ts-ignore: decorator\n @inline\n export const CONNRESET: errno = 15;\n /** Resource deadlock would occur. */\n // @ts-ignore: decorator\n @inline\n export const DEADLK: errno = 16;\n /** Destination address required. */\n // @ts-ignore: decorator\n @inline\n export const DESTADDRREQ: errno = 17;\n /** Mathematics argument out of domain of function. */\n // @ts-ignore: decorator\n @inline\n export const DOM: errno = 18;\n /** Reserved. */\n // @ts-ignore: decorator\n @inline\n export const DQUOT: errno = 19;\n /** File exists. */\n // @ts-ignore: decorator\n @inline\n export const EXIST: errno = 20;\n /** Bad address. */\n // @ts-ignore: decorator\n @inline\n export const FAULT: errno = 21;\n /** File too large. */\n // @ts-ignore: decorator\n @inline\n export const FBIG: errno = 22;\n /** Host is unreachable. */\n // @ts-ignore: decorator\n @inline\n export const HOSTUNREACH: errno = 23;\n /** Identifier removed. */\n // @ts-ignore: decorator\n @inline\n export const IDRM: errno = 24;\n /** Illegal byte sequence. */\n // @ts-ignore: decorator\n @inline\n export const ILSEQ: errno = 25;\n /** Operation in progress. */\n // @ts-ignore: decorator\n @inline\n export const INPROGRESS: errno = 26;\n /** Interrupted function. */\n // @ts-ignore: decorator\n @inline\n export const INTR: errno = 27;\n /** Invalid argument. */\n // @ts-ignore: decorator\n @inline\n export const INVAL: errno = 28;\n /** I/O error. */\n // @ts-ignore: decorator\n @inline\n export const IO: errno = 29;\n /** Socket is connected. */\n // @ts-ignore: decorator\n @inline\n export const ISCONN: errno = 30;\n /** Is a directory. */\n // @ts-ignore: decorator\n @inline\n export const ISDIR: errno = 31;\n /** Too many levels of symbolic links. */\n // @ts-ignore: decorator\n @inline\n export const LOOP: errno = 32;\n /** File descriptor value too large. */\n // @ts-ignore: decorator\n @inline\n export const MFILE: errno = 33;\n /** Too many links. */\n // @ts-ignore: decorator\n @inline\n export const MLINK: errno = 34;\n /** Message too large. */\n // @ts-ignore: decorator\n @inline\n export const MSGSIZE: errno = 35;\n /** Reserved. */\n // @ts-ignore: decorator\n @inline\n export const MULTIHOP: errno = 36;\n /** Filename too long. */\n // @ts-ignore: decorator\n @inline\n export const NAMETOOLONG: errno = 37;\n /** Network is down. */\n // @ts-ignore: decorator\n @inline\n export const NETDOWN: errno = 38;\n /** Connection aborted by network. */\n // @ts-ignore: decorator\n @inline\n export const NETRESET: errno = 39;\n /** Network unreachable. */\n // @ts-ignore: decorator\n @inline\n export const NETUNREACH: errno = 40;\n /** Too many files open in system. */\n // @ts-ignore: decorator\n @inline\n export const NFILE: errno = 41;\n /** No buffer space available. */\n // @ts-ignore: decorator\n @inline\n export const NOBUFS: errno = 42;\n /** No such device. */\n // @ts-ignore: decorator\n @inline\n export const NODEV: errno = 43;\n /** No such file or directory. */\n // @ts-ignore: decorator\n @inline\n export const NOENT: errno = 44;\n /** Executable file format error. */\n // @ts-ignore: decorator\n @inline\n export const NOEXEC: errno = 45;\n /** No locks available. */\n // @ts-ignore: decorator\n @inline\n export const NOLCK: errno = 46;\n /** Reserved. */\n // @ts-ignore: decorator\n @inline\n export const NOLINK: errno = 47;\n /** Not enough space. */\n // @ts-ignore: decorator\n @inline\n export const NOMEM: errno = 48;\n /** No message of the desired type. */\n // @ts-ignore: decorator\n @inline\n export const NOMSG: errno = 49;\n /** Protocol not available. */\n // @ts-ignore: decorator\n @inline\n export const NOPROTOOPT: errno = 50;\n /** No space left on device. */\n // @ts-ignore: decorator\n @inline\n export const NOSPC: errno = 51;\n /** Function not supported. */\n // @ts-ignore: decorator\n @inline\n export const NOSYS: errno = 52;\n /** The socket is not connected. */\n // @ts-ignore: decorator\n @inline\n export const NOTCONN: errno = 53;\n /** Not a directory or a symbolic link to a directory. */\n // @ts-ignore: decorator\n @inline\n export const NOTDIR: errno = 54;\n /** Directory not empty. */\n // @ts-ignore: decorator\n @inline\n export const NOTEMPTY: errno = 55;\n /** State not recoverable. */\n // @ts-ignore: decorator\n @inline\n export const NOTRECOVERABLE: errno = 56;\n /** Not a socket. */\n // @ts-ignore: decorator\n @inline\n export const NOTSOCK: errno = 57;\n /** Not supported, or operation not supported on socket. */\n // @ts-ignore: decorator\n @inline\n export const NOTSUP: errno = 58;\n /** Inappropriate I/O control operation. */\n // @ts-ignore: decorator\n @inline\n export const NOTTY: errno = 59;\n /** No such device or address. */\n // @ts-ignore: decorator\n @inline\n export const NXIO: errno = 60;\n /** Value too large to be stored in data type. */\n // @ts-ignore: decorator\n @inline\n export const OVERFLOW: errno = 61;\n /** Previous owner died. */\n // @ts-ignore: decorator\n @inline\n export const OWNERDEAD: errno = 62;\n /** Operation not permitted. */\n // @ts-ignore: decorator\n @inline\n export const PERM: errno = 63;\n /** Broken pipe. */\n // @ts-ignore: decorator\n @inline\n export const PIPE: errno = 64;\n /** Protocol error. */\n // @ts-ignore: decorator\n @inline\n export const PROTO: errno = 65;\n /** Protocol not supported. */\n // @ts-ignore: decorator\n @inline\n export const PROTONOSUPPORT: errno = 66;\n /** Protocol wrong type for socket. */\n // @ts-ignore: decorator\n @inline\n export const PROTOTYPE: errno = 67;\n /** Result too large. */\n // @ts-ignore: decorator\n @inline\n export const RANGE: errno = 68;\n /** Read-only file system. */\n // @ts-ignore: decorator\n @inline\n export const ROFS: errno = 69;\n /** Invalid seek. */\n // @ts-ignore: decorator\n @inline\n export const SPIPE: errno = 70;\n /** No such process. */\n // @ts-ignore: decorator\n @inline\n export const SRCH: errno = 71;\n /** Reserved. */\n // @ts-ignore: decorator\n @inline\n export const STALE: errno = 72;\n /** Connection timed out. */\n // @ts-ignore: decorator\n @inline\n export const TIMEDOUT: errno = 73;\n /** Text file busy. */\n // @ts-ignore: decorator\n @inline\n export const TXTBSY: errno = 74;\n /** Cross-device link. */\n // @ts-ignore: decorator\n @inline\n export const XDEV: errno = 75;\n /** Extension: Capabilities insufficient. */\n // @ts-ignore: decorator\n @inline\n export const NOTCAPABLE: errno = 76;\n}\nexport type errno = u16;\n\n/** An event that occurred. */\n@unmanaged export abstract class event {\n /** User-provided value that got attached to `subscription#userdata`. */\n userdata: userdata;\n /** If non-zero, an error that occurred while processing the subscription request. */\n error: errno;\n /* The type of the event that occurred. */\n type: eventtype;\n private __padding0: u16;\n}\n\n/** An event that occurred when type is `eventtype.FD_READ` or `eventtype.FD_WRITE`. */\n@unmanaged export class rwevent extends event {\n /* The number of bytes available for reading or writing. */\n nbytes: filesize;\n /* The state of the file descriptor. */\n flags: eventrwflags;\n private __padding1: u32;\n}\n\n/** The state of the file descriptor subscribed to with `eventtype.FD_READ` or `eventtype.FD_WRITE`. */\nexport namespace eventrwflags {\n /** The peer of this socket has closed or disconnected. */\n // @ts-ignore: decorator\n @inline\n export const HANGUP: eventrwflags = 1;\n}\nexport type eventrwflags = u16;\n\n/** Type of a subscription to an event or its occurrence. */\nexport namespace eventtype {\n /** The time value of clock has reached the timestamp. */\n // @ts-ignore: decorator\n @inline\n export const CLOCK: eventtype = 0;\n /** File descriptor has data available for reading. */\n // @ts-ignore: decorator\n @inline\n export const FD_READ: eventtype = 1;\n /** File descriptor has capacity available for writing */\n // @ts-ignore: decorator\n @inline\n export const FD_WRITE: eventtype = 2;\n}\nexport type eventtype = u8;\n\n/** Exit code generated by a process when exiting. */\nexport type exitcode = u32;\n\n/** A file descriptor number. */\nexport type fd = u32;\n\n/** File descriptor flags. */\nexport namespace fdflags {\n /** Append mode: Data written to the file is always appended to the file's end. */\n // @ts-ignore: decorator\n @inline\n export const APPEND: fdflags = 1;\n /** Write according to synchronized I/O data integrity completion. Only the data stored in the file is synchronized. */\n // @ts-ignore: decorator\n @inline\n export const DSYNC: fdflags = 2;\n /** Non-blocking mode. */\n // @ts-ignore: decorator\n @inline\n export const NONBLOCK: fdflags = 4;\n /** Synchronized read I/O operations. */\n // @ts-ignore: decorator\n @inline\n export const RSYNC: fdflags = 8;\n /** Write according to synchronized I/O file integrity completion. */\n // @ts-ignore: decorator\n @inline\n export const SYNC: fdflags = 16;\n}\nexport type fdflags = u16;\n\n/** File descriptor attributes. */\n@unmanaged export class fdstat {\n /** File type. */\n filetype: filetype;\n /** File descriptor flags. */\n flags: fdflags;\n /** Rights that apply to this file descriptor. */\n rights_base: rights;\n /** Maximum set of rights that may be installed on new file descriptors that are created through this file descriptor, e.g., through `path_open`. */\n rights_inheriting: rights;\n}\n\n/** Relative offset within a file. */\nexport type filedelta = i64;\n\n/** Non-negative file size or length of a region within a file. */\nexport type filesize = u64;\n\n/** File attributes. */\n@unmanaged export class filestat {\n /** Device ID of device containing the file. */\n dev: device;\n /** File serial number. */\n ino: inode;\n /** File type. */\n filetype: filetype;\n /** Number of hard links to the file. */\n nlink: linkcount;\n /** For regular files, the file size in bytes. For symbolic links, the length in bytes of the pathname contained in the symbolic link. */\n size: filesize;\n /** Last data access timestamp. */\n atim: timestamp;\n /** Last data modification timestamp. */\n mtim: timestamp;\n /** Last file status change timestamp. */\n ctim: timestamp;\n}\n\n/** The type of a file descriptor or file. */\nexport namespace filetype {\n /** The type of the file descriptor or file is unknown or is different from any of the other types specified. */\n // @ts-ignore: decorator\n @inline\n export const UNKNOWN: filetype = 0;\n /** The file descriptor or file refers to a block device inode. */\n // @ts-ignore: decorator\n @inline\n export const BLOCK_DEVICE: filetype = 1;\n /** The file descriptor or file refers to a character device inode. */\n // @ts-ignore: decorator\n @inline\n export const CHARACTER_DEVICE: filetype = 2;\n /** The file descriptor or file refers to a directory inode. */\n // @ts-ignore: decorator\n @inline\n export const DIRECTORY: filetype = 3;\n /** The file descriptor or file refers to a regular file inode. */\n // @ts-ignore: decorator\n @inline\n export const REGULAR_FILE: filetype = 4;\n /** The file descriptor or file refers to a datagram socket. */\n // @ts-ignore: decorator\n @inline\n export const SOCKET_DGRAM: filetype = 5;\n /** The file descriptor or file refers to a byte-stream socket. */\n // @ts-ignore: decorator\n @inline\n export const SOCKET_STREAM: filetype = 6;\n /** The file refers to a symbolic link inode. */\n // @ts-ignore: decorator\n @inline\n export const SYMBOLIC_LINK: filetype = 7;\n}\nexport type filetype = u8;\n\n/** Which file time attributes to adjust. */\nexport namespace fstflags {\n /** Adjust the last data access timestamp to the value stored in `filestat#st_atim`. */\n // @ts-ignore: decorator\n @inline\n export const SET_ATIM: fstflags = 1;\n /** Adjust the last data access timestamp to the time of clock `clockid.REALTIME`. */\n // @ts-ignore: decorator\n @inline\n export const SET_ATIM_NOW: fstflags = 2;\n /** Adjust the last data modification timestamp to the value stored in `filestat#st_mtim`. */\n // @ts-ignore: decorator\n @inline\n export const SET_MTIM: fstflags = 4;\n /** Adjust the last data modification timestamp to the time of clock `clockid.REALTIME`. */\n // @ts-ignore: decorator\n @inline\n export const SET_MTIM_NOW: fstflags = 8;\n}\nexport type fstflags = u16;\n\n/** File serial number that is unique within its file system. */\nexport type inode = u64;\n\n/** A region of memory for scatter/gather reads. */\n@unmanaged export class iovec {\n /** The address of the buffer to be filled. */\n buf: usize;\n /** The length of the buffer to be filled. */\n buf_len: usize;\n}\n\n/** Number of hard links to an inode. */\nexport type linkcount = u32;\n\n/** Flags determining the method of how paths are resolved. */\nexport namespace lookupflags {\n /** As long as the resolved path corresponds to a symbolic link, it is expanded. */\n // @ts-ignore: decorator\n @inline\n export const SYMLINK_FOLLOW: lookupflags = 1;\n}\nexport type lookupflags = u32;\n\n/** Open flags. */\nexport namespace oflags {\n /** Create file if it does not exist. */\n // @ts-ignore: decorator\n @inline\n export const CREAT: oflags = 1;\n /** Fail if not a directory. */\n // @ts-ignore: decorator\n @inline\n export const DIRECTORY: oflags = 2;\n /** Fail if file already exists. */\n // @ts-ignore: decorator\n @inline\n export const EXCL: oflags = 4;\n /** Truncate file to size 0. */\n // @ts-ignore: decorator\n @inline\n export const TRUNC: oflags = 8;\n}\nexport type oflags = u16;\n\n// TODO: undocumented\nexport namespace preopentype {\n // @ts-ignore: decorator\n @inline\n export const DIR: preopentype = 0;\n}\nexport type preopentype = u8;\n\n// TODO: undocumented\nexport abstract class prestat {\n type: preopentype;\n}\n\n// TODO: undocumented\nexport class dirprestat extends prestat {\n name_len: usize;\n}\n\n/** Flags provided to `sock_recv`. */\nexport namespace riflags {\n /** Returns the message without removing it from the socket's receive queue. */\n // @ts-ignore: decorator\n @inline\n export const PEEK: riflags = 1;\n /** On byte-stream sockets, block until the full amount of data can be returned. */\n // @ts-ignore: decorator\n @inline\n export const WAITALL: riflags = 2;\n}\nexport type riflags = u16;\n\n/** File descriptor rights, determining which actions may be performed. */\nexport namespace rights {\n /** The right to invoke `fd_datasync`. */\n // @ts-ignore: decorator\n @inline\n export const FD_DATASYNC: rights = 1;\n /** The right to invoke `fd_read` and `sock_recv`. */\n // @ts-ignore: decorator\n @inline\n export const FD_READ: rights = 2;\n /** The right to invoke `fd_seek`. This flag implies `rights.FD_TELL`. */\n // @ts-ignore: decorator\n @inline\n export const FD_SEEK: rights = 4;\n /** The right to invoke `fd_fdstat_set_flags`. */\n // @ts-ignore: decorator\n @inline\n export const FD_FDSTAT_SET_FLAGS: rights = 8;\n /** The right to invoke `fd_sync`. */\n // @ts-ignore: decorator\n @inline\n export const FD_SYNC: rights = 16;\n /** The right to invoke `fd_seek` in such a way that the file offset remains unaltered (i.e., `whence.CUR` with offset zero), or to invoke `fd_tell`). */\n // @ts-ignore: decorator\n @inline\n export const FD_TELL: rights = 32;\n /** The right to invoke `fd_write` and `sock_send`. If `rights.FD_SEEK` is set, includes the right to invoke `fd_pwrite`. */\n // @ts-ignore: decorator\n @inline\n export const FD_WRITE: rights = 64;\n /** The right to invoke `fd_advise`. */\n // @ts-ignore: decorator\n @inline\n export const FD_ADVISE: rights = 128;\n /** The right to invoke `fd_allocate`. */\n // @ts-ignore: decorator\n @inline\n export const FD_ALLOCATE: rights = 256;\n /** The right to invoke `path_create_directory`. */\n // @ts-ignore: decorator\n @inline\n export const PATH_CREATE_DIRECTORY: rights = 512;\n /** If `rights.PATH_OPEN` is set, the right to invoke `path_open` with `oflags.CREAT`. */\n // @ts-ignore: decorator\n @inline\n export const PATH_CREATE_FILE: rights = 1024;\n /** The right to invoke `path_link` with the file descriptor as the source directory. */\n // @ts-ignore: decorator\n @inline\n export const PATH_LINK_SOURCE: rights = 2048;\n /** The right to invoke `path_link` with the file descriptor as the target directory. */\n // @ts-ignore: decorator\n @inline\n export const PATH_LINK_TARGET: rights = 4096;\n /** The right to invoke `path_open`. */\n // @ts-ignore: decorator\n @inline\n export const PATH_OPEN: rights = 8192;\n /** The right to invoke `fd_readdir`. */\n // @ts-ignore: decorator\n @inline\n export const FD_READDIR: rights = 16384;\n /** The right to invoke `path_readlink`. */\n // @ts-ignore: decorator\n @inline\n export const PATH_READLINK: rights = 32768;\n /** The right to invoke `path_rename` with the file descriptor as the source directory. */\n // @ts-ignore: decorator\n @inline\n export const PATH_RENAME_SOURCE: rights = 65536;\n /** The right to invoke `path_rename` with the file descriptor as the target directory. */\n // @ts-ignore: decorator\n @inline\n export const PATH_RENAME_TARGET: rights = 131072;\n /** The right to invoke `path_filestat_get`. */\n // @ts-ignore: decorator\n @inline\n export const PATH_FILESTAT_GET: rights = 262144;\n /** The right to change a file's size (there is no `path_filestat_set_size`). If `rights.PATH_OPEN` is set, includes the right to invoke `path_open` with `oflags.TRUNC`. */\n // @ts-ignore: decorator\n @inline\n export const PATH_FILESTAT_SET_SIZE: rights = 524288;\n /** The right to invoke `path_filestat_set_times`. */\n // @ts-ignore: decorator\n @inline\n export const PATH_FILESTAT_SET_TIMES: rights = 1048576;\n /** The right to invoke `fd_filestat_get`. */\n // @ts-ignore: decorator\n @inline\n export const FD_FILESTAT_GET: rights = 2097152;\n /** The right to invoke `fd_filestat_set_size`. */\n // @ts-ignore: decorator\n @inline\n export const FD_FILESTAT_SET_SIZE: rights = 4194304;\n /** The right to invoke `fd_filestat_set_times`. */\n // @ts-ignore: decorator\n @inline\n export const FD_FILESTAT_SET_TIMES: rights = 8388608;\n /** The right to invoke `path_symlink`. */\n // @ts-ignore: decorator\n @inline\n export const RIGHT_PATH_SYMLINK: rights = 16777216;\n /** The right to invoke `path_remove_directory`. */\n // @ts-ignore: decorator\n @inline\n export const PATH_REMOVE_DIRECTORY: rights = 33554432;\n /** The right to invoke `path_unlink_file`. */\n // @ts-ignore: decorator\n @inline\n export const PATH_UNLINK_FILE: rights = 67108864;\n /** If `rights.FD_READ` is set, includes the right to invoke `poll_oneoff` to subscribe to `eventtype.FD_READ`. If `rights.FD_WRITE` is set, includes the right to invoke `poll_oneoff` to subscribe to `eventtype.FD_WRITE`. */\n // @ts-ignore: decorator\n @inline\n export const POLL_FD_READWRITE: rights = 134217728;\n /** The right to invoke `sock_shutdown`. */\n // @ts-ignore: decorator\n @inline\n export const SOCK_SHUTDOWN: rights = 268435456;\n}\nexport type rights = u64;\n\n/** Flags returned by `sock_recv`. */\nexport namespace roflags {\n /** Message data has been truncated. */\n // @ts-ignore: decorator\n @inline\n export const DATA_TRUNCATED: roflags = 1;\n}\nexport type roflags = u16;\n\n/** Which channels on a socket to shut down. */\nexport namespace sdflags {\n /** Disables further receive operations. */\n // @ts-ignore: decorator\n @inline\n export const RD: sdflags = 1;\n /** Disables further send operations. */\n // @ts-ignore: decorator\n @inline\n export const WR: sdflags = 2;\n}\nexport type sdflags = u8;\n\n/** Flags provided to `sock_send`. */\nexport namespace siflags {\n // As there are currently no flags defined, it must be set to zero.\n}\nexport type siflags = u16;\n\n/** Signal condition. */\nexport namespace signal {\n /** Hangup. */\n // @ts-ignore: decorator\n @inline\n export const HUP: signal = 1;\n /** Terminate interrupt signal. */\n // @ts-ignore: decorator\n @inline\n export const INT: signal = 2;\n /** Terminal quit signal. */\n // @ts-ignore: decorator\n @inline\n export const QUIT: signal = 3;\n /** Illegal instruction. */\n // @ts-ignore: decorator\n @inline\n export const ILL: signal = 4;\n /** Trace/breakpoint trap. */\n // @ts-ignore: decorator\n @inline\n export const TRAP: signal = 5;\n /** Process abort signal. */\n // @ts-ignore: decorator\n @inline\n export const ABRT: signal = 6;\n /** Access to an undefined portion of a memory object. */\n // @ts-ignore: decorator\n @inline\n export const BUS: signal = 7;\n /** Erroneous arithmetic operation. */\n // @ts-ignore: decorator\n @inline\n export const FPE: signal = 8;\n /** Kill. */\n // @ts-ignore: decorator\n @inline\n export const KILL: signal = 9;\n /** User-defined signal 1. */\n // @ts-ignore: decorator\n @inline\n export const USR1: signal = 10;\n /** Invalid memory reference. */\n // @ts-ignore: decorator\n @inline\n export const SEGV: signal = 11;\n /** User-defined signal 2. */\n // @ts-ignore: decorator\n @inline\n export const USR2: signal = 12;\n /** Write on a pipe with no one to read it. */\n // @ts-ignore: decorator\n @inline\n export const PIPE: signal = 13;\n /** Alarm clock. */\n // @ts-ignore: decorator\n @inline\n export const ALRM: signal = 14;\n /** Termination signal. */\n // @ts-ignore: decorator\n @inline\n export const TERM: signal = 15;\n /** Child process terminated, stopped, or continued. */\n // @ts-ignore: decorator\n @inline\n export const CHLD: signal = 16;\n /** Continue executing, if stopped. */\n // @ts-ignore: decorator\n @inline\n export const CONT: signal = 17;\n /** Stop executing. */\n // @ts-ignore: decorator\n @inline\n export const STOP: signal = 18;\n /** Terminal stop signal. */\n // @ts-ignore: decorator\n @inline\n export const TSTP: signal = 19;\n /** Background process attempting read. */\n // @ts-ignore: decorator\n @inline\n export const TTIN: signal = 20;\n /** Background process attempting write. */\n // @ts-ignore: decorator\n @inline\n export const TTOU: signal = 21;\n /** High bandwidth data is available at a socket. */\n // @ts-ignore: decorator\n @inline\n export const URG: signal = 22;\n /** CPU time limit exceeded. */\n // @ts-ignore: decorator\n @inline\n export const XCPU: signal = 23;\n /** File size limit exceeded. */\n // @ts-ignore: decorator\n @inline\n export const XFSZ: signal = 24;\n /** Virtual timer expired. */\n // @ts-ignore: decorator\n @inline\n export const VTALRM: signal = 25;\n // @ts-ignore: decorator\n @inline\n export const PROF: signal = 26;\n // @ts-ignore: decorator\n @inline\n export const WINCH: signal = 27;\n // @ts-ignore: decorator\n @inline\n export const POLL: signal = 28;\n // @ts-ignore: decorator\n @inline\n export const PWR: signal = 29;\n /** Bad system call. */\n // @ts-ignore: decorator\n @inline\n export const SYS: signal = 30;\n}\nexport type signal = u8;\n\n/** Flags determining how to interpret the timestamp provided in `subscription_t::u.clock.timeout. */\nexport namespace subclockflags {\n /** If set, treat the timestamp provided in `clocksubscription` as an absolute timestamp. */\n // @ts-ignore: decorator\n @inline\n export const ABSTIME: subclockflags = 1;\n}\nexport type subclockflags = u16;\n\n/** Subscription to an event. */\n@unmanaged export abstract class subscription {\n /** User-provided value that is attached to the subscription. */\n userdata: userdata;\n /** The type of the event to which to subscribe. */\n type: eventtype;\n private __padding0: u32;\n}\n\n/* Subscription to an event of type `eventtype.CLOCK`.**/\n@unmanaged export class clocksubscription extends subscription {\n /** The user-defined unique identifier of the clock. */\n identifier: userdata;\n /** The clock against which to compare the timestamp. */\n clock_id: clockid;\n /** The absolute or relative timestamp. */\n timeout: timestamp;\n /** The amount of time that the implementation may wait additionally to coalesce with other events. */\n precision: timestamp;\n /** Flags specifying whether the timeout is absolute or relative. */\n flags: subclockflags;\n private __padding1: u32;\n}\n\n/* Subscription to an event of type `eventtype.FD_READ` or `eventtype.FD_WRITE`.**/\n@unmanaged export class fdsubscription extends subscription {\n /** The file descriptor on which to wait for it to become ready for reading or writing. */\n fd: fd;\n}\n\n/** Timestamp in nanoseconds. */\nexport type timestamp = u64;\n\n/** User-provided value that may be attached to objects that is retained when extracted from the implementation. */\nexport type userdata = u64;\n\n/** The position relative to which to set the offset of the file descriptor. */\nexport namespace whence {\n /** Seek relative to current position. */\n // @ts-ignore: decorator\n @inline\n export const CUR: whence = 0;\n /** Seek relative to end-of-file. */\n // @ts-ignore: decorator\n @inline\n export const END: whence = 1;\n /** Seek relative to start-of-file. */\n // @ts-ignore: decorator\n @inline\n export const SET: whence = 2;\n}\nexport type whence = u8;\n","bindings/wasi":'export * from "./wasi_unstable";\n',builtins:'// @ts-ignore: decorator\n@builtin @inline\nexport const NaN: f64 = 0 / 0;\n\n// @ts-ignore: decorator\n@builtin @inline\nexport const Infinity: f64 = 1 / 0;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isInteger(value?: T): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isFloat(value?: T): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isBoolean(value?: T): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isSigned(value?: T): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isReference(value?: T): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isString(value?: T): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isArray(value?: T): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isArrayLike(value?: T): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isFunction(value?: T): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isNullable(value?: T): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isDefined(expression: void): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isConstant(expression: void): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isManaged(value?: T): bool;\n\nexport function isNaN(value: T): bool {\n if (!isFloat()) {\n if (!isInteger()) ERROR("numeric type expected");\n }\n return value != value;\n}\n\nexport function isFinite(value: T): bool {\n if (!isFloat()) {\n if (!isInteger()) ERROR("numeric type expected");\n }\n return value - value == 0;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function clz(value: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function ctz(value: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function popcnt(value: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function rotl(value: T, shift: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function rotr(value: T, shift: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function abs(value: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function max(left: T, right: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function min(left: T, right: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function ceil(value: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function floor(value: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function copysign(left: T, right: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function nearest(value: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function reinterpret(value: number): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function sqrt(value: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function trunc(value: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function load(offset: usize, immOffset?: usize, immAlign?: usize): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function store(offset: usize, value: void, immOffset?: usize, immAlign?: usize): void;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function sizeof(): usize; // | u32 / u64\n\n// @ts-ignore: decorator\n@builtin\nexport declare function alignof(): usize; // | u32 / u64\n\n// @ts-ignore: decorator\n@builtin\nexport declare function offsetof(fieldName?: string): usize; // | u32 / u64\n\n// @ts-ignore: decorator\n@builtin\nexport declare function idof(): u32;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function select(ifTrue: T, ifFalse: T, condition: bool): T;\n\n// @ts-ignore: decorator\n@unsafe @builtin\nexport declare function unreachable(): void;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function changetype(value: void): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function assert(isTrueish: T, message?: string): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function unchecked(expr: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function call_indirect(target: void, ...args: void[]): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function call_direct(target: void, ...args: void[]): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function instantiate(...args: void[]): T;\n\nexport namespace atomic {\n // @ts-ignore: decorator\n @builtin\n export declare function load(offset: usize, immOffset?: usize): T;\n\n // @ts-ignore: decorator\n @builtin\n export declare function store(offset: usize, value: T, immOffset?: usize): void;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(ptr: usize, value: T, immOffset?: usize): T;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(ptr: usize, value: T, immOffset?: usize): T;\n\n // @ts-ignore: decorator\n @builtin\n export declare function and(ptr: usize, value: T, immOffset?: usize): T;\n\n // @ts-ignore: decorator\n @builtin\n export declare function or(ptr: usize, value: T, immOffset?: usize): T;\n\n // @ts-ignore: decorator\n @builtin\n export declare function xor(ptr: usize, value: T, immOffset?: usize): T;\n\n // @ts-ignore: decorator\n @builtin\n export declare function xchg(ptr: usize, value: T, immOffset?: usize): T;\n\n // @ts-ignore: decorator\n @builtin\n export declare function cmpxchg(ptr: usize, expected: T, replacement: T, immOffset?: usize): T;\n\n // @ts-ignore: decorator\n @builtin\n export declare function wait(ptr: usize, expected: T, timeout: i64): AtomicWaitResult;\n\n // @ts-ignore: decorator\n @builtin\n export declare function notify(ptr: usize, count: i32): i32;\n}\n\n// @ts-ignore: decorator\n@lazy\nexport const enum AtomicWaitResult {\n OK = 0,\n NOT_EQUAL = 1,\n TIMED_OUT = 2\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function i8(value: void): i8;\n\nexport namespace i8 {\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE: i8 = -128;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE: i8 = 127;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function i16(value: void): i16;\n\nexport namespace i16 {\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE: i16 = -32768;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE: i16 = 32767;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function i32(value: void): i32;\n\nexport namespace i32 {\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE: i32 = -2147483648;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE: i32 = 2147483647;\n\n // @ts-ignore: decorator\n @builtin\n export declare function clz(value: i32): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ctz(value: i32): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function popcnt(value: i32): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function rotl(value: i32, shift: i32): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function rotr(value: i32, shift: i32): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function reinterpret_f32(value: f32): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load8_s(offset: usize, immOffset?: usize, immAlign?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load8_u(offset: usize, immOffset?: usize, immAlign?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load16_s(offset: usize, immOffset?: usize, immAlign?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load16_u(offset: usize, immOffset?: usize, immAlign?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load(offset: usize, immOffset?: usize, immAlign?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function store8(offset: usize, value: i32, immOffset?: usize, immAlign?: usize): void;\n\n // @ts-ignore: decorator\n @builtin\n export declare function store16(offset: usize, value: i32, immOffset?: usize, immAlign?: usize): void;\n\n // @ts-ignore: decorator\n @builtin\n export declare function store(offset: usize, value: i32, immOffset?: usize, immAlign?: usize): void;\n\n export namespace atomic {\n\n // @ts-ignore: decorator\n @builtin\n export declare function load8_u(offset: usize, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load16_u(offset: usize, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load(offset: usize, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function store8(offset: usize, value: i32, immOffset?: usize): void;\n\n // @ts-ignore: decorator\n @builtin\n export declare function store16(offset: usize, value: i32, immOffset?: usize): void;\n\n // @ts-ignore: decorator\n @builtin\n export declare function store(offset: usize, value: i32, immOffset?: usize): void;\n\n // @ts-ignore: decorator\n @builtin\n export declare function wait(ptr: usize, expected: i32, timeout: i64): AtomicWaitResult;\n\n export namespace rmw8 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function add_u(offset: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub_u(offset: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function and_u(offset: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function or_u(offset: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function xor_u(offset: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function xchg_u(offset: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function cmpxchg_u(offset: usize, expected: i32, replacement: i32, immOffset?: usize): i32;\n }\n\n export namespace rmw16 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function add_u(offset: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub_u(offset: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function and_u(offset: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function or_u(offset: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function xor_u(offset: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function xchg_u(offset: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function cmpxchg_u(offset: usize, expected: i32, replacement: i32, immOffset?: usize): i32;\n }\n\n export namespace rmw {\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(offset: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(offset: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function and(offset: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function or(offset: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function xor(offset: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function xchg(offset: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function cmpxchg(offset: usize, expected: i32, replacement: i32, immOffset?: usize): i32;\n }\n }\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function i64(value: void): i64;\n\nexport namespace i64 {\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE: i64 = -9223372036854775808;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE: i64 = 9223372036854775807;\n\n // @ts-ignore: decorator\n @builtin\n export declare function clz(value: i64): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ctz(value: i64): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load8_s(offset: usize, immOffset?: usize, immAlign?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load8_u(offset: usize, immOffset?: usize, immAlign?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load16_s(offset: usize, immOffset?: usize, immAlign?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load16_u(offset: usize, immOffset?: usize, immAlign?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load32_s(offset: usize, immOffset?: usize, immAlign?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load32_u(offset: usize, immOffset?: usize, immAlign?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load(offset: usize, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function popcnt(value: i64): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function rotl(value: i64, shift: i64): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function rotr(value: i64, shift: i64): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function reinterpret_f64(value: f64): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function store8(offset: usize, value: i64, immOffset?: usize, immAlign?: usize): void;\n\n // @ts-ignore: decorator\n @builtin\n export declare function store16(offset: usize, value: i64, immOffset?: usize, immAlign?: usize): void;\n\n // @ts-ignore: decorator\n @builtin\n export declare function store32(offset: usize, value: i64, immOffset?: usize, immAlign?: usize): void;\n\n // @ts-ignore: decorator\n @builtin\n export declare function store(offset: usize, value: i64, immOffset?: usize, immAlign?: usize): void;\n\n export namespace atomic {\n\n // @ts-ignore: decorator\n @builtin\n export declare function load8_u(offset: usize, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load16_u(offset: usize, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load32_u(offset: usize, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load(offset: usize, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function store8(offset: usize, value: i64, immOffset?: usize): void;\n\n // @ts-ignore: decorator\n @builtin\n export declare function store16(offset: usize, value: i64, immOffset?: usize): void;\n\n // @ts-ignore: decorator\n @builtin\n export declare function store32(offset: usize, value: i64, immOffset?: usize): void;\n\n // @ts-ignore: decorator\n @builtin\n export declare function store(offset: usize, value: i64, immOffset?: usize): void;\n\n // @ts-ignore: decorator\n @builtin\n export declare function wait(ptr: usize, expected: i64, timeout: i64): AtomicWaitResult;\n\n export namespace rmw8 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function add_u(offset: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub_u(offset: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function and_u(offset: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function or_u(offset: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function xor_u(offset: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function xchg_u(offset: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function cmpxchg_u(offset: usize, expected: i64, replacement: i64, immOffset?: usize): i64;\n }\n\n export namespace rmw16 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function add_u(offset: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub_u(offset: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function and_u(offset: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function or_u(offset: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function xor_u(offset: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function xchg_u(offset: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function cmpxchg_u(offset: usize, expected: i64, replacement: i64, immOffset?: usize): i64;\n }\n\n export namespace rmw32 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function add_u(offset: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub_u(offset: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function and_u(offset: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function or_u(offset: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function xor_u(offset: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function xchg_u(offset: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function cmpxchg_u(offset: usize, expected: i64, replacement: i64, immOffset?: usize): i64;\n }\n\n export namespace rmw {\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(offset: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(offset: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function and(offset: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function or(offset: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function xor(offset: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function xchg(offset: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function cmpxchg(offset: usize, expected: i64, replacement: i64, immOffset?: usize): i64;\n }\n }\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isize(value: void): isize;\n\nexport namespace isize {\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE: isize = sizeof() == sizeof()\n ? -2147483648\n : -9223372036854775808;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE: isize = sizeof() == sizeof()\n ? 2147483647\n : 9223372036854775807;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function u8(value: void): u8;\n\nexport namespace u8 {\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE: u8 = 0;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE: u8 = 255;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function u16(value: void): u16;\n\nexport namespace u16 {\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE: u16 = 0;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE: u16 = 65535;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function u32(value: void): u32;\n\nexport namespace u32 {\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE: u32 = 0;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE: u32 = 4294967295;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function u64(value: void): u64;\n\nexport namespace u64 {\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE: u64 = 0;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE: u64 = 18446744073709551615;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function usize(value: void): usize;\n\nexport namespace usize {\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE: usize = 0;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE: usize = sizeof() == sizeof()\n ? 4294967295\n : 18446744073709551615;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function bool(value: void): bool;\n\nexport namespace bool {\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE: bool = false;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE: bool = true;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function f32(value: void): f32;\n\nexport namespace f32 {\n\n // @ts-ignore: decorator\n @lazy\n export const EPSILON = reinterpret(0x34000000); // 0x1p-23f\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE = reinterpret(0x00000001); // 0x0.000001p+0f\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE = reinterpret(0x7F7FFFFF); // 0x1.fffffep+127f\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_NORMAL_VALUE = reinterpret(0x00800000); // 0x1p-126f\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_SAFE_INTEGER: f32 = -16777215;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_SAFE_INTEGER: f32 = 16777215;\n\n // @ts-ignore: decorator\n @builtin\n export declare function abs(value: f32): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ceil(value: f32): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function copysign(x: f32, y: f32): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function floor(value: f32): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load(offset: usize, immOffset?: usize, immAlign?: usize): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function max(left: f32, right: f32): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function min(left: f32, right: f32): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function nearest(value: f32): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function reinterpret_i32(value: i32): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sqrt(value: f32): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function store(offset: usize, value: f32, immOffset?: usize, immAlign?: usize): void;\n\n // @ts-ignore: decorator\n @builtin\n export declare function trunc(value: f32): f32;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function f64(value: void): f64;\n\nexport namespace f64 {\n\n // @ts-ignore: decorator\n @lazy\n export const EPSILON = reinterpret(0x3CB0000000000000); // 0x1p-52\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE = reinterpret(0x0000000000000001); // 0x0.0000000000001p+0\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE = reinterpret(0x7FEFFFFFFFFFFFFF); // 0x1.fffffffffffffp+1023\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_NORMAL_VALUE = reinterpret(0x0010000000000000); // 0x1p-1022\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_SAFE_INTEGER: f64 = -9007199254740991;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_SAFE_INTEGER: f64 = 9007199254740991;\n\n // @ts-ignore: decorator\n @builtin\n export declare function abs(value: f64): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ceil(value: f64): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function copysign(x: f64, y: f64): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function floor(value: f64): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load(offset: usize, immOffset?: usize, immAlign?: usize): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function max(left: f64, right: f64): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function min(left: f64, right: f64): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function nearest(value: f64): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function reinterpret_i64(value: i64): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sqrt(value: f64): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function store(offset: usize, value: f64, immOffset?: usize, immAlign?: usize): void;\n\n // @ts-ignore: decorator\n @builtin\n export declare function trunc(value: f64): f64;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function v128(\n a: i8, b: i8, c: i8, d: i8, e: i8, f: i8, g: i8, h: i8,\n i: i8, j: i8, k: i8, l: i8, m: i8, n: i8, o: i8, p: i8\n): v128;\n\nexport namespace v128 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function splat(x: T): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extract_lane(x: v128, idx: u8): T;\n\n // @ts-ignore: decorator\n @builtin\n export declare function replace_lane(x: v128, idx: u8, value: T): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shuffle(a: v128, b: v128, ...lanes: u8[]): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load(offset: usize, immOffset?: usize, immAlign?: usize): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function store(offset: usize, value: v128, immOffset?: usize, immAlign?: usize): void;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function mul(a: v128, b: v128): v128; // except i64\n\n // @ts-ignore: decorator\n @builtin\n export declare function div(a: v128, b: v128): v128; // f32, f64 only\n\n // @ts-ignore: decorator\n @builtin\n export declare function neg(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add_saturate(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub_saturate(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shl(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shr(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function and(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function or(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function xor(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function not(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function bitselect(v1: v128, v2: v128, c: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function any_true(a: v128): bool;\n\n // @ts-ignore: decorator\n @builtin\n export declare function all_true(a: v128): bool;\n\n // @ts-ignore: decorator\n @builtin\n export declare function min(a: v128, b: v128): v128; // f32, f64 only\n\n // @ts-ignore: decorator\n @builtin\n export declare function max(a: v128, b: v128): v128; // f32, f64 only\n\n // @ts-ignore: decorator\n @builtin\n export declare function abs(a: v128): v128; // f32, f64 only\n\n // @ts-ignore: decorator\n @builtin\n export declare function sqrt(a: v128): v128; // f32, f64 only\n\n // @ts-ignore: decorator\n @builtin\n export declare function eq(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ne(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function lt(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function le(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function gt(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ge(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function convert(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function trunc(a: v128): v128;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function i8x16(\n a: i8, b: i8, c: i8, d: i8, e: i8, f: i8, g: i8, h: i8,\n i: i8, j: i8, k: i8, l: i8, m: i8, n: i8, o: i8, p: i8\n): v128;\n\nexport namespace i8x16 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function splat(x: i8): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extract_lane_s(x: v128, idx: u8): i8;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extract_lane_u(x: v128, idx: u8): u8;\n\n // @ts-ignore: decorator\n @builtin\n export declare function replace_lane(x: v128, idx: u8, value: i8): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function mul(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function neg(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add_saturate_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add_saturate_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub_saturate_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub_saturate_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shl(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shr_s(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shr_u(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function any_true(a: v128): bool;\n\n // @ts-ignore: decorator\n @builtin\n export declare function all_true(a: v128): bool;\n\n // @ts-ignore: decorator\n @builtin\n export declare function eq(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ne(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function lt_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function lt_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function le_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function le_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function gt_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function gt_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ge_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ge_u(a: v128, b: v128): v128;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function i16x8(a: i16, b: i16, c: i16, d: i16, e: i16, f: i16, g: i16, h: i16): v128;\n\nexport namespace i16x8 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function splat(x: i16): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extract_lane_s(x: v128, idx: u8): i16;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extract_lane_u(x: v128, idx: u8): u16;\n\n // @ts-ignore: decorator\n @builtin\n export declare function replace_lane(x: v128, idx: u8, value: i16): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function mul(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function neg(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add_saturate_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add_saturate_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub_saturate_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub_saturate_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shl(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shr_s(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shr_u(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function any_true(a: v128): bool;\n\n // @ts-ignore: decorator\n @builtin\n export declare function all_true(a: v128): bool;\n\n // @ts-ignore: decorator\n @builtin\n export declare function eq(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ne(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function lt_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function lt_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function le_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function le_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function gt_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function gt_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ge_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ge_u(a: v128, b: v128): v128;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function i32x4(a: i32, b: i32, c: i32, d: i32): v128;\n\nexport namespace i32x4 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function splat(x: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extract_lane(x: v128, idx: u8): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function replace_lane(x: v128, idx: u8, value: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function mul(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function neg(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shl(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shr_s(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shr_u(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function any_true(a: v128): bool;\n\n // @ts-ignore: decorator\n @builtin\n export declare function all_true(a: v128): bool;\n\n // @ts-ignore: decorator\n @builtin\n export declare function eq(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ne(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function lt_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function lt_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function le_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function le_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function gt_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function gt_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ge_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ge_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function trunc_s_f32x4_sat(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function trunc_u_f32x4_sat(a: v128): v128;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function i64x2(a: i64, b: i64): v128;\n\nexport namespace i64x2 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function splat(x: i64): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extract_lane(x: v128, idx: u8): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function replace_lane(x: v128, idx: u8, value: i64): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function mul(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function neg(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shl(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shr_s(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shr_u(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function any_true(a: v128): bool;\n\n // @ts-ignore: decorator\n @builtin\n export declare function all_true(a: v128): bool;\n\n // @ts-ignore: decorator\n @builtin\n export declare function trunc_s_f64x2_sat(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function trunc_u_f64x2_sat(a: v128): v128;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function f32x4(a: f32, b: f32, c: f32, d: f32): v128;\n\nexport namespace f32x4 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function splat(x: f32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extract_lane(x: v128, idx: u8): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function replace_lane(x: v128, idx: u8, value: f32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function mul(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function div(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function neg(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function min(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function max(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function abs(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sqrt(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function eq(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ne(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function lt(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function le(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function gt(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ge(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function convert_s_i32x4(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function convert_u_i32x4(a: v128): v128;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function f64x2(a: f64, b: f64): v128;\n\nexport namespace f64x2 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function splat(x: f64): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extract_lane(x: v128, idx: u8): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function replace_lane(x: v128, idx: u8, value: f64): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function mul(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function div(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function neg(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function min(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function max(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function abs(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sqrt(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function eq(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ne(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function lt(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function le(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function gt(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ge(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function convert_s_i64x2(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function convert_u_i64x2(a: v128): v128;\n}\n\nexport namespace v8x16 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function shuffle(\n a: v128, b: v128,\n l0: u8, l1: u8, l2: u8, l3: u8, l4: u8, l5: u8, l6: u8, l7: u8,\n l8: u8, l9: u8, l10: u8, l11: u8, l12: u8, l13: u8, l14: u8, l15: u8\n ): v128;\n}\n\n// @ts-ignore: decorator\n@external("env", "abort")\ndeclare function abort(\n message?: string | null,\n fileName?: string | null,\n lineNumber?: u32,\n columnNumber?: u32\n): void;\n\n// @ts-ignore: decorator\n@external("env", "trace")\ndeclare function trace(\n message: string,\n n?: i32,\n a0?: f64,\n a1?: f64,\n a2?: f64,\n a3?: f64,\n a4?: f64\n): void;\n',dataview:'import { BLOCK_MAXSIZE } from "./rt/common";\nimport { ArrayBuffer } from "./arraybuffer";\nimport { E_INDEXOUTOFRANGE, E_INVALIDLENGTH } from "./util/error";\n\n// TODO: there is probably a smarter way to check byteOffset for accesses larger than 1 byte\n\nexport class DataView {\n\n private data: ArrayBuffer;\n private dataStart: usize;\n private dataLength: i32;\n\n constructor(\n buffer: ArrayBuffer,\n byteOffset: i32 = 0,\n byteLength: i32 = buffer.byteLength\n ) {\n if (\n i32(byteLength > BLOCK_MAXSIZE) |\n i32(byteOffset + byteLength > buffer.byteLength)\n ) throw new RangeError(E_INVALIDLENGTH);\n this.data = buffer; // retains\n var dataStart = changetype(buffer) + byteOffset;\n this.dataStart = dataStart;\n this.dataLength = byteLength;\n }\n\n get buffer(): ArrayBuffer {\n return this.data;\n }\n\n get byteOffset(): i32 {\n return (this.dataStart - changetype(this.data));\n }\n\n get byteLength(): i32 {\n return this.dataLength;\n }\n\n getFloat32(byteOffset: i32, littleEndian: boolean = false): f32 {\n if (\n i32(byteOffset < 0) |\n i32(byteOffset + 4 > this.dataLength)\n ) throw new RangeError(E_INDEXOUTOFRANGE);\n return littleEndian\n ? load(this.dataStart + byteOffset)\n : reinterpret(\n bswap(\n load(this.dataStart + byteOffset)\n )\n );\n }\n\n getFloat64(byteOffset: i32, littleEndian: boolean = false): f64 {\n if (\n i32(byteOffset < 0) |\n i32(byteOffset + 8 > this.dataLength)\n ) throw new RangeError(E_INDEXOUTOFRANGE);\n return littleEndian\n ? load(this.dataStart + byteOffset)\n : reinterpret(\n bswap(\n load(this.dataStart + byteOffset)\n )\n );\n }\n\n getInt8(byteOffset: i32): i8 {\n if (byteOffset >= this.dataLength) throw new RangeError(E_INDEXOUTOFRANGE);\n return load(this.dataStart + byteOffset);\n }\n\n getInt16(byteOffset: i32, littleEndian: boolean = false): i16 {\n if (\n i32(byteOffset < 0) |\n i32(byteOffset + 2 > this.dataLength)\n ) throw new RangeError(E_INDEXOUTOFRANGE);\n var result: i16 = load(this.dataStart + byteOffset);\n return littleEndian ? result : bswap(result);\n }\n\n getInt32(byteOffset: i32, littleEndian: boolean = false): i32 {\n if (\n i32(byteOffset < 0) |\n i32(byteOffset + 4 > this.dataLength)\n ) throw new RangeError(E_INDEXOUTOFRANGE);\n var result: i32 = load(this.dataStart + byteOffset);\n return littleEndian ? result : bswap(result);\n }\n\n getUint8(byteOffset: i32): u8 {\n if (byteOffset >= this.dataLength) throw new RangeError(E_INDEXOUTOFRANGE);\n return load(this.dataStart + byteOffset);\n }\n\n getUint16(byteOffset: i32, littleEndian: boolean = false): u16 {\n if (\n i32(byteOffset < 0) |\n i32(byteOffset + 2 > this.dataLength)\n ) throw new RangeError(E_INDEXOUTOFRANGE);\n var result: u16 = load(this.dataStart + byteOffset);\n return littleEndian ? result : bswap(result);\n }\n\n getUint32(byteOffset: i32, littleEndian: boolean = false): u32 {\n if (\n i32(byteOffset < 0) |\n i32(byteOffset + 4 > this.dataLength)\n ) throw new RangeError(E_INDEXOUTOFRANGE);\n var result: u32 = load(this.dataStart + byteOffset);\n return littleEndian ? result : bswap(result);\n }\n\n setFloat32(byteOffset: i32, value: f32, littleEndian: boolean = false): void {\n if (\n i32(byteOffset < 0) |\n i32(byteOffset + 4 > this.dataLength)\n ) throw new RangeError(E_INDEXOUTOFRANGE);\n if (littleEndian) store(this.dataStart + byteOffset, value);\n else store(this.dataStart + byteOffset, bswap(reinterpret(value)));\n }\n\n setFloat64(byteOffset: i32, value: f64, littleEndian: boolean = false): void {\n if (\n i32(byteOffset < 0) |\n i32(byteOffset + 8 > this.dataLength)\n ) throw new RangeError(E_INDEXOUTOFRANGE);\n if (littleEndian) store(this.dataStart + byteOffset, value);\n else store(this.dataStart + byteOffset, bswap(reinterpret(value)));\n }\n\n setInt8(byteOffset: i32, value: i8): void {\n if (byteOffset >= this.dataLength) throw new RangeError(E_INDEXOUTOFRANGE);\n store(this.dataStart + byteOffset, value);\n }\n\n setInt16(byteOffset: i32, value: i16, littleEndian: boolean = false): void {\n if (\n i32(byteOffset < 0) |\n i32(byteOffset + 2 > this.dataLength)\n ) throw new RangeError(E_INDEXOUTOFRANGE);\n store(this.dataStart + byteOffset, littleEndian ? value : bswap(value));\n }\n\n setInt32(byteOffset: i32, value: i32, littleEndian: boolean = false): void {\n if (\n i32(byteOffset < 0) |\n i32(byteOffset + 4 > this.dataLength)\n ) throw new RangeError(E_INDEXOUTOFRANGE);\n store(this.dataStart + byteOffset, littleEndian ? value : bswap(value));\n }\n\n setUint8(byteOffset: i32, value: u8): void {\n if (byteOffset >= this.dataLength) throw new RangeError(E_INDEXOUTOFRANGE);\n store(this.dataStart + byteOffset, value);\n }\n\n setUint16(byteOffset: i32, value: u16, littleEndian: boolean = false): void {\n if (\n i32(byteOffset < 0) |\n i32(byteOffset + 2 > this.dataLength)\n ) throw new RangeError(E_INDEXOUTOFRANGE);\n store(this.dataStart + byteOffset, littleEndian ? value : bswap(value));\n }\n\n setUint32(byteOffset: i32, value: u32, littleEndian: boolean = false): void {\n if (\n i32(byteOffset < 0) |\n i32(byteOffset + 4 > this.dataLength)\n ) throw new RangeError(E_INDEXOUTOFRANGE);\n store(this.dataStart + byteOffset, littleEndian ? value : bswap(value));\n }\n\n // Non-standard additions that make sense in WebAssembly, but won\'t work in JS:\n\n getInt64(byteOffset: i32, littleEndian: boolean = false): i64 {\n if (\n i32(byteOffset < 0) |\n i32(byteOffset + 8 > this.dataLength)\n ) throw new RangeError(E_INDEXOUTOFRANGE);\n var result: i64 = load(this.dataStart + byteOffset);\n return littleEndian ? result : bswap(result);\n }\n\n getUint64(byteOffset: i32, littleEndian: boolean = false): u64 {\n if (\n i32(byteOffset < 0) |\n i32(byteOffset + 8 > this.dataLength)\n ) throw new RangeError(E_INDEXOUTOFRANGE);\n var result = load(this.dataStart + byteOffset);\n return littleEndian ? result : bswap(result);\n }\n\n setInt64(byteOffset: i32, value: i64, littleEndian: boolean = false): void {\n if (\n i32(byteOffset < 0) |\n i32(byteOffset + 8 > this.dataLength)\n ) throw new RangeError(E_INDEXOUTOFRANGE);\n store(this.dataStart + byteOffset, littleEndian ? value : bswap(value));\n }\n\n setUint64(byteOffset: i32, value: u64, littleEndian: boolean = false): void {\n if (\n i32(byteOffset < 0) |\n i32(byteOffset + 8 > this.dataLength)\n ) throw new RangeError(E_INDEXOUTOFRANGE);\n store(this.dataStart + byteOffset, littleEndian ? value : bswap(value));\n }\n\n toString(): string {\n return "[object DataView]";\n }\n}\n',date:'import {\n UTC as Date_UTC,\n now as Date_now\n} from "./bindings/Date";\n\nexport class Date {\n\n @inline static UTC(\n year: i32,\n month: i32 = 0,\n day: i32 = 1,\n hour: i32 = 0,\n minute: i32 = 0,\n second: i32 = 0,\n millisecond: i64 = 0\n ): i64 {\n return Date_UTC(year, month, day, hour, minute, second, millisecond);\n }\n\n @inline static now(): i64 {\n return Date_now();\n }\n\n private value: i64;\n\n constructor(value: i64) {\n this.value = value;\n }\n\n getTime(): i64 {\n return this.value;\n }\n\n setTime(value: i64): i64 {\n this.value = value;\n return value;\n }\n}\n',diagnostics:"// @ts-ignore: decorator\n@builtin\nexport declare function ERROR(message?: string): void;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function WARNING(message?: string): void;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function INFO(message?: string): void;\n",error:'export class Error {\n\n name: string = "Error";\n stack: string = ""; // TODO\n\n constructor(\n public message: string = ""\n ) {}\n\n toString(): string {\n var message = this.message;\n return message.length\n ? this.name + ": " + message\n : this.name;\n }\n}\n\nexport class RangeError extends Error {\n constructor(message: string = "") {\n super(message);\n this.name = "RangeError";\n }\n}\n\nexport class TypeError extends Error {\n constructor(message: string = "") {\n super(message);\n this.name = "TypeError";\n }\n}\n\nexport class SyntaxError extends Error {\n constructor(message: string = "") {\n super(message);\n this.name = "SyntaxError";\n }\n}\n',fixedarray:'/// \n\nimport { BLOCK, BLOCK_OVERHEAD, BLOCK_MAXSIZE } from "./rt/common";\nimport { idof } from "./builtins";\nimport { E_INDEXOUTOFRANGE, E_INVALIDLENGTH, E_HOLEYARRAY } from "./util/error";\n\n// NOTE: DO NOT USE YET!\n\n// TODO: FixedArray with S being the static size, i.e. `new FixedArray`.\n// Then hard-wire this special type to the compiler and do static length checks instead :)\n\nexport class FixedArray {\n [key: number]: T;\n\n constructor(length: i32) {\n if (length > BLOCK_MAXSIZE >>> alignof()) throw new RangeError(E_INVALIDLENGTH);\n if (isReference()) {\n if (!isNullable()) {\n if (length) throw new Error(E_HOLEYARRAY);\n }\n }\n var outSize = length << alignof();\n var out = __alloc(outSize, idof>());\n memory.fill(out, 0, outSize);\n return changetype>(out); // retains\n }\n\n get length(): i32 {\n return changetype(changetype(this) - BLOCK_OVERHEAD).rtSize >>> alignof();\n }\n\n @operator("[]") private __get(index: i32): T {\n if (index >= this.length) throw new RangeError(E_INDEXOUTOFRANGE);\n return this.__unchecked_get(index);\n }\n\n @operator("[]=") private __set(index: i32, value: T): void {\n if (index >= this.length) throw new RangeError(E_INDEXOUTOFRANGE);\n this.__unchecked_set(index, value);\n }\n\n @operator("{}") private __unchecked_get(index: i32): T {\n return load(changetype(this) + (index << alignof()));\n }\n\n @operator("{}=") private __unchecked_set(index: i32, value: T): void {\n if (isManaged()) {\n let offset = changetype(this) + (index << alignof());\n let oldValue = load(offset);\n if (changetype(value) != oldValue) {\n store(offset, __retain(changetype(value)));\n __release(changetype(oldValue));\n }\n } else {\n store(changetype(this) + (index << alignof()), value);\n }\n }\n\n // RT integration\n\n @unsafe private __visit_impl(cookie: u32): void {\n if (isManaged()) {\n let cur = changetype(this);\n let end = cur + changetype(changetype(this) - BLOCK_OVERHEAD).rtSize;\n while (cur < end) {\n let val = load(cur);\n if (val) __visit(val, cookie);\n cur += sizeof();\n }\n }\n }\n}\n',heap:"// @ts-ignore: decorator\n@builtin\nexport declare const __heap_base: usize;\n",iterator:"export abstract class Iterable {\n // ?\n}\n\n@sealed\nexport abstract class Iterator {\n\n // private constructor(iterable: Iterable) {\n // }\n\n // TODO: these need to evaluate the classId at the respective reference in order to obtain the\n // next value, i.e. arrays work differently than maps. we'd then have:\n //\n // ╒═══════════════════ Iterator layout (32-bit) ══════════════════╕\n // 3 2 1\n // 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits\n // ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┤\n // │ index │\n // ├─────────────────────────────────────────────────────────┬───┬─┤\n // │ reference │ 0 │D│\n // └─────────────────────────────────────────────────────────┴───┴─┘\n // D: Done flag\n\n // get value(this: u64): T {\n // ?\n // }\n\n // next(this: u64): Iterator {\n // ?\n // }\n\n done(this: u64): bool {\n return (this & 1);\n }\n}\n",map:'/// \n\nimport { HASH } from "./util/hash";\n\n// A deterministic hash map based on CloseTable from https://github.com/jorendorff/dht\n\n// @ts-ignore: decorator\n@inline\nconst INITIAL_CAPACITY = 4;\n\n// @ts-ignore: decorator\n@inline\nconst FILL_FACTOR: f64 = 8 / 3;\n\n// @ts-ignore: decorator\n@inline\nconst FREE_FACTOR: f64 = 3 / 4;\n\n/** Structure of a map entry. */\n@unmanaged class MapEntry {\n key: K;\n value: V;\n taggedNext: usize; // LSB=1 indicates EMPTY\n}\n\n/** Empty bit. */\n// @ts-ignore: decorator\n@inline\nconst EMPTY: usize = 1 << 0;\n\n/** Size of a bucket. */\n// @ts-ignore: decorator\n@inline\nconst BUCKET_SIZE = sizeof();\n\n/** Computes the alignment of an entry. */\n// @ts-ignore: decorator\n@inline\nfunction ENTRY_ALIGN(): usize {\n // can align to 4 instead of 8 if 32-bit and K/V is <= 32-bits\n const maxkv = sizeof() > sizeof() ? sizeof() : sizeof();\n const align = (maxkv > sizeof() ? maxkv : sizeof()) - 1;\n return align;\n}\n\n/** Computes the aligned size of an entry. */\n// @ts-ignore: decorator\n@inline\nfunction ENTRY_SIZE(): usize {\n const align = ENTRY_ALIGN();\n const size = (offsetof>() + align) & ~align;\n return size;\n}\n\nexport class Map {\n\n // buckets holding references to the respective first entry within\n private buckets: ArrayBuffer; // usize[bucketsMask + 1]\n private bucketsMask: u32;\n\n // entries in insertion order\n private entries: ArrayBuffer; // MapEntry[entriesCapacity]\n private entriesCapacity: i32;\n private entriesOffset: i32;\n private entriesCount: i32;\n\n get size(): i32 { return this.entriesCount; }\n\n constructor() {\n this.clear();\n }\n\n clear(): void {\n const bucketsSize = INITIAL_CAPACITY * BUCKET_SIZE;\n this.buckets = new ArrayBuffer(bucketsSize);\n this.bucketsMask = INITIAL_CAPACITY - 1;\n const entriesSize = INITIAL_CAPACITY * ENTRY_SIZE();\n this.entries = new ArrayBuffer(entriesSize);\n this.entriesCapacity = INITIAL_CAPACITY;\n this.entriesOffset = 0;\n this.entriesCount = 0;\n }\n\n private find(key: K, hashCode: u32): MapEntry | null {\n var entry = load>( // unmanaged!\n changetype(this.buckets) + (hashCode & this.bucketsMask) * BUCKET_SIZE\n );\n while (entry) {\n if (!(entry.taggedNext & EMPTY) && entry.key == key) return entry;\n entry = changetype>(entry.taggedNext & ~EMPTY);\n }\n return null;\n }\n\n has(key: K): bool {\n return this.find(key, HASH(key)) !== null;\n }\n\n get(key: K): V {\n var entry = this.find(key, HASH(key));\n return entry ? entry.value : unreachable();\n }\n\n set(key: K, value: V): void {\n var hashCode = HASH(key);\n var entry = this.find(key, hashCode); // unmanaged!\n if (entry) {\n if (isManaged()) {\n let oldRef = changetype(entry.value);\n if (changetype(value) != oldRef) {\n entry.value = changetype(__retain(changetype(value)));\n __release(oldRef);\n }\n } else {\n entry.value = value;\n }\n } else {\n // check if rehashing is necessary\n if (this.entriesOffset == this.entriesCapacity) {\n this.rehash(\n this.entriesCount < (this.entriesCapacity * FREE_FACTOR)\n ? this.bucketsMask // just rehash if 1/4+ entries are empty\n : (this.bucketsMask << 1) | 1 // grow capacity to next 2^N\n );\n }\n // append new entry\n let entries = this.entries;\n entry = changetype>(changetype(entries) + this.entriesOffset++ * ENTRY_SIZE());\n // link with the map\n entry.key = isManaged()\n ? changetype(__retain(changetype(key)))\n : key;\n entry.value = isManaged()\n ? changetype(__retain(changetype(value)))\n : value;\n ++this.entriesCount;\n // link with previous entry in bucket\n let bucketPtrBase = changetype(this.buckets) + (hashCode & this.bucketsMask) * BUCKET_SIZE;\n entry.taggedNext = load(bucketPtrBase);\n store(bucketPtrBase, changetype(entry));\n }\n }\n\n delete(key: K): bool {\n var entry = this.find(key, HASH(key));\n if (!entry) return false;\n if (isManaged()) __release(changetype(entry.key));\n if (isManaged()) __release(changetype(entry.value));\n entry.taggedNext |= EMPTY;\n --this.entriesCount;\n // check if rehashing is appropriate\n var halfBucketsMask = this.bucketsMask >> 1;\n if (\n halfBucketsMask + 1 >= max(INITIAL_CAPACITY, this.entriesCount) &&\n this.entriesCount < (this.entriesCapacity * FREE_FACTOR)\n ) this.rehash(halfBucketsMask);\n return true;\n }\n\n private rehash(newBucketsMask: u32): void {\n var newBucketsCapacity = (newBucketsMask + 1);\n var newBuckets = new ArrayBuffer(newBucketsCapacity * BUCKET_SIZE);\n var newEntriesCapacity = (newBucketsCapacity * FILL_FACTOR);\n var newEntries = new ArrayBuffer(newEntriesCapacity * ENTRY_SIZE());\n\n // copy old entries to new entries\n var oldPtr = changetype(this.entries);\n var oldEnd = oldPtr + this.entriesOffset * ENTRY_SIZE();\n var newPtr = changetype(newEntries);\n while (oldPtr != oldEnd) {\n let oldEntry = changetype>(oldPtr);\n if (!(oldEntry.taggedNext & EMPTY)) {\n let newEntry = changetype>(newPtr);\n newEntry.key = oldEntry.key;\n newEntry.value = oldEntry.value;\n let newBucketIndex = HASH(oldEntry.key) & newBucketsMask;\n let newBucketPtrBase = changetype(newBuckets) + newBucketIndex * BUCKET_SIZE;\n newEntry.taggedNext = load(newBucketPtrBase);\n store(newBucketPtrBase, newPtr);\n newPtr += ENTRY_SIZE();\n }\n oldPtr += ENTRY_SIZE();\n }\n\n this.buckets = newBuckets;\n this.bucketsMask = newBucketsMask;\n this.entries = newEntries;\n this.entriesCapacity = newEntriesCapacity;\n this.entriesOffset = this.entriesCount;\n }\n\n keys(): K[] {\n // FIXME: this is preliminary, needs iterators/closures\n var start = changetype(this.entries);\n var size = this.entriesOffset;\n var keys = Array.create(size);\n for (let i = 0; i < size; ++i) {\n let entry = changetype>(start + i * ENTRY_SIZE());\n if (!(entry.taggedNext & EMPTY)) {\n keys.push(entry.key);\n }\n }\n return keys;\n }\n\n values(): V[] {\n // FIXME: this is preliminary, needs iterators/closures\n var start = changetype(this.entries);\n var size = this.entriesOffset;\n var values = Array.create(size);\n for (let i = 0; i < size; ++i) {\n let entry = changetype>(start + i * ENTRY_SIZE());\n if (!(entry.taggedNext & EMPTY)) {\n values.push(entry.value);\n }\n }\n return values;\n }\n\n toString(): string {\n return "[object Map]";\n }\n\n // RT integration\n\n @unsafe private __visit_impl(cookie: u32): void {\n __visit(changetype(this.buckets), cookie);\n var entries = changetype(this.entries);\n if (isManaged() || isManaged()) {\n let cur = entries;\n let end = cur + this.entriesOffset * ENTRY_SIZE();\n while (cur < end) {\n let entry = changetype>(cur);\n if (!(entry.taggedNext & EMPTY)) {\n if (isManaged()) {\n let val = changetype(entry.key);\n if (isNullable()) {\n if (val) __visit(val, cookie);\n } else __visit(val, cookie);\n }\n if (isManaged()) {\n let val = changetype(entry.value);\n if (isNullable()) {\n if (val) __visit(val, cookie);\n } else __visit(val, cookie);\n }\n }\n cur += ENTRY_SIZE();\n }\n }\n __visit(entries, cookie);\n }\n}\n',math:'import * as JSMath from "./bindings/Math";\nexport { JSMath };\n\nimport {\n abs as builtin_abs,\n ceil as builtin_ceil,\n clz as builtin_clz,\n copysign as builtin_copysign,\n floor as builtin_floor,\n max as builtin_max,\n min as builtin_min,\n sqrt as builtin_sqrt,\n trunc as builtin_trunc\n} from "./builtins";\n\n// SUN COPYRIGHT NOTICE\n//\n// Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.\n// Developed at SunPro, a Sun Microsystems, Inc. business.\n// Permission to use, copy, modify, and distribute this software\n// is freely granted, provided that this notice is preserved.\n//\n// Applies to all functions marked with a comment referring here.\n\n// TODO: sin, cos, tan for Math namespace\n\n/** @internal */\nfunction R(z: f64): f64 { // Rational approximation of (asin(x)-x)/x^3\n const // see: musl/src/math/asin.c and SUN COPYRIGHT NOTICE above\n pS0 = reinterpret(0x3FC5555555555555), // 1.66666666666666657415e-01\n pS1 = reinterpret(0xBFD4D61203EB6F7D), // -3.25565818622400915405e-01\n pS2 = reinterpret(0x3FC9C1550E884455), // 2.01212532134862925881e-01\n pS3 = reinterpret(0xBFA48228B5688F3B), // -4.00555345006794114027e-02\n pS4 = reinterpret(0x3F49EFE07501B288), // 7.91534994289814532176e-04\n pS5 = reinterpret(0x3F023DE10DFDF709), // 3.47933107596021167570e-05\n qS1 = reinterpret(0xC0033A271C8A2D4B), // -2.40339491173441421878e+00\n qS2 = reinterpret(0x40002AE59C598AC8), // 2.02094576023350569471e+00\n qS3 = reinterpret(0xBFE6066C1B8D0159), // -6.88283971605453293030e-01\n qS4 = reinterpret(0x3FB3B8C5B12E9282); // 7.70381505559019352791e-02\n var p = z * (pS0 + z * (pS1 + z * (pS2 + z * (pS3 + z * (pS4 + z * pS5)))));\n var q = 1.0 + z * (qS1 + z * (qS2 + z * (qS3 + z * qS4)));\n return p / q;\n}\n\n// @ts-ignore: decorator\n@inline\nfunction expo2(x: f64): f64 { // exp(x)/2 for x >= log(DBL_MAX)\n const // see: musl/src/math/__expo2.c\n k = 2043,\n kln2 = reinterpret(0x40962066151ADD8B); // 0x1.62066151add8bp+10\n var scale = reinterpret(((0x3FF + k / 2) << 20) << 32);\n return NativeMath.exp(x - kln2) * scale * scale;\n}\n\n// @ts-ignore: decorator\n@lazy\nvar random_seeded = false;\n\n// @ts-ignore: decorator\n@lazy\nvar random_state0_64: u64;\n\n// @ts-ignore: decorator\n@lazy\nvar random_state1_64: u64;\n\n// @ts-ignore: decorator\n@lazy\nvar random_state0_32: u32;\n\n// @ts-ignore: decorator\n@lazy\nvar random_state1_32: u32;\n\nfunction murmurHash3(h: u64): u64 { // Force all bits of a hash block to avalanche\n h ^= h >> 33; // see: https://github.com/aappleby/smhasher\n h *= 0xFF51AFD7ED558CCD;\n h ^= h >> 33;\n h *= 0xC4CEB9FE1A85EC53;\n h ^= h >> 33;\n return h;\n}\n\nfunction splitMix32(h: u32): u32 {\n h += 0x6D2B79F5;\n h = (h ^ (h >> 15)) * (h | 1);\n h ^= h + (h ^ (h >> 7)) * (h | 61);\n return h ^ (h >> 14);\n}\n\nexport namespace NativeMath {\n\n // @ts-ignore: decorator\n @lazy\n export const E = reinterpret(0x4005BF0A8B145769); // 2.7182818284590452354\n\n // @ts-ignore: decorator\n @lazy\n export const LN2 = reinterpret(0x3FE62E42FEFA39EF); // 0.69314718055994530942\n\n // @ts-ignore: decorator\n @lazy\n export const LN10 = reinterpret(0x40026BB1BBB55516); // 2.30258509299404568402\n\n // @ts-ignore: decorator\n @lazy\n export const LOG2E = reinterpret(0x3FF71547652B82FE); // 1.4426950408889634074\n\n // @ts-ignore: decorator\n @lazy\n export const LOG10E = reinterpret(0x3FDBCB7B1526E50E); // 0.43429448190325182765\n\n // @ts-ignore: decorator\n @lazy\n export const PI = reinterpret(0x400921FB54442D18); // 3.14159265358979323846\n\n // @ts-ignore: decorator\n @lazy\n export const SQRT1_2 = reinterpret(0x3FE6A09E667F3BCD); // 0.70710678118654752440\n\n // @ts-ignore: decorator\n @lazy\n export const SQRT2 = reinterpret(0x3FF6A09E667F3BCD); // 1.41421356237309504880\n\n // @ts-ignore: decorator\n @inline export function abs(x: f64): f64 {\n return builtin_abs(x);\n }\n\n export function acos(x: f64): f64 { // see: musl/src/math/acos.c and SUN COPYRIGHT NOTICE above\n const\n pio2_hi = reinterpret(0x3FF921FB54442D18), // 1.57079632679489655800e+00\n pio2_lo = reinterpret(0x3C91A62633145C07), // 6.12323399573676603587e-17\n Ox1p_120f = reinterpret(0x03800000);\n var hx = (reinterpret(x) >> 32);\n var ix = hx & 0x7FFFFFFF;\n if (ix >= 0x3FF00000) {\n let lx = reinterpret(x);\n if ((ix - 0x3FF00000 | lx) == 0) {\n if (hx >> 31) return 2 * pio2_hi + Ox1p_120f;\n return 0;\n }\n return 0 / (x - x);\n }\n if (ix < 0x3FE00000) {\n if (ix <= 0x3C600000) return pio2_hi + Ox1p_120f;\n return pio2_hi - (x - (pio2_lo - x * R(x * x)));\n }\n var s: f64, w: f64, z: f64;\n if (hx >> 31) {\n // z = (1.0 + x) * 0.5;\n z = 0.5 + x * 0.5;\n s = builtin_sqrt(z);\n w = R(z) * s - pio2_lo;\n return 2 * (pio2_hi - (s + w));\n }\n // z = (1.0 - x) * 0.5;\n z = 0.5 - x * 0.5;\n s = builtin_sqrt(z);\n var df = reinterpret(reinterpret(s) & 0xFFFFFFFF00000000);\n var c = (z - df * df) / (s + df);\n w = R(z) * s + c;\n return 2 * (df + w);\n }\n\n export function acosh(x: f64): f64 { // see: musl/src/math/acosh.c\n const s = reinterpret(0x3FE62E42FEFA39EF);\n var e = reinterpret(x) >> 52 & 0x7FF;\n if (e < 0x3FF + 1) return log1p(x - 1 + builtin_sqrt((x - 1) * (x - 1) + 2 * (x - 1)));\n if (e < 0x3FF + 26) return log(2 * x - 1 / (x + builtin_sqrt(x * x - 1)));\n return log(x) + s;\n }\n\n export function asin(x: f64): f64 { // see: musl/src/math/asin.c and SUN COPYRIGHT NOTICE above\n const\n pio2_hi = reinterpret(0x3FF921FB54442D18), // 1.57079632679489655800e+00\n pio2_lo = reinterpret(0x3C91A62633145C07), // 6.12323399573676603587e-17\n Ox1p_120f = reinterpret(0x03800000);\n var hx = (reinterpret(x) >> 32);\n var ix = hx & 0x7FFFFFFF;\n if (ix >= 0x3FF00000) {\n let lx = reinterpret(x);\n if ((ix - 0x3FF00000 | lx) == 0) return x * pio2_hi + Ox1p_120f;\n return 0 / (x - x);\n }\n if (ix < 0x3FE00000) {\n if (ix < 0x3E500000 && ix >= 0x00100000) return x;\n return x + x * R(x * x);\n }\n // var z = (1.0 - builtin_abs(x)) * 0.5;\n var z = 0.5 - builtin_abs(x) * 0.5;\n var s = builtin_sqrt(z);\n var r = R(z);\n if (ix >= 0x3FEF3333) x = pio2_hi - (2 * (s + s * r) - pio2_lo);\n else {\n let f = reinterpret(reinterpret(s) & 0xFFFFFFFF00000000);\n let c = (z - f * f) / (s + f);\n x = 0.5 * pio2_hi - (2 * s * r - (pio2_lo - 2 * c) - (0.5 * pio2_hi - 2 * f));\n }\n if (hx >> 31) return -x;\n return x;\n }\n\n export function asinh(x: f64): f64 { // see: musl/src/math/asinh.c\n const c = reinterpret(0x3FE62E42FEFA39EF); // 0.693147180559945309417232121458176568\n var u = reinterpret(x);\n var e = u >> 52 & 0x7FF;\n var y = reinterpret(u & 0x7FFFFFFFFFFFFFFF);\n if (e >= 0x3FF + 26) y = log(y) + c;\n else if (e >= 0x3FF + 1) y = log(2 * y + 1 / (builtin_sqrt(y * y + 1) + y));\n else if (e >= 0x3FF - 26) y = log1p(y + y * y / (builtin_sqrt(y * y + 1) + 1));\n return builtin_copysign(y, x);\n }\n\n export function atan(x: f64): f64 { // see musl/src/math/atan.c and SUN COPYRIGHT NOTICE above\n const\n atanhi0 = reinterpret(0x3FDDAC670561BB4F), // 4.63647609000806093515e-01\n atanhi1 = reinterpret(0x3FE921FB54442D18), // 7.85398163397448278999e-01\n atanhi2 = reinterpret(0x3FEF730BD281F69B), // 9.82793723247329054082e-01\n atanhi3 = reinterpret(0x3FF921FB54442D18), // 1.57079632679489655800e+00\n atanlo0 = reinterpret(0x3C7A2B7F222F65E2), // 2.26987774529616870924e-17\n atanlo1 = reinterpret(0x3C81A62633145C07), // 3.06161699786838301793e-17\n atanlo2 = reinterpret(0x3C7007887AF0CBBD), // 1.39033110312309984516e-17\n atanlo3 = reinterpret(0x3C91A62633145C07), // 6.12323399573676603587e-17\n aT0 = reinterpret(0x3FD555555555550D), // 3.33333333333329318027e-01\n aT1 = reinterpret(0xBFC999999998EBC4), // -1.99999999998764832476e-01\n aT2 = reinterpret(0x3FC24924920083FF), // 1.42857142725034663711e-01\n aT3 = reinterpret(0xBFBC71C6FE231671), // -1.11111104054623557880e-01,\n aT4 = reinterpret(0x3FB745CDC54C206E), // 9.09088713343650656196e-02\n aT5 = reinterpret(0xBFB3B0F2AF749A6D), // -7.69187620504482999495e-02\n aT6 = reinterpret(0x3FB10D66A0D03D51), // 6.66107313738753120669e-02\n aT7 = reinterpret(0xBFADDE2D52DEFD9A), // -5.83357013379057348645e-02\n aT8 = reinterpret(0x3FA97B4B24760DEB), // 4.97687799461593236017e-02\n aT9 = reinterpret(0xBFA2B4442C6A6C2F), // -3.65315727442169155270e-02\n aT10 = reinterpret(0x3F90AD3AE322DA11), // 1.62858201153657823623e-02\n Ox1p_120f = reinterpret(0x03800000);\n var ix = (reinterpret(x) >> 32);\n var sx = x;\n ix &= 0x7FFFFFFF;\n var z: f64;\n if (ix >= 0x44100000) {\n if (isNaN(x)) return x;\n z = atanhi3 + Ox1p_120f;\n return builtin_copysign(z, sx);\n }\n var id: i32;\n if (ix < 0x3FDC0000) {\n if (ix < 0x3E400000) return x;\n id = -1;\n } else {\n x = builtin_abs(x);\n if (ix < 0x3FF30000) {\n if (ix < 0x3FE60000) {\n id = 0;\n x = (2.0 * x - 1.0) / (2.0 + x);\n } else {\n id = 1;\n x = (x - 1.0) / (x + 1.0);\n }\n } else {\n if (ix < 0x40038000) {\n id = 2;\n x = (x - 1.5) / (1.0 + 1.5 * x);\n } else {\n id = 3;\n x = -1.0 / x;\n }\n }\n }\n z = x * x;\n var w = z * z;\n var s1 = z * (aT0 + w * (aT2 + w * (aT4 + w * (aT6 + w * (aT8 + w * aT10)))));\n var s2 = w * (aT1 + w * (aT3 + w * (aT5 + w * (aT7 + w * aT9))));\n var s3 = x * (s1 + s2);\n if (id < 0) return x - s3;\n switch (id) {\n case 0: { z = atanhi0 - ((s3 - atanlo0) - x); break; }\n case 1: { z = atanhi1 - ((s3 - atanlo1) - x); break; }\n case 2: { z = atanhi2 - ((s3 - atanlo2) - x); break; }\n case 3: { z = atanhi3 - ((s3 - atanlo3) - x); break; }\n default: unreachable();\n }\n return builtin_copysign(z, sx);\n }\n\n export function atanh(x: f64): f64 { // see: musl/src/math/atanh.c\n var u = reinterpret(x);\n var e = u >> 52 & 0x7FF;\n var s = u >> 63;\n u &= 0x7FFFFFFFFFFFFFFF;\n var y = reinterpret(u);\n if (e < 0x3FF - 1) {\n if (e >= 0x3FF - 32) y = 0.5 * log1p(2 * y + 2 * y * y / (1 - y));\n } else {\n y = 0.5 * log1p(2 * (y / (1 - y)));\n }\n return builtin_copysign(y, x);\n }\n\n export function atan2(y: f64, x: f64): f64 { // see: musl/src/math/atan2.c and SUN COPYRIGHT NOTICE above\n const pi_lo = reinterpret(0x3CA1A62633145C07); // 1.2246467991473531772E-16\n if (isNaN(x) || isNaN(y)) return x + y;\n var u = reinterpret(x);\n var ix = (u >> 32);\n var lx = u;\n u = reinterpret(y);\n var iy = (u >> 32);\n var ly = u;\n if ((ix - 0x3FF00000 | lx) == 0) return atan(y);\n var m = ((iy >> 31) & 1) | ((ix >> 30) & 2);\n ix = ix & 0x7FFFFFFF;\n iy = iy & 0x7FFFFFFF;\n if ((iy | ly) == 0) {\n switch (m) {\n case 0:\n case 1: return y;\n case 2: return PI;\n case 3: return -PI;\n }\n }\n if ((ix | lx) == 0) return m & 1 ? -PI / 2 : PI / 2;\n if (ix == 0x7FF00000) {\n if (iy == 0x7FF00000) {\n switch (m) {\n case 0: return PI / 4;\n case 1: return -PI / 4;\n case 2: return 3 * PI / 4;\n case 3: return -3 * PI / 4;\n }\n } else {\n switch (m) {\n case 0: return 0.0;\n case 1: return -0.0;\n case 2: return PI;\n case 3: return -PI;\n }\n }\n }\n var z: f64;\n if (ix + (64 << 20) < iy || iy == 0x7FF00000) return m & 1 ? -PI / 2 : PI / 2;\n if ((m & 2) && iy + (64 << 20) < ix) z = 0;\n else z = atan(builtin_abs(y / x));\n switch (m) {\n case 0: return z;\n case 1: return -z;\n case 2: return PI - (z - pi_lo);\n case 3: return (z - pi_lo) - PI;\n }\n unreachable();\n return 0;\n }\n\n export function cbrt(x: f64): f64 { // see: musl/src/math/cbrt.c and SUN COPYRIGHT NOTICE above\n const\n B1 = 715094163,\n B2 = 696219795,\n P0 = reinterpret(0x3FFE03E60F61E692), // 1.87595182427177009643\n P1 = reinterpret(0xBFFE28E092F02420), // -1.88497979543377169875\n P2 = reinterpret(0x3FF9F1604A49D6C2), // 1.621429720105354466140\n P3 = reinterpret(0xBFE844CBBEE751D9), // -0.758397934778766047437\n P4 = reinterpret(0x3FC2B000D4E4EDD7), // 0.145996192886612446982\n Ox1p54 = reinterpret(0x4350000000000000);\n var u = reinterpret(x);\n var hx = (u >> 32) & 0x7FFFFFFF;\n if (hx >= 0x7FF00000) return x + x;\n if (hx < 0x00100000) {\n u = reinterpret(x * Ox1p54);\n hx = (u >> 32) & 0x7FFFFFFF;\n if (hx == 0) return x;\n hx = hx / 3 + B2;\n } else {\n hx = hx / 3 + B1;\n }\n u &= 1 << 63;\n u |= hx << 32;\n var t = reinterpret(u);\n var r = (t * t) * (t / x);\n t = t * ((P0 + r * (P1 + r * P2)) + ((r * r) * r) * (P3 + r * P4));\n t = reinterpret((reinterpret(t) + 0x80000000) & 0xFFFFFFFFC0000000);\n var s = t * t;\n r = x / s;\n r = (r - t) / (2 * t + r);\n t = t + t * r;\n return t;\n }\n\n // @ts-ignore: decorator\n @inline\n export function ceil(x: f64): f64 {\n return builtin_ceil(x);\n }\n\n export function clz32(x: f64): f64 {\n if (!isFinite(x)) return 32;\n /*\n * Wasm (MVP) and JS have different approaches for double->int conversions.\n *\n * For emulate JS conversion behavior and avoid trapping from wasm we should modulate by MAX_INT\n * our float-point arguments before actual convertion to integers.\n */\n return builtin_clz(\n (x - 4294967296 * builtin_floor(x * (1.0 / 4294967296)))\n );\n }\n\n export function cos(x: f64): f64 { // TODO\n return JSMath.cos(x);\n }\n\n export function cosh(x: f64): f64 { // see: musl/src/math/cosh.c\n var u = reinterpret(x);\n u &= 0x7FFFFFFFFFFFFFFF;\n x = reinterpret(u);\n var w = (u >> 32);\n var t: f64;\n if (w < 0x3FE62E42) {\n if (w < 0x3FF00000 - (26 << 20)) return 1;\n t = expm1(x);\n // return 1 + t * t / (2 * (1 + t));\n return 1 + t * t / (2 + 2 * t);\n }\n if (w < 0x40862E42) {\n t = exp(x);\n return 0.5 * (t + 1 / t);\n }\n t = expo2(x);\n return t;\n }\n\n export function exp(x: f64): f64 { // see: musl/src/math/exp.c and SUN COPYRIGHT NOTICE above\n const\n ln2hi = reinterpret(0x3FE62E42FEE00000), // 6.93147180369123816490e-01\n ln2lo = reinterpret(0x3DEA39EF35793C76), // 1.90821492927058770002e-10\n invln2 = reinterpret(0x3FF71547652B82FE), // 1.44269504088896338700e+00\n P1 = reinterpret(0x3FC555555555553E), // 1.66666666666666019037e-01\n P2 = reinterpret(0xBF66C16C16BEBD93), // -2.77777777770155933842e-03\n P3 = reinterpret(0x3F11566AAF25DE2C), // 6.61375632143793436117e-05\n P4 = reinterpret(0xBEBBBD41C5D26BF1), // -1.65339022054652515390e-06\n P5 = reinterpret(0x3E66376972BEA4D0), // 4.13813679705723846039e-08\n overflow = reinterpret(0x40862E42FEFA39EF), // 709.782712893383973096\n underflow = reinterpret(0xC0874910D52D3051), // -745.13321910194110842\n Ox1p1023 = reinterpret(0x7FE0000000000000);\n var hx = (reinterpret(x) >> 32);\n var sign_ = (hx >> 31);\n hx &= 0x7FFFFFFF;\n if (hx >= 0x4086232B) {\n if (isNaN(x)) return x;\n if (x > overflow) return x * Ox1p1023;\n if (x < underflow) return 0;\n }\n var hi: f64, lo: f64 = 0;\n var k = 0;\n if (hx > 0x3FD62E42) {\n if (hx >= 0x3FF0A2B2) {\n k = (invln2 * x + builtin_copysign(0.5, x));\n } else {\n k = 1 - (sign_ << 1);\n }\n hi = x - k * ln2hi;\n lo = k * ln2lo;\n x = hi - lo;\n } else if (hx > 0x3E300000) {\n hi = x;\n } else return 1.0 + x;\n var xs = x * x;\n // var c = x - xp2 * (P1 + xp2 * (P2 + xp2 * (P3 + xp2 * (P4 + xp2 * P5))));\n var xq = xs * xs;\n var c = x - (xs * P1 + xq * ((P2 + xs * P3) + xq * (P4 + xs * P5)));\n var y = 1.0 + (x * c / (2 - c) - lo + hi);\n if (k == 0) return y;\n return scalbn(y, k);\n }\n\n export function expm1(x: f64): f64 { // see: musl/src/math/expm1.c and SUN COPYRIGHT NOTICE above\n const\n o_threshold = reinterpret(0x40862E42FEFA39EF), // 7.09782712893383973096e+02\n ln2_hi = reinterpret(0x3FE62E42FEE00000), // 6.93147180369123816490e-01\n ln2_lo = reinterpret(0x3DEA39EF35793C76), // 1.90821492927058770002e-10\n invln2 = reinterpret(0x3FF71547652B82FE), // 1.44269504088896338700e+00\n Q1 = reinterpret(0xBFA11111111110F4), // -3.33333333333331316428e-02\n Q2 = reinterpret(0x3F5A01A019FE5585), // 1.58730158725481460165e-03\n Q3 = reinterpret(0xBF14CE199EAADBB7), // -7.93650757867487942473e-05\n Q4 = reinterpret(0x3ED0CFCA86E65239), // 4.00821782732936239552e-06\n Q5 = reinterpret(0xBE8AFDB76E09C32D), // -2.01099218183624371326e-07\n Ox1p1023 = reinterpret(0x7FE0000000000000);\n var u = reinterpret(x);\n var hx = (u >> 32 & 0x7FFFFFFF);\n var k = 0, sign_ = (u >> 63);\n if (hx >= 0x4043687A) {\n if (isNaN(x)) return x;\n if (sign_) return -1;\n if (x > o_threshold) return x * Ox1p1023;\n }\n var c = 0.0, t: f64;\n if (hx > 0x3FD62E42) {\n k = select(\n 1 - (sign_ << 1),\n (invln2 * x + builtin_copysign(0.5, x)),\n hx < 0x3FF0A2B2\n );\n t = k;\n let hi = x - t * ln2_hi;\n let lo = t * ln2_lo;\n x = hi - lo;\n c = (hi - x) - lo;\n } else if (hx < 0x3C900000) return x;\n var hfx = 0.5 * x;\n var hxs = x * hfx;\n // var r1 = 1.0 + hxs * (Q1 + hxs * (Q2 + hxs * (Q3 + hxs * (Q4 + hxs * Q5))));\n var hxq = hxs * hxs;\n var r1 = (1.0 + hxs * Q1) + hxq * ((Q2 + hxs * Q3) + hxq * (Q4 + hxs * Q5));\n t = 3.0 - r1 * hfx;\n var e = hxs * ((r1 - t) / (6.0 - x * t));\n if (k == 0) return x - (x * e - hxs);\n e = x * (e - c) - c;\n e -= hxs;\n if (k == -1) return 0.5 * (x - e) - 0.5;\n if (k == 1) {\n if (x < -0.25) return -2.0 * (e - (x + 0.5));\n return 1.0 + 2.0 * (x - e);\n }\n u = (0x3FF + k) << 52;\n var twopk = reinterpret(u);\n var y: f64;\n if (k < 0 || k > 56) {\n y = x - e + 1.0;\n if (k == 1024) y = y * 2.0 * Ox1p1023;\n else y = y * twopk;\n return y - 1.0;\n }\n u = (0x3FF - k) << 52;\n y = reinterpret(u);\n if (k < 20) y = (1 - y) - e;\n else y = 1 - (e + y);\n return (x + y) * twopk;\n }\n\n // @ts-ignore: decorator\n @inline\n export function floor(x: f64): f64 {\n return builtin_floor(x);\n }\n\n // @ts-ignore: decorator\n @inline\n export function fround(x: f64): f64 {\n return x;\n }\n\n export function hypot(x: f64, y: f64): f64 { // see: musl/src/math/hypot.c\n const\n SPLIT = reinterpret(0x41A0000000000000) + 1, // 0x1p27 + 1\n Ox1p700 = reinterpret(0x6BB0000000000000),\n Ox1p_700 = reinterpret(0x1430000000000000);\n var ux = reinterpret(x);\n var uy = reinterpret(y);\n ux &= 0x7FFFFFFFFFFFFFFF;\n uy &= 0x7FFFFFFFFFFFFFFF;\n if (ux < uy) {\n let ut = ux;\n ux = uy;\n uy = ut;\n }\n var ex = (ux >> 52);\n var ey = (uy >> 52);\n y = reinterpret(uy);\n if (ey == 0x7FF) return y;\n x = reinterpret(ux);\n if (ex == 0x7FF || uy == 0) return x;\n if (ex - ey > 64) return x + y;\n var z = 1.0;\n if (ex > 0x3FF + 510) {\n z = Ox1p700;\n x *= Ox1p_700;\n y *= Ox1p_700;\n } else if (ey < 0x3FF - 450) {\n z = Ox1p_700;\n x *= Ox1p700;\n y *= Ox1p700;\n }\n var c = x * SPLIT;\n var h = x - c + c;\n var l = x - h;\n var hx = x * x;\n var lx = h * h - hx + (2 * h + l) * l;\n c = y * SPLIT;\n h = y - c + c;\n l = y - h;\n var hy = y * y;\n var ly = h * h - hy + (2 * h + l) * l;\n return z * builtin_sqrt(ly + lx + hy + hx);\n }\n\n export function imul(x: f64, y: f64): f64 {\n /*\n * Wasm (MVP) and JS have different approaches for double->int conversions.\n *\n * For emulate JS conversion behavior and avoid trapping from wasm we should modulate by MAX_INT\n * our float-point arguments before actual convertion to integers.\n */\n if (!isFinite(x + y)) return 0;\n const inv32 = 1.0 / 4294967296;\n return (\n (x - 4294967296 * builtin_floor(x * inv32)) *\n (y - 4294967296 * builtin_floor(y * inv32))\n );\n }\n\n export function log(x: f64): f64 { // see: musl/src/math/log.c and SUN COPYRIGHT NOTICE above\n const\n ln2_hi = reinterpret(0x3FE62E42FEE00000), // 6.93147180369123816490e-01\n ln2_lo = reinterpret(0x3DEA39EF35793C76), // 1.90821492927058770002e-10\n Lg1 = reinterpret(0x3FE5555555555593), // 6.666666666666735130e-01\n Lg2 = reinterpret(0x3FD999999997FA04), // 3.999999999940941908e-01\n Lg3 = reinterpret(0x3FD2492494229359), // 2.857142874366239149e-01\n Lg4 = reinterpret(0x3FCC71C51D8E78AF), // 2.222219843214978396e-01\n Lg5 = reinterpret(0x3FC7466496CB03DE), // 1.818357216161805012e-01\n Lg6 = reinterpret(0x3FC39A09D078C69F), // 1.531383769920937332e-01\n Lg7 = reinterpret(0x3FC2F112DF3E5244), // 1.479819860511658591e-01\n Ox1p54 = reinterpret(0x4350000000000000);\n var u = reinterpret(x);\n var hx = (u >> 32);\n var k = 0;\n if (hx < 0x00100000 || (hx >> 31)) {\n if (u << 1 == 0) return -1 / (x * x);\n if (hx >> 31) return (x - x) / 0.0;\n k -= 54;\n x *= Ox1p54;\n u = reinterpret(x);\n hx = (u >> 32);\n } else if (hx >= 0x7FF00000) return x;\n else if (hx == 0x3FF00000 && u << 32 == 0) return 0;\n hx += 0x3FF00000 - 0x3FE6A09E;\n k += (hx >> 20) - 0x3FF;\n hx = (hx & 0x000FFFFF) + 0x3FE6A09E;\n u = hx << 32 | (u & 0xFFFFFFFF);\n x = reinterpret(u);\n var f = x - 1.0;\n var hfsq = 0.5 * f * f;\n var s = f / (2.0 + f);\n var z = s * s;\n var w = z * z;\n var t1 = w * (Lg2 + w * (Lg4 + w * Lg6));\n var t2 = z * (Lg1 + w * (Lg3 + w * (Lg5 + w * Lg7)));\n var r = t2 + t1;\n var dk = k;\n return s * (hfsq + r) + dk * ln2_lo - hfsq + f + dk * ln2_hi;\n }\n\n export function log10(x: f64): f64 { // see: musl/src/math/log10.c and SUN COPYRIGHT NOTICE above\n const\n ivln10hi = reinterpret(0x3FDBCB7B15200000), // 4.34294481878168880939e-01\n ivln10lo = reinterpret(0x3DBB9438CA9AADD5), // 2.50829467116452752298e-11\n log10_2hi = reinterpret(0x3FD34413509F6000), // 3.01029995663611771306e-01\n log10_2lo = reinterpret(0x3D59FEF311F12B36), // 3.69423907715893078616e-13\n Lg1 = reinterpret(0x3FE5555555555593), // 6.666666666666735130e-01\n Lg2 = reinterpret(0x3FD999999997FA04), // 3.999999999940941908e-01\n Lg3 = reinterpret(0x3FD2492494229359), // 2.857142874366239149e-01\n Lg4 = reinterpret(0x3FCC71C51D8E78AF), // 2.222219843214978396e-01\n Lg5 = reinterpret(0x3FC7466496CB03DE), // 1.818357216161805012e-01\n Lg6 = reinterpret(0x3FC39A09D078C69F), // 1.531383769920937332e-01\n Lg7 = reinterpret(0x3FC2F112DF3E5244), // 1.479819860511658591e-01\n Ox1p54 = reinterpret(0x4350000000000000);\n var u = reinterpret(x);\n var hx = (u >> 32);\n var k = 0;\n if (hx < 0x00100000 || (hx >> 31)) {\n if (u << 1 == 0) return -1 / (x * x);\n if (hx >> 31) return (x - x) / 0.0;\n k -= 54;\n x *= Ox1p54;\n u = reinterpret(x);\n hx = (u >> 32);\n } else if (hx >= 0x7FF00000) return x;\n else if (hx == 0x3FF00000 && u << 32 == 0) return 0;\n hx += 0x3FF00000 - 0x3FE6A09E;\n k += (hx >> 20) - 0x3FF;\n hx = (hx & 0x000FFFFF) + 0x3FE6A09E;\n u = hx << 32 | (u & 0xFFFFFFFF);\n x = reinterpret(u);\n var f = x - 1.0;\n var hfsq = 0.5 * f * f;\n var s = f / (2.0 + f);\n var z = s * s;\n var w = z * z;\n var t1 = w * (Lg2 + w * (Lg4 + w * Lg6));\n var t2 = z * (Lg1 + w * (Lg3 + w * (Lg5 + w * Lg7)));\n var r = t2 + t1;\n var hi = f - hfsq;\n u = reinterpret(hi);\n u &= 0xFFFFFFFF00000000;\n hi = reinterpret(u);\n var lo = f - hi - hfsq + s * (hfsq + r);\n var val_hi = hi * ivln10hi;\n var dk = k;\n var y = dk * log10_2hi;\n var val_lo = dk * log10_2lo + (lo + hi) * ivln10lo + lo * ivln10hi;\n w = y + val_hi;\n val_lo += (y - w) + val_hi;\n return val_lo + w;\n }\n\n export function log1p(x: f64): f64 { // see: musl/src/math/log1p.c and SUN COPYRIGHT NOTICE above\n const\n ln2_hi = reinterpret(0x3FE62E42FEE00000), // 6.93147180369123816490e-01\n ln2_lo = reinterpret(0x3DEA39EF35793C76), // 1.90821492927058770002e-10\n Lg1 = reinterpret(0x3FE5555555555593), // 6.666666666666735130e-01\n Lg2 = reinterpret(0x3FD999999997FA04), // 3.999999999940941908e-01\n Lg3 = reinterpret(0x3FD2492494229359), // 2.857142874366239149e-01\n Lg4 = reinterpret(0x3FCC71C51D8E78AF), // 2.222219843214978396e-01\n Lg5 = reinterpret(0x3FC7466496CB03DE), // 1.818357216161805012e-01\n Lg6 = reinterpret(0x3FC39A09D078C69F), // 1.531383769920937332e-01\n Lg7 = reinterpret(0x3FC2F112DF3E5244); // 1.479819860511658591e-01\n var u = reinterpret(x);\n var hx = (u >> 32);\n var k = 1;\n var c = 0.0, f = 0.0;\n if (hx < 0x3FDA827A || (hx >> 31)) {\n if (hx >= 0xBFF00000) {\n if (x == -1) return x / 0.0;\n return (x - x) / 0.0;\n }\n if (hx << 1 < 0x3CA00000 << 1) return x;\n if (hx <= 0xBFD2BEC4) {\n k = 0;\n c = 0;\n f = x;\n }\n } else if (hx >= 0x7FF00000) return x;\n if (k) {\n u = reinterpret(1 + x);\n let hu = (u >> 32);\n hu += 0x3FF00000 - 0x3FE6A09E;\n k = (hu >> 20) - 0x3FF;\n if (k < 54) {\n let uf = reinterpret(u);\n c = k >= 2 ? 1 - (uf - x) : x - (uf - 1);\n c /= uf;\n } else c = 0;\n hu = (hu & 0x000FFFFF) + 0x3FE6A09E;\n u = hu << 32 | (u & 0xFFFFFFFF);\n f = reinterpret(u) - 1;\n }\n var hfsq = 0.5 * f * f;\n var s = f / (2.0 + f);\n var z = s * s;\n var w = z * z;\n var t1 = w * (Lg2 + w * (Lg4 + w * Lg6));\n var t2 = z * (Lg1 + w * (Lg3 + w * (Lg5 + w * Lg7)));\n var r = t2 + t1;\n var dk = k;\n return s * (hfsq + r) + (dk * ln2_lo + c) - hfsq + f + dk * ln2_hi;\n }\n\n export function log2(x: f64): f64 { // see: musl/src/math/log2.c and SUN COPYRIGHT NOTICE above\n const\n ivln2hi = reinterpret(0x3FF7154765200000), // 1.44269504072144627571e+00\n ivln2lo = reinterpret(0x3DE705FC2EEFA200), // 1.67517131648865118353e-10\n Lg1 = reinterpret(0x3FE5555555555593), // 6.666666666666735130e-01\n Lg2 = reinterpret(0x3FD999999997FA04), // 3.999999999940941908e-01\n Lg3 = reinterpret(0x3FD2492494229359), // 2.857142874366239149e-01\n Lg4 = reinterpret(0x3FCC71C51D8E78AF), // 2.222219843214978396e-01\n Lg5 = reinterpret(0x3FC7466496CB03DE), // 1.818357216161805012e-01\n Lg6 = reinterpret(0x3FC39A09D078C69F), // 1.531383769920937332e-01\n Lg7 = reinterpret(0x3FC2F112DF3E5244), // 1.479819860511658591e-01\n Ox1p54 = reinterpret(0x4350000000000000);\n var u = reinterpret(x);\n var hx = (u >> 32);\n var k = 0;\n if (hx < 0x00100000 || (hx >> 31)) {\n if (u << 1 == 0) return -1 / (x * x);\n if (hx >> 31) return (x - x) / 0.0;\n k -= 54;\n x *= Ox1p54;\n u = reinterpret(x);\n hx = (u >> 32);\n } else if (hx >= 0x7FF00000) return x;\n else if (hx == 0x3FF00000 && u << 32 == 0) return 0;\n hx += 0x3FF00000 - 0x3FE6A09E;\n k += (hx >> 20) - 0x3FF;\n hx = (hx & 0x000FFFFF) + 0x3FE6A09E;\n u = hx << 32 | (u & 0xFFFFFFFF);\n x = reinterpret(u);\n var f = x - 1.0;\n var hfsq = 0.5 * f * f;\n var s = f / (2.0 + f);\n var z = s * s;\n var w = z * z;\n var t1 = w * (Lg2 + w * (Lg4 + w * Lg6));\n var t2 = z * (Lg1 + w * (Lg3 + w * (Lg5 + w * Lg7)));\n var r = t2 + t1;\n var hi = f - hfsq;\n u = reinterpret(hi);\n u &= 0xFFFFFFFF00000000;\n hi = reinterpret(u);\n var lo = f - hi - hfsq + s * (hfsq + r);\n var val_hi = hi * ivln2hi;\n var val_lo = (lo + hi) * ivln2lo + lo * ivln2hi;\n var y = k;\n w = y + val_hi;\n val_lo += (y - w) + val_hi;\n val_hi = w;\n return val_lo + val_hi;\n }\n\n // @ts-ignore: decorator\n @inline\n export function max(value1: f64, value2: f64): f64 {\n return builtin_max(value1, value2);\n }\n\n // @ts-ignore: decorator\n @inline\n export function min(value1: f64, value2: f64): f64 {\n return builtin_min(value1, value2);\n }\n\n export function pow(x: f64, y: f64): f64 { // see: musl/src/math/pow.c and SUN COPYRIGHT NOTICE above\n const\n dp_h1 = reinterpret(0x3FE2B80340000000), // 5.84962487220764160156e-01\n dp_l1 = reinterpret(0x3E4CFDEB43CFD006), // 1.35003920212974897128e-08\n two53 = reinterpret(0x4340000000000000), // 9007199254740992.0\n huge = reinterpret(0x7E37E43C8800759C), // 1e+300\n tiny = reinterpret(0x01A56E1FC2F8F359), // 1e-300\n L1 = reinterpret(0x3FE3333333333303), // 5.99999999999994648725e-01\n L2 = reinterpret(0x3FDB6DB6DB6FABFF), // 4.28571428578550184252e-01\n L3 = reinterpret(0x3FD55555518F264D), // 3.33333329818377432918e-01\n L4 = reinterpret(0x3FD17460A91D4101), // 2.72728123808534006489e-01\n L5 = reinterpret(0x3FCD864A93C9DB65), // 2.30660745775561754067e-01\n L6 = reinterpret(0x3FCA7E284A454EEF), // 2.06975017800338417784e-01\n P1 = reinterpret(0x3FC555555555553E), // 1.66666666666666019037e-01\n P2 = reinterpret(0xBF66C16C16BEBD93), // -2.77777777770155933842e-03\n P3 = reinterpret(0x3F11566AAF25DE2C), // 6.61375632143793436117e-05\n P4 = reinterpret(0xBEBBBD41C5D26BF1), // -1.65339022054652515390e-06\n P5 = reinterpret(0x3E66376972BEA4D0), // 4.13813679705723846039e-08\n lg2 = reinterpret(0x3FE62E42FEFA39EF), // 6.93147180559945286227e-01\n lg2_h = reinterpret(0x3FE62E4300000000), // 6.93147182464599609375e-01\n lg2_l = reinterpret(0xBE205C610CA86C39), // -1.90465429995776804525e-09\n ovt = reinterpret(0x3C971547652B82FE), // 8.0085662595372944372e-017\n cp = reinterpret(0x3FEEC709DC3A03FD), // 9.61796693925975554329e-01\n cp_h = reinterpret(0x3FEEC709E0000000), // 9.61796700954437255859e-01\n cp_l = reinterpret(0xBE3E2FE0145B01F5), // -7.02846165095275826516e-09\n ivln2 = reinterpret(0x3FF71547652B82FE), // 1.44269504088896338700e+00\n ivln2_h = reinterpret(0x3FF7154760000000), // 1.44269502162933349609e+00\n ivln2_l = reinterpret(0x3E54AE0BF85DDF44), // 1.92596299112661746887e-08\n inv3 = reinterpret(0x3FD5555555555555); // 0.3333333333333333333333\n var u_ = reinterpret(x);\n var hx = (u_ >> 32);\n var lx = u_;\n u_ = reinterpret(y);\n var hy = (u_ >> 32);\n var ly = u_;\n var ix = hx & 0x7FFFFFFF;\n var iy = hy & 0x7FFFFFFF;\n if ((iy | ly) == 0) return 1.0; // x**0 = 1, even if x is NaN\n // if (hx == 0x3FF00000 && lx == 0) return 1.0; // C: 1**y = 1, even if y is NaN, JS: NaN\n if ( // NaN if either arg is NaN\n ix > 0x7FF00000 || (ix == 0x7FF00000 && lx != 0) ||\n iy > 0x7FF00000 || (iy == 0x7FF00000 && ly != 0)\n ) return x + y;\n var yisint = 0, k: i32;\n if (hx < 0) {\n if (iy >= 0x43400000) yisint = 2;\n else if (iy >= 0x3FF00000) {\n k = (iy >> 20) - 0x3FF;\n let kcond = k > 20;\n let offset = select(52, 20, kcond) - k;\n let Ly = select(ly, iy, kcond);\n let jj = Ly >> offset;\n if ((jj << offset) == Ly) yisint = 2 - (jj & 1);\n }\n }\n if (ly == 0) {\n if (iy == 0x7FF00000) { // y is +-inf\n if (((ix - 0x3FF00000) | lx) == 0) return NaN; // C: (-1)**+-inf is 1, JS: NaN\n else if (ix >= 0x3FF00000) return hy >= 0 ? y : 0.0; // (|x|>1)**+-inf = inf,0\n else return hy >= 0 ? 0.0 : -y; // (|x|<1)**+-inf = 0,inf\n }\n if (iy == 0x3FF00000) {\n if (hy >= 0) return x;\n return 1 / x;\n }\n if (hy == 0x40000000) return x * x;\n if (hy == 0x3FE00000) {\n if (hx >= 0) return builtin_sqrt(x);\n }\n }\n var ax = builtin_abs(x), z: f64;\n if (lx == 0) {\n if (ix == 0 || ix == 0x7FF00000 || ix == 0x3FF00000) {\n z = ax;\n if (hy < 0) z = 1.0 / z;\n if (hx < 0) {\n if (((ix - 0x3FF00000) | yisint) == 0) {\n let d = z - z;\n z = d / d;\n } else if (yisint == 1) z = -z;\n }\n return z;\n }\n }\n var s = 1.0;\n if (hx < 0) {\n if (yisint == 0) {\n let d = x - x;\n return d / d;\n }\n if (yisint == 1) s = -1.0;\n }\n var t1: f64, t2: f64, p_h: f64, p_l: f64, r: f64, t: f64, u: f64, v: f64, w: f64;\n var j: i32, n: i32;\n if (iy > 0x41E00000) {\n if (iy > 0x43F00000) {\n if (ix <= 0x3FEFFFFF) return hy < 0 ? huge * huge : tiny * tiny;\n if (ix >= 0x3FF00000) return hy > 0 ? huge * huge : tiny * tiny;\n }\n if (ix < 0x3FEFFFFF) return hy < 0 ? s * huge * huge : s * tiny * tiny;\n if (ix > 0x3FF00000) return hy > 0 ? s * huge * huge : s * tiny * tiny;\n t = ax - 1.0;\n w = (t * t) * (0.5 - t * (inv3 - t * 0.25));\n u = ivln2_h * t;\n v = t * ivln2_l - w * ivln2;\n t1 = u + v;\n t1 = reinterpret(reinterpret(t1) & 0xFFFFFFFF00000000);\n t2 = v - (t1 - u);\n } else {\n let ss: f64, s2: f64, s_h: f64, s_l: f64, t_h: f64, t_l: f64;\n n = 0;\n if (ix < 0x00100000) {\n ax *= two53;\n n -= 53;\n ix = (reinterpret(ax) >> 32);\n }\n n += (ix >> 20) - 0x3FF;\n j = ix & 0x000FFFFF;\n ix = j | 0x3FF00000;\n if (j <= 0x3988E) k = 0;\n else if (j < 0xBB67A) k = 1;\n else {\n k = 0;\n n += 1;\n ix -= 0x00100000;\n }\n ax = reinterpret(reinterpret(ax) & 0xFFFFFFFF | (ix << 32));\n let bp = select(1.5, 1.0, k); // k ? 1.5 : 1.0\n u = ax - bp;\n v = 1.0 / (ax + bp);\n ss = u * v;\n s_h = ss;\n s_h = reinterpret(reinterpret(s_h) & 0xFFFFFFFF00000000);\n t_h = reinterpret((((ix >> 1) | 0x20000000) + 0x00080000 + (k << 18)) << 32);\n t_l = ax - (t_h - bp);\n s_l = v * ((u - s_h * t_h) - s_h * t_l);\n s2 = ss * ss;\n r = s2 * s2 * (L1 + s2 * (L2 + s2 * (L3 + s2 * (L4 + s2 * (L5 + s2 * L6)))));\n r += s_l * (s_h + ss);\n s2 = s_h * s_h;\n t_h = 3.0 + s2 + r;\n t_h = reinterpret(reinterpret(t_h) & 0xFFFFFFFF00000000);\n t_l = r - ((t_h - 3.0) - s2);\n u = s_h * t_h;\n v = s_l * t_h + t_l * ss;\n p_h = u + v;\n p_h = reinterpret(reinterpret(p_h) & 0xFFFFFFFF00000000);\n p_l = v - (p_h - u);\n let z_h = cp_h * p_h;\n let dp_l = select(dp_l1, 0.0, k);\n let z_l = cp_l * p_h + p_l * cp + dp_l;\n t = n;\n let dp_h = select(dp_h1, 0.0, k);\n t1 = ((z_h + z_l) + dp_h) + t;\n t1 = reinterpret(reinterpret(t1) & 0xFFFFFFFF00000000);\n t2 = z_l - (((t1 - t) - dp_h) - z_h);\n }\n var y1 = y;\n y1 = reinterpret(reinterpret(y1) & 0xFFFFFFFF00000000);\n p_l = (y - y1) * t1 + y * t2;\n p_h = y1 * t1;\n z = p_l + p_h;\n u_ = reinterpret(z);\n j = (u_ >> 32);\n var i = u_;\n if (j >= 0x40900000) {\n if (((j - 0x40900000) | i) != 0) return s * huge * huge;\n if (p_l + ovt > z - p_h) return s * huge * huge;\n } else if ((j & 0x7FFFFFFF) >= 0x4090CC00) {\n if (((j - 0xC090CC00) | i) != 0) return s * tiny * tiny;\n if (p_l <= z - p_h) return s * tiny * tiny;\n }\n i = j & 0x7FFFFFFF;\n k = (i >> 20) - 0x3FF;\n n = 0;\n if (i > 0x3FE00000) {\n n = j + (0x00100000 >> (k + 1));\n k = ((n & 0x7FFFFFFF) >> 20) - 0x3FF;\n t = 0.0;\n t = reinterpret((n & ~(0x000FFFFF >> k)) << 32);\n n = ((n & 0x000FFFFF) | 0x00100000) >> (20 - k);\n if (j < 0) n = -n;\n p_h -= t;\n }\n t = p_l + p_h;\n t = reinterpret(reinterpret(t) & 0xFFFFFFFF00000000);\n u = t * lg2_h;\n v = (p_l - (t - p_h)) * lg2 + t * lg2_l;\n z = u + v;\n w = v - (z - u);\n t = z * z;\n t1 = z - t * (P1 + t * (P2 + t * (P3 + t * (P4 + t * P5))));\n r = (z * t1) / (t1 - 2.0) - (w + z * w);\n z = 1.0 - (r - z);\n j = (reinterpret(z) >> 32);\n j += n << 20;\n if ((j >> 20) <= 0) z = scalbn(z, n);\n else z = reinterpret(reinterpret(z) & 0xFFFFFFFF | (j << 32));\n return s * z;\n }\n\n export function seedRandom(value: i64): void {\n assert(value);\n random_seeded = true;\n random_state0_64 = murmurHash3(value);\n random_state1_64 = murmurHash3(~random_state0_64);\n random_state0_32 = splitMix32(value);\n random_state1_32 = splitMix32(random_state0_32);\n }\n\n export function random(): f64 { // see: v8/src/base/random-number-generator.cc\n if (!random_seeded) throw new Error("PRNG must be seeded.");\n var s1 = random_state0_64;\n var s0 = random_state1_64;\n random_state0_64 = s0;\n s1 ^= s1 << 23;\n s1 ^= s1 >> 17;\n s1 ^= s0;\n s1 ^= s0 >> 26;\n random_state1_64 = s1;\n var r = ((s0 + s1) & 0x000FFFFFFFFFFFFF) | 0x3FF0000000000000;\n return reinterpret(r) - 1;\n }\n\n // @ts-ignore: decorator\n @inline\n export function round(x: f64): f64 {\n return builtin_copysign(builtin_floor(x + 0.5), x);\n }\n\n // @ts-ignore: decorator\n @inline\n export function sign(x: f64): f64 {\n if (ASC_SHRINK_LEVEL > 0) {\n return builtin_abs(x) > 0 ? builtin_copysign(1, x) : x;\n } else {\n return x > 0 ? 1 : x < 0 ? -1 : x;\n }\n }\n\n // @ts-ignore: decorator\n @inline\n export function signbit(x: f64): bool {\n // In ECMAScript all NaN values are indistinguishable from each other\n // so we need handle NaN and negative NaN in similar way\n return ((reinterpret(x) >>> 63) & i32(x == x));\n }\n\n export function sin(x: f64): f64 { // TODO\n return JSMath.sin(x);\n }\n\n export function sinh(x: f64): f64 { // see: musl/src/math/sinh.c\n var u = reinterpret(x) & 0x7FFFFFFFFFFFFFFF;\n var absx = reinterpret(u);\n var w = (u >> 32);\n var t: f64;\n var h = builtin_copysign(0.5, x);\n if (w < 0x40862E42) {\n t = expm1(absx);\n if (w < 0x3FF00000) {\n if (w < 0x3FF00000 - (26 << 20)) return x;\n return h * (2 * t - t * t / (t + 1));\n }\n return h * (t + t / (t + 1));\n }\n t = 2 * h * expo2(absx);\n return t;\n }\n\n // @ts-ignore: decorator\n @inline\n export function sqrt(x: f64): f64 {\n return builtin_sqrt(x);\n }\n\n export function tan(x: f64): f64 { // TODO\n return JSMath.tan(x);\n }\n\n export function tanh(x: f64): f64 { // see: musl/src/math/tanh.c\n var u = reinterpret(x);\n u &= 0x7FFFFFFFFFFFFFFF;\n var y = reinterpret(u);\n var w = (u >> 32);\n var t: f64;\n if (w > 0x3FE193EA) {\n if (w > 0x40340000) {\n t = 1 - 0 / y;\n } else {\n t = expm1(2 * y);\n t = 1 - 2 / (t + 2);\n }\n } else if (w > 0x3FD058AE) {\n t = expm1(2 * y);\n t = t / (t + 2);\n } else if (w >= 0x00100000) {\n t = expm1(-2 * y);\n t = -t / (t + 2);\n } else t = y;\n return builtin_copysign(t, x);\n }\n\n // @ts-ignore: decorator\n @inline\n export function trunc(x: f64): f64 {\n return builtin_trunc(x);\n }\n\n export function scalbn(x: f64, n: i32): f64 { // see: https://git.musl-libc.org/cgit/musl/tree/src/math/scalbn.c\n const\n Ox1p53 = reinterpret(0x4340000000000000),\n Ox1p1023 = reinterpret(0x7FE0000000000000),\n Ox1p_1022 = reinterpret(0x0010000000000000);\n var y = x;\n if (n > 1023) {\n y *= Ox1p1023;\n n -= 1023;\n if (n > 1023) {\n y *= Ox1p1023;\n n = builtin_min(n - 1023, 1023);\n }\n } else if (n < -1022) {\n /* make sure final n < -53 to avoid double\n rounding in the subnormal range */\n y *= Ox1p_1022 * Ox1p53;\n n += 1022 - 53;\n if (n < -1022) {\n y *= Ox1p_1022 * Ox1p53;\n n = builtin_max(n + 1022 - 53, -1022);\n }\n }\n return y * reinterpret((0x3FF + n) << 52);\n }\n\n export function mod(x: f64, y: f64): f64 { // see: musl/src/math/fmod.c\n var ux = reinterpret(x);\n var uy = reinterpret(y);\n var ex = (ux >> 52 & 0x7FF);\n var ey = (uy >> 52 & 0x7FF);\n var sx = ux >> 63;\n var uy1 = uy << 1;\n if (uy1 == 0 || ex == 0x7FF || isNaN(y)) {\n let m = x * y;\n return m / m;\n }\n var ux1 = ux << 1;\n if (ux1 <= uy1) {\n if (ux1 == uy1) return 0 * x;\n return x;\n }\n if (!ex) {\n ex -= builtin_clz(ux << 12);\n ux <<= -ex + 1;\n } else {\n ux &= -1 >> 12;\n ux |= 1 << 52;\n }\n if (!ey) {\n ey -= builtin_clz(uy << 12);\n uy <<= -ey + 1;\n } else {\n uy &= -1 >> 12;\n uy |= 1 << 52;\n }\n while (ex > ey) {\n if (ux >= uy) {\n if (ux == uy) return 0 * x;\n ux -= uy;\n }\n ux <<= 1;\n --ex;\n }\n if (ux >= uy) {\n if (ux == uy) return 0 * x;\n ux -= uy;\n }\n // for (; !(ux >> 52); ux <<= 1) --ex;\n var shift = builtin_clz(ux << 11);\n ex -= shift;\n ux <<= shift;\n if (ex > 0) {\n ux -= 1 << 52;\n ux |= ex << 52;\n } else {\n ux >>= -ex + 1;\n }\n ux |= sx << 63;\n return reinterpret(ux);\n }\n\n export function rem(x: f64, y: f64): f64 { // see: musl/src/math/remquo.c\n var ux = reinterpret(x);\n var uy = reinterpret(y);\n var ex = (ux >> 52 & 0x7FF);\n var ey = (uy >> 52 & 0x7FF);\n var sx = (ux >> 63);\n if (uy << 1 == 0 || ex == 0x7FF || isNaN(y)) {\n let m = x * y;\n return m / m;\n }\n if (ux << 1 == 0) return x;\n var uxi = ux;\n if (!ex) {\n ex -= builtin_clz(uxi << 12);\n uxi <<= -ex + 1;\n } else {\n uxi &= -1 >> 12;\n uxi |= 1 << 52;\n }\n if (!ey) {\n ey -= builtin_clz(uy << 12);\n uy <<= -ey + 1;\n } else {\n uy &= -1 >> 12;\n uy |= 1 << 52;\n }\n var q: u32 = 0;\n do {\n if (ex < ey) {\n if (ex + 1 == ey) break; // goto end\n return x;\n }\n while (ex > ey) {\n if (uxi >= uy) {\n uxi -= uy;\n ++q;\n }\n uxi <<= 1;\n q <<= 1;\n --ex;\n }\n if (uxi >= uy) {\n uxi -= uy;\n ++q;\n }\n if (uxi == 0) ex = -60;\n else {\n let shift = builtin_clz(uxi << 11);\n ex -= shift;\n uxi <<= shift;\n }\n break;\n } while (false);\n // end:\n if (ex > 0) {\n uxi -= 1 << 52;\n uxi |= ex << 52;\n } else {\n uxi >>= -ex + 1;\n }\n x = reinterpret(uxi);\n y = builtin_abs(y);\n var x2 = x + x;\n if (ex == ey || (ex + 1 == ey && (x2 > y || (x2 == y && (q & 1))))) {\n x -= y;\n // ++q;\n }\n return sx ? -x : x;\n }\n}\n\n// @ts-ignore: decorator\n@lazy\nvar rempio2f_y: f64;\n\n// @ts-ignore: decorator\n@lazy\nconst PIO2_TABLE: u64[] = [\n 0xA2F9836E4E441529,\n 0xFC2757D1F534DDC0,\n 0xDB6295993C439041,\n 0xFE5163ABDEBBC561\n];\n\nfunction Rf(z: f32): f32 { // Rational approximation of (asin(x)-x)/x^3\n const // see: musl/src/math/asinf.c and SUN COPYRIGHT NOTICE above\n pS0 = reinterpret(0x3E2AAA75), // 1.6666586697e-01f\n pS1 = reinterpret(0xBD2F13BA), // -4.2743422091e-02f\n pS2 = reinterpret(0xBC0DD36B), // -8.6563630030e-03f\n qS1 = reinterpret(0xBF34E5AE); // -7.0662963390e-01f\n var p = z * (pS0 + z * (pS1 + z * pS2));\n var q: f32 = 1 + z * qS1;\n return p / q;\n}\n\n// @ts-ignore: decorator\n@inline\nfunction expo2f(x: f32): f32 { // exp(x)/2 for x >= log(DBL_MAX)\n const // see: musl/src/math/__expo2f.c\n k = 235,\n kln2 = reinterpret(0x4322E3BC); // 0x1.45c778p+7f\n var scale = reinterpret((0x7F + (k >> 1)) << 23);\n return NativeMathf.exp(x - kln2) * scale * scale;\n}\n\n// @ts-ignore: decorator\n@inline\nfunction pio2_large_quot(x: f32, u: i32): i32 { // see: jdh8/metallic/blob/master/src/math/float/rem_pio2f.c\n const coeff = reinterpret(0x3BF921FB54442D18); // π * 0x1p-65 = 8.51530395021638647334e-20\n const bits = PIO2_TABLE;\n\n var offset = (u >> 23) - 152;\n var index = offset >> 6;\n var shift = offset & 63;\n\n var b0 = unchecked(bits[index + 0]);\n var b1 = unchecked(bits[index + 1]);\n var lo: u64;\n\n if (shift > 32) {\n let b2 = unchecked(bits[index + 2]);\n lo = b2 >> (96 - shift);\n lo |= b1 << (shift - 32);\n } else {\n lo = b1 >> (32 - shift);\n }\n\n var hi = (b1 >> (64 - shift)) | (b0 << shift);\n var mantissa: u64 = (u & 0x007FFFFF) | 0x00800000;\n var product: u64 = mantissa * hi + (mantissa * lo >> 32);\n var r: i64 = product << 2;\n var q: i32 = ((product >> 62) + (r >>> 63));\n rempio2f_y = copysign(coeff, x) * r;\n return q;\n}\n\n// @ts-ignore: decorator\n@inline\nfunction rempio2f(x: f32, u: u32, sign: i32): i32 { // see: jdh8/metallic/blob/master/src/math/float/rem_pio2f.c\n const pi2hi = reinterpret(0x3FF921FB50000000); // 1.57079631090164184570\n const pi2lo = reinterpret(0x3E5110B4611A6263); // 1.58932547735281966916e-8\n const _2_pi = reinterpret(0x3FE45F306DC9C883); // 0.63661977236758134308\n\n if (u < 0x4DC90FDB) { /* π * 0x1p28 */\n let q = nearest(x * _2_pi);\n rempio2f_y = x - q * pi2hi - q * pi2lo;\n return q;\n }\n\n var q = pio2_large_quot(x, u);\n return select(-q, q, sign);\n}\n\n/* |sin(x)/x - s(x)| < 2**-37.5 (~[-4.89e-12, 4.824e-12]). */\n// @ts-ignore: decorator\n@inline\nfunction sin_kernf(x: f64): f32 { // see: musl/tree/src/math/__sindf.c\n const S1 = reinterpret(0xBFC5555554CBAC77); // -0x15555554cbac77.0p-55\n const S2 = reinterpret(0x3F811110896EFBB2); // 0x111110896efbb2.0p-59\n const S3 = reinterpret(0xBF2A00F9E2CAE774); // -0x1a00f9e2cae774.0p-65\n const S4 = reinterpret(0x3EC6CD878C3B46A7); // 0x16cd878c3b46a7.0p-71\n\n var z = x * x;\n var w = z * z;\n var r = S3 + z * S4;\n var s = z * x;\n return ((x + s * (S1 + z * S2)) + s * w * r);\n}\n\n/* |cos(x) - c(x)| < 2**-34.1 (~[-5.37e-11, 5.295e-11]). */\n// @ts-ignore: decorator\n@inline\nfunction cos_kernf(x: f64): f32 { // see: musl/tree/src/math/__cosdf.c\n const C0 = reinterpret(0xBFDFFFFFFD0C5E81); // -0x1ffffffd0c5e81.0p-54\n const C1 = reinterpret(0x3FA55553E1053A42); // 0x155553e1053a42.0p-57\n const C2 = reinterpret(0xBF56C087E80F1E27); // -0x16c087e80f1e27.0p-62\n const C3 = reinterpret(0x3EF99342E0EE5069); // 0x199342e0ee5069.0p-68\n\n var z = x * x;\n var w = z * z;\n var r = C2 + z * C3;\n return (((1 + z * C0) + w * C1) + (w * z) * r);\n}\n\n/* |tan(x)/x - t(x)| < 2**-25.5 (~[-2e-08, 2e-08]). */\n// @ts-ignore: decorator\n@inline\nfunction tan_kernf(x: f64, odd: i32): f32 { // see: musl/tree/src/math/__tandf.c\n\n const T0 = reinterpret(0x3FD5554D3418C99F); /* 0x15554d3418c99f.0p-54 */\n const T1 = reinterpret(0x3FC112FD38999F72); /* 0x1112fd38999f72.0p-55 */\n const T2 = reinterpret(0x3FAB54C91D865AFE); /* 0x1b54c91d865afe.0p-57 */\n const T3 = reinterpret(0x3F991DF3908C33CE); /* 0x191df3908c33ce.0p-58 */\n const T4 = reinterpret(0x3F685DADFCECF44E); /* 0x185dadfcecf44e.0p-61 */\n const T5 = reinterpret(0x3F8362B9BF971BCD); /* 0x1362b9bf971bcd.0p-59 */\n\n var z = x * x;\n var r = T4 + z * T5;\n var t = T2 + z * T3;\n var w = z * z;\n var s = z * x;\n var u = T0 + z * T1;\n\n r = (x + s * u) + (s * w) * (t + w * r);\n return (odd ? -1 / r : r);\n}\n\nexport namespace NativeMathf {\n\n // @ts-ignore: decorator\n @lazy\n export const E = NativeMath.E;\n\n // @ts-ignore: decorator\n @lazy\n export const LN2 = NativeMath.LN2;\n\n // @ts-ignore: decorator\n @lazy\n export const LN10 = NativeMath.LN10;\n\n // @ts-ignore: decorator\n @lazy\n export const LOG2E = NativeMath.LOG2E;\n\n // @ts-ignore: decorator\n @lazy\n export const LOG10E = NativeMath.LOG10E;\n\n // @ts-ignore: decorator\n @lazy\n export const PI = NativeMath.PI;\n\n // @ts-ignore: decorator\n @lazy\n export const SQRT1_2 = NativeMath.SQRT1_2;\n\n // @ts-ignore: decorator\n @lazy\n export const SQRT2 = NativeMath.SQRT2;\n\n // @ts-ignore: decorator\n @lazy\n export var sincos_sin: f32 = 0;\n\n // @ts-ignore: decorator\n @lazy\n export var sincos_cos: f32 = 0;\n\n // @ts-ignore: decorator\n @inline\n export function abs(x: f32): f32 {\n return builtin_abs(x);\n }\n\n export function acos(x: f32): f32 { // see: musl/src/math/acosf.c and SUN COPYRIGHT NOTICE above\n const\n pio2_hi = reinterpret(0x3FC90FDA), // 1.5707962513e+00f\n pio2_lo = reinterpret(0x33A22168), // 7.5497894159e-08f\n Ox1p_120f = reinterpret(0x03800000);\n var hx = reinterpret(x);\n var ix = hx & 0x7FFFFFFF;\n if (ix >= 0x3F800000) {\n if (ix == 0x3F800000) {\n if (hx >> 31) return 2 * pio2_hi + Ox1p_120f;\n return 0;\n }\n return 0 / (x - x);\n }\n if (ix < 0x3F000000) {\n if (ix <= 0x32800000) return pio2_hi + Ox1p_120f;\n return pio2_hi - (x - (pio2_lo - x * Rf(x * x)));\n }\n var z: f32, w: f32, s: f32;\n if (hx >> 31) {\n // z = (1 + x) * 0.5;\n z = 0.5 + x * 0.5;\n s = builtin_sqrt(z);\n w = Rf(z) * s - pio2_lo;\n return 2 * (pio2_hi - (s + w));\n }\n // z = (1 - x) * 0.5;\n z = 0.5 - x * 0.5;\n s = builtin_sqrt(z);\n hx = reinterpret(s);\n var df = reinterpret(hx & 0xFFFFF000);\n var c = (z - df * df) / (s + df);\n w = Rf(z) * s + c;\n return 2 * (df + w);\n }\n\n export function acosh(x: f32): f32 { // see: musl/src/math/acoshf.c\n const s = reinterpret(0x3F317218); // 0.693147180559945309417232121458176568f\n var u = reinterpret(x);\n var a = u & 0x7FFFFFFF;\n if (a < 0x3F800000 + (1 << 23)) {\n let xm1 = x - 1;\n return log1p(xm1 + builtin_sqrt(xm1 * (xm1 + 2)));\n }\n if (a < 0x3F800000 + (12 << 23)) return log(2 * x - 1 / (x + builtin_sqrt(x * x - 1)));\n return log(x) + s;\n }\n\n export function asin(x: f32): f32 { // see: musl/src/math/asinf.c and SUN COPYRIGHT NOTICE above\n const\n pio2 = reinterpret(0x3FC90FDB), // 1.570796326794896558e+00f\n Ox1p_120f = reinterpret(0x03800000);\n var sx = x;\n var hx = reinterpret(x) & 0x7FFFFFFF;\n if (hx >= 0x3F800000) {\n if (hx == 0x3F800000) return x * pio2 + Ox1p_120f;\n return 0 / (x - x);\n }\n if (hx < 0x3F000000) {\n if (hx < 0x39800000 && hx >= 0x00800000) return x;\n return x + x * Rf(x * x);\n }\n // var z: f32 = (1 - builtin_abs(x)) * 0.5;\n var z: f32 = 0.5 - builtin_abs(x) * 0.5;\n var s = builtin_sqrt(z); // sic\n x = (pio2 - 2 * (s + s * Rf(z)));\n return builtin_copysign(x, sx);\n }\n\n export function asinh(x: f32): f32 { // see: musl/src/math/asinhf.c\n const c = reinterpret(0x3F317218); // 0.693147180559945309417232121458176568f\n var u = reinterpret(x) & 0x7FFFFFFF;\n var y = reinterpret(u);\n if (u >= 0x3F800000 + (12 << 23)) y = log(y) + c;\n else if (u >= 0x3F800000 + (1 << 23)) y = log(2 * y + 1 / (builtin_sqrt(y * y + 1) + y));\n else if (u >= 0x3F800000 - (12 << 23)) y = log1p(y + y * y / (builtin_sqrt(y * y + 1) + 1));\n return builtin_copysign(y, x);\n }\n\n export function atan(x: f32): f32 { // see: musl/src/math/atanf.c and SUN COPYRIGHT NOTICE above\n const\n atanhi0 = reinterpret(0x3EED6338), // 4.6364760399e-01f\n atanhi1 = reinterpret(0x3F490FDA), // 7.8539812565e-01f\n atanhi2 = reinterpret(0x3F7B985E), // 9.8279368877e-01f\n atanhi3 = reinterpret(0x3FC90FDA), // 1.5707962513e+00f\n atanlo0 = reinterpret(0x31AC3769), // 5.0121582440e-09f\n atanlo1 = reinterpret(0x33222168), // 3.7748947079e-08f\n atanlo2 = reinterpret(0x33140FB4), // 3.4473217170e-08f\n atanlo3 = reinterpret(0x33A22168), // 7.5497894159e-08f\n aT0 = reinterpret(0x3EAAAAA9), // 3.3333328366e-01f\n aT1 = reinterpret(0xBE4CCA98), // -1.9999158382e-01f\n aT2 = reinterpret(0x3E11F50D), // 1.4253635705e-01f\n aT3 = reinterpret(0xBDDA1247), // -1.0648017377e-01f\n aT4 = reinterpret(0x3D7CAC25), // 6.1687607318e-02f\n Ox1p_120f = reinterpret(0x03800000);\n var ix = reinterpret(x);\n var sx = x;\n ix &= 0x7FFFFFFF;\n var z: f32;\n if (ix >= 0x4C800000) {\n if (isNaN(x)) return x;\n z = atanhi3 + Ox1p_120f;\n return builtin_copysign(z, sx);\n }\n var id: i32;\n if (ix < 0x3EE00000) {\n if (ix < 0x39800000) return x;\n id = -1;\n } else {\n x = builtin_abs(x);\n if (ix < 0x3F980000) {\n if (ix < 0x3F300000) {\n id = 0;\n x = (2.0 * x - 1.0) / (2.0 + x);\n } else {\n id = 1;\n x = (x - 1.0) / (x + 1.0);\n }\n } else {\n if (ix < 0x401C0000) {\n id = 2;\n x = (x - 1.5) / (1.0 + 1.5 * x);\n } else {\n id = 3;\n x = -1.0 / x;\n }\n }\n }\n z = x * x;\n var w = z * z;\n var s1 = z * (aT0 + w * (aT2 + w * aT4));\n var s2 = w * (aT1 + w * aT3);\n var s3 = x * (s1 + s2);\n if (id < 0) return x - s3;\n switch (id) {\n case 0: { z = atanhi0 - ((s3 - atanlo0) - x); break; }\n case 1: { z = atanhi1 - ((s3 - atanlo1) - x); break; }\n case 2: { z = atanhi2 - ((s3 - atanlo2) - x); break; }\n case 3: { z = atanhi3 - ((s3 - atanlo3) - x); break; }\n default: unreachable();\n }\n return builtin_copysign(z, sx);\n }\n\n export function atanh(x: f32): f32 { // see: musl/src/math/atanhf.c\n var u = reinterpret(x);\n u &= 0x7FFFFFFF;\n var y = reinterpret(u);\n if (u < 0x3F800000 - (1 << 23)) {\n if (u >= 0x3F800000 - (32 << 23)) y = 0.5 * log1p(2 * y * (1.0 + y / (1 - y)));\n } else y = 0.5 * log1p(2 * (y / (1 - y)));\n return builtin_copysign(y, x);\n }\n\n export function atan2(y: f32, x: f32): f32 { // see: musl/src/math/atan2f.c and SUN COPYRIGHT NOTICE above\n const\n pi = reinterpret(0x40490FDB), // 3.1415927410e+00f\n pi_lo = reinterpret(0xB3BBBD2E); // -8.7422776573e-08f\n if (isNaN(x) || isNaN(y)) return x + y;\n var ix = reinterpret(x);\n var iy = reinterpret(y);\n if (ix == 0x3F800000) return atan(y);\n var m = (((iy >> 31) & 1) | ((ix >> 30) & 2));\n ix &= 0x7FFFFFFF;\n iy &= 0x7FFFFFFF;\n if (iy == 0) {\n switch (m) {\n case 0:\n case 1: return y;\n case 2: return pi;\n case 3: return -pi;\n }\n }\n if (ix == 0) return m & 1 ? -pi / 2 : pi / 2;\n if (ix == 0x7F800000) {\n if (iy == 0x7F800000) {\n switch (m) {\n case 0: return pi / 4;\n case 1: return -pi / 4;\n case 2: return 3 * pi / 4;\n case 3: return -3 * pi / 4;\n }\n } else {\n switch (m) {\n case 0: return 0;\n case 1: return -0;\n case 2: return pi;\n case 3: return -pi;\n }\n }\n }\n if (ix + (26 << 23) < iy || iy == 0x7F800000) return m & 1 ? -pi / 2 : pi / 2;\n var z: f32;\n if ((m & 2) && iy + (26 << 23) < ix) z = 0.0;\n else z = atan(builtin_abs(y / x));\n switch (m) {\n case 0: return z;\n case 1: return -z;\n case 2: return pi - (z - pi_lo);\n case 3: return (z - pi_lo) - pi;\n }\n unreachable();\n return 0;\n }\n\n export function cbrt(x: f32): f32 { // see: musl/src/math/cbrtf.c and SUN COPYRIGHT NOTICE above\n const\n B1 = 709958130,\n B2 = 642849266,\n Ox1p24f = reinterpret(0x4B800000);\n var u = reinterpret(x);\n var hx = u & 0x7FFFFFFF;\n if (hx >= 0x7F800000) return x + x;\n if (hx < 0x00800000) {\n if (hx == 0) return x;\n u = reinterpret(x * Ox1p24f);\n hx = u & 0x7FFFFFFF;\n hx = hx / 3 + B2;\n } else {\n hx = hx / 3 + B1;\n }\n u &= 0x80000000;\n u |= hx;\n var t = reinterpret(u);\n var r = t * t * t;\n t = t * (x + x + r) / (x + r + r);\n r = t * t * t;\n t = t * (x + x + r) / (x + r + r);\n return t;\n }\n\n // @ts-ignore: decorator\n @inline\n export function ceil(x: f32): f32 {\n return builtin_ceil(x);\n }\n\n export function clz32(x: f32): f32 {\n if (!isFinite(x)) return 32;\n return builtin_clz(\n (x - 4294967296 * builtin_floor(x * (1.0 / 4294967296)))\n );\n }\n\n export function cos(x: f32): f32 { // see: musl/src/math/cosf.c\n const c1pio2 = reinterpret(0x3FF921FB54442D18); // M_PI_2 * 1\n const c2pio2 = reinterpret(0x400921FB54442D18); // M_PI_2 * 2\n const c3pio2 = reinterpret(0x4012D97C7F3321D2); // M_PI_2 * 3\n const c4pio2 = reinterpret(0x401921FB54442D18); // M_PI_2 * 4\n\n var ix = reinterpret(x);\n var sign = ix >> 31;\n ix &= 0x7FFFFFFF;\n\n if (ix <= 0x3f490fda) { /* |x| ~<= π/4 */\n if (ix < 0x39800000) { /* |x| < 2**-12 */\n /* raise inexact if x != 0 */\n return 1;\n }\n return cos_kernf(x);\n }\n\n if (ASC_SHRINK_LEVEL < 1) {\n if (ix <= 0x407b53d1) { /* |x| ~<= 5π/4 */\n if (ix > 0x4016cbe3) { /* |x| ~> 3π/4 */\n return -cos_kernf(sign ? x + c2pio2 : x - c2pio2);\n } else {\n return sign ? sin_kernf(x + c1pio2) : sin_kernf(c1pio2 - x);\n }\n }\n if (ix <= 0x40e231d5) { /* |x| ~<= 9π/4 */\n if (ix > 0x40afeddf) { /* |x| ~> 7π/4 */\n return cos_kernf(sign ? x + c4pio2 : x - c4pio2);\n } else {\n return sign ? sin_kernf(-x - c3pio2) : sin_kernf(x - c3pio2);\n }\n }\n }\n\n /* cos(Inf or NaN) is NaN */\n if (ix >= 0x7f800000) return x - x;\n\n /* general argument reduction needed */\n var n = rempio2f(x, ix, sign);\n var y = rempio2f_y;\n\n var t = n & 1 ? sin_kernf(y) : cos_kernf(y);\n return (n + 1) & 2 ? -t : t;\n }\n\n export function cosh(x: f32): f32 { // see: musl/src/math/coshf.c\n var u = reinterpret(x);\n u &= 0x7FFFFFFF;\n x = reinterpret(u);\n if (u < 0x3F317217) {\n if (u < 0x3F800000 - (12 << 23)) return 1;\n let t = expm1(x);\n // return 1 + t * t / (2 * (1 + t));\n return 1 + t * t / (2 + 2 * t);\n }\n if (u < 0x42B17217) {\n let t = exp(x);\n // return 0.5 * (t + 1 / t);\n return 0.5 * t + 0.5 / t;\n }\n return expo2f(x);\n }\n\n // @ts-ignore: decorator\n @inline\n export function floor(x: f32): f32 {\n return builtin_floor(x);\n }\n\n export function exp(x: f32): f32 { // see: musl/src/math/expf.c and SUN COPYRIGHT NOTICE above\n const\n ln2hi = reinterpret(0x3F317200), // 6.9314575195e-1f\n ln2lo = reinterpret(0x35BFBE8E), // 1.4286067653e-6f\n invln2 = reinterpret(0x3FB8AA3B), // 1.4426950216e+0f\n P1 = reinterpret(0x3E2AAA8F), // 1.6666625440e-1f\n P2 = reinterpret(0xBB355215), // -2.7667332906e-3f\n Ox1p127f = reinterpret(0x7F000000);\n var hx = reinterpret(x);\n var sign_ = (hx >> 31);\n hx &= 0x7FFFFFFF;\n if (hx >= 0x42AEAC50) {\n if (hx >= 0x42B17218) {\n if (!sign_) return x * Ox1p127f;\n else if (hx >= 0x42CFF1B5) return 0;\n }\n }\n var hi: f32, lo: f32;\n var k: i32;\n if (hx > 0x3EB17218) {\n if (hx > 0x3F851592) {\n k = (invln2 * x + builtin_copysign(0.5, x));\n } else {\n k = 1 - (sign_ << 1);\n }\n hi = x - k * ln2hi;\n lo = k * ln2lo;\n x = hi - lo;\n } else if (hx > 0x39000000) {\n k = 0;\n hi = x;\n lo = 0;\n } else {\n return 1 + x;\n }\n var xx = x * x;\n var c = x - xx * (P1 + xx * P2);\n var y: f32 = 1 + (x * c / (2 - c) - lo + hi);\n if (k == 0) return y;\n return scalbn(y, k);\n }\n\n export function expm1(x: f32): f32 { // see: musl/src/math/expm1f.c and SUN COPYRIGHT NOTICE above\n const\n o_threshold = reinterpret(0x42B17180), // 8.8721679688e+01f\n ln2_hi = reinterpret(0x3F317180), // 6.9313812256e-01f\n ln2_lo = reinterpret(0x3717F7D1), // 9.0580006145e-06f\n invln2 = reinterpret(0x3FB8AA3B), // 1.4426950216e+00f\n Q1 = reinterpret(0xBD088868), // -3.3333212137e-02f\n Q2 = reinterpret(0x3ACF3010), // 1.5807170421e-03f\n Ox1p127f = reinterpret(0x7F000000);\n var u = reinterpret(x);\n var hx = u & 0x7FFFFFFF;\n var sign_ = (u >> 31);\n if (hx >= 0x4195B844) {\n if (hx > 0x7F800000) return x;\n if (sign_) return -1;\n if (x > o_threshold) {\n x *= Ox1p127f;\n return x;\n }\n }\n var c: f32 = 0.0, t: f32, k: i32;\n if (hx > 0x3EB17218) {\n k = select(\n 1 - (sign_ << 1),\n (invln2 * x + builtin_copysign(0.5, x)),\n hx < 0x3F851592\n );\n t = k;\n let hi = x - t * ln2_hi;\n let lo = t * ln2_lo;\n x = hi - lo;\n c = (hi - x) - lo;\n } else if (hx < 0x33000000) {\n return x;\n } else k = 0;\n var hfx: f32 = 0.5 * x;\n var hxs: f32 = x * hfx;\n var r1: f32 = 1.0 + hxs * (Q1 + hxs * Q2);\n t = 3.0 - r1 * hfx;\n var e = hxs * ((r1 - t) / (6.0 - x * t));\n if (k == 0) return x - (x * e - hxs);\n e = x * (e - c) - c;\n e -= hxs;\n if (k == -1) return 0.5 * (x - e) - 0.5;\n if (k == 1) {\n if (x < -0.25) return -2.0 * (e - (x + 0.5));\n return 1.0 + 2.0 * (x - e);\n }\n u = (0x7F + k) << 23;\n var twopk = reinterpret(u);\n var y: f32;\n if (k < 0 || k > 56) {\n y = x - e + 1.0;\n if (k == 128) y = y * 2.0 * Ox1p127f;\n else y = y * twopk;\n return y - 1.0;\n }\n u = (0x7F - k) << 23;\n y = reinterpret(u);\n if (k < 20) y = (1 - y) - e;\n else y = 1 - (e + y);\n return (x + y) * twopk;\n }\n\n // @ts-ignore: decorator\n @inline\n export function fround(x: f32): f32 {\n return x;\n }\n\n export function hypot(x: f32, y: f32): f32 { // see: musl/src/math/hypotf.c\n const\n Ox1p90f = reinterpret(0x6C800000),\n Ox1p_90f = reinterpret(0x12800000);\n var ux = reinterpret(x);\n var uy = reinterpret(y);\n ux &= 0x7FFFFFFF;\n uy &= 0x7FFFFFFF;\n if (ux < uy) {\n let ut = ux;\n ux = uy;\n uy = ut;\n }\n x = reinterpret(ux);\n y = reinterpret(uy);\n if (uy == 0xFF << 23) return y;\n if (ux >= 0xFF << 23 || uy == 0 || ux - uy >= 25 << 23) return x + y;\n var z: f32 = 1;\n if (ux >= (0x7F + 60) << 23) {\n z = Ox1p90f;\n x *= Ox1p_90f;\n y *= Ox1p_90f;\n } else if (uy < (0x7F - 60) << 23) {\n z = Ox1p_90f;\n x *= Ox1p90f;\n y *= Ox1p90f;\n }\n return z * builtin_sqrt((x * x + y * y));\n }\n\n // @ts-ignore: decorator\n @inline\n export function imul(x: f32, y: f32): f32 {\n /*\n * Wasm (MVP) and JS have different approaches for double->int conversions.\n *\n * For emulate JS conversion behavior and avoid trapping from wasm we should modulate by MAX_INT\n * our float-point arguments before actual convertion to integers.\n */\n if (!isFinite(x + y)) return 0;\n const inv32 = 1.0 / 4294967296;\n return (\n (x - 4294967296 * builtin_floor(x * inv32)) *\n (y - 4294967296 * builtin_floor(y * inv32))\n );\n }\n\n export function log(x: f32): f32 { // see: musl/src/math/logf.c and SUN COPYRIGHT NOTICE above\n const\n ln2_hi = reinterpret(0x3F317180), // 6.9313812256e-01f\n ln2_lo = reinterpret(0x3717F7D1), // 9.0580006145e-06f\n Lg1 = reinterpret(0x3F2AAAAA), // 0xaaaaaa.0p-24f\n Lg2 = reinterpret(0x3ECCCE13), // 0xccce13.0p-25f\n Lg3 = reinterpret(0x3E91E9EE), // 0x91e9ee.0p-25f\n Lg4 = reinterpret(0x3E789E26), // 0xf89e26.0p-26f\n Ox1p25f = reinterpret(0x4C000000);\n var u = reinterpret(x);\n var k = 0;\n if (u < 0x00800000 || (u >> 31)) {\n if (u << 1 == 0) return -1 / (x * x);\n if (u >> 31) return (x - x) / 0;\n k -= 25;\n x *= Ox1p25f;\n u = reinterpret(x);\n } else if (u >= 0x7F800000) return x;\n else if (u == 0x3F800000) return 0;\n u += 0x3F800000 - 0x3F3504F3;\n k += (u >> 23) - 0x7F;\n u = (u & 0x007FFFFF) + 0x3F3504F3;\n x = reinterpret(u);\n var f = x - 1.0;\n var s = f / (2.0 + f);\n var z = s * s;\n var w = z * z;\n var t1 = w * (Lg2 + w * Lg4);\n var t2 = z * (Lg1 + w * Lg3);\n var r = t2 + t1;\n var hfsq = 0.5 * f * f;\n var dk = k;\n return s * (hfsq + r) + dk * ln2_lo - hfsq + f + dk * ln2_hi;\n }\n\n export function log10(x: f32): f32 { // see: musl/src/math/log10f.c and SUN COPYRIGHT NOTICE above\n const\n ivln10hi = reinterpret(0x3EDE6000), // 4.3432617188e-01f\n ivln10lo = reinterpret(0xB804EAD9), // -3.1689971365e-05f\n log10_2hi = reinterpret(0x3E9A2080), // 3.0102920532e-01f\n log10_2lo = reinterpret(0x355427DB), // 7.9034151668e-07f\n Lg1 = reinterpret(0x3F2AAAAA), // 0xaaaaaa.0p-24f, 0.66666662693f\n Lg2 = reinterpret(0x3ECCCE13), // 0xccce13.0p-25f, 0.40000972152f\n Lg3 = reinterpret(0x3E91E9EE), // 0x91e9ee.0p-25f, 0.28498786688f\n Lg4 = reinterpret(0x3E789E26), // 0xf89e26.0p-26f, 0.24279078841f\n Ox1p25f = reinterpret(0x4C000000);\n var ix = reinterpret(x);\n var k = 0;\n if (ix < 0x00800000 || (ix >> 31)) {\n if (ix << 1 == 0) return -1 / (x * x);\n if (ix >> 31) return (x - x) / 0.0;\n k -= 25;\n x *= Ox1p25f;\n ix = reinterpret(x);\n } else if (ix >= 0x7F800000) return x;\n else if (ix == 0x3F800000) return 0;\n ix += 0x3F800000 - 0x3F3504F3;\n k += (ix >> 23) - 0x7F;\n ix = (ix & 0x007FFFFF) + 0x3F3504F3;\n x = reinterpret(ix);\n var f = x - 1.0;\n var s = f / (2.0 + f);\n var z = s * s;\n var w = z * z;\n var t1 = w * (Lg2 + w * Lg4);\n var t2 = z * (Lg1 + w * Lg3);\n var r = t2 + t1;\n var hfsq: f32 = 0.5 * f * f;\n var hi = f - hfsq;\n ix = reinterpret(hi);\n ix &= 0xFFFFF000;\n hi = reinterpret(ix);\n var lo = f - hi - hfsq + s * (hfsq + r);\n var dk = k;\n return dk * log10_2lo + (lo + hi) * ivln10lo + lo * ivln10hi + hi * ivln10hi + dk * log10_2hi;\n }\n\n export function log1p(x: f32): f32 { // see: musl/src/math/log1pf.c and SUN COPYRIGHT NOTICE above\n const\n ln2_hi = reinterpret(0x3F317180), // 6.9313812256e-01\n ln2_lo = reinterpret(0x3717F7D1), // 9.0580006145e-06\n Lg1 = reinterpret(0x3F2AAAAA), // 0xaaaaaa.0p-24f, 0.66666662693f\n Lg2 = reinterpret(0x3ECCCE13), // 0xccce13.0p-25f, 0.40000972152f\n Lg3 = reinterpret(0x3E91E9EE), // 0x91e9ee.0p-25f, 0.28498786688f\n Lg4 = reinterpret(0x3E789E26); // 0xf89e26.0p-26f, 0.24279078841f\n var ix = reinterpret(x);\n var c: f32 = 0, f: f32 = 0;\n var k: i32 = 1;\n if (ix < 0x3ED413D0 || (ix >> 31)) {\n if (ix >= 0xBF800000) {\n if (x == -1) return x / 0.0;\n return (x - x) / 0.0;\n }\n if (ix << 1 < 0x33800000 << 1) return x;\n if (ix <= 0xBE95F619) {\n k = 0;\n c = 0;\n f = x;\n }\n } else if (ix >= 0x7F800000) return x;\n if (k) {\n let uf: f32 = 1 + x;\n let iu = reinterpret(uf);\n iu += 0x3F800000 - 0x3F3504F3;\n k = (iu >> 23) - 0x7F;\n if (k < 25) {\n c = k >= 2 ? 1 - (uf - x) : x - (uf - 1);\n c /= uf;\n } else c = 0;\n iu = (iu & 0x007FFFFF) + 0x3F3504F3;\n f = reinterpret(iu) - 1;\n }\n var s = f / (2.0 + f);\n var z = s * s;\n var w = z * z;\n var t1 = w * (Lg2 + w * Lg4);\n var t2 = z * (Lg1 + w * Lg3);\n var r = t2 + t1;\n var hfsq: f32 = 0.5 * f * f;\n var dk = k;\n return s * (hfsq + r) + (dk * ln2_lo + c) - hfsq + f + dk * ln2_hi;\n }\n\n export function log2(x: f32): f32 { // see: musl/src/math/log2f.c and SUN COPYRIGHT NOTICE above\n const\n ivln2hi = reinterpret(0x3FB8B000), // 1.4428710938e+00f\n ivln2lo = reinterpret(0xB9389AD4), // -1.7605285393e-04\n Lg1 = reinterpret(0x3F2AAAAA), // 0xaaaaaa.0p-24f, 0.66666662693f\n Lg2 = reinterpret(0x3ECCCE13), // 0xccce13.0p-25f, 0.40000972152f\n Lg3 = reinterpret(0x3E91E9EE), // 0x91e9ee.0p-25f, 0.28498786688f\n Lg4 = reinterpret(0x3E789E26), // 0xf89e26.0p-26f, 0.24279078841f\n Ox1p25f = reinterpret(0x4C000000);\n var ix = reinterpret(x);\n var k: i32 = 0;\n if (ix < 0x00800000 || (ix >> 31)) {\n if (ix << 1 == 0) return -1 / (x * x);\n if (ix >> 31) return (x - x) / 0.0;\n k -= 25;\n x *= Ox1p25f;\n ix = reinterpret(x);\n } else if (ix >= 0x7F800000) return x;\n else if (ix == 0x3F800000) return 0;\n ix += 0x3F800000 - 0x3F3504F3;\n k += (ix >> 23) - 0x7F;\n ix = (ix & 0x007FFFFF) + 0x3F3504F3;\n x = reinterpret(ix);\n var f = x - 1.0;\n var s = f / (2.0 + f);\n var z = s * s;\n var w = z * z;\n var t1 = w * (Lg2 + w * Lg4);\n var t2 = z * (Lg1 + w * Lg3);\n var r = t2 + t1;\n var hfsq: f32 = 0.5 * f * f;\n var hi = f - hfsq;\n var u = reinterpret(hi);\n u &= 0xFFFFF000;\n hi = reinterpret(u);\n var lo: f32 = f - hi - hfsq + s * (hfsq + r);\n var dk = k;\n return (lo + hi) * ivln2lo + lo * ivln2hi + hi * ivln2hi + dk;\n }\n\n // @ts-ignore: decorator\n @inline\n export function max(value1: f32, value2: f32): f32 {\n return builtin_max(value1, value2);\n }\n\n // @ts-ignore: decorator\n @inline\n export function min(value1: f32, value2: f32): f32 {\n return builtin_min(value1, value2);\n }\n\n export function pow(x: f32, y: f32): f32 { // see: musl/src/math/powf.c and SUN COPYRIGHT NOTICE above\n const\n dp_h1 = reinterpret(0x3F15C000), // 5.84960938e-01f\n dp_l1 = reinterpret(0x35D1CFDC), // 1.56322085e-06f\n two24 = reinterpret(0x4B800000), // 16777216f\n huge = reinterpret(0x7149F2CA), // 1.0e+30f\n tiny = reinterpret(0x0DA24260), // 1.0e-30f\n L1 = reinterpret(0x3F19999A), // 6.0000002384e-01f\n L2 = reinterpret(0x3EDB6DB7), // 4.2857143283e-01f\n L3 = reinterpret(0x3EAAAAAB), // 3.3333334327e-01f\n L4 = reinterpret(0x3E8BA305), // 2.7272811532e-01f\n L5 = reinterpret(0x3E6C3255), // 2.3066075146e-01f\n L6 = reinterpret(0x3E53F142), // 2.0697501302e-01f\n P1 = reinterpret(0x3E2AAAAB), // 1.6666667163e-01f\n P2 = reinterpret(0xBB360B61), // -2.7777778450e-03f\n P3 = reinterpret(0x388AB355), // 6.6137559770e-05f\n P4 = reinterpret(0xB5DDEA0E), // -1.6533901999e-06f\n P5 = reinterpret(0x3331BB4C), // 4.1381369442e-08f\n lg2 = reinterpret(0x3F317218), // 6.9314718246e-01f\n lg2_h = reinterpret(0x3F317200), // 6.93145752e-01f\n lg2_l = reinterpret(0x35BFBE8C), // 1.42860654e-06f\n ovt = reinterpret(0x3338AA3C), // 4.2995665694e-08f\n cp = reinterpret(0x3F76384F), // 9.6179670095e-01\n cp_h = reinterpret(0x3F764000), // 9.6191406250e-01\n cp_l = reinterpret(0xB8F623C6), // -1.1736857402e-04\n ivln2 = reinterpret(0x3FB8AA3B), // 1.4426950216e+00\n ivln2_h = reinterpret(0x3FB8AA00), // 1.4426879883e+00\n ivln2_l = reinterpret(0x36ECA570), // 7.0526075433e-06\n inv3 = reinterpret(0x3EAAAAAB); // 0.333333333333\n var hx = reinterpret(x);\n var hy = reinterpret(y);\n var ix = hx & 0x7FFFFFFF;\n var iy = hy & 0x7FFFFFFF;\n if (iy == 0) return 1.0; // x**0 = 1, even if x is NaN\n // if (hx == 0x3F800000) return 1.0; // C: 1**y = 1, even if y is NaN, JS: NaN\n if (ix > 0x7F800000 || iy > 0x7F800000) return x + y; // NaN if either arg is NaN\n var yisint = 0, j: i32, k: i32;\n if (hx < 0) {\n if (iy >= 0x4B800000) yisint = 2;\n else if (iy >= 0x3F800000) {\n k = (iy >> 23) - 0x7F;\n let ki = 23 - k;\n j = iy >> ki;\n if ((j << ki) == iy) yisint = 2 - (j & 1);\n }\n }\n if (iy == 0x7F800000) { // y is +-inf\n if (ix == 0x3F800000) return NaN; // C: (-1)**+-inf is 1, JS: NaN\n else if (ix > 0x3F800000) return hy >= 0 ? y : 0.0; // (|x|>1)**+-inf = inf,0\n else return hy >= 0 ? 0.0 : -y; // (|x|<1)**+-inf = 0,inf\n }\n if (iy == 0x3F800000) return hy >= 0 ? x : 1.0 / x;\n if (hy == 0x40000000) return x * x;\n if (hy == 0x3F000000) {\n if (hx >= 0) return builtin_sqrt(x);\n }\n var ax = builtin_abs(x);\n var z: f32;\n if (ix == 0x7F800000 || ix == 0 || ix == 0x3F800000) {\n z = ax;\n if (hy < 0) z = 1.0 / z;\n if (hx < 0) {\n if (((ix - 0x3F800000) | yisint) == 0) {\n let d = z - z;\n z = d / d;\n }\n else if (yisint == 1) z = -z;\n }\n return z;\n }\n var sn = 1.0;\n if (hx < 0) {\n if (yisint == 0) {\n let d = x - x;\n return d / d;\n }\n if (yisint == 1) sn = -1.0;\n }\n var t1: f32, t2: f32, r: f32, s: f32, t: f32, u: f32, v: f32, w: f32, p_h: f32, p_l: f32;\n var n: i32, is: i32;\n if (iy > 0x4D000000) {\n if (ix < 0x3F7FFFF8) return hy < 0 ? sn * huge * huge : sn * tiny * tiny;\n if (ix > 0x3F800007) return hy > 0 ? sn * huge * huge : sn * tiny * tiny;\n t = ax - 1;\n w = (t * t) * (0.5 - t * (inv3 - t * 0.25));\n u = ivln2_h * t;\n v = t * ivln2_l - w * ivln2;\n t1 = u + v;\n is = reinterpret(t1);\n t1 = reinterpret(is & 0xFFFFF000);\n t2 = v - (t1 - u);\n } else {\n let s2: f32, s_h: f32, s_l: f32, t_h: f32, t_l: f32;\n n = 0;\n if (ix < 0x00800000) {\n ax *= two24;\n n -= 24;\n ix = reinterpret(ax);\n }\n n += (ix >> 23) - 0x7F;\n j = ix & 0x007FFFFF;\n ix = j | 0x3F800000;\n if (j <= 0x1CC471) k = 0;\n else if (j < 0x5DB3D7) k = 1;\n else {\n k = 0;\n n += 1;\n ix -= 0x00800000;\n }\n ax = reinterpret(ix);\n let bp = select(1.5, 1.0, k); // k ? 1.5 : 1.0\n u = ax - bp;\n v = 1.0 / (ax + bp);\n s = u * v;\n s_h = s;\n is = reinterpret(s_h);\n s_h = reinterpret(is & 0xFFFFF000);\n is = ((ix >> 1) & 0xFFFFF000) | 0x20000000;\n t_h = reinterpret(is + 0x00400000 + (k << 21));\n t_l = ax - (t_h - bp);\n s_l = v * ((u - s_h * t_h) - s_h * t_l);\n s2 = s * s;\n r = s2 * s2 * (L1 + s2 * (L2 + s2 * (L3 + s2 * (L4 + s2 * (L5 + s2 * L6)))));\n r += s_l * (s_h + s);\n s2 = s_h * s_h;\n t_h = 3.0 + s2 + r;\n is = reinterpret(t_h);\n t_h = reinterpret(is & 0xFFFFF000);\n t_l = r - ((t_h - 3.0) - s2);\n u = s_h * t_h;\n v = s_l * t_h + t_l * s;\n p_h = u + v;\n is = reinterpret(p_h);\n p_h = reinterpret(is & 0xFFFFF000);\n p_l = v - (p_h - u);\n let z_h = cp_h * p_h;\n let dp_l = select(dp_l1, 0.0, k);\n let z_l = cp_l * p_h + p_l * cp + dp_l;\n t = n;\n let dp_h = select(dp_h1, 0.0, k);\n t1 = (((z_h + z_l) + dp_h) + t);\n is = reinterpret(t1);\n t1 = reinterpret(is & 0xFFFFF000);\n t2 = z_l - (((t1 - t) - dp_h) - z_h);\n }\n is = reinterpret(y);\n var y1 = reinterpret(is & 0xFFFFF000);\n p_l = (y - y1) * t1 + y * t2;\n p_h = y1 * t1;\n z = p_l + p_h;\n j = reinterpret(z);\n if (j > 0x43000000) {\n return sn * huge * huge;\n } else if (j == 0x43000000) {\n if (p_l + ovt > z - p_h) return sn * huge * huge;\n } else if ((j & 0x7FFFFFFF) > 0x43160000) {\n return sn * tiny * tiny;\n } else if (j == 0xC3160000) {\n if (p_l <= z - p_h) return sn * tiny * tiny;\n }\n var i = j & 0x7FFFFFFF;\n k = (i >> 23) - 0x7F;\n n = 0;\n if (i > 0x3F000000) {\n n = j + (0x00800000 >> (k + 1));\n k = ((n & 0x7FFFFFFF) >> 23) - 0x7F;\n t = reinterpret(n & ~(0x007FFFFF >> k));\n n = ((n & 0x007FFFFF) | 0x00800000) >> (23 - k);\n if (j < 0) n = -n;\n p_h -= t;\n }\n t = p_l + p_h;\n is = reinterpret(t);\n t = reinterpret(is & 0xFFFF8000);\n u = t * lg2_h;\n v = (p_l - (t - p_h)) * lg2 + t * lg2_l;\n z = u + v;\n w = v - (z - u);\n t = z * z;\n t1 = z - t * (P1 + t * (P2 + t * (P3 + t * (P4 + t * P5))));\n r = (z * t1) / (t1 - 2.0) - (w + z * w);\n z = 1.0 - (r - z);\n j = reinterpret(z);\n j += n << 23;\n if ((j >> 23) <= 0) z = scalbn(z, n);\n else z = reinterpret(j);\n return sn * z;\n }\n\n // @ts-ignore: decorator\n @inline\n export function seedRandom(value: i64): void {\n NativeMath.seedRandom(value);\n }\n\n // Using xoroshiro64starstar from http://xoshiro.di.unimi.it/xoroshiro64starstar.c\n export function random(): f32 {\n if (!random_seeded) throw new Error("PRNG must be seeded.");\n\n var s0 = random_state0_32;\n var s1 = random_state1_32;\n var r = rotl(s0 * 0x9E3779BB, 5) * 5;\n\n s1 ^= s0;\n random_state0_32 = rotl(s0, 26) ^ s1 ^ (s1 << 9);\n random_state1_32 = rotl(s1, 13);\n\n return reinterpret((r >> 9) | (127 << 23)) - 1.0;\n }\n\n // @ts-ignore: decorator\n @inline\n export function round(x: f32): f32 {\n return builtin_copysign(builtin_floor(x + 0.5), x);\n }\n\n // @ts-ignore: decorator\n @inline\n export function sign(x: f32): f32 {\n if (ASC_SHRINK_LEVEL > 0) {\n return builtin_abs(x) > 0 ? builtin_copysign(1, x) : x;\n } else {\n return x > 0 ? 1 : x < 0 ? -1 : x;\n }\n }\n\n // @ts-ignore: decorator\n @inline\n export function signbit(x: f32): bool {\n // @ts-ignore: type\n return ((reinterpret(x) >>> 31) & (x == x));\n }\n\n export function sin(x: f32): f32 { // see: musl/src/math/sinf.c\n const s1pio2 = reinterpret(0x3FF921FB54442D18); // M_PI_2 * 1\n const s2pio2 = reinterpret(0x400921FB54442D18); // M_PI_2 * 2\n const s3pio2 = reinterpret(0x4012D97C7F3321D2); // M_PI_2 * 3\n const s4pio2 = reinterpret(0x401921FB54442D18); // M_PI_2 * 4\n\n var ix = reinterpret(x);\n var sign = ix >> 31;\n ix &= 0x7FFFFFFF;\n\n if (ix <= 0x3f490fda) { /* |x| ~<= π/4 */\n if (ix < 0x39800000) { /* |x| < 2**-12 */\n return x;\n }\n return sin_kernf(x);\n }\n\n if (ASC_SHRINK_LEVEL < 1) {\n if (ix <= 0x407b53d1) { /* |x| ~<= 5π/4 */\n if (ix <= 0x4016cbe3) { /* |x| ~<= 3π/4 */\n return sign ? -cos_kernf(x + s1pio2) : cos_kernf(x - s1pio2);\n }\n return sin_kernf(-(sign ? x + s2pio2 : x - s2pio2));\n }\n\n if (ix <= 0x40e231d5) { /* |x| ~<= 9π/4 */\n if (ix <= 0x40afeddf) { /* |x| ~<= 7π/4 */\n return sign ? cos_kernf(x + s3pio2) : -cos_kernf(x - s3pio2);\n }\n return sin_kernf(sign ? x + s4pio2 : x - s4pio2);\n }\n }\n\n /* sin(Inf or NaN) is NaN */\n if (ix >= 0x7f800000) return x - x;\n\n var n = rempio2f(x, ix, sign);\n var y = rempio2f_y;\n\n var t = n & 1 ? cos_kernf(y) : sin_kernf(y);\n return n & 2 ? -t : t;\n }\n\n export function sinh(x: f32): f32 { // see: musl/src/math/sinhf.c\n var u = reinterpret(x) & 0x7FFFFFFF;\n var absx = reinterpret(u);\n var t: f32;\n var h = builtin_copysign(0.5, x);\n if (u < 0x42B17217) {\n t = expm1(absx);\n if (u < 0x3F800000) {\n if (u < 0x3F800000 - (12 << 23)) return x;\n return h * (2 * t - t * t / (t + 1));\n }\n return h * (t + t / (t + 1));\n }\n t = 2 * h * expo2f(absx);\n return t;\n }\n\n // @ts-ignore: decorator\n @inline\n export function sqrt(x: f32): f32 {\n return builtin_sqrt(x);\n }\n\n export function tan(x: f32): f32 { // see: musl/src/math/tanf.c\n const t1pio2 = reinterpret(0x3FF921FB54442D18); // 1 * M_PI_2\n const t2pio2 = reinterpret(0x400921FB54442D18); // 2 * M_PI_2\n const t3pio2 = reinterpret(0x4012D97C7F3321D2); // 3 * M_PI_2\n const t4pio2 = reinterpret(0x401921FB54442D18); // 4 * M_PI_2\n\n var ix = reinterpret(x);\n var sign = ix >> 31;\n ix &= 0x7FFFFFFF;\n\n if (ix <= 0x3f490fda) { /* |x| ~<= π/4 */\n if (ix < 0x39800000) { /* |x| < 2**-12 */\n return x;\n }\n return tan_kernf(x, 0);\n }\n\n if (ASC_SHRINK_LEVEL < 1) {\n if (ix <= 0x407b53d1) { /* |x| ~<= 5π/4 */\n if (ix <= 0x4016cbe3) { /* |x| ~<= 3π/4 */\n return tan_kernf((sign ? x + t1pio2 : x - t1pio2), 1);\n } else {\n return tan_kernf((sign ? x + t2pio2 : x - t2pio2), 0);\n }\n }\n if (ix <= 0x40e231d5) { /* |x| ~<= 9π/4 */\n if (ix <= 0x40afeddf) { /* |x| ~<= 7π/4 */\n return tan_kernf((sign ? x + t3pio2 : x - t3pio2), 1);\n } else {\n return tan_kernf((sign ? x + t4pio2 : x - t4pio2), 0);\n }\n }\n }\n\n /* tan(Inf or NaN) is NaN */\n if (ix >= 0x7f800000) return x - x;\n\n /* argument reduction */\n var n = rempio2f(x, ix, sign);\n var y = rempio2f_y;\n return tan_kernf(y, n & 1);\n }\n\n export function tanh(x: f32): f32 { // see: musl/src/math/tanhf.c\n var u = reinterpret(x);\n u &= 0x7FFFFFFF;\n var y = reinterpret(u);\n var t: f32;\n if (u > 0x3F0C9F54) {\n if (u > 0x41200000) t = 1 + 0 / y;\n else {\n t = expm1(2 * y);\n t = 1 - 2 / (t + 2);\n }\n } else if (u > 0x3E82C578) {\n t = expm1(2 * y);\n t = t / (t + 2);\n } else if (u >= 0x00800000) {\n t = expm1(-2 * y);\n t = -t / (t + 2);\n } else t = y;\n return builtin_copysign(t, x);\n }\n\n // @ts-ignore: decorator\n @inline\n export function trunc(x: f32): f32 {\n return builtin_trunc(x);\n }\n\n export function scalbn(x: f32, n: i32): f32 { // see: https://git.musl-libc.org/cgit/musl/tree/src/math/scalbnf.c\n const\n Ox1p24f = reinterpret(0x4B800000),\n Ox1p127f = reinterpret(0x7F000000),\n Ox1p_126f = reinterpret(0x00800000);\n var y = x;\n if (n > 127) {\n y *= Ox1p127f;\n n -= 127;\n if (n > 127) {\n y *= Ox1p127f;\n n = builtin_min(n - 127, 127);\n }\n } else if (n < -126) {\n y *= Ox1p_126f * Ox1p24f;\n n += 126 - 24;\n if (n < -126) {\n y *= Ox1p_126f * Ox1p24f;\n n = builtin_max(n + 126 - 24, -126);\n }\n }\n return y * reinterpret((0x7F + n) << 23);\n }\n\n export function mod(x: f32, y: f32): f32 { // see: musl/src/math/fmodf.c\n var ux = reinterpret(x);\n var uy = reinterpret(y);\n var ex = (ux >> 23 & 0xFF);\n var ey = (uy >> 23 & 0xFF);\n var sx = ux & 0x80000000;\n var uy1 = uy << 1;\n if (uy1 == 0 || ex == 0xFF || isNaN(y)) {\n let m = x * y;\n return m / m;\n }\n var ux1 = ux << 1;\n if (ux1 <= uy1) {\n if (ux1 == uy1) return 0 * x;\n return x;\n }\n if (!ex) {\n ex -= builtin_clz(ux << 9);\n ux <<= -ex + 1;\n } else {\n ux &= -1 >> 9;\n ux |= 1 << 23;\n }\n if (!ey) {\n ey -= builtin_clz(uy << 9);\n uy <<= -ey + 1;\n } else {\n uy &= -1 >> 9;\n uy |= 1 << 23;\n }\n while (ex > ey) {\n if (ux >= uy) {\n if (ux == uy) return 0 * x;\n ux -= uy;\n }\n ux <<= 1;\n --ex;\n }\n if (ux >= uy) {\n if (ux == uy) return 0 * x;\n ux -= uy;\n }\n // for (; !(ux >> 23); ux <<= 1) --ex;\n var shift = builtin_clz(ux << 8);\n ex -= shift;\n ux <<= shift;\n if (ex > 0) {\n ux -= 1 << 23;\n ux |= ex << 23;\n } else {\n ux >>= -ex + 1;\n }\n ux |= sx;\n return reinterpret(ux);\n }\n\n export function rem(x: f32, y: f32): f32 { // see: musl/src/math/remquof.c\n var ux = reinterpret(x);\n var uy = reinterpret(y);\n var ex = (ux >> 23 & 0xFF);\n var ey = (uy >> 23 & 0xFF);\n var sx = (ux >> 31);\n var uxi = ux;\n if (uy << 1 == 0 || ex == 0xFF || isNaN(y)) return (x * y) / (x * y);\n if (ux << 1 == 0) return x;\n if (!ex) {\n ex -= builtin_clz(uxi << 9);\n uxi <<= -ex + 1;\n } else {\n uxi &= -1 >> 9;\n uxi |= 1 << 23;\n }\n if (!ey) {\n ey -= builtin_clz(uy << 9);\n uy <<= -ey + 1;\n } else {\n uy &= -1 >> 9;\n uy |= 1 << 23;\n }\n var q = 0;\n do {\n if (ex < ey) {\n if (ex + 1 == ey) break; // goto end\n return x;\n }\n while (ex > ey) {\n if (uxi >= uy) {\n uxi -= uy;\n ++q;\n }\n uxi <<= 1;\n q <<= 1;\n --ex;\n }\n if (uxi >= uy) {\n uxi -= uy;\n ++q;\n }\n if (uxi == 0) ex = -30;\n else {\n let shift = builtin_clz(uxi << 8);\n ex -= shift;\n uxi <<= shift;\n }\n break;\n } while (false);\n // end\n if (ex > 0) {\n uxi -= 1 << 23;\n uxi |= ex << 23;\n } else {\n uxi >>= -ex + 1;\n }\n x = reinterpret(uxi);\n y = builtin_abs(y);\n var x2 = x + x;\n if (ex == ey || (ex + 1 == ey && (x2 > y || (x2 == y && (q & 1))))) {\n x -= y;\n // q++;\n }\n return sx ? -x : x;\n }\n\n export function sincos(x: f32): void { // see: musl/tree/src/math/sincosf.c\n const s1pio2 = reinterpret(0x3FF921FB54442D18); // 1 * M_PI_2\n const s2pio2 = reinterpret(0x400921FB54442D18); // 2 * M_PI_2\n const s3pio2 = reinterpret(0x4012D97C7F3321D2); // 3 * M_PI_2\n const s4pio2 = reinterpret(0x401921FB54442D18); // 4 * M_PI_2\n\n var ix = reinterpret(x);\n var sign = ix >> 31;\n ix &= 0x7fffffff;\n\n if (ix <= 0x3f490fda) { /* |x| ~<= π/4 */\n if (ix < 0x39800000) { /* |x| < 2**-12 */\n sincos_sin = x;\n sincos_cos = 1;\n return;\n }\n sincos_sin = sin_kernf(x);\n sincos_cos = cos_kernf(x);\n return;\n }\n\n if (ASC_SHRINK_LEVEL < 1) {\n if (ix <= 0x407b53d1) { /* |x| ~<= 5π/4 */\n if (ix <= 0x4016cbe3) { /* |x| ~<= 3π/4 */\n if (sign) {\n sincos_sin = -cos_kernf(x + s1pio2);\n sincos_cos = sin_kernf(x + s1pio2);\n } else {\n sincos_sin = cos_kernf(s1pio2 - x);\n sincos_cos = sin_kernf(s1pio2 - x);\n }\n return;\n }\n /* -sin(x + c) is not correct if x+c could be 0: -0 vs +0 */\n sincos_sin = -sin_kernf(sign ? x + s2pio2 : x - s2pio2);\n sincos_cos = -cos_kernf(sign ? x + s2pio2 : x - s2pio2);\n return;\n }\n\n if (ix <= 0x40e231d5) { /* |x| ~<= 9π/4 */\n if (ix <= 0x40afeddf) { /* |x| ~<= 7π/4 */\n if (sign) {\n sincos_sin = cos_kernf(x + s3pio2);\n sincos_cos = -sin_kernf(x + s3pio2);\n } else {\n sincos_sin = -cos_kernf(x - s3pio2);\n sincos_cos = sin_kernf(x - s3pio2);\n }\n return;\n }\n sincos_sin = sin_kernf(sign ? x + s4pio2 : x - s4pio2);\n sincos_cos = cos_kernf(sign ? x + s4pio2 : x - s4pio2);\n return;\n }\n }\n\n /* sin(Inf or NaN) is NaN */\n if (ix >= 0x7f800000) {\n let xx = x - x;\n sincos_sin = xx;\n sincos_cos = xx;\n return;\n }\n\n /* general argument reduction needed */\n var n = rempio2f(x, ix, sign);\n var y = rempio2f_y;\n var s = sin_kernf(y);\n var c = cos_kernf(y);\n\n switch (n & 3) {\n case 0: {\n sincos_sin = s;\n sincos_cos = c;\n break;\n }\n case 1: {\n sincos_sin = c;\n sincos_cos = -s;\n break;\n }\n case 2: {\n sincos_sin = -s;\n sincos_cos = -c;\n break;\n }\n case 3:\n default: {\n sincos_sin = -c;\n sincos_cos = s;\n break;\n }\n }\n }\n}\n\nexport function ipow32(x: i32, e: i32): i32 {\n var out = 1;\n if (ASC_SHRINK_LEVEL < 1) {\n if (e < 0) return 0;\n\n switch (e) {\n case 0: return 1;\n case 1: return x;\n case 2: return x * x;\n }\n\n let log = 32 - clz(e);\n if (log <= 5) {\n // 32 = 2 ^ 5, so need only five cases.\n // But some extra cases needs for properly overflowing\n switch (log) {\n case 5: {\n if (e & 1) out *= x;\n e >>= 1;\n x *= x;\n }\n case 4: {\n if (e & 1) out *= x;\n e >>= 1;\n x *= x;\n }\n case 3: {\n if (e & 1) out *= x;\n e >>= 1;\n x *= x;\n }\n case 2: {\n if (e & 1) out *= x;\n e >>= 1;\n x *= x;\n }\n case 1: {\n if (e & 1) out *= x;\n }\n }\n return out;\n }\n }\n\n while (e > 0) {\n if (e & 1) out *= x;\n e >>= 1;\n x *= x;\n }\n return out;\n}\n\nexport function ipow64(x: i64, e: i32): i64 {\n var out: i64 = 1;\n if (ASC_SHRINK_LEVEL < 1) {\n if (e < 0) return 0;\n switch (e) {\n case 0: return 1;\n case 1: return x;\n case 2: return x * x;\n }\n\n let log = 32 - clz(e);\n if (log <= 6) {\n // 64 = 2 ^ 6, so need only six cases.\n // But some extra cases needs for properly overflowing\n switch (log) {\n case 6: {\n if (e & 1) out *= x;\n e >>= 1;\n x *= x;\n }\n case 5: {\n if (e & 1) out *= x;\n e >>= 1;\n x *= x;\n }\n case 4: {\n if (e & 1) out *= x;\n e >>= 1;\n x *= x;\n }\n case 3: {\n if (e & 1) out *= x;\n e >>= 1;\n x *= x;\n }\n case 2: {\n if (e & 1) out *= x;\n e >>= 1;\n x *= x;\n }\n case 1: {\n if (e & 1) out *= x;\n }\n }\n return out;\n }\n }\n\n while (e > 0) {\n if (e & 1) out *= x;\n e >>= 1;\n x *= x;\n }\n return out;\n}\n\nexport function ipow32f(x: f32, e: i32): f32 {\n var sign = e >> 31;\n e = (e + sign) ^ sign; // abs(e)\n var out: f32 = 1;\n while (e) {\n out *= select(x, 1.0, e & 1);\n e >>= 1;\n x *= x;\n }\n return sign ? 1.0 / out : out;\n}\n\nexport function ipow64f(x: f64, e: i32): f64 {\n var sign = e >> 31;\n e = (e + sign) ^ sign; // abs(e)\n var out = 1.0;\n while (e) {\n out *= select(x, 1.0, e & 1);\n e >>= 1;\n x *= x;\n }\n return sign ? 1.0 / out : out;\n}\n',memory:'import { memcmp, memmove, memset } from "./util/memory";\nimport { E_NOTIMPLEMENTED } from "./util/error";\n\n/** Memory manager interface. */\nexport namespace memory {\n\n /** Gets the size of the memory in pages. */\n // @ts-ignore: decorator\n @builtin\n export declare function size(): i32;\n\n /** Grows the memory by the given size in pages and returns the previous size in pages. */\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function grow(pages: i32): i32;\n\n /** Fills a section in memory with the specified byte value. */\n // @ts-ignore: decorator\n @unsafe @builtin\n export function fill(dst: usize, c: u8, n: usize): void {\n memset(dst, c, n); // fallback if "bulk-memory" isn\'t enabled\n }\n\n /** Copies a section of memory to another. Has move semantics. */\n // @ts-ignore: decorator\n @unsafe @builtin\n export function copy(dst: usize, src: usize, n: usize): void {\n memmove(dst, src, n); // fallback if "bulk-memory" isn\'t enabled\n }\n\n /** Initializes a memory segment. */\n // @ts-ignore: decorator\n @unsafe\n export function init(segmentIndex: u32, srcOffset: usize, dstOffset: usize, n: usize): void {\n throw new Error(E_NOTIMPLEMENTED);\n }\n\n /** Drops a memory segment. */\n // @ts-ignore: decorator\n @unsafe\n export function drop(segmentIndex: u32): void {\n throw new Error(E_NOTIMPLEMENTED);\n }\n\n /** Repeats a section of memory at a specific address. */\n // @ts-ignore: decorator\n @unsafe\n export function repeat(dst: usize, src: usize, srcLength: usize, count: usize): void {\n var index: usize = 0;\n var total = srcLength * count;\n while (index < total) {\n memory.copy(dst + index, src, srcLength);\n index += srcLength;\n }\n }\n\n /** Compares a section of memory to another. */\n // @ts-ignore: decorator\n @inline\n export function compare(vl: usize, vr: usize, n: usize): i32 {\n return memcmp(vl, vr, n);\n }\n}\n',number:'import { itoa, dtoa } from "./util/number";\nimport { isNaN as builtin_isNaN, isFinite as builtin_isFinite } from "./builtins";\n\n@sealed @unmanaged\nexport abstract class I8 {\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: i8 = i8.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: i8 = i8.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): i8 {\n return parseI32(value, radix);\n }\n\n toString(this: i8): String {\n // TODO: radix\n return itoa(this);\n }\n}\n\n@sealed @unmanaged\nexport abstract class I16 {\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: i16 = i16.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: i16 = i16.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): i16 {\n return parseI32(value, radix);\n }\n\n toString(this: i16): String {\n // TODO: radix\n return itoa(this);\n }\n}\n\n@sealed @unmanaged\nexport abstract class I32 {\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: i32 = i32.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: i32 = i32.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): i32 {\n return parseI32(value, radix);\n }\n\n toString(this: i32): String {\n // TODO: radix\n return itoa(this);\n }\n}\n\n@sealed @unmanaged\nexport abstract class I64 {\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: i64 = i64.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: i64 = i64.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): i64 {\n return parseI64(value, radix);\n }\n\n toString(this: i64): String {\n // TODO: radix\n return itoa(this);\n }\n}\n\n@sealed @unmanaged\nexport abstract class Isize {\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: isize = isize.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: isize = isize.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): isize {\n return parseI64(value, radix);\n }\n\n toString(this: isize): String {\n // TODO: radix\n return itoa(this);\n }\n}\n\n@sealed @unmanaged\nexport abstract class U8 {\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: u8 = u8.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: u8 = u8.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): u8 {\n return parseI32(value, radix);\n }\n\n toString(this: u8): String {\n // TODO: radix\n return itoa(this);\n }\n}\n\n@sealed @unmanaged\nexport abstract class U16 {\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: u16 = u16.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: u16 = u16.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): u16 {\n return parseI32(value, radix);\n }\n\n toString(this: u16): String {\n // TODO: radix\n return itoa(this);\n }\n}\n\n@sealed @unmanaged\nexport abstract class U32 {\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: u32 = u32.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: u32 = u32.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): u32 {\n return parseI32(value, radix);\n }\n\n toString(this: u32): String {\n // TODO: radix\n return itoa(this);\n }\n}\n\n@sealed @unmanaged\nexport abstract class U64 {\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: u64 = u64.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: u64 = u64.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): u64 {\n return parseI64(value, radix);\n }\n\n toString(this: u64): String {\n // TODO: radix\n return itoa(this);\n }\n}\n\n@sealed @unmanaged\nexport abstract class Usize {\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: usize = usize.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: usize = usize.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): usize {\n return parseI64(value, radix);\n }\n\n toString(this: usize): String {\n // TODO: radix\n return itoa(this);\n }\n}\n\n@sealed @unmanaged\nexport abstract class Bool {\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: bool = bool.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: bool = bool.MAX_VALUE;\n\n toString(this: bool): String {\n // TODO: radix?\n return this ? "true" : "false";\n }\n}\n\nexport { Bool as Boolean };\n\n@sealed @unmanaged\nexport abstract class F32 {\n\n // @ts-ignore: decorator\n @lazy\n static readonly EPSILON: f32 = f32.EPSILON;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: f32 = f32.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: f32 = f32.MAX_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_SAFE_INTEGER: f32 = f32.MIN_SAFE_INTEGER;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_SAFE_INTEGER: f32 = f32.MAX_SAFE_INTEGER;\n\n // @ts-ignore: decorator\n @lazy\n static readonly POSITIVE_INFINITY: f32 = Infinity;\n\n // @ts-ignore: decorator\n @lazy\n static readonly NEGATIVE_INFINITY: f32 = -Infinity;\n\n // @ts-ignore: decorator\n @lazy\n static readonly NaN: f32 = NaN;\n\n static isNaN(value: f32): bool {\n return isNaN(value);\n }\n\n static isFinite(value: f32): bool {\n return isFinite(value);\n }\n\n static isSafeInteger(value: f32): bool {\n return abs(value) <= f32.MAX_SAFE_INTEGER && trunc(value) == value;\n }\n\n static isInteger(value: f32): bool {\n return isFinite(value) && trunc(value) == value;\n }\n\n static parseInt(value: string, radix: i32 = 0): f32 {\n return parseI64(value, radix);\n }\n\n static parseFloat(value: string): f32 {\n return parseFloat(value);\n }\n\n toString(this: f32): String {\n // TODO: radix\n return dtoa(this);\n }\n}\n\n@sealed @unmanaged\nexport abstract class F64 {\n\n // @ts-ignore: decorator\n @lazy\n static readonly EPSILON: f64 = f64.EPSILON;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: f64 = f64.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: f64 = f64.MAX_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_SAFE_INTEGER: f64 = f64.MIN_SAFE_INTEGER;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_SAFE_INTEGER: f64 = f64.MAX_SAFE_INTEGER;\n\n // @ts-ignore: decorator\n @lazy\n static readonly POSITIVE_INFINITY: f64 = Infinity;\n\n // @ts-ignore: decorator\n @lazy\n static readonly NEGATIVE_INFINITY: f64 = -Infinity;\n\n // @ts-ignore: decorator\n @lazy\n static readonly NaN: f64 = NaN;\n\n static isNaN(value: f64): bool {\n return builtin_isNaN(value);\n }\n\n static isFinite(value: f64): bool {\n return builtin_isFinite(value);\n }\n\n static isSafeInteger(value: f64): bool {\n return abs(value) <= f64.MAX_SAFE_INTEGER && trunc(value) == value;\n }\n\n static isInteger(value: f64): bool {\n return builtin_isFinite(value) && trunc(value) == value;\n }\n\n static parseInt(value: string, radix: i32 = 0): f64 {\n return parseI64(value, radix);\n }\n\n static parseFloat(value: string): f64 {\n return parseFloat(value);\n }\n\n toString(this: f64): String {\n // TODO: radix\n return dtoa(this);\n }\n}\n\nexport { F64 as Number };\n',polyfills:"export function bswap(value: T): T {\n if (isInteger()) {\n if (sizeof() == 2) {\n return ((value << 8) | ((value >> 8) & 0x00FF));\n }\n if (sizeof() == 4) {\n return (\n rotl(value & 0xFF00FF00, 8) |\n rotr(value & 0x00FF00FF, 8)\n );\n }\n if (sizeof() == 8) {\n let a = (value >> 8) & 0x00FF00FF00FF00FF;\n let b = (value & 0x00FF00FF00FF00FF) << 8;\n let v = a | b;\n\n a = (v >> 16) & 0x0000FFFF0000FFFF;\n b = (v & 0x0000FFFF0000FFFF) << 16;\n\n return rotr(a | b, 32);\n }\n return value;\n }\n assert(false);\n return value;\n}\n\nexport function bswap16(value: T): T {\n if (isInteger() && sizeof() <= 4) {\n if (sizeof() == 2) {\n return ((value << 8) | ((value >> 8) & 0x00FF));\n } else if (sizeof() == 4) {\n return (((value << 8) & 0xFF00) | ((value >> 8) & 0x00FF) | (value & 0xFFFF0000));\n }\n return value;\n }\n assert(false);\n return value;\n}\n",regexp:'export class RegExp {\n\n // @binding(CALL_NEW, [ STRING, STRING], OBJECT_HANDLE)\n constructor(pattern: string, flags: string = "") { throw new Error("unreachable"); }\n\n // @binding(CALL_THIS, [ STRING ], PASS_THRU)\n test(search: string): bool { throw new Error("unreachable"); }\n\n // @binding(CALL_THIS, [], STRING)\n toString(): string { throw new Error("unreachable"); }\n\n}\n',rt:'import { Typeinfo, TypeinfoFlags } from "./shared/typeinfo";\nimport { E_INDEXOUTOFRANGE } from "./util/error";\nimport { BLOCK, BLOCK_OVERHEAD } from "./rt/common";\nimport { ArrayBufferView } from "./arraybuffer";\n\n// @ts-ignore: decorator\n@builtin\nexport declare const __rtti_base: usize;\n\n// @ts-ignore: decorator\n@builtin @unsafe\nexport declare function __visit_globals(cookie: u32): void;\n\n// @ts-ignore: decorator\n@builtin @unsafe\nexport declare function __visit_members(ref: usize, cookie: u32): void;\n\n// @ts-ignore: decorator\n@unsafe\nexport function __typeinfo(id: u32): TypeinfoFlags {\n var ptr = __rtti_base;\n if (id > load(ptr)) throw new Error(E_INDEXOUTOFRANGE);\n return changetype(ptr + sizeof() + id * offsetof()).flags;\n}\n\n// @ts-ignore: decorator\n@unsafe\nexport function __instanceof(ref: usize, superId: u32): bool { // keyword\n var id = changetype(ref - BLOCK_OVERHEAD).rtId;\n var ptr = __rtti_base;\n if (id <= load(ptr)) {\n do if (id == superId) return true;\n while (id = changetype(ptr + sizeof() + id * offsetof()).base);\n }\n return false;\n}\n\n// @ts-ignore: decorator\n@unsafe\nexport function __allocArray(length: i32, alignLog2: usize, id: u32, data: usize = 0): usize {\n var array = __alloc(offsetof(), id);\n var bufferSize = length << alignLog2;\n var buffer = __alloc(bufferSize, idof());\n store(array, __retain(buffer), offsetof("data"));\n changetype(array).dataStart = buffer;\n changetype(array).dataLength = bufferSize;\n store(changetype(array), length, offsetof("length_"));\n if (data) memory.copy(buffer, data, bufferSize);\n return array;\n}\n\n// These are provided by the respective implementation, included as another entry file by asc:\n\n// @builtin @unsafe\n// export declare function __alloc(size: usize, id: u32): usize;\n\n// // @ts-ignore: decorator\n// @builtin @unsafe\n// export declare function __realloc(ref: usize, size: usize): usize;\n\n// // @ts-ignore: decorator\n// @builtin @unsafe\n// export declare function __free(ref: usize): void;\n\n// // @ts-ignore: decorator\n// @builtin @unsafe\n// export declare function __retain(ref: usize): usize;\n\n// // @ts-ignore: decorator\n// @builtin @unsafe\n// export declare function __release(ref: usize): void;\n\n// // @ts-ignore: decorator\n// @builtin @unsafe\n// export declare function __collect(): void;\n\n// // @ts-ignore: decorator\n// @builtin @unsafe\n// export declare function __visit(ref: usize, cookie: u32): void;\n',"rt/common":"// Alignment guarantees\n\n// @ts-ignore: decorator\n@inline export const AL_BITS: u32 = 4; // 16 bytes to fit up to v128\n// @ts-ignore: decorator\n@inline export const AL_SIZE: usize = 1 << AL_BITS;\n// @ts-ignore: decorator\n@inline export const AL_MASK: usize = AL_SIZE - 1;\n\n// Extra debugging\n\n// @ts-ignore: decorator\n@inline export const DEBUG = true;\n\n// ╒════════════════ Common block layout (32-bit) ═════════════════╕\n// 3 2 1\n// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits\n// ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┤\n// │ MM info │ -16\n// ├───────────────────────────────────────────────────────────────┤\n// │ GC info │ -12\n// ├───────────────────────────────────────────────────────────────┤\n// │ runtime id │ -8\n// ├───────────────────────────────────────────────────────────────┤\n// │ runtime size │ -4\n// ╞═══════════════════════════════════════════════════════════════╡\n// │ ... │ ref\n@unmanaged export class BLOCK {\n /** Memory manager info. */\n mmInfo: usize; // WASM64 needs adaption\n /** Garbage collector info. */\n gcInfo: u32;\n /** Runtime class id. */\n rtId: u32;\n /** Runtime object size. */\n rtSize: u32;\n}\n\n// @ts-ignore: decorator\n@inline export const BLOCK_OVERHEAD = (offsetof() + AL_MASK) & ~AL_MASK;\n\n// @ts-ignore: decorator\n@inline export const BLOCK_MAXSIZE: usize = (1 << 30) - BLOCK_OVERHEAD;\n","rt/index-full":'export { __alloc } from "rt/tlsf";\nexport { __retain, __release, __collect } from "rt/pure";\nexport { __rtti_base } from "rt";\n',"rt/index-half":'import "rt/index-full";\n',"rt/index-none":'import "rt/index-stub";\n',"rt/index-stub":'export { __alloc, __retain, __release, __collect } from "rt/stub";\nexport { __rtti_base } from "rt";\n',"rt/pure":'import { DEBUG, BLOCK_OVERHEAD } from "rt/common";\nimport { Block, freeBlock, ROOT } from "rt/tlsf";\nimport { TypeinfoFlags } from "shared/typeinfo";\nimport { onincrement, ondecrement, onfree, onalloc } from "./rtrace";\n\n/////////////////////////// A Pure Reference Counting Garbage Collector ///////////////////////////\n// see: https://researcher.watson.ibm.com/researcher/files/us-bacon/Bacon03Pure.pdf\n\n// ╒══════════════════════ GC Info structure ══════════════════════╕\n// │ 3 2 1 │\n// │1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0│\n// ├─┼─┴─┴─┼─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┤\n// │B│color│ refCount │\n// └─┴─────┴───────────────────────────────────────────────────────┘\n// B: buffered\n\n// @ts-ignore: decorator\n@inline const BUFFERED_MASK: u32 = 1 << (sizeof() * 8 - 1);\n// @ts-ignore: decorator\n@inline const COLOR_BITS = 3;\n// @ts-ignore: decorator\n@inline const COLOR_SHIFT: u32 = ctz(BUFFERED_MASK) - COLOR_BITS;\n// @ts-ignore: decorator\n@inline const COLOR_MASK: u32 = ((1 << COLOR_BITS) - 1) << COLOR_SHIFT;\n// @ts-ignore: decorator\n@inline const REFCOUNT_MASK: u32 = (1 << COLOR_SHIFT) - 1;\n\n// ╒════════╤═══════════════════ Colors ═══════════════════════════╕\n// │ Color │ Meaning │\n// ├────────┼──────────────────────────────────────────────────────┤\n// │ BLACK │ In use or free │\n// │ GRAY │ Possible member of cycle │\n// │ WHITE │ Member of garbage cycle │\n// │ PURPLE │ Possible root of cycle │\n// │ RED │ Candidate cycle undergoing Σ-computation *concurrent │\n// │ ORANGE │ Candidate cycle awaiting epoch boundary *concurrent │\n// └────────┴──────────────────────────────────────────────────────┘\n// Acyclic detection has been decoupled, hence no GREEN.\n\n// @ts-ignore: decorator\n@inline const COLOR_BLACK: u32 = 0 << COLOR_SHIFT;\n// @ts-ignore: decorator\n@inline const COLOR_GRAY: u32 = 1 << COLOR_SHIFT;\n// @ts-ignore: decorator\n@inline const COLOR_WHITE: u32 = 2 << COLOR_SHIFT;\n// @ts-ignore: decorator\n@inline const COLOR_PURPLE: u32 = 3 << COLOR_SHIFT;\n// @ts-ignore: decorator\n@inline const COLOR_RED: u32 = 4 << COLOR_SHIFT;\n// @ts-ignore: decorator\n@inline const COLOR_ORANGE: u32 = 5 << COLOR_SHIFT;\n\n// @ts-ignore: decorator\n@inline const VISIT_DECREMENT = 1; // guard 0\n// @ts-ignore: decorator\n@inline const VISIT_MARKGRAY = 2;\n// @ts-ignore: decorator\n@inline const VISIT_SCAN = 3;\n// @ts-ignore: decorator\n@inline const VISIT_SCANBLACK = 4;\n// @ts-ignore: decorator\n@inline const VISIT_COLLECTWHITE = 5;\n\n// @ts-ignore: decorator\n@global @unsafe\nfunction __visit(ref: usize, cookie: i32): void {\n if (ref < __heap_base) return;\n var s = changetype(ref - BLOCK_OVERHEAD);\n switch (cookie) {\n case VISIT_DECREMENT: {\n decrement(s);\n break;\n }\n case VISIT_MARKGRAY: {\n if (DEBUG) assert((s.gcInfo & REFCOUNT_MASK) > 0);\n s.gcInfo = s.gcInfo - 1;\n markGray(s);\n break;\n }\n case VISIT_SCAN: {\n scan(s);\n break;\n }\n case VISIT_SCANBLACK: {\n let info = s.gcInfo;\n assert((info & ~REFCOUNT_MASK) == ((info + 1) & ~REFCOUNT_MASK)); // overflow\n s.gcInfo = info + 1;\n if ((info & COLOR_MASK) != COLOR_BLACK) {\n scanBlack(s);\n }\n break;\n }\n case VISIT_COLLECTWHITE: {\n collectWhite(s);\n break;\n }\n default: if (DEBUG) assert(false);\n }\n}\n\n/** Increments the reference count of the specified block by one.*/\nfunction increment(s: Block): void {\n var info = s.gcInfo;\n assert((info & ~REFCOUNT_MASK) == ((info + 1) & ~REFCOUNT_MASK)); // overflow\n s.gcInfo = info + 1;\n if (isDefined(ASC_RTRACE)) onincrement(s);\n if (DEBUG) assert(!(s.mmInfo & 1)); // used\n}\n\n/** Decrements the reference count of the specified block by one, possibly freeing it. */\nfunction decrement(s: Block): void {\n var info = s.gcInfo;\n var rc = info & REFCOUNT_MASK;\n if (isDefined(ASC_RTRACE)) ondecrement(s);\n if (DEBUG) assert(!(s.mmInfo & 1)); // used\n if (rc == 1) {\n __visit_members(changetype(s) + BLOCK_OVERHEAD, VISIT_DECREMENT);\n if (!(info & BUFFERED_MASK)) {\n freeBlock(ROOT, s);\n } else {\n s.gcInfo = BUFFERED_MASK | COLOR_BLACK | 0;\n }\n } else {\n if (DEBUG) assert(rc > 0);\n if (!(__typeinfo(s.rtId) & TypeinfoFlags.ACYCLIC)) {\n s.gcInfo = BUFFERED_MASK | COLOR_PURPLE | (rc - 1);\n if (!(info & BUFFERED_MASK)) {\n appendRoot(s);\n }\n } else {\n s.gcInfo = (info & ~REFCOUNT_MASK) | (rc - 1);\n }\n }\n}\n\n/** Buffer of possible roots. */\n// @ts-ignore: decorator\n@lazy var ROOTS: usize;\n/** Current absolute offset into the `ROOTS` buffer. */\n// @ts-ignore: decorator\n@lazy var CUR: usize = 0;\n/** Current absolute end offset into the `ROOTS` buffer. */\n// @ts-ignore: decorator\n@lazy var END: usize = 0;\n\n/** Appends a block to possible roots. */\nfunction appendRoot(s: Block): void {\n var cur = CUR;\n if (cur >= END) {\n growRoots(); // TBD: either that or pick a default and force collection on overflow\n cur = CUR;\n }\n store(cur, s);\n CUR = cur + sizeof();\n}\n\n/** Grows the roots buffer if it ran full. */\nfunction growRoots(): void {\n var oldRoots = ROOTS;\n var oldSize = CUR - oldRoots;\n var newSize = max(oldSize * 2, 64 << alignof());\n var newRoots = __alloc(newSize, 0);\n if (isDefined(ASC_RTRACE)) onfree(changetype(newRoots - BLOCK_OVERHEAD)); // neglect unmanaged\n memory.copy(newRoots, oldRoots, oldSize);\n if (oldRoots) {\n if (isDefined(ASC_RTRACE)) onalloc(changetype(oldRoots - BLOCK_OVERHEAD)); // neglect unmanaged\n __free(oldRoots);\n }\n ROOTS = newRoots;\n CUR = newRoots + oldSize;\n END = newRoots + newSize;\n}\n\n/** Collects cyclic garbage. */\n// @ts-ignore: decorator\n@global @unsafe\nexport function __collect(): void {\n\n // markRoots\n var roots = ROOTS;\n var cur = roots;\n for (let pos = cur, end = CUR; pos < end; pos += sizeof()) {\n let s = load(pos);\n let info = s.gcInfo;\n if ((info & COLOR_MASK) == COLOR_PURPLE && (info & REFCOUNT_MASK) > 0) {\n markGray(s);\n store(cur, s);\n cur += sizeof();\n } else {\n if ((info & COLOR_MASK) == COLOR_BLACK && !(info & REFCOUNT_MASK)) {\n freeBlock(ROOT, s);\n } else {\n s.gcInfo = info & ~BUFFERED_MASK;\n }\n }\n }\n CUR = cur;\n\n // scanRoots\n for (let pos = roots; pos < cur; pos += sizeof()) {\n scan(load(pos));\n }\n\n // collectRoots\n for (let pos = roots; pos < cur; pos += sizeof()) {\n let s = load(pos);\n s.gcInfo = s.gcInfo & ~BUFFERED_MASK;\n collectWhite(s);\n }\n CUR = roots;\n}\n\n/** Marks a block as gray (possible member of cycle) during the collection phase. */\nfunction markGray(s: Block): void {\n var info = s.gcInfo;\n if ((info & COLOR_MASK) != COLOR_GRAY) {\n s.gcInfo = (info & ~COLOR_MASK) | COLOR_GRAY;\n __visit_members(changetype(s) + BLOCK_OVERHEAD, VISIT_MARKGRAY);\n }\n}\n\n/** Scans a block during the collection phase, determining whether it is garbage or not. */\nfunction scan(s: Block): void {\n var info = s.gcInfo;\n if ((info & COLOR_MASK) == COLOR_GRAY) {\n if ((info & REFCOUNT_MASK) > 0) {\n scanBlack(s);\n } else {\n s.gcInfo = (info & ~COLOR_MASK) | COLOR_WHITE;\n __visit_members(changetype(s) + BLOCK_OVERHEAD, VISIT_SCAN);\n }\n }\n}\n\n/** Marks a block as black (in use) if it was found to be reachable during the collection phase. */\nfunction scanBlack(s: Block): void {\n s.gcInfo = (s.gcInfo & ~COLOR_MASK) | COLOR_BLACK;\n __visit_members(changetype(s) + BLOCK_OVERHEAD, VISIT_SCANBLACK);\n}\n\n/** Collects all white (member of a garbage cycle) nodes when completing the collection phase. */\nfunction collectWhite(s: Block): void {\n var info = s.gcInfo;\n if ((info & COLOR_MASK) == COLOR_WHITE && !(info & BUFFERED_MASK)) {\n s.gcInfo = (info & ~COLOR_MASK) | COLOR_BLACK;\n __visit_members(changetype(s) + BLOCK_OVERHEAD, VISIT_COLLECTWHITE);\n freeBlock(ROOT, s);\n }\n}\n\n// @ts-ignore: decorator\n@global @unsafe\nexport function __retain(ref: usize): usize {\n if (ref > __heap_base) increment(changetype(ref - BLOCK_OVERHEAD));\n return ref;\n}\n\n// @ts-ignore: decorator\n@global @unsafe\nexport function __release(ref: usize): void {\n if (ref > __heap_base) decrement(changetype(ref - BLOCK_OVERHEAD));\n}\n',"rt/rtrace":'import { BLOCK } from "./common";\n\nexport declare function onalloc(s: BLOCK): void;\nexport declare function onincrement(s: BLOCK): void;\nexport declare function ondecrement(s: BLOCK): void;\nexport declare function onfree(s: BLOCK): void;\n',"rt/stub":'import { AL_MASK, BLOCK, BLOCK_OVERHEAD, BLOCK_MAXSIZE } from "rt/common";\n\n// @ts-ignore: decorator\n@lazy\nvar startOffset: usize = (__heap_base + AL_MASK) & ~AL_MASK;\n\n// @ts-ignore: decorator\n@lazy\nvar offset: usize = startOffset;\n\n// @ts-ignore: decorator\n@unsafe @global\nexport function __alloc(size: usize, id: u32): usize {\n if (size > BLOCK_MAXSIZE) unreachable();\n var ptr = offset + BLOCK_OVERHEAD;\n var newPtr = (ptr + max(size, 1) + AL_MASK) & ~AL_MASK;\n var pagesBefore = memory.size();\n if (newPtr > pagesBefore << 16) {\n let pagesNeeded = ((newPtr - ptr + 0xffff) & ~0xffff) >>> 16;\n let pagesWanted = max(pagesBefore, pagesNeeded); // double memory\n if (memory.grow(pagesWanted) < 0) {\n if (memory.grow(pagesNeeded) < 0) unreachable(); // out of memory\n }\n }\n offset = newPtr;\n var block = changetype(ptr - BLOCK_OVERHEAD);\n block.rtId = id;\n block.rtSize = size;\n return ptr;\n}\n\n// @ts-ignore: decorator\n@unsafe @global\nexport function __realloc(ref: usize, size: usize): usize {\n var block = changetype(ref - BLOCK_OVERHEAD);\n var oldSize = block.rtSize;\n if (size > oldSize) {\n let newRef = __alloc(size, block.rtId);\n memory.copy(newRef, ref, oldSize);\n ref = newRef;\n } else {\n block.rtSize = size;\n }\n return ref;\n}\n\n// @ts-ignore: decorator\n@unsafe @global\nexport function __free(ref: usize): void {\n}\n\n// @ts-ignore: decorator\n@unsafe @global\nfunction __reset(): void { // special\n offset = startOffset;\n}\n\n// @ts-ignore: decorator\n@global @unsafe\nexport function __retain(ref: usize): usize {\n return ref;\n}\n\n// @ts-ignore: decorator\n@global @unsafe\nexport function __release(ref: usize): void {\n}\n\n// @ts-ignore: decorator\n@global @unsafe\nexport function __visit(ref: usize, cookie: u32): void {\n}\n\n// @ts-ignore: decorator\n@global @unsafe\nexport function __collect(): void {\n}\n',"rt/tlsf":"import { AL_BITS, AL_MASK, DEBUG, BLOCK, BLOCK_OVERHEAD, BLOCK_MAXSIZE } from \"rt/common\";\nimport { onfree, onalloc } from \"./rtrace\";\n\n/////////////////////// The TLSF (Two-Level Segregate Fit) memory allocator ///////////////////////\n// see: http://www.gii.upv.es/tlsf/\n\n// - `ffs(x)` is equivalent to `ctz(x)` with x != 0\n// - `fls(x)` is equivalent to `sizeof(x) * 8 - clz(x) - 1`\n\n// ╒══════════════ Block size interpretation (32-bit) ═════════════╕\n// 3 2 1\n// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits\n// ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┼─┴─┴─┴─╫─┴─┴─┴─┤\n// │ | FL │ SB = SL + AL │ ◄─ usize\n// └───────────────────────────────────────────────┴───────╨───────┘\n// FL: first level, SL: second level, AL: alignment, SB: small block\n\n// @ts-ignore: decorator\n@inline const SL_BITS: u32 = 4;\n// @ts-ignore: decorator\n@inline const SL_SIZE: usize = 1 << SL_BITS;\n\n// @ts-ignore: decorator\n@inline const SB_BITS: usize = (SL_BITS + AL_BITS);\n// @ts-ignore: decorator\n@inline const SB_SIZE: usize = 1 << SB_BITS;\n\n// @ts-ignore: decorator\n@inline const FL_BITS: u32 = 31 - SB_BITS;\n\n// [00]: < 256B (SB) [12]: < 1M\n// [01]: < 512B [13]: < 2M\n// [02]: < 1K [14]: < 4M\n// [03]: < 2K [15]: < 8M\n// [04]: < 4K [16]: < 16M\n// [05]: < 8K [17]: < 32M\n// [06]: < 16K [18]: < 64M\n// [07]: < 32K [19]: < 128M\n// [08]: < 64K [20]: < 256M\n// [09]: < 128K [21]: < 512M\n// [10]: < 256K [22]: <= 1G - OVERHEAD\n// [11]: < 512K\n// VMs limit to 2GB total (currently), making one 1G block max (or three 512M etc.) due to block overhead\n\n// Tags stored in otherwise unused alignment bits\n\n// @ts-ignore: decorator\n@inline const FREE: usize = 1 << 0;\n// @ts-ignore: decorator\n@inline const LEFTFREE: usize = 1 << 1;\n// @ts-ignore: decorator\n@inline const TAGS_MASK: usize = FREE | LEFTFREE; // <= AL_MASK\n\n// ╒════════════════════ Block layout (32-bit) ════════════════════╕\n// 3 2 1\n// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits\n// ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┼─┼─┼─┤ overhead ┐\n// │ size │0│L│F│ ◄─┐ info\n// ├─────────────────────────────────────────────────────────┴─┴─┴─┤ │\n// │ │ │\n// │ ... additional runtime overhead ... │ │\n// │ │ │\n// ╞═══════════════════════════════════════════════════════════════╡ │ ┐ ┘\n// │ if free: ◄ prev │ ◄─┤ usize\n// ├───────────────────────────────────────────────────────────────┤ │\n// │ if free: next ► │ ◄─┤\n// ├───────────────────────────────────────────────────────────────┤ │\n// │ ... │ │ = 0\n// ├───────────────────────────────────────────────────────────────┤ │\n// │ if free: back ▲ │ ◄─┘\n// └───────────────────────────────────────────────────────────────┘ payload ┘ >= MIN SIZE\n// F: FREE, L: LEFTFREE\n@unmanaged export class Block extends BLOCK {\n\n /** Previous free block, if any. Only valid if free, otherwise part of payload. */\n prev: Block | null;\n /** Next free block, if any. Only valid if free, otherwise part of payload. */\n next: Block | null;\n\n // If the block is free, there is a 'back'reference at its end pointing at its start.\n}\n\n// Block constants. A block must have a minimum size of three pointers so it can hold `prev`,\n// `next` and `back` if free.\n\n// @ts-ignore: decorator\n@inline const BLOCK_MINSIZE: usize = (3 * sizeof() + AL_MASK) & ~AL_MASK; // prev + next + back\n// @ts-ignore: decorator\n// @inline const BLOCK_MAXSIZE: usize = 1 << (FL_BITS + SB_BITS - 1); // exclusive, lives in common.ts\n\n/** Gets the left block of a block. Only valid if the left block is free. */\n// @ts-ignore: decorator\n@inline function GETFREELEFT(block: Block): Block {\n return load(changetype(block) - sizeof());\n}\n\n/** Gets the right block of of a block by advancing to the right by its size. */\n// @ts-ignore: decorator\n@inline function GETRIGHT(block: Block): Block {\n return changetype(changetype(block) + BLOCK_OVERHEAD + (block.mmInfo & ~TAGS_MASK));\n}\n\n// ╒═════════════════════ Root layout (32-bit) ════════════════════╕\n// 3 2 1\n// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits\n// ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┤ ┐\n// │ 0 | flMap S│ ◄────┐\n// ╞═══════════════════════════════════════════════════════════════╡ │\n// │ slMap[0] S │ ◄─┐ │\n// ├───────────────────────────────────────────────────────────────┤ │ │\n// │ slMap[1] │ ◄─┤ │\n// ├───────────────────────────────────────────────────────────────┤ u32 │\n// │ slMap[22] │ ◄─┘ │\n// ╞═══════════════════════════════════════════════════════════════╡ usize\n// │ head[0] │ ◄────┤\n// ├───────────────────────────────────────────────────────────────┤ │\n// │ ... │ ◄────┤\n// ├───────────────────────────────────────────────────────────────┤ │\n// │ head[367] │ ◄────┤\n// ╞═══════════════════════════════════════════════════════════════╡ │\n// │ tail │ ◄────┘\n// └───────────────────────────────────────────────────────────────┘ SIZE ┘\n// S: Small blocks map\n@unmanaged class Root {\n /** First level bitmap. */\n flMap: usize;\n}\n\n// Root constants. Where stuff is stored inside of the root structure.\n\n// @ts-ignore: decorator\n@inline const SL_START = sizeof();\n// @ts-ignore: decorator\n@inline const SL_END = SL_START + (FL_BITS << alignof());\n// @ts-ignore: decorator\n@inline const HL_START = (SL_END + AL_MASK) & ~AL_MASK;\n// @ts-ignore: decorator\n@inline const HL_END = HL_START + FL_BITS * SL_SIZE * sizeof();\n// @ts-ignore: decorator\n@inline const ROOT_SIZE = HL_END + sizeof();\n\n// @ts-ignore: decorator\n@lazy export var ROOT: Root;\n\n/** Gets the second level map of the specified first level. */\n// @ts-ignore: decorator\n@inline function GETSL(root: Root, fl: usize): u32 {\n return load(\n changetype(root) + (fl << alignof()),\n SL_START\n );\n}\n\n/** Sets the second level map of the specified first level. */\n// @ts-ignore: decorator\n@inline function SETSL(root: Root, fl: usize, slMap: u32): void {\n store(\n changetype(root) + (fl << alignof()),\n slMap,\n SL_START\n );\n}\n\n/** Gets the head of the free list for the specified combination of first and second level. */\n// @ts-ignore: decorator\n@inline function GETHEAD(root: Root, fl: usize, sl: u32): Block | null {\n return load(\n changetype(root) + (((fl << SL_BITS) + sl) << alignof()),\n HL_START\n );\n}\n\n/** Sets the head of the free list for the specified combination of first and second level. */\n// @ts-ignore: decorator\n@inline function SETHEAD(root: Root, fl: usize, sl: u32, head: Block | null): void {\n store(\n changetype(root) + (((fl << SL_BITS) + sl) << alignof()),\n head,\n HL_START\n );\n}\n\n/** Gets the tail block.. */\n// @ts-ignore: decorator\n@inline function GETTAIL(root: Root): Block {\n return load(\n changetype(root),\n HL_END\n );\n}\n\n/** Sets the tail block. */\n// @ts-ignore: decorator\n@inline function SETTAIL(root: Root, tail: Block): void {\n store(\n changetype(root),\n tail,\n HL_END\n );\n}\n\n/** Inserts a previously used block back into the free list. */\nfunction insertBlock(root: Root, block: Block): void {\n if (DEBUG) assert(block); // cannot be null\n var blockInfo = block.mmInfo;\n if (DEBUG) assert(blockInfo & FREE); // must be free\n\n var right = GETRIGHT(block);\n var rightInfo = right.mmInfo;\n\n // merge with right block if also free\n if (rightInfo & FREE) {\n let newSize = (blockInfo & ~TAGS_MASK) + BLOCK_OVERHEAD + (rightInfo & ~TAGS_MASK);\n if (newSize < BLOCK_MAXSIZE) {\n removeBlock(root, right);\n block.mmInfo = blockInfo = (blockInfo & TAGS_MASK) | newSize;\n right = GETRIGHT(block);\n rightInfo = right.mmInfo;\n // 'back' is set below\n }\n }\n\n // merge with left block if also free\n if (blockInfo & LEFTFREE) {\n let left = GETFREELEFT(block);\n let leftInfo = left.mmInfo;\n if (DEBUG) assert(leftInfo & FREE); // must be free according to right tags\n let newSize = (leftInfo & ~TAGS_MASK) + BLOCK_OVERHEAD + (blockInfo & ~TAGS_MASK);\n if (newSize < BLOCK_MAXSIZE) {\n removeBlock(root, left);\n left.mmInfo = blockInfo = (leftInfo & TAGS_MASK) | newSize;\n block = left;\n // 'back' is set below\n }\n }\n\n right.mmInfo = rightInfo | LEFTFREE;\n // right is no longer used now, hence rightInfo is not synced\n\n // we now know the size of the block\n var size = blockInfo & ~TAGS_MASK;\n if (DEBUG) assert(size >= BLOCK_MINSIZE && size < BLOCK_MAXSIZE); // must be a valid size\n if (DEBUG) assert(changetype(block) + BLOCK_OVERHEAD + size == changetype(right)); // must match\n\n // set 'back' to itself at the end of block\n store(changetype(right) - sizeof(), block);\n\n // mapping_insert\n var fl: usize, sl: u32;\n if (size < SB_SIZE) {\n fl = 0;\n sl = (size >> AL_BITS);\n } else {\n const inv: usize = sizeof() * 8 - 1;\n fl = inv - clz(size);\n sl = ((size >> (fl - SL_BITS)) ^ (1 << SL_BITS));\n fl -= SB_BITS - 1;\n }\n if (DEBUG) assert(fl < FL_BITS && sl < SL_SIZE); // fl/sl out of range\n\n // perform insertion\n var head = GETHEAD(root, fl, sl);\n block.prev = null;\n block.next = head;\n if (head) head.prev = block;\n SETHEAD(root, fl, sl, block);\n\n // update first and second level maps\n root.flMap |= (1 << fl);\n SETSL(root, fl, GETSL(root, fl) | (1 << sl));\n}\n\n/** Removes a free block from internal lists. */\nfunction removeBlock(root: Root, block: Block): void {\n var blockInfo = block.mmInfo;\n if (DEBUG) assert(blockInfo & FREE); // must be free\n var size = blockInfo & ~TAGS_MASK;\n if (DEBUG) assert(size >= BLOCK_MINSIZE && size < BLOCK_MAXSIZE); // must be valid\n\n // mapping_insert\n var fl: usize, sl: u32;\n if (size < SB_SIZE) {\n fl = 0;\n sl = (size >> AL_BITS);\n } else {\n const inv: usize = sizeof() * 8 - 1;\n fl = inv - clz(size);\n sl = ((size >> (fl - SL_BITS)) ^ (1 << SL_BITS));\n fl -= SB_BITS - 1;\n }\n if (DEBUG) assert(fl < FL_BITS && sl < SL_SIZE); // fl/sl out of range\n\n // link previous and next free block\n var prev = block.prev;\n var next = block.next;\n if (prev) prev.next = next;\n if (next) next.prev = prev;\n\n // update head if we are removing it\n if (block == GETHEAD(root, fl, sl)) {\n SETHEAD(root, fl, sl, next);\n\n // clear second level map if head is empty now\n if (!next) {\n let slMap = GETSL(root, fl);\n SETSL(root, fl, slMap &= ~(1 << sl));\n\n // clear first level map if second level is empty now\n if (!slMap) root.flMap &= ~(1 << fl);\n }\n }\n // note: does not alter left/back because it is likely that splitting\n // is performed afterwards, invalidating those changes. so, the caller\n // must perform those updates.\n}\n\n/** Searches for a free block of at least the specified size. */\nfunction searchBlock(root: Root, size: usize): Block | null {\n // size was already asserted by caller\n\n // mapping_search\n var fl: usize, sl: u32;\n if (size < SB_SIZE) {\n fl = 0;\n sl = (size >> AL_BITS);\n } else {\n const halfMaxSize = BLOCK_MAXSIZE >> 1; // don't round last fl\n const inv: usize = sizeof() * 8 - 1;\n const invRound = inv - SL_BITS;\n let requestSize = size < halfMaxSize\n ? size + (1 << (invRound - clz(size))) - 1\n : size;\n fl = inv - clz(requestSize);\n sl = ((requestSize >> (fl - SL_BITS)) ^ (1 << SL_BITS));\n fl -= SB_BITS - 1;\n }\n if (DEBUG) assert(fl < FL_BITS && sl < SL_SIZE); // fl/sl out of range\n\n // search second level\n var slMap = GETSL(root, fl) & (~0 << sl);\n var head: Block | null = null;\n if (!slMap) {\n // search next larger first level\n let flMap = root.flMap & (~0 << (fl + 1));\n if (!flMap) {\n head = null;\n } else {\n fl = ctz(flMap);\n slMap = GETSL(root, fl);\n if (DEBUG) assert(slMap); // can't be zero if fl points here\n head = GETHEAD(root, fl, ctz(slMap));\n }\n } else {\n head = GETHEAD(root, fl, ctz(slMap));\n }\n return head;\n}\n\n/** Prepares the specified block before (re-)use, possibly splitting it. */\nfunction prepareBlock(root: Root, block: Block, size: usize): void {\n // size was already asserted by caller\n\n var blockInfo = block.mmInfo;\n if (DEBUG) assert(!(size & AL_MASK)); // size must be aligned so the new block is\n\n // split if the block can hold another MINSIZE block incl. overhead\n var remaining = (blockInfo & ~TAGS_MASK) - size;\n if (remaining >= BLOCK_OVERHEAD + BLOCK_MINSIZE) {\n block.mmInfo = size | (blockInfo & LEFTFREE); // also discards FREE\n\n let spare = changetype(changetype(block) + BLOCK_OVERHEAD + size);\n spare.mmInfo = (remaining - BLOCK_OVERHEAD) | FREE; // not LEFTFREE\n insertBlock(root, spare); // also sets 'back'\n\n // otherwise tag block as no longer FREE and right as no longer LEFTFREE\n } else {\n block.mmInfo = blockInfo & ~FREE;\n GETRIGHT(block).mmInfo &= ~LEFTFREE;\n }\n}\n\n/** Adds more memory to the pool. */\nfunction addMemory(root: Root, start: usize, end: usize): bool {\n if (DEBUG) {\n assert(\n start <= end && // must be valid\n !(start & AL_MASK) && // must be aligned\n !(end & AL_MASK) // must be aligned\n );\n }\n\n var tail = GETTAIL(root);\n var tailInfo: usize = 0;\n if (tail) { // more memory\n if (DEBUG) assert(start >= changetype(tail) + BLOCK_OVERHEAD);\n\n // merge with current tail if adjacent\n if (start - BLOCK_OVERHEAD == changetype(tail)) {\n start -= BLOCK_OVERHEAD;\n tailInfo = tail.mmInfo;\n } else {\n // We don't do this, but a user might `memory.grow` manually\n // leading to non-adjacent pages managed by TLSF.\n }\n\n } else if (DEBUG) { // first memory\n assert(start >= changetype(root) + ROOT_SIZE); // starts after root\n }\n\n // check if size is large enough for a free block and the tail block\n var size = end - start;\n if (size < BLOCK_OVERHEAD + BLOCK_MINSIZE + BLOCK_OVERHEAD) {\n return false;\n }\n\n // left size is total minus its own and the zero-length tail's header\n var leftSize = size - 2 * BLOCK_OVERHEAD;\n var left = changetype(start);\n left.mmInfo = leftSize | FREE | (tailInfo & LEFTFREE);\n left.prev = null;\n left.next = null;\n\n // tail is a zero-length used block\n tail = changetype(start + size - BLOCK_OVERHEAD);\n tail.mmInfo = 0 | LEFTFREE;\n SETTAIL(root, tail);\n\n insertBlock(root, left); // also merges with free left before tail / sets 'back'\n\n return true;\n}\n\n/** Grows memory to fit at least another block of the specified size. */\nfunction growMemory(root: Root, size: usize): void {\n var pagesBefore = memory.size();\n var pagesNeeded = (((size + 0xffff) & ~0xffff) >>> 16);\n var pagesWanted = max(pagesBefore, pagesNeeded); // double memory\n if (memory.grow(pagesWanted) < 0) {\n if (memory.grow(pagesNeeded) < 0) unreachable();\n }\n var pagesAfter = memory.size();\n addMemory(root, pagesBefore << 16, pagesAfter << 16);\n}\n\n/** Prepares and checks an allocation size. */\nfunction prepareSize(size: usize): usize {\n if (size >= BLOCK_MAXSIZE) throw new Error(\"allocation too large\");\n return max((size + AL_MASK) & ~AL_MASK, BLOCK_MINSIZE); // align and ensure min size\n}\n\n/** Initilizes the root structure. */\nexport function initializeRoot(): void {\n var rootOffset = (__heap_base + AL_MASK) & ~AL_MASK;\n var pagesBefore = memory.size();\n var pagesNeeded = ((((rootOffset + ROOT_SIZE) + 0xffff) & ~0xffff) >>> 16);\n if (pagesNeeded > pagesBefore && memory.grow(pagesNeeded - pagesBefore) < 0) unreachable();\n var root = changetype(rootOffset);\n root.flMap = 0;\n SETTAIL(root, changetype(0));\n for (let fl: usize = 0; fl < FL_BITS; ++fl) {\n SETSL(root, fl, 0);\n for (let sl: u32 = 0; sl < SL_SIZE; ++sl) {\n SETHEAD(root, fl, sl, null);\n }\n }\n addMemory(root, (rootOffset + ROOT_SIZE + AL_MASK) & ~AL_MASK, memory.size() << 16);\n ROOT = root;\n}\n\n/** Allocates a block of the specified size. */\nexport function allocateBlock(root: Root, size: usize): Block {\n var payloadSize = prepareSize(size);\n var block = searchBlock(root, payloadSize);\n if (!block) {\n growMemory(root, payloadSize);\n block = searchBlock(root, payloadSize);\n if (DEBUG) assert(block); // must be found now\n }\n if (DEBUG) assert((block.mmInfo & ~TAGS_MASK) >= payloadSize); // must fit\n block.gcInfo = 0; // RC=0\n // block.rtId = 0; // set by the caller (__alloc)\n block.rtSize = size;\n removeBlock(root, block);\n prepareBlock(root, block, payloadSize);\n if (isDefined(ASC_RTRACE)) onalloc(block);\n return block;\n}\n\n/** Reallocates a block to the specified size. */\nexport function reallocateBlock(root: Root, block: Block, size: usize): Block {\n var payloadSize = prepareSize(size);\n var blockInfo = block.mmInfo;\n if (DEBUG) assert(!(blockInfo & FREE)); // must be used\n\n // possibly split and update runtime size if it still fits\n if (payloadSize <= (blockInfo & ~TAGS_MASK)) {\n prepareBlock(root, block, payloadSize);\n block.rtSize = size;\n return block;\n }\n\n // merge with right free block if merger is large enough\n var right = GETRIGHT(block);\n var rightInfo = right.mmInfo;\n if (rightInfo & FREE) {\n let mergeSize = (blockInfo & ~TAGS_MASK) + BLOCK_OVERHEAD + (rightInfo & ~TAGS_MASK);\n if (mergeSize >= payloadSize) {\n removeBlock(root, right);\n // TODO: this can yield an intermediate block larger than BLOCK_MAXSIZE, which\n // is immediately split though. does this trigger any assertions / issues?\n block.mmInfo = (blockInfo & TAGS_MASK) | mergeSize;\n block.rtSize = size;\n prepareBlock(root, block, payloadSize);\n return block;\n }\n }\n\n // otherwise move the block\n var newBlock = allocateBlock(root, size);\n newBlock.gcInfo = block.gcInfo;\n newBlock.rtId = block.rtId;\n memory.copy(changetype(newBlock) + BLOCK_OVERHEAD, changetype(block) + BLOCK_OVERHEAD, size);\n block.mmInfo = blockInfo | FREE;\n insertBlock(root, block);\n return newBlock;\n}\n\n/** Frees a block. */\nexport function freeBlock(root: Root, block: Block): void {\n var blockInfo = block.mmInfo;\n assert(!(blockInfo & FREE)); // must be used (user might call through to this)\n block.mmInfo = blockInfo | FREE;\n insertBlock(root, block);\n if (isDefined(ASC_RTRACE)) onfree(block);\n}\n\n// @ts-ignore: decorator\n@global @unsafe\nexport function __alloc(size: usize, id: u32): usize {\n var root = ROOT;\n if (!root) {\n initializeRoot();\n root = ROOT;\n }\n var block = allocateBlock(root, size);\n block.rtId = id;\n return changetype(block) + BLOCK_OVERHEAD;\n}\n\n// @ts-ignore: decorator\n@global @unsafe\nexport function __realloc(ref: usize, size: usize): usize {\n if (DEBUG) assert(ROOT); // must be initialized\n assert(ref != 0 && !(ref & AL_MASK)); // must exist and be aligned\n return changetype(reallocateBlock(ROOT, changetype(ref - BLOCK_OVERHEAD), size)) + BLOCK_OVERHEAD;\n}\n\n// @ts-ignore: decorator\n@global @unsafe\nexport function __free(ref: usize): void {\n if (DEBUG) assert(ROOT); // must be initialized\n assert(ref != 0 && !(ref & AL_MASK)); // must exist and be aligned\n freeBlock(ROOT, changetype(ref - BLOCK_OVERHEAD));\n}\n",set:'/// \n\nimport { HASH } from "./util/hash";\n\n// A deterministic hash set based on CloseTable from https://github.com/jorendorff/dht\n\n// @ts-ignore: decorator\n@inline\nconst INITIAL_CAPACITY = 4;\n\n// @ts-ignore: decorator\n@inline\nconst FILL_FACTOR: f64 = 8 / 3;\n\n// @ts-ignore: decorator\n@inline\nconst FREE_FACTOR: f64 = 3 / 4;\n\n/** Structure of a set entry. */\n@unmanaged class SetEntry {\n key: K;\n taggedNext: usize; // LSB=1 indicates EMPTY\n}\n\n/** Empty bit. */\n// @ts-ignore: decorator\n@inline\nconst EMPTY: usize = 1 << 0;\n\n/** Size of a bucket. */\n// @ts-ignore: decorator\n@inline\nconst BUCKET_SIZE = sizeof();\n\n/** Computes the alignment of an entry. */\n// @ts-ignore: decorator\n@inline\nfunction ENTRY_ALIGN(): usize {\n // can align to 4 instead of 8 if 32-bit and K is <= 32-bits\n const align = (sizeof() > sizeof() ? sizeof() : sizeof()) - 1;\n return align;\n}\n\n/** Computes the aligned size of an entry. */\n// @ts-ignore: decorator\n@inline\nfunction ENTRY_SIZE(): usize {\n const align = ENTRY_ALIGN();\n const size = (offsetof>() + align) & ~align;\n return size;\n}\n\nexport class Set {\n\n // buckets holding references to the respective first entry within\n private buckets: ArrayBuffer; // usize[bucketsMask + 1]\n private bucketsMask: u32;\n\n // entries in insertion order\n private entries: ArrayBuffer; // SetEntry[entriesCapacity]\n private entriesCapacity: i32;\n private entriesOffset: i32;\n private entriesCount: i32;\n\n get size(): i32 { return this.entriesCount; }\n\n constructor() { this.clear(); }\n\n clear(): void {\n const bucketsSize = INITIAL_CAPACITY * BUCKET_SIZE;\n this.buckets = new ArrayBuffer(bucketsSize);\n this.bucketsMask = INITIAL_CAPACITY - 1;\n const entriesSize = INITIAL_CAPACITY * ENTRY_SIZE();\n this.entries = new ArrayBuffer(entriesSize);\n this.entriesCapacity = INITIAL_CAPACITY;\n this.entriesOffset = 0;\n this.entriesCount = 0;\n }\n\n private find(key: T, hashCode: u32): SetEntry | null {\n var entry = load>( // unmanaged!\n changetype(this.buckets) + (hashCode & this.bucketsMask) * BUCKET_SIZE\n );\n while (entry) {\n if (!(entry.taggedNext & EMPTY) && entry.key == key) return entry;\n entry = changetype>(entry.taggedNext & ~EMPTY);\n }\n return null;\n }\n\n has(key: T): bool {\n return this.find(key, HASH(key)) !== null;\n }\n\n add(key: T): void {\n var hashCode = HASH(key);\n var entry = this.find(key, hashCode); // unmanaged!\n if (!entry) {\n // check if rehashing is necessary\n if (this.entriesOffset == this.entriesCapacity) {\n this.rehash(\n this.entriesCount < (this.entriesCapacity * FREE_FACTOR)\n ? this.bucketsMask // just rehash if 1/4+ entries are empty\n : (this.bucketsMask << 1) | 1 // grow capacity to next 2^N\n );\n }\n // append new entry\n entry = changetype>(changetype(this.entries) + this.entriesOffset++ * ENTRY_SIZE());\n entry.key = isManaged()\n ? changetype(__retain(changetype(key)))\n : key;\n ++this.entriesCount;\n // link with previous entry in bucket\n let bucketPtrBase = changetype(this.buckets) + (hashCode & this.bucketsMask) * BUCKET_SIZE;\n entry.taggedNext = load(bucketPtrBase);\n store(bucketPtrBase, changetype(entry));\n }\n }\n\n delete(key: T): bool {\n var entry = this.find(key, HASH(key)); // unmanaged!\n if (!entry) return false;\n if (isManaged()) __release(changetype(entry.key)); // exact \'key\'\n entry.taggedNext |= EMPTY;\n --this.entriesCount;\n // check if rehashing is appropriate\n var halfBucketsMask = this.bucketsMask >> 1;\n if (\n halfBucketsMask + 1 >= max(INITIAL_CAPACITY, this.entriesCount) &&\n this.entriesCount < (this.entriesCapacity * FREE_FACTOR)\n ) this.rehash(halfBucketsMask);\n return true;\n }\n\n private rehash(newBucketsMask: u32): void {\n var newBucketsCapacity = (newBucketsMask + 1);\n var newBuckets = new ArrayBuffer(newBucketsCapacity * BUCKET_SIZE);\n var newEntriesCapacity = (newBucketsCapacity * FILL_FACTOR);\n var newEntries = new ArrayBuffer(newEntriesCapacity * ENTRY_SIZE());\n\n // copy old entries to new entries\n var oldPtr = changetype(this.entries);\n var oldEnd = oldPtr + this.entriesOffset * ENTRY_SIZE();\n var newPtr = changetype(newEntries);\n while (oldPtr != oldEnd) {\n let oldEntry = changetype>(oldPtr); // unmanaged!\n if (!(oldEntry.taggedNext & EMPTY)) {\n let newEntry = changetype>(newPtr); // unmanaged!\n newEntry.key = oldEntry.key;\n let newBucketIndex = HASH(oldEntry.key) & newBucketsMask;\n let newBucketPtrBase = changetype(newBuckets) + newBucketIndex * BUCKET_SIZE;\n newEntry.taggedNext = load(newBucketPtrBase);\n store(newBucketPtrBase, newPtr);\n newPtr += ENTRY_SIZE();\n }\n oldPtr += ENTRY_SIZE();\n }\n\n this.buckets = newBuckets;\n this.bucketsMask = newBucketsMask;\n this.entries = newEntries;\n this.entriesCapacity = newEntriesCapacity;\n this.entriesOffset = this.entriesCount;\n }\n\n values(): T[] {\n // FIXME: this is preliminary, needs iterators/closures\n var start = changetype(this.entries);\n var size = this.entriesOffset;\n var values = Array.create(size);\n for (let i = 0; i < size; ++i) {\n let entry = changetype>(start + i * ENTRY_SIZE());\n if (!(entry.taggedNext & EMPTY)) {\n values.push(entry.key);\n }\n }\n return values;\n }\n\n toString(): string {\n return "[object Set]";\n }\n\n // RT integration\n\n @unsafe private __visit_impl(cookie: u32): void {\n __visit(changetype(this.buckets), cookie);\n var entries = changetype(this.entries);\n if (isManaged()) {\n let cur = entries;\n let end = cur + this.entriesOffset * ENTRY_SIZE();\n while (cur < end) {\n let entry = changetype>(cur);\n if (!(entry.taggedNext & EMPTY)) {\n let val = changetype(entry.key);\n if (isNullable()) {\n if (val) __visit(val, cookie);\n } else __visit(val, cookie);\n }\n cur += ENTRY_SIZE();\n }\n }\n __visit(entries, cookie);\n }\n}\n',"shared/feature":"// This file is shared with the compiler and must remain portable\n\n/** Indicates specific features to activate. */\nexport const enum Feature {\n /** No additional features. */\n NONE = 0,\n /** Sign extension operations. */\n SIGN_EXTENSION = 1 << 0, // see: https://github.com/WebAssembly/sign-extension-ops\n /** Mutable global imports and exports. */\n MUTABLE_GLOBAL = 1 << 1, // see: https://github.com/WebAssembly/mutable-global\n /** Bulk memory operations. */\n BULK_MEMORY = 1 << 2, // see: https://github.com/WebAssembly/bulk-memory-operations\n /** SIMD types and operations. */\n SIMD = 1 << 3, // see: https://github.com/WebAssembly/simd\n /** Threading and atomic operations. */\n THREADS = 1 << 4 // see: https://github.com/WebAssembly/threads\n}\n","shared/target":"// This file is shared with the compiler and must remain portable\n\n/** Compilation target. */\nexport enum Target {\n /** WebAssembly with 32-bit pointers. */\n WASM32,\n /** WebAssembly with 64-bit pointers. Experimental and not supported by any runtime yet. */\n WASM64,\n /** Portable. */\n JS\n}\n","shared/typeinfo":"// This file is shared with the compiler and must remain portable\n\n// ╒═══════════════════ Typeinfo interpretation ═══════════════════╕\n// 3 2 1\n// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits\n// ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┤ ◄─ __rtti_base\n// │ count │\n// ╞═══════════════════════════════════════════════════════════════╡ ┐\n// │ Typeinfo#flags [id=0] │ id < count\n// ├ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┤\n// │ Typeinfo#base [id=0] │\n// ├───────────────────────────────────────────────────────────────┤\n// │ ... │\n\n/** Runtime type information data structure. */\n@unmanaged\nexport class Typeinfo {\n /** Flags describing the shape of this class type. */\n flags: TypeinfoFlags;\n /** Base class id or `0` if none. */\n base: u32;\n}\n\n/** Runtime type information flags. */\nexport const enum TypeinfoFlags {\n /** No specific flags. */\n NONE = 0,\n /** Type is an `ArrayBufferView`. */\n ARRAYBUFFERVIEW = 1 << 0,\n /** Type is an `Array`. */\n ARRAY = 1 << 1,\n /** Type is a `Set`. */\n SET = 1 << 2,\n /** Type is a `Map`. */\n MAP = 1 << 3,\n /** Type is inherently acyclic. */\n ACYCLIC = 1 << 4,\n /** Value alignment of 1 byte. */\n VALUE_ALIGN_0 = 1 << 5,\n /** Value alignment of 2 bytes. */\n VALUE_ALIGN_1 = 1 << 6,\n /** Value alignment of 4 bytes. */\n VALUE_ALIGN_2 = 1 << 7,\n /** Value alignment of 8 bytes. */\n VALUE_ALIGN_3 = 1 << 8,\n /** Value alignment of 16 bytes. */\n VALUE_ALIGN_4 = 1 << 9,\n /** Value is a signed type. */\n VALUE_SIGNED = 1 << 10,\n /** Value is a float type. */\n VALUE_FLOAT = 1 << 11,\n /** Value type is nullable. */\n VALUE_NULLABLE = 1 << 12,\n /** Value type is managed. */\n VALUE_MANAGED = 1 << 13,\n /** Key alignment of 1 byte. */\n KEY_ALIGN_0 = 1 << 14,\n /** Key alignment of 2 bytes. */\n KEY_ALIGN_1 = 1 << 15,\n /** Key alignment of 4 bytes. */\n KEY_ALIGN_2 = 1 << 16,\n /** Key alignment of 8 bytes. */\n KEY_ALIGN_3 = 1 << 17,\n /** Key alignment of 16 bytes. */\n KEY_ALIGN_4 = 1 << 18,\n /** Value is a signed type. */\n KEY_SIGNED = 1 << 19,\n /** Value is a float type. */\n KEY_FLOAT = 1 << 20,\n /** Key type is nullable. */\n KEY_NULLABLE = 1 << 21,\n /** Key type is managed. */\n KEY_MANAGED = 1 << 22\n}\n",string:'/// \n\nimport { BLOCK, BLOCK_OVERHEAD, BLOCK_MAXSIZE } from "./rt/common";\nimport { compareImpl, parse, CharCode, isWhiteSpaceOrLineTerminator } from "./util/string";\nimport { E_INVALIDLENGTH } from "./util/error";\nimport { ArrayBufferView } from "./arraybuffer";\nimport { idof } from "./builtins";\n\n@sealed export abstract class String {\n\n @lazy static readonly MAX_LENGTH: i32 = BLOCK_MAXSIZE >>> alignof();\n\n static fromCharCode(unit: i32, surr: i32 = -1): string {\n var out: usize;\n if (~surr) {\n out = __alloc(4, idof());\n store(out, unit);\n store(out, surr, 2);\n } else {\n out = __alloc(2, idof());\n store(out, unit);\n }\n return changetype(out); // retains\n }\n\n static fromCodePoint(code: i32): string {\n assert(code <= 0x10FFFF);\n var sur = code > 0xFFFF;\n var out = __alloc((i32(sur) + 1) << 1, idof());\n if (!sur) {\n store(out, code);\n } else {\n code -= 0x10000;\n let hi: u32 = (code >>> 10) + 0xD800;\n let lo: u32 = (code & 0x3FF) + 0xDC00;\n store(out, (hi << 16) | lo);\n }\n return changetype(out); // retains\n }\n\n get length(): i32 {\n return changetype(changetype(this) - BLOCK_OVERHEAD).rtSize >> 1;\n }\n\n @operator("[]") charAt(pos: i32): String {\n assert(this !== null);\n if (pos >= this.length) return changetype("");\n var out = __alloc(2, idof());\n store(out, load(changetype(this) + (pos << 1)));\n return changetype(out); // retains\n }\n\n charCodeAt(pos: i32): i32 {\n if (pos >= this.length) return -1; // (NaN)\n return load(changetype(this) + (pos << 1));\n }\n\n codePointAt(pos: i32): i32 {\n if (pos >= this.length) return -1; // (undefined)\n var first = load(changetype(this) + (pos << 1));\n if (first < 0xD800 || first > 0xDBFF || pos + 1 == this.length) return first;\n var second = load(changetype(this) + ((pos + 1) << 1));\n if (second < 0xDC00 || second > 0xDFFF) return first;\n return ((first - 0xD800) << 10) + (second - 0xDC00) + 0x10000;\n }\n\n @operator("+") private static __concat(left: String, right: String): String {\n return select(left, changetype("null"), left !== null).concat(right);\n }\n\n concat(other: String): String {\n if (other === null) other = changetype("null");\n var thisSize: isize = this.length << 1;\n var otherSize: isize = other.length << 1;\n var outSize: usize = thisSize + otherSize;\n if (outSize == 0) return changetype("");\n var out = changetype(__alloc(outSize, idof())); // retains\n memory.copy(changetype(out), changetype(this), thisSize);\n memory.copy(changetype(out) + thisSize, changetype(other), otherSize);\n return out;\n }\n\n endsWith(search: String, end: i32 = String.MAX_LENGTH): bool {\n assert(this !== null);\n if (search === null) return false;\n end = min(max(end, 0), this.length);\n var searchLength = search.length;\n var searchStart = end - searchLength;\n if (searchStart < 0) return false;\n // @ts-ignore: string <-> String\n return !compareImpl(this, searchStart, search, 0, searchLength);\n }\n\n @operator("==") private static __eq(left: String | null, right: String | null): bool {\n if (left === right) return true;\n if (left === null || right === null) return false;\n var leftLength = left.length;\n if (leftLength != right.length) return false;\n // @ts-ignore: string <-> String\n return !compareImpl(left, 0, right, 0, leftLength);\n }\n\n @operator.prefix("!")\n private static __not(str: String | null): bool {\n return str === null || !str.length;\n }\n\n @operator("!=")\n private static __ne(left: String | null, right: String | null): bool {\n return !this.__eq(left, right);\n }\n\n @operator(">") private static __gt(left: String | null, right: String | null): bool {\n if (left === right || left === null || right === null) return false;\n var leftLength = left.length;\n var rightLength = right.length;\n if (!leftLength) return false;\n if (!rightLength) return true;\n // @ts-ignore: string <-> String\n return compareImpl(left, 0, right, 0, min(leftLength, rightLength)) > 0;\n }\n\n @operator(">=") private static __gte(left: String, right: String): bool {\n return !this.__lt(left, right);\n }\n\n @operator("<") private static __lt(left: String, right: String): bool {\n if (left === right || left === null || right === null) return false;\n var leftLength = left.length;\n var rightLength = right.length;\n if (!rightLength) return false;\n if (!leftLength) return true;\n // @ts-ignore: string <-> String\n return compareImpl(left, 0, right, 0, min(leftLength, rightLength)) < 0;\n }\n\n @operator("<=") private static __lte(left: String, right: String): bool {\n return !this.__gt(left, right);\n }\n\n includes(search: String, start: i32 = 0): bool {\n return this.indexOf(search, start) != -1;\n }\n\n indexOf(search: String, start: i32 = 0): i32 {\n var searchLen = search.length;\n if (!searchLen) return 0;\n var len = this.length;\n if (!len) return -1;\n var searchStart = min(max(start, 0), len);\n for (len -= searchLen; searchStart <= len; ++searchStart) {\n // @ts-ignore: string <-> String\n if (!compareImpl(this, searchStart, search, 0, searchLen)) return searchStart;\n }\n return -1;\n }\n\n lastIndexOf(search: String, start: i32 = i32.MAX_VALUE): i32 {\n var searchLen = search.length;\n if (!searchLen) return this.length;\n var len = this.length;\n if (!len) return -1;\n var searchStart = min(max(start, 0), len - searchLen);\n for (; searchStart >= 0; --searchStart) {\n // @ts-ignore: string <-> String\n if (!compareImpl(this, searchStart, search, 0, searchLen)) return searchStart;\n }\n return -1;\n }\n\n startsWith(search: String, start: i32 = 0): bool {\n assert(this !== null);\n if (search === null) search = changetype("null");\n var len = this.length;\n var searchStart = min(max(start, 0), len);\n var searchLength = search.length;\n if (searchLength + searchStart > len) return false;\n // @ts-ignore: string <-> String\n return !compareImpl(this, searchStart, search, 0, searchLength);\n }\n\n substr(start: i32, length: i32 = i32.MAX_VALUE): String { // legacy\n assert(this !== null);\n var intStart: isize = start;\n var end: isize = length;\n var size: isize = this.length;\n if (intStart < 0) intStart = max(size + intStart, 0);\n var resultLength = min(max(end, 0), size - intStart);\n if (resultLength <= 0) return changetype("");\n var out = __alloc(resultLength << 1, idof());\n memory.copy(out, changetype(this) + intStart, resultLength);\n return changetype(out); // retains\n }\n\n substring(start: i32, end: i32 = i32.MAX_VALUE): String {\n assert(this !== null);\n var len: isize = this.length;\n var finalStart = min(max(start, 0), len);\n var finalEnd = min(max(end, 0), len);\n var fromPos = min(finalStart, finalEnd) << 1;\n var toPos = max(finalStart, finalEnd) << 1;\n len = toPos - fromPos;\n if (!len) return changetype("");\n if (!fromPos && toPos == this.length << 1) return this;\n var out = __alloc(len, idof());\n memory.copy(out, changetype(this) + fromPos, len);\n return changetype(out); // retains\n }\n\n trim(): String {\n assert(this !== null);\n var length = this.length;\n var size: usize = length << 1;\n while (\n size &&\n isWhiteSpaceOrLineTerminator(\n load(changetype(this) + size)\n )\n ) {\n size -= 2;\n }\n var offset: usize = 0;\n while (\n offset < size &&\n isWhiteSpaceOrLineTerminator(\n load(changetype(this) + offset)\n )\n ) {\n offset += 2; size -= 2;\n }\n if (!size) return changetype("");\n if (!start && size == length << 1) return this;\n var out = __alloc(size, idof());\n memory.copy(out, changetype(this) + offset, size);\n return changetype(out); // retains\n }\n\n @inline\n trimLeft(): String {\n return this.trimStart();\n }\n\n @inline\n trimRight(): String {\n return this.trimEnd();\n }\n\n trimStart(): String {\n assert(this !== null);\n var size = this.length << 1;\n var offset: usize = 0;\n while (\n offset < size &&\n isWhiteSpaceOrLineTerminator(\n load(changetype(this) + offset)\n )\n ) {\n offset += 2;\n }\n if (!offset) return this;\n size -= offset;\n if (!size) return changetype("");\n var out = __alloc(size, idof());\n memory.copy(out, changetype(this) + offset, size);\n return changetype(out); // retains\n }\n\n trimEnd(): String {\n assert(this !== null);\n var originalSize = this.length << 1;\n var size = originalSize;\n while (\n size &&\n isWhiteSpaceOrLineTerminator(\n load(changetype(this) + size)\n )\n ) {\n size -= 2;\n }\n if (!size) return changetype("");\n if (size == originalSize) return this;\n var out = __alloc(size, idof());\n memory.copy(out, changetype(this), size);\n return changetype(out); // retains\n }\n\n padStart(length: i32, pad: string = " "): String {\n assert(this !== null);\n var thisSize = this.length << 1;\n var targetSize = length << 1;\n var padSize = pad.length << 1;\n if (targetSize < thisSize || !padSize) return this;\n var prependSize = targetSize - thisSize;\n var out = __alloc(targetSize, idof());\n if (prependSize > padSize) {\n let repeatCount = (prependSize - 2) / padSize;\n let restBase = repeatCount * padSize;\n let restSize = prependSize - restBase;\n memory.repeat(out, changetype(pad), padSize, repeatCount);\n memory.copy(out + restBase, changetype(pad), restSize);\n } else {\n memory.copy(out, changetype(pad), prependSize);\n }\n memory.copy(out + prependSize, changetype(this), thisSize);\n return changetype(out); // retains\n }\n\n padEnd(length: i32, pad: string = " "): String {\n assert(this !== null);\n var thisSize = this.length << 1;\n var targetSize = length << 1;\n var padSize = pad.length << 1;\n if (targetSize < thisSize || !padSize) return this;\n var appendSize = targetSize - thisSize;\n var out = __alloc(targetSize, idof());\n memory.copy(out, changetype(this), thisSize);\n if (appendSize > padSize) {\n let repeatCount = (appendSize - 2) / padSize;\n let restBase = repeatCount * padSize;\n let restSize = appendSize - restBase;\n memory.repeat(out + thisSize, changetype(pad), padSize, repeatCount);\n memory.copy(out + thisSize + restBase, changetype(pad), restSize);\n } else {\n memory.copy(out + thisSize, changetype(pad), appendSize);\n }\n return changetype(out); // retains\n }\n\n repeat(count: i32 = 0): String {\n assert(this !== null);\n var length = this.length;\n\n // Most browsers can\'t handle strings 1 << 28 chars or longer\n if (count < 0 || length * count > (1 << 28)) {\n throw new RangeError(E_INVALIDLENGTH);\n }\n\n if (count == 0 || !length) return changetype("");\n if (count == 1) return this;\n var out = __alloc((length * count) << 1, idof());\n memory.repeat(out, changetype(this), length << 1, count);\n return changetype(out); // retains\n }\n\n slice(start: i32, end: i32 = i32.MAX_VALUE): String {\n var len = this.length;\n start = start < 0 ? max(start + len, 0) : min(start, len);\n end = end < 0 ? max(end + len, 0) : min(end, len);\n len = end - start;\n if (len <= 0) return changetype("");\n var out = __alloc(len << 1, idof());\n memory.copy(out, changetype(this) + (start << 1), len << 1);\n return changetype(out); // retains\n }\n\n split(separator: String | null = null, limit: i32 = i32.MAX_VALUE): String[] {\n assert(this !== null);\n if (!limit) return changetype>(__allocArray(0, alignof(), idof>())); // retains\n if (separator === null) return [this];\n var length: isize = this.length;\n var sepLen: isize = separator.length;\n if (limit < 0) limit = i32.MAX_VALUE;\n if (!sepLen) {\n if (!length) return changetype>(__allocArray(0, alignof(), idof>())); // retains\n // split by chars\n length = min(length, limit);\n let result = __allocArray(length, alignof(), idof>());\n let resultStart = changetype(result).dataStart;\n for (let i: isize = 0; i < length; ++i) {\n let charStr = __alloc(2, idof());\n store(charStr, load(changetype(this) + (i << 1)));\n store(resultStart + (i << alignof()), charStr); // result[i] = charStr\n if (isManaged()) __retain(charStr);\n }\n return changetype>(result); // retains\n } else if (!length) {\n let result = __allocArray(1, alignof(), idof>());\n store(changetype(result).dataStart, changetype("")); // static ""\n return changetype>(result); // retains\n }\n var result = changetype>(__allocArray(0, alignof(), idof>())); // retains\n var end = 0, start = 0, i = 0;\n while ((end = this.indexOf(separator, start)) != -1) {\n let len = end - start;\n if (len > 0) {\n let out = __alloc(len << 1, idof());\n memory.copy(out, changetype(this) + (start << 1), len << 1);\n result.push(changetype(out));\n } else {\n result.push(changetype(""));\n }\n if (++i == limit) return changetype>(result); // retains\n start = end + sepLen;\n }\n if (!start) { // also means: loop above didn\'t do anything\n result.push(this);\n return changetype>(result); // retains\n }\n var len = length - start;\n if (len > 0) {\n let out = __alloc(len << 1, idof());\n memory.copy(out, changetype(this) + (start << 1), len << 1);\n result.push(changetype(out)); // retains\n } else {\n result.push(changetype("")); // static ""\n }\n return changetype>(result); // retains\n // releases result\n }\n\n toString(): String {\n return this;\n }\n\n get lengthUTF8(): i32 {\n var len = 1; // null terminated\n var pos: usize = 0;\n var end = this.length;\n while (pos < end) {\n let c = load(changetype(this) + (pos << 1));\n if (c < 128) {\n len += 1; ++pos;\n } else if (c < 2048) {\n len += 2; ++pos;\n } else {\n if (\n (c & 0xFC00) == 0xD800 && pos + 1 < end &&\n (load(changetype(this) + ((pos + 1) << 1)) & 0xFC00) == 0xDC00\n ) {\n len += 4; pos += 2;\n } else {\n len += 3; ++pos;\n }\n }\n }\n return len;\n }\n\n static fromUTF8(ptr: usize, len: usize): String {\n if (len < 1) return changetype("");\n var ptrPos = 0;\n var buf = __alloc(len << 1, 0);\n var bufPos = 0;\n while (ptrPos < len) {\n let cp = load(ptr + ptrPos++);\n if (cp < 128) {\n store(buf + bufPos, cp);\n bufPos += 2;\n } else if (cp > 191 && cp < 224) {\n assert(ptrPos + 1 <= len);\n store(buf + bufPos, (cp & 31) << 6 | load(ptr + ptrPos++) & 63);\n bufPos += 2;\n } else if (cp > 239 && cp < 365) {\n assert(ptrPos + 3 <= len);\n cp = (\n (cp & 7) << 18 |\n (load(ptr + ptrPos++) & 63) << 12 |\n (load(ptr + ptrPos++) & 63) << 6 |\n load(ptr + ptrPos++) & 63\n ) - 0x10000;\n store(buf + bufPos, 0xD800 + (cp >> 10));\n bufPos += 2;\n store(buf + bufPos, 0xDC00 + (cp & 1023));\n bufPos += 2;\n } else {\n assert(ptrPos + 2 <= len);\n store(buf + bufPos,\n (cp & 15) << 12 |\n (load(ptr + ptrPos++) & 63) << 6 |\n load(ptr + ptrPos++) & 63\n );\n bufPos += 2;\n }\n }\n assert(ptrPos == len);\n var out = __alloc(bufPos, idof());\n memory.copy(out, buf, bufPos);\n __free(buf);\n return changetype(out); // retains\n }\n\n toUTF8(): usize {\n var buf = __alloc(this.lengthUTF8, 0);\n var pos: usize = 0;\n var end = this.length;\n var off: usize = 0;\n while (pos < end) {\n let c1 = load(changetype(this) + (pos << 1));\n if (c1 < 128) {\n store(buf + off, c1);\n ++off; ++pos;\n } else if (c1 < 2048) {\n let ptr = buf + off;\n store(ptr, c1 >> 6 | 192);\n store(ptr, c1 & 63 | 128, 1);\n off += 2; ++pos;\n } else {\n let ptr = buf + off;\n if ((c1 & 0xFC00) == 0xD800 && pos + 1 < end) {\n let c2 = load(changetype(this) + ((pos + 1) << 1));\n if ((c2 & 0xFC00) == 0xDC00) {\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\n store(ptr, c1 >> 18 | 240);\n store(ptr, c1 >> 12 & 63 | 128, 1);\n store(ptr, c1 >> 6 & 63 | 128, 2);\n store(ptr, c1 & 63 | 128, 3);\n off += 4; pos += 2;\n continue;\n }\n }\n store(ptr, c1 >> 12 | 224);\n store(ptr, c1 >> 6 & 63 | 128, 1);\n store(ptr, c1 & 63 | 128, 2);\n off += 3; ++pos;\n }\n }\n store(buf + off, 0);\n return buf;\n }\n}\n\n// @ts-ignore: nolib\nexport type string = String;\n\nexport function parseInt(str: String, radix: i32 = 0): f64 {\n // @ts-ignore: string <-> String\n return parse(str, radix);\n}\n\nexport function parseI32(str: String, radix: i32 = 0): i32 {\n // @ts-ignore: string <-> String\n return parse(str, radix);\n}\n\nexport function parseI64(str: String, radix: i32 = 0): i64 {\n // @ts-ignore: string <-> String\n return parse(str, radix);\n}\n\n// FIXME: naive implementation\nexport function parseFloat(str: String): f64 {\n var len: i32 = str.length;\n if (!len) return NaN;\n\n var ptr = changetype(str);\n var code = load(ptr);\n\n // determine sign\n var sign: f64;\n // trim white spaces\n while (isWhiteSpaceOrLineTerminator(code)) {\n code = load(ptr += 2);\n --len;\n }\n if (code == CharCode.MINUS) {\n if (!--len) return NaN;\n code = load(ptr += 2);\n sign = -1;\n } else if (code == CharCode.PLUS) {\n if (!--len) return NaN;\n code = load(ptr += 2);\n sign = 1;\n } else {\n sign = 1;\n }\n\n // calculate value\n var num: f64 = 0;\n while (len--) {\n code = load(ptr);\n if (code == CharCode.DOT) {\n ptr += 2;\n let fac: f64 = 0.1; // precision :(\n while (len--) {\n code = load(ptr);\n if (code == CharCode.E || code == CharCode.e) {\n assert(false); // TODO\n }\n code -= CharCode._0;\n if (code > 9) break;\n num += code * fac;\n fac *= 0.1;\n ptr += 2;\n }\n break;\n }\n code -= CharCode._0;\n if (code >= 10) break;\n num = (num * 10) + code;\n ptr += 2;\n }\n return sign * num;\n}\n',symbol:'import { Map } from "./map";\n\n// @ts-ignore: decorator\n@lazy\nvar stringToId: Map;\n\n// @ts-ignore: decorator\n@lazy\nvar idToString: Map;\n\n// @ts-ignore: decorator\n@lazy\nvar nextId: usize = 12; // Symbol.unscopables + 1\n\n@unmanaged @sealed abstract class _Symbol {\n\n // TODO: all of the following default symbols are unused currently yet add to\n // binary size if #toString becomes compiled. Ultimately we\'ll most likely want\n // to remove the unsupported ones and only keep what\'s actually supported.\n\n // @ts-ignore: decorator\n @lazy\n static readonly hasInstance: symbol = changetype(1);\n\n // @ts-ignore: decorator\n @lazy\n static readonly isConcatSpreadable: symbol = changetype(2);\n\n // @ts-ignore: decorator\n @lazy\n static readonly isRegExp: symbol = changetype(3);\n\n // @ts-ignore: decorator\n @lazy\n static readonly iterator: symbol = changetype(3);\n\n // @ts-ignore: decorator\n @lazy\n static readonly match: symbol = changetype(4);\n\n // @ts-ignore: decorator\n @lazy\n static readonly replace: symbol = changetype(5);\n\n // @ts-ignore: decorator\n @lazy\n static readonly search: symbol = changetype(6);\n\n // @ts-ignore: decorator\n @lazy\n static readonly species: symbol = changetype(7);\n\n // @ts-ignore: decorator\n @lazy\n static readonly split: symbol = changetype(8);\n\n // @ts-ignore: decorator\n @lazy\n static readonly toPrimitive: symbol = changetype(9);\n\n // @ts-ignore: decorator\n @lazy\n static readonly toStringTag: symbol = changetype(10);\n\n // @ts-ignore: decorator\n @lazy\n static readonly unscopables: symbol = changetype(11);\n\n static for(key: string): symbol {\n if (!stringToId) { stringToId = new Map(); idToString = new Map(); }\n else if (stringToId.has(key)) return changetype(stringToId.get(key));\n var id = nextId++;\n if (!id) unreachable(); // out of ids\n stringToId.set(key, id);\n idToString.set(id, key);\n return changetype(id);\n }\n\n static keyFor(sym: symbol): string | null {\n return idToString !== null && idToString.has(changetype(sym))\n ? idToString.get(changetype(sym))\n : null;\n }\n\n toString(): string {\n var id = changetype(this);\n var str = "";\n switch (id) {\n case 1: { str = "hasInstance"; break; }\n case 2: { str = "isConcatSpreadable"; break; }\n case 3: { str = "isRegExp"; break; }\n case 4: { str = "match"; break; }\n case 5: { str = "replace"; break; }\n case 6: { str = "search"; break; }\n case 7: { str = "species"; break; }\n case 8: { str = "split"; break; }\n case 9: { str = "toPrimitive"; break; }\n case 10: { str = "toStringTag"; break; }\n case 11: { str = "unscopables"; break; }\n default: {\n if (idToString !== null && idToString.has(id)) str = idToString.get(id);\n break;\n }\n }\n return "Symbol(" + str + ")";\n }\n}\n\nexport function Symbol(description: string | null = null): symbol {\n var id = nextId++;\n if (!id) unreachable(); // out of ids\n return changetype(id);\n}\n\nexport type Symbol = _Symbol;\n\n// @ts-ignore: nolib\nexport type symbol = _Symbol;\n',table:'import { E_NOTIMPLEMENTED } from "./util/error";\n\nexport namespace table {\n\n export function copy(dst: u32, src: u32, n: u32): void {\n throw new Error(E_NOTIMPLEMENTED);\n }\n\n export function init(elementIndex: u32, srcOffset: u32, dstOffset: u32, n: u32): void {\n throw new Error(E_NOTIMPLEMENTED);\n }\n\n export function drop(elementIndex: u32): void {\n throw new Error(E_NOTIMPLEMENTED);\n }\n}\n',typedarray:'import { COMPARATOR, SORT as SORT_IMPL } from "./util/sort";\nimport { E_INDEXOUTOFRANGE } from "./util/error";\nimport { idof } from "./builtins";\nimport { ArrayBufferView } from "./arraybuffer";\n\nexport class Int8Array extends ArrayBufferView {\n [key: number]: i8;\n\n // @ts-ignore: decorator\n @lazy\n static readonly BYTES_PER_ELEMENT: usize = sizeof();\n\n constructor(length: i32) {\n super(length, alignof());\n }\n\n get buffer(): ArrayBuffer {\n return this.data;\n }\n\n get length(): i32 {\n return this.byteLength;\n }\n\n @operator("[]") // unchecked is built-in\n private __get(index: i32): i8 {\n if (index >= this.dataLength) throw new RangeError(E_INDEXOUTOFRANGE);\n return load(this.dataStart + index);\n }\n\n @operator("[]=") // unchecked is built-in\n private __set(index: i32, value: native): void {\n if (index >= this.dataLength) throw new RangeError(E_INDEXOUTOFRANGE);\n store(this.dataStart + index, value);\n }\n\n fill(value: i32, start: i32 = 0, end: i32 = i32.MAX_VALUE): Int8Array {\n return FILL(this, value, start, end);\n }\n\n sort(comparator: (a: i8, b: i8) => i32 = COMPARATOR()): Int8Array {\n return SORT(this, comparator);\n }\n\n subarray(begin: i32 = 0, end: i32 = 0x7fffffff): Int8Array {\n return SUBARRAY(this, begin, end);\n }\n\n reduce(\n fn: (accumulator: T, value: i8, index: i32, array: Int8Array) => T,\n initialValue: T,\n ): T {\n return REDUCE(this, fn, initialValue);\n }\n\n reduceRight(\n fn: (accumulator: T, value: i8, index: i32, array: Int8Array) => T,\n initialValue: T,\n ): T {\n return REDUCE_RIGHT(this, fn, initialValue);\n }\n\n map(fn: (value: i8, index: i32, self: Int8Array) => i8): Int8Array {\n return MAP(this, fn);\n }\n\n findIndex(fn: (value: i8, index: i32, self: Int8Array) => bool): i32 {\n return FIND_INDEX(this, fn);\n }\n\n some(fn: (value: i8, index: i32, self: Int8Array) => bool): bool {\n return SOME(this, fn);\n }\n\n every(fn: (value: i8, index: i32, self: Int8Array) => bool): bool {\n return EVERY(this, fn);\n }\n\n forEach(fn: (value: i8, index: i32, self: Int8Array) => void): void {\n FOREACH(this, fn);\n }\n\n reverse(): this {\n return REVERSE(this);\n }\n}\n\nexport class Uint8Array extends ArrayBufferView {\n [key: number]: u8;\n\n // @ts-ignore: decorator\n @lazy\n static readonly BYTES_PER_ELEMENT: usize = sizeof();\n\n constructor(length: i32) {\n super(length, alignof());\n }\n\n get buffer(): ArrayBuffer {\n return this.data;\n }\n\n get length(): i32 {\n return this.byteLength;\n }\n\n @operator("[]") // unchecked is built-in\n private __get(index: i32): u8 {\n if (index >= this.dataLength) throw new RangeError(E_INDEXOUTOFRANGE);\n return load(this.dataStart + index);\n }\n\n @operator("[]=") // unchecked is built-in\n private __set(index: i32, value: native): void {\n if (index >= this.dataLength) throw new RangeError(E_INDEXOUTOFRANGE);\n store(this.dataStart + index, value);\n }\n\n fill(value: u32, start: i32 = 0, end: i32 = i32.MAX_VALUE): Uint8Array {\n return FILL(this, value, start, end);\n }\n\n sort(comparator: (a: u8, b: u8) => i32 = COMPARATOR()): Uint8Array {\n return SORT(this, comparator);\n }\n\n subarray(begin: i32 = 0, end: i32 = 0x7fffffff): Uint8Array {\n return SUBARRAY(this, begin, end);\n }\n\n reduce(\n fn: (accumulator: T, value: u8, index: i32, array: Uint8Array) => T,\n initialValue: T,\n ): T {\n return REDUCE(this, fn, initialValue);\n }\n\n reduceRight(\n fn: (accumulator: T, value: u8, index: i32, array: Uint8Array) => T,\n initialValue: T,\n ): T {\n return REDUCE_RIGHT(this, fn, initialValue);\n }\n\n map(fn: (value: u8, index: i32, self: Uint8Array) => u8): Uint8Array {\n return MAP(this, fn);\n }\n\n findIndex(fn: (value: u8, index: i32, self: Uint8Array) => bool): i32 {\n return FIND_INDEX(this, fn);\n }\n\n some(fn: (value: u8, index: i32, self: Uint8Array) => bool): bool {\n return SOME(this, fn);\n }\n\n every(fn: (value: u8, index: i32, self: Uint8Array) => bool): bool {\n return EVERY(this, fn);\n }\n\n forEach(fn: (value: u8, index: i32, self: Uint8Array) => void): void {\n FOREACH(this, fn);\n }\n\n reverse(): this {\n return REVERSE(this);\n }\n}\n\nexport class Uint8ClampedArray extends ArrayBufferView {\n [key: number]: u8;\n\n // @ts-ignore: decorator\n @lazy\n static readonly BYTES_PER_ELEMENT: usize = sizeof();\n\n constructor(length: i32) {\n super(length, alignof());\n }\n\n get buffer(): ArrayBuffer {\n return this.data;\n }\n\n get length(): i32 {\n return this.byteLength;\n }\n\n @operator("[]") // unchecked is built-in\n private __get(index: i32): u8 {\n if (index >= this.dataLength) throw new RangeError(E_INDEXOUTOFRANGE);\n return load(this.dataStart + index);\n }\n\n @operator("[]=") // unchecked is built-in\n private __set(index: i32, value: native): void {\n if (index >= this.dataLength) throw new RangeError(E_INDEXOUTOFRANGE);\n store(this.dataStart + index, ~(value >> 31) & (((255 - value) >> 31) | value));\n }\n\n fill(value: u32, start: i32 = 0, end: i32 = i32.MAX_VALUE): Uint8ClampedArray {\n return FILL(this, value, start, end);\n }\n\n sort(fn: (a: u8, b: u8) => i32 = COMPARATOR()): Uint8ClampedArray {\n return SORT(this, fn);\n }\n\n subarray(start: i32 = 0, end: i32 = 0x7fffffff): Uint8ClampedArray {\n return SUBARRAY(this, start, end);\n }\n\n reduce(\n fn: (accumulator: T, value: u8, index: i32, array: Uint8ClampedArray) => T,\n initialValue: T,\n ): T {\n return REDUCE(this, fn, initialValue);\n }\n\n reduceRight(\n fn: (accumulator: T, value: u8, index: i32, array: Uint8ClampedArray) => T,\n initialValue: T,\n ): T {\n return REDUCE_RIGHT(this, fn, initialValue);\n }\n\n map(fn: (value: u8, index: i32, self: Uint8ClampedArray) => u8): Uint8ClampedArray {\n return MAP(this, fn);\n }\n\n findIndex(fn: (value: u8, index: i32, self: Uint8ClampedArray) => bool): i32 {\n return FIND_INDEX(this, fn);\n }\n\n some(fn: (value: u8, index: i32, self: Uint8ClampedArray) => bool): bool {\n return SOME(this, fn);\n }\n\n every(fn: (value: u8, index: i32, self: Uint8ClampedArray) => bool): bool {\n return EVERY(this, fn);\n }\n\n forEach(fn: (value: u8, index: i32, self: Uint8ClampedArray) => void): void {\n FOREACH(this, fn);\n }\n\n reverse(): this {\n return REVERSE(this);\n }\n}\n\nexport class Int16Array extends ArrayBufferView {\n [key: number]: i16;\n\n // @ts-ignore: decorator\n @lazy\n static readonly BYTES_PER_ELEMENT: usize = sizeof();\n\n constructor(length: i32) {\n super(length, alignof());\n }\n\n get buffer(): ArrayBuffer {\n return this.data;\n }\n\n get length(): i32 {\n return this.byteLength >>> alignof();\n }\n\n @operator("[]") // unchecked is built-in\n private __get(index: i32): i16 {\n if (index >= this.dataLength >>> alignof()) throw new RangeError(E_INDEXOUTOFRANGE);\n return load(this.dataStart + (index << alignof()));\n }\n\n @operator("[]=") // unchecked is built-in\n private __set(index: i32, value: native): void {\n if (index >= this.dataLength >>> alignof()) throw new RangeError(E_INDEXOUTOFRANGE);\n store(this.dataStart + (index << alignof()), value);\n }\n\n fill(value: i32, start: i32 = 0, end: i32 = i32.MAX_VALUE): Int16Array {\n return FILL(this, value, start, end);\n }\n\n sort(comparator: (a: i16, b: i16) => i32 = COMPARATOR()): Int16Array {\n return SORT(this, comparator);\n }\n\n subarray(begin: i32 = 0, end: i32 = 0x7fffffff): Int16Array {\n return SUBARRAY(this, begin, end);\n }\n\n reduce(\n fn: (accumulator: T, value: i16, index: i32, array: Int16Array) => T,\n initialValue: T,\n ): T {\n return REDUCE(this, fn, initialValue);\n }\n\n reduceRight(\n fn: (accumulator: T, value: i16, index: i32, array: Int16Array) => T,\n initialValue: T,\n ): T {\n return REDUCE_RIGHT(this, fn, initialValue);\n }\n\n map(fn: (value: i16, index: i32, self: Int16Array) => i16): Int16Array {\n return MAP(this, fn);\n }\n\n findIndex(fn: (value: i16, index: i32, self: Int16Array) => bool): i32 {\n return FIND_INDEX(this, fn);\n }\n\n some(fn: (value: i16, index: i32, self: Int16Array) => bool): bool {\n return SOME(this, fn);\n }\n\n every(fn: (value: i16, index: i32, self: Int16Array) => bool): bool {\n return EVERY(this, fn);\n }\n\n forEach(fn: (value: i16, index: i32, self: Int16Array) => void): void {\n FOREACH(this, fn);\n }\n\n reverse(): this {\n return REVERSE(this);\n }\n}\n\nexport class Uint16Array extends ArrayBufferView {\n [key: number]: u16;\n\n // @ts-ignore: decorator\n @lazy\n static readonly BYTES_PER_ELEMENT: usize = sizeof();\n\n constructor(length: i32) {\n super(length, alignof());\n }\n\n get buffer(): ArrayBuffer {\n return this.data;\n }\n\n get length(): i32 {\n return this.byteLength >>> alignof();\n }\n\n @operator("[]") // unchecked is built-in\n private __get(index: i32): u16 {\n if (index >= this.dataLength >>> alignof()) throw new RangeError(E_INDEXOUTOFRANGE);\n return load(this.dataStart + (index << alignof()));\n }\n\n @operator("[]=") // unchecked is built-in\n private __set(index: i32, value: native): void {\n if (index >= this.dataLength >>> alignof()) throw new RangeError(E_INDEXOUTOFRANGE);\n store(this.dataStart + (index << alignof()), value);\n }\n\n fill(value: u32, start: i32 = 0, end: i32 = i32.MAX_VALUE): Uint16Array {\n return FILL(this, value, start, end);\n }\n\n sort(comparator: (a: u16, b: u16) => i32 = COMPARATOR()): Uint16Array {\n return SORT(this, comparator);\n }\n\n subarray(begin: i32 = 0, end: i32 = 0x7fffffff): Uint16Array {\n return SUBARRAY(this, begin, end);\n }\n\n reduce(\n fn: (accumulator: T, value: u16, index: i32, array: Uint16Array) => T,\n initialValue: T,\n ): T {\n return REDUCE(this, fn, initialValue);\n }\n\n reduceRight(\n fn: (accumulator: T, value: u16, index: i32, array: Uint16Array) => T,\n initialValue: T,\n ): T {\n return REDUCE_RIGHT(this, fn, initialValue);\n }\n\n map(fn: (value: u16, index: i32, self: Uint16Array) => u16): Uint16Array {\n return MAP(this, fn);\n }\n\n findIndex(fn: (value: u16, index: i32, self: Uint16Array) => bool): i32 {\n return FIND_INDEX(this, fn);\n }\n\n some(fn: (value: u16, index: i32, self: Uint16Array) => bool): bool {\n return SOME(this, fn);\n }\n\n every(fn: (value: u16, index: i32, self: Uint16Array) => bool): bool {\n return EVERY(this, fn);\n }\n\n forEach(fn: (value: u16, index: i32, self: Uint16Array) => void): void {\n FOREACH(this, fn);\n }\n\n reverse(): this {\n return REVERSE(this);\n }\n}\n\nexport class Int32Array extends ArrayBufferView {\n [key: number]: i32;\n\n // @ts-ignore: decorator\n @lazy\n static readonly BYTES_PER_ELEMENT: usize = sizeof();\n\n constructor(length: i32) {\n super(length, alignof());\n }\n\n get buffer(): ArrayBuffer {\n return this.data;\n }\n\n get length(): i32 {\n return this.byteLength >>> alignof();\n }\n\n @operator("[]") // unchecked is built-in\n private __get(index: i32): i32 {\n if (index >= this.dataLength >>> alignof()) throw new RangeError(E_INDEXOUTOFRANGE);\n return load(this.dataStart + (index << alignof()));\n }\n\n @operator("[]=") // unchecked is built-in\n private __set(index: i32, value: i32): void {\n if (index >= this.dataLength >>> alignof()) throw new RangeError(E_INDEXOUTOFRANGE);\n store(this.dataStart + (index << alignof()), value);\n }\n\n fill(value: i32, start: i32 = 0, end: i32 = i32.MAX_VALUE): Int32Array {\n return FILL(this, value, start, end);\n }\n\n sort(comparator: (a: i32, b: i32) => i32 = COMPARATOR()): Int32Array {\n return SORT(this, comparator);\n }\n\n subarray(begin: i32 = 0, end: i32 = 0x7fffffff): Int32Array {\n return SUBARRAY(this, begin, end);\n }\n\n reduce(\n fn: (accumulator: T, value: i32, index: i32, array: Int32Array) => T,\n initialValue: T,\n ): T {\n return REDUCE(this, fn, initialValue);\n }\n\n reduceRight(\n fn: (accumulator: T, value: i32, index: i32, array: Int32Array) => T,\n initialValue: T,\n ): T {\n return REDUCE_RIGHT(this, fn, initialValue);\n }\n\n map(fn: (value: i32, index: i32, self: Int32Array) => i32): Int32Array {\n return MAP(this, fn);\n }\n\n findIndex(fn: (value: i32, index: i32, self: Int32Array) => bool): i32 {\n return FIND_INDEX(this, fn);\n }\n\n some(fn: (value: i32, index: i32, self: Int32Array) => bool): bool {\n return SOME(this, fn);\n }\n\n every(fn: (value: i32, index: i32, self: Int32Array) => bool): bool {\n return EVERY(this, fn);\n }\n\n forEach(fn: (value: i32, index: i32, self: Int32Array) => void): void {\n FOREACH(this, fn);\n }\n\n reverse(): this {\n return REVERSE(this);\n }\n}\n\nexport class Uint32Array extends ArrayBufferView {\n [key: number]: u32;\n\n // @ts-ignore: decorator\n @lazy\n static readonly BYTES_PER_ELEMENT: usize = sizeof();\n\n constructor(length: i32) {\n super(length, alignof());\n }\n\n get buffer(): ArrayBuffer {\n return this.data;\n }\n\n get length(): i32 {\n return this.byteLength >>> alignof();\n }\n\n @operator("[]") // unchecked is built-in\n private __get(index: i32): u32 {\n if (index >= this.dataLength >>> alignof()) throw new RangeError(E_INDEXOUTOFRANGE);\n return load(this.dataStart + (index << alignof()));\n }\n\n @operator("[]=") // unchecked is built-in\n private __set(index: i32, value: u32): void {\n if (index >= this.dataLength >>> alignof()) throw new RangeError(E_INDEXOUTOFRANGE);\n store(this.dataStart + (index << alignof()), value);\n }\n\n fill(value: u32, start: i32 = 0, end: i32 = i32.MAX_VALUE): Uint32Array {\n return FILL(this, value, start, end);\n }\n\n sort(comparator: (a: u32, b: u32) => i32 = COMPARATOR()): Uint32Array {\n return SORT(this, comparator);\n }\n\n subarray(begin: i32 = 0, end: i32 = 0x7fffffff): Uint32Array {\n return SUBARRAY(this, begin, end);\n }\n\n reduce(\n fn: (accumulator: T, value: u32, index: i32, array: Uint32Array) => T,\n initialValue: T,\n ): T {\n return REDUCE(this, fn, initialValue);\n }\n\n reduceRight(\n fn: (accumulator: T, value: u32, index: i32, array: Uint32Array) => T,\n initialValue: T,\n ): T {\n return REDUCE_RIGHT(this, fn, initialValue);\n }\n\n map(fn: (value: u32, index: i32, self: Uint32Array) => u32): Uint32Array {\n return MAP(this, fn);\n }\n\n findIndex(fn: (value: u32, index: i32, self: Uint32Array) => bool): i32 {\n return FIND_INDEX(this, fn);\n }\n\n some(fn: (value: u32, index: i32, self: Uint32Array) => bool): bool {\n return SOME(this, fn);\n }\n\n every(fn: (value: u32, index: i32, self: Uint32Array) => bool): bool {\n return EVERY(this, fn);\n }\n\n forEach(fn: (value: u32, index: i32, self: Uint32Array) => void): void {\n FOREACH(this, fn);\n }\n\n reverse(): this {\n return REVERSE(this);\n }\n}\n\nexport class Int64Array extends ArrayBufferView {\n [key: number]: i64;\n\n // @ts-ignore: decorator\n @lazy\n static readonly BYTES_PER_ELEMENT: usize = sizeof();\n\n constructor(length: i32) {\n super(length, alignof());\n }\n\n get buffer(): ArrayBuffer {\n return this.data;\n }\n\n get length(): i32 {\n return this.byteLength >>> alignof();\n }\n\n @operator("[]") // unchecked is built-in\n private __get(index: i32): i64 {\n if (index >= this.dataLength >>> alignof()) throw new RangeError(E_INDEXOUTOFRANGE);\n return load(this.dataStart + (index << alignof()));\n }\n\n @operator("[]=") // unchecked is built-in\n private __set(index: i32, value: i64): void {\n if (index >= this.dataLength >>> alignof()) throw new RangeError(E_INDEXOUTOFRANGE);\n store(this.dataStart + (index << alignof()), value);\n }\n\n fill(value: i64, start: i32 = 0, end: i32 = i32.MAX_VALUE): Int64Array {\n return FILL(this, value, start, end);\n }\n\n sort(comparator: (a: i64, b: i64) => i32 = COMPARATOR()): Int64Array {\n return SORT(this, comparator);\n }\n\n subarray(begin: i32 = 0, end: i32 = 0x7fffffff): Int64Array {\n return SUBARRAY(this, begin, end);\n }\n\n reduce(\n fn: (accumulator: T, value: i64, index: i32, array: Int64Array) => T,\n initialValue: T,\n ): T {\n return REDUCE(this, fn, initialValue);\n }\n\n reduceRight(\n fn: (accumulator: T, value: i64, index: i32, array: Int64Array) => T,\n initialValue: T,\n ): T {\n return REDUCE_RIGHT(this, fn, initialValue);\n }\n\n map(fn: (value: i64, index: i32, self: Int64Array) => i64): Int64Array {\n return MAP(this, fn);\n }\n\n findIndex(fn: (value: i64, index: i32, self: Int64Array) => bool): i32 {\n return FIND_INDEX(this, fn);\n }\n\n some(fn: (value: i64, index: i32, self: Int64Array) => bool): bool {\n return SOME(this, fn);\n }\n\n every(fn: (value: i64, index: i32, self: Int64Array) => bool): bool {\n return EVERY(this, fn);\n }\n\n forEach(fn: (value: i64, index: i32, self: Int64Array) => void): void {\n FOREACH(this, fn);\n }\n\n reverse(): this {\n return REVERSE(this);\n }\n}\n\nexport class Uint64Array extends ArrayBufferView {\n [key: number]: u64;\n\n // @ts-ignore: decorator\n @lazy\n static readonly BYTES_PER_ELEMENT: usize = sizeof();\n\n constructor(length: i32) {\n super(length, alignof());\n }\n\n get buffer(): ArrayBuffer {\n return this.data;\n }\n\n get length(): i32 {\n return this.byteLength >>> alignof();\n }\n\n @operator("[]") // unchecked is built-in\n private __get(index: i32): u64 {\n if (index >= this.dataLength >>> alignof()) throw new RangeError(E_INDEXOUTOFRANGE);\n return load(this.dataStart + (index << alignof()));\n }\n\n @operator("[]=") // unchecked is built-in\n private __set(index: i32, value: u64): void {\n if (index >= this.dataLength >>> alignof()) throw new RangeError(E_INDEXOUTOFRANGE);\n store(this.dataStart + (index << alignof()), value);\n }\n\n fill(value: u64, start: i32 = 0, end: i32 = i32.MAX_VALUE): Uint64Array {\n return FILL(this, value, start, end);\n }\n\n sort(comparator: (a: u64, b: u64) => i32 = COMPARATOR()): Uint64Array {\n return SORT(this, comparator);\n }\n\n subarray(begin: i32 = 0, end: i32 = 0x7fffffff): Uint64Array {\n return SUBARRAY(this, begin, end);\n }\n\n reduce(\n fn: (accumulator: T, value: u64, index: i32, array: Uint64Array) => T,\n initialValue: T,\n ): T {\n return REDUCE(this, fn, initialValue);\n }\n\n reduceRight(\n fn: (accumulator: T, value: u64, index: i32, array: Uint64Array) => T,\n initialValue: T,\n ): T {\n return REDUCE_RIGHT(this, fn, initialValue);\n }\n\n map(fn: (value: u64, index: i32, self: Uint64Array) => u64): Uint64Array {\n return MAP(this, fn);\n }\n\n findIndex(fn: (value: u64, index: i32, self: Uint64Array) => bool): i32 {\n return FIND_INDEX(this, fn);\n }\n\n some(fn: (value: u64, index: i32, self: Uint64Array) => bool): bool {\n return SOME(this, fn);\n }\n\n every(fn: (value: u64, index: i32, self: Uint64Array) => bool): bool {\n return EVERY(this, fn);\n }\n\n forEach(fn: (value: u64, index: i32, self: Uint64Array) => void): void {\n FOREACH(this, fn);\n }\n\n reverse(): this {\n return REVERSE(this);\n }\n}\n\nexport class Float32Array extends ArrayBufferView {\n [key: number]: f32;\n\n // @ts-ignore: decorator\n @lazy\n static readonly BYTES_PER_ELEMENT: usize = sizeof();\n\n constructor(length: i32) {\n super(length, alignof());\n }\n\n get buffer(): ArrayBuffer {\n return this.data;\n }\n\n get length(): i32 {\n return this.byteLength >>> alignof();\n }\n\n @operator("[]") // unchecked is built-in\n private __get(index: i32): f32 {\n if (index >= this.dataLength >>> alignof()) throw new RangeError(E_INDEXOUTOFRANGE);\n return load(this.dataStart + (index << alignof()));\n }\n\n @operator("[]=") // unchecked is built-in\n private __set(index: i32, value: f32): void {\n if (index >= this.dataLength >>> alignof()) throw new RangeError(E_INDEXOUTOFRANGE);\n store(this.dataStart + (index << alignof()), value);\n }\n\n fill(value: f32, start: i32 = 0, end: i32 = i32.MAX_VALUE): Float32Array {\n return FILL(this, value, start, end);\n }\n\n sort(comparator: (a: f32, b: f32) => i32 = COMPARATOR()): Float32Array {\n return SORT(this, comparator);\n }\n\n subarray(begin: i32 = 0, end: i32 = 0x7fffffff): Float32Array {\n return SUBARRAY(this, begin, end);\n }\n\n reduce(\n fn: (accumulator: T, value: f32, index: i32, array: Float32Array) => T,\n initialValue: T,\n ): T {\n return REDUCE(this, fn, initialValue);\n }\n\n reduceRight(\n fn: (accumulator: T, value: f32, index: i32, array: Float32Array) => T,\n initialValue: T,\n ): T {\n return REDUCE_RIGHT(this, fn, initialValue);\n }\n\n map(fn: (value: f32, index: i32, self: Float32Array) => f32): Float32Array {\n return MAP(this, fn);\n }\n\n findIndex(fn: (value: f32, index: i32, self: Float32Array) => bool): i32 {\n return FIND_INDEX(this, fn);\n }\n\n some(fn: (value: f32, index: i32, self: Float32Array) => bool): bool {\n return SOME(this, fn);\n }\n\n every(fn: (value: f32, index: i32, self: Float32Array) => bool): bool {\n return EVERY(this, fn);\n }\n\n forEach(fn: (value: f32, index: i32, self: Float32Array) => void): void {\n FOREACH(this, fn);\n }\n\n reverse(): this {\n return REVERSE(this);\n }\n}\n\nexport class Float64Array extends ArrayBufferView {\n [key: number]: f64;\n\n // @ts-ignore: decorator\n @lazy\n static readonly BYTES_PER_ELEMENT: usize = sizeof();\n\n constructor(length: i32) {\n super(length, alignof());\n }\n\n get buffer(): ArrayBuffer {\n return this.data;\n }\n\n get length(): i32 {\n return this.byteLength >>> alignof();\n }\n\n @operator("[]") // unchecked is built-in\n private __get(index: i32): f64 {\n if (index >= this.dataLength >>> alignof()) throw new RangeError(E_INDEXOUTOFRANGE);\n return load(this.dataStart + (index << alignof()));\n }\n\n @operator("[]=") // unchecked is built-in\n private __set(index: i32, value: f64): void {\n if (index >= this.dataLength >>> alignof()) throw new RangeError(E_INDEXOUTOFRANGE);\n store(this.dataStart + (index << alignof()), value);\n }\n\n fill(value: f64, start: i32 = 0, end: i32 = i32.MAX_VALUE): Float64Array {\n return FILL(this, value, start, end);\n }\n\n sort(comparator: (a: f64, b: f64) => i32 = COMPARATOR()): Float64Array {\n return SORT(this, comparator);\n }\n\n subarray(begin: i32 = 0, end: i32 = 0x7fffffff): Float64Array {\n return SUBARRAY(this, begin, end);\n }\n\n reduce(\n fn: (accumulator: T, value: f64, index: i32, array: Float64Array) => T,\n initialValue: T,\n ): T {\n return REDUCE(this, fn, initialValue);\n }\n\n reduceRight(\n fn: (accumulator: T, value: f64, index: i32, array: Float64Array) => T,\n initialValue: T,\n ): T {\n return REDUCE_RIGHT(this, fn, initialValue);\n }\n\n map(fn: (value: f64, index: i32, self: Float64Array) => f64): Float64Array {\n return MAP(this, fn);\n }\n\n findIndex(fn: (value: f64, index: i32, self: Float64Array) => bool): i32 {\n return FIND_INDEX(this, fn);\n }\n\n some(fn: (value: f64, index: i32, self: Float64Array) => bool): bool {\n return SOME(this, fn);\n }\n\n every(fn: (value: f64, index: i32, self: Float64Array) => bool): bool {\n return EVERY(this, fn);\n }\n\n forEach(fn: (value: f64, index: i32, self: Float64Array) => void): void {\n FOREACH(this, fn);\n }\n\n reverse(): this {\n return REVERSE(this);\n }\n}\n\n// @ts-ignore: decorator\n@inline\nfunction FILL(\n array: TArray,\n value: native,\n start: i32,\n end: i32\n): TArray {\n var dataStart = array.dataStart;\n var length = array.length;\n start = start < 0 ? max(length + start, 0) : min(start, length);\n end = end < 0 ? max(length + end, 0) : min(end, length);\n if (sizeof() == 1) {\n if (start < end) memory.fill(dataStart + start, value, (end - start));\n } else {\n for (; start < end; ++start) {\n store(dataStart + (start << alignof()), value);\n }\n }\n return array;\n}\n\n// @ts-ignore: decorator\n@inline\nfunction SORT(\n array: TArray,\n comparator: (a: T, b: T) => i32\n): TArray {\n var length = array.length;\n if (length <= 1) return array;\n var base = array.dataStart;\n if (length == 2) {\n let a: T = load(base, sizeof()); // a = arr[1]\n let b: T = load(base); // b = arr[0]\n if (comparator(a, b) < 0) {\n store(base, b, sizeof()); // arr[1] = b\n store(base, a); // arr[0] = a\n }\n return array;\n }\n SORT_IMPL(base, length, comparator);\n return array;\n}\n\n// @ts-ignore: decorator\n@inline\nfunction SUBARRAY(\n array: TArray,\n begin: i32,\n end: i32\n): TArray {\n var len = array.length;\n begin = begin < 0 ? max(len + begin, 0) : min(begin, len);\n end = end < 0 ? max(len + end, 0) : min(end, len);\n end = max(end, begin);\n var out = changetype(__alloc(offsetof(), idof())); // retains\n out.data = array.data; // retains\n out.dataStart = array.dataStart + (begin << alignof());\n out.dataLength = (end - begin) << alignof();\n return out;\n}\n\n// @ts-ignore: decorator\n@inline\nfunction REDUCE(\n array: TArray,\n fn: (accumulator: TRet, value: T, index: i32, array: TArray) => TRet,\n initialValue: TRet\n): TRet {\n var dataStart = array.dataStart;\n for (let i = 0, k = array.length; i < k; i++) {\n initialValue = fn(initialValue, load(dataStart + (i << alignof())), i, array);\n }\n return initialValue;\n}\n\n// @ts-ignore: decorator\n@inline\nfunction REDUCE_RIGHT(\n array: TArray,\n fn: (accumulator: TRet, value: T, index: i32, array: TArray) => TRet,\n initialValue: TRet\n): TRet {\n var dataStart = array.dataStart;\n for (let i = array.length - 1; i >= 0; i--) {\n initialValue = fn(initialValue, load(dataStart + (i << alignof())), i, array);\n }\n return initialValue;\n}\n\n// @ts-ignore: decorator\n@inline\nfunction MAP(\n array: TArray,\n fn: (value: T, index: i32, self: TArray) => T,\n): TArray {\n var length = array.length;\n var dataStart = array.dataStart;\n var out = instantiate(length);\n var outDataStart = out.dataStart;\n for (let i = 0; i < length; i++) {\n store(\n outDataStart + (i << alignof()),\n fn(load(dataStart + (i << alignof())), i, array)\n );\n }\n return out;\n}\n\n// @ts-ignore: decorator\n@inline\nfunction FIND_INDEX(\n array: TArray,\n fn: (value: T, index: i32, array: TArray) => bool,\n): i32 {\n var dataStart = array.dataStart;\n for (let i = 0, k = array.length; i < k; i++) {\n if (fn(load(dataStart + (i << alignof())), i, array)) return i;\n }\n return -1;\n}\n\n// @ts-ignore: decorator\n@inline\nfunction SOME(\n array: TArray,\n fn: (value: T, index: i32, array: TArray) => bool,\n): bool {\n var dataStart = array.dataStart;\n for (let i = 0, k = array.length; i < k; i++) {\n if (fn(load(dataStart + (i << alignof())), i, array)) return true;\n }\n return false;\n}\n\n// @ts-ignore: decorator\n@inline\nfunction EVERY(\n array: TArray,\n fn: (value: T, index: i32, array: TArray) => bool,\n): bool {\n var dataStart = array.dataStart;\n for (let i = 0, k = array.length; i < k; i++) {\n if (fn(load(dataStart + (i << alignof())), i, array)) continue;\n return false;\n }\n return true;\n}\n\n// @ts-ignore: decorator\n@inline\nfunction FOREACH(\n array: TArray,\n fn: (value: T, index: i32, array: TArray) => void,\n): void {\n var dataStart = array.dataStart;\n for (let i = 0, k = array.length; i < k; i++) {\n fn(load(dataStart + (i << alignof())), i, array);\n }\n}\n\n// @ts-ignore: decorator\n@inline\nexport function REVERSE(array: TArray): TArray {\n var dataStart = array.dataStart;\n for (let front = 0, back = array.length - 1; front < back; ++front, --back) {\n let frontPtr = dataStart + (front << alignof());\n let backPtr = dataStart + (back << alignof());\n let temp = load(frontPtr);\n store(frontPtr, load(backPtr));\n store(backPtr, temp);\n }\n return array;\n}\n',"util/error":'// Common error messages for use accross the standard library. Keeping error messages compact\n// and reusing them where possible ensures minimal static data in binaries.\n\n// @ts-ignore: decorator\n@lazy @inline\nexport const E_INDEXOUTOFRANGE: string = "Index out of range";\n\n// @ts-ignore: decorator\n@lazy @inline\nexport const E_INVALIDLENGTH: string = "Invalid length";\n\n// @ts-ignore: decorator\n@lazy @inline\nexport const E_EMPTYARRAY: string = "Array is empty";\n\n// @ts-ignore: decorator\n@lazy @inline\nexport const E_HOLEYARRAY: string = "Element type must be nullable if array is holey";\n\n// @ts-ignore: decorator\n@lazy @inline\nexport const E_NOTIMPLEMENTED: string = "Not implemented";\n',"util/hash":"// @ts-ignore: decorator\n@inline\nexport function HASH(key: T): u32 {\n if (isString()) {\n return hashStr(changetype(key));\n } else if (isReference()) {\n if (sizeof() == 4) return hash32(changetype(key));\n if (sizeof() == 8) return hash64(changetype(key));\n } else if (isFloat()) {\n if (sizeof() == 4) return hash32(reinterpret(f32(key)));\n if (sizeof() == 8) return hash64(reinterpret(f64(key)));\n } else {\n if (sizeof() == 1) return hash8 (u32(key));\n if (sizeof() == 2) return hash16(u32(key));\n if (sizeof() == 4) return hash32(u32(key));\n if (sizeof() == 8) return hash64(u64(key));\n }\n return unreachable();\n}\n\n// FNV-1a 32-bit as a starting point, see: http://isthe.com/chongo/tech/comp/fnv/\n\n// @ts-ignore: decorator\n@inline\nconst FNV_OFFSET: u32 = 2166136261;\n\n// @ts-ignore: decorator\n@inline\nconst FNV_PRIME: u32 = 16777619;\n\nfunction hash8(key: u32): u32 {\n return (FNV_OFFSET ^ key) * FNV_PRIME;\n}\n\nfunction hash16(key: u32): u32 {\n var v = FNV_OFFSET;\n v = (v ^ ( key & 0xff)) * FNV_PRIME;\n v = (v ^ ( key >> 8 )) * FNV_PRIME;\n return v;\n}\n\nfunction hash32(key: u32): u32 {\n var v = FNV_OFFSET;\n v = (v ^ ( key & 0xff)) * FNV_PRIME;\n v = (v ^ ((key >> 8) & 0xff)) * FNV_PRIME;\n v = (v ^ ((key >> 16) & 0xff)) * FNV_PRIME;\n v = (v ^ ( key >> 24 )) * FNV_PRIME;\n return v;\n}\n\nfunction hash64(key: u64): u32 {\n var l = key;\n var h = (key >>> 32);\n var v = FNV_OFFSET;\n v = (v ^ ( l & 0xff)) * FNV_PRIME;\n v = (v ^ ((l >> 8) & 0xff)) * FNV_PRIME;\n v = (v ^ ((l >> 16) & 0xff)) * FNV_PRIME;\n v = (v ^ ( l >> 24 )) * FNV_PRIME;\n v = (v ^ ( h & 0xff)) * FNV_PRIME;\n v = (v ^ ((h >> 8) & 0xff)) * FNV_PRIME;\n v = (v ^ ((h >> 16) & 0xff)) * FNV_PRIME;\n v = (v ^ ( h >> 24 )) * FNV_PRIME;\n return v;\n}\n\nfunction hashStr(key: string): u32 {\n var v = FNV_OFFSET;\n if (key !== null) {\n for (let i: usize = 0, k: usize = key.length << 1; i < k; ++i) {\n v = (v ^ load(changetype(key) + i)) * FNV_PRIME;\n }\n }\n return v;\n}\n","util/memory":"export function memcpy(dest: usize, src: usize, n: usize): void { // see: musl/src/string/memcpy.c\n if (ASC_SHRINK_LEVEL > 1) {\n while (n) {\n store(dest++, load(src++));\n --n;\n }\n } else {\n let w: u32, x: u32;\n\n // copy 1 byte each until src is aligned to 4 bytes\n while (n && (src & 3)) {\n store(dest++, load(src++));\n n--;\n }\n\n // if dst is aligned to 4 bytes as well, copy 4 bytes each\n if ((dest & 3) == 0) {\n while (n >= 16) {\n store(dest , load(src ));\n store(dest + 4, load(src + 4));\n store(dest + 8, load(src + 8));\n store(dest + 12, load(src + 12));\n src += 16; dest += 16; n -= 16;\n }\n if (n & 8) {\n store(dest , load(src ));\n store(dest + 4, load(src + 4));\n dest += 8; src += 8;\n }\n if (n & 4) {\n store(dest, load(src));\n dest += 4; src += 4;\n }\n if (n & 2) { // drop to 2 bytes each\n store(dest, load(src));\n dest += 2; src += 2;\n }\n if (n & 1) { // drop to 1 byte\n store(dest++, load(src++));\n }\n return;\n }\n\n // if dst is not aligned to 4 bytes, use alternating shifts to copy 4 bytes each\n // doing shifts if faster when copying enough bytes (here: 32 or more)\n if (n >= 32) {\n switch (dest & 3) {\n // known to be != 0\n case 1: {\n w = load(src);\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n n -= 3;\n while (n >= 17) {\n x = load(src + 1);\n store(dest, w >> 24 | x << 8);\n w = load(src + 5);\n store(dest + 4, x >> 24 | w << 8);\n x = load(src + 9);\n store(dest + 8, w >> 24 | x << 8);\n w = load(src + 13);\n store(dest + 12, x >> 24 | w << 8);\n src += 16; dest += 16; n -= 16;\n }\n break;\n }\n case 2: {\n w = load(src);\n store(dest++, load(src++));\n store(dest++, load(src++));\n n -= 2;\n while (n >= 18) {\n x = load(src + 2);\n store(dest, w >> 16 | x << 16);\n w = load(src + 6);\n store(dest + 4, x >> 16 | w << 16);\n x = load(src + 10);\n store(dest + 8, w >> 16 | x << 16);\n w = load(src + 14);\n store(dest + 12, x >> 16 | w << 16);\n src += 16; dest += 16; n -= 16;\n }\n break;\n }\n case 3: {\n w = load(src);\n store(dest++, load(src++));\n n -= 1;\n while (n >= 19) {\n x = load(src + 3);\n store(dest, w >> 8 | x << 24);\n w = load(src + 7);\n store(dest + 4, x >> 8 | w << 24);\n x = load(src + 11);\n store(dest + 8, w >> 8 | x << 24);\n w = load(src + 15);\n store(dest + 12, x >> 8 | w << 24);\n src += 16; dest += 16; n -= 16;\n }\n break;\n }\n }\n }\n\n // copy remaining bytes one by one\n if (n & 16) {\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n }\n if (n & 8) {\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n }\n if (n & 4) {\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n }\n if (n & 2) {\n store(dest++, load(src++));\n store(dest++, load(src++));\n }\n if (n & 1) {\n store(dest++, load(src++));\n }\n }\n}\n\n// @ts-ignore: decorator\n@inline\nexport function memmove(dest: usize, src: usize, n: usize): void { // see: musl/src/string/memmove.c\n if (dest === src) return;\n if (ASC_SHRINK_LEVEL < 1) {\n if (src + n <= dest || dest + n <= src) {\n memcpy(dest, src, n);\n return;\n }\n }\n if (dest < src) {\n if ((src & 7) == (dest & 7)) {\n while (dest & 7) {\n if (!n) return;\n --n;\n store(dest++, load(src++));\n }\n while (n >= 8) {\n store(dest, load(src));\n n -= 8;\n dest += 8;\n src += 8;\n }\n }\n while (n) {\n store(dest++, load(src++));\n --n;\n }\n } else {\n if ((src & 7) == (dest & 7)) {\n while ((dest + n) & 7) {\n if (!n) return;\n store(dest + --n, load(src + n));\n }\n while (n >= 8) {\n n -= 8;\n store(dest + n, load(src + n));\n }\n }\n while (n) {\n store(dest + --n, load(src + n));\n }\n }\n}\n\n// @ts-ignore: decorator\n@inline\nexport function memset(dest: usize, c: u8, n: usize): void { // see: musl/src/string/memset\n if (ASC_SHRINK_LEVEL > 1) {\n while (n) {\n store(dest++, c);\n --n;\n }\n } else {\n // fill head and tail with minimal branching\n if (!n) return;\n store(dest, c);\n store(dest + n - 1, c);\n if (n <= 2) return;\n\n store(dest + 1, c);\n store(dest + 2, c);\n store(dest + n - 2, c);\n store(dest + n - 3, c);\n if (n <= 6) return;\n store(dest + 3, c);\n store(dest + n - 4, c);\n if (n <= 8) return;\n\n // advance pointer to align it at 4-byte boundary\n let k: usize = -dest & 3;\n dest += k;\n n -= k;\n n &= -4;\n\n let c32: u32 = -1 / 255 * c;\n\n // fill head/tail up to 28 bytes each in preparation\n store(dest, c32);\n store(dest + n - 4, c32);\n if (n <= 8) return;\n store(dest + 4, c32);\n store(dest + 8, c32);\n store(dest + n - 12, c32);\n store(dest + n - 8, c32);\n if (n <= 24) return;\n store(dest + 12, c32);\n store(dest + 16, c32);\n store(dest + 20, c32);\n store(dest + 24, c32);\n store(dest + n - 28, c32);\n store(dest + n - 24, c32);\n store(dest + n - 20, c32);\n store(dest + n - 16, c32);\n\n // align to a multiple of 8\n k = 24 + (dest & 4);\n dest += k;\n n -= k;\n\n // copy 32 bytes each\n let c64: u64 = c32 | (c32 << 32);\n while (n >= 32) {\n store(dest, c64);\n store(dest + 8, c64);\n store(dest + 16, c64);\n store(dest + 24, c64);\n n -= 32;\n dest += 32;\n }\n }\n}\n\n// @ts-ignore: decorator\n@inline\nexport function memcmp(vl: usize, vr: usize, n: usize): i32 { // see: musl/src/string/memcmp.c\n if (vl == vr) return 0;\n while (n != 0 && load(vl) == load(vr)) {\n n--; vl++; vr++;\n }\n return n ? load(vl) - load(vr) : 0;\n}\n","util/number":'/// \n\nimport { idof } from "../builtins";\nimport { CharCode } from "./string";\nimport { ArrayBufferView } from "../arraybuffer";\n\n// @ts-ignore: decorator\n@inline\nexport const MAX_DOUBLE_LENGTH = 28;\n\n// @ts-ignore: decorator\n@lazy @inline\nconst POWERS10: u32[] = [\n 1,\n 10,\n 100,\n 1000,\n 10000,\n 100000,\n 1000000,\n 10000000,\n 100000000,\n 1000000000\n];\n\n/*\n Lookup table for pairwise char codes in range [0-99]\n\n "00", "01", "02", "03", "04", "05", "06", "07", "08", "09",\n "10", "11", "12", "13", "14", "15", "16", "17", "18", "19",\n "20", "21", "22", "23", "24", "25", "26", "27", "28", "29",\n "30", "31", "32", "33", "34", "35", "36", "37", "38", "39",\n "40", "41", "42", "43", "44", "45", "46", "47", "48", "49",\n "50", "51", "52", "53", "54", "55", "56", "57", "58", "59",\n "60", "61", "62", "63", "64", "65", "66", "67", "68", "69",\n "70", "71", "72", "73", "74", "75", "76", "77", "78", "79",\n "80", "81", "82", "83", "84", "85", "86", "87", "88", "89",\n "90", "91", "92", "93", "94", "95", "96", "97", "98", "99"\n*/\n// @ts-ignore: decorator\n@lazy @inline\nconst DIGITS: u32[] = [\n 0x00300030, 0x00310030, 0x00320030, 0x00330030, 0x00340030,\n 0x00350030, 0x00360030, 0x00370030, 0x00380030, 0x00390030,\n 0x00300031, 0x00310031, 0x00320031, 0x00330031, 0x00340031,\n 0x00350031, 0x00360031, 0x00370031, 0x00380031, 0x00390031,\n 0x00300032, 0x00310032, 0x00320032, 0x00330032, 0x00340032,\n 0x00350032, 0x00360032, 0x00370032, 0x00380032, 0x00390032,\n 0x00300033, 0x00310033, 0x00320033, 0x00330033, 0x00340033,\n 0x00350033, 0x00360033, 0x00370033, 0x00380033, 0x00390033,\n 0x00300034, 0x00310034, 0x00320034, 0x00330034, 0x00340034,\n 0x00350034, 0x00360034, 0x00370034, 0x00380034, 0x00390034,\n 0x00300035, 0x00310035, 0x00320035, 0x00330035, 0x00340035,\n 0x00350035, 0x00360035, 0x00370035, 0x00380035, 0x00390035,\n 0x00300036, 0x00310036, 0x00320036, 0x00330036, 0x00340036,\n 0x00350036, 0x00360036, 0x00370036, 0x00380036, 0x00390036,\n 0x00300037, 0x00310037, 0x00320037, 0x00330037, 0x00340037,\n 0x00350037, 0x00360037, 0x00370037, 0x00380037, 0x00390037,\n 0x00300038, 0x00310038, 0x00320038, 0x00330038, 0x00340038,\n 0x00350038, 0x00360038, 0x00370038, 0x00380038, 0x00390038,\n 0x00300039, 0x00310039, 0x00320039, 0x00330039, 0x00340039,\n 0x00350039, 0x00360039, 0x00370039, 0x00380039, 0x00390039\n];\n\n// @ts-ignore: decorator\n@lazy @inline\nconst EXP_POWERS: i16[] = [\n -1220, -1193, -1166, -1140, -1113, -1087, -1060, -1034, -1007, -980,\n -954, -927, -901, -874, -847, -821, -794, -768, -741, -715,\n -688, -661, -635, -608, -582, -555, -529, -502, -475, -449,\n -422, -396, -369, -343, -316, -289, -263, -236, -210, -183,\n -157, -130, -103, -77, -50, -24, 3, 30, 56, 83,\n 109, 136, 162, 189, 216, 242, 269, 295, 322, 348,\n 375, 402, 428, 455, 481, 508, 534, 561, 588, 614,\n 641, 667, 694, 720, 747, 774, 800, 827, 853, 880,\n 907, 933, 960, 986, 1013, 1039, 1066\n];\n\n// 1e-348, 1e-340, ..., 1e340\n// @ts-ignore: decorator\n@lazy @inline\nconst FRC_POWERS: u64[] = [\n 0xFA8FD5A0081C0288, 0xBAAEE17FA23EBF76, 0x8B16FB203055AC76, 0xCF42894A5DCE35EA,\n 0x9A6BB0AA55653B2D, 0xE61ACF033D1A45DF, 0xAB70FE17C79AC6CA, 0xFF77B1FCBEBCDC4F,\n 0xBE5691EF416BD60C, 0x8DD01FAD907FFC3C, 0xD3515C2831559A83, 0x9D71AC8FADA6C9B5,\n 0xEA9C227723EE8BCB, 0xAECC49914078536D, 0x823C12795DB6CE57, 0xC21094364DFB5637,\n 0x9096EA6F3848984F, 0xD77485CB25823AC7, 0xA086CFCD97BF97F4, 0xEF340A98172AACE5,\n 0xB23867FB2A35B28E, 0x84C8D4DFD2C63F3B, 0xC5DD44271AD3CDBA, 0x936B9FCEBB25C996,\n 0xDBAC6C247D62A584, 0xA3AB66580D5FDAF6, 0xF3E2F893DEC3F126, 0xB5B5ADA8AAFF80B8,\n 0x87625F056C7C4A8B, 0xC9BCFF6034C13053, 0x964E858C91BA2655, 0xDFF9772470297EBD,\n 0xA6DFBD9FB8E5B88F, 0xF8A95FCF88747D94, 0xB94470938FA89BCF, 0x8A08F0F8BF0F156B,\n 0xCDB02555653131B6, 0x993FE2C6D07B7FAC, 0xE45C10C42A2B3B06, 0xAA242499697392D3,\n 0xFD87B5F28300CA0E, 0xBCE5086492111AEB, 0x8CBCCC096F5088CC, 0xD1B71758E219652C,\n 0x9C40000000000000, 0xE8D4A51000000000, 0xAD78EBC5AC620000, 0x813F3978F8940984,\n 0xC097CE7BC90715B3, 0x8F7E32CE7BEA5C70, 0xD5D238A4ABE98068, 0x9F4F2726179A2245,\n 0xED63A231D4C4FB27, 0xB0DE65388CC8ADA8, 0x83C7088E1AAB65DB, 0xC45D1DF942711D9A,\n 0x924D692CA61BE758, 0xDA01EE641A708DEA, 0xA26DA3999AEF774A, 0xF209787BB47D6B85,\n 0xB454E4A179DD1877, 0x865B86925B9BC5C2, 0xC83553C5C8965D3D, 0x952AB45CFA97A0B3,\n 0xDE469FBD99A05FE3, 0xA59BC234DB398C25, 0xF6C69A72A3989F5C, 0xB7DCBF5354E9BECE,\n 0x88FCF317F22241E2, 0xCC20CE9BD35C78A5, 0x98165AF37B2153DF, 0xE2A0B5DC971F303A,\n 0xA8D9D1535CE3B396, 0xFB9B7CD9A4A7443C, 0xBB764C4CA7A44410, 0x8BAB8EEFB6409C1A,\n 0xD01FEF10A657842C, 0x9B10A4E5E9913129, 0xE7109BFBA19C0C9D, 0xAC2820D9623BF429,\n 0x80444B5E7AA7CF85, 0xBF21E44003ACDD2D, 0x8E679C2F5E44FF8F, 0xD433179D9C8CB841,\n 0x9E19DB92B4E31BA9, 0xEB96BF6EBADF77D9, 0xAF87023B9BF0EE6B\n];\n\n// Count number of decimals for u32 values\n// In our case input value always non-zero so we can simplify some parts\nexport function decimalCount32(value: u32): u32 {\n if (value < 100000) {\n if (value < 100) {\n return select(1, 2, value < 10);\n } else {\n let m = select(4, 5, value < 10000);\n return select(3, m, value < 1000);\n }\n } else {\n if (value < 10000000) {\n return select(6, 7, value < 1000000);\n } else {\n let m = select(9, 10, value < 1000000000);\n return select(8, m, value < 100000000);\n }\n }\n}\n\n// Count number of decimals for u64 values\n// In our case input value always greater than 2^32-1 so we can skip some parts\nexport function decimalCount64(value: u64): u32 {\n if (value < 1000000000000000) {\n if (value < 1000000000000) {\n return select(11, 12, value < 100000000000);\n } else {\n let m = select(14, 15, value < 100000000000000);\n return select(13, m, value < 10000000000000);\n }\n } else {\n if (value < 100000000000000000) {\n return select(16, 17, value < 10000000000000000);\n } else {\n let m = select(19, 20, value < 10000000000000000000);\n return select(18, m, value < 1000000000000000000);\n }\n }\n}\n\nfunction utoa32_lut(buffer: usize, num: u32, offset: usize): void {\n var lut = changetype(DIGITS).dataStart;\n while (num >= 10000) {\n // in most VMs i32/u32 div and modulo by constant can be shared and simplificate\n let t = num / 10000;\n let r = num % 10000;\n num = t;\n\n let d1 = r / 100;\n let d2 = r % 100;\n\n let digits1 = load(lut + (d1 << alignof()));\n let digits2 = load(lut + (d2 << alignof()));\n\n offset -= 4;\n store(buffer + (offset << 1), digits1 | (digits2 << 32));\n }\n\n if (num >= 100) {\n let t = num / 100;\n let d1 = num % 100;\n num = t;\n offset -= 2;\n let digits = load(lut + (d1 << alignof()));\n store(buffer + (offset << 1), digits);\n }\n\n if (num >= 10) {\n offset -= 2;\n let digits = load(lut + (num << alignof()));\n store(buffer + (offset << 1), digits);\n } else {\n offset -= 1;\n let digit = CharCode._0 + num;\n store(buffer + (offset << 1), digit);\n }\n}\n\nfunction utoa64_lut(buffer: usize, num: u64, offset: usize): void {\n var lut = changetype(DIGITS).dataStart;\n while (num >= 100000000) {\n let t = num / 100000000;\n let r = (num - t * 100000000);\n num = t;\n\n let b = r / 10000;\n let c = r % 10000;\n\n let b1 = b / 100;\n let b2 = b % 100;\n let c1 = c / 100;\n let c2 = c % 100;\n\n let digits1 = load(lut + (c1 << alignof()));\n let digits2 = load(lut + (c2 << alignof()));\n\n offset -= 4;\n store(buffer + (offset << 1), digits1 | (digits2 << 32));\n\n digits1 = load(lut + (b1 << alignof()));\n digits2 = load(lut + (b2 << alignof()));\n\n offset -= 4;\n store(buffer + (offset << 1), digits1 | (digits2 << 32));\n }\n\n utoa32_lut(buffer, num, offset);\n}\n\nfunction utoa_simple(buffer: usize, num: T, offset: usize): void {\n do {\n let t = num / 10;\n let r = (num % 10);\n num = changetype(t);\n offset -= 1;\n store(buffer + (offset << 1), CharCode._0 + r);\n } while (num);\n}\n\n// @ts-ignore: decorator\n@inline\nexport function utoa32_core(buffer: usize, num: u32, offset: u32): void {\n if (ASC_SHRINK_LEVEL >= 1) {\n utoa_simple(buffer, num, offset);\n } else {\n utoa32_lut(buffer, num, offset);\n }\n}\n\n// @ts-ignore: decorator\n@inline\nexport function utoa64_core(buffer: usize, num: u64, offset: u32): void {\n if (ASC_SHRINK_LEVEL >= 1) {\n utoa_simple(buffer, num, offset);\n } else {\n utoa64_lut(buffer, num, offset);\n }\n}\n\nexport function utoa32(value: u32): String {\n if (!value) return "0";\n\n var decimals = decimalCount32(value);\n var out = __alloc(decimals << 1, idof());\n\n utoa32_core(out, value, decimals);\n return changetype(out); // retains\n}\n\nexport function itoa32(value: i32): String {\n if (!value) return "0";\n\n var sign = value < 0;\n if (sign) value = -value;\n\n var decimals = decimalCount32(value) + u32(sign);\n var out = __alloc(decimals << 1, idof());\n\n utoa32_core(out, value, decimals);\n if (sign) store(out, CharCode.MINUS);\n return changetype(out); // retains\n}\n\nexport function utoa64(value: u64): String {\n if (!value) return "0";\n\n var out: usize;\n if (value <= u32.MAX_VALUE) {\n let val32 = value;\n let decimals = decimalCount32(val32);\n out = __alloc(decimals << 1, idof());\n utoa32_core(out, val32, decimals);\n } else {\n let decimals = decimalCount64(value);\n out = __alloc(decimals << 1, idof());\n utoa64_core(out, value, decimals);\n }\n return changetype(out); // retains\n}\n\nexport function itoa64(value: i64): String {\n if (!value) return "0";\n\n var sign = value < 0;\n if (sign) value = -value;\n\n var out: usize;\n if (value <= u32.MAX_VALUE) {\n let val32 = value;\n let decimals = decimalCount32(val32) + u32(sign);\n out = __alloc(decimals << 1, idof());\n utoa32_core(out, val32, decimals);\n } else {\n let decimals = decimalCount64(value) + u32(sign);\n out = __alloc(decimals << 1, idof());\n utoa64_core(out, value, decimals);\n }\n if (sign) store(out, CharCode.MINUS);\n\n return changetype(out); // retains\n}\n\nexport function itoa(value: T): String {\n if (!isInteger()) ERROR("integer type expected");\n if (isSigned()) {\n if (sizeof() <= 4) {\n return itoa32(value);\n } else {\n return itoa64(value);\n }\n } else {\n if (sizeof() <= 4) {\n return utoa32(value);\n } else {\n return utoa64(value);\n }\n }\n}\n\n// @ts-ignore: decorator\n@lazy\nvar _K: i32 = 0;\n\n// // @ts-ignore: decorator\n// @lazy\n// var _frc: u64 = 0;\n\n// @ts-ignore: decorator\n@lazy\nvar _exp: i32 = 0;\n\n// @ts-ignore: decorator\n@lazy\nvar _frc_minus: u64 = 0;\n\n// @ts-ignore: decorator\n@lazy\nvar _frc_plus: u64 = 0;\n\n// @ts-ignore: decorator\n@lazy\nvar _frc_pow: u64 = 0;\n\n// @ts-ignore: decorator\n@lazy\nvar _exp_pow: i32 = 0;\n\n// @ts-ignore: decorator\n@inline\nfunction umul64f(u: u64, v: u64): u64 {\n var u0 = u & 0xFFFFFFFF;\n var v0 = v & 0xFFFFFFFF;\n\n var u1 = u >> 32;\n var v1 = v >> 32;\n\n var l = u0 * v0;\n var t = u1 * v0 + (l >> 32);\n var w = u0 * v1 + (t & 0xFFFFFFFF);\n\n w += 0x7FFFFFFF; // rounding\n\n t >>= 32;\n w >>= 32;\n\n return u1 * v1 + t + w;\n}\n\n// @ts-ignore: decorator\n@inline\nfunction umul64e(e1: i32, e2: i32): i32 {\n return e1 + e2 + 64; // where 64 is significand size\n}\n\n// @ts-ignore: decorator\n@inline\nfunction normalizedBoundaries(f: u64, e: i32): void {\n var frc = (f << 1) + 1;\n var exp = e - 1;\n var off = clz(frc);\n frc <<= off;\n exp -= off;\n\n var m = 1 + i32(f == 0x0010000000000000);\n\n _frc_plus = frc;\n _frc_minus = ((f << m) - 1) << e - m - exp;\n _exp = exp;\n}\n\n// @ts-ignore: decorator\n@inline\nfunction grisuRound(buffer: usize, len: i32, delta: u64, rest: u64, ten_kappa: u64, wp_w: u64): void {\n var lastp = buffer + ((len - 1) << 1);\n var digit = load(lastp);\n while (\n rest < wp_w &&\n delta - rest >= ten_kappa && (\n rest + ten_kappa < wp_w ||\n wp_w - rest > rest + ten_kappa - wp_w\n )\n ) {\n --digit;\n rest += ten_kappa;\n }\n store(lastp, digit);\n}\n\n// @ts-ignore: decorator\n@inline\nfunction getCachedPower(minExp: i32): void {\n const c = reinterpret(0x3FD34413509F79FE); // 1 / lg(10) = 0.30102999566398114\n var dk = (-61 - minExp) * c + 347;\t // dk must be positive, so can do ceiling in positive\n var k = dk;\n k += i32(k != dk); // conversion with ceil\n\n var index = (k >> 3) + 1;\n _K = 348 - (index << 3);\t// decimal exponent no need lookup table\n _frc_pow = unchecked(FRC_POWERS[index]);\n _exp_pow = unchecked(EXP_POWERS[index]);\n}\n\n// @ts-ignore: decorator\n@inline\nfunction grisu2(value: f64, buffer: usize, sign: i32): i32 {\n\n // frexp routine\n var uv = reinterpret(value);\n var exp = ((uv & 0x7FF0000000000000) >>> 52);\n var sid = uv & 0x000FFFFFFFFFFFFF;\n var frc = (u64(exp != 0) << 52) + sid;\n exp = select(exp, 1, exp != 0) - (0x3FF + 52);\n\n normalizedBoundaries(frc, exp);\n getCachedPower(_exp);\n\n // normalize\n var off = clz(frc);\n frc <<= off;\n exp -= off;\n\n var frc_pow = _frc_pow;\n var exp_pow = _exp_pow;\n\n var w_frc = umul64f(frc, frc_pow);\n var w_exp = umul64e(exp, exp_pow);\n\n var wp_frc = umul64f(_frc_plus, frc_pow) - 1;\n var wp_exp = umul64e(_exp, exp_pow);\n\n var wm_frc = umul64f(_frc_minus, frc_pow) + 1;\n var delta = wp_frc - wm_frc;\n\n return genDigits(buffer, w_frc, w_exp, wp_frc, wp_exp, delta, sign);\n}\n\nfunction genDigits(buffer: usize, w_frc: u64, w_exp: i32, mp_frc: u64, mp_exp: i32, delta: u64, sign: i32): i32 {\n var one_exp = -mp_exp;\n var one_frc = (1) << one_exp;\n var mask = one_frc - 1;\n\n var wp_w_frc = mp_frc - w_frc;\n var wp_w_exp = mp_exp;\n\n var p1 = (mp_frc >> one_exp);\n var p2 = mp_frc & mask;\n\n var kappa = decimalCount32(p1);\n var len = sign;\n\n var lut = changetype(POWERS10).dataStart;\n\n while (kappa > 0) {\n let d: u32;\n switch (kappa) {\n case 10: { d = p1 / 1000000000; p1 %= 1000000000; break; }\n case 9: { d = p1 / 100000000; p1 %= 100000000; break; }\n case 8: { d = p1 / 10000000; p1 %= 10000000; break; }\n case 7: { d = p1 / 1000000; p1 %= 1000000; break; }\n case 6: { d = p1 / 100000; p1 %= 100000; break; }\n case 5: { d = p1 / 10000; p1 %= 10000; break; }\n case 4: { d = p1 / 1000; p1 %= 1000; break; }\n case 3: { d = p1 / 100; p1 %= 100; break; }\n case 2: { d = p1 / 10; p1 %= 10; break; }\n case 1: { d = p1; p1 = 0; break; }\n default: { d = 0; break; }\n }\n\n if (d | len) store(buffer + (len++ << 1), CharCode._0 + d);\n\n --kappa;\n let tmp = ((p1) << one_exp) + p2;\n if (tmp <= delta) {\n _K += kappa;\n grisuRound(buffer, len, delta, tmp, load(lut + (kappa << alignof())) << one_exp, wp_w_frc);\n return len;\n }\n }\n\n while (1) {\n p2 *= 10;\n delta *= 10;\n\n let d = p2 >> one_exp;\n if (d | len) store(buffer + (len++ << 1), CharCode._0 + d);\n\n p2 &= mask;\n --kappa;\n if (p2 < delta) {\n _K += kappa;\n wp_w_frc *= load(lut + (-kappa << alignof()));\n grisuRound(buffer, len, delta, p2, one_frc, wp_w_frc);\n return len;\n }\n }\n\n return len;\n}\n\n// @ts-ignore: decorator\n@inline\nfunction genExponent(buffer: usize, k: i32): i32 {\n var sign = k < 0;\n if (sign) k = -k;\n var decimals = decimalCount32(k) + 1;\n utoa32_core(buffer, k, decimals);\n store(buffer, select(CharCode.MINUS, CharCode.PLUS, sign));\n return decimals;\n}\n\nfunction prettify(buffer: usize, length: i32, k: i32): i32 {\n if (!k) {\n store(buffer + (length << 1), CharCode.DOT | (CharCode._0 << 16));\n return length + 2;\n }\n\n var kk = length + k;\n if (length <= kk && kk <= 21) {\n // 1234e7 -> 12340000000\n for (let i = length; i < kk; ++i) {\n store(buffer + (i << 1), CharCode._0);\n }\n store(buffer + (kk << 1), CharCode.DOT | (CharCode._0 << 16));\n return kk + 2;\n } else if (kk > 0 && kk <= 21) {\n // 1234e-2 -> 12.34\n let ptr = buffer + (kk << 1);\n memory.copy(\n ptr + 2,\n ptr,\n -k << 1\n );\n store(buffer + (kk << 1), CharCode.DOT);\n return length + 1;\n } else if (-6 < kk && kk <= 0) {\n // 1234e-6 -> 0.001234\n let offset = 2 - kk;\n memory.copy(\n buffer + (offset << 1),\n buffer,\n length << 1\n );\n store(buffer, CharCode._0 | (CharCode.DOT << 16));\n for (let i = 2; i < offset; ++i) {\n store(buffer + (i << 1), CharCode._0);\n }\n return length + offset;\n } else if (length == 1) {\n // 1e30\n store(buffer, CharCode.e, 2);\n length = genExponent(buffer + 4, kk - 1);\n return length + 2;\n } else {\n let len = length << 1;\n memory.copy(\n buffer + 4,\n buffer + 2,\n len - 2\n );\n store(buffer, CharCode.DOT, 2);\n store(buffer + len, CharCode.e, 2);\n length += genExponent(buffer + len + 4, kk - 1);\n return length + 2;\n }\n}\n\nexport function dtoa_core(buffer: usize, value: f64): i32 {\n var sign = i32(value < 0);\n if (sign) {\n value = -value;\n store(buffer, CharCode.MINUS);\n }\n // assert(value > 0 && value <= 1.7976931348623157e308);\n var len = grisu2(value, buffer, sign);\n len = prettify(buffer + (sign << 1), len - sign, _K);\n return len + sign;\n}\n\nexport function dtoa(value: f64): String {\n if (value == 0) return "0.0";\n if (!isFinite(value)) {\n if (isNaN(value)) return "NaN";\n return select("-Infinity", "Infinity", value < 0);\n }\n var buffer = __alloc(MAX_DOUBLE_LENGTH << 1, idof());\n var length = dtoa_core(buffer, value);\n if (length == MAX_DOUBLE_LENGTH) return changetype(buffer);\n var result = changetype(buffer).substring(0, length);\n __free(buffer);\n return result;\n}\n\nexport function itoa_stream(buffer: usize, offset: usize, value: T): u32 {\n buffer += (offset << 1);\n if (!value) {\n store(buffer, CharCode._0);\n return 1;\n }\n var decimals: u32 = 0;\n if (isSigned()) {\n let sign = i32(value < 0);\n if (sign) value = changetype(-value);\n if (sizeof() <= 4) {\n decimals = decimalCount32(value) + sign;\n utoa32_core(buffer, value, decimals);\n } else {\n if (value <= u32.MAX_VALUE) {\n let val32 = value;\n decimals = decimalCount32(val32) + sign;\n utoa32_core(buffer, val32, decimals);\n } else {\n decimals = decimalCount64(value) + sign;\n utoa64_core(buffer, value, decimals);\n }\n }\n if (sign) store(buffer, CharCode.MINUS);\n } else {\n if (sizeof() <= 4) {\n decimals = decimalCount32(value);\n utoa32_core(buffer, value, decimals);\n } else {\n if (value <= u32.MAX_VALUE) {\n let val32 = value;\n decimals = decimalCount32(val32);\n utoa32_core(buffer, val32, decimals);\n } else {\n decimals = decimalCount64(value);\n utoa64_core(buffer, value, decimals);\n }\n }\n }\n return decimals;\n}\n\nexport function dtoa_stream(buffer: usize, offset: usize, value: f64): u32 {\n buffer += (offset << 1);\n if (value == 0.0) {\n store(buffer, CharCode._0);\n store(buffer, CharCode.DOT, 2);\n store(buffer, CharCode._0, 4);\n return 3;\n }\n if (!isFinite(value)) {\n if (isNaN(value)) {\n store(buffer, CharCode.N);\n store(buffer, CharCode.a, 2);\n store(buffer, CharCode.N, 4);\n return 3;\n } else {\n let sign = i32(value < 0);\n let len = 8 + sign;\n memory.copy(buffer, changetype(select("-Infinity", "Infinity", sign)), len << 1);\n return len;\n }\n }\n return dtoa_core(buffer, value);\n}\n',"util/sort":'import { compareImpl } from "./string";\n\n// @ts-ignore: decorator\n@inline\nexport function COMPARATOR(): (a: T, b: T) => i32 {\n if (isInteger()) {\n if (isSigned() && sizeof() <= 4) {\n return (a: T, b: T): i32 => (i32(a) - i32(b));\n } else {\n return (a: T, b: T): i32 => (i32(a > b) - i32(a < b));\n }\n } else if (isFloat()) {\n if (sizeof() == 4) {\n return (a: T, b: T): i32 => {\n var ia = reinterpret(f32(a));\n var ib = reinterpret(f32(b));\n ia ^= (ia >> 31) >>> 1;\n ib ^= (ib >> 31) >>> 1;\n return i32(ia > ib) - i32(ia < ib);\n };\n } else {\n return (a: T, b: T): i32 => {\n var ia = reinterpret(f64(a));\n var ib = reinterpret(f64(b));\n ia ^= (ia >> 63) >>> 1;\n ib ^= (ib >> 63) >>> 1;\n return i32(ia > ib) - i32(ia < ib);\n };\n }\n } else if (isString()) {\n return (a: T, b: T): i32 => {\n if (a === b || a === null || b === null) return 0;\n var alen = changetype(a).length;\n var blen = changetype(b).length;\n if (!alen && !blen) return 0;\n if (!alen) return -1;\n if (!blen) return 1;\n return compareImpl(changetype(a), 0, changetype(b), 0, min(alen, blen));\n };\n } else {\n return (a: T, b: T): i32 => (i32(a > b) - i32(a < b));\n }\n}\n\n// @ts-ignore: decorator\n@inline\nexport function SORT(\n dataStart: usize,\n length: i32,\n comparator: (a: T, b: T) => i32\n): void {\n if (isReference()) {\n // TODO replace this to faster stable sort (TimSort) when it implemented\n insertionSort(dataStart, length, comparator);\n } else {\n if (length < 256) {\n insertionSort(dataStart, length, comparator);\n } else {\n weakHeapSort(dataStart, length, comparator);\n }\n }\n}\n\nfunction insertionSort(\n dataStart: usize,\n length: i32,\n comparator: (a: T, b: T) => i32\n): void {\n for (let i = 0; i < length; i++) {\n let a: T = load(dataStart + (i << alignof())); // a = arr[i]\n let j = i - 1;\n while (j >= 0) {\n let b: T = load(dataStart + (j << alignof())); // b = arr[j]\n if (comparator(a, b) < 0) {\n store(dataStart + ((j-- + 1) << alignof()), b); // arr[j + 1] = b\n } else break;\n }\n store(dataStart + ((j + 1) << alignof()), a); // arr[j + 1] = a\n }\n}\n\nfunction weakHeapSort(\n dataStart: usize,\n length: i32,\n comparator: (a: T, b: T) => i32\n): void {\n const shift32 = alignof();\n\n var bitsetSize = (length + 31) >> 5 << shift32;\n var bitset = __alloc(bitsetSize, 0); // indexed in 32-bit chunks below\n memory.fill(bitset, 0, bitsetSize);\n\n // see: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.21.1863&rep=rep1&type=pdf\n\n for (let i = length - 1; i > 0; i--) {\n let j = i;\n while ((j & 1) == (load(bitset + (j >> 6 << shift32)) >> (j >> 1 & 31) & 1)) j >>= 1;\n\n let p = j >> 1;\n let a: T = load(dataStart + (p << alignof())); // a = arr[p]\n let b: T = load(dataStart + (i << alignof())); // b = arr[i]\n if (comparator(a, b) < 0) {\n store(\n bitset + (i >> 5 << shift32),\n load(bitset + (i >> 5 << shift32)) ^ (1 << (i & 31))\n );\n store(dataStart + (i << alignof()), a); // arr[i] = a\n store(dataStart + (p << alignof()), b); // arr[p] = b\n }\n }\n\n for (let i = length - 1; i >= 2; i--) {\n let a: T = load(dataStart); // a = arr[0]\n store(dataStart, load(dataStart + (i << alignof()))); // arr[0] = arr[i]\n store(dataStart + (i << alignof()), a); // arr[i] = a\n\n let x = 1, y: i32;\n while ((y = (x << 1) + ((load(bitset + (x >> 5 << shift32)) >> (x & 31)) & 1)) < i) x = y;\n\n while (x > 0) {\n a = load(dataStart); // a = arr[0]\n let b: T = load(dataStart + (x << alignof())); // b = arr[x]\n\n if (comparator(a, b) < 0) {\n store(\n bitset + (x >> 5 << shift32),\n load(bitset + (x >> 5 << shift32)) ^ (1 << (x & 31))\n );\n store(dataStart + (x << alignof()), a); // arr[x] = a\n store(dataStart, b); // arr[0] = b\n }\n x >>= 1;\n }\n }\n\n __free(bitset);\n\n var t: T = load(dataStart, sizeof()); // t = arr[1]\n store(dataStart, load(dataStart), sizeof()); // arr[1] = arr[0]\n store(dataStart, t); // arr[0] = t\n}\n',"util/string":"export function compareImpl(str1: string, index1: usize, str2: string, index2: usize, len: usize): i32 {\n var result: i32 = 0;\n var ptr1 = changetype(str1) + (index1 << 1);\n var ptr2 = changetype(str2) + (index2 << 1);\n while (len && !(result = load(ptr1) - load(ptr2))) {\n --len, ptr1 += 2, ptr2 += 2;\n }\n return result;\n}\n\n// @ts-ignore: decorator\n@inline\nexport const enum CharCode {\n PLUS = 0x2B,\n MINUS = 0x2D,\n DOT = 0x2E,\n _0 = 0x30,\n _1 = 0x31,\n _2 = 0x32,\n _3 = 0x33,\n _4 = 0x34,\n _5 = 0x35,\n _6 = 0x36,\n _7 = 0x37,\n _8 = 0x38,\n _9 = 0x39,\n A = 0x41,\n B = 0x42,\n E = 0x45,\n N = 0x4E,\n O = 0x4F,\n X = 0x58,\n Z = 0x5a,\n a = 0x61,\n b = 0x62,\n e = 0x65,\n n = 0x6E,\n o = 0x6F,\n x = 0x78,\n z = 0x7A\n}\n\nexport function isWhiteSpaceOrLineTerminator(c: i32): bool {\n switch (c) {\n case 9: // \n case 10: // \n case 13: // \n case 11: // \n case 12: // \n case 32: // \n case 160: // \n case 8232: // \n case 8233: // \n case 65279: return true; // \n default: return false;\n }\n}\n\n/** Parses a string to an integer (usually), using the specified radix. */\nexport function parse(str: string, radix: i32 = 0): T {\n var len: i32 = str.length;\n // @ts-ignore: cast\n if (!len) return NaN;\n\n var ptr = changetype(str) /* + HEAD -> offset */;\n var code = load(ptr);\n\n // determine sign\n var sign: T;\n // trim white spaces\n while (isWhiteSpaceOrLineTerminator(code)) {\n code = load(ptr += 2);\n --len;\n }\n if (code == CharCode.MINUS) {\n // @ts-ignore: cast\n if (!--len) return NaN;\n code = load(ptr += 2);\n // @ts-ignore: type\n sign = -1;\n } else if (code == CharCode.PLUS) {\n // @ts-ignore: cast\n if (!--len) return NaN;\n code = load(ptr += 2);\n // @ts-ignore: type\n sign = 1;\n } else {\n // @ts-ignore: type\n sign = 1;\n }\n\n // determine radix\n if (!radix) {\n if (code == CharCode._0 && len > 2) {\n switch (load(ptr + 2)) {\n case CharCode.B:\n case CharCode.b: {\n ptr += 4; len -= 2;\n radix = 2;\n break;\n }\n case CharCode.O:\n case CharCode.o: {\n ptr += 4; len -= 2;\n radix = 8;\n break;\n }\n case CharCode.X:\n case CharCode.x: {\n ptr += 4; len -= 2;\n radix = 16;\n break;\n }\n default: radix = 10;\n }\n } else radix = 10;\n } else if (radix < 2 || radix > 36) {\n // @ts-ignore: cast\n return NaN;\n }\n\n // calculate value\n // @ts-ignore: type\n var num: T = 0;\n while (len--) {\n code = load(ptr);\n if (code >= CharCode._0 && code <= CharCode._9) {\n code -= CharCode._0;\n } else if (code >= CharCode.A && code <= CharCode.Z) {\n code -= CharCode.A - 10;\n } else if (code >= CharCode.a && code <= CharCode.z) {\n code -= CharCode.a - 10;\n } else break;\n if (code >= radix) break;\n // @ts-ignore: type\n num = (num * radix) + code;\n ptr += 2;\n }\n // @ts-ignore: type\n return sign * num;\n}\n",vector:"/** Vector abstraction. */\n@sealed @unmanaged\nexport abstract class V128 {\n}\n"}):(()=>{const n=path.join(".","..","std","assembly"),e=__webpack_require__(!function(){var n=new Error("Cannot find module 'glob'");throw n.code="MODULE_NOT_FOUND",n}()).sync("**/!(*.d).ts",{cwd:n}),t={};return e.forEach(e=>t[e.replace(/\.ts$/,"")]=fs.readFileSync(path.join(n,e),"utf8")),t})(),exports.definitionFiles=exports.isBundle?Object({assembly:'/**\n * Environment definitions for compiling AssemblyScript to WebAssembly using asc.\n * @module std/assembly\n *//***/\n\n/// \n\n// Types\n\n/** An 8-bit signed integer. */\ndeclare type i8 = number;\n/** A 16-bit signed integer. */\ndeclare type i16 = number;\n/** A 32-bit signed integer. */\ndeclare type i32 = number;\n/** A 64-bit signed integer. */\ndeclare type i64 = number;\n/** A 32-bit signed integer when targeting 32-bit WebAssembly or a 64-bit signed integer when targeting 64-bit WebAssembly. */\ndeclare type isize = number;\n/** An 8-bit unsigned integer. */\ndeclare type u8 = number;\n/** A 16-bit unsigned integer. */\ndeclare type u16 = number;\n/** A 32-bit unsigned integer. */\ndeclare type u32 = number;\n/** A 64-bit unsigned integer. */\ndeclare type u64 = number;\n/** A 32-bit unsigned integer when targeting 32-bit WebAssembly or a 64-bit unsigned integer when targeting 64-bit WebAssembly. */\ndeclare type usize = number;\n/** A 1-bit unsigned integer. */\ndeclare type bool = boolean | number;\n/** A 32-bit float. */\ndeclare type f32 = number;\n/** A 64-bit float. */\ndeclare type f64 = number;\n/** A 128-bit vector. */\ndeclare type v128 = object;\n\n// Compiler hints\n\n/** Compiler target. 0 = JS, 1 = WASM32, 2 = WASM64. */\ndeclare const ASC_TARGET: i32;\n/** Provided noAssert option. */\ndeclare const ASC_NO_ASSERT: bool;\n/** Provided memoryBase option. */\ndeclare const ASC_MEMORY_BASE: i32;\n/** Provided optimizeLevel option. */\ndeclare const ASC_OPTIMIZE_LEVEL: i32;\n/** Provided shrinkLevel option. */\ndeclare const ASC_SHRINK_LEVEL: i32;\n/** Whether the mutable global feature is enabled. */\ndeclare const ASC_FEATURE_MUTABLE_GLOBAL: bool;\n/** Whether the sign extension feature is enabled. */\ndeclare const ASC_FEATURE_SIGN_EXTENSION: bool;\n/** Whether the bulk memory feature is enabled. */\ndeclare const ASC_FEATURE_BULK_MEMORY: bool;\n/** Whether the SIMD feature is enabled. */\ndeclare const ASC_FEATURE_SIMD: bool;\n/** Whether the threads feature is enabled. */\ndeclare const ASC_FEATURE_THREADS: bool;\n\n// Builtins\n\n/** Performs the sign-agnostic count leading zero bits operation on a 32-bit or 64-bit integer. All zero bits are considered leading if the value is zero. */\ndeclare function clz(value: T): T;\n/** Performs the sign-agnostic count tailing zero bits operation on a 32-bit or 64-bit integer. All zero bits are considered trailing if the value is zero. */\ndeclare function ctz(value: T): T;\n/** Performs the sign-agnostic count number of one bits operation on a 32-bit or 64-bit integer. */\ndeclare function popcnt(value: T): T;\n/** Performs the sign-agnostic rotate left operation on a 32-bit or 64-bit integer. */\ndeclare function rotl(value: T, shift: T): T;\n/** Performs the sign-agnostic rotate right operation on a 32-bit or 64-bit integer. */\ndeclare function rotr(value: T, shift: T): T;\n/** Computes the absolute value of an integer or float. */\ndeclare function abs(value: T): T;\n/** Determines the maximum of two integers or floats. If either operand is `NaN`, returns `NaN`. */\ndeclare function max(left: T, right: T): T;\n/** Determines the minimum of two integers or floats. If either operand is `NaN`, returns `NaN`. */\ndeclare function min(left: T, right: T): T;\n/** Performs the ceiling operation on a 32-bit or 64-bit float. */\ndeclare function ceil(value: T): T;\n/** Composes a 32-bit or 64-bit float from the magnitude of `x` and the sign of `y`. */\ndeclare function copysign(x: T, y: T): T;\n/** Performs the floor operation on a 32-bit or 64-bit float. */\ndeclare function floor(value: T): T;\n/** Rounds to the nearest integer tied to even of a 32-bit or 64-bit float. */\ndeclare function nearest(value: T): T;\n/** Reinterprets the bits of the specified value as type `T`. Valid reinterpretations are u32/i32 to/from f32 and u64/i64 to/from f64. */\ndeclare function reinterpret(value: number): T;\n/** Selects one of two pre-evaluated values depending on the condition. */\ndeclare function select(ifTrue: T, ifFalse: T, condition: bool): T;\n/** Calculates the square root of a 32-bit or 64-bit float. */\ndeclare function sqrt(value: T): T;\n/** Rounds to the nearest integer towards zero of a 32-bit or 64-bit float. */\ndeclare function trunc(value: T): T;\n/** Loads a value of the specified type from memory. Equivalent to dereferncing a pointer in other languages. */\ndeclare function load(ptr: usize, immOffset?: usize, immAlign?: usize): T;\n/** Stores a value of the specified type to memory. Equivalent to dereferencing a pointer in other languages when assigning a value. */\ndeclare function store(ptr: usize, value: any, immOffset?: usize, immAlign?: usize): void;\n/** Emits an unreachable operation that results in a runtime error when executed. Both a statement and an expression of any type. */\ndeclare function unreachable(): any; // sic\n\n/** NaN (not a number) as a 32-bit or 64-bit float depending on context. */\ndeclare const NaN: f32 | f64;\n/** Positive infinity as a 32-bit or 64-bit float depending on context. */\ndeclare const Infinity: f32 | f64;\n/** Heap base offset. */\ndeclare const __heap_base: usize;\n/** Determines the byte size of the specified underlying core type. Compiles to a constant. */\ndeclare function sizeof(): usize;\n/** Determines the alignment (log2) of the specified underlying core type. Compiles to a constant. */\ndeclare function alignof(): usize;\n/** Determines the offset of the specified field within the given class type. Returns the class type\'s end offset if field name has been omitted. Compiles to a constant. */\ndeclare function offsetof(fieldName?: string): usize;\n/** Determines the unique runtime id of a class type. Compiles to a constant. */\ndeclare function idof(): u32;\n/** Changes the type of any value of `usize` kind to another one of `usize` kind. Useful for casting class instances to their pointer values and vice-versa. Beware that this is unsafe.*/\ndeclare function changetype(value: any): T;\n/** Explicitly requests no bounds checks on the provided expression. Useful for array accesses. */\ndeclare function unchecked(value: T): T;\n/** Emits a `call_indirect` instruction, calling the specified function in the function table by index with the specified arguments. Does result in a runtime error if the arguments do not match the called function. */\ndeclare function call_indirect(target: Function | u32, ...args: any[]): T;\n/** Emits a `call` instruction, calling the specified function in the function table directly with the specified arguments. Function index must be a compile-time constant. */\ndeclare function call_direct(target: Function | u32, ...args: any[]): T;\n/** Instantiates a new instance of `T` using the specified constructor arguments. */\ndeclare function instantiate(...args: any[]): T;\n/** Tests if a 32-bit or 64-bit float is `NaN`. */\ndeclare function isNaN(value: T): bool;\n/** Tests if a 32-bit or 64-bit float is finite, that is not `NaN` or +/-`Infinity`. */\ndeclare function isFinite(value: T): bool;\n/** Tests if the specified type *or* expression is of an integer type and not a reference. Compiles to a constant. */\ndeclare function isInteger(value?: any): value is number;\n/** Tests if the specified type *or* expression is of a float type. Compiles to a constant. */\ndeclare function isFloat(value?: any): value is number;\n/** Tests if the specified type *or* expression is of a boolean type. */\ndeclare function isBoolean(value?: any): value is number;\n/** Tests if the specified type *or* expression can represent negative numbers. Compiles to a constant. */\ndeclare function isSigned(value?: any): value is number;\n/** Tests if the specified type *or* expression is of a reference type. Compiles to a constant. */\ndeclare function isReference(value?: any): value is object | string;\n/** Tests if the specified type *or* expression can be used as a string. Compiles to a constant. */\ndeclare function isString(value?: any): value is string | String;\n/** Tests if the specified type *or* expression can be used as an array. Compiles to a constant. */\ndeclare function isArray(value?: any): value is Array;\n/** Tests if the specified type *or* expression can be used as an array like object. Compiles to a constant. */\ndeclare function isArrayLike(value?: any): value is ArrayLike;\n/** Tests if the specified type *or* expression is of a function type. Compiles to a constant. */\ndeclare function isFunction(value?: any): value is (...args: any) => any;\n/** Tests if the specified type *or* expression is of a nullable reference type. Compiles to a constant. */\ndeclare function isNullable(value?: any): bool;\n/** Tests if the specified expression resolves to a defined element. Compiles to a constant. */\ndeclare function isDefined(expression: any): bool;\n/** Tests if the specified expression evaluates to a constant value. Compiles to a constant. */\ndeclare function isConstant(expression: any): bool;\n/** Tests if the specified type *or* expression is of a managed type. Compiles to a constant. */\ndeclare function isManaged(value?: any): bool;\n/** Traps if the specified value is not true-ish, otherwise returns the (non-nullable) value. */\ndeclare function assert(isTrueish: T, message?: string): T & object; // any better way to model `: T != null`?\n/** Parses an integer string to a 64-bit float. */\ndeclare function parseInt(str: string, radix?: i32): f64;\n/** Parses an integer string to a 32-bit integer. */\ndeclare function parseI32(str: string, radix?: i32): i32;\n/** Parses an integer string to a 64-bit integer. */\ndeclare function parseI64(str: string, radix?: i32): i64;\n/** Parses a string to a 64-bit float. */\ndeclare function parseFloat(str: string): f64;\n/** Returns the 64-bit floating-point remainder of `x/y`. */\ndeclare function fmod(x: f64, y: f64): f64;\n/** Returns the 32-bit floating-point remainder of `x/y`. */\ndeclare function fmodf(x: f32, y: f32): f32;\n\n/** Atomic operations. */\ndeclare namespace atomic {\n /** Atomically loads an integer value from memory and returns it. */\n export function load(offset: usize, immOffset?: usize): T;\n /** Atomically stores an integer value to memory. */\n export function store(offset: usize, value: T, immOffset?: usize): void;\n /** Atomically adds an integer value in memory. */\n export function add(ptr: usize, value: T, immOffset?: usize): T;\n /** Atomically subtracts an integer value in memory. */\n export function sub(ptr: usize, value: T, immOffset?: usize): T;\n /** Atomically performs a bitwise AND operation on an integer value in memory. */\n export function and(ptr: usize, value: T, immOffset?: usize): T;\n /** Atomically performs a bitwise OR operation on an integer value in memory. */\n export function or(ptr: usize, value: T, immOffset?: usize): T;\n /** Atomically performs a bitwise XOR operation on an integer value in memory. */\n export function xor(ptr: usize, value: T, immOffset?: usize): T;\n /** Atomically exchanges an integer value in memory. */\n export function xchg(ptr: usize, value: T, immOffset?: usize): T;\n /** Atomically compares and exchanges an integer value in memory if the condition is met. */\n export function cmpxchg(ptr: usize, expected: T, replacement: T, immOffset?: usize): T;\n /** Performs a wait operation on an address in memory suspending this agent if the integer condition is met. */\n export function wait(ptr: usize, expected: T, timeout: i64): AtomicWaitResult;\n /** Performs a notify operation on an address in memory waking up suspended agents. */\n export function notify(ptr: usize, count: i32): i32;\n}\n\n/** Describes the result of an atomic wait operation. */\ndeclare enum AtomicWaitResult {\n /** Woken by another agent. */\n OK,\n /** Loaded value did not match the expected value. */\n NOT_EQUAL,\n /** Not woken before the timeout expired. */\n TIMED_OUT\n}\n\n/** Converts any other numeric value to an 8-bit signed integer. */\ndeclare function i8(value: any): i8;\ndeclare namespace i8 {\n /** Smallest representable value. */\n export const MIN_VALUE: i8;\n /** Largest representable value. */\n export const MAX_VALUE: i8;\n}\n/** Converts any other numeric value to a 16-bit signed integer. */\ndeclare function i16(value: any): i8;\ndeclare namespace i16 {\n /** Smallest representable value. */\n export const MIN_VALUE: i16;\n /** Largest representable value. */\n export const MAX_VALUE: i16;\n}\n/** Converts any other numeric value to a 32-bit signed integer. */\ndeclare function i32(value: any): i32;\ndeclare namespace i32 {\n /** Smallest representable value. */\n export const MIN_VALUE: i32;\n /** Largest representable value. */\n export const MAX_VALUE: i32;\n /** Loads an 8-bit signed integer value from memory and returns it as a 32-bit integer. */\n export function load8_s(offset: usize, immOffset?: usize, immAlign?: usize): i32;\n /** Loads an 8-bit unsigned integer value from memory and returns it as a 32-bit integer. */\n export function load8_u(offset: usize, immOffset?: usize, immAlign?: usize): i32;\n /** Loads a 16-bit signed integer value from memory and returns it as a 32-bit integer. */\n export function load16_s(offset: usize, immOffset?: usize, immAlign?: usize): i32;\n /** Loads a 16-bit unsigned integer value from memory and returns it as a 32-bit integer. */\n export function load16_u(offset: usize, immOffset?: usize, immAlign?: usize): i32;\n /** Loads a 32-bit integer value from memory. */\n export function load(offset: usize, immOffset?: usize, immAlign?: usize): i32;\n /** Stores a 32-bit integer value to memory as an 8-bit integer. */\n export function store8(offset: usize, value: i32, immOffset?: usize, immAlign?: usize): void;\n /** Stores a 32-bit integer value to memory as a 16-bit integer. */\n export function store16(offset: usize, value: i32, immOffset?: usize, immAlign?: usize): void;\n /** Stores a 32-bit integer value to memory. */\n export function store(offset: usize, value: i32, immOffset?: usize, immAlign?: usize): void;\n /** Atomic 32-bit integer operations. */\n export namespace atomic {\n /** Atomically loads an 8-bit unsigned integer value from memory and returns it as a 32-bit integer. */\n export function load8_u(offset: usize, immOffset?: usize): i32;\n /** Atomically loads a 16-bit unsigned integer value from memory and returns it as a 32-bit integer. */\n export function load16_u(offset: usize, immOffset?: usize): i32;\n /** Atomically loads a 32-bit integer value from memory and returns it. */\n export function load(offset: usize, immOffset?: usize): i32;\n /** Atomically stores a 32-bit integer value to memory as an 8-bit integer. */\n export function store8(offset: usize, value: i32, immOffset?: usize): void;\n /** Atomically stores a 32-bit integer value to memory as a 16-bit integer. */\n export function store16(offset: usize, value: i32, immOffset?: usize): void;\n /** Atomically stores a 32-bit integer value to memory. */\n export function store(offset: usize, value: i32, immOffset?: usize): void;\n /** Performs a wait operation on a 32-bit integer value in memory suspending this agent if the condition is met. */\n export function wait(ptr: usize, expected: i32, timeout: i64): AtomicWaitResult;\n /** Atomic 32-bit integer read-modify-write operations on 8-bit values. */\n export namespace rmw8 {\n /** Atomically adds an 8-bit unsigned integer value in memory. */\n export function add_u(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically subtracts an 8-bit unsigned integer value in memory. */\n export function sub_u(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically performs a bitwise AND operation an 8-bit unsigned integer value in memory. */\n export function and_u(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically performs a bitwise OR operation an 8-bit unsigned integer value in memory. */\n export function or_u(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically performs a bitwise XOR operation an 8-bit unsigned integer value in memory. */\n export function xor_u(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically exchanges an 8-bit unsigned integer value in memory. */\n export function xchg_u(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically compares and exchanges an 8-bit unsigned integer value in memory if the condition is met. */\n export function cmpxchg_u(offset: usize, expected: i32, replacement: i32, immOffset?: usize): i32;\n }\n /** Atomic 32-bit integer read-modify-write operations on 16-bit values. */\n export namespace rmw16 {\n /** Atomically adds a 16-bit unsigned integer value in memory. */\n export function add_u(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically adds a 16-bit unsigned integer value in memory. */\n export function sub_u(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically performs a bitwise AND operation a 16-bit unsigned integer value in memory. */\n export function and_u(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically performs a bitwise OR operation a 16-bit unsigned integer value in memory. */\n export function or_u(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically performs a bitwise XOR operation a 16-bit unsigned integer value in memory. */\n export function xor_u(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically exchanges a 16-bit unsigned integer value in memory. */\n export function xchg_u(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically compares and exchanges a 16-bit unsigned integer value in memory if the condition is met. */\n export function cmpxchg_u(offset: usize, expected: i32, replacement: i32, immOffset?: usize): i32;\n }\n /** Atomic 32-bit integer read-modify-write operations. */\n export namespace rmw {\n /** Atomically adds a 32-bit integer value in memory. */\n export function add(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically subtracts a 32-bit integer value in memory. */\n export function sub(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically performs a bitwise AND operation a 32-bit integer value in memory. */\n export function and(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically performs a bitwise OR operation a 32-bit integer value in memory. */\n export function or(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically performs a bitwise XOR operation a 32-bit integer value in memory. */\n export function xor(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically exchanges a 32-bit integer value in memory. */\n export function xchg(offset: usize, value: i32, immOffset?: usize): i32;\n /** Atomically compares and exchanges a 32-bit integer value in memory if the condition is met. */\n export function cmpxchg(offset: usize, expected: i32, replacement: i32, immOffset?: usize): i32;\n }\n }\n}\n/** Converts any other numeric value to a 64-bit signed integer. */\ndeclare function i64(value: any): i64;\ndeclare namespace i64 {\n /** Smallest representable value. */\n export const MIN_VALUE: i64;\n /** Largest representable value. */\n export const MAX_VALUE: i64;\n /** Loads an 8-bit signed integer value from memory and returns it as a 64-bit integer. */\n export function load8_s(offset: usize, immOffset?: usize, immAlign?: usize): i64;\n /** Loads an 8-bit unsigned integer value from memory and returns it as a 64-bit integer. */\n export function load8_u(offset: usize, immOffset?: usize, immAlign?: usize): i64;\n /** Loads a 16-bit signed integer value from memory and returns it as a 64-bit integer. */\n export function load16_s(offset: usize, immOffset?: usize, immAlign?: usize): i64;\n /** Loads a 16-bit unsigned integer value from memory and returns it as a 64-bit integer. */\n export function load16_u(offset: usize, immOffset?: usize, immAlign?: usize): i64;\n /** Loads a 32-bit signed integer value from memory and returns it as a 64-bit integer. */\n export function load32_s(offset: usize, immOffset?: usize, immAlign?: usize): i64;\n /** Loads a 32-bit unsigned integer value from memory and returns it as a 64-bit integer. */\n export function load32_u(offset: usize, immOffset?: usize, immAlign?: usize): i64;\n /** Loads a 64-bit unsigned integer value from memory. */\n export function load(offset: usize, immOffset?: usize, immAlign?: usize): i64;\n /** Stores a 64-bit integer value to memory as an 8-bit integer. */\n export function store8(offset: usize, value: i64, immOffset?: usize, immAlign?: usize): void;\n /** Stores a 64-bit integer value to memory as a 16-bit integer. */\n export function store16(offset: usize, value: i64, immOffset?: usize, immAlign?: usize): void;\n /** Stores a 64-bit integer value to memory as a 32-bit integer. */\n export function store32(offset: usize, value: i64, immOffset?: usize, immAlign?: usize): void;\n /** Stores a 64-bit integer value to memory. */\n export function store(offset: usize, value: i64, immOffset?: usize, immAlign?: usize): void;\n /** Atomic 64-bit integer operations. */\n export namespace atomic {\n /** Atomically loads an 8-bit unsigned integer value from memory and returns it as a 64-bit integer. */\n export function load8_u(offset: usize, immOffset?: usize): i64;\n /** Atomically loads a 16-bit unsigned integer value from memory and returns it as a 64-bit integer. */\n export function load16_u(offset: usize, immOffset?: usize): i64;\n /** Atomically loads a 32-bit unsigned integer value from memory and returns it as a 64-bit integer. */\n export function load32_u(offset: usize, immOffset?: usize): i64;\n /** Atomically loads a 64-bit integer value from memory and returns it. */\n export function load(offset: usize, immOffset?: usize): i64;\n /** Atomically stores a 64-bit integer value to memory as an 8-bit integer. */\n export function store8(offset: usize, value: i64, immOffset?: usize): void;\n /** Atomically stores a 64-bit integer value to memory as a 16-bit integer. */\n export function store16(offset: usize, value: i64, immOffset?: usize): void;\n /** Atomically stores a 64-bit integer value to memory as a 32-bit integer. */\n export function store32(offset: usize, value: i64, immOffset?: usize): void;\n /** Atomically stores a 64-bit integer value to memory. */\n export function store(offset: usize, value: i64, immOffset?: usize): void;\n /** Performs a wait operation on a 64-bit integer value in memory suspending this agent if the condition is met. */\n export function wait(ptr: usize, expected: i64, timeout: i64): AtomicWaitResult;\n /** Atomic 64-bit integer read-modify-write operations on 8-bit values. */\n export namespace rmw8 {\n /** Atomically adds an 8-bit unsigned integer value in memory. */\n export function add_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically subtracts an 8-bit unsigned integer value in memory. */\n export function sub_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically performs a bitwise AND operation on an 8-bit unsigned integer value in memory. */\n export function and_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically performs a bitwise OR operation on an 8-bit unsigned integer value in memory. */\n export function or_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically performs a bitwise XOR operation on an 8-bit unsigned integer value in memory. */\n export function xor_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically exchanges an 8-bit unsigned integer value in memory. */\n export function xchg_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically compares and exchanges an 8-bit unsigned integer value in memory if the condition is met. */\n export function cmpxchg_u(offset: usize, expected: i64, replacement: i64, immOffset?: usize): i64;\n }\n /** Atomic 64-bit integer read-modify-write operations on 16-bit values. */\n export namespace rmw16 {\n /** Atomically adds a 16-bit unsigned integer value in memory. */\n export function add_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically subtracts a 16-bit unsigned integer value in memory. */\n export function sub_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically performs a bitwise AND operation on a 16-bit unsigned integer value in memory. */\n export function and_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically performs a bitwise OR operation on a 16-bit unsigned integer value in memory. */\n export function or_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically performs a bitwise XOR operation on a 16-bit unsigned integer value in memory. */\n export function xor_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically exchanges a 16-bit unsigned integer value in memory. */\n export function xchg_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically compares and exchanges a 16-bit unsigned integer value in memory if the condition is met. */\n export function cmpxchg_u(offset: usize, expected: i64, replacement: i64, immOffset?: usize): i64;\n }\n /** Atomic 64-bit integer read-modify-write operations on 32-bit values. */\n export namespace rmw32 {\n /** Atomically adds a 32-bit unsigned integer value in memory. */\n export function add_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically subtracts a 32-bit unsigned integer value in memory. */\n export function sub_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically performs a bitwise AND operation on a 32-bit unsigned integer value in memory. */\n export function and_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically performs a bitwise OR operation on a 32-bit unsigned integer value in memory. */\n export function or_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically performs a bitwise XOR operation on a 32-bit unsigned integer value in memory. */\n export function xor_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically exchanges a 32-bit unsigned integer value in memory. */\n export function xchg_u(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically compares and exchanges a 32-bit unsigned integer value in memory if the condition is met. */\n export function cmpxchg_u(offset: usize, expected: i64, replacement: i64, immOffset?: usize): i64;\n }\n /** Atomic 64-bit integer read-modify-write operations. */\n export namespace rmw {\n /** Atomically adds a 64-bit integer value in memory. */\n export function add(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically subtracts a 64-bit integer value in memory. */\n export function sub(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically performs a bitwise AND operation on a 64-bit integer value in memory. */\n export function and(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically performs a bitwise OR operation on a 64-bit integer value in memory. */\n export function or(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically performs a bitwise XOR operation on a 64-bit integer value in memory. */\n export function xor(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically exchanges a 64-bit integer value in memory. */\n export function xchg(offset: usize, value: i64, immOffset?: usize): i64;\n /** Atomically compares and exchanges a 64-bit integer value in memory if the condition is met. */\n export function cmpxchg(offset: usize, expected: i64, replacement: i64, immOffset?: usize): i64;\n }\n }\n}\n/** Converts any other numeric value to a 32-bit (in WASM32) respectivel 64-bit (in WASM64) signed integer. */\ndeclare var isize: typeof i32 | typeof i64;\n/** Converts any other numeric value to an 8-bit unsigned integer. */\ndeclare function u8(value: any): i8;\ndeclare namespace u8 {\n /** Smallest representable value. */\n export const MIN_VALUE: u8;\n /** Largest representable value. */\n export const MAX_VALUE: u8;\n}\n/** Converts any other numeric value to a 16-bit unsigned integer. */\ndeclare function u16(value: any): i8;\ndeclare namespace u16 {\n /** Smallest representable value. */\n export const MIN_VALUE: u16;\n /** Largest representable value. */\n export const MAX_VALUE: u16;\n}\n/** Converts any other numeric value to a 32-bit unsigned integer. */\ndeclare function u32(value: any): i32;\ndeclare namespace u32 {\n /** Smallest representable value. */\n export const MIN_VALUE: u32;\n /** Largest representable value. */\n export const MAX_VALUE: u32;\n}\n/** Converts any other numeric value to a 64-bit unsigned integer. */\ndeclare function u64(value: any): i64;\ndeclare namespace u64 {\n /** Smallest representable value. */\n export const MIN_VALUE: u64;\n /** Largest representable value. */\n export const MAX_VALUE: u64;\n}\n/** Converts any other numeric value to a 32-bit (in WASM32) respectivel 64-bit (in WASM64) unsigned integer. */\ndeclare var usize: typeof u32 | typeof u64;\n/** Converts any other numeric value to a 1-bit unsigned integer. */\ndeclare function bool(value: any): bool;\ndeclare namespace bool {\n /** Smallest representable value. */\n export const MIN_VALUE: bool;\n /** Largest representable value. */\n export const MAX_VALUE: bool;\n}\n/** Converts any other numeric value to a 32-bit float. */\ndeclare function f32(value: any): f32;\ndeclare namespace f32 {\n /** Smallest representable value. */\n export const MIN_VALUE: f32;\n /** Largest representable value. */\n export const MAX_VALUE: f32;\n /** Smallest normalized positive value. */\n export const MIN_POSITIVE_VALUE: f32;\n /** Smallest safely representable integer value. */\n export const MIN_SAFE_INTEGER: f32;\n /** Largest safely representable integer value. */\n export const MAX_SAFE_INTEGER: f32;\n /** Difference between 1 and the smallest representable value greater than 1. */\n export const EPSILON: f32;\n /** Loads a 32-bit float from memory. */\n export function load(offset: usize, immOffset?: usize, immAlign?: usize): f32;\n /** Stores a 32-bit float to memory. */\n export function store(offset: usize, value: f32, immOffset?: usize, immAlign?: usize): void;\n}\n/** Converts any other numeric value to a 64-bit float. */\ndeclare function f64(value: any): f64;\ndeclare namespace f64 {\n /** Smallest representable value. */\n export const MIN_VALUE: f64;\n /** Largest representable value. */\n export const MAX_VALUE: f64;\n /** Smallest normalized positive value. */\n export const MIN_POSITIVE_VALUE: f64;\n /** Smallest safely representable integer value. */\n export const MIN_SAFE_INTEGER: f64;\n /** Largest safely representable integer value. */\n export const MAX_SAFE_INTEGER: f64;\n /** Difference between 1 and the smallest representable value greater than 1. */\n export const EPSILON: f64;\n /** Loads a 64-bit float from memory. */\n export function load(offset: usize, immOffset?: usize, immAlign?: usize): f64;\n /** Stores a 64-bit float to memory. */\n export function store(offset: usize, value: f64, immOffset?: usize, immAlign?: usize): void;\n}\n/** Initializes a 128-bit vector from sixteen 8-bit integer values. Arguments must be compile-time constants. */\ndeclare function v128(a: i8, b: i8, c: i8, d: i8, e: i8, f: i8, g: i8, h: i8, i: i8, j: i8, k: i8, l: i8, m: i8, n: i8, o: i8, p: i8): v128;\ndeclare namespace v128 {\n /** Creates a 128-bit vector with identical lanes. */\n export function splat(x: T): v128;\n /** Extracts one lane from a 128-bit vector as a scalar. */\n export function extract_lane(x: v128, idx: u8): T;\n /** Replaces one lane in a 128-bit vector. */\n export function replace_lane(x: v128, idx: u8, value: T): v128;\n /** Selects lanes from either 128-bit vector according to the specified lane indexes. */\n export function shuffle(a: v128, b: v128, ...lanes: u8[]): v128;\n /** Loads a 128-bit vector from memory. */\n export function load(offset: usize, immOffset?: usize, immAlign?: usize): v128;\n /** Stores a 128-bit vector to memory. */\n export function store(offset: usize, value: v128, immOffset?: usize, immAlign?: usize): void;\n /** Adds each lane of two 128-bit vectors. */\n export function add(a: v128, b: v128): v128;\n /** Subtracts each lane of two 128-bit vectors. */\n export function sub(a: v128, b: v128): v128;\n /** Multiplies each lane of two 128-bit vectors. */\n export function mul(a: v128, b: v128): v128; // except i64\n /** Divides each lane of two 128-bit vectors. */\n export function div(a: v128, b: v128): v128;\n /** Negates each lane of a 128-bit vector. */\n export function neg(a: v128): v128;\n /** Adds each lane of two 128-bit vectors using saturation. */\n export function add_saturate(a: v128, b: v128): v128;\n /** Subtracts each lane of two 128-bit vectors using saturation. */\n export function sub_saturate(a: v128, b: v128): v128;\n /** Performs a bitwise left shift on each lane of a 128-bit vector by a scalar. */\n export function shl(a: v128, b: i32): v128;\n /** Performs a bitwise right shift on each lane of a 128-bit vector by a scalar. */\n export function shr(a: v128, b: i32): v128;\n /** Performs the bitwise AND operation on each lane of two 128-bit vectors. */\n export function and(a: v128, b: v128): v128;\n /** Performs the bitwise OR operation on each lane of two 128-bit vectors. */\n export function or(a: v128, b: v128): v128;\n /** Performs the bitwise XOR operation on each lane of two 128-bit vectors. */\n export function xor(a: v128, b: v128): v128;\n /** Performs the bitwise NOT operation on each lane of a 128-bit vector. */\n export function not(a: v128): v128;\n /** Selects bits of either 128-bit vector according to the specified mask. */\n export function bitselect(v1: v128, v2: v128, mask: v128): v128;\n /** Reduces a 128-bit vector to a scalar indicating whether any lane is considered `true`. */\n export function any_true(a: v128): bool;\n /** Reduces a 128-bit vector to a scalar indicating whether all lanes are considered `true`. */\n export function all_true(a: v128): bool;\n /** Computes the minimum of each lane of two 128-bit vectors. */\n export function min(a: v128, b: v128): v128;\n /** Computes the maximum of each lane of two 128-bit vectors. */\n export function max(a: v128, b: v128): v128;\n /** Computes the absolute value of each lane of a 128-bit vector. */\n export function abs(a: v128): v128;\n /** Computes the square root of each lane of a 128-bit vector. */\n export function sqrt(a: v128): v128;\n /** Computes which lanes of two 128-bit vectors are equal. */\n export function eq(a: v128, b: v128): v128;\n /** Computes which lanes of two 128-bit vectors are not equal. */\n export function ne(a: v128, b: v128): v128;\n /** Computes which lanes of the first 128-bit vector are less than those of the second. */\n export function lt(a: v128, b: v128): v128;\n /** Computes which lanes of the first 128-bit vector are less than or equal those of the second. */\n export function le(a: v128, b: v128): v128;\n /** Computes which lanes of the first 128-bit vector are greater than those of the second. */\n export function gt(a: v128, b: v128): v128;\n /** Computes which lanes of the first 128-bit vector are greater than or equal those of the second. */\n export function ge(a: v128, b: v128): v128;\n /** Converts each lane of a 128-bit vector from integer to floating point. */\n export function convert(a: v128): v128;\n /** Truncates each lane of a 128-bit vector from floating point to integer with saturation. */\n export function trunc(a: v128): v128;\n}\n/** Initializes a 128-bit vector from sixteen 8-bit integer values. Arguments must be compile-time constants. */\ndeclare function i8x16(a: i8, b: i8, c: i8, d: i8, e: i8, f: i8, g: i8, h: i8, i: i8, j: i8, k: i8, l: i8, m: i8, n: i8, o: i8, p: i8): v128;\ndeclare namespace i8x16 {\n /** Creates a vector with sixteen identical 8-bit integer lanes. */\n export function splat(x: i8): v128;\n /** Extracts one 8-bit integer lane from a 128-bit vector as a signed scalar. */\n export function extract_lane_s(x: v128, idx: u8): i8;\n /** Extracts one 8-bit integer lane from a 128-bit vector as an unsigned scalar. */\n export function extract_lane_u(x: v128, idx: u8): u8;\n /** Replaces one 8-bit integer lane in a 128-bit vector. */\n export function replace_lane(x: v128, idx: u8, value: i8): v128;\n /** Adds each 8-bit integer lane of two 128-bit vectors. */\n export function add(a: v128, b: v128): v128;\n /** Subtracts each 8-bit integer lane of two 128-bit vectors. */\n export function sub(a: v128, b: v128): v128;\n /** Multiplies each 8-bit integer lane of two 128-bit vectors. */\n export function mul(a: v128, b: v128): v128;\n /** Negates each 8-bit integer lane of a 128-bit vector. */\n export function neg(a: v128): v128;\n /** Adds each 8-bit integer lane of two 128-bit vectors using signed saturation. */\n export function add_saturate_s(a: v128, b: v128): v128;\n /** Adds each 8-bit integer lane of two 128-bit vectors using unsigned saturation. */\n export function add_saturate_u(a: v128, b: v128): v128;\n /** Subtracts each 8-bit integer lane of two 128-bit vectors using signed saturation. */\n export function sub_saturate_s(a: v128, b: v128): v128;\n /** Subtracts each 8-bit integer lane of two 128-bit vectors using unsigned saturation. */\n export function sub_saturate_u(a: v128, b: v128): v128;\n /** Performs a bitwise left shift on each 8-bit integer lane of a 128-bit vector by a scalar. */\n export function shl(a: v128, b: i32): v128;\n /** Performs a bitwise arithmetic right shift on each 8-bit integer lane of a 128-bit vector by a scalar. */\n export function shr_s(a: v128, b: i32): v128;\n /** Performs a bitwise logical right shift on each 8-bit integer lane of a 128-bit vector by a scalar. */\n export function shr_u(a: v128, b: i32): v128;\n /** Reduces a 128-bit vector to a scalar indicating whether any 8-bit integer lane is considered `true`. */\n export function any_true(a: v128): bool;\n /** Reduces a 128-bit vector to a scalar indicating whether all 8-bit integer lanes are considered `true`. */\n export function all_true(a: v128): bool;\n /** Computes which 8-bit integer lanes of two 128-bit vectors are equal. */\n export function eq(a: v128, b: v128): v128;\n /** Computes which 8-bit integer lanes of two 128-bit vectors are not equal. */\n export function ne(a: v128, b: v128): v128;\n /** Computes which 8-bit signed integer lanes of the first 128-bit vector are less than those of the second. */\n export function lt_s(a: v128, b: v128): v128;\n /** Computes which 8-bit unsigned integer lanes of the first 128-bit vector are less than those of the second. */\n export function lt_u(a: v128, b: v128): v128;\n /** Computes which 8-bit signed integer lanes of the first 128-bit vector are less than or equal those of the second. */\n export function le_s(a: v128, b: v128): v128;\n /** Computes which 8-bit unsigned integer lanes of the first 128-bit vector are less than or equal those of the second. */\n export function le_u(a: v128, b: v128): v128;\n /** Computes which 8-bit signed integer lanes of the first 128-bit vector are greater than those of the second. */\n export function gt_s(a: v128, b: v128): v128;\n /** Computes which 8-bit unsigned integer lanes of the first 128-bit vector are greater than those of the second. */\n export function gt_u(a: v128, b: v128): v128;\n /** Computes which 8-bit signed integer lanes of the first 128-bit vector are greater than or equal those of the second. */\n export function ge_s(a: v128, b: v128): v128;\n /** Computes which 8-bit unsigned integer lanes of the first 128-bit vector are greater than or equal those of the second. */\n export function ge_u(a: v128, b: v128): v128;\n}\n/** Initializes a 128-bit vector from eight 16-bit integer values. Arguments must be compile-time constants. */\ndeclare function i16x8(a: i16, b: i16, c: i16, d: i16, e: i16, f: i16, g: i16, h: i16): v128;\ndeclare namespace i16x8 {\n /** Creates a vector with eight identical 16-bit integer lanes. */\n export function splat(x: i16): v128;\n /** Extracts one 16-bit integer lane from a 128-bit vector as a signed scalar. */\n export function extract_lane_s(x: v128, idx: u8): i16;\n /** Extracts one 16-bit integer lane from a 128-bit vector as an unsigned scalar. */\n export function extract_lane_u(x: v128, idx: u8): u16;\n /** Replaces one 16-bit integer lane in a 128-bit vector. */\n export function replace_lane(x: v128, idx: u8, value: i16): v128;\n /** Adds each 16-bit integer lane of two 128-bit vectors. */\n export function add(a: v128, b: v128): v128;\n /** Subtracts each 16-bit integer lane of two 128-bit vectors. */\n export function sub(a: v128, b: v128): v128;\n /** Multiplies each 16-bit integer lane of two 128-bit vectors. */\n export function mul(a: v128, b: v128): v128;\n /** Negates each 16-bit integer lane of a 128-bit vector. */\n export function neg(a: v128): v128;\n /** Adds each 16-bit integer lane of two 128-bit vectors using signed saturation. */\n export function add_saturate_s(a: v128, b: v128): v128;\n /** Adds each 16-bit integer lane of two 128-bit vectors using unsigned saturation. */\n export function add_saturate_u(a: v128, b: v128): v128;\n /** Subtracts each 16-bit integer lane of two 128-bit vectors using signed saturation. */\n export function sub_saturate_s(a: v128, b: v128): v128;\n /** Subtracts each 16-bit integer lane of two 128-bit vectors using unsigned saturation. */\n export function sub_saturate_u(a: v128, b: v128): v128;\n /** Performs a bitwise left shift on each 16-bit integer lane of a 128-bit vector by a scalar. */\n export function shl(a: v128, b: i32): v128;\n /** Performs a bitwise arithmetic right shift each 16-bit integer lane of a 128-bit vector by a scalar. */\n export function shr_s(a: v128, b: i32): v128;\n /** Performs a bitwise logical right shift on each 16-bit integer lane of a 128-bit vector by a scalar. */\n export function shr_u(a: v128, b: i32): v128;\n /** Reduces a 128-bit vector to a scalar indicating whether any 16-bit integer lane is considered `true`. */\n export function any_true(a: v128): bool;\n /** Reduces a 128-bit vector to a scalar indicating whether all 16-bit integer lanes are considered `true`. */\n export function all_true(a: v128): bool;\n /** Computes which 16-bit integer lanes of two 128-bit vectors are equal. */\n export function eq(a: v128, b: v128): v128;\n /** Computes which 16-bit integer lanes of two 128-bit vectors are not equal. */\n export function ne(a: v128, b: v128): v128;\n /** Computes which 16-bit signed integer lanes of the first 128-bit vector are less than those of the second. */\n export function lt_s(a: v128, b: v128): v128;\n /** Computes which 16-bit unsigned integer lanes of the first 128-bit vector are less than those of the second. */\n export function lt_u(a: v128, b: v128): v128;\n /** Computes which 16-bit signed integer lanes of the first 128-bit vector are less than or equal those of the second. */\n export function le_s(a: v128, b: v128): v128;\n /** Computes which 16-bit unsigned integer lanes of the first 128-bit vector are less than or equal those of the second. */\n export function le_u(a: v128, b: v128): v128;\n /** Computes which 16-bit signed integer lanes of the first 128-bit vector are greater than those of the second. */\n export function gt_s(a: v128, b: v128): v128;\n /** Computes which 16-bit unsigned integer lanes of the first 128-bit vector are greater than those of the second. */\n export function gt_u(a: v128, b: v128): v128;\n /** Computes which 16-bit signed integer lanes of the first 128-bit vector are greater than or equal those of the second. */\n export function ge_s(a: v128, b: v128): v128;\n /** Computes which 16-bit unsigned integer lanes of the first 128-bit vector are greater than or equal those of the second. */\n export function ge_u(a: v128, b: v128): v128;\n}\n/** Initializes a 128-bit vector from four 32-bit integer values. Arguments must be compile-time constants. */\ndeclare function i32x4(a: i32, b: i32, c: i32, d: i32): v128;\ndeclare namespace i32x4 {\n /** Creates a 128-bit vector with four identical 32-bit integer lanes. */\n export function splat(x: i32): v128;\n /** Extracts one 32-bit integer lane from a 128-bit vector as a scalar. */\n export function extract_lane(x: v128, idx: u8): i32;\n /** Replaces one 32-bit integer lane in a 128-bit vector. */\n export function replace_lane(x: v128, idx: u8, value: i32): v128;\n /** Adds each 32-bit integer lane of two 128-bit vectors. */\n export function add(a: v128, b: v128): v128;\n /** Subtracts each 32-bit integer lane of two 128-bit vectors. */\n export function sub(a: v128, b: v128): v128;\n /** Multiplies each 32-bit integer lane of two 128-bit vectors. */\n export function mul(a: v128, b: v128): v128;\n /** Negates each 32-bit integer lane of a 128-bit vector. */\n export function neg(a: v128): v128;\n /** Performs a bitwise left shift on each 32-bit integer lane of a 128-bit vector by a scalar. */\n export function shl(a: v128, b: i32): v128;\n /** Performs a bitwise arithmetic right shift on each 32-bit integer lane of a 128-bit vector by a scalar. */\n export function shr_s(a: v128, b: i32): v128;\n /** Performs a bitwise logical right shift on each 32-bit integer lane of a 128-bit vector by a scalar. */\n export function shr_u(a: v128, b: i32): v128;\n /** Reduces a 128-bit vector to a scalar indicating whether any 32-bit integer lane is considered `true`. */\n export function any_true(a: v128): bool;\n /** Reduces a 128-bit vector to a scalar indicating whether all 32-bit integer lanes are considered `true`. */\n export function all_true(a: v128): bool;\n /** Computes which 32-bit integer lanes of two 128-bit vectors are equal. */\n export function eq(a: v128, b: v128): v128;\n /** Computes which 32-bit integer lanes of two 128-bit vectors are not equal. */\n export function ne(a: v128, b: v128): v128;\n /** Computes which 32-bit signed integer lanes of the first 128-bit vector are less than those of the second. */\n export function lt_s(a: v128, b: v128): v128;\n /** Computes which 32-bit unsigned integer lanes of the first 128-bit vector are less than those of the second. */\n export function lt_u(a: v128, b: v128): v128;\n /** Computes which 32-bit signed integer lanes of the first 128-bit vector are less than or equal those of the second. */\n export function le_s(a: v128, b: v128): v128;\n /** Computes which 32-bit unsigned integer lanes of the first 128-bit vector are less than or equal those of the second. */\n export function le_u(a: v128, b: v128): v128;\n /** Computes which 32-bit signed integer lanes of the first 128-bit vector are greater than those of the second. */\n export function gt_s(a: v128, b: v128): v128;\n /** Computes which 32-bit unsigned integer lanes of the first 128-bit vector are greater than those of the second. */\n export function gt_u(a: v128, b: v128): v128;\n /** Computes which 32-bit signed integer lanes of the first 128-bit vector are greater than or equal those of the second. */\n export function ge_s(a: v128, b: v128): v128;\n /** Computes which 32-bit unsigned integer lanes of the first 128-bit vector are greater than or equal those of the second. */\n export function ge_u(a: v128, b: v128): v128;\n /** Truncates each 32-bit float lane of a 128-bit vector to a signed integer with saturation. */\n export function trunc_s_f32x4_sat(a: v128): v128;\n /** Truncates each 32-bit float lane of a 128-bit vector to an unsigned integer with saturation. */\n export function trunc_u_f32x4_sat(a: v128): v128;\n}\n/** Initializes a 128-bit vector from two 64-bit integer values. Arguments must be compile-time constants. */\ndeclare function i64x2(a: i64, b: i64): v128;\ndeclare namespace i64x2 {\n /** Creates a 128-bit vector with two identical 64-bit integer lanes. */\n export function splat(x: i64): v128;\n /** Extracts one 64-bit integer lane from a 128-bit vector as a scalar. */\n export function extract_lane(x: v128, idx: u8): i64;\n /** Replaces one 64-bit integer lane in a 128-bit vector. */\n export function replace_lane(x: v128, idx: u8, value: i64): v128;\n /** Adds each 64-bit integer lane of two 128-bit vectors. */\n export function add(a: v128, b: v128): v128;\n /** Subtracts each 64-bit integer lane of two 128-bit vectors. */\n export function sub(a: v128, b: v128): v128;\n /** Multiplies each 64-bit integer lane of two 128-bit vectors. */\n export function mul(a: v128, b: v128): v128;\n /** Negates each 64-bit integer lane of a 128-bit vector. */\n export function neg(a: v128): v128;\n /** Performs a bitwise left shift on each 64-bit integer lane of a 128-bit vector by a scalar. */\n export function shl(a: v128, b: i32): v128;\n /** Performs a bitwise arithmetic right shift on each 64-bit integer lane of a 128-bit vector by a scalar. */\n export function shr_s(a: v128, b: i32): v128;\n /** Performs a bitwise logical right shift on each 64-bit integer lane of a 128-bit vector by a scalar. */\n export function shr_u(a: v128, b: i32): v128;\n /** Reduces a 128-bit vector to a scalar indicating whether any 64-bit integer lane is considered `true`. */\n export function any_true(a: v128): bool;\n /** Reduces a 128-bit vector to a scalar indicating whether all 64-bit integer lanes are considered `true`. */\n export function all_true(a: v128): bool;\n /** Truncates each 64-bit float lane of a 128-bit vector to a signed integer with saturation. */\n export function trunc_s_f64x2_sat(a: v128): v128;\n /** Truncates each 64-bit float lane of a 128-bit vector to an unsigned integer with saturation. */\n export function trunc_u_f64x2_sat(a: v128): v128;\n}\n/** Initializes a 128-bit vector from four 32-bit float values. Arguments must be compile-time constants. */\ndeclare function f32x4(a: f32, b: f32, c: f32, d: f32): v128;\ndeclare namespace f32x4 {\n /** Creates a 128-bit vector with four identical 32-bit float lanes. */\n export function splat(x: f32): v128;\n /** Extracts one 32-bit float lane from a 128-bit vector as a scalar. */\n export function extract_lane(x: v128, idx: u8): f32;\n /** Replaces one 32-bit float lane in a 128-bit vector. */\n export function replace_lane(x: v128, idx: u8, value: f32): v128;\n /** Adds each 32-bit float lane of two 128-bit vectors. */\n export function add(a: v128, b: v128): v128;\n /** Subtracts each 32-bit float lane of two 128-bit vectors. */\n export function sub(a: v128, b: v128): v128;\n /** Multiplies each 32-bit float lane of two 128-bit vectors. */\n export function mul(a: v128, b: v128): v128;\n /** Divides each 32-bit float lane of two 128-bit vectors. */\n export function div(a: v128, b: v128): v128;\n /** Negates each 32-bit float lane of a 128-bit vector. */\n export function neg(a: v128): v128;\n /** Computes the minimum of each 32-bit float lane of two 128-bit vectors. */\n export function min(a: v128, b: v128): v128;\n /** Computes the maximum of each 32-bit float lane of two 128-bit vectors. */\n export function max(a: v128, b: v128): v128;\n /** Computes the absolute value of each 32-bit float lane of a 128-bit vector. */\n export function abs(a: v128): v128;\n /** Computes the square root of each 32-bit float lane of a 128-bit vector. */\n export function sqrt(a: v128): v128;\n /** Computes which 32-bit float lanes of two 128-bit vectors are equal. */\n export function eq(a: v128, b: v128): v128;\n /** Computes which 32-bit float lanes of two 128-bit vectors are not equal. */\n export function ne(a: v128, b: v128): v128;\n /** Computes which 32-bit float lanes of the first 128-bit vector are less than those of the second. */\n export function lt(a: v128, b: v128): v128;\n /** Computes which 32-bit float lanes of the first 128-bit vector are less than or equal those of the second. */\n export function le(a: v128, b: v128): v128;\n /** Computes which 32-bit float lanes of the first 128-bit vector are greater than those of the second. */\n export function gt(a: v128, b: v128): v128;\n /** Computes which 32-bit float lanes of the first 128-bit vector are greater than or equal those of the second. */\n export function ge(a: v128, b: v128): v128;\n /** Converts each 32-bit signed integer lane of a 128-bit vector to floating point. */\n export function convert_s_i32x4(a: v128): v128;\n /** Converts each 32-bit unsigned integer lane of a 128-bit vector to floating point. */\n export function convert_u_i32x4(a: v128): v128;\n}\n/** Initializes a 128-bit vector from two 64-bit float values. Arguments must be compile-time constants. */\ndeclare function f64x2(a: f64, b: f64): v128;\ndeclare namespace f64x2 {\n /** Creates a 128-bit vector with two identical 64-bit float lanes. */\n export function splat(x: f64): v128;\n /** Extracts one 64-bit float lane from a 128-bit vector as a scalar. */\n export function extract_lane(x: v128, idx: u8): f64;\n /** Replaces one 64-bit float lane in a 128-bit vector. */\n export function replace_lane(x: v128, idx: u8, value: f64): v128;\n /** Adds each 64-bit float lane of two 128-bit vectors. */\n export function add(a: v128, b: v128): v128;\n /** Subtracts each 64-bit float lane of two 128-bit vectors. */\n export function sub(a: v128, b: v128): v128;\n /** Multiplies each 64-bit float lane of two 128-bit vectors. */\n export function mul(a: v128, b: v128): v128;\n /** Divides each 64-bit float lane of two 128-bit vectors. */\n export function div(a: v128, b: v128): v128;\n /** Negates each 64-bit float lane of a 128-bit vector. */\n export function neg(a: v128): v128;\n /** Computes the minimum of each 64-bit float lane of two 128-bit vectors. */\n export function min(a: v128, b: v128): v128;\n /** Computes the maximum of each 64-bit float lane of two 128-bit vectors. */\n export function max(a: v128, b: v128): v128;\n /** Computes the absolute value of each 64-bit float lane of a 128-bit vector. */\n export function abs(a: v128): v128;\n /** Computes the square root of each 64-bit float lane of a 128-bit vector. */\n export function sqrt(a: v128): v128;\n /** Computes which 64-bit float lanes of two 128-bit vectors are equal. */\n export function eq(a: v128, b: v128): v128;\n /** Computes which 64-bit float lanes of two 128-bit vectors are not equal. */\n export function ne(a: v128, b: v128): v128;\n /** Computes which 64-bit float lanes of the first 128-bit vector are less than those of the second. */\n export function lt(a: v128, b: v128): v128;\n /** Computes which 64-bit float lanes of the first 128-bit vector are less than or equal those of the second. */\n export function le(a: v128, b: v128): v128;\n /** Computes which 64-bit float lanes of the first 128-bit vector are greater than those of the second. */\n export function gt(a: v128, b: v128): v128;\n /** Computes which 64-bit float lanes of the first 128-bit vector are greater than or equal those of the second. */\n export function ge(a: v128, b: v128): v128;\n /** Converts each 64-bit signed integer lane of a 128-bit vector to floating point. */\n export function convert_s_i64x2(a: v128): v128;\n /** Converts each 64-bit unsigned integer lane of a 128-bit vector to floating point. */\n export function convert_u_i64x2(a: v128): v128;\n}\ndeclare namespace v8x16 {\n /** Selects 8-bit lanes from either 128-bit vector according to the specified lane indexes. */\n export function shuffle(a: v128, b: v128, l0: u8, l1: u8, l2: u8, l3: u8, l4: u8, l5: u8, l6: u8, l7: u8, l8: u8, l9: u8, l10: u8, l11: u8, l12: u8, l13: u8, l14: u8, l15: u8): v128;\n}\n/** Macro type evaluating to the underlying native WebAssembly type. */\ndeclare type native = T;\n\n/** Pseudo-class representing the backing class of integer types. */\ndeclare class _Integer {\n /** Smallest representable value. */\n static readonly MIN_VALUE: number;\n /** Largest representable value. */\n static readonly MAX_VALUE: number;\n /** Converts a string to an integer of this type. */\n static parseInt(value: string, radix?: number): number;\n /** Converts this integer to a string. */\n toString(): string;\n}\n\n/** Pseudo-class representing the backing class of floating-point types. */\ndeclare class _Float {\n /** Difference between 1 and the smallest representable value greater than 1. */\n static readonly EPSILON: f32 | f64;\n /** Smallest representable value. */\n static readonly MIN_VALUE: f32 | f64;\n /** Largest representable value. */\n static readonly MAX_VALUE: f32 | f64;\n /** Smallest safely representable integer value. */\n static readonly MIN_SAFE_INTEGER: f32 | f64;\n /** Largest safely representable integer value. */\n static readonly MAX_SAFE_INTEGER: f32 | f64;\n /** Value representing positive infinity. */\n static readonly POSITIVE_INFINITY: f32 | f64;\n /** Value representing negative infinity. */\n static readonly NEGATIVE_INFINITY: f32 | f64;\n /** Value representing \'not a number\'. */\n static readonly NaN: f32 | f64;\n /** Returns a boolean value that indicates whether a value is the reserved value NaN (not a number). */\n static isNaN(value: f32 | f64): bool;\n /** Returns true if passed value is finite. */\n static isFinite(value: f32 | f64): bool;\n /** Returns true if the value passed is a safe integer. */\n static isSafeInteger(value: f32 | f64): bool;\n /** Returns true if the value passed is an integer, false otherwise. */\n static isInteger(value: f32 | f64): bool;\n /** Converts a string to an integer. */\n static parseInt(value: string, radix?: i32): f32 | f64;\n /** Converts a string to a floating-point number. */\n static parseFloat(value: string): f32 | f64;\n /** Converts this floating-point number to a string. */\n toString(this: f64): string;\n}\n\n/** Backing class of signed 8-bit integers. */\ndeclare const I8: typeof _Integer;\n/** Backing class of signed 16-bit integers. */\ndeclare const I16: typeof _Integer;\n/** Backing class of signed 32-bit integers. */\ndeclare const I32: typeof _Integer;\n/** Backing class of signed 64-bit integers. */\ndeclare const I64: typeof _Integer;\n/** Backing class of signed size integers. */\ndeclare const Isize: typeof _Integer;\n/** Backing class of unsigned 8-bit integers. */\ndeclare const U8: typeof _Integer;\n/** Backing class of unsigned 16-bit integers. */\ndeclare const U16: typeof _Integer;\n/** Backing class of unsigned 32-bit integers. */\ndeclare const U32: typeof _Integer;\n/** Backing class of unsigned 64-bit integers. */\ndeclare const U64: typeof _Integer;\n/** Backing class of unsigned size integers. */\ndeclare const Usize: typeof _Integer;\n/** Backing class of 32-bit floating-point values. */\ndeclare const F32: typeof _Float;\n/** Backing class of 64-bit floating-point values. */\ndeclare const F64: typeof _Float;\n\n// User-defined diagnostic macros\n\n/** Emits a user-defined diagnostic error when encountered. */\ndeclare function ERROR(message?: any): void;\n/** Emits a user-defined diagnostic warning when encountered. */\ndeclare function WARNING(message?: any): void;\n/** Emits a user-defined diagnostic info when encountered. */\ndeclare function INFO(message?: any): void;\n\n// Polyfills\n\n/** Performs the sign-agnostic reverse bytes **/\ndeclare function bswap(value: T): T;\n/** Performs the sign-agnostic reverse bytes only for last 16-bit **/\ndeclare function bswap16(value: T): T;\n\n// Standard library\n\n/** Memory operations. */\ndeclare namespace memory {\n /** Whether the memory managed interface is implemented. */\n export const implemented: bool;\n /** Returns the current memory size in units of pages. One page is 64kb. */\n export function size(): i32;\n /** Grows linear memory by a given unsigned delta of pages. One page is 64kb. Returns the previous memory size in units of pages or `-1` on failure. */\n export function grow(value: i32): i32;\n /** Sets n bytes beginning at the specified destination in memory to the specified byte value. */\n export function fill(dst: usize, value: u8, count: usize): void;\n /** Copies n bytes from the specified source to the specified destination in memory. These regions may overlap. */\n export function copy(dst: usize, src: usize, n: usize): void;\n /** Repeats `src` of length `srcLength` `count` times at `dst`. */\n export function repeat(dst: usize, src: usize, srcLength: usize, count: usize): void;\n /** Copies elements from a passive element segment to a table. */\n export function init(segmentIndex: u32, srcOffset: usize, dstOffset: usize, n: usize): void;\n /** Prevents further use of a passive element segment. */\n export function drop(segmentIndex: u32): void;\n /** Compares two chunks of memory. Returns `0` if equal, otherwise the difference of the first differing bytes. */\n export function compare(vl: usize, vr: usize, n: usize): i32;\n}\n\n/** Garbage collector operations. */\ndeclare namespace gc {\n /** Whether the garbage collector interface is implemented. */\n export const implemented: bool;\n /** Performs a full garbage collection cycle. */\n export function collect(): void;\n /** Retains a reference, making sure that it doesn\'t become collected. */\n export function retain(ref: usize): void;\n /** Releases a reference, allowing it to become collected. */\n export function release(ref: usize): void;\n}\n\n/** Table operations. */\ndeclare namespace table {\n /** Copies elements from a passive element segment to a table. */\n export function init(elementIndex: u32, srcOffset: u32, dstOffset: u32, n: u32): void;\n /** Prevents further use of a passive element segment. */\n export function drop(elementIndex: u32): void;\n /** Copies elements from one region of a table to another region. */\n export function copy(dest: u32, src: u32, n: u32): void;\n}\n\n/** Class representing a generic, fixed-length raw binary data buffer. */\ndeclare class ArrayBuffer {\n /** The size, in bytes, of the array. */\n readonly byteLength: i32;\n /** Returns true if value is one of the ArrayBuffer views, such as typed array or a DataView **/\n static isView(value: T): bool;\n /** Constructs a new array buffer of the given length in bytes. */\n constructor(length: i32);\n /** Returns a copy of this array buffer\'s bytes from begin, inclusive, up to end, exclusive. */\n slice(begin?: i32, end?: i32): ArrayBuffer;\n /** Returns a string representation of ArrayBuffer. */\n toString(): string;\n}\n\n/** The `DataView` view provides a low-level interface for reading and writing multiple number types in a binary `ArrayBuffer`, without having to care about the platform\'s endianness. */\ndeclare class DataView {\n /** The `buffer` accessor property represents the `ArrayBuffer` or `SharedArrayBuffer` referenced by the `DataView` at construction time. */\n readonly buffer: ArrayBuffer;\n /** The `byteLength` accessor property represents the length (in bytes) of this view from the start of its `ArrayBuffer` or `SharedArrayBuffer`. */\n readonly byteLength: i32;\n /** The `byteOffset` accessor property represents the offset (in bytes) of this view from the start of its `ArrayBuffer` or `SharedArrayBuffer`. */\n readonly byteOffset: i32;\n /** Constructs a new `DataView` with the given properties */\n constructor(buffer: ArrayBuffer, byteOffset?: i32, byteLength?: i32);\n /** The `getFloat32()` method gets a signed 32-bit float (float) at the specified byte offset from the start of the `DataView`. */\n getFloat32(byteOffset: i32, littleEndian?: boolean): f32;\n /** The `getFloat64()` method gets a signed 64-bit float (double) at the specified byte offset from the start of the `DataView`. */\n getFloat64(byteOffset: i32, littleEndian?: boolean): f64;\n /** The `getInt8()` method gets a signed 8-bit integer (byte) at the specified byte offset from the start of the `DataView`. */\n getInt8(byteOffset: i32): i8;\n /** The `getInt16()` method gets a signed 16-bit integer (short) at the specified byte offset from the start of the `DataView`. */\n getInt16(byteOffset: i32, littleEndian?: boolean): i16;\n /** The `getInt32()` method gets a signed 32-bit integer (long) at the specified byte offset from the start of the `DataView`. */\n getInt32(byteOffset: i32, littleEndian?: boolean): i32;\n /** The `getInt64()` method gets a signed 64-bit integer (long long) at the specified byte offset from the start of the `DataView`. */\n getInt64(byteOffset: i32, littleEndian?: boolean): i64;\n /** The `getUint8()` method gets an unsigned 8-bit integer (unsigned byte) at the specified byte offset from the start of the `DataView`. */\n getUint8(byteOffset: i32): u8;\n /** The `getUint16()` method gets an unsigned 16-bit integer (unsigned short) at the specified byte offset from the start of the `DataView`. */\n getUint16(byteOffset: i32, littleEndian?: boolean): u16;\n /** The `getUint32()` method gets an unsigned 32-bit integer (unsigned long) at the specified byte offset from the start of the `DataView`. */\n getUint32(byteOffset: i32, littleEndian?: boolean): u32;\n /** The `getUint64()` method gets an unsigned 64-bit integer (unsigned long long) at the specified byte offset from the start of the `DataView`. */\n getUint64(byteOffset: i32, littleEndian?: boolean): u64;\n /** The `setFloat32()` method stores a signed 32-bit float (float) value at the specified byte offset from the start of the `DataView`. */\n setFloat32(byteOffset: i32, value: f32, littleEndian?: boolean): void;\n /** The `setFloat64()` method stores a signed 64-bit float (double) value at the specified byte offset from the start of the `DataView`. */\n setFloat64(byteOffset: i32, value: f64, littleEndian?: boolean): void;\n /** The `setInt8()` method stores a signed 8-bit integer (byte) value at the specified byte offset from the start of the `DataView`. */\n setInt8(byteOffset: i32, value: i8): void;\n /** The `setInt16()` method stores a signed 16-bit integer (short) value at the specified byte offset from the start of the `DataView`. */\n setInt16(byteOffset: i32, value: i16, littleEndian?: boolean): void;\n /** The `setInt32()` method stores a signed 32-bit integer (long) value at the specified byte offset from the start of the `DataView`. */\n setInt32(byteOffset: i32, value: i32, littleEndian?: boolean): void;\n /** The `setInt64()` method stores a signed 64-bit integer (long long) value at the specified byte offset from the start of the `DataView`. */\n setInt64(byteOffset: i32, value: i64, littleEndian?: boolean): void;\n /** The `setUint8()` method stores an unsigned 8-bit integer (byte) value at the specified byte offset from the start of the `DataView`. */\n setUint8(byteOffset: i32, value: u8): void;\n /** The `setUint16()` method stores an unsigned 16-bit integer (unsigned short) value at the specified byte offset from the start of the `DataView`. */\n setUint16(byteOffset: i32, value: u16, littleEndian?: boolean): void;\n /** The `setUint32()` method stores an unsigned 32-bit integer (unsigned long) value at the specified byte offset from the start of the `DataView`. */\n setUint32(byteOffset: i32, value: u32, littleEndian?: boolean): void;\n /** The `setUint64()` method stores an unsigned 64-bit integer (unsigned long long) value at the specified byte offset from the start of the `DataView`. */\n setUint64(byteOffset: i32, value: u64, littleEndian?: boolean): void;\n /** Returns a string representation of DataView. */\n toString(): string;\n}\n\ninterface ArrayLike {\n length: i32;\n // [key: number]: T;\n}\n\n/** Interface for a typed view on an array buffer. */\ninterface ArrayBufferView {\n [key: number]: T;\n /** The {@link ArrayBuffer} referenced by this view. */\n readonly buffer: ArrayBuffer;\n /** The offset in bytes from the start of the referenced {@link ArrayBuffer}. */\n readonly byteOffset: i32;\n /** The length in bytes from the start of the referenced {@link ArrayBuffer}. */\n readonly byteLength: i32;\n}\n\n/* @internal */\ndeclare abstract class TypedArray implements ArrayBufferView {\n [key: number]: T;\n /** Number of bytes per element. */\n static readonly BYTES_PER_ELEMENT: usize;\n /** Constructs a new typed array. */\n constructor(length: i32);\n /** The {@link ArrayBuffer} referenced by this view. */\n readonly buffer: ArrayBuffer;\n /** The offset in bytes from the start of the referenced {@link ArrayBuffer}. */\n readonly byteOffset: i32;\n /** The length in bytes from the start of the referenced {@link ArrayBuffer}. */\n readonly byteLength: i32;\n /** The length (in elements). */\n readonly length: i32;\n /** Returns a new TypedArray of this type on the same ArrayBuffer from begin inclusive to end exclusive. */\n subarray(begin?: i32, end?: i32): this;\n /** The reduce() method applies a function against an accumulator and each value of the typed array (from left-to-right) has to reduce it to a single value. This method has the same algorithm as Array.prototype.reduce(). */\n reduce(\n callbackfn: (accumulator: W, value: T, index: i32, self: this) => W,\n initialValue: W,\n ): W;\n /** The reduceRight() method applies a function against an accumulator and each value of the typed array (from left-to-right) has to reduce it to a single value, starting from the end of the array. This method has the same algorithm as Array.prototype.reduceRight(). */\n reduceRight(\n callbackfn: (accumulator: W, value: T, index: i32, self: this) => W,\n initialValue: W,\n ): W;\n /** The some() method tests whether some element in the typed array passes the test implemented by the provided function. This method has the same algorithm as Array.prototype.some().*/\n some(callbackfn: (value: T, index: i32, self: this) => bool): bool;\n /** The map() method creates a new typed array with the results of calling a provided function on every element in this typed array. This method has the same algorithm as Array.prototype.map().*/\n map(callbackfn: (value: T, index: i32, self: this) => T): this;\n /** The sort() method sorts the elements of a typed array numerically in place and returns the typed array. This method has the same algorithm as Array.prototype.sort(), except that sorts the values numerically instead of as strings. TypedArray is one of the typed array types here. */\n sort(callback?: (a: T, b: T) => i32): this;\n /** The fill() method fills all the elements of a typed array from a start index to an end index with a static value. This method has the same algorithm as Array.prototype.fill(). */\n fill(value: T, start?: i32, end?: i32): this;\n /** The findIndex() method returns an index in the typed array, if an element in the typed array satisfies the provided testing function. Otherwise -1 is returned. See also the find() [not implemented] method, which returns the value of a found element in the typed array instead of its index. */\n findIndex(callbackfn: (value: T, index: i32, self: this) => bool): i32;\n /** The every() method tests whether all elements in the typed array pass the test implemented by the provided function. This method has the same algorithm as Array.prototype.every(). */\n every(callbackfn: (value: T, index: i32, self: this) => bool): bool;\n /** The forEach() method executes a provided function once per array element. This method has the same algorithm as Array.prototype.forEach().*/\n forEach(callbackfn: (value: T, index: i32, self: this) => void): void;\n /** The reverse() method reverses a typed array in place. The first typed array element becomes the last and the last becomes the first. This method has the same algorithm as Array.prototype.reverse(). */\n reverse(): this;\n}\n\n/** An array of twos-complement 8-bit signed integers. */\ndeclare class Int8Array extends TypedArray {}\n/** An array of 8-bit unsigned integers. */\ndeclare class Uint8Array extends TypedArray {}\n/** A clamped array of 8-bit unsigned integers. */\ndeclare class Uint8ClampedArray extends TypedArray {}\n/** An array of twos-complement 16-bit signed integers. */\ndeclare class Int16Array extends TypedArray {}\n/** An array of 16-bit unsigned integers. */\ndeclare class Uint16Array extends TypedArray {}\n/** An array of twos-complement 32-bit signed integers. */\ndeclare class Int32Array extends TypedArray {}\n/** An array of 32-bit unsigned integers. */\ndeclare class Uint32Array extends TypedArray {}\n/** An array of twos-complement 64-bit signed integers. */\ndeclare class Int64Array extends TypedArray {}\n/** An array of 64-bit unsigned integers. */\ndeclare class Uint64Array extends TypedArray {}\n/** An array of 32-bit floating point numbers. */\ndeclare class Float32Array extends TypedArray {}\n/** An array of 64-bit floating point numbers. */\ndeclare class Float64Array extends TypedArray {}\n\n/** Class representing a sequence of values of type `T`. */\ndeclare class Array {\n\n /** Tests if a value is an array. */\n static isArray(value: any): value is Array;\n /** Creates a new array with at least the specified capacity and length zero. */\n static create(capacity?: i32): Array;\n\n [key: number]: T;\n /** Current length of the array. */\n length: i32;\n /** Constructs a new array. If length is greater than zero and T is a non-nullable reference, use `Array.create` instead.*/\n constructor(capacity?: i32);\n\n fill(value: T, start?: i32, end?: i32): this;\n every(callbackfn: (element: T, index: i32, array?: Array) => bool): bool;\n findIndex(predicate: (element: T, index: i32, array?: Array) => bool): i32;\n includes(searchElement: T, fromIndex?: i32): bool;\n indexOf(searchElement: T, fromIndex?: i32): i32;\n lastIndexOf(searchElement: T, fromIndex?: i32): i32;\n push(element: T): i32;\n concat(items: T[]): T[];\n copyWithin(target: i32, start: i32, end?: i32): this;\n pop(): T;\n forEach(callbackfn: (value: T, index: i32, array: Array) => void): void;\n map(callbackfn: (value: T, index: i32, array: Array) => U): Array;\n filter(callbackfn: (value: T, index: i32, array: Array) => bool): Array;\n reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: i32, array: Array) => U, initialValue: U): U;\n reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: i32, array: Array) => U, initialValue: U): U;\n shift(): T;\n some(callbackfn: (element: T, index: i32, array?: Array) => bool): bool;\n unshift(element: T): i32;\n slice(from: i32, to?: i32): Array;\n splice(start: i32, deleteCount?: i32): Array;\n sort(comparator?: (a: T, b: T) => i32): this;\n join(separator?: string): string;\n reverse(): T[];\n toString(): string;\n}\n\n/** Class representing a fixed sequence of values of type `T`. */\ndeclare class FixedArray {\n [key: number]: T;\n readonly length: i32;\n constructor(capacity?: i32);\n}\n\n/** Class representing a sequence of characters. */\ndeclare class String {\n\n static fromCharCode(ls: i32, hs?: i32): string;\n static fromCharCodes(arr: u16[]): string;\n static fromCodePoint(code: i32): string;\n static fromCodePoints(arr: i32[]): string;\n\n readonly length: i32;\n readonly lengthUTF8: i32;\n\n charAt(index: u32): string;\n charCodeAt(index: u32): u16;\n concat(other: string): string;\n endsWith(other: string): bool;\n indexOf(other: string, fromIndex?: i32): u32;\n lastIndexOf(other: string, fromIndex?: i32): i32;\n includes(other: string): bool;\n startsWith(other: string): bool;\n substr(start: u32, length?: u32): string;\n substring(start: u32, end?: u32): string;\n trim(): string;\n trimLeft(): string;\n trimRight(): string;\n trimStart(): string;\n trimEnd(): string;\n padStart(targetLength: i32, padString?: string): string;\n padEnd(targetLength: i32, padString?: string): string;\n repeat(count?: i32): string;\n slice(beginIndex: i32, endIndex?: i32): string;\n split(separator?: string, limit?: i32): string[];\n toString(): string;\n static fromUTF8(ptr: usize, len: usize): string;\n toUTF8(): usize;\n}\n\n/** Class for representing a runtime error. Base class of all errors. */\ndeclare class Error {\n\n /** Error name. */\n name: string;\n\n /** Message provided on construction. */\n message: string;\n\n /** Stack trace. */\n stack?: string;\n\n /** Constructs a new error, optionally with a message. */\n constructor(message?: string);\n\n /** Method returns a string representing the specified Error class. */\n toString(): string;\n}\n\n/** Class for indicating an error when a value is not in the set or range of allowed values. */\ndeclare class RangeError extends Error { }\n\n/** Class for indicating an error when a value is not of the expected type. */\ndeclare class TypeError extends Error { }\n\n/** Class for indicating an error when trying to interpret syntactically invalid code. */\ndeclare class SyntaxError extends Error { }\n\ninterface Boolean {}\ninterface Function {}\ninterface IArguments {}\ninterface Number {}\ninterface Object {}\ninterface RegExp {}\n\ndeclare class Map {\n readonly size: i32;\n has(key: K): bool;\n set(key: K, value: V): void;\n get(key: K): V;\n delete(key: K): bool;\n clear(): void;\n keys(): K[]; // preliminary\n values(): V[]; // preliminary\n toString(): string;\n}\n\ndeclare class Set {\n readonly size: i32;\n has(value: K): bool;\n add(value: K): void;\n delete(value: K): bool;\n clear(): void;\n values(): K[]; // preliminary\n toString(): string;\n}\n\ninterface SymbolConstructor {\n readonly hasInstance: symbol;\n readonly isConcatSpreadable: symbol;\n readonly isRegExp: symbol;\n readonly iterator: symbol;\n readonly match: symbol;\n readonly replace: symbol;\n readonly search: symbol;\n readonly species: symbol;\n readonly split: symbol;\n readonly toPrimitive: symbol;\n readonly toStringTag: symbol;\n readonly unscopables: symbol;\n (description?: string | null): symbol;\n for(key: string): symbol;\n keyFor(sym: symbol): string | null;\n}\n\ndeclare const Symbol: SymbolConstructor;\n\ninterface IMath {\n /** The base of natural logarithms, e, approximately 2.718. */\n readonly E: T;\n /** The natural logarithm of 2, approximately 0.693. */\n readonly LN2: T;\n /** The natural logarithm of 10, approximately 2.302. */\n readonly LN10: T;\n /** The base 2 logarithm of e, approximately 1.442. */\n readonly LOG2E: T;\n /** The base 10 logarithm of e, approximately 0.434. */\n readonly LOG10E: T;\n /** The ratio of the circumference of a circle to its diameter, approximately 3.14159. */\n readonly PI: T;\n /** The square root of 1/2, approximately 0.707. */\n readonly SQRT1_2: T;\n /** The square root of 2, approximately 1.414. */\n readonly SQRT2: T;\n /** Returns the absolute value of `x`. */\n abs(x: T): T;\n /** Returns the arccosine (in radians) of `x`. */\n acos(x: T): T;\n /** Returns the hyperbolic arc-cosine of `x`. */\n acosh(x: T): T;\n /** Returns the arcsine (in radians) of `x`. */\n asin(x: T): T;\n /** Returns the hyperbolic arcsine of `x`. */\n asinh(x: T): T;\n /** Returns the arctangent (in radians) of `x`. */\n atan(x: T): T;\n /** Returns the arctangent of the quotient of its arguments. */\n atan2(y: T, x: T): T;\n /** Returns the hyperbolic arctangent of `x`. */\n atanh(x: T): T;\n /** Returns the cube root of `x`. */\n cbrt(x: T): T;\n /** Returns the smallest integer greater than or equal to `x`. */\n ceil(x: T): T;\n /** Returns the number of leading zero bits in the 32-bit binary representation of `x`. */\n clz32(x: T): T;\n /** Returns the cosine (in radians) of `x`. */\n cos(x: T): T;\n /** Returns the hyperbolic cosine of `x`. */\n cosh(x: T): T;\n /** Returns e to the power of `x`. */\n exp(x: T): T;\n /** Returns e to the power of `x`, minus 1. */\n expm1(x: T): T;\n /** Returns the largest integer less than or equal to `x`. */\n floor(x: T): T;\n /** Returns the nearest 32-bit single precision float representation of `x`. */\n fround(x: T): T;\n /** Returns the square root of the sum of squares of its arguments. */\n hypot(value1: T, value2: T): T; // TODO: rest\n /** Returns the result of the C-like 32-bit multiplication of `a` and `b`. */\n imul(a: T, b: T): T;\n /** Returns the natural logarithm (base e) of `x`. */\n log(x: T): T;\n /** Returns the base 10 logarithm of `x`. */\n log10(x: T): T;\n /** Returns the natural logarithm (base e) of 1 + `x`. */\n log1p(x: T): T;\n /** Returns the base 2 logarithm of `x`. */\n log2(x: T): T;\n /** Returns the largest-valued number of its arguments. */\n max(value1: T, value2: T): T; // TODO: rest\n /** Returns the lowest-valued number of its arguments. */\n min(value1: T, value2: T): T; // TODO: rest\n /** Returns `base` to the power of `exponent`. */\n pow(base: T, exponent: T): T;\n /** Returns a pseudo-random number in the range from 0.0 inclusive up to but not including 1.0. */\n random(): T;\n /** Returns the value of `x` rounded to the nearest integer. */\n round(x: T): T;\n /** Returns the sign of `x`, indicating whether the number is positive, negative or zero. */\n sign(x: T): T;\n /** Returns whether the sign bit of `x` is set. */\n signbit(x: T): bool;\n /** Returns the sine of `x`. */\n sin(x: T): T;\n /** Returns the hyperbolic sine of `x`. */\n sinh(x: T): T;\n /** Returns the square root of `x`. */\n sqrt(x: T): T;\n /** Returns the tangent of `x`. */\n tan(x: T): T;\n /** Returns the hyperbolic tangent of `x`. */\n tanh(x: T): T;\n /** Returns the integer part of `x` by removing any fractional digits. */\n trunc(x: T): T;\n}\n\ninterface INativeMath extends IMath {\n /** Contains sin value produced after Math/Mathf.sincos */\n sincos_sin: T;\n /** Contains cos value produced after Math/Mathf.sincos */\n sincos_cos: T;\n /** Seeds the random number generator. */\n seedRandom(value: i64): void;\n /** Returns the floating-point remainder of `x / y` (rounded towards zero). */\n mod(x: T, y: T): T;\n /** Returns the floating-point remainder of `x / y` (rounded to nearest). */\n rem(x: T, y: T): T;\n /** Returns sin and cos simultaneously for same angle. Results stored to `sincos_s32/64` and `sincos_c32/64` globals */\n sincos(x: T): void;\n}\n\n/** Double precision math imported from JavaScript. */\ndeclare const JSMath: IMath;\n/** Double precision math implemented natively. */\ndeclare const NativeMath: INativeMath;\n/** Single precision math implemented natively. */\ndeclare const NativeMathf: INativeMath;\n/** Alias of {@link NativeMath} or {@link JSMath} respectively. Defaults to `NativeMath`. */\ndeclare const Math: IMath;\n/** Alias of {@link NativeMathf} or {@link JSMath} respectively. Defaults to `NativeMathf`. */\ndeclare const Mathf: IMath;\n\ndeclare class Date {\n /** Returns the UTC timestamp in milliseconds of the specified date. */\n static UTC(\n year: i32,\n month: i32,\n day: i32,\n hour: i32,\n minute: i32,\n second: i32,\n millisecond: i32\n ): i64;\n /** Returns the current UTC timestamp in milliseconds. */\n static now(): i64;\n /** Constructs a new date object from an UTC timestamp in milliseconds. */\n constructor(value: i64);\n /** Returns the UTC timestamp of this date in milliseconds. */\n getTime(): i64;\n /** Sets the UTC timestamp of this date in milliseconds. */\n setTime(value: i64): i64;\n}\n\n/** Environmental tracing function for debugging purposes. */\ndeclare function trace(msg: string, n?: i32, a0?: f64, a1?: f64, a2?: f64, a3?: f64, a4?: f64): void;\n\n// Decorators\n\ninterface TypedPropertyDescriptor {\n configurable?: boolean;\n enumerable?: boolean;\n writable?: boolean;\n value?: T;\n get?(): T;\n set?(value: T): void;\n}\n\n/** Annotates a method as a binary operator overload for the specified `token`. */\ndeclare function operator(token:\n "[]" | "[]=" | "{}" | "{}=" | "==" | "!=" | ">" | "<" | "<=" | ">=" |\n ">>" | ">>>" | "<<" | "&" | "|" | "^" | "+" | "-" | "*" | "**" | "/" | "%"\n): (\n target: any,\n propertyKey: string,\n descriptor: TypedPropertyDescriptor\n) => TypedPropertyDescriptor | void;\n\ndeclare namespace operator {\n /** Annotates a method as a binary operator overload for the specified `token`. */\n export function binary(token:\n "[]" | "[]=" | "{}" | "{}=" | "==" | "!=" | ">" | "<" | "<=" | ">=" |\n ">>" | ">>>" | "<<" | "&" | "|" | "^" | "+" | "-" | "*" | "**" | "/" | "%"\n ): (\n target: any,\n propertyKey: string,\n descriptor: TypedPropertyDescriptor\n ) => TypedPropertyDescriptor | void;\n /** Annotates a method as an unary prefix operator overload for the specified `token`. */\n export function prefix(token: "!" | "~" | "+" | "-" | "++" | "--"): (\n target: any,\n propertyKey: string,\n descriptor: TypedPropertyDescriptor\n ) => TypedPropertyDescriptor | void;\n /** Annotates a method as an unary postfix operator overload for the specified `token`. */\n export function postfix(token: "++" | "--"): (\n target: any,\n propertyKey: string,\n descriptor: TypedPropertyDescriptor\n ) => TypedPropertyDescriptor | void;\n}\n\n/** Annotates an element as a program global. */\ndeclare function global(...args: any[]): any;\n\n/** Annotates a class as being unmanaged with limited capabilities. */\ndeclare function unmanaged(constructor: Function): void;\n\n/** Annotates a class as being sealed / non-derivable. */\ndeclare function sealed(constructor: Function): void;\n\n/** Annotates a method, function or constant global as always inlined. */\ndeclare function inline(...args: any[]): any;\n\n/** Annotates a method, function or constant global as unsafe. */\ndeclare function unsafe(...args: any[]): any;\n\n/** Annotates an explicit external name of a function or global. */\ndeclare function external(...args: any[]): any;\n\n/** Annotates a global for lazy compilation. */\ndeclare function lazy(...args: any[]): any;\n\n/** Annotates a function as the explicit start function. */\ndeclare function start(...args: any[]): any;\n',portable:"/**\n * Environment definitions for compiling AssemblyScript to JavaScript using tsc.\n *\n * Note that semantic differences require additional explicit conversions for full compatibility.\n * For example, when casting an i32 to an u8, doing `(someI32 & 0xff)` will yield the same\n * result when compiling to WebAssembly or JS while `someI32` alone does nothing in JS.\n *\n * Note that i64's are not portable (JS numbers are IEEE754 doubles with a maximum safe integer\n * value of 2^53-1) and instead require a compatibility layer to work in JS as well, as for example\n * {@link glue/js/i64} respectively {@link glue/wasm/i64}.\n *\n * @module std/portable\n *//***/\n\n/// \n\n// Types\n\ndeclare type bool = boolean;\ndeclare type i8 = number;\ndeclare type i16 = number;\ndeclare type i32 = number;\ndeclare type isize = number;\ndeclare type u8 = number;\ndeclare type u16 = number;\ndeclare type u32 = number;\ndeclare type usize = number;\ndeclare type f32 = number;\ndeclare type f64 = number;\n\n// Compiler hints\n\n/** Compiler target. 0 = JS, 1 = WASM32, 2 = WASM64. */\ndeclare const ASC_TARGET: i32;\n/** Provided noAssert option. */\ndeclare const ASC_NO_ASSERT: bool;\n/** Provided memoryBase option. */\ndeclare const ASC_MEMORY_BASE: i32;\n/** Provided optimizeLevel option. */\ndeclare const ASC_OPTIMIZE_LEVEL: i32;\n/** Provided shrinkLevel option. */\ndeclare const ASC_SHRINK_LEVEL: i32;\n/** Whether the mutable global feature is enabled. */\ndeclare const ASC_FEATURE_MUTABLE_GLOBAL: bool;\n/** Whether the sign extension feature is enabled. */\ndeclare const ASC_FEATURE_SIGN_EXTENSION: bool;\n\n// Builtins\n\n/** Performs the sign-agnostic count leading zero bits operation on a 32-bit integer. All zero bits are considered leading if the value is zero. */\ndeclare function clz(value: T): T;\n/** Performs the sign-agnostic count tailing zero bits operation on a 32-bit integer. All zero bits are considered trailing if the value is zero. */\ndeclare function ctz(value: T): T;\n/** Performs the sign-agnostic count number of one bits operation on a 32-bit integer. */\ndeclare function popcnt(value: T): T;\n/** Performs the sign-agnostic rotate left operation on a 32-bit integer. */\ndeclare function rotl(value: T, shift: T): T;\n/** Performs the sign-agnostic rotate right operation on a 32-bit integer. */\ndeclare function rotr(value: T, shift: T): T;\n/** Computes the absolute value of an integer or float. */\ndeclare function abs(value: T): T;\n/** Determines the maximum of two integers or floats. If either operand is `NaN`, returns `NaN`. */\ndeclare function max(left: T, right: T): T;\n/** Determines the minimum of two integers or floats. If either operand is `NaN`, returns `NaN`. */\ndeclare function min(left: T, right: T): T;\n/** Composes a 32-bit or 64-bit float from the magnitude of `x` and the sign of `y`. */\ndeclare function copysign(x: T, y: T): T;\n/** Performs the ceiling operation on a 32-bit or 64-bit float. */\ndeclare function ceil(value: T): T;\n/** Performs the floor operation on a 32-bit or 64-bit float. */\ndeclare function floor(value: T): T;\n/** Rounds to the nearest integer tied to even of a 32-bit or 64-bit float. */\ndeclare function nearest(value: T): T;\n/** Selects one of two pre-evaluated values depending on the condition. */\ndeclare function select(ifTrue: T, ifFalse: T, condition: bool): T;\n/** Calculates the square root of a 32-bit or 64-bit float. */\ndeclare function sqrt(value: T): T;\n/** Rounds to the nearest integer towards zero of a 32-bit or 64-bit float. */\ndeclare function trunc(value: T): T;\n/** Loads a value of the specified type from memory. Type must be `u8`. */\ndeclare function load(ptr: usize, constantOffset?: usize): T;\n/** Stores a value of the specified type to memory. Type must be `u8`. */\ndeclare function store(ptr: usize, value: T, constantOffset?: usize): void;\n/** Emits an unreachable operation that results in a runtime error when executed. */\ndeclare function unreachable(): any; // sic\n\n/** NaN (not a number) as a 32-bit or 64-bit float depending on context. */\ndeclare const NaN: f32 | f64;\n/** Positive infinity as a 32-bit or 64-bit float depending on context. */\ndeclare const Infinity: f32 | f64;\n/** Changes the type of any value of `usize` kind to another one of `usize` kind. Useful for casting class instances to their pointer values and vice-versa. Beware that this is unsafe.*/\ndeclare function changetype(value: any): T;\n/** Explicitly requests no bounds checks on the provided expression. Useful for array accesses. */\ndeclare function unchecked(value: T): T;\n/** Tests if a 32-bit or 64-bit float is `NaN`. */\ndeclare function isNaN(value: T): bool;\n/** Tests if a 32-bit or 64-bit float is finite, that is not `NaN` or +/-`Infinity`. */\ndeclare function isFinite(value: T): bool;\n/** Tests if the specified value is a valid integer. Can't distinguish an integer from an integral float. */\ndeclare function isInteger(value: any): value is number;\n/** Tests if the specified value is a valid float. Can't distinguish a float from an integer. */\ndeclare function isFloat(value: any): value is number;\n/** Tests if the specified value is of a nullable reference type. */\ndeclare function isNullable(value: any): bool;\n/** Tests if the specified value is of a reference type. */\ndeclare function isReference(value: any): value is object | string;\n/** Tests if the specified value is of a function type */\ndeclare function isFunction(value: any): value is Function;\n/** Tests if the specified value can be used as a string. */\ndeclare function isString(value: any): value is string | String;\n/** Tests if the specified value can be used as an array. */\ndeclare function isArray(value: any): value is Array;\n/** Tests if the specified type *or* expression can be used as an array like object. */\ndeclare function isArrayLike(value: any): value is ArrayLike;\n/** Tests if the specified expression resolves to a defined element. */\ndeclare function isDefined(expression: any): bool;\n/** Tests if the specified expression evaluates to a constant value. */\ndeclare function isConstant(expression: any): bool;\n/** Traps if the specified value is not true-ish, otherwise returns the value. */\ndeclare function assert(isTrueish: T | null, message?: string): T;\n/** Parses an integer string to a 64-bit float. */\ndeclare function parseInt(str: string, radix?: i32): f64;\n/** Parses an integer string to a 32-bit integer. */\ndeclare function parseI32(str: string, radix?: i32): i32;\n/** Parses a floating point string to a 64-bit float. */\ndeclare function parseFloat(str: string): f64;\n/** Returns the 64-bit floating-point remainder of `x/y`. */\ndeclare function fmod(x: f64, y: f64): f64;\n/** Returns the 32-bit floating-point remainder of `x/y`. */\ndeclare function fmodf(x: f32, y: f32): f32;\n\n/** Converts any other numeric value to an 8-bit signed integer. */\ndeclare function i8(value: any): i8;\ndeclare namespace i8 {\n /** Smallest representable value. */\n export const MIN_VALUE: i8;\n /** Largest representable value. */\n export const MAX_VALUE: i8;\n /** Converts a string to a floating-point number and cast to target integer after. */\n export function parseFloat(string: string): i8;\n /** Converts A string to an integer. */\n export function parseInt(string: string, radix?: i32): i8;\n}\n/** Converts any other numeric value to a 16-bit signed integer. */\ndeclare function i16(value: any): i16;\ndeclare namespace i16 {\n /** Smallest representable value. */\n export const MIN_VALUE: i16;\n /** Largest representable value. */\n export const MAX_VALUE: i16;\n /** Converts a string to a floating-point number and cast to target integer after. */\n export function parseFloat(string: string): i16;\n /** Converts A string to an integer. */\n export function parseInt(string: string, radix?: i32): i16;\n}\n/** Converts any other numeric value to a 32-bit signed integer. */\ndeclare function i32(value: any): i32;\ndeclare namespace i32 {\n /** Smallest representable value. */\n export const MIN_VALUE: i32;\n /** Largest representable value. */\n export const MAX_VALUE: i32;\n /** Converts a string to a floating-point number and cast to target integer after. */\n export function parseFloat(string: string): i32;\n /** Converts A string to an integer. */\n export function parseInt(string: string, radix?: i32): i32;\n}\n/** Converts any other numeric value to a 32-bit (in WASM32) respectivel 64-bit (in WASM64) signed integer. */\ndeclare function isize(value: any): isize;\ndeclare namespace isize {\n /** Smallest representable value. */\n export const MIN_VALUE: isize;\n /** Largest representable value. */\n export const MAX_VALUE: isize;\n /** Converts a string to a floating-point number and cast to target integer after. */\n export function parseFloat(string: string): isize;\n /** Converts A string to an integer. */\n export function parseInt(string: string, radix?: i32): isize;\n}\n/** Converts any other numeric value to an 8-bit unsigned integer. */\ndeclare function u8(value: any): u8;\ndeclare namespace u8 {\n /** Smallest representable value. */\n export const MIN_VALUE: u8;\n /** Largest representable value. */\n export const MAX_VALUE: u8;\n /** Converts a string to a floating-point number and cast to target integer after. */\n export function parseFloat(string: string): u8;\n /** Converts A string to an integer. */\n export function parseInt(string: string, radix?: i32): u8;\n}\n/** Converts any other numeric value to a 16-bit unsigned integer. */\ndeclare function u16(value: any): u16;\ndeclare namespace u16 {\n /** Smallest representable value. */\n export const MIN_VALUE: u16;\n /** Largest representable value. */\n export const MAX_VALUE: u16;\n /** Converts a string to a floating-point number and cast to target integer after. */\n export function parseFloat(string: string): u16;\n /** Converts A string to an integer. */\n export function parseInt(string: string, radix?: i32): u16;\n}\n/** Converts any other numeric value to a 32-bit unsigned integer. */\ndeclare function u32(value: any): u32;\ndeclare namespace u32 {\n /** Smallest representable value. */\n export const MIN_VALUE: u32;\n /** Largest representable value. */\n export const MAX_VALUE: u32;\n /** Converts a string to a floating-point number and cast to target integer after. */\n export function parseFloat(string: string): u32;\n /** Converts A string to an integer. */\n export function parseInt(string: string, radix?: i32): u32;\n}\n/** Converts any other numeric value to a 32-bit (in WASM32) respectivel 64-bit (in WASM64) unsigned integer. */\ndeclare function usize(value: any): isize;\ndeclare namespace usize {\n /** Smallest representable value. */\n export const MIN_VALUE: usize;\n /** Largest representable value. */\n export const MAX_VALUE: usize;\n /** Converts a string to a floating-point number and cast to target integer after. */\n export function parseFloat(string: string): usize;\n /** Converts A string to an integer. */\n export function parseInt(string: string, radix?: i32): usize;\n}\n/** Converts any other numeric value to a 1-bit unsigned integer. */\ndeclare function bool(value: any): bool;\ndeclare namespace bool {\n /** Smallest representable value. */\n export const MIN_VALUE: bool;\n /** Largest representable value. */\n export const MAX_VALUE: bool;\n}\n/** Converts any other numeric value to a 32-bit float. */\ndeclare function f32(value: any): f32;\ndeclare namespace f32 {\n /** Smallest representable value. */\n export const MIN_VALUE: f32;\n /** Largest representable value. */\n export const MAX_VALUE: f32;\n /** Smallest normalized positive value. */\n export const MIN_POSITIVE_VALUE: f32;\n /** Smallest safely representable integer value. */\n export const MIN_SAFE_INTEGER: f32;\n /** Largest safely representable integer value. */\n export const MAX_SAFE_INTEGER: f32;\n /** Difference between 1 and the smallest representable value greater than 1. */\n export const EPSILON: f32;\n /** Returns a boolean value that indicates whether a value is the reserved value NaN (not a number). */\n export function isNaN(value: f32): bool;\n /** Returns true if passed value is finite. */\n export function isFinite(value: f32): bool;\n /** Returns true if the value passed is a safe integer. */\n export function isSafeInteger(value: f32): bool;\n /** Returns true if the value passed is an integer, false otherwise. */\n export function isInteger(value: f32): bool;\n /** Converts a string to a floating-point number. */\n export function parseFloat(string: string): f32;\n /** Converts A string to an integer. */\n export function parseInt(string: string, radix?: i32): f32;\n}\n/** Converts any other numeric value to a 64-bit float. */\ndeclare function f64(value: any): f64;\ndeclare namespace f64 {\n /** Smallest representable value. */\n export const MIN_VALUE: f64;\n /** Largest representable value. */\n export const MAX_VALUE: f64;\n /** Smallest normalized positive value. */\n export const MIN_POSITIVE_VALUE: f64;\n /** Smallest safely representable integer value. */\n export const MIN_SAFE_INTEGER: f64;\n /** Largest safely representable integer value. */\n export const MAX_SAFE_INTEGER: f64;\n /** Difference between 1 and the smallest representable value greater than 1. */\n export const EPSILON: f64;\n /** Returns a boolean value that indicates whether a value is the reserved value NaN (not a number). */\n export function isNaN(value: f32): bool;\n /** Returns true if passed value is finite. */\n export function isFinite(value: f32): bool;\n /** Returns true if the value passed is a safe integer. */\n export function isSafeInteger(value: f64): bool;\n /** Returns true if the value passed is an integer, false otherwise. */\n export function isInteger(value: f64): bool;\n /** Converts a string to a floating-point number. */\n export function parseFloat(string: string): f64;\n /** Converts A string to an integer. */\n export function parseInt(string: string, radix?: i32): f64;\n}\n\n// Polyfills\n\n/** [Polyfill] Performs the sign-agnostic reverse bytes **/\ndeclare function bswap(value: T): T;\n/** [Polyfill] Performs the sign-agnostic reverse bytes only for last 16-bit **/\ndeclare function bswap16(value: T): T;\n\n// Standard library\n\n/** Memory operations. */\ndeclare namespace memory {\n /** Allocates a chunk of memory of the specified size and returns a pointer to it. */\n function allocate(size: usize): usize;\n /** Disposes a chunk of memory by its pointer. */\n function free(ptr: usize): void;\n /** Copies n bytes from the specified source to the specified destination in memory. These regions may overlap. */\n function copy(dst: usize, src: usize, n: usize): void;\n /** Fills size bytes from from the specified destination by same value in memory. */\n function fill(dst: usize, value: u8, size: usize): void;\n /** Resets the allocator to its initial state, if supported. */\n function reset(): void;\n}\n\n/** Class representing a generic, fixed-length raw binary data buffer. */\ndeclare class ArrayBuffer {\n /** The size, in bytes, of the array. */\n readonly byteLength: i32;\n /** Returns true if value is one of the ArrayBuffer views, such as typed array or a DataView **/\n static isView(value: T): bool;\n /** Constructs a new array buffer of the given length in bytes. */\n constructor(length: i32);\n /** Returns a copy of this array buffer's bytes from begin, inclusive, up to end, exclusive. */\n slice(begin?: i32, end?: i32): ArrayBuffer;\n /** Returns a string representation of ArrayBuffer. */\n toString(): string;\n}\n\n/** The `DataView` view provides a low-level interface for reading and writing multiple number types in a binary `ArrayBuffer`, without having to care about the platform's endianness. */\ndeclare class DataView {\n /** The `buffer` accessor property represents the `ArrayBuffer` or `SharedArrayBuffer` referenced by the `DataView` at construction time. */\n readonly buffer: ArrayBuffer;\n /** The `byteLength` accessor property represents the length (in bytes) of this view from the start of its `ArrayBuffer` or `SharedArrayBuffer`. */\n readonly byteLength: i32;\n /** The `byteOffset` accessor property represents the offset (in bytes) of this view from the start of its `ArrayBuffer` or `SharedArrayBuffer`. */\n readonly byteOffset: i32;\n /** Constructs a new `DataView` with the given properties */\n constructor(buffer: ArrayBuffer, byteOffset?: i32, byteLength?: i32);\n /** The `getFloat32()` method gets a signed 32-bit float (float) at the specified byte offset from the start of the `DataView`. */\n getFloat32(byteOffset: i32, littleEndian?: boolean): f32;\n /** The `getFloat64()` method gets a signed 64-bit float (double) at the specified byte offset from the start of the `DataView`. */\n getFloat64(byteOffset: i32, littleEndian?: boolean): f64;\n /** The `getInt8()` method gets a signed 8-bit integer (byte) at the specified byte offset from the start of the `DataView`. */\n getInt8(byteOffset: i32): i8;\n /** The `getInt16()` method gets a signed 16-bit integer (short) at the specified byte offset from the start of the `DataView`. */\n getInt16(byteOffset: i32, littleEndian?: boolean): i16;\n /** The `getInt32()` method gets a signed 32-bit integer (long) at the specified byte offset from the start of the `DataView`. */\n getInt32(byteOffset: i32, littleEndian?: boolean): i32;\n /** The `getUint8()` method gets an unsigned 8-bit integer (unsigned byte) at the specified byte offset from the start of the `DataView`. */\n getUint8(byteOffset: i32): u8;\n /** The `getUint16()` method gets an unsigned 16-bit integer (unsigned short) at the specified byte offset from the start of the `DataView`. */\n getUint16(byteOffset: i32, littleEndian?: boolean): u16;\n /** The `getUint32()` method gets an unsigned 32-bit integer (unsigned long) at the specified byte offset from the start of the `DataView`. */\n getUint32(byteOffset: i32, littleEndian?: boolean): u32;\n /** The `setFloat32()` method stores a signed 32-bit float (float) value at the specified byte offset from the start of the `DataView`. */\n setFloat32(byteOffset: i32, value: f32, littleEndian?: boolean): void;\n /** The `setFloat64()` method stores a signed 64-bit float (double) value at the specified byte offset from the start of the `DataView`. */\n setFloat64(byteOffset: i32, value: f64, littleEndian?: boolean): void;\n /** The `setInt8()` method stores a signed 8-bit integer (byte) value at the specified byte offset from the start of the `DataView`. */\n setInt8(byteOffset: i32, value: i8): void;\n /** The `setInt16()` method stores a signed 16-bit integer (short) value at the specified byte offset from the start of the `DataView`. */\n setInt16(byteOffset: i32, value: i16, littleEndian?: boolean): void;\n /** The `setInt32()` method stores a signed 32-bit integer (long) value at the specified byte offset from the start of the `DataView`. */\n setInt32(byteOffset: i32, value: i32, littleEndian?: boolean): void;\n /** The `setUint8()` method stores an unsigned 8-bit integer (byte) value at the specified byte offset from the start of the `DataView`. */\n setUint8(byteOffset: i32, value: u8): void;\n /** The `setUint16()` method stores an unsigned 16-bit integer (unsigned short) value at the specified byte offset from the start of the `DataView`. */\n setUint16(byteOffset: i32, value: u16, littleEndian?: boolean): void;\n /** The `setUint32()` method stores an unsigned 32-bit integer (unsigned long) value at the specified byte offset from the start of the `DataView`. */\n setUint32(byteOffset: i32, value: u32, littleEndian?: boolean): void;\n /** Returns a string representation of DataView. */\n toString(): string;\n}\n\ndeclare class Array {\n\n static isArray(value: any): value is Array;\n static create(capacity?: i32): Array;\n\n [key: number]: T;\n length: i32;\n constructor(capacity?: i32);\n\n fill(value: T, start?: i32, end?: i32): this;\n every(callbackfn: (element: T, index: i32, array?: Array) => bool): bool;\n findIndex(predicate: (element: T, index: i32, array?: Array) => bool): i32;\n includes(searchElement: T, fromIndex?: i32): bool;\n indexOf(searchElement: T, fromIndex?: i32): i32;\n lastIndexOf(searchElement: T, fromIndex?: i32): i32;\n push(element: T): i32;\n concat(items: T[]): T[];\n copyWithin(target: i32, start: i32, end?: i32): this;\n pop(): T;\n forEach(callbackfn: (value: T, index: i32, array: Array) => void): void;\n map(callbackfn: (value: T, index: i32, array: Array) => U): Array;\n filter(callbackfn: (value: T, index: i32, array: Array) => bool): Array;\n reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: i32, array: Array) => U, initialValue: U): U;\n reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: i32, array: Array) => U, initialValue: U): U;\n shift(): T;\n some(callbackfn: (element: T, index: i32, array?: Array) => bool): bool;\n unshift(element: T): i32;\n slice(from?: i32, to?: i32): Array;\n splice(start: i32, deleteCount?: i32): Array;\n sort(comparator?: (a: T, b: T) => i32): this;\n join(separator?: string): string;\n reverse(): T[];\n toString(): string;\n}\n\ndeclare class Uint8Array extends Array {}\ndeclare class Uint8ClampedArray extends Array {}\ndeclare class Uint16Array extends Array {}\ndeclare class Uint32Array extends Array {}\ndeclare class Int8Array extends Array {}\ndeclare class Int16Array extends Array {}\ndeclare class Int32Array extends Array {}\ndeclare class Float32Array extends Array {}\ndeclare class Float64Array extends Array {}\n\ninterface ArrayLike {\n length: i32;\n [key: number]: T;\n}\n\n/** Interface for a typed view on an array buffer. */\ninterface ArrayBufferView {\n [key: number]: T;\n /** The {@link ArrayBuffer} referenced by this view. */\n readonly buffer: ArrayBuffer;\n /** The offset in bytes from the start of the referenced {@link ArrayBuffer}. */\n readonly byteOffset: i32;\n /** The length in bytes from the start of the referenced {@link ArrayBuffer}. */\n readonly byteLength: i32;\n}\n\ndeclare class String {\n\n static fromCharCode(ls: i32, hs?: i32): string;\n static fromCharCodes(arr: u16[]): string;\n static fromCodePoint(code: i32): string;\n static fromCodePoints(arr: i32[]): string;\n\n readonly length: i32;\n\n private constructor();\n\n charAt(index: i32): string;\n charCodeAt(index: i32): i32;\n concat(other: string): string;\n indexOf(other: string, fromIndex?: i32): i32;\n lastIndexOf(other: string, fromIndex?: i32): i32;\n includes(other: string): bool;\n startsWith(other: string): bool;\n endsWith(other: string): bool;\n substr(start: u32, length?: u32): string;\n substring(from: i32, to?: i32): string;\n trim(): string;\n trimLeft(): string;\n trimRight(): string;\n trimStart(): string;\n trimEnd(): string;\n padStart(targetLength: i32, padString?: string): string;\n padEnd(targetLength: i32, padString?: string): string;\n replace(search: string, replacement: string): string;\n repeat(count?: i32): string;\n slice(beginIndex: i32, endIndex?: i32): string;\n split(separator?: string, limit?: i32): string[];\n toString(): string;\n}\n\ninterface Boolean {}\n\ndeclare class Number {\n private constructor();\n toString(radix?: i32): string;\n}\n\ninterface Object {}\n\ninterface Function {}\n\ninterface RegExp {}\n\ninterface IArguments {}\n\n/** Class for representing a runtime error. Base class of all errors. */\ndeclare class Error {\n\n /** Error name. */\n name: string;\n\n /** Message provided on construction. */\n message: string;\n\n /** Stack trace. */\n stack?: string;\n\n /** Constructs a new error, optionally with a message. */\n constructor(message?: string);\n\n /** Method returns a string representing the specified Error class. */\n toString(): string;\n}\n\n/** Class for indicating an error when a value is not in the set or range of allowed values. */\ndeclare class RangeError extends Error { }\n\n/** Class for indicating an error when a value is not of the expected type. */\ndeclare class TypeError extends Error { }\n\n/** Class for indicating an error when trying to interpret syntactically invalid code. */\ndeclare class SyntaxError extends Error { }\n\ndeclare class Set {\n constructor(entries?: T[]);\n readonly size: i32;\n has(value: T): bool;\n add(value: T): void;\n delete(value: T): bool;\n clear(): void;\n toString(): string;\n [Symbol.iterator](): Iterator;\n}\n\ndeclare class Map {\n constructor(entries?: [K, V][]);\n readonly size: i32;\n set(key: K, value: V): void;\n has(key: K): bool;\n get(key: K): V | null;\n clear(): void;\n entries(): Iterable<[K, V]>;\n keys(): Iterable;\n values(): Iterable;\n delete(key: K): bool;\n toString(): string;\n [Symbol.iterator](): Iterator<[K,V]>;\n}\n\ninterface SymbolConstructor {\n readonly hasInstance: symbol;\n readonly isConcatSpreadable: symbol;\n readonly isRegExp: symbol;\n readonly iterator: symbol;\n readonly match: symbol;\n readonly replace: symbol;\n readonly search: symbol;\n readonly species: symbol;\n readonly split: symbol;\n readonly toPrimitive: symbol;\n readonly toStringTag: symbol;\n readonly unscopables: symbol;\n (description?: string | null): symbol;\n for(key: string): symbol;\n keyFor(sym: symbol): string | null;\n}\ndeclare const Symbol: SymbolConstructor;\n\ninterface Iterable {\n [Symbol.iterator](): Iterator;\n}\n\ninterface Iterator {}\n\ninterface IMath {\n readonly E: f64;\n readonly LN2: f64;\n readonly LN10: f64;\n readonly LOG2E: f64;\n readonly LOG10E: f64;\n readonly PI: f64;\n readonly SQRT1_2: f64;\n readonly SQRT2: f64;\n\n sincos_sin: f64;\n sincos_cos: f64;\n\n abs(x: f64): f64;\n acos(x: f64): f64;\n acosh(x: f64): f64;\n asin(x: f64): f64;\n asinh(x: f64): f64;\n atan(x: f64): f64;\n atan2(y: f64, x: f64): f64;\n atanh(x: f64): f64;\n cbrt(x: f64): f64;\n ceil(x: f64): f64;\n clz32(x: f64): i32;\n cos(x: f64): f64;\n cosh(x: f64): f64;\n exp(x: f64): f64;\n expm1(x: f64): f64;\n floor(x: f64): f64;\n fround(x: f64): f32;\n hypot(value1: f64, value2: f64): f64; // TODO: see std/math\n imul(a: f64, b: f64): i32;\n log(x: f64): f64;\n log10(x: f64): f64;\n log1p(x: f64): f64;\n log2(x: f64): f64;\n max(value1: f64, value2: f64): f64; // TODO: see std/math\n min(value1: f64, value2: f64): f64; // TODO: see std/math\n pow(base: f64, exponent: f64): f64;\n random(): f64;\n round(x: f64): f64;\n sign(x: f64): f64;\n signbit(x: f64): bool;\n sin(x: f64): f64;\n sincos(x: f64): f64;\n sinh(x: f64): f64;\n sqrt(x: f64): f64;\n tan(x: f64): f64;\n tanh(x: f64): f64;\n trunc(x: f64): f64;\n}\n\ndeclare const Math: IMath;\ndeclare const Mathf: IMath;\ndeclare const JSMath: IMath;\n\ndeclare class Date {\n /** Returns the UTC timestamp in milliseconds of the specified date. */\n static UTC(\n year: i32,\n month: i32,\n day: i32,\n hour: i32,\n minute: i32,\n second: i32,\n millisecond: i32\n ): number;\n /** Returns the current UTC timestamp in milliseconds. */\n static now(): number;\n /** Constructs a new date object from an UTC timestamp in milliseconds. */\n constructor(value: number);\n /** Returns the UTC timestamp of this date in milliseconds. */\n getTime(): number;\n /** Sets the UTC timestamp of this date in milliseconds. */\n setTime(value: number): number;\n}\n\ndeclare namespace console {\n /** @deprecated */\n function log(message: string): void;\n}\n\n/** Annotates a class as being unmanaged with limited capabilities. */\ndeclare function unmanaged(constructor: Function): void;\n"}):(()=>{const n=path.join(".","..","std");return{assembly:fs.readFileSync(path.join(n,"assembly","index.d.ts"),"utf8"),portable:fs.readFileSync(path.join(n,"portable","index.d.ts"),"utf8")}})(),exports.compileString=((n,e)=>{"string"==typeof n&&(n={"input.ts":n});const t=Object.create({stdout:createMemoryStream(),stderr:createMemoryStream()});var r=["--binaryFile","binary","--textFile","text"];return Object.keys(e||{}).forEach(n=>{var t=e[n];Array.isArray(t)?t.forEach(e=>r.push("--"+n,String(e))):r.push("--"+n,String(t))}),exports.main(r.concat(Object.keys(n)),{stdout:t.stdout,stderr:t.stderr,readFile:e=>n.hasOwnProperty(e)?n[e]:null,writeFile:(n,e)=>t[n]=e,listFiles:()=>[]}),t}),exports.main=function(n,e,t){"function"==typeof e?(t=e,e={}):e||(e={});const r=e.stdout||process.stdout,i=e.stderr||process.stderr,o=e.readFile||z,a=e.writeFile||F,s=e.listFiles||S,l=e.stats||createStats();if(!r)throw Error("'options.stdout' must be specified");if(!i)throw Error("'options.stderr' must be specified");const u=optionsUtil.parse(n,exports.options),f=u.options;if(n=u.arguments,f.noColors?colorsUtil.stdout.supported=colorsUtil.stderr.supported=!1:(colorsUtil.stdout=colorsUtil.from(r),colorsUtil.stderr=colorsUtil.from(i)),u.unknown.length&&u.unknown.forEach(n=>{i.write(colorsUtil.stderr.yellow("WARN: ")+"Unknown option '"+n+"'"+EOL)}),u.trailing.length&&i.write(colorsUtil.stderr.yellow("WARN: ")+"Unsupported trailing arguments: "+u.trailing.join(" ")+EOL),t||(t=function(n){var e=0;return n&&(i.write(colorsUtil.stderr.red("ERROR: ")+n.stack.replace(/^ERROR: /i,"")+EOL),e=1),e}),f.version)return r.write("Version "+exports.version+(isDev?"-dev":"")+EOL),t(null);if(f.help||!n.length){var c=f.help?r:i,d=f.help?colorsUtil.stdout:colorsUtil.stderr;return c.write([d.white("SYNTAX")," "+d.cyan("asc")+" [entryFile ...] [options]","",d.white("EXAMPLES")," "+d.cyan("asc")+" hello.ts"," "+d.cyan("asc")+" hello.ts -b hello.wasm -t hello.wat"," "+d.cyan("asc")+" hello1.ts hello2.ts -b -O > hello.wasm","",d.white("OPTIONS")].concat(optionsUtil.help(exports.options,24,EOL)).join(EOL)+EOL),t(null)}if(!fs.readFileSync){if(o===z)throw Error("'options.readFile' must be specified");if(a===F)throw Error("'options.writeFile' must be specified");if(s===S)throw Error("'options.listFiles' must be specified")}const p=f.baseDir?path.resolve(f.baseDir):".",h=[];f.transform&&f.transform.forEach(n=>h.push(__webpack_require__(12)(path.isAbsolute(n=n.trim())?n:path.join(process.cwd(),n))));var g=null;Object.keys(exports.libraryFiles).forEach(n=>{n.indexOf("/")>=0||(l.parseCount++,l.parseTime+=measure(()=>{g=assemblyscript.parseFile(exports.libraryFiles[n],exports.libraryPrefix+n+".ts",!1,g)}))});const x=[];if(f.lib){let n=f.lib;"string"==typeof n&&(n=n.split(",")),Array.prototype.push.apply(x,n.map(n=>n.trim()));for(let n=0,e=x.length;n{g=assemblyscript.parseFile(a,exports.libraryPrefix+i,!1,g)})}}}function v(){for(var n,e;null!=(n=g.nextFile());){if(e=null,n.startsWith(exports.libraryPrefix)){const t=n.substring(exports.libraryPrefix.length),r=n.substring(exports.libraryPrefix.length)+"/index";if(exports.libraryFiles.hasOwnProperty(t))e=exports.libraryFiles[t],n=exports.libraryPrefix+t+".ts";else if(exports.libraryFiles.hasOwnProperty(r))e=exports.libraryFiles[r],n=exports.libraryPrefix+r+".ts";else for(let i=0,a=x.length;i{assemblyscript.parseFile(e,n,!1,g)})}if(checkDiagnostics(g,i))return t(Error("Parse error"))}{let n=String(f.runtime),e="rt/index-"+n,r=exports.libraryFiles[e];if(null==r){if(null==(r=o((e=n)+".ts",p)))return t(Error("Runtime '"+n+"' not found."))}else e="~lib/"+e;l.parseCount++,l.parseTime+=measure(()=>{g=assemblyscript.parseFile(r,e,!0,g)})}for(let e=0,r=n.length;e{g=assemblyscript.parseFile(a,i,!0,g)})}{let n=v();if(n)return n}!function(n,...e){h.forEach(t=>{"function"==typeof t[n]&&t[n](...e)})}("afterParse",g);{let n=v();if(n)return n}const m=assemblyscript.finishParsing(g);var b=0,y=0;f.optimize&&(b=exports.defaultOptimizeLevel,y=exports.defaultShrinkLevel),"number"==typeof f.optimizeLevel&&(b=f.optimizeLevel),"number"==typeof f.shrinkLevel&&(y=f.shrinkLevel),b=Math.min(Math.max(b,0),3),y=Math.min(Math.max(y,0),2);const _=assemblyscript.createOptions();if(assemblyscript.setTarget(_,0),assemblyscript.setNoAssert(_,f.noAssert),assemblyscript.setImportMemory(_,f.importMemory),assemblyscript.setSharedMemory(_,f.sharedMemory),assemblyscript.setImportTable(_,f.importTable),assemblyscript.setExplicitStart(_,f.explicitStart),assemblyscript.setMemoryBase(_,f.memoryBase>>>0),assemblyscript.setSourceMap(_,null!=f.sourceMap),assemblyscript.setOptimizeLevelHints(_,b,y),assemblyscript.setGlobalAlias(_,"Math","NativeMath"),assemblyscript.setGlobalAlias(_,"Mathf","NativeMathf"),assemblyscript.setGlobalAlias(_,"abort","~lib/builtins/abort"),assemblyscript.setGlobalAlias(_,"trace","~lib/builtins/trace"),f.use){let n=f.use;for(let e=0,r=n.length;e{T=assemblyscript.compileProgram(m,_)})}catch(n){return t(n)}if(checkDiagnostics(g,i))return T&&T.dispose(),t(Error("Compile error"));if(f.validate&&(l.validateCount++,l.validateTime+=measure(()=>{if(!T.validate())return T.dispose(),t(Error("Validate error"))})),"clamp"===f.trapMode)l.optimizeCount++,l.optimizeTime+=measure(()=>{T.runPasses(["trap-mode-clamp"])});else if("js"===f.trapMode)l.optimizeCount++,l.optimizeTime+=measure(()=>{T.runPasses(["trap-mode-js"])});else if("allow"!==f.trapMode)return T.dispose(),t(Error("Unsupported trap mode"));(b>=3||y>=2)&&(b=4),T.setOptimizeLevel(b),T.setShrinkLevel(y),T.setDebugInfo(f.debug);var A=[];if(f.runPasses&&("string"==typeof f.runPasses&&(f.runPasses=f.runPasses.split(",")),f.runPasses.length&&f.runPasses.forEach(n=>{A.indexOf(n)<0&&A.push(n)})),(b>0||y>0)&&(l.optimizeCount++,l.optimizeTime+=measure(()=>{T.optimize()})),A.length&&(l.optimizeCount++,l.optimizeTime+=measure(()=>{T.runPasses(A.map(n=>n.trim()))})),!f.noEmit){let n=!1,e=!1;if(null!=f.outFile&&(/\.was?t$/.test(f.outFile)&&null==f.textFile?f.textFile=f.outFile:/\.js$/.test(f.outFile)&&null==f.asmjsFile?f.asmjsFile=f.outFile:null==f.binaryFile&&(f.binaryFile=f.outFile)),null!=f.binaryFile){let r,s=null!=f.sourceMap?f.sourceMap.length?f.sourceMap:path.basename(f.binaryFile)+".map":null;if(l.emitCount++,l.emitTime+=measure(()=>{r=T.toBinary(s)}),f.binaryFile.length?a(f.binaryFile,r.output,p):(I(r.output),n=!0),e=!0,null!=r.sourceMap)if(f.binaryFile.length){let n=JSON.parse(r.sourceMap);n.sourceRoot=exports.sourceMapRoot,n.sources.forEach((e,r)=>{let i=null;if(e.startsWith(exports.libraryPrefix)){let n=e.substring(exports.libraryPrefix.length).replace(/\.ts$/,"");if(exports.libraryFiles.hasOwnProperty(n))i=exports.libraryFiles[n];else for(let n=0,t=x.length;n{t=T.toAsmjs()}),a(f.asmjsFile,t,p)):n||(l.emitCount++,l.emitTime+=measure(()=>{t=T.toAsmjs()}),I(t),n=!0),e=!0}if(null!=f.idlFile){let t;f.idlFile.length?(l.emitCount++,l.emitTime+=measure(()=>{t=assemblyscript.buildIDL(m)}),a(f.idlFile,t,p)):n||(l.emitCount++,l.emitTime+=measure(()=>{t=assemblyscript.buildIDL(m)}),I(t),n=!0),e=!0}if(null!=f.tsdFile){let t;f.tsdFile.length?(l.emitCount++,l.emitTime+=measure(()=>{t=assemblyscript.buildTSD(m)}),a(f.tsdFile,t,p)):n||(l.emitCount++,l.emitTime+=measure(()=>{t=assemblyscript.buildTSD(m)}),I(t),n=!0),e=!0}if(null!=f.textFile||!e){let e;f.textFile&&f.textFile.length?(l.emitCount++,l.emitTime+=measure(()=>{e=T.toText()}),a(f.textFile,e,p)):n||(l.emitCount++,l.emitTime+=measure(()=>{e=T.toText()}),I(e))}}return T.dispose(),f.measure&&printStats(l,i),f.printrtti&&printRTTI(m,i),t(null);function z(n,e){try{let t;return l.readCount++,l.readTime+=measure(()=>{t=fs.readFileSync(path.join(e,n),{encoding:"utf8"})}),t}catch(n){return null}}function F(n,e,t){try{return l.writeCount++,l.writeTime+=measure(()=>{mkdirp(path.join(t,path.dirname(n))),"string"==typeof e?fs.writeFileSync(path.join(t,n),e,{encoding:"utf8"}):fs.writeFileSync(path.join(t,n),e)}),!0}catch(n){return!1}}function S(n,e){var t;try{return l.readTime+=measure(()=>{t=fs.readdirSync(path.join(e,n)).filter(n=>/^(?!.*\.d\.ts$).*\.ts$/.test(n))}),t}catch(n){return[]}}function I(n){I.used||(l.writeCount++,I.used=!0),l.writeTime+=measure(()=>{"string"==typeof n?r.write(n,{encoding:"utf8"}):r.write(n)})}},exports.checkDiagnostics=checkDiagnostics,exports.createStats=createStats,process.hrtime||(process.hrtime=__webpack_require__(13)),exports.measure=measure,exports.formatTime=formatTime,exports.printStats=printStats,exports.printRTTI=printRTTI;var allocBuffer=void 0!==global&&global.Buffer?global.Buffer.allocUnsafe||function(n){return new global.Buffer(n)}:function(n){return new Uint8Array(n)};function createMemoryStream(n){var e=[];return e.write=function(e){if(n&&n(e),"string"==typeof e){let n=allocBuffer(utf8.length(e));utf8.write(e,n,0),e=n}this.push(e)},e.reset=function(){e.length=0},e.toBuffer=function(){for(var n=0,e=0,t=this.length;e191&&r<224?o[a++]=(31&r)<<6|63&n[e++]:r>239&&r<365?(r=((7&r)<<18|(63&n[e++])<<12|(63&n[e++])<<6|63&n[e++])-65536,o[a++]=55296+(r>>10),o[a++]=56320+(1023&r)):o[a++]=(15&r)<<12|(63&n[e++])<<6|63&n[e++],a>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,o)),a=0);return i?(a&&i.push(String.fromCharCode.apply(String,o.slice(0,a))),i.join("")):String.fromCharCode.apply(String,o.slice(0,a))},r.write=function(n,e,t){for(var r,i,o=t,a=0;a>6|192,e[t++]=63&r|128):55296==(64512&r)&&56320==(64512&(i=n.charCodeAt(a+1)))?(r=65536+((1023&r)<<10)+(1023&i),++a,e[t++]=r>>18|240,e[t++]=r>>12&63|128,e[t++]=r>>6&63|128,e[t++]=63&r|128):(e[t++]=r>>12|224,e[t++]=r>>6&63|128,e[t++]=63&r|128);return t-o}},function(n,e,t){(function(n){var t=void 0!==n&&n||{},r=t.env&&"CI"in t.env;function i(n,t){var i=t||{};return i.supported=n&&!!n.isTTY||r,i.gray=(n=>i.supported?e.GRAY+n+e.RESET:n),i.red=(n=>i.supported?e.RED+n+e.RESET:n),i.green=(n=>i.supported?e.GREEN+n+e.RESET:n),i.yellow=(n=>i.supported?e.YELLOW+n+e.RESET:n),i.blue=(n=>i.supported?e.BLUE+n+e.RESET:n),i.magenta=(n=>i.supported?e.MAGENTA+n+e.RESET:n),i.cyan=(n=>i.supported?e.CYAN+n+e.RESET:n),i.white=(n=>i.supported?e.WHITE+n+e.RESET:n),i}e.stdout=i(t.stdout,e),e.stderr=i(t.stderr),e.from=i,e.GRAY="",e.RED="",e.GREEN="",e.YELLOW="",e.BLUE="",e.MAGENTA="",e.CYAN="",e.WHITE="",e.RESET=""}).call(this,t(0))},function(n,e){e.parse=function(n,e){var t={},r=[],arguments=[],i=[],o={};Object.keys(e).forEach(n=>{if(!n.startsWith(" ")){var r=e[n];null!=r.alias&&("string"==typeof r.alias?o[r.alias]=n:Array.isArray(r.alias)&&r.alias.forEach(e=>o[e]=n)),null!=r.default&&(t[n]=r.default)}});for(var a=0,s=(n=n.slice()).length;at[n]=s.value[n])}else r.push(i)}for(;a{var a=n[e];if(null!=a.description){for(var s="";s.length{for(let e=0;e 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}\n\n// Split a filename into [root, dir, basename, ext], unix version\n// 'root' is just a slash, or nothing.\nvar splitPathRe =\n /^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;\nvar splitPath = function(filename) {\n return splitPathRe.exec(filename).slice(1);\n};\n\n// path.resolve([from ...], to)\n// posix version\nexports.resolve = function() {\n var resolvedPath = '',\n resolvedAbsolute = false;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : process.cwd();\n\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n};\n\n// path.normalize(path)\n// posix version\nexports.normalize = function(path) {\n var isAbsolute = exports.isAbsolute(path),\n trailingSlash = substr(path, -1) === '/';\n\n // Normalize the path\n path = normalizeArray(filter(path.split('/'), function(p) {\n return !!p;\n }), !isAbsolute).join('/');\n\n if (!path && !isAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n\n return (isAbsolute ? '/' : '') + path;\n};\n\n// posix version\nexports.isAbsolute = function(path) {\n return path.charAt(0) === '/';\n};\n\n// posix version\nexports.join = function() {\n var paths = Array.prototype.slice.call(arguments, 0);\n return exports.normalize(filter(paths, function(p, index) {\n if (typeof p !== 'string') {\n throw new TypeError('Arguments to path.join must be strings');\n }\n return p;\n }).join('/'));\n};\n\n\n// path.relative(from, to)\n// posix version\nexports.relative = function(from, to) {\n from = exports.resolve(from).substr(1);\n to = exports.resolve(to).substr(1);\n\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n};\n\nexports.sep = '/';\nexports.delimiter = ':';\n\nexports.dirname = function(path) {\n var result = splitPath(path),\n root = result[0],\n dir = result[1];\n\n if (!root && !dir) {\n // No dirname whatsoever\n return '.';\n }\n\n if (dir) {\n // It has a dirname, strip trailing slash\n dir = dir.substr(0, dir.length - 1);\n }\n\n return root + dir;\n};\n\n\nexports.basename = function(path, ext) {\n var f = splitPath(path)[2];\n // TODO: make this comparison case-insensitive on windows?\n if (ext && f.substr(-1 * ext.length) === ext) {\n f = f.substr(0, f.length - ext.length);\n }\n return f;\n};\n\n\nexports.extname = function(path) {\n return splitPath(path)[3];\n};\n\nfunction filter (xs, f) {\n if (xs.filter) return xs.filter(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n if (f(xs[i], i, xs)) res.push(xs[i]);\n }\n return res;\n}\n\n// String.prototype.substr - negative index don't work in IE8\nvar substr = 'ab'.substr(-1) === 'b'\n ? function (str, start, len) { return str.substr(start, len) }\n : function (str, start, len) {\n if (start < 0) start = str.length + start;\n return str.substr(start, len);\n }\n;\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","/**\r\n * Compiler frontend for node.js\r\n *\r\n * Uses the low-level API exported from src/index.ts so it works with the compiler compiled to\r\n * JavaScript as well as the compiler compiled to WebAssembly (eventually). Runs the sources\r\n * directly through ts-node if distribution files are not present (indicated by a `-dev` version).\r\n *\r\n * Can also be packaged as a bundle suitable for in-browser use with the standard library injected\r\n * in the build step. See dist/asc.js for the bundle and webpack.config.js for building details.\r\n *\r\n * @module cli/asc\r\n */\r\n\r\n// Use \".\" instead of \"/\" as cwd in browsers\r\nif (process.browser) process.cwd = function() { return \".\"; };\r\n\r\nconst fs = require(\"fs\");\r\nconst path = require(\"path\");\r\nconst utf8 = require(\"@protobufjs/utf8\");\r\nconst colorsUtil = require(\"./util/colors\");\r\nconst optionsUtil = require(\"./util/options\");\r\nconst mkdirp = require(\"./util/mkdirp\");\r\nconst EOL = process.platform === \"win32\" ? \"\\r\\n\" : \"\\n\";\r\n\r\n// Emscripten adds an `uncaughtException` listener to Binaryen that results in an additional\r\n// useless code fragment on top of an actual error. suppress this:\r\nif (process.removeAllListeners) process.removeAllListeners(\"uncaughtException\");\r\n\r\n// Use distribution files if present, otherwise run the sources directly\r\nvar assemblyscript, isDev = false;\r\n(() => {\r\n try { // `asc` on the command line\r\n assemblyscript = require(\"../dist/assemblyscript.js\");\r\n } catch (e) {\r\n try { // `asc` on the command line without dist files\r\n require(\"ts-node\").register({ project: path.join(__dirname, \"..\", \"src\", \"tsconfig.json\") });\r\n require(\"../src/glue/js\");\r\n assemblyscript = require(\"../src\");\r\n isDev = true;\r\n } catch (e_ts) {\r\n try { // `require(\"dist/asc.js\")` in explicit browser tests\r\n assemblyscript = eval(\"require('./assemblyscript')\");\r\n } catch (e) {\r\n // combine both errors that lead us here\r\n e.stack = e_ts.stack + \"\\n---\\n\" + e.stack;\r\n throw e;\r\n }\r\n }\r\n }\r\n})();\r\n\r\n/** Whether this is a webpack bundle or not. */\r\nexports.isBundle = typeof BUNDLE_VERSION === \"string\";\r\n\r\n/** Whether asc runs the sources directly or not. */\r\nexports.isDev = isDev;\r\n\r\n/** AssemblyScript version. */\r\nexports.version = exports.isBundle ? BUNDLE_VERSION : require(\"../package.json\").version;\r\n\r\n/** Available CLI options. */\r\nexports.options = require(\"./asc.json\");\r\n\r\n/** Common root used in source maps. */\r\nexports.sourceMapRoot = \"assemblyscript:///\";\r\n\r\n/** Prefix used for library files. */\r\nexports.libraryPrefix = assemblyscript.LIBRARY_PREFIX;\r\n\r\n/** Default Binaryen optimization level. */\r\nexports.defaultOptimizeLevel = 2;\r\n\r\n/** Default Binaryen shrink level. */\r\nexports.defaultShrinkLevel = 1;\r\n\r\n/** Bundled library files. */\r\nexports.libraryFiles = exports.isBundle ? BUNDLE_LIBRARY : (() => { // set up if not a bundle\r\n const libDir = path.join(__dirname, \"..\", \"std\", \"assembly\");\r\n const libFiles = require(\"glob\").sync(\"**/!(*.d).ts\", { cwd: libDir });\r\n const bundled = {};\r\n libFiles.forEach(file => bundled[file.replace(/\\.ts$/, \"\")] = fs.readFileSync(path.join(libDir, file), \"utf8\" ));\r\n return bundled;\r\n})();\r\n\r\n/** Bundled definition files. */\r\nexports.definitionFiles = exports.isBundle ? BUNDLE_DEFINITIONS : (() => { // set up if not a bundle\r\n const stdDir = path.join(__dirname, \"..\", \"std\");\r\n return {\r\n \"assembly\": fs.readFileSync(path.join(stdDir, \"assembly\", \"index.d.ts\"), \"utf8\"),\r\n \"portable\": fs.readFileSync(path.join(stdDir, \"portable\", \"index.d.ts\"), \"utf8\")\r\n };\r\n})();\r\n\r\n/** Convenience function that parses and compiles source strings directly. */\r\nexports.compileString = (sources, options) => {\r\n if (typeof sources === \"string\") sources = { \"input.ts\": sources };\r\n const output = Object.create({\r\n stdout: createMemoryStream(),\r\n stderr: createMemoryStream()\r\n });\r\n var argv = [\r\n \"--binaryFile\", \"binary\",\r\n \"--textFile\", \"text\",\r\n ];\r\n Object.keys(options || {}).forEach(key => {\r\n var val = options[key];\r\n if (Array.isArray(val)) val.forEach(val => argv.push(\"--\" + key, String(val)));\r\n else argv.push(\"--\" + key, String(val));\r\n });\r\n exports.main(argv.concat(Object.keys(sources)), {\r\n stdout: output.stdout,\r\n stderr: output.stderr,\r\n readFile: name => sources.hasOwnProperty(name) ? sources[name] : null,\r\n writeFile: (name, contents) => output[name] = contents,\r\n listFiles: () => []\r\n });\r\n return output;\r\n}\r\n\r\n/** Runs the command line utility using the specified arguments array. */\r\nexports.main = function main(argv, options, callback) {\r\n if (typeof options === \"function\") {\r\n callback = options;\r\n options = {};\r\n } else if (!options) {\r\n options = {};\r\n }\r\n\r\n const stdout = options.stdout || process.stdout;\r\n const stderr = options.stderr || process.stderr;\r\n const readFile = options.readFile || readFileNode;\r\n const writeFile = options.writeFile || writeFileNode;\r\n const listFiles = options.listFiles || listFilesNode;\r\n const stats = options.stats || createStats();\r\n\r\n // Output must be specified if not present in the environment\r\n if (!stdout) throw Error(\"'options.stdout' must be specified\");\r\n if (!stderr) throw Error(\"'options.stderr' must be specified\");\r\n\r\n const opts = optionsUtil.parse(argv, exports.options);\r\n const args = opts.options;\r\n argv = opts.arguments;\r\n if (args.noColors) {\r\n colorsUtil.stdout.supported =\r\n colorsUtil.stderr.supported = false;\r\n } else {\r\n colorsUtil.stdout = colorsUtil.from(stdout);\r\n colorsUtil.stderr = colorsUtil.from(stderr);\r\n }\r\n\r\n // Check for unknown arguments\r\n if (opts.unknown.length) {\r\n opts.unknown.forEach(arg => {\r\n stderr.write(colorsUtil.stderr.yellow(\"WARN: \") + \"Unknown option '\" + arg + \"'\" + EOL);\r\n });\r\n }\r\n\r\n // Check for trailing arguments\r\n if (opts.trailing.length) {\r\n stderr.write(colorsUtil.stderr.yellow(\"WARN: \") + \"Unsupported trailing arguments: \" + opts.trailing.join(\" \") + EOL);\r\n }\r\n\r\n // Use default callback if none is provided\r\n if (!callback) callback = function defaultCallback(err) {\r\n var code = 0;\r\n if (err) {\r\n stderr.write(colorsUtil.stderr.red(\"ERROR: \") + err.stack.replace(/^ERROR: /i, \"\") + EOL);\r\n code = 1;\r\n }\r\n return code;\r\n };\r\n\r\n // Just print the version if requested\r\n if (args.version) {\r\n stdout.write(\"Version \" + exports.version + (isDev ? \"-dev\" : \"\") + EOL);\r\n return callback(null);\r\n }\r\n // Print the help message if requested or no source files are provided\r\n if (args.help || !argv.length) {\r\n var out = args.help ? stdout : stderr;\r\n var color = args.help ? colorsUtil.stdout : colorsUtil.stderr;\r\n out.write([\r\n color.white(\"SYNTAX\"),\r\n \" \" + color.cyan(\"asc\") + \" [entryFile ...] [options]\",\r\n \"\",\r\n color.white(\"EXAMPLES\"),\r\n \" \" + color.cyan(\"asc\") + \" hello.ts\",\r\n \" \" + color.cyan(\"asc\") + \" hello.ts -b hello.wasm -t hello.wat\",\r\n \" \" + color.cyan(\"asc\") + \" hello1.ts hello2.ts -b -O > hello.wasm\",\r\n \"\",\r\n color.white(\"OPTIONS\"),\r\n ].concat(\r\n optionsUtil.help(exports.options, 24, EOL)\r\n ).join(EOL) + EOL);\r\n return callback(null);\r\n }\r\n\r\n // I/O must be specified if not present in the environment\r\n if (!fs.readFileSync) {\r\n if (readFile === readFileNode) throw Error(\"'options.readFile' must be specified\");\r\n if (writeFile === writeFileNode) throw Error(\"'options.writeFile' must be specified\");\r\n if (listFiles === listFilesNode) throw Error(\"'options.listFiles' must be specified\");\r\n }\r\n\r\n // Set up base directory\r\n const baseDir = args.baseDir ? path.resolve(args.baseDir) : \".\";\r\n\r\n // Set up transforms\r\n const transforms = [];\r\n if (args.transform) {\r\n args.transform.forEach(transform =>\r\n transforms.push(\r\n require(\r\n path.isAbsolute(transform = transform.trim())\r\n ? transform\r\n : path.join(process.cwd(), transform)\r\n )\r\n )\r\n );\r\n }\r\n function applyTransform(name, ...args) {\r\n transforms.forEach(transform => {\r\n if (typeof transform[name] === \"function\") transform[name](...args);\r\n });\r\n }\r\n\r\n // Begin parsing\r\n var parser = null;\r\n\r\n // Include library files\r\n if (!args.noLib) {\r\n Object.keys(exports.libraryFiles).forEach(libPath => {\r\n if (libPath.indexOf(\"/\") >= 0) return; // in sub-directory: imported on demand\r\n stats.parseCount++;\r\n stats.parseTime += measure(() => {\r\n parser = assemblyscript.parseFile(\r\n exports.libraryFiles[libPath],\r\n exports.libraryPrefix + libPath + \".ts\",\r\n false,\r\n parser\r\n );\r\n });\r\n });\r\n } else { // always include builtins\r\n stats.parseCount++;\r\n stats.parseTime += measure(() => {\r\n parser = assemblyscript.parseFile(\r\n exports.libraryFiles[\"builtins\"],\r\n exports.libraryPrefix + \"builtins.ts\",\r\n false,\r\n parser\r\n );\r\n });\r\n }\r\n const customLibDirs = [];\r\n if (args.lib) {\r\n let lib = args.lib;\r\n if (typeof lib === \"string\") lib = lib.split(\",\");\r\n Array.prototype.push.apply(customLibDirs, lib.map(lib => lib.trim()));\r\n for (let i = 0, k = customLibDirs.length; i < k; ++i) { // custom\r\n let libDir = customLibDirs[i];\r\n let libFiles;\r\n if (libDir.endsWith(\".ts\")) {\r\n libFiles = [ path.basename(libDir) ];\r\n libDir = path.dirname(libDir);\r\n } else {\r\n libFiles = listFiles(libDir);\r\n }\r\n for (let j = 0, l = libFiles.length; j < l; ++j) {\r\n let libPath = libFiles[j];\r\n let libText = readFile(libPath, libDir);\r\n if (libText === null) return callback(Error(\"Library file '\" + libPath + \"' not found.\"));\r\n stats.parseCount++;\r\n stats.parseTime += measure(() => {\r\n parser = assemblyscript.parseFile(\r\n libText,\r\n exports.libraryPrefix + libPath,\r\n false,\r\n parser\r\n );\r\n });\r\n }\r\n }\r\n }\r\n\r\n // Parses the backlog of imported files after including entry files\r\n function parseBacklog() {\r\n var sourcePath, sourceText;\r\n while ((sourcePath = parser.nextFile()) != null) {\r\n\r\n // Load library file if explicitly requested\r\n if (sourcePath.startsWith(exports.libraryPrefix)) {\r\n const plainName = sourcePath.substring(exports.libraryPrefix.length);\r\n const indexName = sourcePath.substring(exports.libraryPrefix.length) + \"/index\";\r\n if (exports.libraryFiles.hasOwnProperty(plainName)) {\r\n sourceText = exports.libraryFiles[plainName];\r\n sourcePath = exports.libraryPrefix + plainName + \".ts\";\r\n } else if (exports.libraryFiles.hasOwnProperty(indexName)) {\r\n sourceText = exports.libraryFiles[indexName];\r\n sourcePath = exports.libraryPrefix + indexName + \".ts\";\r\n } else {\r\n for (let i = 0, k = customLibDirs.length; i < k; ++i) {\r\n sourceText = readFile(plainName + \".ts\", customLibDirs[i]);\r\n if (sourceText !== null) {\r\n sourcePath = exports.libraryPrefix + plainName + \".ts\";\r\n break;\r\n } else {\r\n sourceText = readFile(indexName + \".ts\", customLibDirs[i]);\r\n if (sourceText !== null) {\r\n sourcePath = exports.libraryPrefix + indexName + \".ts\";\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Otherwise try nextFile.ts, nextFile/index.ts, ~lib/nextFile.ts, ~lib/nextFile/index.ts\r\n } else {\r\n const plainName = sourcePath;\r\n const indexName = sourcePath + \"/index\";\r\n sourceText = readFile(plainName + \".ts\", baseDir);\r\n if (sourceText !== null) {\r\n sourcePath = plainName + \".ts\";\r\n } else {\r\n sourceText = readFile(indexName + \".ts\", baseDir);\r\n if (sourceText !== null) {\r\n sourcePath = indexName + \".ts\";\r\n } else if (!plainName.startsWith(\".\")) {\r\n if (exports.libraryFiles.hasOwnProperty(plainName)) {\r\n sourceText = exports.libraryFiles[plainName];\r\n sourcePath = exports.libraryPrefix + plainName + \".ts\";\r\n } else if (exports.libraryFiles.hasOwnProperty(indexName)) {\r\n sourceText = exports.libraryFiles[indexName];\r\n sourcePath = exports.libraryPrefix + indexName + \".ts\";\r\n } else {\r\n for (let i = 0, k = customLibDirs.length; i < k; ++i) {\r\n const dir = customLibDirs[i];\r\n sourceText = readFile(plainName + \".ts\", customLibDirs[i]);\r\n if (sourceText !== null) {\r\n sourcePath = exports.libraryPrefix + plainName + \".ts\";\r\n break;\r\n } else {\r\n sourceText = readFile(indexName + \".ts\", customLibDirs[i]);\r\n if (sourceText !== null) {\r\n sourcePath = exports.libraryPrefix + indexName + \".ts\";\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if (sourceText == null) {\r\n return callback(Error(\"Import file '\" + sourcePath + \".ts' not found.\"));\r\n }\r\n stats.parseCount++;\r\n stats.parseTime += measure(() => {\r\n assemblyscript.parseFile(sourceText, sourcePath, false, parser);\r\n });\r\n }\r\n if (checkDiagnostics(parser, stderr)) {\r\n return callback(Error(\"Parse error\"));\r\n }\r\n }\r\n\r\n // Include entry files\r\n for (let i = 0, k = argv.length; i < k; ++i) {\r\n const filename = argv[i];\r\n\r\n let sourcePath = String(filename).replace(/\\\\/g, \"/\").replace(/(\\.ts|\\/)$/, \"\");\r\n\r\n // Try entryPath.ts, then entryPath/index.ts\r\n let sourceText = readFile(sourcePath + \".ts\", baseDir);\r\n if (sourceText === null) {\r\n sourceText = readFile(sourcePath + \"/index.ts\", baseDir);\r\n if (sourceText === null) {\r\n return callback(Error(\"Entry file '\" + sourcePath + \".ts' not found.\"));\r\n } else {\r\n sourcePath += \"/index.ts\";\r\n }\r\n } else {\r\n sourcePath += \".ts\";\r\n }\r\n\r\n stats.parseCount++;\r\n stats.parseTime += measure(() => {\r\n parser = assemblyscript.parseFile(sourceText, sourcePath, true, parser);\r\n });\r\n let code = parseBacklog();\r\n if (code) return code;\r\n }\r\n\r\n applyTransform(\"afterParse\", parser);\r\n {\r\n let code = parseBacklog();\r\n if (code) return code;\r\n }\r\n\r\n // Finish parsing\r\n const program = assemblyscript.finishParsing(parser);\r\n\r\n // Set up optimization levels\r\n var optimizeLevel = 0;\r\n var shrinkLevel = 0;\r\n if (args.optimize) {\r\n optimizeLevel = exports.defaultOptimizeLevel;\r\n shrinkLevel = exports.defaultShrinkLevel;\r\n }\r\n if (typeof args.optimizeLevel === \"number\") {\r\n optimizeLevel = args.optimizeLevel;\r\n }\r\n if (typeof args.shrinkLevel === \"number\") {\r\n shrinkLevel = args.shrinkLevel;\r\n }\r\n optimizeLevel = Math.min(Math.max(optimizeLevel, 0), 3);\r\n shrinkLevel = Math.min(Math.max(shrinkLevel, 0), 2);\r\n\r\n // Begin compilation\r\n const compilerOptions = assemblyscript.createOptions();\r\n assemblyscript.setTarget(compilerOptions, 0);\r\n assemblyscript.setNoAssert(compilerOptions, args.noAssert);\r\n assemblyscript.setImportMemory(compilerOptions, args.importMemory);\r\n assemblyscript.setSharedMemory(compilerOptions, args.sharedMemory);\r\n assemblyscript.setImportTable(compilerOptions, args.importTable);\r\n assemblyscript.setMemoryBase(compilerOptions, args.memoryBase >>> 0);\r\n assemblyscript.setSourceMap(compilerOptions, args.sourceMap != null);\r\n assemblyscript.setOptimizeLevelHints(compilerOptions, optimizeLevel, shrinkLevel);\r\n\r\n if (!args.noLib) {\r\n // Initialize default aliases\r\n assemblyscript.setGlobalAlias(compilerOptions, \"Math\", \"NativeMath\");\r\n assemblyscript.setGlobalAlias(compilerOptions, \"Mathf\", \"NativeMathf\");\r\n assemblyscript.setGlobalAlias(compilerOptions, \"abort\", \"~lib/env/abort\");\r\n assemblyscript.setGlobalAlias(compilerOptions, \"trace\", \"~lib/env/trace\");\r\n }\r\n\r\n // Add or override aliases if specified\r\n if (args.use) {\r\n let aliases = args.use;\r\n for (let i = 0, k = aliases.length; i < k; ++i) {\r\n let part = aliases[i];\r\n let p = part.indexOf(\"=\");\r\n if (p < 0) return callback(Error(\"Global alias '\" + part + \"' is invalid.\"));\r\n let name = part.substring(0, p).trim();\r\n let alias = part.substring(p + 1).trim();\r\n if (!name.length) return callback(Error(\"Global alias '\" + part + \"' is invalid.\"));\r\n assemblyscript.setGlobalAlias(compilerOptions, name, alias);\r\n }\r\n }\r\n\r\n // Enable additional features if specified\r\n var features = args.enable;\r\n if (features != null) {\r\n if (typeof features === \"string\") features = features.split(\",\");\r\n for (let i = 0, k = features.length; i < k; ++i) {\r\n let name = features[i].trim();\r\n let flag = assemblyscript[\"FEATURE_\" + name.replace(/\\-/g, \"_\").toUpperCase()];\r\n if (!flag) return callback(Error(\"Feature '\" + name + \"' is unknown.\"));\r\n assemblyscript.enableFeature(compilerOptions, flag);\r\n }\r\n }\r\n\r\n var module;\r\n stats.compileCount++;\r\n (() => {\r\n try {\r\n stats.compileTime += measure(() => {\r\n module = assemblyscript.compileProgram(program, compilerOptions);\r\n });\r\n } catch (e) {\r\n return callback(e);\r\n }\r\n })();\r\n if (checkDiagnostics(parser, stderr)) {\r\n if (module) module.dispose();\r\n return callback(Error(\"Compile error\"));\r\n }\r\n\r\n // Validate the module if requested\r\n if (args.validate) {\r\n stats.validateCount++;\r\n stats.validateTime += measure(() => {\r\n if (!module.validate()) {\r\n module.dispose();\r\n return callback(Error(\"Validate error\"));\r\n }\r\n });\r\n }\r\n\r\n // Set Binaryen-specific options\r\n if (args.trapMode === \"clamp\") {\r\n stats.optimizeCount++;\r\n stats.optimizeTime += measure(() => {\r\n module.runPasses([ \"trap-mode-clamp\" ]);\r\n });\r\n } else if (args.trapMode === \"js\") {\r\n stats.optimizeCount++;\r\n stats.optimizeTime += measure(() => {\r\n module.runPasses([ \"trap-mode-js\" ]);\r\n });\r\n } else if (args.trapMode !== \"allow\") {\r\n module.dispose();\r\n return callback(Error(\"Unsupported trap mode\"));\r\n }\r\n\r\n // Implicitly run costly non-LLVM optimizations on -O3 or -Oz\r\n // see: https://github.com/WebAssembly/binaryen/pull/1596\r\n if (optimizeLevel >= 3 || shrinkLevel >= 2) optimizeLevel = 4;\r\n\r\n module.setOptimizeLevel(optimizeLevel);\r\n module.setShrinkLevel(shrinkLevel);\r\n module.setDebugInfo(args.debug);\r\n\r\n var runPasses = [];\r\n if (args.runPasses) {\r\n if (typeof args.runPasses === \"string\") {\r\n args.runPasses = args.runPasses.split(\",\");\r\n }\r\n if (args.runPasses.length) {\r\n args.runPasses.forEach(pass => {\r\n if (runPasses.indexOf(pass) < 0)\r\n runPasses.push(pass);\r\n });\r\n }\r\n }\r\n\r\n // Optimize the module if requested\r\n if (optimizeLevel > 0 || shrinkLevel > 0) {\r\n stats.optimizeCount++;\r\n stats.optimizeTime += measure(() => {\r\n module.optimize();\r\n });\r\n }\r\n\r\n // Run additional passes if requested\r\n if (runPasses.length) {\r\n stats.optimizeCount++;\r\n stats.optimizeTime += measure(() => {\r\n module.runPasses(runPasses.map(pass => pass.trim()));\r\n });\r\n }\r\n\r\n // Prepare output\r\n if (!args.noEmit) {\r\n let hasStdout = false;\r\n let hasOutput = false;\r\n\r\n if (args.outFile != null) {\r\n if (/\\.was?t$/.test(args.outFile) && args.textFile == null) {\r\n args.textFile = args.outFile;\r\n } else if (/\\.js$/.test(args.outFile) && args.asmjsFile == null) {\r\n args.asmjsFile = args.outFile;\r\n } else if (args.binaryFile == null) {\r\n args.binaryFile = args.outFile;\r\n }\r\n }\r\n\r\n // Write binary\r\n if (args.binaryFile != null) {\r\n let sourceMapURL = args.sourceMap != null\r\n ? args.sourceMap.length\r\n ? args.sourceMap\r\n : path.basename(args.binaryFile) + \".map\"\r\n : null;\r\n\r\n let wasm;\r\n stats.emitCount++;\r\n stats.emitTime += measure(() => {\r\n wasm = module.toBinary(sourceMapURL)\r\n });\r\n\r\n if (args.binaryFile.length) {\r\n writeFile(args.binaryFile, wasm.output, baseDir);\r\n } else {\r\n writeStdout(wasm.output);\r\n hasStdout = true;\r\n }\r\n hasOutput = true;\r\n\r\n // Post-process source map\r\n if (wasm.sourceMap != null) {\r\n if (args.binaryFile.length) {\r\n let sourceMap = JSON.parse(wasm.sourceMap);\r\n sourceMap.sourceRoot = exports.sourceMapRoot;\r\n sourceMap.sources.forEach((name, index) => {\r\n let text = null;\r\n if (name.startsWith(exports.libraryPrefix)) {\r\n let stdName = name.substring(exports.libraryPrefix.length).replace(/\\.ts$/, \"\");\r\n if (exports.libraryFiles.hasOwnProperty(stdName)) {\r\n text = exports.libraryFiles[stdName];\r\n } else {\r\n for (let i = 0, k = customLibDirs.length; i < k; ++i) {\r\n text = readFile(name.substring(exports.libraryPrefix.length), customLibDirs[i]);\r\n if (text !== null) break;\r\n }\r\n }\r\n } else {\r\n text = readFile(name, baseDir);\r\n }\r\n if (text === null) {\r\n return callback(Error(\"Source file '\" + name + \"' not found.\"));\r\n }\r\n if (!sourceMap.sourceContents) sourceMap.sourceContents = [];\r\n sourceMap.sourceContents[index] = text;\r\n });\r\n writeFile(path.join(\r\n path.dirname(args.binaryFile),\r\n path.basename(sourceMapURL)\r\n ).replace(/^\\.\\//, \"\"), JSON.stringify(sourceMap), baseDir);\r\n } else {\r\n stderr.write(\"Skipped source map (stdout already occupied)\" + EOL);\r\n }\r\n }\r\n }\r\n\r\n // Write asm.js\r\n if (args.asmjsFile != null) {\r\n let asm;\r\n if (args.asmjsFile.length) {\r\n stats.emitCount++;\r\n stats.emitTime += measure(() => {\r\n asm = module.toAsmjs();\r\n });\r\n writeFile(args.asmjsFile, asm, baseDir);\r\n } else if (!hasStdout) {\r\n stats.emitCount++;\r\n stats.emitTime += measure(() => {\r\n asm = module.toAsmjs();\r\n });\r\n writeStdout(asm);\r\n hasStdout = true;\r\n }\r\n hasOutput = true;\r\n }\r\n\r\n // Write WebIDL\r\n if (args.idlFile != null) {\r\n let idl;\r\n if (args.idlFile.length) {\r\n stats.emitCount++;\r\n stats.emitTime += measure(() => {\r\n idl = assemblyscript.buildIDL(program);\r\n });\r\n writeFile(args.idlFile, idl, baseDir);\r\n } else if (!hasStdout) {\r\n stats.emitCount++;\r\n stats.emitTime += measure(() => {\r\n idl = assemblyscript.buildIDL(program);\r\n });\r\n writeStdout(idl);\r\n hasStdout = true;\r\n }\r\n hasOutput = true;\r\n }\r\n\r\n // Write TypeScript definition\r\n if (args.tsdFile != null) {\r\n let tsd;\r\n if (args.tsdFile.length) {\r\n stats.emitCount++;\r\n stats.emitTime += measure(() => {\r\n tsd = assemblyscript.buildTSD(program);\r\n });\r\n writeFile(args.tsdFile, tsd, baseDir);\r\n } else if (!hasStdout) {\r\n stats.emitCount++;\r\n stats.emitTime += measure(() => {\r\n tsd = assemblyscript.buildTSD(program);\r\n });\r\n writeStdout(tsd);\r\n hasStdout = true;\r\n }\r\n hasOutput = true;\r\n }\r\n\r\n // Write text (must be last)\r\n if (args.textFile != null || !hasOutput) {\r\n let wat;\r\n if (args.textFile && args.textFile.length) {\r\n stats.emitCount++;\r\n stats.emitTime += measure(() => {\r\n wat = module.toText();\r\n });\r\n writeFile(args.textFile, wat, baseDir);\r\n } else if (!hasStdout) {\r\n stats.emitCount++;\r\n stats.emitTime += measure(() => {\r\n wat = module.toText()\r\n });\r\n writeStdout(wat);\r\n }\r\n }\r\n }\r\n\r\n module.dispose();\r\n if (args.measure) {\r\n printStats(stats, stderr);\r\n }\r\n return callback(null);\r\n\r\n function readFileNode(filename, baseDir) {\r\n try {\r\n let text;\r\n stats.readCount++;\r\n stats.readTime += measure(() => {\r\n text = fs.readFileSync(path.join(baseDir, filename), { encoding: \"utf8\" });\r\n });\r\n return text;\r\n } catch (e) {\r\n return null;\r\n }\r\n }\r\n\r\n function writeFileNode(filename, contents, baseDir) {\r\n try {\r\n stats.writeCount++;\r\n stats.writeTime += measure(() => {\r\n mkdirp(path.join(baseDir, path.dirname(filename)));\r\n if (typeof contents === \"string\") {\r\n fs.writeFileSync(path.join(baseDir, filename), contents, { encoding: \"utf8\" } );\r\n } else {\r\n fs.writeFileSync(path.join(baseDir, filename), contents);\r\n }\r\n });\r\n return true;\r\n } catch (e) {\r\n return false;\r\n }\r\n }\r\n\r\n function listFilesNode(dirname, baseDir) {\r\n var files;\r\n try {\r\n stats.readTime += measure(() => {\r\n files = fs.readdirSync(path.join(baseDir, dirname)).filter(file => /^(?!.*\\.d\\.ts$).*\\.ts$/.test(file));\r\n });\r\n return files;\r\n } catch (e) {\r\n return [];\r\n }\r\n }\r\n\r\n function writeStdout(contents) {\r\n if (!writeStdout.used) {\r\n stats.writeCount++;\r\n writeStdout.used = true;\r\n }\r\n stats.writeTime += measure(() => {\r\n if (typeof contents === \"string\") {\r\n stdout.write(contents, { encoding: \"utf8\" });\r\n } else {\r\n stdout.write(contents);\r\n }\r\n });\r\n }\r\n}\r\n\r\n/** Checks diagnostics emitted so far for errors. */\r\nfunction checkDiagnostics(emitter, stderr) {\r\n var diagnostic;\r\n var hasErrors = false;\r\n while ((diagnostic = assemblyscript.nextDiagnostic(emitter)) != null) {\r\n if (stderr) {\r\n stderr.write(\r\n assemblyscript.formatDiagnostic(diagnostic, stderr.isTTY, true) +\r\n EOL + EOL\r\n );\r\n }\r\n if (assemblyscript.isError(diagnostic)) hasErrors = true;\r\n }\r\n return hasErrors;\r\n}\r\n\r\nexports.checkDiagnostics = checkDiagnostics;\r\n\r\n/** Creates an empty set of stats. */\r\nfunction createStats() {\r\n return {\r\n readTime: 0,\r\n readCount: 0,\r\n writeTime: 0,\r\n writeCount: 0,\r\n parseTime: 0,\r\n parseCount: 0,\r\n compileTime: 0,\r\n compileCount: 0,\r\n emitTime: 0,\r\n emitCount: 0,\r\n validateTime: 0,\r\n validateCount: 0,\r\n optimizeTime: 0,\r\n optimizeCount: 0\r\n };\r\n}\r\n\r\nexports.createStats = createStats;\r\n\r\nif (!process.hrtime) process.hrtime = require(\"browser-process-hrtime\");\r\n\r\n/** Measures the execution time of the specified function. */\r\nfunction measure(fn) {\r\n const start = process.hrtime();\r\n fn();\r\n const times = process.hrtime(start);\r\n return times[0] * 1e9 + times[1];\r\n}\r\n\r\nexports.measure = measure;\r\n\r\n/** Formats a high resolution time to a human readable string. */\r\nfunction formatTime(time) {\r\n return time ? (time / 1e6).toFixed(3) + \" ms\" : \"N/A\";\r\n}\r\n\r\nexports.formatTime = formatTime;\r\n\r\n/** Formats and prints out the contents of a set of stats. */\r\nfunction printStats(stats, output) {\r\n function format(time, count) {\r\n return formatTime(time);\r\n }\r\n (output || process.stdout).write([\r\n \"I/O Read : \" + format(stats.readTime, stats.readCount),\r\n \"I/O Write : \" + format(stats.writeTime, stats.writeCount),\r\n \"Parse : \" + format(stats.parseTime, stats.parseCount),\r\n \"Compile : \" + format(stats.compileTime, stats.compileCount),\r\n \"Emit : \" + format(stats.emitTime, stats.emitCount),\r\n \"Validate : \" + format(stats.validateTime, stats.validateCount),\r\n \"Optimize : \" + format(stats.optimizeTime, stats.optimizeCount)\r\n ].join(EOL) + EOL);\r\n}\r\n\r\nexports.printStats = printStats;\r\n\r\nvar allocBuffer = typeof global !== \"undefined\" && global.Buffer\r\n ? global.Buffer.allocUnsafe || function(len) { return new global.Buffer(len); }\r\n : function(len) { return new Uint8Array(len) };\r\n\r\n/** Creates a memory stream that can be used in place of stdout/stderr. */\r\nfunction createMemoryStream(fn) {\r\n var stream = [];\r\n stream.write = function(chunk) {\r\n if (fn) fn(chunk);\r\n if (typeof chunk === \"string\") {\r\n let buffer = allocBuffer(utf8.length(chunk));\r\n utf8.write(chunk, buffer, 0);\r\n chunk = buffer;\r\n }\r\n this.push(chunk);\r\n };\r\n stream.reset = function() {\r\n stream.length = 0;\r\n };\r\n stream.toBuffer = function() {\r\n var offset = 0, i = 0, k = this.length;\r\n while (i < k) offset += this[i++].length;\r\n var buffer = allocBuffer(offset);\r\n offset = i = 0;\r\n while (i < k) {\r\n buffer.set(this[i], offset);\r\n offset += this[i].length;\r\n ++i;\r\n }\r\n return buffer;\r\n };\r\n stream.toString = function() {\r\n var buffer = this.toBuffer();\r\n return utf8.read(buffer, 0, buffer.length);\r\n };\r\n return stream;\r\n}\r\n\r\nexports.createMemoryStream = createMemoryStream;\r\n\r\n/** Compatible TypeScript compiler options for syntax highlighting etc. */\r\nexports.tscOptions = {\r\n alwaysStrict: true,\r\n noImplicitAny: true,\r\n noImplicitReturns: true,\r\n noImplicitThis: true,\r\n noEmitOnError: true,\r\n strictNullChecks: true,\r\n experimentalDecorators: true,\r\n target: \"esnext\",\r\n module: \"commonjs\",\r\n noLib: true,\r\n types: [],\r\n allowJs: false\r\n};\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal UTF8 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar utf8 = exports;\r\n\r\n/**\r\n * Calculates the UTF8 byte length of a string.\r\n * @param {string} string String\r\n * @returns {number} Byte length\r\n */\r\nutf8.length = function utf8_length(string) {\r\n var len = 0,\r\n c = 0;\r\n for (var i = 0; i < string.length; ++i) {\r\n c = string.charCodeAt(i);\r\n if (c < 128)\r\n len += 1;\r\n else if (c < 2048)\r\n len += 2;\r\n else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n ++i;\r\n len += 4;\r\n } else\r\n len += 3;\r\n }\r\n return len;\r\n};\r\n\r\n/**\r\n * Reads UTF8 bytes as a string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} String read\r\n */\r\nutf8.read = function utf8_read(buffer, start, end) {\r\n var len = end - start;\r\n if (len < 1)\r\n return \"\";\r\n var parts = null,\r\n chunk = [],\r\n i = 0, // char offset\r\n t; // temporary\r\n while (start < end) {\r\n t = buffer[start++];\r\n if (t < 128)\r\n chunk[i++] = t;\r\n else if (t > 191 && t < 224)\r\n chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;\r\n else if (t > 239 && t < 365) {\r\n t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;\r\n chunk[i++] = 0xD800 + (t >> 10);\r\n chunk[i++] = 0xDC00 + (t & 1023);\r\n } else\r\n chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\n/**\r\n * Writes a string as UTF8 bytes.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Bytes written\r\n */\r\nutf8.write = function utf8_write(string, buffer, offset) {\r\n var start = offset,\r\n c1, // character 1\r\n c2; // character 2\r\n for (var i = 0; i < string.length; ++i) {\r\n c1 = string.charCodeAt(i);\r\n if (c1 < 128) {\r\n buffer[offset++] = c1;\r\n } else if (c1 < 2048) {\r\n buffer[offset++] = c1 >> 6 | 192;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n ++i;\r\n buffer[offset++] = c1 >> 18 | 240;\r\n buffer[offset++] = c1 >> 12 & 63 | 128;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else {\r\n buffer[offset++] = c1 >> 12 | 224;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n }\r\n }\r\n return offset - start;\r\n};\r\n","var proc = typeof process !== \"undefined\" && process || {};\r\nvar isCI = proc.env && \"CI\" in proc.env; // doesn't work when bundled because 'process' is a mock\r\n\r\nfunction from(stream, base) {\r\n var colors = base || {};\r\n colors.supported = (stream && !!stream.isTTY) || isCI;\r\n colors.gray = text => colors.supported ? exports.GRAY + text + exports.RESET : text;\r\n colors.red = text => colors.supported ? exports.RED + text + exports.RESET : text;\r\n colors.green = text => colors.supported ? exports.GREEN + text + exports.RESET : text;\r\n colors.yellow = text => colors.supported ? exports.YELLOW + text + exports.RESET : text;\r\n colors.blue = text => colors.supported ? exports.BLUE + text + exports.RESET : text;\r\n colors.magenta = text => colors.supported ? exports.MAGENTA + text + exports.RESET : text;\r\n colors.cyan = text => colors.supported ? exports.CYAN + text + exports.RESET : text;\r\n colors.white = text => colors.supported ? exports.WHITE + text + exports.RESET : text;\r\n return colors;\r\n}\r\n\r\nexports.stdout = from(proc.stdout, exports);\r\nexports.stderr = from(proc.stderr);\r\nexports.from = from;\r\n\r\nexports.GRAY = \"\\u001b[90m\";\r\nexports.RED = \"\\u001b[91m\";\r\nexports.GREEN = \"\\u001b[92m\";\r\nexports.YELLOW = \"\\u001b[93m\";\r\nexports.BLUE = \"\\u001b[94m\";\r\nexports.MAGENTA = \"\\u001b[95m\";\r\nexports.CYAN = \"\\u001b[96m\";\r\nexports.WHITE = \"\\u001b[97m\";\r\nexports.RESET = \"\\u001b[0m\";\r\n","// type | meaning\r\n// -----|---------------\r\n// b | boolean\r\n// i | integer\r\n// f | float\r\n// s | string\r\n// I | integer array\r\n// F | float array\r\n// S | string array\r\n\r\n/** Parses the specified command line arguments according to the given configuration. */\r\nfunction parse(argv, config) {\r\n var options = {};\r\n var unknown = [];\r\n var arguments = [];\r\n var trailing = [];\r\n\r\n // make an alias map and initialize defaults\r\n var aliases = {};\r\n Object.keys(config).forEach(key => {\r\n if (key.startsWith(\" \")) return;\r\n var option = config[key];\r\n if (option.alias != null) {\r\n if (typeof option.alias === \"string\") aliases[option.alias] = key;\r\n else if (Array.isArray(option.alias)) option.alias.forEach(alias => aliases[alias] = key);\r\n }\r\n if (option.default != null) options[key] = option.default;\r\n });\r\n\r\n // iterate over argv\r\n for (var i = 0, k = (argv = argv.slice()).length; i < k; ++i) {\r\n let arg = argv[i];\r\n if (arg == \"--\") { ++i; break; }\r\n let match = /^(?:(\\-\\w)(?:=(.*))?|(\\-\\-\\w{2,})(?:=(.*))?)$/.exec(arg), option, key;\r\n if (match) {\r\n if (config[arg]) option = config[key = arg]; // exact\r\n else if (match[1] != null) { // alias\r\n option = config[key = aliases[match[1].substring(1)]];\r\n if (option && match[2] != null) argv[i--] = match[2];\r\n } else if (match[3] != null) { // full\r\n option = config[key = match[3].substring(2)];\r\n if (option && match[4] != null) argv[i--] = match[4];\r\n }\r\n } else {\r\n if (arg.charCodeAt(0) == 45) option = config[key = arg]; // exact\r\n else { arguments.push(arg); continue; } // argument\r\n }\r\n if (option) {\r\n if (option.type == null || option.type === \"b\") options[key] = true; // flag\r\n else {\r\n if (i + 1 < argv.length && argv[i + 1].charCodeAt(0) != 45) { // present\r\n switch (option.type) {\r\n case \"i\": options[key] = parseInt(argv[++i], 10); break;\r\n case \"I\": options[key] = (options[key] || []).concat(parseInt(argv[++i], 10)); break;\r\n case \"f\": options[key] = parseFloat(argv[++i]); break;\r\n case \"F\": options[key] = (options[key] || []).concat(parseFloat(argv[++i])); break;\r\n case \"s\": options[key] = String(argv[++i]); break;\r\n case \"S\": options[key] = (options[key] || []).concat(argv[++i].split(\",\")); break;\r\n default: unknown.push(arg); --i;\r\n }\r\n } else { // omitted\r\n switch (option.type) {\r\n case \"i\":\r\n case \"f\": options[key] = option.default || 0; break;\r\n case \"s\": options[key] = option.default || \"\"; break;\r\n case \"I\":\r\n case \"F\":\r\n case \"S\": options[key] = options.default || []; break;\r\n default: unknown.push(arg);\r\n }\r\n }\r\n }\r\n if (option.value) Object.keys(option.value).forEach(k => options[k] = option.value[k]);\r\n } else unknown.push(arg);\r\n }\r\n while (i < k) trailing.push(argv[i++]); // trailing\r\n\r\n return { options, unknown, arguments, trailing };\r\n}\r\n\r\nexports.parse = parse;\r\n\r\n/** Generates the help text for the specified configuration. */\r\nfunction help(config, options) {\r\n if (!options) options = {};\r\n var indent = options.indent || 2;\r\n var padding = options.padding || 24;\r\n var eol = options.eol || \"\\n\";\r\n var sb = [];\r\n Object.keys(config).forEach(key => {\r\n var option = config[key];\r\n if (option.description == null) return;\r\n var text = \"\";\r\n while (text.length < indent) text += \" \";\r\n text += \"--\" + key;\r\n if (option.alias) text += \", -\" + option.alias;\r\n while (text.length < padding) text += \" \";\r\n if (Array.isArray(option.description)) {\r\n sb.push(text + option.description[0] + option.description.slice(1).map(line => {\r\n for (let i = 0; i < padding; ++i) line = \" \" + line;\r\n return eol + line;\r\n }).join(\"\"));\r\n } else sb.push(text + option.description);\r\n });\r\n return sb.join(eol);\r\n}\r\n\r\nexports.help = help;\r\n","/*\r\nCopyright 2010 James Halliday (mail@substack.net)\r\n\r\nThis project is free software released under the MIT/X11 license:\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in\r\nall copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r\nTHE SOFTWARE.\r\n*/\r\n\r\nvar path = require(\"path\");\r\nvar fs = require(\"fs\");\r\nvar _0777 = parseInt(\"0777\", 8);\r\n\r\nmodule.exports = function mkdirp(p, opts, made) {\r\n if (!opts || typeof opts !== \"object\") {\r\n opts = { mode: opts };\r\n }\r\n var mode = opts.mode;\r\n if (mode === undefined) {\r\n mode = _0777 & (~process.umask());\r\n }\r\n if (!made) made = null;\r\n p = path.resolve(p);\r\n try {\r\n fs.mkdirSync(p, mode);\r\n made = made || p;\r\n } catch (err0) {\r\n switch (err0.code) {\r\n case \"ENOENT\":\r\n made = mkdirp(path.dirname(p), opts, made);\r\n mkdirp(p, opts, made);\r\n break;\r\n default:\r\n var stat;\r\n try {\r\n stat = fs.statSync(p);\r\n } catch (err1) {\r\n throw err0;\r\n }\r\n if (!stat.isDirectory()) throw err0;\r\n break;\r\n }\r\n }\r\n return made;\r\n};\r\n","if(typeof __WEBPACK_EXTERNAL_MODULE__10__ === 'undefined') {var e = new Error(\"Cannot find module 'assemblyscript'\"); e.code = 'MODULE_NOT_FOUND'; throw e;}\nmodule.exports = __WEBPACK_EXTERNAL_MODULE__10__;","function webpackEmptyContext(req) {\n\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\te.code = 'MODULE_NOT_FOUND';\n\tthrow e;\n}\nwebpackEmptyContext.keys = function() { return []; };\nwebpackEmptyContext.resolve = webpackEmptyContext;\nmodule.exports = webpackEmptyContext;\nwebpackEmptyContext.id = 12;","module.exports = process.hrtime || hrtime\n\n// polyfil for window.performance.now\nvar performance = global.performance || {}\nvar performanceNow =\n performance.now ||\n performance.mozNow ||\n performance.msNow ||\n performance.oNow ||\n performance.webkitNow ||\n function(){ return (new Date()).getTime() }\n\n// generate timestamp or delta\n// see http://nodejs.org/api/process.html#process_process_hrtime\nfunction hrtime(previousTimestamp){\n var clocktime = performanceNow.call(performance)*1e-3\n var seconds = Math.floor(clocktime)\n var nanoseconds = Math.floor((clocktime%1)*1e9)\n if (previousTimestamp) {\n seconds = seconds - previousTimestamp[0]\n nanoseconds = nanoseconds - previousTimestamp[1]\n if (nanoseconds<0) {\n seconds--\n nanoseconds += 1e9\n }\n }\n return [seconds,nanoseconds]\n}"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://asc/webpack/universalModuleDefinition","webpack://asc/webpack/bootstrap","webpack://asc/../node_modules/node-libs-browser/mock/process.js","webpack://asc/../node_modules/path-browserify/index.js","webpack://asc/../node_modules/webpack/buildin/global.js","webpack://asc/./asc.js","webpack://asc/../node_modules/@protobufjs/utf8/index.js","webpack://asc/./util/colors.js","webpack://asc/./util/options.js","webpack://asc/./util/mkdirp.js","webpack://asc/external \"assemblyscript\"","webpack://asc/. sync","webpack://asc/../node_modules/browser-process-hrtime/index.js"],"names":["root","factory","exports","module","require","e","define","amd","self","this","__WEBPACK_EXTERNAL_MODULE__10__","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","path","cwd","nextTick","fn","setTimeout","platform","arch","execPath","title","pid","browser","env","argv","binding","Error","chdir","dir","resolve","exit","kill","umask","dlopen","uptime","memoryUsage","uvCounters","features","process","normalizeArray","parts","allowAboveRoot","up","length","last","splice","unshift","splitPathRe","splitPath","filename","exec","slice","filter","xs","f","res","push","resolvedPath","resolvedAbsolute","arguments","TypeError","charAt","split","join","normalize","isAbsolute","trailingSlash","substr","paths","Array","index","relative","from","to","trim","arr","start","end","fromParts","toParts","Math","min","samePartsLength","outputParts","concat","sep","delimiter","dirname","result","basename","ext","extname","str","len","g","Function","window","global","fs","utf8","colorsUtil","optionsUtil","mkdirp","EOL","removeAllListeners","assemblyscript","isDev","checkDiagnostics","emitter","stderr","diagnostic","hasErrors","nextDiagnostic","write","formatDiagnostic","isTTY","isError","createStats","readTime","readCount","writeTime","writeCount","parseTime","parseCount","compileTime","compileCount","emitTime","emitCount","validateTime","validateCount","optimizeTime","optimizeCount","measure","hrtime","times","formatTime","time","toFixed","printStats","stats","output","format","count","stdout","printRTTI","program","buildRTTI","code","register","project","e_ts","eval","stack","isBundle","version","options","sourceMapRoot","libraryPrefix","LIBRARY_PREFIX","defaultOptimizeLevel","defaultShrinkLevel","libraryFiles","array","arraybuffer","bindings/Date","bindings/Math","bindings/wasi_unstable","bindings/wasi","builtins","dataview","date","diagnostics","error","fixedarray","heap","iterator","map","math","memory","number","polyfills","regexp","rt","rt/common","rt/index-full","rt/index-half","rt/index-none","rt/index-stub","rt/pure","rt/rtrace","rt/stub","rt/tlsf","set","shared/feature","shared/target","shared/typeinfo","string","symbol","table","typedarray","util/error","util/hash","util/memory","util/number","util/sort","util/string","vector","libDir","libFiles","sync","bundled","forEach","file","replace","readFileSync","definitionFiles","assembly","portable","stdDir","compileString","sources","input.ts","createMemoryStream","keys","val","isArray","String","main","readFile","writeFile","contents","listFiles","callback","readFileNode","writeFileNode","listFilesNode","opts","parse","args","noColors","supported","unknown","arg","yellow","trailing","err","red","help","out","color","white","cyan","baseDir","transforms","transform","parser","libPath","indexOf","parseFile","customLibDirs","lib","apply","k","endsWith","j","libText","parseBacklog","sourcePath","sourceText","nextFile","startsWith","plainName","substring","indexName","runtimeName","runtime","runtimePath","runtimeText","applyTransform","finishParsing","optimizeLevel","shrinkLevel","optimize","max","compilerOptions","createOptions","setTarget","setNoAssert","noAssert","setImportMemory","importMemory","setSharedMemory","sharedMemory","setImportTable","importTable","setExplicitStart","explicitStart","setMemoryBase","memoryBase","setSourceMap","sourceMap","setOptimizeLevelHints","setGlobalAlias","use","aliases","part","alias","enable","flag","toUpperCase","enableFeature","compileProgram","dispose","validate","trapMode","runPasses","setOptimizeLevel","setShrinkLevel","setDebugInfo","debug","pass","noEmit","hasStdout","hasOutput","outFile","test","textFile","asmjsFile","binaryFile","wasm","sourceMapURL","toBinary","writeStdout","JSON","sourceRoot","text","stdName","sourceContents","stringify","asm","toAsmjs","idlFile","idl","buildIDL","tsdFile","tsd","buildTSD","wat","toText","printrtti","encoding","writeFileSync","files","readdirSync","used","allocBuffer","Buffer","allocUnsafe","Uint8Array","stream","chunk","buffer","reset","toBuffer","offset","toString","read","tscOptions","alwaysStrict","noImplicitAny","noImplicitReturns","noImplicitThis","noEmitOnError","strictNullChecks","experimentalDecorators","target","noLib","types","allowJs","charCodeAt","fromCharCode","c1","c2","proc","isCI","base","colors","gray","GRAY","RESET","RED","green","GREEN","YELLOW","blue","BLUE","magenta","MAGENTA","CYAN","WHITE","config","option","default","match","type","parseInt","parseFloat","indent","padding","eol","sb","description","line","_0777","made","undefined","mkdirSync","err0","stat","statSync","err1","isDirectory","webpackEmptyContext","req","id","previousTimestamp","clocktime","performanceNow","performance","seconds","floor","nanoseconds","now","mozNow","msNow","oNow","webkitNow","Date","getTime"],"mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,EAAA,WAA0E,IAAM,OAAAG,QAAA,kBAAoC,MAAAC,KAApH,IACA,mBAAAC,eAAAC,IACAD,OAAA,mBAAAL,GACA,iBAAAC,QACAA,QAAA,I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AAA6Y,EAAA,KAEA,MADApc,EAAAgL,KAAA,mBACAhL,EAEAmc,EAAAvM,KAAA,WAAuC,UACvCuM,EAAAzY,QAAAyY,EACArc,EAAAD,QAAAsc,EACAA,EAAAE,GAAA,qBCRA,SAAAlY,EAAA2D,GAAAhI,EAAAD,QAAAsE,EAAA+F,QAcA,SAAAoS,GACA,IAAAC,EAAA,KAAAC,EAAA5b,KAAA6b,GACAC,EAAA7V,KAAA8V,MAAAJ,GACAK,EAAA/V,KAAA8V,MAAAJ,EAAA,OACAD,IACAI,GAAAJ,EAAA,IACAM,GAAAN,EAAA,IACA,IACAI,IACAE,GAAA,MAGA,OAAAF,EAAAE,IAvBA,IAAAH,EAAA3U,EAAA2U,aAAA,GACAD,EACAC,EAAAI,KACAJ,EAAAK,QACAL,EAAAM,OACAN,EAAAO,MACAP,EAAAQ,WACA,WAAa,WAAAC,MAAAC","file":"asc.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory((function webpackLoadOptionalExternalModule() { try { return require(\"assemblyscript\"); } catch(e) {} }()));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"assemblyscript\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"asc\"] = factory((function webpackLoadOptionalExternalModule() { try { return require(\"assemblyscript\"); } catch(e) {} }()));\n\telse\n\t\troot[\"asc\"] = factory(root[\"assemblyscript\"]);\n})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE__10__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 4);\n","exports.nextTick = function nextTick(fn) {\n\tsetTimeout(fn, 0);\n};\n\nexports.platform = exports.arch = \nexports.execPath = exports.title = 'browser';\nexports.pid = 1;\nexports.browser = true;\nexports.env = {};\nexports.argv = [];\n\nexports.binding = function (name) {\n\tthrow new Error('No such module. (Possibly not yet loaded)')\n};\n\n(function () {\n var cwd = '/';\n var path;\n exports.cwd = function () { return cwd };\n exports.chdir = function (dir) {\n if (!path) path = require('path');\n cwd = path.resolve(dir, cwd);\n };\n})();\n\nexports.exit = exports.kill = \nexports.umask = exports.dlopen = \nexports.uptime = exports.memoryUsage = \nexports.uvCounters = function() {};\nexports.features = {};\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// resolves . and .. elements in a path array with directory names there\n// must be no slashes, empty elements, or device names (c:\\) in the array\n// (so also no leading and trailing slashes - it does not distinguish\n// relative and absolute paths)\nfunction normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}\n\n// Split a filename into [root, dir, basename, ext], unix version\n// 'root' is just a slash, or nothing.\nvar splitPathRe =\n /^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;\nvar splitPath = function(filename) {\n return splitPathRe.exec(filename).slice(1);\n};\n\n// path.resolve([from ...], to)\n// posix version\nexports.resolve = function() {\n var resolvedPath = '',\n resolvedAbsolute = false;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : process.cwd();\n\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n};\n\n// path.normalize(path)\n// posix version\nexports.normalize = function(path) {\n var isAbsolute = exports.isAbsolute(path),\n trailingSlash = substr(path, -1) === '/';\n\n // Normalize the path\n path = normalizeArray(filter(path.split('/'), function(p) {\n return !!p;\n }), !isAbsolute).join('/');\n\n if (!path && !isAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n\n return (isAbsolute ? '/' : '') + path;\n};\n\n// posix version\nexports.isAbsolute = function(path) {\n return path.charAt(0) === '/';\n};\n\n// posix version\nexports.join = function() {\n var paths = Array.prototype.slice.call(arguments, 0);\n return exports.normalize(filter(paths, function(p, index) {\n if (typeof p !== 'string') {\n throw new TypeError('Arguments to path.join must be strings');\n }\n return p;\n }).join('/'));\n};\n\n\n// path.relative(from, to)\n// posix version\nexports.relative = function(from, to) {\n from = exports.resolve(from).substr(1);\n to = exports.resolve(to).substr(1);\n\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n};\n\nexports.sep = '/';\nexports.delimiter = ':';\n\nexports.dirname = function(path) {\n var result = splitPath(path),\n root = result[0],\n dir = result[1];\n\n if (!root && !dir) {\n // No dirname whatsoever\n return '.';\n }\n\n if (dir) {\n // It has a dirname, strip trailing slash\n dir = dir.substr(0, dir.length - 1);\n }\n\n return root + dir;\n};\n\n\nexports.basename = function(path, ext) {\n var f = splitPath(path)[2];\n // TODO: make this comparison case-insensitive on windows?\n if (ext && f.substr(-1 * ext.length) === ext) {\n f = f.substr(0, f.length - ext.length);\n }\n return f;\n};\n\n\nexports.extname = function(path) {\n return splitPath(path)[3];\n};\n\nfunction filter (xs, f) {\n if (xs.filter) return xs.filter(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n if (f(xs[i], i, xs)) res.push(xs[i]);\n }\n return res;\n}\n\n// String.prototype.substr - negative index don't work in IE8\nvar substr = 'ab'.substr(-1) === 'b'\n ? function (str, start, len) { return str.substr(start, len) }\n : function (str, start, len) {\n if (start < 0) start = str.length + start;\n return str.substr(start, len);\n }\n;\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","/**\r\n * Compiler frontend for node.js\r\n *\r\n * Uses the low-level API exported from src/index.ts so it works with the compiler compiled to\r\n * JavaScript as well as the compiler compiled to WebAssembly (eventually). Runs the sources\r\n * directly through ts-node if distribution files are not present (indicated by a `-dev` version).\r\n *\r\n * Can also be packaged as a bundle suitable for in-browser use with the standard library injected\r\n * in the build step. See dist/asc.js for the bundle and webpack.config.js for building details.\r\n *\r\n * @module cli/asc\r\n */\r\n\r\n// Use \".\" instead of \"/\" as cwd in browsers\r\nif (process.browser) process.cwd = function() { return \".\"; };\r\n\r\nconst fs = require(\"fs\");\r\nconst path = require(\"path\");\r\nconst utf8 = require(\"@protobufjs/utf8\");\r\nconst colorsUtil = require(\"./util/colors\");\r\nconst optionsUtil = require(\"./util/options\");\r\nconst mkdirp = require(\"./util/mkdirp\");\r\nconst EOL = process.platform === \"win32\" ? \"\\r\\n\" : \"\\n\";\r\n\r\n// global.Binaryen = require(\"../lib/binaryen\");\r\n\r\n// Emscripten adds an `uncaughtException` listener to Binaryen that results in an additional\r\n// useless code fragment on top of an actual error. suppress this:\r\nif (process.removeAllListeners) process.removeAllListeners(\"uncaughtException\");\r\n\r\n// Use distribution files if present, otherwise run the sources directly\r\nvar assemblyscript, isDev = false;\r\n(() => {\r\n try { // `asc` on the command line\r\n assemblyscript = require(\"../dist/assemblyscript.js\");\r\n } catch (e) {\r\n try { // `asc` on the command line without dist files\r\n require(\"ts-node\").register({ project: path.join(__dirname, \"..\", \"src\", \"tsconfig.json\") });\r\n require(\"../src/glue/js\");\r\n assemblyscript = require(\"../src\");\r\n isDev = true;\r\n } catch (e_ts) {\r\n try { // `require(\"dist/asc.js\")` in explicit browser tests\r\n assemblyscript = eval(\"require('./assemblyscript')\");\r\n } catch (e) {\r\n // combine both errors that lead us here\r\n e.stack = e_ts.stack + \"\\n---\\n\" + e.stack;\r\n throw e;\r\n }\r\n }\r\n }\r\n})();\r\n\r\n/** Whether this is a webpack bundle or not. */\r\nexports.isBundle = typeof BUNDLE_VERSION === \"string\";\r\n\r\n/** Whether asc runs the sources directly or not. */\r\nexports.isDev = isDev;\r\n\r\n/** AssemblyScript version. */\r\nexports.version = exports.isBundle ? BUNDLE_VERSION : require(\"../package.json\").version;\r\n\r\n/** Available CLI options. */\r\nexports.options = require(\"./asc.json\");\r\n\r\n/** Common root used in source maps. */\r\nexports.sourceMapRoot = \"assemblyscript:///\";\r\n\r\n/** Prefix used for library files. */\r\nexports.libraryPrefix = assemblyscript.LIBRARY_PREFIX;\r\n\r\n/** Default Binaryen optimization level. */\r\nexports.defaultOptimizeLevel = 3;\r\n\r\n/** Default Binaryen shrink level. */\r\nexports.defaultShrinkLevel = 1;\r\n\r\n/** Bundled library files. */\r\nexports.libraryFiles = exports.isBundle ? BUNDLE_LIBRARY : (() => { // set up if not a bundle\r\n const libDir = path.join(__dirname, \"..\", \"std\", \"assembly\");\r\n const libFiles = require(\"glob\").sync(\"**/!(*.d).ts\", { cwd: libDir });\r\n const bundled = {};\r\n libFiles.forEach(file => bundled[file.replace(/\\.ts$/, \"\")] = fs.readFileSync(path.join(libDir, file), \"utf8\" ));\r\n return bundled;\r\n})();\r\n\r\n/** Bundled definition files. */\r\nexports.definitionFiles = exports.isBundle ? BUNDLE_DEFINITIONS : (() => { // set up if not a bundle\r\n const stdDir = path.join(__dirname, \"..\", \"std\");\r\n return {\r\n \"assembly\": fs.readFileSync(path.join(stdDir, \"assembly\", \"index.d.ts\"), \"utf8\"),\r\n \"portable\": fs.readFileSync(path.join(stdDir, \"portable\", \"index.d.ts\"), \"utf8\")\r\n };\r\n})();\r\n\r\n/** Convenience function that parses and compiles source strings directly. */\r\nexports.compileString = (sources, options) => {\r\n if (typeof sources === \"string\") sources = { \"input.ts\": sources };\r\n const output = Object.create({\r\n stdout: createMemoryStream(),\r\n stderr: createMemoryStream()\r\n });\r\n var argv = [\r\n \"--binaryFile\", \"binary\",\r\n \"--textFile\", \"text\",\r\n ];\r\n Object.keys(options || {}).forEach(key => {\r\n var val = options[key];\r\n if (Array.isArray(val)) val.forEach(val => argv.push(\"--\" + key, String(val)));\r\n else argv.push(\"--\" + key, String(val));\r\n });\r\n exports.main(argv.concat(Object.keys(sources)), {\r\n stdout: output.stdout,\r\n stderr: output.stderr,\r\n readFile: name => sources.hasOwnProperty(name) ? sources[name] : null,\r\n writeFile: (name, contents) => output[name] = contents,\r\n listFiles: () => []\r\n });\r\n return output;\r\n}\r\n\r\n/** Runs the command line utility using the specified arguments array. */\r\nexports.main = function main(argv, options, callback) {\r\n if (typeof options === \"function\") {\r\n callback = options;\r\n options = {};\r\n } else if (!options) {\r\n options = {};\r\n }\r\n\r\n const stdout = options.stdout || process.stdout;\r\n const stderr = options.stderr || process.stderr;\r\n const readFile = options.readFile || readFileNode;\r\n const writeFile = options.writeFile || writeFileNode;\r\n const listFiles = options.listFiles || listFilesNode;\r\n const stats = options.stats || createStats();\r\n\r\n // Output must be specified if not present in the environment\r\n if (!stdout) throw Error(\"'options.stdout' must be specified\");\r\n if (!stderr) throw Error(\"'options.stderr' must be specified\");\r\n\r\n const opts = optionsUtil.parse(argv, exports.options);\r\n const args = opts.options;\r\n argv = opts.arguments;\r\n if (args.noColors) {\r\n colorsUtil.stdout.supported =\r\n colorsUtil.stderr.supported = false;\r\n } else {\r\n colorsUtil.stdout = colorsUtil.from(stdout);\r\n colorsUtil.stderr = colorsUtil.from(stderr);\r\n }\r\n\r\n // Check for unknown arguments\r\n if (opts.unknown.length) {\r\n opts.unknown.forEach(arg => {\r\n stderr.write(colorsUtil.stderr.yellow(\"WARN: \") + \"Unknown option '\" + arg + \"'\" + EOL);\r\n });\r\n }\r\n\r\n // Check for trailing arguments\r\n if (opts.trailing.length) {\r\n stderr.write(colorsUtil.stderr.yellow(\"WARN: \") + \"Unsupported trailing arguments: \" + opts.trailing.join(\" \") + EOL);\r\n }\r\n\r\n // Use default callback if none is provided\r\n if (!callback) callback = function defaultCallback(err) {\r\n var code = 0;\r\n if (err) {\r\n stderr.write(colorsUtil.stderr.red(\"ERROR: \") + err.stack.replace(/^ERROR: /i, \"\") + EOL);\r\n code = 1;\r\n }\r\n return code;\r\n };\r\n\r\n // Just print the version if requested\r\n if (args.version) {\r\n stdout.write(\"Version \" + exports.version + (isDev ? \"-dev\" : \"\") + EOL);\r\n return callback(null);\r\n }\r\n // Print the help message if requested or no source files are provided\r\n if (args.help || !argv.length) {\r\n var out = args.help ? stdout : stderr;\r\n var color = args.help ? colorsUtil.stdout : colorsUtil.stderr;\r\n out.write([\r\n color.white(\"SYNTAX\"),\r\n \" \" + color.cyan(\"asc\") + \" [entryFile ...] [options]\",\r\n \"\",\r\n color.white(\"EXAMPLES\"),\r\n \" \" + color.cyan(\"asc\") + \" hello.ts\",\r\n \" \" + color.cyan(\"asc\") + \" hello.ts -b hello.wasm -t hello.wat\",\r\n \" \" + color.cyan(\"asc\") + \" hello1.ts hello2.ts -b -O > hello.wasm\",\r\n \"\",\r\n color.white(\"OPTIONS\"),\r\n ].concat(\r\n optionsUtil.help(exports.options, 24, EOL)\r\n ).join(EOL) + EOL);\r\n return callback(null);\r\n }\r\n\r\n // I/O must be specified if not present in the environment\r\n if (!fs.readFileSync) {\r\n if (readFile === readFileNode) throw Error(\"'options.readFile' must be specified\");\r\n if (writeFile === writeFileNode) throw Error(\"'options.writeFile' must be specified\");\r\n if (listFiles === listFilesNode) throw Error(\"'options.listFiles' must be specified\");\r\n }\r\n\r\n // Set up base directory\r\n const baseDir = args.baseDir ? path.resolve(args.baseDir) : \".\";\r\n\r\n // Set up transforms\r\n const transforms = [];\r\n if (args.transform) {\r\n args.transform.forEach(transform =>\r\n transforms.push(\r\n require(\r\n path.isAbsolute(transform = transform.trim())\r\n ? transform\r\n : path.join(process.cwd(), transform)\r\n )\r\n )\r\n );\r\n }\r\n function applyTransform(name, ...args) {\r\n transforms.forEach(transform => {\r\n if (typeof transform[name] === \"function\") transform[name](...args);\r\n });\r\n }\r\n\r\n // Begin parsing\r\n var parser = null;\r\n\r\n // Include library files\r\n Object.keys(exports.libraryFiles).forEach(libPath => {\r\n if (libPath.indexOf(\"/\") >= 0) return; // in sub-directory: imported on demand\r\n stats.parseCount++;\r\n stats.parseTime += measure(() => {\r\n parser = assemblyscript.parseFile(\r\n exports.libraryFiles[libPath],\r\n exports.libraryPrefix + libPath + \".ts\",\r\n false,\r\n parser\r\n );\r\n });\r\n });\r\n const customLibDirs = [];\r\n if (args.lib) {\r\n let lib = args.lib;\r\n if (typeof lib === \"string\") lib = lib.split(\",\");\r\n Array.prototype.push.apply(customLibDirs, lib.map(lib => lib.trim()));\r\n for (let i = 0, k = customLibDirs.length; i < k; ++i) { // custom\r\n let libDir = customLibDirs[i];\r\n let libFiles;\r\n if (libDir.endsWith(\".ts\")) {\r\n libFiles = [ path.basename(libDir) ];\r\n libDir = path.dirname(libDir);\r\n } else {\r\n libFiles = listFiles(libDir);\r\n }\r\n for (let j = 0, l = libFiles.length; j < l; ++j) {\r\n let libPath = libFiles[j];\r\n let libText = readFile(libPath, libDir);\r\n if (libText === null) return callback(Error(\"Library file '\" + libPath + \"' not found.\"));\r\n stats.parseCount++;\r\n stats.parseTime += measure(() => {\r\n parser = assemblyscript.parseFile(\r\n libText,\r\n exports.libraryPrefix + libPath,\r\n false,\r\n parser\r\n );\r\n });\r\n }\r\n }\r\n }\r\n\r\n // Parses the backlog of imported files after including entry files\r\n function parseBacklog() {\r\n var sourcePath, sourceText;\r\n while ((sourcePath = parser.nextFile()) != null) {\r\n sourceText = null;\r\n\r\n // Load library file if explicitly requested\r\n if (sourcePath.startsWith(exports.libraryPrefix)) {\r\n const plainName = sourcePath.substring(exports.libraryPrefix.length);\r\n const indexName = sourcePath.substring(exports.libraryPrefix.length) + \"/index\";\r\n if (exports.libraryFiles.hasOwnProperty(plainName)) {\r\n sourceText = exports.libraryFiles[plainName];\r\n sourcePath = exports.libraryPrefix + plainName + \".ts\";\r\n } else if (exports.libraryFiles.hasOwnProperty(indexName)) {\r\n sourceText = exports.libraryFiles[indexName];\r\n sourcePath = exports.libraryPrefix + indexName + \".ts\";\r\n } else {\r\n for (let i = 0, k = customLibDirs.length; i < k; ++i) {\r\n sourceText = readFile(plainName + \".ts\", customLibDirs[i]);\r\n if (sourceText !== null) {\r\n sourcePath = exports.libraryPrefix + plainName + \".ts\";\r\n break;\r\n } else {\r\n sourceText = readFile(indexName + \".ts\", customLibDirs[i]);\r\n if (sourceText !== null) {\r\n sourcePath = exports.libraryPrefix + indexName + \".ts\";\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Otherwise try nextFile.ts, nextFile/index.ts, ~lib/nextFile.ts, ~lib/nextFile/index.ts\r\n } else {\r\n const plainName = sourcePath;\r\n const indexName = sourcePath + \"/index\";\r\n sourceText = readFile(plainName + \".ts\", baseDir);\r\n if (sourceText !== null) {\r\n sourcePath = plainName + \".ts\";\r\n } else {\r\n sourceText = readFile(indexName + \".ts\", baseDir);\r\n if (sourceText !== null) {\r\n sourcePath = indexName + \".ts\";\r\n } else if (!plainName.startsWith(\".\")) {\r\n if (exports.libraryFiles.hasOwnProperty(plainName)) {\r\n sourceText = exports.libraryFiles[plainName];\r\n sourcePath = exports.libraryPrefix + plainName + \".ts\";\r\n } else if (exports.libraryFiles.hasOwnProperty(indexName)) {\r\n sourceText = exports.libraryFiles[indexName];\r\n sourcePath = exports.libraryPrefix + indexName + \".ts\";\r\n } else {\r\n for (let i = 0, k = customLibDirs.length; i < k; ++i) {\r\n const dir = customLibDirs[i];\r\n sourceText = readFile(plainName + \".ts\", dir);\r\n if (sourceText !== null) {\r\n sourcePath = exports.libraryPrefix + plainName + \".ts\";\r\n break;\r\n } else {\r\n sourceText = readFile(indexName + \".ts\", dir);\r\n if (sourceText !== null) {\r\n sourcePath = exports.libraryPrefix + indexName + \".ts\";\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if (sourceText == null) {\r\n return callback(Error(\"Import file '\" + sourcePath + \".ts' not found.\"));\r\n }\r\n stats.parseCount++;\r\n stats.parseTime += measure(() => {\r\n assemblyscript.parseFile(sourceText, sourcePath, false, parser);\r\n });\r\n }\r\n if (checkDiagnostics(parser, stderr)) {\r\n return callback(Error(\"Parse error\"));\r\n }\r\n }\r\n\r\n // Include runtime template before entry files so its setup runs first\r\n {\r\n let runtimeName = String(args.runtime);\r\n let runtimePath = \"rt/index-\" + runtimeName;\r\n let runtimeText = exports.libraryFiles[runtimePath];\r\n if (runtimeText == null) {\r\n runtimePath = runtimeName;\r\n runtimeText = readFile(runtimePath + \".ts\", baseDir);\r\n if (runtimeText == null) {\r\n return callback(Error(\"Runtime '\" + runtimeName + \"' not found.\"));\r\n }\r\n } else {\r\n runtimePath = \"~lib/\" + runtimePath;\r\n }\r\n stats.parseCount++;\r\n stats.parseTime += measure(() => {\r\n parser = assemblyscript.parseFile(runtimeText, runtimePath, true, parser);\r\n });\r\n }\r\n\r\n // Include entry files\r\n for (let i = 0, k = argv.length; i < k; ++i) {\r\n const filename = argv[i];\r\n\r\n let sourcePath = String(filename).replace(/\\\\/g, \"/\").replace(/(\\.ts|\\/)$/, \"\");\r\n\r\n // Try entryPath.ts, then entryPath/index.ts\r\n let sourceText = readFile(sourcePath + \".ts\", baseDir);\r\n if (sourceText === null) {\r\n sourceText = readFile(sourcePath + \"/index.ts\", baseDir);\r\n if (sourceText === null) {\r\n return callback(Error(\"Entry file '\" + sourcePath + \".ts' not found.\"));\r\n } else {\r\n sourcePath += \"/index.ts\";\r\n }\r\n } else {\r\n sourcePath += \".ts\";\r\n }\r\n\r\n stats.parseCount++;\r\n stats.parseTime += measure(() => {\r\n parser = assemblyscript.parseFile(sourceText, sourcePath, true, parser);\r\n });\r\n }\r\n\r\n // Parse entry files\r\n {\r\n let code = parseBacklog();\r\n if (code) return code;\r\n }\r\n\r\n // Call afterParse transform hook\r\n applyTransform(\"afterParse\", parser);\r\n\r\n // Parse additional files, if any\r\n {\r\n let code = parseBacklog();\r\n if (code) return code;\r\n }\r\n\r\n // Finish parsing\r\n const program = assemblyscript.finishParsing(parser);\r\n\r\n // Set up optimization levels\r\n var optimizeLevel = 0;\r\n var shrinkLevel = 0;\r\n if (args.optimize) {\r\n optimizeLevel = exports.defaultOptimizeLevel;\r\n shrinkLevel = exports.defaultShrinkLevel;\r\n }\r\n if (typeof args.optimizeLevel === \"number\") {\r\n optimizeLevel = args.optimizeLevel;\r\n }\r\n if (typeof args.shrinkLevel === \"number\") {\r\n shrinkLevel = args.shrinkLevel;\r\n }\r\n optimizeLevel = Math.min(Math.max(optimizeLevel, 0), 3);\r\n shrinkLevel = Math.min(Math.max(shrinkLevel, 0), 2);\r\n\r\n // Begin compilation\r\n const compilerOptions = assemblyscript.createOptions();\r\n assemblyscript.setTarget(compilerOptions, 0);\r\n assemblyscript.setNoAssert(compilerOptions, args.noAssert);\r\n assemblyscript.setImportMemory(compilerOptions, args.importMemory);\r\n assemblyscript.setSharedMemory(compilerOptions, args.sharedMemory);\r\n assemblyscript.setImportTable(compilerOptions, args.importTable);\r\n assemblyscript.setExplicitStart(compilerOptions, args.explicitStart);\r\n assemblyscript.setMemoryBase(compilerOptions, args.memoryBase >>> 0);\r\n assemblyscript.setSourceMap(compilerOptions, args.sourceMap != null);\r\n assemblyscript.setOptimizeLevelHints(compilerOptions, optimizeLevel, shrinkLevel);\r\n\r\n // Initialize default aliases\r\n assemblyscript.setGlobalAlias(compilerOptions, \"Math\", \"NativeMath\");\r\n assemblyscript.setGlobalAlias(compilerOptions, \"Mathf\", \"NativeMathf\");\r\n assemblyscript.setGlobalAlias(compilerOptions, \"abort\", \"~lib/builtins/abort\");\r\n assemblyscript.setGlobalAlias(compilerOptions, \"trace\", \"~lib/builtins/trace\");\r\n\r\n // Add or override aliases if specified\r\n if (args.use) {\r\n let aliases = args.use;\r\n for (let i = 0, k = aliases.length; i < k; ++i) {\r\n let part = aliases[i];\r\n let p = part.indexOf(\"=\");\r\n if (p < 0) return callback(Error(\"Global alias '\" + part + \"' is invalid.\"));\r\n let name = part.substring(0, p).trim();\r\n let alias = part.substring(p + 1).trim();\r\n if (!name.length) return callback(Error(\"Global alias '\" + part + \"' is invalid.\"));\r\n assemblyscript.setGlobalAlias(compilerOptions, name, alias);\r\n }\r\n }\r\n\r\n // Enable additional features if specified\r\n var features = args.enable;\r\n if (features != null) {\r\n if (typeof features === \"string\") features = features.split(\",\");\r\n for (let i = 0, k = features.length; i < k; ++i) {\r\n let name = features[i].trim();\r\n let flag = assemblyscript[\"FEATURE_\" + name.replace(/\\-/g, \"_\").toUpperCase()];\r\n if (!flag) return callback(Error(\"Feature '\" + name + \"' is unknown.\"));\r\n assemblyscript.enableFeature(compilerOptions, flag);\r\n }\r\n }\r\n\r\n var module;\r\n stats.compileCount++;\r\n try {\r\n stats.compileTime += measure(() => {\r\n module = assemblyscript.compileProgram(program, compilerOptions);\r\n });\r\n } catch (e) {\r\n return callback(e);\r\n }\r\n if (checkDiagnostics(parser, stderr)) {\r\n if (module) module.dispose();\r\n return callback(Error(\"Compile error\"));\r\n }\r\n\r\n // Validate the module if requested\r\n if (args.validate) {\r\n stats.validateCount++;\r\n stats.validateTime += measure(() => {\r\n if (!module.validate()) {\r\n module.dispose();\r\n return callback(Error(\"Validate error\"));\r\n }\r\n });\r\n }\r\n\r\n // Set Binaryen-specific options\r\n if (args.trapMode === \"clamp\") {\r\n stats.optimizeCount++;\r\n stats.optimizeTime += measure(() => {\r\n module.runPasses([ \"trap-mode-clamp\" ]);\r\n });\r\n } else if (args.trapMode === \"js\") {\r\n stats.optimizeCount++;\r\n stats.optimizeTime += measure(() => {\r\n module.runPasses([ \"trap-mode-js\" ]);\r\n });\r\n } else if (args.trapMode !== \"allow\") {\r\n module.dispose();\r\n return callback(Error(\"Unsupported trap mode\"));\r\n }\r\n\r\n // Implicitly run costly non-LLVM optimizations on -O3 or -Oz\r\n // see: https://github.com/WebAssembly/binaryen/pull/1596\r\n if (optimizeLevel >= 3 || shrinkLevel >= 2) optimizeLevel = 4;\r\n\r\n module.setOptimizeLevel(optimizeLevel);\r\n module.setShrinkLevel(shrinkLevel);\r\n module.setDebugInfo(args.debug);\r\n\r\n var runPasses = [];\r\n if (args.runPasses) {\r\n if (typeof args.runPasses === \"string\") {\r\n args.runPasses = args.runPasses.split(\",\");\r\n }\r\n if (args.runPasses.length) {\r\n args.runPasses.forEach(pass => {\r\n if (runPasses.indexOf(pass) < 0)\r\n runPasses.push(pass);\r\n });\r\n }\r\n }\r\n\r\n // Optimize the module if requested\r\n if (optimizeLevel > 0 || shrinkLevel > 0) {\r\n stats.optimizeCount++;\r\n stats.optimizeTime += measure(() => {\r\n module.optimize();\r\n });\r\n }\r\n\r\n // Run additional passes if requested\r\n if (runPasses.length) {\r\n stats.optimizeCount++;\r\n stats.optimizeTime += measure(() => {\r\n module.runPasses(runPasses.map(pass => pass.trim()));\r\n });\r\n }\r\n\r\n // Prepare output\r\n if (!args.noEmit) {\r\n let hasStdout = false;\r\n let hasOutput = false;\r\n\r\n if (args.outFile != null) {\r\n if (/\\.was?t$/.test(args.outFile) && args.textFile == null) {\r\n args.textFile = args.outFile;\r\n } else if (/\\.js$/.test(args.outFile) && args.asmjsFile == null) {\r\n args.asmjsFile = args.outFile;\r\n } else if (args.binaryFile == null) {\r\n args.binaryFile = args.outFile;\r\n }\r\n }\r\n\r\n // Write binary\r\n if (args.binaryFile != null) {\r\n let sourceMapURL = args.sourceMap != null\r\n ? args.sourceMap.length\r\n ? args.sourceMap\r\n : path.basename(args.binaryFile) + \".map\"\r\n : null;\r\n\r\n let wasm;\r\n stats.emitCount++;\r\n stats.emitTime += measure(() => {\r\n wasm = module.toBinary(sourceMapURL)\r\n });\r\n\r\n if (args.binaryFile.length) {\r\n writeFile(args.binaryFile, wasm.output, baseDir);\r\n } else {\r\n writeStdout(wasm.output);\r\n hasStdout = true;\r\n }\r\n hasOutput = true;\r\n\r\n // Post-process source map\r\n if (wasm.sourceMap != null) {\r\n if (args.binaryFile.length) {\r\n let sourceMap = JSON.parse(wasm.sourceMap);\r\n sourceMap.sourceRoot = exports.sourceMapRoot;\r\n sourceMap.sources.forEach((name, index) => {\r\n let text = null;\r\n if (name.startsWith(exports.libraryPrefix)) {\r\n let stdName = name.substring(exports.libraryPrefix.length).replace(/\\.ts$/, \"\");\r\n if (exports.libraryFiles.hasOwnProperty(stdName)) {\r\n text = exports.libraryFiles[stdName];\r\n } else {\r\n for (let i = 0, k = customLibDirs.length; i < k; ++i) {\r\n text = readFile(name.substring(exports.libraryPrefix.length), customLibDirs[i]);\r\n if (text !== null) break;\r\n }\r\n }\r\n } else {\r\n text = readFile(name, baseDir);\r\n }\r\n if (text === null) {\r\n return callback(Error(\"Source file '\" + name + \"' not found.\"));\r\n }\r\n if (!sourceMap.sourceContents) sourceMap.sourceContents = [];\r\n sourceMap.sourceContents[index] = text;\r\n });\r\n writeFile(path.join(\r\n path.dirname(args.binaryFile),\r\n path.basename(sourceMapURL)\r\n ).replace(/^\\.\\//, \"\"), JSON.stringify(sourceMap), baseDir);\r\n } else {\r\n stderr.write(\"Skipped source map (stdout already occupied)\" + EOL);\r\n }\r\n }\r\n }\r\n\r\n // Write asm.js\r\n if (args.asmjsFile != null) {\r\n let asm;\r\n if (args.asmjsFile.length) {\r\n stats.emitCount++;\r\n stats.emitTime += measure(() => {\r\n asm = module.toAsmjs();\r\n });\r\n writeFile(args.asmjsFile, asm, baseDir);\r\n } else if (!hasStdout) {\r\n stats.emitCount++;\r\n stats.emitTime += measure(() => {\r\n asm = module.toAsmjs();\r\n });\r\n writeStdout(asm);\r\n hasStdout = true;\r\n }\r\n hasOutput = true;\r\n }\r\n\r\n // Write WebIDL\r\n if (args.idlFile != null) {\r\n let idl;\r\n if (args.idlFile.length) {\r\n stats.emitCount++;\r\n stats.emitTime += measure(() => {\r\n idl = assemblyscript.buildIDL(program);\r\n });\r\n writeFile(args.idlFile, idl, baseDir);\r\n } else if (!hasStdout) {\r\n stats.emitCount++;\r\n stats.emitTime += measure(() => {\r\n idl = assemblyscript.buildIDL(program);\r\n });\r\n writeStdout(idl);\r\n hasStdout = true;\r\n }\r\n hasOutput = true;\r\n }\r\n\r\n // Write TypeScript definition\r\n if (args.tsdFile != null) {\r\n let tsd;\r\n if (args.tsdFile.length) {\r\n stats.emitCount++;\r\n stats.emitTime += measure(() => {\r\n tsd = assemblyscript.buildTSD(program);\r\n });\r\n writeFile(args.tsdFile, tsd, baseDir);\r\n } else if (!hasStdout) {\r\n stats.emitCount++;\r\n stats.emitTime += measure(() => {\r\n tsd = assemblyscript.buildTSD(program);\r\n });\r\n writeStdout(tsd);\r\n hasStdout = true;\r\n }\r\n hasOutput = true;\r\n }\r\n\r\n // Write text (must be last)\r\n if (args.textFile != null || !hasOutput) {\r\n let wat;\r\n if (args.textFile && args.textFile.length) {\r\n stats.emitCount++;\r\n stats.emitTime += measure(() => {\r\n wat = module.toText();\r\n });\r\n writeFile(args.textFile, wat, baseDir);\r\n } else if (!hasStdout) {\r\n stats.emitCount++;\r\n stats.emitTime += measure(() => {\r\n wat = module.toText()\r\n });\r\n writeStdout(wat);\r\n }\r\n }\r\n }\r\n\r\n module.dispose();\r\n if (args.measure) {\r\n printStats(stats, stderr);\r\n }\r\n if (args.printrtti) {\r\n printRTTI(program, stderr);\r\n }\r\n return callback(null);\r\n\r\n function readFileNode(filename, baseDir) {\r\n try {\r\n let text;\r\n stats.readCount++;\r\n stats.readTime += measure(() => {\r\n text = fs.readFileSync(path.join(baseDir, filename), { encoding: \"utf8\" });\r\n });\r\n return text;\r\n } catch (e) {\r\n return null;\r\n }\r\n }\r\n\r\n function writeFileNode(filename, contents, baseDir) {\r\n try {\r\n stats.writeCount++;\r\n stats.writeTime += measure(() => {\r\n mkdirp(path.join(baseDir, path.dirname(filename)));\r\n if (typeof contents === \"string\") {\r\n fs.writeFileSync(path.join(baseDir, filename), contents, { encoding: \"utf8\" } );\r\n } else {\r\n fs.writeFileSync(path.join(baseDir, filename), contents);\r\n }\r\n });\r\n return true;\r\n } catch (e) {\r\n return false;\r\n }\r\n }\r\n\r\n function listFilesNode(dirname, baseDir) {\r\n var files;\r\n try {\r\n stats.readTime += measure(() => {\r\n files = fs.readdirSync(path.join(baseDir, dirname)).filter(file => /^(?!.*\\.d\\.ts$).*\\.ts$/.test(file));\r\n });\r\n return files;\r\n } catch (e) {\r\n return [];\r\n }\r\n }\r\n\r\n function writeStdout(contents) {\r\n if (!writeStdout.used) {\r\n stats.writeCount++;\r\n writeStdout.used = true;\r\n }\r\n stats.writeTime += measure(() => {\r\n if (typeof contents === \"string\") {\r\n stdout.write(contents, { encoding: \"utf8\" });\r\n } else {\r\n stdout.write(contents);\r\n }\r\n });\r\n }\r\n}\r\n\r\n/** Checks diagnostics emitted so far for errors. */\r\nfunction checkDiagnostics(emitter, stderr) {\r\n var diagnostic;\r\n var hasErrors = false;\r\n while ((diagnostic = assemblyscript.nextDiagnostic(emitter)) != null) {\r\n if (stderr) {\r\n stderr.write(\r\n assemblyscript.formatDiagnostic(diagnostic, stderr.isTTY, true) +\r\n EOL + EOL\r\n );\r\n }\r\n if (assemblyscript.isError(diagnostic)) hasErrors = true;\r\n }\r\n return hasErrors;\r\n}\r\n\r\nexports.checkDiagnostics = checkDiagnostics;\r\n\r\n/** Creates an empty set of stats. */\r\nfunction createStats() {\r\n return {\r\n readTime: 0,\r\n readCount: 0,\r\n writeTime: 0,\r\n writeCount: 0,\r\n parseTime: 0,\r\n parseCount: 0,\r\n compileTime: 0,\r\n compileCount: 0,\r\n emitTime: 0,\r\n emitCount: 0,\r\n validateTime: 0,\r\n validateCount: 0,\r\n optimizeTime: 0,\r\n optimizeCount: 0\r\n };\r\n}\r\n\r\nexports.createStats = createStats;\r\n\r\nif (!process.hrtime) process.hrtime = require(\"browser-process-hrtime\");\r\n\r\n/** Measures the execution time of the specified function. */\r\nfunction measure(fn) {\r\n const start = process.hrtime();\r\n fn();\r\n const times = process.hrtime(start);\r\n return times[0] * 1e9 + times[1];\r\n}\r\n\r\nexports.measure = measure;\r\n\r\n/** Formats a high resolution time to a human readable string. */\r\nfunction formatTime(time) {\r\n return time ? (time / 1e6).toFixed(3) + \" ms\" : \"N/A\";\r\n}\r\n\r\nexports.formatTime = formatTime;\r\n\r\n/** Formats and prints out the contents of a set of stats. */\r\nfunction printStats(stats, output) {\r\n function format(time, count) {\r\n return formatTime(time);\r\n }\r\n (output || process.stdout).write([\r\n \"I/O Read : \" + format(stats.readTime, stats.readCount),\r\n \"I/O Write : \" + format(stats.writeTime, stats.writeCount),\r\n \"Parse : \" + format(stats.parseTime, stats.parseCount),\r\n \"Compile : \" + format(stats.compileTime, stats.compileCount),\r\n \"Emit : \" + format(stats.emitTime, stats.emitCount),\r\n \"Validate : \" + format(stats.validateTime, stats.validateCount),\r\n \"Optimize : \" + format(stats.optimizeTime, stats.optimizeCount)\r\n ].join(EOL) + EOL);\r\n}\r\n\r\nexports.printStats = printStats;\r\n\r\n/** Prints runtime type information. */\r\nfunction printRTTI(program, output) {\r\n if (!output) output = process.stderr;\r\n output.write(\"# Runtime type information (RTTI)\\n\");\r\n output.write(assemblyscript.buildRTTI(program));\r\n}\r\n\r\nexports.printRTTI = printRTTI;\r\n\r\nvar allocBuffer = typeof global !== \"undefined\" && global.Buffer\r\n ? global.Buffer.allocUnsafe || function(len) { return new global.Buffer(len); }\r\n : function(len) { return new Uint8Array(len) };\r\n\r\n/** Creates a memory stream that can be used in place of stdout/stderr. */\r\nfunction createMemoryStream(fn) {\r\n var stream = [];\r\n stream.write = function(chunk) {\r\n if (fn) fn(chunk);\r\n if (typeof chunk === \"string\") {\r\n let buffer = allocBuffer(utf8.length(chunk));\r\n utf8.write(chunk, buffer, 0);\r\n chunk = buffer;\r\n }\r\n this.push(chunk);\r\n };\r\n stream.reset = function() {\r\n stream.length = 0;\r\n };\r\n stream.toBuffer = function() {\r\n var offset = 0, i = 0, k = this.length;\r\n while (i < k) offset += this[i++].length;\r\n var buffer = allocBuffer(offset);\r\n offset = i = 0;\r\n while (i < k) {\r\n buffer.set(this[i], offset);\r\n offset += this[i].length;\r\n ++i;\r\n }\r\n return buffer;\r\n };\r\n stream.toString = function() {\r\n var buffer = this.toBuffer();\r\n return utf8.read(buffer, 0, buffer.length);\r\n };\r\n return stream;\r\n}\r\n\r\nexports.createMemoryStream = createMemoryStream;\r\n\r\n/** Compatible TypeScript compiler options for syntax highlighting etc. */\r\nexports.tscOptions = {\r\n alwaysStrict: true,\r\n noImplicitAny: true,\r\n noImplicitReturns: true,\r\n noImplicitThis: true,\r\n noEmitOnError: true,\r\n strictNullChecks: true,\r\n experimentalDecorators: true,\r\n target: \"esnext\",\r\n module: \"commonjs\",\r\n noLib: true,\r\n types: [],\r\n allowJs: false\r\n};\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal UTF8 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar utf8 = exports;\r\n\r\n/**\r\n * Calculates the UTF8 byte length of a string.\r\n * @param {string} string String\r\n * @returns {number} Byte length\r\n */\r\nutf8.length = function utf8_length(string) {\r\n var len = 0,\r\n c = 0;\r\n for (var i = 0; i < string.length; ++i) {\r\n c = string.charCodeAt(i);\r\n if (c < 128)\r\n len += 1;\r\n else if (c < 2048)\r\n len += 2;\r\n else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n ++i;\r\n len += 4;\r\n } else\r\n len += 3;\r\n }\r\n return len;\r\n};\r\n\r\n/**\r\n * Reads UTF8 bytes as a string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} String read\r\n */\r\nutf8.read = function utf8_read(buffer, start, end) {\r\n var len = end - start;\r\n if (len < 1)\r\n return \"\";\r\n var parts = null,\r\n chunk = [],\r\n i = 0, // char offset\r\n t; // temporary\r\n while (start < end) {\r\n t = buffer[start++];\r\n if (t < 128)\r\n chunk[i++] = t;\r\n else if (t > 191 && t < 224)\r\n chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;\r\n else if (t > 239 && t < 365) {\r\n t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;\r\n chunk[i++] = 0xD800 + (t >> 10);\r\n chunk[i++] = 0xDC00 + (t & 1023);\r\n } else\r\n chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\n/**\r\n * Writes a string as UTF8 bytes.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Bytes written\r\n */\r\nutf8.write = function utf8_write(string, buffer, offset) {\r\n var start = offset,\r\n c1, // character 1\r\n c2; // character 2\r\n for (var i = 0; i < string.length; ++i) {\r\n c1 = string.charCodeAt(i);\r\n if (c1 < 128) {\r\n buffer[offset++] = c1;\r\n } else if (c1 < 2048) {\r\n buffer[offset++] = c1 >> 6 | 192;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n ++i;\r\n buffer[offset++] = c1 >> 18 | 240;\r\n buffer[offset++] = c1 >> 12 & 63 | 128;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else {\r\n buffer[offset++] = c1 >> 12 | 224;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n }\r\n }\r\n return offset - start;\r\n};\r\n","var proc = typeof process !== \"undefined\" && process || {};\r\nvar isCI = proc.env && \"CI\" in proc.env; // doesn't work when bundled because 'process' is a mock\r\n\r\nfunction from(stream, base) {\r\n var colors = base || {};\r\n colors.supported = (stream && !!stream.isTTY) || isCI;\r\n colors.gray = text => colors.supported ? exports.GRAY + text + exports.RESET : text;\r\n colors.red = text => colors.supported ? exports.RED + text + exports.RESET : text;\r\n colors.green = text => colors.supported ? exports.GREEN + text + exports.RESET : text;\r\n colors.yellow = text => colors.supported ? exports.YELLOW + text + exports.RESET : text;\r\n colors.blue = text => colors.supported ? exports.BLUE + text + exports.RESET : text;\r\n colors.magenta = text => colors.supported ? exports.MAGENTA + text + exports.RESET : text;\r\n colors.cyan = text => colors.supported ? exports.CYAN + text + exports.RESET : text;\r\n colors.white = text => colors.supported ? exports.WHITE + text + exports.RESET : text;\r\n return colors;\r\n}\r\n\r\nexports.stdout = from(proc.stdout, exports);\r\nexports.stderr = from(proc.stderr);\r\nexports.from = from;\r\n\r\nexports.GRAY = \"\\u001b[90m\";\r\nexports.RED = \"\\u001b[91m\";\r\nexports.GREEN = \"\\u001b[92m\";\r\nexports.YELLOW = \"\\u001b[93m\";\r\nexports.BLUE = \"\\u001b[94m\";\r\nexports.MAGENTA = \"\\u001b[95m\";\r\nexports.CYAN = \"\\u001b[96m\";\r\nexports.WHITE = \"\\u001b[97m\";\r\nexports.RESET = \"\\u001b[0m\";\r\n","// type | meaning\r\n// -----|---------------\r\n// b | boolean\r\n// i | integer\r\n// f | float\r\n// s | string\r\n// I | integer array\r\n// F | float array\r\n// S | string array\r\n\r\n/** Parses the specified command line arguments according to the given configuration. */\r\nfunction parse(argv, config) {\r\n var options = {};\r\n var unknown = [];\r\n var arguments = [];\r\n var trailing = [];\r\n\r\n // make an alias map and initialize defaults\r\n var aliases = {};\r\n Object.keys(config).forEach(key => {\r\n if (key.startsWith(\" \")) return;\r\n var option = config[key];\r\n if (option.alias != null) {\r\n if (typeof option.alias === \"string\") aliases[option.alias] = key;\r\n else if (Array.isArray(option.alias)) option.alias.forEach(alias => aliases[alias] = key);\r\n }\r\n if (option.default != null) options[key] = option.default;\r\n });\r\n\r\n // iterate over argv\r\n for (var i = 0, k = (argv = argv.slice()).length; i < k; ++i) {\r\n let arg = argv[i];\r\n if (arg == \"--\") { ++i; break; }\r\n let match = /^(?:(\\-\\w)(?:=(.*))?|(\\-\\-\\w{2,})(?:=(.*))?)$/.exec(arg), option, key;\r\n if (match) {\r\n if (config[arg]) option = config[key = arg]; // exact\r\n else if (match[1] != null) { // alias\r\n option = config[key = aliases[match[1].substring(1)]];\r\n if (option && match[2] != null) argv[i--] = match[2];\r\n } else if (match[3] != null) { // full\r\n option = config[key = match[3].substring(2)];\r\n if (option && match[4] != null) argv[i--] = match[4];\r\n }\r\n } else {\r\n if (arg.charCodeAt(0) == 45) option = config[key = arg]; // exact\r\n else { arguments.push(arg); continue; } // argument\r\n }\r\n if (option) {\r\n if (option.type == null || option.type === \"b\") options[key] = true; // flag\r\n else {\r\n if (i + 1 < argv.length && argv[i + 1].charCodeAt(0) != 45) { // present\r\n switch (option.type) {\r\n case \"i\": options[key] = parseInt(argv[++i], 10); break;\r\n case \"I\": options[key] = (options[key] || []).concat(parseInt(argv[++i], 10)); break;\r\n case \"f\": options[key] = parseFloat(argv[++i]); break;\r\n case \"F\": options[key] = (options[key] || []).concat(parseFloat(argv[++i])); break;\r\n case \"s\": options[key] = String(argv[++i]); break;\r\n case \"S\": options[key] = (options[key] || []).concat(argv[++i].split(\",\")); break;\r\n default: unknown.push(arg); --i;\r\n }\r\n } else { // omitted\r\n switch (option.type) {\r\n case \"i\":\r\n case \"f\": options[key] = option.default || 0; break;\r\n case \"s\": options[key] = option.default || \"\"; break;\r\n case \"I\":\r\n case \"F\":\r\n case \"S\": options[key] = options.default || []; break;\r\n default: unknown.push(arg);\r\n }\r\n }\r\n }\r\n if (option.value) Object.keys(option.value).forEach(k => options[k] = option.value[k]);\r\n } else unknown.push(arg);\r\n }\r\n while (i < k) trailing.push(argv[i++]); // trailing\r\n\r\n return { options, unknown, arguments, trailing };\r\n}\r\n\r\nexports.parse = parse;\r\n\r\n/** Generates the help text for the specified configuration. */\r\nfunction help(config, options) {\r\n if (!options) options = {};\r\n var indent = options.indent || 2;\r\n var padding = options.padding || 24;\r\n var eol = options.eol || \"\\n\";\r\n var sb = [];\r\n Object.keys(config).forEach(key => {\r\n var option = config[key];\r\n if (option.description == null) return;\r\n var text = \"\";\r\n while (text.length < indent) text += \" \";\r\n text += \"--\" + key;\r\n if (option.alias) text += \", -\" + option.alias;\r\n while (text.length < padding) text += \" \";\r\n if (Array.isArray(option.description)) {\r\n sb.push(text + option.description[0] + option.description.slice(1).map(line => {\r\n for (let i = 0; i < padding; ++i) line = \" \" + line;\r\n return eol + line;\r\n }).join(\"\"));\r\n } else sb.push(text + option.description);\r\n });\r\n return sb.join(eol);\r\n}\r\n\r\nexports.help = help;\r\n","/*\r\nCopyright 2010 James Halliday (mail@substack.net)\r\n\r\nThis project is free software released under the MIT/X11 license:\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in\r\nall copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r\nTHE SOFTWARE.\r\n*/\r\n\r\nvar path = require(\"path\");\r\nvar fs = require(\"fs\");\r\nvar _0777 = parseInt(\"0777\", 8);\r\n\r\nmodule.exports = function mkdirp(p, opts, made) {\r\n if (!opts || typeof opts !== \"object\") {\r\n opts = { mode: opts };\r\n }\r\n var mode = opts.mode;\r\n if (mode === undefined) {\r\n mode = _0777 & (~process.umask());\r\n }\r\n if (!made) made = null;\r\n p = path.resolve(p);\r\n try {\r\n fs.mkdirSync(p, mode);\r\n made = made || p;\r\n } catch (err0) {\r\n switch (err0.code) {\r\n case \"ENOENT\":\r\n made = mkdirp(path.dirname(p), opts, made);\r\n mkdirp(p, opts, made);\r\n break;\r\n default:\r\n var stat;\r\n try {\r\n stat = fs.statSync(p);\r\n } catch (err1) {\r\n throw err0;\r\n }\r\n if (!stat.isDirectory()) throw err0;\r\n break;\r\n }\r\n }\r\n return made;\r\n};\r\n","if(typeof __WEBPACK_EXTERNAL_MODULE__10__ === 'undefined') {var e = new Error(\"Cannot find module 'assemblyscript'\"); e.code = 'MODULE_NOT_FOUND'; throw e;}\nmodule.exports = __WEBPACK_EXTERNAL_MODULE__10__;","function webpackEmptyContext(req) {\n\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\te.code = 'MODULE_NOT_FOUND';\n\tthrow e;\n}\nwebpackEmptyContext.keys = function() { return []; };\nwebpackEmptyContext.resolve = webpackEmptyContext;\nmodule.exports = webpackEmptyContext;\nwebpackEmptyContext.id = 12;","module.exports = process.hrtime || hrtime\n\n// polyfil for window.performance.now\nvar performance = global.performance || {}\nvar performanceNow =\n performance.now ||\n performance.mozNow ||\n performance.msNow ||\n performance.oNow ||\n performance.webkitNow ||\n function(){ return (new Date()).getTime() }\n\n// generate timestamp or delta\n// see http://nodejs.org/api/process.html#process_process_hrtime\nfunction hrtime(previousTimestamp){\n var clocktime = performanceNow.call(performance)*1e-3\n var seconds = Math.floor(clocktime)\n var nanoseconds = Math.floor((clocktime%1)*1e9)\n if (previousTimestamp) {\n seconds = seconds - previousTimestamp[0]\n nanoseconds = nanoseconds - previousTimestamp[1]\n if (nanoseconds<0) {\n seconds--\n nanoseconds += 1e9\n }\n }\n return [seconds,nanoseconds]\n}"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/assemblyscript.d.ts b/dist/assemblyscript.d.ts new file mode 100644 index 0000000000..8261b6aa8c --- /dev/null +++ b/dist/assemblyscript.d.ts @@ -0,0 +1,5606 @@ +declare type bool = boolean; +declare type i8 = number; +declare type i16 = number; +declare type i32 = number; +declare type isize = number; +declare type u8 = number; +declare type u16 = number; +declare type u32 = number; +declare type usize = number; +declare type f32 = number; +declare type f64 = number; +declare module 'assemblyscript' { + export * from 'assemblyscript/src/index'; +} +declare module 'assemblyscript/src/common' { + /** + * Common constants. + * @module common + */ /***/ + /** Indicates traits of a {@link Node} or {@link Element}. */ + export enum CommonFlags { + /** No flags set. */ + NONE = 0, + /** Has an `import` modifier. */ + IMPORT = 1, + /** Has an `export` modifier. */ + EXPORT = 2, + /** Has a `declare` modifier. */ + DECLARE = 4, + /** Has a `const` modifier. */ + CONST = 8, + /** Has a `let` modifier. */ + LET = 16, + /** Has a `static` modifier. */ + STATIC = 32, + /** Has a `readonly` modifier. */ + READONLY = 64, + /** Has an `abstract` modifier. */ + ABSTRACT = 128, + /** Has a `public` modifier. */ + PUBLIC = 256, + /** Has a `private` modifier. */ + PRIVATE = 512, + /** Has a `protected` modifier. */ + PROTECTED = 1024, + /** Has a `get` modifier. */ + GET = 2048, + /** Has a `set` modifier. */ + SET = 4096, + /** Has a definite assignment assertion `!` as in `x!: i32;`. */ + DEFINITE_ASSIGNMENT = 8192, + /** Is ambient, that is either declared or nested in a declared element. */ + AMBIENT = 16384, + /** Is generic. */ + GENERIC = 32768, + /** Is part of a generic context. */ + GENERIC_CONTEXT = 65536, + /** Is an instance member. */ + INSTANCE = 131072, + /** Is a constructor. */ + CONSTRUCTOR = 262144, + /** Is a module export. */ + MODULE_EXPORT = 524288, + /** Is a module import. */ + MODULE_IMPORT = 1048576, + /** Is resolved. */ + RESOLVED = 2097152, + /** Is compiled. */ + COMPILED = 4194304, + /** Has a constant value and is therefore inlined. */ + INLINED = 8388608, + /** Is scoped. */ + SCOPED = 16777216, + /** Is a trampoline. */ + TRAMPOLINE = 33554432, + /** Is a virtual method. */ + VIRTUAL = 67108864, + /** Is the main function. */ + MAIN = 134217728, + /** Is quoted. */ + QUOTED = 268435456 + } + /** Path delimiter inserted between file system levels. */ + export const PATH_DELIMITER = "/"; + /** Substitution used to indicate the parent directory. */ + export const PARENT_SUBST = ".."; + /** Function name prefix used for getters. */ + export const GETTER_PREFIX = "get:"; + /** Function name prefix used for setters. */ + export const SETTER_PREFIX = "set:"; + /** Delimiter used between class names and instance members. */ + export const INSTANCE_DELIMITER = "#"; + /** Delimiter used between class and namespace names and static members. */ + export const STATIC_DELIMITER = "."; + /** Delimiter used between a function and its inner elements. */ + export const INNER_DELIMITER = "~"; + /** Substitution used to indicate a library directory. */ + export const LIBRARY_SUBST = "~lib"; + /** Library directory prefix. */ + export const LIBRARY_PREFIX: string; + /** Path index suffix. */ + export const INDEX_SUFFIX: string; + /** Common compiler symbols. */ + export namespace CommonSymbols { + const EMPTY = ""; + const i8 = "i8"; + const i16 = "i16"; + const i32 = "i32"; + const i64 = "i64"; + const isize = "isize"; + const u8 = "u8"; + const u16 = "u16"; + const u32 = "u32"; + const u64 = "u64"; + const usize = "usize"; + const bool = "bool"; + const f32 = "f32"; + const f64 = "f64"; + const v128 = "v128"; + const i8x16 = "i8x16"; + const u8x16 = "u8x16"; + const i16x8 = "i16x8"; + const u16x8 = "u16x8"; + const i32x4 = "i32x4"; + const u32x4 = "u32x4"; + const i64x2 = "i64x2"; + const u64x2 = "u64x2"; + const f32x4 = "f32x4"; + const f64x2 = "f64x2"; + const void_ = "void"; + const number = "number"; + const boolean = "boolean"; + const string = "string"; + const native = "native"; + const null_ = "null"; + const true_ = "true"; + const false_ = "false"; + const this_ = "this"; + const super_ = "super"; + const constructor = "constructor"; + const ASC_TARGET = "ASC_TARGET"; + const ASC_NO_TREESHAKING = "ASC_NO_TREESHAKING"; + const ASC_NO_ASSERT = "ASC_NO_ASSERT"; + const ASC_MEMORY_BASE = "ASC_MEMORY_BASE"; + const ASC_OPTIMIZE_LEVEL = "ASC_OPTIMIZE_LEVEL"; + const ASC_SHRINK_LEVEL = "ASC_SHRINK_LEVEL"; + const ASC_FEATURE_MUTABLE_GLOBAL = "ASC_FEATURE_MUTABLE_GLOBAL"; + const ASC_FEATURE_SIGN_EXTENSION = "ASC_FEATURE_SIGN_EXTENSION"; + const ASC_FEATURE_BULK_MEMORY = "ASC_FEATURE_BULK_MEMORY"; + const ASC_FEATURE_SIMD = "ASC_FEATURE_SIMD"; + const ASC_FEATURE_THREADS = "ASC_FEATURE_THREADS"; + const I8 = "I8"; + const I16 = "I16"; + const I32 = "I32"; + const I64 = "I64"; + const Isize = "Isize"; + const U8 = "U8"; + const U16 = "U16"; + const U32 = "U32"; + const U64 = "U64"; + const Usize = "Usize"; + const Bool = "Bool"; + const F32 = "F32"; + const F64 = "F64"; + const V128 = "V128"; + const String = "String"; + const Array = "Array"; + const FixedArray = "FixedArray"; + const Set = "Set"; + const Map = "Map"; + const ArrayBufferView = "ArrayBufferView"; + const ArrayBuffer = "ArrayBuffer"; + const Math = "Math"; + const Mathf = "Mathf"; + const Int8Array = "Int8Array"; + const Int16Array = "Int16Array"; + const Int32Array = "Int32Array"; + const Int64Array = "Int64Array"; + const Uint8Array = "Uint8Array"; + const Uint8ClampedArray = "Uint8ClampedArray"; + const Uint16Array = "Uint16Array"; + const Uint32Array = "Uint32Array"; + const Uint64Array = "Uint64Array"; + const Float32Array = "Float32Array"; + const Float64Array = "Float64Array"; + const abort = "abort"; + const pow = "pow"; + const mod = "mod"; + const alloc = "__alloc"; + const realloc = "__realloc"; + const free = "__free"; + const retain = "__retain"; + const release = "__release"; + const collect = "__collect"; + const typeinfo = "__typeinfo"; + const instanceof_ = "__instanceof"; + const visit = "__visit"; + const allocArray = "__allocArray"; + } + export { Feature } from 'assemblyscript/std/assembly/shared/feature'; + export { Target } from 'assemblyscript/std/assembly/shared/target'; + export { Typeinfo, TypeinfoFlags } from 'assemblyscript/std/assembly/shared/typeinfo'; + +} +declare module 'assemblyscript/src/diagnosticMessages.generated' { + /** + * Generated from diagnosticsMessages.json. Do not edit. + * @module diagnostics + */ /***/ + /** Enum of available diagnostic codes. */ + export enum DiagnosticCode { + Operation_not_supported = 100, + Operation_is_unsafe = 101, + User_defined_0 = 102, + Conversion_from_type_0_to_1_requires_an_explicit_cast = 200, + Conversion_from_type_0_to_1_will_require_an_explicit_cast_when_switching_between_32_64_bit = 201, + Type_0_cannot_be_changed_to_type_1 = 202, + Type_0_cannot_be_reinterpreted_as_type_1 = 203, + Basic_type_0_cannot_be_nullable = 204, + Cannot_export_a_mutable_global = 205, + Mutable_value_cannot_be_inlined = 206, + Unmanaged_classes_cannot_extend_managed_classes_and_vice_versa = 207, + Unmanaged_classes_cannot_implement_interfaces = 208, + Invalid_regular_expression_flags = 209, + Implementation_0_must_match_the_signature_1 = 210, + Class_0_is_sealed_and_cannot_be_extended = 211, + Decorator_0_is_not_valid_here = 212, + Duplicate_decorator = 213, + An_allocator_must_be_present_to_use_0 = 214, + Optional_parameter_must_have_an_initializer = 215, + Constructor_of_class_0_must_not_require_any_arguments = 216, + Function_0_cannot_be_inlined_into_itself = 217, + Cannot_access_method_0_without_calling_it_as_it_requires_this_to_be_set = 218, + Optional_properties_are_not_supported = 219, + Expression_must_be_a_compile_time_constant = 220, + Module_cannot_have_multiple_start_functions = 221, + _0_must_be_a_value_between_1_and_2_inclusive = 222, + _0_must_be_a_power_of_two = 223, + TODO_Cannot_inline_inferred_calls_and_specific_internals_yet = 224, + Expression_is_never_null = 225, + Unterminated_string_literal = 1002, + Identifier_expected = 1003, + _0_expected = 1005, + A_file_cannot_have_a_reference_to_itself = 1006, + Trailing_comma_not_allowed = 1009, + Unexpected_token = 1012, + A_rest_parameter_must_be_last_in_a_parameter_list = 1014, + Parameter_cannot_have_question_mark_and_initializer = 1015, + A_required_parameter_cannot_follow_an_optional_parameter = 1016, + Statements_are_not_allowed_in_ambient_contexts = 1036, + Initializers_are_not_allowed_in_ambient_contexts = 1039, + _0_modifier_cannot_be_used_here = 1042, + A_rest_parameter_cannot_be_optional = 1047, + A_rest_parameter_cannot_have_an_initializer = 1048, + A_set_accessor_must_have_exactly_one_parameter = 1049, + A_set_accessor_parameter_cannot_have_an_initializer = 1052, + A_get_accessor_cannot_have_parameters = 1054, + Enum_member_must_have_initializer = 1061, + Type_parameters_cannot_appear_on_a_constructor_declaration = 1092, + Type_annotation_cannot_appear_on_a_constructor_declaration = 1093, + An_accessor_cannot_have_type_parameters = 1094, + A_set_accessor_cannot_have_a_return_type_annotation = 1095, + Type_parameter_list_cannot_be_empty = 1098, + A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement = 1104, + A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement = 1105, + A_return_statement_can_only_be_used_within_a_function_body = 1108, + Expression_expected = 1109, + Type_expected = 1110, + A_default_clause_cannot_appear_more_than_once_in_a_switch_statement = 1113, + Duplicate_label_0 = 1114, + An_export_assignment_cannot_have_modifiers = 1120, + Octal_literals_are_not_allowed_in_strict_mode = 1121, + Digit_expected = 1124, + Hexadecimal_digit_expected = 1125, + Unexpected_end_of_text = 1126, + Invalid_character = 1127, + _case_or_default_expected = 1130, + _super_must_be_followed_by_an_argument_list_or_member_access = 1034, + A_declare_modifier_cannot_be_used_in_an_already_ambient_context = 1038, + Type_argument_expected = 1140, + String_literal_expected = 1141, + Line_break_not_permitted_here = 1142, + Declaration_expected = 1146, + _const_declarations_must_be_initialized = 1155, + Unterminated_regular_expression_literal = 1161, + Interface_declaration_cannot_have_implements_clause = 1176, + Binary_digit_expected = 1177, + Octal_digit_expected = 1178, + An_implementation_cannot_be_declared_in_ambient_contexts = 1183, + An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive = 1198, + Unterminated_Unicode_escape_sequence = 1199, + Decorators_are_not_valid_here = 1206, + _abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration = 1242, + Method_0_cannot_have_an_implementation_because_it_is_marked_abstract = 1245, + A_definite_assignment_assertion_is_not_permitted_in_this_context = 1255, + A_class_may_only_extend_another_class = 1311, + A_parameter_property_cannot_be_declared_using_a_rest_parameter = 1317, + Duplicate_identifier_0 = 2300, + Cannot_find_name_0 = 2304, + Module_0_has_no_exported_member_1 = 2305, + Generic_type_0_requires_1_type_argument_s = 2314, + Type_0_is_not_generic = 2315, + Type_0_is_not_assignable_to_type_1 = 2322, + Index_signature_is_missing_in_type_0 = 2329, + _this_cannot_be_referenced_in_current_location = 2332, + _super_can_only_be_referenced_in_a_derived_class = 2335, + Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors = 2337, + Property_0_does_not_exist_on_type_1 = 2339, + Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures = 2349, + Cannot_use_new_with_an_expression_whose_type_lacks_a_construct_signature = 2351, + A_function_whose_declared_type_is_not_void_must_return_a_value = 2355, + The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access = 2357, + The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access = 2364, + Operator_0_cannot_be_applied_to_types_1_and_2 = 2365, + A_super_call_must_be_the_first_statement_in_the_constructor = 2376, + Constructors_for_derived_classes_must_contain_a_super_call = 2377, + _get_and_set_accessor_must_have_the_same_type = 2380, + Constructor_implementation_is_missing = 2390, + Function_implementation_is_missing_or_not_immediately_following_the_declaration = 2391, + Multiple_constructor_implementations_are_not_allowed = 2392, + Duplicate_function_implementation = 2393, + Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local = 2395, + A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged = 2434, + Type_0_has_no_property_1 = 2460, + The_0_operator_cannot_be_applied_to_type_1 = 2469, + In_const_enum_declarations_member_initializer_must_be_constant_expression = 2474, + Export_declaration_conflicts_with_exported_declaration_of_0 = 2484, + Object_is_possibly_null = 2531, + Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property = 2540, + The_target_of_an_assignment_must_be_a_variable_or_a_property_access = 2541, + Index_signature_in_type_0_only_permits_reading = 2542, + Expected_0_arguments_but_got_1 = 2554, + Expected_at_least_0_arguments_but_got_1 = 2555, + Expected_0_type_arguments_but_got_1 = 2558, + A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums = 2651, + Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration = 2673, + Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration = 2674, + Namespace_0_has_no_exported_member_1 = 2694, + Required_type_parameters_may_not_follow_optional_type_parameters = 2706, + Duplicate_property_0 = 2718, + File_0_not_found = 6054, + Numeric_separators_are_not_allowed_here = 6188, + Multiple_consecutive_numeric_separators_are_not_permitted = 6189, + _super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class = 17009, + _super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class = 17011 + } + /** Translates a diagnostic code to its respective string. */ + export function diagnosticCodeToString(code: DiagnosticCode): string; + +} +declare module 'assemblyscript/src/util/bitset' { + /** @module util */ /***/ + /** Tests if the bit at the specified index is set within a 64-bit map. */ + export function bitsetIs(map: I64, index: i32): bool; + /** Sets or unsets the bit at the specified index within a 64-bit map and returns the new map. */ + export function bitsetSet(map: I64, index: i32, isSet: bool): I64; + +} +declare module 'assemblyscript/src/util/charcode' { + /** @module util */ /***/ + /** An enum of named character codes. */ + export const enum CharCode { + NULL = 0, + LINEFEED = 10, + CARRIAGERETURN = 13, + LINESEPARATOR = 8232, + PARAGRAPHSEPARATOR = 8233, + NEXTLINE = 133, + SPACE = 32, + NONBREAKINGSPACE = 160, + ENQUAD = 8192, + EMQUAD = 8193, + ENSPACE = 8194, + EMSPACE = 8195, + THREEPEREMSPACE = 8196, + FOURPEREMSPACE = 8197, + SIXPEREMSPACE = 8198, + FIGURESPACE = 8199, + PUNCTUATIONSPACE = 8200, + THINSPACE = 8201, + HAIRSPACE = 8202, + ZEROWIDTHSPACE = 8203, + NARROWNOBREAKSPACE = 8239, + IDEOGRAPHICSPACE = 12288, + MATHEMATICALSPACE = 8287, + OGHAM = 5760, + _ = 95, + _0 = 48, + _1 = 49, + _2 = 50, + _3 = 51, + _4 = 52, + _5 = 53, + _6 = 54, + _7 = 55, + _8 = 56, + _9 = 57, + a = 97, + b = 98, + c = 99, + d = 100, + e = 101, + f = 102, + g = 103, + h = 104, + i = 105, + j = 106, + k = 107, + l = 108, + m = 109, + n = 110, + o = 111, + p = 112, + q = 113, + r = 114, + s = 115, + t = 116, + u = 117, + v = 118, + w = 119, + x = 120, + y = 121, + z = 122, + A = 65, + B = 66, + C = 67, + D = 68, + E = 69, + F = 70, + G = 71, + H = 72, + I = 73, + J = 74, + K = 75, + L = 76, + M = 77, + N = 78, + O = 79, + P = 80, + Q = 81, + R = 82, + S = 83, + T = 84, + U = 85, + V = 86, + W = 87, + X = 88, + Y = 89, + Z = 90, + AMPERSAND = 38, + ASTERISK = 42, + AT = 64, + BACKSLASH = 92, + BACKTICK = 96, + BAR = 124, + CARET = 94, + CLOSEBRACE = 125, + CLOSEBRACKET = 93, + CLOSEPAREN = 41, + COLON = 58, + COMMA = 44, + DOLLAR = 36, + DOT = 46, + DOUBLEQUOTE = 34, + EQUALS = 61, + EXCLAMATION = 33, + GREATERTHAN = 62, + HASH = 35, + LESSTHAN = 60, + MINUS = 45, + OPENBRACE = 123, + OPENBRACKET = 91, + OPENPAREN = 40, + PERCENT = 37, + PLUS = 43, + QUESTION = 63, + SEMICOLON = 59, + SINGLEQUOTE = 39, + SLASH = 47, + TILDE = 126, + BACKSPACE = 8, + FORMFEED = 12, + BYTEORDERMARK = 65279, + TAB = 9, + VERTICALTAB = 11 + } + /** Tests if the specified character code is some sort of line break. */ + export function isLineBreak(c: CharCode): bool; + /** Tests if the specified character code is some sort of white space. */ + export function isWhiteSpace(c: i32): bool; + /** Tests if the specified character code is a valid decimal digit. */ + export function isDecimalDigit(c: i32): bool; + /** Tests if the specified character code is a valid octal digit. */ + export function isOctalDigit(c: i32): bool; + /** Tests if the specified character code is a valid start of an identifier. */ + export function isIdentifierStart(c: i32): bool; + /** Tests if the specified character code is a valid keyword character. */ + export function isKeywordCharacter(c: i32): bool; + /** Tests if the specified character code is a valid part of an identifier. */ + export function isIdentifierPart(c: i32): bool; + +} +declare module 'assemblyscript/src/util/collections' { + export function makeArray(original?: Array | null): Array; + export function makeSet(original?: Set | null): Set; + export function makeMap(original?: Map | null, overrides?: Map | null): Map; + +} +declare module 'assemblyscript/src/util/path' { + /** @module util */ /***/ + /** + * Normalizes the specified path, removing interior placeholders. + * Expects a posix-compatible relative path (not Windows compatible). + */ + export function normalizePath(path: string): string; + /** Resolves the specified path relative to the specified origin. */ + export function resolvePath(normalizedPath: string, origin: string): string; + /** Obtains the directory portion of a normalized path. */ + export function dirname(normalizedPath: string): string; + +} +declare module 'assemblyscript/src/util/text' { + /** @module util */ /***/ + /** Creates an indentation matching the number of specified levels. */ + export function indent(sb: string[], level: i32): void; + +} +declare module 'assemblyscript/src/util/binary' { + /** @module util */ /***/ + /** Reads an 8-bit integer from the specified buffer. */ + export function readI8(buffer: Uint8Array, offset: i32): i32; + /** Writes an 8-bit integer to the specified buffer. */ + export function writeI8(value: i32, buffer: Uint8Array, offset: i32): void; + /** Reads a 16-bit integer from the specified buffer. */ + export function readI16(buffer: Uint8Array, offset: i32): i32; + /** Writes a 16-bit integer to the specified buffer. */ + export function writeI16(value: i32, buffer: Uint8Array, offset: i32): void; + /** Reads a 32-bit integer from the specified buffer. */ + export function readI32(buffer: Uint8Array, offset: i32): i32; + /** Writes a 32-bit integer to the specified buffer. */ + export function writeI32(value: i32, buffer: Uint8Array, offset: i32): void; + /** Reads a 64-bit integer from the specified buffer. */ + export function readI64(buffer: Uint8Array, offset: i32): I64; + /** Writes a 64-bit integer to the specified buffer. */ + export function writeI64(value: I64, buffer: Uint8Array, offset: i32): void; + /** Reads a 32-bit float from the specified buffer. */ + export function readF32(buffer: Uint8Array, offset: i32): f32; + /** Writes a 32-bit float to the specified buffer. */ + export function writeF32(value: f32, buffer: Uint8Array, offset: i32): void; + /** Reads a 64-bit float from the specified buffer. */ + export function readF64(buffer: Uint8Array, offset: i32): f64; + /** Writes a 64-bit float to the specified buffer. */ + export function writeF64(value: f64, buffer: Uint8Array, offset: i32): void; + +} +declare module 'assemblyscript/src/util/index' { + /** + * Various compiler utilities. + * @module util + * @preferred + */ /***/ + export * from 'assemblyscript/src/util/bitset'; + export * from 'assemblyscript/src/util/charcode'; + export * from 'assemblyscript/src/util/collections'; + export * from 'assemblyscript/src/util/path'; + export * from 'assemblyscript/src/util/text'; + export * from 'assemblyscript/src/util/binary'; + /** Tests if `x` is a power of two. */ + export function isPowerOf2(x: i32): bool; + +} +declare module 'assemblyscript/src/diagnostics' { + /** + * Shared diagnostic handling inherited by the parser and the compiler. + * @module diagnostics + * @preferred + */ /***/ + import { Range } from 'assemblyscript/src/ast'; + import { DiagnosticCode } from 'assemblyscript/src/diagnosticMessages.generated'; + export { DiagnosticCode, diagnosticCodeToString } from 'assemblyscript/src/diagnosticMessages.generated'; + /** Indicates the category of a {@link DiagnosticMessage}. */ + export enum DiagnosticCategory { + /** Informatory message. */ + INFO = 0, + /** Warning message. */ + WARNING = 1, + /** Error message. */ + ERROR = 2 + } + /** Returns the string representation of the specified diagnostic category. */ + export function diagnosticCategoryToString(category: DiagnosticCategory): string; + /** ANSI escape sequence for blue foreground. */ + export const COLOR_BLUE: string; + /** ANSI escape sequence for yellow foreground. */ + export const COLOR_YELLOW: string; + /** ANSI escape sequence for red foreground. */ + export const COLOR_RED: string; + /** ANSI escape sequence to reset the foreground color. */ + export const COLOR_RESET: string; + /** Returns the ANSI escape sequence for the specified category. */ + export function diagnosticCategoryToColor(category: DiagnosticCategory): string; + /** Represents a diagnostic message. */ + export class DiagnosticMessage { + /** Message code. */ + code: i32; + /** Message category. */ + category: DiagnosticCategory; + /** Message text. */ + message: string; + /** Respective source range, if any. */ + range: Range | null; + /** Related range, if any. */ + relatedRange: Range | null; + /** Constructs a new diagnostic message. */ + private constructor(); + /** Creates a new diagnostic message of the specified category. */ + static create(code: DiagnosticCode, category: DiagnosticCategory, arg0?: string | null, arg1?: string | null, arg2?: string | null): DiagnosticMessage; + /** Creates a new informatory diagnostic message. */ + static createInfo(code: DiagnosticCode, arg0?: string | null, arg1?: string | null): DiagnosticMessage; + /** Creates a new warning diagnostic message. */ + static createWarning(code: DiagnosticCode, arg0?: string | null, arg1?: string | null): DiagnosticMessage; + /** Creates a new error diagnostic message. */ + static createError(code: DiagnosticCode, arg0?: string | null, arg1?: string | null): DiagnosticMessage; + /** Adds a source range to this message. */ + withRange(range: Range): this; + /** Adds a related source range to this message. */ + withRelatedRange(range: Range): this; + /** Converts this message to a string. */ + toString(): string; + } + /** Formats a diagnostic message, optionally with terminal colors and source context. */ + export function formatDiagnosticMessage(message: DiagnosticMessage, useColors?: bool, showContext?: bool): string; + /** Formats the diagnostic context for the specified range, optionally with terminal colors. */ + export function formatDiagnosticContext(range: Range, useColors?: bool): string; + /** Base class of all diagnostic emitters. */ + export abstract class DiagnosticEmitter { + /** Diagnostic messages emitted so far. */ + diagnostics: DiagnosticMessage[]; + /** Initializes this diagnostic emitter. */ + protected constructor(diagnostics?: DiagnosticMessage[] | null); + /** Emits a diagnostic message of the specified category. */ + emitDiagnostic(code: DiagnosticCode, category: DiagnosticCategory, range: Range, relatedRange: Range | null, arg0?: string | null, arg1?: string | null, arg2?: string | null): void; + /** Emits an informatory diagnostic message. */ + info(code: DiagnosticCode, range: Range, arg0?: string | null, arg1?: string | null, arg2?: string | null): void; + /** Emits an informatory diagnostic message with a related range. */ + infoRelated(code: DiagnosticCode, range: Range, relatedRange: Range, arg0?: string | null, arg1?: string | null, arg2?: string | null): void; + /** Emits a warning diagnostic message. */ + warning(code: DiagnosticCode, range: Range, arg0?: string | null, arg1?: string | null, arg2?: string | null): void; + /** Emits a warning diagnostic message with a related range. */ + warningRelated(code: DiagnosticCode, range: Range, relatedRange: Range, arg0?: string | null, arg1?: string | null, arg2?: string | null): void; + /** Emits an error diagnostic message. */ + error(code: DiagnosticCode, range: Range, arg0?: string | null, arg1?: string | null, arg2?: string | null): void; + /** Emits an error diagnostic message with a related range. */ + errorRelated(code: DiagnosticCode, range: Range, relatedRange: Range, arg0?: string | null, arg1?: string | null, arg2?: string | null): void; + } + +} +declare module 'assemblyscript/src/tokenizer' { + /** + * A TypeScript tokenizer modified for AssemblyScript. + * + * Skips over trivia and provides a general mark/reset mechanism for the parser to utilize on + * ambiguous tokens. + * + * @module tokenizer + */ /***/ + import { DiagnosticMessage, DiagnosticEmitter } from 'assemblyscript/src/diagnostics'; + import { Source, CommentKind } from 'assemblyscript/src/ast'; + /** Named token types. */ + export enum Token { + ABSTRACT = 0, + AS = 1, + ASYNC = 2, + AWAIT = 3, + BREAK = 4, + CASE = 5, + CATCH = 6, + CLASS = 7, + CONST = 8, + CONTINUE = 9, + CONSTRUCTOR = 10, + DEBUGGER = 11, + DECLARE = 12, + DEFAULT = 13, + DELETE = 14, + DO = 15, + ELSE = 16, + ENUM = 17, + EXPORT = 18, + EXTENDS = 19, + FALSE = 20, + FINALLY = 21, + FOR = 22, + FROM = 23, + FUNCTION = 24, + GET = 25, + IF = 26, + IMPLEMENTS = 27, + IMPORT = 28, + IN = 29, + INSTANCEOF = 30, + INTERFACE = 31, + IS = 32, + KEYOF = 33, + LET = 34, + MODULE = 35, + NAMESPACE = 36, + NEW = 37, + NULL = 38, + OF = 39, + PACKAGE = 40, + PRIVATE = 41, + PROTECTED = 42, + PUBLIC = 43, + READONLY = 44, + RETURN = 45, + SET = 46, + STATIC = 47, + SUPER = 48, + SWITCH = 49, + THIS = 50, + THROW = 51, + TRUE = 52, + TRY = 53, + TYPE = 54, + TYPEOF = 55, + VAR = 56, + VOID = 57, + WHILE = 58, + WITH = 59, + YIELD = 60, + OPENBRACE = 61, + CLOSEBRACE = 62, + OPENPAREN = 63, + CLOSEPAREN = 64, + OPENBRACKET = 65, + CLOSEBRACKET = 66, + DOT = 67, + DOT_DOT_DOT = 68, + SEMICOLON = 69, + COMMA = 70, + LESSTHAN = 71, + GREATERTHAN = 72, + LESSTHAN_EQUALS = 73, + GREATERTHAN_EQUALS = 74, + EQUALS_EQUALS = 75, + EXCLAMATION_EQUALS = 76, + EQUALS_EQUALS_EQUALS = 77, + EXCLAMATION_EQUALS_EQUALS = 78, + EQUALS_GREATERTHAN = 79, + PLUS = 80, + MINUS = 81, + ASTERISK_ASTERISK = 82, + ASTERISK = 83, + SLASH = 84, + PERCENT = 85, + PLUS_PLUS = 86, + MINUS_MINUS = 87, + LESSTHAN_LESSTHAN = 88, + GREATERTHAN_GREATERTHAN = 89, + GREATERTHAN_GREATERTHAN_GREATERTHAN = 90, + AMPERSAND = 91, + BAR = 92, + CARET = 93, + EXCLAMATION = 94, + TILDE = 95, + AMPERSAND_AMPERSAND = 96, + BAR_BAR = 97, + QUESTION = 98, + COLON = 99, + EQUALS = 100, + PLUS_EQUALS = 101, + MINUS_EQUALS = 102, + ASTERISK_EQUALS = 103, + ASTERISK_ASTERISK_EQUALS = 104, + SLASH_EQUALS = 105, + PERCENT_EQUALS = 106, + LESSTHAN_LESSTHAN_EQUALS = 107, + GREATERTHAN_GREATERTHAN_EQUALS = 108, + GREATERTHAN_GREATERTHAN_GREATERTHAN_EQUALS = 109, + AMPERSAND_EQUALS = 110, + BAR_EQUALS = 111, + CARET_EQUALS = 112, + AT = 113, + IDENTIFIER = 114, + STRINGLITERAL = 115, + INTEGERLITERAL = 116, + FLOATLITERAL = 117, + INVALID = 118, + ENDOFFILE = 119 + } + export enum IdentifierHandling { + DEFAULT = 0, + PREFER = 1, + ALWAYS = 2 + } + export function tokenFromKeyword(text: string): Token; + export function tokenIsAlsoIdentifier(token: Token): bool; + export function operatorTokenToString(token: Token): string; + export class Range { + source: Source; + start: i32; + end: i32; + constructor(source: Source, start: i32, end: i32); + static join(a: Range, b: Range): Range; + readonly atStart: Range; + readonly atEnd: Range; + readonly line: i32; + readonly column: i32; + toString(): string; + debugInfoRef: usize; + } + /** Handler for intercepting comments while tokenizing. */ + export type CommentHandler = (kind: CommentKind, text: string, range: Range) => void; + /** Tokenizes a source to individual {@link Token}s. */ + export class Tokenizer extends DiagnosticEmitter { + source: Source; + end: i32; + pos: i32; + token: Token; + tokenPos: i32; + nextToken: Token; + nextTokenPos: i32; + nextTokenOnNewLine: bool; + onComment: CommentHandler | null; + /** Constructs a new tokenizer. */ + constructor(source: Source, diagnostics?: DiagnosticMessage[] | null); + next(identifierHandling?: IdentifierHandling): Token; + private unsafeNext; + peek(checkOnNewLine?: bool, identifierHandling?: IdentifierHandling, maxCompoundLength?: i32): Token; + skipIdentifier(identifierHandling?: IdentifierHandling): bool; + skip(token: Token, identifierHandling?: IdentifierHandling): bool; + mark(): State; + discard(state: State): void; + reset(state: State): void; + range(start?: i32, end?: i32): Range; + readIdentifier(): string; + readString(): string; + readEscapeSequence(): string; + readRegexpPattern(): string; + readRegexpFlags(): string; + testInteger(): bool; + readInteger(): I64; + readHexInteger(): I64; + readDecimalInteger(): I64; + readOctalInteger(): I64; + readBinaryInteger(): I64; + readFloat(): f64; + readDecimalFloat(): f64; + readHexFloat(): f64; + readUnicodeEscape(): string; + private readExtendedUnicodeEscape; + finish(): void; + } + /** Tokenizer state as returned by {@link Tokenizer#mark} and consumed by {@link Tokenizer#reset}. */ + export class State { + /** Current position. */ + pos: i32; + /** Current token. */ + token: Token; + /** Current token's position. */ + tokenPos: i32; + } + +} +declare module 'assemblyscript/src/ast' { + /** + * Abstract syntax tree representing a source file once parsed. + * @module ast + */ /***/ + import { CommonFlags } from 'assemblyscript/src/common'; + import { Token, Tokenizer, Range } from 'assemblyscript/src/tokenizer'; + export { Token, Range }; + /** Indicates the kind of a node. */ + export enum NodeKind { + SOURCE = 0, + TYPE = 1, + TYPENAME = 2, + TYPEPARAMETER = 3, + PARAMETER = 4, + SIGNATURE = 5, + IDENTIFIER = 6, + ASSERTION = 7, + BINARY = 8, + CALL = 9, + CLASS = 10, + COMMA = 11, + ELEMENTACCESS = 12, + FALSE = 13, + FUNCTION = 14, + INSTANCEOF = 15, + LITERAL = 16, + NEW = 17, + NULL = 18, + PARENTHESIZED = 19, + PROPERTYACCESS = 20, + TERNARY = 21, + SUPER = 22, + THIS = 23, + TRUE = 24, + CONSTRUCTOR = 25, + UNARYPOSTFIX = 26, + UNARYPREFIX = 27, + BLOCK = 28, + BREAK = 29, + CONTINUE = 30, + DO = 31, + EMPTY = 32, + EXPORT = 33, + EXPORTDEFAULT = 34, + EXPORTIMPORT = 35, + EXPRESSION = 36, + FOR = 37, + IF = 38, + IMPORT = 39, + RETURN = 40, + SWITCH = 41, + THROW = 42, + TRY = 43, + VARIABLE = 44, + VOID = 45, + WHILE = 46, + CLASSDECLARATION = 47, + ENUMDECLARATION = 48, + ENUMVALUEDECLARATION = 49, + FIELDDECLARATION = 50, + FUNCTIONDECLARATION = 51, + IMPORTDECLARATION = 52, + INDEXSIGNATUREDECLARATION = 53, + INTERFACEDECLARATION = 54, + METHODDECLARATION = 55, + NAMESPACEDECLARATION = 56, + TYPEDECLARATION = 57, + VARIABLEDECLARATION = 58, + DECORATOR = 59, + EXPORTMEMBER = 60, + SWITCHCASE = 61, + COMMENT = 62 + } + /** Checks if a node represents a constant value. */ + export function nodeIsConstantValue(kind: NodeKind): bool; + /** Checks if a node might be callable. */ + export function nodeIsCallable(kind: NodeKind): bool; + /** Checks if a node might be callable with generic arguments. */ + export function nodeIsGenericCallable(kind: NodeKind): bool; + /** Base class of all nodes. */ + export abstract class Node { + /** Node kind indicator. */ + kind: NodeKind; + /** Source range. */ + range: Range; + static createTypeName(name: IdentifierExpression, range: Range): TypeName; + static createSimpleTypeName(name: string, range: Range): TypeName; + static createType(name: TypeName, typeArguments: CommonTypeNode[] | null, isNullable: bool, range: Range): TypeNode; + static createOmittedType(range: Range): TypeNode; + static createTypeParameter(name: IdentifierExpression, extendsType: TypeNode | null, defaultType: TypeNode | null, range: Range): TypeParameterNode; + static createParameter(name: IdentifierExpression, type: CommonTypeNode, initializer: Expression | null, kind: ParameterKind, range: Range): ParameterNode; + static createSignature(parameters: ParameterNode[], returnType: CommonTypeNode, explicitThisType: TypeNode | null, isNullable: bool, range: Range): SignatureNode; + static createDecorator(name: Expression, args: Expression[] | null, range: Range): DecoratorNode; + static createComment(text: string, kind: CommentKind, range: Range): CommentNode; + static createIdentifierExpression(name: string, range: Range, isQuoted?: bool): IdentifierExpression; + static createEmptyIdentifierExpression(range: Range): IdentifierExpression; + static createArrayLiteralExpression(elements: (Expression | null)[], range: Range): ArrayLiteralExpression; + static createAssertionExpression(assertionKind: AssertionKind, expression: Expression, toType: CommonTypeNode | null, range: Range): AssertionExpression; + static createBinaryExpression(operator: Token, left: Expression, right: Expression, range: Range): BinaryExpression; + static createCallExpression(expression: Expression, typeArgs: CommonTypeNode[] | null, args: Expression[], range: Range): CallExpression; + static createClassExpression(declaration: ClassDeclaration): ClassExpression; + static createCommaExpression(expressions: Expression[], range: Range): CommaExpression; + static createConstructorExpression(range: Range): ConstructorExpression; + static createElementAccessExpression(expression: Expression, element: Expression, range: Range): ElementAccessExpression; + static createFalseExpression(range: Range): FalseExpression; + static createFloatLiteralExpression(value: f64, range: Range): FloatLiteralExpression; + static createFunctionExpression(declaration: FunctionDeclaration): FunctionExpression; + static createInstanceOfExpression(expression: Expression, isType: CommonTypeNode, range: Range): InstanceOfExpression; + static createIntegerLiteralExpression(value: I64, range: Range): IntegerLiteralExpression; + static createNewExpression(expression: Expression, typeArgs: CommonTypeNode[] | null, args: Expression[], range: Range): NewExpression; + static createNullExpression(range: Range): NullExpression; + static createObjectLiteralExpression(names: IdentifierExpression[], values: Expression[], range: Range): ObjectLiteralExpression; + static createParenthesizedExpression(expression: Expression, range: Range): ParenthesizedExpression; + static createPropertyAccessExpression(expression: Expression, property: IdentifierExpression, range: Range): PropertyAccessExpression; + static createRegexpLiteralExpression(pattern: string, flags: string, range: Range): RegexpLiteralExpression; + static createTernaryExpression(condition: Expression, ifThen: Expression, ifElse: Expression, range: Range): TernaryExpression; + static createStringLiteralExpression(value: string, range: Range): StringLiteralExpression; + static createSuperExpression(range: Range): SuperExpression; + static createThisExpression(range: Range): ThisExpression; + static createTrueExpression(range: Range): TrueExpression; + static createUnaryPostfixExpression(operator: Token, operand: Expression, range: Range): UnaryPostfixExpression; + static createUnaryPrefixExpression(operator: Token, operand: Expression, range: Range): UnaryPrefixExpression; + static createBlockStatement(statements: Statement[], range: Range): BlockStatement; + static createBreakStatement(label: IdentifierExpression | null, range: Range): BreakStatement; + static createClassDeclaration(identifier: IdentifierExpression, typeParameters: TypeParameterNode[] | null, extendsType: TypeNode | null, // can't be a function + implementsTypes: TypeNode[] | null, // can't be functions + members: DeclarationStatement[], decorators: DecoratorNode[] | null, flags: CommonFlags, range: Range): ClassDeclaration; + static createContinueStatement(label: IdentifierExpression | null, range: Range): ContinueStatement; + static createDoStatement(statement: Statement, condition: Expression, range: Range): DoStatement; + static createEmptyStatement(range: Range): EmptyStatement; + static createEnumDeclaration(name: IdentifierExpression, members: EnumValueDeclaration[], decorators: DecoratorNode[] | null, flags: CommonFlags, range: Range): EnumDeclaration; + static createEnumValueDeclaration(name: IdentifierExpression, value: Expression | null, flags: CommonFlags, range: Range): EnumValueDeclaration; + static createExportStatement(members: ExportMember[] | null, path: StringLiteralExpression | null, isDeclare: bool, range: Range): ExportStatement; + static createExportDefaultStatement(declaration: DeclarationStatement, range: Range): ExportDefaultStatement; + static createExportImportStatement(name: IdentifierExpression, externalName: IdentifierExpression, range: Range): ExportImportStatement; + static createExportMember(name: IdentifierExpression, externalName: IdentifierExpression | null, range: Range): ExportMember; + static createExpressionStatement(expression: Expression): ExpressionStatement; + static createIfStatement(condition: Expression, ifTrue: Statement, ifFalse: Statement | null, range: Range): IfStatement; + static createImportStatement(decls: ImportDeclaration[] | null, path: StringLiteralExpression, range: Range): ImportStatement; + static createImportStatementWithWildcard(identifier: IdentifierExpression, path: StringLiteralExpression, range: Range): ImportStatement; + static createImportDeclaration(foreignName: IdentifierExpression, name: IdentifierExpression | null, range: Range): ImportDeclaration; + static createInterfaceDeclaration(name: IdentifierExpression, typeParameters: TypeParameterNode[] | null, extendsType: TypeNode | null, // can't be a function + members: DeclarationStatement[], decorators: DecoratorNode[] | null, flags: CommonFlags, range: Range): InterfaceDeclaration; + static createFieldDeclaration(name: IdentifierExpression, type: CommonTypeNode | null, initializer: Expression | null, decorators: DecoratorNode[] | null, flags: CommonFlags, range: Range): FieldDeclaration; + static createForStatement(initializer: Statement | null, condition: Expression | null, incrementor: Expression | null, statement: Statement, range: Range): ForStatement; + static createFunctionDeclaration(name: IdentifierExpression, typeParameters: TypeParameterNode[] | null, signature: SignatureNode, body: Statement | null, decorators: DecoratorNode[] | null, flags: CommonFlags, arrowKind: ArrowKind, range: Range): FunctionDeclaration; + static createIndexSignatureDeclaration(keyType: TypeNode, valueType: CommonTypeNode, range: Range): IndexSignatureDeclaration; + static createMethodDeclaration(name: IdentifierExpression, typeParameters: TypeParameterNode[] | null, signature: SignatureNode, body: Statement | null, decorators: DecoratorNode[] | null, flags: CommonFlags, range: Range): MethodDeclaration; + static createNamespaceDeclaration(name: IdentifierExpression, members: Statement[], decorators: DecoratorNode[] | null, flags: CommonFlags, range: Range): NamespaceDeclaration; + static createReturnStatement(value: Expression | null, range: Range): ReturnStatement; + static createSwitchStatement(condition: Expression, cases: SwitchCase[], range: Range): SwitchStatement; + static createSwitchCase(label: Expression | null, statements: Statement[], range: Range): SwitchCase; + static createThrowStatement(value: Expression, range: Range): ThrowStatement; + static createTryStatement(statements: Statement[], catchVariable: IdentifierExpression | null, catchStatements: Statement[] | null, finallyStatements: Statement[] | null, range: Range): TryStatement; + static createTypeDeclaration(name: IdentifierExpression, typeParameters: TypeParameterNode[] | null, alias: CommonTypeNode, decorators: DecoratorNode[] | null, flags: CommonFlags, range: Range): TypeDeclaration; + static createVariableStatement(declarations: VariableDeclaration[], decorators: DecoratorNode[] | null, range: Range): VariableStatement; + static createVariableDeclaration(name: IdentifierExpression, type: CommonTypeNode | null, initializer: Expression | null, decorators: DecoratorNode[] | null, flags: CommonFlags, range: Range): VariableDeclaration; + static createVoidStatement(expression: Expression, range: Range): VoidStatement; + static createWhileStatement(condition: Expression, statement: Statement, range: Range): WhileStatement; + } + export abstract class CommonTypeNode extends Node { + /** Whether nullable or not. */ + isNullable: bool; + } + /** Represents a type name. */ + export class TypeName extends Node { + kind: NodeKind; + /** Identifier of this part. */ + identifier: IdentifierExpression; + /** Next part of the type name or `null` if this is the last part. */ + next: TypeName | null; + } + /** Represents a type annotation. */ + export class TypeNode extends CommonTypeNode { + kind: NodeKind; + /** Type name. */ + name: TypeName; + /** Type argument references. */ + typeArguments: CommonTypeNode[] | null; + } + /** Represents a type parameter. */ + export class TypeParameterNode extends Node { + kind: NodeKind; + /** Identifier reference. */ + name: IdentifierExpression; + /** Extended type reference, if any. */ + extendsType: TypeNode | null; + /** Default type if omitted, if any. */ + defaultType: TypeNode | null; + } + /** Represents the kind of a parameter. */ + export enum ParameterKind { + /** No specific flags. */ + DEFAULT = 0, + /** Is an optional parameter. */ + OPTIONAL = 1, + /** Is a rest parameter. */ + REST = 2 + } + /** Represents a function parameter. */ + export class ParameterNode extends Node { + kind: NodeKind; + /** Parameter kind. */ + parameterKind: ParameterKind; + /** Parameter name. */ + name: IdentifierExpression; + /** Parameter type. */ + type: CommonTypeNode; + /** Initializer expression, if present. */ + initializer: Expression | null; + /** Implicit field declaration, if applicable. */ + implicitFieldDeclaration: FieldDeclaration | null; + /** Common flags indicating specific traits. */ + flags: CommonFlags; + /** Tests if this node has the specified flag or flags. */ + is(flag: CommonFlags): bool; + /** Tests if this node has one of the specified flags. */ + isAny(flag: CommonFlags): bool; + /** Sets a specific flag or flags. */ + set(flag: CommonFlags): void; + } + /** Represents a function signature. */ + export class SignatureNode extends CommonTypeNode { + kind: NodeKind; + /** Accepted parameters. */ + parameters: ParameterNode[]; + /** Return type. */ + returnType: CommonTypeNode; + /** Explicitly provided this type, if any. */ + explicitThisType: TypeNode | null; + } + /** Built-in decorator kinds. */ + export enum DecoratorKind { + CUSTOM = 0, + GLOBAL = 1, + OPERATOR = 2, + OPERATOR_BINARY = 3, + OPERATOR_PREFIX = 4, + OPERATOR_POSTFIX = 5, + UNMANAGED = 6, + SEALED = 7, + INLINE = 8, + EXTERNAL = 9, + BUILTIN = 10, + LAZY = 11, + UNSAFE = 12 + } + /** Returns the kind of the specified decorator. Defaults to {@link DecoratorKind.CUSTOM}. */ + export function decoratorNameToKind(name: Expression): DecoratorKind; + /** Represents a decorator. */ + export class DecoratorNode extends Node { + kind: NodeKind; + /** Built-in kind, if applicable. */ + decoratorKind: DecoratorKind; + /** Name expression. */ + name: Expression; + /** Argument expressions. */ + arguments: Expression[] | null; + } + /** Comment kinds. */ + export enum CommentKind { + /** Line comment. */ + LINE = 0, + /** Triple-slash comment. */ + TRIPLE = 1, + /** Block comment. */ + BLOCK = 2 + } + /** Represents a comment. */ + export class CommentNode extends Node { + kind: NodeKind; + /** Comment kind. */ + commentKind: CommentKind; + /** Comment text. */ + text: string; + } + /** Base class of all expression nodes. */ + export abstract class Expression extends Node { + } + /** Represents an identifier expression. */ + export class IdentifierExpression extends Expression { + kind: NodeKind; + /** Textual name. */ + text: string; + /** Symbol. */ + symbol: string; + /** Whether quoted or not. */ + isQuoted: bool; + } + /** Indicates the kind of a literal. */ + export enum LiteralKind { + FLOAT = 0, + INTEGER = 1, + STRING = 2, + REGEXP = 3, + ARRAY = 4, + OBJECT = 5 + } + /** Base class of all literal expressions. */ + export abstract class LiteralExpression extends Expression { + kind: NodeKind; + /** Specific literal kind. */ + literalKind: LiteralKind; + } + /** Represents an `[]` literal expression. */ + export class ArrayLiteralExpression extends LiteralExpression { + literalKind: LiteralKind; + /** Nested element expressions. */ + elementExpressions: (Expression | null)[]; + } + /** Indicates the kind of an assertion. */ + export enum AssertionKind { + PREFIX = 0, + AS = 1, + NONNULL = 2 + } + /** Represents an assertion expression. */ + export class AssertionExpression extends Expression { + kind: NodeKind; + /** Specific kind of this assertion. */ + assertionKind: AssertionKind; + /** Expression being asserted. */ + expression: Expression; + /** Target type. */ + toType: CommonTypeNode | null; + } + /** Represents a binary expression. */ + export class BinaryExpression extends Expression { + kind: NodeKind; + /** Operator token. */ + operator: Token; + /** Left-hand side expression */ + left: Expression; + /** Right-hand side expression. */ + right: Expression; + } + /** Represents a call expression. */ + export class CallExpression extends Expression { + kind: NodeKind; + /** Called expression. Usually an identifier or property access expression. */ + expression: Expression; + /** Provided type arguments. */ + typeArguments: CommonTypeNode[] | null; + /** Provided arguments. */ + arguments: Expression[]; + /** Gets the type arguments range for reporting. */ + readonly typeArgumentsRange: Range; + /** Gets the arguments range for reporting. */ + readonly argumentsRange: Range; + } + /** Represents a class expression using the 'class' keyword. */ + export class ClassExpression extends Expression { + kind: NodeKind; + /** Inline class declaration. */ + declaration: ClassDeclaration; + } + /** Represents a comma expression composed of multiple expressions. */ + export class CommaExpression extends Expression { + kind: NodeKind; + /** Sequential expressions. */ + expressions: Expression[]; + } + /** Represents a `constructor` expression. */ + export class ConstructorExpression extends IdentifierExpression { + kind: NodeKind; + text: string; + symbol: string; + } + /** Represents an element access expression, e.g., array access. */ + export class ElementAccessExpression extends Expression { + kind: NodeKind; + /** Expression being accessed. */ + expression: Expression; + /** Element of the expression being accessed. */ + elementExpression: Expression; + } + /** Represents a float literal expression. */ + export class FloatLiteralExpression extends LiteralExpression { + literalKind: LiteralKind; + /** Float value. */ + value: f64; + } + /** Represents a function expression using the 'function' keyword. */ + export class FunctionExpression extends Expression { + kind: NodeKind; + /** Inline function declaration. */ + declaration: FunctionDeclaration; + } + /** Represents an `instanceof` expression. */ + export class InstanceOfExpression extends Expression { + kind: NodeKind; + /** Expression being asserted. */ + expression: Expression; + /** Type to test for. */ + isType: CommonTypeNode; + } + /** Represents an integer literal expression. */ + export class IntegerLiteralExpression extends LiteralExpression { + literalKind: LiteralKind; + /** Integer value. */ + value: I64; + } + /** Represents a `new` expression. Like a call but with its own kind. */ + export class NewExpression extends CallExpression { + kind: NodeKind; + } + /** Represents a `null` expression. */ + export class NullExpression extends IdentifierExpression { + kind: NodeKind; + text: string; + symbol: string; + } + /** Represents an object literal expression. */ + export class ObjectLiteralExpression extends LiteralExpression { + literalKind: LiteralKind; + /** Field names. */ + names: IdentifierExpression[]; + /** Field values. */ + values: Expression[]; + } + /** Represents a parenthesized expression. */ + export class ParenthesizedExpression extends Expression { + kind: NodeKind; + /** Expression in parenthesis. */ + expression: Expression; + } + /** Represents a property access expression. */ + export class PropertyAccessExpression extends Expression { + kind: NodeKind; + /** Expression being accessed. */ + expression: Expression; + /** Property of the expression being accessed. */ + property: IdentifierExpression; + } + /** Represents a regular expression literal expression. */ + export class RegexpLiteralExpression extends LiteralExpression { + literalKind: LiteralKind; + /** Regular expression pattern. */ + pattern: string; + /** Regular expression flags. */ + patternFlags: string; + } + /** Represents a ternary expression, i.e., short if notation. */ + export class TernaryExpression extends Expression { + kind: NodeKind; + /** Condition expression. */ + condition: Expression; + /** Expression executed when condition is `true`. */ + ifThen: Expression; + /** Expression executed when condition is `false`. */ + ifElse: Expression; + } + /** Represents a string literal expression. */ + export class StringLiteralExpression extends LiteralExpression { + literalKind: LiteralKind; + /** String value without quotes. */ + value: string; + } + /** Represents a `super` expression. */ + export class SuperExpression extends IdentifierExpression { + kind: NodeKind; + text: string; + symbol: string; + } + /** Represents a `this` expression. */ + export class ThisExpression extends IdentifierExpression { + kind: NodeKind; + text: string; + symbol: string; + } + /** Represents a `true` expression. */ + export class TrueExpression extends IdentifierExpression { + kind: NodeKind; + text: string; + symbol: string; + } + /** Represents a `false` expression. */ + export class FalseExpression extends IdentifierExpression { + kind: NodeKind; + text: string; + symbol: string; + } + /** Base class of all unary expressions. */ + export abstract class UnaryExpression extends Expression { + /** Operator token. */ + operator: Token; + /** Operand expression. */ + operand: Expression; + } + /** Represents a unary postfix expression, e.g. a postfix increment. */ + export class UnaryPostfixExpression extends UnaryExpression { + kind: NodeKind; + } + /** Represents a unary prefix expression, e.g. a negation. */ + export class UnaryPrefixExpression extends UnaryExpression { + kind: NodeKind; + } + /** Base class of all statement nodes. */ + export abstract class Statement extends Node { + } + /** Indicates the specific kind of a source. */ + export enum SourceKind { + /** Default source. Usually imported from an entry file. */ + DEFAULT = 0, + /** Entry file. */ + ENTRY = 1, + /** Library file. */ + LIBRARY = 2 + } + /** A top-level source node. */ + export class Source extends Node { + kind: NodeKind; + parent: null; + /** Source kind. */ + sourceKind: SourceKind; + /** Normalized path. */ + normalizedPath: string; + /** Path used internally. */ + internalPath: string; + /** Simple path (last part without extension). */ + simplePath: string; + /** Contained statements. */ + statements: Statement[]; + /** Full source text. */ + text: string; + /** Tokenizer reference. */ + tokenizer: Tokenizer | null; + /** Source map index. */ + debugInfoIndex: i32; + /** Re-exported sources. */ + exportPaths: Set | null; + /** Constructs a new source node. */ + constructor(normalizedPath: string, text: string, kind: SourceKind); + /** Tests if this source is an entry file. */ + readonly isEntry: bool; + /** Tests if this source is a stdlib file. */ + readonly isLibrary: bool; + } + /** Base class of all declaration statements. */ + export abstract class DeclarationStatement extends Statement { + /** Simple name being declared. */ + name: IdentifierExpression; + /** Array of decorators. */ + decorators: DecoratorNode[] | null; + /** Common flags indicating specific traits. */ + flags: CommonFlags; + /** Tests if this node has the specified flag or flags. */ + is(flag: CommonFlags): bool; + /** Tests if this node has one of the specified flags. */ + isAny(flag: CommonFlags): bool; + /** Sets a specific flag or flags. */ + set(flag: CommonFlags): void; + } + /** Represents an index signature declaration. */ + export class IndexSignatureDeclaration extends DeclarationStatement { + kind: NodeKind; + /** Key type. */ + keyType: TypeNode; + /** Value type. */ + valueType: CommonTypeNode; + } + /** Base class of all variable-like declaration statements. */ + export abstract class VariableLikeDeclarationStatement extends DeclarationStatement { + /** Variable type. */ + type: CommonTypeNode | null; + /** Variable initializer. */ + initializer: Expression | null; + } + /** Represents a block statement. */ + export class BlockStatement extends Statement { + kind: NodeKind; + /** Contained statements. */ + statements: Statement[]; + } + /** Represents a `break` statement. */ + export class BreakStatement extends Statement { + kind: NodeKind; + /** Target label, if applicable. */ + label: IdentifierExpression | null; + } + /** Represents a `class` declaration. */ + export class ClassDeclaration extends DeclarationStatement { + kind: NodeKind; + /** Accepted type parameters. */ + typeParameters: TypeParameterNode[] | null; + /** Base class type being extended, if any. */ + extendsType: TypeNode | null; + /** Interface types being implemented, if any. */ + implementsTypes: TypeNode[] | null; + /** Class member declarations. */ + members: DeclarationStatement[]; + readonly isGeneric: bool; + } + /** Represents a `continue` statement. */ + export class ContinueStatement extends Statement { + kind: NodeKind; + /** Target label, if applicable. */ + label: IdentifierExpression | null; + } + /** Represents a `do` statement. */ + export class DoStatement extends Statement { + kind: NodeKind; + /** Statement being looped over. */ + statement: Statement; + /** Condition when to repeat. */ + condition: Expression; + } + /** Represents an empty statement, i.e., a semicolon terminating nothing. */ + export class EmptyStatement extends Statement { + kind: NodeKind; + } + /** Represents an `enum` declaration. */ + export class EnumDeclaration extends DeclarationStatement { + kind: NodeKind; + /** Enum value declarations. */ + values: EnumValueDeclaration[]; + } + /** Represents a value of an `enum` declaration. */ + export class EnumValueDeclaration extends VariableLikeDeclarationStatement { + kind: NodeKind; + /** Value expression. */ + value: Expression | null; + } + /** Represents an `export import` statement of an interface. */ + export class ExportImportStatement extends Node { + kind: NodeKind; + /** Identifier being imported. */ + name: IdentifierExpression; + /** Identifier being exported. */ + externalName: IdentifierExpression; + } + /** Represents a member of an `export` statement. */ + export class ExportMember extends Node { + kind: NodeKind; + /** Local identifier. */ + localName: IdentifierExpression; + /** Exported identifier. */ + exportedName: IdentifierExpression; + } + /** Represents an `export` statement. */ + export class ExportStatement extends Statement { + kind: NodeKind; + /** Array of members if a set of named exports, or `null` if a file export. */ + members: ExportMember[] | null; + /** Path being exported from, if applicable. */ + path: StringLiteralExpression | null; + /** Normalized path, if `path` is set. */ + normalizedPath: string | null; + /** Mangled internal path being referenced, if `path` is set. */ + internalPath: string | null; + /** Whether this is a declared export. */ + isDeclare: bool; + } + /** Represents an `export default` statement. */ + export class ExportDefaultStatement extends Statement { + kind: NodeKind; + /** Declaration being exported as default. */ + declaration: DeclarationStatement; + } + /** Represents an expression that is used as a statement. */ + export class ExpressionStatement extends Statement { + kind: NodeKind; + /** Expression being used as a statement.*/ + expression: Expression; + } + /** Represents a field declaration within a `class`. */ + export class FieldDeclaration extends VariableLikeDeclarationStatement { + kind: NodeKind; + /** Parameter index if declared as a constructor parameter, otherwise `-1`. */ + parameterIndex: i32; + } + /** Represents a `for` statement. */ + export class ForStatement extends Statement { + kind: NodeKind; + /** + * Initializer statement, if present. + * Either a {@link VariableStatement} or {@link ExpressionStatement}. + */ + initializer: Statement | null; + /** Condition expression, if present. */ + condition: Expression | null; + /** Incrementor expression, if present. */ + incrementor: Expression | null; + /** Statement being looped over. */ + statement: Statement; + } + /** Indicates the kind of an array function. */ + export const enum ArrowKind { + /** Not an arrow function. */ + NONE = 0, + /** Parenthesized parameter list. */ + ARROW_PARENTHESIZED = 1, + /** Single parameter without parenthesis. */ + ARROW_SINGLE = 2 + } + /** Represents a `function` declaration. */ + export class FunctionDeclaration extends DeclarationStatement { + kind: NodeKind; + /** Type parameters, if any. */ + typeParameters: TypeParameterNode[] | null; + /** Function signature. */ + signature: SignatureNode; + /** Body statement. Usually a block. */ + body: Statement | null; + /** Arrow function kind, if applicable. */ + arrowKind: ArrowKind; + readonly isGeneric: bool; + /** Clones this function declaration. */ + clone(): FunctionDeclaration; + } + /** Represents an `if` statement. */ + export class IfStatement extends Statement { + kind: NodeKind; + /** Condition. */ + condition: Expression; + /** Statement executed when condition is `true`. */ + ifTrue: Statement; + /** Statement executed when condition is `false`. */ + ifFalse: Statement | null; + } + /** Represents an `import` declaration part of an {@link ImportStatement}. */ + export class ImportDeclaration extends DeclarationStatement { + kind: NodeKind; + /** Identifier being imported. */ + foreignName: IdentifierExpression; + } + /** Represents an `import` statement. */ + export class ImportStatement extends Statement { + kind: NodeKind; + /** Array of member declarations or `null` if an asterisk import. */ + declarations: ImportDeclaration[] | null; + /** Name of the local namespace, if an asterisk import. */ + namespaceName: IdentifierExpression | null; + /** Path being imported from. */ + path: StringLiteralExpression; + /** Normalized path. */ + normalizedPath: string; + /** Mangled internal path being referenced. */ + internalPath: string; + } + /** Represents an `interfarce` declaration. */ + export class InterfaceDeclaration extends ClassDeclaration { + kind: NodeKind; + } + /** Represents a method declaration within a `class`. */ + export class MethodDeclaration extends FunctionDeclaration { + kind: NodeKind; + } + /** Represents a `namespace` declaration. */ + export class NamespaceDeclaration extends DeclarationStatement { + kind: NodeKind; + /** Array of namespace members. */ + members: Statement[]; + } + /** Represents a `return` statement. */ + export class ReturnStatement extends Statement { + kind: NodeKind; + /** Value expression being returned, if present. */ + value: Expression | null; + } + /** Represents a single `case` within a `switch` statement. */ + export class SwitchCase extends Node { + kind: NodeKind; + /** Label expression. `null` indicates the default case. */ + label: Expression | null; + /** Contained statements. */ + statements: Statement[]; + } + /** Represents a `switch` statement. */ + export class SwitchStatement extends Statement { + kind: NodeKind; + /** Condition expression. */ + condition: Expression; + /** Contained cases. */ + cases: SwitchCase[]; + } + /** Represents a `throw` statement. */ + export class ThrowStatement extends Statement { + kind: NodeKind; + /** Value expression being thrown. */ + value: Expression; + } + /** Represents a `try` statement. */ + export class TryStatement extends Statement { + kind: NodeKind; + /** Contained statements. */ + statements: Statement[]; + /** Exception variable name, if a `catch` clause is present. */ + catchVariable: IdentifierExpression | null; + /** Statements being executed on catch, if a `catch` clause is present. */ + catchStatements: Statement[] | null; + /** Statements being executed afterwards, if a `finally` clause is present. */ + finallyStatements: Statement[] | null; + } + /** Represents a `type` declaration. */ + export class TypeDeclaration extends DeclarationStatement { + kind: NodeKind; + /** Type parameters, if any. */ + typeParameters: TypeParameterNode[] | null; + /** Type being aliased. */ + type: CommonTypeNode; + } + /** Represents a variable declaration part of a {@link VariableStatement}. */ + export class VariableDeclaration extends VariableLikeDeclarationStatement { + kind: NodeKind; + } + /** Represents a variable statement wrapping {@link VariableDeclaration}s. */ + export class VariableStatement extends Statement { + kind: NodeKind; + /** Array of decorators. */ + decorators: DecoratorNode[] | null; + /** Array of member declarations. */ + declarations: VariableDeclaration[]; + } + /** Represents a void statement dropping an expression's value. */ + export class VoidStatement extends Statement { + kind: NodeKind; + /** Expression being dropped. */ + expression: Expression; + } + /** Represents a `while` statement. */ + export class WhileStatement extends Statement { + kind: NodeKind; + /** Condition expression. */ + condition: Expression; + /** Statement being looped over. */ + statement: Statement; + } + /** Finds the first decorator matching the specified kind. */ + export function findDecorator(kind: DecoratorKind, decorators: DecoratorNode[] | null): DecoratorNode | null; + /** Mangles an external to an internal path. */ + export function mangleInternalPath(path: string): string; + /** Tests if the specified type node represents an omitted type. */ + export function isTypeOmitted(type: CommonTypeNode): bool; + +} +declare module 'assemblyscript/src/module' { + /** + * A thin wrapper around Binaryen's C-API. + * @module module + */ /***/ + import { Target } from 'assemblyscript/src/common'; + export type ModuleRef = usize; + export type FunctionTypeRef = usize; + export type FunctionRef = usize; + export type ExpressionRef = usize; + export type GlobalRef = usize; + export type ImportRef = usize; + export type ExportRef = usize; + export type RelooperRef = usize; + export type RelooperBlockRef = usize; + export type Index = u32; + export enum NativeType { + None, + I32, + I64, + F32, + F64, + V128, + Unreachable, + Auto + } + export enum FeatureFlags { + Atomics, + MutableGloabls, + NontrappingFPToInt, + SIMD128, + BulkMemory, + SignExt, + ExceptionHandling + } + export enum ExpressionId { + Invalid, + Block, + If, + Loop, + Break, + Switch, + Call, + CallIndirect, + LocalGet, + LocalSet, + GlobalGet, + GlobalSet, + Load, + Store, + Const, + Unary, + Binary, + Select, + Drop, + Return, + Host, + Nop, + Unreachable, + AtomicCmpxchg, + AtomicRMW, + AtomicWait, + AtomicNotify, + SIMDExtract, + SIMDReplace, + SIMDShuffle, + SIMDBitselect, + SIMDShift, + MemoryInit, + DataDrop, + MemoryCopy, + MemoryFill + } + export enum UnaryOp { + ClzI32, + CtzI32, + PopcntI32, + NegF32, + AbsF32, + CeilF32, + FloorF32, + TruncF32, + NearestF32, + SqrtF32, + EqzI32, + ClzI64, + CtzI64, + PopcntI64, + NegF64, + AbsF64, + CeilF64, + FloorF64, + TruncF64, + NearestF64, + SqrtF64, + EqzI64, + ExtendI32, + ExtendU32, + WrapI64, + TruncF32ToI32, + TruncF32ToI64, + TruncF32ToU32, + TruncF32ToU64, + TruncF64ToI32, + TruncF64ToI64, + TruncF64ToU32, + TruncF64ToU64, + ReinterpretF32, + ReinterpretF64, + ConvertI32ToF32, + ConvertI32ToF64, + ConvertU32ToF32, + ConvertU32ToF64, + ConvertI64ToF32, + ConvertI64ToF64, + ConvertU64ToF32, + ConvertU64ToF64, + PromoteF32, + DemoteF64, + ReinterpretI32, + ReinterpretI64, + ExtendI8ToI32, + ExtendI16ToI32, + ExtendI8ToI64, + ExtendI16ToI64, + ExtendI32ToI64, + SplatVecI8x16, + SplatVecI16x8, + SplatVecI32x4, + SplatVecI64x2, + SplatVecF32x4, + SplatVecF64x2, + NotVec128, + NegVecI8x16, + AnyTrueVecI8x16, + AllTrueVecI8x16, + NegVecI16x8, + AnyTrueVecI16x8, + AllTrueVecI16x8, + NegVecI32x4, + AnyTrueVecI32x4, + AllTrueVecI32x4, + NegVecI64x2, + AnyTrueVecI64x2, + AllTrueVecI64x2, + AbsVecF32x4, + NegVecF32x4, + SqrtVecF32x4, + AbsVecF64x2, + NegVecF64x2, + SqrtVecF64x2, + TruncSatSVecF32x4ToVecI32x4, + TruncSatUVecF32x4ToVecI32x4, + TruncSatSVecF64x2ToVecI64x2, + TruncSatUVecF64x2ToVecI64x2, + ConvertSVecI32x4ToVecF32x4, + ConvertUVecI32x4ToVecF32x4, + ConvertSVecI64x2ToVecF64x2, + ConvertUVecI64x2ToVecF64x2 + } + export enum BinaryOp { + AddI32, + SubI32, + MulI32, + DivI32, + DivU32, + RemI32, + RemU32, + AndI32, + OrI32, + XorI32, + ShlI32, + ShrU32, + ShrI32, + RotlI32, + RotrI32, + EqI32, + NeI32, + LtI32, + LtU32, + LeI32, + LeU32, + GtI32, + GtU32, + GeI32, + GeU32, + AddI64, + SubI64, + MulI64, + DivI64, + DivU64, + RemI64, + RemU64, + AndI64, + OrI64, + XorI64, + ShlI64, + ShrU64, + ShrI64, + RotlI64, + RotrI64, + EqI64, + NeI64, + LtI64, + LtU64, + LeI64, + LeU64, + GtI64, + GtU64, + GeI64, + GeU64, + AddF32, + SubF32, + MulF32, + DivF32, + CopysignF32, + MinF32, + MaxF32, + EqF32, + NeF32, + LtF32, + LeF32, + GtF32, + GeF32, + AddF64, + SubF64, + MulF64, + DivF64, + CopysignF64, + MinF64, + MaxF64, + EqF64, + NeF64, + LtF64, + LeF64, + GtF64, + GeF64, + EqVecI8x16, + NeVecI8x16, + LtSVecI8x16, + LtUVecI8x16, + LeSVecI8x16, + LeUVecI8x16, + GtSVecI8x16, + GtUVecI8x16, + GeSVecI8x16, + GeUVecI8x16, + EqVecI16x8, + NeVecI16x8, + LtSVecI16x8, + LtUVecI16x8, + LeSVecI16x8, + LeUVecI16x8, + GtSVecI16x8, + GtUVecI16x8, + GeSVecI16x8, + GeUVecI16x8, + EqVecI32x4, + NeVecI32x4, + LtSVecI32x4, + LtUVecI32x4, + LeSVecI32x4, + LeUVecI32x4, + GtSVecI32x4, + GtUVecI32x4, + GeSVecI32x4, + GeUVecI32x4, + EqVecF32x4, + NeVecF32x4, + LtVecF32x4, + LeVecF32x4, + GtVecF32x4, + GeVecF32x4, + EqVecF64x2, + NeVecF64x2, + LtVecF64x2, + LeVecF64x2, + GtVecF64x2, + GeVecF64x2, + AndVec128, + OrVec128, + XorVec128, + AddVecI8x16, + AddSatSVecI8x16, + AddSatUVecI8x16, + SubVecI8x16, + SubSatSVecI8x16, + SubSatUVecI8x16, + MulVecI8x16, + AddVecI16x8, + AddSatSVecI16x8, + AddSatUVecI16x8, + SubVecI16x8, + SubSatSVecI16x8, + SubSatUVecI16x8, + MulVecI16x8, + AddVecI32x4, + SubVecI32x4, + MulVecI32x4, + AddVecI64x2, + SubVecI64x2, + AddVecF32x4, + SubVecF32x4, + MulVecF32x4, + DivVecF32x4, + MinVecF32x4, + MaxVecF32x4, + AddVecF64x2, + SubVecF64x2, + MulVecF64x2, + DivVecF64x2, + MinVecF64x2, + MaxVecF64x2 + } + export enum HostOp { + MemorySize, + MemoryGrow + } + export enum AtomicRMWOp { + Add, + Sub, + And, + Or, + Xor, + Xchg + } + export enum SIMDExtractOp { + ExtractLaneSVecI8x16, + ExtractLaneUVecI8x16, + ExtractLaneSVecI16x8, + ExtractLaneUVecI16x8, + ExtractLaneVecI32x4, + ExtractLaneVecI64x2, + ExtractLaneVecF32x4, + ExtractLaneVecF64x2 + } + export enum SIMDReplaceOp { + ReplaceLaneVecI8x16, + ReplaceLaneVecI16x8, + ReplaceLaneVecI32x4, + ReplaceLaneVecI64x2, + ReplaceLaneVecF32x4, + ReplaceLaneVecF64x2 + } + export enum SIMDShiftOp { + ShlVecI8x16, + ShrSVecI8x16, + ShrUVecI8x16, + ShlVecI16x8, + ShrSVecI16x8, + ShrUVecI16x8, + ShlVecI32x4, + ShrSVecI32x4, + ShrUVecI32x4, + ShlVecI64x2, + ShrSVecI64x2, + ShrUVecI64x2 + } + export class MemorySegment { + buffer: Uint8Array; + offset: I64; + static create(buffer: Uint8Array, offset: I64): MemorySegment; + } + export class Module { + ref: ModuleRef; + private lit; + static create(): Module; + static createFrom(buffer: Uint8Array): Module; + private constructor(); + addFunctionType(name: string, result: NativeType, paramTypes: NativeType[] | null): FunctionRef; + getFunctionTypeBySignature(result: NativeType, paramTypes: NativeType[] | null): FunctionTypeRef; + removeFunctionType(name: string): void; + i32(value: i32): ExpressionRef; + i64(valueLow: i32, valueHigh?: i32): ExpressionRef; + f32(value: f32): ExpressionRef; + f64(value: f64): ExpressionRef; + v128(bytes: Uint8Array): ExpressionRef; + unary(op: UnaryOp, expr: ExpressionRef): ExpressionRef; + binary(op: BinaryOp, left: ExpressionRef, right: ExpressionRef): ExpressionRef; + host(op: HostOp, name?: string | null, operands?: ExpressionRef[] | null): ExpressionRef; + local_get(index: i32, type: NativeType): ExpressionRef; + local_tee(index: i32, value: ExpressionRef): ExpressionRef; + global_get(name: string, type: NativeType): ExpressionRef; + load(bytes: Index, signed: bool, ptr: ExpressionRef, type: NativeType, offset?: Index, align?: Index): ExpressionRef; + store(bytes: Index, ptr: ExpressionRef, value: ExpressionRef, type: NativeType, offset?: Index, align?: Index): ExpressionRef; + atomic_load(bytes: Index, ptr: ExpressionRef, type: NativeType, offset?: Index): ExpressionRef; + atomic_store(bytes: Index, ptr: ExpressionRef, value: ExpressionRef, type: NativeType, offset?: Index): ExpressionRef; + atomic_rmw(op: AtomicRMWOp, bytes: Index, offset: Index, ptr: ExpressionRef, value: ExpressionRef, type: NativeType): ExpressionRef; + atomic_cmpxchg(bytes: Index, offset: Index, ptr: ExpressionRef, expected: ExpressionRef, replacement: ExpressionRef, type: NativeType): ExpressionRef; + atomic_wait(ptr: ExpressionRef, expected: ExpressionRef, timeout: ExpressionRef, expectedType: NativeType): ExpressionRef; + atomic_notify(ptr: ExpressionRef, notifyCount: ExpressionRef): ExpressionRef; + local_set(index: Index, value: ExpressionRef): ExpressionRef; + global_set(name: string, value: ExpressionRef): ExpressionRef; + block(label: string | null, children: ExpressionRef[], type?: NativeType): ExpressionRef; + br(label: string | null, condition?: ExpressionRef, value?: ExpressionRef): ExpressionRef; + drop(expression: ExpressionRef): ExpressionRef; + loop(label: string | null, body: ExpressionRef): ExpressionRef; + if(condition: ExpressionRef, ifTrue: ExpressionRef, ifFalse?: ExpressionRef): ExpressionRef; + nop(): ExpressionRef; + return(expression?: ExpressionRef): ExpressionRef; + select(ifTrue: ExpressionRef, ifFalse: ExpressionRef, condition: ExpressionRef): ExpressionRef; + switch(names: string[], defaultName: string | null, condition: ExpressionRef, value?: ExpressionRef): ExpressionRef; + call(target: string, operands: ExpressionRef[] | null, returnType: NativeType): ExpressionRef; + call_indirect(index: ExpressionRef, operands: ExpressionRef[] | null, typeName: string): ExpressionRef; + unreachable(): ExpressionRef; + memory_copy(dest: ExpressionRef, source: ExpressionRef, size: ExpressionRef): ExpressionRef; + memory_fill(dest: ExpressionRef, value: ExpressionRef, size: ExpressionRef): ExpressionRef; + simd_extract(op: SIMDExtractOp, vec: ExpressionRef, idx: u8): ExpressionRef; + simd_replace(op: SIMDReplaceOp, vec: ExpressionRef, idx: u8, value: ExpressionRef): ExpressionRef; + simd_shuffle(vec1: ExpressionRef, vec2: ExpressionRef, mask: Uint8Array): ExpressionRef; + simd_bitselect(vec1: ExpressionRef, vec2: ExpressionRef, cond: ExpressionRef): ExpressionRef; + simd_shift(op: SIMDShiftOp, vec: ExpressionRef, shift: ExpressionRef): ExpressionRef; + addGlobal(name: string, type: NativeType, mutable: bool, initializer: ExpressionRef): GlobalRef; + removeGlobal(name: string): void; + addFunction(name: string, type: FunctionTypeRef, varTypes: NativeType[] | null, body: ExpressionRef): FunctionRef; + removeFunction(name: string): void; + private hasTemporaryFunction; + addTemporaryFunction(result: NativeType, paramTypes: NativeType[] | null, body: ExpressionRef): FunctionRef; + removeTemporaryFunction(): void; + addFunctionExport(internalName: string, externalName: string): ExportRef; + addTableExport(internalName: string, externalName: string): ExportRef; + addMemoryExport(internalName: string, externalName: string): ExportRef; + addGlobalExport(internalName: string, externalName: string): ExportRef; + removeExport(externalName: string): void; + addFunctionImport(internalName: string, externalModuleName: string, externalBaseName: string, functionType: FunctionTypeRef): ImportRef; + addTableImport(internalName: string, externalModuleName: string, externalBaseName: string): ImportRef; + addMemoryImport(internalName: string, externalModuleName: string, externalBaseName: string, shared?: bool): ImportRef; + addGlobalImport(internalName: string, externalModuleName: string, externalBaseName: string, globalType: NativeType): ImportRef; + /** Unlimited memory constant. */ + static readonly UNLIMITED_MEMORY: Index; + setMemory(initial: Index, maximum: Index, segments: MemorySegment[], target: Target, exportName?: string | null, shared?: bool): void; + setFunctionTable(initial: Index, maximum: Index, funcs: string[]): void; + setStart(func: FunctionRef): void; + getOptimizeLevel(): i32; + setOptimizeLevel(level?: i32): void; + getShrinkLevel(): i32; + setShrinkLevel(level?: i32): void; + setDebugInfo(on?: bool): void; + getFeatures(): BinaryenFeatureFlags; + setFeatures(featureFlags: BinaryenFeatureFlags): void; + optimize(func?: FunctionRef): void; + runPasses(passes: string[], func?: FunctionRef): void; + private cachedPrecomputeNames; + precomputeExpression(expr: ExpressionRef): ExpressionRef; + validate(): bool; + interpret(): void; + toBinary(sourceMapUrl: string | null): BinaryModule; + toText(): string; + toAsmjs(): string; + private cachedStrings; + private allocStringCached; + dispose(): void; + createRelooper(): Relooper; + cloneExpression(expr: ExpressionRef, noSideEffects?: bool, maxDepth?: i32): ExpressionRef; + addDebugInfoFile(name: string): Index; + getDebugInfoFile(index: Index): string | null; + setDebugLocation(func: FunctionRef, expr: ExpressionRef, fileIndex: Index, lineNumber: Index, columnNumber: Index): void; + } + export function getExpressionId(expr: ExpressionRef): ExpressionId; + export function getExpressionType(expr: ExpressionRef): NativeType; + export function getConstValueI32(expr: ExpressionRef): i32; + export function getConstValueI64Low(expr: ExpressionRef): i32; + export function getConstValueI64High(expr: ExpressionRef): i32; + export function getConstValueF32(expr: ExpressionRef): f32; + export function getConstValueF64(expr: ExpressionRef): f32; + export function getLocalGetIndex(expr: ExpressionRef): Index; + export function getLocalSetIndex(expr: ExpressionRef): Index; + export function getLocalSetValue(expr: ExpressionRef): ExpressionRef; + export function isLocalTee(expr: ExpressionRef): bool; + export function getGlobalGetName(expr: ExpressionRef): string | null; + export function getBinaryOp(expr: ExpressionRef): BinaryOp; + export function getBinaryLeft(expr: ExpressionRef): ExpressionRef; + export function getBinaryRight(expr: ExpressionRef): ExpressionRef; + export function getUnaryOp(expr: ExpressionRef): UnaryOp; + export function getUnaryValue(expr: ExpressionRef): ExpressionRef; + export function getLoadBytes(expr: ExpressionRef): u32; + export function getLoadOffset(expr: ExpressionRef): u32; + export function getLoadPtr(expr: ExpressionRef): ExpressionRef; + export function isLoadSigned(expr: ExpressionRef): bool; + export function getStoreBytes(expr: ExpressionRef): u32; + export function getStoreOffset(expr: ExpressionRef): u32; + export function getStorePtr(expr: ExpressionRef): ExpressionRef; + export function getStoreValue(expr: ExpressionRef): ExpressionRef; + export function getBlockName(expr: ExpressionRef): string | null; + export function getBlockChildCount(expr: ExpressionRef): Index; + export function getBlockChild(expr: ExpressionRef, index: Index): ExpressionRef; + export function getIfCondition(expr: ExpressionRef): ExpressionRef; + export function getIfTrue(expr: ExpressionRef): ExpressionRef; + export function getIfFalse(expr: ExpressionRef): ExpressionRef; + export function getLoopName(expr: ExpressionRef): string | null; + export function getLoopBody(expr: ExpressionRef): ExpressionRef; + export function getBreakName(expr: ExpressionRef): string | null; + export function getBreakCondition(expr: ExpressionRef): ExpressionRef; + export function getSelectThen(expr: ExpressionRef): ExpressionRef; + export function getSelectElse(expr: ExpressionRef): ExpressionRef; + export function getSelectCondition(expr: ExpressionRef): ExpressionRef; + export function getDropValue(expr: ExpressionRef): ExpressionRef; + export function getReturnValue(expr: ExpressionRef): ExpressionRef; + export function getCallTarget(expr: ExpressionRef): string | null; + export function getCallOperandCount(expr: ExpressionRef): i32; + export function getCallOperand(expr: ExpressionRef, index: Index): ExpressionRef; + export function getHostOp(expr: ExpressionRef): ExpressionRef; + export function getHostOperandCount(expr: ExpressionRef): Index; + export function getHostOperand(expr: ExpressionRef, index: Index): ExpressionRef; + export function getHostName(expr: ExpressionRef): string | null; + export function getFunctionBody(func: FunctionRef): ExpressionRef; + export function getFunctionName(func: FunctionRef): string | null; + export function getFunctionParamCount(func: FunctionRef): Index; + export function getFunctionParamType(func: FunctionRef, index: Index): NativeType; + export function getFunctionResultType(func: FunctionRef): NativeType; + export class Relooper { + module: Module; + ref: RelooperRef; + static create(module: Module): Relooper; + private constructor(); + addBlock(code: ExpressionRef): RelooperBlockRef; + addBranch(from: RelooperBlockRef, to: RelooperBlockRef, condition?: ExpressionRef, code?: ExpressionRef): void; + addBlockWithSwitch(code: ExpressionRef, condition: ExpressionRef): RelooperBlockRef; + addBranchForSwitch(from: RelooperBlockRef, to: RelooperBlockRef, indexes: i32[], code?: ExpressionRef): void; + renderAndDispose(entry: RelooperBlockRef, labelHelper: Index): ExpressionRef; + } + export function readString(ptr: usize): string | null; + /** Result structure of {@link Module#toBinary}. */ + export class BinaryModule { + /** WebAssembly binary. */ + output: Uint8Array; + /** Source map, if generated. */ + sourceMap: string | null; + } + /** Tests if an expression needs an explicit 'unreachable' when it is the terminating statement. */ + export function needsExplicitUnreachable(expr: ExpressionRef): bool; + /** Traverses all expression members of an expression, calling the given visitor. */ + export function traverse(expr: ExpressionRef, data: T, visit: (expr: ExpressionRef, data: T) => void): bool; + +} +declare module 'assemblyscript/src/types' { + /** + * Mappings from AssemblyScript types to WebAssembly types. + * @module types + */ /***/ + import { Class, FunctionTarget, Program } from 'assemblyscript/src/program'; + import { NativeType, ExpressionRef, Module } from 'assemblyscript/src/module'; + /** Indicates the kind of a type. */ + export const enum TypeKind { + /** An 8-bit signed integer. */ + I8 = 0, + /** A 16-bit signed integer. */ + I16 = 1, + /** A 32-bit signed integer. */ + I32 = 2, + /** A 64-bit signed integer. */ + I64 = 3, + /** A 32-bit/64-bit signed integer, depending on the target. */ + ISIZE = 4, + /** An 8-bit unsigned integer. */ + U8 = 5, + /** A 16-bit unsigned integer. */ + U16 = 6, + /** A 32-bit unsigned integer. Also the base of function types. */ + U32 = 7, + /** A 64-bit unsigned integer. */ + U64 = 8, + /** A 32-bit/64-bit unsigned integer, depending on the target. Also the base of class types. */ + USIZE = 9, + /** A 1-bit unsigned integer. */ + BOOL = 10, + /** A 32-bit float. */ + F32 = 11, + /** A 64-bit double. */ + F64 = 12, + /** A 128-bit vector. */ + V128 = 13, + /** No return type. */ + VOID = 14 + } + /** Indicates capabilities of a type. */ + export const enum TypeFlags { + NONE = 0, + /** Is a signed type that can represent negative values. */ + SIGNED = 1, + /** Is an unsigned type that cannot represent negative values. */ + UNSIGNED = 2, + /** Is an integer type. */ + INTEGER = 4, + /** Is a floating point type. */ + FLOAT = 8, + /** Is a pointer type. */ + POINTER = 16, + /** Is smaller than 32-bits. */ + SHORT = 32, + /** Is larger than 32-bits. */ + LONG = 64, + /** Is a value type. */ + VALUE = 128, + /** Is a reference type. */ + REFERENCE = 256, + /** Is a nullable type. */ + NULLABLE = 512, + /** Is a vector type. */ + VECTOR = 1024 + } + /** Represents a resolved type. */ + export class Type { + /** Type kind. */ + kind: TypeKind; + /** Type flags. */ + flags: TypeFlags; + /** Size in bits. */ + size: u32; + /** Size in bytes. */ + byteSize: i32; + /** Underlying class reference, if a class type. */ + classReference: Class | null; + /** Underlying signature reference, if a function type. */ + signatureReference: Signature | null; + /** Respective non-nullable type, if nullable. */ + nonNullableType: Type; + /** Cached nullable type, if non-nullable. */ + private cachedNullableType; + /** Constructs a new resolved type. */ + constructor(kind: TypeKind, flags: TypeFlags, size: u32); + /** Returns the closest int type representing this type. */ + readonly intType: Type; + /** Gets this type's logarithmic alignment in memory. */ + readonly alignLog2: i32; + /** Tests if this is a managed type that needs GC hooks. */ + readonly isManaged: bool; + /** Tests if this is a class type explicitly annotated as unmanaged. */ + readonly isUnmanaged: bool; + /** Computes the sign-extending shift in the target type. */ + computeSmallIntegerShift(targetType: Type): u32; + /** Computes the truncating mask in the target type. */ + computeSmallIntegerMask(targetType: Type): u32; + /** Tests if this type has (all of) the specified flags. */ + is(flags: TypeFlags): bool; + /** Tests if this type has any of the specified flags. */ + isAny(flags: TypeFlags): bool; + /** Composes a class type from this type and a class. */ + asClass(classType: Class): Type; + /** Composes a function type from this type and a function. */ + asFunction(signature: Signature): Type; + /** Composes the respective nullable type of this type. */ + asNullable(): Type; + /** Tests if a value of this type is assignable to the target type incl. implicit conversion. */ + isAssignableTo(target: Type, signednessIsRelevant?: bool): bool; + /** Tests if a value of this type is assignable to the target type excl. implicit conversion. */ + isStrictlyAssignableTo(target: Type, signednessIsRelevant?: bool): bool; + /** Determines the common denominator type of two types, if there is any. */ + static commonDenominator(left: Type, right: Type, signednessIsImportant: bool): Type | null; + /** Converts this type to a string. */ + toString(): string; + /** Converts this type to its respective native type. */ + toNativeType(): NativeType; + /** Converts this type to its native `0` value. */ + toNativeZero(module: Module): ExpressionRef; + /** Converts this type to its native `1` value. */ + toNativeOne(module: Module): ExpressionRef; + /** Converts this type to its native `-1` value. */ + toNativeNegOne(module: Module): ExpressionRef; + /** Converts this type to its signature string. */ + toSignatureString(): string; + /** An 8-bit signed integer. */ + static readonly i8: Type; + /** A 16-bit signed integer. */ + static readonly i16: Type; + /** A 32-bit signed integer. */ + static readonly i32: Type; + /** A 64-bit signed integer. */ + static readonly i64: Type; + /** A 32-bit signed size. WASM32 only. */ + static readonly isize32: Type; + /** A 64-bit signed size. WASM64 only. */ + static readonly isize64: Type; + /** An 8-bit unsigned integer. */ + static readonly u8: Type; + /** A 16-bit unsigned integer. */ + static readonly u16: Type; + /** A 32-bit unsigned integer. */ + static readonly u32: Type; + /** A 64-bit unsigned integer. */ + static readonly u64: Type; + /** A 32-bit unsigned size. WASM32 only. */ + static readonly usize32: Type; + /** A 64-bit unsigned size. WASM64 only. */ + static readonly usize64: Type; + /** A 1-bit unsigned integer. */ + static readonly bool: Type; + /** A 32-bit float. */ + static readonly f32: Type; + /** A 64-bit float. */ + static readonly f64: Type; + /** A 128-bit vector. */ + static readonly v128: Type; + /** No return type. */ + static readonly void: Type; + } + /** Converts an array of types to an array of native types. */ + export function typesToNativeTypes(types: Type[]): NativeType[]; + /** Converts an array of types to its combined string representation. */ + export function typesToString(types: Type[]): string; + /** Represents a fully resolved function signature. */ + export class Signature { + /** Parameter types, if any, excluding `this`. */ + parameterTypes: Type[]; + /** Parameter names, if known, excluding `this`. */ + parameterNames: string[] | null; + /** Number of required parameters excluding `this`. Other parameters are considered optional. */ + requiredParameters: i32; + /** Return type. */ + returnType: Type; + /** This type, if an instance signature. */ + thisType: Type | null; + /** Whether the last parameter is a rest parameter. */ + hasRest: bool; + /** Cached {@link FunctionTarget}. */ + cachedFunctionTarget: FunctionTarget | null; + /** Respective function type. */ + type: Type; + /** Constructs a new signature. */ + constructor(parameterTypes?: Type[] | null, returnType?: Type | null, thisType?: Type | null); + asFunctionTarget(program: Program): FunctionTarget; + /** Gets the known or, alternatively, generic parameter name at the specified index. */ + getParameterName(index: i32): string; + /** Tests if a value of this function type is assignable to a target of the specified function type. */ + isAssignableTo(target: Signature): bool; + /** Converts a signature to a function type string. */ + static makeSignatureString(parameterTypes: Type[] | null, returnType: Type, thisType?: Type | null): string; + /** Converts this signature to a function type string. */ + toSignatureString(): string; + /** Converts this signature to a string. */ + toString(): string; + } + /** Gets the cached default parameter name for the specified index. */ + export function getDefaultParameterName(index: i32): string; + +} +declare module 'assemblyscript/src/flow' { + /** + * A control flow analyzer. + * @module flow + */ /***/ + import { Type } from 'assemblyscript/src/types'; + import { Local, Function, Element } from 'assemblyscript/src/program'; + import { ExpressionRef } from 'assemblyscript/src/module'; + import { Node } from 'assemblyscript/src/ast'; + /** Control flow flags indicating specific conditions. */ + export const enum FlowFlags { + /** No specific conditions. */ + NONE = 0, + /** This flow returns. */ + RETURNS = 1, + /** This flow returns a wrapped value. */ + RETURNS_WRAPPED = 2, + /** This flow returns a non-null value. */ + RETURNS_NONNULL = 4, + /** This flow throws. */ + THROWS = 8, + /** This flow breaks. */ + BREAKS = 16, + /** This flow continues. */ + CONTINUES = 32, + /** This flow allocates. Constructors only. */ + ALLOCATES = 64, + /** This flow calls super. Constructors only. */ + CALLS_SUPER = 128, + /** This flow conditionally returns in a child flow. */ + CONDITIONALLY_RETURNS = 256, + /** This flow conditionally throws in a child flow. */ + CONDITIONALLY_THROWS = 512, + /** This flow conditionally breaks in a child flow. */ + CONDITIONALLY_BREAKS = 1024, + /** This flow conditionally continues in a child flow. */ + CONDITIONALLY_CONTINUES = 2048, + /** This flow conditionally allocates in a child flow. Constructors only. */ + CONDITIONALLY_ALLOCATES = 4096, + /** This is an inlining flow. */ + INLINE_CONTEXT = 8192, + /** This is a flow with explicitly disabled bounds checking. */ + UNCHECKED_CONTEXT = 16384, + /** Any terminating flag. */ + ANY_TERMINATING = 57, + /** Any categorical flag. */ + ANY_CATEGORICAL = 255, + /** Any conditional flag. */ + ANY_CONDITIONAL = 7936 + } + /** Flags indicating the current state of a local. */ + export enum LocalFlags { + /** No specific conditions. */ + NONE = 0, + /** Local is constant. */ + CONSTANT = 1, + /** Local is properly wrapped. Relevant for small integers. */ + WRAPPED = 2, + /** Local is non-null. */ + NONNULL = 4, + /** Local is read from. */ + READFROM = 8, + /** Local is written to. */ + WRITTENTO = 16, + /** Local is retained. */ + RETAINED = 32, + /** Local is conditionally read from. */ + CONDITIONALLY_READFROM = 64, + /** Local is conditionally written to. */ + CONDITIONALLY_WRITTENTO = 128, + /** Local must be conditionally retained. */ + CONDITIONALLY_RETAINED = 256, + /** Any categorical flag. */ + ANY_CATEGORICAL = 63, + /** Any conditional flag. */ + ANY_CONDITIONAL = 480, + /** Any retained flag. */ + ANY_RETAINED = 288 + } + export namespace LocalFlags { + function join(left: LocalFlags, right: LocalFlags): LocalFlags; + } + /** Flags indicating the current state of a field. */ + export enum FieldFlags { + /** No specific conditions. */ + NONE = 0, + /** Field is initialized. Relevant in constructors. */ + INITIALIZED = 1, + /** Field is conditionally initialized. Relevant in constructors. */ + CONDITIONALLY_INITIALIZED = 2, + /** Any categorical flag. */ + ANY_CATEGORICAL = 1, + /** Any conditional flag. */ + ANY_CONDITIONAL = 2 + } + export namespace FieldFlags { + function join(left: FieldFlags, right: FieldFlags): FieldFlags; + } + /** A control flow evaluator. */ + export class Flow { + /** Parent flow. */ + parent: Flow | null; + /** Flow flags indicating specific conditions. */ + flags: FlowFlags; + /** Function this flow belongs to. */ + parentFunction: Function; + /** The label we break to when encountering a continue statement. */ + continueLabel: string | null; + /** The label we break to when encountering a break statement. */ + breakLabel: string | null; + /** The current return type. */ + returnType: Type; + /** The current contextual type arguments. */ + contextualTypeArguments: Map | null; + /** Scoped local variables. */ + scopedLocals: Map | null; + /** Local flags. */ + localFlags: LocalFlags[]; + /** Field flags. Relevant in constructors. */ + fieldFlags: Map | null; + /** Function being inlined, when inlining. */ + inlineFunction: Function | null; + /** The label we break to when encountering a return statement, when inlining. */ + inlineReturnLabel: string | null; + /** Creates the parent flow of the specified function. */ + static create(parentFunction: Function): Flow; + /** Creates an inline flow within `parentFunction`. */ + static createInline(parentFunction: Function, inlineFunction: Function): Flow; + private constructor(); + /** Gets the actual function being compiled, The inlined function when inlining, otherwise the parent function. */ + readonly actualFunction: Function; + /** Tests if this flow has the specified flag or flags. */ + is(flag: FlowFlags): bool; + /** Tests if this flow has one of the specified flags. */ + isAny(flag: FlowFlags): bool; + /** Sets the specified flag or flags. */ + set(flag: FlowFlags): void; + /** Unsets the specified flag or flags. */ + unset(flag: FlowFlags): void; + /** Forks this flow to a child flow. */ + fork(): Flow; + /** Gets a free temporary local of the specified type. */ + getTempLocal(type: Type, except?: Set | null): Local; + /** Gets a local that sticks around until this flow is exited, and then released. */ + getAutoreleaseLocal(type: Type, except?: Set | null): Local; + /** Frees the temporary local for reuse. */ + freeTempLocal(local: Local): void; + /** Gets and immediately frees a temporary local of the specified type. */ + getAndFreeTempLocal(type: Type, except?: Set | null): Local; + /** Gets the scoped local of the specified name. */ + getScopedLocal(name: string): Local | null; + /** Adds a new scoped local of the specified name. */ + addScopedLocal(name: string, type: Type, except?: Set | null): Local; + /** Adds a new scoped alias for the specified local. For example `super` aliased to the `this` local. */ + addScopedAlias(name: string, type: Type, index: i32, reportNode?: Node | null): Local; + /** Frees this flow's scoped variables and returns its parent flow. */ + freeScopedLocals(): void; + /** Looks up the local of the specified name in the current scope. */ + lookupLocal(name: string): Local | null; + /** Looks up the element with the specified name relative to the scope of this flow. */ + lookup(name: string): Element | null; + /** Tests if the local at the specified index has the specified flag or flags. */ + isLocalFlag(index: i32, flag: LocalFlags, defaultIfInlined?: bool): bool; + /** Tests if the local at the specified index has any of the specified flags. */ + isAnyLocalFlag(index: i32, flag: LocalFlags, defaultIfInlined?: bool): bool; + /** Sets the specified flag or flags on the local at the specified index. */ + setLocalFlag(index: i32, flag: LocalFlags): void; + /** Unsets the specified flag or flags on the local at the specified index. */ + unsetLocalFlag(index: i32, flag: LocalFlags): void; + /** Pushes a new break label to the stack, for example when entering a loop that one can `break` from. */ + pushBreakLabel(): string; + /** Pops the most recent break label from the stack. */ + popBreakLabel(): void; + /** Inherits flags and local wrap states from the specified flow (e.g. blocks). */ + inherit(other: Flow): void; + /** Inherits categorical flags as conditional flags from the specified flow (e.g. then without else). */ + inheritConditional(other: Flow): void; + /** Inherits mutual flags and local wrap states from the specified flows (e.g. then with else). */ + inheritMutual(left: Flow, right: Flow): void; + /** Checks if an expression of the specified type is known to be non-null, even if the type might be nullable. */ + isNonnull(expr: ExpressionRef, type: Type): bool; + /** Updates local states to reflect that this branch is only taken when `expr` is true-ish. */ + inheritNonnullIfTrue(expr: ExpressionRef): void; + /** Updates local states to reflect that this branch is only taken when `expr` is false-ish. */ + inheritNonnullIfFalse(expr: ExpressionRef): void; + /** + * Tests if an expression can possibly overflow in the context of this flow. Assumes that the + * expression might already have overflown and returns `false` only if the operation neglects + * any possible combination of garbage bits being present. + */ + canOverflow(expr: ExpressionRef, type: Type): bool; + toString(): string; + } + /** Finds all indexes of locals used in the specified expression. */ + export function findUsedLocals(expr: ExpressionRef, used?: Set): Set; + +} +declare module 'assemblyscript/src/resolver' { + /** + * Resolve infrastructure to obtain types and elements. + * @module resolver + */ /***/ + import { DiagnosticEmitter } from 'assemblyscript/src/diagnostics'; + import { Program, Element, Class, ClassPrototype, Function, FunctionPrototype, Global } from 'assemblyscript/src/program'; + import { Flow } from 'assemblyscript/src/flow'; + import { CommonTypeNode, TypeName, TypeParameterNode, Node, IdentifierExpression, CallExpression, ElementAccessExpression, PropertyAccessExpression, LiteralExpression, AssertionExpression, Expression, UnaryPrefixExpression, UnaryPostfixExpression, BinaryExpression, ThisExpression, SuperExpression } from 'assemblyscript/src/ast'; + import { Type } from 'assemblyscript/src/types'; + /** Indicates whether errors are reported or not. */ + export enum ReportMode { + /** Report errors. */ + REPORT = 0, + /** Swallow errors. */ + SWALLOW = 1 + } + /** Provides tools to resolve types and expressions. */ + export class Resolver extends DiagnosticEmitter { + /** The program this resolver belongs to. */ + program: Program; + /** Target expression of the previously resolved property or element access. */ + currentThisExpression: Expression | null; + /** Element expression of the previously resolved element access. */ + currentElementExpression: Expression | null; + /** Constructs the resolver for the specified program. */ + constructor( + /** The program to construct a resolver for. */ + program: Program); + /** Resolves a {@link CommonTypeNode} to a concrete {@link Type}. */ + resolveType( + /** The type to resolve. */ + node: CommonTypeNode, + /** Relative context. */ + context: Element, + /** Type arguments inherited through context, i.e. `T`. */ + contextualTypeArguments?: Map | null, + /** How to proceed with eventualy diagnostics. */ + reportMode?: ReportMode): Type | null; + /** Resolves a type name to the program element it refers to. */ + resolveTypeName( + /** The type name to resolve. */ + typeName: TypeName, + /** Relative context. */ + context: Element, + /** How to proceed with eventualy diagnostics. */ + reportMode?: ReportMode): Element | null; + /** Resolves an array of type arguments to concrete types. */ + resolveTypeArguments( + /** Actual type parameter nodes. */ + typeParameters: TypeParameterNode[], + /** Type arguments provided. */ + typeArgumentNodes: CommonTypeNode[] | null, + /** Relative context. */ + context: Element, + /** Type arguments inherited through context, i.e. `T`. */ + contextualTypeArguments?: Map, + /** Alternative report node in case of empty type arguments. */ + alternativeReportNode?: Node | null, + /** How to proceed with eventualy diagnostics. */ + reportMode?: ReportMode): Type[] | null; + /** Resolves an identifier to the program element it refers to. */ + resolveIdentifier( + /** The expression to resolve. */ + identifier: IdentifierExpression, + /** Optional flow to search for scoped locals. */ + flow: Flow | null, + /** Optional context to search. */ + context: Element | null, + /** How to proceed with eventualy diagnostics. */ + reportMode?: ReportMode): Element | null; + /** Resolves a lazily compiled global, i.e. a static class field. */ + ensureResolvedLazyGlobal(global: Global, reportMode?: ReportMode): bool; + /** Resolves a property access expression to the program element it refers to. */ + resolvePropertyAccessExpression( + /** The expression to resolve. */ + propertyAccess: PropertyAccessExpression, + /** Current flow. */ + flow: Flow, + /** Current contextual type. */ + contextualType: Type, + /** How to proceed with eventualy diagnostics. */ + reportMode?: ReportMode): Element | null; + /** Resolves an element access expression to the program element it refers to. */ + resolveElementAccessExpression( + /** The expression to resolve. */ + elementAccess: ElementAccessExpression, + /** Current flow. */ + flow: Flow, + /** Current contextual type. */ + contextualType: Type, + /** How to proceed with eventualy diagnostics. */ + reportMode?: ReportMode): Element | null; + /** Determines the final type of an integer literal given the specified contextual type. */ + determineIntegerLiteralType( + /** Integer literal value. */ + intValue: I64, + /** Current contextual type. */ + contextualType: Type): Type; + /** Resolves any expression to the program element it refers to. */ + resolveExpression( + /** The expression to resolve. */ + expression: Expression, + /** Current flow. */ + flow: Flow, + /** Current contextual type. */ + contextualType?: Type, + /** How to proceed with eventualy diagnostics. */ + reportMode?: ReportMode): Element | null; + /** Resolves an assertion expression to the program element it refers to. */ + resolveAssertionExpression( + /** The expression to resolve. */ + expression: AssertionExpression, + /** Current flow. */ + flow: Flow, + /** Current contextual type. */ + contextualType?: Type, + /** How to proceed with eventualy diagnostics. */ + reportMode?: ReportMode): Element | null; + /** Resolves an unary prefix expression to the program element it refers to. */ + resolveUnaryPrefixExpression( + /** The expression to resolve. */ + expression: UnaryPrefixExpression, + /** Current flow. */ + flow: Flow, + /** Current contextual type. */ + contextualType?: Type, + /** How to proceed with eventualy diagnostics. */ + reportMode?: ReportMode): Element | null; + /** Resolves an unary postfix expression to the program element it refers to. */ + resolveUnaryPostfixExpression( + /** The expression to resolve. */ + expression: UnaryPostfixExpression, + /** Current flow. */ + flow: Flow, + /** Current contextual type. */ + contextualType?: Type, + /** How to proceed with eventualy diagnostics. */ + reportMode?: ReportMode): Element | null; + /** Resolves a binary expression to the program element it refers to. */ + resolveBinaryExpression( + /** The expression to resolve. */ + expression: BinaryExpression, + /** Current flow. */ + flow: Flow, + /** Current contextual type. */ + contextualType?: Type, + /** How to proceed with eventualy diagnostics. */ + reportMode?: ReportMode): Element | null; + /** Resolves a this expression to the program element it refers to. */ + resolveThisExpression( + /** The expression to resolve. */ + expression: ThisExpression, + /** Current flow. */ + flow: Flow, + /** Current contextual type. */ + contextualType?: Type, + /** How to proceed with eventualy diagnostics. */ + reportMode?: ReportMode): Element | null; + /** Resolves a super expression to the program element it refers to. */ + resolveSuperExpression( + /** The expression to resolve. */ + expression: SuperExpression, + /** Current flow. */ + flow: Flow, + /** Current contextual type. */ + contextualType?: Type, + /** How to proceed with eventualy diagnostics. */ + reportMode?: ReportMode): Element | null; + /** Resolves a literal expression to the program element it refers to. */ + resolveLiteralExpression( + /** The expression to resolve. */ + expression: LiteralExpression, + /** Current flow. */ + flow: Flow, + /** Current contextual type. */ + contextualType?: Type, + /** How to proceed with eventualy diagnostics. */ + reportMode?: ReportMode): Element | null; + /** Resolves a call expression to the program element it refers to. */ + resolveCallExpression( + /** The expression to resolve. */ + expression: CallExpression, + /** Current flow. */ + flow: Flow, + /** Current contextual type. */ + contextualType?: Type, + /** How to proceed with eventualy diagnostics. */ + reportMode?: ReportMode): Element | null; + /** Resolves a function prototype using the specified concrete type arguments. */ + resolveFunction( + /** The prototype of the function. */ + prototype: FunctionPrototype, + /** Concrete type arguments. */ + typeArguments: Type[] | null, + /** Type arguments inherited through context, i.e. `T`. */ + contextualTypeArguments?: Map, + /** How to proceed with eventualy diagnostics. */ + reportMode?: ReportMode): Function | null; + /** Resolves a function prototypeby first resolving the specified type arguments. */ + resolveFunctionInclTypeArguments( + /** The prototype of the function. */ + prototype: FunctionPrototype, + /** Type arguments provided. */ + typeArgumentNodes: CommonTypeNode[] | null, + /** Relative context. Type arguments are resolved from here. */ + context: Element, + /** Type arguments inherited through context, i.e. `T`. */ + contextualTypeArguments: Map, + /** The node to use when reporting intermediate errors. */ + reportNode: Node, + /** How to proceed with eventualy diagnostics. */ + reportMode?: ReportMode): Function | null; + /** Resolves a class prototype using the specified concrete type arguments. */ + resolveClass( + /** The prototype of the class. */ + prototype: ClassPrototype, + /** Concrete type arguments. */ + typeArguments: Type[] | null, + /** Type arguments inherited through context, i.e. `T`. */ + contextualTypeArguments?: Map, + /** How to proceed with eventualy diagnostics. */ + reportMode?: ReportMode): Class | null; + /** Resolves a class prototype by first resolving the specified type arguments. */ + resolveClassInclTypeArguments( + /** The prototype of the class. */ + prototype: ClassPrototype, + /** Type argument nodes provided. */ + typeArgumentNodes: CommonTypeNode[] | null, + /** Relative context. Type arguments are resolved from here. */ + context: Element, + /** Type arguments inherited through context, i.e. `T`. */ + contextualTypeArguments: Map, + /** The node to use when reporting intermediate errors. */ + reportNode: Node, + /** How to proceed with eventualy diagnostics. */ + reportMode?: ReportMode): Class | null; + } + +} +declare module 'assemblyscript/src/program' { + /** + * AssemblyScript's intermediate representation describing a program's elements. + * @module program + */ /***/ + import { CommonFlags } from 'assemblyscript/src/common'; + import { Options } from 'assemblyscript/src/compiler'; + import { DiagnosticMessage, DiagnosticEmitter } from 'assemblyscript/src/diagnostics'; + import { Type, TypeKind, Signature } from 'assemblyscript/src/types'; + import { Source, Range, DecoratorNode, DecoratorKind, SignatureNode, TypeParameterNode, CommonTypeNode, TypeNode, ArrowKind, Expression, IdentifierExpression, Statement, ClassDeclaration, DeclarationStatement, EnumDeclaration, EnumValueDeclaration, FieldDeclaration, FunctionDeclaration, InterfaceDeclaration, NamespaceDeclaration, TypeDeclaration, VariableDeclaration, VariableLikeDeclarationStatement } from 'assemblyscript/src/ast'; + import { Module, FunctionRef } from 'assemblyscript/src/module'; + import { Resolver } from 'assemblyscript/src/resolver'; + import { Flow } from 'assemblyscript/src/flow'; + /** Represents the kind of an operator overload. */ + export enum OperatorKind { + INVALID = 0, + INDEXED_GET = 1, + INDEXED_SET = 2, + UNCHECKED_INDEXED_GET = 3, + UNCHECKED_INDEXED_SET = 4, + ADD = 5, + SUB = 6, + MUL = 7, + DIV = 8, + REM = 9, + POW = 10, + BITWISE_AND = 11, + BITWISE_OR = 12, + BITWISE_XOR = 13, + BITWISE_SHL = 14, + BITWISE_SHR = 15, + BITWISE_SHR_U = 16, + EQ = 17, + NE = 18, + GT = 19, + GE = 20, + LT = 21, + LE = 22, + PLUS = 23, + MINUS = 24, + NOT = 25, + BITWISE_NOT = 26, + PREFIX_INC = 27, + PREFIX_DEC = 28, + POSTFIX_INC = 29, + POSTFIX_DEC = 30 + } + /** Represents an AssemblyScript program. */ + export class Program extends DiagnosticEmitter { + /** Resolver instance. */ + resolver: Resolver; + /** Array of sources. */ + sources: Source[]; + /** Diagnostic offset used where successively obtaining the next diagnostic. */ + diagnosticsOffset: i32; + /** Compiler options. */ + options: Options; + /** Special native code source. */ + nativeSource: Source; + /** Special native code file. */ + nativeFile: File; + /** Files by unique internal name. */ + filesByName: Map; + /** Elements by unique internal name in element space. */ + elementsByName: Map; + /** Elements by declaration. */ + elementsByDeclaration: Map; + /** Element instances by unique internal name. */ + instancesByName: Map; + /** Classes backing basic types like `i32`. */ + typeClasses: Map; + /** Managed classes contained in the program, by id. */ + managedClasses: Map; + /** ArrayBufferView reference. */ + arrayBufferViewInstance: Class; + /** ArrayBuffer instance reference. */ + arrayBufferInstance: Class; + /** Array prototype reference. */ + arrayPrototype: ClassPrototype; + /** Set prototype reference. */ + setPrototype: ClassPrototype; + /** Map prototype reference. */ + mapPrototype: ClassPrototype; + /** Fixed array prototype reference. */ + fixedArrayPrototype: ClassPrototype; + /** Int8Array prototype. */ + i8ArrayPrototype: ClassPrototype; + /** Int16Array prototype. */ + i16ArrayPrototype: ClassPrototype; + /** Int32Array prototype. */ + i32ArrayPrototype: ClassPrototype; + /** Int64Array prototype. */ + i64ArrayPrototype: ClassPrototype; + /** Uint8Array prototype. */ + u8ArrayPrototype: ClassPrototype; + /** Uint8ClampedArray prototype. */ + u8ClampedArrayPrototype: ClassPrototype; + /** Uint16Array prototype. */ + u16ArrayPrototype: ClassPrototype; + /** Uint32Array prototype. */ + u32ArrayPrototype: ClassPrototype; + /** Uint64Array prototype. */ + u64ArrayPrototype: ClassPrototype; + /** Float32Array prototype. */ + f32ArrayPrototype: ClassPrototype; + /** Float64Array prototype. */ + f64ArrayPrototype: ClassPrototype; + /** String instance reference. */ + stringInstance: Class; + /** Abort function reference, if present. */ + abortInstance: Function; + /** RT `__alloc(size: usize, id: u32): usize` */ + allocInstance: Function; + /** RT `__realloc(ref: usize, newSize: usize): usize` */ + reallocInstance: Function; + /** RT `__free(ref: usize): void` */ + freeInstance: Function; + /** RT `__retain(ref: usize): usize` */ + retainInstance: Function; + /** RT `__release(ref: usize): void` */ + releaseInstance: Function; + /** RT `__collect(): void` */ + collectInstance: Function; + /** RT `__visit(ref: usize, cookie: u32): void` */ + visitInstance: Function; + /** RT `__typeinfo(id: u32): RTTIFlags` */ + typeinfoInstance: Function; + /** RT `__instanceof(ref: usize, superId: u32): bool` */ + instanceofInstance: Function; + /** RT `__allocArray(length: i32, alignLog2: usize, id: u32, data: usize = 0): usize` */ + allocArrayInstance: Function; + /** Next class id. */ + nextClassId: u32; + /** Constructs a new program, optionally inheriting parser diagnostics. */ + constructor( + /** Shared array of diagnostic messages (emitted so far). */ + diagnostics?: DiagnosticMessage[] | null); + /** Writes a common runtime header to the specified buffer. */ + writeRuntimeHeader(buffer: Uint8Array, offset: i32, classInstance: Class, payloadSize: u32): void; + /** Gets the size of a runtime header. */ + readonly runtimeHeaderSize: i32; + /** Creates a native variable declaration. */ + makeNativeVariableDeclaration( + /** The simple name of the variable */ + name: string, + /** Flags indicating specific traits, e.g. `CONST`. */ + flags?: CommonFlags): VariableDeclaration; + /** Creates a native type declaration. */ + makeNativeTypeDeclaration( + /** The simple name of the type. */ + name: string, + /** Flags indicating specific traits, e.g. `GENERIC`. */ + flags?: CommonFlags): TypeDeclaration; + private nativeDummySignature; + /** Creates a native function declaration. */ + makeNativeFunctionDeclaration( + /** The simple name of the function. */ + name: string, + /** Flags indicating specific traits, e.g. `DECLARE`. */ + flags?: CommonFlags): FunctionDeclaration; + /** Creates a native namespace declaration. */ + makeNativeNamespaceDeclaration( + /** The simple name of the namespace. */ + name: string, + /** Flags indicating specific traits, e.g. `EXPORT`. */ + flags?: CommonFlags): NamespaceDeclaration; + /** Creates a native function. */ + makeNativeFunction( + /** The simple name of the function. */ + name: string, + /** Concrete function signature. */ + signature: Signature, + /** Parent element, usually a file, class or namespace. */ + parent?: Element, + /** Flags indicating specific traits, e.g. `GENERIC`. */ + flags?: CommonFlags, + /** Decorator flags representing built-in decorators. */ + decoratorFlags?: DecoratorFlags): Function; + /** Gets the (possibly merged) program element linked to the specified declaration. */ + getElementByDeclaration(declaration: DeclarationStatement): DeclaredElement; + /** Initializes the program and its elements prior to compilation. */ + initialize(options: Options): void; + /** Requires that a global library element of the specified kind is present and returns it. */ + private require; + /** Requires that a non-generic global class is present and returns it. */ + private requireClass; + /** Requires that a non-generic global function is present and returns it. */ + private requireFunction; + /** Marks an element and its children as a module export. */ + private markModuleExport; + /** Registers a native type with the program. */ + private registerNativeType; + /** Registers the backing class of a native type. */ + private registerNativeTypeClass; + /** Registers a constant integer value within the global scope. */ + private registerConstantInteger; + /** Registers a constant float value within the global scope. */ + private registerConstantFloat; + /** Ensures that the given global element exists. Attempts to merge duplicates. */ + ensureGlobal(name: string, element: DeclaredElement): DeclaredElement; + /** Looks up the element of the specified name in the global scope. */ + lookupGlobal(name: string): Element | null; + /** Looks up the element of the specified name in the global scope. Errors if not present. */ + requireGlobal(name: string): Element; + /** Tries to locate a foreign file given its normalized path. */ + private lookupForeignFile; + /** Tries to locate a foreign element by traversing exports and queued exports. */ + private lookupForeign; + /** Validates that only supported decorators are present. */ + private checkDecorators; + /** Initializes a class declaration. */ + private initializeClass; + /** Initializes a field of a class or interface. */ + private initializeField; + /** Initializes a method of a class or interface. */ + private initializeMethod; + /** Checks that operator overloads are generally valid, if present. */ + private checkOperatorOverloads; + /** Ensures that the property introduced by the specified getter or setter exists.*/ + private ensureProperty; + /** Initializes a property of a class. */ + private initializeProperty; + /** Initializes an enum. */ + private initializeEnum; + /** Initializes an enum value. */ + private initializeEnumValue; + /** Initializes an `export` statement. */ + private initializeExports; + /** Initializes a single `export` member. Does not handle `export *`. */ + private initializeExport; + private initializeExportDefault; + /** Initializes an `import` statement. */ + private initializeImports; + /** Initializes a single `import` declaration. Does not handle `import *`. */ + private initializeImport; + /** Initializes a function. Does not handle methods. */ + private initializeFunction; + /** Initializes an interface. */ + private initializeInterface; + /** Initializes a namespace. */ + private initializeNamespace; + /** Initializes a `type` definition. */ + private initializeTypeDefinition; + /** Initializes a variable statement. */ + private initializeVariables; + } + /** Indicates the specific kind of an {@link Element}. */ + export enum ElementKind { + /** A {@link Global}. */ + GLOBAL = 0, + /** A {@link Local}. */ + LOCAL = 1, + /** An {@link Enum}. */ + ENUM = 2, + /** An {@link EnumValue}. */ + ENUMVALUE = 3, + /** A {@link FunctionPrototype}. */ + FUNCTION_PROTOTYPE = 4, + /** A {@link Function}. */ + FUNCTION = 5, + /** A {@link FunctionTarget}. */ + FUNCTION_TARGET = 6, + /** A {@link ClassPrototype}. */ + CLASS_PROTOTYPE = 7, + /** A {@link Class}. */ + CLASS = 8, + /** An {@link InterfacePrototype}. */ + INTERFACE_PROTOTYPE = 9, + /** An {@link Interface}. */ + INTERFACE = 10, + /** A {@link FieldPrototype}. */ + FIELD_PROTOTYPE = 11, + /** A {@link Field}. */ + FIELD = 12, + /** A {@link PropertyPrototype}. */ + PROPERTY_PROTOTYPE = 13, + /** A {@link Property}. */ + PROPERTY = 14, + /** A {@link Namespace}. */ + NAMESPACE = 15, + /** A {@link File}. */ + FILE = 16, + /** A {@link TypeDefinition}. */ + TYPEDEFINITION = 17 + } + /** Indicates built-in decorators that are present. */ + export enum DecoratorFlags { + /** No flags set. */ + NONE = 0, + /** Is a program global. */ + GLOBAL = 1, + /** Is a binary operator overload. */ + OPERATOR_BINARY = 2, + /** Is a unary prefix operator overload. */ + OPERATOR_PREFIX = 4, + /** Is a unary postfix operator overload. */ + OPERATOR_POSTFIX = 8, + /** Is an unmanaged class. */ + UNMANAGED = 16, + /** Is a sealed class. */ + SEALED = 32, + /** Is always inlined. */ + INLINE = 64, + /** Is using a different external name. */ + EXTERNAL = 128, + /** Is a builtin. */ + BUILTIN = 256, + /** Is compiled lazily. */ + LAZY = 512, + /** Is considered unsafe code. */ + UNSAFE = 1024 + } + /** Translates a decorator kind to the respective decorator flag. */ + export function decoratorKindToFlag(kind: DecoratorKind): DecoratorFlags; + /** Base class of all program elements. */ + export abstract class Element { + /** Specific element kind. */ + kind: ElementKind; + /** Simple name. */ + name: string; + /** Internal name referring to this element. */ + internalName: string; + /** Containing {@link Program}. */ + program: Program; + /** Parent element. */ + parent: Element; + /** Common flags indicating specific traits. */ + flags: CommonFlags; + /** Decorator flags indicating annotated traits. */ + decoratorFlags: DecoratorFlags; + /** Member elements. */ + members: Map | null; + /** Shadowing type in type space, if any. */ + shadowType: TypeDefinition | null; + /** Constructs a new program element. */ + protected constructor( + /** Specific element kind. */ + kind: ElementKind, + /** Simple name. */ + name: string, + /** Internal name referring to this element. */ + internalName: string, + /** Containing {@link Program}. */ + program: Program, + /** Parent element. */ + parent: Element | null); + /** Gets the enclosing file. */ + readonly file: File; + /** Tests if this element has a specific flag or flags. */ + is(flag: CommonFlags): bool; + /** Tests if this element has any of the specified flags. */ + isAny(flags: CommonFlags): bool; + /** Sets a specific flag or flags. */ + set(flag: CommonFlags): void; + /** Unsets the specific flag or flags. */ + unset(flag: CommonFlags): void; + /** Tests if this element has a specific decorator flag or flags. */ + hasDecorator(flag: DecoratorFlags): bool; + /** Looks up the element with the specified name within this element. */ + lookupInSelf(name: string): DeclaredElement | null; + /** Looks up the element with the specified name relative to this element, like in JS. */ + abstract lookup(name: string): Element | null; + /** Adds an element as a member of this one. Reports and returns `false` if a duplicate. */ + add(name: string, element: DeclaredElement): bool; + /** Returns a string representation of this element. */ + toString(): string; + } + /** Base class of elements with an associated declaration statement. */ + export abstract class DeclaredElement extends Element { + /** Declaration reference. */ + declaration: DeclarationStatement; + /** Constructs a new declared program element. */ + protected constructor( + /** Specific element kind. */ + kind: ElementKind, + /** Simple name. */ + name: string, + /** Internal name referring to this element. */ + internalName: string, + /** Containing {@link Program}. */ + program: Program, + /** Parent element. */ + parent: Element | null, + /** Declaration reference. */ + declaration: DeclarationStatement); + /** Tests if this element is a library element. */ + readonly isDeclaredInLibrary: bool; + /** Gets the associated identifier node. */ + readonly identifierNode: IdentifierExpression; + /** Gets the assiciated decorator nodes. */ + readonly decoratorNodes: DecoratorNode[] | null; + } + /** Base class of elements that can be resolved to a concrete type. */ + export abstract class TypedElement extends DeclaredElement { + /** Resolved type. Set once `is(RESOLVED)`, otherwise void. */ + type: Type; + /** Sets the resolved type of this element. */ + setType(type: Type): void; + } + /** A file representing the implicit top-level namespace of a source. */ + export class File extends Element { + /** Source of this file. */ + source: Source; + /** File exports. */ + exports: Map | null; + /** File re-exports. */ + exportsStar: File[] | null; + /** Top-level start function of this file. */ + startFunction: Function; + /** Constructs a new file. */ + constructor( + /** Program this file belongs to. */ + program: Program, + /** Source of this file. */ + source: Source); + add(name: string, element: DeclaredElement, isImport?: bool): bool; + lookupInSelf(name: string): DeclaredElement | null; + lookup(name: string): Element | null; + /** Ensures that an element is an export of this file. */ + ensureExport(name: string, element: DeclaredElement): void; + /** Ensures that another file is a re-export of this file. */ + ensureExportStar(file: File): void; + /** Looks up the export of the specified name. */ + lookupExport(name: string): DeclaredElement | null; + /** Creates an imported namespace from this file. */ + asImportedNamespace(name: string, parent: Element): Namespace; + } + /** A type definition. */ + export class TypeDefinition extends TypedElement { + /** Constructs a new type definition. */ + constructor( + /** Simple name. */ + name: string, + /** Parent element, usually a file or namespace. */ + parent: Element, + /** Declaration reference. */ + declaration: TypeDeclaration, + /** Pre-checked flags indicating built-in decorators. */ + decoratorFlags?: DecoratorFlags); + /** Gets the associated type parameter nodes. */ + readonly typeParameterNodes: TypeParameterNode[] | null; + /** Gets the associated type node. */ + readonly typeNode: CommonTypeNode; + lookup(name: string): Element | null; + } + /** A namespace that differs from a file in being user-declared with a name. */ + export class Namespace extends DeclaredElement { + /** Constructs a new namespace. */ + constructor( + /** Simple name. */ + name: string, + /** Parent element, usually a file or another namespace. */ + parent: Element, + /** Declaration reference. */ + declaration: NamespaceDeclaration, + /** Pre-checked flags indicating built-in decorators. */ + decoratorFlags?: DecoratorFlags); + lookup(name: string): Element | null; + } + /** An enum. */ + export class Enum extends TypedElement { + /** Constructs a new enum. */ + constructor( + /** Simple name. */ + name: string, + /** Parent element, usually a file or namespace. */ + parent: Element, + /** Declaration reference. */ + declaration: EnumDeclaration, + /** Pre-checked flags indicating built-in decorators. */ + decoratorFlags?: DecoratorFlags); + lookup(name: string): Element | null; + } + /** Indicates the kind of an inlined constant value. */ + export const enum ConstantValueKind { + /** No constant value. */ + NONE = 0, + /** Constant integer value. */ + INTEGER = 1, + /** Constant float value. */ + FLOAT = 2 + } + /** Base class of all variable-like program elements. */ + export abstract class VariableLikeElement extends TypedElement { + /** Constant value kind. */ + constantValueKind: ConstantValueKind; + /** Constant integer value, if applicable. */ + constantIntegerValue: I64; + /** Constant float value, if applicable. */ + constantFloatValue: f64; + /** Constructs a new variable-like element. */ + protected constructor( + /** Specific element kind. */ + kind: ElementKind, + /** Simple name. */ + name: string, + /** Parent element, usually a file, namespace or class. */ + parent: Element, + /** Declaration reference. Creates a native declaration if omitted. */ + declaration?: VariableLikeDeclarationStatement); + /** Gets the associated type node.s */ + readonly typeNode: CommonTypeNode | null; + /** Gets the associated initializer node. */ + readonly initializerNode: Expression | null; + /** Applies a constant integer value to this element. */ + setConstantIntegerValue(value: I64, type: Type): void; + /** Applies a constant float value to this element. */ + setConstantFloatValue(value: f64, type: Type): void; + /** @override */ + lookup(name: string): Element | null; + } + /** An enum value. */ + export class EnumValue extends VariableLikeElement { + /** Constructs a new enum value. */ + constructor( + /** Simple name. */ + name: string, + /** Parent enum. */ + parent: Enum, + /** Declaration reference. */ + declaration: EnumValueDeclaration, + /** Pre-checked flags indicating built-in decorators. */ + decoratorFlags?: DecoratorFlags); + /** Whether this enum value is immutable. */ + isImmutable: bool; + /** Gets the associated value node. */ + readonly valueNode: Expression | null; + lookup(name: string): Element | null; + } + /** A global variable. */ + export class Global extends VariableLikeElement { + /** Constructs a new global variable. */ + constructor( + /** Simple name. */ + name: string, + /** Parent element, usually a file, namespace or static class. */ + parent: Element, + /** Pre-checked flags indicating built-in decorators. */ + decoratorFlags: DecoratorFlags, + /** Declaration reference. Creates a native declaration if omitted. */ + declaration?: VariableLikeDeclarationStatement); + } + /** A function parameter. */ + export class Parameter { + /** Parameter name. */ + name: string; + /** Parameter type. */ + type: Type; + /** Parameter initializer, if present. */ + initializer: Expression | null; + /** Constructs a new function parameter. */ + constructor( + /** Parameter name. */ + name: string, + /** Parameter type. */ + type: Type, + /** Parameter initializer, if present. */ + initializer?: Expression | null); + } + /** A local variable. */ + export class Local extends VariableLikeElement { + /** Zero-based index within the enclosing function. `-1` indicates a virtual local. */ + index: i32; + /** Constructs a new local variable. */ + constructor( + /** Simple name. */ + name: string, + /** Zero-based index within the enclosing function. `-1` indicates a virtual local. */ + index: i32, + /** Resolved type. */ + type: Type, + /** Parent function. */ + parent: Function, + /** Declaration reference. */ + declaration?: VariableLikeDeclarationStatement); + } + /** A yet unresolved function prototype. */ + export class FunctionPrototype extends DeclaredElement { + /** Operator kind, if an overload. */ + operatorKind: OperatorKind; + /** Already resolved instances. */ + instances: Map | null; + /** Clones of this prototype that are bounds to specific classes. */ + private boundPrototypes; + /** Constructs a new function prototype. */ + constructor( + /** Simple name */ + name: string, + /** Parent element, usually a file, namespace or class (if a method). */ + parent: Element, + /** Declaration reference. */ + declaration: FunctionDeclaration, + /** Pre-checked flags indicating built-in decorators. */ + decoratorFlags?: DecoratorFlags); + /** Gets the associated type parameter nodes. */ + readonly typeParameterNodes: TypeParameterNode[] | null; + /** Gets the associated signature node. */ + readonly signatureNode: SignatureNode; + /** Gets the associated body node. */ + readonly bodyNode: Statement | null; + /** Gets the arrow function kind. */ + readonly arrowKind: ArrowKind; + /** Tests if this prototype is bound to a class. */ + readonly isBound: bool; + /** Creates a clone of this prototype that is bound to a concrete class instead. */ + toBound(classInstance: Class): FunctionPrototype; + /** Gets the resolved instance for the specified instance key, if already resolved. */ + getResolvedInstance(instanceKey: string): Function | null; + /** Sets the resolved instance for the specified instance key. */ + setResolvedInstance(instanceKey: string, instance: Function): void; + lookup(name: string): Element | null; + } + /** A resolved function. */ + export class Function extends TypedElement { + /** Function prototype. */ + prototype: FunctionPrototype; + /** Function signature. */ + signature: Signature; + /** Map of locals by name. */ + localsByName: Map; + /** Array of locals by index. */ + localsByIndex: Local[]; + /** List of additional non-parameter locals. */ + additionalLocals: Type[]; + /** Contextual type arguments. */ + contextualTypeArguments: Map | null; + /** Default control flow. */ + flow: Flow; + /** Remembered debug locations. */ + debugLocations: Range[]; + /** Function reference, if compiled. */ + ref: FunctionRef; + /** Function table index, if any. */ + functionTableIndex: i32; + /** Trampoline function for calling with omitted arguments. */ + trampoline: Function | null; + /** Counting id of inline operations involving this function. */ + nextInlineId: i32; + /** Counting id of anonymous inner functions. */ + nextAnonymousId: i32; + /** Counting id of autorelease variables. */ + nextAutoreleaseId: i32; + /** Constructs a new concrete function. */ + constructor( + /** Name incl. type parameters, i.e. `foo`. */ + nameInclTypeParameters: string, + /** Respective function prototype. */ + prototype: FunctionPrototype, + /** Concrete signature. */ + signature: Signature, // pre-resolved + /** Contextual type arguments inherited from its parent class, if any. */ + contextualTypeArguments?: Map | null); + /** Adds a local of the specified type, with an optional name. */ + addLocal(type: Type, name?: string | null, declaration?: VariableDeclaration | null): Local; + lookup(name: string): Element | null; + tempI32s: Local[] | null; + tempI64s: Local[] | null; + tempF32s: Local[] | null; + tempF64s: Local[] | null; + tempV128s: Local[] | null; + nextBreakId: i32; + breakStack: i32[] | null; + breakLabel: string | null; + /** Finalizes the function once compiled, releasing no longer needed resources. */ + finalize(module: Module, ref: FunctionRef): void; + } + /** A resolved function target, that is a function called indirectly by an index and signature. */ + export class FunctionTarget extends Element { + /** Underlying signature. */ + signature: Signature; + /** Function type. */ + type: Type; + /** Constructs a new function target. */ + constructor( + /** Concrete signature. */ + signature: Signature, + /** Program reference. */ + program: Program, __s?: string); + lookup(name: string): Element | null; + } + /** A yet unresolved instance field prototype. */ + export class FieldPrototype extends DeclaredElement { + /** Constructs a new field prototype. */ + constructor( + /** Simple name. */ + name: string, + /** Parent class. */ + parent: ClassPrototype, + /** Declaration reference. */ + declaration: FieldDeclaration, + /** Pre-checked flags indicating built-in decorators. */ + decoratorFlags?: DecoratorFlags); + /** Gets the associated type node. */ + readonly typeNode: CommonTypeNode | null; + /** Gets the associated initializer node. */ + readonly initializerNode: Expression | null; + /** Gets the associated parameter index. Set if declared as a constructor parameter, otherwise `-1`. */ + readonly parameterIndex: i32; + lookup(name: string): Element | null; + } + /** A resolved instance field. */ + export class Field extends VariableLikeElement { + /** Field prototype reference. */ + prototype: FieldPrototype; + /** Field memory offset, if an instance field. */ + memoryOffset: i32; + /** Constructs a new field. */ + constructor( + /** Respective field prototype. */ + prototype: FieldPrototype, + /** Parent class. */ + parent: Class, + /** Concrete type. */ + type: Type); + } + /** A property comprised of a getter and a setter function. */ + export class PropertyPrototype extends DeclaredElement { + /** Getter prototype. */ + getterPrototype: FunctionPrototype | null; + /** Setter prototype. */ + setterPrototype: FunctionPrototype | null; + /** Constructs a new property prototype. */ + constructor( + /** Simple name. */ + name: string, + /** Parent class. */ + parent: ClassPrototype, + /** Declaration of the getter or setter introducing the property. */ + firstDeclaration: FunctionDeclaration); + lookup(name: string): Element | null; + } + /** A resolved property. */ + export class Property extends VariableLikeElement { + /** Prototype reference. */ + prototype: PropertyPrototype; + /** Getter instance. */ + getterInstance: Function | null; + /** Setter instance. */ + setterInstance: Function | null; + /** Constructs a new property prototype. */ + constructor( + /** Respective property prototype. */ + prototype: PropertyPrototype, + /** Parent element, usually a static class prototype or class instance. */ + parent: Element); + lookup(name: string): Element | null; + } + /** A yet unresolved class prototype. */ + export class ClassPrototype extends DeclaredElement { + /** Instance member prototypes. */ + instanceMembers: Map | null; + /** Base class prototype, if applicable. */ + basePrototype: ClassPrototype | null; + /** Constructor prototype. */ + constructorPrototype: FunctionPrototype | null; + /** Operator overload prototypes. */ + overloadPrototypes: Map; + /** Already resolved instances. */ + instances: Map | null; + constructor( + /** Simple name. */ + name: string, + /** Parent element, usually a file or namespace. */ + parent: Element, + /** Declaration reference. */ + declaration: ClassDeclaration, + /** Pre-checked flags indicating built-in decorators. */ + decoratorFlags?: DecoratorFlags, _isInterface?: bool); + /** Gets the associated type parameter nodes. */ + readonly typeParameterNodes: TypeParameterNode[] | null; + /** Gets the associated extends node. */ + readonly extendsNode: TypeNode | null; + /** Gets the associated implements nodes. */ + readonly implementsNodes: TypeNode[] | null; + /** Tests if this prototype is of a builtin array type (Array/TypedArray). */ + readonly isBuiltinArray: bool; + /** Tests if this prototype extends the specified. */ + extends(basePtototype: ClassPrototype | null): bool; + /** Adds an element as an instance member of this one. Returns the previous element if a duplicate. */ + addInstance(name: string, element: DeclaredElement): bool; + /** Gets the resolved instance for the specified instance key, if already resolved. */ + getResolvedInstance(instanceKey: string): Class | null; + /** Sets the resolved instance for the specified instance key. */ + setResolvedInstance(instanceKey: string, instance: Class): void; + lookup(name: string): Element | null; + } + /** A resolved class. */ + export class Class extends TypedElement { + /** Class prototype. */ + prototype: ClassPrototype; + /** Resolved type arguments. */ + typeArguments: Type[] | null; + /** Base class, if applicable. */ + base: Class | null; + /** Contextual type arguments for fields and methods. */ + contextualTypeArguments: Map | null; + /** Current member memory offset. */ + currentMemoryOffset: u32; + /** Constructor instance. */ + constructorInstance: Function | null; + /** Operator overloads. */ + overloads: Map | null; + /** Unique class id. */ + private _id; + /** Remembers acyclic state. */ + private _acyclic; + /** Runtime type information flags. */ + rttiFlags: u32; + /** Gets the unique runtime id of this class. */ + readonly id: u32; + /** Tests if this class is of a builtin array type (Array/TypedArray). */ + readonly isBuiltinArray: bool; + /** Tests if this class is array-like. */ + readonly isArrayLike: bool; + /** Constructs a new class. */ + constructor( + /** Name incl. type parameters, i.e. `Foo`. */ + nameInclTypeParameters: string, + /** The respective class prototype. */ + prototype: ClassPrototype, + /** Concrete type arguments, if any. */ + typeArguments?: Type[] | null, + /** Base class, if derived. */ + base?: Class | null, _isInterface?: bool); + /** Tests if a value of this class type is assignable to a target of the specified class type. */ + isAssignableTo(target: Class): bool; + /** Looks up the operator overload of the specified kind. */ + lookupOverload(kind: OperatorKind, unchecked?: bool): Function | null; + lookup(name: string): Element | null; + /** Calculates the memory offset of the specified field. */ + offsetof(fieldName: string): u32; + /** Writes a field value to a buffer and returns the number of bytes written. */ + writeField(name: string, value: T, buffer: Uint8Array, baseOffset: i32): i32; + /** Tests if this class extends the specified prototype. */ + extends(prototype: ClassPrototype): bool; + /** Gets the concrete type arguments to the specified extendend prototype. */ + getTypeArgumentsTo(extendedPrototype: ClassPrototype): Type[] | null; + /** Gets the value type of an array. Must be an array. */ + getArrayValueType(): Type; + /** Tests if this class is inherently acyclic. */ + readonly isAcyclic: bool; + /** Tests if this class potentially forms a reference cycle to another one. */ + private cyclesTo; + } + /** A yet unresolved interface. */ + export class InterfacePrototype extends ClassPrototype { + /** Constructs a new interface prototype. */ + constructor(name: string, parent: Element, declaration: InterfaceDeclaration, decoratorFlags: DecoratorFlags); + } + /** A resolved interface. */ + export class Interface extends Class { + /** Constructs a new interface. */ + constructor(nameInclTypeParameters: string, prototype: InterfacePrototype, typeArguments?: Type[], base?: Interface | null); + } + /** Mangles the internal name of an element with the specified name that is a child of the given parent. */ + export function mangleInternalName(name: string, parent: Element, isInstance: bool, asGlobal?: bool): string; + +} +declare module 'assemblyscript/src/compiler' { + /** + * The AssemblyScript compiler. + * @module compiler + */ /***/ + import { DiagnosticEmitter } from 'assemblyscript/src/diagnostics'; + import { Module, MemorySegment, ExpressionRef, NativeType, FunctionRef, FunctionTypeRef, GlobalRef } from 'assemblyscript/src/module'; + import { Feature, Target } from 'assemblyscript/src/common'; + import { Program, ClassPrototype, Class, Element, Enum, Field, FunctionPrototype, Function, Global, VariableLikeElement, File } from 'assemblyscript/src/program'; + import { Flow } from 'assemblyscript/src/flow'; + import { Resolver } from 'assemblyscript/src/resolver'; + import { Node, TypeNode, Range, Statement, BlockStatement, BreakStatement, ContinueStatement, DoStatement, EmptyStatement, ExpressionStatement, ForStatement, IfStatement, InstanceOfExpression, InterfaceDeclaration, ReturnStatement, SwitchStatement, ThrowStatement, TryStatement, VariableStatement, VoidStatement, WhileStatement, Expression, AssertionExpression, BinaryExpression, CallExpression, CommaExpression, ElementAccessExpression, FunctionExpression, IdentifierExpression, LiteralExpression, NewExpression, ObjectLiteralExpression, PropertyAccessExpression, TernaryExpression, StringLiteralExpression, UnaryPostfixExpression, UnaryPrefixExpression } from 'assemblyscript/src/ast'; + import { Type, Signature } from 'assemblyscript/src/types'; + /** Compiler options. */ + export class Options { + /** WebAssembly target. Defaults to {@link Target.WASM32}. */ + target: Target; + /** If true, replaces assertions with nops. */ + noAssert: bool; + /** If true, imports the memory provided by the embedder. */ + importMemory: bool; + /** If greater than zero, declare memory as shared by setting max memory to sharedMemory. */ + sharedMemory: i32; + /** If true, imports the function table provided by the embedder. */ + importTable: bool; + /** If true, generates information necessary for source maps. */ + sourceMap: bool; + /** If true, generates an explicit start function. */ + explicitStart: bool; + /** Static memory start offset. */ + memoryBase: i32; + /** Global aliases. */ + globalAliases: Map | null; + /** Additional features to activate. */ + features: Feature; + /** Hinted optimize level. Not applied by the compiler itself. */ + optimizeLevelHint: i32; + /** Hinted shrink level. Not applied by the compiler itself. */ + shrinkLevelHint: i32; + /** Tests if the target is WASM64 or, otherwise, WASM32. */ + readonly isWasm64: bool; + /** Gets the unsigned size type matching the target. */ + readonly usizeType: Type; + /** Gets the signed size type matching the target. */ + readonly isizeType: Type; + /** Gets the native size type matching the target. */ + readonly nativeSizeType: NativeType; + /** Tests if a specific feature is activated. */ + hasFeature(feature: Feature): bool; + } + /** Requests or indicates compilation conditions of statements and expressions. */ + export const enum ContextualFlags { + NONE = 0, + /** Implicit conversion required. */ + IMPLICIT = 1, + /** Explicit conversion required. */ + EXPLICIT = 2, + /** Small integer wrap required. */ + WRAP = 4, + /** Value is known to be immediately dropped. */ + WILL_DROP = 8, + /** Value is known to be immediately assigned to a retaining target. */ + SKIP_AUTORELEASE = 16, + /** Is the last statement in a function body. */ + LAST_IN_BODY = 32, + /** Data can be compiled statically. */ + STATIC_CAPABLE = 64 + } + /** Runtime features to be activated by the compiler. */ + export const enum RuntimeFeatures { + NONE = 0, + /** Requires heap setup. */ + HEAP = 1, + /** Requires runtime type information setup. */ + RTTI = 2, + /** Requires the built-in globals visitor. */ + visitGlobals = 4, + /** Requires the built-in members visitor. */ + visitMembers = 8 + } + /** Compiler interface. */ + export class Compiler extends DiagnosticEmitter { + /** Program reference. */ + program: Program; + /** Resolver reference. */ + resolver: Resolver; + /** Provided options. */ + options: Options; + /** Module instance being compiled. */ + module: Module; + /** Current control flow. */ + currentFlow: Flow; + /** Current inline functions stack. */ + currentInlineFunctions: Function[]; + /** Current enum in compilation. */ + currentEnum: Enum | null; + /** Current type in compilation. */ + currentType: Type; + /** Start function statements. */ + currentBody: ExpressionRef[]; + /** Counting memory offset. */ + memoryOffset: I64; + /** Memory segments being compiled. */ + memorySegments: MemorySegment[]; + /** Map of already compiled static string segments. */ + stringSegments: Map; + /** Function table being compiled. */ + functionTable: string[]; + /** Argument count helper global. */ + argcVar: GlobalRef; + /** Argument count helper setter. */ + argcSet: FunctionRef; + /** Requires runtime features. */ + runtimeFeatures: RuntimeFeatures; + /** Expressions known to have skipped an autorelease. Usually function returns. */ + skippedAutoreleases: Set; + /** Compiles a {@link Program} to a {@link Module} using the specified options. */ + static compile(program: Program, options?: Options | null): Module; + /** Constructs a new compiler for a {@link Program} using the specified options. */ + constructor(program: Program, options?: Options | null); + /** Performs compilation of the underlying {@link Program} to a {@link Module}. */ + compile(): Module; + /** Applies the respective module exports for the specified file. */ + private ensureModuleExports; + /** Applies the respective module export(s) for the specified element. */ + private ensureModuleExport; + /** Makes a function to get the value of a field of an exported class. */ + private ensureModuleFieldGetter; + /** Makes a function to set the value of a field of an exported class. */ + private ensureModuleFieldSetter; + /** Compiles any element. */ + compileElement(element: Element, compileMembers?: bool): void; + /** Compiles an element's members. */ + compileMembers(element: Element): void; + /** Compiles a file's exports. */ + compileExports(file: File): void; + /** Compiles the file matching the specified path. */ + compileFileByPath(normalizedPathWithoutExtension: string, reportNode: Node): void; + /** Compiles the specified file. */ + compileFile(file: File): void; + compileGlobal(global: Global): bool; + compileEnum(element: Enum): bool; + /** Resolves the specified type arguments prior to compiling the resulting function instance. */ + compileFunctionUsingTypeArguments(prototype: FunctionPrototype, typeArguments: TypeNode[], contextualTypeArguments?: Map, alternativeReportNode?: Node | null): Function | null; + /** Either reuses or creates the function type matching the specified signature. */ + ensureFunctionType(parameterTypes: Type[] | null, returnType: Type, thisType?: Type | null): FunctionTypeRef; + /** Compiles the body of a function within the specified flow. */ + compileFunctionBody( + /** Function to compile. */ + instance: Function, + /** Target array of statements. */ + stmts?: ExpressionRef[] | null): ExpressionRef[]; + /** Compiles a readily resolved function instance. */ + compileFunction(instance: Function): bool; + compileClassUsingTypeArguments(prototype: ClassPrototype, typeArguments: TypeNode[], contextualTypeArguments?: Map, alternativeReportNode?: Node | null): void; + compileClass(instance: Class): bool; + compileInterfaceDeclaration(declaration: InterfaceDeclaration, typeArguments: TypeNode[], contextualTypeArguments?: Map | null, alternativeReportNode?: Node | null): void; + /** Adds a static memory segment with the specified data. */ + addMemorySegment(buffer: Uint8Array, alignment?: i32): MemorySegment; + /** Ensures that the specified string exists in static memory and returns a pointer to it. */ + ensureStaticString(stringValue: string): ExpressionRef; + ensureStaticArrayBuffer(elementType: Type, values: ExpressionRef[]): MemorySegment; + ensureStaticArrayHeader(elementType: Type, bufferSegment: MemorySegment): MemorySegment; + /** Ensures that a table entry exists for the specified function and returns its index. */ + ensureFunctionTableEntry(func: Function): i32; + compileTopLevelStatement(statement: Statement, body: ExpressionRef[]): void; + compileStatement(statement: Statement, contextualFlags?: ContextualFlags): ExpressionRef; + compileStatements(statements: Statement[], isBody?: bool, stmts?: ExpressionRef[] | null): ExpressionRef[]; + compileBlockStatement(statement: BlockStatement, contextualFlags: ContextualFlags): ExpressionRef; + compileBreakStatement(statement: BreakStatement, contextualFlags: ContextualFlags): ExpressionRef; + compileContinueStatement(statement: ContinueStatement, contextualFlags: ContextualFlags): ExpressionRef; + compileDoStatement(statement: DoStatement, contextualFlags: ContextualFlags): ExpressionRef; + compileEmptyStatement(statement: EmptyStatement, contextualFlags: ContextualFlags): ExpressionRef; + compileExpressionStatement(statement: ExpressionStatement, contextualFlags: ContextualFlags): ExpressionRef; + compileForStatement(statement: ForStatement, contextualFlags: ContextualFlags): ExpressionRef; + compileIfStatement(statement: IfStatement, contextualFlags: ContextualFlags): ExpressionRef; + compileReturnStatement(statement: ReturnStatement, contextualFlags: ContextualFlags): ExpressionRef; + compileSwitchStatement(statement: SwitchStatement, contextualFlags: ContextualFlags): ExpressionRef; + compileThrowStatement(statement: ThrowStatement, contextualFlags: ContextualFlags): ExpressionRef; + compileTryStatement(statement: TryStatement, contextualFlags: ContextualFlags): ExpressionRef; + /** Compiles a variable statement. Returns `0` if an initializer is not necessary. */ + compileVariableStatement(statement: VariableStatement, contextualFlags: ContextualFlags): ExpressionRef; + compileVoidStatement(statement: VoidStatement, contextualFlags: ContextualFlags): ExpressionRef; + compileWhileStatement(statement: WhileStatement, contextualFlags: ContextualFlags): ExpressionRef; + /** Compiles the value of an inlined constant element. */ + compileInlineConstant(element: VariableLikeElement, contextualType: Type, contextualFlags: ContextualFlags): ExpressionRef; + compileExpression(expression: Expression, contextualType: Type, contextualFlags?: ContextualFlags): ExpressionRef; + /** Compiles an expression while retaining the type, that is not void, it ultimately compiles to. */ + compileExpressionRetainType(expression: Expression, contextualType: Type, contextualFlags?: ContextualFlags): ExpressionRef; + /** Compiles and precomputes an expression, possibly yielding a costant value. */ + precomputeExpression(expression: Expression, contextualType: Type, contextualFlags?: ContextualFlags): ExpressionRef; + convertExpression(expr: ExpressionRef, + /** Original type. */ + fromType: Type, + /** New type. */ + toType: Type, + /** Whether the conversion is explicit.*/ + explicit: bool, + /** Whether the result should be wrapped, if a small integer. */ + wrap: bool, reportNode: Node): ExpressionRef; + compileAssertionExpression(expression: AssertionExpression, contextualType: Type, contextualFlags: ContextualFlags): ExpressionRef; + private f32ModInstance; + private f64ModInstance; + private f32PowInstance; + private f64PowInstance; + compileBinaryExpression(expression: BinaryExpression, contextualType: Type, contextualFlags: ContextualFlags): ExpressionRef; + compileUnaryOverload(operatorInstance: Function, value: Expression, valueExpr: ExpressionRef, reportNode: Node): ExpressionRef; + compileBinaryOverload(operatorInstance: Function, left: Expression, leftExpr: ExpressionRef, right: Expression, reportNode: Node): ExpressionRef; + compileAssignment(expression: Expression, valueExpression: Expression, contextualType: Type): ExpressionRef; + /** Makes an assignment expression or block, assigning a value to a target. */ + makeAssignment( + /** Target element, e.g. a Local. */ + target: Element, + /** Value expression that has been compiled in a previous step already. */ + valueExpr: ExpressionRef, + /** Expression reference. Has already been compiled to `valueExpr`. */ + valueExpression: Expression, + /** `this` expression reference if a field or property set. */ + thisExpression: Expression | null, + /** Index expression reference if an indexed set. */ + indexExpression: Expression | null, + /** Whether to tee the value. */ + tee: bool): ExpressionRef; + /** Makes an assignment to a local, possibly retaining and releasing affected references and keeping track of wrap and null states. */ + private makeLocalAssignment; + /** Makes an assignment to a global, possibly retaining and releasing affected references. */ + private makeGlobalAssignment; + /** Makes an assignment to a field, possibly retaining and releasing affected references. */ + makeFieldAssignment( + /** The field to assign to. */ + field: Field, + /** The value to assign. */ + valueExpr: ExpressionRef, + /** The value of `this`. */ + thisExpr: ExpressionRef, + /** Whether to tee the value. */ + tee: bool): ExpressionRef; + /** Compiles a call expression according to the specified context. */ + compileCallExpression( + /** Call expression to compile. */ + expression: CallExpression, + /** Contextual type indicating the return type the caller expects, if any. */ + contextualType: Type, + /** Contextual flags indicating contextual conditions. */ + contextualFlags: ContextualFlags): ExpressionRef; + private compileCallExpressionBuiltin; + /** + * Checks that a call with the given number as arguments can be performed according to the + * specified signature. + */ + checkCallSignature(signature: Signature, numArguments: i32, hasThis: bool, reportNode: Node): bool; + /** Compiles a direct call to a concrete function. */ + compileCallDirect(instance: Function, argumentExpressions: Expression[], reportNode: Node, thisArg?: ExpressionRef, contextualFlags?: ContextualFlags): ExpressionRef; + makeCallInline(instance: Function, operands: ExpressionRef[] | null, thisArg?: ExpressionRef, immediatelyDropped?: bool): ExpressionRef; + /** Gets the trampoline for the specified function. */ + ensureTrampoline(original: Function): Function; + /** Makes sure that the argument count helper global is present and returns its name. */ + private ensureArgcVar; + /** Makes sure that the argument count helper setter is present and returns its name. */ + private ensureArgcSet; + /** Makes retain call, retaining the expression's value. */ + makeRetain(expr: ExpressionRef): ExpressionRef; + /** Makes a retainRelease call, retaining the new expression's value and releasing the old expression's value, in this order. */ + makeRetainRelease(oldExpr: ExpressionRef, newExpr: ExpressionRef): ExpressionRef; + /** Makes a skippedRelease call, ignoring the new expression's value and releasing the old expression's value, in this order. */ + makeSkippedRelease(oldExpr: ExpressionRef, newExpr: ExpressionRef): ExpressionRef; + /** Makes a release call, releasing the expression's value. Changes the current type to void.*/ + makeRelease(expr: ExpressionRef): ExpressionRef; + /** Makes an automatic release call at the end of the current flow. */ + makeAutorelease(expr: ExpressionRef, flow?: Flow): ExpressionRef; + /** Attempts to undo a final autorelease, returning the index of the previously retaining variable or -1 if not possible. */ + undoAutorelease(expr: ExpressionRef, flow: Flow): i32; + /** + * Attemps to move a final autorelease from one flow to a parent. + * It is crucial that from flow hasn't processed autoreleases yet because otherwise the final + * retain would have been written already. + */ + moveAutorelease(expr: ExpressionRef, fromInnerFlow: Flow, toOuterFlow: Flow): ExpressionRef; + /** Performs any queued autoreleases in the specified flow. */ + performAutoreleases(flow: Flow, stmts: ExpressionRef[], clearFlags?: bool): void; + /** Performs any queued autoreleases in the specified flow and returns the value. */ + performAutoreleasesWithValue(flow: Flow, valueExpr: ExpressionRef, valueType: Type, stmts?: ExpressionRef[] | null, clearFlags?: bool): ExpressionRef; + /** Finishes any queued top-level autoreleases in the actual function of the specified flow. */ + finishAutoreleases(flow: Flow, stmts: ExpressionRef[]): void; + /** Creates a direct call to the specified function. */ + makeCallDirect(instance: Function, operands: ExpressionRef[] | null, reportNode: Node, immediatelyDropped?: bool, + /** Skip the usual autorelease and manage this at the callsite instead. */ + skipAutorelease?: bool): ExpressionRef; + /** Compiles an indirect call using an index argument and a signature. */ + compileCallIndirect(signature: Signature, indexArg: ExpressionRef, argumentExpressions: Expression[], reportNode: Node, thisArg?: ExpressionRef, immediatelyDropped?: bool): ExpressionRef; + /** Creates an indirect call to the function at `indexArg` in the function table. */ + makeCallIndirect(signature: Signature, indexArg: ExpressionRef, operands?: ExpressionRef[] | null, immediatelyDropped?: bool): ExpressionRef; + compileCommaExpression(expression: CommaExpression, contextualType: Type, contextualFlags: ContextualFlags): ExpressionRef; + compileElementAccessExpression(expression: ElementAccessExpression, contextualType: Type, contextualFlags: ContextualFlags): ExpressionRef; + compileFunctionExpression(expression: FunctionExpression, contextualSignature: Signature | null, contextualFlags: ContextualFlags): ExpressionRef; + /** Makes sure the enclosing source file of the specified expression has been compiled. */ + private maybeCompileEnclosingSource; + /** + * Compiles an identifier in the specified context. + * @param retainConstantType Retains the type of inlined constants if `true`, otherwise + * precomputes them according to context. + */ + compileIdentifierExpression(expression: IdentifierExpression, contextualType: Type, contextualFlags: ContextualFlags): ExpressionRef; + compileInstanceOfExpression(expression: InstanceOfExpression, contextualType: Type, contextualFlags: ContextualFlags): ExpressionRef; + compileLiteralExpression(expression: LiteralExpression, contextualType: Type, contextualFlags: ContextualFlags, implicitlyNegate?: bool): ExpressionRef; + compileStringLiteral(expression: StringLiteralExpression): ExpressionRef; + compileArrayLiteral(elementType: Type, expressions: (Expression | null)[], isConst: bool, contextualFlags: ContextualFlags, reportNode: Node): ExpressionRef; + compileObjectLiteral(expression: ObjectLiteralExpression, contextualType: Type): ExpressionRef; + compileNewExpression(expression: NewExpression, contextualType: Type, contextualFlags: ContextualFlags): ExpressionRef; + /** Gets the compiled constructor of the specified class or generates one if none is present. */ + ensureConstructor(classInstance: Class, reportNode: Node): Function; + compileInstantiate( + /** Class to instantiate. */ + classInstance: Class, + /** Constructor arguments. */ + argumentExpressions: Expression[], + /** Contextual flags. */ + contextualFlags: ContextualFlags, + /** Node to report on. */ + reportNode: Node): ExpressionRef; + /** + * Compiles a property access in the specified context. + * @param retainConstantType Retains the type of inlined constants if `true`, otherwise + * precomputes them according to context. + */ + compilePropertyAccessExpression(propertyAccess: PropertyAccessExpression, contextualType: Type, contextualFlags: ContextualFlags): ExpressionRef; + compileTernaryExpression(expression: TernaryExpression, contextualType: Type, contextualFlags: ContextualFlags): ExpressionRef; + compileUnaryPostfixExpression(expression: UnaryPostfixExpression, contextualType: Type, contextualFlags: ContextualFlags): ExpressionRef; + compileUnaryPrefixExpression(expression: UnaryPrefixExpression, contextualType: Type, contextualFlags: ContextualFlags): ExpressionRef; + /** Makes sure that a 32-bit integer value is wrapped to a valid value of the specified type. */ + ensureSmallIntegerWrap(expr: ExpressionRef, type: Type): ExpressionRef; + /** Adds the debug location of the specified expression at the specified range to the source map. */ + addDebugLocation(expr: ExpressionRef, range: Range): void; + /** Creates a comparison whether an expression is 'false' in a broader sense. */ + makeIsFalseish(expr: ExpressionRef, type: Type): ExpressionRef; + /** Creates a comparison whether an expression is 'true' in a broader sense. */ + makeIsTrueish(expr: ExpressionRef, type: Type): ExpressionRef; + /** Makes an allocation suitable to hold the data of an instance of the given class. */ + makeAllocation(classInstance: Class): ExpressionRef; + /** Makes the initializers for a class's fields. */ + makeFieldInitialization(classInstance: Class, stmts?: ExpressionRef[]): ExpressionRef[]; + makeInstanceOfClass(expr: ExpressionRef, classInstance: Class): ExpressionRef; + } + /** Flattens a series of expressions to a nop, a single statement or a block depending on statement count. */ + export function flatten(module: Module, stmts: ExpressionRef[], type: NativeType): ExpressionRef; + +} +declare module 'assemblyscript/src/builtins' { + /** + * Built-in elements providing WebAssembly core functionality. + * @module builtins + */ /***/ + import { Compiler } from 'assemblyscript/src/compiler'; + import { Node, Expression, CallExpression } from 'assemblyscript/src/ast'; + import { Type } from 'assemblyscript/src/types'; + import { ExpressionRef } from 'assemblyscript/src/module'; + import { FunctionPrototype } from 'assemblyscript/src/program'; + /** Symbols of various compiler built-ins. */ + export namespace BuiltinSymbols { + const isInteger = "~lib/builtins/isInteger"; + const isFloat = "~lib/builtins/isFloat"; + const isBoolean = "~lib/builtins/isBoolean"; + const isSigned = "~lib/builtins/isSigned"; + const isReference = "~lib/builtins/isReference"; + const isString = "~lib/builtins/isString"; + const isArray = "~lib/builtins/isArray"; + const isArrayLike = "~lib/builtins/isArrayLike"; + const isFunction = "~lib/builtins/isFunction"; + const isNullable = "~lib/builtins/isNullable"; + const isDefined = "~lib/builtins/isDefined"; + const isConstant = "~lib/builtins/isConstant"; + const isManaged = "~lib/builtins/isManaged"; + const clz = "~lib/builtins/clz"; + const ctz = "~lib/builtins/ctz"; + const popcnt = "~lib/builtins/popcnt"; + const rotl = "~lib/builtins/rotl"; + const rotr = "~lib/builtins/rotr"; + const abs = "~lib/builtins/abs"; + const max = "~lib/builtins/max"; + const min = "~lib/builtins/min"; + const ceil = "~lib/builtins/ceil"; + const floor = "~lib/builtins/floor"; + const copysign = "~lib/builtins/copysign"; + const nearest = "~lib/builtins/nearest"; + const reinterpret = "~lib/builtins/reinterpret"; + const sqrt = "~lib/builtins/sqrt"; + const trunc = "~lib/builtins/trunc"; + const load = "~lib/builtins/load"; + const store = "~lib/builtins/store"; + const atomic_load = "~lib/builtins/atomic.load"; + const atomic_store = "~lib/builtins/atomic.store"; + const atomic_add = "~lib/builtins/atomic.add"; + const atomic_sub = "~lib/builtins/atomic.sub"; + const atomic_and = "~lib/builtins/atomic.and"; + const atomic_or = "~lib/builtins/atomic.or"; + const atomic_xor = "~lib/builtins/atomic.xor"; + const atomic_xchg = "~lib/builtins/atomic.xchg"; + const atomic_cmpxchg = "~lib/builtins/atomic.cmpxchg"; + const atomic_wait = "~lib/builtins/atomic.wait"; + const atomic_notify = "~lib/builtins/atomic.notify"; + const sizeof = "~lib/builtins/sizeof"; + const alignof = "~lib/builtins/alignof"; + const offsetof = "~lib/builtins/offsetof"; + const select = "~lib/builtins/select"; + const unreachable = "~lib/builtins/unreachable"; + const changetype = "~lib/builtins/changetype"; + const assert = "~lib/builtins/assert"; + const unchecked = "~lib/builtins/unchecked"; + const call_direct = "~lib/builtins/call_direct"; + const call_indirect = "~lib/builtins/call_indirect"; + const instantiate = "~lib/builtins/instantiate"; + const idof = "~lib/builtins/idof"; + const i8 = "~lib/builtins/i8"; + const i16 = "~lib/builtins/i16"; + const i32 = "~lib/builtins/i32"; + const i64 = "~lib/builtins/i64"; + const isize = "~lib/builtins/isize"; + const u8 = "~lib/builtins/u8"; + const u16 = "~lib/builtins/u16"; + const u32 = "~lib/builtins/u32"; + const u64 = "~lib/builtins/u64"; + const usize = "~lib/builtins/usize"; + const bool = "~lib/builtins/bool"; + const f32 = "~lib/builtins/f32"; + const f64 = "~lib/builtins/f64"; + const v128 = "~lib/builtins/v128"; + const void_ = "~lib/builtins/void"; + const i32_clz = "~lib/builtins/i32.clz"; + const i64_clz = "~lib/builtins/i64.clz"; + const i32_ctz = "~lib/builtins/i32.ctz"; + const i64_ctz = "~lib/builtins/i64.ctz"; + const i32_popcnt = "~lib/builtins/i32.popcnt"; + const i64_popcnt = "~lib/builtins/i64.popcnt"; + const i32_rotl = "~lib/builtins/i32.rotl"; + const i64_rotl = "~lib/builtins/i64.rotl"; + const i32_rotr = "~lib/builtins/i32.rotr"; + const i64_rotr = "~lib/builtins/i64.rotr"; + const f32_abs = "~lib/builtins/f32.abs"; + const f64_abs = "~lib/builtins/f64.abs"; + const f32_max = "~lib/builtins/f32.max"; + const f64_max = "~lib/builtins/f64.max"; + const f32_min = "~lib/builtins/f32.min"; + const f64_min = "~lib/builtins/f64.min"; + const f32_ceil = "~lib/builtins/f32.ceil"; + const f64_ceil = "~lib/builtins/f64.ceil"; + const f32_floor = "~lib/builtins/f32.floor"; + const f64_floor = "~lib/builtins/f64.floor"; + const f32_copysign = "~lib/builtins/f32.copysign"; + const f64_copysign = "~lib/builtins/f64.copysign"; + const f32_nearest = "~lib/builtins/f32.nearest"; + const f64_nearest = "~lib/builtins/f64.nearest"; + const i32_reinterpret_f32 = "~lib/builtins/i32.reinterpret_f32"; + const i64_reinterpret_f64 = "~lib/builtins/i64.reinterpret_f64"; + const f32_reinterpret_i32 = "~lib/builtins/f32.reinterpret_i32"; + const f64_reinterpret_i64 = "~lib/builtins/f64.reinterpret_i64"; + const f32_sqrt = "~lib/builtins/f32.sqrt"; + const f64_sqrt = "~lib/builtins/f64.sqrt"; + const f32_trunc = "~lib/builtins/f32.trunc"; + const f64_trunc = "~lib/builtins/f64.trunc"; + const i32_load8_s = "~lib/builtins/i32.load8_s"; + const i32_load8_u = "~lib/builtins/i32.load8_u"; + const i32_load16_s = "~lib/builtins/i32.load16_s"; + const i32_load16_u = "~lib/builtins/i32.load16_u"; + const i32_load = "~lib/builtins/i32.load"; + const i64_load8_s = "~lib/builtins/i64.load8_s"; + const i64_load8_u = "~lib/builtins/i64.load8_u"; + const i64_load16_s = "~lib/builtins/i64.load16_s"; + const i64_load16_u = "~lib/builtins/i64.load16_u"; + const i64_load32_s = "~lib/builtins/i64.load32_s"; + const i64_load32_u = "~lib/builtins/i64.load32_u"; + const i64_load = "~lib/builtins/i64.load"; + const f32_load = "~lib/builtins/f32.load"; + const f64_load = "~lib/builtins/f64.load"; + const i32_store8 = "~lib/builtins/i32.store8"; + const i32_store16 = "~lib/builtins/i32.store16"; + const i32_store = "~lib/builtins/i32.store"; + const i64_store8 = "~lib/builtins/i64.store8"; + const i64_store16 = "~lib/builtins/i64.store16"; + const i64_store32 = "~lib/builtins/i64.store32"; + const i64_store = "~lib/builtins/i64.store"; + const f32_store = "~lib/builtins/f32.store"; + const f64_store = "~lib/builtins/f64.store"; + const i32_atomic_load8_u = "~lib/builtins/i32.atomic.load8_u"; + const i32_atomic_load16_u = "~lib/builtins/i32.atomic.load16_u"; + const i32_atomic_load = "~lib/builtins/i32.atomic.load"; + const i64_atomic_load8_u = "~lib/builtins/i64.atomic.load8_u"; + const i64_atomic_load16_u = "~lib/builtins/i64.atomic.load16_u"; + const i64_atomic_load32_u = "~lib/builtins/i64.atomic.load32_u"; + const i64_atomic_load = "~lib/builtins/i64.atomic.load"; + const i32_atomic_store8 = "~lib/builtins/i32.atomic.store8"; + const i32_atomic_store16 = "~lib/builtins/i32.atomic.store16"; + const i32_atomic_store = "~lib/builtins/i32.atomic.store"; + const i64_atomic_store8 = "~lib/builtins/i64.atomic.store8"; + const i64_atomic_store16 = "~lib/builtins/i64.atomic.store16"; + const i64_atomic_store32 = "~lib/builtins/i64.atomic.store32"; + const i64_atomic_store = "~lib/builtins/i64.atomic.store"; + const i32_atomic_rmw8_add_u = "~lib/builtins/i32.atomic.rmw8.add_u"; + const i32_atomic_rmw16_add_u = "~lib/builtins/i32.atomic.rmw16.add_u"; + const i32_atomic_rmw_add = "~lib/builtins/i32.atomic.rmw.add"; + const i64_atomic_rmw8_add_u = "~lib/builtins/i64.atomic.rmw8.add_u"; + const i64_atomic_rmw16_add_u = "~lib/builtins/i64.atomic.rmw16.add_u"; + const i64_atomic_rmw32_add_u = "~lib/builtins/i64.atomic.rmw32.add_u"; + const i64_atomic_rmw_add = "~lib/builtins/i64.atomic.rmw.add"; + const i32_atomic_rmw8_sub_u = "~lib/builtins/i32.atomic.rmw8.sub_u"; + const i32_atomic_rmw16_sub_u = "~lib/builtins/i32.atomic.rmw16.sub_u"; + const i32_atomic_rmw_sub = "~lib/builtins/i32.atomic.rmw.sub"; + const i64_atomic_rmw8_sub_u = "~lib/builtins/i64.atomic.rmw8.sub_u"; + const i64_atomic_rmw16_sub_u = "~lib/builtins/i64.atomic.rmw16.sub_u"; + const i64_atomic_rmw32_sub_u = "~lib/builtins/i64.atomic.rmw32.sub_u"; + const i64_atomic_rmw_sub = "~lib/builtins/i64.atomic.rmw.sub"; + const i32_atomic_rmw8_and_u = "~lib/builtins/i32.atomic.rmw8.and_u"; + const i32_atomic_rmw16_and_u = "~lib/builtins/i32.atomic.rmw16.and_u"; + const i32_atomic_rmw_and = "~lib/builtins/i32.atomic.rmw.and"; + const i64_atomic_rmw8_and_u = "~lib/builtins/i64.atomic.rmw8.and_u"; + const i64_atomic_rmw16_and_u = "~lib/builtins/i64.atomic.rmw16.and_u"; + const i64_atomic_rmw32_and_u = "~lib/builtins/i64.atomic.rmw32.and_u"; + const i64_atomic_rmw_and = "~lib/builtins/i64.atomic.rmw.and"; + const i32_atomic_rmw8_or_u = "~lib/builtins/i32.atomic.rmw8.or_u"; + const i32_atomic_rmw16_or_u = "~lib/builtins/i32.atomic.rmw16.or_u"; + const i32_atomic_rmw_or = "~lib/builtins/i32.atomic.rmw.or"; + const i64_atomic_rmw8_or_u = "~lib/builtins/i64.atomic.rmw8.or_u"; + const i64_atomic_rmw16_or_u = "~lib/builtins/i64.atomic.rmw16.or_u"; + const i64_atomic_rmw32_or_u = "~lib/builtins/i64.atomic.rmw32.or_u"; + const i64_atomic_rmw_or = "~lib/builtins/i64.atomic.rmw.or"; + const i32_atomic_rmw8_u_xor = "~lib/builtins/i32.atomic.rmw8.xor_u"; + const i32_atomic_rmw16_u_xor = "~lib/builtins/i32.atomic.rmw16.xor_u"; + const i32_atomic_rmw_xor = "~lib/builtins/i32.atomic.rmw.xor"; + const i64_atomic_rmw8_xor_u = "~lib/builtins/i64.atomic.rmw8.xor_u"; + const i64_atomic_rmw16_xor_u = "~lib/builtins/i64.atomic.rmw16.xor_u"; + const i64_atomic_rmw32_xor_u = "~lib/builtins/i64.atomic.rmw32.xor_u"; + const i64_atomic_rmw_xor = "~lib/builtins/i64.atomic.rmw.xor"; + const i32_atomic_rmw8_xchg_u = "~lib/builtins/i32.atomic.rmw8.xchg_u"; + const i32_atomic_rmw16_xchg_u = "~lib/builtins/i32.atomic.rmw16.xchg_u"; + const i32_atomic_rmw_xchg = "~lib/builtins/i32.atomic.rmw.xchg"; + const i64_atomic_rmw8_xchg_u = "~lib/builtins/i64.atomic.rmw8.xchg_u"; + const i64_atomic_rmw16_xchg_u = "~lib/builtins/i64.atomic.rmw16.xchg_u"; + const i64_atomic_rmw32_xchg_u = "~lib/builtins/i64.atomic.rmw32.xchg_u"; + const i64_atomic_rmw_xchg = "~lib/builtins/i64.atomic.rmw.xchg"; + const i32_atomic_rmw8_cmpxchg_u = "~lib/builtins/i32.atomic.rmw8.cmpxchg_u"; + const i32_atomic_rmw16_cmpxchg_u = "~lib/builtins/i32.atomic.rmw16.cmpxchg_u"; + const i32_atomic_rmw_cmpxchg = "~lib/builtins/i32.atomic.rmw.cmpxchg"; + const i64_atomic_rmw8_cmpxchg_u = "~lib/builtins/i64.atomic.rmw8.cmpxchg_u"; + const i64_atomic_rmw16_cmpxchg_u = "~lib/builtins/i64.atomic.rmw16.cmpxchg_u"; + const i64_atomic_rmw32_cmpxchg_u = "~lib/builtins/i64.atomic.rmw32.cmpxchg_u"; + const i64_atomic_rmw_cmpxchg = "~lib/builtins/i64.atomic.rmw.cmpxchg"; + const i32_wait = "~lib/builtins/i32.wait"; + const i64_wait = "~lib/builtins/i64.wait"; + const v128_splat = "~lib/builtins/v128.splat"; + const v128_extract_lane = "~lib/builtins/v128.extract_lane"; + const v128_replace_lane = "~lib/builtins/v128.replace_lane"; + const v128_shuffle = "~lib/builtins/v128.shuffle"; + const v128_load = "~lib/builtins/v128.load"; + const v128_store = "~lib/builtins/v128.store"; + const v128_add = "~lib/builtins/v128.add"; + const v128_sub = "~lib/builtins/v128.sub"; + const v128_mul = "~lib/builtins/v128.mul"; + const v128_div = "~lib/builtins/v128.div"; + const v128_neg = "~lib/builtins/v128.neg"; + const v128_add_saturate = "~lib/builtins/v128.add_saturate"; + const v128_sub_saturate = "~lib/builtins/v128.sub_saturate"; + const v128_shl = "~lib/builtins/v128.shl"; + const v128_shr = "~lib/builtins/v128.shr"; + const v128_and = "~lib/builtins/v128.and"; + const v128_or = "~lib/builtins/v128.or"; + const v128_xor = "~lib/builtins/v128.xor"; + const v128_not = "~lib/builtins/v128.not"; + const v128_bitselect = "~lib/builtins/v128.bitselect"; + const v128_any_true = "~lib/builtins/v128.any_true"; + const v128_all_true = "~lib/builtins/v128.all_true"; + const v128_min = "~lib/builtins/v128.min"; + const v128_max = "~lib/builtins/v128.max"; + const v128_abs = "~lib/builtins/v128.abs"; + const v128_sqrt = "~lib/builtins/v128.sqrt"; + const v128_eq = "~lib/builtins/v128.eq"; + const v128_ne = "~lib/builtins/v128.ne"; + const v128_lt = "~lib/builtins/v128.lt"; + const v128_le = "~lib/builtins/v128.le"; + const v128_gt = "~lib/builtins/v128.gt"; + const v128_ge = "~lib/builtins/v128.ge"; + const v128_convert = "~lib/builtins/v128.convert"; + const v128_trunc = "~lib/builtins/v128.trunc"; + const i8x16 = "~lib/builtins/i8x16"; + const i16x8 = "~lib/builtins/i16x8"; + const i32x4 = "~lib/builtins/i32x4"; + const i64x2 = "~lib/builtins/i64x2"; + const f32x4 = "~lib/builtins/f32x4"; + const f64x2 = "~lib/builtins/f64x2"; + const i8x16_splat = "~lib/builtins/i8x16.splat"; + const i8x16_extract_lane_s = "~lib/builtins/i8x16.extract_lane_s"; + const i8x16_extract_lane_u = "~lib/builtins/i8x16.extract_lane_u"; + const i8x16_replace_lane = "~lib/builtins/i8x16.replace_lane"; + const i8x16_add = "~lib/builtins/i8x16.add"; + const i8x16_sub = "~lib/builtins/i8x16.sub"; + const i8x16_mul = "~lib/builtins/i8x16.mul"; + const i8x16_neg = "~lib/builtins/i8x16.neg"; + const i8x16_add_saturate_s = "~lib/builtins/i8x16.add_saturate_s"; + const i8x16_add_saturate_u = "~lib/builtins/i8x16.add_saturate_u"; + const i8x16_sub_saturate_s = "~lib/builtins/i8x16.sub_saturate_s"; + const i8x16_sub_saturate_u = "~lib/builtins/i8x16.sub_saturate_u"; + const i8x16_shl = "~lib/builtins/i8x16.shl"; + const i8x16_shr_s = "~lib/builtins/i8x16.shr_s"; + const i8x16_shr_u = "~lib/builtins/i8x16.shr_u"; + const i8x16_any_true = "~lib/builtins/i8x16.any_true"; + const i8x16_all_true = "~lib/builtins/i8x16.all_true"; + const i8x16_eq = "~lib/builtins/i8x16.eq"; + const i8x16_ne = "~lib/builtins/i8x16.ne"; + const i8x16_lt_s = "~lib/builtins/i8x16.lt_s"; + const i8x16_lt_u = "~lib/builtins/i8x16.lt_u"; + const i8x16_le_s = "~lib/builtins/i8x16.le_s"; + const i8x16_le_u = "~lib/builtins/i8x16.le_u"; + const i8x16_gt_s = "~lib/builtins/i8x16.gt_s"; + const i8x16_gt_u = "~lib/builtins/i8x16.gt_u"; + const i8x16_ge_s = "~lib/builtins/i8x16.ge_s"; + const i8x16_ge_u = "~lib/builtins/i8x16.ge_u"; + const i16x8_splat = "~lib/builtins/i16x8.splat"; + const i16x8_extract_lane_s = "~lib/builtins/i16x8.extract_lane_s"; + const i16x8_extract_lane_u = "~lib/builtins/i16x8.extract_lane_u"; + const i16x8_replace_lane = "~lib/builtins/i16x8.replace_lane"; + const i16x8_add = "~lib/builtins/i16x8.add"; + const i16x8_sub = "~lib/builtins/i16x8.sub"; + const i16x8_mul = "~lib/builtins/i16x8.mul"; + const i16x8_neg = "~lib/builtins/i16x8.neg"; + const i16x8_add_saturate_s = "~lib/builtins/i16x8.add_saturate_s"; + const i16x8_add_saturate_u = "~lib/builtins/i16x8.add_saturate_u"; + const i16x8_sub_saturate_s = "~lib/builtins/i16x8.sub_saturate_s"; + const i16x8_sub_saturate_u = "~lib/builtins/i16x8.sub_saturate_u"; + const i16x8_shl = "~lib/builtins/i16x8.shl"; + const i16x8_shr_s = "~lib/builtins/i16x8.shr_s"; + const i16x8_shr_u = "~lib/builtins/i16x8.shr_u"; + const i16x8_any_true = "~lib/builtins/i16x8.any_true"; + const i16x8_all_true = "~lib/builtins/i16x8.all_true"; + const i16x8_eq = "~lib/builtins/i16x8.eq"; + const i16x8_ne = "~lib/builtins/i16x8.ne"; + const i16x8_lt_s = "~lib/builtins/i16x8.lt_s"; + const i16x8_lt_u = "~lib/builtins/i16x8.lt_u"; + const i16x8_le_s = "~lib/builtins/i16x8.le_s"; + const i16x8_le_u = "~lib/builtins/i16x8.le_u"; + const i16x8_gt_s = "~lib/builtins/i16x8.gt_s"; + const i16x8_gt_u = "~lib/builtins/i16x8.gt_u"; + const i16x8_ge_s = "~lib/builtins/i16x8.ge_s"; + const i16x8_ge_u = "~lib/builtins/i16x8.ge_u"; + const i32x4_splat = "~lib/builtins/i32x4.splat"; + const i32x4_extract_lane = "~lib/builtins/i32x4.extract_lane"; + const i32x4_replace_lane = "~lib/builtins/i32x4.replace_lane"; + const i32x4_add = "~lib/builtins/i32x4.add"; + const i32x4_sub = "~lib/builtins/i32x4.sub"; + const i32x4_mul = "~lib/builtins/i32x4.mul"; + const i32x4_neg = "~lib/builtins/i32x4.neg"; + const i32x4_shl = "~lib/builtins/i32x4.shl"; + const i32x4_shr_s = "~lib/builtins/i32x4.shr_s"; + const i32x4_shr_u = "~lib/builtins/i32x4.shr_u"; + const i32x4_any_true = "~lib/builtins/i32x4.any_true"; + const i32x4_all_true = "~lib/builtins/i32x4.all_true"; + const i32x4_eq = "~lib/builtins/i32x4.eq"; + const i32x4_ne = "~lib/builtins/i32x4.ne"; + const i32x4_lt_s = "~lib/builtins/i32x4.lt_s"; + const i32x4_lt_u = "~lib/builtins/i32x4.lt_u"; + const i32x4_le_s = "~lib/builtins/i32x4.le_s"; + const i32x4_le_u = "~lib/builtins/i32x4.le_u"; + const i32x4_gt_s = "~lib/builtins/i32x4.gt_s"; + const i32x4_gt_u = "~lib/builtins/i32x4.gt_u"; + const i32x4_ge_s = "~lib/builtins/i32x4.ge_s"; + const i32x4_ge_u = "~lib/builtins/i32x4.ge_u"; + const i32x4_trunc_s_f32x4_sat = "~lib/builtins/i32x4.trunc_s_f32x4_sat"; + const i32x4_trunc_u_f32x4_sat = "~lib/builtins/i32x4.trunc_u_f32x4_sat"; + const i64x2_splat = "~lib/builtins/i64x2.splat"; + const i64x2_extract_lane = "~lib/builtins/i64x2.extract_lane"; + const i64x2_replace_lane = "~lib/builtins/i64x2.replace_lane"; + const i64x2_add = "~lib/builtins/i64x2.add"; + const i64x2_sub = "~lib/builtins/i64x2.sub"; + const i64x2_neg = "~lib/builtins/i64x2.neg"; + const i64x2_shl = "~lib/builtins/i64x2.shl"; + const i64x2_shr_s = "~lib/builtins/i64x2.shr_s"; + const i64x2_shr_u = "~lib/builtins/i64x2.shr_u"; + const i64x2_any_true = "~lib/builtins/i64x2.any_true"; + const i64x2_all_true = "~lib/builtins/i64x2.all_true"; + const i64x2_trunc_s_f64x2_sat = "~lib/builtins/i64x2.trunc_s_f64x2_sat"; + const i64x2_trunc_u_f64x2_sat = "~lib/builtins/i64x2.trunc_u_f64x2_sat"; + const f32x4_splat = "~lib/builtins/f32x4.splat"; + const f32x4_extract_lane = "~lib/builtins/f32x4.extract_lane"; + const f32x4_replace_lane = "~lib/builtins/f32x4.replace_lane"; + const f32x4_add = "~lib/builtins/f32x4.add"; + const f32x4_sub = "~lib/builtins/f32x4.sub"; + const f32x4_mul = "~lib/builtins/f32x4.mul"; + const f32x4_div = "~lib/builtins/f32x4.div"; + const f32x4_neg = "~lib/builtins/f32x4.neg"; + const f32x4_min = "~lib/builtins/f32x4.min"; + const f32x4_max = "~lib/builtins/f32x4.max"; + const f32x4_abs = "~lib/builtins/f32x4.abs"; + const f32x4_sqrt = "~lib/builtins/f32x4.sqrt"; + const f32x4_eq = "~lib/builtins/f32x4.eq"; + const f32x4_ne = "~lib/builtins/f32x4.ne"; + const f32x4_lt = "~lib/builtins/f32x4.lt"; + const f32x4_le = "~lib/builtins/f32x4.le"; + const f32x4_gt = "~lib/builtins/f32x4.gt"; + const f32x4_ge = "~lib/builtins/f32x4.ge"; + const f32x4_convert_s_i32x4 = "~lib/builtins/f32x4.convert_s_i32x4"; + const f32x4_convert_u_i32x4 = "~lib/builtins/f32x4.convert_u_i32x4"; + const f64x2_splat = "~lib/builtins/f64x2.splat"; + const f64x2_extract_lane = "~lib/builtins/f64x2.extract_lane"; + const f64x2_replace_lane = "~lib/builtins/f64x2.replace_lane"; + const f64x2_add = "~lib/builtins/f64x2.add"; + const f64x2_sub = "~lib/builtins/f64x2.sub"; + const f64x2_mul = "~lib/builtins/f64x2.mul"; + const f64x2_div = "~lib/builtins/f64x2.div"; + const f64x2_neg = "~lib/builtins/f64x2.neg"; + const f64x2_min = "~lib/builtins/f64x2.min"; + const f64x2_max = "~lib/builtins/f64x2.max"; + const f64x2_abs = "~lib/builtins/f64x2.abs"; + const f64x2_sqrt = "~lib/builtins/f64x2.sqrt"; + const f64x2_eq = "~lib/builtins/f64x2.eq"; + const f64x2_ne = "~lib/builtins/f64x2.ne"; + const f64x2_lt = "~lib/builtins/f64x2.lt"; + const f64x2_le = "~lib/builtins/f64x2.le"; + const f64x2_gt = "~lib/builtins/f64x2.gt"; + const f64x2_ge = "~lib/builtins/f64x2.ge"; + const f64x2_convert_s_i64x2 = "~lib/builtins/f64x2.convert_s_i64x2"; + const f64x2_convert_u_i64x2 = "~lib/builtins/f64x2.convert_u_i64x2"; + const v8x16_shuffle = "~lib/builtins/v8x16.shuffle"; + const heap_base = "~lib/heap/__heap_base"; + const rtti_base = "~lib/rt/__rtti_base"; + const visit_globals = "~lib/rt/__visit_globals"; + const visit_members = "~lib/rt/__visit_members"; + const ERROR = "~lib/diagnostics/ERROR"; + const WARNING = "~lib/diagnostics/WARNING"; + const INFO = "~lib/diagnostics/INFO"; + const memory_size = "~lib/memory/memory.size"; + const memory_grow = "~lib/memory/memory.grow"; + const memory_copy = "~lib/memory/memory.copy"; + const memory_fill = "~lib/memory/memory.fill"; + const memory_allocate = "~lib/memory/memory.allocate"; + const memory_free = "~lib/memory/memory.free"; + const memory_reset = "~lib/memory/memory.reset"; + const runtime_instanceof = "~lib/runtime/runtime.instanceof"; + const runtime_flags = "~lib/runtime/runtime.flags"; + const runtime_allocate = "~lib/util/runtime/allocate"; + const runtime_reallocate = "~lib/util/runtime/reallocate"; + const runtime_register = "~lib/util/runtime/register"; + const runtime_discard = "~lib/util/runtime/discard"; + const runtime_makeArray = "~lib/util/runtime/makeArray"; + const Int8Array = "~lib/typedarray/Int8Array"; + const Uint8Array = "~lib/typedarray/Uint8Array"; + const Int16Array = "~lib/typedarray/Int16Array"; + const Uint16Array = "~lib/typedarray/Uint16Array"; + const Int32Array = "~lib/typedarray/Int32Array"; + const Uint32Array = "~lib/typedarray/Uint32Array"; + const Int64Array = "~lib/typedarray/Int64Array"; + const Uint64Array = "~lib/typedarray/Uint64Array"; + const Uint8ClampedArray = "~lib/typedarray/Uint8ClampedArray"; + const Float32Array = "~lib/typedarray/Float32Array"; + const Float64Array = "~lib/typedarray/Float64Array"; + const started = "~lib/started"; + const argc = "~lib/argc"; + const setargc = "~lib/setargc"; + const capabilities = "~lib/capabilities"; + } + /** Compiles a call to a built-in function. */ + export function compileCall(compiler: Compiler, + /** Respective function prototype. */ + prototype: FunctionPrototype, + /** Pre-resolved type arguments. */ + typeArguments: Type[] | null, + /** Operand expressions. */ + operands: Expression[], + /** Contextual type. */ + contextualType: Type, + /** Respective call expression. */ + reportNode: CallExpression, + /** Indicates that contextual type is ASM type. */ + isAsm?: bool): ExpressionRef; + /** Compiles an abort wired to the conditionally imported 'abort' function. */ + export function compileAbort(compiler: Compiler, message: Expression | null, reportNode: Node): ExpressionRef; + /** Compiles the `visit_globals` function. */ + export function compileVisitGlobals(compiler: Compiler): void; + /** Compiles the `visit_members` function. */ + export function compileVisitMembers(compiler: Compiler): void; + /** Compiles runtime type information for use by stdlib. */ + export function compileRTTI(compiler: Compiler): void; + +} +declare module 'assemblyscript/src/decompiler' { + /** + * A decompiler that generates low-level AssemblyScript from WebAssembly binaries. + * @module decompiler + */ /***/ + import { Module, FunctionRef, ExpressionRef } from 'assemblyscript/src/module'; + export class Decompiler { + static decompile(module: Module): string; + text: string[]; + functionId: i32; + constructor(); + /** Decompiles a module to an AST that can then be serialized. */ + decompile(module: Module): void; + decompileFunction(func: FunctionRef): void; + decompileExpression(expr: ExpressionRef): void; + private push; + finish(): string; + } + +} +declare module 'assemblyscript/src/definitions' { + /** + * Definition builders for WebIDL and TypeScript. + * @module definitions + */ /***/ + import { Program, Element, Global, Enum, Field, Function, Class, Namespace, Interface, File } from 'assemblyscript/src/program'; + import { Type } from 'assemblyscript/src/types'; abstract class ExportsWalker { + /** Program reference. */ + program: Program; + /** Whether to include private members */ + includePrivate: bool; + /** Already seen elements. */ + seen: Map; + /** Constructs a new Element walker. */ + constructor(program: Program, includePrivate?: bool); + /** Walks all elements and calls the respective handlers. */ + walk(): void; + /** Visits all exported elements of a file. */ + visitFile(file: File): void; + /** Visits an element.*/ + visitElement(name: string, element: Element): void; + private visitFunctionInstances; + private visitClassInstances; + private visitPropertyInstances; + abstract visitGlobal(name: string, element: Global): void; + abstract visitEnum(name: string, element: Enum): void; + abstract visitFunction(name: string, element: Function): void; + abstract visitClass(name: string, element: Class): void; + abstract visitInterface(name: string, element: Interface): void; + abstract visitField(name: string, element: Field): void; + abstract visitNamespace(name: string, element: Element): void; + abstract visitAlias(name: string, element: Element, originalName: string): void; + } + /** A WebIDL definitions builder. */ + export class IDLBuilder extends ExportsWalker { + /** Builds WebIDL definitions for the specified program. */ + static build(program: Program): string; + private sb; + private indentLevel; + /** Constructs a new WebIDL builder. */ + constructor(program: Program, includePrivate?: bool); + visitGlobal(name: string, element: Global): void; + visitEnum(name: string, element: Enum): void; + visitFunction(name: string, element: Function): void; + visitClass(name: string, element: Class): void; + visitInterface(name: string, element: Interface): void; + visitField(name: string, element: Field): void; + visitNamespace(name: string, element: Namespace): void; + visitAlias(name: string, element: Element, originalName: string): void; + typeToString(type: Type): string; + build(): string; + } + /** A TypeScript definitions builder. */ + export class TSDBuilder extends ExportsWalker { + /** Builds TypeScript definitions for the specified program. */ + static build(program: Program): string; + private sb; + private indentLevel; + private unknown; + /** Constructs a new WebIDL builder. */ + constructor(program: Program, includePrivate?: bool); + visitGlobal(name: string, element: Global): void; + visitEnum(name: string, element: Enum): void; + visitFunction(name: string, element: Function): void; + visitClass(name: string, element: Class): void; + visitInterface(name: string, element: Interface): void; + visitField(name: string, element: Field): void; + visitNamespace(name: string, element: Element): void; + visitAlias(name: string, element: Element, originalName: string): void; + typeToString(type: Type): string; + build(): string; + } + export {}; + +} +declare module 'assemblyscript/src/parser' { + /** + * A TypeScript parser for the AssemblyScript subset. + * @module parser + */ /***/ + import { CommonFlags } from 'assemblyscript/src/common'; + import { Program } from 'assemblyscript/src/program'; + import { Tokenizer, CommentHandler } from 'assemblyscript/src/tokenizer'; + import { DiagnosticEmitter } from 'assemblyscript/src/diagnostics'; + import { CommonTypeNode, SignatureNode, Expression, ClassExpression, FunctionExpression, Statement, BlockStatement, BreakStatement, ClassDeclaration, ContinueStatement, DeclarationStatement, DecoratorNode, DoStatement, EnumDeclaration, EnumValueDeclaration, ExportImportStatement, ExportMember, ExportStatement, ExpressionStatement, ForStatement, FunctionDeclaration, IfStatement, ImportDeclaration, ImportStatement, IndexSignatureDeclaration, NamespaceDeclaration, ParameterNode, ReturnStatement, SwitchCase, SwitchStatement, ThrowStatement, TryStatement, TypeDeclaration, TypeParameterNode, VariableStatement, VariableDeclaration, VoidStatement, WhileStatement } from 'assemblyscript/src/ast'; + /** Parser interface. */ + export class Parser extends DiagnosticEmitter { + /** Program being created. */ + program: Program; + /** Source file names to be requested next. */ + backlog: string[]; + /** Source file names already seen, that is processed or backlogged. */ + seenlog: Set; + /** Source file names already completely processed. */ + donelog: Set; + /** Optional handler to intercept comments while tokenizing. */ + onComment: CommentHandler | null; + /** Constructs a new parser. */ + constructor(); + /** Parses a file and adds its definitions to the program. */ + parseFile(text: string, path: string, isEntry: bool): void; + /** Parses a top-level statement. */ + parseTopLevelStatement(tn: Tokenizer, namespace?: NamespaceDeclaration | null): Statement | null; + /** Obtains the next file to parse. */ + nextFile(): string | null; + /** Finishes parsing and returns the program. */ + finish(): Program; + /** Parses a type. */ + parseType(tn: Tokenizer, acceptParenthesized?: bool, suppressErrors?: bool): CommonTypeNode | null; + private tryParseSignatureIsSignature; + /** Parses a function signature, as used in type declarations. */ + tryParseSignature(tn: Tokenizer): SignatureNode | null; + parseDecorator(tn: Tokenizer): DecoratorNode | null; + parseVariable(tn: Tokenizer, flags: CommonFlags, decorators: DecoratorNode[] | null, startPos: i32): VariableStatement | null; + parseVariableDeclaration(tn: Tokenizer, parentFlags: CommonFlags, parentDecorators: DecoratorNode[] | null): VariableDeclaration | null; + parseEnum(tn: Tokenizer, flags: CommonFlags, decorators: DecoratorNode[] | null, startPos: i32): EnumDeclaration | null; + parseEnumValue(tn: Tokenizer, parentFlags: CommonFlags): EnumValueDeclaration | null; + parseReturn(tn: Tokenizer): ReturnStatement | null; + parseTypeParameters(tn: Tokenizer): TypeParameterNode[] | null; + parseTypeParameter(tn: Tokenizer): TypeParameterNode | null; + private parseParametersThis; + parseParameters(tn: Tokenizer, isConstructor?: bool): ParameterNode[] | null; + parseParameter(tn: Tokenizer, isConstructor?: bool): ParameterNode | null; + parseFunction(tn: Tokenizer, flags: CommonFlags, decorators: DecoratorNode[] | null, startPos: i32): FunctionDeclaration | null; + parseFunctionExpression(tn: Tokenizer): FunctionExpression | null; + private parseFunctionExpressionCommon; + parseClassOrInterface(tn: Tokenizer, flags: CommonFlags, decorators: DecoratorNode[] | null, startPos: i32): ClassDeclaration | null; + parseClassExpression(tn: Tokenizer): ClassExpression | null; + parseClassMember(tn: Tokenizer, parent: ClassDeclaration): DeclarationStatement | null; + parseIndexSignatureDeclaration(tn: Tokenizer, decorators: DecoratorNode[] | null): IndexSignatureDeclaration | null; + parseNamespace(tn: Tokenizer, flags: CommonFlags, decorators: DecoratorNode[] | null, startPos: i32): NamespaceDeclaration | null; + parseExport(tn: Tokenizer, startPos: i32, isDeclare: bool): ExportStatement | null; + parseExportMember(tn: Tokenizer): ExportMember | null; + parseExportDefaultAlias(tn: Tokenizer, startPos: i32, defaultStart: i32, defaultEnd: i32): ExportStatement; + parseImport(tn: Tokenizer): ImportStatement | null; + parseImportDeclaration(tn: Tokenizer): ImportDeclaration | null; + parseExportImport(tn: Tokenizer, startPos: i32): ExportImportStatement | null; + parseStatement(tn: Tokenizer, topLevel?: bool): Statement | null; + parseBlockStatement(tn: Tokenizer, topLevel: bool): BlockStatement | null; + parseBreak(tn: Tokenizer): BreakStatement | null; + parseContinue(tn: Tokenizer): ContinueStatement | null; + parseDoStatement(tn: Tokenizer): DoStatement | null; + parseExpressionStatement(tn: Tokenizer): ExpressionStatement | null; + parseForStatement(tn: Tokenizer): ForStatement | null; + parseIfStatement(tn: Tokenizer): IfStatement | null; + parseSwitchStatement(tn: Tokenizer): SwitchStatement | null; + parseSwitchCase(tn: Tokenizer): SwitchCase | null; + parseThrowStatement(tn: Tokenizer): ThrowStatement | null; + parseTryStatement(tn: Tokenizer): TryStatement | null; + parseTypeDeclaration(tn: Tokenizer, flags: CommonFlags, decorators: DecoratorNode[] | null, startPos: i32): TypeDeclaration | null; + parseVoidStatement(tn: Tokenizer): VoidStatement | null; + parseWhileStatement(tn: Tokenizer): WhileStatement | null; + parseExpressionStart(tn: Tokenizer): Expression | null; + tryParseTypeArgumentsBeforeArguments(tn: Tokenizer): CommonTypeNode[] | null; + parseArguments(tn: Tokenizer): Expression[] | null; + parseExpression(tn: Tokenizer, precedence?: Precedence): Expression | null; + private joinPropertyCall; + private maybeParseCallExpression; + /** Skips over a statement on errors in an attempt to reduce unnecessary diagnostic noise. */ + skipStatement(tn: Tokenizer): void; + /** Skips over a block on errors in an attempt to reduce unnecessary diagnostic noise. */ + skipBlock(tn: Tokenizer): void; + } + /** Operator precedence from least to largest. */ + export const enum Precedence { + NONE = 0, + COMMA = 1, + SPREAD = 2, + YIELD = 3, + ASSIGNMENT = 4, + CONDITIONAL = 5, + LOGICAL_OR = 6, + LOGICAL_AND = 7, + BITWISE_OR = 8, + BITWISE_XOR = 9, + BITWISE_AND = 10, + EQUALITY = 11, + RELATIONAL = 12, + SHIFT = 13, + ADDITIVE = 14, + MULTIPLICATIVE = 15, + EXPONENTIATED = 16, + UNARY_PREFIX = 17, + UNARY_POSTFIX = 18, + CALL = 19, + MEMBERACCESS = 20, + GROUPING = 21 + } + +} +declare module 'assemblyscript/src/index' { + /** + * Low-level C-like compiler API. + * @module index + */ /***/ + import { Target, Feature } from 'assemblyscript/src/common'; + import { Options } from 'assemblyscript/src/compiler'; + import { DiagnosticMessage, formatDiagnosticMessage } from 'assemblyscript/src/diagnostics'; + import { Module } from 'assemblyscript/src/module'; + import { Parser } from 'assemblyscript/src/parser'; + import { Program } from 'assemblyscript/src/program'; + /** Parses a source file. If `parser` has been omitted a new one is created. */ + export function parseFile(text: string, path: string, isEntry?: bool, parser?: Parser | null): Parser; + /** Obtains the next required file's path. Returns `null` once complete. */ + export function nextFile(parser: Parser): string | null; + /** Obtains the next diagnostic message. Returns `null` once complete. */ + export function nextDiagnostic(parser: Parser): DiagnosticMessage | null; + /** Formats a diagnostic message to a string. */ + export { formatDiagnosticMessage as formatDiagnostic }; + /** Tests whether a diagnostic is informatory. */ + export function isInfo(message: DiagnosticMessage): bool; + /** Tests whether a diagnostic is a warning. */ + export function isWarning(message: DiagnosticMessage): bool; + /** Tests whether a diagnostic is an error. */ + export function isError(message: DiagnosticMessage): bool; + /** Creates a new set of compiler options. */ + export function createOptions(): Options; + /** Sets the `target` option. */ + export function setTarget(options: Options, target: Target): void; + /** Sets the `noAssert` option. */ + export function setNoAssert(options: Options, noAssert: bool): void; + /** Sets the `importMemory` option. */ + export function setImportMemory(options: Options, importMemory: bool): void; + /** Sets the `sharedMemory` option. */ + export function setSharedMemory(options: Options, sharedMemory: i32): void; + /** Sets the `importTable` option. */ + export function setImportTable(options: Options, importTable: bool): void; + /** Sets the `sourceMap` option. */ + export function setSourceMap(options: Options, sourceMap: bool): void; + /** Sets the `memoryBase` option. */ + export function setMemoryBase(options: Options, memoryBase: u32): void; + /** Sets a 'globalAliases' value. */ + export function setGlobalAlias(options: Options, name: string, alias: string): void; + /** Sets the `explicitStart` option. */ + export function setExplicitStart(options: Options, explicitStart: bool): void; + /** Sign extension operations. */ + export const FEATURE_SIGN_EXTENSION: Feature; + /** Mutable global imports and exports. */ + export const FEATURE_MUTABLE_GLOBAL: Feature; + /** Bulk memory operations. */ + export const FEATURE_BULK_MEMORY: Feature; + /** SIMD types and operations. */ + export const FEATURE_SIMD: Feature; + /** Threading and atomic operations. */ + export const FEATURE_THREADS: Feature; + /** Enables a specific feature. */ + export function enableFeature(options: Options, feature: Feature): void; + /** Gives the compiler a hint at the optimize levels that will be used later on. */ + export function setOptimizeLevelHints(options: Options, optimizeLevel: i32, shrinkLevel: i32): void; + /** Finishes parsing. */ + export function finishParsing(parser: Parser): Program; + /** Compiles the sources computed by the parser to a module. */ + export function compileProgram(program: Program, options?: Options | null): Module; + /** Decompiles a module to its (low level) source. */ + export function decompileModule(module: Module): string; + /** Builds WebIDL definitions for the specified program. */ + export function buildIDL(program: Program): string; + /** Builds TypeScript definitions for the specified program. */ + export function buildTSD(program: Program): string; + /** Builds a JSON file of a program's runtime type information. */ + export function buildRTTI(program: Program): string; + /** Prefix indicating a library file. */ + export { LIBRARY_PREFIX } from 'assemblyscript/src/common'; + export * from 'assemblyscript/src/ast'; + export * from 'assemblyscript/src/common'; + export * from 'assemblyscript/src/compiler'; + export * from 'assemblyscript/src/decompiler'; + export * from 'assemblyscript/src/definitions'; + export * from 'assemblyscript/src/diagnosticMessages.generated'; + export * from 'assemblyscript/src/diagnostics'; + export * from 'assemblyscript/src/flow'; + export * from 'assemblyscript/src/module'; + export * from 'assemblyscript/src/parser'; + export * from 'assemblyscript/src/program'; + export * from 'assemblyscript/src/resolver'; + export * from 'assemblyscript/src/tokenizer'; + export * from 'assemblyscript/src/types'; + export * from 'assemblyscript/src/util'; + +} +declare module 'assemblyscript/src/extra/ast' { + /** + * Abstract Syntax Tree extras. + * + * Not needed in a standalone compiler but useful for testing the parser. + * + * @module extra/ast + */ /***/ + import { Node, Source, CommonTypeNode, TypeName, TypeParameterNode, SignatureNode, IdentifierExpression, LiteralExpression, FloatLiteralExpression, IntegerLiteralExpression, StringLiteralExpression, RegexpLiteralExpression, ArrayLiteralExpression, AssertionExpression, BinaryExpression, CallExpression, CommaExpression, ElementAccessExpression, FunctionExpression, NewExpression, ParenthesizedExpression, PropertyAccessExpression, TernaryExpression, UnaryPostfixExpression, UnaryExpression, UnaryPrefixExpression, ClassExpression, ObjectLiteralExpression, Statement, BlockStatement, BreakStatement, ContinueStatement, DoStatement, EmptyStatement, ExportImportStatement, ExportStatement, ExportDefaultStatement, ExpressionStatement, ForStatement, IfStatement, ImportStatement, InstanceOfExpression, ReturnStatement, SwitchStatement, ThrowStatement, TryStatement, VariableStatement, WhileStatement, ClassDeclaration, EnumDeclaration, EnumValueDeclaration, FieldDeclaration, FunctionDeclaration, ImportDeclaration, IndexSignatureDeclaration, InterfaceDeclaration, MethodDeclaration, NamespaceDeclaration, TypeDeclaration, VariableDeclaration, DecoratorNode, ParameterNode, ExportMember, SwitchCase, DeclarationStatement } from 'assemblyscript/src/ast'; + /** An AST builder. */ + export class ASTBuilder { + /** Rebuilds the textual source from the specified AST, as far as possible. */ + static build(node: Node): string; + private sb; + private indentLevel; + visitNode(node: Node): void; + visitSource(source: Source): void; + visitTypeNode(node: CommonTypeNode): void; + visitTypeName(node: TypeName): void; + visitTypeParameter(node: TypeParameterNode): void; + visitSignatureNode(node: SignatureNode): void; + visitIdentifierExpression(node: IdentifierExpression): void; + visitArrayLiteralExpression(node: ArrayLiteralExpression): void; + visitObjectLiteralExpression(node: ObjectLiteralExpression): void; + visitAssertionExpression(node: AssertionExpression): void; + visitBinaryExpression(node: BinaryExpression): void; + visitCallExpression(node: CallExpression): void; + visitClassExpression(node: ClassExpression): void; + visitCommaExpression(node: CommaExpression): void; + visitElementAccessExpression(node: ElementAccessExpression): void; + visitFunctionExpression(node: FunctionExpression): void; + visitLiteralExpression(node: LiteralExpression): void; + visitFloatLiteralExpression(node: FloatLiteralExpression): void; + visitInstanceOfExpression(node: InstanceOfExpression): void; + visitIntegerLiteralExpression(node: IntegerLiteralExpression): void; + visitStringLiteral(str: string, singleQuoted?: bool): void; + visitStringLiteralExpression(node: StringLiteralExpression): void; + visitRegexpLiteralExpression(node: RegexpLiteralExpression): void; + visitNewExpression(node: NewExpression): void; + visitParenthesizedExpression(node: ParenthesizedExpression): void; + visitPropertyAccessExpression(node: PropertyAccessExpression): void; + visitTernaryExpression(node: TernaryExpression): void; + visitUnaryExpression(node: UnaryExpression): void; + visitUnaryPostfixExpression(node: UnaryPostfixExpression): void; + visitUnaryPrefixExpression(node: UnaryPrefixExpression): void; + visitNodeAndTerminate(statement: Statement): void; + visitBlockStatement(node: BlockStatement): void; + visitBreakStatement(node: BreakStatement): void; + visitContinueStatement(node: ContinueStatement): void; + visitClassDeclaration(node: ClassDeclaration, isDefault?: bool): void; + visitDoStatement(node: DoStatement): void; + visitEmptyStatement(node: EmptyStatement): void; + visitEnumDeclaration(node: EnumDeclaration, isDefault?: bool): void; + visitEnumValueDeclaration(node: EnumValueDeclaration): void; + visitExportImportStatement(node: ExportImportStatement): void; + visitExportMember(node: ExportMember): void; + visitExportStatement(node: ExportStatement): void; + visitExportDefaultStatement(node: ExportDefaultStatement): void; + visitExpressionStatement(node: ExpressionStatement): void; + visitFieldDeclaration(node: FieldDeclaration): void; + visitForStatement(node: ForStatement): void; + visitFunctionDeclaration(node: FunctionDeclaration, isDefault?: bool): void; + visitFunctionCommon(node: FunctionDeclaration): void; + visitIfStatement(node: IfStatement): void; + visitImportDeclaration(node: ImportDeclaration): void; + visitImportStatement(node: ImportStatement): void; + visitIndexSignatureDeclaration(node: IndexSignatureDeclaration): void; + visitInterfaceDeclaration(node: InterfaceDeclaration, isDefault?: bool): void; + visitMethodDeclaration(node: MethodDeclaration): void; + visitNamespaceDeclaration(node: NamespaceDeclaration, isDefault?: bool): void; + visitReturnStatement(node: ReturnStatement): void; + visitSwitchCase(node: SwitchCase): void; + visitSwitchStatement(node: SwitchStatement): void; + visitThrowStatement(node: ThrowStatement): void; + visitTryStatement(node: TryStatement): void; + visitTypeDeclaration(node: TypeDeclaration): void; + visitVariableDeclaration(node: VariableDeclaration): void; + visitVariableStatement(node: VariableStatement): void; + visitWhileStatement(node: WhileStatement): void; + serializeDecorator(node: DecoratorNode): void; + serializeParameter(node: ParameterNode): void; + serializeExternalModifiers(node: DeclarationStatement): void; + serializeAccessModifiers(node: DeclarationStatement): void; + finish(): string; + } + +} +/** + * TypeScript definitions for Binaryen's C-API. + * + * See: https://github.com/WebAssembly/binaryen/blob/master/src/binaryen-c.h + * + * @module glue/binaryen + *//***/ + +declare function _malloc(size: usize): usize; +declare function _free(ptr: usize): void; + +declare type BinaryenIndex = u32; + +declare type BinaryenType = i32; + +declare function _BinaryenTypeNone(): BinaryenType; +declare function _BinaryenTypeInt32(): BinaryenType; +declare function _BinaryenTypeInt64(): BinaryenType; +declare function _BinaryenTypeFloat32(): BinaryenType; +declare function _BinaryenTypeFloat64(): BinaryenType; +declare function _BinaryenTypeVec128(): BinaryenType; +declare function _BinaryenTypeUnreachable(): BinaryenType; +declare function _BinaryenTypeAuto(): BinaryenType; + +declare type BinaryenFeatureFlags = u32; + +declare function _BinaryenFeatureAtomics(): BinaryenFeatureFlags; +declare function _BinaryenFeatureMutableGlobals(): BinaryenFeatureFlags; +declare function _BinaryenFeatureNontrappingFPToInt(): BinaryenFeatureFlags; +declare function _BinaryenFeatureSIMD128(): BinaryenFeatureFlags; +declare function _BinaryenFeatureBulkMemory(): BinaryenFeatureFlags; +declare function _BinaryenFeatureSignExt(): BinaryenFeatureFlags; +declare function _BinaryenFeatureExceptionHandling(): BinaryenFeatureFlags; + +declare type BinaryenExpressionId = i32; + +declare function _BinaryenInvalidId(): BinaryenExpressionId; +declare function _BinaryenBlockId(): BinaryenExpressionId; +declare function _BinaryenIfId(): BinaryenExpressionId; +declare function _BinaryenLoopId(): BinaryenExpressionId; +declare function _BinaryenBreakId(): BinaryenExpressionId; +declare function _BinaryenSwitchId(): BinaryenExpressionId; +declare function _BinaryenCallId(): BinaryenExpressionId; +declare function _BinaryenCallIndirectId(): BinaryenExpressionId; +declare function _BinaryenLocalGetId(): BinaryenExpressionId; +declare function _BinaryenLocalSetId(): BinaryenExpressionId; +declare function _BinaryenGlobalGetId(): BinaryenExpressionId; +declare function _BinaryenGlobalSetId(): BinaryenExpressionId; +declare function _BinaryenLoadId(): BinaryenExpressionId; +declare function _BinaryenStoreId(): BinaryenExpressionId; +declare function _BinaryenConstId(): BinaryenExpressionId; +declare function _BinaryenUnaryId(): BinaryenExpressionId; +declare function _BinaryenBinaryId(): BinaryenExpressionId; +declare function _BinaryenSelectId(): BinaryenExpressionId; +declare function _BinaryenDropId(): BinaryenExpressionId; +declare function _BinaryenReturnId(): BinaryenExpressionId; +declare function _BinaryenHostId(): BinaryenExpressionId; +declare function _BinaryenNopId(): BinaryenExpressionId; +declare function _BinaryenUnreachableId(): BinaryenExpressionId; +declare function _BinaryenAtomicCmpxchgId(): BinaryenExpressionId; +declare function _BinaryenAtomicRMWId(): BinaryenExpressionId; +declare function _BinaryenAtomicWaitId(): BinaryenExpressionId; +declare function _BinaryenAtomicNotifyId(): BinaryenExpressionId; +declare function _BinaryenSIMDExtractId(): BinaryenExpressionId; +declare function _BinaryenSIMDReplaceId(): BinaryenExpressionId; +declare function _BinaryenSIMDShuffleId(): BinaryenExpressionId; +declare function _BinaryenSIMDBitselectId(): BinaryenExpressionId; +declare function _BinaryenSIMDShiftId(): BinaryenExpressionId; +declare function _BinaryenMemoryInitId(): BinaryenExpressionId; +declare function _BinaryenDataDropId(): BinaryenExpressionId; +declare function _BinaryenMemoryCopyId(): BinaryenExpressionId; +declare function _BinaryenMemoryFillId(): BinaryenExpressionId; + +declare type BinaryenModuleRef = usize; +declare type v128ptr = usize; // TODO: LLVM C-abi for const uint8_t[16]? + +declare function _BinaryenModuleCreate(): BinaryenModuleRef; +declare function _BinaryenModuleDispose(module: BinaryenModuleRef): void; + +// LLVM C ABI with `out` being a large enough buffer receiving the +// BinaryenLiteral struct of size `_BinaryenSizeofLiteral()`. +declare function _BinaryenSizeofLiteral(): usize; +declare function _BinaryenLiteralInt32(out: usize, x: i32): void; +declare function _BinaryenLiteralInt64(out: usize, x: i32, y: i32): void; +declare function _BinaryenLiteralFloat32(out: usize, x: f32): void; +declare function _BinaryenLiteralFloat64(out: usize, x: f64): void; +declare function _BinaryenLiteralVec128(out: usize, x: v128ptr): void; +declare function _BinaryenLiteralFloat32Bits(out: usize, x: i32): void; +declare function _BinaryenLiteralFloat64Bits(out: usize, x: i32, y: i32): void; + +declare type BinaryenOp = i32; + +declare function _BinaryenClzInt32(): BinaryenOp; +declare function _BinaryenCtzInt32(): BinaryenOp; +declare function _BinaryenPopcntInt32(): BinaryenOp; +declare function _BinaryenNegFloat32(): BinaryenOp; +declare function _BinaryenAbsFloat32(): BinaryenOp; +declare function _BinaryenCeilFloat32(): BinaryenOp; +declare function _BinaryenFloorFloat32(): BinaryenOp; +declare function _BinaryenTruncFloat32(): BinaryenOp; +declare function _BinaryenNearestFloat32(): BinaryenOp; +declare function _BinaryenSqrtFloat32(): BinaryenOp; +declare function _BinaryenEqZInt32(): BinaryenOp; +declare function _BinaryenClzInt64(): BinaryenOp; +declare function _BinaryenCtzInt64(): BinaryenOp; +declare function _BinaryenPopcntInt64(): BinaryenOp; +declare function _BinaryenNegFloat64(): BinaryenOp; +declare function _BinaryenAbsFloat64(): BinaryenOp; +declare function _BinaryenCeilFloat64(): BinaryenOp; +declare function _BinaryenFloorFloat64(): BinaryenOp; +declare function _BinaryenTruncFloat64(): BinaryenOp; +declare function _BinaryenNearestFloat64(): BinaryenOp; +declare function _BinaryenSqrtFloat64(): BinaryenOp; +declare function _BinaryenEqZInt64(): BinaryenOp; +declare function _BinaryenExtendSInt32(): BinaryenOp; +declare function _BinaryenExtendUInt32(): BinaryenOp; +declare function _BinaryenWrapInt64(): BinaryenOp; +declare function _BinaryenTruncSFloat32ToInt32(): BinaryenOp; +declare function _BinaryenTruncSFloat32ToInt64(): BinaryenOp; +declare function _BinaryenTruncUFloat32ToInt32(): BinaryenOp; +declare function _BinaryenTruncUFloat32ToInt64(): BinaryenOp; +declare function _BinaryenTruncSFloat64ToInt32(): BinaryenOp; +declare function _BinaryenTruncSFloat64ToInt64(): BinaryenOp; +declare function _BinaryenTruncUFloat64ToInt32(): BinaryenOp; +declare function _BinaryenTruncUFloat64ToInt64(): BinaryenOp; +declare function _BinaryenReinterpretFloat32(): BinaryenOp; +declare function _BinaryenReinterpretFloat64(): BinaryenOp; +declare function _BinaryenConvertSInt32ToFloat32(): BinaryenOp; +declare function _BinaryenConvertSInt32ToFloat64(): BinaryenOp; +declare function _BinaryenConvertUInt32ToFloat32(): BinaryenOp; +declare function _BinaryenConvertUInt32ToFloat64(): BinaryenOp; +declare function _BinaryenConvertSInt64ToFloat32(): BinaryenOp; +declare function _BinaryenConvertSInt64ToFloat64(): BinaryenOp; +declare function _BinaryenConvertUInt64ToFloat32(): BinaryenOp; +declare function _BinaryenConvertUInt64ToFloat64(): BinaryenOp; +declare function _BinaryenPromoteFloat32(): BinaryenOp; +declare function _BinaryenDemoteFloat64(): BinaryenOp; +declare function _BinaryenReinterpretInt32(): BinaryenOp; +declare function _BinaryenReinterpretInt64(): BinaryenOp; +declare function _BinaryenExtendS8Int32(): BinaryenOp; +declare function _BinaryenExtendS16Int32(): BinaryenOp; +declare function _BinaryenExtendS8Int64(): BinaryenOp; +declare function _BinaryenExtendS16Int64(): BinaryenOp; +declare function _BinaryenExtendS32Int64(): BinaryenOp; +declare function _BinaryenAddInt32(): BinaryenOp; +declare function _BinaryenSubInt32(): BinaryenOp; +declare function _BinaryenMulInt32(): BinaryenOp; +declare function _BinaryenDivSInt32(): BinaryenOp; +declare function _BinaryenDivUInt32(): BinaryenOp; +declare function _BinaryenRemSInt32(): BinaryenOp; +declare function _BinaryenRemUInt32(): BinaryenOp; +declare function _BinaryenAndInt32(): BinaryenOp; +declare function _BinaryenOrInt32(): BinaryenOp; +declare function _BinaryenXorInt32(): BinaryenOp; +declare function _BinaryenShlInt32(): BinaryenOp; +declare function _BinaryenShrUInt32(): BinaryenOp; +declare function _BinaryenShrSInt32(): BinaryenOp; +declare function _BinaryenRotLInt32(): BinaryenOp; +declare function _BinaryenRotRInt32(): BinaryenOp; +declare function _BinaryenEqInt32(): BinaryenOp; +declare function _BinaryenNeInt32(): BinaryenOp; +declare function _BinaryenLtSInt32(): BinaryenOp; +declare function _BinaryenLtUInt32(): BinaryenOp; +declare function _BinaryenLeSInt32(): BinaryenOp; +declare function _BinaryenLeUInt32(): BinaryenOp; +declare function _BinaryenGtSInt32(): BinaryenOp; +declare function _BinaryenGtUInt32(): BinaryenOp; +declare function _BinaryenGeSInt32(): BinaryenOp; +declare function _BinaryenGeUInt32(): BinaryenOp; +declare function _BinaryenAddInt64(): BinaryenOp; +declare function _BinaryenSubInt64(): BinaryenOp; +declare function _BinaryenMulInt64(): BinaryenOp; +declare function _BinaryenDivSInt64(): BinaryenOp; +declare function _BinaryenDivUInt64(): BinaryenOp; +declare function _BinaryenRemSInt64(): BinaryenOp; +declare function _BinaryenRemUInt64(): BinaryenOp; +declare function _BinaryenAndInt64(): BinaryenOp; +declare function _BinaryenOrInt64(): BinaryenOp; +declare function _BinaryenXorInt64(): BinaryenOp; +declare function _BinaryenShlInt64(): BinaryenOp; +declare function _BinaryenShrUInt64(): BinaryenOp; +declare function _BinaryenShrSInt64(): BinaryenOp; +declare function _BinaryenRotLInt64(): BinaryenOp; +declare function _BinaryenRotRInt64(): BinaryenOp; +declare function _BinaryenEqInt64(): BinaryenOp; +declare function _BinaryenNeInt64(): BinaryenOp; +declare function _BinaryenLtSInt64(): BinaryenOp; +declare function _BinaryenLtUInt64(): BinaryenOp; +declare function _BinaryenLeSInt64(): BinaryenOp; +declare function _BinaryenLeUInt64(): BinaryenOp; +declare function _BinaryenGtSInt64(): BinaryenOp; +declare function _BinaryenGtUInt64(): BinaryenOp; +declare function _BinaryenGeSInt64(): BinaryenOp; +declare function _BinaryenGeUInt64(): BinaryenOp; +declare function _BinaryenAddFloat32(): BinaryenOp; +declare function _BinaryenSubFloat32(): BinaryenOp; +declare function _BinaryenMulFloat32(): BinaryenOp; +declare function _BinaryenDivFloat32(): BinaryenOp; +declare function _BinaryenCopySignFloat32(): BinaryenOp; +declare function _BinaryenMinFloat32(): BinaryenOp; +declare function _BinaryenMaxFloat32(): BinaryenOp; +declare function _BinaryenEqFloat32(): BinaryenOp; +declare function _BinaryenNeFloat32(): BinaryenOp; +declare function _BinaryenLtFloat32(): BinaryenOp; +declare function _BinaryenLeFloat32(): BinaryenOp; +declare function _BinaryenGtFloat32(): BinaryenOp; +declare function _BinaryenGeFloat32(): BinaryenOp; +declare function _BinaryenAddFloat64(): BinaryenOp; +declare function _BinaryenSubFloat64(): BinaryenOp; +declare function _BinaryenMulFloat64(): BinaryenOp; +declare function _BinaryenDivFloat64(): BinaryenOp; +declare function _BinaryenCopySignFloat64(): BinaryenOp; +declare function _BinaryenMinFloat64(): BinaryenOp; +declare function _BinaryenMaxFloat64(): BinaryenOp; +declare function _BinaryenEqFloat64(): BinaryenOp; +declare function _BinaryenNeFloat64(): BinaryenOp; +declare function _BinaryenLtFloat64(): BinaryenOp; +declare function _BinaryenLeFloat64(): BinaryenOp; +declare function _BinaryenGtFloat64(): BinaryenOp; +declare function _BinaryenGeFloat64(): BinaryenOp; + +declare type BinaryenHostOp = BinaryenOp; + +declare function _BinaryenMemorySize(): BinaryenHostOp; +declare function _BinaryenMemoryGrow(): BinaryenHostOp; + +declare type BinaryenAtomicRMWOp = BinaryenOp; + +declare function _BinaryenAtomicRMWAdd(): BinaryenAtomicRMWOp; +declare function _BinaryenAtomicRMWSub(): BinaryenAtomicRMWOp; +declare function _BinaryenAtomicRMWAnd(): BinaryenAtomicRMWOp; +declare function _BinaryenAtomicRMWOr(): BinaryenAtomicRMWOp; +declare function _BinaryenAtomicRMWXor(): BinaryenAtomicRMWOp; +declare function _BinaryenAtomicRMWXchg(): BinaryenAtomicRMWOp; + +declare type BinaryenSIMDOp = BinaryenOp; + +declare function _BinaryenSplatVecI8x16(): BinaryenSIMDOp; +declare function _BinaryenExtractLaneSVecI8x16(): BinaryenSIMDOp; +declare function _BinaryenExtractLaneUVecI8x16(): BinaryenSIMDOp; +declare function _BinaryenReplaceLaneVecI8x16(): BinaryenSIMDOp; +declare function _BinaryenSplatVecI16x8(): BinaryenSIMDOp; +declare function _BinaryenExtractLaneSVecI16x8(): BinaryenSIMDOp; +declare function _BinaryenExtractLaneUVecI16x8(): BinaryenSIMDOp; +declare function _BinaryenReplaceLaneVecI16x8(): BinaryenSIMDOp; +declare function _BinaryenSplatVecI32x4(): BinaryenSIMDOp; +declare function _BinaryenExtractLaneVecI32x4(): BinaryenSIMDOp; +declare function _BinaryenReplaceLaneVecI32x4(): BinaryenSIMDOp; +declare function _BinaryenSplatVecI64x2(): BinaryenSIMDOp; +declare function _BinaryenExtractLaneVecI64x2(): BinaryenSIMDOp; +declare function _BinaryenReplaceLaneVecI64x2(): BinaryenSIMDOp; +declare function _BinaryenSplatVecF32x4(): BinaryenSIMDOp; +declare function _BinaryenExtractLaneVecF32x4(): BinaryenSIMDOp; +declare function _BinaryenReplaceLaneVecF32x4(): BinaryenSIMDOp; +declare function _BinaryenSplatVecF64x2(): BinaryenSIMDOp; +declare function _BinaryenExtractLaneVecF64x2(): BinaryenSIMDOp; +declare function _BinaryenReplaceLaneVecF64x2(): BinaryenSIMDOp; +declare function _BinaryenEqVecI8x16(): BinaryenSIMDOp; +declare function _BinaryenNeVecI8x16(): BinaryenSIMDOp; +declare function _BinaryenLtSVecI8x16(): BinaryenSIMDOp; +declare function _BinaryenLtUVecI8x16(): BinaryenSIMDOp; +declare function _BinaryenGtSVecI8x16(): BinaryenSIMDOp; +declare function _BinaryenGtUVecI8x16(): BinaryenSIMDOp; +declare function _BinaryenLeSVecI8x16(): BinaryenSIMDOp; +declare function _BinaryenLeUVecI8x16(): BinaryenSIMDOp; +declare function _BinaryenGeSVecI8x16(): BinaryenSIMDOp; +declare function _BinaryenGeUVecI8x16(): BinaryenSIMDOp; +declare function _BinaryenEqVecI16x8(): BinaryenSIMDOp; +declare function _BinaryenNeVecI16x8(): BinaryenSIMDOp; +declare function _BinaryenLtSVecI16x8(): BinaryenSIMDOp; +declare function _BinaryenLtUVecI16x8(): BinaryenSIMDOp; +declare function _BinaryenGtSVecI16x8(): BinaryenSIMDOp; +declare function _BinaryenGtUVecI16x8(): BinaryenSIMDOp; +declare function _BinaryenLeSVecI16x8(): BinaryenSIMDOp; +declare function _BinaryenLeUVecI16x8(): BinaryenSIMDOp; +declare function _BinaryenGeSVecI16x8(): BinaryenSIMDOp; +declare function _BinaryenGeUVecI16x8(): BinaryenSIMDOp; +declare function _BinaryenEqVecI32x4(): BinaryenSIMDOp; +declare function _BinaryenNeVecI32x4(): BinaryenSIMDOp; +declare function _BinaryenLtSVecI32x4(): BinaryenSIMDOp; +declare function _BinaryenLtUVecI32x4(): BinaryenSIMDOp; +declare function _BinaryenGtSVecI32x4(): BinaryenSIMDOp; +declare function _BinaryenGtUVecI32x4(): BinaryenSIMDOp; +declare function _BinaryenLeSVecI32x4(): BinaryenSIMDOp; +declare function _BinaryenLeUVecI32x4(): BinaryenSIMDOp; +declare function _BinaryenGeSVecI32x4(): BinaryenSIMDOp; +declare function _BinaryenGeUVecI32x4(): BinaryenSIMDOp; +declare function _BinaryenEqVecF32x4(): BinaryenSIMDOp; +declare function _BinaryenNeVecF32x4(): BinaryenSIMDOp; +declare function _BinaryenLtVecF32x4(): BinaryenSIMDOp; +declare function _BinaryenGtVecF32x4(): BinaryenSIMDOp; +declare function _BinaryenLeVecF32x4(): BinaryenSIMDOp; +declare function _BinaryenGeVecF32x4(): BinaryenSIMDOp; +declare function _BinaryenEqVecF64x2(): BinaryenSIMDOp; +declare function _BinaryenNeVecF64x2(): BinaryenSIMDOp; +declare function _BinaryenLtVecF64x2(): BinaryenSIMDOp; +declare function _BinaryenGtVecF64x2(): BinaryenSIMDOp; +declare function _BinaryenLeVecF64x2(): BinaryenSIMDOp; +declare function _BinaryenGeVecF64x2(): BinaryenSIMDOp; +declare function _BinaryenNotVec128(): BinaryenSIMDOp; +declare function _BinaryenAndVec128(): BinaryenSIMDOp; +declare function _BinaryenOrVec128(): BinaryenSIMDOp; +declare function _BinaryenXorVec128(): BinaryenSIMDOp; +declare function _BinaryenNegVecI8x16(): BinaryenSIMDOp; +declare function _BinaryenAnyTrueVecI8x16(): BinaryenSIMDOp; +declare function _BinaryenAllTrueVecI8x16(): BinaryenSIMDOp; +declare function _BinaryenShlVecI8x16(): BinaryenSIMDOp; +declare function _BinaryenShrSVecI8x16(): BinaryenSIMDOp; +declare function _BinaryenShrUVecI8x16(): BinaryenSIMDOp; +declare function _BinaryenAddVecI8x16(): BinaryenSIMDOp; +declare function _BinaryenAddSatSVecI8x16(): BinaryenSIMDOp; +declare function _BinaryenAddSatUVecI8x16(): BinaryenSIMDOp; +declare function _BinaryenSubVecI8x16(): BinaryenSIMDOp; +declare function _BinaryenSubSatSVecI8x16(): BinaryenSIMDOp; +declare function _BinaryenSubSatUVecI8x16(): BinaryenSIMDOp; +declare function _BinaryenMulVecI8x16(): BinaryenSIMDOp; +declare function _BinaryenNegVecI16x8(): BinaryenSIMDOp; +declare function _BinaryenAnyTrueVecI16x8(): BinaryenSIMDOp; +declare function _BinaryenAllTrueVecI16x8(): BinaryenSIMDOp; +declare function _BinaryenShlVecI16x8(): BinaryenSIMDOp; +declare function _BinaryenShrSVecI16x8(): BinaryenSIMDOp; +declare function _BinaryenShrUVecI16x8(): BinaryenSIMDOp; +declare function _BinaryenAddVecI16x8(): BinaryenSIMDOp; +declare function _BinaryenAddSatSVecI16x8(): BinaryenSIMDOp; +declare function _BinaryenAddSatUVecI16x8(): BinaryenSIMDOp; +declare function _BinaryenSubVecI16x8(): BinaryenSIMDOp; +declare function _BinaryenSubSatSVecI16x8(): BinaryenSIMDOp; +declare function _BinaryenSubSatUVecI16x8(): BinaryenSIMDOp; +declare function _BinaryenMulVecI16x8(): BinaryenSIMDOp; +declare function _BinaryenNegVecI32x4(): BinaryenSIMDOp; +declare function _BinaryenAnyTrueVecI32x4(): BinaryenSIMDOp; +declare function _BinaryenAllTrueVecI32x4(): BinaryenSIMDOp; +declare function _BinaryenShlVecI32x4(): BinaryenSIMDOp; +declare function _BinaryenShrSVecI32x4(): BinaryenSIMDOp; +declare function _BinaryenShrUVecI32x4(): BinaryenSIMDOp; +declare function _BinaryenAddVecI32x4(): BinaryenSIMDOp; +declare function _BinaryenSubVecI32x4(): BinaryenSIMDOp; +declare function _BinaryenMulVecI32x4(): BinaryenSIMDOp; +declare function _BinaryenNegVecI64x2(): BinaryenSIMDOp; +declare function _BinaryenAnyTrueVecI64x2(): BinaryenSIMDOp; +declare function _BinaryenAllTrueVecI64x2(): BinaryenSIMDOp; +declare function _BinaryenShlVecI64x2(): BinaryenSIMDOp; +declare function _BinaryenShrSVecI64x2(): BinaryenSIMDOp; +declare function _BinaryenShrUVecI64x2(): BinaryenSIMDOp; +declare function _BinaryenAddVecI64x2(): BinaryenSIMDOp; +declare function _BinaryenSubVecI64x2(): BinaryenSIMDOp; +declare function _BinaryenAbsVecF32x4(): BinaryenSIMDOp; +declare function _BinaryenNegVecF32x4(): BinaryenSIMDOp; +declare function _BinaryenSqrtVecF32x4(): BinaryenSIMDOp; +declare function _BinaryenAddVecF32x4(): BinaryenSIMDOp; +declare function _BinaryenSubVecF32x4(): BinaryenSIMDOp; +declare function _BinaryenMulVecF32x4(): BinaryenSIMDOp; +declare function _BinaryenDivVecF32x4(): BinaryenSIMDOp; +declare function _BinaryenMinVecF32x4(): BinaryenSIMDOp; +declare function _BinaryenMaxVecF32x4(): BinaryenSIMDOp; +declare function _BinaryenAbsVecF64x2(): BinaryenSIMDOp; +declare function _BinaryenNegVecF64x2(): BinaryenSIMDOp; +declare function _BinaryenSqrtVecF64x2(): BinaryenSIMDOp; +declare function _BinaryenAddVecF64x2(): BinaryenSIMDOp; +declare function _BinaryenSubVecF64x2(): BinaryenSIMDOp; +declare function _BinaryenMulVecF64x2(): BinaryenSIMDOp; +declare function _BinaryenDivVecF64x2(): BinaryenSIMDOp; +declare function _BinaryenMinVecF64x2(): BinaryenSIMDOp; +declare function _BinaryenMaxVecF64x2(): BinaryenSIMDOp; +declare function _BinaryenTruncSatSVecF32x4ToVecI32x4(): BinaryenSIMDOp; +declare function _BinaryenTruncSatUVecF32x4ToVecI32x4(): BinaryenSIMDOp; +declare function _BinaryenTruncSatSVecF64x2ToVecI64x2(): BinaryenSIMDOp; +declare function _BinaryenTruncSatUVecF64x2ToVecI64x2(): BinaryenSIMDOp; +declare function _BinaryenConvertSVecI32x4ToVecF32x4(): BinaryenSIMDOp; +declare function _BinaryenConvertUVecI32x4ToVecF32x4(): BinaryenSIMDOp; +declare function _BinaryenConvertSVecI64x2ToVecF64x2(): BinaryenSIMDOp; +declare function _BinaryenConvertUVecI64x2ToVecF64x2(): BinaryenSIMDOp; + +declare type BinaryenExpressionRef = usize; + +declare function _BinaryenBlock(module: BinaryenModuleRef, name: usize, children: usize, numChildren: BinaryenIndex, type: BinaryenType): BinaryenExpressionRef; +declare function _BinaryenIf(module: BinaryenModuleRef, condition: BinaryenExpressionRef, ifTrue: BinaryenExpressionRef, ifFalse: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenLoop(module: BinaryenModuleRef, name: usize, body: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenBreak(module: BinaryenModuleRef, name: usize, condition: BinaryenExpressionRef, value: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenSwitch(module: BinaryenModuleRef, names: usize, numNames: BinaryenIndex, defaultName: usize, condition: BinaryenExpressionRef, value: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenCall(module: BinaryenModuleRef, target: usize, operands: usize, numOperands: BinaryenIndex, returnType: BinaryenType): BinaryenExpressionRef; +declare function _BinaryenCallIndirect(module: BinaryenModuleRef, target: BinaryenExpressionRef, operands: usize, numOperands: BinaryenIndex, type: usize): BinaryenExpressionRef; +declare function _BinaryenLocalGet(module: BinaryenModuleRef, index: BinaryenIndex, type: BinaryenType): BinaryenExpressionRef; +declare function _BinaryenLocalSet(module: BinaryenModuleRef, index: BinaryenIndex, value: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenLocalTee(module: BinaryenModuleRef, index: BinaryenIndex, value: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenGlobalGet(module: BinaryenModuleRef, name: usize, type: BinaryenType): BinaryenExpressionRef; +declare function _BinaryenGlobalSet(module: BinaryenModuleRef, name: usize, value: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenLoad(module: BinaryenModuleRef, bytes: u32, signed: i8, offset: u32, align: u32, type: BinaryenType, ptr: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenStore(module: BinaryenModuleRef, bytes: u32, offset: u32, align: u32, ptr: BinaryenExpressionRef, value: BinaryenExpressionRef, type: BinaryenType): BinaryenExpressionRef; +declare function _BinaryenConst(module: BinaryenModuleRef, value: usize): BinaryenExpressionRef; +declare function _BinaryenUnary(module: BinaryenModuleRef, op: BinaryenOp, value: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenBinary(module: BinaryenModuleRef, op: BinaryenOp, left: BinaryenExpressionRef, right: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenSelect(module: BinaryenModuleRef, condition: BinaryenExpressionRef, ifTrue: BinaryenExpressionRef, ifFalse: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenDrop(module: BinaryenModuleRef, value: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenReturn(module: BinaryenModuleRef, value: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenHost(module: BinaryenModuleRef, op: BinaryenOp, name: usize | 0, operands: usize, numOperands: BinaryenIndex): BinaryenExpressionRef; +declare function _BinaryenNop(module: BinaryenModuleRef): BinaryenExpressionRef; +declare function _BinaryenUnreachable(module: BinaryenModuleRef): BinaryenExpressionRef; + +declare function _BinaryenAtomicLoad(module: BinaryenModuleRef, bytes: BinaryenIndex, offset: BinaryenIndex, type: BinaryenType, ptr: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenAtomicStore(module: BinaryenModuleRef, bytes: BinaryenIndex, offset: BinaryenIndex, ptr: BinaryenExpressionRef, value: BinaryenExpressionRef, type: BinaryenType): BinaryenExpressionRef; +declare function _BinaryenAtomicRMW(module: BinaryenModuleRef, op: BinaryenAtomicRMWOp, bytes: i32, offset: i32, ptr: BinaryenExpressionRef, value: BinaryenExpressionRef, type: BinaryenType): BinaryenExpressionRef; +declare function _BinaryenAtomicCmpxchg(module: BinaryenModuleRef, bytes: i32, offset: i32, ptr: BinaryenExpressionRef, expected: BinaryenExpressionRef, replacement: BinaryenExpressionRef, type: BinaryenType): BinaryenExpressionRef; +declare function _BinaryenAtomicWait(module: BinaryenModuleRef, ptr: BinaryenExpressionRef, expected: BinaryenExpressionRef, timeout: BinaryenExpressionRef, expectedType: BinaryenType): BinaryenExpressionRef; +declare function _BinaryenAtomicNotify(module: BinaryenModuleRef, ptr: BinaryenExpressionRef, notifyCount: BinaryenExpressionRef): BinaryenExpressionRef; + +declare function _BinaryenSIMDExtract(module: BinaryenModuleRef, op: BinaryenSIMDOp, vec: BinaryenExpressionRef, idx: u8): BinaryenExpressionRef; +declare function _BinaryenSIMDReplace(module: BinaryenModuleRef, op: BinaryenSIMDOp, vec: BinaryenExpressionRef, idx: u8, value: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenSIMDShuffle(module: BinaryenModuleRef, left: BinaryenExpressionRef, right: BinaryenExpressionRef, mask: v128ptr): BinaryenExpressionRef; +declare function _BinaryenSIMDBitselect(module: BinaryenModuleRef, left: BinaryenExpressionRef, right: BinaryenExpressionRef, cond: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenSIMDShift(module: BinaryenModuleRef, op: BinaryenSIMDOp, vec: BinaryenExpressionRef, shift: BinaryenExpressionRef): BinaryenExpressionRef; + +declare function _BinaryenMemoryInit(module: BinaryenModuleRef, segment: u32, dest: BinaryenExpressionRef, offset: BinaryenExpressionRef, size: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenDataDrop(module: BinaryenModuleRef, segment: u32): BinaryenExpressionRef; +declare function _BinaryenMemoryCopy(module: BinaryenModuleRef, dest: BinaryenExpressionRef, source: BinaryenExpressionRef, size: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenMemoryFill(module: BinaryenModuleRef, dest: BinaryenExpressionRef, value: BinaryenExpressionRef, size: BinaryenExpressionRef): BinaryenExpressionRef; + +declare function _BinaryenExpressionGetId(expr: BinaryenExpressionRef): BinaryenExpressionId; +declare function _BinaryenExpressionGetType(expr: BinaryenExpressionRef): BinaryenType; +declare function _BinaryenExpressionPrint(expr: BinaryenExpressionRef): void; + +declare function _BinaryenBlockGetName(expr: BinaryenExpressionRef): usize; +declare function _BinaryenBlockGetNumChildren(expr: BinaryenExpressionRef): BinaryenIndex; +declare function _BinaryenBlockGetChild(expr: BinaryenExpressionRef, index: BinaryenIndex): BinaryenExpressionRef; + +declare function _BinaryenIfGetCondition(expr: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenIfGetIfTrue(expr: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenIfGetIfFalse(expr: BinaryenExpressionRef): BinaryenExpressionRef; + +declare function _BinaryenLoopGetName(expr: BinaryenExpressionRef): usize; +declare function _BinaryenLoopGetBody(expr: BinaryenExpressionRef): BinaryenExpressionRef; + +declare function _BinaryenBreakGetName(expr: BinaryenExpressionRef): usize; +declare function _BinaryenBreakGetCondition(expr: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenBreakGetValue(expr: BinaryenExpressionRef): BinaryenExpressionRef; + +declare function _BinaryenSwitchGetNumNames(expr: BinaryenExpressionRef): BinaryenIndex; +declare function _BinaryenSwitchGetName(expr: BinaryenExpressionRef, index: BinaryenIndex): usize; +declare function _BinaryenSwitchGetDefaultName(expr: BinaryenExpressionRef): usize; +declare function _BinaryenSwitchGetCondition(expr: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenSwitchGetValue(expr: BinaryenExpressionRef): BinaryenExpressionRef; + +declare function _BinaryenCallGetTarget(expr: BinaryenExpressionRef): usize; +declare function _BinaryenCallGetNumOperands(expr: BinaryenExpressionRef): BinaryenIndex; +declare function _BinaryenCallGetOperand(expr: BinaryenExpressionRef, index: BinaryenIndex): BinaryenExpressionRef; + +declare function _BinaryenCallIndirectGetTarget(expr: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenCallIndirectGetNumOperands(expr: BinaryenExpressionRef): BinaryenIndex; +declare function _BinaryenCallIndirectGetOperand(expr: BinaryenExpressionRef, index: BinaryenIndex): BinaryenExpressionRef; + +declare function _BinaryenLocalGetGetIndex(expr: BinaryenExpressionRef): BinaryenIndex; + +declare function _BinaryenLocalSetIsTee(expr: BinaryenExpressionRef): bool; +declare function _BinaryenLocalSetGetIndex(expr: BinaryenExpressionRef): BinaryenIndex; +declare function _BinaryenLocalSetGetValue(expr: BinaryenExpressionRef): BinaryenExpressionRef; + +declare function _BinaryenGlobalGetGetName(expr: BinaryenExpressionRef): usize; + +declare function _BinaryenGlobalSetGetName(expr: BinaryenExpressionRef): usize; +declare function _BinaryenGlobalSetGetValue(expr: BinaryenExpressionRef): BinaryenExpressionRef; + +declare function _BinaryenHostGetOp(expr: BinaryenExpressionRef): BinaryenOp; +declare function _BinaryenHostGetNameOperand(expr: BinaryenExpressionRef): usize; +declare function _BinaryenHostGetNumOperands(expr: BinaryenExpressionRef): BinaryenIndex; +declare function _BinaryenHostGetOperand(expr: BinaryenExpressionRef, index: BinaryenIndex): BinaryenExpressionRef; + +declare function _BinaryenLoadIsAtomic(expr: BinaryenExpressionRef): bool; +declare function _BinaryenLoadIsSigned(expr: BinaryenExpressionRef): bool; +declare function _BinaryenLoadGetBytes(expr: BinaryenExpressionRef): u32; +declare function _BinaryenLoadGetOffset(expr: BinaryenExpressionRef): u32; +declare function _BinaryenLoadGetAlign(expr: BinaryenExpressionRef): u32; +declare function _BinaryenLoadGetPtr(expr: BinaryenExpressionRef): BinaryenExpressionRef; + +declare function _BinaryenStoreIsAtomic(expr: BinaryenExpressionRef): bool; +declare function _BinaryenStoreGetBytes(expr: BinaryenExpressionRef): u32; +declare function _BinaryenStoreGetOffset(expr: BinaryenExpressionRef): u32; +declare function _BinaryenStoreGetAlign(expr: BinaryenExpressionRef): u32; +declare function _BinaryenStoreGetPtr(expr: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenStoreGetValue(expr: BinaryenExpressionRef): BinaryenExpressionRef; + +declare function _BinaryenConstGetValueI32(expr: BinaryenExpressionRef): i32; +declare function _BinaryenConstGetValueI64Low(expr: BinaryenExpressionRef): i32; +declare function _BinaryenConstGetValueI64High(expr: BinaryenExpressionRef): i32; +declare function _BinaryenConstGetValueF32(expr: BinaryenExpressionRef): f32; +declare function _BinaryenConstGetValueF64(expr: BinaryenExpressionRef): f64; + +declare function _BinaryenUnaryGetOp(expr: BinaryenExpressionRef): BinaryenOp; +declare function _BinaryenUnaryGetValue(expr: BinaryenExpressionRef): BinaryenExpressionRef; + +declare function _BinaryenBinaryGetOp(expr: BinaryenExpressionRef): BinaryenOp; +declare function _BinaryenBinaryGetLeft(expr: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenBinaryGetRight(expr: BinaryenExpressionRef): BinaryenExpressionRef; + +declare function _BinaryenSelectGetIfTrue(expr: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenSelectGetIfFalse(expr: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenSelectGetCondition(expr: BinaryenExpressionRef): BinaryenExpressionRef; + +declare function _BinaryenDropGetValue(expr: BinaryenExpressionRef): BinaryenExpressionRef; + +declare function _BinaryenReturnGetValue(expr: BinaryenExpressionRef): BinaryenExpressionRef; + +declare function _BinaryenAtomicRMWGetOp(expr: BinaryenExpressionRef): BinaryenOp; +declare function _BinaryenAtomicRMWGetBytes(expr: BinaryenExpressionRef): u32; +declare function _BinaryenAtomicRMWGetOffset(expr: BinaryenExpressionRef): u32; +declare function _BinaryenAtomicRMWGetPtr(expr: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenAtomicRMWGetValue(expr: BinaryenExpressionRef): BinaryenExpressionRef; + +declare function _BinaryenAtomicCmpxchgGetBytes(expr: BinaryenExpressionRef): u32; +declare function _BinaryenAtomicCmpxchgGetOffset(expr: BinaryenExpressionRef): u32; +declare function _BinaryenAtomicCmpxchgGetPtr(expr: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenAtomicCmpxchgGetExpected(expr: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenAtomicCmpxchgGetReplacement(expr: BinaryenExpressionRef): BinaryenExpressionRef; + +declare function _BinaryenAtomicWaitGetPtr(expr: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenAtomicWaitGetExpected(expr: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenAtomicWaitGetTimeout(expr: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenAtomicWaitGetExpectedType(expr: BinaryenExpressionRef): BinaryenType; + +declare function _BinaryenAtomicNotifyGetPtr(expr: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenAtomicNotifyGetNotifyCount(expr: BinaryenExpressionRef): BinaryenExpressionRef; + +declare function _BinaryenSIMDExtractGetOp(expr: BinaryenExpressionRef): BinaryenSIMDOp; +declare function _BinaryenSIMDExtractGetVec(expr: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenSIMDExtractGetIdx(expr: BinaryenExpressionRef): u8; + +declare function _BinaryenSIMDReplaceGetOp(expr: BinaryenExpressionRef): BinaryenSIMDOp; +declare function _BinaryenSIMDReplaceGetVec(expr: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenSIMDReplaceGetIdx(expr: BinaryenExpressionRef): u8; +declare function _BinaryenSIMDReplaceGetValue(expr: BinaryenExpressionRef): BinaryenExpressionRef; + +declare function _BinaryenSIMDShuffleGetLeft(expr: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenSIMDShuffleGetRight(expr: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenSIMDShuffleGetMask(expr: BinaryenExpressionRef, out: v128ptr): void; + +declare function _BinaryenSIMDBitselectGetLeft(expr: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenSIMDBitselectGetRight(expr: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenSIMDBitselectGetCond(expr: BinaryenExpressionRef): BinaryenExpressionRef; + +declare function _BinaryenSIMDShiftGetOp(expr: BinaryenExpressionRef): BinaryenSIMDOp; +declare function _BinaryenSIMDShiftGetVec(expr: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenSIMDShiftGetShift(expr: BinaryenExpressionRef): BinaryenExpressionRef; + +declare function _BinaryenMemoryInitGetSegment(expr: BinaryenExpressionRef): u32; +declare function _BinaryenMemoryInitGetDest(expr: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenMemoryInitGetOffset(expr: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenMemoryInitGetSize(expr: BinaryenExpressionRef): BinaryenExpressionRef; + +declare function _BinaryenDataDropGetSegment(expr: BinaryenExpressionRef): u32; + +declare function _BinaryenMemoryCopyGetDest(expr: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenMemoryCopyGetSource(expr: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenMemoryCopyGetSize(expr: BinaryenExpressionRef): BinaryenExpressionRef; + +declare function _BinaryenMemoryFillGetDest(expr: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenMemoryFillGetValue(expr: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenMemoryFillGetSize(expr: BinaryenExpressionRef): BinaryenExpressionRef; + +declare type BinaryenFunctionTypeRef = usize; + +declare function _BinaryenAddFunctionType(module: BinaryenModuleRef, name: usize, result: BinaryenType, paramTypes: usize, numParams: BinaryenIndex): BinaryenFunctionTypeRef; +declare function _BinaryenGetFunctionTypeBySignature(module: BinaryenModuleRef, result: BinaryenType, paramTypes: usize, numParams: BinaryenIndex): BinaryenFunctionTypeRef; +declare function _BinaryenRemoveFunctionType(module: BinaryenModuleRef, name: usize): void; + +declare function _BinaryenFunctionTypeGetName(ftype: BinaryenFunctionTypeRef): usize; +declare function _BinaryenFunctionTypeGetNumParams(ftype: BinaryenFunctionTypeRef): BinaryenIndex; +declare function _BinaryenFunctionTypeGetParam(ftype: BinaryenFunctionTypeRef, index: BinaryenIndex): BinaryenType; +declare function _BinaryenFunctionTypeGetResult(ftype: BinaryenFunctionTypeRef): BinaryenType; + +declare type BinaryenFunctionRef = usize; + +declare function _BinaryenAddFunction(module: BinaryenModuleRef, name: usize, type: BinaryenFunctionTypeRef, varTypes: usize, numVarTypes: BinaryenIndex, body: BinaryenExpressionRef): BinaryenFunctionRef; +declare function _BinaryenGetFunction(module: BinaryenModuleRef, name: usize): BinaryenFunctionRef; +declare function _BinaryenRemoveFunction(module: BinaryenModuleRef, name: usize): void; + +declare function _BinaryenFunctionGetName(func: BinaryenFunctionRef): usize; +declare function _BinaryenFunctionGetType(func: BinaryenFunctionRef): BinaryenFunctionTypeRef; +declare function _BinaryenFunctionGetNumParams(func: BinaryenFunctionRef): BinaryenIndex; +declare function _BinaryenFunctionGetParam(func: BinaryenFunctionRef, index: BinaryenIndex): BinaryenType; +declare function _BinaryenFunctionGetResult(func: BinaryenFunctionRef): BinaryenType; +declare function _BinaryenFunctionGetNumVars(func: BinaryenFunctionRef): BinaryenIndex; +declare function _BinaryenFunctionGetVar(func: BinaryenFunctionRef, index: BinaryenIndex): BinaryenType; +declare function _BinaryenFunctionGetBody(func: BinaryenFunctionRef): BinaryenExpressionRef; +declare function _BinaryenFunctionOptimize(func: BinaryenFunctionRef, module: BinaryenModuleRef): void; +declare function _BinaryenFunctionRunPasses(func: BinaryenFunctionRef, module: BinaryenModuleRef, passes: usize, numPasses: BinaryenIndex): void; +declare function _BinaryenFunctionSetDebugLocation(func: BinaryenFunctionRef, expr: BinaryenExpressionRef, fileIndex: BinaryenIndex, lineNumber: BinaryenIndex, columnNumber: BinaryenIndex): void; + +declare type BinaryenImportRef = usize; + +declare function _BinaryenAddFunctionImport(module: BinaryenModuleRef, internalName: usize, externalModuleName: usize, externalBaseName: usize, functionType: BinaryenFunctionTypeRef): BinaryenImportRef; +declare function _BinaryenAddTableImport(module: BinaryenModuleRef, internalName: usize, externalModuleName: usize, externalBaseName: usize): BinaryenImportRef; +declare function _BinaryenAddMemoryImport(module: BinaryenModuleRef, internalName: usize, externalModuleName: usize, externalBaseName: usize, shared:bool): BinaryenImportRef; +declare function _BinaryenAddGlobalImport(module: BinaryenModuleRef, internalName: usize, externalModuleName: usize, externalBaseName: usize, globalType: BinaryenType): BinaryenImportRef; + +declare type BinaryenExportRef = usize; + +declare function _BinaryenAddFunctionExport(module: BinaryenModuleRef, internalName: usize, externalName: usize): BinaryenExportRef; +declare function _BinaryenAddTableExport(module: BinaryenModuleRef, internalName: usize, externalName: usize): BinaryenExportRef; +declare function _BinaryenAddMemoryExport(module: BinaryenModuleRef, internalName: usize, externalName: usize): BinaryenExportRef; +declare function _BinaryenAddGlobalExport(module: BinaryenModuleRef, internalName: usize, externalName: usize): BinaryenExportRef; +declare function _BinaryenRemoveExport(module: BinaryenModuleRef, externalName: usize): void; + +declare type BinaryenGlobalRef = usize; + +declare function _BinaryenAddGlobal(module: BinaryenModuleRef, name: usize, type: BinaryenType, mutable: i8, init: BinaryenExpressionRef): BinaryenGlobalRef; +declare function _BinaryenRemoveGlobal(module: BinaryenModuleRef, name: usize): void; + +declare function _BinaryenSetFunctionTable(module: BinaryenModuleRef, initial: BinaryenIndex, maximum: BinaryenIndex, funcs: usize, numFuncs: BinaryenIndex): void; + +declare function _BinaryenSetMemory(module: BinaryenModuleRef, initial: BinaryenIndex, maximum: BinaryenIndex, exportName: usize, segments: usize, segmentPassive: usize, segmentOffsets: usize, segmentSizes: usize, numSegments: BinaryenIndex, shared: bool): void; + +declare function _BinaryenSetStart(module: BinaryenModuleRef, start: BinaryenFunctionRef): void; + +declare function _BinaryenModuleParse(text: usize): BinaryenModuleRef; +declare function _BinaryenModulePrint(module: BinaryenModuleRef): void; +declare function _BinaryenModulePrintAsmjs(module: BinaryenModuleRef): void; +declare function _BinaryenModuleValidate(module: BinaryenModuleRef): i32; +declare function _BinaryenModuleOptimize(module: BinaryenModuleRef): void; +declare function _BinaryenModuleRunPasses(module: BinaryenModuleRef, passes: usize, numPasses: BinaryenIndex): void; +declare function _BinaryenModuleAutoDrop(module: BinaryenModuleRef): void; +declare function _BinaryenModuleAllocateAndWrite(out: usize, module: BinaryenModuleRef, sourceMapUrl: usize): void; +declare function _BinaryenModuleRead(input: usize, inputSize: usize): BinaryenModuleRef; +declare function _BinaryenModuleInterpret(module: BinaryenModuleRef): void; +declare function _BinaryenModuleAddDebugInfoFileName(module: BinaryenModuleRef, filename: usize): BinaryenIndex; +declare function _BinaryenModuleGetDebugInfoFileName(module: BinaryenModuleRef, index: BinaryenIndex): usize; +declare function _BinaryenModuleGetFeatures(module: BinaryenModuleRef): BinaryenFeatureFlags; +declare function _BinaryenModuleSetFeatures(module: BinaryenModuleRef, featureFlags: BinaryenFeatureFlags): void; + +declare type BinaryenRelooperRef = usize; +declare type BinaryenRelooperBlockRef = usize; + +declare function _RelooperCreate(module: BinaryenModuleRef): BinaryenRelooperRef; +declare function _RelooperAddBlock(relooper: BinaryenRelooperRef, code: BinaryenExpressionRef): BinaryenRelooperBlockRef; +declare function _RelooperAddBranch(from: BinaryenRelooperBlockRef, to: BinaryenRelooperBlockRef, condition: BinaryenExpressionRef, code: BinaryenExpressionRef): void; +declare function _RelooperAddBlockWithSwitch(relooper: BinaryenRelooperRef, code: BinaryenExpressionRef, condition: BinaryenExpressionRef): BinaryenRelooperBlockRef; +declare function _RelooperAddBranchForSwitch(from: BinaryenRelooperBlockRef, to: BinaryenRelooperBlockRef, indexes: usize, numIndexes: BinaryenIndex, code: BinaryenExpressionRef): void; +declare function _RelooperRenderAndDispose(relooper: BinaryenRelooperRef, entry: BinaryenRelooperBlockRef, labelHelper: BinaryenIndex): BinaryenExpressionRef; + +declare function _BinaryenGetOptimizeLevel(): i32; +declare function _BinaryenSetOptimizeLevel(level: i32): void; +declare function _BinaryenGetShrinkLevel(): i32; +declare function _BinaryenSetShrinkLevel(level: i32): void; +declare function _BinaryenGetDebugInfo(): bool; +declare function _BinaryenSetDebugInfo(on: bool): void; + +declare function _BinaryenSetAPITracing(on: i32): void; +/** @module glue/js *//***/ + + +declare namespace binaryen { + class Module { + constructor(); + emitStackIR(optimize?: boolean): string; + emitAsmjs(): string; + } + function wrapModule(ptr: number): Module; +} +/** @module glue/js *//***/ + +declare function f32_as_i32(value: f32): i32; +declare function i32_as_f32(value: i32): f32; +declare function f64_as_i64(value: f64): I64; +declare function i64_as_f64(value: I64): f64; +/** @module glue/js *//***/ + +declare type I64 = { __Long__: true }; // opaque + +declare const i64_zero: I64; +declare const i64_one: I64; + +declare function i64_new(lo: i32, hi?: i32): I64; +declare function i64_low(value: I64): i32; +declare function i64_high(value: I64): i32; + +declare function i64_add(left: I64, right: I64): I64; +declare function i64_sub(left: I64, right: I64): I64; +declare function i64_mul(left: I64, right: I64): I64; +declare function i64_div(left: I64, right: I64): I64; +declare function i64_div_u(left: I64, right: I64): I64; +declare function i64_rem(left: I64, right: I64): I64; +declare function i64_rem_u(left: I64, right: I64): I64; +declare function i64_and(left: I64, right: I64): I64; +declare function i64_or(left: I64, right: I64): I64; +declare function i64_xor(left: I64, right: I64): I64; +declare function i64_shl(left: I64, right: I64): I64; +declare function i64_shr(left: I64, right: I64): I64; +declare function i64_shr_u(left: I64, right: I64): I64; +declare function i64_not(value: I64): I64; + +declare function i64_eq(left: I64, right: I64): bool; +declare function i64_ne(left: I64, right: I64): bool; + +declare function i64_align(value: I64, alignment: i32): I64; + +declare function i64_is_i8(value: I64): bool; +declare function i64_is_i16(value: I64): bool; +declare function i64_is_i32(value: I64): bool; +declare function i64_is_u8(value: I64): bool; +declare function i64_is_u16(value: I64): bool; +declare function i64_is_u32(value: I64): bool; +declare function i64_is_bool(value: I64): bool; +declare function i64_is_f32(value: I64): bool; +declare function i64_is_f64(value: I64): bool; + +declare function i64_to_f32(value: I64): f64; +declare function i64_to_f64(value: I64): f64; +declare function i64_to_string(value: I64, unsigned?: bool): string; diff --git a/dist/assemblyscript.js b/dist/assemblyscript.js index f367daff01..cec88225fc 100644 --- a/dist/assemblyscript.js +++ b/dist/assemblyscript.js @@ -1,3 +1,2 @@ -!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("binaryen")):"function"==typeof define&&define.amd?define(["binaryen"],r):"object"==typeof exports?exports.assemblyscript=r(require("binaryen")):e.assemblyscript=r(e.binaryen)}("undefined"!=typeof self?self:this,function(e){return function(e){var r={};function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var i in e)t.d(n,i,function(r){return e[r]}.bind(null,i));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=16)}([function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),function(e){e[e.NONE=0]="NONE",e[e.IMPORT=1]="IMPORT",e[e.EXPORT=2]="EXPORT",e[e.DECLARE=4]="DECLARE",e[e.CONST=8]="CONST",e[e.LET=16]="LET",e[e.STATIC=32]="STATIC",e[e.READONLY=64]="READONLY",e[e.ABSTRACT=128]="ABSTRACT",e[e.PUBLIC=256]="PUBLIC",e[e.PRIVATE=512]="PRIVATE",e[e.PROTECTED=1024]="PROTECTED",e[e.GET=2048]="GET",e[e.SET=4096]="SET",e[e.DEFINITE_ASSIGNMENT=8192]="DEFINITE_ASSIGNMENT",e[e.AMBIENT=16384]="AMBIENT",e[e.GENERIC=32768]="GENERIC",e[e.GENERIC_CONTEXT=65536]="GENERIC_CONTEXT",e[e.INSTANCE=131072]="INSTANCE",e[e.CONSTRUCTOR=262144]="CONSTRUCTOR",e[e.MODULE_EXPORT=524288]="MODULE_EXPORT",e[e.MODULE_IMPORT=1048576]="MODULE_IMPORT",e[e.RESOLVED=2097152]="RESOLVED",e[e.COMPILED=4194304]="COMPILED",e[e.INLINED=8388608]="INLINED",e[e.SCOPED=16777216]="SCOPED",e[e.TRAMPOLINE=33554432]="TRAMPOLINE",e[e.VIRTUAL=67108864]="VIRTUAL",e[e.MAIN=134217728]="MAIN",e[e.QUOTED=268435456]="QUOTED"}(r.CommonFlags||(r.CommonFlags={})),r.PATH_DELIMITER="/",r.PARENT_SUBST="..",r.GETTER_PREFIX="get:",r.SETTER_PREFIX="set:",r.INSTANCE_DELIMITER="#",r.STATIC_DELIMITER=".",r.INNER_DELIMITER="~",r.LIBRARY_SUBST="~lib",r.LIBRARY_PREFIX=r.LIBRARY_SUBST+r.PATH_DELIMITER,r.INDEX_SUFFIX=r.PATH_DELIMITER+"index",function(e){e.EMPTY="",e.i8="i8",e.i16="i16",e.i32="i32",e.i64="i64",e.isize="isize",e.u8="u8",e.u16="u16",e.u32="u32",e.u64="u64",e.usize="usize",e.bool="bool",e.f32="f32",e.f64="f64",e.v128="v128",e.i8x16="i8x16",e.u8x16="u8x16",e.i16x8="i16x8",e.u16x8="u16x8",e.i32x4="i32x4",e.u32x4="u32x4",e.i64x2="i64x2",e.u64x2="u64x2",e.f32x4="f32x4",e.f64x2="f64x2",e.void_="void",e.number="number",e.boolean="boolean",e.string="string",e.native="native",e.null_="null",e.true_="true",e.false_="false",e.this_="this",e.super_="super",e.constructor="constructor"}(r.CommonSymbols||(r.CommonSymbols={})),function(e){e.ASC_TARGET="ASC_TARGET",e.ASC_NO_TREESHAKING="ASC_NO_TREESHAKING",e.ASC_NO_ASSERT="ASC_NO_ASSERT",e.ASC_MEMORY_BASE="ASC_MEMORY_BASE",e.ASC_OPTIMIZE_LEVEL="ASC_OPTIMIZE_LEVEL",e.ASC_SHRINK_LEVEL="ASC_SHRINK_LEVEL",e.ASC_FEATURE_MUTABLE_GLOBAL="ASC_FEATURE_MUTABLE_GLOBAL",e.ASC_FEATURE_SIGN_EXTENSION="ASC_FEATURE_SIGN_EXTENSION",e.ASC_FEATURE_BULK_MEMORY="ASC_FEATURE_BULK_MEMORY",e.ASC_FEATURE_SIMD="ASC_FEATURE_SIMD",e.ASC_FEATURE_THREADS="ASC_FEATURE_THREADS",e.I8="I8",e.I16="I16",e.I32="I32",e.I64="I64",e.Isize="Isize",e.U8="U8",e.U16="U16",e.U32="U32",e.U64="U64",e.Usize="Usize",e.Bool="Bool",e.F32="F32",e.F64="F64",e.V128="V128",e.String="String",e.Array="Array",e.ArrayBuffer="ArrayBuffer",e.Math="Math",e.Mathf="Mathf",e.memory="memory",e.allocate="allocate",e.abort="abort",e.main="main",e.length="length",e.byteLength="byteLength",e.pow="pow",e.mod="mod"}(r.LibrarySymbols||(r.LibrarySymbols={}))},function(e,r,t){"use strict";function n(e){for(var t in e)r.hasOwnProperty(t)||(r[t]=e[t])}Object.defineProperty(r,"__esModule",{value:!0}),n(t(25)),n(t(26)),n(t(27)),n(t(28)),n(t(29)),n(t(30)),r.isPowerOf2=function(e){return 0!=e&&0==(e&e-1)}},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=t(11),a=t(1),s=t(11);function o(e){switch(e){case n.INFO:return"INFO";case n.WARNING:return"WARNING";case n.ERROR:return"ERROR";default:return assert(!1),""}}function c(e){switch(e){case n.INFO:return r.COLOR_BLUE;case n.WARNING:return r.COLOR_YELLOW;case n.ERROR:return r.COLOR_RED;default:return assert(!1),""}}r.DiagnosticCode=s.DiagnosticCode,r.diagnosticCodeToString=s.diagnosticCodeToString,function(e){e[e.INFO=0]="INFO",e[e.WARNING=1]="WARNING",e[e.ERROR=2]="ERROR"}(n=r.DiagnosticCategory||(r.DiagnosticCategory={})),r.diagnosticCategoryToString=o,r.COLOR_BLUE="",r.COLOR_YELLOW="",r.COLOR_RED="",r.COLOR_RESET="",r.diagnosticCategoryToColor=c;var l=function(){function e(e,r,t){this.range=null,this.relatedRange=null,this.code=e,this.category=r,this.message=t}return e.create=function(r,t,n,a,s){void 0===n&&(n=null),void 0===a&&(a=null),void 0===s&&(s=null);var o=i.diagnosticCodeToString(r);return null!=n&&(o=o.replace("{0}",n)),null!=a&&(o=o.replace("{1}",a)),null!=s&&(o=o.replace("{2}",s)),new e(r,t,o)},e.createInfo=function(r,t,i){return void 0===t&&(t=null),void 0===i&&(i=null),e.create(r,n.INFO,t,i)},e.createWarning=function(r,t,i){return void 0===t&&(t=null),void 0===i&&(i=null),e.create(r,n.WARNING,t,i)},e.createError=function(r,t,i){return void 0===t&&(t=null),void 0===i&&(i=null),e.create(r,n.ERROR,t,i)},e.prototype.withRange=function(e){return this.range=e,this},e.prototype.withRelatedRange=function(e){return this.relatedRange=e,this},e.prototype.toString=function(){return this.range?o(this.category)+" "+this.code.toString(10)+': "'+this.message+'" in '+this.range.source.normalizedPath+":"+this.range.line.toString(10)+":"+this.range.column.toString(10):o(this.category)+" "+this.code.toString(10)+": "+this.message},e}();function p(e,t){void 0===t&&(t=!1);for(var n=e.source.text,i=n.length,s=e.start,o=e.end;s>0&&!a.isLineBreak(n.charCodeAt(s-1));)s--;for(;o=e.length&&(e=void 0),{value:e&&e[t++],done:!e}}}},s=this&&this.__read||function(e,r){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var n,i,a=t.call(e),s=[];try{for(;(void 0===r||r-- >0)&&!(n=a.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(t=a.return)&&t.call(a)}finally{if(i)throw i.error}}return s};Object.defineProperty(r,"__esModule",{value:!0});var o,c=t(0),l=t(2),p=t(6),u=t(5),_=t(9),h=t(12),d=function(){return function(e,r,t,n,i){this.localFile=e,this.localIdentifier=r,this.foreignIdentifier=t,this.foreignPath=n,this.foreignPathAlt=i}}(),y=function(){return function(e,r,t,n){this.localIdentifier=e,this.foreignIdentifier=r,this.foreignPath=t,this.foreignPathAlt=n}}(),m=function(){return function(e,r,t){this.foreignPath=e,this.foreignPathAlt=r,this.pathLiteral=t}}();function T(e,r){switch(assert(r.length),e){case u.DecoratorKind.OPERATOR:case u.DecoratorKind.OPERATOR_BINARY:switch(r.charCodeAt(0)){case 91:if("[]"==r)return o.INDEXED_GET;if("[]="==r)return o.INDEXED_SET;break;case 123:if("{}"==r)return o.UNCHECKED_INDEXED_GET;if("{}="==r)return o.UNCHECKED_INDEXED_SET;break;case 43:if("+"==r)return o.ADD;break;case 45:if("-"==r)return o.SUB;break;case 42:if("*"==r)return o.MUL;if("**"==r)return o.POW;break;case 47:if("/"==r)return o.DIV;break;case 37:if("%"==r)return o.REM;break;case 38:if("&"==r)return o.BITWISE_AND;break;case 124:if("|"==r)return o.BITWISE_OR;break;case 94:if("^"==r)return o.BITWISE_XOR;break;case 61:if("=="==r)return o.EQ;break;case 33:if("!="==r)return o.NE;break;case 62:if(">"==r)return o.GT;if(">="==r)return o.GE;if(">>"==r)return o.BITWISE_SHR;if(">>>"==r)return o.BITWISE_SHR_U;break;case 60:if("<"==r)return o.LT;if("<="==r)return o.LE;if("<<"==r)return o.BITWISE_SHL}break;case u.DecoratorKind.OPERATOR_PREFIX:switch(r.charCodeAt(0)){case 43:if("+"==r)return o.PLUS;if("++"==r)return o.PREFIX_INC;break;case 45:if("-"==r)return o.MINUS;if("--"==r)return o.PREFIX_DEC;break;case 33:if("!"==r)return o.NOT;break;case 126:if("~"==r)return o.BITWISE_NOT}break;case u.DecoratorKind.OPERATOR_POSTFIX:switch(r.charCodeAt(0)){case 43:if("++"==r)return o.POSTFIX_INC;break;case 45:if("--"==r)return o.POSTFIX_DEC}}return o.INVALID}!function(e){e[e.INVALID=0]="INVALID",e[e.INDEXED_GET=1]="INDEXED_GET",e[e.INDEXED_SET=2]="INDEXED_SET",e[e.UNCHECKED_INDEXED_GET=3]="UNCHECKED_INDEXED_GET",e[e.UNCHECKED_INDEXED_SET=4]="UNCHECKED_INDEXED_SET",e[e.ADD=5]="ADD",e[e.SUB=6]="SUB",e[e.MUL=7]="MUL",e[e.DIV=8]="DIV",e[e.REM=9]="REM",e[e.POW=10]="POW",e[e.BITWISE_AND=11]="BITWISE_AND",e[e.BITWISE_OR=12]="BITWISE_OR",e[e.BITWISE_XOR=13]="BITWISE_XOR",e[e.BITWISE_SHL=14]="BITWISE_SHL",e[e.BITWISE_SHR=15]="BITWISE_SHR",e[e.BITWISE_SHR_U=16]="BITWISE_SHR_U",e[e.EQ=17]="EQ",e[e.NE=18]="NE",e[e.GT=19]="GT",e[e.GE=20]="GE",e[e.LT=21]="LT",e[e.LE=22]="LE",e[e.PLUS=23]="PLUS",e[e.MINUS=24]="MINUS",e[e.NOT=25]="NOT",e[e.BITWISE_NOT=26]="BITWISE_NOT",e[e.PREFIX_INC=27]="PREFIX_INC",e[e.PREFIX_DEC=28]="PREFIX_DEC",e[e.POSTFIX_INC=29]="POSTFIX_INC",e[e.POSTFIX_DEC=30]="POSTFIX_DEC"}(o=r.OperatorKind||(r.OperatorKind={}));var f,E,g=function(e){function r(r){void 0===r&&(r=null);var t=e.call(this,r)||this;t.sources=[],t.diagnosticsOffset=0,t.explicitStartFunction=null,t.filesByName=new Map,t.elementsByName=new Map,t.elementsByDeclaration=new Map,t.instancesByName=new Map,t.typeClasses=new Map,t.arrayBufferInstance=null,t.arrayPrototype=null,t.stringInstance=null,t.abortInstance=null,t.memoryAllocateInstance=null,t.hasGC=!1,t.gcAllocateInstance=null,t.gcLinkInstance=null,t.gcMarkInstance=null,t.gcHeaderSize=0,t.gcHookOffset=0,t.nativeDummySignature=null;var n=new u.Source(c.LIBRARY_SUBST,"[native code]",u.SourceKind.LIBRARY);t.nativeSource=n;var i=new S(t,n);return t.nativeFile=i,t.filesByName.set(i.internalName,i),t.resolver=new _.Resolver(t),t}return i(r,e),r.prototype.makeNativeVariableDeclaration=function(e,r){void 0===r&&(r=c.CommonFlags.NONE);var t=this.nativeSource.range;return u.Node.createVariableDeclaration(u.Node.createIdentifierExpression(e,t),null,null,null,r,t)},r.prototype.makeNativeTypeDeclaration=function(e,r){void 0===r&&(r=c.CommonFlags.NONE);var t=this.nativeSource.range,n=u.Node.createIdentifierExpression(e,t);return u.Node.createTypeDeclaration(n,null,u.Node.createOmittedType(t),null,r,t)},r.prototype.makeNativeFunctionDeclaration=function(e,r){void 0===r&&(r=c.CommonFlags.NONE);var t=this.nativeSource.range;return u.Node.createFunctionDeclaration(u.Node.createIdentifierExpression(e,t),null,this.nativeDummySignature||(this.nativeDummySignature=u.Node.createSignature([],u.Node.createType(u.Node.createSimpleTypeName(c.CommonSymbols.void_,t),null,!1,t),null,!1,t)),null,null,r,0,t)},r.prototype.makeNativeNamespaceDeclaration=function(e,r){void 0===r&&(r=c.CommonFlags.NONE);var t=this.nativeSource.range;return u.Node.createNamespaceDeclaration(u.Node.createIdentifierExpression(e,t),[],null,r,t)},r.prototype.makeNativeFunction=function(e,r,t,n,i){return void 0===t&&(t=this.nativeFile),void 0===n&&(n=c.CommonFlags.NONE),void 0===i&&(i=E.NONE),new U(e,new B(e,t,this.makeNativeFunctionDeclaration(e,n),i),r)},r.prototype.getElementByDeclaration=function(e){var r=this.elementsByDeclaration;return assert(r.has(e)),r.get(e)},r.prototype.initialize=function(e){var r,t,n,i,o,_,h,d,y,m,T,g;this.options=e,this.registerNativeType(c.CommonSymbols.i8,p.Type.i8),this.registerNativeType(c.CommonSymbols.i16,p.Type.i16),this.registerNativeType(c.CommonSymbols.i32,p.Type.i32),this.registerNativeType(c.CommonSymbols.i64,p.Type.i64),this.registerNativeType(c.CommonSymbols.isize,e.isizeType),this.registerNativeType(c.CommonSymbols.u8,p.Type.u8),this.registerNativeType(c.CommonSymbols.u16,p.Type.u16),this.registerNativeType(c.CommonSymbols.u32,p.Type.u32),this.registerNativeType(c.CommonSymbols.u64,p.Type.u64),this.registerNativeType(c.CommonSymbols.usize,e.usizeType),this.registerNativeType(c.CommonSymbols.bool,p.Type.bool),this.registerNativeType(c.CommonSymbols.f32,p.Type.f32),this.registerNativeType(c.CommonSymbols.f64,p.Type.f64),this.registerNativeType(c.CommonSymbols.void_,p.Type.void),this.registerNativeType(c.CommonSymbols.number,p.Type.f64),this.registerNativeType(c.CommonSymbols.boolean,p.Type.bool),this.nativeFile.add(c.CommonSymbols.native,new A(c.CommonSymbols.native,this.nativeFile,this.makeNativeTypeDeclaration(c.CommonSymbols.native,c.CommonFlags.EXPORT|c.CommonFlags.GENERIC),E.BUILTIN)),e.hasFeature(8)&&this.registerNativeType(c.CommonSymbols.v128,p.Type.v128),this.registerConstantInteger(c.LibrarySymbols.ASC_TARGET,p.Type.i32,i64_new(e.isWasm64?2:1)),this.registerConstantInteger(c.LibrarySymbols.ASC_NO_ASSERT,p.Type.bool,i64_new(e.noAssert?1:0,0)),this.registerConstantInteger(c.LibrarySymbols.ASC_MEMORY_BASE,p.Type.i32,i64_new(e.memoryBase,0)),this.registerConstantInteger(c.LibrarySymbols.ASC_OPTIMIZE_LEVEL,p.Type.i32,i64_new(e.optimizeLevelHint,0)),this.registerConstantInteger(c.LibrarySymbols.ASC_SHRINK_LEVEL,p.Type.i32,i64_new(e.shrinkLevelHint,0)),this.registerConstantInteger(c.LibrarySymbols.ASC_FEATURE_MUTABLE_GLOBAL,p.Type.bool,i64_new(e.hasFeature(2)?1:0,0)),this.registerConstantInteger(c.LibrarySymbols.ASC_FEATURE_SIGN_EXTENSION,p.Type.bool,i64_new(e.hasFeature(1)?1:0,0)),this.registerConstantInteger(c.LibrarySymbols.ASC_FEATURE_BULK_MEMORY,p.Type.bool,i64_new(e.hasFeature(4)?1:0,0)),this.registerConstantInteger(c.LibrarySymbols.ASC_FEATURE_SIMD,p.Type.bool,i64_new(e.hasFeature(8)?1:0,0)),this.registerConstantInteger(c.LibrarySymbols.ASC_FEATURE_THREADS,p.Type.bool,i64_new(e.hasFeature(16)?1:0,0));for(var v=new Array,I=new Map,x=new Map,N=new Array,O=new Array,C=0,k=this.sources.length;C=e.length&&(e=void 0),{value:e&&e[t++],done:!e}}}};Object.defineProperty(r,"__esModule",{value:!0});var i,a,s=t(10);!function(e){e[e.None=_BinaryenTypeNone()]="None",e[e.I32=_BinaryenTypeInt32()]="I32",e[e.I64=_BinaryenTypeInt64()]="I64",e[e.F32=_BinaryenTypeFloat32()]="F32",e[e.F64=_BinaryenTypeFloat64()]="F64",e[e.V128=_BinaryenTypeVec128()]="V128",e[e.Unreachable=_BinaryenTypeUnreachable()]="Unreachable",e[e.Auto=_BinaryenTypeAuto()]="Auto"}(i=r.NativeType||(r.NativeType={})),function(e){e[e.Invalid=_BinaryenInvalidId()]="Invalid",e[e.Block=_BinaryenBlockId()]="Block",e[e.If=_BinaryenIfId()]="If",e[e.Loop=_BinaryenLoopId()]="Loop",e[e.Break=_BinaryenBreakId()]="Break",e[e.Switch=_BinaryenSwitchId()]="Switch",e[e.Call=_BinaryenCallId()]="Call",e[e.CallIndirect=_BinaryenCallIndirectId()]="CallIndirect",e[e.GetLocal=_BinaryenGetLocalId()]="GetLocal",e[e.SetLocal=_BinaryenSetLocalId()]="SetLocal",e[e.GetGlobal=_BinaryenGetGlobalId()]="GetGlobal",e[e.SetGlobal=_BinaryenSetGlobalId()]="SetGlobal",e[e.Load=_BinaryenLoadId()]="Load",e[e.Store=_BinaryenStoreId()]="Store",e[e.Const=_BinaryenConstId()]="Const",e[e.Unary=_BinaryenUnaryId()]="Unary",e[e.Binary=_BinaryenBinaryId()]="Binary",e[e.Select=_BinaryenSelectId()]="Select",e[e.Drop=_BinaryenDropId()]="Drop",e[e.Return=_BinaryenReturnId()]="Return",e[e.Host=_BinaryenHostId()]="Host",e[e.Nop=_BinaryenNopId()]="Nop",e[e.Unreachable=_BinaryenUnreachableId()]="Unreachable",e[e.AtomicCmpxchg=_BinaryenAtomicCmpxchgId()]="AtomicCmpxchg",e[e.AtomicRMW=_BinaryenAtomicRMWId()]="AtomicRMW",e[e.AtomicWait=_BinaryenAtomicWaitId()]="AtomicWait",e[e.AtomicNotify=_BinaryenAtomicNotifyId()]="AtomicNotify",e[e.SIMDExtract=_BinaryenSIMDExtractId()]="SIMDExtract",e[e.SIMDReplace=_BinaryenSIMDReplaceId()]="SIMDReplace",e[e.SIMDShuffle=_BinaryenSIMDShuffleId()]="SIMDShuffle",e[e.SIMDBitselect=_BinaryenSIMDBitselectId()]="SIMDBitselect",e[e.SIMDShift=_BinaryenSIMDShiftId()]="SIMDShift",e[e.MemoryInit=_BinaryenMemoryInitId()]="MemoryInit",e[e.DataDrop=_BinaryenDataDropId()]="DataDrop",e[e.MemoryCopy=_BinaryenMemoryCopyId()]="MemoryCopy",e[e.MemoryFill=_BinaryenMemoryFillId()]="MemoryFill"}(a=r.ExpressionId||(r.ExpressionId={})),function(e){e[e.ClzI32=_BinaryenClzInt32()]="ClzI32",e[e.CtzI32=_BinaryenCtzInt32()]="CtzI32",e[e.PopcntI32=_BinaryenPopcntInt32()]="PopcntI32",e[e.NegF32=_BinaryenNegFloat32()]="NegF32",e[e.AbsF32=_BinaryenAbsFloat32()]="AbsF32",e[e.CeilF32=_BinaryenCeilFloat32()]="CeilF32",e[e.FloorF32=_BinaryenFloorFloat32()]="FloorF32",e[e.TruncF32=_BinaryenTruncFloat32()]="TruncF32",e[e.NearestF32=_BinaryenNearestFloat32()]="NearestF32",e[e.SqrtF32=_BinaryenSqrtFloat32()]="SqrtF32",e[e.EqzI32=_BinaryenEqZInt32()]="EqzI32",e[e.ClzI64=_BinaryenClzInt64()]="ClzI64",e[e.CtzI64=_BinaryenCtzInt64()]="CtzI64",e[e.PopcntI64=_BinaryenPopcntInt64()]="PopcntI64",e[e.NegF64=_BinaryenNegFloat64()]="NegF64",e[e.AbsF64=_BinaryenAbsFloat64()]="AbsF64",e[e.CeilF64=_BinaryenCeilFloat64()]="CeilF64",e[e.FloorF64=_BinaryenFloorFloat64()]="FloorF64",e[e.TruncF64=_BinaryenTruncFloat64()]="TruncF64",e[e.NearestF64=_BinaryenNearestFloat64()]="NearestF64",e[e.SqrtF64=_BinaryenSqrtFloat64()]="SqrtF64",e[e.EqzI64=_BinaryenEqZInt64()]="EqzI64",e[e.ExtendI32=_BinaryenExtendSInt32()]="ExtendI32",e[e.ExtendU32=_BinaryenExtendUInt32()]="ExtendU32",e[e.WrapI64=_BinaryenWrapInt64()]="WrapI64",e[e.TruncF32ToI32=_BinaryenTruncSFloat32ToInt32()]="TruncF32ToI32",e[e.TruncF32ToI64=_BinaryenTruncSFloat32ToInt64()]="TruncF32ToI64",e[e.TruncF32ToU32=_BinaryenTruncUFloat32ToInt32()]="TruncF32ToU32",e[e.TruncF32ToU64=_BinaryenTruncUFloat32ToInt64()]="TruncF32ToU64",e[e.TruncF64ToI32=_BinaryenTruncSFloat64ToInt32()]="TruncF64ToI32",e[e.TruncF64ToI64=_BinaryenTruncSFloat64ToInt64()]="TruncF64ToI64",e[e.TruncF64ToU32=_BinaryenTruncUFloat64ToInt32()]="TruncF64ToU32",e[e.TruncF64ToU64=_BinaryenTruncUFloat64ToInt64()]="TruncF64ToU64",e[e.ReinterpretF32=_BinaryenReinterpretFloat32()]="ReinterpretF32",e[e.ReinterpretF64=_BinaryenReinterpretFloat64()]="ReinterpretF64",e[e.ConvertI32ToF32=_BinaryenConvertSInt32ToFloat32()]="ConvertI32ToF32",e[e.ConvertI32ToF64=_BinaryenConvertSInt32ToFloat64()]="ConvertI32ToF64",e[e.ConvertU32ToF32=_BinaryenConvertUInt32ToFloat32()]="ConvertU32ToF32",e[e.ConvertU32ToF64=_BinaryenConvertUInt32ToFloat64()]="ConvertU32ToF64",e[e.ConvertI64ToF32=_BinaryenConvertSInt64ToFloat32()]="ConvertI64ToF32",e[e.ConvertI64ToF64=_BinaryenConvertSInt64ToFloat64()]="ConvertI64ToF64",e[e.ConvertU64ToF32=_BinaryenConvertUInt64ToFloat32()]="ConvertU64ToF32",e[e.ConvertU64ToF64=_BinaryenConvertUInt64ToFloat64()]="ConvertU64ToF64",e[e.PromoteF32=_BinaryenPromoteFloat32()]="PromoteF32",e[e.DemoteF64=_BinaryenDemoteFloat64()]="DemoteF64",e[e.ReinterpretI32=_BinaryenReinterpretInt32()]="ReinterpretI32",e[e.ReinterpretI64=_BinaryenReinterpretInt64()]="ReinterpretI64",e[e.ExtendI8ToI32=_BinaryenExtendS8Int32()]="ExtendI8ToI32",e[e.ExtendI16ToI32=_BinaryenExtendS16Int32()]="ExtendI16ToI32",e[e.ExtendI8ToI64=_BinaryenExtendS8Int64()]="ExtendI8ToI64",e[e.ExtendI16ToI64=_BinaryenExtendS16Int64()]="ExtendI16ToI64",e[e.ExtendI32ToI64=_BinaryenExtendS32Int64()]="ExtendI32ToI64",e[e.SplatVecI8x16=_BinaryenSplatVecI8x16()]="SplatVecI8x16",e[e.SplatVecI16x8=_BinaryenSplatVecI16x8()]="SplatVecI16x8",e[e.SplatVecI32x4=_BinaryenSplatVecI32x4()]="SplatVecI32x4",e[e.SplatVecI64x2=_BinaryenSplatVecI64x2()]="SplatVecI64x2",e[e.SplatVecF32x4=_BinaryenSplatVecF32x4()]="SplatVecF32x4",e[e.SplatVecF64x2=_BinaryenSplatVecF64x2()]="SplatVecF64x2",e[e.NotVec128=_BinaryenNotVec128()]="NotVec128",e[e.NegVecI8x16=_BinaryenNegVecI8x16()]="NegVecI8x16",e[e.AnyTrueVecI8x16=_BinaryenAnyTrueVecI8x16()]="AnyTrueVecI8x16",e[e.AllTrueVecI8x16=_BinaryenAllTrueVecI8x16()]="AllTrueVecI8x16",e[e.NegVecI16x8=_BinaryenNegVecI16x8()]="NegVecI16x8",e[e.AnyTrueVecI16x8=_BinaryenAnyTrueVecI16x8()]="AnyTrueVecI16x8",e[e.AllTrueVecI16x8=_BinaryenAllTrueVecI16x8()]="AllTrueVecI16x8",e[e.NegVecI32x4=_BinaryenNegVecI32x4()]="NegVecI32x4",e[e.AnyTrueVecI32x4=_BinaryenAnyTrueVecI32x4()]="AnyTrueVecI32x4",e[e.AllTrueVecI32x4=_BinaryenAllTrueVecI32x4()]="AllTrueVecI32x4",e[e.NegVecI64x2=_BinaryenNegVecI64x2()]="NegVecI64x2",e[e.AnyTrueVecI64x2=_BinaryenAnyTrueVecI64x2()]="AnyTrueVecI64x2",e[e.AllTrueVecI64x2=_BinaryenAllTrueVecI64x2()]="AllTrueVecI64x2",e[e.AbsVecF32x4=_BinaryenAbsVecF32x4()]="AbsVecF32x4",e[e.NegVecF32x4=_BinaryenNegVecF32x4()]="NegVecF32x4",e[e.SqrtVecF32x4=_BinaryenSqrtVecF32x4()]="SqrtVecF32x4",e[e.AbsVecF64x2=_BinaryenAbsVecF64x2()]="AbsVecF64x2",e[e.NegVecF64x2=_BinaryenNegVecF64x2()]="NegVecF64x2",e[e.SqrtVecF64x2=_BinaryenSqrtVecF64x2()]="SqrtVecF64x2",e[e.TruncSatSVecF32x4ToVecI32x4=_BinaryenTruncSatSVecF32x4ToVecI32x4()]="TruncSatSVecF32x4ToVecI32x4",e[e.TruncSatUVecF32x4ToVecI32x4=_BinaryenTruncSatUVecF32x4ToVecI32x4()]="TruncSatUVecF32x4ToVecI32x4",e[e.TruncSatSVecF64x2ToVecI64x2=_BinaryenTruncSatSVecF64x2ToVecI64x2()]="TruncSatSVecF64x2ToVecI64x2",e[e.TruncSatUVecF64x2ToVecI64x2=_BinaryenTruncSatUVecF64x2ToVecI64x2()]="TruncSatUVecF64x2ToVecI64x2",e[e.ConvertSVecI32x4ToVecF32x4=_BinaryenConvertSVecI32x4ToVecF32x4()]="ConvertSVecI32x4ToVecF32x4",e[e.ConvertUVecI32x4ToVecF32x4=_BinaryenConvertUVecI32x4ToVecF32x4()]="ConvertUVecI32x4ToVecF32x4",e[e.ConvertSVecI64x2ToVecF64x2=_BinaryenConvertSVecI64x2ToVecF64x2()]="ConvertSVecI64x2ToVecF64x2",e[e.ConvertUVecI64x2ToVecF64x2=_BinaryenConvertUVecI64x2ToVecF64x2()]="ConvertUVecI64x2ToVecF64x2"}(r.UnaryOp||(r.UnaryOp={})),function(e){e[e.AddI32=_BinaryenAddInt32()]="AddI32",e[e.SubI32=_BinaryenSubInt32()]="SubI32",e[e.MulI32=_BinaryenMulInt32()]="MulI32",e[e.DivI32=_BinaryenDivSInt32()]="DivI32",e[e.DivU32=_BinaryenDivUInt32()]="DivU32",e[e.RemI32=_BinaryenRemSInt32()]="RemI32",e[e.RemU32=_BinaryenRemUInt32()]="RemU32",e[e.AndI32=_BinaryenAndInt32()]="AndI32",e[e.OrI32=_BinaryenOrInt32()]="OrI32",e[e.XorI32=_BinaryenXorInt32()]="XorI32",e[e.ShlI32=_BinaryenShlInt32()]="ShlI32",e[e.ShrU32=_BinaryenShrUInt32()]="ShrU32",e[e.ShrI32=_BinaryenShrSInt32()]="ShrI32",e[e.RotlI32=_BinaryenRotLInt32()]="RotlI32",e[e.RotrI32=_BinaryenRotRInt32()]="RotrI32",e[e.EqI32=_BinaryenEqInt32()]="EqI32",e[e.NeI32=_BinaryenNeInt32()]="NeI32",e[e.LtI32=_BinaryenLtSInt32()]="LtI32",e[e.LtU32=_BinaryenLtUInt32()]="LtU32",e[e.LeI32=_BinaryenLeSInt32()]="LeI32",e[e.LeU32=_BinaryenLeUInt32()]="LeU32",e[e.GtI32=_BinaryenGtSInt32()]="GtI32",e[e.GtU32=_BinaryenGtUInt32()]="GtU32",e[e.GeI32=_BinaryenGeSInt32()]="GeI32",e[e.GeU32=_BinaryenGeUInt32()]="GeU32",e[e.AddI64=_BinaryenAddInt64()]="AddI64",e[e.SubI64=_BinaryenSubInt64()]="SubI64",e[e.MulI64=_BinaryenMulInt64()]="MulI64",e[e.DivI64=_BinaryenDivSInt64()]="DivI64",e[e.DivU64=_BinaryenDivUInt64()]="DivU64",e[e.RemI64=_BinaryenRemSInt64()]="RemI64",e[e.RemU64=_BinaryenRemUInt64()]="RemU64",e[e.AndI64=_BinaryenAndInt64()]="AndI64",e[e.OrI64=_BinaryenOrInt64()]="OrI64",e[e.XorI64=_BinaryenXorInt64()]="XorI64",e[e.ShlI64=_BinaryenShlInt64()]="ShlI64",e[e.ShrU64=_BinaryenShrUInt64()]="ShrU64",e[e.ShrI64=_BinaryenShrSInt64()]="ShrI64",e[e.RotlI64=_BinaryenRotLInt64()]="RotlI64",e[e.RotrI64=_BinaryenRotRInt64()]="RotrI64",e[e.EqI64=_BinaryenEqInt64()]="EqI64",e[e.NeI64=_BinaryenNeInt64()]="NeI64",e[e.LtI64=_BinaryenLtSInt64()]="LtI64",e[e.LtU64=_BinaryenLtUInt64()]="LtU64",e[e.LeI64=_BinaryenLeSInt64()]="LeI64",e[e.LeU64=_BinaryenLeUInt64()]="LeU64",e[e.GtI64=_BinaryenGtSInt64()]="GtI64",e[e.GtU64=_BinaryenGtUInt64()]="GtU64",e[e.GeI64=_BinaryenGeSInt64()]="GeI64",e[e.GeU64=_BinaryenGeUInt64()]="GeU64",e[e.AddF32=_BinaryenAddFloat32()]="AddF32",e[e.SubF32=_BinaryenSubFloat32()]="SubF32",e[e.MulF32=_BinaryenMulFloat32()]="MulF32",e[e.DivF32=_BinaryenDivFloat32()]="DivF32",e[e.CopysignF32=_BinaryenCopySignFloat32()]="CopysignF32",e[e.MinF32=_BinaryenMinFloat32()]="MinF32",e[e.MaxF32=_BinaryenMaxFloat32()]="MaxF32",e[e.EqF32=_BinaryenEqFloat32()]="EqF32",e[e.NeF32=_BinaryenNeFloat32()]="NeF32",e[e.LtF32=_BinaryenLtFloat32()]="LtF32",e[e.LeF32=_BinaryenLeFloat32()]="LeF32",e[e.GtF32=_BinaryenGtFloat32()]="GtF32",e[e.GeF32=_BinaryenGeFloat32()]="GeF32",e[e.AddF64=_BinaryenAddFloat64()]="AddF64",e[e.SubF64=_BinaryenSubFloat64()]="SubF64",e[e.MulF64=_BinaryenMulFloat64()]="MulF64",e[e.DivF64=_BinaryenDivFloat64()]="DivF64",e[e.CopysignF64=_BinaryenCopySignFloat64()]="CopysignF64",e[e.MinF64=_BinaryenMinFloat64()]="MinF64",e[e.MaxF64=_BinaryenMaxFloat64()]="MaxF64",e[e.EqF64=_BinaryenEqFloat64()]="EqF64",e[e.NeF64=_BinaryenNeFloat64()]="NeF64",e[e.LtF64=_BinaryenLtFloat64()]="LtF64",e[e.LeF64=_BinaryenLeFloat64()]="LeF64",e[e.GtF64=_BinaryenGtFloat64()]="GtF64",e[e.GeF64=_BinaryenGeFloat64()]="GeF64",e[e.EqVecI8x16=_BinaryenEqVecI8x16()]="EqVecI8x16",e[e.NeVecI8x16=_BinaryenNeVecI8x16()]="NeVecI8x16",e[e.LtSVecI8x16=_BinaryenLtSVecI8x16()]="LtSVecI8x16",e[e.LtUVecI8x16=_BinaryenLtUVecI8x16()]="LtUVecI8x16",e[e.LeSVecI8x16=_BinaryenLeSVecI8x16()]="LeSVecI8x16",e[e.LeUVecI8x16=_BinaryenLeUVecI8x16()]="LeUVecI8x16",e[e.GtSVecI8x16=_BinaryenGtSVecI8x16()]="GtSVecI8x16",e[e.GtUVecI8x16=_BinaryenGtUVecI8x16()]="GtUVecI8x16",e[e.GeSVecI8x16=_BinaryenGeSVecI8x16()]="GeSVecI8x16",e[e.GeUVecI8x16=_BinaryenGeUVecI8x16()]="GeUVecI8x16",e[e.EqVecI16x8=_BinaryenEqVecI16x8()]="EqVecI16x8",e[e.NeVecI16x8=_BinaryenNeVecI16x8()]="NeVecI16x8",e[e.LtSVecI16x8=_BinaryenLtSVecI16x8()]="LtSVecI16x8",e[e.LtUVecI16x8=_BinaryenLtUVecI16x8()]="LtUVecI16x8",e[e.LeSVecI16x8=_BinaryenLeSVecI16x8()]="LeSVecI16x8",e[e.LeUVecI16x8=_BinaryenLeUVecI16x8()]="LeUVecI16x8",e[e.GtSVecI16x8=_BinaryenGtSVecI16x8()]="GtSVecI16x8",e[e.GtUVecI16x8=_BinaryenGtUVecI16x8()]="GtUVecI16x8",e[e.GeSVecI16x8=_BinaryenGeSVecI16x8()]="GeSVecI16x8",e[e.GeUVecI16x8=_BinaryenGeUVecI16x8()]="GeUVecI16x8",e[e.EqVecI32x4=_BinaryenEqVecI32x4()]="EqVecI32x4",e[e.NeVecI32x4=_BinaryenNeVecI32x4()]="NeVecI32x4",e[e.LtSVecI32x4=_BinaryenLtSVecI32x4()]="LtSVecI32x4",e[e.LtUVecI32x4=_BinaryenLtUVecI32x4()]="LtUVecI32x4",e[e.LeSVecI32x4=_BinaryenLeSVecI32x4()]="LeSVecI32x4",e[e.LeUVecI32x4=_BinaryenLeUVecI32x4()]="LeUVecI32x4",e[e.GtSVecI32x4=_BinaryenGtSVecI32x4()]="GtSVecI32x4",e[e.GtUVecI32x4=_BinaryenGtUVecI32x4()]="GtUVecI32x4",e[e.GeSVecI32x4=_BinaryenGeSVecI32x4()]="GeSVecI32x4",e[e.GeUVecI32x4=_BinaryenGeUVecI32x4()]="GeUVecI32x4",e[e.EqVecF32x4=_BinaryenEqVecF32x4()]="EqVecF32x4",e[e.NeVecF32x4=_BinaryenNeVecF32x4()]="NeVecF32x4",e[e.LtVecF32x4=_BinaryenLtVecF32x4()]="LtVecF32x4",e[e.LeVecF32x4=_BinaryenLeVecF32x4()]="LeVecF32x4",e[e.GtVecF32x4=_BinaryenGtVecF32x4()]="GtVecF32x4",e[e.GeVecF32x4=_BinaryenGeVecF32x4()]="GeVecF32x4",e[e.EqVecF64x2=_BinaryenEqVecF64x2()]="EqVecF64x2",e[e.NeVecF64x2=_BinaryenNeVecF64x2()]="NeVecF64x2",e[e.LtVecF64x2=_BinaryenLtVecF64x2()]="LtVecF64x2",e[e.LeVecF64x2=_BinaryenLeVecF64x2()]="LeVecF64x2",e[e.GtVecF64x2=_BinaryenGtVecF64x2()]="GtVecF64x2",e[e.GeVecF64x2=_BinaryenGeVecF64x2()]="GeVecF64x2",e[e.AndVec128=_BinaryenAndVec128()]="AndVec128",e[e.OrVec128=_BinaryenOrVec128()]="OrVec128",e[e.XorVec128=_BinaryenXorVec128()]="XorVec128",e[e.AddVecI8x16=_BinaryenAddVecI8x16()]="AddVecI8x16",e[e.AddSatSVecI8x16=_BinaryenAddSatSVecI8x16()]="AddSatSVecI8x16",e[e.AddSatUVecI8x16=_BinaryenAddSatUVecI8x16()]="AddSatUVecI8x16",e[e.SubVecI8x16=_BinaryenSubVecI8x16()]="SubVecI8x16",e[e.SubSatSVecI8x16=_BinaryenSubSatSVecI8x16()]="SubSatSVecI8x16",e[e.SubSatUVecI8x16=_BinaryenSubSatUVecI8x16()]="SubSatUVecI8x16",e[e.MulVecI8x16=_BinaryenMulVecI8x16()]="MulVecI8x16",e[e.AddVecI16x8=_BinaryenAddVecI16x8()]="AddVecI16x8",e[e.AddSatSVecI16x8=_BinaryenAddSatSVecI16x8()]="AddSatSVecI16x8",e[e.AddSatUVecI16x8=_BinaryenAddSatUVecI16x8()]="AddSatUVecI16x8",e[e.SubVecI16x8=_BinaryenSubVecI16x8()]="SubVecI16x8",e[e.SubSatSVecI16x8=_BinaryenSubSatSVecI16x8()]="SubSatSVecI16x8",e[e.SubSatUVecI16x8=_BinaryenSubSatUVecI16x8()]="SubSatUVecI16x8",e[e.MulVecI16x8=_BinaryenMulVecI16x8()]="MulVecI16x8",e[e.AddVecI32x4=_BinaryenAddVecI32x4()]="AddVecI32x4",e[e.SubVecI32x4=_BinaryenSubVecI32x4()]="SubVecI32x4",e[e.MulVecI32x4=_BinaryenMulVecI32x4()]="MulVecI32x4",e[e.AddVecI64x2=_BinaryenAddVecI64x2()]="AddVecI64x2",e[e.SubVecI64x2=_BinaryenSubVecI64x2()]="SubVecI64x2",e[e.AddVecF32x4=_BinaryenAddVecF32x4()]="AddVecF32x4",e[e.SubVecF32x4=_BinaryenSubVecF32x4()]="SubVecF32x4",e[e.MulVecF32x4=_BinaryenMulVecF32x4()]="MulVecF32x4",e[e.DivVecF32x4=_BinaryenDivVecF32x4()]="DivVecF32x4",e[e.MinVecF32x4=_BinaryenMinVecF32x4()]="MinVecF32x4",e[e.MaxVecF32x4=_BinaryenMaxVecF32x4()]="MaxVecF32x4",e[e.AddVecF64x2=_BinaryenAddVecF64x2()]="AddVecF64x2",e[e.SubVecF64x2=_BinaryenSubVecF64x2()]="SubVecF64x2",e[e.MulVecF64x2=_BinaryenMulVecF64x2()]="MulVecF64x2",e[e.DivVecF64x2=_BinaryenDivVecF64x2()]="DivVecF64x2",e[e.MinVecF64x2=_BinaryenMinVecF64x2()]="MinVecF64x2",e[e.MaxVecF64x2=_BinaryenMaxVecF64x2()]="MaxVecF64x2"}(r.BinaryOp||(r.BinaryOp={})),function(e){e[e.CurrentMemory=_BinaryenCurrentMemory()]="CurrentMemory",e[e.GrowMemory=_BinaryenGrowMemory()]="GrowMemory"}(r.HostOp||(r.HostOp={})),function(e){e[e.Add=_BinaryenAtomicRMWAdd()]="Add",e[e.Sub=_BinaryenAtomicRMWSub()]="Sub",e[e.And=_BinaryenAtomicRMWAnd()]="And",e[e.Or=_BinaryenAtomicRMWOr()]="Or",e[e.Xor=_BinaryenAtomicRMWXor()]="Xor",e[e.Xchg=_BinaryenAtomicRMWXchg()]="Xchg"}(r.AtomicRMWOp||(r.AtomicRMWOp={})),function(e){e[e.ExtractLaneSVecI8x16=_BinaryenExtractLaneSVecI8x16()]="ExtractLaneSVecI8x16",e[e.ExtractLaneUVecI8x16=_BinaryenExtractLaneUVecI8x16()]="ExtractLaneUVecI8x16",e[e.ExtractLaneSVecI16x8=_BinaryenExtractLaneSVecI16x8()]="ExtractLaneSVecI16x8",e[e.ExtractLaneUVecI16x8=_BinaryenExtractLaneUVecI16x8()]="ExtractLaneUVecI16x8",e[e.ExtractLaneVecI32x4=_BinaryenExtractLaneVecI32x4()]="ExtractLaneVecI32x4",e[e.ExtractLaneVecI64x2=_BinaryenExtractLaneVecI64x2()]="ExtractLaneVecI64x2",e[e.ExtractLaneVecF32x4=_BinaryenExtractLaneVecF32x4()]="ExtractLaneVecF32x4",e[e.ExtractLaneVecF64x2=_BinaryenExtractLaneVecF64x2()]="ExtractLaneVecF64x2"}(r.SIMDExtractOp||(r.SIMDExtractOp={})),function(e){e[e.ReplaceLaneVecI8x16=_BinaryenReplaceLaneVecI8x16()]="ReplaceLaneVecI8x16",e[e.ReplaceLaneVecI16x8=_BinaryenReplaceLaneVecI16x8()]="ReplaceLaneVecI16x8",e[e.ReplaceLaneVecI32x4=_BinaryenReplaceLaneVecI32x4()]="ReplaceLaneVecI32x4",e[e.ReplaceLaneVecI64x2=_BinaryenReplaceLaneVecI64x2()]="ReplaceLaneVecI64x2",e[e.ReplaceLaneVecF32x4=_BinaryenReplaceLaneVecF32x4()]="ReplaceLaneVecF32x4",e[e.ReplaceLaneVecF64x2=_BinaryenReplaceLaneVecF64x2()]="ReplaceLaneVecF64x2"}(r.SIMDReplaceOp||(r.SIMDReplaceOp={})),function(e){e[e.ShlVecI8x16=_BinaryenShlVecI8x16()]="ShlVecI8x16",e[e.ShrSVecI8x16=_BinaryenShrSVecI8x16()]="ShrSVecI8x16",e[e.ShrUVecI8x16=_BinaryenShrUVecI8x16()]="ShrUVecI8x16",e[e.ShlVecI16x8=_BinaryenShlVecI16x8()]="ShlVecI16x8",e[e.ShrSVecI16x8=_BinaryenShrSVecI16x8()]="ShrSVecI16x8",e[e.ShrUVecI16x8=_BinaryenShrUVecI16x8()]="ShrUVecI16x8",e[e.ShlVecI32x4=_BinaryenShlVecI32x4()]="ShlVecI32x4",e[e.ShrSVecI32x4=_BinaryenShrSVecI32x4()]="ShrSVecI32x4",e[e.ShrUVecI32x4=_BinaryenShrUVecI32x4()]="ShrUVecI32x4",e[e.ShlVecI64x2=_BinaryenShlVecI64x2()]="ShlVecI64x2",e[e.ShrSVecI64x2=_BinaryenShrSVecI64x2()]="ShrSVecI64x2",e[e.ShrUVecI64x2=_BinaryenShrUVecI64x2()]="ShrUVecI64x2"}(r.SIMDShiftOp||(r.SIMDShiftOp={}));var o=function(){function e(){}return e.create=function(r,t){var n=new e;return n.buffer=r,n.offset=t,n},e}();r.MemorySegment=o;var c=function(){function e(){this.hasTemporaryFunction=!1,this.cachedPrecomputeNames=0,this.cachedStrings=new Map}return e.create=function(){var r=new e;return r.ref=_BinaryenModuleCreate(),r.lit=memory.allocate(_BinaryenSizeofLiteral()),r},e.createFrom=function(r){var t=p(r);try{var n=new e;return n.ref=_BinaryenModuleRead(t,r.length),n.lit=memory.allocate(_BinaryenSizeofLiteral()),n}finally{memory.free(changetype(t))}},e.prototype.addFunctionType=function(e,r,t){var n=this.allocStringCached(e),i=u(t);try{return _BinaryenAddFunctionType(this.ref,n,r,i,t?t.length:0)}finally{memory.free(i)}},e.prototype.getFunctionTypeBySignature=function(e,r){var t=u(r);try{return _BinaryenGetFunctionTypeBySignature(this.ref,e,t,r?r.length:0)}finally{memory.free(t)}},e.prototype.removeFunctionType=function(e){var r=this.allocStringCached(e);_BinaryenRemoveFunctionType(this.ref,r)},e.prototype.createI32=function(e){var r=this.lit;return _BinaryenLiteralInt32(r,e),_BinaryenConst(this.ref,r)},e.prototype.createI64=function(e,r){void 0===r&&(r=0);var t=this.lit;return _BinaryenLiteralInt64(t,e,r),_BinaryenConst(this.ref,t)},e.prototype.createF32=function(e){var r=this.lit;return _BinaryenLiteralFloat32(r,e),_BinaryenConst(this.ref,r)},e.prototype.createF64=function(e){var r=this.lit;return _BinaryenLiteralFloat64(r,e),_BinaryenConst(this.ref,r)},e.prototype.createV128=function(e){assert(16==e.length);for(var r=this.lit,t=0;t<16;++t)store(r+t,e[t]);return _BinaryenLiteralVec128(r,r),_BinaryenConst(this.ref,r)},e.prototype.createUnary=function(e,r){return _BinaryenUnary(this.ref,e,r)},e.prototype.createBinary=function(e,r,t){return _BinaryenBinary(this.ref,e,r,t)},e.prototype.createHost=function(e,r,t){void 0===r&&(r=null),void 0===t&&(t=null);var n=this.allocStringCached(r),i=_(t);try{return _BinaryenHost(this.ref,e,n,i,t?t.length:0)}finally{memory.free(i)}},e.prototype.createGetLocal=function(e,r){return _BinaryenGetLocal(this.ref,e,r)},e.prototype.createTeeLocal=function(e,r){return _BinaryenTeeLocal(this.ref,e,r)},e.prototype.createGetGlobal=function(e,r){var t=this.allocStringCached(e);return _BinaryenGetGlobal(this.ref,t,r)},e.prototype.createLoad=function(e,r,t,n,i,a){return void 0===i&&(i=0),void 0===a&&(a=e),_BinaryenLoad(this.ref,e,r?1:0,i,a,n,t)},e.prototype.createStore=function(e,r,t,n,i,a){return void 0===i&&(i=0),void 0===a&&(a=e),_BinaryenStore(this.ref,e,i,a,r,t,n)},e.prototype.createAtomicLoad=function(e,r,t,n){return void 0===n&&(n=0),_BinaryenAtomicLoad(this.ref,e,n,t,r)},e.prototype.createAtomicStore=function(e,r,t,n,i){return void 0===i&&(i=0),_BinaryenAtomicStore(this.ref,e,i,r,t,n)},e.prototype.createAtomicRMW=function(e,r,t,n,i,a){return _BinaryenAtomicRMW(this.ref,e,r,t,n,i,a)},e.prototype.createAtomicCmpxchg=function(e,r,t,n,i,a){return _BinaryenAtomicCmpxchg(this.ref,e,r,t,n,i,a)},e.prototype.createAtomicWait=function(e,r,t,n){return _BinaryenAtomicWait(this.ref,e,r,t,n)},e.prototype.createAtomicNotify=function(e,r){return _BinaryenAtomicNotify(this.ref,e,r)},e.prototype.createSetLocal=function(e,r){return _BinaryenSetLocal(this.ref,e,r)},e.prototype.createSetGlobal=function(e,r){var t=this.allocStringCached(e);return _BinaryenSetGlobal(this.ref,t,r)},e.prototype.createBlock=function(e,r,t){void 0===t&&(t=i.None);var n=this.allocStringCached(e),a=_(r);try{return _BinaryenBlock(this.ref,n,a,r.length,t)}finally{memory.free(a)}},e.prototype.createBreak=function(e,r,t){void 0===r&&(r=0),void 0===t&&(t=0);var n=this.allocStringCached(e);return _BinaryenBreak(this.ref,n,r,t)},e.prototype.createDrop=function(e){return _BinaryenDrop(this.ref,e)},e.prototype.createLoop=function(e,r){var t=this.allocStringCached(e);return _BinaryenLoop(this.ref,t,r)},e.prototype.createIf=function(e,r,t){return void 0===t&&(t=0),_BinaryenIf(this.ref,e,r,t)},e.prototype.createNop=function(){return _BinaryenNop(this.ref)},e.prototype.createReturn=function(e){return void 0===e&&(e=0),_BinaryenReturn(this.ref,e)},e.prototype.createSelect=function(e,r,t){return _BinaryenSelect(this.ref,t,e,r)},e.prototype.createSwitch=function(e,r,t,n){void 0===n&&(n=0);for(var i=e.length,a=new Array(i),s=0;s=0;--y)memory.free(l[y])}},e.prototype.setFunctionTable=function(e,r,t){for(var n=t.length,i=new Array(n),a=0;a=0;--i)memory.free(n[i])}},e.prototype.precomputeExpression=function(e){var r=_BinaryenGetOptimizeLevel(),t=_BinaryenGetShrinkLevel(),n=_BinaryenGetDebugInfo();_BinaryenSetOptimizeLevel(4),_BinaryenSetShrinkLevel(0),_BinaryenSetDebugInfo(!1);var i=_BinaryenExpressionGetType(e),a=this.addTemporaryFunction(i,null,e),s=this.cachedPrecomputeNames;return s||(this.cachedPrecomputeNames=s=u([this.allocStringCached("precompute")])),_BinaryenFunctionRunPasses(a,this.ref,s,1),e=_BinaryenFunctionGetBody(a),this.removeTemporaryFunction(),_BinaryenSetOptimizeLevel(r),_BinaryenSetShrinkLevel(t),_BinaryenSetDebugInfo(n),e},e.prototype.validate=function(){return 1==_BinaryenModuleValidate(this.ref)},e.prototype.interpret=function(){_BinaryenModuleInterpret(this.ref)},e.prototype.toBinary=function(e){var r=this.lit;assert(_BinaryenSizeofLiteral()>=12);var t=h(e),n=0,i=0;try{_BinaryenModuleAllocateAndWrite(r,this.ref,t),n=d(r);var a=d(r+4);i=d(r+8);var s=new m;return s.output=function(e,r){for(var t=new Uint8Array(r),n=0;n>8&255),store(t+2,a>>16&255),store(t+3,a>>>24),t+=4}return r}function _(e){return u(e)}function h(e){if(null==e)return 0;for(var r=memory.allocate(function(e){for(var r=0,t=0,n=e.length;t=55296&&i<=57343&&t+1=55296&&a<=57343&&n+1>>6),store(t++,128|63&a)):a<=65535?(store(t++,224|a>>>12),store(t++,128|a>>>6&63),store(t++,128|63&a)):a<=2097151?(store(t++,240|a>>>18),store(t++,128|a>>>12&63),store(t++,128|a>>>6&63),store(t++,128|63&a)):a<=67108863?(store(t++,248|a>>>24),store(t++,128|a>>>18&63),store(t++,128|a>>>12&63),store(t++,128|a>>>6&63),store(t++,128|63&a)):(store(t++,252|a>>>30),store(t++,128|a>>>24&63),store(t++,128|a>>>18&63),store(t++,128|a>>>12&63),store(t++,128|a>>>6&63),store(t++,128|63&a))}return store(t,0),r}function d(e){return load(e)|load(e+1)<<8|load(e+2)<<16|load(e+3)<<24}function y(e){if(!e)return null;for(var r,t,n,i,a,s=new Array;r=load(e++);)128&r?(t=63&load(e++),192!=(224&r)?(n=63&load(e++),224==(240&r)?r=(15&r)<<12|t<<6|n:(i=63&load(e++),240==(248&r)?r=(7&r)<<18|t<<12|n<<6|i:(a=63&load(e++),r=248==(252&r)?(3&r)<<24|t<<18|n<<12|i<<6|a:(1&r)<<30|t<<24|n<<18|i<<12|a<<6|63&load(e++))),s.push(r)):s.push((31&r)<<6|t)):s.push(r);return String.fromCodePoints(s)}r.Relooper=l,r.readString=y;var m=function(){return function(){}}();r.BinaryModule=m,r.needsExplicitUnreachable=function e(r){if(_BinaryenExpressionGetType(r)!=i.Unreachable)return!1;switch(_BinaryenExpressionGetId(r)){case a.Unreachable:case a.Return:return!1;case a.Break:return 0!=_BinaryenBreakGetCondition(r);case a.Block:if(!_BinaryenBlockGetName(r)){var t=_BinaryenBlockGetNumChildren(r);return t>0&&e(_BinaryenBlockGetChild(r,t-1))}}return!0}},function(e,r,t){"use strict";var n,i=this&&this.__extends||(n=function(e,r){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)r.hasOwnProperty(t)&&(e[t]=r[t])})(e,r)},function(e,r){function t(){this.constructor=e}n(e,r),e.prototype=null===r?Object.create(r):(t.prototype=r.prototype,new t)});Object.defineProperty(r,"__esModule",{value:!0});var a=t(0),s=t(7);r.Token=s.Token,r.Range=s.Range;var o,c=t(1);!function(e){e[e.SOURCE=0]="SOURCE",e[e.TYPE=1]="TYPE",e[e.TYPENAME=2]="TYPENAME",e[e.TYPEPARAMETER=3]="TYPEPARAMETER",e[e.PARAMETER=4]="PARAMETER",e[e.SIGNATURE=5]="SIGNATURE",e[e.IDENTIFIER=6]="IDENTIFIER",e[e.ASSERTION=7]="ASSERTION",e[e.BINARY=8]="BINARY",e[e.CALL=9]="CALL",e[e.CLASS=10]="CLASS",e[e.COMMA=11]="COMMA",e[e.ELEMENTACCESS=12]="ELEMENTACCESS",e[e.FALSE=13]="FALSE",e[e.FUNCTION=14]="FUNCTION",e[e.INSTANCEOF=15]="INSTANCEOF",e[e.LITERAL=16]="LITERAL",e[e.NEW=17]="NEW",e[e.NULL=18]="NULL",e[e.PARENTHESIZED=19]="PARENTHESIZED",e[e.PROPERTYACCESS=20]="PROPERTYACCESS",e[e.TERNARY=21]="TERNARY",e[e.SUPER=22]="SUPER",e[e.THIS=23]="THIS",e[e.TRUE=24]="TRUE",e[e.CONSTRUCTOR=25]="CONSTRUCTOR",e[e.UNARYPOSTFIX=26]="UNARYPOSTFIX",e[e.UNARYPREFIX=27]="UNARYPREFIX",e[e.BLOCK=28]="BLOCK",e[e.BREAK=29]="BREAK",e[e.CONTINUE=30]="CONTINUE",e[e.DO=31]="DO",e[e.EMPTY=32]="EMPTY",e[e.EXPORT=33]="EXPORT",e[e.EXPORTIMPORT=34]="EXPORTIMPORT",e[e.EXPRESSION=35]="EXPRESSION",e[e.FOR=36]="FOR",e[e.IF=37]="IF",e[e.IMPORT=38]="IMPORT",e[e.RETURN=39]="RETURN",e[e.SWITCH=40]="SWITCH",e[e.THROW=41]="THROW",e[e.TRY=42]="TRY",e[e.VARIABLE=43]="VARIABLE",e[e.VOID=44]="VOID",e[e.WHILE=45]="WHILE",e[e.CLASSDECLARATION=46]="CLASSDECLARATION",e[e.ENUMDECLARATION=47]="ENUMDECLARATION",e[e.ENUMVALUEDECLARATION=48]="ENUMVALUEDECLARATION",e[e.FIELDDECLARATION=49]="FIELDDECLARATION",e[e.FUNCTIONDECLARATION=50]="FUNCTIONDECLARATION",e[e.IMPORTDECLARATION=51]="IMPORTDECLARATION",e[e.INDEXSIGNATUREDECLARATION=52]="INDEXSIGNATUREDECLARATION",e[e.INTERFACEDECLARATION=53]="INTERFACEDECLARATION",e[e.METHODDECLARATION=54]="METHODDECLARATION",e[e.NAMESPACEDECLARATION=55]="NAMESPACEDECLARATION",e[e.TYPEDECLARATION=56]="TYPEDECLARATION",e[e.VARIABLEDECLARATION=57]="VARIABLEDECLARATION",e[e.DECORATOR=58]="DECORATOR",e[e.EXPORTMEMBER=59]="EXPORTMEMBER",e[e.SWITCHCASE=60]="SWITCHCASE",e[e.COMMENT=61]="COMMENT"}(o=r.NodeKind||(r.NodeKind={})),r.nodeIsConstantValue=function(e){switch(e){case o.LITERAL:case o.NULL:case o.TRUE:case o.FALSE:return!0}return!1},r.nodeIsCallable=function(e){switch(e){case o.IDENTIFIER:case o.ASSERTION:case o.CALL:case o.ELEMENTACCESS:case o.PARENTHESIZED:case o.PROPERTYACCESS:case o.SUPER:return!0}return!1},r.nodeIsGenericCallable=function(e){switch(e){case o.IDENTIFIER:case o.PROPERTYACCESS:return!0}return!1};var l=function(){function e(){}return e.createTypeName=function(e,r){var t=new u;return t.range=r,t.identifier=e,t.next=null,t},e.createSimpleTypeName=function(r,t){return e.createTypeName(e.createIdentifierExpression(r,t),t)},e.createType=function(e,r,t,n){var i=new _;return i.range=n,i.name=e,i.typeArguments=r,i.isNullable=t,i},e.createOmittedType=function(r){return e.createType(e.createSimpleTypeName("",r),null,!1,r)},e.createTypeParameter=function(e,r,t,n){var i=new h;return i.range=n,i.name=e,i.extendsType=r,i.defaultType=t,i},e.createParameter=function(e,r,t,n,i){var a=new d;return a.range=i,a.name=e,a.type=r,a.initializer=t,a.parameterKind=n,a},e.createSignature=function(e,r,t,n,i){var a=new m;return a.range=i,a.parameters=e,a.returnType=r,a.explicitThisType=t,a.isNullable=n,a},e.createDecorator=function(e,r,t){var n=new f;return n.range=t,n.name=e,n.arguments=r,n.decoratorKind=T(e),n},e.createComment=function(e,r,t){var n=new E;return n.range=t,n.commentKind=r,n.text=e,n},e.createIdentifierExpression=function(e,r,t){void 0===t&&(t=!1);var n=new I;return n.range=r,n.text=e,n.symbol=e,n.isQuoted=t,n},e.createEmptyIdentifierExpression=function(e){var r=new I;return r.range=e,r.text="",r},e.createArrayLiteralExpression=function(e,r){var t=new x;return t.range=r,t.elementExpressions=e,t},e.createAssertionExpression=function(e,r,t,n){var i=new S;return i.range=n,i.assertionKind=e,i.expression=r,i.toType=t,i},e.createBinaryExpression=function(e,r,t,n){var i=new A;return i.range=n,i.operator=e,i.left=r,i.right=t,i},e.createCallExpression=function(e,r,t,n){var i=new N;return i.range=n,i.expression=e,i.typeArguments=r,i.arguments=t,i},e.createClassExpression=function(e){var r=new O;return r.range=e.range,r.declaration=e,r},e.createCommaExpression=function(e,r){var t=new C;return t.range=r,t.expressions=e,t},e.createConstructorExpression=function(e){var r=new k;return r.range=e,r},e.createElementAccessExpression=function(e,r,t){var n=new R;return n.range=t,n.expression=e,n.elementExpression=r,n},e.createFalseExpression=function(e){var r=new X;return r.range=e,r},e.createFloatLiteralExpression=function(e,r){var t=new L;return t.range=r,t.value=e,t},e.createFunctionExpression=function(e){var r=new F;return r.range=e.range,r.declaration=e,r},e.createInstanceOfExpression=function(e,r,t){var n=new B;return n.range=t,n.expression=e,n.isType=r,n},e.createIntegerLiteralExpression=function(e,r){var t=new U;return t.range=r,t.value=e,t},e.createNewExpression=function(e,r,t,n){var i=new D;return i.range=n,i.expression=e,i.typeArguments=r,i.arguments=t,i},e.createNullExpression=function(e){var r=new w;return r.range=e,r},e.createObjectLiteralExpression=function(e,r,t){var n=new P;return n.range=t,n.names=e,n.values=r,n},e.createParenthesizedExpression=function(e,r){var t=new M;return t.range=r,t.expression=e,t},e.createPropertyAccessExpression=function(e,r,t){var n=new V;return n.range=t,n.expression=e,n.property=r,n},e.createRegexpLiteralExpression=function(e,r,t){var n=new G;return n.range=t,n.pattern=e,n.patternFlags=r,n},e.createTernaryExpression=function(e,r,t,n){var i=new K;return i.range=n,i.condition=e,i.ifThen=r,i.ifElse=t,i},e.createStringLiteralExpression=function(e,r){var t=new z;return t.range=r,t.value=e,t},e.createSuperExpression=function(e){var r=new H;return r.range=e,r},e.createThisExpression=function(e){var r=new Y;return r.range=e,r},e.createTrueExpression=function(e){var r=new W;return r.range=e,r},e.createUnaryPostfixExpression=function(e,r,t){var n=new Q;return n.range=t,n.operator=e,n.operand=r,n},e.createUnaryPrefixExpression=function(e,r,t){var n=new j;return n.range=t,n.operator=e,n.operand=r,n},e.createBlockStatement=function(e,r){var t=new ne;return t.range=r,t.statements=e,t},e.createBreakStatement=function(e,r){var t=new ie;return t.range=r,t.label=e,t},e.createClassDeclaration=function(e,r,t,n,i,a,s,o){var c=new ae;return c.range=o,c.flags=s,c.name=e,c.typeParameters=r,c.extendsType=t,c.implementsTypes=n,c.members=i,c.decorators=a,c},e.createContinueStatement=function(e,r){var t=new se;return t.range=r,t.label=e,t},e.createDoStatement=function(e,r,t){var n=new oe;return n.range=t,n.statement=e,n.condition=r,n},e.createEmptyStatement=function(e){var r=new ce;return r.range=e,r},e.createEnumDeclaration=function(e,r,t,n,i){var a=new le;return a.range=i,a.flags=n,a.name=e,a.values=r,a.decorators=t,a},e.createEnumValueDeclaration=function(e,r,t,n){var i=new pe;return i.range=n,i.flags=t,i.name=e,i.value=r,i},e.createExportStatement=function(e,r,t,n){var i=new he;if(i.range=n,i.members=e,i.path=r,r){var a=c.normalizePath(r.value);r.value.startsWith(".")?i.normalizedPath=c.resolvePath(a,n.source.normalizedPath):i.normalizedPath=a,i.internalPath=Be(i.normalizedPath)}else i.normalizedPath=null,i.internalPath=null;return i.isDeclare=t,i},e.createExportImportStatement=function(e,r,t){var n=new ue;return n.range=t,n.name=e,n.externalName=r,n},e.createExportMember=function(e,r,t){var n=new _e;return n.range=t,n.localName=e,r||(r=e),n.exportedName=r,n},e.createExpressionStatement=function(e){var r=new de;return r.range=e.range,r.expression=e,r},e.createIfStatement=function(e,r,t,n){var i=new fe;return i.range=n,i.condition=e,i.ifTrue=r,i.ifFalse=t,i},e.createImportStatement=function(e,r,t){var n=new ge;n.range=t,n.declarations=e,n.namespaceName=null,n.path=r;var i=c.normalizePath(r.value);return r.value.startsWith(".")?n.normalizedPath=c.resolvePath(i,t.source.normalizedPath):(i.startsWith(a.LIBRARY_PREFIX)||(i=a.LIBRARY_PREFIX+i),n.normalizedPath=i),n.internalPath=Be(n.normalizedPath),n},e.createImportStatementWithWildcard=function(e,r,t){var n=new ge;return n.range=t,n.declarations=null,n.namespaceName=e,n.path=r,n.normalizedPath=c.resolvePath(c.normalizePath(r.value),t.source.normalizedPath),n.internalPath=Be(n.normalizedPath),n},e.createImportDeclaration=function(e,r,t){var n=new Ee;return n.range=t,n.foreignName=e,r||(r=e),n.name=r,n},e.createInterfaceDeclaration=function(e,r,t,n,i,a,s){var o=new ve;return o.range=s,o.flags=a,o.name=e,o.typeParameters=r,o.extendsType=t,o.members=n,o.decorators=i,o},e.createFieldDeclaration=function(e,r,t,n,i,a){var s=new ye;return s.range=a,s.flags=i,s.name=e,s.type=r,s.initializer=t,s.decorators=n,s},e.createForStatement=function(e,r,t,n,i){var a=new me;return a.range=i,a.initializer=e,a.condition=r,a.incrementor=t,a.statement=n,a},e.createFunctionDeclaration=function(e,r,t,n,i,a,s,o){var c=new Te;return c.range=o,c.flags=a,c.name=e,c.typeParameters=r,c.signature=t,c.body=n,c.decorators=i,c.arrowKind=s,c},e.createIndexSignatureDeclaration=function(e,r,t){var n=new re;return n.range=t,n.keyType=e,n.valueType=r,n},e.createMethodDeclaration=function(e,r,t,n,i,a,s){var o=new Ie;return o.range=s,o.flags=a,o.name=e,o.typeParameters=r,o.signature=t,o.body=n,o.decorators=i,o},e.createNamespaceDeclaration=function(e,r,t,n,i){var a=new be;return a.range=i,a.flags=n,a.name=e,a.members=r,a.decorators=t,a},e.createReturnStatement=function(e,r){var t=new xe;return t.range=r,t.value=e,t},e.createSwitchStatement=function(e,r,t){var n=new Ae;return n.range=t,n.condition=e,n.cases=r,n},e.createSwitchCase=function(e,r,t){var n=new Se;return n.range=t,n.label=e,n.statements=r,n},e.createThrowStatement=function(e,r){var t=new Ne;return t.range=r,t.value=e,t},e.createTryStatement=function(e,r,t,n,i){var a=new Oe;return a.range=i,a.statements=e,a.catchVariable=r,a.catchStatements=t,a.finallyStatements=n,a},e.createTypeDeclaration=function(e,r,t,n,i,a){var s=new Ce;return s.range=a,s.flags=i,s.name=e,s.typeParameters=r,s.type=t,s.decorators=n,s},e.createVariableStatement=function(e,r,t){var n=new Re;return n.range=t,n.declarations=e,n.decorators=r,n},e.createVariableDeclaration=function(e,r,t,n,i,a){var s=new ke;return s.range=a,s.flags=i,s.name=e,s.type=r,s.initializer=t,s.decorators=n,s},e.createVoidStatement=function(e,r){var t=new Le;return t.range=r,t.expression=e,t},e.createWhileStatement=function(e,r,t){var n=new Fe;return n.range=t,n.condition=e,n.statement=r,n},e}();r.Node=l;var p=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return i(r,e),r}(l);r.CommonTypeNode=p;var u=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.TYPENAME,r}return i(r,e),r}(l);r.TypeName=u;var _=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.TYPE,r}return i(r,e),r}(p);r.TypeNode=_;var h=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.TYPEPARAMETER,r}return i(r,e),r}(l);r.TypeParameterNode=h,function(e){e[e.DEFAULT=0]="DEFAULT",e[e.OPTIONAL=1]="OPTIONAL",e[e.REST=2]="REST"}(r.ParameterKind||(r.ParameterKind={}));var d=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.PARAMETER,r.implicitFieldDeclaration=null,r.flags=a.CommonFlags.NONE,r}return i(r,e),r.prototype.is=function(e){return(this.flags&e)==e},r.prototype.isAny=function(e){return 0!=(this.flags&e)},r.prototype.set=function(e){this.flags|=e},r}(l);r.ParameterNode=d;var y,m=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.SIGNATURE,r}return i(r,e),r}(p);function T(e){if(e.kind==o.IDENTIFIER){var r=e.text;switch(assert(r.length),r.charCodeAt(0)){case 98:if("builtin"==r)return y.BUILTIN;break;case 101:if("external"==r)return y.EXTERNAL;break;case 103:if("global"==r)return y.GLOBAL;break;case 105:if("inline"==r)return y.INLINE;break;case 108:if("lazy"==r)return y.LAZY;break;case 111:if("operator"==r)return y.OPERATOR;break;case 115:if("sealed"==r)return y.SEALED;if("start"==r)return y.START;break;case 117:if("unmanaged"==r)return y.UNMANAGED}}else if(e.kind==o.PROPERTYACCESS&&e.expression.kind==o.IDENTIFIER){r=e.expression.text;assert(r.length);var t=e.property.text;if(assert(t.length),"operator"==r)switch(t.charCodeAt(0)){case 98:if("binary"==t)return y.OPERATOR_BINARY;break;case 112:switch(t){case"prefix":return y.OPERATOR_PREFIX;case"postfix":return y.OPERATOR_POSTFIX}}}return y.CUSTOM}r.SignatureNode=m,function(e){e[e.CUSTOM=0]="CUSTOM",e[e.GLOBAL=1]="GLOBAL",e[e.OPERATOR=2]="OPERATOR",e[e.OPERATOR_BINARY=3]="OPERATOR_BINARY",e[e.OPERATOR_PREFIX=4]="OPERATOR_PREFIX",e[e.OPERATOR_POSTFIX=5]="OPERATOR_POSTFIX",e[e.UNMANAGED=6]="UNMANAGED",e[e.SEALED=7]="SEALED",e[e.INLINE=8]="INLINE",e[e.EXTERNAL=9]="EXTERNAL",e[e.BUILTIN=10]="BUILTIN",e[e.LAZY=11]="LAZY",e[e.START=12]="START"}(y=r.DecoratorKind||(r.DecoratorKind={})),r.decoratorNameToKind=T;var f=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.DECORATOR,r}return i(r,e),r}(l);r.DecoratorNode=f,function(e){e[e.LINE=0]="LINE",e[e.TRIPLE=1]="TRIPLE",e[e.BLOCK=2]="BLOCK"}(r.CommentKind||(r.CommentKind={}));var E=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.COMMENT,r}return i(r,e),r}(l);r.CommentNode=E;var g=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return i(r,e),r}(l);r.Expression=g;var v,I=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.IDENTIFIER,r}return i(r,e),r}(g);r.IdentifierExpression=I,function(e){e[e.FLOAT=0]="FLOAT",e[e.INTEGER=1]="INTEGER",e[e.STRING=2]="STRING",e[e.REGEXP=3]="REGEXP",e[e.ARRAY=4]="ARRAY",e[e.OBJECT=5]="OBJECT"}(v=r.LiteralKind||(r.LiteralKind={}));var b=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.LITERAL,r}return i(r,e),r}(g);r.LiteralExpression=b;var x=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.literalKind=v.ARRAY,r}return i(r,e),r}(b);r.ArrayLiteralExpression=x,function(e){e[e.PREFIX=0]="PREFIX",e[e.AS=1]="AS",e[e.NONNULL=2]="NONNULL"}(r.AssertionKind||(r.AssertionKind={}));var S=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.ASSERTION,r}return i(r,e),r}(g);r.AssertionExpression=S;var A=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.BINARY,r}return i(r,e),r}(g);r.BinaryExpression=A;var N=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.CALL,r}return i(r,e),Object.defineProperty(r.prototype,"typeArgumentsRange",{get:function(){var e,r=this.typeArguments;return r&&(e=r.length)?s.Range.join(r[0].range,r[e-1].range):this.expression.range},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"argumentsRange",{get:function(){var e=this.arguments,r=e.length;return r?s.Range.join(e[0].range,e[r-1].range):this.expression.range},enumerable:!0,configurable:!0}),r}(g);r.CallExpression=N;var O=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.CLASS,r}return i(r,e),r}(g);r.ClassExpression=O;var C=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.COMMA,r}return i(r,e),r}(g);r.CommaExpression=C;var k=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.CONSTRUCTOR,r.text="constructor",r.symbol=a.CommonSymbols.constructor,r}return i(r,e),r}(I);r.ConstructorExpression=k;var R=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.ELEMENTACCESS,r}return i(r,e),r}(g);r.ElementAccessExpression=R;var L=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.literalKind=v.FLOAT,r}return i(r,e),r}(b);r.FloatLiteralExpression=L;var F=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.FUNCTION,r}return i(r,e),r}(g);r.FunctionExpression=F;var B=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.INSTANCEOF,r}return i(r,e),r}(g);r.InstanceOfExpression=B;var U=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.literalKind=v.INTEGER,r}return i(r,e),r}(b);r.IntegerLiteralExpression=U;var D=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.NEW,r}return i(r,e),r}(N);r.NewExpression=D;var w=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.NULL,r.text="null",r.symbol=a.CommonSymbols.null_,r}return i(r,e),r}(I);r.NullExpression=w;var P=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.literalKind=v.OBJECT,r}return i(r,e),r}(b);r.ObjectLiteralExpression=P;var M=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.PARENTHESIZED,r}return i(r,e),r}(g);r.ParenthesizedExpression=M;var V=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.PROPERTYACCESS,r}return i(r,e),r}(g);r.PropertyAccessExpression=V;var G=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.literalKind=v.REGEXP,r}return i(r,e),r}(b);r.RegexpLiteralExpression=G;var K=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.TERNARY,r}return i(r,e),r}(g);r.TernaryExpression=K;var z=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.literalKind=v.STRING,r}return i(r,e),r}(b);r.StringLiteralExpression=z;var H=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.SUPER,r.text="super",r.symbol=a.CommonSymbols.super_,r}return i(r,e),r}(I);r.SuperExpression=H;var Y=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.THIS,r.text="this",r.symbol=a.CommonSymbols.this_,r}return i(r,e),r}(I);r.ThisExpression=Y;var W=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.TRUE,r.text="true",r.symbol=a.CommonSymbols.true_,r}return i(r,e),r}(I);r.TrueExpression=W;var X=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.FALSE,r.text="false",r.symbol=a.CommonSymbols.false_,r}return i(r,e),r}(I);r.FalseExpression=X;var q=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return i(r,e),r}(g);r.UnaryExpression=q;var Q=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.UNARYPOSTFIX,r}return i(r,e),r}(q);r.UnaryPostfixExpression=Q;var j=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.UNARYPREFIX,r}return i(r,e),r}(q);r.UnaryPrefixExpression=j;var Z,J=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return i(r,e),r}(l);r.Statement=J,function(e){e[e.DEFAULT=0]="DEFAULT",e[e.ENTRY=1]="ENTRY",e[e.LIBRARY=2]="LIBRARY"}(Z=r.SourceKind||(r.SourceKind={}));var $=function(e){function r(r,t,n){var i=e.call(this)||this;i.kind=o.SOURCE,i.parent=null,i.tokenizer=null,i.debugInfoIndex=-1,i.exportPaths=null,i.sourceKind=n,i.normalizedPath=r;var c=Be(i.normalizedPath);i.internalPath=c;var l=c.lastIndexOf(a.PATH_DELIMITER);return i.simplePath=l>=0?c.substring(l+1):c,i.statements=new Array,i.range=new s.Range(i,0,t.length),i.text=t,i}return i(r,e),Object.defineProperty(r.prototype,"isEntry",{get:function(){return this.sourceKind==Z.ENTRY},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"isLibrary",{get:function(){return this.sourceKind==Z.LIBRARY},enumerable:!0,configurable:!0}),r}(l);r.Source=$;var ee=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.decorators=null,r.flags=a.CommonFlags.NONE,r}return i(r,e),r.prototype.is=function(e){return(this.flags&e)==e},r.prototype.isAny=function(e){return 0!=(this.flags&e)},r.prototype.set=function(e){this.flags|=e},r}(J);r.DeclarationStatement=ee;var re=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.INDEXSIGNATUREDECLARATION,r}return i(r,e),r}(ee);r.IndexSignatureDeclaration=re;var te=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return i(r,e),r}(ee);r.VariableLikeDeclarationStatement=te;var ne=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.BLOCK,r}return i(r,e),r}(J);r.BlockStatement=ne;var ie=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.BREAK,r}return i(r,e),r}(J);r.BreakStatement=ie;var ae=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.CLASSDECLARATION,r}return i(r,e),Object.defineProperty(r.prototype,"isGeneric",{get:function(){var e=this.typeParameters;return null!=e&&e.length>0},enumerable:!0,configurable:!0}),r}(ee);r.ClassDeclaration=ae;var se=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.CONTINUE,r}return i(r,e),r}(J);r.ContinueStatement=se;var oe=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.DO,r}return i(r,e),r}(J);r.DoStatement=oe;var ce=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.EMPTY,r}return i(r,e),r}(J);r.EmptyStatement=ce;var le=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.ENUMDECLARATION,r}return i(r,e),r}(ee);r.EnumDeclaration=le;var pe=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.ENUMVALUEDECLARATION,r}return i(r,e),r}(te);r.EnumValueDeclaration=pe;var ue=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.EXPORTIMPORT,r}return i(r,e),r}(l);r.ExportImportStatement=ue;var _e=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.EXPORTMEMBER,r}return i(r,e),r}(l);r.ExportMember=_e;var he=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.EXPORT,r}return i(r,e),r}(J);r.ExportStatement=he;var de=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.EXPRESSION,r}return i(r,e),r}(J);r.ExpressionStatement=de;var ye=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.FIELDDECLARATION,r.parameterIndex=-1,r}return i(r,e),r}(te);r.FieldDeclaration=ye;var me=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.FOR,r}return i(r,e),r}(J);r.ForStatement=me,function(e){e[e.NONE=0]="NONE",e[e.ARROW_PARENTHESIZED=1]="ARROW_PARENTHESIZED",e[e.ARROW_SINGLE=2]="ARROW_SINGLE"}(r.ArrowKind||(r.ArrowKind={}));var Te=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.FUNCTIONDECLARATION,r}return i(r,e),Object.defineProperty(r.prototype,"isGeneric",{get:function(){var e=this.typeParameters;return null!=e&&e.length>0},enumerable:!0,configurable:!0}),r.prototype.clone=function(){return l.createFunctionDeclaration(this.name,this.typeParameters,this.signature,this.body,this.decorators,this.flags,this.arrowKind,this.range)},r}(ee);r.FunctionDeclaration=Te;var fe=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.IF,r}return i(r,e),r}(J);r.IfStatement=fe;var Ee=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.IMPORTDECLARATION,r}return i(r,e),r}(ee);r.ImportDeclaration=Ee;var ge=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.IMPORT,r}return i(r,e),r}(J);r.ImportStatement=ge;var ve=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.INTERFACEDECLARATION,r}return i(r,e),r}(ae);r.InterfaceDeclaration=ve;var Ie=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.METHODDECLARATION,r}return i(r,e),r}(Te);r.MethodDeclaration=Ie;var be=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.NAMESPACEDECLARATION,r}return i(r,e),r}(ee);r.NamespaceDeclaration=be;var xe=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.RETURN,r}return i(r,e),r}(J);r.ReturnStatement=xe;var Se=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.SWITCHCASE,r}return i(r,e),r}(l);r.SwitchCase=Se;var Ae=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.SWITCH,r}return i(r,e),r}(J);r.SwitchStatement=Ae;var Ne=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.THROW,r}return i(r,e),r}(J);r.ThrowStatement=Ne;var Oe=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.TRY,r}return i(r,e),r}(J);r.TryStatement=Oe;var Ce=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.TYPEDECLARATION,r}return i(r,e),r}(ee);r.TypeDeclaration=Ce;var ke=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.VARIABLEDECLARATION,r}return i(r,e),r}(te);r.VariableDeclaration=ke;var Re=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.VARIABLE,r}return i(r,e),r}(J);r.VariableStatement=Re;var Le=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.VOID,r}return i(r,e),r}(J);r.VoidStatement=Le;var Fe=function(e){function r(){var r=null!==e&&e.apply(this,arguments)||this;return r.kind=o.WHILE,r}return i(r,e),r}(J);function Be(e){return e.endsWith(".ts")&&(e=e.substring(0,e.length-3)),e}r.WhileStatement=Fe,r.findDecorator=function(e,r){if(r)for(var t=0,n=r.length;t>>e.size-r},e.prototype.is=function(e){return(this.flags&e)==e},e.prototype.isAny=function(e){return 0!=(this.flags&e)},e.prototype.asClass=function(r){assert(9==this.kind&&!this.classReference);var t=new e(this.kind,-129&this.flags|256,this.size);return t.classReference=r,t},e.prototype.asFunction=function(r){assert(7==this.kind&&!this.signatureReference);var t=new e(this.kind,-129&this.flags|256,this.size);return t.signatureReference=r,t},e.prototype.asNullable=function(){return assert(this.is(256)),this.cachedNullableType||(assert(!this.is(512)),this.cachedNullableType=new e(this.kind,512|this.flags,this.size),this.cachedNullableType.nonNullableType=this,this.cachedNullableType.classReference=this.classReference,this.cachedNullableType.signatureReference=this.signatureReference),this.cachedNullableType},e.prototype.isAssignableTo=function(r,t){var n,i,a,s;if(void 0===t&&(t=!1),this.is(256)){if(r.is(256)&&(!this.is(512)||r.is(512)))if(n=this.classReference){if(i=r.classReference)return n.isAssignableTo(i)}else if((a=this.signatureReference)&&(s=r.signatureReference))return a.isAssignableTo(s)}else if(!r.is(256))if(this.is(4))if(r.is(4)){if(!t||this==e.bool||this.is(1)==r.is(1))return this.size<=r.size}else{if(11==r.kind)return this.size<=23;if(12==r.kind)return this.size<=52}else if(this.is(8)){if(r.is(8))return this.size<=r.size}else if(this.is(1024)&&r.is(1024))return this.size==r.size;return!1},e.prototype.isStrictlyAssignableTo=function(e,r){return void 0===r&&(r=!1),this.is(256)?this.isAssignableTo(e):!e.is(256)&&(this.is(4)?e.is(4)&&e.size==this.size&&(!r||this.is(1)==e.is(1)):this.kind==e.kind)},e.commonDenominator=function(e,r,t){return r.isAssignableTo(e,t)?e:e.isAssignableTo(r,t)?r:null},e.prototype.toString=function(){if(this.is(256)){var e=this.classReference;if(e)return this.is(512)?e.internalName+" | null":e.internalName;var r=this.signatureReference;if(r)return this.is(512)?"("+r.toString()+") | null":r.toString();assert(!1)}switch(this.kind){case 0:return"i8";case 1:return"i16";case 2:return"i32";case 3:return"i64";case 4:return"isize";case 5:return"u8";case 6:return"u16";case 7:return"u32";case 8:return"u64";case 9:return"usize";case 10:return"bool";case 11:return"f32";case 12:return"f64";case 13:return"v128";default:assert(!1);case 14:return"void"}},e.prototype.toNativeType=function(){switch(this.kind){default:return i.NativeType.I32;case 3:case 8:return i.NativeType.I64;case 4:case 9:return 64==this.size?i.NativeType.I64:i.NativeType.I32;case 11:return i.NativeType.F32;case 12:return i.NativeType.F64;case 13:return i.NativeType.V128;case 14:return i.NativeType.None}},e.prototype.toNativeZero=function(e){switch(this.kind){case 14:assert(!1);default:return e.createI32(0);case 4:case 9:if(64!=this.size)return e.createI32(0);case 3:case 8:return e.createI64(0);case 11:return e.createF32(0);case 12:return e.createF64(0);case 13:return e.createV128(a)}},e.prototype.toNativeOne=function(e){switch(this.kind){case 13:case 14:assert(!1);default:return e.createI32(1);case 4:case 9:if(64!=this.size)return e.createI32(1);case 3:case 8:return e.createI64(1);case 11:return e.createF32(1);case 12:return e.createF64(1)}},e.prototype.toNativeNegOne=function(e){switch(this.kind){case 13:case 14:assert(!1);default:return e.createI32(-1);case 4:case 9:if(64!=this.size)return e.createI32(-1);case 3:case 8:return e.createI64(-1,-1);case 11:return e.createF32(-1);case 12:return e.createF64(-1)}},e.prototype.toSignatureString=function(){switch(this.kind){case 0:case 5:case 1:case 6:case 2:case 7:case 10:return"i";case 3:case 8:return"j";case 4:case 9:return 64==this.size?"j":"i";case 11:return"f";case 12:return"d";case 13:return"V";case 14:return"v";default:assert(!1)}return"i"},e.i8=new e(0,165,8),e.i16=new e(1,165,16),e.i32=new e(2,133,32),e.i64=new e(3,197,64),e.isize32=new e(4,149,32),e.isize64=new e(4,213,64),e.u8=new e(5,166,8),e.u16=new e(6,166,16),e.u32=new e(7,134,32),e.u64=new e(8,198,64),e.usize32=new e(9,150,32),e.usize64=new e(9,214,64),e.bool=new e(10,166,1),e.f32=new e(11,137,32),e.f64=new e(12,201,64),e.v128=new e(13,1152,128),e.void=new e(14,0,0),e}();r.Type=s,r.typesToNativeTypes=function(e){for(var r=e.length,t=new Array(r),n=0;ne?r[e]:l(e)},e.prototype.isAssignableTo=function(e){var r=this.thisType,t=e.thisType;if(r){if(!t||!r.isAssignableTo(t))return!1}else if(t)return!1;if(this.hasRest!=e.hasRest)return!1;var n=this.parameterTypes,i=e.parameterTypes,a=n.length;if(a!=i.length)return!1;for(var s=0;s=o&&p!=c?e.push("?: "):e.push(": "),e.push(n[p].toString());return e.push(") => "),e.push(this.returnType.toString()),e.join("")},e}();r.Signature=o;var c=null;function l(e){c||(c=[]);for(var r=c.length;r<=e;++r)c.push("arg$"+r.toString(10));return c[e-1]}r.getDefaultParameterName=l},function(e,r,t){"use strict";var n,i=this&&this.__extends||(n=function(e,r){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)r.hasOwnProperty(t)&&(e[t]=r[t])})(e,r)},function(e,r){function t(){this.constructor=e}n(e,r),e.prototype=null===r?Object.create(r):(t.prototype=r.prototype,new t)});Object.defineProperty(r,"__esModule",{value:!0});var a,s,o=t(2),c=t(5),l=t(1);function p(e){switch(assert(e.length),e.charCodeAt(0)){case 97:switch(e){case"abstract":return a.ABSTRACT;case"as":return a.AS;case"async":return a.ASYNC;case"await":return a.AWAIT}break;case 98:switch(e){case"break":return a.BREAK}break;case 99:switch(e){case"case":return a.CASE;case"catch":return a.CATCH;case"class":return a.CLASS;case"continue":return a.CONTINUE;case"const":return a.CONST;case"constructor":return a.CONSTRUCTOR}break;case 100:switch(e){case"debugger":return a.DEBUGGER;case"declare":return a.DECLARE;case"default":return a.DEFAULT;case"delete":return a.DELETE;case"do":return a.DO}break;case 101:switch(e){case"else":return a.ELSE;case"enum":return a.ENUM;case"export":return a.EXPORT;case"extends":return a.EXTENDS}break;case 102:switch(e){case"false":return a.FALSE;case"finally":return a.FINALLY;case"for":return a.FOR;case"from":return a.FROM;case"function":return a.FUNCTION}break;case 103:switch(e){case"get":return a.GET}break;case 105:switch(e){case"if":return a.IF;case"implements":return a.IMPLEMENTS;case"import":return a.IMPORT;case"in":return a.IN;case"instanceof":return a.INSTANCEOF;case"interface":return a.INTERFACE;case"is":return a.IS}break;case 107:switch(e){case"keyof":return a.KEYOF}break;case 108:switch(e){case"let":return a.LET}break;case 109:switch(e){case"module":return a.MODULE}break;case 110:switch(e){case"namespace":return a.NAMESPACE;case"new":return a.NEW;case"null":return a.NULL}break;case 111:switch(e){case"of":return a.OF}break;case 112:switch(e){case"package":return a.PACKAGE;case"private":return a.PRIVATE;case"protected":return a.PROTECTED;case"public":return a.PUBLIC}break;case 114:switch(e){case"readonly":return a.READONLY;case"return":return a.RETURN}break;case 115:switch(e){case"set":return a.SET;case"static":return a.STATIC;case"super":return a.SUPER;case"switch":return a.SWITCH}break;case 116:switch(e){case"this":return a.THIS;case"throw":return a.THROW;case"true":return a.TRUE;case"try":return a.TRY;case"type":return a.TYPE;case"typeof":return a.TYPEOF}break;case 118:switch(e){case"var":return a.VAR;case"void":return a.VOID}break;case 119:switch(e){case"while":return a.WHILE;case"with":return a.WITH}break;case 121:switch(e){case"yield":return a.YIELD}}return a.INVALID}function u(e){switch(e){case a.ABSTRACT:case a.AS:case a.CONSTRUCTOR:case a.DECLARE:case a.DELETE:case a.FROM:case a.FOR:case a.GET:case a.IS:case a.KEYOF:case a.MODULE:case a.NAMESPACE:case a.READONLY:case a.SET:case a.TYPE:case a.VOID:return!0;default:return!1}}!function(e){e[e.ABSTRACT=0]="ABSTRACT",e[e.AS=1]="AS",e[e.ASYNC=2]="ASYNC",e[e.AWAIT=3]="AWAIT",e[e.BREAK=4]="BREAK",e[e.CASE=5]="CASE",e[e.CATCH=6]="CATCH",e[e.CLASS=7]="CLASS",e[e.CONST=8]="CONST",e[e.CONTINUE=9]="CONTINUE",e[e.CONSTRUCTOR=10]="CONSTRUCTOR",e[e.DEBUGGER=11]="DEBUGGER",e[e.DECLARE=12]="DECLARE",e[e.DEFAULT=13]="DEFAULT",e[e.DELETE=14]="DELETE",e[e.DO=15]="DO",e[e.ELSE=16]="ELSE",e[e.ENUM=17]="ENUM",e[e.EXPORT=18]="EXPORT",e[e.EXTENDS=19]="EXTENDS",e[e.FALSE=20]="FALSE",e[e.FINALLY=21]="FINALLY",e[e.FOR=22]="FOR",e[e.FROM=23]="FROM",e[e.FUNCTION=24]="FUNCTION",e[e.GET=25]="GET",e[e.IF=26]="IF",e[e.IMPLEMENTS=27]="IMPLEMENTS",e[e.IMPORT=28]="IMPORT",e[e.IN=29]="IN",e[e.INSTANCEOF=30]="INSTANCEOF",e[e.INTERFACE=31]="INTERFACE",e[e.IS=32]="IS",e[e.KEYOF=33]="KEYOF",e[e.LET=34]="LET",e[e.MODULE=35]="MODULE",e[e.NAMESPACE=36]="NAMESPACE",e[e.NEW=37]="NEW",e[e.NULL=38]="NULL",e[e.OF=39]="OF",e[e.PACKAGE=40]="PACKAGE",e[e.PRIVATE=41]="PRIVATE",e[e.PROTECTED=42]="PROTECTED",e[e.PUBLIC=43]="PUBLIC",e[e.READONLY=44]="READONLY",e[e.RETURN=45]="RETURN",e[e.SET=46]="SET",e[e.STATIC=47]="STATIC",e[e.SUPER=48]="SUPER",e[e.SWITCH=49]="SWITCH",e[e.THIS=50]="THIS",e[e.THROW=51]="THROW",e[e.TRUE=52]="TRUE",e[e.TRY=53]="TRY",e[e.TYPE=54]="TYPE",e[e.TYPEOF=55]="TYPEOF",e[e.VAR=56]="VAR",e[e.VOID=57]="VOID",e[e.WHILE=58]="WHILE",e[e.WITH=59]="WITH",e[e.YIELD=60]="YIELD",e[e.OPENBRACE=61]="OPENBRACE",e[e.CLOSEBRACE=62]="CLOSEBRACE",e[e.OPENPAREN=63]="OPENPAREN",e[e.CLOSEPAREN=64]="CLOSEPAREN",e[e.OPENBRACKET=65]="OPENBRACKET",e[e.CLOSEBRACKET=66]="CLOSEBRACKET",e[e.DOT=67]="DOT",e[e.DOT_DOT_DOT=68]="DOT_DOT_DOT",e[e.SEMICOLON=69]="SEMICOLON",e[e.COMMA=70]="COMMA",e[e.LESSTHAN=71]="LESSTHAN",e[e.GREATERTHAN=72]="GREATERTHAN",e[e.LESSTHAN_EQUALS=73]="LESSTHAN_EQUALS",e[e.GREATERTHAN_EQUALS=74]="GREATERTHAN_EQUALS",e[e.EQUALS_EQUALS=75]="EQUALS_EQUALS",e[e.EXCLAMATION_EQUALS=76]="EXCLAMATION_EQUALS",e[e.EQUALS_EQUALS_EQUALS=77]="EQUALS_EQUALS_EQUALS",e[e.EXCLAMATION_EQUALS_EQUALS=78]="EXCLAMATION_EQUALS_EQUALS",e[e.EQUALS_GREATERTHAN=79]="EQUALS_GREATERTHAN",e[e.PLUS=80]="PLUS",e[e.MINUS=81]="MINUS",e[e.ASTERISK_ASTERISK=82]="ASTERISK_ASTERISK",e[e.ASTERISK=83]="ASTERISK",e[e.SLASH=84]="SLASH",e[e.PERCENT=85]="PERCENT",e[e.PLUS_PLUS=86]="PLUS_PLUS",e[e.MINUS_MINUS=87]="MINUS_MINUS",e[e.LESSTHAN_LESSTHAN=88]="LESSTHAN_LESSTHAN",e[e.GREATERTHAN_GREATERTHAN=89]="GREATERTHAN_GREATERTHAN",e[e.GREATERTHAN_GREATERTHAN_GREATERTHAN=90]="GREATERTHAN_GREATERTHAN_GREATERTHAN",e[e.AMPERSAND=91]="AMPERSAND",e[e.BAR=92]="BAR",e[e.CARET=93]="CARET",e[e.EXCLAMATION=94]="EXCLAMATION",e[e.TILDE=95]="TILDE",e[e.AMPERSAND_AMPERSAND=96]="AMPERSAND_AMPERSAND",e[e.BAR_BAR=97]="BAR_BAR",e[e.QUESTION=98]="QUESTION",e[e.COLON=99]="COLON",e[e.EQUALS=100]="EQUALS",e[e.PLUS_EQUALS=101]="PLUS_EQUALS",e[e.MINUS_EQUALS=102]="MINUS_EQUALS",e[e.ASTERISK_EQUALS=103]="ASTERISK_EQUALS",e[e.ASTERISK_ASTERISK_EQUALS=104]="ASTERISK_ASTERISK_EQUALS",e[e.SLASH_EQUALS=105]="SLASH_EQUALS",e[e.PERCENT_EQUALS=106]="PERCENT_EQUALS",e[e.LESSTHAN_LESSTHAN_EQUALS=107]="LESSTHAN_LESSTHAN_EQUALS",e[e.GREATERTHAN_GREATERTHAN_EQUALS=108]="GREATERTHAN_GREATERTHAN_EQUALS",e[e.GREATERTHAN_GREATERTHAN_GREATERTHAN_EQUALS=109]="GREATERTHAN_GREATERTHAN_GREATERTHAN_EQUALS",e[e.AMPERSAND_EQUALS=110]="AMPERSAND_EQUALS",e[e.BAR_EQUALS=111]="BAR_EQUALS",e[e.CARET_EQUALS=112]="CARET_EQUALS",e[e.AT=113]="AT",e[e.IDENTIFIER=114]="IDENTIFIER",e[e.STRINGLITERAL=115]="STRINGLITERAL",e[e.INTEGERLITERAL=116]="INTEGERLITERAL",e[e.FLOATLITERAL=117]="FLOATLITERAL",e[e.INVALID=118]="INVALID",e[e.ENDOFFILE=119]="ENDOFFILE"}(a=r.Token||(r.Token={})),function(e){e[e.DEFAULT=0]="DEFAULT",e[e.PREFER=1]="PREFER",e[e.ALWAYS=2]="ALWAYS"}(s=r.IdentifierHandling||(r.IdentifierHandling={})),r.tokenFromKeyword=p,r.tokenIsAlsoIdentifier=u,r.operatorTokenToString=function(e){switch(e){case a.DELETE:return"delete";case a.IN:return"in";case a.INSTANCEOF:return"instanceof";case a.NEW:return"new";case a.TYPEOF:return"typeof";case a.VOID:return"void";case a.YIELD:return"yield";case a.DOT_DOT_DOT:return"...";case a.COMMA:return",";case a.LESSTHAN:return"<";case a.GREATERTHAN:return">";case a.LESSTHAN_EQUALS:return"<=";case a.GREATERTHAN_EQUALS:return">=";case a.EQUALS_EQUALS:return"==";case a.EXCLAMATION_EQUALS:return"!=";case a.EQUALS_EQUALS_EQUALS:return"===";case a.EXCLAMATION_EQUALS_EQUALS:return"!==";case a.PLUS:return"+";case a.MINUS:return"-";case a.ASTERISK_ASTERISK:return"**";case a.ASTERISK:return"*";case a.SLASH:return"/";case a.PERCENT:return"%";case a.PLUS_PLUS:return"++";case a.MINUS_MINUS:return"--";case a.LESSTHAN_LESSTHAN:return"<<";case a.GREATERTHAN_GREATERTHAN:return">>";case a.GREATERTHAN_GREATERTHAN_GREATERTHAN:return">>>";case a.AMPERSAND:return"&";case a.BAR:return"|";case a.CARET:return"^";case a.EXCLAMATION:return"!";case a.TILDE:return"~";case a.AMPERSAND_AMPERSAND:return"&&";case a.BAR_BAR:return"||";case a.EQUALS:return"=";case a.PLUS_EQUALS:return"+=";case a.MINUS_EQUALS:return"-=";case a.ASTERISK_EQUALS:return"*=";case a.ASTERISK_ASTERISK_EQUALS:return"**=";case a.SLASH_EQUALS:return"/=";case a.PERCENT_EQUALS:return"%=";case a.LESSTHAN_LESSTHAN_EQUALS:return"<<=";case a.GREATERTHAN_GREATERTHAN_EQUALS:return">>=";case a.GREATERTHAN_GREATERTHAN_GREATERTHAN_EQUALS:return">>>=";case a.AMPERSAND_EQUALS:return"&=";case a.BAR_EQUALS:return"|=";case a.CARET_EQUALS:return"^=";default:return assert(!1),""}};var _=function(){function e(e,r,t){this.debugInfoRef=0,this.source=e,this.start=r,this.end=t}return e.join=function(r,t){if(r.source!=t.source)throw new Error("source mismatch");return new e(r.source,r.startt.end?r.end:t.end)},Object.defineProperty(e.prototype,"atStart",{get:function(){return new e(this.source,this.start,this.start)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"atEnd",{get:function(){return new e(this.source,this.end,this.end)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"line",{get:function(){for(var e=this.source.text,r=1,t=this.start;t>=0;--t)10==e.charCodeAt(t)&&r++;return r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"column",{get:function(){for(var e=this.source.text,r=0,t=this.start-1;t>=0&&10!=e.charCodeAt(t);--t)++r;return r},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return this.source.text.substring(this.start,this.end)},e}();r.Range=_;var h=function(e){function r(r,t){void 0===t&&(t=null);var n=e.call(this,t)||this;n.end=0,n.pos=0,n.token=-1,n.tokenPos=0,n.nextToken=-1,n.nextTokenPos=0,n.nextTokenOnNewLine=!1,n.onComment=null,n.source=r,n.pos=0,n.end=r.text.length,n.diagnostics=t||new Array;var i=r.text;if(n.pos1&&this.pos2&&this.pos1&&this.pos1&&this.pos1&&this.pos2&&this.pos1&&this.pos1&&this.pos1&&this.pos2&&this.pos+11&&this.pos1&&this.pos2&&this.pos1&&this.pos2&&this.pos1&&this.pos2&&this.pos3&&this.pos1&&this.pos1&&this.pos=this.end){n+=e.substring(t,this.pos),this.error(o.DiagnosticCode.Unterminated_string_literal,this.range(t-1,this.end));break}var i=e.charCodeAt(this.pos);if(i==r){n+=e.substring(t,this.pos++);break}if(92!=i){if(l.isLineBreak(i)){n+=e.substring(t,this.pos),this.error(o.DiagnosticCode.Unterminated_string_literal,this.range(t-1,this.pos));break}++this.pos}else n+=e.substring(t,this.pos),n+=this.readEscapeSequence(),t=this.pos}return n},r.prototype.readEscapeSequence=function(){if(++this.pos>=this.end)return this.error(o.DiagnosticCode.Unexpected_end_of_text,this.range(this.end)),"";var e=this.source.text,r=e.charCodeAt(this.pos++);switch(r){case 48:return"\0";case 98:return"\b";case 116:return"\t";case 110:return"\n";case 118:return"\v";case 102:return"\f";case 114:return"\r";case 39:return"'";case 34:return'"';case 117:return this.pos=this.end){this.error(o.DiagnosticCode.Unterminated_regular_expression_literal,this.range(r,this.end));break}if(92!=e.charCodeAt(this.pos)){var n=e.charCodeAt(this.pos);if(!t&&47==n)break;if(l.isLineBreak(n)){this.error(o.DiagnosticCode.Unterminated_regular_expression_literal,this.range(r,this.pos));break}++this.pos,t=!1}else++this.pos,t=!0}return e.substring(r,this.pos)},r.prototype.readRegexpFlags=function(){for(var e=this.source.text,r=this.pos,t=0;this.pos57)&&95!=t)break;r++}return!0},r.prototype.readInteger=function(){var e=this.source.text;if(this.pos+2=48&&s<=57)t=i64_add(i64_shl(t,n),i64_new(s-48));else if(s>=65&&s<=70)t=i64_add(i64_shl(t,n),i64_new(10+s-65));else if(s>=97&&s<=102)t=i64_add(i64_shl(t,n),i64_new(10+s-97));else{if(95!=s)break;i==a&&this.error(i==r?o.DiagnosticCode.Numeric_separators_are_not_allowed_here:o.DiagnosticCode.Multiple_consecutive_numeric_separators_are_not_permitted,this.range(a)),i=a+1}this.pos=a+1}return this.pos==r?this.error(o.DiagnosticCode.Hexadecimal_digit_expected,this.range(r)):i==this.pos&&this.error(o.DiagnosticCode.Numeric_separators_are_not_allowed_here,this.range(i-1)),t},r.prototype.readDecimalInteger=function(){for(var e=this.source.text,r=this.pos,t=i64_new(0),n=i64_new(10),i=r;this.pos=48&&s<=57)t=i64_add(i64_mul(t,n),i64_new(s-48));else{if(95!=s)break;i==a&&this.error(i==r?o.DiagnosticCode.Numeric_separators_are_not_allowed_here:o.DiagnosticCode.Multiple_consecutive_numeric_separators_are_not_permitted,this.range(a)),i=a+1}this.pos=a+1}return this.pos==r?this.error(o.DiagnosticCode.Digit_expected,this.range(r)):i==this.pos&&this.error(o.DiagnosticCode.Numeric_separators_are_not_allowed_here,this.range(i-1)),t},r.prototype.readOctalInteger=function(){for(var e=this.source.text,r=this.pos,t=i64_new(0),n=i64_new(3),i=r;this.pos=48&&s<=55)t=i64_add(i64_shl(t,n),i64_new(s-48));else{if(95!=s)break;i==a&&this.error(i==r?o.DiagnosticCode.Numeric_separators_are_not_allowed_here:o.DiagnosticCode.Multiple_consecutive_numeric_separators_are_not_permitted,this.range(a)),i=a+1}++this.pos}return this.pos==r?this.error(o.DiagnosticCode.Octal_digit_expected,this.range(r)):i==this.pos&&this.error(o.DiagnosticCode.Numeric_separators_are_not_allowed_here,this.range(i-1)),t},r.prototype.readBinaryInteger=function(){for(var e=this.source.text,r=this.pos,t=i64_new(0),n=i64_new(1),i=r;this.pos=48&&n<=57)r=(r<<4)+n-48;else if(n>=65&&n<=70)r=(r<<4)+n+-55;else{if(!(n>=97&&n<=102))return this.error(o.DiagnosticCode.Hexadecimal_digit_expected,this.range(this.pos-1,this.pos)),"";r=(r<<4)+n+-87}if(0==--e)break}return e?(this.error(o.DiagnosticCode.Unexpected_end_of_text,this.range(this.pos)),""):String.fromCharCode(r)},r.prototype.readExtendedUnicodeEscape=function(){var e=this.pos,r=this.readHexInteger(),t=i64_low(r),n=!1;assert(!i64_high(r)),t>1114111&&(this.error(o.DiagnosticCode.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive,this.range(e,this.pos)),n=!0);var i=this.source.text;return this.pos>=this.end?(this.error(o.DiagnosticCode.Unexpected_end_of_text,this.range(e,this.end)),n=!0):125==i.charCodeAt(this.pos)?++this.pos:(this.error(o.DiagnosticCode.Unterminated_Unicode_escape_sequence,this.range(e,this.pos)),n=!0),n?"":t<65536?String.fromCharCode(t):String.fromCharCode(55296+(t-65536>>>10),56320+(t-65536&1023))},r.prototype.finish=function(){},r}(o.DiagnosticEmitter);r.Tokenizer=h;var d=function(){return function(){}}();r.State=d;var y=null},function(e,r){var t;t=function(){return this}();try{t=t||new Function("return this")()}catch(e){"object"==typeof window&&(t=window)}e.exports=t},function(e,r,t){"use strict";var n,i=this&&this.__extends||(n=function(e,r){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)r.hasOwnProperty(t)&&(e[t]=r[t])})(e,r)},function(e,r){function t(){this.constructor=e}n(e,r),e.prototype=null===r?Object.create(r):(t.prototype=r.prototype,new t)}),a=this&&this.__values||function(e){var r="function"==typeof Symbol&&e[Symbol.iterator],t=0;return r?r.call(e):{next:function(){return e&&t>=e.length&&(e=void 0),{value:e&&e[t++],done:!e}}}},s=this&&this.__read||function(e,r){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var n,i,a=t.call(e),s=[];try{for(;(void 0===r||r-- >0)&&!(n=a.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(t=a.return)&&t.call(a)}finally{if(i)throw i.error}}return s};Object.defineProperty(r,"__esModule",{value:!0});var o,c=t(2),l=t(3),p=t(5),u=t(6),_=t(0),h=t(1),d=t(7);!function(e){e[e.REPORT=0]="REPORT",e[e.SWALLOW=1]="SWALLOW"}(o=r.ReportMode||(r.ReportMode={}));var y=function(e){function r(r){var t=e.call(this,r.diagnostics)||this;return t.currentThisExpression=null,t.currentElementExpression=null,t.program=r,t}return i(r,e),r.prototype.resolveType=function(e,r,t,n){if(void 0===t&&(t=null),void 0===n&&(n=o.REPORT),e.kind==p.NodeKind.SIGNATURE){var i=e.explicitThisType,a=null;if(i&&!(a=this.resolveType(i,r,t,n)))return null;for(var s=e.parameters,d=s.length,y=new Array(d),m=new Array(d),T=0,f=!1,E=0;El)return this.error(c.DiagnosticCode.Expected_0_type_arguments_but_got_1,_?p.Range.join(r[0].range,r[_-1].range):assert(i).range,(_");var w=new l.Function(D,e,U,t);return e.setResolvedInstance(s,w),w},r.prototype.resolveFunctionInclTypeArguments=function(e,r,t,n,i,a){void 0===a&&(a=o.REPORT);var s=e.parent.kind==l.ElementKind.PROPERTY_PROTOTYPE?e.parent.parent:e.parent,p=null;if(e.is(_.CommonFlags.GENERIC)){if(e.is(_.CommonFlags.INSTANCE)){assert(s.kind==l.ElementKind.CLASS);var u=s.typeArguments;if(u){var h=assert(s.prototype.typeParameterNodes),d=u.length;assert(d==h.length);for(var y=0;y"),(E=new l.Class(N,e,r,S)).contextualTypeArguments=t,e.setResolvedInstance(f,E);var O=0;if(S){if(G=S.members){(P=E.members)||(E.members=P=new Map);try{for(var C=a(G),k=C.next();!k.done;k=C.next()){var R=s(k.value,2),L=R[0],F=R[1];P.set(L,F)}}catch(e){i={error:e}}finally{try{k&&!k.done&&(p=C.return)&&p.call(C)}finally{if(i)throw i.error}}}O=S.currentMemoryOffset}var B=e.instanceMembers;if(B)try{for(var U=a(B.values()),D=U.next();!D.done;D=U.next()){var w=D.value;switch(w.kind){case l.ElementKind.FIELD_PROTOTYPE:var P;if(P=E.members){if(P.has(w.name)){this.error(c.DiagnosticCode.Duplicate_identifier_0,w.identifierNode.range,w.name);break}}else E.members=P=new Map;var M=w.typeNode,V=null;if(M)V=this.resolveType(M,e.parent,E.contextualTypeArguments,n);else{var G;if(S)if((G=S.members)&&G.has(w.name)){var K=G.get(w.name);K.is(_.CommonFlags.PRIVATE)||(assert(K.kind==l.ElementKind.FIELD),V=K.type)}V||n==o.REPORT&&this.error(c.DiagnosticCode.Type_expected,w.identifierNode.range.atEnd)}if(!V)break;var z=new l.Field(w,E,V);assert(h.isPowerOf2(V.byteSize));var H=V.byteSize-1;O&H&&(O=1+(O|H)),z.memoryOffset=O,O+=V.byteSize,E.add(w.name,z);break;case l.ElementKind.FUNCTION_PROTOTYPE:var Y=w.toBound(E);E.add(Y.name,Y);break;case l.ElementKind.PROPERTY_PROTOTYPE:var W=new l.Property(w,E),X=w.getterPrototype;if(X){var q=this.resolveFunction(X.toBound(E),null,h.makeMap(E.contextualTypeArguments),n);q&&(W.getterInstance=q,W.setType(q.signature.returnType))}var Q=w.setterPrototype;if(Q){var j=this.resolveFunction(Q.toBound(E),null,h.makeMap(E.contextualTypeArguments),n);j&&(W.setterInstance=j,W.is(_.CommonFlags.RESOLVED)||(assert(1==j.signature.parameterTypes.length),W.setType(j.signature.parameterTypes[0])))}E.add(W.name,W);break;default:assert(!1)}}}catch(e){d={error:e}}finally{try{D&&!D.done&&(y=U.return)&&y.call(U)}finally{if(d)throw d.error}}E.currentMemoryOffset=O;var Z=E.lookupInSelf(_.CommonSymbols.constructor);if(Z&&Z.parent===E){assert(Z.kind==l.ElementKind.FUNCTION_PROTOTYPE);var J=this.resolveFunction(Z,null,E.contextualTypeArguments,n);J&&(E.constructorInstance=J)}try{for(var $=a(e.overloadPrototypes),ee=$.next();!ee.done;ee=$.next()){var re=s(ee.value,2),te=re[0],ne=re[1];assert(te!=l.OperatorKind.INVALID);var ie=void 0;if(ne.is(_.CommonFlags.INSTANCE)){Y=ne.toBound(E);ie=this.resolveFunction(Y,null,h.makeMap(),n)}else ie=this.resolveFunction(ne,null,h.makeMap(),n);if(ie){var ae=E.overloads;ae||(E.overloads=ae=new Map),ae.set(te,ie)}}}catch(e){m={error:e}}finally{try{ee&&!ee.done&&(T=$.return)&&T.call($)}finally{if(m)throw m.error}}return E},r.prototype.resolveClassInclTypeArguments=function(e,r,t,n,i,a){void 0===a&&(a=o.REPORT);var s=null;if(e.is(_.CommonFlags.GENERIC)){if(!(s=this.resolveTypeArguments(assert(e.typeParameterNodes),r,t,n,i,a)))return null}else if(null!==r&&r.length)return a==o.REPORT&&this.error(c.DiagnosticCode.Type_0_is_not_generic,i.range,e.internalName),null;return this.resolveClass(e,s,n,a)},r}(c.DiagnosticEmitter);r.Resolver=y},function(e,r,t){"use strict";var n,i=this&&this.__extends||(n=function(e,r){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)r.hasOwnProperty(t)&&(e[t]=r[t])})(e,r)},function(e,r){function t(){this.constructor=e}n(e,r),e.prototype=null===r?Object.create(r):(t.prototype=r.prototype,new t)}),a=this&&this.__values||function(e){var r="function"==typeof Symbol&&e[Symbol.iterator],t=0;return r?r.call(e):{next:function(){return e&&t>=e.length&&(e=void 0),{value:e&&e[t++],done:!e}}}},s=this&&this.__read||function(e,r){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var n,i,a=t.call(e),s=[];try{for(;(void 0===r||r-- >0)&&!(n=a.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(t=a.return)&&t.call(a)}finally{if(i)throw i.error}}return s};Object.defineProperty(r,"__esModule",{value:!0});var o,c=t(24),l=t(2),p=t(4),u=t(0),_=t(3),h=t(12),d=t(9),y=t(7),m=t(5),T=t(6),f=t(1);!function(e){e[e.WASM32=0]="WASM32",e[e.WASM64=1]="WASM64"}(o=r.Target||(r.Target={}));var E=function(){function e(){this.target=o.WASM32,this.noAssert=!1,this.importMemory=!1,this.sharedMemory=0,this.importTable=!1,this.sourceMap=!1,this.memoryBase=0,this.globalAliases=null,this.features=0,this.optimizeLevelHint=0,this.shrinkLevelHint=0}return Object.defineProperty(e.prototype,"isWasm64",{get:function(){return this.target==o.WASM64},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"usizeType",{get:function(){return this.target==o.WASM64?T.Type.usize64:T.Type.usize32},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isizeType",{get:function(){return this.target==o.WASM64?T.Type.isize64:T.Type.isize32},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nativeSizeType",{get:function(){return this.target==o.WASM64?p.NativeType.I64:p.NativeType.I32},enumerable:!0,configurable:!0}),e.prototype.hasFeature=function(e){return 0!=(this.features&e)},e}();r.Options=E,function(e){e[e.NONE=0]="NONE",e[e.SIGN_EXTENSION=1]="SIGN_EXTENSION",e[e.MUTABLE_GLOBAL=2]="MUTABLE_GLOBAL",e[e.BULK_MEMORY=4]="BULK_MEMORY",e[e.SIMD=8]="SIMD",e[e.THREADS=16]="THREADS"}(r.Feature||(r.Feature={})),function(e){e[e.NONE=0]="NONE",e[e.IMPLICIT=1]="IMPLICIT",e[e.EXPLICIT=2]="EXPLICIT"}(r.ConversionKind||(r.ConversionKind={})),function(e){e[e.NONE=0]="NONE",e[e.WRAP=1]="WRAP"}(r.WrapMode||(r.WrapMode={}));var g,v,I,b=function(e){function r(r,t){void 0===t&&(t=null);var n=e.call(this,r.diagnostics)||this;return n.currentInlineFunctions=[],n.currentEnum=null,n.currentType=T.Type.void,n.memorySegments=[],n.stringSegments=new Map,n.functionTable=["null"],n.argcVar=0,n.argcSet=0,n.needsIterateRoots=!1,n.f32ModInstance=null,n.f64ModInstance=null,n.f32PowInstance=null,n.f64PowInstance=null,n.program=r,n.resolver=r.resolver,t||(t=new E),n.options=t,n.memoryOffset=i64_new(max(t.memoryBase,8)),n.module=p.Module.create(),n}return i(r,e),r.compile=function(e,t){return void 0===t&&(t=null),new r(e,t).compile()},r.prototype.compile=function(){var e,r,t,n,i=this.options,s=this.module,o=this.program;o.initialize(i);var l=o.makeNativeFunction("start",new T.Signature([],T.Type.void));l.internalName="start";var u=new Array;this.currentFlow=l.flow,this.currentBody=u,i.isWasm64?s.addGlobal(c.BuiltinSymbols.HEAP_BASE,p.NativeType.I64,!0,s.createI64(0,0)):s.addGlobal(c.BuiltinSymbols.HEAP_BASE,p.NativeType.I32,!1,s.createI32(0));var _=o.filesByName;try{for(var h=a(_.values()),d=h.next();!d.done;d=h.next()){(x=d.value).source.isEntry&&(this.compileFile(x),this.compileExports(x))}}catch(r){e={error:r}}finally{try{d&&!d.done&&(r=h.return)&&r.call(h)}finally{if(e)throw e.error}}var y=o.explicitStartFunction;if(u.length||y){var m=l.signature,f=s.addFunction(l.internalName,this.ensureFunctionType(m.parameterTypes,m.returnType,m.thisType),T.typesToNativeTypes(l.additionalLocals),s.createBlock(null,u));l.finalize(s,f),y||s.setStart(f)}var E=this.memoryOffset;E=i64_align(E,i.usizeType.byteSize),this.memoryOffset=E,s.removeGlobal(c.BuiltinSymbols.HEAP_BASE),i.isWasm64?s.addGlobal(c.BuiltinSymbols.HEAP_BASE,p.NativeType.I64,!1,s.createI64(i64_low(E),i64_high(E))):s.addGlobal(c.BuiltinSymbols.HEAP_BASE,p.NativeType.I32,!1,s.createI32(i64_low(E)));var g=i.hasFeature(16)&&i.sharedMemory>0;s.setMemory(this.options.memoryBase||this.memorySegments.length?i64_low(i64_shr_u(i64_align(E,65536),i64_new(16,0))):0,g?i.sharedMemory:p.Module.UNLIMITED_MEMORY,this.memorySegments,i.target,"memory",g),i.importMemory&&s.addMemoryImport("0","env","memory",g);var v=this.functionTable;s.setFunctionTable(v.length,4294967295,v),s.addTableExport("0","table"),s.addFunction("null",this.ensureFunctionType(null,T.Type.void),null,s.createBlock(null,[])),i.importTable&&s.addTableImport("0","env","table");try{for(var I=a(this.program.filesByName.values()),b=I.next();!b.done;b=I.next()){var x;(x=b.value).source.isEntry&&this.makeModuleExports(x)}}catch(e){t={error:e}}finally{try{b&&!b.done&&(n=I.return)&&n.call(I)}finally{if(t)throw t.error}}return this.needsIterateRoots&&c.compileIterateRoots(this),s},r.prototype.makeModuleExports=function(e){var r,t,n=e.exports;if(n)try{for(var i=a(n),o=i.next();!o.done;o=i.next()){var c=s(o.value,2),l=c[0],p=c[1];this.makeModuleExport(l,p)}}catch(e){r={error:e}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(r)throw r.error}}var u=e.exportsStar;if(u)for(var _=0,h=u.length;_1?c.createBlock(null,n):n[0]),t.push(c.createCall(r.internalName,null,p.NativeType.None))}}},r.prototype.compileGlobal=function(e){if(e.is(u.CommonFlags.COMPILED))return!0;e.set(u.CommonFlags.COMPILED);var r=this.module,t=0,n=e.typeNode,i=e.initializerNode;if(!e.is(u.CommonFlags.RESOLVED))if(n){var a=this.resolver.resolveType(n,e.parent);if(!a)return!1;if(a==T.Type.void)return this.error(l.DiagnosticCode.Type_expected,n.range),!1;e.setType(a)}else{if(!i)return this.error(l.DiagnosticCode.Type_expected,e.identifierNode.range.atEnd),!1;var s=this.currentFlow;if(e.hasDecorator(_.DecoratorFlags.LAZY)&&(this.currentFlow=e.file.startFunction.flow),t=this.compileExpressionRetainType(i,T.Type.void,1),this.currentFlow=s,this.currentType==T.Type.void)return this.error(l.DiagnosticCode.Type_0_is_not_assignable_to_type_1,i.range,this.currentType.toString(),""),!1;e.setType(this.currentType)}if(e.is(u.CommonFlags.AMBIENT)&&e.hasDecorator(_.DecoratorFlags.BUILTIN))return!0;var o=e.type.toNativeType(),c=e.is(u.CommonFlags.CONST)||e.is(u.CommonFlags.STATIC|u.CommonFlags.READONLY);if(e.is(u.CommonFlags.AMBIENT))return c||this.options.hasFeature(2)?(e.set(u.CommonFlags.MODULE_IMPORT),x(e,e.declaration),r.addGlobalImport(e.internalName,g,v,o),e.set(u.CommonFlags.COMPILED),!0):(this.error(l.DiagnosticCode.Operation_not_supported,e.declaration.range),!1);var h=!1;if(i){if(!t){s=this.currentFlow;e.hasDecorator(_.DecoratorFlags.LAZY)&&(this.currentFlow=e.file.startFunction.flow),t=this.compileExpression(i,e.type,1,1),this.currentFlow=s}if(p.getExpressionId(t)!=p.ExpressionId.Const&&(c?(t=r.precomputeExpression(t),p.getExpressionId(t)!=p.ExpressionId.Const&&(this.warning(l.DiagnosticCode.Compiling_constant_with_non_constant_initializer_as_mutable,i.range),h=!0)):h=!0),e.hasDecorator(_.DecoratorFlags.INLINE)&&!h){switch(assert(p.getExpressionId(t)==p.ExpressionId.Const),p.getExpressionType(t)){case p.NativeType.I32:e.constantValueKind=1,e.constantIntegerValue=i64_new(p.getConstValueI32(t),0);break;case p.NativeType.I64:e.constantValueKind=1,e.constantIntegerValue=i64_new(p.getConstValueI64Low(t),p.getConstValueI64High(t));break;case p.NativeType.F32:e.constantValueKind=2,e.constantFloatValue=p.getConstValueF32(t);break;case p.NativeType.F64:e.constantValueKind=2,e.constantFloatValue=p.getConstValueF64(t);break;default:return assert(!1),!1}e.set(u.CommonFlags.INLINED)}}else t=e.type.toNativeZero(r);var d=e.internalName;return h?(e.hasDecorator(_.DecoratorFlags.INLINE)&&this.error(l.DiagnosticCode.Decorator_0_is_not_valid_here,e.identifierNode.range,"inline"),r.addGlobal(d,o,!0,e.type.toNativeZero(r)),this.currentBody.push(r.createSetGlobal(d,t))):e.hasDecorator(_.DecoratorFlags.INLINE)||r.addGlobal(d,o,!c,t),!0},r.prototype.compileEnum=function(e){var r,t;if(e.is(u.CommonFlags.COMPILED))return!0;e.set(u.CommonFlags.COMPILED);var n=this.module;this.currentEnum=e;var i=null,s=!1,o=e.is(u.CommonFlags.CONST)||e.hasDecorator(_.DecoratorFlags.INLINE);if(e.members)try{for(var c=a(e.members.values()),h=c.next();!h.done;h=c.next()){var d=h.value;if(d.kind==_.ElementKind.ENUMVALUE){var y=!1,m=d,f=m.valueNode;m.set(u.CommonFlags.COMPILED);var E=this.currentFlow;e.hasDecorator(_.DecoratorFlags.LAZY)&&(this.currentFlow=e.file.startFunction.flow);var g=void 0;f?(g=this.compileExpression(f,T.Type.i32,1,0),p.getExpressionId(g)!=p.ExpressionId.Const&&(g=n.precomputeExpression(g),p.getExpressionId(g)!=p.ExpressionId.Const&&(e.is(u.CommonFlags.CONST)&&this.error(l.DiagnosticCode.In_const_enum_declarations_member_initializer_must_be_constant_expression,f.range),y=!0))):null==i?g=n.createI32(0):(s&&this.error(l.DiagnosticCode.Enum_member_must_have_initializer,d.identifierNode.range.atEnd),g=n.createBinary(p.BinaryOp.AddI32,n.createGetGlobal(i.internalName,p.NativeType.I32),n.createI32(1)),g=n.precomputeExpression(g),p.getExpressionId(g)!=p.ExpressionId.Const&&(e.is(u.CommonFlags.CONST)&&this.error(l.DiagnosticCode.In_const_enum_declarations_member_initializer_must_be_constant_expression,d.declaration.range),y=!0)),this.currentFlow=E,y?(n.addGlobal(m.internalName,p.NativeType.I32,!0,n.createI32(0)),this.currentBody.push(n.createSetGlobal(m.internalName,g)),s=!0):(o?(m.setConstantIntegerValue(i64_new(p.getConstValueI32(g)),T.Type.i32),m.is(u.CommonFlags.MODULE_EXPORT)&&n.addGlobal(m.internalName,p.NativeType.I32,!1,g)):n.addGlobal(m.internalName,p.NativeType.I32,!1,g),m.isImmutable=!0,s=!1),i=m}}}catch(e){r={error:e}}finally{try{h&&!h.done&&(t=c.return)&&t.call(c)}finally{if(r)throw r.error}}return this.currentEnum=null,!0},r.prototype.compileFunctionUsingTypeArguments=function(e,r,t,n){if(void 0===t&&(t=f.makeMap()),void 0===n&&(n=null),e.hasDecorator(_.DecoratorFlags.BUILTIN))return null;var i=this.resolver.resolveFunctionInclTypeArguments(e,r,e.parent,t,n||e.declaration);return i&&this.compileFunction(i)?i:null},r.prototype.ensureFunctionType=function(e,r,t){void 0===t&&(t=null);var n,i=e?e.length:0,a=0;if(t?((n=new Array(1+i))[0]=t.toNativeType(),a=1):n=new Array(i),e)for(var s=0;s=0)return e.functionTableIndex;var r=this.functionTable,t=r.length;return!e.is(u.CommonFlags.TRAMPOLINE)&&e.signature.requiredParameters=0?"case"+u.toString(10):"break")+"|"+a);var d=r.createBlock("case0|"+a,c,p.NativeType.None),y=!0,m=!0,f=!0,E=!0;for(_=0;_=0&&(y&&i.set(1),m&&i.set(2),f&&i.set(4),E&&i.set(32)),d},r.prototype.compileThrowStatement=function(e){var r=this.currentFlow;return r.set(4),r.set(1),c.compileAbort(this,null,e)},r.prototype.compileTryStatement=function(e){return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()},r.prototype.compileVariableStatement=function(e){for(var r=e.declarations,t=r.length,n=this.currentFlow,i=new Array,a=this.resolver,s=0;s");continue}h=this.currentType}var y=!1;if(o.is(u.CommonFlags.CONST))if(d)if(d=this.module.precomputeExpression(d),p.getExpressionId(d)==p.ExpressionId.Const){var m=new _.Local(c,-1,h,n.parentFunction);switch(p.getExpressionType(d)){case p.NativeType.I32:m.setConstantIntegerValue(i64_new(p.getConstValueI32(d),0),h);break;case p.NativeType.I64:m.setConstantIntegerValue(i64_new(p.getConstValueI64Low(d),p.getConstValueI64High(d)),h);break;case p.NativeType.F32:m.setConstantFloatValue(p.getConstValueF32(d),h);break;case p.NativeType.F64:m.setConstantFloatValue(p.getConstValueF64(d),h);break;default:return assert(!1),this.module.createUnreachable()}var f=n.scopedLocals;if(f){if(f.has(c))return this.error(l.DiagnosticCode.Duplicate_identifier_0,o.name.range,c),this.module.createUnreachable()}else n.scopedLocals=f=new Map;f.set(c,m),y=!0}else this.warning(l.DiagnosticCode.Compiling_constant_with_non_constant_initializer_as_mutable,o.range);else this.error(l.DiagnosticCode._const_declarations_must_be_initialized,o.range);if(!y){m=void 0;if(o.isAny(u.CommonFlags.LET|u.CommonFlags.CONST)||n.is(4096))m=n.addScopedLocal(c,h,!1,o.name);else{if(n.lookupLocal(c)){this.error(l.DiagnosticCode.Duplicate_identifier_0,o.name.range,c);continue}m=n.parentFunction.addLocal(h,c,o)}d?(i.push(this.compileAssignmentWithValue(o.name,d)),m.type.is(36)&&n.setLocalWrapped(m.index,!n.canOverflow(d,h))):m.type.is(36)&&n.setLocalWrapped(m.index,!0)}}return i.length?1==i.length?i[0]:this.module.createBlock(null,i,p.NativeType.None):0},r.prototype.compileVoidStatement=function(e){return this.compileExpression(e.expression,T.Type.void,2,0)},r.prototype.compileWhileStatement=function(e){var r=this.module,t=this.currentFlow,n=this.makeIsTrueish(this.compileExpressionRetainType(e.condition,T.Type.bool,0),this.currentType),i=r.precomputeExpression(n);if(p.getExpressionId(i)==p.ExpressionId.Const&&p.getExpressionType(i)==p.NativeType.I32){if(!p.getConstValueI32(i))return r.createNop()}else n=this.makeIsTrueish(this.compileExpressionRetainType(e.condition,T.Type.bool,0),this.currentType);var a=t.pushBreakLabel(),s=t.fork();this.currentFlow=s;var o="break|"+a;s.breakLabel=o;var c="continue|"+a;s.continueLabel=c;var l=this.compileStatement(e.statement),u=s.isAny(29);return s.freeScopedLocals(),t.popBreakLabel(),this.currentFlow=t,s.unset(1560),t.inheritConditional(s),r.createBlock(o,[r.createLoop(c,r.createIf(n,u?l:r.createBlock(null,[l,r.createBreak(c)],p.NativeType.None)))])},r.prototype.compileInlineConstant=function(e,r,t){assert(e.is(u.CommonFlags.INLINED));var n=e.type;switch(!t&&n.is(4)&&r.is(4)&&n.size>i:0);case 5:case 6:case 10:var a=e.type.computeSmallIntegerMask(T.Type.i32);return this.module.createI32(1==e.constantValueKind?i64_low(e.constantIntegerValue)&a:0);case 2:case 7:return this.module.createI32(1==e.constantValueKind?i64_low(e.constantIntegerValue):0);case 4:case 9:if(!e.program.options.isWasm64)return this.module.createI32(1==e.constantValueKind?i64_low(e.constantIntegerValue):0);case 3:case 8:return 1==e.constantValueKind?this.module.createI64(i64_low(e.constantIntegerValue),i64_high(e.constantIntegerValue)):this.module.createI64(0);case 12:if(!e.hasDecorator(_.DecoratorFlags.BUILTIN)||r!=T.Type.f32)return this.module.createF64(e.constantFloatValue);this.currentType=T.Type.f32;case 11:return this.module.createF32(e.constantFloatValue);default:return assert(!1),this.module.createUnreachable()}},r.prototype.compileExpression=function(e,r,t,n){var i;switch(this.currentType=r,e.kind){case m.NodeKind.ASSERTION:i=this.compileAssertionExpression(e,r);break;case m.NodeKind.BINARY:i=this.compileBinaryExpression(e,r);break;case m.NodeKind.CALL:i=this.compileCallExpression(e,r);break;case m.NodeKind.COMMA:i=this.compileCommaExpression(e,r);break;case m.NodeKind.ELEMENTACCESS:i=this.compileElementAccessExpression(e,r);break;case m.NodeKind.FUNCTION:i=this.compileFunctionExpression(e,r.signatureReference);break;case m.NodeKind.IDENTIFIER:case m.NodeKind.FALSE:case m.NodeKind.NULL:case m.NodeKind.THIS:case m.NodeKind.SUPER:case m.NodeKind.TRUE:i=this.compileIdentifierExpression(e,r,0==t);break;case m.NodeKind.INSTANCEOF:i=this.compileInstanceOfExpression(e,r);break;case m.NodeKind.LITERAL:i=this.compileLiteralExpression(e,r);break;case m.NodeKind.NEW:i=this.compileNewExpression(e,r);break;case m.NodeKind.PARENTHESIZED:i=this.compileParenthesizedExpression(e,r);break;case m.NodeKind.PROPERTYACCESS:i=this.compilePropertyAccessExpression(e,r,0==t);break;case m.NodeKind.TERNARY:i=this.compileTernaryExpression(e,r);break;case m.NodeKind.UNARYPOSTFIX:i=this.compileUnaryPostfixExpression(e,r);break;case m.NodeKind.UNARYPREFIX:i=this.compileUnaryPrefixExpression(e,r);break;default:this.error(l.DiagnosticCode.Operation_not_supported,e.range),i=this.module.createUnreachable()}var a=this.currentType;return 0!=t&&a!=r?(i=this.convertExpression(i,a,r,t,n,e),this.currentType=r):1==n&&(i=this.ensureSmallIntegerWrap(i,a)),this.options.sourceMap&&this.addDebugLocation(i,e.range),i},r.prototype.compileExpressionRetainType=function(e,r,t){return this.compileExpression(e,r==T.Type.void?T.Type.i32:r,0,t)},r.prototype.precomputeExpression=function(e,r,t,n){return this.module.precomputeExpression(this.compileExpression(e,r,t,n))},r.prototype.convertExpression=function(e,r,t,n,i,a){assert(0!=n);var s=this.module;return 14==r.kind?(assert(14!=t.kind),this.error(l.DiagnosticCode.Type_0_is_not_assignable_to_type_1,a.range,r.toString(),t.toString()),s.createUnreachable()):14==t.kind?s.createDrop(e):(r.isAssignableTo(t)||1==n&&this.error(l.DiagnosticCode.Conversion_from_type_0_to_1_requires_an_explicit_cast,a.range,r.toString(),t.toString()),r.is(8)?t.is(8)?11==r.kind?12==t.kind&&(e=s.createUnary(p.UnaryOp.PromoteF32,e)):11==t.kind&&(e=s.createUnary(p.UnaryOp.DemoteF64,e)):t.is(4)?11==r.kind?t==T.Type.bool?(e=s.createBinary(p.BinaryOp.NeF32,e,s.createF32(0)),i=0):e=t.is(1)?t.is(64)?s.createUnary(p.UnaryOp.TruncF32ToI64,e):s.createUnary(p.UnaryOp.TruncF32ToI32,e):t.is(64)?s.createUnary(p.UnaryOp.TruncF32ToU64,e):s.createUnary(p.UnaryOp.TruncF32ToU32,e):t==T.Type.bool?(e=s.createBinary(p.BinaryOp.NeF64,e,s.createF64(0)),i=0):e=t.is(1)?t.is(64)?s.createUnary(p.UnaryOp.TruncF64ToI64,e):s.createUnary(p.UnaryOp.TruncF64ToI32,e):t.is(64)?s.createUnary(p.UnaryOp.TruncF64ToU64,e):s.createUnary(p.UnaryOp.TruncF64ToU32,e):(assert(0==t.flags,"void type expected"),e=s.createDrop(e)):r.is(4)&&t.is(8)?e=11==t.kind?r.is(64)?s.createUnary(r.is(1)?p.UnaryOp.ConvertI64ToF32:p.UnaryOp.ConvertU64ToF32,e):s.createUnary(r.is(1)?p.UnaryOp.ConvertI32ToF32:p.UnaryOp.ConvertU32ToF32,e):r.is(64)?s.createUnary(r.is(1)?p.UnaryOp.ConvertI64ToF64:p.UnaryOp.ConvertU64ToF64,e):s.createUnary(r.is(1)?p.UnaryOp.ConvertI32ToF64:p.UnaryOp.ConvertU32ToF64,e):r.is(64)?t==T.Type.bool?(e=s.createBinary(p.BinaryOp.NeI64,e,s.createI64(0)),i=0):t.is(64)||(e=s.createUnary(p.UnaryOp.WrapI64,e)):t.is(64)?(e=s.createUnary(r.is(1)?p.UnaryOp.ExtendI32:p.UnaryOp.ExtendU32,this.ensureSmallIntegerWrap(e,r)),i=0):r.is(32)&&r.size",n.toString(),a.toString()),this.currentType=r,c.createUnreachable();switch(t=this.convertExpression(t,n,n=s,1,1,h),i=this.convertExpression(i,a,a=s,1,1,d),s.kind){case 0:case 1:case 2:o=c.createBinary(p.BinaryOp.GtI32,t,i);break;case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.GtI64:p.BinaryOp.GtI32,t,i);break;case 3:o=c.createBinary(p.BinaryOp.GtI64,t,i);break;case 5:case 6:case 7:case 10:o=c.createBinary(p.BinaryOp.GtU32,t,i);break;case 9:o=c.createBinary(this.options.isWasm64?p.BinaryOp.GtU64:p.BinaryOp.GtU32,t,i);break;case 8:o=c.createBinary(p.BinaryOp.GtU64,t,i);break;case 11:o=c.createBinary(p.BinaryOp.GtF32,t,i);break;case 12:o=c.createBinary(p.BinaryOp.GtF64,t,i);break;default:assert(!1),o=c.createUnreachable()}this.currentType=T.Type.bool;break;case y.Token.LESSTHAN_EQUALS:if(t=this.compileExpressionRetainType(h,r,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(b=I.lookupOverload(_.OperatorKind.LE)){o=this.compileBinaryOverload(b,h,t,d,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}if(i=this.compileExpressionRetainType(d,n,0),a=this.currentType,!(s=T.Type.commonDenominator(n,a,!0)))return this.error(l.DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,e.range,"<=",n.toString(),a.toString()),this.currentType=r,c.createUnreachable();switch(t=this.convertExpression(t,n,n=s,1,1,h),i=this.convertExpression(i,a,a=s,1,1,d),s.kind){case 0:case 1:case 2:o=c.createBinary(p.BinaryOp.LeI32,t,i);break;case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.LeI64:p.BinaryOp.LeI32,t,i);break;case 3:o=c.createBinary(p.BinaryOp.LeI64,t,i);break;case 5:case 6:case 7:case 10:o=c.createBinary(p.BinaryOp.LeU32,t,i);break;case 9:o=c.createBinary(this.options.isWasm64?p.BinaryOp.LeU64:p.BinaryOp.LeU32,t,i);break;case 8:o=c.createBinary(p.BinaryOp.LeU64,t,i);break;case 11:o=c.createBinary(p.BinaryOp.LeF32,t,i);break;case 12:o=c.createBinary(p.BinaryOp.LeF64,t,i);break;default:assert(!1),o=c.createUnreachable()}this.currentType=T.Type.bool;break;case y.Token.GREATERTHAN_EQUALS:if(t=this.compileExpressionRetainType(h,r,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(b=I.lookupOverload(_.OperatorKind.GE)){o=this.compileBinaryOverload(b,h,t,d,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}if(i=this.compileExpressionRetainType(d,n,0),a=this.currentType,!(s=T.Type.commonDenominator(n,a,!0)))return this.error(l.DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,e.range,">=",n.toString(),a.toString()),this.currentType=r,c.createUnreachable();switch(t=this.convertExpression(t,n,n=s,1,1,h),i=this.convertExpression(i,a,a=s,1,1,d),s.kind){case 0:case 1:case 2:o=c.createBinary(p.BinaryOp.GeI32,t,i);break;case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.GeI64:p.BinaryOp.GeI32,t,i);break;case 3:o=c.createBinary(p.BinaryOp.GeI64,t,i);break;case 5:case 6:case 7:case 10:o=c.createBinary(p.BinaryOp.GeU32,t,i);break;case 9:o=c.createBinary(this.options.isWasm64?p.BinaryOp.GeU64:p.BinaryOp.GeU32,t,i);break;case 8:o=c.createBinary(p.BinaryOp.GeU64,t,i);break;case 11:o=c.createBinary(p.BinaryOp.GeF32,t,i);break;case 12:o=c.createBinary(p.BinaryOp.GeF64,t,i);break;default:assert(!1),o=c.createUnreachable()}this.currentType=T.Type.bool;break;case y.Token.EQUALS_EQUALS_EQUALS:case y.Token.EQUALS_EQUALS:if(t=this.compileExpressionRetainType(h,r,0),n=this.currentType,f==y.Token.EQUALS_EQUALS&&this.currentType.is(256))if(I=n.classReference)if(b=I.lookupOverload(_.OperatorKind.EQ)){o=this.compileBinaryOverload(b,h,t,d,e);break}if(i=this.compileExpressionRetainType(d,n,0),a=this.currentType,!(s=T.Type.commonDenominator(n,a,!1)))return this.error(l.DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,e.range,y.operatorTokenToString(e.operator),n.toString(),a.toString()),this.currentType=r,c.createUnreachable();switch(t=this.convertExpression(t,n,n=s,1,1,h),i=this.convertExpression(i,a,a=s,1,1,d),s.kind){case 0:case 1:case 2:case 5:case 6:case 7:case 10:o=c.createBinary(p.BinaryOp.EqI32,t,i);break;case 9:case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.EqI64:p.BinaryOp.EqI32,t,i);break;case 3:case 8:o=c.createBinary(p.BinaryOp.EqI64,t,i);break;case 11:o=c.createBinary(p.BinaryOp.EqF32,t,i);break;case 12:o=c.createBinary(p.BinaryOp.EqF64,t,i);break;case 13:o=c.createUnary(p.UnaryOp.AllTrueVecI8x16,c.createBinary(p.BinaryOp.EqVecI8x16,t,i));break;default:assert(!1),o=c.createUnreachable()}this.currentType=T.Type.bool;break;case y.Token.EXCLAMATION_EQUALS_EQUALS:case y.Token.EXCLAMATION_EQUALS:if(t=this.compileExpressionRetainType(h,r,0),n=this.currentType,f==y.Token.EXCLAMATION_EQUALS&&this.currentType.is(256))if(I=n.classReference)if(b=I.lookupOverload(_.OperatorKind.NE)){o=this.compileBinaryOverload(b,h,t,d,e);break}if(i=this.compileExpressionRetainType(d,n,0),a=this.currentType,!(s=T.Type.commonDenominator(n,a,!1)))return this.error(l.DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,e.range,y.operatorTokenToString(e.operator),n.toString(),a.toString()),this.currentType=r,c.createUnreachable();switch(t=this.convertExpression(t,n,n=s,1,1,h),i=this.convertExpression(i,a,a=s,1,1,d),s.kind){case 0:case 1:case 2:case 5:case 6:case 7:case 10:o=c.createBinary(p.BinaryOp.NeI32,t,i);break;case 9:case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.NeI64:p.BinaryOp.NeI32,t,i);break;case 3:case 8:o=c.createBinary(p.BinaryOp.NeI64,t,i);break;case 11:o=c.createBinary(p.BinaryOp.NeF32,t,i);break;case 12:o=c.createBinary(p.BinaryOp.NeF64,t,i);break;case 13:o=c.createUnary(p.UnaryOp.AnyTrueVecI8x16,c.createBinary(p.BinaryOp.NeVecI8x16,t,i));break;default:assert(!1),o=c.createUnreachable()}this.currentType=T.Type.bool;break;case y.Token.EQUALS:return this.compileAssignment(h,d,r);case y.Token.PLUS_EQUALS:m=!0;case y.Token.PLUS:if(t=this.compileExpressionRetainType(h,r,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(b=I.lookupOverload(_.OperatorKind.ADD)){o=this.compileBinaryOverload(b,h,t,d,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}if(m)i=this.compileExpression(d,n,1,0);else{if(i=this.compileExpressionRetainType(d,n,0),a=this.currentType,!(s=T.Type.commonDenominator(n,a,!1)))return this.error(l.DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,e.range,"+",n.toString(),a.toString()),this.currentType=r,c.createUnreachable();t=this.convertExpression(t,n,n=s,1,0,h),i=this.convertExpression(i,a,a=s,1,0,d)}switch(this.currentType.kind){case 0:case 1:case 5:case 6:case 10:case 2:case 7:o=c.createBinary(p.BinaryOp.AddI32,t,i);break;case 9:case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.AddI64:p.BinaryOp.AddI32,t,i);break;case 3:case 8:o=c.createBinary(p.BinaryOp.AddI64,t,i);break;case 11:o=c.createBinary(p.BinaryOp.AddF32,t,i);break;case 12:o=c.createBinary(p.BinaryOp.AddF64,t,i);break;default:assert(!1),o=c.createUnreachable()}break;case y.Token.MINUS_EQUALS:m=!0;case y.Token.MINUS:if(t=this.compileExpressionRetainType(h,r,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(b=I.lookupOverload(_.OperatorKind.SUB)){o=this.compileBinaryOverload(b,h,t,d,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}if(m)i=this.compileExpression(d,n,1,0),a=this.currentType;else{if(i=this.compileExpressionRetainType(d,n,0),a=this.currentType,!(s=T.Type.commonDenominator(n,a,!1)))return this.error(l.DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,e.range,"-",n.toString(),a.toString()),this.currentType=r,c.createUnreachable();t=this.convertExpression(t,n,n=s,1,0,h),i=this.convertExpression(i,a,a=s,1,0,d)}switch(this.currentType.kind){case 0:case 1:case 5:case 6:case 10:case 2:case 7:o=c.createBinary(p.BinaryOp.SubI32,t,i);break;case 9:case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.SubI64:p.BinaryOp.SubI32,t,i);break;case 3:case 8:o=c.createBinary(p.BinaryOp.SubI64,t,i);break;case 11:o=c.createBinary(p.BinaryOp.SubF32,t,i);break;case 12:o=c.createBinary(p.BinaryOp.SubF64,t,i);break;default:assert(!1),o=c.createUnreachable()}break;case y.Token.ASTERISK_EQUALS:m=!0;case y.Token.ASTERISK:if(t=this.compileExpressionRetainType(h,r,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(b=I.lookupOverload(_.OperatorKind.MUL)){o=this.compileBinaryOverload(b,h,t,d,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}if(m)t=this.ensureSmallIntegerWrap(t,n),i=this.compileExpression(d,n,1,1);else{if(i=this.compileExpressionRetainType(d,n,0),a=this.currentType,!(s=T.Type.commonDenominator(n,a,!1)))return this.error(l.DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,e.range,"*",n.toString(),a.toString()),this.currentType=r,c.createUnreachable();t=this.convertExpression(t,n,n=s,1,0,h),i=this.convertExpression(i,a,a=s,1,0,d)}switch(this.currentType.kind){case 0:case 1:case 5:case 6:case 10:case 2:case 7:o=c.createBinary(p.BinaryOp.MulI32,t,i);break;case 9:case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.MulI64:p.BinaryOp.MulI32,t,i);break;case 3:case 8:o=c.createBinary(p.BinaryOp.MulI64,t,i);break;case 11:o=c.createBinary(p.BinaryOp.MulF32,t,i);break;case 12:o=c.createBinary(p.BinaryOp.MulF64,t,i);break;default:assert(!1),o=c.createUnreachable()}break;case y.Token.ASTERISK_ASTERISK_EQUALS:m=!0;case y.Token.ASTERISK_ASTERISK:if(t=this.compileExpressionRetainType(h,r,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(b=I.lookupOverload(_.OperatorKind.POW)){o=this.compileBinaryOverload(b,h,t,d,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}var E=void 0;if(11==this.currentType.kind){if(i=this.compileExpression(d,T.Type.f32,1,0),a=this.currentType,!(E=this.f32PowInstance)){if(!(g=this.program.lookupGlobal(u.LibrarySymbols.Mathf))){this.error(l.DiagnosticCode.Cannot_find_name_0,e.range,"Mathf"),o=c.createUnreachable();break}if(!(v=g.members?g.members.get(u.LibrarySymbols.pow):null)){this.error(l.DiagnosticCode.Cannot_find_name_0,e.range,"Mathf.pow"),o=c.createUnreachable();break}assert(v.kind==_.ElementKind.FUNCTION_PROTOTYPE),this.f32PowInstance=E=this.resolver.resolveFunction(v,null)}}else if(t=this.convertExpression(t,this.currentType,T.Type.f64,1,0,h),n=this.currentType,i=this.compileExpression(d,T.Type.f64,1,0),a=this.currentType,!(E=this.f64PowInstance)){if(!(g=this.program.lookupGlobal(u.LibrarySymbols.Math))){this.error(l.DiagnosticCode.Cannot_find_name_0,e.range,"Math"),o=c.createUnreachable();break}if(!(v=g.members?g.members.get(u.LibrarySymbols.pow):null)){this.error(l.DiagnosticCode.Cannot_find_name_0,e.range,"Math.pow"),o=c.createUnreachable();break}assert(v.kind==_.ElementKind.FUNCTION_PROTOTYPE),this.f64PowInstance=E=this.resolver.resolveFunction(v,null)}o=E&&this.compileFunction(E)?this.makeCallDirect(E,[t,i]):c.createUnreachable();break;case y.Token.SLASH_EQUALS:m=!0;case y.Token.SLASH:if(t=this.compileExpressionRetainType(h,r,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(b=I.lookupOverload(_.OperatorKind.DIV)){o=this.compileBinaryOverload(b,h,t,d,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}if(m)t=this.ensureSmallIntegerWrap(t,n),i=this.compileExpression(d,n,1,1),a=this.currentType;else{if(i=this.compileExpressionRetainType(d,n,0),a=this.currentType,!(s=T.Type.commonDenominator(n,a,!1)))return this.error(l.DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,e.range,"/",n.toString(),a.toString()),this.currentType=r,c.createUnreachable();t=this.convertExpression(t,n,n=s,1,1,h),i=this.convertExpression(i,a,a=s,1,1,d)}switch(this.currentType.kind){case 0:case 1:case 2:o=c.createBinary(p.BinaryOp.DivI32,t,i);break;case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.DivI64:p.BinaryOp.DivI32,t,i);break;case 3:o=c.createBinary(p.BinaryOp.DivI64,t,i);break;case 5:case 6:case 10:case 7:o=c.createBinary(p.BinaryOp.DivU32,t,i);break;case 9:o=c.createBinary(this.options.isWasm64?p.BinaryOp.DivU64:p.BinaryOp.DivU32,t,i);break;case 8:o=c.createBinary(p.BinaryOp.DivU64,t,i);break;case 11:o=c.createBinary(p.BinaryOp.DivF32,t,i);break;case 12:o=c.createBinary(p.BinaryOp.DivF64,t,i);break;default:assert(!1),o=c.createUnreachable()}break;case y.Token.PERCENT_EQUALS:m=!0;case y.Token.PERCENT:if(t=this.compileExpressionRetainType(h,r,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(b=I.lookupOverload(_.OperatorKind.REM)){o=this.compileBinaryOverload(b,h,t,d,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}if(m)t=this.ensureSmallIntegerWrap(t,n),i=this.compileExpression(d,n,1,1),a=this.currentType;else{if(i=this.compileExpressionRetainType(d,n,0),a=this.currentType,!(s=T.Type.commonDenominator(n,a,!1)))return this.error(l.DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,e.range,"%",n.toString(),a.toString()),this.currentType=r,c.createUnreachable();t=this.convertExpression(t,n,n=s,1,1,h),i=this.convertExpression(i,a,a=s,1,1,d)}switch(this.currentType.kind){case 0:case 1:case 2:o=c.createBinary(p.BinaryOp.RemI32,t,i);break;case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.RemI64:p.BinaryOp.RemI32,t,i);break;case 3:o=c.createBinary(p.BinaryOp.RemI64,t,i);break;case 5:case 6:case 10:case 7:o=c.createBinary(p.BinaryOp.RemU32,t,i);break;case 9:o=c.createBinary(this.options.isWasm64?p.BinaryOp.RemU64:p.BinaryOp.RemU32,t,i);break;case 8:o=c.createBinary(p.BinaryOp.RemU64,t,i);break;case 11:if(!(E=this.f32ModInstance)){if(!(g=this.program.lookupGlobal(u.LibrarySymbols.Mathf))){this.error(l.DiagnosticCode.Cannot_find_name_0,e.range,"Mathf"),o=c.createUnreachable();break}if(!(v=g.members?g.members.get(u.LibrarySymbols.mod):null)){this.error(l.DiagnosticCode.Cannot_find_name_0,e.range,"Mathf.mod"),o=c.createUnreachable();break}assert(v.kind==_.ElementKind.FUNCTION_PROTOTYPE),this.f32ModInstance=E=this.resolver.resolveFunction(v,null)}o=E&&this.compileFunction(E)?this.makeCallDirect(E,[t,i]):c.createUnreachable();break;case 12:if(!(E=this.f64ModInstance)){var g,v;if(!(g=this.program.lookupGlobal(u.LibrarySymbols.Math))){this.error(l.DiagnosticCode.Cannot_find_name_0,e.range,"Math"),o=c.createUnreachable();break}if(!(v=g.members?g.members.get(u.LibrarySymbols.mod):null)){this.error(l.DiagnosticCode.Cannot_find_name_0,e.range,"Math.mod"),o=c.createUnreachable();break}assert(v.kind==_.ElementKind.FUNCTION_PROTOTYPE),this.f64ModInstance=E=this.resolver.resolveFunction(v,null)}o=E&&this.compileFunction(E)?this.makeCallDirect(E,[t,i]):c.createUnreachable();break;default:assert(!1),o=c.createUnreachable()}break;case y.Token.LESSTHAN_LESSTHAN_EQUALS:m=!0;case y.Token.LESSTHAN_LESSTHAN:if(t=this.compileExpressionRetainType(h,r.intType,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(b=I.lookupOverload(_.OperatorKind.BITWISE_SHL)){o=this.compileBinaryOverload(b,h,t,d,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}switch(i=this.compileExpression(d,n,1,0),a=this.currentType,this.currentType.kind){case 0:case 1:case 5:case 6:case 10:case 2:case 7:o=c.createBinary(p.BinaryOp.ShlI32,t,i);break;case 3:case 8:o=c.createBinary(p.BinaryOp.ShlI64,t,i);break;case 9:case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.ShlI64:p.BinaryOp.ShlI32,t,i);break;case 11:case 12:return this.error(l.DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,e.range,y.operatorTokenToString(e.operator),this.currentType.toString()),c.createUnreachable();default:assert(!1),o=c.createUnreachable()}break;case y.Token.GREATERTHAN_GREATERTHAN_EQUALS:m=!0;case y.Token.GREATERTHAN_GREATERTHAN:if(t=this.compileExpressionRetainType(h,r.intType,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(b=I.lookupOverload(_.OperatorKind.BITWISE_SHR)){o=this.compileBinaryOverload(b,h,t,d,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}switch(t=this.ensureSmallIntegerWrap(t,n),i=this.compileExpression(d,n,1,1),a=this.currentType,this.currentType.kind){case 0:case 1:case 2:o=c.createBinary(p.BinaryOp.ShrI32,t,i);break;case 3:o=c.createBinary(p.BinaryOp.ShrI64,t,i);break;case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.ShrI64:p.BinaryOp.ShrI32,t,i);break;case 5:case 6:case 10:case 7:o=c.createBinary(p.BinaryOp.ShrU32,t,i);break;case 8:o=c.createBinary(p.BinaryOp.ShrU64,t,i);break;case 9:o=c.createBinary(this.options.isWasm64?p.BinaryOp.ShrU64:p.BinaryOp.ShrU32,t,i);break;case 11:case 12:return this.error(l.DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,e.range,y.operatorTokenToString(e.operator),this.currentType.toString()),c.createUnreachable();default:assert(!1),o=c.createUnreachable()}break;case y.Token.GREATERTHAN_GREATERTHAN_GREATERTHAN_EQUALS:m=!0;case y.Token.GREATERTHAN_GREATERTHAN_GREATERTHAN:if(t=this.compileExpressionRetainType(h,r.intType,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(b=I.lookupOverload(_.OperatorKind.BITWISE_SHR_U)){o=this.compileBinaryOverload(b,h,t,d,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}switch(t=this.ensureSmallIntegerWrap(t,n),i=this.compileExpression(d,n,1,0),a=this.currentType,this.currentType.kind){case 5:case 6:case 10:o=c.createBinary(p.BinaryOp.ShrU32,t,i);case 0:case 1:case 2:case 7:o=c.createBinary(p.BinaryOp.ShrU32,t,i);break;case 3:case 8:o=c.createBinary(p.BinaryOp.ShrU64,t,i);break;case 9:case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.ShrU64:p.BinaryOp.ShrU32,t,i);break;case 11:case 12:return this.error(l.DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,e.range,y.operatorTokenToString(e.operator),this.currentType.toString()),c.createUnreachable();default:assert(!1),o=c.createUnreachable()}break;case y.Token.AMPERSAND_EQUALS:m=!0;case y.Token.AMPERSAND:if(t=this.compileExpressionRetainType(h,r.intType,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(b=I.lookupOverload(_.OperatorKind.BITWISE_AND)){o=this.compileBinaryOverload(b,h,t,d,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}if(m)i=this.compileExpression(d,n,1,0),a=this.currentType;else{if(i=this.compileExpressionRetainType(d,n,0),a=this.currentType,!(s=T.Type.commonDenominator(n,a,!1)))return this.error(l.DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,e.range,"&",n.toString(),a.toString()),this.currentType=r,c.createUnreachable();t=this.convertExpression(t,n,n=s,1,0,h),i=this.convertExpression(i,a,a=s,1,0,d)}switch(this.currentType.kind){case 0:case 1:case 2:case 5:case 6:case 10:case 7:o=c.createBinary(p.BinaryOp.AndI32,t,i);break;case 3:case 8:o=c.createBinary(p.BinaryOp.AndI64,t,i);break;case 9:case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.AndI64:p.BinaryOp.AndI32,t,i);break;case 11:case 12:return this.error(l.DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,e.range,y.operatorTokenToString(e.operator),this.currentType.toString()),c.createUnreachable();default:assert(!1),o=c.createUnreachable()}break;case y.Token.BAR_EQUALS:m=!0;case y.Token.BAR:if(t=this.compileExpressionRetainType(h,r.intType,0),n=this.currentType,this.currentType.is(256)){if(I=n.classReference)if(b=I.lookupOverload(_.OperatorKind.BITWISE_OR)){o=this.compileBinaryOverload(b,h,t,d,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}if(m)i=this.compileExpression(d,n,1,0),a=this.currentType;else{if(i=this.compileExpressionRetainType(d,n,0),a=this.currentType,!(s=T.Type.commonDenominator(n,a,!1)))return this.error(l.DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,e.range,"|",n.toString(),a.toString()),this.currentType=r,c.createUnreachable();t=this.convertExpression(t,n,n=s,1,0,h),i=this.convertExpression(i,a,a=s,1,0,d)}switch(this.currentType.kind){case 0:case 1:case 5:case 6:case 10:o=c.createBinary(p.BinaryOp.OrI32,t,i);break;case 2:case 7:o=c.createBinary(p.BinaryOp.OrI32,t,i);break;case 3:case 8:o=c.createBinary(p.BinaryOp.OrI64,t,i);break;case 9:case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.OrI64:p.BinaryOp.OrI32,t,i);break;case 11:case 12:return this.error(l.DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,e.range,y.operatorTokenToString(e.operator),this.currentType.toString()),c.createUnreachable();default:assert(!1),o=c.createUnreachable()}break;case y.Token.CARET_EQUALS:m=!0;case y.Token.CARET:if(t=this.compileExpressionRetainType(h,r.intType,0),n=this.currentType,this.currentType.is(256)){var I,b;if(I=n.classReference)if(b=I.lookupOverload(_.OperatorKind.BITWISE_XOR)){o=this.compileBinaryOverload(b,h,t,d,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}if(m)i=this.compileExpression(d,n,1,0),a=this.currentType;else{if(i=this.compileExpressionRetainType(d,n,0),a=this.currentType,!(s=T.Type.commonDenominator(n,a,!1)))return this.error(l.DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,e.range,"^",n.toString(),a.toString()),this.currentType=r,c.createUnreachable();t=this.convertExpression(t,n,n=s,1,0,h),i=this.convertExpression(i,a,a=s,1,0,d)}switch(this.currentType.kind){case 0:case 1:case 5:case 6:case 10:o=c.createBinary(p.BinaryOp.XorI32,t,i);break;case 2:case 7:o=c.createBinary(p.BinaryOp.XorI32,t,i);break;case 3:case 8:o=c.createBinary(p.BinaryOp.XorI64,t,i);break;case 9:case 4:o=c.createBinary(this.options.isWasm64?p.BinaryOp.XorI64:p.BinaryOp.XorI32,t,i);break;case 11:case 12:return this.error(l.DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,e.range,y.operatorTokenToString(e.operator),this.currentType.toString()),c.createUnreachable();default:assert(!1),o=c.createUnreachable()}break;case y.Token.AMPERSAND_AMPERSAND:if(t=this.compileExpressionRetainType(h,r,0),n=this.currentType,i=this.compileExpression(d,n,1,0),a=this.currentType,o=c.cloneExpression(t,!0,0))o=c.createIf(this.makeIsTrueish(t,this.currentType),i,o);else{var x=(S=this.currentFlow).getAndFreeTempLocal(this.currentType,!S.canOverflow(t,this.currentType));o=c.createIf(this.makeIsTrueish(c.createTeeLocal(x.index,t),this.currentType),i,c.createGetLocal(assert(x).index,this.currentType.toNativeType()))}break;case y.Token.BAR_BAR:if(t=this.compileExpressionRetainType(h,r,0),n=this.currentType,i=this.compileExpression(d,n,1,0),a=this.currentType,o=this.module.cloneExpression(t,!0,0))o=this.module.createIf(this.makeIsTrueish(t,this.currentType),o,i);else{var S;x=(S=this.currentFlow).getAndFreeTempLocal(this.currentType,!S.canOverflow(t,this.currentType));o=c.createIf(this.makeIsTrueish(c.createTeeLocal(x.index,t),this.currentType),c.createGetLocal(assert(x).index,this.currentType.toNativeType()),i)}break;default:assert(!1),o=this.module.createUnreachable()}return m?this.compileAssignmentWithValue(h,o,r!=T.Type.void):o},r.prototype.compileUnaryOverload=function(e,r,t,n){var i,a=0;return e.is(u.CommonFlags.INSTANCE)?(a=t,i=[]):i=[r],this.compileCallDirect(e,i,n,a)},r.prototype.compileBinaryOverload=function(e,r,t,n,i){var a,s=0;if(e.is(u.CommonFlags.INSTANCE)){var o=assert(e.parent);assert(o.kind==_.ElementKind.CLASS),s=t,a=[n]}else a=[r,n];return this.compileCallDirect(e,a,i,s)},r.prototype.compileAssignment=function(e,r,t){var n,i=this.program.resolver,a=this.currentFlow,s=i.resolveExpression(e,a);if(!s)return this.module.createUnreachable();switch(s.kind){case _.ElementKind.GLOBAL:if(!this.compileGlobal(s))return this.module.createUnreachable();assert(s.type!=T.Type.void);case _.ElementKind.LOCAL:case _.ElementKind.FIELD:n=s.type;break;case _.ElementKind.PROPERTY_PROTOTYPE:var o=s.setterPrototype;if(!o)return this.error(l.DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property,e.range,s.internalName),this.module.createUnreachable();if(!(c=this.resolver.resolveFunction(o,null,f.makeMap(),d.ReportMode.REPORT)))return this.module.createUnreachable();assert(1==c.signature.parameterTypes.length),n=c.signature.parameterTypes[0];break;case _.ElementKind.PROPERTY:var c;if(!(c=s.setterInstance))return this.error(l.DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property,e.range,s.internalName),this.module.createUnreachable();assert(1==c.signature.parameterTypes.length),n=c.signature.parameterTypes[0];break;case _.ElementKind.CLASS:if(i.currentElementExpression){var p=a.is(8192),u=s.lookupOverload(_.OperatorKind.INDEXED_SET,p);if(!u)return s.lookupOverload(_.OperatorKind.INDEXED_GET,p)?this.error(l.DiagnosticCode.Index_signature_in_type_0_only_permits_reading,e.range,s.internalName):this.error(l.DiagnosticCode.Index_signature_is_missing_in_type_0,e.range,s.internalName),this.module.createUnreachable();assert(2==u.signature.parameterTypes.length),n=u.signature.parameterTypes[1];break}default:return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()}assert(n!=T.Type.void);var h=this.compileExpression(r,n,1,0);return this.compileAssignmentWithValue(e,h,t!=T.Type.void)},r.prototype.compileAssignmentWithValue=function(e,r,t){void 0===t&&(t=!1);var n=this.module,i=this.currentFlow,a=this.resolver.resolveExpression(e,i);if(!a)return n.createUnreachable();switch(a.kind){case _.ElementKind.LOCAL:var s=a.type;return assert(s!=T.Type.void),this.currentType=t?s:T.Type.void,a.is(u.CommonFlags.CONST)?(this.error(l.DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property,e.range,a.internalName),n.createUnreachable()):(s.is(36)&&i.setLocalWrapped(a.index,!i.canOverflow(r,s)),t?n.createTeeLocal(a.index,r):n.createSetLocal(a.index,r));case _.ElementKind.GLOBAL:if(!this.compileGlobal(a))return n.createUnreachable();s=a.type;if(assert(s!=T.Type.void),this.currentType=t?s:T.Type.void,a.is(u.CommonFlags.CONST))return this.error(l.DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property,e.range,a.internalName),n.createUnreachable();if(r=this.ensureSmallIntegerWrap(r,s),t){var o=s.toNativeType(),c=a.internalName;return n.createBlock(null,[n.createSetGlobal(c,r),n.createGetGlobal(c,o)],o)}return n.createSetGlobal(a.internalName,r);case _.ElementKind.FIELD:var p=a.initializerNode;if(a.is(u.CommonFlags.READONLY)&&!i.actualFunction.is(u.CommonFlags.CONSTRUCTOR)&&!p)return this.error(l.DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property,e.range,a.internalName),n.createUnreachable();var h=assert(this.resolver.currentThisExpression),y=this.compileExpressionRetainType(h,this.options.usizeType,0);s=a.type;this.currentType=t?s:T.Type.void;o=s.toNativeType();if(10==s.kind&&(r=this.ensureSmallIntegerWrap(r,s)),t){var m=this.currentFlow,E=m.getAndFreeTempLocal(s,!m.canOverflow(r,s)).index;return n.createBlock(null,[n.createSetLocal(E,r),n.createStore(s.byteSize,y,n.createGetLocal(E,o),o,a.memoryOffset),n.createGetLocal(E,o)],o)}return n.createStore(s.byteSize,y,r,o,a.memoryOffset);case _.ElementKind.PROPERTY_PROTOTYPE:var g=a.setterPrototype;if(!g)return this.error(l.DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property,e.range,a.internalName),n.createUnreachable();if(!(b=this.resolver.resolveFunction(g,null,f.makeMap(),d.ReportMode.REPORT)))return n.createUnreachable();if(!t)return this.makeCallDirect(b,[r]);var v=assert(a.getterPrototype);if(!(S=this.resolver.resolveFunction(v,null,f.makeMap(),d.ReportMode.REPORT)))return n.createUnreachable();var I=(B=S.signature.returnType).toNativeType();return n.createBlock(null,[this.makeCallDirect(b,[r]),this.makeCallDirect(S)],I);case _.ElementKind.PROPERTY:var b;if(!(b=a.setterInstance))return this.error(l.DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property,e.range,a.internalName),n.createUnreachable();if(!t){var x=this.compileExpressionRetainType(assert(this.resolver.currentThisExpression),this.options.usizeType,0);return this.makeCallDirect(b,[x,r])}var S;I=(B=(S=assert(a.getterInstance)).signature.returnType).toNativeType(),y=this.compileExpressionRetainType(assert(this.resolver.currentThisExpression),this.options.usizeType,0),E=i.getAndFreeTempLocal(B,!1).index;return n.createBlock(null,[this.makeCallDirect(b,[n.createTeeLocal(E,y),r]),this.makeCallDirect(S,[n.createGetLocal(E,I)])],I);case _.ElementKind.CLASS:var A=this.resolver.currentElementExpression;if(A){var N=i.is(8192),O=a.lookupOverload(_.OperatorKind.INDEXED_GET,N);if(!O)return this.error(l.DiagnosticCode.Index_signature_is_missing_in_type_0,e.range,a.internalName),n.createUnreachable();var C=a.lookupOverload(_.OperatorKind.INDEXED_SET,N);if(!C)return this.error(l.DiagnosticCode.Index_signature_in_type_0_only_permits_reading,e.range,a.internalName),this.currentType=t?O.signature.returnType:T.Type.void,n.createUnreachable();var k=a.type,R=(h=assert(this.resolver.currentThisExpression),y=this.compileExpressionRetainType(h,this.options.usizeType,0),this.compileExpression(A,T.Type.i32,1,0));if(t){var L=i.getTempLocal(k,!1),F=i.getAndFreeTempLocal(this.currentType,!1),B=O.signature.returnType;return i.freeTempLocal(L),n.createBlock(null,[this.makeCallDirect(C,[n.createTeeLocal(L.index,y),n.createTeeLocal(F.index,R),r]),this.makeCallDirect(O,[n.createGetLocal(L.index,L.type.toNativeType()),n.createGetLocal(F.index,F.type.toNativeType())])],B.toNativeType())}return this.makeCallDirect(C,[y,R,r])}}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),n.createUnreachable()},r.prototype.compileCallExpression=function(e,r){var t=this.module,n=this.currentFlow;if(e.expression.kind==m.NodeKind.SUPER){var i=this.currentFlow,a=i.actualFunction;if(!a.is(u.CommonFlags.CONSTRUCTOR))return this.error(l.DiagnosticCode.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors,e.range),t.createUnreachable();var s=assert(a.parent);assert(s.kind==_.ElementKind.CLASS);var o=assert(s.base),c=assert(i.lookupLocal(u.CommonSymbols.this_)),h=this.options.nativeSizeType,d=[t.createSetLocal(c.index,this.compileCallDirect(this.ensureConstructor(o,e),e.arguments,e,t.createIf(t.createGetLocal(c.index,h),t.createGetLocal(c.index,h),this.makeAllocation(s))))];return this.makeFieldInitialization(s,d),i.isAny(2080)?(this.error(l.DiagnosticCode._super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class,e.range),t.createUnreachable()):(i.set(96),this.currentType=T.Type.void,t.createBlock(null,d))}var y,E,g=this.resolver.resolveExpression(e.expression,n);if(!g)return t.createUnreachable();switch(g.kind){case _.ElementKind.FUNCTION_PROTOTYPE:var v=g,I=e.typeArguments;if(v.hasDecorator(_.DecoratorFlags.BUILTIN))return this.compileCallExpressionBuiltin(v,e,r);var b=null;if(I){if(!v.is(u.CommonFlags.GENERIC))return this.error(l.DiagnosticCode.Type_0_is_not_generic,e.expression.range,v.internalName),t.createUnreachable();b=this.resolver.resolveFunctionInclTypeArguments(v,I,n.actualFunction.parent,f.makeMap(n.contextualTypeArguments),e)}else{if(v.is(u.CommonFlags.GENERIC)){for(var x=new Map,S=assert(v.typeParameterNodes),A=S.length,N=0;Ns&&!i)||(this.error(l.DiagnosticCode.Expected_0_arguments_but_got_1,n.range,s.toString(),r.toString()),!1)},r.prototype.compileCallDirect=function(e,r,t,n){void 0===n&&(n=0);var i=r.length,a=e.signature;if(!this.checkCallSignature(a,i,0!=n,t))return this.module.createUnreachable();if(e.hasDecorator(_.DecoratorFlags.INLINE)){if(assert(!e.is(u.CommonFlags.TRAMPOLINE)),!this.currentInlineFunctions.includes(e)){this.currentInlineFunctions.push(e);var s=this.compileCallInlinePrechecked(e,r,n);return this.currentInlineFunctions.pop(),s}this.warning(l.DiagnosticCode.Function_0_cannot_be_inlined_into_itself,t.range,e.internalName)}var o=n?i+1:i,c=new Array(o),p=0;n&&(c[0]=n,p=1);for(var h=a.parameterTypes,d=0;d=i);var o=this.module;if(!this.compileFunction(e))return o.createUnreachable();var c=e.signature.returnType,l=e.is(u.CommonFlags.MODULE_IMPORT);if(t=a),this.ensureFunctionType(e.parameterTypes,e.returnType,e.thisType);var c=this.module;if(nd)return this.error(l.DiagnosticCode.Expected_0_arguments_but_got_1,e.range,d.toString(),u.toString()),this.module.createUnreachable();for(var y=new Array(u),E=0;E=0),this.currentType=A,this.module.createGetLocal(N,A.toNativeType());case _.ElementKind.GLOBAL:if(!this.compileGlobal(S))return this.module.createUnreachable();var O=S.type;return assert(O!=T.Type.void),S.is(u.CommonFlags.INLINED)?this.compileInlineConstant(S,r,t):(this.currentType=O,this.module.createGetGlobal(S.internalName,O.toNativeType()));case _.ElementKind.ENUMVALUE:return S.is(u.CommonFlags.COMPILED)?(this.currentType=T.Type.i32,S.is(u.CommonFlags.INLINED)?(assert(1==S.constantValueKind),this.module.createI32(i64_low(S.constantIntegerValue))):this.module.createGetGlobal(S.internalName,p.NativeType.I32)):(this.error(l.DiagnosticCode.A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums,e.range),this.currentType=T.Type.i32,this.module.createUnreachable());case _.ElementKind.FUNCTION_PROTOTYPE:var C=this.resolver.resolveFunction(S,null,f.makeMap(i.contextualTypeArguments));if(!C||!this.compileFunction(C))return n.createUnreachable();var k=this.ensureFunctionTableEntry(C);return this.currentType=C.signature.type,this.module.createI32(k)}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.module.createUnreachable()},r.prototype.compileInstanceOfExpression=function(e,r){var t=this.module,n=this.compileExpressionRetainType(e.expression,this.options.usizeType,0),i=this.currentType,a=this.resolver.resolveType(e.isType,this.currentFlow.actualFunction);return this.currentType=T.Type.bool,a?a.is(256)?i.is(512)&&!a.is(512)&&i.nonNullableType.isAssignableTo(a)?t.createBinary(i.is(64)?p.BinaryOp.NeI64:p.BinaryOp.NeI32,n,i.toNativeZero(t)):t.createI32(i.isAssignableTo(a)?1:0):t.createI32(i==a?1:0):t.createUnreachable()},r.prototype.compileLiteralExpression=function(e,r,t){void 0===t&&(t=!1);var n=this.module;switch(e.literalKind){case m.LiteralKind.ARRAY:assert(!t);var i=r.classReference;return i&&i.prototype==this.program.arrayPrototype?this.compileArrayLiteral(assert(i.typeArguments)[0],e.elementExpressions,!1,e):(this.error(l.DiagnosticCode.Operation_not_supported,e.range),n.createUnreachable());case m.LiteralKind.FLOAT:var a=e.value;return t&&(a=-a),r==T.Type.f32?n.createF32(a):(this.currentType=T.Type.f64,n.createF64(a));case m.LiteralKind.INTEGER:var s=e.value;t&&(s=i64_sub(i64_new(0),s));var o=this.resolver.determineIntegerLiteralType(s,r);switch(this.currentType=o,o.kind){case 4:if(!this.options.isWasm64)return n.createI32(i64_low(s));case 3:return n.createI64(i64_low(s),i64_high(s));case 9:if(!this.options.isWasm64)return n.createI32(i64_low(s));case 8:return n.createI64(i64_low(s),i64_high(s));case 11:return n.createF32(i64_to_f32(s));case 12:return n.createF64(i64_to_f64(s));default:return n.createI32(i64_low(s))}case m.LiteralKind.STRING:return assert(!t),this.compileStringLiteral(e);case m.LiteralKind.OBJECT:return assert(!t),this.compileObjectLiteral(e,r)}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),this.currentType=r,n.createUnreachable()},r.prototype.ensureStaticString=function(e){var r,t=this.program,n=t.hasGC,i=t.gcHeaderSize,a=assert(t.stringInstance),s=this.stringSegments;if(s.has(e))r=s.get(e);else{var o=e.length,l=a.currentMemoryOffset+1&-2,p=l+2*o,_=void 0,h=void 0;n?(_=new Uint8Array(i+p),h=i,f.writeI32(c.ensureGCHook(this,a),_,t.gcHookOffset)):(_=new Uint8Array(p),h=0),f.writeI32(o,_,h+a.offsetof(u.LibrarySymbols.length)),h+=l;for(var d=0;d",r.toString()),t.createUnreachable();var i=n.constructorInstance;if(i){if(i.signature.requiredParameters)return this.error(l.DiagnosticCode.Constructor_of_class_0_must_not_require_any_arguments,e.range,n.toString()),t.createUnreachable();if(i.is(u.CommonFlags.PRIVATE))return this.error(l.DiagnosticCode.Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration,e.range,n.toString()),t.createUnreachable();if(i.is(u.CommonFlags.PROTECTED))return this.error(l.DiagnosticCode.Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration,e.range,n.toString()),t.createUnreachable()}var a=e.names,s=a.length,o=e.values,c=n.members,p=!1,h=new Array(s+2),d=this.currentFlow.getTempLocal(this.options.usizeType);assert(s==o.length);for(var y=0,m=s;yv)for(m=v;m=0);var c=this.compileExpressionRetainType(assert(this.resolver.currentThisExpression),this.options.usizeType,0);return this.currentType=a.type,n.createLoad(a.type.byteSize,a.type.is(5),c,a.type.toNativeType(),a.memoryOffset);case _.ElementKind.PROPERTY_PROTOTYPE:var h=a.getterPrototype;if(h){var d=this.resolver.resolveFunction(h,null);if(d)return this.compileCallDirect(d,[],e,0)}return n.createUnreachable();case _.ElementKind.PROPERTY:var y=assert(a.getterInstance);return this.compileCallDirect(y,[],e,this.compileExpressionRetainType(assert(this.resolver.currentThisExpression),this.options.usizeType,0));case _.ElementKind.FUNCTION_PROTOTYPE:return this.error(l.DiagnosticCode.Cannot_access_method_0_without_calling_it_as_it_requires_this_to_be_set,e.range,a.name),n.createUnreachable()}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),n.createUnreachable()},r.prototype.compileGetter=function(e,r){var t=e.getterPrototype;if(t){var n=this.resolver.resolveFunction(t,null);if(!n)return this.module.createUnreachable();var i=n.signature;if(!this.checkCallSignature(i,0,n.is(u.CommonFlags.INSTANCE),r))return this.module.createUnreachable();if(n.is(u.CommonFlags.INSTANCE)){var a=assert(n.parent);assert(a.kind==_.ElementKind.CLASS);var s=assert(this.resolver.currentThisExpression),o=this.compileExpressionRetainType(s,this.options.usizeType,0);//!!! -return this.currentType=i.returnType,this.compileCallDirect(n,[],r,o)}return this.currentType=i.returnType,this.compileCallDirect(n,[],r,0)}return this.error(l.DiagnosticCode.Property_0_does_not_exist_on_type_1,r.range,e.name,e.parent.toString()),this.module.createUnreachable()},r.prototype.compileTernaryExpression=function(e,r){var t=e.ifThen,n=e.ifElse,i=this.currentFlow,a=this.makeIsTrueish(this.compileExpressionRetainType(e.condition,T.Type.bool,0),this.currentType),s=this.module.precomputeExpression(a);if(p.getExpressionId(s)==p.ExpressionId.Const&&p.getExpressionType(s)==p.NativeType.I32)return p.getConstValueI32(s)?this.compileExpressionRetainType(t,r,0):this.compileExpressionRetainType(n,r,0);a=this.makeIsTrueish(this.compileExpressionRetainType(e.condition,T.Type.bool,0),this.currentType);var o=i.fork();this.currentFlow=o;var c=this.compileExpressionRetainType(t,r,0),u=this.currentType;o.freeScopedLocals();var _=i.fork();this.currentFlow=_;var h=this.compileExpressionRetainType(n,r,0),d=this.currentType;_.freeScopedLocals(),this.currentFlow=i,i.inheritMutual(o,_);var y=T.Type.commonDenominator(u,d,!1);return y?(c=this.convertExpression(c,u,y,1,0,t),h=this.convertExpression(h,d,y,1,0,n),this.currentType=y,this.module.createIf(a,c,h)):(this.error(l.DiagnosticCode.Type_0_is_not_assignable_to_type_1,e.range,u.toString(),d.toString()),this.currentType=r,this.module.createUnreachable())},r.prototype.compileUnaryPostfixExpression=function(e,r){var t=this.module,n=this.currentFlow,i=this.compileExpression(e.operand,r==T.Type.void?T.Type.i32:r,0,0);if(p.getExpressionId(i)==p.ExpressionId.Unreachable)return i;var a,s=this.currentType,o=null;switch(r!=T.Type.void&&(o=n.getTempLocal(s,!1),i=t.createTeeLocal(o.index,i)),e.operator){case y.Token.PLUS_PLUS:switch(s.kind){case 0:case 1:case 2:case 5:case 6:case 7:case 10:a=t.createBinary(p.BinaryOp.AddI32,i,t.createI32(1));break;case 9:if(this.currentType.is(256)){if(u=this.currentType.classReference)if(h=u.lookupOverload(_.OperatorKind.POSTFIX_INC)){a=this.compileUnaryOverload(h,e.operand,i,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),t.createUnreachable()}case 4:var c=this.options;a=t.createBinary(c.isWasm64?p.BinaryOp.AddI64:p.BinaryOp.AddI32,i,s.toNativeOne(t));break;case 3:case 8:a=t.createBinary(p.BinaryOp.AddI64,i,t.createI64(1));break;case 11:a=t.createBinary(p.BinaryOp.AddF32,i,t.createF32(1));break;case 12:a=t.createBinary(p.BinaryOp.AddF64,i,t.createF64(1));break;default:return assert(!1),t.createUnreachable()}break;case y.Token.MINUS_MINUS:switch(s.kind){case 0:case 1:case 2:case 5:case 6:case 7:case 10:a=t.createBinary(p.BinaryOp.SubI32,i,t.createI32(1));break;case 9:if(this.currentType.is(256)){var u,h;if(u=this.currentType.classReference)if(h=u.lookupOverload(_.OperatorKind.POSTFIX_DEC)){a=this.compileUnaryOverload(h,e.operand,i,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),t.createUnreachable()}case 4:c=this.options;a=t.createBinary(c.isWasm64?p.BinaryOp.SubI64:p.BinaryOp.SubI32,i,s.toNativeOne(t));break;case 3:case 8:a=t.createBinary(p.BinaryOp.SubI64,i,t.createI64(1));break;case 11:a=t.createBinary(p.BinaryOp.SubF32,i,t.createF32(1));break;case 12:a=t.createBinary(p.BinaryOp.SubF64,i,t.createF64(1));break;default:return assert(!1),t.createUnreachable()}break;default:return assert(!1),t.createUnreachable()}if(!o)return this.currentType=T.Type.void,this.compileAssignmentWithValue(e.operand,a,!1);var d=this.compileAssignmentWithValue(e.operand,a,!1);this.currentType=o.type,n.freeTempLocal(o);var m=o.type.toNativeType();return t.createBlock(null,[d,t.createGetLocal(o.index,m)],m)},r.prototype.compileUnaryPrefixExpression=function(e,r){var t,n=this.module,i=!1;switch(e.operator){case y.Token.PLUS:if(t=this.compileExpression(e.operand,r==T.Type.void?T.Type.i32:r,0,0),this.currentType.is(256)){if(a=this.currentType.classReference)if(s=a.lookupOverload(_.OperatorKind.PLUS)){t=this.compileUnaryOverload(s,e.operand,t,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),n.createUnreachable()}break;case y.Token.MINUS:if(e.operand.kind==m.NodeKind.LITERAL&&(e.operand.literalKind==m.LiteralKind.INTEGER||e.operand.literalKind==m.LiteralKind.FLOAT)){t=this.compileLiteralExpression(e.operand,r,!0),this.options.sourceMap&&this.addDebugLocation(t,e.range);break}if(t=this.compileExpression(e.operand,r==T.Type.void?T.Type.i32:r,0,0),this.currentType.is(256)){if(a=this.currentType.classReference)if(s=a.lookupOverload(_.OperatorKind.MINUS)){t=this.compileUnaryOverload(s,e.operand,t,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),n.createUnreachable()}switch(this.currentType.kind){case 0:case 1:case 2:case 5:case 6:case 7:case 10:t=n.createBinary(p.BinaryOp.SubI32,n.createI32(0),t);break;case 9:case 4:t=n.createBinary(this.options.isWasm64?p.BinaryOp.SubI64:p.BinaryOp.SubI32,this.currentType.toNativeZero(n),t);break;case 3:case 8:t=n.createBinary(p.BinaryOp.SubI64,n.createI64(0),t);break;case 11:t=n.createUnary(p.UnaryOp.NegF32,t);break;case 12:t=n.createUnary(p.UnaryOp.NegF64,t);break;default:assert(!1),t=n.createUnreachable()}break;case y.Token.PLUS_PLUS:if(i=!0,t=this.compileExpression(e.operand,r==T.Type.void?T.Type.i32:r,0,0),this.currentType.is(256)){if(a=this.currentType.classReference)if(s=a.lookupOverload(_.OperatorKind.PREFIX_INC)){t=this.compileUnaryOverload(s,e.operand,t,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),n.createUnreachable()}switch(this.currentType.kind){case 0:case 1:case 2:case 5:case 6:case 7:case 10:t=n.createBinary(p.BinaryOp.AddI32,t,this.module.createI32(1));break;case 9:case 4:t=n.createBinary(this.options.isWasm64?p.BinaryOp.AddI64:p.BinaryOp.AddI32,t,this.currentType.toNativeOne(n));break;case 3:case 8:t=n.createBinary(p.BinaryOp.AddI64,t,n.createI64(1));break;case 11:t=n.createBinary(p.BinaryOp.AddF32,t,n.createF32(1));break;case 12:t=n.createBinary(p.BinaryOp.AddF64,t,n.createF64(1));break;default:assert(!1),t=n.createUnreachable()}break;case y.Token.MINUS_MINUS:if(i=!0,t=this.compileExpression(e.operand,r==T.Type.void?T.Type.i32:r,0,0),this.currentType.is(256)){if(a=this.currentType.classReference)if(s=a.lookupOverload(_.OperatorKind.PREFIX_DEC)){t=this.compileUnaryOverload(s,e.operand,t,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),n.createUnreachable()}switch(this.currentType.kind){case 0:case 1:case 2:case 5:case 6:case 7:case 10:t=n.createBinary(p.BinaryOp.SubI32,t,n.createI32(1));break;case 9:case 4:t=n.createBinary(this.options.isWasm64?p.BinaryOp.SubI64:p.BinaryOp.SubI32,t,this.currentType.toNativeOne(n));break;case 3:case 8:t=n.createBinary(p.BinaryOp.SubI64,t,n.createI64(1));break;case 11:t=n.createBinary(p.BinaryOp.SubF32,t,n.createF32(1));break;case 12:t=n.createBinary(p.BinaryOp.SubF64,t,n.createF64(1));break;default:assert(!1),t=n.createUnreachable()}break;case y.Token.EXCLAMATION:if(t=this.compileExpression(e.operand,r==T.Type.void?T.Type.i32:r,0,0),this.currentType.is(256))if(a=this.currentType.classReference)if(s=a.lookupOverload(_.OperatorKind.NOT)){t=this.compileUnaryOverload(s,e.operand,t,e);break}t=this.makeIsFalseish(t,this.currentType),this.currentType=T.Type.bool;break;case y.Token.TILDE:if(t=this.compileExpression(e.operand,r==T.Type.void?T.Type.i32:r.is(8)?T.Type.i64:r,0,0),this.currentType.is(256)){var a,s;if(a=this.currentType.classReference)if(s=a.lookupOverload(_.OperatorKind.BITWISE_NOT)){t=this.compileUnaryOverload(s,e.operand,t,e);break}return this.error(l.DiagnosticCode.Operation_not_supported,e.range),n.createUnreachable()}switch(t=this.convertExpression(t,this.currentType,this.currentType.intType,1,0,e.operand),this.currentType.kind){case 0:case 1:case 2:case 5:case 6:case 7:case 10:t=n.createBinary(p.BinaryOp.XorI32,t,n.createI32(-1));break;case 9:case 4:t=n.createBinary(this.options.isWasm64?p.BinaryOp.XorI64:p.BinaryOp.XorI32,t,this.currentType.toNativeNegOne(n));break;case 3:case 8:t=n.createBinary(p.BinaryOp.XorI64,t,n.createI64(-1,-1));break;default:assert(!1),t=n.createUnreachable()}break;case y.Token.TYPEOF:return this.error(l.DiagnosticCode.Operation_not_supported,e.range),n.createUnreachable();default:return assert(!1),n.createUnreachable()}return i?this.compileAssignmentWithValue(e.operand,t,r!=T.Type.void):t},r.prototype.ensureSmallIntegerWrap=function(e,r){var t=this.module,n=this.currentFlow;switch(r.kind){case 0:n.canOverflow(e,r)&&(e=this.options.hasFeature(1)?t.createUnary(p.UnaryOp.ExtendI8ToI32,e):t.createBinary(p.BinaryOp.ShrI32,t.createBinary(p.BinaryOp.ShlI32,e,t.createI32(24)),t.createI32(24)));break;case 1:n.canOverflow(e,r)&&(e=this.options.hasFeature(1)?t.createUnary(p.UnaryOp.ExtendI16ToI32,e):t.createBinary(p.BinaryOp.ShrI32,t.createBinary(p.BinaryOp.ShlI32,e,t.createI32(16)),t.createI32(16)));break;case 5:n.canOverflow(e,r)&&(e=t.createBinary(p.BinaryOp.AndI32,e,t.createI32(255)));break;case 6:n.canOverflow(e,r)&&(e=t.createBinary(p.BinaryOp.AndI32,e,t.createI32(65535)));break;case 10:n.canOverflow(e,r)&&(e=t.createBinary(p.BinaryOp.NeI32,e,t.createI32(0)))}return e},r.prototype.makeIsFalseish=function(e,r){var t=this.module;switch(r.kind){case 0:case 1:case 5:case 6:case 10:e=this.ensureSmallIntegerWrap(e,r);case 2:case 7:return t.createUnary(p.UnaryOp.EqzI32,e);case 3:case 8:return t.createUnary(p.UnaryOp.EqzI64,e);case 9:case 4:return t.createUnary(64==r.size?p.UnaryOp.EqzI64:p.UnaryOp.EqzI32,e);case 11:return t.createBinary(p.BinaryOp.EqF32,e,t.createF32(0));case 12:return t.createBinary(p.BinaryOp.EqF64,e,t.createF64(0));default:return assert(!1),t.createI32(1)}},r.prototype.makeIsTrueish=function(e,r){var t=this.module;switch(r.kind){case 0:case 1:case 5:case 6:case 10:e=this.ensureSmallIntegerWrap(e,r);case 2:case 7:return e;case 3:case 8:return t.createBinary(p.BinaryOp.NeI64,e,t.createI64(0));case 9:case 4:return 64==r.size?t.createBinary(p.BinaryOp.NeI64,e,t.createI64(0)):e;case 11:return t.createBinary(p.BinaryOp.NeF32,e,t.createF32(0));case 12:return t.createBinary(p.BinaryOp.NeF64,e,t.createF64(0));default:return assert(!1),t.createI32(0)}},r.prototype.makeAllocation=function(e){var r=this.program;assert(e.program==r);var t=this.module,n=this.options;if(r.hasGC&&e.type.isManaged(r)){var i=assert(r.gcAllocateInstance);return this.compileFunction(i)?(this.currentType=e.type,t.createCall(i.internalName,[n.isWasm64?t.createI64(e.currentMemoryOffset):t.createI32(e.currentMemoryOffset),t.createI32(c.ensureGCHook(this,e))],n.nativeSizeType)):t.createUnreachable()}return(i=r.memoryAllocateInstance)&&this.compileFunction(i)?(this.currentType=e.type,t.createCall(i.internalName,[n.isWasm64?t.createI64(e.currentMemoryOffset):t.createI32(e.currentMemoryOffset)],n.nativeSizeType)):t.createUnreachable()},r.prototype.makeFieldInitialization=function(e,r){var t,n;void 0===r&&(r=[]);var i=e.members;if(!i)return[];var s=this.module,o=this.currentFlow,c=o.is(4096),l=c?assert(o.lookupLocal(u.CommonSymbols.this_)).index:0,p=this.options.nativeSizeType;try{for(var h=a(i.values()),d=h.next();!d.done;d=h.next()){var y=d.value;if(y.kind==_.ElementKind.FIELD&&y.parent==e){var m=y;assert(!m.isAny(u.CommonFlags.CONST));var T=m.type,f=T.toNativeType(),E=m.prototype.initializerNode;if(E)r.push(s.createStore(T.byteSize,s.createGetLocal(l,p),this.compileExpression(E,T,1,0),f,m.memoryOffset));else{var g=m.prototype.parameterIndex;r.push(s.createStore(T.byteSize,s.createGetLocal(l,p),g>=0?s.createGetLocal(c?assert(o.lookupLocal(m.name)).index:1+g,f):T.toNativeZero(s),f,m.memoryOffset))}}}}catch(e){t={error:e}}finally{try{d&&!d.done&&(n=h.return)&&n.call(h)}finally{if(t)throw t.error}}return r},r.prototype.addDebugLocation=function(e,r){var t=this.currentFlow.parentFunction,n=r.source;n.debugInfoIndex<0&&(n.debugInfoIndex=this.module.addDebugInfoFile(n.normalizedPath)),r.debugInfoRef=e,t.debugLocations.push(r)},r}(l.DiagnosticEmitter);function x(e,r){if(g=r.range.source.simplePath,v=_.mangleInternalName(e.name,e.parent,e.is(u.CommonFlags.INSTANCE),!0),e.hasDecorator(_.DecoratorFlags.EXTERNAL)){var t=e.program,n=assert(m.findDecorator(m.DecoratorKind.EXTERNAL,r.decorators)),i=n.arguments;if(i&&i.length){var a=i[0];a.kind==m.NodeKind.LITERAL&&a.literalKind==m.LiteralKind.STRING?(v=a.value,i.length>=2&&((a=i[1]).kind==m.NodeKind.LITERAL&&a.literalKind==m.LiteralKind.STRING?(g=v,v=a.value,i.length>2&&t.error(l.DiagnosticCode.Expected_0_arguments_but_got_1,n.range,"2",i.length.toString())):t.error(l.DiagnosticCode.String_literal_expected,a.range))):t.error(l.DiagnosticCode.String_literal_expected,a.range)}else t.error(l.DiagnosticCode.Expected_at_least_0_arguments_but_got_1,n.range,"1","0")}}r.Compiler=b,function(e){e.started="~lib/started",e.argc="~lib/argc",e.setargc="~lib/setargc"}(I||(I={}))},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),function(e){e[e.Operation_not_supported=100]="Operation_not_supported",e[e.Operation_is_unsafe=101]="Operation_is_unsafe",e[e.User_defined_0=102]="User_defined_0",e[e.Conversion_from_type_0_to_1_requires_an_explicit_cast=200]="Conversion_from_type_0_to_1_requires_an_explicit_cast",e[e.Conversion_from_type_0_to_1_will_require_an_explicit_cast_when_switching_between_32_64_bit=201]="Conversion_from_type_0_to_1_will_require_an_explicit_cast_when_switching_between_32_64_bit",e[e.Type_0_cannot_be_changed_to_type_1=202]="Type_0_cannot_be_changed_to_type_1",e[e.Type_0_cannot_be_reinterpreted_as_type_1=203]="Type_0_cannot_be_reinterpreted_as_type_1",e[e.Basic_type_0_cannot_be_nullable=204]="Basic_type_0_cannot_be_nullable",e[e.Cannot_export_a_mutable_global=205]="Cannot_export_a_mutable_global",e[e.Compiling_constant_with_non_constant_initializer_as_mutable=206]="Compiling_constant_with_non_constant_initializer_as_mutable",e[e.Unmanaged_classes_cannot_extend_managed_classes_and_vice_versa=207]="Unmanaged_classes_cannot_extend_managed_classes_and_vice_versa",e[e.Unmanaged_classes_cannot_implement_interfaces=208]="Unmanaged_classes_cannot_implement_interfaces",e[e.Invalid_regular_expression_flags=209]="Invalid_regular_expression_flags",e[e.Implementation_0_must_match_the_signature_1=210]="Implementation_0_must_match_the_signature_1",e[e.Class_0_is_sealed_and_cannot_be_extended=211]="Class_0_is_sealed_and_cannot_be_extended",e[e.Decorator_0_is_not_valid_here=212]="Decorator_0_is_not_valid_here",e[e.Duplicate_decorator=213]="Duplicate_decorator",e[e.An_allocator_must_be_declared_to_allocate_memory_Try_importing_allocator_arena_or_allocator_tlsf=214]="An_allocator_must_be_declared_to_allocate_memory_Try_importing_allocator_arena_or_allocator_tlsf",e[e.Optional_parameter_must_have_an_initializer=215]="Optional_parameter_must_have_an_initializer",e[e.Constructor_of_class_0_must_not_require_any_arguments=216]="Constructor_of_class_0_must_not_require_any_arguments",e[e.Function_0_cannot_be_inlined_into_itself=217]="Function_0_cannot_be_inlined_into_itself",e[e.Cannot_access_method_0_without_calling_it_as_it_requires_this_to_be_set=218]="Cannot_access_method_0_without_calling_it_as_it_requires_this_to_be_set",e[e.Optional_properties_are_not_supported=219]="Optional_properties_are_not_supported",e[e.Expression_must_be_a_compile_time_constant=220]="Expression_must_be_a_compile_time_constant",e[e.Module_cannot_have_multiple_start_functions=221]="Module_cannot_have_multiple_start_functions",e[e._0_must_be_a_value_between_1_and_2_inclusive=222]="_0_must_be_a_value_between_1_and_2_inclusive",e[e._0_must_be_a_power_of_two=223]="_0_must_be_a_power_of_two",e[e.Unterminated_string_literal=1002]="Unterminated_string_literal",e[e.Identifier_expected=1003]="Identifier_expected",e[e._0_expected=1005]="_0_expected",e[e.A_file_cannot_have_a_reference_to_itself=1006]="A_file_cannot_have_a_reference_to_itself",e[e.Trailing_comma_not_allowed=1009]="Trailing_comma_not_allowed",e[e.Unexpected_token=1012]="Unexpected_token",e[e.A_rest_parameter_must_be_last_in_a_parameter_list=1014]="A_rest_parameter_must_be_last_in_a_parameter_list",e[e.Parameter_cannot_have_question_mark_and_initializer=1015]="Parameter_cannot_have_question_mark_and_initializer",e[e.A_required_parameter_cannot_follow_an_optional_parameter=1016]="A_required_parameter_cannot_follow_an_optional_parameter",e[e.Statements_are_not_allowed_in_ambient_contexts=1036]="Statements_are_not_allowed_in_ambient_contexts",e[e.Initializers_are_not_allowed_in_ambient_contexts=1039]="Initializers_are_not_allowed_in_ambient_contexts",e[e._0_modifier_cannot_be_used_here=1042]="_0_modifier_cannot_be_used_here",e[e.A_rest_parameter_cannot_be_optional=1047]="A_rest_parameter_cannot_be_optional",e[e.A_rest_parameter_cannot_have_an_initializer=1048]="A_rest_parameter_cannot_have_an_initializer",e[e.A_set_accessor_must_have_exactly_one_parameter=1049]="A_set_accessor_must_have_exactly_one_parameter",e[e.A_set_accessor_parameter_cannot_have_an_initializer=1052]="A_set_accessor_parameter_cannot_have_an_initializer",e[e.A_get_accessor_cannot_have_parameters=1054]="A_get_accessor_cannot_have_parameters",e[e.Enum_member_must_have_initializer=1061]="Enum_member_must_have_initializer",e[e.Type_parameters_cannot_appear_on_a_constructor_declaration=1092]="Type_parameters_cannot_appear_on_a_constructor_declaration",e[e.Type_annotation_cannot_appear_on_a_constructor_declaration=1093]="Type_annotation_cannot_appear_on_a_constructor_declaration",e[e.An_accessor_cannot_have_type_parameters=1094]="An_accessor_cannot_have_type_parameters",e[e.A_set_accessor_cannot_have_a_return_type_annotation=1095]="A_set_accessor_cannot_have_a_return_type_annotation",e[e.Type_parameter_list_cannot_be_empty=1098]="Type_parameter_list_cannot_be_empty",e[e.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement=1104]="A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement",e[e.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement=1105]="A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement",e[e.A_return_statement_can_only_be_used_within_a_function_body=1108]="A_return_statement_can_only_be_used_within_a_function_body",e[e.Expression_expected=1109]="Expression_expected",e[e.Type_expected=1110]="Type_expected",e[e.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement=1113]="A_default_clause_cannot_appear_more_than_once_in_a_switch_statement",e[e.Duplicate_label_0=1114]="Duplicate_label_0",e[e.Octal_literals_are_not_allowed_in_strict_mode=1121]="Octal_literals_are_not_allowed_in_strict_mode",e[e.Digit_expected=1124]="Digit_expected",e[e.Hexadecimal_digit_expected=1125]="Hexadecimal_digit_expected",e[e.Unexpected_end_of_text=1126]="Unexpected_end_of_text",e[e.Invalid_character=1127]="Invalid_character",e[e._case_or_default_expected=1130]="_case_or_default_expected",e[e._super_must_be_followed_by_an_argument_list_or_member_access=1034]="_super_must_be_followed_by_an_argument_list_or_member_access",e[e.A_declare_modifier_cannot_be_used_in_an_already_ambient_context=1038]="A_declare_modifier_cannot_be_used_in_an_already_ambient_context",e[e.Type_argument_expected=1140]="Type_argument_expected",e[e.String_literal_expected=1141]="String_literal_expected",e[e.Line_break_not_permitted_here=1142]="Line_break_not_permitted_here",e[e.Declaration_expected=1146]="Declaration_expected",e[e._const_declarations_must_be_initialized=1155]="_const_declarations_must_be_initialized",e[e.Unterminated_regular_expression_literal=1161]="Unterminated_regular_expression_literal",e[e.Interface_declaration_cannot_have_implements_clause=1176]="Interface_declaration_cannot_have_implements_clause",e[e.Binary_digit_expected=1177]="Binary_digit_expected",e[e.Octal_digit_expected=1178]="Octal_digit_expected",e[e.An_implementation_cannot_be_declared_in_ambient_contexts=1183]="An_implementation_cannot_be_declared_in_ambient_contexts",e[e.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive=1198]="An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive",e[e.Unterminated_Unicode_escape_sequence=1199]="Unterminated_Unicode_escape_sequence",e[e.Decorators_are_not_valid_here=1206]="Decorators_are_not_valid_here",e[e._abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration=1242]="_abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration",e[e.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract=1245]="Method_0_cannot_have_an_implementation_because_it_is_marked_abstract",e[e.A_definite_assignment_assertion_is_not_permitted_in_this_context=1255]="A_definite_assignment_assertion_is_not_permitted_in_this_context",e[e.A_class_may_only_extend_another_class=1311]="A_class_may_only_extend_another_class",e[e.A_parameter_property_cannot_be_declared_using_a_rest_parameter=1317]="A_parameter_property_cannot_be_declared_using_a_rest_parameter",e[e.Duplicate_identifier_0=2300]="Duplicate_identifier_0",e[e.Cannot_find_name_0=2304]="Cannot_find_name_0",e[e.Module_0_has_no_exported_member_1=2305]="Module_0_has_no_exported_member_1",e[e.Generic_type_0_requires_1_type_argument_s=2314]="Generic_type_0_requires_1_type_argument_s",e[e.Type_0_is_not_generic=2315]="Type_0_is_not_generic",e[e.Type_0_is_not_assignable_to_type_1=2322]="Type_0_is_not_assignable_to_type_1",e[e.Index_signature_is_missing_in_type_0=2329]="Index_signature_is_missing_in_type_0",e[e._this_cannot_be_referenced_in_current_location=2332]="_this_cannot_be_referenced_in_current_location",e[e._super_can_only_be_referenced_in_a_derived_class=2335]="_super_can_only_be_referenced_in_a_derived_class",e[e.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors=2337]="Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors",e[e.Property_0_does_not_exist_on_type_1=2339]="Property_0_does_not_exist_on_type_1",e[e.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures=2349]="Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures",e[e.Cannot_use_new_with_an_expression_whose_type_lacks_a_construct_signature=2351]="Cannot_use_new_with_an_expression_whose_type_lacks_a_construct_signature",e[e.A_function_whose_declared_type_is_not_void_must_return_a_value=2355]="A_function_whose_declared_type_is_not_void_must_return_a_value",e[e.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access=2357]="The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access",e[e.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access=2364]="The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access",e[e.Operator_0_cannot_be_applied_to_types_1_and_2=2365]="Operator_0_cannot_be_applied_to_types_1_and_2",e[e.A_super_call_must_be_the_first_statement_in_the_constructor=2376]="A_super_call_must_be_the_first_statement_in_the_constructor",e[e.Constructors_for_derived_classes_must_contain_a_super_call=2377]="Constructors_for_derived_classes_must_contain_a_super_call",e[e._get_and_set_accessor_must_have_the_same_type=2380]="_get_and_set_accessor_must_have_the_same_type",e[e.Constructor_implementation_is_missing=2390]="Constructor_implementation_is_missing",e[e.Function_implementation_is_missing_or_not_immediately_following_the_declaration=2391]="Function_implementation_is_missing_or_not_immediately_following_the_declaration",e[e.Multiple_constructor_implementations_are_not_allowed=2392]="Multiple_constructor_implementations_are_not_allowed",e[e.Duplicate_function_implementation=2393]="Duplicate_function_implementation",e[e.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local=2395]="Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local",e[e.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged=2434]="A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged",e[e.Type_0_has_no_property_1=2460]="Type_0_has_no_property_1",e[e.The_0_operator_cannot_be_applied_to_type_1=2469]="The_0_operator_cannot_be_applied_to_type_1",e[e.In_const_enum_declarations_member_initializer_must_be_constant_expression=2474]="In_const_enum_declarations_member_initializer_must_be_constant_expression",e[e.Export_declaration_conflicts_with_exported_declaration_of_0=2484]="Export_declaration_conflicts_with_exported_declaration_of_0",e[e.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property=2540]="Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property",e[e.The_target_of_an_assignment_must_be_a_variable_or_a_property_access=2541]="The_target_of_an_assignment_must_be_a_variable_or_a_property_access",e[e.Index_signature_in_type_0_only_permits_reading=2542]="Index_signature_in_type_0_only_permits_reading",e[e.Expected_0_arguments_but_got_1=2554]="Expected_0_arguments_but_got_1",e[e.Expected_at_least_0_arguments_but_got_1=2555]="Expected_at_least_0_arguments_but_got_1",e[e.Expected_0_type_arguments_but_got_1=2558]="Expected_0_type_arguments_but_got_1",e[e.A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums=2651]="A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums",e[e.Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration=2673]="Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration",e[e.Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration=2674]="Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration",e[e.Namespace_0_has_no_exported_member_1=2694]="Namespace_0_has_no_exported_member_1",e[e.Required_type_parameters_may_not_follow_optional_type_parameters=2706]="Required_type_parameters_may_not_follow_optional_type_parameters",e[e.Duplicate_property_0=2718]="Duplicate_property_0",e[e.File_0_not_found=6054]="File_0_not_found",e[e.Numeric_separators_are_not_allowed_here=6188]="Numeric_separators_are_not_allowed_here",e[e.Multiple_consecutive_numeric_separators_are_not_permitted=6189]="Multiple_consecutive_numeric_separators_are_not_permitted",e[e._super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class=17009]="_super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class",e[e._super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class=17011]="_super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class"}(r.DiagnosticCode||(r.DiagnosticCode={})),r.diagnosticCodeToString=function(e){switch(e){case 100:return"Operation not supported.";case 101:return"Operation is unsafe.";case 102:return"User-defined: {0}";case 200:return"Conversion from type '{0}' to '{1}' requires an explicit cast.";case 201:return"Conversion from type '{0}' to '{1}' will require an explicit cast when switching between 32/64-bit.";case 202:return"Type '{0}' cannot be changed to type '{1}'.";case 203:return"Type '{0}' cannot be reinterpreted as type '{1}'.";case 204:return"Basic type '{0}' cannot be nullable.";case 205:return"Cannot export a mutable global.";case 206:return"Compiling constant with non-constant initializer as mutable.";case 207:return"Unmanaged classes cannot extend managed classes and vice-versa.";case 208:return"Unmanaged classes cannot implement interfaces.";case 209:return"Invalid regular expression flags.";case 210:return"Implementation '{0}' must match the signature '{1}'.";case 211:return"Class '{0}' is sealed and cannot be extended.";case 212:return"Decorator '{0}' is not valid here.";case 213:return"Duplicate decorator.";case 214:return"An allocator must be declared to allocate memory. Try importing allocator/arena or allocator/tlsf.";case 215:return"Optional parameter must have an initializer.";case 216:return"Constructor of class '{0}' must not require any arguments.";case 217:return"Function '{0}' cannot be inlined into itself.";case 218:return"Cannot access method '{0}' without calling it as it requires 'this' to be set.";case 219:return"Optional properties are not supported.";case 220:return"Expression must be a compile-time constant.";case 221:return"Module cannot have multiple start functions.";case 222:return"'{0}' must be a value between '{1}' and '{2}' inclusive.";case 223:return"'{0}' must be a power of two.";case 1002:return"Unterminated string literal.";case 1003:return"Identifier expected.";case 1005:return"'{0}' expected.";case 1006:return"A file cannot have a reference to itself.";case 1009:return"Trailing comma not allowed.";case 1012:return"Unexpected token.";case 1014:return"A rest parameter must be last in a parameter list.";case 1015:return"Parameter cannot have question mark and initializer.";case 1016:return"A required parameter cannot follow an optional parameter.";case 1036:return"Statements are not allowed in ambient contexts.";case 1039:return"Initializers are not allowed in ambient contexts.";case 1042:return"'{0}' modifier cannot be used here.";case 1047:return"A rest parameter cannot be optional.";case 1048:return"A rest parameter cannot have an initializer.";case 1049:return"A 'set' accessor must have exactly one parameter.";case 1052:return"A 'set' accessor parameter cannot have an initializer.";case 1054:return"A 'get' accessor cannot have parameters.";case 1061:return"Enum member must have initializer.";case 1092:return"Type parameters cannot appear on a constructor declaration.";case 1093:return"Type annotation cannot appear on a constructor declaration.";case 1094:return"An accessor cannot have type parameters.";case 1095:return"A 'set' accessor cannot have a return type annotation.";case 1098:return"Type parameter list cannot be empty.";case 1104:return"A 'continue' statement can only be used within an enclosing iteration statement.";case 1105:return"A 'break' statement can only be used within an enclosing iteration or switch statement.";case 1108:return"A 'return' statement can only be used within a function body.";case 1109:return"Expression expected.";case 1110:return"Type expected.";case 1113:return"A 'default' clause cannot appear more than once in a 'switch' statement.";case 1114:return"Duplicate label '{0}'.";case 1121:return"Octal literals are not allowed in strict mode.";case 1124:return"Digit expected.";case 1125:return"Hexadecimal digit expected.";case 1126:return"Unexpected end of text.";case 1127:return"Invalid character.";case 1130:return"'case' or 'default' expected.";case 1034:return"'super' must be followed by an argument list or member access.";case 1038:return"A 'declare' modifier cannot be used in an already ambient context.";case 1140:return"Type argument expected.";case 1141:return"String literal expected.";case 1142:return"Line break not permitted here.";case 1146:return"Declaration expected.";case 1155:return"'const' declarations must be initialized.";case 1161:return"Unterminated regular expression literal.";case 1176:return"Interface declaration cannot have 'implements' clause.";case 1177:return"Binary digit expected.";case 1178:return"Octal digit expected.";case 1183:return"An implementation cannot be declared in ambient contexts.";case 1198:return"An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.";case 1199:return"Unterminated Unicode escape sequence.";case 1206:return"Decorators are not valid here.";case 1242:return"'abstract' modifier can only appear on a class, method, or property declaration.";case 1245:return"Method '{0}' cannot have an implementation because it is marked abstract.";case 1255:return"A definite assignment assertion '!' is not permitted in this context.";case 1311:return"A class may only extend another class.";case 1317:return"A parameter property cannot be declared using a rest parameter.";case 2300:return"Duplicate identifier '{0}'.";case 2304:return"Cannot find name '{0}'.";case 2305:return"Module '{0}' has no exported member '{1}'.";case 2314:return"Generic type '{0}' requires {1} type argument(s).";case 2315:return"Type '{0}' is not generic.";case 2322:return"Type '{0}' is not assignable to type '{1}'.";case 2329:return"Index signature is missing in type '{0}'.";case 2332:return"'this' cannot be referenced in current location.";case 2335:return"'super' can only be referenced in a derived class.";case 2337:return"Super calls are not permitted outside constructors or in nested functions inside constructors.";case 2339:return"Property '{0}' does not exist on type '{1}'.";case 2349:return"Cannot invoke an expression whose type lacks a call signature. Type '{0}' has no compatible call signatures.";case 2351:return"Cannot use 'new' with an expression whose type lacks a construct signature.";case 2355:return"A function whose declared type is not 'void' must return a value.";case 2357:return"The operand of an increment or decrement operator must be a variable or a property access.";case 2364:return"The left-hand side of an assignment expression must be a variable or a property access.";case 2365:return"Operator '{0}' cannot be applied to types '{1}' and '{2}'.";case 2376:return"A 'super' call must be the first statement in the constructor.";case 2377:return"Constructors for derived classes must contain a 'super' call.";case 2380:return"'get' and 'set' accessor must have the same type.";case 2390:return"Constructor implementation is missing.";case 2391:return"Function implementation is missing or not immediately following the declaration.";case 2392:return"Multiple constructor implementations are not allowed.";case 2393:return"Duplicate function implementation.";case 2395:return"Individual declarations in merged declaration '{0}' must be all exported or all local.";case 2434:return"A namespace declaration cannot be located prior to a class or function with which it is merged.";case 2460:return"Type '{0}' has no property '{1}'.";case 2469:return"The '{0}' operator cannot be applied to type '{1}'.";case 2474:return"In 'const' enum declarations member initializer must be constant expression.";case 2484:return"Export declaration conflicts with exported declaration of '{0}'.";case 2540:return"Cannot assign to '{0}' because it is a constant or a read-only property.";case 2541:return"The target of an assignment must be a variable or a property access.";case 2542:return"Index signature in type '{0}' only permits reading.";case 2554:return"Expected {0} arguments, but got {1}.";case 2555:return"Expected at least {0} arguments, but got {1}.";case 2558:return"Expected {0} type arguments, but got {1}.";case 2651:return"A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums.";case 2673:return"Constructor of class '{0}' is private and only accessible within the class declaration.";case 2674:return"Constructor of class '{0}' is protected and only accessible within the class declaration.";case 2694:return"Namespace '{0}' has no exported member '{1}'.";case 2706:return"Required type parameters may not follow optional type parameters.";case 2718:return"Duplicate property '{0}'.";case 6054:return"File '{0}' not found.";case 6188:return"Numeric separators are not allowed here.";case 6189:return"Multiple consecutive numeric separators are not permitted.";case 17009:return"'super' must be called before accessing 'this' in the constructor of a derived class.";case 17011:return"'super' must be called before accessing a property of 'super' in the constructor of a derived class.";default:return""}}},function(e,r,t){"use strict";var n=this&&this.__values||function(e){var r="function"==typeof Symbol&&e[Symbol.iterator],t=0;return r?r.call(e):{next:function(){return e&&t>=e.length&&(e=void 0),{value:e&&e[t++],done:!e}}}};Object.defineProperty(r,"__esModule",{value:!0});var i=t(6),a=t(3),s=t(4),o=t(0),c=t(2),l=t(1);!function(e){e[e.NONE=0]="NONE",e[e.RETURNS=1]="RETURNS",e[e.RETURNS_WRAPPED=2]="RETURNS_WRAPPED",e[e.THROWS=4]="THROWS",e[e.BREAKS=8]="BREAKS",e[e.CONTINUES=16]="CONTINUES",e[e.ALLOCATES=32]="ALLOCATES",e[e.CALLS_SUPER=64]="CALLS_SUPER",e[e.CONDITIONALLY_RETURNS=128]="CONDITIONALLY_RETURNS",e[e.CONDITIONALLY_THROWS=256]="CONDITIONALLY_THROWS",e[e.CONDITIONALLY_BREAKS=512]="CONDITIONALLY_BREAKS",e[e.CONDITIONALLY_CONTINUES=1024]="CONDITIONALLY_CONTINUES",e[e.CONDITIONALLY_ALLOCATES=2048]="CONDITIONALLY_ALLOCATES",e[e.INLINE_CONTEXT=4096]="INLINE_CONTEXT",e[e.UNCHECKED_CONTEXT=8192]="UNCHECKED_CONTEXT",e[e.ANY_TERMINATING=29]="ANY_TERMINATING",e[e.ANY_CATEGORICAL=127]="ANY_CATEGORICAL",e[e.ANY_CONDITIONAL=3968]="ANY_CONDITIONAL"}(r.FlowFlags||(r.FlowFlags={}));var p=function(){function e(){this.scopedLocals=null}return e.create=function(r){var t=new e;return t.parent=null,t.flags=0,t.parentFunction=r,t.continueLabel=null,t.breakLabel=null,t.returnType=r.signature.returnType,t.contextualTypeArguments=r.contextualTypeArguments,t.wrappedLocals=i64_new(0),t.wrappedLocalsExt=null,t.inlineFunction=null,t.inlineReturnLabel=null,t},e.createInline=function(r,t){var n=e.create(r);return n.set(4096),n.inlineFunction=t,n.inlineReturnLabel=t.internalName+"|inlined."+(t.nextInlineId++).toString(10),n.returnType=t.signature.returnType,n.contextualTypeArguments=t.contextualTypeArguments,n},Object.defineProperty(e.prototype,"actualFunction",{get:function(){return this.inlineFunction||this.parentFunction},enumerable:!0,configurable:!0}),e.prototype.is=function(e){return(this.flags&e)==e},e.prototype.isAny=function(e){return 0!=(this.flags&e)},e.prototype.set=function(e){this.flags|=e},e.prototype.unset=function(e){this.flags&=~e},e.prototype.fork=function(){var r=new e;return r.parent=this,r.flags=this.flags,r.parentFunction=this.parentFunction,r.continueLabel=this.continueLabel,r.breakLabel=this.breakLabel,r.returnType=this.returnType,r.contextualTypeArguments=this.contextualTypeArguments,r.wrappedLocals=this.wrappedLocals,r.wrappedLocalsExt=this.wrappedLocalsExt?this.wrappedLocalsExt.slice():null,r.inlineFunction=this.inlineFunction,r.inlineReturnLabel=this.inlineReturnLabel,r},e.prototype.getTempLocal=function(e,r){void 0===r&&(r=!1);var t,n,i=this.parentFunction;switch(e.toNativeType()){case s.NativeType.I32:t=i.tempI32s;break;case s.NativeType.I64:t=i.tempI64s;break;case s.NativeType.F32:t=i.tempF32s;break;case s.NativeType.F64:t=i.tempF64s;break;case s.NativeType.V128:t=i.tempV128s;break;default:throw new Error("concrete type expected")}return t&&t.length?((n=t.pop()).type=e,n.flags=o.CommonFlags.NONE):n=i.addLocal(e),e.is(36)&&this.setLocalWrapped(n.index,r),n},e.prototype.freeTempLocal=function(e){if(!e.is(o.CommonFlags.INLINED)){assert(e.index>=0);var r,t=this.parentFunction;switch(assert(null!=e.type),e.type.toNativeType()){case s.NativeType.I32:r=t.tempI32s||(t.tempI32s=[]);break;case s.NativeType.I64:r=t.tempI64s||(t.tempI64s=[]);break;case s.NativeType.F32:r=t.tempF32s||(t.tempF32s=[]);break;case s.NativeType.F64:r=t.tempF64s||(t.tempF64s=[]);break;case s.NativeType.V128:r=t.tempV128s||(t.tempV128s=[]);break;default:throw new Error("concrete type expected")}assert(e.index>=0),r.push(e)}},e.prototype.getAndFreeTempLocal=function(e,r){var t,n,i=this.parentFunction;switch(e.toNativeType()){case s.NativeType.I32:t=i.tempI32s||(i.tempI32s=[]);break;case s.NativeType.I64:t=i.tempI64s||(i.tempI64s=[]);break;case s.NativeType.F32:t=i.tempF32s||(i.tempF32s=[]);break;case s.NativeType.F64:t=i.tempF64s||(i.tempF64s=[]);break;case s.NativeType.V128:t=i.tempV128s||(i.tempV128s=[]);break;default:throw new Error("concrete type expected")}return t.length?(n=t[t.length-1]).type=e:(n=i.addLocal(e),t.push(n)),e.is(36)&&this.setLocalWrapped(n.index,r),n},e.prototype.addScopedLocal=function(e,r,t,n){void 0===n&&(n=null);var i=this.getTempLocal(r,!1);if(this.scopedLocals){var a=this.scopedLocals.get(e);if(a)return n&&this.parentFunction.program.error(c.DiagnosticCode.Duplicate_identifier_0,n.range),a}else this.scopedLocals=new Map;return i.set(o.CommonFlags.SCOPED),this.scopedLocals.set(e,i),r.is(36)&&this.setLocalWrapped(i.index,t),i},e.prototype.addScopedAlias=function(e,r,t,n){if(void 0===n&&(n=null),this.scopedLocals){var i=this.scopedLocals.get(e);if(i)return n&&this.parentFunction.program.error(c.DiagnosticCode.Duplicate_identifier_0,n.range),i}else this.scopedLocals=new Map;assert(t1?e.breakLabel=r[t-2].toString(10):(e.breakLabel=null,e.breakStack=null)},e.prototype.inherit=function(e){this.flags|=4095&e.flags,this.wrappedLocals=e.wrappedLocals,this.wrappedLocalsExt=e.wrappedLocalsExt},e.prototype.inheritConditional=function(e){e.is(1)&&this.set(128),e.is(4)&&this.set(256),e.is(8)&&e.breakLabel==this.breakLabel&&this.set(512),e.is(16)&&e.continueLabel==this.continueLabel&&this.set(1024),e.is(32)&&this.set(2048)},e.prototype.inheritMutual=function(e,r){this.flags|=e.flags&r.flags&127,this.flags|=3968&e.flags,this.flags|=3968&r.flags,this.wrappedLocals=i64_and(e.wrappedLocals,r.wrappedLocals);var t=e.wrappedLocalsExt,n=r.wrappedLocalsExt;if(null!=t&&null!=n){var i=this.wrappedLocalsExt,a=min(t.length,n.length);if(a){if(i)for(;i.lengthc):this.canOverflow(s.getBinaryLeft(e),r)&&!(s.getExpressionId(t=s.getBinaryRight(e))==s.ExpressionId.Const&&s.getConstValueI32(t)>=c);case s.BinaryOp.DivU32:case s.BinaryOp.RemI32:case s.BinaryOp.RemU32:return this.canOverflow(s.getBinaryLeft(e),r)||this.canOverflow(s.getBinaryRight(e),r)}break;case s.ExpressionId.Unary:switch(s.getUnaryOp(e)){case s.UnaryOp.EqzI32:case s.UnaryOp.EqzI64:return!1;case s.UnaryOp.ClzI32:case s.UnaryOp.CtzI32:case s.UnaryOp.PopcntI32:return r.size<7}break;case s.ExpressionId.Const:var l=0;switch(s.getExpressionType(e)){case s.NativeType.I32:l=s.getConstValueI32(e);break;case s.NativeType.I64:l=s.getConstValueI64Low(e);break;case s.NativeType.F32:l=i32(s.getConstValueF32(e));break;case s.NativeType.F64:l=i32(s.getConstValueF64(e));break;default:assert(!1)}switch(r.kind){case 0:return li8.MAX_VALUE;case 1:return li16.MAX_VALUE;case 5:return l<0||l>u8.MAX_VALUE;case 6:return l<0||l>u16.MAX_VALUE;case 10:return 0!=(-2&l)}break;case s.ExpressionId.Load:var p=void 0;switch(s.getLoadBytes(e)){case 1:p=s.isLoadSigned(e)?i.Type.i8:i.Type.u8;break;case 2:p=s.isLoadSigned(e)?i.Type.i16:i.Type.u16;break;default:p=s.isLoadSigned(e)?i.Type.i32:i.Type.u32}return u(p,r);case s.ExpressionId.Block:if(!s.getBlockName(e)){var _=assert(s.getBlockChildCount(e)),h=s.getBlockChild(e,_-1);return this.canOverflow(h,r)}break;case s.ExpressionId.If:return this.canOverflow(s.getIfTrue(e),r)||this.canOverflow(assert(s.getIfFalse(e)),r);case s.ExpressionId.Select:return this.canOverflow(s.getSelectThen(e),r)||this.canOverflow(s.getSelectElse(e),r);case s.ExpressionId.Call:var d=this.parentFunction.program,y=assert(d.instancesByName.get(assert(s.getCallTarget(e))));assert(y.kind==a.ElementKind.FUNCTION);var m=y.signature.returnType;return!y.flow.is(2)||u(m,r);case s.ExpressionId.Unreachable:return!1}return!0},e}();function u(e,r){return!e.is(4)||e.size>r.size||e.is(1)!=r.is(1)}r.Flow=p},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(4),i=function(){function e(){this.text=[],this.functionId=0}return e.decompile=function(r){var t=new e;return t.decompile(r),t.finish()},e.prototype.decompile=function(e){throw new Error("not implemented")},e.prototype.decompileFunction=function(e){var r=n.getFunctionName(e)||"$"+this.functionId.toString(10),t=n.getFunctionBody(e);this.push("function "),this.push(r),this.push("(");for(var i=0,s=n.getFunctionParamCount(e);i0&&this.push(", "),this.push("$"),this.push(i.toString(10)),this.push(": "),this.push(a(n.getFunctionParamType(e,i)));this.push("): "),this.push(a(n.getFunctionResultType(e))),this.push(" "),n.getExpressionId(t)!=n.ExpressionId.Block&&this.push("{\n"),this.decompileExpression(t),n.getExpressionId(t)!=n.ExpressionId.Block&&this.push("\n}\n"),++this.functionId},e.prototype.decompileExpression=function(e){var r,t,i,s,o=n.getExpressionId(e),c=n.getExpressionType(e);switch(o){case n.ExpressionId.Block:for(null!=(t=n.getBlockName(e))&&(this.push(t),this.push(": ")),this.push("{\n"),s=n.getBlockChildCount(e),i=0;i("),this.push(n.getLoadOffset(e).toString(10)),this.push(" + "),this.decompileExpression(n.getLoadPtr(e)),void this.push(")");case n.ExpressionId.Store:return this.push("store<"),this.push(a(c)),this.push(">("),this.push(n.getStoreOffset(e).toString(10)),this.push(" + "),this.decompileExpression(n.getStorePtr(e)),this.push(", "),this.decompileExpression(n.getStoreValue(e)),void this.push(")");case n.ExpressionId.Const:switch(c){case n.NativeType.I32:return void this.push(n.getConstValueI32(e).toString(10));case n.NativeType.I64:return void this.push(i64_to_string(i64_new(n.getConstValueI64Low(e),n.getConstValueI64High(e))));case n.NativeType.F32:return void this.push(n.getConstValueF32(e).toString(10));case n.NativeType.F64:return void this.push(n.getConstValueF64(e).toString(10))}break;case n.ExpressionId.Unary:switch(n.getUnaryOp(e)){case n.UnaryOp.ClzI32:return this.push("clz("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.CtzI32:return this.push("ctz("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.PopcntI32:return this.push("popcnt("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.NegF32:case n.UnaryOp.NegF64:return this.push("-"),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.AbsF32:return this.push("abs("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.CeilF32:return this.push("ceil("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.FloorF32:return this.push("floor("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.TruncF32:return this.push("trunc("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.NearestF32:return this.push("nearest("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.SqrtF32:return this.push("sqrt("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.EqzI32:case n.UnaryOp.EqzI64:return this.push("!"),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.ClzI64:return this.push("clz("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.CtzI64:return this.push("ctz("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.PopcntI64:return this.push("popcnt("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.AbsF64:return this.push("abs("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.CeilF64:return this.push("ceil("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.FloorF64:return this.push("floor("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.TruncF64:return this.push("trunc("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.NearestF64:return this.push("nearest("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.SqrtF64:return this.push("sqrt("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.ExtendI32:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.ExtendU32:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.WrapI64:case n.UnaryOp.TruncF32ToI32:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.TruncF32ToI64:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.TruncF32ToU32:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.TruncF32ToU64:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.TruncF64ToI32:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.TruncF64ToI64:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.TruncF64ToU32:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.TruncF64ToU64:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.ReinterpretF32:return this.push("reinterpret("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.ReinterpretF64:return this.push("reinterpret("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.ConvertI32ToF32:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.ConvertI32ToF64:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.ConvertU32ToF32:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.ConvertU32ToF64:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.ConvertI64ToF32:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.ConvertI64ToF64:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.ConvertU64ToF32:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.ConvertU64ToF64:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.PromoteF32:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.DemoteF64:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.ReinterpretI32:return this.push("reinterpret("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.ReinterpretI64:return this.push("reinterpret("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")")}break;case n.ExpressionId.Binary:switch(n.getBinaryOp(e)){case n.BinaryOp.AddI32:case n.BinaryOp.AddI64:case n.BinaryOp.AddF32:case n.BinaryOp.AddF64:return this.decompileExpression(n.getBinaryLeft(e)),this.push(" + "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.SubI32:case n.BinaryOp.SubI64:case n.BinaryOp.SubF32:case n.BinaryOp.SubF64:return this.decompileExpression(n.getBinaryLeft(e)),this.push(" - "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.MulI32:case n.BinaryOp.MulI64:case n.BinaryOp.MulF32:case n.BinaryOp.MulF64:return this.decompileExpression(n.getBinaryLeft(e)),this.push(" * "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.DivI32:case n.BinaryOp.DivI64:case n.BinaryOp.DivF32:case n.BinaryOp.DivF64:return this.decompileExpression(n.getBinaryLeft(e)),this.push(" / "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.DivU32:return this.push("("),this.decompileExpression(n.getBinaryLeft(e)),this.push(" / "),this.decompileExpression(n.getBinaryRight(e)),void this.push(")");case n.BinaryOp.RemI32:case n.BinaryOp.RemI64:return this.decompileExpression(n.getBinaryLeft(e)),this.push(" % "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.RemU32:return this.push("("),this.decompileExpression(n.getBinaryLeft(e)),this.push(" / "),this.decompileExpression(n.getBinaryRight(e)),void this.push(")");case n.BinaryOp.AndI32:case n.BinaryOp.AndI64:return this.decompileExpression(n.getBinaryLeft(e)),this.push(" & "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.OrI32:case n.BinaryOp.OrI64:return this.decompileExpression(n.getBinaryLeft(e)),this.push(" | "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.XorI32:case n.BinaryOp.XorI64:return this.decompileExpression(n.getBinaryLeft(e)),this.push(" ^ "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.ShlI32:case n.BinaryOp.ShlI64:return this.decompileExpression(n.getBinaryLeft(e)),this.push(" << "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.ShrU32:case n.BinaryOp.ShrU64:return this.decompileExpression(n.getBinaryLeft(e)),this.push(" >>> "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.ShrI32:case n.BinaryOp.ShrI64:return this.decompileExpression(n.getBinaryLeft(e)),this.push(" >> "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.RotlI32:return this.push("rotl("),this.decompileExpression(n.getBinaryLeft(e)),this.push(", "),this.decompileExpression(n.getBinaryRight(e)),void this.push(")");case n.BinaryOp.RotrI32:return this.push("rotr("),this.decompileExpression(n.getBinaryLeft(e)),this.push(", "),this.decompileExpression(n.getBinaryRight(e)),void this.push(")");case n.BinaryOp.EqI32:case n.BinaryOp.EqI64:case n.BinaryOp.EqF32:case n.BinaryOp.EqF64:return this.decompileExpression(n.getBinaryLeft(e)),this.push(" == "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.NeI32:case n.BinaryOp.NeI64:case n.BinaryOp.NeF32:case n.BinaryOp.NeF64:return this.decompileExpression(n.getBinaryLeft(e)),this.push(" != "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.LtI32:case n.BinaryOp.LtI64:case n.BinaryOp.LtF32:case n.BinaryOp.LtF64:return this.decompileExpression(n.getBinaryLeft(e)),this.push(" < "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.LtU32:return this.push(""),this.decompileExpression(n.getBinaryLeft(e)),this.push(" < "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.LeI32:case n.BinaryOp.LeI64:case n.BinaryOp.LeF32:case n.BinaryOp.LeF64:return this.decompileExpression(n.getBinaryLeft(e)),this.push(" <= "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.LeU32:return this.push(""),this.decompileExpression(n.getBinaryLeft(e)),this.push(" <= "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.GtI32:case n.BinaryOp.GtI64:case n.BinaryOp.GtF32:case n.BinaryOp.GtF64:return this.decompileExpression(n.getBinaryLeft(e)),this.push(" > "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.GtU32:return this.push(""),this.decompileExpression(n.getBinaryLeft(e)),this.push(" > "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.GeI32:case n.BinaryOp.GeI64:case n.BinaryOp.GeF32:case n.BinaryOp.GeF64:return this.decompileExpression(n.getBinaryLeft(e)),this.push(" >= "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.GeU32:return this.push(""),this.decompileExpression(n.getBinaryLeft(e)),this.push(" >= "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.DivU64:return this.push(""),this.decompileExpression(n.getBinaryLeft(e)),this.push(" / "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.RemU64:return this.push(""),this.decompileExpression(n.getBinaryLeft(e)),this.push(" % "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.RotlI64:return this.push("rotl("),this.decompileExpression(n.getBinaryLeft(e)),this.push(", "),this.decompileExpression(n.getBinaryRight(e)),void this.push(")");case n.BinaryOp.RotrI64:return this.push("rotr("),this.decompileExpression(n.getBinaryLeft(e)),this.push(", "),this.decompileExpression(n.getBinaryRight(e)),void this.push(")");case n.BinaryOp.LtU64:return this.push(""),this.decompileExpression(n.getBinaryLeft(e)),this.push(" < "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.LeU64:return this.push(""),this.decompileExpression(n.getBinaryLeft(e)),this.push(" <= "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.GtU64:return this.push(""),this.decompileExpression(n.getBinaryLeft(e)),this.push(" > "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.GeU64:return this.push(""),this.decompileExpression(n.getBinaryLeft(e)),this.push(" >= "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.CopysignF32:return this.push("copysign("),this.decompileExpression(n.getBinaryLeft(e)),this.push(", "),this.decompileExpression(n.getBinaryRight(e)),void this.push(")");case n.BinaryOp.MinF32:return this.push("min("),this.decompileExpression(n.getBinaryLeft(e)),this.push(", "),this.decompileExpression(n.getBinaryRight(e)),void this.push(")");case n.BinaryOp.MaxF32:return this.push("max("),this.decompileExpression(n.getBinaryLeft(e)),this.push(", "),this.decompileExpression(n.getBinaryRight(e)),void this.push(")");case n.BinaryOp.CopysignF64:return this.push("copysign("),this.decompileExpression(n.getBinaryLeft(e)),this.push(", "),this.decompileExpression(n.getBinaryRight(e)),void this.push(")");case n.BinaryOp.MinF64:return this.push("min("),this.decompileExpression(n.getBinaryLeft(e)),this.push(", "),this.decompileExpression(n.getBinaryRight(e)),void this.push(")");case n.BinaryOp.MaxF64:return this.push("max("),this.decompileExpression(n.getBinaryLeft(e)),this.push(", "),this.decompileExpression(n.getBinaryRight(e)),void this.push(")")}return;case n.ExpressionId.Select:return this.push("select<"),this.push(a(c)),this.push(">("),this.decompileExpression(n.getSelectThen(e)),this.push(", "),this.decompileExpression(n.getSelectElse(e)),this.push(", "),this.decompileExpression(n.getSelectCondition(e)),void this.push(")");case n.ExpressionId.Drop:return this.decompileExpression(n.getDropValue(e)),void this.push(";\n");case n.ExpressionId.Return:return void((r=n.getReturnValue(e))?(this.push("return "),this.decompileExpression(r),this.push(";\n")):this.push("return;\n"));case n.ExpressionId.Host:switch(n.getHostOp(e)){case n.HostOp.CurrentMemory:return void this.push("memory.size()");case n.HostOp.GrowMemory:return this.push("memory.grow("),this.decompileExpression(n.getHostOperand(e,0)),void this.push(")")}break;case n.ExpressionId.Nop:return void this.push(";\n");case n.ExpressionId.Unreachable:return void this.push("unreachable()");case n.ExpressionId.AtomicCmpxchg:case n.ExpressionId.AtomicRMW:case n.ExpressionId.AtomicWait:case n.ExpressionId.AtomicNotify:}throw new Error("not implemented")},e.prototype.push=function(e){this.text.push(e)},e.prototype.finish=function(){var e=this.text.join("");return this.text=[],e},e}();function a(e){switch(e){case n.NativeType.None:return"void";case n.NativeType.I32:return"i32";case n.NativeType.I64:return"i64";case n.NativeType.F32:return"f32";case n.NativeType.F64:return"f64";case n.NativeType.V128:return"v128";case n.NativeType.Unreachable:throw new Error("unreachable type");case n.NativeType.Auto:throw new Error("auto type");default:throw new Error("unexpected type")}}r.Decompiler=i},function(e,r,t){"use strict";var n,i=this&&this.__extends||(n=function(e,r){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)r.hasOwnProperty(t)&&(e[t]=r[t])})(e,r)},function(e,r){function t(){this.constructor=e}n(e,r),e.prototype=null===r?Object.create(r):(t.prototype=r.prototype,new t)}),a=this&&this.__values||function(e){var r="function"==typeof Symbol&&e[Symbol.iterator],t=0;return r?r.call(e):{next:function(){return e&&t>=e.length&&(e=void 0),{value:e&&e[t++],done:!e}}}},s=this&&this.__read||function(e,r){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var n,i,a=t.call(e),s=[];try{for(;(void 0===r||r-- >0)&&!(n=a.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(t=a.return)&&t.call(a)}finally{if(i)throw i.error}}return s};Object.defineProperty(r,"__esModule",{value:!0});var o=t(0),c=t(3),l=t(1),p=function(){function e(e,r){void 0===r&&(r=!1),this.todo=[],this.seen=new Set,this.program=e,this.includePrivate}return e.prototype.walk=function(){var e,r,t,n;try{for(var i=a(this.program.filesByName.values()),s=i.next();!s.done;s=i.next()){var o=s.value.members;if(o)try{for(var c=a(o.values()),l=c.next();!l.done;l=c.next()){var p=l.value;this.visitElement(p)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}}}catch(r){e={error:r}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}for(var u=this.todo;0"),null}for(;e.skip(o.Token.BAR);){if(!e.skip(o.Token.NULL))return t||this.error(c.DiagnosticCode._0_expected,e.range(e.pos),"null"),null;y=!0}n=p.Node.createType(_,d||[],y,e.range(a,e.pos))}for(;e.skip(o.Token.OPENBRACKET);){var f=e.tokenPos;if(!e.skip(o.Token.CLOSEBRACKET))return t||this.error(c.DiagnosticCode._0_expected,e.range(),"]"),null;var E=e.range(f,e.pos);y=!1;if(e.skip(o.Token.BAR)){if(!e.skip(o.Token.NULL))return t||this.error(c.DiagnosticCode._0_expected,e.range(),"null"),null;y=!0}if(n=p.Node.createType(p.Node.createSimpleTypeName("Array",E),[n],y,e.range(a,e.pos)),y)break}return n},r.prototype.tryParseSignature=function(e){var r,t=e.mark(),n=e.tokenPos,i=null,a=null,s=!1;if(e.skip(o.Token.CLOSEPAREN))s=!0,e.discard(t),i=[];else{s=!1;do{var l=p.ParameterKind.DEFAULT;if(e.skip(o.Token.DOT_DOT_DOT)&&(s=!0,e.discard(t),l=p.ParameterKind.REST),e.skip(o.Token.THIS)){if(!e.skip(o.Token.COLON))return e.reset(t),this.tryParseSignatureIsSignature=!1,null;s=!0,e.discard(t);var u=this.parseType(e,!1);if(!u)return null;if(u.kind!=p.NodeKind.TYPE)return this.error(c.DiagnosticCode.Operation_not_supported,u.range),this.tryParseSignatureIsSignature=!0,null;a=u}else{if(!e.skipIdentifier())return s?this.error(c.DiagnosticCode.Identifier_expected,e.range()):e.reset(t),this.tryParseSignatureIsSignature=s,null;var _=p.Node.createIdentifierExpression(e.readIdentifier(),e.range(e.tokenPos,e.pos));if(e.skip(o.Token.QUESTION)&&(s=!0,e.discard(t),l==p.ParameterKind.REST?this.error(c.DiagnosticCode.A_rest_parameter_cannot_be_optional,e.range()):l=p.ParameterKind.OPTIONAL),e.skip(o.Token.COLON)){s=!0,e.discard(t);var h=this.parseType(e);if(!h)return this.tryParseSignatureIsSignature=s,null;var d=new p.ParameterNode;d.parameterKind=l,d.name=_,d.type=h,i?i.push(d):i=[d]}else s&&this.error(c.DiagnosticCode.Type_expected,e.range())}}while(e.skip(o.Token.COMMA));if(!e.skip(o.Token.CLOSEPAREN))return s?this.error(c.DiagnosticCode._0_expected,e.range(),")"):e.reset(t),this.tryParseSignatureIsSignature=s,null}return e.skip(o.Token.EQUALS_GREATERTHAN)?(s=!0,e.discard(t),(r=this.parseType(e))?(this.tryParseSignatureIsSignature=!0,p.Node.createSignature(i||[],r,a,!1,e.range(n,e.pos))):(this.tryParseSignatureIsSignature=s,null)):(s?this.error(c.DiagnosticCode._0_expected,e.range(),"=>"):e.reset(t),this.tryParseSignatureIsSignature=s,null)},r.prototype.parseDecorator=function(e){var r=e.tokenPos;if(e.skipIdentifier()){for(var t=e.readIdentifier(),n=p.Node.createIdentifierExpression(t,e.range(r,e.pos));e.skip(o.Token.DOT);){if(!e.skipIdentifier())return this.error(c.DiagnosticCode.Identifier_expected,e.range()),null;t=e.readIdentifier(),n=p.Node.createPropertyAccessExpression(n,p.Node.createIdentifierExpression(t,e.range()),e.range(r,e.pos))}var i=void 0;if(!e.skip(o.Token.OPENPAREN))return p.Node.createDecorator(n,null,e.range(r,e.pos));if(i=this.parseArguments(e))return p.Node.createDecorator(n,i,e.range(r,e.pos))}else this.error(c.DiagnosticCode.Identifier_expected,e.range());return null},r.prototype.parseVariable=function(e,r,t,n){var i=new Array;do{var a=this.parseVariableDeclaration(e,r,t);if(!a)return null;i.push(a)}while(e.skip(o.Token.COMMA));var s=p.Node.createVariableStatement(i,t,e.range(n,e.pos));return e.skip(o.Token.SEMICOLON),s},r.prototype.parseVariableDeclaration=function(e,r,t){if(!e.skipIdentifier())return this.error(c.DiagnosticCode.Identifier_expected,e.range()),null;var n=p.Node.createIdentifierExpression(e.readIdentifier(),e.range()),i=r;e.skip(o.Token.EXCLAMATION)&&(i|=a.CommonFlags.DEFINITE_ASSIGNMENT);var s=null;e.skip(o.Token.COLON)&&(s=this.parseType(e));var l=null;if(e.skip(o.Token.EQUALS)){if(i&a.CommonFlags.AMBIENT&&this.error(c.DiagnosticCode.Initializers_are_not_allowed_in_ambient_contexts,e.range()),!(l=this.parseExpression(e,2)))return null}else i&a.CommonFlags.CONST?i&a.CommonFlags.AMBIENT||this.error(c.DiagnosticCode._const_declarations_must_be_initialized,n.range):s||this.error(c.DiagnosticCode.Type_expected,e.range(e.pos));var u=o.Range.join(n.range,e.range());return i&a.CommonFlags.DEFINITE_ASSIGNMENT&&l&&this.error(c.DiagnosticCode.A_definite_assignment_assertion_is_not_permitted_in_this_context,u),p.Node.createVariableDeclaration(n,s,l,t,i,u)},r.prototype.parseEnum=function(e,r,t,n){if(e.next()!=o.Token.IDENTIFIER)return this.error(c.DiagnosticCode.Identifier_expected,e.range()),null;var i=p.Node.createIdentifierExpression(e.readIdentifier(),e.range());if(e.next()!=o.Token.OPENBRACE)return this.error(c.DiagnosticCode._0_expected,e.range(),"{"),null;for(var s=new Array;!e.skip(o.Token.CLOSEBRACE);){var l=this.parseEnumValue(e,a.CommonFlags.NONE);if(!l)return null;if(s.push(l),!e.skip(o.Token.COMMA)){if(e.skip(o.Token.CLOSEBRACE))break;return this.error(c.DiagnosticCode._0_expected,e.range(),"}"),null}}var u=p.Node.createEnumDeclaration(i,s,t,r,e.range(n,e.pos));return e.skip(o.Token.SEMICOLON),u},r.prototype.parseEnumValue=function(e,r){if(!e.skipIdentifier())return this.error(c.DiagnosticCode.Identifier_expected,e.range()),null;var t=p.Node.createIdentifierExpression(e.readIdentifier(),e.range()),n=null;return e.skip(o.Token.EQUALS)&&!(n=this.parseExpression(e,2))?null:p.Node.createEnumValueDeclaration(t,n,r,o.Range.join(t.range,e.range()))},r.prototype.parseReturn=function(e){var r=null;if(e.peek(!0)!=o.Token.SEMICOLON&&e.nextToken!=o.Token.CLOSEBRACE&&!e.nextTokenOnNewLine&&!(r=this.parseExpression(e)))return null;var t=p.Node.createReturnStatement(r,e.range());return e.skip(o.Token.SEMICOLON),t},r.prototype.parseTypeParameters=function(e){for(var r=null,t=!1;!e.skip(o.Token.GREATERTHAN);){var n=this.parseTypeParameter(e);if(!n)return null;if(null!==n.defaultType?t=!0:t&&(this.error(c.DiagnosticCode.Required_type_parameters_may_not_follow_optional_type_parameters,n.range),n.defaultType=null),r?r.push(n):r=[n],!e.skip(o.Token.COMMA)){if(e.skip(o.Token.GREATERTHAN))break;return this.error(c.DiagnosticCode._0_expected,e.range(),">"),null}}return r&&r.length||this.error(c.DiagnosticCode.Type_parameter_list_cannot_be_empty,e.range()),r},r.prototype.parseTypeParameter=function(e){if(e.next()==o.Token.IDENTIFIER){var r=p.Node.createIdentifierExpression(e.readIdentifier(),e.range()),t=null;if(e.skip(o.Token.EXTENDS)){if(!(i=this.parseType(e)))return null;if(i.kind!=p.NodeKind.TYPE)return this.error(c.DiagnosticCode.Operation_not_supported,i.range),null;t=i}var n=null;if(e.skip(o.Token.EQUALS)){var i;if(!(i=this.parseType(e)))return null;if(i.kind!=p.NodeKind.TYPE)return this.error(c.DiagnosticCode.Operation_not_supported,i.range),null;n=i}return p.Node.createTypeParameter(r,t,n,o.Range.join(r.range,e.range()))}return this.error(c.DiagnosticCode.Identifier_expected,e.range()),null},r.prototype.parseParameters=function(e,r){void 0===r&&(r=!1);var t=new Array,n=null,i=!1,a=!1,s=null;if(this.parseParametersThis=null,e.skip(o.Token.THIS)){if(!e.skip(o.Token.COLON))return this.error(c.DiagnosticCode._0_expected,e.range(),":"),null;if(!(s=this.parseType(e)))return null;if(s.kind==p.NodeKind.TYPE?this.parseParametersThis=s:this.error(c.DiagnosticCode.Operation_not_supported,s.range),!e.skip(o.Token.COMMA))return e.skip(o.Token.CLOSEPAREN)?t:(this.error(c.DiagnosticCode._0_expected,e.range(),")"),null)}for(;!e.skip(o.Token.CLOSEPAREN);){var l=this.parseParameter(e,r);if(!l)return null;switch(n&&!a&&(this.error(c.DiagnosticCode.A_rest_parameter_must_be_last_in_a_parameter_list,n.name.range),a=!0),l.parameterKind){default:i&&this.error(c.DiagnosticCode.A_required_parameter_cannot_follow_an_optional_parameter,l.name.range);break;case p.ParameterKind.OPTIONAL:i=!0;break;case p.ParameterKind.REST:n=l}if(t.push(l),!e.skip(o.Token.COMMA)){if(e.skip(o.Token.CLOSEPAREN))break;return this.error(c.DiagnosticCode._0_expected,e.range(),")"),null}}return t},r.prototype.parseParameter=function(e,r){void 0===r&&(r=!1);var t=!1,n=!1,i=null,s=a.CommonFlags.NONE;if(r&&(e.skip(o.Token.PUBLIC)?(i=e.range(),s|=a.CommonFlags.PUBLIC):e.skip(o.Token.PROTECTED)?(i=e.range(),s|=a.CommonFlags.PROTECTED):e.skip(o.Token.PRIVATE)&&(i=e.range(),s|=a.CommonFlags.PRIVATE),e.peek()==o.Token.READONLY)){var l=e.mark();e.next(),e.peek()!=o.Token.COLON?(e.discard(l),i||(i=e.range()),s|=a.CommonFlags.READONLY):e.reset(l)}if(e.skip(o.Token.DOT_DOT_DOT)&&(s?this.error(c.DiagnosticCode.A_parameter_property_cannot_be_declared_using_a_rest_parameter,e.range()):i=e.range(),t=!0),e.skipIdentifier()){t||(i=e.range());var u=p.Node.createIdentifierExpression(e.readIdentifier(),e.range()),_=null;if((n=e.skip(o.Token.QUESTION))&&t&&this.error(c.DiagnosticCode.A_rest_parameter_cannot_be_optional,u.range),e.skip(o.Token.COLON)){if(!(_=this.parseType(e)))return null}else _=p.Node.createOmittedType(e.range(e.pos));var h=null;if(e.skip(o.Token.EQUALS)&&(t&&this.error(c.DiagnosticCode.A_rest_parameter_cannot_have_an_initializer,u.range),n?this.error(c.DiagnosticCode.Parameter_cannot_have_question_mark_and_initializer,u.range):n=!0,!(h=this.parseExpression(e,2))))return null;var d=p.Node.createParameter(u,_,h,t?p.ParameterKind.REST:n?p.ParameterKind.OPTIONAL:p.ParameterKind.DEFAULT,o.Range.join(i,e.range()));return d.flags|=s,d}return this.error(c.DiagnosticCode.Identifier_expected,e.range()),null},r.prototype.parseFunction=function(e,r,t,n){if(!e.skipIdentifier())return this.error(c.DiagnosticCode.Identifier_expected,e.range(e.pos)),null;var i=p.Node.createIdentifierExpression(e.readIdentifier(),e.range()),s=-1,l=null;if(e.skip(o.Token.LESSTHAN)){if(s=e.tokenPos,!(l=this.parseTypeParameters(e)))return null;r|=a.CommonFlags.GENERIC}if(!e.skip(o.Token.OPENPAREN))return this.error(c.DiagnosticCode._0_expected,e.range(e.pos),"("),null;s<0&&(s=e.tokenPos);var u=this.parseParameters(e);if(!u)return null;var _=this.parseParametersThis,h=0!=(r&a.CommonFlags.SET);h&&(1!=u.length&&this.error(c.DiagnosticCode.A_set_accessor_must_have_exactly_one_parameter,i.range),u.length&&u[0].initializer&&this.error(c.DiagnosticCode.A_set_accessor_parameter_cannot_have_an_initializer,i.range)),r&a.CommonFlags.GET&&u.length&&this.error(c.DiagnosticCode.A_get_accessor_cannot_have_parameters,i.range);var d=null;if(e.skip(o.Token.COLON)&&!(d=this.parseType(e,!0,h)))return null;d||(d=p.Node.createOmittedType(e.range(e.pos)),h||this.error(c.DiagnosticCode.Type_expected,d.range));var y=p.Node.createSignature(u,d,_,!1,e.range(s,e.pos)),m=null;if(e.skip(o.Token.OPENBRACE)){if(r&a.CommonFlags.AMBIENT&&this.error(c.DiagnosticCode.An_implementation_cannot_be_declared_in_ambient_contexts,e.range()),!(m=this.parseBlockStatement(e,!1)))return null}else r&a.CommonFlags.AMBIENT||this.error(c.DiagnosticCode.Function_implementation_is_missing_or_not_immediately_following_the_declaration,e.range(e.pos));var T=p.Node.createFunctionDeclaration(i,l,y,m,t,r,0,e.range(n,e.pos));return e.skip(o.Token.SEMICOLON),T},r.prototype.parseFunctionExpression=function(e){var r,t=e.tokenPos,n=0;if(e.token==o.Token.FUNCTION){if(r=e.skipIdentifier()?p.Node.createIdentifierExpression(e.readIdentifier(),e.range()):p.Node.createEmptyIdentifierExpression(e.range(e.pos)),!e.skip(o.Token.OPENPAREN))return this.error(c.DiagnosticCode._0_expected,e.range(e.pos),"("),null}else n=1,assert(e.token==o.Token.OPENPAREN),r=p.Node.createEmptyIdentifierExpression(e.range(e.tokenPos));var i=e.pos,a=this.parseParameters(e);return a?this.parseFunctionExpressionCommon(e,r,a,n,t,i):null},r.prototype.parseFunctionExpressionCommon=function(e,r,t,n,i,s){void 0===i&&(i=-1),void 0===s&&(s=-1),i<0&&(i=r.range.start),s<0&&(s=i);var l=null;if(2!=n&&e.skip(o.Token.COLON)){if(!(l=this.parseType(e)))return null}else l=p.Node.createOmittedType(e.range(e.pos));if(n&&!e.skip(o.Token.EQUALS_GREATERTHAN))return this.error(c.DiagnosticCode._0_expected,e.range(e.pos),"=>"),null;var u=p.Node.createSignature(t,l,null,!1,e.range(s,e.pos)),_=null;if(n)if(e.skip(o.Token.OPENBRACE))_=this.parseBlockStatement(e,!1);else{var h=this.parseExpression(e,2);h&&(_=p.Node.createExpressionStatement(h))}else{if(!e.skip(o.Token.OPENBRACE))return this.error(c.DiagnosticCode._0_expected,e.range(e.pos),"{"),null;_=this.parseBlockStatement(e,!1)}if(!_)return null;var d=p.Node.createFunctionDeclaration(r,null,u,_,null,a.CommonFlags.NONE,n,e.range(i,e.pos));return p.Node.createFunctionExpression(d)},r.prototype.parseClassOrInterface=function(e,r,t,n){var i=e.token==o.Token.INTERFACE;if(!e.skipIdentifier())return this.error(c.DiagnosticCode.Identifier_expected,e.range()),null;var s=p.Node.createIdentifierExpression(e.readIdentifier(),e.range()),l=null;if(e.skip(o.Token.LESSTHAN)){if(!(l=this.parseTypeParameters(e)))return null;r|=a.CommonFlags.GENERIC}var u=null;if(e.skip(o.Token.EXTENDS)){var _=this.parseType(e);if(!_)return null;if(_.kind!=p.NodeKind.TYPE)return this.error(c.DiagnosticCode.Operation_not_supported,_.range),null;u=_}var h=null;if(e.skip(o.Token.IMPLEMENTS)){i&&this.error(c.DiagnosticCode.Interface_declaration_cannot_have_implements_clause,e.range());do{var d=this.parseType(e);if(!d)return null;i||(h?h.push(d):h=[d])}while(e.skip(o.Token.COMMA))}if(!e.skip(o.Token.OPENBRACE))return this.error(c.DiagnosticCode._0_expected,e.range(),"{"),null;var y,m=new Array;if(i?(assert(!h),y=p.Node.createInterfaceDeclaration(s,l,u,m,t,r,e.range(n,e.pos))):y=p.Node.createClassDeclaration(s,l,u,h,m,t,r,e.range(n,e.pos)),!e.skip(o.Token.CLOSEBRACE))do{var T=this.parseClassMember(e,y);if(T)m.push(T);else if(this.skipStatement(e),e.skip(o.Token.ENDOFFILE))return this.error(c.DiagnosticCode._0_expected,e.range(),"}"),null}while(!e.skip(o.Token.CLOSEBRACE));return y},r.prototype.parseClassExpression=function(e){var r,t=e.tokenPos;if(r=e.skipIdentifier()?p.Node.createIdentifierExpression(e.readIdentifier(),e.range()):p.Node.createEmptyIdentifierExpression(e.range(e.pos)),!e.skip(o.Token.OPENBRACE))return this.error(c.DiagnosticCode._0_expected,e.range(e.pos),"{"),null;var n=new Array,i=p.Node.createClassDeclaration(r,[],null,null,n,null,a.CommonFlags.NONE,e.range(t,e.pos));if(!e.skip(o.Token.CLOSEBRACE))do{var s=this.parseClassMember(e,i);if(s)n.push(s);else if(this.skipStatement(e),e.skip(o.Token.ENDOFFILE))return this.error(c.DiagnosticCode._0_expected,e.range(),"}"),null}while(!e.skip(o.Token.CLOSEBRACE));return p.Node.createClassExpression(i)},r.prototype.parseClassMember=function(e,r){var t=e.pos,n=r.kind==p.NodeKind.INTERFACEDECLARATION,i=null;if(e.skip(o.Token.AT)){do{var s=this.parseDecorator(e);if(!s)break;i?i.push(s):i=[s]}while(e.skip(o.Token.AT));i&&n&&this.error(c.DiagnosticCode.Decorators_are_not_valid_here,o.Range.join(i[0].range,i[i.length-1].range))}var l=r.flags&a.CommonFlags.AMBIENT;n&&(l|=a.CommonFlags.VIRTUAL);var u=0,_=0;e.skip(o.Token.PUBLIC)?(n&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(),"public"),l|=a.CommonFlags.PUBLIC,u=e.tokenPos,_=e.pos):e.skip(o.Token.PRIVATE)?(n&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(),"private"),l|=a.CommonFlags.PRIVATE,u=e.tokenPos,_=e.pos):e.skip(o.Token.PROTECTED)&&(n&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(),"protected"),l|=a.CommonFlags.PROTECTED,u=e.tokenPos,_=e.pos);var h=0,d=0,y=0,m=0;e.skip(o.Token.STATIC)?(n&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(),"static"),l|=a.CommonFlags.STATIC,h=e.tokenPos,d=e.pos):(l|=a.CommonFlags.INSTANCE,e.skip(o.Token.ABSTRACT)&&(n&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(),"abstract"),l|=a.CommonFlags.ABSTRACT,y=e.tokenPos,m=e.pos),r.flags&a.CommonFlags.GENERIC&&(l|=a.CommonFlags.GENERIC_CONTEXT));var T=0,f=0;e.skip(o.Token.READONLY)&&(l|=a.CommonFlags.READONLY,T=e.tokenPos,f=e.pos);var E,g=e.mark(),v=!1,I=!1,b=!1,x=0,S=0;if(n||(e.skip(o.Token.GET)?e.peek(!0,o.IdentifierHandling.PREFER)!=o.Token.IDENTIFIER||e.nextTokenOnNewLine?e.reset(g):(l|=a.CommonFlags.GET,I=!0,x=e.tokenPos,S=e.pos,l&a.CommonFlags.READONLY&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(T,f),"readonly")):e.skip(o.Token.SET)?e.peek(!0,o.IdentifierHandling.PREFER)!=o.Token.IDENTIFIER||e.nextTokenOnNewLine?e.reset(g):(l|=a.CommonFlags.SET,b=!0,x=e.tokenPos,S=e.pos,l&a.CommonFlags.READONLY&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(T,f),"readonly")):e.skip(o.Token.CONSTRUCTOR)&&(v=!0,(l|=a.CommonFlags.CONSTRUCTOR)&a.CommonFlags.STATIC&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(h,d),"static"),l&a.CommonFlags.ABSTRACT&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(y,m),"abstract"),l&a.CommonFlags.READONLY&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(T,f),"readonly"))),v)E=p.Node.createConstructorExpression(e.range());else{if(!I&&!b&&e.skip(o.Token.OPENBRACKET)){l&a.CommonFlags.PUBLIC?this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(u,_),"public"):l&a.CommonFlags.PROTECTED?this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(u,_),"protected"):l&a.CommonFlags.PRIVATE&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(u,_),"protected"),l&a.CommonFlags.STATIC&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(h,d),"static"),l&a.CommonFlags.ABSTRACT&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(y,m),"abstract"),l&a.CommonFlags.READONLY&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(T,f),"readonly");var A=this.parseIndexSignatureDeclaration(e,i);return A?(e.skip(o.Token.SEMICOLON),A):null}if(!e.skipIdentifier())return this.error(c.DiagnosticCode.Identifier_expected,e.range()),null;E=p.Node.createIdentifierExpression(e.readIdentifier(),e.range())}var N=null;if(e.skip(o.Token.LESSTHAN)){var O=e.tokenPos;if(!(N=this.parseTypeParameters(e)))return null;v?this.error(c.DiagnosticCode.Type_parameters_cannot_appear_on_a_constructor_declaration,e.range(O,e.pos)):I||b?this.error(c.DiagnosticCode.An_accessor_cannot_have_type_parameters,e.range(O,e.pos)):l|=a.CommonFlags.GENERIC}if(e.skip(o.Token.OPENPAREN)){var C=e.tokenPos,k=this.parseParameters(e,v);if(!k)return null;var R=this.parseParametersThis;if(v)for(var L=0,F=k.length;L"),null):null;case o.Token.IDENTIFIER:var f=p.Node.createIdentifierExpression(e.readIdentifier(),e.range(t,e.pos));return e.peek(!0)!=o.Token.EQUALS_GREATERTHAN||e.nextTokenOnNewLine?f:this.parseFunctionExpressionCommon(e,p.Node.createEmptyIdentifierExpression(e.range(t)),[p.Node.createParameter(f,p.Node.createOmittedType(f.range.atEnd),null,p.ParameterKind.DEFAULT,f.range)],2,t);case o.Token.THIS:return p.Node.createThisExpression(e.range(t,e.pos));case o.Token.CONSTRUCTOR:return p.Node.createConstructorExpression(e.range(t,e.pos));case o.Token.SUPER:return e.peek()!=o.Token.DOT&&e.nextToken!=o.Token.OPENPAREN&&this.error(c.DiagnosticCode._super_must_be_followed_by_an_argument_list_or_member_access,e.range()),p.Node.createSuperExpression(e.range(t,e.pos));case o.Token.STRINGLITERAL:return p.Node.createStringLiteralExpression(e.readString(),e.range(t,e.pos));case o.Token.INTEGERLITERAL:return p.Node.createIntegerLiteralExpression(e.readInteger(),e.range(t,e.pos));case o.Token.FLOATLITERAL:return p.Node.createFloatLiteralExpression(e.readFloat(),e.range(t,e.pos));case o.Token.SLASH:var E=e.readRegexpPattern();return e.skip(o.Token.SLASH)?p.Node.createRegexpLiteralExpression(E,e.readRegexpFlags(),e.range(t,e.pos)):(this.error(c.DiagnosticCode._0_expected,e.range(),"/"),null);case o.Token.FUNCTION:return this.parseFunctionExpression(e);case o.Token.CLASS:return this.parseClassExpression(e);default:return r==o.Token.ENDOFFILE?this.error(c.DiagnosticCode.Unexpected_end_of_text,e.range(t)):this.error(c.DiagnosticCode.Expression_expected,e.range()),null}},r.prototype.tryParseTypeArgumentsBeforeArguments=function(e){var r=e.mark();if(!e.skip(o.Token.LESSTHAN))return null;var t=null;do{if(e.peek()===o.Token.GREATERTHAN)break;var n=this.parseType(e,!0,!0);if(!n)return e.reset(r),null;t?t.push(n):t=[n]}while(e.skip(o.Token.COMMA));return e.skip(o.Token.GREATERTHAN)&&e.skip(o.Token.OPENPAREN)?t:(e.reset(r),null)},r.prototype.parseArguments=function(e){for(var r=new Array;!e.skip(o.Token.CLOSEPAREN);){var t=this.parseExpression(e,2);if(!t)return null;if(r.push(t),!e.skip(o.Token.COMMA)){if(e.skip(o.Token.CLOSEPAREN))break;return this.error(c.DiagnosticCode._0_expected,e.range(),")"),null}}return r},r.prototype.parseExpression=function(e,r){void 0===r&&(r=1),assert(0!=r);var t=this.parseExpressionStart(e);if(!t)return null;for(var n,i,a=(t=this.maybeParseCallExpression(e,t)).range.start,s=null;(i=_(n=e.peek()))>=r;){switch(e.next(),n){case o.Token.AS:var l=this.parseType(e);if(!l)return null;t=p.Node.createAssertionExpression(p.AssertionKind.AS,t,l,e.range(a,e.pos));break;case o.Token.EXCLAMATION:t=p.Node.createAssertionExpression(p.AssertionKind.NONNULL,t,null,e.range(a,e.pos));break;case o.Token.INSTANCEOF:var u=this.parseType(e);if(!u)return null;t=p.Node.createInstanceOfExpression(t,u,e.range(a,e.pos));break;case o.Token.OPENBRACKET:if(!(s=this.parseExpression(e)))return null;if(!e.skip(o.Token.CLOSEBRACKET))return this.error(c.DiagnosticCode._0_expected,e.range(),"]"),null;t=p.Node.createElementAccessExpression(t,s,e.range(a,e.pos));break;case o.Token.PLUS_PLUS:case o.Token.MINUS_MINUS:t.kind!=p.NodeKind.IDENTIFIER&&t.kind!=p.NodeKind.ELEMENTACCESS&&t.kind!=p.NodeKind.PROPERTYACCESS&&this.error(c.DiagnosticCode.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access,t.range),t=p.Node.createUnaryPostfixExpression(n,t,e.range(a,e.pos));break;case o.Token.QUESTION:var d=this.parseExpression(e);if(!d)return null;if(!e.skip(o.Token.COLON))return this.error(c.DiagnosticCode._0_expected,e.range(),":"),null;var y=this.parseExpression(e,r>1?2:1);if(!y)return null;t=p.Node.createTernaryExpression(t,d,y,e.range(a,e.pos));break;case o.Token.COMMA:var m=[t];do{if(!(t=this.parseExpression(e,2)))return null;m.push(t)}while(e.skip(o.Token.COMMA));t=p.Node.createCommaExpression(m,e.range(a,e.pos));break;default:if(n==o.Token.DOT){if(e.skipIdentifier())s=p.Node.createIdentifierExpression(e.readIdentifier(),e.range());else if(!(s=this.parseExpression(e,h(n)?i:i+1)))return null;if(s.kind==p.NodeKind.IDENTIFIER)t=p.Node.createPropertyAccessExpression(t,s,e.range(a,e.pos));else{if(s.kind!=p.NodeKind.CALL)return this.error(c.DiagnosticCode.Identifier_expected,s.range),null;if(!(t=this.joinPropertyCall(e,a,t,s)))return null}}else{if(!(s=this.parseExpression(e,h(n)?i:i+1)))return null;t=p.Node.createBinaryExpression(n,t,s,e.range(a,e.pos))}}t=this.maybeParseCallExpression(e,t)}return t},r.prototype.joinPropertyCall=function(e,r,t,n){var i=n.expression;switch(i.kind){case p.NodeKind.IDENTIFIER:n.expression=p.Node.createPropertyAccessExpression(t,i,e.range(r,e.pos));break;case p.NodeKind.CALL:var a=this.joinPropertyCall(e,r,t,i);if(!a)return null;n.expression=a,n.range=e.range(r,e.pos);break;default:return this.error(c.DiagnosticCode.Identifier_expected,n.range),null}return n},r.prototype.maybeParseCallExpression=function(e,r){if(p.nodeIsCallable(r.kind))for(var t=null;e.skip(o.Token.OPENPAREN)||p.nodeIsGenericCallable(r.kind)&&null!==(t=this.tryParseTypeArgumentsBeforeArguments(e));){var n=this.parseArguments(e);if(!n)break;r=p.Node.createCallExpression(r,t,n,e.range(r.range.start,e.pos))}return r},r.prototype.skipStatement=function(e){for(e.peek(!0),e.nextTokenOnNewLine&&e.next();;){var r=e.peek(!0);if(r==o.Token.ENDOFFILE||r==o.Token.SEMICOLON){e.next();break}if(e.nextTokenOnNewLine)break;switch(e.next()){case o.Token.IDENTIFIER:e.readIdentifier();break;case o.Token.STRINGLITERAL:e.readString();break;case o.Token.INTEGERLITERAL:e.readInteger();break;case o.Token.FLOATLITERAL:e.readFloat();break;case o.Token.OPENBRACE:this.skipBlock(e)}}},r.prototype.skipBlock=function(e){var r=1,t=!0;do{switch(e.next()){case o.Token.ENDOFFILE:this.error(c.DiagnosticCode._0_expected,e.range(),"}"),t=!1;break;case o.Token.OPENBRACE:++r;break;case o.Token.CLOSEBRACE:--r||(t=!1);break;case o.Token.IDENTIFIER:e.readIdentifier();break;case o.Token.STRINGLITERAL:e.readString();break;case o.Token.INTEGERLITERAL:e.readInteger();break;case o.Token.FLOATLITERAL:e.readFloat()}}while(t)},r}(c.DiagnosticEmitter);function _(e){switch(e){case o.Token.COMMA:return 1;case o.Token.EQUALS:case o.Token.PLUS_EQUALS:case o.Token.MINUS_EQUALS:case o.Token.ASTERISK_ASTERISK_EQUALS:case o.Token.ASTERISK_EQUALS:case o.Token.SLASH_EQUALS:case o.Token.PERCENT_EQUALS:case o.Token.LESSTHAN_LESSTHAN_EQUALS:case o.Token.GREATERTHAN_GREATERTHAN_EQUALS:case o.Token.GREATERTHAN_GREATERTHAN_GREATERTHAN_EQUALS:case o.Token.AMPERSAND_EQUALS:case o.Token.CARET_EQUALS:case o.Token.BAR_EQUALS:return 4;case o.Token.QUESTION:return 5;case o.Token.BAR_BAR:return 6;case o.Token.AMPERSAND_AMPERSAND:return 7;case o.Token.BAR:return 8;case o.Token.CARET:return 9;case o.Token.AMPERSAND:return 10;case o.Token.EQUALS_EQUALS:case o.Token.EXCLAMATION_EQUALS:case o.Token.EQUALS_EQUALS_EQUALS:case o.Token.EXCLAMATION_EQUALS_EQUALS:return 11;case o.Token.AS:case o.Token.IN:case o.Token.INSTANCEOF:case o.Token.LESSTHAN:case o.Token.GREATERTHAN:case o.Token.LESSTHAN_EQUALS:case o.Token.GREATERTHAN_EQUALS:return 12;case o.Token.LESSTHAN_LESSTHAN:case o.Token.GREATERTHAN_GREATERTHAN:case o.Token.GREATERTHAN_GREATERTHAN_GREATERTHAN:return 13;case o.Token.PLUS:case o.Token.MINUS:return 14;case o.Token.ASTERISK:case o.Token.SLASH:case o.Token.PERCENT:return 15;case o.Token.ASTERISK_ASTERISK:return 16;case o.Token.PLUS_PLUS:case o.Token.MINUS_MINUS:return 18;case o.Token.DOT:case o.Token.NEW:case o.Token.OPENBRACKET:case o.Token.EXCLAMATION:return 20}return 0}function h(e){switch(e){case o.Token.EQUALS:case o.Token.PLUS_EQUALS:case o.Token.MINUS_EQUALS:case o.Token.ASTERISK_ASTERISK_EQUALS:case o.Token.ASTERISK_EQUALS:case o.Token.SLASH_EQUALS:case o.Token.PERCENT_EQUALS:case o.Token.LESSTHAN_LESSTHAN_EQUALS:case o.Token.GREATERTHAN_GREATERTHAN_EQUALS:case o.Token.GREATERTHAN_GREATERTHAN_GREATERTHAN_EQUALS:case o.Token.AMPERSAND_EQUALS:case o.Token.CARET_EQUALS:case o.Token.BAR_EQUALS:case o.Token.QUESTION:case o.Token.ASTERISK_ASTERISK:return!0;default:return!1}}r.Parser=u,function(e){e[e.NONE=0]="NONE",e[e.COMMA=1]="COMMA",e[e.SPREAD=2]="SPREAD",e[e.YIELD=3]="YIELD",e[e.ASSIGNMENT=4]="ASSIGNMENT",e[e.CONDITIONAL=5]="CONDITIONAL",e[e.LOGICAL_OR=6]="LOGICAL_OR",e[e.LOGICAL_AND=7]="LOGICAL_AND",e[e.BITWISE_OR=8]="BITWISE_OR",e[e.BITWISE_XOR=9]="BITWISE_XOR",e[e.BITWISE_AND=10]="BITWISE_AND",e[e.EQUALITY=11]="EQUALITY",e[e.RELATIONAL=12]="RELATIONAL",e[e.SHIFT=13]="SHIFT",e[e.ADDITIVE=14]="ADDITIVE",e[e.MULTIPLICATIVE=15]="MULTIPLICATIVE",e[e.EXPONENTIATED=16]="EXPONENTIATED",e[e.UNARY_PREFIX=17]="UNARY_PREFIX",e[e.UNARY_POSTFIX=18]="UNARY_POSTFIX",e[e.CALL=19]="CALL",e[e.MEMBERACCESS=20]="MEMBERACCESS",e[e.GROUPING=21]="GROUPING"}(r.Precedence||(r.Precedence={}))},function(e,r,t){t(17),e.exports=t(31)},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),t(18),t(20),t(21),t(22);var n=t(4);n.Module.prototype.toText=function(){return binaryen.wrapModule(this.ref).emitStackIR()},n.Module.prototype.toAsmjs=function(){return binaryen.wrapModule(this.ref).emitAsmjs()}},function(e,r,t){(function(e){const r=e.Binaryen||t(19);for(var n in e.binaryen=r,r)(n.startsWith("_Binaryen")||n.startsWith("_Relooper"))&&(e[n]=r[n]);e.__memory_allocate=r._malloc,e.__memory_free=r._free,e.__memory_copy=r._memmove,e.__store=function(e,t){r.HEAPU8[e]=t},e.__load=function(e){return r.HEAPU8[e]}}).call(this,t(8))},function(r,t){r.exports=e},function(e,r,t){(function(e){var r="undefined"!=typeof window&&window||void 0!==e&&e||self;r.ASC_TARGET=0,r.ASC_NO_ASSERT=!1,r.ASC_MEMORY_BASE=0,r.ASC_OPTIMIZE_LEVEL=3,r.ASC_SHRINK_LEVEL=0,r.ASC_FEATURE_MUTABLE_GLOBAL=!1,r.ASC_FEATURE_SIGN_EXTENSION=!1,r.ASC_FEATURE_BULK_MEMORY=!1,r.ASC_FEATURE_SIMD=!1,r.ASC_FEATURE_THREADS=!1;var t=new Float64Array(1),n=new Uint32Array(t.buffer);function i(){Error.captureStackTrace?Error.captureStackTrace(this,i):this.stack=this.name+": "+this.message+"\n"+(new Error).stack}function a(e){this.message=e||"assertion failed",Error.captureStackTrace?Error.captureStackTrace(this,a):this.stack=this.name+": "+this.message+"\n"+(new Error).stack}Object.defineProperties(r.i8=function(e){return e<<24>>24},{MIN_VALUE:{value:-128,writable:!1},MAX_VALUE:{value:127,writable:!1}}),Object.defineProperties(r.i16=function(e){return e<<16>>16},{MIN_VALUE:{value:-32768,writable:!1},MAX_VALUE:{value:32767,writable:!1}}),Object.defineProperties(r.i32=r.isize=function(e){return 0|e},{MIN_VALUE:{value:-2147483648,writable:!1},MAX_VALUE:{value:2147483647,writable:!1}}),Object.defineProperties(r.u8=function(e){return 255&e},{MIN_VALUE:{value:0,writable:!1},MAX_VALUE:{value:255,writable:!1}}),Object.defineProperties(r.u16=function(e){return 65535&e},{MIN_VALUE:{value:0,writable:!1},MAX_VALUE:{value:65535,writable:!1}}),Object.defineProperties(r.u32=r.usize=function(e){return e>>>0},{MIN_VALUE:{value:0,writable:!1},MAX_VALUE:{value:4294967295,writable:!1}}),Object.defineProperties(r.bool=function(e){return!!e},{MIN_VALUE:{value:!1,writable:!1},MAX_VALUE:{value:!0,writable:!1}}),Object.defineProperties(r.f32=function(e){return Math.fround(e)},{EPSILON:{value:Math.fround(1.1920929e-7),writable:!1},MIN_VALUE:{value:Math.fround(1.4012985e-45),writable:!1},MAX_VALUE:{value:Math.fround(3.4028235e38),writable:!1},MIN_NORMAL_VALUE:{value:Math.fround(1.17549435e-38),writable:!1},MIN_SAFE_INTEGER:{value:-16777215,writable:!1},MAX_SAFE_INTEGER:{value:16777215,writable:!1}}),Object.defineProperties(r.f64=function(e){return+e},{EPSILON:{value:2.220446049250313e-16,writable:!1},MIN_VALUE:{value:5e-324,writable:!1},MAX_VALUE:{value:1.7976931348623157e308,writable:!1},MIN_NORMAL_VALUE:{value:2.2250738585072014e-308,writable:!1},MIN_SAFE_INTEGER:{value:-9007199254740991,writable:!1},MAX_SAFE_INTEGER:{value:9007199254740991,writable:!1}}),r.clz=Math.clz32,r.ctz=function(e){var r=Math.clz32(e&-e);return e?31-r:r},r.popcnt=function(e){return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},r.rotl=function(e,r){return e<<(r&=31)|e>>>32-r},r.rotr=function(e,r){return e>>>(r&=31)|e<<32-r},r.abs=Math.abs,r.max=Math.max,r.min=Math.min,r.ceil=Math.ceil,r.floor=Math.floor,r.nearest=function(e){return.5===Math.abs(e-Math.trunc(e))?2*Math.round(.5*e):Math.round(e)},r.select=function(e,r,t){return t?e:r},r.sqrt=Math.sqrt,r.trunc=Math.trunc,r.copysign=function(e,r){return Math.abs(e)*Math.sign(r)},r.bswap=function(e){var r=e>>8&16711935,t=(16711935&e)<<8;return(r=(e=r|t)>>16&65535)|(t=(65535&e)<<16)},r.bswap16=function(e){return e<<8&65280|e>>8&255|4294901760&e},i.prototype=Object.create(Error.prototype),i.prototype.name="UnreachableError",i.prototype.message="unreachable",r.unreachable=function(){throw new i},a.prototype=Object.create(Error.prototype),a.prototype.name="AssertionError",r.assert=function(e,r){if(e)return e;throw new a(r)},r.changetype=function(e){return e},r.parseI32=function(e,r){return 0|parseInt(e,void 0)},String.fromCharCodes=function(e){return String.fromCharCode.apply(String,e)},String.fromCodePoints=function(e){return String.fromCodePoint.apply(String,e)},r.isInteger=Number.isInteger,r.isFloat=function(e){return"number"==typeof e},r.isNullable=function(e){return!0},r.isReference=function(e){return"object"==typeof e||"string"==typeof e},r.isFunction=function(e){return"function"==typeof e},r.isString=function(e){return"string"==typeof e||e instanceof String},r.isArray=Array.isArray,r.isArrayLike=function(e){return e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&Math.trunc(e.length)===e.length},r.isDefined=function(e){return void 0!==e},r.isConstant=function(e){return!1},r.unchecked=function(e){return e},r.fmod=function(e,r){return e%r},r.fmodf=function(e,r){return Math.fround(e%r)},r.JSMath=Math,Object.defineProperties(r.JSMath,{sincos_sin:{value:0,writable:!0},sincos_cos:{value:0,writable:!0},signbit:{value:function(e){return t[0]=e,Boolean(n[1]>>>31&e==e)}},sincos:{value:function(e){this.sincos_sin=Math.sin(e),this.sincos_cos=Math.cos(e)}}}),r.memory=(()=>{var e=new Uint8Array(0),t=0;return{allocate:r.__memory_allocate||function(r){if(!(r>>>=0))return 0;if(t+r>e.length){var n=e;(e=new Uint8Array(Math.max(65536,e.length+r,2*e.length))).set(n)}var i=t;return 7&(t+=r)&&(t=1+(7|t)),i},fill:r.__memory_fill||function(r,t,n){e.fill(t,r,r+n)},free:r.__memory_free||function(e){},copy:r.__memory_copy||function(r,t,n){e.copyWithin(r,t,t+n)},reset:r.__memory_reset||function(){e=new Uint8Array(0),t=0}}})(),r.store=r.__store||function(e,r,t){HEAP[(0|e)+(0|t)]=r},r.load=r.__load||function(e,r){return HEAP[(0|e)+(0|r)]}}).call(this,t(8))},function(e,r,t){(function(e){const r=new Float64Array(1),t=new Float32Array(r.buffer),n=new Int32Array(r.buffer);e.f32_as_i32=function(e){return t[0]=e,n[0]},e.i32_as_f32=function(e){return n[0]=e,t[0]},e.f64_as_i64=function(e){return r[0]=e,i64_new(n[0],n[1])},e.i64_as_f64=function(e){return n[0]=i64_low(e),n[1]=i64_high(e),r[0]}}).call(this,t(8))},function(e,r,t){(function(e){const r=e.Long||t(23);e.i64_zero=r.ZERO,e.i64_one=r.ONE,e.i64_new=function(e,t){return r.fromBits(e,t)},e.i64_low=function(e){return e.low},e.i64_high=function(e){return e.high},e.i64_add=function(e,r){return e.add(r)},e.i64_sub=function(e,r){return e.sub(r)},e.i64_mul=function(e,r){return e.mul(r)},e.i64_div=function(e,r){return e.div(r)},e.i64_div_u=function(e,r){return e.toUnsigned().div(r.toUnsigned()).toSigned()},e.i64_rem=function(e,r){return e.mod(r)},e.i64_rem_u=function(e,r){return e.toUnsigned().mod(r.toUnsigned()).toSigned()},e.i64_and=function(e,r){return e.and(r)},e.i64_or=function(e,r){return e.or(r)},e.i64_xor=function(e,r){return e.xor(r)},e.i64_shl=function(e,r){return e.shl(r)},e.i64_shr=function(e,r){return e.shr(r)},e.i64_shr_u=function(e,r){return e.shru(r)},e.i64_not=function(e){return e.not()},e.i64_eq=function(e,r){return e.eq(r)},e.i64_ne=function(e,r){return e.ne(r)},e.i64_align=function(e,t){assert(t&&0==(t&t-1));var n=r.fromInt(t-1);return e.add(n).and(n.not())},e.i64_is_i8=function(e){return 0===e.high&&e.low>=0&&e.low<=i8.MAX_VALUE||-1===e.high&&e.low>=i8.MIN_VALUE&&e.low<0},e.i64_is_i16=function(e){return 0===e.high&&e.low>=0&&e.low<=i16.MAX_VALUE||-1===e.high&&e.low>=i16.MIN_VALUE&&e.low<0},e.i64_is_i32=function(e){return 0===e.high&&e.low>=0||-1===e.high&&e.low<0},e.i64_is_u8=function(e){return 0===e.high&&e.low>=0&&e.low<=u8.MAX_VALUE},e.i64_is_u16=function(e){return 0===e.high&&e.low>=0&&e.low<=u16.MAX_VALUE},e.i64_is_u32=function(e){return 0===e.high},e.i64_is_bool=function(e){return 0===e.high&&(0===e.low||1===e.low)};const n=r.fromNumber(f32.MIN_SAFE_INTEGER),i=r.fromNumber(f32.MAX_SAFE_INTEGER);e.i64_is_f32=function(e){return e.gte(n)&&e.lte(i)};const a=r.fromNumber(f64.MIN_SAFE_INTEGER),s=r.fromNumber(f64.MAX_SAFE_INTEGER);e.i64_is_f64=function(e){return e.gte(a)&&e.lte(s)},e.i64_to_f32=function(r){return e.Math.fround(r.toNumber())},e.i64_to_f64=function(e){return e.toNumber()},e.i64_to_string=function(e,r){return(r?e.toUnsigned():e).toString(10)}}).call(this,t(8))},function(e,r){e.exports=n;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function n(e,r,t){this.low=0|e,this.high=0|r,this.unsigned=!!t}function i(e){return!0===(e&&e.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=i;var a={},s={};function o(e,r){var t,n,i;return r?(i=0<=(e>>>=0)&&e<256)&&(n=s[e])?n:(t=l(e,(0|e)<0?-1:0,!0),i&&(s[e]=t),t):(i=-128<=(e|=0)&&e<128)&&(n=a[e])?n:(t=l(e,e<0?-1:0,!1),i&&(a[e]=t),t)}function c(e,r){if(isNaN(e))return r?f:T;if(r){if(e<0)return f;if(e>=d)return b}else{if(e<=-y)return x;if(e+1>=y)return I}return e<0?c(-e,r).neg():l(e%h|0,e/h|0,r)}function l(e,r,t){return new n(e,r,t)}n.fromInt=o,n.fromNumber=c,n.fromBits=l;var p=Math.pow;function u(e,r,t){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return T;if("number"==typeof r?(t=r,r=!1):r=!!r,(t=t||10)<2||360)throw Error("interior hyphen");if(0===n)return u(e.substring(1),r,t).neg();for(var i=c(p(t,8)),a=T,s=0;s>>0:this.low},S.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},S.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((a=o).isZero())return l+s;for(;l.length<6;)l="0"+l;s=""+l+s}},S.getHighBits=function(){return this.high},S.getHighBitsUnsigned=function(){return this.high>>>0},S.getLowBits=function(){return this.low},S.getLowBitsUnsigned=function(){return this.low>>>0},S.getNumBitsAbs=function(){if(this.isNegative())return this.eq(x)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,r=31;r>0&&0==(e&1<=0},S.isOdd=function(){return 1==(1&this.low)},S.isEven=function(){return 0==(1&this.low)},S.equals=function(e){return i(e)||(e=_(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},S.eq=S.equals,S.notEquals=function(e){return!this.eq(e)},S.neq=S.notEquals,S.ne=S.notEquals,S.lessThan=function(e){return this.comp(e)<0},S.lt=S.lessThan,S.lessThanOrEqual=function(e){return this.comp(e)<=0},S.lte=S.lessThanOrEqual,S.le=S.lessThanOrEqual,S.greaterThan=function(e){return this.comp(e)>0},S.gt=S.greaterThan,S.greaterThanOrEqual=function(e){return this.comp(e)>=0},S.gte=S.greaterThanOrEqual,S.ge=S.greaterThanOrEqual,S.compare=function(e){if(i(e)||(e=_(e)),this.eq(e))return 0;var r=this.isNegative(),t=e.isNegative();return r&&!t?-1:!r&&t?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},S.comp=S.compare,S.negate=function(){return!this.unsigned&&this.eq(x)?x:this.not().add(E)},S.neg=S.negate,S.add=function(e){i(e)||(e=_(e));var r=this.high>>>16,t=65535&this.high,n=this.low>>>16,a=65535&this.low,s=e.high>>>16,o=65535&e.high,c=e.low>>>16,p=0,u=0,h=0,d=0;return h+=(d+=a+(65535&e.low))>>>16,u+=(h+=n+c)>>>16,p+=(u+=t+o)>>>16,p+=r+s,l((h&=65535)<<16|(d&=65535),(p&=65535)<<16|(u&=65535),this.unsigned)},S.subtract=function(e){return i(e)||(e=_(e)),this.add(e.neg())},S.sub=S.subtract,S.multiply=function(e){if(this.isZero())return T;if(i(e)||(e=_(e)),t)return l(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return T;if(this.eq(x))return e.isOdd()?x:T;if(e.eq(x))return this.isOdd()?x:T;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(m)&&e.lt(m))return c(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,n=65535&this.high,a=this.low>>>16,s=65535&this.low,o=e.high>>>16,p=65535&e.high,u=e.low>>>16,h=65535&e.low,d=0,y=0,f=0,E=0;return f+=(E+=s*h)>>>16,y+=(f+=a*h)>>>16,f&=65535,y+=(f+=s*u)>>>16,d+=(y+=n*h)>>>16,y&=65535,d+=(y+=a*u)>>>16,y&=65535,d+=(y+=s*p)>>>16,d+=r*h+n*u+a*p+s*o,l((f&=65535)<<16|(E&=65535),(d&=65535)<<16|(y&=65535),this.unsigned)},S.mul=S.multiply,S.divide=function(e){if(i(e)||(e=_(e)),e.isZero())throw Error("division by zero");var r,n,a;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?l((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?f:T;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return f;if(e.gt(this.shru(1)))return g;a=f}else{if(this.eq(x))return e.eq(E)||e.eq(v)?x:e.eq(x)?E:(r=this.shr(1).div(e).shl(1)).eq(T)?e.isNegative()?E:v:(n=this.sub(e.mul(r)),a=r.add(n.div(e)));if(e.eq(x))return this.unsigned?f:T;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();a=T}for(n=this;n.gte(e);){r=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var s=Math.ceil(Math.log(r)/Math.LN2),o=s<=48?1:p(2,s-48),u=c(r),h=u.mul(e);h.isNegative()||h.gt(n);)h=(u=c(r-=o,this.unsigned)).mul(e);u.isZero()&&(u=E),a=a.add(u),n=n.sub(h)}return a},S.div=S.divide,S.modulo=function(e){return i(e)||(e=_(e)),t?l((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},S.mod=S.modulo,S.rem=S.modulo,S.not=function(){return l(~this.low,~this.high,this.unsigned)},S.and=function(e){return i(e)||(e=_(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},S.or=function(e){return i(e)||(e=_(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},S.xor=function(e){return i(e)||(e=_(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},S.shiftLeft=function(e){return i(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?l(this.low<>>32-e,this.unsigned):l(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):l(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},S.shr=S.shiftRight,S.shiftRightUnsigned=function(e){if(i(e)&&(e=e.toInt()),0===(e&=63))return this;var r=this.high;return e<32?l(this.low>>>e|r<<32-e,r>>>e,this.unsigned):l(32===e?r:r>>>e-32,0,this.unsigned)},S.shru=S.shiftRightUnsigned,S.shr_u=S.shiftRightUnsigned,S.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},S.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},S.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},S.toBytesLE=function(){var e=this.high,r=this.low;return[255&r,r>>>8&255,r>>>16&255,r>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},S.toBytesBE=function(){var e=this.high,r=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,r>>>24,r>>>16&255,r>>>8&255,255&r]},n.fromBytes=function(e,r,t){return t?n.fromBytesLE(e,r):n.fromBytesBE(e,r)},n.fromBytesLE=function(e,r){return new n(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,r)},n.fromBytesBE=function(e,r){return new n(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],r)}},function(e,r,t){"use strict";var n=this&&this.__values||function(e){var r="function"==typeof Symbol&&e[Symbol.iterator],t=0;return r?r.call(e):{next:function(){return e&&t>=e.length&&(e=void 0),{value:e&&e[t++],done:!e}}}};Object.defineProperty(r,"__esModule",{value:!0});var i,a=t(2),s=t(5),o=t(6),c=t(4),l=t(3),p=t(9),u=t(0),_=t(1);function h(e,r,t,n,u,h,b){void 0===b&&(b=!1);var x=e.module;switch(r.internalName){case i.isInteger:var S=m(e,t,n,h);return e.currentType=o.Type.bool,S?S.is(4)&&!S.is(256)?x.createI32(1):x.createI32(0):x.createUnreachable();case i.isFloat:S=m(e,t,n,h);return e.currentType=o.Type.bool,S?S.is(8)?x.createI32(1):x.createI32(0):x.createUnreachable();case i.isSigned:S=m(e,t,n,h);return e.currentType=o.Type.bool,S?S.is(1)?x.createI32(1):x.createI32(0):x.createUnreachable();case i.isReference:S=m(e,t,n,h);return e.currentType=o.Type.bool,S?S.is(256)?x.createI32(1):x.createI32(0):x.createUnreachable();case i.isString:S=m(e,t,n,h);if(e.currentType=o.Type.bool,!S)return x.createUnreachable();if(F=S.classReference){var A=e.program.stringInstance;if(A&&F.isAssignableTo(A))return x.createI32(1)}return x.createI32(0);case i.isArray:S=m(e,t,n,h);if(e.currentType=o.Type.bool,!S)return x.createUnreachable();if(!(O=S.classReference))return x.createI32(0);var N=O.prototype;return x.createI32(N.extends(e.program.arrayPrototype)?1:0);case i.isArrayLike:var O;S=m(e,t,n,h);return e.currentType=o.Type.bool,S?(O=S.classReference)?x.createI32(O.lookupInSelf("length")&&(O.lookupOverload(l.OperatorKind.INDEXED_GET)||O.lookupOverload(l.OperatorKind.UNCHECKED_INDEXED_GET))?1:0):x.createI32(0):x.createUnreachable();case i.isFunction:S=m(e,t,n,h);return e.currentType=o.Type.bool,S?x.createI32(S.signatureReference?1:0):x.createUnreachable();case i.isNullable:S=m(e,t,n,h);return e.currentType=o.Type.bool,S?x.createI32(S.is(512)?1:0):x.createUnreachable();case i.isDefined:if(e.currentType=o.Type.bool,g(t,h,r)|v(n,1,h,e))return x.createUnreachable();var C=e.resolver.resolveExpression(n[0],e.currentFlow,o.Type.void,p.ReportMode.SWALLOW);return x.createI32(C?1:0);case i.isConstant:if(e.currentType=o.Type.bool,g(t,h,r)|v(n,1,h,e))return x.createUnreachable();var k=e.compileExpressionRetainType(n[0],o.Type.i32,0);return e.currentType=o.Type.bool,x.createI32(c.getExpressionId(k)==c.ExpressionId.Const?1:0);case i.isManaged:if(!e.program.hasGC)return e.currentType=o.Type.bool,x.createI32(0);S=m(e,t,n,h);return e.currentType=o.Type.bool,S?null===(F=S.classReference)||F.hasDecorator(l.DecoratorFlags.UNMANAGED)?x.createI32(0):x.createI32(1):x.createUnreachable();case i.sizeof:if(e.currentType=e.options.usizeType,f(t,h,e)|v(n,0,h,e))return x.createUnreachable();var R=t[0].byteSize,k=void 0;return e.options.isWasm64?u.is(4)&&u.size<=32?(e.currentType=o.Type.u32,k=x.createI32(R)):k=x.createI64(R,0):u.is(4)&&64==u.size?(e.currentType=o.Type.u64,k=x.createI64(R,0)):k=x.createI32(R),k;case i.alignof:if(e.currentType=e.options.usizeType,f(t,h,e)|v(n,0,h,e))return x.createUnreachable();R=t[0].byteSize;assert(_.isPowerOf2(R));var L=ctz(R);k=void 0;return e.options.isWasm64?u.is(4)&&u.size<=32?(e.currentType=o.Type.u32,k=x.createI32(L)):k=x.createI64(L,0):u.is(4)&&64==u.size?(e.currentType=o.Type.u64,k=x.createI64(L,0)):k=x.createI32(L),k;case i.offsetof:if(e.currentType=e.options.usizeType,f(t,h,e)|I(n,0,1,h,e))return x.createUnreachable();var F;if(!(F=t[0].classReference))return e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),x.createUnreachable();var B=void 0;if(n.length){if(n[0].kind!=s.NodeKind.LITERAL||n[0].literalKind!=s.LiteralKind.STRING)return e.error(a.DiagnosticCode.String_literal_expected,n[0].range),x.createUnreachable();var U=n[0].value,D=F.members?F.members.get(U):null;if(!D||D.kind!=l.ElementKind.FIELD)return e.error(a.DiagnosticCode.Type_0_has_no_property_1,n[0].range,F.internalName,U),x.createUnreachable();B=D.memoryOffset}else B=F.currentMemoryOffset;return e.options.isWasm64?u.is(4)&&u.size<=32?(e.currentType=o.Type.u32,x.createI32(B)):x.createI64(B):u.is(4)&&64==u.size?(e.currentType=o.Type.u64,x.createI64(B)):x.createI32(B);case i.clz:case i.ctz:case i.popcnt:if(E(t,h,e,!0)|v(n,1,h,e))return x.createUnreachable();var w=t?e.compileExpression(n[0],t[0],1,1):e.compileExpression(n[0],o.Type.i32,0,1);if((S=e.currentType).is(256))return e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),x.createUnreachable();var P=-1;switch(r.internalName){case i.clz:switch(S.kind){case 10:case 0:case 5:case 1:case 6:case 2:case 7:P=c.UnaryOp.ClzI32;break;case 9:case 4:P=e.options.isWasm64?c.UnaryOp.ClzI64:c.UnaryOp.ClzI32;break;case 3:case 8:P=c.UnaryOp.ClzI64}break;case i.ctz:switch(S.kind){case 10:case 0:case 5:case 1:case 6:case 2:case 7:P=c.UnaryOp.CtzI32;break;case 9:case 4:P=e.options.isWasm64?c.UnaryOp.CtzI64:c.UnaryOp.CtzI32;break;case 3:case 8:P=c.UnaryOp.CtzI64}break;case i.popcnt:switch(e.currentType.kind){case 10:case 0:case 5:case 1:case 6:case 2:case 7:P=c.UnaryOp.PopcntI32;break;case 9:case 4:P=e.options.isWasm64?c.UnaryOp.PopcntI64:c.UnaryOp.PopcntI32;break;case 3:case 8:P=c.UnaryOp.PopcntI64}}return-1==P?(e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),x.createUnreachable()):x.createUnary(P,w);case i.rotl:if(E(t,h,e,!0)|v(n,2,h,e))return x.createUnreachable();w=t?e.compileExpression(n[0],t[0],1,1):e.compileExpression(n[0],o.Type.i32,0,1);if((S=e.currentType).is(256))return e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),x.createUnreachable();var M=e.compileExpression(n[1],S,1,0);k=void 0;switch(S.kind){case 0:case 1:case 5:case 6:case 10:k=e.ensureSmallIntegerWrap(x.createBinary(c.BinaryOp.RotlI32,w,M),S);case 2:case 7:k=x.createBinary(c.BinaryOp.RotlI32,w,M);break;case 9:case 4:k=x.createBinary(e.options.isWasm64?c.BinaryOp.RotlI64:c.BinaryOp.RotlI32,w,M);break;case 3:case 8:k=x.createBinary(c.BinaryOp.RotlI64,w,M);break;default:e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),k=x.createUnreachable()}return k;case i.rotr:if(E(t,h,e,!0)|v(n,2,h,e))return x.createUnreachable();w=t?e.compileExpression(n[0],t[0],1,1):e.compileExpression(n[0],o.Type.i32,0,1);if((S=e.currentType).is(256))return e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),x.createUnreachable();M=e.compileExpression(n[1],S,1,0),k=void 0;switch(S.kind){case 0:case 1:case 5:case 6:case 10:k=e.ensureSmallIntegerWrap(x.createBinary(c.BinaryOp.RotrI32,w,M),S);break;case 2:case 7:k=x.createBinary(c.BinaryOp.RotrI32,w,M);break;case 9:case 4:k=x.createBinary(e.options.isWasm64?c.BinaryOp.RotrI64:c.BinaryOp.RotrI32,w,M);break;case 3:case 8:k=x.createBinary(c.BinaryOp.RotrI64,w,M);break;default:e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),k=x.createUnreachable()}return k;case i.abs:if(E(t,h,e,!0)|v(n,1,h,e))return x.createUnreachable();w=t?e.compileExpression(n[0],t[0],1,1):e.compileExpression(n[0],o.Type.f64,0,1);if((S=e.currentType).is(256))return e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),x.createUnreachable();k=void 0;switch(S.kind){case 0:case 1:case 2:var V=(H=e.currentFlow).getTempLocal(o.Type.i32,!1),G=H.getAndFreeTempLocal(o.Type.i32,!1).index,K=V.index;k=x.createBinary(c.BinaryOp.XorI32,x.createBinary(c.BinaryOp.AddI32,x.createTeeLocal(G,x.createBinary(c.BinaryOp.ShrI32,x.createTeeLocal(K,w),x.createI32(31))),x.createGetLocal(K,c.NativeType.I32)),x.createGetLocal(G,c.NativeType.I32)),H.freeTempLocal(V);break;case 4:var z=e.options,H=e.currentFlow,Y=z.isWasm64;V=H.getTempLocal(z.usizeType,!1),G=H.getAndFreeTempLocal(z.usizeType,!1).index,K=V.index;k=x.createBinary(Y?c.BinaryOp.XorI64:c.BinaryOp.XorI32,x.createBinary(Y?c.BinaryOp.AddI64:c.BinaryOp.AddI32,x.createTeeLocal(G,x.createBinary(Y?c.BinaryOp.ShrI64:c.BinaryOp.ShrI32,x.createTeeLocal(K,w),Y?x.createI64(63):x.createI32(31))),x.createGetLocal(K,z.nativeSizeType)),x.createGetLocal(G,z.nativeSizeType)),H.freeTempLocal(V);break;case 3:V=(H=e.currentFlow).getTempLocal(o.Type.i64,!1),G=H.getAndFreeTempLocal(o.Type.i64,!1).index,K=V.index;k=x.createBinary(c.BinaryOp.XorI64,x.createBinary(c.BinaryOp.AddI64,x.createTeeLocal(G,x.createBinary(c.BinaryOp.ShrI64,x.createTeeLocal(K,w),x.createI64(63))),x.createGetLocal(K,c.NativeType.I64)),x.createGetLocal(G,c.NativeType.I64)),H.freeTempLocal(V);break;case 9:case 5:case 6:case 7:case 8:case 10:k=w;break;case 11:k=x.createUnary(c.UnaryOp.AbsF32,w);break;case 12:k=x.createUnary(c.UnaryOp.AbsF64,w);break;default:e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),k=x.createUnreachable()}return k;case i.max:if(E(t,h,e,!0)|v(n,2,h,e))return x.createUnreachable();w=t?e.compileExpression(n[0],t[0],1,1):e.compileExpression(n[0],o.Type.f64,0,1);if((S=e.currentType).is(256))return e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),x.createUnreachable();M=e.compileExpression(n[1],S,1,1),P=void 0;switch(S.kind){case 0:case 1:case 2:P=c.BinaryOp.GtI32;break;case 5:case 6:case 7:case 10:P=c.BinaryOp.GtU32;break;case 3:P=c.BinaryOp.GtI64;break;case 8:P=c.BinaryOp.GtU64;break;case 4:P=e.options.isWasm64?c.BinaryOp.GtI64:c.BinaryOp.GtI32;break;case 9:P=e.options.isWasm64?c.BinaryOp.GtU64:c.BinaryOp.GtU32;break;case 11:return x.createBinary(c.BinaryOp.MaxF32,w,M);case 12:return x.createBinary(c.BinaryOp.MaxF64,w,M);default:return e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),x.createUnreachable()}H=e.currentFlow;var W=S.toNativeType(),X=H.getTempLocal(S,!0);V=H.getAndFreeTempLocal(S,!0);return H.freeTempLocal(X),x.createSelect(x.createTeeLocal(X.index,w),x.createTeeLocal(V.index,M),x.createBinary(P,x.createGetLocal(X.index,W),x.createGetLocal(V.index,W)));case i.min:if(E(t,h,e,!0)|v(n,2,h,e))return x.createUnreachable();w=t?e.compileExpression(n[0],t[0],1,1):e.compileExpression(n[0],o.Type.f64,0,1);if((S=e.currentType).is(256))return e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),x.createUnreachable();M=e.compileExpression(n[1],S,1,1),P=void 0;switch(S.kind){case 0:case 1:case 2:P=c.BinaryOp.LtI32;break;case 5:case 6:case 7:case 10:P=c.BinaryOp.LtU32;break;case 3:P=c.BinaryOp.LtI64;break;case 8:P=c.BinaryOp.LtU64;break;case 4:P=e.options.isWasm64?c.BinaryOp.LtI64:c.BinaryOp.LtI32;break;case 9:P=e.options.isWasm64?c.BinaryOp.LtU64:c.BinaryOp.LtU32;break;case 11:return x.createBinary(c.BinaryOp.MinF32,w,M);case 12:return x.createBinary(c.BinaryOp.MinF64,w,M);default:return e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),x.createUnreachable()}H=e.currentFlow,W=S.toNativeType(),X=H.getTempLocal(S,!0),V=H.getAndFreeTempLocal(S,!0);return H.freeTempLocal(X),x.createSelect(x.createTeeLocal(X.index,w),x.createTeeLocal(V.index,M),x.createBinary(P,x.createGetLocal(X.index,W),x.createGetLocal(V.index,W)));case i.ceil:case i.floor:if(E(t,h,e,!0)|v(n,1,h,e))return x.createUnreachable();w=t?e.compileExpression(n[0],t[0],1,0):e.compileExpression(n[0],o.Type.f64,0,0);if((S=e.currentType).is(256))return e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),x.createUnreachable();P=void 0;switch(S.kind){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return w;case 11:P=r.internalName==i.ceil?c.UnaryOp.CeilF32:c.UnaryOp.FloorF32;break;case 12:P=r.internalName==i.ceil?c.UnaryOp.CeilF64:c.UnaryOp.FloorF64;break;default:return e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),x.createUnreachable()}return x.createUnary(P,w);case i.copysign:if(E(t,h,e,!0)|v(n,2,h,e))return x.createUnreachable();w=t?e.compileExpression(n[0],t[0],1,0):e.compileExpression(n[0],o.Type.f64,0,0);if((S=e.currentType).is(256))return e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),x.createUnreachable();M=e.compileExpression(n[1],S,1,0),P=void 0;switch(S.kind){case 11:P=c.BinaryOp.CopysignF32;break;case 12:P=c.BinaryOp.CopysignF64;break;default:return e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),x.createUnreachable()}return x.createBinary(P,w,M);case i.nearest:if(E(t,h,e,!0)|v(n,1,h,e))return x.createUnreachable();w=t?e.compileExpression(n[0],t[0],1,0):e.compileExpression(n[0],o.Type.f64,0,0);if((S=e.currentType).is(256))return e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),x.createUnreachable();k=void 0;switch(S.kind){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:k=w;break;case 11:k=x.createUnary(c.UnaryOp.NearestF32,w);break;case 12:k=x.createUnary(c.UnaryOp.NearestF64,w);break;default:e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),k=x.createUnreachable()}return k;case i.reinterpret:if(f(t,h,e,!0)|v(n,1,h,e))return x.createUnreachable();if((S=t[0]).is(256))return e.currentType=S,e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),x.createUnreachable();k=void 0;switch(S.kind){case 2:case 7:w=e.compileExpression(n[0],o.Type.f32,1,0);k=x.createUnary(c.UnaryOp.ReinterpretF32,w);break;case 3:case 8:w=e.compileExpression(n[0],o.Type.f64,1,0);k=x.createUnary(c.UnaryOp.ReinterpretF64,w);break;case 4:case 9:w=e.compileExpression(n[0],e.options.isWasm64?o.Type.f64:o.Type.f32,1,0);k=x.createUnary(e.options.isWasm64?c.UnaryOp.ReinterpretF64:c.UnaryOp.ReinterpretF32,w);break;case 11:w=e.compileExpression(n[0],o.Type.i32,1,0);k=x.createUnary(c.UnaryOp.ReinterpretI32,w);break;case 12:w=e.compileExpression(n[0],o.Type.i64,1,0);k=x.createUnary(c.UnaryOp.ReinterpretI64,w);break;default:e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),k=x.createUnreachable()}return e.currentType=S,k;case i.sqrt:if(E(t,h,e,!0)|v(n,1,h,e))return x.createUnreachable();w=t?e.compileExpression(n[0],t[0],1,0):e.compileExpression(n[0],o.Type.f64,0,0);if((S=e.currentType).is(256))return e.currentType=S,e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),x.createUnreachable();k=void 0;switch(S.kind){case 11:k=x.createUnary(c.UnaryOp.SqrtF32,w);break;case 12:k=x.createUnary(c.UnaryOp.SqrtF64,w);break;default:e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),k=x.createUnreachable()}return k;case i.trunc:if(E(t,h,e,!0)|v(n,1,h,e))return x.createUnreachable();w=t?e.compileExpression(n[0],t[0],1,0):e.compileExpression(n[0],o.Type.f64,0,0);if((S=e.currentType).is(256))return e.error(a.DiagnosticCode.Operation_not_supported,h.range),x.createUnreachable();k=void 0;switch(S.kind){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:k=w;break;case 11:k=x.createUnary(c.UnaryOp.TruncF32,w);break;case 12:k=x.createUnary(c.UnaryOp.TruncF64,w);break;default:e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),k=x.createUnreachable()}return k;case i.load:if(f(t,h,e,!0)|I(n,1,3,h,e))return x.createUnreachable();var q=(S=t[0]).is(4)&&u.is(4)&&u.size>S.size?u:S;w=e.compileExpression(n[0],e.options.usizeType,1,0);if((J=(le=n.length)>=2?T(n[1],e):0)<0)return e.currentType=q,x.createUnreachable();var Q=void 0,j=S.byteSize;if(3==le){if((Q=T(n[2],e))<0)return e.currentType=q,x.createUnreachable();if(Q>j)return e.error(a.DiagnosticCode._0_must_be_a_value_between_1_and_2_inclusive,n[2].range,"Alignment","0",j.toString()),e.currentType=q,x.createUnreachable();if(!_.isPowerOf2(Q))return e.error(a.DiagnosticCode._0_must_be_a_power_of_two,n[2].range,"Alignment"),e.currentType=q,x.createUnreachable()}else Q=j;return e.currentType=q,x.createLoad(S.byteSize,S.is(5),w,q.toNativeType(),J,Q);case i.store:if(e.currentType=o.Type.void,f(t,h,e)|I(n,2,4,h,e))return x.createUnreachable();S=t[0],w=e.compileExpression(n[0],e.options.usizeType,1,0),M=b?e.compileExpression(n[1],u,1,0):e.compileExpression(n[1],S,S.is(4)?0:1,0);var Z=e.currentType;if(S.is(4)&&(!Z.is(4)||Z.size=3?T(n[2],e):0)<0)return e.currentType=o.Type.void,x.createUnreachable();Q=void 0,j=S.byteSize;if(4==n.length){if((Q=T(n[3],e))<0)return e.currentType=o.Type.void,x.createUnreachable();if(Q>j)return e.error(a.DiagnosticCode._0_must_be_a_value_between_1_and_2_inclusive,n[3].range,"Alignment","0",j.toString()),e.currentType=o.Type.void,x.createUnreachable();if(!_.isPowerOf2(Q))return e.error(a.DiagnosticCode._0_must_be_a_power_of_two,n[3].range,"Alignment"),e.currentType=o.Type.void,x.createUnreachable()}else Q=j;return e.currentType=o.Type.void,x.createStore(S.byteSize,w,M,Z.toNativeType(),J,Q);case i.atomic_load:if(!e.options.hasFeature(16))break;if(f(t,h,e,!0)|I(n,1,2,h,e))return x.createUnreachable();q=(S=t[0]).is(4)&&u.is(4)&&u.size>S.size?u:S;if(!S.is(4))return e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),e.currentType=q,x.createUnreachable();w=e.compileExpression(n[0],e.options.usizeType,1,0);return(J=2==n.length?T(n[1],e):0)<0?(e.currentType=q,x.createUnreachable()):(e.currentType=q,x.createAtomicLoad(S.byteSize,w,q.toNativeType(),J));case i.atomic_store:if(!e.options.hasFeature(16))break;if(e.currentType=o.Type.void,f(t,h,e)|I(n,2,3,h,e))return x.createUnreachable();if(!(S=t[0]).is(4)||S.size<8)return e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),x.createUnreachable();w=e.compileExpression(n[0],e.options.usizeType,1,0),M=b?e.compileExpression(n[1],u,1,0):e.compileExpression(n[1],S,S.is(4)?0:1,0),Z=e.currentType;return S.is(4)&&(!Z.is(4)||Z.sizebe?(e.error(a.DiagnosticCode._0_must_be_a_value_between_1_and_2_inclusive,n[1].range,"Lane index","0",be.toString()),x.createUnreachable()):x.createSIMDExtract(P,w,Ne);case i.v128_replace_lane:if(!e.options.hasFeature(8))break;if(f(t,h,e)|v(n,3,h,e))return e.currentType=o.Type.v128,x.createUnreachable();if((S=t[0]).is(256))return e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),e.currentType=o.Type.v128,x.createUnreachable();P=void 0;switch(S.kind){case 0:case 5:P=c.SIMDReplaceOp.ReplaceLaneVecI8x16;break;case 1:case 6:P=c.SIMDReplaceOp.ReplaceLaneVecI16x8;break;case 2:case 7:P=c.SIMDReplaceOp.ReplaceLaneVecI32x4;break;case 3:case 8:P=c.SIMDReplaceOp.ReplaceLaneVecI64x2;break;case 4:case 9:P=e.options.isWasm64?c.SIMDReplaceOp.ReplaceLaneVecI64x2:c.SIMDReplaceOp.ReplaceLaneVecI32x4;break;case 11:P=c.SIMDReplaceOp.ReplaceLaneVecF32x4;break;case 12:P=c.SIMDReplaceOp.ReplaceLaneVecF64x2;break;default:return e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),e.currentType=o.Type.v128,x.createUnreachable()}w=e.compileExpression(n[0],o.Type.v128,1,0),M=x.precomputeExpression(e.compileExpression(n[1],o.Type.u8,1,0));if(c.getExpressionId(M)!=c.ExpressionId.Const)return e.error(a.DiagnosticCode.Expression_must_be_a_compile_time_constant,n[1].range),e.currentType=o.Type.v128,x.createUnreachable();assert(c.getExpressionType(M)==c.NativeType.I32);be=16/S.byteSize-1;if((Ne=c.getConstValueI32(M))<0||Ne>be)return e.error(a.DiagnosticCode._0_must_be_a_value_between_1_and_2_inclusive,n[1].range,"Lane index","0",be.toString()),x.createUnreachable();$=e.compileExpression(n[2],S,1,0);return e.currentType=o.Type.v128,x.createSIMDReplace(P,w,Ne,$);case i.v128_shuffle:if(!e.options.hasFeature(8))break;if(f(t,h,e))return e.currentType=o.Type.v128,x.createUnreachable();if((S=t[0]).is(256))return e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),e.currentType=o.Type.v128,x.createUnreachable();var xe=S.byteSize,Se=16/xe;if(assert(isInteger(Se)&&_.isPowerOf2(Se)),v(n,2+Se,h,e))return e.currentType=o.Type.v128,x.createUnreachable();switch(S.kind){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 11:case 12:break;default:return e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),e.currentType=o.Type.v128,x.createUnreachable()}w=e.compileExpression(n[0],o.Type.v128,1,0),M=e.compileExpression(n[1],o.Type.v128,1,0);var Ae=new Uint8Array(16);for(be=(Se<<1)-1,de=0;debe)return e.error(a.DiagnosticCode._0_must_be_a_value_between_1_and_2_inclusive,Oe.range,"Lane index","0",be.toString()),e.currentType=o.Type.v128,x.createUnreachable();switch(xe){case 1:_.writeI8(Ne,Ae,de);break;case 2:var ke=de<<1,Re=Ne<<1;_.writeI8(Re,Ae,ke),_.writeI8(Re+1,Ae,ke+1);break;case 4:ke=de<<2,Re=Ne<<2;_.writeI8(Re,Ae,ke),_.writeI8(Re+1,Ae,ke+1),_.writeI8(Re+2,Ae,ke+2),_.writeI8(Re+3,Ae,ke+3);break;case 8:ke=de<<3,Re=Ne<<3;_.writeI8(Re,Ae,ke),_.writeI8(Re+1,Ae,ke+1),_.writeI8(Re+2,Ae,ke+2),_.writeI8(Re+3,Ae,ke+3),_.writeI8(Re+4,Ae,ke+4),_.writeI8(Re+5,Ae,ke+5),_.writeI8(Re+6,Ae,ke+6),_.writeI8(Re+7,Ae,ke+7);break;default:assert(!1)}}return e.currentType=o.Type.v128,x.createSIMDShuffle(w,M,Ae);case i.v128_add:case i.v128_sub:case i.v128_mul:case i.v128_div:case i.v128_add_saturate:case i.v128_sub_saturate:case i.v128_min:case i.v128_max:case i.v128_eq:case i.v128_ne:case i.v128_lt:case i.v128_le:case i.v128_gt:case i.v128_ge:if(!e.options.hasFeature(8))break;if(f(t,h,e)|v(n,2,h,e))return e.currentType=o.Type.v128,x.createUnreachable();if((S=t[0]).is(256))return e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),e.currentType=o.Type.v128,x.createUnreachable();P=-1;switch(r.internalName){case i.v128_add:switch(S.kind){case 0:case 5:P=c.BinaryOp.AddVecI8x16;break;case 1:case 6:P=c.BinaryOp.AddVecI16x8;break;case 2:case 7:P=c.BinaryOp.AddVecI32x4;break;case 3:case 8:P=c.BinaryOp.AddVecI64x2;break;case 4:case 9:P=e.options.isWasm64?c.BinaryOp.AddVecI64x2:c.BinaryOp.AddVecI32x4;break;case 11:P=c.BinaryOp.AddVecF32x4;break;case 12:P=c.BinaryOp.AddVecF64x2}break;case i.v128_sub:switch(S.kind){case 0:case 5:P=c.BinaryOp.SubVecI8x16;break;case 1:case 6:P=c.BinaryOp.SubVecI16x8;break;case 2:case 7:P=c.BinaryOp.SubVecI32x4;break;case 3:case 8:P=c.BinaryOp.SubVecI64x2;break;case 4:case 9:P=e.options.isWasm64?c.BinaryOp.SubVecI64x2:c.BinaryOp.SubVecI32x4;break;case 11:P=c.BinaryOp.SubVecF32x4;break;case 12:P=c.BinaryOp.SubVecF64x2}break;case i.v128_mul:switch(S.kind){case 0:case 5:P=c.BinaryOp.MulVecI8x16;break;case 1:case 6:P=c.BinaryOp.MulVecI16x8;break;case 2:case 7:P=c.BinaryOp.MulVecI32x4;break;case 11:P=c.BinaryOp.MulVecF32x4;break;case 12:P=c.BinaryOp.MulVecF64x2;break;case 4:case 9:e.options.isWasm64||(P=c.BinaryOp.MulVecI32x4)}break;case i.v128_div:switch(S.kind){case 11:P=c.BinaryOp.DivVecF32x4;break;case 12:P=c.BinaryOp.DivVecF64x2}break;case i.v128_add_saturate:switch(S.kind){case 0:P=c.BinaryOp.AddSatSVecI8x16;break;case 5:P=c.BinaryOp.AddSatUVecI8x16;break;case 1:P=c.BinaryOp.AddSatSVecI16x8;break;case 6:P=c.BinaryOp.AddSatUVecI16x8}break;case i.v128_sub_saturate:switch(S.kind){case 0:P=c.BinaryOp.SubSatSVecI8x16;break;case 5:P=c.BinaryOp.SubSatUVecI8x16;break;case 1:P=c.BinaryOp.SubSatSVecI16x8;break;case 6:P=c.BinaryOp.SubSatUVecI16x8}break;case i.v128_min:switch(S.kind){case 11:P=c.BinaryOp.MinVecF32x4;break;case 12:P=c.BinaryOp.MinVecF64x2}break;case i.v128_max:switch(S.kind){case 11:P=c.BinaryOp.MaxVecF32x4;break;case 12:P=c.BinaryOp.MaxVecF64x2}break;case i.v128_eq:switch(S.kind){case 0:case 5:P=c.BinaryOp.EqVecI8x16;break;case 1:case 6:P=c.BinaryOp.EqVecI16x8;break;case 2:case 7:P=c.BinaryOp.EqVecI32x4;break;case 11:P=c.BinaryOp.EqVecF32x4;break;case 12:P=c.BinaryOp.EqVecF64x2;break;case 4:case 9:e.options.isWasm64||(P=c.BinaryOp.EqVecI32x4)}break;case i.v128_ne:switch(S.kind){case 0:case 5:P=c.BinaryOp.NeVecI8x16;break;case 1:case 6:P=c.BinaryOp.NeVecI16x8;break;case 2:case 7:P=c.BinaryOp.NeVecI32x4;break;case 11:P=c.BinaryOp.NeVecF32x4;break;case 12:P=c.BinaryOp.NeVecF64x2;break;case 4:case 9:e.options.isWasm64||(P=c.BinaryOp.NeVecI32x4)}break;case i.v128_lt:switch(S.kind){case 0:P=c.BinaryOp.LtSVecI8x16;break;case 5:P=c.BinaryOp.LtUVecI8x16;break;case 1:P=c.BinaryOp.LtSVecI16x8;break;case 6:P=c.BinaryOp.LtUVecI16x8;break;case 2:P=c.BinaryOp.LtSVecI32x4;break;case 7:P=c.BinaryOp.LtUVecI32x4;break;case 11:P=c.BinaryOp.LtVecF32x4;break;case 12:P=c.BinaryOp.LtVecF64x2;break;case 4:case 9:e.options.isWasm64||(P=4==S.kind?c.BinaryOp.LtSVecI32x4:c.BinaryOp.LtUVecI32x4)}break;case i.v128_le:switch(S.kind){case 0:P=c.BinaryOp.LeSVecI8x16;break;case 5:P=c.BinaryOp.LeUVecI8x16;break;case 1:P=c.BinaryOp.LeSVecI16x8;break;case 6:P=c.BinaryOp.LeUVecI16x8;break;case 2:P=c.BinaryOp.LeSVecI32x4;break;case 7:P=c.BinaryOp.LeUVecI32x4;break;case 11:P=c.BinaryOp.LeVecF32x4;break;case 12:P=c.BinaryOp.LeVecF64x2;break;case 4:case 9:e.options.isWasm64||(P=4==S.kind?c.BinaryOp.LeSVecI32x4:c.BinaryOp.LeUVecI32x4)}break;case i.v128_gt:switch(S.kind){case 0:P=c.BinaryOp.GtSVecI8x16;break;case 5:P=c.BinaryOp.GtUVecI8x16;break;case 1:P=c.BinaryOp.GtSVecI16x8;break;case 6:P=c.BinaryOp.GtUVecI16x8;break;case 2:P=c.BinaryOp.GtSVecI32x4;break;case 7:P=c.BinaryOp.GtUVecI32x4;break;case 11:P=c.BinaryOp.GtVecF32x4;break;case 12:P=c.BinaryOp.GtVecF64x2;break;case 4:case 9:e.options.isWasm64||(P=4==S.kind?c.BinaryOp.GtSVecI32x4:c.BinaryOp.GtUVecI32x4)}break;case i.v128_ge:switch(S.kind){case 0:P=c.BinaryOp.GeSVecI8x16;break;case 5:P=c.BinaryOp.GeUVecI8x16;break;case 1:P=c.BinaryOp.GeSVecI16x8;break;case 6:P=c.BinaryOp.GeUVecI16x8;break;case 2:P=c.BinaryOp.GeSVecI32x4;break;case 7:P=c.BinaryOp.GeUVecI32x4;break;case 11:P=c.BinaryOp.GeVecF32x4;break;case 12:P=c.BinaryOp.GeVecF64x2;break;case 4:case 9:e.options.isWasm64||(P=4==S.kind?c.BinaryOp.GeSVecI32x4:c.BinaryOp.GeUVecI32x4)}}if(-1==P)return e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),e.currentType=o.Type.v128,x.createUnreachable();w=e.compileExpression(n[0],o.Type.v128,1,0),M=e.compileExpression(n[1],o.Type.v128,1,0);return e.currentType=o.Type.v128,x.createBinary(P,w,M);case i.v128_neg:case i.v128_abs:case i.v128_sqrt:case i.v128_convert:case i.v128_trunc:if(!e.options.hasFeature(8))break;if(f(t,h,e)|v(n,1,h,e))return e.currentType=o.Type.v128,x.createUnreachable();if((S=t[0]).is(256))return e.error(a.DiagnosticCode.Operation_not_supported,h.range),e.currentType=o.Type.v128,x.createUnreachable();P=-1;switch(r.internalName){case i.v128_neg:switch(S.kind){case 0:case 5:P=c.UnaryOp.NegVecI8x16;break;case 1:case 6:P=c.UnaryOp.NegVecI16x8;break;case 2:case 7:P=c.UnaryOp.NegVecI32x4;break;case 3:case 8:P=c.UnaryOp.NegVecI64x2;break;case 4:case 9:P=e.options.isWasm64?c.UnaryOp.NegVecI64x2:c.UnaryOp.NegVecI32x4;break;case 11:P=c.UnaryOp.NegVecF32x4;break;case 12:P=c.UnaryOp.NegVecF64x2}break;case i.v128_abs:switch(S.kind){case 11:P=c.UnaryOp.AbsVecF32x4;break;case 12:P=c.UnaryOp.AbsVecF64x2}break;case i.v128_sqrt:switch(S.kind){case 11:P=c.UnaryOp.SqrtVecF32x4;break;case 12:P=c.UnaryOp.SqrtVecF64x2}break;case i.v128_convert:switch(S.kind){case 2:P=c.UnaryOp.ConvertSVecI32x4ToVecF32x4;break;case 7:P=c.UnaryOp.ConvertUVecI32x4ToVecF32x4;break;case 3:P=c.UnaryOp.ConvertSVecI64x2ToVecF64x2;break;case 8:P=c.UnaryOp.ConvertUVecI64x2ToVecF64x2}break;case i.v128_trunc:switch(S.kind){case 2:P=c.UnaryOp.TruncSatSVecF32x4ToVecI32x4;break;case 7:P=c.UnaryOp.TruncSatUVecF32x4ToVecI32x4;break;case 3:P=c.UnaryOp.TruncSatSVecF64x2ToVecI64x2;break;case 8:P=c.UnaryOp.TruncSatUVecF64x2ToVecI64x2}}if(-1==P)return e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),e.currentType=o.Type.v128,x.createUnreachable();w=e.compileExpression(n[0],o.Type.v128,1,0);return e.currentType=o.Type.v128,x.createUnary(P,w);case i.v128_shl:case i.v128_shr:if(!e.options.hasFeature(8))break;if(f(t,h,e)|v(n,2,h,e))return e.currentType=o.Type.v128,x.createUnreachable();if((S=t[0]).is(256))return e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),e.currentType=o.Type.v128,x.createUnreachable();P=-1;switch(r.internalName){case i.v128_shl:switch(S.kind){case 0:case 5:P=c.SIMDShiftOp.ShlVecI8x16;break;case 1:case 6:P=c.SIMDShiftOp.ShlVecI16x8;break;case 2:case 7:P=c.SIMDShiftOp.ShlVecI32x4;break;case 3:case 8:P=c.SIMDShiftOp.ShlVecI64x2;break;case 4:case 9:P=e.options.isWasm64?c.SIMDShiftOp.ShlVecI64x2:c.SIMDShiftOp.ShlVecI32x4}break;case i.v128_shr:switch(S.kind){case 0:P=c.SIMDShiftOp.ShrSVecI8x16;break;case 5:P=c.SIMDShiftOp.ShrUVecI8x16;break;case 1:P=c.SIMDShiftOp.ShrSVecI16x8;break;case 6:P=c.SIMDShiftOp.ShrUVecI16x8;break;case 2:P=c.SIMDShiftOp.ShrSVecI32x4;break;case 7:P=c.SIMDShiftOp.ShrUVecI32x4;break;case 3:P=c.SIMDShiftOp.ShrSVecI64x2;break;case 8:P=c.SIMDShiftOp.ShrUVecI64x2;break;case 4:P=e.options.isWasm64?c.SIMDShiftOp.ShrSVecI64x2:c.SIMDShiftOp.ShrSVecI32x4;break;case 9:P=e.options.isWasm64?c.SIMDShiftOp.ShrUVecI64x2:c.SIMDShiftOp.ShrUVecI32x4}}if(-1==P)return e.error(a.DiagnosticCode.Operation_not_supported,h.range),e.currentType=o.Type.v128,x.createUnreachable();w=e.compileExpression(n[0],o.Type.v128,1,0),M=e.compileExpression(n[1],o.Type.i32,1,0);return e.currentType=o.Type.v128,x.createSIMDShift(P,w,M);case i.v128_and:case i.v128_or:case i.v128_xor:if(!e.options.hasFeature(8))break;if(g(t,h,r)|v(n,2,h,e))return e.currentType=o.Type.v128,x.createUnreachable();P=-1;switch(r.internalName){default:assert(!1);case i.v128_and:P=c.BinaryOp.AndVec128;break;case i.v128_or:P=c.BinaryOp.OrVec128;break;case i.v128_xor:P=c.BinaryOp.XorVec128}w=e.compileExpression(n[0],o.Type.v128,1,0),M=e.compileExpression(n[1],o.Type.v128,1,0);return x.createBinary(P,w,M);case i.v128_not:if(!e.options.hasFeature(8))break;if(g(t,h,r)|v(n,1,h,e))return e.currentType=o.Type.v128,x.createUnreachable();w=e.compileExpression(n[0],o.Type.v128,1,0);return x.createUnary(c.UnaryOp.NotVec128,w);case i.v128_bitselect:if(!e.options.hasFeature(8))break;if(g(t,h,r)|v(n,3,h,e))return e.currentType=o.Type.v128,x.createUnreachable();w=e.compileExpression(n[0],o.Type.v128,1,0),M=e.compileExpression(n[1],o.Type.v128,1,0),$=e.compileExpression(n[2],o.Type.v128,1,0);return x.createSIMDBitselect(w,M,$);case i.v128_any_true:case i.v128_all_true:if(!e.options.hasFeature(8))break;if(f(t,h,e)|v(n,1,h,e))return e.currentType=o.Type.bool,x.createUnreachable();if((S=t[0]).is(256))return e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),x.createUnreachable();P=-1;switch(r.internalName){default:assert(!1);case i.v128_any_true:switch(S.kind){case 0:case 5:P=c.UnaryOp.AnyTrueVecI8x16;break;case 1:case 6:P=c.UnaryOp.AnyTrueVecI16x8;break;case 2:case 7:P=c.UnaryOp.AnyTrueVecI32x4;break;case 3:case 8:P=c.UnaryOp.AnyTrueVecI64x2;break;case 4:case 9:P=e.options.isWasm64?c.UnaryOp.AnyTrueVecI64x2:c.UnaryOp.AnyTrueVecI32x4}break;case i.v128_all_true:switch(S.kind){case 0:case 5:P=c.UnaryOp.AllTrueVecI8x16;break;case 1:case 6:P=c.UnaryOp.AllTrueVecI16x8;break;case 2:case 7:P=c.UnaryOp.AllTrueVecI32x4;break;case 3:case 8:P=c.UnaryOp.AllTrueVecI64x2;break;case 4:case 9:P=e.options.isWasm64?c.UnaryOp.AllTrueVecI64x2:c.UnaryOp.AllTrueVecI32x4}}if(-1==P)return e.error(a.DiagnosticCode.Operation_not_supported,h.typeArgumentsRange),e.currentType=o.Type.bool,x.createUnreachable();w=e.compileExpression(n[0],o.Type.v128,1,0);return e.currentType=o.Type.bool,x.createUnary(P,w);case i.iterateRoots:if(g(t,h,r)|v(n,1,h,e))return e.currentType=o.Type.void,x.createUnreachable();k=e.compileExpressionRetainType(n[0],o.Type.u32,0);var Le=(S=e.currentType).signatureReference;return S.is(256)&&Le&&1==Le.parameterTypes.length&&Le.parameterTypes[0]==e.options.usizeType?(e.needsIterateRoots=!0,e.currentType=o.Type.void,x.createCall("~iterateRoots",[k],c.NativeType.None)):(e.error(a.DiagnosticCode.Type_0_is_not_assignable_to_type_1,h.range,S.toString(),"(ref: usize) => void"),e.currentType=o.Type.void,x.createUnreachable())}return(k=function(e,r,t,n){switch(r.internalName){case i.i32_clz:return d(i.clz,e,o.Type.i32,t,o.Type.i32,n);case i.i64_clz:return d(i.clz,e,o.Type.i64,t,o.Type.i64,n);case i.i32_ctz:return d(i.ctz,e,o.Type.i32,t,o.Type.i32,n);case i.i64_ctz:return d(i.ctz,e,o.Type.i64,t,o.Type.i64,n);case i.i32_popcnt:return d(i.popcnt,e,o.Type.i32,t,o.Type.i32,n);case i.i64_popcnt:return d(i.popcnt,e,o.Type.i64,t,o.Type.i64,n);case i.i32_rotl:return d(i.rotl,e,o.Type.i32,t,o.Type.i32,n);case i.i64_rotl:return d(i.rotl,e,o.Type.i64,t,o.Type.i64,n);case i.i32_rotr:return d(i.rotr,e,o.Type.i32,t,o.Type.i32,n);case i.i64_rotr:return d(i.rotr,e,o.Type.i64,t,o.Type.i64,n);case i.f32_abs:return d(i.abs,e,o.Type.f32,t,o.Type.f32,n);case i.f64_abs:return d(i.abs,e,o.Type.f64,t,o.Type.f64,n);case i.f32_max:return d(i.max,e,o.Type.f32,t,o.Type.f32,n);case i.f64_max:return d(i.max,e,o.Type.f64,t,o.Type.f64,n);case i.f32_min:return d(i.min,e,o.Type.f32,t,o.Type.f32,n);case i.f64_min:return d(i.min,e,o.Type.f64,t,o.Type.f64,n);case i.f32_ceil:return d(i.ceil,e,o.Type.f32,t,o.Type.f32,n);case i.f64_ceil:return d(i.ceil,e,o.Type.f64,t,o.Type.f64,n);case i.f32_floor:return d(i.floor,e,o.Type.f32,t,o.Type.f32,n);case i.f64_floor:return d(i.floor,e,o.Type.f64,t,o.Type.f64,n);case i.f32_copysign:return d(i.copysign,e,o.Type.f32,t,o.Type.f32,n);case i.f64_copysign:return d(i.copysign,e,o.Type.f64,t,o.Type.f64,n);case i.f32_nearest:return d(i.nearest,e,o.Type.f32,t,o.Type.f32,n);case i.f64_nearest:return d(i.nearest,e,o.Type.f64,t,o.Type.f64,n);case i.i32_reinterpret_f32:return d(i.reinterpret,e,o.Type.i32,t,o.Type.f32,n);case i.i64_reinterpret_f64:return d(i.reinterpret,e,o.Type.i64,t,o.Type.f64,n);case i.f32_reinterpret_i32:return d(i.reinterpret,e,o.Type.f32,t,o.Type.i32,n);case i.f64_reinterpret_i64:return d(i.reinterpret,e,o.Type.f64,t,o.Type.i64,n);case i.f32_sqrt:return d(i.sqrt,e,o.Type.f32,t,o.Type.f32,n);case i.f64_sqrt:return d(i.sqrt,e,o.Type.f64,t,o.Type.f64,n);case i.f32_trunc:return d(i.trunc,e,o.Type.f32,t,o.Type.f32,n);case i.f64_trunc:return d(i.trunc,e,o.Type.f64,t,o.Type.f64,n);case i.i32_load8_s:return d(i.load,e,o.Type.i8,t,o.Type.i32,n);case i.i32_load8_u:return d(i.load,e,o.Type.u8,t,o.Type.i32,n);case i.i32_load16_s:return d(i.load,e,o.Type.i16,t,o.Type.i32,n);case i.i32_load16_u:return d(i.load,e,o.Type.u16,t,o.Type.i32,n);case i.i32_load:return d(i.load,e,o.Type.i32,t,o.Type.i32,n);case i.i64_load8_s:return d(i.load,e,o.Type.i8,t,o.Type.i64,n);case i.i64_load8_u:return d(i.load,e,o.Type.u8,t,o.Type.i64,n);case i.i64_load16_s:return d(i.load,e,o.Type.i16,t,o.Type.i64,n);case i.i64_load16_u:return d(i.load,e,o.Type.u16,t,o.Type.i64,n);case i.i64_load32_s:return d(i.load,e,o.Type.i32,t,o.Type.i64,n);case i.i64_load32_u:return d(i.load,e,o.Type.u32,t,o.Type.i64,n);case i.i64_load:return d(i.load,e,o.Type.i64,t,o.Type.i64,n);case i.f32_load:return d(i.load,e,o.Type.f32,t,o.Type.f32,n);case i.f64_load:return d(i.load,e,o.Type.f64,t,o.Type.f64,n);case i.i32_store8:return d(i.store,e,o.Type.i8,t,o.Type.i32,n);case i.i32_store16:return d(i.store,e,o.Type.i16,t,o.Type.i32,n);case i.i32_store:return d(i.store,e,o.Type.i32,t,o.Type.i32,n);case i.i64_store8:return d(i.store,e,o.Type.i8,t,o.Type.i64,n);case i.i64_store16:return d(i.store,e,o.Type.i16,t,o.Type.i64,n);case i.i64_store32:return d(i.store,e,o.Type.i32,t,o.Type.i64,n);case i.i64_store:return d(i.store,e,o.Type.i64,t,o.Type.i64,n);case i.f32_store:return d(i.store,e,o.Type.f32,t,o.Type.f32,n);case i.f64_store:return d(i.store,e,o.Type.f64,t,o.Type.f64,n)}if(e.options.hasFeature(16))switch(r.internalName){case i.i32_atomic_load8_u:return d(i.atomic_load,e,o.Type.u8,t,o.Type.i32,n);case i.i32_atomic_load16_u:return d(i.atomic_load,e,o.Type.u16,t,o.Type.i32,n);case i.i32_atomic_load:return d(i.atomic_load,e,o.Type.i32,t,o.Type.i32,n);case i.i64_atomic_load8_u:return d(i.atomic_load,e,o.Type.u8,t,o.Type.i64,n);case i.i64_atomic_load16_u:return d(i.atomic_load,e,o.Type.u16,t,o.Type.i64,n);case i.i64_atomic_load32_u:return d(i.atomic_load,e,o.Type.u32,t,o.Type.i64,n);case i.i64_atomic_load:return d(i.atomic_load,e,o.Type.i64,t,o.Type.i64,n);case i.i32_atomic_store8:return d(i.atomic_store,e,o.Type.u8,t,o.Type.i32,n);case i.i32_atomic_store16:return d(i.atomic_store,e,o.Type.u16,t,o.Type.i32,n);case i.i32_atomic_store:return d(i.atomic_store,e,o.Type.i32,t,o.Type.i32,n);case i.i64_atomic_store8:return d(i.atomic_store,e,o.Type.u8,t,o.Type.i64,n);case i.i64_atomic_store16:return d(i.atomic_store,e,o.Type.u16,t,o.Type.i64,n);case i.i64_atomic_store32:return d(i.atomic_store,e,o.Type.u32,t,o.Type.i64,n);case i.i64_atomic_store:return d(i.atomic_store,e,o.Type.i64,t,o.Type.i64,n);case i.i32_atomic_rmw8_add_u:return d(i.atomic_add,e,o.Type.u8,t,o.Type.i32,n);case i.i32_atomic_rmw16_add_u:return d(i.atomic_add,e,o.Type.u16,t,o.Type.i32,n);case i.i32_atomic_rmw_add:return d(i.atomic_add,e,o.Type.i32,t,o.Type.i32,n);case i.i64_atomic_rmw8_add_u:return d(i.atomic_add,e,o.Type.u8,t,o.Type.i64,n);case i.i64_atomic_rmw16_add_u:return d(i.atomic_add,e,o.Type.u16,t,o.Type.i64,n);case i.i64_atomic_rmw32_add_u:return d(i.atomic_add,e,o.Type.u32,t,o.Type.i64,n);case i.i64_atomic_rmw_add:return d(i.atomic_add,e,o.Type.i64,t,o.Type.i64,n);case i.i32_atomic_rmw8_sub_u:return d(i.atomic_sub,e,o.Type.u8,t,o.Type.i32,n);case i.i32_atomic_rmw16_sub_u:return d(i.atomic_sub,e,o.Type.u16,t,o.Type.i32,n);case i.i32_atomic_rmw_sub:return d(i.atomic_sub,e,o.Type.i32,t,o.Type.i32,n);case i.i64_atomic_rmw8_sub_u:return d(i.atomic_sub,e,o.Type.u8,t,o.Type.i64,n);case i.i64_atomic_rmw16_sub_u:return d(i.atomic_sub,e,o.Type.u16,t,o.Type.i64,n);case i.i64_atomic_rmw32_sub_u:return d(i.atomic_sub,e,o.Type.u32,t,o.Type.i64,n);case i.i64_atomic_rmw_sub:return d(i.atomic_sub,e,o.Type.i64,t,o.Type.i64,n);case i.i32_atomic_rmw8_and_u:return d(i.atomic_and,e,o.Type.u8,t,o.Type.i32,n);case i.i32_atomic_rmw16_and_u:return d(i.atomic_and,e,o.Type.u16,t,o.Type.i32,n);case i.i32_atomic_rmw_and:return d(i.atomic_and,e,o.Type.i32,t,o.Type.i32,n);case i.i64_atomic_rmw8_and_u:return d(i.atomic_and,e,o.Type.u8,t,o.Type.i64,n);case i.i64_atomic_rmw16_and_u:return d(i.atomic_and,e,o.Type.u16,t,o.Type.i64,n);case i.i64_atomic_rmw32_and_u:return d(i.atomic_and,e,o.Type.u32,t,o.Type.i64,n);case i.i64_atomic_rmw_and:return d(i.atomic_and,e,o.Type.i64,t,o.Type.i64,n);case i.i32_atomic_rmw8_or_u:return d(i.atomic_or,e,o.Type.u8,t,o.Type.i32,n);case i.i32_atomic_rmw16_or_u:return d(i.atomic_or,e,o.Type.u16,t,o.Type.i32,n);case i.i32_atomic_rmw_or:return d(i.atomic_or,e,o.Type.i32,t,o.Type.i32,n);case i.i64_atomic_rmw8_or_u:return d(i.atomic_or,e,o.Type.u8,t,o.Type.i64,n);case i.i64_atomic_rmw16_or_u:return d(i.atomic_or,e,o.Type.u16,t,o.Type.i64,n);case i.i64_atomic_rmw32_or_u:return d(i.atomic_or,e,o.Type.u32,t,o.Type.i64,n);case i.i64_atomic_rmw_or:return d(i.atomic_or,e,o.Type.i64,t,o.Type.i64,n);case i.i32_atomic_rmw8_u_xor:return d(i.atomic_xor,e,o.Type.u8,t,o.Type.i32,n);case i.i32_atomic_rmw16_u_xor:return d(i.atomic_xor,e,o.Type.u16,t,o.Type.i32,n);case i.i32_atomic_rmw_xor:return d(i.atomic_xor,e,o.Type.i32,t,o.Type.i32,n);case i.i64_atomic_rmw8_xor_u:return d(i.atomic_xor,e,o.Type.u8,t,o.Type.i64,n);case i.i64_atomic_rmw16_xor_u:return d(i.atomic_xor,e,o.Type.u16,t,o.Type.i64,n);case i.i64_atomic_rmw32_xor_u:return d(i.atomic_xor,e,o.Type.u32,t,o.Type.i64,n);case i.i64_atomic_rmw_xor:return d(i.atomic_xor,e,o.Type.i64,t,o.Type.i64,n);case i.i32_atomic_rmw8_xchg_u:return d(i.atomic_xchg,e,o.Type.u8,t,o.Type.i32,n);case i.i32_atomic_rmw16_xchg_u:return d(i.atomic_xchg,e,o.Type.u16,t,o.Type.i32,n);case i.i32_atomic_rmw_xchg:return d(i.atomic_xchg,e,o.Type.i32,t,o.Type.i32,n);case i.i64_atomic_rmw8_xchg_u:return d(i.atomic_xchg,e,o.Type.u8,t,o.Type.i64,n);case i.i64_atomic_rmw16_xchg_u:return d(i.atomic_xchg,e,o.Type.u16,t,o.Type.i64,n);case i.i64_atomic_rmw32_xchg_u:return d(i.atomic_xchg,e,o.Type.u32,t,o.Type.i64,n);case i.i64_atomic_rmw_xchg:return d(i.atomic_xchg,e,o.Type.i64,t,o.Type.i64,n);case i.i32_atomic_rmw8_cmpxchg_u:return d(i.atomic_cmpxchg,e,o.Type.u8,t,o.Type.i32,n);case i.i32_atomic_rmw16_cmpxchg_u:return d(i.atomic_cmpxchg,e,o.Type.u16,t,o.Type.i32,n);case i.i32_atomic_rmw_cmpxchg:return d(i.atomic_cmpxchg,e,o.Type.i32,t,o.Type.i32,n);case i.i64_atomic_rmw8_cmpxchg_u:return d(i.atomic_cmpxchg,e,o.Type.u8,t,o.Type.i64,n);case i.i64_atomic_rmw16_cmpxchg_u:return d(i.atomic_cmpxchg,e,o.Type.u16,t,o.Type.i64,n);case i.i64_atomic_rmw32_cmpxchg_u:return d(i.atomic_cmpxchg,e,o.Type.u32,t,o.Type.i64,n);case i.i64_atomic_rmw_cmpxchg:return d(i.atomic_cmpxchg,e,o.Type.i64,t,o.Type.i64,n);case i.i32_wait:return d(i.atomic_wait,e,o.Type.i32,t,o.Type.i32,n);case i.i64_wait:return d(i.atomic_wait,e,o.Type.i64,t,o.Type.i32,n)}if(e.options.hasFeature(8))switch(r.internalName){case i.v128_load:return d(i.load,e,o.Type.v128,t,o.Type.v128,n);case i.v128_store:return d(i.store,e,o.Type.v128,t,o.Type.void,n);case i.i8x16_splat:return d(i.v128_splat,e,o.Type.i8,t,o.Type.v128,n);case i.i8x16_extract_lane_s:return d(i.v128_extract_lane,e,o.Type.i8,t,o.Type.i8,n);case i.i8x16_extract_lane_u:return d(i.v128_extract_lane,e,o.Type.u8,t,o.Type.u8,n);case i.i8x16_replace_lane:return d(i.v128_replace_lane,e,o.Type.i8,t,o.Type.v128,n);case i.i8x16_add:return d(i.v128_add,e,o.Type.i8,t,o.Type.v128,n);case i.i8x16_sub:return d(i.v128_sub,e,o.Type.i8,t,o.Type.v128,n);case i.i8x16_mul:return d(i.v128_mul,e,o.Type.i8,t,o.Type.v128,n);case i.i8x16_neg:return d(i.v128_neg,e,o.Type.i8,t,o.Type.v128,n);case i.i8x16_add_saturate_s:return d(i.v128_add_saturate,e,o.Type.i8,t,o.Type.v128,n);case i.i8x16_add_saturate_u:return d(i.v128_add_saturate,e,o.Type.u8,t,o.Type.v128,n);case i.i8x16_sub_saturate_s:return d(i.v128_sub_saturate,e,o.Type.i8,t,o.Type.v128,n);case i.i8x16_sub_saturate_u:return d(i.v128_sub_saturate,e,o.Type.u8,t,o.Type.v128,n);case i.i8x16_shl:return d(i.v128_shl,e,o.Type.i8,t,o.Type.v128,n);case i.i8x16_shr_s:return d(i.v128_shr,e,o.Type.i8,t,o.Type.v128,n);case i.i8x16_shr_u:return d(i.v128_shr,e,o.Type.u8,t,o.Type.v128,n);case i.i8x16_any_true:return d(i.v128_any_true,e,o.Type.i8,t,o.Type.i32,n);case i.i8x16_all_true:return d(i.v128_all_true,e,o.Type.i8,t,o.Type.i32,n);case i.i8x16_eq:return d(i.v128_eq,e,o.Type.i8,t,o.Type.v128,n);case i.i8x16_ne:return d(i.v128_ne,e,o.Type.i8,t,o.Type.v128,n);case i.i8x16_lt_s:return d(i.v128_lt,e,o.Type.i8,t,o.Type.v128,n);case i.i8x16_lt_u:return d(i.v128_lt,e,o.Type.u8,t,o.Type.v128,n);case i.i8x16_le_s:return d(i.v128_le,e,o.Type.i8,t,o.Type.v128,n);case i.i8x16_le_u:return d(i.v128_le,e,o.Type.u8,t,o.Type.v128,n);case i.i8x16_gt_s:return d(i.v128_gt,e,o.Type.i8,t,o.Type.v128,n);case i.i8x16_gt_u:return d(i.v128_gt,e,o.Type.u8,t,o.Type.v128,n);case i.i8x16_ge_s:return d(i.v128_ge,e,o.Type.i8,t,o.Type.v128,n);case i.i8x16_ge_u:return d(i.v128_ge,e,o.Type.u8,t,o.Type.v128,n);case i.i16x8_splat:return d(i.v128_splat,e,o.Type.i16,t,o.Type.v128,n);case i.i16x8_extract_lane_s:return d(i.v128_extract_lane,e,o.Type.i16,t,o.Type.i16,n);case i.i16x8_extract_lane_u:return d(i.v128_extract_lane,e,o.Type.u16,t,o.Type.u16,n);case i.i16x8_replace_lane:return d(i.v128_replace_lane,e,o.Type.i16,t,o.Type.v128,n);case i.i16x8_add:return d(i.v128_add,e,o.Type.i16,t,o.Type.v128,n);case i.i16x8_sub:return d(i.v128_sub,e,o.Type.i16,t,o.Type.v128,n);case i.i16x8_mul:return d(i.v128_mul,e,o.Type.i16,t,o.Type.v128,n);case i.i16x8_neg:return d(i.v128_neg,e,o.Type.i16,t,o.Type.v128,n);case i.i16x8_add_saturate_s:return d(i.v128_add_saturate,e,o.Type.i16,t,o.Type.v128,n);case i.i16x8_add_saturate_u:return d(i.v128_add_saturate,e,o.Type.u16,t,o.Type.v128,n);case i.i16x8_sub_saturate_s:return d(i.v128_sub_saturate,e,o.Type.i16,t,o.Type.v128,n);case i.i16x8_sub_saturate_u:return d(i.v128_sub_saturate,e,o.Type.u16,t,o.Type.v128,n);case i.i16x8_shl:return d(i.v128_shl,e,o.Type.i16,t,o.Type.v128,n);case i.i16x8_shr_s:return d(i.v128_shr,e,o.Type.i16,t,o.Type.v128,n);case i.i16x8_shr_u:return d(i.v128_shr,e,o.Type.u16,t,o.Type.v128,n);case i.i16x8_any_true:return d(i.v128_any_true,e,o.Type.i16,t,o.Type.i32,n);case i.i16x8_all_true:return d(i.v128_all_true,e,o.Type.i16,t,o.Type.i32,n);case i.i16x8_eq:return d(i.v128_eq,e,o.Type.i16,t,o.Type.v128,n);case i.i16x8_ne:return d(i.v128_ne,e,o.Type.i16,t,o.Type.v128,n);case i.i16x8_lt_s:return d(i.v128_lt,e,o.Type.i16,t,o.Type.v128,n);case i.i16x8_lt_u:return d(i.v128_lt,e,o.Type.u16,t,o.Type.v128,n);case i.i16x8_le_s:return d(i.v128_le,e,o.Type.i16,t,o.Type.v128,n);case i.i16x8_le_u:return d(i.v128_le,e,o.Type.u16,t,o.Type.v128,n);case i.i16x8_gt_s:return d(i.v128_gt,e,o.Type.i16,t,o.Type.v128,n);case i.i16x8_gt_u:return d(i.v128_gt,e,o.Type.u16,t,o.Type.v128,n);case i.i16x8_ge_s:return d(i.v128_ge,e,o.Type.i16,t,o.Type.v128,n);case i.i16x8_ge_u:return d(i.v128_ge,e,o.Type.u16,t,o.Type.v128,n);case i.i32x4_splat:return d(i.v128_splat,e,o.Type.i32,t,o.Type.v128,n);case i.i32x4_extract_lane:return d(i.v128_extract_lane,e,o.Type.i32,t,o.Type.i32,n);case i.i32x4_replace_lane:return d(i.v128_replace_lane,e,o.Type.i32,t,o.Type.v128,n);case i.i32x4_add:return d(i.v128_add,e,o.Type.i32,t,o.Type.v128,n);case i.i32x4_sub:return d(i.v128_sub,e,o.Type.i32,t,o.Type.v128,n);case i.i32x4_mul:return d(i.v128_mul,e,o.Type.i32,t,o.Type.v128,n);case i.i32x4_neg:return d(i.v128_neg,e,o.Type.i32,t,o.Type.v128,n);case i.i32x4_shl:return d(i.v128_shl,e,o.Type.i32,t,o.Type.v128,n);case i.i32x4_shr_s:return d(i.v128_shr,e,o.Type.i32,t,o.Type.v128,n);case i.i32x4_shr_u:return d(i.v128_shr,e,o.Type.u32,t,o.Type.v128,n);case i.i32x4_any_true:return d(i.v128_any_true,e,o.Type.i32,t,o.Type.i32,n);case i.i32x4_all_true:return d(i.v128_all_true,e,o.Type.i32,t,o.Type.i32,n);case i.i32x4_eq:return d(i.v128_eq,e,o.Type.i32,t,o.Type.v128,n);case i.i32x4_ne:return d(i.v128_ne,e,o.Type.i32,t,o.Type.v128,n);case i.i32x4_lt_s:return d(i.v128_lt,e,o.Type.i32,t,o.Type.v128,n);case i.i32x4_lt_u:return d(i.v128_lt,e,o.Type.u32,t,o.Type.v128,n);case i.i32x4_le_s:return d(i.v128_le,e,o.Type.i32,t,o.Type.v128,n);case i.i32x4_le_u:return d(i.v128_le,e,o.Type.u32,t,o.Type.v128,n);case i.i32x4_gt_s:return d(i.v128_gt,e,o.Type.i32,t,o.Type.v128,n);case i.i32x4_gt_u:return d(i.v128_gt,e,o.Type.u32,t,o.Type.v128,n);case i.i32x4_ge_s:return d(i.v128_ge,e,o.Type.i32,t,o.Type.v128,n);case i.i32x4_ge_u:return d(i.v128_ge,e,o.Type.u32,t,o.Type.v128,n);case i.i32x4_trunc_s_f32x4_sat:return d(i.v128_trunc,e,o.Type.i32,t,o.Type.v128,n);case i.i32x4_trunc_u_f32x4_sat:return d(i.v128_trunc,e,o.Type.u32,t,o.Type.v128,n);case i.i64x2_splat:return d(i.v128_splat,e,o.Type.i64,t,o.Type.v128,n);case i.i64x2_extract_lane:return d(i.v128_extract_lane,e,o.Type.i64,t,o.Type.i64,n);case i.i64x2_replace_lane:return d(i.v128_replace_lane,e,o.Type.i64,t,o.Type.v128,n);case i.i64x2_add:return d(i.v128_add,e,o.Type.i64,t,o.Type.v128,n);case i.i64x2_sub:return d(i.v128_sub,e,o.Type.i64,t,o.Type.v128,n);case i.i64x2_neg:return d(i.v128_neg,e,o.Type.i64,t,o.Type.v128,n);case i.i64x2_shl:return d(i.v128_shl,e,o.Type.i64,t,o.Type.v128,n);case i.i64x2_shr_s:return d(i.v128_shr,e,o.Type.i64,t,o.Type.v128,n);case i.i64x2_shr_u:return d(i.v128_shr,e,o.Type.u64,t,o.Type.v128,n);case i.i64x2_any_true:return d(i.v128_any_true,e,o.Type.i64,t,o.Type.i32,n);case i.i64x2_all_true:return d(i.v128_all_true,e,o.Type.i64,t,o.Type.i32,n);case i.i64x2_trunc_s_f64x2_sat:return d(i.v128_trunc,e,o.Type.i64,t,o.Type.v128,n);case i.i64x2_trunc_u_f64x2_sat:return d(i.v128_trunc,e,o.Type.u64,t,o.Type.v128,n);case i.f32x4_splat:return d(i.v128_splat,e,o.Type.f32,t,o.Type.v128,n);case i.f32x4_extract_lane:return d(i.v128_extract_lane,e,o.Type.f32,t,o.Type.f32,n);case i.f32x4_replace_lane:return d(i.v128_replace_lane,e,o.Type.f32,t,o.Type.v128,n);case i.f32x4_add:return d(i.v128_add,e,o.Type.f32,t,o.Type.v128,n);case i.f32x4_sub:return d(i.v128_sub,e,o.Type.f32,t,o.Type.v128,n);case i.f32x4_mul:return d(i.v128_mul,e,o.Type.f32,t,o.Type.v128,n);case i.f32x4_div:return d(i.v128_div,e,o.Type.f32,t,o.Type.v128,n);case i.f32x4_neg:return d(i.v128_neg,e,o.Type.f32,t,o.Type.v128,n);case i.f32x4_min:return d(i.v128_min,e,o.Type.f32,t,o.Type.v128,n);case i.f32x4_max:return d(i.v128_max,e,o.Type.f32,t,o.Type.v128,n);case i.f32x4_abs:return d(i.v128_abs,e,o.Type.f32,t,o.Type.v128,n);case i.f32x4_sqrt:return d(i.v128_sqrt,e,o.Type.f32,t,o.Type.v128,n);case i.f32x4_eq:return d(i.v128_eq,e,o.Type.f32,t,o.Type.v128,n);case i.f32x4_ne:return d(i.v128_ne,e,o.Type.f32,t,o.Type.v128,n);case i.f32x4_lt:return d(i.v128_lt,e,o.Type.f32,t,o.Type.v128,n);case i.f32x4_le:return d(i.v128_le,e,o.Type.f32,t,o.Type.v128,n);case i.f32x4_gt:return d(i.v128_gt,e,o.Type.f32,t,o.Type.v128,n);case i.f32x4_ge:return d(i.v128_ge,e,o.Type.f32,t,o.Type.v128,n);case i.f32x4_convert_s_i32x4:return d(i.v128_convert,e,o.Type.i32,t,o.Type.v128,n);case i.f32x4_convert_u_i32x4:return d(i.v128_convert,e,o.Type.u32,t,o.Type.v128,n);case i.f64x2_splat:return d(i.v128_splat,e,o.Type.f64,t,o.Type.v128,n);case i.f64x2_extract_lane:return d(i.v128_extract_lane,e,o.Type.f64,t,o.Type.f64,n);case i.f64x2_replace_lane:return d(i.v128_replace_lane,e,o.Type.f64,t,o.Type.v128,n);case i.f64x2_add:return d(i.v128_add,e,o.Type.f64,t,o.Type.v128,n);case i.f64x2_sub:return d(i.v128_sub,e,o.Type.f64,t,o.Type.v128,n);case i.f64x2_mul:return d(i.v128_mul,e,o.Type.f64,t,o.Type.v128,n);case i.f64x2_div:return d(i.v128_div,e,o.Type.f64,t,o.Type.v128,n);case i.f64x2_neg:return d(i.v128_neg,e,o.Type.f64,t,o.Type.v128,n);case i.f64x2_min:return d(i.v128_min,e,o.Type.f64,t,o.Type.v128,n);case i.f64x2_max:return d(i.v128_max,e,o.Type.f64,t,o.Type.v128,n);case i.f64x2_abs:return d(i.v128_abs,e,o.Type.f64,t,o.Type.v128,n);case i.f64x2_sqrt:return d(i.v128_sqrt,e,o.Type.f64,t,o.Type.v128,n);case i.f64x2_eq:return d(i.v128_eq,e,o.Type.f64,t,o.Type.v128,n);case i.f64x2_ne:return d(i.v128_ne,e,o.Type.f64,t,o.Type.v128,n);case i.f64x2_lt:return d(i.v128_lt,e,o.Type.f64,t,o.Type.v128,n);case i.f64x2_le:return d(i.v128_le,e,o.Type.f64,t,o.Type.v128,n);case i.f64x2_gt:return d(i.v128_gt,e,o.Type.f64,t,o.Type.v128,n);case i.f64x2_ge:return d(i.v128_ge,e,o.Type.f64,t,o.Type.v128,n);case i.f64x2_convert_s_i64x2:return d(i.v128_convert,e,o.Type.i64,t,o.Type.v128,n);case i.f64x2_convert_u_i64x2:return d(i.v128_convert,e,o.Type.u64,t,o.Type.v128,n);case i.v8x16_shuffle:return d(i.v128_shuffle,e,o.Type.i8,t,o.Type.v128,n)}return 0}(e,r,n,h))?(t&&e.error(a.DiagnosticCode.Type_0_is_not_generic,h.typeArgumentsRange,r.internalName),k):(e.error(a.DiagnosticCode.Cannot_find_name_0,h.expression.range,r.internalName),x.createUnreachable())}function d(e,r,t,n,i,a){assert(r.program.elementsByName.has(e));var s=r.program.elementsByName.get(e);return assert(s.kind==l.ElementKind.FUNCTION_PROTOTYPE),h(r,s,[t],n,i,a,!0)}function y(e,r,t){var n=e.program,i=e.module,a=e.program.stringInstance;if(!a)return i.createUnreachable();var s=n.abortInstance;if(!s||!e.compileFunction(s))return i.createUnreachable();var l=null!=r?e.compileExpression(r,a.type,1,0):a.type.toNativeZero(i),p=e.ensureStaticString(t.range.source.normalizedPath);return e.currentType=o.Type.void,i.createBlock(null,[i.createCall(s.internalName,[l,p,i.createI32(t.range.line),i.createI32(t.range.column)],c.NativeType.None),i.createUnreachable()])}function m(e,r,t,n){if(0==t.length)return r&&1==r.length?r[0]:(e.error(a.DiagnosticCode.Expected_0_type_arguments_but_got_1,n.typeArgumentsRange,"1",r?r.length.toString(10):"0"),null);if(1==t.length){if(r)if(1==r.length)e.compileExpression(t[0],r[0],1,0);else{if(r.length)return e.error(a.DiagnosticCode.Expected_0_type_arguments_but_got_1,n.typeArgumentsRange,"1",r.length.toString(10)),null;e.compileExpressionRetainType(t[0],o.Type.i32,0)}else e.compileExpressionRetainType(t[0],o.Type.i32,0);return e.currentType}return r&&r.length>1&&e.error(a.DiagnosticCode.Expected_0_type_arguments_but_got_1,n.typeArgumentsRange,"1",r.length.toString(10)),e.error(a.DiagnosticCode.Expected_0_arguments_but_got_1,n.argumentsRange,"1",t.length.toString(10)),null}function T(e,r){var t,n;return r.options.isWasm64?(t=r.precomputeExpression(e,o.Type.usize64,1,0),(c.getExpressionId(t)!=c.ExpressionId.Const||c.getExpressionType(t)!=c.NativeType.I64||0!=c.getConstValueI64High(t)||(n=c.getConstValueI64Low(t))<0)&&(r.error(a.DiagnosticCode.Expression_must_be_a_compile_time_constant,e.range),n=-1)):(t=r.precomputeExpression(e,o.Type.usize32,1,0),(c.getExpressionId(t)!=c.ExpressionId.Const||c.getExpressionType(t)!=c.NativeType.I32||(n=c.getConstValueI32(t))<0)&&(r.error(a.DiagnosticCode.Expression_must_be_a_compile_time_constant,e.range),n=-1)),n}function f(e,r,t,n){if(void 0===n&&(n=!1),e){var i=e.length;if(1==i)return 0;assert(i),n&&(t.currentType=e[0]),t.error(a.DiagnosticCode.Expected_0_type_arguments_but_got_1,r.typeArgumentsRange,"1",i.toString())}else t.error(a.DiagnosticCode.Expected_0_type_arguments_but_got_1,r.range,"1","0");return 1}function E(e,r,t,n){if(void 0===n&&(n=!1),e){var i=e.length;return 1==i?0:(assert(i),n&&(t.currentType=e[0]),t.error(a.DiagnosticCode.Expected_0_type_arguments_but_got_1,r.typeArgumentsRange,"1",i.toString()),1)}return 0}function g(e,r,t){return e?(t.program.error(a.DiagnosticCode.Type_0_is_not_generic,r.typeArgumentsRange,t.internalName),1):0}function v(e,r,t,n){return e.length!=r?(n.error(a.DiagnosticCode.Expected_0_arguments_but_got_1,t.range,r.toString(),e.length.toString()),1):0}function I(e,r,t,n,i){var s=e.length;return st?(i.error(a.DiagnosticCode.Expected_0_arguments_but_got_1,n.range,t.toString(),s.toString()),1):0}!function(e){e.isInteger="~lib/builtins/isInteger",e.isFloat="~lib/builtins/isFloat",e.isSigned="~lib/builtins/isSigned",e.isReference="~lib/builtins/isReference",e.isString="~lib/builtins/isString",e.isArray="~lib/builtins/isArray",e.isArrayLike="~lib/builtins/isArrayLike",e.isFunction="~lib/builtins/isFunction",e.isNullable="~lib/builtins/isNullable",e.isDefined="~lib/builtins/isDefined",e.isConstant="~lib/builtins/isConstant",e.isManaged="~lib/builtins/isManaged",e.clz="~lib/builtins/clz",e.ctz="~lib/builtins/ctz",e.popcnt="~lib/builtins/popcnt",e.rotl="~lib/builtins/rotl",e.rotr="~lib/builtins/rotr",e.abs="~lib/builtins/abs",e.max="~lib/builtins/max",e.min="~lib/builtins/min",e.ceil="~lib/builtins/ceil",e.floor="~lib/builtins/floor",e.copysign="~lib/builtins/copysign",e.nearest="~lib/builtins/nearest",e.reinterpret="~lib/builtins/reinterpret",e.sqrt="~lib/builtins/sqrt",e.trunc="~lib/builtins/trunc",e.load="~lib/builtins/load",e.store="~lib/builtins/store",e.atomic_load="~lib/builtins/atomic.load",e.atomic_store="~lib/builtins/atomic.store",e.atomic_add="~lib/builtins/atomic.add",e.atomic_sub="~lib/builtins/atomic.sub",e.atomic_and="~lib/builtins/atomic.and",e.atomic_or="~lib/builtins/atomic.or",e.atomic_xor="~lib/builtins/atomic.xor",e.atomic_xchg="~lib/builtins/atomic.xchg",e.atomic_cmpxchg="~lib/builtins/atomic.cmpxchg",e.atomic_wait="~lib/builtins/atomic.wait",e.atomic_notify="~lib/builtins/atomic.notify",e.sizeof="~lib/builtins/sizeof",e.alignof="~lib/builtins/alignof",e.offsetof="~lib/builtins/offsetof",e.select="~lib/builtins/select",e.unreachable="~lib/builtins/unreachable",e.changetype="~lib/builtins/changetype",e.assert="~lib/builtins/assert",e.unchecked="~lib/builtins/unchecked",e.call_indirect="~lib/builtins/call_indirect",e.instantiate="~lib/builtins/instantiate",e.i8="~lib/builtins/i8",e.i16="~lib/builtins/i16",e.i32="~lib/builtins/i32",e.i64="~lib/builtins/i64",e.isize="~lib/builtins/isize",e.u8="~lib/builtins/u8",e.u16="~lib/builtins/u16",e.u32="~lib/builtins/u32",e.u64="~lib/builtins/u64",e.usize="~lib/builtins/usize",e.bool="~lib/builtins/bool",e.f32="~lib/builtins/f32",e.f64="~lib/builtins/f64",e.v128="~lib/builtins/v128",e.void_="~lib/builtins/void",e.i32_clz="~lib/builtins/i32.clz",e.i64_clz="~lib/builtins/i64.clz",e.i32_ctz="~lib/builtins/i32.ctz",e.i64_ctz="~lib/builtins/i64.ctz",e.i32_popcnt="~lib/builtins/i32.popcnt",e.i64_popcnt="~lib/builtins/i64.popcnt",e.i32_rotl="~lib/builtins/i32.rotl",e.i64_rotl="~lib/builtins/i64.rotl",e.i32_rotr="~lib/builtins/i32.rotr",e.i64_rotr="~lib/builtins/i64.rotr",e.f32_abs="~lib/builtins/f32.abs",e.f64_abs="~lib/builtins/f64.abs",e.f32_max="~lib/builtins/f32.max",e.f64_max="~lib/builtins/f64.max",e.f32_min="~lib/builtins/f32.min",e.f64_min="~lib/builtins/f64.min",e.f32_ceil="~lib/builtins/f32.ceil",e.f64_ceil="~lib/builtins/f64.ceil",e.f32_floor="~lib/builtins/f32.floor",e.f64_floor="~lib/builtins/f64.floor",e.f32_copysign="~lib/builtins/f32.copysign",e.f64_copysign="~lib/builtins/f64.copysign",e.f32_nearest="~lib/builtins/f32.nearest",e.f64_nearest="~lib/builtins/f64.nearest",e.i32_reinterpret_f32="~lib/builtins/i32.reinterpret_f32",e.i64_reinterpret_f64="~lib/builtins/i64.reinterpret_f64",e.f32_reinterpret_i32="~lib/builtins/f32.reinterpret_i32",e.f64_reinterpret_i64="~lib/builtins/f64.reinterpret_i64",e.f32_sqrt="~lib/builtins/f32.sqrt",e.f64_sqrt="~lib/builtins/f64.sqrt",e.f32_trunc="~lib/builtins/f32.trunc",e.f64_trunc="~lib/builtins/f64.trunc",e.i32_load8_s="~lib/builtins/i32.load8_s",e.i32_load8_u="~lib/builtins/i32.load8_u",e.i32_load16_s="~lib/builtins/i32.load16_s",e.i32_load16_u="~lib/builtins/i32.load16_u",e.i32_load="~lib/builtins/i32.load",e.i64_load8_s="~lib/builtins/i64.load8_s",e.i64_load8_u="~lib/builtins/i64.load8_u",e.i64_load16_s="~lib/builtins/i64.load16_s",e.i64_load16_u="~lib/builtins/i64.load16_u",e.i64_load32_s="~lib/builtins/i64.load32_s",e.i64_load32_u="~lib/builtins/i64.load32_u",e.i64_load="~lib/builtins/i64.load",e.f32_load="~lib/builtins/f32.load",e.f64_load="~lib/builtins/f64.load",e.i32_store8="~lib/builtins/i32.store8",e.i32_store16="~lib/builtins/i32.store16",e.i32_store="~lib/builtins/i32.store",e.i64_store8="~lib/builtins/i64.store8",e.i64_store16="~lib/builtins/i64.store16",e.i64_store32="~lib/builtins/i64.store32",e.i64_store="~lib/builtins/i64.store",e.f32_store="~lib/builtins/f32.store",e.f64_store="~lib/builtins/f64.store",e.i32_atomic_load8_u="~lib/builtins/i32.atomic.load8_u",e.i32_atomic_load16_u="~lib/builtins/i32.atomic.load16_u",e.i32_atomic_load="~lib/builtins/i32.atomic.load",e.i64_atomic_load8_u="~lib/builtins/i64.atomic.load8_u",e.i64_atomic_load16_u="~lib/builtins/i64.atomic.load16_u",e.i64_atomic_load32_u="~lib/builtins/i64.atomic.load32_u",e.i64_atomic_load="~lib/builtins/i64.atomic.load",e.i32_atomic_store8="~lib/builtins/i32.atomic.store8",e.i32_atomic_store16="~lib/builtins/i32.atomic.store16",e.i32_atomic_store="~lib/builtins/i32.atomic.store",e.i64_atomic_store8="~lib/builtins/i64.atomic.store8",e.i64_atomic_store16="~lib/builtins/i64.atomic.store16",e.i64_atomic_store32="~lib/builtins/i64.atomic.store32",e.i64_atomic_store="~lib/builtins/i64.atomic.store",e.i32_atomic_rmw8_add_u="~lib/builtins/i32.atomic.rmw8.add_u",e.i32_atomic_rmw16_add_u="~lib/builtins/i32.atomic.rmw16.add_u",e.i32_atomic_rmw_add="~lib/builtins/i32.atomic.rmw.add",e.i64_atomic_rmw8_add_u="~lib/builtins/i64.atomic.rmw8.add_u",e.i64_atomic_rmw16_add_u="~lib/builtins/i64.atomic.rmw16.add_u",e.i64_atomic_rmw32_add_u="~lib/builtins/i64.atomic.rmw32.add_u",e.i64_atomic_rmw_add="~lib/builtins/i64.atomic.rmw.add",e.i32_atomic_rmw8_sub_u="~lib/builtins/i32.atomic.rmw8.sub_u",e.i32_atomic_rmw16_sub_u="~lib/builtins/i32.atomic.rmw16.sub_u",e.i32_atomic_rmw_sub="~lib/builtins/i32.atomic.rmw.sub",e.i64_atomic_rmw8_sub_u="~lib/builtins/i64.atomic.rmw8.sub_u",e.i64_atomic_rmw16_sub_u="~lib/builtins/i64.atomic.rmw16.sub_u",e.i64_atomic_rmw32_sub_u="~lib/builtins/i64.atomic.rmw32.sub_u",e.i64_atomic_rmw_sub="~lib/builtins/i64.atomic.rmw.sub",e.i32_atomic_rmw8_and_u="~lib/builtins/i32.atomic.rmw8.and_u",e.i32_atomic_rmw16_and_u="~lib/builtins/i32.atomic.rmw16.and_u",e.i32_atomic_rmw_and="~lib/builtins/i32.atomic.rmw.and",e.i64_atomic_rmw8_and_u="~lib/builtins/i64.atomic.rmw8.and_u",e.i64_atomic_rmw16_and_u="~lib/builtins/i64.atomic.rmw16.and_u",e.i64_atomic_rmw32_and_u="~lib/builtins/i64.atomic.rmw32.and_u",e.i64_atomic_rmw_and="~lib/builtins/i64.atomic.rmw.and",e.i32_atomic_rmw8_or_u="~lib/builtins/i32.atomic.rmw8.or_u",e.i32_atomic_rmw16_or_u="~lib/builtins/i32.atomic.rmw16.or_u",e.i32_atomic_rmw_or="~lib/builtins/i32.atomic.rmw.or",e.i64_atomic_rmw8_or_u="~lib/builtins/i64.atomic.rmw8.or_u",e.i64_atomic_rmw16_or_u="~lib/builtins/i64.atomic.rmw16.or_u",e.i64_atomic_rmw32_or_u="~lib/builtins/i64.atomic.rmw32.or_u",e.i64_atomic_rmw_or="~lib/builtins/i64.atomic.rmw.or",e.i32_atomic_rmw8_u_xor="~lib/builtins/i32.atomic.rmw8.xor_u",e.i32_atomic_rmw16_u_xor="~lib/builtins/i32.atomic.rmw16.xor_u",e.i32_atomic_rmw_xor="~lib/builtins/i32.atomic.rmw.xor",e.i64_atomic_rmw8_xor_u="~lib/builtins/i64.atomic.rmw8.xor_u",e.i64_atomic_rmw16_xor_u="~lib/builtins/i64.atomic.rmw16.xor_u",e.i64_atomic_rmw32_xor_u="~lib/builtins/i64.atomic.rmw32.xor_u",e.i64_atomic_rmw_xor="~lib/builtins/i64.atomic.rmw.xor",e.i32_atomic_rmw8_xchg_u="~lib/builtins/i32.atomic.rmw8.xchg_u",e.i32_atomic_rmw16_xchg_u="~lib/builtins/i32.atomic.rmw16.xchg_u",e.i32_atomic_rmw_xchg="~lib/builtins/i32.atomic.rmw.xchg",e.i64_atomic_rmw8_xchg_u="~lib/builtins/i64.atomic.rmw8.xchg_u",e.i64_atomic_rmw16_xchg_u="~lib/builtins/i64.atomic.rmw16.xchg_u",e.i64_atomic_rmw32_xchg_u="~lib/builtins/i64.atomic.rmw32.xchg_u",e.i64_atomic_rmw_xchg="~lib/builtins/i64.atomic.rmw.xchg",e.i32_atomic_rmw8_cmpxchg_u="~lib/builtins/i32.atomic.rmw8.cmpxchg_u",e.i32_atomic_rmw16_cmpxchg_u="~lib/builtins/i32.atomic.rmw16.cmpxchg_u",e.i32_atomic_rmw_cmpxchg="~lib/builtins/i32.atomic.rmw.cmpxchg",e.i64_atomic_rmw8_cmpxchg_u="~lib/builtins/i64.atomic.rmw8.cmpxchg_u",e.i64_atomic_rmw16_cmpxchg_u="~lib/builtins/i64.atomic.rmw16.cmpxchg_u",e.i64_atomic_rmw32_cmpxchg_u="~lib/builtins/i64.atomic.rmw32.cmpxchg_u",e.i64_atomic_rmw_cmpxchg="~lib/builtins/i64.atomic.rmw.cmpxchg",e.i32_wait="~lib/builtins/i32.wait",e.i64_wait="~lib/builtins/i64.wait",e.v128_splat="~lib/builtins/v128.splat",e.v128_extract_lane="~lib/builtins/v128.extract_lane",e.v128_replace_lane="~lib/builtins/v128.replace_lane",e.v128_shuffle="~lib/builtins/v128.shuffle",e.v128_load="~lib/builtins/v128.load",e.v128_store="~lib/builtins/v128.store",e.v128_add="~lib/builtins/v128.add",e.v128_sub="~lib/builtins/v128.sub",e.v128_mul="~lib/builtins/v128.mul",e.v128_div="~lib/builtins/v128.div",e.v128_neg="~lib/builtins/v128.neg",e.v128_add_saturate="~lib/builtins/v128.add_saturate",e.v128_sub_saturate="~lib/builtins/v128.sub_saturate",e.v128_shl="~lib/builtins/v128.shl",e.v128_shr="~lib/builtins/v128.shr",e.v128_and="~lib/builtins/v128.and",e.v128_or="~lib/builtins/v128.or",e.v128_xor="~lib/builtins/v128.xor",e.v128_not="~lib/builtins/v128.not",e.v128_bitselect="~lib/builtins/v128.bitselect",e.v128_any_true="~lib/builtins/v128.any_true",e.v128_all_true="~lib/builtins/v128.all_true",e.v128_min="~lib/builtins/v128.min",e.v128_max="~lib/builtins/v128.max",e.v128_abs="~lib/builtins/v128.abs",e.v128_sqrt="~lib/builtins/v128.sqrt",e.v128_eq="~lib/builtins/v128.eq",e.v128_ne="~lib/builtins/v128.ne",e.v128_lt="~lib/builtins/v128.lt",e.v128_le="~lib/builtins/v128.le",e.v128_gt="~lib/builtins/v128.gt",e.v128_ge="~lib/builtins/v128.ge",e.v128_convert="~lib/builtins/v128.convert",e.v128_trunc="~lib/builtins/v128.trunc",e.i8x16="~lib/builtins/i8x16",e.i16x8="~lib/builtins/i16x8",e.i32x4="~lib/builtins/i32x4",e.i64x2="~lib/builtins/i64x2",e.f32x4="~lib/builtins/f32x4",e.f64x2="~lib/builtins/f64x2",e.i8x16_splat="~lib/builtins/i8x16.splat",e.i8x16_extract_lane_s="~lib/builtins/i8x16.extract_lane_s",e.i8x16_extract_lane_u="~lib/builtins/i8x16.extract_lane_u",e.i8x16_replace_lane="~lib/builtins/i8x16.replace_lane",e.i8x16_add="~lib/builtins/i8x16.add",e.i8x16_sub="~lib/builtins/i8x16.sub",e.i8x16_mul="~lib/builtins/i8x16.mul",e.i8x16_neg="~lib/builtins/i8x16.neg",e.i8x16_add_saturate_s="~lib/builtins/i8x16.add_saturate_s",e.i8x16_add_saturate_u="~lib/builtins/i8x16.add_saturate_u",e.i8x16_sub_saturate_s="~lib/builtins/i8x16.sub_saturate_s",e.i8x16_sub_saturate_u="~lib/builtins/i8x16.sub_saturate_u",e.i8x16_shl="~lib/builtins/i8x16.shl",e.i8x16_shr_s="~lib/builtins/i8x16.shr_s",e.i8x16_shr_u="~lib/builtins/i8x16.shr_u",e.i8x16_any_true="~lib/builtins/i8x16.any_true",e.i8x16_all_true="~lib/builtins/i8x16.all_true",e.i8x16_eq="~lib/builtins/i8x16.eq",e.i8x16_ne="~lib/builtins/i8x16.ne",e.i8x16_lt_s="~lib/builtins/i8x16.lt_s",e.i8x16_lt_u="~lib/builtins/i8x16.lt_u",e.i8x16_le_s="~lib/builtins/i8x16.le_s",e.i8x16_le_u="~lib/builtins/i8x16.le_u",e.i8x16_gt_s="~lib/builtins/i8x16.gt_s",e.i8x16_gt_u="~lib/builtins/i8x16.gt_u",e.i8x16_ge_s="~lib/builtins/i8x16.ge_s",e.i8x16_ge_u="~lib/builtins/i8x16.ge_u",e.i16x8_splat="~lib/builtins/i16x8.splat",e.i16x8_extract_lane_s="~lib/builtins/i16x8.extract_lane_s",e.i16x8_extract_lane_u="~lib/builtins/i16x8.extract_lane_u",e.i16x8_replace_lane="~lib/builtins/i16x8.replace_lane",e.i16x8_add="~lib/builtins/i16x8.add",e.i16x8_sub="~lib/builtins/i16x8.sub",e.i16x8_mul="~lib/builtins/i16x8.mul",e.i16x8_neg="~lib/builtins/i16x8.neg",e.i16x8_add_saturate_s="~lib/builtins/i16x8.add_saturate_s",e.i16x8_add_saturate_u="~lib/builtins/i16x8.add_saturate_u",e.i16x8_sub_saturate_s="~lib/builtins/i16x8.sub_saturate_s",e.i16x8_sub_saturate_u="~lib/builtins/i16x8.sub_saturate_u",e.i16x8_shl="~lib/builtins/i16x8.shl",e.i16x8_shr_s="~lib/builtins/i16x8.shr_s",e.i16x8_shr_u="~lib/builtins/i16x8.shr_u",e.i16x8_any_true="~lib/builtins/i16x8.any_true",e.i16x8_all_true="~lib/builtins/i16x8.all_true",e.i16x8_eq="~lib/builtins/i16x8.eq",e.i16x8_ne="~lib/builtins/i16x8.ne",e.i16x8_lt_s="~lib/builtins/i16x8.lt_s",e.i16x8_lt_u="~lib/builtins/i16x8.lt_u",e.i16x8_le_s="~lib/builtins/i16x8.le_s",e.i16x8_le_u="~lib/builtins/i16x8.le_u",e.i16x8_gt_s="~lib/builtins/i16x8.gt_s",e.i16x8_gt_u="~lib/builtins/i16x8.gt_u",e.i16x8_ge_s="~lib/builtins/i16x8.ge_s",e.i16x8_ge_u="~lib/builtins/i16x8.ge_u",e.i32x4_splat="~lib/builtins/i32x4.splat",e.i32x4_extract_lane="~lib/builtins/i32x4.extract_lane",e.i32x4_replace_lane="~lib/builtins/i32x4.replace_lane",e.i32x4_add="~lib/builtins/i32x4.add",e.i32x4_sub="~lib/builtins/i32x4.sub",e.i32x4_mul="~lib/builtins/i32x4.mul",e.i32x4_neg="~lib/builtins/i32x4.neg",e.i32x4_shl="~lib/builtins/i32x4.shl",e.i32x4_shr_s="~lib/builtins/i32x4.shr_s",e.i32x4_shr_u="~lib/builtins/i32x4.shr_u",e.i32x4_any_true="~lib/builtins/i32x4.any_true",e.i32x4_all_true="~lib/builtins/i32x4.all_true",e.i32x4_eq="~lib/builtins/i32x4.eq",e.i32x4_ne="~lib/builtins/i32x4.ne",e.i32x4_lt_s="~lib/builtins/i32x4.lt_s",e.i32x4_lt_u="~lib/builtins/i32x4.lt_u",e.i32x4_le_s="~lib/builtins/i32x4.le_s",e.i32x4_le_u="~lib/builtins/i32x4.le_u",e.i32x4_gt_s="~lib/builtins/i32x4.gt_s",e.i32x4_gt_u="~lib/builtins/i32x4.gt_u",e.i32x4_ge_s="~lib/builtins/i32x4.ge_s",e.i32x4_ge_u="~lib/builtins/i32x4.ge_u",e.i32x4_trunc_s_f32x4_sat="~lib/builtins/i32x4.trunc_s_f32x4_sat",e.i32x4_trunc_u_f32x4_sat="~lib/builtins/i32x4.trunc_u_f32x4_sat",e.i64x2_splat="~lib/builtins/i64x2.splat",e.i64x2_extract_lane="~lib/builtins/i64x2.extract_lane",e.i64x2_replace_lane="~lib/builtins/i64x2.replace_lane",e.i64x2_add="~lib/builtins/i64x2.add",e.i64x2_sub="~lib/builtins/i64x2.sub",e.i64x2_neg="~lib/builtins/i64x2.neg",e.i64x2_shl="~lib/builtins/i64x2.shl",e.i64x2_shr_s="~lib/builtins/i64x2.shr_s",e.i64x2_shr_u="~lib/builtins/i64x2.shr_u",e.i64x2_any_true="~lib/builtins/i64x2.any_true",e.i64x2_all_true="~lib/builtins/i64x2.all_true",e.i64x2_trunc_s_f64x2_sat="~lib/builtins/i64x2.trunc_s_f64x2_sat",e.i64x2_trunc_u_f64x2_sat="~lib/builtins/i64x2.trunc_u_f64x2_sat",e.f32x4_splat="~lib/builtins/f32x4.splat",e.f32x4_extract_lane="~lib/builtins/f32x4.extract_lane",e.f32x4_replace_lane="~lib/builtins/f32x4.replace_lane",e.f32x4_add="~lib/builtins/f32x4.add",e.f32x4_sub="~lib/builtins/f32x4.sub",e.f32x4_mul="~lib/builtins/f32x4.mul",e.f32x4_div="~lib/builtins/f32x4.div",e.f32x4_neg="~lib/builtins/f32x4.neg",e.f32x4_min="~lib/builtins/f32x4.min",e.f32x4_max="~lib/builtins/f32x4.max",e.f32x4_abs="~lib/builtins/f32x4.abs",e.f32x4_sqrt="~lib/builtins/f32x4.sqrt",e.f32x4_eq="~lib/builtins/f32x4.eq",e.f32x4_ne="~lib/builtins/f32x4.ne",e.f32x4_lt="~lib/builtins/f32x4.lt",e.f32x4_le="~lib/builtins/f32x4.le",e.f32x4_gt="~lib/builtins/f32x4.gt",e.f32x4_ge="~lib/builtins/f32x4.ge",e.f32x4_convert_s_i32x4="~lib/builtins/f32x4.convert_s_i32x4",e.f32x4_convert_u_i32x4="~lib/builtins/f32x4.convert_u_i32x4",e.f64x2_splat="~lib/builtins/f64x2.splat",e.f64x2_extract_lane="~lib/builtins/f64x2.extract_lane",e.f64x2_replace_lane="~lib/builtins/f64x2.replace_lane",e.f64x2_add="~lib/builtins/f64x2.add",e.f64x2_sub="~lib/builtins/f64x2.sub",e.f64x2_mul="~lib/builtins/f64x2.mul",e.f64x2_div="~lib/builtins/f64x2.div",e.f64x2_neg="~lib/builtins/f64x2.neg",e.f64x2_min="~lib/builtins/f64x2.min",e.f64x2_max="~lib/builtins/f64x2.max",e.f64x2_abs="~lib/builtins/f64x2.abs",e.f64x2_sqrt="~lib/builtins/f64x2.sqrt",e.f64x2_eq="~lib/builtins/f64x2.eq",e.f64x2_ne="~lib/builtins/f64x2.ne",e.f64x2_lt="~lib/builtins/f64x2.lt",e.f64x2_le="~lib/builtins/f64x2.le",e.f64x2_gt="~lib/builtins/f64x2.gt",e.f64x2_ge="~lib/builtins/f64x2.ge",e.f64x2_convert_s_i64x2="~lib/builtins/f64x2.convert_s_i64x2",e.f64x2_convert_u_i64x2="~lib/builtins/f64x2.convert_u_i64x2",e.v8x16_shuffle="~lib/builtins/v8x16.shuffle",e.ERROR="~lib/diagnostics/ERROR",e.WARNING="~lib/diagnostics/WARNING",e.INFO="~lib/diagnostics/INFO",e.HEAP_BASE="~lib/memory/HEAP_BASE",e.memory_size="~lib/memory/memory.size",e.memory_grow="~lib/memory/memory.grow",e.memory_copy="~lib/memory/memory.copy",e.memory_fill="~lib/memory/memory.fill",e.iterateRoots="~lib/gc/iterateRoots"}(i=r.BuiltinSymbols||(r.BuiltinSymbols={})),r.compileCall=h,r.compileAbort=y,r.compileIterateRoots=function(e){var r,t,i=e.module,a=new Array,s=o.Signature.makeSignatureString([o.Type.i32],o.Type.void),p=e.ensureFunctionType([o.Type.i32],o.Type.void);try{for(var _=n(e.program.elementsByName.values()),h=_.next();!h.done;h=_.next()){var d=h.value;if(d.kind==l.ElementKind.GLOBAL){var y=d,m=y.type.classReference;if(y.is(u.CommonFlags.COMPILED)&&null!==m&&!m.hasDecorator(l.DecoratorFlags.UNMANAGED))if(y.is(u.CommonFlags.INLINED)){var T=y.constantIntegerValue;a.push(i.createCallIndirect(i.createGetLocal(0,c.NativeType.I32),[e.options.isWasm64?i.createI64(i64_low(T),i64_high(T)):i.createI32(i64_low(T))],s))}else a.push(i.createCallIndirect(i.createGetLocal(0,c.NativeType.I32),[i.createGetGlobal(y.internalName,e.options.nativeSizeType)],s))}}}catch(e){r={error:e}}finally{try{h&&!h.done&&(t=_.return)&&t.call(_)}finally{if(r)throw r.error}}i.addFunction("~iterateRoots",p,[],a.length?i.createBlock(null,a):i.createNop())},r.ensureGCHook=function e(r,t){var i,a,s=r.program;assert(t.type.isManaged(s));var p=t.gcHookIndex;if(-1!=p)return p;var _=t.members;if(t.isDeclaredInLibrary&&null!==_&&_.has("__gc")){var h=assert(_.get("__gc"));assert(h.kind==l.ElementKind.FUNCTION_PROTOTYPE);var d=assert(s.resolver.resolveFunction(h,null));assert(d.is(u.CommonFlags.PRIVATE|u.CommonFlags.INSTANCE)),assert(!d.isAny(u.CommonFlags.AMBIENT|u.CommonFlags.VIRTUAL)),assert(0==d.signature.parameterTypes.length),assert(d.signature.returnType==o.Type.void),d.internalName=t.internalName+"~gc",assert(r.compileFunction(d));var y=r.ensureFunctionTableEntry(d);return t.gcHookIndex=y,y}var m=r.module,T=r.options,f=T.nativeSizeType,E=T.usizeType.byteSize,g=new Array;g.push(m.createIf(m.createUnary(T.isWasm64?c.UnaryOp.EqzI64:c.UnaryOp.EqzI32,m.createGetLocal(0,f)),m.createReturn()));var v=r.functionTable,I=v.length;v.push(""),t.gcHookIndex=I;var b=t.base;if(b?(assert(b.type.isManaged(s)),g.push(m.createCallIndirect(m.createI32(e(r,b.type.classReference)),[m.createGetLocal(0,f)],"FUNCSIG$"+(f==c.NativeType.I64?"vj":"vi")))):g.push(m.createCall(assert(s.gcMarkInstance).internalName,[m.createGetLocal(0,f)],c.NativeType.None)),_)try{for(var x=n(_.values()),S=x.next();!S.done;S=x.next()){var A=S.value;if(A.kind==l.ElementKind.FIELD&&A.parent===t&&A.type.isManaged(s)){var N=A.memoryOffset;assert(N>=0),g.push(m.createCall(assert(s.gcMarkInstance).internalName,[m.createLoad(E,!1,m.createGetLocal(0,f),f,N)],c.NativeType.None))}}}catch(e){i={error:e}}finally{try{S&&!S.done&&(a=x.return)&&a.call(x)}finally{if(i)throw i.error}}var O=t.internalName+"~gc";return m.addFunction(O,r.ensureFunctionType(null,o.Type.void,T.usizeType),null,m.createBlock(null,g)),v[I]=O,I}},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.bitsetIs=function(e,r){return assert(r>=0&&r<64),i64_ne(i64_and(e,i64_shl(i64_one,i64_new(r))),i64_zero)},r.bitsetSet=function(e,r,t){return assert(r>=0&&r<64),t?i64_or(e,i64_shl(i64_one,i64_new(r))):i64_and(e,i64_not(i64_shl(i64_one,i64_new(r))))}},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),function(e){e[e.NULL=0]="NULL",e[e.LINEFEED=10]="LINEFEED",e[e.CARRIAGERETURN=13]="CARRIAGERETURN",e[e.LINESEPARATOR=8232]="LINESEPARATOR",e[e.PARAGRAPHSEPARATOR=8233]="PARAGRAPHSEPARATOR",e[e.NEXTLINE=133]="NEXTLINE",e[e.SPACE=32]="SPACE",e[e.NONBREAKINGSPACE=160]="NONBREAKINGSPACE",e[e.ENQUAD=8192]="ENQUAD",e[e.EMQUAD=8193]="EMQUAD",e[e.ENSPACE=8194]="ENSPACE",e[e.EMSPACE=8195]="EMSPACE",e[e.THREEPEREMSPACE=8196]="THREEPEREMSPACE",e[e.FOURPEREMSPACE=8197]="FOURPEREMSPACE",e[e.SIXPEREMSPACE=8198]="SIXPEREMSPACE",e[e.FIGURESPACE=8199]="FIGURESPACE",e[e.PUNCTUATIONSPACE=8200]="PUNCTUATIONSPACE",e[e.THINSPACE=8201]="THINSPACE",e[e.HAIRSPACE=8202]="HAIRSPACE",e[e.ZEROWIDTHSPACE=8203]="ZEROWIDTHSPACE",e[e.NARROWNOBREAKSPACE=8239]="NARROWNOBREAKSPACE",e[e.IDEOGRAPHICSPACE=12288]="IDEOGRAPHICSPACE",e[e.MATHEMATICALSPACE=8287]="MATHEMATICALSPACE",e[e.OGHAM=5760]="OGHAM",e[e._=95]="_",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.AMPERSAND=38]="AMPERSAND",e[e.ASTERISK=42]="ASTERISK",e[e.AT=64]="AT",e[e.BACKSLASH=92]="BACKSLASH",e[e.BACKTICK=96]="BACKTICK",e[e.BAR=124]="BAR",e[e.CARET=94]="CARET",e[e.CLOSEBRACE=125]="CLOSEBRACE",e[e.CLOSEBRACKET=93]="CLOSEBRACKET",e[e.CLOSEPAREN=41]="CLOSEPAREN",e[e.COLON=58]="COLON",e[e.COMMA=44]="COMMA",e[e.DOLLAR=36]="DOLLAR",e[e.DOT=46]="DOT",e[e.DOUBLEQUOTE=34]="DOUBLEQUOTE",e[e.EQUALS=61]="EQUALS",e[e.EXCLAMATION=33]="EXCLAMATION",e[e.GREATERTHAN=62]="GREATERTHAN",e[e.HASH=35]="HASH",e[e.LESSTHAN=60]="LESSTHAN",e[e.MINUS=45]="MINUS",e[e.OPENBRACE=123]="OPENBRACE",e[e.OPENBRACKET=91]="OPENBRACKET",e[e.OPENPAREN=40]="OPENPAREN",e[e.PERCENT=37]="PERCENT",e[e.PLUS=43]="PLUS",e[e.QUESTION=63]="QUESTION",e[e.SEMICOLON=59]="SEMICOLON",e[e.SINGLEQUOTE=39]="SINGLEQUOTE",e[e.SLASH=47]="SLASH",e[e.TILDE=126]="TILDE",e[e.BACKSPACE=8]="BACKSPACE",e[e.FORMFEED=12]="FORMFEED",e[e.BYTEORDERMARK=65279]="BYTEORDERMARK",e[e.TAB=9]="TAB",e[e.VERTICALTAB=11]="VERTICALTAB"}(r.CharCode||(r.CharCode={})),r.isLineBreak=function(e){switch(e){case 10:case 13:case 8232:case 8233:return!0;default:return!1}},r.isWhiteSpace=function(e){switch(e){case 32:case 9:case 11:case 12:case 160:case 133:case 5760:case 8239:case 8287:case 12288:case 65279:return!0;default:return e>=8192&&e<=8203}},r.isDecimalDigit=function(e){return e>=48&&e<=57},r.isOctalDigit=function(e){return e>=48&&e<=55},r.isIdentifierStart=function(e){return e>=97&&e<=122||e>=65&&e<=90||95==e||36==e||e>127&&!((r=e)<0||r>65535)&&a(r,n);var r},r.isKeywordCharacter=function(e){return e>=97&&e<=122},r.isIdentifierPart=function(e){return e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||95==e||36==e||e>127&&!((r=e)<0||r>65535)&&a(r,i);var r};var n=[170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,880,884,886,887,890,893,902,902,904,906,908,908,910,929,931,1013,1015,1153,1162,1319,1329,1366,1369,1369,1377,1415,1488,1514,1520,1522,1568,1610,1646,1647,1649,1747,1749,1749,1765,1766,1774,1775,1786,1788,1791,1791,1808,1808,1810,1839,1869,1957,1969,1969,1994,2026,2036,2037,2042,2042,2048,2069,2074,2074,2084,2084,2088,2088,2112,2136,2208,2208,2210,2220,2308,2361,2365,2365,2384,2384,2392,2401,2417,2423,2425,2431,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2493,2493,2510,2510,2524,2525,2527,2529,2544,2545,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2649,2652,2654,2654,2674,2676,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2749,2768,2768,2784,2785,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2877,2877,2908,2909,2911,2913,2929,2929,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3024,3024,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3133,3133,3160,3161,3168,3169,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3261,3261,3294,3294,3296,3297,3313,3314,3333,3340,3342,3344,3346,3386,3389,3389,3406,3406,3424,3425,3450,3455,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3585,3632,3634,3635,3648,3654,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3760,3762,3763,3773,3773,3776,3780,3782,3782,3804,3807,3840,3840,3904,3911,3913,3948,3976,3980,4096,4138,4159,4159,4176,4181,4186,4189,4193,4193,4197,4198,4206,4208,4213,4225,4238,4238,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4992,5007,5024,5108,5121,5740,5743,5759,5761,5786,5792,5866,5870,5872,5888,5900,5902,5905,5920,5937,5952,5969,5984,5996,5998,6e3,6016,6067,6103,6103,6108,6108,6176,6263,6272,6312,6314,6314,6320,6389,6400,6428,6480,6509,6512,6516,6528,6571,6593,6599,6656,6678,6688,6740,6823,6823,6917,6963,6981,6987,7043,7072,7086,7087,7098,7141,7168,7203,7245,7247,7258,7293,7401,7404,7406,7409,7413,7414,7424,7615,7680,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8305,8305,8319,8319,8336,8348,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11502,11506,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11648,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11823,11823,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12445,12447,12449,12538,12540,12543,12549,12589,12593,12686,12704,12730,12784,12799,13312,19893,19968,40908,40960,42124,42192,42237,42240,42508,42512,42527,42538,42539,42560,42606,42623,42647,42656,42735,42775,42783,42786,42888,42891,42894,42896,42899,42912,42922,43e3,43009,43011,43013,43015,43018,43020,43042,43072,43123,43138,43187,43250,43255,43259,43259,43274,43301,43312,43334,43360,43388,43396,43442,43471,43471,43520,43560,43584,43586,43588,43595,43616,43638,43642,43642,43648,43695,43697,43697,43701,43702,43705,43709,43712,43712,43714,43714,43739,43741,43744,43754,43762,43764,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43968,44002,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65136,65140,65142,65276,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500],i=[170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,768,884,886,887,890,893,902,902,904,906,908,908,910,929,931,1013,1015,1153,1155,1159,1162,1319,1329,1366,1369,1369,1377,1415,1425,1469,1471,1471,1473,1474,1476,1477,1479,1479,1488,1514,1520,1522,1552,1562,1568,1641,1646,1747,1749,1756,1759,1768,1770,1788,1791,1791,1808,1866,1869,1969,1984,2037,2042,2042,2048,2093,2112,2139,2208,2208,2210,2220,2276,2302,2304,2403,2406,2415,2417,2423,2425,2431,2433,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2492,2500,2503,2504,2507,2510,2519,2519,2524,2525,2527,2531,2534,2545,2561,2563,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2620,2620,2622,2626,2631,2632,2635,2637,2641,2641,2649,2652,2654,2654,2662,2677,2689,2691,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2748,2757,2759,2761,2763,2765,2768,2768,2784,2787,2790,2799,2817,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2876,2884,2887,2888,2891,2893,2902,2903,2908,2909,2911,2915,2918,2927,2929,2929,2946,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3006,3010,3014,3016,3018,3021,3024,3024,3031,3031,3046,3055,3073,3075,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3133,3140,3142,3144,3146,3149,3157,3158,3160,3161,3168,3171,3174,3183,3202,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3260,3268,3270,3272,3274,3277,3285,3286,3294,3294,3296,3299,3302,3311,3313,3314,3330,3331,3333,3340,3342,3344,3346,3386,3389,3396,3398,3400,3402,3406,3415,3415,3424,3427,3430,3439,3450,3455,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3530,3530,3535,3540,3542,3542,3544,3551,3570,3571,3585,3642,3648,3662,3664,3673,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3769,3771,3773,3776,3780,3782,3782,3784,3789,3792,3801,3804,3807,3840,3840,3864,3865,3872,3881,3893,3893,3895,3895,3897,3897,3902,3911,3913,3948,3953,3972,3974,3991,3993,4028,4038,4038,4096,4169,4176,4253,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4957,4959,4992,5007,5024,5108,5121,5740,5743,5759,5761,5786,5792,5866,5870,5872,5888,5900,5902,5908,5920,5940,5952,5971,5984,5996,5998,6e3,6002,6003,6016,6099,6103,6103,6108,6109,6112,6121,6155,6157,6160,6169,6176,6263,6272,6314,6320,6389,6400,6428,6432,6443,6448,6459,6470,6509,6512,6516,6528,6571,6576,6601,6608,6617,6656,6683,6688,6750,6752,6780,6783,6793,6800,6809,6823,6823,6912,6987,6992,7001,7019,7027,7040,7155,7168,7223,7232,7241,7245,7293,7376,7378,7380,7414,7424,7654,7676,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8204,8205,8255,8256,8276,8276,8305,8305,8319,8319,8336,8348,8400,8412,8417,8417,8421,8432,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11647,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11744,11775,11823,11823,12293,12295,12321,12335,12337,12341,12344,12348,12353,12438,12441,12442,12445,12447,12449,12538,12540,12543,12549,12589,12593,12686,12704,12730,12784,12799,13312,19893,19968,40908,40960,42124,42192,42237,42240,42508,42512,42539,42560,42607,42612,42621,42623,42647,42655,42737,42775,42783,42786,42888,42891,42894,42896,42899,42912,42922,43e3,43047,43072,43123,43136,43204,43216,43225,43232,43255,43259,43259,43264,43309,43312,43347,43360,43388,43392,43456,43471,43481,43520,43574,43584,43597,43600,43609,43616,43638,43642,43643,43648,43714,43739,43741,43744,43759,43762,43766,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43968,44010,44012,44013,44016,44025,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65024,65039,65056,65062,65075,65076,65101,65103,65136,65140,65142,65276,65296,65305,65313,65338,65343,65343,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500];function a(e,r){if(e>1),(n=r[t-=1&t])<=e&&e<=r[t+1])return!0;e=e.length&&(e=void 0),{value:e&&e[t++],done:!e}}}},i=this&&this.__read||function(e,r){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var n,i,a=t.call(e),s=[];try{for(;(void 0===r||r-- >0)&&!(n=a.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(t=a.return)&&t.call(a)}finally{if(i)throw i.error}}return s};Object.defineProperty(r,"__esModule",{value:!0}),r.makeArray=function(e){if(void 0===e&&(e=null),e){for(var r=new Array(e.length),t=0,n=e.length;t0||n=0;)if(e.charCodeAt(a)==i){t-a==3&&46==e.charCodeAt(a+1)&&46==e.charCodeAt(a+2)||(e=r?e.substring(0,a):e.substring(0,a)+e.substring(t+3),n-=t+3-a,t=a-1);break}if(a<0&&t>0&&(2!=t||46!=e.charCodeAt(0)||46!=e.charCodeAt(1))){n=(e=e.substring(t+4)).length;continue}}}t++}return n>0?e:"."}function s(e){var r=e.length;if(r<=1){if(0==r)return".";if(e.charCodeAt(0)==i)return e}for(;--r>0;)if(e.charCodeAt(r)==i)return e.substring(0,r);return"."}r.normalizePath=a,r.resolvePath=function(e,r){return e.startsWith("std/")?e:a(s(r)+n.PATH_DELIMITER+e)},r.dirname=s},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=" ",i=" ",a=" ";r.indent=function(e,r){for(;r>=4;)e.push(a),r-=4;r>=2&&(e.push(i),r-=2),r&&e.push(n)}},function(e,r,t){"use strict";function n(e,r){return e[r]|e[r+1]<<8|e[r+2]<<16|e[r+3]<<24}function i(e,r,t){r[t]=e,r[t+1]=e>>>8,r[t+2]=e>>>16,r[t+3]=e>>>24}function a(e,r){var t=n(e,r),i=n(e,r+4);return i64_new(t,i)}Object.defineProperty(r,"__esModule",{value:!0}),r.readI8=function(e,r){return e[r]},r.writeI8=function(e,r,t){r[t]=e},r.readI16=function(e,r){return e[r]|e[r+1]<<8},r.writeI16=function(e,r,t){r[t]=e,r[t+1]=e>>>8},r.readI32=n,r.writeI32=i,r.readI64=a,r.writeI64=function(e,r,t){i(i64_low(e),r,t),i(i64_high(e),r,t+4)},r.readF32=function(e,r){return i32_as_f32(n(e,r))},r.writeF32=function(e,r,t){i(f32_as_i32(e),r,t)},r.readF64=function(e,r){return i64_as_f64(a(e,r))},r.writeF64=function(e,r,t){var n=f64_as_i64(e);i(i64_low(n),r,t),i(i64_high(n),r,t+4)}},function(e,r,t){"use strict";function n(e){for(var t in e)r.hasOwnProperty(t)||(r[t]=e[t])}Object.defineProperty(r,"__esModule",{value:!0});var i=t(10),a=t(13),s=t(14),o=t(2);r.formatDiagnostic=o.formatDiagnosticMessage;var c=t(15);r.parseFile=function(e,r,t,n){return void 0===t&&(t=!1),void 0===n&&(n=null),n||(n=new c.Parser),n.parseFile(e,r,t),n},r.nextFile=function(e){return e.nextFile()},r.nextDiagnostic=function(e){var r=e.program;return r.diagnosticsOffset0&&!a.isLineBreak(n.charCodeAt(s-1));)s--;for(;o=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}},s=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return s};Object.defineProperty(t,"__esModule",{value:!0});var o,c=r(0),l=r(2),u=r(6),p=r(5),_=r(1),h=r(9),d=r(10),y=function(){return function(e,t,r,n,i){this.localFile=e,this.localIdentifier=t,this.foreignIdentifier=r,this.foreignPath=n,this.foreignPathAlt=i}}(),m=function(){return function(e,t,r,n){this.localIdentifier=e,this.foreignIdentifier=t,this.foreignPath=r,this.foreignPathAlt=n}}(),f=function(){return function(e,t,r){this.foreignPath=e,this.foreignPathAlt=t,this.pathLiteral=r}}();function T(e,t){switch(assert(t.length),e){case p.DecoratorKind.OPERATOR:case p.DecoratorKind.OPERATOR_BINARY:switch(t.charCodeAt(0)){case 91:if("[]"==t)return o.INDEXED_GET;if("[]="==t)return o.INDEXED_SET;break;case 123:if("{}"==t)return o.UNCHECKED_INDEXED_GET;if("{}="==t)return o.UNCHECKED_INDEXED_SET;break;case 43:if("+"==t)return o.ADD;break;case 45:if("-"==t)return o.SUB;break;case 42:if("*"==t)return o.MUL;if("**"==t)return o.POW;break;case 47:if("/"==t)return o.DIV;break;case 37:if("%"==t)return o.REM;break;case 38:if("&"==t)return o.BITWISE_AND;break;case 124:if("|"==t)return o.BITWISE_OR;break;case 94:if("^"==t)return o.BITWISE_XOR;break;case 61:if("=="==t)return o.EQ;break;case 33:if("!="==t)return o.NE;break;case 62:if(">"==t)return o.GT;if(">="==t)return o.GE;if(">>"==t)return o.BITWISE_SHR;if(">>>"==t)return o.BITWISE_SHR_U;break;case 60:if("<"==t)return o.LT;if("<="==t)return o.LE;if("<<"==t)return o.BITWISE_SHL}break;case p.DecoratorKind.OPERATOR_PREFIX:switch(t.charCodeAt(0)){case 43:if("+"==t)return o.PLUS;if("++"==t)return o.PREFIX_INC;break;case 45:if("-"==t)return o.MINUS;if("--"==t)return o.PREFIX_DEC;break;case 33:if("!"==t)return o.NOT;break;case 126:if("~"==t)return o.BITWISE_NOT}break;case p.DecoratorKind.OPERATOR_POSTFIX:switch(t.charCodeAt(0)){case 43:if("++"==t)return o.POSTFIX_INC;break;case 45:if("--"==t)return o.POSTFIX_DEC}}return o.INVALID}!function(e){e[e.INVALID=0]="INVALID",e[e.INDEXED_GET=1]="INDEXED_GET",e[e.INDEXED_SET=2]="INDEXED_SET",e[e.UNCHECKED_INDEXED_GET=3]="UNCHECKED_INDEXED_GET",e[e.UNCHECKED_INDEXED_SET=4]="UNCHECKED_INDEXED_SET",e[e.ADD=5]="ADD",e[e.SUB=6]="SUB",e[e.MUL=7]="MUL",e[e.DIV=8]="DIV",e[e.REM=9]="REM",e[e.POW=10]="POW",e[e.BITWISE_AND=11]="BITWISE_AND",e[e.BITWISE_OR=12]="BITWISE_OR",e[e.BITWISE_XOR=13]="BITWISE_XOR",e[e.BITWISE_SHL=14]="BITWISE_SHL",e[e.BITWISE_SHR=15]="BITWISE_SHR",e[e.BITWISE_SHR_U=16]="BITWISE_SHR_U",e[e.EQ=17]="EQ",e[e.NE=18]="NE",e[e.GT=19]="GT",e[e.GE=20]="GE",e[e.LT=21]="LT",e[e.LE=22]="LE",e[e.PLUS=23]="PLUS",e[e.MINUS=24]="MINUS",e[e.NOT=25]="NOT",e[e.BITWISE_NOT=26]="BITWISE_NOT",e[e.PREFIX_INC=27]="PREFIX_INC",e[e.PREFIX_DEC=28]="PREFIX_DEC",e[e.POSTFIX_INC=29]="POSTFIX_INC",e[e.POSTFIX_DEC=30]="POSTFIX_DEC"}(o=t.OperatorKind||(t.OperatorKind={}));var g,E,v=function(e){function t(t){void 0===t&&(t=null);var r=e.call(this,t)||this;r.sources=[],r.diagnosticsOffset=0,r.filesByName=new Map,r.elementsByName=new Map,r.elementsByDeclaration=new Map,r.instancesByName=new Map,r.typeClasses=new Map,r.managedClasses=new Map,r.nextClassId=0,r.nativeDummySignature=null;var n=new p.Source(c.LIBRARY_SUBST,"[native code]",p.SourceKind.LIBRARY);r.nativeSource=n;var i=new N(r,n);return r.nativeFile=i,r.filesByName.set(i.internalName,i),r.resolver=new h.Resolver(r),r}return i(t,e),t.prototype.writeRuntimeHeader=function(e,t,r,n){assert(n<1<<28),_.writeI32(n,e,t),_.writeI32(1,e,t+4),_.writeI32(r.id,e,t+8),_.writeI32(n,e,t+12)},Object.defineProperty(t.prototype,"runtimeHeaderSize",{get:function(){return 16},enumerable:!0,configurable:!0}),t.prototype.makeNativeVariableDeclaration=function(e,t){void 0===t&&(t=c.CommonFlags.NONE);var r=this.nativeSource.range;return p.Node.createVariableDeclaration(p.Node.createIdentifierExpression(e,r),null,null,null,t,r)},t.prototype.makeNativeTypeDeclaration=function(e,t){void 0===t&&(t=c.CommonFlags.NONE);var r=this.nativeSource.range,n=p.Node.createIdentifierExpression(e,r);return p.Node.createTypeDeclaration(n,null,p.Node.createOmittedType(r),null,t,r)},t.prototype.makeNativeFunctionDeclaration=function(e,t){void 0===t&&(t=c.CommonFlags.NONE);var r=this.nativeSource.range;return p.Node.createFunctionDeclaration(p.Node.createIdentifierExpression(e,r),null,this.nativeDummySignature||(this.nativeDummySignature=p.Node.createSignature([],p.Node.createType(p.Node.createSimpleTypeName(c.CommonSymbols.void_,r),null,!1,r),null,!1,r)),null,null,t,0,r)},t.prototype.makeNativeNamespaceDeclaration=function(e,t){void 0===t&&(t=c.CommonFlags.NONE);var r=this.nativeSource.range;return p.Node.createNamespaceDeclaration(p.Node.createIdentifierExpression(e,r),[],null,t,r)},t.prototype.makeNativeFunction=function(e,t,r,n,i){return void 0===r&&(r=this.nativeFile),void 0===n&&(n=c.CommonFlags.NONE),void 0===i&&(i=E.NONE),new P(e,new D(e,r,this.makeNativeFunctionDeclaration(e,n),i),t)},t.prototype.getElementByDeclaration=function(e){var t=this.elementsByDeclaration;return assert(t.has(e)),t.get(e)},t.prototype.initialize=function(e){var t,r,n,i,o,_,h,d,y,m,f,T;this.options=e,this.registerNativeType(c.CommonSymbols.i8,u.Type.i8),this.registerNativeType(c.CommonSymbols.i16,u.Type.i16),this.registerNativeType(c.CommonSymbols.i32,u.Type.i32),this.registerNativeType(c.CommonSymbols.i64,u.Type.i64),this.registerNativeType(c.CommonSymbols.isize,e.isizeType),this.registerNativeType(c.CommonSymbols.u8,u.Type.u8),this.registerNativeType(c.CommonSymbols.u16,u.Type.u16),this.registerNativeType(c.CommonSymbols.u32,u.Type.u32),this.registerNativeType(c.CommonSymbols.u64,u.Type.u64),this.registerNativeType(c.CommonSymbols.usize,e.usizeType),this.registerNativeType(c.CommonSymbols.bool,u.Type.bool),this.registerNativeType(c.CommonSymbols.f32,u.Type.f32),this.registerNativeType(c.CommonSymbols.f64,u.Type.f64),this.registerNativeType(c.CommonSymbols.void_,u.Type.void),this.registerNativeType(c.CommonSymbols.number,u.Type.f64),this.registerNativeType(c.CommonSymbols.boolean,u.Type.bool),this.nativeFile.add(c.CommonSymbols.native,new S(c.CommonSymbols.native,this.nativeFile,this.makeNativeTypeDeclaration(c.CommonSymbols.native,c.CommonFlags.EXPORT|c.CommonFlags.GENERIC),E.BUILTIN)),e.hasFeature(8)&&this.registerNativeType(c.CommonSymbols.v128,u.Type.v128),this.registerConstantInteger(c.CommonSymbols.ASC_TARGET,u.Type.i32,i64_new(e.isWasm64?c.Target.WASM64:c.Target.WASM32)),this.registerConstantInteger(c.CommonSymbols.ASC_NO_ASSERT,u.Type.bool,i64_new(e.noAssert?1:0,0)),this.registerConstantInteger(c.CommonSymbols.ASC_MEMORY_BASE,u.Type.i32,i64_new(e.memoryBase,0)),this.registerConstantInteger(c.CommonSymbols.ASC_OPTIMIZE_LEVEL,u.Type.i32,i64_new(e.optimizeLevelHint,0)),this.registerConstantInteger(c.CommonSymbols.ASC_SHRINK_LEVEL,u.Type.i32,i64_new(e.shrinkLevelHint,0)),this.registerConstantInteger(c.CommonSymbols.ASC_FEATURE_MUTABLE_GLOBAL,u.Type.bool,i64_new(e.hasFeature(2)?1:0,0)),this.registerConstantInteger(c.CommonSymbols.ASC_FEATURE_SIGN_EXTENSION,u.Type.bool,i64_new(e.hasFeature(1)?1:0,0)),this.registerConstantInteger(c.CommonSymbols.ASC_FEATURE_BULK_MEMORY,u.Type.bool,i64_new(e.hasFeature(4)?1:0,0)),this.registerConstantInteger(c.CommonSymbols.ASC_FEATURE_SIMD,u.Type.bool,i64_new(e.hasFeature(8)?1:0,0)),this.registerConstantInteger(c.CommonSymbols.ASC_FEATURE_THREADS,u.Type.bool,i64_new(e.hasFeature(16)?1:0,0));for(var v=new Array,b=new Map,I=new Map,A=new Array,O=new Array,C=0,k=this.sources.length;C=48&&ye<=57)this.registerConstantInteger(he,u.Type.i32,i64_new(parseI32(de,10)));else{var me=this.elementsByName;if(!(ve=me.get(de)))throw new Error("no such global element: "+de);if(me.has(he))throw new Error("duplicate global element: "+de);me.set(he,ve)}}}}catch(e){h={error:e}}finally{try{pe&&!pe.done&&(d=ue.return)&&d.call(ue)}finally{if(h)throw h.error}}this.arrayPrototype=this.require(c.CommonSymbols.Array,g.CLASS_PROTOTYPE),this.fixedArrayPrototype=this.require(c.CommonSymbols.FixedArray,g.CLASS_PROTOTYPE),this.setPrototype=this.require(c.CommonSymbols.Set,g.CLASS_PROTOTYPE),this.mapPrototype=this.require(c.CommonSymbols.Map,g.CLASS_PROTOTYPE),this.abortInstance=this.requireFunction(c.CommonSymbols.abort),this.allocInstance=this.requireFunction(c.CommonSymbols.alloc),this.reallocInstance=this.requireFunction(c.CommonSymbols.realloc),this.freeInstance=this.requireFunction(c.CommonSymbols.free),this.retainInstance=this.requireFunction(c.CommonSymbols.retain),this.releaseInstance=this.requireFunction(c.CommonSymbols.release),this.collectInstance=this.requireFunction(c.CommonSymbols.collect),this.typeinfoInstance=this.requireFunction(c.CommonSymbols.typeinfo),this.instanceofInstance=this.requireFunction(c.CommonSymbols.instanceof_),this.visitInstance=this.requireFunction(c.CommonSymbols.visit),this.allocArrayInstance=this.requireFunction(c.CommonSymbols.allocArray);try{for(var fe=a(this.filesByName.values()),Te=fe.next();!Te.done;Te=fe.next()){j=(L=Te.value).exports;if(L.source.isEntry&&j)try{for(var ge=a(j.values()),Ee=ge.next();!Ee.done;Ee=ge.next()){var ve=Ee.value;this.markModuleExport(ve)}}catch(e){f={error:e}}finally{try{Ee&&!Ee.done&&(T=ge.return)&&T.call(ge)}finally{if(f)throw f.error}}}}catch(e){y={error:e}}finally{try{Te&&!Te.done&&(m=fe.return)&&m.call(fe)}finally{if(y)throw y.error}}},t.prototype.require=function(e,t){var r=this.lookupGlobal(e);if(!r)throw new Error("missing "+e);if(r.kind!=t)throw new Error("unexpected "+e);return r},t.prototype.requireClass=function(e){var t=this.require(e,g.CLASS_PROTOTYPE),r=this.resolver.resolveClass(t,null);if(!r)throw new Error("invalid "+e);return r},t.prototype.requireFunction=function(e){var t=this.require(e,g.FUNCTION_PROTOTYPE),r=this.resolver.resolveFunction(t,null);if(!r)throw new Error("invalid "+e);return r},t.prototype.markModuleExport=function(e){var t,r,n,i;switch(e.set(c.CommonFlags.MODULE_EXPORT),e.kind){case g.CLASS_PROTOTYPE:var s=e.instanceMembers;if(s)try{for(var o=a(s.values()),l=o.next();!l.done;l=o.next()){var u=l.value;this.markModuleExport(u)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}break;case g.PROPERTY_PROTOTYPE:var p=e.getterPrototype;p&&this.markModuleExport(p);var _=e.setterPrototype;_&&this.markModuleExport(_);break;case g.PROPERTY:case g.FUNCTION:case g.FIELD:case g.CLASS:assert(!1)}var h=e.members;if(h)try{for(var d=a(h.values()),y=d.next();!y.done;y=d.next()){u=y.value;this.markModuleExport(u)}}catch(e){n={error:e}}finally{try{y&&!y.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}},t.prototype.registerNativeType=function(e,t){var r=new S(e,this.nativeFile,this.makeNativeTypeDeclaration(e,c.CommonFlags.EXPORT),E.BUILTIN);r.setType(t),this.nativeFile.add(e,r)},t.prototype.registerNativeTypeClass=function(e,t){assert(!this.typeClasses.has(e));var r=this.lookupGlobal(t);if(r){assert(r.kind==g.CLASS_PROTOTYPE);var n=this.resolver.resolveClass(r,null);n&&this.typeClasses.set(e,n)}},t.prototype.registerConstantInteger=function(e,t,r){assert(t.is(4));var n=new L(e,this.nativeFile,E.NONE,this.makeNativeVariableDeclaration(e,c.CommonFlags.CONST|c.CommonFlags.EXPORT));n.setConstantIntegerValue(r,t),this.nativeFile.add(e,n)},t.prototype.registerConstantFloat=function(e,t,r){assert(t.is(8));var n=new L(e,this.nativeFile,E.NONE,this.makeNativeVariableDeclaration(e,c.CommonFlags.CONST|c.CommonFlags.EXPORT));n.setConstantFloatValue(r,t),this.nativeFile.add(e,n)},t.prototype.ensureGlobal=function(e,t){var r=this.elementsByName;if(r.has(e)&&r.get(e)!==t){var n=q(r.get(e),t);if(!n)return this.error(l.DiagnosticCode.Duplicate_identifier_0,t.identifierNode.range,e),t;t=n}return r.set(e,t),t},t.prototype.lookupGlobal=function(e){var t=this.elementsByName;return t.has(e)?t.get(e):null},t.prototype.requireGlobal=function(e){var t=this.elementsByName;if(t.has(e))return t.get(e);throw new Error("missing global")},t.prototype.lookupForeignFile=function(e,t){var r=this.filesByName;return r.has(e)?r.get(e):r.has(t)?r.get(t):null},t.prototype.lookupForeign=function(e,t,r,n){for(;;){var i=this.lookupForeignFile(t,r);if(!i)return null;var a=i.lookupExport(e);if(a)return a;if(n.has(i)){var s=n.get(i);if(s.has(e)){var o=s.get(e);if(o.foreignPath){e=o.localIdentifier.text,t=o.foreignPath,r=assert(o.foreignPathAlt);continue}if(a=i.lookupInSelf(o.localIdentifier.text))return a}}break}return null},t.prototype.checkDecorators=function(e,t){var r=E.NONE;if(e)for(var n=0,i=e.length;n=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}};Object.defineProperty(t,"__esModule",{value:!0});var i,a,s=r(0);!function(e){e[e.None=_BinaryenTypeNone()]="None",e[e.I32=_BinaryenTypeInt32()]="I32",e[e.I64=_BinaryenTypeInt64()]="I64",e[e.F32=_BinaryenTypeFloat32()]="F32",e[e.F64=_BinaryenTypeFloat64()]="F64",e[e.V128=_BinaryenTypeVec128()]="V128",e[e.Unreachable=_BinaryenTypeUnreachable()]="Unreachable",e[e.Auto=_BinaryenTypeAuto()]="Auto"}(i=t.NativeType||(t.NativeType={})),function(e){e[e.Atomics=_BinaryenFeatureAtomics()]="Atomics",e[e.MutableGloabls=_BinaryenFeatureMutableGlobals()]="MutableGloabls",e[e.NontrappingFPToInt=_BinaryenFeatureNontrappingFPToInt()]="NontrappingFPToInt",e[e.SIMD128=_BinaryenFeatureSIMD128()]="SIMD128",e[e.BulkMemory=_BinaryenFeatureBulkMemory()]="BulkMemory",e[e.SignExt=_BinaryenFeatureSignExt()]="SignExt",e[e.ExceptionHandling=_BinaryenFeatureExceptionHandling()]="ExceptionHandling"}(t.FeatureFlags||(t.FeatureFlags={})),function(e){e[e.Invalid=_BinaryenInvalidId()]="Invalid",e[e.Block=_BinaryenBlockId()]="Block",e[e.If=_BinaryenIfId()]="If",e[e.Loop=_BinaryenLoopId()]="Loop",e[e.Break=_BinaryenBreakId()]="Break",e[e.Switch=_BinaryenSwitchId()]="Switch",e[e.Call=_BinaryenCallId()]="Call",e[e.CallIndirect=_BinaryenCallIndirectId()]="CallIndirect",e[e.LocalGet=_BinaryenLocalGetId()]="LocalGet",e[e.LocalSet=_BinaryenLocalSetId()]="LocalSet",e[e.GlobalGet=_BinaryenGlobalGetId()]="GlobalGet",e[e.GlobalSet=_BinaryenGlobalSetId()]="GlobalSet",e[e.Load=_BinaryenLoadId()]="Load",e[e.Store=_BinaryenStoreId()]="Store",e[e.Const=_BinaryenConstId()]="Const",e[e.Unary=_BinaryenUnaryId()]="Unary",e[e.Binary=_BinaryenBinaryId()]="Binary",e[e.Select=_BinaryenSelectId()]="Select",e[e.Drop=_BinaryenDropId()]="Drop",e[e.Return=_BinaryenReturnId()]="Return",e[e.Host=_BinaryenHostId()]="Host",e[e.Nop=_BinaryenNopId()]="Nop",e[e.Unreachable=_BinaryenUnreachableId()]="Unreachable",e[e.AtomicCmpxchg=_BinaryenAtomicCmpxchgId()]="AtomicCmpxchg",e[e.AtomicRMW=_BinaryenAtomicRMWId()]="AtomicRMW",e[e.AtomicWait=_BinaryenAtomicWaitId()]="AtomicWait",e[e.AtomicNotify=_BinaryenAtomicNotifyId()]="AtomicNotify",e[e.SIMDExtract=_BinaryenSIMDExtractId()]="SIMDExtract",e[e.SIMDReplace=_BinaryenSIMDReplaceId()]="SIMDReplace",e[e.SIMDShuffle=_BinaryenSIMDShuffleId()]="SIMDShuffle",e[e.SIMDBitselect=_BinaryenSIMDBitselectId()]="SIMDBitselect",e[e.SIMDShift=_BinaryenSIMDShiftId()]="SIMDShift",e[e.MemoryInit=_BinaryenMemoryInitId()]="MemoryInit",e[e.DataDrop=_BinaryenDataDropId()]="DataDrop",e[e.MemoryCopy=_BinaryenMemoryCopyId()]="MemoryCopy",e[e.MemoryFill=_BinaryenMemoryFillId()]="MemoryFill"}(a=t.ExpressionId||(t.ExpressionId={})),function(e){e[e.ClzI32=_BinaryenClzInt32()]="ClzI32",e[e.CtzI32=_BinaryenCtzInt32()]="CtzI32",e[e.PopcntI32=_BinaryenPopcntInt32()]="PopcntI32",e[e.NegF32=_BinaryenNegFloat32()]="NegF32",e[e.AbsF32=_BinaryenAbsFloat32()]="AbsF32",e[e.CeilF32=_BinaryenCeilFloat32()]="CeilF32",e[e.FloorF32=_BinaryenFloorFloat32()]="FloorF32",e[e.TruncF32=_BinaryenTruncFloat32()]="TruncF32",e[e.NearestF32=_BinaryenNearestFloat32()]="NearestF32",e[e.SqrtF32=_BinaryenSqrtFloat32()]="SqrtF32",e[e.EqzI32=_BinaryenEqZInt32()]="EqzI32",e[e.ClzI64=_BinaryenClzInt64()]="ClzI64",e[e.CtzI64=_BinaryenCtzInt64()]="CtzI64",e[e.PopcntI64=_BinaryenPopcntInt64()]="PopcntI64",e[e.NegF64=_BinaryenNegFloat64()]="NegF64",e[e.AbsF64=_BinaryenAbsFloat64()]="AbsF64",e[e.CeilF64=_BinaryenCeilFloat64()]="CeilF64",e[e.FloorF64=_BinaryenFloorFloat64()]="FloorF64",e[e.TruncF64=_BinaryenTruncFloat64()]="TruncF64",e[e.NearestF64=_BinaryenNearestFloat64()]="NearestF64",e[e.SqrtF64=_BinaryenSqrtFloat64()]="SqrtF64",e[e.EqzI64=_BinaryenEqZInt64()]="EqzI64",e[e.ExtendI32=_BinaryenExtendSInt32()]="ExtendI32",e[e.ExtendU32=_BinaryenExtendUInt32()]="ExtendU32",e[e.WrapI64=_BinaryenWrapInt64()]="WrapI64",e[e.TruncF32ToI32=_BinaryenTruncSFloat32ToInt32()]="TruncF32ToI32",e[e.TruncF32ToI64=_BinaryenTruncSFloat32ToInt64()]="TruncF32ToI64",e[e.TruncF32ToU32=_BinaryenTruncUFloat32ToInt32()]="TruncF32ToU32",e[e.TruncF32ToU64=_BinaryenTruncUFloat32ToInt64()]="TruncF32ToU64",e[e.TruncF64ToI32=_BinaryenTruncSFloat64ToInt32()]="TruncF64ToI32",e[e.TruncF64ToI64=_BinaryenTruncSFloat64ToInt64()]="TruncF64ToI64",e[e.TruncF64ToU32=_BinaryenTruncUFloat64ToInt32()]="TruncF64ToU32",e[e.TruncF64ToU64=_BinaryenTruncUFloat64ToInt64()]="TruncF64ToU64",e[e.ReinterpretF32=_BinaryenReinterpretFloat32()]="ReinterpretF32",e[e.ReinterpretF64=_BinaryenReinterpretFloat64()]="ReinterpretF64",e[e.ConvertI32ToF32=_BinaryenConvertSInt32ToFloat32()]="ConvertI32ToF32",e[e.ConvertI32ToF64=_BinaryenConvertSInt32ToFloat64()]="ConvertI32ToF64",e[e.ConvertU32ToF32=_BinaryenConvertUInt32ToFloat32()]="ConvertU32ToF32",e[e.ConvertU32ToF64=_BinaryenConvertUInt32ToFloat64()]="ConvertU32ToF64",e[e.ConvertI64ToF32=_BinaryenConvertSInt64ToFloat32()]="ConvertI64ToF32",e[e.ConvertI64ToF64=_BinaryenConvertSInt64ToFloat64()]="ConvertI64ToF64",e[e.ConvertU64ToF32=_BinaryenConvertUInt64ToFloat32()]="ConvertU64ToF32",e[e.ConvertU64ToF64=_BinaryenConvertUInt64ToFloat64()]="ConvertU64ToF64",e[e.PromoteF32=_BinaryenPromoteFloat32()]="PromoteF32",e[e.DemoteF64=_BinaryenDemoteFloat64()]="DemoteF64",e[e.ReinterpretI32=_BinaryenReinterpretInt32()]="ReinterpretI32",e[e.ReinterpretI64=_BinaryenReinterpretInt64()]="ReinterpretI64",e[e.ExtendI8ToI32=_BinaryenExtendS8Int32()]="ExtendI8ToI32",e[e.ExtendI16ToI32=_BinaryenExtendS16Int32()]="ExtendI16ToI32",e[e.ExtendI8ToI64=_BinaryenExtendS8Int64()]="ExtendI8ToI64",e[e.ExtendI16ToI64=_BinaryenExtendS16Int64()]="ExtendI16ToI64",e[e.ExtendI32ToI64=_BinaryenExtendS32Int64()]="ExtendI32ToI64",e[e.SplatVecI8x16=_BinaryenSplatVecI8x16()]="SplatVecI8x16",e[e.SplatVecI16x8=_BinaryenSplatVecI16x8()]="SplatVecI16x8",e[e.SplatVecI32x4=_BinaryenSplatVecI32x4()]="SplatVecI32x4",e[e.SplatVecI64x2=_BinaryenSplatVecI64x2()]="SplatVecI64x2",e[e.SplatVecF32x4=_BinaryenSplatVecF32x4()]="SplatVecF32x4",e[e.SplatVecF64x2=_BinaryenSplatVecF64x2()]="SplatVecF64x2",e[e.NotVec128=_BinaryenNotVec128()]="NotVec128",e[e.NegVecI8x16=_BinaryenNegVecI8x16()]="NegVecI8x16",e[e.AnyTrueVecI8x16=_BinaryenAnyTrueVecI8x16()]="AnyTrueVecI8x16",e[e.AllTrueVecI8x16=_BinaryenAllTrueVecI8x16()]="AllTrueVecI8x16",e[e.NegVecI16x8=_BinaryenNegVecI16x8()]="NegVecI16x8",e[e.AnyTrueVecI16x8=_BinaryenAnyTrueVecI16x8()]="AnyTrueVecI16x8",e[e.AllTrueVecI16x8=_BinaryenAllTrueVecI16x8()]="AllTrueVecI16x8",e[e.NegVecI32x4=_BinaryenNegVecI32x4()]="NegVecI32x4",e[e.AnyTrueVecI32x4=_BinaryenAnyTrueVecI32x4()]="AnyTrueVecI32x4",e[e.AllTrueVecI32x4=_BinaryenAllTrueVecI32x4()]="AllTrueVecI32x4",e[e.NegVecI64x2=_BinaryenNegVecI64x2()]="NegVecI64x2",e[e.AnyTrueVecI64x2=_BinaryenAnyTrueVecI64x2()]="AnyTrueVecI64x2",e[e.AllTrueVecI64x2=_BinaryenAllTrueVecI64x2()]="AllTrueVecI64x2",e[e.AbsVecF32x4=_BinaryenAbsVecF32x4()]="AbsVecF32x4",e[e.NegVecF32x4=_BinaryenNegVecF32x4()]="NegVecF32x4",e[e.SqrtVecF32x4=_BinaryenSqrtVecF32x4()]="SqrtVecF32x4",e[e.AbsVecF64x2=_BinaryenAbsVecF64x2()]="AbsVecF64x2",e[e.NegVecF64x2=_BinaryenNegVecF64x2()]="NegVecF64x2",e[e.SqrtVecF64x2=_BinaryenSqrtVecF64x2()]="SqrtVecF64x2",e[e.TruncSatSVecF32x4ToVecI32x4=_BinaryenTruncSatSVecF32x4ToVecI32x4()]="TruncSatSVecF32x4ToVecI32x4",e[e.TruncSatUVecF32x4ToVecI32x4=_BinaryenTruncSatUVecF32x4ToVecI32x4()]="TruncSatUVecF32x4ToVecI32x4",e[e.TruncSatSVecF64x2ToVecI64x2=_BinaryenTruncSatSVecF64x2ToVecI64x2()]="TruncSatSVecF64x2ToVecI64x2",e[e.TruncSatUVecF64x2ToVecI64x2=_BinaryenTruncSatUVecF64x2ToVecI64x2()]="TruncSatUVecF64x2ToVecI64x2",e[e.ConvertSVecI32x4ToVecF32x4=_BinaryenConvertSVecI32x4ToVecF32x4()]="ConvertSVecI32x4ToVecF32x4",e[e.ConvertUVecI32x4ToVecF32x4=_BinaryenConvertUVecI32x4ToVecF32x4()]="ConvertUVecI32x4ToVecF32x4",e[e.ConvertSVecI64x2ToVecF64x2=_BinaryenConvertSVecI64x2ToVecF64x2()]="ConvertSVecI64x2ToVecF64x2",e[e.ConvertUVecI64x2ToVecF64x2=_BinaryenConvertUVecI64x2ToVecF64x2()]="ConvertUVecI64x2ToVecF64x2"}(t.UnaryOp||(t.UnaryOp={})),function(e){e[e.AddI32=_BinaryenAddInt32()]="AddI32",e[e.SubI32=_BinaryenSubInt32()]="SubI32",e[e.MulI32=_BinaryenMulInt32()]="MulI32",e[e.DivI32=_BinaryenDivSInt32()]="DivI32",e[e.DivU32=_BinaryenDivUInt32()]="DivU32",e[e.RemI32=_BinaryenRemSInt32()]="RemI32",e[e.RemU32=_BinaryenRemUInt32()]="RemU32",e[e.AndI32=_BinaryenAndInt32()]="AndI32",e[e.OrI32=_BinaryenOrInt32()]="OrI32",e[e.XorI32=_BinaryenXorInt32()]="XorI32",e[e.ShlI32=_BinaryenShlInt32()]="ShlI32",e[e.ShrU32=_BinaryenShrUInt32()]="ShrU32",e[e.ShrI32=_BinaryenShrSInt32()]="ShrI32",e[e.RotlI32=_BinaryenRotLInt32()]="RotlI32",e[e.RotrI32=_BinaryenRotRInt32()]="RotrI32",e[e.EqI32=_BinaryenEqInt32()]="EqI32",e[e.NeI32=_BinaryenNeInt32()]="NeI32",e[e.LtI32=_BinaryenLtSInt32()]="LtI32",e[e.LtU32=_BinaryenLtUInt32()]="LtU32",e[e.LeI32=_BinaryenLeSInt32()]="LeI32",e[e.LeU32=_BinaryenLeUInt32()]="LeU32",e[e.GtI32=_BinaryenGtSInt32()]="GtI32",e[e.GtU32=_BinaryenGtUInt32()]="GtU32",e[e.GeI32=_BinaryenGeSInt32()]="GeI32",e[e.GeU32=_BinaryenGeUInt32()]="GeU32",e[e.AddI64=_BinaryenAddInt64()]="AddI64",e[e.SubI64=_BinaryenSubInt64()]="SubI64",e[e.MulI64=_BinaryenMulInt64()]="MulI64",e[e.DivI64=_BinaryenDivSInt64()]="DivI64",e[e.DivU64=_BinaryenDivUInt64()]="DivU64",e[e.RemI64=_BinaryenRemSInt64()]="RemI64",e[e.RemU64=_BinaryenRemUInt64()]="RemU64",e[e.AndI64=_BinaryenAndInt64()]="AndI64",e[e.OrI64=_BinaryenOrInt64()]="OrI64",e[e.XorI64=_BinaryenXorInt64()]="XorI64",e[e.ShlI64=_BinaryenShlInt64()]="ShlI64",e[e.ShrU64=_BinaryenShrUInt64()]="ShrU64",e[e.ShrI64=_BinaryenShrSInt64()]="ShrI64",e[e.RotlI64=_BinaryenRotLInt64()]="RotlI64",e[e.RotrI64=_BinaryenRotRInt64()]="RotrI64",e[e.EqI64=_BinaryenEqInt64()]="EqI64",e[e.NeI64=_BinaryenNeInt64()]="NeI64",e[e.LtI64=_BinaryenLtSInt64()]="LtI64",e[e.LtU64=_BinaryenLtUInt64()]="LtU64",e[e.LeI64=_BinaryenLeSInt64()]="LeI64",e[e.LeU64=_BinaryenLeUInt64()]="LeU64",e[e.GtI64=_BinaryenGtSInt64()]="GtI64",e[e.GtU64=_BinaryenGtUInt64()]="GtU64",e[e.GeI64=_BinaryenGeSInt64()]="GeI64",e[e.GeU64=_BinaryenGeUInt64()]="GeU64",e[e.AddF32=_BinaryenAddFloat32()]="AddF32",e[e.SubF32=_BinaryenSubFloat32()]="SubF32",e[e.MulF32=_BinaryenMulFloat32()]="MulF32",e[e.DivF32=_BinaryenDivFloat32()]="DivF32",e[e.CopysignF32=_BinaryenCopySignFloat32()]="CopysignF32",e[e.MinF32=_BinaryenMinFloat32()]="MinF32",e[e.MaxF32=_BinaryenMaxFloat32()]="MaxF32",e[e.EqF32=_BinaryenEqFloat32()]="EqF32",e[e.NeF32=_BinaryenNeFloat32()]="NeF32",e[e.LtF32=_BinaryenLtFloat32()]="LtF32",e[e.LeF32=_BinaryenLeFloat32()]="LeF32",e[e.GtF32=_BinaryenGtFloat32()]="GtF32",e[e.GeF32=_BinaryenGeFloat32()]="GeF32",e[e.AddF64=_BinaryenAddFloat64()]="AddF64",e[e.SubF64=_BinaryenSubFloat64()]="SubF64",e[e.MulF64=_BinaryenMulFloat64()]="MulF64",e[e.DivF64=_BinaryenDivFloat64()]="DivF64",e[e.CopysignF64=_BinaryenCopySignFloat64()]="CopysignF64",e[e.MinF64=_BinaryenMinFloat64()]="MinF64",e[e.MaxF64=_BinaryenMaxFloat64()]="MaxF64",e[e.EqF64=_BinaryenEqFloat64()]="EqF64",e[e.NeF64=_BinaryenNeFloat64()]="NeF64",e[e.LtF64=_BinaryenLtFloat64()]="LtF64",e[e.LeF64=_BinaryenLeFloat64()]="LeF64",e[e.GtF64=_BinaryenGtFloat64()]="GtF64",e[e.GeF64=_BinaryenGeFloat64()]="GeF64",e[e.EqVecI8x16=_BinaryenEqVecI8x16()]="EqVecI8x16",e[e.NeVecI8x16=_BinaryenNeVecI8x16()]="NeVecI8x16",e[e.LtSVecI8x16=_BinaryenLtSVecI8x16()]="LtSVecI8x16",e[e.LtUVecI8x16=_BinaryenLtUVecI8x16()]="LtUVecI8x16",e[e.LeSVecI8x16=_BinaryenLeSVecI8x16()]="LeSVecI8x16",e[e.LeUVecI8x16=_BinaryenLeUVecI8x16()]="LeUVecI8x16",e[e.GtSVecI8x16=_BinaryenGtSVecI8x16()]="GtSVecI8x16",e[e.GtUVecI8x16=_BinaryenGtUVecI8x16()]="GtUVecI8x16",e[e.GeSVecI8x16=_BinaryenGeSVecI8x16()]="GeSVecI8x16",e[e.GeUVecI8x16=_BinaryenGeUVecI8x16()]="GeUVecI8x16",e[e.EqVecI16x8=_BinaryenEqVecI16x8()]="EqVecI16x8",e[e.NeVecI16x8=_BinaryenNeVecI16x8()]="NeVecI16x8",e[e.LtSVecI16x8=_BinaryenLtSVecI16x8()]="LtSVecI16x8",e[e.LtUVecI16x8=_BinaryenLtUVecI16x8()]="LtUVecI16x8",e[e.LeSVecI16x8=_BinaryenLeSVecI16x8()]="LeSVecI16x8",e[e.LeUVecI16x8=_BinaryenLeUVecI16x8()]="LeUVecI16x8",e[e.GtSVecI16x8=_BinaryenGtSVecI16x8()]="GtSVecI16x8",e[e.GtUVecI16x8=_BinaryenGtUVecI16x8()]="GtUVecI16x8",e[e.GeSVecI16x8=_BinaryenGeSVecI16x8()]="GeSVecI16x8",e[e.GeUVecI16x8=_BinaryenGeUVecI16x8()]="GeUVecI16x8",e[e.EqVecI32x4=_BinaryenEqVecI32x4()]="EqVecI32x4",e[e.NeVecI32x4=_BinaryenNeVecI32x4()]="NeVecI32x4",e[e.LtSVecI32x4=_BinaryenLtSVecI32x4()]="LtSVecI32x4",e[e.LtUVecI32x4=_BinaryenLtUVecI32x4()]="LtUVecI32x4",e[e.LeSVecI32x4=_BinaryenLeSVecI32x4()]="LeSVecI32x4",e[e.LeUVecI32x4=_BinaryenLeUVecI32x4()]="LeUVecI32x4",e[e.GtSVecI32x4=_BinaryenGtSVecI32x4()]="GtSVecI32x4",e[e.GtUVecI32x4=_BinaryenGtUVecI32x4()]="GtUVecI32x4",e[e.GeSVecI32x4=_BinaryenGeSVecI32x4()]="GeSVecI32x4",e[e.GeUVecI32x4=_BinaryenGeUVecI32x4()]="GeUVecI32x4",e[e.EqVecF32x4=_BinaryenEqVecF32x4()]="EqVecF32x4",e[e.NeVecF32x4=_BinaryenNeVecF32x4()]="NeVecF32x4",e[e.LtVecF32x4=_BinaryenLtVecF32x4()]="LtVecF32x4",e[e.LeVecF32x4=_BinaryenLeVecF32x4()]="LeVecF32x4",e[e.GtVecF32x4=_BinaryenGtVecF32x4()]="GtVecF32x4",e[e.GeVecF32x4=_BinaryenGeVecF32x4()]="GeVecF32x4",e[e.EqVecF64x2=_BinaryenEqVecF64x2()]="EqVecF64x2",e[e.NeVecF64x2=_BinaryenNeVecF64x2()]="NeVecF64x2",e[e.LtVecF64x2=_BinaryenLtVecF64x2()]="LtVecF64x2",e[e.LeVecF64x2=_BinaryenLeVecF64x2()]="LeVecF64x2",e[e.GtVecF64x2=_BinaryenGtVecF64x2()]="GtVecF64x2",e[e.GeVecF64x2=_BinaryenGeVecF64x2()]="GeVecF64x2",e[e.AndVec128=_BinaryenAndVec128()]="AndVec128",e[e.OrVec128=_BinaryenOrVec128()]="OrVec128",e[e.XorVec128=_BinaryenXorVec128()]="XorVec128",e[e.AddVecI8x16=_BinaryenAddVecI8x16()]="AddVecI8x16",e[e.AddSatSVecI8x16=_BinaryenAddSatSVecI8x16()]="AddSatSVecI8x16",e[e.AddSatUVecI8x16=_BinaryenAddSatUVecI8x16()]="AddSatUVecI8x16",e[e.SubVecI8x16=_BinaryenSubVecI8x16()]="SubVecI8x16",e[e.SubSatSVecI8x16=_BinaryenSubSatSVecI8x16()]="SubSatSVecI8x16",e[e.SubSatUVecI8x16=_BinaryenSubSatUVecI8x16()]="SubSatUVecI8x16",e[e.MulVecI8x16=_BinaryenMulVecI8x16()]="MulVecI8x16",e[e.AddVecI16x8=_BinaryenAddVecI16x8()]="AddVecI16x8",e[e.AddSatSVecI16x8=_BinaryenAddSatSVecI16x8()]="AddSatSVecI16x8",e[e.AddSatUVecI16x8=_BinaryenAddSatUVecI16x8()]="AddSatUVecI16x8",e[e.SubVecI16x8=_BinaryenSubVecI16x8()]="SubVecI16x8",e[e.SubSatSVecI16x8=_BinaryenSubSatSVecI16x8()]="SubSatSVecI16x8",e[e.SubSatUVecI16x8=_BinaryenSubSatUVecI16x8()]="SubSatUVecI16x8",e[e.MulVecI16x8=_BinaryenMulVecI16x8()]="MulVecI16x8",e[e.AddVecI32x4=_BinaryenAddVecI32x4()]="AddVecI32x4",e[e.SubVecI32x4=_BinaryenSubVecI32x4()]="SubVecI32x4",e[e.MulVecI32x4=_BinaryenMulVecI32x4()]="MulVecI32x4",e[e.AddVecI64x2=_BinaryenAddVecI64x2()]="AddVecI64x2",e[e.SubVecI64x2=_BinaryenSubVecI64x2()]="SubVecI64x2",e[e.AddVecF32x4=_BinaryenAddVecF32x4()]="AddVecF32x4",e[e.SubVecF32x4=_BinaryenSubVecF32x4()]="SubVecF32x4",e[e.MulVecF32x4=_BinaryenMulVecF32x4()]="MulVecF32x4",e[e.DivVecF32x4=_BinaryenDivVecF32x4()]="DivVecF32x4",e[e.MinVecF32x4=_BinaryenMinVecF32x4()]="MinVecF32x4",e[e.MaxVecF32x4=_BinaryenMaxVecF32x4()]="MaxVecF32x4",e[e.AddVecF64x2=_BinaryenAddVecF64x2()]="AddVecF64x2",e[e.SubVecF64x2=_BinaryenSubVecF64x2()]="SubVecF64x2",e[e.MulVecF64x2=_BinaryenMulVecF64x2()]="MulVecF64x2",e[e.DivVecF64x2=_BinaryenDivVecF64x2()]="DivVecF64x2",e[e.MinVecF64x2=_BinaryenMinVecF64x2()]="MinVecF64x2",e[e.MaxVecF64x2=_BinaryenMaxVecF64x2()]="MaxVecF64x2"}(t.BinaryOp||(t.BinaryOp={})),function(e){e[e.MemorySize=_BinaryenMemorySize()]="MemorySize",e[e.MemoryGrow=_BinaryenMemoryGrow()]="MemoryGrow"}(t.HostOp||(t.HostOp={})),function(e){e[e.Add=_BinaryenAtomicRMWAdd()]="Add",e[e.Sub=_BinaryenAtomicRMWSub()]="Sub",e[e.And=_BinaryenAtomicRMWAnd()]="And",e[e.Or=_BinaryenAtomicRMWOr()]="Or",e[e.Xor=_BinaryenAtomicRMWXor()]="Xor",e[e.Xchg=_BinaryenAtomicRMWXchg()]="Xchg"}(t.AtomicRMWOp||(t.AtomicRMWOp={})),function(e){e[e.ExtractLaneSVecI8x16=_BinaryenExtractLaneSVecI8x16()]="ExtractLaneSVecI8x16",e[e.ExtractLaneUVecI8x16=_BinaryenExtractLaneUVecI8x16()]="ExtractLaneUVecI8x16",e[e.ExtractLaneSVecI16x8=_BinaryenExtractLaneSVecI16x8()]="ExtractLaneSVecI16x8",e[e.ExtractLaneUVecI16x8=_BinaryenExtractLaneUVecI16x8()]="ExtractLaneUVecI16x8",e[e.ExtractLaneVecI32x4=_BinaryenExtractLaneVecI32x4()]="ExtractLaneVecI32x4",e[e.ExtractLaneVecI64x2=_BinaryenExtractLaneVecI64x2()]="ExtractLaneVecI64x2",e[e.ExtractLaneVecF32x4=_BinaryenExtractLaneVecF32x4()]="ExtractLaneVecF32x4",e[e.ExtractLaneVecF64x2=_BinaryenExtractLaneVecF64x2()]="ExtractLaneVecF64x2"}(t.SIMDExtractOp||(t.SIMDExtractOp={})),function(e){e[e.ReplaceLaneVecI8x16=_BinaryenReplaceLaneVecI8x16()]="ReplaceLaneVecI8x16",e[e.ReplaceLaneVecI16x8=_BinaryenReplaceLaneVecI16x8()]="ReplaceLaneVecI16x8",e[e.ReplaceLaneVecI32x4=_BinaryenReplaceLaneVecI32x4()]="ReplaceLaneVecI32x4",e[e.ReplaceLaneVecI64x2=_BinaryenReplaceLaneVecI64x2()]="ReplaceLaneVecI64x2",e[e.ReplaceLaneVecF32x4=_BinaryenReplaceLaneVecF32x4()]="ReplaceLaneVecF32x4",e[e.ReplaceLaneVecF64x2=_BinaryenReplaceLaneVecF64x2()]="ReplaceLaneVecF64x2"}(t.SIMDReplaceOp||(t.SIMDReplaceOp={})),function(e){e[e.ShlVecI8x16=_BinaryenShlVecI8x16()]="ShlVecI8x16",e[e.ShrSVecI8x16=_BinaryenShrSVecI8x16()]="ShrSVecI8x16",e[e.ShrUVecI8x16=_BinaryenShrUVecI8x16()]="ShrUVecI8x16",e[e.ShlVecI16x8=_BinaryenShlVecI16x8()]="ShlVecI16x8",e[e.ShrSVecI16x8=_BinaryenShrSVecI16x8()]="ShrSVecI16x8",e[e.ShrUVecI16x8=_BinaryenShrUVecI16x8()]="ShrUVecI16x8",e[e.ShlVecI32x4=_BinaryenShlVecI32x4()]="ShlVecI32x4",e[e.ShrSVecI32x4=_BinaryenShrSVecI32x4()]="ShrSVecI32x4",e[e.ShrUVecI32x4=_BinaryenShrUVecI32x4()]="ShrUVecI32x4",e[e.ShlVecI64x2=_BinaryenShlVecI64x2()]="ShlVecI64x2",e[e.ShrSVecI64x2=_BinaryenShrSVecI64x2()]="ShrSVecI64x2",e[e.ShrUVecI64x2=_BinaryenShrUVecI64x2()]="ShrUVecI64x2"}(t.SIMDShiftOp||(t.SIMDShiftOp={}));var o=function(){function e(){}return e.create=function(t,r){var n=new e;return n.buffer=t,n.offset=r,n},e}();t.MemorySegment=o;var c=function(){function e(){this.hasTemporaryFunction=!1,this.cachedPrecomputeNames=0,this.cachedStrings=new Map}return e.create=function(){var t=new e;return t.ref=_BinaryenModuleCreate(),t.lit=memory.allocate(_BinaryenSizeofLiteral()),t},e.createFrom=function(t){var r=p(t);try{var n=new e;return n.ref=_BinaryenModuleRead(r,t.length),n.lit=memory.allocate(_BinaryenSizeofLiteral()),n}finally{memory.free(changetype(r))}},e.prototype.addFunctionType=function(e,t,r){var n=this.allocStringCached(e),i=_(r);try{return _BinaryenAddFunctionType(this.ref,n,t,i,r?r.length:0)}finally{memory.free(i)}},e.prototype.getFunctionTypeBySignature=function(e,t){var r=_(t);try{return _BinaryenGetFunctionTypeBySignature(this.ref,e,r,t?t.length:0)}finally{memory.free(r)}},e.prototype.removeFunctionType=function(e){var t=this.allocStringCached(e);_BinaryenRemoveFunctionType(this.ref,t)},e.prototype.i32=function(e){var t=this.lit;return _BinaryenLiteralInt32(t,e),_BinaryenConst(this.ref,t)},e.prototype.i64=function(e,t){void 0===t&&(t=0);var r=this.lit;return _BinaryenLiteralInt64(r,e,t),_BinaryenConst(this.ref,r)},e.prototype.f32=function(e){var t=this.lit;return _BinaryenLiteralFloat32(t,e),_BinaryenConst(this.ref,t)},e.prototype.f64=function(e){var t=this.lit;return _BinaryenLiteralFloat64(t,e),_BinaryenConst(this.ref,t)},e.prototype.v128=function(e){assert(16==e.length);for(var t=this.lit,r=0;r<16;++r)store(t+r,e[r]);return _BinaryenLiteralVec128(t,t),_BinaryenConst(this.ref,t)},e.prototype.unary=function(e,t){return _BinaryenUnary(this.ref,e,t)},e.prototype.binary=function(e,t,r){return _BinaryenBinary(this.ref,e,t,r)},e.prototype.host=function(e,t,r){void 0===t&&(t=null),void 0===r&&(r=null);var n=this.allocStringCached(t),i=h(r);try{return _BinaryenHost(this.ref,e,n,i,r?r.length:0)}finally{memory.free(i)}},e.prototype.local_get=function(e,t){return _BinaryenLocalGet(this.ref,e,t)},e.prototype.local_tee=function(e,t){return _BinaryenLocalTee(this.ref,e,t)},e.prototype.global_get=function(e,t){var r=this.allocStringCached(e);return _BinaryenGlobalGet(this.ref,r,t)},e.prototype.load=function(e,t,r,n,i,a){return void 0===i&&(i=0),void 0===a&&(a=e),_BinaryenLoad(this.ref,e,t?1:0,i,a,n,r)},e.prototype.store=function(e,t,r,n,a,s){if(void 0===a&&(a=0),void 0===s&&(s=e),ni.V128)throw new Error("here: "+n);return _BinaryenStore(this.ref,e,a,s,t,r,n)},e.prototype.atomic_load=function(e,t,r,n){return void 0===n&&(n=0),_BinaryenAtomicLoad(this.ref,e,n,r,t)},e.prototype.atomic_store=function(e,t,r,n,i){return void 0===i&&(i=0),_BinaryenAtomicStore(this.ref,e,i,t,r,n)},e.prototype.atomic_rmw=function(e,t,r,n,i,a){return _BinaryenAtomicRMW(this.ref,e,t,r,n,i,a)},e.prototype.atomic_cmpxchg=function(e,t,r,n,i,a){return _BinaryenAtomicCmpxchg(this.ref,e,t,r,n,i,a)},e.prototype.atomic_wait=function(e,t,r,n){return _BinaryenAtomicWait(this.ref,e,t,r,n)},e.prototype.atomic_notify=function(e,t){return _BinaryenAtomicNotify(this.ref,e,t)},e.prototype.local_set=function(e,t){return _BinaryenLocalSet(this.ref,e,t)},e.prototype.global_set=function(e,t){var r=this.allocStringCached(e);return _BinaryenGlobalSet(this.ref,r,t)},e.prototype.block=function(e,t,r){void 0===r&&(r=i.None);var n=this.allocStringCached(e),a=h(t);try{return _BinaryenBlock(this.ref,n,a,t.length,r)}finally{memory.free(a)}},e.prototype.br=function(e,t,r){void 0===t&&(t=0),void 0===r&&(r=0);var n=this.allocStringCached(e);return _BinaryenBreak(this.ref,n,t,r)},e.prototype.drop=function(e){return _BinaryenDrop(this.ref,e)},e.prototype.loop=function(e,t){var r=this.allocStringCached(e);return _BinaryenLoop(this.ref,r,t)},e.prototype.if=function(e,t,r){return void 0===r&&(r=0),_BinaryenIf(this.ref,e,t,r)},e.prototype.nop=function(){return _BinaryenNop(this.ref)},e.prototype.return=function(e){return void 0===e&&(e=0),_BinaryenReturn(this.ref,e)},e.prototype.select=function(e,t,r){return _BinaryenSelect(this.ref,r,e,t)},e.prototype.switch=function(e,t,r,n){void 0===n&&(n=0);for(var i=e.length,a=new Array(i),s=0;s=0;--y)memory.free(l[y])}},e.prototype.setFunctionTable=function(e,t,r){for(var n=r.length,i=new Array(n),a=0;a=0;--i)memory.free(n[i])}},e.prototype.precomputeExpression=function(e){var t=_BinaryenGetOptimizeLevel(),r=_BinaryenGetShrinkLevel(),n=_BinaryenGetDebugInfo();_BinaryenSetOptimizeLevel(4),_BinaryenSetShrinkLevel(0),_BinaryenSetDebugInfo(!1);var i=_BinaryenExpressionGetType(e),a=this.addTemporaryFunction(i,null,e),s=this.cachedPrecomputeNames;return s||(this.cachedPrecomputeNames=s=_([this.allocStringCached("precompute")])),_BinaryenFunctionRunPasses(a,this.ref,s,1),e=_BinaryenFunctionGetBody(a),this.removeTemporaryFunction(),_BinaryenSetOptimizeLevel(t),_BinaryenSetShrinkLevel(r),_BinaryenSetDebugInfo(n),e},e.prototype.validate=function(){return 1==_BinaryenModuleValidate(this.ref)},e.prototype.interpret=function(){_BinaryenModuleInterpret(this.ref)},e.prototype.toBinary=function(e){var t=this.lit;assert(_BinaryenSizeofLiteral()>=12);var r=d(e),n=0,i=0;try{_BinaryenModuleAllocateAndWrite(t,this.ref,r),n=y(t);var a=y(t+4);i=y(t+8);var s=new f;return s.output=function(e,t){for(var r=new Uint8Array(t),n=0;n>8&255),store(r+2,a>>16&255),store(r+3,a>>>24),r+=4}return t}function h(e){return _(e)}function d(e){if(null==e)return 0;for(var t=memory.allocate(function(e){for(var t=0,r=0,n=e.length;r=55296&&i<=57343&&r+1=55296&&a<=57343&&n+1>>6),store(r++,128|63&a)):a<=65535?(store(r++,224|a>>>12),store(r++,128|a>>>6&63),store(r++,128|63&a)):a<=2097151?(store(r++,240|a>>>18),store(r++,128|a>>>12&63),store(r++,128|a>>>6&63),store(r++,128|63&a)):a<=67108863?(store(r++,248|a>>>24),store(r++,128|a>>>18&63),store(r++,128|a>>>12&63),store(r++,128|a>>>6&63),store(r++,128|63&a)):(store(r++,252|a>>>30),store(r++,128|a>>>24&63),store(r++,128|a>>>18&63),store(r++,128|a>>>12&63),store(r++,128|a>>>6&63),store(r++,128|63&a))}return store(r,0),t}function y(e){return load(e)|load(e+1)<<8|load(e+2)<<16|load(e+3)<<24}function m(e){if(!e)return null;for(var t,r,n,i,a,s=new Array;t=load(e++);)128&t?(r=63&load(e++),192!=(224&t)?(n=63&load(e++),224==(240&t)?t=(15&t)<<12|r<<6|n:(i=63&load(e++),240==(248&t)?t=(7&t)<<18|r<<12|n<<6|i:(a=63&load(e++),t=248==(252&t)?(3&t)<<24|r<<18|n<<12|i<<6|a:(1&t)<<30|r<<24|n<<18|i<<12|a<<6|63&load(e++))),s.push(t)):s.push((31&t)<<6|r)):s.push(t);return String.fromCodePoints(s)}t.Relooper=u,t.readString=m;var f=function(){return function(){}}();t.BinaryModule=f,t.needsExplicitUnreachable=function e(t){if(_BinaryenExpressionGetType(t)!=i.Unreachable)return!1;switch(_BinaryenExpressionGetId(t)){case a.Unreachable:case a.Return:return!1;case a.Break:return 0!=_BinaryenBreakGetCondition(t);case a.Block:if(!_BinaryenBlockGetName(t)){var r=_BinaryenBlockGetNumChildren(t);return r>0&&e(_BinaryenBlockGetChild(t,r-1))}}return!0},t.traverse=function(e,t,r){switch(l(e)){case a.Block:for(var n=0,i=_BinaryenBlockGetNumChildren(e);n=0?c.substring(l+1):c,i.statements=new Array,i.range=new s.Range(i,0,r.length),i.text=r,i}return i(t,e),Object.defineProperty(t.prototype,"isEntry",{get:function(){return this.sourceKind==Z.ENTRY},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isLibrary",{get:function(){return this.sourceKind==Z.LIBRARY},enumerable:!0,configurable:!0}),t}(l);t.Source=$;var ee=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.decorators=null,t.flags=a.CommonFlags.NONE,t}return i(t,e),t.prototype.is=function(e){return(this.flags&e)==e},t.prototype.isAny=function(e){return 0!=(this.flags&e)},t.prototype.set=function(e){this.flags|=e},t}(J);t.DeclarationStatement=ee;var te=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.INDEXSIGNATUREDECLARATION,t}return i(t,e),t}(ee);t.IndexSignatureDeclaration=te;var re=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(ee);t.VariableLikeDeclarationStatement=re;var ne=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.BLOCK,t}return i(t,e),t}(J);t.BlockStatement=ne;var ie=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.BREAK,t}return i(t,e),t}(J);t.BreakStatement=ie;var ae=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.CLASSDECLARATION,t}return i(t,e),Object.defineProperty(t.prototype,"isGeneric",{get:function(){var e=this.typeParameters;return null!=e&&e.length>0},enumerable:!0,configurable:!0}),t}(ee);t.ClassDeclaration=ae;var se=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.CONTINUE,t}return i(t,e),t}(J);t.ContinueStatement=se;var oe=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.DO,t}return i(t,e),t}(J);t.DoStatement=oe;var ce=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.EMPTY,t}return i(t,e),t}(J);t.EmptyStatement=ce;var le=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.ENUMDECLARATION,t}return i(t,e),t}(ee);t.EnumDeclaration=le;var ue=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.ENUMVALUEDECLARATION,t}return i(t,e),t}(re);t.EnumValueDeclaration=ue;var pe=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.EXPORTIMPORT,t}return i(t,e),t}(l);t.ExportImportStatement=pe;var _e=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.EXPORTMEMBER,t}return i(t,e),t}(l);t.ExportMember=_e;var he=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.EXPORT,t}return i(t,e),t}(J);t.ExportStatement=he;var de=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.EXPORTDEFAULT,t}return i(t,e),t}(J);t.ExportDefaultStatement=de;var ye=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.EXPRESSION,t}return i(t,e),t}(J);t.ExpressionStatement=ye;var me=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.FIELDDECLARATION,t.parameterIndex=-1,t}return i(t,e),t}(re);t.FieldDeclaration=me;var fe=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.FOR,t}return i(t,e),t}(J);t.ForStatement=fe,function(e){e[e.NONE=0]="NONE",e[e.ARROW_PARENTHESIZED=1]="ARROW_PARENTHESIZED",e[e.ARROW_SINGLE=2]="ARROW_SINGLE"}(t.ArrowKind||(t.ArrowKind={}));var Te=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.FUNCTIONDECLARATION,t}return i(t,e),Object.defineProperty(t.prototype,"isGeneric",{get:function(){var e=this.typeParameters;return null!=e&&e.length>0},enumerable:!0,configurable:!0}),t.prototype.clone=function(){return l.createFunctionDeclaration(this.name,this.typeParameters,this.signature,this.body,this.decorators,this.flags,this.arrowKind,this.range)},t}(ee);t.FunctionDeclaration=Te;var ge=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.IF,t}return i(t,e),t}(J);t.IfStatement=ge;var Ee=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.IMPORTDECLARATION,t}return i(t,e),t}(ee);t.ImportDeclaration=Ee;var ve=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.IMPORT,t}return i(t,e),t}(J);t.ImportStatement=ve;var be=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.INTERFACEDECLARATION,t}return i(t,e),t}(ae);t.InterfaceDeclaration=be;var Ie=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.METHODDECLARATION,t}return i(t,e),t}(Te);t.MethodDeclaration=Ie;var xe=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.NAMESPACEDECLARATION,t}return i(t,e),t}(ee);t.NamespaceDeclaration=xe;var Ae=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.RETURN,t}return i(t,e),t}(J);t.ReturnStatement=Ae;var Ne=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.SWITCHCASE,t}return i(t,e),t}(l);t.SwitchCase=Ne;var Se=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.SWITCH,t}return i(t,e),t}(J);t.SwitchStatement=Se;var Oe=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.THROW,t}return i(t,e),t}(J);t.ThrowStatement=Oe;var Ce=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.TRY,t}return i(t,e),t}(J);t.TryStatement=Ce;var ke=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.TYPEDECLARATION,t}return i(t,e),t}(ee);t.TypeDeclaration=ke;var Re=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.VARIABLEDECLARATION,t}return i(t,e),t}(re);t.VariableDeclaration=Re;var Le=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.VARIABLE,t}return i(t,e),t}(J);t.VariableStatement=Le;var Fe=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.VOID,t}return i(t,e),t}(J);t.VoidStatement=Fe;var Be=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.kind=o.WHILE,t}return i(t,e),t}(J);function De(e){return e.endsWith(".ts")&&(e=e.substring(0,e.length-3)),e}t.WhileStatement=Be,t.findDecorator=function(e,t){if(t)for(var r=0,n=t.length;r>>e.size-t},e.prototype.is=function(e){return(this.flags&e)==e},e.prototype.isAny=function(e){return 0!=(this.flags&e)},e.prototype.asClass=function(t){assert(9==this.kind&&!this.classReference);var r=new e(this.kind,-129&this.flags|256,this.size);return r.classReference=t,r},e.prototype.asFunction=function(t){assert(7==this.kind&&!this.signatureReference);var r=new e(this.kind,-129&this.flags|256,this.size);return r.signatureReference=t,r},e.prototype.asNullable=function(){return assert(this.is(256)),this.cachedNullableType||(assert(!this.is(512)),this.cachedNullableType=new e(this.kind,512|this.flags,this.size),this.cachedNullableType.nonNullableType=this,this.cachedNullableType.classReference=this.classReference,this.cachedNullableType.signatureReference=this.signatureReference),this.cachedNullableType},e.prototype.isAssignableTo=function(t,r){var n,i,a,s;if(void 0===r&&(r=!1),this.is(256)){if(t.is(256)&&(!this.is(512)||t.is(512)))if(n=this.classReference){if(i=t.classReference)return n.isAssignableTo(i)}else if((a=this.signatureReference)&&(s=t.signatureReference))return a.isAssignableTo(s)}else if(!t.is(256))if(this.is(4))if(t.is(4)){if(!r||this==e.bool||this.is(1)==t.is(1))return this.size<=t.size}else{if(11==t.kind)return this.size<=23;if(12==t.kind)return this.size<=52}else if(this.is(8)){if(t.is(8))return this.size<=t.size}else if(this.is(1024)&&t.is(1024))return this.size==t.size;return!1},e.prototype.isStrictlyAssignableTo=function(e,t){return void 0===t&&(t=!1),this.is(256)?this.isAssignableTo(e):!e.is(256)&&(this.is(4)?e.is(4)&&e.size==this.size&&(!t||this.is(1)==e.is(1)):this.kind==e.kind)},e.commonDenominator=function(e,t,r){return t.isAssignableTo(e,r)?e:e.isAssignableTo(t,r)?t:null},e.prototype.toString=function(){if(this.is(256)){var e=this.classReference;if(e)return this.is(512)?e.internalName+" | null":e.internalName;var t=this.signatureReference;if(t)return this.is(512)?"("+t.toString()+") | null":t.toString();assert(!1)}switch(this.kind){case 0:return"i8";case 1:return"i16";case 2:return"i32";case 3:return"i64";case 4:return"isize";case 5:return"u8";case 6:return"u16";case 7:return"u32";case 8:return"u64";case 9:return"usize";case 10:return"bool";case 11:return"f32";case 12:return"f64";case 13:return"v128";default:assert(!1);case 14:return"void"}},e.prototype.toNativeType=function(){switch(this.kind){default:return i.NativeType.I32;case 3:case 8:return i.NativeType.I64;case 4:case 9:return 64==this.size?i.NativeType.I64:i.NativeType.I32;case 11:return i.NativeType.F32;case 12:return i.NativeType.F64;case 13:return i.NativeType.V128;case 14:return i.NativeType.None}},e.prototype.toNativeZero=function(e){switch(this.kind){case 14:assert(!1);default:return e.i32(0);case 4:case 9:if(64!=this.size)return e.i32(0);case 3:case 8:return e.i64(0);case 11:return e.f32(0);case 12:return e.f64(0);case 13:return e.v128(a)}},e.prototype.toNativeOne=function(e){switch(this.kind){case 13:case 14:assert(!1);default:return e.i32(1);case 4:case 9:if(64!=this.size)return e.i32(1);case 3:case 8:return e.i64(1);case 11:return e.f32(1);case 12:return e.f64(1)}},e.prototype.toNativeNegOne=function(e){switch(this.kind){case 13:case 14:assert(!1);default:return e.i32(-1);case 4:case 9:if(64!=this.size)return e.i32(-1);case 3:case 8:return e.i64(-1,-1);case 11:return e.f32(-1);case 12:return e.f64(-1)}},e.prototype.toSignatureString=function(){switch(this.kind){case 0:case 5:case 1:case 6:case 2:case 7:case 10:return"i";case 3:case 8:return"j";case 4:case 9:return 64==this.size?"j":"i";case 11:return"f";case 12:return"d";case 13:return"V";case 14:return"v";default:assert(!1)}return"i"},e.i8=new e(0,165,8),e.i16=new e(1,165,16),e.i32=new e(2,133,32),e.i64=new e(3,197,64),e.isize32=new e(4,149,32),e.isize64=new e(4,213,64),e.u8=new e(5,166,8),e.u16=new e(6,166,16),e.u32=new e(7,134,32),e.u64=new e(8,198,64),e.usize32=new e(9,150,32),e.usize64=new e(9,214,64),e.bool=new e(10,166,1),e.f32=new e(11,137,32),e.f64=new e(12,201,64),e.v128=new e(13,1152,128),e.void=new e(14,0,0),e}();t.Type=s,t.typesToNativeTypes=function(e){for(var t=e.length,r=new Array(t),n=0;ne?t[e]:l(e)},e.prototype.isAssignableTo=function(e){var t=this.thisType,r=e.thisType;if(t){if(!r||!t.isAssignableTo(r))return!1}else if(r)return!1;if(this.hasRest!=e.hasRest)return!1;var n=this.parameterTypes,i=e.parameterTypes,a=n.length;if(a!=i.length)return!1;for(var s=0;s=o&&u!=c?e.push("?: "):e.push(": "),e.push(n[u].toString());return e.push(") => "),e.push(this.returnType.toString()),e.join("")},e}();t.Signature=o;var c=null;function l(e){c||(c=[]);for(var t=c.length;t<=e;++t)c.push("arg$"+t.toString(10));return c[e-1]}t.getDefaultParameterName=l},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var a,s,o=r(2),c=r(5),l=r(1);function u(e){switch(assert(e.length),e.charCodeAt(0)){case 97:switch(e){case"abstract":return a.ABSTRACT;case"as":return a.AS;case"async":return a.ASYNC;case"await":return a.AWAIT}break;case 98:switch(e){case"break":return a.BREAK}break;case 99:switch(e){case"case":return a.CASE;case"catch":return a.CATCH;case"class":return a.CLASS;case"continue":return a.CONTINUE;case"const":return a.CONST;case"constructor":return a.CONSTRUCTOR}break;case 100:switch(e){case"debugger":return a.DEBUGGER;case"declare":return a.DECLARE;case"default":return a.DEFAULT;case"delete":return a.DELETE;case"do":return a.DO}break;case 101:switch(e){case"else":return a.ELSE;case"enum":return a.ENUM;case"export":return a.EXPORT;case"extends":return a.EXTENDS}break;case 102:switch(e){case"false":return a.FALSE;case"finally":return a.FINALLY;case"for":return a.FOR;case"from":return a.FROM;case"function":return a.FUNCTION}break;case 103:switch(e){case"get":return a.GET}break;case 105:switch(e){case"if":return a.IF;case"implements":return a.IMPLEMENTS;case"import":return a.IMPORT;case"in":return a.IN;case"instanceof":return a.INSTANCEOF;case"interface":return a.INTERFACE;case"is":return a.IS}break;case 107:switch(e){case"keyof":return a.KEYOF}break;case 108:switch(e){case"let":return a.LET}break;case 109:switch(e){case"module":return a.MODULE}break;case 110:switch(e){case"namespace":return a.NAMESPACE;case"new":return a.NEW;case"null":return a.NULL}break;case 111:switch(e){case"of":return a.OF}break;case 112:switch(e){case"package":return a.PACKAGE;case"private":return a.PRIVATE;case"protected":return a.PROTECTED;case"public":return a.PUBLIC}break;case 114:switch(e){case"readonly":return a.READONLY;case"return":return a.RETURN}break;case 115:switch(e){case"set":return a.SET;case"static":return a.STATIC;case"super":return a.SUPER;case"switch":return a.SWITCH}break;case 116:switch(e){case"this":return a.THIS;case"throw":return a.THROW;case"true":return a.TRUE;case"try":return a.TRY;case"type":return a.TYPE;case"typeof":return a.TYPEOF}break;case 118:switch(e){case"var":return a.VAR;case"void":return a.VOID}break;case 119:switch(e){case"while":return a.WHILE;case"with":return a.WITH}break;case 121:switch(e){case"yield":return a.YIELD}}return a.INVALID}function p(e){switch(e){case a.ABSTRACT:case a.AS:case a.CONSTRUCTOR:case a.DECLARE:case a.DELETE:case a.FROM:case a.FOR:case a.GET:case a.INSTANCEOF:case a.IS:case a.KEYOF:case a.MODULE:case a.NAMESPACE:case a.READONLY:case a.SET:case a.TYPE:case a.VOID:return!0;default:return!1}}!function(e){e[e.ABSTRACT=0]="ABSTRACT",e[e.AS=1]="AS",e[e.ASYNC=2]="ASYNC",e[e.AWAIT=3]="AWAIT",e[e.BREAK=4]="BREAK",e[e.CASE=5]="CASE",e[e.CATCH=6]="CATCH",e[e.CLASS=7]="CLASS",e[e.CONST=8]="CONST",e[e.CONTINUE=9]="CONTINUE",e[e.CONSTRUCTOR=10]="CONSTRUCTOR",e[e.DEBUGGER=11]="DEBUGGER",e[e.DECLARE=12]="DECLARE",e[e.DEFAULT=13]="DEFAULT",e[e.DELETE=14]="DELETE",e[e.DO=15]="DO",e[e.ELSE=16]="ELSE",e[e.ENUM=17]="ENUM",e[e.EXPORT=18]="EXPORT",e[e.EXTENDS=19]="EXTENDS",e[e.FALSE=20]="FALSE",e[e.FINALLY=21]="FINALLY",e[e.FOR=22]="FOR",e[e.FROM=23]="FROM",e[e.FUNCTION=24]="FUNCTION",e[e.GET=25]="GET",e[e.IF=26]="IF",e[e.IMPLEMENTS=27]="IMPLEMENTS",e[e.IMPORT=28]="IMPORT",e[e.IN=29]="IN",e[e.INSTANCEOF=30]="INSTANCEOF",e[e.INTERFACE=31]="INTERFACE",e[e.IS=32]="IS",e[e.KEYOF=33]="KEYOF",e[e.LET=34]="LET",e[e.MODULE=35]="MODULE",e[e.NAMESPACE=36]="NAMESPACE",e[e.NEW=37]="NEW",e[e.NULL=38]="NULL",e[e.OF=39]="OF",e[e.PACKAGE=40]="PACKAGE",e[e.PRIVATE=41]="PRIVATE",e[e.PROTECTED=42]="PROTECTED",e[e.PUBLIC=43]="PUBLIC",e[e.READONLY=44]="READONLY",e[e.RETURN=45]="RETURN",e[e.SET=46]="SET",e[e.STATIC=47]="STATIC",e[e.SUPER=48]="SUPER",e[e.SWITCH=49]="SWITCH",e[e.THIS=50]="THIS",e[e.THROW=51]="THROW",e[e.TRUE=52]="TRUE",e[e.TRY=53]="TRY",e[e.TYPE=54]="TYPE",e[e.TYPEOF=55]="TYPEOF",e[e.VAR=56]="VAR",e[e.VOID=57]="VOID",e[e.WHILE=58]="WHILE",e[e.WITH=59]="WITH",e[e.YIELD=60]="YIELD",e[e.OPENBRACE=61]="OPENBRACE",e[e.CLOSEBRACE=62]="CLOSEBRACE",e[e.OPENPAREN=63]="OPENPAREN",e[e.CLOSEPAREN=64]="CLOSEPAREN",e[e.OPENBRACKET=65]="OPENBRACKET",e[e.CLOSEBRACKET=66]="CLOSEBRACKET",e[e.DOT=67]="DOT",e[e.DOT_DOT_DOT=68]="DOT_DOT_DOT",e[e.SEMICOLON=69]="SEMICOLON",e[e.COMMA=70]="COMMA",e[e.LESSTHAN=71]="LESSTHAN",e[e.GREATERTHAN=72]="GREATERTHAN",e[e.LESSTHAN_EQUALS=73]="LESSTHAN_EQUALS",e[e.GREATERTHAN_EQUALS=74]="GREATERTHAN_EQUALS",e[e.EQUALS_EQUALS=75]="EQUALS_EQUALS",e[e.EXCLAMATION_EQUALS=76]="EXCLAMATION_EQUALS",e[e.EQUALS_EQUALS_EQUALS=77]="EQUALS_EQUALS_EQUALS",e[e.EXCLAMATION_EQUALS_EQUALS=78]="EXCLAMATION_EQUALS_EQUALS",e[e.EQUALS_GREATERTHAN=79]="EQUALS_GREATERTHAN",e[e.PLUS=80]="PLUS",e[e.MINUS=81]="MINUS",e[e.ASTERISK_ASTERISK=82]="ASTERISK_ASTERISK",e[e.ASTERISK=83]="ASTERISK",e[e.SLASH=84]="SLASH",e[e.PERCENT=85]="PERCENT",e[e.PLUS_PLUS=86]="PLUS_PLUS",e[e.MINUS_MINUS=87]="MINUS_MINUS",e[e.LESSTHAN_LESSTHAN=88]="LESSTHAN_LESSTHAN",e[e.GREATERTHAN_GREATERTHAN=89]="GREATERTHAN_GREATERTHAN",e[e.GREATERTHAN_GREATERTHAN_GREATERTHAN=90]="GREATERTHAN_GREATERTHAN_GREATERTHAN",e[e.AMPERSAND=91]="AMPERSAND",e[e.BAR=92]="BAR",e[e.CARET=93]="CARET",e[e.EXCLAMATION=94]="EXCLAMATION",e[e.TILDE=95]="TILDE",e[e.AMPERSAND_AMPERSAND=96]="AMPERSAND_AMPERSAND",e[e.BAR_BAR=97]="BAR_BAR",e[e.QUESTION=98]="QUESTION",e[e.COLON=99]="COLON",e[e.EQUALS=100]="EQUALS",e[e.PLUS_EQUALS=101]="PLUS_EQUALS",e[e.MINUS_EQUALS=102]="MINUS_EQUALS",e[e.ASTERISK_EQUALS=103]="ASTERISK_EQUALS",e[e.ASTERISK_ASTERISK_EQUALS=104]="ASTERISK_ASTERISK_EQUALS",e[e.SLASH_EQUALS=105]="SLASH_EQUALS",e[e.PERCENT_EQUALS=106]="PERCENT_EQUALS",e[e.LESSTHAN_LESSTHAN_EQUALS=107]="LESSTHAN_LESSTHAN_EQUALS",e[e.GREATERTHAN_GREATERTHAN_EQUALS=108]="GREATERTHAN_GREATERTHAN_EQUALS",e[e.GREATERTHAN_GREATERTHAN_GREATERTHAN_EQUALS=109]="GREATERTHAN_GREATERTHAN_GREATERTHAN_EQUALS",e[e.AMPERSAND_EQUALS=110]="AMPERSAND_EQUALS",e[e.BAR_EQUALS=111]="BAR_EQUALS",e[e.CARET_EQUALS=112]="CARET_EQUALS",e[e.AT=113]="AT",e[e.IDENTIFIER=114]="IDENTIFIER",e[e.STRINGLITERAL=115]="STRINGLITERAL",e[e.INTEGERLITERAL=116]="INTEGERLITERAL",e[e.FLOATLITERAL=117]="FLOATLITERAL",e[e.INVALID=118]="INVALID",e[e.ENDOFFILE=119]="ENDOFFILE"}(a=t.Token||(t.Token={})),function(e){e[e.DEFAULT=0]="DEFAULT",e[e.PREFER=1]="PREFER",e[e.ALWAYS=2]="ALWAYS"}(s=t.IdentifierHandling||(t.IdentifierHandling={})),t.tokenFromKeyword=u,t.tokenIsAlsoIdentifier=p,t.operatorTokenToString=function(e){switch(e){case a.DELETE:return"delete";case a.IN:return"in";case a.INSTANCEOF:return"instanceof";case a.NEW:return"new";case a.TYPEOF:return"typeof";case a.VOID:return"void";case a.YIELD:return"yield";case a.DOT_DOT_DOT:return"...";case a.COMMA:return",";case a.LESSTHAN:return"<";case a.GREATERTHAN:return">";case a.LESSTHAN_EQUALS:return"<=";case a.GREATERTHAN_EQUALS:return">=";case a.EQUALS_EQUALS:return"==";case a.EXCLAMATION_EQUALS:return"!=";case a.EQUALS_EQUALS_EQUALS:return"===";case a.EXCLAMATION_EQUALS_EQUALS:return"!==";case a.PLUS:return"+";case a.MINUS:return"-";case a.ASTERISK_ASTERISK:return"**";case a.ASTERISK:return"*";case a.SLASH:return"/";case a.PERCENT:return"%";case a.PLUS_PLUS:return"++";case a.MINUS_MINUS:return"--";case a.LESSTHAN_LESSTHAN:return"<<";case a.GREATERTHAN_GREATERTHAN:return">>";case a.GREATERTHAN_GREATERTHAN_GREATERTHAN:return">>>";case a.AMPERSAND:return"&";case a.BAR:return"|";case a.CARET:return"^";case a.EXCLAMATION:return"!";case a.TILDE:return"~";case a.AMPERSAND_AMPERSAND:return"&&";case a.BAR_BAR:return"||";case a.EQUALS:return"=";case a.PLUS_EQUALS:return"+=";case a.MINUS_EQUALS:return"-=";case a.ASTERISK_EQUALS:return"*=";case a.ASTERISK_ASTERISK_EQUALS:return"**=";case a.SLASH_EQUALS:return"/=";case a.PERCENT_EQUALS:return"%=";case a.LESSTHAN_LESSTHAN_EQUALS:return"<<=";case a.GREATERTHAN_GREATERTHAN_EQUALS:return">>=";case a.GREATERTHAN_GREATERTHAN_GREATERTHAN_EQUALS:return">>>=";case a.AMPERSAND_EQUALS:return"&=";case a.BAR_EQUALS:return"|=";case a.CARET_EQUALS:return"^=";default:return assert(!1),""}};var _=function(){function e(e,t,r){this.debugInfoRef=0,this.source=e,this.start=t,this.end=r}return e.join=function(t,r){if(t.source!=r.source)throw new Error("source mismatch");return new e(t.source,t.startr.end?t.end:r.end)},Object.defineProperty(e.prototype,"atStart",{get:function(){return new e(this.source,this.start,this.start)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"atEnd",{get:function(){return new e(this.source,this.end,this.end)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"line",{get:function(){for(var e=this.source.text,t=1,r=this.start;r>=0;--r)10==e.charCodeAt(r)&&t++;return t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"column",{get:function(){for(var e=this.source.text,t=0,r=this.start-1;r>=0&&10!=e.charCodeAt(r);--r)++t;return t},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return this.source.text.substring(this.start,this.end)},e}();t.Range=_;var h=function(e){function t(t,r){void 0===r&&(r=null);var n=e.call(this,r)||this;n.end=0,n.pos=0,n.token=-1,n.tokenPos=0,n.nextToken=-1,n.nextTokenPos=0,n.nextTokenOnNewLine=!1,n.onComment=null,n.source=t,n.pos=0,n.end=t.text.length,n.diagnostics=r||new Array;var i=n.end,a=t.text;if(n.pos1&&this.pos2&&this.pos1&&this.pos1&&this.pos1&&this.pos2&&this.pos1&&this.pos1&&this.pos1&&this.pos2&&this.pos+11&&this.pos1&&this.pos2&&this.pos1&&this.pos2&&this.pos1&&this.pos2&&this.pos3&&this.pos1&&this.pos1&&this.pos=n){i+=e.substring(r,this.pos),this.error(o.DiagnosticCode.Unterminated_string_literal,this.range(r-1,n));break}var a=e.charCodeAt(this.pos);if(a==t){i+=e.substring(r,this.pos++);break}if(92!=a){if(l.isLineBreak(a)){i+=e.substring(r,this.pos),this.error(o.DiagnosticCode.Unterminated_string_literal,this.range(r-1,this.pos));break}++this.pos}else i+=e.substring(r,this.pos),i+=this.readEscapeSequence(),r=this.pos}return i},t.prototype.readEscapeSequence=function(){var e=this.end;if(++this.pos>=e)return this.error(o.DiagnosticCode.Unexpected_end_of_text,this.range(e)),"";var t=this.source.text,r=t.charCodeAt(this.pos++);switch(r){case 48:return"\0";case 98:return"\b";case 116:return"\t";case 110:return"\n";case 118:return"\v";case 102:return"\f";case 114:return"\r";case 39:return"'";case 34:return'"';case 117:return this.pos=r){this.error(o.DiagnosticCode.Unterminated_regular_expression_literal,this.range(t,r));break}if(92!=e.charCodeAt(this.pos)){var i=e.charCodeAt(this.pos);if(!n&&47==i)break;if(l.isLineBreak(i)){this.error(o.DiagnosticCode.Unterminated_regular_expression_literal,this.range(t,this.pos));break}++this.pos,n=!1}else++this.pos,n=!0}return e.substring(t,this.pos)},t.prototype.readRegexpFlags=function(){for(var e=this.source.text,t=this.pos,r=this.end,n=0;this.pos57)&&95!=n)break;r++}return!0},t.prototype.readInteger=function(){var e=this.source.text;if(this.pos+2=48&&c<=57)r=i64_add(i64_shl(r,n),i64_new(c-48));else if(c>=65&&c<=70)r=i64_add(i64_shl(r,n),i64_new(10+c-65));else if(c>=97&&c<=102)r=i64_add(i64_shl(r,n),i64_new(10+c-97));else{if(95!=c)break;i==s&&this.error(i==t?o.DiagnosticCode.Numeric_separators_are_not_allowed_here:o.DiagnosticCode.Multiple_consecutive_numeric_separators_are_not_permitted,this.range(s)),i=s+1}this.pos=s+1}return this.pos==t?this.error(o.DiagnosticCode.Hexadecimal_digit_expected,this.range(t)):i==this.pos&&this.error(o.DiagnosticCode.Numeric_separators_are_not_allowed_here,this.range(i-1)),r},t.prototype.readDecimalInteger=function(){for(var e=this.source.text,t=this.pos,r=this.end,n=i64_new(0),i=i64_new(10),a=t;this.pos=48&&c<=57)n=i64_add(i64_mul(n,i),i64_new(c-48));else{if(95!=c)break;a==s&&this.error(a==t?o.DiagnosticCode.Numeric_separators_are_not_allowed_here:o.DiagnosticCode.Multiple_consecutive_numeric_separators_are_not_permitted,this.range(s)),a=s+1}this.pos=s+1}return this.pos==t?this.error(o.DiagnosticCode.Digit_expected,this.range(t)):a==this.pos&&this.error(o.DiagnosticCode.Numeric_separators_are_not_allowed_here,this.range(a-1)),n},t.prototype.readOctalInteger=function(){for(var e=this.source.text,t=this.pos,r=i64_new(0),n=i64_new(3),i=t,a=this.end;this.pos=48&&c<=55)r=i64_add(i64_shl(r,n),i64_new(c-48));else{if(95!=c)break;i==s&&this.error(i==t?o.DiagnosticCode.Numeric_separators_are_not_allowed_here:o.DiagnosticCode.Multiple_consecutive_numeric_separators_are_not_permitted,this.range(s)),i=s+1}++this.pos}return this.pos==t?this.error(o.DiagnosticCode.Octal_digit_expected,this.range(t)):i==this.pos&&this.error(o.DiagnosticCode.Numeric_separators_are_not_allowed_here,this.range(i-1)),r},t.prototype.readBinaryInteger=function(){for(var e=this.source.text,t=this.pos,r=i64_new(0),n=i64_new(1),i=t,a=this.end;this.pos=48&&i<=57)t=(t<<4)+i-48;else if(i>=65&&i<=70)t=(t<<4)+i+-55;else{if(!(i>=97&&i<=102))return this.error(o.DiagnosticCode.Hexadecimal_digit_expected,this.range(this.pos-1,this.pos)),"";t=(t<<4)+i+-87}if(0==--e)break}return e?(this.error(o.DiagnosticCode.Unexpected_end_of_text,this.range(this.pos)),""):String.fromCharCode(t)},t.prototype.readExtendedUnicodeEscape=function(){var e=this.pos,t=this.readHexInteger(),r=i64_low(t),n=!1;assert(!i64_high(t)),r>1114111&&(this.error(o.DiagnosticCode.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive,this.range(e,this.pos)),n=!0);var i=this.end,a=this.source.text;return this.pos>=i?(this.error(o.DiagnosticCode.Unexpected_end_of_text,this.range(e,i)),n=!0):125==a.charCodeAt(this.pos)?++this.pos:(this.error(o.DiagnosticCode.Unterminated_Unicode_escape_sequence,this.range(e,this.pos)),n=!0),n?"":r<65536?String.fromCharCode(r):String.fromCharCode(55296+(r-65536>>>10),56320+(r-65536&1023))},t.prototype.finish=function(){},t}(o.DiagnosticEmitter);t.Tokenizer=h;var d=function(){return function(){}}();t.State=d;var y=null},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__values||function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}},s=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return s};Object.defineProperty(t,"__esModule",{value:!0});var o,c=r(2),l=r(3),u=r(5),p=r(6),_=r(0),h=r(1),d=r(7),y=r(13);!function(e){e[e.REPORT=0]="REPORT",e[e.SWALLOW=1]="SWALLOW"}(o=t.ReportMode||(t.ReportMode={}));var m=function(e){function t(t){var r=e.call(this,t.diagnostics)||this;return r.currentThisExpression=null,r.currentElementExpression=null,r.program=t,r}return i(t,e),t.prototype.resolveType=function(e,t,r,n){if(void 0===r&&(r=null),void 0===n&&(n=o.REPORT),e.kind==u.NodeKind.SIGNATURE){var i=e.explicitThisType,a=null;if(i&&!(a=this.resolveType(i,t,r,n)))return null;for(var s=e.parameters,d=s.length,y=new Array(d),m=new Array(d),f=0,T=!1,g=0;gl)return this.error(c.DiagnosticCode.Expected_0_type_arguments_but_got_1,d?u.Range.join(t[0].range,t[d-1].range):assert(i).range,(d0)return this.resolveExpression(e.arguments[0],t,r,n);var s=this.resolveFunctionInclTypeArguments(a,e.typeArguments,t.actualFunction,h.makeMap(t.contextualTypeArguments),e,n);if(!s)return null;var u=s.signature.returnType,_=u.classReference;if(_)return _;var d=u.signatureReference;return d?d.asFunctionTarget(this.program):(n==o.REPORT&&this.error(c.DiagnosticCode.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures,i.range,a.internalName),null)}return n==o.REPORT&&this.error(c.DiagnosticCode.Operation_not_supported,e.range),null},t.prototype.resolveFunction=function(e,t,r,n){void 0===r&&(r=h.makeMap()),void 0===n&&(n=o.REPORT);var i=e.parent.kind==l.ElementKind.PROPERTY_PROTOTYPE?e.parent.parent:e.parent,a=null,s=t?p.typesToString(t):"";if(e.is(_.CommonFlags.INSTANCE)){if(assert(i.kind==l.ElementKind.CLASS),a=i,g=e.getResolvedInstance(s))return g;var d=a.typeArguments;if(d){var y=assert(a.prototype.typeParameterNodes),m=y.length;assert(m==y.length);for(var f=0;f");var w=new l.Function(P,e,D,r);return e.setResolvedInstance(s,w),w},t.prototype.resolveFunctionInclTypeArguments=function(e,t,r,n,i,a){void 0===a&&(a=o.REPORT);var s=e.parent.kind==l.ElementKind.PROPERTY_PROTOTYPE?e.parent.parent:e.parent,u=null;if(e.is(_.CommonFlags.GENERIC)){if(e.is(_.CommonFlags.INSTANCE)){assert(s.kind==l.ElementKind.CLASS);var p=s.typeArguments;if(p){var h=assert(s.prototype.typeParameterNodes),d=p.length;assert(d==h.length);for(var y=0;y"),(g=new l.Class(S,e,t,A)).contextualTypeArguments=r,e.setResolvedInstance(T,g);var O=0;if(A){if(G=A.members){(U=g.members)||(g.members=U=new Map);try{for(var C=a(G),k=C.next();!k.done;k=C.next()){var R=s(k.value,2),L=R[0],F=R[1];U.set(L,F)}}catch(e){i={error:e}}finally{try{k&&!k.done&&(u=C.return)&&u.call(C)}finally{if(i)throw i.error}}}O=A.currentMemoryOffset}var B=e.instanceMembers;if(B)try{for(var D=a(B.values()),P=D.next();!P.done;P=D.next()){var w=P.value;switch(w.kind){case l.ElementKind.FIELD_PROTOTYPE:var U;if(U=g.members){if(U.has(w.name)){this.error(c.DiagnosticCode.Duplicate_identifier_0,w.identifierNode.range,w.name);break}}else g.members=U=new Map;var M=w.typeNode,V=null;if(M)V=this.resolveType(M,e.parent,g.contextualTypeArguments,n);else{var G;if(A)if((G=A.members)&&G.has(w.name)){var K=G.get(w.name);K.is(_.CommonFlags.PRIVATE)||(assert(K.kind==l.ElementKind.FIELD),V=K.type)}V||n==o.REPORT&&this.error(c.DiagnosticCode.Type_expected,w.identifierNode.range.atEnd)}if(!V)break;var z=new l.Field(w,g,V);assert(h.isPowerOf2(V.byteSize));var Y=V.byteSize-1;O&Y&&(O=1+(O|Y)),z.memoryOffset=O,O+=V.byteSize,g.add(w.name,z);break;case l.ElementKind.FUNCTION_PROTOTYPE:var H=w.toBound(g);g.add(H.name,H);break;case l.ElementKind.PROPERTY_PROTOTYPE:var W=new l.Property(w,g),X=w.getterPrototype;if(X){var q=this.resolveFunction(X.toBound(g),null,h.makeMap(g.contextualTypeArguments),n);q&&(W.getterInstance=q,W.setType(q.signature.returnType))}var Q=w.setterPrototype;if(Q){var j=this.resolveFunction(Q.toBound(g),null,h.makeMap(g.contextualTypeArguments),n);j&&(W.setterInstance=j,W.is(_.CommonFlags.RESOLVED)||(assert(1==j.signature.parameterTypes.length),W.setType(j.signature.parameterTypes[0])))}g.add(W.name,W);break;default:assert(!1)}}}catch(e){d={error:e}}finally{try{P&&!P.done&&(y=D.return)&&y.call(D)}finally{if(d)throw d.error}}g.currentMemoryOffset=O;var Z=g.lookupInSelf(_.CommonSymbols.constructor);if(Z&&Z.parent===g){assert(Z.kind==l.ElementKind.FUNCTION_PROTOTYPE);var J=this.resolveFunction(Z,null,g.contextualTypeArguments,n);J&&(g.constructorInstance=J)}try{for(var $=a(e.overloadPrototypes),ee=$.next();!ee.done;ee=$.next()){var te=s(ee.value,2),re=te[0],ne=te[1];assert(re!=l.OperatorKind.INVALID);var ie=void 0;if(ne.is(_.CommonFlags.INSTANCE)){H=ne.toBound(g);ie=this.resolveFunction(H,null,h.makeMap(),n)}else ie=this.resolveFunction(ne,null,h.makeMap(),n);if(ie){var ae=g.overloads;ae||(g.overloads=ae=new Map),ae.set(re,ie)}}}catch(e){m={error:e}}finally{try{ee&&!ee.done&&(f=$.return)&&f.call($)}finally{if(m)throw m.error}}return g},t.prototype.resolveClassInclTypeArguments=function(e,t,r,n,i,a){void 0===a&&(a=o.REPORT);var s=null;if(e.is(_.CommonFlags.GENERIC)){if(!(s=this.resolveTypeArguments(assert(e.typeParameterNodes),t,r,n,i,a)))return null}else if(null!==t&&t.length)return a==o.REPORT&&this.error(c.DiagnosticCode.Type_0_is_not_generic,i.range,e.internalName),null;return this.resolveClass(e,s,n,a)},t}(c.DiagnosticEmitter);t.Resolver=m},function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}};Object.defineProperty(t,"__esModule",{value:!0});var i,a=r(6),s=r(3),o=r(4),c=r(0),l=r(2);!function(e){e[e.NONE=0]="NONE",e[e.RETURNS=1]="RETURNS",e[e.RETURNS_WRAPPED=2]="RETURNS_WRAPPED",e[e.RETURNS_NONNULL=4]="RETURNS_NONNULL",e[e.THROWS=8]="THROWS",e[e.BREAKS=16]="BREAKS",e[e.CONTINUES=32]="CONTINUES",e[e.ALLOCATES=64]="ALLOCATES",e[e.CALLS_SUPER=128]="CALLS_SUPER",e[e.CONDITIONALLY_RETURNS=256]="CONDITIONALLY_RETURNS",e[e.CONDITIONALLY_THROWS=512]="CONDITIONALLY_THROWS",e[e.CONDITIONALLY_BREAKS=1024]="CONDITIONALLY_BREAKS",e[e.CONDITIONALLY_CONTINUES=2048]="CONDITIONALLY_CONTINUES",e[e.CONDITIONALLY_ALLOCATES=4096]="CONDITIONALLY_ALLOCATES",e[e.INLINE_CONTEXT=8192]="INLINE_CONTEXT",e[e.UNCHECKED_CONTEXT=16384]="UNCHECKED_CONTEXT",e[e.ANY_TERMINATING=57]="ANY_TERMINATING",e[e.ANY_CATEGORICAL=255]="ANY_CATEGORICAL",e[e.ANY_CONDITIONAL=7936]="ANY_CONDITIONAL"}(t.FlowFlags||(t.FlowFlags={})),function(e){e[e.NONE=0]="NONE",e[e.CONSTANT=1]="CONSTANT",e[e.WRAPPED=2]="WRAPPED",e[e.NONNULL=4]="NONNULL",e[e.READFROM=8]="READFROM",e[e.WRITTENTO=16]="WRITTENTO",e[e.RETAINED=32]="RETAINED",e[e.CONDITIONALLY_READFROM=64]="CONDITIONALLY_READFROM",e[e.CONDITIONALLY_WRITTENTO=128]="CONDITIONALLY_WRITTENTO",e[e.CONDITIONALLY_RETAINED=256]="CONDITIONALLY_RETAINED",e[e.ANY_CATEGORICAL=63]="ANY_CATEGORICAL",e[e.ANY_CONDITIONAL=480]="ANY_CONDITIONAL",e[e.ANY_RETAINED=288]="ANY_RETAINED"}(i=t.LocalFlags||(t.LocalFlags={})),function(e){e.join=function(t,r){return t&e.ANY_CATEGORICAL&r&e.ANY_CATEGORICAL|t&e.ANY_CONDITIONAL|r&e.ANY_CONDITIONAL}}(i=t.LocalFlags||(t.LocalFlags={})),function(e){e[e.NONE=0]="NONE",e[e.INITIALIZED=1]="INITIALIZED",e[e.CONDITIONALLY_INITIALIZED=2]="CONDITIONALLY_INITIALIZED",e[e.ANY_CATEGORICAL=1]="ANY_CATEGORICAL",e[e.ANY_CONDITIONAL=2]="ANY_CONDITIONAL"}(t.FieldFlags||(t.FieldFlags={})),function(e){e.join=function(t,r){return t&e.ANY_CATEGORICAL&r&e.ANY_CATEGORICAL|t&e.ANY_CONDITIONAL|r&e.ANY_CONDITIONAL}}(t.FieldFlags||(t.FieldFlags={}));var u=function(){function e(){this.scopedLocals=null,this.fieldFlags=null}return e.create=function(t){var r=new e;return r.parent=null,r.flags=0,r.parentFunction=t,r.continueLabel=null,r.breakLabel=null,r.returnType=t.signature.returnType,r.contextualTypeArguments=t.contextualTypeArguments,r.localFlags=[],r.inlineFunction=null,r.inlineReturnLabel=null,r},e.createInline=function(t,r){var n=e.create(t);return n.set(8192),n.inlineFunction=r,n.inlineReturnLabel=r.internalName+"|inlined."+(r.nextInlineId++).toString(10),n.returnType=r.signature.returnType,n.contextualTypeArguments=r.contextualTypeArguments,n},Object.defineProperty(e.prototype,"actualFunction",{get:function(){return this.inlineFunction||this.parentFunction},enumerable:!0,configurable:!0}),e.prototype.is=function(e){return(this.flags&e)==e},e.prototype.isAny=function(e){return 0!=(this.flags&e)},e.prototype.set=function(e){this.flags|=e},e.prototype.unset=function(e){this.flags&=~e},e.prototype.fork=function(){var t=new e;return t.parent=this,t.flags=this.flags,t.parentFunction=this.parentFunction,t.continueLabel=this.continueLabel,t.breakLabel=this.breakLabel,t.returnType=this.returnType,t.contextualTypeArguments=this.contextualTypeArguments,t.localFlags=this.localFlags.slice(),t.inlineFunction=this.inlineFunction,t.inlineReturnLabel=this.inlineReturnLabel,t},e.prototype.getTempLocal=function(e,t){void 0===t&&(t=null);var r,n,i=this.parentFunction;switch(e.toNativeType()){case o.NativeType.I32:r=i.tempI32s;break;case o.NativeType.I64:r=i.tempI64s;break;case o.NativeType.F32:r=i.tempF32s;break;case o.NativeType.F64:r=i.tempF64s;break;case o.NativeType.V128:r=i.tempV128s;break;default:throw new Error("concrete type expected")}if(t){if(r&&r.length)for(var a=0,s=r.length;a=0);var t,r=this.parentFunction;switch(assert(null!=e.type),e.type.toNativeType()){case o.NativeType.I32:t=r.tempI32s||(r.tempI32s=[]);break;case o.NativeType.I64:t=r.tempI64s||(r.tempI64s=[]);break;case o.NativeType.F32:t=r.tempF32s||(r.tempF32s=[]);break;case o.NativeType.F64:t=r.tempF64s||(r.tempF64s=[]);break;case o.NativeType.V128:t=r.tempV128s||(r.tempV128s=[]);break;default:throw new Error("concrete type expected")}assert(e.index>=0),t.push(e)}},e.prototype.getAndFreeTempLocal=function(e,t){void 0===t&&(t=null);var r=this.getTempLocal(e,t);return this.freeTempLocal(r),r},e.prototype.getScopedLocal=function(e){var t=this.scopedLocals;return t&&t.has(e)?t.get(e):null},e.prototype.addScopedLocal=function(e,t,r){void 0===r&&(r=null);var n=this.getTempLocal(t,r),i=this.scopedLocals;return i?assert(!i.has(e)):this.scopedLocals=i=new Map,n.set(c.CommonFlags.SCOPED),i.set(e,n),n},e.prototype.addScopedAlias=function(e,t,r,n){if(void 0===n&&(n=null),this.scopedLocals){var i=this.scopedLocals.get(e);if(i)return n&&this.parentFunction.program.error(l.DiagnosticCode.Duplicate_identifier_0,n.range),i}else this.scopedLocals=new Map;assert(r1?e.breakLabel=t[r-2].toString(10):(e.breakLabel=null,e.breakStack=null)},e.prototype.inherit=function(e){this.flags|=8191&e.flags,this.localFlags=e.localFlags},e.prototype.inheritConditional=function(e){e.is(1)&&this.set(256),e.is(8)&&this.set(512),e.is(16)&&e.breakLabel==this.breakLabel&&this.set(1024),e.is(32)&&e.continueLabel==this.continueLabel&&this.set(2048),e.is(64)&&this.set(4096);for(var t=e.localFlags,r=0,n=t.length;rl):this.canOverflow(o.getBinaryLeft(e),t)&&!(o.getExpressionId(r=o.getBinaryRight(e))==o.ExpressionId.Const&&o.getConstValueI32(r)>=l);case o.BinaryOp.DivU32:case o.BinaryOp.RemI32:case o.BinaryOp.RemU32:return this.canOverflow(o.getBinaryLeft(e),t)||this.canOverflow(o.getBinaryRight(e),t)}break;case o.ExpressionId.Unary:switch(o.getUnaryOp(e)){case o.UnaryOp.EqzI32:case o.UnaryOp.EqzI64:return!1;case o.UnaryOp.ClzI32:case o.UnaryOp.CtzI32:case o.UnaryOp.PopcntI32:return t.size<7}break;case o.ExpressionId.Const:var u=0;switch(o.getExpressionType(e)){case o.NativeType.I32:u=o.getConstValueI32(e);break;case o.NativeType.I64:u=o.getConstValueI64Low(e);break;case o.NativeType.F32:u=i32(o.getConstValueF32(e));break;case o.NativeType.F64:u=i32(o.getConstValueF64(e));break;default:assert(!1)}switch(t.kind){case 0:return ui8.MAX_VALUE;case 1:return ui16.MAX_VALUE;case 5:return u<0||u>u8.MAX_VALUE;case 6:return u<0||u>u16.MAX_VALUE;case 10:return 0!=(-2&u)}break;case o.ExpressionId.Load:var _=void 0,h=o.isLoadSigned(e);switch(o.getLoadBytes(e)){case 1:_=h?a.Type.i8:a.Type.u8;break;case 2:_=h?a.Type.i16:a.Type.u16;break;default:_=h?a.Type.i32:a.Type.u32}return p(_,t);case o.ExpressionId.Block:if(!o.getBlockName(e)){var d=assert(o.getBlockChildCount(e)),y=o.getBlockChild(e,d-1);return this.canOverflow(y,t)}break;case o.ExpressionId.If:return this.canOverflow(o.getIfTrue(e),t)||this.canOverflow(assert(o.getIfFalse(e)),t);case o.ExpressionId.Select:return this.canOverflow(o.getSelectThen(e),t)||this.canOverflow(o.getSelectElse(e),t);case o.ExpressionId.Call:var m=this.parentFunction.program.instancesByName,f=assert(o.getCallTarget(e));if(m.has(f)){var T=m.get(f);assert(T.kind==s.ElementKind.FUNCTION);var g=T.signature.returnType;return!T.flow.is(2)||p(g,t)}return!1;case o.ExpressionId.Unreachable:return!1}return!0},e.prototype.toString=function(){for(var e=0,t=this.parent;t;)t=t.parent,++e;return"Flow("+this.actualFunction+")["+e.toString()+"]"},e}();function p(e,t){return!e.is(4)||e.size>t.size||e.is(1)!=t.is(1)}function _(e,t){switch(o.getExpressionId(e)){case o.ExpressionId.LocalGet:t.add(o.getLocalGetIndex(e));break;case o.ExpressionId.LocalSet:t.add(o.getLocalSetIndex(e));default:o.traverse(e,t,_)}}t.Flow=u,t.findUsedLocals=function(e,t){return void 0===t&&(t=new Set),o.traverse(e,t,_),t}},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__values||function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}},s=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return s};Object.defineProperty(t,"__esModule",{value:!0});var o=r(13),c=r(2),l=r(4),u=r(0),p=r(3),_=r(10),h=r(9),d=r(7),y=r(5),m=r(6),f=r(1),T=function(){function e(){this.target=u.Target.WASM32,this.noAssert=!1,this.importMemory=!1,this.sharedMemory=0,this.importTable=!1,this.sourceMap=!1,this.explicitStart=!1,this.memoryBase=0,this.globalAliases=null,this.features=0,this.optimizeLevelHint=0,this.shrinkLevelHint=0}return Object.defineProperty(e.prototype,"isWasm64",{get:function(){return this.target==u.Target.WASM64},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"usizeType",{get:function(){return this.target==u.Target.WASM64?m.Type.usize64:m.Type.usize32},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isizeType",{get:function(){return this.target==u.Target.WASM64?m.Type.isize64:m.Type.isize32},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nativeSizeType",{get:function(){return this.target==u.Target.WASM64?l.NativeType.I64:l.NativeType.I32},enumerable:!0,configurable:!0}),e.prototype.hasFeature=function(e){return 0!=(this.features&e)},e}();t.Options=T,function(e){e[e.NONE=0]="NONE",e[e.IMPLICIT=1]="IMPLICIT",e[e.EXPLICIT=2]="EXPLICIT",e[e.WRAP=4]="WRAP",e[e.WILL_DROP=8]="WILL_DROP",e[e.SKIP_AUTORELEASE=16]="SKIP_AUTORELEASE",e[e.LAST_IN_BODY=32]="LAST_IN_BODY",e[e.STATIC_CAPABLE=64]="STATIC_CAPABLE"}(t.ContextualFlags||(t.ContextualFlags={})),function(e){e[e.NONE=0]="NONE",e[e.HEAP=1]="HEAP",e[e.RTTI=2]="RTTI",e[e.visitGlobals=4]="visitGlobals",e[e.visitMembers=8]="visitMembers"}(t.RuntimeFeatures||(t.RuntimeFeatures={}));var g,E,v=function(e){function t(t,r){void 0===r&&(r=null);var n=e.call(this,t.diagnostics)||this;n.currentInlineFunctions=[],n.currentEnum=null,n.currentType=m.Type.void,n.memorySegments=[],n.stringSegments=new Map,n.functionTable=["null"],n.argcVar=0,n.argcSet=0,n.runtimeFeatures=0,n.skippedAutoreleases=new Set,n.f32ModInstance=null,n.f64ModInstance=null,n.f32PowInstance=null,n.f64PowInstance=null,n.program=t,n.resolver=t.resolver,r||(r=new T),n.options=r,n.memoryOffset=i64_new(max(r.memoryBase,8)),n.module=l.Module.create();var i=0;return n.options.hasFeature(16)&&(i|=l.FeatureFlags.Atomics),n.options.hasFeature(2)&&(i|=l.FeatureFlags.MutableGloabls),n.options.hasFeature(8)&&(i|=l.FeatureFlags.SIMD128),n.options.hasFeature(4)&&(i|=l.FeatureFlags.BulkMemory),n.options.hasFeature(1)&&(i|=l.FeatureFlags.SignExt),n.module.setFeatures(i),n}return i(t,e),t.compile=function(e,r){return void 0===r&&(r=null),new t(e,r).compile()},t.prototype.compile=function(){var e,t,r,n,i=this.options,s=this.module,c=this.program;c.initialize(i);var u=c.makeNativeFunction("start",new m.Signature([],m.Type.void));u.internalName="start";var p=new Array;this.currentFlow=u.flow,this.currentBody=p,i.isWasm64?(s.addGlobal(o.BuiltinSymbols.heap_base,l.NativeType.I64,!0,s.i64(0)),s.addGlobal(o.BuiltinSymbols.rtti_base,l.NativeType.I64,!0,s.i64(0))):(s.addGlobal(o.BuiltinSymbols.heap_base,l.NativeType.I32,!0,s.i32(0)),s.addGlobal(o.BuiltinSymbols.rtti_base,l.NativeType.I32,!0,s.i32(0)));var _=c.filesByName;try{for(var h=a(_.values()),d=h.next();!d.done;d=h.next()){(A=d.value).source.isEntry&&(this.compileFile(A),this.compileExports(A))}}catch(t){e={error:t}}finally{try{d&&!d.done&&(t=h.return)&&t.call(h)}finally{if(e)throw e.error}}var y=!p.length,f=i.explicitStart;if(!y||f){var T=u.signature;!y&&f&&(s.addGlobal(o.BuiltinSymbols.started,l.NativeType.I32,!0,s.i32(0)),p.unshift(s.if(s.global_get(o.BuiltinSymbols.started,l.NativeType.I32),s.return(),s.global_set(o.BuiltinSymbols.started,s.i32(1)))));var g=s.addFunction(u.internalName,this.ensureFunctionType(T.parameterTypes,T.returnType,T.thisType),m.typesToNativeTypes(u.additionalLocals),s.block(null,p));u.finalize(s,g),f?s.addFunctionExport(u.internalName,"__start"):s.setStart(g)}4&this.runtimeFeatures&&o.compileVisitGlobals(this),8&this.runtimeFeatures&&o.compileVisitMembers(this),s.removeGlobal(o.BuiltinSymbols.rtti_base),2&this.runtimeFeatures&&o.compileRTTI(this);var E=this.memoryOffset;E=i64_align(E,i.usizeType.byteSize),this.memoryOffset=E,s.removeGlobal(o.BuiltinSymbols.heap_base),1&this.runtimeFeatures&&(i.isWasm64?s.addGlobal(o.BuiltinSymbols.heap_base,l.NativeType.I64,!1,s.i64(i64_low(E),i64_high(E))):s.addGlobal(o.BuiltinSymbols.heap_base,l.NativeType.I32,!1,s.i32(i64_low(E))));var v=i.hasFeature(16)&&i.sharedMemory>0;s.setMemory(this.options.memoryBase||this.memorySegments.length?i64_low(i64_shr_u(i64_align(E,65536),i64_new(16,0))):0,v?i.sharedMemory:l.Module.UNLIMITED_MEMORY,this.memorySegments,i.target,"memory",v),i.importMemory&&s.addMemoryImport("0","env","memory",v);var b=this.functionTable;s.setFunctionTable(b.length,4294967295,b),s.addFunction("null",this.ensureFunctionType(null,m.Type.void),null,s.block(null,[])),i.importTable&&s.addTableImport("0","env","table");try{for(var I=a(this.program.filesByName.values()),x=I.next();!x.done;x=I.next()){var A;(A=x.value).source.isEntry&&this.ensureModuleExports(A)}}catch(e){r={error:e}}finally{try{x&&!x.done&&(n=I.return)&&n.call(I)}finally{if(r)throw r.error}}return s},t.prototype.ensureModuleExports=function(e){var t,r,n=e.exports;if(n)try{for(var i=a(n),o=i.next();!o.done;o=i.next()){var c=s(o.value,2),l=c[0],u=c[1];this.ensureModuleExport(l,u)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}var p=e.exportsStar;if(p)for(var _=0,h=p.length;_1?p.block(null,n):n[0]),r.push(p.call(t.internalName,null,l.NativeType.None))}}},t.prototype.compileGlobal=function(e){if(e.is(u.CommonFlags.COMPILED))return!0;e.set(u.CommonFlags.COMPILED);var t=this.module,r=0,n=!1,i=e.typeNode,a=e.initializerNode;if(!e.is(u.CommonFlags.RESOLVED))if(i){var s=this.resolver.resolveType(i,e.parent);if(!s)return!1;if(s==m.Type.void)return this.error(c.DiagnosticCode.Type_expected,i.range),!1;e.setType(s)}else{if(!a)return this.error(c.DiagnosticCode.Type_expected,e.identifierNode.range.atEnd),!1;var _=this.currentFlow;if(e.hasDecorator(p.DecoratorFlags.LAZY)&&(this.currentFlow=e.file.startFunction.flow),r=this.compileExpression(a,m.Type.i32,20),this.skippedAutoreleases.has(r)&&(n=!0),this.currentFlow=_,this.currentType==m.Type.void)return this.error(c.DiagnosticCode.Type_0_is_not_assignable_to_type_1,a.range,this.currentType.toString(),""),!1;e.setType(this.currentType)}if(e.is(u.CommonFlags.AMBIENT)&&e.hasDecorator(p.DecoratorFlags.BUILTIN))return e.internalName==o.BuiltinSymbols.heap_base?this.runtimeFeatures|=1:e.internalName==o.BuiltinSymbols.rtti_base&&(this.runtimeFeatures|=2),!0;var h=e.type,d=h.toNativeType(),f=e.is(u.CommonFlags.CONST)||e.is(u.CommonFlags.STATIC|u.CommonFlags.READONLY),T=e.hasDecorator(p.DecoratorFlags.INLINE);if(e.is(u.CommonFlags.AMBIENT))return f||this.options.hasFeature(2)?(e.set(u.CommonFlags.MODULE_IMPORT),b(e,e.declaration),t.addGlobalImport(e.internalName,g,E,d),e.set(u.CommonFlags.COMPILED),!0):(this.error(c.DiagnosticCode.Operation_not_supported,e.declaration.range),!1);var v=!1;if(a){if(!r){_=this.currentFlow;e.hasDecorator(p.DecoratorFlags.LAZY)&&(this.currentFlow=e.file.startFunction.flow),r=this.compileExpression(a,h,85),this.skippedAutoreleases.has(r)&&(n=!0),this.currentFlow=_}if(l.getExpressionId(r)!=l.ExpressionId.Const&&(f?(r=t.precomputeExpression(r),l.getExpressionId(r)!=l.ExpressionId.Const&&(v=!0)):v=!0),T)if(v)this.warning(c.DiagnosticCode.Mutable_value_cannot_be_inlined,a.range);else{switch(assert(l.getExpressionId(r)==l.ExpressionId.Const),l.getExpressionType(r)){case l.NativeType.I32:e.constantValueKind=1,e.constantIntegerValue=i64_new(l.getConstValueI32(r),0);break;case l.NativeType.I64:e.constantValueKind=1,e.constantIntegerValue=i64_new(l.getConstValueI64Low(r),l.getConstValueI64High(r));break;case l.NativeType.F32:e.constantValueKind=2,e.constantFloatValue=l.getConstValueF32(r);break;case l.NativeType.F64:e.constantValueKind=2,e.constantFloatValue=l.getConstValueF64(r);break;default:return assert(!1),!1}e.set(u.CommonFlags.INLINED)}}else r=h.toNativeZero(t);var I=e.internalName;return v?(T&&this.error(c.DiagnosticCode.Decorator_0_is_not_valid_here,assert(y.findDecorator(y.DecoratorKind.INLINE,e.decoratorNodes)).range,"inline"),t.addGlobal(I,d,!0,h.toNativeZero(t)),h.isManaged&&!n&&(r=this.makeRetain(r)),this.currentBody.push(t.global_set(I,r))):T||t.addGlobal(I,d,!f,r),!0},t.prototype.compileEnum=function(e){var t,r;if(e.is(u.CommonFlags.COMPILED))return!0;e.set(u.CommonFlags.COMPILED);var n=this.module;this.currentEnum=e;var i=null,s=!1,o=e.is(u.CommonFlags.CONST)||e.hasDecorator(p.DecoratorFlags.INLINE);if(e.members)try{for(var _=a(e.members.values()),h=_.next();!h.done;h=_.next()){var d=h.value;if(d.kind==p.ElementKind.ENUMVALUE){var y=!1,f=d,T=f.valueNode;f.set(u.CommonFlags.COMPILED);var g=this.currentFlow;e.hasDecorator(p.DecoratorFlags.LAZY)&&(this.currentFlow=e.file.startFunction.flow);var E=void 0;T?(E=this.compileExpression(T,m.Type.i32,1),l.getExpressionId(E)!=l.ExpressionId.Const&&(E=n.precomputeExpression(E),l.getExpressionId(E)!=l.ExpressionId.Const&&(e.is(u.CommonFlags.CONST)&&this.error(c.DiagnosticCode.In_const_enum_declarations_member_initializer_must_be_constant_expression,T.range),y=!0))):null==i?E=n.i32(0):(s&&this.error(c.DiagnosticCode.Enum_member_must_have_initializer,d.identifierNode.range.atEnd),E=n.binary(l.BinaryOp.AddI32,n.global_get(i.internalName,l.NativeType.I32),n.i32(1)),E=n.precomputeExpression(E),l.getExpressionId(E)!=l.ExpressionId.Const&&(e.is(u.CommonFlags.CONST)&&this.error(c.DiagnosticCode.In_const_enum_declarations_member_initializer_must_be_constant_expression,d.declaration.range),y=!0)),this.currentFlow=g,y?(n.addGlobal(f.internalName,l.NativeType.I32,!0,n.i32(0)),this.currentBody.push(this.makeGlobalAssignment(f,E,!1)),s=!0):(o?(f.setConstantIntegerValue(i64_new(l.getConstValueI32(E)),m.Type.i32),f.is(u.CommonFlags.MODULE_EXPORT)&&n.addGlobal(f.internalName,l.NativeType.I32,!1,E)):n.addGlobal(f.internalName,l.NativeType.I32,!1,E),f.isImmutable=!0,s=!1),i=f}}}catch(e){t={error:e}}finally{try{h&&!h.done&&(r=_.return)&&r.call(_)}finally{if(t)throw t.error}}return this.currentEnum=null,!0},t.prototype.compileFunctionUsingTypeArguments=function(e,t,r,n){if(void 0===r&&(r=f.makeMap()),void 0===n&&(n=null),e.hasDecorator(p.DecoratorFlags.BUILTIN))return null;var i=this.resolver.resolveFunctionInclTypeArguments(e,t,e.parent,r,n||e.declaration);return i&&this.compileFunction(i)?i:null},t.prototype.ensureFunctionType=function(e,t,r){void 0===r&&(r=null);var n,i=e?e.length:0,a=0;if(r?((n=new Array(1+i))[0]=r.toNativeType(),a=1):n=new Array(i),e)for(var s=0;so){var f=a.getAndFreeTempLocal(i);h||a.setLocalFlag(f.index,_.LocalFlags.WRAPPED),d&&a.setLocalFlag(f.index,_.LocalFlags.NONNULL),t[o-1]=r.local_set(f.index,s),t.push(r.local_get(f.index,i.toNativeType()))}h||a.set(2),d&&a.set(4),a.set(1)}}if(e.is(u.CommonFlags.CONSTRUCTOR)){var T=this.options.nativeSizeType;assert(e.is(u.CommonFlags.INSTANCE));var g=assert(e.parent);if(assert(g.kind==p.ElementKind.CLASS),!a.isAny(57)){var E=assert(a.lookupLocal(u.CommonSymbols.this_));a.is(64)||(t.push(r.if(r.unary(T==l.NativeType.I64?l.UnaryOp.EqzI64:l.UnaryOp.EqzI32,r.local_get(E.index,T)),r.local_set(E.index,this.makeRetain(this.makeAllocation(g))))),this.makeFieldInitialization(g,t)),this.performAutoreleases(a,t),this.finishAutoreleases(a,t),t.push(r.local_get(E.index,this.options.nativeSizeType)),a.set(5)}g.base&&!a.is(128)&&this.error(c.DiagnosticCode.Constructors_for_derived_classes_must_contain_a_super_call,e.prototype.declaration.range)}else i==m.Type.void||a.is(1)||this.error(c.DiagnosticCode.A_function_whose_declared_type_is_not_void_must_return_a_value,e.prototype.signatureNode.returnType.range);return t},t.prototype.compileFunction=function(e){if(e.is(u.CommonFlags.COMPILED))return!0;assert(!(e.is(u.CommonFlags.AMBIENT)&&e.hasDecorator(p.DecoratorFlags.BUILTIN)));var t=this.currentType;e.set(u.CommonFlags.COMPILED);var r,n=this.module,i=e.signature,a=e.prototype.bodyNode,s=this.ensureFunctionType(i.parameterTypes,i.returnType,i.thisType);if(a){if(e.is(u.CommonFlags.AMBIENT)&&this.error(c.DiagnosticCode.An_implementation_cannot_be_declared_in_ambient_contexts,e.identifierNode.range),e.hasDecorator(p.DecoratorFlags.EXTERNAL)){var o=e.decoratorNodes,l=assert(y.findDecorator(y.DecoratorKind.EXTERNAL,o));this.error(c.DiagnosticCode.Operation_not_supported,l.range)}var h=this.currentFlow,d=e.flow;this.currentFlow=d;var f=new Array,T=0;i.thisType&&++T;for(var v=i.parameterTypes,x=0,A=v.length;x=0)return e.functionTableIndex;var t=this.functionTable,r=t.length;return!e.is(u.CommonFlags.TRAMPOLINE)&&e.signature.requiredParameters=0?"case"+_.toString(10):"break")+"|"+s);var y=r.block("case0|"+s,u,l.NativeType.None),f=!0,T=!0,g=!0,E=!0;for(h=0;h=0&&(f&&a.set(1),T&&a.set(2),g&&a.set(8),E&&a.set(64)),y},t.prototype.compileThrowStatement=function(e,t){var r=this.currentFlow;r.set(8),r.set(1);var n=new Array;this.finishAutoreleases(r,n);var i=e.value,a=null;if(i.kind==y.NodeKind.NEW){var s=i.arguments;s.length&&(a=s[0])}return n.push(o.compileAbort(this,a,e)),I(this.module,n,l.NativeType.None)},t.prototype.compileTryStatement=function(e,t){return this.error(c.DiagnosticCode.Operation_not_supported,e.range),this.module.unreachable()},t.prototype.compileVariableStatement=function(e,t){for(var r=this.module,n=e.declarations,i=n.length,a=this.currentFlow,s=new Array,o=this.resolver,h=0;h");continue}f=this.currentType}var E=d.is(u.CommonFlags.CONST),v=!1;if(E)if(T){if(T=r.precomputeExpression(T),l.getExpressionId(T)==l.ExpressionId.Const){var b=new p.Local(y,-1,f,a.parentFunction);switch(l.getExpressionType(T)){case l.NativeType.I32:b.setConstantIntegerValue(i64_new(l.getConstValueI32(T),0),f);break;case l.NativeType.I64:b.setConstantIntegerValue(i64_new(l.getConstValueI64Low(T),l.getConstValueI64High(T)),f);break;case l.NativeType.F32:b.setConstantFloatValue(l.getConstValueF32(T),f);break;case l.NativeType.F64:b.setConstantFloatValue(l.getConstValueF64(T),f);break;default:return assert(!1),r.unreachable()}var x=a.scopedLocals;if(x){if(x.has(y))return this.error(c.DiagnosticCode.Duplicate_identifier_0,d.name.range,y),this.module.unreachable()}else a.scopedLocals=x=new Map;x.set(y,b),v=!0}}else this.error(c.DiagnosticCode._const_declarations_must_be_initialized,d.range);if(!v){b=void 0;if(d.isAny(u.CommonFlags.LET|u.CommonFlags.CONST)||a.is(8192)){var A=a.getScopedLocal(y);A?(this.error(c.DiagnosticCode.Duplicate_identifier_0,d.name.range,d.name.text),b=A):b=a.addScopedLocal(y,f),E&&a.setLocalFlag(b.index,_.LocalFlags.CONSTANT)}else{if(a.lookupLocal(y)){this.error(c.DiagnosticCode.Duplicate_identifier_0,d.name.range,y);continue}b=a.parentFunction.addLocal(f,y,d),E&&a.setLocalFlag(b.index,_.LocalFlags.CONSTANT)}var N=f.isManaged;T?(a.isNonnull(T,f)&&a.setLocalFlag(b.index,_.LocalFlags.NONNULL),N?(a.setLocalFlag(b.index,_.LocalFlags.RETAINED),s.push(r.local_set(b.index,g?T:this.makeRetain(T)))):(s.push(r.local_set(b.index,T)),b.type.is(36)&&(a.canOverflow(T,f)?a.unsetLocalFlag(b.index,_.LocalFlags.WRAPPED):a.setLocalFlag(b.index,_.LocalFlags.WRAPPED)))):N?(s.push(r.local_set(b.index,f.toNativeZero(r))),a.setLocalFlag(b.index,_.LocalFlags.CONDITIONALLY_RETAINED)):b.type.is(36)&&a.setLocalFlag(b.index,_.LocalFlags.WRAPPED)}}return 0==s.length?0:I(r,s,l.NativeType.None)},t.prototype.compileVoidStatement=function(e,t){return this.compileExpression(e.expression,m.Type.void,10)},t.prototype.compileWhileStatement=function(e,t){var r=this.module,n=this.currentFlow,i=r.precomputeExpression(this.makeIsTrueish(this.compileExpressionRetainType(e.condition,m.Type.bool),this.currentType));if(l.getExpressionId(i)==l.ExpressionId.Const&&l.getExpressionType(i)==l.NativeType.I32&&!l.getConstValueI32(i))return r.nop();var a=n.pushBreakLabel(),s=n.fork();this.currentFlow=s;var o="break|"+a;s.breakLabel=o;var c="continue|"+a;s.continueLabel=c,s.inheritNonnullIfTrue(i);var u=new Array;e.statement.kind==y.NodeKind.BLOCK?this.compileStatements(e.statement.statements,!1,u):u.push(this.compileStatement(e.statement));return s.isAny(57)||(this.performAutoreleases(s,u),u.push(r.br(c))),s.freeScopedLocals(),n.popBreakLabel(),this.currentFlow=n,s.unset(3120),n.inheritConditional(s),r.block(o,[r.loop(c,r.if(i,I(r,u,l.NativeType.None)))])},t.prototype.compileInlineConstant=function(e,t,r){assert(e.is(u.CommonFlags.INLINED));var n=e.type;switch(!(3&r)&&n.is(4)&&t.is(4)&&n.size>i:0);case 5:case 6:case 10:var a=e.type.computeSmallIntegerMask(m.Type.i32);return this.module.i32(1==e.constantValueKind?i64_low(e.constantIntegerValue)&a:0);case 2:case 7:return this.module.i32(1==e.constantValueKind?i64_low(e.constantIntegerValue):0);case 4:case 9:if(!e.program.options.isWasm64)return this.module.i32(1==e.constantValueKind?i64_low(e.constantIntegerValue):0);case 3:case 8:return 1==e.constantValueKind?this.module.i64(i64_low(e.constantIntegerValue),i64_high(e.constantIntegerValue)):this.module.i64(0);case 12:if(!e.hasDecorator(p.DecoratorFlags.BUILTIN)||t!=m.Type.f32)return this.module.f64(e.constantFloatValue);this.currentType=m.Type.f32;case 11:return this.module.f32(e.constantFloatValue);default:return assert(!1),this.module.unreachable()}},t.prototype.compileExpression=function(e,t,r){var n;switch(void 0===r&&(r=0),this.currentType=t,t==m.Type.void&&(r|=8),e.kind){case y.NodeKind.ASSERTION:n=this.compileAssertionExpression(e,t,r);break;case y.NodeKind.BINARY:n=this.compileBinaryExpression(e,t,r);break;case y.NodeKind.CALL:n=this.compileCallExpression(e,t,r);break;case y.NodeKind.COMMA:n=this.compileCommaExpression(e,t,r);break;case y.NodeKind.ELEMENTACCESS:n=this.compileElementAccessExpression(e,t,r);break;case y.NodeKind.FUNCTION:n=this.compileFunctionExpression(e,t.signatureReference,r);break;case y.NodeKind.IDENTIFIER:case y.NodeKind.FALSE:case y.NodeKind.NULL:case y.NodeKind.THIS:case y.NodeKind.SUPER:case y.NodeKind.TRUE:n=this.compileIdentifierExpression(e,t,r);break;case y.NodeKind.INSTANCEOF:n=this.compileInstanceOfExpression(e,t,r);break;case y.NodeKind.LITERAL:n=this.compileLiteralExpression(e,t,r);break;case y.NodeKind.NEW:n=this.compileNewExpression(e,t,r);break;case y.NodeKind.PARENTHESIZED:n=this.compileExpression(e.expression,t,r);break;case y.NodeKind.PROPERTYACCESS:n=this.compilePropertyAccessExpression(e,t,r);break;case y.NodeKind.TERNARY:n=this.compileTernaryExpression(e,t,r);break;case y.NodeKind.UNARYPOSTFIX:n=this.compileUnaryPostfixExpression(e,t,r);break;case y.NodeKind.UNARYPREFIX:n=this.compileUnaryPrefixExpression(e,t,r);break;default:this.error(c.DiagnosticCode.Operation_not_supported,e.range),n=this.module.unreachable()}var i=this.currentType,a=0!=(4&r);return i!=t&&(2&r?(n=this.convertExpression(n,i,t,!0,a,e),a=!1,this.currentType=t):1&r&&(n=this.convertExpression(n,i,t,!1,a,e),a=!1,this.currentType=t)),a&&(n=this.ensureSmallIntegerWrap(n,i)),this.options.sourceMap&&this.addDebugLocation(n,e.range),n},t.prototype.compileExpressionRetainType=function(e,t,r){return void 0===r&&(r=0),this.compileExpression(e,t==m.Type.void?m.Type.i32:t,-4&r)},t.prototype.precomputeExpression=function(e,t,r){return void 0===r&&(r=0),this.module.precomputeExpression(this.compileExpression(e,t,r))},t.prototype.convertExpression=function(e,t,r,n,i,a){var s=this.module;return 14==t.kind?(assert(14!=r.kind),this.error(c.DiagnosticCode.Type_0_is_not_assignable_to_type_1,a.range,t.toString(),r.toString()),s.unreachable()):14==r.kind?s.drop(e):(this.currentFlow.isNonnull(e,t)&&(t=t.nonNullableType),t.isAssignableTo(r)||n||(t.nonNullableType==r?this.error(c.DiagnosticCode.Object_is_possibly_null,a.range):this.error(c.DiagnosticCode.Conversion_from_type_0_to_1_requires_an_explicit_cast,a.range,t.toString(),r.toString())),t.is(8)?r.is(8)?11==t.kind?12==r.kind&&(e=s.unary(l.UnaryOp.PromoteF32,e)):11==r.kind&&(e=s.unary(l.UnaryOp.DemoteF64,e)):r.is(4)?11==t.kind?r==m.Type.bool?(e=s.binary(l.BinaryOp.NeF32,e,s.f32(0)),i=!1):e=r.is(1)?r.is(64)?s.unary(l.UnaryOp.TruncF32ToI64,e):s.unary(l.UnaryOp.TruncF32ToI32,e):r.is(64)?s.unary(l.UnaryOp.TruncF32ToU64,e):s.unary(l.UnaryOp.TruncF32ToU32,e):r==m.Type.bool?(e=s.binary(l.BinaryOp.NeF64,e,s.f64(0)),i=!1):e=r.is(1)?r.is(64)?s.unary(l.UnaryOp.TruncF64ToI64,e):s.unary(l.UnaryOp.TruncF64ToI32,e):r.is(64)?s.unary(l.UnaryOp.TruncF64ToU64,e):s.unary(l.UnaryOp.TruncF64ToU32,e):(assert(0==r.flags,"void type expected"),e=s.drop(e)):t.is(4)&&r.is(8)?e=11==r.kind?t.is(64)?s.unary(t.is(1)?l.UnaryOp.ConvertI64ToF32:l.UnaryOp.ConvertU64ToF32,e):s.unary(t.is(1)?l.UnaryOp.ConvertI32ToF32:l.UnaryOp.ConvertU32ToF32,e):t.is(64)?s.unary(t.is(1)?l.UnaryOp.ConvertI64ToF64:l.UnaryOp.ConvertU64ToF64,e):s.unary(t.is(1)?l.UnaryOp.ConvertI32ToF64:l.UnaryOp.ConvertU32ToF64,e):t.is(64)?r==m.Type.bool?(e=s.binary(l.BinaryOp.NeI64,e,s.i64(0)),i=!1):r.is(64)||(e=s.unary(l.UnaryOp.WrapI64,e)):r.is(64)?(e=s.unary(t.is(1)?l.UnaryOp.ExtendI32:l.UnaryOp.ExtendU32,this.ensureSmallIntegerWrap(e,t)),i=!1):t.is(32)&&t.size",i.toString(),s.toString()),this.currentType=t,y.unreachable();switch(n=this.convertExpression(n,i,i=o,!1,!0,f),a=this.convertExpression(a,s,s=o,!1,!0,T),o.kind){case 0:case 1:case 2:h=y.binary(l.BinaryOp.GtI32,n,a);break;case 4:h=y.binary(this.options.isWasm64?l.BinaryOp.GtI64:l.BinaryOp.GtI32,n,a);break;case 3:h=y.binary(l.BinaryOp.GtI64,n,a);break;case 5:case 6:case 7:case 10:h=y.binary(l.BinaryOp.GtU32,n,a);break;case 9:h=y.binary(this.options.isWasm64?l.BinaryOp.GtU64:l.BinaryOp.GtU32,n,a);break;case 8:h=y.binary(l.BinaryOp.GtU64,n,a);break;case 11:h=y.binary(l.BinaryOp.GtF32,n,a);break;case 12:h=y.binary(l.BinaryOp.GtF64,n,a);break;default:assert(!1),h=y.unreachable()}this.currentType=m.Type.bool;break;case d.Token.LESSTHAN_EQUALS:if(n=this.compileExpressionRetainType(f,t),i=this.currentType,this.currentType.is(256)){if(x=i.classReference)if(A=x.lookupOverload(p.OperatorKind.LE)){h=this.compileBinaryOverload(A,f,n,T,e);break}return this.error(c.DiagnosticCode.Operation_not_supported,e.range),this.module.unreachable()}if(a=this.compileExpressionRetainType(T,i),s=this.currentType,!(o=m.Type.commonDenominator(i,s,!0)))return this.error(c.DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,e.range,"<=",i.toString(),s.toString()),this.currentType=t,y.unreachable();switch(n=this.convertExpression(n,i,i=o,!1,!0,f),a=this.convertExpression(a,s,s=o,!1,!0,T),o.kind){case 0:case 1:case 2:h=y.binary(l.BinaryOp.LeI32,n,a);break;case 4:h=y.binary(this.options.isWasm64?l.BinaryOp.LeI64:l.BinaryOp.LeI32,n,a);break;case 3:h=y.binary(l.BinaryOp.LeI64,n,a);break;case 5:case 6:case 7:case 10:h=y.binary(l.BinaryOp.LeU32,n,a);break;case 9:h=y.binary(this.options.isWasm64?l.BinaryOp.LeU64:l.BinaryOp.LeU32,n,a);break;case 8:h=y.binary(l.BinaryOp.LeU64,n,a);break;case 11:h=y.binary(l.BinaryOp.LeF32,n,a);break;case 12:h=y.binary(l.BinaryOp.LeF64,n,a);break;default:assert(!1),h=y.unreachable()}this.currentType=m.Type.bool;break;case d.Token.GREATERTHAN_EQUALS:if(n=this.compileExpressionRetainType(f,t),i=this.currentType,this.currentType.is(256)){if(x=i.classReference)if(A=x.lookupOverload(p.OperatorKind.GE)){h=this.compileBinaryOverload(A,f,n,T,e);break}return this.error(c.DiagnosticCode.Operation_not_supported,e.range),this.module.unreachable()}if(a=this.compileExpressionRetainType(T,i),s=this.currentType,!(o=m.Type.commonDenominator(i,s,!0)))return this.error(c.DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,e.range,">=",i.toString(),s.toString()),this.currentType=t,y.unreachable();switch(n=this.convertExpression(n,i,i=o,!1,!0,f),a=this.convertExpression(a,s,s=o,!1,!0,T),o.kind){case 0:case 1:case 2:h=y.binary(l.BinaryOp.GeI32,n,a);break;case 4:h=y.binary(this.options.isWasm64?l.BinaryOp.GeI64:l.BinaryOp.GeI32,n,a);break;case 3:h=y.binary(l.BinaryOp.GeI64,n,a);break;case 5:case 6:case 7:case 10:h=y.binary(l.BinaryOp.GeU32,n,a);break;case 9:h=y.binary(this.options.isWasm64?l.BinaryOp.GeU64:l.BinaryOp.GeU32,n,a);break;case 8:h=y.binary(l.BinaryOp.GeU64,n,a);break;case 11:h=y.binary(l.BinaryOp.GeF32,n,a);break;case 12:h=y.binary(l.BinaryOp.GeF64,n,a);break;default:assert(!1),h=y.unreachable()}this.currentType=m.Type.bool;break;case d.Token.EQUALS_EQUALS_EQUALS:case d.Token.EQUALS_EQUALS:if(n=this.compileExpressionRetainType(f,t),i=this.currentType,E==d.Token.EQUALS_EQUALS&&this.currentType.is(256))if(x=i.classReference)if(A=x.lookupOverload(p.OperatorKind.EQ)){h=this.compileBinaryOverload(A,f,n,T,e);break}if(a=this.compileExpressionRetainType(T,i),s=this.currentType,!(o=m.Type.commonDenominator(i,s,!1)))return this.error(c.DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,e.range,d.operatorTokenToString(e.operator),i.toString(),s.toString()),this.currentType=t,y.unreachable();switch(n=this.convertExpression(n,i,i=o,!1,!0,f),a=this.convertExpression(a,s,s=o,!1,!0,T),o.kind){case 0:case 1:case 2:case 5:case 6:case 7:case 10:h=y.binary(l.BinaryOp.EqI32,n,a);break;case 9:case 4:h=y.binary(this.options.isWasm64?l.BinaryOp.EqI64:l.BinaryOp.EqI32,n,a);break;case 3:case 8:h=y.binary(l.BinaryOp.EqI64,n,a);break;case 11:h=y.binary(l.BinaryOp.EqF32,n,a);break;case 12:h=y.binary(l.BinaryOp.EqF64,n,a);break;case 13:h=y.unary(l.UnaryOp.AllTrueVecI8x16,y.binary(l.BinaryOp.EqVecI8x16,n,a));break;default:assert(!1),h=y.unreachable()}this.currentType=m.Type.bool;break;case d.Token.EXCLAMATION_EQUALS_EQUALS:case d.Token.EXCLAMATION_EQUALS:if(n=this.compileExpressionRetainType(f,t),i=this.currentType,E==d.Token.EXCLAMATION_EQUALS&&this.currentType.is(256))if(x=i.classReference)if(A=x.lookupOverload(p.OperatorKind.NE)){h=this.compileBinaryOverload(A,f,n,T,e);break}if(a=this.compileExpressionRetainType(T,i),s=this.currentType,!(o=m.Type.commonDenominator(i,s,!1)))return this.error(c.DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,e.range,d.operatorTokenToString(e.operator),i.toString(),s.toString()),this.currentType=t,y.unreachable();switch(n=this.convertExpression(n,i,i=o,!1,!0,f),a=this.convertExpression(a,s,s=o,!1,!0,T),o.kind){case 0:case 1:case 2:case 5:case 6:case 7:case 10:h=y.binary(l.BinaryOp.NeI32,n,a);break;case 9:case 4:h=y.binary(this.options.isWasm64?l.BinaryOp.NeI64:l.BinaryOp.NeI32,n,a);break;case 3:case 8:h=y.binary(l.BinaryOp.NeI64,n,a);break;case 11:h=y.binary(l.BinaryOp.NeF32,n,a);break;case 12:h=y.binary(l.BinaryOp.NeF64,n,a);break;case 13:h=y.unary(l.UnaryOp.AnyTrueVecI8x16,y.binary(l.BinaryOp.NeVecI8x16,n,a));break;default:assert(!1),h=y.unreachable()}this.currentType=m.Type.bool;break;case d.Token.EQUALS:return this.compileAssignment(f,T,t);case d.Token.PLUS_EQUALS:g=!0;case d.Token.PLUS:if(n=this.compileExpressionRetainType(f,t),i=this.currentType,this.currentType.is(256)){if(x=i.classReference)if(A=x.lookupOverload(p.OperatorKind.ADD)){h=this.compileBinaryOverload(A,f,n,T,e);break}return this.error(c.DiagnosticCode.Operation_not_supported,e.range),this.module.unreachable()}if(g)a=this.compileExpression(T,i,1);else{if(a=this.compileExpressionRetainType(T,i),s=this.currentType,!(o=m.Type.commonDenominator(i,s,!1)))return this.error(c.DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,e.range,"+",i.toString(),s.toString()),this.currentType=t,y.unreachable();n=this.convertExpression(n,i,i=o,!1,!1,f),a=this.convertExpression(a,s,s=o,!1,!1,T)}switch(this.currentType.kind){case 0:case 1:case 5:case 6:case 10:case 2:case 7:h=y.binary(l.BinaryOp.AddI32,n,a);break;case 9:case 4:h=y.binary(this.options.isWasm64?l.BinaryOp.AddI64:l.BinaryOp.AddI32,n,a);break;case 3:case 8:h=y.binary(l.BinaryOp.AddI64,n,a);break;case 11:h=y.binary(l.BinaryOp.AddF32,n,a);break;case 12:h=y.binary(l.BinaryOp.AddF64,n,a);break;default:assert(!1),h=y.unreachable()}break;case d.Token.MINUS_EQUALS:g=!0;case d.Token.MINUS:if(n=this.compileExpressionRetainType(f,t),i=this.currentType,this.currentType.is(256)){if(x=i.classReference)if(A=x.lookupOverload(p.OperatorKind.SUB)){h=this.compileBinaryOverload(A,f,n,T,e);break}return this.error(c.DiagnosticCode.Operation_not_supported,e.range),this.module.unreachable()}if(g)a=this.compileExpression(T,i,1),s=this.currentType;else{if(a=this.compileExpressionRetainType(T,i),s=this.currentType,!(o=m.Type.commonDenominator(i,s,!1)))return this.error(c.DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,e.range,"-",i.toString(),s.toString()),this.currentType=t,y.unreachable();n=this.convertExpression(n,i,i=o,!1,!1,f),a=this.convertExpression(a,s,s=o,!1,!1,T)}switch(this.currentType.kind){case 0:case 1:case 5:case 6:case 10:case 2:case 7:h=y.binary(l.BinaryOp.SubI32,n,a);break;case 9:case 4:h=y.binary(this.options.isWasm64?l.BinaryOp.SubI64:l.BinaryOp.SubI32,n,a);break;case 3:case 8:h=y.binary(l.BinaryOp.SubI64,n,a);break;case 11:h=y.binary(l.BinaryOp.SubF32,n,a);break;case 12:h=y.binary(l.BinaryOp.SubF64,n,a);break;default:assert(!1),h=y.unreachable()}break;case d.Token.ASTERISK_EQUALS:g=!0;case d.Token.ASTERISK:if(n=this.compileExpressionRetainType(f,t),i=this.currentType,this.currentType.is(256)){if(x=i.classReference)if(A=x.lookupOverload(p.OperatorKind.MUL)){h=this.compileBinaryOverload(A,f,n,T,e);break}return this.error(c.DiagnosticCode.Operation_not_supported,e.range),this.module.unreachable()}if(g)n=this.ensureSmallIntegerWrap(n,i),a=this.compileExpression(T,i,1);else{if(a=this.compileExpressionRetainType(T,i),s=this.currentType,!(o=m.Type.commonDenominator(i,s,!1)))return this.error(c.DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,e.range,"*",i.toString(),s.toString()),this.currentType=t,y.unreachable();n=this.convertExpression(n,i,i=o,!1,!1,f),a=this.convertExpression(a,s,s=o,!1,!1,T)}switch(this.currentType.kind){case 0:case 1:case 5:case 6:case 10:case 2:case 7:h=y.binary(l.BinaryOp.MulI32,n,a);break;case 9:case 4:h=y.binary(this.options.isWasm64?l.BinaryOp.MulI64:l.BinaryOp.MulI32,n,a);break;case 3:case 8:h=y.binary(l.BinaryOp.MulI64,n,a);break;case 11:h=y.binary(l.BinaryOp.MulF32,n,a);break;case 12:h=y.binary(l.BinaryOp.MulF64,n,a);break;default:assert(!1),h=y.unreachable()}break;case d.Token.ASTERISK_ASTERISK_EQUALS:g=!0;case d.Token.ASTERISK_ASTERISK:if(n=this.compileExpressionRetainType(f,t),i=this.currentType,this.currentType.is(256)){if(x=i.classReference)if(A=x.lookupOverload(p.OperatorKind.POW)){h=this.compileBinaryOverload(A,f,n,T,e);break}return this.error(c.DiagnosticCode.Operation_not_supported,e.range),this.module.unreachable()}var v=void 0;if(11==this.currentType.kind){if(a=this.compileExpression(T,m.Type.f32,1),s=this.currentType,!(v=this.f32PowInstance)){if(!(b=this.program.lookupGlobal(u.CommonSymbols.Mathf))){this.error(c.DiagnosticCode.Cannot_find_name_0,e.range,"Mathf"),h=y.unreachable();break}if(!(I=b.members?b.members.get(u.CommonSymbols.pow):null)){this.error(c.DiagnosticCode.Cannot_find_name_0,e.range,"Mathf.pow"),h=y.unreachable();break}assert(I.kind==p.ElementKind.FUNCTION_PROTOTYPE),this.f32PowInstance=v=this.resolver.resolveFunction(I,null)}}else if(n=this.convertExpression(n,this.currentType,m.Type.f64,!1,!1,f),i=this.currentType,a=this.compileExpression(T,m.Type.f64,1),s=this.currentType,!(v=this.f64PowInstance)){if(!(b=this.program.lookupGlobal(u.CommonSymbols.Math))){this.error(c.DiagnosticCode.Cannot_find_name_0,e.range,"Math"),h=y.unreachable();break}if(!(I=b.members?b.members.get(u.CommonSymbols.pow):null)){this.error(c.DiagnosticCode.Cannot_find_name_0,e.range,"Math.pow"),h=y.unreachable();break}assert(I.kind==p.ElementKind.FUNCTION_PROTOTYPE),this.f64PowInstance=v=this.resolver.resolveFunction(I,null)}h=v&&this.compileFunction(v)?this.makeCallDirect(v,[n,a],e):y.unreachable();break;case d.Token.SLASH_EQUALS:g=!0;case d.Token.SLASH:if(n=this.compileExpressionRetainType(f,t),i=this.currentType,this.currentType.is(256)){if(x=i.classReference)if(A=x.lookupOverload(p.OperatorKind.DIV)){h=this.compileBinaryOverload(A,f,n,T,e);break}return this.error(c.DiagnosticCode.Operation_not_supported,e.range),this.module.unreachable()}if(g)n=this.ensureSmallIntegerWrap(n,i),a=this.compileExpression(T,i,1),s=this.currentType;else{if(a=this.compileExpressionRetainType(T,i),s=this.currentType,!(o=m.Type.commonDenominator(i,s,!1)))return this.error(c.DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,e.range,"/",i.toString(),s.toString()),this.currentType=t,y.unreachable();n=this.convertExpression(n,i,i=o,!1,!0,f),a=this.convertExpression(a,s,s=o,!1,!0,T)}switch(this.currentType.kind){case 0:case 1:case 2:h=y.binary(l.BinaryOp.DivI32,n,a);break;case 4:h=y.binary(this.options.isWasm64?l.BinaryOp.DivI64:l.BinaryOp.DivI32,n,a);break;case 3:h=y.binary(l.BinaryOp.DivI64,n,a);break;case 5:case 6:case 10:case 7:h=y.binary(l.BinaryOp.DivU32,n,a);break;case 9:h=y.binary(this.options.isWasm64?l.BinaryOp.DivU64:l.BinaryOp.DivU32,n,a);break;case 8:h=y.binary(l.BinaryOp.DivU64,n,a);break;case 11:h=y.binary(l.BinaryOp.DivF32,n,a);break;case 12:h=y.binary(l.BinaryOp.DivF64,n,a);break;default:assert(!1),h=y.unreachable()}break;case d.Token.PERCENT_EQUALS:g=!0;case d.Token.PERCENT:if(n=this.compileExpressionRetainType(f,t),i=this.currentType,this.currentType.is(256)){if(x=i.classReference)if(A=x.lookupOverload(p.OperatorKind.REM)){h=this.compileBinaryOverload(A,f,n,T,e);break}return this.error(c.DiagnosticCode.Operation_not_supported,e.range),this.module.unreachable()}if(g)n=this.ensureSmallIntegerWrap(n,i),a=this.compileExpression(T,i,1),s=this.currentType;else{if(a=this.compileExpressionRetainType(T,i),s=this.currentType,!(o=m.Type.commonDenominator(i,s,!1)))return this.error(c.DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,e.range,"%",i.toString(),s.toString()),this.currentType=t,y.unreachable();n=this.convertExpression(n,i,i=o,!1,!0,f),a=this.convertExpression(a,s,s=o,!1,!0,T)}switch(this.currentType.kind){case 0:case 1:case 2:h=y.binary(l.BinaryOp.RemI32,n,a);break;case 4:h=y.binary(this.options.isWasm64?l.BinaryOp.RemI64:l.BinaryOp.RemI32,n,a);break;case 3:h=y.binary(l.BinaryOp.RemI64,n,a);break;case 5:case 6:case 10:case 7:h=y.binary(l.BinaryOp.RemU32,n,a);break;case 9:h=y.binary(this.options.isWasm64?l.BinaryOp.RemU64:l.BinaryOp.RemU32,n,a);break;case 8:h=y.binary(l.BinaryOp.RemU64,n,a);break;case 11:if(!(v=this.f32ModInstance)){if(!(b=this.program.lookupGlobal(u.CommonSymbols.Mathf))){this.error(c.DiagnosticCode.Cannot_find_name_0,e.range,"Mathf"),h=y.unreachable();break}if(!(I=b.members?b.members.get(u.CommonSymbols.mod):null)){this.error(c.DiagnosticCode.Cannot_find_name_0,e.range,"Mathf.mod"),h=y.unreachable();break}assert(I.kind==p.ElementKind.FUNCTION_PROTOTYPE),this.f32ModInstance=v=this.resolver.resolveFunction(I,null)}h=v&&this.compileFunction(v)?this.makeCallDirect(v,[n,a],e):y.unreachable();break;case 12:if(!(v=this.f64ModInstance)){var b,I;if(!(b=this.program.lookupGlobal(u.CommonSymbols.Math))){this.error(c.DiagnosticCode.Cannot_find_name_0,e.range,"Math"),h=y.unreachable();break}if(!(I=b.members?b.members.get(u.CommonSymbols.mod):null)){this.error(c.DiagnosticCode.Cannot_find_name_0,e.range,"Math.mod"),h=y.unreachable();break}assert(I.kind==p.ElementKind.FUNCTION_PROTOTYPE),this.f64ModInstance=v=this.resolver.resolveFunction(I,null)}h=v&&this.compileFunction(v)?this.makeCallDirect(v,[n,a],e):y.unreachable();break;default:assert(!1),h=y.unreachable()}break;case d.Token.LESSTHAN_LESSTHAN_EQUALS:g=!0;case d.Token.LESSTHAN_LESSTHAN:if(n=this.compileExpressionRetainType(f,t.intType),i=this.currentType,this.currentType.is(256)){if(x=i.classReference)if(A=x.lookupOverload(p.OperatorKind.BITWISE_SHL)){h=this.compileBinaryOverload(A,f,n,T,e);break}return this.error(c.DiagnosticCode.Operation_not_supported,e.range),this.module.unreachable()}switch(a=this.compileExpression(T,i,1),s=this.currentType,this.currentType.kind){case 0:case 1:case 5:case 6:case 10:case 2:case 7:h=y.binary(l.BinaryOp.ShlI32,n,a);break;case 3:case 8:h=y.binary(l.BinaryOp.ShlI64,n,a);break;case 9:case 4:h=y.binary(this.options.isWasm64?l.BinaryOp.ShlI64:l.BinaryOp.ShlI32,n,a);break;case 11:case 12:return this.error(c.DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,e.range,d.operatorTokenToString(e.operator),this.currentType.toString()),y.unreachable();default:assert(!1),h=y.unreachable()}break;case d.Token.GREATERTHAN_GREATERTHAN_EQUALS:g=!0;case d.Token.GREATERTHAN_GREATERTHAN:if(n=this.compileExpressionRetainType(f,t.intType),i=this.currentType,this.currentType.is(256)){if(x=i.classReference)if(A=x.lookupOverload(p.OperatorKind.BITWISE_SHR)){h=this.compileBinaryOverload(A,f,n,T,e);break}return this.error(c.DiagnosticCode.Operation_not_supported,e.range),this.module.unreachable()}switch(n=this.ensureSmallIntegerWrap(n,i),a=this.compileExpression(T,i,1),s=this.currentType,this.currentType.kind){case 0:case 1:case 2:h=y.binary(l.BinaryOp.ShrI32,n,a);break;case 3:h=y.binary(l.BinaryOp.ShrI64,n,a);break;case 4:h=y.binary(this.options.isWasm64?l.BinaryOp.ShrI64:l.BinaryOp.ShrI32,n,a);break;case 5:case 6:case 10:case 7:h=y.binary(l.BinaryOp.ShrU32,n,a);break;case 8:h=y.binary(l.BinaryOp.ShrU64,n,a);break;case 9:h=y.binary(this.options.isWasm64?l.BinaryOp.ShrU64:l.BinaryOp.ShrU32,n,a);break;case 11:case 12:return this.error(c.DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,e.range,d.operatorTokenToString(e.operator),this.currentType.toString()),y.unreachable();default:assert(!1),h=y.unreachable()}break;case d.Token.GREATERTHAN_GREATERTHAN_GREATERTHAN_EQUALS:g=!0;case d.Token.GREATERTHAN_GREATERTHAN_GREATERTHAN:if(n=this.compileExpressionRetainType(f,t.intType),i=this.currentType,this.currentType.is(256)){if(x=i.classReference)if(A=x.lookupOverload(p.OperatorKind.BITWISE_SHR_U)){h=this.compileBinaryOverload(A,f,n,T,e);break}return this.error(c.DiagnosticCode.Operation_not_supported,e.range),this.module.unreachable()}switch(n=this.ensureSmallIntegerWrap(n,i),a=this.compileExpression(T,i,1),s=this.currentType,this.currentType.kind){case 5:case 6:case 10:h=y.binary(l.BinaryOp.ShrU32,n,a);case 0:case 1:case 2:case 7:h=y.binary(l.BinaryOp.ShrU32,n,a);break;case 3:case 8:h=y.binary(l.BinaryOp.ShrU64,n,a);break;case 9:case 4:h=y.binary(this.options.isWasm64?l.BinaryOp.ShrU64:l.BinaryOp.ShrU32,n,a);break;case 11:case 12:return this.error(c.DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,e.range,d.operatorTokenToString(e.operator),this.currentType.toString()),y.unreachable();default:assert(!1),h=y.unreachable()}break;case d.Token.AMPERSAND_EQUALS:g=!0;case d.Token.AMPERSAND:if(n=this.compileExpressionRetainType(f,t.intType),i=this.currentType,this.currentType.is(256)){if(x=i.classReference)if(A=x.lookupOverload(p.OperatorKind.BITWISE_AND)){h=this.compileBinaryOverload(A,f,n,T,e);break}return this.error(c.DiagnosticCode.Operation_not_supported,e.range),this.module.unreachable()}if(g)a=this.compileExpression(T,i,1),s=this.currentType;else{if(a=this.compileExpressionRetainType(T,i),s=this.currentType,!(o=m.Type.commonDenominator(i,s,!1)))return this.error(c.DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,e.range,"&",i.toString(),s.toString()),this.currentType=t,y.unreachable();n=this.convertExpression(n,i,i=o,!1,!1,f),a=this.convertExpression(a,s,s=o,!1,!1,T)}switch(this.currentType.kind){case 0:case 1:case 2:case 5:case 6:case 10:case 7:h=y.binary(l.BinaryOp.AndI32,n,a);break;case 3:case 8:h=y.binary(l.BinaryOp.AndI64,n,a);break;case 9:case 4:h=y.binary(this.options.isWasm64?l.BinaryOp.AndI64:l.BinaryOp.AndI32,n,a);break;case 11:case 12:return this.error(c.DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,e.range,d.operatorTokenToString(e.operator),this.currentType.toString()),y.unreachable();default:assert(!1),h=y.unreachable()}break;case d.Token.BAR_EQUALS:g=!0;case d.Token.BAR:if(n=this.compileExpressionRetainType(f,t.intType),i=this.currentType,this.currentType.is(256)){if(x=i.classReference)if(A=x.lookupOverload(p.OperatorKind.BITWISE_OR)){h=this.compileBinaryOverload(A,f,n,T,e);break}return this.error(c.DiagnosticCode.Operation_not_supported,e.range),this.module.unreachable()}if(g)a=this.compileExpression(T,i,1),s=this.currentType;else{if(a=this.compileExpressionRetainType(T,i),s=this.currentType,!(o=m.Type.commonDenominator(i,s,!1)))return this.error(c.DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,e.range,"|",i.toString(),s.toString()),this.currentType=t,y.unreachable();n=this.convertExpression(n,i,i=o,!1,!1,f),a=this.convertExpression(a,s,s=o,!1,!1,T)}switch(this.currentType.kind){case 0:case 1:case 5:case 6:case 10:h=y.binary(l.BinaryOp.OrI32,n,a);break;case 2:case 7:h=y.binary(l.BinaryOp.OrI32,n,a);break;case 3:case 8:h=y.binary(l.BinaryOp.OrI64,n,a);break;case 9:case 4:h=y.binary(this.options.isWasm64?l.BinaryOp.OrI64:l.BinaryOp.OrI32,n,a);break;case 11:case 12:return this.error(c.DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,e.range,d.operatorTokenToString(e.operator),this.currentType.toString()),y.unreachable();default:assert(!1),h=y.unreachable()}break;case d.Token.CARET_EQUALS:g=!0;case d.Token.CARET:if(n=this.compileExpressionRetainType(f,t.intType),i=this.currentType,this.currentType.is(256)){var x,A;if(x=i.classReference)if(A=x.lookupOverload(p.OperatorKind.BITWISE_XOR)){h=this.compileBinaryOverload(A,f,n,T,e);break}return this.error(c.DiagnosticCode.Operation_not_supported,e.range),this.module.unreachable()}if(g)a=this.compileExpression(T,i,1),s=this.currentType;else{if(a=this.compileExpressionRetainType(T,i),s=this.currentType,!(o=m.Type.commonDenominator(i,s,!1)))return this.error(c.DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,e.range,"^",i.toString(),s.toString()),this.currentType=t,y.unreachable();n=this.convertExpression(n,i,i=o,!1,!1,f),a=this.convertExpression(a,s,s=o,!1,!1,T)}switch(this.currentType.kind){case 0:case 1:case 5:case 6:case 10:h=y.binary(l.BinaryOp.XorI32,n,a);break;case 2:case 7:h=y.binary(l.BinaryOp.XorI32,n,a);break;case 3:case 8:h=y.binary(l.BinaryOp.XorI64,n,a);break;case 9:case 4:h=y.binary(this.options.isWasm64?l.BinaryOp.XorI64:l.BinaryOp.XorI32,n,a);break;case 11:case 12:return this.error(c.DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,e.range,d.operatorTokenToString(e.operator),this.currentType.toString()),y.unreachable();default:assert(!1),h=y.unreachable()}break;case d.Token.AMPERSAND_AMPERSAND:var N=this.currentFlow;n=this.compileExpressionRetainType(f,t,r),i=this.currentType;var S=N.fork();if(this.currentFlow=S,S.inheritNonnullIfTrue(n),a=this.compileExpression(T,i,1|-9&r),s=i,t==m.Type.bool||t==m.Type.void)a=this.performAutoreleasesWithValue(S,a,s),S.freeScopedLocals(),this.currentFlow=N,this.currentType=m.Type.bool,h=y.if(this.makeIsTrueish(n,i),this.makeIsTrueish(a,s),y.i32(0));else if(i.isManaged){var O=this.skippedAutoreleases.has(n),C=this.skippedAutoreleases.has(a),k=N.getTempLocal(i);n=y.local_tee(k.index,n);var R=!1;O!=C?O?(a=this.makeRetain(a),C=!0):R=!0:16&r||(a=this.moveAutorelease(a,S,N));var L=new Array;O&&L.unshift(this.makeRelease(y.local_get(k.index,i.toNativeType()))),a=this.performAutoreleasesWithValue(S,a,s,L),S.freeScopedLocals(),this.currentFlow=N,h=y.if(this.makeIsTrueish(n,i),a,R?this.makeRetain(y.local_get(k.index,i.toNativeType())):y.local_get(k.index,i.toNativeType())),(O||C)&&this.skippedAutoreleases.add(h),k&&N.freeTempLocal(k)}else if(a=this.performAutoreleasesWithValue(S,a,s),S.freeScopedLocals(),this.currentFlow=N,h=y.cloneExpression(n,!0,0))h=y.if(this.makeIsTrueish(n,this.currentType),a,h);else{var F=N.getTempLocal(i);N.canOverflow(n,i)||N.setLocalFlag(F.index,_.LocalFlags.WRAPPED),N.isNonnull(n,i)&&N.setLocalFlag(F.index,_.LocalFlags.NONNULL),h=y.if(this.makeIsTrueish(y.local_tee(F.index,n),i),a,y.local_get(F.index,i.toNativeType()))}this.currentType=i;break;case d.Token.BAR_BAR:N=this.currentFlow;n=this.compileExpressionRetainType(f,t,r),i=this.currentType;S=N.fork();if(this.currentFlow=S,S.inheritNonnullIfFalse(n),a=this.compileExpression(T,i,1|r),s=i,t==m.Type.bool||t==m.Type.void)a=this.performAutoreleasesWithValue(S,a,i),S.freeScopedLocals(),this.currentFlow=N,this.currentType=m.Type.bool,h=y.if(this.makeIsTrueish(n,i),y.i32(1),this.makeIsTrueish(a,s));else if(i.isManaged){O=this.skippedAutoreleases.has(n),C=this.skippedAutoreleases.has(a),k=N.getTempLocal(i);n=y.local_tee(k.index,n);var B=!1;O!=C?O?(a=this.makeRetain(a),C=!0):B=!0:16&r||(a=this.moveAutorelease(a,S,N));L=new Array;O&&L.unshift(this.makeRelease(y.local_get(k.index,i.toNativeType()))),a=this.performAutoreleasesWithValue(S,a,s,L),S.freeScopedLocals(),this.currentFlow=N,h=y.if(this.makeIsTrueish(n,i),B?this.makeRetain(y.local_get(k.index,i.toNativeType())):y.local_get(k.index,i.toNativeType()),a),(O||C)&&this.skippedAutoreleases.add(h),k&&N.freeTempLocal(k)}else if(a=this.performAutoreleasesWithValue(S,a,s),S.freeScopedLocals(),this.currentFlow=N,h=y.cloneExpression(n,!0,0))h=y.if(this.makeIsTrueish(n,i),h,a);else{F=N.getAndFreeTempLocal(i);N.canOverflow(n,i)||N.setLocalFlag(F.index,_.LocalFlags.WRAPPED),N.isNonnull(n,i)&&N.setLocalFlag(F.index,_.LocalFlags.NONNULL),h=y.if(this.makeIsTrueish(y.local_tee(F.index,n),i),y.local_get(F.index,i.toNativeType()),a)}this.currentType=i;break;default:assert(!1),h=this.module.unreachable()}if(!g)return h;var D=this.resolver,P=this.resolver.resolveExpression(f,this.currentFlow);return P?this.makeAssignment(P,h,f,D.currentThisExpression,D.currentElementExpression,t!=m.Type.void):y.unreachable()},t.prototype.compileUnaryOverload=function(e,t,r,n){return this.makeCallDirect(e,[r],n,!1)},t.prototype.compileBinaryOverload=function(e,t,r,n,i){var a;if(e.is(u.CommonFlags.INSTANCE)){var s=assert(e.parent);assert(s.kind==p.ElementKind.CLASS),a=e.signature.parameterTypes[0]}else a=e.signature.parameterTypes[1];var o=this.compileExpression(n,a,1);return this.makeCallDirect(e,[r,o],i)},t.prototype.compileAssignment=function(e,t,r){var n=this.program.resolver,i=this.currentFlow,a=n.resolveExpression(e,i);if(!a)return this.module.unreachable();var s,o=n.currentThisExpression,l=n.currentElementExpression;switch(a.kind){case p.ElementKind.GLOBAL:if(!this.compileGlobal(a))return this.module.unreachable();case p.ElementKind.FIELD:case p.ElementKind.LOCAL:s=a.type;break;case p.ElementKind.PROPERTY_PROTOTYPE:var u=a.setterPrototype;if(!u)return this.error(c.DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property,e.range,a.internalName),this.module.unreachable();if(!(_=this.resolver.resolveFunction(u,null,f.makeMap(),h.ReportMode.REPORT)))return this.module.unreachable();assert(1==_.signature.parameterTypes.length),s=_.signature.parameterTypes[0];break;case p.ElementKind.PROPERTY:var _;if(!(_=a.setterInstance))return this.error(c.DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property,e.range,a.internalName),this.module.unreachable();assert(1==_.signature.parameterTypes.length),s=_.signature.parameterTypes[0];break;case p.ElementKind.CLASS:if(l){var d=i.is(16384),y=a.lookupOverload(p.OperatorKind.INDEXED_SET,d);if(!y)return a.lookupOverload(p.OperatorKind.INDEXED_GET,d)?this.error(c.DiagnosticCode.Index_signature_in_type_0_only_permits_reading,e.range,a.internalName):this.error(c.DiagnosticCode.Index_signature_is_missing_in_type_0,e.range,a.internalName),this.module.unreachable();assert(2==y.signature.parameterTypes.length),s=y.signature.parameterTypes[1];break}default:return this.error(c.DiagnosticCode.Operation_not_supported,e.range),this.module.unreachable()}return assert(s!=m.Type.void),this.makeAssignment(a,this.compileExpression(t,s,17),e,o,l,r!=m.Type.void)},t.prototype.makeAssignment=function(e,t,r,n,i,a){var s=this.module,o=this.currentFlow;switch(e.kind){case p.ElementKind.LOCAL:return o.isLocalFlag(e.index,_.LocalFlags.CONSTANT,!0)?(this.error(c.DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property,r.range,e.internalName),this.currentType=a?e.type:m.Type.void,s.unreachable()):this.makeLocalAssignment(e,t,a);case p.ElementKind.GLOBAL:return this.compileGlobal(e)?e.isAny(u.CommonFlags.CONST|u.CommonFlags.READONLY)?(this.error(c.DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property,r.range,e.internalName),this.currentType=a?e.type:m.Type.void,s.unreachable()):this.makeGlobalAssignment(e,t,a):s.unreachable();case p.ElementKind.FIELD:var l=e.initializerNode;return!e.is(u.CommonFlags.READONLY)||o.actualFunction.is(u.CommonFlags.CONSTRUCTOR)||l?this.makeFieldAssignment(e,t,this.compileExpressionRetainType(assert(n),this.options.usizeType),a):(this.error(c.DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property,r.range,e.internalName),s.unreachable());case p.ElementKind.PROPERTY_PROTOTYPE:this.skippedAutoreleases.has(t)&&(t=this.makeAutorelease(t,o));var d=e.setterPrototype;if(!d)return this.error(c.DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property,r.range,e.internalName),s.unreachable();if(!(g=this.resolver.resolveFunction(d,null,f.makeMap(),h.ReportMode.REPORT)))return s.unreachable();if(!a)return this.makeCallDirect(g,[t],r);var y=assert(e.getterPrototype);if(!(v=this.resolver.resolveFunction(y,null,f.makeMap(),h.ReportMode.REPORT)))return s.unreachable();var T=(R=v.signature.returnType).toNativeType();return s.block(null,[this.makeCallDirect(g,[t],r),this.makeCallDirect(v,null,r)],T);case p.ElementKind.PROPERTY:var g;if(this.skippedAutoreleases.has(t)&&(t=this.makeAutorelease(t,o)),!(g=e.setterInstance))return this.error(c.DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property,r.range,e.internalName),s.unreachable();if(!a){var E=this.compileExpressionRetainType(assert(n),this.options.usizeType);return this.makeCallDirect(g,[E,t],r)}T=(R=(v=assert(e.getterInstance)).signature.returnType).toNativeType();var v,b=this.compileExpressionRetainType(assert(n),this.options.usizeType),I=o.getAndFreeTempLocal(R).index;return s.block(null,[this.makeCallDirect(g,[s.local_tee(I,b),t],r),this.makeCallDirect(v,[s.local_get(I,T)],r)],T);case p.ElementKind.CLASS:if(this.skippedAutoreleases.has(t)&&(t=this.makeAutorelease(t,o)),i){var x=o.is(16384),A=e.lookupOverload(p.OperatorKind.INDEXED_GET,x);if(!A)return this.error(c.DiagnosticCode.Index_signature_is_missing_in_type_0,r.range,e.internalName),s.unreachable();var N=e.lookupOverload(p.OperatorKind.INDEXED_SET,x);if(!N)return this.error(c.DiagnosticCode.Index_signature_in_type_0_only_permits_reading,r.range,e.internalName),this.currentType=a?A.signature.returnType:m.Type.void,s.unreachable();var S=e.type,O=(b=this.compileExpressionRetainType(assert(n),this.options.usizeType),this.compileExpression(i,m.Type.i32,1));if(a){var C=o.getTempLocal(S),k=o.getAndFreeTempLocal(this.currentType),R=A.signature.returnType;return o.freeTempLocal(C),s.block(null,[this.makeCallDirect(N,[s.local_tee(C.index,b),s.local_tee(k.index,O),t],r),this.makeCallDirect(A,[s.local_get(C.index,C.type.toNativeType()),s.local_get(k.index,k.type.toNativeType())],r)],R.toNativeType())}return this.makeCallDirect(N,[b,O,t],r)}}return this.error(c.DiagnosticCode.Operation_not_supported,r.range),s.unreachable()},t.prototype.makeLocalAssignment=function(e,t,r){var n=e.type;assert(n!=m.Type.void);var i=this.currentFlow,a=e.index;if(n.is(512)&&(i.isNonnull(t,n)?i.setLocalFlag(a,_.LocalFlags.NONNULL):i.unsetLocalFlag(a,_.LocalFlags.NONNULL)),i.setLocalFlag(a,_.LocalFlags.WRITTENTO),n.isManaged){var s=this.module,o=n.toNativeType();return i.isAnyLocalFlag(a,_.LocalFlags.ANY_RETAINED)?this.skippedAutoreleases.has(t)?(t=this.makeSkippedRelease(s.local_get(a,o),t),r?(this.currentType=n,s.local_tee(a,t)):(this.currentType=m.Type.void,s.local_set(a,t))):(t=this.makeRetainRelease(s.local_get(a,o),t),r?(this.currentType=n,s.local_tee(a,t)):(this.currentType=m.Type.void,s.local_set(a,t))):(i.unsetLocalFlag(a,_.LocalFlags.CONDITIONALLY_RETAINED),i.setLocalFlag(a,_.LocalFlags.RETAINED),this.skippedAutoreleases.has(t)||(t=this.makeRetain(t)),r?(this.currentType=n,s.local_tee(a,t)):(this.currentType=m.Type.void,s.local_set(a,t)))}return n.is(36)&&(i.canOverflow(t,n)?i.unsetLocalFlag(a,_.LocalFlags.WRAPPED):i.setLocalFlag(a,_.LocalFlags.WRAPPED)),r?(this.currentType=n,this.module.local_tee(a,t)):(this.currentType=m.Type.void,this.module.local_set(a,t))},t.prototype.makeGlobalAssignment=function(e,t,r){var n=this.module,i=e.type;assert(i!=m.Type.void);var a=i.toNativeType();return i.isManaged?this.skippedAutoreleases.has(t)?r?(this.currentType=i,n.block(null,[n.global_set(e.internalName,this.makeSkippedRelease(n.global_get(e.internalName,a),t)),n.global_get(e.internalName,a)],a)):(this.currentType=m.Type.void,n.global_set(e.internalName,this.makeSkippedRelease(n.global_get(e.internalName,a),t))):r?(this.currentType=i,n.block(null,[n.global_set(e.internalName,this.makeRetainRelease(n.global_get(e.internalName,a),t)),n.global_get(e.internalName,a)],a)):(this.currentType=m.Type.void,n.global_set(e.internalName,this.makeRetainRelease(n.global_get(e.internalName,a),t))):(t=this.ensureSmallIntegerWrap(t,i),r?(this.currentType=i,n.block(null,[n.global_set(e.internalName,t),n.global_get(e.internalName,a)],a)):(this.currentType=m.Type.void,n.global_set(e.internalName,t)))},t.prototype.makeFieldAssignment=function(e,t,r,n){var i=this.module,a=this.currentFlow,s=e.type,o=s.toNativeType();assert(e.parent.kind==p.ElementKind.CLASS);var c=e.parent.type,l=c.toNativeType();if(s.isManaged&&c.isManaged){var u=a.getTempLocal(c);if(this.skippedAutoreleases.has(t)){if(n){var h=a.getAndFreeTempLocal(s);return a.canOverflow(t,s)||a.setLocalFlag(h.index,_.LocalFlags.WRAPPED),a.isNonnull(t,s)&&a.setLocalFlag(h.index,_.LocalFlags.NONNULL),a.freeTempLocal(u),this.currentType=s,i.block(null,[i.store(s.byteSize,i.local_tee(u.index,r),this.makeSkippedRelease(i.load(s.byteSize,s.is(1),i.local_get(u.index,l),o,e.memoryOffset),i.local_tee(h.index,t)),o,e.memoryOffset),i.local_get(h.index,o)],o)}return a.freeTempLocal(u),this.currentType=m.Type.void,i.store(s.byteSize,i.local_tee(u.index,r),this.makeSkippedRelease(i.load(s.byteSize,s.is(1),i.local_get(u.index,l),o,e.memoryOffset),t),o,e.memoryOffset)}if(n){h=a.getAndFreeTempLocal(s);return a.canOverflow(t,s)||a.setLocalFlag(h.index,_.LocalFlags.WRAPPED),a.isNonnull(t,s)&&a.setLocalFlag(h.index,_.LocalFlags.NONNULL),a.freeTempLocal(u),this.currentType=s,i.block(null,[i.store(s.byteSize,i.local_tee(u.index,r),this.makeRetainRelease(i.load(s.byteSize,s.is(1),i.local_get(u.index,l),o,e.memoryOffset),i.local_tee(h.index,t)),o,e.memoryOffset),i.local_get(h.index,o)],o)}return a.freeTempLocal(u),this.currentType=m.Type.void,i.store(s.byteSize,i.local_tee(u.index,r),this.makeRetainRelease(i.load(s.byteSize,s.is(1),i.local_get(u.index,l),o,e.memoryOffset),t),o,e.memoryOffset)}if(n){h=a.getAndFreeTempLocal(s);return a.canOverflow(t,s)||a.setLocalFlag(h.index,_.LocalFlags.WRAPPED),a.isNonnull(t,s)&&a.setLocalFlag(h.index,_.LocalFlags.NONNULL),this.currentType=s,i.block(null,[i.store(s.byteSize,r,i.local_tee(h.index,t),o,e.memoryOffset),i.local_get(h.index,o)],o)}return this.currentType=m.Type.void,i.store(s.byteSize,r,t,o,e.memoryOffset)},t.prototype.compileCallExpression=function(e,t,r){var n=this.module,i=this.currentFlow;if(e.expression.kind==y.NodeKind.SUPER){var a=this.currentFlow,s=a.actualFunction;if(!s.is(u.CommonFlags.CONSTRUCTOR))return this.error(c.DiagnosticCode.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors,e.range),n.unreachable();var o=assert(s.parent);assert(o.kind==p.ElementKind.CLASS);var _=assert(o.base),h=assert(a.lookupLocal(u.CommonSymbols.this_)),d=this.options.nativeSizeType,T=this.compileCallDirect(this.ensureConstructor(_,e),e.arguments,e,n.if(n.local_get(h.index,d),n.local_get(h.index,d),this.makeRetain(this.makeAllocation(o))),16);assert(this.skippedAutoreleases.has(T));var g=[n.local_set(h.index,T)];return this.makeFieldInitialization(o,g),a.isAny(4160)?(this.error(c.DiagnosticCode._super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class,e.range),n.unreachable()):(a.set(192),this.currentType=m.Type.void,n.block(null,g))}var E,v,b=this.resolver.resolveExpression(e.expression,i);if(!b)return n.unreachable();switch(b.kind){case p.ElementKind.FUNCTION_PROTOTYPE:var I=b,x=e.typeArguments;if(I.hasDecorator(p.DecoratorFlags.BUILTIN))return this.compileCallExpressionBuiltin(I,e,t);var A=null;if(x){if(!I.is(u.CommonFlags.GENERIC))return this.error(c.DiagnosticCode.Type_0_is_not_generic,e.expression.range,I.internalName),n.unreachable();A=this.resolver.resolveFunctionInclTypeArguments(I,x,i.actualFunction.parent,f.makeMap(i.contextualTypeArguments),e)}else{if(I.is(u.CommonFlags.GENERIC)){for(var N=new Map,S=assert(I.typeParameterNodes),O=S.length,C=0;Cs&&!i)||(this.error(c.DiagnosticCode.Expected_0_arguments_but_got_1,n.range,s.toString(),t.toString()),!1)},t.prototype.compileCallDirect=function(e,t,r,n,i){void 0===n&&(n=0),void 0===i&&(i=0);var a=t.length,s=e.signature;if(!this.checkCallSignature(s,a,0!=n,r))return this.currentType=s.returnType,this.module.unreachable();if(e.hasDecorator(p.DecoratorFlags.INLINE)){if(assert(!e.is(u.CommonFlags.TRAMPOLINE)),!this.currentInlineFunctions.includes(e)){this.currentInlineFunctions.push(e);var o=s.parameterTypes;assert(a<=o.length);for(var l=new Array(a),_=0;_=0;--f){var T=t[f],g=o[f],E=h.addScopedLocal(s.getParameterName(f),g,y);_.findUsedLocals(T,y),l.canOverflow(T,g)||h.setLocalFlag(E.index,_.LocalFlags.WRAPPED),h.isNonnull(T,g)&&h.setLocalFlag(E.index,_.LocalFlags.NONNULL),g.isManaged&&(this.skippedAutoreleases.has(T)||(T=this.makeRetain(T)),h.setLocalFlag(E.index,_.LocalFlags.RETAINED)),d.unshift(i.local_set(E.index,T))}if(r){var v=assert(e.parent);assert(v.kind==p.ElementKind.CLASS);var b=assert(e.signature.thisType),I=h.addScopedLocal(u.CommonSymbols.this_,b,y);d.unshift(i.local_set(I.index,r));var x=v.base;x&&h.addScopedAlias(u.CommonSymbols.super_,x.type,I.index)}else assert(!e.signature.thisType);this.currentFlow=h;for(f=a;fa){var s=r.toNativeType(),o=e.getAndFreeTempLocal(r);e.canOverflow(t,r)||e.setLocalFlag(o.index,_.LocalFlags.WRAPPED),e.isNonnull(t,r)&&e.setLocalFlag(o.index,_.LocalFlags.NONNULL);var c=this.module;return n[a-1]=c.local_set(o.index,t),n.push(c.local_get(o.index,s)),c.block(null,n,s)}return n.length>1?(n[a-1]=t,this.module.block(null,n,r.toNativeType())):t},t.prototype.finishAutoreleases=function(e,t){var r,n,i=this.module;if(e.is(8192)){for(var s=void 0;s=e.parent;)e=s;this.performAutoreleases(e,t,!1)}else try{for(var o=a(e.parentFunction.localsByIndex),c=o.next();!c.done;c=o.next()){var l=c.value,u=l.index;e.isAnyLocalFlag(u,_.LocalFlags.ANY_RETAINED)&&(e.unsetLocalFlag(u,_.LocalFlags.ANY_RETAINED),t.push(this.makeRelease(i.local_get(u,l.type.toNativeType()))))}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}},t.prototype.makeCallDirect=function(e,t,r,n,i){void 0===n&&(n=!1),void 0===i&&(i=!1),e.hasDecorator(p.DecoratorFlags.INLINE)&&this.warning(c.DiagnosticCode.TODO_Cannot_inline_inferred_calls_and_specific_internals_yet,r.range,e.internalName);var a=t?t.length:0,s=a,o=e.signature.requiredParameters,l=e.signature.parameterTypes.length,_=l;e.is(u.CommonFlags.INSTANCE)&&(++o,++_,--s),assert(a>=o);var h=this.module;if(!this.compileFunction(e))return h.unreachable();var d=e.signature.returnType,f=e.is(u.CommonFlags.MODULE_IMPORT);if(a<_){t||((t=new Array(_)).length=0);var T=e.signature.parameterTypes,g=e.prototype.signatureNode.parameters;assert(g.length==T.length);for(var E=!0,v=s;v=s),this.ensureFunctionType(e.parameterTypes,e.returnType,e.thisType);var l=this.module;if(iT)return this.error(c.DiagnosticCode.Expected_0_arguments_but_got_1,e.range,T.toString(),h.toString()),this.module.unreachable();for(var g=new Array(h),E=0;E=0),S.is(512)&&i.isLocalFlag(O,_.LocalFlags.NONNULL,!1)&&(S=S.nonNullableType),this.currentType=S,this.module.local_get(O,S.toNativeType());case p.ElementKind.GLOBAL:if(!this.compileGlobal(N))return this.module.unreachable();S=N.type;return assert(S!=m.Type.void),N.is(u.CommonFlags.INLINED)?this.compileInlineConstant(N,t,r):(this.currentType=S,this.module.global_get(N.internalName,S.toNativeType()));case p.ElementKind.ENUMVALUE:return N.is(u.CommonFlags.COMPILED)?(this.currentType=m.Type.i32,N.is(u.CommonFlags.INLINED)?(assert(1==N.constantValueKind),this.module.i32(i64_low(N.constantIntegerValue))):this.module.global_get(N.internalName,l.NativeType.I32)):(this.error(c.DiagnosticCode.A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums,e.range),this.currentType=m.Type.i32,this.module.unreachable());case p.ElementKind.FUNCTION_PROTOTYPE:var C=this.resolver.resolveFunction(N,null,f.makeMap(i.contextualTypeArguments));if(!C||!this.compileFunction(C))return n.unreachable();var k=this.ensureFunctionTableEntry(C);return this.currentType=C.signature.type,this.module.i32(k)}return this.error(c.DiagnosticCode.Operation_not_supported,e.range),this.module.unreachable()},t.prototype.compileInstanceOfExpression=function(e,t,r){var n=this.module,i=this.compileExpressionRetainType(e.expression,this.options.usizeType),a=this.currentType,s=this.resolver.resolveType(e.isType,this.currentFlow.actualFunction);if(this.currentType=m.Type.bool,!s)return n.unreachable();if(!s.is(256))return n.block(null,[this.convertExpression(i,a,m.Type.void,0!=(2&r),!1,e.expression),n.i32(a==s?1:0)],l.NativeType.I32);if(!a.is(256))return n.block(null,[this.convertExpression(i,a,m.Type.void,0!=(2&r),!1,e.expression),n.i32(0)],l.NativeType.I32);var o=a.toNativeType();if(a.is(512)&&!s.is(512)){if(a.nonNullableType.isAssignableTo(s))return n.binary(o==l.NativeType.I64?l.BinaryOp.NeI64:l.BinaryOp.NeI32,i,a.toNativeZero(n));if(s.isAssignableTo(a)){var u=this.program;if(!a.isUnmanaged&&!s.isUnmanaged){var p=this.currentFlow.getAndFreeTempLocal(a),_=assert(u.instanceofInstance);return this.compileFunction(_),n.if(n.unary(o==l.NativeType.I64?l.UnaryOp.EqzI64:l.UnaryOp.EqzI32,n.local_tee(p.index,i)),n.i32(0),this.makeCallDirect(_,[n.local_get(p.index,o),n.i32(s.classReference.id)],e))}this.error(c.DiagnosticCode.Operation_not_supported,e.range)}}else{if(a.isAssignableTo(s))return n.block(null,[this.convertExpression(i,a,m.Type.void,0!=(2&r),!1,e.expression),n.i32(1)],l.NativeType.I32);if(s.isAssignableTo(a)){u=this.program;if(!a.isUnmanaged&&!s.isUnmanaged){p=this.currentFlow.getAndFreeTempLocal(a),_=assert(u.instanceofInstance);return this.compileFunction(_),n.if(n.unary(o==l.NativeType.I64?l.UnaryOp.EqzI64:l.UnaryOp.EqzI32,n.local_tee(p.index,i)),n.i32(0),this.makeCallDirect(_,[n.local_get(p.index,o),n.i32(s.classReference.id)],e))}this.error(c.DiagnosticCode.Operation_not_supported,e.range)}}return n.block(null,[this.convertExpression(i,a,m.Type.void,0!=(2&r),!1,e.expression),n.i32(0)],l.NativeType.I32)},t.prototype.compileLiteralExpression=function(e,t,r,n){void 0===n&&(n=!1);var i=this.module;switch(e.literalKind){case y.LiteralKind.ARRAY:assert(!n);var a=t.classReference;return a&&a.prototype==this.program.arrayPrototype?this.compileArrayLiteral(assert(a.typeArguments)[0],e.elementExpressions,!1,r,e):(this.error(c.DiagnosticCode.Operation_not_supported,e.range),i.unreachable());case y.LiteralKind.FLOAT:var s=e.value;return n&&(s=-s),t==m.Type.f32?i.f32(s):(this.currentType=m.Type.f64,i.f64(s));case y.LiteralKind.INTEGER:var o=e.value;n&&(o=i64_sub(i64_new(0),o));var l=this.resolver.determineIntegerLiteralType(o,t);switch(this.currentType=l,l.kind){case 4:if(!this.options.isWasm64)return i.i32(i64_low(o));case 3:return i.i64(i64_low(o),i64_high(o));case 9:if(!this.options.isWasm64)return i.i32(i64_low(o));case 8:return i.i64(i64_low(o),i64_high(o));case 11:return i.f32(i64_to_f32(o));case 12:return i.f64(i64_to_f64(o));default:return i.i32(i64_low(o))}case y.LiteralKind.STRING:return assert(!n),this.compileStringLiteral(e);case y.LiteralKind.OBJECT:return assert(!n),this.compileObjectLiteral(e,t)}return this.error(c.DiagnosticCode.Operation_not_supported,e.range),this.currentType=t,i.unreachable()},t.prototype.compileStringLiteral=function(e){return this.ensureStaticString(e.value)},t.prototype.compileArrayLiteral=function(e,t,r,n,i){for(var a=this.module,s=this.program,o=assert(s.arrayPrototype),u=assert(this.resolver.resolveClass(o,[e])),_=assert(s.arrayBufferInstance),h=u.type,d=this.currentFlow,y=d.getTempLocal(h),m=d.getTempLocal(_.type),f=t.length,T=new Array(f),g=!0,E=e.toNativeType(),v=0;v",t.toString()),r.unreachable();var i=n.constructorInstance;if(i){if(i.signature.requiredParameters)return this.error(c.DiagnosticCode.Constructor_of_class_0_must_not_require_any_arguments,e.range,n.toString()),r.unreachable();if(i.is(u.CommonFlags.PRIVATE))return this.error(c.DiagnosticCode.Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration,e.range,n.toString()),r.unreachable();if(i.is(u.CommonFlags.PROTECTED))return this.error(c.DiagnosticCode.Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration,e.range,n.toString()),r.unreachable()}var a=e.names,s=a.length,o=e.values,l=n.members,_=!1,h=new Array(s+2),d=this.currentFlow.getAutoreleaseLocal(this.options.usizeType);assert(s==o.length);for(var y=0,m=s;yI)for(T=I;T=0);var _=this.compileExpressionRetainType(assert(this.resolver.currentThisExpression),this.options.usizeType);return this.currentType=a.type,n.load(a.type.byteSize,a.type.is(5),_,a.type.toNativeType(),a.memoryOffset);case p.ElementKind.PROPERTY_PROTOTYPE:var h=a.getterPrototype;if(h){var d=this.resolver.resolveFunction(h,null);if(d)return this.compileCallDirect(d,[],e,0)}return n.unreachable();case p.ElementKind.PROPERTY:var y=assert(a.getterInstance);return this.compileCallDirect(y,[],e,this.compileExpressionRetainType(assert(this.resolver.currentThisExpression),this.options.usizeType));case p.ElementKind.FUNCTION_PROTOTYPE:return this.error(c.DiagnosticCode.Cannot_access_method_0_without_calling_it_as_it_requires_this_to_be_set,e.range,a.name),n.unreachable()}return this.error(c.DiagnosticCode.Operation_not_supported,e.range),n.unreachable()},t.prototype.compileTernaryExpression=function(e,t,r){var n=e.ifThen,i=e.ifElse,a=this.currentFlow,s=this.module.precomputeExpression(this.makeIsTrueish(this.compileExpressionRetainType(e.condition,m.Type.bool),this.currentType));if(l.getExpressionId(s)==l.ExpressionId.Const&&l.getExpressionType(s)==l.NativeType.I32)return l.getConstValueI32(s)?this.compileExpressionRetainType(n,t):this.compileExpressionRetainType(i,t);var o=a.fork();this.currentFlow=o;var u=this.compileExpressionRetainType(n,t,16&r),p=this.currentType,_=this.skippedAutoreleases.has(u),h=a.fork();this.currentFlow=h;var d=this.compileExpressionRetainType(i,t,16&r),y=this.currentType,f=this.skippedAutoreleases.has(d),T=m.Type.commonDenominator(p,y,!1);if(!T)return this.error(c.DiagnosticCode.Type_0_is_not_assignable_to_type_1,i.range,y.toString(),p.toString()),this.currentType=t,this.module.unreachable();u=this.convertExpression(u,p,T,!1,!1,n),d=this.convertExpression(d,y,T,!1,!1,i),this.currentType=T,_!=f?_?(d=this.makeRetain(d),f=!0):(u=this.makeRetain(u),_=!0):!_&&T.isManaged&&(u=this.moveAutorelease(u,o,a),d=this.moveAutorelease(d,h,a)),u=this.performAutoreleasesWithValue(o,u,T),o.freeScopedLocals(),d=this.performAutoreleasesWithValue(h,d,T),h.freeScopedLocals(),this.currentFlow=a,a.inheritMutual(o,h);var g=this.module.if(s,u,d);return assert(_==f),_&&this.skippedAutoreleases.add(g),g},t.prototype.compileUnaryPostfixExpression=function(e,t,r){var n=this.module,i=this.currentFlow,a=this.compileExpression(e.operand,t==m.Type.void?m.Type.i32:t,0);if(l.getExpressionId(a)==l.ExpressionId.Unreachable)return a;var s,o=null;switch(t!=m.Type.void&&(o=i.getTempLocal(this.currentType),a=n.local_tee(o.index,a)),e.operator){case d.Token.PLUS_PLUS:switch(this.currentType.kind){case 0:case 1:case 2:case 5:case 6:case 7:case 10:s=n.binary(l.BinaryOp.AddI32,a,n.i32(1));break;case 9:if(this.currentType.is(256)){if(_=this.currentType.classReference)if(h=_.lookupOverload(p.OperatorKind.POSTFIX_INC)){s=this.compileUnaryOverload(h,e.operand,a,e);break}return this.error(c.DiagnosticCode.Operation_not_supported,e.range),n.unreachable()}case 4:var u=this.options;s=n.binary(u.isWasm64?l.BinaryOp.AddI64:l.BinaryOp.AddI32,a,this.currentType.toNativeOne(n));break;case 3:case 8:s=n.binary(l.BinaryOp.AddI64,a,n.i64(1));break;case 11:s=n.binary(l.BinaryOp.AddF32,a,n.f32(1));break;case 12:s=n.binary(l.BinaryOp.AddF64,a,n.f64(1));break;default:return assert(!1),n.unreachable()}break;case d.Token.MINUS_MINUS:switch(this.currentType.kind){case 0:case 1:case 2:case 5:case 6:case 7:case 10:s=n.binary(l.BinaryOp.SubI32,a,n.i32(1));break;case 9:if(this.currentType.is(256)){var _,h;if(_=this.currentType.classReference)if(h=_.lookupOverload(p.OperatorKind.POSTFIX_DEC)){s=this.compileUnaryOverload(h,e.operand,a,e);break}return this.error(c.DiagnosticCode.Operation_not_supported,e.range),n.unreachable()}case 4:u=this.options;s=n.binary(u.isWasm64?l.BinaryOp.SubI64:l.BinaryOp.SubI32,a,this.currentType.toNativeOne(n));break;case 3:case 8:s=n.binary(l.BinaryOp.SubI64,a,n.i64(1));break;case 11:s=n.binary(l.BinaryOp.SubF32,a,n.f32(1));break;case 12:s=n.binary(l.BinaryOp.SubF64,a,n.f64(1));break;default:return assert(!1),n.unreachable()}break;default:return assert(!1),n.unreachable()}var y=this.resolver,f=y.resolveExpression(e.operand,i);if(!o)return this.currentType=m.Type.void,f?this.makeAssignment(f,s,e.operand,y.currentThisExpression,y.currentElementExpression,!1):n.unreachable();if(!f)return n.unreachable();var T=this.makeAssignment(f,s,e.operand,y.currentThisExpression,y.currentElementExpression,!1);this.currentType=o.type,i.freeTempLocal(o);var g=o.type.toNativeType();return n.block(null,[T,n.local_get(o.index,g)],g)},t.prototype.compileUnaryPrefixExpression=function(e,t,r){var n,i=this.module,a=!1;switch(e.operator){case d.Token.PLUS:if(n=this.compileExpression(e.operand,t==m.Type.void?m.Type.i32:t,0),this.currentType.is(256)){if(s=this.currentType.classReference)if(o=s.lookupOverload(p.OperatorKind.PLUS)){n=this.compileUnaryOverload(o,e.operand,n,e);break}return this.error(c.DiagnosticCode.Operation_not_supported,e.range),i.unreachable()}break;case d.Token.MINUS:if(e.operand.kind==y.NodeKind.LITERAL&&(e.operand.literalKind==y.LiteralKind.INTEGER||e.operand.literalKind==y.LiteralKind.FLOAT)){n=this.compileLiteralExpression(e.operand,t,0,!0),this.options.sourceMap&&this.addDebugLocation(n,e.range);break}if(n=this.compileExpression(e.operand,t==m.Type.void?m.Type.i32:t,0),this.currentType.is(256)){if(s=this.currentType.classReference)if(o=s.lookupOverload(p.OperatorKind.MINUS)){n=this.compileUnaryOverload(o,e.operand,n,e);break}return this.error(c.DiagnosticCode.Operation_not_supported,e.range),i.unreachable()}switch(this.currentType.kind){case 0:case 1:case 2:case 5:case 6:case 7:case 10:n=i.binary(l.BinaryOp.SubI32,i.i32(0),n);break;case 9:case 4:n=i.binary(this.options.isWasm64?l.BinaryOp.SubI64:l.BinaryOp.SubI32,this.currentType.toNativeZero(i),n);break;case 3:case 8:n=i.binary(l.BinaryOp.SubI64,i.i64(0),n);break;case 11:n=i.unary(l.UnaryOp.NegF32,n);break;case 12:n=i.unary(l.UnaryOp.NegF64,n);break;default:assert(!1),n=i.unreachable()}break;case d.Token.PLUS_PLUS:if(a=!0,n=this.compileExpression(e.operand,t==m.Type.void?m.Type.i32:t,0),this.currentType.is(256)){if(s=this.currentType.classReference)if(o=s.lookupOverload(p.OperatorKind.PREFIX_INC)){n=this.compileUnaryOverload(o,e.operand,n,e);break}return this.error(c.DiagnosticCode.Operation_not_supported,e.range),i.unreachable()}switch(this.currentType.kind){case 0:case 1:case 2:case 5:case 6:case 7:case 10:n=i.binary(l.BinaryOp.AddI32,n,this.module.i32(1));break;case 9:case 4:n=i.binary(this.options.isWasm64?l.BinaryOp.AddI64:l.BinaryOp.AddI32,n,this.currentType.toNativeOne(i));break;case 3:case 8:n=i.binary(l.BinaryOp.AddI64,n,i.i64(1));break;case 11:n=i.binary(l.BinaryOp.AddF32,n,i.f32(1));break;case 12:n=i.binary(l.BinaryOp.AddF64,n,i.f64(1));break;default:assert(!1),n=i.unreachable()}break;case d.Token.MINUS_MINUS:if(a=!0,n=this.compileExpression(e.operand,t==m.Type.void?m.Type.i32:t,0),this.currentType.is(256)){if(s=this.currentType.classReference)if(o=s.lookupOverload(p.OperatorKind.PREFIX_DEC)){n=this.compileUnaryOverload(o,e.operand,n,e);break}return this.error(c.DiagnosticCode.Operation_not_supported,e.range),i.unreachable()}switch(this.currentType.kind){case 0:case 1:case 2:case 5:case 6:case 7:case 10:n=i.binary(l.BinaryOp.SubI32,n,i.i32(1));break;case 9:case 4:n=i.binary(this.options.isWasm64?l.BinaryOp.SubI64:l.BinaryOp.SubI32,n,this.currentType.toNativeOne(i));break;case 3:case 8:n=i.binary(l.BinaryOp.SubI64,n,i.i64(1));break;case 11:n=i.binary(l.BinaryOp.SubF32,n,i.f32(1));break;case 12:n=i.binary(l.BinaryOp.SubF64,n,i.f64(1));break;default:assert(!1),n=i.unreachable()}break;case d.Token.EXCLAMATION:if(n=this.compileExpression(e.operand,t==m.Type.void?m.Type.i32:t,0),this.currentType.is(256))if(s=this.currentType.classReference)if(o=s.lookupOverload(p.OperatorKind.NOT)){n=this.compileUnaryOverload(o,e.operand,n,e);break}n=this.makeIsFalseish(n,this.currentType),this.currentType=m.Type.bool;break;case d.Token.TILDE:if(n=this.compileExpression(e.operand,t==m.Type.void?m.Type.i32:t.is(8)?m.Type.i64:t,0),this.currentType.is(256)){var s,o;if(s=this.currentType.classReference)if(o=s.lookupOverload(p.OperatorKind.BITWISE_NOT)){n=this.compileUnaryOverload(o,e.operand,n,e);break}return this.error(c.DiagnosticCode.Operation_not_supported,e.range),i.unreachable()}switch(n=this.convertExpression(n,this.currentType,this.currentType.intType,!1,!1,e.operand),this.currentType.kind){case 0:case 1:case 2:case 5:case 6:case 7:case 10:n=i.binary(l.BinaryOp.XorI32,n,i.i32(-1));break;case 9:case 4:n=i.binary(this.options.isWasm64?l.BinaryOp.XorI64:l.BinaryOp.XorI32,n,this.currentType.toNativeNegOne(i));break;case 3:case 8:n=i.binary(l.BinaryOp.XorI64,n,i.i64(-1,-1));break;default:assert(!1),n=i.unreachable()}break;case d.Token.TYPEOF:return this.error(c.DiagnosticCode.Operation_not_supported,e.range),i.unreachable();default:return assert(!1),i.unreachable()}if(!a)return n;var u=this.resolver,_=u.resolveExpression(e.operand,this.currentFlow);return _?this.makeAssignment(_,n,e.operand,u.currentThisExpression,u.currentElementExpression,t!=m.Type.void):i.unreachable()},t.prototype.ensureSmallIntegerWrap=function(e,t){var r=this.module,n=this.currentFlow;switch(t.kind){case 0:n.canOverflow(e,t)&&(e=this.options.hasFeature(1)?r.unary(l.UnaryOp.ExtendI8ToI32,e):r.binary(l.BinaryOp.ShrI32,r.binary(l.BinaryOp.ShlI32,e,r.i32(24)),r.i32(24)));break;case 1:n.canOverflow(e,t)&&(e=this.options.hasFeature(1)?r.unary(l.UnaryOp.ExtendI16ToI32,e):r.binary(l.BinaryOp.ShrI32,r.binary(l.BinaryOp.ShlI32,e,r.i32(16)),r.i32(16)));break;case 5:n.canOverflow(e,t)&&(e=r.binary(l.BinaryOp.AndI32,e,r.i32(255)));break;case 6:n.canOverflow(e,t)&&(e=r.binary(l.BinaryOp.AndI32,e,r.i32(65535)));break;case 10:n.canOverflow(e,t)&&(e=r.binary(l.BinaryOp.NeI32,e,r.i32(0)))}return e},t.prototype.addDebugLocation=function(e,t){var r=this.currentFlow.parentFunction,n=t.source;n.debugInfoIndex<0&&(n.debugInfoIndex=this.module.addDebugInfoFile(n.normalizedPath)),t.debugInfoRef=e,r.debugLocations.push(t)},t.prototype.makeIsFalseish=function(e,t){var r=this.module;switch(t.kind){case 0:case 1:case 5:case 6:case 10:e=this.ensureSmallIntegerWrap(e,t);case 2:case 7:return r.unary(l.UnaryOp.EqzI32,e);case 3:case 8:return r.unary(l.UnaryOp.EqzI64,e);case 9:this.skippedAutoreleases.has(e)&&(e=this.makeAutorelease(e));case 4:return r.unary(64==t.size?l.UnaryOp.EqzI64:l.UnaryOp.EqzI32,e);case 11:return r.binary(l.BinaryOp.EqF32,e,r.f32(0));case 12:return r.binary(l.BinaryOp.EqF64,e,r.f64(0));default:return assert(!1),r.i32(1)}},t.prototype.makeIsTrueish=function(e,t){var r=this.module;switch(t.kind){case 0:case 1:case 5:case 6:e=this.ensureSmallIntegerWrap(e,t);case 10:case 2:case 7:return e;case 3:case 8:return r.binary(l.BinaryOp.NeI64,e,r.i64(0));case 9:this.skippedAutoreleases.has(e)&&(e=this.makeAutorelease(e));case 4:return 64==t.size?r.binary(l.BinaryOp.NeI64,e,r.i64(0)):e;case 11:return r.binary(l.BinaryOp.NeF32,e,r.f32(0));case 12:return r.binary(l.BinaryOp.NeF64,e,r.f64(0));default:return assert(!1),r.i32(0)}},t.prototype.makeAllocation=function(e){var t=this.program;assert(e.program==t);var r=this.module,n=this.options;this.currentType=e.type;var i=t.allocInstance;return this.compileFunction(i),r.call(i.internalName,[n.isWasm64?r.i64(e.currentMemoryOffset):r.i32(e.currentMemoryOffset),r.i32(e.hasDecorator(p.DecoratorFlags.UNMANAGED)?0:e.id)],n.nativeSizeType)},t.prototype.makeFieldInitialization=function(e,t){var r,n;void 0===t&&(t=[]);var i=e.members;if(!i)return[];var s=this.module,o=this.currentFlow,c=o.is(8192),l=c?assert(o.lookupLocal(u.CommonSymbols.this_)).index:0,_=this.options.nativeSizeType;try{for(var h=a(i.values()),d=h.next();!d.done;d=h.next()){var y=d.value;if(y.kind==p.ElementKind.FIELD&&y.parent==e){var m=y;assert(!m.isAny(u.CommonFlags.CONST));var f=m.type,T=f.toNativeType(),g=m.prototype.initializerNode;if(g){var E=this.compileExpression(g,f,17);f.isManaged&&!this.skippedAutoreleases.has(E)&&(E=this.makeRetain(E)),t.push(s.store(f.byteSize,s.local_get(l,_),E,T,m.memoryOffset))}else{var v=m.prototype.parameterIndex;t.push(s.store(f.byteSize,s.local_get(l,_),v>=0?s.local_get(c?assert(o.lookupLocal(m.name)).index:1+v,T):f.toNativeZero(s),T,m.memoryOffset))}}}}catch(e){r={error:e}}finally{try{d&&!d.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}return t},t.prototype.makeInstanceOfClass=function(e,t){var r=this.module,n=this.currentFlow,i=n.getTempLocal(m.Type.i32),a=r.load(4,!1,r.binary(l.BinaryOp.SubI32,e,r.i32(this.program.runtimeHeaderSize)),l.NativeType.I32),s="instanceof_"+t.name+"|"+n.pushBreakLabel(),o=[];return o.push(r.drop(r.br(s,r.binary(l.BinaryOp.EqI32,r.local_tee(i.index,a),r.i32(t.id)),r.i32(1)))),o.push(r.i32(0)),n.freeTempLocal(i),n.popBreakLabel(),r.block(s,o,l.NativeType.I32)},t}(c.DiagnosticEmitter);function b(e,t){if(g=t.range.source.simplePath,E=p.mangleInternalName(e.name,e.parent,e.is(u.CommonFlags.INSTANCE),!0),e.hasDecorator(p.DecoratorFlags.EXTERNAL)){var r=e.program,n=assert(y.findDecorator(y.DecoratorKind.EXTERNAL,t.decorators)),i=n.arguments;if(i&&i.length){var a=i[0];a.kind==y.NodeKind.LITERAL&&a.literalKind==y.LiteralKind.STRING?(E=a.value,i.length>=2&&((a=i[1]).kind==y.NodeKind.LITERAL&&a.literalKind==y.LiteralKind.STRING?(g=E,E=a.value,i.length>2&&r.error(c.DiagnosticCode.Expected_0_arguments_but_got_1,n.range,"2",i.length.toString())):r.error(c.DiagnosticCode.String_literal_expected,a.range))):r.error(c.DiagnosticCode.String_literal_expected,a.range)}else r.error(c.DiagnosticCode.Expected_at_least_0_arguments_but_got_1,n.range,"1","0")}}function I(e,t,r){var n=t.length;return 0==n?e.nop():1==n?t[0]:e.block(null,t,r==l.NativeType.Auto?l.getExpressionType(t[n-1]):r)}t.Compiler=v,t.flatten=I},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Operation_not_supported=100]="Operation_not_supported",e[e.Operation_is_unsafe=101]="Operation_is_unsafe",e[e.User_defined_0=102]="User_defined_0",e[e.Conversion_from_type_0_to_1_requires_an_explicit_cast=200]="Conversion_from_type_0_to_1_requires_an_explicit_cast",e[e.Conversion_from_type_0_to_1_will_require_an_explicit_cast_when_switching_between_32_64_bit=201]="Conversion_from_type_0_to_1_will_require_an_explicit_cast_when_switching_between_32_64_bit",e[e.Type_0_cannot_be_changed_to_type_1=202]="Type_0_cannot_be_changed_to_type_1",e[e.Type_0_cannot_be_reinterpreted_as_type_1=203]="Type_0_cannot_be_reinterpreted_as_type_1",e[e.Basic_type_0_cannot_be_nullable=204]="Basic_type_0_cannot_be_nullable",e[e.Cannot_export_a_mutable_global=205]="Cannot_export_a_mutable_global",e[e.Mutable_value_cannot_be_inlined=206]="Mutable_value_cannot_be_inlined",e[e.Unmanaged_classes_cannot_extend_managed_classes_and_vice_versa=207]="Unmanaged_classes_cannot_extend_managed_classes_and_vice_versa",e[e.Unmanaged_classes_cannot_implement_interfaces=208]="Unmanaged_classes_cannot_implement_interfaces",e[e.Invalid_regular_expression_flags=209]="Invalid_regular_expression_flags",e[e.Implementation_0_must_match_the_signature_1=210]="Implementation_0_must_match_the_signature_1",e[e.Class_0_is_sealed_and_cannot_be_extended=211]="Class_0_is_sealed_and_cannot_be_extended",e[e.Decorator_0_is_not_valid_here=212]="Decorator_0_is_not_valid_here",e[e.Duplicate_decorator=213]="Duplicate_decorator",e[e.An_allocator_must_be_present_to_use_0=214]="An_allocator_must_be_present_to_use_0",e[e.Optional_parameter_must_have_an_initializer=215]="Optional_parameter_must_have_an_initializer",e[e.Constructor_of_class_0_must_not_require_any_arguments=216]="Constructor_of_class_0_must_not_require_any_arguments",e[e.Function_0_cannot_be_inlined_into_itself=217]="Function_0_cannot_be_inlined_into_itself",e[e.Cannot_access_method_0_without_calling_it_as_it_requires_this_to_be_set=218]="Cannot_access_method_0_without_calling_it_as_it_requires_this_to_be_set",e[e.Optional_properties_are_not_supported=219]="Optional_properties_are_not_supported",e[e.Expression_must_be_a_compile_time_constant=220]="Expression_must_be_a_compile_time_constant",e[e.Module_cannot_have_multiple_start_functions=221]="Module_cannot_have_multiple_start_functions",e[e._0_must_be_a_value_between_1_and_2_inclusive=222]="_0_must_be_a_value_between_1_and_2_inclusive",e[e._0_must_be_a_power_of_two=223]="_0_must_be_a_power_of_two",e[e.TODO_Cannot_inline_inferred_calls_and_specific_internals_yet=224]="TODO_Cannot_inline_inferred_calls_and_specific_internals_yet",e[e.Expression_is_never_null=225]="Expression_is_never_null",e[e.Unterminated_string_literal=1002]="Unterminated_string_literal",e[e.Identifier_expected=1003]="Identifier_expected",e[e._0_expected=1005]="_0_expected",e[e.A_file_cannot_have_a_reference_to_itself=1006]="A_file_cannot_have_a_reference_to_itself",e[e.Trailing_comma_not_allowed=1009]="Trailing_comma_not_allowed",e[e.Unexpected_token=1012]="Unexpected_token",e[e.A_rest_parameter_must_be_last_in_a_parameter_list=1014]="A_rest_parameter_must_be_last_in_a_parameter_list",e[e.Parameter_cannot_have_question_mark_and_initializer=1015]="Parameter_cannot_have_question_mark_and_initializer",e[e.A_required_parameter_cannot_follow_an_optional_parameter=1016]="A_required_parameter_cannot_follow_an_optional_parameter",e[e.Statements_are_not_allowed_in_ambient_contexts=1036]="Statements_are_not_allowed_in_ambient_contexts",e[e.Initializers_are_not_allowed_in_ambient_contexts=1039]="Initializers_are_not_allowed_in_ambient_contexts",e[e._0_modifier_cannot_be_used_here=1042]="_0_modifier_cannot_be_used_here",e[e.A_rest_parameter_cannot_be_optional=1047]="A_rest_parameter_cannot_be_optional",e[e.A_rest_parameter_cannot_have_an_initializer=1048]="A_rest_parameter_cannot_have_an_initializer",e[e.A_set_accessor_must_have_exactly_one_parameter=1049]="A_set_accessor_must_have_exactly_one_parameter",e[e.A_set_accessor_parameter_cannot_have_an_initializer=1052]="A_set_accessor_parameter_cannot_have_an_initializer",e[e.A_get_accessor_cannot_have_parameters=1054]="A_get_accessor_cannot_have_parameters",e[e.Enum_member_must_have_initializer=1061]="Enum_member_must_have_initializer",e[e.Type_parameters_cannot_appear_on_a_constructor_declaration=1092]="Type_parameters_cannot_appear_on_a_constructor_declaration",e[e.Type_annotation_cannot_appear_on_a_constructor_declaration=1093]="Type_annotation_cannot_appear_on_a_constructor_declaration",e[e.An_accessor_cannot_have_type_parameters=1094]="An_accessor_cannot_have_type_parameters",e[e.A_set_accessor_cannot_have_a_return_type_annotation=1095]="A_set_accessor_cannot_have_a_return_type_annotation",e[e.Type_parameter_list_cannot_be_empty=1098]="Type_parameter_list_cannot_be_empty",e[e.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement=1104]="A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement",e[e.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement=1105]="A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement",e[e.A_return_statement_can_only_be_used_within_a_function_body=1108]="A_return_statement_can_only_be_used_within_a_function_body",e[e.Expression_expected=1109]="Expression_expected",e[e.Type_expected=1110]="Type_expected",e[e.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement=1113]="A_default_clause_cannot_appear_more_than_once_in_a_switch_statement",e[e.Duplicate_label_0=1114]="Duplicate_label_0",e[e.An_export_assignment_cannot_have_modifiers=1120]="An_export_assignment_cannot_have_modifiers",e[e.Octal_literals_are_not_allowed_in_strict_mode=1121]="Octal_literals_are_not_allowed_in_strict_mode",e[e.Digit_expected=1124]="Digit_expected",e[e.Hexadecimal_digit_expected=1125]="Hexadecimal_digit_expected",e[e.Unexpected_end_of_text=1126]="Unexpected_end_of_text",e[e.Invalid_character=1127]="Invalid_character",e[e._case_or_default_expected=1130]="_case_or_default_expected",e[e._super_must_be_followed_by_an_argument_list_or_member_access=1034]="_super_must_be_followed_by_an_argument_list_or_member_access",e[e.A_declare_modifier_cannot_be_used_in_an_already_ambient_context=1038]="A_declare_modifier_cannot_be_used_in_an_already_ambient_context",e[e.Type_argument_expected=1140]="Type_argument_expected",e[e.String_literal_expected=1141]="String_literal_expected",e[e.Line_break_not_permitted_here=1142]="Line_break_not_permitted_here",e[e.Declaration_expected=1146]="Declaration_expected",e[e._const_declarations_must_be_initialized=1155]="_const_declarations_must_be_initialized",e[e.Unterminated_regular_expression_literal=1161]="Unterminated_regular_expression_literal",e[e.Interface_declaration_cannot_have_implements_clause=1176]="Interface_declaration_cannot_have_implements_clause",e[e.Binary_digit_expected=1177]="Binary_digit_expected",e[e.Octal_digit_expected=1178]="Octal_digit_expected",e[e.An_implementation_cannot_be_declared_in_ambient_contexts=1183]="An_implementation_cannot_be_declared_in_ambient_contexts",e[e.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive=1198]="An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive",e[e.Unterminated_Unicode_escape_sequence=1199]="Unterminated_Unicode_escape_sequence",e[e.Decorators_are_not_valid_here=1206]="Decorators_are_not_valid_here",e[e._abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration=1242]="_abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration",e[e.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract=1245]="Method_0_cannot_have_an_implementation_because_it_is_marked_abstract",e[e.A_definite_assignment_assertion_is_not_permitted_in_this_context=1255]="A_definite_assignment_assertion_is_not_permitted_in_this_context",e[e.A_class_may_only_extend_another_class=1311]="A_class_may_only_extend_another_class",e[e.A_parameter_property_cannot_be_declared_using_a_rest_parameter=1317]="A_parameter_property_cannot_be_declared_using_a_rest_parameter",e[e.Duplicate_identifier_0=2300]="Duplicate_identifier_0",e[e.Cannot_find_name_0=2304]="Cannot_find_name_0",e[e.Module_0_has_no_exported_member_1=2305]="Module_0_has_no_exported_member_1",e[e.Generic_type_0_requires_1_type_argument_s=2314]="Generic_type_0_requires_1_type_argument_s",e[e.Type_0_is_not_generic=2315]="Type_0_is_not_generic",e[e.Type_0_is_not_assignable_to_type_1=2322]="Type_0_is_not_assignable_to_type_1",e[e.Index_signature_is_missing_in_type_0=2329]="Index_signature_is_missing_in_type_0",e[e._this_cannot_be_referenced_in_current_location=2332]="_this_cannot_be_referenced_in_current_location",e[e._super_can_only_be_referenced_in_a_derived_class=2335]="_super_can_only_be_referenced_in_a_derived_class",e[e.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors=2337]="Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors",e[e.Property_0_does_not_exist_on_type_1=2339]="Property_0_does_not_exist_on_type_1",e[e.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures=2349]="Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures",e[e.Cannot_use_new_with_an_expression_whose_type_lacks_a_construct_signature=2351]="Cannot_use_new_with_an_expression_whose_type_lacks_a_construct_signature",e[e.A_function_whose_declared_type_is_not_void_must_return_a_value=2355]="A_function_whose_declared_type_is_not_void_must_return_a_value",e[e.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access=2357]="The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access",e[e.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access=2364]="The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access",e[e.Operator_0_cannot_be_applied_to_types_1_and_2=2365]="Operator_0_cannot_be_applied_to_types_1_and_2",e[e.A_super_call_must_be_the_first_statement_in_the_constructor=2376]="A_super_call_must_be_the_first_statement_in_the_constructor",e[e.Constructors_for_derived_classes_must_contain_a_super_call=2377]="Constructors_for_derived_classes_must_contain_a_super_call",e[e._get_and_set_accessor_must_have_the_same_type=2380]="_get_and_set_accessor_must_have_the_same_type",e[e.Constructor_implementation_is_missing=2390]="Constructor_implementation_is_missing",e[e.Function_implementation_is_missing_or_not_immediately_following_the_declaration=2391]="Function_implementation_is_missing_or_not_immediately_following_the_declaration",e[e.Multiple_constructor_implementations_are_not_allowed=2392]="Multiple_constructor_implementations_are_not_allowed",e[e.Duplicate_function_implementation=2393]="Duplicate_function_implementation",e[e.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local=2395]="Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local",e[e.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged=2434]="A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged",e[e.Type_0_has_no_property_1=2460]="Type_0_has_no_property_1",e[e.The_0_operator_cannot_be_applied_to_type_1=2469]="The_0_operator_cannot_be_applied_to_type_1",e[e.In_const_enum_declarations_member_initializer_must_be_constant_expression=2474]="In_const_enum_declarations_member_initializer_must_be_constant_expression",e[e.Export_declaration_conflicts_with_exported_declaration_of_0=2484]="Export_declaration_conflicts_with_exported_declaration_of_0",e[e.Object_is_possibly_null=2531]="Object_is_possibly_null",e[e.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property=2540]="Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property",e[e.The_target_of_an_assignment_must_be_a_variable_or_a_property_access=2541]="The_target_of_an_assignment_must_be_a_variable_or_a_property_access",e[e.Index_signature_in_type_0_only_permits_reading=2542]="Index_signature_in_type_0_only_permits_reading",e[e.Expected_0_arguments_but_got_1=2554]="Expected_0_arguments_but_got_1",e[e.Expected_at_least_0_arguments_but_got_1=2555]="Expected_at_least_0_arguments_but_got_1",e[e.Expected_0_type_arguments_but_got_1=2558]="Expected_0_type_arguments_but_got_1",e[e.A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums=2651]="A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums",e[e.Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration=2673]="Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration",e[e.Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration=2674]="Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration",e[e.Namespace_0_has_no_exported_member_1=2694]="Namespace_0_has_no_exported_member_1",e[e.Required_type_parameters_may_not_follow_optional_type_parameters=2706]="Required_type_parameters_may_not_follow_optional_type_parameters",e[e.Duplicate_property_0=2718]="Duplicate_property_0",e[e.File_0_not_found=6054]="File_0_not_found",e[e.Numeric_separators_are_not_allowed_here=6188]="Numeric_separators_are_not_allowed_here",e[e.Multiple_consecutive_numeric_separators_are_not_permitted=6189]="Multiple_consecutive_numeric_separators_are_not_permitted",e[e._super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class=17009]="_super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class",e[e._super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class=17011]="_super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class"}(t.DiagnosticCode||(t.DiagnosticCode={})),t.diagnosticCodeToString=function(e){switch(e){case 100:return"Operation not supported.";case 101:return"Operation is unsafe.";case 102:return"User-defined: {0}";case 200:return"Conversion from type '{0}' to '{1}' requires an explicit cast.";case 201:return"Conversion from type '{0}' to '{1}' will require an explicit cast when switching between 32/64-bit.";case 202:return"Type '{0}' cannot be changed to type '{1}'.";case 203:return"Type '{0}' cannot be reinterpreted as type '{1}'.";case 204:return"Basic type '{0}' cannot be nullable.";case 205:return"Cannot export a mutable global.";case 206:return"Mutable value cannot be inlined.";case 207:return"Unmanaged classes cannot extend managed classes and vice-versa.";case 208:return"Unmanaged classes cannot implement interfaces.";case 209:return"Invalid regular expression flags.";case 210:return"Implementation '{0}' must match the signature '{1}'.";case 211:return"Class '{0}' is sealed and cannot be extended.";case 212:return"Decorator '{0}' is not valid here.";case 213:return"Duplicate decorator.";case 214:return"An allocator must be present to use '{0}'.";case 215:return"Optional parameter must have an initializer.";case 216:return"Constructor of class '{0}' must not require any arguments.";case 217:return"Function '{0}' cannot be inlined into itself.";case 218:return"Cannot access method '{0}' without calling it as it requires 'this' to be set.";case 219:return"Optional properties are not supported.";case 220:return"Expression must be a compile-time constant.";case 221:return"Module cannot have multiple start functions.";case 222:return"'{0}' must be a value between '{1}' and '{2}' inclusive.";case 223:return"'{0}' must be a power of two.";case 224:return"TODO: Cannot inline inferred calls and specific internals yet.";case 225:return"Expression is never 'null'.";case 1002:return"Unterminated string literal.";case 1003:return"Identifier expected.";case 1005:return"'{0}' expected.";case 1006:return"A file cannot have a reference to itself.";case 1009:return"Trailing comma not allowed.";case 1012:return"Unexpected token.";case 1014:return"A rest parameter must be last in a parameter list.";case 1015:return"Parameter cannot have question mark and initializer.";case 1016:return"A required parameter cannot follow an optional parameter.";case 1036:return"Statements are not allowed in ambient contexts.";case 1039:return"Initializers are not allowed in ambient contexts.";case 1042:return"'{0}' modifier cannot be used here.";case 1047:return"A rest parameter cannot be optional.";case 1048:return"A rest parameter cannot have an initializer.";case 1049:return"A 'set' accessor must have exactly one parameter.";case 1052:return"A 'set' accessor parameter cannot have an initializer.";case 1054:return"A 'get' accessor cannot have parameters.";case 1061:return"Enum member must have initializer.";case 1092:return"Type parameters cannot appear on a constructor declaration.";case 1093:return"Type annotation cannot appear on a constructor declaration.";case 1094:return"An accessor cannot have type parameters.";case 1095:return"A 'set' accessor cannot have a return type annotation.";case 1098:return"Type parameter list cannot be empty.";case 1104:return"A 'continue' statement can only be used within an enclosing iteration statement.";case 1105:return"A 'break' statement can only be used within an enclosing iteration or switch statement.";case 1108:return"A 'return' statement can only be used within a function body.";case 1109:return"Expression expected.";case 1110:return"Type expected.";case 1113:return"A 'default' clause cannot appear more than once in a 'switch' statement.";case 1114:return"Duplicate label '{0}'.";case 1120:return"An export assignment cannot have modifiers.";case 1121:return"Octal literals are not allowed in strict mode.";case 1124:return"Digit expected.";case 1125:return"Hexadecimal digit expected.";case 1126:return"Unexpected end of text.";case 1127:return"Invalid character.";case 1130:return"'case' or 'default' expected.";case 1034:return"'super' must be followed by an argument list or member access.";case 1038:return"A 'declare' modifier cannot be used in an already ambient context.";case 1140:return"Type argument expected.";case 1141:return"String literal expected.";case 1142:return"Line break not permitted here.";case 1146:return"Declaration expected.";case 1155:return"'const' declarations must be initialized.";case 1161:return"Unterminated regular expression literal.";case 1176:return"Interface declaration cannot have 'implements' clause.";case 1177:return"Binary digit expected.";case 1178:return"Octal digit expected.";case 1183:return"An implementation cannot be declared in ambient contexts.";case 1198:return"An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.";case 1199:return"Unterminated Unicode escape sequence.";case 1206:return"Decorators are not valid here.";case 1242:return"'abstract' modifier can only appear on a class, method, or property declaration.";case 1245:return"Method '{0}' cannot have an implementation because it is marked abstract.";case 1255:return"A definite assignment assertion '!' is not permitted in this context.";case 1311:return"A class may only extend another class.";case 1317:return"A parameter property cannot be declared using a rest parameter.";case 2300:return"Duplicate identifier '{0}'.";case 2304:return"Cannot find name '{0}'.";case 2305:return"Module '{0}' has no exported member '{1}'.";case 2314:return"Generic type '{0}' requires {1} type argument(s).";case 2315:return"Type '{0}' is not generic.";case 2322:return"Type '{0}' is not assignable to type '{1}'.";case 2329:return"Index signature is missing in type '{0}'.";case 2332:return"'this' cannot be referenced in current location.";case 2335:return"'super' can only be referenced in a derived class.";case 2337:return"Super calls are not permitted outside constructors or in nested functions inside constructors.";case 2339:return"Property '{0}' does not exist on type '{1}'.";case 2349:return"Cannot invoke an expression whose type lacks a call signature. Type '{0}' has no compatible call signatures.";case 2351:return"Cannot use 'new' with an expression whose type lacks a construct signature.";case 2355:return"A function whose declared type is not 'void' must return a value.";case 2357:return"The operand of an increment or decrement operator must be a variable or a property access.";case 2364:return"The left-hand side of an assignment expression must be a variable or a property access.";case 2365:return"Operator '{0}' cannot be applied to types '{1}' and '{2}'.";case 2376:return"A 'super' call must be the first statement in the constructor.";case 2377:return"Constructors for derived classes must contain a 'super' call.";case 2380:return"'get' and 'set' accessor must have the same type.";case 2390:return"Constructor implementation is missing.";case 2391:return"Function implementation is missing or not immediately following the declaration.";case 2392:return"Multiple constructor implementations are not allowed.";case 2393:return"Duplicate function implementation.";case 2395:return"Individual declarations in merged declaration '{0}' must be all exported or all local.";case 2434:return"A namespace declaration cannot be located prior to a class or function with which it is merged.";case 2460:return"Type '{0}' has no property '{1}'.";case 2469:return"The '{0}' operator cannot be applied to type '{1}'.";case 2474:return"In 'const' enum declarations member initializer must be constant expression.";case 2484:return"Export declaration conflicts with exported declaration of '{0}'.";case 2531:return"Object is possibly 'null'.";case 2540:return"Cannot assign to '{0}' because it is a constant or a read-only property.";case 2541:return"The target of an assignment must be a variable or a property access.";case 2542:return"Index signature in type '{0}' only permits reading.";case 2554:return"Expected {0} arguments, but got {1}.";case 2555:return"Expected at least {0} arguments, but got {1}.";case 2558:return"Expected {0} type arguments, but got {1}.";case 2651:return"A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums.";case 2673:return"Constructor of class '{0}' is private and only accessible within the class declaration.";case 2674:return"Constructor of class '{0}' is protected and only accessible within the class declaration.";case 2694:return"Namespace '{0}' has no exported member '{1}'.";case 2706:return"Required type parameters may not follow optional type parameters.";case 2718:return"Duplicate property '{0}'.";case 6054:return"File '{0}' not found.";case 6188:return"Numeric separators are not allowed here.";case 6189:return"Multiple consecutive numeric separators are not permitted.";case 17009:return"'super' must be called before accessing 'this' in the constructor of a derived class.";case 17011:return"'super' must be called before accessing a property of 'super' in the constructor of a derived class.";default:return""}}},function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}},i=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return s};Object.defineProperty(t,"__esModule",{value:!0});var a,s=r(11),o=r(2),c=r(5),l=r(6),u=r(4),p=r(3),_=r(10),h=r(9),d=r(0),y=r(1);function m(e,t,r,n,i,s,d){void 0===d&&(d=!1);var m=e.module,g=!1;switch(t.internalName){case a.isInteger:var S=E(e,r,n,s);return e.currentType=l.Type.bool,S?S.is(4)&&!S.is(256)?m.i32(1):m.i32(0):m.unreachable();case a.isFloat:S=E(e,r,n,s);return e.currentType=l.Type.bool,S?S.is(8)?m.i32(1):m.i32(0):m.unreachable();case a.isBoolean:S=E(e,r,n,s);return e.currentType=l.Type.bool,S?S==l.Type.bool?m.i32(1):m.i32(0):m.unreachable();case a.isSigned:S=E(e,r,n,s);return e.currentType=l.Type.bool,S?S.is(1)?m.i32(1):m.i32(0):m.unreachable();case a.isReference:S=E(e,r,n,s);return e.currentType=l.Type.bool,S?S.is(256)?m.i32(1):m.i32(0):m.unreachable();case a.isString:S=E(e,r,n,s);if(e.currentType=l.Type.bool,!S)return m.unreachable();if(B=S.classReference){var O=e.program.stringInstance;if(O&&B.isAssignableTo(O))return m.i32(1)}return m.i32(0);case a.isArray:S=E(e,r,n,s);if(e.currentType=l.Type.bool,!S)return m.unreachable();if(!(De=S.classReference))return m.i32(0);var C=De.prototype;return m.i32(C.extends(e.program.arrayPrototype)?1:0);case a.isArrayLike:S=E(e,r,n,s);return e.currentType=l.Type.bool,S?(De=S.classReference)?m.i32(De.isArrayLike?1:0):m.i32(0):m.unreachable();case a.isFunction:S=E(e,r,n,s);return e.currentType=l.Type.bool,S?m.i32(S.signatureReference?1:0):m.unreachable();case a.isNullable:S=E(e,r,n,s);return e.currentType=l.Type.bool,S?m.i32(S.is(512)?1:0):m.unreachable();case a.isDefined:if(e.currentType=l.Type.bool,x(r,s,t)|A(n,1,s,e))return m.unreachable();var k=e.resolver.resolveExpression(n[0],e.currentFlow,l.Type.void,h.ReportMode.SWALLOW);return m.i32(k?1:0);case a.isConstant:if(e.currentType=l.Type.bool,x(r,s,t)|A(n,1,s,e))return m.unreachable();var R=e.compileExpressionRetainType(n[0],l.Type.i32);return e.currentType=l.Type.bool,m.i32(u.getExpressionId(R)==u.ExpressionId.Const?1:0);case a.isManaged:S=E(e,r,n,s);return e.currentType=l.Type.bool,S?m.i32(S.isManaged?1:0):m.unreachable();case a.sizeof:if(e.currentType=e.options.usizeType,b(r,s,e)|A(n,0,s,e))return m.unreachable();var L=r[0].byteSize,R=void 0;return e.options.isWasm64?i.is(4)&&i.size<=32?(e.currentType=l.Type.u32,R=m.i32(L)):R=m.i64(L,0):i.is(4)&&64==i.size?(e.currentType=l.Type.u64,R=m.i64(L,0)):R=m.i32(L),R;case a.alignof:if(e.currentType=e.options.usizeType,b(r,s,e)|A(n,0,s,e))return m.unreachable();L=r[0].byteSize;assert(y.isPowerOf2(L));var F=ctz(L);R=void 0;return e.options.isWasm64?i.is(4)&&i.size<=32?(e.currentType=l.Type.u32,R=m.i32(F)):R=m.i64(F,0):i.is(4)&&64==i.size?(e.currentType=l.Type.u64,R=m.i64(F,0)):R=m.i32(F),R;case a.offsetof:if(e.currentType=e.options.usizeType,b(r,s,e)|N(n,0,1,s,e))return m.unreachable();var B;if(!(B=r[0].classReference))return e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),m.unreachable();var D=void 0;if(n.length){if(n[0].kind!=c.NodeKind.LITERAL||n[0].literalKind!=c.LiteralKind.STRING)return e.error(o.DiagnosticCode.String_literal_expected,n[0].range),m.unreachable();var P=n[0].value,w=B.members?B.members.get(P):null;if(!w||w.kind!=p.ElementKind.FIELD)return e.error(o.DiagnosticCode.Type_0_has_no_property_1,n[0].range,B.internalName,P),m.unreachable();D=w.memoryOffset}else D=B.currentMemoryOffset;return e.options.isWasm64?i.is(4)&&i.size<=32?(e.currentType=l.Type.u32,m.i32(D)):m.i64(D):i.is(4)&&64==i.size?(e.currentType=l.Type.u64,m.i64(D)):m.i32(D);case a.clz:case a.ctz:case a.popcnt:if(I(r,s,e,!0)|A(n,1,s,e))return m.unreachable();var U=r?e.compileExpression(n[0],r[0],5):e.compileExpression(n[0],l.Type.i32,4);if((S=e.currentType).is(256))return e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),m.unreachable();var M=-1;switch(t.internalName){case a.clz:switch(S.kind){case 10:case 0:case 5:case 1:case 6:case 2:case 7:M=u.UnaryOp.ClzI32;break;case 9:case 4:M=e.options.isWasm64?u.UnaryOp.ClzI64:u.UnaryOp.ClzI32;break;case 3:case 8:M=u.UnaryOp.ClzI64}break;case a.ctz:switch(S.kind){case 10:case 0:case 5:case 1:case 6:case 2:case 7:M=u.UnaryOp.CtzI32;break;case 9:case 4:M=e.options.isWasm64?u.UnaryOp.CtzI64:u.UnaryOp.CtzI32;break;case 3:case 8:M=u.UnaryOp.CtzI64}break;case a.popcnt:switch(e.currentType.kind){case 10:case 0:case 5:case 1:case 6:case 2:case 7:M=u.UnaryOp.PopcntI32;break;case 9:case 4:M=e.options.isWasm64?u.UnaryOp.PopcntI64:u.UnaryOp.PopcntI32;break;case 3:case 8:M=u.UnaryOp.PopcntI64}}return-1==M?(e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),m.unreachable()):m.unary(M,U);case a.rotl:if(I(r,s,e,!0)|A(n,2,s,e))return m.unreachable();U=r?e.compileExpression(n[0],r[0],5):e.compileExpression(n[0],l.Type.i32,4);if((S=e.currentType).is(256))return e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),m.unreachable();var V=e.compileExpression(n[1],S,1);R=void 0;switch(S.kind){case 0:case 1:case 5:case 6:case 10:R=e.ensureSmallIntegerWrap(m.binary(u.BinaryOp.RotlI32,U,V),S);case 2:case 7:R=m.binary(u.BinaryOp.RotlI32,U,V);break;case 9:case 4:R=m.binary(e.options.isWasm64?u.BinaryOp.RotlI64:u.BinaryOp.RotlI32,U,V);break;case 3:case 8:R=m.binary(u.BinaryOp.RotlI64,U,V);break;default:e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),R=m.unreachable()}return R;case a.rotr:if(I(r,s,e,!0)|A(n,2,s,e))return m.unreachable();U=r?e.compileExpression(n[0],r[0],5):e.compileExpression(n[0],l.Type.i32,4);if((S=e.currentType).is(256))return e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),m.unreachable();V=e.compileExpression(n[1],S,1),R=void 0;switch(S.kind){case 0:case 1:case 5:case 6:case 10:R=e.ensureSmallIntegerWrap(m.binary(u.BinaryOp.RotrI32,U,V),S);break;case 2:case 7:R=m.binary(u.BinaryOp.RotrI32,U,V);break;case 9:case 4:R=m.binary(e.options.isWasm64?u.BinaryOp.RotrI64:u.BinaryOp.RotrI32,U,V);break;case 3:case 8:R=m.binary(u.BinaryOp.RotrI64,U,V);break;default:e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),R=m.unreachable()}return R;case a.abs:if(I(r,s,e,!0)|A(n,1,s,e))return m.unreachable();U=r?e.compileExpression(n[0],r[0],5):e.compileExpression(n[0],l.Type.f64,4);if((S=e.currentType).is(256))return e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),m.unreachable();R=void 0;switch(S.kind){case 0:case 1:case 2:var G=(H=e.currentFlow).getTempLocal(l.Type.i32),K=H.getAndFreeTempLocal(l.Type.i32).index,z=G.index;R=m.binary(u.BinaryOp.XorI32,m.binary(u.BinaryOp.AddI32,m.local_tee(K,m.binary(u.BinaryOp.ShrI32,m.local_tee(z,U),m.i32(31))),m.local_get(z,u.NativeType.I32)),m.local_get(K,u.NativeType.I32)),H.freeTempLocal(G);break;case 4:var Y=e.options,H=e.currentFlow,W=Y.isWasm64;G=H.getTempLocal(Y.usizeType),K=H.getAndFreeTempLocal(Y.usizeType).index,z=G.index;R=m.binary(W?u.BinaryOp.XorI64:u.BinaryOp.XorI32,m.binary(W?u.BinaryOp.AddI64:u.BinaryOp.AddI32,m.local_tee(K,m.binary(W?u.BinaryOp.ShrI64:u.BinaryOp.ShrI32,m.local_tee(z,U),W?m.i64(63):m.i32(31))),m.local_get(z,Y.nativeSizeType)),m.local_get(K,Y.nativeSizeType)),H.freeTempLocal(G);break;case 3:G=(H=e.currentFlow).getTempLocal(l.Type.i64),K=H.getAndFreeTempLocal(l.Type.i64).index,z=G.index;R=m.binary(u.BinaryOp.XorI64,m.binary(u.BinaryOp.AddI64,m.local_tee(K,m.binary(u.BinaryOp.ShrI64,m.local_tee(z,U),m.i64(63))),m.local_get(z,u.NativeType.I64)),m.local_get(K,u.NativeType.I64)),H.freeTempLocal(G);break;case 9:case 5:case 6:case 7:case 8:case 10:R=U;break;case 11:R=m.unary(u.UnaryOp.AbsF32,U);break;case 12:R=m.unary(u.UnaryOp.AbsF64,U);break;default:e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),R=m.unreachable()}return R;case a.max:if(I(r,s,e,!0)|A(n,2,s,e))return m.unreachable();U=r?e.compileExpression(n[0],r[0],5):e.compileExpression(n[0],l.Type.f64,4);if((S=e.currentType).is(256))return e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),m.unreachable();V=e.compileExpression(n[1],S,5),M=void 0;switch(S.kind){case 0:case 1:case 2:M=u.BinaryOp.GtI32;break;case 5:case 6:case 7:case 10:M=u.BinaryOp.GtU32;break;case 3:M=u.BinaryOp.GtI64;break;case 8:M=u.BinaryOp.GtU64;break;case 4:M=e.options.isWasm64?u.BinaryOp.GtI64:u.BinaryOp.GtI32;break;case 9:M=e.options.isWasm64?u.BinaryOp.GtU64:u.BinaryOp.GtU32;break;case 11:return m.binary(u.BinaryOp.MaxF32,U,V);case 12:return m.binary(u.BinaryOp.MaxF64,U,V);default:return e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),m.unreachable()}H=e.currentFlow;var X=S.toNativeType(),q=H.getTempLocal(S);H.setLocalFlag(q.index,_.LocalFlags.WRAPPED);G=H.getAndFreeTempLocal(S);return H.setLocalFlag(G.index,_.LocalFlags.WRAPPED),H.freeTempLocal(q),m.select(m.local_tee(q.index,U),m.local_tee(G.index,V),m.binary(M,m.local_get(q.index,X),m.local_get(G.index,X)));case a.min:if(I(r,s,e,!0)|A(n,2,s,e))return m.unreachable();U=r?e.compileExpression(n[0],r[0],5):e.compileExpression(n[0],l.Type.f64,4);if((S=e.currentType).is(256))return e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),m.unreachable();V=e.compileExpression(n[1],S,5),M=void 0;switch(S.kind){case 0:case 1:case 2:M=u.BinaryOp.LtI32;break;case 5:case 6:case 7:case 10:M=u.BinaryOp.LtU32;break;case 3:M=u.BinaryOp.LtI64;break;case 8:M=u.BinaryOp.LtU64;break;case 4:M=e.options.isWasm64?u.BinaryOp.LtI64:u.BinaryOp.LtI32;break;case 9:M=e.options.isWasm64?u.BinaryOp.LtU64:u.BinaryOp.LtU32;break;case 11:return m.binary(u.BinaryOp.MinF32,U,V);case 12:return m.binary(u.BinaryOp.MinF64,U,V);default:return e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),m.unreachable()}H=e.currentFlow,X=S.toNativeType(),q=H.getTempLocal(S);H.setLocalFlag(q.index,_.LocalFlags.WRAPPED);G=H.getAndFreeTempLocal(S);return H.setLocalFlag(G.index,_.LocalFlags.WRAPPED),H.freeTempLocal(q),m.select(m.local_tee(q.index,U),m.local_tee(G.index,V),m.binary(M,m.local_get(q.index,X),m.local_get(G.index,X)));case a.ceil:case a.floor:if(I(r,s,e,!0)|A(n,1,s,e))return m.unreachable();U=r?e.compileExpression(n[0],r[0],1):e.compileExpression(n[0],l.Type.f64,0);if((S=e.currentType).is(256))return e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),m.unreachable();M=void 0;switch(S.kind){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return U;case 11:M=t.internalName==a.ceil?u.UnaryOp.CeilF32:u.UnaryOp.FloorF32;break;case 12:M=t.internalName==a.ceil?u.UnaryOp.CeilF64:u.UnaryOp.FloorF64;break;default:return e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),m.unreachable()}return m.unary(M,U);case a.copysign:if(I(r,s,e,!0)|A(n,2,s,e))return m.unreachable();U=r?e.compileExpression(n[0],r[0],1):e.compileExpression(n[0],l.Type.f64,0);if((S=e.currentType).is(256))return e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),m.unreachable();V=e.compileExpression(n[1],S,1),M=void 0;switch(S.kind){case 11:M=u.BinaryOp.CopysignF32;break;case 12:M=u.BinaryOp.CopysignF64;break;default:return e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),m.unreachable()}return m.binary(M,U,V);case a.nearest:if(I(r,s,e,!0)|A(n,1,s,e))return m.unreachable();U=r?e.compileExpression(n[0],r[0],1):e.compileExpression(n[0],l.Type.f64,0);if((S=e.currentType).is(256))return e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),m.unreachable();R=void 0;switch(S.kind){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:R=U;break;case 11:R=m.unary(u.UnaryOp.NearestF32,U);break;case 12:R=m.unary(u.UnaryOp.NearestF64,U);break;default:e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),R=m.unreachable()}return R;case a.reinterpret:if(b(r,s,e,!0)|A(n,1,s,e))return m.unreachable();if((S=r[0]).is(256))return e.currentType=S,e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),m.unreachable();R=void 0;switch(S.kind){case 2:case 7:U=e.compileExpression(n[0],l.Type.f32,1);R=m.unary(u.UnaryOp.ReinterpretF32,U);break;case 3:case 8:U=e.compileExpression(n[0],l.Type.f64,1);R=m.unary(u.UnaryOp.ReinterpretF64,U);break;case 4:case 9:U=e.compileExpression(n[0],e.options.isWasm64?l.Type.f64:l.Type.f32,1);R=m.unary(e.options.isWasm64?u.UnaryOp.ReinterpretF64:u.UnaryOp.ReinterpretF32,U);break;case 11:U=e.compileExpression(n[0],l.Type.i32,1);R=m.unary(u.UnaryOp.ReinterpretI32,U);break;case 12:U=e.compileExpression(n[0],l.Type.i64,1);R=m.unary(u.UnaryOp.ReinterpretI64,U);break;default:e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),R=m.unreachable()}return e.currentType=S,R;case a.sqrt:if(I(r,s,e,!0)|A(n,1,s,e))return m.unreachable();U=r?e.compileExpression(n[0],r[0],1):e.compileExpression(n[0],l.Type.f64,0);if((S=e.currentType).is(256))return e.currentType=S,e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),m.unreachable();R=void 0;switch(S.kind){case 11:R=m.unary(u.UnaryOp.SqrtF32,U);break;case 12:R=m.unary(u.UnaryOp.SqrtF64,U);break;default:e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),R=m.unreachable()}return R;case a.trunc:if(I(r,s,e,!0)|A(n,1,s,e))return m.unreachable();U=r?e.compileExpression(n[0],r[0],1):e.compileExpression(n[0],l.Type.f64,0);if((S=e.currentType).is(256))return e.error(o.DiagnosticCode.Operation_not_supported,s.range),m.unreachable();R=void 0;switch(S.kind){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:R=U;break;case 11:R=m.unary(u.UnaryOp.TruncF32,U);break;case 12:R=m.unary(u.UnaryOp.TruncF64,U);break;default:e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),R=m.unreachable()}return R;case a.load:if(b(r,s,e,!0)|N(n,1,3,s,e))return m.unreachable();var Q=(S=r[0]).is(4)&&i.is(4)&&i.size>S.size?i:S;U=e.compileExpression(n[0],e.options.usizeType,1);if(($=(ue=n.length)>=2?v(n[1],e):0)<0)return e.currentType=Q,m.unreachable();var j=void 0,Z=S.byteSize;if(3==ue){if((j=v(n[2],e))<0)return e.currentType=Q,m.unreachable();if(j>Z)return e.error(o.DiagnosticCode._0_must_be_a_value_between_1_and_2_inclusive,n[2].range,"Alignment","0",Z.toString()),e.currentType=Q,m.unreachable();if(!y.isPowerOf2(j))return e.error(o.DiagnosticCode._0_must_be_a_power_of_two,n[2].range,"Alignment"),e.currentType=Q,m.unreachable()}else j=Z;return e.currentType=Q,m.load(S.byteSize,S.is(5),U,Q.toNativeType(),$,j);case a.store:if(e.currentType=l.Type.void,b(r,s,e)|N(n,2,4,s,e))return m.unreachable();S=r[0],U=e.compileExpression(n[0],e.options.usizeType,1),V=d?e.compileExpression(n[1],i,1):e.compileExpression(n[1],S,S.is(4)?0:1);var J=e.currentType;if(S.is(4)&&(!J.is(4)||J.size=3?v(n[2],e):0)<0)return e.currentType=l.Type.void,m.unreachable();j=void 0,Z=S.byteSize;if(4==n.length){if((j=v(n[3],e))<0)return e.currentType=l.Type.void,m.unreachable();if(j>Z)return e.error(o.DiagnosticCode._0_must_be_a_value_between_1_and_2_inclusive,n[3].range,"Alignment","0",Z.toString()),e.currentType=l.Type.void,m.unreachable();if(!y.isPowerOf2(j))return e.error(o.DiagnosticCode._0_must_be_a_power_of_two,n[3].range,"Alignment"),e.currentType=l.Type.void,m.unreachable()}else j=Z;return e.currentType=l.Type.void,m.store(S.byteSize,U,V,J.toNativeType(),$,j);case a.atomic_load:if(!e.options.hasFeature(16))break;if(b(r,s,e,!0)|N(n,1,2,s,e))return m.unreachable();Q=(S=r[0]).is(4)&&i.is(4)&&i.size>S.size?i:S;if(!S.is(4))return e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),e.currentType=Q,m.unreachable();U=e.compileExpression(n[0],e.options.usizeType,1);return($=2==n.length?v(n[1],e):0)<0?(e.currentType=Q,m.unreachable()):(e.currentType=Q,m.atomic_load(S.byteSize,U,Q.toNativeType(),$));case a.atomic_store:if(!e.options.hasFeature(16))break;if(e.currentType=l.Type.void,b(r,s,e)|N(n,2,3,s,e))return m.unreachable();if(!(S=r[0]).is(4)||S.size<8)return e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),m.unreachable();U=e.compileExpression(n[0],e.options.usizeType,1),V=d?e.compileExpression(n[1],i,1):e.compileExpression(n[1],S,S.is(4)?0:1),J=e.currentType;return S.is(4)&&(!J.is(4)||J.size=0&&geNe?(e.error(o.DiagnosticCode._0_must_be_a_value_between_1_and_2_inclusive,n[1].range,"Lane index","0",Ne.toString()),m.unreachable()):m.simd_extract(M,U,ke);case a.v128_replace_lane:if(!e.options.hasFeature(8))break;if(b(r,s,e)|A(n,3,s,e))return e.currentType=l.Type.v128,m.unreachable();if((S=r[0]).is(256))return e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),e.currentType=l.Type.v128,m.unreachable();M=void 0;switch(S.kind){case 0:case 5:M=u.SIMDReplaceOp.ReplaceLaneVecI8x16;break;case 1:case 6:M=u.SIMDReplaceOp.ReplaceLaneVecI16x8;break;case 2:case 7:M=u.SIMDReplaceOp.ReplaceLaneVecI32x4;break;case 3:case 8:M=u.SIMDReplaceOp.ReplaceLaneVecI64x2;break;case 4:case 9:M=e.options.isWasm64?u.SIMDReplaceOp.ReplaceLaneVecI64x2:u.SIMDReplaceOp.ReplaceLaneVecI32x4;break;case 11:M=u.SIMDReplaceOp.ReplaceLaneVecF32x4;break;case 12:M=u.SIMDReplaceOp.ReplaceLaneVecF64x2;break;default:return e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),e.currentType=l.Type.v128,m.unreachable()}U=e.compileExpression(n[0],l.Type.v128,1),V=e.precomputeExpression(n[1],l.Type.u8,1);if(u.getExpressionId(V)!=u.ExpressionId.Const)return e.error(o.DiagnosticCode.Expression_must_be_a_compile_time_constant,n[1].range),e.currentType=l.Type.v128,m.unreachable();assert(u.getExpressionType(V)==u.NativeType.I32);Ne=16/S.byteSize-1;if((ke=u.getConstValueI32(V))<0||ke>Ne)return e.error(o.DiagnosticCode._0_must_be_a_value_between_1_and_2_inclusive,n[1].range,"Lane index","0",Ne.toString()),m.unreachable();ee=e.compileExpression(n[2],S,1);return e.currentType=l.Type.v128,m.simd_replace(M,U,ke,ee);case a.v128_shuffle:if(!e.options.hasFeature(8))break;if(b(r,s,e))return e.currentType=l.Type.v128,m.unreachable();if((S=r[0]).is(256))return e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),e.currentType=l.Type.v128,m.unreachable();var Se=S.byteSize,Oe=16/Se;if(assert(isInteger(Oe)&&y.isPowerOf2(Oe)),A(n,2+Oe,s,e))return e.currentType=l.Type.v128,m.unreachable();switch(S.kind){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 11:case 12:break;default:return e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),e.currentType=l.Type.v128,m.unreachable()}U=e.compileExpression(n[0],l.Type.v128,1),V=e.compileExpression(n[1],l.Type.v128,1);var Ce=new Uint8Array(16);for(Ne=(Oe<<1)-1,ye=0;yeNe)return e.error(o.DiagnosticCode._0_must_be_a_value_between_1_and_2_inclusive,Re.range,"Lane index","0",Ne.toString()),e.currentType=l.Type.v128,m.unreachable();switch(Se){case 1:y.writeI8(ke,Ce,ye);break;case 2:var Fe=ye<<1,Be=ke<<1;y.writeI8(Be,Ce,Fe),y.writeI8(Be+1,Ce,Fe+1);break;case 4:Fe=ye<<2,Be=ke<<2;y.writeI8(Be,Ce,Fe),y.writeI8(Be+1,Ce,Fe+1),y.writeI8(Be+2,Ce,Fe+2),y.writeI8(Be+3,Ce,Fe+3);break;case 8:Fe=ye<<3,Be=ke<<3;y.writeI8(Be,Ce,Fe),y.writeI8(Be+1,Ce,Fe+1),y.writeI8(Be+2,Ce,Fe+2),y.writeI8(Be+3,Ce,Fe+3),y.writeI8(Be+4,Ce,Fe+4),y.writeI8(Be+5,Ce,Fe+5),y.writeI8(Be+6,Ce,Fe+6),y.writeI8(Be+7,Ce,Fe+7);break;default:assert(!1)}}return e.currentType=l.Type.v128,m.simd_shuffle(U,V,Ce);case a.v128_add:case a.v128_sub:case a.v128_mul:case a.v128_div:case a.v128_add_saturate:case a.v128_sub_saturate:case a.v128_min:case a.v128_max:case a.v128_eq:case a.v128_ne:case a.v128_lt:case a.v128_le:case a.v128_gt:case a.v128_ge:if(!e.options.hasFeature(8))break;if(b(r,s,e)|A(n,2,s,e))return e.currentType=l.Type.v128,m.unreachable();if((S=r[0]).is(256))return e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),e.currentType=l.Type.v128,m.unreachable();M=-1;switch(t.internalName){case a.v128_add:switch(S.kind){case 0:case 5:M=u.BinaryOp.AddVecI8x16;break;case 1:case 6:M=u.BinaryOp.AddVecI16x8;break;case 2:case 7:M=u.BinaryOp.AddVecI32x4;break;case 3:case 8:M=u.BinaryOp.AddVecI64x2;break;case 4:case 9:M=e.options.isWasm64?u.BinaryOp.AddVecI64x2:u.BinaryOp.AddVecI32x4;break;case 11:M=u.BinaryOp.AddVecF32x4;break;case 12:M=u.BinaryOp.AddVecF64x2}break;case a.v128_sub:switch(S.kind){case 0:case 5:M=u.BinaryOp.SubVecI8x16;break;case 1:case 6:M=u.BinaryOp.SubVecI16x8;break;case 2:case 7:M=u.BinaryOp.SubVecI32x4;break;case 3:case 8:M=u.BinaryOp.SubVecI64x2;break;case 4:case 9:M=e.options.isWasm64?u.BinaryOp.SubVecI64x2:u.BinaryOp.SubVecI32x4;break;case 11:M=u.BinaryOp.SubVecF32x4;break;case 12:M=u.BinaryOp.SubVecF64x2}break;case a.v128_mul:switch(S.kind){case 0:case 5:M=u.BinaryOp.MulVecI8x16;break;case 1:case 6:M=u.BinaryOp.MulVecI16x8;break;case 2:case 7:M=u.BinaryOp.MulVecI32x4;break;case 11:M=u.BinaryOp.MulVecF32x4;break;case 12:M=u.BinaryOp.MulVecF64x2;break;case 4:case 9:e.options.isWasm64||(M=u.BinaryOp.MulVecI32x4)}break;case a.v128_div:switch(S.kind){case 11:M=u.BinaryOp.DivVecF32x4;break;case 12:M=u.BinaryOp.DivVecF64x2}break;case a.v128_add_saturate:switch(S.kind){case 0:M=u.BinaryOp.AddSatSVecI8x16;break;case 5:M=u.BinaryOp.AddSatUVecI8x16;break;case 1:M=u.BinaryOp.AddSatSVecI16x8;break;case 6:M=u.BinaryOp.AddSatUVecI16x8}break;case a.v128_sub_saturate:switch(S.kind){case 0:M=u.BinaryOp.SubSatSVecI8x16;break;case 5:M=u.BinaryOp.SubSatUVecI8x16;break;case 1:M=u.BinaryOp.SubSatSVecI16x8;break;case 6:M=u.BinaryOp.SubSatUVecI16x8}break;case a.v128_min:switch(S.kind){case 11:M=u.BinaryOp.MinVecF32x4;break;case 12:M=u.BinaryOp.MinVecF64x2}break;case a.v128_max:switch(S.kind){case 11:M=u.BinaryOp.MaxVecF32x4;break;case 12:M=u.BinaryOp.MaxVecF64x2}break;case a.v128_eq:switch(S.kind){case 0:case 5:M=u.BinaryOp.EqVecI8x16;break;case 1:case 6:M=u.BinaryOp.EqVecI16x8;break;case 2:case 7:M=u.BinaryOp.EqVecI32x4;break;case 11:M=u.BinaryOp.EqVecF32x4;break;case 12:M=u.BinaryOp.EqVecF64x2;break;case 4:case 9:e.options.isWasm64||(M=u.BinaryOp.EqVecI32x4)}break;case a.v128_ne:switch(S.kind){case 0:case 5:M=u.BinaryOp.NeVecI8x16;break;case 1:case 6:M=u.BinaryOp.NeVecI16x8;break;case 2:case 7:M=u.BinaryOp.NeVecI32x4;break;case 11:M=u.BinaryOp.NeVecF32x4;break;case 12:M=u.BinaryOp.NeVecF64x2;break;case 4:case 9:e.options.isWasm64||(M=u.BinaryOp.NeVecI32x4)}break;case a.v128_lt:switch(S.kind){case 0:M=u.BinaryOp.LtSVecI8x16;break;case 5:M=u.BinaryOp.LtUVecI8x16;break;case 1:M=u.BinaryOp.LtSVecI16x8;break;case 6:M=u.BinaryOp.LtUVecI16x8;break;case 2:M=u.BinaryOp.LtSVecI32x4;break;case 7:M=u.BinaryOp.LtUVecI32x4;break;case 11:M=u.BinaryOp.LtVecF32x4;break;case 12:M=u.BinaryOp.LtVecF64x2;break;case 4:case 9:e.options.isWasm64||(M=4==S.kind?u.BinaryOp.LtSVecI32x4:u.BinaryOp.LtUVecI32x4)}break;case a.v128_le:switch(S.kind){case 0:M=u.BinaryOp.LeSVecI8x16;break;case 5:M=u.BinaryOp.LeUVecI8x16;break;case 1:M=u.BinaryOp.LeSVecI16x8;break;case 6:M=u.BinaryOp.LeUVecI16x8;break;case 2:M=u.BinaryOp.LeSVecI32x4;break;case 7:M=u.BinaryOp.LeUVecI32x4;break;case 11:M=u.BinaryOp.LeVecF32x4;break;case 12:M=u.BinaryOp.LeVecF64x2;break;case 4:case 9:e.options.isWasm64||(M=4==S.kind?u.BinaryOp.LeSVecI32x4:u.BinaryOp.LeUVecI32x4)}break;case a.v128_gt:switch(S.kind){case 0:M=u.BinaryOp.GtSVecI8x16;break;case 5:M=u.BinaryOp.GtUVecI8x16;break;case 1:M=u.BinaryOp.GtSVecI16x8;break;case 6:M=u.BinaryOp.GtUVecI16x8;break;case 2:M=u.BinaryOp.GtSVecI32x4;break;case 7:M=u.BinaryOp.GtUVecI32x4;break;case 11:M=u.BinaryOp.GtVecF32x4;break;case 12:M=u.BinaryOp.GtVecF64x2;break;case 4:case 9:e.options.isWasm64||(M=4==S.kind?u.BinaryOp.GtSVecI32x4:u.BinaryOp.GtUVecI32x4)}break;case a.v128_ge:switch(S.kind){case 0:M=u.BinaryOp.GeSVecI8x16;break;case 5:M=u.BinaryOp.GeUVecI8x16;break;case 1:M=u.BinaryOp.GeSVecI16x8;break;case 6:M=u.BinaryOp.GeUVecI16x8;break;case 2:M=u.BinaryOp.GeSVecI32x4;break;case 7:M=u.BinaryOp.GeUVecI32x4;break;case 11:M=u.BinaryOp.GeVecF32x4;break;case 12:M=u.BinaryOp.GeVecF64x2;break;case 4:case 9:e.options.isWasm64||(M=4==S.kind?u.BinaryOp.GeSVecI32x4:u.BinaryOp.GeUVecI32x4)}}if(-1==M)return e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),e.currentType=l.Type.v128,m.unreachable();U=e.compileExpression(n[0],l.Type.v128,1),V=e.compileExpression(n[1],l.Type.v128,1);return e.currentType=l.Type.v128,m.binary(M,U,V);case a.v128_neg:case a.v128_abs:case a.v128_sqrt:case a.v128_convert:case a.v128_trunc:if(!e.options.hasFeature(8))break;if(b(r,s,e)|A(n,1,s,e))return e.currentType=l.Type.v128,m.unreachable();if((S=r[0]).is(256))return e.error(o.DiagnosticCode.Operation_not_supported,s.range),e.currentType=l.Type.v128,m.unreachable();M=-1;switch(t.internalName){case a.v128_neg:switch(S.kind){case 0:case 5:M=u.UnaryOp.NegVecI8x16;break;case 1:case 6:M=u.UnaryOp.NegVecI16x8;break;case 2:case 7:M=u.UnaryOp.NegVecI32x4;break;case 3:case 8:M=u.UnaryOp.NegVecI64x2;break;case 4:case 9:M=e.options.isWasm64?u.UnaryOp.NegVecI64x2:u.UnaryOp.NegVecI32x4;break;case 11:M=u.UnaryOp.NegVecF32x4;break;case 12:M=u.UnaryOp.NegVecF64x2}break;case a.v128_abs:switch(S.kind){case 11:M=u.UnaryOp.AbsVecF32x4;break;case 12:M=u.UnaryOp.AbsVecF64x2}break;case a.v128_sqrt:switch(S.kind){case 11:M=u.UnaryOp.SqrtVecF32x4;break;case 12:M=u.UnaryOp.SqrtVecF64x2}break;case a.v128_convert:switch(S.kind){case 2:M=u.UnaryOp.ConvertSVecI32x4ToVecF32x4;break;case 7:M=u.UnaryOp.ConvertUVecI32x4ToVecF32x4;break;case 3:M=u.UnaryOp.ConvertSVecI64x2ToVecF64x2;break;case 8:M=u.UnaryOp.ConvertUVecI64x2ToVecF64x2}break;case a.v128_trunc:switch(S.kind){case 2:M=u.UnaryOp.TruncSatSVecF32x4ToVecI32x4;break;case 7:M=u.UnaryOp.TruncSatUVecF32x4ToVecI32x4;break;case 3:M=u.UnaryOp.TruncSatSVecF64x2ToVecI64x2;break;case 8:M=u.UnaryOp.TruncSatUVecF64x2ToVecI64x2}}if(-1==M)return e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),e.currentType=l.Type.v128,m.unreachable();U=e.compileExpression(n[0],l.Type.v128,1);return e.currentType=l.Type.v128,m.unary(M,U);case a.v128_shl:case a.v128_shr:if(!e.options.hasFeature(8))break;if(b(r,s,e)|A(n,2,s,e))return e.currentType=l.Type.v128,m.unreachable();if((S=r[0]).is(256))return e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),e.currentType=l.Type.v128,m.unreachable();M=-1;switch(t.internalName){case a.v128_shl:switch(S.kind){case 0:case 5:M=u.SIMDShiftOp.ShlVecI8x16;break;case 1:case 6:M=u.SIMDShiftOp.ShlVecI16x8;break;case 2:case 7:M=u.SIMDShiftOp.ShlVecI32x4;break;case 3:case 8:M=u.SIMDShiftOp.ShlVecI64x2;break;case 4:case 9:M=e.options.isWasm64?u.SIMDShiftOp.ShlVecI64x2:u.SIMDShiftOp.ShlVecI32x4}break;case a.v128_shr:switch(S.kind){case 0:M=u.SIMDShiftOp.ShrSVecI8x16;break;case 5:M=u.SIMDShiftOp.ShrUVecI8x16;break;case 1:M=u.SIMDShiftOp.ShrSVecI16x8;break;case 6:M=u.SIMDShiftOp.ShrUVecI16x8;break;case 2:M=u.SIMDShiftOp.ShrSVecI32x4;break;case 7:M=u.SIMDShiftOp.ShrUVecI32x4;break;case 3:M=u.SIMDShiftOp.ShrSVecI64x2;break;case 8:M=u.SIMDShiftOp.ShrUVecI64x2;break;case 4:M=e.options.isWasm64?u.SIMDShiftOp.ShrSVecI64x2:u.SIMDShiftOp.ShrSVecI32x4;break;case 9:M=e.options.isWasm64?u.SIMDShiftOp.ShrUVecI64x2:u.SIMDShiftOp.ShrUVecI32x4}}if(-1==M)return e.error(o.DiagnosticCode.Operation_not_supported,s.range),e.currentType=l.Type.v128,m.unreachable();U=e.compileExpression(n[0],l.Type.v128,1),V=e.compileExpression(n[1],l.Type.i32,1);return e.currentType=l.Type.v128,m.simd_shift(M,U,V);case a.v128_and:case a.v128_or:case a.v128_xor:if(!e.options.hasFeature(8))break;if(x(r,s,t)|A(n,2,s,e))return e.currentType=l.Type.v128,m.unreachable();M=-1;switch(t.internalName){default:assert(!1);case a.v128_and:M=u.BinaryOp.AndVec128;break;case a.v128_or:M=u.BinaryOp.OrVec128;break;case a.v128_xor:M=u.BinaryOp.XorVec128}U=e.compileExpression(n[0],l.Type.v128,1),V=e.compileExpression(n[1],l.Type.v128,1);return m.binary(M,U,V);case a.v128_not:if(!e.options.hasFeature(8))break;if(x(r,s,t)|A(n,1,s,e))return e.currentType=l.Type.v128,m.unreachable();U=e.compileExpression(n[0],l.Type.v128,1);return m.unary(u.UnaryOp.NotVec128,U);case a.v128_bitselect:if(!e.options.hasFeature(8))break;if(x(r,s,t)|A(n,3,s,e))return e.currentType=l.Type.v128,m.unreachable();U=e.compileExpression(n[0],l.Type.v128,1),V=e.compileExpression(n[1],l.Type.v128,1),ee=e.compileExpression(n[2],l.Type.v128,1);return m.simd_bitselect(U,V,ee);case a.v128_any_true:case a.v128_all_true:if(!e.options.hasFeature(8))break;if(b(r,s,e)|A(n,1,s,e))return e.currentType=l.Type.bool,m.unreachable();if((S=r[0]).is(256))return e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),m.unreachable();M=-1;switch(t.internalName){default:assert(!1);case a.v128_any_true:switch(S.kind){case 0:case 5:M=u.UnaryOp.AnyTrueVecI8x16;break;case 1:case 6:M=u.UnaryOp.AnyTrueVecI16x8;break;case 2:case 7:M=u.UnaryOp.AnyTrueVecI32x4;break;case 3:case 8:M=u.UnaryOp.AnyTrueVecI64x2;break;case 4:case 9:M=e.options.isWasm64?u.UnaryOp.AnyTrueVecI64x2:u.UnaryOp.AnyTrueVecI32x4}break;case a.v128_all_true:switch(S.kind){case 0:case 5:M=u.UnaryOp.AllTrueVecI8x16;break;case 1:case 6:M=u.UnaryOp.AllTrueVecI16x8;break;case 2:case 7:M=u.UnaryOp.AllTrueVecI32x4;break;case 3:case 8:M=u.UnaryOp.AllTrueVecI64x2;break;case 4:case 9:M=e.options.isWasm64?u.UnaryOp.AllTrueVecI64x2:u.UnaryOp.AllTrueVecI32x4}}if(-1==M)return e.error(o.DiagnosticCode.Operation_not_supported,s.typeArgumentsRange),e.currentType=l.Type.bool,m.unreachable();U=e.compileExpression(n[0],l.Type.v128,1);return e.currentType=l.Type.bool,m.unary(M,U);case a.idof:var De;S=E(e,r,n,s);return e.currentType=l.Type.u32,S?!(De=S.classReference)||De.hasDecorator(p.DecoratorFlags.UNMANAGED)?(e.error(o.DiagnosticCode.Operation_not_supported,s.range),m.unreachable()):m.i32(De.id):m.unreachable();case a.visit_globals:if(x(r,s,t)|A(n,1,s,e))return e.currentType=l.Type.void,m.unreachable();U=e.compileExpression(n[0],l.Type.u32,1);return e.runtimeFeatures|=4,e.currentType=l.Type.void,m.call(a.visit_globals,[U],u.NativeType.None);case a.visit_members:if(x(r,s,t)|A(n,2,s,e))return e.currentType=l.Type.void,m.unreachable();U=e.compileExpression(n[0],e.options.usizeType,1),V=e.compileExpression(n[1],l.Type.u32,1);return e.runtimeFeatures|=8,e.currentType=l.Type.void,m.call(a.visit_members,[U,V],u.NativeType.None)}return(R=function(e,t,r,n){switch(t.internalName){case a.i32_clz:return f(a.clz,e,l.Type.i32,r,l.Type.i32,n);case a.i64_clz:return f(a.clz,e,l.Type.i64,r,l.Type.i64,n);case a.i32_ctz:return f(a.ctz,e,l.Type.i32,r,l.Type.i32,n);case a.i64_ctz:return f(a.ctz,e,l.Type.i64,r,l.Type.i64,n);case a.i32_popcnt:return f(a.popcnt,e,l.Type.i32,r,l.Type.i32,n);case a.i64_popcnt:return f(a.popcnt,e,l.Type.i64,r,l.Type.i64,n);case a.i32_rotl:return f(a.rotl,e,l.Type.i32,r,l.Type.i32,n);case a.i64_rotl:return f(a.rotl,e,l.Type.i64,r,l.Type.i64,n);case a.i32_rotr:return f(a.rotr,e,l.Type.i32,r,l.Type.i32,n);case a.i64_rotr:return f(a.rotr,e,l.Type.i64,r,l.Type.i64,n);case a.f32_abs:return f(a.abs,e,l.Type.f32,r,l.Type.f32,n);case a.f64_abs:return f(a.abs,e,l.Type.f64,r,l.Type.f64,n);case a.f32_max:return f(a.max,e,l.Type.f32,r,l.Type.f32,n);case a.f64_max:return f(a.max,e,l.Type.f64,r,l.Type.f64,n);case a.f32_min:return f(a.min,e,l.Type.f32,r,l.Type.f32,n);case a.f64_min:return f(a.min,e,l.Type.f64,r,l.Type.f64,n);case a.f32_ceil:return f(a.ceil,e,l.Type.f32,r,l.Type.f32,n);case a.f64_ceil:return f(a.ceil,e,l.Type.f64,r,l.Type.f64,n);case a.f32_floor:return f(a.floor,e,l.Type.f32,r,l.Type.f32,n);case a.f64_floor:return f(a.floor,e,l.Type.f64,r,l.Type.f64,n);case a.f32_copysign:return f(a.copysign,e,l.Type.f32,r,l.Type.f32,n);case a.f64_copysign:return f(a.copysign,e,l.Type.f64,r,l.Type.f64,n);case a.f32_nearest:return f(a.nearest,e,l.Type.f32,r,l.Type.f32,n);case a.f64_nearest:return f(a.nearest,e,l.Type.f64,r,l.Type.f64,n);case a.i32_reinterpret_f32:return f(a.reinterpret,e,l.Type.i32,r,l.Type.f32,n);case a.i64_reinterpret_f64:return f(a.reinterpret,e,l.Type.i64,r,l.Type.f64,n);case a.f32_reinterpret_i32:return f(a.reinterpret,e,l.Type.f32,r,l.Type.i32,n);case a.f64_reinterpret_i64:return f(a.reinterpret,e,l.Type.f64,r,l.Type.i64,n);case a.f32_sqrt:return f(a.sqrt,e,l.Type.f32,r,l.Type.f32,n);case a.f64_sqrt:return f(a.sqrt,e,l.Type.f64,r,l.Type.f64,n);case a.f32_trunc:return f(a.trunc,e,l.Type.f32,r,l.Type.f32,n);case a.f64_trunc:return f(a.trunc,e,l.Type.f64,r,l.Type.f64,n);case a.i32_load8_s:return f(a.load,e,l.Type.i8,r,l.Type.i32,n);case a.i32_load8_u:return f(a.load,e,l.Type.u8,r,l.Type.i32,n);case a.i32_load16_s:return f(a.load,e,l.Type.i16,r,l.Type.i32,n);case a.i32_load16_u:return f(a.load,e,l.Type.u16,r,l.Type.i32,n);case a.i32_load:return f(a.load,e,l.Type.i32,r,l.Type.i32,n);case a.i64_load8_s:return f(a.load,e,l.Type.i8,r,l.Type.i64,n);case a.i64_load8_u:return f(a.load,e,l.Type.u8,r,l.Type.i64,n);case a.i64_load16_s:return f(a.load,e,l.Type.i16,r,l.Type.i64,n);case a.i64_load16_u:return f(a.load,e,l.Type.u16,r,l.Type.i64,n);case a.i64_load32_s:return f(a.load,e,l.Type.i32,r,l.Type.i64,n);case a.i64_load32_u:return f(a.load,e,l.Type.u32,r,l.Type.i64,n);case a.i64_load:return f(a.load,e,l.Type.i64,r,l.Type.i64,n);case a.f32_load:return f(a.load,e,l.Type.f32,r,l.Type.f32,n);case a.f64_load:return f(a.load,e,l.Type.f64,r,l.Type.f64,n);case a.i32_store8:return f(a.store,e,l.Type.i8,r,l.Type.i32,n);case a.i32_store16:return f(a.store,e,l.Type.i16,r,l.Type.i32,n);case a.i32_store:return f(a.store,e,l.Type.i32,r,l.Type.i32,n);case a.i64_store8:return f(a.store,e,l.Type.i8,r,l.Type.i64,n);case a.i64_store16:return f(a.store,e,l.Type.i16,r,l.Type.i64,n);case a.i64_store32:return f(a.store,e,l.Type.i32,r,l.Type.i64,n);case a.i64_store:return f(a.store,e,l.Type.i64,r,l.Type.i64,n);case a.f32_store:return f(a.store,e,l.Type.f32,r,l.Type.f32,n);case a.f64_store:return f(a.store,e,l.Type.f64,r,l.Type.f64,n)}if(e.options.hasFeature(16))switch(t.internalName){case a.i32_atomic_load8_u:return f(a.atomic_load,e,l.Type.u8,r,l.Type.i32,n);case a.i32_atomic_load16_u:return f(a.atomic_load,e,l.Type.u16,r,l.Type.i32,n);case a.i32_atomic_load:return f(a.atomic_load,e,l.Type.i32,r,l.Type.i32,n);case a.i64_atomic_load8_u:return f(a.atomic_load,e,l.Type.u8,r,l.Type.i64,n);case a.i64_atomic_load16_u:return f(a.atomic_load,e,l.Type.u16,r,l.Type.i64,n);case a.i64_atomic_load32_u:return f(a.atomic_load,e,l.Type.u32,r,l.Type.i64,n);case a.i64_atomic_load:return f(a.atomic_load,e,l.Type.i64,r,l.Type.i64,n);case a.i32_atomic_store8:return f(a.atomic_store,e,l.Type.u8,r,l.Type.i32,n);case a.i32_atomic_store16:return f(a.atomic_store,e,l.Type.u16,r,l.Type.i32,n);case a.i32_atomic_store:return f(a.atomic_store,e,l.Type.i32,r,l.Type.i32,n);case a.i64_atomic_store8:return f(a.atomic_store,e,l.Type.u8,r,l.Type.i64,n);case a.i64_atomic_store16:return f(a.atomic_store,e,l.Type.u16,r,l.Type.i64,n);case a.i64_atomic_store32:return f(a.atomic_store,e,l.Type.u32,r,l.Type.i64,n);case a.i64_atomic_store:return f(a.atomic_store,e,l.Type.i64,r,l.Type.i64,n);case a.i32_atomic_rmw8_add_u:return f(a.atomic_add,e,l.Type.u8,r,l.Type.i32,n);case a.i32_atomic_rmw16_add_u:return f(a.atomic_add,e,l.Type.u16,r,l.Type.i32,n);case a.i32_atomic_rmw_add:return f(a.atomic_add,e,l.Type.i32,r,l.Type.i32,n);case a.i64_atomic_rmw8_add_u:return f(a.atomic_add,e,l.Type.u8,r,l.Type.i64,n);case a.i64_atomic_rmw16_add_u:return f(a.atomic_add,e,l.Type.u16,r,l.Type.i64,n);case a.i64_atomic_rmw32_add_u:return f(a.atomic_add,e,l.Type.u32,r,l.Type.i64,n);case a.i64_atomic_rmw_add:return f(a.atomic_add,e,l.Type.i64,r,l.Type.i64,n);case a.i32_atomic_rmw8_sub_u:return f(a.atomic_sub,e,l.Type.u8,r,l.Type.i32,n);case a.i32_atomic_rmw16_sub_u:return f(a.atomic_sub,e,l.Type.u16,r,l.Type.i32,n);case a.i32_atomic_rmw_sub:return f(a.atomic_sub,e,l.Type.i32,r,l.Type.i32,n);case a.i64_atomic_rmw8_sub_u:return f(a.atomic_sub,e,l.Type.u8,r,l.Type.i64,n);case a.i64_atomic_rmw16_sub_u:return f(a.atomic_sub,e,l.Type.u16,r,l.Type.i64,n);case a.i64_atomic_rmw32_sub_u:return f(a.atomic_sub,e,l.Type.u32,r,l.Type.i64,n);case a.i64_atomic_rmw_sub:return f(a.atomic_sub,e,l.Type.i64,r,l.Type.i64,n);case a.i32_atomic_rmw8_and_u:return f(a.atomic_and,e,l.Type.u8,r,l.Type.i32,n);case a.i32_atomic_rmw16_and_u:return f(a.atomic_and,e,l.Type.u16,r,l.Type.i32,n);case a.i32_atomic_rmw_and:return f(a.atomic_and,e,l.Type.i32,r,l.Type.i32,n);case a.i64_atomic_rmw8_and_u:return f(a.atomic_and,e,l.Type.u8,r,l.Type.i64,n);case a.i64_atomic_rmw16_and_u:return f(a.atomic_and,e,l.Type.u16,r,l.Type.i64,n);case a.i64_atomic_rmw32_and_u:return f(a.atomic_and,e,l.Type.u32,r,l.Type.i64,n);case a.i64_atomic_rmw_and:return f(a.atomic_and,e,l.Type.i64,r,l.Type.i64,n);case a.i32_atomic_rmw8_or_u:return f(a.atomic_or,e,l.Type.u8,r,l.Type.i32,n);case a.i32_atomic_rmw16_or_u:return f(a.atomic_or,e,l.Type.u16,r,l.Type.i32,n);case a.i32_atomic_rmw_or:return f(a.atomic_or,e,l.Type.i32,r,l.Type.i32,n);case a.i64_atomic_rmw8_or_u:return f(a.atomic_or,e,l.Type.u8,r,l.Type.i64,n);case a.i64_atomic_rmw16_or_u:return f(a.atomic_or,e,l.Type.u16,r,l.Type.i64,n);case a.i64_atomic_rmw32_or_u:return f(a.atomic_or,e,l.Type.u32,r,l.Type.i64,n);case a.i64_atomic_rmw_or:return f(a.atomic_or,e,l.Type.i64,r,l.Type.i64,n);case a.i32_atomic_rmw8_u_xor:return f(a.atomic_xor,e,l.Type.u8,r,l.Type.i32,n);case a.i32_atomic_rmw16_u_xor:return f(a.atomic_xor,e,l.Type.u16,r,l.Type.i32,n);case a.i32_atomic_rmw_xor:return f(a.atomic_xor,e,l.Type.i32,r,l.Type.i32,n);case a.i64_atomic_rmw8_xor_u:return f(a.atomic_xor,e,l.Type.u8,r,l.Type.i64,n);case a.i64_atomic_rmw16_xor_u:return f(a.atomic_xor,e,l.Type.u16,r,l.Type.i64,n);case a.i64_atomic_rmw32_xor_u:return f(a.atomic_xor,e,l.Type.u32,r,l.Type.i64,n);case a.i64_atomic_rmw_xor:return f(a.atomic_xor,e,l.Type.i64,r,l.Type.i64,n);case a.i32_atomic_rmw8_xchg_u:return f(a.atomic_xchg,e,l.Type.u8,r,l.Type.i32,n);case a.i32_atomic_rmw16_xchg_u:return f(a.atomic_xchg,e,l.Type.u16,r,l.Type.i32,n);case a.i32_atomic_rmw_xchg:return f(a.atomic_xchg,e,l.Type.i32,r,l.Type.i32,n);case a.i64_atomic_rmw8_xchg_u:return f(a.atomic_xchg,e,l.Type.u8,r,l.Type.i64,n);case a.i64_atomic_rmw16_xchg_u:return f(a.atomic_xchg,e,l.Type.u16,r,l.Type.i64,n);case a.i64_atomic_rmw32_xchg_u:return f(a.atomic_xchg,e,l.Type.u32,r,l.Type.i64,n);case a.i64_atomic_rmw_xchg:return f(a.atomic_xchg,e,l.Type.i64,r,l.Type.i64,n);case a.i32_atomic_rmw8_cmpxchg_u:return f(a.atomic_cmpxchg,e,l.Type.u8,r,l.Type.i32,n);case a.i32_atomic_rmw16_cmpxchg_u:return f(a.atomic_cmpxchg,e,l.Type.u16,r,l.Type.i32,n);case a.i32_atomic_rmw_cmpxchg:return f(a.atomic_cmpxchg,e,l.Type.i32,r,l.Type.i32,n);case a.i64_atomic_rmw8_cmpxchg_u:return f(a.atomic_cmpxchg,e,l.Type.u8,r,l.Type.i64,n);case a.i64_atomic_rmw16_cmpxchg_u:return f(a.atomic_cmpxchg,e,l.Type.u16,r,l.Type.i64,n);case a.i64_atomic_rmw32_cmpxchg_u:return f(a.atomic_cmpxchg,e,l.Type.u32,r,l.Type.i64,n);case a.i64_atomic_rmw_cmpxchg:return f(a.atomic_cmpxchg,e,l.Type.i64,r,l.Type.i64,n);case a.i32_wait:return f(a.atomic_wait,e,l.Type.i32,r,l.Type.i32,n);case a.i64_wait:return f(a.atomic_wait,e,l.Type.i64,r,l.Type.i32,n)}if(e.options.hasFeature(8))switch(t.internalName){case a.v128_load:return f(a.load,e,l.Type.v128,r,l.Type.v128,n);case a.v128_store:return f(a.store,e,l.Type.v128,r,l.Type.void,n);case a.i8x16_splat:return f(a.v128_splat,e,l.Type.i8,r,l.Type.v128,n);case a.i8x16_extract_lane_s:return f(a.v128_extract_lane,e,l.Type.i8,r,l.Type.i8,n);case a.i8x16_extract_lane_u:return f(a.v128_extract_lane,e,l.Type.u8,r,l.Type.u8,n);case a.i8x16_replace_lane:return f(a.v128_replace_lane,e,l.Type.i8,r,l.Type.v128,n);case a.i8x16_add:return f(a.v128_add,e,l.Type.i8,r,l.Type.v128,n);case a.i8x16_sub:return f(a.v128_sub,e,l.Type.i8,r,l.Type.v128,n);case a.i8x16_mul:return f(a.v128_mul,e,l.Type.i8,r,l.Type.v128,n);case a.i8x16_neg:return f(a.v128_neg,e,l.Type.i8,r,l.Type.v128,n);case a.i8x16_add_saturate_s:return f(a.v128_add_saturate,e,l.Type.i8,r,l.Type.v128,n);case a.i8x16_add_saturate_u:return f(a.v128_add_saturate,e,l.Type.u8,r,l.Type.v128,n);case a.i8x16_sub_saturate_s:return f(a.v128_sub_saturate,e,l.Type.i8,r,l.Type.v128,n);case a.i8x16_sub_saturate_u:return f(a.v128_sub_saturate,e,l.Type.u8,r,l.Type.v128,n);case a.i8x16_shl:return f(a.v128_shl,e,l.Type.i8,r,l.Type.v128,n);case a.i8x16_shr_s:return f(a.v128_shr,e,l.Type.i8,r,l.Type.v128,n);case a.i8x16_shr_u:return f(a.v128_shr,e,l.Type.u8,r,l.Type.v128,n);case a.i8x16_any_true:return f(a.v128_any_true,e,l.Type.i8,r,l.Type.i32,n);case a.i8x16_all_true:return f(a.v128_all_true,e,l.Type.i8,r,l.Type.i32,n);case a.i8x16_eq:return f(a.v128_eq,e,l.Type.i8,r,l.Type.v128,n);case a.i8x16_ne:return f(a.v128_ne,e,l.Type.i8,r,l.Type.v128,n);case a.i8x16_lt_s:return f(a.v128_lt,e,l.Type.i8,r,l.Type.v128,n);case a.i8x16_lt_u:return f(a.v128_lt,e,l.Type.u8,r,l.Type.v128,n);case a.i8x16_le_s:return f(a.v128_le,e,l.Type.i8,r,l.Type.v128,n);case a.i8x16_le_u:return f(a.v128_le,e,l.Type.u8,r,l.Type.v128,n);case a.i8x16_gt_s:return f(a.v128_gt,e,l.Type.i8,r,l.Type.v128,n);case a.i8x16_gt_u:return f(a.v128_gt,e,l.Type.u8,r,l.Type.v128,n);case a.i8x16_ge_s:return f(a.v128_ge,e,l.Type.i8,r,l.Type.v128,n);case a.i8x16_ge_u:return f(a.v128_ge,e,l.Type.u8,r,l.Type.v128,n);case a.i16x8_splat:return f(a.v128_splat,e,l.Type.i16,r,l.Type.v128,n);case a.i16x8_extract_lane_s:return f(a.v128_extract_lane,e,l.Type.i16,r,l.Type.i16,n);case a.i16x8_extract_lane_u:return f(a.v128_extract_lane,e,l.Type.u16,r,l.Type.u16,n);case a.i16x8_replace_lane:return f(a.v128_replace_lane,e,l.Type.i16,r,l.Type.v128,n);case a.i16x8_add:return f(a.v128_add,e,l.Type.i16,r,l.Type.v128,n);case a.i16x8_sub:return f(a.v128_sub,e,l.Type.i16,r,l.Type.v128,n);case a.i16x8_mul:return f(a.v128_mul,e,l.Type.i16,r,l.Type.v128,n);case a.i16x8_neg:return f(a.v128_neg,e,l.Type.i16,r,l.Type.v128,n);case a.i16x8_add_saturate_s:return f(a.v128_add_saturate,e,l.Type.i16,r,l.Type.v128,n);case a.i16x8_add_saturate_u:return f(a.v128_add_saturate,e,l.Type.u16,r,l.Type.v128,n);case a.i16x8_sub_saturate_s:return f(a.v128_sub_saturate,e,l.Type.i16,r,l.Type.v128,n);case a.i16x8_sub_saturate_u:return f(a.v128_sub_saturate,e,l.Type.u16,r,l.Type.v128,n);case a.i16x8_shl:return f(a.v128_shl,e,l.Type.i16,r,l.Type.v128,n);case a.i16x8_shr_s:return f(a.v128_shr,e,l.Type.i16,r,l.Type.v128,n);case a.i16x8_shr_u:return f(a.v128_shr,e,l.Type.u16,r,l.Type.v128,n);case a.i16x8_any_true:return f(a.v128_any_true,e,l.Type.i16,r,l.Type.i32,n);case a.i16x8_all_true:return f(a.v128_all_true,e,l.Type.i16,r,l.Type.i32,n);case a.i16x8_eq:return f(a.v128_eq,e,l.Type.i16,r,l.Type.v128,n);case a.i16x8_ne:return f(a.v128_ne,e,l.Type.i16,r,l.Type.v128,n);case a.i16x8_lt_s:return f(a.v128_lt,e,l.Type.i16,r,l.Type.v128,n);case a.i16x8_lt_u:return f(a.v128_lt,e,l.Type.u16,r,l.Type.v128,n);case a.i16x8_le_s:return f(a.v128_le,e,l.Type.i16,r,l.Type.v128,n);case a.i16x8_le_u:return f(a.v128_le,e,l.Type.u16,r,l.Type.v128,n);case a.i16x8_gt_s:return f(a.v128_gt,e,l.Type.i16,r,l.Type.v128,n);case a.i16x8_gt_u:return f(a.v128_gt,e,l.Type.u16,r,l.Type.v128,n);case a.i16x8_ge_s:return f(a.v128_ge,e,l.Type.i16,r,l.Type.v128,n);case a.i16x8_ge_u:return f(a.v128_ge,e,l.Type.u16,r,l.Type.v128,n);case a.i32x4_splat:return f(a.v128_splat,e,l.Type.i32,r,l.Type.v128,n);case a.i32x4_extract_lane:return f(a.v128_extract_lane,e,l.Type.i32,r,l.Type.i32,n);case a.i32x4_replace_lane:return f(a.v128_replace_lane,e,l.Type.i32,r,l.Type.v128,n);case a.i32x4_add:return f(a.v128_add,e,l.Type.i32,r,l.Type.v128,n);case a.i32x4_sub:return f(a.v128_sub,e,l.Type.i32,r,l.Type.v128,n);case a.i32x4_mul:return f(a.v128_mul,e,l.Type.i32,r,l.Type.v128,n);case a.i32x4_neg:return f(a.v128_neg,e,l.Type.i32,r,l.Type.v128,n);case a.i32x4_shl:return f(a.v128_shl,e,l.Type.i32,r,l.Type.v128,n);case a.i32x4_shr_s:return f(a.v128_shr,e,l.Type.i32,r,l.Type.v128,n);case a.i32x4_shr_u:return f(a.v128_shr,e,l.Type.u32,r,l.Type.v128,n);case a.i32x4_any_true:return f(a.v128_any_true,e,l.Type.i32,r,l.Type.i32,n);case a.i32x4_all_true:return f(a.v128_all_true,e,l.Type.i32,r,l.Type.i32,n);case a.i32x4_eq:return f(a.v128_eq,e,l.Type.i32,r,l.Type.v128,n);case a.i32x4_ne:return f(a.v128_ne,e,l.Type.i32,r,l.Type.v128,n);case a.i32x4_lt_s:return f(a.v128_lt,e,l.Type.i32,r,l.Type.v128,n);case a.i32x4_lt_u:return f(a.v128_lt,e,l.Type.u32,r,l.Type.v128,n);case a.i32x4_le_s:return f(a.v128_le,e,l.Type.i32,r,l.Type.v128,n);case a.i32x4_le_u:return f(a.v128_le,e,l.Type.u32,r,l.Type.v128,n);case a.i32x4_gt_s:return f(a.v128_gt,e,l.Type.i32,r,l.Type.v128,n);case a.i32x4_gt_u:return f(a.v128_gt,e,l.Type.u32,r,l.Type.v128,n);case a.i32x4_ge_s:return f(a.v128_ge,e,l.Type.i32,r,l.Type.v128,n);case a.i32x4_ge_u:return f(a.v128_ge,e,l.Type.u32,r,l.Type.v128,n);case a.i32x4_trunc_s_f32x4_sat:return f(a.v128_trunc,e,l.Type.i32,r,l.Type.v128,n);case a.i32x4_trunc_u_f32x4_sat:return f(a.v128_trunc,e,l.Type.u32,r,l.Type.v128,n);case a.i64x2_splat:return f(a.v128_splat,e,l.Type.i64,r,l.Type.v128,n);case a.i64x2_extract_lane:return f(a.v128_extract_lane,e,l.Type.i64,r,l.Type.i64,n);case a.i64x2_replace_lane:return f(a.v128_replace_lane,e,l.Type.i64,r,l.Type.v128,n);case a.i64x2_add:return f(a.v128_add,e,l.Type.i64,r,l.Type.v128,n);case a.i64x2_sub:return f(a.v128_sub,e,l.Type.i64,r,l.Type.v128,n);case a.i64x2_neg:return f(a.v128_neg,e,l.Type.i64,r,l.Type.v128,n);case a.i64x2_shl:return f(a.v128_shl,e,l.Type.i64,r,l.Type.v128,n);case a.i64x2_shr_s:return f(a.v128_shr,e,l.Type.i64,r,l.Type.v128,n);case a.i64x2_shr_u:return f(a.v128_shr,e,l.Type.u64,r,l.Type.v128,n);case a.i64x2_any_true:return f(a.v128_any_true,e,l.Type.i64,r,l.Type.i32,n);case a.i64x2_all_true:return f(a.v128_all_true,e,l.Type.i64,r,l.Type.i32,n);case a.i64x2_trunc_s_f64x2_sat:return f(a.v128_trunc,e,l.Type.i64,r,l.Type.v128,n);case a.i64x2_trunc_u_f64x2_sat:return f(a.v128_trunc,e,l.Type.u64,r,l.Type.v128,n);case a.f32x4_splat:return f(a.v128_splat,e,l.Type.f32,r,l.Type.v128,n);case a.f32x4_extract_lane:return f(a.v128_extract_lane,e,l.Type.f32,r,l.Type.f32,n);case a.f32x4_replace_lane:return f(a.v128_replace_lane,e,l.Type.f32,r,l.Type.v128,n);case a.f32x4_add:return f(a.v128_add,e,l.Type.f32,r,l.Type.v128,n);case a.f32x4_sub:return f(a.v128_sub,e,l.Type.f32,r,l.Type.v128,n);case a.f32x4_mul:return f(a.v128_mul,e,l.Type.f32,r,l.Type.v128,n);case a.f32x4_div:return f(a.v128_div,e,l.Type.f32,r,l.Type.v128,n);case a.f32x4_neg:return f(a.v128_neg,e,l.Type.f32,r,l.Type.v128,n);case a.f32x4_min:return f(a.v128_min,e,l.Type.f32,r,l.Type.v128,n);case a.f32x4_max:return f(a.v128_max,e,l.Type.f32,r,l.Type.v128,n);case a.f32x4_abs:return f(a.v128_abs,e,l.Type.f32,r,l.Type.v128,n);case a.f32x4_sqrt:return f(a.v128_sqrt,e,l.Type.f32,r,l.Type.v128,n);case a.f32x4_eq:return f(a.v128_eq,e,l.Type.f32,r,l.Type.v128,n);case a.f32x4_ne:return f(a.v128_ne,e,l.Type.f32,r,l.Type.v128,n);case a.f32x4_lt:return f(a.v128_lt,e,l.Type.f32,r,l.Type.v128,n);case a.f32x4_le:return f(a.v128_le,e,l.Type.f32,r,l.Type.v128,n);case a.f32x4_gt:return f(a.v128_gt,e,l.Type.f32,r,l.Type.v128,n);case a.f32x4_ge:return f(a.v128_ge,e,l.Type.f32,r,l.Type.v128,n);case a.f32x4_convert_s_i32x4:return f(a.v128_convert,e,l.Type.i32,r,l.Type.v128,n);case a.f32x4_convert_u_i32x4:return f(a.v128_convert,e,l.Type.u32,r,l.Type.v128,n);case a.f64x2_splat:return f(a.v128_splat,e,l.Type.f64,r,l.Type.v128,n);case a.f64x2_extract_lane:return f(a.v128_extract_lane,e,l.Type.f64,r,l.Type.f64,n);case a.f64x2_replace_lane:return f(a.v128_replace_lane,e,l.Type.f64,r,l.Type.v128,n);case a.f64x2_add:return f(a.v128_add,e,l.Type.f64,r,l.Type.v128,n);case a.f64x2_sub:return f(a.v128_sub,e,l.Type.f64,r,l.Type.v128,n);case a.f64x2_mul:return f(a.v128_mul,e,l.Type.f64,r,l.Type.v128,n);case a.f64x2_div:return f(a.v128_div,e,l.Type.f64,r,l.Type.v128,n);case a.f64x2_neg:return f(a.v128_neg,e,l.Type.f64,r,l.Type.v128,n);case a.f64x2_min:return f(a.v128_min,e,l.Type.f64,r,l.Type.v128,n);case a.f64x2_max:return f(a.v128_max,e,l.Type.f64,r,l.Type.v128,n);case a.f64x2_abs:return f(a.v128_abs,e,l.Type.f64,r,l.Type.v128,n);case a.f64x2_sqrt:return f(a.v128_sqrt,e,l.Type.f64,r,l.Type.v128,n);case a.f64x2_eq:return f(a.v128_eq,e,l.Type.f64,r,l.Type.v128,n);case a.f64x2_ne:return f(a.v128_ne,e,l.Type.f64,r,l.Type.v128,n);case a.f64x2_lt:return f(a.v128_lt,e,l.Type.f64,r,l.Type.v128,n);case a.f64x2_le:return f(a.v128_le,e,l.Type.f64,r,l.Type.v128,n);case a.f64x2_gt:return f(a.v128_gt,e,l.Type.f64,r,l.Type.v128,n);case a.f64x2_ge:return f(a.v128_ge,e,l.Type.f64,r,l.Type.v128,n);case a.f64x2_convert_s_i64x2:return f(a.v128_convert,e,l.Type.i64,r,l.Type.v128,n);case a.f64x2_convert_u_i64x2:return f(a.v128_convert,e,l.Type.u64,r,l.Type.v128,n);case a.v8x16_shuffle:return f(a.v128_shuffle,e,l.Type.i8,r,l.Type.v128,n)}return 0}(e,t,n,s))?(r&&e.error(o.DiagnosticCode.Type_0_is_not_generic,s.typeArgumentsRange,t.internalName),R):(e.error(o.DiagnosticCode.Cannot_find_name_0,s.expression.range,t.internalName),m.unreachable())}function f(e,t,r,n,i,a){assert(t.program.elementsByName.has(e));var s=t.program.elementsByName.get(e);return assert(s.kind==p.ElementKind.FUNCTION_PROTOTYPE),m(t,s,[r],n,i,a,!0)}function T(e,t,r){var n=e.program,i=e.module,a=e.program.stringInstance;if(!a)return i.unreachable();var s,o=n.abortInstance;if(!o||!e.compileFunction(o))return i.unreachable();s=null!==t?e.compileExpression(t,a.type,17):a.type.toNativeZero(i);var c=e.ensureStaticString(r.range.source.normalizedPath);return e.currentType=l.Type.void,i.block(null,[i.call(o.internalName,[s,c,i.i32(r.range.line),i.i32(r.range.column)],u.NativeType.None),i.unreachable()])}function g(e){var t=32*(1<1&&e.error(o.DiagnosticCode.Expected_0_type_arguments_but_got_1,n.typeArgumentsRange,"1",t.length.toString(10)),e.error(o.DiagnosticCode.Expected_0_arguments_but_got_1,n.argumentsRange,"1",r.length.toString(10)),null}function v(e,t){var r,n;return t.options.isWasm64?(r=t.precomputeExpression(e,l.Type.usize64,1),(u.getExpressionId(r)!=u.ExpressionId.Const||u.getExpressionType(r)!=u.NativeType.I64||0!=u.getConstValueI64High(r)||(n=u.getConstValueI64Low(r))<0)&&(t.error(o.DiagnosticCode.Expression_must_be_a_compile_time_constant,e.range),n=-1)):(r=t.precomputeExpression(e,l.Type.usize32,1),(u.getExpressionId(r)!=u.ExpressionId.Const||u.getExpressionType(r)!=u.NativeType.I32||(n=u.getConstValueI32(r))<0)&&(t.error(o.DiagnosticCode.Expression_must_be_a_compile_time_constant,e.range),n=-1)),n}function b(e,t,r,n){if(void 0===n&&(n=!1),e){var i=e.length;if(1==i)return 0;assert(i),n&&(r.currentType=e[0]),r.error(o.DiagnosticCode.Expected_0_type_arguments_but_got_1,t.typeArgumentsRange,"1",i.toString())}else r.error(o.DiagnosticCode.Expected_0_type_arguments_but_got_1,t.range,"1","0");return 1}function I(e,t,r,n){if(void 0===n&&(n=!1),e){var i=e.length;return 1==i?0:(assert(i),n&&(r.currentType=e[0]),r.error(o.DiagnosticCode.Expected_0_type_arguments_but_got_1,t.typeArgumentsRange,"1",i.toString()),1)}return 0}function x(e,t,r){return e?(r.program.error(o.DiagnosticCode.Type_0_is_not_generic,t.typeArgumentsRange,r.internalName),1):0}function A(e,t,r,n){return e.length!=t?(n.error(o.DiagnosticCode.Expected_0_arguments_but_got_1,r.range,t.toString(),e.length.toString()),1):0}function N(e,t,r,n,i){var a=e.length;return ar?(i.error(o.DiagnosticCode.Expected_0_arguments_but_got_1,n.range,r.toString(),a.toString()),1):0}!function(e){e.isInteger="~lib/builtins/isInteger",e.isFloat="~lib/builtins/isFloat",e.isBoolean="~lib/builtins/isBoolean",e.isSigned="~lib/builtins/isSigned",e.isReference="~lib/builtins/isReference",e.isString="~lib/builtins/isString",e.isArray="~lib/builtins/isArray",e.isArrayLike="~lib/builtins/isArrayLike",e.isFunction="~lib/builtins/isFunction",e.isNullable="~lib/builtins/isNullable",e.isDefined="~lib/builtins/isDefined",e.isConstant="~lib/builtins/isConstant",e.isManaged="~lib/builtins/isManaged",e.clz="~lib/builtins/clz",e.ctz="~lib/builtins/ctz",e.popcnt="~lib/builtins/popcnt",e.rotl="~lib/builtins/rotl",e.rotr="~lib/builtins/rotr",e.abs="~lib/builtins/abs",e.max="~lib/builtins/max",e.min="~lib/builtins/min",e.ceil="~lib/builtins/ceil",e.floor="~lib/builtins/floor",e.copysign="~lib/builtins/copysign",e.nearest="~lib/builtins/nearest",e.reinterpret="~lib/builtins/reinterpret",e.sqrt="~lib/builtins/sqrt",e.trunc="~lib/builtins/trunc",e.load="~lib/builtins/load",e.store="~lib/builtins/store",e.atomic_load="~lib/builtins/atomic.load",e.atomic_store="~lib/builtins/atomic.store",e.atomic_add="~lib/builtins/atomic.add",e.atomic_sub="~lib/builtins/atomic.sub",e.atomic_and="~lib/builtins/atomic.and",e.atomic_or="~lib/builtins/atomic.or",e.atomic_xor="~lib/builtins/atomic.xor",e.atomic_xchg="~lib/builtins/atomic.xchg",e.atomic_cmpxchg="~lib/builtins/atomic.cmpxchg",e.atomic_wait="~lib/builtins/atomic.wait",e.atomic_notify="~lib/builtins/atomic.notify",e.sizeof="~lib/builtins/sizeof",e.alignof="~lib/builtins/alignof",e.offsetof="~lib/builtins/offsetof",e.select="~lib/builtins/select",e.unreachable="~lib/builtins/unreachable",e.changetype="~lib/builtins/changetype",e.assert="~lib/builtins/assert",e.unchecked="~lib/builtins/unchecked",e.call_direct="~lib/builtins/call_direct",e.call_indirect="~lib/builtins/call_indirect",e.instantiate="~lib/builtins/instantiate",e.idof="~lib/builtins/idof",e.i8="~lib/builtins/i8",e.i16="~lib/builtins/i16",e.i32="~lib/builtins/i32",e.i64="~lib/builtins/i64",e.isize="~lib/builtins/isize",e.u8="~lib/builtins/u8",e.u16="~lib/builtins/u16",e.u32="~lib/builtins/u32",e.u64="~lib/builtins/u64",e.usize="~lib/builtins/usize",e.bool="~lib/builtins/bool",e.f32="~lib/builtins/f32",e.f64="~lib/builtins/f64",e.v128="~lib/builtins/v128",e.void_="~lib/builtins/void",e.i32_clz="~lib/builtins/i32.clz",e.i64_clz="~lib/builtins/i64.clz",e.i32_ctz="~lib/builtins/i32.ctz",e.i64_ctz="~lib/builtins/i64.ctz",e.i32_popcnt="~lib/builtins/i32.popcnt",e.i64_popcnt="~lib/builtins/i64.popcnt",e.i32_rotl="~lib/builtins/i32.rotl",e.i64_rotl="~lib/builtins/i64.rotl",e.i32_rotr="~lib/builtins/i32.rotr",e.i64_rotr="~lib/builtins/i64.rotr",e.f32_abs="~lib/builtins/f32.abs",e.f64_abs="~lib/builtins/f64.abs",e.f32_max="~lib/builtins/f32.max",e.f64_max="~lib/builtins/f64.max",e.f32_min="~lib/builtins/f32.min",e.f64_min="~lib/builtins/f64.min",e.f32_ceil="~lib/builtins/f32.ceil",e.f64_ceil="~lib/builtins/f64.ceil",e.f32_floor="~lib/builtins/f32.floor",e.f64_floor="~lib/builtins/f64.floor",e.f32_copysign="~lib/builtins/f32.copysign",e.f64_copysign="~lib/builtins/f64.copysign",e.f32_nearest="~lib/builtins/f32.nearest",e.f64_nearest="~lib/builtins/f64.nearest",e.i32_reinterpret_f32="~lib/builtins/i32.reinterpret_f32",e.i64_reinterpret_f64="~lib/builtins/i64.reinterpret_f64",e.f32_reinterpret_i32="~lib/builtins/f32.reinterpret_i32",e.f64_reinterpret_i64="~lib/builtins/f64.reinterpret_i64",e.f32_sqrt="~lib/builtins/f32.sqrt",e.f64_sqrt="~lib/builtins/f64.sqrt",e.f32_trunc="~lib/builtins/f32.trunc",e.f64_trunc="~lib/builtins/f64.trunc",e.i32_load8_s="~lib/builtins/i32.load8_s",e.i32_load8_u="~lib/builtins/i32.load8_u",e.i32_load16_s="~lib/builtins/i32.load16_s",e.i32_load16_u="~lib/builtins/i32.load16_u",e.i32_load="~lib/builtins/i32.load",e.i64_load8_s="~lib/builtins/i64.load8_s",e.i64_load8_u="~lib/builtins/i64.load8_u",e.i64_load16_s="~lib/builtins/i64.load16_s",e.i64_load16_u="~lib/builtins/i64.load16_u",e.i64_load32_s="~lib/builtins/i64.load32_s",e.i64_load32_u="~lib/builtins/i64.load32_u",e.i64_load="~lib/builtins/i64.load",e.f32_load="~lib/builtins/f32.load",e.f64_load="~lib/builtins/f64.load",e.i32_store8="~lib/builtins/i32.store8",e.i32_store16="~lib/builtins/i32.store16",e.i32_store="~lib/builtins/i32.store",e.i64_store8="~lib/builtins/i64.store8",e.i64_store16="~lib/builtins/i64.store16",e.i64_store32="~lib/builtins/i64.store32",e.i64_store="~lib/builtins/i64.store",e.f32_store="~lib/builtins/f32.store",e.f64_store="~lib/builtins/f64.store",e.i32_atomic_load8_u="~lib/builtins/i32.atomic.load8_u",e.i32_atomic_load16_u="~lib/builtins/i32.atomic.load16_u",e.i32_atomic_load="~lib/builtins/i32.atomic.load",e.i64_atomic_load8_u="~lib/builtins/i64.atomic.load8_u",e.i64_atomic_load16_u="~lib/builtins/i64.atomic.load16_u",e.i64_atomic_load32_u="~lib/builtins/i64.atomic.load32_u",e.i64_atomic_load="~lib/builtins/i64.atomic.load",e.i32_atomic_store8="~lib/builtins/i32.atomic.store8",e.i32_atomic_store16="~lib/builtins/i32.atomic.store16",e.i32_atomic_store="~lib/builtins/i32.atomic.store",e.i64_atomic_store8="~lib/builtins/i64.atomic.store8",e.i64_atomic_store16="~lib/builtins/i64.atomic.store16",e.i64_atomic_store32="~lib/builtins/i64.atomic.store32",e.i64_atomic_store="~lib/builtins/i64.atomic.store",e.i32_atomic_rmw8_add_u="~lib/builtins/i32.atomic.rmw8.add_u",e.i32_atomic_rmw16_add_u="~lib/builtins/i32.atomic.rmw16.add_u",e.i32_atomic_rmw_add="~lib/builtins/i32.atomic.rmw.add",e.i64_atomic_rmw8_add_u="~lib/builtins/i64.atomic.rmw8.add_u",e.i64_atomic_rmw16_add_u="~lib/builtins/i64.atomic.rmw16.add_u",e.i64_atomic_rmw32_add_u="~lib/builtins/i64.atomic.rmw32.add_u",e.i64_atomic_rmw_add="~lib/builtins/i64.atomic.rmw.add",e.i32_atomic_rmw8_sub_u="~lib/builtins/i32.atomic.rmw8.sub_u",e.i32_atomic_rmw16_sub_u="~lib/builtins/i32.atomic.rmw16.sub_u",e.i32_atomic_rmw_sub="~lib/builtins/i32.atomic.rmw.sub",e.i64_atomic_rmw8_sub_u="~lib/builtins/i64.atomic.rmw8.sub_u",e.i64_atomic_rmw16_sub_u="~lib/builtins/i64.atomic.rmw16.sub_u",e.i64_atomic_rmw32_sub_u="~lib/builtins/i64.atomic.rmw32.sub_u",e.i64_atomic_rmw_sub="~lib/builtins/i64.atomic.rmw.sub",e.i32_atomic_rmw8_and_u="~lib/builtins/i32.atomic.rmw8.and_u",e.i32_atomic_rmw16_and_u="~lib/builtins/i32.atomic.rmw16.and_u",e.i32_atomic_rmw_and="~lib/builtins/i32.atomic.rmw.and",e.i64_atomic_rmw8_and_u="~lib/builtins/i64.atomic.rmw8.and_u",e.i64_atomic_rmw16_and_u="~lib/builtins/i64.atomic.rmw16.and_u",e.i64_atomic_rmw32_and_u="~lib/builtins/i64.atomic.rmw32.and_u",e.i64_atomic_rmw_and="~lib/builtins/i64.atomic.rmw.and",e.i32_atomic_rmw8_or_u="~lib/builtins/i32.atomic.rmw8.or_u",e.i32_atomic_rmw16_or_u="~lib/builtins/i32.atomic.rmw16.or_u",e.i32_atomic_rmw_or="~lib/builtins/i32.atomic.rmw.or",e.i64_atomic_rmw8_or_u="~lib/builtins/i64.atomic.rmw8.or_u",e.i64_atomic_rmw16_or_u="~lib/builtins/i64.atomic.rmw16.or_u",e.i64_atomic_rmw32_or_u="~lib/builtins/i64.atomic.rmw32.or_u",e.i64_atomic_rmw_or="~lib/builtins/i64.atomic.rmw.or",e.i32_atomic_rmw8_u_xor="~lib/builtins/i32.atomic.rmw8.xor_u",e.i32_atomic_rmw16_u_xor="~lib/builtins/i32.atomic.rmw16.xor_u",e.i32_atomic_rmw_xor="~lib/builtins/i32.atomic.rmw.xor",e.i64_atomic_rmw8_xor_u="~lib/builtins/i64.atomic.rmw8.xor_u",e.i64_atomic_rmw16_xor_u="~lib/builtins/i64.atomic.rmw16.xor_u",e.i64_atomic_rmw32_xor_u="~lib/builtins/i64.atomic.rmw32.xor_u",e.i64_atomic_rmw_xor="~lib/builtins/i64.atomic.rmw.xor",e.i32_atomic_rmw8_xchg_u="~lib/builtins/i32.atomic.rmw8.xchg_u",e.i32_atomic_rmw16_xchg_u="~lib/builtins/i32.atomic.rmw16.xchg_u",e.i32_atomic_rmw_xchg="~lib/builtins/i32.atomic.rmw.xchg",e.i64_atomic_rmw8_xchg_u="~lib/builtins/i64.atomic.rmw8.xchg_u",e.i64_atomic_rmw16_xchg_u="~lib/builtins/i64.atomic.rmw16.xchg_u",e.i64_atomic_rmw32_xchg_u="~lib/builtins/i64.atomic.rmw32.xchg_u",e.i64_atomic_rmw_xchg="~lib/builtins/i64.atomic.rmw.xchg",e.i32_atomic_rmw8_cmpxchg_u="~lib/builtins/i32.atomic.rmw8.cmpxchg_u",e.i32_atomic_rmw16_cmpxchg_u="~lib/builtins/i32.atomic.rmw16.cmpxchg_u",e.i32_atomic_rmw_cmpxchg="~lib/builtins/i32.atomic.rmw.cmpxchg",e.i64_atomic_rmw8_cmpxchg_u="~lib/builtins/i64.atomic.rmw8.cmpxchg_u",e.i64_atomic_rmw16_cmpxchg_u="~lib/builtins/i64.atomic.rmw16.cmpxchg_u",e.i64_atomic_rmw32_cmpxchg_u="~lib/builtins/i64.atomic.rmw32.cmpxchg_u",e.i64_atomic_rmw_cmpxchg="~lib/builtins/i64.atomic.rmw.cmpxchg",e.i32_wait="~lib/builtins/i32.wait",e.i64_wait="~lib/builtins/i64.wait",e.v128_splat="~lib/builtins/v128.splat",e.v128_extract_lane="~lib/builtins/v128.extract_lane",e.v128_replace_lane="~lib/builtins/v128.replace_lane",e.v128_shuffle="~lib/builtins/v128.shuffle",e.v128_load="~lib/builtins/v128.load",e.v128_store="~lib/builtins/v128.store",e.v128_add="~lib/builtins/v128.add",e.v128_sub="~lib/builtins/v128.sub",e.v128_mul="~lib/builtins/v128.mul",e.v128_div="~lib/builtins/v128.div",e.v128_neg="~lib/builtins/v128.neg",e.v128_add_saturate="~lib/builtins/v128.add_saturate",e.v128_sub_saturate="~lib/builtins/v128.sub_saturate",e.v128_shl="~lib/builtins/v128.shl",e.v128_shr="~lib/builtins/v128.shr",e.v128_and="~lib/builtins/v128.and",e.v128_or="~lib/builtins/v128.or",e.v128_xor="~lib/builtins/v128.xor",e.v128_not="~lib/builtins/v128.not",e.v128_bitselect="~lib/builtins/v128.bitselect",e.v128_any_true="~lib/builtins/v128.any_true",e.v128_all_true="~lib/builtins/v128.all_true",e.v128_min="~lib/builtins/v128.min",e.v128_max="~lib/builtins/v128.max",e.v128_abs="~lib/builtins/v128.abs",e.v128_sqrt="~lib/builtins/v128.sqrt",e.v128_eq="~lib/builtins/v128.eq",e.v128_ne="~lib/builtins/v128.ne",e.v128_lt="~lib/builtins/v128.lt",e.v128_le="~lib/builtins/v128.le",e.v128_gt="~lib/builtins/v128.gt",e.v128_ge="~lib/builtins/v128.ge",e.v128_convert="~lib/builtins/v128.convert",e.v128_trunc="~lib/builtins/v128.trunc",e.i8x16="~lib/builtins/i8x16",e.i16x8="~lib/builtins/i16x8",e.i32x4="~lib/builtins/i32x4",e.i64x2="~lib/builtins/i64x2",e.f32x4="~lib/builtins/f32x4",e.f64x2="~lib/builtins/f64x2",e.i8x16_splat="~lib/builtins/i8x16.splat",e.i8x16_extract_lane_s="~lib/builtins/i8x16.extract_lane_s",e.i8x16_extract_lane_u="~lib/builtins/i8x16.extract_lane_u",e.i8x16_replace_lane="~lib/builtins/i8x16.replace_lane",e.i8x16_add="~lib/builtins/i8x16.add",e.i8x16_sub="~lib/builtins/i8x16.sub",e.i8x16_mul="~lib/builtins/i8x16.mul",e.i8x16_neg="~lib/builtins/i8x16.neg",e.i8x16_add_saturate_s="~lib/builtins/i8x16.add_saturate_s",e.i8x16_add_saturate_u="~lib/builtins/i8x16.add_saturate_u",e.i8x16_sub_saturate_s="~lib/builtins/i8x16.sub_saturate_s",e.i8x16_sub_saturate_u="~lib/builtins/i8x16.sub_saturate_u",e.i8x16_shl="~lib/builtins/i8x16.shl",e.i8x16_shr_s="~lib/builtins/i8x16.shr_s",e.i8x16_shr_u="~lib/builtins/i8x16.shr_u",e.i8x16_any_true="~lib/builtins/i8x16.any_true",e.i8x16_all_true="~lib/builtins/i8x16.all_true",e.i8x16_eq="~lib/builtins/i8x16.eq",e.i8x16_ne="~lib/builtins/i8x16.ne",e.i8x16_lt_s="~lib/builtins/i8x16.lt_s",e.i8x16_lt_u="~lib/builtins/i8x16.lt_u",e.i8x16_le_s="~lib/builtins/i8x16.le_s",e.i8x16_le_u="~lib/builtins/i8x16.le_u",e.i8x16_gt_s="~lib/builtins/i8x16.gt_s",e.i8x16_gt_u="~lib/builtins/i8x16.gt_u",e.i8x16_ge_s="~lib/builtins/i8x16.ge_s",e.i8x16_ge_u="~lib/builtins/i8x16.ge_u",e.i16x8_splat="~lib/builtins/i16x8.splat",e.i16x8_extract_lane_s="~lib/builtins/i16x8.extract_lane_s",e.i16x8_extract_lane_u="~lib/builtins/i16x8.extract_lane_u",e.i16x8_replace_lane="~lib/builtins/i16x8.replace_lane",e.i16x8_add="~lib/builtins/i16x8.add",e.i16x8_sub="~lib/builtins/i16x8.sub",e.i16x8_mul="~lib/builtins/i16x8.mul",e.i16x8_neg="~lib/builtins/i16x8.neg",e.i16x8_add_saturate_s="~lib/builtins/i16x8.add_saturate_s",e.i16x8_add_saturate_u="~lib/builtins/i16x8.add_saturate_u",e.i16x8_sub_saturate_s="~lib/builtins/i16x8.sub_saturate_s",e.i16x8_sub_saturate_u="~lib/builtins/i16x8.sub_saturate_u",e.i16x8_shl="~lib/builtins/i16x8.shl",e.i16x8_shr_s="~lib/builtins/i16x8.shr_s",e.i16x8_shr_u="~lib/builtins/i16x8.shr_u",e.i16x8_any_true="~lib/builtins/i16x8.any_true",e.i16x8_all_true="~lib/builtins/i16x8.all_true",e.i16x8_eq="~lib/builtins/i16x8.eq",e.i16x8_ne="~lib/builtins/i16x8.ne",e.i16x8_lt_s="~lib/builtins/i16x8.lt_s",e.i16x8_lt_u="~lib/builtins/i16x8.lt_u",e.i16x8_le_s="~lib/builtins/i16x8.le_s",e.i16x8_le_u="~lib/builtins/i16x8.le_u",e.i16x8_gt_s="~lib/builtins/i16x8.gt_s",e.i16x8_gt_u="~lib/builtins/i16x8.gt_u",e.i16x8_ge_s="~lib/builtins/i16x8.ge_s",e.i16x8_ge_u="~lib/builtins/i16x8.ge_u",e.i32x4_splat="~lib/builtins/i32x4.splat",e.i32x4_extract_lane="~lib/builtins/i32x4.extract_lane",e.i32x4_replace_lane="~lib/builtins/i32x4.replace_lane",e.i32x4_add="~lib/builtins/i32x4.add",e.i32x4_sub="~lib/builtins/i32x4.sub",e.i32x4_mul="~lib/builtins/i32x4.mul",e.i32x4_neg="~lib/builtins/i32x4.neg",e.i32x4_shl="~lib/builtins/i32x4.shl",e.i32x4_shr_s="~lib/builtins/i32x4.shr_s",e.i32x4_shr_u="~lib/builtins/i32x4.shr_u",e.i32x4_any_true="~lib/builtins/i32x4.any_true",e.i32x4_all_true="~lib/builtins/i32x4.all_true",e.i32x4_eq="~lib/builtins/i32x4.eq",e.i32x4_ne="~lib/builtins/i32x4.ne",e.i32x4_lt_s="~lib/builtins/i32x4.lt_s",e.i32x4_lt_u="~lib/builtins/i32x4.lt_u",e.i32x4_le_s="~lib/builtins/i32x4.le_s",e.i32x4_le_u="~lib/builtins/i32x4.le_u",e.i32x4_gt_s="~lib/builtins/i32x4.gt_s",e.i32x4_gt_u="~lib/builtins/i32x4.gt_u",e.i32x4_ge_s="~lib/builtins/i32x4.ge_s",e.i32x4_ge_u="~lib/builtins/i32x4.ge_u",e.i32x4_trunc_s_f32x4_sat="~lib/builtins/i32x4.trunc_s_f32x4_sat",e.i32x4_trunc_u_f32x4_sat="~lib/builtins/i32x4.trunc_u_f32x4_sat",e.i64x2_splat="~lib/builtins/i64x2.splat",e.i64x2_extract_lane="~lib/builtins/i64x2.extract_lane",e.i64x2_replace_lane="~lib/builtins/i64x2.replace_lane",e.i64x2_add="~lib/builtins/i64x2.add",e.i64x2_sub="~lib/builtins/i64x2.sub",e.i64x2_neg="~lib/builtins/i64x2.neg",e.i64x2_shl="~lib/builtins/i64x2.shl",e.i64x2_shr_s="~lib/builtins/i64x2.shr_s",e.i64x2_shr_u="~lib/builtins/i64x2.shr_u",e.i64x2_any_true="~lib/builtins/i64x2.any_true",e.i64x2_all_true="~lib/builtins/i64x2.all_true",e.i64x2_trunc_s_f64x2_sat="~lib/builtins/i64x2.trunc_s_f64x2_sat",e.i64x2_trunc_u_f64x2_sat="~lib/builtins/i64x2.trunc_u_f64x2_sat",e.f32x4_splat="~lib/builtins/f32x4.splat",e.f32x4_extract_lane="~lib/builtins/f32x4.extract_lane",e.f32x4_replace_lane="~lib/builtins/f32x4.replace_lane",e.f32x4_add="~lib/builtins/f32x4.add",e.f32x4_sub="~lib/builtins/f32x4.sub",e.f32x4_mul="~lib/builtins/f32x4.mul",e.f32x4_div="~lib/builtins/f32x4.div",e.f32x4_neg="~lib/builtins/f32x4.neg",e.f32x4_min="~lib/builtins/f32x4.min",e.f32x4_max="~lib/builtins/f32x4.max",e.f32x4_abs="~lib/builtins/f32x4.abs",e.f32x4_sqrt="~lib/builtins/f32x4.sqrt",e.f32x4_eq="~lib/builtins/f32x4.eq",e.f32x4_ne="~lib/builtins/f32x4.ne",e.f32x4_lt="~lib/builtins/f32x4.lt",e.f32x4_le="~lib/builtins/f32x4.le",e.f32x4_gt="~lib/builtins/f32x4.gt",e.f32x4_ge="~lib/builtins/f32x4.ge",e.f32x4_convert_s_i32x4="~lib/builtins/f32x4.convert_s_i32x4",e.f32x4_convert_u_i32x4="~lib/builtins/f32x4.convert_u_i32x4",e.f64x2_splat="~lib/builtins/f64x2.splat",e.f64x2_extract_lane="~lib/builtins/f64x2.extract_lane",e.f64x2_replace_lane="~lib/builtins/f64x2.replace_lane",e.f64x2_add="~lib/builtins/f64x2.add",e.f64x2_sub="~lib/builtins/f64x2.sub",e.f64x2_mul="~lib/builtins/f64x2.mul",e.f64x2_div="~lib/builtins/f64x2.div",e.f64x2_neg="~lib/builtins/f64x2.neg",e.f64x2_min="~lib/builtins/f64x2.min",e.f64x2_max="~lib/builtins/f64x2.max",e.f64x2_abs="~lib/builtins/f64x2.abs",e.f64x2_sqrt="~lib/builtins/f64x2.sqrt",e.f64x2_eq="~lib/builtins/f64x2.eq",e.f64x2_ne="~lib/builtins/f64x2.ne",e.f64x2_lt="~lib/builtins/f64x2.lt",e.f64x2_le="~lib/builtins/f64x2.le",e.f64x2_gt="~lib/builtins/f64x2.gt",e.f64x2_ge="~lib/builtins/f64x2.ge",e.f64x2_convert_s_i64x2="~lib/builtins/f64x2.convert_s_i64x2",e.f64x2_convert_u_i64x2="~lib/builtins/f64x2.convert_u_i64x2",e.v8x16_shuffle="~lib/builtins/v8x16.shuffle",e.heap_base="~lib/heap/__heap_base",e.rtti_base="~lib/rt/__rtti_base",e.visit_globals="~lib/rt/__visit_globals",e.visit_members="~lib/rt/__visit_members",e.ERROR="~lib/diagnostics/ERROR",e.WARNING="~lib/diagnostics/WARNING",e.INFO="~lib/diagnostics/INFO",e.memory_size="~lib/memory/memory.size",e.memory_grow="~lib/memory/memory.grow",e.memory_copy="~lib/memory/memory.copy",e.memory_fill="~lib/memory/memory.fill",e.memory_allocate="~lib/memory/memory.allocate",e.memory_free="~lib/memory/memory.free",e.memory_reset="~lib/memory/memory.reset",e.runtime_instanceof="~lib/runtime/runtime.instanceof",e.runtime_flags="~lib/runtime/runtime.flags",e.runtime_allocate="~lib/util/runtime/allocate",e.runtime_reallocate="~lib/util/runtime/reallocate",e.runtime_register="~lib/util/runtime/register",e.runtime_discard="~lib/util/runtime/discard",e.runtime_makeArray="~lib/util/runtime/makeArray",e.Int8Array="~lib/typedarray/Int8Array",e.Uint8Array="~lib/typedarray/Uint8Array",e.Int16Array="~lib/typedarray/Int16Array",e.Uint16Array="~lib/typedarray/Uint16Array",e.Int32Array="~lib/typedarray/Int32Array",e.Uint32Array="~lib/typedarray/Uint32Array",e.Int64Array="~lib/typedarray/Int64Array",e.Uint64Array="~lib/typedarray/Uint64Array",e.Uint8ClampedArray="~lib/typedarray/Uint8ClampedArray",e.Float32Array="~lib/typedarray/Float32Array",e.Float64Array="~lib/typedarray/Float64Array",e.started="~lib/started",e.argc="~lib/argc",e.setargc="~lib/setargc",e.capabilities="~lib/capabilities"}(a=t.BuiltinSymbols||(t.BuiltinSymbols={})),t.compileCall=m,t.compileAbort=T,t.compileVisitGlobals=function(e){var t,r,i=e.module,s=new Array,o=e.ensureFunctionType([l.Type.u32],l.Type.void),c=e.options.nativeSizeType,_=assert(e.program.visitInstance);e.compileFunction(_);try{for(var h=n(e.program.elementsByName.values()),y=h.next();!y.done;y=h.next()){var m=y.value;if(m.kind==p.ElementKind.GLOBAL){var f=m,T=f.type.classReference;if(f.is(d.CommonFlags.COMPILED)&&null!==T&&!T.hasDecorator(p.DecoratorFlags.UNMANAGED))if(f.is(d.CommonFlags.INLINED)){var g=f.constantIntegerValue;(i64_low(g)||i64_high(g))&&s.push(i.call(_.internalName,[e.options.isWasm64?i.i64(i64_low(g),i64_high(g)):i.i32(i64_low(g))],u.NativeType.None))}else s.push(i.if(i.local_tee(1,i.global_get(f.internalName,c)),i.call(_.internalName,[i.local_get(1,c),i.local_get(0,u.NativeType.I32)],u.NativeType.None)))}}}catch(e){t={error:e}}finally{try{y&&!y.done&&(r=h.return)&&r.call(h)}finally{if(t)throw t.error}}i.addFunction(a.visit_globals,o,[c],s.length?i.block(null,s):i.nop())},t.compileVisitMembers=function(e){var t,r,o,c,_,h,d=e.program,y=e.module,m=d.options.usizeType,f=m.toNativeType(),T=m.byteSize,g=e.ensureFunctionType([m,l.Type.i32],l.Type.void),E=d.managedClasses,v=assert(d.visitInstance),b=new Array,I=u.Relooper.create(y),x=I.addBlockWithSwitch(y.nop(),y.load(T,!1,f==u.NativeType.I64?y.binary(u.BinaryOp.SubI64,y.local_get(0,f),y.i64(8)):y.binary(u.BinaryOp.SubI32,y.local_get(0,f),y.i32(8)),u.NativeType.I32,0)),A=0;try{for(var N=n(E),S=N.next();!S.done;S=N.next()){var O=i(S.value,2),C=O[0],k=O[1];assert(k.type.isManaged),assert(C==A++);var R=void 0;if(k.isDeclaredInLibrary&&(R=k.lookupInSelf("__visit_impl"))){assert(R.kind==p.ElementKind.FUNCTION_PROTOTYPE);var L=d.resolver.resolveFunction(R,null),F=void 0;if(L&&e.compileFunction(L)){var B=L.signature;assert(1==B.parameterTypes.length&&B.parameterTypes[0]==l.Type.u32&&B.returnType==l.Type.void&&B.thisType==k.type);var D=y.call(L.internalName,[y.local_get(0,f),y.local_get(1,u.NativeType.I32)],u.NativeType.None);F=I.addBlock(k.base?D:y.block(null,[D,y.return()]))}else F=I.addBlock(y.unreachable());I.addBranchForSwitch(x,F,[C]),b.push(F)}else{var P=new Array,w=k.members;if(w)try{for(var U=n(w.values()),M=U.next();!M.done;M=U.next()){var V=M.value;if(V.kind==p.ElementKind.FIELD&&V.parent===k&&V.type.isManaged){var G=V.memoryOffset;assert(G>=0),P.push(y.if(y.local_tee(2,y.load(T,!1,y.local_get(0,f),f,G)),y.call(v.internalName,[y.local_get(2,f),y.local_get(1,u.NativeType.I32)],u.NativeType.None)))}}}catch(e){o={error:e}}finally{try{M&&!M.done&&(c=U.return)&&c.call(U)}finally{if(o)throw o.error}}k.base||P.push(y.return()),F=I.addBlock(s.flatten(y,P,u.NativeType.None)),I.addBranchForSwitch(x,F,[C]),b.push(F)}}}catch(e){t={error:e}}finally{try{S&&!S.done&&(r=N.return)&&r.call(N)}finally{if(t)throw t.error}}try{for(var K=n(E),z=K.next();!z.done;z=K.next()){var Y=i(z.value,2),H=(C=Y[0],(k=Y[1]).base);H&&I.addBranch(b[C],b[H.id])}}catch(e){_={error:e}}finally{try{z&&!z.done&&(h=K.return)&&h.call(K)}finally{if(_)throw _.error}}b.push(I.addBlock(y.unreachable())),I.addBranchForSwitch(x,b[b.length-1],[]),e.compileFunction(v),y.addFunction(a.visit_members,g,[f],I.renderAndDispose(x,2))},t.compileRTTI=function(e){var t,r,s=e.program,o=e.module,c=s.managedClasses,l=c.size,p=4+8*l,_=new Uint8Array(p);y.writeI32(l,_,0);var h=4,d=s.arrayBufferViewInstance,m=d.prototype,f=s.arrayPrototype,T=s.setPrototype,E=s.mapPrototype,v=0;try{for(var b=n(c),I=b.next();!I.done;I=b.next()){var x=i(I.value,2),A=x[0],N=x[1];assert(A==v++);var S=0;if(N.isAcyclic&&(S|=16),N!==d&&N.extends(m)){var O=N.getArrayValueType();S|=1,N.extends(f)&&(S|=2),S|=32*g(O)}else if(N.extends(T)){var C=assert(N.getTypeArgumentsTo(T));assert(1==C.length),S|=4,S|=32*g(C[0])}else N.extends(E)&&(C=assert(N.getTypeArgumentsTo(E)),assert(2==C.length),S|=8,S|=16384*g(C[0]),S|=32*g(C[1]));y.writeI32(S,_,h),h+=4,N.rttiFlags=S;var k=N.base;y.writeI32(k?k.id:0,_,h),h+=4}}catch(e){t={error:e}}finally{try{I&&!I.done&&(r=b.return)&&r.call(b)}finally{if(t)throw t.error}}assert(h==p);var R=s.options.usizeType,L=e.addMemorySegment(_);if(8==R.size){var F=L.offset;o.addGlobal(a.rtti_base,u.NativeType.I64,!1,o.i64(i64_low(F),i64_high(F)))}else o.addGlobal(a.rtti_base,u.NativeType.I32,!1,o.i32(i64_low(L.offset)))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4),i=function(){function e(){this.text=[],this.functionId=0}return e.decompile=function(t){var r=new e;return r.decompile(t),r.finish()},e.prototype.decompile=function(e){throw new Error("not implemented")},e.prototype.decompileFunction=function(e){var t=n.getFunctionName(e)||"$"+this.functionId.toString(10),r=n.getFunctionBody(e);this.push("function "),this.push(t),this.push("(");for(var i=0,s=n.getFunctionParamCount(e);i0&&this.push(", "),this.push("$"),this.push(i.toString(10)),this.push(": "),this.push(a(n.getFunctionParamType(e,i)));this.push("): "),this.push(a(n.getFunctionResultType(e))),this.push(" "),n.getExpressionId(r)!=n.ExpressionId.Block&&this.push("{\n"),this.decompileExpression(r),n.getExpressionId(r)!=n.ExpressionId.Block&&this.push("\n}\n"),++this.functionId},e.prototype.decompileExpression=function(e){var t,r,i,s,o=n.getExpressionId(e),c=n.getExpressionType(e);switch(o){case n.ExpressionId.Block:for(null!=(r=n.getBlockName(e))&&(this.push(r),this.push(": ")),this.push("{\n"),s=n.getBlockChildCount(e),i=0;i("),this.push(n.getLoadOffset(e).toString(10)),this.push(" + "),this.decompileExpression(n.getLoadPtr(e)),void this.push(")");case n.ExpressionId.Store:return this.push("store<"),this.push(a(c)),this.push(">("),this.push(n.getStoreOffset(e).toString(10)),this.push(" + "),this.decompileExpression(n.getStorePtr(e)),this.push(", "),this.decompileExpression(n.getStoreValue(e)),void this.push(")");case n.ExpressionId.Const:switch(c){case n.NativeType.I32:return void this.push(n.getConstValueI32(e).toString(10));case n.NativeType.I64:return void this.push(i64_to_string(i64_new(n.getConstValueI64Low(e),n.getConstValueI64High(e))));case n.NativeType.F32:return void this.push(n.getConstValueF32(e).toString(10));case n.NativeType.F64:return void this.push(n.getConstValueF64(e).toString(10))}break;case n.ExpressionId.Unary:switch(n.getUnaryOp(e)){case n.UnaryOp.ClzI32:return this.push("clz("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.CtzI32:return this.push("ctz("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.PopcntI32:return this.push("popcnt("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.NegF32:case n.UnaryOp.NegF64:return this.push("-"),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.AbsF32:return this.push("abs("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.CeilF32:return this.push("ceil("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.FloorF32:return this.push("floor("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.TruncF32:return this.push("trunc("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.NearestF32:return this.push("nearest("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.SqrtF32:return this.push("sqrt("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.EqzI32:case n.UnaryOp.EqzI64:return this.push("!"),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.ClzI64:return this.push("clz("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.CtzI64:return this.push("ctz("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.PopcntI64:return this.push("popcnt("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.AbsF64:return this.push("abs("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.CeilF64:return this.push("ceil("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.FloorF64:return this.push("floor("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.TruncF64:return this.push("trunc("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.NearestF64:return this.push("nearest("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.SqrtF64:return this.push("sqrt("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.ExtendI32:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.ExtendU32:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.WrapI64:case n.UnaryOp.TruncF32ToI32:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.TruncF32ToI64:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.TruncF32ToU32:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.TruncF32ToU64:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.TruncF64ToI32:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.TruncF64ToI64:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.TruncF64ToU32:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.TruncF64ToU64:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.ReinterpretF32:return this.push("reinterpret("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.ReinterpretF64:return this.push("reinterpret("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.ConvertI32ToF32:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.ConvertI32ToF64:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.ConvertU32ToF32:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.ConvertU32ToF64:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.ConvertI64ToF32:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.ConvertI64ToF64:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.ConvertU64ToF32:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.ConvertU64ToF64:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.PromoteF32:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.DemoteF64:return this.push(""),void this.decompileExpression(n.getUnaryValue(e));case n.UnaryOp.ReinterpretI32:return this.push("reinterpret("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")");case n.UnaryOp.ReinterpretI64:return this.push("reinterpret("),this.decompileExpression(n.getUnaryValue(e)),void this.push(")")}break;case n.ExpressionId.Binary:switch(n.getBinaryOp(e)){case n.BinaryOp.AddI32:case n.BinaryOp.AddI64:case n.BinaryOp.AddF32:case n.BinaryOp.AddF64:return this.decompileExpression(n.getBinaryLeft(e)),this.push(" + "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.SubI32:case n.BinaryOp.SubI64:case n.BinaryOp.SubF32:case n.BinaryOp.SubF64:return this.decompileExpression(n.getBinaryLeft(e)),this.push(" - "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.MulI32:case n.BinaryOp.MulI64:case n.BinaryOp.MulF32:case n.BinaryOp.MulF64:return this.decompileExpression(n.getBinaryLeft(e)),this.push(" * "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.DivI32:case n.BinaryOp.DivI64:case n.BinaryOp.DivF32:case n.BinaryOp.DivF64:return this.decompileExpression(n.getBinaryLeft(e)),this.push(" / "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.DivU32:return this.push("("),this.decompileExpression(n.getBinaryLeft(e)),this.push(" / "),this.decompileExpression(n.getBinaryRight(e)),void this.push(")");case n.BinaryOp.RemI32:case n.BinaryOp.RemI64:return this.decompileExpression(n.getBinaryLeft(e)),this.push(" % "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.RemU32:return this.push("("),this.decompileExpression(n.getBinaryLeft(e)),this.push(" / "),this.decompileExpression(n.getBinaryRight(e)),void this.push(")");case n.BinaryOp.AndI32:case n.BinaryOp.AndI64:return this.decompileExpression(n.getBinaryLeft(e)),this.push(" & "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.OrI32:case n.BinaryOp.OrI64:return this.decompileExpression(n.getBinaryLeft(e)),this.push(" | "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.XorI32:case n.BinaryOp.XorI64:return this.decompileExpression(n.getBinaryLeft(e)),this.push(" ^ "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.ShlI32:case n.BinaryOp.ShlI64:return this.decompileExpression(n.getBinaryLeft(e)),this.push(" << "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.ShrU32:case n.BinaryOp.ShrU64:return this.decompileExpression(n.getBinaryLeft(e)),this.push(" >>> "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.ShrI32:case n.BinaryOp.ShrI64:return this.decompileExpression(n.getBinaryLeft(e)),this.push(" >> "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.RotlI32:return this.push("rotl("),this.decompileExpression(n.getBinaryLeft(e)),this.push(", "),this.decompileExpression(n.getBinaryRight(e)),void this.push(")");case n.BinaryOp.RotrI32:return this.push("rotr("),this.decompileExpression(n.getBinaryLeft(e)),this.push(", "),this.decompileExpression(n.getBinaryRight(e)),void this.push(")");case n.BinaryOp.EqI32:case n.BinaryOp.EqI64:case n.BinaryOp.EqF32:case n.BinaryOp.EqF64:return this.decompileExpression(n.getBinaryLeft(e)),this.push(" == "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.NeI32:case n.BinaryOp.NeI64:case n.BinaryOp.NeF32:case n.BinaryOp.NeF64:return this.decompileExpression(n.getBinaryLeft(e)),this.push(" != "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.LtI32:case n.BinaryOp.LtI64:case n.BinaryOp.LtF32:case n.BinaryOp.LtF64:return this.decompileExpression(n.getBinaryLeft(e)),this.push(" < "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.LtU32:return this.push(""),this.decompileExpression(n.getBinaryLeft(e)),this.push(" < "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.LeI32:case n.BinaryOp.LeI64:case n.BinaryOp.LeF32:case n.BinaryOp.LeF64:return this.decompileExpression(n.getBinaryLeft(e)),this.push(" <= "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.LeU32:return this.push(""),this.decompileExpression(n.getBinaryLeft(e)),this.push(" <= "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.GtI32:case n.BinaryOp.GtI64:case n.BinaryOp.GtF32:case n.BinaryOp.GtF64:return this.decompileExpression(n.getBinaryLeft(e)),this.push(" > "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.GtU32:return this.push(""),this.decompileExpression(n.getBinaryLeft(e)),this.push(" > "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.GeI32:case n.BinaryOp.GeI64:case n.BinaryOp.GeF32:case n.BinaryOp.GeF64:return this.decompileExpression(n.getBinaryLeft(e)),this.push(" >= "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.GeU32:return this.push(""),this.decompileExpression(n.getBinaryLeft(e)),this.push(" >= "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.DivU64:return this.push(""),this.decompileExpression(n.getBinaryLeft(e)),this.push(" / "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.RemU64:return this.push(""),this.decompileExpression(n.getBinaryLeft(e)),this.push(" % "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.RotlI64:return this.push("rotl("),this.decompileExpression(n.getBinaryLeft(e)),this.push(", "),this.decompileExpression(n.getBinaryRight(e)),void this.push(")");case n.BinaryOp.RotrI64:return this.push("rotr("),this.decompileExpression(n.getBinaryLeft(e)),this.push(", "),this.decompileExpression(n.getBinaryRight(e)),void this.push(")");case n.BinaryOp.LtU64:return this.push(""),this.decompileExpression(n.getBinaryLeft(e)),this.push(" < "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.LeU64:return this.push(""),this.decompileExpression(n.getBinaryLeft(e)),this.push(" <= "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.GtU64:return this.push(""),this.decompileExpression(n.getBinaryLeft(e)),this.push(" > "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.GeU64:return this.push(""),this.decompileExpression(n.getBinaryLeft(e)),this.push(" >= "),void this.decompileExpression(n.getBinaryRight(e));case n.BinaryOp.CopysignF32:return this.push("copysign("),this.decompileExpression(n.getBinaryLeft(e)),this.push(", "),this.decompileExpression(n.getBinaryRight(e)),void this.push(")");case n.BinaryOp.MinF32:return this.push("min("),this.decompileExpression(n.getBinaryLeft(e)),this.push(", "),this.decompileExpression(n.getBinaryRight(e)),void this.push(")");case n.BinaryOp.MaxF32:return this.push("max("),this.decompileExpression(n.getBinaryLeft(e)),this.push(", "),this.decompileExpression(n.getBinaryRight(e)),void this.push(")");case n.BinaryOp.CopysignF64:return this.push("copysign("),this.decompileExpression(n.getBinaryLeft(e)),this.push(", "),this.decompileExpression(n.getBinaryRight(e)),void this.push(")");case n.BinaryOp.MinF64:return this.push("min("),this.decompileExpression(n.getBinaryLeft(e)),this.push(", "),this.decompileExpression(n.getBinaryRight(e)),void this.push(")");case n.BinaryOp.MaxF64:return this.push("max("),this.decompileExpression(n.getBinaryLeft(e)),this.push(", "),this.decompileExpression(n.getBinaryRight(e)),void this.push(")")}return;case n.ExpressionId.Select:return this.push("select<"),this.push(a(c)),this.push(">("),this.decompileExpression(n.getSelectThen(e)),this.push(", "),this.decompileExpression(n.getSelectElse(e)),this.push(", "),this.decompileExpression(n.getSelectCondition(e)),void this.push(")");case n.ExpressionId.Drop:return this.decompileExpression(n.getDropValue(e)),void this.push(";\n");case n.ExpressionId.Return:return void((t=n.getReturnValue(e))?(this.push("return "),this.decompileExpression(t),this.push(";\n")):this.push("return;\n"));case n.ExpressionId.Host:switch(n.getHostOp(e)){case n.HostOp.MemorySize:return void this.push("memory.size()");case n.HostOp.MemoryGrow:return this.push("memory.grow("),this.decompileExpression(n.getHostOperand(e,0)),void this.push(")")}break;case n.ExpressionId.Nop:return void this.push(";\n");case n.ExpressionId.Unreachable:return void this.push("unreachable()");case n.ExpressionId.AtomicCmpxchg:case n.ExpressionId.AtomicRMW:case n.ExpressionId.AtomicWait:case n.ExpressionId.AtomicNotify:}throw new Error("not implemented")},e.prototype.push=function(e){this.text.push(e)},e.prototype.finish=function(){var e=this.text.join("");return this.text=[],e},e}();function a(e){switch(e){case n.NativeType.None:return"void";case n.NativeType.I32:return"i32";case n.NativeType.I64:return"i64";case n.NativeType.F32:return"f32";case n.NativeType.F64:return"f64";case n.NativeType.V128:return"v128";case n.NativeType.Unreachable:throw new Error("unreachable type");case n.NativeType.Auto:throw new Error("auto type");default:throw new Error("unexpected type")}}t.Decompiler=i},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__values||function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}},s=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return s};Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),c=r(3),l=r(1),u=function(){function e(e,t){void 0===t&&(t=!1),this.seen=new Map,this.program=e,this.includePrivate}return e.prototype.walk=function(){var e,t;try{for(var r=a(this.program.filesByName.values()),n=r.next();!n.done;n=r.next()){var i=n.value;i.source.isEntry&&this.visitFile(i)}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},e.prototype.visitFile=function(e){var t,r,n,i,o=e.exports;if(o)try{for(var c=a(o),l=c.next();!l.done;l=c.next()){var u=s(l.value,2),p=u[0],_=u[1];this.visitElement(p,_)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(t)throw t.error}}var h=e.exportsStar;if(h)try{for(var d=a(h),y=d.next();!y.done;y=d.next()){var m=y.value;this.visitFile(m)}}catch(e){n={error:e}}finally{try{y&&!y.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}},e.prototype.visitElement=function(e,t){if(!t.is(o.CommonFlags.PRIVATE)||this.includePrivate){var r=this.seen;if(r.has(t))this.visitAlias(e,t,r.get(t));else switch(r.set(t,e),t.kind){case c.ElementKind.GLOBAL:t.is(o.CommonFlags.COMPILED)&&this.visitGlobal(e,t);break;case c.ElementKind.ENUM:t.is(o.CommonFlags.COMPILED)&&this.visitEnum(e,t);break;case c.ElementKind.FUNCTION_PROTOTYPE:this.visitFunctionInstances(e,t);break;case c.ElementKind.CLASS_PROTOTYPE:this.visitClassInstances(e,t);break;case c.ElementKind.FIELD:t.is(o.CommonFlags.COMPILED)&&this.visitField(e,t);break;case c.ElementKind.PROPERTY_PROTOTYPE:this.visitPropertyInstances(e,t);break;case c.ElementKind.PROPERTY:var n=t,i=n.getterInstance;i&&this.visitFunction(e,i);var s=n.setterInstance;s&&this.visitFunction(e,s);break;case c.ElementKind.NAMESPACE:(function e(t){var r,n,i,s,l,u;var p=t.members;if(p)try{for(var _=a(p.values()),h=_.next();!h.done;h=_.next()){var d=h.value;switch(d.kind){case c.ElementKind.FUNCTION_PROTOTYPE:var y=d.instances;if(y)try{for(var m=a(y.values()),f=m.next();!f.done;f=m.next()){var T=f.value;if(T.is(o.CommonFlags.COMPILED))return!0}}catch(e){i={error:e}}finally{try{f&&!f.done&&(s=m.return)&&s.call(m)}finally{if(i)throw i.error}}break;case c.ElementKind.CLASS_PROTOTYPE:var y=d.instances;if(y)try{for(var g=a(y.values()),E=g.next();!E.done;E=g.next()){var T=E.value;if(T.is(o.CommonFlags.COMPILED))return!0}}catch(e){l={error:e}}finally{try{E&&!E.done&&(u=g.return)&&u.call(g)}finally{if(l)throw l.error}}break;default:if(d.is(o.CommonFlags.COMPILED)||e(d))return!0}}}catch(e){r={error:e}}finally{try{h&&!h.done&&(n=_.return)&&n.call(_)}finally{if(r)throw r.error}}return!1})(t)&&this.visitNamespace(e,t);break;case c.ElementKind.TYPEDEFINITION:break;default:assert(!1)}}},e.prototype.visitFunctionInstances=function(e,t){var r,n,i=t.instances;if(i)try{for(var s=a(i.values()),c=s.next();!c.done;c=s.next()){var l=c.value;l.is(o.CommonFlags.COMPILED)&&this.visitFunction(e,l)}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}},e.prototype.visitClassInstances=function(e,t){var r,n,i=t.instances;if(i)try{for(var s=a(i.values()),c=s.next();!c.done;c=s.next()){var l=c.value;l.is(o.CommonFlags.COMPILED)&&this.visitClass(e,l)}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}},e.prototype.visitPropertyInstances=function(e,t){assert(!1)},e}(),p=function(e){function t(t,r){void 0===r&&(r=!1);var n=e.call(this,t,r)||this;return n.sb=[],n.indentLevel=0,n}return i(t,e),t.build=function(e){return new t(e).build()},t.prototype.visitGlobal=function(e,t){var r=this.sb,n=t.is(o.CommonFlags.INLINED);if(l.indent(r,this.indentLevel),n&&r.push("const "),r.push(this.typeToString(t.type)),r.push(" "),r.push(e),n)switch(t.constantValueKind){case 1:r.push(" = "),r.push(i64_to_string(t.constantIntegerValue));break;case 2:r.push(" = "),r.push(t.constantFloatValue.toString());break;default:assert(!1)}r.push(";\n")},t.prototype.visitEnum=function(e,t){var r,n,i,u,p=this.sb;l.indent(p,this.indentLevel++),p.push("interface "),p.push(e),p.push(" {\n");var _=t.members;if(_){try{for(var h=a(_),d=h.next();!d.done;d=h.next()){var y=s(d.value,2),m=y[0];if((E=y[1]).kind==c.ElementKind.ENUMVALUE){var f=E.is(o.CommonFlags.INLINED);l.indent(p,this.indentLevel),f?p.push("const "):p.push("readonly "),p.push("unsigned long "),p.push(m),f&&(p.push(" = "),assert(1==E.constantValueKind),p.push(i64_low(E.constantIntegerValue).toString(10))),p.push(";\n")}}}catch(e){r={error:e}}finally{try{d&&!d.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}try{for(var T=a(_.values()),g=T.next();!g.done;g=T.next()){var E;(E=g.value).kind!=c.ElementKind.ENUMVALUE&&this.visitElement(E.name,E)}}catch(e){i={error:e}}finally{try{g&&!g.done&&(u=T.return)&&u.call(T)}finally{if(i)throw i.error}}}l.indent(p,--this.indentLevel),p.push("}\n")},t.prototype.visitFunction=function(e,t){var r,n,i=this.sb,s=t.signature;l.indent(i,this.indentLevel),i.push(this.typeToString(s.returnType)),i.push(" "),i.push(e),i.push("(");for(var o=s.parameterTypes,c=o.length,u=0;u"),null}for(;e.skip(o.Token.BAR);){if(!e.skip(o.Token.NULL))return r||this.error(c.DiagnosticCode._0_expected,e.range(e.pos),"null"),null;y=!0}n=u.Node.createType(_,d||[],y,e.range(a,e.pos))}for(;e.skip(o.Token.OPENBRACKET);){var T=e.tokenPos;if(!e.skip(o.Token.CLOSEBRACKET))return r||this.error(c.DiagnosticCode._0_expected,e.range(),"]"),null;var g=e.range(T,e.pos);y=!1;if(e.skip(o.Token.BAR)){if(!e.skip(o.Token.NULL))return r||this.error(c.DiagnosticCode._0_expected,e.range(),"null"),null;y=!0}if(n=u.Node.createType(u.Node.createSimpleTypeName("Array",g),[n],y,e.range(a,e.pos)),y)break}return n},t.prototype.tryParseSignature=function(e){var t,r=e.mark(),n=e.tokenPos,i=null,a=null,s=!1;if(e.skip(o.Token.CLOSEPAREN))s=!0,e.discard(r),i=[];else{s=!1;do{var l=u.ParameterKind.DEFAULT;if(e.skip(o.Token.DOT_DOT_DOT)&&(s=!0,e.discard(r),l=u.ParameterKind.REST),e.skip(o.Token.THIS)){if(!e.skip(o.Token.COLON))return e.reset(r),this.tryParseSignatureIsSignature=!1,null;s=!0,e.discard(r);var p=this.parseType(e,!1);if(!p)return null;if(p.kind!=u.NodeKind.TYPE)return this.error(c.DiagnosticCode.Operation_not_supported,p.range),this.tryParseSignatureIsSignature=!0,null;a=p}else{if(!e.skipIdentifier())return s?this.error(c.DiagnosticCode.Identifier_expected,e.range()):e.reset(r),this.tryParseSignatureIsSignature=s,null;var _=u.Node.createIdentifierExpression(e.readIdentifier(),e.range(e.tokenPos,e.pos));if(e.skip(o.Token.QUESTION)&&(s=!0,e.discard(r),l==u.ParameterKind.REST?this.error(c.DiagnosticCode.A_rest_parameter_cannot_be_optional,e.range()):l=u.ParameterKind.OPTIONAL),e.skip(o.Token.COLON)){s=!0,e.discard(r);var h=this.parseType(e);if(!h)return this.tryParseSignatureIsSignature=s,null;var d=new u.ParameterNode;d.parameterKind=l,d.name=_,d.type=h,i?i.push(d):i=[d]}else s&&this.error(c.DiagnosticCode.Type_expected,e.range())}}while(e.skip(o.Token.COMMA));if(!e.skip(o.Token.CLOSEPAREN))return s?this.error(c.DiagnosticCode._0_expected,e.range(),")"):e.reset(r),this.tryParseSignatureIsSignature=s,null}return e.skip(o.Token.EQUALS_GREATERTHAN)?(s=!0,e.discard(r),(t=this.parseType(e))?(this.tryParseSignatureIsSignature=!0,u.Node.createSignature(i||[],t,a,!1,e.range(n,e.pos))):(this.tryParseSignatureIsSignature=s,null)):(s?this.error(c.DiagnosticCode._0_expected,e.range(),"=>"):e.reset(r),this.tryParseSignatureIsSignature=s,null)},t.prototype.parseDecorator=function(e){var t=e.tokenPos;if(e.skipIdentifier()){for(var r=e.readIdentifier(),n=u.Node.createIdentifierExpression(r,e.range(t,e.pos));e.skip(o.Token.DOT);){if(!e.skipIdentifier())return this.error(c.DiagnosticCode.Identifier_expected,e.range()),null;r=e.readIdentifier(),n=u.Node.createPropertyAccessExpression(n,u.Node.createIdentifierExpression(r,e.range()),e.range(t,e.pos))}var i=void 0;if(!e.skip(o.Token.OPENPAREN))return u.Node.createDecorator(n,null,e.range(t,e.pos));if(i=this.parseArguments(e))return u.Node.createDecorator(n,i,e.range(t,e.pos))}else this.error(c.DiagnosticCode.Identifier_expected,e.range());return null},t.prototype.parseVariable=function(e,t,r,n){var i=new Array;do{var a=this.parseVariableDeclaration(e,t,r);if(!a)return null;i.push(a)}while(e.skip(o.Token.COMMA));var s=u.Node.createVariableStatement(i,r,e.range(n,e.pos));return e.skip(o.Token.SEMICOLON),s},t.prototype.parseVariableDeclaration=function(e,t,r){if(!e.skipIdentifier())return this.error(c.DiagnosticCode.Identifier_expected,e.range()),null;var n=u.Node.createIdentifierExpression(e.readIdentifier(),e.range()),i=t;e.skip(o.Token.EXCLAMATION)&&(i|=a.CommonFlags.DEFINITE_ASSIGNMENT);var s=null;e.skip(o.Token.COLON)&&(s=this.parseType(e));var l=null;if(e.skip(o.Token.EQUALS)){if(i&a.CommonFlags.AMBIENT&&this.error(c.DiagnosticCode.Initializers_are_not_allowed_in_ambient_contexts,e.range()),!(l=this.parseExpression(e,2)))return null}else i&a.CommonFlags.CONST?i&a.CommonFlags.AMBIENT||this.error(c.DiagnosticCode._const_declarations_must_be_initialized,n.range):s||this.error(c.DiagnosticCode.Type_expected,e.range(e.pos));var p=o.Range.join(n.range,e.range());return i&a.CommonFlags.DEFINITE_ASSIGNMENT&&l&&this.error(c.DiagnosticCode.A_definite_assignment_assertion_is_not_permitted_in_this_context,p),u.Node.createVariableDeclaration(n,s,l,r,i,p)},t.prototype.parseEnum=function(e,t,r,n){if(e.next()!=o.Token.IDENTIFIER)return this.error(c.DiagnosticCode.Identifier_expected,e.range()),null;var i=u.Node.createIdentifierExpression(e.readIdentifier(),e.range());if(e.next()!=o.Token.OPENBRACE)return this.error(c.DiagnosticCode._0_expected,e.range(),"{"),null;for(var s=new Array;!e.skip(o.Token.CLOSEBRACE);){var l=this.parseEnumValue(e,a.CommonFlags.NONE);if(!l)return null;if(s.push(l),!e.skip(o.Token.COMMA)){if(e.skip(o.Token.CLOSEBRACE))break;return this.error(c.DiagnosticCode._0_expected,e.range(),"}"),null}}var p=u.Node.createEnumDeclaration(i,s,r,t,e.range(n,e.pos));return e.skip(o.Token.SEMICOLON),p},t.prototype.parseEnumValue=function(e,t){if(!e.skipIdentifier())return this.error(c.DiagnosticCode.Identifier_expected,e.range()),null;var r=u.Node.createIdentifierExpression(e.readIdentifier(),e.range()),n=null;return e.skip(o.Token.EQUALS)&&!(n=this.parseExpression(e,2))?null:u.Node.createEnumValueDeclaration(r,n,t,o.Range.join(r.range,e.range()))},t.prototype.parseReturn=function(e){var t=null;if(e.peek(!0)!=o.Token.SEMICOLON&&e.nextToken!=o.Token.CLOSEBRACE&&!e.nextTokenOnNewLine&&!(t=this.parseExpression(e)))return null;var r=u.Node.createReturnStatement(t,e.range());return e.skip(o.Token.SEMICOLON),r},t.prototype.parseTypeParameters=function(e){for(var t=null,r=!1;!e.skip(o.Token.GREATERTHAN);){var n=this.parseTypeParameter(e);if(!n)return null;if(null!==n.defaultType?r=!0:r&&(this.error(c.DiagnosticCode.Required_type_parameters_may_not_follow_optional_type_parameters,n.range),n.defaultType=null),t?t.push(n):t=[n],!e.skip(o.Token.COMMA)){if(e.skip(o.Token.GREATERTHAN))break;return this.error(c.DiagnosticCode._0_expected,e.range(),">"),null}}return t&&t.length||this.error(c.DiagnosticCode.Type_parameter_list_cannot_be_empty,e.range()),t},t.prototype.parseTypeParameter=function(e){if(e.next()==o.Token.IDENTIFIER){var t=u.Node.createIdentifierExpression(e.readIdentifier(),e.range()),r=null;if(e.skip(o.Token.EXTENDS)){if(!(i=this.parseType(e)))return null;if(i.kind!=u.NodeKind.TYPE)return this.error(c.DiagnosticCode.Operation_not_supported,i.range),null;r=i}var n=null;if(e.skip(o.Token.EQUALS)){var i;if(!(i=this.parseType(e)))return null;if(i.kind!=u.NodeKind.TYPE)return this.error(c.DiagnosticCode.Operation_not_supported,i.range),null;n=i}return u.Node.createTypeParameter(t,r,n,o.Range.join(t.range,e.range()))}return this.error(c.DiagnosticCode.Identifier_expected,e.range()),null},t.prototype.parseParameters=function(e,t){void 0===t&&(t=!1);var r=new Array,n=null,i=!1,a=!1,s=null;if(this.parseParametersThis=null,e.skip(o.Token.THIS)){if(!e.skip(o.Token.COLON))return this.error(c.DiagnosticCode._0_expected,e.range(),":"),null;if(!(s=this.parseType(e)))return null;if(s.kind==u.NodeKind.TYPE?this.parseParametersThis=s:this.error(c.DiagnosticCode.Operation_not_supported,s.range),!e.skip(o.Token.COMMA))return e.skip(o.Token.CLOSEPAREN)?r:(this.error(c.DiagnosticCode._0_expected,e.range(),")"),null)}for(;!e.skip(o.Token.CLOSEPAREN);){var l=this.parseParameter(e,t);if(!l)return null;switch(n&&!a&&(this.error(c.DiagnosticCode.A_rest_parameter_must_be_last_in_a_parameter_list,n.name.range),a=!0),l.parameterKind){default:i&&this.error(c.DiagnosticCode.A_required_parameter_cannot_follow_an_optional_parameter,l.name.range);break;case u.ParameterKind.OPTIONAL:i=!0;break;case u.ParameterKind.REST:n=l}if(r.push(l),!e.skip(o.Token.COMMA)){if(e.skip(o.Token.CLOSEPAREN))break;return this.error(c.DiagnosticCode._0_expected,e.range(),")"),null}}return r},t.prototype.parseParameter=function(e,t){void 0===t&&(t=!1);var r=!1,n=!1,i=null,s=a.CommonFlags.NONE;if(t&&(e.skip(o.Token.PUBLIC)?(i=e.range(),s|=a.CommonFlags.PUBLIC):e.skip(o.Token.PROTECTED)?(i=e.range(),s|=a.CommonFlags.PROTECTED):e.skip(o.Token.PRIVATE)&&(i=e.range(),s|=a.CommonFlags.PRIVATE),e.peek()==o.Token.READONLY)){var l=e.mark();e.next(),e.peek()!=o.Token.COLON?(e.discard(l),i||(i=e.range()),s|=a.CommonFlags.READONLY):e.reset(l)}if(e.skip(o.Token.DOT_DOT_DOT)&&(s?this.error(c.DiagnosticCode.A_parameter_property_cannot_be_declared_using_a_rest_parameter,e.range()):i=e.range(),r=!0),e.skipIdentifier()){r||(i=e.range());var p=u.Node.createIdentifierExpression(e.readIdentifier(),e.range()),_=null;if((n=e.skip(o.Token.QUESTION))&&r&&this.error(c.DiagnosticCode.A_rest_parameter_cannot_be_optional,p.range),e.skip(o.Token.COLON)){if(!(_=this.parseType(e)))return null}else _=u.Node.createOmittedType(e.range(e.pos));var h=null;if(e.skip(o.Token.EQUALS)&&(r&&this.error(c.DiagnosticCode.A_rest_parameter_cannot_have_an_initializer,p.range),n?this.error(c.DiagnosticCode.Parameter_cannot_have_question_mark_and_initializer,p.range):n=!0,!(h=this.parseExpression(e,2))))return null;var d=u.Node.createParameter(p,_,h,r?u.ParameterKind.REST:n?u.ParameterKind.OPTIONAL:u.ParameterKind.DEFAULT,o.Range.join(i,e.range()));return d.flags|=s,d}return this.error(c.DiagnosticCode.Identifier_expected,e.range()),null},t.prototype.parseFunction=function(e,t,r,n){if(!e.skipIdentifier())return this.error(c.DiagnosticCode.Identifier_expected,e.range(e.pos)),null;var i=u.Node.createIdentifierExpression(e.readIdentifier(),e.range()),s=-1,l=null;if(e.skip(o.Token.LESSTHAN)){if(s=e.tokenPos,!(l=this.parseTypeParameters(e)))return null;t|=a.CommonFlags.GENERIC}if(!e.skip(o.Token.OPENPAREN))return this.error(c.DiagnosticCode._0_expected,e.range(e.pos),"("),null;s<0&&(s=e.tokenPos);var p=this.parseParameters(e);if(!p)return null;var _=this.parseParametersThis,h=0!=(t&a.CommonFlags.SET);h&&(1!=p.length&&this.error(c.DiagnosticCode.A_set_accessor_must_have_exactly_one_parameter,i.range),p.length&&p[0].initializer&&this.error(c.DiagnosticCode.A_set_accessor_parameter_cannot_have_an_initializer,i.range)),t&a.CommonFlags.GET&&p.length&&this.error(c.DiagnosticCode.A_get_accessor_cannot_have_parameters,i.range);var d=null;if(e.skip(o.Token.COLON)&&!(d=this.parseType(e,!0,h)))return null;d||(d=u.Node.createOmittedType(e.range(e.pos)),h||this.error(c.DiagnosticCode.Type_expected,d.range));var y=u.Node.createSignature(p,d,_,!1,e.range(s,e.pos)),m=null;if(e.skip(o.Token.OPENBRACE)){if(t&a.CommonFlags.AMBIENT&&this.error(c.DiagnosticCode.An_implementation_cannot_be_declared_in_ambient_contexts,e.range()),!(m=this.parseBlockStatement(e,!1)))return null}else t&a.CommonFlags.AMBIENT||this.error(c.DiagnosticCode.Function_implementation_is_missing_or_not_immediately_following_the_declaration,e.range(e.pos));var f=u.Node.createFunctionDeclaration(i,l,y,m,r,t,0,e.range(n,e.pos));return e.skip(o.Token.SEMICOLON),f},t.prototype.parseFunctionExpression=function(e){var t,r=e.tokenPos,n=0;if(e.token==o.Token.FUNCTION){if(t=e.skipIdentifier()?u.Node.createIdentifierExpression(e.readIdentifier(),e.range()):u.Node.createEmptyIdentifierExpression(e.range(e.pos)),!e.skip(o.Token.OPENPAREN))return this.error(c.DiagnosticCode._0_expected,e.range(e.pos),"("),null}else n=1,assert(e.token==o.Token.OPENPAREN),t=u.Node.createEmptyIdentifierExpression(e.range(e.tokenPos));var i=e.pos,a=this.parseParameters(e);return a?this.parseFunctionExpressionCommon(e,t,a,n,r,i):null},t.prototype.parseFunctionExpressionCommon=function(e,t,r,n,i,s){void 0===i&&(i=-1),void 0===s&&(s=-1),i<0&&(i=t.range.start),s<0&&(s=i);var l=null;if(2!=n&&e.skip(o.Token.COLON)){if(!(l=this.parseType(e)))return null}else l=u.Node.createOmittedType(e.range(e.pos));if(n&&!e.skip(o.Token.EQUALS_GREATERTHAN))return this.error(c.DiagnosticCode._0_expected,e.range(e.pos),"=>"),null;var p=u.Node.createSignature(r,l,null,!1,e.range(s,e.pos)),_=null;if(n)if(e.skip(o.Token.OPENBRACE))_=this.parseBlockStatement(e,!1);else{var h=this.parseExpression(e,2);h&&(_=u.Node.createExpressionStatement(h))}else{if(!e.skip(o.Token.OPENBRACE))return this.error(c.DiagnosticCode._0_expected,e.range(e.pos),"{"),null;_=this.parseBlockStatement(e,!1)}if(!_)return null;var d=u.Node.createFunctionDeclaration(t,null,p,_,null,a.CommonFlags.NONE,n,e.range(i,e.pos));return u.Node.createFunctionExpression(d)},t.prototype.parseClassOrInterface=function(e,t,r,n){var i=e.token==o.Token.INTERFACE;if(!e.skipIdentifier())return this.error(c.DiagnosticCode.Identifier_expected,e.range()),null;var s=u.Node.createIdentifierExpression(e.readIdentifier(),e.range()),l=null;if(e.skip(o.Token.LESSTHAN)){if(!(l=this.parseTypeParameters(e)))return null;t|=a.CommonFlags.GENERIC}var p=null;if(e.skip(o.Token.EXTENDS)){var _=this.parseType(e);if(!_)return null;if(_.kind!=u.NodeKind.TYPE)return this.error(c.DiagnosticCode.Operation_not_supported,_.range),null;p=_}var h=null;if(e.skip(o.Token.IMPLEMENTS)){i&&this.error(c.DiagnosticCode.Interface_declaration_cannot_have_implements_clause,e.range());do{var d=this.parseType(e);if(!d)return null;i||(h?h.push(d):h=[d])}while(e.skip(o.Token.COMMA))}if(!e.skip(o.Token.OPENBRACE))return this.error(c.DiagnosticCode._0_expected,e.range(),"{"),null;var y,m=new Array;if(i?(assert(!h),y=u.Node.createInterfaceDeclaration(s,l,p,m,r,t,e.range(n,e.pos))):y=u.Node.createClassDeclaration(s,l,p,h,m,r,t,e.range(n,e.pos)),!e.skip(o.Token.CLOSEBRACE))do{var f=this.parseClassMember(e,y);if(f)m.push(f);else if(this.skipStatement(e),e.skip(o.Token.ENDOFFILE))return this.error(c.DiagnosticCode._0_expected,e.range(),"}"),null}while(!e.skip(o.Token.CLOSEBRACE));return y.range.end=e.pos,y},t.prototype.parseClassExpression=function(e){var t,r=e.tokenPos;if(t=e.skipIdentifier()?u.Node.createIdentifierExpression(e.readIdentifier(),e.range()):u.Node.createEmptyIdentifierExpression(e.range(e.pos)),!e.skip(o.Token.OPENBRACE))return this.error(c.DiagnosticCode._0_expected,e.range(e.pos),"{"),null;var n=new Array,i=u.Node.createClassDeclaration(t,[],null,null,n,null,a.CommonFlags.NONE,e.range(r,e.pos));if(!e.skip(o.Token.CLOSEBRACE))do{var s=this.parseClassMember(e,i);if(s)n.push(s);else if(this.skipStatement(e),e.skip(o.Token.ENDOFFILE))return this.error(c.DiagnosticCode._0_expected,e.range(),"}"),null}while(!e.skip(o.Token.CLOSEBRACE));return i.range.end=e.pos,u.Node.createClassExpression(i)},t.prototype.parseClassMember=function(e,t){var r=e.pos,n=t.kind==u.NodeKind.INTERFACEDECLARATION,i=null;if(e.skip(o.Token.AT)){do{var s=this.parseDecorator(e);if(!s)break;i?i.push(s):i=[s]}while(e.skip(o.Token.AT));i&&n&&this.error(c.DiagnosticCode.Decorators_are_not_valid_here,o.Range.join(i[0].range,i[i.length-1].range))}var l=t.flags&a.CommonFlags.AMBIENT;n&&(l|=a.CommonFlags.VIRTUAL);var p=0,_=0;e.skip(o.Token.PUBLIC)?(n&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(),"public"),l|=a.CommonFlags.PUBLIC,p=e.tokenPos,_=e.pos):e.skip(o.Token.PRIVATE)?(n&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(),"private"),l|=a.CommonFlags.PRIVATE,p=e.tokenPos,_=e.pos):e.skip(o.Token.PROTECTED)&&(n&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(),"protected"),l|=a.CommonFlags.PROTECTED,p=e.tokenPos,_=e.pos);var h=0,d=0,y=0,m=0;e.skip(o.Token.STATIC)?(n&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(),"static"),l|=a.CommonFlags.STATIC,h=e.tokenPos,d=e.pos):(l|=a.CommonFlags.INSTANCE,e.skip(o.Token.ABSTRACT)&&(n&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(),"abstract"),l|=a.CommonFlags.ABSTRACT,y=e.tokenPos,m=e.pos),t.flags&a.CommonFlags.GENERIC&&(l|=a.CommonFlags.GENERIC_CONTEXT));var f=0,T=0;e.skip(o.Token.READONLY)&&(l|=a.CommonFlags.READONLY,f=e.tokenPos,T=e.pos);var g,E=e.mark(),v=!1,b=!1,I=!1,x=0,A=0;if(n||(e.skip(o.Token.GET)?e.peek(!0,o.IdentifierHandling.PREFER)!=o.Token.IDENTIFIER||e.nextTokenOnNewLine?e.reset(E):(l|=a.CommonFlags.GET,b=!0,x=e.tokenPos,A=e.pos,l&a.CommonFlags.READONLY&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(f,T),"readonly")):e.skip(o.Token.SET)?e.peek(!0,o.IdentifierHandling.PREFER)!=o.Token.IDENTIFIER||e.nextTokenOnNewLine?e.reset(E):(l|=a.CommonFlags.SET,I=!0,x=e.tokenPos,A=e.pos,l&a.CommonFlags.READONLY&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(f,T),"readonly")):e.skip(o.Token.CONSTRUCTOR)&&(v=!0,(l|=a.CommonFlags.CONSTRUCTOR)&a.CommonFlags.STATIC&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(h,d),"static"),l&a.CommonFlags.ABSTRACT&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(y,m),"abstract"),l&a.CommonFlags.READONLY&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(f,T),"readonly"))),v)g=u.Node.createConstructorExpression(e.range());else{if(!b&&!I&&e.skip(o.Token.OPENBRACKET)){l&a.CommonFlags.PUBLIC?this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(p,_),"public"):l&a.CommonFlags.PROTECTED?this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(p,_),"protected"):l&a.CommonFlags.PRIVATE&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(p,_),"protected"),l&a.CommonFlags.STATIC&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(h,d),"static"),l&a.CommonFlags.ABSTRACT&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(y,m),"abstract"),l&a.CommonFlags.READONLY&&this.error(c.DiagnosticCode._0_modifier_cannot_be_used_here,e.range(f,T),"readonly");var N=this.parseIndexSignatureDeclaration(e,i);return N?(e.skip(o.Token.SEMICOLON),N):null}if(!e.skipIdentifier())return this.error(c.DiagnosticCode.Identifier_expected,e.range()),null;g=u.Node.createIdentifierExpression(e.readIdentifier(),e.range())}var S=null;if(e.skip(o.Token.LESSTHAN)){var O=e.tokenPos;if(!(S=this.parseTypeParameters(e)))return null;v?this.error(c.DiagnosticCode.Type_parameters_cannot_appear_on_a_constructor_declaration,e.range(O,e.pos)):b||I?this.error(c.DiagnosticCode.An_accessor_cannot_have_type_parameters,e.range(O,e.pos)):l|=a.CommonFlags.GENERIC}if(e.skip(o.Token.OPENPAREN)){var C=e.tokenPos,k=this.parseParameters(e,v);if(!k)return null;var R=this.parseParametersThis;if(v)for(var L=0,F=k.length;L"),null):null;case o.Token.IDENTIFIER:var T=u.Node.createIdentifierExpression(e.readIdentifier(),e.range(r,e.pos));return e.peek(!0)!=o.Token.EQUALS_GREATERTHAN||e.nextTokenOnNewLine?T:this.parseFunctionExpressionCommon(e,u.Node.createEmptyIdentifierExpression(e.range(r)),[u.Node.createParameter(T,u.Node.createOmittedType(T.range.atEnd),null,u.ParameterKind.DEFAULT,T.range)],2,r);case o.Token.THIS:return u.Node.createThisExpression(e.range(r,e.pos));case o.Token.CONSTRUCTOR:return u.Node.createConstructorExpression(e.range(r,e.pos));case o.Token.SUPER:return e.peek()!=o.Token.DOT&&e.nextToken!=o.Token.OPENPAREN&&this.error(c.DiagnosticCode._super_must_be_followed_by_an_argument_list_or_member_access,e.range()),u.Node.createSuperExpression(e.range(r,e.pos));case o.Token.STRINGLITERAL:return u.Node.createStringLiteralExpression(e.readString(),e.range(r,e.pos));case o.Token.INTEGERLITERAL:return u.Node.createIntegerLiteralExpression(e.readInteger(),e.range(r,e.pos));case o.Token.FLOATLITERAL:return u.Node.createFloatLiteralExpression(e.readFloat(),e.range(r,e.pos));case o.Token.SLASH:var g=e.readRegexpPattern();return e.skip(o.Token.SLASH)?u.Node.createRegexpLiteralExpression(g,e.readRegexpFlags(),e.range(r,e.pos)):(this.error(c.DiagnosticCode._0_expected,e.range(),"/"),null);case o.Token.FUNCTION:return this.parseFunctionExpression(e);case o.Token.CLASS:return this.parseClassExpression(e);default:return t==o.Token.ENDOFFILE?this.error(c.DiagnosticCode.Unexpected_end_of_text,e.range(r)):this.error(c.DiagnosticCode.Expression_expected,e.range()),null}},t.prototype.tryParseTypeArgumentsBeforeArguments=function(e){var t=e.mark();if(!e.skip(o.Token.LESSTHAN))return null;var r=null;do{if(e.peek()===o.Token.GREATERTHAN)break;var n=this.parseType(e,!0,!0);if(!n)return e.reset(t),null;r?r.push(n):r=[n]}while(e.skip(o.Token.COMMA));return e.skip(o.Token.GREATERTHAN)&&e.skip(o.Token.OPENPAREN)?r:(e.reset(t),null)},t.prototype.parseArguments=function(e){for(var t=new Array;!e.skip(o.Token.CLOSEPAREN);){var r=this.parseExpression(e,2);if(!r)return null;if(t.push(r),!e.skip(o.Token.COMMA)){if(e.skip(o.Token.CLOSEPAREN))break;return this.error(c.DiagnosticCode._0_expected,e.range(),")"),null}}return t},t.prototype.parseExpression=function(e,t){void 0===t&&(t=1),assert(0!=t);var r=this.parseExpressionStart(e);if(!r)return null;for(var n,i,a=(r=this.maybeParseCallExpression(e,r)).range.start,s=null;(i=_(n=e.peek()))>=t;){switch(e.next(),n){case o.Token.AS:var l=this.parseType(e);if(!l)return null;r=u.Node.createAssertionExpression(u.AssertionKind.AS,r,l,e.range(a,e.pos));break;case o.Token.EXCLAMATION:r=u.Node.createAssertionExpression(u.AssertionKind.NONNULL,r,null,e.range(a,e.pos));break;case o.Token.INSTANCEOF:var p=this.parseType(e);if(!p)return null;r=u.Node.createInstanceOfExpression(r,p,e.range(a,e.pos));break;case o.Token.OPENBRACKET:if(!(s=this.parseExpression(e)))return null;if(!e.skip(o.Token.CLOSEBRACKET))return this.error(c.DiagnosticCode._0_expected,e.range(),"]"),null;r=u.Node.createElementAccessExpression(r,s,e.range(a,e.pos));break;case o.Token.PLUS_PLUS:case o.Token.MINUS_MINUS:r.kind!=u.NodeKind.IDENTIFIER&&r.kind!=u.NodeKind.ELEMENTACCESS&&r.kind!=u.NodeKind.PROPERTYACCESS&&this.error(c.DiagnosticCode.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access,r.range),r=u.Node.createUnaryPostfixExpression(n,r,e.range(a,e.pos));break;case o.Token.QUESTION:var d=this.parseExpression(e);if(!d)return null;if(!e.skip(o.Token.COLON))return this.error(c.DiagnosticCode._0_expected,e.range(),":"),null;var y=this.parseExpression(e,t>1?2:1);if(!y)return null;r=u.Node.createTernaryExpression(r,d,y,e.range(a,e.pos));break;case o.Token.COMMA:var m=[r];do{if(!(r=this.parseExpression(e,2)))return null;m.push(r)}while(e.skip(o.Token.COMMA));r=u.Node.createCommaExpression(m,e.range(a,e.pos));break;default:if(n==o.Token.DOT){if(e.skipIdentifier())s=u.Node.createIdentifierExpression(e.readIdentifier(),e.range());else if(!(s=this.parseExpression(e,h(n)?i:i+1)))return null;if(s.kind==u.NodeKind.IDENTIFIER)r=u.Node.createPropertyAccessExpression(r,s,e.range(a,e.pos));else{if(s.kind!=u.NodeKind.CALL)return this.error(c.DiagnosticCode.Identifier_expected,s.range),null;if(!(r=this.joinPropertyCall(e,a,r,s)))return null}}else{if(!(s=this.parseExpression(e,h(n)?i:i+1)))return null;r=u.Node.createBinaryExpression(n,r,s,e.range(a,e.pos))}}r=this.maybeParseCallExpression(e,r)}return r},t.prototype.joinPropertyCall=function(e,t,r,n){var i=n.expression;switch(i.kind){case u.NodeKind.IDENTIFIER:n.expression=u.Node.createPropertyAccessExpression(r,i,e.range(t,e.pos));break;case u.NodeKind.CALL:var a=this.joinPropertyCall(e,t,r,i);if(!a)return null;n.expression=a,n.range=e.range(t,e.pos);break;default:return this.error(c.DiagnosticCode.Identifier_expected,n.range),null}return n},t.prototype.maybeParseCallExpression=function(e,t){if(u.nodeIsCallable(t.kind))for(var r=null;e.skip(o.Token.OPENPAREN)||u.nodeIsGenericCallable(t.kind)&&null!==(r=this.tryParseTypeArgumentsBeforeArguments(e));){var n=this.parseArguments(e);if(!n)break;t=u.Node.createCallExpression(t,r,n,e.range(t.range.start,e.pos))}return t},t.prototype.skipStatement=function(e){for(e.peek(!0),e.nextTokenOnNewLine&&e.next();;){var t=e.peek(!0);if(t==o.Token.ENDOFFILE||t==o.Token.SEMICOLON){e.next();break}if(e.nextTokenOnNewLine)break;switch(e.next()){case o.Token.IDENTIFIER:e.readIdentifier();break;case o.Token.STRINGLITERAL:e.readString();break;case o.Token.INTEGERLITERAL:e.readInteger();break;case o.Token.FLOATLITERAL:e.readFloat();break;case o.Token.OPENBRACE:this.skipBlock(e)}}},t.prototype.skipBlock=function(e){var t=1,r=!0;do{switch(e.next()){case o.Token.ENDOFFILE:this.error(c.DiagnosticCode._0_expected,e.range(),"}"),r=!1;break;case o.Token.OPENBRACE:++t;break;case o.Token.CLOSEBRACE:--t||(r=!1);break;case o.Token.IDENTIFIER:e.readIdentifier();break;case o.Token.STRINGLITERAL:e.readString();break;case o.Token.INTEGERLITERAL:e.readInteger();break;case o.Token.FLOATLITERAL:e.readFloat()}}while(r)},t}(c.DiagnosticEmitter);function _(e){switch(e){case o.Token.COMMA:return 1;case o.Token.EQUALS:case o.Token.PLUS_EQUALS:case o.Token.MINUS_EQUALS:case o.Token.ASTERISK_ASTERISK_EQUALS:case o.Token.ASTERISK_EQUALS:case o.Token.SLASH_EQUALS:case o.Token.PERCENT_EQUALS:case o.Token.LESSTHAN_LESSTHAN_EQUALS:case o.Token.GREATERTHAN_GREATERTHAN_EQUALS:case o.Token.GREATERTHAN_GREATERTHAN_GREATERTHAN_EQUALS:case o.Token.AMPERSAND_EQUALS:case o.Token.CARET_EQUALS:case o.Token.BAR_EQUALS:return 4;case o.Token.QUESTION:return 5;case o.Token.BAR_BAR:return 6;case o.Token.AMPERSAND_AMPERSAND:return 7;case o.Token.BAR:return 8;case o.Token.CARET:return 9;case o.Token.AMPERSAND:return 10;case o.Token.EQUALS_EQUALS:case o.Token.EXCLAMATION_EQUALS:case o.Token.EQUALS_EQUALS_EQUALS:case o.Token.EXCLAMATION_EQUALS_EQUALS:return 11;case o.Token.AS:case o.Token.IN:case o.Token.INSTANCEOF:case o.Token.LESSTHAN:case o.Token.GREATERTHAN:case o.Token.LESSTHAN_EQUALS:case o.Token.GREATERTHAN_EQUALS:return 12;case o.Token.LESSTHAN_LESSTHAN:case o.Token.GREATERTHAN_GREATERTHAN:case o.Token.GREATERTHAN_GREATERTHAN_GREATERTHAN:return 13;case o.Token.PLUS:case o.Token.MINUS:return 14;case o.Token.ASTERISK:case o.Token.SLASH:case o.Token.PERCENT:return 15;case o.Token.ASTERISK_ASTERISK:return 16;case o.Token.PLUS_PLUS:case o.Token.MINUS_MINUS:return 18;case o.Token.DOT:case o.Token.NEW:case o.Token.OPENBRACKET:case o.Token.EXCLAMATION:return 20}return 0}function h(e){switch(e){case o.Token.EQUALS:case o.Token.PLUS_EQUALS:case o.Token.MINUS_EQUALS:case o.Token.ASTERISK_ASTERISK_EQUALS:case o.Token.ASTERISK_EQUALS:case o.Token.SLASH_EQUALS:case o.Token.PERCENT_EQUALS:case o.Token.LESSTHAN_LESSTHAN_EQUALS:case o.Token.GREATERTHAN_GREATERTHAN_EQUALS:case o.Token.GREATERTHAN_GREATERTHAN_GREATERTHAN_EQUALS:case o.Token.AMPERSAND_EQUALS:case o.Token.CARET_EQUALS:case o.Token.BAR_EQUALS:case o.Token.QUESTION:case o.Token.ASTERISK_ASTERISK:return!0;default:return!1}}t.Parser=p,function(e){e[e.NONE=0]="NONE",e[e.COMMA=1]="COMMA",e[e.SPREAD=2]="SPREAD",e[e.YIELD=3]="YIELD",e[e.ASSIGNMENT=4]="ASSIGNMENT",e[e.CONDITIONAL=5]="CONDITIONAL",e[e.LOGICAL_OR=6]="LOGICAL_OR",e[e.LOGICAL_AND=7]="LOGICAL_AND",e[e.BITWISE_OR=8]="BITWISE_OR",e[e.BITWISE_XOR=9]="BITWISE_XOR",e[e.BITWISE_AND=10]="BITWISE_AND",e[e.EQUALITY=11]="EQUALITY",e[e.RELATIONAL=12]="RELATIONAL",e[e.SHIFT=13]="SHIFT",e[e.ADDITIVE=14]="ADDITIVE",e[e.MULTIPLICATIVE=15]="MULTIPLICATIVE",e[e.EXPONENTIATED=16]="EXPONENTIATED",e[e.UNARY_PREFIX=17]="UNARY_PREFIX",e[e.UNARY_POSTFIX=18]="UNARY_POSTFIX",e[e.CALL=19]="CALL",e[e.MEMBERACCESS=20]="MEMBERACCESS",e[e.GROUPING=21]="GROUPING"}(t.Precedence||(t.Precedence={}))},function(e,t,r){r(18),e.exports=r(28)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(19),r(21),r(22),r(23);var n=r(4);n.Module.prototype.toText=function(){return binaryen.wrapModule(this.ref).emitStackIR()},n.Module.prototype.toAsmjs=function(){return binaryen.wrapModule(this.ref).emitAsmjs()}},function(e,t,r){(function(e){const t=e.Binaryen||r(20);for(var n in e.binaryen=t,t)(n.startsWith("_Binaryen")||n.startsWith("_Relooper"))&&(e[n]=t[n]);e.__memory_allocate=t._malloc,e.__memory_free=t._free,e.__memory_copy=t._memmove,e.__store=function(e,r){t.HEAPU8[e]=r},e.__load=function(e){return t.HEAPU8[e]}}).call(this,r(8))},function(t,r){t.exports=e},function(e,t,r){(function(e){var t="undefined"!=typeof window&&window||void 0!==e&&e||self;t.ASC_TARGET=2,t.ASC_NO_ASSERT=!1,t.ASC_MEMORY_BASE=0,t.ASC_OPTIMIZE_LEVEL=3,t.ASC_SHRINK_LEVEL=0,t.ASC_FEATURE_MUTABLE_GLOBAL=!1,t.ASC_FEATURE_SIGN_EXTENSION=!1,t.ASC_FEATURE_BULK_MEMORY=!1,t.ASC_FEATURE_SIMD=!1,t.ASC_FEATURE_THREADS=!1;var r=new Float64Array(1),n=new Uint32Array(r.buffer);function i(){Error.captureStackTrace?Error.captureStackTrace(this,i):this.stack=this.name+": "+this.message+"\n"+(new Error).stack}function a(e){this.message=e||"assertion failed",Error.captureStackTrace?Error.captureStackTrace(this,a):this.stack=this.name+": "+this.message+"\n"+(new Error).stack}Object.defineProperties(t.i8=function(e){return e<<24>>24},{MIN_VALUE:{value:-128,writable:!1},MAX_VALUE:{value:127,writable:!1}}),Object.defineProperties(t.i16=function(e){return e<<16>>16},{MIN_VALUE:{value:-32768,writable:!1},MAX_VALUE:{value:32767,writable:!1}}),Object.defineProperties(t.i32=t.isize=function(e){return 0|e},{MIN_VALUE:{value:-2147483648,writable:!1},MAX_VALUE:{value:2147483647,writable:!1}}),Object.defineProperties(t.u8=function(e){return 255&e},{MIN_VALUE:{value:0,writable:!1},MAX_VALUE:{value:255,writable:!1}}),Object.defineProperties(t.u16=function(e){return 65535&e},{MIN_VALUE:{value:0,writable:!1},MAX_VALUE:{value:65535,writable:!1}}),Object.defineProperties(t.u32=t.usize=function(e){return e>>>0},{MIN_VALUE:{value:0,writable:!1},MAX_VALUE:{value:4294967295,writable:!1}}),Object.defineProperties(t.bool=function(e){return!!e},{MIN_VALUE:{value:!1,writable:!1},MAX_VALUE:{value:!0,writable:!1}}),Object.defineProperties(t.f32=function(e){return Math.fround(e)},{EPSILON:{value:Math.fround(1.1920929e-7),writable:!1},MIN_VALUE:{value:Math.fround(1.4012985e-45),writable:!1},MAX_VALUE:{value:Math.fround(3.4028235e38),writable:!1},MIN_NORMAL_VALUE:{value:Math.fround(1.17549435e-38),writable:!1},MIN_SAFE_INTEGER:{value:-16777215,writable:!1},MAX_SAFE_INTEGER:{value:16777215,writable:!1}}),Object.defineProperties(t.f64=function(e){return+e},{EPSILON:{value:2.220446049250313e-16,writable:!1},MIN_VALUE:{value:5e-324,writable:!1},MAX_VALUE:{value:1.7976931348623157e308,writable:!1},MIN_NORMAL_VALUE:{value:2.2250738585072014e-308,writable:!1},MIN_SAFE_INTEGER:{value:-9007199254740991,writable:!1},MAX_SAFE_INTEGER:{value:9007199254740991,writable:!1}}),t.clz=Math.clz32,t.ctz=function(e){var t=Math.clz32(e&-e);return e?31-t:t},t.popcnt=function(e){return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},t.rotl=function(e,t){return e<<(t&=31)|e>>>32-t},t.rotr=function(e,t){return e>>>(t&=31)|e<<32-t},t.abs=Math.abs,t.max=Math.max,t.min=Math.min,t.ceil=Math.ceil,t.floor=Math.floor,t.nearest=function(e){return.5===Math.abs(e-Math.trunc(e))?2*Math.round(.5*e):Math.round(e)},t.select=function(e,t,r){return r?e:t},t.sqrt=Math.sqrt,t.trunc=Math.trunc,t.copysign=function(e,t){return Math.abs(e)*Math.sign(t)},t.bswap=function(e){var t=e>>8&16711935,r=(16711935&e)<<8;return(t=(e=t|r)>>16&65535)|(r=(65535&e)<<16)},t.bswap16=function(e){return e<<8&65280|e>>8&255|4294901760&e},i.prototype=Object.create(Error.prototype),i.prototype.name="UnreachableError",i.prototype.message="unreachable",t.unreachable=function(){throw new i},a.prototype=Object.create(Error.prototype),a.prototype.name="AssertionError",t.assert=function(e,t){if(e)return e;throw new a(t)},t.changetype=function(e){return e},t.parseI32=function(e,t){return 0|parseInt(e,void 0)},String.fromCharCodes=function(e){return String.fromCharCode.apply(String,e)},String.fromCodePoints=function(e){return String.fromCodePoint.apply(String,e)},t.isInteger=Number.isInteger,t.isFloat=function(e){return"number"==typeof e},t.isNullable=function(e){return!0},t.isReference=function(e){return"object"==typeof e||"string"==typeof e},t.isFunction=function(e){return"function"==typeof e},t.isString=function(e){return"string"==typeof e||e instanceof String},t.isArray=Array.isArray,t.isArrayLike=function(e){return e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&Math.trunc(e.length)===e.length},Array.create=function(e){var t=new Array(e);return t.length=0,t},t.isDefined=function(e){return void 0!==e},t.isConstant=function(e){return!1},t.unchecked=function(e){return e},t.fmod=function(e,t){return e%t},t.fmodf=function(e,t){return Math.fround(e%t)},t.JSMath=Math,Object.defineProperties(t.JSMath,{sincos_sin:{value:0,writable:!0},sincos_cos:{value:0,writable:!0},signbit:{value:function(e){return r[0]=e,Boolean(n[1]>>>31&e==e)}},sincos:{value:function(e){this.sincos_sin=Math.sin(e),this.sincos_cos=Math.cos(e)}}}),t.memory=(()=>{var e=new Uint8Array(0),r=0;return{allocate:t.__memory_allocate||function(t){if(!(t>>>=0))return 0;if(r+t>e.length){var n=e;(e=new Uint8Array(Math.max(65536,e.length+t,2*e.length))).set(n)}var i=r;return 7&(r+=t)&&(r=1+(7|r)),i},fill:t.__memory_fill||function(t,r,n){e.fill(r,t,t+n)},free:t.__memory_free||function(e){},copy:t.__memory_copy||function(t,r,n){e.copyWithin(t,r,r+n)},reset:t.__memory_reset||function(){e=new Uint8Array(0),r=0}}})(),t.store=t.__store||function(e,t,r){HEAP[(0|e)+(0|r)]=t},t.load=t.__load||function(e,t){return HEAP[(0|e)+(0|t)]},t.unmanaged=function(){}}).call(this,r(8))},function(e,t,r){(function(e){const t=new Float64Array(1),r=new Float32Array(t.buffer),n=new Int32Array(t.buffer);e.f32_as_i32=function(e){return r[0]=e,n[0]},e.i32_as_f32=function(e){return n[0]=e,r[0]},e.f64_as_i64=function(e){return t[0]=e,i64_new(n[0],n[1])},e.i64_as_f64=function(e){return n[0]=i64_low(e),n[1]=i64_high(e),t[0]}}).call(this,r(8))},function(e,t,r){(function(e){const t=e.Long||r(24);e.i64_zero=t.ZERO,e.i64_one=t.ONE,e.i64_new=function(e,r){return t.fromBits(e,r)},e.i64_low=function(e){return e.low},e.i64_high=function(e){return e.high},e.i64_add=function(e,t){return e.add(t)},e.i64_sub=function(e,t){return e.sub(t)},e.i64_mul=function(e,t){return e.mul(t)},e.i64_div=function(e,t){return e.div(t)},e.i64_div_u=function(e,t){return e.toUnsigned().div(t.toUnsigned()).toSigned()},e.i64_rem=function(e,t){return e.mod(t)},e.i64_rem_u=function(e,t){return e.toUnsigned().mod(t.toUnsigned()).toSigned()},e.i64_and=function(e,t){return e.and(t)},e.i64_or=function(e,t){return e.or(t)},e.i64_xor=function(e,t){return e.xor(t)},e.i64_shl=function(e,t){return e.shl(t)},e.i64_shr=function(e,t){return e.shr(t)},e.i64_shr_u=function(e,t){return e.shru(t)},e.i64_not=function(e){return e.not()},e.i64_eq=function(e,t){return e.eq(t)},e.i64_ne=function(e,t){return e.ne(t)},e.i64_align=function(e,r){assert(r&&0==(r&r-1));var n=t.fromInt(r-1);return e.add(n).and(n.not())},e.i64_is_i8=function(e){return 0===e.high&&e.low>=0&&e.low<=i8.MAX_VALUE||-1===e.high&&e.low>=i8.MIN_VALUE&&e.low<0},e.i64_is_i16=function(e){return 0===e.high&&e.low>=0&&e.low<=i16.MAX_VALUE||-1===e.high&&e.low>=i16.MIN_VALUE&&e.low<0},e.i64_is_i32=function(e){return 0===e.high&&e.low>=0||-1===e.high&&e.low<0},e.i64_is_u8=function(e){return 0===e.high&&e.low>=0&&e.low<=u8.MAX_VALUE},e.i64_is_u16=function(e){return 0===e.high&&e.low>=0&&e.low<=u16.MAX_VALUE},e.i64_is_u32=function(e){return 0===e.high},e.i64_is_bool=function(e){return 0===e.high&&(0===e.low||1===e.low)};const n=t.fromNumber(f32.MIN_SAFE_INTEGER),i=t.fromNumber(f32.MAX_SAFE_INTEGER);e.i64_is_f32=function(e){return e.gte(n)&&e.lte(i)};const a=t.fromNumber(f64.MIN_SAFE_INTEGER),s=t.fromNumber(f64.MAX_SAFE_INTEGER);e.i64_is_f64=function(e){return e.gte(a)&&e.lte(s)},e.i64_to_f32=function(t){return e.Math.fround(t.toNumber())},e.i64_to_f64=function(e){return e.toNumber()},e.i64_to_string=function(e,t){return(t?e.toUnsigned():e).toString(10)}}).call(this,r(8))},function(e,t){e.exports=n;var r=null;try{r=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function n(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function i(e){return!0===(e&&e.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=i;var a={},s={};function o(e,t){var r,n,i;return t?(i=0<=(e>>>=0)&&e<256)&&(n=s[e])?n:(r=l(e,(0|e)<0?-1:0,!0),i&&(s[e]=r),r):(i=-128<=(e|=0)&&e<128)&&(n=a[e])?n:(r=l(e,e<0?-1:0,!1),i&&(a[e]=r),r)}function c(e,t){if(isNaN(e))return t?T:f;if(t){if(e<0)return T;if(e>=d)return I}else{if(e<=-y)return x;if(e+1>=y)return b}return e<0?c(-e,t).neg():l(e%h|0,e/h|0,t)}function l(e,t,r){return new n(e,t,r)}n.fromInt=o,n.fromNumber=c,n.fromBits=l;var u=Math.pow;function p(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return f;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||360)throw Error("interior hyphen");if(0===n)return p(e.substring(1),t,r).neg();for(var i=c(u(r,8)),a=f,s=0;s>>0:this.low},A.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},A.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((a=o).isZero())return l+s;for(;l.length<6;)l="0"+l;s=""+l+s}},A.getHighBits=function(){return this.high},A.getHighBitsUnsigned=function(){return this.high>>>0},A.getLowBits=function(){return this.low},A.getLowBitsUnsigned=function(){return this.low>>>0},A.getNumBitsAbs=function(){if(this.isNegative())return this.eq(x)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},A.isOdd=function(){return 1==(1&this.low)},A.isEven=function(){return 0==(1&this.low)},A.equals=function(e){return i(e)||(e=_(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},A.eq=A.equals,A.notEquals=function(e){return!this.eq(e)},A.neq=A.notEquals,A.ne=A.notEquals,A.lessThan=function(e){return this.comp(e)<0},A.lt=A.lessThan,A.lessThanOrEqual=function(e){return this.comp(e)<=0},A.lte=A.lessThanOrEqual,A.le=A.lessThanOrEqual,A.greaterThan=function(e){return this.comp(e)>0},A.gt=A.greaterThan,A.greaterThanOrEqual=function(e){return this.comp(e)>=0},A.gte=A.greaterThanOrEqual,A.ge=A.greaterThanOrEqual,A.compare=function(e){if(i(e)||(e=_(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},A.comp=A.compare,A.negate=function(){return!this.unsigned&&this.eq(x)?x:this.not().add(g)},A.neg=A.negate,A.add=function(e){i(e)||(e=_(e));var t=this.high>>>16,r=65535&this.high,n=this.low>>>16,a=65535&this.low,s=e.high>>>16,o=65535&e.high,c=e.low>>>16,u=0,p=0,h=0,d=0;return h+=(d+=a+(65535&e.low))>>>16,p+=(h+=n+c)>>>16,u+=(p+=r+o)>>>16,u+=t+s,l((h&=65535)<<16|(d&=65535),(u&=65535)<<16|(p&=65535),this.unsigned)},A.subtract=function(e){return i(e)||(e=_(e)),this.add(e.neg())},A.sub=A.subtract,A.multiply=function(e){if(this.isZero())return f;if(i(e)||(e=_(e)),r)return l(r.mul(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned);if(e.isZero())return f;if(this.eq(x))return e.isOdd()?x:f;if(e.eq(x))return this.isOdd()?x:f;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(m)&&e.lt(m))return c(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,n=65535&this.high,a=this.low>>>16,s=65535&this.low,o=e.high>>>16,u=65535&e.high,p=e.low>>>16,h=65535&e.low,d=0,y=0,T=0,g=0;return T+=(g+=s*h)>>>16,y+=(T+=a*h)>>>16,T&=65535,y+=(T+=s*p)>>>16,d+=(y+=n*h)>>>16,y&=65535,d+=(y+=a*p)>>>16,y&=65535,d+=(y+=s*u)>>>16,d+=t*h+n*p+a*u+s*o,l((T&=65535)<<16|(g&=65535),(d&=65535)<<16|(y&=65535),this.unsigned)},A.mul=A.multiply,A.divide=function(e){if(i(e)||(e=_(e)),e.isZero())throw Error("division by zero");var t,n,a;if(r)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?l((this.unsigned?r.div_u:r.div_s)(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?T:f;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return T;if(e.gt(this.shru(1)))return E;a=T}else{if(this.eq(x))return e.eq(g)||e.eq(v)?x:e.eq(x)?g:(t=this.shr(1).div(e).shl(1)).eq(f)?e.isNegative()?g:v:(n=this.sub(e.mul(t)),a=t.add(n.div(e)));if(e.eq(x))return this.unsigned?T:f;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();a=f}for(n=this;n.gte(e);){t=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var s=Math.ceil(Math.log(t)/Math.LN2),o=s<=48?1:u(2,s-48),p=c(t),h=p.mul(e);h.isNegative()||h.gt(n);)h=(p=c(t-=o,this.unsigned)).mul(e);p.isZero()&&(p=g),a=a.add(p),n=n.sub(h)}return a},A.div=A.divide,A.modulo=function(e){return i(e)||(e=_(e)),r?l((this.unsigned?r.rem_u:r.rem_s)(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},A.mod=A.modulo,A.rem=A.modulo,A.not=function(){return l(~this.low,~this.high,this.unsigned)},A.and=function(e){return i(e)||(e=_(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},A.or=function(e){return i(e)||(e=_(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},A.xor=function(e){return i(e)||(e=_(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},A.shiftLeft=function(e){return i(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?l(this.low<>>32-e,this.unsigned):l(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):l(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},A.shr=A.shiftRight,A.shiftRightUnsigned=function(e){if(i(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?l(this.low>>>e|t<<32-e,t>>>e,this.unsigned):l(32===e?t:t>>>e-32,0,this.unsigned)},A.shru=A.shiftRightUnsigned,A.shr_u=A.shiftRightUnsigned,A.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},A.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},A.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},A.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},A.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},n.fromBytes=function(e,t,r){return r?n.fromBytesLE(e,t):n.fromBytesBE(e,t)},n.fromBytesLE=function(e,t){return new n(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},n.fromBytesBE=function(e,t){return new n(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.NONE=0]="NONE",e[e.SIGN_EXTENSION=1]="SIGN_EXTENSION",e[e.MUTABLE_GLOBAL=2]="MUTABLE_GLOBAL",e[e.BULK_MEMORY=4]="BULK_MEMORY",e[e.SIMD=8]="SIMD",e[e.THREADS=16]="THREADS"}(t.Feature||(t.Feature={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.WASM32=0]="WASM32",e[e.WASM64=1]="WASM64",e[e.JS=2]="JS"}(t.Target||(t.Target={}))},function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var o=e.length-1;o>=0;o--)(i=e[o])&&(s=(a<3?i(s):a>3?i(t,r,s):i(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){}return e=n([unmanaged],e)}();t.Typeinfo=i,function(e){e[e.NONE=0]="NONE",e[e.ARRAYBUFFERVIEW=1]="ARRAYBUFFERVIEW",e[e.ARRAY=2]="ARRAY",e[e.SET=4]="SET",e[e.MAP=8]="MAP",e[e.ACYCLIC=16]="ACYCLIC",e[e.VALUE_ALIGN_0=32]="VALUE_ALIGN_0",e[e.VALUE_ALIGN_1=64]="VALUE_ALIGN_1",e[e.VALUE_ALIGN_2=128]="VALUE_ALIGN_2",e[e.VALUE_ALIGN_3=256]="VALUE_ALIGN_3",e[e.VALUE_ALIGN_4=512]="VALUE_ALIGN_4",e[e.VALUE_SIGNED=1024]="VALUE_SIGNED",e[e.VALUE_FLOAT=2048]="VALUE_FLOAT",e[e.VALUE_NULLABLE=4096]="VALUE_NULLABLE",e[e.VALUE_MANAGED=8192]="VALUE_MANAGED",e[e.KEY_ALIGN_0=16384]="KEY_ALIGN_0",e[e.KEY_ALIGN_1=32768]="KEY_ALIGN_1",e[e.KEY_ALIGN_2=65536]="KEY_ALIGN_2",e[e.KEY_ALIGN_3=131072]="KEY_ALIGN_3",e[e.KEY_ALIGN_4=262144]="KEY_ALIGN_4",e[e.KEY_SIGNED=524288]="KEY_SIGNED",e[e.KEY_FLOAT=1048576]="KEY_FLOAT",e[e.KEY_NULLABLE=2097152]="KEY_NULLABLE",e[e.KEY_MANAGED=4194304]="KEY_MANAGED"}(t.TypeinfoFlags||(t.TypeinfoFlags={}))},function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}};function i(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0});var a=r(11),s=r(14),o=r(15),c=r(2);t.formatDiagnostic=c.formatDiagnosticMessage;var l=r(16);t.parseFile=function(e,t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=null),n||(n=new l.Parser),n.parseFile(e,t,r),n},t.nextFile=function(e){return e.nextFile()},t.nextDiagnostic=function(e){var t=e.program;return t.diagnosticsOffset=0&&t<64),i64_ne(i64_and(e,i64_shl(i64_one,i64_new(t))),i64_zero)},t.bitsetSet=function(e,t,r){return assert(t>=0&&t<64),r?i64_or(e,i64_shl(i64_one,i64_new(t))):i64_and(e,i64_not(i64_shl(i64_one,i64_new(t))))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.NULL=0]="NULL",e[e.LINEFEED=10]="LINEFEED",e[e.CARRIAGERETURN=13]="CARRIAGERETURN",e[e.LINESEPARATOR=8232]="LINESEPARATOR",e[e.PARAGRAPHSEPARATOR=8233]="PARAGRAPHSEPARATOR",e[e.NEXTLINE=133]="NEXTLINE",e[e.SPACE=32]="SPACE",e[e.NONBREAKINGSPACE=160]="NONBREAKINGSPACE",e[e.ENQUAD=8192]="ENQUAD",e[e.EMQUAD=8193]="EMQUAD",e[e.ENSPACE=8194]="ENSPACE",e[e.EMSPACE=8195]="EMSPACE",e[e.THREEPEREMSPACE=8196]="THREEPEREMSPACE",e[e.FOURPEREMSPACE=8197]="FOURPEREMSPACE",e[e.SIXPEREMSPACE=8198]="SIXPEREMSPACE",e[e.FIGURESPACE=8199]="FIGURESPACE",e[e.PUNCTUATIONSPACE=8200]="PUNCTUATIONSPACE",e[e.THINSPACE=8201]="THINSPACE",e[e.HAIRSPACE=8202]="HAIRSPACE",e[e.ZEROWIDTHSPACE=8203]="ZEROWIDTHSPACE",e[e.NARROWNOBREAKSPACE=8239]="NARROWNOBREAKSPACE",e[e.IDEOGRAPHICSPACE=12288]="IDEOGRAPHICSPACE",e[e.MATHEMATICALSPACE=8287]="MATHEMATICALSPACE",e[e.OGHAM=5760]="OGHAM",e[e._=95]="_",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.AMPERSAND=38]="AMPERSAND",e[e.ASTERISK=42]="ASTERISK",e[e.AT=64]="AT",e[e.BACKSLASH=92]="BACKSLASH",e[e.BACKTICK=96]="BACKTICK",e[e.BAR=124]="BAR",e[e.CARET=94]="CARET",e[e.CLOSEBRACE=125]="CLOSEBRACE",e[e.CLOSEBRACKET=93]="CLOSEBRACKET",e[e.CLOSEPAREN=41]="CLOSEPAREN",e[e.COLON=58]="COLON",e[e.COMMA=44]="COMMA",e[e.DOLLAR=36]="DOLLAR",e[e.DOT=46]="DOT",e[e.DOUBLEQUOTE=34]="DOUBLEQUOTE",e[e.EQUALS=61]="EQUALS",e[e.EXCLAMATION=33]="EXCLAMATION",e[e.GREATERTHAN=62]="GREATERTHAN",e[e.HASH=35]="HASH",e[e.LESSTHAN=60]="LESSTHAN",e[e.MINUS=45]="MINUS",e[e.OPENBRACE=123]="OPENBRACE",e[e.OPENBRACKET=91]="OPENBRACKET",e[e.OPENPAREN=40]="OPENPAREN",e[e.PERCENT=37]="PERCENT",e[e.PLUS=43]="PLUS",e[e.QUESTION=63]="QUESTION",e[e.SEMICOLON=59]="SEMICOLON",e[e.SINGLEQUOTE=39]="SINGLEQUOTE",e[e.SLASH=47]="SLASH",e[e.TILDE=126]="TILDE",e[e.BACKSPACE=8]="BACKSPACE",e[e.FORMFEED=12]="FORMFEED",e[e.BYTEORDERMARK=65279]="BYTEORDERMARK",e[e.TAB=9]="TAB",e[e.VERTICALTAB=11]="VERTICALTAB"}(t.CharCode||(t.CharCode={})),t.isLineBreak=function(e){switch(e){case 10:case 13:case 8232:case 8233:return!0;default:return!1}},t.isWhiteSpace=function(e){switch(e){case 32:case 9:case 11:case 12:case 160:case 133:case 5760:case 8239:case 8287:case 12288:case 65279:return!0;default:return e>=8192&&e<=8203}},t.isDecimalDigit=function(e){return e>=48&&e<=57},t.isOctalDigit=function(e){return e>=48&&e<=55},t.isIdentifierStart=function(e){return e>=97&&e<=122||e>=65&&e<=90||95==e||36==e||e>127&&!((t=e)<0||t>65535)&&a(t,n);var t},t.isKeywordCharacter=function(e){return e>=97&&e<=122},t.isIdentifierPart=function(e){return e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||95==e||36==e||e>127&&!((t=e)<0||t>65535)&&a(t,i);var t};var n=[170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,880,884,886,887,890,893,902,902,904,906,908,908,910,929,931,1013,1015,1153,1162,1319,1329,1366,1369,1369,1377,1415,1488,1514,1520,1522,1568,1610,1646,1647,1649,1747,1749,1749,1765,1766,1774,1775,1786,1788,1791,1791,1808,1808,1810,1839,1869,1957,1969,1969,1994,2026,2036,2037,2042,2042,2048,2069,2074,2074,2084,2084,2088,2088,2112,2136,2208,2208,2210,2220,2308,2361,2365,2365,2384,2384,2392,2401,2417,2423,2425,2431,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2493,2493,2510,2510,2524,2525,2527,2529,2544,2545,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2649,2652,2654,2654,2674,2676,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2749,2768,2768,2784,2785,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2877,2877,2908,2909,2911,2913,2929,2929,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3024,3024,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3133,3133,3160,3161,3168,3169,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3261,3261,3294,3294,3296,3297,3313,3314,3333,3340,3342,3344,3346,3386,3389,3389,3406,3406,3424,3425,3450,3455,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3585,3632,3634,3635,3648,3654,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3760,3762,3763,3773,3773,3776,3780,3782,3782,3804,3807,3840,3840,3904,3911,3913,3948,3976,3980,4096,4138,4159,4159,4176,4181,4186,4189,4193,4193,4197,4198,4206,4208,4213,4225,4238,4238,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4992,5007,5024,5108,5121,5740,5743,5759,5761,5786,5792,5866,5870,5872,5888,5900,5902,5905,5920,5937,5952,5969,5984,5996,5998,6e3,6016,6067,6103,6103,6108,6108,6176,6263,6272,6312,6314,6314,6320,6389,6400,6428,6480,6509,6512,6516,6528,6571,6593,6599,6656,6678,6688,6740,6823,6823,6917,6963,6981,6987,7043,7072,7086,7087,7098,7141,7168,7203,7245,7247,7258,7293,7401,7404,7406,7409,7413,7414,7424,7615,7680,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8305,8305,8319,8319,8336,8348,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11502,11506,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11648,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11823,11823,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12445,12447,12449,12538,12540,12543,12549,12589,12593,12686,12704,12730,12784,12799,13312,19893,19968,40908,40960,42124,42192,42237,42240,42508,42512,42527,42538,42539,42560,42606,42623,42647,42656,42735,42775,42783,42786,42888,42891,42894,42896,42899,42912,42922,43e3,43009,43011,43013,43015,43018,43020,43042,43072,43123,43138,43187,43250,43255,43259,43259,43274,43301,43312,43334,43360,43388,43396,43442,43471,43471,43520,43560,43584,43586,43588,43595,43616,43638,43642,43642,43648,43695,43697,43697,43701,43702,43705,43709,43712,43712,43714,43714,43739,43741,43744,43754,43762,43764,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43968,44002,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65136,65140,65142,65276,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500],i=[170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,768,884,886,887,890,893,902,902,904,906,908,908,910,929,931,1013,1015,1153,1155,1159,1162,1319,1329,1366,1369,1369,1377,1415,1425,1469,1471,1471,1473,1474,1476,1477,1479,1479,1488,1514,1520,1522,1552,1562,1568,1641,1646,1747,1749,1756,1759,1768,1770,1788,1791,1791,1808,1866,1869,1969,1984,2037,2042,2042,2048,2093,2112,2139,2208,2208,2210,2220,2276,2302,2304,2403,2406,2415,2417,2423,2425,2431,2433,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2492,2500,2503,2504,2507,2510,2519,2519,2524,2525,2527,2531,2534,2545,2561,2563,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2620,2620,2622,2626,2631,2632,2635,2637,2641,2641,2649,2652,2654,2654,2662,2677,2689,2691,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2748,2757,2759,2761,2763,2765,2768,2768,2784,2787,2790,2799,2817,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2876,2884,2887,2888,2891,2893,2902,2903,2908,2909,2911,2915,2918,2927,2929,2929,2946,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3006,3010,3014,3016,3018,3021,3024,3024,3031,3031,3046,3055,3073,3075,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3133,3140,3142,3144,3146,3149,3157,3158,3160,3161,3168,3171,3174,3183,3202,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3260,3268,3270,3272,3274,3277,3285,3286,3294,3294,3296,3299,3302,3311,3313,3314,3330,3331,3333,3340,3342,3344,3346,3386,3389,3396,3398,3400,3402,3406,3415,3415,3424,3427,3430,3439,3450,3455,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3530,3530,3535,3540,3542,3542,3544,3551,3570,3571,3585,3642,3648,3662,3664,3673,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3769,3771,3773,3776,3780,3782,3782,3784,3789,3792,3801,3804,3807,3840,3840,3864,3865,3872,3881,3893,3893,3895,3895,3897,3897,3902,3911,3913,3948,3953,3972,3974,3991,3993,4028,4038,4038,4096,4169,4176,4253,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4957,4959,4992,5007,5024,5108,5121,5740,5743,5759,5761,5786,5792,5866,5870,5872,5888,5900,5902,5908,5920,5940,5952,5971,5984,5996,5998,6e3,6002,6003,6016,6099,6103,6103,6108,6109,6112,6121,6155,6157,6160,6169,6176,6263,6272,6314,6320,6389,6400,6428,6432,6443,6448,6459,6470,6509,6512,6516,6528,6571,6576,6601,6608,6617,6656,6683,6688,6750,6752,6780,6783,6793,6800,6809,6823,6823,6912,6987,6992,7001,7019,7027,7040,7155,7168,7223,7232,7241,7245,7293,7376,7378,7380,7414,7424,7654,7676,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8204,8205,8255,8256,8276,8276,8305,8305,8319,8319,8336,8348,8400,8412,8417,8417,8421,8432,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11647,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11744,11775,11823,11823,12293,12295,12321,12335,12337,12341,12344,12348,12353,12438,12441,12442,12445,12447,12449,12538,12540,12543,12549,12589,12593,12686,12704,12730,12784,12799,13312,19893,19968,40908,40960,42124,42192,42237,42240,42508,42512,42539,42560,42607,42612,42621,42623,42647,42655,42737,42775,42783,42786,42888,42891,42894,42896,42899,42912,42922,43e3,43047,43072,43123,43136,43204,43216,43225,43232,43255,43259,43259,43264,43309,43312,43347,43360,43388,43392,43456,43471,43481,43520,43574,43584,43597,43600,43609,43616,43638,43642,43643,43648,43714,43739,43741,43744,43759,43762,43766,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43968,44010,44012,44013,44016,44025,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65024,65039,65056,65062,65075,65076,65101,65103,65136,65140,65142,65276,65296,65305,65313,65338,65343,65343,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500];function a(e,t){if(e>1),(n=t[r-=1&r])<=e&&e<=t[r+1])return!0;e=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}},i=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return s};Object.defineProperty(t,"__esModule",{value:!0}),t.makeArray=function(e){if(void 0===e&&(e=null),e){for(var t=new Array(e.length),r=0,n=e.length;r0||n=0;)if(e.charCodeAt(a)==i){r-a==3&&46==e.charCodeAt(a+1)&&46==e.charCodeAt(a+2)||(e=t?e.substring(0,a):e.substring(0,a)+e.substring(r+3),n-=r+3-a,r=a-1);break}if(a<0&&r>0&&(2!=r||46!=e.charCodeAt(0)||46!=e.charCodeAt(1))){n=(e=e.substring(r+4)).length;continue}}}r++}return n>0?e:"."}function s(e){var t=e.length;if(t<=1){if(0==t)return".";if(e.charCodeAt(0)==i)return e}for(;--t>0;)if(e.charCodeAt(t)==i)return e.substring(0,t);return"."}t.normalizePath=a,t.resolvePath=function(e,t){return e.startsWith("std/")?e:a(s(t)+n.PATH_DELIMITER+e)},t.dirname=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=" ",i=" ",a=" ";t.indent=function(e,t){for(;t>=4;)e.push(a),t-=4;t>=2&&(e.push(i),t-=2),t&&e.push(n)}},function(e,t,r){"use strict";function n(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24}function i(e,t,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function a(e,t){var r=n(e,t),i=n(e,t+4);return i64_new(r,i)}Object.defineProperty(t,"__esModule",{value:!0}),t.readI8=function(e,t){return e[t]},t.writeI8=function(e,t,r){t[r]=e},t.readI16=function(e,t){return e[t]|e[t+1]<<8},t.writeI16=function(e,t,r){t[r]=e,t[r+1]=e>>>8},t.readI32=n,t.writeI32=i,t.readI64=a,t.writeI64=function(e,t,r){i(i64_low(e),t,r),i(i64_high(e),t,r+4)},t.readF32=function(e,t){return i32_as_f32(n(e,t))},t.writeF32=function(e,t,r){i(f32_as_i32(e),t,r)},t.readF64=function(e,t){return i64_as_f64(a(e,t))},t.writeF64=function(e,t,r){var n=f64_as_i64(e);i(i64_low(n),t,r),i(i64_high(n),t,r+4)}}])}); //# sourceMappingURL=assemblyscript.js.map \ No newline at end of file diff --git a/dist/assemblyscript.js.map b/dist/assemblyscript.js.map index 2924ff0ed3..795eed1541 100644 --- a/dist/assemblyscript.js.map +++ b/dist/assemblyscript.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://assemblyscript/webpack/universalModuleDefinition","webpack://assemblyscript/webpack/bootstrap","webpack://assemblyscript/./src/common.ts","webpack://assemblyscript/./src/util/index.ts","webpack://assemblyscript/./src/diagnostics.ts","webpack://assemblyscript/./src/program.ts","webpack://assemblyscript/./src/module.ts","webpack://assemblyscript/./src/ast.ts","webpack://assemblyscript/./src/types.ts","webpack://assemblyscript/./src/tokenizer.ts","webpack://assemblyscript/(webpack)/buildin/global.js","webpack://assemblyscript/./src/resolver.ts","webpack://assemblyscript/./src/compiler.ts","webpack://assemblyscript/./src/diagnosticMessages.generated.ts","webpack://assemblyscript/./src/flow.ts","webpack://assemblyscript/./src/decompiler.ts","webpack://assemblyscript/./src/definitions.ts","webpack://assemblyscript/./src/parser.ts","webpack://assemblyscript/./src/glue/js/index.ts","webpack://assemblyscript/./src/glue/js/binaryen.js","webpack://assemblyscript/external \"binaryen\"","webpack://assemblyscript/./std/portable/index.js","webpack://assemblyscript/./src/glue/js/float.js","webpack://assemblyscript/./src/glue/js/i64.js","webpack://assemblyscript/./node_modules/long/src/long.js","webpack://assemblyscript/./src/builtins.ts","webpack://assemblyscript/./src/util/bitset.ts","webpack://assemblyscript/./src/util/charcode.ts","webpack://assemblyscript/./src/util/collections.ts","webpack://assemblyscript/./src/util/path.ts","webpack://assemblyscript/./src/util/text.ts","webpack://assemblyscript/./src/util/binary.ts","webpack://assemblyscript/./src/index.ts"],"names":["root","factory","exports","module","require","define","amd","self","this","__WEBPACK_EXTERNAL_MODULE__19__","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","CommonFlags","PATH_DELIMITER","PARENT_SUBST","GETTER_PREFIX","SETTER_PREFIX","INSTANCE_DELIMITER","STATIC_DELIMITER","INNER_DELIMITER","LIBRARY_SUBST","LIBRARY_PREFIX","INDEX_SUFFIX","CommonSymbols","EMPTY","i8","i16","i32","i64","isize","u8","u16","u32","u64","usize","bool","f32","f64","v128","i8x16","u8x16","i16x8","u16x8","i32x4","u32x4","i64x2","u64x2","f32x4","f64x2","void_","number","boolean","string","native","null_","true_","false_","this_","super_","constructor","LibrarySymbols","ASC_TARGET","ASC_NO_TREESHAKING","ASC_NO_ASSERT","ASC_MEMORY_BASE","ASC_OPTIMIZE_LEVEL","ASC_SHRINK_LEVEL","ASC_FEATURE_MUTABLE_GLOBAL","ASC_FEATURE_SIGN_EXTENSION","ASC_FEATURE_BULK_MEMORY","ASC_FEATURE_SIMD","ASC_FEATURE_THREADS","I8","I16","I32","I64","Isize","U8","U16","U32","U64","Usize","Bool","F32","F64","V128","String","Array","ArrayBuffer","Math","Mathf","memory","allocate","abort","main","length","byteLength","pow","mod","__export","isPowerOf2","x","DiagnosticCategory","diagnosticMessages_generated_1","util_1","diagnosticMessages_generated_2","diagnosticCategoryToString","category","INFO","WARNING","ERROR","assert","diagnosticCategoryToColor","COLOR_BLUE","COLOR_YELLOW","COLOR_RED","DiagnosticCode","diagnosticCodeToString","COLOR_RESET","DiagnosticMessage","code","message","range","relatedRange","arg0","arg1","arg2","replace","createInfo","createWarning","createError","withRange","withRelatedRange","toString","source","normalizedPath","line","column","formatDiagnosticContext","useColors","text","len","start","end","isLineBreak","charCodeAt","sb","substring","push","join","formatDiagnosticMessage","showContext","DiagnosticEmitter","diagnostics","emitDiagnostic","info","infoRelated","warning","warningRelated","error","errorRelated","OperatorKind","common_1","diagnostics_1","types_1","ast_1","resolver_1","flow_1","QueuedImport","localFile","localIdentifier","foreignIdentifier","foreignPath","foreignPathAlt","QueuedExport","QueuedExportStar","pathLiteral","operatorKindFromDecorator","decoratorKind","arg","DecoratorKind","OPERATOR","OPERATOR_BINARY","INDEXED_GET","INDEXED_SET","UNCHECKED_INDEXED_GET","UNCHECKED_INDEXED_SET","ADD","SUB","MUL","POW","DIV","REM","BITWISE_AND","BITWISE_OR","BITWISE_XOR","EQ","NE","GT","GE","BITWISE_SHR","BITWISE_SHR_U","LT","LE","BITWISE_SHL","OPERATOR_PREFIX","PLUS","PREFIX_INC","MINUS","PREFIX_DEC","NOT","BITWISE_NOT","OPERATOR_POSTFIX","POSTFIX_INC","POSTFIX_DEC","INVALID","ElementKind","DecoratorFlags","Program","_super","_this","sources","diagnosticsOffset","explicitStartFunction","filesByName","Map","elementsByName","elementsByDeclaration","instancesByName","typeClasses","arrayBufferInstance","arrayPrototype","stringInstance","abortInstance","memoryAllocateInstance","hasGC","gcAllocateInstance","gcLinkInstance","gcMarkInstance","gcHeaderSize","gcHookOffset","nativeDummySignature","nativeSource","Source","SourceKind","LIBRARY","nativeFile","File","set","internalName","resolver","Resolver","__extends","makeNativeVariableDeclaration","flags","NONE","Node","createVariableDeclaration","createIdentifierExpression","makeNativeTypeDeclaration","identifier","createTypeDeclaration","createOmittedType","makeNativeFunctionDeclaration","createFunctionDeclaration","createSignature","createType","createSimpleTypeName","makeNativeNamespaceDeclaration","createNamespaceDeclaration","makeNativeFunction","signature","parent","decoratorFlags","Function","FunctionPrototype","getElementByDeclaration","declaration","has","initialize","options","registerNativeType","Type","isizeType","usizeType","void","add","TypeDefinition","EXPORT","GENERIC","BUILTIN","hasFeature","registerConstantInteger","i64_new","isWasm64","noAssert","memoryBase","optimizeLevelHint","shrinkLevelHint","queuedImports","queuedExports","queuedExportsStar","queuedExtends","queuedImplements","k","file","statements","j","statement","kind","NodeKind","initializeExports","IMPORT","initializeImports","VARIABLE","initializeVariables","CLASSDECLARATION","initializeClass","ENUMDECLARATION","initializeEnum","FUNCTIONDECLARATION","initializeFunction","INTERFACEDECLARATION","initializeInterface","NAMESPACEDECLARATION","initializeNamespace","TYPEDECLARATION","initializeTypeDefinition","queuedExportsStar_1","__values","queuedExportsStar_1_1","next","done","_g","__read","exportsStar","exportStar","foreignFile","lookupForeignFile","ensureExportStar","File_0_not_found","queuedImport","element","lookupForeign","Module_0_has_no_exported_member_1","localName","asImportedNamespace","queuedExports_1","queuedExports_1_1","_h","exports_1","exports_1_1","_j","exportName","queuedExport","ensureExport","lookupInSelf","globalElement","lookupGlobal","DeclaredElement","registerNativeTypeClass","thisPrototype","extendsNode","baseElement","resolveTypeName","CLASS_PROTOTYPE","basePrototype","hasDecorator","SEALED","Class_0_is_sealed_and_cannot_be_extended","identifierNode","UNMANAGED","Unmanaged_classes_cannot_extend_managed_classes_and_vice_versa","Range","A_class_may_only_extend_another_class","globalAliases","globalAliases_1","globalAliases_1_1","_k","alias","Error","resolveClass","FUNCTION_PROTOTYPE","resolveFunction","parameterTypes","signatureReference","returnType","byteSize","_l","values","_m","isEntry","_o","_p","markModuleExport","MODULE_EXPORT","instanceMembers","_c","_d","member","PROPERTY_PROTOTYPE","getterPrototype","setterPrototype","PROPERTY","FUNCTION","FIELD","CLASS","members","_e","_f","type","setType","typeKind","className","classElement","is","global","Global","CONST","setConstantIntegerValue","registerConstantFloat","setConstantFloatValue","ensureGlobal","merged","tryMerge","Duplicate_identifier_0","elements","foreignName","lookupExport","fileQueuedExports","checkDecorators","decorators","acceptedFlags","decorator","flag","decoratorKindToFlag","decoratorNameToKind","isLibrary","Decorator_0_is_not_valid_here","Duplicate_decorator","ClassPrototype","GLOBAL","implementsTypes","numImplementsTypes","Unmanaged_classes_cannot_implement_interfaces","Operation_not_supported","extendsType","memberDeclarations","memberDeclaration","FIELDDECLARATION","initializeField","METHODDECLARATION","isAny","GET","SET","initializeProperty","initializeMethod","INDEXSIGNATUREDECLARATION","STATIC","INTERFACE_PROTOTYPE","READONLY","INLINE","LAZY","ABSTRACT","FieldPrototype","addInstance","isStatic","CONSTRUCTOR","checkOperatorOverloads","classPrototype","numArgs","arguments","firstArg","LITERAL","literalKind","LiteralKind","STRING","overloads","overloadPrototypes","Duplicate_function_implementation","operatorKind","String_literal_expected","Expected_0_arguments_but_got_1","ensureProperty","parentMembers","PropertyPrototype","Duplicate_property_0","isGetter","Enum","initializeEnumValue","EnumValue","initializeExport","internalPath","queued","endsWith","path","exportedName","Export_declaration_conflicts_with_exported_declaration_of_0","declarations","initializeImport","namespaceName","validDecorators","AMBIENT","EXTERNAL","INSTANCE","FILE","START","Module_cannot_have_multiple_start_functions","findDecorator","InterfacePrototype","Namespace","DECLARE","Element","program","shadowType","current","originalDeclaration","actual","isBound","TypedElement","apply","RESOLVED","startFunction","Signature","isImport","lookup","includes","exports_2","exports_2_1","_b","memberName","TYPEDEFINITION","mangleInternalName","typeParameters","NAMESPACE","ENUM","ConstantValueKind","VariableLikeElement","constantValueKind","initializer","constantIntegerValue","INLINED","constantFloatValue","ENUMVALUE","isImmutable","Parameter","Local","index","LOCAL","instances","boundPrototypes","body","arrowKind","toBound","classInstance","bound","getResolvedInstance","instanceKey","setResolvedInstance","instance","nameInclTypeParameters","contextualTypeArguments","localsByName","localsByIndex","additionalLocals","debugLocations","ref","functionTableIndex","trampoline","nextInlineId","nextAnonymousId","tempI32s","tempI64s","tempF32s","tempF64s","tempV128s","nextBreakId","breakStack","breakLabel","asFunction","localIndex","local","thisType","parameterType","parameterName","getParameterName","flow","Flow","registerConcreteElement","addLocal","locals","finalize","sourceMap","debugLocation","setDebugLocation","debugInfoRef","debugInfoIndex","FunctionTarget","__s","FUNCTION_TARGET","toSignatureString","FIELD_PROTOTYPE","parameterIndex","Field","memoryOffset","firstDeclaration","Property","getterInstance","setterInstance","_isInterface","constructorPrototype","extends","basePtototype","Class","typeArguments","base","INTERFACE","currentMemoryOffset","constructorInstance","gcHookIndex","asClass","inheritedTypeArguments","inheritedTypeArguments_1","inheritedTypeArguments_1_1","baseName","baseType","typeParameterNodes","numTypeArguments","isAssignableTo","target","lookupOverload","unchecked","uncheckedOverload","overload","offsetof","fieldName","field","Interface","older","newer","copyMembers","Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local","src","dest","srcMembers","destMembers","srcMembers_1","srcMembers_1_1","isInstance","asGlobal","NativeType","ExpressionId","compiler_1","_BinaryenTypeNone","_BinaryenTypeInt32","_BinaryenTypeInt64","_BinaryenTypeFloat32","_BinaryenTypeFloat64","_BinaryenTypeVec128","_BinaryenTypeUnreachable","_BinaryenTypeAuto","_BinaryenInvalidId","_BinaryenBlockId","_BinaryenIfId","_BinaryenLoopId","_BinaryenBreakId","_BinaryenSwitchId","_BinaryenCallId","_BinaryenCallIndirectId","_BinaryenGetLocalId","_BinaryenSetLocalId","_BinaryenGetGlobalId","_BinaryenSetGlobalId","_BinaryenLoadId","_BinaryenStoreId","_BinaryenConstId","_BinaryenUnaryId","_BinaryenBinaryId","_BinaryenSelectId","_BinaryenDropId","_BinaryenReturnId","_BinaryenHostId","_BinaryenNopId","_BinaryenUnreachableId","_BinaryenAtomicCmpxchgId","_BinaryenAtomicRMWId","_BinaryenAtomicWaitId","_BinaryenAtomicNotifyId","_BinaryenSIMDExtractId","_BinaryenSIMDReplaceId","_BinaryenSIMDShuffleId","_BinaryenSIMDBitselectId","_BinaryenSIMDShiftId","_BinaryenMemoryInitId","_BinaryenDataDropId","_BinaryenMemoryCopyId","_BinaryenMemoryFillId","UnaryOp","_BinaryenClzInt32","_BinaryenCtzInt32","_BinaryenPopcntInt32","_BinaryenNegFloat32","_BinaryenAbsFloat32","_BinaryenCeilFloat32","_BinaryenFloorFloat32","_BinaryenTruncFloat32","_BinaryenNearestFloat32","_BinaryenSqrtFloat32","_BinaryenEqZInt32","_BinaryenClzInt64","_BinaryenCtzInt64","_BinaryenPopcntInt64","_BinaryenNegFloat64","_BinaryenAbsFloat64","_BinaryenCeilFloat64","_BinaryenFloorFloat64","_BinaryenTruncFloat64","_BinaryenNearestFloat64","_BinaryenSqrtFloat64","_BinaryenEqZInt64","_BinaryenExtendSInt32","_BinaryenExtendUInt32","_BinaryenWrapInt64","_BinaryenTruncSFloat32ToInt32","_BinaryenTruncSFloat32ToInt64","_BinaryenTruncUFloat32ToInt32","_BinaryenTruncUFloat32ToInt64","_BinaryenTruncSFloat64ToInt32","_BinaryenTruncSFloat64ToInt64","_BinaryenTruncUFloat64ToInt32","_BinaryenTruncUFloat64ToInt64","_BinaryenReinterpretFloat32","_BinaryenReinterpretFloat64","_BinaryenConvertSInt32ToFloat32","_BinaryenConvertSInt32ToFloat64","_BinaryenConvertUInt32ToFloat32","_BinaryenConvertUInt32ToFloat64","_BinaryenConvertSInt64ToFloat32","_BinaryenConvertSInt64ToFloat64","_BinaryenConvertUInt64ToFloat32","_BinaryenConvertUInt64ToFloat64","_BinaryenPromoteFloat32","_BinaryenDemoteFloat64","_BinaryenReinterpretInt32","_BinaryenReinterpretInt64","_BinaryenExtendS8Int32","_BinaryenExtendS16Int32","_BinaryenExtendS8Int64","_BinaryenExtendS16Int64","_BinaryenExtendS32Int64","_BinaryenSplatVecI8x16","_BinaryenSplatVecI16x8","_BinaryenSplatVecI32x4","_BinaryenSplatVecI64x2","_BinaryenSplatVecF32x4","_BinaryenSplatVecF64x2","_BinaryenNotVec128","_BinaryenNegVecI8x16","_BinaryenAnyTrueVecI8x16","_BinaryenAllTrueVecI8x16","_BinaryenNegVecI16x8","_BinaryenAnyTrueVecI16x8","_BinaryenAllTrueVecI16x8","_BinaryenNegVecI32x4","_BinaryenAnyTrueVecI32x4","_BinaryenAllTrueVecI32x4","_BinaryenNegVecI64x2","_BinaryenAnyTrueVecI64x2","_BinaryenAllTrueVecI64x2","_BinaryenAbsVecF32x4","_BinaryenNegVecF32x4","_BinaryenSqrtVecF32x4","_BinaryenAbsVecF64x2","_BinaryenNegVecF64x2","_BinaryenSqrtVecF64x2","_BinaryenTruncSatSVecF32x4ToVecI32x4","_BinaryenTruncSatUVecF32x4ToVecI32x4","_BinaryenTruncSatSVecF64x2ToVecI64x2","_BinaryenTruncSatUVecF64x2ToVecI64x2","_BinaryenConvertSVecI32x4ToVecF32x4","_BinaryenConvertUVecI32x4ToVecF32x4","_BinaryenConvertSVecI64x2ToVecF64x2","_BinaryenConvertUVecI64x2ToVecF64x2","BinaryOp","_BinaryenAddInt32","_BinaryenSubInt32","_BinaryenMulInt32","_BinaryenDivSInt32","_BinaryenDivUInt32","_BinaryenRemSInt32","_BinaryenRemUInt32","_BinaryenAndInt32","_BinaryenOrInt32","_BinaryenXorInt32","_BinaryenShlInt32","_BinaryenShrUInt32","_BinaryenShrSInt32","_BinaryenRotLInt32","_BinaryenRotRInt32","_BinaryenEqInt32","_BinaryenNeInt32","_BinaryenLtSInt32","_BinaryenLtUInt32","_BinaryenLeSInt32","_BinaryenLeUInt32","_BinaryenGtSInt32","_BinaryenGtUInt32","_BinaryenGeSInt32","_BinaryenGeUInt32","_BinaryenAddInt64","_BinaryenSubInt64","_BinaryenMulInt64","_BinaryenDivSInt64","_BinaryenDivUInt64","_BinaryenRemSInt64","_BinaryenRemUInt64","_BinaryenAndInt64","_BinaryenOrInt64","_BinaryenXorInt64","_BinaryenShlInt64","_BinaryenShrUInt64","_BinaryenShrSInt64","_BinaryenRotLInt64","_BinaryenRotRInt64","_BinaryenEqInt64","_BinaryenNeInt64","_BinaryenLtSInt64","_BinaryenLtUInt64","_BinaryenLeSInt64","_BinaryenLeUInt64","_BinaryenGtSInt64","_BinaryenGtUInt64","_BinaryenGeSInt64","_BinaryenGeUInt64","_BinaryenAddFloat32","_BinaryenSubFloat32","_BinaryenMulFloat32","_BinaryenDivFloat32","_BinaryenCopySignFloat32","_BinaryenMinFloat32","_BinaryenMaxFloat32","_BinaryenEqFloat32","_BinaryenNeFloat32","_BinaryenLtFloat32","_BinaryenLeFloat32","_BinaryenGtFloat32","_BinaryenGeFloat32","_BinaryenAddFloat64","_BinaryenSubFloat64","_BinaryenMulFloat64","_BinaryenDivFloat64","_BinaryenCopySignFloat64","_BinaryenMinFloat64","_BinaryenMaxFloat64","_BinaryenEqFloat64","_BinaryenNeFloat64","_BinaryenLtFloat64","_BinaryenLeFloat64","_BinaryenGtFloat64","_BinaryenGeFloat64","_BinaryenEqVecI8x16","_BinaryenNeVecI8x16","_BinaryenLtSVecI8x16","_BinaryenLtUVecI8x16","_BinaryenLeSVecI8x16","_BinaryenLeUVecI8x16","_BinaryenGtSVecI8x16","_BinaryenGtUVecI8x16","_BinaryenGeSVecI8x16","_BinaryenGeUVecI8x16","_BinaryenEqVecI16x8","_BinaryenNeVecI16x8","_BinaryenLtSVecI16x8","_BinaryenLtUVecI16x8","_BinaryenLeSVecI16x8","_BinaryenLeUVecI16x8","_BinaryenGtSVecI16x8","_BinaryenGtUVecI16x8","_BinaryenGeSVecI16x8","_BinaryenGeUVecI16x8","_BinaryenEqVecI32x4","_BinaryenNeVecI32x4","_BinaryenLtSVecI32x4","_BinaryenLtUVecI32x4","_BinaryenLeSVecI32x4","_BinaryenLeUVecI32x4","_BinaryenGtSVecI32x4","_BinaryenGtUVecI32x4","_BinaryenGeSVecI32x4","_BinaryenGeUVecI32x4","_BinaryenEqVecF32x4","_BinaryenNeVecF32x4","_BinaryenLtVecF32x4","_BinaryenLeVecF32x4","_BinaryenGtVecF32x4","_BinaryenGeVecF32x4","_BinaryenEqVecF64x2","_BinaryenNeVecF64x2","_BinaryenLtVecF64x2","_BinaryenLeVecF64x2","_BinaryenGtVecF64x2","_BinaryenGeVecF64x2","_BinaryenAndVec128","_BinaryenOrVec128","_BinaryenXorVec128","_BinaryenAddVecI8x16","_BinaryenAddSatSVecI8x16","_BinaryenAddSatUVecI8x16","_BinaryenSubVecI8x16","_BinaryenSubSatSVecI8x16","_BinaryenSubSatUVecI8x16","_BinaryenMulVecI8x16","_BinaryenAddVecI16x8","_BinaryenAddSatSVecI16x8","_BinaryenAddSatUVecI16x8","_BinaryenSubVecI16x8","_BinaryenSubSatSVecI16x8","_BinaryenSubSatUVecI16x8","_BinaryenMulVecI16x8","_BinaryenAddVecI32x4","_BinaryenSubVecI32x4","_BinaryenMulVecI32x4","_BinaryenAddVecI64x2","_BinaryenSubVecI64x2","_BinaryenAddVecF32x4","_BinaryenSubVecF32x4","_BinaryenMulVecF32x4","_BinaryenDivVecF32x4","_BinaryenMinVecF32x4","_BinaryenMaxVecF32x4","_BinaryenAddVecF64x2","_BinaryenSubVecF64x2","_BinaryenMulVecF64x2","_BinaryenDivVecF64x2","_BinaryenMinVecF64x2","_BinaryenMaxVecF64x2","HostOp","_BinaryenCurrentMemory","_BinaryenGrowMemory","AtomicRMWOp","_BinaryenAtomicRMWAdd","_BinaryenAtomicRMWSub","_BinaryenAtomicRMWAnd","_BinaryenAtomicRMWOr","_BinaryenAtomicRMWXor","_BinaryenAtomicRMWXchg","SIMDExtractOp","_BinaryenExtractLaneSVecI8x16","_BinaryenExtractLaneUVecI8x16","_BinaryenExtractLaneSVecI16x8","_BinaryenExtractLaneUVecI16x8","_BinaryenExtractLaneVecI32x4","_BinaryenExtractLaneVecI64x2","_BinaryenExtractLaneVecF32x4","_BinaryenExtractLaneVecF64x2","SIMDReplaceOp","_BinaryenReplaceLaneVecI8x16","_BinaryenReplaceLaneVecI16x8","_BinaryenReplaceLaneVecI32x4","_BinaryenReplaceLaneVecI64x2","_BinaryenReplaceLaneVecF32x4","_BinaryenReplaceLaneVecF64x2","SIMDShiftOp","_BinaryenShlVecI8x16","_BinaryenShrSVecI8x16","_BinaryenShrUVecI8x16","_BinaryenShlVecI16x8","_BinaryenShrSVecI16x8","_BinaryenShrUVecI16x8","_BinaryenShlVecI32x4","_BinaryenShrSVecI32x4","_BinaryenShrUVecI32x4","_BinaryenShlVecI64x2","_BinaryenShrSVecI64x2","_BinaryenShrUVecI64x2","MemorySegment","buffer","offset","segment","Module","hasTemporaryFunction","cachedPrecomputeNames","cachedStrings","_BinaryenModuleCreate","lit","_BinaryenSizeofLiteral","createFrom","cArr","allocU8Array","_BinaryenModuleRead","free","changetype","addFunctionType","result","paramTypes","cStr","allocStringCached","allocI32Array","_BinaryenAddFunctionType","getFunctionTypeBySignature","_BinaryenGetFunctionTypeBySignature","removeFunctionType","_BinaryenRemoveFunctionType","createI32","out","_BinaryenLiteralInt32","_BinaryenConst","createI64","valueLow","valueHigh","_BinaryenLiteralInt64","createF32","_BinaryenLiteralFloat32","createF64","_BinaryenLiteralFloat64","createV128","bytes","store","_BinaryenLiteralVec128","createUnary","op","expr","_BinaryenUnary","createBinary","left","right","_BinaryenBinary","createHost","operands","allocPtrArray","_BinaryenHost","createGetLocal","_BinaryenGetLocal","createTeeLocal","_BinaryenTeeLocal","createGetGlobal","_BinaryenGetGlobal","createLoad","signed","ptr","align","_BinaryenLoad","createStore","_BinaryenStore","createAtomicLoad","_BinaryenAtomicLoad","createAtomicStore","_BinaryenAtomicStore","createAtomicRMW","_BinaryenAtomicRMW","createAtomicCmpxchg","expected","replacement","_BinaryenAtomicCmpxchg","createAtomicWait","timeout","expectedType","_BinaryenAtomicWait","createAtomicNotify","notifyCount","_BinaryenAtomicNotify","createSetLocal","_BinaryenSetLocal","createSetGlobal","_BinaryenSetGlobal","createBlock","label","children","None","_BinaryenBlock","createBreak","condition","_BinaryenBreak","createDrop","expression","_BinaryenDrop","createLoop","_BinaryenLoop","createIf","ifTrue","ifFalse","_BinaryenIf","createNop","_BinaryenNop","createReturn","_BinaryenReturn","createSelect","_BinaryenSelect","createSwitch","names","defaultName","numNames","strs","_BinaryenSwitch","createCall","_BinaryenCall","createCallIndirect","typeName","_BinaryenCallIndirect","createUnreachable","_BinaryenUnreachable","createMemoryCopy","size","_BinaryenMemoryCopy","createMemoryFill","_BinaryenMemoryFill","createSIMDExtract","vec","idx","_BinaryenSIMDExtract","createSIMDReplace","_BinaryenSIMDReplace","createSIMDShuffle","vec1","vec2","mask","_BinaryenSIMDShuffle","createSIMDBitselect","cond","_BinaryenSIMDBitselect","createSIMDShift","shift","_BinaryenSIMDShift","addGlobal","mutable","_BinaryenAddGlobal","removeGlobal","_BinaryenRemoveGlobal","addFunction","varTypes","_BinaryenAddFunction","removeFunction","_BinaryenRemoveFunction","addTemporaryFunction","tempName","typeRef","removeTemporaryFunction","addFunctionExport","externalName","cStr1","cStr2","_BinaryenAddFunctionExport","addTableExport","_BinaryenAddTableExport","addMemoryExport","_BinaryenAddMemoryExport","addGlobalExport","_BinaryenAddGlobalExport","removeExport","_BinaryenRemoveExport","addFunctionImport","externalModuleName","externalBaseName","functionType","cStr3","_BinaryenAddFunctionImport","addTableImport","_BinaryenAddTableImport","addMemoryImport","shared","_BinaryenAddMemoryImport","addGlobalImport","globalType","_BinaryenAddGlobalImport","setMemory","initial","maximum","segments","segs","psvs","offs","sizs","Target","WASM64","i64_low","i64_high","cArr1","cArr2","cArr3","cArr4","_BinaryenSetMemory","setFunctionTable","funcs","_BinaryenSetFunctionTable","setStart","func","_BinaryenSetStart","getOptimizeLevel","_BinaryenGetOptimizeLevel","setOptimizeLevel","level","_BinaryenSetOptimizeLevel","getShrinkLevel","_BinaryenGetShrinkLevel","setShrinkLevel","_BinaryenSetShrinkLevel","setDebugInfo","on","_BinaryenSetDebugInfo","optimize","_BinaryenFunctionOptimize","_BinaryenModuleOptimize","runPasses","passes","allocString","_BinaryenFunctionRunPasses","_BinaryenModuleRunPasses","precomputeExpression","previousOptimizeLevel","previousShrinkLevel","previousDebugInfo","_BinaryenGetDebugInfo","_BinaryenExpressionGetType","_BinaryenFunctionGetBody","validate","_BinaryenModuleValidate","interpret","_BinaryenModuleInterpret","toBinary","sourceMapUrl","binaryPtr","sourceMapPtr","_BinaryenModuleAllocateAndWrite","readInt","binaryBytes","ret","BinaryModule","output","Uint8Array","load","readBuffer","readString","toText","toAsmjs","str","dispose","_BinaryenModuleDispose","createRelooper","Relooper","cloneExpression","noSideEffects","maxDepth","MAX_VALUE","nested1","nested2","_BinaryenExpressionGetId","Const","_BinaryenConstGetValueI32","_BinaryenConstGetValueI64Low","_BinaryenConstGetValueI64High","_BinaryenConstGetValueF32","_BinaryenConstGetValueF64","GetLocal","_BinaryenGetLocalGetIndex","GetGlobal","globalName","_BinaryenGetGlobalGetName","Load","_BinaryenLoadGetPtr","_BinaryenLoadIsAtomic","_BinaryenLoadGetBytes","_BinaryenLoadGetOffset","_BinaryenLoadIsSigned","_BinaryenLoadGetAlign","Unary","_BinaryenUnaryGetValue","_BinaryenUnaryGetOp","Binary","_BinaryenBinaryGetLeft","_BinaryenBinaryGetRight","_BinaryenBinaryGetOp","addDebugInfoFile","_BinaryenModuleAddDebugInfoFileName","getDebugInfoFile","_BinaryenModuleGetDebugInfoFileName","fileIndex","lineNumber","columnNumber","_BinaryenFunctionSetDebugLocation","UNLIMITED_MEMORY","getExpressionId","getExpressionType","getConstValueI32","getConstValueI64Low","getConstValueI64High","getConstValueF32","getConstValueF64","getGetLocalIndex","getSetLocalIndex","_BinaryenSetLocalGetIndex","getSetLocalValue","_BinaryenSetLocalGetValue","isTeeLocal","_BinaryenSetLocalIsTee","getGetGlobalName","getBinaryOp","getBinaryLeft","getBinaryRight","getUnaryOp","getUnaryValue","getLoadBytes","getLoadOffset","getLoadPtr","isLoadSigned","getStoreBytes","_BinaryenStoreGetBytes","getStoreOffset","_BinaryenStoreGetOffset","getStorePtr","_BinaryenStoreGetPtr","getStoreValue","_BinaryenStoreGetValue","getBlockName","_BinaryenBlockGetName","getBlockChildCount","_BinaryenBlockGetNumChildren","getBlockChild","_BinaryenBlockGetChild","getIfCondition","_BinaryenIfGetCondition","getIfTrue","_BinaryenIfGetIfTrue","getIfFalse","_BinaryenIfGetIfFalse","getLoopName","_BinaryenLoopGetName","getLoopBody","_BinaryenLoopGetBody","getBreakName","_BinaryenBreakGetName","getBreakCondition","_BinaryenBreakGetCondition","getSelectThen","_BinaryenSelectGetIfTrue","getSelectElse","_BinaryenSelectGetIfFalse","getSelectCondition","_BinaryenSelectGetCondition","getDropValue","_BinaryenDropGetValue","getReturnValue","_BinaryenReturnGetValue","getCallTarget","_BinaryenCallGetTarget","getHostOp","_BinaryenHostGetOp","getHostOperandCount","_BinaryenHostGetNumOperands","getHostOperand","_BinaryenHostGetOperand","getHostName","_BinaryenHostGetNameOperand","getFunctionBody","getFunctionName","_BinaryenFunctionGetName","getFunctionParamCount","_BinaryenFunctionGetNumParams","getFunctionParamType","_BinaryenFunctionGetParam","getFunctionResultType","_BinaryenFunctionGetResult","relooper","_RelooperCreate","addBlock","_RelooperAddBlock","addBranch","from","to","_RelooperAddBranch","addBlockWithSwitch","_RelooperAddBlockWithSwitch","addBranchForSwitch","indexes","_RelooperAddBranchForSwitch","renderAndDispose","entry","labelHelper","_RelooperRenderAndDispose","u8s","numValues","i32s","val","ptrs","u","stringLengthUTF8","cp","u1","u2","u3","u4","arr","fromCodePoints","needsExplicitUnreachable","Unreachable","Return","Break","Block","numChildren","tokenizer_1","Token","nodeIsConstantValue","NULL","TRUE","FALSE","nodeIsCallable","IDENTIFIER","ASSERTION","CALL","ELEMENTACCESS","PARENTHESIZED","PROPERTYACCESS","SUPER","nodeIsGenericCallable","createTypeName","TypeName","isNullable","TypeNode","createTypeParameter","defaultType","elem","TypeParameterNode","createParameter","ParameterNode","parameterKind","parameters","explicitThisType","sig","SignatureNode","createDecorator","args","stmt","DecoratorNode","createComment","node","CommentNode","commentKind","isQuoted","IdentifierExpression","symbol","createEmptyIdentifierExpression","createArrayLiteralExpression","ArrayLiteralExpression","elementExpressions","createAssertionExpression","assertionKind","toType","AssertionExpression","createBinaryExpression","operator","BinaryExpression","createCallExpression","typeArgs","CallExpression","createClassExpression","ClassExpression","createCommaExpression","expressions","CommaExpression","createConstructorExpression","ConstructorExpression","createElementAccessExpression","ElementAccessExpression","elementExpression","createFalseExpression","FalseExpression","createFloatLiteralExpression","FloatLiteralExpression","createFunctionExpression","FunctionExpression","createInstanceOfExpression","isType","InstanceOfExpression","createIntegerLiteralExpression","IntegerLiteralExpression","createNewExpression","NewExpression","createNullExpression","NullExpression","createObjectLiteralExpression","ObjectLiteralExpression","createParenthesizedExpression","ParenthesizedExpression","createPropertyAccessExpression","PropertyAccessExpression","createRegexpLiteralExpression","pattern","RegexpLiteralExpression","patternFlags","createTernaryExpression","ifThen","ifElse","TernaryExpression","createStringLiteralExpression","StringLiteralExpression","createSuperExpression","SuperExpression","createThisExpression","ThisExpression","createTrueExpression","TrueExpression","createUnaryPostfixExpression","operand","UnaryPostfixExpression","createUnaryPrefixExpression","UnaryPrefixExpression","createBlockStatement","BlockStatement","createBreakStatement","BreakStatement","createClassDeclaration","ClassDeclaration","createContinueStatement","ContinueStatement","createDoStatement","DoStatement","createEmptyStatement","EmptyStatement","createEnumDeclaration","EnumDeclaration","createEnumValueDeclaration","EnumValueDeclaration","createExportStatement","isDeclare","ExportStatement","normalizePath","startsWith","resolvePath","mangleInternalPath","createExportImportStatement","ExportImportStatement","createExportMember","ExportMember","createExpressionStatement","ExpressionStatement","createIfStatement","IfStatement","createImportStatement","decls","ImportStatement","createImportStatementWithWildcard","createImportDeclaration","ImportDeclaration","createInterfaceDeclaration","InterfaceDeclaration","createFieldDeclaration","FieldDeclaration","createForStatement","incrementor","ForStatement","FunctionDeclaration","createIndexSignatureDeclaration","keyType","valueType","IndexSignatureDeclaration","createMethodDeclaration","MethodDeclaration","NamespaceDeclaration","createReturnStatement","ReturnStatement","createSwitchStatement","cases","SwitchStatement","createSwitchCase","SwitchCase","createThrowStatement","ThrowStatement","createTryStatement","catchVariable","catchStatements","finallyStatements","TryStatement","TypeDeclaration","createVariableStatement","VariableStatement","VariableDeclaration","createVoidStatement","VoidStatement","createWhileStatement","WhileStatement","CommonTypeNode","TYPENAME","TYPE","TYPEPARAMETER","ParameterKind","PARAMETER","implicitFieldDeclaration","SIGNATURE","nameStr","propStr","CUSTOM","DECORATOR","CommentKind","COMMENT","Expression","LiteralExpression","ARRAY","AssertionKind","BINARY","numArguments","COMMA","FLOAT","INSTANCEOF","INTEGER","NEW","OBJECT","REGEXP","TERNARY","THIS","UnaryExpression","UNARYPOSTFIX","UNARYPREFIX","Statement","SOURCE","tokenizer","exportPaths","sourceKind","pos","lastIndexOf","simplePath","ENTRY","DeclarationStatement","VariableLikeDeclarationStatement","BLOCK","BREAK","CONTINUE","DO","ENUMVALUEDECLARATION","EXPORTIMPORT","EXPORTMEMBER","EXPRESSION","FOR","ArrowKind","clone","IF","IMPORTDECLARATION","RETURN","SWITCHCASE","SWITCH","THROW","TRY","VARIABLEDECLARATION","VOID","WHILE","isTypeOmitted","program_1","module_1","TypeKind","TypeFlags","v128_zero","cachedNullableType","ceil","classReference","nonNullableType","isize64","isize32","usize64","usize32","isManaged","computeSmallIntegerShift","targetType","computeSmallIntegerMask","classType","asNullable","signednessIsRelevant","currentClass","targetClass","currentFunction","targetFunction","isStrictlyAssignableTo","commonDenominator","signednessIsImportant","toNativeType","toNativeZero","toNativeOne","toNativeNegOne","typesToNativeTypes","types","numTypes","typesToString","cachedFunctionTarget","parameterNames","requiredParameters","hasRest","asFunctionTarget","getDefaultParameterName","thisThisType","targetThisType","thisParameterTypes","targetParameterTypes","numParameters","thisParameterType","targetParameterType","thisReturnType","targetReturnType","makeSignatureString","optionalStart","restIndex","cachedDefaultParameterNames","IdentifierHandling","tokenFromKeyword","AS","ASYNC","AWAIT","CASE","CATCH","DEBUGGER","DEFAULT","DELETE","ELSE","EXTENDS","FINALLY","FROM","IMPLEMENTS","IN","IS","KEYOF","LET","MODULE","OF","PACKAGE","PRIVATE","PROTECTED","PUBLIC","TYPEOF","VAR","WITH","YIELD","tokenIsAlsoIdentifier","token","operatorTokenToString","DOT_DOT_DOT","LESSTHAN","GREATERTHAN","LESSTHAN_EQUALS","GREATERTHAN_EQUALS","EQUALS_EQUALS","EXCLAMATION_EQUALS","EQUALS_EQUALS_EQUALS","EXCLAMATION_EQUALS_EQUALS","ASTERISK_ASTERISK","ASTERISK","SLASH","PERCENT","PLUS_PLUS","MINUS_MINUS","LESSTHAN_LESSTHAN","GREATERTHAN_GREATERTHAN","GREATERTHAN_GREATERTHAN_GREATERTHAN","AMPERSAND","BAR","CARET","EXCLAMATION","TILDE","AMPERSAND_AMPERSAND","BAR_BAR","EQUALS","PLUS_EQUALS","MINUS_EQUALS","ASTERISK_EQUALS","ASTERISK_ASTERISK_EQUALS","SLASH_EQUALS","PERCENT_EQUALS","LESSTHAN_LESSTHAN_EQUALS","GREATERTHAN_GREATERTHAN_EQUALS","GREATERTHAN_GREATERTHAN_GREATERTHAN_EQUALS","AMPERSAND_EQUALS","BAR_EQUALS","CARET_EQUALS","a","b","Tokenizer","tokenPos","nextToken","nextTokenPos","nextTokenOnNewLine","onComment","identifierHandling","unsafeNext","maxTokenLength","STRINGLITERAL","chr","OPENPAREN","CLOSEPAREN","isDecimalDigit","FLOATLITERAL","DOT","commentStartPos","LINE","TRIPLE","closed","_0_expected","testInteger","INTEGERLITERAL","COLON","SEMICOLON","EQUALS_GREATERTHAN","QUESTION","OPENBRACKET","CLOSEBRACKET","OPENBRACE","CLOSEBRACE","AT","isIdentifierStart","isKeywordCharacter","posBefore","isIdentifierPart","keywordToken","ALWAYS","PREFER","isWhiteSpace","Invalid_character","ENDOFFILE","peek","checkOnNewLine","maxCompoundLength","tokenBefore","tokenPosBefore","skipIdentifier","skip","mark","state","reusableState","State","discard","reset","readIdentifier","quote","Unterminated_string_literal","readEscapeSequence","Unexpected_end_of_text","readExtendedUnicodeEscape","readUnicodeEscape","fromCharCode","readRegexpPattern","escaped","Unterminated_regular_expression_literal","readRegexpFlags","Invalid_regular_expression_flags","readInteger","readHexInteger","readBinaryInteger","readOctalInteger","isOctalDigit","Octal_literals_are_not_allowed_in_strict_mode","readDecimalInteger","i64_4","sepEnd","i64_add","i64_shl","Numeric_separators_are_not_allowed_here","Multiple_consecutive_numeric_separators_are_not_permitted","Hexadecimal_digit_expected","i64_10","i64_mul","Digit_expected","i64_3","Octal_digit_expected","i64_1","Binary_digit_expected","readFloat","readDecimalFloat","parseFloat","readHexFloat","remain","value32","invalid","An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive","Unterminated_Unicode_escape_sequence","finish","g","e","window","ReportMode","currentThisExpression","currentElementExpression","resolveType","context","reportMode","REPORT","parameterNodes","parameterNode","REST","parameterTypeNode","Type_expected","returnTypeNode","typeNode","typeArgumentNodes","possiblyPlaceholder","Type_0_is_not_generic","Basic_type_0_cannot_be_nullable","resolveClassInclTypeArguments","makeMap","Expected_0_type_arguments_but_got_1","typeArgument","resolveTypeArguments","Cannot_find_name_0","prev","Property_0_does_not_exist_on_type_1","alternativeReportNode","minParameterCount","maxParameterCount","argumentCount","resolveIdentifier","ensureResolvedLazyGlobal","resolvePropertyAccessExpression","propertyAccess","contextualType","targetExpression","resolveExpression","propertyName","indexedGet","Index_signature_is_missing_in_type_0","resolveElementAccessExpression","elementAccess","determineIntegerLiteralType","intValue","i64_is_i8","i64_is_u8","i64_is_i16","i64_is_u16","i64_is_i32","i64_is_u32","i64_is_bool","resolveAssertionExpression","resolveUnaryPrefixExpression","resolveUnaryPostfixExpression","resolveBinaryExpression","resolveThisExpression","resolveSuperExpression","actualFunction","resolveLiteralExpression","resolveCallExpression","NONNULL","i64_sub","i64_zero","thisLocal","lookupLocal","_this_cannot_be_referenced_in_current_location","superLocal","_super_can_only_be_referenced_in_a_derived_class","literalType","resolveFunctionInclTypeArguments","Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures","actualParent","resolvedInstance","classTypeArguments","classTypeParameters","numClassTypeArguments","classTypeParameterName","numFunctionTypeArguments","signatureNode","signatureParameters","numSignatureParameters","parameterDeclaration","reportNode","resolvedTypeArguments","numTypeParameters","baseClass","nameInclTypeParamters","baseMembers","baseMembers_1","baseMembers_1_1","baseMemberName","baseMember","instanceMemberPrototypes","fieldTypeNode","fieldType","baseField","atEnd","fieldInstance","boundPrototype","propertyInstance","ctorPrototype","ctorInstance","overloadPrototype","operatorInstance","builtins_1","Options","WASM32","importMemory","sharedMemory","importTable","features","feature","Feature","ConversionKind","WrapMode","mangleImportName_moduleName","mangleImportName_elementName","CompilerSymbols","Compiler","currentInlineFunctions","currentEnum","currentType","memorySegments","stringSegments","functionTable","argcVar","argcSet","needsIterateRoots","f32ModInstance","f64ModInstance","f32PowInstance","f64PowInstance","max","compile","startFunctionInstance","startFunctionBody","currentFlow","currentBody","BuiltinSymbols","HEAP_BASE","files","compileFile","compileExports","funcRef","ensureFunctionType","i64_align","isSharedMemory","i64_shr_u","makeModuleExports","compileIterateRoots","members_1","members_1_1","makeModuleExport","prefix","instanceName","fullName","setter","Cannot_export_a_mutable_global","ensureTrampoline","ensureArgcSet","COMPILED","nativeType","nativeSizeType","getterName","setterName","subPrefix","compileElement","compileMembers","compileGlobal","compileEnum","compileFunctionUsingTypeArguments","compileClassUsingTypeArguments","element_1","exportsStar_1","exportsStar_1_1","compileFileByPath","normalizedPathWithoutExtension","pathWithIndex","previousBody","previousFlow","compileTopLevelStatement","numLocals","initExpr","initializerNode","resolvedType","compileExpressionRetainType","Type_0_is_not_assignable_to_type_1","isDeclaredConstant","MODULE_IMPORT","mangleImportName","initializeInStart","compileExpression","Compiling_constant_with_non_constant_initializer_as_mutable","previousValue","previousValueIsMut","isInline","initInStart","valueNode","In_const_enum_declarations_member_initializer_must_be_constant_expression","Enum_member_must_have_initializer","AddI32","compileFunction","resultType","compileFunctionBody","stmts","bodyNode","compileStatements","MAIN","canOverflow","started","unshift","EqzI32","thisLocalIndex","EqzI64","makeAllocation","makeFieldInitialization","Constructors_for_derived_classes_must_contain_a_super_call","A_function_whose_declared_type_is_not_void_must_return_a_value","An_implementation_cannot_be_declared_in_ambient_contexts","decoratorNodes","Function_implementation_is_missing_or_not_immediately_following_the_declaration","compileClass","staticMembers","compileInterfaceDeclaration","addMemorySegment","alignment","ensureFunctionTableEntry","TRAMPOLINE","memberStatements","compileStatement","Nop","isLastStatementInBody","compileBlockStatement","compileBreakStatement","compileContinueStatement","compileDoStatement","compileEmptyStatement","compileExpressionStatement","compileForStatement","compileIfStatement","compileReturnStatement","compileSwitchStatement","compileThrowStatement","compileTryStatement","compileVariableStatement","compileVoidStatement","compileWhileStatement","addDebugLocation","isBody","numStatements","outerFlow","innerFlow","fork","freeScopedLocals","inherit","A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement","continueLabel","A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement","pushBreakLabel","condExpr","makeIsTrueish","popBreakLabel","terminated","unset","block","repeatLabel","alwaysTrue","condPre","incrExpr","bodyStatement","bodyExpr","usesContinue","inheritConditional","breakBlock","repeatBlock","condExprPrecomp","ifTrueFlow","ifTrueExpr","ifFalseExpr","ifFalseFlow","inheritMutual","inlineReturnLabel","numCases","tempLocal","getTempLocal","tempLocalIndex","breaks","breakIndex","defaultIndex","EqI32","freeTempLocal","currentBlock","alwaysReturns","alwaysReturnsWrapped","alwaysThrows","alwaysAllocates","isLast","nextLabel","count","compileAbort","numDeclarations","initializers","isInlined","parentFunction","scopedLocals","_const_declarations_must_be_initialized","addScopedLocal","compileAssignmentWithValue","setLocalWrapped","compileInlineConstant","retainType","conversionKind","wrapMode","compileAssertionExpression","compileBinaryExpression","compileCallExpression","compileCommaExpression","compileElementAccessExpression","compileFunctionExpression","compileIdentifierExpression","compileInstanceOfExpression","compileLiteralExpression","compileNewExpression","compileParenthesizedExpression","compilePropertyAccessExpression","compileTernaryExpression","compileUnaryPostfixExpression","compileUnaryPrefixExpression","convertExpression","ensureSmallIntegerWrap","fromType","Conversion_from_type_0_to_1_requires_an_explicit_cast","PromoteF32","DemoteF64","NeF32","TruncF32ToI64","TruncF32ToI32","TruncF32ToU64","TruncF32ToU32","NeF64","TruncF64ToI64","TruncF64ToI32","TruncF64ToU64","TruncF64ToU32","ConvertI64ToF32","ConvertU64ToF32","ConvertI32ToF32","ConvertU32ToF32","ConvertI64ToF64","ConvertU64ToF64","ConvertI32ToF64","ConvertU32ToF64","NeI64","WrapI64","ExtendI32","ExtendU32","PREFIX","leftExpr","leftType","rightExpr","rightType","commonType","compound","compileBinaryOverload","Operator_0_cannot_be_applied_to_types_1_and_2","LtI32","LtI64","LtU32","LtU64","LtF32","LtF64","GtI32","GtI64","GtU32","GtU64","GtF32","GtF64","LeI32","LeI64","LeU32","LeU64","LeF32","LeF64","GeI32","GeI64","GeU32","GeU64","GeF32","GeF64","EqI64","EqF32","EqF64","AllTrueVecI8x16","EqVecI8x16","NeI32","AnyTrueVecI8x16","NeVecI8x16","compileAssignment","AddI64","AddF32","AddF64","SubI32","SubI64","SubF32","SubF64","MulI32","MulI64","MulF32","MulF64","namespace","makeCallDirect","DivI32","DivI64","DivU32","DivU64","DivF32","DivF64","RemI32","RemI64","RemU32","RemU64","intType","ShlI32","ShlI64","The_0_operator_cannot_be_applied_to_type_1","ShrI32","ShrI64","ShrU32","ShrU64","AndI32","AndI64","OrI32","OrI64","XorI32","XorI64","getAndFreeTempLocal","compileUnaryOverload","valueExpr","argumentExpressions","thisArg","compileCallDirect","valueExpression","Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property","isUnchecked","indexedSet","Index_signature_in_type_0_only_permits_reading","valueWithCorrectType","tee","thisExpression","thisExpr","flow_2","nativeReturnType","thisExpr_1","elementExpr","tempLocalTarget","tempLocalElement","flow_3","Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors","baseClassInstance","ensureConstructor","_super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class","indexArg","compileCallExpressionBuiltin","inferredTypes","argumentNodes","argumentExprs","templateName","argumentExpression","inferredType","concreteType","compileCallIndirect","compileCall","checkCallSignature","hasThis","minimum","Expected_at_least_0_arguments_but_got_1","compileCallInlinePrechecked","pop","Function_0_cannot_be_inlined_into_itself","numArgumentsInclThis","createInline","baseInstance","addScopedAlias","paramExpr","argumentLocal","original","originalSignature","originalName","originalParameterTypes","originalParameterDeclarations","commonReturnType","commonThisType","minArguments","minOperands","maxArguments","maxOperands","numOptional","forwardedOperands","operandIndex","trampolineSignature","ofN","argc","Optional_parameter_must_have_an_initializer","ensureArgcVar","setargc","numOperands","isCallImport","allOptionalsAreConstant","makeCallIndirect","numExpressions","exprs","contextualSignature","numPresentParameters","thisTypeNode","maybeCompileEnclosingSource","retainConstantType","flow_4","actualFunction_1","_super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class","scopedThis","superType","localType","A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums","actualType","implicitNegate","compileArrayLiteral","floatValue","i64_to_f32","i64_to_f64","compileStringLiteral","compileObjectLiteral","ensureStaticString","stringValue","stringSegment","headerSize","totalSize","buf","writeI32","ensureGCHook","writeI16","stringOffset","ensureStaticArray","elementType","usizeTypeSize","bufferInstance","bufferHeaderSize","bufferTotalSize","clz","writeI8","writeI64","writeF32","writeF64","bufferOffset","arrayInstance","arrayHeaderSize","arrayOffset","buffer_offset","length_offset","isConst","compiledValues","constantValues","nativeElementType","arrayType","nativeArrayType","ctor","Constructor_of_class_0_must_not_require_any_arguments","Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration","Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration","hasErrors","Cannot_use_new_with_an_expression_whose_type_lacks_a_construct_signature","compileInstantiate","baseCtor","theEnum","Cannot_access_method_0_without_calling_it_as_it_requires_this_to_be_set","compileGetter","ifThenFlow","ifThenExpr","ifThenType","ifElseFlow","ifElseExpr","ifElseType","getValue","calcValue","setValue","NegF32","NegF64","makeIsFalseish","ExtendI8ToI32","ExtendI16ToI32","allocateInstance","nativeFieldType","FlowFlags","wrappedLocals","wrappedLocalsExt","inlineFunction","branch","slice","wrapped","temps","scopedLocal","existingLocal","SCOPED","scopedAlias","scope","isLocalWrapped","bitsetIs","ext","bitsetSet","id","stack","other","i64_and","leftExt","rightExt","thisExt","minLength","min","canConversionOverflow","SetLocal","global_1","ClzI32","CtzI32","PopcntI32","MIN_VALUE","last","If","Select","Call","Decompiler","functionId","decompile","decompiler","decompileFunction","nativeTypeToType","decompileExpression","nested","Loop","Switch","CallIndirect","SetGlobal","Store","i64_to_string","AbsF32","CeilF32","FloorF32","TruncF32","NearestF32","SqrtF32","ClzI64","CtzI64","PopcntI64","AbsF64","CeilF64","FloorF64","TruncF64","NearestF64","SqrtF64","ReinterpretF32","ReinterpretF64","ReinterpretI32","ReinterpretI64","RotlI32","RotrI32","RotlI64","RotrI64","CopysignF32","MinF32","MaxF32","CopysignF64","MinF64","MaxF64","Drop","Host","CurrentMemory","GrowMemory","AtomicCmpxchg","AtomicRMW","AtomicWait","AtomicNotify","Auto","ExportsWalker","includePrivate","todo","seen","Set","walk","visitElement","visitGlobal","visitEnum","visitFunctionInstances","visitClassInstances","visitField","visitPropertyInstances","prop","visitFunction","hasCompiledMember","visitNamespace","visitClass","IDLBuilder","indentLevel","build","indent","typeToString","visitInterface","TSDBuilder","numMembers","members_2","members_2_1","isInterface","Parser","backlog","seenlog","donelog","tryParseSignatureIsSignature","parseParametersThis","parseFile","indexOf","tn","parseTopLevelStatement","startPos","parseDecorator","skipStatement","exportStart","exportEnd","contextIsAmbient","A_declare_modifier_cannot_be_used_in_an_already_ambient_context","first","parseEnum","parseVariable","parseFunction","parseStatement","parseClassOrInterface","parseNamespace","parseExportImport","parseImport","parseTypeDeclaration","parseExport","_0_modifier_cannot_be_used_here","Decorators_are_not_valid_here","nextFile","clear","parseType","acceptParenthesized","suppressErrors","isNullableSignature","tryParseSignature","Unexpected_token","innerType","Identifier_expected","nullable","parameter","bracketStart","bracketRange","isSignature","A_rest_parameter_cannot_be_optional","OPTIONAL","param","parseArguments","parseVariableDeclaration","parentFlags","parentDecorators","DEFINITE_ASSIGNMENT","Initializers_are_not_allowed_in_ambient_contexts","parseExpression","A_definite_assignment_assertion_is_not_permitted_in_this_context","parseEnumValue","parseReturn","parseTypeParameters","seenOptional","typeParameter","parseTypeParameter","Required_type_parameters_may_not_follow_optional_type_parameters","Type_parameter_list_cannot_be_empty","parseParameters","isConstructor","seenRest","reportedRest","parseParameter","A_rest_parameter_must_be_last_in_a_parameter_list","A_required_parameter_cannot_follow_an_optional_parameter","isRest","isOptional","startRange","accessFlags","A_parameter_property_cannot_be_declared_using_a_rest_parameter","A_rest_parameter_cannot_have_an_initializer","Parameter_cannot_have_question_mark_and_initializer","signatureStart","isSetter","A_set_accessor_must_have_exactly_one_parameter","A_set_accessor_parameter_cannot_have_an_initializer","A_get_accessor_cannot_have_parameters","parseBlockStatement","parseFunctionExpression","parseFunctionExpressionCommon","bodyExpression","Interface_declaration_cannot_have_implements_clause","parseClassMember","parseClassExpression","VIRTUAL","accessStart","accessEnd","staticStart","staticEnd","abstractStart","abstractEnd","GENERIC_CONTEXT","readonlyStart","readonlyEnd","setEnd","retIndex","parseIndexSignatureDeclaration","typeParametersStart","Type_parameters_cannot_appear_on_a_constructor_declaration","An_accessor_cannot_have_type_parameters","Type_annotation_cannot_appear_on_a_constructor_declaration","A_set_accessor_cannot_have_a_return_type_annotation","Method_0_cannot_have_an_implementation_because_it_is_marked_abstract","retMethod","Constructor_implementation_is_missing","Optional_properties_are_not_supported","retField","parseExportMember","asIdentifier","skipFrom","parseImportDeclaration","topLevel","parseBreak","parseContinue","parseDoStatement","parseForStatement","parseIfStatement","A_return_statement_can_only_be_used_within_a_function_body","parseSwitchStatement","parseThrowStatement","parseTryStatement","parseVoidStatement","parseWhileStatement","parseExpressionStatement","elseStatement","case_","parseSwitchCase","_case_or_default_expected","parseExpressionStart","precedence","determinePrecedenceStart","The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access","again","startPos_1","_super_must_be_followed_by_an_argument_list_or_member_access","regexpPattern","Expression_expected","tryParseTypeArgumentsBeforeArguments","nextPrecedence","maybeParseCallExpression","determinePrecedence","commaExprs","isRightAssociative","joinPropertyCall","callee","inner","skipBlock","depth","Precedence","binaryen","wrapModule","emitStackIR","emitAsmjs","Binaryen","__memory_allocate","_malloc","__memory_free","_free","__memory_copy","_memmove","__store","HEAPU8","__load","globalScope","Float64Array","Uint32Array","UnreachableError","captureStackTrace","AssertionError","defineProperties","writable","fround","EPSILON","MIN_NORMAL_VALUE","MIN_SAFE_INTEGER","MAX_SAFE_INTEGER","clz32","abs","floor","trunc","round","sqrt","y","sign","isTrueish","radix","parseInt","undefined","fromCodePoint","Number","isInteger","isArray","sincos_sin","sincos_cos","signbit","Boolean","sincos","sin","cos","HEAP","HEAP_OFFSET","oldHeap","fill","copy","copyWithin","Float32Array","Int32Array","f32_as_i32","i32_as_f32","f64_as_i64","i64_as_f64","Long","ZERO","i64_one","ONE","lo","hi","fromBits","low","high","sub","mul","i64_div","div","i64_div_u","toUnsigned","toSigned","i64_rem","i64_rem_u","and","i64_or","or","i64_xor","xor","shl","i64_shr","shr","shru","i64_not","not","i64_eq","eq","i64_ne","ne","fromInt","minSafeF32","fromNumber","maxSafeF32","i64_is_f32","gte","lte","minSafeF64","maxSafeF64","i64_is_f64","toNumber","unsigned","wasm","WebAssembly","Instance","isLong","obj","__isLong__","INT_CACHE","UINT_CACHE","cachedObj","cache","isNaN","UZERO","TWO_PWR_64_DBL","MAX_UNSIGNED_VALUE","TWO_PWR_63_DBL","neg","TWO_PWR_32_DBL","lowBits","highBits","pow_dbl","fromString","RangeError","radixToPower","power","fromValue","TWO_PWR_16_DBL","TWO_PWR_24","UONE","NEG_ONE","LongPrototype","toInt","isZero","isNegative","radixLong","rem1","rem","remDiv","digits","getHighBits","getHighBitsUnsigned","getLowBits","getLowBitsUnsigned","getNumBitsAbs","bit","eqz","isPositive","isOdd","isEven","equals","notEquals","neq","lessThan","comp","lt","lessThanOrEqual","le","greaterThan","gt","greaterThanOrEqual","ge","compare","thisNeg","otherNeg","negate","addend","a48","a32","a16","a00","b48","b32","b16","c48","c32","c16","c00","subtract","subtrahend","multiply","multiplier","get_high","b00","divide","divisor","approx","res","div_u","div_s","log2","log","LN2","delta","approxRes","approxRem","modulo","rem_u","rem_s","shiftLeft","numBits","shiftRight","shiftRightUnsigned","shr_u","toBytes","toBytesLE","toBytesBE","fromBytes","fromBytesLE","fromBytesBE","compiler","isAsm","evaluateConstantType","isFloat","isSigned","isReference","isString","isArrayLike","isFunction","isDefined","checkTypeAbsent","checkArgsRequired","SWALLOW","isConstant","sizeof","checkTypeRequired","alignof","alignLog2","ctz","checkArgsOptional","typeArgumentsRange","Type_0_has_no_property_1","popcnt","checkTypeOptional","rotl","rotr","tempLocal1","tempLocalIndex2","tempLocalIndex1","wasm64","tempLocal0","copysign","nearest","reinterpret","outType","immOffset","evaluateImmediateOffset","immAlign","naturalAlign","_0_must_be_a_value_between_1_and_2_inclusive","_0_must_be_a_power_of_two","inType","atomic_load","atomic_store","atomic_add","atomic_sub","atomic_and","atomic_or","atomic_xor","atomic_xchg","Add","Sub","And","Or","Xor","Xchg","atomic_cmpxchg","atomic_wait","atomic_notify","select","unreachable","memory_size","memory_grow","memory_copy","memory_fill","alreadyUnchecked","call_indirect","arg0Type","operandExprs","nativeParamTypes","operandType","instantiate","User_defined_0","Expression_must_be_a_compile_time_constant","off","v128_splat","SplatVecI8x16","SplatVecI16x8","SplatVecI32x4","SplatVecI64x2","SplatVecF32x4","SplatVecF64x2","v128_extract_lane","ExtractLaneSVecI8x16","ExtractLaneUVecI8x16","ExtractLaneSVecI16x8","ExtractLaneUVecI16x8","ExtractLaneVecI32x4","ExtractLaneVecI64x2","ExtractLaneVecF32x4","ExtractLaneVecF64x2","maxIdx","v128_replace_lane","ReplaceLaneVecI8x16","ReplaceLaneVecI16x8","ReplaceLaneVecI32x4","ReplaceLaneVecI64x2","ReplaceLaneVecF32x4","ReplaceLaneVecF64x2","v128_shuffle","laneWidth","laneCount","argN","off8","idx8","v128_add","v128_sub","v128_mul","v128_div","v128_add_saturate","v128_sub_saturate","v128_min","v128_max","v128_eq","v128_ne","v128_lt","v128_le","v128_gt","v128_ge","AddVecI8x16","AddVecI16x8","AddVecI32x4","AddVecI64x2","AddVecF32x4","AddVecF64x2","SubVecI8x16","SubVecI16x8","SubVecI32x4","SubVecI64x2","SubVecF32x4","SubVecF64x2","MulVecI8x16","MulVecI16x8","MulVecI32x4","MulVecF32x4","MulVecF64x2","DivVecF32x4","DivVecF64x2","AddSatSVecI8x16","AddSatUVecI8x16","AddSatSVecI16x8","AddSatUVecI16x8","SubSatSVecI8x16","SubSatUVecI8x16","SubSatSVecI16x8","SubSatUVecI16x8","MinVecF32x4","MinVecF64x2","MaxVecF32x4","MaxVecF64x2","EqVecI16x8","EqVecI32x4","EqVecF32x4","EqVecF64x2","NeVecI16x8","NeVecI32x4","NeVecF32x4","NeVecF64x2","LtSVecI8x16","LtUVecI8x16","LtSVecI16x8","LtUVecI16x8","LtSVecI32x4","LtUVecI32x4","LtVecF32x4","LtVecF64x2","LeSVecI8x16","LeUVecI8x16","LeSVecI16x8","LeUVecI16x8","LeSVecI32x4","LeUVecI32x4","LeVecF32x4","LeVecF64x2","GtSVecI8x16","GtUVecI8x16","GtSVecI16x8","GtUVecI16x8","GtSVecI32x4","GtUVecI32x4","GtVecF32x4","GtVecF64x2","GeSVecI8x16","GeUVecI8x16","GeSVecI16x8","GeUVecI16x8","GeSVecI32x4","GeUVecI32x4","GeVecF32x4","GeVecF64x2","v128_neg","v128_abs","v128_sqrt","v128_convert","v128_trunc","NegVecI8x16","NegVecI16x8","NegVecI32x4","NegVecI64x2","NegVecF32x4","NegVecF64x2","AbsVecF32x4","AbsVecF64x2","SqrtVecF32x4","SqrtVecF64x2","ConvertSVecI32x4ToVecF32x4","ConvertUVecI32x4ToVecF32x4","ConvertSVecI64x2ToVecF64x2","ConvertUVecI64x2ToVecF64x2","TruncSatSVecF32x4ToVecI32x4","TruncSatUVecF32x4ToVecI32x4","TruncSatSVecF64x2ToVecI64x2","TruncSatUVecF64x2ToVecI64x2","v128_shl","v128_shr","ShlVecI8x16","ShlVecI16x8","ShlVecI32x4","ShlVecI64x2","ShrSVecI8x16","ShrUVecI8x16","ShrSVecI16x8","ShrUVecI16x8","ShrSVecI32x4","ShrUVecI32x4","ShrSVecI64x2","ShrUVecI64x2","v128_and","v128_or","v128_xor","AndVec128","OrVec128","XorVec128","v128_not","NotVec128","v128_bitselect","v128_any_true","v128_all_true","AnyTrueVecI16x8","AnyTrueVecI32x4","AnyTrueVecI64x2","AllTrueVecI16x8","AllTrueVecI32x4","AllTrueVecI64x2","iterateRoots","i32_clz","deferASM","i64_clz","i32_ctz","i64_ctz","i32_popcnt","i64_popcnt","i32_rotl","i64_rotl","i32_rotr","i64_rotr","f32_abs","f64_abs","f32_max","f64_max","f32_min","f64_min","f32_ceil","f64_ceil","f32_floor","f64_floor","f32_copysign","f64_copysign","f32_nearest","f64_nearest","i32_reinterpret_f32","i64_reinterpret_f64","f32_reinterpret_i32","f64_reinterpret_i64","f32_sqrt","f64_sqrt","f32_trunc","f64_trunc","i32_load8_s","i32_load8_u","i32_load16_s","i32_load16_u","i32_load","i64_load8_s","i64_load8_u","i64_load16_s","i64_load16_u","i64_load32_s","i64_load32_u","i64_load","f32_load","f64_load","i32_store8","i32_store16","i32_store","i64_store8","i64_store16","i64_store32","i64_store","f32_store","f64_store","i32_atomic_load8_u","i32_atomic_load16_u","i32_atomic_load","i64_atomic_load8_u","i64_atomic_load16_u","i64_atomic_load32_u","i64_atomic_load","i32_atomic_store8","i32_atomic_store16","i32_atomic_store","i64_atomic_store8","i64_atomic_store16","i64_atomic_store32","i64_atomic_store","i32_atomic_rmw8_add_u","i32_atomic_rmw16_add_u","i32_atomic_rmw_add","i64_atomic_rmw8_add_u","i64_atomic_rmw16_add_u","i64_atomic_rmw32_add_u","i64_atomic_rmw_add","i32_atomic_rmw8_sub_u","i32_atomic_rmw16_sub_u","i32_atomic_rmw_sub","i64_atomic_rmw8_sub_u","i64_atomic_rmw16_sub_u","i64_atomic_rmw32_sub_u","i64_atomic_rmw_sub","i32_atomic_rmw8_and_u","i32_atomic_rmw16_and_u","i32_atomic_rmw_and","i64_atomic_rmw8_and_u","i64_atomic_rmw16_and_u","i64_atomic_rmw32_and_u","i64_atomic_rmw_and","i32_atomic_rmw8_or_u","i32_atomic_rmw16_or_u","i32_atomic_rmw_or","i64_atomic_rmw8_or_u","i64_atomic_rmw16_or_u","i64_atomic_rmw32_or_u","i64_atomic_rmw_or","i32_atomic_rmw8_u_xor","i32_atomic_rmw16_u_xor","i32_atomic_rmw_xor","i64_atomic_rmw8_xor_u","i64_atomic_rmw16_xor_u","i64_atomic_rmw32_xor_u","i64_atomic_rmw_xor","i32_atomic_rmw8_xchg_u","i32_atomic_rmw16_xchg_u","i32_atomic_rmw_xchg","i64_atomic_rmw8_xchg_u","i64_atomic_rmw16_xchg_u","i64_atomic_rmw32_xchg_u","i64_atomic_rmw_xchg","i32_atomic_rmw8_cmpxchg_u","i32_atomic_rmw16_cmpxchg_u","i32_atomic_rmw_cmpxchg","i64_atomic_rmw8_cmpxchg_u","i64_atomic_rmw16_cmpxchg_u","i64_atomic_rmw32_cmpxchg_u","i64_atomic_rmw_cmpxchg","i32_wait","i64_wait","v128_load","v128_store","i8x16_splat","i8x16_extract_lane_s","i8x16_extract_lane_u","i8x16_replace_lane","i8x16_add","i8x16_sub","i8x16_mul","i8x16_neg","i8x16_add_saturate_s","i8x16_add_saturate_u","i8x16_sub_saturate_s","i8x16_sub_saturate_u","i8x16_shl","i8x16_shr_s","i8x16_shr_u","i8x16_any_true","i8x16_all_true","i8x16_eq","i8x16_ne","i8x16_lt_s","i8x16_lt_u","i8x16_le_s","i8x16_le_u","i8x16_gt_s","i8x16_gt_u","i8x16_ge_s","i8x16_ge_u","i16x8_splat","i16x8_extract_lane_s","i16x8_extract_lane_u","i16x8_replace_lane","i16x8_add","i16x8_sub","i16x8_mul","i16x8_neg","i16x8_add_saturate_s","i16x8_add_saturate_u","i16x8_sub_saturate_s","i16x8_sub_saturate_u","i16x8_shl","i16x8_shr_s","i16x8_shr_u","i16x8_any_true","i16x8_all_true","i16x8_eq","i16x8_ne","i16x8_lt_s","i16x8_lt_u","i16x8_le_s","i16x8_le_u","i16x8_gt_s","i16x8_gt_u","i16x8_ge_s","i16x8_ge_u","i32x4_splat","i32x4_extract_lane","i32x4_replace_lane","i32x4_add","i32x4_sub","i32x4_mul","i32x4_neg","i32x4_shl","i32x4_shr_s","i32x4_shr_u","i32x4_any_true","i32x4_all_true","i32x4_eq","i32x4_ne","i32x4_lt_s","i32x4_lt_u","i32x4_le_s","i32x4_le_u","i32x4_gt_s","i32x4_gt_u","i32x4_ge_s","i32x4_ge_u","i32x4_trunc_s_f32x4_sat","i32x4_trunc_u_f32x4_sat","i64x2_splat","i64x2_extract_lane","i64x2_replace_lane","i64x2_add","i64x2_sub","i64x2_neg","i64x2_shl","i64x2_shr_s","i64x2_shr_u","i64x2_any_true","i64x2_all_true","i64x2_trunc_s_f64x2_sat","i64x2_trunc_u_f64x2_sat","f32x4_splat","f32x4_extract_lane","f32x4_replace_lane","f32x4_add","f32x4_sub","f32x4_mul","f32x4_div","f32x4_neg","f32x4_min","f32x4_max","f32x4_abs","f32x4_sqrt","f32x4_eq","f32x4_ne","f32x4_lt","f32x4_le","f32x4_gt","f32x4_ge","f32x4_convert_s_i32x4","f32x4_convert_u_i32x4","f64x2_splat","f64x2_extract_lane","f64x2_replace_lane","f64x2_add","f64x2_sub","f64x2_mul","f64x2_div","f64x2_neg","f64x2_min","f64x2_max","f64x2_abs","f64x2_sqrt","f64x2_eq","f64x2_ne","f64x2_lt","f64x2_le","f64x2_gt","f64x2_ge","f64x2_convert_s_i64x2","f64x2_convert_u_i64x2","v8x16_shuffle","tryDeferASM","messageArg","filenameArg","argumentsRange","setCurrentTypeOnError","expectedMinimum","expectedMaximum","existingIndex","isDeclaredInLibrary","gcPrototype","gcInstance","nativeSizeSize","funcName","map","isSet","CharCode","lookupInUnicodeMap","unicodeIdentifierStart","unicodeIdentifierPart","mid","midVal","makeArray","cloned","makeSet","original_1","original_1_1","v","overrides","original_2","original_2_1","overrides_1","overrides_1_1","overrides_2","overrides_2_1","separator","ipos","dirname","origin","indentX1","indentX2","indentX4","readI32","readI64","readI8","readI16","readF32","readF64","valueI64","decompiler_1","definitions_1","formatDiagnostic","parser_1","parser","nextDiagnostic","isInfo","isWarning","isError","createOptions","setTarget","setNoAssert","setImportMemory","setSharedMemory","setImportTable","setSourceMap","setMemoryBase","setGlobalAlias","FEATURE_SIGN_EXTENSION","FEATURE_MUTABLE_GLOBAL","FEATURE_BULK_MEMORY","FEATURE_SIMD","FEATURE_THREADS","enableFeature","setOptimizeLevelHints","optimizeLevel","shrinkLevel","finishParsing","compileProgram","decompileModule","buildIDL","buildTSD"],"mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,EAAAG,QAAA,aACA,mBAAAC,eAAAC,IACAD,OAAA,aAAAJ,GACA,iBAAAC,QACAA,QAAA,eAAAD,EAAAG,QAAA,aAEAJ,EAAA,eAAAC,EA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A55B,WAAWJ,MAAM3gE,IAI1B,IAAA/V,EAAAxL,EAAA,GAAST,EAAAoD,eAAA6I,EAAA7I,eAGT8E,EAAAzH,EAAA,IAEAyH,EAAAzH,EAAA,IACAyH,EAAAzH,EAAA,KACAyH,EAAAzH,EAAA,KACAyH,EAAAzH,EAAA,KACAyH,EAAAzH,EAAA,KACAyH,EAAAzH,EAAA,IACAyH,EAAAzH,EAAA,KACAyH,EAAAzH,EAAA,IACAyH,EAAAzH,EAAA,KACAyH,EAAAzH,EAAA,IACAyH,EAAAzH,EAAA,IACAyH,EAAAzH,EAAA,IACAyH,EAAAzH,EAAA,IACAyH,EAAAzH,EAAA","file":"assemblyscript.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"binaryen\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"binaryen\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"assemblyscript\"] = factory(require(\"binaryen\"));\n\telse\n\t\troot[\"assemblyscript\"] = factory(root[\"binaryen\"]);\n})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE__19__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 16);\n","/**\r\n * Common constants.\r\n * @module common\r\n *//***/\r\n\r\n/** Indicates traits of a {@link Node} or {@link Element}. */\r\nexport enum CommonFlags {\r\n /** No flags set. */\r\n NONE = 0,\r\n\r\n // Basic modifiers\r\n\r\n /** Has an `import` modifier. */\r\n IMPORT = 1 << 0,\r\n /** Has an `export` modifier. */\r\n EXPORT = 1 << 1,\r\n /** Has a `declare` modifier. */\r\n DECLARE = 1 << 2,\r\n /** Has a `const` modifier. */\r\n CONST = 1 << 3,\r\n /** Has a `let` modifier. */\r\n LET = 1 << 4,\r\n /** Has a `static` modifier. */\r\n STATIC = 1 << 5,\r\n /** Has a `readonly` modifier. */\r\n READONLY = 1 << 6,\r\n /** Has an `abstract` modifier. */\r\n ABSTRACT = 1 << 7,\r\n /** Has a `public` modifier. */\r\n PUBLIC = 1 << 8,\r\n /** Has a `private` modifier. */\r\n PRIVATE = 1 << 9,\r\n /** Has a `protected` modifier. */\r\n PROTECTED = 1 << 10,\r\n /** Has a `get` modifier. */\r\n GET = 1 << 11,\r\n /** Has a `set` modifier. */\r\n SET = 1 << 12,\r\n /** Has a definite assignment assertion `!` as in `x!: i32;`. */\r\n DEFINITE_ASSIGNMENT = 1 << 13,\r\n\r\n // Extended modifiers usually derived from basic modifiers\r\n\r\n /** Is ambient, that is either declared or nested in a declared element. */\r\n AMBIENT = 1 << 14,\r\n /** Is generic. */\r\n GENERIC = 1 << 15,\r\n /** Is part of a generic context. */\r\n GENERIC_CONTEXT = 1 << 16,\r\n /** Is an instance member. */\r\n INSTANCE = 1 << 17,\r\n /** Is a constructor. */\r\n CONSTRUCTOR = 1 << 18,\r\n /** Is a module export. */\r\n MODULE_EXPORT = 1 << 19,\r\n /** Is a module import. */\r\n MODULE_IMPORT = 1 << 20,\r\n\r\n // Compilation states\r\n\r\n /** Is resolved. */\r\n RESOLVED = 1 << 21,\r\n /** Is compiled. */\r\n COMPILED = 1 << 22,\r\n /** Has a constant value and is therefore inlined. */\r\n INLINED = 1 << 23,\r\n /** Is scoped. */\r\n SCOPED = 1 << 24,\r\n /** Is a trampoline. */\r\n TRAMPOLINE = 1 << 25,\r\n /** Is a virtual method. */\r\n VIRTUAL = 1 << 26,\r\n /** Is the main function. */\r\n MAIN = 1 << 27,\r\n\r\n // Other\r\n\r\n QUOTED = 1 << 28\r\n}\r\n\r\n/** Path delimiter inserted between file system levels. */\r\nexport const PATH_DELIMITER = \"/\";\r\n/** Substitution used to indicate the parent directory. */\r\nexport const PARENT_SUBST = \"..\";\r\n/** Function name prefix used for getters. */\r\nexport const GETTER_PREFIX = \"get:\";\r\n/** Function name prefix used for setters. */\r\nexport const SETTER_PREFIX = \"set:\";\r\n/** Delimiter used between class names and instance members. */\r\nexport const INSTANCE_DELIMITER = \"#\";\r\n/** Delimiter used between class and namespace names and static members. */\r\nexport const STATIC_DELIMITER = \".\";\r\n/** Delimiter used between a function and its inner elements. */\r\nexport const INNER_DELIMITER = \"~\";\r\n/** Substitution used to indicate a library directory. */\r\nexport const LIBRARY_SUBST = \"~lib\";\r\n/** Library directory prefix. */\r\nexport const LIBRARY_PREFIX = LIBRARY_SUBST + PATH_DELIMITER;\r\n/** Path index suffix. */\r\nexport const INDEX_SUFFIX = PATH_DELIMITER + \"index\";\r\n\r\n/** Common compiler symbols. */\r\nexport namespace CommonSymbols {\r\n // special\r\n export const EMPTY = \"\";\r\n // types\r\n export const i8 = \"i8\";\r\n export const i16 = \"i16\";\r\n export const i32 = \"i32\";\r\n export const i64 = \"i64\";\r\n export const isize = \"isize\";\r\n export const u8 = \"u8\";\r\n export const u16 = \"u16\";\r\n export const u32 = \"u32\";\r\n export const u64 = \"u64\";\r\n export const usize = \"usize\";\r\n export const bool = \"bool\";\r\n export const f32 = \"f32\";\r\n export const f64 = \"f64\";\r\n export const v128 = \"v128\";\r\n export const i8x16 = \"i8x16\";\r\n export const u8x16 = \"u8x16\";\r\n export const i16x8 = \"i16x8\";\r\n export const u16x8 = \"u16x8\";\r\n export const i32x4 = \"i32x4\";\r\n export const u32x4 = \"u32x4\";\r\n export const i64x2 = \"i64x2\";\r\n export const u64x2 = \"u64x2\";\r\n export const f32x4 = \"f32x4\";\r\n export const f64x2 = \"f64x2\";\r\n export const void_ = \"void\";\r\n export const number = \"number\";\r\n export const boolean = \"boolean\";\r\n export const string = \"string\";\r\n export const native = \"native\";\r\n // aliases\r\n export const null_ = \"null\";\r\n export const true_ = \"true\";\r\n export const false_ = \"false\";\r\n // objects\r\n export const this_ = \"this\";\r\n export const super_ = \"super\";\r\n export const constructor = \"constructor\";\r\n}\r\n\r\n/** Common standard library symbols. */\r\nexport namespace LibrarySymbols {\r\n // constants\r\n export const ASC_TARGET = \"ASC_TARGET\";\r\n export const ASC_NO_TREESHAKING = \"ASC_NO_TREESHAKING\";\r\n export const ASC_NO_ASSERT = \"ASC_NO_ASSERT\";\r\n export const ASC_MEMORY_BASE = \"ASC_MEMORY_BASE\";\r\n export const ASC_OPTIMIZE_LEVEL = \"ASC_OPTIMIZE_LEVEL\";\r\n export const ASC_SHRINK_LEVEL = \"ASC_SHRINK_LEVEL\";\r\n export const ASC_FEATURE_MUTABLE_GLOBAL = \"ASC_FEATURE_MUTABLE_GLOBAL\";\r\n export const ASC_FEATURE_SIGN_EXTENSION = \"ASC_FEATURE_SIGN_EXTENSION\";\r\n export const ASC_FEATURE_BULK_MEMORY = \"ASC_FEATURE_BULK_MEMORY\";\r\n export const ASC_FEATURE_SIMD = \"ASC_FEATURE_SIMD\";\r\n export const ASC_FEATURE_THREADS = \"ASC_FEATURE_THREADS\";\r\n // classes\r\n export const I8 = \"I8\";\r\n export const I16 = \"I16\";\r\n export const I32 = \"I32\";\r\n export const I64 = \"I64\";\r\n export const Isize = \"Isize\";\r\n export const U8 = \"U8\";\r\n export const U16 = \"U16\";\r\n export const U32 = \"U32\";\r\n export const U64 = \"U64\";\r\n export const Usize = \"Usize\";\r\n export const Bool = \"Bool\";\r\n export const F32 = \"F32\";\r\n export const F64 = \"F64\";\r\n export const V128 = \"V128\";\r\n export const String = \"String\";\r\n export const Array = \"Array\";\r\n export const ArrayBuffer = \"ArrayBuffer\";\r\n export const Math = \"Math\";\r\n export const Mathf = \"Mathf\";\r\n // runtime\r\n export const memory = \"memory\";\r\n export const allocate = \"allocate\";\r\n export const abort = \"abort\";\r\n export const main = \"main\";\r\n // other\r\n export const length = \"length\";\r\n export const byteLength = \"byteLength\";\r\n export const pow = \"pow\";\r\n export const mod = \"mod\";\r\n}\r\n","/**\r\n * Various compiler utilities.\r\n * @module util\r\n * @preferred\r\n *//***/\r\n\r\nexport * from \"./bitset\";\r\nexport * from \"./charcode\";\r\nexport * from \"./collections\";\r\nexport * from \"./path\";\r\nexport * from \"./text\";\r\nexport * from \"./binary\";\r\n\r\n/** Tests if `x` is a power of two. */\r\nexport function isPowerOf2(x: i32): bool {\r\n return x != 0 && (x & (x - 1)) == 0;\r\n}\r\n","/**\r\n * Shared diagnostic handling inherited by the parser and the compiler.\r\n * @module diagnostics\r\n * @preferred\r\n *//***/\r\n\r\nimport {\r\n Range\r\n} from \"./ast\";\r\n\r\nimport {\r\n DiagnosticCode,\r\n diagnosticCodeToString\r\n} from \"./diagnosticMessages.generated\";\r\n\r\nimport {\r\n isLineBreak\r\n} from \"./util\";\r\n\r\nexport {\r\n DiagnosticCode,\r\n diagnosticCodeToString\r\n} from \"./diagnosticMessages.generated\";\r\n\r\n/** Indicates the category of a {@link DiagnosticMessage}. */\r\nexport enum DiagnosticCategory {\r\n /** Informatory message. */\r\n INFO,\r\n /** Warning message. */\r\n WARNING,\r\n /** Error message. */\r\n ERROR\r\n}\r\n\r\n/** Returns the string representation of the specified diagnostic category. */\r\nexport function diagnosticCategoryToString(category: DiagnosticCategory): string {\r\n switch (category) {\r\n case DiagnosticCategory.INFO: return \"INFO\";\r\n case DiagnosticCategory.WARNING: return \"WARNING\";\r\n case DiagnosticCategory.ERROR: return \"ERROR\";\r\n default: {\r\n assert(false);\r\n return \"\";\r\n }\r\n }\r\n}\r\n\r\n/** ANSI escape sequence for blue foreground. */\r\nexport const COLOR_BLUE: string = \"\\u001b[96m\";\r\n/** ANSI escape sequence for yellow foreground. */\r\nexport const COLOR_YELLOW: string = \"\\u001b[93m\";\r\n/** ANSI escape sequence for red foreground. */\r\nexport const COLOR_RED: string = \"\\u001b[91m\";\r\n/** ANSI escape sequence to reset the foreground color. */\r\nexport const COLOR_RESET: string = \"\\u001b[0m\";\r\n\r\n/** Returns the ANSI escape sequence for the specified category. */\r\nexport function diagnosticCategoryToColor(category: DiagnosticCategory): string {\r\n switch (category) {\r\n case DiagnosticCategory.INFO: return COLOR_BLUE;\r\n case DiagnosticCategory.WARNING: return COLOR_YELLOW;\r\n case DiagnosticCategory.ERROR: return COLOR_RED;\r\n default: {\r\n assert(false);\r\n return \"\";\r\n }\r\n }\r\n}\r\n\r\n/** Represents a diagnostic message. */\r\nexport class DiagnosticMessage {\r\n\r\n /** Message code. */\r\n code: i32;\r\n /** Message category. */\r\n category: DiagnosticCategory;\r\n /** Message text. */\r\n message: string;\r\n /** Respective source range, if any. */\r\n range: Range | null = null;\r\n /** Related range, if any. */\r\n relatedRange: Range | null = null;\r\n\r\n /** Constructs a new diagnostic message. */\r\n private constructor(code: i32, category: DiagnosticCategory, message: string) {\r\n this.code = code;\r\n this.category = category;\r\n this.message = message;\r\n }\r\n\r\n /** Creates a new diagnostic message of the specified category. */\r\n static create(\r\n code: DiagnosticCode,\r\n category: DiagnosticCategory,\r\n arg0: string | null = null,\r\n arg1: string | null = null,\r\n arg2: string | null = null\r\n ): DiagnosticMessage {\r\n var message = diagnosticCodeToString(code);\r\n if (arg0 != null) message = message.replace(\"{0}\", arg0);\r\n if (arg1 != null) message = message.replace(\"{1}\", arg1);\r\n if (arg2 != null) message = message.replace(\"{2}\", arg2);\r\n return new DiagnosticMessage(code, category, message);\r\n }\r\n\r\n /** Creates a new informatory diagnostic message. */\r\n static createInfo(\r\n code: DiagnosticCode,\r\n arg0: string | null = null,\r\n arg1: string | null = null\r\n ): DiagnosticMessage {\r\n return DiagnosticMessage.create(code, DiagnosticCategory.INFO, arg0, arg1);\r\n }\r\n\r\n /** Creates a new warning diagnostic message. */\r\n static createWarning(\r\n code: DiagnosticCode,\r\n arg0: string | null = null,\r\n arg1: string | null = null\r\n ): DiagnosticMessage {\r\n return DiagnosticMessage.create(code, DiagnosticCategory.WARNING, arg0, arg1);\r\n }\r\n\r\n /** Creates a new error diagnostic message. */\r\n static createError(\r\n code: DiagnosticCode,\r\n arg0: string | null = null,\r\n arg1: string | null = null\r\n ): DiagnosticMessage {\r\n return DiagnosticMessage.create(code, DiagnosticCategory.ERROR, arg0, arg1);\r\n }\r\n\r\n /** Adds a source range to this message. */\r\n withRange(range: Range): this {\r\n this.range = range;\r\n return this;\r\n }\r\n\r\n /** Adds a related source range to this message. */\r\n withRelatedRange(range: Range): this {\r\n this.relatedRange = range;\r\n return this;\r\n }\r\n\r\n /** Converts this message to a string. */\r\n toString(): string {\r\n if (this.range) {\r\n return (\r\n diagnosticCategoryToString(this.category) +\r\n \" \" +\r\n this.code.toString(10) +\r\n \": \\\"\" +\r\n this.message +\r\n \"\\\" in \" +\r\n this.range.source.normalizedPath +\r\n \":\" +\r\n this.range.line.toString(10) +\r\n \":\" +\r\n this.range.column.toString(10)\r\n );\r\n }\r\n return (\r\n diagnosticCategoryToString(this.category) +\r\n \" \" +\r\n this.code.toString(10) +\r\n \": \" +\r\n this.message\r\n );\r\n }\r\n}\r\n\r\n/** Formats a diagnostic message, optionally with terminal colors and source context. */\r\nexport function formatDiagnosticMessage(\r\n message: DiagnosticMessage,\r\n useColors: bool = false,\r\n showContext: bool = false\r\n): string {\r\n\r\n // general information\r\n var sb: string[] = [];\r\n if (useColors) sb.push(diagnosticCategoryToColor(message.category));\r\n sb.push(diagnosticCategoryToString(message.category));\r\n if (useColors) sb.push(COLOR_RESET);\r\n sb.push(message.code < 1000 ? \" AS\" : \" TS\");\r\n sb.push(message.code.toString(10));\r\n sb.push(\": \");\r\n sb.push(message.message);\r\n\r\n // include range information if available\r\n if (message.range) {\r\n\r\n // include context information if requested\r\n let range = message.range;\r\n if (showContext) {\r\n sb.push(\"\\n\");\r\n sb.push(formatDiagnosticContext(range, useColors));\r\n }\r\n sb.push(\"\\n\");\r\n sb.push(\" in \");\r\n sb.push(range.source.normalizedPath);\r\n sb.push(\"(\");\r\n sb.push(range.line.toString(10));\r\n sb.push(\",\");\r\n sb.push(range.column.toString(10));\r\n sb.push(\")\");\r\n\r\n let relatedRange = message.relatedRange;\r\n if (relatedRange) {\r\n if (showContext) {\r\n sb.push(\"\\n\");\r\n sb.push(formatDiagnosticContext(relatedRange, useColors));\r\n }\r\n sb.push(\"\\n\");\r\n sb.push(\" in \");\r\n sb.push(range.source.normalizedPath);\r\n sb.push(\"(\");\r\n sb.push(range.line.toString(10));\r\n sb.push(\",\");\r\n sb.push(range.column.toString(10));\r\n sb.push(\")\");\r\n }\r\n }\r\n return sb.join(\"\");\r\n}\r\n\r\n/** Formats the diagnostic context for the specified range, optionally with terminal colors. */\r\nexport function formatDiagnosticContext(range: Range, useColors: bool = false): string {\r\n var text = range.source.text;\r\n var len = text.length;\r\n var start = range.start;\r\n var end = range.end;\r\n while (start > 0 && !isLineBreak(text.charCodeAt(start - 1))) start--;\r\n while (end < len && !isLineBreak(text.charCodeAt(end))) end++;\r\n var sb: string[] = [\r\n \"\\n \",\r\n text.substring(start, end),\r\n \"\\n \"\r\n ];\r\n while (start < range.start) {\r\n sb.push(\" \");\r\n start++;\r\n }\r\n if (useColors) sb.push(COLOR_RED);\r\n if (range.start == range.end) {\r\n sb.push(\"^\");\r\n } else {\r\n while (start++ < range.end) sb.push(\"~\");\r\n }\r\n if (useColors) sb.push(COLOR_RESET);\r\n return sb.join(\"\");\r\n}\r\n\r\n/** Base class of all diagnostic emitters. */\r\nexport abstract class DiagnosticEmitter {\r\n\r\n /** Diagnostic messages emitted so far. */\r\n diagnostics: DiagnosticMessage[];\r\n\r\n /** Initializes this diagnostic emitter. */\r\n protected constructor(diagnostics: DiagnosticMessage[] | null = null) {\r\n this.diagnostics = diagnostics ? diagnostics : new Array();\r\n }\r\n\r\n /** Emits a diagnostic message of the specified category. */\r\n emitDiagnostic(\r\n code: DiagnosticCode,\r\n category: DiagnosticCategory,\r\n range: Range,\r\n relatedRange: Range | null,\r\n arg0: string | null = null,\r\n arg1: string | null = null,\r\n arg2: string | null = null\r\n ): void {\r\n var message = DiagnosticMessage.create(code, category, arg0, arg1, arg2).withRange(range);\r\n if (relatedRange) message.relatedRange = relatedRange;\r\n this.diagnostics.push(message);\r\n // console.log(formatDiagnosticMessage(message, true, true) + \"\\n\"); // temporary\r\n // console.log(new Error(\"stack\").stack);\r\n }\r\n\r\n /** Emits an informatory diagnostic message. */\r\n info(\r\n code: DiagnosticCode,\r\n range: Range,\r\n arg0: string | null = null,\r\n arg1: string | null = null,\r\n arg2: string | null = null\r\n ): void {\r\n this.emitDiagnostic(code, DiagnosticCategory.INFO, range, null, arg0, arg1, arg2);\r\n }\r\n\r\n /** Emits an informatory diagnostic message with a related range. */\r\n infoRelated(\r\n code: DiagnosticCode,\r\n range: Range,\r\n relatedRange: Range,\r\n arg0: string | null = null,\r\n arg1: string | null = null,\r\n arg2: string | null = null\r\n ): void {\r\n this.emitDiagnostic(code, DiagnosticCategory.INFO, range, relatedRange, arg0, arg1, arg2);\r\n }\r\n\r\n /** Emits a warning diagnostic message. */\r\n warning(\r\n code: DiagnosticCode,\r\n range: Range,\r\n arg0: string | null = null,\r\n arg1: string | null = null,\r\n arg2: string | null = null\r\n ): void {\r\n this.emitDiagnostic(code, DiagnosticCategory.WARNING, range, null, arg0, arg1, arg2);\r\n }\r\n\r\n /** Emits a warning diagnostic message with a related range. */\r\n warningRelated(\r\n code: DiagnosticCode,\r\n range: Range,\r\n relatedRange: Range,\r\n arg0: string | null = null,\r\n arg1: string | null = null,\r\n arg2: string | null = null\r\n ): void {\r\n this.emitDiagnostic(code, DiagnosticCategory.WARNING, range, relatedRange, arg0, arg1, arg2);\r\n }\r\n\r\n /** Emits an error diagnostic message. */\r\n error(\r\n code: DiagnosticCode,\r\n range: Range,\r\n arg0: string | null = null,\r\n arg1: string | null = null,\r\n arg2: string | null = null\r\n ): void {\r\n this.emitDiagnostic(code, DiagnosticCategory.ERROR, range, null, arg0, arg1, arg2);\r\n }\r\n\r\n /** Emits an error diagnostic message with a related range. */\r\n errorRelated(\r\n code: DiagnosticCode,\r\n range: Range,\r\n relatedRange: Range,\r\n arg0: string | null = null,\r\n arg1: string | null = null,\r\n arg2: string | null = null\r\n ): void {\r\n this.emitDiagnostic(code, DiagnosticCategory.ERROR, range, relatedRange, arg0, arg1, arg2);\r\n }\r\n}\r\n","/**\r\n * AssemblyScript's intermediate representation describing a program's elements.\r\n * @module program\r\n *//***/\r\n\r\nimport {\r\n CommonFlags,\r\n PATH_DELIMITER,\r\n STATIC_DELIMITER,\r\n INSTANCE_DELIMITER,\r\n GETTER_PREFIX,\r\n SETTER_PREFIX,\r\n INNER_DELIMITER,\r\n LIBRARY_SUBST,\r\n INDEX_SUFFIX,\r\n CommonSymbols,\r\n LibrarySymbols\r\n} from \"./common\";\r\n\r\nimport {\r\n Options,\r\n Feature\r\n} from \"./compiler\";\r\n\r\nimport {\r\n DiagnosticCode,\r\n DiagnosticMessage,\r\n DiagnosticEmitter\r\n} from \"./diagnostics\";\r\n\r\nimport {\r\n Type,\r\n TypeKind,\r\n TypeFlags,\r\n Signature\r\n} from \"./types\";\r\n\r\nimport {\r\n Node,\r\n NodeKind,\r\n Source,\r\n SourceKind,\r\n Range,\r\n DecoratorNode,\r\n DecoratorKind,\r\n SignatureNode,\r\n TypeParameterNode,\r\n CommonTypeNode,\r\n TypeNode,\r\n ArrowKind,\r\n\r\n Expression,\r\n IdentifierExpression,\r\n LiteralExpression,\r\n LiteralKind,\r\n StringLiteralExpression,\r\n\r\n Statement,\r\n ClassDeclaration,\r\n DeclarationStatement,\r\n EnumDeclaration,\r\n EnumValueDeclaration,\r\n ExportMember,\r\n ExportStatement,\r\n FieldDeclaration,\r\n FunctionDeclaration,\r\n ImportDeclaration,\r\n ImportStatement,\r\n InterfaceDeclaration,\r\n MethodDeclaration,\r\n NamespaceDeclaration,\r\n TypeDeclaration,\r\n VariableDeclaration,\r\n VariableLikeDeclarationStatement,\r\n VariableStatement,\r\n\r\n decoratorNameToKind,\r\n findDecorator\r\n} from \"./ast\";\r\n\r\nimport {\r\n Module,\r\n FunctionRef\r\n} from \"./module\";\r\n\r\nimport {\r\n CharCode\r\n} from \"./util\";\r\n\r\nimport {\r\n Resolver\r\n} from \"./resolver\";\r\n\r\nimport {\r\n Flow\r\n} from \"./flow\";\r\n\r\n/** Represents a yet unresolved `import`. */\r\nclass QueuedImport {\r\n constructor(\r\n /** File being imported into. */\r\n public localFile: File,\r\n /** Identifier within the local file. */\r\n public localIdentifier: IdentifierExpression,\r\n /** Identifier within the other file. Is an `import *` if not set. */\r\n public foreignIdentifier: IdentifierExpression | null,\r\n /** Path to the other file. */\r\n public foreignPath: string,\r\n /** Alternative path to the other file. */\r\n public foreignPathAlt: string\r\n ) {}\r\n}\r\n\r\n/** Represents a yet unresolved `export`. */\r\nclass QueuedExport {\r\n constructor(\r\n /** Identifier within the local file. */\r\n public localIdentifier: IdentifierExpression,\r\n /** Identifier within the other file. */\r\n public foreignIdentifier: IdentifierExpression,\r\n /** Path to the other file if a re-export. */\r\n public foreignPath: string | null,\r\n /** Alternative path to the other file if a re-export. */\r\n public foreignPathAlt: string | null\r\n ) {}\r\n}\r\n\r\n/** Represents a yet unresolved `export *`. */\r\nclass QueuedExportStar {\r\n // stored in a map with localFile as the key\r\n constructor(\r\n /** Path to the other file. */\r\n public foreignPath: string,\r\n /** Alternative path to the other file. */\r\n public foreignPathAlt: string,\r\n /** Reference to the path literal for reporting. */\r\n public pathLiteral: StringLiteralExpression\r\n ) {}\r\n}\r\n\r\n/** Represents the kind of an operator overload. */\r\nexport enum OperatorKind {\r\n INVALID,\r\n\r\n // indexed access\r\n INDEXED_GET, // a[]\r\n INDEXED_SET, // a[]=b\r\n UNCHECKED_INDEXED_GET, // unchecked(a[])\r\n UNCHECKED_INDEXED_SET, // unchecked(a[]=b)\r\n\r\n // binary\r\n ADD, // a + b\r\n SUB, // a - b\r\n MUL, // a * b\r\n DIV, // a / b\r\n REM, // a % b\r\n POW, // a ** b\r\n BITWISE_AND, // a & b\r\n BITWISE_OR, // a | b\r\n BITWISE_XOR, // a ^ b\r\n BITWISE_SHL, // a << b\r\n BITWISE_SHR, // a >> b\r\n BITWISE_SHR_U, // a >>> b\r\n EQ, // a == b\r\n NE, // a != b\r\n GT, // a > b\r\n GE, // a >= b\r\n LT, // a < b\r\n LE, // a <= b\r\n\r\n // unary prefix\r\n PLUS, // +a\r\n MINUS, // -a\r\n NOT, // !a\r\n BITWISE_NOT, // ~a\r\n PREFIX_INC, // ++a\r\n PREFIX_DEC, // --a\r\n\r\n // unary postfix\r\n POSTFIX_INC, // a++\r\n POSTFIX_DEC // a--\r\n\r\n // not overridable:\r\n // IDENTITY // a === b\r\n // LOGICAL_AND // a && b\r\n // LOGICAL_OR // a || b\r\n}\r\n\r\n/** Returns the operator kind represented by the specified decorator and string argument. */\r\nfunction operatorKindFromDecorator(decoratorKind: DecoratorKind, arg: string): OperatorKind {\r\n assert(arg.length);\r\n switch (decoratorKind) {\r\n case DecoratorKind.OPERATOR:\r\n case DecoratorKind.OPERATOR_BINARY: {\r\n switch (arg.charCodeAt(0)) {\r\n case CharCode.OPENBRACKET: {\r\n if (arg == \"[]\") return OperatorKind.INDEXED_GET;\r\n if (arg == \"[]=\") return OperatorKind.INDEXED_SET;\r\n break;\r\n }\r\n case CharCode.OPENBRACE: {\r\n if (arg == \"{}\") return OperatorKind.UNCHECKED_INDEXED_GET;\r\n if (arg == \"{}=\") return OperatorKind.UNCHECKED_INDEXED_SET;\r\n break;\r\n }\r\n case CharCode.PLUS: {\r\n if (arg == \"+\") return OperatorKind.ADD;\r\n break;\r\n }\r\n case CharCode.MINUS: {\r\n if (arg == \"-\") return OperatorKind.SUB;\r\n break;\r\n }\r\n case CharCode.ASTERISK: {\r\n if (arg == \"*\") return OperatorKind.MUL;\r\n if (arg == \"**\") return OperatorKind.POW;\r\n break;\r\n }\r\n case CharCode.SLASH: {\r\n if (arg == \"/\") return OperatorKind.DIV;\r\n break;\r\n }\r\n case CharCode.PERCENT: {\r\n if (arg == \"%\") return OperatorKind.REM;\r\n break;\r\n }\r\n case CharCode.AMPERSAND: {\r\n if (arg == \"&\") return OperatorKind.BITWISE_AND;\r\n break;\r\n }\r\n case CharCode.BAR: {\r\n if (arg == \"|\") return OperatorKind.BITWISE_OR;\r\n break;\r\n }\r\n case CharCode.CARET: {\r\n if (arg == \"^\") return OperatorKind.BITWISE_XOR;\r\n break;\r\n }\r\n case CharCode.EQUALS: {\r\n if (arg == \"==\") return OperatorKind.EQ;\r\n break;\r\n }\r\n case CharCode.EXCLAMATION: {\r\n if (arg == \"!=\") return OperatorKind.NE;\r\n break;\r\n }\r\n case CharCode.GREATERTHAN: {\r\n if (arg == \">\") return OperatorKind.GT;\r\n if (arg == \">=\") return OperatorKind.GE;\r\n if (arg == \">>\") return OperatorKind.BITWISE_SHR;\r\n if (arg == \">>>\") return OperatorKind.BITWISE_SHR_U;\r\n break;\r\n }\r\n case CharCode.LESSTHAN: {\r\n if (arg == \"<\") return OperatorKind.LT;\r\n if (arg == \"<=\") return OperatorKind.LE;\r\n if (arg == \"<<\") return OperatorKind.BITWISE_SHL;\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n case DecoratorKind.OPERATOR_PREFIX: {\r\n switch (arg.charCodeAt(0)) {\r\n case CharCode.PLUS: {\r\n if (arg == \"+\") return OperatorKind.PLUS;\r\n if (arg == \"++\") return OperatorKind.PREFIX_INC;\r\n break;\r\n }\r\n case CharCode.MINUS: {\r\n if (arg == \"-\") return OperatorKind.MINUS;\r\n if (arg == \"--\") return OperatorKind.PREFIX_DEC;\r\n break;\r\n }\r\n case CharCode.EXCLAMATION: {\r\n if (arg == \"!\") return OperatorKind.NOT;\r\n break;\r\n }\r\n case CharCode.TILDE: {\r\n if (arg == \"~\") return OperatorKind.BITWISE_NOT;\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n case DecoratorKind.OPERATOR_POSTFIX: {\r\n switch (arg.charCodeAt(0)) {\r\n case CharCode.PLUS: {\r\n if (arg == \"++\") return OperatorKind.POSTFIX_INC;\r\n break;\r\n }\r\n case CharCode.MINUS: {\r\n if (arg == \"--\") return OperatorKind.POSTFIX_DEC;\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n return OperatorKind.INVALID;\r\n}\r\n\r\n/** Represents an AssemblyScript program. */\r\nexport class Program extends DiagnosticEmitter {\r\n\r\n /** Resolver instance. */\r\n resolver: Resolver;\r\n /** Array of sources. */\r\n sources: Source[] = [];\r\n /** Diagnostic offset used where successively obtaining the next diagnostic. */\r\n diagnosticsOffset: i32 = 0;\r\n /** Compiler options. */\r\n options: Options;\r\n /** Special native code source. */\r\n nativeSource: Source;\r\n /** Special native code file. */\r\n nativeFile: File;\r\n /** Explicitly annotated start function. */\r\n explicitStartFunction: FunctionPrototype | null = null;\r\n\r\n // lookup maps\r\n\r\n /** Files by unique internal name. */\r\n filesByName: Map = new Map();\r\n /** Elements by unique internal name in element space. */\r\n elementsByName: Map = new Map();\r\n /** Elements by declaration. */\r\n elementsByDeclaration: Map = new Map();\r\n /** Element instances by unique internal name. */\r\n instancesByName: Map = new Map();\r\n /** Classes backing basic types like `i32`. */\r\n typeClasses: Map = new Map();\r\n\r\n // runtime references\r\n\r\n /** ArrayBuffer instance reference. */\r\n arrayBufferInstance: Class | null = null;\r\n /** Array prototype reference. */\r\n arrayPrototype: ClassPrototype | null = null;\r\n /** String instance reference. */\r\n stringInstance: Class | null = null;\r\n /** Abort function reference, if present. */\r\n abortInstance: Function | null = null;\r\n /** Memory allocation function. */\r\n memoryAllocateInstance: Function | null = null;\r\n\r\n // gc integration\r\n\r\n /** Whether a garbage collector is present or not. */\r\n hasGC: bool = false;\r\n /** Garbage collector allocation function. */\r\n gcAllocateInstance: Function | null = null;\r\n /** Garbage collector link function called when a managed object is referenced from a parent. */\r\n gcLinkInstance: Function | null = null;\r\n /** Garbage collector mark function called to on reachable managed objects. */\r\n gcMarkInstance: Function | null = null;\r\n /** Size of a managed object header. */\r\n gcHeaderSize: u32 = 0;\r\n /** Offset of the GC hook. */\r\n gcHookOffset: u32 = 0;\r\n\r\n /** Constructs a new program, optionally inheriting parser diagnostics. */\r\n constructor(\r\n /** Shared array of diagnostic messages (emitted so far). */\r\n diagnostics: DiagnosticMessage[] | null = null\r\n ) {\r\n super(diagnostics);\r\n var nativeSource = new Source(LIBRARY_SUBST, \"[native code]\", SourceKind.LIBRARY);\r\n this.nativeSource = nativeSource;\r\n var nativeFile = new File(this, nativeSource);\r\n this.nativeFile = nativeFile;\r\n this.filesByName.set(nativeFile.internalName, nativeFile);\r\n this.resolver = new Resolver(this);\r\n }\r\n\r\n /** Creates a native variable declaration. */\r\n makeNativeVariableDeclaration(\r\n /** The simple name of the variable */\r\n name: string,\r\n /** Flags indicating specific traits, e.g. `CONST`. */\r\n flags: CommonFlags = CommonFlags.NONE\r\n ): VariableDeclaration {\r\n var range = this.nativeSource.range;\r\n return Node.createVariableDeclaration(\r\n Node.createIdentifierExpression(name, range),\r\n null, null, null, flags, range\r\n );\r\n }\r\n\r\n /** Creates a native type declaration. */\r\n makeNativeTypeDeclaration(\r\n /** The simple name of the type. */\r\n name: string,\r\n /** Flags indicating specific traits, e.g. `GENERIC`. */\r\n flags: CommonFlags = CommonFlags.NONE\r\n ): TypeDeclaration {\r\n var range = this.nativeSource.range;\r\n var identifier = Node.createIdentifierExpression(name, range);\r\n return Node.createTypeDeclaration(\r\n identifier,\r\n null,\r\n Node.createOmittedType(range),\r\n null, flags, range\r\n );\r\n }\r\n\r\n // a dummy signature for programmatically generated native functions\r\n private nativeDummySignature: SignatureNode | null = null;\r\n\r\n /** Creates a native function declaration. */\r\n makeNativeFunctionDeclaration(\r\n /** The simple name of the function. */\r\n name: string,\r\n /** Flags indicating specific traits, e.g. `DECLARE`. */\r\n flags: CommonFlags = CommonFlags.NONE\r\n ): FunctionDeclaration {\r\n var range = this.nativeSource.range;\r\n return Node.createFunctionDeclaration(\r\n Node.createIdentifierExpression(name, range),\r\n null,\r\n this.nativeDummySignature || (this.nativeDummySignature = Node.createSignature([],\r\n Node.createType( // ^ AST signature doesn't really matter, is overridden anyway\r\n Node.createSimpleTypeName(CommonSymbols.void_, range),\r\n null, false, range\r\n ),\r\n null, false, range)\r\n ),\r\n null, null, flags, ArrowKind.NONE, range\r\n );\r\n }\r\n\r\n /** Creates a native namespace declaration. */\r\n makeNativeNamespaceDeclaration(\r\n /** The simple name of the namespace. */\r\n name: string,\r\n /** Flags indicating specific traits, e.g. `EXPORT`. */\r\n flags: CommonFlags = CommonFlags.NONE\r\n ): NamespaceDeclaration {\r\n var range = this.nativeSource.range;\r\n return Node.createNamespaceDeclaration(\r\n Node.createIdentifierExpression(name, range),\r\n [], null, flags, range\r\n );\r\n }\r\n\r\n /** Creates a native function. */\r\n makeNativeFunction(\r\n /** The simple name of the function. */\r\n name: string,\r\n /** Concrete function signature. */\r\n signature: Signature,\r\n /** Parent element, usually a file, class or namespace. */\r\n parent: Element = this.nativeFile,\r\n /** Flags indicating specific traits, e.g. `GENERIC`. */\r\n flags: CommonFlags = CommonFlags.NONE,\r\n /** Decorator flags representing built-in decorators. */\r\n decoratorFlags: DecoratorFlags = DecoratorFlags.NONE\r\n ): Function {\r\n return new Function(\r\n name,\r\n new FunctionPrototype(\r\n name,\r\n parent,\r\n this.makeNativeFunctionDeclaration(name, flags),\r\n decoratorFlags\r\n ),\r\n signature\r\n );\r\n }\r\n\r\n /** Gets the (possibly merged) program element linked to the specified declaration. */\r\n getElementByDeclaration(declaration: DeclarationStatement): DeclaredElement {\r\n var elementsByDeclaration = this.elementsByDeclaration;\r\n assert(elementsByDeclaration.has(declaration));\r\n return elementsByDeclaration.get(declaration)!;\r\n }\r\n\r\n /** Initializes the program and its elements prior to compilation. */\r\n initialize(options: Options): void {\r\n this.options = options;\r\n\r\n // register native types\r\n this.registerNativeType(CommonSymbols.i8, Type.i8);\r\n this.registerNativeType(CommonSymbols.i16, Type.i16);\r\n this.registerNativeType(CommonSymbols.i32, Type.i32);\r\n this.registerNativeType(CommonSymbols.i64, Type.i64);\r\n this.registerNativeType(CommonSymbols.isize, options.isizeType);\r\n this.registerNativeType(CommonSymbols.u8, Type.u8);\r\n this.registerNativeType(CommonSymbols.u16, Type.u16);\r\n this.registerNativeType(CommonSymbols.u32, Type.u32);\r\n this.registerNativeType(CommonSymbols.u64, Type.u64);\r\n this.registerNativeType(CommonSymbols.usize, options.usizeType);\r\n this.registerNativeType(CommonSymbols.bool, Type.bool);\r\n this.registerNativeType(CommonSymbols.f32, Type.f32);\r\n this.registerNativeType(CommonSymbols.f64, Type.f64);\r\n this.registerNativeType(CommonSymbols.void_, Type.void);\r\n this.registerNativeType(CommonSymbols.number, Type.f64); // alias\r\n this.registerNativeType(CommonSymbols.boolean, Type.bool); // alias\r\n this.nativeFile.add(CommonSymbols.native, new TypeDefinition(\r\n CommonSymbols.native,\r\n this.nativeFile,\r\n this.makeNativeTypeDeclaration(CommonSymbols.native, CommonFlags.EXPORT | CommonFlags.GENERIC),\r\n DecoratorFlags.BUILTIN\r\n ));\r\n if (options.hasFeature(Feature.SIMD)) this.registerNativeType(CommonSymbols.v128, Type.v128);\r\n\r\n // register compiler hints\r\n this.registerConstantInteger(LibrarySymbols.ASC_TARGET, Type.i32,\r\n i64_new(options.isWasm64 ? 2 : 1));\r\n this.registerConstantInteger(LibrarySymbols.ASC_NO_ASSERT, Type.bool,\r\n i64_new(options.noAssert ? 1 : 0, 0));\r\n this.registerConstantInteger(LibrarySymbols.ASC_MEMORY_BASE, Type.i32,\r\n i64_new(options.memoryBase, 0));\r\n this.registerConstantInteger(LibrarySymbols.ASC_OPTIMIZE_LEVEL, Type.i32,\r\n i64_new(options.optimizeLevelHint, 0));\r\n this.registerConstantInteger(LibrarySymbols.ASC_SHRINK_LEVEL, Type.i32,\r\n i64_new(options.shrinkLevelHint, 0));\r\n this.registerConstantInteger(LibrarySymbols.ASC_FEATURE_MUTABLE_GLOBAL, Type.bool,\r\n i64_new(options.hasFeature(Feature.MUTABLE_GLOBAL) ? 1 : 0, 0));\r\n this.registerConstantInteger(LibrarySymbols.ASC_FEATURE_SIGN_EXTENSION, Type.bool,\r\n i64_new(options.hasFeature(Feature.SIGN_EXTENSION) ? 1 : 0, 0));\r\n this.registerConstantInteger(LibrarySymbols.ASC_FEATURE_BULK_MEMORY, Type.bool,\r\n i64_new(options.hasFeature(Feature.BULK_MEMORY) ? 1 : 0, 0));\r\n this.registerConstantInteger(LibrarySymbols.ASC_FEATURE_SIMD, Type.bool,\r\n i64_new(options.hasFeature(Feature.SIMD) ? 1 : 0, 0));\r\n this.registerConstantInteger(LibrarySymbols.ASC_FEATURE_THREADS, Type.bool,\r\n i64_new(options.hasFeature(Feature.THREADS) ? 1 : 0, 0));\r\n\r\n // remember deferred elements\r\n var queuedImports = new Array();\r\n var queuedExports = new Map>();\r\n var queuedExportsStar = new Map();\r\n var queuedExtends = new Array();\r\n var queuedImplements = new Array();\r\n\r\n // initialize relevant declaration-like statements of the entire program\r\n for (let i = 0, k = this.sources.length; i < k; ++i) {\r\n let source = this.sources[i];\r\n let file = new File(this, source);\r\n this.filesByName.set(file.internalName, file);\r\n let statements = source.statements;\r\n for (let j = 0, l = statements.length; j < l; ++j) {\r\n let statement = statements[j];\r\n switch (statement.kind) {\r\n case NodeKind.EXPORT: {\r\n this.initializeExports(statement, file, queuedExports, queuedExportsStar);\r\n break;\r\n }\r\n case NodeKind.IMPORT: {\r\n this.initializeImports(statement, file, queuedImports, queuedExports);\r\n break;\r\n }\r\n case NodeKind.VARIABLE: {\r\n this.initializeVariables(statement, file);\r\n break;\r\n }\r\n case NodeKind.CLASSDECLARATION: {\r\n this.initializeClass(statement, file, queuedExtends, queuedImplements);\r\n break;\r\n }\r\n case NodeKind.ENUMDECLARATION: {\r\n this.initializeEnum(statement, file);\r\n break;\r\n }\r\n case NodeKind.FUNCTIONDECLARATION: {\r\n this.initializeFunction(statement, file);\r\n break;\r\n }\r\n case NodeKind.INTERFACEDECLARATION: {\r\n this.initializeInterface(statement, file);\r\n break;\r\n }\r\n case NodeKind.NAMESPACEDECLARATION: {\r\n this.initializeNamespace(statement, file, queuedExtends, queuedImplements);\r\n break;\r\n }\r\n case NodeKind.TYPEDECLARATION: {\r\n this.initializeTypeDefinition(statement, file);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // queued exports * should be linkable now that all files have been processed\r\n for (let [file, exportsStar] of queuedExportsStar) {\r\n for (let i = 0, k = exportsStar.length; i < k; ++i) {\r\n let exportStar = exportsStar[i];\r\n let foreignFile = this.lookupForeignFile(exportStar.foreignPath, exportStar.foreignPathAlt);\r\n if (!foreignFile) {\r\n this.error(\r\n DiagnosticCode.File_0_not_found,\r\n exportStar.pathLiteral.range, exportStar.pathLiteral.value\r\n );\r\n continue;\r\n }\r\n file.ensureExportStar(foreignFile);\r\n }\r\n }\r\n\r\n // queued imports should be resolvable now through traversing exports and queued exports\r\n for (let i = 0, k = queuedImports.length; i < k; ++i) {\r\n let queuedImport = queuedImports[i];\r\n let foreignIdentifier = queuedImport.foreignIdentifier;\r\n if (foreignIdentifier) { // i.e. import { foo [as bar] } from \"./baz\"\r\n let element = this.lookupForeign(\r\n foreignIdentifier.text,\r\n queuedImport.foreignPath,\r\n queuedImport.foreignPathAlt,\r\n queuedExports\r\n );\r\n if (element) {\r\n queuedImport.localFile.add(\r\n queuedImport.localIdentifier.text,\r\n element,\r\n true // isImport\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Module_0_has_no_exported_member_1,\r\n foreignIdentifier.range,\r\n queuedImport.foreignPath,\r\n foreignIdentifier.text\r\n );\r\n }\r\n } else { // i.e. import * as bar from \"./bar\"\r\n let foreignFile = this.lookupForeignFile(queuedImport.foreignPath, queuedImport.foreignPathAlt);\r\n if (foreignFile) {\r\n let localFile = queuedImport.localFile;\r\n let localName = queuedImport.localIdentifier.text;\r\n localFile.add(\r\n localName,\r\n foreignFile.asImportedNamespace(\r\n localName,\r\n localFile\r\n ),\r\n true // isImport\r\n );\r\n } else {\r\n assert(false); // already reported by the parser not finding the file\r\n }\r\n }\r\n }\r\n\r\n // queued exports should be resolvable now that imports are finalized\r\n for (let [file, exports] of queuedExports) {\r\n for (let [exportName, queuedExport] of exports) {\r\n let localName = queuedExport.localIdentifier.text;\r\n let foreignPath = queuedExport.foreignPath;\r\n if (foreignPath) { // i.e. export { foo [as bar] } from \"./baz\"\r\n let element = this.lookupForeign(\r\n localName,\r\n foreignPath,\r\n assert(queuedExport.foreignPathAlt), // must be set if foreignPath is\r\n queuedExports\r\n );\r\n if (element) {\r\n file.ensureExport(exportName, element);\r\n } else {\r\n this.error(\r\n DiagnosticCode.Module_0_has_no_exported_member_1,\r\n queuedExport.localIdentifier.range,\r\n foreignPath, localName\r\n );\r\n }\r\n } else { // i.e. export { foo [as bar] }\r\n let element = file.lookupInSelf(localName);\r\n if (element) {\r\n file.ensureExport(exportName, element);\r\n } else {\r\n let globalElement = this.lookupGlobal(localName);\r\n if (globalElement && globalElement instanceof DeclaredElement) { // export { memory }\r\n file.ensureExport(exportName, globalElement);\r\n } else {\r\n this.error(\r\n DiagnosticCode.Module_0_has_no_exported_member_1,\r\n queuedExport.foreignIdentifier.range,\r\n file.internalName, queuedExport.foreignIdentifier.text\r\n );\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n // register classes backing basic types\r\n this.registerNativeTypeClass(TypeKind.I8, LibrarySymbols.I8);\r\n this.registerNativeTypeClass(TypeKind.I16, LibrarySymbols.I16);\r\n this.registerNativeTypeClass(TypeKind.I32, LibrarySymbols.I32);\r\n this.registerNativeTypeClass(TypeKind.I64, LibrarySymbols.I64);\r\n this.registerNativeTypeClass(TypeKind.ISIZE, LibrarySymbols.Isize);\r\n this.registerNativeTypeClass(TypeKind.U8, LibrarySymbols.U8);\r\n this.registerNativeTypeClass(TypeKind.U16, LibrarySymbols.U16);\r\n this.registerNativeTypeClass(TypeKind.U32, LibrarySymbols.U32);\r\n this.registerNativeTypeClass(TypeKind.U64, LibrarySymbols.U64);\r\n this.registerNativeTypeClass(TypeKind.USIZE, LibrarySymbols.Usize);\r\n this.registerNativeTypeClass(TypeKind.BOOL, LibrarySymbols.Bool);\r\n this.registerNativeTypeClass(TypeKind.F32, LibrarySymbols.F32);\r\n this.registerNativeTypeClass(TypeKind.F64, LibrarySymbols.F64);\r\n if (options.hasFeature(Feature.SIMD)) this.registerNativeTypeClass(TypeKind.V128, LibrarySymbols.V128);\r\n\r\n // resolve base prototypes of derived classes\r\n var resolver = this.resolver;\r\n for (let i = 0, k = queuedExtends.length; i < k; ++i) {\r\n let thisPrototype = queuedExtends[i];\r\n let extendsNode = assert(thisPrototype.extendsNode); // must be present if in queuedExtends\r\n let baseElement = resolver.resolveTypeName(extendsNode.name, thisPrototype.parent); // reports\r\n if (!baseElement) continue;\r\n if (baseElement.kind == ElementKind.CLASS_PROTOTYPE) {\r\n let basePrototype = baseElement;\r\n if (basePrototype.hasDecorator(DecoratorFlags.SEALED)) {\r\n this.error(\r\n DiagnosticCode.Class_0_is_sealed_and_cannot_be_extended,\r\n extendsNode.range, (baseElement).identifierNode.text\r\n );\r\n }\r\n if (\r\n basePrototype.hasDecorator(DecoratorFlags.UNMANAGED) !=\r\n thisPrototype.hasDecorator(DecoratorFlags.UNMANAGED)\r\n ) {\r\n this.error(\r\n DiagnosticCode.Unmanaged_classes_cannot_extend_managed_classes_and_vice_versa,\r\n Range.join(thisPrototype.identifierNode.range, extendsNode.range)\r\n );\r\n }\r\n thisPrototype.basePrototype = basePrototype;\r\n } else {\r\n this.error(\r\n DiagnosticCode.A_class_may_only_extend_another_class,\r\n extendsNode.range\r\n );\r\n }\r\n }\r\n\r\n // set up global aliases\r\n {\r\n let globalAliases = options.globalAliases;\r\n if (globalAliases) {\r\n for (let [alias, name] of globalAliases) {\r\n if (!name.length) continue; // explicitly disabled\r\n let elementsByName = this.elementsByName;\r\n let element = elementsByName.get(name);\r\n if (element) {\r\n if (elementsByName.has(alias)) throw new Error(\"duplicate global element: \" + name);\r\n elementsByName.set(alias, element);\r\n }\r\n else throw new Error(\"no such global element: \" + name);\r\n }\r\n }\r\n }\r\n\r\n // register global library elements\r\n {\r\n let element: Element | null;\r\n if (element = this.lookupGlobal(LibrarySymbols.String)) {\r\n assert(element.kind == ElementKind.CLASS_PROTOTYPE);\r\n this.stringInstance = resolver.resolveClass(element, null);\r\n }\r\n if (element = this.lookupGlobal(LibrarySymbols.ArrayBuffer)) {\r\n assert(element.kind == ElementKind.CLASS_PROTOTYPE);\r\n this.arrayBufferInstance = resolver.resolveClass(element, null);\r\n }\r\n if (element = this.lookupGlobal(LibrarySymbols.Array)) {\r\n assert(element.kind == ElementKind.CLASS_PROTOTYPE);\r\n this.arrayPrototype = element;\r\n }\r\n if (element = this.lookupGlobal(LibrarySymbols.abort)) {\r\n assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);\r\n this.abortInstance = this.resolver.resolveFunction(element, null);\r\n }\r\n if (element = this.lookupGlobal(LibrarySymbols.memory)) {\r\n if (element = element.lookupInSelf(LibrarySymbols.allocate)) {\r\n assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);\r\n this.memoryAllocateInstance = this.resolver.resolveFunction(element, null);\r\n }\r\n }\r\n }\r\n\r\n // register GC hooks if present\r\n // FIXME: think about a better way than globals to model this, maybe a GC namespace that can be\r\n // dynamically extended by a concrete implementation but then has `@unsafe` methods that normal\r\n // code cannot call without explicitly enabling it with a flag.\r\n if (\r\n this.elementsByName.has(\"__gc_allocate\") &&\r\n this.elementsByName.has(\"__gc_link\") &&\r\n this.elementsByName.has(\"__gc_mark\")\r\n ) {\r\n // __gc_allocate(usize, (ref: usize) => void): usize\r\n let element = this.elementsByName.get(\"__gc_allocate\");\r\n assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);\r\n let gcAllocateInstance = assert(this.resolver.resolveFunction(element, null));\r\n let signature = gcAllocateInstance.signature;\r\n assert(signature.parameterTypes.length == 2);\r\n assert(signature.parameterTypes[0] == this.options.usizeType);\r\n assert(signature.parameterTypes[1].signatureReference);\r\n assert(signature.returnType == this.options.usizeType);\r\n\r\n // __gc_link(usize, usize): void\r\n element = this.elementsByName.get(\"__gc_link\");\r\n assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);\r\n let gcLinkInstance = assert(this.resolver.resolveFunction(element, null));\r\n signature = gcLinkInstance.signature;\r\n assert(signature.parameterTypes.length == 2);\r\n assert(signature.parameterTypes[0] == this.options.usizeType);\r\n assert(signature.parameterTypes[1] == this.options.usizeType);\r\n assert(signature.returnType == Type.void);\r\n\r\n // __gc_mark(usize): void\r\n element = this.elementsByName.get(\"__gc_mark\");\r\n assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);\r\n let gcMarkInstance = assert(this.resolver.resolveFunction(element, null));\r\n signature = gcMarkInstance.signature;\r\n assert(signature.parameterTypes.length == 1);\r\n assert(signature.parameterTypes[0] == this.options.usizeType);\r\n assert(signature.returnType == Type.void);\r\n\r\n this.gcAllocateInstance = gcAllocateInstance;\r\n this.gcLinkInstance = gcLinkInstance;\r\n this.gcMarkInstance = gcMarkInstance;\r\n let gcHookOffset = 2 * options.usizeType.byteSize; // .next + .prev\r\n this.gcHookOffset = gcHookOffset;\r\n this.gcHeaderSize = (gcHookOffset + 4 + 7) & ~7; // + .hook index + alignment\r\n this.hasGC = true;\r\n }\r\n\r\n // mark module exports, i.e. to apply proper wrapping behavior on the boundaries\r\n for (let file of this.filesByName.values()) {\r\n let exports = file.exports;\r\n if (!(file.source.isEntry && exports)) continue;\r\n for (let element of exports.values()) this.markModuleExport(element);\r\n }\r\n }\r\n\r\n /** Marks an element and its children as a module export. */\r\n private markModuleExport(element: Element): void {\r\n element.set(CommonFlags.MODULE_EXPORT);\r\n switch (element.kind) {\r\n case ElementKind.CLASS_PROTOTYPE: {\r\n let instanceMembers = (element).instanceMembers;\r\n if (instanceMembers) for (let member of instanceMembers.values()) this.markModuleExport(member);\r\n break;\r\n }\r\n case ElementKind.PROPERTY_PROTOTYPE: {\r\n let getterPrototype = (element).getterPrototype;\r\n if (getterPrototype) this.markModuleExport(getterPrototype);\r\n let setterPrototype = (element).setterPrototype;\r\n if (setterPrototype) this.markModuleExport(setterPrototype);\r\n break;\r\n }\r\n case ElementKind.PROPERTY:\r\n case ElementKind.FUNCTION:\r\n case ElementKind.FIELD:\r\n case ElementKind.CLASS: assert(false); // assumes that there are no instances yet\r\n }\r\n {\r\n let members = element.members;\r\n if (members) for (let member of members.values()) this.markModuleExport(member);\r\n }\r\n }\r\n\r\n /** Registers a native type with the program. */\r\n private registerNativeType(name: string, type: Type): void {\r\n var element = new TypeDefinition(\r\n name,\r\n this.nativeFile,\r\n this.makeNativeTypeDeclaration(name, CommonFlags.EXPORT),\r\n DecoratorFlags.BUILTIN\r\n );\r\n element.setType(type);\r\n this.nativeFile.add(name, element);\r\n }\r\n\r\n /** Registers the backing class of a native type. */\r\n private registerNativeTypeClass(typeKind: TypeKind, className: string): void {\r\n assert(!this.typeClasses.has(typeKind));\r\n var element = this.lookupGlobal(className);\r\n if (element) {\r\n assert(element.kind == ElementKind.CLASS_PROTOTYPE);\r\n let classElement = this.resolver.resolveClass(element, null);\r\n if (classElement) this.typeClasses.set(typeKind, classElement);\r\n }\r\n }\r\n\r\n /** Registers a constant integer value within the global scope. */\r\n private registerConstantInteger(name: string, type: Type, value: I64): void {\r\n assert(type.is(TypeFlags.INTEGER)); // must be an integer type\r\n var global = new Global(\r\n name,\r\n this.nativeFile,\r\n DecoratorFlags.NONE,\r\n this.makeNativeVariableDeclaration(name, CommonFlags.CONST | CommonFlags.EXPORT)\r\n );\r\n global.setConstantIntegerValue(value, type);\r\n this.nativeFile.add(name, global);\r\n }\r\n\r\n /** Registers a constant float value within the global scope. */\r\n private registerConstantFloat(name: string, type: Type, value: f64): void {\r\n assert(type.is(TypeFlags.FLOAT)); // must be a float type\r\n var global = new Global(\r\n name,\r\n this.nativeFile,\r\n DecoratorFlags.NONE,\r\n this.makeNativeVariableDeclaration(name, CommonFlags.CONST | CommonFlags.EXPORT)\r\n );\r\n global.setConstantFloatValue(value, type);\r\n this.nativeFile.add(name, global);\r\n }\r\n\r\n /** Ensures that the given global element exists. Attempts to merge duplicates. */\r\n ensureGlobal(name: string, element: DeclaredElement): void {\r\n var elementsByName = this.elementsByName;\r\n if (elementsByName.has(name)) {\r\n let actual = elementsByName.get(name);\r\n // NOTE: this is effectively only performed when merging native types with\r\n // their respective namespaces in std/builtins, but can also trigger when a\r\n // user has multiple global elements of the same name in different files,\r\n // which might result in unexpected shared symbols accross files. considering\r\n // this a wonky feature for now that we might want to revisit later.\r\n if (actual !== element) {\r\n let merged = tryMerge(elementsByName.get(name)!, element);\r\n if (!merged) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n element.identifierNode.range, name\r\n );\r\n return;\r\n }\r\n element = merged;\r\n }\r\n }\r\n elementsByName.set(name, element);\r\n }\r\n\r\n /** Looks up the element of the specified name in the global scope. */\r\n lookupGlobal(name: string): Element | null {\r\n var elements = this.elementsByName;\r\n if (elements.has(name)) return elements.get(name);\r\n return null;\r\n }\r\n\r\n /** Tries to locate a foreign file given its normalized path. */\r\n private lookupForeignFile(\r\n /** Normalized path to the other file. */\r\n foreignPath: string,\r\n /** Alternative normalized path to the other file. */\r\n foreignPathAlt: string\r\n ): File | null {\r\n var filesByName = this.filesByName;\r\n return filesByName.has(foreignPath)\r\n ? filesByName.get(foreignPath)!\r\n : filesByName.has(foreignPathAlt)\r\n ? filesByName.get(foreignPathAlt)!\r\n : null;\r\n }\r\n\r\n /** Tries to locate a foreign element by traversing exports and queued exports. */\r\n private lookupForeign(\r\n /** Identifier within the other file. */\r\n foreignName: string,\r\n /** Normalized path to the other file. */\r\n foreignPath: string,\r\n /** Alternative normalized path to the other file. */\r\n foreignPathAlt: string,\r\n /** So far queued exports. */\r\n queuedExports: Map>\r\n ): DeclaredElement | null {\r\n do {\r\n let foreignFile = this.lookupForeignFile(foreignPath, foreignPathAlt);\r\n if (!foreignFile) return null; // no such file\r\n\r\n // search already resolved exports\r\n let element = foreignFile.lookupExport(foreignName);\r\n if (element) return element;\r\n\r\n // otherwise traverse queued exports\r\n if (queuedExports.has(foreignFile)) {\r\n let fileQueuedExports = queuedExports.get(foreignFile)!;\r\n if (fileQueuedExports.has(foreignName)) {\r\n let queuedExport = fileQueuedExports.get(foreignName)!;\r\n if (queuedExport.foreignPath) { // imported from another file\r\n foreignName = queuedExport.localIdentifier.text;\r\n foreignPath = queuedExport.foreignPath;\r\n foreignPathAlt = assert(queuedExport.foreignPathAlt);\r\n continue;\r\n } else { // local element of this file\r\n element = foreignFile.lookupInSelf(queuedExport.localIdentifier.text);\r\n if (element) return element;\r\n }\r\n }\r\n }\r\n break;\r\n } while (true);\r\n return null;\r\n }\r\n\r\n /** Validates that only supported decorators are present. */\r\n private checkDecorators(\r\n /** Decorators present on an element. */\r\n decorators: DecoratorNode[] | null,\r\n /** Accepted decorator flags. Emits diagnostics if any other decorators are present. */\r\n acceptedFlags: DecoratorFlags\r\n ): DecoratorFlags {\r\n var flags = DecoratorFlags.NONE;\r\n if (decorators) {\r\n for (let i = 0, k = decorators.length; i < k; ++i) {\r\n let decorator = decorators[i];\r\n let kind = decoratorNameToKind(decorator.name);\r\n let flag = decoratorKindToFlag(kind);\r\n if (flag) {\r\n if (flag == DecoratorFlags.BUILTIN) {\r\n if (decorator.range.source.isLibrary) {\r\n flags |= flag;\r\n } else {\r\n this.error(\r\n DiagnosticCode.Decorator_0_is_not_valid_here,\r\n decorator.range, decorator.name.range.toString()\r\n );\r\n }\r\n } else if (!(acceptedFlags & flag)) {\r\n this.error(\r\n DiagnosticCode.Decorator_0_is_not_valid_here,\r\n decorator.range, decorator.name.range.toString()\r\n );\r\n } else if (flags & flag) {\r\n this.error(\r\n DiagnosticCode.Duplicate_decorator,\r\n decorator.range, decorator.name.range.toString()\r\n );\r\n } else {\r\n flags |= flag;\r\n }\r\n }\r\n }\r\n }\r\n return flags;\r\n }\r\n\r\n /** Initializes a class declaration. */\r\n private initializeClass(\r\n /** The declaration to initialize. */\r\n declaration: ClassDeclaration,\r\n /** Parent element, usually a file or namespace. */\r\n parent: Element,\r\n /** So far queued `extends` clauses. */\r\n queuedExtends: ClassPrototype[],\r\n /** So far queued `implements` clauses. */\r\n queuedImplements: ClassPrototype[]\r\n ): void {\r\n var name = declaration.name.text;\r\n var element = new ClassPrototype(\r\n name,\r\n parent,\r\n declaration,\r\n this.checkDecorators(declaration.decorators,\r\n DecoratorFlags.GLOBAL |\r\n DecoratorFlags.SEALED |\r\n DecoratorFlags.UNMANAGED\r\n )\r\n );\r\n if (!parent.add(name, element)) return;\r\n\r\n var implementsTypes = declaration.implementsTypes;\r\n if (implementsTypes) {\r\n let numImplementsTypes = implementsTypes.length;\r\n // cannot implement interfaces when unmanaged\r\n if (element.hasDecorator(DecoratorFlags.UNMANAGED)) {\r\n if (numImplementsTypes) {\r\n this.error(\r\n DiagnosticCode.Unmanaged_classes_cannot_implement_interfaces,\r\n Range.join(\r\n declaration.name.range,\r\n implementsTypes[numImplementsTypes - 1].range\r\n )\r\n );\r\n }\r\n } else if (numImplementsTypes) {\r\n // remember classes that implement interfaces\r\n for (let i = 0; i < numImplementsTypes; ++i) {\r\n this.warning( // TODO: not yet supported\r\n DiagnosticCode.Operation_not_supported,\r\n implementsTypes[i].range\r\n );\r\n }\r\n queuedImplements.push(element);\r\n }\r\n }\r\n // remember classes that extend another class\r\n if (declaration.extendsType) queuedExtends.push(element);\r\n\r\n // initialize members\r\n var memberDeclarations = declaration.members;\r\n for (let i = 0, k = memberDeclarations.length; i < k; ++i) {\r\n let memberDeclaration = memberDeclarations[i];\r\n switch (memberDeclaration.kind) {\r\n case NodeKind.FIELDDECLARATION: {\r\n this.initializeField(memberDeclaration, element);\r\n break;\r\n }\r\n case NodeKind.METHODDECLARATION: {\r\n if (memberDeclaration.isAny(CommonFlags.GET | CommonFlags.SET)) {\r\n this.initializeProperty(memberDeclaration, element);\r\n } else {\r\n this.initializeMethod(memberDeclaration, element);\r\n }\r\n break;\r\n }\r\n case NodeKind.INDEXSIGNATUREDECLARATION: break; // ignored for now\r\n default: assert(false); // class member expected\r\n }\r\n }\r\n }\r\n\r\n /** Initializes a field of a class or interface. */\r\n private initializeField(\r\n /** The declaration to initialize. */\r\n declaration: FieldDeclaration,\r\n /** Parent class. */\r\n parent: ClassPrototype\r\n ): void {\r\n var name = declaration.name.text;\r\n var decorators = declaration.decorators;\r\n var element: DeclaredElement;\r\n if (declaration.is(CommonFlags.STATIC)) { // global variable\r\n assert(parent.kind != ElementKind.INTERFACE_PROTOTYPE);\r\n element = new Global(\r\n name,\r\n parent,\r\n this.checkDecorators(decorators,\r\n (declaration.is(CommonFlags.READONLY)\r\n ? DecoratorFlags.INLINE\r\n : DecoratorFlags.NONE\r\n ) | DecoratorFlags.LAZY\r\n ),\r\n declaration\r\n );\r\n if (!parent.add(name, element)) return;\r\n } else { // actual instance field\r\n assert(!declaration.isAny(CommonFlags.ABSTRACT | CommonFlags.GET | CommonFlags.SET));\r\n element = new FieldPrototype(\r\n name,\r\n parent,\r\n declaration,\r\n this.checkDecorators(decorators, DecoratorFlags.NONE)\r\n );\r\n if (!parent.addInstance(name, element)) return;\r\n }\r\n }\r\n\r\n /** Initializes a method of a class or interface. */\r\n private initializeMethod(\r\n /** The declaration to initialize. */\r\n declaration: MethodDeclaration,\r\n /** Parent class. */\r\n parent: ClassPrototype\r\n ): void {\r\n var name = declaration.name.text;\r\n var isStatic = declaration.is(CommonFlags.STATIC);\r\n var acceptedFlags = DecoratorFlags.INLINE;\r\n if (!declaration.is(CommonFlags.GENERIC)) {\r\n acceptedFlags |= DecoratorFlags.OPERATOR_BINARY\r\n | DecoratorFlags.OPERATOR_PREFIX\r\n | DecoratorFlags.OPERATOR_POSTFIX;\r\n }\r\n var element = new FunctionPrototype(\r\n name,\r\n parent,\r\n declaration,\r\n this.checkDecorators(declaration.decorators, acceptedFlags)\r\n );\r\n if (isStatic) { // global function\r\n assert(declaration.name.kind != NodeKind.CONSTRUCTOR);\r\n if (!parent.add(name, element)) return;\r\n } else { // actual instance method\r\n if (!parent.addInstance(name, element)) return;\r\n }\r\n this.checkOperatorOverloads(declaration.decorators, element, parent);\r\n }\r\n\r\n /** Checks that operator overloads are generally valid, if present. */\r\n private checkOperatorOverloads(\r\n /** Decorators to check. */\r\n decorators: DecoratorNode[] | null,\r\n /** Decorated method. */\r\n prototype: FunctionPrototype,\r\n /** Parent class. */\r\n classPrototype: ClassPrototype\r\n ): void {\r\n if (decorators) {\r\n for (let i = 0, k = decorators.length; i < k; ++i) {\r\n let decorator = decorators[i];\r\n switch (decorator.decoratorKind) {\r\n case DecoratorKind.OPERATOR:\r\n case DecoratorKind.OPERATOR_BINARY:\r\n case DecoratorKind.OPERATOR_PREFIX:\r\n case DecoratorKind.OPERATOR_POSTFIX: {\r\n let numArgs = decorator.arguments && decorator.arguments.length || 0;\r\n if (numArgs == 1) {\r\n let firstArg = (decorator.arguments)[0];\r\n if (\r\n firstArg.kind == NodeKind.LITERAL &&\r\n (firstArg).literalKind == LiteralKind.STRING\r\n ) {\r\n let kind = operatorKindFromDecorator(\r\n decorator.decoratorKind,\r\n (firstArg).value\r\n );\r\n if (kind == OperatorKind.INVALID) {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n firstArg.range\r\n );\r\n } else {\r\n let overloads = classPrototype.overloadPrototypes;\r\n if (overloads.has(kind)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_function_implementation,\r\n firstArg.range\r\n );\r\n } else {\r\n prototype.operatorKind = kind;\r\n overloads.set(kind, prototype);\r\n }\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode.String_literal_expected,\r\n firstArg.range\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n decorator.range, \"1\", numArgs.toString(10)\r\n );\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /** Ensures that the property introduced by the specified getter or setter exists.*/\r\n private ensureProperty(\r\n /** The declaration of the getter or setter introducing the property. */\r\n declaration: MethodDeclaration,\r\n /** Parent class. */\r\n parent: ClassPrototype\r\n ): PropertyPrototype | null {\r\n var name = declaration.name.text;\r\n if (declaration.is(CommonFlags.STATIC)) {\r\n let parentMembers = parent.members;\r\n if (parentMembers && parentMembers.has(name)) {\r\n let element = parentMembers.get(name)!;\r\n if (element.kind == ElementKind.PROPERTY_PROTOTYPE) return element;\r\n } else {\r\n let element = new PropertyPrototype(name, parent, declaration);\r\n if (!parent.add(name, element)) return null;\r\n return element;\r\n }\r\n } else {\r\n let parentMembers = parent.instanceMembers;\r\n if (parentMembers && parentMembers.has(name)) {\r\n let element = parentMembers.get(name);\r\n if (element.kind == ElementKind.PROPERTY_PROTOTYPE) return element;\r\n } else {\r\n let element = new PropertyPrototype(name, parent, declaration);\r\n if (!parent.addInstance(name, element)) return null;\r\n return element;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Duplicate_property_0,\r\n declaration.name.range, name\r\n );\r\n return null;\r\n }\r\n\r\n /** Initializes a property of a class. */\r\n private initializeProperty(\r\n /** The declaration of the getter or setter. */\r\n declaration: MethodDeclaration,\r\n /** Parent class. */\r\n parent: ClassPrototype\r\n ): void {\r\n var property = this.ensureProperty(declaration, parent);\r\n if (!property) return;\r\n var name = declaration.name.text;\r\n var isGetter = declaration.is(CommonFlags.GET);\r\n if (isGetter) {\r\n if (property.getterPrototype) {\r\n this.error(\r\n DiagnosticCode.Duplicate_property_0,\r\n declaration.name.range, name\r\n );\r\n return;\r\n }\r\n } else {\r\n if (property.setterPrototype) {\r\n this.error(\r\n DiagnosticCode.Duplicate_property_0,\r\n declaration.name.range, name\r\n );\r\n return;\r\n }\r\n }\r\n var element = new FunctionPrototype(\r\n (isGetter ? GETTER_PREFIX : SETTER_PREFIX) + name,\r\n property,\r\n declaration,\r\n this.checkDecorators(declaration.decorators,\r\n DecoratorFlags.INLINE\r\n )\r\n );\r\n if (isGetter) {\r\n property.getterPrototype = element;\r\n } else {\r\n property.setterPrototype = element;\r\n }\r\n }\r\n\r\n /** Initializes an enum. */\r\n private initializeEnum(\r\n /** The declaration to initialize. */\r\n declaration: EnumDeclaration,\r\n /** Parent element, usually a file or namespace. */\r\n parent: Element\r\n ): void {\r\n var name = declaration.name.text;\r\n var element = new Enum(\r\n name,\r\n parent,\r\n declaration,\r\n this.checkDecorators(declaration.decorators,\r\n DecoratorFlags.GLOBAL |\r\n DecoratorFlags.INLINE |\r\n DecoratorFlags.LAZY\r\n )\r\n );\r\n if (!parent.add(name, element)) return;\r\n var values = declaration.values;\r\n for (let i = 0, k = values.length; i < k; ++i) {\r\n this.initializeEnumValue(values[i], element);\r\n }\r\n }\r\n\r\n /** Initializes an enum value. */\r\n private initializeEnumValue(\r\n /** The declaration to initialize. */\r\n declaration: EnumValueDeclaration,\r\n /** Parent enum. */\r\n parent: Enum\r\n ): void {\r\n var name = declaration.name.text;\r\n var element = new EnumValue(\r\n name,\r\n parent,\r\n declaration,\r\n this.checkDecorators(declaration.decorators,\r\n DecoratorFlags.NONE\r\n )\r\n );\r\n if (!parent.add(name, element)) return;\r\n }\r\n\r\n /** Initializes an `export` statement. */\r\n private initializeExports(\r\n /** The statement to initialize. */\r\n statement: ExportStatement,\r\n /** Parent file. */\r\n parent: File,\r\n /** So far queued `export`s. */\r\n queuedExports: Map>,\r\n /** So far queued `export *`s. */\r\n queuedExportsStar: Map\r\n ): void {\r\n var members = statement.members;\r\n if (members) { // export { foo, bar } [from \"./baz\"]\r\n for (let i = 0, k = members.length; i < k; ++i) {\r\n this.initializeExport(members[i], parent, statement.internalPath, queuedExports);\r\n }\r\n } else { // export * from \"./baz\"\r\n let queued: QueuedExportStar[];\r\n if (queuedExportsStar.has(parent)) queued = queuedExportsStar.get(parent)!;\r\n else queuedExportsStar.set(parent, queued = []);\r\n let foreignPath = assert(statement.internalPath); // must be set for export *\r\n queued.push(new QueuedExportStar(\r\n foreignPath,\r\n foreignPath.endsWith(INDEX_SUFFIX) // strip or add index depending on what's already present\r\n ? foreignPath.substring(0, foreignPath.length - INDEX_SUFFIX.length)\r\n : foreignPath + INDEX_SUFFIX,\r\n assert(statement.path)\r\n ));\r\n }\r\n }\r\n\r\n /** Initializes a single `export` member. Does not handle `export *`. */\r\n private initializeExport(\r\n /** The member to initialize. */\r\n member: ExportMember,\r\n /** Local file. */\r\n localFile: File,\r\n /** Path to the other file, if present. */\r\n foreignPath: string | null,\r\n /** So far queued `export`s. */\r\n queuedExports: Map>\r\n ): void {\r\n var localName = member.localName.text;\r\n var foreignName = member.exportedName.text;\r\n\r\n // check for duplicates\r\n var element = localFile.lookupExport(foreignName);\r\n if (element) {\r\n this.error(\r\n DiagnosticCode.Export_declaration_conflicts_with_exported_declaration_of_0,\r\n member.exportedName.range, foreignName\r\n );\r\n return;\r\n }\r\n // local element, i.e. export { foo [as bar] }\r\n if (foreignPath === null) {\r\n\r\n // resolve right away if the local element already exists\r\n if (element = localFile.lookupInSelf(localName)) {\r\n localFile.ensureExport(foreignName, element);\r\n\r\n // otherwise queue it\r\n } else {\r\n let queued: Map;\r\n if (queuedExports.has(localFile)) queued = queuedExports.get(localFile)!;\r\n else queuedExports.set(localFile, queued = new Map());\r\n queued.set(foreignName, new QueuedExport(\r\n member.localName,\r\n member.exportedName,\r\n null, null\r\n ));\r\n }\r\n\r\n // foreign element, i.e. export { foo } from \"./bar\"\r\n } else {\r\n let queued: Map;\r\n if (queuedExports.has(localFile)) queued = queuedExports.get(localFile)!;\r\n else queuedExports.set(localFile, queued = new Map());\r\n queued.set(foreignName, new QueuedExport(\r\n member.localName,\r\n member.exportedName,\r\n foreignPath,\r\n foreignPath.endsWith(INDEX_SUFFIX) // strip or add index depending on what's already present\r\n ? foreignPath.substring(0, foreignPath.length - INDEX_SUFFIX.length)\r\n : foreignPath + INDEX_SUFFIX\r\n ));\r\n }\r\n }\r\n\r\n /** Initializes an `import` statement. */\r\n private initializeImports(\r\n /** The statement to initialize. */\r\n statement: ImportStatement,\r\n /** Parent file. */\r\n parent: File,\r\n /** So far queued `import`s. */\r\n queuedImports: QueuedImport[],\r\n /** SO far queued `export`s. */\r\n queuedExports: Map>\r\n ): void {\r\n var declarations = statement.declarations;\r\n if (declarations) { // import { foo [as bar] } from \"./baz\"\r\n for (let i = 0, k = declarations.length; i < k; ++i) {\r\n this.initializeImport(\r\n declarations[i],\r\n parent,\r\n statement.internalPath,\r\n queuedImports,\r\n queuedExports\r\n );\r\n }\r\n } else if (statement.namespaceName) { // import * as foo from \"./bar\"\r\n queuedImports.push(new QueuedImport(\r\n parent,\r\n statement.namespaceName,\r\n null, // indicates import *\r\n statement.internalPath,\r\n statement.internalPath + INDEX_SUFFIX\r\n ));\r\n } else {\r\n // import \"./foo\"\r\n }\r\n }\r\n\r\n /** Initializes a single `import` declaration. Does not handle `import *`. */\r\n private initializeImport( // { foo [as bar] }\r\n /** The declaration to initialize. */\r\n declaration: ImportDeclaration,\r\n /** Parent file. */\r\n parent: File,\r\n /** Path to the other file. */\r\n foreignPath: string,\r\n /** So far queued `import`s. */\r\n queuedImports: QueuedImport[],\r\n /** So far queued `export`s. */\r\n queuedExports: Map>\r\n ): void {\r\n var foreignPathAlt = foreignPath.endsWith(INDEX_SUFFIX) // strip or add index depending on what's already present\r\n ? foreignPath.substring(0, foreignPath.length - INDEX_SUFFIX.length)\r\n : foreignPath + INDEX_SUFFIX;\r\n\r\n // resolve right away if the element exists\r\n var element = this.lookupForeign(declaration.foreignName.text, foreignPath, foreignPathAlt, queuedExports);\r\n if (element) {\r\n parent.add(declaration.name.text, element, true);\r\n return;\r\n }\r\n\r\n // otherwise queue it\r\n queuedImports.push(new QueuedImport(\r\n parent,\r\n declaration.name,\r\n declaration.foreignName,\r\n foreignPath,\r\n foreignPathAlt\r\n ));\r\n }\r\n\r\n /** Initializes a function. Does not handle methods. */\r\n private initializeFunction(\r\n /** The declaration to initialize. */\r\n declaration: FunctionDeclaration,\r\n /** Parent element, usually a file or namespace. */\r\n parent: Element\r\n ): void {\r\n var name = declaration.name.text;\r\n var validDecorators = DecoratorFlags.NONE;\r\n if (declaration.is(CommonFlags.AMBIENT)) {\r\n validDecorators |= DecoratorFlags.EXTERNAL;\r\n } else {\r\n validDecorators |= DecoratorFlags.INLINE;\r\n }\r\n if (!declaration.is(CommonFlags.INSTANCE)) {\r\n if (parent.kind != ElementKind.CLASS_PROTOTYPE) {\r\n validDecorators |= DecoratorFlags.GLOBAL;\r\n }\r\n }\r\n if (!declaration.is(CommonFlags.GENERIC)) {\r\n if (parent.kind == ElementKind.FILE && (parent).source.isEntry) {\r\n validDecorators |= DecoratorFlags.START;\r\n }\r\n }\r\n var element = new FunctionPrototype(\r\n name,\r\n parent,\r\n declaration,\r\n this.checkDecorators(declaration.decorators, validDecorators)\r\n );\r\n if (!parent.add(name, element)) return;\r\n if (element.hasDecorator(DecoratorFlags.START)) {\r\n if (this.explicitStartFunction) {\r\n this.error(\r\n DiagnosticCode.Module_cannot_have_multiple_start_functions,\r\n assert(findDecorator(DecoratorKind.START, declaration.decorators)).range\r\n );\r\n } else this.explicitStartFunction = element;\r\n }\r\n }\r\n\r\n /** Initializes an interface. */\r\n private initializeInterface(\r\n /** The declaration to initialize. */\r\n declaration: InterfaceDeclaration,\r\n /** Parent element, usually a file or namespace. */\r\n parent: Element\r\n ): void {\r\n var name = declaration.name.text;\r\n var element = new InterfacePrototype(\r\n name,\r\n parent,\r\n declaration,\r\n this.checkDecorators(declaration.decorators,\r\n DecoratorFlags.GLOBAL\r\n )\r\n );\r\n if (!parent.add(name, element)) return;\r\n var memberDeclarations = declaration.members;\r\n for (let i = 0, k = memberDeclarations.length; i < k; ++i) {\r\n let memberDeclaration = memberDeclarations[i];\r\n switch (memberDeclaration.kind) {\r\n case NodeKind.FIELDDECLARATION: {\r\n this.initializeField(memberDeclaration, element);\r\n break;\r\n }\r\n case NodeKind.METHODDECLARATION: {\r\n if (memberDeclaration.isAny(CommonFlags.GET | CommonFlags.SET)) {\r\n this.initializeProperty(memberDeclaration, element);\r\n } else {\r\n this.initializeMethod(memberDeclaration, element);\r\n }\r\n break;\r\n }\r\n default: assert(false); // interface member expected\r\n }\r\n }\r\n }\r\n\r\n /** Initializes a namespace. */\r\n private initializeNamespace(\r\n /** The declaration to initialize. */\r\n declaration: NamespaceDeclaration,\r\n /** Parent element, usually a file or another namespace. */\r\n parent: Element,\r\n /** So far queued `extends` clauses. */\r\n queuedExtends: ClassPrototype[],\r\n /** So far queued `implements` clauses. */\r\n queuedImplements: ClassPrototype[]\r\n ): void {\r\n var name = declaration.name.text;\r\n var element = new Namespace(name, parent, declaration);\r\n if (!parent.add(name, element)) return;\r\n element = assert(parent.lookupInSelf(name)); // possibly merged\r\n var members = declaration.members;\r\n for (let i = 0, k = members.length; i < k; ++i) {\r\n let member = members[i];\r\n switch (member.kind) {\r\n case NodeKind.CLASSDECLARATION: {\r\n this.initializeClass(member, element, queuedExtends, queuedImplements);\r\n break;\r\n }\r\n case NodeKind.ENUMDECLARATION: {\r\n this.initializeEnum(member, element);\r\n break;\r\n }\r\n case NodeKind.FUNCTIONDECLARATION: {\r\n this.initializeFunction(member, element);\r\n break;\r\n }\r\n case NodeKind.INTERFACEDECLARATION: {\r\n this.initializeInterface(member, element);\r\n break;\r\n }\r\n case NodeKind.NAMESPACEDECLARATION: {\r\n this.initializeNamespace(member, element, queuedExtends, queuedImplements);\r\n break;\r\n }\r\n case NodeKind.TYPEDECLARATION: {\r\n this.initializeTypeDefinition(member, element);\r\n break;\r\n }\r\n case NodeKind.VARIABLE: {\r\n this.initializeVariables(member, element);\r\n break;\r\n }\r\n default: assert(false); // namespace member expected\r\n }\r\n }\r\n }\r\n\r\n /** Initializes a `type` definition. */\r\n private initializeTypeDefinition(\r\n /** The declaration to initialize. */\r\n declaration: TypeDeclaration,\r\n /** Parent element, usually a file or namespace. */\r\n parent: Element\r\n ): void {\r\n var name = declaration.name.text;\r\n var element = new TypeDefinition(\r\n name,\r\n parent,\r\n declaration,\r\n this.checkDecorators(declaration.decorators, DecoratorFlags.NONE)\r\n );\r\n parent.add(name, element); // reports\r\n }\r\n\r\n /** Initializes a variable statement. */\r\n private initializeVariables(\r\n /** The statement to initialize. */\r\n statement: VariableStatement,\r\n /** Parent element, usually a file or namespace. */\r\n parent: Element\r\n ): void {\r\n var declarations = statement.declarations;\r\n for (let i = 0, k = declarations.length; i < k; ++i) {\r\n let declaration = declarations[i];\r\n let name = declaration.name.text;\r\n let acceptedFlags = DecoratorFlags.GLOBAL | DecoratorFlags.LAZY;\r\n if (declaration.is(CommonFlags.DECLARE)) {\r\n acceptedFlags |= DecoratorFlags.EXTERNAL;\r\n }\r\n if (declaration.is(CommonFlags.CONST)) {\r\n acceptedFlags |= DecoratorFlags.INLINE;\r\n }\r\n let element = new Global(\r\n name,\r\n parent,\r\n this.checkDecorators(declaration.decorators, acceptedFlags),\r\n declaration\r\n );\r\n if (!parent.add(name, element)) continue; // reports\r\n }\r\n }\r\n}\r\n\r\n/** Indicates the specific kind of an {@link Element}. */\r\nexport enum ElementKind {\r\n /** A {@link Global}. */\r\n GLOBAL,\r\n /** A {@link Local}. */\r\n LOCAL,\r\n /** An {@link Enum}. */\r\n ENUM,\r\n /** An {@link EnumValue}. */\r\n ENUMVALUE,\r\n /** A {@link FunctionPrototype}. */\r\n FUNCTION_PROTOTYPE,\r\n /** A {@link Function}. */\r\n FUNCTION,\r\n /** A {@link FunctionTarget}. */\r\n FUNCTION_TARGET,\r\n /** A {@link ClassPrototype}. */\r\n CLASS_PROTOTYPE,\r\n /** A {@link Class}. */\r\n CLASS,\r\n /** An {@link InterfacePrototype}. */\r\n INTERFACE_PROTOTYPE,\r\n /** An {@link Interface}. */\r\n INTERFACE,\r\n /** A {@link FieldPrototype}. */\r\n FIELD_PROTOTYPE,\r\n /** A {@link Field}. */\r\n FIELD,\r\n /** A {@link PropertyPrototype}. */\r\n PROPERTY_PROTOTYPE,\r\n /** A {@link Property}. */\r\n PROPERTY,\r\n /** A {@link Namespace}. */\r\n NAMESPACE,\r\n /** A {@link File}. */\r\n FILE,\r\n /** A {@link TypeDefinition}. */\r\n TYPEDEFINITION,\r\n}\r\n\r\n/** Indicates built-in decorators that are present. */\r\nexport enum DecoratorFlags {\r\n /** No flags set. */\r\n NONE = 0,\r\n /** Is a program global. */\r\n GLOBAL = 1 << 0,\r\n /** Is a binary operator overload. */\r\n OPERATOR_BINARY = 1 << 1,\r\n /** Is a unary prefix operator overload. */\r\n OPERATOR_PREFIX = 1 << 2,\r\n /** Is a unary postfix operator overload. */\r\n OPERATOR_POSTFIX = 1 << 3,\r\n /** Is an unmanaged class. */\r\n UNMANAGED = 1 << 4,\r\n /** Is a sealed class. */\r\n SEALED = 1 << 5,\r\n /** Is always inlined. */\r\n INLINE = 1 << 6,\r\n /** Is using a different external name. */\r\n EXTERNAL = 1 << 7,\r\n /** Is a builtin. */\r\n BUILTIN = 1 << 8,\r\n /** Is compiled lazily. */\r\n LAZY = 1 << 9,\r\n /** Is the explicit start function. */\r\n START = 1 << 10\r\n}\r\n\r\n/** Translates a decorator kind to the respective decorator flag. */\r\nexport function decoratorKindToFlag(kind: DecoratorKind): DecoratorFlags {\r\n switch (kind) {\r\n case DecoratorKind.GLOBAL: return DecoratorFlags.GLOBAL;\r\n case DecoratorKind.OPERATOR:\r\n case DecoratorKind.OPERATOR_BINARY: return DecoratorFlags.OPERATOR_BINARY;\r\n case DecoratorKind.OPERATOR_PREFIX: return DecoratorFlags.OPERATOR_PREFIX;\r\n case DecoratorKind.OPERATOR_POSTFIX: return DecoratorFlags.OPERATOR_POSTFIX;\r\n case DecoratorKind.UNMANAGED: return DecoratorFlags.UNMANAGED;\r\n case DecoratorKind.SEALED: return DecoratorFlags.SEALED;\r\n case DecoratorKind.INLINE: return DecoratorFlags.INLINE;\r\n case DecoratorKind.EXTERNAL: return DecoratorFlags.EXTERNAL;\r\n case DecoratorKind.BUILTIN: return DecoratorFlags.BUILTIN;\r\n case DecoratorKind.LAZY: return DecoratorFlags.LAZY;\r\n case DecoratorKind.START: return DecoratorFlags.START;\r\n default: return DecoratorFlags.NONE;\r\n }\r\n}\r\n\r\n/** Base class of all program elements. */\r\nexport abstract class Element {\r\n\r\n /** Parent element. */\r\n parent: Element;\r\n /** Common flags indicating specific traits. */\r\n flags: CommonFlags = CommonFlags.NONE;\r\n /** Decorator flags indicating annotated traits. */\r\n decoratorFlags: DecoratorFlags = DecoratorFlags.NONE;\r\n /** Member elements. */\r\n members: Map | null = null;\r\n /** Shadowing type in type space, if any. */\r\n shadowType: TypeDefinition | null = null;\r\n\r\n /** Constructs a new program element. */\r\n protected constructor(\r\n /** Specific element kind. */\r\n public kind: ElementKind,\r\n /** Simple name. */\r\n public name: string,\r\n /** Internal name referring to this element. */\r\n public internalName: string,\r\n /** Containing {@link Program}. */\r\n public program: Program,\r\n /** Parent element. */\r\n parent: Element | null\r\n ) {\r\n this.program = program;\r\n this.name = name;\r\n this.internalName = internalName;\r\n if (parent) {\r\n this.parent = parent;\r\n } else {\r\n assert(this.kind == ElementKind.FILE);\r\n this.parent = this; // special case to keep this.parent non-nullable\r\n }\r\n }\r\n\r\n /** Gets the enclosing file. */\r\n get file(): File {\r\n var current: Element = this;\r\n do if ((current = current.parent).kind == ElementKind.FILE) return current;\r\n while (true);\r\n }\r\n\r\n /** Tests if this element has a specific flag or flags. */\r\n is(flag: CommonFlags): bool { return (this.flags & flag) == flag; }\r\n /** Tests if this element has any of the specified flags. */\r\n isAny(flags: CommonFlags): bool { return (this.flags & flags) != 0; }\r\n /** Sets a specific flag or flags. */\r\n set(flag: CommonFlags): void { this.flags |= flag; }\r\n /** Tests if this element has a specific decorator flag or flags. */\r\n hasDecorator(flag: DecoratorFlags): bool { return (this.decoratorFlags & flag) == flag; }\r\n\r\n /** Looks up the element with the specified name within this element. */\r\n lookupInSelf(name: string): DeclaredElement | null {\r\n var members = this.members;\r\n if (members && members.has(name)) return members.get(name)!;\r\n return null;\r\n }\r\n\r\n /** Looks up the element with the specified name relative to this element, like in JS. */\r\n abstract lookup(name: string): Element | null;\r\n\r\n /** Adds an element as a member of this one. Reports and returns `false` if a duplicate. */\r\n add(name: string, element: DeclaredElement): bool {\r\n var originalDeclaration = element.declaration;\r\n var members = this.members;\r\n if (!members) this.members = members = new Map();\r\n else if (members.has(name)) {\r\n let actual = members.get(name)!;\r\n if (actual.parent !== this) {\r\n // override non-own element\r\n } else {\r\n let merged = tryMerge(actual, element);\r\n if (merged) {\r\n element = merged; // use merged element\r\n } else {\r\n this.program.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n element.identifierNode.range, element.identifierNode.text\r\n );\r\n return false;\r\n }\r\n }\r\n }\r\n members.set(name, element);\r\n var program = this.program;\r\n if (element.kind != ElementKind.FUNCTION_PROTOTYPE || !(element).isBound) {\r\n // prefer unbound prototypes in global lookup maps\r\n program.elementsByName.set(element.internalName, element);\r\n program.elementsByDeclaration.set(originalDeclaration, element);\r\n }\r\n return true;\r\n }\r\n\r\n /** Returns a string representation of this element. */\r\n toString(): string {\r\n return ElementKind[this.kind] + \":\" + this.internalName;\r\n }\r\n}\r\n\r\n/** Base class of elements with an associated declaration statement. */\r\nexport abstract class DeclaredElement extends Element {\r\n\r\n /** Constructs a new declared program element. */\r\n protected constructor(\r\n /** Specific element kind. */\r\n kind: ElementKind,\r\n /** Simple name. */\r\n name: string,\r\n /** Internal name referring to this element. */\r\n internalName: string,\r\n /** Containing {@link Program}. */\r\n program: Program,\r\n /** Parent element. */\r\n parent: Element | null,\r\n /** Declaration reference. */\r\n public declaration: DeclarationStatement\r\n ) {\r\n super(kind, name, internalName, program, parent);\r\n // It is necessary to have access to identifiers of all members and exports\r\n // for reporting purposes and this is the lowest common denominator. Comes\r\n // at the expense of not having more specific type information in derived\r\n // classes, though. Instead, derived classes implement getters for other\r\n // important AST nodes directly through manual casting, allowing the resolver\r\n // etc. to not worry about actual declarations.\r\n this.declaration = declaration;\r\n this.flags = declaration.flags; // inherit\r\n }\r\n\r\n /** Tests if this element is a library element. */\r\n get isDeclaredInLibrary(): bool {\r\n return this.declaration.range.source.isLibrary;\r\n }\r\n\r\n /** Gets the associated identifier node. */\r\n get identifierNode(): IdentifierExpression {\r\n return this.declaration.name;\r\n }\r\n\r\n /** Gets the assiciated decorator nodes. */\r\n get decoratorNodes(): DecoratorNode[] | null {\r\n return this.declaration.decorators;\r\n }\r\n}\r\n\r\n/** Base class of elements that can be resolved to a concrete type. */\r\nexport abstract class TypedElement extends DeclaredElement {\r\n\r\n /** Resolved type. Set once `is(RESOLVED)`, otherwise void. */\r\n type: Type = Type.void;\r\n\r\n /** Sets the resolved type of this element. */\r\n setType(type: Type): void {\r\n assert(!this.is(CommonFlags.RESOLVED));\r\n this.type = type;\r\n this.set(CommonFlags.RESOLVED);\r\n }\r\n}\r\n\r\n/** A file representing the implicit top-level namespace of a source. */\r\nexport class File extends Element {\r\n\r\n /** File exports. */\r\n exports: Map | null = null;\r\n /** File re-exports. */\r\n exportsStar: File[] | null = null;\r\n /** Top-level start function of this file. */\r\n startFunction: Function;\r\n\r\n /** Constructs a new file. */\r\n constructor(\r\n /** Program this file belongs to. */\r\n program: Program,\r\n /** Source of this file. */\r\n public source: Source\r\n ) {\r\n super(\r\n ElementKind.FILE,\r\n source.normalizedPath,\r\n source.internalPath,\r\n program,\r\n null // special case for files\r\n );\r\n this.source = source;\r\n assert(!program.filesByName.has(this.internalName));\r\n program.filesByName.set(this.internalName, this);\r\n var startFunction = this.program.makeNativeFunction(\r\n \"start:\" + this.internalName,\r\n new Signature(null, Type.void),\r\n this\r\n );\r\n startFunction.internalName = startFunction.name;\r\n this.startFunction = startFunction;\r\n }\r\n\r\n /* @override */\r\n add(name: string, element: DeclaredElement, isImport: bool = false): bool {\r\n if (!super.add(name, element)) return false;\r\n element = assert(this.lookupInSelf(name)); // possibly merged\r\n if (element.is(CommonFlags.EXPORT) && !isImport) {\r\n this.ensureExport(\r\n element.name,\r\n element\r\n );\r\n }\r\n if (element.hasDecorator(DecoratorFlags.GLOBAL)) this.program.ensureGlobal(name, element);\r\n return true;\r\n }\r\n\r\n /* @override */\r\n lookupInSelf(name: string): DeclaredElement | null {\r\n var element = super.lookupInSelf(name);\r\n if (element) return element;\r\n var exportsStar = this.exportsStar;\r\n if (exportsStar) {\r\n for (let i = 0, k = exportsStar.length; i < k; ++i) {\r\n if (element = exportsStar[i].lookupInSelf(name)) return element;\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n /* @override */\r\n lookup(name: string): Element | null {\r\n var element = this.lookupInSelf(name);\r\n if (element) return element;\r\n return this.program.lookupGlobal(name);\r\n }\r\n\r\n /** Ensures that an element is an export of this file. */\r\n ensureExport(name: string, element: DeclaredElement): void {\r\n var exports = this.exports;\r\n if (!exports) this.exports = exports = new Map();\r\n exports.set(name, element);\r\n if (this.source.isLibrary) this.program.ensureGlobal(name, element);\r\n }\r\n\r\n /** Ensures that another file is a re-export of this file. */\r\n ensureExportStar(file: File): void {\r\n var exportsStar = this.exportsStar;\r\n if (!exportsStar) this.exportsStar = exportsStar = [];\r\n else if (exportsStar.includes(file)) return;\r\n exportsStar.push(file);\r\n }\r\n\r\n /** Looks up the export of the specified name. */\r\n lookupExport(name: string): DeclaredElement | null {\r\n var exports = this.exports;\r\n if (exports && exports.has(name)) return exports.get(name)!;\r\n var exportsStar = this.exportsStar;\r\n if (exportsStar) {\r\n for (let i = 0, k = exportsStar.length; i < k; ++i) {\r\n let element = exportsStar[i].lookupExport(name);\r\n if (element) return element;\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n /** Creates an imported namespace from this file. */\r\n asImportedNamespace(name: string, parent: Element): Namespace {\r\n var ns = new Namespace(\r\n name,\r\n parent,\r\n this.program.makeNativeNamespaceDeclaration(name)\r\n );\r\n var exports = this.exports;\r\n if (exports) {\r\n for (let [memberName, member] of exports) {\r\n ns.add(memberName, member);\r\n }\r\n }\r\n return ns;\r\n }\r\n}\r\n\r\n/** A type definition. */\r\nexport class TypeDefinition extends TypedElement {\r\n\r\n /** Constructs a new type definition. */\r\n constructor(\r\n /** Simple name. */\r\n name: string,\r\n /** Parent element, usually a file or namespace. */\r\n parent: Element,\r\n /** Declaration reference. */\r\n declaration: TypeDeclaration,\r\n /** Pre-checked flags indicating built-in decorators. */\r\n decoratorFlags: DecoratorFlags = DecoratorFlags.NONE\r\n ) {\r\n super(\r\n ElementKind.TYPEDEFINITION,\r\n name,\r\n mangleInternalName(name, parent, false),\r\n parent.program,\r\n parent,\r\n declaration\r\n );\r\n this.decoratorFlags = decoratorFlags;\r\n }\r\n\r\n /** Gets the associated type parameter nodes. */\r\n get typeParameterNodes(): TypeParameterNode[] | null {\r\n return (this.declaration).typeParameters;\r\n }\r\n\r\n /** Gets the associated type node. */\r\n get typeNode(): CommonTypeNode {\r\n return (this.declaration).type;\r\n }\r\n\r\n /* @override */\r\n lookup(name: string): Element | null {\r\n return this.parent.lookup(name);\r\n }\r\n}\r\n\r\n/** A namespace that differs from a file in being user-declared with a name. */\r\nexport class Namespace extends DeclaredElement {\r\n\r\n /** Constructs a new namespace. */\r\n constructor(\r\n /** Simple name. */\r\n name: string,\r\n /** Parent element, usually a file or another namespace. */\r\n parent: Element,\r\n /** Declaration reference. */\r\n declaration: NamespaceDeclaration\r\n ) {\r\n super(\r\n ElementKind.NAMESPACE,\r\n name,\r\n mangleInternalName(name, parent, false),\r\n parent.program,\r\n parent,\r\n declaration\r\n );\r\n }\r\n\r\n /* @override */\r\n lookup(name: string): Element | null {\r\n return this.lookupInSelf(name)\r\n || this.parent.lookup(name);\r\n }\r\n}\r\n\r\n/** An enum. */\r\nexport class Enum extends TypedElement {\r\n\r\n /** Constructs a new enum. */\r\n constructor(\r\n /** Simple name. */\r\n name: string,\r\n /** Parent element, usually a file or namespace. */\r\n parent: Element,\r\n /** Declaration reference. */\r\n declaration: EnumDeclaration,\r\n /** Pre-checked flags indicating built-in decorators. */\r\n decoratorFlags: DecoratorFlags = DecoratorFlags.NONE\r\n ) {\r\n super(\r\n ElementKind.ENUM,\r\n name,\r\n mangleInternalName(name, parent, false),\r\n parent.program,\r\n parent,\r\n declaration\r\n );\r\n this.decoratorFlags = decoratorFlags;\r\n this.setType(Type.i32);\r\n }\r\n\r\n /* @override */\r\n lookup(name: string): Element | null {\r\n return this.lookupInSelf(name)\r\n || this.parent.lookup(name);\r\n }\r\n}\r\n\r\n/** Indicates the kind of an inlined constant value. */\r\nexport const enum ConstantValueKind {\r\n /** No constant value. */\r\n NONE,\r\n /** Constant integer value. */\r\n INTEGER,\r\n /** Constant float value. */\r\n FLOAT\r\n}\r\n\r\n/** Base class of all variable-like program elements. */\r\nexport abstract class VariableLikeElement extends TypedElement {\r\n\r\n /** Constant value kind. */\r\n constantValueKind: ConstantValueKind = ConstantValueKind.NONE;\r\n /** Constant integer value, if applicable. */\r\n constantIntegerValue: I64;\r\n /** Constant float value, if applicable. */\r\n constantFloatValue: f64;\r\n\r\n /** Constructs a new variable-like element. */\r\n protected constructor(\r\n /** Specific element kind. */\r\n kind: ElementKind,\r\n /** Simple name. */\r\n name: string,\r\n /** Parent element, usually a file, namespace or class. */\r\n parent: Element,\r\n /** Declaration reference. Creates a native declaration if omitted. */\r\n declaration: VariableLikeDeclarationStatement = parent.program.makeNativeVariableDeclaration(name)\r\n ) {\r\n super(\r\n kind,\r\n name,\r\n mangleInternalName(name, parent, false),\r\n parent.program,\r\n parent,\r\n declaration\r\n );\r\n this.flags = declaration.flags;\r\n }\r\n\r\n /** Gets the associated type node.s */\r\n get typeNode(): CommonTypeNode | null {\r\n return (this.declaration).type;\r\n }\r\n\r\n /** Gets the associated initializer node. */\r\n get initializerNode(): Expression | null {\r\n return (this.declaration).initializer;\r\n }\r\n\r\n /** Applies a constant integer value to this element. */\r\n setConstantIntegerValue(value: I64, type: Type): void {\r\n assert(type.is(TypeFlags.INTEGER));\r\n this.type = type;\r\n this.constantValueKind = ConstantValueKind.INTEGER;\r\n this.constantIntegerValue = value;\r\n this.set(CommonFlags.CONST | CommonFlags.INLINED | CommonFlags.RESOLVED);\r\n }\r\n\r\n /** Applies a constant float value to this element. */\r\n setConstantFloatValue(value: f64, type: Type): void {\r\n assert(type.is(TypeFlags.FLOAT));\r\n this.type = type;\r\n this.constantValueKind = ConstantValueKind.FLOAT;\r\n this.constantFloatValue = value;\r\n this.set(CommonFlags.CONST | CommonFlags.INLINED | CommonFlags.RESOLVED);\r\n }\r\n\r\n /** @override */\r\n lookup(name: string): Element | null {\r\n return this.parent.lookup(name);\r\n }\r\n}\r\n\r\n/** An enum value. */\r\nexport class EnumValue extends VariableLikeElement {\r\n\r\n /** Constructs a new enum value. */\r\n constructor(\r\n /** Simple name. */\r\n name: string,\r\n /** Parent enum. */\r\n parent: Enum,\r\n /** Declaration reference. */\r\n declaration: EnumValueDeclaration,\r\n /** Pre-checked flags indicating built-in decorators. */\r\n decoratorFlags: DecoratorFlags = DecoratorFlags.NONE\r\n ) {\r\n super(\r\n ElementKind.ENUMVALUE,\r\n name,\r\n parent,\r\n declaration\r\n );\r\n this.decoratorFlags = decoratorFlags;\r\n this.setType(Type.i32);\r\n }\r\n\r\n /** Whether this enum value is immutable. */\r\n isImmutable: bool = false;\r\n\r\n /** Gets the associated value node. */\r\n get valueNode(): Expression | null {\r\n return (this.declaration).value;\r\n }\r\n\r\n /* @override */\r\n lookup(name: string): Element | null {\r\n return this.parent.lookup(name);\r\n }\r\n}\r\n\r\n/** A global variable. */\r\nexport class Global extends VariableLikeElement {\r\n\r\n /** Constructs a new global variable. */\r\n constructor(\r\n /** Simple name. */\r\n name: string,\r\n /** Parent element, usually a file, namespace or static class. */\r\n parent: Element,\r\n /** Pre-checked flags indicating built-in decorators. */\r\n decoratorFlags: DecoratorFlags,\r\n /** Declaration reference. Creates a native declaration if omitted. */\r\n declaration: VariableLikeDeclarationStatement = parent.program.makeNativeVariableDeclaration(name)\r\n ) {\r\n super(\r\n ElementKind.GLOBAL,\r\n name,\r\n parent,\r\n declaration\r\n );\r\n this.decoratorFlags = decoratorFlags;\r\n }\r\n}\r\n\r\n/** A function parameter. */\r\nexport class Parameter {\r\n /** Constructs a new function parameter. */\r\n constructor(\r\n /** Parameter name. */\r\n public name: string,\r\n /** Parameter type. */\r\n public type: Type,\r\n /** Parameter initializer, if present. */\r\n public initializer: Expression | null = null\r\n ) {}\r\n}\r\n\r\n/** A local variable. */\r\nexport class Local extends VariableLikeElement {\r\n\r\n /** Constructs a new local variable. */\r\n constructor(\r\n /** Simple name. */\r\n name: string,\r\n /** Zero-based index within the enclosing function. `-1` indicates a virtual local. */\r\n public index: i32,\r\n /** Resolved type. */\r\n type: Type,\r\n /** Parent function. */\r\n parent: Function,\r\n /** Declaration reference. */\r\n declaration: VariableLikeDeclarationStatement = parent.program.makeNativeVariableDeclaration(name)\r\n ) {\r\n super(\r\n ElementKind.LOCAL,\r\n name,\r\n parent,\r\n declaration\r\n );\r\n this.index = index;\r\n assert(type != Type.void);\r\n this.setType(type);\r\n }\r\n}\r\n\r\n/** A yet unresolved function prototype. */\r\nexport class FunctionPrototype extends DeclaredElement {\r\n\r\n /** Operator kind, if an overload. */\r\n operatorKind: OperatorKind = OperatorKind.INVALID;\r\n /** Already resolved instances. */\r\n instances: Map | null = null;\r\n\r\n /** Clones of this prototype that are bounds to specific classes. */\r\n private boundPrototypes: Map | null = null;\r\n\r\n /** Constructs a new function prototype. */\r\n constructor(\r\n /** Simple na,e */\r\n name: string,\r\n /** Parent element, usually a file, namespace or class (if a method). */\r\n parent: Element,\r\n /** Declaration reference. */\r\n declaration: FunctionDeclaration,\r\n /** Pre-checked flags indicating built-in decorators. */\r\n decoratorFlags: DecoratorFlags = DecoratorFlags.NONE\r\n ) {\r\n super(\r\n ElementKind.FUNCTION_PROTOTYPE,\r\n name,\r\n mangleInternalName(name, parent, declaration.is(CommonFlags.INSTANCE)),\r\n parent.program,\r\n parent,\r\n declaration\r\n );\r\n this.decoratorFlags = decoratorFlags;\r\n }\r\n\r\n /** Gets the associated type parameter nodes. */\r\n get typeParameterNodes(): TypeParameterNode[] | null {\r\n return (this.declaration).typeParameters;\r\n }\r\n\r\n /** Gets the associated signature node. */\r\n get signatureNode(): SignatureNode {\r\n return (this.declaration).signature;\r\n }\r\n\r\n /** Gets the associated body node. */\r\n get bodyNode(): Statement | null {\r\n return (this.declaration).body;\r\n }\r\n\r\n /** Gets the arrow function kind. */\r\n get arrowKind(): ArrowKind {\r\n return (this.declaration).arrowKind;\r\n }\r\n\r\n /** Tests if this prototype is bound to a class. */\r\n get isBound(): bool {\r\n var parent = this.parent;\r\n return parent.kind == ElementKind.CLASS\r\n || parent.kind == ElementKind.PROPERTY_PROTOTYPE && parent.parent.kind == ElementKind.CLASS;\r\n }\r\n\r\n /** Creates a clone of this prototype that is bound to a concrete class instead. */\r\n toBound(classInstance: Class): FunctionPrototype {\r\n assert(this.is(CommonFlags.INSTANCE));\r\n assert(!this.isBound);\r\n var boundPrototypes = this.boundPrototypes;\r\n if (!boundPrototypes) this.boundPrototypes = boundPrototypes = new Map();\r\n else if (boundPrototypes.has(classInstance)) return boundPrototypes.get(classInstance)!;\r\n var declaration = this.declaration; assert(declaration.kind == NodeKind.METHODDECLARATION);\r\n var bound = new FunctionPrototype(\r\n this.name,\r\n classInstance, // !\r\n declaration,\r\n this.decoratorFlags\r\n );\r\n bound.flags = this.flags;\r\n bound.operatorKind = this.operatorKind;\r\n // NOTE: this.instances holds instances per bound class / unbound\r\n boundPrototypes.set(classInstance, bound);\r\n return bound;\r\n }\r\n\r\n /** Gets the resolved instance for the specified instance key, if already resolved. */\r\n getResolvedInstance(instanceKey: string): Function | null {\r\n var instances = this.instances;\r\n if (instances && instances.has(instanceKey)) return instances.get(instanceKey);\r\n return null;\r\n }\r\n\r\n /** Sets the resolved instance for the specified instance key. */\r\n setResolvedInstance(instanceKey: string, instance: Function): void {\r\n var instances = this.instances;\r\n if (!instances) this.instances = instances = new Map();\r\n else assert(!instances.has(instanceKey));\r\n instances.set(instanceKey, instance);\r\n }\r\n\r\n /* @override */\r\n lookup(name: string): Element | null {\r\n return this.parent.lookup(name);\r\n }\r\n}\r\n\r\n/** A resolved function. */\r\nexport class Function extends TypedElement {\r\n\r\n /** Function prototype. */\r\n prototype: FunctionPrototype;\r\n /** Function signature. */\r\n signature: Signature;\r\n /** Map of locals by name. */\r\n localsByName: Map = new Map();\r\n /** Array of locals by index. */\r\n localsByIndex: Local[] = [];\r\n /** List of additional non-parameter locals. */\r\n additionalLocals: Type[] = [];\r\n /** Contextual type arguments. */\r\n contextualTypeArguments: Map | null;\r\n /** Default control flow. */\r\n flow: Flow;\r\n /** Remembered debug locations. */\r\n debugLocations: Range[] = [];\r\n /** Function reference, if compiled. */\r\n ref: FunctionRef = 0;\r\n /** Function table index, if any. */\r\n functionTableIndex: i32 = -1;\r\n /** Trampoline function for calling with omitted arguments. */\r\n trampoline: Function | null = null;\r\n\r\n /** Counting id of inline operations involving this function. */\r\n nextInlineId: i32 = 0;\r\n /** Counting id of anonymous inner functions. */\r\n nextAnonymousId: i32 = 0;\r\n\r\n /** Constructs a new concrete function. */\r\n constructor(\r\n /** Name incl. type parameters, i.e. `foo`. */\r\n nameInclTypeParameters: string,\r\n /** Respective function prototype. */\r\n prototype: FunctionPrototype,\r\n /** Concrete signature. */\r\n signature: Signature, // pre-resolved\r\n /** Contextual type arguments inherited from its parent class, if any. */\r\n contextualTypeArguments: Map | null = null\r\n ) {\r\n super(\r\n ElementKind.FUNCTION,\r\n nameInclTypeParameters,\r\n mangleInternalName(nameInclTypeParameters, prototype.parent, prototype.is(CommonFlags.INSTANCE)),\r\n prototype.program,\r\n prototype.parent,\r\n prototype.declaration\r\n );\r\n this.prototype = prototype;\r\n this.signature = signature;\r\n this.flags = prototype.flags | CommonFlags.RESOLVED;\r\n this.decoratorFlags = prototype.decoratorFlags;\r\n this.contextualTypeArguments = contextualTypeArguments;\r\n this.type = Type.u32.asFunction(signature);\r\n if (!prototype.is(CommonFlags.AMBIENT)) {\r\n let localIndex = 0;\r\n if (this.is(CommonFlags.INSTANCE)) {\r\n let local = new Local(\r\n CommonSymbols.this_,\r\n localIndex++,\r\n assert(signature.thisType),\r\n this\r\n );\r\n this.localsByName.set(CommonSymbols.this_, local);\r\n this.localsByIndex[local.index] = local;\r\n }\r\n let parameterTypes = signature.parameterTypes;\r\n for (let i = 0, k = parameterTypes.length; i < k; ++i) {\r\n let parameterType = parameterTypes[i];\r\n let parameterName = signature.getParameterName(i);\r\n let local = new Local(\r\n parameterName,\r\n localIndex++,\r\n parameterType,\r\n this\r\n );\r\n this.localsByName.set(parameterName, local);\r\n this.localsByIndex[local.index] = local;\r\n }\r\n }\r\n this.flow = Flow.create(this);\r\n registerConcreteElement(this.program, this);\r\n }\r\n\r\n /** Adds a local of the specified type, with an optional name. */\r\n addLocal(type: Type, name: string | null = null, declaration: VariableDeclaration | null = null): Local {\r\n // if it has a name, check previously as this method will throw otherwise\r\n var localIndex = this.signature.parameterTypes.length + this.additionalLocals.length;\r\n if (this.is(CommonFlags.INSTANCE)) ++localIndex;\r\n var localName = name !== null\r\n ? name\r\n : \"var$\" + localIndex.toString();\r\n var local = new Local(\r\n localName,\r\n localIndex,\r\n type,\r\n this,\r\n declaration || this.program.makeNativeVariableDeclaration(localName)\r\n );\r\n if (name) {\r\n if (this.localsByName.has(name)) throw new Error(\"duplicate local name\");\r\n this.localsByName.set(name, local);\r\n }\r\n this.localsByIndex[local.index] = local;\r\n this.additionalLocals.push(type);\r\n return local;\r\n }\r\n\r\n /* @override */\r\n lookup(name: string): Element | null {\r\n var locals = this.localsByName;\r\n if (locals.has(name)) return locals.get(name);\r\n return this.parent.lookup(name);\r\n }\r\n\r\n // used by flows to keep track of temporary locals\r\n tempI32s: Local[] | null = null;\r\n tempI64s: Local[] | null = null;\r\n tempF32s: Local[] | null = null;\r\n tempF64s: Local[] | null = null;\r\n tempV128s: Local[] | null = null;\r\n\r\n // used by flows to keep track of break labels\r\n nextBreakId: i32 = 0;\r\n breakStack: i32[] | null = null;\r\n breakLabel: string | null = null;\r\n\r\n /** Finalizes the function once compiled, releasing no longer needed resources. */\r\n finalize(module: Module, ref: FunctionRef): void {\r\n this.ref = ref;\r\n assert(!this.breakStack || !this.breakStack.length); // internal error\r\n this.breakStack = null;\r\n this.breakLabel = null;\r\n this.tempI32s = this.tempI64s = this.tempF32s = this.tempF64s = null;\r\n if (this.program.options.sourceMap) {\r\n let debugLocations = this.debugLocations;\r\n for (let i = 0, k = debugLocations.length; i < k; ++i) {\r\n let debugLocation = debugLocations[i];\r\n module.setDebugLocation(\r\n ref,\r\n debugLocation.debugInfoRef,\r\n debugLocation.source.debugInfoIndex,\r\n debugLocation.line,\r\n debugLocation.column\r\n );\r\n }\r\n }\r\n }\r\n}\r\n\r\n/** A resolved function target, that is a function called indirectly by an index and signature. */\r\nexport class FunctionTarget extends Element {\r\n\r\n /** Underlying signature. */\r\n signature: Signature;\r\n /** Function type. */\r\n type: Type;\r\n\r\n /** Constructs a new function target. */\r\n constructor(\r\n /** Concrete signature. */\r\n signature: Signature,\r\n /** Program reference. */\r\n program: Program,\r\n __s: string = \"\" // FIXME: current TS limitation workaround, but a fix seems underway\r\n ) {\r\n super(\r\n ElementKind.FUNCTION_TARGET,\r\n __s = \"sig:\" + signature.toSignatureString(),\r\n __s,\r\n program,\r\n program.nativeFile\r\n );\r\n this.signature = signature;\r\n this.flags = CommonFlags.RESOLVED;\r\n this.type = Type.u32.asFunction(signature);\r\n }\r\n\r\n /* @override */\r\n lookup(name: string): Element | null {\r\n return null;\r\n }\r\n}\r\n\r\n/** A yet unresolved instance field prototype. */\r\nexport class FieldPrototype extends DeclaredElement {\r\n\r\n /** Constructs a new field prototype. */\r\n constructor(\r\n /** Simple name. */\r\n name: string,\r\n /** Parent class. */\r\n parent: ClassPrototype,\r\n /** Declaration reference. */\r\n declaration: FieldDeclaration,\r\n /** Pre-checked flags indicating built-in decorators. */\r\n decoratorFlags: DecoratorFlags = DecoratorFlags.NONE\r\n ) {\r\n super(\r\n ElementKind.FIELD_PROTOTYPE,\r\n name,\r\n mangleInternalName(name, parent, assert(declaration.is(CommonFlags.INSTANCE))),\r\n parent.program,\r\n parent,\r\n declaration\r\n );\r\n this.decoratorFlags = decoratorFlags;\r\n }\r\n\r\n /** Gets the associated type node. */\r\n get typeNode(): CommonTypeNode | null {\r\n return (this.declaration).type;\r\n }\r\n\r\n /** Gets the associated initializer node. */\r\n get initializerNode(): Expression | null {\r\n return (this.declaration).initializer;\r\n }\r\n\r\n /** Gets the associated parameter index. Set if declared as a constructor parameter, otherwise `-1`. */\r\n get parameterIndex(): i32 {\r\n return (this.declaration).parameterIndex;\r\n }\r\n\r\n /* @override */\r\n lookup(name: string): Element | null {\r\n return this.parent.lookup(name);\r\n }\r\n}\r\n\r\n/** A resolved instance field. */\r\nexport class Field extends VariableLikeElement {\r\n\r\n /** Field prototype reference. */\r\n prototype: FieldPrototype;\r\n /** Field memory offset, if an instance field. */\r\n memoryOffset: i32 = -1;\r\n\r\n /** Constructs a new field. */\r\n constructor(\r\n /** Respective field prototype. */\r\n prototype: FieldPrototype,\r\n /** Parent class. */\r\n parent: Class,\r\n /** Concrete type. */\r\n type: Type\r\n ) {\r\n super(\r\n ElementKind.FIELD,\r\n prototype.name,\r\n parent,\r\n prototype.declaration\r\n );\r\n this.prototype = prototype;\r\n this.flags = prototype.flags;\r\n assert(type != Type.void);\r\n this.setType(type);\r\n registerConcreteElement(this.program, this);\r\n }\r\n}\r\n\r\n/** A property comprised of a getter and a setter function. */\r\nexport class PropertyPrototype extends DeclaredElement {\r\n\r\n /** Getter prototype. */\r\n getterPrototype: FunctionPrototype | null = null;\r\n /** Setter prototype. */\r\n setterPrototype: FunctionPrototype | null = null;\r\n\r\n /** Constructs a new property prototype. */\r\n constructor(\r\n /** Simple name. */\r\n name: string,\r\n /** Parent class. */\r\n parent: ClassPrototype,\r\n /** Declaration of the getter or setter introducing the property. */\r\n firstDeclaration: FunctionDeclaration\r\n ) {\r\n super(\r\n ElementKind.PROPERTY_PROTOTYPE,\r\n name,\r\n mangleInternalName(name, parent, firstDeclaration.is(CommonFlags.INSTANCE)),\r\n parent.program,\r\n parent,\r\n firstDeclaration\r\n );\r\n this.flags &= ~(CommonFlags.GET | CommonFlags.SET);\r\n }\r\n\r\n /* @override */\r\n lookup(name: string): Element | null {\r\n return this.parent.lookup(name);\r\n }\r\n}\r\n\r\n/** A resolved property. */\r\nexport class Property extends VariableLikeElement {\r\n\r\n /** Prototype reference. */\r\n prototype: PropertyPrototype;\r\n /** Getter instance. */\r\n getterInstance: Function | null = null;\r\n /** Setter instance. */\r\n setterInstance: Function | null = null;\r\n\r\n /** Constructs a new property prototype. */\r\n constructor(\r\n /** Respective property prototype. */\r\n prototype: PropertyPrototype,\r\n /** Parent element, usually a static class prototype or class instance. */\r\n parent: Element\r\n ) {\r\n super(\r\n ElementKind.PROPERTY,\r\n prototype.name,\r\n parent,\r\n prototype.program.makeNativeVariableDeclaration(\r\n prototype.name,\r\n prototype.is(CommonFlags.INSTANCE)\r\n ? CommonFlags.INSTANCE\r\n : CommonFlags.NONE\r\n )\r\n );\r\n this.prototype = prototype;\r\n registerConcreteElement(this.program, this);\r\n }\r\n\r\n /* @override */\r\n lookup(name: string): Element | null {\r\n return this.parent.lookup(name);\r\n }\r\n}\r\n\r\n/** A yet unresolved class prototype. */\r\nexport class ClassPrototype extends DeclaredElement {\r\n\r\n /** Instance member prototypes. */\r\n instanceMembers: Map | null = null;\r\n /** Base class prototype, if applicable. */\r\n basePrototype: ClassPrototype | null = null; // set in Program#initialize\r\n /** Constructor prototype. */\r\n constructorPrototype: FunctionPrototype | null = null;\r\n /** Operator overload prototypes. */\r\n overloadPrototypes: Map = new Map();\r\n /** Already resolved instances. */\r\n instances: Map | null = null;\r\n\r\n constructor(\r\n /** Simple name. */\r\n name: string,\r\n /** Parent element, usually a file or namespace. */\r\n parent: Element,\r\n /** Declaration reference. */\r\n declaration: ClassDeclaration,\r\n /** Pre-checked flags indicating built-in decorators. */\r\n decoratorFlags: DecoratorFlags = DecoratorFlags.NONE,\r\n _isInterface: bool = false // FIXME\r\n ) {\r\n super(\r\n _isInterface ? ElementKind.INTERFACE_PROTOTYPE : ElementKind.CLASS_PROTOTYPE,\r\n name,\r\n mangleInternalName(name, parent, declaration.is(CommonFlags.INSTANCE)),\r\n parent.program,\r\n parent,\r\n declaration\r\n );\r\n this.decoratorFlags = decoratorFlags;\r\n }\r\n\r\n /** Gets the associated type parameter nodes. */\r\n get typeParameterNodes(): TypeParameterNode[] | null {\r\n return (this.declaration).typeParameters;\r\n }\r\n /** Gets the associated extends node. */\r\n get extendsNode(): TypeNode | null {\r\n return (this.declaration).extendsType;\r\n }\r\n /** Gets the associated implements nodes. */\r\n get implementsNodes(): TypeNode[] | null {\r\n return (this.declaration).implementsTypes;\r\n }\r\n\r\n /** Tests if this prototype extends the specified. */\r\n extends(basePtototype: ClassPrototype | null): bool {\r\n var current: ClassPrototype | null = this;\r\n do {\r\n if (current === basePtototype) return true;\r\n } while (current = current.basePrototype);\r\n return false;\r\n }\r\n\r\n /** Adds an element as an instance member of this one. Returns the previous element if a duplicate. */\r\n addInstance(name: string, element: DeclaredElement): bool {\r\n var originalDeclaration = element.declaration;\r\n var instanceMembers = this.instanceMembers;\r\n if (!instanceMembers) this.instanceMembers = instanceMembers = new Map();\r\n else if (instanceMembers.has(name)) {\r\n let merged = tryMerge(instanceMembers.get(name)!, element);\r\n if (!merged) {\r\n this.program.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n element.identifierNode.range, element.identifierNode.text\r\n );\r\n return false;\r\n }\r\n element = merged;\r\n }\r\n instanceMembers.set(name, element);\r\n if (element.is(CommonFlags.EXPORT) && this.is(CommonFlags.MODULE_EXPORT)) {\r\n element.set(CommonFlags.MODULE_EXPORT); // propagate\r\n }\r\n this.program.elementsByDeclaration.set(originalDeclaration, element);\r\n return true;\r\n }\r\n\r\n /** Gets the resolved instance for the specified instance key, if already resolved. */\r\n getResolvedInstance(instanceKey: string): Class | null {\r\n var instances = this.instances;\r\n if (instances && instances.has(instanceKey)) return instances.get(instanceKey);\r\n return null;\r\n }\r\n\r\n /** Sets the resolved instance for the specified instance key. */\r\n setResolvedInstance(instanceKey: string, instance: Class): void {\r\n var instances = this.instances;\r\n if (!instances) this.instances = instances = new Map();\r\n else assert(!instances.has(instanceKey));\r\n instances.set(instanceKey, instance);\r\n }\r\n\r\n /* @override */\r\n lookup(name: string): Element | null {\r\n return this.parent.lookup(name);\r\n }\r\n}\r\n\r\n/** A resolved class. */\r\nexport class Class extends TypedElement {\r\n\r\n /** Class prototype. */\r\n prototype: ClassPrototype;\r\n /** Resolved type arguments. */\r\n typeArguments: Type[] | null;\r\n /** Base class, if applicable. */\r\n base: Class | null;\r\n /** Contextual type arguments for fields and methods. */\r\n contextualTypeArguments: Map | null = null;\r\n /** Current member memory offset. */\r\n currentMemoryOffset: u32 = 0;\r\n /** Constructor instance. */\r\n constructorInstance: Function | null = null;\r\n /** Operator overloads. */\r\n overloads: Map | null = null;\r\n /** Function index of the GC hook. */\r\n gcHookIndex: u32 = -1;\r\n\r\n /** Constructs a new class. */\r\n constructor(\r\n /** Name incl. type parameters, i.e. `Foo`. */\r\n nameInclTypeParameters: string,\r\n /** The respective class prototype. */\r\n prototype: ClassPrototype,\r\n /** Concrete type arguments, if any. */\r\n typeArguments: Type[] | null = null,\r\n /** Base class, if derived. */\r\n base: Class | null = null,\r\n _isInterface: bool = false // FIXME\r\n ) {\r\n super(\r\n _isInterface ? ElementKind.INTERFACE : ElementKind.CLASS,\r\n nameInclTypeParameters,\r\n mangleInternalName(nameInclTypeParameters, prototype.parent, prototype.is(CommonFlags.INSTANCE)),\r\n prototype.program,\r\n prototype.parent,\r\n prototype.declaration\r\n );\r\n this.prototype = prototype;\r\n this.flags = prototype.flags;\r\n this.decoratorFlags = prototype.decoratorFlags;\r\n this.typeArguments = typeArguments;\r\n this.setType(this.program.options.usizeType.asClass(this));\r\n this.base = base;\r\n\r\n // inherit static members and contextual type arguments from base class\r\n if (base) {\r\n let inheritedTypeArguments = base.contextualTypeArguments;\r\n if (inheritedTypeArguments) {\r\n let contextualTypeArguments = this.contextualTypeArguments;\r\n for (let [baseName, baseType] of inheritedTypeArguments) {\r\n if (!contextualTypeArguments) this.contextualTypeArguments = contextualTypeArguments = new Map();\r\n contextualTypeArguments.set(baseName, baseType);\r\n }\r\n }\r\n }\r\n\r\n // apply pre-checked instance-specific contextual type arguments\r\n var typeParameters = prototype.typeParameterNodes;\r\n if (typeArguments) {\r\n let numTypeArguments = typeArguments.length;\r\n if (!typeParameters || numTypeArguments != typeParameters.length) {\r\n throw new Error(\"type argument count mismatch\");\r\n }\r\n if (numTypeArguments) {\r\n if (!this.contextualTypeArguments) this.contextualTypeArguments = new Map();\r\n for (let i = 0; i < numTypeArguments; ++i) {\r\n this.contextualTypeArguments.set(typeParameters[i].name.text, typeArguments[i]);\r\n }\r\n }\r\n } else if (typeParameters && typeParameters.length) {\r\n throw new Error(\"type argument count mismatch\");\r\n }\r\n registerConcreteElement(this.program, this);\r\n }\r\n\r\n /** Tests if a value of this class type is assignable to a target of the specified class type. */\r\n isAssignableTo(target: Class): bool {\r\n var current: Class | null = this;\r\n do if (current == target) return true;\r\n while (current = current.base);\r\n return false;\r\n }\r\n\r\n /** Looks up the operator overload of the specified kind. */\r\n lookupOverload(kind: OperatorKind, unchecked: bool = false): Function | null {\r\n if (unchecked) {\r\n switch (kind) {\r\n case OperatorKind.INDEXED_GET: {\r\n let uncheckedOverload = this.lookupOverload(OperatorKind.UNCHECKED_INDEXED_GET);\r\n if (uncheckedOverload) return uncheckedOverload;\r\n break;\r\n }\r\n case OperatorKind.INDEXED_SET: {\r\n let uncheckedOverload = this.lookupOverload(OperatorKind.UNCHECKED_INDEXED_SET);\r\n if (uncheckedOverload) return uncheckedOverload;\r\n break;\r\n }\r\n default: assert(false);\r\n }\r\n }\r\n var instance: Class | null = this;\r\n do {\r\n let overloads = instance.overloads;\r\n if (overloads) {\r\n let overload = overloads.get(kind);\r\n if (overload) return overload;\r\n }\r\n } while (instance = instance.base);\r\n return null;\r\n }\r\n\r\n /* @override */\r\n lookup(name: string): Element | null {\r\n return this.parent.lookup(name);\r\n }\r\n\r\n /** Calculates the memory offset of the specified field. */\r\n offsetof(fieldName: string): u32 {\r\n var members = assert(this.members);\r\n assert(members.has(fieldName));\r\n var field = members.get(fieldName);\r\n assert(field.kind == ElementKind.FIELD);\r\n return (field).memoryOffset;\r\n }\r\n}\r\n\r\n/** A yet unresolved interface. */\r\nexport class InterfacePrototype extends ClassPrototype { // FIXME\r\n\r\n /** Constructs a new interface prototype. */\r\n constructor(\r\n name: string,\r\n parent: Element,\r\n declaration: InterfaceDeclaration,\r\n decoratorFlags: DecoratorFlags\r\n ) {\r\n super(\r\n name,\r\n parent,\r\n declaration,\r\n decoratorFlags,\r\n true\r\n );\r\n }\r\n}\r\n\r\n/** A resolved interface. */\r\nexport class Interface extends Class { // FIXME\r\n\r\n /** Constructs a new interface. */\r\n constructor(\r\n nameInclTypeParameters: string,\r\n prototype: InterfacePrototype,\r\n typeArguments: Type[] = [],\r\n base: Interface | null = null\r\n ) {\r\n super(\r\n nameInclTypeParameters,\r\n prototype,\r\n typeArguments,\r\n base,\r\n true\r\n );\r\n }\r\n}\r\n\r\n/** Registers a concrete element with a program. */\r\nfunction registerConcreteElement(program: Program, element: Element): void {\r\n assert(!program.instancesByName.has(element.internalName));\r\n program.instancesByName.set(element.internalName, element);\r\n}\r\n\r\n/** Attempts to merge two elements. Returns the merged element on success. */\r\nfunction tryMerge(older: Element, newer: Element): DeclaredElement | null {\r\n // NOTE: some of the following cases are not supported by TS, not sure why exactly.\r\n // suggesting to just merge what seems to be possible for now and revisit later.\r\n assert(older.program === newer.program);\r\n assert(!newer.members);\r\n var merged: DeclaredElement | null = null;\r\n switch (older.kind) {\r\n case ElementKind.FUNCTION_PROTOTYPE: {\r\n switch (newer.kind) {\r\n case ElementKind.NAMESPACE: {\r\n copyMembers(newer, older);\r\n merged = older;\r\n break;\r\n }\r\n case ElementKind.TYPEDEFINITION: {\r\n if (!older.shadowType) {\r\n older.shadowType = newer;\r\n copyMembers(newer, older);\r\n merged = older;\r\n }\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n case ElementKind.CLASS_PROTOTYPE:\r\n case ElementKind.ENUM: {\r\n if (newer.kind == ElementKind.NAMESPACE) {\r\n copyMembers(newer, older);\r\n merged = older;\r\n break;\r\n }\r\n break;\r\n }\r\n case ElementKind.NAMESPACE: {\r\n switch (newer.kind) {\r\n case ElementKind.ENUM:\r\n case ElementKind.CLASS_PROTOTYPE: // TS2434\r\n case ElementKind.FUNCTION_PROTOTYPE: { // TS2434\r\n copyMembers(older, newer);\r\n merged = newer;\r\n break;\r\n }\r\n case ElementKind.NAMESPACE: {\r\n copyMembers(newer, older);\r\n merged = older;\r\n break;\r\n }\r\n case ElementKind.TYPEDEFINITION: {\r\n if (!older.shadowType) {\r\n older.shadowType = newer;\r\n copyMembers(newer, older);\r\n merged = older;\r\n }\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n case ElementKind.GLOBAL: {\r\n if (newer.kind == ElementKind.TYPEDEFINITION) {\r\n if (!older.shadowType) {\r\n older.shadowType = newer;\r\n copyMembers(newer, older);\r\n merged = older;\r\n }\r\n }\r\n break;\r\n }\r\n case ElementKind.TYPEDEFINITION: {\r\n switch (newer.kind) {\r\n case ElementKind.GLOBAL:\r\n case ElementKind.FUNCTION_PROTOTYPE:\r\n case ElementKind.NAMESPACE: {\r\n if (!newer.shadowType) {\r\n newer.shadowType = older;\r\n copyMembers(older, newer);\r\n merged = newer;\r\n }\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n if (merged) {\r\n if (older.is(CommonFlags.EXPORT) != newer.is(CommonFlags.EXPORT)) {\r\n older.program.error(\r\n DiagnosticCode.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local,\r\n merged.identifierNode.range, merged.identifierNode.text\r\n );\r\n }\r\n }\r\n return merged;\r\n}\r\n\r\n/** Copies the members of `src` to `dest`. */\r\nfunction copyMembers(src: Element, dest: Element): void {\r\n var srcMembers = src.members;\r\n if (srcMembers) {\r\n let destMembers = dest.members;\r\n if (!destMembers) dest.members = destMembers = new Map();\r\n for (let [memberName, member] of srcMembers) {\r\n destMembers.set(memberName, member);\r\n }\r\n }\r\n}\r\n\r\n/** Mangles the internal name of an element with the specified name that is a child of the given parent. */\r\nexport function mangleInternalName(name: string, parent: Element, isInstance: bool, asGlobal: bool = false): string {\r\n switch (parent.kind) {\r\n case ElementKind.FILE: {\r\n if (asGlobal) return name;\r\n return parent.internalName + PATH_DELIMITER + name;\r\n }\r\n case ElementKind.FUNCTION: {\r\n if (asGlobal) return name;\r\n assert(!isInstance);\r\n return parent.internalName + INNER_DELIMITER + name;\r\n }\r\n default: {\r\n return mangleInternalName(parent.name, parent.parent, parent.is(CommonFlags.INSTANCE), asGlobal)\r\n + (isInstance ? INSTANCE_DELIMITER : STATIC_DELIMITER) + name;\r\n }\r\n }\r\n}\r\n","/**\r\n * A thin wrapper around Binaryen's C-API.\r\n * @module module\r\n *//***/\r\n\r\nimport {\r\n Target\r\n} from \"./compiler\";\r\n\r\nexport type ModuleRef = usize;\r\nexport type FunctionTypeRef = usize;\r\nexport type FunctionRef = usize;\r\nexport type ExpressionRef = usize;\r\nexport type GlobalRef = usize;\r\nexport type ImportRef = usize;\r\nexport type ExportRef = usize;\r\nexport type RelooperRef = usize;\r\nexport type RelooperBlockRef = usize;\r\nexport type Index = u32;\r\n\r\nexport enum NativeType {\r\n None = _BinaryenTypeNone(),\r\n I32 = _BinaryenTypeInt32(),\r\n I64 = _BinaryenTypeInt64(),\r\n F32 = _BinaryenTypeFloat32(),\r\n F64 = _BinaryenTypeFloat64(),\r\n V128 = _BinaryenTypeVec128(),\r\n Unreachable = _BinaryenTypeUnreachable(),\r\n Auto = _BinaryenTypeAuto()\r\n}\r\n\r\nexport enum ExpressionId {\r\n Invalid = _BinaryenInvalidId(),\r\n Block = _BinaryenBlockId(),\r\n If = _BinaryenIfId(),\r\n Loop = _BinaryenLoopId(),\r\n Break = _BinaryenBreakId(),\r\n Switch = _BinaryenSwitchId(),\r\n Call = _BinaryenCallId(),\r\n CallIndirect = _BinaryenCallIndirectId(),\r\n GetLocal = _BinaryenGetLocalId(),\r\n SetLocal = _BinaryenSetLocalId(),\r\n GetGlobal = _BinaryenGetGlobalId(),\r\n SetGlobal = _BinaryenSetGlobalId(),\r\n Load = _BinaryenLoadId(),\r\n Store = _BinaryenStoreId(),\r\n Const = _BinaryenConstId(),\r\n Unary = _BinaryenUnaryId(),\r\n Binary = _BinaryenBinaryId(),\r\n Select = _BinaryenSelectId(),\r\n Drop = _BinaryenDropId(),\r\n Return = _BinaryenReturnId(),\r\n Host = _BinaryenHostId(),\r\n Nop = _BinaryenNopId(),\r\n Unreachable = _BinaryenUnreachableId(),\r\n AtomicCmpxchg = _BinaryenAtomicCmpxchgId(),\r\n AtomicRMW = _BinaryenAtomicRMWId(),\r\n AtomicWait = _BinaryenAtomicWaitId(),\r\n AtomicNotify = _BinaryenAtomicNotifyId(),\r\n SIMDExtract = _BinaryenSIMDExtractId(),\r\n SIMDReplace = _BinaryenSIMDReplaceId(),\r\n SIMDShuffle = _BinaryenSIMDShuffleId(),\r\n SIMDBitselect = _BinaryenSIMDBitselectId(),\r\n SIMDShift = _BinaryenSIMDShiftId(),\r\n MemoryInit = _BinaryenMemoryInitId(),\r\n DataDrop = _BinaryenDataDropId(),\r\n MemoryCopy = _BinaryenMemoryCopyId(),\r\n MemoryFill = _BinaryenMemoryFillId()\r\n}\r\n\r\nexport enum UnaryOp {\r\n ClzI32 = _BinaryenClzInt32(),\r\n CtzI32 = _BinaryenCtzInt32(),\r\n PopcntI32 = _BinaryenPopcntInt32(),\r\n NegF32 = _BinaryenNegFloat32(),\r\n AbsF32 = _BinaryenAbsFloat32(),\r\n CeilF32 = _BinaryenCeilFloat32(),\r\n FloorF32 = _BinaryenFloorFloat32(),\r\n TruncF32 = _BinaryenTruncFloat32(),\r\n NearestF32 = _BinaryenNearestFloat32(),\r\n SqrtF32 = _BinaryenSqrtFloat32(),\r\n EqzI32 = _BinaryenEqZInt32(),\r\n ClzI64 = _BinaryenClzInt64(),\r\n CtzI64 = _BinaryenCtzInt64(),\r\n PopcntI64 = _BinaryenPopcntInt64(),\r\n NegF64 = _BinaryenNegFloat64(),\r\n AbsF64 = _BinaryenAbsFloat64(),\r\n CeilF64 = _BinaryenCeilFloat64(),\r\n FloorF64 = _BinaryenFloorFloat64(),\r\n TruncF64 = _BinaryenTruncFloat64(),\r\n NearestF64 = _BinaryenNearestFloat64(),\r\n SqrtF64 = _BinaryenSqrtFloat64(),\r\n EqzI64 = _BinaryenEqZInt64(),\r\n ExtendI32 = _BinaryenExtendSInt32(),\r\n ExtendU32 = _BinaryenExtendUInt32(),\r\n WrapI64 = _BinaryenWrapInt64(),\r\n TruncF32ToI32 = _BinaryenTruncSFloat32ToInt32(),\r\n TruncF32ToI64 = _BinaryenTruncSFloat32ToInt64(),\r\n TruncF32ToU32 = _BinaryenTruncUFloat32ToInt32(),\r\n TruncF32ToU64 = _BinaryenTruncUFloat32ToInt64(),\r\n TruncF64ToI32 = _BinaryenTruncSFloat64ToInt32(),\r\n TruncF64ToI64 = _BinaryenTruncSFloat64ToInt64(),\r\n TruncF64ToU32 = _BinaryenTruncUFloat64ToInt32(),\r\n TruncF64ToU64 = _BinaryenTruncUFloat64ToInt64(),\r\n ReinterpretF32 = _BinaryenReinterpretFloat32(),\r\n ReinterpretF64 = _BinaryenReinterpretFloat64(),\r\n ConvertI32ToF32 = _BinaryenConvertSInt32ToFloat32(),\r\n ConvertI32ToF64 = _BinaryenConvertSInt32ToFloat64(),\r\n ConvertU32ToF32 = _BinaryenConvertUInt32ToFloat32(),\r\n ConvertU32ToF64 = _BinaryenConvertUInt32ToFloat64(),\r\n ConvertI64ToF32 = _BinaryenConvertSInt64ToFloat32(),\r\n ConvertI64ToF64 = _BinaryenConvertSInt64ToFloat64(),\r\n ConvertU64ToF32 = _BinaryenConvertUInt64ToFloat32(),\r\n ConvertU64ToF64 = _BinaryenConvertUInt64ToFloat64(),\r\n PromoteF32 = _BinaryenPromoteFloat32(),\r\n DemoteF64 = _BinaryenDemoteFloat64(),\r\n ReinterpretI32 = _BinaryenReinterpretInt32(),\r\n ReinterpretI64 = _BinaryenReinterpretInt64(),\r\n\r\n // see: https://github.com/WebAssembly/sign-extension-ops\r\n ExtendI8ToI32 = _BinaryenExtendS8Int32(),\r\n ExtendI16ToI32 = _BinaryenExtendS16Int32(),\r\n ExtendI8ToI64 = _BinaryenExtendS8Int64(),\r\n ExtendI16ToI64 = _BinaryenExtendS16Int64(),\r\n ExtendI32ToI64 = _BinaryenExtendS32Int64(),\r\n\r\n // see: https://github.com/WebAssembly/nontrapping-float-to-int-conversions\r\n // TruncF32ToI32Sat\r\n // TruncF32ToU32Sat\r\n // TruncF64ToI32Sat\r\n // TruncF64ToU32Sat\r\n // TruncF32ToI64Sat\r\n // TruncF32ToU64Sat\r\n // TruncF64ToI64Sat\r\n // TruncF64ToU64Sat\r\n\r\n // see: https://github.com/WebAssembly/simd\r\n SplatVecI8x16 = _BinaryenSplatVecI8x16(),\r\n SplatVecI16x8 = _BinaryenSplatVecI16x8(),\r\n SplatVecI32x4 = _BinaryenSplatVecI32x4(),\r\n SplatVecI64x2 = _BinaryenSplatVecI64x2(),\r\n SplatVecF32x4 = _BinaryenSplatVecF32x4(),\r\n SplatVecF64x2 = _BinaryenSplatVecF64x2(),\r\n NotVec128 = _BinaryenNotVec128(),\r\n NegVecI8x16 = _BinaryenNegVecI8x16(),\r\n AnyTrueVecI8x16 = _BinaryenAnyTrueVecI8x16(),\r\n AllTrueVecI8x16 = _BinaryenAllTrueVecI8x16(),\r\n NegVecI16x8 = _BinaryenNegVecI16x8(),\r\n AnyTrueVecI16x8 = _BinaryenAnyTrueVecI16x8(),\r\n AllTrueVecI16x8 = _BinaryenAllTrueVecI16x8(),\r\n NegVecI32x4 = _BinaryenNegVecI32x4(),\r\n AnyTrueVecI32x4 = _BinaryenAnyTrueVecI32x4(),\r\n AllTrueVecI32x4 = _BinaryenAllTrueVecI32x4(),\r\n NegVecI64x2 = _BinaryenNegVecI64x2(),\r\n AnyTrueVecI64x2 = _BinaryenAnyTrueVecI64x2(),\r\n AllTrueVecI64x2 = _BinaryenAllTrueVecI64x2(),\r\n AbsVecF32x4 = _BinaryenAbsVecF32x4(),\r\n NegVecF32x4 = _BinaryenNegVecF32x4(),\r\n SqrtVecF32x4 = _BinaryenSqrtVecF32x4(),\r\n AbsVecF64x2 = _BinaryenAbsVecF64x2(),\r\n NegVecF64x2 = _BinaryenNegVecF64x2(),\r\n SqrtVecF64x2 = _BinaryenSqrtVecF64x2(),\r\n TruncSatSVecF32x4ToVecI32x4 = _BinaryenTruncSatSVecF32x4ToVecI32x4(),\r\n TruncSatUVecF32x4ToVecI32x4 = _BinaryenTruncSatUVecF32x4ToVecI32x4(),\r\n TruncSatSVecF64x2ToVecI64x2 = _BinaryenTruncSatSVecF64x2ToVecI64x2(),\r\n TruncSatUVecF64x2ToVecI64x2 = _BinaryenTruncSatUVecF64x2ToVecI64x2(),\r\n ConvertSVecI32x4ToVecF32x4 = _BinaryenConvertSVecI32x4ToVecF32x4(),\r\n ConvertUVecI32x4ToVecF32x4 = _BinaryenConvertUVecI32x4ToVecF32x4(),\r\n ConvertSVecI64x2ToVecF64x2 = _BinaryenConvertSVecI64x2ToVecF64x2(),\r\n ConvertUVecI64x2ToVecF64x2 = _BinaryenConvertUVecI64x2ToVecF64x2()\r\n}\r\n\r\nexport enum BinaryOp {\r\n AddI32 = _BinaryenAddInt32(),\r\n SubI32 = _BinaryenSubInt32(),\r\n MulI32 = _BinaryenMulInt32(),\r\n DivI32 = _BinaryenDivSInt32(),\r\n DivU32 = _BinaryenDivUInt32(),\r\n RemI32 = _BinaryenRemSInt32(),\r\n RemU32 = _BinaryenRemUInt32(),\r\n AndI32 = _BinaryenAndInt32(),\r\n OrI32 = _BinaryenOrInt32(),\r\n XorI32 = _BinaryenXorInt32(),\r\n ShlI32 = _BinaryenShlInt32(),\r\n ShrU32 = _BinaryenShrUInt32(),\r\n ShrI32 = _BinaryenShrSInt32(),\r\n RotlI32 = _BinaryenRotLInt32(),\r\n RotrI32 = _BinaryenRotRInt32(),\r\n EqI32 = _BinaryenEqInt32(),\r\n NeI32 = _BinaryenNeInt32(),\r\n LtI32 = _BinaryenLtSInt32(),\r\n LtU32 = _BinaryenLtUInt32(),\r\n LeI32 = _BinaryenLeSInt32(),\r\n LeU32 = _BinaryenLeUInt32(),\r\n GtI32 = _BinaryenGtSInt32(),\r\n GtU32 = _BinaryenGtUInt32(),\r\n GeI32 = _BinaryenGeSInt32(),\r\n GeU32 = _BinaryenGeUInt32(),\r\n AddI64 = _BinaryenAddInt64(),\r\n SubI64 = _BinaryenSubInt64(),\r\n MulI64 = _BinaryenMulInt64(),\r\n DivI64 = _BinaryenDivSInt64(),\r\n DivU64 = _BinaryenDivUInt64(),\r\n RemI64 = _BinaryenRemSInt64(),\r\n RemU64 = _BinaryenRemUInt64(),\r\n AndI64 = _BinaryenAndInt64(),\r\n OrI64 = _BinaryenOrInt64(),\r\n XorI64 = _BinaryenXorInt64(),\r\n ShlI64 = _BinaryenShlInt64(),\r\n ShrU64 = _BinaryenShrUInt64(),\r\n ShrI64 = _BinaryenShrSInt64(),\r\n RotlI64 = _BinaryenRotLInt64(),\r\n RotrI64 = _BinaryenRotRInt64(),\r\n EqI64 = _BinaryenEqInt64(),\r\n NeI64 = _BinaryenNeInt64(),\r\n LtI64 = _BinaryenLtSInt64(),\r\n LtU64 = _BinaryenLtUInt64(),\r\n LeI64 = _BinaryenLeSInt64(),\r\n LeU64 = _BinaryenLeUInt64(),\r\n GtI64 = _BinaryenGtSInt64(),\r\n GtU64 = _BinaryenGtUInt64(),\r\n GeI64 = _BinaryenGeSInt64(),\r\n GeU64 = _BinaryenGeUInt64(),\r\n AddF32 = _BinaryenAddFloat32(),\r\n SubF32 = _BinaryenSubFloat32(),\r\n MulF32 = _BinaryenMulFloat32(),\r\n DivF32 = _BinaryenDivFloat32(),\r\n CopysignF32 = _BinaryenCopySignFloat32(),\r\n MinF32 = _BinaryenMinFloat32(),\r\n MaxF32 = _BinaryenMaxFloat32(),\r\n EqF32 = _BinaryenEqFloat32(),\r\n NeF32 = _BinaryenNeFloat32(),\r\n LtF32 = _BinaryenLtFloat32(),\r\n LeF32 = _BinaryenLeFloat32(),\r\n GtF32 = _BinaryenGtFloat32(),\r\n GeF32 = _BinaryenGeFloat32(),\r\n AddF64 = _BinaryenAddFloat64(),\r\n SubF64 = _BinaryenSubFloat64(),\r\n MulF64 = _BinaryenMulFloat64(),\r\n DivF64 = _BinaryenDivFloat64(),\r\n CopysignF64 = _BinaryenCopySignFloat64(),\r\n MinF64 = _BinaryenMinFloat64(),\r\n MaxF64 = _BinaryenMaxFloat64(),\r\n EqF64 = _BinaryenEqFloat64(),\r\n NeF64 = _BinaryenNeFloat64(),\r\n LtF64 = _BinaryenLtFloat64(),\r\n LeF64 = _BinaryenLeFloat64(),\r\n GtF64 = _BinaryenGtFloat64(),\r\n GeF64 = _BinaryenGeFloat64(),\r\n\r\n // see: https://github.com/WebAssembly/simd\r\n EqVecI8x16 = _BinaryenEqVecI8x16(),\r\n NeVecI8x16 = _BinaryenNeVecI8x16(),\r\n LtSVecI8x16 = _BinaryenLtSVecI8x16(),\r\n LtUVecI8x16 = _BinaryenLtUVecI8x16(),\r\n LeSVecI8x16 = _BinaryenLeSVecI8x16(),\r\n LeUVecI8x16 = _BinaryenLeUVecI8x16(),\r\n GtSVecI8x16 = _BinaryenGtSVecI8x16(),\r\n GtUVecI8x16 = _BinaryenGtUVecI8x16(),\r\n GeSVecI8x16 = _BinaryenGeSVecI8x16(),\r\n GeUVecI8x16 = _BinaryenGeUVecI8x16(),\r\n EqVecI16x8 = _BinaryenEqVecI16x8(),\r\n NeVecI16x8 = _BinaryenNeVecI16x8(),\r\n LtSVecI16x8 = _BinaryenLtSVecI16x8(),\r\n LtUVecI16x8 = _BinaryenLtUVecI16x8(),\r\n LeSVecI16x8 = _BinaryenLeSVecI16x8(),\r\n LeUVecI16x8 = _BinaryenLeUVecI16x8(),\r\n GtSVecI16x8 = _BinaryenGtSVecI16x8(),\r\n GtUVecI16x8 = _BinaryenGtUVecI16x8(),\r\n GeSVecI16x8 = _BinaryenGeSVecI16x8(),\r\n GeUVecI16x8 = _BinaryenGeUVecI16x8(),\r\n EqVecI32x4 = _BinaryenEqVecI32x4(),\r\n NeVecI32x4 = _BinaryenNeVecI32x4(),\r\n LtSVecI32x4 = _BinaryenLtSVecI32x4(),\r\n LtUVecI32x4 = _BinaryenLtUVecI32x4(),\r\n LeSVecI32x4 = _BinaryenLeSVecI32x4(),\r\n LeUVecI32x4 = _BinaryenLeUVecI32x4(),\r\n GtSVecI32x4 = _BinaryenGtSVecI32x4(),\r\n GtUVecI32x4 = _BinaryenGtUVecI32x4(),\r\n GeSVecI32x4 = _BinaryenGeSVecI32x4(),\r\n GeUVecI32x4 = _BinaryenGeUVecI32x4(),\r\n EqVecF32x4 = _BinaryenEqVecF32x4(),\r\n NeVecF32x4 = _BinaryenNeVecF32x4(),\r\n LtVecF32x4 = _BinaryenLtVecF32x4(),\r\n LeVecF32x4 = _BinaryenLeVecF32x4(),\r\n GtVecF32x4 = _BinaryenGtVecF32x4(),\r\n GeVecF32x4 = _BinaryenGeVecF32x4(),\r\n EqVecF64x2 = _BinaryenEqVecF64x2(),\r\n NeVecF64x2 = _BinaryenNeVecF64x2(),\r\n LtVecF64x2 = _BinaryenLtVecF64x2(),\r\n LeVecF64x2 = _BinaryenLeVecF64x2(),\r\n GtVecF64x2 = _BinaryenGtVecF64x2(),\r\n GeVecF64x2 = _BinaryenGeVecF64x2(),\r\n AndVec128 = _BinaryenAndVec128(),\r\n OrVec128 = _BinaryenOrVec128(),\r\n XorVec128 = _BinaryenXorVec128(),\r\n AddVecI8x16 = _BinaryenAddVecI8x16(),\r\n AddSatSVecI8x16 = _BinaryenAddSatSVecI8x16(),\r\n AddSatUVecI8x16 = _BinaryenAddSatUVecI8x16(),\r\n SubVecI8x16 = _BinaryenSubVecI8x16(),\r\n SubSatSVecI8x16 = _BinaryenSubSatSVecI8x16(),\r\n SubSatUVecI8x16 = _BinaryenSubSatUVecI8x16(),\r\n MulVecI8x16 = _BinaryenMulVecI8x16(),\r\n AddVecI16x8 = _BinaryenAddVecI16x8(),\r\n AddSatSVecI16x8 = _BinaryenAddSatSVecI16x8(),\r\n AddSatUVecI16x8 = _BinaryenAddSatUVecI16x8(),\r\n SubVecI16x8 = _BinaryenSubVecI16x8(),\r\n SubSatSVecI16x8 = _BinaryenSubSatSVecI16x8(),\r\n SubSatUVecI16x8 = _BinaryenSubSatUVecI16x8(),\r\n MulVecI16x8 = _BinaryenMulVecI16x8(),\r\n AddVecI32x4 = _BinaryenAddVecI32x4(),\r\n SubVecI32x4 = _BinaryenSubVecI32x4(),\r\n MulVecI32x4 = _BinaryenMulVecI32x4(),\r\n AddVecI64x2 = _BinaryenAddVecI64x2(),\r\n SubVecI64x2 = _BinaryenSubVecI64x2(),\r\n AddVecF32x4 = _BinaryenAddVecF32x4(),\r\n SubVecF32x4 = _BinaryenSubVecF32x4(),\r\n MulVecF32x4 = _BinaryenMulVecF32x4(),\r\n DivVecF32x4 = _BinaryenDivVecF32x4(),\r\n MinVecF32x4 = _BinaryenMinVecF32x4(),\r\n MaxVecF32x4 = _BinaryenMaxVecF32x4(),\r\n AddVecF64x2 = _BinaryenAddVecF64x2(),\r\n SubVecF64x2 = _BinaryenSubVecF64x2(),\r\n MulVecF64x2 = _BinaryenMulVecF64x2(),\r\n DivVecF64x2 = _BinaryenDivVecF64x2(),\r\n MinVecF64x2 = _BinaryenMinVecF64x2(),\r\n MaxVecF64x2 = _BinaryenMaxVecF64x2()\r\n}\r\n\r\nexport enum HostOp {\r\n CurrentMemory = _BinaryenCurrentMemory(),\r\n GrowMemory = _BinaryenGrowMemory(),\r\n}\r\n\r\nexport enum AtomicRMWOp {\r\n Add = _BinaryenAtomicRMWAdd(),\r\n Sub = _BinaryenAtomicRMWSub(),\r\n And = _BinaryenAtomicRMWAnd(),\r\n Or = _BinaryenAtomicRMWOr(),\r\n Xor = _BinaryenAtomicRMWXor(),\r\n Xchg = _BinaryenAtomicRMWXchg()\r\n}\r\n\r\nexport enum SIMDExtractOp {\r\n ExtractLaneSVecI8x16 = _BinaryenExtractLaneSVecI8x16(),\r\n ExtractLaneUVecI8x16 = _BinaryenExtractLaneUVecI8x16(),\r\n ExtractLaneSVecI16x8 = _BinaryenExtractLaneSVecI16x8(),\r\n ExtractLaneUVecI16x8 = _BinaryenExtractLaneUVecI16x8(),\r\n ExtractLaneVecI32x4 = _BinaryenExtractLaneVecI32x4(),\r\n ExtractLaneVecI64x2 = _BinaryenExtractLaneVecI64x2(),\r\n ExtractLaneVecF32x4 = _BinaryenExtractLaneVecF32x4(),\r\n ExtractLaneVecF64x2 = _BinaryenExtractLaneVecF64x2(),\r\n}\r\n\r\nexport enum SIMDReplaceOp {\r\n ReplaceLaneVecI8x16 = _BinaryenReplaceLaneVecI8x16(),\r\n ReplaceLaneVecI16x8 = _BinaryenReplaceLaneVecI16x8(),\r\n ReplaceLaneVecI32x4 = _BinaryenReplaceLaneVecI32x4(),\r\n ReplaceLaneVecI64x2 = _BinaryenReplaceLaneVecI64x2(),\r\n ReplaceLaneVecF32x4 = _BinaryenReplaceLaneVecF32x4(),\r\n ReplaceLaneVecF64x2 = _BinaryenReplaceLaneVecF64x2()\r\n}\r\n\r\nexport enum SIMDShiftOp {\r\n ShlVecI8x16 = _BinaryenShlVecI8x16(),\r\n ShrSVecI8x16 = _BinaryenShrSVecI8x16(),\r\n ShrUVecI8x16 = _BinaryenShrUVecI8x16(),\r\n ShlVecI16x8 = _BinaryenShlVecI16x8(),\r\n ShrSVecI16x8 = _BinaryenShrSVecI16x8(),\r\n ShrUVecI16x8 = _BinaryenShrUVecI16x8(),\r\n ShlVecI32x4 = _BinaryenShlVecI32x4(),\r\n ShrSVecI32x4 = _BinaryenShrSVecI32x4(),\r\n ShrUVecI32x4 = _BinaryenShrUVecI32x4(),\r\n ShlVecI64x2 = _BinaryenShlVecI64x2(),\r\n ShrSVecI64x2 = _BinaryenShrSVecI64x2(),\r\n ShrUVecI64x2 = _BinaryenShrUVecI64x2()\r\n}\r\n\r\nexport class MemorySegment {\r\n\r\n buffer: Uint8Array;\r\n offset: I64;\r\n\r\n static create(buffer: Uint8Array, offset: I64): MemorySegment {\r\n var segment = new MemorySegment();\r\n segment.buffer = buffer;\r\n segment.offset = offset;\r\n return segment;\r\n }\r\n}\r\n\r\nexport class Module {\r\n\r\n ref: ModuleRef;\r\n\r\n private lit: usize;\r\n\r\n static create(): Module {\r\n var module = new Module();\r\n module.ref = _BinaryenModuleCreate();\r\n module.lit = memory.allocate(_BinaryenSizeofLiteral());\r\n return module;\r\n }\r\n\r\n static createFrom(buffer: Uint8Array): Module {\r\n var cArr = allocU8Array(buffer);\r\n try {\r\n let module = new Module();\r\n module.ref = _BinaryenModuleRead(cArr, buffer.length);\r\n module.lit = memory.allocate(_BinaryenSizeofLiteral());\r\n return module;\r\n } finally {\r\n memory.free(changetype(cArr));\r\n }\r\n }\r\n\r\n private constructor() { }\r\n\r\n // types\r\n\r\n addFunctionType(\r\n name: string,\r\n result: NativeType,\r\n paramTypes: NativeType[] | null\r\n ): FunctionRef {\r\n var cStr = this.allocStringCached(name);\r\n var cArr = allocI32Array(paramTypes);\r\n try {\r\n return _BinaryenAddFunctionType(this.ref, cStr, result, cArr, paramTypes ? paramTypes.length : 0);\r\n } finally {\r\n memory.free(cArr);\r\n }\r\n }\r\n\r\n getFunctionTypeBySignature(\r\n result: NativeType,\r\n paramTypes: NativeType[] | null\r\n ): FunctionTypeRef {\r\n var cArr = allocI32Array(paramTypes);\r\n try {\r\n return _BinaryenGetFunctionTypeBySignature(this.ref, result, cArr, paramTypes ? paramTypes.length : 0);\r\n } finally {\r\n memory.free(cArr);\r\n }\r\n }\r\n\r\n removeFunctionType(name: string): void {\r\n var cStr = this.allocStringCached(name);\r\n _BinaryenRemoveFunctionType(this.ref, cStr);\r\n }\r\n\r\n // constants\r\n\r\n createI32(value: i32): ExpressionRef {\r\n var out = this.lit;\r\n _BinaryenLiteralInt32(out, value);\r\n return _BinaryenConst(this.ref, out);\r\n }\r\n\r\n createI64(valueLow: i32, valueHigh: i32 = 0): ExpressionRef {\r\n var out = this.lit;\r\n _BinaryenLiteralInt64(out, valueLow, valueHigh);\r\n return _BinaryenConst(this.ref, out);\r\n }\r\n\r\n createF32(value: f32): ExpressionRef {\r\n var out = this.lit;\r\n _BinaryenLiteralFloat32(out, value);\r\n return _BinaryenConst(this.ref, out);\r\n }\r\n\r\n createF64(value: f64): ExpressionRef {\r\n var out = this.lit;\r\n _BinaryenLiteralFloat64(out, value);\r\n return _BinaryenConst(this.ref, out);\r\n }\r\n\r\n createV128(bytes: Uint8Array): ExpressionRef {\r\n assert(bytes.length == 16);\r\n var out = this.lit;\r\n for (let i = 0; i < 16; ++i) store(out + i, bytes[i]);\r\n _BinaryenLiteralVec128(out, out);\r\n return _BinaryenConst(this.ref, out);\r\n }\r\n\r\n // expressions\r\n\r\n createUnary(\r\n op: UnaryOp,\r\n expr: ExpressionRef\r\n ): ExpressionRef {\r\n return _BinaryenUnary(this.ref, op, expr);\r\n }\r\n\r\n createBinary(\r\n op: BinaryOp,\r\n left: ExpressionRef,\r\n right: ExpressionRef\r\n ): ExpressionRef {\r\n return _BinaryenBinary(this.ref, op, left, right);\r\n }\r\n\r\n createHost(\r\n op: HostOp,\r\n name: string | null = null,\r\n operands: ExpressionRef[] | null = null\r\n ): ExpressionRef {\r\n var cStr = this.allocStringCached(name);\r\n var cArr = allocPtrArray(operands);\r\n try {\r\n return _BinaryenHost(this.ref, op, cStr, cArr, operands ? (operands).length : 0);\r\n } finally {\r\n memory.free(cArr);\r\n }\r\n }\r\n\r\n createGetLocal(\r\n index: i32,\r\n type: NativeType\r\n ): ExpressionRef {\r\n return _BinaryenGetLocal(this.ref, index, type);\r\n }\r\n\r\n createTeeLocal(\r\n index: i32,\r\n value: ExpressionRef\r\n ): ExpressionRef {\r\n return _BinaryenTeeLocal(this.ref, index, value);\r\n }\r\n\r\n createGetGlobal(\r\n name: string,\r\n type: NativeType\r\n ): ExpressionRef {\r\n var cStr = this.allocStringCached(name);\r\n return _BinaryenGetGlobal(this.ref, cStr, type);\r\n }\r\n\r\n createLoad(\r\n bytes: Index,\r\n signed: bool,\r\n ptr: ExpressionRef,\r\n type: NativeType,\r\n offset: Index = 0,\r\n align: Index = bytes // naturally aligned by default\r\n ): ExpressionRef {\r\n return _BinaryenLoad(this.ref, bytes, signed ? 1 : 0, offset, align, type, ptr);\r\n }\r\n\r\n createStore(\r\n bytes: Index,\r\n ptr: ExpressionRef,\r\n value: ExpressionRef,\r\n type: NativeType,\r\n offset: Index = 0,\r\n align: Index = bytes // naturally aligned by default\r\n ): ExpressionRef {\r\n return _BinaryenStore(this.ref, bytes, offset, align, ptr, value, type);\r\n }\r\n\r\n createAtomicLoad(\r\n bytes: Index,\r\n ptr: ExpressionRef,\r\n type: NativeType,\r\n offset: Index = 0\r\n ): ExpressionRef {\r\n return _BinaryenAtomicLoad(this.ref, bytes, offset, type, ptr);\r\n }\r\n\r\n createAtomicStore(\r\n bytes: Index,\r\n ptr: ExpressionRef,\r\n value: ExpressionRef,\r\n type: NativeType,\r\n offset: Index = 0\r\n ): ExpressionRef {\r\n return _BinaryenAtomicStore(this.ref, bytes, offset, ptr, value, type);\r\n }\r\n\r\n createAtomicRMW(\r\n op: AtomicRMWOp,\r\n bytes: Index,\r\n offset: Index,\r\n ptr: ExpressionRef,\r\n value: ExpressionRef,\r\n type: NativeType\r\n ): ExpressionRef {\r\n return _BinaryenAtomicRMW(this.ref, op, bytes, offset, ptr, value, type);\r\n }\r\n\r\n createAtomicCmpxchg(\r\n bytes: Index,\r\n offset: Index,\r\n ptr: ExpressionRef,\r\n expected: ExpressionRef,\r\n replacement: ExpressionRef,\r\n type: NativeType\r\n ): ExpressionRef {\r\n return _BinaryenAtomicCmpxchg(this.ref, bytes, offset, ptr, expected, replacement, type);\r\n }\r\n\r\n createAtomicWait(\r\n ptr: ExpressionRef,\r\n expected: ExpressionRef,\r\n timeout: ExpressionRef,\r\n expectedType: NativeType\r\n ): ExpressionRef {\r\n return _BinaryenAtomicWait(this.ref, ptr, expected, timeout, expectedType);\r\n }\r\n\r\n createAtomicNotify(\r\n ptr: ExpressionRef,\r\n notifyCount: ExpressionRef\r\n ): ExpressionRef {\r\n return _BinaryenAtomicNotify(this.ref, ptr, notifyCount);\r\n }\r\n\r\n // statements\r\n\r\n createSetLocal(\r\n index: Index,\r\n value: ExpressionRef\r\n ): ExpressionRef {\r\n return _BinaryenSetLocal(this.ref, index, value);\r\n }\r\n\r\n createSetGlobal(\r\n name: string,\r\n value: ExpressionRef\r\n ): ExpressionRef {\r\n var cStr = this.allocStringCached(name);\r\n return _BinaryenSetGlobal(this.ref, cStr, value);\r\n }\r\n\r\n createBlock(\r\n label: string | null,\r\n children: ExpressionRef[],\r\n type: NativeType = NativeType.None\r\n ): ExpressionRef {\r\n var cStr = this.allocStringCached(label);\r\n var cArr = allocPtrArray(children);\r\n try {\r\n return _BinaryenBlock(this.ref, cStr, cArr, children.length, type);\r\n } finally {\r\n memory.free(cArr);\r\n }\r\n }\r\n\r\n createBreak(\r\n label: string | null,\r\n condition: ExpressionRef = 0,\r\n value: ExpressionRef = 0\r\n ): ExpressionRef {\r\n var cStr = this.allocStringCached(label);\r\n return _BinaryenBreak(this.ref, cStr, condition, value);\r\n }\r\n\r\n createDrop(\r\n expression: ExpressionRef\r\n ): ExpressionRef {\r\n return _BinaryenDrop(this.ref, expression);\r\n }\r\n\r\n createLoop(\r\n label: string | null,\r\n body: ExpressionRef\r\n ): ExpressionRef {\r\n var cStr = this.allocStringCached(label);\r\n return _BinaryenLoop(this.ref, cStr, body);\r\n }\r\n\r\n createIf(\r\n condition: ExpressionRef,\r\n ifTrue: ExpressionRef,\r\n ifFalse: ExpressionRef = 0\r\n ): ExpressionRef {\r\n return _BinaryenIf(this.ref, condition, ifTrue, ifFalse);\r\n }\r\n\r\n createNop(): ExpressionRef {\r\n return _BinaryenNop(this.ref);\r\n }\r\n\r\n createReturn(\r\n expression: ExpressionRef = 0\r\n ): ExpressionRef {\r\n return _BinaryenReturn(this.ref, expression);\r\n }\r\n\r\n createSelect(\r\n ifTrue: ExpressionRef,\r\n ifFalse: ExpressionRef,\r\n condition: ExpressionRef\r\n ): ExpressionRef {\r\n return _BinaryenSelect(this.ref, condition, ifTrue, ifFalse);\r\n }\r\n\r\n createSwitch(\r\n names: string[],\r\n defaultName: string | null,\r\n condition: ExpressionRef,\r\n value: ExpressionRef = 0\r\n ): ExpressionRef {\r\n var numNames = names.length;\r\n var strs = new Array(numNames);\r\n for (let i = 0; i < numNames; ++i) {\r\n strs[i] = this.allocStringCached(names[i]);\r\n }\r\n var cArr = allocI32Array(strs);\r\n var cStr = this.allocStringCached(defaultName);\r\n try {\r\n return _BinaryenSwitch(this.ref, cArr, numNames, cStr, condition, value);\r\n } finally {\r\n memory.free(cArr);\r\n }\r\n }\r\n\r\n createCall(\r\n target: string,\r\n operands: ExpressionRef[] | null,\r\n returnType: NativeType\r\n ): ExpressionRef {\r\n var cStr = this.allocStringCached(target);\r\n var cArr = allocPtrArray(operands);\r\n try {\r\n return _BinaryenCall(this.ref, cStr, cArr, operands && operands.length || 0, returnType);\r\n } finally {\r\n memory.free(cArr);\r\n }\r\n }\r\n\r\n createCallIndirect(\r\n index: ExpressionRef,\r\n operands: ExpressionRef[] | null,\r\n typeName: string\r\n ): ExpressionRef {\r\n var cStr = this.allocStringCached(typeName);\r\n var cArr = allocPtrArray(operands);\r\n try {\r\n return _BinaryenCallIndirect(this.ref, index, cArr, operands && operands.length || 0, cStr);\r\n } finally {\r\n memory.free(cArr);\r\n }\r\n }\r\n\r\n createUnreachable(): ExpressionRef {\r\n return _BinaryenUnreachable(this.ref);\r\n }\r\n\r\n // bulk memory\r\n\r\n createMemoryCopy(\r\n dest: ExpressionRef,\r\n source: ExpressionRef,\r\n size: ExpressionRef\r\n ): ExpressionRef {\r\n return _BinaryenMemoryCopy(this.ref, dest, source, size);\r\n }\r\n\r\n createMemoryFill(\r\n dest: ExpressionRef,\r\n value: ExpressionRef,\r\n size: ExpressionRef\r\n ): ExpressionRef {\r\n return _BinaryenMemoryFill(this.ref, dest, value, size);\r\n }\r\n\r\n // simd\r\n\r\n createSIMDExtract(\r\n op: SIMDExtractOp,\r\n vec: ExpressionRef,\r\n idx: u8\r\n ): ExpressionRef {\r\n return _BinaryenSIMDExtract(this.ref, op, vec, idx);\r\n }\r\n\r\n createSIMDReplace(\r\n op: SIMDReplaceOp,\r\n vec: ExpressionRef,\r\n idx: u8,\r\n value: ExpressionRef\r\n ): ExpressionRef {\r\n return _BinaryenSIMDReplace(this.ref, op, vec, idx, value);\r\n }\r\n\r\n createSIMDShuffle(\r\n vec1: ExpressionRef,\r\n vec2: ExpressionRef,\r\n mask: Uint8Array\r\n ): ExpressionRef {\r\n assert(mask.length == 16);\r\n var cArr = allocU8Array(mask);\r\n try {\r\n return _BinaryenSIMDShuffle(this.ref, vec1, vec2, cArr);\r\n } finally {\r\n memory.free(cArr);\r\n }\r\n }\r\n\r\n createSIMDBitselect(\r\n vec1: ExpressionRef,\r\n vec2: ExpressionRef,\r\n cond: ExpressionRef\r\n ): ExpressionRef {\r\n return _BinaryenSIMDBitselect(this.ref, vec1, vec2, cond);\r\n }\r\n\r\n createSIMDShift(\r\n op: SIMDShiftOp,\r\n vec: ExpressionRef,\r\n shift: ExpressionRef\r\n ): ExpressionRef {\r\n return _BinaryenSIMDShift(this.ref, op, vec, shift);\r\n }\r\n\r\n // meta\r\n\r\n addGlobal(\r\n name: string,\r\n type: NativeType,\r\n mutable: bool,\r\n initializer: ExpressionRef\r\n ): GlobalRef {\r\n var cStr = this.allocStringCached(name);\r\n return _BinaryenAddGlobal(this.ref, cStr, type, mutable ? 1 : 0, initializer);\r\n }\r\n\r\n removeGlobal(\r\n name: string\r\n ): void {\r\n var cStr = this.allocStringCached(name);\r\n _BinaryenRemoveGlobal(this.ref, cStr);\r\n }\r\n\r\n addFunction(\r\n name: string,\r\n type: FunctionTypeRef,\r\n varTypes: NativeType[] | null,\r\n body: ExpressionRef\r\n ): FunctionRef {\r\n var cStr = this.allocStringCached(name);\r\n var cArr = allocI32Array(varTypes);\r\n try {\r\n return _BinaryenAddFunction(this.ref, cStr, type, cArr, varTypes ? varTypes.length : 0, body);\r\n } finally {\r\n memory.free(cArr);\r\n }\r\n }\r\n\r\n removeFunction(name: string): void {\r\n var cStr = this.allocStringCached(name);\r\n _BinaryenRemoveFunction(this.ref, cStr);\r\n }\r\n\r\n private hasTemporaryFunction: bool = false;\r\n\r\n addTemporaryFunction(result: NativeType, paramTypes: NativeType[] | null, body: ExpressionRef): FunctionRef {\r\n this.hasTemporaryFunction = assert(!this.hasTemporaryFunction);\r\n var tempName = this.allocStringCached(\"\");\r\n var cArr = allocI32Array(paramTypes);\r\n try {\r\n let typeRef = _BinaryenAddFunctionType(this.ref, tempName, result, cArr, paramTypes ? paramTypes.length : 0);\r\n return _BinaryenAddFunction(this.ref, tempName, typeRef, 0, 0, body);\r\n } finally {\r\n memory.free(cArr);\r\n }\r\n }\r\n\r\n removeTemporaryFunction(): void {\r\n this.hasTemporaryFunction = !assert(this.hasTemporaryFunction);\r\n var tempName = this.allocStringCached(\"\");\r\n _BinaryenRemoveFunction(this.ref, tempName);\r\n _BinaryenRemoveFunctionType(this.ref, tempName);\r\n }\r\n\r\n addFunctionExport(\r\n internalName: string,\r\n externalName: string\r\n ): ExportRef {\r\n var cStr1 = this.allocStringCached(internalName);\r\n var cStr2 = this.allocStringCached(externalName);\r\n return _BinaryenAddFunctionExport(this.ref, cStr1, cStr2);\r\n }\r\n\r\n addTableExport(\r\n internalName: string,\r\n externalName: string\r\n ): ExportRef {\r\n var cStr1 = this.allocStringCached(internalName);\r\n var cStr2 = this.allocStringCached(externalName);\r\n return _BinaryenAddTableExport(this.ref, cStr1, cStr2);\r\n }\r\n\r\n addMemoryExport(\r\n internalName: string,\r\n externalName: string\r\n ): ExportRef {\r\n var cStr1 = this.allocStringCached(internalName);\r\n var cStr2 = this.allocStringCached(externalName);\r\n return _BinaryenAddMemoryExport(this.ref, cStr1, cStr2);\r\n }\r\n\r\n addGlobalExport(\r\n internalName: string,\r\n externalName: string\r\n ): ExportRef {\r\n var cStr1 = this.allocStringCached(internalName);\r\n var cStr2 = this.allocStringCached(externalName);\r\n return _BinaryenAddGlobalExport(this.ref, cStr1, cStr2);\r\n }\r\n\r\n removeExport(externalName: string): void {\r\n var cStr = this.allocStringCached(externalName);\r\n _BinaryenRemoveExport(this.ref, cStr);\r\n }\r\n\r\n addFunctionImport(\r\n internalName: string,\r\n externalModuleName: string,\r\n externalBaseName: string,\r\n functionType: FunctionTypeRef\r\n ): ImportRef {\r\n var cStr1 = this.allocStringCached(internalName);\r\n var cStr2 = this.allocStringCached(externalModuleName);\r\n var cStr3 = this.allocStringCached(externalBaseName);\r\n return _BinaryenAddFunctionImport(this.ref, cStr1, cStr2, cStr3, functionType);\r\n }\r\n\r\n addTableImport(\r\n internalName: string,\r\n externalModuleName: string,\r\n externalBaseName: string\r\n ): ImportRef {\r\n var cStr1 = this.allocStringCached(internalName);\r\n var cStr2 = this.allocStringCached(externalModuleName);\r\n var cStr3 = this.allocStringCached(externalBaseName);\r\n return _BinaryenAddTableImport(this.ref, cStr1, cStr2, cStr3);\r\n }\r\n\r\n addMemoryImport(\r\n internalName: string,\r\n externalModuleName: string,\r\n externalBaseName: string,\r\n shared: bool = false,\r\n ): ImportRef {\r\n var cStr1 = this.allocStringCached(internalName);\r\n var cStr2 = this.allocStringCached(externalModuleName);\r\n var cStr3 = this.allocStringCached(externalBaseName);\r\n return _BinaryenAddMemoryImport(this.ref, cStr1, cStr2, cStr3, shared);\r\n }\r\n\r\n addGlobalImport(\r\n internalName: string,\r\n externalModuleName: string,\r\n externalBaseName: string,\r\n globalType: NativeType\r\n ): ImportRef {\r\n var cStr1 = this.allocStringCached(internalName);\r\n var cStr2 = this.allocStringCached(externalModuleName);\r\n var cStr3 = this.allocStringCached(externalBaseName);\r\n return _BinaryenAddGlobalImport(this.ref, cStr1, cStr2, cStr3, globalType);\r\n }\r\n\r\n /** Unlimited memory constant. */\r\n static readonly UNLIMITED_MEMORY: Index = -1;\r\n\r\n setMemory(\r\n initial: Index,\r\n maximum: Index,\r\n segments: MemorySegment[],\r\n target: Target,\r\n exportName: string | null = null,\r\n shared: bool = false\r\n ): void {\r\n var cStr = this.allocStringCached(exportName);\r\n var k = segments.length;\r\n var segs = new Array(k);\r\n var psvs = new Array(k);\r\n var offs = new Array(k);\r\n var sizs = new Array(k);\r\n for (let i = 0; i < k; ++i) {\r\n let buffer = segments[i].buffer;\r\n let offset = segments[i].offset;\r\n segs[i] = allocU8Array(buffer);\r\n psvs[i] = 0; // no passive segments currently\r\n offs[i] = target == Target.WASM64\r\n ? this.createI64(i64_low(offset), i64_high(offset))\r\n : this.createI32(i64_low(offset));\r\n sizs[i] = buffer.length;\r\n }\r\n var cArr1 = allocI32Array(segs);\r\n var cArr2 = allocU8Array(psvs);\r\n var cArr3 = allocI32Array(offs);\r\n var cArr4 = allocI32Array(sizs);\r\n try {\r\n _BinaryenSetMemory(this.ref, initial, maximum, cStr, cArr1, cArr2, cArr3, cArr4, k, shared);\r\n } finally {\r\n memory.free(cArr4);\r\n memory.free(cArr3);\r\n memory.free(cArr2);\r\n memory.free(cArr1);\r\n for (let i = k - 1; i >= 0; --i) memory.free(segs[i]);\r\n }\r\n }\r\n\r\n setFunctionTable(\r\n initial: Index,\r\n maximum: Index,\r\n funcs: string[]\r\n ): void {\r\n var numNames = funcs.length;\r\n var names = new Array(numNames);\r\n for (let i = 0; i < numNames; ++i) {\r\n names[i] = this.allocStringCached(funcs[i]);\r\n }\r\n var cArr = allocI32Array(names);\r\n try {\r\n _BinaryenSetFunctionTable(this.ref, initial, maximum, cArr, numNames);\r\n } finally {\r\n memory.free(cArr);\r\n }\r\n }\r\n\r\n setStart(func: FunctionRef): void {\r\n _BinaryenSetStart(this.ref, func);\r\n }\r\n\r\n getOptimizeLevel(): i32 {\r\n return _BinaryenGetOptimizeLevel();\r\n }\r\n\r\n setOptimizeLevel(level: i32 = 2): void {\r\n _BinaryenSetOptimizeLevel(level);\r\n }\r\n\r\n getShrinkLevel(): i32 {\r\n return _BinaryenGetShrinkLevel();\r\n }\r\n\r\n setShrinkLevel(level: i32 = 1): void {\r\n _BinaryenSetShrinkLevel(level);\r\n }\r\n\r\n setDebugInfo(on: bool = false): void {\r\n _BinaryenSetDebugInfo(on);\r\n }\r\n\r\n optimize(func: FunctionRef = 0): void {\r\n if (func) {\r\n _BinaryenFunctionOptimize(func, this.ref);\r\n } else {\r\n _BinaryenModuleOptimize(this.ref);\r\n }\r\n }\r\n\r\n runPasses(passes: string[], func: FunctionRef = 0): void {\r\n var numNames = passes.length;\r\n var names = new Array(numNames);\r\n for (let i = 0; i < numNames; ++i) {\r\n names[i] = allocString(passes[i]);\r\n }\r\n var cArr = allocI32Array(names);\r\n try {\r\n if (func) {\r\n _BinaryenFunctionRunPasses(func, this.ref, cArr, numNames);\r\n } else {\r\n _BinaryenModuleRunPasses(this.ref, cArr, numNames);\r\n }\r\n } finally {\r\n memory.free(cArr);\r\n for (let i = numNames; i >= 0; --i) memory.free(names[i]);\r\n }\r\n }\r\n\r\n private cachedPrecomputeNames: usize = 0;\r\n\r\n precomputeExpression(expr: ExpressionRef): ExpressionRef {\r\n // remember the previous optimize levels and set to max instead, to be sure\r\n var previousOptimizeLevel = _BinaryenGetOptimizeLevel();\r\n var previousShrinkLevel = _BinaryenGetShrinkLevel();\r\n var previousDebugInfo = _BinaryenGetDebugInfo();\r\n _BinaryenSetOptimizeLevel(4);\r\n _BinaryenSetShrinkLevel(0);\r\n _BinaryenSetDebugInfo(false);\r\n\r\n // wrap the expression in a temp. function and run the precompute pass on it\r\n var type = _BinaryenExpressionGetType(expr);\r\n var func = this.addTemporaryFunction(type, null, expr);\r\n var names = this.cachedPrecomputeNames;\r\n if (!names) {\r\n this.cachedPrecomputeNames = names = allocI32Array([ this.allocStringCached(\"precompute\") ]);\r\n }\r\n _BinaryenFunctionRunPasses(func, this.ref, names, 1);\r\n expr = _BinaryenFunctionGetBody(func);\r\n this.removeTemporaryFunction();\r\n\r\n // reset optimize levels to previous\r\n _BinaryenSetOptimizeLevel(previousOptimizeLevel);\r\n _BinaryenSetShrinkLevel(previousShrinkLevel);\r\n _BinaryenSetDebugInfo(previousDebugInfo);\r\n return expr;\r\n }\r\n\r\n validate(): bool {\r\n return _BinaryenModuleValidate(this.ref) == 1;\r\n }\r\n\r\n interpret(): void {\r\n _BinaryenModuleInterpret(this.ref);\r\n }\r\n\r\n toBinary(sourceMapUrl: string | null): BinaryModule {\r\n var out = this.lit; // safe to reuse as long as..\r\n assert(_BinaryenSizeofLiteral() >= 12);\r\n var cStr = allocString(sourceMapUrl);\r\n var binaryPtr: usize = 0;\r\n var sourceMapPtr: usize = 0;\r\n try {\r\n _BinaryenModuleAllocateAndWrite(out, this.ref, cStr);\r\n binaryPtr = readInt(out);\r\n let binaryBytes = readInt(out + 4);\r\n sourceMapPtr = readInt(out + 4 * 2);\r\n let ret = new BinaryModule();\r\n ret.output = readBuffer(binaryPtr, binaryBytes);\r\n ret.sourceMap = readString(sourceMapPtr);\r\n return ret;\r\n } finally {\r\n if (cStr) memory.free(cStr);\r\n if (binaryPtr) memory.free(binaryPtr);\r\n if (sourceMapPtr) memory.free(sourceMapPtr);\r\n }\r\n }\r\n\r\n toText(): string {\r\n throw new Error(\"not implemented\"); // JS glue overrides this\r\n }\r\n\r\n toAsmjs(): string {\r\n throw new Error(\"not implemented\"); // JS glue overrides this\r\n }\r\n\r\n private cachedStrings: Map = new Map();\r\n\r\n private allocStringCached(str: string | null): usize {\r\n if (str == null) return 0;\r\n var cachedStrings = this.cachedStrings;\r\n if (cachedStrings.has(str)) return cachedStrings.get(str);\r\n var ptr = allocString(str);\r\n cachedStrings.set(str, ptr);\r\n return ptr;\r\n }\r\n\r\n dispose(): void {\r\n assert(this.ref);\r\n for (let ptr of this.cachedStrings.values()) memory.free(ptr);\r\n this.cachedStrings = new Map();\r\n memory.free(this.lit);\r\n memory.free(this.cachedPrecomputeNames);\r\n this.cachedPrecomputeNames = 0;\r\n _BinaryenModuleDispose(this.ref);\r\n this.ref = 0;\r\n }\r\n\r\n createRelooper(): Relooper {\r\n return Relooper.create(this);\r\n }\r\n\r\n cloneExpression(\r\n expr: ExpressionRef,\r\n noSideEffects: bool = false,\r\n maxDepth: i32 = i32.MAX_VALUE\r\n ): ExpressionRef { // currently supports side effect free expressions only\r\n if (maxDepth < 0) return 0;\r\n maxDepth -= 1;\r\n\r\n var nested1: ExpressionRef,\r\n nested2: ExpressionRef;\r\n\r\n switch (_BinaryenExpressionGetId(expr)) {\r\n case ExpressionId.Const: {\r\n switch (_BinaryenExpressionGetType(expr)) {\r\n case NativeType.I32: {\r\n return this.createI32(_BinaryenConstGetValueI32(expr));\r\n }\r\n case NativeType.I64: {\r\n return this.createI64(\r\n _BinaryenConstGetValueI64Low(expr),\r\n _BinaryenConstGetValueI64High(expr)\r\n );\r\n }\r\n case NativeType.F32: {\r\n return this.createF32(_BinaryenConstGetValueF32(expr));\r\n }\r\n case NativeType.F64: {\r\n return this.createF64(_BinaryenConstGetValueF64(expr));\r\n }\r\n case NativeType.V128: {\r\n // TODO\r\n return 0;\r\n }\r\n default: {\r\n throw new Error(\"concrete type expected\");\r\n }\r\n }\r\n }\r\n case ExpressionId.GetLocal: {\r\n return _BinaryenGetLocal(this.ref,\r\n _BinaryenGetLocalGetIndex(expr),\r\n _BinaryenExpressionGetType(expr)\r\n );\r\n }\r\n case ExpressionId.GetGlobal: {\r\n let globalName = _BinaryenGetGlobalGetName(expr);\r\n if (!globalName) break;\r\n return _BinaryenGetGlobal(this.ref, globalName, _BinaryenExpressionGetType(expr));\r\n }\r\n case ExpressionId.Load: {\r\n if (!(nested1 = this.cloneExpression(_BinaryenLoadGetPtr(expr), noSideEffects, maxDepth))) {\r\n break;\r\n }\r\n return (\r\n _BinaryenLoadIsAtomic(expr)\r\n ? _BinaryenAtomicLoad(this.ref,\r\n _BinaryenLoadGetBytes(expr),\r\n _BinaryenLoadGetOffset(expr),\r\n _BinaryenExpressionGetType(expr),\r\n nested1\r\n )\r\n : _BinaryenLoad(this.ref,\r\n _BinaryenLoadGetBytes(expr),\r\n _BinaryenLoadIsSigned(expr) ? 1 : 0,\r\n _BinaryenLoadGetOffset(expr),\r\n _BinaryenLoadGetAlign(expr),\r\n _BinaryenExpressionGetType(expr),\r\n nested1\r\n )\r\n );\r\n }\r\n case ExpressionId.Unary: {\r\n if (!(nested1 = this.cloneExpression(_BinaryenUnaryGetValue(expr), noSideEffects, maxDepth))) {\r\n break;\r\n }\r\n return _BinaryenUnary(this.ref, _BinaryenUnaryGetOp(expr), nested1);\r\n }\r\n case ExpressionId.Binary: {\r\n if (!(nested1 = this.cloneExpression(_BinaryenBinaryGetLeft(expr), noSideEffects, maxDepth))) {\r\n break;\r\n }\r\n if (!(nested2 = this.cloneExpression(_BinaryenBinaryGetRight(expr), noSideEffects, maxDepth))) {\r\n break;\r\n }\r\n return _BinaryenBinary(this.ref, _BinaryenBinaryGetOp(expr), nested1, nested2);\r\n }\r\n }\r\n return 0;\r\n }\r\n\r\n // source map generation\r\n\r\n addDebugInfoFile(name: string): Index {\r\n var cStr = allocString(name);\r\n try {\r\n return _BinaryenModuleAddDebugInfoFileName(this.ref, cStr);\r\n } finally {\r\n memory.free(cStr);\r\n }\r\n }\r\n\r\n getDebugInfoFile(index: Index): string | null {\r\n return readString(_BinaryenModuleGetDebugInfoFileName(this.ref, index));\r\n }\r\n\r\n setDebugLocation(\r\n func: FunctionRef,\r\n expr: ExpressionRef,\r\n fileIndex: Index,\r\n lineNumber: Index,\r\n columnNumber: Index\r\n ): void {\r\n _BinaryenFunctionSetDebugLocation(func, expr, fileIndex, lineNumber, columnNumber);\r\n }\r\n}\r\n\r\n// expressions\r\n\r\nexport function getExpressionId(expr: ExpressionRef): ExpressionId {\r\n return _BinaryenExpressionGetId(expr);\r\n}\r\n\r\nexport function getExpressionType(expr: ExpressionRef): NativeType {\r\n return _BinaryenExpressionGetType(expr);\r\n}\r\n\r\nexport function getConstValueI32(expr: ExpressionRef): i32 {\r\n return _BinaryenConstGetValueI32(expr);\r\n}\r\n\r\nexport function getConstValueI64Low(expr: ExpressionRef): i32 {\r\n return _BinaryenConstGetValueI64Low(expr);\r\n}\r\n\r\nexport function getConstValueI64High(expr: ExpressionRef): i32 {\r\n return _BinaryenConstGetValueI64High(expr);\r\n}\r\n\r\nexport function getConstValueF32(expr: ExpressionRef): f32 {\r\n return _BinaryenConstGetValueF32(expr);\r\n}\r\n\r\nexport function getConstValueF64(expr: ExpressionRef): f32 {\r\n return _BinaryenConstGetValueF64(expr);\r\n}\r\n\r\nexport function getGetLocalIndex(expr: ExpressionRef): Index {\r\n return _BinaryenGetLocalGetIndex(expr);\r\n}\r\n\r\nexport function getSetLocalIndex(expr: ExpressionRef): Index {\r\n return _BinaryenSetLocalGetIndex(expr);\r\n}\r\n\r\nexport function getSetLocalValue(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenSetLocalGetValue(expr);\r\n}\r\n\r\nexport function isTeeLocal(expr: ExpressionRef): bool {\r\n return _BinaryenSetLocalIsTee(expr);\r\n}\r\n\r\nexport function getGetGlobalName(expr: ExpressionRef): string | null {\r\n return readString(_BinaryenGetGlobalGetName(expr));\r\n}\r\n\r\nexport function getBinaryOp(expr: ExpressionRef): BinaryOp {\r\n return _BinaryenBinaryGetOp(expr);\r\n}\r\n\r\nexport function getBinaryLeft(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenBinaryGetLeft(expr);\r\n}\r\n\r\nexport function getBinaryRight(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenBinaryGetRight(expr);\r\n}\r\n\r\nexport function getUnaryOp(expr: ExpressionRef): UnaryOp {\r\n return _BinaryenUnaryGetOp(expr);\r\n}\r\n\r\nexport function getUnaryValue(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenUnaryGetValue(expr);\r\n}\r\n\r\nexport function getLoadBytes(expr: ExpressionRef): u32 {\r\n return _BinaryenLoadGetBytes(expr);\r\n}\r\n\r\nexport function getLoadOffset(expr: ExpressionRef): u32 {\r\n return _BinaryenLoadGetOffset(expr);\r\n}\r\n\r\nexport function getLoadPtr(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenLoadGetPtr(expr);\r\n}\r\n\r\nexport function isLoadSigned(expr: ExpressionRef): bool {\r\n return _BinaryenLoadIsSigned(expr);\r\n}\r\n\r\nexport function getStoreBytes(expr: ExpressionRef): u32 {\r\n return _BinaryenStoreGetBytes(expr);\r\n}\r\n\r\nexport function getStoreOffset(expr: ExpressionRef): u32 {\r\n return _BinaryenStoreGetOffset(expr);\r\n}\r\n\r\nexport function getStorePtr(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenStoreGetPtr(expr);\r\n}\r\n\r\nexport function getStoreValue(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenStoreGetValue(expr);\r\n}\r\n\r\nexport function getBlockName(expr: ExpressionRef): string | null {\r\n return readString(_BinaryenBlockGetName(expr));\r\n}\r\n\r\nexport function getBlockChildCount(expr: ExpressionRef): Index {\r\n return _BinaryenBlockGetNumChildren(expr);\r\n}\r\n\r\nexport function getBlockChild(expr: ExpressionRef, index: Index): ExpressionRef {\r\n return _BinaryenBlockGetChild(expr, index);\r\n}\r\n\r\nexport function getIfCondition(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenIfGetCondition(expr);\r\n}\r\n\r\nexport function getIfTrue(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenIfGetIfTrue(expr);\r\n}\r\n\r\nexport function getIfFalse(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenIfGetIfFalse(expr);\r\n}\r\n\r\nexport function getLoopName(expr: ExpressionRef): string | null {\r\n return readString(_BinaryenLoopGetName(expr));\r\n}\r\n\r\nexport function getLoopBody(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenLoopGetBody(expr);\r\n}\r\n\r\nexport function getBreakName(expr: ExpressionRef): string | null {\r\n return readString(_BinaryenBreakGetName(expr));\r\n}\r\n\r\nexport function getBreakCondition(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenBreakGetCondition(expr);\r\n}\r\n\r\nexport function getSelectThen(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenSelectGetIfTrue(expr);\r\n}\r\n\r\nexport function getSelectElse(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenSelectGetIfFalse(expr);\r\n}\r\n\r\nexport function getSelectCondition(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenSelectGetCondition(expr);\r\n}\r\n\r\nexport function getDropValue(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenDropGetValue(expr);\r\n}\r\n\r\nexport function getReturnValue(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenReturnGetValue(expr);\r\n}\r\n\r\nexport function getCallTarget(expr: ExpressionRef): string | null {\r\n return readString(_BinaryenCallGetTarget(expr));\r\n}\r\n\r\nexport function getHostOp(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenHostGetOp(expr);\r\n}\r\n\r\nexport function getHostOperandCount(expr: ExpressionRef): Index {\r\n return _BinaryenHostGetNumOperands(expr);\r\n}\r\n\r\nexport function getHostOperand(expr: ExpressionRef, index: Index): ExpressionRef {\r\n return _BinaryenHostGetOperand(expr, index);\r\n}\r\n\r\nexport function getHostName(expr: ExpressionRef): string | null {\r\n return readString(_BinaryenHostGetNameOperand(expr));\r\n}\r\n\r\n// functions\r\n\r\nexport function getFunctionBody(func: FunctionRef): ExpressionRef {\r\n return _BinaryenFunctionGetBody(func);\r\n}\r\n\r\nexport function getFunctionName(func: FunctionRef): string | null {\r\n return readString(_BinaryenFunctionGetName(func));\r\n}\r\n\r\nexport function getFunctionParamCount(func: FunctionRef): Index {\r\n return _BinaryenFunctionGetNumParams(func);\r\n}\r\n\r\nexport function getFunctionParamType(func: FunctionRef, index: Index): NativeType {\r\n return _BinaryenFunctionGetParam(func, index);\r\n}\r\n\r\nexport function getFunctionResultType(func: FunctionRef): NativeType {\r\n return _BinaryenFunctionGetResult(func);\r\n}\r\n\r\nexport class Relooper {\r\n\r\n module: Module;\r\n ref: RelooperRef;\r\n\r\n static create(module: Module): Relooper {\r\n var relooper = new Relooper();\r\n relooper.module = module;\r\n relooper.ref = _RelooperCreate(module.ref);\r\n return relooper;\r\n }\r\n\r\n private constructor() {}\r\n\r\n addBlock(code: ExpressionRef): RelooperBlockRef {\r\n return _RelooperAddBlock(this.ref, code);\r\n }\r\n\r\n addBranch(\r\n from: RelooperBlockRef,\r\n to: RelooperBlockRef,\r\n condition: ExpressionRef = 0,\r\n code: ExpressionRef = 0\r\n ): void {\r\n _RelooperAddBranch(from, to, condition, code);\r\n }\r\n\r\n addBlockWithSwitch(code: ExpressionRef, condition: ExpressionRef): RelooperBlockRef {\r\n return _RelooperAddBlockWithSwitch(this.ref, code, condition);\r\n }\r\n\r\n addBranchForSwitch(\r\n from: RelooperBlockRef,\r\n to: RelooperBlockRef,\r\n indexes: i32[],\r\n code: ExpressionRef = 0\r\n ): void {\r\n var cArr = allocI32Array(indexes);\r\n try {\r\n _RelooperAddBranchForSwitch(from, to, cArr, indexes.length, code);\r\n } finally {\r\n memory.free(cArr);\r\n }\r\n }\r\n\r\n renderAndDispose(entry: RelooperBlockRef, labelHelper: Index): ExpressionRef {\r\n return _RelooperRenderAndDispose(this.ref, entry, labelHelper);\r\n }\r\n}\r\n\r\n// export function hasSideEffects(expr: ExpressionRef): bool {\r\n// switch (_BinaryenExpressionGetId(expr = getPtr(expr))) {\r\n// case ExpressionId.GetLocal:\r\n// case ExpressionId.GetGlobal:\r\n// case ExpressionId.Const:\r\n// case ExpressionId.Nop:\r\n// case ExpressionId.Unreachable: {\r\n// return false;\r\n// }\r\n// case ExpressionId.Block: {\r\n// for (let i = 0, k = _BinaryenBlockGetNumChildren(expr); i < k; ++i) {\r\n// if (hasSideEffects(_BinaryenBlockGetChild(expr, i))) return true;\r\n// }\r\n// return false;\r\n// }\r\n// case ExpressionId.If: {\r\n// return hasSideEffects(_BinaryenIfGetCondition(expr))\r\n// || hasSideEffects(_BinaryenIfGetIfTrue(expr))\r\n// || hasSideEffects(_BinaryenIfGetIfFalse(expr));\r\n// }\r\n// case ExpressionId.Unary: {\r\n// return hasSideEffects(_BinaryenUnaryGetValue(expr));\r\n// }\r\n// case ExpressionId.Binary: {\r\n// return hasSideEffects(_BinaryenBinaryGetLeft(expr))\r\n// || hasSideEffects(_BinaryenBinaryGetRight(expr));\r\n// }\r\n// case ExpressionId.Drop: {\r\n// return hasSideEffects(_BinaryenDropGetValue(expr));\r\n// }\r\n// case ExpressionId.Select: {\r\n// return hasSideEffects(_BinaryenSelectGetIfTrue(expr))\r\n// || hasSideEffects(_BinaryenSelectGetIfFalse(expr))\r\n// || hasSideEffects(_BinaryenSelectGetCondition(expr));\r\n// }\r\n// }\r\n// return true;\r\n// }\r\n\r\n// helpers\r\n// can't do stack allocation here: STACKTOP is a global in WASM but a hidden variable in asm.js\r\n\r\nfunction allocU8Array(u8s: Uint8Array | null): usize {\r\n if (!u8s) return 0;\r\n var numValues = u8s.length;\r\n var ptr = memory.allocate(numValues);\r\n var idx = ptr;\r\n for (let i = 0; i < numValues; ++i) {\r\n store(idx++, u8s[i]);\r\n }\r\n return ptr;\r\n}\r\n\r\nfunction allocI32Array(i32s: i32[] | null): usize {\r\n if (!i32s) return 0;\r\n var ptr = memory.allocate(i32s.length << 2);\r\n var idx = ptr;\r\n for (let i = 0, k = i32s.length; i < k; ++i) {\r\n let val = i32s[i];\r\n // store(idx, val) is not portable\r\n store(idx , ( val & 0xff) as u8);\r\n store(idx + 1, ((val >> 8) & 0xff) as u8);\r\n store(idx + 2, ((val >> 16) & 0xff) as u8);\r\n store(idx + 3, ( val >>> 24 ) as u8);\r\n idx += 4;\r\n }\r\n return ptr;\r\n}\r\n\r\nfunction allocPtrArray(ptrs: usize[] | null): usize {\r\n return allocI32Array(ptrs); // TODO: WASM64 one day\r\n}\r\n\r\nfunction stringLengthUTF8(str: string): usize {\r\n var len = 0;\r\n for (let i = 0, k = str.length; i < k; ++i) {\r\n let u = str.charCodeAt(i);\r\n if (u >= 0xD800 && u <= 0xDFFF && i + 1 < k) {\r\n u = 0x10000 + ((u & 0x3FF) << 10) | (str.charCodeAt(++i) & 0x3FF);\r\n }\r\n if (u <= 0x7F) {\r\n ++len;\r\n } else if (u <= 0x7FF) {\r\n len += 2;\r\n } else if (u <= 0xFFFF) {\r\n len += 3;\r\n } else if (u <= 0x1FFFFF) {\r\n len += 4;\r\n } else if (u <= 0x3FFFFFF) {\r\n len += 5;\r\n } else {\r\n len += 6;\r\n }\r\n }\r\n return len;\r\n}\r\n\r\nfunction allocString(str: string | null): usize {\r\n if (str == null) return 0;\r\n var ptr = memory.allocate(stringLengthUTF8(str) + 1);\r\n // the following is based on Emscripten's stringToUTF8Array\r\n var idx = ptr;\r\n for (let i = 0, k = str.length; i < k; ++i) {\r\n let u = str.charCodeAt(i);\r\n if (u >= 0xD800 && u <= 0xDFFF && i + 1 < k) {\r\n u = 0x10000 + ((u & 0x3FF) << 10) | (str.charCodeAt(++i) & 0x3FF);\r\n }\r\n if (u <= 0x7F) {\r\n store(idx++, u as u8);\r\n } else if (u <= 0x7FF) {\r\n store(idx++, (0xC0 | (u >>> 6) ) as u8);\r\n store(idx++, (0x80 | ( u & 63)) as u8);\r\n } else if (u <= 0xFFFF) {\r\n store(idx++, (0xE0 | (u >>> 12) ) as u8);\r\n store(idx++, (0x80 | ((u >>> 6) & 63)) as u8);\r\n store(idx++, (0x80 | ( u & 63)) as u8);\r\n } else if (u <= 0x1FFFFF) {\r\n store(idx++, (0xF0 | (u >>> 18) ) as u8);\r\n store(idx++, (0x80 | ((u >>> 12) & 63)) as u8);\r\n store(idx++, (0x80 | ((u >>> 6) & 63)) as u8);\r\n store(idx++, (0x80 | ( u & 63)) as u8);\r\n } else if (u <= 0x3FFFFFF) {\r\n store(idx++, (0xF8 | (u >>> 24) ) as u8);\r\n store(idx++, (0x80 | ((u >>> 18) & 63)) as u8);\r\n store(idx++, (0x80 | ((u >>> 12) & 63)) as u8);\r\n store(idx++, (0x80 | ((u >>> 6) & 63)) as u8);\r\n store(idx++, (0x80 | ( u & 63)) as u8);\r\n } else {\r\n store(idx++, (0xFC | (u >>> 30) ) as u8);\r\n store(idx++, (0x80 | ((u >>> 24) & 63)) as u8);\r\n store(idx++, (0x80 | ((u >>> 18) & 63)) as u8);\r\n store(idx++, (0x80 | ((u >>> 12) & 63)) as u8);\r\n store(idx++, (0x80 | ((u >>> 6) & 63)) as u8);\r\n store(idx++, (0x80 | ( u & 63)) as u8);\r\n }\r\n }\r\n store(idx, 0);\r\n return ptr;\r\n}\r\n\r\nfunction readInt(ptr: usize): i32 {\r\n return (\r\n load(ptr ) |\r\n (load(ptr + 1) << 8) |\r\n (load(ptr + 2) << 16) |\r\n (load(ptr + 3) << 24)\r\n );\r\n}\r\n\r\nfunction readBuffer(ptr: usize, length: usize): Uint8Array {\r\n var ret = new Uint8Array(length);\r\n for (let i: usize = 0; i < length; ++i) {\r\n ret[i] = load(ptr + i);\r\n }\r\n return ret;\r\n}\r\n\r\nexport function readString(ptr: usize): string | null {\r\n if (!ptr) return null;\r\n var arr = new Array();\r\n // the following is based on Emscripten's UTF8ArrayToString\r\n var cp: u32;\r\n var u1: u32, u2: u32, u3: u32, u4: u32, u5: u32;\r\n while (cp = load(ptr++)) {\r\n if (!(cp & 0x80)) {\r\n arr.push(cp);\r\n continue;\r\n }\r\n u1 = load(ptr++) & 63;\r\n if ((cp & 0xE0) == 0xC0) {\r\n arr.push(((cp & 31) << 6) | u1);\r\n continue;\r\n }\r\n u2 = load(ptr++) & 63;\r\n if ((cp & 0xF0) == 0xE0) {\r\n cp = ((cp & 15) << 12) | (u1 << 6) | u2;\r\n } else {\r\n u3 = load(ptr++) & 63;\r\n if ((cp & 0xF8) == 0xF0) {\r\n cp = ((cp & 7) << 18) | (u1 << 12) | (u2 << 6) | u3;\r\n } else {\r\n u4 = load(ptr++) & 63;\r\n if ((cp & 0xFC) == 0xF8) {\r\n cp = ((cp & 3) << 24) | (u1 << 18) | (u2 << 12) | (u3 << 6) | u4;\r\n } else {\r\n u5 = load(ptr++) & 63;\r\n cp = ((cp & 1) << 30) | (u1 << 24) | (u2 << 18) | (u3 << 12) | (u4 << 6) | u5;\r\n }\r\n }\r\n }\r\n arr.push(cp);\r\n // if (cp < 0x10000) {\r\n // arr.push(cp);\r\n // } else {\r\n // var ch = cp - 0x10000;\r\n // arr.push(0xD800 | (ch >> 10));\r\n // arr.push(0xDC00 | (ch & 0x3FF));\r\n // }\r\n }\r\n // return String.fromCharCodes(arr);\r\n return String.fromCodePoints(arr);\r\n}\r\n\r\n/** Result structure of {@link Module#toBinary}. */\r\nexport class BinaryModule {\r\n /** WebAssembly binary. */\r\n output: Uint8Array;\r\n /** Source map, if generated. */\r\n sourceMap: string | null;\r\n}\r\n\r\n/** Tests if an expression needs an explicit 'unreachable' when it is the terminating statement. */\r\nexport function needsExplicitUnreachable(expr: ExpressionRef): bool {\r\n // not applicable if pushing a value to the stack\r\n if (_BinaryenExpressionGetType(expr) != NativeType.Unreachable) return false;\r\n\r\n switch (_BinaryenExpressionGetId(expr)) {\r\n case ExpressionId.Unreachable:\r\n case ExpressionId.Return: return false;\r\n case ExpressionId.Break: return _BinaryenBreakGetCondition(expr) != 0;\r\n case ExpressionId.Block: {\r\n if (!_BinaryenBlockGetName(expr)) { // can't break out of it\r\n let numChildren = _BinaryenBlockGetNumChildren(expr); // last child needs unreachable\r\n return numChildren > 0 && needsExplicitUnreachable(_BinaryenBlockGetChild(expr, numChildren - 1));\r\n }\r\n }\r\n }\r\n return true;\r\n}\r\n","/**\r\n * Abstract syntax tree representing a source file once parsed.\r\n * @module ast\r\n *//***/\r\n\r\nimport {\r\n CommonFlags,\r\n CommonSymbols,\r\n PATH_DELIMITER,\r\n LIBRARY_PREFIX\r\n} from \"./common\";\r\n\r\nimport {\r\n Token,\r\n Tokenizer,\r\n Range\r\n} from \"./tokenizer\";\r\n\r\nimport {\r\n normalizePath,\r\n resolvePath,\r\n CharCode\r\n} from \"./util\";\r\n\r\nexport { Token, Range };\r\n\r\n/** Indicates the kind of a node. */\r\nexport enum NodeKind {\r\n\r\n SOURCE,\r\n\r\n // types\r\n TYPE,\r\n TYPENAME,\r\n TYPEPARAMETER,\r\n PARAMETER,\r\n SIGNATURE,\r\n\r\n // expressions\r\n IDENTIFIER,\r\n ASSERTION,\r\n BINARY,\r\n CALL,\r\n CLASS,\r\n COMMA,\r\n ELEMENTACCESS,\r\n FALSE,\r\n FUNCTION,\r\n INSTANCEOF,\r\n LITERAL,\r\n NEW,\r\n NULL,\r\n PARENTHESIZED,\r\n PROPERTYACCESS,\r\n TERNARY,\r\n SUPER,\r\n THIS,\r\n TRUE,\r\n CONSTRUCTOR,\r\n UNARYPOSTFIX,\r\n UNARYPREFIX,\r\n\r\n // statements\r\n BLOCK,\r\n BREAK,\r\n CONTINUE,\r\n DO,\r\n EMPTY,\r\n EXPORT,\r\n EXPORTIMPORT,\r\n EXPRESSION,\r\n FOR,\r\n IF,\r\n IMPORT,\r\n RETURN,\r\n SWITCH,\r\n THROW,\r\n TRY,\r\n VARIABLE,\r\n VOID,\r\n WHILE,\r\n\r\n // declaration statements\r\n CLASSDECLARATION,\r\n ENUMDECLARATION,\r\n ENUMVALUEDECLARATION,\r\n FIELDDECLARATION,\r\n FUNCTIONDECLARATION,\r\n IMPORTDECLARATION,\r\n INDEXSIGNATUREDECLARATION,\r\n INTERFACEDECLARATION,\r\n METHODDECLARATION,\r\n NAMESPACEDECLARATION,\r\n TYPEDECLARATION,\r\n VARIABLEDECLARATION,\r\n\r\n // special\r\n DECORATOR,\r\n EXPORTMEMBER,\r\n SWITCHCASE,\r\n COMMENT\r\n}\r\n\r\n/** Checks if a node represents a constant value. */\r\nexport function nodeIsConstantValue(kind: NodeKind): bool {\r\n switch (kind) {\r\n case NodeKind.LITERAL:\r\n case NodeKind.NULL:\r\n case NodeKind.TRUE:\r\n case NodeKind.FALSE: return true;\r\n }\r\n return false;\r\n}\r\n\r\n/** Checks if a node might be callable. */\r\nexport function nodeIsCallable(kind: NodeKind): bool {\r\n switch (kind) {\r\n case NodeKind.IDENTIFIER:\r\n case NodeKind.ASSERTION: // if kind=NONNULL\r\n case NodeKind.CALL:\r\n case NodeKind.ELEMENTACCESS:\r\n case NodeKind.PARENTHESIZED:\r\n case NodeKind.PROPERTYACCESS:\r\n case NodeKind.SUPER: return true;\r\n }\r\n return false;\r\n}\r\n\r\n/** Checks if a node might be callable with generic arguments. */\r\nexport function nodeIsGenericCallable(kind: NodeKind): bool {\r\n switch (kind) {\r\n case NodeKind.IDENTIFIER:\r\n case NodeKind.PROPERTYACCESS: return true;\r\n }\r\n return false;\r\n}\r\n\r\n/** Base class of all nodes. */\r\nexport abstract class Node {\r\n\r\n /** Node kind indicator. */\r\n kind: NodeKind;\r\n /** Source range. */\r\n range: Range;\r\n\r\n // types\r\n\r\n static createTypeName(\r\n name: IdentifierExpression,\r\n range: Range\r\n ): TypeName {\r\n var typeName = new TypeName();\r\n typeName.range = range;\r\n typeName.identifier = name;\r\n typeName.next = null;\r\n return typeName;\r\n }\r\n\r\n static createSimpleTypeName(\r\n name: string,\r\n range: Range\r\n ): TypeName {\r\n return Node.createTypeName(Node.createIdentifierExpression(name, range), range);\r\n }\r\n\r\n static createType(\r\n name: TypeName,\r\n typeArguments: CommonTypeNode[] | null,\r\n isNullable: bool,\r\n range: Range\r\n ): TypeNode {\r\n var type = new TypeNode();\r\n type.range = range;\r\n type.name = name;\r\n type.typeArguments = typeArguments;\r\n type.isNullable = isNullable;\r\n return type;\r\n }\r\n\r\n static createOmittedType(\r\n range: Range\r\n ): TypeNode {\r\n return Node.createType(\r\n Node.createSimpleTypeName(\"\", range),\r\n null,\r\n false,\r\n range\r\n );\r\n }\r\n\r\n static createTypeParameter(\r\n name: IdentifierExpression,\r\n extendsType: TypeNode | null,\r\n defaultType: TypeNode | null,\r\n range: Range\r\n ): TypeParameterNode {\r\n var elem = new TypeParameterNode();\r\n elem.range = range;\r\n elem.name = name;\r\n elem.extendsType = extendsType;\r\n elem.defaultType = defaultType;\r\n return elem;\r\n }\r\n\r\n static createParameter(\r\n name: IdentifierExpression,\r\n type: CommonTypeNode,\r\n initializer: Expression | null,\r\n kind: ParameterKind,\r\n range: Range\r\n ): ParameterNode {\r\n var elem = new ParameterNode();\r\n elem.range = range;\r\n elem.name = name;\r\n elem.type = type;\r\n elem.initializer = initializer;\r\n elem.parameterKind = kind;\r\n return elem;\r\n }\r\n\r\n static createSignature(\r\n parameters: ParameterNode[],\r\n returnType: CommonTypeNode,\r\n explicitThisType: TypeNode | null,\r\n isNullable: bool,\r\n range: Range\r\n ): SignatureNode {\r\n var sig = new SignatureNode();\r\n sig.range = range;\r\n sig.parameters = parameters;\r\n sig.returnType = returnType;\r\n sig.explicitThisType = explicitThisType;\r\n sig.isNullable = isNullable;\r\n return sig;\r\n }\r\n\r\n // special\r\n\r\n static createDecorator(\r\n name: Expression,\r\n args: Expression[] | null,\r\n range: Range\r\n ): DecoratorNode {\r\n var stmt = new DecoratorNode();\r\n stmt.range = range;\r\n stmt.name = name;\r\n stmt.arguments = args;\r\n stmt.decoratorKind = decoratorNameToKind(name);\r\n return stmt;\r\n }\r\n\r\n static createComment(\r\n text: string,\r\n kind: CommentKind,\r\n range: Range\r\n ): CommentNode {\r\n var node = new CommentNode();\r\n node.range = range;\r\n node.commentKind = kind;\r\n node.text = text;\r\n return node;\r\n }\r\n\r\n // expressions\r\n\r\n static createIdentifierExpression(\r\n name: string,\r\n range: Range,\r\n isQuoted: bool = false\r\n ): IdentifierExpression {\r\n var expr = new IdentifierExpression();\r\n expr.range = range;\r\n expr.text = name; // TODO: extract from range\r\n expr.symbol = name; // TODO: Symbol.for(name)\r\n expr.isQuoted = isQuoted;\r\n return expr;\r\n }\r\n\r\n static createEmptyIdentifierExpression(\r\n range: Range\r\n ): IdentifierExpression {\r\n var expr = new IdentifierExpression();\r\n expr.range = range;\r\n expr.text = \"\";\r\n return expr;\r\n }\r\n\r\n static createArrayLiteralExpression(\r\n elements: (Expression | null)[],\r\n range: Range\r\n ): ArrayLiteralExpression {\r\n var expr = new ArrayLiteralExpression();\r\n expr.range = range;\r\n expr.elementExpressions = elements;\r\n return expr;\r\n }\r\n\r\n static createAssertionExpression(\r\n assertionKind: AssertionKind,\r\n expression: Expression,\r\n toType: CommonTypeNode | null,\r\n range: Range\r\n ): AssertionExpression {\r\n var expr = new AssertionExpression();\r\n expr.range = range;\r\n expr.assertionKind = assertionKind;\r\n expr.expression = expression;\r\n expr.toType = toType;\r\n return expr;\r\n }\r\n\r\n static createBinaryExpression(\r\n operator: Token,\r\n left: Expression,\r\n right: Expression,\r\n range: Range\r\n ): BinaryExpression {\r\n var expr = new BinaryExpression();\r\n expr.range = range;\r\n expr.operator = operator;\r\n expr.left = left;\r\n expr.right = right;\r\n return expr;\r\n }\r\n\r\n static createCallExpression(\r\n expression: Expression,\r\n typeArgs: CommonTypeNode[] | null,\r\n args: Expression[],\r\n range: Range\r\n ): CallExpression {\r\n var expr = new CallExpression();\r\n expr.range = range;\r\n expr.expression = expression;\r\n expr.typeArguments = typeArgs;\r\n expr.arguments = args;\r\n return expr;\r\n }\r\n\r\n static createClassExpression(\r\n declaration: ClassDeclaration\r\n ): ClassExpression {\r\n var expr = new ClassExpression();\r\n expr.range = declaration.range;\r\n expr.declaration = declaration;\r\n return expr;\r\n }\r\n\r\n static createCommaExpression(\r\n expressions: Expression[],\r\n range: Range\r\n ): CommaExpression {\r\n var expr = new CommaExpression();\r\n expr.range = range;\r\n expr.expressions = expressions;\r\n return expr;\r\n }\r\n\r\n static createConstructorExpression(\r\n range: Range\r\n ): ConstructorExpression {\r\n var expr = new ConstructorExpression();\r\n expr.range = range;\r\n return expr;\r\n }\r\n\r\n static createElementAccessExpression(\r\n expression: Expression,\r\n element: Expression,\r\n range: Range\r\n ): ElementAccessExpression {\r\n var expr = new ElementAccessExpression();\r\n expr.range = range;\r\n expr.expression = expression;\r\n expr.elementExpression = element;\r\n return expr;\r\n }\r\n\r\n static createFalseExpression(\r\n range: Range\r\n ): FalseExpression {\r\n var expr = new FalseExpression();\r\n expr.range = range;\r\n return expr;\r\n }\r\n\r\n static createFloatLiteralExpression(\r\n value: f64,\r\n range: Range\r\n ): FloatLiteralExpression {\r\n var expr = new FloatLiteralExpression();\r\n expr.range = range;\r\n expr.value = value;\r\n return expr;\r\n }\r\n\r\n static createFunctionExpression(\r\n declaration: FunctionDeclaration\r\n ): FunctionExpression {\r\n var expr = new FunctionExpression();\r\n expr.range = declaration.range;\r\n expr.declaration = declaration;\r\n return expr;\r\n }\r\n\r\n static createInstanceOfExpression(\r\n expression: Expression,\r\n isType: CommonTypeNode,\r\n range: Range\r\n ): InstanceOfExpression {\r\n var expr = new InstanceOfExpression();\r\n expr.range = range;\r\n expr.expression = expression;\r\n expr.isType = isType;\r\n return expr;\r\n }\r\n\r\n static createIntegerLiteralExpression(\r\n value: I64,\r\n range: Range\r\n ): IntegerLiteralExpression {\r\n var expr = new IntegerLiteralExpression();\r\n expr.range = range;\r\n expr.value = value;\r\n return expr;\r\n }\r\n\r\n static createNewExpression(\r\n expression: Expression,\r\n typeArgs: CommonTypeNode[] | null,\r\n args: Expression[],\r\n range: Range\r\n ): NewExpression {\r\n var expr = new NewExpression();\r\n expr.range = range;\r\n expr.expression = expression;\r\n expr.typeArguments = typeArgs;\r\n expr.arguments = args;\r\n return expr;\r\n }\r\n\r\n static createNullExpression(\r\n range: Range\r\n ): NullExpression {\r\n var expr = new NullExpression();\r\n expr.range = range;\r\n return expr;\r\n }\r\n\r\n static createObjectLiteralExpression(\r\n names: IdentifierExpression[],\r\n values: Expression[],\r\n range: Range\r\n ): ObjectLiteralExpression {\r\n var expr = new ObjectLiteralExpression();\r\n expr.range = range;\r\n expr.names = names;\r\n expr.values = values;\r\n return expr;\r\n }\r\n\r\n static createParenthesizedExpression(\r\n expression: Expression,\r\n range: Range\r\n ): ParenthesizedExpression {\r\n var expr = new ParenthesizedExpression();\r\n expr.range = range;\r\n expr.expression = expression;\r\n return expr;\r\n }\r\n\r\n static createPropertyAccessExpression(\r\n expression: Expression,\r\n property: IdentifierExpression,\r\n range: Range\r\n ): PropertyAccessExpression {\r\n var expr = new PropertyAccessExpression();\r\n expr.range = range;\r\n expr.expression = expression;\r\n expr.property = property;\r\n return expr;\r\n }\r\n\r\n static createRegexpLiteralExpression(\r\n pattern: string,\r\n flags: string,\r\n range: Range\r\n ): RegexpLiteralExpression {\r\n var expr = new RegexpLiteralExpression();\r\n expr.range = range;\r\n expr.pattern = pattern;\r\n expr.patternFlags = flags;\r\n return expr;\r\n }\r\n\r\n static createTernaryExpression(\r\n condition: Expression,\r\n ifThen: Expression,\r\n ifElse: Expression,\r\n range: Range\r\n ): TernaryExpression {\r\n var expr = new TernaryExpression();\r\n expr.range = range;\r\n expr.condition = condition;\r\n expr.ifThen = ifThen;\r\n expr.ifElse = ifElse;\r\n return expr;\r\n }\r\n\r\n static createStringLiteralExpression(\r\n value: string,\r\n range: Range\r\n ): StringLiteralExpression {\r\n var expr = new StringLiteralExpression();\r\n expr.range = range;\r\n expr.value = value;\r\n return expr;\r\n }\r\n\r\n static createSuperExpression(\r\n range: Range\r\n ): SuperExpression {\r\n var expr = new SuperExpression();\r\n expr.range = range;\r\n return expr;\r\n }\r\n\r\n static createThisExpression(\r\n range: Range\r\n ): ThisExpression {\r\n var expr = new ThisExpression();\r\n expr.range = range;\r\n return expr;\r\n }\r\n\r\n static createTrueExpression(\r\n range: Range\r\n ): TrueExpression {\r\n var expr = new TrueExpression();\r\n expr.range = range;\r\n return expr;\r\n }\r\n\r\n static createUnaryPostfixExpression(\r\n operator: Token,\r\n operand: Expression,\r\n range: Range\r\n ): UnaryPostfixExpression {\r\n var expr = new UnaryPostfixExpression();\r\n expr.range = range;\r\n expr.operator = operator;\r\n expr.operand = operand;\r\n return expr;\r\n }\r\n\r\n static createUnaryPrefixExpression(\r\n operator: Token,\r\n operand: Expression,\r\n range: Range\r\n ): UnaryPrefixExpression {\r\n var expr = new UnaryPrefixExpression();\r\n expr.range = range;\r\n expr.operator = operator;\r\n expr.operand = operand;\r\n return expr;\r\n }\r\n\r\n // statements\r\n\r\n static createBlockStatement(\r\n statements: Statement[],\r\n range: Range\r\n ): BlockStatement {\r\n var stmt = new BlockStatement();\r\n stmt.range = range;\r\n stmt.statements = statements;\r\n return stmt;\r\n }\r\n\r\n static createBreakStatement(\r\n label: IdentifierExpression | null,\r\n range: Range\r\n ): BreakStatement {\r\n var stmt = new BreakStatement();\r\n stmt.range = range;\r\n stmt.label = label;\r\n return stmt;\r\n }\r\n\r\n static createClassDeclaration(\r\n identifier: IdentifierExpression,\r\n typeParameters: TypeParameterNode[] | null,\r\n extendsType: TypeNode | null, // can't be a function\r\n implementsTypes: TypeNode[] | null, // can't be functions\r\n members: DeclarationStatement[],\r\n decorators: DecoratorNode[] | null,\r\n flags: CommonFlags,\r\n range: Range\r\n ): ClassDeclaration {\r\n var stmt = new ClassDeclaration();\r\n stmt.range = range;\r\n stmt.flags = flags;\r\n stmt.name = identifier;\r\n stmt.typeParameters = typeParameters;\r\n stmt.extendsType = extendsType;\r\n stmt.implementsTypes = implementsTypes;\r\n stmt.members = members;\r\n stmt.decorators = decorators;\r\n return stmt;\r\n }\r\n\r\n static createContinueStatement(\r\n label: IdentifierExpression | null,\r\n range: Range\r\n ): ContinueStatement {\r\n var stmt = new ContinueStatement();\r\n stmt.range = range;\r\n stmt.label = label;\r\n return stmt;\r\n }\r\n\r\n static createDoStatement(\r\n statement: Statement,\r\n condition: Expression,\r\n range: Range\r\n ): DoStatement {\r\n var stmt = new DoStatement();\r\n stmt.range = range;\r\n stmt.statement = statement;\r\n stmt.condition = condition;\r\n return stmt;\r\n }\r\n\r\n static createEmptyStatement(\r\n range: Range\r\n ): EmptyStatement {\r\n var stmt = new EmptyStatement();\r\n stmt.range = range;\r\n return stmt;\r\n }\r\n\r\n static createEnumDeclaration(\r\n name: IdentifierExpression,\r\n members: EnumValueDeclaration[],\r\n decorators: DecoratorNode[] | null,\r\n flags: CommonFlags,\r\n range: Range\r\n ): EnumDeclaration {\r\n var stmt = new EnumDeclaration();\r\n stmt.range = range;\r\n stmt.flags = flags;\r\n stmt.name = name;\r\n stmt.values = members;\r\n stmt.decorators = decorators;\r\n return stmt;\r\n }\r\n\r\n static createEnumValueDeclaration(\r\n name: IdentifierExpression,\r\n value: Expression | null,\r\n flags: CommonFlags,\r\n range: Range\r\n ): EnumValueDeclaration {\r\n var stmt = new EnumValueDeclaration();\r\n stmt.range = range;\r\n stmt.flags = flags;\r\n stmt.name = name;\r\n stmt.value = value;\r\n return stmt;\r\n }\r\n\r\n static createExportStatement(\r\n members: ExportMember[] | null,\r\n path: StringLiteralExpression | null,\r\n isDeclare: bool,\r\n range: Range\r\n ): ExportStatement {\r\n var stmt = new ExportStatement();\r\n stmt.range = range;\r\n stmt.members = members;\r\n stmt.path = path;\r\n if (path) {\r\n let normalizedPath = normalizePath(path.value);\r\n if (path.value.startsWith(\".\")) { // relative\r\n stmt.normalizedPath = resolvePath(\r\n normalizedPath,\r\n range.source.normalizedPath\r\n );\r\n } else { // absolute\r\n stmt.normalizedPath = normalizedPath;\r\n }\r\n stmt.internalPath = mangleInternalPath(stmt.normalizedPath);\r\n } else {\r\n stmt.normalizedPath = null;\r\n stmt.internalPath = null;\r\n }\r\n stmt.isDeclare = isDeclare;\r\n return stmt;\r\n }\r\n\r\n static createExportImportStatement(\r\n name: IdentifierExpression,\r\n externalName: IdentifierExpression,\r\n range: Range\r\n ): ExportImportStatement {\r\n var stmt = new ExportImportStatement();\r\n stmt.range = range;\r\n stmt.name = name;\r\n stmt.externalName = externalName;\r\n return stmt;\r\n }\r\n\r\n static createExportMember(\r\n name: IdentifierExpression,\r\n externalName: IdentifierExpression | null,\r\n range: Range\r\n ): ExportMember {\r\n var elem = new ExportMember();\r\n elem.range = range;\r\n elem.localName = name;\r\n if (!externalName) externalName = name;\r\n elem.exportedName = externalName;\r\n return elem;\r\n }\r\n\r\n static createExpressionStatement(\r\n expression: Expression\r\n ): ExpressionStatement {\r\n var stmt = new ExpressionStatement();\r\n stmt.range = expression.range;\r\n stmt.expression = expression;\r\n return stmt;\r\n }\r\n\r\n static createIfStatement(\r\n condition: Expression,\r\n ifTrue: Statement,\r\n ifFalse: Statement | null,\r\n range: Range\r\n ): IfStatement {\r\n var stmt = new IfStatement();\r\n stmt.range = range;\r\n stmt.condition = condition;\r\n stmt.ifTrue = ifTrue;\r\n stmt.ifFalse = ifFalse;\r\n return stmt;\r\n }\r\n\r\n static createImportStatement(\r\n decls: ImportDeclaration[] | null,\r\n path: StringLiteralExpression,\r\n range: Range\r\n ): ImportStatement {\r\n var stmt = new ImportStatement();\r\n stmt.range = range;\r\n stmt.declarations = decls;\r\n stmt.namespaceName = null;\r\n stmt.path = path;\r\n var normalizedPath = normalizePath(path.value);\r\n if (path.value.startsWith(\".\")) { // relative in project\r\n stmt.normalizedPath = resolvePath(\r\n normalizedPath,\r\n range.source.normalizedPath\r\n );\r\n } else { // absolute in library\r\n if (!normalizedPath.startsWith(LIBRARY_PREFIX)) {\r\n normalizedPath = LIBRARY_PREFIX + normalizedPath;\r\n }\r\n stmt.normalizedPath = normalizedPath;\r\n }\r\n stmt.internalPath = mangleInternalPath(stmt.normalizedPath);\r\n return stmt;\r\n }\r\n\r\n static createImportStatementWithWildcard(\r\n identifier: IdentifierExpression,\r\n path: StringLiteralExpression,\r\n range: Range\r\n ): ImportStatement {\r\n var stmt = new ImportStatement();\r\n stmt.range = range;\r\n stmt.declarations = null;\r\n stmt.namespaceName = identifier;\r\n stmt.path = path;\r\n stmt.normalizedPath = resolvePath(\r\n normalizePath(path.value),\r\n range.source.normalizedPath\r\n );\r\n stmt.internalPath = mangleInternalPath(stmt.normalizedPath);\r\n return stmt;\r\n }\r\n\r\n static createImportDeclaration(\r\n foreignName: IdentifierExpression,\r\n name: IdentifierExpression | null,\r\n range: Range\r\n ): ImportDeclaration {\r\n var elem = new ImportDeclaration();\r\n elem.range = range;\r\n elem.foreignName = foreignName;\r\n if (!name) name = foreignName;\r\n elem.name = name;\r\n return elem;\r\n }\r\n\r\n static createInterfaceDeclaration(\r\n name: IdentifierExpression,\r\n typeParameters: TypeParameterNode[] | null,\r\n extendsType: TypeNode | null, // can't be a function\r\n members: DeclarationStatement[],\r\n decorators: DecoratorNode[] | null,\r\n flags: CommonFlags,\r\n range: Range\r\n ): InterfaceDeclaration {\r\n var stmt = new InterfaceDeclaration();\r\n stmt.range = range;\r\n stmt.flags = flags;\r\n stmt.name = name;\r\n stmt.typeParameters = typeParameters;\r\n stmt.extendsType = extendsType;\r\n stmt.members = members;\r\n stmt.decorators = decorators;\r\n return stmt;\r\n }\r\n\r\n static createFieldDeclaration(\r\n name: IdentifierExpression,\r\n type: CommonTypeNode | null,\r\n initializer: Expression | null,\r\n decorators: DecoratorNode[] | null,\r\n flags: CommonFlags,\r\n range: Range\r\n ): FieldDeclaration {\r\n var stmt = new FieldDeclaration();\r\n stmt.range = range;\r\n stmt.flags = flags;\r\n stmt.name = name;\r\n stmt.type = type;\r\n stmt.initializer = initializer;\r\n stmt.decorators = decorators;\r\n return stmt;\r\n }\r\n\r\n static createForStatement(\r\n initializer: Statement | null,\r\n condition: Expression | null,\r\n incrementor: Expression | null,\r\n statement: Statement,\r\n range: Range\r\n ): ForStatement {\r\n var stmt = new ForStatement();\r\n stmt.range = range;\r\n stmt.initializer = initializer;\r\n stmt.condition = condition;\r\n stmt.incrementor = incrementor;\r\n stmt.statement = statement;\r\n return stmt;\r\n }\r\n\r\n static createFunctionDeclaration(\r\n name: IdentifierExpression,\r\n typeParameters: TypeParameterNode[] | null,\r\n signature: SignatureNode,\r\n body: Statement | null,\r\n decorators: DecoratorNode[] | null,\r\n flags: CommonFlags,\r\n arrowKind: ArrowKind,\r\n range: Range\r\n ): FunctionDeclaration {\r\n var stmt = new FunctionDeclaration();\r\n stmt.range = range;\r\n stmt.flags = flags;\r\n stmt.name = name;\r\n stmt.typeParameters = typeParameters;\r\n stmt.signature = signature;\r\n stmt.body = body;\r\n stmt.decorators = decorators;\r\n stmt.arrowKind = arrowKind;\r\n return stmt;\r\n }\r\n\r\n static createIndexSignatureDeclaration(\r\n keyType: TypeNode,\r\n valueType: CommonTypeNode,\r\n range: Range\r\n ): IndexSignatureDeclaration {\r\n var elem = new IndexSignatureDeclaration();\r\n elem.range = range;\r\n elem.keyType = keyType;\r\n elem.valueType = valueType;\r\n return elem;\r\n }\r\n\r\n static createMethodDeclaration(\r\n name: IdentifierExpression,\r\n typeParameters: TypeParameterNode[] | null,\r\n signature: SignatureNode,\r\n body: Statement | null,\r\n decorators: DecoratorNode[] | null,\r\n flags: CommonFlags,\r\n range: Range\r\n ): MethodDeclaration {\r\n var stmt = new MethodDeclaration();\r\n stmt.range = range;\r\n stmt.flags = flags;\r\n stmt.name = name;\r\n stmt.typeParameters = typeParameters;\r\n stmt.signature = signature;\r\n stmt.body = body;\r\n stmt.decorators = decorators;\r\n return stmt;\r\n }\r\n\r\n static createNamespaceDeclaration(\r\n name: IdentifierExpression,\r\n members: Statement[],\r\n decorators: DecoratorNode[] | null,\r\n flags: CommonFlags,\r\n range: Range\r\n ): NamespaceDeclaration {\r\n var stmt = new NamespaceDeclaration();\r\n stmt.range = range;\r\n stmt.flags = flags;\r\n stmt.name = name;\r\n stmt.members = members;\r\n stmt.decorators = decorators;\r\n return stmt;\r\n }\r\n\r\n static createReturnStatement(\r\n value: Expression | null,\r\n range: Range\r\n ): ReturnStatement {\r\n var stmt = new ReturnStatement();\r\n stmt.range = range;\r\n stmt.value = value;\r\n return stmt;\r\n }\r\n\r\n static createSwitchStatement(\r\n condition: Expression,\r\n cases: SwitchCase[],\r\n range: Range\r\n ): SwitchStatement {\r\n var stmt = new SwitchStatement();\r\n stmt.range = range;\r\n stmt.condition = condition;\r\n stmt.cases = cases;\r\n return stmt;\r\n }\r\n\r\n static createSwitchCase(\r\n label: Expression | null,\r\n statements: Statement[],\r\n range: Range\r\n ): SwitchCase {\r\n var elem = new SwitchCase();\r\n elem.range = range;\r\n elem.label = label;\r\n elem.statements = statements;\r\n return elem;\r\n }\r\n\r\n static createThrowStatement(\r\n value: Expression,\r\n range: Range\r\n ): ThrowStatement {\r\n var stmt = new ThrowStatement();\r\n stmt.range = range;\r\n stmt.value = value;\r\n return stmt;\r\n }\r\n\r\n static createTryStatement(\r\n statements: Statement[],\r\n catchVariable: IdentifierExpression | null,\r\n catchStatements: Statement[] | null,\r\n finallyStatements: Statement[] | null,\r\n range: Range\r\n ): TryStatement {\r\n var stmt = new TryStatement();\r\n stmt.range = range;\r\n stmt.statements = statements;\r\n stmt.catchVariable = catchVariable;\r\n stmt.catchStatements = catchStatements;\r\n stmt.finallyStatements = finallyStatements;\r\n return stmt;\r\n }\r\n\r\n static createTypeDeclaration(\r\n name: IdentifierExpression,\r\n typeParameters: TypeParameterNode[] | null,\r\n alias: CommonTypeNode,\r\n decorators: DecoratorNode[] | null,\r\n flags: CommonFlags,\r\n range: Range\r\n ): TypeDeclaration {\r\n var stmt = new TypeDeclaration();\r\n stmt.range = range;\r\n stmt.flags = flags;\r\n stmt.name = name;\r\n stmt.typeParameters = typeParameters;\r\n stmt.type = alias;\r\n stmt.decorators = decorators;\r\n return stmt;\r\n }\r\n\r\n static createVariableStatement(\r\n declarations: VariableDeclaration[],\r\n decorators: DecoratorNode[] | null,\r\n range: Range\r\n ): VariableStatement {\r\n var stmt = new VariableStatement();\r\n stmt.range = range;\r\n stmt.declarations = declarations;\r\n stmt.decorators = decorators;\r\n return stmt;\r\n }\r\n\r\n static createVariableDeclaration(\r\n name: IdentifierExpression,\r\n type: CommonTypeNode | null,\r\n initializer: Expression | null,\r\n decorators: DecoratorNode[] | null,\r\n flags: CommonFlags,\r\n range: Range\r\n ): VariableDeclaration {\r\n var elem = new VariableDeclaration();\r\n elem.range = range;\r\n elem.flags = flags;\r\n elem.name = name;\r\n elem.type = type;\r\n elem.initializer = initializer;\r\n elem.decorators = decorators; // inherited\r\n return elem;\r\n }\r\n\r\n static createVoidStatement(\r\n expression: Expression,\r\n range: Range\r\n ): VoidStatement {\r\n var stmt = new VoidStatement();\r\n stmt.range = range;\r\n stmt.expression = expression;\r\n return stmt;\r\n }\r\n\r\n static createWhileStatement(\r\n condition: Expression,\r\n statement: Statement,\r\n range: Range\r\n ): WhileStatement {\r\n var stmt = new WhileStatement();\r\n stmt.range = range;\r\n stmt.condition = condition;\r\n stmt.statement = statement;\r\n return stmt;\r\n }\r\n}\r\n\r\n// types\r\n\r\nexport abstract class CommonTypeNode extends Node {\r\n // kind varies\r\n\r\n /** Whether nullable or not. */\r\n isNullable: bool;\r\n}\r\n\r\n/** Represents a type name. */\r\nexport class TypeName extends Node {\r\n kind = NodeKind.TYPENAME;\r\n\r\n /** Identifier of this part. */\r\n identifier: IdentifierExpression;\r\n /** Next part of the type name or `null` if this is the last part. */\r\n next: TypeName | null;\r\n}\r\n\r\n/** Represents a type annotation. */\r\nexport class TypeNode extends CommonTypeNode {\r\n kind = NodeKind.TYPE;\r\n\r\n /** Type name. */\r\n name: TypeName;\r\n /** Type argument references. */\r\n typeArguments: CommonTypeNode[] | null;\r\n}\r\n\r\n/** Represents a type parameter. */\r\nexport class TypeParameterNode extends Node {\r\n kind = NodeKind.TYPEPARAMETER;\r\n\r\n /** Identifier reference. */\r\n name: IdentifierExpression;\r\n /** Extended type reference, if any. */\r\n extendsType: TypeNode | null; // can't be a function\r\n /** Default type if omitted, if any. */\r\n defaultType: TypeNode | null; // can't be a function\r\n}\r\n\r\n/** Represents the kind of a parameter. */\r\nexport enum ParameterKind {\r\n /** No specific flags. */\r\n DEFAULT,\r\n /** Is an optional parameter. */\r\n OPTIONAL,\r\n /** Is a rest parameter. */\r\n REST\r\n}\r\n\r\n/** Represents a function parameter. */\r\nexport class ParameterNode extends Node {\r\n kind = NodeKind.PARAMETER;\r\n\r\n /** Parameter kind. */\r\n parameterKind: ParameterKind;\r\n /** Parameter name. */\r\n name: IdentifierExpression;\r\n /** Parameter type. */\r\n type: CommonTypeNode;\r\n /** Initializer expression, if present. */\r\n initializer: Expression | null;\r\n /** Implicit field declaration, if applicable. */\r\n implicitFieldDeclaration: FieldDeclaration | null = null;\r\n /** Common flags indicating specific traits. */\r\n flags: CommonFlags = CommonFlags.NONE;\r\n\r\n /** Tests if this node has the specified flag or flags. */\r\n is(flag: CommonFlags): bool { return (this.flags & flag) == flag; }\r\n /** Tests if this node has one of the specified flags. */\r\n isAny(flag: CommonFlags): bool { return (this.flags & flag) != 0; }\r\n /** Sets a specific flag or flags. */\r\n set(flag: CommonFlags): void { this.flags |= flag; }\r\n}\r\n\r\n/** Represents a function signature. */\r\nexport class SignatureNode extends CommonTypeNode {\r\n kind = NodeKind.SIGNATURE;\r\n\r\n /** Accepted parameters. */\r\n parameters: ParameterNode[];\r\n /** Return type. */\r\n returnType: CommonTypeNode;\r\n /** Explicitly provided this type, if any. */\r\n explicitThisType: TypeNode | null; // can't be a function\r\n}\r\n\r\n// special\r\n\r\n/** Built-in decorator kinds. */\r\nexport enum DecoratorKind {\r\n CUSTOM,\r\n GLOBAL,\r\n OPERATOR,\r\n OPERATOR_BINARY,\r\n OPERATOR_PREFIX,\r\n OPERATOR_POSTFIX,\r\n UNMANAGED,\r\n SEALED,\r\n INLINE,\r\n EXTERNAL,\r\n BUILTIN,\r\n LAZY,\r\n START\r\n}\r\n\r\n/** Returns the kind of the specified decorator. Defaults to {@link DecoratorKind.CUSTOM}. */\r\nexport function decoratorNameToKind(name: Expression): DecoratorKind {\r\n // @global, @inline, @operator, @sealed, @unmanaged\r\n if (name.kind == NodeKind.IDENTIFIER) {\r\n let nameStr = (name).text;\r\n assert(nameStr.length);\r\n switch (nameStr.charCodeAt(0)) {\r\n case CharCode.b: {\r\n if (nameStr == \"builtin\") return DecoratorKind.BUILTIN;\r\n break;\r\n }\r\n case CharCode.e: {\r\n if (nameStr == \"external\") return DecoratorKind.EXTERNAL;\r\n break;\r\n }\r\n case CharCode.g: {\r\n if (nameStr == \"global\") return DecoratorKind.GLOBAL;\r\n break;\r\n }\r\n case CharCode.i: {\r\n if (nameStr == \"inline\") return DecoratorKind.INLINE;\r\n break;\r\n }\r\n case CharCode.l: {\r\n if (nameStr == \"lazy\") return DecoratorKind.LAZY;\r\n break;\r\n }\r\n case CharCode.o: {\r\n if (nameStr == \"operator\") return DecoratorKind.OPERATOR;\r\n break;\r\n }\r\n case CharCode.s: {\r\n if (nameStr == \"sealed\") return DecoratorKind.SEALED;\r\n if (nameStr == \"start\") return DecoratorKind.START;\r\n break;\r\n }\r\n case CharCode.u: {\r\n if (nameStr == \"unmanaged\") return DecoratorKind.UNMANAGED;\r\n break;\r\n }\r\n }\r\n } else if (\r\n name.kind == NodeKind.PROPERTYACCESS &&\r\n (name).expression.kind == NodeKind.IDENTIFIER\r\n ) {\r\n let nameStr = ((name).expression).text;\r\n assert(nameStr.length);\r\n let propStr = (name).property.text;\r\n assert(propStr.length);\r\n // @operator.binary, @operator.prefix, @operator.postfix\r\n if (nameStr == \"operator\") {\r\n switch (propStr.charCodeAt(0)) {\r\n case CharCode.b: {\r\n if (propStr == \"binary\") return DecoratorKind.OPERATOR_BINARY;\r\n break;\r\n }\r\n case CharCode.p: {\r\n switch (propStr) {\r\n case \"prefix\": return DecoratorKind.OPERATOR_PREFIX;\r\n case \"postfix\": return DecoratorKind.OPERATOR_POSTFIX;\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n return DecoratorKind.CUSTOM;\r\n}\r\n\r\n/** Represents a decorator. */\r\nexport class DecoratorNode extends Node {\r\n kind = NodeKind.DECORATOR;\r\n\r\n /** Built-in kind, if applicable. */\r\n decoratorKind: DecoratorKind;\r\n /** Name expression. */\r\n name: Expression;\r\n /** Argument expressions. */\r\n arguments: Expression[] | null;\r\n}\r\n\r\n/** Comment kinds. */\r\nexport enum CommentKind {\r\n /** Line comment. */\r\n LINE,\r\n /** Triple-slash comment. */\r\n TRIPLE,\r\n /** Block comment. */\r\n BLOCK\r\n}\r\n\r\n/** Represents a comment. */\r\nexport class CommentNode extends Node {\r\n kind = NodeKind.COMMENT;\r\n\r\n /** Comment kind. */\r\n commentKind: CommentKind;\r\n /** Comment text. */\r\n text: string;\r\n}\r\n\r\n// expressions\r\n\r\n/** Base class of all expression nodes. */\r\nexport abstract class Expression extends Node { }\r\n\r\n/** Represents an identifier expression. */\r\nexport class IdentifierExpression extends Expression {\r\n kind = NodeKind.IDENTIFIER;\r\n\r\n /** Textual name. */\r\n text: string;\r\n /** Symbol. */\r\n symbol: string; // TODO: symbol\r\n /** Whether quoted or not. */\r\n isQuoted: bool;\r\n}\r\n\r\n/** Indicates the kind of a literal. */\r\nexport enum LiteralKind {\r\n FLOAT,\r\n INTEGER,\r\n STRING,\r\n REGEXP,\r\n ARRAY,\r\n OBJECT\r\n}\r\n\r\n/** Base class of all literal expressions. */\r\nexport abstract class LiteralExpression extends Expression {\r\n kind = NodeKind.LITERAL;\r\n\r\n /** Specific literal kind. */\r\n literalKind: LiteralKind;\r\n}\r\n\r\n/** Represents an `[]` literal expression. */\r\nexport class ArrayLiteralExpression extends LiteralExpression {\r\n literalKind = LiteralKind.ARRAY;\r\n\r\n /** Nested element expressions. */\r\n elementExpressions: (Expression | null)[];\r\n}\r\n\r\n/** Indicates the kind of an assertion. */\r\nexport enum AssertionKind {\r\n PREFIX,\r\n AS,\r\n NONNULL\r\n}\r\n\r\n/** Represents an assertion expression. */\r\nexport class AssertionExpression extends Expression {\r\n kind = NodeKind.ASSERTION;\r\n\r\n /** Specific kind of this assertion. */\r\n assertionKind: AssertionKind;\r\n /** Expression being asserted. */\r\n expression: Expression;\r\n /** Target type. */\r\n toType: CommonTypeNode | null;\r\n}\r\n\r\n/** Represents a binary expression. */\r\nexport class BinaryExpression extends Expression {\r\n kind = NodeKind.BINARY;\r\n\r\n /** Operator token. */\r\n operator: Token;\r\n /** Left-hand side expression */\r\n left: Expression;\r\n /** Right-hand side expression. */\r\n right: Expression;\r\n}\r\n\r\n/** Represents a call expression. */\r\nexport class CallExpression extends Expression {\r\n kind = NodeKind.CALL;\r\n\r\n /** Called expression. Usually an identifier or property access expression. */\r\n expression: Expression;\r\n /** Provided type arguments. */\r\n typeArguments: CommonTypeNode[] | null;\r\n /** Provided arguments. */\r\n arguments: Expression[];\r\n\r\n /** Gets the type arguments range for reporting. */\r\n get typeArgumentsRange(): Range {\r\n var typeArguments = this.typeArguments;\r\n var numTypeArguments: i32;\r\n if (typeArguments && (numTypeArguments = typeArguments.length)) {\r\n return Range.join(typeArguments[0].range, typeArguments[numTypeArguments - 1].range);\r\n }\r\n return this.expression.range;\r\n }\r\n\r\n /** Gets the arguments range for reporting. */\r\n get argumentsRange(): Range {\r\n var args = this.arguments;\r\n var numArguments = args.length;\r\n if (numArguments) {\r\n return Range.join(args[0].range, args[numArguments - 1].range);\r\n }\r\n return this.expression.range;\r\n }\r\n}\r\n\r\n/** Represents a class expression using the 'class' keyword. */\r\nexport class ClassExpression extends Expression {\r\n kind = NodeKind.CLASS;\r\n\r\n /** Inline class declaration. */\r\n declaration: ClassDeclaration;\r\n}\r\n\r\n/** Represents a comma expression composed of multiple expressions. */\r\nexport class CommaExpression extends Expression {\r\n kind = NodeKind.COMMA;\r\n\r\n /** Sequential expressions. */\r\n expressions: Expression[];\r\n}\r\n\r\n/** Represents a `constructor` expression. */\r\nexport class ConstructorExpression extends IdentifierExpression {\r\n kind = NodeKind.CONSTRUCTOR;\r\n text = \"constructor\";\r\n symbol = CommonSymbols.constructor;\r\n}\r\n\r\n/** Represents an element access expression, e.g., array access. */\r\nexport class ElementAccessExpression extends Expression {\r\n kind = NodeKind.ELEMENTACCESS;\r\n\r\n /** Expression being accessed. */\r\n expression: Expression;\r\n /** Element of the expression being accessed. */\r\n elementExpression: Expression;\r\n}\r\n\r\n/** Represents a float literal expression. */\r\nexport class FloatLiteralExpression extends LiteralExpression {\r\n literalKind = LiteralKind.FLOAT;\r\n\r\n /** Float value. */\r\n value: f64;\r\n}\r\n\r\n/** Represents a function expression using the 'function' keyword. */\r\nexport class FunctionExpression extends Expression {\r\n kind = NodeKind.FUNCTION;\r\n\r\n /** Inline function declaration. */\r\n declaration: FunctionDeclaration;\r\n}\r\n\r\n/** Represents an `instanceof` expression. */\r\nexport class InstanceOfExpression extends Expression {\r\n kind = NodeKind.INSTANCEOF;\r\n\r\n /** Expression being asserted. */\r\n expression: Expression;\r\n /** Type to test for. */\r\n isType: CommonTypeNode;\r\n}\r\n\r\n/** Represents an integer literal expression. */\r\nexport class IntegerLiteralExpression extends LiteralExpression {\r\n literalKind = LiteralKind.INTEGER;\r\n\r\n /** Integer value. */\r\n value: I64;\r\n}\r\n\r\n/** Represents a `new` expression. Like a call but with its own kind. */\r\nexport class NewExpression extends CallExpression {\r\n kind = NodeKind.NEW;\r\n}\r\n\r\n/** Represents a `null` expression. */\r\nexport class NullExpression extends IdentifierExpression {\r\n kind = NodeKind.NULL;\r\n text = \"null\";\r\n symbol = CommonSymbols.null_;\r\n}\r\n\r\n/** Represents an object literal expression. */\r\nexport class ObjectLiteralExpression extends LiteralExpression {\r\n literalKind = LiteralKind.OBJECT;\r\n\r\n /** Field names. */\r\n names: IdentifierExpression[];\r\n /** Field values. */\r\n values: Expression[];\r\n}\r\n\r\n/** Represents a parenthesized expression. */\r\nexport class ParenthesizedExpression extends Expression {\r\n kind = NodeKind.PARENTHESIZED;\r\n\r\n /** Expression in parenthesis. */\r\n expression: Expression;\r\n}\r\n\r\n/** Represents a property access expression. */\r\nexport class PropertyAccessExpression extends Expression {\r\n kind = NodeKind.PROPERTYACCESS;\r\n\r\n /** Expression being accessed. */\r\n expression: Expression;\r\n /** Property of the expression being accessed. */\r\n property: IdentifierExpression;\r\n}\r\n\r\n/** Represents a regular expression literal expression. */\r\nexport class RegexpLiteralExpression extends LiteralExpression {\r\n literalKind = LiteralKind.REGEXP;\r\n\r\n /** Regular expression pattern. */\r\n pattern: string;\r\n /** Regular expression flags. */\r\n patternFlags: string;\r\n}\r\n\r\n/** Represents a ternary expression, i.e., short if notation. */\r\nexport class TernaryExpression extends Expression {\r\n kind = NodeKind.TERNARY;\r\n\r\n /** Condition expression. */\r\n condition: Expression;\r\n /** Expression executed when condition is `true`. */\r\n ifThen: Expression;\r\n /** Expression executed when condition is `false`. */\r\n ifElse: Expression;\r\n}\r\n\r\n/** Represents a string literal expression. */\r\nexport class StringLiteralExpression extends LiteralExpression {\r\n literalKind = LiteralKind.STRING;\r\n\r\n /** String value without quotes. */\r\n value: string;\r\n}\r\n\r\n/** Represents a `super` expression. */\r\nexport class SuperExpression extends IdentifierExpression {\r\n kind = NodeKind.SUPER;\r\n text = \"super\";\r\n symbol = CommonSymbols.super_;\r\n}\r\n\r\n/** Represents a `this` expression. */\r\nexport class ThisExpression extends IdentifierExpression {\r\n kind = NodeKind.THIS;\r\n text = \"this\";\r\n symbol = CommonSymbols.this_;\r\n}\r\n\r\n/** Represents a `true` expression. */\r\nexport class TrueExpression extends IdentifierExpression {\r\n kind = NodeKind.TRUE;\r\n text = \"true\";\r\n symbol = CommonSymbols.true_;\r\n}\r\n\r\n/** Represents a `false` expression. */\r\nexport class FalseExpression extends IdentifierExpression {\r\n kind = NodeKind.FALSE;\r\n text = \"false\";\r\n symbol = CommonSymbols.false_;\r\n}\r\n\r\n/** Base class of all unary expressions. */\r\nexport abstract class UnaryExpression extends Expression {\r\n\r\n /** Operator token. */\r\n operator: Token;\r\n /** Operand expression. */\r\n operand: Expression;\r\n}\r\n\r\n/** Represents a unary postfix expression, e.g. a postfix increment. */\r\nexport class UnaryPostfixExpression extends UnaryExpression {\r\n kind = NodeKind.UNARYPOSTFIX;\r\n}\r\n\r\n/** Represents a unary prefix expression, e.g. a negation. */\r\nexport class UnaryPrefixExpression extends UnaryExpression {\r\n kind = NodeKind.UNARYPREFIX;\r\n}\r\n\r\n// statements\r\n\r\n/** Base class of all statement nodes. */\r\nexport abstract class Statement extends Node { }\r\n\r\n/** Indicates the specific kind of a source. */\r\nexport enum SourceKind {\r\n /** Default source. Usually imported from an entry file. */\r\n DEFAULT,\r\n /** Entry file. */\r\n ENTRY,\r\n /** Library file. */\r\n LIBRARY\r\n}\r\n\r\n/** A top-level source node. */\r\nexport class Source extends Node {\r\n kind = NodeKind.SOURCE;\r\n parent = null;\r\n\r\n /** Source kind. */\r\n sourceKind: SourceKind;\r\n /** Normalized path. */\r\n normalizedPath: string;\r\n /** Path used internally. */\r\n internalPath: string;\r\n /** Simple path (last part without extension). */\r\n simplePath: string;\r\n /** Contained statements. */\r\n statements: Statement[];\r\n /** Full source text. */\r\n text: string;\r\n /** Tokenizer reference. */\r\n tokenizer: Tokenizer | null = null;\r\n /** Source map index. */\r\n debugInfoIndex: i32 = -1;\r\n /** Re-exported sources. */\r\n exportPaths: Set | null = null;\r\n\r\n /** Constructs a new source node. */\r\n constructor(normalizedPath: string, text: string, kind: SourceKind) {\r\n super();\r\n this.sourceKind = kind;\r\n this.normalizedPath = normalizedPath;\r\n var internalPath = mangleInternalPath(this.normalizedPath);\r\n this.internalPath = internalPath;\r\n var pos = internalPath.lastIndexOf(PATH_DELIMITER);\r\n this.simplePath = pos >= 0 ? internalPath.substring(pos + 1) : internalPath;\r\n this.statements = new Array();\r\n this.range = new Range(this, 0, text.length);\r\n this.text = text;\r\n }\r\n\r\n /** Tests if this source is an entry file. */\r\n get isEntry(): bool { return this.sourceKind == SourceKind.ENTRY; }\r\n /** Tests if this source is a stdlib file. */\r\n get isLibrary(): bool { return this.sourceKind == SourceKind.LIBRARY; }\r\n}\r\n\r\n/** Base class of all declaration statements. */\r\nexport abstract class DeclarationStatement extends Statement {\r\n /** Simple name being declared. */\r\n name: IdentifierExpression;\r\n /** Array of decorators. */\r\n decorators: DecoratorNode[] | null = null;\r\n /** Common flags indicating specific traits. */\r\n flags: CommonFlags = CommonFlags.NONE;\r\n\r\n /** Tests if this node has the specified flag or flags. */\r\n is(flag: CommonFlags): bool { return (this.flags & flag) == flag; }\r\n /** Tests if this node has one of the specified flags. */\r\n isAny(flag: CommonFlags): bool { return (this.flags & flag) != 0; }\r\n /** Sets a specific flag or flags. */\r\n set(flag: CommonFlags): void { this.flags |= flag; }\r\n}\r\n\r\n/** Represents an index signature declaration. */\r\nexport class IndexSignatureDeclaration extends DeclarationStatement {\r\n kind = NodeKind.INDEXSIGNATUREDECLARATION;\r\n\r\n /** Key type. */\r\n keyType: TypeNode;\r\n /** Value type. */\r\n valueType: CommonTypeNode;\r\n}\r\n\r\n/** Base class of all variable-like declaration statements. */\r\nexport abstract class VariableLikeDeclarationStatement extends DeclarationStatement {\r\n\r\n /** Variable type. */\r\n type: CommonTypeNode | null;\r\n /** Variable initializer. */\r\n initializer: Expression | null;\r\n}\r\n\r\n/** Represents a block statement. */\r\nexport class BlockStatement extends Statement {\r\n kind = NodeKind.BLOCK;\r\n\r\n /** Contained statements. */\r\n statements: Statement[];\r\n}\r\n\r\n/** Represents a `break` statement. */\r\nexport class BreakStatement extends Statement {\r\n kind = NodeKind.BREAK;\r\n\r\n /** Target label, if applicable. */\r\n label: IdentifierExpression | null;\r\n}\r\n\r\n/** Represents a `class` declaration. */\r\nexport class ClassDeclaration extends DeclarationStatement {\r\n kind = NodeKind.CLASSDECLARATION;\r\n\r\n /** Accepted type parameters. */\r\n typeParameters: TypeParameterNode[] | null;\r\n /** Base class type being extended, if any. */\r\n extendsType: TypeNode | null; // can't be a function\r\n /** Interface types being implemented, if any. */\r\n implementsTypes: TypeNode[] | null; // can't be functions\r\n /** Class member declarations. */\r\n members: DeclarationStatement[];\r\n\r\n get isGeneric(): bool {\r\n var typeParameters = this.typeParameters;\r\n return typeParameters != null && typeParameters.length > 0;\r\n }\r\n}\r\n\r\n/** Represents a `continue` statement. */\r\nexport class ContinueStatement extends Statement {\r\n kind = NodeKind.CONTINUE;\r\n\r\n /** Target label, if applicable. */\r\n label: IdentifierExpression | null;\r\n}\r\n\r\n/** Represents a `do` statement. */\r\nexport class DoStatement extends Statement {\r\n kind = NodeKind.DO;\r\n\r\n /** Statement being looped over. */\r\n statement: Statement;\r\n /** Condition when to repeat. */\r\n condition: Expression;\r\n}\r\n\r\n/** Represents an empty statement, i.e., a semicolon terminating nothing. */\r\nexport class EmptyStatement extends Statement {\r\n kind = NodeKind.EMPTY;\r\n}\r\n\r\n/** Represents an `enum` declaration. */\r\nexport class EnumDeclaration extends DeclarationStatement {\r\n kind = NodeKind.ENUMDECLARATION;\r\n\r\n /** Enum value declarations. */\r\n values: EnumValueDeclaration[];\r\n}\r\n\r\n/** Represents a value of an `enum` declaration. */\r\nexport class EnumValueDeclaration extends VariableLikeDeclarationStatement {\r\n kind = NodeKind.ENUMVALUEDECLARATION;\r\n // name is inherited\r\n\r\n /** Value expression. */\r\n value: Expression | null;\r\n}\r\n\r\n/** Represents an `export import` statement of an interface. */\r\nexport class ExportImportStatement extends Node {\r\n kind = NodeKind.EXPORTIMPORT;\r\n\r\n /** Identifier being imported. */\r\n name: IdentifierExpression;\r\n /** Identifier being exported. */\r\n externalName: IdentifierExpression;\r\n}\r\n\r\n/** Represents a member of an `export` statement. */\r\nexport class ExportMember extends Node {\r\n kind = NodeKind.EXPORTMEMBER;\r\n\r\n /** Local identifier. */\r\n localName: IdentifierExpression;\r\n /** Exported identifier. */\r\n exportedName: IdentifierExpression;\r\n}\r\n\r\n/** Represents an `export` statement. */\r\nexport class ExportStatement extends Statement {\r\n kind = NodeKind.EXPORT;\r\n\r\n /** Array of members if a set of named exports, or `null` if a file export. */\r\n members: ExportMember[] | null;\r\n /** Path being exported from, if applicable. */\r\n path: StringLiteralExpression | null;\r\n /** Normalized path, if `path` is set. */\r\n normalizedPath: string | null;\r\n /** Mangled internal path being referenced, if `path` is set. */\r\n internalPath: string | null;\r\n /** Whether this is a declared export. */\r\n isDeclare: bool;\r\n}\r\n\r\n/** Represents an expression that is used as a statement. */\r\nexport class ExpressionStatement extends Statement {\r\n kind = NodeKind.EXPRESSION;\r\n\r\n /** Expression being used as a statement.*/\r\n expression: Expression;\r\n}\r\n\r\n/** Represents a field declaration within a `class`. */\r\nexport class FieldDeclaration extends VariableLikeDeclarationStatement {\r\n kind = NodeKind.FIELDDECLARATION;\r\n\r\n /** Parameter index if declared as a constructor parameter, otherwise `-1`. */\r\n parameterIndex: i32 = -1;\r\n}\r\n\r\n/** Represents a `for` statement. */\r\nexport class ForStatement extends Statement {\r\n kind = NodeKind.FOR;\r\n\r\n /**\r\n * Initializer statement, if present.\r\n * Either a {@link VariableStatement} or {@link ExpressionStatement}.\r\n */\r\n initializer: Statement | null;\r\n /** Condition expression, if present. */\r\n condition: Expression | null;\r\n /** Incrementor expression, if present. */\r\n incrementor: Expression | null;\r\n /** Statement being looped over. */\r\n statement: Statement;\r\n}\r\n\r\n/** Indicates the kind of an array function. */\r\nexport const enum ArrowKind {\r\n /** Not an arrow function. */\r\n NONE,\r\n /** Parenthesized parameter list. */\r\n ARROW_PARENTHESIZED,\r\n /** Single parameter without parenthesis. */\r\n ARROW_SINGLE\r\n}\r\n\r\n/** Represents a `function` declaration. */\r\nexport class FunctionDeclaration extends DeclarationStatement {\r\n kind = NodeKind.FUNCTIONDECLARATION;\r\n\r\n /** Type parameters, if any. */\r\n typeParameters: TypeParameterNode[] | null;\r\n /** Function signature. */\r\n signature: SignatureNode;\r\n /** Body statement. Usually a block. */\r\n body: Statement | null;\r\n /** Arrow function kind, if applicable. */\r\n arrowKind: ArrowKind;\r\n\r\n get isGeneric(): bool {\r\n var typeParameters = this.typeParameters;\r\n return typeParameters != null && typeParameters.length > 0;\r\n }\r\n\r\n /** Clones this function declaration. */\r\n clone(): FunctionDeclaration {\r\n return Node.createFunctionDeclaration(\r\n this.name,\r\n this.typeParameters,\r\n this.signature,\r\n this.body,\r\n this.decorators,\r\n this.flags,\r\n this.arrowKind,\r\n this.range\r\n );\r\n }\r\n}\r\n\r\n/** Represents an `if` statement. */\r\nexport class IfStatement extends Statement {\r\n kind = NodeKind.IF;\r\n\r\n /** Condition. */\r\n condition: Expression;\r\n /** Statement executed when condition is `true`. */\r\n ifTrue: Statement;\r\n /** Statement executed when condition is `false`. */\r\n ifFalse: Statement | null;\r\n}\r\n\r\n/** Represents an `import` declaration part of an {@link ImportStatement}. */\r\nexport class ImportDeclaration extends DeclarationStatement {\r\n kind = NodeKind.IMPORTDECLARATION;\r\n\r\n /** Identifier being imported. */\r\n foreignName: IdentifierExpression;\r\n}\r\n\r\n/** Represents an `import` statement. */\r\nexport class ImportStatement extends Statement {\r\n kind = NodeKind.IMPORT;\r\n\r\n /** Array of member declarations or `null` if an asterisk import. */\r\n declarations: ImportDeclaration[] | null;\r\n /** Name of the local namespace, if an asterisk import. */\r\n namespaceName: IdentifierExpression | null;\r\n /** Path being imported from. */\r\n path: StringLiteralExpression;\r\n /** Normalized path. */\r\n normalizedPath: string;\r\n /** Mangled internal path being referenced. */\r\n internalPath: string;\r\n}\r\n\r\n/** Represents an `interfarce` declaration. */\r\nexport class InterfaceDeclaration extends ClassDeclaration {\r\n kind = NodeKind.INTERFACEDECLARATION;\r\n}\r\n\r\n/** Represents a method declaration within a `class`. */\r\nexport class MethodDeclaration extends FunctionDeclaration {\r\n kind = NodeKind.METHODDECLARATION;\r\n}\r\n\r\n/** Represents a `namespace` declaration. */\r\nexport class NamespaceDeclaration extends DeclarationStatement {\r\n kind = NodeKind.NAMESPACEDECLARATION;\r\n\r\n /** Array of namespace members. */\r\n members: Statement[];\r\n}\r\n\r\n/** Represents a `return` statement. */\r\nexport class ReturnStatement extends Statement {\r\n kind = NodeKind.RETURN;\r\n\r\n /** Value expression being returned, if present. */\r\n value: Expression | null;\r\n}\r\n\r\n/** Represents a single `case` within a `switch` statement. */\r\nexport class SwitchCase extends Node {\r\n kind = NodeKind.SWITCHCASE;\r\n\r\n /** Label expression. `null` indicates the default case. */\r\n label: Expression | null;\r\n /** Contained statements. */\r\n statements: Statement[];\r\n}\r\n\r\n/** Represents a `switch` statement. */\r\nexport class SwitchStatement extends Statement {\r\n kind = NodeKind.SWITCH;\r\n\r\n /** Condition expression. */\r\n condition: Expression;\r\n /** Contained cases. */\r\n cases: SwitchCase[];\r\n}\r\n\r\n/** Represents a `throw` statement. */\r\nexport class ThrowStatement extends Statement {\r\n kind = NodeKind.THROW;\r\n\r\n /** Value expression being thrown. */\r\n value: Expression;\r\n}\r\n\r\n/** Represents a `try` statement. */\r\nexport class TryStatement extends Statement {\r\n kind = NodeKind.TRY;\r\n\r\n /** Contained statements. */\r\n statements: Statement[];\r\n /** Exception variable name, if a `catch` clause is present. */\r\n catchVariable: IdentifierExpression | null;\r\n /** Statements being executed on catch, if a `catch` clause is present. */\r\n catchStatements: Statement[] | null;\r\n /** Statements being executed afterwards, if a `finally` clause is present. */\r\n finallyStatements: Statement[] | null;\r\n}\r\n\r\n/** Represents a `type` declaration. */\r\nexport class TypeDeclaration extends DeclarationStatement {\r\n kind = NodeKind.TYPEDECLARATION;\r\n\r\n /** Type parameters, if any. */\r\n typeParameters: TypeParameterNode[] | null;\r\n /** Type being aliased. */\r\n type: CommonTypeNode;\r\n}\r\n\r\n/** Represents a variable declaration part of a {@link VariableStatement}. */\r\nexport class VariableDeclaration extends VariableLikeDeclarationStatement {\r\n kind = NodeKind.VARIABLEDECLARATION;\r\n}\r\n\r\n/** Represents a variable statement wrapping {@link VariableDeclaration}s. */\r\nexport class VariableStatement extends Statement {\r\n kind = NodeKind.VARIABLE;\r\n\r\n /** Array of decorators. */\r\n decorators: DecoratorNode[] | null;\r\n /** Array of member declarations. */\r\n declarations: VariableDeclaration[];\r\n}\r\n\r\n/** Represents a void statement dropping an expression's value. */\r\nexport class VoidStatement extends Statement {\r\n kind = NodeKind.VOID;\r\n\r\n /** Expression being dropped. */\r\n expression: Expression;\r\n}\r\n\r\n/** Represents a `while` statement. */\r\nexport class WhileStatement extends Statement {\r\n kind = NodeKind.WHILE;\r\n\r\n /** Condition expression. */\r\n condition: Expression;\r\n /** Statement being looped over. */\r\n statement: Statement;\r\n}\r\n\r\n/** Finds the first decorator matching the specified kind. */\r\nexport function findDecorator(kind: DecoratorKind, decorators: DecoratorNode[] | null): DecoratorNode | null {\r\n if (decorators) {\r\n for (let i = 0, k = decorators.length; i < k; ++i) {\r\n let decorator = decorators[i];\r\n if (decorator.decoratorKind == kind) return decorator;\r\n }\r\n }\r\n return null;\r\n}\r\n\r\n/** Mangles an external to an internal path. */\r\nexport function mangleInternalPath(path: string): string {\r\n if (path.endsWith(\".ts\")) path = path.substring(0, path.length - 3);\r\n return path;\r\n}\r\n\r\n/** Tests if the specified type node represents an omitted type. */\r\nexport function isTypeOmitted(type: CommonTypeNode): bool {\r\n if (type.kind == NodeKind.TYPE) {\r\n let name = (type).name;\r\n return !(name.next || name.identifier.text.length);\r\n }\r\n return false;\r\n}\r\n","/**\r\n * Mappings from AssemblyScript types to WebAssembly types.\r\n * @module types\r\n *//***/\r\n\r\nimport {\r\n Class,\r\n FunctionTarget,\r\n Program,\r\n DecoratorFlags\r\n} from \"./program\";\r\n\r\nimport {\r\n NativeType,\r\n ExpressionRef,\r\n Module\r\n} from \"./module\";\r\n\r\n/** Indicates the kind of a type. */\r\nexport const enum TypeKind {\r\n\r\n // signed integers\r\n\r\n /** An 8-bit signed integer. */\r\n I8,\r\n /** A 16-bit signed integer. */\r\n I16,\r\n /** A 32-bit signed integer. */\r\n I32,\r\n /** A 64-bit signed integer. */\r\n I64,\r\n /** A 32-bit/64-bit signed integer, depending on the target. */\r\n ISIZE,\r\n\r\n // unsigned integers\r\n\r\n /** An 8-bit unsigned integer. */\r\n U8,\r\n /** A 16-bit unsigned integer. */\r\n U16,\r\n /** A 32-bit unsigned integer. Also the base of function types. */\r\n U32,\r\n /** A 64-bit unsigned integer. */\r\n U64,\r\n /** A 32-bit/64-bit unsigned integer, depending on the target. Also the base of class types. */\r\n USIZE,\r\n /** A 1-bit unsigned integer. */\r\n BOOL, // sic\r\n\r\n // floats\r\n\r\n /** A 32-bit float. */\r\n F32,\r\n /** A 64-bit double. */\r\n F64,\r\n\r\n // vectors\r\n\r\n /** A 128-bit vector. */\r\n V128,\r\n\r\n // other\r\n\r\n /** No return type. */\r\n VOID\r\n}\r\n\r\n/** Indicates capabilities of a type. */\r\nexport const enum TypeFlags {\r\n NONE = 0,\r\n /** Is a signed type that can represent negative values. */\r\n SIGNED = 1 << 0,\r\n /** Is an unsigned type that cannot represent negative values. */\r\n UNSIGNED = 1 << 1,\r\n /** Is an integer type. */\r\n INTEGER = 1 << 2,\r\n /** Is a floating point type. */\r\n FLOAT = 1 << 3,\r\n /** Is a pointer type. */\r\n POINTER = 1 << 4,\r\n /** Is smaller than 32-bits. */\r\n SHORT = 1 << 5,\r\n /** Is larger than 32-bits. */\r\n LONG = 1 << 6,\r\n /** Is a value type. */\r\n VALUE = 1 << 7,\r\n /** Is a reference type. */\r\n REFERENCE = 1 << 8,\r\n /** Is a nullable type. */\r\n NULLABLE = 1 << 9,\r\n /** Is a vector type. */\r\n VECTOR = 1 << 10\r\n}\r\n\r\nconst v128_zero = new Uint8Array(16);\r\n\r\n/** Represents a resolved type. */\r\nexport class Type {\r\n\r\n /** Type kind. */\r\n kind: TypeKind;\r\n /** Type flags. */\r\n flags: TypeFlags;\r\n /** Size in bits. */\r\n size: u32;\r\n /** Size in bytes. */\r\n byteSize: i32;\r\n /** Underlying class reference, if a class type. */\r\n classReference: Class | null;\r\n /** Underlying signature reference, if a function type. */\r\n signatureReference: Signature | null;\r\n /** Respective non-nullable type, if nullable. */\r\n nonNullableType: Type;\r\n /** Cached nullable type, if non-nullable. */\r\n private cachedNullableType: Type | null = null;\r\n\r\n /** Constructs a new resolved type. */\r\n constructor(kind: TypeKind, flags: TypeFlags, size: u32) {\r\n this.kind = kind;\r\n this.flags = flags;\r\n this.size = size;\r\n this.byteSize = ceil(size / 8);\r\n this.classReference = null;\r\n this.signatureReference = null;\r\n this.nonNullableType = this;\r\n }\r\n\r\n /** Returns the closest int type representing this type. */\r\n get intType(): Type {\r\n switch (this.kind) {\r\n case TypeKind.I8: return Type.i8;\r\n case TypeKind.I16: return Type.i16;\r\n case TypeKind.F32:\r\n case TypeKind.I32: return Type.i32;\r\n case TypeKind.F64:\r\n case TypeKind.I64: return Type.i64;\r\n case TypeKind.ISIZE: return this.size == 64 ? Type.isize64 : Type.isize32;\r\n case TypeKind.U8: return Type.u8;\r\n case TypeKind.U16: return Type.u16;\r\n case TypeKind.U32: return Type.u32;\r\n case TypeKind.U64: return Type.u64;\r\n case TypeKind.USIZE: return this.size == 64 ? Type.usize64 : Type.usize32;\r\n case TypeKind.BOOL:\r\n default: return Type.i32;\r\n }\r\n }\r\n\r\n /** Tests if this is a managed type that needs GC hooks. */\r\n isManaged(program: Program): bool {\r\n if (program.hasGC) {\r\n let classReference = this.classReference;\r\n return classReference !== null && !classReference.hasDecorator(DecoratorFlags.UNMANAGED);\r\n }\r\n return false;\r\n }\r\n\r\n /** Computes the sign-extending shift in the target type. */\r\n computeSmallIntegerShift(targetType: Type): u32 {\r\n return targetType.size - this.size;\r\n }\r\n\r\n /** Computes the truncating mask in the target type. */\r\n computeSmallIntegerMask(targetType: Type): u32 {\r\n var size = this.is(TypeFlags.UNSIGNED) ? this.size : this.size - 1;\r\n return ~0 >>> (targetType.size - size);\r\n }\r\n\r\n /** Tests if this type has (all of) the specified flags. */\r\n is(flags: TypeFlags): bool { return (this.flags & flags) == flags; }\r\n /** Tests if this type has any of the specified flags. */\r\n isAny(flags: TypeFlags): bool { return (this.flags & flags) != 0; }\r\n\r\n /** Composes a class type from this type and a class. */\r\n asClass(classType: Class): Type {\r\n assert(this.kind == TypeKind.USIZE && !this.classReference);\r\n var ret = new Type(this.kind, this.flags & ~TypeFlags.VALUE | TypeFlags.REFERENCE, this.size);\r\n ret.classReference = classType;\r\n return ret;\r\n }\r\n\r\n /** Composes a function type from this type and a function. */\r\n asFunction(signature: Signature): Type {\r\n assert(this.kind == TypeKind.U32 && !this.signatureReference);\r\n var ret = new Type(this.kind, this.flags & ~TypeFlags.VALUE | TypeFlags.REFERENCE, this.size);\r\n ret.signatureReference = signature;\r\n return ret;\r\n }\r\n\r\n /** Composes the respective nullable type of this type. */\r\n asNullable(): Type {\r\n assert(this.is(TypeFlags.REFERENCE));\r\n if (!this.cachedNullableType) {\r\n assert(!this.is(TypeFlags.NULLABLE));\r\n this.cachedNullableType = new Type(this.kind, this.flags | TypeFlags.NULLABLE, this.size);\r\n this.cachedNullableType.nonNullableType = this;\r\n this.cachedNullableType.classReference = this.classReference; // either a class reference\r\n this.cachedNullableType.signatureReference = this.signatureReference; // or a function reference\r\n }\r\n return this.cachedNullableType;\r\n }\r\n\r\n /** Tests if a value of this type is assignable to the target type incl. implicit conversion. */\r\n isAssignableTo(target: Type, signednessIsRelevant: bool = false): bool {\r\n var currentClass: Class | null;\r\n var targetClass: Class | null;\r\n var currentFunction: Signature | null;\r\n var targetFunction: Signature | null;\r\n if (this.is(TypeFlags.REFERENCE)) {\r\n if (target.is(TypeFlags.REFERENCE)) {\r\n if (!this.is(TypeFlags.NULLABLE) || target.is(TypeFlags.NULLABLE)) {\r\n if (currentClass = this.classReference) {\r\n if (targetClass = target.classReference) {\r\n return currentClass.isAssignableTo(targetClass);\r\n }\r\n } else if (currentFunction = this.signatureReference) {\r\n if (targetFunction = target.signatureReference) {\r\n return currentFunction.isAssignableTo(targetFunction);\r\n }\r\n }\r\n }\r\n }\r\n } else if (!target.is(TypeFlags.REFERENCE)) {\r\n if (this.is(TypeFlags.INTEGER)) {\r\n if (target.is(TypeFlags.INTEGER)) {\r\n if (\r\n !signednessIsRelevant ||\r\n this == Type.bool || // a bool (0 or 1) can be safely assigned to all sorts of integers\r\n this.is(TypeFlags.SIGNED) == target.is(TypeFlags.SIGNED)\r\n ) {\r\n return this.size <= target.size;\r\n }\r\n } else if (target.kind == TypeKind.F32) {\r\n return this.size <= 23; // mantissa bits\r\n } else if (target.kind == TypeKind.F64) {\r\n return this.size <= 52; // ^\r\n }\r\n } else if (this.is(TypeFlags.FLOAT)) {\r\n if (target.is(TypeFlags.FLOAT)) {\r\n return this.size <= target.size;\r\n }\r\n } else if (this.is(TypeFlags.VECTOR)) {\r\n if (target.is(TypeFlags.VECTOR)) {\r\n return this.size == target.size;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n /** Tests if a value of this type is assignable to the target type excl. implicit conversion. */\r\n isStrictlyAssignableTo(target: Type, signednessIsRelevant: bool = false): bool {\r\n if (this.is(TypeFlags.REFERENCE)) return this.isAssignableTo(target);\r\n else if (target.is(TypeFlags.REFERENCE)) return false;\r\n if (this.is(TypeFlags.INTEGER)) {\r\n return target.is(TypeFlags.INTEGER) && target.size == this.size && (\r\n !signednessIsRelevant || this.is(TypeFlags.SIGNED) == target.is(TypeFlags.SIGNED)\r\n );\r\n }\r\n return this.kind == target.kind;\r\n }\r\n\r\n /** Determines the common denominator type of two types, if there is any. */\r\n static commonDenominator(left: Type, right: Type, signednessIsImportant: bool): Type | null {\r\n if (right.isAssignableTo(left, signednessIsImportant)) return left;\r\n else if (left.isAssignableTo(right, signednessIsImportant)) return right;\r\n return null;\r\n }\r\n\r\n /** Converts this type to a string. */\r\n toString(): string {\r\n if (this.is(TypeFlags.REFERENCE)) {\r\n let classReference = this.classReference;\r\n if (classReference) {\r\n return this.is(TypeFlags.NULLABLE)\r\n ? classReference.internalName + \" | null\"\r\n : classReference.internalName;\r\n }\r\n let signatureReference = this.signatureReference;\r\n if (signatureReference) {\r\n return this.is(TypeFlags.NULLABLE)\r\n ? \"(\" + signatureReference.toString() + \") | null\"\r\n : signatureReference.toString();\r\n }\r\n assert(false);\r\n }\r\n switch (this.kind) {\r\n case TypeKind.I8: return \"i8\";\r\n case TypeKind.I16: return \"i16\";\r\n case TypeKind.I32: return \"i32\";\r\n case TypeKind.I64: return \"i64\";\r\n case TypeKind.ISIZE: return \"isize\";\r\n case TypeKind.U8: return \"u8\";\r\n case TypeKind.U16: return \"u16\";\r\n case TypeKind.U32: return \"u32\";\r\n case TypeKind.U64: return \"u64\";\r\n case TypeKind.USIZE: return \"usize\";\r\n case TypeKind.BOOL: return \"bool\";\r\n case TypeKind.F32: return \"f32\";\r\n case TypeKind.F64: return \"f64\";\r\n case TypeKind.V128: return \"v128\";\r\n default: assert(false);\r\n case TypeKind.VOID: return \"void\";\r\n }\r\n }\r\n\r\n // Binaryen specific\r\n\r\n /** Converts this type to its respective native type. */\r\n toNativeType(): NativeType {\r\n switch (this.kind) {\r\n default: return NativeType.I32;\r\n case TypeKind.I64:\r\n case TypeKind.U64: return NativeType.I64;\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: return this.size == 64 ? NativeType.I64 : NativeType.I32;\r\n case TypeKind.F32: return NativeType.F32;\r\n case TypeKind.F64: return NativeType.F64;\r\n case TypeKind.V128: return NativeType.V128;\r\n case TypeKind.VOID: return NativeType.None;\r\n }\r\n }\r\n\r\n /** Converts this type to its native `0` value. */\r\n toNativeZero(module: Module): ExpressionRef {\r\n switch (this.kind) {\r\n case TypeKind.VOID: assert(false);\r\n default: return module.createI32(0);\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: if (this.size != 64) return module.createI32(0);\r\n case TypeKind.I64:\r\n case TypeKind.U64: return module.createI64(0);\r\n case TypeKind.F32: return module.createF32(0);\r\n case TypeKind.F64: return module.createF64(0);\r\n case TypeKind.V128: return module.createV128(v128_zero);\r\n }\r\n }\r\n\r\n /** Converts this type to its native `1` value. */\r\n toNativeOne(module: Module): ExpressionRef {\r\n switch (this.kind) {\r\n case TypeKind.V128:\r\n case TypeKind.VOID: assert(false);\r\n default: return module.createI32(1);\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: if (this.size != 64) return module.createI32(1);\r\n case TypeKind.I64:\r\n case TypeKind.U64: return module.createI64(1);\r\n case TypeKind.F32: return module.createF32(1);\r\n case TypeKind.F64: return module.createF64(1);\r\n }\r\n }\r\n\r\n /** Converts this type to its native `-1` value. */\r\n toNativeNegOne(module: Module): ExpressionRef {\r\n switch (this.kind) {\r\n case TypeKind.V128:\r\n case TypeKind.VOID: assert(false);\r\n default: return module.createI32(-1);\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: if (this.size != 64) return module.createI32(-1);\r\n case TypeKind.I64:\r\n case TypeKind.U64: return module.createI64(-1, -1);\r\n case TypeKind.F32: return module.createF32(-1);\r\n case TypeKind.F64: return module.createF64(-1);\r\n }\r\n }\r\n\r\n /** Converts this type to its signature string. */\r\n toSignatureString(): string {\r\n switch (this.kind) {\r\n // same naming scheme as Binaryen\r\n case TypeKind.I8:\r\n case TypeKind.U8:\r\n case TypeKind.I16:\r\n case TypeKind.U16:\r\n case TypeKind.I32:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: return \"i\";\r\n case TypeKind.I64:\r\n case TypeKind.U64: return \"j\";\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: return this.size == 64 ? \"j\" : \"i\";\r\n case TypeKind.F32: return \"f\";\r\n case TypeKind.F64: return \"d\";\r\n case TypeKind.V128: return \"V\";\r\n case TypeKind.VOID: return \"v\";\r\n default: assert(false);\r\n }\r\n return \"i\";\r\n }\r\n\r\n // Types\r\n\r\n /** An 8-bit signed integer. */\r\n static readonly i8: Type = new Type(TypeKind.I8,\r\n TypeFlags.SIGNED |\r\n TypeFlags.SHORT |\r\n TypeFlags.INTEGER |\r\n TypeFlags.VALUE, 8\r\n );\r\n\r\n /** A 16-bit signed integer. */\r\n static readonly i16: Type = new Type(TypeKind.I16,\r\n TypeFlags.SIGNED |\r\n TypeFlags.SHORT |\r\n TypeFlags.INTEGER |\r\n TypeFlags.VALUE, 16\r\n );\r\n\r\n /** A 32-bit signed integer. */\r\n static readonly i32: Type = new Type(TypeKind.I32,\r\n TypeFlags.SIGNED |\r\n TypeFlags.INTEGER |\r\n TypeFlags.VALUE, 32\r\n );\r\n\r\n /** A 64-bit signed integer. */\r\n static readonly i64: Type = new Type(TypeKind.I64,\r\n TypeFlags.SIGNED |\r\n TypeFlags.LONG |\r\n TypeFlags.INTEGER |\r\n TypeFlags.VALUE, 64\r\n );\r\n\r\n /** A 32-bit signed size. WASM32 only. */\r\n static readonly isize32: Type = new Type(TypeKind.ISIZE,\r\n TypeFlags.SIGNED |\r\n TypeFlags.INTEGER |\r\n TypeFlags.POINTER |\r\n TypeFlags.VALUE, 32\r\n );\r\n\r\n /** A 64-bit signed size. WASM64 only. */\r\n static readonly isize64: Type = new Type(TypeKind.ISIZE,\r\n TypeFlags.SIGNED |\r\n TypeFlags.LONG |\r\n TypeFlags.INTEGER |\r\n TypeFlags.POINTER |\r\n TypeFlags.VALUE, 64\r\n );\r\n\r\n /** An 8-bit unsigned integer. */\r\n static readonly u8: Type = new Type(TypeKind.U8,\r\n TypeFlags.UNSIGNED |\r\n TypeFlags.SHORT |\r\n TypeFlags.INTEGER |\r\n TypeFlags.VALUE, 8\r\n );\r\n\r\n /** A 16-bit unsigned integer. */\r\n static readonly u16: Type = new Type(TypeKind.U16,\r\n TypeFlags.UNSIGNED |\r\n TypeFlags.SHORT |\r\n TypeFlags.INTEGER |\r\n TypeFlags.VALUE, 16\r\n );\r\n\r\n /** A 32-bit unsigned integer. */\r\n static readonly u32: Type = new Type(TypeKind.U32,\r\n TypeFlags.UNSIGNED |\r\n TypeFlags.INTEGER |\r\n TypeFlags.VALUE, 32\r\n );\r\n\r\n /** A 64-bit unsigned integer. */\r\n static readonly u64: Type = new Type(TypeKind.U64,\r\n TypeFlags.UNSIGNED |\r\n TypeFlags.LONG |\r\n TypeFlags.INTEGER |\r\n TypeFlags.VALUE, 64\r\n );\r\n\r\n /** A 32-bit unsigned size. WASM32 only. */\r\n static readonly usize32: Type = new Type(TypeKind.USIZE,\r\n TypeFlags.UNSIGNED |\r\n TypeFlags.INTEGER |\r\n TypeFlags.POINTER |\r\n TypeFlags.VALUE, 32\r\n );\r\n\r\n /** A 64-bit unsigned size. WASM64 only. */\r\n static readonly usize64: Type = new Type(TypeKind.USIZE,\r\n TypeFlags.UNSIGNED |\r\n TypeFlags.LONG |\r\n TypeFlags.INTEGER |\r\n TypeFlags.POINTER |\r\n TypeFlags.VALUE, 64\r\n );\r\n\r\n /** A 1-bit unsigned integer. */\r\n static readonly bool: Type = new Type(TypeKind.BOOL,\r\n TypeFlags.UNSIGNED |\r\n TypeFlags.SHORT |\r\n TypeFlags.INTEGER |\r\n TypeFlags.VALUE, 1\r\n );\r\n\r\n /** A 32-bit float. */\r\n static readonly f32: Type = new Type(TypeKind.F32,\r\n TypeFlags.SIGNED |\r\n TypeFlags.FLOAT |\r\n TypeFlags.VALUE, 32\r\n );\r\n\r\n /** A 64-bit float. */\r\n static readonly f64: Type = new Type(TypeKind.F64,\r\n TypeFlags.SIGNED |\r\n TypeFlags.LONG |\r\n TypeFlags.FLOAT |\r\n TypeFlags.VALUE, 64\r\n );\r\n\r\n /** A 128-bit vector. */\r\n static readonly v128: Type = new Type(TypeKind.V128,\r\n TypeFlags.VECTOR |\r\n TypeFlags.VALUE, 128\r\n );\r\n\r\n /** No return type. */\r\n static readonly void: Type = new Type(TypeKind.VOID, TypeFlags.NONE, 0);\r\n}\r\n\r\n/** Converts an array of types to an array of native types. */\r\nexport function typesToNativeTypes(types: Type[]): NativeType[] {\r\n var numTypes = types.length;\r\n var ret = new Array(numTypes);\r\n for (let i = 0; i < numTypes; ++i) ret[i] = types[i].toNativeType();\r\n return ret;\r\n}\r\n\r\n/** Converts an array of types to its combined string representation. */\r\nexport function typesToString(types: Type[]): string {\r\n var numTypes = types.length;\r\n if (!numTypes) return \"\";\r\n var sb = new Array(numTypes);\r\n for (let i = 0; i < numTypes; ++i) sb[i] = types[i].toString();\r\n return sb.join(\",\");\r\n}\r\n\r\n/** Represents a fully resolved function signature. */\r\nexport class Signature {\r\n\r\n /** Parameter types, if any, excluding `this`. */\r\n parameterTypes: Type[];\r\n /** Parameter names, if known, excluding `this`. */\r\n parameterNames: string[] | null;\r\n /** Number of required parameters excluding `this`. Other parameters are considered optional. */\r\n requiredParameters: i32;\r\n /** Return type. */\r\n returnType: Type;\r\n /** This type, if an instance signature. */\r\n thisType: Type | null;\r\n /** Whether the last parameter is a rest parameter. */\r\n hasRest: bool;\r\n /** Cached {@link FunctionTarget}. */\r\n cachedFunctionTarget: FunctionTarget | null = null;\r\n /** Respective function type. */\r\n type: Type;\r\n\r\n /** Constructs a new signature. */\r\n constructor(\r\n parameterTypes: Type[] | null = null,\r\n returnType: Type | null = null,\r\n thisType: Type | null = null\r\n ) {\r\n this.parameterTypes = parameterTypes ? parameterTypes : [];\r\n this.parameterNames = null;\r\n this.requiredParameters = 0;\r\n this.returnType = returnType ? returnType : Type.void;\r\n this.thisType = thisType;\r\n this.hasRest = false;\r\n this.type = Type.u32.asFunction(this);\r\n }\r\n\r\n asFunctionTarget(program: Program): FunctionTarget {\r\n var target = this.cachedFunctionTarget;\r\n if (!target) this.cachedFunctionTarget = target = new FunctionTarget(this, program);\r\n else assert(target.program == program);\r\n return target;\r\n }\r\n\r\n /** Gets the known or, alternatively, generic parameter name at the specified index. */\r\n getParameterName(index: i32): string {\r\n var parameterNames = this.parameterNames;\r\n return parameterNames && parameterNames.length > index\r\n ? parameterNames[index]\r\n : getDefaultParameterName(index);\r\n }\r\n\r\n /** Tests if a value of this function type is assignable to a target of the specified function type. */\r\n isAssignableTo(target: Signature): bool {\r\n // TODO: maybe cache results?\r\n\r\n // check `this` type\r\n var thisThisType = this.thisType;\r\n var targetThisType = target.thisType;\r\n if (thisThisType) {\r\n if (!(targetThisType && thisThisType.isAssignableTo(targetThisType))) return false;\r\n } else if (targetThisType) {\r\n return false;\r\n }\r\n\r\n // check rest parameter\r\n if (this.hasRest != target.hasRest) return false; // TODO\r\n\r\n // check parameter types\r\n var thisParameterTypes = this.parameterTypes;\r\n var targetParameterTypes = target.parameterTypes;\r\n var numParameters = thisParameterTypes.length;\r\n if (numParameters != targetParameterTypes.length) return false;\r\n for (let i = 0; i < numParameters; ++i) {\r\n let thisParameterType = thisParameterTypes[i];\r\n let targetParameterType = targetParameterTypes[i];\r\n if (!thisParameterType.isAssignableTo(targetParameterType)) return false;\r\n }\r\n\r\n // check return type\r\n var thisReturnType = this.returnType;\r\n var targetReturnType = target.returnType;\r\n return thisReturnType == targetReturnType || thisReturnType.isAssignableTo(targetReturnType);\r\n }\r\n\r\n /** Converts a signature to a function type string. */\r\n static makeSignatureString(parameterTypes: Type[] | null, returnType: Type, thisType: Type | null = null): string {\r\n var sb = [];\r\n sb.push(returnType.toSignatureString());\r\n if (thisType) sb.push(thisType.toSignatureString());\r\n if (parameterTypes) {\r\n for (let i = 0, k = parameterTypes.length; i < k; ++i) sb.push(parameterTypes[i].toSignatureString());\r\n }\r\n return \"FUNCSIG$\" + sb.join(\"\");\r\n }\r\n\r\n /** Converts this signature to a function type string. */\r\n toSignatureString(): string {\r\n return Signature.makeSignatureString(this.parameterTypes, this.returnType, this.thisType);\r\n }\r\n\r\n /** Converts this signature to a string. */\r\n toString(): string {\r\n var sb = new Array();\r\n sb.push(\"(\");\r\n var index = 0;\r\n var thisType = this.thisType;\r\n if (thisType) {\r\n sb.push(\"this: \");\r\n assert(!thisType.signatureReference);\r\n sb.push(thisType.toString());\r\n index = 1;\r\n }\r\n var parameters = this.parameterTypes;\r\n var numParameters = parameters.length;\r\n if (numParameters) {\r\n let names = this.parameterNames;\r\n let numNames = names ? names.length : 0;\r\n let optionalStart = this.requiredParameters;\r\n let restIndex = this.hasRest ? numParameters - 1 : -1;\r\n for (let i = 0; i < numParameters; ++i, ++index) {\r\n if (index) sb.push(\", \");\r\n if (i == restIndex) sb.push(\"...\");\r\n if (i < numNames) sb.push((names)[i]);\r\n else sb.push(getDefaultParameterName(i));\r\n if (i >= optionalStart && i != restIndex) sb.push(\"?: \");\r\n else sb.push(\": \");\r\n sb.push(parameters[i].toString());\r\n }\r\n }\r\n sb.push(\") => \");\r\n sb.push(this.returnType.toString());\r\n return sb.join(\"\");\r\n }\r\n}\r\n\r\n// helpers\r\n\r\n// Cached default parameter names used where names are unknown.\r\nvar cachedDefaultParameterNames: string[] | null = null;\r\n\r\n/** Gets the cached default parameter name for the specified index. */\r\nexport function getDefaultParameterName(index: i32): string {\r\n if (!cachedDefaultParameterNames) cachedDefaultParameterNames = [];\r\n for (let i = cachedDefaultParameterNames.length; i <= index; ++i) {\r\n cachedDefaultParameterNames.push(\"arg$\" + i.toString(10));\r\n }\r\n return cachedDefaultParameterNames[index - 1];\r\n}\r\n","/**\r\n * A TypeScript tokenizer modified for AssemblyScript.\r\n *\r\n * Skips over trivia and provides a general mark/reset mechanism for the parser to utilize on\r\n * ambiguous tokens.\r\n *\r\n * @module tokenizer\r\n *//***/\r\n\r\nimport {\r\n DiagnosticCode,\r\n DiagnosticMessage,\r\n DiagnosticEmitter\r\n} from \"./diagnostics\";\r\n\r\nimport {\r\n Source,\r\n CommentKind\r\n} from \"./ast\";\r\n\r\nimport {\r\n CharCode,\r\n isLineBreak,\r\n isWhiteSpace,\r\n isIdentifierStart,\r\n isIdentifierPart,\r\n isDecimalDigit,\r\n isOctalDigit,\r\n isKeywordCharacter\r\n} from \"./util\";\r\n\r\n/** Named token types. */\r\nexport enum Token {\r\n\r\n // keywords\r\n // discarded: ANY, BOOLEAN, NEVER, NUMBER, STRING, SYMBOL, UNDEFINED, LESSTHAN_SLASH\r\n\r\n ABSTRACT,\r\n AS,\r\n ASYNC,\r\n AWAIT, // ES2017\r\n BREAK, // ES2017\r\n CASE, // ES2017\r\n CATCH, // ES2017\r\n CLASS, // ES2017\r\n CONST, // ES2017\r\n CONTINUE, // ES2017\r\n CONSTRUCTOR,\r\n DEBUGGER, // ES2017\r\n DECLARE,\r\n DEFAULT, // ES2017\r\n DELETE, // ES2017\r\n DO, // ES2017\r\n ELSE, // ES2017\r\n ENUM, // ES2017 future\r\n EXPORT, // ES2017\r\n EXTENDS, // ES2017\r\n FALSE, // ES\r\n FINALLY, // ES2017\r\n FOR, // ES2017\r\n FROM, // AS possible identifier\r\n FUNCTION, // ES2017\r\n GET,\r\n IF, // ES2017\r\n IMPLEMENTS, // ES2017 non-lexical\r\n IMPORT, // ES2017\r\n IN, // ES2017\r\n INSTANCEOF, // ES2017\r\n INTERFACE, // ES2017 non-lexical\r\n IS,\r\n KEYOF,\r\n LET, // ES2017 non-lexical\r\n MODULE, // AS possible identifier\r\n NAMESPACE, // AS possible identifier\r\n NEW, // ES2017\r\n NULL, // ES\r\n OF,\r\n PACKAGE, // ES2017 non-lexical\r\n PRIVATE, // ES2017 non-lexical\r\n PROTECTED, // ES2017 non-lexical\r\n PUBLIC, // ES2017 non-lexical\r\n READONLY,\r\n RETURN, // ES2017\r\n SET,\r\n STATIC, // ES2017 non-lexical\r\n SUPER, // ES2017\r\n SWITCH, // ES2017\r\n THIS, // ES2017\r\n THROW, // ES2017\r\n TRUE, // ES\r\n TRY, // ES2017\r\n TYPE, // AS possible identifier\r\n TYPEOF, // ES2017\r\n VAR, // ES2017\r\n VOID, // ES2017\r\n WHILE, // ES2017\r\n WITH, // ES2017\r\n YIELD, // ES2017\r\n\r\n // punctuation\r\n\r\n OPENBRACE,\r\n CLOSEBRACE,\r\n OPENPAREN,\r\n CLOSEPAREN,\r\n OPENBRACKET,\r\n CLOSEBRACKET,\r\n DOT,\r\n DOT_DOT_DOT,\r\n SEMICOLON,\r\n COMMA,\r\n LESSTHAN,\r\n GREATERTHAN,\r\n LESSTHAN_EQUALS,\r\n GREATERTHAN_EQUALS,\r\n EQUALS_EQUALS,\r\n EXCLAMATION_EQUALS,\r\n EQUALS_EQUALS_EQUALS,\r\n EXCLAMATION_EQUALS_EQUALS,\r\n EQUALS_GREATERTHAN,\r\n PLUS,\r\n MINUS,\r\n ASTERISK_ASTERISK,\r\n ASTERISK,\r\n SLASH,\r\n PERCENT,\r\n PLUS_PLUS,\r\n MINUS_MINUS,\r\n LESSTHAN_LESSTHAN,\r\n GREATERTHAN_GREATERTHAN,\r\n GREATERTHAN_GREATERTHAN_GREATERTHAN,\r\n AMPERSAND,\r\n BAR,\r\n CARET,\r\n EXCLAMATION,\r\n TILDE,\r\n AMPERSAND_AMPERSAND,\r\n BAR_BAR,\r\n QUESTION,\r\n COLON,\r\n EQUALS,\r\n PLUS_EQUALS,\r\n MINUS_EQUALS,\r\n ASTERISK_EQUALS,\r\n ASTERISK_ASTERISK_EQUALS,\r\n SLASH_EQUALS,\r\n PERCENT_EQUALS,\r\n LESSTHAN_LESSTHAN_EQUALS,\r\n GREATERTHAN_GREATERTHAN_EQUALS,\r\n GREATERTHAN_GREATERTHAN_GREATERTHAN_EQUALS,\r\n AMPERSAND_EQUALS,\r\n BAR_EQUALS,\r\n CARET_EQUALS,\r\n AT,\r\n\r\n // literals\r\n\r\n IDENTIFIER,\r\n STRINGLITERAL,\r\n INTEGERLITERAL,\r\n FLOATLITERAL,\r\n\r\n // meta\r\n\r\n INVALID,\r\n ENDOFFILE\r\n}\r\n\r\nexport enum IdentifierHandling {\r\n DEFAULT,\r\n PREFER,\r\n ALWAYS\r\n}\r\n\r\nexport function tokenFromKeyword(text: string): Token {\r\n assert(text.length);\r\n switch (text.charCodeAt(0)) {\r\n case CharCode.a: {\r\n switch (text) {\r\n case \"abstract\": return Token.ABSTRACT;\r\n case \"as\": return Token.AS;\r\n case \"async\": return Token.ASYNC;\r\n case \"await\": return Token.AWAIT;\r\n }\r\n break;\r\n }\r\n case CharCode.b: {\r\n switch (text) {\r\n case \"break\": return Token.BREAK;\r\n }\r\n break;\r\n }\r\n case CharCode.c: {\r\n switch (text) {\r\n case \"case\": return Token.CASE;\r\n case \"catch\": return Token.CATCH;\r\n case \"class\": return Token.CLASS;\r\n case \"continue\": return Token.CONTINUE;\r\n case \"const\": return Token.CONST;\r\n case \"constructor\": return Token.CONSTRUCTOR;\r\n }\r\n break;\r\n }\r\n case CharCode.d: {\r\n switch (text) {\r\n case \"debugger\": return Token.DEBUGGER;\r\n case \"declare\": return Token.DECLARE;\r\n case \"default\": return Token.DEFAULT;\r\n case \"delete\": return Token.DELETE;\r\n case \"do\": return Token.DO;\r\n }\r\n break;\r\n }\r\n case CharCode.e: {\r\n switch (text) {\r\n case \"else\": return Token.ELSE;\r\n case \"enum\": return Token.ENUM;\r\n case \"export\": return Token.EXPORT;\r\n case \"extends\": return Token.EXTENDS;\r\n }\r\n break;\r\n }\r\n case CharCode.f: {\r\n switch (text) {\r\n case \"false\": return Token.FALSE;\r\n case \"finally\": return Token.FINALLY;\r\n case \"for\": return Token.FOR;\r\n case \"from\": return Token.FROM;\r\n case \"function\": return Token.FUNCTION;\r\n }\r\n break;\r\n }\r\n case CharCode.g: {\r\n switch (text) {\r\n case \"get\": return Token.GET;\r\n }\r\n break;\r\n }\r\n case CharCode.i: {\r\n switch (text) {\r\n case \"if\": return Token.IF;\r\n case \"implements\": return Token.IMPLEMENTS;\r\n case \"import\": return Token.IMPORT;\r\n case \"in\": return Token.IN;\r\n case \"instanceof\": return Token.INSTANCEOF;\r\n case \"interface\": return Token.INTERFACE;\r\n case \"is\": return Token.IS;\r\n }\r\n break;\r\n }\r\n case CharCode.k: {\r\n switch (text) {\r\n case \"keyof\": return Token.KEYOF;\r\n }\r\n break;\r\n }\r\n case CharCode.l: {\r\n switch (text) {\r\n case \"let\": return Token.LET;\r\n }\r\n break;\r\n }\r\n case CharCode.m: {\r\n switch (text) {\r\n case \"module\": return Token.MODULE;\r\n }\r\n break;\r\n }\r\n case CharCode.n: {\r\n switch (text) {\r\n case \"namespace\": return Token.NAMESPACE;\r\n case \"new\": return Token.NEW;\r\n case \"null\": return Token.NULL;\r\n }\r\n break;\r\n }\r\n case CharCode.o: {\r\n switch (text) {\r\n case \"of\": return Token.OF;\r\n }\r\n break;\r\n }\r\n case CharCode.p: {\r\n switch (text) {\r\n case \"package\": return Token.PACKAGE;\r\n case \"private\": return Token.PRIVATE;\r\n case \"protected\": return Token.PROTECTED;\r\n case \"public\": return Token.PUBLIC;\r\n }\r\n break;\r\n }\r\n case CharCode.r: {\r\n switch (text) {\r\n case \"readonly\": return Token.READONLY;\r\n case \"return\": return Token.RETURN;\r\n }\r\n break;\r\n }\r\n case CharCode.s: {\r\n switch (text) {\r\n case \"set\": return Token.SET;\r\n case \"static\": return Token.STATIC;\r\n case \"super\": return Token.SUPER;\r\n case \"switch\": return Token.SWITCH;\r\n }\r\n break;\r\n }\r\n case CharCode.t: {\r\n switch (text) {\r\n case \"this\": return Token.THIS;\r\n case \"throw\": return Token.THROW;\r\n case \"true\": return Token.TRUE;\r\n case \"try\": return Token.TRY;\r\n case \"type\": return Token.TYPE;\r\n case \"typeof\": return Token.TYPEOF;\r\n }\r\n break;\r\n }\r\n case CharCode.v: {\r\n switch (text) {\r\n case \"var\": return Token.VAR;\r\n case \"void\": return Token.VOID;\r\n }\r\n break;\r\n }\r\n case CharCode.w: {\r\n switch (text) {\r\n case \"while\": return Token.WHILE;\r\n case \"with\": return Token.WITH;\r\n }\r\n break;\r\n }\r\n case CharCode.y: {\r\n switch (text) {\r\n case \"yield\": return Token.YIELD;\r\n }\r\n break;\r\n }\r\n }\r\n return Token.INVALID;\r\n}\r\n\r\nexport function tokenIsAlsoIdentifier(token: Token): bool {\r\n switch (token) {\r\n case Token.ABSTRACT:\r\n case Token.AS:\r\n case Token.CONSTRUCTOR:\r\n case Token.DECLARE:\r\n case Token.DELETE:\r\n case Token.FROM:\r\n case Token.FOR:\r\n case Token.GET:\r\n case Token.IS:\r\n case Token.KEYOF:\r\n case Token.MODULE:\r\n case Token.NAMESPACE:\r\n case Token.READONLY:\r\n case Token.SET:\r\n case Token.TYPE:\r\n case Token.VOID: return true;\r\n default: return false;\r\n }\r\n}\r\n\r\nexport function operatorTokenToString(token: Token): string {\r\n switch (token) {\r\n case Token.DELETE: return \"delete\";\r\n case Token.IN: return \"in\";\r\n case Token.INSTANCEOF: return \"instanceof\";\r\n case Token.NEW: return \"new\";\r\n case Token.TYPEOF: return \"typeof\";\r\n case Token.VOID: return \"void\";\r\n case Token.YIELD: return \"yield\";\r\n case Token.DOT_DOT_DOT: return \"...\";\r\n case Token.COMMA: return \",\";\r\n case Token.LESSTHAN: return \"<\";\r\n case Token.GREATERTHAN: return \">\";\r\n case Token.LESSTHAN_EQUALS: return \"<=\";\r\n case Token.GREATERTHAN_EQUALS: return \">=\";\r\n case Token.EQUALS_EQUALS: return \"==\";\r\n case Token.EXCLAMATION_EQUALS: return \"!=\";\r\n case Token.EQUALS_EQUALS_EQUALS: return \"===\";\r\n case Token.EXCLAMATION_EQUALS_EQUALS: return \"!==\";\r\n case Token.PLUS: return \"+\";\r\n case Token.MINUS: return \"-\";\r\n case Token.ASTERISK_ASTERISK: return \"**\";\r\n case Token.ASTERISK: return \"*\";\r\n case Token.SLASH: return \"/\";\r\n case Token.PERCENT: return \"%\";\r\n case Token.PLUS_PLUS: return \"++\";\r\n case Token.MINUS_MINUS: return \"--\";\r\n case Token.LESSTHAN_LESSTHAN: return \"<<\";\r\n case Token.GREATERTHAN_GREATERTHAN: return \">>\";\r\n case Token.GREATERTHAN_GREATERTHAN_GREATERTHAN: return \">>>\";\r\n case Token.AMPERSAND: return \"&\";\r\n case Token.BAR: return \"|\";\r\n case Token.CARET: return \"^\";\r\n case Token.EXCLAMATION: return \"!\";\r\n case Token.TILDE: return \"~\";\r\n case Token.AMPERSAND_AMPERSAND: return \"&&\";\r\n case Token.BAR_BAR: return \"||\";\r\n case Token.EQUALS: return \"=\";\r\n case Token.PLUS_EQUALS: return \"+=\";\r\n case Token.MINUS_EQUALS: return \"-=\";\r\n case Token.ASTERISK_EQUALS: return \"*=\";\r\n case Token.ASTERISK_ASTERISK_EQUALS: return \"**=\";\r\n case Token.SLASH_EQUALS: return \"/=\";\r\n case Token.PERCENT_EQUALS: return \"%=\";\r\n case Token.LESSTHAN_LESSTHAN_EQUALS: return \"<<=\";\r\n case Token.GREATERTHAN_GREATERTHAN_EQUALS: return \">>=\";\r\n case Token.GREATERTHAN_GREATERTHAN_GREATERTHAN_EQUALS: return \">>>=\";\r\n case Token.AMPERSAND_EQUALS: return \"&=\";\r\n case Token.BAR_EQUALS: return \"|=\";\r\n case Token.CARET_EQUALS: return \"^=\";\r\n default: {\r\n assert(false);\r\n return \"\";\r\n }\r\n }\r\n}\r\n\r\nexport class Range {\r\n\r\n source: Source;\r\n start: i32;\r\n end: i32;\r\n\r\n // TODO: set these while tokenizing\r\n // line: i32;\r\n // column: i32;\r\n\r\n constructor(source: Source, start: i32, end: i32) {\r\n this.source = source;\r\n this.start = start;\r\n this.end = end;\r\n }\r\n\r\n static join(a: Range, b: Range): Range {\r\n if (a.source != b.source) throw new Error(\"source mismatch\");\r\n return new Range(a.source,\r\n a.start < b.start ? a.start : b.start,\r\n a.end > b.end ? a.end : b.end\r\n );\r\n }\r\n\r\n get atStart(): Range {\r\n return new Range(this.source, this.start, this.start);\r\n }\r\n get atEnd(): Range {\r\n return new Range(this.source, this.end, this.end);\r\n }\r\n\r\n get line(): i32 {\r\n var text = this.source.text;\r\n var line = 1;\r\n for (let pos = this.start; pos >= 0; --pos) {\r\n if (text.charCodeAt(pos) == CharCode.LINEFEED) line++;\r\n }\r\n return line;\r\n }\r\n\r\n get column(): i32 {\r\n var text = this.source.text;\r\n var column = 0;\r\n for (let pos = this.start - 1; pos >= 0; --pos) {\r\n if (text.charCodeAt(pos) == CharCode.LINEFEED) break;\r\n ++column;\r\n }\r\n return column;\r\n }\r\n\r\n toString(): string {\r\n return this.source.text.substring(this.start, this.end);\r\n }\r\n\r\n debugInfoRef: usize = 0;\r\n}\r\n\r\ndeclare function parseFloat(str: string): f64;\r\n\r\n/** Handler for intercepting comments while tokenizing. */\r\nexport type CommentHandler = (kind: CommentKind, text: string, range: Range) => void;\r\n\r\n/** Tokenizes a source to individual {@link Token}s. */\r\nexport class Tokenizer extends DiagnosticEmitter {\r\n\r\n source: Source;\r\n end: i32 = 0;\r\n\r\n pos: i32 = 0;\r\n token: Token = -1;\r\n tokenPos: i32 = 0;\r\n\r\n nextToken: Token = -1;\r\n nextTokenPos: i32 = 0;\r\n nextTokenOnNewLine: bool = false;\r\n\r\n onComment: CommentHandler | null = null;\r\n\r\n /** Constructs a new tokenizer. */\r\n constructor(source: Source, diagnostics: DiagnosticMessage[] | null = null) {\r\n super(diagnostics);\r\n\r\n this.source = source;\r\n this.pos = 0;\r\n this.end = source.text.length;\r\n this.diagnostics = diagnostics ? diagnostics : new Array();\r\n\r\n var text = source.text;\r\n\r\n // skip bom\r\n if (\r\n this.pos < this.end &&\r\n text.charCodeAt(this.pos) == CharCode.BYTEORDERMARK\r\n ) {\r\n ++this.pos;\r\n }\r\n\r\n // skip shebang\r\n if (\r\n this.pos + 1 < this.end &&\r\n text.charCodeAt(this.pos) == CharCode.HASH &&\r\n text.charCodeAt(this.pos + 1) == CharCode.EXCLAMATION\r\n ) {\r\n this.pos += 2;\r\n while (\r\n this.pos < this.end &&\r\n text.charCodeAt(this.pos) != CharCode.LINEFEED\r\n ) {\r\n ++this.pos;\r\n }\r\n // 'next' now starts at lf or eof\r\n }\r\n }\r\n\r\n next(identifierHandling: IdentifierHandling = IdentifierHandling.DEFAULT): Token {\r\n this.nextToken = -1;\r\n return this.token = this.unsafeNext(identifierHandling);\r\n }\r\n\r\n private unsafeNext(\r\n identifierHandling: IdentifierHandling = IdentifierHandling.DEFAULT,\r\n maxTokenLength: i32 = i32.MAX_VALUE\r\n ): Token {\r\n var text = this.source.text;\r\n while (this.pos < this.end) {\r\n this.tokenPos = this.pos;\r\n let c = text.charCodeAt(this.pos);\r\n switch (c) {\r\n case CharCode.CARRIAGERETURN: {\r\n if (!(\r\n ++this.pos < this.end &&\r\n text.charCodeAt(this.pos) == CharCode.LINEFEED\r\n )) break;\r\n // otherwise fall-through\r\n }\r\n case CharCode.LINEFEED:\r\n case CharCode.TAB:\r\n case CharCode.VERTICALTAB:\r\n case CharCode.FORMFEED:\r\n case CharCode.SPACE: {\r\n ++this.pos;\r\n break;\r\n }\r\n case CharCode.EXCLAMATION: {\r\n ++this.pos;\r\n if (\r\n maxTokenLength > 1 && this.pos < this.end &&\r\n text.charCodeAt(this.pos) == CharCode.EQUALS\r\n ) {\r\n ++this.pos;\r\n if (\r\n maxTokenLength > 2 && this.pos < this.end &&\r\n text.charCodeAt(this.pos) == CharCode.EQUALS\r\n ) {\r\n ++this.pos;\r\n return Token.EXCLAMATION_EQUALS_EQUALS;\r\n }\r\n return Token.EXCLAMATION_EQUALS;\r\n }\r\n return Token.EXCLAMATION;\r\n }\r\n case CharCode.DOUBLEQUOTE:\r\n case CharCode.SINGLEQUOTE:\r\n case CharCode.BACKTICK: { // TODO\r\n return Token.STRINGLITERAL; // expects a call to readString\r\n }\r\n case CharCode.PERCENT: {\r\n ++this.pos;\r\n if (\r\n maxTokenLength > 1 && this.pos < this.end &&\r\n text.charCodeAt(this.pos) == CharCode.EQUALS\r\n ) {\r\n ++this.pos;\r\n return Token.PERCENT_EQUALS;\r\n }\r\n return Token.PERCENT;\r\n }\r\n case CharCode.AMPERSAND: {\r\n ++this.pos;\r\n if (maxTokenLength > 1 && this.pos < this.end) {\r\n let chr = text.charCodeAt(this.pos);\r\n if (chr == CharCode.AMPERSAND) {\r\n ++this.pos;\r\n return Token.AMPERSAND_AMPERSAND;\r\n }\r\n if (chr == CharCode.EQUALS) {\r\n ++this.pos;\r\n return Token.AMPERSAND_EQUALS;\r\n }\r\n }\r\n return Token.AMPERSAND;\r\n }\r\n case CharCode.OPENPAREN: {\r\n ++this.pos;\r\n return Token.OPENPAREN;\r\n }\r\n case CharCode.CLOSEPAREN: {\r\n ++this.pos;\r\n return Token.CLOSEPAREN;\r\n }\r\n case CharCode.ASTERISK: {\r\n ++this.pos;\r\n if (maxTokenLength > 1 && this.pos < this.end) {\r\n let chr = text.charCodeAt(this.pos);\r\n if (chr == CharCode.EQUALS) {\r\n ++this.pos;\r\n return Token.ASTERISK_EQUALS;\r\n }\r\n if (chr == CharCode.ASTERISK) {\r\n ++this.pos;\r\n if (\r\n maxTokenLength > 2 && this.pos < this.end &&\r\n text.charCodeAt(this.pos) == CharCode.EQUALS\r\n ) {\r\n ++this.pos;\r\n return Token.ASTERISK_ASTERISK_EQUALS;\r\n }\r\n return Token.ASTERISK_ASTERISK;\r\n }\r\n }\r\n return Token.ASTERISK;\r\n }\r\n case CharCode.PLUS: {\r\n ++this.pos;\r\n if (maxTokenLength > 1 && this.pos < this.end) {\r\n let chr = text.charCodeAt(this.pos);\r\n if (chr == CharCode.PLUS) {\r\n ++this.pos;\r\n return Token.PLUS_PLUS;\r\n }\r\n if (chr == CharCode.EQUALS) {\r\n ++this.pos;\r\n return Token.PLUS_EQUALS;\r\n }\r\n }\r\n return Token.PLUS;\r\n }\r\n case CharCode.COMMA: {\r\n ++this.pos;\r\n return Token.COMMA;\r\n }\r\n case CharCode.MINUS: {\r\n ++this.pos;\r\n if (maxTokenLength > 1 && this.pos < this.end) {\r\n let chr = text.charCodeAt(this.pos);\r\n if (chr == CharCode.MINUS) {\r\n ++this.pos;\r\n return Token.MINUS_MINUS;\r\n }\r\n if (chr == CharCode.EQUALS) {\r\n ++this.pos;\r\n return Token.MINUS_EQUALS;\r\n }\r\n }\r\n return Token.MINUS;\r\n }\r\n case CharCode.DOT: {\r\n ++this.pos;\r\n if (maxTokenLength > 1 && this.pos < this.end) {\r\n let chr = text.charCodeAt(this.pos);\r\n if (isDecimalDigit(chr)) {\r\n --this.pos;\r\n return Token.FLOATLITERAL; // expects a call to readFloat\r\n }\r\n if (\r\n maxTokenLength > 2 && this.pos + 1 < this.end &&\r\n chr == CharCode.DOT &&\r\n text.charCodeAt(this.pos + 1) == CharCode.DOT\r\n ) {\r\n this.pos += 2;\r\n return Token.DOT_DOT_DOT;\r\n }\r\n }\r\n return Token.DOT;\r\n }\r\n case CharCode.SLASH: {\r\n let commentStartPos = this.pos;\r\n ++this.pos;\r\n if (maxTokenLength > 1 && this.pos < this.end) {\r\n let chr = text.charCodeAt(this.pos);\r\n if (chr == CharCode.SLASH) { // single-line\r\n let commentKind = CommentKind.LINE;\r\n if (\r\n this.pos + 1 < this.end &&\r\n text.charCodeAt(this.pos + 1) == CharCode.SLASH\r\n ) {\r\n ++this.pos;\r\n commentKind = CommentKind.TRIPLE;\r\n }\r\n while (++this.pos < this.end) {\r\n if (text.charCodeAt(this.pos) == CharCode.LINEFEED) {\r\n ++this.pos;\r\n break;\r\n }\r\n }\r\n if (this.onComment) {\r\n this.onComment(\r\n commentKind,\r\n text.substring(commentStartPos, this.pos),\r\n this.range(commentStartPos, this.pos)\r\n );\r\n }\r\n break;\r\n }\r\n if (chr == CharCode.ASTERISK) { // multi-line\r\n let closed = false;\r\n while (++this.pos < this.end) {\r\n c = text.charCodeAt(this.pos);\r\n if (\r\n c == CharCode.ASTERISK &&\r\n this.pos + 1 < this.end &&\r\n text.charCodeAt(this.pos + 1) == CharCode.SLASH\r\n ) {\r\n this.pos += 2;\r\n closed = true;\r\n break;\r\n }\r\n }\r\n if (!closed) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n this.range(this.pos), \"*/\"\r\n );\r\n } else if (this.onComment) {\r\n this.onComment(\r\n CommentKind.BLOCK,\r\n text.substring(commentStartPos, this.pos),\r\n this.range(commentStartPos, this.pos)\r\n );\r\n }\r\n break;\r\n }\r\n if (chr == CharCode.EQUALS) {\r\n ++this.pos;\r\n return Token.SLASH_EQUALS;\r\n }\r\n }\r\n return Token.SLASH;\r\n }\r\n case CharCode._0:\r\n case CharCode._1:\r\n case CharCode._2:\r\n case CharCode._3:\r\n case CharCode._4:\r\n case CharCode._5:\r\n case CharCode._6:\r\n case CharCode._7:\r\n case CharCode._8:\r\n case CharCode._9: {\r\n return this.testInteger()\r\n ? Token.INTEGERLITERAL // expects a call to readInteger\r\n : Token.FLOATLITERAL; // expects a call to readFloat\r\n }\r\n case CharCode.COLON: {\r\n ++this.pos;\r\n return Token.COLON;\r\n }\r\n case CharCode.SEMICOLON: {\r\n ++this.pos;\r\n return Token.SEMICOLON;\r\n }\r\n case CharCode.LESSTHAN: {\r\n ++this.pos;\r\n if (maxTokenLength > 1 && this.pos < this.end) {\r\n let chr = text.charCodeAt(this.pos);\r\n if (chr == CharCode.LESSTHAN) {\r\n ++this.pos;\r\n if (\r\n maxTokenLength > 2 &&\r\n this.pos < this.end &&\r\n text.charCodeAt(this.pos) == CharCode.EQUALS\r\n ) {\r\n ++this.pos;\r\n return Token.LESSTHAN_LESSTHAN_EQUALS;\r\n }\r\n return Token.LESSTHAN_LESSTHAN;\r\n }\r\n if (chr == CharCode.EQUALS) {\r\n ++this.pos;\r\n return Token.LESSTHAN_EQUALS;\r\n }\r\n }\r\n return Token.LESSTHAN;\r\n }\r\n case CharCode.EQUALS: {\r\n ++this.pos;\r\n if (maxTokenLength > 1 && this.pos < this.end) {\r\n let chr = text.charCodeAt(this.pos);\r\n if (chr == CharCode.EQUALS) {\r\n ++this.pos;\r\n if (\r\n maxTokenLength > 2 &&\r\n this.pos < this.end &&\r\n text.charCodeAt(this.pos) == CharCode.EQUALS\r\n ) {\r\n ++this.pos;\r\n return Token.EQUALS_EQUALS_EQUALS;\r\n }\r\n return Token.EQUALS_EQUALS;\r\n }\r\n if (chr == CharCode.GREATERTHAN) {\r\n ++this.pos;\r\n return Token.EQUALS_GREATERTHAN;\r\n }\r\n }\r\n return Token.EQUALS;\r\n }\r\n case CharCode.GREATERTHAN: {\r\n ++this.pos;\r\n if (maxTokenLength > 1 && this.pos < this.end) {\r\n let chr = text.charCodeAt(this.pos);\r\n if (chr == CharCode.GREATERTHAN) {\r\n ++this.pos;\r\n if (maxTokenLength > 2 && this.pos < this.end) {\r\n chr = text.charCodeAt(this.pos);\r\n if (chr == CharCode.GREATERTHAN) {\r\n ++this.pos;\r\n if (\r\n maxTokenLength > 3 && this.pos < this.end &&\r\n text.charCodeAt(this.pos) == CharCode.EQUALS\r\n ) {\r\n ++this.pos;\r\n return Token.GREATERTHAN_GREATERTHAN_GREATERTHAN_EQUALS;\r\n }\r\n return Token.GREATERTHAN_GREATERTHAN_GREATERTHAN;\r\n }\r\n if (chr == CharCode.EQUALS) {\r\n ++this.pos;\r\n return Token.GREATERTHAN_GREATERTHAN_EQUALS;\r\n }\r\n }\r\n return Token.GREATERTHAN_GREATERTHAN;\r\n }\r\n if (chr == CharCode.EQUALS) {\r\n ++this.pos;\r\n return Token.GREATERTHAN_EQUALS;\r\n }\r\n }\r\n return Token.GREATERTHAN;\r\n }\r\n case CharCode.QUESTION: {\r\n ++this.pos;\r\n return Token.QUESTION;\r\n }\r\n case CharCode.OPENBRACKET: {\r\n ++this.pos;\r\n return Token.OPENBRACKET;\r\n }\r\n case CharCode.CLOSEBRACKET: {\r\n ++this.pos;\r\n return Token.CLOSEBRACKET;\r\n }\r\n case CharCode.CARET: {\r\n ++this.pos;\r\n if (\r\n maxTokenLength > 1 && this.pos < this.end &&\r\n text.charCodeAt(this.pos) == CharCode.EQUALS\r\n ) {\r\n ++this.pos;\r\n return Token.CARET_EQUALS;\r\n }\r\n return Token.CARET;\r\n }\r\n case CharCode.OPENBRACE: {\r\n ++this.pos;\r\n return Token.OPENBRACE;\r\n }\r\n case CharCode.BAR: {\r\n ++this.pos;\r\n if (maxTokenLength > 1 && this.pos < this.end) {\r\n let chr = text.charCodeAt(this.pos);\r\n if (chr == CharCode.BAR) {\r\n ++this.pos;\r\n return Token.BAR_BAR;\r\n }\r\n if (chr == CharCode.EQUALS) {\r\n ++this.pos;\r\n return Token.BAR_EQUALS;\r\n }\r\n }\r\n return Token.BAR;\r\n }\r\n case CharCode.CLOSEBRACE: {\r\n ++this.pos;\r\n return Token.CLOSEBRACE;\r\n }\r\n case CharCode.TILDE: {\r\n ++this.pos;\r\n return Token.TILDE;\r\n }\r\n case CharCode.AT: {\r\n ++this.pos;\r\n return Token.AT;\r\n }\r\n default: {\r\n if (isIdentifierStart(c)) {\r\n if (isKeywordCharacter(c)) {\r\n let posBefore = this.pos;\r\n while (\r\n ++this.pos < this.end &&\r\n isIdentifierPart(c = text.charCodeAt(this.pos))\r\n ) {\r\n if (!isKeywordCharacter(c)) {\r\n this.pos = posBefore;\r\n return Token.IDENTIFIER;\r\n }\r\n }\r\n let keywordText = text.substring(posBefore, this.pos);\r\n let keywordToken = tokenFromKeyword(keywordText);\r\n if (\r\n keywordToken !== Token.INVALID &&\r\n identifierHandling !== IdentifierHandling.ALWAYS &&\r\n !(\r\n identifierHandling === IdentifierHandling.PREFER &&\r\n tokenIsAlsoIdentifier(keywordToken)\r\n )\r\n ) {\r\n return keywordToken;\r\n }\r\n this.pos = posBefore;\r\n }\r\n return Token.IDENTIFIER; // expects a call to readIdentifier\r\n } else if (isWhiteSpace(c)) {\r\n ++this.pos;\r\n break;\r\n }\r\n this.error(\r\n DiagnosticCode.Invalid_character,\r\n this.range(this.pos, this.pos + 1)\r\n );\r\n ++this.pos;\r\n return Token.INVALID;\r\n }\r\n }\r\n }\r\n return Token.ENDOFFILE;\r\n }\r\n\r\n peek(\r\n checkOnNewLine: bool = false,\r\n identifierHandling: IdentifierHandling = IdentifierHandling.DEFAULT,\r\n maxCompoundLength: i32 = i32.MAX_VALUE\r\n ): Token {\r\n var text = this.source.text;\r\n if (this.nextToken < 0) {\r\n let posBefore = this.pos;\r\n let tokenBefore = this.token;\r\n let tokenPosBefore = this.tokenPos;\r\n this.nextToken = this.unsafeNext(identifierHandling, maxCompoundLength);\r\n this.nextTokenPos = this.tokenPos;\r\n if (checkOnNewLine) {\r\n this.nextTokenOnNewLine = false;\r\n for (let pos = posBefore, end = this.nextTokenPos; pos < end; ++pos) {\r\n if (isLineBreak(text.charCodeAt(pos))) {\r\n this.nextTokenOnNewLine = true;\r\n break;\r\n }\r\n }\r\n }\r\n this.pos = posBefore;\r\n this.token = tokenBefore;\r\n this.tokenPos = tokenPosBefore;\r\n }\r\n return this.nextToken;\r\n }\r\n\r\n skipIdentifier(identifierHandling: IdentifierHandling = IdentifierHandling.PREFER): bool {\r\n return this.skip(Token.IDENTIFIER, identifierHandling);\r\n }\r\n\r\n skip(token: Token, identifierHandling: IdentifierHandling = IdentifierHandling.DEFAULT): bool {\r\n var posBefore = this.pos;\r\n var tokenBefore = this.token;\r\n var tokenPosBefore = this.tokenPos;\r\n var maxCompoundLength = i32.MAX_VALUE;\r\n switch (token) {\r\n case Token.GREATERTHAN: { // where parsing type arguments\r\n maxCompoundLength = 1;\r\n break;\r\n }\r\n }\r\n this.token = this.unsafeNext(identifierHandling, maxCompoundLength);\r\n if (this.token == token) {\r\n this.nextToken = -1;\r\n return true;\r\n } else {\r\n this.pos = posBefore;\r\n this.token = tokenBefore;\r\n this.tokenPos = tokenPosBefore;\r\n return false;\r\n }\r\n }\r\n\r\n mark(): State {\r\n var state: State;\r\n if (reusableState) {\r\n state = reusableState;\r\n reusableState = null;\r\n } else {\r\n state = new State();\r\n }\r\n state.pos = this.pos;\r\n state.token = this.token;\r\n state.tokenPos = this.tokenPos;\r\n return state;\r\n }\r\n\r\n discard(state: State): void {\r\n reusableState = state;\r\n }\r\n\r\n reset(state: State): void {\r\n this.pos = state.pos;\r\n this.token = state.token;\r\n this.tokenPos = state.tokenPos;\r\n this.nextToken = -1;\r\n }\r\n\r\n range(start: i32 = -1, end: i32 = -1): Range {\r\n if (start < 0) {\r\n start = this.tokenPos;\r\n end = this.pos;\r\n } else if (end < 0) {\r\n end = start;\r\n }\r\n return new Range(this.source, start, end);\r\n }\r\n\r\n readIdentifier(): string {\r\n var text = this.source.text;\r\n var start = this.pos;\r\n while (\r\n ++this.pos < this.end &&\r\n isIdentifierPart(text.charCodeAt(this.pos))\r\n );\r\n return text.substring(start, this.pos);\r\n }\r\n\r\n readString(): string {\r\n var text = this.source.text;\r\n var quote = text.charCodeAt(this.pos++);\r\n var start = this.pos;\r\n var result = \"\";\r\n while (true) {\r\n if (this.pos >= this.end) {\r\n result += text.substring(start, this.pos);\r\n this.error(\r\n DiagnosticCode.Unterminated_string_literal,\r\n this.range(start - 1, this.end)\r\n );\r\n break;\r\n }\r\n let c = text.charCodeAt(this.pos);\r\n if (c == quote) {\r\n result += text.substring(start, this.pos++);\r\n break;\r\n }\r\n if (c == CharCode.BACKSLASH) {\r\n result += text.substring(start, this.pos);\r\n result += this.readEscapeSequence();\r\n start = this.pos;\r\n continue;\r\n }\r\n if (isLineBreak(c)) {\r\n result += text.substring(start, this.pos);\r\n this.error(\r\n DiagnosticCode.Unterminated_string_literal,\r\n this.range(start - 1, this.pos)\r\n );\r\n break;\r\n }\r\n ++this.pos;\r\n }\r\n return result;\r\n }\r\n\r\n readEscapeSequence(): string {\r\n if (++this.pos >= this.end) {\r\n this.error(\r\n DiagnosticCode.Unexpected_end_of_text,\r\n this.range(this.end)\r\n );\r\n return \"\";\r\n }\r\n\r\n var text = this.source.text;\r\n var c = text.charCodeAt(this.pos++);\r\n switch (c) {\r\n case CharCode._0: return \"\\0\";\r\n case CharCode.b: return \"\\b\";\r\n case CharCode.t: return \"\\t\";\r\n case CharCode.n: return \"\\n\";\r\n case CharCode.v: return \"\\v\";\r\n case CharCode.f: return \"\\f\";\r\n case CharCode.r: return \"\\r\";\r\n case CharCode.SINGLEQUOTE: return \"'\";\r\n case CharCode.DOUBLEQUOTE: return \"\\\"\";\r\n case CharCode.u: {\r\n if (\r\n this.pos < this.end &&\r\n text.charCodeAt(this.pos) == CharCode.OPENBRACE\r\n ) {\r\n ++this.pos;\r\n return this.readExtendedUnicodeEscape(); // \\u{DDDDDDDD}\r\n }\r\n return this.readUnicodeEscape(); // \\uDDDD\r\n }\r\n case CharCode.CARRIAGERETURN: {\r\n if (\r\n this.pos < this.end &&\r\n text.charCodeAt(this.pos) == CharCode.LINEFEED\r\n ) {\r\n ++this.pos;\r\n }\r\n // fall through\r\n }\r\n case CharCode.LINEFEED:\r\n case CharCode.LINESEPARATOR:\r\n case CharCode.PARAGRAPHSEPARATOR: return \"\";\r\n default: return String.fromCharCode(c);\r\n }\r\n }\r\n\r\n readRegexpPattern(): string {\r\n var text = this.source.text;\r\n var start = this.pos;\r\n var escaped = false;\r\n while (true) {\r\n if (this.pos >= this.end) {\r\n this.error(\r\n DiagnosticCode.Unterminated_regular_expression_literal,\r\n this.range(start, this.end)\r\n );\r\n break;\r\n }\r\n if (text.charCodeAt(this.pos) == CharCode.BACKSLASH) {\r\n ++this.pos;\r\n escaped = true;\r\n continue;\r\n }\r\n let c = text.charCodeAt(this.pos);\r\n if (!escaped && c == CharCode.SLASH) break;\r\n if (isLineBreak(c)) {\r\n this.error(\r\n DiagnosticCode.Unterminated_regular_expression_literal,\r\n this.range(start, this.pos)\r\n );\r\n break;\r\n }\r\n ++this.pos;\r\n escaped = false;\r\n }\r\n return text.substring(start, this.pos);\r\n }\r\n\r\n readRegexpFlags(): string {\r\n var text = this.source.text;\r\n var start = this.pos;\r\n var flags = 0;\r\n while (this.pos < this.end) {\r\n let c: i32 = text.charCodeAt(this.pos);\r\n if (!isIdentifierPart(c)) break;\r\n ++this.pos;\r\n\r\n // make sure each supported flag is unique\r\n switch (c) {\r\n case CharCode.g: {\r\n flags |= flags & 1 ? -1 : 1;\r\n break;\r\n }\r\n case CharCode.i: {\r\n flags |= flags & 2 ? -1 : 2;\r\n break;\r\n }\r\n case CharCode.m: {\r\n flags |= flags & 4 ? -1 : 4;\r\n break;\r\n }\r\n default: {\r\n flags = -1;\r\n break;\r\n }\r\n }\r\n }\r\n if (flags == -1) {\r\n this.error(\r\n DiagnosticCode.Invalid_regular_expression_flags,\r\n this.range(start, this.pos)\r\n );\r\n }\r\n return text.substring(start, this.pos);\r\n }\r\n\r\n testInteger(): bool {\r\n var text = this.source.text;\r\n if (this.pos + 1 < this.end && text.charCodeAt(this.pos) == CharCode._0) {\r\n switch (text.charCodeAt(this.pos + 2)) {\r\n case CharCode.x:\r\n case CharCode.X:\r\n case CharCode.b:\r\n case CharCode.B:\r\n case CharCode.o:\r\n case CharCode.O: return true;\r\n }\r\n }\r\n var pos = this.pos;\r\n while (pos < this.end) {\r\n let c = text.charCodeAt(pos);\r\n if (c == CharCode.DOT || c == CharCode.e || c == CharCode.E) {\r\n return false;\r\n }\r\n if ((c < CharCode._0 || c > CharCode._9) && c != CharCode._) break;\r\n // does not validate separator placement (this is done in readXYInteger)\r\n pos++;\r\n }\r\n return true;\r\n }\r\n\r\n readInteger(): I64 {\r\n var text = this.source.text;\r\n if (this.pos + 2 < this.end && text.charCodeAt(this.pos) == CharCode._0) {\r\n switch (text.charCodeAt(this.pos + 1)) {\r\n case CharCode.x:\r\n case CharCode.X: {\r\n this.pos += 2;\r\n return this.readHexInteger();\r\n }\r\n case CharCode.b:\r\n case CharCode.B: {\r\n this.pos += 2;\r\n return this.readBinaryInteger();\r\n }\r\n case CharCode.o:\r\n case CharCode.O: {\r\n this.pos += 2;\r\n return this.readOctalInteger();\r\n }\r\n }\r\n if (isOctalDigit(text.charCodeAt(this.pos + 1))) {\r\n let start = this.pos;\r\n ++this.pos;\r\n let value = this.readOctalInteger();\r\n this.error(\r\n DiagnosticCode.Octal_literals_are_not_allowed_in_strict_mode,\r\n this.range(start, this.pos)\r\n );\r\n return value;\r\n }\r\n }\r\n return this.readDecimalInteger();\r\n }\r\n\r\n readHexInteger(): I64 {\r\n var text = this.source.text;\r\n var start = this.pos;\r\n var value = i64_new(0);\r\n var i64_4 = i64_new(4);\r\n var sepEnd = start;\r\n while (this.pos < this.end) {\r\n let pos = this.pos;\r\n let c = text.charCodeAt(pos);\r\n if (c >= CharCode._0 && c <= CharCode._9) {\r\n // value = (value << 4) + c - CharCode._0;\r\n value = i64_add(\r\n i64_shl(value, i64_4),\r\n i64_new(c - CharCode._0)\r\n );\r\n } else if (c >= CharCode.A && c <= CharCode.F) {\r\n // value = (value << 4) + 10 + c - CharCode.A;\r\n value = i64_add(\r\n i64_shl(value, i64_4),\r\n i64_new(10 + c - CharCode.A)\r\n );\r\n } else if (c >= CharCode.a && c <= CharCode.f) {\r\n // value = (value << 4) + 10 + c - CharCode.a;\r\n value = i64_add(\r\n i64_shl(value, i64_4),\r\n i64_new(10 + c - CharCode.a)\r\n );\r\n } else if (c == CharCode._) {\r\n if (sepEnd == pos) {\r\n this.error(\r\n sepEnd == start\r\n ? DiagnosticCode.Numeric_separators_are_not_allowed_here\r\n : DiagnosticCode.Multiple_consecutive_numeric_separators_are_not_permitted,\r\n this.range(pos)\r\n );\r\n }\r\n sepEnd = pos + 1;\r\n } else {\r\n break;\r\n }\r\n this.pos = pos + 1;\r\n }\r\n if (this.pos == start) {\r\n this.error(\r\n DiagnosticCode.Hexadecimal_digit_expected,\r\n this.range(start)\r\n );\r\n } else if (sepEnd == this.pos) {\r\n this.error(\r\n DiagnosticCode.Numeric_separators_are_not_allowed_here,\r\n this.range(sepEnd - 1)\r\n );\r\n }\r\n return value;\r\n }\r\n\r\n readDecimalInteger(): I64 {\r\n var text = this.source.text;\r\n var start = this.pos;\r\n var value = i64_new(0);\r\n var i64_10 = i64_new(10);\r\n var sepEnd = start;\r\n while (this.pos < this.end) {\r\n let pos = this.pos;\r\n let c = text.charCodeAt(pos);\r\n if (c >= CharCode._0 && c <= CharCode._9) {\r\n // value = value * 10 + c - CharCode._0;\r\n value = i64_add(\r\n i64_mul(value, i64_10),\r\n i64_new(c - CharCode._0)\r\n );\r\n } else if (c == CharCode._) {\r\n if (sepEnd == pos) {\r\n this.error(\r\n sepEnd == start\r\n ? DiagnosticCode.Numeric_separators_are_not_allowed_here\r\n : DiagnosticCode.Multiple_consecutive_numeric_separators_are_not_permitted,\r\n this.range(pos)\r\n );\r\n }\r\n sepEnd = pos + 1;\r\n } else {\r\n break;\r\n }\r\n this.pos = pos + 1;\r\n }\r\n if (this.pos == start) {\r\n this.error(\r\n DiagnosticCode.Digit_expected,\r\n this.range(start)\r\n );\r\n } else if (sepEnd == this.pos) {\r\n this.error(\r\n DiagnosticCode.Numeric_separators_are_not_allowed_here,\r\n this.range(sepEnd - 1)\r\n );\r\n }\r\n return value;\r\n }\r\n\r\n readOctalInteger(): I64 {\r\n var text = this.source.text;\r\n var start = this.pos;\r\n var value = i64_new(0);\r\n var i64_3 = i64_new(3);\r\n var sepEnd = start;\r\n while (this.pos < this.end) {\r\n let pos = this.pos;\r\n let c = text.charCodeAt(pos);\r\n if (c >= CharCode._0 && c <= CharCode._7) {\r\n // value = (value << 3) + c - CharCode._0;\r\n value = i64_add(\r\n i64_shl(value, i64_3),\r\n i64_new(c - CharCode._0)\r\n );\r\n } else if (c == CharCode._) {\r\n if (sepEnd == pos) {\r\n this.error(\r\n sepEnd == start\r\n ? DiagnosticCode.Numeric_separators_are_not_allowed_here\r\n : DiagnosticCode.Multiple_consecutive_numeric_separators_are_not_permitted,\r\n this.range(pos)\r\n );\r\n }\r\n sepEnd = pos + 1;\r\n } else {\r\n break;\r\n }\r\n ++this.pos;\r\n }\r\n if (this.pos == start) {\r\n this.error(\r\n DiagnosticCode.Octal_digit_expected,\r\n this.range(start)\r\n );\r\n } else if (sepEnd == this.pos) {\r\n this.error(\r\n DiagnosticCode.Numeric_separators_are_not_allowed_here,\r\n this.range(sepEnd - 1)\r\n );\r\n }\r\n return value;\r\n }\r\n\r\n readBinaryInteger(): I64 {\r\n var text = this.source.text;\r\n var start = this.pos;\r\n var value = i64_new(0);\r\n var i64_1 = i64_new(1);\r\n var sepEnd = start;\r\n while (this.pos < this.end) {\r\n let pos = this.pos;\r\n let c = text.charCodeAt(pos);\r\n if (c == CharCode._0) {\r\n // value = (value << 1);\r\n value = i64_shl(value, i64_1);\r\n } else if (c == CharCode._1) {\r\n // value = (value << 1) + 1;\r\n value = i64_add(\r\n i64_shl(value, i64_1),\r\n i64_1\r\n );\r\n } else if (c == CharCode._) {\r\n if (sepEnd == pos) {\r\n this.error(\r\n sepEnd == start\r\n ? DiagnosticCode.Numeric_separators_are_not_allowed_here\r\n : DiagnosticCode.Multiple_consecutive_numeric_separators_are_not_permitted,\r\n this.range(pos)\r\n );\r\n }\r\n sepEnd = pos + 1;\r\n } else {\r\n break;\r\n }\r\n this.pos = pos + 1;\r\n }\r\n if (this.pos == start) {\r\n this.error(\r\n DiagnosticCode.Binary_digit_expected,\r\n this.range(start)\r\n );\r\n } else if (sepEnd == this.pos) {\r\n this.error(\r\n DiagnosticCode.Numeric_separators_are_not_allowed_here,\r\n this.range(sepEnd - 1)\r\n );\r\n }\r\n return value;\r\n }\r\n\r\n readFloat(): f64 {\r\n // var text = this.source.text;\r\n // if (text.charCodeAt(this.pos) == CharCode._0 && this.pos + 2 < this.end) {\r\n // switch (text.charCodeAt(this.pos + 1)) {\r\n // case CharCode.X:\r\n // case CharCode.x: {\r\n // this.pos += 2;\r\n // return this.readHexFloat();\r\n // }\r\n // }\r\n // }\r\n return this.readDecimalFloat();\r\n }\r\n\r\n readDecimalFloat(): f64 {\r\n // TODO: numeric separators (parseFloat can't handle these)\r\n var start = this.pos;\r\n var text = this.source.text;\r\n while (this.pos < this.end && isDecimalDigit(text.charCodeAt(this.pos))) {\r\n ++this.pos;\r\n }\r\n if (this.pos < this.end && text.charCodeAt(this.pos) == CharCode.DOT) {\r\n ++this.pos;\r\n while (this.pos < this.end && isDecimalDigit(text.charCodeAt(this.pos))) {\r\n ++this.pos;\r\n }\r\n }\r\n if (this.pos < this.end) {\r\n let c = text.charCodeAt(this.pos);\r\n if (c == CharCode.e || c == CharCode.E) {\r\n if (\r\n ++this.pos < this.end &&\r\n (c = text.charCodeAt(this.pos)) == CharCode.MINUS || c == CharCode.PLUS &&\r\n isDecimalDigit(text.charCodeAt(this.pos + 1))\r\n ) {\r\n ++this.pos;\r\n }\r\n while (this.pos < this.end && isDecimalDigit(text.charCodeAt(this.pos))) {\r\n ++this.pos;\r\n }\r\n }\r\n }\r\n return parseFloat(text.substring(start, this.pos));\r\n }\r\n\r\n readHexFloat(): f64 {\r\n throw new Error(\"not implemented\"); // TBD\r\n }\r\n\r\n readUnicodeEscape(): string {\r\n var remain = 4;\r\n var value = 0;\r\n var text = this.source.text;\r\n while (this.pos < this.end) {\r\n let c = text.charCodeAt(this.pos++);\r\n if (c >= CharCode._0 && c <= CharCode._9) {\r\n value = (value << 4) + c - CharCode._0;\r\n } else if (c >= CharCode.A && c <= CharCode.F) {\r\n value = (value << 4) + c + (10 - CharCode.A);\r\n } else if (c >= CharCode.a && c <= CharCode.f) {\r\n value = (value << 4) + c + (10 - CharCode.a);\r\n } else {\r\n this.error(\r\n DiagnosticCode.Hexadecimal_digit_expected,\r\n this.range(this.pos - 1, this.pos)\r\n );\r\n return \"\";\r\n }\r\n if (--remain == 0) break;\r\n }\r\n if (remain) {\r\n this.error(\r\n DiagnosticCode.Unexpected_end_of_text,\r\n this.range(this.pos)\r\n );\r\n return \"\";\r\n }\r\n return String.fromCharCode(value);\r\n }\r\n\r\n private readExtendedUnicodeEscape(): string {\r\n var start = this.pos;\r\n var value = this.readHexInteger();\r\n var value32 = i64_low(value);\r\n var invalid = false;\r\n\r\n assert(!i64_high(value));\r\n if (value32 > 0x10FFFF) {\r\n this.error(\r\n DiagnosticCode.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive,\r\n this.range(start, this.pos)\r\n );\r\n invalid = true;\r\n }\r\n\r\n var text = this.source.text;\r\n if (this.pos >= this.end) {\r\n this.error(\r\n DiagnosticCode.Unexpected_end_of_text,\r\n this.range(start, this.end)\r\n );\r\n invalid = true;\r\n } else if (text.charCodeAt(this.pos) == CharCode.CLOSEBRACE) {\r\n ++this.pos;\r\n } else {\r\n this.error(\r\n DiagnosticCode.Unterminated_Unicode_escape_sequence,\r\n this.range(start, this.pos)\r\n );\r\n invalid = true;\r\n }\r\n\r\n if (invalid) return \"\";\r\n return value32 < 65536\r\n ? String.fromCharCode(value32)\r\n : String.fromCharCode(\r\n ((value32 - 65536) >>> 10) + 0xD800,\r\n ((value32 - 65536) & 1023) + 0xDC00\r\n );\r\n }\r\n\r\n finish(): void {\r\n }\r\n}\r\n\r\n/** Tokenizer state as returned by {@link Tokenizer#mark} and consumed by {@link Tokenizer#reset}. */\r\nexport class State {\r\n /** Current position. */\r\n pos: i32;\r\n /** Current token. */\r\n token: Token;\r\n /** Current token's position. */\r\n tokenPos: i32;\r\n}\r\n\r\n// Reusable state object to reduce allocations\r\nvar reusableState: State | null = null;\r\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","/**\r\n * Resolve infrastructure to obtain types and elements.\r\n * @module resolver\r\n *//***/\r\n\r\nimport {\r\n DiagnosticEmitter,\r\n DiagnosticCode\r\n} from \"./diagnostics\";\r\n\r\nimport {\r\n Program,\r\n ElementKind,\r\n OperatorKind,\r\n Element,\r\n Class,\r\n ClassPrototype,\r\n Function,\r\n FunctionPrototype,\r\n VariableLikeElement,\r\n Property,\r\n PropertyPrototype,\r\n Field,\r\n FieldPrototype,\r\n Global,\r\n TypeDefinition\r\n} from \"./program\";\r\n\r\nimport {\r\n FlowFlags,\r\n Flow\r\n} from \"./flow\";\r\n\r\nimport {\r\n SignatureNode,\r\n ParameterKind,\r\n CommonTypeNode,\r\n NodeKind,\r\n TypeNode,\r\n TypeName,\r\n TypeParameterNode,\r\n Node,\r\n Range,\r\n IdentifierExpression,\r\n CallExpression,\r\n ElementAccessExpression,\r\n PropertyAccessExpression,\r\n LiteralExpression,\r\n LiteralKind,\r\n ParenthesizedExpression,\r\n AssertionExpression,\r\n Expression,\r\n IntegerLiteralExpression,\r\n UnaryPrefixExpression,\r\n UnaryPostfixExpression,\r\n AssertionKind,\r\n BinaryExpression,\r\n ThisExpression,\r\n SuperExpression,\r\n isTypeOmitted\r\n} from \"./ast\";\r\n\r\nimport {\r\n Type,\r\n Signature,\r\n typesToString,\r\n TypeKind,\r\n TypeFlags\r\n} from \"./types\";\r\n\r\nimport {\r\n CommonFlags,\r\n CommonSymbols\r\n} from \"./common\";\r\n\r\nimport {\r\n makeMap,\r\n isPowerOf2\r\n} from \"./util\";\r\n\r\nimport {\r\n Token\r\n} from \"./tokenizer\";\r\n\r\n/** Indicates whether errors are reported or not. */\r\nexport enum ReportMode {\r\n /** Report errors. */\r\n REPORT,\r\n /** Swallow errors. */\r\n SWALLOW\r\n}\r\n\r\n/** Provides tools to resolve types and expressions. */\r\nexport class Resolver extends DiagnosticEmitter {\r\n\r\n /** The program this resolver belongs to. */\r\n program: Program;\r\n\r\n /** Target expression of the previously resolved property or element access. */\r\n currentThisExpression: Expression | null = null;\r\n /** Element expression of the previously resolved element access. */\r\n currentElementExpression : Expression | null = null;\r\n\r\n /** Constructs the resolver for the specified program. */\r\n constructor(\r\n /** The program to construct a resolver for. */\r\n program: Program\r\n ) {\r\n super(program.diagnostics);\r\n this.program = program;\r\n }\r\n\r\n /** Resolves a {@link CommonTypeNode} to a concrete {@link Type}. */\r\n resolveType(\r\n /** The type to resolve. */\r\n node: CommonTypeNode,\r\n /** Relative context. */\r\n context: Element,\r\n /** Type arguments inherited through context, i.e. `T`. */\r\n contextualTypeArguments: Map | null = null,\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Type | null {\r\n\r\n // handle signature\r\n if (node.kind == NodeKind.SIGNATURE) {\r\n let explicitThisType = (node).explicitThisType;\r\n let thisType: Type | null = null;\r\n if (explicitThisType) {\r\n thisType = this.resolveType(\r\n explicitThisType,\r\n context,\r\n contextualTypeArguments,\r\n reportMode\r\n );\r\n if (!thisType) return null;\r\n }\r\n let parameterNodes = (node).parameters;\r\n let numParameters = parameterNodes.length;\r\n let parameterTypes = new Array(numParameters);\r\n let parameterNames = new Array(numParameters);\r\n let requiredParameters = 0;\r\n let hasRest = false;\r\n for (let i = 0; i < numParameters; ++i) {\r\n let parameterNode = parameterNodes[i];\r\n switch (parameterNode.parameterKind) {\r\n case ParameterKind.DEFAULT: {\r\n requiredParameters = i + 1;\r\n break;\r\n }\r\n case ParameterKind.REST: {\r\n assert(i == numParameters);\r\n hasRest = true;\r\n break;\r\n }\r\n }\r\n let parameterTypeNode = parameterNode.type;\r\n if (isTypeOmitted(parameterTypeNode)) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Type_expected,\r\n parameterTypeNode.range\r\n );\r\n }\r\n return null;\r\n }\r\n let parameterType = this.resolveType(\r\n parameterTypeNode,\r\n context,\r\n contextualTypeArguments,\r\n reportMode\r\n );\r\n if (!parameterType) return null;\r\n parameterTypes[i] = parameterType;\r\n parameterNames[i] = parameterNode.name.text;\r\n }\r\n let returnTypeNode = (node).returnType;\r\n if (isTypeOmitted(returnTypeNode)) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Type_expected,\r\n returnTypeNode.range\r\n );\r\n }\r\n return null;\r\n }\r\n let returnType: Type | null;\r\n if (returnTypeNode) {\r\n returnType = this.resolveType(\r\n returnTypeNode,\r\n context,\r\n contextualTypeArguments,\r\n reportMode\r\n );\r\n if (!returnType) return null;\r\n } else {\r\n returnType = Type.void;\r\n }\r\n let signature = new Signature(parameterTypes, returnType, thisType);\r\n signature.parameterNames = parameterNames;\r\n signature.requiredParameters = requiredParameters;\r\n signature.hasRest = hasRest;\r\n return node.isNullable ? signature.type.asNullable() : signature.type;\r\n }\r\n\r\n // now dealing with TypeNode\r\n assert(node.kind == NodeKind.TYPE);\r\n var typeNode = node;\r\n var typeName = typeNode.name;\r\n var typeArgumentNodes = typeNode.typeArguments;\r\n var possiblyPlaceholder = !typeName.next;\r\n\r\n // look up in contextual type arguments if possibly a placeholder\r\n if (possiblyPlaceholder) {\r\n if (contextualTypeArguments && contextualTypeArguments.has(typeName.identifier.text)) {\r\n let type = contextualTypeArguments.get(typeName.identifier.text)!;\r\n if (typeArgumentNodes !== null && typeArgumentNodes.length) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n node.range, type.toString()\r\n );\r\n }\r\n }\r\n if (node.isNullable) {\r\n if (!type.is(TypeFlags.REFERENCE)) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Basic_type_0_cannot_be_nullable,\r\n node.range, type.toString()\r\n );\r\n }\r\n }\r\n return type.asNullable();\r\n }\r\n return type;\r\n }\r\n }\r\n\r\n // look up in context\r\n var element = this.resolveTypeName(typeName, context, reportMode);\r\n if (!element) return null;\r\n\r\n // use shadow type if present (i.e. namespace sharing a type)\r\n if (element.shadowType) {\r\n element = element.shadowType;\r\n\r\n } else {\r\n // handle enums (become i32)\r\n if (element.kind == ElementKind.ENUM) {\r\n if (typeArgumentNodes !== null && typeArgumentNodes.length) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n node.range, element.internalName\r\n );\r\n }\r\n }\r\n if (node.isNullable) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Basic_type_0_cannot_be_nullable,\r\n node.range, element.name\r\n );\r\n }\r\n }\r\n return Type.i32;\r\n }\r\n\r\n // handle classes\r\n if (element.kind == ElementKind.CLASS_PROTOTYPE) {\r\n let instance = this.resolveClassInclTypeArguments(\r\n element,\r\n typeArgumentNodes,\r\n context,\r\n makeMap(contextualTypeArguments), // don't inherit\r\n node\r\n ); // reports\r\n if (!instance) return null;\r\n return node.isNullable ? instance.type.asNullable() : instance.type;\r\n }\r\n }\r\n\r\n // handle type definitions\r\n if (element.kind == ElementKind.TYPEDEFINITION) {\r\n\r\n // shortcut already resolved (mostly builtins)\r\n if (element.is(CommonFlags.RESOLVED)) {\r\n if (typeArgumentNodes !== null && typeArgumentNodes.length) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n node.range, element.internalName\r\n );\r\n }\r\n }\r\n let type = (element).type;\r\n if (node.isNullable) {\r\n if (!type.is(TypeFlags.REFERENCE)) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Basic_type_0_cannot_be_nullable,\r\n typeNode.name.range, typeName.identifier.text\r\n );\r\n }\r\n } else {\r\n return type.asNullable();\r\n }\r\n }\r\n return type;\r\n }\r\n\r\n // handle special native type\r\n if (possiblyPlaceholder && typeName.identifier.text == CommonSymbols.native) {\r\n if (!(typeArgumentNodes && typeArgumentNodes.length == 1)) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n typeNode.range, \"1\", (typeArgumentNodes ? typeArgumentNodes.length : 1).toString(10)\r\n );\r\n }\r\n return null;\r\n }\r\n let typeArgument = this.resolveType(\r\n typeArgumentNodes[0],\r\n context,\r\n contextualTypeArguments,\r\n reportMode\r\n );\r\n if (!typeArgument) return null;\r\n switch (typeArgument.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32: return Type.i32;\r\n case TypeKind.ISIZE: if (!this.program.options.isWasm64) return Type.i32;\r\n case TypeKind.I64: return Type.i64;\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: return Type.u32;\r\n case TypeKind.USIZE: if (!this.program.options.isWasm64) return Type.u32;\r\n case TypeKind.U64: return Type.u64;\r\n case TypeKind.F32: return Type.f32;\r\n case TypeKind.F64: return Type.f64;\r\n case TypeKind.V128: return Type.v128;\r\n case TypeKind.VOID: return Type.void;\r\n default: assert(false);\r\n }\r\n }\r\n\r\n // resolve normally\r\n let typeParameterNodes = (element).typeParameterNodes;\r\n let typeArguments: Type[] | null = null;\r\n if (typeParameterNodes) {\r\n typeArguments = this.resolveTypeArguments(\r\n typeParameterNodes,\r\n typeArgumentNodes,\r\n context,\r\n contextualTypeArguments = makeMap(contextualTypeArguments), // inherit\r\n node,\r\n reportMode\r\n );\r\n if (!typeArguments) return null;\r\n } else if (typeArgumentNodes && typeArgumentNodes.length) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n typeNode.range, typeName.identifier.text\r\n );\r\n // recoverable\r\n }\r\n return this.resolveType(\r\n (element).typeNode,\r\n element,\r\n contextualTypeArguments,\r\n reportMode\r\n );\r\n }\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Cannot_find_name_0,\r\n typeNode.name.range, typeName.identifier.text\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n /** Resolves a type name to the program element it refers to. */\r\n resolveTypeName(\r\n /** The type name to resolve. */\r\n typeName: TypeName,\r\n /** Relative context. */\r\n context: Element,\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode = ReportMode.REPORT\r\n ): Element | null {\r\n var element = context.lookup(typeName.identifier.text);\r\n if (!element) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Cannot_find_name_0,\r\n typeName.range, typeName.identifier.text\r\n );\r\n }\r\n return null;\r\n }\r\n var prev = typeName;\r\n var next = typeName.next;\r\n while (next) {\r\n if (!(element = element.lookupInSelf(next.identifier.text))) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Property_0_does_not_exist_on_type_1,\r\n next.range, next.identifier.text, prev.identifier.text\r\n );\r\n }\r\n return null;\r\n }\r\n prev = next;\r\n next = next.next;\r\n }\r\n return element;\r\n }\r\n\r\n /** Resolves an array of type arguments to concrete types. */\r\n resolveTypeArguments(\r\n /** Actual type parameter nodes. */\r\n typeParameters: TypeParameterNode[],\r\n /** Type arguments provided. */\r\n typeArgumentNodes: CommonTypeNode[] | null,\r\n /** Relative context. */\r\n context: Element,\r\n /** Type arguments inherited through context, i.e. `T`. */\r\n contextualTypeArguments: Map = makeMap(),\r\n /** Alternative report node in case of empty type arguments. */\r\n alternativeReportNode: Node | null = null,\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Type[] | null {\r\n var minParameterCount = 0;\r\n var maxParameterCount = 0;\r\n for (let i = 0; i < typeParameters.length; ++i) {\r\n if (!typeParameters[i].defaultType) ++minParameterCount;\r\n ++maxParameterCount;\r\n }\r\n var argumentCount = typeArgumentNodes ? typeArgumentNodes.length : 0;\r\n if (argumentCount < minParameterCount || argumentCount > maxParameterCount) {\r\n this.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n argumentCount\r\n ? Range.join(\r\n (typeArgumentNodes)[0].range,\r\n (typeArgumentNodes)[argumentCount - 1].range\r\n )\r\n : assert(alternativeReportNode).range,\r\n (argumentCount < minParameterCount ? minParameterCount : maxParameterCount).toString(10),\r\n argumentCount.toString(10)\r\n );\r\n return null;\r\n }\r\n var typeArguments = new Array(maxParameterCount);\r\n for (let i = 0; i < maxParameterCount; ++i) {\r\n let type = i < argumentCount\r\n ? this.resolveType( // reports\r\n (typeArgumentNodes)[i],\r\n context,\r\n contextualTypeArguments,\r\n reportMode\r\n )\r\n : this.resolveType( // reports\r\n assert(typeParameters[i].defaultType),\r\n context,\r\n contextualTypeArguments,\r\n reportMode\r\n );\r\n if (!type) return null;\r\n // TODO: check extendsType\r\n contextualTypeArguments.set(typeParameters[i].name.text, type);\r\n typeArguments[i] = type;\r\n }\r\n return typeArguments;\r\n }\r\n\r\n /** Resolves an identifier to the program element it refers to. */\r\n resolveIdentifier(\r\n /** The expression to resolve. */\r\n identifier: IdentifierExpression,\r\n /** Optional flow to search for scoped locals. */\r\n flow: Flow | null,\r\n /** Optional context to search. */\r\n context: Element | null,\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Element | null {\r\n var name = identifier.text;\r\n var element: Element | null;\r\n if (flow) {\r\n if (element = flow.lookup(name)) {\r\n this.currentThisExpression = null;\r\n this.currentElementExpression = null;\r\n return element;\r\n }\r\n }\r\n if (context) {\r\n if (element = context.lookup(name)) {\r\n this.currentThisExpression = null;\r\n this.currentElementExpression = null;\r\n return element;\r\n }\r\n }\r\n if (element = this.program.lookupGlobal(name)) {\r\n this.currentThisExpression = null;\r\n this.currentElementExpression = null;\r\n return element;\r\n }\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Cannot_find_name_0,\r\n identifier.range, name\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n /** Resolves a lazily compiled global, i.e. a static class field. */\r\n ensureResolvedLazyGlobal(global: Global, reportMode: ReportMode = ReportMode.REPORT): bool {\r\n if (global.is(CommonFlags.RESOLVED)) return true;\r\n var typeNode = global.typeNode;\r\n if (!typeNode) return false;\r\n var type = this.resolveType( // reports\r\n typeNode,\r\n global.parent,\r\n null,\r\n reportMode\r\n );\r\n if (!type) return false;\r\n global.setType(type);\r\n return true;\r\n }\r\n\r\n /** Resolves a property access expression to the program element it refers to. */\r\n resolvePropertyAccessExpression(\r\n /** The expression to resolve. */\r\n propertyAccess: PropertyAccessExpression,\r\n /** Current flow. */\r\n flow: Flow,\r\n /** Current contextual type. */\r\n contextualType: Type,\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Element | null {\r\n var targetExpression = propertyAccess.expression;\r\n var target = this.resolveExpression(targetExpression, flow, contextualType, reportMode); // reports\r\n if (!target) return null;\r\n var propertyName = propertyAccess.property.text;\r\n\r\n // Resolve variable-likes to their class type first\r\n switch (target.kind) {\r\n case ElementKind.GLOBAL: if (!this.ensureResolvedLazyGlobal(target, reportMode)) return null;\r\n case ElementKind.LOCAL:\r\n case ElementKind.FIELD: {\r\n let type = (target).type; assert(type != Type.void);\r\n let classReference = type.classReference;\r\n if (!classReference) {\r\n let typeClasses = this.program.typeClasses;\r\n if (!type.is(TypeFlags.REFERENCE) && typeClasses.has(type.kind)) {\r\n classReference = typeClasses.get(type.kind)!;\r\n } else {\r\n this.error(\r\n DiagnosticCode.Property_0_does_not_exist_on_type_1,\r\n propertyAccess.property.range, propertyName, (target).type.toString()\r\n );\r\n return null;\r\n }\r\n }\r\n target = classReference;\r\n break;\r\n }\r\n case ElementKind.PROPERTY_PROTOTYPE: { // static\r\n let getterInstance = this.resolveFunction( // reports\r\n assert((target).getterPrototype), // must have a getter\r\n null,\r\n makeMap(),\r\n reportMode\r\n );\r\n if (!getterInstance) return null;\r\n let classReference = getterInstance.signature.returnType.classReference;\r\n if (!classReference) {\r\n this.error(\r\n DiagnosticCode.Property_0_does_not_exist_on_type_1,\r\n propertyAccess.property.range, propertyName, getterInstance.signature.returnType.toString()\r\n );\r\n return null;\r\n }\r\n target = classReference;\r\n break;\r\n }\r\n case ElementKind.PROPERTY: { // instance\r\n let getterInstance = assert((target).getterInstance); // must have a getter\r\n let classReference = getterInstance.signature.returnType.classReference;\r\n if (!classReference) {\r\n this.error(\r\n DiagnosticCode.Property_0_does_not_exist_on_type_1,\r\n propertyAccess.property.range, propertyName, getterInstance.signature.returnType.toString()\r\n );\r\n return null;\r\n }\r\n target = classReference;\r\n break;\r\n }\r\n case ElementKind.CLASS: { // property access on element access?\r\n let elementExpression = this.currentElementExpression;\r\n if (elementExpression) {\r\n let indexedGet = (target).lookupOverload(OperatorKind.INDEXED_GET);\r\n if (!indexedGet) {\r\n this.error(\r\n DiagnosticCode.Index_signature_is_missing_in_type_0,\r\n elementExpression.range, (target).internalName\r\n );\r\n return null;\r\n }\r\n let returnType = indexedGet.signature.returnType;\r\n if (!(target = returnType.classReference)) {\r\n this.error(\r\n DiagnosticCode.Property_0_does_not_exist_on_type_1,\r\n propertyAccess.property.range, propertyName, returnType.toString()\r\n );\r\n return null;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n\r\n // Look up the member within\r\n switch (target.kind) {\r\n case ElementKind.CLASS_PROTOTYPE:\r\n case ElementKind.CLASS: {\r\n do {\r\n let members = target.members;\r\n if (members && members.has(propertyName)) {\r\n this.currentThisExpression = targetExpression;\r\n this.currentElementExpression = null;\r\n return members.get(propertyName)!; // instance FIELD, static GLOBAL, FUNCTION_PROTOTYPE...\r\n }\r\n // traverse inherited static members on the base prototype if target is a class prototype\r\n if (target.kind == ElementKind.CLASS_PROTOTYPE) {\r\n if ((target).basePrototype) {\r\n target = (target).basePrototype;\r\n } else {\r\n break;\r\n }\r\n // traverse inherited instance members on the base class if target is a class instance\r\n } else if (target.kind == ElementKind.CLASS) {\r\n if ((target).base) {\r\n target = (target).base;\r\n } else {\r\n break;\r\n }\r\n } else {\r\n break;\r\n }\r\n } while (true);\r\n break;\r\n }\r\n default: { // enums or other namespace-like elements\r\n let members = target.members;\r\n if (members && members.has(propertyName)) {\r\n this.currentThisExpression = targetExpression;\r\n this.currentElementExpression = null;\r\n return members.get(propertyName)!; // static ENUMVALUE, static GLOBAL, static FUNCTION_PROTOTYPE...\r\n }\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Property_0_does_not_exist_on_type_1,\r\n propertyAccess.property.range, propertyName, target.internalName\r\n );\r\n return null;\r\n }\r\n\r\n /** Resolves an element access expression to the program element it refers to. */\r\n resolveElementAccessExpression(\r\n /** The expression to resolve. */\r\n elementAccess: ElementAccessExpression,\r\n /** Current flow. */\r\n flow: Flow,\r\n /** Current contextual type. */\r\n contextualType: Type,\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Element | null {\r\n var targetExpression = elementAccess.expression;\r\n var target = this.resolveExpression(targetExpression, flow, contextualType, reportMode); // reports\r\n if (!target) return null;\r\n switch (target.kind) {\r\n case ElementKind.GLOBAL: if (!this.ensureResolvedLazyGlobal(target, reportMode)) return null;\r\n case ElementKind.LOCAL:\r\n case ElementKind.FIELD: {\r\n let type = (target).type;\r\n if (target = type.classReference) {\r\n this.currentThisExpression = targetExpression;\r\n this.currentElementExpression = elementAccess.elementExpression;\r\n return target;\r\n }\r\n break;\r\n }\r\n case ElementKind.CLASS: {\r\n let indexedGet = (target).lookupOverload(OperatorKind.INDEXED_GET);\r\n if (!indexedGet) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Index_signature_is_missing_in_type_0,\r\n elementAccess.range, (target).internalName\r\n );\r\n }\r\n return null;\r\n }\r\n if (targetExpression.kind == NodeKind.ELEMENTACCESS) { // nested element access\r\n let returnType = indexedGet.signature.returnType;\r\n if (target = returnType.classReference) {\r\n this.currentThisExpression = targetExpression;\r\n this.currentElementExpression = elementAccess.elementExpression;\r\n return target;\r\n }\r\n return null;\r\n }\r\n this.currentThisExpression = targetExpression;\r\n this.currentElementExpression = elementAccess.elementExpression;\r\n return target;\r\n }\r\n }\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n targetExpression.range\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n /** Determines the final type of an integer literal given the specified contextual type. */\r\n determineIntegerLiteralType(\r\n /** Integer literal value. */\r\n intValue: I64,\r\n /** Current contextual type. */\r\n contextualType: Type\r\n ): Type {\r\n if (!contextualType.is(TypeFlags.REFERENCE)) {\r\n // compile to contextualType if matching\r\n switch (contextualType.kind) {\r\n case TypeKind.I8: {\r\n if (i64_is_i8(intValue)) return Type.i8;\r\n break;\r\n }\r\n case TypeKind.U8: {\r\n if (i64_is_u8(intValue)) return Type.u8;\r\n break;\r\n }\r\n case TypeKind.I16: {\r\n if (i64_is_i16(intValue)) return Type.i16;\r\n break;\r\n }\r\n case TypeKind.U16: {\r\n if (i64_is_u16(intValue)) return Type.u16;\r\n break;\r\n }\r\n case TypeKind.I32: {\r\n if (i64_is_i32(intValue)) return Type.i32;\r\n break;\r\n }\r\n case TypeKind.U32: {\r\n if (i64_is_u32(intValue)) return Type.u32;\r\n break;\r\n }\r\n case TypeKind.BOOL: {\r\n if (i64_is_bool(intValue)) return Type.bool;\r\n break;\r\n }\r\n case TypeKind.ISIZE: {\r\n if (!this.program.options.isWasm64) {\r\n if (i64_is_i32(intValue)) return Type.isize32;\r\n break;\r\n }\r\n return Type.isize64;\r\n }\r\n case TypeKind.USIZE: {\r\n if (!this.program.options.isWasm64) {\r\n if (i64_is_u32(intValue)) return Type.usize32;\r\n break;\r\n }\r\n return Type.usize64;\r\n }\r\n case TypeKind.I64: return Type.i64;\r\n case TypeKind.U64: return Type.u64;\r\n case TypeKind.F32: return Type.f32;\r\n case TypeKind.F64: return Type.f64;\r\n case TypeKind.VOID: break; // best fitting below\r\n default: assert(false);\r\n }\r\n }\r\n // otherwise compile to best fitting native type\r\n if (i64_is_i32(intValue)) return Type.i32;\r\n if (i64_is_u32(intValue)) return Type.u32;\r\n return Type.i64;\r\n }\r\n\r\n /** Resolves any expression to the program element it refers to. */\r\n resolveExpression(\r\n /** The expression to resolve. */\r\n expression: Expression,\r\n /** Current flow. */\r\n flow: Flow,\r\n /** Current contextual type. */\r\n contextualType: Type = Type.void,\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Element | null {\r\n while (expression.kind == NodeKind.PARENTHESIZED) { // simply skip\r\n expression = (expression).expression;\r\n }\r\n switch (expression.kind) {\r\n case NodeKind.ASSERTION: {\r\n return this.resolveAssertionExpression(\r\n expression,\r\n flow, contextualType, reportMode\r\n );\r\n }\r\n case NodeKind.UNARYPREFIX: {\r\n return this.resolveUnaryPrefixExpression(\r\n expression,\r\n flow, contextualType, reportMode\r\n );\r\n }\r\n case NodeKind.UNARYPOSTFIX: {\r\n return this.resolveUnaryPostfixExpression(\r\n expression,\r\n flow, contextualType, reportMode\r\n );\r\n }\r\n case NodeKind.BINARY: {\r\n return this.resolveBinaryExpression(\r\n expression,\r\n flow, contextualType, reportMode\r\n );\r\n }\r\n case NodeKind.THIS: {\r\n return this.resolveThisExpression(\r\n expression,\r\n flow, contextualType, reportMode\r\n );\r\n }\r\n case NodeKind.SUPER: {\r\n return this.resolveSuperExpression(\r\n expression,\r\n flow, contextualType, reportMode\r\n );\r\n }\r\n case NodeKind.IDENTIFIER: {\r\n return this.resolveIdentifier(\r\n expression,\r\n flow, flow.actualFunction, reportMode\r\n );\r\n }\r\n case NodeKind.LITERAL: {\r\n return this.resolveLiteralExpression(\r\n expression,\r\n flow, contextualType, reportMode\r\n );\r\n }\r\n case NodeKind.PROPERTYACCESS: {\r\n return this.resolvePropertyAccessExpression(\r\n expression,\r\n flow, contextualType, reportMode\r\n );\r\n }\r\n case NodeKind.ELEMENTACCESS: {\r\n return this.resolveElementAccessExpression(\r\n expression,\r\n flow, contextualType, reportMode\r\n );\r\n }\r\n case NodeKind.CALL: {\r\n return this.resolveCallExpression(\r\n expression,\r\n flow, contextualType, reportMode\r\n );\r\n }\r\n // TODO: everything else\r\n }\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n /** Resolves an assertion expression to the program element it refers to. */\r\n resolveAssertionExpression(\r\n /** The expression to resolve. */\r\n expression: AssertionExpression,\r\n /** Current flow. */\r\n flow: Flow,\r\n /** Current contextual type. */\r\n contextualType: Type = Type.void,\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Element | null {\r\n if (expression.assertionKind == AssertionKind.NONNULL) {\r\n return this.resolveExpression(\r\n expression.expression,\r\n flow,\r\n contextualType,\r\n reportMode\r\n );\r\n }\r\n var type = this.resolveType(\r\n assert(expression.toType), // must be set if not NONNULL\r\n flow.actualFunction,\r\n flow.contextualTypeArguments,\r\n reportMode\r\n );\r\n if (!type) return null;\r\n var element: Element | null = type.classReference;\r\n if (!element) {\r\n let signature = type.signatureReference;\r\n if (!signature) return null;\r\n element = signature.asFunctionTarget(this.program);\r\n }\r\n this.currentThisExpression = null;\r\n this.currentElementExpression = null;\r\n return element;\r\n }\r\n\r\n /** Resolves an unary prefix expression to the program element it refers to. */\r\n resolveUnaryPrefixExpression(\r\n /** The expression to resolve. */\r\n expression: UnaryPrefixExpression,\r\n /** Current flow. */\r\n flow: Flow,\r\n /** Current contextual type. */\r\n contextualType: Type = Type.void,\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Element | null {\r\n var operand = expression.operand;\r\n // TODO: operator overloads\r\n switch (expression.operator) {\r\n case Token.MINUS: {\r\n // implicitly negate if an integer literal to distinguish between i32/u32/i64\r\n if (operand.kind == NodeKind.LITERAL && (operand).literalKind == LiteralKind.INTEGER) {\r\n let type = this.determineIntegerLiteralType(\r\n i64_sub(i64_zero, (operand).value),\r\n contextualType\r\n );\r\n let typeClasses = this.program.typeClasses;\r\n return typeClasses.has(type.kind) ? typeClasses.get(type.kind)! : null;\r\n }\r\n return this.resolveExpression(\r\n operand,\r\n flow,\r\n contextualType,\r\n reportMode\r\n );\r\n }\r\n case Token.PLUS:\r\n case Token.PLUS_PLUS:\r\n case Token.MINUS_MINUS: {\r\n return this.resolveExpression(\r\n expression.operand,\r\n flow,\r\n contextualType,\r\n reportMode\r\n );\r\n }\r\n case Token.EXCLAMATION: {\r\n let typeClasses = this.program.typeClasses;\r\n return typeClasses.has(TypeKind.BOOL) ? typeClasses.get(TypeKind.BOOL)! : null;\r\n }\r\n case Token.TILDE: {\r\n let resolvedOperand = this.resolveExpression(\r\n expression.operand,\r\n flow,\r\n contextualType,\r\n reportMode\r\n );\r\n if (!resolvedOperand) return null;\r\n // TODO\r\n break;\r\n }\r\n default: assert(false);\r\n }\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n /** Resolves an unary postfix expression to the program element it refers to. */\r\n resolveUnaryPostfixExpression(\r\n /** The expression to resolve. */\r\n expression: UnaryPostfixExpression,\r\n /** Current flow. */\r\n flow: Flow,\r\n /** Current contextual type. */\r\n contextualType: Type = Type.void,\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Element | null {\r\n // TODO: operator overloads\r\n switch (expression.operator) {\r\n case Token.PLUS_PLUS:\r\n case Token.MINUS_MINUS: {\r\n return this.resolveExpression(\r\n expression.operand,\r\n flow,\r\n contextualType,\r\n reportMode\r\n );\r\n }\r\n default: assert(false);\r\n }\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n /** Resolves a binary expression to the program element it refers to. */\r\n resolveBinaryExpression(\r\n /** The expression to resolve. */\r\n expression: BinaryExpression,\r\n /** Current flow. */\r\n flow: Flow,\r\n /** Current contextual type. */\r\n contextualType: Type = Type.void,\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Element | null {\r\n // TODO\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n /** Resolves a this expression to the program element it refers to. */\r\n resolveThisExpression(\r\n /** The expression to resolve. */\r\n expression: ThisExpression,\r\n /** Current flow. */\r\n flow: Flow,\r\n /** Current contextual type. */\r\n contextualType: Type = Type.void,\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Element | null {\r\n if (flow.is(FlowFlags.INLINE_CONTEXT)) {\r\n let thisLocal = flow.lookupLocal(CommonSymbols.this_);\r\n if (thisLocal) {\r\n this.currentThisExpression = null;\r\n this.currentElementExpression = null;\r\n return thisLocal;\r\n }\r\n }\r\n var parent = flow.actualFunction.parent;\r\n if (parent) {\r\n this.currentThisExpression = null;\r\n this.currentElementExpression = null;\r\n return parent;\r\n }\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode._this_cannot_be_referenced_in_current_location,\r\n expression.range\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n /** Resolves a super expression to the program element it refers to. */\r\n resolveSuperExpression(\r\n /** The expression to resolve. */\r\n expression: SuperExpression,\r\n /** Current flow. */\r\n flow: Flow,\r\n /** Current contextual type. */\r\n contextualType: Type = Type.void,\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Element | null {\r\n if (flow.is(FlowFlags.INLINE_CONTEXT)) {\r\n let superLocal = flow.lookupLocal(CommonSymbols.super_);\r\n if (superLocal) {\r\n this.currentThisExpression = null;\r\n this.currentElementExpression = null;\r\n return superLocal;\r\n }\r\n }\r\n var parent: Element | null = flow.actualFunction.parent;\r\n if (parent && parent.kind == ElementKind.CLASS && (parent = (parent).base)) {\r\n this.currentThisExpression = null;\r\n this.currentElementExpression = null;\r\n return parent;\r\n }\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode._super_can_only_be_referenced_in_a_derived_class,\r\n expression.range\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n /** Resolves a literal expression to the program element it refers to. */\r\n resolveLiteralExpression(\r\n /** The expression to resolve. */\r\n expression: LiteralExpression,\r\n /** Current flow. */\r\n flow: Flow,\r\n /** Current contextual type. */\r\n contextualType: Type = Type.void,\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Element | null {\r\n switch (expression.literalKind) {\r\n case LiteralKind.INTEGER: {\r\n this.currentThisExpression = expression;\r\n this.currentElementExpression = null;\r\n let literalType = this.determineIntegerLiteralType(\r\n (expression).value,\r\n contextualType\r\n );\r\n let typeClasses = this.program.typeClasses;\r\n return typeClasses.has(literalType.kind) ? typeClasses.get(literalType.kind)! : null;\r\n }\r\n case LiteralKind.FLOAT: {\r\n this.currentThisExpression = expression;\r\n this.currentElementExpression = null;\r\n let literalType = contextualType == Type.f32 ? Type.f32 : Type.f64;\r\n let typeClasses = this.program.typeClasses;\r\n return typeClasses.has(literalType.kind) ? typeClasses.get(literalType.kind)! : null;\r\n }\r\n case LiteralKind.STRING: {\r\n this.currentThisExpression = expression;\r\n this.currentElementExpression = null;\r\n return this.program.stringInstance;\r\n }\r\n // TODO\r\n // case LiteralKind.ARRAY:\r\n }\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n /** Resolves a call expression to the program element it refers to. */\r\n resolveCallExpression(\r\n /** The expression to resolve. */\r\n expression: CallExpression,\r\n /** Current flow. */\r\n flow: Flow,\r\n /** Current contextual type. */\r\n contextualType: Type = Type.void,\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Element | null {\r\n var targetExpression = expression.expression;\r\n var target = this.resolveExpression( // reports\r\n targetExpression,\r\n flow,\r\n contextualType,\r\n reportMode\r\n );\r\n if (!target) return null;\r\n if (target.kind == ElementKind.FUNCTION_PROTOTYPE) {\r\n let instance = this.resolveFunctionInclTypeArguments(\r\n target,\r\n expression.typeArguments,\r\n flow.actualFunction,\r\n makeMap(flow.contextualTypeArguments), // don't inherit\r\n expression,\r\n reportMode\r\n );\r\n if (!instance) return null;\r\n let returnType = instance.signature.returnType;\r\n let classType = returnType.classReference;\r\n if (classType) {\r\n // reuse resolvedThisExpression (might be property access)\r\n // reuse resolvedElementExpression (might be element access)\r\n return classType;\r\n } else {\r\n let signature = returnType.signatureReference;\r\n if (signature) {\r\n let functionTarget = signature.asFunctionTarget(this.program);\r\n // reuse resolvedThisExpression (might be property access)\r\n // reuse resolvedElementExpression (might be element access)\r\n return functionTarget;\r\n }\r\n }\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures,\r\n targetExpression.range, target.internalName\r\n );\r\n }\r\n return null;\r\n }\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n /** Resolves a function prototype using the specified concrete type arguments. */\r\n resolveFunction(\r\n /** The prototype of the function. */\r\n prototype: FunctionPrototype,\r\n /** Concrete type arguments. */\r\n typeArguments: Type[] | null,\r\n /** Type arguments inherited through context, i.e. `T`. */\r\n contextualTypeArguments: Map = makeMap(),\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Function | null {\r\n var actualParent = prototype.parent.kind == ElementKind.PROPERTY_PROTOTYPE\r\n ? prototype.parent.parent\r\n : prototype.parent;\r\n var classInstance: Class | null = null; // if an instance method\r\n var instanceKey = typeArguments ? typesToString(typeArguments) : \"\";\r\n\r\n // Instance method prototypes are pre-bound to their concrete class as their parent\r\n if (prototype.is(CommonFlags.INSTANCE)) {\r\n assert(actualParent.kind == ElementKind.CLASS);\r\n classInstance = actualParent;\r\n\r\n // check if this exact concrete class and function combination is known already\r\n let resolvedInstance = prototype.getResolvedInstance(instanceKey);\r\n if (resolvedInstance) return resolvedInstance;\r\n\r\n // inherit class specific type arguments\r\n let classTypeArguments = classInstance.typeArguments;\r\n if (classTypeArguments) {\r\n let classTypeParameters = assert(classInstance.prototype.typeParameterNodes);\r\n let numClassTypeArguments = classTypeParameters.length;\r\n assert(numClassTypeArguments == classTypeParameters.length);\r\n for (let i = 0; i < numClassTypeArguments; ++i) {\r\n let classTypeParameterName = classTypeParameters[i].name.text;\r\n if (!contextualTypeArguments.has(classTypeParameterName)) {\r\n contextualTypeArguments.set(\r\n classTypeParameterName,\r\n classTypeArguments[i]\r\n );\r\n }\r\n }\r\n }\r\n } else {\r\n assert(actualParent.kind != ElementKind.CLASS); // must not be pre-bound\r\n let resolvedInstance = prototype.getResolvedInstance(instanceKey);\r\n if (resolvedInstance) return resolvedInstance;\r\n }\r\n\r\n // override whatever is contextual with actual function type arguments\r\n var signatureNode = prototype.signatureNode;\r\n var typeParameterNodes = prototype.typeParameterNodes;\r\n var numFunctionTypeArguments: i32;\r\n if (typeArguments && (numFunctionTypeArguments = typeArguments.length)) {\r\n assert(typeParameterNodes && numFunctionTypeArguments == typeParameterNodes.length);\r\n for (let i = 0; i < numFunctionTypeArguments; ++i) {\r\n contextualTypeArguments.set(\r\n (typeParameterNodes)[i].name.text,\r\n typeArguments[i]\r\n );\r\n }\r\n } else {\r\n assert(!typeParameterNodes || typeParameterNodes.length == 0);\r\n }\r\n\r\n // resolve `this` type if applicable\r\n var thisType: Type | null = null;\r\n var explicitThisType = signatureNode.explicitThisType;\r\n if (explicitThisType) {\r\n thisType = this.resolveType(\r\n explicitThisType,\r\n prototype.parent, // relative to function\r\n contextualTypeArguments,\r\n reportMode\r\n );\r\n if (!thisType) return null;\r\n contextualTypeArguments.set(CommonSymbols.this_, thisType);\r\n } else if (classInstance) {\r\n thisType = classInstance.type;\r\n contextualTypeArguments.set(CommonSymbols.this_, thisType);\r\n }\r\n\r\n // resolve parameter types\r\n var signatureParameters = signatureNode.parameters;\r\n var numSignatureParameters = signatureParameters.length;\r\n var parameterTypes = new Array(numSignatureParameters);\r\n var parameterNames = new Array(numSignatureParameters);\r\n var requiredParameters = 0;\r\n for (let i = 0; i < numSignatureParameters; ++i) {\r\n let parameterDeclaration = signatureParameters[i];\r\n if (parameterDeclaration.parameterKind == ParameterKind.DEFAULT) {\r\n requiredParameters = i + 1;\r\n }\r\n let typeNode = parameterDeclaration.type;\r\n if (isTypeOmitted(typeNode)) {\r\n this.error(\r\n DiagnosticCode.Type_expected,\r\n typeNode.range\r\n );\r\n return null;\r\n }\r\n let parameterType = this.resolveType(\r\n typeNode,\r\n prototype.parent, // relative to function\r\n contextualTypeArguments,\r\n reportMode\r\n );\r\n if (!parameterType) return null;\r\n parameterTypes[i] = parameterType;\r\n parameterNames[i] = parameterDeclaration.name.text;\r\n }\r\n\r\n // resolve return type\r\n var returnType: Type;\r\n if (prototype.is(CommonFlags.SET)) {\r\n returnType = Type.void; // not annotated\r\n } else if (prototype.is(CommonFlags.CONSTRUCTOR)) {\r\n returnType = assert(classInstance).type; // not annotated\r\n } else {\r\n let typeNode = signatureNode.returnType;\r\n if (isTypeOmitted(typeNode)) {\r\n this.error(\r\n DiagnosticCode.Type_expected,\r\n typeNode.range\r\n );\r\n return null;\r\n }\r\n let type = this.resolveType(\r\n typeNode,\r\n prototype.parent, // relative to function\r\n contextualTypeArguments,\r\n reportMode\r\n );\r\n if (!type) return null;\r\n returnType = type;\r\n }\r\n\r\n var signature = new Signature(parameterTypes, returnType, thisType);\r\n signature.parameterNames = parameterNames;\r\n signature.requiredParameters = requiredParameters;\r\n\r\n var nameInclTypeParameters = prototype.name;\r\n if (instanceKey.length) nameInclTypeParameters += \"<\" + instanceKey + \">\";\r\n var instance = new Function(\r\n nameInclTypeParameters,\r\n prototype,\r\n signature,\r\n contextualTypeArguments\r\n );\r\n prototype.setResolvedInstance(instanceKey, instance);\r\n return instance;\r\n }\r\n\r\n /** Resolves a function prototypeby first resolving the specified type arguments. */\r\n resolveFunctionInclTypeArguments(\r\n /** The prototype of the function. */\r\n prototype: FunctionPrototype,\r\n /** Type arguments provided. */\r\n typeArgumentNodes: CommonTypeNode[] | null,\r\n /** Relative context. Type arguments are resolved from here. */\r\n context: Element,\r\n /** Type arguments inherited through context, i.e. `T`. */\r\n contextualTypeArguments: Map,\r\n /** The node to use when reporting intermediate errors. */\r\n reportNode: Node,\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Function | null {\r\n var actualParent = prototype.parent.kind == ElementKind.PROPERTY_PROTOTYPE\r\n ? prototype.parent.parent\r\n : prototype.parent;\r\n var resolvedTypeArguments: Type[] | null = null;\r\n\r\n // Resolve type arguments if generic\r\n if (prototype.is(CommonFlags.GENERIC)) {\r\n\r\n // If this is an instance method, first apply the class's type arguments\r\n if (prototype.is(CommonFlags.INSTANCE)) {\r\n assert(actualParent.kind == ElementKind.CLASS);\r\n let classTypeArguments = (actualParent).typeArguments;\r\n if (classTypeArguments) {\r\n let typeParameterNodes = assert((actualParent).prototype.typeParameterNodes);\r\n let numClassTypeArguments = classTypeArguments.length;\r\n assert(numClassTypeArguments == typeParameterNodes.length);\r\n for (let i = 0; i < numClassTypeArguments; ++i) {\r\n contextualTypeArguments.set(\r\n typeParameterNodes[i].name.text,\r\n classTypeArguments[i]\r\n );\r\n }\r\n }\r\n }\r\n\r\n resolvedTypeArguments = this.resolveTypeArguments( // reports\r\n assert(prototype.typeParameterNodes),\r\n typeArgumentNodes,\r\n context,\r\n contextualTypeArguments,\r\n reportNode,\r\n reportMode\r\n );\r\n if (!resolvedTypeArguments) return null;\r\n\r\n // Otherwise make sure that no type arguments have been specified\r\n } else {\r\n if (typeArgumentNodes !== null && typeArgumentNodes.length) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n return null;\r\n }\r\n }\r\n\r\n // Continue with concrete types\r\n return this.resolveFunction(\r\n prototype,\r\n resolvedTypeArguments,\r\n contextualTypeArguments,\r\n reportMode\r\n );\r\n }\r\n\r\n /** Resolves a class prototype using the specified concrete type arguments. */\r\n resolveClass(\r\n /** The prototype of the class. */\r\n prototype: ClassPrototype,\r\n /** Concrete type arguments. */\r\n typeArguments: Type[] | null,\r\n /** Type arguments inherited through context, i.e. `T`. */\r\n contextualTypeArguments: Map = makeMap(),\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Class | null {\r\n var instanceKey = typeArguments ? typesToString(typeArguments) : \"\";\r\n\r\n // Check if this exact instance has already been resolved\r\n var instance = prototype.getResolvedInstance(instanceKey);\r\n if (instance) return instance;\r\n\r\n // Insert contextual type arguments for this operation. Internally, this method is always\r\n // called with matching type parameter / argument counts.\r\n if (typeArguments) {\r\n let typeParameterNodes = assert(prototype.typeParameterNodes);\r\n let numTypeParameters = typeParameterNodes.length;\r\n let numTypeArguments = typeArguments.length;\r\n assert(numTypeArguments == numTypeParameters);\r\n for (let i = 0; i < numTypeArguments; ++i) {\r\n contextualTypeArguments.set(typeParameterNodes[i].name.text, typeArguments[i]);\r\n }\r\n } else {\r\n let typeParameterNodes = prototype.typeParameterNodes;\r\n assert(!(typeParameterNodes && typeParameterNodes.length));\r\n }\r\n\r\n // Resolve base class if applicable\r\n var basePrototype = prototype.basePrototype;\r\n var baseClass: Class | null = null;\r\n if (basePrototype) {\r\n let extendsNode = assert(prototype.extendsNode); // must be present if it has a base prototype\r\n baseClass = this.resolveClassInclTypeArguments(\r\n basePrototype,\r\n extendsNode.typeArguments,\r\n prototype.parent, // relative to derived class\r\n makeMap(contextualTypeArguments), // don't inherit\r\n extendsNode,\r\n reportMode\r\n );\r\n if (!baseClass) return null;\r\n }\r\n\r\n // Construct the instance and remember that it has been resolved already\r\n var nameInclTypeParamters = prototype.name;\r\n if (instanceKey.length) nameInclTypeParamters += \"<\" + instanceKey + \">\";\r\n instance = new Class(nameInclTypeParamters, prototype, typeArguments, baseClass);\r\n instance.contextualTypeArguments = contextualTypeArguments;\r\n prototype.setResolvedInstance(instanceKey, instance);\r\n\r\n // Inherit base class members and set up the initial memory offset for own fields\r\n var memoryOffset: u32 = 0;\r\n if (baseClass) {\r\n let baseMembers = baseClass.members;\r\n if (baseMembers) {\r\n let instanceMembers = instance.members;\r\n if (!instanceMembers) instance.members = instanceMembers = new Map();\r\n for (let [baseMemberName, baseMember] of baseMembers) {\r\n instanceMembers.set(baseMemberName, baseMember);\r\n }\r\n }\r\n memoryOffset = baseClass.currentMemoryOffset;\r\n }\r\n\r\n // Resolve instance members\r\n var instanceMemberPrototypes = prototype.instanceMembers;\r\n if (instanceMemberPrototypes) {\r\n for (let member of instanceMemberPrototypes.values()) {\r\n switch (member.kind) {\r\n\r\n // Lay out fields in advance\r\n case ElementKind.FIELD_PROTOTYPE: {\r\n let instanceMembers = instance.members;\r\n if (!instanceMembers) instance.members = instanceMembers = new Map();\r\n else if (instanceMembers.has(member.name)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n (member).identifierNode.range,\r\n member.name\r\n );\r\n break;\r\n }\r\n let fieldTypeNode = (member).typeNode;\r\n let fieldType: Type | null = null;\r\n // TODO: handle duplicate non-private fields specifically?\r\n if (!fieldTypeNode) {\r\n if (baseClass) {\r\n let baseMembers = baseClass.members;\r\n if (baseMembers && baseMembers.has((member).name)) {\r\n let baseField = baseMembers.get((member).name)!;\r\n if (!baseField.is(CommonFlags.PRIVATE)) {\r\n assert(baseField.kind == ElementKind.FIELD);\r\n fieldType = (baseField).type;\r\n }\r\n }\r\n }\r\n if (!fieldType) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Type_expected,\r\n (member).identifierNode.range.atEnd\r\n );\r\n }\r\n }\r\n } else {\r\n fieldType = this.resolveType(\r\n fieldTypeNode,\r\n prototype.parent, // relative to class\r\n instance.contextualTypeArguments,\r\n reportMode\r\n );\r\n }\r\n if (!fieldType) break; // did report above\r\n let fieldInstance = new Field(member, instance, fieldType);\r\n assert(isPowerOf2(fieldType.byteSize));\r\n let mask = fieldType.byteSize - 1;\r\n if (memoryOffset & mask) memoryOffset = (memoryOffset | mask) + 1;\r\n fieldInstance.memoryOffset = memoryOffset;\r\n memoryOffset += fieldType.byteSize;\r\n instance.add(member.name, fieldInstance); // reports\r\n break;\r\n }\r\n case ElementKind.FUNCTION_PROTOTYPE: {\r\n let boundPrototype = (member).toBound(instance);\r\n instance.add(boundPrototype.name, boundPrototype); // reports\r\n break;\r\n }\r\n case ElementKind.PROPERTY_PROTOTYPE: {\r\n let propertyInstance = new Property(member, instance);\r\n let getterPrototype = (member).getterPrototype;\r\n if (getterPrototype) {\r\n let getterInstance = this.resolveFunction(\r\n getterPrototype.toBound(instance),\r\n null,\r\n makeMap(instance.contextualTypeArguments),\r\n reportMode\r\n );\r\n if (getterInstance) {\r\n propertyInstance.getterInstance = getterInstance;\r\n propertyInstance.setType(getterInstance.signature.returnType);\r\n }\r\n }\r\n let setterPrototype = (member).setterPrototype;\r\n if (setterPrototype) {\r\n let setterInstance = this.resolveFunction(\r\n setterPrototype.toBound(instance),\r\n null,\r\n makeMap(instance.contextualTypeArguments),\r\n reportMode\r\n );\r\n if (setterInstance) {\r\n propertyInstance.setterInstance = setterInstance;\r\n if (!propertyInstance.is(CommonFlags.RESOLVED)) {\r\n assert(setterInstance.signature.parameterTypes.length == 1);\r\n propertyInstance.setType(setterInstance.signature.parameterTypes[0]);\r\n }\r\n }\r\n }\r\n instance.add(propertyInstance.name, propertyInstance); // reports\r\n break;\r\n }\r\n default: assert(false);\r\n }\r\n }\r\n }\r\n\r\n // Finalize memory offset\r\n instance.currentMemoryOffset = memoryOffset;\r\n\r\n // Link _own_ constructor if present\r\n {\r\n let ctorPrototype = instance.lookupInSelf(CommonSymbols.constructor);\r\n if (ctorPrototype && ctorPrototype.parent === instance) {\r\n assert(ctorPrototype.kind == ElementKind.FUNCTION_PROTOTYPE);\r\n let ctorInstance = this.resolveFunction(\r\n ctorPrototype,\r\n null,\r\n instance.contextualTypeArguments,\r\n reportMode\r\n );\r\n if (ctorInstance) instance.constructorInstance = ctorInstance;\r\n }\r\n }\r\n\r\n // Fully resolve operator overloads (don't have type parameters on their own)\r\n for (let [kind, overloadPrototype] of prototype.overloadPrototypes) {\r\n assert(kind != OperatorKind.INVALID);\r\n let operatorInstance: Function | null;\r\n if (overloadPrototype.is(CommonFlags.INSTANCE)) {\r\n let boundPrototype = overloadPrototype.toBound(instance);\r\n operatorInstance = this.resolveFunction(\r\n boundPrototype,\r\n null,\r\n makeMap(),\r\n reportMode\r\n );\r\n } else {\r\n operatorInstance = this.resolveFunction(\r\n overloadPrototype,\r\n null,\r\n makeMap(),\r\n reportMode\r\n );\r\n }\r\n if (!operatorInstance) continue;\r\n let overloads = instance.overloads;\r\n if (!overloads) instance.overloads = overloads = new Map();\r\n overloads.set(kind, operatorInstance);\r\n }\r\n return instance;\r\n }\r\n\r\n /** Resolves a class prototype by first resolving the specified type arguments. */\r\n resolveClassInclTypeArguments(\r\n /** The prototype of the class. */\r\n prototype: ClassPrototype,\r\n /** Type argument nodes provided. */\r\n typeArgumentNodes: CommonTypeNode[] | null,\r\n /** Relative context. Type arguments are resolved from here. */\r\n context: Element,\r\n /** Type arguments inherited through context, i.e. `T`. */\r\n contextualTypeArguments: Map,\r\n /** The node to use when reporting intermediate errors. */\r\n reportNode: Node,\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Class | null {\r\n var resolvedTypeArguments: Type[] | null = null;\r\n\r\n // Resolve type arguments if generic\r\n if (prototype.is(CommonFlags.GENERIC)) {\r\n resolvedTypeArguments = this.resolveTypeArguments( // reports\r\n assert(prototype.typeParameterNodes), // must be present if generic\r\n typeArgumentNodes,\r\n context,\r\n contextualTypeArguments,\r\n reportNode,\r\n reportMode\r\n );\r\n if (!resolvedTypeArguments) return null;\r\n\r\n // Otherwise make sure that no type arguments have been specified\r\n } else {\r\n if (typeArgumentNodes !== null && typeArgumentNodes.length) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n return null;\r\n }\r\n }\r\n\r\n // Continue with concrete types\r\n return this.resolveClass(\r\n prototype,\r\n resolvedTypeArguments,\r\n contextualTypeArguments,\r\n reportMode\r\n );\r\n }\r\n}\r\n","/**\r\n * The AssemblyScript compiler.\r\n * @module compiler\r\n *//***/\r\n\r\nimport {\r\n compileCall as compileBuiltinCall,\r\n compileAbort,\r\n compileIterateRoots,\r\n ensureGCHook,\r\n BuiltinSymbols\r\n} from \"./builtins\";\r\n\r\nimport {\r\n DiagnosticCode,\r\n DiagnosticEmitter\r\n} from \"./diagnostics\";\r\n\r\nimport {\r\n Module,\r\n MemorySegment,\r\n ExpressionRef,\r\n UnaryOp,\r\n BinaryOp,\r\n NativeType,\r\n FunctionRef,\r\n ExpressionId,\r\n FunctionTypeRef,\r\n GlobalRef,\r\n getExpressionId,\r\n getExpressionType,\r\n getConstValueI32,\r\n getConstValueI64Low,\r\n getConstValueI64High,\r\n getConstValueF32,\r\n getConstValueF64,\r\n getBlockChildCount,\r\n getBlockChild,\r\n getBlockName,\r\n needsExplicitUnreachable\r\n} from \"./module\";\r\n\r\nimport {\r\n CommonFlags,\r\n INSTANCE_DELIMITER,\r\n STATIC_DELIMITER,\r\n GETTER_PREFIX,\r\n SETTER_PREFIX,\r\n LibrarySymbols,\r\n CommonSymbols,\r\n INDEX_SUFFIX\r\n} from \"./common\";\r\n\r\nimport {\r\n Program,\r\n ClassPrototype,\r\n Class,\r\n Element,\r\n ElementKind,\r\n Enum,\r\n Field,\r\n FunctionPrototype,\r\n Function,\r\n FunctionTarget,\r\n Global,\r\n Local,\r\n EnumValue,\r\n Property,\r\n VariableLikeElement,\r\n ConstantValueKind,\r\n OperatorKind,\r\n DecoratorFlags,\r\n PropertyPrototype,\r\n File,\r\n mangleInternalName\r\n} from \"./program\";\r\n\r\nimport {\r\n FlowFlags,\r\n Flow\r\n} from \"./flow\";\r\n\r\nimport {\r\n Resolver, ReportMode\r\n} from \"./resolver\";\r\n\r\nimport {\r\n Token,\r\n operatorTokenToString\r\n} from \"./tokenizer\";\r\n\r\nimport {\r\n Node,\r\n NodeKind,\r\n TypeNode,\r\n Range,\r\n DecoratorKind,\r\n AssertionKind,\r\n\r\n Statement,\r\n BlockStatement,\r\n BreakStatement,\r\n ClassDeclaration,\r\n ContinueStatement,\r\n DeclarationStatement,\r\n DoStatement,\r\n EmptyStatement,\r\n EnumDeclaration,\r\n ExportStatement,\r\n ExpressionStatement,\r\n FieldDeclaration,\r\n ForStatement,\r\n FunctionDeclaration,\r\n IfStatement,\r\n ImportStatement,\r\n InstanceOfExpression,\r\n InterfaceDeclaration,\r\n NamespaceDeclaration,\r\n ReturnStatement,\r\n SwitchStatement,\r\n ThrowStatement,\r\n TryStatement,\r\n VariableStatement,\r\n VoidStatement,\r\n WhileStatement,\r\n\r\n Expression,\r\n AssertionExpression,\r\n BinaryExpression,\r\n CallExpression,\r\n CommaExpression,\r\n ElementAccessExpression,\r\n FloatLiteralExpression,\r\n FunctionExpression,\r\n IdentifierExpression,\r\n IntegerLiteralExpression,\r\n LiteralExpression,\r\n LiteralKind,\r\n NewExpression,\r\n ObjectLiteralExpression,\r\n ParenthesizedExpression,\r\n PropertyAccessExpression,\r\n TernaryExpression,\r\n ArrayLiteralExpression,\r\n StringLiteralExpression,\r\n UnaryPostfixExpression,\r\n UnaryPrefixExpression,\r\n\r\n nodeIsConstantValue,\r\n findDecorator,\r\n isTypeOmitted\r\n} from \"./ast\";\r\n\r\nimport {\r\n Type,\r\n TypeKind,\r\n TypeFlags,\r\n Signature,\r\n\r\n typesToNativeTypes\r\n} from \"./types\";\r\n\r\nimport {\r\n writeI8,\r\n writeI16,\r\n writeI32,\r\n writeI64,\r\n writeF32,\r\n writeF64,\r\n makeMap\r\n} from \"./util\";\r\n\r\n/** Compilation target. */\r\nexport enum Target {\r\n /** WebAssembly with 32-bit pointers. */\r\n WASM32,\r\n /** WebAssembly with 64-bit pointers. Experimental and not supported by any runtime yet. */\r\n WASM64\r\n}\r\n\r\n/** Compiler options. */\r\nexport class Options {\r\n\r\n /** WebAssembly target. Defaults to {@link Target.WASM32}. */\r\n target: Target = Target.WASM32;\r\n /** If true, replaces assertions with nops. */\r\n noAssert: bool = false;\r\n /** If true, imports the memory provided by the embedder. */\r\n importMemory: bool = false;\r\n /** If greater than zero, declare memory as shared by setting max memory to sharedMemory. */\r\n sharedMemory: i32 = 0;\r\n /** If true, imports the function table provided by the embedder. */\r\n importTable: bool = false;\r\n /** If true, generates information necessary for source maps. */\r\n sourceMap: bool = false;\r\n /** Static memory start offset. */\r\n memoryBase: i32 = 0;\r\n /** Global aliases. */\r\n globalAliases: Map | null = null;\r\n /** Additional features to activate. */\r\n features: Feature = Feature.NONE;\r\n\r\n /** Hinted optimize level. Not applied by the compiler itself. */\r\n optimizeLevelHint: i32 = 0;\r\n /** Hinted shrink level. Not applied by the compiler itself. */\r\n shrinkLevelHint: i32 = 0;\r\n\r\n /** Tests if the target is WASM64 or, otherwise, WASM32. */\r\n get isWasm64(): bool {\r\n return this.target == Target.WASM64;\r\n }\r\n\r\n /** Gets the unsigned size type matching the target. */\r\n get usizeType(): Type {\r\n return this.target == Target.WASM64 ? Type.usize64 : Type.usize32;\r\n }\r\n\r\n /** Gets the signed size type matching the target. */\r\n get isizeType(): Type {\r\n return this.target == Target.WASM64 ? Type.isize64 : Type.isize32;\r\n }\r\n\r\n /** Gets the native size type matching the target. */\r\n get nativeSizeType(): NativeType {\r\n return this.target == Target.WASM64 ? NativeType.I64 : NativeType.I32;\r\n }\r\n\r\n /** Tests if a specific feature is activated. */\r\n hasFeature(feature: Feature): bool {\r\n return (this.features & feature) != 0;\r\n }\r\n}\r\n\r\n/** Indicates specific features to activate. */\r\nexport const enum Feature {\r\n /** No additional features. */\r\n NONE = 0,\r\n /** Sign extension operations. */\r\n SIGN_EXTENSION = 1 << 0, // see: https://github.com/WebAssembly/sign-extension-ops\r\n /** Mutable global imports and exports. */\r\n MUTABLE_GLOBAL = 1 << 1, // see: https://github.com/WebAssembly/mutable-global\r\n /** Bulk memory operations. */\r\n BULK_MEMORY = 1 << 2, // see: https://github.com/WebAssembly/bulk-memory-operations\r\n /** SIMD types and operations. */\r\n SIMD = 1 << 3, // see: https://github.com/WebAssembly/simd\r\n /** Threading and atomic operations. */\r\n THREADS = 1 << 4 // see: https://github.com/WebAssembly/threads\r\n}\r\n\r\n/** Indicates the desired kind of a conversion. */\r\nexport const enum ConversionKind {\r\n /** No conversion. */\r\n NONE,\r\n /** Implicit conversion. */\r\n IMPLICIT,\r\n /** Explicit conversion. */\r\n EXPLICIT\r\n}\r\n\r\n/** Indicates the desired wrap mode of a conversion. */\r\nexport const enum WrapMode {\r\n /** No wrapping. */\r\n NONE,\r\n /** Wrap small integer values. */\r\n WRAP\r\n}\r\n\r\n/** Compiler interface. */\r\nexport class Compiler extends DiagnosticEmitter {\r\n\r\n /** Program reference. */\r\n program: Program;\r\n /** Resolver reference. */\r\n resolver: Resolver;\r\n /** Provided options. */\r\n options: Options;\r\n /** Module instance being compiled. */\r\n module: Module;\r\n /** Current control flow. */\r\n currentFlow: Flow;\r\n /** Current inline functions stack. */\r\n currentInlineFunctions: Function[] = [];\r\n /** Current enum in compilation. */\r\n currentEnum: Enum | null = null;\r\n /** Current type in compilation. */\r\n currentType: Type = Type.void;\r\n /** Start function statements. */\r\n currentBody: ExpressionRef[];\r\n /** Counting memory offset. */\r\n memoryOffset: I64;\r\n /** Memory segments being compiled. */\r\n memorySegments: MemorySegment[] = [];\r\n /** Map of already compiled static string segments. */\r\n stringSegments: Map = new Map();\r\n /** Function table being compiled. */\r\n functionTable: string[] = [ \"null\" ];\r\n /** Argument count helper global. */\r\n argcVar: GlobalRef = 0;\r\n /** Argument count helper setter. */\r\n argcSet: FunctionRef = 0;\r\n /** Indicates whether the iterateRoots function must be generated. */\r\n needsIterateRoots: bool = false;\r\n\r\n /** Compiles a {@link Program} to a {@link Module} using the specified options. */\r\n static compile(program: Program, options: Options | null = null): Module {\r\n return new Compiler(program, options).compile();\r\n }\r\n\r\n /** Constructs a new compiler for a {@link Program} using the specified options. */\r\n constructor(program: Program, options: Options | null = null) {\r\n super(program.diagnostics);\r\n this.program = program;\r\n this.resolver = program.resolver;\r\n if (!options) options = new Options();\r\n this.options = options;\r\n this.memoryOffset = i64_new(\r\n // leave space for `null`. also functions as a sentinel for erroneous stores at offset 0.\r\n // note that Binaryen's asm.js output utilizes the first 8 bytes for reinterpretations (#1547)\r\n max(options.memoryBase, 8)\r\n );\r\n this.module = Module.create();\r\n }\r\n\r\n /** Performs compilation of the underlying {@link Program} to a {@link Module}. */\r\n compile(): Module {\r\n var options = this.options;\r\n var module = this.module;\r\n var program = this.program;\r\n\r\n // initialize lookup maps, built-ins, imports, exports, etc.\r\n program.initialize(options);\r\n\r\n // set up the main start function\r\n var startFunctionInstance = program.makeNativeFunction(\"start\", new Signature([], Type.void));\r\n startFunctionInstance.internalName = \"start\";\r\n var startFunctionBody = new Array();\r\n this.currentFlow = startFunctionInstance.flow;\r\n this.currentBody = startFunctionBody;\r\n\r\n // add a mutable heap base dummy\r\n if (options.isWasm64) {\r\n module.addGlobal(\r\n BuiltinSymbols.HEAP_BASE,\r\n NativeType.I64,\r\n true,\r\n module.createI64(0, 0)\r\n );\r\n } else {\r\n module.addGlobal(\r\n BuiltinSymbols.HEAP_BASE,\r\n NativeType.I32,\r\n false,\r\n module.createI32(0)\r\n );\r\n }\r\n\r\n // compile entry file(s) while traversing reachable elements\r\n var files = program.filesByName;\r\n for (let file of files.values()) {\r\n if (file.source.isEntry) {\r\n this.compileFile(file);\r\n this.compileExports(file);\r\n }\r\n }\r\n\r\n // compile the start function if not empty or called by main\r\n var explicitStartFunction = program.explicitStartFunction;\r\n if (startFunctionBody.length || explicitStartFunction) {\r\n let signature = startFunctionInstance.signature;\r\n let funcRef = module.addFunction(\r\n startFunctionInstance.internalName,\r\n this.ensureFunctionType(\r\n signature.parameterTypes,\r\n signature.returnType,\r\n signature.thisType\r\n ),\r\n typesToNativeTypes(startFunctionInstance.additionalLocals),\r\n module.createBlock(null, startFunctionBody)\r\n );\r\n startFunctionInstance.finalize(module, funcRef);\r\n if (!explicitStartFunction) module.setStart(funcRef);\r\n }\r\n\r\n // update the heap base pointer\r\n var memoryOffset = this.memoryOffset;\r\n memoryOffset = i64_align(memoryOffset, options.usizeType.byteSize);\r\n this.memoryOffset = memoryOffset;\r\n module.removeGlobal(BuiltinSymbols.HEAP_BASE);\r\n if (options.isWasm64) {\r\n module.addGlobal(\r\n BuiltinSymbols.HEAP_BASE,\r\n NativeType.I64,\r\n false,\r\n module.createI64(i64_low(memoryOffset), i64_high(memoryOffset))\r\n );\r\n } else {\r\n module.addGlobal(\r\n BuiltinSymbols.HEAP_BASE,\r\n NativeType.I32,\r\n false,\r\n module.createI32(i64_low(memoryOffset))\r\n );\r\n }\r\n\r\n // set up memory\r\n var isSharedMemory = options.hasFeature(Feature.THREADS) && options.sharedMemory > 0;\r\n module.setMemory(\r\n this.options.memoryBase /* is specified */ || this.memorySegments.length\r\n ? i64_low(i64_shr_u(i64_align(memoryOffset, 0x10000), i64_new(16, 0)))\r\n : 0,\r\n isSharedMemory ? options.sharedMemory : Module.UNLIMITED_MEMORY,\r\n this.memorySegments,\r\n options.target,\r\n \"memory\",\r\n isSharedMemory\r\n );\r\n\r\n // import memory if requested (default memory is named '0' by Binaryen)\r\n if (options.importMemory) module.addMemoryImport(\"0\", \"env\", \"memory\", isSharedMemory);\r\n\r\n // set up function table\r\n var functionTable = this.functionTable;\r\n module.setFunctionTable(functionTable.length, 0xffffffff, functionTable);\r\n module.addTableExport(\"0\", \"table\");\r\n module.addFunction(\"null\", this.ensureFunctionType(null, Type.void), null, module.createBlock(null, []));\r\n\r\n // import table if requested (default table is named '0' by Binaryen)\r\n if (options.importTable) module.addTableImport(\"0\", \"env\", \"table\");\r\n\r\n // set up module exports\r\n for (let file of this.program.filesByName.values()) {\r\n if (file.source.isEntry) this.makeModuleExports(file);\r\n }\r\n\r\n // set up gc\r\n if (this.needsIterateRoots) compileIterateRoots(this);\r\n\r\n return module;\r\n }\r\n\r\n /** Applies the respective module exports for the specified file. */\r\n private makeModuleExports(file: File): void {\r\n var members = file.exports;\r\n if (members) for (let [name, member] of members) this.makeModuleExport(name, member);\r\n var exportsStar = file.exportsStar;\r\n if (exportsStar) {\r\n for (let i = 0, k = exportsStar.length; i < k; ++i) this.makeModuleExports(exportsStar[i]);\r\n }\r\n }\r\n\r\n /** Applies the respective module export(s) for the specified element. */\r\n private makeModuleExport(name: string, element: Element, prefix: string = \"\"): void {\r\n switch (element.kind) {\r\n\r\n // traverse instances\r\n case ElementKind.FUNCTION_PROTOTYPE: {\r\n let instances = (element).instances;\r\n if (instances) {\r\n for (let instance of instances.values()) {\r\n let instanceName = name;\r\n if (instance.is(CommonFlags.GENERIC)) {\r\n let fullName = instance.internalName;\r\n instanceName += fullName.substring(fullName.lastIndexOf(\"<\"));\r\n }\r\n this.makeModuleExport(instanceName, instance, prefix);\r\n }\r\n }\r\n break;\r\n }\r\n case ElementKind.CLASS_PROTOTYPE: {\r\n let instances = (element).instances;\r\n if (instances) {\r\n for (let instance of instances.values()) {\r\n let instanceName = name;\r\n if (instance.is(CommonFlags.GENERIC)) {\r\n let fullName = instance.internalName;\r\n instanceName += fullName.substring(fullName.lastIndexOf(\"<\"));\r\n }\r\n this.makeModuleExport(instanceName, instance, prefix);\r\n }\r\n }\r\n break;\r\n }\r\n case ElementKind.PROPERTY_PROTOTYPE: {\r\n let getter = (element).getterPrototype;\r\n let setter = (element).setterPrototype;\r\n if (getter) this.makeModuleExport(GETTER_PREFIX + name, getter, prefix);\r\n if (setter) this.makeModuleExport(SETTER_PREFIX + name, setter, prefix);\r\n break;\r\n }\r\n\r\n // export concrete elements\r\n case ElementKind.GLOBAL: {\r\n let isConst = element.is(CommonFlags.CONST) || element.is(CommonFlags.STATIC | CommonFlags.READONLY);\r\n if (!isConst && !this.options.hasFeature(Feature.MUTABLE_GLOBAL)) {\r\n this.error(\r\n DiagnosticCode.Cannot_export_a_mutable_global,\r\n (element).identifierNode.range\r\n );\r\n } else {\r\n this.module.addGlobalExport(element.internalName, prefix + name);\r\n }\r\n break;\r\n }\r\n case ElementKind.ENUMVALUE: {\r\n if (!(element).isImmutable && !this.options.hasFeature(Feature.MUTABLE_GLOBAL)) {\r\n this.error(\r\n DiagnosticCode.Cannot_export_a_mutable_global,\r\n (element).identifierNode.range\r\n );\r\n } else {\r\n this.module.addGlobalExport(element.internalName, prefix + name);\r\n }\r\n break;\r\n }\r\n case ElementKind.FUNCTION: {\r\n let instance = element;\r\n let signature = instance.signature;\r\n if (signature.requiredParameters < signature.parameterTypes.length) {\r\n // utilize trampoline to fill in omitted arguments\r\n instance = this.ensureTrampoline(instance);\r\n this.ensureArgcSet();\r\n }\r\n if (instance.is(CommonFlags.COMPILED)) this.module.addFunctionExport(instance.internalName, prefix + name);\r\n break;\r\n }\r\n case ElementKind.PROPERTY: {\r\n let getter = (element).getterInstance;\r\n if (getter) this.makeModuleExport(GETTER_PREFIX + name, getter, prefix);\r\n let setter = (element).setterInstance;\r\n if (setter) this.makeModuleExport(SETTER_PREFIX + name, setter, prefix);\r\n break;\r\n }\r\n case ElementKind.FIELD: {\r\n let module = this.module;\r\n let type = (element).type;\r\n let nativeType = type.toNativeType();\r\n let offset = (element).memoryOffset;\r\n let usizeType = this.options.usizeType;\r\n let nativeSizeType = this.options.nativeSizeType;\r\n\r\n // make a getter\r\n let getterName = prefix + GETTER_PREFIX + name;\r\n module.addFunction(\r\n getterName,\r\n this.ensureFunctionType(null, type, usizeType),\r\n null,\r\n module.createLoad(\r\n type.byteSize,\r\n type.is(TypeFlags.SIGNED),\r\n module.createGetLocal(0, nativeSizeType),\r\n nativeType,\r\n offset\r\n )\r\n );\r\n module.addFunctionExport(getterName, getterName);\r\n\r\n // make a setter\r\n if (!element.is(CommonFlags.READONLY)) {\r\n let setterName = prefix + SETTER_PREFIX + name;\r\n module.addFunction(\r\n setterName,\r\n this.ensureFunctionType([ type ], Type.void, usizeType),\r\n null,\r\n module.createStore(\r\n type.byteSize,\r\n module.createGetLocal(0, nativeSizeType),\r\n module.createGetLocal(1, nativeType),\r\n nativeType,\r\n offset\r\n )\r\n );\r\n module.addFunctionExport(setterName, setterName);\r\n }\r\n break;\r\n }\r\n\r\n // just traverse members below\r\n case ElementKind.ENUM:\r\n case ElementKind.CLASS:\r\n case ElementKind.NAMESPACE:\r\n case ElementKind.FILE:\r\n case ElementKind.TYPEDEFINITION: break;\r\n\r\n default: assert(false); // unexpected module export\r\n }\r\n\r\n // traverse members\r\n var members = element.members;\r\n if (members) {\r\n let subPrefix = prefix + name + (element.kind == ElementKind.CLASS\r\n ? INSTANCE_DELIMITER\r\n : STATIC_DELIMITER\r\n );\r\n if (\r\n element.kind == ElementKind.NAMESPACE ||\r\n element.kind == ElementKind.FILE\r\n ) {\r\n for (let member of members.values()) {\r\n if (!member.is(CommonFlags.EXPORT)) continue;\r\n this.makeModuleExport(member.name, member, subPrefix);\r\n }\r\n } else {\r\n for (let member of members.values()) {\r\n if (member.is(CommonFlags.PRIVATE)) continue;\r\n this.makeModuleExport(member.name, member, subPrefix);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // general\r\n\r\n /** Compiles any element. */\r\n compileElement(element: Element, compileMembers: bool = true): void {\r\n switch (element.kind) {\r\n case ElementKind.GLOBAL: {\r\n this.compileGlobal(element);\r\n break;\r\n }\r\n case ElementKind.ENUM: {\r\n this.compileEnum(element);\r\n break;\r\n }\r\n case ElementKind.FUNCTION_PROTOTYPE: {\r\n if (!element.is(CommonFlags.GENERIC)) {\r\n this.compileFunctionUsingTypeArguments(element, []);\r\n }\r\n break;\r\n }\r\n case ElementKind.CLASS_PROTOTYPE: {\r\n if (!element.is(CommonFlags.GENERIC)) {\r\n this.compileClassUsingTypeArguments(element, []);\r\n }\r\n break;\r\n }\r\n case ElementKind.PROPERTY_PROTOTYPE: {\r\n let getterPrototype = (element).getterPrototype;\r\n if (getterPrototype) {\r\n this.compileFunctionUsingTypeArguments(getterPrototype, []);\r\n }\r\n let setterPrototype = (element).setterPrototype;\r\n if (setterPrototype) {\r\n this.compileFunctionUsingTypeArguments(setterPrototype, []);\r\n }\r\n break;\r\n }\r\n case ElementKind.NAMESPACE:\r\n case ElementKind.TYPEDEFINITION:\r\n case ElementKind.ENUMVALUE: break;\r\n default: assert(false, ElementKind[element.kind]);\r\n }\r\n if (compileMembers) this.compileMembers(element);\r\n }\r\n\r\n /** Compiles an element's members. */\r\n compileMembers(element: Element): void {\r\n var members = element.members;\r\n if (members) for (let element of members.values()) this.compileElement(element);\r\n }\r\n\r\n /** Compiles a file's exports. */\r\n compileExports(file: File): void {\r\n var exports = file.exports;\r\n if (exports) for (let element of exports.values()) this.compileElement(element);\r\n var exportsStar = file.exportsStar;\r\n if (exportsStar) for (let exportStar of exportsStar) this.compileFile(exportStar);\r\n }\r\n\r\n // files\r\n\r\n /** Compiles the file matching the specified path. */\r\n compileFileByPath(normalizedPathWithoutExtension: string, reportNode: Node): void {\r\n var file: File;\r\n var filesByName = this.program.filesByName;\r\n var pathWithIndex: string;\r\n if (filesByName.has(normalizedPathWithoutExtension)) {\r\n file = filesByName.get(normalizedPathWithoutExtension)!;\r\n } else if (filesByName.has(pathWithIndex = normalizedPathWithoutExtension + INDEX_SUFFIX)) {\r\n file = filesByName.get(pathWithIndex)!;\r\n } else {\r\n this.error(\r\n DiagnosticCode.File_0_not_found,\r\n reportNode.range, normalizedPathWithoutExtension\r\n );\r\n return;\r\n }\r\n this.compileFile(file);\r\n }\r\n\r\n /** Compiles the specified file. */\r\n compileFile(file: File): void {\r\n if (file.is(CommonFlags.COMPILED)) return;\r\n file.set(CommonFlags.COMPILED);\r\n\r\n // compile top-level statements within the file's start function\r\n var startFunction = file.startFunction;\r\n var previousBody = this.currentBody;\r\n var startFunctionBody = new Array();\r\n this.currentBody = startFunctionBody;\r\n\r\n // compile top-level statements\r\n var previousFlow = this.currentFlow;\r\n this.currentFlow = startFunction.flow;\r\n for (let statements = file.source.statements, i = 0, k = statements.length; i < k; ++i) {\r\n this.compileTopLevelStatement(statements[i], startFunctionBody);\r\n }\r\n this.currentFlow = previousFlow;\r\n this.currentBody = previousBody;\r\n\r\n // if top-level statements are present, make the per-file start function and call it in start\r\n if (startFunctionBody.length) {\r\n let module = this.module;\r\n let locals = startFunction.localsByIndex;\r\n let numLocals = locals.length;\r\n let varTypes = new Array(numLocals);\r\n for (let i = 0; i < numLocals; ++i) varTypes[i] = locals[i].type.toNativeType();\r\n module.addFunction(\r\n startFunction.internalName,\r\n this.ensureFunctionType(startFunction.signature.parameterTypes, startFunction.signature.returnType),\r\n varTypes,\r\n startFunctionBody.length > 1\r\n ? module.createBlock(null, startFunctionBody)\r\n : startFunctionBody[0]\r\n );\r\n previousBody.push(\r\n module.createCall(startFunction.internalName, null, NativeType.None)\r\n );\r\n }\r\n }\r\n\r\n // globals\r\n\r\n compileGlobal(global: Global): bool {\r\n if (global.is(CommonFlags.COMPILED)) return true;\r\n global.set(CommonFlags.COMPILED);\r\n\r\n var module = this.module;\r\n var initExpr: ExpressionRef = 0;\r\n var typeNode = global.typeNode;\r\n var initializerNode = global.initializerNode;\r\n\r\n if (!global.is(CommonFlags.RESOLVED)) {\r\n\r\n // resolve now if annotated\r\n if (typeNode) {\r\n let resolvedType = this.resolver.resolveType(typeNode, global.parent); // reports\r\n if (!resolvedType) return false;\r\n if (resolvedType == Type.void) {\r\n this.error(\r\n DiagnosticCode.Type_expected,\r\n typeNode.range\r\n );\r\n return false;\r\n }\r\n global.setType(resolvedType);\r\n\r\n // infer from initializer if not annotated\r\n } else if (initializerNode) { // infer type using void/NONE for literal inference\r\n let previousFlow = this.currentFlow;\r\n if (global.hasDecorator(DecoratorFlags.LAZY)) {\r\n this.currentFlow = global.file.startFunction.flow;\r\n }\r\n initExpr = this.compileExpressionRetainType( // reports\r\n initializerNode,\r\n Type.void,\r\n WrapMode.WRAP\r\n );\r\n this.currentFlow = previousFlow;\r\n if (this.currentType == Type.void) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_assignable_to_type_1,\r\n initializerNode.range, this.currentType.toString(), \"\"\r\n );\r\n return false;\r\n }\r\n global.setType(this.currentType);\r\n\r\n // must either be annotated or have an initializer\r\n } else {\r\n this.error(\r\n DiagnosticCode.Type_expected,\r\n global.identifierNode.range.atEnd\r\n );\r\n return false;\r\n }\r\n }\r\n\r\n // ambient builtins like 'HEAP_BASE' need to be resolved but are added explicitly\r\n if (global.is(CommonFlags.AMBIENT) && global.hasDecorator(DecoratorFlags.BUILTIN)) return true;\r\n\r\n var nativeType = global.type.toNativeType();\r\n var isDeclaredConstant = global.is(CommonFlags.CONST) || global.is(CommonFlags.STATIC | CommonFlags.READONLY);\r\n\r\n // handle imports\r\n if (global.is(CommonFlags.AMBIENT)) {\r\n\r\n // constant global\r\n if (isDeclaredConstant || this.options.hasFeature(Feature.MUTABLE_GLOBAL)) {\r\n global.set(CommonFlags.MODULE_IMPORT);\r\n mangleImportName(global, global.declaration);\r\n module.addGlobalImport(\r\n global.internalName,\r\n mangleImportName_moduleName,\r\n mangleImportName_elementName,\r\n nativeType\r\n );\r\n global.set(CommonFlags.COMPILED);\r\n return true;\r\n\r\n // importing mutable globals is not supported in the MVP\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n global.declaration.range\r\n );\r\n }\r\n return false;\r\n }\r\n\r\n // the MVP does not yet support initializer expressions other than constant values (and constant\r\n // get_globals), hence such initializations must be performed in the start function for now.\r\n var initializeInStart = false;\r\n\r\n // evaluate initializer if present\r\n if (initializerNode) {\r\n if (!initExpr) {\r\n let previousFlow = this.currentFlow;\r\n if (global.hasDecorator(DecoratorFlags.LAZY)) {\r\n this.currentFlow = global.file.startFunction.flow;\r\n }\r\n initExpr = this.compileExpression(\r\n initializerNode,\r\n global.type,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.WRAP\r\n );\r\n this.currentFlow = previousFlow;\r\n }\r\n\r\n if (getExpressionId(initExpr) != ExpressionId.Const) {\r\n if (isDeclaredConstant) {\r\n initExpr = module.precomputeExpression(initExpr);\r\n if (getExpressionId(initExpr) != ExpressionId.Const) {\r\n this.warning(\r\n DiagnosticCode.Compiling_constant_with_non_constant_initializer_as_mutable,\r\n initializerNode.range\r\n );\r\n initializeInStart = true;\r\n }\r\n } else {\r\n initializeInStart = true;\r\n }\r\n }\r\n\r\n // explicitly inline if annotated\r\n if (global.hasDecorator(DecoratorFlags.INLINE)) {\r\n if (!initializeInStart) { // reported above\r\n assert(getExpressionId(initExpr) == ExpressionId.Const);\r\n let exprType = getExpressionType(initExpr);\r\n switch (exprType) {\r\n case NativeType.I32: {\r\n global.constantValueKind = ConstantValueKind.INTEGER;\r\n global.constantIntegerValue = i64_new(getConstValueI32(initExpr), 0);\r\n break;\r\n }\r\n case NativeType.I64: {\r\n global.constantValueKind = ConstantValueKind.INTEGER;\r\n global.constantIntegerValue = i64_new(\r\n getConstValueI64Low(initExpr),\r\n getConstValueI64High(initExpr)\r\n );\r\n break;\r\n }\r\n case NativeType.F32: {\r\n global.constantValueKind = ConstantValueKind.FLOAT;\r\n global.constantFloatValue = getConstValueF32(initExpr);\r\n break;\r\n }\r\n case NativeType.F64: {\r\n global.constantValueKind = ConstantValueKind.FLOAT;\r\n global.constantFloatValue = getConstValueF64(initExpr);\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n return false;\r\n }\r\n }\r\n global.set(CommonFlags.INLINED); // inline the value from now on\r\n }\r\n }\r\n\r\n // initialize to zero if there's no initializer\r\n } else {\r\n initExpr = global.type.toNativeZero(module);\r\n }\r\n\r\n var internalName = global.internalName;\r\n\r\n if (initializeInStart) { // initialize to mutable zero and set the actual value in start\r\n if (global.hasDecorator(DecoratorFlags.INLINE)) {\r\n this.error(\r\n DiagnosticCode.Decorator_0_is_not_valid_here,\r\n global.identifierNode.range, \"inline\"\r\n );\r\n }\r\n module.addGlobal(internalName, nativeType, true, global.type.toNativeZero(module));\r\n this.currentBody.push(module.createSetGlobal(internalName, initExpr));\r\n\r\n } else if (!global.hasDecorator(DecoratorFlags.INLINE)) { // compile normally\r\n module.addGlobal(internalName, nativeType, !isDeclaredConstant, initExpr);\r\n }\r\n return true;\r\n }\r\n\r\n // enums\r\n\r\n compileEnum(element: Enum): bool {\r\n if (element.is(CommonFlags.COMPILED)) return true;\r\n element.set(CommonFlags.COMPILED);\r\n\r\n var module = this.module;\r\n this.currentEnum = element;\r\n var previousValue: EnumValue | null = null;\r\n var previousValueIsMut = false;\r\n var isInline = element.is(CommonFlags.CONST) || element.hasDecorator(DecoratorFlags.INLINE);\r\n\r\n if (element.members) {\r\n for (let member of element.members.values()) {\r\n if (member.kind != ElementKind.ENUMVALUE) continue; // happens if an enum is also a namespace\r\n let initInStart = false;\r\n let val = member;\r\n let valueNode = val.valueNode;\r\n val.set(CommonFlags.COMPILED);\r\n let previousFlow = this.currentFlow;\r\n if (element.hasDecorator(DecoratorFlags.LAZY)) {\r\n this.currentFlow = element.file.startFunction.flow;\r\n }\r\n let initExpr: ExpressionRef;\r\n if (valueNode) {\r\n initExpr = this.compileExpression(\r\n valueNode,\r\n Type.i32,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n if (getExpressionId(initExpr) != ExpressionId.Const) {\r\n initExpr = module.precomputeExpression(initExpr);\r\n if (getExpressionId(initExpr) != ExpressionId.Const) {\r\n if (element.is(CommonFlags.CONST)) {\r\n this.error(\r\n DiagnosticCode.In_const_enum_declarations_member_initializer_must_be_constant_expression,\r\n valueNode.range\r\n );\r\n }\r\n initInStart = true;\r\n }\r\n }\r\n } else if (previousValue == null) {\r\n initExpr = module.createI32(0);\r\n } else {\r\n if (previousValueIsMut) {\r\n this.error(\r\n DiagnosticCode.Enum_member_must_have_initializer,\r\n (member).identifierNode.range.atEnd\r\n );\r\n }\r\n initExpr = module.createBinary(BinaryOp.AddI32,\r\n module.createGetGlobal(previousValue.internalName, NativeType.I32),\r\n module.createI32(1)\r\n );\r\n initExpr = module.precomputeExpression(initExpr);\r\n if (getExpressionId(initExpr) != ExpressionId.Const) {\r\n if (element.is(CommonFlags.CONST)) {\r\n this.error(\r\n DiagnosticCode.In_const_enum_declarations_member_initializer_must_be_constant_expression,\r\n member.declaration.range\r\n );\r\n }\r\n initInStart = true;\r\n }\r\n }\r\n this.currentFlow = previousFlow;\r\n if (initInStart) {\r\n module.addGlobal(val.internalName, NativeType.I32, true, module.createI32(0));\r\n this.currentBody.push(\r\n module.createSetGlobal(val.internalName, initExpr)\r\n );\r\n previousValueIsMut = true;\r\n } else {\r\n if (isInline) {\r\n val.setConstantIntegerValue(i64_new(getConstValueI32(initExpr)), Type.i32);\r\n if (val.is(CommonFlags.MODULE_EXPORT)) {\r\n module.addGlobal(val.internalName, NativeType.I32, false, initExpr);\r\n }\r\n } else {\r\n module.addGlobal(val.internalName, NativeType.I32, false, initExpr);\r\n }\r\n val.isImmutable = true;\r\n previousValueIsMut = false;\r\n }\r\n previousValue = val;\r\n }\r\n }\r\n this.currentEnum = null;\r\n return true;\r\n }\r\n\r\n // functions\r\n\r\n /** Resolves the specified type arguments prior to compiling the resulting function instance. */\r\n compileFunctionUsingTypeArguments(\r\n prototype: FunctionPrototype,\r\n typeArguments: TypeNode[],\r\n contextualTypeArguments: Map = makeMap(),\r\n alternativeReportNode: Node | null = null\r\n ): Function | null {\r\n if (prototype.hasDecorator(DecoratorFlags.BUILTIN)) return null;\r\n var instance = this.resolver.resolveFunctionInclTypeArguments(\r\n prototype,\r\n typeArguments,\r\n prototype.parent, // relative to itself\r\n contextualTypeArguments,\r\n alternativeReportNode || prototype.declaration\r\n );\r\n if (!instance) return null;\r\n if (!this.compileFunction(instance)) return null; // reports\r\n return instance;\r\n }\r\n\r\n /** Either reuses or creates the function type matching the specified signature. */\r\n ensureFunctionType(\r\n parameterTypes: Type[] | null,\r\n returnType: Type,\r\n thisType: Type | null = null\r\n ): FunctionTypeRef {\r\n var numParameters = parameterTypes ? parameterTypes.length : 0;\r\n var paramTypes: NativeType[];\r\n var index = 0;\r\n if (thisType) {\r\n paramTypes = new Array(1 + numParameters);\r\n paramTypes[0] = thisType.toNativeType();\r\n index = 1;\r\n } else {\r\n paramTypes = new Array(numParameters);\r\n }\r\n if (parameterTypes) {\r\n for (let i = 0; i < numParameters; ++i, ++index) {\r\n paramTypes[index] = parameterTypes[i].toNativeType();\r\n }\r\n }\r\n var resultType = returnType.toNativeType();\r\n var module = this.module;\r\n var typeRef = module.getFunctionTypeBySignature(resultType, paramTypes);\r\n if (!typeRef) {\r\n let name = Signature.makeSignatureString(parameterTypes, returnType, thisType);\r\n typeRef = module.addFunctionType(name, resultType, paramTypes);\r\n }\r\n return typeRef;\r\n }\r\n\r\n /** Compiles the body of a function within the specified flow. */\r\n private compileFunctionBody(instance: Function): ExpressionRef[] {\r\n var module = this.module;\r\n var bodyNode = assert(instance.prototype.bodyNode);\r\n var returnType = instance.signature.returnType;\r\n var flow = this.currentFlow;\r\n\r\n // compile statements\r\n var stmts: BinaryenExportRef[];\r\n if (bodyNode.kind == NodeKind.BLOCK) {\r\n stmts = this.compileStatements((bodyNode).statements, true);\r\n } else {\r\n // must be an expression statement if not a block\r\n assert(bodyNode.kind == NodeKind.EXPRESSION);\r\n\r\n // must be an arrow function\r\n assert(instance.prototype.arrowKind);\r\n\r\n // none of the following can be an arrow function\r\n assert(!instance.isAny(CommonFlags.CONSTRUCTOR | CommonFlags.GET | CommonFlags.SET | CommonFlags.MAIN));\r\n\r\n let stmt = this.compileExpression(\r\n (bodyNode).expression,\r\n returnType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n flow.set(FlowFlags.RETURNS);\r\n if (!flow.canOverflow(stmt, returnType)) flow.set(FlowFlags.RETURNS_WRAPPED);\r\n stmts = [ stmt ];\r\n }\r\n\r\n // make the main function call `start` implicitly, but only once\r\n if (instance.prototype == this.program.explicitStartFunction) {\r\n module.addGlobal(CompilerSymbols.started, NativeType.I32, true, module.createI32(0));\r\n stmts.unshift(\r\n module.createIf(\r\n module.createUnary(\r\n UnaryOp.EqzI32,\r\n module.createGetGlobal(CompilerSymbols.started, NativeType.I32)\r\n ),\r\n module.createBlock(null, [\r\n module.createCall(\"start\", null, NativeType.None),\r\n module.createSetGlobal(CompilerSymbols.started, module.createI32(1))\r\n ])\r\n )\r\n );\r\n }\r\n\r\n // make constructors return their instance pointer\r\n if (instance.is(CommonFlags.CONSTRUCTOR)) {\r\n let nativeSizeType = this.options.nativeSizeType;\r\n assert(instance.is(CommonFlags.INSTANCE));\r\n let classInstance = assert(instance.parent); assert(classInstance.kind == ElementKind.CLASS);\r\n\r\n if (!flow.isAny(FlowFlags.ANY_TERMINATING)) {\r\n let thisLocalIndex = flow.is(FlowFlags.INLINE_CONTEXT)\r\n ? assert(flow.lookupLocal(CommonSymbols.this_)).index\r\n : 0;\r\n\r\n // if `this` wasn't accessed before, allocate if necessary and initialize `this`\r\n if (!flow.is(FlowFlags.ALLOCATES)) {\r\n // {\r\n // if (!this) this = \r\n // this.a = X\r\n // this.b = Y\r\n // }\r\n stmts.push(\r\n module.createIf(\r\n module.createUnary(nativeSizeType == NativeType.I64 ? UnaryOp.EqzI64 : UnaryOp.EqzI32,\r\n module.createGetLocal(thisLocalIndex, nativeSizeType)\r\n ),\r\n module.createSetLocal(thisLocalIndex,\r\n this.makeAllocation(classInstance)\r\n )\r\n )\r\n );\r\n this.makeFieldInitialization(classInstance, stmts);\r\n }\r\n\r\n // implicitly return `this`\r\n stmts.push(\r\n module.createGetLocal(thisLocalIndex, nativeSizeType)\r\n );\r\n }\r\n\r\n // check that super has been called if this is a derived class\r\n if ((classInstance).base && !flow.is(FlowFlags.CALLS_SUPER)) {\r\n this.error(\r\n DiagnosticCode.Constructors_for_derived_classes_must_contain_a_super_call,\r\n instance.prototype.declaration.range\r\n );\r\n }\r\n\r\n // if this is a normal function, make sure that all branches return\r\n } else if (returnType != Type.void && !flow.is(FlowFlags.RETURNS)) {\r\n this.error(\r\n DiagnosticCode.A_function_whose_declared_type_is_not_void_must_return_a_value,\r\n instance.prototype.signatureNode.returnType.range\r\n );\r\n }\r\n\r\n return stmts;\r\n }\r\n\r\n /** Compiles a readily resolved function instance. */\r\n compileFunction(instance: Function): bool {\r\n if (instance.is(CommonFlags.COMPILED)) return true;\r\n assert(!(instance.is(CommonFlags.AMBIENT) && instance.hasDecorator(DecoratorFlags.BUILTIN)));\r\n instance.set(CommonFlags.COMPILED);\r\n\r\n var module = this.module;\r\n var signature = instance.signature;\r\n var bodyNode = instance.prototype.bodyNode;\r\n\r\n var typeRef = this.ensureFunctionType(signature.parameterTypes, signature.returnType, signature.thisType);\r\n var funcRef: FunctionRef;\r\n\r\n // concrete function\r\n if (bodyNode) {\r\n\r\n // must not be ambient\r\n if (instance.is(CommonFlags.AMBIENT)) {\r\n this.error(\r\n DiagnosticCode.An_implementation_cannot_be_declared_in_ambient_contexts,\r\n instance.identifierNode.range\r\n );\r\n }\r\n\r\n // cannot have an annotated external name\r\n if (instance.hasDecorator(DecoratorFlags.EXTERNAL)) {\r\n let decoratorNodes = instance.decoratorNodes;\r\n let decorator = assert(findDecorator(DecoratorKind.EXTERNAL, decoratorNodes));\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n decorator.range\r\n );\r\n }\r\n\r\n // compile body in this function's context\r\n let previousFlow = this.currentFlow;\r\n this.currentFlow = instance.flow;\r\n let stmts = this.compileFunctionBody(instance);\r\n this.currentFlow = previousFlow;\r\n\r\n // create the function\r\n funcRef = module.addFunction(\r\n instance.internalName,\r\n typeRef,\r\n typesToNativeTypes(instance.additionalLocals),\r\n stmts.length\r\n ? stmts.length == 1\r\n ? stmts[0]\r\n : module.createBlock(null, stmts, instance.signature.returnType.toNativeType())\r\n : module.createNop()\r\n );\r\n\r\n // imported function\r\n } else {\r\n if (!instance.is(CommonFlags.AMBIENT)) {\r\n this.error(\r\n DiagnosticCode.Function_implementation_is_missing_or_not_immediately_following_the_declaration,\r\n instance.identifierNode.range\r\n );\r\n }\r\n\r\n instance.set(CommonFlags.MODULE_IMPORT);\r\n mangleImportName(instance, instance.declaration); // TODO: check for duplicates\r\n\r\n // create the import\r\n funcRef = module.addFunctionImport(\r\n instance.internalName,\r\n mangleImportName_moduleName,\r\n mangleImportName_elementName,\r\n typeRef\r\n );\r\n }\r\n\r\n instance.finalize(module, funcRef);\r\n return true;\r\n }\r\n\r\n // classes\r\n\r\n compileClassUsingTypeArguments(\r\n prototype: ClassPrototype,\r\n typeArguments: TypeNode[],\r\n contextualTypeArguments: Map = makeMap(),\r\n alternativeReportNode: Node | null = null\r\n ): void {\r\n var instance = this.resolver.resolveClassInclTypeArguments(\r\n prototype,\r\n typeArguments,\r\n prototype.parent, // relative to itself\r\n contextualTypeArguments,\r\n alternativeReportNode || prototype.declaration\r\n );\r\n if (!instance) return;\r\n this.compileClass(instance);\r\n }\r\n\r\n compileClass(instance: Class): bool {\r\n if (instance.is(CommonFlags.COMPILED)) return true;\r\n instance.set(CommonFlags.COMPILED);\r\n var prototype = instance.prototype;\r\n var staticMembers = (prototype).members;\r\n if (staticMembers) {\r\n for (let element of staticMembers.values()) {\r\n switch (element.kind) {\r\n case ElementKind.GLOBAL: {\r\n this.compileGlobal(element);\r\n break;\r\n }\r\n case ElementKind.FUNCTION_PROTOTYPE: {\r\n if (\r\n !(element).is(CommonFlags.GENERIC)\r\n ) {\r\n this.compileFunctionUsingTypeArguments(\r\n element,\r\n [],\r\n makeMap(),\r\n (element).identifierNode\r\n );\r\n }\r\n break;\r\n }\r\n case ElementKind.PROPERTY_PROTOTYPE: {\r\n let getter = (element).getterPrototype;\r\n if (getter) {\r\n this.compileFunctionUsingTypeArguments(\r\n getter,\r\n [],\r\n makeMap(),\r\n getter.identifierNode\r\n );\r\n }\r\n let setter = (element).setterPrototype;\r\n if (setter) {\r\n this.compileFunctionUsingTypeArguments(\r\n setter,\r\n [],\r\n makeMap(),\r\n setter.identifierNode\r\n );\r\n }\r\n break;\r\n }\r\n case ElementKind.PROPERTY: {\r\n }\r\n }\r\n }\r\n }\r\n var ctorInstance = instance.constructorInstance;\r\n if (ctorInstance) this.compileFunction(ctorInstance);\r\n var instanceMembers = instance.members;\r\n if (instanceMembers) {\r\n for (let element of instanceMembers.values()) {\r\n switch (element.kind) {\r\n case ElementKind.FUNCTION_PROTOTYPE: {\r\n if (\r\n !(element).is(CommonFlags.GENERIC)\r\n ) {\r\n this.compileFunctionUsingTypeArguments(\r\n element,\r\n [],\r\n makeMap(instance.contextualTypeArguments),\r\n (element).declaration.name\r\n );\r\n }\r\n break;\r\n }\r\n case ElementKind.FIELD_PROTOTYPE: {\r\n element.set(CommonFlags.COMPILED);\r\n break;\r\n }\r\n case ElementKind.PROPERTY: {\r\n let getter = (element).getterInstance;\r\n if (getter) this.compileFunction(getter);\r\n let setter = (element).setterInstance;\r\n if (setter) this.compileFunction(setter);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n compileInterfaceDeclaration(\r\n declaration: InterfaceDeclaration,\r\n typeArguments: TypeNode[],\r\n contextualTypeArguments: Map | null = null,\r\n alternativeReportNode: Node | null = null\r\n ): void {\r\n // TODO\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n declaration.range\r\n );\r\n }\r\n\r\n // memory\r\n\r\n /** Adds a static memory segment with the specified data. */\r\n addMemorySegment(buffer: Uint8Array, alignment: i32 = 8): MemorySegment {\r\n var memoryOffset = i64_align(this.memoryOffset, alignment);\r\n var segment = MemorySegment.create(buffer, memoryOffset);\r\n this.memorySegments.push(segment);\r\n this.memoryOffset = i64_add(memoryOffset, i64_new(buffer.length, 0));\r\n return segment;\r\n }\r\n\r\n // function table\r\n\r\n /** Ensures that a table entry exists for the specified function and returns its index. */\r\n ensureFunctionTableEntry(func: Function): i32 {\r\n assert(func.is(CommonFlags.COMPILED));\r\n if (func.functionTableIndex >= 0) {\r\n return func.functionTableIndex;\r\n }\r\n var functionTable = this.functionTable;\r\n var index = functionTable.length;\r\n if (!func.is(CommonFlags.TRAMPOLINE) && func.signature.requiredParameters < func.signature.parameterTypes.length) {\r\n // insert the trampoline if the function has optional parameters\r\n func = this.ensureTrampoline(func);\r\n }\r\n functionTable.push(func.internalName);\r\n func.functionTableIndex = index;\r\n return index;\r\n }\r\n\r\n // statements\r\n\r\n compileTopLevelStatement(statement: Statement, body: ExpressionRef[]): void {\r\n switch (statement.kind) {\r\n case NodeKind.CLASSDECLARATION: {\r\n let memberStatements = (statement).members;\r\n for (let i = 0, k = memberStatements.length; i < k; ++i) {\r\n this.compileTopLevelStatement(memberStatements[i], body);\r\n }\r\n break;\r\n }\r\n case NodeKind.ENUMDECLARATION: {\r\n let element = this.program.getElementByDeclaration(statement);\r\n assert(element.kind == ElementKind.ENUM);\r\n if (!element.hasDecorator(DecoratorFlags.LAZY)) this.compileEnum(element);\r\n break;\r\n }\r\n case NodeKind.NAMESPACEDECLARATION: {\r\n let memberStatements = (statement).members;\r\n for (let i = 0, k = memberStatements.length; i < k; ++i) {\r\n this.compileTopLevelStatement(memberStatements[i], body);\r\n }\r\n break;\r\n }\r\n case NodeKind.VARIABLE: {\r\n let declarations = (statement).declarations;\r\n for (let i = 0, k = declarations.length; i < k; ++i) {\r\n let element = this.program.getElementByDeclaration(declarations[i]);\r\n assert(element.kind == ElementKind.GLOBAL);\r\n if (\r\n !element.is(CommonFlags.AMBIENT) && // delay imports\r\n !element.hasDecorator(DecoratorFlags.LAZY)\r\n ) this.compileGlobal(element);\r\n }\r\n break;\r\n }\r\n case NodeKind.FIELDDECLARATION: {\r\n let element = this.program.getElementByDeclaration(statement);\r\n if (element.kind == ElementKind.GLOBAL) { // static\r\n if (!element.hasDecorator(DecoratorFlags.LAZY)) this.compileGlobal(element);\r\n }\r\n break;\r\n }\r\n case NodeKind.EXPORT: {\r\n if ((statement).normalizedPath != null) {\r\n this.compileFileByPath(\r\n (statement).normalizedPath,\r\n (statement).path\r\n );\r\n }\r\n break;\r\n }\r\n case NodeKind.IMPORT: {\r\n this.compileFileByPath(\r\n (statement).normalizedPath,\r\n (statement).path\r\n );\r\n break;\r\n }\r\n case NodeKind.FUNCTIONDECLARATION:\r\n case NodeKind.METHODDECLARATION:\r\n case NodeKind.INTERFACEDECLARATION:\r\n case NodeKind.INDEXSIGNATUREDECLARATION:\r\n case NodeKind.TYPEDECLARATION: break;\r\n default: { // otherwise a top-level statement that is part of the start function's body\r\n let stmt = this.compileStatement(statement);\r\n if (getExpressionId(stmt) != ExpressionId.Nop) body.push(stmt);\r\n break;\r\n }\r\n }\r\n }\r\n\r\n compileStatement(statement: Statement, isLastStatementInBody: bool = false): ExpressionRef {\r\n var module = this.module;\r\n var stmt: ExpressionRef;\r\n switch (statement.kind) {\r\n case NodeKind.BLOCK: {\r\n stmt = this.compileBlockStatement(statement);\r\n break;\r\n }\r\n case NodeKind.BREAK: {\r\n stmt = this.compileBreakStatement(statement);\r\n break;\r\n }\r\n case NodeKind.CONTINUE: {\r\n stmt = this.compileContinueStatement(statement);\r\n break;\r\n }\r\n case NodeKind.DO: {\r\n stmt = this.compileDoStatement(statement);\r\n break;\r\n }\r\n case NodeKind.EMPTY: {\r\n stmt = this.compileEmptyStatement(statement);\r\n break;\r\n }\r\n case NodeKind.EXPRESSION: {\r\n stmt = this.compileExpressionStatement(statement);\r\n break;\r\n }\r\n case NodeKind.FOR: {\r\n stmt = this.compileForStatement(statement);\r\n break;\r\n }\r\n case NodeKind.IF: {\r\n stmt = this.compileIfStatement(statement);\r\n break;\r\n }\r\n case NodeKind.RETURN: {\r\n stmt = this.compileReturnStatement(statement, isLastStatementInBody);\r\n break;\r\n }\r\n case NodeKind.SWITCH: {\r\n stmt = this.compileSwitchStatement(statement);\r\n break;\r\n }\r\n case NodeKind.THROW: {\r\n stmt = this.compileThrowStatement(statement);\r\n break;\r\n }\r\n case NodeKind.TRY: {\r\n stmt = this.compileTryStatement(statement);\r\n break;\r\n }\r\n case NodeKind.VARIABLE: {\r\n stmt = this.compileVariableStatement(statement);\r\n if (!stmt) stmt = module.createNop();\r\n break;\r\n }\r\n case NodeKind.VOID: {\r\n stmt = this.compileVoidStatement(statement);\r\n break;\r\n }\r\n case NodeKind.WHILE: {\r\n stmt = this.compileWhileStatement(statement);\r\n break;\r\n }\r\n case NodeKind.TYPEDECLARATION: {\r\n // TODO: integrate inner type declaration into flow\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n statement.range\r\n );\r\n stmt = module.createUnreachable();\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n stmt = module.createUnreachable();\r\n }\r\n }\r\n if (this.options.sourceMap) this.addDebugLocation(stmt, statement.range);\r\n return stmt;\r\n }\r\n\r\n compileStatements(statements: Statement[], isBody: bool = false): ExpressionRef[] {\r\n var numStatements = statements.length;\r\n var stmts = new Array(numStatements);\r\n stmts.length = 0;\r\n var flow = this.currentFlow;\r\n for (let i = 0; i < numStatements; ++i) {\r\n let stmt = this.compileStatement(statements[i], isBody && i == numStatements - 1);\r\n switch (getExpressionId(stmt)) {\r\n case ExpressionId.Block: {\r\n if (!getBlockName(stmt)) {\r\n for (let j = 0, k = getBlockChildCount(stmt); j < k; ++j) stmts.push(getBlockChild(stmt, j));\r\n break;\r\n }\r\n // fall-through\r\n }\r\n default: stmts.push(stmt);\r\n case ExpressionId.Nop:\r\n }\r\n if (flow.isAny(FlowFlags.ANY_TERMINATING)) {\r\n if (needsExplicitUnreachable(stmt)) stmts.push(this.module.createUnreachable());\r\n break;\r\n }\r\n }\r\n return stmts;\r\n }\r\n\r\n compileBlockStatement(statement: BlockStatement): ExpressionRef {\r\n var statements = statement.statements;\r\n var outerFlow = this.currentFlow;\r\n var innerFlow = outerFlow.fork();\r\n this.currentFlow = innerFlow;\r\n\r\n var stmts = this.compileStatements(statements);\r\n var stmt = stmts.length == 0\r\n ? this.module.createNop()\r\n : stmts.length == 1\r\n ? stmts[0]\r\n : this.module.createBlock(null, stmts,getExpressionType(stmts[stmts.length - 1]));\r\n\r\n innerFlow.freeScopedLocals();\r\n outerFlow.inherit(innerFlow);\r\n this.currentFlow = outerFlow;\r\n return stmt;\r\n }\r\n\r\n compileBreakStatement(statement: BreakStatement): ExpressionRef {\r\n var module = this.module;\r\n if (statement.label) {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n statement.label.range\r\n );\r\n return module.createUnreachable();\r\n }\r\n var flow = this.currentFlow;\r\n var breakLabel = flow.breakLabel;\r\n if (breakLabel == null) {\r\n this.error(\r\n DiagnosticCode.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement,\r\n statement.range\r\n );\r\n return module.createUnreachable();\r\n }\r\n flow.set(FlowFlags.BREAKS);\r\n return module.createBreak(breakLabel);\r\n }\r\n\r\n compileContinueStatement(statement: ContinueStatement): ExpressionRef {\r\n var module = this.module;\r\n var label = statement.label;\r\n if (label) {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n label.range\r\n );\r\n return module.createUnreachable();\r\n }\r\n // Check if 'continue' is allowed here\r\n var flow = this.currentFlow;\r\n var continueLabel = flow.continueLabel;\r\n if (continueLabel == null) {\r\n this.error(\r\n DiagnosticCode.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement,\r\n statement.range\r\n );\r\n return module.createUnreachable();\r\n }\r\n flow.set(FlowFlags.CONTINUES);\r\n return module.createBreak(continueLabel);\r\n }\r\n\r\n compileDoStatement(statement: DoStatement): ExpressionRef {\r\n var module = this.module;\r\n\r\n var outerFlow = this.currentFlow;\r\n var label = outerFlow.pushBreakLabel();\r\n var innerFlow = outerFlow.fork();\r\n this.currentFlow = innerFlow;\r\n var breakLabel = \"break|\" + label;\r\n innerFlow.breakLabel = breakLabel;\r\n var continueLabel = \"continue|\" + label;\r\n innerFlow.continueLabel = continueLabel;\r\n\r\n var body = this.compileStatement(statement.statement);\r\n var condExpr = this.makeIsTrueish(\r\n this.compileExpression(statement.condition, Type.i32, ConversionKind.NONE, WrapMode.NONE),\r\n this.currentType\r\n );\r\n // TODO: check if condition is always false and if so, omit it (just a block)\r\n\r\n // Switch back to the parent flow\r\n innerFlow.freeScopedLocals();\r\n outerFlow.popBreakLabel();\r\n this.currentFlow = outerFlow;\r\n var terminated = innerFlow.isAny(FlowFlags.ANY_TERMINATING);\r\n innerFlow.unset(\r\n FlowFlags.BREAKS |\r\n FlowFlags.CONDITIONALLY_BREAKS |\r\n FlowFlags.CONTINUES |\r\n FlowFlags.CONDITIONALLY_CONTINUES\r\n );\r\n outerFlow.inherit(innerFlow);\r\n\r\n var block: ExpressionRef[] = [\r\n module.createLoop(continueLabel,\r\n terminated\r\n ? body // skip trailing continue if unnecessary\r\n : module.createBlock(null, [\r\n body,\r\n module.createBreak(continueLabel, condExpr)\r\n ], NativeType.None)\r\n )\r\n ];\r\n if (terminated) block.push(module.createUnreachable());\r\n return module.createBlock(breakLabel, block);\r\n }\r\n\r\n compileEmptyStatement(statement: EmptyStatement): ExpressionRef {\r\n return this.module.createNop();\r\n }\r\n\r\n compileExpressionStatement(statement: ExpressionStatement): ExpressionRef {\r\n var expr = this.compileExpression(statement.expression, Type.void, ConversionKind.NONE, WrapMode.NONE);\r\n if (this.currentType != Type.void) {\r\n expr = this.module.createDrop(expr);\r\n this.currentType = Type.void;\r\n }\r\n return expr;\r\n }\r\n\r\n compileForStatement(statement: ForStatement): ExpressionRef {\r\n // A for statement initiates a new branch with its own scoped variables\r\n // possibly declared in its initializer, and break context.\r\n var outerFlow = this.currentFlow;\r\n var label = outerFlow.pushBreakLabel();\r\n var innerFlow = outerFlow.fork();\r\n this.currentFlow = innerFlow;\r\n var breakLabel = innerFlow.breakLabel = \"break|\" + label;\r\n innerFlow.breakLabel = breakLabel;\r\n var continueLabel = \"continue|\" + label;\r\n innerFlow.continueLabel = continueLabel;\r\n var repeatLabel = \"repeat|\" + label;\r\n\r\n // Compile in correct order\r\n var module = this.module;\r\n var initExpr = statement.initializer\r\n ? this.compileStatement(statement.initializer)\r\n : 0;\r\n var condExpr: ExpressionRef = 0;\r\n var alwaysTrue = false;\r\n if (statement.condition) {\r\n condExpr = this.makeIsTrueish(\r\n this.compileExpressionRetainType(statement.condition, Type.bool, WrapMode.NONE),\r\n this.currentType\r\n );\r\n // check if the condition is always true\r\n let condPre = module.precomputeExpression(condExpr);\r\n if (getExpressionId(condPre) == ExpressionId.Const) {\r\n assert(getExpressionType(condPre) == NativeType.I32);\r\n if (getConstValueI32(condPre) != 0) alwaysTrue = true;\r\n // TODO: could skip compilation if the condition is always false here, but beware that the\r\n // initializer could still declare new 'var's that are used later on.\r\n }\r\n // recompile to original\r\n condExpr = this.makeIsTrueish(\r\n this.compileExpressionRetainType(statement.condition, Type.bool, WrapMode.NONE),\r\n this.currentType\r\n );\r\n } else {\r\n // omitted condition is always true\r\n condExpr = module.createI32(1);\r\n alwaysTrue = true;\r\n }\r\n var incrExpr = statement.incrementor\r\n ? this.compileExpression(statement.incrementor, Type.void, ConversionKind.IMPLICIT, WrapMode.NONE)\r\n : 0;\r\n var bodyStatement = statement.statement;\r\n var bodyExpr = bodyStatement.kind == NodeKind.BLOCK && (bodyStatement).statements.length == 1\r\n ? this.compileStatement((bodyStatement).statements[0])\r\n : this.compileStatement(bodyStatement);\r\n\r\n // Switch back to the parent flow\r\n innerFlow.freeScopedLocals();\r\n outerFlow.popBreakLabel();\r\n this.currentFlow = outerFlow;\r\n var usesContinue = innerFlow.isAny(FlowFlags.CONTINUES | FlowFlags.CONDITIONALLY_CONTINUES);\r\n innerFlow.unset(\r\n FlowFlags.BREAKS |\r\n FlowFlags.CONDITIONALLY_BREAKS |\r\n FlowFlags.CONTINUES |\r\n FlowFlags.CONDITIONALLY_CONTINUES\r\n );\r\n if (alwaysTrue) outerFlow.inherit(innerFlow);\r\n else outerFlow.inheritConditional(innerFlow);\r\n\r\n var breakBlock = new Array(); // outer 'break' block\r\n if (initExpr) breakBlock.push(initExpr);\r\n\r\n var repeatBlock = new Array(); // block repeating the loop\r\n if (usesContinue) {\r\n repeatBlock.push(\r\n module.createBlock(continueLabel, [ // inner 'continue' block\r\n module.createBreak(breakLabel, module.createUnary(UnaryOp.EqzI32, condExpr)),\r\n bodyExpr\r\n ], NativeType.None)\r\n );\r\n } else { // can omit the 'continue' block\r\n repeatBlock.push(\r\n module.createBreak(breakLabel, module.createUnary(UnaryOp.EqzI32, condExpr))\r\n );\r\n repeatBlock.push(bodyExpr);\r\n }\r\n if (incrExpr) repeatBlock.push(incrExpr);\r\n repeatBlock.push(\r\n module.createBreak(repeatLabel)\r\n );\r\n\r\n breakBlock.push(\r\n module.createLoop(repeatLabel, module.createBlock(null, repeatBlock, NativeType.None))\r\n );\r\n\r\n return module.createBlock(breakLabel, breakBlock);\r\n }\r\n\r\n compileIfStatement(statement: IfStatement): ExpressionRef {\r\n var module = this.module;\r\n var ifTrue = statement.ifTrue;\r\n var ifFalse = statement.ifFalse;\r\n var outerFlow = this.currentFlow;\r\n var actualFunction = outerFlow.actualFunction;\r\n\r\n // The condition doesn't initiate a branch yet\r\n var condExpr = this.makeIsTrueish(\r\n this.compileExpressionRetainType(statement.condition, Type.bool, WrapMode.NONE),\r\n this.currentType\r\n );\r\n\r\n // Try to eliminate unnecesssary branches if the condition is constant\r\n var condExprPrecomp = module.precomputeExpression(condExpr);\r\n if (\r\n getExpressionId(condExprPrecomp) == ExpressionId.Const &&\r\n getExpressionType(condExprPrecomp) == NativeType.I32\r\n ) {\r\n return getConstValueI32(condExprPrecomp)\r\n ? this.compileStatement(ifTrue)\r\n : ifFalse\r\n ? this.compileStatement(ifFalse)\r\n : module.createNop();\r\n\r\n // Otherwise recompile to the original and let the optimizer decide\r\n } else /* if (condExpr != condExprPrecomp) <- not guaranteed */ {\r\n condExpr = this.makeIsTrueish(\r\n this.compileExpressionRetainType(statement.condition, Type.bool, WrapMode.NONE),\r\n this.currentType\r\n );\r\n }\r\n\r\n // Each arm initiates a branch\r\n var ifTrueFlow = outerFlow.fork();\r\n this.currentFlow = ifTrueFlow;\r\n var ifTrueExpr = this.compileStatement(ifTrue);\r\n ifTrueFlow.freeScopedLocals();\r\n this.currentFlow = outerFlow;\r\n\r\n var ifFalseExpr: ExpressionRef = 0;\r\n if (ifFalse) {\r\n let ifFalseFlow = outerFlow.fork();\r\n this.currentFlow = ifFalseFlow;\r\n ifFalseExpr = this.compileStatement(ifFalse);\r\n ifFalseFlow.freeScopedLocals();\r\n this.currentFlow = outerFlow;\r\n outerFlow.inheritMutual(ifTrueFlow, ifFalseFlow);\r\n } else {\r\n outerFlow.inheritConditional(ifTrueFlow);\r\n }\r\n return module.createIf(condExpr, ifTrueExpr, ifFalseExpr);\r\n }\r\n\r\n compileReturnStatement(statement: ReturnStatement, isLastStatementInBody: bool): ExpressionRef {\r\n var module = this.module;\r\n var expr: ExpressionRef = 0;\r\n var flow = this.currentFlow;\r\n var returnType = flow.returnType;\r\n\r\n // Remember that this flow returns\r\n flow.set(FlowFlags.RETURNS);\r\n\r\n if (statement.value) {\r\n if (returnType == Type.void) {\r\n this.compileExpressionRetainType(statement.value, returnType, WrapMode.NONE);\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_assignable_to_type_1,\r\n statement.value.range, this.currentType.toString(), returnType.toString()\r\n );\r\n this.currentType = Type.void;\r\n return module.createUnreachable();\r\n }\r\n expr = this.compileExpression(\r\n statement.value,\r\n returnType,\r\n ConversionKind.IMPLICIT,\r\n flow.actualFunction.is(CommonFlags.MODULE_EXPORT)\r\n ? WrapMode.WRAP\r\n : WrapMode.NONE\r\n );\r\n\r\n // Remember whether returning a properly wrapped value\r\n if (!flow.canOverflow(expr, returnType)) flow.set(FlowFlags.RETURNS_WRAPPED);\r\n\r\n } else if (returnType != Type.void) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_assignable_to_type_1,\r\n statement.range, \"void\", returnType.toString()\r\n );\r\n expr = module.createUnreachable();\r\n }\r\n\r\n // If the last statement anyway, make it the block's return value\r\n if (isLastStatementInBody) return expr ? expr : module.createNop();\r\n\r\n // When inlining, break to the end of the inlined function's block (no need to wrap)\r\n if (flow.is(FlowFlags.INLINE_CONTEXT)) return module.createBreak(assert(flow.inlineReturnLabel), 0, expr);\r\n\r\n return module.createReturn(expr);\r\n }\r\n\r\n compileSwitchStatement(statement: SwitchStatement): ExpressionRef {\r\n var module = this.module;\r\n\r\n var cases = statement.cases;\r\n var numCases = cases.length;\r\n if (!numCases) {\r\n return this.compileExpression(statement.condition, Type.void, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n }\r\n\r\n // Everything within a switch uses the same break context\r\n var outerFlow = this.currentFlow;\r\n var context = outerFlow.pushBreakLabel();\r\n\r\n // introduce a local for evaluating the condition (exactly once)\r\n var tempLocal = outerFlow.getTempLocal(Type.u32, false);\r\n var tempLocalIndex = tempLocal.index;\r\n\r\n // Prepend initializer to inner block. Does not initiate a new branch, yet.\r\n var breaks = new Array(1 + numCases);\r\n breaks[0] = module.createSetLocal( // initializer\r\n tempLocalIndex,\r\n this.compileExpression(statement.condition, Type.u32, ConversionKind.IMPLICIT, WrapMode.NONE)\r\n );\r\n\r\n // make one br_if per (possibly dynamic) labeled case (binaryen optimizes to br_table where possible)\r\n var breakIndex = 1;\r\n var defaultIndex = -1;\r\n for (let i = 0; i < numCases; ++i) {\r\n let case_ = cases[i];\r\n let label = case_.label;\r\n if (label) {\r\n breaks[breakIndex++] = module.createBreak(\"case\" + i.toString(10) + \"|\" + context,\r\n module.createBinary(BinaryOp.EqI32,\r\n module.createGetLocal(tempLocalIndex, NativeType.I32),\r\n this.compileExpression(label, Type.u32, ConversionKind.IMPLICIT, WrapMode.NONE)\r\n )\r\n );\r\n } else {\r\n defaultIndex = i;\r\n }\r\n }\r\n\r\n outerFlow.freeTempLocal(tempLocal);\r\n\r\n // otherwise br to default respectively out of the switch if there is no default case\r\n breaks[breakIndex] = module.createBreak((defaultIndex >= 0\r\n ? \"case\" + defaultIndex.toString(10)\r\n : \"break\"\r\n ) + \"|\" + context);\r\n\r\n // nest blocks in order\r\n var currentBlock = module.createBlock(\"case0|\" + context, breaks, NativeType.None);\r\n var alwaysReturns = true;\r\n var alwaysReturnsWrapped = true;\r\n var alwaysThrows = true;\r\n var alwaysAllocates = true;\r\n for (let i = 0; i < numCases; ++i) {\r\n let case_ = cases[i];\r\n let statements = case_.statements;\r\n let numStatements = statements.length;\r\n\r\n // Each switch case initiates a new branch\r\n let innerFlow = outerFlow.fork();\r\n this.currentFlow = innerFlow;\r\n let breakLabel = \"break|\" + context;\r\n innerFlow.breakLabel = breakLabel;\r\n\r\n let isLast = i == numCases - 1;\r\n let nextLabel = isLast ? breakLabel : \"case\" + (i + 1).toString(10) + \"|\" + context;\r\n let stmts = new Array(1 + numStatements);\r\n stmts[0] = currentBlock;\r\n let count = 1;\r\n let terminated = false;\r\n for (let j = 0; j < numStatements; ++j) {\r\n let stmt = this.compileStatement(statements[j]);\r\n if (getExpressionId(stmt) != ExpressionId.Nop) {\r\n stmts[count++] = stmt;\r\n if (innerFlow.isAny(FlowFlags.ANY_TERMINATING)) {\r\n terminated = true;\r\n break;\r\n }\r\n }\r\n }\r\n stmts.length = count;\r\n if (terminated || isLast) {\r\n if (!innerFlow.is(FlowFlags.RETURNS)) alwaysReturns = false;\r\n if (!innerFlow.is(FlowFlags.RETURNS_WRAPPED)) alwaysReturnsWrapped = false;\r\n if (!innerFlow.is(FlowFlags.THROWS)) alwaysThrows = false;\r\n if (!innerFlow.is(FlowFlags.ALLOCATES)) alwaysAllocates = false;\r\n }\r\n\r\n // Switch back to the parent flow\r\n innerFlow.unset(\r\n FlowFlags.BREAKS |\r\n FlowFlags.CONDITIONALLY_BREAKS\r\n );\r\n innerFlow.freeScopedLocals();\r\n this.currentFlow = outerFlow;\r\n currentBlock = module.createBlock(nextLabel, stmts, NativeType.None); // must be a labeled block\r\n }\r\n outerFlow.popBreakLabel();\r\n\r\n // If the switch has a default (guaranteed to handle any value), propagate common flags\r\n if (defaultIndex >= 0) {\r\n if (alwaysReturns) outerFlow.set(FlowFlags.RETURNS);\r\n if (alwaysReturnsWrapped) outerFlow.set(FlowFlags.RETURNS_WRAPPED);\r\n if (alwaysThrows) outerFlow.set(FlowFlags.THROWS);\r\n if (alwaysAllocates) outerFlow.set(FlowFlags.ALLOCATES);\r\n }\r\n return currentBlock;\r\n }\r\n\r\n compileThrowStatement(statement: ThrowStatement): ExpressionRef {\r\n var flow = this.currentFlow;\r\n\r\n // Remember that this branch throws\r\n flow.set(FlowFlags.THROWS);\r\n\r\n // FIXME: without try-catch it is safe to assume RETURNS as well for now\r\n flow.set(FlowFlags.RETURNS);\r\n\r\n // TODO: requires exception-handling spec.\r\n return compileAbort(this, null, statement);\r\n }\r\n\r\n compileTryStatement(statement: TryStatement): ExpressionRef {\r\n // TODO: can't yet support something like: try { return ... } finally { ... }\r\n // worthwhile to investigate lowering returns to block results (here)?\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n statement.range\r\n );\r\n return this.module.createUnreachable();\r\n }\r\n\r\n /** Compiles a variable statement. Returns `0` if an initializer is not necessary. */\r\n compileVariableStatement(statement: VariableStatement): ExpressionRef {\r\n var declarations = statement.declarations;\r\n var numDeclarations = declarations.length;\r\n var flow = this.currentFlow;\r\n var initializers = new Array();\r\n var resolver = this.resolver;\r\n for (let i = 0; i < numDeclarations; ++i) {\r\n let declaration = declarations[i];\r\n let name = declaration.name.text;\r\n let type: Type | null = null;\r\n let initExpr: ExpressionRef = 0;\r\n if (declaration.type) {\r\n type = resolver.resolveType( // reports\r\n declaration.type,\r\n flow.actualFunction,\r\n flow.contextualTypeArguments\r\n );\r\n if (!type) continue;\r\n if (declaration.initializer) {\r\n initExpr = this.compileExpression( // reports\r\n declaration.initializer,\r\n type,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n }\r\n } else if (declaration.initializer) { // infer type using void/NONE for proper literal inference\r\n initExpr = this.compileExpressionRetainType( // reports\r\n declaration.initializer,\r\n Type.void,\r\n WrapMode.NONE\r\n );\r\n if (this.currentType == Type.void) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_assignable_to_type_1,\r\n declaration.range, this.currentType.toString(), \"\"\r\n );\r\n continue;\r\n }\r\n type = this.currentType;\r\n } else {\r\n this.error(\r\n DiagnosticCode.Type_expected,\r\n declaration.name.range.atEnd\r\n );\r\n continue;\r\n }\r\n let isInlined = false;\r\n if (declaration.is(CommonFlags.CONST)) {\r\n if (initExpr) {\r\n initExpr = this.module.precomputeExpression(initExpr);\r\n if (getExpressionId(initExpr) == ExpressionId.Const) {\r\n let local = new Local(name, -1, type, flow.parentFunction);\r\n switch (getExpressionType(initExpr)) {\r\n case NativeType.I32: {\r\n local.setConstantIntegerValue(\r\n i64_new(\r\n getConstValueI32(initExpr),\r\n 0\r\n ),\r\n type\r\n );\r\n break;\r\n }\r\n case NativeType.I64: {\r\n local.setConstantIntegerValue(\r\n i64_new(\r\n getConstValueI64Low(initExpr),\r\n getConstValueI64High(initExpr)\r\n ),\r\n type\r\n );\r\n break;\r\n }\r\n case NativeType.F32: {\r\n local.setConstantFloatValue(getConstValueF32(initExpr), type);\r\n break;\r\n }\r\n case NativeType.F64: {\r\n local.setConstantFloatValue(getConstValueF64(initExpr), type);\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n return this.module.createUnreachable();\r\n }\r\n }\r\n // Create a virtual local that doesn't actually exist in WebAssembly\r\n let scopedLocals = flow.scopedLocals;\r\n if (!scopedLocals) flow.scopedLocals = scopedLocals = new Map();\r\n else if (scopedLocals.has(name)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, name\r\n );\r\n return this.module.createUnreachable();\r\n }\r\n scopedLocals.set(name, local);\r\n isInlined = true;\r\n } else {\r\n this.warning(\r\n DiagnosticCode.Compiling_constant_with_non_constant_initializer_as_mutable,\r\n declaration.range\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._const_declarations_must_be_initialized,\r\n declaration.range\r\n );\r\n }\r\n }\r\n if (!isInlined) {\r\n let local: Local;\r\n if (\r\n declaration.isAny(CommonFlags.LET | CommonFlags.CONST) ||\r\n flow.is(FlowFlags.INLINE_CONTEXT)\r\n ) { // here: not top-level\r\n local = flow.addScopedLocal(name, type, false, declaration.name); // reports if duplicate\r\n } else {\r\n if (flow.lookupLocal(name)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, name\r\n );\r\n continue;\r\n }\r\n local = flow.parentFunction.addLocal(type, name, declaration);\r\n }\r\n if (initExpr) {\r\n initializers.push(\r\n this.compileAssignmentWithValue(declaration.name, initExpr)\r\n );\r\n if (local.type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) {\r\n flow.setLocalWrapped(local.index, !flow.canOverflow(initExpr, type));\r\n }\r\n } else if (local.type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) {\r\n flow.setLocalWrapped(local.index, true); // zero\r\n }\r\n }\r\n }\r\n return initializers.length // we can unwrap these here because the\r\n ? initializers.length == 1 // source didn't tell us exactly what to do\r\n ? initializers[0]\r\n : this.module.createBlock(null, initializers, NativeType.None)\r\n : 0;\r\n }\r\n\r\n compileVoidStatement(statement: VoidStatement): ExpressionRef {\r\n return this.compileExpression(statement.expression, Type.void, ConversionKind.EXPLICIT, WrapMode.NONE);\r\n }\r\n\r\n compileWhileStatement(statement: WhileStatement): ExpressionRef {\r\n var module = this.module;\r\n var outerFlow = this.currentFlow;\r\n\r\n // The condition does not yet initialize a branch\r\n var condExpr = this.makeIsTrueish(\r\n this.compileExpressionRetainType(statement.condition, Type.bool, WrapMode.NONE),\r\n this.currentType\r\n );\r\n\r\n // Try to eliminate unnecesssary loops if the condition is constant\r\n var condExprPrecomp = module.precomputeExpression(condExpr);\r\n if (\r\n getExpressionId(condExprPrecomp) == ExpressionId.Const &&\r\n getExpressionType(condExprPrecomp) == NativeType.I32\r\n ) {\r\n if (!getConstValueI32(condExprPrecomp)) return module.createNop();\r\n\r\n // Otherwise recompile to the original and let the optimizer decide\r\n } else /* if (condExpr != condExprPrecomp) <- not guaranteed */ {\r\n condExpr = this.makeIsTrueish(\r\n this.compileExpressionRetainType(statement.condition, Type.bool, WrapMode.NONE),\r\n this.currentType\r\n );\r\n }\r\n\r\n // Statements initiate a new branch with its own break context\r\n var label = outerFlow.pushBreakLabel();\r\n var innerFlow = outerFlow.fork();\r\n this.currentFlow = innerFlow;\r\n var breakLabel = \"break|\" + label;\r\n innerFlow.breakLabel = breakLabel;\r\n var continueLabel = \"continue|\" + label;\r\n innerFlow.continueLabel = continueLabel;\r\n\r\n var body = this.compileStatement(statement.statement);\r\n var alwaysTrue = false; // TODO\r\n var terminated = innerFlow.isAny(FlowFlags.ANY_TERMINATING);\r\n\r\n // Switch back to the parent flow\r\n innerFlow.freeScopedLocals();\r\n outerFlow.popBreakLabel();\r\n this.currentFlow = outerFlow;\r\n innerFlow.unset(\r\n FlowFlags.BREAKS |\r\n FlowFlags.CONDITIONALLY_BREAKS |\r\n FlowFlags.CONTINUES |\r\n FlowFlags.CONDITIONALLY_CONTINUES\r\n );\r\n if (alwaysTrue) outerFlow.inherit(innerFlow);\r\n else outerFlow.inheritConditional(innerFlow);\r\n\r\n return module.createBlock(breakLabel, [\r\n module.createLoop(continueLabel,\r\n module.createIf(condExpr,\r\n terminated\r\n ? body // skip trailing continue if unnecessary\r\n : module.createBlock(null, [\r\n body,\r\n module.createBreak(continueLabel)\r\n ], NativeType.None)\r\n )\r\n )\r\n ]);\r\n }\r\n\r\n // expressions\r\n\r\n /**\r\n * Compiles the value of an inlined constant element.\r\n * @param retainType If true, the annotated type of the constant is retained. Otherwise, the value\r\n * is precomputed according to context.\r\n */\r\n compileInlineConstant(\r\n element: VariableLikeElement,\r\n contextualType: Type,\r\n retainType: bool\r\n ): ExpressionRef {\r\n assert(element.is(CommonFlags.INLINED));\r\n var type = element.type;\r\n switch (\r\n !retainType &&\r\n type.is(TypeFlags.INTEGER) &&\r\n contextualType.is(TypeFlags.INTEGER) &&\r\n type.size < contextualType.size\r\n ? (this.currentType = contextualType).kind // essentially precomputes a (sign-)extension\r\n : (this.currentType = type).kind\r\n ) {\r\n case TypeKind.I8:\r\n case TypeKind.I16: {\r\n let shift = type.computeSmallIntegerShift(Type.i32);\r\n return this.module.createI32(\r\n element.constantValueKind == ConstantValueKind.INTEGER\r\n ? i64_low(element.constantIntegerValue) << shift >> shift\r\n : 0\r\n ); // recognized by canOverflow\r\n }\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.BOOL: {\r\n let mask = element.type.computeSmallIntegerMask(Type.i32);\r\n return this.module.createI32(\r\n element.constantValueKind == ConstantValueKind.INTEGER\r\n ? i64_low(element.constantIntegerValue) & mask\r\n : 0\r\n ); // recognized by canOverflow\r\n }\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n return this.module.createI32(\r\n element.constantValueKind == ConstantValueKind.INTEGER\r\n ? i64_low(element.constantIntegerValue)\r\n : 0\r\n );\r\n }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n if (!element.program.options.isWasm64) {\r\n return this.module.createI32(\r\n element.constantValueKind == ConstantValueKind.INTEGER\r\n ? i64_low(element.constantIntegerValue)\r\n : 0\r\n );\r\n }\r\n // fall-through\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n return element.constantValueKind == ConstantValueKind.INTEGER\r\n ? this.module.createI64(\r\n i64_low(element.constantIntegerValue),\r\n i64_high(element.constantIntegerValue)\r\n )\r\n : this.module.createI64(0);\r\n }\r\n case TypeKind.F64: {\r\n // monkey-patch for converting built-in floats to f32 implicitly\r\n if (!(element.hasDecorator(DecoratorFlags.BUILTIN) && contextualType == Type.f32)) {\r\n return this.module.createF64((element).constantFloatValue);\r\n }\r\n // otherwise fall-through: basically precomputes f32.demote/f64 of NaN / Infinity\r\n this.currentType = Type.f32;\r\n }\r\n case TypeKind.F32: {\r\n return this.module.createF32((element).constantFloatValue);\r\n }\r\n default: {\r\n assert(false);\r\n return this.module.createUnreachable();\r\n }\r\n }\r\n }\r\n\r\n compileExpression(\r\n expression: Expression,\r\n contextualType: Type,\r\n conversionKind: ConversionKind,\r\n wrapMode: WrapMode\r\n ): ExpressionRef {\r\n this.currentType = contextualType;\r\n var expr: ExpressionRef;\r\n switch (expression.kind) {\r\n case NodeKind.ASSERTION: {\r\n expr = this.compileAssertionExpression(expression, contextualType);\r\n break;\r\n }\r\n case NodeKind.BINARY: {\r\n expr = this.compileBinaryExpression(expression, contextualType);\r\n break;\r\n }\r\n case NodeKind.CALL: {\r\n expr = this.compileCallExpression(expression, contextualType);\r\n break;\r\n }\r\n case NodeKind.COMMA: {\r\n expr = this.compileCommaExpression(expression, contextualType);\r\n break;\r\n }\r\n case NodeKind.ELEMENTACCESS: {\r\n expr = this.compileElementAccessExpression(expression, contextualType);\r\n break;\r\n }\r\n case NodeKind.FUNCTION: {\r\n expr = this.compileFunctionExpression(expression, contextualType.signatureReference);\r\n break;\r\n }\r\n case NodeKind.IDENTIFIER:\r\n case NodeKind.FALSE:\r\n case NodeKind.NULL:\r\n case NodeKind.THIS:\r\n case NodeKind.SUPER:\r\n case NodeKind.TRUE: {\r\n expr = this.compileIdentifierExpression(\r\n expression,\r\n contextualType,\r\n conversionKind == ConversionKind.NONE // retain type of inlined constants\r\n );\r\n break;\r\n }\r\n case NodeKind.INSTANCEOF: {\r\n expr = this.compileInstanceOfExpression(expression, contextualType);\r\n break;\r\n }\r\n case NodeKind.LITERAL: {\r\n expr = this.compileLiteralExpression(expression, contextualType);\r\n break;\r\n }\r\n case NodeKind.NEW: {\r\n expr = this.compileNewExpression(expression, contextualType);\r\n break;\r\n }\r\n case NodeKind.PARENTHESIZED: {\r\n expr = this.compileParenthesizedExpression(expression, contextualType);\r\n break;\r\n }\r\n case NodeKind.PROPERTYACCESS: {\r\n expr = this.compilePropertyAccessExpression(\r\n expression,\r\n contextualType,\r\n conversionKind == ConversionKind.NONE // retain type of inlined constants\r\n );\r\n break;\r\n }\r\n case NodeKind.TERNARY: {\r\n expr = this.compileTernaryExpression(expression, contextualType);\r\n break;\r\n }\r\n case NodeKind.UNARYPOSTFIX: {\r\n expr = this.compileUnaryPostfixExpression(expression, contextualType);\r\n break;\r\n }\r\n case NodeKind.UNARYPREFIX: {\r\n expr = this.compileUnaryPrefixExpression(expression, contextualType);\r\n break;\r\n }\r\n default: {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n expr = this.module.createUnreachable();\r\n }\r\n }\r\n var currentType = this.currentType;\r\n if (conversionKind != ConversionKind.NONE && currentType != contextualType) {\r\n expr = this.convertExpression(expr, currentType, contextualType, conversionKind, wrapMode, expression);\r\n this.currentType = contextualType;\r\n } else if (wrapMode == WrapMode.WRAP) {\r\n expr = this.ensureSmallIntegerWrap(expr, currentType);\r\n }\r\n\r\n if (this.options.sourceMap) this.addDebugLocation(expr, expression.range);\r\n return expr;\r\n }\r\n\r\n compileExpressionRetainType(\r\n expression: Expression,\r\n contextualType: Type,\r\n wrapMode: WrapMode\r\n ): ExpressionRef {\r\n return this.compileExpression(\r\n expression,\r\n contextualType == Type.void\r\n ? Type.i32\r\n : contextualType,\r\n ConversionKind.NONE,\r\n wrapMode\r\n );\r\n }\r\n\r\n precomputeExpression(\r\n expression: Expression,\r\n contextualType: Type,\r\n conversionKind: ConversionKind,\r\n wrapMode: WrapMode\r\n ): ExpressionRef {\r\n return this.module.precomputeExpression(\r\n this.compileExpression(expression, contextualType, conversionKind, wrapMode)\r\n );\r\n }\r\n\r\n convertExpression(\r\n expr: ExpressionRef,\r\n fromType: Type,\r\n toType: Type,\r\n conversionKind: ConversionKind,\r\n wrapMode: WrapMode,\r\n reportNode: Node\r\n ): ExpressionRef {\r\n assert(conversionKind != ConversionKind.NONE);\r\n var module = this.module;\r\n\r\n // void to any\r\n if (fromType.kind == TypeKind.VOID) {\r\n assert(toType.kind != TypeKind.VOID); // convertExpression should not be called with void -> void\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_assignable_to_type_1,\r\n reportNode.range, fromType.toString(), toType.toString()\r\n );\r\n return module.createUnreachable();\r\n }\r\n\r\n // any to void\r\n if (toType.kind == TypeKind.VOID) return module.createDrop(expr);\r\n\r\n if (!fromType.isAssignableTo(toType)) {\r\n if (conversionKind == ConversionKind.IMPLICIT) {\r\n this.error(\r\n DiagnosticCode.Conversion_from_type_0_to_1_requires_an_explicit_cast,\r\n reportNode.range, fromType.toString(), toType.toString()\r\n ); // recoverable\r\n }\r\n }\r\n\r\n if (fromType.is(TypeFlags.FLOAT)) {\r\n\r\n // float to float\r\n if (toType.is(TypeFlags.FLOAT)) {\r\n if (fromType.kind == TypeKind.F32) {\r\n\r\n // f32 to f64\r\n if (toType.kind == TypeKind.F64) {\r\n expr = module.createUnary(UnaryOp.PromoteF32, expr);\r\n }\r\n\r\n // otherwise f32 to f32\r\n\r\n // f64 to f32\r\n } else if (toType.kind == TypeKind.F32) {\r\n expr = module.createUnary(UnaryOp.DemoteF64, expr);\r\n }\r\n\r\n // otherwise f64 to f64\r\n\r\n // float to int\r\n } else if (toType.is(TypeFlags.INTEGER)) {\r\n\r\n // f32 to int\r\n if (fromType.kind == TypeKind.F32) {\r\n if (toType == Type.bool) {\r\n expr = module.createBinary(BinaryOp.NeF32, expr, module.createF32(0));\r\n wrapMode = WrapMode.NONE;\r\n } else if (toType.is(TypeFlags.SIGNED)) {\r\n if (toType.is(TypeFlags.LONG)) {\r\n expr = module.createUnary(UnaryOp.TruncF32ToI64, expr);\r\n } else {\r\n expr = module.createUnary(UnaryOp.TruncF32ToI32, expr);\r\n }\r\n } else {\r\n if (toType.is(TypeFlags.LONG)) {\r\n expr = module.createUnary(UnaryOp.TruncF32ToU64, expr);\r\n } else {\r\n expr = module.createUnary(UnaryOp.TruncF32ToU32, expr);\r\n }\r\n }\r\n\r\n // f64 to int\r\n } else {\r\n if (toType == Type.bool) {\r\n expr = module.createBinary(BinaryOp.NeF64, expr, module.createF64(0));\r\n wrapMode = WrapMode.NONE;\r\n } else if (toType.is(TypeFlags.SIGNED)) {\r\n if (toType.is(TypeFlags.LONG)) {\r\n expr = module.createUnary(UnaryOp.TruncF64ToI64, expr);\r\n } else {\r\n expr = module.createUnary(UnaryOp.TruncF64ToI32, expr);\r\n }\r\n } else {\r\n if (toType.is(TypeFlags.LONG)) {\r\n expr = module.createUnary(UnaryOp.TruncF64ToU64, expr);\r\n } else {\r\n expr = module.createUnary(UnaryOp.TruncF64ToU32, expr);\r\n }\r\n }\r\n }\r\n\r\n // float to void\r\n } else {\r\n assert(toType.flags == TypeFlags.NONE, \"void type expected\");\r\n expr = module.createDrop(expr);\r\n }\r\n\r\n // int to float\r\n } else if (fromType.is(TypeFlags.INTEGER) && toType.is(TypeFlags.FLOAT)) {\r\n\r\n // int to f32\r\n if (toType.kind == TypeKind.F32) {\r\n if (fromType.is(TypeFlags.LONG)) {\r\n expr = module.createUnary(\r\n fromType.is(TypeFlags.SIGNED)\r\n ? UnaryOp.ConvertI64ToF32\r\n : UnaryOp.ConvertU64ToF32,\r\n expr\r\n );\r\n } else {\r\n expr = module.createUnary(\r\n fromType.is(TypeFlags.SIGNED)\r\n ? UnaryOp.ConvertI32ToF32\r\n : UnaryOp.ConvertU32ToF32,\r\n expr\r\n );\r\n }\r\n\r\n // int to f64\r\n } else {\r\n if (fromType.is(TypeFlags.LONG)) {\r\n expr = module.createUnary(\r\n fromType.is(TypeFlags.SIGNED)\r\n ? UnaryOp.ConvertI64ToF64\r\n : UnaryOp.ConvertU64ToF64,\r\n expr\r\n );\r\n } else {\r\n expr = module.createUnary(\r\n fromType.is(TypeFlags.SIGNED)\r\n ? UnaryOp.ConvertI32ToF64\r\n : UnaryOp.ConvertU32ToF64,\r\n expr\r\n );\r\n }\r\n }\r\n\r\n // int to int\r\n } else {\r\n // i64 to ...\r\n if (fromType.is(TypeFlags.LONG)) {\r\n\r\n // i64 to i32 or smaller\r\n if (toType == Type.bool) {\r\n expr = module.createBinary(BinaryOp.NeI64, expr, module.createI64(0));\r\n wrapMode = WrapMode.NONE;\r\n } else if (!toType.is(TypeFlags.LONG)) {\r\n expr = module.createUnary(UnaryOp.WrapI64, expr); // discards upper bits\r\n }\r\n\r\n // i32 or smaller to i64\r\n } else if (toType.is(TypeFlags.LONG)) {\r\n expr = module.createUnary(\r\n fromType.is(TypeFlags.SIGNED) ? UnaryOp.ExtendI32 : UnaryOp.ExtendU32,\r\n this.ensureSmallIntegerWrap(expr, fromType) // must clear garbage bits\r\n );\r\n wrapMode = WrapMode.NONE;\r\n\r\n // i32 to i32\r\n } else {\r\n // small i32 to ...\r\n if (fromType.is(TypeFlags.SHORT)) {\r\n // small i32 to larger i32\r\n if (fromType.size < toType.size) {\r\n expr = this.ensureSmallIntegerWrap(expr, fromType); // must clear garbage bits\r\n wrapMode = WrapMode.NONE;\r\n }\r\n }\r\n }\r\n }\r\n\r\n this.currentType = toType;\r\n return wrapMode == WrapMode.WRAP\r\n ? this.ensureSmallIntegerWrap(expr, toType)\r\n : expr;\r\n }\r\n\r\n compileAssertionExpression(expression: AssertionExpression, contextualType: Type): ExpressionRef {\r\n switch (expression.assertionKind) {\r\n case AssertionKind.PREFIX:\r\n case AssertionKind.AS: {\r\n let toType = this.resolver.resolveType( // reports\r\n assert(expression.toType),\r\n this.currentFlow.actualFunction,\r\n this.currentFlow.contextualTypeArguments\r\n );\r\n if (!toType) return this.module.createUnreachable();\r\n return this.compileExpression(expression.expression, toType, ConversionKind.EXPLICIT, WrapMode.NONE);\r\n }\r\n case AssertionKind.NONNULL: {\r\n assert(!expression.toType);\r\n let expr = this.compileExpressionRetainType(expression.expression, contextualType, WrapMode.NONE);\r\n this.currentType = this.currentType.nonNullableType;\r\n return expr;\r\n }\r\n default: assert(false);\r\n }\r\n return this.module.createUnreachable();\r\n }\r\n\r\n private f32ModInstance: Function | null = null;\r\n private f64ModInstance: Function | null = null;\r\n private f32PowInstance: Function | null = null;\r\n private f64PowInstance: Function | null = null;\r\n\r\n compileBinaryExpression(\r\n expression: BinaryExpression,\r\n contextualType: Type\r\n ): ExpressionRef {\r\n var module = this.module;\r\n var left = expression.left;\r\n var right = expression.right;\r\n\r\n var leftExpr: ExpressionRef;\r\n var leftType: Type;\r\n var rightExpr: ExpressionRef;\r\n var rightType: Type;\r\n var commonType: Type | null;\r\n\r\n var expr: ExpressionRef;\r\n var compound = false;\r\n\r\n var operator = expression.operator;\r\n switch (operator) {\r\n case Token.LESSTHAN: {\r\n leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE);\r\n leftType = this.currentType;\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.LT);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.createUnreachable();\r\n }\r\n\r\n rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE);\r\n rightType = this.currentType;\r\n if (commonType = Type.commonDenominator(leftType, rightType, true)) {\r\n leftExpr = this.convertExpression(\r\n leftExpr,\r\n leftType,\r\n leftType = commonType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.WRAP,\r\n left\r\n );\r\n rightExpr = this.convertExpression(\r\n rightExpr,\r\n rightType,\r\n rightType = commonType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.WRAP,\r\n right\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,\r\n expression.range, \"<\", leftType.toString(), rightType.toString()\r\n );\r\n this.currentType = contextualType;\r\n return module.createUnreachable();\r\n }\r\n switch (commonType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32: {\r\n expr = module.createBinary(BinaryOp.LtI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.I64: {\r\n expr = module.createBinary(BinaryOp.LtI64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.ISIZE: {\r\n expr = module.createBinary(\r\n this.options.isWasm64\r\n ? BinaryOp.LtI64\r\n : BinaryOp.LtI32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: {\r\n expr = module.createBinary(BinaryOp.LtU32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n expr = module.createBinary(\r\n this.options.isWasm64\r\n ? BinaryOp.LtU64\r\n : BinaryOp.LtU32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.U64: {\r\n expr = module.createBinary(BinaryOp.LtU64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n expr = module.createBinary(BinaryOp.LtF32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.createBinary(BinaryOp.LtF64, leftExpr, rightExpr);\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.createUnreachable();\r\n }\r\n }\r\n this.currentType = Type.bool;\r\n break;\r\n }\r\n case Token.GREATERTHAN: {\r\n leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE);\r\n leftType = this.currentType;\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.GT);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.createUnreachable();\r\n }\r\n\r\n rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE);\r\n rightType = this.currentType;\r\n if (commonType = Type.commonDenominator(leftType, rightType, true)) {\r\n leftExpr = this.convertExpression(\r\n leftExpr,\r\n leftType,\r\n leftType = commonType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.WRAP,\r\n left\r\n );\r\n rightExpr = this.convertExpression(\r\n rightExpr,\r\n rightType,\r\n rightType = commonType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.WRAP,\r\n right\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,\r\n expression.range, \">\", leftType.toString(), rightType.toString()\r\n );\r\n this.currentType = contextualType;\r\n return module.createUnreachable();\r\n }\r\n switch (commonType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32: {\r\n expr = module.createBinary(BinaryOp.GtI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.ISIZE: {\r\n expr = module.createBinary(\r\n this.options.isWasm64\r\n ? BinaryOp.GtI64\r\n : BinaryOp.GtI32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.I64: {\r\n expr = module.createBinary(BinaryOp.GtI64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: {\r\n expr = module.createBinary(BinaryOp.GtU32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n expr = module.createBinary(\r\n this.options.isWasm64\r\n ? BinaryOp.GtU64\r\n : BinaryOp.GtU32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.U64: {\r\n expr = module.createBinary(BinaryOp.GtU64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n expr = module.createBinary(BinaryOp.GtF32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.createBinary(BinaryOp.GtF64, leftExpr, rightExpr);\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.createUnreachable();\r\n }\r\n }\r\n this.currentType = Type.bool;\r\n break;\r\n }\r\n case Token.LESSTHAN_EQUALS: {\r\n leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE);\r\n leftType = this.currentType;\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.LE);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.createUnreachable();\r\n }\r\n\r\n rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE);\r\n rightType = this.currentType;\r\n if (commonType = Type.commonDenominator(leftType, rightType, true)) {\r\n leftExpr = this.convertExpression(\r\n leftExpr,\r\n leftType,\r\n leftType = commonType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.WRAP,\r\n left\r\n );\r\n rightExpr = this.convertExpression(\r\n rightExpr,\r\n rightType,\r\n rightType = commonType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.WRAP,\r\n right\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,\r\n expression.range, \"<=\", leftType.toString(), rightType.toString()\r\n );\r\n this.currentType = contextualType;\r\n return module.createUnreachable();\r\n }\r\n switch (commonType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32: {\r\n expr = module.createBinary(BinaryOp.LeI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.ISIZE: {\r\n expr = module.createBinary(\r\n this.options.isWasm64\r\n ? BinaryOp.LeI64\r\n : BinaryOp.LeI32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.I64: {\r\n expr = module.createBinary(BinaryOp.LeI64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: {\r\n expr = module.createBinary(BinaryOp.LeU32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n expr = module.createBinary(\r\n this.options.isWasm64\r\n ? BinaryOp.LeU64\r\n : BinaryOp.LeU32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.U64: {\r\n expr = module.createBinary(BinaryOp.LeU64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n expr = module.createBinary(BinaryOp.LeF32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.createBinary(BinaryOp.LeF64, leftExpr, rightExpr);\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.createUnreachable();\r\n }\r\n }\r\n this.currentType = Type.bool;\r\n break;\r\n }\r\n case Token.GREATERTHAN_EQUALS: {\r\n leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE);\r\n leftType = this.currentType;\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.GE);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.createUnreachable();\r\n }\r\n\r\n rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE);\r\n rightType = this.currentType;\r\n if (commonType = Type.commonDenominator(leftType, rightType, true)) {\r\n leftExpr = this.convertExpression(\r\n leftExpr,\r\n leftType,\r\n leftType = commonType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.WRAP,\r\n left\r\n );\r\n rightExpr = this.convertExpression(\r\n rightExpr,\r\n rightType,\r\n rightType = commonType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.WRAP,\r\n right\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,\r\n expression.range, \">=\", leftType.toString(), rightType.toString()\r\n );\r\n this.currentType = contextualType;\r\n return module.createUnreachable();\r\n }\r\n switch (commonType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32: {\r\n expr = module.createBinary(BinaryOp.GeI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.ISIZE: {\r\n expr = module.createBinary(\r\n this.options.isWasm64\r\n ? BinaryOp.GeI64\r\n : BinaryOp.GeI32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.I64: {\r\n expr = module.createBinary(BinaryOp.GeI64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: {\r\n expr = module.createBinary(BinaryOp.GeU32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n expr = module.createBinary(\r\n this.options.isWasm64\r\n ? BinaryOp.GeU64\r\n : BinaryOp.GeU32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.U64: {\r\n expr = module.createBinary(BinaryOp.GeU64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n expr = module.createBinary(BinaryOp.GeF32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.createBinary(BinaryOp.GeF64, leftExpr, rightExpr);\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.createUnreachable();\r\n }\r\n }\r\n this.currentType = Type.bool;\r\n break;\r\n }\r\n\r\n case Token.EQUALS_EQUALS_EQUALS:\r\n case Token.EQUALS_EQUALS: {\r\n\r\n // NOTE that this favors correctness, in terms of emitting a binary expression, over\r\n // checking for a possible use of unary EQZ. while the most classic of all optimizations,\r\n // that's not what the source told us to do. for reference, `!left` emits unary EQZ.\r\n\r\n leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE);\r\n leftType = this.currentType;\r\n\r\n // check operator overload\r\n if (operator == Token.EQUALS_EQUALS && this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.EQ);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n // still allow '==' with references\r\n }\r\n\r\n rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE);\r\n rightType = this.currentType;\r\n if (commonType = Type.commonDenominator(leftType, rightType, false)) {\r\n leftExpr = this.convertExpression(\r\n leftExpr,\r\n leftType,\r\n leftType = commonType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.WRAP,\r\n left\r\n );\r\n rightExpr = this.convertExpression(\r\n rightExpr,\r\n rightType,\r\n rightType = commonType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.WRAP,\r\n right\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,\r\n expression.range, operatorTokenToString(expression.operator), leftType.toString(), rightType.toString()\r\n );\r\n this.currentType = contextualType;\r\n return module.createUnreachable();\r\n }\r\n switch (commonType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: {\r\n expr = module.createBinary(BinaryOp.EqI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n expr = module.createBinary(\r\n this.options.isWasm64\r\n ? BinaryOp.EqI64\r\n : BinaryOp.EqI32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.createBinary(BinaryOp.EqI64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n expr = module.createBinary(BinaryOp.EqF32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.createBinary(BinaryOp.EqF64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.V128: {\r\n expr = module.createUnary(UnaryOp.AllTrueVecI8x16,\r\n module.createBinary(BinaryOp.EqVecI8x16, leftExpr, rightExpr)\r\n );\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.createUnreachable();\r\n }\r\n }\r\n this.currentType = Type.bool;\r\n break;\r\n }\r\n case Token.EXCLAMATION_EQUALS_EQUALS:\r\n case Token.EXCLAMATION_EQUALS: {\r\n leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE);\r\n leftType = this.currentType;\r\n\r\n // check operator overload\r\n if (operator == Token.EXCLAMATION_EQUALS && this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.NE);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n // still allow '!=' with references\r\n }\r\n\r\n rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE);\r\n rightType = this.currentType;\r\n if (commonType = Type.commonDenominator(leftType, rightType, false)) {\r\n leftExpr = this.convertExpression(\r\n leftExpr,\r\n leftType,\r\n leftType = commonType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.WRAP,\r\n left\r\n );\r\n rightExpr = this.convertExpression(\r\n rightExpr,\r\n rightType,\r\n rightType = commonType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.WRAP,\r\n right\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,\r\n expression.range, operatorTokenToString(expression.operator), leftType.toString(), rightType.toString()\r\n );\r\n this.currentType = contextualType;\r\n return module.createUnreachable();\r\n }\r\n switch (commonType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: {\r\n expr = module.createBinary(BinaryOp.NeI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n expr = module.createBinary(\r\n this.options.isWasm64\r\n ? BinaryOp.NeI64\r\n : BinaryOp.NeI32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.createBinary(BinaryOp.NeI64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n expr = module.createBinary(BinaryOp.NeF32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.createBinary(BinaryOp.NeF64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.V128: {\r\n expr = module.createUnary(UnaryOp.AnyTrueVecI8x16,\r\n module.createBinary(BinaryOp.NeVecI8x16, leftExpr, rightExpr)\r\n );\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.createUnreachable();\r\n }\r\n }\r\n this.currentType = Type.bool;\r\n break;\r\n }\r\n case Token.EQUALS: {\r\n return this.compileAssignment(left, right, contextualType);\r\n }\r\n case Token.PLUS_EQUALS: compound = true;\r\n case Token.PLUS: {\r\n leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE);\r\n leftType = this.currentType;\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.ADD);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.createUnreachable();\r\n }\r\n\r\n if (compound) {\r\n rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n } else {\r\n rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE);\r\n rightType = this.currentType;\r\n if (commonType = Type.commonDenominator(leftType, rightType, false)) {\r\n leftExpr = this.convertExpression(\r\n leftExpr,\r\n leftType,\r\n leftType = commonType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE,\r\n left\r\n );\r\n rightExpr = this.convertExpression(\r\n rightExpr,\r\n rightType,\r\n rightType = commonType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE,\r\n right\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,\r\n expression.range, \"+\", leftType.toString(), rightType.toString()\r\n );\r\n this.currentType = contextualType;\r\n return module.createUnreachable();\r\n }\r\n }\r\n switch (this.currentType.kind) {\r\n case TypeKind.I8: // addition might overflow\r\n case TypeKind.I16: // ^\r\n case TypeKind.U8: // ^\r\n case TypeKind.U16: // ^\r\n case TypeKind.BOOL: // ^\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n expr = module.createBinary(BinaryOp.AddI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n expr = module.createBinary(\r\n this.options.isWasm64\r\n ? BinaryOp.AddI64\r\n : BinaryOp.AddI32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.createBinary(BinaryOp.AddI64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n expr = module.createBinary(BinaryOp.AddF32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.createBinary(BinaryOp.AddF64, leftExpr, rightExpr);\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.createUnreachable();\r\n }\r\n }\r\n break;\r\n }\r\n case Token.MINUS_EQUALS: compound = true;\r\n case Token.MINUS: {\r\n leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE);\r\n leftType = this.currentType;\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.SUB);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.createUnreachable();\r\n }\r\n\r\n if (compound) {\r\n rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n rightType = this.currentType;\r\n } else {\r\n rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE);\r\n rightType = this.currentType;\r\n if (commonType = Type.commonDenominator(leftType, rightType, false)) {\r\n leftExpr = this.convertExpression(\r\n leftExpr,\r\n leftType,\r\n leftType = commonType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE,\r\n left\r\n );\r\n rightExpr = this.convertExpression(\r\n rightExpr,\r\n rightType,\r\n rightType = commonType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE,\r\n right\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,\r\n expression.range, \"-\", leftType.toString(), rightType.toString()\r\n );\r\n this.currentType = contextualType;\r\n return module.createUnreachable();\r\n }\r\n }\r\n switch (this.currentType.kind) {\r\n case TypeKind.I8: // subtraction might overflow\r\n case TypeKind.I16: // ^\r\n case TypeKind.U8: // ^\r\n case TypeKind.U16: // ^\r\n case TypeKind.BOOL: // ^\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n expr = module.createBinary(BinaryOp.SubI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n expr = module.createBinary(\r\n this.options.isWasm64\r\n ? BinaryOp.SubI64\r\n : BinaryOp.SubI32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.createBinary(BinaryOp.SubI64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n expr = module.createBinary(BinaryOp.SubF32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.createBinary(BinaryOp.SubF64, leftExpr, rightExpr);\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.createUnreachable();\r\n }\r\n }\r\n break;\r\n }\r\n case Token.ASTERISK_EQUALS: compound = true;\r\n case Token.ASTERISK: {\r\n leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE);\r\n leftType = this.currentType;\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.MUL);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.createUnreachable();\r\n }\r\n\r\n if (compound) {\r\n leftExpr = this.ensureSmallIntegerWrap(leftExpr, leftType);\r\n rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.WRAP);\r\n } else {\r\n rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE);\r\n rightType = this.currentType;\r\n if (commonType = Type.commonDenominator(leftType, rightType, false)) {\r\n leftExpr = this.convertExpression(\r\n leftExpr,\r\n leftType,\r\n leftType = commonType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE,\r\n left\r\n );\r\n rightExpr = this.convertExpression(\r\n rightExpr,\r\n rightType,\r\n rightType = commonType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE,\r\n right\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,\r\n expression.range, \"*\", leftType.toString(), rightType.toString()\r\n );\r\n this.currentType = contextualType;\r\n return module.createUnreachable();\r\n }\r\n }\r\n switch (this.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.BOOL:\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n expr = module.createBinary(BinaryOp.MulI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n expr = module.createBinary(\r\n this.options.isWasm64\r\n ? BinaryOp.MulI64\r\n : BinaryOp.MulI32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.createBinary(BinaryOp.MulI64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n expr = module.createBinary(BinaryOp.MulF32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.createBinary(BinaryOp.MulF64, leftExpr, rightExpr);\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.createUnreachable();\r\n }\r\n }\r\n break;\r\n }\r\n case Token.ASTERISK_ASTERISK_EQUALS: compound = true;\r\n case Token.ASTERISK_ASTERISK: {\r\n leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE);\r\n leftType = this.currentType;\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.POW);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.createUnreachable();\r\n }\r\n\r\n let instance: Function | null;\r\n\r\n // Mathf.pow if lhs is f32 (result is f32)\r\n if (this.currentType.kind == TypeKind.F32) {\r\n rightExpr = this.compileExpression(right, Type.f32, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n rightType = this.currentType;\r\n if (!(instance = this.f32PowInstance)) {\r\n let namespace = this.program.lookupGlobal(LibrarySymbols.Mathf);\r\n if (!namespace) {\r\n this.error(\r\n DiagnosticCode.Cannot_find_name_0,\r\n expression.range, \"Mathf\"\r\n );\r\n expr = module.createUnreachable();\r\n break;\r\n }\r\n let prototype = namespace.members ? namespace.members.get(LibrarySymbols.pow) : null;\r\n if (!prototype) {\r\n this.error(\r\n DiagnosticCode.Cannot_find_name_0,\r\n expression.range, \"Mathf.pow\"\r\n );\r\n expr = module.createUnreachable();\r\n break;\r\n }\r\n assert(prototype.kind == ElementKind.FUNCTION_PROTOTYPE);\r\n this.f32PowInstance = instance = this.resolver.resolveFunction(prototype, null);\r\n }\r\n\r\n // Math.pow otherwise (result is f64)\r\n // TODO: should the result be converted back?\r\n } else {\r\n leftExpr = this.convertExpression(\r\n leftExpr,\r\n this.currentType,\r\n Type.f64,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE,\r\n left\r\n );\r\n leftType = this.currentType;\r\n rightExpr = this.compileExpression(\r\n right,\r\n Type.f64,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n rightType = this.currentType;\r\n if (!(instance = this.f64PowInstance)) {\r\n let namespace = this.program.lookupGlobal(LibrarySymbols.Math);\r\n if (!namespace) {\r\n this.error(\r\n DiagnosticCode.Cannot_find_name_0,\r\n expression.range, \"Math\"\r\n );\r\n expr = module.createUnreachable();\r\n break;\r\n }\r\n let prototype = namespace.members ? namespace.members.get(LibrarySymbols.pow) : null;\r\n if (!prototype) {\r\n this.error(\r\n DiagnosticCode.Cannot_find_name_0,\r\n expression.range, \"Math.pow\"\r\n );\r\n expr = module.createUnreachable();\r\n break;\r\n }\r\n assert(prototype.kind == ElementKind.FUNCTION_PROTOTYPE);\r\n this.f64PowInstance = instance = this.resolver.resolveFunction(prototype, null);\r\n }\r\n }\r\n if (!(instance && this.compileFunction(instance))) {\r\n expr = module.createUnreachable();\r\n } else {\r\n expr = this.makeCallDirect(instance, [ leftExpr, rightExpr ]);\r\n }\r\n break;\r\n }\r\n case Token.SLASH_EQUALS: compound = true;\r\n case Token.SLASH: {\r\n leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE);\r\n leftType = this.currentType;\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.DIV);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.createUnreachable();\r\n }\r\n\r\n if (compound) {\r\n leftExpr = this.ensureSmallIntegerWrap(leftExpr, leftType);\r\n rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.WRAP);\r\n rightType = this.currentType;\r\n } else {\r\n rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE);\r\n rightType = this.currentType;\r\n if (commonType = Type.commonDenominator(leftType, rightType, false)) {\r\n leftExpr = this.convertExpression(\r\n leftExpr,\r\n leftType,\r\n leftType = commonType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.WRAP, // !\r\n left\r\n );\r\n rightExpr = this.convertExpression(\r\n rightExpr,\r\n rightType,\r\n rightType = commonType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.WRAP, // !\r\n right\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,\r\n expression.range, \"/\", leftType.toString(), rightType.toString()\r\n );\r\n this.currentType = contextualType;\r\n return module.createUnreachable();\r\n }\r\n }\r\n switch (this.currentType.kind) {\r\n case TypeKind.I8: // signed div on signed small integers might overflow, e.g. -128/-1\r\n case TypeKind.I16: // ^\r\n case TypeKind.I32: {\r\n expr = module.createBinary(BinaryOp.DivI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.ISIZE: {\r\n expr = module.createBinary(\r\n this.options.isWasm64\r\n ? BinaryOp.DivI64\r\n : BinaryOp.DivI32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.I64: {\r\n expr = module.createBinary(BinaryOp.DivI64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.BOOL: {\r\n expr = module.createBinary(BinaryOp.DivU32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.U32: {\r\n expr = module.createBinary(BinaryOp.DivU32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n expr = module.createBinary(\r\n this.options.isWasm64\r\n ? BinaryOp.DivU64\r\n : BinaryOp.DivU32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.U64: {\r\n expr = module.createBinary(BinaryOp.DivU64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n expr = module.createBinary(BinaryOp.DivF32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.createBinary(BinaryOp.DivF64, leftExpr, rightExpr);\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.createUnreachable();\r\n }\r\n }\r\n break;\r\n }\r\n case Token.PERCENT_EQUALS: compound = true;\r\n case Token.PERCENT: {\r\n leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE);\r\n leftType = this.currentType;\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.REM);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.createUnreachable();\r\n }\r\n\r\n if (compound) {\r\n leftExpr = this.ensureSmallIntegerWrap(leftExpr, leftType);\r\n rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.WRAP);\r\n rightType = this.currentType;\r\n } else {\r\n rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE);\r\n rightType = this.currentType;\r\n if (commonType = Type.commonDenominator(leftType, rightType, false)) {\r\n leftExpr = this.convertExpression(\r\n leftExpr,\r\n leftType,\r\n leftType = commonType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.WRAP, // !\r\n left\r\n );\r\n rightExpr = this.convertExpression(\r\n rightExpr,\r\n rightType,\r\n rightType = commonType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.WRAP, // !\r\n right\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,\r\n expression.range, \"%\", leftType.toString(), rightType.toString()\r\n );\r\n this.currentType = contextualType;\r\n return module.createUnreachable();\r\n }\r\n }\r\n switch (this.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16: {\r\n expr = module.createBinary(BinaryOp.RemI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.I32: {\r\n expr = module.createBinary(BinaryOp.RemI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.ISIZE: {\r\n expr = module.createBinary(\r\n this.options.isWasm64\r\n ? BinaryOp.RemI64\r\n : BinaryOp.RemI32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.I64: {\r\n expr = module.createBinary(BinaryOp.RemI64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.BOOL: {\r\n expr = module.createBinary(BinaryOp.RemU32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.U32: {\r\n expr = module.createBinary(BinaryOp.RemU32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n expr = module.createBinary(\r\n this.options.isWasm64\r\n ? BinaryOp.RemU64\r\n : BinaryOp.RemU32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.U64: {\r\n expr = module.createBinary(BinaryOp.RemU64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n let instance = this.f32ModInstance;\r\n if (!instance) {\r\n let namespace = this.program.lookupGlobal(LibrarySymbols.Mathf);\r\n if (!namespace) {\r\n this.error(\r\n DiagnosticCode.Cannot_find_name_0,\r\n expression.range, \"Mathf\"\r\n );\r\n expr = module.createUnreachable();\r\n break;\r\n }\r\n let prototype = namespace.members ? namespace.members.get(LibrarySymbols.mod) : null;\r\n if (!prototype) {\r\n this.error(\r\n DiagnosticCode.Cannot_find_name_0,\r\n expression.range, \"Mathf.mod\"\r\n );\r\n expr = module.createUnreachable();\r\n break;\r\n }\r\n assert(prototype.kind == ElementKind.FUNCTION_PROTOTYPE);\r\n this.f32ModInstance = instance = this.resolver.resolveFunction(prototype, null);\r\n }\r\n if (!(instance && this.compileFunction(instance))) {\r\n expr = module.createUnreachable();\r\n } else {\r\n expr = this.makeCallDirect(instance, [ leftExpr, rightExpr ]);\r\n }\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n let instance = this.f64ModInstance;\r\n if (!instance) {\r\n let namespace = this.program.lookupGlobal(LibrarySymbols.Math);\r\n if (!namespace) {\r\n this.error(\r\n DiagnosticCode.Cannot_find_name_0,\r\n expression.range, \"Math\"\r\n );\r\n expr = module.createUnreachable();\r\n break;\r\n }\r\n let prototype = namespace.members ? namespace.members.get(LibrarySymbols.mod) : null;\r\n if (!prototype) {\r\n this.error(\r\n DiagnosticCode.Cannot_find_name_0,\r\n expression.range, \"Math.mod\"\r\n );\r\n expr = module.createUnreachable();\r\n break;\r\n }\r\n assert(prototype.kind == ElementKind.FUNCTION_PROTOTYPE);\r\n this.f64ModInstance = instance = this.resolver.resolveFunction(prototype, null);\r\n }\r\n if (!(instance && this.compileFunction(instance))) {\r\n expr = module.createUnreachable();\r\n } else {\r\n expr = this.makeCallDirect(instance, [ leftExpr, rightExpr ]);\r\n }\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.createUnreachable();\r\n }\r\n }\r\n break;\r\n }\r\n case Token.LESSTHAN_LESSTHAN_EQUALS: compound = true;\r\n case Token.LESSTHAN_LESSTHAN: {\r\n leftExpr = this.compileExpressionRetainType(left, contextualType.intType, WrapMode.NONE);\r\n leftType = this.currentType;\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.BITWISE_SHL);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.createUnreachable();\r\n }\r\n\r\n rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n rightType = this.currentType;\r\n switch (this.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.BOOL:\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n expr = module.createBinary(BinaryOp.ShlI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.createBinary(BinaryOp.ShlI64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n expr = module.createBinary(\r\n this.options.isWasm64\r\n ? BinaryOp.ShlI64\r\n : BinaryOp.ShlI32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.F32:\r\n case TypeKind.F64: {\r\n this.error(\r\n DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,\r\n expression.range, operatorTokenToString(expression.operator), this.currentType.toString()\r\n );\r\n return module.createUnreachable();\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.createUnreachable();\r\n }\r\n }\r\n break;\r\n }\r\n case Token.GREATERTHAN_GREATERTHAN_EQUALS: compound = true;\r\n case Token.GREATERTHAN_GREATERTHAN: {\r\n leftExpr = this.compileExpressionRetainType(left, contextualType.intType, WrapMode.NONE);\r\n leftType = this.currentType;\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.BITWISE_SHR);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.createUnreachable();\r\n }\r\n\r\n leftExpr = this.ensureSmallIntegerWrap(leftExpr, leftType); // must clear garbage bits\r\n rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.WRAP);\r\n rightType = this.currentType;\r\n switch (this.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16: {\r\n expr = module.createBinary(BinaryOp.ShrI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.I32: {\r\n expr = module.createBinary(BinaryOp.ShrI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.I64: {\r\n expr = module.createBinary(BinaryOp.ShrI64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.ISIZE: {\r\n expr = module.createBinary(\r\n this.options.isWasm64\r\n ? BinaryOp.ShrI64\r\n : BinaryOp.ShrI32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.BOOL: {\r\n expr = module.createBinary(BinaryOp.ShrU32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.U32: {\r\n expr = module.createBinary(BinaryOp.ShrU32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.U64: {\r\n expr = module.createBinary(BinaryOp.ShrU64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n expr = module.createBinary(\r\n this.options.isWasm64\r\n ? BinaryOp.ShrU64\r\n : BinaryOp.ShrU32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.F32:\r\n case TypeKind.F64: {\r\n this.error(\r\n DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,\r\n expression.range, operatorTokenToString(expression.operator), this.currentType.toString()\r\n );\r\n return module.createUnreachable();\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.createUnreachable();\r\n }\r\n }\r\n break;\r\n }\r\n case Token.GREATERTHAN_GREATERTHAN_GREATERTHAN_EQUALS: compound = true;\r\n case Token.GREATERTHAN_GREATERTHAN_GREATERTHAN: {\r\n leftExpr = this.compileExpressionRetainType(left, contextualType.intType, WrapMode.NONE);\r\n leftType = this.currentType;\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.BITWISE_SHR_U);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.createUnreachable();\r\n }\r\n\r\n leftExpr = this.ensureSmallIntegerWrap(leftExpr, leftType); // must clear garbage bits\r\n rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n rightType = this.currentType;\r\n switch (this.currentType.kind) {\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.BOOL: { // assumes that unsigned shr on unsigned small integers does not overflow\r\n expr = module.createBinary(BinaryOp.ShrU32, leftExpr, rightExpr);\r\n }\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n expr = module.createBinary(BinaryOp.ShrU32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.createBinary(BinaryOp.ShrU64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n expr = module.createBinary(\r\n this.options.isWasm64\r\n ? BinaryOp.ShrU64\r\n : BinaryOp.ShrU32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.F32:\r\n case TypeKind.F64: {\r\n this.error(\r\n DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,\r\n expression.range, operatorTokenToString(expression.operator), this.currentType.toString()\r\n );\r\n return module.createUnreachable();\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.createUnreachable();\r\n }\r\n }\r\n break;\r\n }\r\n case Token.AMPERSAND_EQUALS: compound = true;\r\n case Token.AMPERSAND: {\r\n leftExpr = this.compileExpressionRetainType(left, contextualType.intType, WrapMode.NONE);\r\n leftType = this.currentType;\r\n\r\n // check operator overloadd\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.BITWISE_AND);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.createUnreachable();\r\n }\r\n\r\n if (compound) {\r\n rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n rightType = this.currentType;\r\n } else {\r\n rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE);\r\n rightType = this.currentType;\r\n if (commonType = Type.commonDenominator(leftType, rightType, false)) {\r\n leftExpr = this.convertExpression(\r\n leftExpr,\r\n leftType,\r\n leftType = commonType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE,\r\n left\r\n );\r\n rightExpr = this.convertExpression(\r\n rightExpr,\r\n rightType,\r\n rightType = commonType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE,\r\n right\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,\r\n expression.range, \"&\", leftType.toString(), rightType.toString()\r\n );\r\n this.currentType = contextualType;\r\n return module.createUnreachable();\r\n }\r\n }\r\n switch (this.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.BOOL:\r\n case TypeKind.U32: {\r\n expr = module.createBinary(BinaryOp.AndI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.createBinary(BinaryOp.AndI64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n expr = module.createBinary(\r\n this.options.isWasm64\r\n ? BinaryOp.AndI64\r\n : BinaryOp.AndI32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.F32:\r\n case TypeKind.F64: {\r\n this.error(\r\n DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,\r\n expression.range, operatorTokenToString(expression.operator), this.currentType.toString()\r\n );\r\n return module.createUnreachable();\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.createUnreachable();\r\n }\r\n }\r\n break;\r\n }\r\n case Token.BAR_EQUALS: compound = true;\r\n case Token.BAR: {\r\n leftExpr = this.compileExpressionRetainType(left, contextualType.intType, WrapMode.NONE);\r\n leftType = this.currentType;\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.BITWISE_OR);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.createUnreachable();\r\n }\r\n\r\n if (compound) {\r\n rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n rightType = this.currentType;\r\n } else {\r\n rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE);\r\n rightType = this.currentType;\r\n if (commonType = Type.commonDenominator(leftType, rightType, false)) {\r\n leftExpr = this.convertExpression(\r\n leftExpr,\r\n leftType,\r\n leftType = commonType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE,\r\n left\r\n );\r\n rightExpr = this.convertExpression(\r\n rightExpr,\r\n rightType,\r\n rightType = commonType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE,\r\n right\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,\r\n expression.range, \"|\", leftType.toString(), rightType.toString()\r\n );\r\n this.currentType = contextualType;\r\n return module.createUnreachable();\r\n }\r\n }\r\n switch (this.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.BOOL: {\r\n expr = module.createBinary(BinaryOp.OrI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n expr = module.createBinary(BinaryOp.OrI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.createBinary(BinaryOp.OrI64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n expr = module.createBinary(\r\n this.options.isWasm64\r\n ? BinaryOp.OrI64\r\n : BinaryOp.OrI32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.F32:\r\n case TypeKind.F64: {\r\n this.error(\r\n DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,\r\n expression.range, operatorTokenToString(expression.operator), this.currentType.toString()\r\n );\r\n return module.createUnreachable();\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.createUnreachable();\r\n }\r\n }\r\n break;\r\n }\r\n case Token.CARET_EQUALS: compound = true;\r\n case Token.CARET: {\r\n leftExpr = this.compileExpressionRetainType(left, contextualType.intType, WrapMode.NONE);\r\n leftType = this.currentType;\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.BITWISE_XOR);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.createUnreachable();\r\n }\r\n\r\n if (compound) {\r\n rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n rightType = this.currentType;\r\n } else {\r\n rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE);\r\n rightType = this.currentType;\r\n if (commonType = Type.commonDenominator(leftType, rightType, false)) {\r\n leftExpr = this.convertExpression(\r\n leftExpr,\r\n leftType,\r\n leftType = commonType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE,\r\n left\r\n );\r\n rightExpr = this.convertExpression(\r\n rightExpr,\r\n rightType,\r\n rightType = commonType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE,\r\n right\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,\r\n expression.range, \"^\", leftType.toString(), rightType.toString()\r\n );\r\n this.currentType = contextualType;\r\n return module.createUnreachable();\r\n }\r\n }\r\n switch (this.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.BOOL: {\r\n expr = module.createBinary(BinaryOp.XorI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n expr = module.createBinary(BinaryOp.XorI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.createBinary(BinaryOp.XorI64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n expr = module.createBinary(\r\n this.options.isWasm64\r\n ? BinaryOp.XorI64\r\n : BinaryOp.XorI32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.F32:\r\n case TypeKind.F64: {\r\n this.error(\r\n DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,\r\n expression.range, operatorTokenToString(expression.operator), this.currentType.toString()\r\n );\r\n return module.createUnreachable();\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.createUnreachable();\r\n }\r\n }\r\n break;\r\n }\r\n\r\n // logical (no overloading)\r\n\r\n case Token.AMPERSAND_AMPERSAND: { // left && right\r\n leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE);\r\n leftType = this.currentType;\r\n rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n rightType = this.currentType;\r\n\r\n // simplify if cloning left without side effects is possible\r\n if (expr = module.cloneExpression(leftExpr, true, 0)) {\r\n expr = module.createIf(\r\n this.makeIsTrueish(leftExpr, this.currentType),\r\n rightExpr,\r\n expr\r\n );\r\n\r\n // if not possible, tee left to a temp. local\r\n } else {\r\n let flow = this.currentFlow;\r\n let tempLocal = flow.getAndFreeTempLocal(\r\n this.currentType,\r\n !flow.canOverflow(leftExpr, this.currentType)\r\n );\r\n expr = module.createIf(\r\n this.makeIsTrueish(\r\n module.createTeeLocal(tempLocal.index, leftExpr),\r\n this.currentType\r\n ),\r\n rightExpr,\r\n module.createGetLocal(\r\n assert(tempLocal).index, // to be sure\r\n this.currentType.toNativeType()\r\n )\r\n );\r\n }\r\n break;\r\n }\r\n case Token.BAR_BAR: { // left || right\r\n leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE);\r\n leftType = this.currentType;\r\n rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n rightType = this.currentType;\r\n\r\n // simplify if cloning left without side effects is possible\r\n if (expr = this.module.cloneExpression(leftExpr, true, 0)) {\r\n expr = this.module.createIf(\r\n this.makeIsTrueish(leftExpr, this.currentType),\r\n expr,\r\n rightExpr\r\n );\r\n\r\n // if not possible, tee left to a temp. local\r\n } else {\r\n let flow = this.currentFlow;\r\n let tempLocal = flow.getAndFreeTempLocal(\r\n this.currentType,\r\n !flow.canOverflow(leftExpr, this.currentType)\r\n );\r\n expr = module.createIf(\r\n this.makeIsTrueish(\r\n module.createTeeLocal(tempLocal.index, leftExpr),\r\n this.currentType\r\n ),\r\n module.createGetLocal(\r\n assert(tempLocal).index, // to be sure\r\n this.currentType.toNativeType()\r\n ),\r\n rightExpr\r\n );\r\n }\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n expr = this.module.createUnreachable();\r\n }\r\n }\r\n return compound\r\n ? this.compileAssignmentWithValue(left, expr, contextualType != Type.void)\r\n : expr;\r\n }\r\n\r\n compileUnaryOverload(\r\n operatorInstance: Function,\r\n value: Expression,\r\n valueExpr: ExpressionRef,\r\n reportNode: Node\r\n ): ExpressionRef {\r\n var argumentExpressions: Expression[];\r\n var thisArg: ExpressionRef = 0;\r\n if (operatorInstance.is(CommonFlags.INSTANCE)) {\r\n thisArg = valueExpr; // can reuse the previously evaluated expr as the this value here\r\n argumentExpressions = [];\r\n } else {\r\n argumentExpressions = [ value ]; // annotated type might differ -> recompile\r\n }\r\n return this.compileCallDirect(\r\n operatorInstance,\r\n argumentExpressions,\r\n reportNode,\r\n thisArg\r\n );\r\n }\r\n\r\n compileBinaryOverload(\r\n operatorInstance: Function,\r\n left: Expression,\r\n leftExpr: ExpressionRef,\r\n right: Expression,\r\n reportNode: Node\r\n ): ExpressionRef {\r\n var argumentExpressions: Expression[];\r\n var thisArg: ExpressionRef = 0;\r\n if (operatorInstance.is(CommonFlags.INSTANCE)) {\r\n let classInstance = assert(operatorInstance.parent); assert(classInstance.kind == ElementKind.CLASS);\r\n thisArg = leftExpr; // can reuse the previously evaluated leftExpr as the this value here\r\n argumentExpressions = [ right ];\r\n } else {\r\n argumentExpressions = [ left, right ]; // annotated type of LHS might differ -> recompile\r\n }\r\n var ret = this.compileCallDirect(\r\n operatorInstance,\r\n argumentExpressions,\r\n reportNode,\r\n thisArg\r\n );\r\n return ret;\r\n }\r\n\r\n compileAssignment(expression: Expression, valueExpression: Expression, contextualType: Type): ExpressionRef {\r\n var program = this.program;\r\n var resolver = program.resolver;\r\n var flow = this.currentFlow;\r\n var target = resolver.resolveExpression(expression, flow); // reports\r\n if (!target) return this.module.createUnreachable();\r\n\r\n // to compile just the value, we need to know the target's type\r\n var targetType: Type;\r\n switch (target.kind) {\r\n case ElementKind.GLOBAL: {\r\n if (!this.compileGlobal(target)) { // reports; not yet compiled if a static field compiled as a global\r\n return this.module.createUnreachable();\r\n }\r\n assert((target).type != Type.void); // compileGlobal must guarantee this\r\n // fall-through\r\n }\r\n case ElementKind.LOCAL:\r\n case ElementKind.FIELD: {\r\n targetType = (target).type;\r\n break;\r\n }\r\n case ElementKind.PROPERTY_PROTOTYPE: { // static property\r\n let setterPrototype = (target).setterPrototype;\r\n if (!setterPrototype) {\r\n this.error(\r\n DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property,\r\n expression.range, (target).internalName\r\n );\r\n return this.module.createUnreachable();\r\n }\r\n let setterInstance = this.resolver.resolveFunction(setterPrototype, null, makeMap(), ReportMode.REPORT);\r\n if (!setterInstance) return this.module.createUnreachable();\r\n assert(setterInstance.signature.parameterTypes.length == 1); // parser must guarantee this\r\n targetType = setterInstance.signature.parameterTypes[0];\r\n break;\r\n }\r\n case ElementKind.PROPERTY: { // instance property\r\n let setterInstance = (target).setterInstance;\r\n if (!setterInstance) {\r\n this.error(\r\n DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property,\r\n expression.range, (target).internalName\r\n );\r\n return this.module.createUnreachable();\r\n }\r\n assert(setterInstance.signature.parameterTypes.length == 1); // parser must guarantee this\r\n targetType = setterInstance.signature.parameterTypes[0];\r\n break;\r\n }\r\n case ElementKind.CLASS: {\r\n if (resolver.currentElementExpression) { // indexed access\r\n let isUnchecked = flow.is(FlowFlags.UNCHECKED_CONTEXT);\r\n let indexedSet = (target).lookupOverload(OperatorKind.INDEXED_SET, isUnchecked);\r\n if (!indexedSet) {\r\n let indexedGet = (target).lookupOverload(OperatorKind.INDEXED_GET, isUnchecked);\r\n if (!indexedGet) {\r\n this.error(\r\n DiagnosticCode.Index_signature_is_missing_in_type_0,\r\n expression.range, (target).internalName\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Index_signature_in_type_0_only_permits_reading,\r\n expression.range, (target).internalName\r\n );\r\n }\r\n return this.module.createUnreachable();\r\n }\r\n assert(indexedSet.signature.parameterTypes.length == 2); // parser must guarantee this\r\n targetType = indexedSet.signature.parameterTypes[1]; // 2nd parameter is the element\r\n break;\r\n }\r\n // fall-through\r\n }\r\n default: {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.createUnreachable();\r\n }\r\n }\r\n\r\n // compile the value and do the assignment\r\n assert(targetType != Type.void);\r\n var valueExpr = this.compileExpression(valueExpression, targetType, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n return this.compileAssignmentWithValue(\r\n expression,\r\n valueExpr,\r\n contextualType != Type.void\r\n );\r\n }\r\n\r\n compileAssignmentWithValue(\r\n expression: Expression,\r\n valueWithCorrectType: ExpressionRef,\r\n tee: bool = false\r\n ): ExpressionRef {\r\n var module = this.module;\r\n var flow = this.currentFlow;\r\n var target = this.resolver.resolveExpression(expression, flow); // reports\r\n if (!target) return module.createUnreachable();\r\n\r\n switch (target.kind) {\r\n case ElementKind.LOCAL: {\r\n let type = (target).type;\r\n assert(type != Type.void);\r\n this.currentType = tee ? type : Type.void;\r\n if ((target).is(CommonFlags.CONST)) {\r\n this.error(\r\n DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property,\r\n expression.range, target.internalName\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) {\r\n flow.setLocalWrapped((target).index, !flow.canOverflow(valueWithCorrectType, type));\r\n }\r\n return tee\r\n ? module.createTeeLocal((target).index, valueWithCorrectType)\r\n : module.createSetLocal((target).index, valueWithCorrectType);\r\n }\r\n case ElementKind.GLOBAL: {\r\n if (!this.compileGlobal(target)) return module.createUnreachable();\r\n let type = (target).type;\r\n assert(type != Type.void);\r\n this.currentType = tee ? type : Type.void;\r\n if ((target).is(CommonFlags.CONST)) {\r\n this.error(\r\n DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property,\r\n expression.range,\r\n target.internalName\r\n );\r\n return module.createUnreachable();\r\n }\r\n valueWithCorrectType = this.ensureSmallIntegerWrap(valueWithCorrectType, type); // guaranteed\r\n if (tee) {\r\n let nativeType = type.toNativeType();\r\n let internalName = target.internalName;\r\n return module.createBlock(null, [ // emulated teeGlobal\r\n module.createSetGlobal(internalName, valueWithCorrectType),\r\n module.createGetGlobal(internalName, nativeType)\r\n ], nativeType);\r\n } else {\r\n return module.createSetGlobal(target.internalName, valueWithCorrectType);\r\n }\r\n }\r\n case ElementKind.FIELD: {\r\n let initializerNode = (target).initializerNode;\r\n if (\r\n (target).is(CommonFlags.READONLY) &&\r\n !(\r\n flow.actualFunction.is(CommonFlags.CONSTRUCTOR) ||\r\n initializerNode\r\n )\r\n ) {\r\n this.error(\r\n DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property,\r\n expression.range, (target).internalName\r\n );\r\n return module.createUnreachable();\r\n }\r\n let thisExpression = assert(this.resolver.currentThisExpression);\r\n let thisExpr = this.compileExpressionRetainType(\r\n thisExpression,\r\n this.options.usizeType,\r\n WrapMode.NONE\r\n );\r\n let type = (target).type;\r\n this.currentType = tee ? type : Type.void;\r\n let nativeType = type.toNativeType();\r\n if (type.kind == TypeKind.BOOL) {\r\n // make sure bools are wrapped (usually are) when storing as 8 bits\r\n valueWithCorrectType = this.ensureSmallIntegerWrap(valueWithCorrectType, type);\r\n }\r\n if (tee) {\r\n let flow = this.currentFlow;\r\n let tempLocal = flow.getAndFreeTempLocal(\r\n type,\r\n !flow.canOverflow(valueWithCorrectType, type)\r\n );\r\n let tempLocalIndex = tempLocal.index;\r\n // TODO: simplify if valueWithCorrectType has no side effects\r\n // TODO: call __gc_link here if a GC is present\r\n return module.createBlock(null, [\r\n module.createSetLocal(tempLocalIndex, valueWithCorrectType),\r\n module.createStore(\r\n type.byteSize,\r\n thisExpr,\r\n module.createGetLocal(tempLocalIndex, nativeType),\r\n nativeType,\r\n (target).memoryOffset\r\n ),\r\n module.createGetLocal(tempLocalIndex, nativeType)\r\n ], nativeType);\r\n } else {\r\n // TODO: call __gc_link here if a GC is present\r\n return module.createStore(\r\n type.byteSize,\r\n thisExpr,\r\n valueWithCorrectType,\r\n nativeType,\r\n (target).memoryOffset\r\n );\r\n }\r\n }\r\n case ElementKind.PROPERTY_PROTOTYPE: { // static property\r\n let setterPrototype = (target).setterPrototype;\r\n if (!setterPrototype) {\r\n this.error(\r\n DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property,\r\n expression.range, target.internalName\r\n );\r\n return module.createUnreachable();\r\n }\r\n let setterInstance = this.resolver.resolveFunction(setterPrototype, null, makeMap(), ReportMode.REPORT);\r\n if (!setterInstance) return module.createUnreachable();\r\n // call just the setter if the return value isn't of interest\r\n if (!tee) return this.makeCallDirect(setterInstance, [ valueWithCorrectType ]);\r\n // otherwise call the setter first, then the getter\r\n let getterPrototype = assert((target).getterPrototype); // must be present\r\n let getterInstance = this.resolver.resolveFunction(getterPrototype, null, makeMap(), ReportMode.REPORT);\r\n if (!getterInstance) return module.createUnreachable();\r\n let returnType = getterInstance.signature.returnType;\r\n let nativeReturnType = returnType.toNativeType();\r\n return module.createBlock(null, [\r\n this.makeCallDirect(setterInstance, [ valueWithCorrectType ]),\r\n this.makeCallDirect(getterInstance) // sets currentType\r\n ], nativeReturnType);\r\n }\r\n case ElementKind.PROPERTY: { // instance property\r\n let setterInstance = (target).setterInstance;\r\n if (!setterInstance) {\r\n this.error(\r\n DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property,\r\n expression.range, target.internalName\r\n );\r\n return module.createUnreachable();\r\n }\r\n // call just the setter if the return value isn't of interest\r\n if (!tee) {\r\n let thisExpr = this.compileExpressionRetainType(\r\n assert(this.resolver.currentThisExpression),\r\n this.options.usizeType,\r\n WrapMode.NONE\r\n );\r\n return this.makeCallDirect(setterInstance, [ thisExpr, valueWithCorrectType ]);\r\n }\r\n // otherwise call the setter first, then the getter\r\n let getterInstance = assert((target).getterInstance); // must be present\r\n let returnType = getterInstance.signature.returnType;\r\n let nativeReturnType = returnType.toNativeType();\r\n let thisExpr = this.compileExpressionRetainType(\r\n assert(this.resolver.currentThisExpression),\r\n this.options.usizeType,\r\n WrapMode.NONE\r\n );\r\n let tempLocal = flow.getAndFreeTempLocal(returnType, false);\r\n let tempLocalIndex = tempLocal.index;\r\n return module.createBlock(null, [\r\n this.makeCallDirect(setterInstance, [ // set and remember the target\r\n module.createTeeLocal(tempLocalIndex, thisExpr),\r\n valueWithCorrectType\r\n ]),\r\n this.makeCallDirect(getterInstance, [ // get from remembered target\r\n module.createGetLocal(tempLocalIndex, nativeReturnType)\r\n ])\r\n ], nativeReturnType);\r\n }\r\n case ElementKind.CLASS: {\r\n let elementExpression = this.resolver.currentElementExpression;\r\n if (elementExpression) {\r\n let isUnchecked = flow.is(FlowFlags.UNCHECKED_CONTEXT);\r\n let indexedGet = (target).lookupOverload(OperatorKind.INDEXED_GET, isUnchecked);\r\n if (!indexedGet) {\r\n this.error(\r\n DiagnosticCode.Index_signature_is_missing_in_type_0,\r\n expression.range, target.internalName\r\n );\r\n return module.createUnreachable();\r\n }\r\n let indexedSet = (target).lookupOverload(OperatorKind.INDEXED_SET, isUnchecked);\r\n if (!indexedSet) {\r\n this.error(\r\n DiagnosticCode.Index_signature_in_type_0_only_permits_reading,\r\n expression.range, target.internalName\r\n );\r\n this.currentType = tee ? indexedGet.signature.returnType : Type.void;\r\n return module.createUnreachable();\r\n }\r\n let targetType = (target).type;\r\n let thisExpression = assert(this.resolver.currentThisExpression);\r\n let thisExpr = this.compileExpressionRetainType(\r\n thisExpression,\r\n this.options.usizeType,\r\n WrapMode.NONE\r\n );\r\n let elementExpr = this.compileExpression(\r\n elementExpression,\r\n Type.i32,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n if (tee) {\r\n let tempLocalTarget = flow.getTempLocal(targetType, false);\r\n let tempLocalElement = flow.getAndFreeTempLocal(this.currentType, false);\r\n let returnType = indexedGet.signature.returnType;\r\n flow.freeTempLocal(tempLocalTarget);\r\n return module.createBlock(null, [\r\n this.makeCallDirect(indexedSet, [\r\n module.createTeeLocal(tempLocalTarget.index, thisExpr),\r\n module.createTeeLocal(tempLocalElement.index, elementExpr),\r\n valueWithCorrectType\r\n ]),\r\n this.makeCallDirect(indexedGet, [\r\n module.createGetLocal(tempLocalTarget.index, tempLocalTarget.type.toNativeType()),\r\n module.createGetLocal(tempLocalElement.index, tempLocalElement.type.toNativeType())\r\n ])\r\n ], returnType.toNativeType());\r\n } else {\r\n return this.makeCallDirect(indexedSet, [\r\n thisExpr,\r\n elementExpr,\r\n valueWithCorrectType\r\n ]);\r\n }\r\n }\r\n // fall-through\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return module.createUnreachable();\r\n }\r\n\r\n compileCallExpression(expression: CallExpression, contextualType: Type): ExpressionRef {\r\n var module = this.module;\r\n var flow = this.currentFlow;\r\n\r\n // handle call to super\r\n if (expression.expression.kind == NodeKind.SUPER) {\r\n let flow = this.currentFlow;\r\n let actualFunction = flow.actualFunction;\r\n if (!actualFunction.is(CommonFlags.CONSTRUCTOR)) {\r\n this.error(\r\n DiagnosticCode.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors,\r\n expression.range\r\n );\r\n return module.createUnreachable();\r\n }\r\n\r\n let classInstance = assert(actualFunction.parent); assert(classInstance.kind == ElementKind.CLASS);\r\n let baseClassInstance = assert((classInstance).base);\r\n let thisLocal = assert(flow.lookupLocal(CommonSymbols.this_));\r\n let nativeSizeType = this.options.nativeSizeType;\r\n\r\n // {\r\n // this = super(this || , ...args)\r\n // this.a = X\r\n // this.b = Y\r\n // }\r\n let stmts: ExpressionRef[] = [\r\n module.createSetLocal(thisLocal.index,\r\n this.compileCallDirect(\r\n this.ensureConstructor(baseClassInstance, expression),\r\n expression.arguments,\r\n expression,\r\n module.createIf(\r\n module.createGetLocal(thisLocal.index, nativeSizeType),\r\n module.createGetLocal(thisLocal.index, nativeSizeType),\r\n this.makeAllocation(classInstance)\r\n )\r\n )\r\n )\r\n ];\r\n this.makeFieldInitialization(classInstance, stmts);\r\n\r\n // check that super had been called before accessing allocating `this`\r\n if (flow.isAny(\r\n FlowFlags.ALLOCATES |\r\n FlowFlags.CONDITIONALLY_ALLOCATES\r\n )) {\r\n this.error(\r\n DiagnosticCode._super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class,\r\n expression.range\r\n );\r\n return module.createUnreachable();\r\n }\r\n flow.set(FlowFlags.ALLOCATES | FlowFlags.CALLS_SUPER);\r\n this.currentType = Type.void;\r\n return module.createBlock(null, stmts);\r\n }\r\n\r\n // otherwise resolve normally\r\n var target = this.resolver.resolveExpression(expression.expression, flow); // reports\r\n if (!target) return module.createUnreachable();\r\n\r\n var signature: Signature | null;\r\n var indexArg: ExpressionRef;\r\n switch (target.kind) {\r\n\r\n // direct call: concrete function\r\n case ElementKind.FUNCTION_PROTOTYPE: {\r\n let prototype = target;\r\n let typeArguments = expression.typeArguments;\r\n\r\n // builtins handle present respectively omitted type arguments on their own\r\n if (prototype.hasDecorator(DecoratorFlags.BUILTIN)) {\r\n return this.compileCallExpressionBuiltin(prototype, expression, contextualType);\r\n }\r\n\r\n let instance: Function | null = null;\r\n\r\n // resolve generic call if type arguments have been provided\r\n if (typeArguments) {\r\n if (!prototype.is(CommonFlags.GENERIC)) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n expression.expression.range, prototype.internalName\r\n );\r\n return module.createUnreachable();\r\n }\r\n instance = this.resolver.resolveFunctionInclTypeArguments(\r\n prototype,\r\n typeArguments,\r\n flow.actualFunction.parent, // relative to caller\r\n makeMap(flow.contextualTypeArguments),\r\n expression\r\n );\r\n\r\n // infer generic call if type arguments have been omitted\r\n } else if (prototype.is(CommonFlags.GENERIC)) {\r\n let inferredTypes = new Map();\r\n let typeParameterNodes = assert(prototype.typeParameterNodes);\r\n let numTypeParameters = typeParameterNodes.length;\r\n for (let i = 0; i < numTypeParameters; ++i) {\r\n inferredTypes.set(typeParameterNodes[i].name.text, null);\r\n }\r\n // let numInferred = 0;\r\n let parameterNodes = prototype.signatureNode.parameters;\r\n let numParameters = parameterNodes.length;\r\n let argumentNodes = expression.arguments;\r\n let numArguments = argumentNodes.length;\r\n let argumentExprs = new Array(numArguments);\r\n for (let i = 0; i < numParameters; ++i) {\r\n let typeNode = parameterNodes[i].type;\r\n let templateName = typeNode.kind == NodeKind.TYPE && !(typeNode).name.next\r\n ? (typeNode).name.identifier.text\r\n : null;\r\n let argumentExpression = i < numArguments\r\n ? argumentNodes[i]\r\n : parameterNodes[i].initializer;\r\n if (!argumentExpression) { // missing initializer -> too few arguments\r\n this.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n expression.range, numParameters.toString(10), numArguments.toString(10)\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (templateName !== null && inferredTypes.has(templateName)) {\r\n let inferredType = inferredTypes.get(templateName);\r\n if (inferredType) {\r\n argumentExprs[i] = this.compileExpressionRetainType(argumentExpression, inferredType, WrapMode.NONE);\r\n let commonType: Type | null;\r\n if (!(commonType = Type.commonDenominator(inferredType, this.currentType, true))) {\r\n if (!(commonType = Type.commonDenominator(inferredType, this.currentType, false))) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_assignable_to_type_1,\r\n parameterNodes[i].type.range, this.currentType.toString(), inferredType.toString()\r\n );\r\n return module.createUnreachable();\r\n }\r\n }\r\n inferredType = commonType;\r\n } else {\r\n argumentExprs[i] = this.compileExpressionRetainType(argumentExpression, Type.i32, WrapMode.NONE);\r\n inferredType = this.currentType;\r\n // ++numInferred;\r\n }\r\n inferredTypes.set(templateName, inferredType);\r\n } else {\r\n let concreteType = this.resolver.resolveType(\r\n parameterNodes[i].type,\r\n flow.actualFunction,\r\n flow.contextualTypeArguments\r\n );\r\n if (!concreteType) return module.createUnreachable();\r\n argumentExprs[i] = this.compileExpression(\r\n argumentExpression,\r\n concreteType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n }\r\n }\r\n let resolvedTypeArguments = new Array(numTypeParameters);\r\n for (let i = 0; i < numTypeParameters; ++i) {\r\n let inferredType = assert(inferredTypes.get(typeParameterNodes[i].name.text)); // TODO\r\n resolvedTypeArguments[i] = inferredType;\r\n }\r\n instance = this.resolver.resolveFunction(\r\n prototype,\r\n resolvedTypeArguments,\r\n makeMap(flow.contextualTypeArguments)\r\n );\r\n if (!instance) return this.module.createUnreachable();\r\n return this.makeCallDirect(instance, argumentExprs);\r\n // TODO: this skips inlining because inlining requires compiling its temporary locals in\r\n // the scope of the inlined flow. might need another mechanism to lock temp. locals early,\r\n // so inlining can be performed in `makeCallDirect` instead?\r\n\r\n // otherwise resolve the non-generic call as usual\r\n } else {\r\n instance = this.resolver.resolveFunction(prototype, null);\r\n }\r\n if (!instance) return this.module.createUnreachable();\r\n\r\n // compile 'this' expression if an instance method\r\n let thisExpr: ExpressionRef = 0;\r\n if (instance.is(CommonFlags.INSTANCE)) {\r\n thisExpr = this.compileExpressionRetainType(\r\n assert(this.resolver.currentThisExpression),\r\n this.options.usizeType,\r\n WrapMode.NONE\r\n );\r\n }\r\n\r\n return this.compileCallDirect(\r\n instance,\r\n expression.arguments,\r\n expression,\r\n thisExpr\r\n );\r\n }\r\n\r\n // indirect call: index argument with signature (non-generic, can't be inlined)\r\n case ElementKind.LOCAL: {\r\n if (signature = (target).type.signatureReference) {\r\n if ((target).is(CommonFlags.INLINED)) {\r\n indexArg = module.createI32(i64_low((target).constantIntegerValue));\r\n } else {\r\n indexArg = module.createGetLocal((target).index, NativeType.I32);\r\n }\r\n break;\r\n } else {\r\n this.error(\r\n DiagnosticCode.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures,\r\n expression.range, (target).type.toString()\r\n );\r\n return module.createUnreachable();\r\n }\r\n }\r\n case ElementKind.GLOBAL: {\r\n if (signature = (target).type.signatureReference) {\r\n indexArg = module.createGetGlobal((target).internalName, (target).type.toNativeType());\r\n break;\r\n } else {\r\n this.error(\r\n DiagnosticCode.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures,\r\n expression.range, (target).type.toString()\r\n );\r\n return module.createUnreachable();\r\n }\r\n }\r\n case ElementKind.FIELD: {\r\n let type = (target).type;\r\n if (signature = type.signatureReference) {\r\n let thisExpression = assert(this.resolver.currentThisExpression);\r\n let thisExpr = this.compileExpressionRetainType(\r\n thisExpression,\r\n this.options.usizeType,\r\n WrapMode.NONE\r\n );\r\n indexArg = module.createLoad(\r\n 4,\r\n false,\r\n thisExpr,\r\n NativeType.I32,\r\n (target).memoryOffset\r\n );\r\n break;\r\n } else {\r\n this.error(\r\n DiagnosticCode.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures,\r\n expression.range, type.toString()\r\n );\r\n return module.createUnreachable();\r\n }\r\n }\r\n case ElementKind.FUNCTION_TARGET: {\r\n signature = (target).signature;\r\n indexArg = this.compileExpression(\r\n expression.expression,\r\n (target).type,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n break;\r\n }\r\n\r\n case ElementKind.PROPERTY_PROTOTYPE: { // static property\r\n let getterPrototype = assert((target).getterPrototype);\r\n let getterInstance = this.resolver.resolveFunction(getterPrototype, null);\r\n if (!getterInstance) return module.createUnreachable();\r\n indexArg = this.compileCallDirect(getterInstance, [], expression.expression);\r\n signature = this.currentType.signatureReference;\r\n if (!signature) {\r\n this.error(\r\n DiagnosticCode.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures,\r\n expression.range, this.currentType.toString()\r\n );\r\n return module.createUnreachable();\r\n }\r\n break;\r\n }\r\n case ElementKind.PROPERTY: { // instance property\r\n let getterInstance = assert((target).getterInstance);\r\n indexArg = this.compileCallDirect(getterInstance, [], expression.expression,\r\n this.compileExpressionRetainType(\r\n assert(this.resolver.currentThisExpression),\r\n this.options.usizeType,\r\n WrapMode.NONE\r\n )\r\n );\r\n signature = this.currentType.signatureReference;\r\n if (!signature) {\r\n this.error(\r\n DiagnosticCode.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures,\r\n expression.range, this.currentType.toString()\r\n );\r\n return module.createUnreachable();\r\n }\r\n break;\r\n }\r\n\r\n // not supported\r\n default: {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return module.createUnreachable();\r\n }\r\n }\r\n return this.compileCallIndirect(\r\n signature,\r\n indexArg,\r\n expression.arguments,\r\n expression\r\n );\r\n }\r\n\r\n private compileCallExpressionBuiltin(\r\n prototype: FunctionPrototype,\r\n expression: CallExpression,\r\n contextualType: Type\r\n ): ExpressionRef {\r\n var typeArguments: Type[] | null = null;\r\n\r\n // builtins handle omitted type arguments on their own. if present, however, resolve them here\r\n // and pass them to the builtin, even if it's still up to the builtin how to handle them.\r\n var typeParameterNodes = prototype.typeParameterNodes;\r\n var typeArgumentNodes = expression.typeArguments;\r\n if (expression.typeArguments) {\r\n if (!prototype.is(CommonFlags.GENERIC)) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n expression.range, prototype.internalName\r\n );\r\n }\r\n typeArguments = this.resolver.resolveTypeArguments(\r\n assert(typeParameterNodes),\r\n typeArgumentNodes,\r\n this.currentFlow.actualFunction.parent,\r\n makeMap(this.currentFlow.contextualTypeArguments),\r\n expression\r\n );\r\n }\r\n\r\n // now compile the builtin, which usually returns a block of code that replaces the call.\r\n var expr = compileBuiltinCall(\r\n this,\r\n prototype,\r\n typeArguments,\r\n expression.arguments,\r\n contextualType,\r\n expression\r\n );\r\n if (!expr) {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.createUnreachable();\r\n }\r\n return expr;\r\n }\r\n\r\n /**\r\n * Checks that a call with the given number as arguments can be performed according to the\r\n * specified signature.\r\n */\r\n checkCallSignature(\r\n signature: Signature,\r\n numArguments: i32,\r\n hasThis: bool,\r\n reportNode: Node\r\n ): bool {\r\n\r\n // cannot call an instance method without a `this` argument (TODO: `.call`?)\r\n var thisType = signature.thisType;\r\n if (hasThis != (thisType != null)) {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported, // TODO: better message?\r\n reportNode.range\r\n );\r\n return false;\r\n }\r\n\r\n // not yet implemented (TODO: maybe some sort of an unmanaged/lightweight array?)\r\n var hasRest = signature.hasRest;\r\n if (hasRest) {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n return false;\r\n }\r\n\r\n var minimum = signature.requiredParameters;\r\n var maximum = signature.parameterTypes.length;\r\n\r\n // must at least be called with required arguments\r\n if (numArguments < minimum) {\r\n this.error(\r\n minimum < maximum\r\n ? DiagnosticCode.Expected_at_least_0_arguments_but_got_1\r\n : DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, minimum.toString(), numArguments.toString()\r\n );\r\n return false;\r\n }\r\n\r\n // must not be called with more than the maximum arguments\r\n if (numArguments > maximum && !hasRest) {\r\n this.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, maximum.toString(), numArguments.toString()\r\n );\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /** Compiles a direct call to a concrete function. */\r\n compileCallDirect(\r\n instance: Function,\r\n argumentExpressions: Expression[],\r\n reportNode: Node,\r\n thisArg: ExpressionRef = 0\r\n ): ExpressionRef {\r\n var numArguments = argumentExpressions.length;\r\n var signature = instance.signature;\r\n\r\n if (!this.checkCallSignature( // reports\r\n signature,\r\n numArguments,\r\n thisArg != 0,\r\n reportNode\r\n )) {\r\n return this.module.createUnreachable();\r\n }\r\n\r\n // Inline if explicitly requested\r\n if (instance.hasDecorator(DecoratorFlags.INLINE)) {\r\n assert(!instance.is(CommonFlags.TRAMPOLINE)); // doesn't make sense\r\n if (this.currentInlineFunctions.includes(instance)) {\r\n this.warning(\r\n DiagnosticCode.Function_0_cannot_be_inlined_into_itself,\r\n reportNode.range, instance.internalName\r\n );\r\n } else {\r\n this.currentInlineFunctions.push(instance);\r\n let expr = this.compileCallInlinePrechecked(instance, argumentExpressions, thisArg);\r\n this.currentInlineFunctions.pop();\r\n return expr;\r\n }\r\n }\r\n\r\n // Otherwise compile to just a call\r\n var numArgumentsInclThis = thisArg ? numArguments + 1 : numArguments;\r\n var operands = new Array(numArgumentsInclThis);\r\n var index = 0;\r\n if (thisArg) {\r\n operands[0] = thisArg;\r\n index = 1;\r\n }\r\n var parameterTypes = signature.parameterTypes;\r\n for (let i = 0; i < numArguments; ++i, ++index) {\r\n operands[index] = this.compileExpression(\r\n argumentExpressions[i],\r\n parameterTypes[i],\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n }\r\n assert(index == numArgumentsInclThis);\r\n return this.makeCallDirect(instance, operands);\r\n }\r\n\r\n // Depends on being pre-checked in compileCallDirect\r\n private compileCallInlinePrechecked(\r\n instance: Function,\r\n argumentExpressions: Expression[],\r\n thisArg: ExpressionRef = 0\r\n ): ExpressionRef {\r\n var module = this.module;\r\n\r\n // Create a new inline flow and use it to compile the function as a block\r\n var previousFlow = this.currentFlow;\r\n var flow = Flow.createInline(previousFlow.parentFunction, instance);\r\n\r\n // Convert provided call arguments to temporary locals. It is important that these are compiled\r\n // here, with their respective locals being blocked. There is no 'makeCallInline'.\r\n var body = [];\r\n\r\n if (thisArg) {\r\n let classInstance = assert(instance.parent); assert(classInstance.kind == ElementKind.CLASS);\r\n let thisType = assert(instance.signature.thisType);\r\n let thisLocal = flow.addScopedLocal(CommonSymbols.this_, thisType, false);\r\n body.push(\r\n module.createSetLocal(thisLocal.index, thisArg)\r\n );\r\n let baseInstance = (classInstance).base;\r\n if (baseInstance) flow.addScopedAlias(CommonSymbols.super_, baseInstance.type, thisLocal.index);\r\n }\r\n\r\n var numArguments = argumentExpressions.length;\r\n var signature = instance.signature;\r\n var parameterTypes = signature.parameterTypes;\r\n for (let i = 0; i < numArguments; ++i) {\r\n let paramExpr = this.compileExpression(\r\n argumentExpressions[i],\r\n parameterTypes[i],\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n let argumentLocal = flow.addScopedLocal(\r\n signature.getParameterName(i),\r\n parameterTypes[i],\r\n !previousFlow.canOverflow(paramExpr, parameterTypes[i])\r\n );\r\n body.push(\r\n module.createSetLocal(argumentLocal.index, paramExpr)\r\n );\r\n }\r\n\r\n // Compile optional parameter initializers in the scope of the inlined flow\r\n this.currentFlow = flow;\r\n var numParameters = signature.parameterTypes.length;\r\n for (let i = numArguments; i < numParameters; ++i) {\r\n let initExpr = this.compileExpression(\r\n assert(instance.prototype.signatureNode.parameters[i].initializer),\r\n parameterTypes[i],\r\n ConversionKind.IMPLICIT,\r\n WrapMode.WRAP\r\n );\r\n let argumentLocal = flow.addScopedLocal(\r\n signature.getParameterName(i),\r\n parameterTypes[i],\r\n !flow.canOverflow(initExpr, parameterTypes[i])\r\n );\r\n body.push(\r\n module.createSetLocal(argumentLocal.index, initExpr)\r\n );\r\n }\r\n\r\n // Compile the called function's body in the scope of the inlined flow\r\n {\r\n let stmts = this.compileFunctionBody(instance);\r\n for (let i = 0, k = stmts.length; i < k; ++i) body.push(stmts[i]);\r\n }\r\n\r\n // Free any new scoped locals and reset to the original flow\r\n flow.freeScopedLocals();\r\n var returnType = flow.returnType;\r\n this.currentFlow = previousFlow;\r\n this.currentType = returnType;\r\n\r\n // Create an outer block that we can break to when returning a value out of order\r\n return module.createBlock(flow.inlineReturnLabel, body, returnType.toNativeType());\r\n }\r\n\r\n /** Gets the trampoline for the specified function. */\r\n ensureTrampoline(original: Function): Function {\r\n // A trampoline is a function that takes a fixed amount of operands with some of them possibly\r\n // being zeroed. It takes one additional argument denoting the number of actual operands\r\n // provided to the call, and takes appropriate steps to initialize zeroed operands to their\r\n // default values using the optional parameter initializers of the original function. Doing so\r\n // allows calls to functions with optional parameters to circumvent the trampoline when all\r\n // parameters are provided as a fast route, respectively setting up omitted operands in a proper\r\n // context otherwise.\r\n var trampoline = original.trampoline;\r\n if (trampoline) return trampoline;\r\n\r\n var originalSignature = original.signature;\r\n var originalName = original.internalName;\r\n var originalParameterTypes = originalSignature.parameterTypes;\r\n var originalParameterDeclarations = original.prototype.signatureNode.parameters;\r\n var commonReturnType = originalSignature.returnType;\r\n var commonThisType = originalSignature.thisType;\r\n var isInstance = original.is(CommonFlags.INSTANCE);\r\n\r\n // arguments excl. `this`, operands incl. `this`\r\n var minArguments = originalSignature.requiredParameters;\r\n var minOperands = minArguments;\r\n var maxArguments = originalParameterTypes.length;\r\n var maxOperands = maxArguments;\r\n if (isInstance) {\r\n ++minOperands;\r\n ++maxOperands;\r\n }\r\n var numOptional = assert(maxOperands - minOperands);\r\n\r\n var forwardedOperands = new Array(minOperands);\r\n var operandIndex = 0;\r\n\r\n // forward `this` if applicable\r\n var module = this.module;\r\n if (isInstance) {\r\n forwardedOperands[0] = module.createGetLocal(0, this.options.nativeSizeType);\r\n operandIndex = 1;\r\n }\r\n\r\n // forward required arguments\r\n for (let i = 0; i < minArguments; ++i, ++operandIndex) {\r\n forwardedOperands[operandIndex] = module.createGetLocal(operandIndex, originalParameterTypes[i].toNativeType());\r\n }\r\n assert(operandIndex == minOperands);\r\n\r\n // create the trampoline element\r\n var trampolineSignature = new Signature(originalParameterTypes, commonReturnType, commonThisType);\r\n trampolineSignature.requiredParameters = maxArguments;\r\n trampoline = new Function(\r\n original.name + \"|trampoline\",\r\n original.prototype,\r\n trampolineSignature,\r\n original.contextualTypeArguments\r\n );\r\n trampoline.set(original.flags | CommonFlags.TRAMPOLINE | CommonFlags.COMPILED);\r\n original.trampoline = trampoline;\r\n\r\n // compile initializers of omitted arguments in scope of the trampoline function\r\n // this is necessary because initializers might need additional locals and a proper this context\r\n var previousFlow = this.currentFlow;\r\n this.currentFlow = trampoline.flow;\r\n\r\n // create a br_table switching over the number of optional parameters provided\r\n var numNames = numOptional + 1; // incl. outer block\r\n var names = new Array(numNames);\r\n var ofN = \"of\" + numOptional.toString(10);\r\n for (let i = 0; i < numNames; ++i) {\r\n let label = i.toString(10) + ofN;\r\n names[i] = label;\r\n }\r\n var body = module.createBlock(names[0], [\r\n module.createBlock(\"outOfRange\", [\r\n module.createSwitch(names, \"outOfRange\",\r\n // condition is number of provided optional arguments, so subtract required arguments\r\n minArguments\r\n ? module.createBinary(\r\n BinaryOp.SubI32,\r\n module.createGetGlobal(CompilerSymbols.argc, NativeType.I32),\r\n module.createI32(minArguments)\r\n )\r\n : module.createGetGlobal(CompilerSymbols.argc, NativeType.I32)\r\n )\r\n ]),\r\n module.createUnreachable()\r\n ]);\r\n for (let i = 0; i < numOptional; ++i, ++operandIndex) {\r\n let type = originalParameterTypes[minArguments + i];\r\n let declaration = originalParameterDeclarations[minArguments + i];\r\n let initializer = declaration.initializer;\r\n let initExpr: ExpressionRef;\r\n if (initializer) {\r\n initExpr = module.createSetLocal(operandIndex,\r\n this.compileExpression(\r\n initializer,\r\n type,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.WRAP\r\n )\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Optional_parameter_must_have_an_initializer,\r\n declaration.range\r\n );\r\n initExpr = module.createUnreachable();\r\n }\r\n body = module.createBlock(names[i + 1], [\r\n body,\r\n initExpr,\r\n ]);\r\n forwardedOperands[operandIndex] = module.createGetLocal(operandIndex, type.toNativeType());\r\n }\r\n this.currentFlow = previousFlow;\r\n assert(operandIndex == maxOperands);\r\n\r\n var funcRef = module.addFunction(\r\n trampoline.internalName,\r\n this.ensureFunctionType(\r\n trampolineSignature.parameterTypes,\r\n trampolineSignature.returnType,\r\n trampolineSignature.thisType\r\n ),\r\n typesToNativeTypes(trampoline.additionalLocals),\r\n module.createBlock(null, [\r\n body,\r\n module.createCall(\r\n originalName,\r\n forwardedOperands,\r\n commonReturnType.toNativeType()\r\n )\r\n ], commonReturnType.toNativeType())\r\n );\r\n trampoline.finalize(module, funcRef);\r\n return trampoline;\r\n }\r\n\r\n /** Makes sure that the argument count helper global is present and returns its name. */\r\n private ensureArgcVar(): string {\r\n if (!this.argcVar) {\r\n let module = this.module;\r\n this.argcVar = module.addGlobal(\r\n CompilerSymbols.argc,\r\n NativeType.I32,\r\n true,\r\n module.createI32(0)\r\n );\r\n }\r\n return CompilerSymbols.argc;\r\n }\r\n\r\n /** Makes sure that the argument count helper setter is present and returns its name. */\r\n private ensureArgcSet(): string {\r\n var internalName = CompilerSymbols.setargc;\r\n if (!this.argcSet) {\r\n let module = this.module;\r\n this.argcSet = module.addFunction(internalName,\r\n this.ensureFunctionType([ Type.u32 ], Type.void),\r\n null,\r\n module.createSetGlobal(this.ensureArgcVar(),\r\n module.createGetLocal(0, NativeType.I32)\r\n )\r\n );\r\n module.addFunctionExport(internalName, \"_setargc\");\r\n }\r\n return internalName;\r\n }\r\n\r\n /** Creates a direct call to the specified function. */\r\n makeCallDirect(\r\n instance: Function,\r\n operands: ExpressionRef[] | null = null\r\n ): ExpressionRef {\r\n var numOperands = operands ? operands.length : 0;\r\n var numArguments = numOperands;\r\n var minArguments = instance.signature.requiredParameters;\r\n var minOperands = minArguments;\r\n var maxArguments = instance.signature.parameterTypes.length;\r\n var maxOperands = maxArguments;\r\n if (instance.is(CommonFlags.INSTANCE)) {\r\n ++minOperands;\r\n ++maxOperands;\r\n --numArguments;\r\n }\r\n assert(numOperands >= minOperands);\r\n\r\n var module = this.module;\r\n if (!this.compileFunction(instance)) return module.createUnreachable();\r\n var returnType = instance.signature.returnType;\r\n var isCallImport = instance.is(CommonFlags.MODULE_IMPORT);\r\n\r\n // fill up omitted arguments with their initializers, if constant, otherwise with zeroes.\r\n if (numOperands < maxOperands) {\r\n if (!operands) {\r\n operands = new Array(maxOperands);\r\n operands.length = 0;\r\n }\r\n let parameterTypes = instance.signature.parameterTypes;\r\n let parameterNodes = instance.prototype.signatureNode.parameters;\r\n assert(parameterNodes.length == parameterTypes.length);\r\n let allOptionalsAreConstant = true;\r\n for (let i = numArguments; i < maxArguments; ++i) {\r\n let initializer = parameterNodes[i].initializer;\r\n if (!(initializer && nodeIsConstantValue(initializer.kind))) {\r\n allOptionalsAreConstant = false;\r\n break;\r\n }\r\n }\r\n if (allOptionalsAreConstant) { // inline into the call\r\n for (let i = numArguments; i < maxArguments; ++i) {\r\n operands.push(\r\n this.compileExpression(\r\n parameterNodes[i].initializer,\r\n parameterTypes[i],\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n )\r\n );\r\n }\r\n } else { // otherwise fill up with zeroes and call the trampoline\r\n for (let i = numArguments; i < maxArguments; ++i) {\r\n operands.push(parameterTypes[i].toNativeZero(module));\r\n }\r\n if (!isCallImport) {\r\n let original = instance;\r\n instance = this.ensureTrampoline(instance);\r\n if (!this.compileFunction(instance)) return module.createUnreachable();\r\n instance.flow.flags = original.flow.flags;\r\n let nativeReturnType = returnType.toNativeType();\r\n this.currentType = returnType;\r\n return module.createBlock(null, [\r\n module.createSetGlobal(this.ensureArgcVar(), module.createI32(numArguments)),\r\n module.createCall(instance.internalName, operands, nativeReturnType)\r\n ], nativeReturnType);\r\n }\r\n }\r\n }\r\n\r\n // otherwise just call through\r\n this.currentType = returnType;\r\n return module.createCall(instance.internalName, operands, returnType.toNativeType());\r\n }\r\n\r\n /** Compiles an indirect call using an index argument and a signature. */\r\n compileCallIndirect(\r\n signature: Signature,\r\n indexArg: ExpressionRef,\r\n argumentExpressions: Expression[],\r\n reportNode: Node,\r\n thisArg: ExpressionRef = 0\r\n ): ExpressionRef {\r\n var numArguments = argumentExpressions.length;\r\n\r\n if (!this.checkCallSignature( // reports\r\n signature,\r\n numArguments,\r\n thisArg != 0,\r\n reportNode\r\n )) {\r\n return this.module.createUnreachable();\r\n }\r\n\r\n var numArgumentsInclThis = thisArg ? numArguments + 1 : numArguments;\r\n var operands = new Array(numArgumentsInclThis);\r\n var index = 0;\r\n if (thisArg) {\r\n operands[0] = thisArg;\r\n index = 1;\r\n }\r\n var parameterTypes = signature.parameterTypes;\r\n for (let i = 0; i < numArguments; ++i, ++index) {\r\n operands[index] = this.compileExpression(\r\n argumentExpressions[i],\r\n parameterTypes[i],\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n }\r\n assert(index == numArgumentsInclThis);\r\n return this.makeCallIndirect(signature, indexArg, operands);\r\n }\r\n\r\n /** Creates an indirect call to the function at `indexArg` in the function table. */\r\n makeCallIndirect(\r\n signature: Signature,\r\n indexArg: ExpressionRef,\r\n operands: ExpressionRef[] | null = null\r\n ): ExpressionRef {\r\n var numOperands = operands ? operands.length : 0;\r\n var numArguments = numOperands;\r\n var minArguments = signature.requiredParameters;\r\n var minOperands = minArguments;\r\n var maxArguments = signature.parameterTypes.length;\r\n var maxOperands = maxArguments;\r\n if (signature.thisType) {\r\n ++minOperands;\r\n ++maxOperands;\r\n --numArguments;\r\n }\r\n assert(numOperands >= minOperands);\r\n\r\n this.ensureFunctionType(signature.parameterTypes, signature.returnType, signature.thisType);\r\n var module = this.module;\r\n\r\n // fill up omitted arguments with zeroes\r\n if (numOperands < maxOperands) {\r\n if (!operands) {\r\n operands = new Array(maxOperands);\r\n operands.length = 0;\r\n }\r\n let parameterTypes = signature.parameterTypes;\r\n for (let i = numArguments; i < maxArguments; ++i) {\r\n operands.push(parameterTypes[i].toNativeZero(module));\r\n }\r\n }\r\n\r\n var returnType = signature.returnType;\r\n this.currentType = returnType;\r\n return module.createBlock(null, [\r\n module.createSetGlobal(this.ensureArgcVar(), // might still be calling a trampoline\r\n module.createI32(numArguments)\r\n ),\r\n module.createCallIndirect(indexArg, operands, signature.toSignatureString())\r\n ], returnType.toNativeType()); // not necessarily wrapped\r\n }\r\n\r\n compileCommaExpression(expression: CommaExpression, contextualType: Type): ExpressionRef {\r\n var expressions = expression.expressions;\r\n var numExpressions = expressions.length;\r\n var exprs = new Array(numExpressions--);\r\n for (let i = 0; i < numExpressions; ++i) {\r\n exprs[i] = this.compileExpression(\r\n expressions[i],\r\n Type.void, // drop all\r\n ConversionKind.EXPLICIT,\r\n WrapMode.NONE\r\n );\r\n }\r\n exprs[numExpressions] = this.compileExpression(\r\n expressions[numExpressions],\r\n contextualType, // except last\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n return this.module.createBlock(null, exprs, this.currentType.toNativeType());\r\n }\r\n\r\n compileElementAccessExpression(expression: ElementAccessExpression, contextualType: Type): ExpressionRef {\r\n var target = this.resolver.resolveElementAccessExpression(\r\n expression,\r\n this.currentFlow,\r\n contextualType\r\n ); // reports\r\n if (!target) return this.module.createUnreachable();\r\n switch (target.kind) {\r\n case ElementKind.CLASS: {\r\n let isUnchecked = this.currentFlow.is(FlowFlags.UNCHECKED_CONTEXT);\r\n let indexedGet = (target).lookupOverload(OperatorKind.INDEXED_GET, isUnchecked);\r\n if (!indexedGet) {\r\n this.error(\r\n DiagnosticCode.Index_signature_is_missing_in_type_0,\r\n expression.expression.range, (target).internalName\r\n );\r\n return this.module.createUnreachable();\r\n }\r\n let thisArg = this.compileExpression(\r\n expression.expression,\r\n (target).type,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n return this.compileCallDirect(indexedGet, [\r\n expression.elementExpression\r\n ], expression, thisArg);\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.createUnreachable();\r\n }\r\n\r\n compileFunctionExpression(\r\n expression: FunctionExpression,\r\n contextualSignature: Signature | null\r\n ): ExpressionRef {\r\n var declaration = expression.declaration.clone(); // generic contexts can have multiple\r\n assert(!declaration.typeParameters); // function expression cannot be generic\r\n var flow = this.currentFlow;\r\n var actualFunction = flow.actualFunction;\r\n var prototype = new FunctionPrototype(\r\n declaration.name.text.length\r\n ? declaration.name.text\r\n : \"anonymous|\" + (actualFunction.nextAnonymousId++).toString(10),\r\n actualFunction,\r\n declaration,\r\n DecoratorFlags.NONE\r\n );\r\n var instance: Function | null;\r\n var contextualTypeArguments = makeMap(flow.contextualTypeArguments);\r\n\r\n // compile according to context. this differs from a normal function in that omitted parameter\r\n // and return types can be inferred and omitted arguments can be replaced with dummies.\r\n if (contextualSignature) {\r\n let signatureNode = prototype.signatureNode;\r\n let parameterNodes = signatureNode.parameters;\r\n let numPresentParameters = parameterNodes.length;\r\n\r\n // must not require more than the maximum number of parameters\r\n let parameterTypes = contextualSignature.parameterTypes;\r\n let numParameters = parameterTypes.length;\r\n if (numPresentParameters > numParameters) {\r\n this.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n expression.range, numParameters.toString(), numPresentParameters.toString()\r\n );\r\n return this.module.createUnreachable();\r\n }\r\n\r\n // check non-omitted parameter types\r\n let parameterNames = new Array(numPresentParameters);\r\n for (let i = 0; i < numPresentParameters; ++i) {\r\n let parameterNode = parameterNodes[i];\r\n parameterNames[i] = parameterNode.name.text; // use actual name\r\n if (!isTypeOmitted(parameterNode.type)) {\r\n let resolvedType = this.resolver.resolveType(\r\n parameterNode.type,\r\n actualFunction.parent,\r\n contextualTypeArguments\r\n );\r\n if (!resolvedType) return this.module.createUnreachable();\r\n if (!parameterTypes[i].isStrictlyAssignableTo(resolvedType)) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_assignable_to_type_1,\r\n parameterNode.range, parameterTypes[i].toString(), resolvedType.toString()\r\n );\r\n return this.module.createUnreachable();\r\n }\r\n }\r\n // any unused parameters are inherited but ignored\r\n }\r\n\r\n // check non-omitted return type\r\n let returnType = contextualSignature.returnType;\r\n if (!isTypeOmitted(signatureNode.returnType)) {\r\n let resolvedType = this.resolver.resolveType(\r\n signatureNode.returnType,\r\n actualFunction.parent,\r\n contextualTypeArguments\r\n );\r\n if (!resolvedType) return this.module.createUnreachable();\r\n if (\r\n returnType == Type.void\r\n ? resolvedType != Type.void\r\n : !resolvedType.isStrictlyAssignableTo(returnType)\r\n ) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_assignable_to_type_1,\r\n signatureNode.returnType.range, resolvedType.toString(), returnType.toString()\r\n );\r\n return this.module.createUnreachable();\r\n }\r\n }\r\n\r\n // check explicit this type\r\n let thisType = contextualSignature.thisType;\r\n let thisTypeNode = signatureNode.explicitThisType;\r\n if (thisTypeNode) {\r\n if (!thisType) {\r\n this.error(\r\n DiagnosticCode._this_cannot_be_referenced_in_current_location,\r\n thisTypeNode.range\r\n );\r\n return this.module.createUnreachable();\r\n }\r\n let resolvedType = this.resolver.resolveType(\r\n thisTypeNode,\r\n actualFunction.parent,\r\n contextualTypeArguments\r\n );\r\n if (!resolvedType) return this.module.createUnreachable();\r\n if (!thisType.isStrictlyAssignableTo(resolvedType)) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_assignable_to_type_1,\r\n thisTypeNode.range, thisType.toString(), resolvedType.toString()\r\n );\r\n return this.module.createUnreachable();\r\n }\r\n }\r\n\r\n let signature = new Signature(parameterTypes, returnType, thisType);\r\n signature.requiredParameters = numParameters; // !\r\n signature.parameterNames = parameterNames;\r\n instance = new Function(\r\n prototype.name,\r\n prototype,\r\n signature,\r\n contextualTypeArguments\r\n );\r\n if (!this.compileFunction(instance)) return this.module.createUnreachable();\r\n this.currentType = contextualSignature.type;\r\n\r\n // otherwise compile like a normal function\r\n } else {\r\n instance = this.compileFunctionUsingTypeArguments(\r\n prototype,\r\n [],\r\n contextualTypeArguments\r\n );\r\n if (!instance) return this.module.createUnreachable();\r\n this.currentType = instance.signature.type;\r\n }\r\n\r\n var index = this.ensureFunctionTableEntry(instance); // reports\r\n return index < 0\r\n ? this.module.createUnreachable()\r\n : this.module.createI32(index);\r\n }\r\n\r\n /** Makes sure the enclosing source file of the specified expression has been compiled. */\r\n private maybeCompileEnclosingSource(expression: Expression): void {\r\n var internalPath = expression.range.source.internalPath;\r\n var filesByName = this.program.filesByName;\r\n assert(filesByName.has(internalPath));\r\n var enclosingFile = filesByName.get(internalPath)!;\r\n if (!enclosingFile.is(CommonFlags.COMPILED)) {\r\n this.compileFileByPath(internalPath, expression);\r\n }\r\n }\r\n\r\n /**\r\n * Compiles an identifier in the specified context.\r\n * @param retainConstantType Retains the type of inlined constants if `true`, otherwise\r\n * precomputes them according to context.\r\n */\r\n compileIdentifierExpression(\r\n expression: IdentifierExpression,\r\n contextualType: Type,\r\n retainConstantType: bool\r\n ): ExpressionRef {\r\n var module = this.module;\r\n var flow = this.currentFlow;\r\n var actualFunction = flow.actualFunction;\r\n\r\n // check special keywords first\r\n switch (expression.kind) {\r\n case NodeKind.NULL: {\r\n let options = this.options;\r\n if (!contextualType.classReference) {\r\n this.currentType = options.usizeType;\r\n }\r\n return options.isWasm64\r\n ? module.createI64(0)\r\n : module.createI32(0);\r\n }\r\n case NodeKind.TRUE: {\r\n this.currentType = Type.bool;\r\n return module.createI32(1);\r\n }\r\n case NodeKind.FALSE: {\r\n this.currentType = Type.bool;\r\n return module.createI32(0);\r\n }\r\n case NodeKind.THIS: {\r\n if (actualFunction.is(CommonFlags.INSTANCE)) {\r\n let thisLocal = assert(flow.lookupLocal(CommonSymbols.this_));\r\n let classInstance = assert(actualFunction.parent); assert(classInstance.kind == ElementKind.CLASS);\r\n let nativeSizeType = this.options.nativeSizeType;\r\n if (actualFunction.is(CommonFlags.CONSTRUCTOR)) {\r\n if (!flow.is(FlowFlags.ALLOCATES)) {\r\n flow.set(FlowFlags.ALLOCATES);\r\n // {\r\n // if (!this) this = \r\n // this.a = X\r\n // this.b = Y\r\n // return this\r\n // }\r\n let stmts: ExpressionRef[] = [\r\n module.createIf(\r\n module.createUnary(nativeSizeType == NativeType.I64 ? UnaryOp.EqzI64 : UnaryOp.EqzI32,\r\n module.createGetLocal(thisLocal.index, nativeSizeType)\r\n ),\r\n module.createSetLocal(thisLocal.index,\r\n this.makeAllocation(classInstance)\r\n )\r\n )\r\n ];\r\n this.makeFieldInitialization(classInstance, stmts);\r\n stmts.push(\r\n module.createGetLocal(thisLocal.index, nativeSizeType)\r\n );\r\n this.currentType = thisLocal.type;\r\n return module.createBlock(null, stmts, nativeSizeType);\r\n }\r\n }\r\n // if not a constructor, `this` type can differ\r\n let thisType = assert(actualFunction.signature.thisType);\r\n this.currentType = thisType;\r\n return module.createGetLocal(thisLocal.index, thisType.toNativeType());\r\n }\r\n this.error(\r\n DiagnosticCode._this_cannot_be_referenced_in_current_location,\r\n expression.range\r\n );\r\n this.currentType = this.options.usizeType;\r\n return module.createUnreachable();\r\n }\r\n case NodeKind.SUPER: {\r\n let flow = this.currentFlow;\r\n let actualFunction = flow.actualFunction;\r\n if (actualFunction.is(CommonFlags.CONSTRUCTOR)) {\r\n if (!flow.is(FlowFlags.CALLS_SUPER)) {\r\n // TS1034 in the parser effectively limits this to property accesses\r\n this.error(\r\n DiagnosticCode._super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class,\r\n expression.range\r\n );\r\n }\r\n }\r\n if (flow.is(FlowFlags.INLINE_CONTEXT)) {\r\n let scopedThis = flow.lookupLocal(CommonSymbols.this_);\r\n if (scopedThis) {\r\n let scopedThisClass = assert(scopedThis.type.classReference);\r\n let base = scopedThisClass.base;\r\n if (base) {\r\n this.currentType = base.type;\r\n return module.createGetLocal(scopedThis.index, base.type.toNativeType());\r\n }\r\n }\r\n }\r\n if (actualFunction.is(CommonFlags.INSTANCE)) {\r\n let classInstance = assert(actualFunction.parent); assert(classInstance.kind == ElementKind.CLASS);\r\n let baseClassInstance = (classInstance).base;\r\n if (baseClassInstance) {\r\n let superType = baseClassInstance.type;\r\n this.currentType = superType;\r\n return module.createGetLocal(0, superType.toNativeType());\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode._super_can_only_be_referenced_in_a_derived_class,\r\n expression.range\r\n );\r\n this.currentType = this.options.usizeType;\r\n return module.createUnreachable();\r\n }\r\n }\r\n\r\n this.maybeCompileEnclosingSource(expression);\r\n\r\n // otherwise resolve\r\n var target = this.resolver.resolveIdentifier( // reports\r\n expression,\r\n flow,\r\n this.currentEnum || actualFunction\r\n );\r\n if (!target) return module.createUnreachable();\r\n\r\n switch (target.kind) {\r\n case ElementKind.LOCAL: {\r\n let localType = (target).type;\r\n assert(localType != Type.void);\r\n if ((target).is(CommonFlags.INLINED)) {\r\n return this.compileInlineConstant(target, contextualType, retainConstantType);\r\n }\r\n let localIndex = (target).index;\r\n assert(localIndex >= 0);\r\n this.currentType = localType;\r\n return this.module.createGetLocal(localIndex, localType.toNativeType());\r\n }\r\n case ElementKind.GLOBAL: {\r\n if (!this.compileGlobal(target)) { // reports; not yet compiled if a static field\r\n return this.module.createUnreachable();\r\n }\r\n let globalType = (target).type;\r\n assert(globalType != Type.void);\r\n if ((target).is(CommonFlags.INLINED)) {\r\n return this.compileInlineConstant(target, contextualType, retainConstantType);\r\n }\r\n this.currentType = globalType;\r\n return this.module.createGetGlobal((target).internalName, globalType.toNativeType());\r\n }\r\n case ElementKind.ENUMVALUE: { // here: if referenced from within the same enum\r\n if (!target.is(CommonFlags.COMPILED)) {\r\n this.error(\r\n DiagnosticCode.A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums,\r\n expression.range\r\n );\r\n this.currentType = Type.i32;\r\n return this.module.createUnreachable();\r\n }\r\n this.currentType = Type.i32;\r\n if ((target).is(CommonFlags.INLINED)) {\r\n assert((target).constantValueKind == ConstantValueKind.INTEGER);\r\n return this.module.createI32(i64_low((target).constantIntegerValue));\r\n }\r\n return this.module.createGetGlobal((target).internalName, NativeType.I32);\r\n }\r\n case ElementKind.FUNCTION_PROTOTYPE: {\r\n let instance = this.resolver.resolveFunction(\r\n target,\r\n null,\r\n makeMap(flow.contextualTypeArguments)\r\n );\r\n if (!(instance && this.compileFunction(instance))) return module.createUnreachable();\r\n let index = this.ensureFunctionTableEntry(instance);\r\n this.currentType = instance.signature.type;\r\n return this.module.createI32(index);\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.createUnreachable();\r\n }\r\n\r\n compileInstanceOfExpression(\r\n expression: InstanceOfExpression,\r\n contextualType: Type\r\n ): ExpressionRef {\r\n var module = this.module;\r\n // NOTE that this differs from TypeScript in that the rhs is a type, not an expression. at the\r\n // time of implementation, this seemed more useful because dynamic rhs expressions are not\r\n // possible in AS anyway.\r\n var expr = this.compileExpressionRetainType(expression.expression, this.options.usizeType, WrapMode.NONE);\r\n var actualType = this.currentType;\r\n var expectedType = this.resolver.resolveType(\r\n expression.isType,\r\n this.currentFlow.actualFunction\r\n );\r\n this.currentType = Type.bool;\r\n if (!expectedType) return module.createUnreachable();\r\n\r\n // instanceof must be exact\r\n if (!expectedType.is(TypeFlags.REFERENCE)) {\r\n return module.createI32(actualType == expectedType ? 1 : 0);\r\n }\r\n // instanceof must be != 0\r\n if (\r\n actualType.is(TypeFlags.NULLABLE) && !expectedType.is(TypeFlags.NULLABLE) &&\r\n actualType.nonNullableType.isAssignableTo(expectedType)\r\n ) {\r\n return module.createBinary(\r\n actualType.is(TypeFlags.LONG)\r\n ? BinaryOp.NeI64\r\n : BinaryOp.NeI32,\r\n expr,\r\n actualType.toNativeZero(module)\r\n );\r\n }\r\n return module.createI32(actualType.isAssignableTo(expectedType) ? 1 : 0);\r\n }\r\n\r\n compileLiteralExpression(\r\n expression: LiteralExpression,\r\n contextualType: Type,\r\n implicitNegate: bool = false\r\n ): ExpressionRef {\r\n var module = this.module;\r\n switch (expression.literalKind) {\r\n case LiteralKind.ARRAY: {\r\n assert(!implicitNegate);\r\n let classType = contextualType.classReference;\r\n if (\r\n classType &&\r\n classType.prototype == this.program.arrayPrototype\r\n ) {\r\n return this.compileArrayLiteral(\r\n assert(classType.typeArguments)[0],\r\n (expression).elementExpressions,\r\n false, // TODO: isConst?\r\n expression\r\n );\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return module.createUnreachable();\r\n }\r\n case LiteralKind.FLOAT: {\r\n let floatValue = (expression).value;\r\n if (implicitNegate) {\r\n floatValue = -floatValue;\r\n }\r\n if (contextualType == Type.f32) {\r\n return module.createF32(floatValue);\r\n }\r\n this.currentType = Type.f64;\r\n return module.createF64(floatValue);\r\n }\r\n case LiteralKind.INTEGER: {\r\n let intValue = (expression).value;\r\n if (implicitNegate) {\r\n intValue = i64_sub(\r\n i64_new(0),\r\n intValue\r\n );\r\n }\r\n let type = this.resolver.determineIntegerLiteralType(intValue, contextualType);\r\n this.currentType = type;\r\n switch (type.kind) {\r\n case TypeKind.ISIZE: if (!this.options.isWasm64) return module.createI32(i64_low(intValue));\r\n case TypeKind.I64: return module.createI64(i64_low(intValue), i64_high(intValue));\r\n case TypeKind.USIZE: if (!this.options.isWasm64) return module.createI32(i64_low(intValue));\r\n case TypeKind.U64: return module.createI64(i64_low(intValue), i64_high(intValue));\r\n case TypeKind.F32: return module.createF32(i64_to_f32(intValue));\r\n case TypeKind.F64: return module.createF64(i64_to_f64(intValue));\r\n default: return module.createI32(i64_low(intValue));\r\n }\r\n }\r\n case LiteralKind.STRING: {\r\n assert(!implicitNegate);\r\n return this.compileStringLiteral(expression);\r\n }\r\n case LiteralKind.OBJECT: {\r\n assert(!implicitNegate);\r\n return this.compileObjectLiteral(expression, contextualType);\r\n }\r\n // case LiteralKind.REGEXP:\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n this.currentType = contextualType;\r\n return module.createUnreachable();\r\n }\r\n\r\n /** Ensures that the specified string exists in static memory and returns a pointer to it. */\r\n ensureStaticString(stringValue: string): ExpressionRef {\r\n var program = this.program;\r\n var hasGC = program.hasGC;\r\n var gcHeaderSize = program.gcHeaderSize;\r\n\r\n var stringInstance = assert(program.stringInstance);\r\n var stringSegment: MemorySegment;\r\n\r\n // if the string already exists, reuse it\r\n var segments = this.stringSegments;\r\n if (segments.has(stringValue)) {\r\n stringSegment = segments.get(stringValue);\r\n\r\n // otherwise create it\r\n } else {\r\n let length = stringValue.length;\r\n let headerSize = (stringInstance.currentMemoryOffset + 1) & ~1;\r\n let totalSize = headerSize + length * 2;\r\n\r\n let buf: Uint8Array;\r\n let pos: u32;\r\n\r\n if (hasGC) {\r\n buf = new Uint8Array(gcHeaderSize + totalSize);\r\n pos = gcHeaderSize;\r\n writeI32(ensureGCHook(this, stringInstance), buf, program.gcHookOffset);\r\n } else {\r\n buf = new Uint8Array(totalSize);\r\n pos = 0;\r\n }\r\n writeI32(length, buf, pos + stringInstance.offsetof(LibrarySymbols.length));\r\n pos += headerSize;\r\n for (let i = 0; i < length; ++i) {\r\n writeI16(stringValue.charCodeAt(i), buf, pos + (i << 1));\r\n }\r\n stringSegment = this.addMemorySegment(buf);\r\n segments.set(stringValue, stringSegment);\r\n }\r\n var stringOffset = stringSegment.offset;\r\n if (hasGC) stringOffset = i64_add(stringOffset, i64_new(gcHeaderSize));\r\n\r\n this.currentType = stringInstance.type;\r\n if (this.options.isWasm64) {\r\n return this.module.createI64(i64_low(stringOffset), i64_high(stringOffset));\r\n } else {\r\n assert(i64_is_u32(stringOffset));\r\n return this.module.createI32(i64_low(stringOffset));\r\n }\r\n }\r\n\r\n compileStringLiteral(expression: StringLiteralExpression): ExpressionRef {\r\n return this.ensureStaticString(expression.value);\r\n }\r\n\r\n /** Ensures that the specified array exists in static memory and returns a pointer to it. */\r\n ensureStaticArray(elementType: Type, values: ExpressionRef[]): ExpressionRef {\r\n var program = this.program;\r\n var hasGC = program.hasGC;\r\n var gcHeaderSize = program.gcHeaderSize;\r\n\r\n var length = values.length;\r\n var byteSize = elementType.byteSize;\r\n var byteLength = length * byteSize;\r\n var usizeTypeSize = this.options.usizeType.byteSize;\r\n\r\n var buf: Uint8Array;\r\n var pos: u32;\r\n\r\n // create the backing ArrayBuffer segment\r\n var bufferInstance = assert(program.arrayBufferInstance);\r\n var bufferHeaderSize = (bufferInstance.currentMemoryOffset + 7) & ~7;\r\n var bufferTotalSize = 1 << (32 - clz(bufferHeaderSize + byteLength - 1));\r\n if (hasGC) {\r\n buf = new Uint8Array(gcHeaderSize + bufferTotalSize);\r\n pos = gcHeaderSize;\r\n writeI32(ensureGCHook(this, bufferInstance), buf, program.gcHookOffset);\r\n } else {\r\n buf = new Uint8Array(bufferTotalSize);\r\n pos = 0;\r\n }\r\n writeI32(byteLength, buf, pos + bufferInstance.offsetof(LibrarySymbols.byteLength));\r\n pos += bufferHeaderSize;\r\n var nativeType = elementType.toNativeType();\r\n switch (nativeType) {\r\n case NativeType.I32: {\r\n switch (byteSize) {\r\n case 1: {\r\n for (let i = 0; i < length; ++i) {\r\n let value = values[i];\r\n assert(getExpressionType(value) == nativeType);\r\n assert(getExpressionId(value) == ExpressionId.Const);\r\n writeI8(getConstValueI32(value), buf, pos);\r\n pos += 1;\r\n }\r\n break;\r\n }\r\n case 2: {\r\n for (let i = 0; i < length; ++i) {\r\n let value = values[i];\r\n assert(getExpressionType(value) == nativeType);\r\n assert(getExpressionId(value) == ExpressionId.Const);\r\n writeI16(getConstValueI32(value), buf, pos);\r\n pos += 2;\r\n }\r\n break;\r\n }\r\n case 4: {\r\n for (let i = 0; i < length; ++i) {\r\n let value = values[i];\r\n assert(getExpressionType(value) == nativeType);\r\n assert(getExpressionId(value) == ExpressionId.Const);\r\n writeI32(getConstValueI32(value), buf, pos);\r\n pos += 4;\r\n }\r\n break;\r\n }\r\n default: assert(false);\r\n }\r\n break;\r\n }\r\n case NativeType.I64: {\r\n for (let i = 0; i < length; ++i) {\r\n let value = values[i];\r\n assert(getExpressionType(value) == nativeType);\r\n assert(getExpressionId(value) == ExpressionId.Const);\r\n writeI64(i64_new(getConstValueI64Low(value), getConstValueI64High(value)), buf, pos);\r\n pos += 8;\r\n }\r\n break;\r\n }\r\n case NativeType.F32: {\r\n for (let i = 0; i < length; ++i) {\r\n let value = values[i];\r\n assert(getExpressionType(value) == nativeType);\r\n assert(getExpressionId(value) == ExpressionId.Const);\r\n writeF32(getConstValueF32(value), buf, pos);\r\n pos += 4;\r\n }\r\n break;\r\n }\r\n case NativeType.F64: {\r\n for (let i = 0; i < length; ++i) {\r\n let value = values[i];\r\n assert(getExpressionType(value) == nativeType);\r\n assert(getExpressionId(value) == ExpressionId.Const);\r\n writeF64(getConstValueF64(value), buf, pos);\r\n pos += 8;\r\n }\r\n break;\r\n }\r\n default: assert(false);\r\n }\r\n var bufferSegment = this.addMemorySegment(buf);\r\n var bufferOffset = bufferSegment.offset;\r\n if (hasGC) bufferOffset = i64_add(bufferOffset, i64_new(gcHeaderSize));\r\n\r\n // create the Array segment and return a pointer to it\r\n var arrayPrototype = assert(program.arrayPrototype);\r\n var arrayInstance = assert(this.resolver.resolveClass(\r\n arrayPrototype,\r\n [ elementType ],\r\n makeMap()\r\n ));\r\n var arrayHeaderSize = (arrayInstance.currentMemoryOffset + 7) & ~7;\r\n if (hasGC) {\r\n buf = new Uint8Array(gcHeaderSize + arrayHeaderSize);\r\n pos = gcHeaderSize;\r\n writeI32(ensureGCHook(this, arrayInstance), buf, program.gcHookOffset);\r\n } else {\r\n buf = new Uint8Array(arrayHeaderSize);\r\n pos = 0;\r\n }\r\n var arraySegment = this.addMemorySegment(buf);\r\n var arrayOffset = arraySegment.offset;\r\n if (hasGC) arrayOffset = i64_add(arrayOffset, i64_new(gcHeaderSize));\r\n this.currentType = arrayInstance.type;\r\n var buffer_offset = pos + arrayInstance.offsetof(\"buffer_\");\r\n var length_offset = pos + arrayInstance.offsetof(\"length_\");\r\n if (usizeTypeSize == 8) {\r\n writeI64(bufferOffset, buf, buffer_offset);\r\n writeI32(length, buf, length_offset);\r\n return this.module.createI64(i64_low(arrayOffset), i64_high(arrayOffset));\r\n } else {\r\n assert(i64_is_u32(bufferOffset));\r\n writeI32(i64_low(bufferOffset), buf, buffer_offset);\r\n writeI32(length, buf, length_offset);\r\n assert(i64_is_u32(arrayOffset));\r\n return this.module.createI32(i64_low(arrayOffset));\r\n }\r\n }\r\n\r\n compileArrayLiteral(\r\n elementType: Type,\r\n expressions: (Expression | null)[],\r\n isConst: bool,\r\n reportNode: Node\r\n ): ExpressionRef {\r\n var module = this.module;\r\n\r\n // find out whether all elements are constant (array is static)\r\n var length = expressions.length;\r\n var compiledValues = new Array(length);\r\n var constantValues = new Array(length);\r\n var nativeElementType = elementType.toNativeType();\r\n var isStatic = true;\r\n for (let i = 0; i < length; ++i) {\r\n let expression = expressions[i];\r\n let expr = expression\r\n ? this.compileExpression(expression, elementType, ConversionKind.IMPLICIT, WrapMode.NONE)\r\n : elementType.toNativeZero(module);\r\n compiledValues[i] = expr;\r\n if (isStatic) {\r\n expr = module.precomputeExpression(expr);\r\n if (getExpressionId(expr) == ExpressionId.Const) {\r\n assert(getExpressionType(expr) == nativeElementType);\r\n constantValues[i] = expr;\r\n } else {\r\n if (isConst) {\r\n this.warning(\r\n DiagnosticCode.Compiling_constant_with_non_constant_initializer_as_mutable,\r\n reportNode.range\r\n );\r\n }\r\n isStatic = false;\r\n }\r\n }\r\n }\r\n\r\n // make a static array if possible\r\n if (isStatic) return this.ensureStaticArray(elementType, constantValues);\r\n\r\n // otherwise obtain the array type\r\n var arrayPrototype = assert(this.program.arrayPrototype);\r\n var arrayInstance = assert(this.resolver.resolveClass(\r\n arrayPrototype,\r\n [ elementType ],\r\n makeMap()\r\n ));\r\n var arrayType = arrayInstance.type;\r\n\r\n // and compile an explicit instantiation\r\n this.currentType = arrayType;\r\n var setter = arrayInstance.lookupOverload(OperatorKind.INDEXED_SET, true);\r\n if (!setter) {\r\n this.error(\r\n DiagnosticCode.Index_signature_in_type_0_only_permits_reading,\r\n reportNode.range, arrayInstance.internalName\r\n );\r\n return module.createUnreachable();\r\n }\r\n var nativeArrayType = arrayType.toNativeType();\r\n var flow = this.currentFlow;\r\n var tempLocal = flow.parentFunction.addLocal(arrayType); // can't reuse a temp (used in compiledValues)\r\n var stmts = new Array(2 + length);\r\n var index = 0;\r\n stmts[index++] = module.createSetLocal(tempLocal.index,\r\n this.makeCallDirect(assert(arrayInstance.constructorInstance), [\r\n module.createI32(0), // this\r\n module.createI32(length)\r\n ])\r\n );\r\n for (let i = 0; i < length; ++i) {\r\n stmts[index++] = this.makeCallDirect(setter, [\r\n module.createGetLocal(tempLocal.index, nativeArrayType), // this\r\n module.createI32(i),\r\n compiledValues[i]\r\n ]);\r\n }\r\n assert(index + 1 == stmts.length);\r\n stmts[index] = module.createGetLocal(tempLocal.index, nativeArrayType);\r\n flow.freeTempLocal(tempLocal); // but can be reused now\r\n this.currentType = arrayType;\r\n return module.createBlock(null, stmts, nativeArrayType);\r\n }\r\n\r\n compileObjectLiteral(expression: ObjectLiteralExpression, contextualType: Type): ExpressionRef {\r\n var module = this.module;\r\n\r\n // contextual type must be a class\r\n var classReference = contextualType.classReference;\r\n if (!classReference || classReference.is(CommonFlags.ABSTRACT)) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_assignable_to_type_1,\r\n expression.range, \"\", contextualType.toString()\r\n );\r\n return module.createUnreachable();\r\n }\r\n\r\n // if present, check that the constructor is compatible with object literals\r\n var ctor = classReference.constructorInstance;\r\n if (ctor) {\r\n // TODO: if the constructor requires parameters, check whether these are given as part of the\r\n // object literal and use them to call the ctor while not generating a store.\r\n if (ctor.signature.requiredParameters) {\r\n this.error(\r\n DiagnosticCode.Constructor_of_class_0_must_not_require_any_arguments,\r\n expression.range, classReference.toString()\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (ctor.is(CommonFlags.PRIVATE)) {\r\n this.error(\r\n DiagnosticCode.Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration,\r\n expression.range, classReference.toString()\r\n );\r\n return module.createUnreachable();\r\n }\r\n if (ctor.is(CommonFlags.PROTECTED)) {\r\n this.error(\r\n DiagnosticCode.Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration,\r\n expression.range, classReference.toString()\r\n );\r\n return module.createUnreachable();\r\n }\r\n }\r\n\r\n // check and compile field values\r\n var names = expression.names;\r\n var numNames = names.length;\r\n var values = expression.values;\r\n var members = classReference.members;\r\n var hasErrors = false;\r\n var exprs = new Array(numNames + 2);\r\n var flow = this.currentFlow;\r\n var tempLocal = flow.getTempLocal(this.options.usizeType);\r\n assert(numNames == values.length);\r\n for (let i = 0, k = numNames; i < k; ++i) {\r\n let member = members ? members.get(names[i].text) : null;\r\n if (!member || member.kind != ElementKind.FIELD) {\r\n this.error(\r\n DiagnosticCode.Property_0_does_not_exist_on_type_1,\r\n names[i].range, names[i].text, classReference.toString()\r\n );\r\n hasErrors = true;\r\n continue;\r\n }\r\n let type = (member).type;\r\n exprs[i + 1] = this.module.createStore( // TODO: handle setters as well\r\n type.byteSize,\r\n this.module.createGetLocal(tempLocal.index, this.options.nativeSizeType),\r\n this.compileExpression(values[i], (member).type, ConversionKind.IMPLICIT, WrapMode.NONE),\r\n type.toNativeType(),\r\n (member).memoryOffset\r\n );\r\n }\r\n this.currentType = classReference.type.nonNullableType;\r\n if (hasErrors) return module.createUnreachable();\r\n\r\n // allocate a new instance first and assign 'this' to the temp. local\r\n exprs[0] = module.createSetLocal(\r\n tempLocal.index,\r\n this.makeAllocation(classReference)\r\n );\r\n\r\n // once all field values have been set, return 'this'\r\n exprs[exprs.length - 1] = module.createGetLocal(tempLocal.index, this.options.nativeSizeType);\r\n\r\n return module.createBlock(null, exprs, this.options.nativeSizeType);\r\n }\r\n\r\n compileNewExpression(expression: NewExpression, contextualType: Type): ExpressionRef {\r\n var module = this.module;\r\n var flow = this.currentFlow;\r\n\r\n // obtain the class being instantiated\r\n var target = this.resolver.resolveExpression( // reports\r\n expression.expression,\r\n flow\r\n );\r\n if (!target) return module.createUnreachable();\r\n if (target.kind != ElementKind.CLASS_PROTOTYPE) {\r\n this.error(\r\n DiagnosticCode.Cannot_use_new_with_an_expression_whose_type_lacks_a_construct_signature,\r\n expression.expression.range\r\n );\r\n return this.module.createUnreachable();\r\n }\r\n var classPrototype = target;\r\n var classInstance: Class | null = null;\r\n var typeArguments = expression.typeArguments;\r\n var classReference: Class | null;\r\n if (\r\n !typeArguments &&\r\n (classReference = contextualType.classReference) !== null &&\r\n classReference.is(CommonFlags.GENERIC)\r\n ) {\r\n classInstance = this.resolver.resolveClass(\r\n classPrototype,\r\n classReference.typeArguments,\r\n makeMap(flow.contextualTypeArguments)\r\n );\r\n } else {\r\n classInstance = this.resolver.resolveClassInclTypeArguments(\r\n classPrototype,\r\n typeArguments,\r\n flow.actualFunction.parent, // relative to caller\r\n makeMap(flow.contextualTypeArguments),\r\n expression\r\n );\r\n }\r\n if (!classInstance) return module.createUnreachable();\r\n return this.compileInstantiate(classInstance, expression.arguments, expression);\r\n }\r\n\r\n /** Gets the compiled constructor of the specified class or generates one if none is present. */\r\n ensureConstructor(classInstance: Class, reportNode: Node): Function {\r\n var instance = classInstance.constructorInstance;\r\n if (instance) {\r\n // do not attempt to compile it if inlined anyway\r\n if (!instance.hasDecorator(DecoratorFlags.INLINE)) this.compileFunction(instance);\r\n return instance;\r\n }\r\n\r\n // clone base constructor if a derived class\r\n var baseClass = classInstance.base;\r\n if (baseClass) {\r\n let baseCtor = this.ensureConstructor(baseClass, reportNode);\r\n instance = new Function(\r\n CommonSymbols.constructor,\r\n new FunctionPrototype(\r\n CommonSymbols.constructor,\r\n classInstance,\r\n // declaration is important, i.e. to access optional parameter initializers\r\n (baseCtor.declaration).clone()\r\n ),\r\n baseCtor.signature,\r\n null\r\n );\r\n\r\n // otherwise make a default constructor\r\n } else {\r\n instance = new Function(\r\n CommonSymbols.constructor,\r\n new FunctionPrototype(\r\n CommonSymbols.constructor,\r\n classInstance,\r\n this.program.makeNativeFunctionDeclaration(CommonSymbols.constructor,\r\n CommonFlags.INSTANCE | CommonFlags.CONSTRUCTOR\r\n )\r\n ),\r\n new Signature(null, classInstance.type, classInstance.type),\r\n null\r\n );\r\n }\r\n\r\n instance.internalName = classInstance.internalName + INSTANCE_DELIMITER + \"constructor\";\r\n instance.set(CommonFlags.COMPILED);\r\n instance.prototype.setResolvedInstance(\"\", instance);\r\n classInstance.constructorInstance = instance;\r\n var previousFlow = this.currentFlow;\r\n this.currentFlow = instance.flow;\r\n\r\n // generate body\r\n var signature = instance.signature;\r\n var module = this.module;\r\n var nativeSizeType = this.options.nativeSizeType;\r\n var stmts = new Array();\r\n\r\n // {\r\n // if (!this) this = \r\n // IF_DERIVED: this = super(this, ...args)\r\n // this.a = X\r\n // this.b = Y\r\n // return this\r\n // }\r\n stmts.push(\r\n module.createIf(\r\n module.createUnary(nativeSizeType == NativeType.I64 ? UnaryOp.EqzI64 : UnaryOp.EqzI32,\r\n module.createGetLocal(0, nativeSizeType)\r\n ),\r\n module.createSetLocal(0,\r\n this.makeAllocation(classInstance)\r\n )\r\n )\r\n );\r\n if (baseClass) {\r\n let parameterTypes = signature.parameterTypes;\r\n let numParameters = parameterTypes.length;\r\n let operands = new Array(1 + numParameters);\r\n operands[0] = module.createGetLocal(0, nativeSizeType);\r\n for (let i = 0; i < numParameters; ++i) {\r\n operands[i + 1] = module.createGetLocal(i + 1, parameterTypes[i].toNativeType());\r\n }\r\n // TODO: base constructor might be inlined, but makeCallDirect can't do this\r\n stmts.push(\r\n module.createSetLocal(0,\r\n this.makeCallDirect(assert(baseClass.constructorInstance), operands)\r\n )\r\n );\r\n }\r\n this.makeFieldInitialization(classInstance, stmts);\r\n stmts.push(\r\n module.createGetLocal(0, nativeSizeType)\r\n );\r\n\r\n // make the function\r\n var typeRef = this.ensureFunctionType(signature.parameterTypes, signature.returnType, signature.thisType);\r\n var locals = instance.localsByIndex;\r\n var varTypes = new Array(); // of temp. vars added while compiling initializers\r\n var numOperands = 1 + signature.parameterTypes.length;\r\n var numLocals = locals.length;\r\n if (numLocals > numOperands) {\r\n for (let i = numOperands; i < numLocals; ++i) varTypes.push(locals[i].type.toNativeType());\r\n }\r\n var funcRef = module.addFunction(instance.internalName, typeRef, varTypes,\r\n stmts.length == 1\r\n ? stmts[0]\r\n : module.createBlock(null, stmts, nativeSizeType)\r\n );\r\n instance.finalize(module, funcRef);\r\n this.currentFlow = previousFlow;\r\n return instance;\r\n }\r\n\r\n compileInstantiate(classInstance: Class, argumentExpressions: Expression[], reportNode: Node): ExpressionRef {\r\n var ctor = this.ensureConstructor(classInstance, reportNode);\r\n var expr = this.compileCallDirect(\r\n ctor,\r\n argumentExpressions,\r\n reportNode,\r\n this.options.usizeType.toNativeZero(this.module)\r\n );\r\n this.currentType = classInstance.type;\r\n return expr;\r\n }\r\n\r\n compileParenthesizedExpression(\r\n expression: ParenthesizedExpression,\r\n contextualType: Type\r\n ): ExpressionRef {\r\n // does not change types, just order\r\n return this.compileExpression(\r\n expression.expression,\r\n contextualType,\r\n ConversionKind.NONE,\r\n WrapMode.NONE\r\n );\r\n }\r\n\r\n /**\r\n * Compiles a property access in the specified context.\r\n * @param retainConstantType Retains the type of inlined constants if `true`, otherwise\r\n * precomputes them according to context.\r\n */\r\n compilePropertyAccessExpression(\r\n propertyAccess: PropertyAccessExpression,\r\n contextualType: Type,\r\n retainConstantType: bool\r\n ): ExpressionRef {\r\n var module = this.module;\r\n var flow = this.currentFlow;\r\n\r\n this.maybeCompileEnclosingSource(propertyAccess);\r\n\r\n var target = this.resolver.resolvePropertyAccessExpression(propertyAccess, flow, contextualType); // reports\r\n if (!target) return module.createUnreachable();\r\n\r\n switch (target.kind) {\r\n case ElementKind.GLOBAL: { // static field\r\n if (!this.compileGlobal(target)) { // reports; not yet compiled if a static field\r\n return module.createUnreachable();\r\n }\r\n let globalType = (target).type;\r\n assert(globalType != Type.void);\r\n if ((target).is(CommonFlags.INLINED)) {\r\n return this.compileInlineConstant(target, contextualType, retainConstantType);\r\n }\r\n this.currentType = globalType;\r\n return module.createGetGlobal((target).internalName, globalType.toNativeType());\r\n }\r\n case ElementKind.ENUMVALUE: { // enum value\r\n let theEnum = assert((target).parent); assert(theEnum.kind == ElementKind.ENUM);\r\n if (!this.compileEnum(theEnum)) {\r\n this.currentType = Type.i32;\r\n return this.module.createUnreachable();\r\n }\r\n this.currentType = Type.i32;\r\n if ((target).is(CommonFlags.INLINED)) {\r\n assert((target).constantValueKind == ConstantValueKind.INTEGER);\r\n return module.createI32(i64_low((target).constantIntegerValue));\r\n }\r\n return module.createGetGlobal((target).internalName, NativeType.I32);\r\n }\r\n case ElementKind.FIELD: { // instance field\r\n assert((target).memoryOffset >= 0);\r\n let thisExpr = this.compileExpressionRetainType(\r\n assert(this.resolver.currentThisExpression),\r\n this.options.usizeType,\r\n WrapMode.NONE\r\n );\r\n this.currentType = (target).type;\r\n return module.createLoad(\r\n (target).type.byteSize,\r\n (target).type.is(TypeFlags.SIGNED | TypeFlags.INTEGER),\r\n thisExpr,\r\n (target).type.toNativeType(),\r\n (target).memoryOffset\r\n );\r\n }\r\n case ElementKind.PROPERTY_PROTOTYPE: {// static property\r\n let getterPrototype = (target).getterPrototype;\r\n if (getterPrototype) {\r\n let getter = this.resolver.resolveFunction(getterPrototype, null);\r\n if (getter) return this.compileCallDirect(getter, [], propertyAccess, 0);\r\n }\r\n return module.createUnreachable();\r\n }\r\n case ElementKind.PROPERTY: { // instance property\r\n let getterInstance = assert((target).getterInstance);\r\n return this.compileCallDirect(getterInstance, [], propertyAccess,\r\n this.compileExpressionRetainType(\r\n assert(this.resolver.currentThisExpression),\r\n this.options.usizeType,\r\n WrapMode.NONE\r\n )\r\n );\r\n }\r\n case ElementKind.FUNCTION_PROTOTYPE: {\r\n this.error(\r\n DiagnosticCode.Cannot_access_method_0_without_calling_it_as_it_requires_this_to_be_set,\r\n propertyAccess.range, (target).name\r\n );\r\n return module.createUnreachable();\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n propertyAccess.range\r\n );\r\n return module.createUnreachable();\r\n }\r\n\r\n private compileGetter(target: PropertyPrototype, reportNode: Node): ExpressionRef {\r\n var prototype = target.getterPrototype;\r\n if (prototype) {\r\n let instance = this.resolver.resolveFunction(prototype, null);\r\n if (!instance) return this.module.createUnreachable();\r\n let signature = instance.signature;\r\n if (!this.checkCallSignature( // reports\r\n signature,\r\n 0,\r\n instance.is(CommonFlags.INSTANCE),\r\n reportNode\r\n )) {\r\n return this.module.createUnreachable();\r\n }\r\n if (instance.is(CommonFlags.INSTANCE)) {\r\n let classInstance = assert(instance.parent); assert(classInstance.kind == ElementKind.CLASS);\r\n let thisExpression = assert(this.resolver.currentThisExpression); //!!!\r\n let thisExpr = this.compileExpressionRetainType(\r\n thisExpression,\r\n this.options.usizeType,\r\n WrapMode.NONE\r\n );\r\n this.currentType = signature.returnType;\r\n return this.compileCallDirect(instance, [], reportNode, thisExpr);\r\n } else {\r\n this.currentType = signature.returnType;\r\n return this.compileCallDirect(instance, [], reportNode, 0);\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode.Property_0_does_not_exist_on_type_1,\r\n reportNode.range, (target).name, (target).parent.toString()\r\n );\r\n return this.module.createUnreachable();\r\n }\r\n }\r\n\r\n compileTernaryExpression(expression: TernaryExpression, contextualType: Type): ExpressionRef {\r\n var ifThen = expression.ifThen;\r\n var ifElse = expression.ifElse;\r\n var outerFlow = this.currentFlow;\r\n\r\n var condExpr = this.makeIsTrueish(\r\n this.compileExpressionRetainType(expression.condition, Type.bool, WrapMode.NONE),\r\n this.currentType\r\n );\r\n\r\n // Try to eliminate unnecesssary branches if the condition is constant\r\n var condExprPrecomp = this.module.precomputeExpression(condExpr);\r\n if (\r\n getExpressionId(condExprPrecomp) == ExpressionId.Const &&\r\n getExpressionType(condExprPrecomp) == NativeType.I32\r\n ) {\r\n return getConstValueI32(condExprPrecomp)\r\n ? this.compileExpressionRetainType(ifThen, contextualType, WrapMode.NONE)\r\n : this.compileExpressionRetainType(ifElse, contextualType, WrapMode.NONE);\r\n\r\n // Otherwise recompile to the original and let the optimizer decide\r\n } else /* if (condExpr != condExprPrecomp) <- not guaranteed */ {\r\n condExpr = this.makeIsTrueish(\r\n this.compileExpressionRetainType(expression.condition, Type.bool, WrapMode.NONE),\r\n this.currentType\r\n );\r\n }\r\n\r\n var ifThenFlow = outerFlow.fork();\r\n this.currentFlow = ifThenFlow;\r\n var ifThenExpr = this.compileExpressionRetainType(ifThen, contextualType, WrapMode.NONE);\r\n var ifThenType = this.currentType;\r\n ifThenFlow.freeScopedLocals();\r\n\r\n var ifElseFlow = outerFlow.fork();\r\n this.currentFlow = ifElseFlow;\r\n var ifElseExpr = this.compileExpressionRetainType(ifElse, contextualType, WrapMode.NONE);\r\n var ifElseType = this.currentType;\r\n ifElseFlow.freeScopedLocals();\r\n this.currentFlow = outerFlow;\r\n\r\n outerFlow.inheritMutual(ifThenFlow, ifElseFlow);\r\n\r\n var commonType = Type.commonDenominator(ifThenType, ifElseType, false);\r\n if (!commonType) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_assignable_to_type_1,\r\n expression.range, ifThenType.toString(), ifElseType.toString()\r\n );\r\n this.currentType = contextualType;\r\n return this.module.createUnreachable();\r\n }\r\n ifThenExpr = this.convertExpression(\r\n ifThenExpr,\r\n ifThenType,\r\n commonType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE,\r\n ifThen\r\n );\r\n ifElseExpr = this.convertExpression(\r\n ifElseExpr,\r\n ifElseType,\r\n commonType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE,\r\n ifElse\r\n );\r\n this.currentType = commonType;\r\n return this.module.createIf(condExpr, ifThenExpr, ifElseExpr);\r\n }\r\n\r\n compileUnaryPostfixExpression(expression: UnaryPostfixExpression, contextualType: Type): ExpressionRef {\r\n var module = this.module;\r\n var flow = this.currentFlow;\r\n\r\n // make a getter for the expression (also obtains the type)\r\n var getValue = this.compileExpression( // reports\r\n expression.operand,\r\n contextualType == Type.void\r\n ? Type.i32\r\n : contextualType,\r\n ConversionKind.NONE,\r\n WrapMode.NONE\r\n );\r\n\r\n // shortcut if compiling the getter already failed\r\n if (getExpressionId(getValue) == ExpressionId.Unreachable) return getValue;\r\n\r\n var currentType = this.currentType;\r\n\r\n // if the value isn't dropped, a temp. local is required to remember the original value\r\n var tempLocal: Local | null = null;\r\n if (contextualType != Type.void) {\r\n tempLocal = flow.getTempLocal(currentType, false);\r\n getValue = module.createTeeLocal(\r\n tempLocal.index,\r\n getValue\r\n );\r\n }\r\n\r\n var calcValue: ExpressionRef;\r\n\r\n switch (expression.operator) {\r\n case Token.PLUS_PLUS: {\r\n switch (currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: {\r\n calcValue = module.createBinary(\r\n BinaryOp.AddI32,\r\n getValue,\r\n module.createI32(1)\r\n );\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = this.currentType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.POSTFIX_INC);\r\n if (overload) {\r\n calcValue = this.compileUnaryOverload(overload, expression.operand, getValue, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return module.createUnreachable();\r\n }\r\n }\r\n case TypeKind.ISIZE: {\r\n let options = this.options;\r\n calcValue = module.createBinary(\r\n options.isWasm64\r\n ? BinaryOp.AddI64\r\n : BinaryOp.AddI32,\r\n getValue,\r\n currentType.toNativeOne(module)\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n calcValue = module.createBinary(\r\n BinaryOp.AddI64,\r\n getValue,\r\n module.createI64(1)\r\n );\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n calcValue = module.createBinary(\r\n BinaryOp.AddF32,\r\n getValue,\r\n module.createF32(1)\r\n );\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n calcValue = module.createBinary(\r\n BinaryOp.AddF64,\r\n getValue,\r\n module.createF64(1)\r\n );\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n return module.createUnreachable();\r\n }\r\n }\r\n break;\r\n }\r\n case Token.MINUS_MINUS: {\r\n switch (currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: {\r\n calcValue = module.createBinary(\r\n BinaryOp.SubI32,\r\n getValue,\r\n module.createI32(1)\r\n );\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = this.currentType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.POSTFIX_DEC);\r\n if (overload) {\r\n calcValue = this.compileUnaryOverload(overload, expression.operand, getValue, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return module.createUnreachable();\r\n }\r\n }\r\n case TypeKind.ISIZE: {\r\n let options = this.options;\r\n calcValue = module.createBinary(\r\n options.isWasm64\r\n ? BinaryOp.SubI64\r\n : BinaryOp.SubI32,\r\n getValue,\r\n currentType.toNativeOne(module)\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n calcValue = module.createBinary(\r\n BinaryOp.SubI64,\r\n getValue,\r\n module.createI64(1)\r\n );\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n calcValue = module.createBinary(\r\n BinaryOp.SubF32,\r\n getValue,\r\n module.createF32(1)\r\n );\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n calcValue = module.createBinary(\r\n BinaryOp.SubF64,\r\n getValue,\r\n module.createF64(1)\r\n );\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n return module.createUnreachable();\r\n }\r\n }\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n return module.createUnreachable();\r\n }\r\n }\r\n\r\n // simplify if dropped anyway\r\n if (!tempLocal) {\r\n this.currentType = Type.void;\r\n return this.compileAssignmentWithValue(expression.operand,\r\n calcValue,\r\n false\r\n );\r\n }\r\n\r\n // otherwise use the temp. local for the intermediate value (always possibly overflows)\r\n var setValue = this.compileAssignmentWithValue(expression.operand,\r\n calcValue, // also tees getValue to tempLocal\r\n false\r\n );\r\n\r\n this.currentType = tempLocal.type;\r\n flow.freeTempLocal(tempLocal);\r\n var nativeType = tempLocal.type.toNativeType();\r\n\r\n return module.createBlock(null, [\r\n setValue,\r\n module.createGetLocal(tempLocal.index, nativeType)\r\n ], nativeType); // result of 'x++' / 'x--' might overflow\r\n }\r\n\r\n compileUnaryPrefixExpression(\r\n expression: UnaryPrefixExpression,\r\n contextualType: Type\r\n ): ExpressionRef {\r\n var module = this.module;\r\n var compound = false;\r\n var expr: ExpressionRef;\r\n\r\n switch (expression.operator) {\r\n case Token.PLUS: {\r\n expr = this.compileExpression(\r\n expression.operand,\r\n contextualType == Type.void\r\n ? Type.i32\r\n : contextualType,\r\n ConversionKind.NONE,\r\n WrapMode.NONE\r\n );\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = this.currentType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.PLUS);\r\n if (overload) {\r\n expr = this.compileUnaryOverload(overload, expression.operand, expr, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return module.createUnreachable();\r\n }\r\n\r\n // nop\r\n break;\r\n }\r\n case Token.MINUS: {\r\n if (expression.operand.kind == NodeKind.LITERAL && (\r\n (expression.operand).literalKind == LiteralKind.INTEGER ||\r\n (expression.operand).literalKind == LiteralKind.FLOAT\r\n )) {\r\n // implicitly negate integer and float literals. also enables proper checking of literal ranges.\r\n expr = this.compileLiteralExpression(expression.operand, contextualType, true);\r\n // compileExpression normally does this:\r\n if (this.options.sourceMap) this.addDebugLocation(expr, expression.range);\r\n break;\r\n }\r\n\r\n expr = this.compileExpression(\r\n expression.operand,\r\n contextualType == Type.void\r\n ? Type.i32\r\n : contextualType,\r\n ConversionKind.NONE,\r\n WrapMode.NONE\r\n );\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = this.currentType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.MINUS);\r\n if (overload) {\r\n expr = this.compileUnaryOverload(overload, expression.operand, expr, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return module.createUnreachable();\r\n }\r\n\r\n switch (this.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: {\r\n expr = module.createBinary(BinaryOp.SubI32, module.createI32(0), expr);\r\n break;\r\n }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n expr = module.createBinary(\r\n this.options.isWasm64\r\n ? BinaryOp.SubI64\r\n : BinaryOp.SubI32,\r\n this.currentType.toNativeZero(module),\r\n expr\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.createBinary(BinaryOp.SubI64, module.createI64(0), expr);\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n expr = module.createUnary(UnaryOp.NegF32, expr);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.createUnary(UnaryOp.NegF64, expr);\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.createUnreachable();\r\n }\r\n }\r\n break;\r\n }\r\n case Token.PLUS_PLUS: {\r\n compound = true;\r\n expr = this.compileExpression(\r\n expression.operand,\r\n contextualType == Type.void\r\n ? Type.i32\r\n : contextualType,\r\n ConversionKind.NONE,\r\n WrapMode.NONE\r\n );\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = this.currentType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.PREFIX_INC);\r\n if (overload) {\r\n expr = this.compileUnaryOverload(overload, expression.operand, expr, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return module.createUnreachable();\r\n }\r\n\r\n switch (this.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: {\r\n expr = module.createBinary(BinaryOp.AddI32, expr, this.module.createI32(1));\r\n break;\r\n }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n expr = module.createBinary(\r\n this.options.isWasm64\r\n ? BinaryOp.AddI64\r\n : BinaryOp.AddI32,\r\n expr,\r\n this.currentType.toNativeOne(module)\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.createBinary(BinaryOp.AddI64, expr, module.createI64(1));\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n expr = module.createBinary(BinaryOp.AddF32, expr, module.createF32(1));\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.createBinary(BinaryOp.AddF64, expr, module.createF64(1));\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.createUnreachable();\r\n }\r\n }\r\n break;\r\n }\r\n case Token.MINUS_MINUS: {\r\n compound = true;\r\n expr = this.compileExpression(\r\n expression.operand,\r\n contextualType == Type.void\r\n ? Type.i32\r\n : contextualType,\r\n ConversionKind.NONE,\r\n WrapMode.NONE\r\n );\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = this.currentType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.PREFIX_DEC);\r\n if (overload) {\r\n expr = this.compileUnaryOverload(overload, expression.operand, expr, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return module.createUnreachable();\r\n }\r\n\r\n switch (this.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: {\r\n expr = module.createBinary(BinaryOp.SubI32, expr, module.createI32(1));\r\n break;\r\n }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n expr = module.createBinary(\r\n this.options.isWasm64\r\n ? BinaryOp.SubI64\r\n : BinaryOp.SubI32,\r\n expr,\r\n this.currentType.toNativeOne(module)\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.createBinary(BinaryOp.SubI64, expr, module.createI64(1));\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n expr = module.createBinary(BinaryOp.SubF32, expr, module.createF32(1));\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.createBinary(BinaryOp.SubF64, expr, module.createF64(1));\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.createUnreachable();\r\n }\r\n }\r\n break;\r\n }\r\n case Token.EXCLAMATION: {\r\n expr = this.compileExpression(\r\n expression.operand,\r\n contextualType == Type.void\r\n ? Type.i32\r\n : contextualType,\r\n ConversionKind.NONE,\r\n WrapMode.NONE\r\n );\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = this.currentType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.NOT);\r\n if (overload) {\r\n expr = this.compileUnaryOverload(overload, expression.operand, expr, expression);\r\n break;\r\n }\r\n }\r\n // allow '!' for references even without an overload\r\n }\r\n\r\n expr = this.makeIsFalseish(expr, this.currentType);\r\n this.currentType = Type.bool;\r\n break;\r\n }\r\n case Token.TILDE: {\r\n expr = this.compileExpression(\r\n expression.operand,\r\n contextualType == Type.void\r\n ? Type.i32\r\n : contextualType.is(TypeFlags.FLOAT)\r\n ? Type.i64\r\n : contextualType,\r\n ConversionKind.NONE,\r\n WrapMode.NONE\r\n );\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = this.currentType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.BITWISE_NOT);\r\n if (overload) {\r\n expr = this.compileUnaryOverload(overload, expression.operand, expr, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return module.createUnreachable();\r\n } else {\r\n expr = this.convertExpression(\r\n expr,\r\n this.currentType, this.currentType.intType,\r\n ConversionKind.IMPLICIT, WrapMode.NONE,\r\n expression.operand\r\n );\r\n }\r\n\r\n switch (this.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: {\r\n expr = module.createBinary(BinaryOp.XorI32, expr, module.createI32(-1));\r\n break;\r\n }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n expr = module.createBinary(\r\n this.options.isWasm64\r\n ? BinaryOp.XorI64\r\n : BinaryOp.XorI32,\r\n expr,\r\n this.currentType.toNativeNegOne(module)\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.createBinary(BinaryOp.XorI64, expr, module.createI64(-1, -1));\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.createUnreachable();\r\n }\r\n }\r\n break;\r\n }\r\n case Token.TYPEOF: {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return module.createUnreachable();\r\n }\r\n default: {\r\n assert(false);\r\n return module.createUnreachable();\r\n }\r\n }\r\n return compound\r\n ? this.compileAssignmentWithValue(expression.operand, expr, contextualType != Type.void)\r\n : expr;\r\n }\r\n\r\n /** Makes sure that a 32-bit integer value is wrapped to a valid value of the specified type. */\r\n ensureSmallIntegerWrap(expr: ExpressionRef, type: Type): ExpressionRef {\r\n var module = this.module;\r\n var flow = this.currentFlow;\r\n switch (type.kind) {\r\n case TypeKind.I8: {\r\n if (flow.canOverflow(expr, type)) {\r\n expr = this.options.hasFeature(Feature.SIGN_EXTENSION)\r\n ? module.createUnary(UnaryOp.ExtendI8ToI32, expr)\r\n : module.createBinary(BinaryOp.ShrI32,\r\n module.createBinary(BinaryOp.ShlI32,\r\n expr,\r\n module.createI32(24)\r\n ),\r\n module.createI32(24)\r\n );\r\n }\r\n break;\r\n }\r\n case TypeKind.I16: {\r\n if (flow.canOverflow(expr, type)) {\r\n expr = this.options.hasFeature(Feature.SIGN_EXTENSION)\r\n ? module.createUnary(UnaryOp.ExtendI16ToI32, expr)\r\n : module.createBinary(BinaryOp.ShrI32,\r\n module.createBinary(BinaryOp.ShlI32,\r\n expr,\r\n module.createI32(16)\r\n ),\r\n module.createI32(16)\r\n );\r\n }\r\n break;\r\n }\r\n case TypeKind.U8: {\r\n if (flow.canOverflow(expr, type)) {\r\n expr = module.createBinary(BinaryOp.AndI32,\r\n expr,\r\n module.createI32(0xff)\r\n );\r\n }\r\n break;\r\n }\r\n case TypeKind.U16: {\r\n if (flow.canOverflow(expr, type)) {\r\n expr = module.createBinary(BinaryOp.AndI32,\r\n expr,\r\n module.createI32(0xffff)\r\n );\r\n }\r\n break;\r\n }\r\n case TypeKind.BOOL: {\r\n if (flow.canOverflow(expr, type)) {\r\n // bool is special in that it compares to 0 instead of masking with 0x1\r\n expr = module.createBinary(BinaryOp.NeI32,\r\n expr,\r\n module.createI32(0)\r\n );\r\n }\r\n break;\r\n }\r\n }\r\n return expr;\r\n }\r\n\r\n /** Creates a comparison whether an expression is 'false' in a broader sense. */\r\n makeIsFalseish(expr: ExpressionRef, type: Type): ExpressionRef {\r\n var module = this.module;\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.BOOL: {\r\n expr = this.ensureSmallIntegerWrap(expr, type);\r\n // fall-through\r\n }\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n return module.createUnary(UnaryOp.EqzI32, expr);\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n return module.createUnary(UnaryOp.EqzI64, expr);\r\n }\r\n case TypeKind.USIZE: // TODO: strings?\r\n case TypeKind.ISIZE: {\r\n return module.createUnary(type.size == 64 ? UnaryOp.EqzI64 : UnaryOp.EqzI32, expr);\r\n }\r\n case TypeKind.F32: {\r\n return module.createBinary(BinaryOp.EqF32, expr, module.createF32(0));\r\n }\r\n case TypeKind.F64: {\r\n return module.createBinary(BinaryOp.EqF64, expr, module.createF64(0));\r\n }\r\n default: {\r\n assert(false);\r\n return module.createI32(1);\r\n }\r\n }\r\n }\r\n\r\n /** Creates a comparison whether an expression is 'true' in a broader sense. */\r\n makeIsTrueish(expr: ExpressionRef, type: Type): ExpressionRef {\r\n var module = this.module;\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.BOOL: {\r\n expr = this.ensureSmallIntegerWrap(expr, type);\r\n // fall-through\r\n }\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n return expr;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n return module.createBinary(BinaryOp.NeI64, expr, module.createI64(0));\r\n }\r\n case TypeKind.USIZE: // TODO: strings?\r\n case TypeKind.ISIZE: {\r\n return type.size == 64\r\n ? module.createBinary(BinaryOp.NeI64, expr, module.createI64(0))\r\n : expr;\r\n }\r\n case TypeKind.F32: {\r\n return module.createBinary(BinaryOp.NeF32, expr, module.createF32(0));\r\n }\r\n case TypeKind.F64: {\r\n return module.createBinary(BinaryOp.NeF64, expr, module.createF64(0));\r\n }\r\n default: {\r\n assert(false);\r\n return module.createI32(0);\r\n }\r\n }\r\n }\r\n\r\n /** Makes an allocation suitable to hold the data of an instance of the given class. */\r\n makeAllocation(classInstance: Class): ExpressionRef {\r\n var program = this.program;\r\n assert(classInstance.program == program);\r\n var module = this.module;\r\n var options = this.options;\r\n\r\n // __gc_allocate(size, markFn)\r\n if (program.hasGC && classInstance.type.isManaged(program)) {\r\n let allocateInstance = assert(program.gcAllocateInstance);\r\n if (!this.compileFunction(allocateInstance)) return module.createUnreachable();\r\n this.currentType = classInstance.type;\r\n return module.createCall(\r\n allocateInstance.internalName, [\r\n options.isWasm64\r\n ? module.createI64(classInstance.currentMemoryOffset)\r\n : module.createI32(classInstance.currentMemoryOffset),\r\n module.createI32(\r\n ensureGCHook(this, classInstance)\r\n )\r\n ],\r\n options.nativeSizeType\r\n );\r\n\r\n // memory.allocate(size)\r\n } else {\r\n let allocateInstance = program.memoryAllocateInstance;\r\n if (!allocateInstance || !this.compileFunction(allocateInstance)) return module.createUnreachable();\r\n this.currentType = classInstance.type;\r\n return module.createCall(\r\n allocateInstance.internalName, [\r\n options.isWasm64\r\n ? module.createI64(classInstance.currentMemoryOffset)\r\n : module.createI32(classInstance.currentMemoryOffset)\r\n ],\r\n options.nativeSizeType\r\n );\r\n }\r\n }\r\n\r\n /** Makes the initializers for a class's fields. */\r\n makeFieldInitialization(classInstance: Class, stmts: ExpressionRef[] = []): ExpressionRef[] {\r\n var members = classInstance.members;\r\n if (!members) return [];\r\n\r\n var module = this.module;\r\n var flow = this.currentFlow;\r\n var isInline = flow.is(FlowFlags.INLINE_CONTEXT);\r\n var thisLocalIndex = isInline\r\n ? assert(flow.lookupLocal(CommonSymbols.this_)).index\r\n : 0;\r\n var nativeSizeType = this.options.nativeSizeType;\r\n\r\n for (let member of members.values()) {\r\n if (\r\n member.kind != ElementKind.FIELD || // not a field\r\n member.parent != classInstance // inherited field\r\n ) continue;\r\n\r\n let field = member; assert(!field.isAny(CommonFlags.CONST));\r\n let fieldType = field.type;\r\n let nativeFieldType = fieldType.toNativeType();\r\n let initializerNode = field.prototype.initializerNode;\r\n if (initializerNode) { // use initializer\r\n stmts.push(\r\n module.createStore(fieldType.byteSize,\r\n module.createGetLocal(thisLocalIndex, nativeSizeType),\r\n this.compileExpression( // reports\r\n initializerNode,\r\n fieldType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n ),\r\n nativeFieldType,\r\n field.memoryOffset\r\n )\r\n );\r\n } else {\r\n let parameterIndex = field.prototype.parameterIndex;\r\n stmts.push(\r\n module.createStore(fieldType.byteSize,\r\n module.createGetLocal(thisLocalIndex, nativeSizeType),\r\n parameterIndex >= 0 // initialized via parameter (here: a local)\r\n ? module.createGetLocal(\r\n isInline\r\n ? assert(flow.lookupLocal(field.name)).index\r\n : 1 + parameterIndex, // this is local 0\r\n nativeFieldType\r\n )\r\n : fieldType.toNativeZero(module),\r\n nativeFieldType,\r\n field.memoryOffset\r\n )\r\n );\r\n }\r\n }\r\n return stmts;\r\n }\r\n\r\n /** Adds the debug location of the specified expression at the specified range to the source map. */\r\n addDebugLocation(expr: ExpressionRef, range: Range): void {\r\n var parentFunction = this.currentFlow.parentFunction;\r\n var source = range.source;\r\n if (source.debugInfoIndex < 0) source.debugInfoIndex = this.module.addDebugInfoFile(source.normalizedPath);\r\n range.debugInfoRef = expr;\r\n parentFunction.debugLocations.push(range);\r\n }\r\n}\r\n\r\n// helpers\r\n\r\nfunction mangleImportName(\r\n element: Element,\r\n declaration: DeclarationStatement\r\n): void {\r\n // by default, use the file name as the module name\r\n mangleImportName_moduleName = declaration.range.source.simplePath;\r\n // and the internal name of the element within that file as the element name\r\n mangleImportName_elementName = mangleInternalName(\r\n element.name, element.parent, element.is(CommonFlags.INSTANCE), true\r\n );\r\n if (!element.hasDecorator(DecoratorFlags.EXTERNAL)) return;\r\n\r\n var program = element.program;\r\n var decorator = assert(findDecorator(DecoratorKind.EXTERNAL, declaration.decorators));\r\n var args = decorator.arguments;\r\n if (args && args.length) {\r\n let arg = args[0];\r\n // if one argument is given, override just the element name\r\n // if two arguments are given, override both module and element name\r\n if (arg.kind == NodeKind.LITERAL && (arg).literalKind == LiteralKind.STRING) {\r\n mangleImportName_elementName = (arg).value;\r\n if (args.length >= 2) {\r\n arg = args[1];\r\n if (arg.kind == NodeKind.LITERAL && (arg).literalKind == LiteralKind.STRING) {\r\n mangleImportName_moduleName = mangleImportName_elementName;\r\n mangleImportName_elementName = (arg).value;\r\n if (args.length > 2) {\r\n program.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n decorator.range, \"2\", args.length.toString()\r\n );\r\n }\r\n } else {\r\n program.error(\r\n DiagnosticCode.String_literal_expected,\r\n arg.range\r\n );\r\n }\r\n }\r\n } else {\r\n program.error(\r\n DiagnosticCode.String_literal_expected,\r\n arg.range\r\n );\r\n }\r\n } else {\r\n program.error(\r\n DiagnosticCode.Expected_at_least_0_arguments_but_got_1,\r\n decorator.range, \"1\", \"0\"\r\n );\r\n }\r\n}\r\n\r\nvar mangleImportName_moduleName: string;\r\nvar mangleImportName_elementName: string;\r\n\r\n/** Special compiler symbols. */\r\nnamespace CompilerSymbols {\r\n /** Module started global. Used if an explicit start function is present. */\r\n export const started = \"~lib/started\";\r\n /** Argument count global. Used to call trampolines for varargs functions. */\r\n export const argc = \"~lib/argc\";\r\n /** Argument count setter. Exported for use by host calls. */\r\n export const setargc = \"~lib/setargc\";\r\n}\r\n","/**\r\n * Generated from diagnosticsMessages.json. Do not edit.\r\n * @module diagnostics\r\n *//***/\r\n\r\n/* tslint:disable:max-line-length */\r\n\r\n/** Enum of available diagnostic codes. */\r\nexport enum DiagnosticCode {\r\n Operation_not_supported = 100,\r\n Operation_is_unsafe = 101,\r\n User_defined_0 = 102,\r\n Conversion_from_type_0_to_1_requires_an_explicit_cast = 200,\r\n Conversion_from_type_0_to_1_will_require_an_explicit_cast_when_switching_between_32_64_bit = 201,\r\n Type_0_cannot_be_changed_to_type_1 = 202,\r\n Type_0_cannot_be_reinterpreted_as_type_1 = 203,\r\n Basic_type_0_cannot_be_nullable = 204,\r\n Cannot_export_a_mutable_global = 205,\r\n Compiling_constant_with_non_constant_initializer_as_mutable = 206,\r\n Unmanaged_classes_cannot_extend_managed_classes_and_vice_versa = 207,\r\n Unmanaged_classes_cannot_implement_interfaces = 208,\r\n Invalid_regular_expression_flags = 209,\r\n Implementation_0_must_match_the_signature_1 = 210,\r\n Class_0_is_sealed_and_cannot_be_extended = 211,\r\n Decorator_0_is_not_valid_here = 212,\r\n Duplicate_decorator = 213,\r\n An_allocator_must_be_declared_to_allocate_memory_Try_importing_allocator_arena_or_allocator_tlsf = 214,\r\n Optional_parameter_must_have_an_initializer = 215,\r\n Constructor_of_class_0_must_not_require_any_arguments = 216,\r\n Function_0_cannot_be_inlined_into_itself = 217,\r\n Cannot_access_method_0_without_calling_it_as_it_requires_this_to_be_set = 218,\r\n Optional_properties_are_not_supported = 219,\r\n Expression_must_be_a_compile_time_constant = 220,\r\n Module_cannot_have_multiple_start_functions = 221,\r\n _0_must_be_a_value_between_1_and_2_inclusive = 222,\r\n _0_must_be_a_power_of_two = 223,\r\n Unterminated_string_literal = 1002,\r\n Identifier_expected = 1003,\r\n _0_expected = 1005,\r\n A_file_cannot_have_a_reference_to_itself = 1006,\r\n Trailing_comma_not_allowed = 1009,\r\n Unexpected_token = 1012,\r\n A_rest_parameter_must_be_last_in_a_parameter_list = 1014,\r\n Parameter_cannot_have_question_mark_and_initializer = 1015,\r\n A_required_parameter_cannot_follow_an_optional_parameter = 1016,\r\n Statements_are_not_allowed_in_ambient_contexts = 1036,\r\n Initializers_are_not_allowed_in_ambient_contexts = 1039,\r\n _0_modifier_cannot_be_used_here = 1042,\r\n A_rest_parameter_cannot_be_optional = 1047,\r\n A_rest_parameter_cannot_have_an_initializer = 1048,\r\n A_set_accessor_must_have_exactly_one_parameter = 1049,\r\n A_set_accessor_parameter_cannot_have_an_initializer = 1052,\r\n A_get_accessor_cannot_have_parameters = 1054,\r\n Enum_member_must_have_initializer = 1061,\r\n Type_parameters_cannot_appear_on_a_constructor_declaration = 1092,\r\n Type_annotation_cannot_appear_on_a_constructor_declaration = 1093,\r\n An_accessor_cannot_have_type_parameters = 1094,\r\n A_set_accessor_cannot_have_a_return_type_annotation = 1095,\r\n Type_parameter_list_cannot_be_empty = 1098,\r\n A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement = 1104,\r\n A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement = 1105,\r\n A_return_statement_can_only_be_used_within_a_function_body = 1108,\r\n Expression_expected = 1109,\r\n Type_expected = 1110,\r\n A_default_clause_cannot_appear_more_than_once_in_a_switch_statement = 1113,\r\n Duplicate_label_0 = 1114,\r\n Octal_literals_are_not_allowed_in_strict_mode = 1121,\r\n Digit_expected = 1124,\r\n Hexadecimal_digit_expected = 1125,\r\n Unexpected_end_of_text = 1126,\r\n Invalid_character = 1127,\r\n _case_or_default_expected = 1130,\r\n _super_must_be_followed_by_an_argument_list_or_member_access = 1034,\r\n A_declare_modifier_cannot_be_used_in_an_already_ambient_context = 1038,\r\n Type_argument_expected = 1140,\r\n String_literal_expected = 1141,\r\n Line_break_not_permitted_here = 1142,\r\n Declaration_expected = 1146,\r\n _const_declarations_must_be_initialized = 1155,\r\n Unterminated_regular_expression_literal = 1161,\r\n Interface_declaration_cannot_have_implements_clause = 1176,\r\n Binary_digit_expected = 1177,\r\n Octal_digit_expected = 1178,\r\n An_implementation_cannot_be_declared_in_ambient_contexts = 1183,\r\n An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive = 1198,\r\n Unterminated_Unicode_escape_sequence = 1199,\r\n Decorators_are_not_valid_here = 1206,\r\n _abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration = 1242,\r\n Method_0_cannot_have_an_implementation_because_it_is_marked_abstract = 1245,\r\n A_definite_assignment_assertion_is_not_permitted_in_this_context = 1255,\r\n A_class_may_only_extend_another_class = 1311,\r\n A_parameter_property_cannot_be_declared_using_a_rest_parameter = 1317,\r\n Duplicate_identifier_0 = 2300,\r\n Cannot_find_name_0 = 2304,\r\n Module_0_has_no_exported_member_1 = 2305,\r\n Generic_type_0_requires_1_type_argument_s = 2314,\r\n Type_0_is_not_generic = 2315,\r\n Type_0_is_not_assignable_to_type_1 = 2322,\r\n Index_signature_is_missing_in_type_0 = 2329,\r\n _this_cannot_be_referenced_in_current_location = 2332,\r\n _super_can_only_be_referenced_in_a_derived_class = 2335,\r\n Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors = 2337,\r\n Property_0_does_not_exist_on_type_1 = 2339,\r\n Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures = 2349,\r\n Cannot_use_new_with_an_expression_whose_type_lacks_a_construct_signature = 2351,\r\n A_function_whose_declared_type_is_not_void_must_return_a_value = 2355,\r\n The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access = 2357,\r\n The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access = 2364,\r\n Operator_0_cannot_be_applied_to_types_1_and_2 = 2365,\r\n A_super_call_must_be_the_first_statement_in_the_constructor = 2376,\r\n Constructors_for_derived_classes_must_contain_a_super_call = 2377,\r\n _get_and_set_accessor_must_have_the_same_type = 2380,\r\n Constructor_implementation_is_missing = 2390,\r\n Function_implementation_is_missing_or_not_immediately_following_the_declaration = 2391,\r\n Multiple_constructor_implementations_are_not_allowed = 2392,\r\n Duplicate_function_implementation = 2393,\r\n Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local = 2395,\r\n A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged = 2434,\r\n Type_0_has_no_property_1 = 2460,\r\n The_0_operator_cannot_be_applied_to_type_1 = 2469,\r\n In_const_enum_declarations_member_initializer_must_be_constant_expression = 2474,\r\n Export_declaration_conflicts_with_exported_declaration_of_0 = 2484,\r\n Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property = 2540,\r\n The_target_of_an_assignment_must_be_a_variable_or_a_property_access = 2541,\r\n Index_signature_in_type_0_only_permits_reading = 2542,\r\n Expected_0_arguments_but_got_1 = 2554,\r\n Expected_at_least_0_arguments_but_got_1 = 2555,\r\n Expected_0_type_arguments_but_got_1 = 2558,\r\n A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums = 2651,\r\n Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration = 2673,\r\n Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration = 2674,\r\n Namespace_0_has_no_exported_member_1 = 2694,\r\n Required_type_parameters_may_not_follow_optional_type_parameters = 2706,\r\n Duplicate_property_0 = 2718,\r\n File_0_not_found = 6054,\r\n Numeric_separators_are_not_allowed_here = 6188,\r\n Multiple_consecutive_numeric_separators_are_not_permitted = 6189,\r\n _super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class = 17009,\r\n _super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class = 17011\r\n}\r\n\r\n/** Translates a diagnostic code to its respective string. */\r\nexport function diagnosticCodeToString(code: DiagnosticCode): string {\r\n switch (code) {\r\n case 100: return \"Operation not supported.\";\r\n case 101: return \"Operation is unsafe.\";\r\n case 102: return \"User-defined: {0}\";\r\n case 200: return \"Conversion from type '{0}' to '{1}' requires an explicit cast.\";\r\n case 201: return \"Conversion from type '{0}' to '{1}' will require an explicit cast when switching between 32/64-bit.\";\r\n case 202: return \"Type '{0}' cannot be changed to type '{1}'.\";\r\n case 203: return \"Type '{0}' cannot be reinterpreted as type '{1}'.\";\r\n case 204: return \"Basic type '{0}' cannot be nullable.\";\r\n case 205: return \"Cannot export a mutable global.\";\r\n case 206: return \"Compiling constant with non-constant initializer as mutable.\";\r\n case 207: return \"Unmanaged classes cannot extend managed classes and vice-versa.\";\r\n case 208: return \"Unmanaged classes cannot implement interfaces.\";\r\n case 209: return \"Invalid regular expression flags.\";\r\n case 210: return \"Implementation '{0}' must match the signature '{1}'.\";\r\n case 211: return \"Class '{0}' is sealed and cannot be extended.\";\r\n case 212: return \"Decorator '{0}' is not valid here.\";\r\n case 213: return \"Duplicate decorator.\";\r\n case 214: return \"An allocator must be declared to allocate memory. Try importing allocator/arena or allocator/tlsf.\";\r\n case 215: return \"Optional parameter must have an initializer.\";\r\n case 216: return \"Constructor of class '{0}' must not require any arguments.\";\r\n case 217: return \"Function '{0}' cannot be inlined into itself.\";\r\n case 218: return \"Cannot access method '{0}' without calling it as it requires 'this' to be set.\";\r\n case 219: return \"Optional properties are not supported.\";\r\n case 220: return \"Expression must be a compile-time constant.\";\r\n case 221: return \"Module cannot have multiple start functions.\";\r\n case 222: return \"'{0}' must be a value between '{1}' and '{2}' inclusive.\";\r\n case 223: return \"'{0}' must be a power of two.\";\r\n case 1002: return \"Unterminated string literal.\";\r\n case 1003: return \"Identifier expected.\";\r\n case 1005: return \"'{0}' expected.\";\r\n case 1006: return \"A file cannot have a reference to itself.\";\r\n case 1009: return \"Trailing comma not allowed.\";\r\n case 1012: return \"Unexpected token.\";\r\n case 1014: return \"A rest parameter must be last in a parameter list.\";\r\n case 1015: return \"Parameter cannot have question mark and initializer.\";\r\n case 1016: return \"A required parameter cannot follow an optional parameter.\";\r\n case 1036: return \"Statements are not allowed in ambient contexts.\";\r\n case 1039: return \"Initializers are not allowed in ambient contexts.\";\r\n case 1042: return \"'{0}' modifier cannot be used here.\";\r\n case 1047: return \"A rest parameter cannot be optional.\";\r\n case 1048: return \"A rest parameter cannot have an initializer.\";\r\n case 1049: return \"A 'set' accessor must have exactly one parameter.\";\r\n case 1052: return \"A 'set' accessor parameter cannot have an initializer.\";\r\n case 1054: return \"A 'get' accessor cannot have parameters.\";\r\n case 1061: return \"Enum member must have initializer.\";\r\n case 1092: return \"Type parameters cannot appear on a constructor declaration.\";\r\n case 1093: return \"Type annotation cannot appear on a constructor declaration.\";\r\n case 1094: return \"An accessor cannot have type parameters.\";\r\n case 1095: return \"A 'set' accessor cannot have a return type annotation.\";\r\n case 1098: return \"Type parameter list cannot be empty.\";\r\n case 1104: return \"A 'continue' statement can only be used within an enclosing iteration statement.\";\r\n case 1105: return \"A 'break' statement can only be used within an enclosing iteration or switch statement.\";\r\n case 1108: return \"A 'return' statement can only be used within a function body.\";\r\n case 1109: return \"Expression expected.\";\r\n case 1110: return \"Type expected.\";\r\n case 1113: return \"A 'default' clause cannot appear more than once in a 'switch' statement.\";\r\n case 1114: return \"Duplicate label '{0}'.\";\r\n case 1121: return \"Octal literals are not allowed in strict mode.\";\r\n case 1124: return \"Digit expected.\";\r\n case 1125: return \"Hexadecimal digit expected.\";\r\n case 1126: return \"Unexpected end of text.\";\r\n case 1127: return \"Invalid character.\";\r\n case 1130: return \"'case' or 'default' expected.\";\r\n case 1034: return \"'super' must be followed by an argument list or member access.\";\r\n case 1038: return \"A 'declare' modifier cannot be used in an already ambient context.\";\r\n case 1140: return \"Type argument expected.\";\r\n case 1141: return \"String literal expected.\";\r\n case 1142: return \"Line break not permitted here.\";\r\n case 1146: return \"Declaration expected.\";\r\n case 1155: return \"'const' declarations must be initialized.\";\r\n case 1161: return \"Unterminated regular expression literal.\";\r\n case 1176: return \"Interface declaration cannot have 'implements' clause.\";\r\n case 1177: return \"Binary digit expected.\";\r\n case 1178: return \"Octal digit expected.\";\r\n case 1183: return \"An implementation cannot be declared in ambient contexts.\";\r\n case 1198: return \"An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.\";\r\n case 1199: return \"Unterminated Unicode escape sequence.\";\r\n case 1206: return \"Decorators are not valid here.\";\r\n case 1242: return \"'abstract' modifier can only appear on a class, method, or property declaration.\";\r\n case 1245: return \"Method '{0}' cannot have an implementation because it is marked abstract.\";\r\n case 1255: return \"A definite assignment assertion '!' is not permitted in this context.\";\r\n case 1311: return \"A class may only extend another class.\";\r\n case 1317: return \"A parameter property cannot be declared using a rest parameter.\";\r\n case 2300: return \"Duplicate identifier '{0}'.\";\r\n case 2304: return \"Cannot find name '{0}'.\";\r\n case 2305: return \"Module '{0}' has no exported member '{1}'.\";\r\n case 2314: return \"Generic type '{0}' requires {1} type argument(s).\";\r\n case 2315: return \"Type '{0}' is not generic.\";\r\n case 2322: return \"Type '{0}' is not assignable to type '{1}'.\";\r\n case 2329: return \"Index signature is missing in type '{0}'.\";\r\n case 2332: return \"'this' cannot be referenced in current location.\";\r\n case 2335: return \"'super' can only be referenced in a derived class.\";\r\n case 2337: return \"Super calls are not permitted outside constructors or in nested functions inside constructors.\";\r\n case 2339: return \"Property '{0}' does not exist on type '{1}'.\";\r\n case 2349: return \"Cannot invoke an expression whose type lacks a call signature. Type '{0}' has no compatible call signatures.\";\r\n case 2351: return \"Cannot use 'new' with an expression whose type lacks a construct signature.\";\r\n case 2355: return \"A function whose declared type is not 'void' must return a value.\";\r\n case 2357: return \"The operand of an increment or decrement operator must be a variable or a property access.\";\r\n case 2364: return \"The left-hand side of an assignment expression must be a variable or a property access.\";\r\n case 2365: return \"Operator '{0}' cannot be applied to types '{1}' and '{2}'.\";\r\n case 2376: return \"A 'super' call must be the first statement in the constructor.\";\r\n case 2377: return \"Constructors for derived classes must contain a 'super' call.\";\r\n case 2380: return \"'get' and 'set' accessor must have the same type.\";\r\n case 2390: return \"Constructor implementation is missing.\";\r\n case 2391: return \"Function implementation is missing or not immediately following the declaration.\";\r\n case 2392: return \"Multiple constructor implementations are not allowed.\";\r\n case 2393: return \"Duplicate function implementation.\";\r\n case 2395: return \"Individual declarations in merged declaration '{0}' must be all exported or all local.\";\r\n case 2434: return \"A namespace declaration cannot be located prior to a class or function with which it is merged.\";\r\n case 2460: return \"Type '{0}' has no property '{1}'.\";\r\n case 2469: return \"The '{0}' operator cannot be applied to type '{1}'.\";\r\n case 2474: return \"In 'const' enum declarations member initializer must be constant expression.\";\r\n case 2484: return \"Export declaration conflicts with exported declaration of '{0}'.\";\r\n case 2540: return \"Cannot assign to '{0}' because it is a constant or a read-only property.\";\r\n case 2541: return \"The target of an assignment must be a variable or a property access.\";\r\n case 2542: return \"Index signature in type '{0}' only permits reading.\";\r\n case 2554: return \"Expected {0} arguments, but got {1}.\";\r\n case 2555: return \"Expected at least {0} arguments, but got {1}.\";\r\n case 2558: return \"Expected {0} type arguments, but got {1}.\";\r\n case 2651: return \"A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums.\";\r\n case 2673: return \"Constructor of class '{0}' is private and only accessible within the class declaration.\";\r\n case 2674: return \"Constructor of class '{0}' is protected and only accessible within the class declaration.\";\r\n case 2694: return \"Namespace '{0}' has no exported member '{1}'.\";\r\n case 2706: return \"Required type parameters may not follow optional type parameters.\";\r\n case 2718: return \"Duplicate property '{0}'.\";\r\n case 6054: return \"File '{0}' not found.\";\r\n case 6188: return \"Numeric separators are not allowed here.\";\r\n case 6189: return \"Multiple consecutive numeric separators are not permitted.\";\r\n case 17009: return \"'super' must be called before accessing 'this' in the constructor of a derived class.\";\r\n case 17011: return \"'super' must be called before accessing a property of 'super' in the constructor of a derived class.\";\r\n default: return \"\";\r\n }\r\n}\r\n","/**\r\n * A control flow analyzer.\r\n * @module flow\r\n *//***/\r\n\r\nimport {\r\n Type,\r\n TypeFlags,\r\n TypeKind\r\n} from \"./types\";\r\n\r\nimport {\r\n Local,\r\n Function,\r\n Element,\r\n ElementKind,\r\n Global\r\n} from \"./program\";\r\n\r\nimport {\r\n NativeType,\r\n ExpressionId,\r\n ExpressionRef,\r\n\r\n getExpressionId,\r\n getGetLocalIndex,\r\n isTeeLocal,\r\n getSetLocalValue,\r\n getGetGlobalName,\r\n getBinaryOp,\r\n BinaryOp,\r\n getBinaryLeft,\r\n getConstValueI32,\r\n getBinaryRight,\r\n getUnaryOp,\r\n UnaryOp,\r\n getExpressionType,\r\n getConstValueI64Low,\r\n getConstValueF32,\r\n getConstValueF64,\r\n getLoadBytes,\r\n isLoadSigned,\r\n getBlockName,\r\n getBlockChildCount,\r\n getBlockChild,\r\n getIfTrue,\r\n getIfFalse,\r\n getSelectThen,\r\n getSelectElse,\r\n getCallTarget\r\n} from \"./module\";\r\n\r\nimport {\r\n CommonFlags\r\n} from \"./common\";\r\n\r\nimport {\r\n DiagnosticCode\r\n} from \"./diagnostics\";\r\n\r\nimport {\r\n Node\r\n} from \"./ast\";\r\n\r\nimport {\r\n bitsetIs,\r\n bitsetSet\r\n} from \"./util\";\r\n\r\n/** Control flow flags indicating specific conditions. */\r\nexport const enum FlowFlags {\r\n /** No specific conditions. */\r\n NONE = 0,\r\n\r\n // categorical\r\n\r\n /** This flow returns. */\r\n RETURNS = 1 << 0,\r\n /** This flow returns a wrapped value. */\r\n RETURNS_WRAPPED = 1 << 1,\r\n /** This flow throws. */\r\n THROWS = 1 << 2,\r\n /** This flow breaks. */\r\n BREAKS = 1 << 3,\r\n /** This flow continues. */\r\n CONTINUES = 1 << 4,\r\n /** This flow allocates. Constructors only. */\r\n ALLOCATES = 1 << 5,\r\n /** This flow calls super. Constructors only. */\r\n CALLS_SUPER = 1 << 6,\r\n\r\n // conditional\r\n\r\n /** This flow conditionally returns in a child flow. */\r\n CONDITIONALLY_RETURNS = 1 << 7,\r\n /** This flow conditionally throws in a child flow. */\r\n CONDITIONALLY_THROWS = 1 << 8,\r\n /** This flow conditionally breaks in a child flow. */\r\n CONDITIONALLY_BREAKS = 1 << 9,\r\n /** This flow conditionally continues in a child flow. */\r\n CONDITIONALLY_CONTINUES = 1 << 10,\r\n /** This flow conditionally allocates in a child flow. Constructors only. */\r\n CONDITIONALLY_ALLOCATES = 1 << 11,\r\n\r\n // special\r\n\r\n /** This is an inlining flow. */\r\n INLINE_CONTEXT = 1 << 12,\r\n /** This is a flow with explicitly disabled bounds checking. */\r\n UNCHECKED_CONTEXT = 1 << 13,\r\n\r\n // masks\r\n\r\n /** Any terminating flag. */\r\n ANY_TERMINATING = FlowFlags.RETURNS\r\n | FlowFlags.THROWS\r\n | FlowFlags.BREAKS\r\n | FlowFlags.CONTINUES,\r\n\r\n /** Any categorical flag. */\r\n ANY_CATEGORICAL = FlowFlags.RETURNS\r\n | FlowFlags.RETURNS_WRAPPED\r\n | FlowFlags.THROWS\r\n | FlowFlags.BREAKS\r\n | FlowFlags.CONTINUES\r\n | FlowFlags.ALLOCATES\r\n | FlowFlags.CALLS_SUPER,\r\n\r\n /** Any conditional flag. */\r\n ANY_CONDITIONAL = FlowFlags.CONDITIONALLY_RETURNS\r\n | FlowFlags.CONDITIONALLY_THROWS\r\n | FlowFlags.CONDITIONALLY_BREAKS\r\n | FlowFlags.CONDITIONALLY_CONTINUES\r\n | FlowFlags.CONDITIONALLY_ALLOCATES\r\n}\r\n\r\n/** A control flow evaluator. */\r\nexport class Flow {\r\n\r\n /** Parent flow. */\r\n parent: Flow | null;\r\n /** Flow flags indicating specific conditions. */\r\n flags: FlowFlags;\r\n /** Function this flow belongs to. */\r\n parentFunction: Function;\r\n /** The label we break to when encountering a continue statement. */\r\n continueLabel: string | null;\r\n /** The label we break to when encountering a break statement. */\r\n breakLabel: string | null;\r\n /** The current return type. */\r\n returnType: Type;\r\n /** The current contextual type arguments. */\r\n contextualTypeArguments: Map | null;\r\n /** Scoped local variables. */\r\n scopedLocals: Map | null = null;\r\n /** Local variable wrap states for the first 64 locals. */\r\n wrappedLocals: I64;\r\n /** Local variable wrap states for locals with index >= 64. */\r\n wrappedLocalsExt: I64[] | null;\r\n /** Function being inlined, when inlining. */\r\n inlineFunction: Function | null;\r\n /** The label we break to when encountering a return statement, when inlining. */\r\n inlineReturnLabel: string | null;\r\n\r\n /** Creates the parent flow of the specified function. */\r\n static create(parentFunction: Function): Flow {\r\n var flow = new Flow();\r\n flow.parent = null;\r\n flow.flags = FlowFlags.NONE;\r\n flow.parentFunction = parentFunction;\r\n flow.continueLabel = null;\r\n flow.breakLabel = null;\r\n flow.returnType = parentFunction.signature.returnType;\r\n flow.contextualTypeArguments = parentFunction.contextualTypeArguments;\r\n flow.wrappedLocals = i64_new(0);\r\n flow.wrappedLocalsExt = null;\r\n flow.inlineFunction = null;\r\n flow.inlineReturnLabel = null;\r\n return flow;\r\n }\r\n\r\n /** Creates an inline flow within `currentFunction`. */\r\n static createInline(parentFunction: Function, inlineFunction: Function): Flow {\r\n var flow = Flow.create(parentFunction);\r\n flow.set(FlowFlags.INLINE_CONTEXT);\r\n flow.inlineFunction = inlineFunction;\r\n flow.inlineReturnLabel = inlineFunction.internalName + \"|inlined.\" + (inlineFunction.nextInlineId++).toString(10);\r\n flow.returnType = inlineFunction.signature.returnType;\r\n flow.contextualTypeArguments = inlineFunction.contextualTypeArguments;\r\n return flow;\r\n }\r\n\r\n private constructor() { }\r\n\r\n /** Gets the actual function being compiled, The inlined function when inlining, otherwise the parent function. */\r\n get actualFunction(): Function {\r\n return this.inlineFunction || this.parentFunction;\r\n }\r\n\r\n /** Tests if this flow has the specified flag or flags. */\r\n is(flag: FlowFlags): bool { return (this.flags & flag) == flag; }\r\n /** Tests if this flow has one of the specified flags. */\r\n isAny(flag: FlowFlags): bool { return (this.flags & flag) != 0; }\r\n /** Sets the specified flag or flags. */\r\n set(flag: FlowFlags): void { this.flags |= flag; }\r\n /** Unsets the specified flag or flags. */\r\n unset(flag: FlowFlags): void { this.flags &= ~flag; }\r\n\r\n /** Forks this flow to a child flow. */\r\n fork(): Flow {\r\n var branch = new Flow();\r\n branch.parent = this;\r\n branch.flags = this.flags;\r\n branch.parentFunction = this.parentFunction;\r\n branch.continueLabel = this.continueLabel;\r\n branch.breakLabel = this.breakLabel;\r\n branch.returnType = this.returnType;\r\n branch.contextualTypeArguments = this.contextualTypeArguments;\r\n branch.wrappedLocals = this.wrappedLocals;\r\n branch.wrappedLocalsExt = this.wrappedLocalsExt ? this.wrappedLocalsExt.slice() : null;\r\n branch.inlineFunction = this.inlineFunction;\r\n branch.inlineReturnLabel = this.inlineReturnLabel;\r\n return branch;\r\n }\r\n\r\n /** Gets a free temporary local of the specified type. */\r\n getTempLocal(type: Type, wrapped: bool = false): Local {\r\n var parentFunction = this.parentFunction;\r\n var temps: Local[] | null;\r\n switch (type.toNativeType()) {\r\n case NativeType.I32: { temps = parentFunction.tempI32s; break; }\r\n case NativeType.I64: { temps = parentFunction.tempI64s; break; }\r\n case NativeType.F32: { temps = parentFunction.tempF32s; break; }\r\n case NativeType.F64: { temps = parentFunction.tempF64s; break; }\r\n case NativeType.V128: { temps = parentFunction.tempV128s; break; }\r\n default: throw new Error(\"concrete type expected\");\r\n }\r\n var local: Local;\r\n if (temps && temps.length) {\r\n local = temps.pop();\r\n local.type = type;\r\n local.flags = CommonFlags.NONE;\r\n } else {\r\n local = parentFunction.addLocal(type);\r\n }\r\n if (type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) this.setLocalWrapped(local.index, wrapped);\r\n return local;\r\n }\r\n\r\n /** Frees the temporary local for reuse. */\r\n freeTempLocal(local: Local): void {\r\n if (local.is(CommonFlags.INLINED)) return;\r\n assert(local.index >= 0);\r\n var parentFunction = this.parentFunction;\r\n var temps: Local[];\r\n assert(local.type != null); // internal error\r\n switch ((local.type).toNativeType()) {\r\n case NativeType.I32: {\r\n temps = parentFunction.tempI32s || (parentFunction.tempI32s = []);\r\n break;\r\n }\r\n case NativeType.I64: {\r\n temps = parentFunction.tempI64s || (parentFunction.tempI64s = []);\r\n break;\r\n }\r\n case NativeType.F32: {\r\n temps = parentFunction.tempF32s || (parentFunction.tempF32s = []);\r\n break;\r\n }\r\n case NativeType.F64: {\r\n temps = parentFunction.tempF64s || (parentFunction.tempF64s = []);\r\n break;\r\n }\r\n case NativeType.V128: {\r\n temps = parentFunction.tempV128s || (parentFunction.tempV128s = []);\r\n break;\r\n }\r\n default: throw new Error(\"concrete type expected\");\r\n }\r\n assert(local.index >= 0);\r\n temps.push(local);\r\n }\r\n\r\n /** Gets and immediately frees a temporary local of the specified type. */\r\n getAndFreeTempLocal(type: Type, wrapped: bool): Local {\r\n var parentFunction = this.parentFunction;\r\n var temps: Local[];\r\n switch (type.toNativeType()) {\r\n case NativeType.I32: {\r\n temps = parentFunction.tempI32s || (parentFunction.tempI32s = []);\r\n break;\r\n }\r\n case NativeType.I64: {\r\n temps = parentFunction.tempI64s || (parentFunction.tempI64s = []);\r\n break;\r\n }\r\n case NativeType.F32: {\r\n temps = parentFunction.tempF32s || (parentFunction.tempF32s = []);\r\n break;\r\n }\r\n case NativeType.F64: {\r\n temps = parentFunction.tempF64s || (parentFunction.tempF64s = []);\r\n break;\r\n }\r\n case NativeType.V128: {\r\n temps = parentFunction.tempV128s || (parentFunction.tempV128s = []);\r\n break;\r\n }\r\n default: throw new Error(\"concrete type expected\");\r\n }\r\n var local: Local;\r\n if (temps.length) {\r\n local = temps[temps.length - 1];\r\n local.type = type;\r\n } else {\r\n local = parentFunction.addLocal(type);\r\n temps.push(local);\r\n }\r\n if (type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) this.setLocalWrapped(local.index, wrapped);\r\n return local;\r\n }\r\n\r\n /** Adds a new scoped local of the specified name. */\r\n addScopedLocal(name: string, type: Type, wrapped: bool, reportNode: Node | null = null): Local {\r\n var scopedLocal = this.getTempLocal(type, false);\r\n if (!this.scopedLocals) this.scopedLocals = new Map();\r\n else {\r\n let existingLocal = this.scopedLocals.get(name);\r\n if (existingLocal) {\r\n if (reportNode) {\r\n this.parentFunction.program.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n reportNode.range\r\n );\r\n }\r\n return existingLocal;\r\n }\r\n }\r\n scopedLocal.set(CommonFlags.SCOPED);\r\n this.scopedLocals.set(name, scopedLocal);\r\n if (type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) {\r\n this.setLocalWrapped(scopedLocal.index, wrapped);\r\n }\r\n return scopedLocal;\r\n }\r\n\r\n /** Adds a new scoped alias for the specified local. For example `super` aliased to the `this` local. */\r\n addScopedAlias(name: string, type: Type, index: i32, reportNode: Node | null = null): Local {\r\n if (!this.scopedLocals) this.scopedLocals = new Map();\r\n else {\r\n let existingLocal = this.scopedLocals.get(name);\r\n if (existingLocal) {\r\n if (reportNode) {\r\n this.parentFunction.program.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n reportNode.range\r\n );\r\n }\r\n return existingLocal;\r\n }\r\n }\r\n assert(index < this.parentFunction.localsByIndex.length);\r\n var scopedAlias = new Local(\r\n name,\r\n index,\r\n type,\r\n this.parentFunction\r\n );\r\n // not flagged as SCOPED as it must not be free'd when the flow is finalized\r\n this.scopedLocals.set(name, scopedAlias);\r\n return scopedAlias;\r\n }\r\n\r\n /** Frees this flow's scoped variables and returns its parent flow. */\r\n freeScopedLocals(): void {\r\n if (this.scopedLocals) {\r\n for (let scopedLocal of this.scopedLocals.values()) {\r\n if (scopedLocal.is(CommonFlags.SCOPED)) { // otherwise an alias\r\n this.freeTempLocal(scopedLocal);\r\n }\r\n }\r\n this.scopedLocals = null;\r\n }\r\n }\r\n\r\n /** Looks up the local of the specified name in the current scope. */\r\n lookupLocal(name: string): Local | null {\r\n var current: Flow | null = this;\r\n var scope: Map | null;\r\n do if ((scope = current.scopedLocals) && (scope.has(name))) return scope.get(name);\r\n while (current = current.parent);\r\n return this.parentFunction.localsByName.get(name);\r\n }\r\n\r\n /** Looks up the element with the specified name relative to the scope of this flow. */\r\n lookup(name: string): Element | null {\r\n var element = this.lookupLocal(name);\r\n if (element) return element;\r\n return this.actualFunction.lookup(name);\r\n }\r\n\r\n /** Tests if the value of the local at the specified index is considered wrapped. */\r\n isLocalWrapped(index: i32): bool {\r\n if (index < 0) return true; // inlined constant\r\n if (index < 64) return bitsetIs(this.wrappedLocals, index);\r\n var ext = this.wrappedLocalsExt;\r\n var i = ((index - 64) / 64) | 0;\r\n if (!(ext && i < ext.length)) return false;\r\n return bitsetIs(ext[i], index - (i + 1) * 64);\r\n }\r\n\r\n /** Sets if the value of the local at the specified index is considered wrapped. */\r\n setLocalWrapped(index: i32, wrapped: bool): void {\r\n if (index < 0) return; // inlined constant\r\n if (index < 64) {\r\n this.wrappedLocals = bitsetSet(this.wrappedLocals, index, wrapped);\r\n return;\r\n }\r\n var ext = this.wrappedLocalsExt;\r\n var i = ((index - 64) / 64) | 0;\r\n if (!ext) {\r\n this.wrappedLocalsExt = ext = new Array(i + 1);\r\n for (let j = 0; j <= i; ++j) ext[j] = i64_new(0);\r\n } else {\r\n while (ext.length <= i) ext.push(i64_new(0));\r\n }\r\n ext[i] = bitsetSet(ext[i], index - (i + 1) * 64, wrapped);\r\n }\r\n\r\n /** Pushes a new break label to the stack, for example when entering a loop that one can `break` from. */\r\n pushBreakLabel(): string {\r\n var parentFunction = this.parentFunction;\r\n var id = parentFunction.nextBreakId++;\r\n var stack = parentFunction.breakStack;\r\n if (!stack) parentFunction.breakStack = [ id ];\r\n else stack.push(id);\r\n return parentFunction.breakLabel = id.toString(10);\r\n }\r\n\r\n /** Pops the most recent break label from the stack. */\r\n popBreakLabel(): void {\r\n var parentFunction = this.parentFunction;\r\n var stack = assert(parentFunction.breakStack);\r\n var length = assert(stack.length);\r\n stack.pop();\r\n if (length > 1) {\r\n parentFunction.breakLabel = stack[length - 2].toString(10);\r\n } else {\r\n parentFunction.breakLabel = null;\r\n parentFunction.breakStack = null;\r\n }\r\n }\r\n\r\n /** Inherits flags and local wrap states from the specified flow (e.g. blocks). */\r\n inherit(other: Flow): void {\r\n this.flags |= other.flags & (FlowFlags.ANY_CATEGORICAL | FlowFlags.ANY_CONDITIONAL);\r\n this.wrappedLocals = other.wrappedLocals;\r\n this.wrappedLocalsExt = other.wrappedLocalsExt; // no need to slice because other flow is finished\r\n }\r\n\r\n /** Inherits categorical flags as conditional flags from the specified flow (e.g. then without else). */\r\n inheritConditional(other: Flow): void {\r\n if (other.is(FlowFlags.RETURNS)) {\r\n this.set(FlowFlags.CONDITIONALLY_RETURNS);\r\n }\r\n if (other.is(FlowFlags.THROWS)) {\r\n this.set(FlowFlags.CONDITIONALLY_THROWS);\r\n }\r\n if (other.is(FlowFlags.BREAKS) && other.breakLabel == this.breakLabel) {\r\n this.set(FlowFlags.CONDITIONALLY_BREAKS);\r\n }\r\n if (other.is(FlowFlags.CONTINUES) && other.continueLabel == this.continueLabel) {\r\n this.set(FlowFlags.CONDITIONALLY_CONTINUES);\r\n }\r\n if (other.is(FlowFlags.ALLOCATES)) {\r\n this.set(FlowFlags.CONDITIONALLY_ALLOCATES);\r\n }\r\n }\r\n\r\n /** Inherits mutual flags and local wrap states from the specified flows (e.g. then with else). */\r\n inheritMutual(left: Flow, right: Flow): void {\r\n // categorical flags set in both arms\r\n this.flags |= left.flags & right.flags & FlowFlags.ANY_CATEGORICAL;\r\n\r\n // conditional flags set in at least one arm\r\n this.flags |= left.flags & FlowFlags.ANY_CONDITIONAL;\r\n this.flags |= right.flags & FlowFlags.ANY_CONDITIONAL;\r\n\r\n // locals wrapped in both arms\r\n this.wrappedLocals = i64_and(left.wrappedLocals, right.wrappedLocals);\r\n var leftExt = left.wrappedLocalsExt;\r\n var rightExt = right.wrappedLocalsExt;\r\n if (leftExt != null && rightExt != null) {\r\n let thisExt = this.wrappedLocalsExt;\r\n let minLength = min(leftExt.length, rightExt.length);\r\n if (minLength) {\r\n if (!thisExt) thisExt = new Array(minLength);\r\n else while (thisExt.length < minLength) thisExt.push(i64_new(0));\r\n for (let i = 0; i < minLength; ++i) {\r\n thisExt[i] = i64_and(\r\n leftExt[i],\r\n rightExt[i]\r\n );\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Tests if an expression can possibly overflow in the context of this flow. Assumes that the\r\n * expression might already have overflown and returns `false` only if the operation neglects\r\n * any possible combination of garbage bits being present.\r\n */\r\n canOverflow(expr: ExpressionRef, type: Type): bool {\r\n // TODO: the following catches most common and a few uncommon cases, but there are additional\r\n // opportunities here, obviously.\r\n assert(type != Type.void);\r\n\r\n // types other than i8, u8, i16, u16 and bool do not overflow\r\n if (!type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) return false;\r\n\r\n var operand: ExpressionRef;\r\n switch (getExpressionId(expr)) {\r\n\r\n // overflows if the local isn't wrapped or the conversion does\r\n case ExpressionId.GetLocal: {\r\n let local = this.parentFunction.localsByIndex[getGetLocalIndex(expr)];\r\n return !this.isLocalWrapped(local.index)\r\n || canConversionOverflow(local.type, type);\r\n }\r\n\r\n // overflows if the value does\r\n case ExpressionId.SetLocal: { // tee\r\n assert(isTeeLocal(expr));\r\n return this.canOverflow(getSetLocalValue(expr), type);\r\n }\r\n\r\n // overflows if the conversion does (globals are wrapped on set)\r\n case ExpressionId.GetGlobal: {\r\n // TODO: this is inefficient because it has to read a string\r\n let global = assert(this.parentFunction.program.elementsByName.get(assert(getGetGlobalName(expr))));\r\n assert(global.kind == ElementKind.GLOBAL);\r\n return canConversionOverflow(assert((global).type), type);\r\n }\r\n\r\n case ExpressionId.Binary: {\r\n switch (getBinaryOp(expr)) {\r\n\r\n // comparisons do not overflow (result is 0 or 1)\r\n case BinaryOp.EqI32:\r\n case BinaryOp.EqI64:\r\n case BinaryOp.EqF32:\r\n case BinaryOp.EqF64:\r\n case BinaryOp.NeI32:\r\n case BinaryOp.NeI64:\r\n case BinaryOp.NeF32:\r\n case BinaryOp.NeF64:\r\n case BinaryOp.LtI32:\r\n case BinaryOp.LtU32:\r\n case BinaryOp.LtI64:\r\n case BinaryOp.LtU64:\r\n case BinaryOp.LtF32:\r\n case BinaryOp.LtF64:\r\n case BinaryOp.LeI32:\r\n case BinaryOp.LeU32:\r\n case BinaryOp.LeI64:\r\n case BinaryOp.LeU64:\r\n case BinaryOp.LeF32:\r\n case BinaryOp.LeF64:\r\n case BinaryOp.GtI32:\r\n case BinaryOp.GtU32:\r\n case BinaryOp.GtI64:\r\n case BinaryOp.GtU64:\r\n case BinaryOp.GtF32:\r\n case BinaryOp.GtF64:\r\n case BinaryOp.GeI32:\r\n case BinaryOp.GeU32:\r\n case BinaryOp.GeI64:\r\n case BinaryOp.GeU64:\r\n case BinaryOp.GeF32:\r\n case BinaryOp.GeF64: return false;\r\n\r\n // result won't overflow if one side is 0 or if one side is 1 and the other wrapped\r\n case BinaryOp.MulI32: {\r\n return !(\r\n (\r\n getExpressionId(operand = getBinaryLeft(expr)) == ExpressionId.Const &&\r\n (\r\n getConstValueI32(operand) == 0 ||\r\n (\r\n getConstValueI32(operand) == 1 &&\r\n !this.canOverflow(getBinaryRight(expr), type)\r\n )\r\n )\r\n ) || (\r\n getExpressionId(operand = getBinaryRight(expr)) == ExpressionId.Const &&\r\n (\r\n getConstValueI32(operand) == 0 ||\r\n (\r\n getConstValueI32(operand) == 1 &&\r\n !this.canOverflow(getBinaryLeft(expr), type)\r\n )\r\n )\r\n )\r\n );\r\n }\r\n\r\n // result won't overflow if one side is a constant less than this type's mask or one side\r\n // is wrapped\r\n case BinaryOp.AndI32: {\r\n // note that computeSmallIntegerMask returns the mask minus the MSB for signed types\r\n // because signed value garbage bits must be guaranteed to be equal to the MSB.\r\n return !(\r\n (\r\n (\r\n getExpressionId(operand = getBinaryLeft(expr)) == ExpressionId.Const &&\r\n getConstValueI32(operand) <= type.computeSmallIntegerMask(Type.i32)\r\n ) || !this.canOverflow(operand, type)\r\n ) || (\r\n (\r\n getExpressionId(operand = getBinaryRight(expr)) == ExpressionId.Const &&\r\n getConstValueI32(operand) <= type.computeSmallIntegerMask(Type.i32)\r\n ) || !this.canOverflow(operand, type)\r\n )\r\n );\r\n }\r\n\r\n // overflows if the shift doesn't clear potential garbage bits\r\n case BinaryOp.ShlI32: {\r\n let shift = 32 - type.size;\r\n return getExpressionId(operand = getBinaryRight(expr)) != ExpressionId.Const\r\n || getConstValueI32(operand) < shift;\r\n }\r\n\r\n // overflows if the value does and the shift doesn't clear potential garbage bits\r\n case BinaryOp.ShrI32: {\r\n let shift = 32 - type.size;\r\n return this.canOverflow(getBinaryLeft(expr), type) && (\r\n getExpressionId(operand = getBinaryRight(expr)) != ExpressionId.Const ||\r\n getConstValueI32(operand) < shift\r\n );\r\n }\r\n\r\n // overflows if the shift does not clear potential garbage bits. if an unsigned value is\r\n // wrapped, it can't overflow.\r\n case BinaryOp.ShrU32: {\r\n let shift = 32 - type.size;\r\n return type.is(TypeFlags.SIGNED)\r\n ? !(\r\n getExpressionId(operand = getBinaryRight(expr)) == ExpressionId.Const &&\r\n getConstValueI32(operand) > shift // must clear MSB\r\n )\r\n : this.canOverflow(getBinaryLeft(expr), type) && !(\r\n getExpressionId(operand = getBinaryRight(expr)) == ExpressionId.Const &&\r\n getConstValueI32(operand) >= shift // can leave MSB\r\n );\r\n }\r\n\r\n // overflows if any side does\r\n case BinaryOp.DivU32:\r\n case BinaryOp.RemI32:\r\n case BinaryOp.RemU32: {\r\n return this.canOverflow(getBinaryLeft(expr), type)\r\n || this.canOverflow(getBinaryRight(expr), type);\r\n }\r\n }\r\n break;\r\n }\r\n\r\n case ExpressionId.Unary: {\r\n switch (getUnaryOp(expr)) {\r\n\r\n // comparisons do not overflow (result is 0 or 1)\r\n case UnaryOp.EqzI32:\r\n case UnaryOp.EqzI64: return false;\r\n\r\n // overflow if the maximum result (32) cannot be represented in the target type\r\n case UnaryOp.ClzI32:\r\n case UnaryOp.CtzI32:\r\n case UnaryOp.PopcntI32: return type.size < 7;\r\n }\r\n break;\r\n }\r\n\r\n // overflows if the value cannot be represented in the target type\r\n case ExpressionId.Const: {\r\n let value: i32 = 0;\r\n switch (getExpressionType(expr)) {\r\n case NativeType.I32: { value = getConstValueI32(expr); break; }\r\n case NativeType.I64: { value = getConstValueI64Low(expr); break; } // discards upper bits\r\n case NativeType.F32: { value = i32(getConstValueF32(expr)); break; }\r\n case NativeType.F64: { value = i32(getConstValueF64(expr)); break; }\r\n default: assert(false);\r\n }\r\n switch (type.kind) {\r\n case TypeKind.I8: return value < i8.MIN_VALUE || value > i8.MAX_VALUE;\r\n case TypeKind.I16: return value < i16.MIN_VALUE || value > i16.MAX_VALUE;\r\n case TypeKind.U8: return value < 0 || value > u8.MAX_VALUE;\r\n case TypeKind.U16: return value < 0 || value > u16.MAX_VALUE;\r\n case TypeKind.BOOL: return (value & ~1) != 0;\r\n }\r\n break;\r\n }\r\n\r\n // overflows if the conversion does\r\n case ExpressionId.Load: {\r\n let fromType: Type;\r\n switch (getLoadBytes(expr)) {\r\n case 1: { fromType = isLoadSigned(expr) ? Type.i8 : Type.u8; break; }\r\n case 2: { fromType = isLoadSigned(expr) ? Type.i16 : Type.u16; break; }\r\n default: { fromType = isLoadSigned(expr) ? Type.i32 : Type.u32; break; }\r\n }\r\n return canConversionOverflow(fromType, type);\r\n }\r\n\r\n // overflows if the result does, which is either\r\n // - the last expression of the block, by contract, if the block doesn't have a label\r\n // - the last expression or the value of an inner br if the block has a label (TODO)\r\n case ExpressionId.Block: {\r\n if (!getBlockName(expr)) {\r\n let size = assert(getBlockChildCount(expr));\r\n let last = getBlockChild(expr, size - 1);\r\n return this.canOverflow(last, type);\r\n }\r\n break;\r\n }\r\n\r\n // overflows if either side does\r\n case ExpressionId.If: {\r\n return this.canOverflow(getIfTrue(expr), type)\r\n || this.canOverflow(assert(getIfFalse(expr)), type);\r\n }\r\n\r\n // overflows if either side does\r\n case ExpressionId.Select: {\r\n return this.canOverflow(getSelectThen(expr), type)\r\n || this.canOverflow(getSelectElse(expr), type);\r\n }\r\n\r\n // overflows if the call does not return a wrapped value or the conversion does\r\n case ExpressionId.Call: {\r\n let program = this.parentFunction.program;\r\n let instance = assert(program.instancesByName.get(assert(getCallTarget(expr))));\r\n assert(instance.kind == ElementKind.FUNCTION);\r\n let returnType = (instance).signature.returnType;\r\n return !(instance).flow.is(FlowFlags.RETURNS_WRAPPED)\r\n || canConversionOverflow(returnType, type);\r\n }\r\n\r\n // doesn't technically overflow\r\n case ExpressionId.Unreachable: return false;\r\n }\r\n return true;\r\n }\r\n}\r\n\r\n/** Tests if a conversion from one type to another can technically overflow. */\r\nfunction canConversionOverflow(fromType: Type, toType: Type): bool {\r\n return !fromType.is(TypeFlags.INTEGER) // non-i32 locals or returns\r\n || fromType.size > toType.size\r\n || fromType.is(TypeFlags.SIGNED) != toType.is(TypeFlags.SIGNED);\r\n}\r\n","/**\r\n * A decompiler that generates low-level AssemblyScript from WebAssembly binaries.\r\n * @module decompiler\r\n *//***/\r\n\r\nimport {\r\n Module,\r\n NativeType,\r\n ExpressionId,\r\n UnaryOp,\r\n BinaryOp,\r\n HostOp,\r\n FunctionRef,\r\n ExpressionRef,\r\n Index,\r\n getFunctionName,\r\n getFunctionBody,\r\n getFunctionParamCount,\r\n getFunctionParamType,\r\n getFunctionResultType,\r\n getExpressionId,\r\n getExpressionType,\r\n getBlockName,\r\n getBlockChildCount,\r\n getBlockChild,\r\n getIfCondition,\r\n getIfTrue,\r\n getIfFalse,\r\n getLoopName,\r\n getLoopBody,\r\n getBreakName,\r\n getBreakCondition,\r\n getGetLocalIndex,\r\n getSetLocalIndex,\r\n getSetLocalValue,\r\n getLoadOffset,\r\n getLoadPtr,\r\n getStoreOffset,\r\n getStorePtr,\r\n getStoreValue,\r\n getConstValueI32,\r\n getConstValueI64Low,\r\n getConstValueI64High,\r\n getConstValueF32,\r\n getConstValueF64,\r\n getUnaryOp,\r\n getUnaryValue,\r\n getBinaryOp,\r\n getBinaryLeft,\r\n getBinaryRight,\r\n getSelectThen,\r\n getSelectElse,\r\n getSelectCondition,\r\n getDropValue,\r\n getReturnValue,\r\n getHostOp,\r\n getHostOperand\r\n} from \"./module\";\r\n\r\n// TODO :-)\r\n\r\nexport class Decompiler {\r\n\r\n static decompile(module: Module): string {\r\n var decompiler = new Decompiler();\r\n decompiler.decompile(module);\r\n return decompiler.finish();\r\n }\r\n\r\n text: string[] = [];\r\n functionId: i32 = 0;\r\n\r\n constructor() { }\r\n\r\n /** Decompiles a module to an AST that can then be serialized. */\r\n decompile(module: Module): void {\r\n throw new Error(\"not implemented\");\r\n }\r\n\r\n decompileFunction(func: FunctionRef): void {\r\n var name = getFunctionName(func) || \"$\" + this.functionId.toString(10);\r\n var body = getFunctionBody(func);\r\n this.push(\"function \");\r\n this.push(name);\r\n this.push(\"(\");\r\n for (let i: Index = 0, k: Index = getFunctionParamCount(func); i < k; ++i) {\r\n if (i > 0) this.push(\", \");\r\n this.push(\"$\");\r\n this.push(i.toString(10));\r\n this.push(\": \");\r\n this.push(nativeTypeToType(getFunctionParamType(func, i)));\r\n }\r\n this.push(\"): \");\r\n this.push(nativeTypeToType(getFunctionResultType(func)));\r\n this.push(\" \");\r\n if (getExpressionId(body) != ExpressionId.Block) {\r\n this.push(\"{\\n\");\r\n }\r\n this.decompileExpression(body);\r\n if (getExpressionId(body) != ExpressionId.Block) {\r\n this.push(\"\\n}\\n\");\r\n }\r\n ++this.functionId;\r\n }\r\n\r\n decompileExpression(expr: ExpressionRef): void {\r\n var id = getExpressionId(expr);\r\n var type = getExpressionType(expr);\r\n\r\n var nested: ExpressionRef;\r\n var string: string | null;\r\n var i: Index, k: Index;\r\n\r\n switch (id) {\r\n case ExpressionId.Block: { // TODO: magic\r\n if ((string = getBlockName(expr)) != null) {\r\n this.push(string);\r\n this.push(\": \");\r\n }\r\n this.push(\"{\\n\");\r\n k = getBlockChildCount(expr);\r\n for (i = 0; i < k; ++i) {\r\n this.decompileExpression(getBlockChild(expr, i));\r\n }\r\n this.push(\"}\\n\");\r\n return;\r\n }\r\n case ExpressionId.If: {\r\n if (type == NativeType.None) {\r\n this.push(\"if (\");\r\n this.decompileExpression(getIfCondition(expr));\r\n this.push(\") \");\r\n this.decompileExpression(getIfTrue(expr));\r\n if (nested = getIfFalse(expr)) {\r\n this.push(\" else \");\r\n this.decompileExpression(nested);\r\n }\r\n } else {\r\n this.decompileExpression(getIfCondition(expr));\r\n this.push(\" ? \");\r\n this.decompileExpression(getIfTrue(expr));\r\n this.push(\" : \");\r\n this.decompileExpression(getIfFalse(expr));\r\n }\r\n return;\r\n }\r\n case ExpressionId.Loop: {\r\n if ((string = getLoopName(expr)) != null) {\r\n this.push(string);\r\n this.push(\": \");\r\n }\r\n this.push(\"do \");\r\n this.decompileExpression(getLoopBody(expr));\r\n this.push(\"while (0);\\n\");\r\n }\r\n case ExpressionId.Break: {\r\n if (nested = getBreakCondition(expr)) {\r\n this.push(\"if (\");\r\n this.decompileExpression(nested);\r\n this.push(\") \");\r\n }\r\n if ((string = getBreakName(expr)) != null) {\r\n this.push(\"break \");\r\n this.push(string);\r\n this.push(\";\\n\");\r\n } else {\r\n this.push(\"break;\\n\");\r\n }\r\n return;\r\n }\r\n case ExpressionId.Switch:\r\n case ExpressionId.Call:\r\n case ExpressionId.CallIndirect: {\r\n throw new Error(\"not implemented\");\r\n }\r\n case ExpressionId.GetLocal: {\r\n this.push(\"$\");\r\n this.push(getGetLocalIndex(expr).toString(10));\r\n return;\r\n }\r\n case ExpressionId.SetLocal: {\r\n this.push(\"$\");\r\n this.push(getSetLocalIndex(expr).toString(10));\r\n this.push(\" = \");\r\n this.decompileExpression(getSetLocalValue(expr));\r\n return;\r\n }\r\n case ExpressionId.GetGlobal:\r\n case ExpressionId.SetGlobal: {\r\n throw new Error(\"not implemented\");\r\n }\r\n case ExpressionId.Load: {\r\n this.push(\"load<\");\r\n this.push(nativeTypeToType(type));\r\n this.push(\">(\");\r\n this.push(getLoadOffset(expr).toString(10));\r\n this.push(\" + \");\r\n this.decompileExpression(getLoadPtr(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case ExpressionId.Store: {\r\n this.push(\"store<\");\r\n this.push(nativeTypeToType(type));\r\n this.push(\">(\");\r\n this.push(getStoreOffset(expr).toString(10));\r\n this.push(\" + \");\r\n this.decompileExpression(getStorePtr(expr));\r\n this.push(\", \");\r\n this.decompileExpression(getStoreValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case ExpressionId.Const: {\r\n switch (type) {\r\n case NativeType.I32: {\r\n this.push(getConstValueI32(expr).toString(10));\r\n return;\r\n }\r\n case NativeType.I64: {\r\n this.push(\r\n i64_to_string(\r\n i64_new(\r\n getConstValueI64Low(expr),\r\n getConstValueI64High(expr)\r\n )\r\n )\r\n );\r\n return;\r\n }\r\n case NativeType.F32: {\r\n this.push(getConstValueF32(expr).toString(10));\r\n return;\r\n }\r\n case NativeType.F64: {\r\n this.push(getConstValueF64(expr).toString(10));\r\n return;\r\n }\r\n }\r\n break;\r\n }\r\n case ExpressionId.Unary: {\r\n switch (getUnaryOp(expr)) {\r\n case UnaryOp.ClzI32: {\r\n this.push(\"clz(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.CtzI32: {\r\n this.push(\"ctz(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.PopcntI32: {\r\n this.push(\"popcnt(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.NegF32:\r\n case UnaryOp.NegF64: {\r\n this.push(\"-\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.AbsF32: {\r\n this.push(\"abs(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.CeilF32: {\r\n this.push(\"ceil(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.FloorF32: {\r\n this.push(\"floor(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.TruncF32: {\r\n this.push(\"trunc(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.NearestF32: {\r\n this.push(\"nearest(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.SqrtF32: {\r\n this.push(\"sqrt(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.EqzI32:\r\n case UnaryOp.EqzI64: {\r\n this.push(\"!\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.ClzI64: {\r\n this.push(\"clz(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.CtzI64: {\r\n this.push(\"ctz(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.PopcntI64: {\r\n this.push(\"popcnt(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.AbsF64: {\r\n this.push(\"abs(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.CeilF64: {\r\n this.push(\"ceil(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.FloorF64: {\r\n this.push(\"floor(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.TruncF64: {\r\n this.push(\"trunc(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.NearestF64: {\r\n this.push(\"nearest(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.SqrtF64: {\r\n this.push(\"sqrt(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.ExtendI32: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.ExtendU32: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.WrapI64: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.TruncF32ToI32: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.TruncF32ToI64: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.TruncF32ToU32: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.TruncF32ToU64: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.TruncF64ToI32: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.TruncF64ToI64: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.TruncF64ToU32: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.TruncF64ToU64: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.ReinterpretF32: {\r\n this.push(\"reinterpret(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.ReinterpretF64: {\r\n this.push(\"reinterpret(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.ConvertI32ToF32: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.ConvertI32ToF64: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.ConvertU32ToF32: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.ConvertU32ToF64: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.ConvertI64ToF32: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.ConvertI64ToF64: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.ConvertU64ToF32: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.ConvertU64ToF64: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.PromoteF32: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.DemoteF64: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.ReinterpretI32: {\r\n this.push(\"reinterpret(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.ReinterpretI64: {\r\n this.push(\"reinterpret(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n }\r\n break;\r\n }\r\n case ExpressionId.Binary: { // TODO: precedence\r\n switch (getBinaryOp(expr)) {\r\n case BinaryOp.AddI32:\r\n case BinaryOp.AddI64:\r\n case BinaryOp.AddF32:\r\n case BinaryOp.AddF64: {\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" + \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.SubI32:\r\n case BinaryOp.SubI64:\r\n case BinaryOp.SubF32:\r\n case BinaryOp.SubF64: {\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" - \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.MulI32:\r\n case BinaryOp.MulI64:\r\n case BinaryOp.MulF32:\r\n case BinaryOp.MulF64: {\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" * \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.DivI32:\r\n case BinaryOp.DivI64:\r\n case BinaryOp.DivF32:\r\n case BinaryOp.DivF64: {\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" / \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.DivU32: {\r\n this.push(\"(\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" / \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case BinaryOp.RemI32:\r\n case BinaryOp.RemI64: {\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" % \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.RemU32: {\r\n this.push(\"(\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" / \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case BinaryOp.AndI32:\r\n case BinaryOp.AndI64: {\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" & \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.OrI32:\r\n case BinaryOp.OrI64: {\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" | \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.XorI32:\r\n case BinaryOp.XorI64: {\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" ^ \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.ShlI32:\r\n case BinaryOp.ShlI64: {\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" << \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.ShrU32:\r\n case BinaryOp.ShrU64: {\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" >>> \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.ShrI32:\r\n case BinaryOp.ShrI64: {\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" >> \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.RotlI32: {\r\n this.push(\"rotl(\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\", \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case BinaryOp.RotrI32: {\r\n this.push(\"rotr(\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\", \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case BinaryOp.EqI32:\r\n case BinaryOp.EqI64:\r\n case BinaryOp.EqF32:\r\n case BinaryOp.EqF64: {\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" == \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.NeI32:\r\n case BinaryOp.NeI64:\r\n case BinaryOp.NeF32:\r\n case BinaryOp.NeF64: {\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" != \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.LtI32:\r\n case BinaryOp.LtI64:\r\n case BinaryOp.LtF32:\r\n case BinaryOp.LtF64: {\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" < \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.LtU32: {\r\n this.push(\"\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" < \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.LeI32:\r\n case BinaryOp.LeI64:\r\n case BinaryOp.LeF32:\r\n case BinaryOp.LeF64: {\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" <= \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.LeU32: {\r\n this.push(\"\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" <= \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.GtI32:\r\n case BinaryOp.GtI64:\r\n case BinaryOp.GtF32:\r\n case BinaryOp.GtF64: {\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" > \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.GtU32: {\r\n this.push(\"\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" > \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.GeI32:\r\n case BinaryOp.GeI64:\r\n case BinaryOp.GeF32:\r\n case BinaryOp.GeF64: {\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" >= \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.GeU32: {\r\n this.push(\"\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" >= \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.DivU64: {\r\n this.push(\"\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" / \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.RemU64: {\r\n this.push(\"\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" % \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.RotlI64: {\r\n this.push(\"rotl(\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\", \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case BinaryOp.RotrI64: {\r\n this.push(\"rotr(\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\", \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case BinaryOp.LtU64: {\r\n this.push(\"\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" < \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.LeU64: {\r\n this.push(\"\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" <= \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.GtU64: {\r\n this.push(\"\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" > \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.GeU64: {\r\n this.push(\"\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" >= \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.CopysignF32: {\r\n this.push(\"copysign(\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\", \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case BinaryOp.MinF32: {\r\n this.push(\"min(\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\", \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case BinaryOp.MaxF32: {\r\n this.push(\"max(\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\", \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case BinaryOp.CopysignF64: {\r\n this.push(\"copysign(\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\", \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case BinaryOp.MinF64: {\r\n this.push(\"min(\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\", \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case BinaryOp.MaxF64: {\r\n this.push(\"max(\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\", \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n }\r\n return;\r\n }\r\n case ExpressionId.Select: {\r\n this.push(\"select<\");\r\n this.push(nativeTypeToType(type));\r\n this.push(\">(\");\r\n this.decompileExpression(getSelectThen(expr));\r\n this.push(\", \");\r\n this.decompileExpression(getSelectElse(expr));\r\n this.push(\", \");\r\n this.decompileExpression(getSelectCondition(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case ExpressionId.Drop: {\r\n this.decompileExpression(getDropValue(expr));\r\n this.push(\";\\n\");\r\n return;\r\n }\r\n case ExpressionId.Return: {\r\n if (nested = getReturnValue(expr)) {\r\n this.push(\"return \");\r\n this.decompileExpression(nested);\r\n this.push(\";\\n\");\r\n } else {\r\n this.push(\"return;\\n\");\r\n }\r\n return;\r\n }\r\n case ExpressionId.Host: {\r\n switch (getHostOp(expr)) {\r\n case HostOp.CurrentMemory: {\r\n this.push(\"memory.size()\");\r\n return;\r\n }\r\n case HostOp.GrowMemory: {\r\n this.push(\"memory.grow(\");\r\n this.decompileExpression(getHostOperand(expr, 0));\r\n this.push(\")\");\r\n return;\r\n }\r\n }\r\n break;\r\n }\r\n case ExpressionId.Nop: {\r\n this.push(\";\\n\");\r\n return;\r\n }\r\n case ExpressionId.Unreachable: {\r\n this.push(\"unreachable()\");\r\n return;\r\n }\r\n case ExpressionId.AtomicCmpxchg:\r\n case ExpressionId.AtomicRMW:\r\n case ExpressionId.AtomicWait:\r\n case ExpressionId.AtomicNotify:\r\n }\r\n throw new Error(\"not implemented\");\r\n }\r\n\r\n private push(text: string): void {\r\n // mostly here so we can add debugging if necessary\r\n this.text.push(text);\r\n }\r\n\r\n finish(): string {\r\n var ret = this.text.join(\"\");\r\n this.text = [];\r\n return ret;\r\n }\r\n}\r\n\r\nfunction nativeTypeToType(type: NativeType): string {\r\n switch (type) {\r\n case NativeType.None: return \"void\";\r\n case NativeType.I32: return \"i32\";\r\n case NativeType.I64: return \"i64\";\r\n case NativeType.F32: return \"f32\";\r\n case NativeType.F64: return \"f64\";\r\n case NativeType.V128: return \"v128\";\r\n case NativeType.Unreachable: throw new Error(\"unreachable type\");\r\n case NativeType.Auto: throw new Error(\"auto type\");\r\n default: throw new Error(\"unexpected type\");\r\n }\r\n}\r\n","/**\r\n * Definition builders for WebIDL and TypeScript.\r\n * @module definitions\r\n *//***/\r\n\r\nimport {\r\n CommonFlags\r\n} from \"./common\";\r\n\r\nimport {\r\n Program,\r\n Element,\r\n ElementKind,\r\n Global,\r\n Enum,\r\n EnumValue,\r\n Field,\r\n Function,\r\n FunctionPrototype,\r\n Class,\r\n ClassPrototype,\r\n Namespace,\r\n ConstantValueKind,\r\n Interface,\r\n Property,\r\n PropertyPrototype\r\n} from \"./program\";\r\n\r\nimport {\r\n Type,\r\n TypeKind\r\n} from \"./types\";\r\n\r\nimport {\r\n indent\r\n} from \"./util\";\r\n\r\n/** Walker base class. */\r\nabstract class ExportsWalker {\r\n\r\n /** Program reference. */\r\n program: Program;\r\n /** Whether to include private members */\r\n includePrivate: bool;\r\n /** Elements still to do. */\r\n todo: Element[] = [];\r\n /** Already seen elements. */\r\n seen: Set = new Set();\r\n\r\n /** Constructs a new Element walker. */\r\n constructor(program: Program, includePrivate: bool = false) {\r\n this.program = program;\r\n this.includePrivate;\r\n }\r\n\r\n /** Walks all elements and calls the respective handlers. */\r\n walk(): void {\r\n for (let file of this.program.filesByName.values()) {\r\n let members = file.members;\r\n if (!members) continue;\r\n for (let member of members.values()) {\r\n // FIXME: doesn't honor the actual externally visible name\r\n this.visitElement(member);\r\n }\r\n }\r\n var todo = this.todo;\r\n for (let i = 0; i < todo.length; ) this.visitElement(todo[i]);\r\n }\r\n\r\n /** Visits an element.*/\r\n visitElement(element: Element): void {\r\n if (element.is(CommonFlags.PRIVATE) && !this.includePrivate) return;\r\n if (this.seen.has(element)) return;\r\n this.seen.add(element);\r\n switch (element.kind) {\r\n case ElementKind.GLOBAL: {\r\n if (element.is(CommonFlags.COMPILED)) this.visitGlobal(element);\r\n break;\r\n }\r\n case ElementKind.ENUM: {\r\n if (element.is(CommonFlags.COMPILED)) this.visitEnum(element);\r\n break;\r\n }\r\n case ElementKind.FUNCTION_PROTOTYPE: {\r\n this.visitFunctionInstances(element);\r\n break;\r\n }\r\n case ElementKind.CLASS_PROTOTYPE: {\r\n this.visitClassInstances(element);\r\n break;\r\n }\r\n case ElementKind.FIELD: {\r\n if ((element).is(CommonFlags.COMPILED)) this.visitField(element);\r\n break;\r\n }\r\n case ElementKind.PROPERTY_PROTOTYPE: {\r\n this.visitPropertyInstances(element);\r\n break;\r\n }\r\n case ElementKind.PROPERTY: {\r\n let prop = element;\r\n let getter = prop.getterInstance;\r\n if (getter) this.visitFunction(getter);\r\n let setter = prop.setterInstance;\r\n if (setter) this.visitFunction(setter);\r\n break;\r\n }\r\n case ElementKind.NAMESPACE: {\r\n if (hasCompiledMember(element)) this.visitNamespace(element);\r\n break;\r\n }\r\n case ElementKind.TYPEDEFINITION: break;\r\n default: assert(false);\r\n }\r\n }\r\n\r\n private visitFunctionInstances(element: FunctionPrototype): void {\r\n var instances = element.instances;\r\n if (instances) {\r\n for (let instance of instances.values()) {\r\n if (instance.is(CommonFlags.COMPILED)) this.visitFunction(instance);\r\n }\r\n }\r\n }\r\n\r\n private visitClassInstances(element: ClassPrototype): void {\r\n var instances = element.instances;\r\n if (instances) {\r\n for (let instance of instances.values()) {\r\n if (instance.is(CommonFlags.COMPILED)) this.visitClass(instance);\r\n }\r\n }\r\n }\r\n\r\n private visitPropertyInstances(element: PropertyPrototype): void {\r\n // var instances = element.instances;\r\n // if (instances) {\r\n // for (let instance of instances.values()) {\r\n // if (instance.is(CommonFlags.COMPILED)) this.visitProperty(instance);\r\n // }\r\n // }\r\n assert(false);\r\n }\r\n\r\n abstract visitGlobal(element: Global): void;\r\n abstract visitEnum(element: Enum): void;\r\n abstract visitFunction(element: Function): void;\r\n abstract visitClass(element: Class): void;\r\n abstract visitInterface(element: Interface): void;\r\n abstract visitField(element: Field): void;\r\n abstract visitNamespace(element: Element): void;\r\n}\r\n\r\n/** A WebIDL definitions builder. */\r\nexport class IDLBuilder extends ExportsWalker {\r\n\r\n /** Builds WebIDL definitions for the specified program. */\r\n static build(program: Program): string {\r\n return new IDLBuilder(program).build();\r\n }\r\n\r\n private sb: string[] = [];\r\n private indentLevel: i32 = 0;\r\n\r\n /** Constructs a new WebIDL builder. */\r\n constructor(program: Program, includePrivate: bool = false) {\r\n super(program, includePrivate);\r\n }\r\n\r\n visitGlobal(element: Global): void {\r\n var sb = this.sb;\r\n var isConst = element.is(CommonFlags.INLINED);\r\n indent(sb, this.indentLevel);\r\n if (isConst) sb.push(\"const \");\r\n sb.push(this.typeToString(element.type));\r\n sb.push(\" \");\r\n sb.push(element.name);\r\n if (isConst) {\r\n switch (element.constantValueKind) {\r\n case ConstantValueKind.INTEGER: {\r\n sb.push(\" = \");\r\n sb.push(i64_to_string(element.constantIntegerValue));\r\n break;\r\n }\r\n case ConstantValueKind.FLOAT: {\r\n sb.push(\" = \");\r\n sb.push(element.constantFloatValue.toString());\r\n break;\r\n }\r\n default: assert(false);\r\n }\r\n }\r\n sb.push(\";\\n\");\r\n }\r\n\r\n visitEnum(element: Enum): void {\r\n var sb = this.sb;\r\n indent(sb, this.indentLevel++);\r\n sb.push(\"interface \");\r\n sb.push(element.name);\r\n sb.push(\" {\\n\");\r\n var members = element.members;\r\n if (members) {\r\n for (let [name, member] of members) {\r\n if (member.kind == ElementKind.ENUMVALUE) {\r\n let isConst = (member).is(CommonFlags.INLINED);\r\n indent(sb, this.indentLevel);\r\n if (isConst) sb.push(\"const \");\r\n else sb.push(\"readonly \");\r\n sb.push(\"unsigned long \");\r\n sb.push(name);\r\n if (isConst) {\r\n sb.push(\" = \");\r\n assert((member).constantValueKind == ConstantValueKind.INTEGER);\r\n sb.push(i64_low((member).constantIntegerValue).toString(10));\r\n }\r\n sb.push(\";\\n\");\r\n }\r\n }\r\n for (let member of members.values()) {\r\n if (member.kind != ElementKind.ENUMVALUE) this.visitElement(member);\r\n }\r\n }\r\n indent(sb, --this.indentLevel);\r\n sb.push(\"}\\n\");\r\n }\r\n\r\n visitFunction(element: Function): void {\r\n var sb = this.sb;\r\n var signature = element.signature;\r\n indent(sb, this.indentLevel);\r\n sb.push(this.typeToString(signature.returnType));\r\n sb.push(\" \");\r\n sb.push(element.name);\r\n sb.push(\"(\");\r\n var parameters = signature.parameterTypes;\r\n var numParameters = parameters.length;\r\n // var requiredParameters = signature.requiredParameters;\r\n for (let i = 0; i < numParameters; ++i) {\r\n if (i) sb.push(\", \");\r\n // if (i >= requiredParameters) sb.push(\"optional \");\r\n sb.push(this.typeToString(parameters[i]));\r\n sb.push(\" \");\r\n sb.push(signature.getParameterName(i));\r\n }\r\n sb.push(\");\\n\");\r\n var members = element.members;\r\n if (members && members.size) {\r\n indent(sb, this.indentLevel);\r\n sb.push(\"interface \");\r\n sb.push(element.name);\r\n sb.push(\" {\\n\");\r\n for (let member of members.values()) this.visitElement(member);\r\n indent(sb, --this.indentLevel);\r\n sb.push(\"}\\n\");\r\n }\r\n }\r\n\r\n visitClass(element: Class): void {\r\n var sb = this.sb;\r\n indent(sb, this.indentLevel++);\r\n sb.push(\"interface \");\r\n sb.push(element.name);\r\n sb.push(\" {\\n\");\r\n // TODO\r\n indent(sb, --this.indentLevel);\r\n sb.push(\"}\\n\");\r\n }\r\n\r\n visitInterface(element: Interface): void {\r\n this.visitClass(element);\r\n }\r\n\r\n visitField(element: Field): void {\r\n // TODO\r\n }\r\n\r\n visitNamespace(element: Namespace): void {\r\n var sb = this.sb;\r\n indent(sb, this.indentLevel++);\r\n sb.push(\"interface \");\r\n sb.push(element.name);\r\n sb.push(\" {\\n\");\r\n var members = element.members;\r\n if (members) {\r\n for (let member of members.values()) this.visitElement(member);\r\n }\r\n indent(sb, --this.indentLevel);\r\n sb.push(\"}\\n\");\r\n }\r\n\r\n typeToString(type: Type): string {\r\n switch (type.kind) {\r\n case TypeKind.I8: return \"byte\";\r\n case TypeKind.I16: return \"short\";\r\n case TypeKind.I32: return \"long\";\r\n case TypeKind.I64: return \"long long\";\r\n case TypeKind.ISIZE: return this.program.options.isWasm64 ? \"long long\" : \"long\";\r\n case TypeKind.U8: return \"octet\";\r\n case TypeKind.U16: return \"unsigned short\";\r\n case TypeKind.U32: return \"unsigned long\";\r\n // ^ TODO: function types\r\n case TypeKind.U64: return \"unsigned long long\";\r\n case TypeKind.USIZE: return this.program.options.isWasm64 ? \"unsigned long long\" : \"unsigned long\";\r\n // ^ TODO: class types\r\n case TypeKind.BOOL: return \"boolean\";\r\n case TypeKind.F32: return \"unrestricted float\";\r\n case TypeKind.F64: return \"unrestricted double\";\r\n case TypeKind.VOID: return \"void\";\r\n default: {\r\n assert(false);\r\n return \"\";\r\n }\r\n }\r\n }\r\n\r\n build(): string {\r\n var sb = this.sb;\r\n sb.push(\"interface ASModule {\\n\");\r\n ++this.indentLevel;\r\n this.walk();\r\n --this.indentLevel;\r\n sb.push(\"}\\n\");\r\n return sb.join(\"\");\r\n }\r\n}\r\n\r\n/** A TypeScript definitions builder. */\r\nexport class TSDBuilder extends ExportsWalker {\r\n\r\n /** Builds TypeScript definitions for the specified program. */\r\n static build(program: Program): string {\r\n return new TSDBuilder(program).build();\r\n }\r\n\r\n private sb: string[] = [];\r\n private indentLevel: i32 = 0;\r\n\r\n /** Constructs a new WebIDL builder. */\r\n constructor(program: Program, includePrivate: bool = false) {\r\n super(program, includePrivate);\r\n }\r\n\r\n visitGlobal(element: Global): void {\r\n var sb = this.sb;\r\n var isConst = element.is(CommonFlags.INLINED);\r\n indent(sb, this.indentLevel);\r\n if (element.is(CommonFlags.STATIC)) {\r\n if (isConst) sb.push(\"static readonly \");\r\n else sb.push(\"static \");\r\n } else {\r\n if (isConst) sb.push(\"const \");\r\n else sb.push(\"var \");\r\n }\r\n sb.push(element.name);\r\n sb.push(\": \");\r\n sb.push(this.typeToString(element.type));\r\n sb.push(\";\\n\");\r\n this.visitNamespace(element);\r\n }\r\n\r\n visitEnum(element: Enum): void {\r\n var sb = this.sb;\r\n indent(sb, this.indentLevel++);\r\n sb.push(\"enum \");\r\n sb.push(element.name);\r\n sb.push(\" {\\n\");\r\n var members = element.members;\r\n if (members) {\r\n let numMembers = members.size;\r\n for (let [name, member] of members) {\r\n if (member.kind == ElementKind.ENUMVALUE) {\r\n indent(sb, this.indentLevel);\r\n sb.push(name);\r\n if (member.is(CommonFlags.INLINED)) {\r\n sb.push(\" = \");\r\n assert((member).constantValueKind == ConstantValueKind.INTEGER);\r\n sb.push(i64_low((member).constantIntegerValue).toString(10));\r\n }\r\n sb.push(\",\\n\");\r\n --numMembers;\r\n }\r\n }\r\n if (numMembers) this.visitNamespace(element);\r\n }\r\n indent(sb, --this.indentLevel);\r\n sb.push(\"}\\n\");\r\n }\r\n\r\n visitFunction(element: Function): void {\r\n if (element.isAny(CommonFlags.PRIVATE | CommonFlags.SET)) return;\r\n var sb = this.sb;\r\n var signature = element.signature;\r\n indent(sb, this.indentLevel);\r\n if (element.is(CommonFlags.PROTECTED)) sb.push(\"protected \");\r\n if (element.is(CommonFlags.STATIC)) sb.push(\"static \");\r\n if (element.is(CommonFlags.GET)) {\r\n sb.push(element.identifierNode.text); // 'get:funcName' internally\r\n sb.push(\": \");\r\n sb.push(this.typeToString(signature.returnType));\r\n sb.push(\";\\n\");\r\n return;\r\n } else {\r\n if (!element.isAny(CommonFlags.STATIC | CommonFlags.INSTANCE)) sb.push(\"function \");\r\n sb.push(element.name);\r\n }\r\n sb.push(\"(\");\r\n var parameters = signature.parameterTypes;\r\n var numParameters = parameters.length;\r\n // var requiredParameters = signature.requiredParameters;\r\n for (let i = 0; i < numParameters; ++i) {\r\n if (i) sb.push(\", \");\r\n // if (i >= requiredParameters) sb.push(\"optional \");\r\n sb.push(signature.getParameterName(i));\r\n sb.push(\": \");\r\n sb.push(this.typeToString(parameters[i]));\r\n }\r\n if (element.isAny(CommonFlags.CONSTRUCTOR | CommonFlags.SET)) {\r\n sb.push(\")\");\r\n } else {\r\n sb.push(\"): \");\r\n sb.push(this.typeToString(signature.returnType));\r\n }\r\n sb.push(\";\\n\");\r\n this.visitNamespace(element);\r\n }\r\n\r\n visitClass(element: Class): void {\r\n var sb = this.sb;\r\n var isInterface = element.kind == ElementKind.INTERFACE;\r\n indent(sb, this.indentLevel++);\r\n if (isInterface) {\r\n sb.push(\"interface \");\r\n } else {\r\n if (element.is(CommonFlags.ABSTRACT)) sb.push(\"abstract \");\r\n sb.push(\"class \");\r\n }\r\n sb.push(element.name);\r\n var base = element.base;\r\n if (base && base.is(CommonFlags.COMPILED | CommonFlags.MODULE_EXPORT)) {\r\n sb.push(\" extends \");\r\n sb.push(base.name); // TODO: fqn\r\n }\r\n sb.push(\" {\\n\");\r\n var members = element.parent.members; // static\r\n if (members) {\r\n for (let member of members.values()) {\r\n this.visitElement(member);\r\n }\r\n }\r\n var ctor = element.constructorInstance;\r\n if (ctor) this.visitFunction(ctor);\r\n members = element.members; // instance\r\n if (members) {\r\n for (let member of members.values()) this.visitElement(member);\r\n }\r\n indent(sb, --this.indentLevel);\r\n sb.push(\"}\\n\");\r\n }\r\n\r\n visitInterface(element: Interface): void {\r\n this.visitClass(element);\r\n }\r\n\r\n visitField(element: Field): void {\r\n if (element.is(CommonFlags.PRIVATE)) return;\r\n var sb = this.sb;\r\n indent(sb, this.indentLevel);\r\n if (element.is(CommonFlags.PROTECTED)) sb.push(\"protected \");\r\n if (element.is(CommonFlags.STATIC)) sb.push(\"static \");\r\n if (element.is(CommonFlags.READONLY)) sb.push(\"readonly \");\r\n sb.push(element.name);\r\n sb.push(\": \");\r\n sb.push(this.typeToString(element.type));\r\n sb.push(\";\\n\");\r\n }\r\n\r\n visitNamespace(element: Element): void {\r\n var members = element.members;\r\n if (members && members.size) {\r\n let sb = this.sb;\r\n indent(sb, this.indentLevel++);\r\n sb.push(\"namespace \");\r\n sb.push(element.name);\r\n sb.push(\" {\\n\");\r\n for (let member of members.values()) this.visitElement(member);\r\n indent(sb, --this.indentLevel);\r\n sb.push(\"}\\n\");\r\n }\r\n }\r\n\r\n typeToString(type: Type): string {\r\n switch (type.kind) {\r\n case TypeKind.I8: return \"i8\";\r\n case TypeKind.I16: return \"i16\";\r\n case TypeKind.I32: return \"i32\";\r\n case TypeKind.I64: return \"I64\";\r\n case TypeKind.ISIZE: return this.program.options.isWasm64 ? \"I64\" : \"i32\";\r\n case TypeKind.U8: return \"u8\";\r\n case TypeKind.U16: return \"u16\";\r\n case TypeKind.U32: return \"u32\";\r\n // ^ TODO: function types\r\n case TypeKind.U64: return \"U64\";\r\n case TypeKind.USIZE: return this.program.options.isWasm64 ? \"U64\" : \"u32\";\r\n // ^ TODO: class types\r\n case TypeKind.BOOL: return \"bool\";\r\n case TypeKind.F32: return \"f32\";\r\n case TypeKind.F64: return \"f64\";\r\n case TypeKind.V128: return \"v128\";\r\n case TypeKind.VOID: return \"void\";\r\n default: {\r\n assert(false);\r\n return \"\";\r\n }\r\n }\r\n }\r\n\r\n build(): string {\r\n var sb = this.sb;\r\n sb.push(\"declare module ASModule {\\n\");\r\n sb.push(\" type i8 = number;\\n\");\r\n sb.push(\" type i16 = number;\\n\");\r\n sb.push(\" type i32 = number;\\n\");\r\n sb.push(\" type u8 = number;\\n\");\r\n sb.push(\" type u16 = number;\\n\");\r\n sb.push(\" type u32 = number;\\n\");\r\n sb.push(\" type f32 = number;\\n\");\r\n sb.push(\" type f64 = number;\\n\");\r\n sb.push(\" type bool = any;\\n\");\r\n ++this.indentLevel;\r\n this.walk();\r\n --this.indentLevel;\r\n sb.push(\"}\\n\");\r\n sb.push(\"export default ASModule;\\n\");\r\n return this.sb.join(\"\");\r\n }\r\n}\r\n\r\n// helpers\r\n\r\n/** Tests if a namespace-like element has at least one compiled member. */\r\nfunction hasCompiledMember(element: Element): bool {\r\n var members = element.members;\r\n if (members) {\r\n for (let member of members.values()) {\r\n switch (member.kind) {\r\n case ElementKind.FUNCTION_PROTOTYPE: {\r\n let instances = (member).instances;\r\n if (instances) {\r\n for (let instance of instances.values()) {\r\n if (instance.is(CommonFlags.COMPILED)) return true;\r\n }\r\n }\r\n break;\r\n }\r\n case ElementKind.CLASS_PROTOTYPE: {\r\n let instances = (member).instances;\r\n if (instances) {\r\n for (let instance of instances.values()) {\r\n if (instance.is(CommonFlags.COMPILED)) return true;\r\n }\r\n }\r\n break;\r\n }\r\n default: {\r\n if (member.is(CommonFlags.COMPILED) || hasCompiledMember(member)) return true;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n return false;\r\n}\r\n","/**\r\n * A TypeScript parser for the AssemblyScript subset.\r\n * @module parser\r\n *//***/\r\n\r\nimport {\r\n CommonFlags,\r\n LIBRARY_PREFIX,\r\n PATH_DELIMITER\r\n} from \"./common\";\r\n\r\nimport {\r\n Program\r\n} from \"./program\";\r\n\r\nimport {\r\n Tokenizer,\r\n Token,\r\n Range,\r\n CommentHandler,\r\n IdentifierHandling\r\n} from \"./tokenizer\";\r\n\r\nimport {\r\n DiagnosticCode,\r\n DiagnosticEmitter\r\n} from \"./diagnostics\";\r\n\r\nimport {\r\n normalizePath\r\n} from \"./util\";\r\n\r\nimport {\r\n Node,\r\n NodeKind,\r\n Source,\r\n SourceKind,\r\n CommonTypeNode,\r\n TypeNode,\r\n SignatureNode,\r\n ArrowKind,\r\n\r\n Expression,\r\n AssertionKind,\r\n CallExpression,\r\n ClassExpression,\r\n FunctionExpression,\r\n IdentifierExpression,\r\n StringLiteralExpression,\r\n\r\n Statement,\r\n BlockStatement,\r\n BreakStatement,\r\n ClassDeclaration,\r\n ContinueStatement,\r\n DeclarationStatement,\r\n DecoratorNode,\r\n DoStatement,\r\n EnumDeclaration,\r\n EnumValueDeclaration,\r\n ExportImportStatement,\r\n ExportMember,\r\n ExportStatement,\r\n ExpressionStatement,\r\n ForStatement,\r\n FunctionDeclaration,\r\n IfStatement,\r\n ImportDeclaration,\r\n ImportStatement,\r\n IndexSignatureDeclaration,\r\n NamespaceDeclaration,\r\n ParameterNode,\r\n ParameterKind,\r\n ReturnStatement,\r\n SwitchCase,\r\n SwitchStatement,\r\n ThrowStatement,\r\n TryStatement,\r\n TypeDeclaration,\r\n TypeParameterNode,\r\n VariableStatement,\r\n VariableDeclaration,\r\n VoidStatement,\r\n WhileStatement,\r\n\r\n mangleInternalPath,\r\n nodeIsCallable,\r\n nodeIsGenericCallable\r\n} from \"./ast\";\r\n\r\n/** Parser interface. */\r\nexport class Parser extends DiagnosticEmitter {\r\n\r\n /** Program being created. */\r\n program: Program;\r\n /** Source file names to be requested next. */\r\n backlog: string[] = new Array();\r\n /** Source file names already seen, that is processed or backlogged. */\r\n seenlog: Set = new Set();\r\n /** Source file names already completely processed. */\r\n donelog: Set = new Set();\r\n /** Optional handler to intercept comments while tokenizing. */\r\n onComment: CommentHandler | null = null;\r\n\r\n /** Constructs a new parser. */\r\n constructor() {\r\n super();\r\n this.program = new Program(this.diagnostics);\r\n }\r\n\r\n /** Parses a file and adds its definitions to the program. */\r\n parseFile(\r\n text: string,\r\n path: string,\r\n isEntry: bool\r\n ): void {\r\n var normalizedPath = normalizePath(path);\r\n var internalPath = mangleInternalPath(normalizedPath);\r\n\r\n // check if already processed\r\n if (this.donelog.has(internalPath)) return;\r\n this.donelog.add(internalPath); // do not parse again\r\n this.seenlog.add(internalPath); // do not request again\r\n\r\n // create the source element\r\n var source = new Source(\r\n normalizedPath,\r\n text,\r\n isEntry\r\n ? SourceKind.ENTRY\r\n : path.startsWith(LIBRARY_PREFIX) && path.indexOf(PATH_DELIMITER, LIBRARY_PREFIX.length) < 0\r\n ? SourceKind.LIBRARY\r\n : SourceKind.DEFAULT\r\n );\r\n var program = this.program;\r\n program.sources.push(source);\r\n\r\n // tokenize and parse\r\n var tn = new Tokenizer(source, program.diagnostics);\r\n tn.onComment = this.onComment;\r\n source.tokenizer = tn;\r\n var statements = source.statements;\r\n while (!tn.skip(Token.ENDOFFILE)) {\r\n let statement = this.parseTopLevelStatement(tn, null);\r\n if (statement) statements.push(statement);\r\n }\r\n tn.finish();\r\n }\r\n\r\n /** Parses a top-level statement. */\r\n parseTopLevelStatement(\r\n tn: Tokenizer,\r\n namespace: NamespaceDeclaration | null = null\r\n ): Statement | null {\r\n var flags = CommonFlags.NONE;\r\n var startPos: i32 = -1;\r\n\r\n // check decorators\r\n var decorators: DecoratorNode[] | null = null;\r\n while (tn.skip(Token.AT)) {\r\n if (startPos < 0) startPos = tn.tokenPos;\r\n let decorator = this.parseDecorator(tn);\r\n if (!decorator) {\r\n this.skipStatement(tn);\r\n continue;\r\n }\r\n if (!decorators) decorators = [decorator];\r\n else decorators.push(decorator);\r\n }\r\n\r\n // check modifiers\r\n var exportStart: i32 = 0;\r\n var exportEnd: i32 = 0;\r\n if (tn.skip(Token.EXPORT)) {\r\n if (tn.skip(Token.DEFAULT)) {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n tn.range()\r\n );\r\n }\r\n if (startPos < 0) startPos = tn.tokenPos;\r\n flags |= CommonFlags.EXPORT;\r\n exportStart = tn.tokenPos;\r\n exportEnd = tn.pos;\r\n }\r\n\r\n var declareStart: i32 = 0;\r\n var declareEnd: i32 = 0;\r\n var contextIsAmbient = namespace != null && namespace.is(CommonFlags.AMBIENT);\r\n if (tn.skip(Token.DECLARE)) {\r\n if (startPos < 0) startPos = tn.tokenPos;\r\n if (contextIsAmbient) {\r\n this.error(\r\n DiagnosticCode.A_declare_modifier_cannot_be_used_in_an_already_ambient_context,\r\n tn.range()\r\n ); // recoverable\r\n }\r\n flags |= CommonFlags.DECLARE | CommonFlags.AMBIENT;\r\n } else if (contextIsAmbient) {\r\n flags |= CommonFlags.AMBIENT;\r\n }\r\n\r\n // parse the statement\r\n var statement: Statement | null = null;\r\n\r\n // handle declarations\r\n var first = tn.peek();\r\n if (startPos < 0) startPos = tn.nextTokenPos;\r\n switch (first) {\r\n case Token.CONST: {\r\n tn.next();\r\n flags |= CommonFlags.CONST;\r\n if (tn.skip(Token.ENUM)) {\r\n statement = this.parseEnum(tn, flags, decorators, startPos);\r\n } else {\r\n statement = this.parseVariable(tn, flags, decorators, startPos);\r\n }\r\n decorators = null;\r\n break;\r\n }\r\n case Token.LET: flags |= CommonFlags.LET;\r\n case Token.VAR: {\r\n tn.next();\r\n statement = this.parseVariable(tn, flags, decorators, startPos);\r\n decorators = null;\r\n break;\r\n }\r\n case Token.ENUM: {\r\n tn.next();\r\n statement = this.parseEnum(tn, flags, decorators, startPos);\r\n decorators = null;\r\n break;\r\n }\r\n case Token.FUNCTION: {\r\n tn.next();\r\n statement = this.parseFunction(tn, flags, decorators, startPos);\r\n decorators = null;\r\n break;\r\n }\r\n case Token.ABSTRACT: {\r\n let state = tn.mark();\r\n tn.next();\r\n if (!tn.skip(Token.CLASS)) {\r\n tn.reset(state);\r\n statement = this.parseStatement(tn, true);\r\n break;\r\n } else {\r\n tn.discard(state);\r\n }\r\n flags |= CommonFlags.ABSTRACT;\r\n // fall through\r\n }\r\n case Token.CLASS:\r\n case Token.INTERFACE: {\r\n tn.next();\r\n statement = this.parseClassOrInterface(tn, flags, decorators, startPos);\r\n decorators = null;\r\n break;\r\n }\r\n case Token.NAMESPACE: {\r\n let state = tn.mark();\r\n tn.next();\r\n if (tn.peek(false, IdentifierHandling.PREFER) == Token.IDENTIFIER) {\r\n tn.discard(state);\r\n statement = this.parseNamespace(tn, flags, decorators, startPos);\r\n decorators = null;\r\n } else {\r\n tn.reset(state);\r\n statement = this.parseStatement(tn, true);\r\n }\r\n break;\r\n }\r\n case Token.IMPORT: {\r\n tn.next();\r\n flags |= CommonFlags.IMPORT;\r\n if (flags & CommonFlags.EXPORT) {\r\n statement = this.parseExportImport(tn, startPos);\r\n } else {\r\n statement = this.parseImport(tn);\r\n }\r\n break;\r\n }\r\n case Token.TYPE: { // also identifier\r\n let state = tn.mark();\r\n tn.next();\r\n if (tn.peek(false, IdentifierHandling.PREFER) == Token.IDENTIFIER) {\r\n tn.discard(state);\r\n statement = this.parseTypeDeclaration(tn, flags, decorators, startPos);\r\n decorators = null;\r\n } else {\r\n tn.reset(state);\r\n statement = this.parseStatement(tn, true);\r\n }\r\n break;\r\n }\r\n default: {\r\n\r\n // handle plain exports\r\n if (flags & CommonFlags.EXPORT) {\r\n statement = this.parseExport(tn, startPos, (flags & CommonFlags.DECLARE) != 0);\r\n\r\n // handle non-declaration statements\r\n } else {\r\n if (exportEnd) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(exportStart, exportEnd), \"export\"\r\n ); // recoverable\r\n }\r\n if (declareEnd) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(declareStart, declareEnd), \"declare\"\r\n ); // recoverable\r\n }\r\n if (!namespace) {\r\n statement = this.parseStatement(tn, true);\r\n } // TODO: else?\r\n }\r\n break;\r\n }\r\n }\r\n\r\n // check for decorators that weren't consumed\r\n if (decorators) {\r\n for (let i = 0, k = decorators.length; i < k; ++i) {\r\n this.error(\r\n DiagnosticCode.Decorators_are_not_valid_here,\r\n decorators[i].range\r\n );\r\n }\r\n }\r\n return statement;\r\n }\r\n\r\n /** Obtains the next file to parse. */\r\n nextFile(): string | null {\r\n var backlog = this.backlog;\r\n return backlog.length ? backlog.shift() : null;\r\n }\r\n\r\n /** Finishes parsing and returns the program. */\r\n finish(): Program {\r\n if (this.backlog.length) throw new Error(\"backlog is not empty\");\r\n this.backlog = [];\r\n this.seenlog.clear();\r\n this.donelog.clear();\r\n return this.program;\r\n }\r\n\r\n /** Parses a type. */\r\n parseType(\r\n tn: Tokenizer,\r\n acceptParenthesized: bool = true,\r\n suppressErrors: bool = false\r\n ): CommonTypeNode | null {\r\n\r\n // NOTE: this parses our limited subset\r\n var token = tn.next();\r\n var startPos = tn.tokenPos;\r\n\r\n var type: CommonTypeNode;\r\n\r\n // '(' ...\r\n if (token == Token.OPENPAREN) {\r\n\r\n // '(' FunctionSignature ')' '|' 'null'?\r\n let isNullableSignature = tn.skip(Token.OPENPAREN);\r\n // FunctionSignature?\r\n let signature = this.tryParseSignature(tn);\r\n if (signature) {\r\n if (isNullableSignature) {\r\n if (!tn.skip(Token.CLOSEPAREN)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \")\"\r\n );\r\n return null;\r\n }\r\n if (!tn.skip(Token.BAR)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"|\"\r\n );\r\n return null;\r\n }\r\n if (!tn.skip(Token.NULL)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"null\"\r\n );\r\n }\r\n signature.isNullable = true;\r\n }\r\n return signature;\r\n } else if (isNullableSignature || this.tryParseSignatureIsSignature) {\r\n this.error(\r\n DiagnosticCode.Unexpected_token,\r\n tn.range()\r\n );\r\n return null;\r\n }\r\n\r\n // Type (',' Type)* ')'\r\n if (acceptParenthesized) {\r\n let innerType = this.parseType(tn, false, suppressErrors);\r\n if (!innerType) return null;\r\n if (!tn.skip(Token.CLOSEPAREN)) {\r\n if (!suppressErrors) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(tn.pos), \"}\"\r\n );\r\n }\r\n return null;\r\n }\r\n type = innerType;\r\n type.range.start = startPos;\r\n type.range.end = tn.pos;\r\n } else {\r\n this.error(\r\n DiagnosticCode.Unexpected_token,\r\n tn.range()\r\n );\r\n return null;\r\n }\r\n\r\n // 'void'\r\n } else if (token == Token.VOID) {\r\n type = Node.createType(\r\n Node.createSimpleTypeName(\"void\", tn.range()), [], false, tn.range(startPos, tn.pos)\r\n );\r\n\r\n // 'this'\r\n } else if (token == Token.THIS) {\r\n type = Node.createType(\r\n Node.createSimpleTypeName(\"this\", tn.range()), [], false, tn.range(startPos, tn.pos)\r\n );\r\n\r\n // 'true'\r\n } else if (token == Token.TRUE || token == Token.FALSE) {\r\n type = Node.createType(\r\n Node.createSimpleTypeName(\"bool\", tn.range()), [], false, tn.range(startPos, tn.pos)\r\n );\r\n\r\n // StringLiteral\r\n } else if (token == Token.STRINGLITERAL) {\r\n tn.readString();\r\n type = Node.createType(\r\n Node.createSimpleTypeName(\"string\", tn.range()), [], false, tn.range(startPos, tn.pos)\r\n );\r\n\r\n // Identifier\r\n } else if (token == Token.IDENTIFIER) {\r\n let first = Node.createSimpleTypeName(tn.readIdentifier(), tn.range());\r\n let current = first;\r\n let parameters: TypeNode[] | null = null;\r\n let nullable = false;\r\n\r\n // Identifier ('.' Identifier)+\r\n while (tn.skip(Token.DOT)) {\r\n if (tn.skip(Token.IDENTIFIER)) {\r\n let next = Node.createSimpleTypeName(tn.readIdentifier(), tn.range());\r\n current.next = next;\r\n current = next;\r\n } else {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range(tn.pos)\r\n );\r\n return null;\r\n }\r\n }\r\n\r\n // Name\r\n if (tn.skip(Token.LESSTHAN)) {\r\n do {\r\n let parameter = this.parseType(tn, true, suppressErrors);\r\n if (!parameter) return null;\r\n if (!parameters) parameters = [parameter];\r\n else parameters.push(parameter);\r\n } while (tn.skip(Token.COMMA));\r\n if (!tn.skip(Token.GREATERTHAN)) {\r\n if (!suppressErrors) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(tn.pos), \">\"\r\n );\r\n }\r\n return null;\r\n }\r\n }\r\n // ... | null\r\n while (tn.skip(Token.BAR)) {\r\n if (tn.skip(Token.NULL)) {\r\n nullable = true;\r\n } else {\r\n if (!suppressErrors) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(tn.pos), \"null\"\r\n );\r\n }\r\n return null;\r\n }\r\n }\r\n type = Node.createType(first, parameters || [], nullable, tn.range(startPos, tn.pos));\r\n } else {\r\n if (!suppressErrors) {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n }\r\n return null;\r\n }\r\n // ... [][]\r\n while (tn.skip(Token.OPENBRACKET)) {\r\n let bracketStart = tn.tokenPos;\r\n if (!tn.skip(Token.CLOSEBRACKET)) {\r\n if (!suppressErrors) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"]\"\r\n );\r\n }\r\n return null;\r\n }\r\n let bracketRange = tn.range(bracketStart, tn.pos);\r\n\r\n // ...[] | null\r\n let nullable = false;\r\n if (tn.skip(Token.BAR)) {\r\n if (tn.skip(Token.NULL)) {\r\n nullable = true;\r\n } else {\r\n if (!suppressErrors) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"null\"\r\n );\r\n }\r\n return null;\r\n }\r\n }\r\n type = Node.createType(\r\n Node.createSimpleTypeName(\"Array\", bracketRange),\r\n [ type ],\r\n nullable,\r\n tn.range(startPos, tn.pos)\r\n );\r\n if (nullable) break;\r\n }\r\n\r\n return type;\r\n }\r\n\r\n // Indicates whether tryParseSignature determined that it is handling a Signature\r\n private tryParseSignatureIsSignature: bool = false;\r\n\r\n /** Parses a function signature, as used in type declarations. */\r\n tryParseSignature(\r\n tn: Tokenizer\r\n ): SignatureNode | null {\r\n\r\n // at '(': ('...'? Identifier '?'? ':' Type (',' '...'? Identifier '?'? ':' Type)* )? ')' '=>' Type\r\n\r\n var state = tn.mark();\r\n var startPos = tn.tokenPos;\r\n var parameters: ParameterNode[] | null = null;\r\n var thisType: TypeNode | null = null;\r\n var isSignature: bool = false;\r\n\r\n if (tn.skip(Token.CLOSEPAREN)) {\r\n isSignature = true;\r\n tn.discard(state);\r\n parameters = [];\r\n\r\n } else {\r\n isSignature = false; // not yet known\r\n do {\r\n let kind = ParameterKind.DEFAULT;\r\n if (tn.skip(Token.DOT_DOT_DOT)) {\r\n isSignature = true;\r\n tn.discard(state);\r\n kind = ParameterKind.REST;\r\n }\r\n if (tn.skip(Token.THIS)) {\r\n if (tn.skip(Token.COLON)) {\r\n isSignature = true;\r\n tn.discard(state);\r\n let t = this.parseType(tn, false);\r\n if (!t) return null;\r\n if (t.kind != NodeKind.TYPE) {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n t.range\r\n );\r\n this.tryParseSignatureIsSignature = true;\r\n return null;\r\n }\r\n thisType = t;\r\n } else {\r\n tn.reset(state);\r\n this.tryParseSignatureIsSignature = false;\r\n return null;\r\n }\r\n } else if (tn.skipIdentifier()) {\r\n let name = Node.createIdentifierExpression(tn.readIdentifier(), tn.range(tn.tokenPos, tn.pos));\r\n if (tn.skip(Token.QUESTION)) {\r\n isSignature = true;\r\n tn.discard(state);\r\n if (kind == ParameterKind.REST) {\r\n this.error(\r\n DiagnosticCode.A_rest_parameter_cannot_be_optional,\r\n tn.range()\r\n ); // recoverable\r\n } else {\r\n kind = ParameterKind.OPTIONAL;\r\n }\r\n }\r\n if (tn.skip(Token.COLON)) {\r\n isSignature = true;\r\n tn.discard(state);\r\n let type = this.parseType(tn); // not suppressing errors because known\r\n if (!type) {\r\n this.tryParseSignatureIsSignature = isSignature;\r\n return null;\r\n }\r\n let param = new ParameterNode();\r\n param.parameterKind = kind;\r\n param.name = name;\r\n param.type = type;\r\n if (!parameters) parameters = [ param ];\r\n else parameters.push(param);\r\n } else {\r\n if (isSignature) {\r\n this.error(\r\n DiagnosticCode.Type_expected,\r\n tn.range()\r\n ); // recoverable\r\n }\r\n }\r\n } else {\r\n if (isSignature) {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n } else {\r\n tn.reset(state);\r\n }\r\n this.tryParseSignatureIsSignature = isSignature;\r\n return null;\r\n }\r\n } while (tn.skip(Token.COMMA));\r\n if (!tn.skip(Token.CLOSEPAREN)) {\r\n if (isSignature) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \")\"\r\n );\r\n } else {\r\n tn.reset(state);\r\n }\r\n this.tryParseSignatureIsSignature = isSignature;\r\n return null;\r\n }\r\n }\r\n\r\n var returnType: CommonTypeNode | null;\r\n if (tn.skip(Token.EQUALS_GREATERTHAN)) {\r\n isSignature = true;\r\n tn.discard(state);\r\n returnType = this.parseType(tn);\r\n if (!returnType) {\r\n this.tryParseSignatureIsSignature = isSignature;\r\n return null;\r\n }\r\n } else {\r\n if (isSignature) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"=>\"\r\n );\r\n } else {\r\n tn.reset(state);\r\n }\r\n this.tryParseSignatureIsSignature = isSignature;\r\n return null;\r\n }\r\n this.tryParseSignatureIsSignature = true;\r\n return Node.createSignature(\r\n parameters || [],\r\n returnType,\r\n thisType,\r\n false,\r\n tn.range(startPos, tn.pos)\r\n );\r\n }\r\n\r\n // statements\r\n\r\n parseDecorator(\r\n tn: Tokenizer\r\n ): DecoratorNode | null {\r\n\r\n // at '@': Identifier ('.' Identifier)* '(' Arguments\r\n\r\n var startPos = tn.tokenPos;\r\n if (tn.skipIdentifier()) {\r\n let name = tn.readIdentifier();\r\n let expression: Expression = Node.createIdentifierExpression(name, tn.range(startPos, tn.pos));\r\n while (tn.skip(Token.DOT)) {\r\n if (tn.skipIdentifier()) {\r\n name = tn.readIdentifier();\r\n expression = Node.createPropertyAccessExpression(\r\n expression,\r\n Node.createIdentifierExpression(name, tn.range()),\r\n tn.range(startPos, tn.pos)\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n return null;\r\n }\r\n }\r\n let args: Expression[] | null;\r\n if (tn.skip(Token.OPENPAREN)) {\r\n args = this.parseArguments(tn);\r\n if (args) {\r\n return Node.createDecorator(expression, args, tn.range(startPos, tn.pos));\r\n }\r\n } else {\r\n return Node.createDecorator(expression, null, tn.range(startPos, tn.pos));\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n parseVariable(\r\n tn: Tokenizer,\r\n flags: CommonFlags,\r\n decorators: DecoratorNode[] | null,\r\n startPos: i32\r\n ): VariableStatement | null {\r\n\r\n // at ('const' | 'let' | 'var'): VariableDeclaration (',' VariableDeclaration)* ';'?\r\n\r\n var members = new Array();\r\n do {\r\n let member = this.parseVariableDeclaration(tn, flags, decorators);\r\n if (!member) return null;\r\n members.push(member);\r\n } while (tn.skip(Token.COMMA));\r\n\r\n var ret = Node.createVariableStatement(members, decorators, tn.range(startPos, tn.pos));\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n }\r\n\r\n parseVariableDeclaration(\r\n tn: Tokenizer,\r\n parentFlags: CommonFlags,\r\n parentDecorators: DecoratorNode[] | null\r\n ): VariableDeclaration | null {\r\n\r\n // before: Identifier (':' Type)? ('=' Expression)?\r\n\r\n if (!tn.skipIdentifier()) {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n return null;\r\n }\r\n var identifier = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n var flags = parentFlags;\r\n if (tn.skip(Token.EXCLAMATION)) {\r\n flags |= CommonFlags.DEFINITE_ASSIGNMENT;\r\n }\r\n\r\n var type: CommonTypeNode | null = null;\r\n if (tn.skip(Token.COLON)) {\r\n type = this.parseType(tn);\r\n }\r\n\r\n var initializer: Expression | null = null;\r\n if (tn.skip(Token.EQUALS)) {\r\n if (flags & CommonFlags.AMBIENT) {\r\n this.error(\r\n DiagnosticCode.Initializers_are_not_allowed_in_ambient_contexts,\r\n tn.range()\r\n ); // recoverable\r\n }\r\n initializer = this.parseExpression(tn, Precedence.COMMA + 1);\r\n if (!initializer) return null;\r\n } else {\r\n if (flags & CommonFlags.CONST) {\r\n if (!(flags & CommonFlags.AMBIENT)) {\r\n this.error(\r\n DiagnosticCode._const_declarations_must_be_initialized,\r\n identifier.range\r\n ); // recoverable\r\n }\r\n } else if (!type) { // neither type nor initializer\r\n this.error(\r\n DiagnosticCode.Type_expected,\r\n tn.range(tn.pos)\r\n ); // recoverable\r\n }\r\n }\r\n var range = Range.join(identifier.range, tn.range());\r\n if ((flags & CommonFlags.DEFINITE_ASSIGNMENT) && initializer) {\r\n this.error(\r\n DiagnosticCode.A_definite_assignment_assertion_is_not_permitted_in_this_context,\r\n range);\r\n }\r\n return Node.createVariableDeclaration(\r\n identifier,\r\n type,\r\n initializer,\r\n parentDecorators,\r\n flags,\r\n range\r\n );\r\n }\r\n\r\n parseEnum(\r\n tn: Tokenizer,\r\n flags: CommonFlags,\r\n decorators: DecoratorNode[] | null,\r\n startPos: i32\r\n ): EnumDeclaration | null {\r\n\r\n // at 'enum': Identifier '{' (EnumValueDeclaration (',' EnumValueDeclaration )*)? '}' ';'?\r\n\r\n if (tn.next() != Token.IDENTIFIER) {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n return null;\r\n }\r\n var identifier = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n if (tn.next() != Token.OPENBRACE) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"{\"\r\n );\r\n return null;\r\n }\r\n var members = new Array();\r\n while (!tn.skip(Token.CLOSEBRACE)) {\r\n let member = this.parseEnumValue(tn, CommonFlags.NONE);\r\n if (!member) return null;\r\n members.push(member);\r\n if (!tn.skip(Token.COMMA)) {\r\n if (tn.skip(Token.CLOSEBRACE)) {\r\n break;\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"}\"\r\n );\r\n return null;\r\n }\r\n }\r\n }\r\n var ret = Node.createEnumDeclaration(\r\n identifier,\r\n members,\r\n decorators,\r\n flags,\r\n tn.range(startPos, tn.pos)\r\n );\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n }\r\n\r\n parseEnumValue(\r\n tn: Tokenizer,\r\n parentFlags: CommonFlags\r\n ): EnumValueDeclaration | null {\r\n\r\n // before: Identifier ('=' Expression)?\r\n\r\n if (!tn.skipIdentifier()) {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n return null;\r\n }\r\n var identifier = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n var value: Expression | null = null;\r\n if (tn.skip(Token.EQUALS)) {\r\n value = this.parseExpression(tn, Precedence.COMMA + 1);\r\n if (!value) return null;\r\n }\r\n return Node.createEnumValueDeclaration(\r\n identifier,\r\n value,\r\n parentFlags,\r\n Range.join(identifier.range, tn.range())\r\n );\r\n }\r\n\r\n parseReturn(\r\n tn: Tokenizer\r\n ): ReturnStatement | null {\r\n\r\n // at 'return': Expression | (';' | '}' | ...'\\n')\r\n\r\n var expr: Expression | null = null;\r\n if (\r\n tn.peek(true) != Token.SEMICOLON &&\r\n tn.nextToken != Token.CLOSEBRACE &&\r\n !tn.nextTokenOnNewLine\r\n ) {\r\n if (!(expr = this.parseExpression(tn))) return null;\r\n }\r\n\r\n var ret = Node.createReturnStatement(expr, tn.range());\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n }\r\n\r\n parseTypeParameters(\r\n tn: Tokenizer\r\n ): TypeParameterNode[] | null {\r\n\r\n // at '<': TypeParameter (',' TypeParameter)* '>'\r\n\r\n var typeParameters: TypeParameterNode[] | null = null;\r\n var seenOptional = false;\r\n while (!tn.skip(Token.GREATERTHAN)) {\r\n let typeParameter = this.parseTypeParameter(tn);\r\n if (!typeParameter) return null;\r\n if (typeParameter.defaultType !== null) {\r\n seenOptional = true;\r\n } else if (seenOptional) {\r\n this.error(\r\n DiagnosticCode.Required_type_parameters_may_not_follow_optional_type_parameters,\r\n typeParameter.range\r\n );\r\n typeParameter.defaultType = null;\r\n }\r\n if (!typeParameters) typeParameters = [ typeParameter ];\r\n else typeParameters.push(typeParameter);\r\n if (!tn.skip(Token.COMMA)) {\r\n if (tn.skip(Token.GREATERTHAN)) {\r\n break;\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \">\"\r\n );\r\n return null;\r\n }\r\n }\r\n }\r\n if (!(typeParameters && typeParameters.length)) {\r\n this.error(\r\n DiagnosticCode.Type_parameter_list_cannot_be_empty,\r\n tn.range()\r\n ); // recoverable\r\n }\r\n return typeParameters;\r\n }\r\n\r\n parseTypeParameter(\r\n tn: Tokenizer\r\n ): TypeParameterNode | null {\r\n\r\n // before: Identifier ('extends' Type)? ('=' Type)?\r\n\r\n if (tn.next() == Token.IDENTIFIER) {\r\n let identifier = Node.createIdentifierExpression(\r\n tn.readIdentifier(),\r\n tn.range()\r\n );\r\n let extendsType: TypeNode | null = null;\r\n if (tn.skip(Token.EXTENDS)) {\r\n let t = this.parseType(tn);\r\n if (!t) return null;\r\n if (t.kind != NodeKind.TYPE) {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n t.range\r\n );\r\n return null;\r\n }\r\n extendsType = t;\r\n }\r\n let defaultType: TypeNode | null = null;\r\n if (tn.skip(Token.EQUALS)) {\r\n let t = this.parseType(tn);\r\n if (!t) return null;\r\n if (t.kind != NodeKind.TYPE) {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n t.range\r\n );\r\n return null;\r\n }\r\n defaultType = t;\r\n }\r\n return Node.createTypeParameter(\r\n identifier,\r\n extendsType,\r\n defaultType,\r\n Range.join(identifier.range, tn.range())\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n private parseParametersThis: TypeNode | null = null;\r\n\r\n parseParameters(\r\n tn: Tokenizer,\r\n isConstructor: bool = false\r\n ): ParameterNode[] | null {\r\n\r\n // at '(': (Parameter (',' Parameter)*)? ')'\r\n\r\n var parameters = new Array();\r\n var seenRest: ParameterNode | null = null;\r\n var seenOptional = false;\r\n var reportedRest = false;\r\n var thisType: CommonTypeNode | null = null;\r\n\r\n // check if there is a leading `this` parameter\r\n this.parseParametersThis = null;\r\n if (tn.skip(Token.THIS)) {\r\n if (tn.skip(Token.COLON)) {\r\n thisType = this.parseType(tn); // reports\r\n if (!thisType) return null;\r\n if (thisType.kind == NodeKind.TYPE) {\r\n this.parseParametersThis = thisType;\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n thisType.range\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \":\"\r\n );\r\n return null;\r\n }\r\n if (!tn.skip(Token.COMMA)) {\r\n if (tn.skip(Token.CLOSEPAREN)) {\r\n return parameters;\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \")\"\r\n );\r\n return null;\r\n }\r\n }\r\n }\r\n\r\n while (!tn.skip(Token.CLOSEPAREN)) {\r\n let param = this.parseParameter(tn, isConstructor); // reports\r\n if (!param) return null;\r\n if (seenRest && !reportedRest) {\r\n this.error(\r\n DiagnosticCode.A_rest_parameter_must_be_last_in_a_parameter_list,\r\n seenRest.name.range\r\n );\r\n reportedRest = true;\r\n }\r\n switch (param.parameterKind) {\r\n default: {\r\n if (seenOptional) {\r\n this.error(\r\n DiagnosticCode.A_required_parameter_cannot_follow_an_optional_parameter,\r\n param.name.range\r\n );\r\n }\r\n break;\r\n }\r\n case ParameterKind.OPTIONAL: {\r\n seenOptional = true;\r\n break;\r\n }\r\n case ParameterKind.REST: {\r\n seenRest = param;\r\n break;\r\n }\r\n }\r\n parameters.push(param);\r\n if (!tn.skip(Token.COMMA)) {\r\n if (tn.skip(Token.CLOSEPAREN)) {\r\n break;\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \")\"\r\n );\r\n return null;\r\n }\r\n }\r\n }\r\n return parameters;\r\n }\r\n\r\n parseParameter(\r\n tn: Tokenizer,\r\n isConstructor: bool = false\r\n ): ParameterNode | null {\r\n\r\n // before: ('public' | 'private' | 'protected' | '...')? Identifier '?'? (':' Type)? ('=' Expression)?\r\n\r\n var isRest = false;\r\n var isOptional = false;\r\n var startRange: Range | null = null;\r\n var accessFlags: CommonFlags = CommonFlags.NONE;\r\n if (isConstructor) {\r\n if (tn.skip(Token.PUBLIC)) {\r\n startRange = tn.range();\r\n accessFlags |= CommonFlags.PUBLIC;\r\n } else if (tn.skip(Token.PROTECTED)) {\r\n startRange = tn.range();\r\n accessFlags |= CommonFlags.PROTECTED;\r\n } else if (tn.skip(Token.PRIVATE)) {\r\n startRange = tn.range();\r\n accessFlags |= CommonFlags.PRIVATE;\r\n }\r\n if (tn.peek() == Token.READONLY) {\r\n let state = tn.mark();\r\n tn.next();\r\n if (tn.peek() != Token.COLON) { // modifier\r\n tn.discard(state);\r\n if (!startRange) startRange = tn.range();\r\n accessFlags |= CommonFlags.READONLY;\r\n } else { // identifier\r\n tn.reset(state);\r\n }\r\n }\r\n }\r\n if (tn.skip(Token.DOT_DOT_DOT)) {\r\n if (accessFlags) {\r\n this.error(\r\n DiagnosticCode.A_parameter_property_cannot_be_declared_using_a_rest_parameter,\r\n tn.range()\r\n );\r\n } else {\r\n startRange = tn.range();\r\n }\r\n isRest = true;\r\n }\r\n if (tn.skipIdentifier()) {\r\n if (!isRest) startRange = tn.range();\r\n let identifier = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n let type: CommonTypeNode | null = null;\r\n if (isOptional = tn.skip(Token.QUESTION)) {\r\n if (isRest) {\r\n this.error(\r\n DiagnosticCode.A_rest_parameter_cannot_be_optional,\r\n identifier.range\r\n );\r\n }\r\n }\r\n if (tn.skip(Token.COLON)) {\r\n type = this.parseType(tn);\r\n if (!type) return null;\r\n } else {\r\n type = Node.createOmittedType(tn.range(tn.pos));\r\n }\r\n let initializer: Expression | null = null;\r\n if (tn.skip(Token.EQUALS)) {\r\n if (isRest) {\r\n this.error(\r\n DiagnosticCode.A_rest_parameter_cannot_have_an_initializer,\r\n identifier.range\r\n );\r\n }\r\n if (isOptional) {\r\n this.error(\r\n DiagnosticCode.Parameter_cannot_have_question_mark_and_initializer,\r\n identifier.range\r\n );\r\n } else {\r\n isOptional = true;\r\n }\r\n initializer = this.parseExpression(tn, Precedence.COMMA + 1);\r\n if (!initializer) return null;\r\n }\r\n let param = Node.createParameter(\r\n identifier,\r\n type,\r\n initializer,\r\n isRest\r\n ? ParameterKind.REST\r\n : isOptional\r\n ? ParameterKind.OPTIONAL\r\n : ParameterKind.DEFAULT,\r\n Range.join(startRange, tn.range())\r\n );\r\n param.flags |= accessFlags;\r\n return param;\r\n } else {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n parseFunction(\r\n tn: Tokenizer,\r\n flags: CommonFlags,\r\n decorators: DecoratorNode[] | null,\r\n startPos: i32\r\n ): FunctionDeclaration | null {\r\n\r\n // at 'function':\r\n // Identifier\r\n // ('<' TypeParameters)?\r\n // '(' Parameters (':' Type)?\r\n // '{' Statement* '}'\r\n // ';'?\r\n\r\n if (!tn.skipIdentifier()) {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range(tn.pos)\r\n );\r\n return null;\r\n }\r\n\r\n var name = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n var signatureStart: i32 = -1;\r\n\r\n var typeParameters: TypeParameterNode[] | null = null;\r\n if (tn.skip(Token.LESSTHAN)) {\r\n signatureStart = tn.tokenPos;\r\n typeParameters = this.parseTypeParameters(tn);\r\n if (!typeParameters) return null;\r\n flags |= CommonFlags.GENERIC;\r\n }\r\n\r\n if (!tn.skip(Token.OPENPAREN)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(tn.pos), \"(\"\r\n );\r\n return null;\r\n }\r\n\r\n if (signatureStart < 0) {\r\n signatureStart = tn.tokenPos;\r\n }\r\n\r\n var parameters = this.parseParameters(tn);\r\n if (!parameters) return null;\r\n var thisType = this.parseParametersThis;\r\n\r\n var isSetter = (flags & CommonFlags.SET) != 0;\r\n if (isSetter) {\r\n if (parameters.length != 1) {\r\n this.error(\r\n DiagnosticCode.A_set_accessor_must_have_exactly_one_parameter,\r\n name.range\r\n ); // recoverable\r\n }\r\n if (parameters.length && parameters[0].initializer) {\r\n this.error(\r\n DiagnosticCode.A_set_accessor_parameter_cannot_have_an_initializer,\r\n name.range\r\n ); // recoverable\r\n }\r\n }\r\n\r\n if (flags & CommonFlags.GET) {\r\n if (parameters.length) {\r\n this.error(\r\n DiagnosticCode.A_get_accessor_cannot_have_parameters,\r\n name.range\r\n ); // recoverable\r\n }\r\n }\r\n\r\n var returnType: CommonTypeNode | null = null;\r\n if (tn.skip(Token.COLON)) {\r\n returnType = this.parseType(tn, true, isSetter);\r\n if (!returnType) return null;\r\n }\r\n\r\n if (!returnType) {\r\n returnType = Node.createOmittedType(\r\n tn.range(tn.pos)\r\n );\r\n if (!isSetter) {\r\n this.error(\r\n DiagnosticCode.Type_expected,\r\n returnType.range\r\n ); // recoverable\r\n }\r\n }\r\n\r\n var signature = Node.createSignature(\r\n parameters,\r\n returnType,\r\n thisType,\r\n false,\r\n tn.range(signatureStart, tn.pos)\r\n );\r\n\r\n var body: Statement | null = null;\r\n if (tn.skip(Token.OPENBRACE)) {\r\n if (flags & CommonFlags.AMBIENT) {\r\n this.error(\r\n DiagnosticCode.An_implementation_cannot_be_declared_in_ambient_contexts,\r\n tn.range()\r\n ); // recoverable\r\n }\r\n\r\n body = this.parseBlockStatement(tn, false);\r\n if (!body) return null;\r\n } else if (!(flags & CommonFlags.AMBIENT)) {\r\n this.error(\r\n DiagnosticCode.Function_implementation_is_missing_or_not_immediately_following_the_declaration,\r\n tn.range(tn.pos)\r\n );\r\n }\r\n\r\n var ret = Node.createFunctionDeclaration(\r\n name,\r\n typeParameters,\r\n signature,\r\n body,\r\n decorators,\r\n flags,\r\n ArrowKind.NONE,\r\n tn.range(startPos, tn.pos)\r\n );\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n }\r\n\r\n parseFunctionExpression(tn: Tokenizer): FunctionExpression | null {\r\n var startPos = tn.tokenPos;\r\n var name: IdentifierExpression;\r\n var arrowKind = ArrowKind.NONE;\r\n\r\n // either at 'function':\r\n // Identifier?\r\n // '(' Parameters (':' Type)?\r\n // Statement\r\n\r\n if (tn.token == Token.FUNCTION) {\r\n if (tn.skipIdentifier()) {\r\n name = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n } else { // empty name\r\n name = Node.createEmptyIdentifierExpression(tn.range(tn.pos));\r\n }\r\n if (!tn.skip(Token.OPENPAREN)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(tn.pos), \"(\"\r\n );\r\n return null;\r\n }\r\n\r\n // or at '(' of arrow function:\r\n // Parameters (':' Type)?\r\n // Statement\r\n\r\n } else {\r\n arrowKind = ArrowKind.ARROW_PARENTHESIZED;\r\n assert(tn.token == Token.OPENPAREN);\r\n name = Node.createEmptyIdentifierExpression(tn.range(tn.tokenPos));\r\n }\r\n\r\n // TODO: type parameters? doesn't seem worth it.\r\n\r\n var signatureStart = tn.pos;\r\n var parameters = this.parseParameters(tn);\r\n if (!parameters) return null;\r\n\r\n return this.parseFunctionExpressionCommon(tn, name, parameters, arrowKind, startPos, signatureStart);\r\n }\r\n\r\n private parseFunctionExpressionCommon(\r\n tn: Tokenizer,\r\n name: IdentifierExpression,\r\n parameters: ParameterNode[],\r\n arrowKind: ArrowKind,\r\n startPos: i32 = -1,\r\n signatureStart: i32 = -1\r\n ): FunctionExpression | null {\r\n if (startPos < 0) startPos = name.range.start;\r\n if (signatureStart < 0) signatureStart = startPos;\r\n\r\n var returnType: CommonTypeNode | null = null;\r\n if (arrowKind != ArrowKind.ARROW_SINGLE && tn.skip(Token.COLON)) {\r\n returnType = this.parseType(tn);\r\n if (!returnType) return null;\r\n } else {\r\n returnType = Node.createOmittedType(tn.range(tn.pos));\r\n }\r\n\r\n if (arrowKind) {\r\n if (!tn.skip(Token.EQUALS_GREATERTHAN)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(tn.pos), \"=>\"\r\n );\r\n return null;\r\n }\r\n }\r\n\r\n var signature = Node.createSignature(\r\n parameters,\r\n returnType,\r\n null, // TODO?\r\n false,\r\n tn.range(signatureStart, tn.pos)\r\n );\r\n\r\n var body: Statement | null = null;\r\n if (arrowKind) {\r\n if (tn.skip(Token.OPENBRACE)) {\r\n body = this.parseBlockStatement(tn, false);\r\n } else {\r\n let bodyExpression = this.parseExpression(tn, Precedence.COMMA + 1);\r\n if (bodyExpression) body = Node.createExpressionStatement(bodyExpression);\r\n }\r\n } else {\r\n if (!tn.skip(Token.OPENBRACE)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(tn.pos), \"{\"\r\n );\r\n return null;\r\n }\r\n body = this.parseBlockStatement(tn, false);\r\n }\r\n if (!body) return null;\r\n\r\n var declaration = Node.createFunctionDeclaration(\r\n name,\r\n null,\r\n signature,\r\n body,\r\n null,\r\n CommonFlags.NONE,\r\n arrowKind,\r\n tn.range(startPos, tn.pos)\r\n );\r\n return Node.createFunctionExpression(declaration);\r\n }\r\n\r\n parseClassOrInterface(\r\n tn: Tokenizer,\r\n flags: CommonFlags,\r\n decorators: DecoratorNode[] | null,\r\n startPos: i32\r\n ): ClassDeclaration | null {\r\n\r\n // at ('class' | 'interface'):\r\n // Identifier\r\n // ('<' TypeParameters)?\r\n // ('extends' Type)?\r\n // ('implements' Type (',' Type)*)?\r\n // '{' ClassMember* '}'\r\n\r\n var isInterface = tn.token == Token.INTERFACE;\r\n\r\n if (!tn.skipIdentifier()) {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n return null;\r\n }\r\n\r\n var identifier = Node.createIdentifierExpression(\r\n tn.readIdentifier(),\r\n tn.range()\r\n );\r\n\r\n var typeParameters: TypeParameterNode[] | null = null;\r\n if (tn.skip(Token.LESSTHAN)) {\r\n typeParameters = this.parseTypeParameters(tn);\r\n if (!typeParameters) return null;\r\n flags |= CommonFlags.GENERIC;\r\n }\r\n\r\n var extendsType: TypeNode | null = null;\r\n if (tn.skip(Token.EXTENDS)) {\r\n let t = this.parseType(tn);\r\n if (!t) return null;\r\n if (t.kind != NodeKind.TYPE) {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n t.range\r\n );\r\n return null;\r\n }\r\n extendsType = t;\r\n }\r\n\r\n var implementsTypes: TypeNode[] | null = null;\r\n if (tn.skip(Token.IMPLEMENTS)) {\r\n if (isInterface) {\r\n this.error(\r\n DiagnosticCode.Interface_declaration_cannot_have_implements_clause,\r\n tn.range()\r\n ); // recoverable\r\n }\r\n do {\r\n let type = this.parseType(tn);\r\n if (!type) return null;\r\n if (!isInterface) {\r\n if (!implementsTypes) implementsTypes = [type];\r\n else implementsTypes.push(type);\r\n }\r\n } while (tn.skip(Token.COMMA));\r\n }\r\n\r\n if (!tn.skip(Token.OPENBRACE)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"{\"\r\n );\r\n return null;\r\n }\r\n\r\n var members = new Array();\r\n var declaration: ClassDeclaration;\r\n if (isInterface) {\r\n assert(!implementsTypes);\r\n declaration = Node.createInterfaceDeclaration(\r\n identifier,\r\n typeParameters,\r\n extendsType,\r\n members,\r\n decorators,\r\n flags,\r\n tn.range(startPos, tn.pos)\r\n );\r\n } else {\r\n declaration = Node.createClassDeclaration(\r\n identifier,\r\n typeParameters,\r\n extendsType,\r\n implementsTypes,\r\n members,\r\n decorators,\r\n flags,\r\n tn.range(startPos, tn.pos)\r\n );\r\n }\r\n if (!tn.skip(Token.CLOSEBRACE)) {\r\n do {\r\n let member = this.parseClassMember(tn, declaration);\r\n if (member) members.push(member);\r\n else {\r\n this.skipStatement(tn);\r\n if (tn.skip(Token.ENDOFFILE)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"}\"\r\n );\r\n return null;\r\n }\r\n }\r\n } while (!tn.skip(Token.CLOSEBRACE));\r\n }\r\n return declaration;\r\n }\r\n\r\n parseClassExpression(tn: Tokenizer): ClassExpression | null {\r\n\r\n // at 'class': Identifier? '{' ... '}'\r\n\r\n var startPos = tn.tokenPos;\r\n var name: IdentifierExpression;\r\n\r\n if (tn.skipIdentifier()) {\r\n name = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n } else {\r\n name = Node.createEmptyIdentifierExpression(tn.range(tn.pos));\r\n }\r\n\r\n if (!tn.skip(Token.OPENBRACE)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(tn.pos), \"{\"\r\n );\r\n return null;\r\n }\r\n\r\n var members = new Array();\r\n var declaration = Node.createClassDeclaration(\r\n name,\r\n [],\r\n null,\r\n null,\r\n members,\r\n null,\r\n CommonFlags.NONE,\r\n tn.range(startPos, tn.pos)\r\n );\r\n if (!tn.skip(Token.CLOSEBRACE)) {\r\n do {\r\n let member = this.parseClassMember(tn, declaration);\r\n if (member) members.push(member);\r\n else {\r\n this.skipStatement(tn);\r\n if (tn.skip(Token.ENDOFFILE)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"}\"\r\n );\r\n return null;\r\n }\r\n }\r\n } while (!tn.skip(Token.CLOSEBRACE));\r\n }\r\n return Node.createClassExpression(declaration);\r\n }\r\n\r\n parseClassMember(\r\n tn: Tokenizer,\r\n parent: ClassDeclaration\r\n ): DeclarationStatement | null {\r\n\r\n // before:\r\n // ('public' | 'private' | 'protected')?\r\n // ('static' | 'abstract')?\r\n // 'readonly'?\r\n // ('get' | 'set')?\r\n // Identifier ...\r\n\r\n var startPos = tn.pos;\r\n var isInterface = parent.kind == NodeKind.INTERFACEDECLARATION;\r\n\r\n var decorators: DecoratorNode[] | null = null;\r\n if (tn.skip(Token.AT)) {\r\n do {\r\n let decorator = this.parseDecorator(tn);\r\n if (!decorator) break;\r\n if (!decorators) decorators = [decorator];\r\n else decorators.push(decorator);\r\n } while (tn.skip(Token.AT));\r\n if (decorators && isInterface) {\r\n this.error(\r\n DiagnosticCode.Decorators_are_not_valid_here,\r\n Range.join(decorators[0].range, decorators[decorators.length - 1].range)\r\n );\r\n }\r\n }\r\n\r\n // inherit ambient status\r\n var flags = parent.flags & CommonFlags.AMBIENT;\r\n\r\n // implemented methods are virtual\r\n if (isInterface) flags |= CommonFlags.VIRTUAL;\r\n\r\n var accessStart = 0;\r\n var accessEnd = 0;\r\n if (tn.skip(Token.PUBLIC)) {\r\n if (isInterface) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(), \"public\"\r\n );\r\n }\r\n flags |= CommonFlags.PUBLIC;\r\n accessStart = tn.tokenPos;\r\n accessEnd = tn.pos;\r\n } else if (tn.skip(Token.PRIVATE)) {\r\n if (isInterface) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(), \"private\"\r\n );\r\n }\r\n flags |= CommonFlags.PRIVATE;\r\n accessStart = tn.tokenPos;\r\n accessEnd = tn.pos;\r\n } else if (tn.skip(Token.PROTECTED)) {\r\n if (isInterface) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(), \"protected\"\r\n );\r\n }\r\n flags |= CommonFlags.PROTECTED;\r\n accessStart = tn.tokenPos;\r\n accessEnd = tn.pos;\r\n }\r\n\r\n var staticStart = 0;\r\n var staticEnd = 0;\r\n var abstractStart = 0;\r\n var abstractEnd = 0;\r\n if (tn.skip(Token.STATIC)) {\r\n if (isInterface) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(), \"static\"\r\n );\r\n }\r\n flags |= CommonFlags.STATIC;\r\n staticStart = tn.tokenPos;\r\n staticEnd = tn.pos;\r\n } else {\r\n flags |= CommonFlags.INSTANCE;\r\n if (tn.skip(Token.ABSTRACT)) {\r\n if (isInterface) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(), \"abstract\"\r\n );\r\n }\r\n flags |= CommonFlags.ABSTRACT;\r\n abstractStart = tn.tokenPos;\r\n abstractEnd = tn.pos;\r\n }\r\n if (parent.flags & CommonFlags.GENERIC) flags |= CommonFlags.GENERIC_CONTEXT;\r\n }\r\n\r\n var readonlyStart: i32 = 0;\r\n var readonlyEnd: i32 = 0;\r\n if (tn.skip(Token.READONLY)) {\r\n flags |= CommonFlags.READONLY;\r\n readonlyStart = tn.tokenPos;\r\n readonlyEnd = tn.pos;\r\n }\r\n\r\n // check if accessor: ('get' | 'set') ^\\n Identifier\r\n var state = tn.mark();\r\n var isConstructor = false;\r\n var isGetter = false;\r\n var getStart: i32 = 0;\r\n var getEnd: i32 = 0;\r\n var isSetter = false;\r\n var setStart: i32 = 0;\r\n var setEnd: i32 = 0;\r\n if (!isInterface) {\r\n if (tn.skip(Token.GET)) {\r\n if (tn.peek(true, IdentifierHandling.PREFER) == Token.IDENTIFIER && !tn.nextTokenOnNewLine) {\r\n flags |= CommonFlags.GET;\r\n isGetter = true;\r\n setStart = tn.tokenPos;\r\n setEnd = tn.pos;\r\n if (flags & CommonFlags.READONLY) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(readonlyStart, readonlyEnd), \"readonly\"\r\n ); // recoverable\r\n }\r\n } else {\r\n tn.reset(state);\r\n }\r\n } else if (tn.skip(Token.SET)) {\r\n if (tn.peek(true, IdentifierHandling.PREFER) == Token.IDENTIFIER && !tn.nextTokenOnNewLine) {\r\n flags |= CommonFlags.SET;\r\n isSetter = true;\r\n setStart = tn.tokenPos;\r\n setEnd = tn.pos;\r\n if (flags & CommonFlags.READONLY) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(readonlyStart, readonlyEnd), \"readonly\"\r\n ); // recoverable\r\n }\r\n } else {\r\n tn.reset(state);\r\n }\r\n } else if (tn.skip(Token.CONSTRUCTOR)) {\r\n flags |= CommonFlags.CONSTRUCTOR;\r\n isConstructor = true;\r\n if (flags & CommonFlags.STATIC) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(staticStart, staticEnd), \"static\"\r\n ); // recoverable\r\n }\r\n if (flags & CommonFlags.ABSTRACT) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(abstractStart, abstractEnd), \"abstract\"\r\n ); // recoverable\r\n }\r\n if (flags & CommonFlags.READONLY) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(readonlyStart, readonlyEnd), \"readonly\"\r\n ); // recoverable\r\n }\r\n }\r\n }\r\n\r\n var name: IdentifierExpression;\r\n if (isConstructor) {\r\n name = Node.createConstructorExpression(tn.range());\r\n } else {\r\n if (!(isGetter || isSetter) && tn.skip(Token.OPENBRACKET)) {\r\n // TODO: also handle symbols, which might have some of these modifiers\r\n if (flags & CommonFlags.PUBLIC) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(accessStart, accessEnd), \"public\"\r\n ); // recoverable\r\n } else if (flags & CommonFlags.PROTECTED) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(accessStart, accessEnd), \"protected\"\r\n ); // recoverable\r\n } else if (flags & CommonFlags.PRIVATE) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(accessStart, accessEnd), \"protected\"\r\n ); // recoverable\r\n }\r\n if (flags & CommonFlags.STATIC) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(staticStart, staticEnd), \"static\"\r\n ); // recoverable\r\n }\r\n if (flags & CommonFlags.ABSTRACT) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(abstractStart, abstractEnd), \"abstract\"\r\n ); // recoverable\r\n }\r\n if (flags & CommonFlags.READONLY) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(readonlyStart, readonlyEnd), \"readonly\"\r\n ); // recoverable\r\n }\r\n let retIndex = this.parseIndexSignatureDeclaration(tn, decorators);\r\n if (!retIndex) return null;\r\n tn.skip(Token.SEMICOLON);\r\n return retIndex;\r\n }\r\n if (!tn.skipIdentifier()) {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n return null;\r\n }\r\n name = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n }\r\n var typeParameters: TypeParameterNode[] | null = null;\r\n if (tn.skip(Token.LESSTHAN)) {\r\n let typeParametersStart = tn.tokenPos;\r\n typeParameters = this.parseTypeParameters(tn);\r\n if (!typeParameters) return null;\r\n if (isConstructor) {\r\n this.error(\r\n DiagnosticCode.Type_parameters_cannot_appear_on_a_constructor_declaration,\r\n tn.range(typeParametersStart, tn.pos)\r\n ); // recoverable\r\n } else if (isGetter || isSetter) {\r\n this.error(\r\n DiagnosticCode.An_accessor_cannot_have_type_parameters,\r\n tn.range(typeParametersStart, tn.pos)\r\n ); // recoverable\r\n } else {\r\n flags |= CommonFlags.GENERIC;\r\n }\r\n }\r\n\r\n // method: '(' Parameters (':' Type)? '{' Statement* '}' ';'?\r\n if (tn.skip(Token.OPENPAREN)) {\r\n let signatureStart = tn.tokenPos;\r\n let parameters = this.parseParameters(tn, isConstructor);\r\n if (!parameters) return null;\r\n let thisType = this.parseParametersThis;\r\n if (isConstructor) {\r\n for (let i = 0, k = parameters.length; i < k; ++i) {\r\n let parameter = parameters[i];\r\n if (parameter.isAny(\r\n CommonFlags.PUBLIC |\r\n CommonFlags.PROTECTED |\r\n CommonFlags.PRIVATE |\r\n CommonFlags.READONLY\r\n )) {\r\n let implicitFieldDeclaration = Node.createFieldDeclaration(\r\n parameter.name,\r\n parameter.type,\r\n null, // initialized via parameter\r\n null,\r\n parameter.flags | CommonFlags.INSTANCE,\r\n parameter.range\r\n );\r\n implicitFieldDeclaration.parameterIndex = i;\r\n parameter.implicitFieldDeclaration = implicitFieldDeclaration;\r\n parent.members.push(implicitFieldDeclaration);\r\n }\r\n }\r\n } else if (isGetter) {\r\n if (parameters.length) {\r\n this.error(\r\n DiagnosticCode.A_get_accessor_cannot_have_parameters,\r\n name.range\r\n );\r\n }\r\n } else if (isSetter) {\r\n if (parameters.length != 1) {\r\n this.error(\r\n DiagnosticCode.A_set_accessor_must_have_exactly_one_parameter,\r\n name.range\r\n );\r\n }\r\n if (parameters.length && parameters[0].initializer) {\r\n this.error(\r\n DiagnosticCode.A_set_accessor_parameter_cannot_have_an_initializer,\r\n name.range\r\n );\r\n }\r\n }\r\n\r\n let returnType: CommonTypeNode | null = null;\r\n if (tn.skip(Token.COLON)) {\r\n if (name.kind == NodeKind.CONSTRUCTOR) {\r\n this.error(\r\n DiagnosticCode.Type_annotation_cannot_appear_on_a_constructor_declaration,\r\n tn.range()\r\n );\r\n } else if (isSetter) {\r\n this.error(\r\n DiagnosticCode.A_set_accessor_cannot_have_a_return_type_annotation,\r\n tn.range()\r\n );\r\n }\r\n returnType = this.parseType(tn, name.kind == NodeKind.CONSTRUCTOR || isSetter);\r\n if (!returnType) return null;\r\n } else {\r\n returnType = Node.createOmittedType(tn.range(tn.pos));\r\n if (!isSetter && name.kind != NodeKind.CONSTRUCTOR) {\r\n this.error(\r\n DiagnosticCode.Type_expected,\r\n returnType.range\r\n ); // recoverable\r\n }\r\n }\r\n\r\n let signature = Node.createSignature(\r\n parameters,\r\n returnType,\r\n thisType,\r\n false,\r\n tn.range(signatureStart, tn.pos)\r\n );\r\n\r\n let body: Statement | null = null;\r\n if (tn.skip(Token.OPENBRACE)) {\r\n if (flags & CommonFlags.AMBIENT) {\r\n this.error(\r\n DiagnosticCode.An_implementation_cannot_be_declared_in_ambient_contexts,\r\n tn.range()\r\n ); // recoverable\r\n } else if (flags & CommonFlags.ABSTRACT) {\r\n this.error(\r\n DiagnosticCode.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract,\r\n tn.range(), name.text\r\n ); // recoverable\r\n }\r\n body = this.parseBlockStatement(tn, false);\r\n if (!body) return null;\r\n } else if (!(flags & CommonFlags.AMBIENT) && !isInterface) {\r\n this.error(\r\n DiagnosticCode.Function_implementation_is_missing_or_not_immediately_following_the_declaration,\r\n tn.range()\r\n ); // recoverable\r\n }\r\n\r\n let retMethod = Node.createMethodDeclaration(\r\n name,\r\n typeParameters,\r\n signature,\r\n body,\r\n decorators,\r\n flags,\r\n tn.range(startPos, tn.pos)\r\n );\r\n tn.skip(Token.SEMICOLON);\r\n return retMethod;\r\n\r\n } else if (isConstructor) {\r\n this.error(\r\n DiagnosticCode.Constructor_implementation_is_missing,\r\n name.range\r\n );\r\n\r\n } else if (isGetter || isSetter) {\r\n this.error(\r\n DiagnosticCode.Function_implementation_is_missing_or_not_immediately_following_the_declaration,\r\n name.range\r\n );\r\n\r\n // field: (':' Type)? ('=' Expression)? ';'?\r\n } else {\r\n if (flags & CommonFlags.ABSTRACT) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(abstractStart, abstractEnd), \"abstract\"\r\n ); // recoverable\r\n }\r\n\r\n if (flags & CommonFlags.GET) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(getStart, getEnd), \"get\"\r\n ); // recoverable\r\n }\r\n\r\n if (flags & CommonFlags.SET) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(setStart, setEnd), \"set\"\r\n ); // recoverable\r\n }\r\n\r\n let type: CommonTypeNode | null = null;\r\n if (tn.skip(Token.QUESTION)) {\r\n this.error(\r\n DiagnosticCode.Optional_properties_are_not_supported,\r\n tn.range(startPos, tn.pos)\r\n );\r\n }\r\n if (tn.skip(Token.EXCLAMATION)) {\r\n flags |= CommonFlags.DEFINITE_ASSIGNMENT;\r\n }\r\n if (tn.skip(Token.COLON)) {\r\n type = this.parseType(tn);\r\n if (!type) return null;\r\n } else {\r\n this.error(\r\n DiagnosticCode.Type_expected,\r\n tn.range()\r\n ); // recoverable\r\n }\r\n let initializer: Expression | null = null;\r\n if (tn.skip(Token.EQUALS)) {\r\n initializer = this.parseExpression(tn);\r\n if (!initializer) return null;\r\n }\r\n let range = tn.range(startPos, tn.pos);\r\n if ((flags & CommonFlags.DEFINITE_ASSIGNMENT) && ((flags & CommonFlags.STATIC) || isInterface || initializer)) {\r\n this.error(\r\n DiagnosticCode.A_definite_assignment_assertion_is_not_permitted_in_this_context,\r\n range\r\n );\r\n }\r\n let retField = Node.createFieldDeclaration(\r\n name,\r\n type,\r\n initializer,\r\n decorators,\r\n flags,\r\n range\r\n );\r\n tn.skip(Token.SEMICOLON);\r\n return retField;\r\n }\r\n return null;\r\n }\r\n\r\n parseIndexSignatureDeclaration(tn: Tokenizer, decorators: DecoratorNode[] | null): IndexSignatureDeclaration | null {\r\n\r\n // at: '[': 'key' ':' Type ']' ':' Type\r\n\r\n if (decorators && decorators.length) {\r\n this.error(\r\n DiagnosticCode.Decorators_are_not_valid_here,\r\n Range.join(decorators[0].range, decorators[decorators.length - 1].range)\r\n ); // recoverable\r\n }\r\n\r\n var start = tn.tokenPos;\r\n if (tn.skipIdentifier()) {\r\n let id = tn.readIdentifier();\r\n if (id == \"key\") {\r\n if (tn.skip(Token.COLON)) {\r\n let keyType = this.parseType(tn);\r\n if (!keyType) return null;\r\n if (keyType.kind != NodeKind.TYPE) {\r\n this.error(\r\n DiagnosticCode.Type_expected,\r\n tn.range()\r\n );\r\n return null;\r\n }\r\n if (tn.skip(Token.CLOSEBRACKET)) {\r\n if (tn.skip(Token.COLON)) {\r\n let valueType = this.parseType(tn);\r\n if (!valueType) return null;\r\n return Node.createIndexSignatureDeclaration(keyType, valueType, tn.range(start, tn.pos));\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \":\"\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"]\"\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \":\"\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"key\"\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n parseNamespace(\r\n tn: Tokenizer,\r\n flags: CommonFlags,\r\n decorators: DecoratorNode[] | null,\r\n startPos: i32\r\n ): NamespaceDeclaration | null {\r\n\r\n // at 'namespace': Identifier '{' (Variable | Function)* '}'\r\n\r\n if (tn.skipIdentifier()) {\r\n let identifier = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n if (tn.skip(Token.OPENBRACE)) {\r\n let members = new Array();\r\n let ns = Node.createNamespaceDeclaration(\r\n identifier,\r\n members,\r\n decorators,\r\n flags,\r\n tn.range(startPos, tn.pos)\r\n );\r\n while (!tn.skip(Token.CLOSEBRACE)) {\r\n let member = this.parseTopLevelStatement(tn, ns);\r\n if (member) members.push(member);\r\n else {\r\n this.skipStatement(tn);\r\n if (tn.skip(Token.ENDOFFILE)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"}\"\r\n );\r\n return null;\r\n }\r\n }\r\n }\r\n tn.skip(Token.SEMICOLON);\r\n return ns;\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"{\"\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n parseExport(\r\n tn: Tokenizer,\r\n startPos: i32,\r\n isDeclare: bool\r\n ): ExportStatement | null {\r\n\r\n // at 'export': '{' ExportMember (',' ExportMember)* }' ('from' StringLiteral)? ';'?\r\n\r\n var path: StringLiteralExpression | null = null;\r\n if (tn.skip(Token.OPENBRACE)) {\r\n let members = new Array();\r\n while (!tn.skip(Token.CLOSEBRACE)) {\r\n let member = this.parseExportMember(tn);\r\n if (!member) return null;\r\n members.push(member);\r\n if (!tn.skip(Token.COMMA)) {\r\n if (tn.skip(Token.CLOSEBRACE)) {\r\n break;\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"}\"\r\n );\r\n return null;\r\n }\r\n }\r\n }\r\n if (tn.skip(Token.FROM)) {\r\n if (tn.skip(Token.STRINGLITERAL)) {\r\n path = Node.createStringLiteralExpression(tn.readString(), tn.range());\r\n } else {\r\n this.error(\r\n DiagnosticCode.String_literal_expected,\r\n tn.range()\r\n );\r\n return null;\r\n }\r\n }\r\n let ret = Node.createExportStatement(members, path, isDeclare, tn.range(startPos, tn.pos));\r\n let internalPath = ret.internalPath;\r\n if (internalPath !== null && !this.seenlog.has(internalPath)) {\r\n this.backlog.push(internalPath);\r\n this.seenlog.add(internalPath);\r\n }\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n } else if (tn.skip(Token.ASTERISK)) {\r\n if (tn.skip(Token.FROM)) {\r\n if (tn.skip(Token.STRINGLITERAL)) {\r\n path = Node.createStringLiteralExpression(tn.readString(), tn.range());\r\n let ret = Node.createExportStatement(null, path, isDeclare, tn.range(startPos, tn.pos));\r\n let internalPath = assert(ret.internalPath);\r\n let source = tn.source;\r\n if (!source.exportPaths) source.exportPaths = new Set();\r\n source.exportPaths.add(internalPath);\r\n if (!this.seenlog.has(internalPath)) {\r\n this.backlog.push(internalPath);\r\n this.seenlog.add(internalPath);\r\n }\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n } else {\r\n this.error(\r\n DiagnosticCode.String_literal_expected,\r\n tn.range()\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"from\"\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"{\"\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n parseExportMember(\r\n tn: Tokenizer\r\n ): ExportMember | null {\r\n\r\n // before: Identifier ('as' Identifier)?\r\n\r\n if (tn.skipIdentifier()) {\r\n let identifier = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n let asIdentifier: IdentifierExpression | null = null;\r\n if (tn.skip(Token.AS)) {\r\n if (tn.skipIdentifier(IdentifierHandling.ALWAYS)) {\r\n asIdentifier = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n } else {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n return null;\r\n }\r\n }\r\n return Node.createExportMember(\r\n identifier,\r\n asIdentifier,\r\n asIdentifier\r\n ? Range.join(identifier.range, asIdentifier.range)\r\n : identifier.range\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n parseImport(\r\n tn: Tokenizer\r\n ): ImportStatement | null {\r\n\r\n // at 'import':\r\n // ('{' (ImportMember (',' ImportMember)* '}') | ('*' 'as' Identifier)?\r\n // 'from' StringLiteral ';'?\r\n\r\n var startPos = tn.tokenPos;\r\n var members: ImportDeclaration[] | null = null;\r\n var namespaceName: IdentifierExpression | null = null;\r\n var skipFrom = false;\r\n if (tn.skip(Token.OPENBRACE)) {\r\n members = new Array();\r\n while (!tn.skip(Token.CLOSEBRACE)) {\r\n let member = this.parseImportDeclaration(tn);\r\n if (!member) return null;\r\n members.push(member);\r\n if (!tn.skip(Token.COMMA)) {\r\n if (tn.skip(Token.CLOSEBRACE)) {\r\n break;\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"}\"\r\n );\r\n return null;\r\n }\r\n }\r\n }\r\n } else if (tn.skip(Token.ASTERISK)) {\r\n if (tn.skip(Token.AS)) {\r\n if (tn.skipIdentifier()) {\r\n namespaceName = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n } else {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n return null;\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"as\"\r\n );\r\n return null;\r\n }\r\n } else {\r\n skipFrom = true;\r\n }\r\n\r\n if (skipFrom || tn.skip(Token.FROM)) {\r\n if (tn.skip(Token.STRINGLITERAL)) {\r\n let path = Node.createStringLiteralExpression(tn.readString(), tn.range());\r\n let ret: ImportStatement;\r\n if (namespaceName) {\r\n assert(!members);\r\n ret = Node.createImportStatementWithWildcard(namespaceName, path, tn.range(startPos, tn.pos));\r\n } else {\r\n ret = Node.createImportStatement(members, path, tn.range(startPos, tn.pos));\r\n }\r\n let internalPath = ret.internalPath;\r\n if (!this.seenlog.has(internalPath)) {\r\n this.backlog.push(internalPath);\r\n this.seenlog.add(internalPath);\r\n }\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n } else {\r\n this.error(\r\n DiagnosticCode.String_literal_expected,\r\n tn.range()\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"from\"\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n parseImportDeclaration(\r\n tn: Tokenizer\r\n ): ImportDeclaration | null {\r\n\r\n // before: Identifier ('as' Identifier)?\r\n\r\n if (tn.skipIdentifier(IdentifierHandling.ALWAYS)) {\r\n let identifier = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n let asIdentifier: IdentifierExpression | null = null;\r\n if (tn.skip(Token.AS)) {\r\n if (tn.skipIdentifier()) {\r\n asIdentifier = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n } else {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n return null;\r\n }\r\n }\r\n return Node.createImportDeclaration(\r\n identifier,\r\n asIdentifier,\r\n asIdentifier\r\n ? Range.join(identifier.range, asIdentifier.range)\r\n : identifier.range\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n parseExportImport(\r\n tn: Tokenizer,\r\n startPos: i32\r\n ): ExportImportStatement | null {\r\n\r\n // at 'export' 'import': Identifier ('=' Identifier)? ';'?\r\n\r\n if (tn.skipIdentifier()) {\r\n let asIdentifier = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n if (tn.skip(Token.EQUALS)) {\r\n if (tn.skipIdentifier()) {\r\n let identifier = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n let ret = Node.createExportImportStatement(identifier, asIdentifier, tn.range(startPos, tn.pos));\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n } else {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"=\"\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n parseStatement(\r\n tn: Tokenizer,\r\n topLevel: bool = false\r\n ): Statement | null {\r\n\r\n // at previous token\r\n\r\n var state = tn.mark();\r\n var token = tn.next();\r\n var statement: Statement | null = null;\r\n switch (token) {\r\n case Token.BREAK: {\r\n statement = this.parseBreak(tn);\r\n break;\r\n }\r\n case Token.CONST: {\r\n statement = this.parseVariable(tn, CommonFlags.CONST, null, tn.tokenPos);\r\n break;\r\n }\r\n case Token.CONTINUE: {\r\n statement = this.parseContinue(tn);\r\n break;\r\n }\r\n case Token.DO: {\r\n statement = this.parseDoStatement(tn);\r\n break;\r\n }\r\n case Token.FOR: {\r\n statement = this.parseForStatement(tn);\r\n break;\r\n }\r\n case Token.IF: {\r\n statement = this.parseIfStatement(tn);\r\n break;\r\n }\r\n case Token.LET: {\r\n statement = this.parseVariable(tn, CommonFlags.LET, null, tn.tokenPos);\r\n break;\r\n }\r\n case Token.VAR: {\r\n statement = this.parseVariable(tn, CommonFlags.NONE, null, tn.tokenPos);\r\n break;\r\n }\r\n case Token.OPENBRACE: {\r\n statement = this.parseBlockStatement(tn, topLevel);\r\n break;\r\n }\r\n case Token.RETURN: {\r\n if (topLevel) {\r\n this.error(\r\n DiagnosticCode.A_return_statement_can_only_be_used_within_a_function_body,\r\n tn.range()\r\n ); // recoverable\r\n }\r\n statement = this.parseReturn(tn);\r\n break;\r\n }\r\n case Token.SEMICOLON: {\r\n return Node.createEmptyStatement(tn.range(tn.tokenPos));\r\n }\r\n case Token.SWITCH: {\r\n statement = this.parseSwitchStatement(tn);\r\n break;\r\n }\r\n case Token.THROW: {\r\n statement = this.parseThrowStatement(tn);\r\n break;\r\n }\r\n case Token.TRY: {\r\n statement = this.parseTryStatement(tn);\r\n break;\r\n }\r\n case Token.VOID: {\r\n statement = this.parseVoidStatement(tn);\r\n break;\r\n }\r\n case Token.WHILE: {\r\n statement = this.parseWhileStatement(tn);\r\n break;\r\n }\r\n case Token.TYPE: { // also identifier\r\n if (tn.peek(false, IdentifierHandling.PREFER) == Token.IDENTIFIER) {\r\n statement = this.parseTypeDeclaration(tn, CommonFlags.NONE, null, tn.tokenPos);\r\n break;\r\n }\r\n // fall-through\r\n }\r\n default: {\r\n tn.reset(state);\r\n statement = this.parseExpressionStatement(tn);\r\n break;\r\n }\r\n }\r\n if (!statement) { // has been reported\r\n tn.reset(state);\r\n this.skipStatement(tn);\r\n } else {\r\n tn.discard(state);\r\n }\r\n return statement;\r\n }\r\n\r\n parseBlockStatement(\r\n tn: Tokenizer,\r\n topLevel: bool\r\n ): BlockStatement | null {\r\n\r\n // at '{': Statement* '}' ';'?\r\n\r\n var startPos = tn.tokenPos;\r\n var statements = new Array();\r\n while (!tn.skip(Token.CLOSEBRACE)) {\r\n let state = tn.mark();\r\n let statement = this.parseStatement(tn, topLevel);\r\n if (!statement) {\r\n if (tn.token == Token.ENDOFFILE) return null;\r\n tn.reset(state);\r\n this.skipStatement(tn);\r\n } else {\r\n tn.discard(state);\r\n statements.push(statement);\r\n }\r\n }\r\n var ret = Node.createBlockStatement(statements, tn.range(startPos, tn.pos));\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n }\r\n\r\n parseBreak(\r\n tn: Tokenizer\r\n ): BreakStatement | null {\r\n\r\n // at 'break': Identifier? ';'?\r\n\r\n var identifier: IdentifierExpression | null = null;\r\n if (tn.peek(true) == Token.IDENTIFIER && !tn.nextTokenOnNewLine) {\r\n tn.next(IdentifierHandling.PREFER);\r\n identifier = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n }\r\n var ret = Node.createBreakStatement(identifier, tn.range());\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n }\r\n\r\n parseContinue(\r\n tn: Tokenizer\r\n ): ContinueStatement | null {\r\n\r\n // at 'continue': Identifier? ';'?\r\n\r\n var identifier: IdentifierExpression | null = null;\r\n if (tn.peek(true) == Token.IDENTIFIER && !tn.nextTokenOnNewLine) {\r\n tn.next(IdentifierHandling.PREFER);\r\n identifier = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n }\r\n var ret = Node.createContinueStatement(identifier, tn.range());\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n }\r\n\r\n parseDoStatement(\r\n tn: Tokenizer\r\n ): DoStatement | null {\r\n\r\n // at 'do': Statement 'while' '(' Expression ')' ';'?\r\n\r\n var startPos = tn.tokenPos;\r\n var statement = this.parseStatement(tn);\r\n if (!statement) return null;\r\n\r\n if (tn.skip(Token.WHILE)) {\r\n\r\n if (tn.skip(Token.OPENPAREN)) {\r\n let condition = this.parseExpression(tn);\r\n if (!condition) return null;\r\n\r\n if (tn.skip(Token.CLOSEPAREN)) {\r\n let ret = Node.createDoStatement(statement, condition, tn.range(startPos, tn.pos));\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \")\"\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"(\"\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"while\"\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n parseExpressionStatement(\r\n tn: Tokenizer\r\n ): ExpressionStatement | null {\r\n\r\n // at previous token\r\n\r\n var expr = this.parseExpression(tn);\r\n if (!expr) return null;\r\n\r\n var ret = Node.createExpressionStatement(expr);\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n }\r\n\r\n parseForStatement(\r\n tn: Tokenizer\r\n ): ForStatement | null {\r\n\r\n // at 'for': '(' Statement? Expression? ';' Expression? ')' Statement\r\n\r\n var startPos = tn.tokenPos;\r\n\r\n if (tn.skip(Token.OPENPAREN)) {\r\n let initializer: Statement | null = null;\r\n\r\n if (tn.skip(Token.CONST)) {\r\n initializer = this.parseVariable(tn, CommonFlags.CONST, null, tn.tokenPos);\r\n } else if (tn.skip(Token.LET)) {\r\n initializer = this.parseVariable(tn, CommonFlags.LET, null, tn.tokenPos);\r\n } else if (tn.skip(Token.VAR)) {\r\n initializer = this.parseVariable(tn, CommonFlags.NONE, null, tn.tokenPos);\r\n\r\n } else if (!tn.skip(Token.SEMICOLON)) {\r\n initializer = this.parseExpressionStatement(tn);\r\n if (!initializer) return null;\r\n }\r\n\r\n if (tn.token == Token.SEMICOLON) {\r\n let condition: ExpressionStatement | null = null;\r\n if (!tn.skip(Token.SEMICOLON)) {\r\n condition = this.parseExpressionStatement(tn);\r\n if (!condition) return null;\r\n }\r\n\r\n if (tn.token == Token.SEMICOLON) {\r\n let incrementor: Expression | null = null;\r\n if (!tn.skip(Token.CLOSEPAREN)) {\r\n incrementor = this.parseExpression(tn);\r\n if (!incrementor) return null;\r\n\r\n if (!tn.skip(Token.CLOSEPAREN)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \")\"\r\n );\r\n return null;\r\n }\r\n }\r\n\r\n let statement = this.parseStatement(tn);\r\n if (!statement) return null;\r\n\r\n return Node.createForStatement(\r\n initializer,\r\n condition\r\n ? condition.expression\r\n : null,\r\n incrementor,\r\n statement,\r\n tn.range(startPos, tn.pos)\r\n );\r\n\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \";\"\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \";\"\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"(\"\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n parseIfStatement(\r\n tn: Tokenizer\r\n ): IfStatement | null {\r\n\r\n // at 'if': '(' Expression ')' Statement ('else' Statement)?\r\n\r\n var startPos = tn.tokenPos;\r\n if (tn.skip(Token.OPENPAREN)) {\r\n let condition = this.parseExpression(tn);\r\n if (!condition) return null;\r\n if (tn.skip(Token.CLOSEPAREN)) {\r\n let statement = this.parseStatement(tn);\r\n if (!statement) return null;\r\n let elseStatement: Statement | null = null;\r\n if (tn.skip(Token.ELSE)) {\r\n elseStatement = this.parseStatement(tn);\r\n if (!elseStatement) return null;\r\n }\r\n return Node.createIfStatement(\r\n condition,\r\n statement,\r\n elseStatement,\r\n tn.range(startPos, tn.pos)\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \")\"\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"(\"\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n parseSwitchStatement(\r\n tn: Tokenizer\r\n ): SwitchStatement | null {\r\n\r\n // at 'switch': '(' Expression ')' '{' SwitchCase* '}' ';'?\r\n\r\n var startPos = tn.tokenPos;\r\n if (tn.skip(Token.OPENPAREN)) {\r\n let condition = this.parseExpression(tn);\r\n if (!condition) return null;\r\n if (tn.skip(Token.CLOSEPAREN)) {\r\n if (tn.skip(Token.OPENBRACE)) {\r\n let cases = new Array();\r\n while (!tn.skip(Token.CLOSEBRACE)) {\r\n let case_ = this.parseSwitchCase(tn);\r\n if (!case_) return null;\r\n cases.push(case_);\r\n }\r\n let ret = Node.createSwitchStatement(condition, cases, tn.range(startPos, tn.pos));\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"{\"\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \")\"\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"(\"\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n parseSwitchCase(\r\n tn: Tokenizer\r\n ): SwitchCase | null {\r\n\r\n var startPos = tn.tokenPos;\r\n var statements: Statement[],\r\n statement: Statement | null;\r\n\r\n // 'case' Expression ':' Statement*\r\n\r\n if (tn.skip(Token.CASE)) {\r\n let label = this.parseExpression(tn);\r\n if (!label) return null;\r\n if (tn.skip(Token.COLON)) {\r\n statements = new Array();\r\n while (tn.peek() != Token.CASE && tn.nextToken != Token.DEFAULT && tn.nextToken != Token.CLOSEBRACE) {\r\n statement = this.parseStatement(tn);\r\n if (!statement) return null;\r\n statements.push(statement);\r\n }\r\n return Node.createSwitchCase(label, statements, tn.range(startPos, tn.pos));\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \":\"\r\n );\r\n }\r\n\r\n // 'default' ':' Statement*\r\n\r\n } else if (tn.skip(Token.DEFAULT)) {\r\n if (tn.skip(Token.COLON)) {\r\n statements = new Array();\r\n while (tn.peek() != Token.CASE && tn.nextToken != Token.DEFAULT && tn.nextToken != Token.CLOSEBRACE) {\r\n statement = this.parseStatement(tn);\r\n if (!statement) return null;\r\n statements.push(statement);\r\n }\r\n return Node.createSwitchCase(null, statements, tn.range(startPos, tn.pos));\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \":\"\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._case_or_default_expected,\r\n tn.range()\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n parseThrowStatement(\r\n tn: Tokenizer\r\n ): ThrowStatement | null {\r\n\r\n // at 'throw': Expression ';'?\r\n\r\n var startPos = tn.tokenPos;\r\n var expression = this.parseExpression(tn);\r\n if (!expression) return null;\r\n var ret = Node.createThrowStatement(expression, tn.range(startPos, tn.pos));\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n }\r\n\r\n parseTryStatement(\r\n tn: Tokenizer\r\n ): TryStatement | null {\r\n\r\n // at 'try':\r\n // '{' Statement* '}'\r\n // ('catch' '(' VariableMember ')' '{' Statement* '}')?\r\n // ('finally' '{' Statement* '}'? ';'?\r\n\r\n var startPos = tn.tokenPos;\r\n var stmt: Statement | null;\r\n if (tn.skip(Token.OPENBRACE)) {\r\n let statements = new Array();\r\n while (!tn.skip(Token.CLOSEBRACE)) {\r\n stmt = this.parseStatement(tn);\r\n if (!stmt) return null;\r\n statements.push(stmt);\r\n }\r\n let catchVariable: IdentifierExpression | null = null;\r\n let catchStatements: Statement[] | null = null;\r\n let finallyStatements: Statement[] | null = null;\r\n if (tn.skip(Token.CATCH)) {\r\n if (!tn.skip(Token.OPENPAREN)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"(\"\r\n );\r\n return null;\r\n }\r\n if (!tn.skipIdentifier()) {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n return null;\r\n }\r\n catchVariable = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n if (!tn.skip(Token.CLOSEPAREN)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \")\"\r\n );\r\n return null;\r\n }\r\n if (!tn.skip(Token.OPENBRACE)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"{\"\r\n );\r\n return null;\r\n }\r\n catchStatements = [];\r\n while (!tn.skip(Token.CLOSEBRACE)) {\r\n stmt = this.parseStatement(tn);\r\n if (!stmt) return null;\r\n catchStatements.push(stmt);\r\n }\r\n }\r\n if (tn.skip(Token.FINALLY)) {\r\n if (!tn.skip(Token.OPENBRACE)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"{\"\r\n );\r\n return null;\r\n }\r\n finallyStatements = [];\r\n while (!tn.skip(Token.CLOSEBRACE)) {\r\n stmt = this.parseStatement(tn);\r\n if (!stmt) return null;\r\n finallyStatements.push(stmt);\r\n }\r\n }\r\n if (!(catchStatements || finallyStatements)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"catch\"\r\n );\r\n return null;\r\n }\r\n let ret = Node.createTryStatement(\r\n statements,\r\n catchVariable,\r\n catchStatements,\r\n finallyStatements,\r\n tn.range(startPos, tn.pos)\r\n );\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"{\"\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n parseTypeDeclaration(\r\n tn: Tokenizer,\r\n flags: CommonFlags,\r\n decorators: DecoratorNode[] | null,\r\n startPos: i32\r\n ): TypeDeclaration | null {\r\n\r\n // at 'type': Identifier ('<' TypeParameters '>')? '=' Type ';'?\r\n\r\n if (tn.skipIdentifier()) {\r\n let name = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n let typeParameters: TypeParameterNode[] | null = null;\r\n if (tn.skip(Token.LESSTHAN)) {\r\n typeParameters = this.parseTypeParameters(tn);\r\n if (!typeParameters) return null;\r\n flags |= CommonFlags.GENERIC;\r\n }\r\n if (tn.skip(Token.EQUALS)) {\r\n let type = this.parseType(tn);\r\n if (!type) return null;\r\n let ret = Node.createTypeDeclaration(\r\n name,\r\n typeParameters,\r\n type,\r\n decorators,\r\n flags,\r\n tn.range(startPos, tn.pos)\r\n );\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"=\"\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n parseVoidStatement(\r\n tn: Tokenizer\r\n ): VoidStatement | null {\r\n\r\n // at 'void': Expression ';'?\r\n\r\n var startPos = tn.tokenPos;\r\n var expression = this.parseExpression(tn, Precedence.GROUPING);\r\n if (!expression) return null;\r\n var ret = Node.createVoidStatement(expression, tn.range(startPos, tn.pos));\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n }\r\n\r\n parseWhileStatement(\r\n tn: Tokenizer\r\n ): WhileStatement | null {\r\n\r\n // at 'while': '(' Expression ')' Statement ';'?\r\n\r\n var startPos = tn.tokenPos;\r\n if (tn.skip(Token.OPENPAREN)) {\r\n let expression = this.parseExpression(tn);\r\n if (!expression) return null;\r\n if (tn.skip(Token.CLOSEPAREN)) {\r\n let statement = this.parseStatement(tn);\r\n if (!statement) return null;\r\n let ret = Node.createWhileStatement(expression, statement, tn.range(startPos, tn.pos));\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \")\"\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"(\"\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n // expressions\r\n // see: http://www.engr.mun.ca/~theo/Misc/exp_parsing.htm#climbing\r\n\r\n parseExpressionStart(\r\n tn: Tokenizer\r\n ): Expression | null {\r\n\r\n var token = tn.next(IdentifierHandling.PREFER);\r\n var startPos = tn.tokenPos;\r\n var precedence = determinePrecedenceStart(token);\r\n if (precedence != Precedence.NONE) {\r\n let operand: Expression | null;\r\n\r\n // TODO: SpreadExpression, YieldExpression (currently become unsupported UnaryPrefixExpressions)\r\n\r\n // NewExpression\r\n if (token == Token.NEW) {\r\n operand = this.parseExpression(tn, Precedence.CALL);\r\n if (!operand) return null;\r\n if (operand.kind == NodeKind.CALL) {\r\n return Node.createNewExpression(\r\n (operand).expression,\r\n (operand).typeArguments,\r\n (operand).arguments,\r\n tn.range(startPos, tn.pos)\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n tn.range()\r\n );\r\n }\r\n return null;\r\n } else {\r\n operand = this.parseExpression(tn, precedence);\r\n if (!operand) return null;\r\n }\r\n\r\n // UnaryPrefixExpression\r\n if (token == Token.PLUS_PLUS || token == Token.MINUS_MINUS) {\r\n if (\r\n operand.kind != NodeKind.IDENTIFIER &&\r\n operand.kind != NodeKind.ELEMENTACCESS &&\r\n operand.kind != NodeKind.PROPERTYACCESS\r\n ) {\r\n this.error(\r\n DiagnosticCode.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access,\r\n operand.range\r\n );\r\n }\r\n }\r\n return Node.createUnaryPrefixExpression(token, operand, tn.range(startPos, tn.pos));\r\n }\r\n\r\n var expr: Expression | null = null;\r\n switch (token) {\r\n\r\n case Token.NULL: return Node.createNullExpression(tn.range());\r\n case Token.TRUE: return Node.createTrueExpression(tn.range());\r\n case Token.FALSE: return Node.createFalseExpression(tn.range());\r\n\r\n // ParenthesizedExpression\r\n // FunctionExpression\r\n case Token.OPENPAREN: {\r\n\r\n // determine whether this is a function expression\r\n if (tn.skip(Token.CLOSEPAREN)) { // must be a function expression (fast route)\r\n return this.parseFunctionExpressionCommon(\r\n tn,\r\n Node.createEmptyIdentifierExpression(tn.range(startPos)),\r\n [],\r\n ArrowKind.ARROW_PARENTHESIZED\r\n );\r\n }\r\n let state = tn.mark();\r\n let again = true;\r\n do {\r\n switch (tn.next(IdentifierHandling.PREFER)) {\r\n\r\n // function expression\r\n case Token.DOT_DOT_DOT: {\r\n tn.reset(state);\r\n return this.parseFunctionExpression(tn);\r\n }\r\n // can be both\r\n case Token.IDENTIFIER: {\r\n tn.readIdentifier();\r\n switch (tn.next()) {\r\n\r\n // if we got here, check for arrow\r\n case Token.CLOSEPAREN: {\r\n if (\r\n !tn.skip(Token.COLON) &&\r\n !tn.skip(Token.EQUALS_GREATERTHAN)\r\n ) {\r\n again = false;\r\n break;\r\n }\r\n // fall-through\r\n }\r\n // function expression\r\n case Token.COLON: { // type annotation\r\n tn.reset(state);\r\n return this.parseFunctionExpression(tn);\r\n }\r\n // optional parameter or parenthesized\r\n case Token.QUESTION: {\r\n if (\r\n tn.skip(Token.COLON) || // optional parameter with type\r\n tn.skip(Token.COMMA) || // optional parameter without type\r\n tn.skip(Token.CLOSEPAREN) // last optional parameter without type\r\n ) {\r\n tn.reset(state);\r\n return this.parseFunctionExpression(tn);\r\n }\r\n again = false; // parenthesized\r\n break;\r\n }\r\n case Token.COMMA: {\r\n break; // continue\r\n }\r\n // parenthesized expression\r\n // case Token.EQUALS: // missing type annotation for simplicity\r\n default: {\r\n again = false;\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n // parenthesized expression\r\n default: {\r\n again = false;\r\n break;\r\n }\r\n }\r\n } while (again);\r\n tn.reset(state);\r\n\r\n // parse parenthesized\r\n expr = this.parseExpression(tn);\r\n if (!expr) return null;\r\n if (!tn.skip(Token.CLOSEPAREN)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \")\"\r\n );\r\n return null;\r\n }\r\n return Node.createParenthesizedExpression(expr, tn.range(startPos, tn.pos));\r\n }\r\n // ArrayLiteralExpression\r\n case Token.OPENBRACKET: {\r\n let elementExpressions = new Array();\r\n while (!tn.skip(Token.CLOSEBRACKET)) {\r\n if (tn.peek() == Token.COMMA) {\r\n expr = null; // omitted\r\n } else {\r\n expr = this.parseExpression(tn, Precedence.COMMA + 1);\r\n if (!expr) return null;\r\n }\r\n elementExpressions.push(expr);\r\n if (!tn.skip(Token.COMMA)) {\r\n if (tn.skip(Token.CLOSEBRACKET)) {\r\n break;\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"]\"\r\n );\r\n return null;\r\n }\r\n }\r\n }\r\n return Node.createArrayLiteralExpression(elementExpressions, tn.range(startPos, tn.pos));\r\n }\r\n // ObjectLiteralExpression\r\n case Token.OPENBRACE: {\r\n let startPos = tn.tokenPos;\r\n let names = new Array();\r\n let values = new Array();\r\n let name: IdentifierExpression;\r\n while (!tn.skip(Token.CLOSEBRACE)) {\r\n if (!tn.skipIdentifier()) {\r\n if (!tn.skip(Token.STRINGLITERAL)) {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range(),\r\n );\r\n return null;\r\n }\r\n name = Node.createIdentifierExpression(tn.readString(), tn.range());\r\n name.isQuoted = true;\r\n } else {\r\n name = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n }\r\n names.push(name);\r\n if (tn.skip(Token.COLON)) {\r\n let value = this.parseExpression(tn, Precedence.COMMA + 1);\r\n if (!value) return null;\r\n values.push(value);\r\n } else if (!name.isQuoted) {\r\n values.push(name);\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \":\"\r\n );\r\n return null;\r\n }\r\n if (!tn.skip(Token.COMMA)) {\r\n if (tn.skip(Token.CLOSEBRACE)) {\r\n break;\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"}\"\r\n );\r\n return null;\r\n }\r\n }\r\n }\r\n return Node.createObjectLiteralExpression(names, values, tn.range(startPos, tn.pos));\r\n }\r\n // AssertionExpression (unary prefix)\r\n case Token.LESSTHAN: {\r\n let toType = this.parseType(tn);\r\n if (!toType) return null;\r\n if (!tn.skip(Token.GREATERTHAN)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \">\"\r\n );\r\n return null;\r\n }\r\n expr = this.parseExpression(tn, Precedence.CALL);\r\n if (!expr) return null;\r\n return Node.createAssertionExpression(\r\n AssertionKind.PREFIX,\r\n expr,\r\n toType,\r\n tn.range(startPos, tn.pos)\r\n );\r\n }\r\n case Token.IDENTIFIER: {\r\n let identifier = Node.createIdentifierExpression(tn.readIdentifier(), tn.range(startPos, tn.pos));\r\n if (tn.peek(true) == Token.EQUALS_GREATERTHAN && !tn.nextTokenOnNewLine) {\r\n return this.parseFunctionExpressionCommon(\r\n tn,\r\n Node.createEmptyIdentifierExpression(tn.range(startPos)),\r\n [\r\n Node.createParameter(\r\n identifier,\r\n Node.createOmittedType(identifier.range.atEnd),\r\n null,\r\n ParameterKind.DEFAULT,\r\n identifier.range\r\n )\r\n ],\r\n ArrowKind.ARROW_SINGLE,\r\n startPos\r\n );\r\n }\r\n return identifier;\r\n }\r\n case Token.THIS: {\r\n return Node.createThisExpression(tn.range(startPos, tn.pos));\r\n }\r\n case Token.CONSTRUCTOR: {\r\n return Node.createConstructorExpression(tn.range(startPos, tn.pos));\r\n }\r\n case Token.SUPER: {\r\n if (tn.peek() != Token.DOT && tn.nextToken != Token.OPENPAREN) {\r\n this.error(\r\n DiagnosticCode._super_must_be_followed_by_an_argument_list_or_member_access,\r\n tn.range()\r\n );\r\n }\r\n return Node.createSuperExpression(tn.range(startPos, tn.pos));\r\n }\r\n case Token.STRINGLITERAL: {\r\n return Node.createStringLiteralExpression(tn.readString(), tn.range(startPos, tn.pos));\r\n }\r\n case Token.INTEGERLITERAL: {\r\n return Node.createIntegerLiteralExpression(tn.readInteger(), tn.range(startPos, tn.pos));\r\n }\r\n case Token.FLOATLITERAL: {\r\n return Node.createFloatLiteralExpression(tn.readFloat(), tn.range(startPos, tn.pos));\r\n }\r\n // RegexpLiteralExpression\r\n // note that this also continues on invalid ones so the surrounding AST remains intact\r\n case Token.SLASH: {\r\n let regexpPattern = tn.readRegexpPattern(); // also reports\r\n if (!tn.skip(Token.SLASH)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"/\"\r\n );\r\n return null;\r\n }\r\n return Node.createRegexpLiteralExpression(\r\n regexpPattern,\r\n tn.readRegexpFlags(), // also reports\r\n tn.range(startPos, tn.pos)\r\n );\r\n }\r\n case Token.FUNCTION: {\r\n return this.parseFunctionExpression(tn);\r\n }\r\n case Token.CLASS: {\r\n return this.parseClassExpression(tn);\r\n }\r\n default: {\r\n if (token == Token.ENDOFFILE) {\r\n this.error(\r\n DiagnosticCode.Unexpected_end_of_text,\r\n tn.range(startPos)\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Expression_expected,\r\n tn.range()\r\n );\r\n }\r\n return null;\r\n }\r\n }\r\n }\r\n\r\n tryParseTypeArgumentsBeforeArguments(\r\n tn: Tokenizer\r\n ): CommonTypeNode[] | null {\r\n\r\n // at '<': Type (',' Type)* '>' '('\r\n\r\n var state = tn.mark();\r\n if (!tn.skip(Token.LESSTHAN)) return null;\r\n var typeArguments: CommonTypeNode[] | null = null;\r\n do {\r\n if (tn.peek() === Token.GREATERTHAN) {\r\n break;\r\n }\r\n let type = this.parseType(tn, true, true);\r\n if (!type) {\r\n tn.reset(state);\r\n return null;\r\n }\r\n if (!typeArguments) typeArguments = [ type ];\r\n else typeArguments.push(type);\r\n } while (tn.skip(Token.COMMA));\r\n if (tn.skip(Token.GREATERTHAN) && tn.skip(Token.OPENPAREN)) {\r\n return typeArguments;\r\n }\r\n tn.reset(state);\r\n return null;\r\n }\r\n\r\n parseArguments(\r\n tn: Tokenizer\r\n ): Expression[] | null {\r\n\r\n // at '(': (Expression (',' Expression)*)? ')'\r\n\r\n var args = new Array();\r\n while (!tn.skip(Token.CLOSEPAREN)) {\r\n let expr = this.parseExpression(tn, Precedence.COMMA + 1);\r\n if (!expr) return null;\r\n args.push(expr);\r\n if (!tn.skip(Token.COMMA)) {\r\n if (tn.skip(Token.CLOSEPAREN)) {\r\n break;\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \")\"\r\n );\r\n return null;\r\n }\r\n }\r\n }\r\n return args;\r\n }\r\n\r\n parseExpression(\r\n tn: Tokenizer,\r\n precedence: Precedence = Precedence.COMMA\r\n ): Expression | null {\r\n assert(precedence != Precedence.NONE);\r\n\r\n var expr = this.parseExpressionStart(tn);\r\n if (!expr) return null;\r\n expr = this.maybeParseCallExpression(tn, expr); // simple call like on an Identifier\r\n\r\n var startPos = expr.range.start;\r\n var token: Token;\r\n var next: Expression | null = null;\r\n var nextPrecedence: Precedence;\r\n while (\r\n (nextPrecedence = determinePrecedence(token = tn.peek())) >= precedence\r\n ) { // precedence climbing\r\n tn.next();\r\n switch (token) {\r\n // AssertionExpression\r\n case Token.AS: {\r\n let toType = this.parseType(tn); // reports\r\n if (!toType) return null;\r\n expr = Node.createAssertionExpression(\r\n AssertionKind.AS,\r\n expr,\r\n toType,\r\n tn.range(startPos, tn.pos)\r\n );\r\n break;\r\n }\r\n case Token.EXCLAMATION: {\r\n expr = Node.createAssertionExpression(\r\n AssertionKind.NONNULL,\r\n expr,\r\n null,\r\n tn.range(startPos, tn.pos)\r\n );\r\n break;\r\n }\r\n // InstanceOfExpression\r\n case Token.INSTANCEOF: {\r\n let isType = this.parseType(tn); // reports\r\n if (!isType) return null;\r\n expr = Node.createInstanceOfExpression(\r\n expr,\r\n isType,\r\n tn.range(startPos, tn.pos)\r\n );\r\n break;\r\n }\r\n // ElementAccessExpression\r\n case Token.OPENBRACKET: {\r\n next = this.parseExpression(tn); // reports\r\n if (!next) return null;\r\n if (!tn.skip(Token.CLOSEBRACKET)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"]\"\r\n );\r\n return null;\r\n }\r\n expr = Node.createElementAccessExpression(\r\n expr,\r\n next,\r\n tn.range(startPos, tn.pos)\r\n );\r\n break;\r\n }\r\n // UnaryPostfixExpression\r\n case Token.PLUS_PLUS:\r\n case Token.MINUS_MINUS: {\r\n if (\r\n expr.kind != NodeKind.IDENTIFIER &&\r\n expr.kind != NodeKind.ELEMENTACCESS &&\r\n expr.kind != NodeKind.PROPERTYACCESS\r\n ) {\r\n this.error(\r\n DiagnosticCode.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access,\r\n expr.range\r\n );\r\n }\r\n expr = Node.createUnaryPostfixExpression(\r\n token,\r\n expr,\r\n tn.range(startPos, tn.pos)\r\n );\r\n break;\r\n }\r\n // TernaryExpression\r\n case Token.QUESTION: {\r\n let ifThen = this.parseExpression(tn);\r\n if (!ifThen) return null;\r\n if (!tn.skip(Token.COLON)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \":\"\r\n );\r\n return null;\r\n }\r\n let ifElse = this.parseExpression(tn, precedence > Precedence.COMMA\r\n ? Precedence.COMMA + 1\r\n : Precedence.COMMA\r\n );\r\n if (!ifElse) return null;\r\n expr = Node.createTernaryExpression(\r\n expr,\r\n ifThen,\r\n ifElse,\r\n tn.range(startPos, tn.pos)\r\n );\r\n break;\r\n }\r\n // CommaExpression\r\n case Token.COMMA: {\r\n let commaExprs: Expression[] = [ expr ];\r\n do {\r\n expr = this.parseExpression(tn, Precedence.COMMA + 1);\r\n if (!expr) return null;\r\n commaExprs.push(expr);\r\n } while (tn.skip(Token.COMMA));\r\n expr = Node.createCommaExpression(commaExprs, tn.range(startPos, tn.pos));\r\n break;\r\n }\r\n default: {\r\n\r\n // PropertyAccessExpression\r\n if (token == Token.DOT) {\r\n if (tn.skipIdentifier()) {\r\n next = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n } else {\r\n next = this.parseExpression(tn,\r\n isRightAssociative(token)\r\n ? nextPrecedence\r\n : nextPrecedence + 1\r\n );\r\n if (!next) return null;\r\n }\r\n if (next.kind == NodeKind.IDENTIFIER) { // expr '.' Identifier\r\n expr = Node.createPropertyAccessExpression(\r\n expr,\r\n next,\r\n tn.range(startPos, tn.pos)\r\n );\r\n } else if (next.kind == NodeKind.CALL) { // expr '.' CallExpression\r\n expr = this.joinPropertyCall(tn, startPos, expr, next);\r\n if (!expr) return null;\r\n } else {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n next.range\r\n );\r\n return null;\r\n }\r\n\r\n // BinaryExpression\r\n } else {\r\n next = this.parseExpression(tn,\r\n isRightAssociative(token)\r\n ? nextPrecedence\r\n : nextPrecedence + 1\r\n );\r\n if (!next) return null;\r\n expr = Node.createBinaryExpression(token, expr, next, tn.range(startPos, tn.pos));\r\n }\r\n break;\r\n }\r\n }\r\n expr = this.maybeParseCallExpression(tn, expr); // compound call like on an ElementAccess\r\n }\r\n return expr;\r\n }\r\n\r\n private joinPropertyCall(\r\n tn: Tokenizer,\r\n startPos: i32,\r\n expr: Expression,\r\n call: CallExpression\r\n ): Expression | null {\r\n var callee = call.expression;\r\n switch (callee.kind) {\r\n case NodeKind.IDENTIFIER: { // join property access and use as call target\r\n call.expression = Node.createPropertyAccessExpression(\r\n expr,\r\n callee,\r\n tn.range(startPos, tn.pos)\r\n );\r\n break;\r\n }\r\n case NodeKind.CALL: { // join call target und wrap the original call around it\r\n let inner = this.joinPropertyCall(tn, startPos, expr, callee);\r\n if (!inner) return null;\r\n call.expression = inner;\r\n call.range = tn.range(startPos, tn.pos);\r\n break;\r\n }\r\n default: {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n call.range\r\n );\r\n return null;\r\n }\r\n }\r\n return call;\r\n }\r\n\r\n private maybeParseCallExpression(\r\n tn: Tokenizer,\r\n expr: Expression\r\n ): Expression {\r\n if (nodeIsCallable(expr.kind)) {\r\n let typeArguments: CommonTypeNode[] | null = null;\r\n while (\r\n tn.skip(Token.OPENPAREN)\r\n ||\r\n nodeIsGenericCallable(expr.kind) && (typeArguments = this.tryParseTypeArgumentsBeforeArguments(tn)) !== null\r\n ) {\r\n let args = this.parseArguments(tn);\r\n if (!args) break;\r\n expr = Node.createCallExpression( // is again callable\r\n expr,\r\n typeArguments,\r\n args,\r\n tn.range(expr.range.start, tn.pos)\r\n );\r\n }\r\n }\r\n return expr;\r\n }\r\n\r\n /** Skips over a statement on errors in an attempt to reduce unnecessary diagnostic noise. */\r\n skipStatement(tn: Tokenizer): void {\r\n tn.peek(true);\r\n if (tn.nextTokenOnNewLine) tn.next(); // if reset() to the previous line\r\n do {\r\n let nextToken = tn.peek(true);\r\n if (\r\n nextToken == Token.ENDOFFILE || // next step should handle this\r\n nextToken == Token.SEMICOLON // end of the statement for sure\r\n ) {\r\n tn.next();\r\n break;\r\n }\r\n if (tn.nextTokenOnNewLine) break; // end of the statement maybe\r\n switch (tn.next()) {\r\n case Token.IDENTIFIER: {\r\n tn.readIdentifier();\r\n break;\r\n }\r\n case Token.STRINGLITERAL: {\r\n tn.readString();\r\n break;\r\n }\r\n case Token.INTEGERLITERAL: {\r\n tn.readInteger();\r\n break;\r\n }\r\n case Token.FLOATLITERAL: {\r\n tn.readFloat();\r\n break;\r\n }\r\n case Token.OPENBRACE: {\r\n this.skipBlock(tn);\r\n break;\r\n }\r\n }\r\n } while (true);\r\n }\r\n\r\n /** Skips over a block on errors in an attempt to reduce unnecessary diagnostic noise. */\r\n skipBlock(tn: Tokenizer): void {\r\n // at '{': ... '}'\r\n var depth = 1;\r\n var again = true;\r\n do {\r\n switch (tn.next()) {\r\n case Token.ENDOFFILE: {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"}\"\r\n );\r\n again = false;\r\n break;\r\n }\r\n case Token.OPENBRACE: {\r\n ++depth;\r\n break;\r\n }\r\n case Token.CLOSEBRACE: {\r\n --depth;\r\n if (!depth) again = false;\r\n break;\r\n }\r\n case Token.IDENTIFIER: {\r\n tn.readIdentifier();\r\n break;\r\n }\r\n case Token.STRINGLITERAL: {\r\n tn.readString();\r\n break;\r\n }\r\n case Token.INTEGERLITERAL: {\r\n tn.readInteger();\r\n break;\r\n }\r\n case Token.FLOATLITERAL: {\r\n tn.readFloat();\r\n break;\r\n }\r\n }\r\n } while (again);\r\n }\r\n}\r\n\r\n/** Operator precedence from least to largest. */\r\nexport const enum Precedence {\r\n NONE,\r\n COMMA,\r\n SPREAD,\r\n YIELD,\r\n ASSIGNMENT,\r\n CONDITIONAL,\r\n LOGICAL_OR,\r\n LOGICAL_AND,\r\n BITWISE_OR,\r\n BITWISE_XOR,\r\n BITWISE_AND,\r\n EQUALITY,\r\n RELATIONAL,\r\n SHIFT,\r\n ADDITIVE,\r\n MULTIPLICATIVE,\r\n EXPONENTIATED,\r\n UNARY_PREFIX,\r\n UNARY_POSTFIX,\r\n CALL,\r\n MEMBERACCESS,\r\n GROUPING\r\n}\r\n\r\n/** Determines the precedence of a starting token. */\r\nfunction determinePrecedenceStart(kind: Token): Precedence {\r\n switch (kind) {\r\n case Token.DOT_DOT_DOT: return Precedence.SPREAD;\r\n case Token.YIELD: return Precedence.YIELD;\r\n case Token.EXCLAMATION:\r\n case Token.TILDE:\r\n case Token.PLUS:\r\n case Token.MINUS:\r\n case Token.PLUS_PLUS:\r\n case Token.MINUS_MINUS:\r\n case Token.TYPEOF:\r\n case Token.VOID:\r\n case Token.DELETE: return Precedence.UNARY_PREFIX;\r\n case Token.NEW: return Precedence.MEMBERACCESS;\r\n }\r\n return Precedence.NONE;\r\n}\r\n\r\n/** Determines the precende of a non-starting token. */\r\nfunction determinePrecedence(kind: Token): Precedence {\r\n switch (kind) {\r\n case Token.COMMA: return Precedence.COMMA;\r\n case Token.EQUALS:\r\n case Token.PLUS_EQUALS:\r\n case Token.MINUS_EQUALS:\r\n case Token.ASTERISK_ASTERISK_EQUALS:\r\n case Token.ASTERISK_EQUALS:\r\n case Token.SLASH_EQUALS:\r\n case Token.PERCENT_EQUALS:\r\n case Token.LESSTHAN_LESSTHAN_EQUALS:\r\n case Token.GREATERTHAN_GREATERTHAN_EQUALS:\r\n case Token.GREATERTHAN_GREATERTHAN_GREATERTHAN_EQUALS:\r\n case Token.AMPERSAND_EQUALS:\r\n case Token.CARET_EQUALS:\r\n case Token.BAR_EQUALS: return Precedence.ASSIGNMENT;\r\n case Token.QUESTION: return Precedence.CONDITIONAL;\r\n case Token.BAR_BAR: return Precedence.LOGICAL_OR;\r\n case Token.AMPERSAND_AMPERSAND: return Precedence.LOGICAL_AND;\r\n case Token.BAR: return Precedence.BITWISE_OR;\r\n case Token.CARET: return Precedence.BITWISE_XOR;\r\n case Token.AMPERSAND: return Precedence.BITWISE_AND;\r\n case Token.EQUALS_EQUALS:\r\n case Token.EXCLAMATION_EQUALS:\r\n case Token.EQUALS_EQUALS_EQUALS:\r\n case Token.EXCLAMATION_EQUALS_EQUALS: return Precedence.EQUALITY;\r\n case Token.AS:\r\n case Token.IN:\r\n case Token.INSTANCEOF:\r\n case Token.LESSTHAN:\r\n case Token.GREATERTHAN:\r\n case Token.LESSTHAN_EQUALS:\r\n case Token.GREATERTHAN_EQUALS: return Precedence.RELATIONAL;\r\n case Token.LESSTHAN_LESSTHAN:\r\n case Token.GREATERTHAN_GREATERTHAN:\r\n case Token.GREATERTHAN_GREATERTHAN_GREATERTHAN: return Precedence.SHIFT;\r\n case Token.PLUS:\r\n case Token.MINUS: return Precedence.ADDITIVE;\r\n case Token.ASTERISK:\r\n case Token.SLASH:\r\n case Token.PERCENT: return Precedence.MULTIPLICATIVE;\r\n case Token.ASTERISK_ASTERISK: return Precedence.EXPONENTIATED;\r\n case Token.PLUS_PLUS:\r\n case Token.MINUS_MINUS: return Precedence.UNARY_POSTFIX;\r\n case Token.DOT:\r\n case Token.NEW:\r\n case Token.OPENBRACKET:\r\n case Token.EXCLAMATION: return Precedence.MEMBERACCESS;\r\n }\r\n return Precedence.NONE;\r\n}\r\n\r\n/** Determines whether a non-starting token is right associative. */\r\nfunction isRightAssociative(kind: Token): bool {\r\n switch (kind) {\r\n case Token.EQUALS:\r\n case Token.PLUS_EQUALS:\r\n case Token.MINUS_EQUALS:\r\n case Token.ASTERISK_ASTERISK_EQUALS:\r\n case Token.ASTERISK_EQUALS:\r\n case Token.SLASH_EQUALS:\r\n case Token.PERCENT_EQUALS:\r\n case Token.LESSTHAN_LESSTHAN_EQUALS:\r\n case Token.GREATERTHAN_GREATERTHAN_EQUALS:\r\n case Token.GREATERTHAN_GREATERTHAN_GREATERTHAN_EQUALS:\r\n case Token.AMPERSAND_EQUALS:\r\n case Token.CARET_EQUALS:\r\n case Token.BAR_EQUALS:\r\n case Token.QUESTION:\r\n case Token.ASTERISK_ASTERISK: return true;\r\n default: return false;\r\n }\r\n}\r\n","/**\r\n * JavaScript glue code.\r\n * @module glue/js\r\n * @preferred\r\n *//***/\r\n\r\n/// \r\n\r\nimport \"./binaryen\"; // must be first so portable can pick up the memory implementation\r\nimport \"../../../std/portable/index\";\r\nimport \"./float\";\r\nimport \"./i64\";\r\n\r\nimport { Module } from \"../../module\";\r\n\r\nModule.prototype.toText = function(this: Module) {\r\n return binaryen.wrapModule(this.ref).emitStackIR();\r\n};\r\n\r\nModule.prototype.toAsmjs = function(this: Module) {\r\n return binaryen.wrapModule(this.ref).emitAsmjs();\r\n};\r\n","// Copy Binaryen exports to global scope\r\n\r\nconst binaryen = global.Binaryen || require(\"binaryen\");\r\nglobal.binaryen = binaryen;\r\n\r\nfor (var key in binaryen) {\r\n if (key.startsWith(\"_Binaryen\") || key.startsWith(\"_Relooper\")) global[key] = binaryen[key];\r\n}\r\n\r\n// Utilize Binaryen's heap\r\n\r\nglobal.__memory_allocate = binaryen._malloc;\r\nglobal.__memory_free = binaryen._free;\r\nglobal.__memory_copy = binaryen._memmove;\r\nglobal.__store = function(ptr, val) { binaryen.HEAPU8[ptr] = val; };\r\nglobal.__load = function(ptr) { return binaryen.HEAPU8[ptr]; };\r\n","module.exports = __WEBPACK_EXTERNAL_MODULE__19__;","/** @module std/portable *//***/\r\n\r\nvar globalScope = typeof window !== \"undefined\" && window || typeof global !== \"undefined\" && global || self;\r\n\r\nglobalScope.ASC_TARGET = 0; // JS\r\nglobalScope.ASC_NO_ASSERT = false;\r\nglobalScope.ASC_MEMORY_BASE = 0;\r\nglobalScope.ASC_OPTIMIZE_LEVEL = 3;\r\nglobalScope.ASC_SHRINK_LEVEL = 0;\r\nglobalScope.ASC_FEATURE_MUTABLE_GLOBAL = false;\r\nglobalScope.ASC_FEATURE_SIGN_EXTENSION = false;\r\nglobalScope.ASC_FEATURE_BULK_MEMORY = false;\r\nglobalScope.ASC_FEATURE_SIMD = false;\r\nglobalScope.ASC_FEATURE_THREADS = false;\r\n\r\nvar F64 = new Float64Array(1);\r\nvar U64 = new Uint32Array(F64.buffer);\r\n\r\nObject.defineProperties(\r\n globalScope[\"i8\"] = function i8(value) { return value << 24 >> 24; }\r\n, {\r\n \"MIN_VALUE\": { value: -128, writable: false },\r\n \"MAX_VALUE\": { value: 127, writable: false }\r\n});\r\n\r\nObject.defineProperties(\r\n globalScope[\"i16\"] = function i16(value) { return value << 16 >> 16; }\r\n, {\r\n \"MIN_VALUE\": { value: -32768, writable: false },\r\n \"MAX_VALUE\": { value: 32767, writable: false }\r\n});\r\n\r\nObject.defineProperties(\r\n globalScope[\"i32\"] = globalScope[\"isize\"] = function i32(value) { return value | 0; }\r\n, {\r\n \"MIN_VALUE\": { value: -2147483648, writable: false },\r\n \"MAX_VALUE\": { value: 2147483647, writable: false }\r\n});\r\n\r\nObject.defineProperties(\r\n globalScope[\"u8\"] = function u8(value) { return value & 0xff; }\r\n, {\r\n \"MIN_VALUE\": { value: 0, writable: false },\r\n \"MAX_VALUE\": { value: 255, writable: false }\r\n});\r\n\r\nObject.defineProperties(\r\n globalScope[\"u16\"] = function u16(value) { return value & 0xffff; }\r\n, {\r\n \"MIN_VALUE\": { value: 0, writable: false },\r\n \"MAX_VALUE\": { value: 65535, writable: false }\r\n});\r\n\r\nObject.defineProperties(\r\n globalScope[\"u32\"] = globalScope[\"usize\"] = function u32(value) { return value >>> 0; }\r\n, {\r\n \"MIN_VALUE\": { value: 0, writable: false },\r\n \"MAX_VALUE\": { value: 4294967295, writable: false }\r\n});\r\n\r\nObject.defineProperties(\r\n globalScope[\"bool\"] = function bool(value) { return !!value; }\r\n, {\r\n \"MIN_VALUE\": { value: false, writable: false },\r\n \"MAX_VALUE\": { value: true, writable: false }\r\n});\r\n\r\nObject.defineProperties(\r\n globalScope[\"f32\"] = function f32(value) { return Math.fround(value); }\r\n, {\r\n \"EPSILON\": { value: Math.fround(1.1920929e-07), writable: false },\r\n \"MIN_VALUE\": { value: Math.fround(1.4012985e-45), writable: false },\r\n \"MAX_VALUE\": { value: Math.fround(3.4028235e+38), writable: false },\r\n \"MIN_NORMAL_VALUE\": { value: Math.fround(1.17549435e-38), writable: false },\r\n \"MIN_SAFE_INTEGER\": { value: -16777215, writable: false },\r\n \"MAX_SAFE_INTEGER\": { value: 16777215, writable: false }\r\n});\r\n\r\nObject.defineProperties(\r\n globalScope[\"f64\"] = function f64(value) { return +value; }\r\n, {\r\n \"EPSILON\": { value: 2.2204460492503131e-16, writable: false },\r\n \"MIN_VALUE\": { value: 5e-324, writable: false },\r\n \"MAX_VALUE\": { value: 1.7976931348623157e+308, writable: false },\r\n \"MIN_NORMAL_VALUE\": { value: 2.2250738585072014e-308 , writable: false },\r\n \"MIN_SAFE_INTEGER\": { value: -9007199254740991, writable: false },\r\n \"MAX_SAFE_INTEGER\": { value: 9007199254740991, writable: false }\r\n});\r\n\r\nglobalScope[\"clz\"] = Math.clz32;\r\n\r\nglobalScope[\"ctz\"] = function ctz(value) {\r\n var c = Math.clz32(value & -value);\r\n return value ? 31 - c : c;\r\n};\r\n\r\nglobalScope[\"popcnt\"] = function popcnt(value) {\r\n value -= value >>> 1 & 0x55555555;\r\n value = (value & 0x33333333) + (value >>> 2 & 0x33333333);\r\n return (((value + (value >>> 4)) & 0x0F0F0F0F) * 0x01010101) >>> 24;\r\n};\r\n\r\nglobalScope[\"rotl\"] = function rotl(value, shift) {\r\n shift &= 31;\r\n return (value << shift) | (value >>> (32 - shift));\r\n};\r\n\r\nglobalScope[\"rotr\"] = function rotr(value, shift) {\r\n shift &= 31;\r\n return (value >>> shift) | (value << (32 - shift));\r\n};\r\n\r\nglobalScope[\"abs\"] = Math.abs;\r\n\r\nglobalScope[\"max\"] = Math.max;\r\n\r\nglobalScope[\"min\"] = Math.min;\r\n\r\nglobalScope[\"ceil\"] = Math.ceil;\r\n\r\nglobalScope[\"floor\"] = Math.floor;\r\n\r\n// Adopt code from https://github.com/rfk/wasm-polyfill\r\nglobalScope[\"nearest\"] = function nearest(value) {\r\n if (Math.abs(value - Math.trunc(value)) === 0.5) {\r\n return 2.0 * Math.round(value * 0.5);\r\n }\r\n return Math.round(value);\r\n};\r\n\r\nglobalScope[\"select\"] = function select(ifTrue, ifFalse, condition) {\r\n return condition ? ifTrue : ifFalse;\r\n};\r\n\r\nglobalScope[\"sqrt\"] = Math.sqrt;\r\n\r\nglobalScope[\"trunc\"] = Math.trunc;\r\n\r\nglobalScope[\"copysign\"] = function copysign(x, y) {\r\n return Math.abs(x) * Math.sign(y);\r\n};\r\n\r\nglobalScope[\"bswap\"] = function bswap(value) {\r\n var a = value >> 8 & 0x00FF00FF;\r\n var b = (value & 0x00FF00FF) << 8;\r\n value = a | b;\r\n a = value >> 16 & 0x0000FFFF;\r\n b = (value & 0x0000FFFF) << 16;\r\n return a | b;\r\n};\r\n\r\nglobalScope[\"bswap16\"] = function bswap16(value) {\r\n return ((value << 8) & 0xFF00) | ((value >> 8) & 0x00FF) | (value & 0xFFFF0000);\r\n};\r\n\r\nfunction UnreachableError() {\r\n if (Error.captureStackTrace) {\r\n Error.captureStackTrace(this, UnreachableError);\r\n } else {\r\n this.stack = this.name + \": \" + this.message + \"\\n\" + new Error().stack;\r\n }\r\n}\r\nUnreachableError.prototype = Object.create(Error.prototype);\r\nUnreachableError.prototype.name = \"UnreachableError\";\r\nUnreachableError.prototype.message = \"unreachable\";\r\n\r\nglobalScope[\"unreachable\"] = function unreachable() {\r\n throw new UnreachableError();\r\n};\r\n\r\nfunction AssertionError(message) {\r\n this.message = message || \"assertion failed\";\r\n if (Error.captureStackTrace) {\r\n Error.captureStackTrace(this, AssertionError);\r\n } else {\r\n this.stack = this.name + \": \" + this.message + \"\\n\" + new Error().stack;\r\n }\r\n}\r\nAssertionError.prototype = Object.create(Error.prototype);\r\nAssertionError.prototype.name = \"AssertionError\";\r\n\r\nglobalScope[\"assert\"] = function assert(isTrueish, message) {\r\n if (isTrueish) return isTrueish;\r\n throw new AssertionError(message);\r\n};\r\n\r\nglobalScope[\"changetype\"] = function changetype(value) {\r\n return value;\r\n};\r\n\r\nglobalScope[\"parseI32\"] = function parseI32(str, radix) {\r\n return parseInt(str, undefined) | 0;\r\n};\r\n\r\nString[\"fromCharCodes\"] = function fromCharCodes(arr) {\r\n return String.fromCharCode.apply(String, arr);\r\n};\r\n\r\nString[\"fromCodePoints\"] = function fromCodePoints(arr) {\r\n return String.fromCodePoint.apply(String, arr);\r\n};\r\n\r\nglobalScope[\"isInteger\"] = Number.isInteger;\r\n\r\nglobalScope[\"isFloat\"] = function isFloat(arg) {\r\n return typeof arg === \"number\";\r\n};\r\n\r\nglobalScope[\"isNullable\"] = function isNullable(arg) {\r\n return true;\r\n}\r\n\r\nglobalScope[\"isReference\"] = function isReference(arg) {\r\n return typeof arg === \"object\" || typeof arg === \"string\";\r\n};\r\n\r\nglobalScope[\"isFunction\"] = function isFunction(arg) {\r\n return typeof arg === \"function\";\r\n}\r\n\r\nglobalScope[\"isString\"] = function isString(arg) {\r\n return typeof arg === \"string\" || arg instanceof String;\r\n};\r\n\r\nglobalScope[\"isArray\"] = Array.isArray;\r\nglobalScope[\"isArrayLike\"] = function isArrayLike(expr) {\r\n return expr\r\n && typeof expr === 'object'\r\n && typeof expr.length === 'number'\r\n && expr.length >= 0\r\n && Math.trunc(expr.length) === expr.length;\r\n}\r\n\r\nglobalScope[\"isDefined\"] = function isDefined(expr) {\r\n return typeof expr !== \"undefined\";\r\n}\r\n\r\nglobalScope[\"isConstant\"] = function isConstant(expr) {\r\n return false;\r\n};\r\n\r\nglobalScope[\"unchecked\"] = function unchecked(expr) {\r\n return expr;\r\n};\r\n\r\nglobalScope[\"fmod\"] = function fmod(x, y) {\r\n return x % y;\r\n};\r\n\r\nglobalScope[\"fmodf\"] = function fmodf(x, y) {\r\n return Math.fround(x % y);\r\n};\r\n\r\nglobalScope[\"JSMath\"] = Math;\r\n\r\nObject.defineProperties(globalScope[\"JSMath\"], {\r\n sincos_sin: { value: 0.0, writable: true },\r\n sincos_cos: { value: 0.0, writable: true },\r\n signbit: {\r\n value: function signbit(x) {\r\n F64[0] = x; return Boolean((U64[1] >>> 31) & (x == x));\r\n }\r\n },\r\n sincos: {\r\n value: function sincos(x) {\r\n this.sincos_sin = Math.sin(x);\r\n this.sincos_cos = Math.cos(x);\r\n }\r\n }\r\n});\r\n\r\nglobalScope[\"memory\"] = (() => {\r\n var HEAP = new Uint8Array(0);\r\n var HEAP_OFFSET = 0;\r\n return {\r\n allocate: globalScope[\"__memory_allocate\"] || function allocate(size) {\r\n if (!(size >>>= 0)) return 0;\r\n if (HEAP_OFFSET + size > HEAP.length) {\r\n var oldHeap = HEAP;\r\n HEAP = new Uint8Array(Math.max(65536, HEAP.length + size, HEAP.length * 2));\r\n HEAP.set(oldHeap);\r\n }\r\n var ptr = HEAP_OFFSET;\r\n if ((HEAP_OFFSET += size) & 7) HEAP_OFFSET = (HEAP_OFFSET | 7) + 1;\r\n return ptr;\r\n },\r\n fill: globalScope[\"__memory_fill\"] || function fill(dest, value, size) {\r\n HEAP.fill(value, dest, dest + size);\r\n },\r\n free: globalScope[\"__memory_free\"] || function free(ptr) { },\r\n copy: globalScope[\"__memory_copy\"] || function copy(dest, src, size) {\r\n HEAP.copyWithin(dest, src, src + size);\r\n },\r\n reset: globalScope[\"__memory_reset\"] || function reset() {\r\n HEAP = new Uint8Array(0);\r\n HEAP_OFFSET = 0;\r\n }\r\n };\r\n})();\r\n\r\nglobalScope[\"store\"] = globalScope[\"__store\"] || function store(ptr, value, offset) {\r\n HEAP[(ptr | 0) + (offset | 0)] = value;\r\n};\r\n\r\nglobalScope[\"load\"] = globalScope[\"__load\"] || function load(ptr, offset) {\r\n return HEAP[(ptr | 0) + (offset | 0)];\r\n};\r\n","const F64 = new Float64Array(1);\r\nconst F32 = new Float32Array(F64.buffer);\r\nconst I32 = new Int32Array(F64.buffer);\r\n\r\nglobal.f32_as_i32 = function(value) {\r\n F32[0] = value;\r\n return I32[0];\r\n};\r\n\r\nglobal.i32_as_f32 = function(value) {\r\n I32[0] = value;\r\n return F32[0];\r\n};\r\n\r\nglobal.f64_as_i64 = function(value) {\r\n F64[0] = value;\r\n return i64_new(I32[0], I32[1]);\r\n};\r\n\r\nglobal.i64_as_f64 = function(value) {\r\n I32[0] = i64_low(value);\r\n I32[1] = i64_high(value);\r\n return F64[0];\r\n};\r\n","const Long = global.Long || require(\"long\");\r\n\r\nglobal.i64_zero = Long.ZERO;\r\n\r\nglobal.i64_one = Long.ONE;\r\n\r\nglobal.i64_new = function(lo, hi) {\r\n return Long.fromBits(lo, hi);\r\n};\r\n\r\nglobal.i64_low = function(value) {\r\n return value.low;\r\n};\r\n\r\nglobal.i64_high = function(value) {\r\n return value.high;\r\n};\r\n\r\nglobal.i64_add = function(left, right) {\r\n return left.add(right);\r\n};\r\n\r\nglobal.i64_sub = function(left, right) {\r\n return left.sub(right);\r\n};\r\n\r\nglobal.i64_mul = function(left, right) {\r\n return left.mul(right);\r\n};\r\n\r\nglobal.i64_div = function(left, right) {\r\n return left.div(right);\r\n};\r\n\r\nglobal.i64_div_u = function(left, right) {\r\n return left.toUnsigned().div(right.toUnsigned()).toSigned();\r\n};\r\n\r\nglobal.i64_rem = function(left, right) {\r\n return left.mod(right);\r\n};\r\n\r\nglobal.i64_rem_u = function(left, right) {\r\n return left.toUnsigned().mod(right.toUnsigned()).toSigned();\r\n};\r\n\r\nglobal.i64_and = function(left, right) {\r\n return left.and(right);\r\n};\r\n\r\nglobal.i64_or = function(left, right) {\r\n return left.or(right);\r\n};\r\n\r\nglobal.i64_xor = function(left, right) {\r\n return left.xor(right);\r\n};\r\n\r\nglobal.i64_shl = function(left, right) {\r\n return left.shl(right);\r\n};\r\n\r\nglobal.i64_shr = function(left, right) {\r\n return left.shr(right);\r\n};\r\n\r\nglobal.i64_shr_u = function(left, right) {\r\n return left.shru(right);\r\n};\r\n\r\nglobal.i64_not = function(value) {\r\n return value.not();\r\n};\r\n\r\nglobal.i64_eq = function(left, right) {\r\n return left.eq(right);\r\n};\r\n\r\nglobal.i64_ne = function(left, right) {\r\n return left.ne(right);\r\n};\r\n\r\nglobal.i64_align = function(value, alignment) {\r\n assert(alignment && (alignment & (alignment - 1)) == 0);\r\n var mask = Long.fromInt(alignment - 1);\r\n return value.add(mask).and(mask.not());\r\n};\r\n\r\nglobal.i64_is_i8 = function(value) {\r\n return value.high === 0 && (value.low >= 0 && value.low <= i8.MAX_VALUE)\r\n || value.high === -1 && (value.low >= i8.MIN_VALUE && value.low < 0);\r\n};\r\n\r\nglobal.i64_is_i16 = function(value) {\r\n return value.high === 0 && (value.low >= 0 && value.low <= i16.MAX_VALUE)\r\n || value.high === -1 && (value.low >= i16.MIN_VALUE && value.low < 0);\r\n};\r\n\r\nglobal.i64_is_i32 = function(value) {\r\n return (value.high === 0 && value.low >= 0)\r\n || (value.high === -1 && value.low < 0);\r\n};\r\n\r\nglobal.i64_is_u8 = function(value) {\r\n return value.high === 0 && value.low >= 0 && value.low <= u8.MAX_VALUE;\r\n};\r\n\r\nglobal.i64_is_u16 = function(value) {\r\n return value.high === 0 && value.low >= 0 && value.low <= u16.MAX_VALUE;\r\n};\r\n\r\nglobal.i64_is_u32 = function(value) {\r\n return value.high === 0;\r\n};\r\n\r\nglobal.i64_is_bool = function(value) {\r\n return value.high === 0 && (value.low === 0 || value.low === 1);\r\n};\r\n\r\nconst minSafeF32 = Long.fromNumber(f32.MIN_SAFE_INTEGER);\r\nconst maxSafeF32 = Long.fromNumber(f32.MAX_SAFE_INTEGER);\r\n\r\nglobal.i64_is_f32 = function(value) {\r\n return value.gte(minSafeF32) && value.lte(maxSafeF32);\r\n};\r\n\r\nconst minSafeF64 = Long.fromNumber(f64.MIN_SAFE_INTEGER);\r\nconst maxSafeF64 = Long.fromNumber(f64.MAX_SAFE_INTEGER);\r\n\r\nglobal.i64_is_f64 = function(value) {\r\n return value.gte(minSafeF64) && value.lte(maxSafeF64);\r\n};\r\n\r\nglobal.i64_to_f32 = function(value) {\r\n return global.Math.fround(value.toNumber());\r\n};\r\n\r\nglobal.i64_to_f64 = function(value) {\r\n return value.toNumber();\r\n};\r\n\r\nglobal.i64_to_string = function(value, unsigned) {\r\n return (unsigned ? value.toUnsigned() : value).toString(10);\r\n};\r\n","module.exports = Long;\r\n\r\n/**\r\n * wasm optimizations, to do native i64 multiplication and divide\r\n */\r\nvar wasm = null;\r\n\r\ntry {\r\n wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([\r\n 0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11\r\n ])), {}).exports;\r\n} catch (e) {\r\n // no wasm support :(\r\n}\r\n\r\n/**\r\n * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers.\r\n * See the from* functions below for more convenient ways of constructing Longs.\r\n * @exports Long\r\n * @class A Long class for representing a 64 bit two's-complement integer value.\r\n * @param {number} low The low (signed) 32 bits of the long\r\n * @param {number} high The high (signed) 32 bits of the long\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @constructor\r\n */\r\nfunction Long(low, high, unsigned) {\r\n\r\n /**\r\n * The low 32 bits as a signed value.\r\n * @type {number}\r\n */\r\n this.low = low | 0;\r\n\r\n /**\r\n * The high 32 bits as a signed value.\r\n * @type {number}\r\n */\r\n this.high = high | 0;\r\n\r\n /**\r\n * Whether unsigned or not.\r\n * @type {boolean}\r\n */\r\n this.unsigned = !!unsigned;\r\n}\r\n\r\n// The internal representation of a long is the two given signed, 32-bit values.\r\n// We use 32-bit pieces because these are the size of integers on which\r\n// Javascript performs bit-operations. For operations like addition and\r\n// multiplication, we split each number into 16 bit pieces, which can easily be\r\n// multiplied within Javascript's floating-point representation without overflow\r\n// or change in sign.\r\n//\r\n// In the algorithms below, we frequently reduce the negative case to the\r\n// positive case by negating the input(s) and then post-processing the result.\r\n// Note that we must ALWAYS check specially whether those values are MIN_VALUE\r\n// (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as\r\n// a positive number, it overflows back into a negative). Not handling this\r\n// case would often result in infinite recursion.\r\n//\r\n// Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from*\r\n// methods on which they depend.\r\n\r\n/**\r\n * An indicator used to reliably determine if an object is a Long or not.\r\n * @type {boolean}\r\n * @const\r\n * @private\r\n */\r\nLong.prototype.__isLong__;\r\n\r\nObject.defineProperty(Long.prototype, \"__isLong__\", { value: true });\r\n\r\n/**\r\n * @function\r\n * @param {*} obj Object\r\n * @returns {boolean}\r\n * @inner\r\n */\r\nfunction isLong(obj) {\r\n return (obj && obj[\"__isLong__\"]) === true;\r\n}\r\n\r\n/**\r\n * Tests if the specified object is a Long.\r\n * @function\r\n * @param {*} obj Object\r\n * @returns {boolean}\r\n */\r\nLong.isLong = isLong;\r\n\r\n/**\r\n * A cache of the Long representations of small integer values.\r\n * @type {!Object}\r\n * @inner\r\n */\r\nvar INT_CACHE = {};\r\n\r\n/**\r\n * A cache of the Long representations of small unsigned integer values.\r\n * @type {!Object}\r\n * @inner\r\n */\r\nvar UINT_CACHE = {};\r\n\r\n/**\r\n * @param {number} value\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromInt(value, unsigned) {\r\n var obj, cachedObj, cache;\r\n if (unsigned) {\r\n value >>>= 0;\r\n if (cache = (0 <= value && value < 256)) {\r\n cachedObj = UINT_CACHE[value];\r\n if (cachedObj)\r\n return cachedObj;\r\n }\r\n obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true);\r\n if (cache)\r\n UINT_CACHE[value] = obj;\r\n return obj;\r\n } else {\r\n value |= 0;\r\n if (cache = (-128 <= value && value < 128)) {\r\n cachedObj = INT_CACHE[value];\r\n if (cachedObj)\r\n return cachedObj;\r\n }\r\n obj = fromBits(value, value < 0 ? -1 : 0, false);\r\n if (cache)\r\n INT_CACHE[value] = obj;\r\n return obj;\r\n }\r\n}\r\n\r\n/**\r\n * Returns a Long representing the given 32 bit integer value.\r\n * @function\r\n * @param {number} value The 32 bit integer in question\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long} The corresponding Long value\r\n */\r\nLong.fromInt = fromInt;\r\n\r\n/**\r\n * @param {number} value\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromNumber(value, unsigned) {\r\n if (isNaN(value))\r\n return unsigned ? UZERO : ZERO;\r\n if (unsigned) {\r\n if (value < 0)\r\n return UZERO;\r\n if (value >= TWO_PWR_64_DBL)\r\n return MAX_UNSIGNED_VALUE;\r\n } else {\r\n if (value <= -TWO_PWR_63_DBL)\r\n return MIN_VALUE;\r\n if (value + 1 >= TWO_PWR_63_DBL)\r\n return MAX_VALUE;\r\n }\r\n if (value < 0)\r\n return fromNumber(-value, unsigned).neg();\r\n return fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned);\r\n}\r\n\r\n/**\r\n * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.\r\n * @function\r\n * @param {number} value The number in question\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long} The corresponding Long value\r\n */\r\nLong.fromNumber = fromNumber;\r\n\r\n/**\r\n * @param {number} lowBits\r\n * @param {number} highBits\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromBits(lowBits, highBits, unsigned) {\r\n return new Long(lowBits, highBits, unsigned);\r\n}\r\n\r\n/**\r\n * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is\r\n * assumed to use 32 bits.\r\n * @function\r\n * @param {number} lowBits The low 32 bits\r\n * @param {number} highBits The high 32 bits\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long} The corresponding Long value\r\n */\r\nLong.fromBits = fromBits;\r\n\r\n/**\r\n * @function\r\n * @param {number} base\r\n * @param {number} exponent\r\n * @returns {number}\r\n * @inner\r\n */\r\nvar pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4)\r\n\r\n/**\r\n * @param {string} str\r\n * @param {(boolean|number)=} unsigned\r\n * @param {number=} radix\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromString(str, unsigned, radix) {\r\n if (str.length === 0)\r\n throw Error('empty string');\r\n if (str === \"NaN\" || str === \"Infinity\" || str === \"+Infinity\" || str === \"-Infinity\")\r\n return ZERO;\r\n if (typeof unsigned === 'number') {\r\n // For goog.math.long compatibility\r\n radix = unsigned,\r\n unsigned = false;\r\n } else {\r\n unsigned = !! unsigned;\r\n }\r\n radix = radix || 10;\r\n if (radix < 2 || 36 < radix)\r\n throw RangeError('radix');\r\n\r\n var p;\r\n if ((p = str.indexOf('-')) > 0)\r\n throw Error('interior hyphen');\r\n else if (p === 0) {\r\n return fromString(str.substring(1), unsigned, radix).neg();\r\n }\r\n\r\n // Do several (8) digits each time through the loop, so as to\r\n // minimize the calls to the very expensive emulated div.\r\n var radixToPower = fromNumber(pow_dbl(radix, 8));\r\n\r\n var result = ZERO;\r\n for (var i = 0; i < str.length; i += 8) {\r\n var size = Math.min(8, str.length - i),\r\n value = parseInt(str.substring(i, i + size), radix);\r\n if (size < 8) {\r\n var power = fromNumber(pow_dbl(radix, size));\r\n result = result.mul(power).add(fromNumber(value));\r\n } else {\r\n result = result.mul(radixToPower);\r\n result = result.add(fromNumber(value));\r\n }\r\n }\r\n result.unsigned = unsigned;\r\n return result;\r\n}\r\n\r\n/**\r\n * Returns a Long representation of the given string, written using the specified radix.\r\n * @function\r\n * @param {string} str The textual representation of the Long\r\n * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to signed\r\n * @param {number=} radix The radix in which the text is written (2-36), defaults to 10\r\n * @returns {!Long} The corresponding Long value\r\n */\r\nLong.fromString = fromString;\r\n\r\n/**\r\n * @function\r\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromValue(val, unsigned) {\r\n if (typeof val === 'number')\r\n return fromNumber(val, unsigned);\r\n if (typeof val === 'string')\r\n return fromString(val, unsigned);\r\n // Throws for non-objects, converts non-instanceof Long:\r\n return fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned);\r\n}\r\n\r\n/**\r\n * Converts the specified value to a Long using the appropriate from* function for its type.\r\n * @function\r\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val Value\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long}\r\n */\r\nLong.fromValue = fromValue;\r\n\r\n// NOTE: the compiler should inline these constant values below and then remove these variables, so there should be\r\n// no runtime penalty for these.\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_16_DBL = 1 << 16;\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_24_DBL = 1 << 24;\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL;\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL;\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2;\r\n\r\n/**\r\n * @type {!Long}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_24 = fromInt(TWO_PWR_24_DBL);\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar ZERO = fromInt(0);\r\n\r\n/**\r\n * Signed zero.\r\n * @type {!Long}\r\n */\r\nLong.ZERO = ZERO;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar UZERO = fromInt(0, true);\r\n\r\n/**\r\n * Unsigned zero.\r\n * @type {!Long}\r\n */\r\nLong.UZERO = UZERO;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar ONE = fromInt(1);\r\n\r\n/**\r\n * Signed one.\r\n * @type {!Long}\r\n */\r\nLong.ONE = ONE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar UONE = fromInt(1, true);\r\n\r\n/**\r\n * Unsigned one.\r\n * @type {!Long}\r\n */\r\nLong.UONE = UONE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar NEG_ONE = fromInt(-1);\r\n\r\n/**\r\n * Signed negative one.\r\n * @type {!Long}\r\n */\r\nLong.NEG_ONE = NEG_ONE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar MAX_VALUE = fromBits(0xFFFFFFFF|0, 0x7FFFFFFF|0, false);\r\n\r\n/**\r\n * Maximum signed value.\r\n * @type {!Long}\r\n */\r\nLong.MAX_VALUE = MAX_VALUE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF|0, 0xFFFFFFFF|0, true);\r\n\r\n/**\r\n * Maximum unsigned value.\r\n * @type {!Long}\r\n */\r\nLong.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar MIN_VALUE = fromBits(0, 0x80000000|0, false);\r\n\r\n/**\r\n * Minimum signed value.\r\n * @type {!Long}\r\n */\r\nLong.MIN_VALUE = MIN_VALUE;\r\n\r\n/**\r\n * @alias Long.prototype\r\n * @inner\r\n */\r\nvar LongPrototype = Long.prototype;\r\n\r\n/**\r\n * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer.\r\n * @returns {number}\r\n */\r\nLongPrototype.toInt = function toInt() {\r\n return this.unsigned ? this.low >>> 0 : this.low;\r\n};\r\n\r\n/**\r\n * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa).\r\n * @returns {number}\r\n */\r\nLongPrototype.toNumber = function toNumber() {\r\n if (this.unsigned)\r\n return ((this.high >>> 0) * TWO_PWR_32_DBL) + (this.low >>> 0);\r\n return this.high * TWO_PWR_32_DBL + (this.low >>> 0);\r\n};\r\n\r\n/**\r\n * Converts the Long to a string written in the specified radix.\r\n * @param {number=} radix Radix (2-36), defaults to 10\r\n * @returns {string}\r\n * @override\r\n * @throws {RangeError} If `radix` is out of range\r\n */\r\nLongPrototype.toString = function toString(radix) {\r\n radix = radix || 10;\r\n if (radix < 2 || 36 < radix)\r\n throw RangeError('radix');\r\n if (this.isZero())\r\n return '0';\r\n if (this.isNegative()) { // Unsigned Longs are never negative\r\n if (this.eq(MIN_VALUE)) {\r\n // We need to change the Long value before it can be negated, so we remove\r\n // the bottom-most digit in this base and then recurse to do the rest.\r\n var radixLong = fromNumber(radix),\r\n div = this.div(radixLong),\r\n rem1 = div.mul(radixLong).sub(this);\r\n return div.toString(radix) + rem1.toInt().toString(radix);\r\n } else\r\n return '-' + this.neg().toString(radix);\r\n }\r\n\r\n // Do several (6) digits each time through the loop, so as to\r\n // minimize the calls to the very expensive emulated div.\r\n var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned),\r\n rem = this;\r\n var result = '';\r\n while (true) {\r\n var remDiv = rem.div(radixToPower),\r\n intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0,\r\n digits = intval.toString(radix);\r\n rem = remDiv;\r\n if (rem.isZero())\r\n return digits + result;\r\n else {\r\n while (digits.length < 6)\r\n digits = '0' + digits;\r\n result = '' + digits + result;\r\n }\r\n }\r\n};\r\n\r\n/**\r\n * Gets the high 32 bits as a signed integer.\r\n * @returns {number} Signed high bits\r\n */\r\nLongPrototype.getHighBits = function getHighBits() {\r\n return this.high;\r\n};\r\n\r\n/**\r\n * Gets the high 32 bits as an unsigned integer.\r\n * @returns {number} Unsigned high bits\r\n */\r\nLongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() {\r\n return this.high >>> 0;\r\n};\r\n\r\n/**\r\n * Gets the low 32 bits as a signed integer.\r\n * @returns {number} Signed low bits\r\n */\r\nLongPrototype.getLowBits = function getLowBits() {\r\n return this.low;\r\n};\r\n\r\n/**\r\n * Gets the low 32 bits as an unsigned integer.\r\n * @returns {number} Unsigned low bits\r\n */\r\nLongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() {\r\n return this.low >>> 0;\r\n};\r\n\r\n/**\r\n * Gets the number of bits needed to represent the absolute value of this Long.\r\n * @returns {number}\r\n */\r\nLongPrototype.getNumBitsAbs = function getNumBitsAbs() {\r\n if (this.isNegative()) // Unsigned Longs are never negative\r\n return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs();\r\n var val = this.high != 0 ? this.high : this.low;\r\n for (var bit = 31; bit > 0; bit--)\r\n if ((val & (1 << bit)) != 0)\r\n break;\r\n return this.high != 0 ? bit + 33 : bit + 1;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value equals zero.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isZero = function isZero() {\r\n return this.high === 0 && this.low === 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value equals zero. This is an alias of {@link Long#isZero}.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.eqz = LongPrototype.isZero;\r\n\r\n/**\r\n * Tests if this Long's value is negative.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isNegative = function isNegative() {\r\n return !this.unsigned && this.high < 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is positive.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isPositive = function isPositive() {\r\n return this.unsigned || this.high >= 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is odd.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isOdd = function isOdd() {\r\n return (this.low & 1) === 1;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is even.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isEven = function isEven() {\r\n return (this.low & 1) === 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value equals the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.equals = function equals(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n if (this.unsigned !== other.unsigned && (this.high >>> 31) === 1 && (other.high >>> 31) === 1)\r\n return false;\r\n return this.high === other.high && this.low === other.low;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.eq = LongPrototype.equals;\r\n\r\n/**\r\n * Tests if this Long's value differs from the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.notEquals = function notEquals(other) {\r\n return !this.eq(/* validates */ other);\r\n};\r\n\r\n/**\r\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.neq = LongPrototype.notEquals;\r\n\r\n/**\r\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.ne = LongPrototype.notEquals;\r\n\r\n/**\r\n * Tests if this Long's value is less than the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.lessThan = function lessThan(other) {\r\n return this.comp(/* validates */ other) < 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.lt = LongPrototype.lessThan;\r\n\r\n/**\r\n * Tests if this Long's value is less than or equal the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.lessThanOrEqual = function lessThanOrEqual(other) {\r\n return this.comp(/* validates */ other) <= 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.lte = LongPrototype.lessThanOrEqual;\r\n\r\n/**\r\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.le = LongPrototype.lessThanOrEqual;\r\n\r\n/**\r\n * Tests if this Long's value is greater than the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.greaterThan = function greaterThan(other) {\r\n return this.comp(/* validates */ other) > 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.gt = LongPrototype.greaterThan;\r\n\r\n/**\r\n * Tests if this Long's value is greater than or equal the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) {\r\n return this.comp(/* validates */ other) >= 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.gte = LongPrototype.greaterThanOrEqual;\r\n\r\n/**\r\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.ge = LongPrototype.greaterThanOrEqual;\r\n\r\n/**\r\n * Compares this Long's value with the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\r\n * if the given one is greater\r\n */\r\nLongPrototype.compare = function compare(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n if (this.eq(other))\r\n return 0;\r\n var thisNeg = this.isNegative(),\r\n otherNeg = other.isNegative();\r\n if (thisNeg && !otherNeg)\r\n return -1;\r\n if (!thisNeg && otherNeg)\r\n return 1;\r\n // At this point the sign bits are the same\r\n if (!this.unsigned)\r\n return this.sub(other).isNegative() ? -1 : 1;\r\n // Both are positive if at least one is unsigned\r\n return (other.high >>> 0) > (this.high >>> 0) || (other.high === this.high && (other.low >>> 0) > (this.low >>> 0)) ? -1 : 1;\r\n};\r\n\r\n/**\r\n * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\r\n * if the given one is greater\r\n */\r\nLongPrototype.comp = LongPrototype.compare;\r\n\r\n/**\r\n * Negates this Long's value.\r\n * @returns {!Long} Negated Long\r\n */\r\nLongPrototype.negate = function negate() {\r\n if (!this.unsigned && this.eq(MIN_VALUE))\r\n return MIN_VALUE;\r\n return this.not().add(ONE);\r\n};\r\n\r\n/**\r\n * Negates this Long's value. This is an alias of {@link Long#negate}.\r\n * @function\r\n * @returns {!Long} Negated Long\r\n */\r\nLongPrototype.neg = LongPrototype.negate;\r\n\r\n/**\r\n * Returns the sum of this and the specified Long.\r\n * @param {!Long|number|string} addend Addend\r\n * @returns {!Long} Sum\r\n */\r\nLongPrototype.add = function add(addend) {\r\n if (!isLong(addend))\r\n addend = fromValue(addend);\r\n\r\n // Divide each number into 4 chunks of 16 bits, and then sum the chunks.\r\n\r\n var a48 = this.high >>> 16;\r\n var a32 = this.high & 0xFFFF;\r\n var a16 = this.low >>> 16;\r\n var a00 = this.low & 0xFFFF;\r\n\r\n var b48 = addend.high >>> 16;\r\n var b32 = addend.high & 0xFFFF;\r\n var b16 = addend.low >>> 16;\r\n var b00 = addend.low & 0xFFFF;\r\n\r\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\r\n c00 += a00 + b00;\r\n c16 += c00 >>> 16;\r\n c00 &= 0xFFFF;\r\n c16 += a16 + b16;\r\n c32 += c16 >>> 16;\r\n c16 &= 0xFFFF;\r\n c32 += a32 + b32;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c48 += a48 + b48;\r\n c48 &= 0xFFFF;\r\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the difference of this and the specified Long.\r\n * @param {!Long|number|string} subtrahend Subtrahend\r\n * @returns {!Long} Difference\r\n */\r\nLongPrototype.subtract = function subtract(subtrahend) {\r\n if (!isLong(subtrahend))\r\n subtrahend = fromValue(subtrahend);\r\n return this.add(subtrahend.neg());\r\n};\r\n\r\n/**\r\n * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}.\r\n * @function\r\n * @param {!Long|number|string} subtrahend Subtrahend\r\n * @returns {!Long} Difference\r\n */\r\nLongPrototype.sub = LongPrototype.subtract;\r\n\r\n/**\r\n * Returns the product of this and the specified Long.\r\n * @param {!Long|number|string} multiplier Multiplier\r\n * @returns {!Long} Product\r\n */\r\nLongPrototype.multiply = function multiply(multiplier) {\r\n if (this.isZero())\r\n return ZERO;\r\n if (!isLong(multiplier))\r\n multiplier = fromValue(multiplier);\r\n\r\n // use wasm support if present\r\n if (wasm) {\r\n var low = wasm.mul(this.low,\r\n this.high,\r\n multiplier.low,\r\n multiplier.high);\r\n return fromBits(low, wasm.get_high(), this.unsigned);\r\n }\r\n\r\n if (multiplier.isZero())\r\n return ZERO;\r\n if (this.eq(MIN_VALUE))\r\n return multiplier.isOdd() ? MIN_VALUE : ZERO;\r\n if (multiplier.eq(MIN_VALUE))\r\n return this.isOdd() ? MIN_VALUE : ZERO;\r\n\r\n if (this.isNegative()) {\r\n if (multiplier.isNegative())\r\n return this.neg().mul(multiplier.neg());\r\n else\r\n return this.neg().mul(multiplier).neg();\r\n } else if (multiplier.isNegative())\r\n return this.mul(multiplier.neg()).neg();\r\n\r\n // If both longs are small, use float multiplication\r\n if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24))\r\n return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned);\r\n\r\n // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products.\r\n // We can skip products that would overflow.\r\n\r\n var a48 = this.high >>> 16;\r\n var a32 = this.high & 0xFFFF;\r\n var a16 = this.low >>> 16;\r\n var a00 = this.low & 0xFFFF;\r\n\r\n var b48 = multiplier.high >>> 16;\r\n var b32 = multiplier.high & 0xFFFF;\r\n var b16 = multiplier.low >>> 16;\r\n var b00 = multiplier.low & 0xFFFF;\r\n\r\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\r\n c00 += a00 * b00;\r\n c16 += c00 >>> 16;\r\n c00 &= 0xFFFF;\r\n c16 += a16 * b00;\r\n c32 += c16 >>> 16;\r\n c16 &= 0xFFFF;\r\n c16 += a00 * b16;\r\n c32 += c16 >>> 16;\r\n c16 &= 0xFFFF;\r\n c32 += a32 * b00;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c32 += a16 * b16;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c32 += a00 * b32;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;\r\n c48 &= 0xFFFF;\r\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}.\r\n * @function\r\n * @param {!Long|number|string} multiplier Multiplier\r\n * @returns {!Long} Product\r\n */\r\nLongPrototype.mul = LongPrototype.multiply;\r\n\r\n/**\r\n * Returns this Long divided by the specified. The result is signed if this Long is signed or\r\n * unsigned if this Long is unsigned.\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Quotient\r\n */\r\nLongPrototype.divide = function divide(divisor) {\r\n if (!isLong(divisor))\r\n divisor = fromValue(divisor);\r\n if (divisor.isZero())\r\n throw Error('division by zero');\r\n\r\n // use wasm support if present\r\n if (wasm) {\r\n // guard against signed division overflow: the largest\r\n // negative number / -1 would be 1 larger than the largest\r\n // positive number, due to two's complement.\r\n if (!this.unsigned &&\r\n this.high === -0x80000000 &&\r\n divisor.low === -1 && divisor.high === -1) {\r\n // be consistent with non-wasm code path\r\n return this;\r\n }\r\n var low = (this.unsigned ? wasm.div_u : wasm.div_s)(\r\n this.low,\r\n this.high,\r\n divisor.low,\r\n divisor.high\r\n );\r\n return fromBits(low, wasm.get_high(), this.unsigned);\r\n }\r\n\r\n if (this.isZero())\r\n return this.unsigned ? UZERO : ZERO;\r\n var approx, rem, res;\r\n if (!this.unsigned) {\r\n // This section is only relevant for signed longs and is derived from the\r\n // closure library as a whole.\r\n if (this.eq(MIN_VALUE)) {\r\n if (divisor.eq(ONE) || divisor.eq(NEG_ONE))\r\n return MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE\r\n else if (divisor.eq(MIN_VALUE))\r\n return ONE;\r\n else {\r\n // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.\r\n var halfThis = this.shr(1);\r\n approx = halfThis.div(divisor).shl(1);\r\n if (approx.eq(ZERO)) {\r\n return divisor.isNegative() ? ONE : NEG_ONE;\r\n } else {\r\n rem = this.sub(divisor.mul(approx));\r\n res = approx.add(rem.div(divisor));\r\n return res;\r\n }\r\n }\r\n } else if (divisor.eq(MIN_VALUE))\r\n return this.unsigned ? UZERO : ZERO;\r\n if (this.isNegative()) {\r\n if (divisor.isNegative())\r\n return this.neg().div(divisor.neg());\r\n return this.neg().div(divisor).neg();\r\n } else if (divisor.isNegative())\r\n return this.div(divisor.neg()).neg();\r\n res = ZERO;\r\n } else {\r\n // The algorithm below has not been made for unsigned longs. It's therefore\r\n // required to take special care of the MSB prior to running it.\r\n if (!divisor.unsigned)\r\n divisor = divisor.toUnsigned();\r\n if (divisor.gt(this))\r\n return UZERO;\r\n if (divisor.gt(this.shru(1))) // 15 >>> 1 = 7 ; with divisor = 8 ; true\r\n return UONE;\r\n res = UZERO;\r\n }\r\n\r\n // Repeat the following until the remainder is less than other: find a\r\n // floating-point that approximates remainder / other *from below*, add this\r\n // into the result, and subtract it from the remainder. It is critical that\r\n // the approximate value is less than or equal to the real value so that the\r\n // remainder never becomes negative.\r\n rem = this;\r\n while (rem.gte(divisor)) {\r\n // Approximate the result of division. This may be a little greater or\r\n // smaller than the actual value.\r\n approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber()));\r\n\r\n // We will tweak the approximate result by changing it in the 48-th digit or\r\n // the smallest non-fractional digit, whichever is larger.\r\n var log2 = Math.ceil(Math.log(approx) / Math.LN2),\r\n delta = (log2 <= 48) ? 1 : pow_dbl(2, log2 - 48),\r\n\r\n // Decrease the approximation until it is smaller than the remainder. Note\r\n // that if it is too large, the product overflows and is negative.\r\n approxRes = fromNumber(approx),\r\n approxRem = approxRes.mul(divisor);\r\n while (approxRem.isNegative() || approxRem.gt(rem)) {\r\n approx -= delta;\r\n approxRes = fromNumber(approx, this.unsigned);\r\n approxRem = approxRes.mul(divisor);\r\n }\r\n\r\n // We know the answer can't be zero... and actually, zero would cause\r\n // infinite recursion since we would make no progress.\r\n if (approxRes.isZero())\r\n approxRes = ONE;\r\n\r\n res = res.add(approxRes);\r\n rem = rem.sub(approxRem);\r\n }\r\n return res;\r\n};\r\n\r\n/**\r\n * Returns this Long divided by the specified. This is an alias of {@link Long#divide}.\r\n * @function\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Quotient\r\n */\r\nLongPrototype.div = LongPrototype.divide;\r\n\r\n/**\r\n * Returns this Long modulo the specified.\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Remainder\r\n */\r\nLongPrototype.modulo = function modulo(divisor) {\r\n if (!isLong(divisor))\r\n divisor = fromValue(divisor);\r\n\r\n // use wasm support if present\r\n if (wasm) {\r\n var low = (this.unsigned ? wasm.rem_u : wasm.rem_s)(\r\n this.low,\r\n this.high,\r\n divisor.low,\r\n divisor.high\r\n );\r\n return fromBits(low, wasm.get_high(), this.unsigned);\r\n }\r\n\r\n return this.sub(this.div(divisor).mul(divisor));\r\n};\r\n\r\n/**\r\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\r\n * @function\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Remainder\r\n */\r\nLongPrototype.mod = LongPrototype.modulo;\r\n\r\n/**\r\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\r\n * @function\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Remainder\r\n */\r\nLongPrototype.rem = LongPrototype.modulo;\r\n\r\n/**\r\n * Returns the bitwise NOT of this Long.\r\n * @returns {!Long}\r\n */\r\nLongPrototype.not = function not() {\r\n return fromBits(~this.low, ~this.high, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the bitwise AND of this Long and the specified.\r\n * @param {!Long|number|string} other Other Long\r\n * @returns {!Long}\r\n */\r\nLongPrototype.and = function and(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n return fromBits(this.low & other.low, this.high & other.high, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the bitwise OR of this Long and the specified.\r\n * @param {!Long|number|string} other Other Long\r\n * @returns {!Long}\r\n */\r\nLongPrototype.or = function or(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n return fromBits(this.low | other.low, this.high | other.high, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the bitwise XOR of this Long and the given one.\r\n * @param {!Long|number|string} other Other Long\r\n * @returns {!Long}\r\n */\r\nLongPrototype.xor = function xor(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns this Long with bits shifted to the left by the given amount.\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shiftLeft = function shiftLeft(numBits) {\r\n if (isLong(numBits))\r\n numBits = numBits.toInt();\r\n if ((numBits &= 63) === 0)\r\n return this;\r\n else if (numBits < 32)\r\n return fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned);\r\n else\r\n return fromBits(0, this.low << (numBits - 32), this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shl = LongPrototype.shiftLeft;\r\n\r\n/**\r\n * Returns this Long with bits arithmetically shifted to the right by the given amount.\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shiftRight = function shiftRight(numBits) {\r\n if (isLong(numBits))\r\n numBits = numBits.toInt();\r\n if ((numBits &= 63) === 0)\r\n return this;\r\n else if (numBits < 32)\r\n return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned);\r\n else\r\n return fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shr = LongPrototype.shiftRight;\r\n\r\n/**\r\n * Returns this Long with bits logically shifted to the right by the given amount.\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) {\r\n if (isLong(numBits))\r\n numBits = numBits.toInt();\r\n numBits &= 63;\r\n if (numBits === 0)\r\n return this;\r\n else {\r\n var high = this.high;\r\n if (numBits < 32) {\r\n var low = this.low;\r\n return fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned);\r\n } else if (numBits === 32)\r\n return fromBits(high, 0, this.unsigned);\r\n else\r\n return fromBits(high >>> (numBits - 32), 0, this.unsigned);\r\n }\r\n};\r\n\r\n/**\r\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shru = LongPrototype.shiftRightUnsigned;\r\n\r\n/**\r\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shr_u = LongPrototype.shiftRightUnsigned;\r\n\r\n/**\r\n * Converts this Long to signed.\r\n * @returns {!Long} Signed long\r\n */\r\nLongPrototype.toSigned = function toSigned() {\r\n if (!this.unsigned)\r\n return this;\r\n return fromBits(this.low, this.high, false);\r\n};\r\n\r\n/**\r\n * Converts this Long to unsigned.\r\n * @returns {!Long} Unsigned long\r\n */\r\nLongPrototype.toUnsigned = function toUnsigned() {\r\n if (this.unsigned)\r\n return this;\r\n return fromBits(this.low, this.high, true);\r\n};\r\n\r\n/**\r\n * Converts this Long to its byte representation.\r\n * @param {boolean=} le Whether little or big endian, defaults to big endian\r\n * @returns {!Array.} Byte representation\r\n */\r\nLongPrototype.toBytes = function toBytes(le) {\r\n return le ? this.toBytesLE() : this.toBytesBE();\r\n};\r\n\r\n/**\r\n * Converts this Long to its little endian byte representation.\r\n * @returns {!Array.} Little endian byte representation\r\n */\r\nLongPrototype.toBytesLE = function toBytesLE() {\r\n var hi = this.high,\r\n lo = this.low;\r\n return [\r\n lo & 0xff,\r\n lo >>> 8 & 0xff,\r\n lo >>> 16 & 0xff,\r\n lo >>> 24 ,\r\n hi & 0xff,\r\n hi >>> 8 & 0xff,\r\n hi >>> 16 & 0xff,\r\n hi >>> 24\r\n ];\r\n};\r\n\r\n/**\r\n * Converts this Long to its big endian byte representation.\r\n * @returns {!Array.} Big endian byte representation\r\n */\r\nLongPrototype.toBytesBE = function toBytesBE() {\r\n var hi = this.high,\r\n lo = this.low;\r\n return [\r\n hi >>> 24 ,\r\n hi >>> 16 & 0xff,\r\n hi >>> 8 & 0xff,\r\n hi & 0xff,\r\n lo >>> 24 ,\r\n lo >>> 16 & 0xff,\r\n lo >>> 8 & 0xff,\r\n lo & 0xff\r\n ];\r\n};\r\n\r\n/**\r\n * Creates a Long from its byte representation.\r\n * @param {!Array.} bytes Byte representation\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @param {boolean=} le Whether little or big endian, defaults to big endian\r\n * @returns {Long} The corresponding Long value\r\n */\r\nLong.fromBytes = function fromBytes(bytes, unsigned, le) {\r\n return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned);\r\n};\r\n\r\n/**\r\n * Creates a Long from its little endian byte representation.\r\n * @param {!Array.} bytes Little endian byte representation\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {Long} The corresponding Long value\r\n */\r\nLong.fromBytesLE = function fromBytesLE(bytes, unsigned) {\r\n return new Long(\r\n bytes[0] |\r\n bytes[1] << 8 |\r\n bytes[2] << 16 |\r\n bytes[3] << 24,\r\n bytes[4] |\r\n bytes[5] << 8 |\r\n bytes[6] << 16 |\r\n bytes[7] << 24,\r\n unsigned\r\n );\r\n};\r\n\r\n/**\r\n * Creates a Long from its big endian byte representation.\r\n * @param {!Array.} bytes Big endian byte representation\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {Long} The corresponding Long value\r\n */\r\nLong.fromBytesBE = function fromBytesBE(bytes, unsigned) {\r\n return new Long(\r\n bytes[4] << 24 |\r\n bytes[5] << 16 |\r\n bytes[6] << 8 |\r\n bytes[7],\r\n bytes[0] << 24 |\r\n bytes[1] << 16 |\r\n bytes[2] << 8 |\r\n bytes[3],\r\n unsigned\r\n );\r\n};\r\n","/**\r\n * Built-in elements providing WebAssembly core functionality.\r\n * @module builtins\r\n *//***/\r\n\r\n import {\r\n Compiler,\r\n ConversionKind,\r\n WrapMode,\r\n Feature\r\n} from \"./compiler\";\r\n\r\nimport {\r\n DiagnosticCode\r\n} from \"./diagnostics\";\r\n\r\nimport {\r\n Node,\r\n NodeKind,\r\n Expression,\r\n LiteralKind,\r\n LiteralExpression,\r\n StringLiteralExpression,\r\n CallExpression\r\n} from \"./ast\";\r\n\r\nimport {\r\n Type,\r\n TypeKind,\r\n TypeFlags,\r\n Signature\r\n} from \"./types\";\r\n\r\nimport {\r\n BinaryOp,\r\n UnaryOp,\r\n HostOp,\r\n AtomicRMWOp,\r\n SIMDExtractOp,\r\n SIMDReplaceOp,\r\n SIMDShiftOp,\r\n NativeType,\r\n ExpressionRef,\r\n ExpressionId,\r\n getExpressionId,\r\n getExpressionType,\r\n getConstValueI64High,\r\n getConstValueI64Low,\r\n getConstValueI32,\r\n getConstValueF32,\r\n getConstValueF64\r\n} from \"./module\";\r\n\r\nimport {\r\n ElementKind,\r\n OperatorKind,\r\n FunctionPrototype,\r\n Class,\r\n Field,\r\n Global,\r\n DecoratorFlags,\r\n ClassPrototype\r\n} from \"./program\";\r\n\r\nimport {\r\n FlowFlags\r\n} from \"./flow\";\r\n\r\nimport {\r\n ReportMode\r\n} from \"./resolver\";\r\n\r\nimport {\r\n CommonFlags\r\n} from \"./common\";\r\n\r\nimport {\r\n writeI8,\r\n writeI16,\r\n writeI32,\r\n writeF32,\r\n writeF64,\r\n isPowerOf2\r\n} from \"./util\";\r\n\r\n/** Symbols of various compiler built-ins. */\r\nexport namespace BuiltinSymbols {\r\n // std/builtins.ts\r\n export const isInteger = \"~lib/builtins/isInteger\";\r\n export const isFloat = \"~lib/builtins/isFloat\";\r\n export const isSigned = \"~lib/builtins/isSigned\";\r\n export const isReference = \"~lib/builtins/isReference\";\r\n export const isString = \"~lib/builtins/isString\";\r\n export const isArray = \"~lib/builtins/isArray\";\r\n export const isArrayLike = \"~lib/builtins/isArrayLike\";\r\n export const isFunction = \"~lib/builtins/isFunction\";\r\n export const isNullable = \"~lib/builtins/isNullable\";\r\n export const isDefined = \"~lib/builtins/isDefined\";\r\n export const isConstant = \"~lib/builtins/isConstant\";\r\n export const isManaged = \"~lib/builtins/isManaged\";\r\n\r\n export const clz = \"~lib/builtins/clz\";\r\n export const ctz = \"~lib/builtins/ctz\";\r\n export const popcnt = \"~lib/builtins/popcnt\";\r\n export const rotl = \"~lib/builtins/rotl\";\r\n export const rotr = \"~lib/builtins/rotr\";\r\n export const abs = \"~lib/builtins/abs\";\r\n export const max = \"~lib/builtins/max\";\r\n export const min = \"~lib/builtins/min\";\r\n export const ceil = \"~lib/builtins/ceil\";\r\n export const floor = \"~lib/builtins/floor\";\r\n export const copysign = \"~lib/builtins/copysign\";\r\n export const nearest = \"~lib/builtins/nearest\";\r\n export const reinterpret = \"~lib/builtins/reinterpret\";\r\n export const sqrt = \"~lib/builtins/sqrt\";\r\n export const trunc = \"~lib/builtins/trunc\";\r\n export const load = \"~lib/builtins/load\";\r\n export const store = \"~lib/builtins/store\";\r\n export const atomic_load = \"~lib/builtins/atomic.load\";\r\n export const atomic_store = \"~lib/builtins/atomic.store\";\r\n export const atomic_add = \"~lib/builtins/atomic.add\";\r\n export const atomic_sub = \"~lib/builtins/atomic.sub\";\r\n export const atomic_and = \"~lib/builtins/atomic.and\";\r\n export const atomic_or = \"~lib/builtins/atomic.or\";\r\n export const atomic_xor = \"~lib/builtins/atomic.xor\";\r\n export const atomic_xchg = \"~lib/builtins/atomic.xchg\";\r\n export const atomic_cmpxchg = \"~lib/builtins/atomic.cmpxchg\";\r\n export const atomic_wait = \"~lib/builtins/atomic.wait\";\r\n export const atomic_notify = \"~lib/builtins/atomic.notify\";\r\n\r\n export const sizeof = \"~lib/builtins/sizeof\";\r\n export const alignof = \"~lib/builtins/alignof\";\r\n export const offsetof = \"~lib/builtins/offsetof\";\r\n export const select = \"~lib/builtins/select\";\r\n export const unreachable = \"~lib/builtins/unreachable\";\r\n export const changetype = \"~lib/builtins/changetype\";\r\n export const assert = \"~lib/builtins/assert\";\r\n export const unchecked = \"~lib/builtins/unchecked\";\r\n export const call_indirect = \"~lib/builtins/call_indirect\";\r\n export const instantiate = \"~lib/builtins/instantiate\";\r\n\r\n export const i8 = \"~lib/builtins/i8\";\r\n export const i16 = \"~lib/builtins/i16\";\r\n export const i32 = \"~lib/builtins/i32\";\r\n export const i64 = \"~lib/builtins/i64\";\r\n export const isize = \"~lib/builtins/isize\";\r\n export const u8 = \"~lib/builtins/u8\";\r\n export const u16 = \"~lib/builtins/u16\";\r\n export const u32 = \"~lib/builtins/u32\";\r\n export const u64 = \"~lib/builtins/u64\";\r\n export const usize = \"~lib/builtins/usize\";\r\n export const bool = \"~lib/builtins/bool\";\r\n export const f32 = \"~lib/builtins/f32\";\r\n export const f64 = \"~lib/builtins/f64\";\r\n export const v128 = \"~lib/builtins/v128\";\r\n export const void_ = \"~lib/builtins/void\";\r\n\r\n export const i32_clz = \"~lib/builtins/i32.clz\";\r\n export const i64_clz = \"~lib/builtins/i64.clz\";\r\n export const i32_ctz = \"~lib/builtins/i32.ctz\";\r\n export const i64_ctz = \"~lib/builtins/i64.ctz\";\r\n export const i32_popcnt = \"~lib/builtins/i32.popcnt\";\r\n export const i64_popcnt = \"~lib/builtins/i64.popcnt\";\r\n export const i32_rotl = \"~lib/builtins/i32.rotl\";\r\n export const i64_rotl = \"~lib/builtins/i64.rotl\";\r\n export const i32_rotr = \"~lib/builtins/i32.rotr\";\r\n export const i64_rotr = \"~lib/builtins/i64.rotr\";\r\n\r\n export const f32_abs = \"~lib/builtins/f32.abs\";\r\n export const f64_abs = \"~lib/builtins/f64.abs\";\r\n export const f32_max = \"~lib/builtins/f32.max\";\r\n export const f64_max = \"~lib/builtins/f64.max\";\r\n export const f32_min = \"~lib/builtins/f32.min\";\r\n export const f64_min = \"~lib/builtins/f64.min\";\r\n export const f32_ceil = \"~lib/builtins/f32.ceil\";\r\n export const f64_ceil = \"~lib/builtins/f64.ceil\";\r\n export const f32_floor = \"~lib/builtins/f32.floor\";\r\n export const f64_floor = \"~lib/builtins/f64.floor\";\r\n export const f32_copysign = \"~lib/builtins/f32.copysign\";\r\n export const f64_copysign = \"~lib/builtins/f64.copysign\";\r\n export const f32_nearest = \"~lib/builtins/f32.nearest\";\r\n export const f64_nearest = \"~lib/builtins/f64.nearest\";\r\n export const i32_reinterpret_f32 = \"~lib/builtins/i32.reinterpret_f32\";\r\n export const i64_reinterpret_f64 = \"~lib/builtins/i64.reinterpret_f64\";\r\n export const f32_reinterpret_i32 = \"~lib/builtins/f32.reinterpret_i32\";\r\n export const f64_reinterpret_i64 = \"~lib/builtins/f64.reinterpret_i64\";\r\n export const f32_sqrt = \"~lib/builtins/f32.sqrt\";\r\n export const f64_sqrt = \"~lib/builtins/f64.sqrt\";\r\n export const f32_trunc = \"~lib/builtins/f32.trunc\";\r\n export const f64_trunc = \"~lib/builtins/f64.trunc\";\r\n\r\n export const i32_load8_s = \"~lib/builtins/i32.load8_s\";\r\n export const i32_load8_u = \"~lib/builtins/i32.load8_u\";\r\n export const i32_load16_s = \"~lib/builtins/i32.load16_s\";\r\n export const i32_load16_u = \"~lib/builtins/i32.load16_u\";\r\n export const i32_load = \"~lib/builtins/i32.load\";\r\n export const i64_load8_s = \"~lib/builtins/i64.load8_s\";\r\n export const i64_load8_u = \"~lib/builtins/i64.load8_u\";\r\n export const i64_load16_s = \"~lib/builtins/i64.load16_s\";\r\n export const i64_load16_u = \"~lib/builtins/i64.load16_u\";\r\n export const i64_load32_s = \"~lib/builtins/i64.load32_s\";\r\n export const i64_load32_u = \"~lib/builtins/i64.load32_u\";\r\n export const i64_load = \"~lib/builtins/i64.load\";\r\n export const f32_load = \"~lib/builtins/f32.load\";\r\n export const f64_load = \"~lib/builtins/f64.load\";\r\n export const i32_store8 = \"~lib/builtins/i32.store8\";\r\n export const i32_store16 = \"~lib/builtins/i32.store16\";\r\n export const i32_store = \"~lib/builtins/i32.store\";\r\n export const i64_store8 = \"~lib/builtins/i64.store8\";\r\n export const i64_store16 = \"~lib/builtins/i64.store16\";\r\n export const i64_store32 = \"~lib/builtins/i64.store32\";\r\n export const i64_store = \"~lib/builtins/i64.store\";\r\n export const f32_store = \"~lib/builtins/f32.store\";\r\n export const f64_store = \"~lib/builtins/f64.store\";\r\n\r\n export const i32_atomic_load8_u = \"~lib/builtins/i32.atomic.load8_u\";\r\n export const i32_atomic_load16_u = \"~lib/builtins/i32.atomic.load16_u\";\r\n export const i32_atomic_load = \"~lib/builtins/i32.atomic.load\";\r\n export const i64_atomic_load8_u = \"~lib/builtins/i64.atomic.load8_u\";\r\n export const i64_atomic_load16_u = \"~lib/builtins/i64.atomic.load16_u\";\r\n export const i64_atomic_load32_u = \"~lib/builtins/i64.atomic.load32_u\";\r\n export const i64_atomic_load = \"~lib/builtins/i64.atomic.load\";\r\n export const i32_atomic_store8 = \"~lib/builtins/i32.atomic.store8\";\r\n export const i32_atomic_store16 = \"~lib/builtins/i32.atomic.store16\";\r\n export const i32_atomic_store = \"~lib/builtins/i32.atomic.store\";\r\n export const i64_atomic_store8 = \"~lib/builtins/i64.atomic.store8\";\r\n export const i64_atomic_store16 = \"~lib/builtins/i64.atomic.store16\";\r\n export const i64_atomic_store32 = \"~lib/builtins/i64.atomic.store32\";\r\n export const i64_atomic_store = \"~lib/builtins/i64.atomic.store\";\r\n export const i32_atomic_rmw8_add_u = \"~lib/builtins/i32.atomic.rmw8.add_u\";\r\n export const i32_atomic_rmw16_add_u = \"~lib/builtins/i32.atomic.rmw16.add_u\";\r\n export const i32_atomic_rmw_add = \"~lib/builtins/i32.atomic.rmw.add\";\r\n export const i64_atomic_rmw8_add_u = \"~lib/builtins/i64.atomic.rmw8.add_u\";\r\n export const i64_atomic_rmw16_add_u = \"~lib/builtins/i64.atomic.rmw16.add_u\";\r\n export const i64_atomic_rmw32_add_u = \"~lib/builtins/i64.atomic.rmw32.add_u\";\r\n export const i64_atomic_rmw_add = \"~lib/builtins/i64.atomic.rmw.add\";\r\n export const i32_atomic_rmw8_sub_u = \"~lib/builtins/i32.atomic.rmw8.sub_u\";\r\n export const i32_atomic_rmw16_sub_u = \"~lib/builtins/i32.atomic.rmw16.sub_u\";\r\n export const i32_atomic_rmw_sub = \"~lib/builtins/i32.atomic.rmw.sub\";\r\n export const i64_atomic_rmw8_sub_u = \"~lib/builtins/i64.atomic.rmw8.sub_u\";\r\n export const i64_atomic_rmw16_sub_u = \"~lib/builtins/i64.atomic.rmw16.sub_u\";\r\n export const i64_atomic_rmw32_sub_u = \"~lib/builtins/i64.atomic.rmw32.sub_u\";\r\n export const i64_atomic_rmw_sub = \"~lib/builtins/i64.atomic.rmw.sub\";\r\n export const i32_atomic_rmw8_and_u = \"~lib/builtins/i32.atomic.rmw8.and_u\";\r\n export const i32_atomic_rmw16_and_u = \"~lib/builtins/i32.atomic.rmw16.and_u\";\r\n export const i32_atomic_rmw_and = \"~lib/builtins/i32.atomic.rmw.and\";\r\n export const i64_atomic_rmw8_and_u = \"~lib/builtins/i64.atomic.rmw8.and_u\";\r\n export const i64_atomic_rmw16_and_u = \"~lib/builtins/i64.atomic.rmw16.and_u\";\r\n export const i64_atomic_rmw32_and_u = \"~lib/builtins/i64.atomic.rmw32.and_u\";\r\n export const i64_atomic_rmw_and = \"~lib/builtins/i64.atomic.rmw.and\";\r\n export const i32_atomic_rmw8_or_u = \"~lib/builtins/i32.atomic.rmw8.or_u\";\r\n export const i32_atomic_rmw16_or_u = \"~lib/builtins/i32.atomic.rmw16.or_u\";\r\n export const i32_atomic_rmw_or = \"~lib/builtins/i32.atomic.rmw.or\";\r\n export const i64_atomic_rmw8_or_u = \"~lib/builtins/i64.atomic.rmw8.or_u\";\r\n export const i64_atomic_rmw16_or_u = \"~lib/builtins/i64.atomic.rmw16.or_u\";\r\n export const i64_atomic_rmw32_or_u = \"~lib/builtins/i64.atomic.rmw32.or_u\";\r\n export const i64_atomic_rmw_or = \"~lib/builtins/i64.atomic.rmw.or\";\r\n export const i32_atomic_rmw8_u_xor = \"~lib/builtins/i32.atomic.rmw8.xor_u\";\r\n export const i32_atomic_rmw16_u_xor = \"~lib/builtins/i32.atomic.rmw16.xor_u\";\r\n export const i32_atomic_rmw_xor = \"~lib/builtins/i32.atomic.rmw.xor\";\r\n export const i64_atomic_rmw8_xor_u = \"~lib/builtins/i64.atomic.rmw8.xor_u\";\r\n export const i64_atomic_rmw16_xor_u = \"~lib/builtins/i64.atomic.rmw16.xor_u\";\r\n export const i64_atomic_rmw32_xor_u = \"~lib/builtins/i64.atomic.rmw32.xor_u\";\r\n export const i64_atomic_rmw_xor = \"~lib/builtins/i64.atomic.rmw.xor\";\r\n export const i32_atomic_rmw8_xchg_u = \"~lib/builtins/i32.atomic.rmw8.xchg_u\";\r\n export const i32_atomic_rmw16_xchg_u = \"~lib/builtins/i32.atomic.rmw16.xchg_u\";\r\n export const i32_atomic_rmw_xchg = \"~lib/builtins/i32.atomic.rmw.xchg\";\r\n export const i64_atomic_rmw8_xchg_u = \"~lib/builtins/i64.atomic.rmw8.xchg_u\";\r\n export const i64_atomic_rmw16_xchg_u = \"~lib/builtins/i64.atomic.rmw16.xchg_u\";\r\n export const i64_atomic_rmw32_xchg_u = \"~lib/builtins/i64.atomic.rmw32.xchg_u\";\r\n export const i64_atomic_rmw_xchg = \"~lib/builtins/i64.atomic.rmw.xchg\";\r\n export const i32_atomic_rmw8_cmpxchg_u = \"~lib/builtins/i32.atomic.rmw8.cmpxchg_u\";\r\n export const i32_atomic_rmw16_cmpxchg_u = \"~lib/builtins/i32.atomic.rmw16.cmpxchg_u\";\r\n export const i32_atomic_rmw_cmpxchg = \"~lib/builtins/i32.atomic.rmw.cmpxchg\";\r\n export const i64_atomic_rmw8_cmpxchg_u = \"~lib/builtins/i64.atomic.rmw8.cmpxchg_u\";\r\n export const i64_atomic_rmw16_cmpxchg_u = \"~lib/builtins/i64.atomic.rmw16.cmpxchg_u\";\r\n export const i64_atomic_rmw32_cmpxchg_u = \"~lib/builtins/i64.atomic.rmw32.cmpxchg_u\";\r\n export const i64_atomic_rmw_cmpxchg = \"~lib/builtins/i64.atomic.rmw.cmpxchg\";\r\n export const i32_wait = \"~lib/builtins/i32.wait\";\r\n export const i64_wait = \"~lib/builtins/i64.wait\";\r\n\r\n export const v128_splat = \"~lib/builtins/v128.splat\";\r\n export const v128_extract_lane = \"~lib/builtins/v128.extract_lane\";\r\n export const v128_replace_lane = \"~lib/builtins/v128.replace_lane\";\r\n export const v128_shuffle = \"~lib/builtins/v128.shuffle\";\r\n export const v128_load = \"~lib/builtins/v128.load\";\r\n export const v128_store = \"~lib/builtins/v128.store\";\r\n export const v128_add = \"~lib/builtins/v128.add\";\r\n export const v128_sub = \"~lib/builtins/v128.sub\";\r\n export const v128_mul = \"~lib/builtins/v128.mul\";\r\n export const v128_div = \"~lib/builtins/v128.div\";\r\n export const v128_neg = \"~lib/builtins/v128.neg\";\r\n export const v128_add_saturate = \"~lib/builtins/v128.add_saturate\";\r\n export const v128_sub_saturate = \"~lib/builtins/v128.sub_saturate\";\r\n export const v128_shl = \"~lib/builtins/v128.shl\";\r\n export const v128_shr = \"~lib/builtins/v128.shr\";\r\n export const v128_and = \"~lib/builtins/v128.and\";\r\n export const v128_or = \"~lib/builtins/v128.or\";\r\n export const v128_xor = \"~lib/builtins/v128.xor\";\r\n export const v128_not = \"~lib/builtins/v128.not\";\r\n export const v128_bitselect = \"~lib/builtins/v128.bitselect\";\r\n export const v128_any_true = \"~lib/builtins/v128.any_true\";\r\n export const v128_all_true = \"~lib/builtins/v128.all_true\";\r\n export const v128_min = \"~lib/builtins/v128.min\";\r\n export const v128_max = \"~lib/builtins/v128.max\";\r\n export const v128_abs = \"~lib/builtins/v128.abs\";\r\n export const v128_sqrt = \"~lib/builtins/v128.sqrt\";\r\n export const v128_eq = \"~lib/builtins/v128.eq\";\r\n export const v128_ne = \"~lib/builtins/v128.ne\";\r\n export const v128_lt = \"~lib/builtins/v128.lt\";\r\n export const v128_le = \"~lib/builtins/v128.le\";\r\n export const v128_gt = \"~lib/builtins/v128.gt\";\r\n export const v128_ge = \"~lib/builtins/v128.ge\";\r\n export const v128_convert = \"~lib/builtins/v128.convert\";\r\n export const v128_trunc = \"~lib/builtins/v128.trunc\";\r\n\r\n export const i8x16 = \"~lib/builtins/i8x16\";\r\n export const i16x8 = \"~lib/builtins/i16x8\";\r\n export const i32x4 = \"~lib/builtins/i32x4\";\r\n export const i64x2 = \"~lib/builtins/i64x2\";\r\n export const f32x4 = \"~lib/builtins/f32x4\";\r\n export const f64x2 = \"~lib/builtins/f64x2\";\r\n\r\n export const i8x16_splat = \"~lib/builtins/i8x16.splat\";\r\n export const i8x16_extract_lane_s = \"~lib/builtins/i8x16.extract_lane_s\";\r\n export const i8x16_extract_lane_u = \"~lib/builtins/i8x16.extract_lane_u\";\r\n export const i8x16_replace_lane = \"~lib/builtins/i8x16.replace_lane\";\r\n export const i8x16_add = \"~lib/builtins/i8x16.add\";\r\n export const i8x16_sub = \"~lib/builtins/i8x16.sub\";\r\n export const i8x16_mul = \"~lib/builtins/i8x16.mul\";\r\n export const i8x16_neg = \"~lib/builtins/i8x16.neg\";\r\n export const i8x16_add_saturate_s = \"~lib/builtins/i8x16.add_saturate_s\";\r\n export const i8x16_add_saturate_u = \"~lib/builtins/i8x16.add_saturate_u\";\r\n export const i8x16_sub_saturate_s = \"~lib/builtins/i8x16.sub_saturate_s\";\r\n export const i8x16_sub_saturate_u = \"~lib/builtins/i8x16.sub_saturate_u\";\r\n export const i8x16_shl = \"~lib/builtins/i8x16.shl\";\r\n export const i8x16_shr_s = \"~lib/builtins/i8x16.shr_s\";\r\n export const i8x16_shr_u = \"~lib/builtins/i8x16.shr_u\";\r\n export const i8x16_any_true = \"~lib/builtins/i8x16.any_true\";\r\n export const i8x16_all_true = \"~lib/builtins/i8x16.all_true\";\r\n export const i8x16_eq = \"~lib/builtins/i8x16.eq\";\r\n export const i8x16_ne = \"~lib/builtins/i8x16.ne\";\r\n export const i8x16_lt_s = \"~lib/builtins/i8x16.lt_s\";\r\n export const i8x16_lt_u = \"~lib/builtins/i8x16.lt_u\";\r\n export const i8x16_le_s = \"~lib/builtins/i8x16.le_s\";\r\n export const i8x16_le_u = \"~lib/builtins/i8x16.le_u\";\r\n export const i8x16_gt_s = \"~lib/builtins/i8x16.gt_s\";\r\n export const i8x16_gt_u = \"~lib/builtins/i8x16.gt_u\";\r\n export const i8x16_ge_s = \"~lib/builtins/i8x16.ge_s\";\r\n export const i8x16_ge_u = \"~lib/builtins/i8x16.ge_u\";\r\n\r\n export const i16x8_splat = \"~lib/builtins/i16x8.splat\";\r\n export const i16x8_extract_lane_s = \"~lib/builtins/i16x8.extract_lane_s\";\r\n export const i16x8_extract_lane_u = \"~lib/builtins/i16x8.extract_lane_u\";\r\n export const i16x8_replace_lane = \"~lib/builtins/i16x8.replace_lane\";\r\n export const i16x8_add = \"~lib/builtins/i16x8.add\";\r\n export const i16x8_sub = \"~lib/builtins/i16x8.sub\";\r\n export const i16x8_mul = \"~lib/builtins/i16x8.mul\";\r\n export const i16x8_neg = \"~lib/builtins/i16x8.neg\";\r\n export const i16x8_add_saturate_s = \"~lib/builtins/i16x8.add_saturate_s\";\r\n export const i16x8_add_saturate_u = \"~lib/builtins/i16x8.add_saturate_u\";\r\n export const i16x8_sub_saturate_s = \"~lib/builtins/i16x8.sub_saturate_s\";\r\n export const i16x8_sub_saturate_u = \"~lib/builtins/i16x8.sub_saturate_u\";\r\n export const i16x8_shl = \"~lib/builtins/i16x8.shl\";\r\n export const i16x8_shr_s = \"~lib/builtins/i16x8.shr_s\";\r\n export const i16x8_shr_u = \"~lib/builtins/i16x8.shr_u\";\r\n export const i16x8_any_true = \"~lib/builtins/i16x8.any_true\";\r\n export const i16x8_all_true = \"~lib/builtins/i16x8.all_true\";\r\n export const i16x8_eq = \"~lib/builtins/i16x8.eq\";\r\n export const i16x8_ne = \"~lib/builtins/i16x8.ne\";\r\n export const i16x8_lt_s = \"~lib/builtins/i16x8.lt_s\";\r\n export const i16x8_lt_u = \"~lib/builtins/i16x8.lt_u\";\r\n export const i16x8_le_s = \"~lib/builtins/i16x8.le_s\";\r\n export const i16x8_le_u = \"~lib/builtins/i16x8.le_u\";\r\n export const i16x8_gt_s = \"~lib/builtins/i16x8.gt_s\";\r\n export const i16x8_gt_u = \"~lib/builtins/i16x8.gt_u\";\r\n export const i16x8_ge_s = \"~lib/builtins/i16x8.ge_s\";\r\n export const i16x8_ge_u = \"~lib/builtins/i16x8.ge_u\";\r\n\r\n export const i32x4_splat = \"~lib/builtins/i32x4.splat\";\r\n export const i32x4_extract_lane = \"~lib/builtins/i32x4.extract_lane\";\r\n export const i32x4_replace_lane = \"~lib/builtins/i32x4.replace_lane\";\r\n export const i32x4_add = \"~lib/builtins/i32x4.add\";\r\n export const i32x4_sub = \"~lib/builtins/i32x4.sub\";\r\n export const i32x4_mul = \"~lib/builtins/i32x4.mul\";\r\n export const i32x4_neg = \"~lib/builtins/i32x4.neg\";\r\n export const i32x4_shl = \"~lib/builtins/i32x4.shl\";\r\n export const i32x4_shr_s = \"~lib/builtins/i32x4.shr_s\";\r\n export const i32x4_shr_u = \"~lib/builtins/i32x4.shr_u\";\r\n export const i32x4_any_true = \"~lib/builtins/i32x4.any_true\";\r\n export const i32x4_all_true = \"~lib/builtins/i32x4.all_true\";\r\n export const i32x4_eq = \"~lib/builtins/i32x4.eq\";\r\n export const i32x4_ne = \"~lib/builtins/i32x4.ne\";\r\n export const i32x4_lt_s = \"~lib/builtins/i32x4.lt_s\";\r\n export const i32x4_lt_u = \"~lib/builtins/i32x4.lt_u\";\r\n export const i32x4_le_s = \"~lib/builtins/i32x4.le_s\";\r\n export const i32x4_le_u = \"~lib/builtins/i32x4.le_u\";\r\n export const i32x4_gt_s = \"~lib/builtins/i32x4.gt_s\";\r\n export const i32x4_gt_u = \"~lib/builtins/i32x4.gt_u\";\r\n export const i32x4_ge_s = \"~lib/builtins/i32x4.ge_s\";\r\n export const i32x4_ge_u = \"~lib/builtins/i32x4.ge_u\";\r\n export const i32x4_trunc_s_f32x4_sat = \"~lib/builtins/i32x4.trunc_s_f32x4_sat\";\r\n export const i32x4_trunc_u_f32x4_sat = \"~lib/builtins/i32x4.trunc_u_f32x4_sat\";\r\n\r\n export const i64x2_splat = \"~lib/builtins/i64x2.splat\";\r\n export const i64x2_extract_lane = \"~lib/builtins/i64x2.extract_lane\";\r\n export const i64x2_replace_lane = \"~lib/builtins/i64x2.replace_lane\";\r\n export const i64x2_add = \"~lib/builtins/i64x2.add\";\r\n export const i64x2_sub = \"~lib/builtins/i64x2.sub\"; // i64x2 has no .mul\r\n export const i64x2_neg = \"~lib/builtins/i64x2.neg\";\r\n export const i64x2_shl = \"~lib/builtins/i64x2.shl\";\r\n export const i64x2_shr_s = \"~lib/builtins/i64x2.shr_s\";\r\n export const i64x2_shr_u = \"~lib/builtins/i64x2.shr_u\";\r\n export const i64x2_any_true = \"~lib/builtins/i64x2.any_true\";\r\n export const i64x2_all_true = \"~lib/builtins/i64x2.all_true\"; // i64x2 has no .eq etc.\r\n export const i64x2_trunc_s_f64x2_sat = \"~lib/builtins/i64x2.trunc_s_f64x2_sat\";\r\n export const i64x2_trunc_u_f64x2_sat = \"~lib/builtins/i64x2.trunc_u_f64x2_sat\";\r\n\r\n export const f32x4_splat = \"~lib/builtins/f32x4.splat\";\r\n export const f32x4_extract_lane = \"~lib/builtins/f32x4.extract_lane\";\r\n export const f32x4_replace_lane = \"~lib/builtins/f32x4.replace_lane\";\r\n export const f32x4_add = \"~lib/builtins/f32x4.add\";\r\n export const f32x4_sub = \"~lib/builtins/f32x4.sub\";\r\n export const f32x4_mul = \"~lib/builtins/f32x4.mul\";\r\n export const f32x4_div = \"~lib/builtins/f32x4.div\";\r\n export const f32x4_neg = \"~lib/builtins/f32x4.neg\";\r\n export const f32x4_min = \"~lib/builtins/f32x4.min\";\r\n export const f32x4_max = \"~lib/builtins/f32x4.max\";\r\n export const f32x4_abs = \"~lib/builtins/f32x4.abs\";\r\n export const f32x4_sqrt = \"~lib/builtins/f32x4.sqrt\";\r\n export const f32x4_eq = \"~lib/builtins/f32x4.eq\";\r\n export const f32x4_ne = \"~lib/builtins/f32x4.ne\";\r\n export const f32x4_lt = \"~lib/builtins/f32x4.lt\";\r\n export const f32x4_le = \"~lib/builtins/f32x4.le\";\r\n export const f32x4_gt = \"~lib/builtins/f32x4.gt\";\r\n export const f32x4_ge = \"~lib/builtins/f32x4.ge\";\r\n export const f32x4_convert_s_i32x4 = \"~lib/builtins/f32x4.convert_s_i32x4\";\r\n export const f32x4_convert_u_i32x4 = \"~lib/builtins/f32x4.convert_u_i32x4\";\r\n\r\n export const f64x2_splat = \"~lib/builtins/f64x2.splat\";\r\n export const f64x2_extract_lane = \"~lib/builtins/f64x2.extract_lane\";\r\n export const f64x2_replace_lane = \"~lib/builtins/f64x2.replace_lane\";\r\n export const f64x2_add = \"~lib/builtins/f64x2.add\";\r\n export const f64x2_sub = \"~lib/builtins/f64x2.sub\";\r\n export const f64x2_mul = \"~lib/builtins/f64x2.mul\";\r\n export const f64x2_div = \"~lib/builtins/f64x2.div\";\r\n export const f64x2_neg = \"~lib/builtins/f64x2.neg\";\r\n export const f64x2_min = \"~lib/builtins/f64x2.min\";\r\n export const f64x2_max = \"~lib/builtins/f64x2.max\";\r\n export const f64x2_abs = \"~lib/builtins/f64x2.abs\";\r\n export const f64x2_sqrt = \"~lib/builtins/f64x2.sqrt\";\r\n export const f64x2_eq = \"~lib/builtins/f64x2.eq\";\r\n export const f64x2_ne = \"~lib/builtins/f64x2.ne\";\r\n export const f64x2_lt = \"~lib/builtins/f64x2.lt\";\r\n export const f64x2_le = \"~lib/builtins/f64x2.le\";\r\n export const f64x2_gt = \"~lib/builtins/f64x2.gt\";\r\n export const f64x2_ge = \"~lib/builtins/f64x2.ge\";\r\n export const f64x2_convert_s_i64x2 = \"~lib/builtins/f64x2.convert_s_i64x2\";\r\n export const f64x2_convert_u_i64x2 = \"~lib/builtins/f64x2.convert_u_i64x2\";\r\n\r\n export const v8x16_shuffle = \"~lib/builtins/v8x16.shuffle\";\r\n\r\n // std/diagnostics.ts\r\n export const ERROR = \"~lib/diagnostics/ERROR\";\r\n export const WARNING = \"~lib/diagnostics/WARNING\";\r\n export const INFO = \"~lib/diagnostics/INFO\";\r\n // std/memory.ts\r\n export const HEAP_BASE = \"~lib/memory/HEAP_BASE\";\r\n export const memory_size = \"~lib/memory/memory.size\";\r\n export const memory_grow = \"~lib/memory/memory.grow\";\r\n export const memory_copy = \"~lib/memory/memory.copy\";\r\n export const memory_fill = \"~lib/memory/memory.fill\";\r\n // std/gc.ts\r\n export const iterateRoots = \"~lib/gc/iterateRoots\";\r\n}\r\n\r\n/** Compiles a call to a built-in function. */\r\nexport function compileCall(\r\n /* Compiler reference. */\r\n compiler: Compiler,\r\n /** Respective function prototype. */\r\n prototype: FunctionPrototype,\r\n /** Pre-resolved type arguments. */\r\n typeArguments: Type[] | null,\r\n /** Operand expressions. */\r\n operands: Expression[],\r\n /** Contextual type. */\r\n contextualType: Type,\r\n /** Respective call expression. */\r\n reportNode: CallExpression,\r\n /** Indicates that contextual type is ASM type. */\r\n isAsm: bool = false\r\n): ExpressionRef {\r\n var module = compiler.module;\r\n\r\n // NOTE that some implementations below make use of the select expression where straight-forward.\r\n // whether worth or not should probably be tested once it's known if/how embedders handle it.\r\n // search: createSelect\r\n\r\n // NOTE that consolidation of individual instructions into a single case isn't exactly scientific\r\n // below, but rather done to make this file easier to work with. If there was a general rule it'd\r\n // most likely be \"three or more instructions that only differ in their actual opcode\".\r\n\r\n switch (prototype.internalName) {\r\n\r\n // === Static type evaluation =================================================================\r\n\r\n case BuiltinSymbols.isInteger: { // isInteger() / isInteger(value: T) -> bool\r\n let type = evaluateConstantType(compiler, typeArguments, operands, reportNode);\r\n compiler.currentType = Type.bool;\r\n if (!type) return module.createUnreachable();\r\n return type.is(TypeFlags.INTEGER) && !type.is(TypeFlags.REFERENCE)\r\n ? module.createI32(1)\r\n : module.createI32(0);\r\n }\r\n case BuiltinSymbols.isFloat: { // isFloat() / isFloat(value: T) -> bool\r\n let type = evaluateConstantType(compiler, typeArguments, operands, reportNode);\r\n compiler.currentType = Type.bool;\r\n if (!type) return module.createUnreachable();\r\n return type.is(TypeFlags.FLOAT)\r\n ? module.createI32(1)\r\n : module.createI32(0);\r\n }\r\n case BuiltinSymbols.isSigned: { // isSigned() / isSigned(value: T) -> bool\r\n let type = evaluateConstantType(compiler, typeArguments, operands, reportNode);\r\n compiler.currentType = Type.bool;\r\n if (!type) return module.createUnreachable();\r\n return type.is(TypeFlags.SIGNED)\r\n ? module.createI32(1)\r\n : module.createI32(0);\r\n }\r\n case BuiltinSymbols.isReference: { // isReference() / isReference(value: T) -> bool\r\n let type = evaluateConstantType(compiler, typeArguments, operands, reportNode);\r\n compiler.currentType = Type.bool;\r\n if (!type) return module.createUnreachable();\r\n return type.is(TypeFlags.REFERENCE)\r\n ? module.createI32(1)\r\n : module.createI32(0);\r\n }\r\n case BuiltinSymbols.isString: { // isString() / isString(value: T) -> bool\r\n let type = evaluateConstantType(compiler, typeArguments, operands, reportNode);\r\n compiler.currentType = Type.bool;\r\n if (!type) return module.createUnreachable();\r\n let classType = type.classReference;\r\n if (classType) {\r\n let stringInstance = compiler.program.stringInstance;\r\n if (stringInstance && classType.isAssignableTo(stringInstance)) return module.createI32(1);\r\n }\r\n return module.createI32(0);\r\n }\r\n case BuiltinSymbols.isArray: { // isArray() / isArray(value: T) -> bool\r\n let type = evaluateConstantType(compiler, typeArguments, operands, reportNode);\r\n compiler.currentType = Type.bool;\r\n if (!type) return module.createUnreachable();\r\n let classReference = type.classReference;\r\n if (!classReference) return module.createI32(0);\r\n let classPrototype = classReference.prototype;\r\n return module.createI32(\r\n (classPrototype).extends(compiler.program.arrayPrototype)\r\n ? 1\r\n : 0\r\n );\r\n }\r\n case BuiltinSymbols.isArrayLike: { // isArrayLike() / isArrayLike(value: T) -> bool\r\n let type = evaluateConstantType(compiler, typeArguments, operands, reportNode);\r\n compiler.currentType = Type.bool;\r\n if (!type) return module.createUnreachable();\r\n let classReference = type.classReference;\r\n if (!classReference) return module.createI32(0);\r\n return module.createI32(\r\n classReference.lookupInSelf(\"length\") && (\r\n classReference.lookupOverload(OperatorKind.INDEXED_GET) ||\r\n classReference.lookupOverload(OperatorKind.UNCHECKED_INDEXED_GET)\r\n ) ? 1 : 0\r\n );\r\n }\r\n case BuiltinSymbols.isFunction: { // isFunction / isFunction(value: T) -> bool\r\n let type = evaluateConstantType(compiler, typeArguments, operands, reportNode);\r\n compiler.currentType = Type.bool;\r\n if (!type) return module.createUnreachable();\r\n return module.createI32(type.signatureReference ? 1 : 0);\r\n }\r\n case BuiltinSymbols.isNullable: { // isNullable / isNullable(value: T) -> bool\r\n let type = evaluateConstantType(compiler, typeArguments, operands, reportNode);\r\n compiler.currentType = Type.bool;\r\n if (!type) return module.createUnreachable();\r\n return module.createI32(type.is(TypeFlags.NULLABLE) ? 1 : 0);\r\n }\r\n case BuiltinSymbols.isDefined: { // isDefined(expression) -> bool\r\n compiler.currentType = Type.bool;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) return module.createUnreachable();\r\n let element = compiler.resolver.resolveExpression(\r\n operands[0],\r\n compiler.currentFlow,\r\n Type.void,\r\n ReportMode.SWALLOW\r\n );\r\n return module.createI32(element ? 1 : 0);\r\n }\r\n case BuiltinSymbols.isConstant: { // isConstant(expression) -> bool\r\n compiler.currentType = Type.bool;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) return module.createUnreachable();\r\n let expr = compiler.compileExpressionRetainType(operands[0], Type.i32, WrapMode.NONE);\r\n compiler.currentType = Type.bool;\r\n return module.createI32(getExpressionId(expr) == ExpressionId.Const ? 1 : 0);\r\n }\r\n case BuiltinSymbols.isManaged: { // isManaged() -> bool\r\n if (!compiler.program.hasGC) {\r\n compiler.currentType = Type.bool;\r\n return module.createI32(0);\r\n }\r\n let type = evaluateConstantType(compiler, typeArguments, operands, reportNode);\r\n compiler.currentType = Type.bool;\r\n if (!type) return module.createUnreachable();\r\n let classType = type.classReference;\r\n return classType !== null && !classType.hasDecorator(DecoratorFlags.UNMANAGED)\r\n ? module.createI32(1)\r\n : module.createI32(0);\r\n }\r\n case BuiltinSymbols.sizeof: { // sizeof() -> usize\r\n compiler.currentType = compiler.options.usizeType;\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler) |\r\n checkArgsRequired(operands, 0, reportNode, compiler)\r\n ) return module.createUnreachable();\r\n let byteSize = (typeArguments)[0].byteSize;\r\n let expr: ExpressionRef;\r\n if (compiler.options.isWasm64) {\r\n // implicitly wrap if contextual type is a 32-bit integer\r\n if (contextualType.is(TypeFlags.INTEGER) && contextualType.size <= 32) {\r\n compiler.currentType = Type.u32;\r\n expr = module.createI32(byteSize);\r\n } else {\r\n expr = module.createI64(byteSize, 0);\r\n }\r\n } else {\r\n // implicitly extend if contextual type is a 64-bit integer\r\n if (contextualType.is(TypeFlags.INTEGER) && contextualType.size == 64) {\r\n compiler.currentType = Type.u64;\r\n expr = module.createI64(byteSize, 0);\r\n } else {\r\n expr = module.createI32(byteSize);\r\n }\r\n }\r\n return expr;\r\n }\r\n case BuiltinSymbols.alignof: { // alignof() -> usize\r\n compiler.currentType = compiler.options.usizeType;\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler) |\r\n checkArgsRequired(operands, 0, reportNode, compiler)\r\n ) return module.createUnreachable();\r\n let byteSize = (typeArguments)[0].byteSize;\r\n assert(isPowerOf2(byteSize));\r\n let alignLog2 = ctz(byteSize);\r\n let expr: ExpressionRef;\r\n if (compiler.options.isWasm64) {\r\n // implicitly wrap if contextual type is a 32-bit integer\r\n if (contextualType.is(TypeFlags.INTEGER) && contextualType.size <= 32) {\r\n compiler.currentType = Type.u32;\r\n expr = module.createI32(alignLog2);\r\n } else {\r\n expr = module.createI64(alignLog2, 0);\r\n }\r\n } else {\r\n // implicitly extend if contextual type is a 64-bit integer\r\n if (contextualType.is(TypeFlags.INTEGER) && contextualType.size == 64) {\r\n compiler.currentType = Type.u64;\r\n expr = module.createI64(alignLog2, 0);\r\n } else {\r\n expr = module.createI32(alignLog2);\r\n }\r\n }\r\n return expr;\r\n }\r\n case BuiltinSymbols.offsetof: { // offsetof(fieldName?: string) -> usize\r\n compiler.currentType = compiler.options.usizeType;\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler) |\r\n checkArgsOptional(operands, 0, 1, reportNode, compiler)\r\n ) return module.createUnreachable();\r\n let classType = typeArguments![0].classReference;\r\n if (!classType) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.createUnreachable();\r\n }\r\n let offset: i32;\r\n if (operands.length) {\r\n if (\r\n operands[0].kind != NodeKind.LITERAL ||\r\n (operands[0]).literalKind != LiteralKind.STRING\r\n ) {\r\n compiler.error(\r\n DiagnosticCode.String_literal_expected,\r\n operands[0].range\r\n );\r\n return module.createUnreachable();\r\n }\r\n let fieldName = (operands[0]).value;\r\n let field = classType.members ? classType.members.get(fieldName) : null;\r\n if (!(field && field.kind == ElementKind.FIELD)) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_has_no_property_1,\r\n operands[0].range, classType.internalName, fieldName\r\n );\r\n return module.createUnreachable();\r\n }\r\n offset = (field).memoryOffset;\r\n } else {\r\n offset = classType.currentMemoryOffset;\r\n }\r\n if (compiler.options.isWasm64) {\r\n // implicitly wrap if contextual type is a 32-bit integer\r\n if (contextualType.is(TypeFlags.INTEGER) && contextualType.size <= 32) {\r\n compiler.currentType = Type.u32;\r\n return module.createI32(offset);\r\n } else {\r\n return module.createI64(offset);\r\n }\r\n } else {\r\n // implicitly extend if contextual type is a 64-bit integer\r\n if (contextualType.is(TypeFlags.INTEGER) && contextualType.size == 64) {\r\n compiler.currentType = Type.u64;\r\n return module.createI64(offset);\r\n } else {\r\n return module.createI32(offset);\r\n }\r\n }\r\n }\r\n\r\n // === Math ===================================================================================\r\n\r\n case BuiltinSymbols.clz: // any_bitcount(value: T) -> T\r\n case BuiltinSymbols.ctz:\r\n case BuiltinSymbols.popcnt: {\r\n if (\r\n checkTypeOptional(typeArguments, reportNode, compiler, true) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) return module.createUnreachable();\r\n let arg0 = typeArguments\r\n ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP)\r\n : compiler.compileExpression(operands[0], Type.i32, ConversionKind.NONE, WrapMode.WRAP);\r\n let type = compiler.currentType;\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.createUnreachable();\r\n }\r\n let op: UnaryOp = -1;\r\n switch (prototype.internalName) {\r\n case BuiltinSymbols.clz: {\r\n switch (type.kind) {\r\n case TypeKind.BOOL:\r\n case TypeKind.I8:\r\n case TypeKind.U8:\r\n case TypeKind.I16:\r\n case TypeKind.U16:\r\n case TypeKind.I32:\r\n case TypeKind.U32: { op = UnaryOp.ClzI32; break; }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n op = compiler.options.isWasm64\r\n ? UnaryOp.ClzI64\r\n : UnaryOp.ClzI32;\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: { op = UnaryOp.ClzI64; break; }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.ctz: {\r\n switch (type.kind) {\r\n case TypeKind.BOOL:\r\n case TypeKind.I8:\r\n case TypeKind.U8:\r\n case TypeKind.I16:\r\n case TypeKind.U16:\r\n case TypeKind.I32:\r\n case TypeKind.U32: { op = UnaryOp.CtzI32; break; }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n op = compiler.options.isWasm64\r\n ? UnaryOp.CtzI64\r\n : UnaryOp.CtzI32;\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: { op = UnaryOp.CtzI64; break; }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.popcnt: {\r\n switch (compiler.currentType.kind) {\r\n case TypeKind.BOOL:\r\n case TypeKind.I8:\r\n case TypeKind.U8:\r\n case TypeKind.I16:\r\n case TypeKind.U16:\r\n case TypeKind.I32:\r\n case TypeKind.U32: { op = UnaryOp.PopcntI32; break; }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n op = compiler.options.isWasm64\r\n ? UnaryOp.PopcntI64\r\n : UnaryOp.PopcntI32;\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: { op = UnaryOp.PopcntI64; break; }\r\n }\r\n break;\r\n }\r\n }\r\n if (op == -1) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.createUnreachable();\r\n }\r\n return module.createUnary(op, arg0);\r\n }\r\n case BuiltinSymbols.rotl: { // rotl(value: T, shift: T) -> T\r\n if (\r\n checkTypeOptional(typeArguments, reportNode, compiler, true) |\r\n checkArgsRequired(operands, 2, reportNode, compiler)\r\n ) return module.createUnreachable();\r\n let arg0 = typeArguments\r\n ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP)\r\n : compiler.compileExpression(operands[0], Type.i32, ConversionKind.NONE, WrapMode.WRAP);\r\n let type = compiler.currentType;\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.createUnreachable();\r\n }\r\n let arg1 = compiler.compileExpression(operands[1], type, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n let expr: ExpressionRef;\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.BOOL: {\r\n expr = compiler.ensureSmallIntegerWrap(\r\n module.createBinary(BinaryOp.RotlI32, arg0, arg1),\r\n type\r\n );\r\n // fall-through\r\n }\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n expr = module.createBinary(BinaryOp.RotlI32, arg0, arg1);\r\n break;\r\n }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n expr = module.createBinary(\r\n compiler.options.isWasm64\r\n ? BinaryOp.RotlI64\r\n : BinaryOp.RotlI32,\r\n arg0, arg1\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.createBinary(BinaryOp.RotlI64, arg0, arg1);\r\n break;\r\n }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n expr = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return expr; // possibly overflows\r\n }\r\n case BuiltinSymbols.rotr: { // rotr(value: T, shift: T) -> T\r\n if (\r\n checkTypeOptional(typeArguments, reportNode, compiler, true) |\r\n checkArgsRequired(operands, 2, reportNode, compiler)\r\n ) return module.createUnreachable();\r\n let arg0 = typeArguments\r\n ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP)\r\n : compiler.compileExpression(operands[0], Type.i32, ConversionKind.NONE, WrapMode.WRAP);\r\n let type = compiler.currentType;\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.createUnreachable();\r\n }\r\n let arg1 = compiler.compileExpression(operands[1], type, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n let expr: ExpressionRef;\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.BOOL: {\r\n expr = compiler.ensureSmallIntegerWrap(\r\n module.createBinary(BinaryOp.RotrI32, arg0, arg1),\r\n type\r\n );\r\n break;\r\n }\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n expr = module.createBinary(BinaryOp.RotrI32, arg0, arg1);\r\n break;\r\n }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n expr = module.createBinary(\r\n compiler.options.isWasm64\r\n ? BinaryOp.RotrI64\r\n : BinaryOp.RotrI32,\r\n arg0, arg1\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.createBinary(BinaryOp.RotrI64, arg0, arg1);\r\n break;\r\n }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n expr = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return expr; // possibly overflowws\r\n }\r\n case BuiltinSymbols.abs: { // abs(value: T) -> T\r\n if (\r\n checkTypeOptional(typeArguments, reportNode, compiler, true) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) return module.createUnreachable();\r\n let arg0 = typeArguments\r\n ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP)\r\n : compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.WRAP);\r\n let type = compiler.currentType;\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.createUnreachable();\r\n }\r\n let expr: ExpressionRef;\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32: {\r\n let flow = compiler.currentFlow;\r\n\r\n // possibly overflows, e.g. abs(-128) == 128\r\n let tempLocal1 = flow.getTempLocal(Type.i32, false);\r\n let tempLocalIndex2 = flow.getAndFreeTempLocal(Type.i32, false).index;\r\n let tempLocalIndex1 = tempLocal1.index;\r\n\r\n // (x + (x >> 31)) ^ (x >> 31)\r\n expr = module.createBinary(BinaryOp.XorI32,\r\n module.createBinary(BinaryOp.AddI32,\r\n module.createTeeLocal(\r\n tempLocalIndex2,\r\n module.createBinary(BinaryOp.ShrI32,\r\n module.createTeeLocal(tempLocalIndex1, arg0),\r\n module.createI32(31)\r\n )\r\n ),\r\n module.createGetLocal(tempLocalIndex1, NativeType.I32)\r\n ),\r\n module.createGetLocal(tempLocalIndex2, NativeType.I32)\r\n );\r\n\r\n flow.freeTempLocal(tempLocal1);\r\n break;\r\n }\r\n case TypeKind.ISIZE: {\r\n let options = compiler.options;\r\n let flow = compiler.currentFlow;\r\n let wasm64 = options.isWasm64;\r\n\r\n let tempLocal1 = flow.getTempLocal(options.usizeType, false);\r\n let tempLocalIndex2 = flow.getAndFreeTempLocal(options.usizeType, false).index;\r\n let tempLocalIndex1 = tempLocal1.index;\r\n\r\n expr = module.createBinary(wasm64 ? BinaryOp.XorI64 : BinaryOp.XorI32,\r\n module.createBinary(wasm64 ? BinaryOp.AddI64 : BinaryOp.AddI32,\r\n module.createTeeLocal(\r\n tempLocalIndex2,\r\n module.createBinary(wasm64 ? BinaryOp.ShrI64 : BinaryOp.ShrI32,\r\n module.createTeeLocal(tempLocalIndex1, arg0),\r\n wasm64 ? module.createI64(63) : module.createI32(31)\r\n )\r\n ),\r\n module.createGetLocal(tempLocalIndex1, options.nativeSizeType)\r\n ),\r\n module.createGetLocal(tempLocalIndex2, options.nativeSizeType)\r\n );\r\n\r\n flow.freeTempLocal(tempLocal1);\r\n break;\r\n }\r\n case TypeKind.I64: {\r\n let flow = compiler.currentFlow;\r\n\r\n let tempLocal1 = flow.getTempLocal(Type.i64, false);\r\n let tempLocalIndex2 = flow.getAndFreeTempLocal(Type.i64, false).index;\r\n let tempLocalIndex1 = tempLocal1.index;\r\n\r\n // (x + (x >> 63)) ^ (x >> 63)\r\n expr = module.createBinary(BinaryOp.XorI64,\r\n module.createBinary(BinaryOp.AddI64,\r\n module.createTeeLocal(\r\n tempLocalIndex2,\r\n module.createBinary(BinaryOp.ShrI64,\r\n module.createTeeLocal(tempLocalIndex1, arg0),\r\n module.createI64(63)\r\n )\r\n ),\r\n module.createGetLocal(tempLocalIndex1, NativeType.I64)\r\n ),\r\n module.createGetLocal(tempLocalIndex2, NativeType.I64)\r\n );\r\n\r\n flow.freeTempLocal(tempLocal1);\r\n break;\r\n }\r\n case TypeKind.USIZE:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.U64:\r\n case TypeKind.BOOL: {\r\n expr = arg0;\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n expr = module.createUnary(UnaryOp.AbsF32, arg0);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.createUnary(UnaryOp.AbsF64, arg0);\r\n break;\r\n }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n expr = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return expr;\r\n }\r\n case BuiltinSymbols.max: { // max(left: T, right: T) -> T\r\n if (\r\n checkTypeOptional(typeArguments, reportNode, compiler, true) |\r\n checkArgsRequired(operands, 2, reportNode, compiler)\r\n ) return module.createUnreachable();\r\n let arg0 = typeArguments\r\n ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP)\r\n : compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.WRAP);\r\n let type = compiler.currentType;\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.createUnreachable();\r\n }\r\n let arg1 = compiler.compileExpression(operands[1], type, ConversionKind.IMPLICIT, WrapMode.WRAP);\r\n let op: BinaryOp;\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32: { op = BinaryOp.GtI32; break; }\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: { op = BinaryOp.GtU32; break; }\r\n case TypeKind.I64: { op = BinaryOp.GtI64; break; }\r\n case TypeKind.U64: { op = BinaryOp.GtU64; break; }\r\n case TypeKind.ISIZE: {\r\n op = compiler.options.isWasm64\r\n ? BinaryOp.GtI64\r\n : BinaryOp.GtI32;\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n op = compiler.options.isWasm64\r\n ? BinaryOp.GtU64\r\n : BinaryOp.GtU32;\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n return module.createBinary(BinaryOp.MaxF32, arg0, arg1);\r\n }\r\n case TypeKind.F64: {\r\n return module.createBinary(BinaryOp.MaxF64, arg0, arg1);\r\n }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.createUnreachable();\r\n }\r\n }\r\n let flow = compiler.currentFlow;\r\n let nativeType = type.toNativeType();\r\n let tempLocal0 = flow.getTempLocal(type, true);\r\n let tempLocal1 = flow.getAndFreeTempLocal(type, true);\r\n flow.freeTempLocal(tempLocal0);\r\n return module.createSelect(\r\n module.createTeeLocal(tempLocal0.index, arg0),\r\n module.createTeeLocal(tempLocal1.index, arg1),\r\n module.createBinary(op,\r\n module.createGetLocal(tempLocal0.index, nativeType),\r\n module.createGetLocal(tempLocal1.index, nativeType)\r\n )\r\n );\r\n }\r\n case BuiltinSymbols.min: { // min(left: T, right: T) -> T\r\n if (\r\n checkTypeOptional(typeArguments, reportNode, compiler, true) |\r\n checkArgsRequired(operands, 2, reportNode, compiler)\r\n ) return module.createUnreachable();\r\n let arg0 = typeArguments\r\n ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP)\r\n : compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.WRAP);\r\n let type = compiler.currentType;\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.createUnreachable();\r\n }\r\n let arg1 = compiler.compileExpression(operands[1], type, ConversionKind.IMPLICIT, WrapMode.WRAP);\r\n let op: BinaryOp;\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32: { op = BinaryOp.LtI32; break; }\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: { op = BinaryOp.LtU32; break; }\r\n case TypeKind.I64: { op = BinaryOp.LtI64; break; }\r\n case TypeKind.U64: { op = BinaryOp.LtU64; break; }\r\n case TypeKind.ISIZE: {\r\n op = compiler.options.isWasm64\r\n ? BinaryOp.LtI64\r\n : BinaryOp.LtI32;\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n op = compiler.options.isWasm64\r\n ? BinaryOp.LtU64\r\n : BinaryOp.LtU32;\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n return module.createBinary(BinaryOp.MinF32, arg0, arg1);\r\n }\r\n case TypeKind.F64: {\r\n return module.createBinary(BinaryOp.MinF64, arg0, arg1);\r\n }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.createUnreachable();\r\n }\r\n }\r\n let flow = compiler.currentFlow;\r\n let nativeType = type.toNativeType();\r\n let tempLocal0 = flow.getTempLocal(type, true);\r\n let tempLocal1 = flow.getAndFreeTempLocal(type, true);\r\n flow.freeTempLocal(tempLocal0);\r\n return module.createSelect(\r\n module.createTeeLocal(tempLocal0.index, arg0),\r\n module.createTeeLocal(tempLocal1.index, arg1),\r\n module.createBinary(op,\r\n module.createGetLocal(tempLocal0.index, nativeType),\r\n module.createGetLocal(tempLocal1.index, nativeType)\r\n )\r\n );\r\n }\r\n case BuiltinSymbols.ceil: // any_rounding(value: T) -> T\r\n case BuiltinSymbols.floor: {\r\n if (\r\n checkTypeOptional(typeArguments, reportNode, compiler, true) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) return module.createUnreachable();\r\n let arg0 = typeArguments\r\n ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.NONE)\r\n : compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.NONE);\r\n let type = compiler.currentType;\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.createUnreachable();\r\n }\r\n let op: UnaryOp;\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32:\r\n case TypeKind.I64:\r\n case TypeKind.ISIZE:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.U64:\r\n case TypeKind.USIZE:\r\n case TypeKind.BOOL: return arg0; // considered rounded\r\n case TypeKind.F32: {\r\n op = prototype.internalName == BuiltinSymbols.ceil\r\n ? UnaryOp.CeilF32\r\n : UnaryOp.FloorF32;\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n op = prototype.internalName == BuiltinSymbols.ceil\r\n ? UnaryOp.CeilF64\r\n : UnaryOp.FloorF64;\r\n break;\r\n }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.createUnreachable();\r\n }\r\n }\r\n return module.createUnary(op, arg0);\r\n }\r\n case BuiltinSymbols.copysign: { // copysign(left: T, right: T) -> T\r\n if (\r\n checkTypeOptional(typeArguments, reportNode, compiler, true) |\r\n checkArgsRequired(operands, 2, reportNode, compiler)\r\n ) return module.createUnreachable();\r\n let arg0 = typeArguments\r\n ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.NONE)\r\n : compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.NONE);\r\n let type = compiler.currentType;\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.createUnreachable();\r\n }\r\n let arg1 = compiler.compileExpression(operands[1], type, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n let op: BinaryOp;\r\n switch (type.kind) {\r\n // TODO: does an integer version make sense?\r\n case TypeKind.F32: { op = BinaryOp.CopysignF32; break; }\r\n case TypeKind.F64: { op = BinaryOp.CopysignF64; break; }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.createUnreachable();\r\n }\r\n }\r\n return module.createBinary(op, arg0, arg1);\r\n }\r\n case BuiltinSymbols.nearest: { // nearest(value: T) -> T\r\n if (\r\n checkTypeOptional(typeArguments, reportNode, compiler, true) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) return module.createUnreachable();\r\n let arg0 = typeArguments\r\n ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.NONE)\r\n : compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.NONE);\r\n let type = compiler.currentType;\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.createUnreachable();\r\n }\r\n let expr: ExpressionRef;\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32:\r\n case TypeKind.I64:\r\n case TypeKind.ISIZE:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.U64:\r\n case TypeKind.USIZE:\r\n case TypeKind.BOOL: {\r\n expr = arg0;\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n expr = module.createUnary(UnaryOp.NearestF32, arg0);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.createUnary(UnaryOp.NearestF64, arg0);\r\n break;\r\n }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n expr = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return expr;\r\n }\r\n case BuiltinSymbols.reinterpret: { // reinterpret(value: *) -> T\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler, true) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) return module.createUnreachable();\r\n let type = typeArguments![0];\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.currentType = type;\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.createUnreachable();\r\n }\r\n let expr: ExpressionRef;\r\n switch (type.kind) {\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n let arg0 = compiler.compileExpression(operands[0], Type.f32, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n expr = module.createUnary(UnaryOp.ReinterpretF32, arg0);\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n let arg0 = compiler.compileExpression(operands[0], Type.f64, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n expr = module.createUnary(UnaryOp.ReinterpretF64, arg0);\r\n break;\r\n }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n let arg0 = compiler.compileExpression(\r\n operands[0],\r\n compiler.options.isWasm64\r\n ? Type.f64\r\n : Type.f32,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n expr = module.createUnary(\r\n compiler.options.isWasm64\r\n ? UnaryOp.ReinterpretF64\r\n : UnaryOp.ReinterpretF32,\r\n arg0\r\n );\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n let arg0 = compiler.compileExpression(operands[0], Type.i32, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n expr = module.createUnary(UnaryOp.ReinterpretI32, arg0);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n let arg0 = compiler.compileExpression(operands[0], Type.i64, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n expr = module.createUnary(UnaryOp.ReinterpretI64, arg0);\r\n break;\r\n }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n expr = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n compiler.currentType = type;\r\n return expr;\r\n }\r\n case BuiltinSymbols.sqrt: { // sqrt(value: T) -> T\r\n if (\r\n checkTypeOptional(typeArguments, reportNode, compiler, true) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) return module.createUnreachable();\r\n let arg0 = typeArguments\r\n ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.NONE)\r\n : compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.NONE);\r\n let type = compiler.currentType;\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.currentType = type;\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.createUnreachable();\r\n }\r\n let expr: ExpressionRef;\r\n switch (type.kind) { // TODO: integer versions (that return f64 or convert)?\r\n case TypeKind.F32: {\r\n expr = module.createUnary(UnaryOp.SqrtF32, arg0);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.createUnary(UnaryOp.SqrtF64, arg0);\r\n break;\r\n }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n expr = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return expr;\r\n }\r\n case BuiltinSymbols.trunc: { // trunc(value: T) -> T\r\n if (\r\n checkTypeOptional(typeArguments, reportNode, compiler, true) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) return module.createUnreachable();\r\n let arg0 = typeArguments\r\n ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.NONE)\r\n : compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.NONE);\r\n let type = compiler.currentType;\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n return module.createUnreachable();\r\n }\r\n let expr: ExpressionRef;\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32:\r\n case TypeKind.I64:\r\n case TypeKind.ISIZE:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.U64:\r\n case TypeKind.USIZE:\r\n case TypeKind.BOOL: {\r\n expr = arg0;\r\n break;\r\n }\r\n // TODO: truncate to contextual type directly (if not void etc.)?\r\n case TypeKind.F32: {\r\n expr = module.createUnary(UnaryOp.TruncF32, arg0);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.createUnary(UnaryOp.TruncF64, arg0);\r\n break;\r\n }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n expr = module.createUnreachable();\r\n break;\r\n }\r\n }\r\n return expr;\r\n }\r\n\r\n // === Memory access ==========================================================================\r\n\r\n case BuiltinSymbols.load: { // load(offset: usize, immOffset?: usize, immAlign?: usize) -> T*\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler, true) |\r\n checkArgsOptional(operands, 1, 3, reportNode, compiler)\r\n ) return module.createUnreachable();\r\n let type = typeArguments![0];\r\n let outType = (\r\n type.is(TypeFlags.INTEGER) &&\r\n contextualType.is(TypeFlags.INTEGER) &&\r\n contextualType.size > type.size\r\n ) ? contextualType : type;\r\n let arg0 = compiler.compileExpression(\r\n operands[0],\r\n compiler.options.usizeType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n let numOperands = operands.length;\r\n let immOffset = numOperands >= 2 ? evaluateImmediateOffset(operands[1], compiler) : 0; // reports\r\n if (immOffset < 0) {\r\n compiler.currentType = outType;\r\n return module.createUnreachable();\r\n }\r\n let immAlign: i32;\r\n let naturalAlign = type.byteSize;\r\n if (numOperands == 3) {\r\n immAlign = evaluateImmediateOffset(operands[2], compiler);\r\n if (immAlign < 0) {\r\n compiler.currentType = outType;\r\n return module.createUnreachable();\r\n }\r\n if (immAlign > naturalAlign) {\r\n compiler.error(\r\n DiagnosticCode._0_must_be_a_value_between_1_and_2_inclusive,\r\n operands[2].range, \"Alignment\", \"0\", naturalAlign.toString()\r\n );\r\n compiler.currentType = outType;\r\n return module.createUnreachable();\r\n }\r\n if (!isPowerOf2(immAlign)) {\r\n compiler.error(\r\n DiagnosticCode._0_must_be_a_power_of_two,\r\n operands[2].range, \"Alignment\"\r\n );\r\n compiler.currentType = outType;\r\n return module.createUnreachable();\r\n }\r\n } else {\r\n immAlign = naturalAlign;\r\n }\r\n compiler.currentType = outType;\r\n return module.createLoad(\r\n type.byteSize,\r\n type.is(TypeFlags.SIGNED | TypeFlags.INTEGER),\r\n arg0,\r\n outType.toNativeType(),\r\n immOffset,\r\n immAlign\r\n );\r\n }\r\n case BuiltinSymbols.store: { // store(offset: usize, value: T*, offset?: usize, align?: usize) -> void\r\n compiler.currentType = Type.void;\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler) |\r\n checkArgsOptional(operands, 2, 4, reportNode, compiler)\r\n ) return module.createUnreachable();\r\n let type = typeArguments![0];\r\n let arg0 = compiler.compileExpression(\r\n operands[0],\r\n compiler.options.usizeType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n let arg1 = isAsm\r\n ? compiler.compileExpression(\r\n operands[1],\r\n contextualType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n )\r\n : compiler.compileExpression(\r\n operands[1],\r\n type,\r\n type.is(TypeFlags.INTEGER)\r\n ? ConversionKind.NONE // no need to convert to small int (but now might result in a float)\r\n : ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n let inType = compiler.currentType;\r\n if (\r\n type.is(TypeFlags.INTEGER) &&\r\n (\r\n !inType.is(TypeFlags.INTEGER) || // float to int\r\n inType.size < type.size // int to larger int (clear garbage bits)\r\n )\r\n ) {\r\n arg1 = compiler.convertExpression(\r\n arg1,\r\n inType, type,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE, // still clears garbage bits\r\n operands[1]\r\n );\r\n inType = type;\r\n }\r\n let immOffset = operands.length >= 3 ? evaluateImmediateOffset(operands[2], compiler) : 0; // reports\r\n if (immOffset < 0) {\r\n compiler.currentType = Type.void;\r\n return module.createUnreachable();\r\n }\r\n let immAlign: i32;\r\n let naturalAlign = type.byteSize;\r\n if (operands.length == 4) {\r\n immAlign = evaluateImmediateOffset(operands[3], compiler);\r\n if (immAlign < 0) {\r\n compiler.currentType = Type.void;\r\n return module.createUnreachable();\r\n }\r\n if (immAlign > naturalAlign) {\r\n compiler.error(\r\n DiagnosticCode._0_must_be_a_value_between_1_and_2_inclusive,\r\n operands[3].range, \"Alignment\", \"0\", naturalAlign.toString()\r\n );\r\n compiler.currentType = Type.void;\r\n return module.createUnreachable();\r\n }\r\n if (!isPowerOf2(immAlign)) {\r\n compiler.error(\r\n DiagnosticCode._0_must_be_a_power_of_two,\r\n operands[3].range, \"Alignment\"\r\n );\r\n compiler.currentType = Type.void;\r\n return module.createUnreachable();\r\n }\r\n } else {\r\n immAlign = naturalAlign;\r\n }\r\n compiler.currentType = Type.void;\r\n return module.createStore(type.byteSize, arg0, arg1, inType.toNativeType(), immOffset, immAlign);\r\n }\r\n\r\n // === Atomics ================================================================================\r\n\r\n case BuiltinSymbols.atomic_load: { // load(offset: usize, immOffset?: usize) -> T*\r\n if (!compiler.options.hasFeature(Feature.THREADS)) break;\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler, true) |\r\n checkArgsOptional(operands, 1, 2, reportNode, compiler)\r\n ) return module.createUnreachable();\r\n let type = typeArguments![0];\r\n let outType = (\r\n type.is(TypeFlags.INTEGER) &&\r\n contextualType.is(TypeFlags.INTEGER) &&\r\n contextualType.size > type.size\r\n ) ? contextualType : type;\r\n if (!type.is(TypeFlags.INTEGER)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n compiler.currentType = outType;\r\n return module.createUnreachable();\r\n }\r\n let arg0 = compiler.compileExpression(\r\n operands[0],\r\n compiler.options.usizeType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n let immOffset = operands.length == 2 ? evaluateImmediateOffset(operands[1], compiler) : 0; // reports\r\n if (immOffset < 0) {\r\n compiler.currentType = outType;\r\n return module.createUnreachable();\r\n }\r\n compiler.currentType = outType;\r\n return module.createAtomicLoad(\r\n type.byteSize,\r\n arg0,\r\n outType.toNativeType(),\r\n immOffset\r\n );\r\n }\r\n case BuiltinSymbols.atomic_store: { // store(offset: usize, value: T*, immOffset?: usize) -> void\r\n if (!compiler.options.hasFeature(Feature.THREADS)) break;\r\n compiler.currentType = Type.void;\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler) |\r\n checkArgsOptional(operands, 2, 3, reportNode, compiler)\r\n ) return module.createUnreachable();\r\n let type = typeArguments![0];\r\n if (!type.is(TypeFlags.INTEGER) || type.size < 8) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.createUnreachable();\r\n }\r\n let arg0 = compiler.compileExpression(\r\n operands[0],\r\n compiler.options.usizeType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n let arg1 = isAsm\r\n ? compiler.compileExpression(\r\n operands[1],\r\n contextualType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n )\r\n : compiler.compileExpression(\r\n operands[1],\r\n type,\r\n type.is(TypeFlags.INTEGER)\r\n ? ConversionKind.NONE // no need to convert to small int (but now might result in a float)\r\n : ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n let inType = compiler.currentType;\r\n if (\r\n type.is(TypeFlags.INTEGER) &&\r\n (\r\n !inType.is(TypeFlags.INTEGER) || // float to int\r\n inType.size < type.size // int to larger int (clear garbage bits)\r\n )\r\n ) {\r\n arg1 = compiler.convertExpression(\r\n arg1,\r\n inType, type,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE, // still clears garbage bits\r\n operands[1]\r\n );\r\n inType = type;\r\n }\r\n let immOffset = operands.length == 3 ? evaluateImmediateOffset(operands[2], compiler) : 0; // reports\r\n if (immOffset < 0) {\r\n compiler.currentType = Type.void;\r\n return module.createUnreachable();\r\n }\r\n compiler.currentType = Type.void;\r\n return module.createAtomicStore(type.byteSize, arg0, arg1, inType.toNativeType(), immOffset);\r\n }\r\n case BuiltinSymbols.atomic_add: // any_atomic_binary(ptr, value: T, immOffset?: usize) -> T\r\n case BuiltinSymbols.atomic_sub:\r\n case BuiltinSymbols.atomic_and:\r\n case BuiltinSymbols.atomic_or:\r\n case BuiltinSymbols.atomic_xor:\r\n case BuiltinSymbols.atomic_xchg: {\r\n if (!compiler.options.hasFeature(Feature.THREADS)) break;\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler, true) |\r\n checkArgsOptional(operands, 2, 3, reportNode, compiler)\r\n ) return module.createUnreachable();\r\n let type = typeArguments![0];\r\n if (!type.is(TypeFlags.INTEGER) || type.size < 8) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.createUnreachable();\r\n }\r\n let arg0 = compiler.compileExpression(\r\n operands[0],\r\n compiler.options.usizeType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n let arg1 = isAsm\r\n ? compiler.compileExpression(\r\n operands[1],\r\n contextualType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n )\r\n : compiler.compileExpression(\r\n operands[1],\r\n type,\r\n type.is(TypeFlags.INTEGER)\r\n ? ConversionKind.NONE // no need to convert to small int (but now might result in a float)\r\n : ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n let inType = compiler.currentType;\r\n if (\r\n type.is(TypeFlags.INTEGER) &&\r\n (\r\n !inType.is(TypeFlags.INTEGER) || // float to int\r\n inType.size < type.size // int to larger int (clear garbage bits)\r\n )\r\n ) {\r\n arg1 = compiler.convertExpression(\r\n arg1,\r\n inType, type,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE, // still clears garbage bits\r\n operands[1]\r\n );\r\n inType = type;\r\n }\r\n let immOffset = operands.length == 3 ? evaluateImmediateOffset(operands[2], compiler) : 0; // reports\r\n if (immOffset < 0) {\r\n compiler.currentType = inType;\r\n return module.createUnreachable();\r\n }\r\n let op: AtomicRMWOp;\r\n switch (prototype.internalName) {\r\n default: assert(false);\r\n case BuiltinSymbols.atomic_add: { op = AtomicRMWOp.Add; break; }\r\n case BuiltinSymbols.atomic_sub: { op = AtomicRMWOp.Sub; break; }\r\n case BuiltinSymbols.atomic_and: { op = AtomicRMWOp.And; break; }\r\n case BuiltinSymbols.atomic_or: { op = AtomicRMWOp.Or; break; }\r\n case BuiltinSymbols.atomic_xor: { op = AtomicRMWOp.Xor; break; }\r\n case BuiltinSymbols.atomic_xchg: { op = AtomicRMWOp.Xchg; break; }\r\n }\r\n compiler.currentType = inType;\r\n return module.createAtomicRMW(\r\n op, type.byteSize, immOffset, arg0, arg1, inType.toNativeType()\r\n );\r\n }\r\n case BuiltinSymbols.atomic_cmpxchg: { // cmpxchg(ptr: usize, expected: T, replacement: T, off?: usize): T\r\n if (!compiler.options.hasFeature(Feature.THREADS)) break;\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler, true) |\r\n checkArgsOptional(operands, 3, 4, reportNode, compiler)\r\n ) return module.createUnreachable();\r\n let type = typeArguments![0];\r\n if (!type.is(TypeFlags.INTEGER) || type.size < 8) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.createUnreachable();\r\n }\r\n let arg0 = compiler.compileExpression(\r\n operands[0],\r\n compiler.options.usizeType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n let arg1 = isAsm\r\n ? compiler.compileExpression(\r\n operands[1],\r\n contextualType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n )\r\n : compiler.compileExpression(\r\n operands[1],\r\n type,\r\n type.is(TypeFlags.INTEGER)\r\n ? ConversionKind.NONE // no need to convert to small int (but now might result in a float)\r\n : ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n let inType = compiler.currentType;\r\n let arg2 = compiler.compileExpression(\r\n operands[2],\r\n inType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n if (\r\n type.is(TypeFlags.INTEGER) &&\r\n (\r\n !inType.is(TypeFlags.INTEGER) || // float to int\r\n inType.size < type.size // int to larger int (clear garbage bits)\r\n )\r\n ) {\r\n arg1 = compiler.convertExpression(\r\n arg1,\r\n inType, type,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE, // still clears garbage bits\r\n operands[1]\r\n );\r\n arg2 = compiler.convertExpression(\r\n arg2,\r\n inType, type,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE, // still clears garbage bits\r\n operands[2]\r\n );\r\n inType = type;\r\n }\r\n let immOffset = operands.length == 4 ? evaluateImmediateOffset(operands[3], compiler) : 0; // reports\r\n if (immOffset < 0) {\r\n compiler.currentType = inType;\r\n return module.createUnreachable();\r\n }\r\n compiler.currentType = inType;\r\n return module.createAtomicCmpxchg(\r\n type.byteSize, immOffset, arg0, arg1, arg2, inType.toNativeType()\r\n );\r\n }\r\n case BuiltinSymbols.atomic_wait: { // wait(ptr: usize, expected: T, timeout: i64): i32;\r\n if (!compiler.options.hasFeature(Feature.THREADS)) break;\r\n compiler.currentType = Type.i32;\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler) |\r\n checkArgsRequired(operands, 3, reportNode, compiler)\r\n ) return module.createUnreachable();\r\n let type = typeArguments![0];\r\n if (!type.is(TypeFlags.INTEGER) || type.size < 32) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.createUnreachable();\r\n }\r\n let arg0 = compiler.compileExpression(\r\n operands[0],\r\n compiler.options.usizeType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n let arg1 = compiler.compileExpression(\r\n operands[1],\r\n type,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n let arg2 = compiler.compileExpression(\r\n operands[2],\r\n Type.i64,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n compiler.currentType = Type.i32;\r\n return module.createAtomicWait(arg0, arg1, arg2, type.toNativeType());\r\n }\r\n case BuiltinSymbols.atomic_notify: { // notify(ptr: usize, count: i32): i32;\r\n if (!compiler.options.hasFeature(Feature.THREADS)) break;\r\n compiler.currentType = Type.i32;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 2, reportNode, compiler)\r\n ) return module.createUnreachable();\r\n let arg0 = compiler.compileExpression(\r\n operands[0],\r\n compiler.options.usizeType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n let arg1 = compiler.compileExpression(\r\n operands[1],\r\n Type.i32,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n compiler.currentType = Type.i32;\r\n return module.createAtomicNotify(arg0, arg1);\r\n }\r\n\r\n // === Control flow ===========================================================================\r\n\r\n case BuiltinSymbols.select: { // select(ifTrue: T, ifFalse: T, condition: bool) -> T\r\n if (\r\n checkTypeOptional(typeArguments, reportNode, compiler, true) |\r\n checkArgsRequired(operands, 3, reportNode, compiler)\r\n ) return module.createUnreachable();\r\n let arg0 = typeArguments\r\n ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.NONE)\r\n : compiler.compileExpressionRetainType(operands[0], Type.i32, WrapMode.NONE);\r\n let type = compiler.currentType;\r\n if (!type.isAny(TypeFlags.VALUE | TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.createUnreachable();\r\n }\r\n let arg1 = compiler.compileExpression(operands[1], type, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n let arg2 = compiler.makeIsTrueish(\r\n compiler.compileExpressionRetainType(operands[2], Type.bool, WrapMode.NONE),\r\n compiler.currentType // ^\r\n );\r\n compiler.currentType = type;\r\n return module.createSelect(arg0, arg1, arg2);\r\n }\r\n case BuiltinSymbols.unreachable: { // unreachable() -> *\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.typeArgumentsRange, prototype.internalName\r\n );\r\n }\r\n checkArgsRequired(operands, 0, reportNode, compiler);\r\n return module.createUnreachable();\r\n }\r\n\r\n // === Memory =================================================================================\r\n\r\n case BuiltinSymbols.memory_size: { // memory.size() -> i32\r\n compiler.currentType = Type.i32;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 0, reportNode, compiler)\r\n ) return module.createUnreachable();\r\n return module.createHost(HostOp.CurrentMemory);\r\n }\r\n case BuiltinSymbols.memory_grow: { // memory.grow(pages: i32) -> i32\r\n compiler.currentType = Type.i32;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) return module.createUnreachable();\r\n return module.createHost(HostOp.GrowMemory, null, [\r\n compiler.compileExpression(operands[0], Type.i32, ConversionKind.IMPLICIT, WrapMode.NONE)\r\n ]);\r\n }\r\n case BuiltinSymbols.memory_copy: { // memory.copy(dest: usize, src: usize: n: usize) -> void\r\n compiler.currentType = Type.void;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 3, reportNode, compiler)\r\n ) return module.createUnreachable();\r\n if (!compiler.options.hasFeature(Feature.BULK_MEMORY)) {\r\n let instance = compiler.resolver.resolveFunction(prototype, null); // reports\r\n compiler.currentType = Type.void;\r\n if (!instance) return module.createUnreachable();\r\n return compiler.compileCallDirect(instance, operands, reportNode);\r\n }\r\n let usizeType = compiler.options.usizeType;\r\n let arg0 = compiler.compileExpression(\r\n operands[0],\r\n usizeType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n let arg1 = compiler.compileExpression(\r\n operands[1],\r\n usizeType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n let arg2 = compiler.compileExpression(\r\n operands[2],\r\n usizeType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n compiler.currentType = Type.void;\r\n return module.createMemoryCopy(arg0, arg1, arg2);\r\n }\r\n case BuiltinSymbols.memory_fill: { // memory.fill(dest: usize, value: u8, n: usize) -> void\r\n compiler.currentType = Type.void;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 3, reportNode, compiler)\r\n ) return module.createUnreachable();\r\n if (!compiler.options.hasFeature(Feature.BULK_MEMORY)) {\r\n let instance = compiler.resolver.resolveFunction(prototype, null); // reports\r\n compiler.currentType = Type.void;\r\n if (!instance) return module.createUnreachable();\r\n return compiler.compileCallDirect(instance, operands, reportNode);\r\n }\r\n let usizeType = compiler.options.usizeType;\r\n let arg0 = compiler.compileExpression(\r\n operands[0],\r\n usizeType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n let arg1 = compiler.compileExpression(\r\n operands[1],\r\n Type.u8,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n let arg2 = compiler.compileExpression(\r\n operands[2],\r\n usizeType,\r\n ConversionKind.IMPLICIT,\r\n WrapMode.NONE\r\n );\r\n compiler.currentType = Type.void;\r\n return module.createMemoryFill(arg0, arg1, arg2);\r\n }\r\n\r\n // === Helpers ================================================================================\r\n\r\n case BuiltinSymbols.changetype: { // changetype(value: *) -> T\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler, true) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) return module.createUnreachable();\r\n let toType = typeArguments![0];\r\n let arg0 = compiler.compileExpressionRetainType(\r\n operands[0],\r\n toType,\r\n WrapMode.NONE\r\n );\r\n let fromType = compiler.currentType;\r\n compiler.currentType = toType;\r\n if (fromType.size != toType.size) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n return module.createUnreachable();\r\n }\r\n return arg0;\r\n }\r\n case BuiltinSymbols.assert: { // assert(isTrueish: T, message?: string) -> T{!= null}\r\n if (\r\n checkTypeOptional(typeArguments, reportNode, compiler) |\r\n checkArgsOptional(operands, 1, 2, reportNode, compiler)\r\n ) {\r\n if (typeArguments) {\r\n assert(typeArguments.length); // otherwise invalid, should not been set at all\r\n compiler.currentType = typeArguments[0].nonNullableType;\r\n }\r\n return module.createUnreachable();\r\n }\r\n let arg0 = typeArguments\r\n ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP)\r\n : compiler.compileExpressionRetainType(operands[0], Type.bool, WrapMode.WRAP);\r\n let type = compiler.currentType;\r\n compiler.currentType = type.nonNullableType;\r\n\r\n // return ifTrueish if assertions are disabled\r\n if (compiler.options.noAssert) {\r\n if (contextualType == Type.void) { // simplify if dropped anyway\r\n compiler.currentType = Type.void;\r\n return module.createNop();\r\n }\r\n return arg0;\r\n }\r\n\r\n // otherwise call abort if the assertion is false-ish\r\n let abort = compileAbort(compiler, operands.length == 2 ? operands[1] : null, reportNode);\r\n compiler.currentType = type.nonNullableType;\r\n let expr: ExpressionRef;\r\n if (contextualType == Type.void) { // simplify if dropped anyway\r\n compiler.currentType = Type.void;\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: {\r\n expr = module.createIf(\r\n module.createUnary(UnaryOp.EqzI32, arg0),\r\n abort\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.createIf(\r\n module.createUnary(UnaryOp.EqzI64, arg0),\r\n abort\r\n );\r\n break;\r\n }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n expr = module.createIf(\r\n module.createUnary(\r\n compiler.options.isWasm64\r\n ? UnaryOp.EqzI64\r\n : UnaryOp.EqzI32,\r\n arg0\r\n ),\r\n abort\r\n );\r\n break;\r\n }\r\n // TODO: also check for NaN in float assertions, as in `Boolean(NaN) -> false`?\r\n case TypeKind.F32: {\r\n expr = module.createIf(\r\n module.createBinary(BinaryOp.EqF32,\r\n arg0,\r\n module.createF32(0)\r\n ),\r\n abort\r\n );\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.createIf(\r\n module.createBinary(BinaryOp.EqF64,\r\n arg0,\r\n module.createF64(0)\r\n ),\r\n abort\r\n );\r\n break;\r\n }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n expr = abort;\r\n break;\r\n }\r\n }\r\n } else {\r\n compiler.currentType = type.nonNullableType;\r\n switch (compiler.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: {\r\n let tempLocal = compiler.currentFlow.getAndFreeTempLocal(type, true /* arg0 is wrapped */);\r\n expr = module.createIf(\r\n module.createTeeLocal(tempLocal.index, arg0),\r\n module.createGetLocal(tempLocal.index, NativeType.I32),\r\n abort\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n let tempLocal = compiler.currentFlow.getAndFreeTempLocal(Type.i64, false);\r\n expr = module.createIf(\r\n module.createUnary(UnaryOp.EqzI64,\r\n module.createTeeLocal(tempLocal.index, arg0)\r\n ),\r\n abort,\r\n module.createGetLocal(tempLocal.index, NativeType.I64)\r\n );\r\n break;\r\n }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n let tempLocal = compiler.currentFlow.getAndFreeTempLocal(compiler.options.usizeType, false);\r\n expr = module.createIf(\r\n module.createUnary(\r\n compiler.options.isWasm64\r\n ? UnaryOp.EqzI64\r\n : UnaryOp.EqzI32,\r\n module.createTeeLocal(tempLocal.index, arg0)\r\n ),\r\n abort,\r\n module.createGetLocal(tempLocal.index, compiler.options.nativeSizeType)\r\n );\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n let tempLocal = compiler.currentFlow.getAndFreeTempLocal(Type.f32, false);\r\n expr = module.createIf(\r\n module.createBinary(BinaryOp.EqF32,\r\n module.createTeeLocal(tempLocal.index, arg0),\r\n module.createF32(0)\r\n ),\r\n abort,\r\n module.createGetLocal(tempLocal.index, NativeType.F32)\r\n );\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n let tempLocal = compiler.currentFlow.getAndFreeTempLocal(Type.f64, false);\r\n expr = module.createIf(\r\n module.createBinary(BinaryOp.EqF64,\r\n module.createTeeLocal(tempLocal.index, arg0),\r\n module.createF64(0)\r\n ),\r\n abort,\r\n module.createGetLocal(tempLocal.index, NativeType.F64)\r\n );\r\n break;\r\n }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n expr = abort;\r\n break;\r\n }\r\n }\r\n }\r\n return expr;\r\n }\r\n case BuiltinSymbols.unchecked: { // unchecked(expr: *) -> *\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) return module.createUnreachable();\r\n let flow = compiler.currentFlow;\r\n let alreadyUnchecked = flow.is(FlowFlags.UNCHECKED_CONTEXT);\r\n flow.set(FlowFlags.UNCHECKED_CONTEXT);\r\n let expr = compiler.compileExpressionRetainType(operands[0], contextualType, WrapMode.NONE);\r\n if (!alreadyUnchecked) flow.unset(FlowFlags.UNCHECKED_CONTEXT);\r\n return expr;\r\n }\r\n case BuiltinSymbols.call_indirect: { // call_indirect(target: Function | u32, ...args: *[]) -> T\r\n if (\r\n checkTypeOptional(typeArguments, reportNode, compiler, true) |\r\n checkArgsOptional(operands, 1, i32.MAX_VALUE, reportNode, compiler)\r\n ) return module.createUnreachable();\r\n let returnType = typeArguments ? typeArguments[0] : contextualType;\r\n let arg0 = compiler.compileExpressionRetainType(operands[0], Type.u32, WrapMode.NONE);\r\n let arg0Type = compiler.currentType;\r\n if (!(\r\n arg0Type == Type.u32 || // either plain index\r\n arg0Type.kind == TypeKind.U32 && arg0Type.signatureReference // or function reference\r\n )) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n operands[0].range\r\n );\r\n return module.createUnreachable();\r\n }\r\n let numOperands = operands.length - 1;\r\n let operandExprs = new Array(numOperands);\r\n let nativeReturnType = returnType.toNativeType();\r\n let parameterTypes = new Array(numOperands);\r\n let nativeParamTypes = new Array(numOperands);\r\n for (let i = 0; i < numOperands; ++i) {\r\n operandExprs[i] = compiler.compileExpressionRetainType(operands[1 + i], Type.i32, WrapMode.NONE);\r\n let operandType = compiler.currentType;\r\n parameterTypes[i] = operandType;\r\n nativeParamTypes[i] = operandType.toNativeType();\r\n }\r\n let typeName = Signature.makeSignatureString(parameterTypes, returnType);\r\n let typeRef = module.getFunctionTypeBySignature(nativeReturnType, nativeParamTypes);\r\n if (!typeRef) typeRef = module.addFunctionType(typeName, nativeReturnType, nativeParamTypes);\r\n compiler.currentType = returnType;\r\n // of course this can easily result in a 'RuntimeError: function signature mismatch' trap and\r\n // thus must be used with care. it exists because it *might* be useful in specific scenarios.\r\n return module.createCallIndirect(arg0, operandExprs, typeName);\r\n }\r\n case BuiltinSymbols.instantiate: { // instantiate(...args: *[]) -> T\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler, true)\r\n ) return module.createUnreachable();\r\n let classInstance = typeArguments![0].classReference;\r\n if (!classInstance) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.createUnreachable();\r\n }\r\n compiler.currentType = classInstance.type;\r\n return compiler.compileInstantiate(classInstance, operands, reportNode);\r\n }\r\n\r\n // === User-defined diagnostics ===============================================================\r\n\r\n case BuiltinSymbols.ERROR: {\r\n checkTypeAbsent(typeArguments, reportNode, prototype);\r\n compiler.error(\r\n DiagnosticCode.User_defined_0,\r\n reportNode.range, (operands.length ? operands[0] : reportNode).range.toString()\r\n );\r\n return module.createUnreachable();\r\n }\r\n case BuiltinSymbols.WARNING: {\r\n checkTypeAbsent(typeArguments, reportNode, prototype);\r\n compiler.warning(\r\n DiagnosticCode.User_defined_0,\r\n reportNode.range, (operands.length ? operands[0] : reportNode).range.toString()\r\n );\r\n return module.createNop();\r\n }\r\n case BuiltinSymbols.INFO: {\r\n checkTypeAbsent(typeArguments, reportNode, prototype);\r\n compiler.info(\r\n DiagnosticCode.User_defined_0,\r\n reportNode.range, (operands.length ? operands[0] : reportNode).range.toString()\r\n );\r\n return module.createNop();\r\n }\r\n\r\n // === Portable type conversions ==============================================================\r\n\r\n case BuiltinSymbols.i8: {\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.i8;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(operands[0], Type.i8, ConversionKind.EXPLICIT, WrapMode.NONE);\r\n }\r\n case BuiltinSymbols.i16: {\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.i16;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(operands[0], Type.i16, ConversionKind.EXPLICIT, WrapMode.NONE);\r\n }\r\n case BuiltinSymbols.i32: {\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.i32;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(operands[0], Type.i32, ConversionKind.EXPLICIT, WrapMode.NONE);\r\n }\r\n case BuiltinSymbols.i64: {\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.i64;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(operands[0], Type.i64, ConversionKind.EXPLICIT, WrapMode.NONE);\r\n }\r\n case BuiltinSymbols.isize: {\r\n let isizeType = compiler.options.isizeType;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) {\r\n compiler.currentType = isizeType;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(operands[0], isizeType, ConversionKind.EXPLICIT, WrapMode.NONE);\r\n }\r\n case BuiltinSymbols.u8: {\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.u8;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(operands[0], Type.u8, ConversionKind.EXPLICIT, WrapMode.NONE);\r\n }\r\n case BuiltinSymbols.u16: {\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.u16;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(operands[0], Type.u16, ConversionKind.EXPLICIT, WrapMode.NONE);\r\n }\r\n case BuiltinSymbols.u32: {\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.u32;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(operands[0], Type.u32, ConversionKind.EXPLICIT, WrapMode.NONE);\r\n }\r\n case BuiltinSymbols.u64: {\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.u64;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(operands[0], Type.u64, ConversionKind.EXPLICIT, WrapMode.NONE);\r\n }\r\n case BuiltinSymbols.usize: {\r\n let usizeType = compiler.options.usizeType;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) {\r\n compiler.currentType = usizeType;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(operands[0], usizeType, ConversionKind.EXPLICIT, WrapMode.NONE);\r\n }\r\n case BuiltinSymbols.bool: {\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.bool;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(operands[0], Type.bool, ConversionKind.EXPLICIT, WrapMode.NONE);\r\n }\r\n case BuiltinSymbols.f32: {\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.f32;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(operands[0], Type.f32, ConversionKind.EXPLICIT, WrapMode.NONE);\r\n }\r\n case BuiltinSymbols.f64: {\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.f64;\r\n return module.createUnreachable();\r\n }\r\n return compiler.compileExpression(operands[0], Type.f64, ConversionKind.EXPLICIT, WrapMode.NONE);\r\n }\r\n\r\n // === SIMD ===================================================================================\r\n\r\n case BuiltinSymbols.v128: // alias for now\r\n case BuiltinSymbols.i8x16: {\r\n if (!compiler.options.hasFeature(Feature.SIMD)) break;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 16, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n let bytes = new Uint8Array(16);\r\n for (let i = 0; i < 16; ++i) {\r\n let value = operands[i];\r\n if (value) {\r\n let expr = module.precomputeExpression(\r\n compiler.compileExpression(value, Type.i8, ConversionKind.IMPLICIT, WrapMode.NONE)\r\n );\r\n if (getExpressionId(expr) != ExpressionId.Const) {\r\n compiler.error(\r\n DiagnosticCode.Expression_must_be_a_compile_time_constant,\r\n value.range\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n assert(getExpressionType(expr) == NativeType.I32);\r\n writeI8(getConstValueI32(expr), bytes, i);\r\n }\r\n }\r\n compiler.currentType = Type.v128;\r\n return module.createV128(bytes);\r\n }\r\n case BuiltinSymbols.i16x8: {\r\n if (!compiler.options.hasFeature(Feature.SIMD)) break;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 8, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n let bytes = new Uint8Array(16);\r\n for (let i = 0; i < 8; ++i) {\r\n let value = operands[i];\r\n if (value) {\r\n let expr = module.precomputeExpression(\r\n compiler.compileExpression(value, Type.i16, ConversionKind.IMPLICIT, WrapMode.NONE)\r\n );\r\n if (getExpressionId(expr) != ExpressionId.Const) {\r\n compiler.error(\r\n DiagnosticCode.Expression_must_be_a_compile_time_constant,\r\n value.range\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n assert(getExpressionType(expr) == NativeType.I32);\r\n writeI16(getConstValueI32(expr), bytes, i << 1);\r\n }\r\n }\r\n compiler.currentType = Type.v128;\r\n return module.createV128(bytes);\r\n }\r\n case BuiltinSymbols.i32x4: {\r\n if (!compiler.options.hasFeature(Feature.SIMD)) break;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 4, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n let bytes = new Uint8Array(16);\r\n for (let i = 0; i < 4; ++i) {\r\n let value = operands[i];\r\n if (value) {\r\n let expr = module.precomputeExpression(\r\n compiler.compileExpression(value, Type.i32, ConversionKind.IMPLICIT, WrapMode.NONE)\r\n );\r\n if (getExpressionId(expr) != ExpressionId.Const) {\r\n compiler.error(\r\n DiagnosticCode.Expression_must_be_a_compile_time_constant,\r\n value.range\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n assert(getExpressionType(expr) == NativeType.I32);\r\n writeI32(getConstValueI32(expr), bytes, i << 2);\r\n }\r\n }\r\n compiler.currentType = Type.v128;\r\n return module.createV128(bytes);\r\n }\r\n case BuiltinSymbols.i64x2: {\r\n if (!compiler.options.hasFeature(Feature.SIMD)) break;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 2, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n let bytes = new Uint8Array(16);\r\n for (let i = 0; i < 2; ++i) {\r\n let value = operands[i];\r\n if (value) {\r\n let expr = module.precomputeExpression(\r\n compiler.compileExpression(value, Type.i64, ConversionKind.IMPLICIT, WrapMode.NONE)\r\n );\r\n if (getExpressionId(expr) != ExpressionId.Const) {\r\n compiler.error(\r\n DiagnosticCode.Expression_must_be_a_compile_time_constant,\r\n value.range\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n assert(getExpressionType(expr) == NativeType.I64);\r\n let off = i << 3;\r\n writeI32(getConstValueI64Low(expr), bytes, off);\r\n writeI32(getConstValueI64High(expr), bytes, off + 4);\r\n }\r\n }\r\n compiler.currentType = Type.v128;\r\n return module.createV128(bytes);\r\n }\r\n case BuiltinSymbols.f32x4: {\r\n if (!compiler.options.hasFeature(Feature.SIMD)) break;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 4, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n let bytes = new Uint8Array(16);\r\n for (let i = 0; i < 4; ++i) {\r\n let value = operands[i];\r\n if (value) {\r\n let expr = module.precomputeExpression(\r\n compiler.compileExpression(value, Type.f32, ConversionKind.IMPLICIT, WrapMode.NONE)\r\n );\r\n if (getExpressionId(expr) != ExpressionId.Const) {\r\n compiler.error(\r\n DiagnosticCode.Expression_must_be_a_compile_time_constant,\r\n value.range\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n assert(getExpressionType(expr) == NativeType.F32);\r\n writeF32(getConstValueF32(expr), bytes, i << 2);\r\n }\r\n }\r\n compiler.currentType = Type.v128;\r\n return module.createV128(bytes);\r\n }\r\n case BuiltinSymbols.f64x2: {\r\n if (!compiler.options.hasFeature(Feature.SIMD)) break;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 2, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n let bytes = new Uint8Array(16);\r\n for (let i = 0; i < 2; ++i) {\r\n let value = operands[i];\r\n if (value) {\r\n let expr = module.precomputeExpression(\r\n compiler.compileExpression(value, Type.f64, ConversionKind.IMPLICIT, WrapMode.NONE)\r\n );\r\n if (getExpressionId(expr) != ExpressionId.Const) {\r\n compiler.error(\r\n DiagnosticCode.Expression_must_be_a_compile_time_constant,\r\n value.range\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n assert(getExpressionType(expr) == NativeType.F64);\r\n writeF64(getConstValueF64(expr), bytes, i << 3);\r\n }\r\n }\r\n compiler.currentType = Type.v128;\r\n return module.createV128(bytes);\r\n }\r\n case BuiltinSymbols.v128_splat: { // splat(x: T) -> v128\r\n if (!compiler.options.hasFeature(Feature.SIMD)) break;\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n let type = typeArguments![0];\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n let op: UnaryOp;\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.U8: { op = UnaryOp.SplatVecI8x16; break; }\r\n case TypeKind.I16:\r\n case TypeKind.U16: { op = UnaryOp.SplatVecI16x8; break; }\r\n case TypeKind.I32:\r\n case TypeKind.U32: { op = UnaryOp.SplatVecI32x4; break; }\r\n case TypeKind.I64:\r\n case TypeKind.U64: { op = UnaryOp.SplatVecI64x2; break; }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n op = compiler.options.isWasm64\r\n ? UnaryOp.SplatVecI64x2\r\n : UnaryOp.SplatVecI32x4;\r\n break;\r\n }\r\n case TypeKind.F32: { op = UnaryOp.SplatVecF32x4; break; }\r\n case TypeKind.F64: { op = UnaryOp.SplatVecF64x2; break; }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n }\r\n let arg0 = compiler.compileExpression(operands[0], type, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n compiler.currentType = Type.v128;\r\n return module.createUnary(op, arg0);\r\n }\r\n case BuiltinSymbols.v128_extract_lane: { // extract_lane(x: v128, idx: u8) -> T\r\n if (!compiler.options.hasFeature(Feature.SIMD)) break;\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler, true) |\r\n checkArgsRequired(operands, 2, reportNode, compiler)\r\n ) return module.createUnreachable();\r\n let type = typeArguments![0];\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n compiler.currentType = type;\r\n return module.createUnreachable();\r\n }\r\n let op: SIMDExtractOp;\r\n switch (type.kind) {\r\n case TypeKind.I8: { op = SIMDExtractOp.ExtractLaneSVecI8x16; break; }\r\n case TypeKind.U8: { op = SIMDExtractOp.ExtractLaneUVecI8x16; break; }\r\n case TypeKind.I16: { op = SIMDExtractOp.ExtractLaneSVecI16x8; break; }\r\n case TypeKind.U16: { op = SIMDExtractOp.ExtractLaneUVecI16x8; break; }\r\n case TypeKind.I32:\r\n case TypeKind.U32: { op = SIMDExtractOp.ExtractLaneVecI32x4; break; }\r\n case TypeKind.I64:\r\n case TypeKind.U64: { op = SIMDExtractOp.ExtractLaneVecI64x2; break; }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n op = compiler.options.isWasm64\r\n ? SIMDExtractOp.ExtractLaneVecI64x2\r\n : SIMDExtractOp.ExtractLaneVecI32x4;\r\n break;\r\n }\r\n case TypeKind.F32: { op = SIMDExtractOp.ExtractLaneVecF32x4; break; }\r\n case TypeKind.F64: { op = SIMDExtractOp.ExtractLaneVecF64x2; break; }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n compiler.currentType = type;\r\n return module.createUnreachable();\r\n }\r\n }\r\n let arg0 = compiler.compileExpression(operands[0], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n let arg1 = module.precomputeExpression(\r\n compiler.compileExpression(operands[1], Type.u8, ConversionKind.IMPLICIT, WrapMode.NONE)\r\n );\r\n compiler.currentType = type;\r\n if (getExpressionId(arg1) != ExpressionId.Const) {\r\n compiler.error(\r\n DiagnosticCode.Expression_must_be_a_compile_time_constant,\r\n operands[1].range\r\n );\r\n return module.createUnreachable();\r\n }\r\n assert(getExpressionType(arg1) == NativeType.I32);\r\n let maxIdx = (16 / type.byteSize) - 1;\r\n let idx = getConstValueI32(arg1);\r\n if (idx < 0 || idx > maxIdx) {\r\n compiler.error(\r\n DiagnosticCode._0_must_be_a_value_between_1_and_2_inclusive,\r\n operands[1].range, \"Lane index\", \"0\", maxIdx.toString()\r\n );\r\n return module.createUnreachable();\r\n }\r\n return module.createSIMDExtract(op, arg0, idx);\r\n }\r\n case BuiltinSymbols.v128_replace_lane: { // replace_lane(x: v128, idx: u8, value: T) -> v128\r\n if (!compiler.options.hasFeature(Feature.SIMD)) break;\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler) |\r\n checkArgsRequired(operands, 3, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n let type = typeArguments![0];\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n let op: SIMDReplaceOp;\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.U8: { op = SIMDReplaceOp.ReplaceLaneVecI8x16; break; }\r\n case TypeKind.I16:\r\n case TypeKind.U16: { op = SIMDReplaceOp.ReplaceLaneVecI16x8; break; }\r\n case TypeKind.I32:\r\n case TypeKind.U32: { op = SIMDReplaceOp.ReplaceLaneVecI32x4; break; }\r\n case TypeKind.I64:\r\n case TypeKind.U64: { op = SIMDReplaceOp.ReplaceLaneVecI64x2; break; }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n op = compiler.options.isWasm64\r\n ? SIMDReplaceOp.ReplaceLaneVecI64x2\r\n : SIMDReplaceOp.ReplaceLaneVecI32x4;\r\n break;\r\n }\r\n case TypeKind.F32: { op = SIMDReplaceOp.ReplaceLaneVecF32x4; break; }\r\n case TypeKind.F64: { op = SIMDReplaceOp.ReplaceLaneVecF64x2; break; }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n }\r\n let arg0 = compiler.compileExpression(operands[0], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n let arg1 = module.precomputeExpression(\r\n compiler.compileExpression(operands[1], Type.u8, ConversionKind.IMPLICIT, WrapMode.NONE)\r\n );\r\n if (getExpressionId(arg1) != ExpressionId.Const) {\r\n compiler.error(\r\n DiagnosticCode.Expression_must_be_a_compile_time_constant,\r\n operands[1].range\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n assert(getExpressionType(arg1) == NativeType.I32);\r\n let maxIdx = (16 / type.byteSize) - 1;\r\n let idx = getConstValueI32(arg1);\r\n if (idx < 0 || idx > maxIdx) {\r\n compiler.error(\r\n DiagnosticCode._0_must_be_a_value_between_1_and_2_inclusive,\r\n operands[1].range, \"Lane index\", \"0\", maxIdx.toString()\r\n );\r\n return module.createUnreachable();\r\n }\r\n let arg2 = compiler.compileExpression(operands[2], type, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n compiler.currentType = Type.v128;\r\n return module.createSIMDReplace(op, arg0, idx, arg2);\r\n }\r\n case BuiltinSymbols.v128_shuffle: { // shuffle(a: v128, b: v128, ...lanes: u8[]) -> v128\r\n if (!compiler.options.hasFeature(Feature.SIMD)) break;\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n let type = typeArguments![0];\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n let laneWidth = type.byteSize;\r\n let laneCount = 16 / laneWidth;\r\n assert(isInteger(laneCount) && isPowerOf2(laneCount));\r\n if (\r\n checkArgsRequired(operands, 2 + laneCount, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32:\r\n case TypeKind.I64:\r\n case TypeKind.ISIZE:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.U64:\r\n case TypeKind.USIZE:\r\n case TypeKind.F32:\r\n case TypeKind.F64: break;\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n }\r\n let arg0 = compiler.compileExpression(operands[0], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n let arg1 = compiler.compileExpression(operands[1], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n let mask = new Uint8Array(16);\r\n let maxIdx = (laneCount << 1) - 1;\r\n for (let i = 0; i < laneCount; ++i) {\r\n let operand = operands[2 + i];\r\n let argN = module.precomputeExpression(\r\n compiler.compileExpression(operand, Type.u8, ConversionKind.IMPLICIT, WrapMode.NONE)\r\n );\r\n if (getExpressionId(argN) != ExpressionId.Const) {\r\n compiler.error(\r\n DiagnosticCode.Expression_must_be_a_compile_time_constant,\r\n operand.range\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n assert(getExpressionType(argN) == NativeType.I32);\r\n let idx = getConstValueI32(argN);\r\n if (idx < 0 || idx > maxIdx) {\r\n compiler.error(\r\n DiagnosticCode._0_must_be_a_value_between_1_and_2_inclusive,\r\n operand.range, \"Lane index\", \"0\", maxIdx.toString()\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n switch (laneWidth) {\r\n case 1: {\r\n writeI8(idx, mask, i);\r\n break;\r\n }\r\n case 2: {\r\n let off8 = i << 1;\r\n let idx8 = idx << 1;\r\n writeI8(idx8 , mask, off8);\r\n writeI8(idx8 + 1, mask, off8 + 1);\r\n break;\r\n }\r\n case 4: {\r\n let off8 = i << 2;\r\n let idx8 = idx << 2;\r\n writeI8(idx8 , mask, off8);\r\n writeI8(idx8 + 1, mask, off8 + 1);\r\n writeI8(idx8 + 2, mask, off8 + 2);\r\n writeI8(idx8 + 3, mask, off8 + 3);\r\n break;\r\n }\r\n case 8: {\r\n let off8 = i << 3;\r\n let idx8 = idx << 3;\r\n writeI8(idx8 , mask, off8);\r\n writeI8(idx8 + 1, mask, off8 + 1);\r\n writeI8(idx8 + 2, mask, off8 + 2);\r\n writeI8(idx8 + 3, mask, off8 + 3);\r\n writeI8(idx8 + 4, mask, off8 + 4);\r\n writeI8(idx8 + 5, mask, off8 + 5);\r\n writeI8(idx8 + 6, mask, off8 + 6);\r\n writeI8(idx8 + 7, mask, off8 + 7);\r\n break;\r\n }\r\n default: assert(false);\r\n }\r\n }\r\n compiler.currentType = Type.v128;\r\n return module.createSIMDShuffle(arg0, arg1, mask);\r\n }\r\n case BuiltinSymbols.v128_add: // any_binary(a: v128, b: v128) -> v128\r\n case BuiltinSymbols.v128_sub:\r\n case BuiltinSymbols.v128_mul:\r\n case BuiltinSymbols.v128_div:\r\n case BuiltinSymbols.v128_add_saturate:\r\n case BuiltinSymbols.v128_sub_saturate:\r\n case BuiltinSymbols.v128_min:\r\n case BuiltinSymbols.v128_max:\r\n case BuiltinSymbols.v128_eq:\r\n case BuiltinSymbols.v128_ne:\r\n case BuiltinSymbols.v128_lt:\r\n case BuiltinSymbols.v128_le:\r\n case BuiltinSymbols.v128_gt:\r\n case BuiltinSymbols.v128_ge: {\r\n if (!compiler.options.hasFeature(Feature.SIMD)) break;\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler) |\r\n checkArgsRequired(operands, 2, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n let type = typeArguments![0];\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n let op: BinaryOp = -1;\r\n switch (prototype.internalName) {\r\n case BuiltinSymbols.v128_add: {\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.U8: { op = BinaryOp.AddVecI8x16; break; }\r\n case TypeKind.I16:\r\n case TypeKind.U16: { op = BinaryOp.AddVecI16x8; break; }\r\n case TypeKind.I32:\r\n case TypeKind.U32: { op = BinaryOp.AddVecI32x4; break; }\r\n case TypeKind.I64:\r\n case TypeKind.U64: { op = BinaryOp.AddVecI64x2; break; }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n op = compiler.options.isWasm64\r\n ? BinaryOp.AddVecI64x2\r\n : BinaryOp.AddVecI32x4;\r\n break;\r\n }\r\n case TypeKind.F32: { op = BinaryOp.AddVecF32x4; break; }\r\n case TypeKind.F64: { op = BinaryOp.AddVecF64x2; break; }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_sub: {\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.U8: { op = BinaryOp.SubVecI8x16; break; }\r\n case TypeKind.I16:\r\n case TypeKind.U16: { op = BinaryOp.SubVecI16x8; break; }\r\n case TypeKind.I32:\r\n case TypeKind.U32: { op = BinaryOp.SubVecI32x4; break; }\r\n case TypeKind.I64:\r\n case TypeKind.U64: { op = BinaryOp.SubVecI64x2; break; }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n op = compiler.options.isWasm64\r\n ? BinaryOp.SubVecI64x2\r\n : BinaryOp.SubVecI32x4;\r\n break;\r\n }\r\n case TypeKind.F32: { op = BinaryOp.SubVecF32x4; break; }\r\n case TypeKind.F64: { op = BinaryOp.SubVecF64x2; break; }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_mul: {\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.U8: { op = BinaryOp.MulVecI8x16; break; }\r\n case TypeKind.I16:\r\n case TypeKind.U16: { op = BinaryOp.MulVecI16x8; break; }\r\n case TypeKind.I32:\r\n case TypeKind.U32: { op = BinaryOp.MulVecI32x4; break; }\r\n case TypeKind.F32: { op = BinaryOp.MulVecF32x4; break; }\r\n case TypeKind.F64: { op = BinaryOp.MulVecF64x2; break; }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n if (!compiler.options.isWasm64) op = BinaryOp.MulVecI32x4;\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_div: {\r\n switch (type.kind) {\r\n case TypeKind.F32: { op = BinaryOp.DivVecF32x4; break; }\r\n case TypeKind.F64: { op = BinaryOp.DivVecF64x2; break; }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_add_saturate: {\r\n switch (type.kind) {\r\n case TypeKind.I8: { op = BinaryOp.AddSatSVecI8x16; break; }\r\n case TypeKind.U8: { op = BinaryOp.AddSatUVecI8x16; break; }\r\n case TypeKind.I16: { op = BinaryOp.AddSatSVecI16x8; break; }\r\n case TypeKind.U16: { op = BinaryOp.AddSatUVecI16x8; break; }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_sub_saturate: {\r\n switch (type.kind) {\r\n case TypeKind.I8: { op = BinaryOp.SubSatSVecI8x16; break; }\r\n case TypeKind.U8: { op = BinaryOp.SubSatUVecI8x16; break; }\r\n case TypeKind.I16: { op = BinaryOp.SubSatSVecI16x8; break; }\r\n case TypeKind.U16: { op = BinaryOp.SubSatUVecI16x8; break; }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_min: {\r\n switch (type.kind) {\r\n case TypeKind.F32: { op = BinaryOp.MinVecF32x4; break; }\r\n case TypeKind.F64: { op = BinaryOp.MinVecF64x2; break; }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_max: {\r\n switch (type.kind) {\r\n case TypeKind.F32: { op = BinaryOp.MaxVecF32x4; break; }\r\n case TypeKind.F64: { op = BinaryOp.MaxVecF64x2; break; }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_eq: {\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.U8: { op = BinaryOp.EqVecI8x16; break; }\r\n case TypeKind.I16:\r\n case TypeKind.U16: { op = BinaryOp.EqVecI16x8; break; }\r\n case TypeKind.I32:\r\n case TypeKind.U32: { op = BinaryOp.EqVecI32x4; break; }\r\n case TypeKind.F32: { op = BinaryOp.EqVecF32x4; break; }\r\n case TypeKind.F64: { op = BinaryOp.EqVecF64x2; break; }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n if (!compiler.options.isWasm64) op = BinaryOp.EqVecI32x4;\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_ne: {\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.U8: { op = BinaryOp.NeVecI8x16; break; }\r\n case TypeKind.I16:\r\n case TypeKind.U16: { op = BinaryOp.NeVecI16x8; break; }\r\n case TypeKind.I32:\r\n case TypeKind.U32: { op = BinaryOp.NeVecI32x4; break; }\r\n case TypeKind.F32: { op = BinaryOp.NeVecF32x4; break; }\r\n case TypeKind.F64: { op = BinaryOp.NeVecF64x2; break; }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n if (!compiler.options.isWasm64) op = BinaryOp.NeVecI32x4;\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_lt: {\r\n switch (type.kind) {\r\n case TypeKind.I8: { op = BinaryOp.LtSVecI8x16; break; }\r\n case TypeKind.U8: { op = BinaryOp.LtUVecI8x16; break; }\r\n case TypeKind.I16: { op = BinaryOp.LtSVecI16x8; break; }\r\n case TypeKind.U16: { op = BinaryOp.LtUVecI16x8; break; }\r\n case TypeKind.I32: { op = BinaryOp.LtSVecI32x4; break; }\r\n case TypeKind.U32: { op = BinaryOp.LtUVecI32x4; break; }\r\n case TypeKind.F32: { op = BinaryOp.LtVecF32x4; break; }\r\n case TypeKind.F64: { op = BinaryOp.LtVecF64x2; break; }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n if (!compiler.options.isWasm64) {\r\n op = type.kind == TypeKind.ISIZE\r\n ? BinaryOp.LtSVecI32x4\r\n : BinaryOp.LtUVecI32x4;\r\n }\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_le: {\r\n switch (type.kind) {\r\n case TypeKind.I8: { op = BinaryOp.LeSVecI8x16; break; }\r\n case TypeKind.U8: { op = BinaryOp.LeUVecI8x16; break; }\r\n case TypeKind.I16: { op = BinaryOp.LeSVecI16x8; break; }\r\n case TypeKind.U16: { op = BinaryOp.LeUVecI16x8; break; }\r\n case TypeKind.I32: { op = BinaryOp.LeSVecI32x4; break; }\r\n case TypeKind.U32: { op = BinaryOp.LeUVecI32x4; break; }\r\n case TypeKind.F32: { op = BinaryOp.LeVecF32x4; break; }\r\n case TypeKind.F64: { op = BinaryOp.LeVecF64x2; break; }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n if (!compiler.options.isWasm64) {\r\n op = type.kind == TypeKind.ISIZE\r\n ? BinaryOp.LeSVecI32x4\r\n : BinaryOp.LeUVecI32x4;\r\n }\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_gt: {\r\n switch (type.kind) {\r\n case TypeKind.I8: { op = BinaryOp.GtSVecI8x16; break; }\r\n case TypeKind.U8: { op = BinaryOp.GtUVecI8x16; break; }\r\n case TypeKind.I16: { op = BinaryOp.GtSVecI16x8; break; }\r\n case TypeKind.U16: { op = BinaryOp.GtUVecI16x8; break; }\r\n case TypeKind.I32: { op = BinaryOp.GtSVecI32x4; break; }\r\n case TypeKind.U32: { op = BinaryOp.GtUVecI32x4; break; }\r\n case TypeKind.F32: { op = BinaryOp.GtVecF32x4; break; }\r\n case TypeKind.F64: { op = BinaryOp.GtVecF64x2; break; }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n if (!compiler.options.isWasm64) {\r\n op = type.kind == TypeKind.ISIZE\r\n ? BinaryOp.GtSVecI32x4\r\n : BinaryOp.GtUVecI32x4;\r\n }\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_ge: {\r\n switch (type.kind) {\r\n case TypeKind.I8: { op = BinaryOp.GeSVecI8x16; break; }\r\n case TypeKind.U8: { op = BinaryOp.GeUVecI8x16; break; }\r\n case TypeKind.I16: { op = BinaryOp.GeSVecI16x8; break; }\r\n case TypeKind.U16: { op = BinaryOp.GeUVecI16x8; break; }\r\n case TypeKind.I32: { op = BinaryOp.GeSVecI32x4; break; }\r\n case TypeKind.U32: { op = BinaryOp.GeUVecI32x4; break; }\r\n case TypeKind.F32: { op = BinaryOp.GeVecF32x4; break; }\r\n case TypeKind.F64: { op = BinaryOp.GeVecF64x2; break; }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n if (!compiler.options.isWasm64) {\r\n op = type.kind == TypeKind.ISIZE\r\n ? BinaryOp.GeSVecI32x4\r\n : BinaryOp.GeUVecI32x4;\r\n }\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n if (op == -1) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n let arg0 = compiler.compileExpression(operands[0], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n let arg1 = compiler.compileExpression(operands[1], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n compiler.currentType = Type.v128;\r\n return module.createBinary(op, arg0, arg1);\r\n }\r\n case BuiltinSymbols.v128_neg: // any_unary(a: v128) -> v128\r\n case BuiltinSymbols.v128_abs:\r\n case BuiltinSymbols.v128_sqrt:\r\n case BuiltinSymbols.v128_convert:\r\n case BuiltinSymbols.v128_trunc: {\r\n if (!compiler.options.hasFeature(Feature.SIMD)) break;\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n let type = typeArguments![0];\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n let op: UnaryOp = -1;\r\n switch (prototype.internalName) {\r\n case BuiltinSymbols.v128_neg: {\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.U8: { op = UnaryOp.NegVecI8x16; break; }\r\n case TypeKind.I16:\r\n case TypeKind.U16: { op = UnaryOp.NegVecI16x8; break; }\r\n case TypeKind.I32:\r\n case TypeKind.U32: { op = UnaryOp.NegVecI32x4; break; }\r\n case TypeKind.I64:\r\n case TypeKind.U64: { op = UnaryOp.NegVecI64x2; break; }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n op = compiler.options.isWasm64\r\n ? UnaryOp.NegVecI64x2\r\n : UnaryOp.NegVecI32x4;\r\n break;\r\n }\r\n case TypeKind.F32: { op = UnaryOp.NegVecF32x4; break; }\r\n case TypeKind.F64: { op = UnaryOp.NegVecF64x2; break; }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_abs: {\r\n switch (type.kind) {\r\n case TypeKind.F32: { op = UnaryOp.AbsVecF32x4; break; }\r\n case TypeKind.F64: { op = UnaryOp.AbsVecF64x2; break; }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_sqrt: {\r\n switch (type.kind) {\r\n case TypeKind.F32: { op = UnaryOp.SqrtVecF32x4; break; }\r\n case TypeKind.F64: { op = UnaryOp.SqrtVecF64x2; break; }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_convert: {\r\n switch (type.kind) {\r\n case TypeKind.I32: { op = UnaryOp.ConvertSVecI32x4ToVecF32x4; break; }\r\n case TypeKind.U32: { op = UnaryOp.ConvertUVecI32x4ToVecF32x4; break; }\r\n case TypeKind.I64: { op = UnaryOp.ConvertSVecI64x2ToVecF64x2; break; }\r\n case TypeKind.U64: { op = UnaryOp.ConvertUVecI64x2ToVecF64x2; break; }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_trunc: {\r\n switch (type.kind) {\r\n case TypeKind.I32: { op = UnaryOp.TruncSatSVecF32x4ToVecI32x4; break; }\r\n case TypeKind.U32: { op = UnaryOp.TruncSatUVecF32x4ToVecI32x4; break; }\r\n case TypeKind.I64: { op = UnaryOp.TruncSatSVecF64x2ToVecI64x2; break; }\r\n case TypeKind.U64: { op = UnaryOp.TruncSatUVecF64x2ToVecI64x2; break; }\r\n }\r\n break;\r\n }\r\n }\r\n if (op == -1) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n let arg0 = compiler.compileExpression(operands[0], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n compiler.currentType = Type.v128;\r\n return module.createUnary(op, arg0);\r\n }\r\n case BuiltinSymbols.v128_shl: // any_shift(a: v128, b: i32) -> v128\r\n case BuiltinSymbols.v128_shr: {\r\n if (!compiler.options.hasFeature(Feature.SIMD)) break;\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler) |\r\n checkArgsRequired(operands, 2, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n let type = typeArguments![0];\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n let op: SIMDShiftOp = -1;\r\n switch (prototype.internalName) {\r\n case BuiltinSymbols.v128_shl: {\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.U8: { op = SIMDShiftOp.ShlVecI8x16; break; }\r\n case TypeKind.I16:\r\n case TypeKind.U16: { op = SIMDShiftOp.ShlVecI16x8; break; }\r\n case TypeKind.I32:\r\n case TypeKind.U32: { op = SIMDShiftOp.ShlVecI32x4; break; }\r\n case TypeKind.I64:\r\n case TypeKind.U64: { op = SIMDShiftOp.ShlVecI64x2; break; }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n op = compiler.options.isWasm64\r\n ? SIMDShiftOp.ShlVecI64x2\r\n : SIMDShiftOp.ShlVecI32x4;\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_shr: {\r\n switch (type.kind) {\r\n case TypeKind.I8: { op = SIMDShiftOp.ShrSVecI8x16; break; }\r\n case TypeKind.U8: { op = SIMDShiftOp.ShrUVecI8x16; break; }\r\n case TypeKind.I16: { op = SIMDShiftOp.ShrSVecI16x8; break; }\r\n case TypeKind.U16: { op = SIMDShiftOp.ShrUVecI16x8; break; }\r\n case TypeKind.I32: { op = SIMDShiftOp.ShrSVecI32x4; break; }\r\n case TypeKind.U32: { op = SIMDShiftOp.ShrUVecI32x4; break; }\r\n case TypeKind.I64: { op = SIMDShiftOp.ShrSVecI64x2; break; }\r\n case TypeKind.U64: { op = SIMDShiftOp.ShrUVecI64x2; break; }\r\n case TypeKind.ISIZE: {\r\n op = compiler.options.isWasm64\r\n ? SIMDShiftOp.ShrSVecI64x2\r\n : SIMDShiftOp.ShrSVecI32x4;\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n op = compiler.options.isWasm64\r\n ? SIMDShiftOp.ShrUVecI64x2\r\n : SIMDShiftOp.ShrUVecI32x4;\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n if (op == -1) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n let arg0 = compiler.compileExpression(operands[0], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n let arg1 = compiler.compileExpression(operands[1], Type.i32, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n compiler.currentType = Type.v128;\r\n return module.createSIMDShift(op, arg0, arg1);\r\n }\r\n case BuiltinSymbols.v128_and: // any_bitwise_binary(a: v128, b: v128) -> v128\r\n case BuiltinSymbols.v128_or:\r\n case BuiltinSymbols.v128_xor: {\r\n if (!compiler.options.hasFeature(Feature.SIMD)) break;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 2, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n let op: BinaryOp = -1;\r\n switch (prototype.internalName) {\r\n default: assert(false);\r\n case BuiltinSymbols.v128_and: { op = BinaryOp.AndVec128; break; }\r\n case BuiltinSymbols.v128_or: { op = BinaryOp.OrVec128; break; }\r\n case BuiltinSymbols.v128_xor: { op = BinaryOp.XorVec128; break; }\r\n }\r\n let arg0 = compiler.compileExpression(operands[0], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n let arg1 = compiler.compileExpression(operands[1], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n return module.createBinary(op, arg0, arg1);\r\n }\r\n case BuiltinSymbols.v128_not: { // any_bitwise_unary(a: v128) -> v128\r\n if (!compiler.options.hasFeature(Feature.SIMD)) break;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n let arg0 = compiler.compileExpression(operands[0], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n return module.createUnary(UnaryOp.NotVec128, arg0);\r\n }\r\n case BuiltinSymbols.v128_bitselect: { // bitselect(v1: v128, v2: v128, c: v128) -> v128\r\n if (!compiler.options.hasFeature(Feature.SIMD)) break;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 3, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.v128;\r\n return module.createUnreachable();\r\n }\r\n let arg0 = compiler.compileExpression(operands[0], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n let arg1 = compiler.compileExpression(operands[1], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n let arg2 = compiler.compileExpression(operands[2], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n return module.createSIMDBitselect(arg0, arg1, arg2);\r\n }\r\n case BuiltinSymbols.v128_any_true: // any_test(a: v128) -> bool\r\n case BuiltinSymbols.v128_all_true: {\r\n if (!compiler.options.hasFeature(Feature.SIMD)) break;\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.bool;\r\n return module.createUnreachable();\r\n }\r\n let type = typeArguments![0];\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.createUnreachable();\r\n }\r\n let op: UnaryOp = -1;\r\n switch (prototype.internalName) {\r\n default: assert(false);\r\n case BuiltinSymbols.v128_any_true: {\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.U8: { op = UnaryOp.AnyTrueVecI8x16; break; }\r\n case TypeKind.I16:\r\n case TypeKind.U16: { op = UnaryOp.AnyTrueVecI16x8; break; }\r\n case TypeKind.I32:\r\n case TypeKind.U32: { op = UnaryOp.AnyTrueVecI32x4; break; }\r\n case TypeKind.I64:\r\n case TypeKind.U64: { op = UnaryOp.AnyTrueVecI64x2; break; }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n op = compiler.options.isWasm64\r\n ? UnaryOp.AnyTrueVecI64x2\r\n : UnaryOp.AnyTrueVecI32x4;\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_all_true: {\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.U8: { op = UnaryOp.AllTrueVecI8x16; break; }\r\n case TypeKind.I16:\r\n case TypeKind.U16: { op = UnaryOp.AllTrueVecI16x8; break; }\r\n case TypeKind.I32:\r\n case TypeKind.U32: { op = UnaryOp.AllTrueVecI32x4; break; }\r\n case TypeKind.I64:\r\n case TypeKind.U64: { op = UnaryOp.AllTrueVecI64x2; break; }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n op = compiler.options.isWasm64\r\n ? UnaryOp.AllTrueVecI64x2\r\n : UnaryOp.AllTrueVecI32x4;\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n if (op == -1) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n compiler.currentType = Type.bool;\r\n return module.createUnreachable();\r\n }\r\n let arg0 = compiler.compileExpression(operands[0], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n compiler.currentType = Type.bool;\r\n return module.createUnary(op, arg0);\r\n }\r\n\r\n // === GC integration =========================================================================\r\n\r\n case BuiltinSymbols.iterateRoots: {\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.void;\r\n return module.createUnreachable();\r\n }\r\n let expr = compiler.compileExpressionRetainType(operands[0], Type.u32, WrapMode.NONE);\r\n let type = compiler.currentType;\r\n let signatureReference = type.signatureReference;\r\n if (\r\n !type.is(TypeFlags.REFERENCE) ||\r\n !signatureReference ||\r\n signatureReference.parameterTypes.length != 1 ||\r\n signatureReference.parameterTypes[0] != compiler.options.usizeType\r\n ) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_assignable_to_type_1,\r\n reportNode.range, type.toString(), \"(ref: usize) => void\"\r\n );\r\n compiler.currentType = Type.void;\r\n return module.createUnreachable();\r\n }\r\n // just emit a call even if the function doesn't yet exist\r\n compiler.needsIterateRoots = true;\r\n compiler.currentType = Type.void;\r\n return module.createCall(\"~iterateRoots\", [ expr ], NativeType.None);\r\n }\r\n }\r\n\r\n // try to defer inline asm to a concrete built-in\r\n {\r\n let expr = tryDeferASM(compiler, prototype, operands, reportNode);\r\n if (expr) {\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.typeArgumentsRange, prototype.internalName\r\n );\r\n }\r\n return expr;\r\n }\r\n }\r\n compiler.error(\r\n DiagnosticCode.Cannot_find_name_0,\r\n reportNode.expression.range, prototype.internalName\r\n );\r\n return module.createUnreachable();\r\n}\r\n\r\n/** Tries to defer an inline-assembler-like call to a built-in function. */\r\nfunction tryDeferASM(\r\n compiler: Compiler,\r\n prototype: FunctionPrototype,\r\n operands: Expression[],\r\n reportNode: CallExpression\r\n): ExpressionRef {\r\n /* tslint:disable:max-line-length */\r\n switch (prototype.internalName) {\r\n\r\n // TODO: Operators can't be just deferred (don't have a corresponding generic built-in)\r\n // add, sub, mul, div_s, div_u, rem_s, rem_u\r\n // and, or, xor, shl, shr_u, shr_s\r\n // eq, eqz, ne, lt_s, lt_u, le_s, le_u, gt_s, gt_u, ge_s, ge_u\r\n\r\n case BuiltinSymbols.i32_clz: return deferASM(BuiltinSymbols.clz, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64_clz: return deferASM(BuiltinSymbols.clz, compiler, Type.i64, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i32_ctz: return deferASM(BuiltinSymbols.ctz, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64_ctz: return deferASM(BuiltinSymbols.ctz, compiler, Type.i64, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i32_popcnt: return deferASM(BuiltinSymbols.popcnt, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64_popcnt: return deferASM(BuiltinSymbols.popcnt, compiler, Type.i64, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i32_rotl: return deferASM(BuiltinSymbols.rotl, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64_rotl: return deferASM(BuiltinSymbols.rotl, compiler, Type.i64, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i32_rotr: return deferASM(BuiltinSymbols.rotr, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64_rotr: return deferASM(BuiltinSymbols.rotr, compiler, Type.i64, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.f32_abs: return deferASM(BuiltinSymbols.abs, compiler, Type.f32, operands, Type.f32, reportNode);\r\n case BuiltinSymbols.f64_abs: return deferASM(BuiltinSymbols.abs, compiler, Type.f64, operands, Type.f64, reportNode);\r\n case BuiltinSymbols.f32_max: return deferASM(BuiltinSymbols.max, compiler, Type.f32, operands, Type.f32, reportNode);\r\n case BuiltinSymbols.f64_max: return deferASM(BuiltinSymbols.max, compiler, Type.f64, operands, Type.f64, reportNode);\r\n case BuiltinSymbols.f32_min: return deferASM(BuiltinSymbols.min, compiler, Type.f32, operands, Type.f32, reportNode);\r\n case BuiltinSymbols.f64_min: return deferASM(BuiltinSymbols.min, compiler, Type.f64, operands, Type.f64, reportNode);\r\n case BuiltinSymbols.f32_ceil: return deferASM(BuiltinSymbols.ceil, compiler, Type.f32, operands, Type.f32, reportNode);\r\n case BuiltinSymbols.f64_ceil: return deferASM(BuiltinSymbols.ceil, compiler, Type.f64, operands, Type.f64, reportNode);\r\n case BuiltinSymbols.f32_floor: return deferASM(BuiltinSymbols.floor, compiler, Type.f32, operands, Type.f32, reportNode);\r\n case BuiltinSymbols.f64_floor: return deferASM(BuiltinSymbols.floor, compiler, Type.f64, operands, Type.f64, reportNode);\r\n case BuiltinSymbols.f32_copysign: return deferASM(BuiltinSymbols.copysign, compiler, Type.f32, operands, Type.f32, reportNode);\r\n case BuiltinSymbols.f64_copysign: return deferASM(BuiltinSymbols.copysign, compiler, Type.f64, operands, Type.f64, reportNode);\r\n case BuiltinSymbols.f32_nearest: return deferASM(BuiltinSymbols.nearest, compiler, Type.f32, operands, Type.f32, reportNode);\r\n case BuiltinSymbols.f64_nearest: return deferASM(BuiltinSymbols.nearest, compiler, Type.f64, operands, Type.f64, reportNode);\r\n case BuiltinSymbols.i32_reinterpret_f32: return deferASM(BuiltinSymbols.reinterpret, compiler, Type.i32, operands, Type.f32, reportNode);\r\n case BuiltinSymbols.i64_reinterpret_f64: return deferASM(BuiltinSymbols.reinterpret, compiler, Type.i64, operands, Type.f64, reportNode);\r\n case BuiltinSymbols.f32_reinterpret_i32: return deferASM(BuiltinSymbols.reinterpret, compiler, Type.f32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.f64_reinterpret_i64: return deferASM(BuiltinSymbols.reinterpret, compiler, Type.f64, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.f32_sqrt: return deferASM(BuiltinSymbols.sqrt, compiler, Type.f32, operands, Type.f32, reportNode);\r\n case BuiltinSymbols.f64_sqrt: return deferASM(BuiltinSymbols.sqrt, compiler, Type.f64, operands, Type.f64, reportNode);\r\n case BuiltinSymbols.f32_trunc: return deferASM(BuiltinSymbols.trunc, compiler, Type.f32, operands, Type.f32, reportNode);\r\n case BuiltinSymbols.f64_trunc: return deferASM(BuiltinSymbols.trunc, compiler, Type.f64, operands, Type.f64, reportNode);\r\n case BuiltinSymbols.i32_load8_s: return deferASM(BuiltinSymbols.load, compiler, Type.i8, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_load8_u: return deferASM(BuiltinSymbols.load, compiler, Type.u8, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_load16_s: return deferASM(BuiltinSymbols.load, compiler, Type.i16, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_load16_u: return deferASM(BuiltinSymbols.load, compiler, Type.u16, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_load: return deferASM(BuiltinSymbols.load, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64_load8_s: return deferASM(BuiltinSymbols.load, compiler, Type.i8, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_load8_u: return deferASM(BuiltinSymbols.load, compiler, Type.u8, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_load16_s: return deferASM(BuiltinSymbols.load, compiler, Type.i16, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_load16_u: return deferASM(BuiltinSymbols.load, compiler, Type.u16, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_load32_s: return deferASM(BuiltinSymbols.load, compiler, Type.i32, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_load32_u: return deferASM(BuiltinSymbols.load, compiler, Type.u32, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_load: return deferASM(BuiltinSymbols.load, compiler, Type.i64, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.f32_load: return deferASM(BuiltinSymbols.load, compiler, Type.f32, operands, Type.f32, reportNode);\r\n case BuiltinSymbols.f64_load: return deferASM(BuiltinSymbols.load, compiler, Type.f64, operands, Type.f64, reportNode);\r\n case BuiltinSymbols.i32_store8: return deferASM(BuiltinSymbols.store, compiler, Type.i8, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_store16: return deferASM(BuiltinSymbols.store, compiler, Type.i16, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_store: return deferASM(BuiltinSymbols.store, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64_store8: return deferASM(BuiltinSymbols.store, compiler, Type.i8, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_store16: return deferASM(BuiltinSymbols.store, compiler, Type.i16, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_store32: return deferASM(BuiltinSymbols.store, compiler, Type.i32, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_store: return deferASM(BuiltinSymbols.store, compiler, Type.i64, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.f32_store: return deferASM(BuiltinSymbols.store, compiler, Type.f32, operands, Type.f32, reportNode);\r\n case BuiltinSymbols.f64_store: return deferASM(BuiltinSymbols.store, compiler, Type.f64, operands, Type.f64, reportNode);\r\n }\r\n if (compiler.options.hasFeature(Feature.THREADS)) {\r\n switch (prototype.internalName) {\r\n\r\n case BuiltinSymbols.i32_atomic_load8_u: return deferASM(BuiltinSymbols.atomic_load, compiler, Type.u8, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_load16_u: return deferASM(BuiltinSymbols.atomic_load, compiler, Type.u16, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_load: return deferASM(BuiltinSymbols.atomic_load, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64_atomic_load8_u: return deferASM(BuiltinSymbols.atomic_load, compiler, Type.u8, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_load16_u: return deferASM(BuiltinSymbols.atomic_load, compiler, Type.u16, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_load32_u: return deferASM(BuiltinSymbols.atomic_load, compiler, Type.u32, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_load: return deferASM(BuiltinSymbols.atomic_load, compiler, Type.i64, operands, Type.i64, reportNode);\r\n\r\n case BuiltinSymbols.i32_atomic_store8: return deferASM(BuiltinSymbols.atomic_store, compiler, Type.u8, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_store16: return deferASM(BuiltinSymbols.atomic_store, compiler, Type.u16, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_store: return deferASM(BuiltinSymbols.atomic_store, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64_atomic_store8: return deferASM(BuiltinSymbols.atomic_store, compiler, Type.u8, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_store16: return deferASM(BuiltinSymbols.atomic_store, compiler, Type.u16, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_store32: return deferASM(BuiltinSymbols.atomic_store, compiler, Type.u32, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_store: return deferASM(BuiltinSymbols.atomic_store, compiler, Type.i64, operands, Type.i64, reportNode);\r\n\r\n case BuiltinSymbols.i32_atomic_rmw8_add_u: return deferASM(BuiltinSymbols.atomic_add, compiler, Type.u8, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_rmw16_add_u: return deferASM(BuiltinSymbols.atomic_add, compiler, Type.u16, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_rmw_add: return deferASM(BuiltinSymbols.atomic_add, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw8_add_u: return deferASM(BuiltinSymbols.atomic_add, compiler, Type.u8, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw16_add_u: return deferASM(BuiltinSymbols.atomic_add, compiler, Type.u16, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw32_add_u: return deferASM(BuiltinSymbols.atomic_add, compiler, Type.u32, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw_add: return deferASM(BuiltinSymbols.atomic_add, compiler, Type.i64, operands, Type.i64, reportNode);\r\n\r\n case BuiltinSymbols.i32_atomic_rmw8_sub_u: return deferASM(BuiltinSymbols.atomic_sub, compiler, Type.u8, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_rmw16_sub_u: return deferASM(BuiltinSymbols.atomic_sub, compiler, Type.u16, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_rmw_sub: return deferASM(BuiltinSymbols.atomic_sub, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw8_sub_u: return deferASM(BuiltinSymbols.atomic_sub, compiler, Type.u8, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw16_sub_u: return deferASM(BuiltinSymbols.atomic_sub, compiler, Type.u16, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw32_sub_u: return deferASM(BuiltinSymbols.atomic_sub, compiler, Type.u32, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw_sub: return deferASM(BuiltinSymbols.atomic_sub, compiler, Type.i64, operands, Type.i64, reportNode);\r\n\r\n case BuiltinSymbols.i32_atomic_rmw8_and_u: return deferASM(BuiltinSymbols.atomic_and, compiler, Type.u8, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_rmw16_and_u: return deferASM(BuiltinSymbols.atomic_and, compiler, Type.u16, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_rmw_and: return deferASM(BuiltinSymbols.atomic_and, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw8_and_u: return deferASM(BuiltinSymbols.atomic_and, compiler, Type.u8, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw16_and_u: return deferASM(BuiltinSymbols.atomic_and, compiler, Type.u16, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw32_and_u: return deferASM(BuiltinSymbols.atomic_and, compiler, Type.u32, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw_and: return deferASM(BuiltinSymbols.atomic_and, compiler, Type.i64, operands, Type.i64, reportNode);\r\n\r\n case BuiltinSymbols.i32_atomic_rmw8_or_u: return deferASM(BuiltinSymbols.atomic_or, compiler, Type.u8, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_rmw16_or_u: return deferASM(BuiltinSymbols.atomic_or, compiler, Type.u16, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_rmw_or: return deferASM(BuiltinSymbols.atomic_or, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw8_or_u: return deferASM(BuiltinSymbols.atomic_or, compiler, Type.u8, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw16_or_u: return deferASM(BuiltinSymbols.atomic_or, compiler, Type.u16, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw32_or_u: return deferASM(BuiltinSymbols.atomic_or, compiler, Type.u32, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw_or: return deferASM(BuiltinSymbols.atomic_or, compiler, Type.i64, operands, Type.i64, reportNode);\r\n\r\n case BuiltinSymbols.i32_atomic_rmw8_u_xor: return deferASM(BuiltinSymbols.atomic_xor, compiler, Type.u8, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_rmw16_u_xor: return deferASM(BuiltinSymbols.atomic_xor, compiler, Type.u16, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_rmw_xor: return deferASM(BuiltinSymbols.atomic_xor, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw8_xor_u: return deferASM(BuiltinSymbols.atomic_xor, compiler, Type.u8, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw16_xor_u: return deferASM(BuiltinSymbols.atomic_xor, compiler, Type.u16, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw32_xor_u: return deferASM(BuiltinSymbols.atomic_xor, compiler, Type.u32, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw_xor: return deferASM(BuiltinSymbols.atomic_xor, compiler, Type.i64, operands, Type.i64, reportNode);\r\n\r\n case BuiltinSymbols.i32_atomic_rmw8_xchg_u: return deferASM(BuiltinSymbols.atomic_xchg, compiler, Type.u8, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_rmw16_xchg_u: return deferASM(BuiltinSymbols.atomic_xchg, compiler, Type.u16, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_rmw_xchg: return deferASM(BuiltinSymbols.atomic_xchg, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw8_xchg_u: return deferASM(BuiltinSymbols.atomic_xchg, compiler, Type.u8, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw16_xchg_u: return deferASM(BuiltinSymbols.atomic_xchg, compiler, Type.u16, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw32_xchg_u: return deferASM(BuiltinSymbols.atomic_xchg, compiler, Type.u32, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw_xchg: return deferASM(BuiltinSymbols.atomic_xchg, compiler, Type.i64, operands, Type.i64, reportNode);\r\n\r\n case BuiltinSymbols.i32_atomic_rmw8_cmpxchg_u: return deferASM(BuiltinSymbols.atomic_cmpxchg, compiler, Type.u8, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_rmw16_cmpxchg_u: return deferASM(BuiltinSymbols.atomic_cmpxchg, compiler, Type.u16, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_rmw_cmpxchg: return deferASM(BuiltinSymbols.atomic_cmpxchg, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw8_cmpxchg_u: return deferASM(BuiltinSymbols.atomic_cmpxchg, compiler, Type.u8, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw16_cmpxchg_u: return deferASM(BuiltinSymbols.atomic_cmpxchg, compiler, Type.u16, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw32_cmpxchg_u: return deferASM(BuiltinSymbols.atomic_cmpxchg, compiler, Type.u32, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw_cmpxchg: return deferASM(BuiltinSymbols.atomic_cmpxchg, compiler, Type.i64, operands, Type.i64, reportNode);\r\n\r\n case BuiltinSymbols.i32_wait: return deferASM(BuiltinSymbols.atomic_wait, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64_wait: return deferASM(BuiltinSymbols.atomic_wait, compiler, Type.i64, operands, Type.i32, reportNode);\r\n }\r\n }\r\n if (compiler.options.hasFeature(Feature.SIMD)) {\r\n switch (prototype.internalName) {\r\n\r\n case BuiltinSymbols.v128_load: return deferASM(BuiltinSymbols.load, compiler, Type.v128, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.v128_store: return deferASM(BuiltinSymbols.store, compiler, Type.v128, operands, Type.void, reportNode);\r\n\r\n case BuiltinSymbols.i8x16_splat: return deferASM(BuiltinSymbols.v128_splat, compiler, Type.i8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_extract_lane_s: return deferASM(BuiltinSymbols.v128_extract_lane, compiler, Type.i8, operands, Type.i8, reportNode);\r\n case BuiltinSymbols.i8x16_extract_lane_u: return deferASM(BuiltinSymbols.v128_extract_lane, compiler, Type.u8, operands, Type.u8, reportNode);\r\n case BuiltinSymbols.i8x16_replace_lane: return deferASM(BuiltinSymbols.v128_replace_lane, compiler, Type.i8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_add: return deferASM(BuiltinSymbols.v128_add, compiler, Type.i8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_sub: return deferASM(BuiltinSymbols.v128_sub, compiler, Type.i8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_mul: return deferASM(BuiltinSymbols.v128_mul, compiler, Type.i8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_neg: return deferASM(BuiltinSymbols.v128_neg, compiler, Type.i8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_add_saturate_s: return deferASM(BuiltinSymbols.v128_add_saturate, compiler, Type.i8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_add_saturate_u: return deferASM(BuiltinSymbols.v128_add_saturate, compiler, Type.u8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_sub_saturate_s: return deferASM(BuiltinSymbols.v128_sub_saturate, compiler, Type.i8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_sub_saturate_u: return deferASM(BuiltinSymbols.v128_sub_saturate, compiler, Type.u8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_shl: return deferASM(BuiltinSymbols.v128_shl, compiler, Type.i8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_shr_s: return deferASM(BuiltinSymbols.v128_shr, compiler, Type.i8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_shr_u: return deferASM(BuiltinSymbols.v128_shr, compiler, Type.u8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_any_true: return deferASM(BuiltinSymbols.v128_any_true, compiler, Type.i8, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i8x16_all_true: return deferASM(BuiltinSymbols.v128_all_true, compiler, Type.i8, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i8x16_eq: return deferASM(BuiltinSymbols.v128_eq, compiler, Type.i8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_ne: return deferASM(BuiltinSymbols.v128_ne, compiler, Type.i8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_lt_s: return deferASM(BuiltinSymbols.v128_lt, compiler, Type.i8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_lt_u: return deferASM(BuiltinSymbols.v128_lt, compiler, Type.u8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_le_s: return deferASM(BuiltinSymbols.v128_le, compiler, Type.i8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_le_u: return deferASM(BuiltinSymbols.v128_le, compiler, Type.u8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_gt_s: return deferASM(BuiltinSymbols.v128_gt, compiler, Type.i8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_gt_u: return deferASM(BuiltinSymbols.v128_gt, compiler, Type.u8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_ge_s: return deferASM(BuiltinSymbols.v128_ge, compiler, Type.i8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_ge_u: return deferASM(BuiltinSymbols.v128_ge, compiler, Type.u8, operands, Type.v128, reportNode);\r\n\r\n case BuiltinSymbols.i16x8_splat: return deferASM(BuiltinSymbols.v128_splat, compiler, Type.i16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_extract_lane_s: return deferASM(BuiltinSymbols.v128_extract_lane, compiler, Type.i16, operands, Type.i16, reportNode);\r\n case BuiltinSymbols.i16x8_extract_lane_u: return deferASM(BuiltinSymbols.v128_extract_lane, compiler, Type.u16, operands, Type.u16, reportNode);\r\n case BuiltinSymbols.i16x8_replace_lane: return deferASM(BuiltinSymbols.v128_replace_lane, compiler, Type.i16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_add: return deferASM(BuiltinSymbols.v128_add, compiler, Type.i16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_sub: return deferASM(BuiltinSymbols.v128_sub, compiler, Type.i16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_mul: return deferASM(BuiltinSymbols.v128_mul, compiler, Type.i16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_neg: return deferASM(BuiltinSymbols.v128_neg, compiler, Type.i16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_add_saturate_s: return deferASM(BuiltinSymbols.v128_add_saturate, compiler, Type.i16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_add_saturate_u: return deferASM(BuiltinSymbols.v128_add_saturate, compiler, Type.u16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_sub_saturate_s: return deferASM(BuiltinSymbols.v128_sub_saturate, compiler, Type.i16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_sub_saturate_u: return deferASM(BuiltinSymbols.v128_sub_saturate, compiler, Type.u16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_shl: return deferASM(BuiltinSymbols.v128_shl, compiler, Type.i16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_shr_s: return deferASM(BuiltinSymbols.v128_shr, compiler, Type.i16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_shr_u: return deferASM(BuiltinSymbols.v128_shr, compiler, Type.u16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_any_true: return deferASM(BuiltinSymbols.v128_any_true, compiler, Type.i16, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i16x8_all_true: return deferASM(BuiltinSymbols.v128_all_true, compiler, Type.i16, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i16x8_eq: return deferASM(BuiltinSymbols.v128_eq, compiler, Type.i16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_ne: return deferASM(BuiltinSymbols.v128_ne, compiler, Type.i16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_lt_s: return deferASM(BuiltinSymbols.v128_lt, compiler, Type.i16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_lt_u: return deferASM(BuiltinSymbols.v128_lt, compiler, Type.u16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_le_s: return deferASM(BuiltinSymbols.v128_le, compiler, Type.i16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_le_u: return deferASM(BuiltinSymbols.v128_le, compiler, Type.u16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_gt_s: return deferASM(BuiltinSymbols.v128_gt, compiler, Type.i16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_gt_u: return deferASM(BuiltinSymbols.v128_gt, compiler, Type.u16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_ge_s: return deferASM(BuiltinSymbols.v128_ge, compiler, Type.i16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_ge_u: return deferASM(BuiltinSymbols.v128_ge, compiler, Type.u16, operands, Type.v128, reportNode);\r\n\r\n case BuiltinSymbols.i32x4_splat: return deferASM(BuiltinSymbols.v128_splat, compiler, Type.i32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_extract_lane: return deferASM(BuiltinSymbols.v128_extract_lane, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32x4_replace_lane: return deferASM(BuiltinSymbols.v128_replace_lane, compiler, Type.i32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_add: return deferASM(BuiltinSymbols.v128_add, compiler, Type.i32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_sub: return deferASM(BuiltinSymbols.v128_sub, compiler, Type.i32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_mul: return deferASM(BuiltinSymbols.v128_mul, compiler, Type.i32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_neg: return deferASM(BuiltinSymbols.v128_neg, compiler, Type.i32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_shl: return deferASM(BuiltinSymbols.v128_shl, compiler, Type.i32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_shr_s: return deferASM(BuiltinSymbols.v128_shr, compiler, Type.i32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_shr_u: return deferASM(BuiltinSymbols.v128_shr, compiler, Type.u32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_any_true: return deferASM(BuiltinSymbols.v128_any_true, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32x4_all_true: return deferASM(BuiltinSymbols.v128_all_true, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32x4_eq: return deferASM(BuiltinSymbols.v128_eq, compiler, Type.i32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_ne: return deferASM(BuiltinSymbols.v128_ne, compiler, Type.i32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_lt_s: return deferASM(BuiltinSymbols.v128_lt, compiler, Type.i32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_lt_u: return deferASM(BuiltinSymbols.v128_lt, compiler, Type.u32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_le_s: return deferASM(BuiltinSymbols.v128_le, compiler, Type.i32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_le_u: return deferASM(BuiltinSymbols.v128_le, compiler, Type.u32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_gt_s: return deferASM(BuiltinSymbols.v128_gt, compiler, Type.i32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_gt_u: return deferASM(BuiltinSymbols.v128_gt, compiler, Type.u32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_ge_s: return deferASM(BuiltinSymbols.v128_ge, compiler, Type.i32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_ge_u: return deferASM(BuiltinSymbols.v128_ge, compiler, Type.u32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_trunc_s_f32x4_sat: return deferASM(BuiltinSymbols.v128_trunc, compiler, Type.i32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_trunc_u_f32x4_sat: return deferASM(BuiltinSymbols.v128_trunc, compiler, Type.u32, operands, Type.v128, reportNode);\r\n\r\n case BuiltinSymbols.i64x2_splat: return deferASM(BuiltinSymbols.v128_splat, compiler, Type.i64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i64x2_extract_lane: return deferASM(BuiltinSymbols.v128_extract_lane, compiler, Type.i64, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64x2_replace_lane: return deferASM(BuiltinSymbols.v128_replace_lane, compiler, Type.i64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i64x2_add: return deferASM(BuiltinSymbols.v128_add, compiler, Type.i64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i64x2_sub: return deferASM(BuiltinSymbols.v128_sub, compiler, Type.i64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i64x2_neg: return deferASM(BuiltinSymbols.v128_neg, compiler, Type.i64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i64x2_shl: return deferASM(BuiltinSymbols.v128_shl, compiler, Type.i64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i64x2_shr_s: return deferASM(BuiltinSymbols.v128_shr, compiler, Type.i64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i64x2_shr_u: return deferASM(BuiltinSymbols.v128_shr, compiler, Type.u64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i64x2_any_true: return deferASM(BuiltinSymbols.v128_any_true, compiler, Type.i64, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64x2_all_true: return deferASM(BuiltinSymbols.v128_all_true, compiler, Type.i64, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64x2_trunc_s_f64x2_sat: return deferASM(BuiltinSymbols.v128_trunc, compiler, Type.i64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i64x2_trunc_u_f64x2_sat: return deferASM(BuiltinSymbols.v128_trunc, compiler, Type.u64, operands, Type.v128, reportNode);\r\n\r\n case BuiltinSymbols.f32x4_splat: return deferASM(BuiltinSymbols.v128_splat, compiler, Type.f32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_extract_lane: return deferASM(BuiltinSymbols.v128_extract_lane, compiler, Type.f32, operands, Type.f32, reportNode);\r\n case BuiltinSymbols.f32x4_replace_lane: return deferASM(BuiltinSymbols.v128_replace_lane, compiler, Type.f32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_add: return deferASM(BuiltinSymbols.v128_add, compiler, Type.f32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_sub: return deferASM(BuiltinSymbols.v128_sub, compiler, Type.f32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_mul: return deferASM(BuiltinSymbols.v128_mul, compiler, Type.f32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_div: return deferASM(BuiltinSymbols.v128_div, compiler, Type.f32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_neg: return deferASM(BuiltinSymbols.v128_neg, compiler, Type.f32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_min: return deferASM(BuiltinSymbols.v128_min, compiler, Type.f32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_max: return deferASM(BuiltinSymbols.v128_max, compiler, Type.f32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_abs: return deferASM(BuiltinSymbols.v128_abs, compiler, Type.f32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_sqrt: return deferASM(BuiltinSymbols.v128_sqrt, compiler, Type.f32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_eq: return deferASM(BuiltinSymbols.v128_eq, compiler, Type.f32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_ne: return deferASM(BuiltinSymbols.v128_ne, compiler, Type.f32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_lt: return deferASM(BuiltinSymbols.v128_lt, compiler, Type.f32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_le: return deferASM(BuiltinSymbols.v128_le, compiler, Type.f32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_gt: return deferASM(BuiltinSymbols.v128_gt, compiler, Type.f32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_ge: return deferASM(BuiltinSymbols.v128_ge, compiler, Type.f32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_convert_s_i32x4: return deferASM(BuiltinSymbols.v128_convert, compiler, Type.i32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_convert_u_i32x4: return deferASM(BuiltinSymbols.v128_convert, compiler, Type.u32, operands, Type.v128, reportNode);\r\n\r\n case BuiltinSymbols.f64x2_splat: return deferASM(BuiltinSymbols.v128_splat, compiler, Type.f64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_extract_lane: return deferASM(BuiltinSymbols.v128_extract_lane, compiler, Type.f64, operands, Type.f64, reportNode);\r\n case BuiltinSymbols.f64x2_replace_lane: return deferASM(BuiltinSymbols.v128_replace_lane, compiler, Type.f64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_add: return deferASM(BuiltinSymbols.v128_add, compiler, Type.f64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_sub: return deferASM(BuiltinSymbols.v128_sub, compiler, Type.f64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_mul: return deferASM(BuiltinSymbols.v128_mul, compiler, Type.f64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_div: return deferASM(BuiltinSymbols.v128_div, compiler, Type.f64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_neg: return deferASM(BuiltinSymbols.v128_neg, compiler, Type.f64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_min: return deferASM(BuiltinSymbols.v128_min, compiler, Type.f64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_max: return deferASM(BuiltinSymbols.v128_max, compiler, Type.f64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_abs: return deferASM(BuiltinSymbols.v128_abs, compiler, Type.f64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_sqrt: return deferASM(BuiltinSymbols.v128_sqrt, compiler, Type.f64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_eq: return deferASM(BuiltinSymbols.v128_eq, compiler, Type.f64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_ne: return deferASM(BuiltinSymbols.v128_ne, compiler, Type.f64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_lt: return deferASM(BuiltinSymbols.v128_lt, compiler, Type.f64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_le: return deferASM(BuiltinSymbols.v128_le, compiler, Type.f64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_gt: return deferASM(BuiltinSymbols.v128_gt, compiler, Type.f64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_ge: return deferASM(BuiltinSymbols.v128_ge, compiler, Type.f64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_convert_s_i64x2: return deferASM(BuiltinSymbols.v128_convert, compiler, Type.i64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_convert_u_i64x2: return deferASM(BuiltinSymbols.v128_convert, compiler, Type.u64, operands, Type.v128, reportNode);\r\n\r\n case BuiltinSymbols.v8x16_shuffle: return deferASM(BuiltinSymbols.v128_shuffle, compiler, Type.i8, operands, Type.v128, reportNode);\r\n }\r\n }\r\n /* tslint:enable:max-line-length */\r\n return 0;\r\n}\r\n\r\n/** A helper for deferring inline-assembler-like calls to built-in functions. */\r\nfunction deferASM(\r\n name: string,\r\n compiler: Compiler,\r\n typeArgument: Type,\r\n operands: Expression[],\r\n contextualType: Type,\r\n reportNode: CallExpression\r\n): ExpressionRef {\r\n assert(compiler.program.elementsByName.has(name));\r\n var prototype = compiler.program.elementsByName.get(name)!;\r\n assert(prototype.kind == ElementKind.FUNCTION_PROTOTYPE);\r\n return compileCall(\r\n compiler,\r\n prototype,\r\n [ typeArgument ],\r\n operands,\r\n contextualType,\r\n reportNode,\r\n /* isAsm */ true\r\n );\r\n}\r\n\r\n/** Compiles an abort wired to the conditionally imported 'abort' function. */\r\nexport function compileAbort(\r\n compiler: Compiler,\r\n message: Expression | null,\r\n reportNode: Node\r\n): ExpressionRef {\r\n var program = compiler.program;\r\n var module = compiler.module;\r\n\r\n var stringInstance = compiler.program.stringInstance;\r\n if (!stringInstance) return module.createUnreachable();\r\n\r\n var abortInstance = program.abortInstance;\r\n if (!(abortInstance && compiler.compileFunction(abortInstance))) return module.createUnreachable();\r\n\r\n var messageArg = message != null\r\n ? compiler.compileExpression(message, stringInstance.type, ConversionKind.IMPLICIT, WrapMode.NONE)\r\n : stringInstance.type.toNativeZero(module);\r\n\r\n var filenameArg = compiler.ensureStaticString(reportNode.range.source.normalizedPath);\r\n\r\n compiler.currentType = Type.void;\r\n return module.createBlock(null, [\r\n module.createCall(\r\n abortInstance.internalName, [\r\n messageArg,\r\n filenameArg,\r\n module.createI32(reportNode.range.line),\r\n module.createI32(reportNode.range.column)\r\n ],\r\n NativeType.None\r\n ),\r\n module.createUnreachable()\r\n ]);\r\n}\r\n\r\n/** Compiles the iterateRoots function if required. */\r\nexport function compileIterateRoots(compiler: Compiler): void {\r\n var module = compiler.module;\r\n var exprs = new Array();\r\n var typeName = Signature.makeSignatureString([ Type.i32 ], Type.void);\r\n var typeRef = compiler.ensureFunctionType([ Type.i32 ], Type.void);\r\n\r\n for (let element of compiler.program.elementsByName.values()) {\r\n if (element.kind != ElementKind.GLOBAL) continue;\r\n let global = element;\r\n let classReference = global.type.classReference;\r\n if (\r\n global.is(CommonFlags.COMPILED) &&\r\n classReference !== null &&\r\n !classReference.hasDecorator(DecoratorFlags.UNMANAGED)\r\n ) {\r\n if (global.is(CommonFlags.INLINED)) {\r\n let value = global.constantIntegerValue;\r\n exprs.push(\r\n module.createCallIndirect(\r\n module.createGetLocal(0, NativeType.I32),\r\n [\r\n compiler.options.isWasm64\r\n ? module.createI64(i64_low(value), i64_high(value))\r\n : module.createI32(i64_low(value))\r\n ],\r\n typeName\r\n )\r\n );\r\n } else {\r\n exprs.push(\r\n module.createCallIndirect(\r\n module.createGetLocal(0, NativeType.I32),\r\n [\r\n module.createGetGlobal(\r\n global.internalName,\r\n compiler.options.nativeSizeType\r\n )\r\n ],\r\n typeName\r\n )\r\n );\r\n }\r\n }\r\n }\r\n module.addFunction(\"~iterateRoots\", typeRef, [],\r\n exprs.length\r\n ? module.createBlock(null, exprs)\r\n : module.createNop()\r\n );\r\n}\r\n\r\n/** Ensures that the specified class's GC hook exists and returns its function table index. */\r\nexport function ensureGCHook(\r\n compiler: Compiler,\r\n classInstance: Class\r\n): u32 {\r\n var program = compiler.program;\r\n assert(classInstance.type.isManaged(program));\r\n\r\n // check if the GC hook has already been created\r\n {\r\n let existingIndex = classInstance.gcHookIndex;\r\n if (existingIndex != -1) return existingIndex;\r\n }\r\n\r\n // check if the class implements a custom GC function (only valid for library elements)\r\n var members = classInstance.members;\r\n if (classInstance.isDeclaredInLibrary) {\r\n if (members !== null && members.has(\"__gc\")) {\r\n let gcPrototype = assert(members.get(\"__gc\"));\r\n assert(gcPrototype.kind == ElementKind.FUNCTION_PROTOTYPE);\r\n let gcInstance = assert(program.resolver.resolveFunction(gcPrototype, null));\r\n assert(gcInstance.is(CommonFlags.PRIVATE | CommonFlags.INSTANCE));\r\n assert(!gcInstance.isAny(CommonFlags.AMBIENT | CommonFlags.VIRTUAL));\r\n assert(gcInstance.signature.parameterTypes.length == 0);\r\n assert(gcInstance.signature.returnType == Type.void);\r\n gcInstance.internalName = classInstance.internalName + \"~gc\";\r\n assert(compiler.compileFunction(gcInstance));\r\n let index = compiler.ensureFunctionTableEntry(gcInstance);\r\n classInstance.gcHookIndex = index;\r\n return index;\r\n }\r\n }\r\n\r\n var module = compiler.module;\r\n var options = compiler.options;\r\n var nativeSizeType = options.nativeSizeType;\r\n var nativeSizeSize = options.usizeType.byteSize;\r\n var body = new Array();\r\n\r\n // nothing to mark if 'this' is null\r\n body.push(\r\n module.createIf(\r\n module.createUnary(\r\n options.isWasm64\r\n ? UnaryOp.EqzI64\r\n : UnaryOp.EqzI32,\r\n module.createGetLocal(0, nativeSizeType)\r\n ),\r\n module.createReturn()\r\n )\r\n );\r\n\r\n // remember the function index so we don't recurse infinitely\r\n var functionTable = compiler.functionTable;\r\n var gcHookIndex = functionTable.length;\r\n functionTable.push(\"\");\r\n classInstance.gcHookIndex = gcHookIndex;\r\n\r\n // if the class extends a base class, call its hook first (calls mark)\r\n var baseInstance = classInstance.base;\r\n if (baseInstance) {\r\n assert(baseInstance.type.isManaged(program));\r\n body.push(\r\n module.createCallIndirect(\r\n module.createI32(\r\n ensureGCHook(compiler, baseInstance.type.classReference)\r\n ),\r\n [\r\n module.createGetLocal(0, nativeSizeType)\r\n ],\r\n \"FUNCSIG$\" + (nativeSizeType == NativeType.I64 ? \"vj\" : \"vi\")\r\n )\r\n );\r\n\r\n // if this class is the top-most base class, mark the instance\r\n } else {\r\n body.push(\r\n module.createCall(assert(program.gcMarkInstance).internalName, [\r\n module.createGetLocal(0, nativeSizeType)\r\n ], NativeType.None)\r\n );\r\n }\r\n\r\n // mark instances assigned to own fields that are again references\r\n if (members) {\r\n for (let member of members.values()) {\r\n if (member.kind == ElementKind.FIELD) {\r\n if ((member).parent === classInstance) {\r\n let type = (member).type;\r\n if (type.isManaged(program)) {\r\n let offset = (member).memoryOffset;\r\n assert(offset >= 0);\r\n body.push(\r\n module.createCall(assert(program.gcMarkInstance).internalName, [\r\n module.createLoad(\r\n nativeSizeSize,\r\n false,\r\n module.createGetLocal(0, nativeSizeType),\r\n nativeSizeType,\r\n offset\r\n )\r\n ], NativeType.None)\r\n );\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n // add the function to the module and return its table index\r\n var funcName = classInstance.internalName + \"~gc\";\r\n module.addFunction(\r\n funcName,\r\n compiler.ensureFunctionType(null, Type.void, options.usizeType),\r\n null,\r\n module.createBlock(null, body)\r\n );\r\n functionTable[gcHookIndex] = funcName;\r\n return gcHookIndex;\r\n}\r\n\r\n// Helpers\r\n\r\n/** Evaluates the constant type of a type argument *or* expression. */\r\nfunction evaluateConstantType(\r\n compiler: Compiler,\r\n typeArguments: Type[] | null,\r\n operands: Expression[],\r\n reportNode: CallExpression\r\n): Type | null {\r\n if (operands.length == 0) { // requires type argument\r\n if (!typeArguments || typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.typeArgumentsRange, \"1\", typeArguments ? typeArguments.length.toString(10) : \"0\"\r\n );\r\n return null;\r\n }\r\n return typeArguments[0];\r\n }\r\n if (operands.length == 1) { // optional type argument\r\n if (typeArguments) {\r\n if (typeArguments.length == 1) {\r\n compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.NONE);\r\n } else {\r\n if (typeArguments.length) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.typeArgumentsRange, \"1\", typeArguments.length.toString(10)\r\n );\r\n return null;\r\n }\r\n compiler.compileExpressionRetainType(operands[0], Type.i32, WrapMode.NONE);\r\n }\r\n } else {\r\n compiler.compileExpressionRetainType(operands[0], Type.i32, WrapMode.NONE);\r\n }\r\n return compiler.currentType;\r\n }\r\n if (typeArguments && typeArguments.length > 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.typeArgumentsRange, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.argumentsRange, \"1\", operands.length.toString(10)\r\n );\r\n return null;\r\n}\r\n\r\n/** Evaluates a compile-time constant immediate offset argument.*/\r\nfunction evaluateImmediateOffset(expression: Expression, compiler: Compiler): i32 {\r\n var expr: ExpressionRef;\r\n var value: i32;\r\n if (compiler.options.isWasm64) {\r\n expr = compiler.precomputeExpression(expression, Type.usize64, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n if (\r\n getExpressionId(expr) != ExpressionId.Const ||\r\n getExpressionType(expr) != NativeType.I64 ||\r\n getConstValueI64High(expr) != 0 ||\r\n (value = getConstValueI64Low(expr)) < 0\r\n ) {\r\n compiler.error(\r\n DiagnosticCode.Expression_must_be_a_compile_time_constant,\r\n expression.range\r\n );\r\n value = -1;\r\n }\r\n } else {\r\n expr = compiler.precomputeExpression(expression, Type.usize32, ConversionKind.IMPLICIT, WrapMode.NONE);\r\n if (\r\n getExpressionId(expr) != ExpressionId.Const ||\r\n getExpressionType(expr) != NativeType.I32 ||\r\n (value = getConstValueI32(expr)) < 0\r\n ) {\r\n compiler.error(\r\n DiagnosticCode.Expression_must_be_a_compile_time_constant,\r\n expression.range\r\n );\r\n value = -1;\r\n }\r\n }\r\n return value;\r\n}\r\n\r\n/** Checks a call with a single required type argument. Returns `1` on error. */\r\nfunction checkTypeRequired(\r\n typeArguments: Type[] | null,\r\n reportNode: CallExpression,\r\n compiler: Compiler,\r\n setCurrentTypeOnError: bool = false\r\n): i32 {\r\n if (typeArguments) {\r\n let numTypeArguments = typeArguments.length;\r\n if (numTypeArguments == 1) return 0;\r\n assert(numTypeArguments); // invalid if 0, must not be set at all instead\r\n if (setCurrentTypeOnError) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.typeArgumentsRange, \"1\", numTypeArguments.toString()\r\n );\r\n } else {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", \"0\"\r\n );\r\n }\r\n return 1;\r\n}\r\n\r\n/** Checks a call with a single optional type argument. Returns `1` on error. */\r\nfunction checkTypeOptional(\r\n typeArguments: Type[] | null,\r\n reportNode: CallExpression,\r\n compiler: Compiler,\r\n setCurrentTypeOnError: bool = false\r\n): i32 {\r\n if (typeArguments) {\r\n let numTypeArguments = typeArguments.length;\r\n if (numTypeArguments == 1) return 0;\r\n assert(numTypeArguments); // invalid if 0, must not be set at all instead\r\n if (setCurrentTypeOnError) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.typeArgumentsRange, \"1\", numTypeArguments.toString()\r\n );\r\n return 1;\r\n }\r\n return 0;\r\n}\r\n\r\n/** Checks a call that is not generic. Returns `1` on error. */\r\nfunction checkTypeAbsent(\r\n typeArguments: Type[] | null,\r\n reportNode: CallExpression,\r\n prototype: FunctionPrototype\r\n): i32 {\r\n if (typeArguments) {\r\n prototype.program.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.typeArgumentsRange, prototype.internalName\r\n );\r\n return 1;\r\n }\r\n return 0;\r\n}\r\n\r\n/** Checks a call that requires a fixed number of arguments. Returns `1` on error. */\r\nfunction checkArgsRequired(\r\n operands: Expression[],\r\n expected: i32,\r\n reportNode: CallExpression,\r\n compiler: Compiler\r\n): i32 {\r\n if (operands.length != expected) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, expected.toString(), operands.length.toString()\r\n );\r\n return 1;\r\n }\r\n return 0;\r\n}\r\n\r\n/** Checks a call that requires a variable number of arguments. Returns `1` on error. */\r\nfunction checkArgsOptional(\r\n operands: Expression[],\r\n expectedMinimum: i32,\r\n expectedMaximum: i32,\r\n reportNode: CallExpression,\r\n compiler: Compiler\r\n): i32 {\r\n var numOperands = operands.length;\r\n if (numOperands < expectedMinimum) {\r\n compiler.error(\r\n DiagnosticCode.Expected_at_least_0_arguments_but_got_1,\r\n reportNode.range, expectedMinimum.toString(), numOperands.toString()\r\n );\r\n return 1;\r\n } else if (numOperands > expectedMaximum) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, expectedMaximum.toString(), numOperands.toString()\r\n );\r\n return 1;\r\n }\r\n return 0;\r\n}\r\n","/** @module util *//***/\r\n\r\n/** Tests if the bit at the specified index is set within a 64-bit map. */\r\nexport function bitsetIs(map: I64, index: i32): bool {\r\n assert(index >= 0 && index < 64);\r\n return i64_ne(\r\n i64_and(\r\n map,\r\n i64_shl(\r\n i64_one,\r\n i64_new(index)\r\n )\r\n ),\r\n i64_zero\r\n );\r\n}\r\n\r\n/** Sets or unsets the bit at the specified index within a 64-bit map and returns the new map. */\r\nexport function bitsetSet(map: I64, index: i32, isSet: bool): I64 {\r\n assert(index >= 0 && index < 64);\r\n return isSet\r\n ? i64_or(\r\n map,\r\n i64_shl(\r\n i64_one,\r\n i64_new(index)\r\n )\r\n )\r\n : i64_and(\r\n map,\r\n i64_not(\r\n i64_shl(\r\n i64_one,\r\n i64_new(index)\r\n )\r\n )\r\n );\r\n}\r\n","/** @module util *//***/\r\n\r\n/** An enum of named character codes. */\r\nexport const enum CharCode {\r\n\r\n NULL = 0,\r\n LINEFEED = 0x0A,\r\n CARRIAGERETURN = 0x0D,\r\n LINESEPARATOR = 0x2028,\r\n PARAGRAPHSEPARATOR = 0x2029,\r\n NEXTLINE = 0x0085,\r\n\r\n SPACE = 0x20,\r\n NONBREAKINGSPACE = 0xA0,\r\n ENQUAD = 0x2000,\r\n EMQUAD = 0x2001,\r\n ENSPACE = 0x2002,\r\n EMSPACE = 0x2003,\r\n THREEPEREMSPACE = 0x2004,\r\n FOURPEREMSPACE = 0x2005,\r\n SIXPEREMSPACE = 0x2006,\r\n FIGURESPACE = 0x2007,\r\n PUNCTUATIONSPACE = 0x2008,\r\n THINSPACE = 0x2009,\r\n HAIRSPACE = 0x200A,\r\n ZEROWIDTHSPACE = 0x200B,\r\n NARROWNOBREAKSPACE = 0x202F,\r\n IDEOGRAPHICSPACE = 0x3000,\r\n MATHEMATICALSPACE = 0x205F,\r\n OGHAM = 0x1680,\r\n\r\n _ = 0x5F,\r\n\r\n _0 = 0x30,\r\n _1 = 0x31,\r\n _2 = 0x32,\r\n _3 = 0x33,\r\n _4 = 0x34,\r\n _5 = 0x35,\r\n _6 = 0x36,\r\n _7 = 0x37,\r\n _8 = 0x38,\r\n _9 = 0x39,\r\n\r\n a = 0x61,\r\n b = 0x62,\r\n c = 0x63,\r\n d = 0x64,\r\n e = 0x65,\r\n f = 0x66,\r\n g = 0x67,\r\n h = 0x68,\r\n i = 0x69,\r\n j = 0x6A,\r\n k = 0x6B,\r\n l = 0x6C,\r\n m = 0x6D,\r\n n = 0x6E,\r\n o = 0x6F,\r\n p = 0x70,\r\n q = 0x71,\r\n r = 0x72,\r\n s = 0x73,\r\n t = 0x74,\r\n u = 0x75,\r\n v = 0x76,\r\n w = 0x77,\r\n x = 0x78,\r\n y = 0x79,\r\n z = 0x7A,\r\n\r\n A = 0x41,\r\n B = 0x42,\r\n C = 0x43,\r\n D = 0x44,\r\n E = 0x45,\r\n F = 0x46,\r\n G = 0x47,\r\n H = 0x48,\r\n I = 0x49,\r\n J = 0x4A,\r\n K = 0x4B,\r\n L = 0x4C,\r\n M = 0x4D,\r\n N = 0x4E,\r\n O = 0x4F,\r\n P = 0x50,\r\n Q = 0x51,\r\n R = 0x52,\r\n S = 0x53,\r\n T = 0x54,\r\n U = 0x55,\r\n V = 0x56,\r\n W = 0x57,\r\n X = 0x58,\r\n Y = 0x59,\r\n Z = 0x5a,\r\n\r\n AMPERSAND = 0x26,\r\n ASTERISK = 0x2A,\r\n AT = 0x40,\r\n BACKSLASH = 0x5C,\r\n BACKTICK = 0x60,\r\n BAR = 0x7C,\r\n CARET = 0x5E,\r\n CLOSEBRACE = 0x7D,\r\n CLOSEBRACKET = 0x5D,\r\n CLOSEPAREN = 0x29,\r\n COLON = 0x3A,\r\n COMMA = 0x2C,\r\n DOLLAR = 0x24,\r\n DOT = 0x2E,\r\n DOUBLEQUOTE = 0x22,\r\n EQUALS = 0x3D,\r\n EXCLAMATION = 0x21,\r\n GREATERTHAN = 0x3E,\r\n HASH = 0x23,\r\n LESSTHAN = 0x3C,\r\n MINUS = 0x2D,\r\n OPENBRACE = 0x7B,\r\n OPENBRACKET = 0x5B,\r\n OPENPAREN = 0x28,\r\n PERCENT = 0x25,\r\n PLUS = 0x2B,\r\n QUESTION = 0x3F,\r\n SEMICOLON = 0x3B,\r\n SINGLEQUOTE = 0x27,\r\n SLASH = 0x2F,\r\n TILDE = 0x7E,\r\n\r\n BACKSPACE = 0x08,\r\n FORMFEED = 0x0C,\r\n BYTEORDERMARK = 0xFEFF,\r\n TAB = 0x09,\r\n VERTICALTAB = 0x0B\r\n}\r\n\r\n/** Tests if the specified character code is some sort of line break. */\r\nexport function isLineBreak(c: CharCode): bool {\r\n switch (c) {\r\n case CharCode.LINEFEED:\r\n case CharCode.CARRIAGERETURN:\r\n case CharCode.LINESEPARATOR:\r\n case CharCode.PARAGRAPHSEPARATOR: {\r\n return true;\r\n }\r\n default: {\r\n return false;\r\n }\r\n }\r\n}\r\n\r\n/** Tests if the specified character code is some sort of white space. */\r\nexport function isWhiteSpace(c: i32): bool {\r\n switch (c) {\r\n case CharCode.SPACE:\r\n case CharCode.TAB:\r\n case CharCode.VERTICALTAB:\r\n case CharCode.FORMFEED:\r\n case CharCode.NONBREAKINGSPACE:\r\n case CharCode.NEXTLINE:\r\n case CharCode.OGHAM:\r\n case CharCode.NARROWNOBREAKSPACE:\r\n case CharCode.MATHEMATICALSPACE:\r\n case CharCode.IDEOGRAPHICSPACE:\r\n case CharCode.BYTEORDERMARK: {\r\n return true;\r\n }\r\n default: {\r\n return c >= CharCode.ENQUAD && c <= CharCode.ZEROWIDTHSPACE;\r\n }\r\n }\r\n}\r\n\r\n/** Tests if the specified character code is a valid decimal digit. */\r\nexport function isDecimalDigit(c: i32): bool {\r\n return c >= CharCode._0 && c <= CharCode._9;\r\n}\r\n\r\n/** Tests if the specified character code is a valid octal digit. */\r\nexport function isOctalDigit(c: i32): bool {\r\n return c >= CharCode._0 && c <= CharCode._7;\r\n}\r\n\r\n/** Tests if the specified character code is a valid start of an identifier. */\r\nexport function isIdentifierStart(c: i32): bool {\r\n return c >= CharCode.a && c <= CharCode.z\r\n || c >= CharCode.A && c <= CharCode.Z\r\n || c == CharCode._\r\n || c == CharCode.DOLLAR\r\n || c > 0x7f && isUnicodeIdentifierStart(c);\r\n}\r\n\r\n/** Tests if the specified character code is a valid keyword character. */\r\nexport function isKeywordCharacter(c: i32): bool {\r\n return c >= CharCode.a && c <= CharCode.z;\r\n}\r\n\r\n/** Tests if the specified character code is a valid part of an identifier. */\r\nexport function isIdentifierPart(c: i32): bool {\r\n return c >= CharCode.a && c <= CharCode.z\r\n || c >= CharCode.A && c <= CharCode.Z\r\n || c >= CharCode._0 && c <= CharCode._9\r\n || c == CharCode._\r\n || c == CharCode.DOLLAR\r\n || c > 0x7f && isUnicodeIdentifierPart(c);\r\n}\r\n\r\n// storing as u16 to save memory\r\nconst unicodeIdentifierStart: u16[] = [\r\n 170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736,\r\n 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906,\r\n 908, 908, 910, 929, 931,\r\n 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514,\r\n 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774,\r\n 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969,\r\n 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088,\r\n 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384,\r\n 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474,\r\n 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529,\r\n 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613,\r\n 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705,\r\n 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784,\r\n 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873,\r\n 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958,\r\n 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986,\r\n 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125,\r\n 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240,\r\n 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333,\r\n 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455,\r\n 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634,\r\n 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725,\r\n 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757,\r\n 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840,\r\n 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186,\r\n 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293,\r\n 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696,\r\n 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798,\r\n 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992,\r\n 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872,\r\n 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016,\r\n 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389,\r\n 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688,\r\n 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141,\r\n 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424,\r\n 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025,\r\n 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130,\r\n 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188,\r\n 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469,\r\n 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505,\r\n 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584,\r\n 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520,\r\n 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670,\r\n 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720,\r\n 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329,\r\n 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540,\r\n 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893,\r\n 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538,\r\n 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888,\r\n 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013, 43015,\r\n 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259,\r\n 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520,\r\n 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695,\r\n 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739,\r\n 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798,\r\n 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243,\r\n 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285,\r\n 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323,\r\n 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019,\r\n 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474,\r\n 65479, 65482, 65487, 65490, 65495, 65498, 65500,\r\n];\r\nconst unicodeIdentifierPart: u16[] = [\r\n 170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736,\r\n 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906,\r\n 908, 908, 910, 929, 931,\r\n 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415,\r\n 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520,\r\n 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788,\r\n 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112,\r\n 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423,\r\n 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482,\r\n 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525,\r\n 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602,\r\n 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632,\r\n 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693,\r\n 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757,\r\n 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821,\r\n 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884,\r\n 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929,\r\n 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972,\r\n 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018,\r\n 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088,\r\n 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157,\r\n 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216,\r\n 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285,\r\n 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340,\r\n 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424,\r\n 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515,\r\n 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570,\r\n 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720,\r\n 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751,\r\n 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789,\r\n 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895,\r\n 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028,\r\n 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304,\r\n 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744,\r\n 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808,\r\n 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108,\r\n 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902,\r\n 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099,\r\n 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272,\r\n 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516,\r\n 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783,\r\n 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155,\r\n 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676,\r\n 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027,\r\n 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134,\r\n 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205,\r\n 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417,\r\n 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477,\r\n 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517,\r\n 8521, 8526, 8526, 8544, 8584,\r\n 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559,\r\n 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686,\r\n 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728,\r\n 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335,\r\n 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449,\r\n 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799,\r\n 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512,\r\n 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783,\r\n 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43047, 43072,\r\n 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309,\r\n 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584,\r\n 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741,\r\n 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808,\r\n 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203,\r\n 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275,\r\n 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321,\r\n 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008,\r\n 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140,\r\n 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382,\r\n 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,\r\n];\r\n\r\nfunction lookupInUnicodeMap(code: u16, map: u16[]): bool {\r\n if (code < map[0]) return false;\r\n\r\n var lo = 0;\r\n var hi = map.length;\r\n var mid: i32;\r\n var midVal: u16;\r\n\r\n while (lo + 1 < hi) {\r\n mid = lo + ((hi - lo) >> 1);\r\n mid -= (mid & 1);\r\n midVal = map[mid];\r\n if (midVal <= code && code <= map[mid + 1]) {\r\n return true;\r\n }\r\n if (code < midVal) {\r\n hi = mid;\r\n } else {\r\n lo = mid + 2;\r\n }\r\n }\r\n return false;\r\n}\r\n\r\nfunction isUnicodeIdentifierStart(code: i32): bool {\r\n return code < 0 || code > 0xffff ? false\r\n : lookupInUnicodeMap(code as u16, unicodeIdentifierStart);\r\n}\r\n\r\nfunction isUnicodeIdentifierPart(code: i32): bool {\r\n return code < 0 || code > 0xffff ? false\r\n : lookupInUnicodeMap(code as u16, unicodeIdentifierPart);\r\n}\r\n","export function makeArray(original: Array | null = null): Array {\r\n if (original) {\r\n let cloned = new Array(original.length);\r\n for (let i = 0, k = original.length; i < k; ++i) unchecked(cloned[i] = original[i]);\r\n return cloned;\r\n }\r\n return new Array();\r\n}\r\n\r\nexport function makeSet(original: Set | null = null): Set {\r\n if (original) {\r\n let cloned = new Set();\r\n for (let v of original) cloned.add(v);\r\n return cloned;\r\n }\r\n return new Set();\r\n}\r\n\r\nexport function makeMap(original: Map | null = null, overrides: Map | null = null): Map {\r\n var cloned = new Map();\r\n if (original) {\r\n for (let [k, v] of original) cloned.set(k, v);\r\n if (overrides) for (let [k, v] of overrides) cloned.set(k, v);\r\n } else if (overrides) {\r\n for (let [k, v] of overrides) cloned.set(k, v);\r\n }\r\n return cloned;\r\n}\r\n","/** @module util *//***/\r\n\r\nimport {\r\n CharCode\r\n} from \"./charcode\";\r\n\r\nimport {\r\n PATH_DELIMITER\r\n} from \"../common\";\r\n\r\nconst separator = CharCode.SLASH;\r\n\r\n/**\r\n * Normalizes the specified path, removing interior placeholders.\r\n * Expects a posix-compatible relative path (not Windows compatible).\r\n */\r\nexport function normalizePath(path: string): string {\r\n var pos = 0;\r\n var len = path.length;\r\n\r\n // trim leading './'\r\n while (pos + 1 < len &&\r\n path.charCodeAt(pos) == CharCode.DOT &&\r\n path.charCodeAt(pos + 1) == separator\r\n ) {\r\n pos += 2;\r\n }\r\n\r\n if (pos > 0 || len < path.length) {\r\n path = path.substring(pos, len);\r\n len -= pos;\r\n pos = 0;\r\n }\r\n\r\n var atEnd: bool;\r\n while (pos + 1 < len) {\r\n atEnd = false;\r\n\r\n // we are only interested in '/.' sequences ...\r\n if (\r\n path.charCodeAt(pos) == separator &&\r\n path.charCodeAt(pos + 1) == CharCode.DOT\r\n ) {\r\n // '/.' ( '/' | $ )\r\n atEnd = pos + 2 == len;\r\n if (atEnd ||\r\n pos + 2 < len &&\r\n path.charCodeAt(pos + 2) == separator\r\n ) {\r\n path = atEnd\r\n ? path.substring(0, pos)\r\n : path.substring(0, pos) + path.substring(pos + 2);\r\n len -= 2;\r\n continue;\r\n }\r\n\r\n // '/.' ( './' | '.' $ )\r\n atEnd = pos + 3 == len;\r\n if (atEnd && path.charCodeAt(pos + 2) == CharCode.DOT ||\r\n pos + 3 < len &&\r\n path.charCodeAt(pos + 2) == CharCode.DOT &&\r\n path.charCodeAt(pos + 3) == separator\r\n ) {\r\n // find preceeding '/'\r\n let ipos = pos;\r\n while (--ipos >= 0) {\r\n if (path.charCodeAt(ipos) == separator) {\r\n if (pos - ipos != 3 ||\r\n path.charCodeAt(ipos + 1) != CharCode.DOT ||\r\n path.charCodeAt(ipos + 2) != CharCode.DOT\r\n ) { // exclude '..' itself\r\n path = atEnd\r\n ? path.substring(0, ipos)\r\n : path.substring(0, ipos) + path.substring(pos + 3);\r\n len -= pos + 3 - ipos;\r\n pos = ipos - 1; // incremented again at end of loop\r\n }\r\n break;\r\n }\r\n }\r\n\r\n // if there's no preceeding '/', trim start if non-empty\r\n if (ipos < 0 && pos > 0) {\r\n if (pos != 2 ||\r\n path.charCodeAt(0) != CharCode.DOT ||\r\n path.charCodeAt(1) != CharCode.DOT\r\n ) { // exclude '..' itself\r\n path = path.substring(pos + 4);\r\n len = path.length;\r\n continue;\r\n }\r\n }\r\n }\r\n }\r\n pos++;\r\n }\r\n return len > 0 ? path : \".\";\r\n}\r\n\r\n/** Resolves the specified path relative to the specified origin. */\r\nexport function resolvePath(normalizedPath: string, origin: string): string {\r\n if (normalizedPath.startsWith(\"std/\")) {\r\n return normalizedPath;\r\n }\r\n return normalizePath(\r\n dirname(origin) + PATH_DELIMITER + normalizedPath\r\n );\r\n}\r\n\r\n/** Obtains the directory portion of a normalized path. */\r\nexport function dirname(normalizedPath: string): string {\r\n var pos = normalizedPath.length;\r\n if (pos <= 1) {\r\n if (pos == 0) return \".\";\r\n if (normalizedPath.charCodeAt(0) == separator) {\r\n return normalizedPath;\r\n }\r\n }\r\n while (--pos > 0) {\r\n if (normalizedPath.charCodeAt(pos) == separator) {\r\n return normalizedPath.substring(0, pos);\r\n }\r\n }\r\n return \".\";\r\n}\r\n","/** @module util *//***/\r\n\r\nconst indentX1 = \" \";\r\nconst indentX2 = \" \";\r\nconst indentX4 = \" \";\r\n\r\n/** Creates an indentation matching the number of specified levels. */\r\nexport function indent(sb: string[], level: i32): void {\r\n while (level >= 4) {\r\n sb.push(indentX4);\r\n level -= 4;\r\n }\r\n if (level >= 2) {\r\n sb.push(indentX2);\r\n level -= 2;\r\n }\r\n if (level) {\r\n sb.push(indentX1);\r\n }\r\n}\r\n","/** @module util *//***/\r\n\r\n/** Reads an 8-bit integer from the specified buffer. */\r\nexport function readI8(buffer: Uint8Array, offset: i32): i32 {\r\n return buffer[offset];\r\n}\r\n\r\n/** Writes an 8-bit integer to the specified buffer. */\r\nexport function writeI8(value: i32, buffer: Uint8Array, offset: i32): void {\r\n buffer[offset] = value;\r\n}\r\n\r\n/** Reads a 16-bit integer from the specified buffer. */\r\nexport function readI16(buffer: Uint8Array, offset: i32): i32 {\r\n return buffer[offset ]\r\n | buffer[offset + 1] << 8;\r\n}\r\n\r\n/** Writes a 16-bit integer to the specified buffer. */\r\nexport function writeI16(value: i32, buffer: Uint8Array, offset: i32): void {\r\n buffer[offset ] = value;\r\n buffer[offset + 1] = value >>> 8;\r\n}\r\n\r\n/** Reads a 32-bit integer from the specified buffer. */\r\nexport function readI32(buffer: Uint8Array, offset: i32): i32 {\r\n return buffer[offset ]\r\n | buffer[offset + 1] << 8\r\n | buffer[offset + 2] << 16\r\n | buffer[offset + 3] << 24;\r\n}\r\n\r\n/** Writes a 32-bit integer to the specified buffer. */\r\nexport function writeI32(value: i32, buffer: Uint8Array, offset: i32): void {\r\n buffer[offset ] = value;\r\n buffer[offset + 1] = value >>> 8;\r\n buffer[offset + 2] = value >>> 16;\r\n buffer[offset + 3] = value >>> 24;\r\n}\r\n\r\n/** Reads a 64-bit integer from the specified buffer. */\r\nexport function readI64(buffer: Uint8Array, offset: i32): I64 {\r\n var lo = readI32(buffer, offset);\r\n var hi = readI32(buffer, offset + 4);\r\n return i64_new(lo, hi);\r\n}\r\n\r\n/** Writes a 64-bit integer to the specified buffer. */\r\nexport function writeI64(value: I64, buffer: Uint8Array, offset: i32): void {\r\n writeI32(i64_low(value), buffer, offset);\r\n writeI32(i64_high(value), buffer, offset + 4);\r\n}\r\n\r\n/** Reads a 32-bit float from the specified buffer. */\r\nexport function readF32(buffer: Uint8Array, offset: i32): f32 {\r\n return i32_as_f32(readI32(buffer, offset));\r\n}\r\n\r\n/** Writes a 32-bit float to the specified buffer. */\r\nexport function writeF32(value: f32, buffer: Uint8Array, offset: i32): void {\r\n writeI32(f32_as_i32(value), buffer, offset);\r\n}\r\n\r\n/** Reads a 64-bit float from the specified buffer. */\r\nexport function readF64(buffer: Uint8Array, offset: i32): f64 {\r\n return i64_as_f64(readI64(buffer, offset));\r\n}\r\n\r\n/** Writes a 64-bit float to the specified buffer. */\r\nexport function writeF64(value: f64, buffer: Uint8Array, offset: i32): void {\r\n var valueI64 = f64_as_i64(value);\r\n writeI32(i64_low(valueI64), buffer, offset);\r\n writeI32(i64_high(valueI64), buffer, offset + 4);\r\n}\r\n","/**\r\n * Low-level C-like compiler API.\r\n * @module index\r\n *//***/\r\n\r\nimport {\r\n Compiler,\r\n Options,\r\n Target,\r\n Feature\r\n} from \"./compiler\";\r\n\r\nimport {\r\n Decompiler\r\n} from \"./decompiler\";\r\n\r\nimport {\r\n IDLBuilder,\r\n TSDBuilder\r\n} from \"./definitions\";\r\n\r\nimport {\r\n DiagnosticMessage,\r\n DiagnosticCategory,\r\n formatDiagnosticMessage\r\n} from \"./diagnostics\";\r\n\r\nimport {\r\n Module\r\n} from \"./module\";\r\n\r\nimport {\r\n Parser\r\n} from \"./parser\";\r\n\r\nimport {\r\n Program\r\n} from \"./program\";\r\n\r\n/** Parses a source file. If `parser` has been omitted a new one is created. */\r\nexport function parseFile(text: string, path: string, isEntry: bool = false,\r\n parser: Parser | null = null\r\n): Parser {\r\n if (!parser) parser = new Parser();\r\n parser.parseFile(text, path, isEntry);\r\n return parser;\r\n}\r\n\r\n/** Obtains the next required file's path. Returns `null` once complete. */\r\nexport function nextFile(parser: Parser): string | null {\r\n return parser.nextFile();\r\n}\r\n\r\n/** Obtains the next diagnostic message. Returns `null` once complete. */\r\nexport function nextDiagnostic(parser: Parser): DiagnosticMessage | null {\r\n var program = parser.program;\r\n return program.diagnosticsOffset < program.diagnostics.length\r\n ? program.diagnostics[program.diagnosticsOffset++]\r\n : null;\r\n}\r\n\r\n/** Formats a diagnostic message to a string. */\r\nexport { formatDiagnosticMessage as formatDiagnostic };\r\n\r\n/** Tests whether a diagnostic is informatory. */\r\nexport function isInfo(message: DiagnosticMessage): bool {\r\n return message.category == DiagnosticCategory.INFO;\r\n}\r\n\r\n/** Tests whether a diagnostic is a warning. */\r\nexport function isWarning(message: DiagnosticMessage): bool {\r\n return message.category == DiagnosticCategory.WARNING;\r\n}\r\n\r\n/** Tests whether a diagnostic is an error. */\r\nexport function isError(message: DiagnosticMessage): bool {\r\n return message.category == DiagnosticCategory.ERROR;\r\n}\r\n\r\n/** Creates a new set of compiler options. */\r\nexport function createOptions(): Options {\r\n return new Options();\r\n}\r\n\r\n/** Sets the `target` option. */\r\nexport function setTarget(options: Options, target: Target): void {\r\n options.target = target;\r\n}\r\n\r\n/** Sets the `noAssert` option. */\r\nexport function setNoAssert(options: Options, noAssert: bool): void {\r\n options.noAssert = noAssert;\r\n}\r\n\r\n/** Sets the `importMemory` option. */\r\nexport function setImportMemory(options: Options, importMemory: bool): void {\r\n options.importMemory = importMemory;\r\n}\r\n\r\n/** Sets the `sharedMemory` option. */\r\nexport function setSharedMemory(options: Options, sharedMemory: i32): void {\r\n options.sharedMemory = sharedMemory;\r\n}\r\n\r\n/** Sets the `importTable` option. */\r\nexport function setImportTable(options: Options, importTable: bool): void {\r\n options.importTable = importTable;\r\n}\r\n\r\n/** Sets the `sourceMap` option. */\r\nexport function setSourceMap(options: Options, sourceMap: bool): void {\r\n options.sourceMap = sourceMap;\r\n}\r\n\r\n/** Sets the `memoryBase` option. */\r\nexport function setMemoryBase(options: Options, memoryBase: u32): void {\r\n options.memoryBase = memoryBase;\r\n}\r\n\r\n/** Sets a 'globalAliases' value. */\r\nexport function setGlobalAlias(options: Options, name: string, alias: string): void {\r\n var globalAliases = options.globalAliases;\r\n if (!globalAliases) options.globalAliases = globalAliases = new Map();\r\n globalAliases.set(name, alias);\r\n}\r\n\r\n/** Sign extension operations. */\r\nexport const FEATURE_SIGN_EXTENSION = Feature.SIGN_EXTENSION;\r\n/** Mutable global imports and exports. */\r\nexport const FEATURE_MUTABLE_GLOBAL = Feature.MUTABLE_GLOBAL;\r\n/** Bulk memory operations. */\r\nexport const FEATURE_BULK_MEMORY = Feature.BULK_MEMORY;\r\n/** SIMD types and operations. */\r\nexport const FEATURE_SIMD = Feature.SIMD;\r\n/** Threading and atomic operations. */\r\nexport const FEATURE_THREADS = Feature.THREADS;\r\n\r\n/** Enables a specific feature. */\r\nexport function enableFeature(options: Options, feature: Feature): void {\r\n options.features |= feature;\r\n}\r\n\r\n/** Gives the compiler a hint at the optimize levels that will be used later on. */\r\nexport function setOptimizeLevelHints(options: Options, optimizeLevel: i32, shrinkLevel: i32): void {\r\n options.optimizeLevelHint = optimizeLevel;\r\n options.shrinkLevelHint = shrinkLevel;\r\n}\r\n\r\n/** Finishes parsing. */\r\nexport function finishParsing(parser: Parser): Program {\r\n return parser.finish();\r\n}\r\n\r\n/** Compiles the sources computed by the parser to a module. */\r\nexport function compileProgram(program: Program, options: Options | null = null): Module {\r\n return new Compiler(program, options).compile();\r\n}\r\n\r\n/** Decompiles a module to its (low level) source. */\r\nexport function decompileModule(module: Module): string {\r\n var decompiler = new Decompiler();\r\n decompiler.decompile(module);\r\n return decompiler.finish();\r\n}\r\n\r\n/** Builds WebIDL definitions for the specified program. */\r\nexport function buildIDL(program: Program): string {\r\n return IDLBuilder.build(program);\r\n}\r\n\r\n/** Builds TypeScript definitions for the specified program. */\r\nexport function buildTSD(program: Program): string {\r\n return TSDBuilder.build(program);\r\n}\r\n\r\n/** Prefix indicating a library file. */\r\nexport { LIBRARY_PREFIX } from \"./common\";\r\n\r\n// Full API\r\nexport * from \"./ast\";\r\n// export * from \"./binary\";\r\nexport * from \"./common\";\r\nexport * from \"./compiler\";\r\nexport * from \"./decompiler\";\r\nexport * from \"./definitions\";\r\nexport * from \"./diagnosticMessages.generated\";\r\nexport * from \"./diagnostics\";\r\nexport * from \"./flow\";\r\nexport * from \"./module\";\r\nexport * from \"./parser\";\r\nexport * from \"./program\";\r\nexport * from \"./resolver\";\r\nexport * from \"./tokenizer\";\r\nexport * from \"./types\";\r\nexport * from \"./util\";\r\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://assemblyscript/webpack/universalModuleDefinition","webpack://assemblyscript/webpack/bootstrap","webpack://assemblyscript/./src/common.ts","webpack://assemblyscript/./src/util/index.ts","webpack://assemblyscript/./src/diagnostics.ts","webpack://assemblyscript/./src/program.ts","webpack://assemblyscript/./src/module.ts","webpack://assemblyscript/./src/ast.ts","webpack://assemblyscript/./src/types.ts","webpack://assemblyscript/./src/tokenizer.ts","webpack://assemblyscript/(webpack)/buildin/global.js","webpack://assemblyscript/./src/resolver.ts","webpack://assemblyscript/./src/flow.ts","webpack://assemblyscript/./src/compiler.ts","webpack://assemblyscript/./src/diagnosticMessages.generated.ts","webpack://assemblyscript/./src/builtins.ts","webpack://assemblyscript/./src/decompiler.ts","webpack://assemblyscript/./src/definitions.ts","webpack://assemblyscript/./src/parser.ts","webpack://assemblyscript/./src/glue/js/index.ts","webpack://assemblyscript/./src/glue/js/binaryen.js","webpack://assemblyscript/external \"binaryen\"","webpack://assemblyscript/./std/portable/index.js","webpack://assemblyscript/./src/glue/js/float.js","webpack://assemblyscript/./src/glue/js/i64.js","webpack://assemblyscript/./node_modules/long/src/long.js","webpack://assemblyscript/./std/assembly/shared/feature.ts","webpack://assemblyscript/./std/assembly/shared/target.ts","webpack://assemblyscript/./std/assembly/shared/typeinfo.ts","webpack://assemblyscript/./src/index.ts","webpack://assemblyscript/./src/util/bitset.ts","webpack://assemblyscript/./src/util/charcode.ts","webpack://assemblyscript/./src/util/collections.ts","webpack://assemblyscript/./src/util/path.ts","webpack://assemblyscript/./src/util/text.ts","webpack://assemblyscript/./src/util/binary.ts"],"names":["root","factory","exports","module","require","define","amd","self","this","__WEBPACK_EXTERNAL_MODULE__20__","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","CommonFlags","PATH_DELIMITER","PARENT_SUBST","GETTER_PREFIX","SETTER_PREFIX","INSTANCE_DELIMITER","STATIC_DELIMITER","INNER_DELIMITER","LIBRARY_SUBST","LIBRARY_PREFIX","INDEX_SUFFIX","CommonSymbols","EMPTY","i8","i16","i32","i64","isize","u8","u16","u32","u64","usize","bool","f32","f64","v128","i8x16","u8x16","i16x8","u16x8","i32x4","u32x4","i64x2","u64x2","f32x4","f64x2","void_","number","boolean","string","native","null_","true_","false_","this_","super_","constructor","ASC_TARGET","ASC_NO_TREESHAKING","ASC_NO_ASSERT","ASC_MEMORY_BASE","ASC_OPTIMIZE_LEVEL","ASC_SHRINK_LEVEL","ASC_FEATURE_MUTABLE_GLOBAL","ASC_FEATURE_SIGN_EXTENSION","ASC_FEATURE_BULK_MEMORY","ASC_FEATURE_SIMD","ASC_FEATURE_THREADS","I8","I16","I32","I64","Isize","U8","U16","U32","U64","Usize","Bool","F32","F64","V128","String","Array","FixedArray","Set","Map","ArrayBufferView","ArrayBuffer","Math","Mathf","Int8Array","Int16Array","Int32Array","Int64Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","Uint64Array","Float32Array","Float64Array","abort","pow","mod","alloc","realloc","free","retain","release","collect","typeinfo","instanceof_","visit","allocArray","feature_1","Feature","target_1","Target","typeinfo_1","Typeinfo","TypeinfoFlags","__export","isPowerOf2","x","DiagnosticCategory","diagnosticMessages_generated_1","util_1","diagnosticMessages_generated_2","diagnosticCategoryToString","category","INFO","WARNING","ERROR","assert","diagnosticCategoryToColor","COLOR_BLUE","COLOR_YELLOW","COLOR_RED","DiagnosticCode","diagnosticCodeToString","COLOR_RESET","DiagnosticMessage","code","message","range","relatedRange","arg0","arg1","arg2","replace","createInfo","createWarning","createError","withRange","withRelatedRange","toString","source","normalizedPath","line","column","formatDiagnosticContext","useColors","text","len","length","start","end","isLineBreak","charCodeAt","sb","substring","push","join","formatDiagnosticMessage","showContext","DiagnosticEmitter","diagnostics","emitDiagnostic","info","infoRelated","warning","warningRelated","error","errorRelated","OperatorKind","common_1","diagnostics_1","types_1","ast_1","resolver_1","flow_1","QueuedImport","localFile","localIdentifier","foreignIdentifier","foreignPath","foreignPathAlt","QueuedExport","QueuedExportStar","pathLiteral","operatorKindFromDecorator","decoratorKind","arg","DecoratorKind","OPERATOR","OPERATOR_BINARY","INDEXED_GET","INDEXED_SET","UNCHECKED_INDEXED_GET","UNCHECKED_INDEXED_SET","ADD","SUB","MUL","POW","DIV","REM","BITWISE_AND","BITWISE_OR","BITWISE_XOR","EQ","NE","GT","GE","BITWISE_SHR","BITWISE_SHR_U","LT","LE","BITWISE_SHL","OPERATOR_PREFIX","PLUS","PREFIX_INC","MINUS","PREFIX_DEC","NOT","BITWISE_NOT","OPERATOR_POSTFIX","POSTFIX_INC","POSTFIX_DEC","INVALID","ElementKind","DecoratorFlags","Program","_super","_this","sources","diagnosticsOffset","filesByName","elementsByName","elementsByDeclaration","instancesByName","typeClasses","managedClasses","nextClassId","nativeDummySignature","nativeSource","Source","SourceKind","LIBRARY","nativeFile","File","set","internalName","resolver","Resolver","__extends","writeRuntimeHeader","buffer","offset","classInstance","payloadSize","writeI32","id","makeNativeVariableDeclaration","flags","NONE","Node","createVariableDeclaration","createIdentifierExpression","makeNativeTypeDeclaration","identifier","createTypeDeclaration","createOmittedType","makeNativeFunctionDeclaration","createFunctionDeclaration","createSignature","createType","createSimpleTypeName","makeNativeNamespaceDeclaration","createNamespaceDeclaration","makeNativeFunction","signature","parent","decoratorFlags","Function","FunctionPrototype","getElementByDeclaration","declaration","has","initialize","options","registerNativeType","Type","isizeType","usizeType","void","add","TypeDefinition","EXPORT","GENERIC","BUILTIN","hasFeature","registerConstantInteger","i64_new","isWasm64","WASM64","WASM32","noAssert","memoryBase","optimizeLevelHint","shrinkLevelHint","queuedImports","queuedExports","queuedExportsStar","queuedExtends","queuedImplements","k","file","statements","j","statement","kind","NodeKind","initializeExports","EXPORTDEFAULT","initializeExportDefault","IMPORT","initializeImports","VARIABLE","initializeVariables","CLASSDECLARATION","initializeClass","ENUMDECLARATION","initializeEnum","FUNCTIONDECLARATION","initializeFunction","INTERFACEDECLARATION","initializeInterface","NAMESPACEDECLARATION","initializeNamespace","TYPEDECLARATION","initializeTypeDefinition","queuedExportsStar_1","__values","queuedExportsStar_1_1","next","done","_g","__read","exportsStar","exportStar","foreignFile","lookupForeignFile","ensureExportStar","File_0_not_found","queuedImport","element","lookupForeign","Module_0_has_no_exported_member_1","localName","asImportedNamespace","queuedExports_1","queuedExports_1_1","_h","exports_1","exports_1_1","_j","exportName","queuedExport","ensureExport","lookupInSelf","globalElement","lookupGlobal","DeclaredElement","arrayBufferInstance","requireClass","stringInstance","arrayBufferViewInstance","registerNativeTypeClass","i8ArrayPrototype","CLASS_PROTOTYPE","i16ArrayPrototype","i32ArrayPrototype","i64ArrayPrototype","u8ArrayPrototype","u8ClampedArrayPrototype","u16ArrayPrototype","u32ArrayPrototype","u64ArrayPrototype","f32ArrayPrototype","f64ArrayPrototype","thisPrototype","extendsNode","baseElement","resolveTypeName","basePrototype","hasDecorator","SEALED","Class_0_is_sealed_and_cannot_be_extended","identifierNode","UNMANAGED","Unmanaged_classes_cannot_extend_managed_classes_and_vice_versa","Range","A_class_may_only_extend_another_class","globalAliases","globalAliases_1","globalAliases_1_1","_k","alias","firstChar","parseI32","Error","arrayPrototype","fixedArrayPrototype","setPrototype","mapPrototype","abortInstance","requireFunction","allocInstance","reallocInstance","freeInstance","retainInstance","releaseInstance","collectInstance","typeinfoInstance","instanceofInstance","visitInstance","allocArrayInstance","_l","values","_m","isEntry","_o","_p","markModuleExport","resolved","resolveClass","FUNCTION_PROTOTYPE","resolveFunction","MODULE_EXPORT","instanceMembers","_c","_d","member","PROPERTY_PROTOTYPE","getterPrototype","setterPrototype","PROPERTY","FUNCTION","FIELD","CLASS","members","_e","_f","type","setType","typeKind","className","classElement","is","global","Global","CONST","setConstantIntegerValue","registerConstantFloat","setConstantFloatValue","ensureGlobal","merged","tryMerge","Duplicate_identifier_0","elements","requireGlobal","foreignName","lookupExport","fileQueuedExports","checkDecorators","decorators","acceptedFlags","decorator","flag","decoratorKindToFlag","decoratorNameToKind","isLibrary","Decorator_0_is_not_valid_here","Duplicate_decorator","ClassPrototype","GLOBAL","implementsTypes","numImplementsTypes","Unmanaged_classes_cannot_implement_interfaces","Operation_not_supported","extendsType","memberDeclarations","memberDeclaration","FIELDDECLARATION","initializeField","METHODDECLARATION","isAny","GET","SET","initializeProperty","initializeMethod","INDEXSIGNATUREDECLARATION","STATIC","INTERFACE_PROTOTYPE","READONLY","INLINE","LAZY","UNSAFE","ABSTRACT","FieldPrototype","addInstance","isStatic","CONSTRUCTOR","checkOperatorOverloads","classPrototype","numArgs","arguments","firstArg","LITERAL","literalKind","LiteralKind","STRING","overloads","overloadPrototypes","Duplicate_function_implementation","operatorKind","String_literal_expected","Expected_0_arguments_but_got_1","ensureProperty","parentMembers","PropertyPrototype","Duplicate_property_0","isGetter","Enum","initializeEnumValue","EnumValue","initializeExport","internalPath","queued","endsWith","path","exportedName","Export_declaration_conflicts_with_exported_declaration_of_0","declarations","initializeImport","namespaceName","validDecorators","AMBIENT","EXTERNAL","INSTANCE","InterfacePrototype","original","Namespace","copyMembers","DECLARE","Element","program","shadowType","FILE","current","unset","originalDeclaration","actual","isBound","TypedElement","apply","RESOLVED","startFunction","Signature","isImport","lookup","includes","exports_2","exports_2_1","_b","memberName","TYPEDEFINITION","mangleInternalName","typeParameters","NAMESPACE","ENUM","ConstantValueKind","VariableLikeElement","constantValueKind","initializer","constantIntegerValue","INLINED","constantFloatValue","ENUMVALUE","isImmutable","Parameter","Local","index","LOCAL","instances","boundPrototypes","body","arrowKind","toBound","bound","getResolvedInstance","instanceKey","setResolvedInstance","instance","nameInclTypeParameters","contextualTypeArguments","localsByName","localsByIndex","additionalLocals","debugLocations","ref","functionTableIndex","trampoline","nextInlineId","nextAnonymousId","nextAutoreleaseId","tempI32s","tempI64s","tempF32s","tempF64s","tempV128s","nextBreakId","breakStack","breakLabel","asFunction","localIndex","local","thisType","parameterTypes","parameterType","parameterName","getParameterName","flow","Flow","registerConcreteElement","addLocal","locals","finalize","sourceMap","debugLocation","setDebugLocation","debugInfoRef","debugInfoIndex","FunctionTarget","__s","FUNCTION_TARGET","toSignatureString","FIELD_PROTOTYPE","parameterIndex","Field","memoryOffset","firstDeclaration","Property","getterInstance","setterInstance","AcyclicState","_isInterface","constructorPrototype","extends","basePtototype","Class","typeArguments","base","INTERFACE","currentMemoryOffset","constructorInstance","_id","_acyclic","rttiFlags","asClass","inheritedTypeArguments","inheritedTypeArguments_1","inheritedTypeArguments_1_1","baseName","baseType","typeParameterNodes","numTypeArguments","isBuiltinArray","lengthField","lookupOverload","isAssignableTo","target","unchecked","uncheckedOverload","overload","offsetof","fieldName","field","writeField","baseOffset","writeI8","writeI16","writeF32","writeF64","getTypeArgumentsTo","extendedPrototype","getArrayValueType","abvInstance","acyclic","hasCycle","cyclesTo","other","except","classReference","Interface","older","newer","Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local","src","dest","srcMembers","destMembers","srcMembers_1","srcMembers_1_1","isInstance","asGlobal","NativeType","ExpressionId","_BinaryenTypeNone","_BinaryenTypeInt32","_BinaryenTypeInt64","_BinaryenTypeFloat32","_BinaryenTypeFloat64","_BinaryenTypeVec128","_BinaryenTypeUnreachable","_BinaryenTypeAuto","FeatureFlags","_BinaryenFeatureAtomics","_BinaryenFeatureMutableGlobals","_BinaryenFeatureNontrappingFPToInt","_BinaryenFeatureSIMD128","_BinaryenFeatureBulkMemory","_BinaryenFeatureSignExt","_BinaryenFeatureExceptionHandling","_BinaryenInvalidId","_BinaryenBlockId","_BinaryenIfId","_BinaryenLoopId","_BinaryenBreakId","_BinaryenSwitchId","_BinaryenCallId","_BinaryenCallIndirectId","_BinaryenLocalGetId","_BinaryenLocalSetId","_BinaryenGlobalGetId","_BinaryenGlobalSetId","_BinaryenLoadId","_BinaryenStoreId","_BinaryenConstId","_BinaryenUnaryId","_BinaryenBinaryId","_BinaryenSelectId","_BinaryenDropId","_BinaryenReturnId","_BinaryenHostId","_BinaryenNopId","_BinaryenUnreachableId","_BinaryenAtomicCmpxchgId","_BinaryenAtomicRMWId","_BinaryenAtomicWaitId","_BinaryenAtomicNotifyId","_BinaryenSIMDExtractId","_BinaryenSIMDReplaceId","_BinaryenSIMDShuffleId","_BinaryenSIMDBitselectId","_BinaryenSIMDShiftId","_BinaryenMemoryInitId","_BinaryenDataDropId","_BinaryenMemoryCopyId","_BinaryenMemoryFillId","UnaryOp","_BinaryenClzInt32","_BinaryenCtzInt32","_BinaryenPopcntInt32","_BinaryenNegFloat32","_BinaryenAbsFloat32","_BinaryenCeilFloat32","_BinaryenFloorFloat32","_BinaryenTruncFloat32","_BinaryenNearestFloat32","_BinaryenSqrtFloat32","_BinaryenEqZInt32","_BinaryenClzInt64","_BinaryenCtzInt64","_BinaryenPopcntInt64","_BinaryenNegFloat64","_BinaryenAbsFloat64","_BinaryenCeilFloat64","_BinaryenFloorFloat64","_BinaryenTruncFloat64","_BinaryenNearestFloat64","_BinaryenSqrtFloat64","_BinaryenEqZInt64","_BinaryenExtendSInt32","_BinaryenExtendUInt32","_BinaryenWrapInt64","_BinaryenTruncSFloat32ToInt32","_BinaryenTruncSFloat32ToInt64","_BinaryenTruncUFloat32ToInt32","_BinaryenTruncUFloat32ToInt64","_BinaryenTruncSFloat64ToInt32","_BinaryenTruncSFloat64ToInt64","_BinaryenTruncUFloat64ToInt32","_BinaryenTruncUFloat64ToInt64","_BinaryenReinterpretFloat32","_BinaryenReinterpretFloat64","_BinaryenConvertSInt32ToFloat32","_BinaryenConvertSInt32ToFloat64","_BinaryenConvertUInt32ToFloat32","_BinaryenConvertUInt32ToFloat64","_BinaryenConvertSInt64ToFloat32","_BinaryenConvertSInt64ToFloat64","_BinaryenConvertUInt64ToFloat32","_BinaryenConvertUInt64ToFloat64","_BinaryenPromoteFloat32","_BinaryenDemoteFloat64","_BinaryenReinterpretInt32","_BinaryenReinterpretInt64","_BinaryenExtendS8Int32","_BinaryenExtendS16Int32","_BinaryenExtendS8Int64","_BinaryenExtendS16Int64","_BinaryenExtendS32Int64","_BinaryenSplatVecI8x16","_BinaryenSplatVecI16x8","_BinaryenSplatVecI32x4","_BinaryenSplatVecI64x2","_BinaryenSplatVecF32x4","_BinaryenSplatVecF64x2","_BinaryenNotVec128","_BinaryenNegVecI8x16","_BinaryenAnyTrueVecI8x16","_BinaryenAllTrueVecI8x16","_BinaryenNegVecI16x8","_BinaryenAnyTrueVecI16x8","_BinaryenAllTrueVecI16x8","_BinaryenNegVecI32x4","_BinaryenAnyTrueVecI32x4","_BinaryenAllTrueVecI32x4","_BinaryenNegVecI64x2","_BinaryenAnyTrueVecI64x2","_BinaryenAllTrueVecI64x2","_BinaryenAbsVecF32x4","_BinaryenNegVecF32x4","_BinaryenSqrtVecF32x4","_BinaryenAbsVecF64x2","_BinaryenNegVecF64x2","_BinaryenSqrtVecF64x2","_BinaryenTruncSatSVecF32x4ToVecI32x4","_BinaryenTruncSatUVecF32x4ToVecI32x4","_BinaryenTruncSatSVecF64x2ToVecI64x2","_BinaryenTruncSatUVecF64x2ToVecI64x2","_BinaryenConvertSVecI32x4ToVecF32x4","_BinaryenConvertUVecI32x4ToVecF32x4","_BinaryenConvertSVecI64x2ToVecF64x2","_BinaryenConvertUVecI64x2ToVecF64x2","BinaryOp","_BinaryenAddInt32","_BinaryenSubInt32","_BinaryenMulInt32","_BinaryenDivSInt32","_BinaryenDivUInt32","_BinaryenRemSInt32","_BinaryenRemUInt32","_BinaryenAndInt32","_BinaryenOrInt32","_BinaryenXorInt32","_BinaryenShlInt32","_BinaryenShrUInt32","_BinaryenShrSInt32","_BinaryenRotLInt32","_BinaryenRotRInt32","_BinaryenEqInt32","_BinaryenNeInt32","_BinaryenLtSInt32","_BinaryenLtUInt32","_BinaryenLeSInt32","_BinaryenLeUInt32","_BinaryenGtSInt32","_BinaryenGtUInt32","_BinaryenGeSInt32","_BinaryenGeUInt32","_BinaryenAddInt64","_BinaryenSubInt64","_BinaryenMulInt64","_BinaryenDivSInt64","_BinaryenDivUInt64","_BinaryenRemSInt64","_BinaryenRemUInt64","_BinaryenAndInt64","_BinaryenOrInt64","_BinaryenXorInt64","_BinaryenShlInt64","_BinaryenShrUInt64","_BinaryenShrSInt64","_BinaryenRotLInt64","_BinaryenRotRInt64","_BinaryenEqInt64","_BinaryenNeInt64","_BinaryenLtSInt64","_BinaryenLtUInt64","_BinaryenLeSInt64","_BinaryenLeUInt64","_BinaryenGtSInt64","_BinaryenGtUInt64","_BinaryenGeSInt64","_BinaryenGeUInt64","_BinaryenAddFloat32","_BinaryenSubFloat32","_BinaryenMulFloat32","_BinaryenDivFloat32","_BinaryenCopySignFloat32","_BinaryenMinFloat32","_BinaryenMaxFloat32","_BinaryenEqFloat32","_BinaryenNeFloat32","_BinaryenLtFloat32","_BinaryenLeFloat32","_BinaryenGtFloat32","_BinaryenGeFloat32","_BinaryenAddFloat64","_BinaryenSubFloat64","_BinaryenMulFloat64","_BinaryenDivFloat64","_BinaryenCopySignFloat64","_BinaryenMinFloat64","_BinaryenMaxFloat64","_BinaryenEqFloat64","_BinaryenNeFloat64","_BinaryenLtFloat64","_BinaryenLeFloat64","_BinaryenGtFloat64","_BinaryenGeFloat64","_BinaryenEqVecI8x16","_BinaryenNeVecI8x16","_BinaryenLtSVecI8x16","_BinaryenLtUVecI8x16","_BinaryenLeSVecI8x16","_BinaryenLeUVecI8x16","_BinaryenGtSVecI8x16","_BinaryenGtUVecI8x16","_BinaryenGeSVecI8x16","_BinaryenGeUVecI8x16","_BinaryenEqVecI16x8","_BinaryenNeVecI16x8","_BinaryenLtSVecI16x8","_BinaryenLtUVecI16x8","_BinaryenLeSVecI16x8","_BinaryenLeUVecI16x8","_BinaryenGtSVecI16x8","_BinaryenGtUVecI16x8","_BinaryenGeSVecI16x8","_BinaryenGeUVecI16x8","_BinaryenEqVecI32x4","_BinaryenNeVecI32x4","_BinaryenLtSVecI32x4","_BinaryenLtUVecI32x4","_BinaryenLeSVecI32x4","_BinaryenLeUVecI32x4","_BinaryenGtSVecI32x4","_BinaryenGtUVecI32x4","_BinaryenGeSVecI32x4","_BinaryenGeUVecI32x4","_BinaryenEqVecF32x4","_BinaryenNeVecF32x4","_BinaryenLtVecF32x4","_BinaryenLeVecF32x4","_BinaryenGtVecF32x4","_BinaryenGeVecF32x4","_BinaryenEqVecF64x2","_BinaryenNeVecF64x2","_BinaryenLtVecF64x2","_BinaryenLeVecF64x2","_BinaryenGtVecF64x2","_BinaryenGeVecF64x2","_BinaryenAndVec128","_BinaryenOrVec128","_BinaryenXorVec128","_BinaryenAddVecI8x16","_BinaryenAddSatSVecI8x16","_BinaryenAddSatUVecI8x16","_BinaryenSubVecI8x16","_BinaryenSubSatSVecI8x16","_BinaryenSubSatUVecI8x16","_BinaryenMulVecI8x16","_BinaryenAddVecI16x8","_BinaryenAddSatSVecI16x8","_BinaryenAddSatUVecI16x8","_BinaryenSubVecI16x8","_BinaryenSubSatSVecI16x8","_BinaryenSubSatUVecI16x8","_BinaryenMulVecI16x8","_BinaryenAddVecI32x4","_BinaryenSubVecI32x4","_BinaryenMulVecI32x4","_BinaryenAddVecI64x2","_BinaryenSubVecI64x2","_BinaryenAddVecF32x4","_BinaryenSubVecF32x4","_BinaryenMulVecF32x4","_BinaryenDivVecF32x4","_BinaryenMinVecF32x4","_BinaryenMaxVecF32x4","_BinaryenAddVecF64x2","_BinaryenSubVecF64x2","_BinaryenMulVecF64x2","_BinaryenDivVecF64x2","_BinaryenMinVecF64x2","_BinaryenMaxVecF64x2","HostOp","_BinaryenMemorySize","_BinaryenMemoryGrow","AtomicRMWOp","_BinaryenAtomicRMWAdd","_BinaryenAtomicRMWSub","_BinaryenAtomicRMWAnd","_BinaryenAtomicRMWOr","_BinaryenAtomicRMWXor","_BinaryenAtomicRMWXchg","SIMDExtractOp","_BinaryenExtractLaneSVecI8x16","_BinaryenExtractLaneUVecI8x16","_BinaryenExtractLaneSVecI16x8","_BinaryenExtractLaneUVecI16x8","_BinaryenExtractLaneVecI32x4","_BinaryenExtractLaneVecI64x2","_BinaryenExtractLaneVecF32x4","_BinaryenExtractLaneVecF64x2","SIMDReplaceOp","_BinaryenReplaceLaneVecI8x16","_BinaryenReplaceLaneVecI16x8","_BinaryenReplaceLaneVecI32x4","_BinaryenReplaceLaneVecI64x2","_BinaryenReplaceLaneVecF32x4","_BinaryenReplaceLaneVecF64x2","SIMDShiftOp","_BinaryenShlVecI8x16","_BinaryenShrSVecI8x16","_BinaryenShrUVecI8x16","_BinaryenShlVecI16x8","_BinaryenShrSVecI16x8","_BinaryenShrUVecI16x8","_BinaryenShlVecI32x4","_BinaryenShrSVecI32x4","_BinaryenShrUVecI32x4","_BinaryenShlVecI64x2","_BinaryenShrSVecI64x2","_BinaryenShrUVecI64x2","MemorySegment","segment","Module","hasTemporaryFunction","cachedPrecomputeNames","cachedStrings","_BinaryenModuleCreate","lit","memory","allocate","_BinaryenSizeofLiteral","createFrom","cArr","allocU8Array","_BinaryenModuleRead","changetype","addFunctionType","result","paramTypes","cStr","allocStringCached","allocI32Array","_BinaryenAddFunctionType","getFunctionTypeBySignature","_BinaryenGetFunctionTypeBySignature","removeFunctionType","_BinaryenRemoveFunctionType","out","_BinaryenLiteralInt32","_BinaryenConst","valueLow","valueHigh","_BinaryenLiteralInt64","_BinaryenLiteralFloat32","_BinaryenLiteralFloat64","bytes","store","_BinaryenLiteralVec128","unary","op","expr","_BinaryenUnary","binary","left","right","_BinaryenBinary","host","operands","allocPtrArray","_BinaryenHost","local_get","_BinaryenLocalGet","local_tee","_BinaryenLocalTee","global_get","_BinaryenGlobalGet","load","signed","ptr","align","_BinaryenLoad","None","_BinaryenStore","atomic_load","_BinaryenAtomicLoad","atomic_store","_BinaryenAtomicStore","atomic_rmw","_BinaryenAtomicRMW","atomic_cmpxchg","expected","replacement","_BinaryenAtomicCmpxchg","atomic_wait","timeout","expectedType","_BinaryenAtomicWait","atomic_notify","notifyCount","_BinaryenAtomicNotify","local_set","_BinaryenLocalSet","global_set","_BinaryenGlobalSet","block","label","children","_BinaryenBlock","br","condition","_BinaryenBreak","drop","expression","_BinaryenDrop","loop","_BinaryenLoop","if","ifTrue","ifFalse","_BinaryenIf","nop","_BinaryenNop","return","_BinaryenReturn","select","_BinaryenSelect","switch","names","defaultName","numNames","strs","_BinaryenSwitch","returnType","_BinaryenCall","call_indirect","typeName","_BinaryenCallIndirect","unreachable","_BinaryenUnreachable","memory_copy","size","_BinaryenMemoryCopy","memory_fill","_BinaryenMemoryFill","simd_extract","vec","idx","_BinaryenSIMDExtract","simd_replace","_BinaryenSIMDReplace","simd_shuffle","vec1","vec2","mask","_BinaryenSIMDShuffle","simd_bitselect","cond","_BinaryenSIMDBitselect","simd_shift","shift","_BinaryenSIMDShift","addGlobal","mutable","_BinaryenAddGlobal","removeGlobal","_BinaryenRemoveGlobal","addFunction","varTypes","_BinaryenAddFunction","removeFunction","_BinaryenRemoveFunction","addTemporaryFunction","tempName","typeRef","removeTemporaryFunction","addFunctionExport","externalName","cStr1","cStr2","_BinaryenAddFunctionExport","addTableExport","_BinaryenAddTableExport","addMemoryExport","_BinaryenAddMemoryExport","addGlobalExport","_BinaryenAddGlobalExport","removeExport","_BinaryenRemoveExport","addFunctionImport","externalModuleName","externalBaseName","functionType","cStr3","_BinaryenAddFunctionImport","addTableImport","_BinaryenAddTableImport","addMemoryImport","shared","_BinaryenAddMemoryImport","addGlobalImport","globalType","_BinaryenAddGlobalImport","setMemory","initial","maximum","segments","segs","psvs","offs","sizs","i64_low","i64_high","cArr1","cArr2","cArr3","cArr4","_BinaryenSetMemory","setFunctionTable","funcs","_BinaryenSetFunctionTable","setStart","func","_BinaryenSetStart","getOptimizeLevel","_BinaryenGetOptimizeLevel","setOptimizeLevel","level","_BinaryenSetOptimizeLevel","getShrinkLevel","_BinaryenGetShrinkLevel","setShrinkLevel","_BinaryenSetShrinkLevel","setDebugInfo","on","_BinaryenSetDebugInfo","getFeatures","_BinaryenModuleGetFeatures","setFeatures","featureFlags","_BinaryenModuleSetFeatures","optimize","_BinaryenFunctionOptimize","_BinaryenModuleOptimize","runPasses","passes","allocString","_BinaryenFunctionRunPasses","_BinaryenModuleRunPasses","precomputeExpression","previousOptimizeLevel","previousShrinkLevel","previousDebugInfo","_BinaryenGetDebugInfo","_BinaryenExpressionGetType","_BinaryenFunctionGetBody","validate","_BinaryenModuleValidate","interpret","_BinaryenModuleInterpret","toBinary","sourceMapUrl","binaryPtr","sourceMapPtr","_BinaryenModuleAllocateAndWrite","readInt","binaryBytes","ret","BinaryModule","output","readBuffer","readString","toText","toAsmjs","str","dispose","_BinaryenModuleDispose","createRelooper","Relooper","cloneExpression","noSideEffects","maxDepth","MAX_VALUE","nested1","nested2","_BinaryenExpressionGetId","Const","_BinaryenConstGetValueI32","_BinaryenConstGetValueI64Low","_BinaryenConstGetValueI64High","_BinaryenConstGetValueF32","_BinaryenConstGetValueF64","LocalGet","_BinaryenLocalGetGetIndex","GlobalGet","globalName","_BinaryenGlobalGetGetName","Load","_BinaryenLoadGetPtr","_BinaryenLoadIsAtomic","_BinaryenLoadGetBytes","_BinaryenLoadGetOffset","_BinaryenLoadIsSigned","_BinaryenLoadGetAlign","Unary","_BinaryenUnaryGetValue","_BinaryenUnaryGetOp","Binary","_BinaryenBinaryGetLeft","_BinaryenBinaryGetRight","_BinaryenBinaryGetOp","addDebugInfoFile","_BinaryenModuleAddDebugInfoFileName","getDebugInfoFile","_BinaryenModuleGetDebugInfoFileName","fileIndex","lineNumber","columnNumber","_BinaryenFunctionSetDebugLocation","UNLIMITED_MEMORY","getExpressionId","getExpressionType","getConstValueI32","getConstValueI64Low","getConstValueI64High","getConstValueF32","getConstValueF64","getLocalGetIndex","getLocalSetIndex","_BinaryenLocalSetGetIndex","getLocalSetValue","_BinaryenLocalSetGetValue","isLocalTee","_BinaryenLocalSetIsTee","getGlobalGetName","getBinaryOp","getBinaryLeft","getBinaryRight","getUnaryOp","getUnaryValue","getLoadBytes","getLoadOffset","getLoadPtr","isLoadSigned","getStoreBytes","_BinaryenStoreGetBytes","getStoreOffset","_BinaryenStoreGetOffset","getStorePtr","_BinaryenStoreGetPtr","getStoreValue","_BinaryenStoreGetValue","getBlockName","_BinaryenBlockGetName","getBlockChildCount","_BinaryenBlockGetNumChildren","getBlockChild","_BinaryenBlockGetChild","getIfCondition","_BinaryenIfGetCondition","getIfTrue","_BinaryenIfGetIfTrue","getIfFalse","_BinaryenIfGetIfFalse","getLoopName","_BinaryenLoopGetName","getLoopBody","_BinaryenLoopGetBody","getBreakName","_BinaryenBreakGetName","getBreakCondition","_BinaryenBreakGetCondition","getSelectThen","_BinaryenSelectGetIfTrue","getSelectElse","_BinaryenSelectGetIfFalse","getSelectCondition","_BinaryenSelectGetCondition","getDropValue","_BinaryenDropGetValue","getReturnValue","_BinaryenReturnGetValue","getCallTarget","_BinaryenCallGetTarget","getCallOperandCount","_BinaryenCallGetNumOperands","getCallOperand","_BinaryenCallGetOperand","getHostOp","_BinaryenHostGetOp","getHostOperandCount","_BinaryenHostGetNumOperands","getHostOperand","_BinaryenHostGetOperand","getHostName","_BinaryenHostGetNameOperand","getFunctionBody","getFunctionName","_BinaryenFunctionGetName","getFunctionParamCount","_BinaryenFunctionGetNumParams","getFunctionParamType","_BinaryenFunctionGetParam","getFunctionResultType","_BinaryenFunctionGetResult","relooper","_RelooperCreate","addBlock","_RelooperAddBlock","addBranch","from","to","_RelooperAddBranch","addBlockWithSwitch","_RelooperAddBlockWithSwitch","addBranchForSwitch","indexes","_RelooperAddBranchForSwitch","renderAndDispose","entry","labelHelper","_RelooperRenderAndDispose","u8s","numValues","i32s","val","ptrs","u","stringLengthUTF8","cp","u1","u2","u3","u4","arr","fromCodePoints","needsExplicitUnreachable","Unreachable","Return","Break","Block","numChildren","traverse","data","If","Loop","Switch","_BinaryenSwitchGetCondition","Call","CallIndirect","_BinaryenCallIndirectGetNumOperands","_BinaryenCallIndirectGetOperand","LocalSet","GlobalSet","_BinaryenGlobalSetGetValue","Store","AtomicRMW","_BinaryenAtomicRMWGetPtr","_BinaryenAtomicRMWGetValue","AtomicCmpxchg","_BinaryenAtomicCmpxchgGetPtr","_BinaryenAtomicCmpxchgGetExpected","_BinaryenAtomicCmpxchgGetReplacement","AtomicWait","_BinaryenAtomicWaitGetPtr","_BinaryenAtomicWaitGetExpected","_BinaryenAtomicWaitGetTimeout","AtomicNotify","_BinaryenAtomicNotifyGetPtr","SIMDExtract","_BinaryenSIMDExtractGetVec","SIMDReplace","_BinaryenSIMDReplaceGetVec","_BinaryenSIMDReplaceGetValue","SIMDShuffle","_BinaryenSIMDShuffleGetLeft","_BinaryenSIMDShuffleGetRight","SIMDBitselect","_BinaryenSIMDBitselectGetLeft","_BinaryenSIMDBitselectGetRight","_BinaryenSIMDBitselectGetCond","SIMDShift","_BinaryenSIMDShiftGetVec","_BinaryenSIMDShiftGetShift","MemoryInit","_BinaryenMemoryInitGetDest","_BinaryenMemoryInitGetOffset","_BinaryenMemoryInitGetSize","DataDrop","MemoryCopy","_BinaryenMemoryCopyGetDest","_BinaryenMemoryCopyGetSource","_BinaryenMemoryCopyGetSize","MemoryFill","_BinaryenMemoryFillGetDest","_BinaryenMemoryFillGetValue","_BinaryenMemoryFillGetSize","Select","Drop","Host","Nop","tokenizer_1","Token","nodeIsConstantValue","NULL","TRUE","FALSE","nodeIsCallable","IDENTIFIER","ASSERTION","CALL","ELEMENTACCESS","PARENTHESIZED","PROPERTYACCESS","SUPER","nodeIsGenericCallable","createTypeName","TypeName","isNullable","TypeNode","createTypeParameter","defaultType","elem","TypeParameterNode","createParameter","ParameterNode","parameterKind","parameters","explicitThisType","sig","SignatureNode","createDecorator","args","stmt","DecoratorNode","createComment","node","CommentNode","commentKind","isQuoted","IdentifierExpression","symbol","createEmptyIdentifierExpression","createArrayLiteralExpression","ArrayLiteralExpression","elementExpressions","createAssertionExpression","assertionKind","toType","AssertionExpression","createBinaryExpression","operator","BinaryExpression","createCallExpression","typeArgs","CallExpression","createClassExpression","ClassExpression","createCommaExpression","expressions","CommaExpression","createConstructorExpression","ConstructorExpression","createElementAccessExpression","ElementAccessExpression","elementExpression","createFalseExpression","FalseExpression","createFloatLiteralExpression","FloatLiteralExpression","createFunctionExpression","FunctionExpression","createInstanceOfExpression","isType","InstanceOfExpression","createIntegerLiteralExpression","IntegerLiteralExpression","createNewExpression","NewExpression","createNullExpression","NullExpression","createObjectLiteralExpression","ObjectLiteralExpression","createParenthesizedExpression","ParenthesizedExpression","createPropertyAccessExpression","PropertyAccessExpression","createRegexpLiteralExpression","pattern","RegexpLiteralExpression","patternFlags","createTernaryExpression","ifThen","ifElse","TernaryExpression","createStringLiteralExpression","StringLiteralExpression","createSuperExpression","SuperExpression","createThisExpression","ThisExpression","createTrueExpression","TrueExpression","createUnaryPostfixExpression","operand","UnaryPostfixExpression","createUnaryPrefixExpression","UnaryPrefixExpression","createBlockStatement","BlockStatement","createBreakStatement","BreakStatement","createClassDeclaration","ClassDeclaration","createContinueStatement","ContinueStatement","createDoStatement","DoStatement","createEmptyStatement","EmptyStatement","createEnumDeclaration","EnumDeclaration","createEnumValueDeclaration","EnumValueDeclaration","createExportStatement","isDeclare","ExportStatement","normalizePath","startsWith","resolvePath","mangleInternalPath","createExportDefaultStatement","ExportDefaultStatement","createExportImportStatement","ExportImportStatement","createExportMember","ExportMember","createExpressionStatement","ExpressionStatement","createIfStatement","IfStatement","createImportStatement","decls","ImportStatement","createImportStatementWithWildcard","createImportDeclaration","ImportDeclaration","createInterfaceDeclaration","InterfaceDeclaration","createFieldDeclaration","FieldDeclaration","createForStatement","incrementor","ForStatement","FunctionDeclaration","createIndexSignatureDeclaration","keyType","valueType","IndexSignatureDeclaration","createMethodDeclaration","MethodDeclaration","NamespaceDeclaration","createReturnStatement","ReturnStatement","createSwitchStatement","cases","SwitchStatement","createSwitchCase","SwitchCase","createThrowStatement","ThrowStatement","createTryStatement","catchVariable","catchStatements","finallyStatements","TryStatement","TypeDeclaration","createVariableStatement","VariableStatement","VariableDeclaration","createVoidStatement","VoidStatement","createWhileStatement","WhileStatement","CommonTypeNode","TYPENAME","TYPE","TYPEPARAMETER","ParameterKind","PARAMETER","implicitFieldDeclaration","SIGNATURE","nameStr","propStr","CUSTOM","DECORATOR","CommentKind","COMMENT","Expression","LiteralExpression","ARRAY","AssertionKind","BINARY","numArguments","COMMA","FLOAT","INSTANCEOF","INTEGER","NEW","OBJECT","REGEXP","TERNARY","THIS","UnaryExpression","UNARYPOSTFIX","UNARYPREFIX","Statement","SOURCE","tokenizer","exportPaths","sourceKind","pos","lastIndexOf","simplePath","ENTRY","DeclarationStatement","VariableLikeDeclarationStatement","BLOCK","BREAK","CONTINUE","DO","ENUMVALUEDECLARATION","EXPORTIMPORT","EXPORTMEMBER","EXPRESSION","FOR","ArrowKind","clone","IF","IMPORTDECLARATION","RETURN","SWITCHCASE","SWITCH","THROW","TRY","VARIABLEDECLARATION","VOID","WHILE","findDecorator","isTypeOmitted","program_1","module_1","TypeKind","TypeFlags","v128_zero","cachedNullableType","byteSize","ceil","signatureReference","nonNullableType","isize64","isize32","usize64","usize32","clz","computeSmallIntegerShift","targetType","computeSmallIntegerMask","classType","asNullable","signednessIsRelevant","currentClass","targetClass","currentFunction","targetFunction","isStrictlyAssignableTo","commonDenominator","signednessIsImportant","toNativeType","toNativeZero","toNativeOne","toNativeNegOne","typesToNativeTypes","types","numTypes","typesToString","cachedFunctionTarget","parameterNames","requiredParameters","hasRest","asFunctionTarget","getDefaultParameterName","thisThisType","targetThisType","thisParameterTypes","targetParameterTypes","numParameters","thisParameterType","targetParameterType","thisReturnType","targetReturnType","makeSignatureString","optionalStart","restIndex","cachedDefaultParameterNames","IdentifierHandling","tokenFromKeyword","AS","ASYNC","AWAIT","CASE","CATCH","DEBUGGER","DEFAULT","DELETE","ELSE","EXTENDS","FINALLY","FROM","IMPLEMENTS","IN","IS","KEYOF","LET","MODULE","OF","PACKAGE","PRIVATE","PROTECTED","PUBLIC","TYPEOF","VAR","WITH","YIELD","tokenIsAlsoIdentifier","token","operatorTokenToString","DOT_DOT_DOT","LESSTHAN","GREATERTHAN","LESSTHAN_EQUALS","GREATERTHAN_EQUALS","EQUALS_EQUALS","EXCLAMATION_EQUALS","EQUALS_EQUALS_EQUALS","EXCLAMATION_EQUALS_EQUALS","ASTERISK_ASTERISK","ASTERISK","SLASH","PERCENT","PLUS_PLUS","MINUS_MINUS","LESSTHAN_LESSTHAN","GREATERTHAN_GREATERTHAN","GREATERTHAN_GREATERTHAN_GREATERTHAN","AMPERSAND","BAR","CARET","EXCLAMATION","TILDE","AMPERSAND_AMPERSAND","BAR_BAR","EQUALS","PLUS_EQUALS","MINUS_EQUALS","ASTERISK_EQUALS","ASTERISK_ASTERISK_EQUALS","SLASH_EQUALS","PERCENT_EQUALS","LESSTHAN_LESSTHAN_EQUALS","GREATERTHAN_GREATERTHAN_EQUALS","GREATERTHAN_GREATERTHAN_GREATERTHAN_EQUALS","AMPERSAND_EQUALS","BAR_EQUALS","CARET_EQUALS","a","b","Tokenizer","tokenPos","nextToken","nextTokenPos","nextTokenOnNewLine","onComment","identifierHandling","unsafeNext","maxTokenLength","STRINGLITERAL","chr","OPENPAREN","CLOSEPAREN","isDecimalDigit","FLOATLITERAL","DOT","commentStartPos","LINE","TRIPLE","closed","_0_expected","testInteger","INTEGERLITERAL","COLON","SEMICOLON","EQUALS_GREATERTHAN","QUESTION","OPENBRACKET","CLOSEBRACKET","OPENBRACE","CLOSEBRACE","AT","isIdentifierStart","isKeywordCharacter","posBefore","isIdentifierPart","keywordToken","ALWAYS","PREFER","isWhiteSpace","Invalid_character","ENDOFFILE","peek","checkOnNewLine","maxCompoundLength","tokenBefore","tokenPosBefore","skipIdentifier","skip","mark","state","reusableState","State","discard","reset","readIdentifier","quote","Unterminated_string_literal","readEscapeSequence","Unexpected_end_of_text","readExtendedUnicodeEscape","readUnicodeEscape","fromCharCode","readRegexpPattern","escaped","Unterminated_regular_expression_literal","readRegexpFlags","Invalid_regular_expression_flags","readInteger","readHexInteger","readBinaryInteger","readOctalInteger","isOctalDigit","Octal_literals_are_not_allowed_in_strict_mode","readDecimalInteger","i64_4","sepEnd","i64_add","i64_shl","Numeric_separators_are_not_allowed_here","Multiple_consecutive_numeric_separators_are_not_permitted","Hexadecimal_digit_expected","i64_10","i64_mul","Digit_expected","i64_3","Octal_digit_expected","i64_1","Binary_digit_expected","readFloat","readDecimalFloat","parseFloat","readHexFloat","remain","value32","invalid","An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive","Unterminated_Unicode_escape_sequence","finish","g","e","window","ReportMode","builtins_1","currentThisExpression","currentElementExpression","resolveType","context","reportMode","REPORT","parameterNodes","parameterNode","REST","parameterTypeNode","Type_expected","returnTypeNode","typeNode","typeArgumentNodes","possiblyPlaceholder","Type_0_is_not_generic","Basic_type_0_cannot_be_nullable","resolveClassInclTypeArguments","makeMap","type_1","Expected_0_type_arguments_but_got_1","typeArgument","resolveTypeArguments","Cannot_find_name_0","prev","Property_0_does_not_exist_on_type_1","alternativeReportNode","minParameterCount","maxParameterCount","argumentCount","resolveIdentifier","ensureResolvedLazyGlobal","resolvePropertyAccessExpression","propertyAccess","contextualType","targetExpression","resolveExpression","propertyName","indexedGet","Index_signature_is_missing_in_type_0","arrayType","resolvedType","resolveElementAccessExpression","elementAccess","determineIntegerLiteralType","intValue","i64_is_i8","i64_is_u8","i64_is_i16","i64_is_u16","i64_is_i32","i64_is_u32","i64_is_bool","resolveAssertionExpression","resolveUnaryPrefixExpression","resolveUnaryPostfixExpression","resolveBinaryExpression","resolveThisExpression","resolveSuperExpression","actualFunction","resolveLiteralExpression","resolveCallExpression","NONNULL","i64_sub","i64_zero","thisLocal","lookupLocal","_this_cannot_be_referenced_in_current_location","superLocal","_super_can_only_be_referenced_in_a_derived_class","literalType","BuiltinSymbols","resolveFunctionInclTypeArguments","Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures","actualParent","resolvedInstance","classTypeArguments","classTypeParameters","numClassTypeArguments","classTypeParameterName","numFunctionTypeArguments","signatureNode","signatureParameters","numSignatureParameters","parameterDeclaration","reportNode","resolvedTypeArguments","numTypeParameters","baseClass","nameInclTypeParamters","baseMembers","baseMembers_1","baseMembers_1_1","baseMemberName","baseMember","instanceMemberPrototypes","fieldTypeNode","fieldType","baseField","atEnd","fieldInstance","boundPrototype","propertyInstance","ctorPrototype","ctorInstance","overloadPrototype","operatorInstance","LocalFlags","FlowFlags","ANY_CATEGORICAL","ANY_CONDITIONAL","FieldFlags","scopedLocals","fieldFlags","parentFunction","continueLabel","localFlags","inlineFunction","inlineReturnLabel","createInline","fork","branch","slice","getTempLocal","temps","k_1","unsetLocalFlag","pop","getAutoreleaseLocal","SCOPED","setLocalFlag","RETAINED","freeTempLocal","getAndFreeTempLocal","getScopedLocal","addScopedLocal","scopedLocal","addScopedAlias","existingLocal","scopedAlias","freeScopedLocals","scope","isLocalFlag","defaultIfInlined","isAnyLocalFlag","pushBreakLabel","stack","popBreakLabel","inherit","inheritConditional","CONDITIONALLY_RETAINED","READFROM","CONDITIONALLY_READFROM","WRITTENTO","CONDITIONALLY_WRITTENTO","inheritMutual","leftLocalFlags","numLeftLocalFlags","rightLocalFlags","numRightLocalFlags","combinedFlags","max","isNonnull","inheritNonnullIfTrue","EqzI32","EqzI64","inheritNonnullIfFalse","EqI32","EqI64","NeI32","NeI64","canOverflow","WRAPPED","canConversionOverflow","global_1","EqF32","EqF64","NeF32","NeF64","LtI32","LtU32","LtI64","LtU64","LtF32","LtF64","LeI32","LeU32","LeI64","LeU64","LeF32","LeF64","GtI32","GtU32","GtI64","GtU64","GtF32","GtF64","GeI32","GeU32","GeI64","GeU64","GeF32","GeF64","MulI32","AndI32","ShlI32","ShrI32","ShrU32","DivU32","RemI32","RemU32","ClzI32","CtzI32","PopcntI32","MIN_VALUE","fromType","last","instanceName","levels","findUsedLocalsVisit","used","findUsedLocals","Options","importMemory","sharedMemory","importTable","explicitStart","features","feature","ContextualFlags","RuntimeFeatures","mangleImportName_moduleName","mangleImportName_elementName","Compiler","currentInlineFunctions","currentEnum","currentType","memorySegments","stringSegments","functionTable","argcVar","argcSet","runtimeFeatures","skippedAutoreleases","f32ModInstance","f64ModInstance","f32PowInstance","f64PowInstance","Atomics","MutableGloabls","SIMD128","BulkMemory","SignExt","compile","startFunctionInstance","startFunctionBody","currentFlow","currentBody","heap_base","rtti_base","files","compileFile","compileExports","startIsEmpty","started","unshift","funcRef","ensureFunctionType","compileVisitGlobals","compileVisitMembers","compileRTTI","i64_align","isSharedMemory","i64_shr_u","ensureModuleExports","members_1","members_1_1","ensureModuleExport","prefix","fullName","setter","Cannot_export_a_mutable_global","ensureTrampoline","ensureArgcSet","COMPILED","ensureModuleFieldGetter","ensureModuleFieldSetter","isUnmanaged","subPrefix","loadExpr","isManaged","makeRetain","nativeType","nativeSizeType","valueExpr","makeRetainRelease","compileElement","compileMembers","compileGlobal","compileEnum","compileFunctionUsingTypeArguments","compileClassUsingTypeArguments","element_1","exportsStar_1","exportsStar_1_1","compileFileByPath","normalizedPathWithoutExtension","pathWithIndex","previousBody","previousFlow","compileTopLevelStatement","finishAutoreleases","numLocals","initExpr","initAutoreleaseSkipped","initializerNode","compileExpression","Type_0_is_not_assignable_to_type_1","isDeclaredConstant","isDeclaredInline","MODULE_IMPORT","mangleImportName","initializeInStart","Mutable_value_cannot_be_inlined","decoratorNodes","previousValue","previousValueIsMut","isInline","initInStart","valueNode","In_const_enum_declarations_member_initializer_must_be_constant_expression","Enum_member_must_have_initializer","AddI32","makeGlobalAssignment","compileFunction","resultType","compileFunctionBody","stmts","bodyNode","compileStatements","MAIN","indexBefore","performAutoreleases","nonNull","temp","makeAllocation","makeFieldInitialization","Constructors_for_derived_classes_must_contain_a_super_call","A_function_whose_declared_type_is_not_void_must_return_a_value","previousType","An_implementation_cannot_be_declared_in_ambient_contexts","flatten","Function_implementation_is_missing_or_not_immediately_following_the_declaration","compileClass","staticMembers","compileInterfaceDeclaration","addMemorySegment","alignment","ensureStaticString","stringValue","stringSegment","rtHeaderSize","runtimeHeaderSize","ensureStaticArrayBuffer","elementType","byteLength","bufferInstance","buf","writeI64","ensureStaticArrayHeader","bufferSegment","arrayInstance","arrayInstanceSize","bufferLength","arrayLength","bufferAddress32","ensureFunctionTableEntry","TRAMPOLINE","memberStatements","compileStatement","contextualFlags","compileBlockStatement","compileBreakStatement","compileContinueStatement","compileDoStatement","compileEmptyStatement","compileExpressionStatement","compileForStatement","compileIfStatement","compileReturnStatement","compileSwitchStatement","compileThrowStatement","compileTryStatement","compileVariableStatement","compileVoidStatement","compileWhileStatement","addDebugLocation","isBody","numStatements","outerFlow","innerFlow","A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement","A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement","condExpr","makeIsTrueish","terminated","repeatLabel","alwaysTrue","compileExpressionRetainType","incrExpr","bodyStatement","usesContinue","breakBlock","repeatBlock","ifTrueStmts","ifTrueFlow","ifFalseFlow","ifFalseStmts","valueExpression","contextualFlags_1","ANY_RETAINED","numCases","tempLocal","tempLocalIndex","breaks","breakIndex","defaultIndex","currentBlock","alwaysReturns","alwaysReturnsWrapped","alwaysThrows","alwaysAllocates","isLast","nextLabel","count","newArgs","compileAbort","numDeclarations","initializers","isConst","_const_declarations_must_be_initialized","CONSTANT","compileInlineConstant","compileAssertionExpression","compileBinaryExpression","compileCallExpression","compileCommaExpression","compileElementAccessExpression","compileFunctionExpression","compileIdentifierExpression","compileInstanceOfExpression","compileLiteralExpression","compileNewExpression","compilePropertyAccessExpression","compileTernaryExpression","compileUnaryPostfixExpression","compileUnaryPrefixExpression","wrap","convertExpression","ensureSmallIntegerWrap","explicit","Object_is_possibly_null","Conversion_from_type_0_to_1_requires_an_explicit_cast","PromoteF32","DemoteF64","TruncF32ToI64","TruncF32ToI32","TruncF32ToU64","TruncF32ToU32","TruncF64ToI64","TruncF64ToI32","TruncF64ToU64","TruncF64ToU32","ConvertI64ToF32","ConvertU64ToF32","ConvertI32ToF32","ConvertU32ToF32","ConvertI64ToF64","ConvertU64ToF64","ConvertI32ToF64","ConvertU32ToF64","WrapI64","ExtendI32","ExtendU32","PREFIX","Expression_is_never_null","tempIndex","leftExpr","leftType","rightExpr","rightType","commonType","compound","compileBinaryOverload","Operator_0_cannot_be_applied_to_types_1_and_2","AllTrueVecI8x16","EqVecI8x16","AnyTrueVecI8x16","NeVecI8x16","compileAssignment","AddI64","AddF32","AddF64","SubI32","SubI64","SubF32","SubF64","MulI64","MulF32","MulF64","namespace","makeCallDirect","DivI32","DivI64","DivU64","DivF32","DivF64","RemI64","RemU64","intType","ShlI64","The_0_operator_cannot_be_applied_to_type_1","ShrI64","ShrU64","AndI64","OrI32","OrI64","XorI32","XorI64","rightFlow","performAutoreleasesWithValue","leftAutoreleaseSkipped","rightAutoreleaseSkipped","retainLeftInElse","moveAutorelease","rightStmts","makeRelease","retainLeftInThen","makeAssignment","compileUnaryOverload","thisExpression","Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property","isUnchecked","indexedSet","Index_signature_in_type_0_only_permits_reading","indexExpression","tee","makeLocalAssignment","makeFieldAssignment","makeAutorelease","nativeReturnType","thisExpr_1","thisExpr","elementExpr","tempLocalTarget","tempLocalElement","makeSkippedRelease","nativeFieldType","nativeThisType","tempThis","tempValue","flow_2","Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors","baseClassInstance","theCall","compileCallDirect","ensureConstructor","_super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class","indexArg","compileCallExpressionBuiltin","inferredTypes","argumentNodes","argumentExprs","templateName","argumentExpression","inferredType","concreteType","compileCallIndirect","compileCall","checkCallSignature","hasThis","minimum","Expected_at_least_0_arguments_but_got_1","argumentExpressions","thisArg","parameterTypes_1","makeCallInline","Function_0_cannot_be_inlined_into_itself","numArgumentsInclThis","immediatelyDropped","usedLocals","paramExpr","paramType","argumentLocal","baseInstance","initType","originalSignature","originalName","originalParameterTypes","originalParameterDeclarations","minArguments","minOperands","maxArguments","maxOperands","numOptional","forwardedOperands","operandIndex","trampolineSignature","ofN","argc","Optional_parameter_must_have_an_initializer","ensureArgcVar","setargc","oldExpr","newExpr","temp1","temp2","undoAutorelease","fromInnerFlow","toOuterFlow","clearFlags","lengthBefore","skipAutorelease","TODO_Cannot_inline_inferred_calls_and_specific_internals_yet","numOperands","isCallImport","allOptionalsAreConstant","expr_1","makeCallIndirect","numExpressions","exprs","contextualSignature","numPresentParameters","thisTypeNode","maybeCompileEnclosingSource","flow_3","actualFunction_1","_super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class","scopedThis","superType","A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums","actualType","implicitlyNegate","compileArrayLiteral","floatValue","i64_to_f32","i64_to_f64","compileStringLiteral","compileObjectLiteral","tempDataStart","nativeElementType","bufferAddress","arraySegment","arrayAddress","alignLog2","nativeArrayType","dataStart","ctor","Constructor_of_class_0_must_not_require_any_arguments","Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration","Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration","hasErrors","Cannot_use_new_with_an_expression_whose_type_lacks_a_construct_signature","compileInstantiate","baseCtor","theEnum","Cannot_access_method_0_without_calling_it_as_it_requires_this_to_be_set","ifThenFlow","ifThenExpr","ifThenType","IfThenAutoreleaseSkipped","ifElseFlow","ifElseExpr","ifElseType","ifElseAutoreleaseSkipped","getValue","setValue","NegF32","NegF64","makeIsFalseish","ExtendI8ToI32","ExtendI16ToI32","thisLocalIndex","makeInstanceOfClass","idTemp","idExpr","conditions","Auto","compiler_1","compiler","isAsm","directize","isInteger","evaluateConstantType","isFloat","isBoolean","isSigned","isReference","isString","isArray","isArrayLike","isFunction","isDefined","checkTypeAbsent","checkArgsRequired","SWALLOW","isConstant","sizeof","checkTypeRequired","alignof","ctz","checkArgsOptional","typeArgumentsRange","Type_0_has_no_property_1","popcnt","checkTypeOptional","ClzI64","CtzI64","PopcntI64","rotl","RotlI32","RotlI64","rotr","RotrI32","RotrI64","abs","tempLocal1","tempLocalIndex2","tempLocalIndex1","wasm64","AbsF32","AbsF64","MaxF32","MaxF64","tempLocal0","min","MinF32","MinF64","floor","CeilF32","FloorF32","CeilF64","FloorF64","copysign","CopysignF32","CopysignF64","nearest","NearestF32","NearestF64","reinterpret","ReinterpretF32","ReinterpretF64","ReinterpretI32","ReinterpretI64","sqrt","SqrtF32","SqrtF64","trunc","TruncF32","TruncF64","outType","immOffset","evaluateImmediateOffset","immAlign","naturalAlign","_0_must_be_a_value_between_1_and_2_inclusive","_0_must_be_a_power_of_two","inType","atomic_add","atomic_sub","atomic_and","atomic_or","atomic_xor","atomic_xchg","Add","Sub","And","Or","Xor","Xchg","memory_size","MemorySize","memory_grow","MemoryGrow","alreadyUnchecked","call_direct","arg0Type","operandExprs","nativeParamTypes","operandType","instantiate","User_defined_0","Expression_must_be_a_compile_time_constant","off","v128_splat","SplatVecI8x16","SplatVecI16x8","SplatVecI32x4","SplatVecI64x2","SplatVecF32x4","SplatVecF64x2","v128_extract_lane","ExtractLaneSVecI8x16","ExtractLaneUVecI8x16","ExtractLaneSVecI16x8","ExtractLaneUVecI16x8","ExtractLaneVecI32x4","ExtractLaneVecI64x2","ExtractLaneVecF32x4","ExtractLaneVecF64x2","maxIdx","v128_replace_lane","ReplaceLaneVecI8x16","ReplaceLaneVecI16x8","ReplaceLaneVecI32x4","ReplaceLaneVecI64x2","ReplaceLaneVecF32x4","ReplaceLaneVecF64x2","v128_shuffle","laneWidth","laneCount","argN","off8","idx8","v128_add","v128_sub","v128_mul","v128_div","v128_add_saturate","v128_sub_saturate","v128_min","v128_max","v128_eq","v128_ne","v128_lt","v128_le","v128_gt","v128_ge","AddVecI8x16","AddVecI16x8","AddVecI32x4","AddVecI64x2","AddVecF32x4","AddVecF64x2","SubVecI8x16","SubVecI16x8","SubVecI32x4","SubVecI64x2","SubVecF32x4","SubVecF64x2","MulVecI8x16","MulVecI16x8","MulVecI32x4","MulVecF32x4","MulVecF64x2","DivVecF32x4","DivVecF64x2","AddSatSVecI8x16","AddSatUVecI8x16","AddSatSVecI16x8","AddSatUVecI16x8","SubSatSVecI8x16","SubSatUVecI8x16","SubSatSVecI16x8","SubSatUVecI16x8","MinVecF32x4","MinVecF64x2","MaxVecF32x4","MaxVecF64x2","EqVecI16x8","EqVecI32x4","EqVecF32x4","EqVecF64x2","NeVecI16x8","NeVecI32x4","NeVecF32x4","NeVecF64x2","LtSVecI8x16","LtUVecI8x16","LtSVecI16x8","LtUVecI16x8","LtSVecI32x4","LtUVecI32x4","LtVecF32x4","LtVecF64x2","LeSVecI8x16","LeUVecI8x16","LeSVecI16x8","LeUVecI16x8","LeSVecI32x4","LeUVecI32x4","LeVecF32x4","LeVecF64x2","GtSVecI8x16","GtUVecI8x16","GtSVecI16x8","GtUVecI16x8","GtSVecI32x4","GtUVecI32x4","GtVecF32x4","GtVecF64x2","GeSVecI8x16","GeUVecI8x16","GeSVecI16x8","GeUVecI16x8","GeSVecI32x4","GeUVecI32x4","GeVecF32x4","GeVecF64x2","v128_neg","v128_abs","v128_sqrt","v128_convert","v128_trunc","NegVecI8x16","NegVecI16x8","NegVecI32x4","NegVecI64x2","NegVecF32x4","NegVecF64x2","AbsVecF32x4","AbsVecF64x2","SqrtVecF32x4","SqrtVecF64x2","ConvertSVecI32x4ToVecF32x4","ConvertUVecI32x4ToVecF32x4","ConvertSVecI64x2ToVecF64x2","ConvertUVecI64x2ToVecF64x2","TruncSatSVecF32x4ToVecI32x4","TruncSatUVecF32x4ToVecI32x4","TruncSatSVecF64x2ToVecI64x2","TruncSatUVecF64x2ToVecI64x2","v128_shl","v128_shr","ShlVecI8x16","ShlVecI16x8","ShlVecI32x4","ShlVecI64x2","ShrSVecI8x16","ShrUVecI8x16","ShrSVecI16x8","ShrUVecI16x8","ShrSVecI32x4","ShrUVecI32x4","ShrSVecI64x2","ShrUVecI64x2","v128_and","v128_or","v128_xor","AndVec128","OrVec128","XorVec128","v128_not","NotVec128","v128_bitselect","v128_any_true","v128_all_true","AnyTrueVecI16x8","AnyTrueVecI32x4","AnyTrueVecI64x2","AllTrueVecI16x8","AllTrueVecI32x4","AllTrueVecI64x2","idof","visit_globals","visit_members","i32_clz","deferASM","i64_clz","i32_ctz","i64_ctz","i32_popcnt","i64_popcnt","i32_rotl","i64_rotl","i32_rotr","i64_rotr","f32_abs","f64_abs","f32_max","f64_max","f32_min","f64_min","f32_ceil","f64_ceil","f32_floor","f64_floor","f32_copysign","f64_copysign","f32_nearest","f64_nearest","i32_reinterpret_f32","i64_reinterpret_f64","f32_reinterpret_i32","f64_reinterpret_i64","f32_sqrt","f64_sqrt","f32_trunc","f64_trunc","i32_load8_s","i32_load8_u","i32_load16_s","i32_load16_u","i32_load","i64_load8_s","i64_load8_u","i64_load16_s","i64_load16_u","i64_load32_s","i64_load32_u","i64_load","f32_load","f64_load","i32_store8","i32_store16","i32_store","i64_store8","i64_store16","i64_store32","i64_store","f32_store","f64_store","i32_atomic_load8_u","i32_atomic_load16_u","i32_atomic_load","i64_atomic_load8_u","i64_atomic_load16_u","i64_atomic_load32_u","i64_atomic_load","i32_atomic_store8","i32_atomic_store16","i32_atomic_store","i64_atomic_store8","i64_atomic_store16","i64_atomic_store32","i64_atomic_store","i32_atomic_rmw8_add_u","i32_atomic_rmw16_add_u","i32_atomic_rmw_add","i64_atomic_rmw8_add_u","i64_atomic_rmw16_add_u","i64_atomic_rmw32_add_u","i64_atomic_rmw_add","i32_atomic_rmw8_sub_u","i32_atomic_rmw16_sub_u","i32_atomic_rmw_sub","i64_atomic_rmw8_sub_u","i64_atomic_rmw16_sub_u","i64_atomic_rmw32_sub_u","i64_atomic_rmw_sub","i32_atomic_rmw8_and_u","i32_atomic_rmw16_and_u","i32_atomic_rmw_and","i64_atomic_rmw8_and_u","i64_atomic_rmw16_and_u","i64_atomic_rmw32_and_u","i64_atomic_rmw_and","i32_atomic_rmw8_or_u","i32_atomic_rmw16_or_u","i32_atomic_rmw_or","i64_atomic_rmw8_or_u","i64_atomic_rmw16_or_u","i64_atomic_rmw32_or_u","i64_atomic_rmw_or","i32_atomic_rmw8_u_xor","i32_atomic_rmw16_u_xor","i32_atomic_rmw_xor","i64_atomic_rmw8_xor_u","i64_atomic_rmw16_xor_u","i64_atomic_rmw32_xor_u","i64_atomic_rmw_xor","i32_atomic_rmw8_xchg_u","i32_atomic_rmw16_xchg_u","i32_atomic_rmw_xchg","i64_atomic_rmw8_xchg_u","i64_atomic_rmw16_xchg_u","i64_atomic_rmw32_xchg_u","i64_atomic_rmw_xchg","i32_atomic_rmw8_cmpxchg_u","i32_atomic_rmw16_cmpxchg_u","i32_atomic_rmw_cmpxchg","i64_atomic_rmw8_cmpxchg_u","i64_atomic_rmw16_cmpxchg_u","i64_atomic_rmw32_cmpxchg_u","i64_atomic_rmw_cmpxchg","i32_wait","i64_wait","v128_load","v128_store","i8x16_splat","i8x16_extract_lane_s","i8x16_extract_lane_u","i8x16_replace_lane","i8x16_add","i8x16_sub","i8x16_mul","i8x16_neg","i8x16_add_saturate_s","i8x16_add_saturate_u","i8x16_sub_saturate_s","i8x16_sub_saturate_u","i8x16_shl","i8x16_shr_s","i8x16_shr_u","i8x16_any_true","i8x16_all_true","i8x16_eq","i8x16_ne","i8x16_lt_s","i8x16_lt_u","i8x16_le_s","i8x16_le_u","i8x16_gt_s","i8x16_gt_u","i8x16_ge_s","i8x16_ge_u","i16x8_splat","i16x8_extract_lane_s","i16x8_extract_lane_u","i16x8_replace_lane","i16x8_add","i16x8_sub","i16x8_mul","i16x8_neg","i16x8_add_saturate_s","i16x8_add_saturate_u","i16x8_sub_saturate_s","i16x8_sub_saturate_u","i16x8_shl","i16x8_shr_s","i16x8_shr_u","i16x8_any_true","i16x8_all_true","i16x8_eq","i16x8_ne","i16x8_lt_s","i16x8_lt_u","i16x8_le_s","i16x8_le_u","i16x8_gt_s","i16x8_gt_u","i16x8_ge_s","i16x8_ge_u","i32x4_splat","i32x4_extract_lane","i32x4_replace_lane","i32x4_add","i32x4_sub","i32x4_mul","i32x4_neg","i32x4_shl","i32x4_shr_s","i32x4_shr_u","i32x4_any_true","i32x4_all_true","i32x4_eq","i32x4_ne","i32x4_lt_s","i32x4_lt_u","i32x4_le_s","i32x4_le_u","i32x4_gt_s","i32x4_gt_u","i32x4_ge_s","i32x4_ge_u","i32x4_trunc_s_f32x4_sat","i32x4_trunc_u_f32x4_sat","i64x2_splat","i64x2_extract_lane","i64x2_replace_lane","i64x2_add","i64x2_sub","i64x2_neg","i64x2_shl","i64x2_shr_s","i64x2_shr_u","i64x2_any_true","i64x2_all_true","i64x2_trunc_s_f64x2_sat","i64x2_trunc_u_f64x2_sat","f32x4_splat","f32x4_extract_lane","f32x4_replace_lane","f32x4_add","f32x4_sub","f32x4_mul","f32x4_div","f32x4_neg","f32x4_min","f32x4_max","f32x4_abs","f32x4_sqrt","f32x4_eq","f32x4_ne","f32x4_lt","f32x4_le","f32x4_gt","f32x4_ge","f32x4_convert_s_i32x4","f32x4_convert_u_i32x4","f64x2_splat","f64x2_extract_lane","f64x2_replace_lane","f64x2_add","f64x2_sub","f64x2_mul","f64x2_div","f64x2_neg","f64x2_min","f64x2_max","f64x2_abs","f64x2_sqrt","f64x2_eq","f64x2_ne","f64x2_lt","f64x2_le","f64x2_gt","f64x2_ge","f64x2_convert_s_i64x2","f64x2_convert_u_i64x2","v8x16_shuffle","tryDeferASM","messageArg","filenameArg","typeToRuntimeFlags","argumentsRange","setCurrentTypeOnError","expectedMinimum","expectedMaximum","memory_allocate","memory_free","memory_reset","runtime_instanceof","runtime_flags","runtime_allocate","runtime_reallocate","runtime_register","runtime_discard","runtime_makeArray","capabilities","nativeSizeSize","ftype","blocks","outer","lastId","managedClasses_1","managedClasses_1_1","visitImpl","isDeclaredInLibrary","visitFunc","visitSig","callExpr","fieldOffset","managedClasses_2","managedClasses_2_1","abvPrototype","managedClasses_3","managedClasses_3_1","isAcyclic","Decompiler","functionId","decompile","decompiler","decompileFunction","nativeTypeToType","decompileExpression","nested","i64_to_string","ExportsWalker","includePrivate","seen","walk","visitFile","visitElement","visitAlias","visitGlobal","visitEnum","visitFunctionInstances","visitClassInstances","visitField","visitPropertyInstances","prop","visitFunction","hasCompiledMember","visitNamespace","visitClass","IDLBuilder","indentLevel","build","indent","typeToString","members_2","members_2_1","name_1","visitInterface","TSDBuilder","unknown","numMembers","members_3","members_3_1","name_2","isInterface","Parser","backlog","seenlog","donelog","tryParseSignatureIsSignature","parseParametersThis","parseFile","indexOf","tn","parseTopLevelStatement","startPos","parseDecorator","skipStatement","exportStart","exportEnd","defaultStart","defaultEnd","declareStart","declareEnd","contextIsAmbient","A_declare_modifier_cannot_be_used_in_an_already_ambient_context","first","parseEnum","parseVariable","parseFunction","parseStatement","parseClassOrInterface","parseNamespace","parseExportImport","parseImport","parseTypeDeclaration","An_export_assignment_cannot_have_modifiers","parseExportDefaultAlias","parseExport","_0_modifier_cannot_be_used_here","Decorators_are_not_valid_here","nextFile","clear","parseType","acceptParenthesized","suppressErrors","isNullableSignature","tryParseSignature","Unexpected_token","innerType","Identifier_expected","nullable","parameter","bracketStart","bracketRange","isSignature","A_rest_parameter_cannot_be_optional","OPTIONAL","param","parseArguments","parseVariableDeclaration","parentFlags","parentDecorators","DEFINITE_ASSIGNMENT","Initializers_are_not_allowed_in_ambient_contexts","parseExpression","A_definite_assignment_assertion_is_not_permitted_in_this_context","parseEnumValue","parseReturn","parseTypeParameters","seenOptional","typeParameter","parseTypeParameter","Required_type_parameters_may_not_follow_optional_type_parameters","Type_parameter_list_cannot_be_empty","parseParameters","isConstructor","seenRest","reportedRest","parseParameter","A_rest_parameter_must_be_last_in_a_parameter_list","A_required_parameter_cannot_follow_an_optional_parameter","isRest","isOptional","startRange","accessFlags","A_parameter_property_cannot_be_declared_using_a_rest_parameter","A_rest_parameter_cannot_have_an_initializer","Parameter_cannot_have_question_mark_and_initializer","signatureStart","isSetter","A_set_accessor_must_have_exactly_one_parameter","A_set_accessor_parameter_cannot_have_an_initializer","A_get_accessor_cannot_have_parameters","parseBlockStatement","parseFunctionExpression","parseFunctionExpressionCommon","bodyExpression","Interface_declaration_cannot_have_implements_clause","parseClassMember","parseClassExpression","VIRTUAL","accessStart","accessEnd","staticStart","staticEnd","abstractStart","abstractEnd","GENERIC_CONTEXT","readonlyStart","readonlyEnd","setEnd","retIndex","parseIndexSignatureDeclaration","typeParametersStart","Type_parameters_cannot_appear_on_a_constructor_declaration","An_accessor_cannot_have_type_parameters","Type_annotation_cannot_appear_on_a_constructor_declaration","A_set_accessor_cannot_have_a_return_type_annotation","Method_0_cannot_have_an_implementation_because_it_is_marked_abstract","retMethod","Constructor_implementation_is_missing","Optional_properties_are_not_supported","retField","parseExportMember","asIdentifier","skipFrom","parseImportDeclaration","topLevel","parseBreak","parseContinue","parseDoStatement","parseForStatement","parseIfStatement","A_return_statement_can_only_be_used_within_a_function_body","parseSwitchStatement","parseThrowStatement","parseTryStatement","parseVoidStatement","parseWhileStatement","parseExpressionStatement","elseStatement","case_","parseSwitchCase","_case_or_default_expected","parseExpressionStart","precedence","determinePrecedenceStart","The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access","again","startPos_1","_super_must_be_followed_by_an_argument_list_or_member_access","regexpPattern","Expression_expected","tryParseTypeArgumentsBeforeArguments","nextPrecedence","maybeParseCallExpression","determinePrecedence","commaExprs","isRightAssociative","joinPropertyCall","callee","inner","skipBlock","depth","Precedence","binaryen","wrapModule","emitStackIR","emitAsmjs","Binaryen","__memory_allocate","_malloc","__memory_free","_free","__memory_copy","_memmove","__store","HEAPU8","__load","globalScope","UnreachableError","captureStackTrace","AssertionError","defineProperties","writable","fround","EPSILON","MIN_NORMAL_VALUE","MIN_SAFE_INTEGER","MAX_SAFE_INTEGER","clz32","round","y","sign","isTrueish","radix","parseInt","undefined","fromCodePoint","Number","capacity","sincos_sin","sincos_cos","signbit","Boolean","sincos","sin","cos","HEAP","HEAP_OFFSET","oldHeap","fill","copy","copyWithin","f32_as_i32","i32_as_f32","f64_as_i64","i64_as_f64","Long","ZERO","i64_one","ONE","lo","hi","fromBits","low","high","sub","mul","i64_div","div","i64_div_u","toUnsigned","toSigned","i64_rem","i64_rem_u","i64_and","and","i64_or","or","i64_xor","xor","shl","i64_shr","shr","shru","i64_not","not","i64_eq","eq","i64_ne","ne","fromInt","minSafeF32","fromNumber","maxSafeF32","i64_is_f32","gte","lte","minSafeF64","maxSafeF64","i64_is_f64","toNumber","unsigned","wasm","WebAssembly","Instance","isLong","obj","__isLong__","INT_CACHE","UINT_CACHE","cachedObj","cache","isNaN","UZERO","TWO_PWR_64_DBL","MAX_UNSIGNED_VALUE","TWO_PWR_63_DBL","neg","TWO_PWR_32_DBL","lowBits","highBits","pow_dbl","fromString","RangeError","radixToPower","power","fromValue","TWO_PWR_16_DBL","TWO_PWR_24","UONE","NEG_ONE","LongPrototype","toInt","isZero","isNegative","radixLong","rem1","rem","remDiv","digits","getHighBits","getHighBitsUnsigned","getLowBits","getLowBitsUnsigned","getNumBitsAbs","bit","eqz","isPositive","isOdd","isEven","equals","notEquals","neq","lessThan","comp","lt","lessThanOrEqual","le","greaterThan","gt","greaterThanOrEqual","ge","compare","thisNeg","otherNeg","negate","addend","a48","a32","a16","a00","b48","b32","b16","c48","c32","c16","c00","subtract","subtrahend","multiply","multiplier","get_high","b00","divide","divisor","approx","res","div_u","div_s","log2","log","LN2","delta","approxRes","approxRem","modulo","rem_u","rem_s","shiftLeft","numBits","shiftRight","shiftRightUnsigned","shr_u","toBytes","toBytesLE","toBytesBE","fromBytes","fromBytesLE","fromBytesBE","__decorate","unmanaged","decompiler_1","definitions_1","formatDiagnostic","parser_1","parser","nextDiagnostic","isInfo","isWarning","isError","createOptions","setTarget","setNoAssert","setImportMemory","setSharedMemory","setImportTable","setSourceMap","setMemoryBase","setGlobalAlias","setExplicitStart","FEATURE_SIGN_EXTENSION","FEATURE_MUTABLE_GLOBAL","FEATURE_BULK_MEMORY","FEATURE_SIMD","FEATURE_THREADS","enableFeature","setOptimizeLevelHints","optimizeLevel","shrinkLevel","finishParsing","compileProgram","decompileModule","buildIDL","buildTSD","buildRTTI","cls","bitsetIs","map","bitsetSet","isSet","CharCode","lookupInUnicodeMap","unicodeIdentifierStart","unicodeIdentifierPart","mid","midVal","makeArray","cloned","makeSet","original_1","original_1_1","v","overrides","original_2","original_2_1","overrides_1","overrides_1_1","overrides_2","overrides_2_1","separator","ipos","dirname","origin","indentX1","indentX2","indentX4","readI32","readI64","readI8","readI16","readF32","readF64","valueI64"],"mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,EAAAG,QAAA,aACA,mBAAAC,eAAAC,IACAD,OAAA,aAAAJ,GACA,iBAAAC,QACAA,QAAA,eAAAD,EAAAG,QAAA,aAEAJ,EAAA,eAAAC,EAAAD,EAAA,UARA,CASC,oBAAAO,UAAAC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yBz1E,EAAYiR,EAAoBC,GACvDG,EAASk9B,QAAQvuC,GAAQiR,EAAQC,GACjCG,EAASm9B,SAASxuC,GAAQiR,EAAQC,EAAS,IAI7C9S,EAAAktH,QAAA,SAAwBr6G,EAAoBC,GAC1C,OAAOgsG,WAAWgO,EAAQj6G,EAAQC,KAIpC9S,EAAAiuB,SAAA,SAAyBrsB,EAAYiR,EAAoBC,GACvDG,EAAS4rG,WAAWj9G,GAAQiR,EAAQC,IAItC9S,EAAAmtH,QAAA,SAAwBt6G,EAAoBC,GAC1C,OAAOksG,WAAW+N,EAAQl6G,EAAQC,KAIpC9S,EAAAkuB,SAAA,SAAyBtsB,EAAYiR,EAAoBC,GACvD,IAAIs6G,EAAWrO,WAAWn9G,GAC1BqR,EAASk9B,QAAQi9E,GAAWv6G,EAAQC,GACpCG,EAASm9B,SAASg9E,GAAWv6G,EAAQC,EAAS","file":"assemblyscript.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"binaryen\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"binaryen\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"assemblyscript\"] = factory(require(\"binaryen\"));\n\telse\n\t\troot[\"assemblyscript\"] = factory(root[\"binaryen\"]);\n})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE__20__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 17);\n","/**\r\n * Common constants.\r\n * @module common\r\n *//***/\r\n\r\n/** Indicates traits of a {@link Node} or {@link Element}. */\r\nexport enum CommonFlags {\r\n /** No flags set. */\r\n NONE = 0,\r\n\r\n // Basic modifiers\r\n\r\n /** Has an `import` modifier. */\r\n IMPORT = 1 << 0,\r\n /** Has an `export` modifier. */\r\n EXPORT = 1 << 1,\r\n /** Has a `declare` modifier. */\r\n DECLARE = 1 << 2,\r\n /** Has a `const` modifier. */\r\n CONST = 1 << 3,\r\n /** Has a `let` modifier. */\r\n LET = 1 << 4,\r\n /** Has a `static` modifier. */\r\n STATIC = 1 << 5,\r\n /** Has a `readonly` modifier. */\r\n READONLY = 1 << 6,\r\n /** Has an `abstract` modifier. */\r\n ABSTRACT = 1 << 7,\r\n /** Has a `public` modifier. */\r\n PUBLIC = 1 << 8,\r\n /** Has a `private` modifier. */\r\n PRIVATE = 1 << 9,\r\n /** Has a `protected` modifier. */\r\n PROTECTED = 1 << 10,\r\n /** Has a `get` modifier. */\r\n GET = 1 << 11,\r\n /** Has a `set` modifier. */\r\n SET = 1 << 12,\r\n /** Has a definite assignment assertion `!` as in `x!: i32;`. */\r\n DEFINITE_ASSIGNMENT = 1 << 13,\r\n\r\n // Extended modifiers usually derived from basic modifiers\r\n\r\n /** Is ambient, that is either declared or nested in a declared element. */\r\n AMBIENT = 1 << 14,\r\n /** Is generic. */\r\n GENERIC = 1 << 15,\r\n /** Is part of a generic context. */\r\n GENERIC_CONTEXT = 1 << 16,\r\n /** Is an instance member. */\r\n INSTANCE = 1 << 17,\r\n /** Is a constructor. */\r\n CONSTRUCTOR = 1 << 18,\r\n /** Is a module export. */\r\n MODULE_EXPORT = 1 << 19,\r\n /** Is a module import. */\r\n MODULE_IMPORT = 1 << 20,\r\n\r\n // Compilation states\r\n\r\n /** Is resolved. */\r\n RESOLVED = 1 << 21,\r\n /** Is compiled. */\r\n COMPILED = 1 << 22,\r\n /** Has a constant value and is therefore inlined. */\r\n INLINED = 1 << 23,\r\n /** Is scoped. */\r\n SCOPED = 1 << 24,\r\n /** Is a trampoline. */\r\n TRAMPOLINE = 1 << 25,\r\n /** Is a virtual method. */\r\n VIRTUAL = 1 << 26,\r\n /** Is the main function. */\r\n MAIN = 1 << 27,\r\n\r\n // Other\r\n\r\n /** Is quoted. */\r\n QUOTED = 1 << 28\r\n}\r\n\r\n/** Path delimiter inserted between file system levels. */\r\nexport const PATH_DELIMITER = \"/\";\r\n/** Substitution used to indicate the parent directory. */\r\nexport const PARENT_SUBST = \"..\";\r\n/** Function name prefix used for getters. */\r\nexport const GETTER_PREFIX = \"get:\";\r\n/** Function name prefix used for setters. */\r\nexport const SETTER_PREFIX = \"set:\";\r\n/** Delimiter used between class names and instance members. */\r\nexport const INSTANCE_DELIMITER = \"#\";\r\n/** Delimiter used between class and namespace names and static members. */\r\nexport const STATIC_DELIMITER = \".\";\r\n/** Delimiter used between a function and its inner elements. */\r\nexport const INNER_DELIMITER = \"~\";\r\n/** Substitution used to indicate a library directory. */\r\nexport const LIBRARY_SUBST = \"~lib\";\r\n/** Library directory prefix. */\r\nexport const LIBRARY_PREFIX = LIBRARY_SUBST + PATH_DELIMITER;\r\n/** Path index suffix. */\r\nexport const INDEX_SUFFIX = PATH_DELIMITER + \"index\";\r\n\r\n/** Common compiler symbols. */\r\nexport namespace CommonSymbols {\r\n // special\r\n export const EMPTY = \"\";\r\n // types\r\n export const i8 = \"i8\";\r\n export const i16 = \"i16\";\r\n export const i32 = \"i32\";\r\n export const i64 = \"i64\";\r\n export const isize = \"isize\";\r\n export const u8 = \"u8\";\r\n export const u16 = \"u16\";\r\n export const u32 = \"u32\";\r\n export const u64 = \"u64\";\r\n export const usize = \"usize\";\r\n export const bool = \"bool\";\r\n export const f32 = \"f32\";\r\n export const f64 = \"f64\";\r\n export const v128 = \"v128\";\r\n export const i8x16 = \"i8x16\";\r\n export const u8x16 = \"u8x16\";\r\n export const i16x8 = \"i16x8\";\r\n export const u16x8 = \"u16x8\";\r\n export const i32x4 = \"i32x4\";\r\n export const u32x4 = \"u32x4\";\r\n export const i64x2 = \"i64x2\";\r\n export const u64x2 = \"u64x2\";\r\n export const f32x4 = \"f32x4\";\r\n export const f64x2 = \"f64x2\";\r\n export const void_ = \"void\";\r\n export const number = \"number\";\r\n export const boolean = \"boolean\";\r\n export const string = \"string\";\r\n export const native = \"native\";\r\n // aliases\r\n export const null_ = \"null\";\r\n export const true_ = \"true\";\r\n export const false_ = \"false\";\r\n // objects\r\n export const this_ = \"this\";\r\n export const super_ = \"super\";\r\n export const constructor = \"constructor\";\r\n // constants\r\n export const ASC_TARGET = \"ASC_TARGET\";\r\n export const ASC_NO_TREESHAKING = \"ASC_NO_TREESHAKING\";\r\n export const ASC_NO_ASSERT = \"ASC_NO_ASSERT\";\r\n export const ASC_MEMORY_BASE = \"ASC_MEMORY_BASE\";\r\n export const ASC_OPTIMIZE_LEVEL = \"ASC_OPTIMIZE_LEVEL\";\r\n export const ASC_SHRINK_LEVEL = \"ASC_SHRINK_LEVEL\";\r\n export const ASC_FEATURE_MUTABLE_GLOBAL = \"ASC_FEATURE_MUTABLE_GLOBAL\";\r\n export const ASC_FEATURE_SIGN_EXTENSION = \"ASC_FEATURE_SIGN_EXTENSION\";\r\n export const ASC_FEATURE_BULK_MEMORY = \"ASC_FEATURE_BULK_MEMORY\";\r\n export const ASC_FEATURE_SIMD = \"ASC_FEATURE_SIMD\";\r\n export const ASC_FEATURE_THREADS = \"ASC_FEATURE_THREADS\";\r\n // classes\r\n export const I8 = \"I8\";\r\n export const I16 = \"I16\";\r\n export const I32 = \"I32\";\r\n export const I64 = \"I64\";\r\n export const Isize = \"Isize\";\r\n export const U8 = \"U8\";\r\n export const U16 = \"U16\";\r\n export const U32 = \"U32\";\r\n export const U64 = \"U64\";\r\n export const Usize = \"Usize\";\r\n export const Bool = \"Bool\";\r\n export const F32 = \"F32\";\r\n export const F64 = \"F64\";\r\n export const V128 = \"V128\";\r\n export const String = \"String\";\r\n export const Array = \"Array\";\r\n export const FixedArray = \"FixedArray\";\r\n export const Set = \"Set\";\r\n export const Map = \"Map\";\r\n export const ArrayBufferView = \"ArrayBufferView\";\r\n export const ArrayBuffer = \"ArrayBuffer\";\r\n export const Math = \"Math\";\r\n export const Mathf = \"Mathf\";\r\n export const Int8Array = \"Int8Array\";\r\n export const Int16Array = \"Int16Array\";\r\n export const Int32Array = \"Int32Array\";\r\n export const Int64Array = \"Int64Array\";\r\n export const Uint8Array = \"Uint8Array\";\r\n export const Uint8ClampedArray = \"Uint8ClampedArray\";\r\n export const Uint16Array = \"Uint16Array\";\r\n export const Uint32Array = \"Uint32Array\";\r\n export const Uint64Array = \"Uint64Array\";\r\n export const Float32Array = \"Float32Array\";\r\n export const Float64Array = \"Float64Array\";\r\n // runtime\r\n export const abort = \"abort\";\r\n export const pow = \"pow\";\r\n export const mod = \"mod\";\r\n export const alloc = \"__alloc\";\r\n export const realloc = \"__realloc\";\r\n export const free = \"__free\";\r\n export const retain = \"__retain\";\r\n export const release = \"__release\";\r\n export const collect = \"__collect\";\r\n export const typeinfo = \"__typeinfo\";\r\n export const instanceof_ = \"__instanceof\";\r\n export const visit = \"__visit\";\r\n export const allocArray = \"__allocArray\";\r\n}\r\n\r\n// shared\r\nexport { Feature } from \"../std/assembly/shared/feature\";\r\nexport { Target } from \"../std/assembly/shared/target\";\r\nexport { Typeinfo, TypeinfoFlags } from \"../std/assembly/shared/typeinfo\";\r\n","/**\r\n * Various compiler utilities.\r\n * @module util\r\n * @preferred\r\n *//***/\r\n\r\nexport * from \"./bitset\";\r\nexport * from \"./charcode\";\r\nexport * from \"./collections\";\r\nexport * from \"./path\";\r\nexport * from \"./text\";\r\nexport * from \"./binary\";\r\n\r\n/** Tests if `x` is a power of two. */\r\nexport function isPowerOf2(x: i32): bool {\r\n return x != 0 && (x & (x - 1)) == 0;\r\n}\r\n","/**\r\n * Shared diagnostic handling inherited by the parser and the compiler.\r\n * @module diagnostics\r\n * @preferred\r\n *//***/\r\n\r\nimport {\r\n Range\r\n} from \"./ast\";\r\n\r\nimport {\r\n DiagnosticCode,\r\n diagnosticCodeToString\r\n} from \"./diagnosticMessages.generated\";\r\n\r\nimport {\r\n isLineBreak, CharCode\r\n} from \"./util\";\r\n\r\nexport {\r\n DiagnosticCode,\r\n diagnosticCodeToString\r\n} from \"./diagnosticMessages.generated\";\r\n\r\n/** Indicates the category of a {@link DiagnosticMessage}. */\r\nexport enum DiagnosticCategory {\r\n /** Informatory message. */\r\n INFO,\r\n /** Warning message. */\r\n WARNING,\r\n /** Error message. */\r\n ERROR\r\n}\r\n\r\n/** Returns the string representation of the specified diagnostic category. */\r\nexport function diagnosticCategoryToString(category: DiagnosticCategory): string {\r\n switch (category) {\r\n case DiagnosticCategory.INFO: return \"INFO\";\r\n case DiagnosticCategory.WARNING: return \"WARNING\";\r\n case DiagnosticCategory.ERROR: return \"ERROR\";\r\n default: {\r\n assert(false);\r\n return \"\";\r\n }\r\n }\r\n}\r\n\r\n/** ANSI escape sequence for blue foreground. */\r\nexport const COLOR_BLUE: string = \"\\u001b[96m\";\r\n/** ANSI escape sequence for yellow foreground. */\r\nexport const COLOR_YELLOW: string = \"\\u001b[93m\";\r\n/** ANSI escape sequence for red foreground. */\r\nexport const COLOR_RED: string = \"\\u001b[91m\";\r\n/** ANSI escape sequence to reset the foreground color. */\r\nexport const COLOR_RESET: string = \"\\u001b[0m\";\r\n\r\n/** Returns the ANSI escape sequence for the specified category. */\r\nexport function diagnosticCategoryToColor(category: DiagnosticCategory): string {\r\n switch (category) {\r\n case DiagnosticCategory.INFO: return COLOR_BLUE;\r\n case DiagnosticCategory.WARNING: return COLOR_YELLOW;\r\n case DiagnosticCategory.ERROR: return COLOR_RED;\r\n default: {\r\n assert(false);\r\n return \"\";\r\n }\r\n }\r\n}\r\n\r\n/** Represents a diagnostic message. */\r\nexport class DiagnosticMessage {\r\n\r\n /** Message code. */\r\n code: i32;\r\n /** Message category. */\r\n category: DiagnosticCategory;\r\n /** Message text. */\r\n message: string;\r\n /** Respective source range, if any. */\r\n range: Range | null = null;\r\n /** Related range, if any. */\r\n relatedRange: Range | null = null;\r\n\r\n /** Constructs a new diagnostic message. */\r\n private constructor(code: i32, category: DiagnosticCategory, message: string) {\r\n this.code = code;\r\n this.category = category;\r\n this.message = message;\r\n }\r\n\r\n /** Creates a new diagnostic message of the specified category. */\r\n static create(\r\n code: DiagnosticCode,\r\n category: DiagnosticCategory,\r\n arg0: string | null = null,\r\n arg1: string | null = null,\r\n arg2: string | null = null\r\n ): DiagnosticMessage {\r\n var message = diagnosticCodeToString(code);\r\n if (arg0 != null) message = message.replace(\"{0}\", arg0);\r\n if (arg1 != null) message = message.replace(\"{1}\", arg1);\r\n if (arg2 != null) message = message.replace(\"{2}\", arg2);\r\n return new DiagnosticMessage(code, category, message);\r\n }\r\n\r\n /** Creates a new informatory diagnostic message. */\r\n static createInfo(\r\n code: DiagnosticCode,\r\n arg0: string | null = null,\r\n arg1: string | null = null\r\n ): DiagnosticMessage {\r\n return DiagnosticMessage.create(code, DiagnosticCategory.INFO, arg0, arg1);\r\n }\r\n\r\n /** Creates a new warning diagnostic message. */\r\n static createWarning(\r\n code: DiagnosticCode,\r\n arg0: string | null = null,\r\n arg1: string | null = null\r\n ): DiagnosticMessage {\r\n return DiagnosticMessage.create(code, DiagnosticCategory.WARNING, arg0, arg1);\r\n }\r\n\r\n /** Creates a new error diagnostic message. */\r\n static createError(\r\n code: DiagnosticCode,\r\n arg0: string | null = null,\r\n arg1: string | null = null\r\n ): DiagnosticMessage {\r\n return DiagnosticMessage.create(code, DiagnosticCategory.ERROR, arg0, arg1);\r\n }\r\n\r\n /** Adds a source range to this message. */\r\n withRange(range: Range): this {\r\n this.range = range;\r\n return this;\r\n }\r\n\r\n /** Adds a related source range to this message. */\r\n withRelatedRange(range: Range): this {\r\n this.relatedRange = range;\r\n return this;\r\n }\r\n\r\n /** Converts this message to a string. */\r\n toString(): string {\r\n if (this.range) {\r\n return (\r\n diagnosticCategoryToString(this.category) +\r\n \" \" +\r\n this.code.toString(10) +\r\n \": \\\"\" +\r\n this.message +\r\n \"\\\" in \" +\r\n this.range.source.normalizedPath +\r\n \":\" +\r\n this.range.line.toString(10) +\r\n \":\" +\r\n this.range.column.toString(10)\r\n );\r\n }\r\n return (\r\n diagnosticCategoryToString(this.category) +\r\n \" \" +\r\n this.code.toString(10) +\r\n \": \" +\r\n this.message\r\n );\r\n }\r\n}\r\n\r\n/** Formats a diagnostic message, optionally with terminal colors and source context. */\r\nexport function formatDiagnosticMessage(\r\n message: DiagnosticMessage,\r\n useColors: bool = false,\r\n showContext: bool = false\r\n): string {\r\n\r\n // general information\r\n var sb: string[] = [];\r\n if (useColors) sb.push(diagnosticCategoryToColor(message.category));\r\n sb.push(diagnosticCategoryToString(message.category));\r\n if (useColors) sb.push(COLOR_RESET);\r\n sb.push(message.code < 1000 ? \" AS\" : \" TS\");\r\n sb.push(message.code.toString(10));\r\n sb.push(\": \");\r\n sb.push(message.message);\r\n\r\n // include range information if available\r\n if (message.range) {\r\n\r\n // include context information if requested\r\n let range = message.range;\r\n if (showContext) {\r\n sb.push(\"\\n\");\r\n sb.push(formatDiagnosticContext(range, useColors));\r\n }\r\n sb.push(\"\\n\");\r\n sb.push(\" in \");\r\n sb.push(range.source.normalizedPath);\r\n sb.push(\"(\");\r\n sb.push(range.line.toString(10));\r\n sb.push(\",\");\r\n sb.push(range.column.toString(10));\r\n sb.push(\")\");\r\n\r\n let relatedRange = message.relatedRange;\r\n if (relatedRange) {\r\n if (showContext) {\r\n sb.push(\"\\n\");\r\n sb.push(formatDiagnosticContext(relatedRange, useColors));\r\n }\r\n sb.push(\"\\n\");\r\n sb.push(\" in \");\r\n sb.push(range.source.normalizedPath);\r\n sb.push(\"(\");\r\n sb.push(range.line.toString(10));\r\n sb.push(\",\");\r\n sb.push(range.column.toString(10));\r\n sb.push(\")\");\r\n }\r\n }\r\n return sb.join(\"\");\r\n}\r\n\r\n/** Formats the diagnostic context for the specified range, optionally with terminal colors. */\r\nexport function formatDiagnosticContext(range: Range, useColors: bool = false): string {\r\n var text = range.source.text;\r\n var len = text.length;\r\n var start = range.start;\r\n var end = range.end;\r\n while (start > 0 && !isLineBreak(text.charCodeAt(start - 1))) start--;\r\n while (end < len && !isLineBreak(text.charCodeAt(end))) end++;\r\n var sb: string[] = [\r\n \"\\n \",\r\n text.substring(start, end),\r\n \"\\n \"\r\n ];\r\n while (start < range.start) {\r\n sb.push(\" \");\r\n start++;\r\n }\r\n if (useColors) sb.push(COLOR_RED);\r\n if (range.start == range.end) {\r\n sb.push(\"^\");\r\n } else {\r\n while (start++ < range.end) {\r\n if (isLineBreak(text.charCodeAt(start))) {\r\n sb.push(start == range.start + 1 ? \"^\" : \"~\");\r\n break;\r\n }\r\n sb.push(\"~\");\r\n }\r\n }\r\n if (useColors) sb.push(COLOR_RESET);\r\n return sb.join(\"\");\r\n}\r\n\r\n/** Base class of all diagnostic emitters. */\r\nexport abstract class DiagnosticEmitter {\r\n\r\n /** Diagnostic messages emitted so far. */\r\n diagnostics: DiagnosticMessage[];\r\n\r\n /** Initializes this diagnostic emitter. */\r\n protected constructor(diagnostics: DiagnosticMessage[] | null = null) {\r\n this.diagnostics = diagnostics ? diagnostics : new Array();\r\n }\r\n\r\n /** Emits a diagnostic message of the specified category. */\r\n emitDiagnostic(\r\n code: DiagnosticCode,\r\n category: DiagnosticCategory,\r\n range: Range,\r\n relatedRange: Range | null,\r\n arg0: string | null = null,\r\n arg1: string | null = null,\r\n arg2: string | null = null\r\n ): void {\r\n var message = DiagnosticMessage.create(code, category, arg0, arg1, arg2).withRange(range);\r\n if (relatedRange) message.relatedRange = relatedRange;\r\n this.diagnostics.push(message);\r\n // console.log(formatDiagnosticMessage(message, true, true) + \"\\n\"); // temporary\r\n // console.log(new Error(\"stack\").stack);\r\n }\r\n\r\n /** Emits an informatory diagnostic message. */\r\n info(\r\n code: DiagnosticCode,\r\n range: Range,\r\n arg0: string | null = null,\r\n arg1: string | null = null,\r\n arg2: string | null = null\r\n ): void {\r\n this.emitDiagnostic(code, DiagnosticCategory.INFO, range, null, arg0, arg1, arg2);\r\n }\r\n\r\n /** Emits an informatory diagnostic message with a related range. */\r\n infoRelated(\r\n code: DiagnosticCode,\r\n range: Range,\r\n relatedRange: Range,\r\n arg0: string | null = null,\r\n arg1: string | null = null,\r\n arg2: string | null = null\r\n ): void {\r\n this.emitDiagnostic(code, DiagnosticCategory.INFO, range, relatedRange, arg0, arg1, arg2);\r\n }\r\n\r\n /** Emits a warning diagnostic message. */\r\n warning(\r\n code: DiagnosticCode,\r\n range: Range,\r\n arg0: string | null = null,\r\n arg1: string | null = null,\r\n arg2: string | null = null\r\n ): void {\r\n this.emitDiagnostic(code, DiagnosticCategory.WARNING, range, null, arg0, arg1, arg2);\r\n }\r\n\r\n /** Emits a warning diagnostic message with a related range. */\r\n warningRelated(\r\n code: DiagnosticCode,\r\n range: Range,\r\n relatedRange: Range,\r\n arg0: string | null = null,\r\n arg1: string | null = null,\r\n arg2: string | null = null\r\n ): void {\r\n this.emitDiagnostic(code, DiagnosticCategory.WARNING, range, relatedRange, arg0, arg1, arg2);\r\n }\r\n\r\n /** Emits an error diagnostic message. */\r\n error(\r\n code: DiagnosticCode,\r\n range: Range,\r\n arg0: string | null = null,\r\n arg1: string | null = null,\r\n arg2: string | null = null\r\n ): void {\r\n this.emitDiagnostic(code, DiagnosticCategory.ERROR, range, null, arg0, arg1, arg2);\r\n }\r\n\r\n /** Emits an error diagnostic message with a related range. */\r\n errorRelated(\r\n code: DiagnosticCode,\r\n range: Range,\r\n relatedRange: Range,\r\n arg0: string | null = null,\r\n arg1: string | null = null,\r\n arg2: string | null = null\r\n ): void {\r\n this.emitDiagnostic(code, DiagnosticCategory.ERROR, range, relatedRange, arg0, arg1, arg2);\r\n }\r\n}\r\n","/**\r\n * AssemblyScript's intermediate representation describing a program's elements.\r\n * @module program\r\n *//***/\r\n\r\nimport {\r\n CommonFlags,\r\n PATH_DELIMITER,\r\n STATIC_DELIMITER,\r\n INSTANCE_DELIMITER,\r\n GETTER_PREFIX,\r\n SETTER_PREFIX,\r\n INNER_DELIMITER,\r\n LIBRARY_SUBST,\r\n INDEX_SUFFIX,\r\n CommonSymbols,\r\n Feature,\r\n Target\r\n} from \"./common\";\r\n\r\nimport {\r\n Options\r\n} from \"./compiler\";\r\n\r\nimport {\r\n DiagnosticCode,\r\n DiagnosticMessage,\r\n DiagnosticEmitter\r\n} from \"./diagnostics\";\r\n\r\nimport {\r\n Type,\r\n TypeKind,\r\n TypeFlags,\r\n Signature\r\n} from \"./types\";\r\n\r\nimport {\r\n Node,\r\n NodeKind,\r\n Source,\r\n SourceKind,\r\n Range,\r\n DecoratorNode,\r\n DecoratorKind,\r\n SignatureNode,\r\n TypeParameterNode,\r\n CommonTypeNode,\r\n TypeNode,\r\n ArrowKind,\r\n\r\n Expression,\r\n IdentifierExpression,\r\n LiteralExpression,\r\n LiteralKind,\r\n StringLiteralExpression,\r\n\r\n Statement,\r\n ClassDeclaration,\r\n DeclarationStatement,\r\n EnumDeclaration,\r\n EnumValueDeclaration,\r\n ExportMember,\r\n ExportStatement,\r\n FieldDeclaration,\r\n FunctionDeclaration,\r\n ImportDeclaration,\r\n ImportStatement,\r\n InterfaceDeclaration,\r\n MethodDeclaration,\r\n NamespaceDeclaration,\r\n TypeDeclaration,\r\n VariableDeclaration,\r\n VariableLikeDeclarationStatement,\r\n VariableStatement,\r\n\r\n decoratorNameToKind,\r\n findDecorator,\r\n ExportDefaultStatement\r\n} from \"./ast\";\r\n\r\nimport {\r\n Module,\r\n FunctionRef\r\n} from \"./module\";\r\n\r\nimport {\r\n CharCode,\r\n writeI8,\r\n writeI16,\r\n writeI32,\r\n writeF32,\r\n writeF64\r\n} from \"./util\";\r\n\r\nimport {\r\n Resolver\r\n} from \"./resolver\";\r\n\r\nimport {\r\n Flow\r\n} from \"./flow\";\r\n\r\n/** Represents a yet unresolved `import`. */\r\nclass QueuedImport {\r\n constructor(\r\n /** File being imported into. */\r\n public localFile: File,\r\n /** Identifier within the local file. */\r\n public localIdentifier: IdentifierExpression,\r\n /** Identifier within the other file. Is an `import *` if not set. */\r\n public foreignIdentifier: IdentifierExpression | null,\r\n /** Path to the other file. */\r\n public foreignPath: string,\r\n /** Alternative path to the other file. */\r\n public foreignPathAlt: string\r\n ) {}\r\n}\r\n\r\n/** Represents a yet unresolved `export`. */\r\nclass QueuedExport {\r\n constructor(\r\n /** Identifier within the local file. */\r\n public localIdentifier: IdentifierExpression,\r\n /** Identifier within the other file. */\r\n public foreignIdentifier: IdentifierExpression,\r\n /** Path to the other file if a re-export. */\r\n public foreignPath: string | null,\r\n /** Alternative path to the other file if a re-export. */\r\n public foreignPathAlt: string | null\r\n ) {}\r\n}\r\n\r\n/** Represents a yet unresolved `export *`. */\r\nclass QueuedExportStar {\r\n // stored in a map with localFile as the key\r\n constructor(\r\n /** Path to the other file. */\r\n public foreignPath: string,\r\n /** Alternative path to the other file. */\r\n public foreignPathAlt: string,\r\n /** Reference to the path literal for reporting. */\r\n public pathLiteral: StringLiteralExpression\r\n ) {}\r\n}\r\n\r\n/** Represents the kind of an operator overload. */\r\nexport enum OperatorKind {\r\n INVALID,\r\n\r\n // indexed access\r\n INDEXED_GET, // a[]\r\n INDEXED_SET, // a[]=b\r\n UNCHECKED_INDEXED_GET, // unchecked(a[])\r\n UNCHECKED_INDEXED_SET, // unchecked(a[]=b)\r\n\r\n // binary\r\n ADD, // a + b\r\n SUB, // a - b\r\n MUL, // a * b\r\n DIV, // a / b\r\n REM, // a % b\r\n POW, // a ** b\r\n BITWISE_AND, // a & b\r\n BITWISE_OR, // a | b\r\n BITWISE_XOR, // a ^ b\r\n BITWISE_SHL, // a << b\r\n BITWISE_SHR, // a >> b\r\n BITWISE_SHR_U, // a >>> b\r\n EQ, // a == b\r\n NE, // a != b\r\n GT, // a > b\r\n GE, // a >= b\r\n LT, // a < b\r\n LE, // a <= b\r\n\r\n // unary prefix\r\n PLUS, // +a\r\n MINUS, // -a\r\n NOT, // !a\r\n BITWISE_NOT, // ~a\r\n PREFIX_INC, // ++a\r\n PREFIX_DEC, // --a\r\n\r\n // unary postfix\r\n POSTFIX_INC, // a++\r\n POSTFIX_DEC // a--\r\n\r\n // not overridable:\r\n // IDENTITY // a === b\r\n // LOGICAL_AND // a && b\r\n // LOGICAL_OR // a || b\r\n}\r\n\r\n/** Returns the operator kind represented by the specified decorator and string argument. */\r\nfunction operatorKindFromDecorator(decoratorKind: DecoratorKind, arg: string): OperatorKind {\r\n assert(arg.length);\r\n switch (decoratorKind) {\r\n case DecoratorKind.OPERATOR:\r\n case DecoratorKind.OPERATOR_BINARY: {\r\n switch (arg.charCodeAt(0)) {\r\n case CharCode.OPENBRACKET: {\r\n if (arg == \"[]\") return OperatorKind.INDEXED_GET;\r\n if (arg == \"[]=\") return OperatorKind.INDEXED_SET;\r\n break;\r\n }\r\n case CharCode.OPENBRACE: {\r\n if (arg == \"{}\") return OperatorKind.UNCHECKED_INDEXED_GET;\r\n if (arg == \"{}=\") return OperatorKind.UNCHECKED_INDEXED_SET;\r\n break;\r\n }\r\n case CharCode.PLUS: {\r\n if (arg == \"+\") return OperatorKind.ADD;\r\n break;\r\n }\r\n case CharCode.MINUS: {\r\n if (arg == \"-\") return OperatorKind.SUB;\r\n break;\r\n }\r\n case CharCode.ASTERISK: {\r\n if (arg == \"*\") return OperatorKind.MUL;\r\n if (arg == \"**\") return OperatorKind.POW;\r\n break;\r\n }\r\n case CharCode.SLASH: {\r\n if (arg == \"/\") return OperatorKind.DIV;\r\n break;\r\n }\r\n case CharCode.PERCENT: {\r\n if (arg == \"%\") return OperatorKind.REM;\r\n break;\r\n }\r\n case CharCode.AMPERSAND: {\r\n if (arg == \"&\") return OperatorKind.BITWISE_AND;\r\n break;\r\n }\r\n case CharCode.BAR: {\r\n if (arg == \"|\") return OperatorKind.BITWISE_OR;\r\n break;\r\n }\r\n case CharCode.CARET: {\r\n if (arg == \"^\") return OperatorKind.BITWISE_XOR;\r\n break;\r\n }\r\n case CharCode.EQUALS: {\r\n if (arg == \"==\") return OperatorKind.EQ;\r\n break;\r\n }\r\n case CharCode.EXCLAMATION: {\r\n if (arg == \"!=\") return OperatorKind.NE;\r\n break;\r\n }\r\n case CharCode.GREATERTHAN: {\r\n if (arg == \">\") return OperatorKind.GT;\r\n if (arg == \">=\") return OperatorKind.GE;\r\n if (arg == \">>\") return OperatorKind.BITWISE_SHR;\r\n if (arg == \">>>\") return OperatorKind.BITWISE_SHR_U;\r\n break;\r\n }\r\n case CharCode.LESSTHAN: {\r\n if (arg == \"<\") return OperatorKind.LT;\r\n if (arg == \"<=\") return OperatorKind.LE;\r\n if (arg == \"<<\") return OperatorKind.BITWISE_SHL;\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n case DecoratorKind.OPERATOR_PREFIX: {\r\n switch (arg.charCodeAt(0)) {\r\n case CharCode.PLUS: {\r\n if (arg == \"+\") return OperatorKind.PLUS;\r\n if (arg == \"++\") return OperatorKind.PREFIX_INC;\r\n break;\r\n }\r\n case CharCode.MINUS: {\r\n if (arg == \"-\") return OperatorKind.MINUS;\r\n if (arg == \"--\") return OperatorKind.PREFIX_DEC;\r\n break;\r\n }\r\n case CharCode.EXCLAMATION: {\r\n if (arg == \"!\") return OperatorKind.NOT;\r\n break;\r\n }\r\n case CharCode.TILDE: {\r\n if (arg == \"~\") return OperatorKind.BITWISE_NOT;\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n case DecoratorKind.OPERATOR_POSTFIX: {\r\n switch (arg.charCodeAt(0)) {\r\n case CharCode.PLUS: {\r\n if (arg == \"++\") return OperatorKind.POSTFIX_INC;\r\n break;\r\n }\r\n case CharCode.MINUS: {\r\n if (arg == \"--\") return OperatorKind.POSTFIX_DEC;\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n return OperatorKind.INVALID;\r\n}\r\n\r\n/** Represents an AssemblyScript program. */\r\nexport class Program extends DiagnosticEmitter {\r\n\r\n /** Resolver instance. */\r\n resolver: Resolver;\r\n /** Array of sources. */\r\n sources: Source[] = [];\r\n /** Diagnostic offset used where successively obtaining the next diagnostic. */\r\n diagnosticsOffset: i32 = 0;\r\n /** Compiler options. */\r\n options: Options;\r\n /** Special native code source. */\r\n nativeSource: Source;\r\n /** Special native code file. */\r\n nativeFile: File;\r\n\r\n // lookup maps\r\n\r\n /** Files by unique internal name. */\r\n filesByName: Map = new Map();\r\n /** Elements by unique internal name in element space. */\r\n elementsByName: Map = new Map();\r\n /** Elements by declaration. */\r\n elementsByDeclaration: Map = new Map();\r\n /** Element instances by unique internal name. */\r\n instancesByName: Map = new Map();\r\n /** Classes backing basic types like `i32`. */\r\n typeClasses: Map = new Map();\r\n /** Managed classes contained in the program, by id. */\r\n managedClasses: Map = new Map();\r\n\r\n // standard references\r\n\r\n /** ArrayBufferView reference. */\r\n arrayBufferViewInstance: Class;\r\n /** ArrayBuffer instance reference. */\r\n arrayBufferInstance: Class;\r\n /** Array prototype reference. */\r\n arrayPrototype: ClassPrototype;\r\n /** Set prototype reference. */\r\n setPrototype: ClassPrototype;\r\n /** Map prototype reference. */\r\n mapPrototype: ClassPrototype;\r\n /** Fixed array prototype reference. */\r\n fixedArrayPrototype: ClassPrototype;\r\n /** Int8Array prototype. */\r\n i8ArrayPrototype: ClassPrototype;\r\n /** Int16Array prototype. */\r\n i16ArrayPrototype: ClassPrototype;\r\n /** Int32Array prototype. */\r\n i32ArrayPrototype: ClassPrototype;\r\n /** Int64Array prototype. */\r\n i64ArrayPrototype: ClassPrototype;\r\n /** Uint8Array prototype. */\r\n u8ArrayPrototype: ClassPrototype;\r\n /** Uint8ClampedArray prototype. */\r\n u8ClampedArrayPrototype: ClassPrototype;\r\n /** Uint16Array prototype. */\r\n u16ArrayPrototype: ClassPrototype;\r\n /** Uint32Array prototype. */\r\n u32ArrayPrototype: ClassPrototype;\r\n /** Uint64Array prototype. */\r\n u64ArrayPrototype: ClassPrototype;\r\n /** Float32Array prototype. */\r\n f32ArrayPrototype: ClassPrototype;\r\n /** Float64Array prototype. */\r\n f64ArrayPrototype: ClassPrototype;\r\n /** String instance reference. */\r\n stringInstance: Class;\r\n /** Abort function reference, if present. */\r\n abortInstance: Function;\r\n\r\n // runtime references\r\n\r\n /** RT `__alloc(size: usize, id: u32): usize` */\r\n allocInstance: Function;\r\n /** RT `__realloc(ref: usize, newSize: usize): usize` */\r\n reallocInstance: Function;\r\n /** RT `__free(ref: usize): void` */\r\n freeInstance: Function;\r\n /** RT `__retain(ref: usize): usize` */\r\n retainInstance: Function;\r\n /** RT `__release(ref: usize): void` */\r\n releaseInstance: Function;\r\n /** RT `__collect(): void` */\r\n collectInstance: Function;\r\n /** RT `__visit(ref: usize, cookie: u32): void` */\r\n visitInstance: Function;\r\n /** RT `__typeinfo(id: u32): RTTIFlags` */\r\n typeinfoInstance: Function;\r\n /** RT `__instanceof(ref: usize, superId: u32): bool` */\r\n instanceofInstance: Function;\r\n /** RT `__allocArray(length: i32, alignLog2: usize, id: u32, data: usize = 0): usize` */\r\n allocArrayInstance: Function;\r\n\r\n /** Next class id. */\r\n nextClassId: u32 = 0;\r\n\r\n /** Constructs a new program, optionally inheriting parser diagnostics. */\r\n constructor(\r\n /** Shared array of diagnostic messages (emitted so far). */\r\n diagnostics: DiagnosticMessage[] | null = null\r\n ) {\r\n super(diagnostics);\r\n var nativeSource = new Source(LIBRARY_SUBST, \"[native code]\", SourceKind.LIBRARY);\r\n this.nativeSource = nativeSource;\r\n var nativeFile = new File(this, nativeSource);\r\n this.nativeFile = nativeFile;\r\n this.filesByName.set(nativeFile.internalName, nativeFile);\r\n this.resolver = new Resolver(this);\r\n }\r\n\r\n /** Writes a common runtime header to the specified buffer. */\r\n writeRuntimeHeader(buffer: Uint8Array, offset: i32, classInstance: Class, payloadSize: u32): void {\r\n // BLOCK {\r\n // mmInfo: usize // WASM64 TODO\r\n // gcInfo: u32\r\n // rtId: u32\r\n // rtSize: u32\r\n // }\r\n assert(payloadSize < (1 << 28)); // 1 bit BUFFERED + 3 bits color\r\n writeI32(payloadSize, buffer, offset);\r\n writeI32(1, buffer, offset + 4); // RC=1\r\n writeI32(classInstance.id, buffer, offset + 8);\r\n writeI32(payloadSize, buffer, offset + 12);\r\n }\r\n\r\n /** Gets the size of a runtime header. */\r\n get runtimeHeaderSize(): i32 {\r\n return 16;\r\n }\r\n\r\n /** Creates a native variable declaration. */\r\n makeNativeVariableDeclaration(\r\n /** The simple name of the variable */\r\n name: string,\r\n /** Flags indicating specific traits, e.g. `CONST`. */\r\n flags: CommonFlags = CommonFlags.NONE\r\n ): VariableDeclaration {\r\n var range = this.nativeSource.range;\r\n return Node.createVariableDeclaration(\r\n Node.createIdentifierExpression(name, range),\r\n null, null, null, flags, range\r\n );\r\n }\r\n\r\n /** Creates a native type declaration. */\r\n makeNativeTypeDeclaration(\r\n /** The simple name of the type. */\r\n name: string,\r\n /** Flags indicating specific traits, e.g. `GENERIC`. */\r\n flags: CommonFlags = CommonFlags.NONE\r\n ): TypeDeclaration {\r\n var range = this.nativeSource.range;\r\n var identifier = Node.createIdentifierExpression(name, range);\r\n return Node.createTypeDeclaration(\r\n identifier,\r\n null,\r\n Node.createOmittedType(range),\r\n null, flags, range\r\n );\r\n }\r\n\r\n // a dummy signature for programmatically generated native functions\r\n private nativeDummySignature: SignatureNode | null = null;\r\n\r\n /** Creates a native function declaration. */\r\n makeNativeFunctionDeclaration(\r\n /** The simple name of the function. */\r\n name: string,\r\n /** Flags indicating specific traits, e.g. `DECLARE`. */\r\n flags: CommonFlags = CommonFlags.NONE\r\n ): FunctionDeclaration {\r\n var range = this.nativeSource.range;\r\n return Node.createFunctionDeclaration(\r\n Node.createIdentifierExpression(name, range),\r\n null,\r\n this.nativeDummySignature || (this.nativeDummySignature = Node.createSignature([],\r\n Node.createType( // ^ AST signature doesn't really matter, is overridden anyway\r\n Node.createSimpleTypeName(CommonSymbols.void_, range),\r\n null, false, range\r\n ),\r\n null, false, range)\r\n ),\r\n null, null, flags, ArrowKind.NONE, range\r\n );\r\n }\r\n\r\n /** Creates a native namespace declaration. */\r\n makeNativeNamespaceDeclaration(\r\n /** The simple name of the namespace. */\r\n name: string,\r\n /** Flags indicating specific traits, e.g. `EXPORT`. */\r\n flags: CommonFlags = CommonFlags.NONE\r\n ): NamespaceDeclaration {\r\n var range = this.nativeSource.range;\r\n return Node.createNamespaceDeclaration(\r\n Node.createIdentifierExpression(name, range),\r\n [], null, flags, range\r\n );\r\n }\r\n\r\n /** Creates a native function. */\r\n makeNativeFunction(\r\n /** The simple name of the function. */\r\n name: string,\r\n /** Concrete function signature. */\r\n signature: Signature,\r\n /** Parent element, usually a file, class or namespace. */\r\n parent: Element = this.nativeFile,\r\n /** Flags indicating specific traits, e.g. `GENERIC`. */\r\n flags: CommonFlags = CommonFlags.NONE,\r\n /** Decorator flags representing built-in decorators. */\r\n decoratorFlags: DecoratorFlags = DecoratorFlags.NONE\r\n ): Function {\r\n return new Function(\r\n name,\r\n new FunctionPrototype(\r\n name,\r\n parent,\r\n this.makeNativeFunctionDeclaration(name, flags),\r\n decoratorFlags\r\n ),\r\n signature\r\n );\r\n }\r\n\r\n /** Gets the (possibly merged) program element linked to the specified declaration. */\r\n getElementByDeclaration(declaration: DeclarationStatement): DeclaredElement {\r\n var elementsByDeclaration = this.elementsByDeclaration;\r\n assert(elementsByDeclaration.has(declaration));\r\n return elementsByDeclaration.get(declaration)!;\r\n }\r\n\r\n /** Initializes the program and its elements prior to compilation. */\r\n initialize(options: Options): void {\r\n this.options = options;\r\n\r\n // register native types\r\n this.registerNativeType(CommonSymbols.i8, Type.i8);\r\n this.registerNativeType(CommonSymbols.i16, Type.i16);\r\n this.registerNativeType(CommonSymbols.i32, Type.i32);\r\n this.registerNativeType(CommonSymbols.i64, Type.i64);\r\n this.registerNativeType(CommonSymbols.isize, options.isizeType);\r\n this.registerNativeType(CommonSymbols.u8, Type.u8);\r\n this.registerNativeType(CommonSymbols.u16, Type.u16);\r\n this.registerNativeType(CommonSymbols.u32, Type.u32);\r\n this.registerNativeType(CommonSymbols.u64, Type.u64);\r\n this.registerNativeType(CommonSymbols.usize, options.usizeType);\r\n this.registerNativeType(CommonSymbols.bool, Type.bool);\r\n this.registerNativeType(CommonSymbols.f32, Type.f32);\r\n this.registerNativeType(CommonSymbols.f64, Type.f64);\r\n this.registerNativeType(CommonSymbols.void_, Type.void);\r\n this.registerNativeType(CommonSymbols.number, Type.f64); // alias\r\n this.registerNativeType(CommonSymbols.boolean, Type.bool); // alias\r\n this.nativeFile.add(CommonSymbols.native, new TypeDefinition(\r\n CommonSymbols.native,\r\n this.nativeFile,\r\n this.makeNativeTypeDeclaration(CommonSymbols.native, CommonFlags.EXPORT | CommonFlags.GENERIC),\r\n DecoratorFlags.BUILTIN\r\n ));\r\n if (options.hasFeature(Feature.SIMD)) this.registerNativeType(CommonSymbols.v128, Type.v128);\r\n\r\n // register compiler hints\r\n this.registerConstantInteger(CommonSymbols.ASC_TARGET, Type.i32,\r\n i64_new(options.isWasm64 ? Target.WASM64 : Target.WASM32));\r\n this.registerConstantInteger(CommonSymbols.ASC_NO_ASSERT, Type.bool,\r\n i64_new(options.noAssert ? 1 : 0, 0));\r\n this.registerConstantInteger(CommonSymbols.ASC_MEMORY_BASE, Type.i32,\r\n i64_new(options.memoryBase, 0));\r\n this.registerConstantInteger(CommonSymbols.ASC_OPTIMIZE_LEVEL, Type.i32,\r\n i64_new(options.optimizeLevelHint, 0));\r\n this.registerConstantInteger(CommonSymbols.ASC_SHRINK_LEVEL, Type.i32,\r\n i64_new(options.shrinkLevelHint, 0));\r\n this.registerConstantInteger(CommonSymbols.ASC_FEATURE_MUTABLE_GLOBAL, Type.bool,\r\n i64_new(options.hasFeature(Feature.MUTABLE_GLOBAL) ? 1 : 0, 0));\r\n this.registerConstantInteger(CommonSymbols.ASC_FEATURE_SIGN_EXTENSION, Type.bool,\r\n i64_new(options.hasFeature(Feature.SIGN_EXTENSION) ? 1 : 0, 0));\r\n this.registerConstantInteger(CommonSymbols.ASC_FEATURE_BULK_MEMORY, Type.bool,\r\n i64_new(options.hasFeature(Feature.BULK_MEMORY) ? 1 : 0, 0));\r\n this.registerConstantInteger(CommonSymbols.ASC_FEATURE_SIMD, Type.bool,\r\n i64_new(options.hasFeature(Feature.SIMD) ? 1 : 0, 0));\r\n this.registerConstantInteger(CommonSymbols.ASC_FEATURE_THREADS, Type.bool,\r\n i64_new(options.hasFeature(Feature.THREADS) ? 1 : 0, 0));\r\n\r\n // remember deferred elements\r\n var queuedImports = new Array();\r\n var queuedExports = new Map>();\r\n var queuedExportsStar = new Map();\r\n var queuedExtends = new Array();\r\n var queuedImplements = new Array();\r\n\r\n // initialize relevant declaration-like statements of the entire program\r\n for (let i = 0, k = this.sources.length; i < k; ++i) {\r\n let source = this.sources[i];\r\n let file = new File(this, source);\r\n this.filesByName.set(file.internalName, file);\r\n let statements = source.statements;\r\n for (let j = 0, l = statements.length; j < l; ++j) {\r\n let statement = statements[j];\r\n switch (statement.kind) {\r\n case NodeKind.EXPORT: {\r\n this.initializeExports(statement, file, queuedExports, queuedExportsStar);\r\n break;\r\n }\r\n case NodeKind.EXPORTDEFAULT: {\r\n this.initializeExportDefault(statement, file, queuedExtends, queuedImplements);\r\n break;\r\n }\r\n case NodeKind.IMPORT: {\r\n this.initializeImports(statement, file, queuedImports, queuedExports);\r\n break;\r\n }\r\n case NodeKind.VARIABLE: {\r\n this.initializeVariables(statement, file);\r\n break;\r\n }\r\n case NodeKind.CLASSDECLARATION: {\r\n this.initializeClass(statement, file, queuedExtends, queuedImplements);\r\n break;\r\n }\r\n case NodeKind.ENUMDECLARATION: {\r\n this.initializeEnum(statement, file);\r\n break;\r\n }\r\n case NodeKind.FUNCTIONDECLARATION: {\r\n this.initializeFunction(statement, file);\r\n break;\r\n }\r\n case NodeKind.INTERFACEDECLARATION: {\r\n this.initializeInterface(statement, file);\r\n break;\r\n }\r\n case NodeKind.NAMESPACEDECLARATION: {\r\n this.initializeNamespace(statement, file, queuedExtends, queuedImplements);\r\n break;\r\n }\r\n case NodeKind.TYPEDECLARATION: {\r\n this.initializeTypeDefinition(statement, file);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // queued exports * should be linkable now that all files have been processed\r\n for (let [file, exportsStar] of queuedExportsStar) {\r\n for (let i = 0, k = exportsStar.length; i < k; ++i) {\r\n let exportStar = exportsStar[i];\r\n let foreignFile = this.lookupForeignFile(exportStar.foreignPath, exportStar.foreignPathAlt);\r\n if (!foreignFile) {\r\n this.error(\r\n DiagnosticCode.File_0_not_found,\r\n exportStar.pathLiteral.range, exportStar.pathLiteral.value\r\n );\r\n continue;\r\n }\r\n file.ensureExportStar(foreignFile);\r\n }\r\n }\r\n\r\n // queued imports should be resolvable now through traversing exports and queued exports\r\n for (let i = 0, k = queuedImports.length; i < k; ++i) {\r\n let queuedImport = queuedImports[i];\r\n let foreignIdentifier = queuedImport.foreignIdentifier;\r\n if (foreignIdentifier) { // i.e. import { foo [as bar] } from \"./baz\"\r\n let element = this.lookupForeign(\r\n foreignIdentifier.text,\r\n queuedImport.foreignPath,\r\n queuedImport.foreignPathAlt,\r\n queuedExports\r\n );\r\n if (element) {\r\n queuedImport.localFile.add(\r\n queuedImport.localIdentifier.text,\r\n element,\r\n true // isImport\r\n );\r\n } else {\r\n // FIXME: file not found is not reported if this happens?\r\n this.error(\r\n DiagnosticCode.Module_0_has_no_exported_member_1,\r\n foreignIdentifier.range, queuedImport.foreignPath, foreignIdentifier.text\r\n );\r\n }\r\n } else { // i.e. import * as bar from \"./bar\"\r\n let foreignFile = this.lookupForeignFile(queuedImport.foreignPath, queuedImport.foreignPathAlt);\r\n if (foreignFile) {\r\n let localFile = queuedImport.localFile;\r\n let localName = queuedImport.localIdentifier.text;\r\n localFile.add(\r\n localName,\r\n foreignFile.asImportedNamespace(\r\n localName,\r\n localFile\r\n ),\r\n true // isImport\r\n );\r\n } else {\r\n assert(false); // already reported by the parser not finding the file\r\n }\r\n }\r\n }\r\n\r\n // queued exports should be resolvable now that imports are finalized\r\n for (let [file, exports] of queuedExports) {\r\n for (let [exportName, queuedExport] of exports) {\r\n let localName = queuedExport.localIdentifier.text;\r\n let foreignPath = queuedExport.foreignPath;\r\n if (foreignPath) { // i.e. export { foo [as bar] } from \"./baz\"\r\n let element = this.lookupForeign(\r\n localName,\r\n foreignPath,\r\n assert(queuedExport.foreignPathAlt), // must be set if foreignPath is\r\n queuedExports\r\n );\r\n if (element) {\r\n file.ensureExport(exportName, element);\r\n } else {\r\n this.error(\r\n DiagnosticCode.Module_0_has_no_exported_member_1,\r\n queuedExport.localIdentifier.range,\r\n foreignPath, localName\r\n );\r\n }\r\n } else { // i.e. export { foo [as bar] }\r\n let element = file.lookupInSelf(localName);\r\n if (element) {\r\n file.ensureExport(exportName, element);\r\n } else {\r\n let globalElement = this.lookupGlobal(localName);\r\n if (globalElement && globalElement instanceof DeclaredElement) { // export { memory }\r\n file.ensureExport(exportName, globalElement);\r\n } else {\r\n this.error(\r\n DiagnosticCode.Module_0_has_no_exported_member_1,\r\n queuedExport.foreignIdentifier.range,\r\n file.internalName, queuedExport.foreignIdentifier.text\r\n );\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n // register ArrayBuffer (id=0), String (id=1), ArrayBufferView (id=2)\r\n assert(this.nextClassId == 0);\r\n this.arrayBufferInstance = this.requireClass(CommonSymbols.ArrayBuffer);\r\n assert(this.arrayBufferInstance.id == 0);\r\n this.stringInstance = this.requireClass(CommonSymbols.String);\r\n assert(this.stringInstance.id == 1);\r\n this.arrayBufferViewInstance = this.requireClass(CommonSymbols.ArrayBufferView);\r\n assert(this.arrayBufferViewInstance.id == 2);\r\n\r\n // register classes backing basic types\r\n this.registerNativeTypeClass(TypeKind.I8, CommonSymbols.I8);\r\n this.registerNativeTypeClass(TypeKind.I16, CommonSymbols.I16);\r\n this.registerNativeTypeClass(TypeKind.I32, CommonSymbols.I32);\r\n this.registerNativeTypeClass(TypeKind.I64, CommonSymbols.I64);\r\n this.registerNativeTypeClass(TypeKind.ISIZE, CommonSymbols.Isize);\r\n this.registerNativeTypeClass(TypeKind.U8, CommonSymbols.U8);\r\n this.registerNativeTypeClass(TypeKind.U16, CommonSymbols.U16);\r\n this.registerNativeTypeClass(TypeKind.U32, CommonSymbols.U32);\r\n this.registerNativeTypeClass(TypeKind.U64, CommonSymbols.U64);\r\n this.registerNativeTypeClass(TypeKind.USIZE, CommonSymbols.Usize);\r\n this.registerNativeTypeClass(TypeKind.BOOL, CommonSymbols.Bool);\r\n this.registerNativeTypeClass(TypeKind.F32, CommonSymbols.F32);\r\n this.registerNativeTypeClass(TypeKind.F64, CommonSymbols.F64);\r\n if (options.hasFeature(Feature.SIMD)) this.registerNativeTypeClass(TypeKind.V128, CommonSymbols.V128);\r\n\r\n // register views but don't instantiate them yet\r\n this.i8ArrayPrototype = this.require(CommonSymbols.Int8Array, ElementKind.CLASS_PROTOTYPE);\r\n this.i16ArrayPrototype = this.require(CommonSymbols.Int16Array, ElementKind.CLASS_PROTOTYPE);\r\n this.i32ArrayPrototype = this.require(CommonSymbols.Int32Array, ElementKind.CLASS_PROTOTYPE);\r\n this.i64ArrayPrototype = this.require(CommonSymbols.Int64Array, ElementKind.CLASS_PROTOTYPE);\r\n this.u8ArrayPrototype = this.require(CommonSymbols.Uint8Array, ElementKind.CLASS_PROTOTYPE);\r\n this.u8ClampedArrayPrototype = this.require(CommonSymbols.Uint8ClampedArray, ElementKind.CLASS_PROTOTYPE);\r\n this.u16ArrayPrototype = this.require(CommonSymbols.Uint16Array, ElementKind.CLASS_PROTOTYPE);\r\n this.u32ArrayPrototype = this.require(CommonSymbols.Uint32Array, ElementKind.CLASS_PROTOTYPE);\r\n this.u64ArrayPrototype = this.require(CommonSymbols.Uint64Array, ElementKind.CLASS_PROTOTYPE);\r\n this.f32ArrayPrototype = this.require(CommonSymbols.Float32Array, ElementKind.CLASS_PROTOTYPE);\r\n this.f64ArrayPrototype = this.require(CommonSymbols.Float64Array, ElementKind.CLASS_PROTOTYPE);\r\n\r\n // resolve base prototypes of derived classes\r\n var resolver = this.resolver;\r\n for (let i = 0, k = queuedExtends.length; i < k; ++i) {\r\n let thisPrototype = queuedExtends[i];\r\n let extendsNode = assert(thisPrototype.extendsNode); // must be present if in queuedExtends\r\n let baseElement = resolver.resolveTypeName(extendsNode.name, thisPrototype.parent); // reports\r\n if (!baseElement) continue;\r\n if (baseElement.kind == ElementKind.CLASS_PROTOTYPE) {\r\n let basePrototype = baseElement;\r\n if (basePrototype.hasDecorator(DecoratorFlags.SEALED)) {\r\n this.error(\r\n DiagnosticCode.Class_0_is_sealed_and_cannot_be_extended,\r\n extendsNode.range, (baseElement).identifierNode.text\r\n );\r\n }\r\n if (\r\n basePrototype.hasDecorator(DecoratorFlags.UNMANAGED) !=\r\n thisPrototype.hasDecorator(DecoratorFlags.UNMANAGED)\r\n ) {\r\n this.error(\r\n DiagnosticCode.Unmanaged_classes_cannot_extend_managed_classes_and_vice_versa,\r\n Range.join(thisPrototype.identifierNode.range, extendsNode.range)\r\n );\r\n }\r\n thisPrototype.basePrototype = basePrototype;\r\n } else {\r\n this.error(\r\n DiagnosticCode.A_class_may_only_extend_another_class,\r\n extendsNode.range\r\n );\r\n }\r\n }\r\n\r\n // set up global aliases\r\n {\r\n let globalAliases = options.globalAliases;\r\n if (globalAliases) {\r\n for (let [alias, name] of globalAliases) {\r\n if (!name.length) continue; // explicitly disabled\r\n let firstChar = name.charCodeAt(0);\r\n if (firstChar >= CharCode._0 && firstChar <= CharCode._9) {\r\n this.registerConstantInteger(alias, Type.i32, i64_new(parseI32(name, 10)));\r\n } else {\r\n let elementsByName = this.elementsByName;\r\n let element = elementsByName.get(name);\r\n if (element) {\r\n if (elementsByName.has(alias)) throw new Error(\"duplicate global element: \" + name);\r\n elementsByName.set(alias, element);\r\n }\r\n else throw new Error(\"no such global element: \" + name);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // register stdlib components\r\n this.arrayPrototype = this.require(CommonSymbols.Array, ElementKind.CLASS_PROTOTYPE);\r\n this.fixedArrayPrototype = this.require(CommonSymbols.FixedArray, ElementKind.CLASS_PROTOTYPE);\r\n this.setPrototype = this.require(CommonSymbols.Set, ElementKind.CLASS_PROTOTYPE);\r\n this.mapPrototype = this.require(CommonSymbols.Map, ElementKind.CLASS_PROTOTYPE);\r\n this.abortInstance = this.requireFunction(CommonSymbols.abort);\r\n this.allocInstance = this.requireFunction(CommonSymbols.alloc);\r\n this.reallocInstance = this.requireFunction(CommonSymbols.realloc);\r\n this.freeInstance = this.requireFunction(CommonSymbols.free);\r\n this.retainInstance = this.requireFunction(CommonSymbols.retain);\r\n this.releaseInstance = this.requireFunction(CommonSymbols.release);\r\n this.collectInstance = this.requireFunction(CommonSymbols.collect);\r\n this.typeinfoInstance = this.requireFunction(CommonSymbols.typeinfo);\r\n this.instanceofInstance = this.requireFunction(CommonSymbols.instanceof_);\r\n this.visitInstance = this.requireFunction(CommonSymbols.visit);\r\n this.allocArrayInstance = this.requireFunction(CommonSymbols.allocArray);\r\n\r\n // mark module exports, i.e. to apply proper wrapping behavior on the boundaries\r\n for (let file of this.filesByName.values()) {\r\n let exports = file.exports;\r\n if (!(file.source.isEntry && exports)) continue;\r\n for (let element of exports.values()) this.markModuleExport(element);\r\n }\r\n }\r\n\r\n /** Requires that a global library element of the specified kind is present and returns it. */\r\n private require(name: string, kind: ElementKind): Element {\r\n var element = this.lookupGlobal(name);\r\n if (!element) throw new Error(\"missing \" + name);\r\n if (element.kind != kind) throw new Error(\"unexpected \" + name);\r\n return element;\r\n }\r\n\r\n /** Requires that a non-generic global class is present and returns it. */\r\n private requireClass(name: string): Class {\r\n var prototype = this.require(name, ElementKind.CLASS_PROTOTYPE);\r\n var resolved = this.resolver.resolveClass(prototype, null);\r\n if (!resolved) throw new Error(\"invalid \" + name);\r\n return resolved;\r\n }\r\n\r\n /** Requires that a non-generic global function is present and returns it. */\r\n private requireFunction(name: string): Function {\r\n var prototype = this.require(name, ElementKind.FUNCTION_PROTOTYPE);\r\n var resolved = this.resolver.resolveFunction(prototype, null);\r\n if (!resolved) throw new Error(\"invalid \" + name);\r\n return resolved;\r\n }\r\n\r\n /** Marks an element and its children as a module export. */\r\n private markModuleExport(element: Element): void {\r\n element.set(CommonFlags.MODULE_EXPORT);\r\n switch (element.kind) {\r\n case ElementKind.CLASS_PROTOTYPE: {\r\n let instanceMembers = (element).instanceMembers;\r\n if (instanceMembers) for (let member of instanceMembers.values()) this.markModuleExport(member);\r\n break;\r\n }\r\n case ElementKind.PROPERTY_PROTOTYPE: {\r\n let getterPrototype = (element).getterPrototype;\r\n if (getterPrototype) this.markModuleExport(getterPrototype);\r\n let setterPrototype = (element).setterPrototype;\r\n if (setterPrototype) this.markModuleExport(setterPrototype);\r\n break;\r\n }\r\n case ElementKind.PROPERTY:\r\n case ElementKind.FUNCTION:\r\n case ElementKind.FIELD:\r\n case ElementKind.CLASS: assert(false); // assumes that there are no instances yet\r\n }\r\n {\r\n let members = element.members;\r\n if (members) for (let member of members.values()) this.markModuleExport(member);\r\n }\r\n }\r\n\r\n /** Registers a native type with the program. */\r\n private registerNativeType(name: string, type: Type): void {\r\n var element = new TypeDefinition(\r\n name,\r\n this.nativeFile,\r\n this.makeNativeTypeDeclaration(name, CommonFlags.EXPORT),\r\n DecoratorFlags.BUILTIN\r\n );\r\n element.setType(type);\r\n this.nativeFile.add(name, element);\r\n }\r\n\r\n /** Registers the backing class of a native type. */\r\n private registerNativeTypeClass(typeKind: TypeKind, className: string): void {\r\n assert(!this.typeClasses.has(typeKind));\r\n var element = this.lookupGlobal(className);\r\n if (element) {\r\n assert(element.kind == ElementKind.CLASS_PROTOTYPE);\r\n let classElement = this.resolver.resolveClass(element, null);\r\n if (classElement) this.typeClasses.set(typeKind, classElement);\r\n }\r\n }\r\n\r\n /** Registers a constant integer value within the global scope. */\r\n private registerConstantInteger(name: string, type: Type, value: I64): void {\r\n assert(type.is(TypeFlags.INTEGER)); // must be an integer type\r\n var global = new Global(\r\n name,\r\n this.nativeFile,\r\n DecoratorFlags.NONE,\r\n this.makeNativeVariableDeclaration(name, CommonFlags.CONST | CommonFlags.EXPORT)\r\n );\r\n global.setConstantIntegerValue(value, type);\r\n this.nativeFile.add(name, global);\r\n }\r\n\r\n /** Registers a constant float value within the global scope. */\r\n private registerConstantFloat(name: string, type: Type, value: f64): void {\r\n assert(type.is(TypeFlags.FLOAT)); // must be a float type\r\n var global = new Global(\r\n name,\r\n this.nativeFile,\r\n DecoratorFlags.NONE,\r\n this.makeNativeVariableDeclaration(name, CommonFlags.CONST | CommonFlags.EXPORT)\r\n );\r\n global.setConstantFloatValue(value, type);\r\n this.nativeFile.add(name, global);\r\n }\r\n\r\n /** Ensures that the given global element exists. Attempts to merge duplicates. */\r\n ensureGlobal(name: string, element: DeclaredElement): DeclaredElement {\r\n var elementsByName = this.elementsByName;\r\n if (elementsByName.has(name)) {\r\n let actual = elementsByName.get(name)!;\r\n // NOTE: this is effectively only performed when merging native types with\r\n // their respective namespaces in std/builtins, but can also trigger when a\r\n // user has multiple global elements of the same name in different files,\r\n // which might result in unexpected shared symbols accross files. considering\r\n // this a wonky feature for now that we might want to revisit later.\r\n if (actual !== element) {\r\n let merged = tryMerge(elementsByName.get(name)!, element);\r\n if (!merged) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n element.identifierNode.range, name\r\n );\r\n return element;\r\n }\r\n element = merged;\r\n }\r\n }\r\n elementsByName.set(name, element);\r\n return element;\r\n }\r\n\r\n /** Looks up the element of the specified name in the global scope. */\r\n lookupGlobal(name: string): Element | null {\r\n var elements = this.elementsByName;\r\n if (elements.has(name)) return elements.get(name);\r\n return null;\r\n }\r\n\r\n /** Looks up the element of the specified name in the global scope. Errors if not present. */\r\n requireGlobal(name: string): Element {\r\n var elements = this.elementsByName;\r\n if (elements.has(name)) return elements.get(name)!;\r\n throw new Error(\"missing global\");\r\n }\r\n\r\n /** Tries to locate a foreign file given its normalized path. */\r\n private lookupForeignFile(\r\n /** Normalized path to the other file. */\r\n foreignPath: string,\r\n /** Alternative normalized path to the other file. */\r\n foreignPathAlt: string\r\n ): File | null {\r\n var filesByName = this.filesByName;\r\n return filesByName.has(foreignPath)\r\n ? filesByName.get(foreignPath)!\r\n : filesByName.has(foreignPathAlt)\r\n ? filesByName.get(foreignPathAlt)!\r\n : null;\r\n }\r\n\r\n /** Tries to locate a foreign element by traversing exports and queued exports. */\r\n private lookupForeign(\r\n /** Identifier within the other file. */\r\n foreignName: string,\r\n /** Normalized path to the other file. */\r\n foreignPath: string,\r\n /** Alternative normalized path to the other file. */\r\n foreignPathAlt: string,\r\n /** So far queued exports. */\r\n queuedExports: Map>\r\n ): DeclaredElement | null {\r\n do {\r\n let foreignFile = this.lookupForeignFile(foreignPath, foreignPathAlt);\r\n if (!foreignFile) return null; // no such file\r\n\r\n // search already resolved exports\r\n let element = foreignFile.lookupExport(foreignName);\r\n if (element) return element;\r\n\r\n // otherwise traverse queued exports\r\n if (queuedExports.has(foreignFile)) {\r\n let fileQueuedExports = queuedExports.get(foreignFile)!;\r\n if (fileQueuedExports.has(foreignName)) {\r\n let queuedExport = fileQueuedExports.get(foreignName)!;\r\n if (queuedExport.foreignPath) { // imported from another file\r\n foreignName = queuedExport.localIdentifier.text;\r\n foreignPath = queuedExport.foreignPath;\r\n foreignPathAlt = assert(queuedExport.foreignPathAlt);\r\n continue;\r\n } else { // local element of this file\r\n element = foreignFile.lookupInSelf(queuedExport.localIdentifier.text);\r\n if (element) return element;\r\n }\r\n }\r\n }\r\n break;\r\n } while (true);\r\n return null;\r\n }\r\n\r\n /** Validates that only supported decorators are present. */\r\n private checkDecorators(\r\n /** Decorators present on an element. */\r\n decorators: DecoratorNode[] | null,\r\n /** Accepted decorator flags. Emits diagnostics if any other decorators are present. */\r\n acceptedFlags: DecoratorFlags\r\n ): DecoratorFlags {\r\n var flags = DecoratorFlags.NONE;\r\n if (decorators) {\r\n for (let i = 0, k = decorators.length; i < k; ++i) {\r\n let decorator = decorators[i];\r\n let kind = decoratorNameToKind(decorator.name);\r\n let flag = decoratorKindToFlag(kind);\r\n if (flag) {\r\n if (flag == DecoratorFlags.BUILTIN) {\r\n if (!(acceptedFlags & flag) && !decorator.range.source.isLibrary) {\r\n this.error(\r\n DiagnosticCode.Decorator_0_is_not_valid_here,\r\n decorator.range, decorator.name.range.toString()\r\n );\r\n } else {\r\n flags |= flag;\r\n }\r\n } else if (!(acceptedFlags & flag)) {\r\n this.error(\r\n DiagnosticCode.Decorator_0_is_not_valid_here,\r\n decorator.range, decorator.name.range.toString()\r\n );\r\n } else if (flags & flag) {\r\n this.error(\r\n DiagnosticCode.Duplicate_decorator,\r\n decorator.range, decorator.name.range.toString()\r\n );\r\n } else {\r\n flags |= flag;\r\n }\r\n }\r\n }\r\n }\r\n return flags;\r\n }\r\n\r\n /** Initializes a class declaration. */\r\n private initializeClass(\r\n /** The declaration to initialize. */\r\n declaration: ClassDeclaration,\r\n /** Parent element, usually a file or namespace. */\r\n parent: Element,\r\n /** So far queued `extends` clauses. */\r\n queuedExtends: ClassPrototype[],\r\n /** So far queued `implements` clauses. */\r\n queuedImplements: ClassPrototype[]\r\n ): ClassPrototype | null {\r\n var name = declaration.name.text;\r\n var element = new ClassPrototype(\r\n name,\r\n parent,\r\n declaration,\r\n this.checkDecorators(declaration.decorators,\r\n DecoratorFlags.GLOBAL |\r\n DecoratorFlags.SEALED |\r\n DecoratorFlags.UNMANAGED\r\n )\r\n );\r\n if (!parent.add(name, element)) return null;\r\n\r\n var implementsTypes = declaration.implementsTypes;\r\n if (implementsTypes) {\r\n let numImplementsTypes = implementsTypes.length;\r\n // cannot implement interfaces when unmanaged\r\n if (element.hasDecorator(DecoratorFlags.UNMANAGED)) {\r\n if (numImplementsTypes) {\r\n this.error(\r\n DiagnosticCode.Unmanaged_classes_cannot_implement_interfaces,\r\n Range.join(\r\n declaration.name.range,\r\n implementsTypes[numImplementsTypes - 1].range\r\n )\r\n );\r\n }\r\n } else if (numImplementsTypes) {\r\n // remember classes that implement interfaces\r\n for (let i = 0; i < numImplementsTypes; ++i) {\r\n this.warning( // TODO: not yet supported\r\n DiagnosticCode.Operation_not_supported,\r\n implementsTypes[i].range\r\n );\r\n }\r\n queuedImplements.push(element);\r\n }\r\n }\r\n // remember classes that extend another class\r\n if (declaration.extendsType) queuedExtends.push(element);\r\n\r\n // initialize members\r\n var memberDeclarations = declaration.members;\r\n for (let i = 0, k = memberDeclarations.length; i < k; ++i) {\r\n let memberDeclaration = memberDeclarations[i];\r\n switch (memberDeclaration.kind) {\r\n case NodeKind.FIELDDECLARATION: {\r\n this.initializeField(memberDeclaration, element);\r\n break;\r\n }\r\n case NodeKind.METHODDECLARATION: {\r\n if (memberDeclaration.isAny(CommonFlags.GET | CommonFlags.SET)) {\r\n this.initializeProperty(memberDeclaration, element);\r\n } else {\r\n this.initializeMethod(memberDeclaration, element);\r\n }\r\n break;\r\n }\r\n case NodeKind.INDEXSIGNATUREDECLARATION: break; // ignored for now\r\n default: assert(false); // class member expected\r\n }\r\n }\r\n return element;\r\n }\r\n\r\n /** Initializes a field of a class or interface. */\r\n private initializeField(\r\n /** The declaration to initialize. */\r\n declaration: FieldDeclaration,\r\n /** Parent class. */\r\n parent: ClassPrototype\r\n ): void {\r\n var name = declaration.name.text;\r\n var decorators = declaration.decorators;\r\n var element: DeclaredElement;\r\n if (declaration.is(CommonFlags.STATIC)) { // global variable\r\n assert(parent.kind != ElementKind.INTERFACE_PROTOTYPE);\r\n element = new Global(\r\n name,\r\n parent,\r\n this.checkDecorators(decorators,\r\n (declaration.is(CommonFlags.READONLY)\r\n ? DecoratorFlags.INLINE\r\n : DecoratorFlags.NONE\r\n ) | DecoratorFlags.LAZY | DecoratorFlags.UNSAFE\r\n ),\r\n declaration\r\n );\r\n if (!parent.add(name, element)) return;\r\n } else { // actual instance field\r\n assert(!declaration.isAny(CommonFlags.ABSTRACT | CommonFlags.GET | CommonFlags.SET));\r\n element = new FieldPrototype(\r\n name,\r\n parent,\r\n declaration,\r\n this.checkDecorators(decorators, DecoratorFlags.UNSAFE)\r\n );\r\n if (!parent.addInstance(name, element)) return;\r\n }\r\n }\r\n\r\n /** Initializes a method of a class or interface. */\r\n private initializeMethod(\r\n /** The declaration to initialize. */\r\n declaration: MethodDeclaration,\r\n /** Parent class. */\r\n parent: ClassPrototype\r\n ): void {\r\n var name = declaration.name.text;\r\n var isStatic = declaration.is(CommonFlags.STATIC);\r\n var acceptedFlags = DecoratorFlags.INLINE | DecoratorFlags.UNSAFE;\r\n if (!declaration.is(CommonFlags.GENERIC)) {\r\n acceptedFlags |= DecoratorFlags.OPERATOR_BINARY\r\n | DecoratorFlags.OPERATOR_PREFIX\r\n | DecoratorFlags.OPERATOR_POSTFIX;\r\n }\r\n var element = new FunctionPrototype(\r\n name,\r\n parent,\r\n declaration,\r\n this.checkDecorators(declaration.decorators, acceptedFlags)\r\n );\r\n if (isStatic) { // global function\r\n assert(declaration.name.kind != NodeKind.CONSTRUCTOR);\r\n if (!parent.add(name, element)) return;\r\n } else { // actual instance method\r\n if (!parent.addInstance(name, element)) return;\r\n }\r\n this.checkOperatorOverloads(declaration.decorators, element, parent);\r\n }\r\n\r\n /** Checks that operator overloads are generally valid, if present. */\r\n private checkOperatorOverloads(\r\n /** Decorators to check. */\r\n decorators: DecoratorNode[] | null,\r\n /** Decorated method. */\r\n prototype: FunctionPrototype,\r\n /** Parent class. */\r\n classPrototype: ClassPrototype\r\n ): void {\r\n if (decorators) {\r\n for (let i = 0, k = decorators.length; i < k; ++i) {\r\n let decorator = decorators[i];\r\n switch (decorator.decoratorKind) {\r\n case DecoratorKind.OPERATOR:\r\n case DecoratorKind.OPERATOR_BINARY:\r\n case DecoratorKind.OPERATOR_PREFIX:\r\n case DecoratorKind.OPERATOR_POSTFIX: {\r\n let numArgs = decorator.arguments && decorator.arguments.length || 0;\r\n if (numArgs == 1) {\r\n let firstArg = (decorator.arguments)[0];\r\n if (\r\n firstArg.kind == NodeKind.LITERAL &&\r\n (firstArg).literalKind == LiteralKind.STRING\r\n ) {\r\n let kind = operatorKindFromDecorator(\r\n decorator.decoratorKind,\r\n (firstArg).value\r\n );\r\n if (kind == OperatorKind.INVALID) {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n firstArg.range\r\n );\r\n } else {\r\n let overloads = classPrototype.overloadPrototypes;\r\n if (overloads.has(kind)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_function_implementation,\r\n firstArg.range\r\n );\r\n } else {\r\n prototype.operatorKind = kind;\r\n overloads.set(kind, prototype);\r\n }\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode.String_literal_expected,\r\n firstArg.range\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n decorator.range, \"1\", numArgs.toString(10)\r\n );\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /** Ensures that the property introduced by the specified getter or setter exists.*/\r\n private ensureProperty(\r\n /** The declaration of the getter or setter introducing the property. */\r\n declaration: MethodDeclaration,\r\n /** Parent class. */\r\n parent: ClassPrototype\r\n ): PropertyPrototype | null {\r\n var name = declaration.name.text;\r\n if (declaration.is(CommonFlags.STATIC)) {\r\n let parentMembers = parent.members;\r\n if (parentMembers && parentMembers.has(name)) {\r\n let element = parentMembers.get(name)!;\r\n if (element.kind == ElementKind.PROPERTY_PROTOTYPE) return element;\r\n } else {\r\n let element = new PropertyPrototype(name, parent, declaration);\r\n if (!parent.add(name, element)) return null;\r\n return element;\r\n }\r\n } else {\r\n let parentMembers = parent.instanceMembers;\r\n if (parentMembers && parentMembers.has(name)) {\r\n let element = parentMembers.get(name);\r\n if (element.kind == ElementKind.PROPERTY_PROTOTYPE) return element;\r\n } else {\r\n let element = new PropertyPrototype(name, parent, declaration);\r\n if (!parent.addInstance(name, element)) return null;\r\n return element;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Duplicate_property_0,\r\n declaration.name.range, name\r\n );\r\n return null;\r\n }\r\n\r\n /** Initializes a property of a class. */\r\n private initializeProperty(\r\n /** The declaration of the getter or setter. */\r\n declaration: MethodDeclaration,\r\n /** Parent class. */\r\n parent: ClassPrototype\r\n ): void {\r\n var property = this.ensureProperty(declaration, parent);\r\n if (!property) return;\r\n var name = declaration.name.text;\r\n var isGetter = declaration.is(CommonFlags.GET);\r\n if (isGetter) {\r\n if (property.getterPrototype) {\r\n this.error(\r\n DiagnosticCode.Duplicate_property_0,\r\n declaration.name.range, name\r\n );\r\n return;\r\n }\r\n } else {\r\n if (property.setterPrototype) {\r\n this.error(\r\n DiagnosticCode.Duplicate_property_0,\r\n declaration.name.range, name\r\n );\r\n return;\r\n }\r\n }\r\n var element = new FunctionPrototype(\r\n (isGetter ? GETTER_PREFIX : SETTER_PREFIX) + name,\r\n property,\r\n declaration,\r\n this.checkDecorators(declaration.decorators,\r\n DecoratorFlags.INLINE | DecoratorFlags.UNSAFE\r\n )\r\n );\r\n if (isGetter) {\r\n property.getterPrototype = element;\r\n } else {\r\n property.setterPrototype = element;\r\n }\r\n }\r\n\r\n /** Initializes an enum. */\r\n private initializeEnum(\r\n /** The declaration to initialize. */\r\n declaration: EnumDeclaration,\r\n /** Parent element, usually a file or namespace. */\r\n parent: Element\r\n ): Enum | null {\r\n var name = declaration.name.text;\r\n var element = new Enum(\r\n name,\r\n parent,\r\n declaration,\r\n this.checkDecorators(declaration.decorators,\r\n DecoratorFlags.GLOBAL |\r\n DecoratorFlags.INLINE |\r\n DecoratorFlags.LAZY\r\n )\r\n );\r\n if (!parent.add(name, element)) return null;\r\n var values = declaration.values;\r\n for (let i = 0, k = values.length; i < k; ++i) {\r\n this.initializeEnumValue(values[i], element);\r\n }\r\n return element;\r\n }\r\n\r\n /** Initializes an enum value. */\r\n private initializeEnumValue(\r\n /** The declaration to initialize. */\r\n declaration: EnumValueDeclaration,\r\n /** Parent enum. */\r\n parent: Enum\r\n ): void {\r\n var name = declaration.name.text;\r\n var element = new EnumValue(\r\n name,\r\n parent,\r\n declaration,\r\n this.checkDecorators(declaration.decorators,\r\n DecoratorFlags.NONE\r\n )\r\n );\r\n if (!parent.add(name, element)) return;\r\n }\r\n\r\n /** Initializes an `export` statement. */\r\n private initializeExports(\r\n /** The statement to initialize. */\r\n statement: ExportStatement,\r\n /** Parent file. */\r\n parent: File,\r\n /** So far queued `export`s. */\r\n queuedExports: Map>,\r\n /** So far queued `export *`s. */\r\n queuedExportsStar: Map\r\n ): void {\r\n var members = statement.members;\r\n if (members) { // export { foo, bar } [from \"./baz\"]\r\n for (let i = 0, k = members.length; i < k; ++i) {\r\n this.initializeExport(members[i], parent, statement.internalPath, queuedExports);\r\n }\r\n } else { // export * from \"./baz\"\r\n let queued: QueuedExportStar[];\r\n if (queuedExportsStar.has(parent)) queued = queuedExportsStar.get(parent)!;\r\n else queuedExportsStar.set(parent, queued = []);\r\n let foreignPath = assert(statement.internalPath); // must be set for export *\r\n queued.push(new QueuedExportStar(\r\n foreignPath,\r\n foreignPath.endsWith(INDEX_SUFFIX) // strip or add index depending on what's already present\r\n ? foreignPath.substring(0, foreignPath.length - INDEX_SUFFIX.length)\r\n : foreignPath + INDEX_SUFFIX,\r\n assert(statement.path)\r\n ));\r\n }\r\n }\r\n\r\n /** Initializes a single `export` member. Does not handle `export *`. */\r\n private initializeExport(\r\n /** The member to initialize. */\r\n member: ExportMember,\r\n /** Local file. */\r\n localFile: File,\r\n /** Path to the other file, if present. */\r\n foreignPath: string | null,\r\n /** So far queued `export`s. */\r\n queuedExports: Map>\r\n ): void {\r\n var localName = member.localName.text;\r\n var foreignName = member.exportedName.text;\r\n\r\n // check for duplicates\r\n var element = localFile.lookupExport(foreignName);\r\n if (element) {\r\n this.error(\r\n DiagnosticCode.Export_declaration_conflicts_with_exported_declaration_of_0,\r\n member.exportedName.range, foreignName\r\n );\r\n return;\r\n }\r\n // local element, i.e. export { foo [as bar] }\r\n if (foreignPath === null) {\r\n\r\n // resolve right away if the local element already exists\r\n if (element = localFile.lookupInSelf(localName)) {\r\n localFile.ensureExport(foreignName, element);\r\n\r\n // otherwise queue it\r\n } else {\r\n let queued: Map;\r\n if (queuedExports.has(localFile)) queued = queuedExports.get(localFile)!;\r\n else queuedExports.set(localFile, queued = new Map());\r\n queued.set(foreignName, new QueuedExport(\r\n member.localName,\r\n member.exportedName,\r\n null, null\r\n ));\r\n }\r\n\r\n // foreign element, i.e. export { foo } from \"./bar\"\r\n } else {\r\n let queued: Map;\r\n if (queuedExports.has(localFile)) queued = queuedExports.get(localFile)!;\r\n else queuedExports.set(localFile, queued = new Map());\r\n queued.set(foreignName, new QueuedExport(\r\n member.localName,\r\n member.exportedName,\r\n foreignPath,\r\n foreignPath.endsWith(INDEX_SUFFIX) // strip or add index depending on what's already present\r\n ? foreignPath.substring(0, foreignPath.length - INDEX_SUFFIX.length)\r\n : foreignPath + INDEX_SUFFIX\r\n ));\r\n }\r\n }\r\n\r\n private initializeExportDefault(\r\n /** The statement to initialize. */\r\n statement: ExportDefaultStatement,\r\n /** Parent file. */\r\n parent: File,\r\n /** So far queued `extends` clauses. */\r\n queuedExtends: Array,\r\n /** So far queued `implements` clauses. */\r\n queuedImplements: ClassPrototype[]\r\n ): void {\r\n var declaration = statement.declaration;\r\n var element: DeclaredElement | null = null;\r\n switch (declaration.kind) {\r\n case NodeKind.ENUMDECLARATION: {\r\n element = this.initializeEnum(declaration, parent);\r\n break;\r\n }\r\n case NodeKind.FUNCTIONDECLARATION: {\r\n element = this.initializeFunction(declaration, parent);\r\n break;\r\n }\r\n case NodeKind.CLASSDECLARATION: {\r\n element = this.initializeClass(declaration, parent, queuedExtends, queuedImplements);\r\n break;\r\n }\r\n case NodeKind.INTERFACEDECLARATION: {\r\n element = this.initializeInterface(declaration, parent);\r\n break;\r\n }\r\n case NodeKind.NAMESPACEDECLARATION: {\r\n element = this.initializeNamespace(declaration, parent, queuedExtends, queuedImplements);\r\n break;\r\n }\r\n default: assert(false);\r\n }\r\n if (element) {\r\n let exports = parent.exports;\r\n if (!exports) parent.exports = exports = new Map();\r\n else if (exports.has(\"default\")) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, \"default\"\r\n )\r\n return;\r\n }\r\n exports.set(\"default\", element);\r\n }\r\n }\r\n\r\n /** Initializes an `import` statement. */\r\n private initializeImports(\r\n /** The statement to initialize. */\r\n statement: ImportStatement,\r\n /** Parent file. */\r\n parent: File,\r\n /** So far queued `import`s. */\r\n queuedImports: QueuedImport[],\r\n /** So far queued `export`s. */\r\n queuedExports: Map>\r\n ): void {\r\n var declarations = statement.declarations;\r\n if (declarations) { // import { foo [as bar] } from \"./baz\"\r\n for (let i = 0, k = declarations.length; i < k; ++i) {\r\n this.initializeImport(\r\n declarations[i],\r\n parent,\r\n statement.internalPath,\r\n queuedImports,\r\n queuedExports\r\n );\r\n }\r\n } else if (statement.namespaceName) { // import * as foo from \"./bar\"\r\n queuedImports.push(new QueuedImport(\r\n parent,\r\n statement.namespaceName,\r\n null, // indicates import *\r\n statement.internalPath,\r\n statement.internalPath + INDEX_SUFFIX\r\n ));\r\n } else {\r\n // import \"./foo\"\r\n }\r\n }\r\n\r\n /** Initializes a single `import` declaration. Does not handle `import *`. */\r\n private initializeImport( // { foo [as bar] }\r\n /** The declaration to initialize. */\r\n declaration: ImportDeclaration,\r\n /** Parent file. */\r\n parent: File,\r\n /** Path to the other file. */\r\n foreignPath: string,\r\n /** So far queued `import`s. */\r\n queuedImports: QueuedImport[],\r\n /** So far queued `export`s. */\r\n queuedExports: Map>\r\n ): void {\r\n var foreignPathAlt = foreignPath.endsWith(INDEX_SUFFIX) // strip or add index depending on what's already present\r\n ? foreignPath.substring(0, foreignPath.length - INDEX_SUFFIX.length)\r\n : foreignPath + INDEX_SUFFIX;\r\n\r\n // resolve right away if the element exists\r\n var element = this.lookupForeign(declaration.foreignName.text, foreignPath, foreignPathAlt, queuedExports);\r\n if (element) {\r\n parent.add(declaration.name.text, element, true);\r\n return;\r\n }\r\n\r\n // otherwise queue it\r\n queuedImports.push(new QueuedImport(\r\n parent,\r\n declaration.name,\r\n declaration.foreignName,\r\n foreignPath,\r\n foreignPathAlt\r\n ));\r\n }\r\n\r\n /** Initializes a function. Does not handle methods. */\r\n private initializeFunction(\r\n /** The declaration to initialize. */\r\n declaration: FunctionDeclaration,\r\n /** Parent element, usually a file or namespace. */\r\n parent: Element\r\n ): FunctionPrototype | null {\r\n var name = declaration.name.text;\r\n var validDecorators = DecoratorFlags.UNSAFE | DecoratorFlags.BUILTIN;\r\n if (declaration.is(CommonFlags.AMBIENT)) {\r\n validDecorators |= DecoratorFlags.EXTERNAL;\r\n } else {\r\n validDecorators |= DecoratorFlags.INLINE;\r\n }\r\n if (!declaration.is(CommonFlags.INSTANCE)) {\r\n if (parent.kind != ElementKind.CLASS_PROTOTYPE) {\r\n validDecorators |= DecoratorFlags.GLOBAL;\r\n }\r\n }\r\n var element = new FunctionPrototype(\r\n name,\r\n parent,\r\n declaration,\r\n this.checkDecorators(declaration.decorators, validDecorators)\r\n );\r\n if (!parent.add(name, element)) return null;\r\n return element;\r\n }\r\n\r\n /** Initializes an interface. */\r\n private initializeInterface(\r\n /** The declaration to initialize. */\r\n declaration: InterfaceDeclaration,\r\n /** Parent element, usually a file or namespace. */\r\n parent: Element\r\n ): InterfacePrototype | null {\r\n var name = declaration.name.text;\r\n var element = new InterfacePrototype(\r\n name,\r\n parent,\r\n declaration,\r\n this.checkDecorators(declaration.decorators,\r\n DecoratorFlags.GLOBAL\r\n )\r\n );\r\n if (!parent.add(name, element)) return null;\r\n var memberDeclarations = declaration.members;\r\n for (let i = 0, k = memberDeclarations.length; i < k; ++i) {\r\n let memberDeclaration = memberDeclarations[i];\r\n switch (memberDeclaration.kind) {\r\n case NodeKind.FIELDDECLARATION: {\r\n this.initializeField(memberDeclaration, element);\r\n break;\r\n }\r\n case NodeKind.METHODDECLARATION: {\r\n if (memberDeclaration.isAny(CommonFlags.GET | CommonFlags.SET)) {\r\n this.initializeProperty(memberDeclaration, element);\r\n } else {\r\n this.initializeMethod(memberDeclaration, element);\r\n }\r\n break;\r\n }\r\n default: assert(false); // interface member expected\r\n }\r\n }\r\n return element;\r\n }\r\n\r\n /** Initializes a namespace. */\r\n private initializeNamespace(\r\n /** The declaration to initialize. */\r\n declaration: NamespaceDeclaration,\r\n /** Parent element, usually a file or another namespace. */\r\n parent: Element,\r\n /** So far queued `extends` clauses. */\r\n queuedExtends: ClassPrototype[],\r\n /** So far queued `implements` clauses. */\r\n queuedImplements: ClassPrototype[]\r\n ): Namespace | null {\r\n var name = declaration.name.text;\r\n var original = new Namespace(\r\n name,\r\n parent,\r\n declaration,\r\n this.checkDecorators(declaration.decorators, DecoratorFlags.GLOBAL)\r\n );\r\n if (!parent.add(name, original)) return null;\r\n var element = assert(parent.lookupInSelf(name)); // possibly merged\r\n var members = declaration.members;\r\n for (let i = 0, k = members.length; i < k; ++i) {\r\n let member = members[i];\r\n switch (member.kind) {\r\n case NodeKind.CLASSDECLARATION: {\r\n this.initializeClass(member, original, queuedExtends, queuedImplements);\r\n break;\r\n }\r\n case NodeKind.ENUMDECLARATION: {\r\n this.initializeEnum(member, original);\r\n break;\r\n }\r\n case NodeKind.FUNCTIONDECLARATION: {\r\n this.initializeFunction(member, original);\r\n break;\r\n }\r\n case NodeKind.INTERFACEDECLARATION: {\r\n this.initializeInterface(member, original);\r\n break;\r\n }\r\n case NodeKind.NAMESPACEDECLARATION: {\r\n this.initializeNamespace(member, original, queuedExtends, queuedImplements);\r\n break;\r\n }\r\n case NodeKind.TYPEDECLARATION: {\r\n this.initializeTypeDefinition(member, original);\r\n break;\r\n }\r\n case NodeKind.VARIABLE: {\r\n this.initializeVariables(member, original);\r\n break;\r\n }\r\n default: assert(false); // namespace member expected\r\n }\r\n }\r\n if (original != element) copyMembers(original, element); // retain original parent\r\n return element;\r\n }\r\n\r\n /** Initializes a `type` definition. */\r\n private initializeTypeDefinition(\r\n /** The declaration to initialize. */\r\n declaration: TypeDeclaration,\r\n /** Parent element, usually a file or namespace. */\r\n parent: Element\r\n ): void {\r\n var name = declaration.name.text;\r\n var element = new TypeDefinition(\r\n name,\r\n parent,\r\n declaration,\r\n this.checkDecorators(declaration.decorators, DecoratorFlags.NONE)\r\n );\r\n parent.add(name, element); // reports\r\n }\r\n\r\n /** Initializes a variable statement. */\r\n private initializeVariables(\r\n /** The statement to initialize. */\r\n statement: VariableStatement,\r\n /** Parent element, usually a file or namespace. */\r\n parent: Element\r\n ): void {\r\n var declarations = statement.declarations;\r\n for (let i = 0, k = declarations.length; i < k; ++i) {\r\n let declaration = declarations[i];\r\n let name = declaration.name.text;\r\n let acceptedFlags = DecoratorFlags.GLOBAL | DecoratorFlags.LAZY;\r\n if (declaration.is(CommonFlags.DECLARE)) {\r\n acceptedFlags |= DecoratorFlags.EXTERNAL;\r\n }\r\n if (declaration.is(CommonFlags.CONST)) {\r\n acceptedFlags |= DecoratorFlags.INLINE;\r\n }\r\n let element = new Global(\r\n name,\r\n parent,\r\n this.checkDecorators(declaration.decorators, acceptedFlags),\r\n declaration\r\n );\r\n if (!parent.add(name, element)) continue; // reports\r\n }\r\n }\r\n\r\n /** Determines the element type of a built-in array. */\r\n // determineBuiltinArrayType(target: Class): Type | null {\r\n // switch (target.internalName) {\r\n // case BuiltinSymbols.Int8Array: return Type.i8;\r\n // case BuiltinSymbols.Uint8ClampedArray:\r\n // case BuiltinSymbols.Uint8Array: return Type.u8;\r\n // case BuiltinSymbols.Int16Array: return Type.i16;\r\n // case BuiltinSymbols.Uint16Array: return Type.u16;\r\n // case BuiltinSymbols.Int32Array: return Type.i32;\r\n // case BuiltinSymbols.Uint32Array: return Type.u32;\r\n // case BuiltinSymbols.Int64Array: return Type.i64;\r\n // case BuiltinSymbols.Uint64Array: return Type.u64;\r\n // case BuiltinSymbols.Float32Array: return Type.f32;\r\n // case BuiltinSymbols.Float64Array: return Type.f64;\r\n // }\r\n // var current: Class | null = target;\r\n // var arrayPrototype = this.arrayPrototype;\r\n // do {\r\n // if (current.prototype == arrayPrototype) { // Array\r\n // let typeArguments = assert(current.typeArguments);\r\n // assert(typeArguments.length == 1);\r\n // return typeArguments[0];\r\n // }\r\n // } while (current = current.base);\r\n // return null;\r\n // }\r\n}\r\n\r\n/** Indicates the specific kind of an {@link Element}. */\r\nexport enum ElementKind {\r\n /** A {@link Global}. */\r\n GLOBAL,\r\n /** A {@link Local}. */\r\n LOCAL,\r\n /** An {@link Enum}. */\r\n ENUM,\r\n /** An {@link EnumValue}. */\r\n ENUMVALUE,\r\n /** A {@link FunctionPrototype}. */\r\n FUNCTION_PROTOTYPE,\r\n /** A {@link Function}. */\r\n FUNCTION,\r\n /** A {@link FunctionTarget}. */\r\n FUNCTION_TARGET,\r\n /** A {@link ClassPrototype}. */\r\n CLASS_PROTOTYPE,\r\n /** A {@link Class}. */\r\n CLASS,\r\n /** An {@link InterfacePrototype}. */\r\n INTERFACE_PROTOTYPE,\r\n /** An {@link Interface}. */\r\n INTERFACE,\r\n /** A {@link FieldPrototype}. */\r\n FIELD_PROTOTYPE,\r\n /** A {@link Field}. */\r\n FIELD,\r\n /** A {@link PropertyPrototype}. */\r\n PROPERTY_PROTOTYPE,\r\n /** A {@link Property}. */\r\n PROPERTY,\r\n /** A {@link Namespace}. */\r\n NAMESPACE,\r\n /** A {@link File}. */\r\n FILE,\r\n /** A {@link TypeDefinition}. */\r\n TYPEDEFINITION,\r\n}\r\n\r\n/** Indicates built-in decorators that are present. */\r\nexport enum DecoratorFlags {\r\n /** No flags set. */\r\n NONE = 0,\r\n /** Is a program global. */\r\n GLOBAL = 1 << 0,\r\n /** Is a binary operator overload. */\r\n OPERATOR_BINARY = 1 << 1,\r\n /** Is a unary prefix operator overload. */\r\n OPERATOR_PREFIX = 1 << 2,\r\n /** Is a unary postfix operator overload. */\r\n OPERATOR_POSTFIX = 1 << 3,\r\n /** Is an unmanaged class. */\r\n UNMANAGED = 1 << 4,\r\n /** Is a sealed class. */\r\n SEALED = 1 << 5,\r\n /** Is always inlined. */\r\n INLINE = 1 << 6,\r\n /** Is using a different external name. */\r\n EXTERNAL = 1 << 7,\r\n /** Is a builtin. */\r\n BUILTIN = 1 << 8,\r\n /** Is compiled lazily. */\r\n LAZY = 1 << 9,\r\n /** Is considered unsafe code. */\r\n UNSAFE = 1 << 10\r\n}\r\n\r\n/** Translates a decorator kind to the respective decorator flag. */\r\nexport function decoratorKindToFlag(kind: DecoratorKind): DecoratorFlags {\r\n switch (kind) {\r\n case DecoratorKind.GLOBAL: return DecoratorFlags.GLOBAL;\r\n case DecoratorKind.OPERATOR:\r\n case DecoratorKind.OPERATOR_BINARY: return DecoratorFlags.OPERATOR_BINARY;\r\n case DecoratorKind.OPERATOR_PREFIX: return DecoratorFlags.OPERATOR_PREFIX;\r\n case DecoratorKind.OPERATOR_POSTFIX: return DecoratorFlags.OPERATOR_POSTFIX;\r\n case DecoratorKind.UNMANAGED: return DecoratorFlags.UNMANAGED;\r\n case DecoratorKind.SEALED: return DecoratorFlags.SEALED;\r\n case DecoratorKind.INLINE: return DecoratorFlags.INLINE;\r\n case DecoratorKind.EXTERNAL: return DecoratorFlags.EXTERNAL;\r\n case DecoratorKind.BUILTIN: return DecoratorFlags.BUILTIN;\r\n case DecoratorKind.LAZY: return DecoratorFlags.LAZY;\r\n case DecoratorKind.UNSAFE: return DecoratorFlags.UNSAFE;\r\n default: return DecoratorFlags.NONE;\r\n }\r\n}\r\n\r\n/** Base class of all program elements. */\r\nexport abstract class Element {\r\n\r\n /** Parent element. */\r\n parent: Element;\r\n /** Common flags indicating specific traits. */\r\n flags: CommonFlags = CommonFlags.NONE;\r\n /** Decorator flags indicating annotated traits. */\r\n decoratorFlags: DecoratorFlags = DecoratorFlags.NONE;\r\n /** Member elements. */\r\n members: Map | null = null;\r\n /** Shadowing type in type space, if any. */\r\n shadowType: TypeDefinition | null = null;\r\n\r\n /** Constructs a new program element. */\r\n protected constructor(\r\n /** Specific element kind. */\r\n public kind: ElementKind,\r\n /** Simple name. */\r\n public name: string,\r\n /** Internal name referring to this element. */\r\n public internalName: string,\r\n /** Containing {@link Program}. */\r\n public program: Program,\r\n /** Parent element. */\r\n parent: Element | null\r\n ) {\r\n this.program = program;\r\n this.name = name;\r\n this.internalName = internalName;\r\n if (parent) {\r\n this.parent = parent;\r\n } else {\r\n assert(this.kind == ElementKind.FILE);\r\n this.parent = this; // special case to keep this.parent non-nullable\r\n }\r\n }\r\n\r\n /** Gets the enclosing file. */\r\n get file(): File {\r\n var current: Element = this;\r\n do if ((current = current.parent).kind == ElementKind.FILE) return current;\r\n while (true);\r\n }\r\n\r\n /** Tests if this element has a specific flag or flags. */\r\n is(flag: CommonFlags): bool { return (this.flags & flag) == flag; }\r\n /** Tests if this element has any of the specified flags. */\r\n isAny(flags: CommonFlags): bool { return (this.flags & flags) != 0; }\r\n /** Sets a specific flag or flags. */\r\n set(flag: CommonFlags): void { this.flags |= flag; }\r\n /** Unsets the specific flag or flags. */\r\n unset(flag: CommonFlags): void {this.flags &= ~flag; }\r\n /** Tests if this element has a specific decorator flag or flags. */\r\n hasDecorator(flag: DecoratorFlags): bool { return (this.decoratorFlags & flag) == flag; }\r\n\r\n /** Looks up the element with the specified name within this element. */\r\n lookupInSelf(name: string): DeclaredElement | null {\r\n var members = this.members;\r\n if (members && members.has(name)) return members.get(name)!;\r\n return null;\r\n }\r\n\r\n /** Looks up the element with the specified name relative to this element, like in JS. */\r\n abstract lookup(name: string): Element | null;\r\n\r\n /** Adds an element as a member of this one. Reports and returns `false` if a duplicate. */\r\n add(name: string, element: DeclaredElement): bool {\r\n var originalDeclaration = element.declaration;\r\n var members = this.members;\r\n if (!members) this.members = members = new Map();\r\n else if (members.has(name)) {\r\n let actual = members.get(name)!;\r\n if (actual.parent !== this) {\r\n // override non-own element\r\n } else {\r\n let merged = tryMerge(actual, element);\r\n if (merged) {\r\n element = merged; // use merged element\r\n } else {\r\n this.program.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n element.identifierNode.range, element.identifierNode.text\r\n );\r\n return false;\r\n }\r\n }\r\n }\r\n members.set(name, element);\r\n var program = this.program;\r\n if (element.kind != ElementKind.FUNCTION_PROTOTYPE || !(element).isBound) {\r\n // prefer unbound prototypes in global lookup maps\r\n program.elementsByName.set(element.internalName, element);\r\n program.elementsByDeclaration.set(originalDeclaration, element);\r\n }\r\n return true;\r\n }\r\n\r\n /** Returns a string representation of this element. */\r\n toString(): string {\r\n return ElementKind[this.kind] + \":\" + this.internalName;\r\n }\r\n}\r\n\r\n/** Base class of elements with an associated declaration statement. */\r\nexport abstract class DeclaredElement extends Element {\r\n\r\n /** Constructs a new declared program element. */\r\n protected constructor(\r\n /** Specific element kind. */\r\n kind: ElementKind,\r\n /** Simple name. */\r\n name: string,\r\n /** Internal name referring to this element. */\r\n internalName: string,\r\n /** Containing {@link Program}. */\r\n program: Program,\r\n /** Parent element. */\r\n parent: Element | null,\r\n /** Declaration reference. */\r\n public declaration: DeclarationStatement\r\n ) {\r\n super(kind, name, internalName, program, parent);\r\n // It is necessary to have access to identifiers of all members and exports\r\n // for reporting purposes and this is the lowest common denominator. Comes\r\n // at the expense of not having more specific type information in derived\r\n // classes, though. Instead, derived classes implement getters for other\r\n // important AST nodes directly through manual casting, allowing the resolver\r\n // etc. to not worry about actual declarations.\r\n this.declaration = declaration;\r\n this.flags = declaration.flags; // inherit\r\n }\r\n\r\n /** Tests if this element is a library element. */\r\n get isDeclaredInLibrary(): bool {\r\n return this.declaration.range.source.isLibrary;\r\n }\r\n\r\n /** Gets the associated identifier node. */\r\n get identifierNode(): IdentifierExpression {\r\n return this.declaration.name;\r\n }\r\n\r\n /** Gets the assiciated decorator nodes. */\r\n get decoratorNodes(): DecoratorNode[] | null {\r\n return this.declaration.decorators;\r\n }\r\n}\r\n\r\n/** Base class of elements that can be resolved to a concrete type. */\r\nexport abstract class TypedElement extends DeclaredElement {\r\n\r\n /** Resolved type. Set once `is(RESOLVED)`, otherwise void. */\r\n type: Type = Type.void;\r\n\r\n /** Sets the resolved type of this element. */\r\n setType(type: Type): void {\r\n assert(!this.is(CommonFlags.RESOLVED));\r\n this.type = type;\r\n this.set(CommonFlags.RESOLVED);\r\n }\r\n}\r\n\r\n/** A file representing the implicit top-level namespace of a source. */\r\nexport class File extends Element {\r\n\r\n /** File exports. */\r\n exports: Map | null = null;\r\n /** File re-exports. */\r\n exportsStar: File[] | null = null;\r\n /** Top-level start function of this file. */\r\n startFunction: Function;\r\n\r\n /** Constructs a new file. */\r\n constructor(\r\n /** Program this file belongs to. */\r\n program: Program,\r\n /** Source of this file. */\r\n public source: Source\r\n ) {\r\n super(\r\n ElementKind.FILE,\r\n source.normalizedPath,\r\n source.internalPath,\r\n program,\r\n null // special case for files\r\n );\r\n this.source = source;\r\n assert(!program.filesByName.has(this.internalName));\r\n program.filesByName.set(this.internalName, this);\r\n var startFunction = this.program.makeNativeFunction(\r\n \"start:\" + this.internalName,\r\n new Signature(null, Type.void),\r\n this\r\n );\r\n startFunction.internalName = startFunction.name;\r\n this.startFunction = startFunction;\r\n }\r\n\r\n /* @override */\r\n add(name: string, element: DeclaredElement, isImport: bool = false): bool {\r\n if (element.hasDecorator(DecoratorFlags.GLOBAL)) {\r\n element = this.program.ensureGlobal(name, element); // possibly merged globally\r\n }\r\n if (!super.add(name, element)) return false;\r\n element = assert(this.lookupInSelf(name)); // possibly merged locally\r\n if (element.is(CommonFlags.EXPORT) && !isImport) {\r\n this.ensureExport(\r\n element.name,\r\n element\r\n );\r\n }\r\n return true;\r\n }\r\n\r\n /* @override */\r\n lookupInSelf(name: string): DeclaredElement | null {\r\n var element = super.lookupInSelf(name);\r\n if (element) return element;\r\n var exportsStar = this.exportsStar;\r\n if (exportsStar) {\r\n for (let i = 0, k = exportsStar.length; i < k; ++i) {\r\n if (element = exportsStar[i].lookupInSelf(name)) return element;\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n /* @override */\r\n lookup(name: string): Element | null {\r\n var element = this.lookupInSelf(name);\r\n if (element) return element;\r\n return this.program.lookupGlobal(name);\r\n }\r\n\r\n /** Ensures that an element is an export of this file. */\r\n ensureExport(name: string, element: DeclaredElement): void {\r\n var exports = this.exports;\r\n if (!exports) this.exports = exports = new Map();\r\n exports.set(name, element);\r\n if (this.source.isLibrary) this.program.ensureGlobal(name, element);\r\n }\r\n\r\n /** Ensures that another file is a re-export of this file. */\r\n ensureExportStar(file: File): void {\r\n var exportsStar = this.exportsStar;\r\n if (!exportsStar) this.exportsStar = exportsStar = [];\r\n else if (exportsStar.includes(file)) return;\r\n exportsStar.push(file);\r\n }\r\n\r\n /** Looks up the export of the specified name. */\r\n lookupExport(name: string): DeclaredElement | null {\r\n var exports = this.exports;\r\n if (exports && exports.has(name)) return exports.get(name)!;\r\n var exportsStar = this.exportsStar;\r\n if (exportsStar) {\r\n for (let i = 0, k = exportsStar.length; i < k; ++i) {\r\n let element = exportsStar[i].lookupExport(name);\r\n if (element) return element;\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n /** Creates an imported namespace from this file. */\r\n asImportedNamespace(name: string, parent: Element): Namespace {\r\n var ns = new Namespace(\r\n name,\r\n parent,\r\n this.program.makeNativeNamespaceDeclaration(name)\r\n );\r\n var exports = this.exports;\r\n if (exports) {\r\n for (let [memberName, member] of exports) {\r\n ns.add(memberName, member);\r\n }\r\n }\r\n return ns;\r\n }\r\n}\r\n\r\n/** A type definition. */\r\nexport class TypeDefinition extends TypedElement {\r\n\r\n /** Constructs a new type definition. */\r\n constructor(\r\n /** Simple name. */\r\n name: string,\r\n /** Parent element, usually a file or namespace. */\r\n parent: Element,\r\n /** Declaration reference. */\r\n declaration: TypeDeclaration,\r\n /** Pre-checked flags indicating built-in decorators. */\r\n decoratorFlags: DecoratorFlags = DecoratorFlags.NONE\r\n ) {\r\n super(\r\n ElementKind.TYPEDEFINITION,\r\n name,\r\n mangleInternalName(name, parent, false),\r\n parent.program,\r\n parent,\r\n declaration\r\n );\r\n this.decoratorFlags = decoratorFlags;\r\n }\r\n\r\n /** Gets the associated type parameter nodes. */\r\n get typeParameterNodes(): TypeParameterNode[] | null {\r\n return (this.declaration).typeParameters;\r\n }\r\n\r\n /** Gets the associated type node. */\r\n get typeNode(): CommonTypeNode {\r\n return (this.declaration).type;\r\n }\r\n\r\n /* @override */\r\n lookup(name: string): Element | null {\r\n return this.parent.lookup(name);\r\n }\r\n}\r\n\r\n/** A namespace that differs from a file in being user-declared with a name. */\r\nexport class Namespace extends DeclaredElement {\r\n\r\n /** Constructs a new namespace. */\r\n constructor(\r\n /** Simple name. */\r\n name: string,\r\n /** Parent element, usually a file or another namespace. */\r\n parent: Element,\r\n /** Declaration reference. */\r\n declaration: NamespaceDeclaration,\r\n /** Pre-checked flags indicating built-in decorators. */\r\n decoratorFlags: DecoratorFlags = DecoratorFlags.NONE\r\n ) {\r\n super(\r\n ElementKind.NAMESPACE,\r\n name,\r\n mangleInternalName(name, parent, false),\r\n parent.program,\r\n parent,\r\n declaration\r\n );\r\n this.decoratorFlags = decoratorFlags;\r\n }\r\n\r\n /* @override */\r\n lookup(name: string): Element | null {\r\n return this.lookupInSelf(name)\r\n || this.parent.lookup(name);\r\n }\r\n}\r\n\r\n/** An enum. */\r\nexport class Enum extends TypedElement {\r\n\r\n /** Constructs a new enum. */\r\n constructor(\r\n /** Simple name. */\r\n name: string,\r\n /** Parent element, usually a file or namespace. */\r\n parent: Element,\r\n /** Declaration reference. */\r\n declaration: EnumDeclaration,\r\n /** Pre-checked flags indicating built-in decorators. */\r\n decoratorFlags: DecoratorFlags = DecoratorFlags.NONE\r\n ) {\r\n super(\r\n ElementKind.ENUM,\r\n name,\r\n mangleInternalName(name, parent, false),\r\n parent.program,\r\n parent,\r\n declaration\r\n );\r\n this.decoratorFlags = decoratorFlags;\r\n this.setType(Type.i32);\r\n }\r\n\r\n /* @override */\r\n lookup(name: string): Element | null {\r\n return this.lookupInSelf(name)\r\n || this.parent.lookup(name);\r\n }\r\n}\r\n\r\n/** Indicates the kind of an inlined constant value. */\r\nexport const enum ConstantValueKind {\r\n /** No constant value. */\r\n NONE,\r\n /** Constant integer value. */\r\n INTEGER,\r\n /** Constant float value. */\r\n FLOAT\r\n}\r\n\r\n/** Base class of all variable-like program elements. */\r\nexport abstract class VariableLikeElement extends TypedElement {\r\n\r\n /** Constant value kind. */\r\n constantValueKind: ConstantValueKind = ConstantValueKind.NONE;\r\n /** Constant integer value, if applicable. */\r\n constantIntegerValue: I64;\r\n /** Constant float value, if applicable. */\r\n constantFloatValue: f64;\r\n\r\n /** Constructs a new variable-like element. */\r\n protected constructor(\r\n /** Specific element kind. */\r\n kind: ElementKind,\r\n /** Simple name. */\r\n name: string,\r\n /** Parent element, usually a file, namespace or class. */\r\n parent: Element,\r\n /** Declaration reference. Creates a native declaration if omitted. */\r\n declaration: VariableLikeDeclarationStatement = parent.program.makeNativeVariableDeclaration(name)\r\n ) {\r\n super(\r\n kind,\r\n name,\r\n mangleInternalName(name, parent, false),\r\n parent.program,\r\n parent,\r\n declaration\r\n );\r\n this.flags = declaration.flags;\r\n }\r\n\r\n /** Gets the associated type node.s */\r\n get typeNode(): CommonTypeNode | null {\r\n return (this.declaration).type;\r\n }\r\n\r\n /** Gets the associated initializer node. */\r\n get initializerNode(): Expression | null {\r\n return (this.declaration).initializer;\r\n }\r\n\r\n /** Applies a constant integer value to this element. */\r\n setConstantIntegerValue(value: I64, type: Type): void {\r\n assert(type.is(TypeFlags.INTEGER));\r\n this.type = type;\r\n this.constantValueKind = ConstantValueKind.INTEGER;\r\n this.constantIntegerValue = value;\r\n this.set(CommonFlags.CONST | CommonFlags.INLINED | CommonFlags.RESOLVED);\r\n }\r\n\r\n /** Applies a constant float value to this element. */\r\n setConstantFloatValue(value: f64, type: Type): void {\r\n assert(type.is(TypeFlags.FLOAT));\r\n this.type = type;\r\n this.constantValueKind = ConstantValueKind.FLOAT;\r\n this.constantFloatValue = value;\r\n this.set(CommonFlags.CONST | CommonFlags.INLINED | CommonFlags.RESOLVED);\r\n }\r\n\r\n /** @override */\r\n lookup(name: string): Element | null {\r\n return this.parent.lookup(name);\r\n }\r\n}\r\n\r\n/** An enum value. */\r\nexport class EnumValue extends VariableLikeElement {\r\n\r\n /** Constructs a new enum value. */\r\n constructor(\r\n /** Simple name. */\r\n name: string,\r\n /** Parent enum. */\r\n parent: Enum,\r\n /** Declaration reference. */\r\n declaration: EnumValueDeclaration,\r\n /** Pre-checked flags indicating built-in decorators. */\r\n decoratorFlags: DecoratorFlags = DecoratorFlags.NONE\r\n ) {\r\n super(\r\n ElementKind.ENUMVALUE,\r\n name,\r\n parent,\r\n declaration\r\n );\r\n this.decoratorFlags = decoratorFlags;\r\n this.setType(Type.i32);\r\n }\r\n\r\n /** Whether this enum value is immutable. */\r\n isImmutable: bool = false;\r\n\r\n /** Gets the associated value node. */\r\n get valueNode(): Expression | null {\r\n return (this.declaration).value;\r\n }\r\n\r\n /* @override */\r\n lookup(name: string): Element | null {\r\n return this.parent.lookup(name);\r\n }\r\n}\r\n\r\n/** A global variable. */\r\nexport class Global extends VariableLikeElement {\r\n\r\n /** Constructs a new global variable. */\r\n constructor(\r\n /** Simple name. */\r\n name: string,\r\n /** Parent element, usually a file, namespace or static class. */\r\n parent: Element,\r\n /** Pre-checked flags indicating built-in decorators. */\r\n decoratorFlags: DecoratorFlags,\r\n /** Declaration reference. Creates a native declaration if omitted. */\r\n declaration: VariableLikeDeclarationStatement = parent.program.makeNativeVariableDeclaration(name)\r\n ) {\r\n super(\r\n ElementKind.GLOBAL,\r\n name,\r\n parent,\r\n declaration\r\n );\r\n this.decoratorFlags = decoratorFlags;\r\n }\r\n}\r\n\r\n/** A function parameter. */\r\nexport class Parameter {\r\n /** Constructs a new function parameter. */\r\n constructor(\r\n /** Parameter name. */\r\n public name: string,\r\n /** Parameter type. */\r\n public type: Type,\r\n /** Parameter initializer, if present. */\r\n public initializer: Expression | null = null\r\n ) {}\r\n}\r\n\r\n/** A local variable. */\r\nexport class Local extends VariableLikeElement {\r\n\r\n /** Constructs a new local variable. */\r\n constructor(\r\n /** Simple name. */\r\n name: string,\r\n /** Zero-based index within the enclosing function. `-1` indicates a virtual local. */\r\n public index: i32,\r\n /** Resolved type. */\r\n type: Type,\r\n /** Parent function. */\r\n parent: Function,\r\n /** Declaration reference. */\r\n declaration: VariableLikeDeclarationStatement = parent.program.makeNativeVariableDeclaration(name)\r\n ) {\r\n super(\r\n ElementKind.LOCAL,\r\n name,\r\n parent,\r\n declaration\r\n );\r\n this.index = index;\r\n assert(type != Type.void);\r\n this.setType(type);\r\n }\r\n}\r\n\r\n/** A yet unresolved function prototype. */\r\nexport class FunctionPrototype extends DeclaredElement {\r\n\r\n /** Operator kind, if an overload. */\r\n operatorKind: OperatorKind = OperatorKind.INVALID;\r\n /** Already resolved instances. */\r\n instances: Map | null = null;\r\n\r\n /** Clones of this prototype that are bounds to specific classes. */\r\n private boundPrototypes: Map | null = null;\r\n\r\n /** Constructs a new function prototype. */\r\n constructor(\r\n /** Simple name */\r\n name: string,\r\n /** Parent element, usually a file, namespace or class (if a method). */\r\n parent: Element,\r\n /** Declaration reference. */\r\n declaration: FunctionDeclaration,\r\n /** Pre-checked flags indicating built-in decorators. */\r\n decoratorFlags: DecoratorFlags = DecoratorFlags.NONE\r\n ) {\r\n super(\r\n ElementKind.FUNCTION_PROTOTYPE,\r\n name,\r\n mangleInternalName(name, parent, declaration.is(CommonFlags.INSTANCE)),\r\n parent.program,\r\n parent,\r\n declaration\r\n );\r\n this.decoratorFlags = decoratorFlags;\r\n }\r\n\r\n /** Gets the associated type parameter nodes. */\r\n get typeParameterNodes(): TypeParameterNode[] | null {\r\n return (this.declaration).typeParameters;\r\n }\r\n\r\n /** Gets the associated signature node. */\r\n get signatureNode(): SignatureNode {\r\n return (this.declaration).signature;\r\n }\r\n\r\n /** Gets the associated body node. */\r\n get bodyNode(): Statement | null {\r\n return (this.declaration).body;\r\n }\r\n\r\n /** Gets the arrow function kind. */\r\n get arrowKind(): ArrowKind {\r\n return (this.declaration).arrowKind;\r\n }\r\n\r\n /** Tests if this prototype is bound to a class. */\r\n get isBound(): bool {\r\n var parent = this.parent;\r\n return parent.kind == ElementKind.CLASS\r\n || parent.kind == ElementKind.PROPERTY_PROTOTYPE && parent.parent.kind == ElementKind.CLASS;\r\n }\r\n\r\n /** Creates a clone of this prototype that is bound to a concrete class instead. */\r\n toBound(classInstance: Class): FunctionPrototype {\r\n assert(this.is(CommonFlags.INSTANCE));\r\n assert(!this.isBound);\r\n var boundPrototypes = this.boundPrototypes;\r\n if (!boundPrototypes) this.boundPrototypes = boundPrototypes = new Map();\r\n else if (boundPrototypes.has(classInstance)) return boundPrototypes.get(classInstance)!;\r\n var declaration = this.declaration; assert(declaration.kind == NodeKind.METHODDECLARATION);\r\n var bound = new FunctionPrototype(\r\n this.name,\r\n classInstance, // !\r\n declaration,\r\n this.decoratorFlags\r\n );\r\n bound.flags = this.flags;\r\n bound.operatorKind = this.operatorKind;\r\n // NOTE: this.instances holds instances per bound class / unbound\r\n boundPrototypes.set(classInstance, bound);\r\n return bound;\r\n }\r\n\r\n /** Gets the resolved instance for the specified instance key, if already resolved. */\r\n getResolvedInstance(instanceKey: string): Function | null {\r\n var instances = this.instances;\r\n if (instances && instances.has(instanceKey)) return instances.get(instanceKey);\r\n return null;\r\n }\r\n\r\n /** Sets the resolved instance for the specified instance key. */\r\n setResolvedInstance(instanceKey: string, instance: Function): void {\r\n var instances = this.instances;\r\n if (!instances) this.instances = instances = new Map();\r\n else assert(!instances.has(instanceKey));\r\n instances.set(instanceKey, instance);\r\n }\r\n\r\n /* @override */\r\n lookup(name: string): Element | null {\r\n return this.parent.lookup(name);\r\n }\r\n}\r\n\r\n/** A resolved function. */\r\nexport class Function extends TypedElement {\r\n\r\n /** Function prototype. */\r\n prototype: FunctionPrototype;\r\n /** Function signature. */\r\n signature: Signature;\r\n /** Map of locals by name. */\r\n localsByName: Map = new Map();\r\n /** Array of locals by index. */\r\n localsByIndex: Local[] = [];\r\n /** List of additional non-parameter locals. */\r\n additionalLocals: Type[] = [];\r\n /** Contextual type arguments. */\r\n contextualTypeArguments: Map | null;\r\n /** Default control flow. */\r\n flow: Flow;\r\n /** Remembered debug locations. */\r\n debugLocations: Range[] = [];\r\n /** Function reference, if compiled. */\r\n ref: FunctionRef = 0;\r\n /** Function table index, if any. */\r\n functionTableIndex: i32 = -1;\r\n /** Trampoline function for calling with omitted arguments. */\r\n trampoline: Function | null = null;\r\n\r\n /** Counting id of inline operations involving this function. */\r\n nextInlineId: i32 = 0;\r\n /** Counting id of anonymous inner functions. */\r\n nextAnonymousId: i32 = 0;\r\n /** Counting id of autorelease variables. */\r\n nextAutoreleaseId: i32 = 0;\r\n\r\n /** Constructs a new concrete function. */\r\n constructor(\r\n /** Name incl. type parameters, i.e. `foo`. */\r\n nameInclTypeParameters: string,\r\n /** Respective function prototype. */\r\n prototype: FunctionPrototype,\r\n /** Concrete signature. */\r\n signature: Signature, // pre-resolved\r\n /** Contextual type arguments inherited from its parent class, if any. */\r\n contextualTypeArguments: Map | null = null\r\n ) {\r\n super(\r\n ElementKind.FUNCTION,\r\n nameInclTypeParameters,\r\n mangleInternalName(nameInclTypeParameters, prototype.parent, prototype.is(CommonFlags.INSTANCE)),\r\n prototype.program,\r\n prototype.parent,\r\n prototype.declaration\r\n );\r\n this.prototype = prototype;\r\n this.signature = signature;\r\n this.flags = prototype.flags | CommonFlags.RESOLVED;\r\n this.decoratorFlags = prototype.decoratorFlags;\r\n this.contextualTypeArguments = contextualTypeArguments;\r\n this.type = Type.u32.asFunction(signature);\r\n if (!prototype.is(CommonFlags.AMBIENT)) {\r\n let localIndex = 0;\r\n if (this.is(CommonFlags.INSTANCE)) {\r\n let local = new Local(\r\n CommonSymbols.this_,\r\n localIndex++,\r\n assert(signature.thisType),\r\n this\r\n );\r\n this.localsByName.set(CommonSymbols.this_, local);\r\n this.localsByIndex[local.index] = local;\r\n }\r\n let parameterTypes = signature.parameterTypes;\r\n for (let i = 0, k = parameterTypes.length; i < k; ++i) {\r\n let parameterType = parameterTypes[i];\r\n let parameterName = signature.getParameterName(i);\r\n let local = new Local(\r\n parameterName,\r\n localIndex++,\r\n parameterType,\r\n this\r\n );\r\n this.localsByName.set(parameterName, local);\r\n this.localsByIndex[local.index] = local;\r\n }\r\n }\r\n this.flow = Flow.create(this);\r\n registerConcreteElement(this.program, this);\r\n }\r\n\r\n /** Adds a local of the specified type, with an optional name. */\r\n addLocal(type: Type, name: string | null = null, declaration: VariableDeclaration | null = null): Local {\r\n // if it has a name, check previously as this method will throw otherwise\r\n var localIndex = this.signature.parameterTypes.length + this.additionalLocals.length;\r\n if (this.is(CommonFlags.INSTANCE)) ++localIndex;\r\n var localName = name !== null\r\n ? name\r\n : \"var$\" + localIndex.toString();\r\n var local = new Local(\r\n localName,\r\n localIndex,\r\n type,\r\n this,\r\n declaration || this.program.makeNativeVariableDeclaration(localName)\r\n );\r\n if (name) {\r\n if (this.localsByName.has(name)) throw new Error(\"duplicate local name\");\r\n this.localsByName.set(name, local);\r\n }\r\n this.localsByIndex[local.index] = local;\r\n this.additionalLocals.push(type);\r\n return local;\r\n }\r\n\r\n /* @override */\r\n lookup(name: string): Element | null {\r\n var locals = this.localsByName;\r\n if (locals.has(name)) return locals.get(name);\r\n return this.parent.lookup(name);\r\n }\r\n\r\n // used by flows to keep track of temporary locals\r\n tempI32s: Local[] | null = null;\r\n tempI64s: Local[] | null = null;\r\n tempF32s: Local[] | null = null;\r\n tempF64s: Local[] | null = null;\r\n tempV128s: Local[] | null = null;\r\n\r\n // used by flows to keep track of break labels\r\n nextBreakId: i32 = 0;\r\n breakStack: i32[] | null = null;\r\n breakLabel: string | null = null;\r\n\r\n /** Finalizes the function once compiled, releasing no longer needed resources. */\r\n finalize(module: Module, ref: FunctionRef): void {\r\n this.ref = ref;\r\n assert(!this.breakStack || !this.breakStack.length); // internal error\r\n this.breakStack = null;\r\n this.breakLabel = null;\r\n this.tempI32s = this.tempI64s = this.tempF32s = this.tempF64s = null;\r\n if (this.program.options.sourceMap) {\r\n let debugLocations = this.debugLocations;\r\n for (let i = 0, k = debugLocations.length; i < k; ++i) {\r\n let debugLocation = debugLocations[i];\r\n module.setDebugLocation(\r\n ref,\r\n debugLocation.debugInfoRef,\r\n debugLocation.source.debugInfoIndex,\r\n debugLocation.line,\r\n debugLocation.column\r\n );\r\n }\r\n }\r\n }\r\n}\r\n\r\n/** A resolved function target, that is a function called indirectly by an index and signature. */\r\nexport class FunctionTarget extends Element {\r\n\r\n /** Underlying signature. */\r\n signature: Signature;\r\n /** Function type. */\r\n type: Type;\r\n\r\n /** Constructs a new function target. */\r\n constructor(\r\n /** Concrete signature. */\r\n signature: Signature,\r\n /** Program reference. */\r\n program: Program,\r\n __s: string = \"\" // FIXME: current TS limitation workaround, but a fix seems underway\r\n ) {\r\n super(\r\n ElementKind.FUNCTION_TARGET,\r\n __s = \"sig:\" + signature.toSignatureString(),\r\n __s,\r\n program,\r\n program.nativeFile\r\n );\r\n this.signature = signature;\r\n this.flags = CommonFlags.RESOLVED;\r\n this.type = Type.u32.asFunction(signature);\r\n }\r\n\r\n /* @override */\r\n lookup(name: string): Element | null {\r\n return null;\r\n }\r\n}\r\n\r\n/** A yet unresolved instance field prototype. */\r\nexport class FieldPrototype extends DeclaredElement {\r\n\r\n /** Constructs a new field prototype. */\r\n constructor(\r\n /** Simple name. */\r\n name: string,\r\n /** Parent class. */\r\n parent: ClassPrototype,\r\n /** Declaration reference. */\r\n declaration: FieldDeclaration,\r\n /** Pre-checked flags indicating built-in decorators. */\r\n decoratorFlags: DecoratorFlags = DecoratorFlags.NONE\r\n ) {\r\n super(\r\n ElementKind.FIELD_PROTOTYPE,\r\n name,\r\n mangleInternalName(name, parent, assert(declaration.is(CommonFlags.INSTANCE))),\r\n parent.program,\r\n parent,\r\n declaration\r\n );\r\n this.decoratorFlags = decoratorFlags;\r\n }\r\n\r\n /** Gets the associated type node. */\r\n get typeNode(): CommonTypeNode | null {\r\n return (this.declaration).type;\r\n }\r\n\r\n /** Gets the associated initializer node. */\r\n get initializerNode(): Expression | null {\r\n return (this.declaration).initializer;\r\n }\r\n\r\n /** Gets the associated parameter index. Set if declared as a constructor parameter, otherwise `-1`. */\r\n get parameterIndex(): i32 {\r\n return (this.declaration).parameterIndex;\r\n }\r\n\r\n /* @override */\r\n lookup(name: string): Element | null {\r\n return this.parent.lookup(name);\r\n }\r\n}\r\n\r\n/** A resolved instance field. */\r\nexport class Field extends VariableLikeElement {\r\n\r\n /** Field prototype reference. */\r\n prototype: FieldPrototype;\r\n /** Field memory offset, if an instance field. */\r\n memoryOffset: i32 = -1;\r\n\r\n /** Constructs a new field. */\r\n constructor(\r\n /** Respective field prototype. */\r\n prototype: FieldPrototype,\r\n /** Parent class. */\r\n parent: Class,\r\n /** Concrete type. */\r\n type: Type\r\n ) {\r\n super(\r\n ElementKind.FIELD,\r\n prototype.name,\r\n parent,\r\n prototype.declaration\r\n );\r\n this.prototype = prototype;\r\n this.flags = prototype.flags;\r\n assert(type != Type.void);\r\n this.setType(type);\r\n registerConcreteElement(this.program, this);\r\n }\r\n}\r\n\r\n/** A property comprised of a getter and a setter function. */\r\nexport class PropertyPrototype extends DeclaredElement {\r\n\r\n /** Getter prototype. */\r\n getterPrototype: FunctionPrototype | null = null;\r\n /** Setter prototype. */\r\n setterPrototype: FunctionPrototype | null = null;\r\n\r\n /** Constructs a new property prototype. */\r\n constructor(\r\n /** Simple name. */\r\n name: string,\r\n /** Parent class. */\r\n parent: ClassPrototype,\r\n /** Declaration of the getter or setter introducing the property. */\r\n firstDeclaration: FunctionDeclaration\r\n ) {\r\n super(\r\n ElementKind.PROPERTY_PROTOTYPE,\r\n name,\r\n mangleInternalName(name, parent, firstDeclaration.is(CommonFlags.INSTANCE)),\r\n parent.program,\r\n parent,\r\n firstDeclaration\r\n );\r\n this.flags &= ~(CommonFlags.GET | CommonFlags.SET);\r\n }\r\n\r\n /* @override */\r\n lookup(name: string): Element | null {\r\n return this.parent.lookup(name);\r\n }\r\n}\r\n\r\n/** A resolved property. */\r\nexport class Property extends VariableLikeElement {\r\n\r\n /** Prototype reference. */\r\n prototype: PropertyPrototype;\r\n /** Getter instance. */\r\n getterInstance: Function | null = null;\r\n /** Setter instance. */\r\n setterInstance: Function | null = null;\r\n\r\n /** Constructs a new property prototype. */\r\n constructor(\r\n /** Respective property prototype. */\r\n prototype: PropertyPrototype,\r\n /** Parent element, usually a static class prototype or class instance. */\r\n parent: Element\r\n ) {\r\n super(\r\n ElementKind.PROPERTY,\r\n prototype.name,\r\n parent,\r\n prototype.program.makeNativeVariableDeclaration(\r\n prototype.name,\r\n prototype.is(CommonFlags.INSTANCE)\r\n ? CommonFlags.INSTANCE\r\n : CommonFlags.NONE\r\n )\r\n );\r\n this.prototype = prototype;\r\n registerConcreteElement(this.program, this);\r\n }\r\n\r\n /* @override */\r\n lookup(name: string): Element | null {\r\n return this.parent.lookup(name);\r\n }\r\n}\r\n\r\n/** A yet unresolved class prototype. */\r\nexport class ClassPrototype extends DeclaredElement {\r\n\r\n /** Instance member prototypes. */\r\n instanceMembers: Map | null = null;\r\n /** Base class prototype, if applicable. */\r\n basePrototype: ClassPrototype | null = null; // set in Program#initialize\r\n /** Constructor prototype. */\r\n constructorPrototype: FunctionPrototype | null = null;\r\n /** Operator overload prototypes. */\r\n overloadPrototypes: Map = new Map();\r\n /** Already resolved instances. */\r\n instances: Map | null = null;\r\n\r\n constructor(\r\n /** Simple name. */\r\n name: string,\r\n /** Parent element, usually a file or namespace. */\r\n parent: Element,\r\n /** Declaration reference. */\r\n declaration: ClassDeclaration,\r\n /** Pre-checked flags indicating built-in decorators. */\r\n decoratorFlags: DecoratorFlags = DecoratorFlags.NONE,\r\n _isInterface: bool = false // FIXME\r\n ) {\r\n super(\r\n _isInterface ? ElementKind.INTERFACE_PROTOTYPE : ElementKind.CLASS_PROTOTYPE,\r\n name,\r\n mangleInternalName(name, parent, declaration.is(CommonFlags.INSTANCE)),\r\n parent.program,\r\n parent,\r\n declaration\r\n );\r\n this.decoratorFlags = decoratorFlags;\r\n }\r\n\r\n /** Gets the associated type parameter nodes. */\r\n get typeParameterNodes(): TypeParameterNode[] | null {\r\n return (this.declaration).typeParameters;\r\n }\r\n /** Gets the associated extends node. */\r\n get extendsNode(): TypeNode | null {\r\n return (this.declaration).extendsType;\r\n }\r\n /** Gets the associated implements nodes. */\r\n get implementsNodes(): TypeNode[] | null {\r\n return (this.declaration).implementsTypes;\r\n }\r\n\r\n /** Tests if this prototype is of a builtin array type (Array/TypedArray). */\r\n get isBuiltinArray(): bool {\r\n var arrayBufferViewInstance = this.program.arrayBufferViewInstance;\r\n return arrayBufferViewInstance !== null\r\n && this.extends(arrayBufferViewInstance.prototype);\r\n }\r\n\r\n /** Tests if this prototype extends the specified. */\r\n extends(basePtototype: ClassPrototype | null): bool {\r\n var current: ClassPrototype | null = this;\r\n do if (current === basePtototype) return true;\r\n while (current = current.basePrototype);\r\n return false;\r\n }\r\n\r\n /** Adds an element as an instance member of this one. Returns the previous element if a duplicate. */\r\n addInstance(name: string, element: DeclaredElement): bool {\r\n var originalDeclaration = element.declaration;\r\n var instanceMembers = this.instanceMembers;\r\n if (!instanceMembers) this.instanceMembers = instanceMembers = new Map();\r\n else if (instanceMembers.has(name)) {\r\n let merged = tryMerge(instanceMembers.get(name)!, element);\r\n if (!merged) {\r\n this.program.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n element.identifierNode.range, element.identifierNode.text\r\n );\r\n return false;\r\n }\r\n element = merged;\r\n }\r\n instanceMembers.set(name, element);\r\n if (element.is(CommonFlags.EXPORT) && this.is(CommonFlags.MODULE_EXPORT)) {\r\n element.set(CommonFlags.MODULE_EXPORT); // propagate\r\n }\r\n this.program.elementsByDeclaration.set(originalDeclaration, element);\r\n return true;\r\n }\r\n\r\n /** Gets the resolved instance for the specified instance key, if already resolved. */\r\n getResolvedInstance(instanceKey: string): Class | null {\r\n var instances = this.instances;\r\n if (instances && instances.has(instanceKey)) return instances.get(instanceKey);\r\n return null;\r\n }\r\n\r\n /** Sets the resolved instance for the specified instance key. */\r\n setResolvedInstance(instanceKey: string, instance: Class): void {\r\n var instances = this.instances;\r\n if (!instances) this.instances = instances = new Map();\r\n else assert(!instances.has(instanceKey));\r\n instances.set(instanceKey, instance);\r\n }\r\n\r\n /* @override */\r\n lookup(name: string): Element | null {\r\n return this.parent.lookup(name);\r\n }\r\n}\r\n\r\nconst enum AcyclicState {\r\n UNKNOWN,\r\n ACYCLIC,\r\n NOT_ACYCLIC\r\n}\r\n\r\n/** A resolved class. */\r\nexport class Class extends TypedElement {\r\n\r\n /** Class prototype. */\r\n prototype: ClassPrototype;\r\n /** Resolved type arguments. */\r\n typeArguments: Type[] | null;\r\n /** Base class, if applicable. */\r\n base: Class | null;\r\n /** Contextual type arguments for fields and methods. */\r\n contextualTypeArguments: Map | null = null;\r\n /** Current member memory offset. */\r\n currentMemoryOffset: u32 = 0;\r\n /** Constructor instance. */\r\n constructorInstance: Function | null = null;\r\n /** Operator overloads. */\r\n overloads: Map | null = null;\r\n /** Unique class id. */\r\n private _id: u32 = 0;\r\n /** Remembers acyclic state. */\r\n private _acyclic: AcyclicState = AcyclicState.UNKNOWN;\r\n /** Runtime type information flags. */\r\n rttiFlags: u32 = 0;\r\n\r\n /** Gets the unique runtime id of this class. */\r\n get id(): u32 {\r\n return this._id; // unmanaged remains 0 (=ArrayBuffer)\r\n }\r\n\r\n /** Tests if this class is of a builtin array type (Array/TypedArray). */\r\n get isBuiltinArray(): bool {\r\n return this.prototype.isBuiltinArray;\r\n }\r\n\r\n /** Tests if this class is array-like. */\r\n get isArrayLike(): bool {\r\n if (this.isBuiltinArray) return true;\r\n var lengthField = this.lookupInSelf(\"length\");\r\n return lengthField !== null && (\r\n lengthField.kind == ElementKind.FIELD ||\r\n (\r\n lengthField.kind == ElementKind.PROPERTY &&\r\n (lengthField).getterInstance !== null // TODO: resolve & check type?\r\n )\r\n ) && (\r\n this.lookupOverload(OperatorKind.INDEXED_GET) !== null ||\r\n this.lookupOverload(OperatorKind.UNCHECKED_INDEXED_GET) !== null\r\n );\r\n }\r\n\r\n /** Constructs a new class. */\r\n constructor(\r\n /** Name incl. type parameters, i.e. `Foo`. */\r\n nameInclTypeParameters: string,\r\n /** The respective class prototype. */\r\n prototype: ClassPrototype,\r\n /** Concrete type arguments, if any. */\r\n typeArguments: Type[] | null = null,\r\n /** Base class, if derived. */\r\n base: Class | null = null,\r\n _isInterface: bool = false // FIXME\r\n ) {\r\n super(\r\n _isInterface ? ElementKind.INTERFACE : ElementKind.CLASS,\r\n nameInclTypeParameters,\r\n mangleInternalName(nameInclTypeParameters, prototype.parent, prototype.is(CommonFlags.INSTANCE)),\r\n prototype.program,\r\n prototype.parent,\r\n prototype.declaration\r\n );\r\n var program = this.program;\r\n this.prototype = prototype;\r\n this.flags = prototype.flags;\r\n this.decoratorFlags = prototype.decoratorFlags;\r\n this.typeArguments = typeArguments;\r\n this.setType(program.options.usizeType.asClass(this));\r\n this.base = base;\r\n\r\n if (!this.hasDecorator(DecoratorFlags.UNMANAGED)) {\r\n let id = program.nextClassId++;\r\n this._id = id;\r\n program.managedClasses.set(id, this);\r\n }\r\n\r\n // inherit static members and contextual type arguments from base class\r\n if (base) {\r\n let inheritedTypeArguments = base.contextualTypeArguments;\r\n if (inheritedTypeArguments) {\r\n let contextualTypeArguments = this.contextualTypeArguments;\r\n for (let [baseName, baseType] of inheritedTypeArguments) {\r\n if (!contextualTypeArguments) this.contextualTypeArguments = contextualTypeArguments = new Map();\r\n contextualTypeArguments.set(baseName, baseType);\r\n }\r\n }\r\n }\r\n\r\n // apply pre-checked instance-specific contextual type arguments\r\n var typeParameters = prototype.typeParameterNodes;\r\n if (typeArguments) {\r\n let numTypeArguments = typeArguments.length;\r\n if (!typeParameters || numTypeArguments != typeParameters.length) {\r\n throw new Error(\"type argument count mismatch\");\r\n }\r\n if (numTypeArguments) {\r\n if (!this.contextualTypeArguments) this.contextualTypeArguments = new Map();\r\n for (let i = 0; i < numTypeArguments; ++i) {\r\n this.contextualTypeArguments.set(typeParameters[i].name.text, typeArguments[i]);\r\n }\r\n }\r\n } else if (typeParameters && typeParameters.length) {\r\n throw new Error(\"type argument count mismatch\");\r\n }\r\n registerConcreteElement(program, this);\r\n }\r\n\r\n /** Tests if a value of this class type is assignable to a target of the specified class type. */\r\n isAssignableTo(target: Class): bool {\r\n var current: Class | null = this;\r\n do if (current == target) return true;\r\n while (current = current.base);\r\n return false;\r\n }\r\n\r\n /** Looks up the operator overload of the specified kind. */\r\n lookupOverload(kind: OperatorKind, unchecked: bool = false): Function | null {\r\n if (unchecked) {\r\n switch (kind) {\r\n case OperatorKind.INDEXED_GET: {\r\n let uncheckedOverload = this.lookupOverload(OperatorKind.UNCHECKED_INDEXED_GET);\r\n if (uncheckedOverload) return uncheckedOverload;\r\n break;\r\n }\r\n case OperatorKind.INDEXED_SET: {\r\n let uncheckedOverload = this.lookupOverload(OperatorKind.UNCHECKED_INDEXED_SET);\r\n if (uncheckedOverload) return uncheckedOverload;\r\n break;\r\n }\r\n default: assert(false);\r\n }\r\n }\r\n var instance: Class | null = this;\r\n do {\r\n let overloads = instance.overloads;\r\n if (overloads) {\r\n let overload = overloads.get(kind);\r\n if (overload) return overload;\r\n }\r\n } while (instance = instance.base);\r\n return null;\r\n }\r\n\r\n /* @override */\r\n lookup(name: string): Element | null {\r\n return this.parent.lookup(name);\r\n }\r\n\r\n /** Calculates the memory offset of the specified field. */\r\n offsetof(fieldName: string): u32 {\r\n var members = assert(this.members);\r\n assert(members.has(fieldName));\r\n var field = members.get(fieldName);\r\n assert(field.kind == ElementKind.FIELD);\r\n return (field).memoryOffset;\r\n }\r\n\r\n /** Writes a field value to a buffer and returns the number of bytes written. */\r\n writeField(name: string, value: T, buffer: Uint8Array, baseOffset: i32): i32 {\r\n var field = this.lookupInSelf(name);\r\n if (field && field.kind == ElementKind.FIELD) {\r\n let offset = baseOffset + (field).memoryOffset;\r\n switch ((field).type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.U8: {\r\n writeI8(i32(value), buffer, offset);\r\n return 1;\r\n }\r\n case TypeKind.I16:\r\n case TypeKind.U16: {\r\n writeI16(i32(value), buffer, offset);\r\n return 2;\r\n }\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n writeI32(i32(value), buffer, offset);\r\n return 4;\r\n }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n assert(!this.program.options.isWasm64); // TODO\r\n writeI32(i32(value), buffer, offset);\r\n return 4;\r\n }\r\n case TypeKind.F32: {\r\n writeF32(f32(value), buffer, offset);\r\n return 4;\r\n }\r\n case TypeKind.F64: {\r\n writeF64(f64(value), buffer, offset);\r\n return 8;\r\n }\r\n }\r\n }\r\n assert(false);\r\n return 0;\r\n }\r\n\r\n /** Tests if this class extends the specified prototype. */\r\n extends(prototype: ClassPrototype): bool {\r\n return this.prototype.extends(prototype);\r\n }\r\n\r\n /** Gets the concrete type arguments to the specified extendend prototype. */\r\n getTypeArgumentsTo(extendedPrototype: ClassPrototype): Type[] | null {\r\n var current: Class | null = this;\r\n do if (current.prototype === extendedPrototype) return current.typeArguments;\r\n while (current = current.base);\r\n return null;\r\n }\r\n\r\n /** Gets the value type of an array. Must be an array. */\r\n getArrayValueType(): Type {\r\n var current: Class = this;\r\n var program = this.program;\r\n var abvInstance = program.arrayBufferViewInstance;\r\n while (current.base !== abvInstance) {\r\n current = assert(current.base);\r\n }\r\n switch (current.prototype) {\r\n case program.i8ArrayPrototype: return Type.i8;\r\n case program.i16ArrayPrototype: return Type.i16;\r\n case program.i32ArrayPrototype: return Type.i32;\r\n case program.i64ArrayPrototype: return Type.i64;\r\n case program.u8ArrayPrototype:\r\n case program.u8ClampedArrayPrototype: return Type.u8;\r\n case program.u16ArrayPrototype: return Type.u16;\r\n case program.u32ArrayPrototype: return Type.u32;\r\n case program.u64ArrayPrototype: return Type.u64;\r\n case program.f32ArrayPrototype: return Type.f32;\r\n case program.f64ArrayPrototype: return Type.f64;\r\n case program.arrayPrototype: return assert(this.getTypeArgumentsTo(program.arrayPrototype))[0];\r\n default: assert(false);\r\n }\r\n return Type.void;\r\n }\r\n\r\n /** Tests if this class is inherently acyclic. */\r\n get isAcyclic(): bool {\r\n var acyclic = this._acyclic;\r\n if (acyclic == AcyclicState.UNKNOWN) {\r\n let hasCycle = this.cyclesTo(this);\r\n if (hasCycle) this._acyclic = acyclic = AcyclicState.NOT_ACYCLIC;\r\n else this._acyclic = acyclic = AcyclicState.ACYCLIC;\r\n }\r\n return acyclic == AcyclicState.ACYCLIC;\r\n }\r\n\r\n /** Tests if this class potentially forms a reference cycle to another one. */\r\n private cyclesTo(other: Class, except: Set = new Set()): bool {\r\n // TODO: The pure RC paper describes acyclic data structures as classes that may contain\r\n //\r\n // - scalars\r\n // - references to classes that are both acyclic and final (here: Java); and\r\n // - arrays (in our case: also sets, maps) of either of the above\r\n //\r\n // Our implementation, however, treats all objects that do not reference themselves directly\r\n // or indirectly as acylic, allowing them to contain inner cycles of other non-acyclic objects.\r\n // This contradicts the second assumption and must be revisited when actually implementing RC.\r\n\r\n if (except.has(this)) return false;\r\n except.add(this); // don't recurse indefinitely\r\n\r\n // Find out if any field references 'other' directly or indirectly\r\n var current: Class | null;\r\n var members = this.members;\r\n if (members) {\r\n for (let member of members.values()) {\r\n if (\r\n member.kind == ElementKind.FIELD &&\r\n (current = (member).type.classReference) !== null &&\r\n (\r\n current === other ||\r\n current.cyclesTo(other, except)\r\n )\r\n ) return true;\r\n }\r\n }\r\n\r\n // Do the same for non-field data\r\n var basePrototype: ClassPrototype | null;\r\n\r\n // Arrayother?>\r\n if ((basePrototype = this.program.arrayPrototype) && this.prototype.extends(basePrototype)) {\r\n let typeArguments = assert(this.getTypeArgumentsTo(basePrototype));\r\n assert(typeArguments.length == 1);\r\n if (\r\n (current = typeArguments[0].classReference) !== null &&\r\n (\r\n current === other ||\r\n current.cyclesTo(other, except)\r\n )\r\n ) return true;\r\n\r\n // Setother?>\r\n } else if ((basePrototype = this.program.setPrototype) && this.prototype.extends(basePrototype)) {\r\n let typeArguments = assert(this.getTypeArgumentsTo(basePrototype));\r\n assert(typeArguments.length == 1);\r\n if (\r\n (current = typeArguments[0].classReference) !== null &&\r\n (\r\n current === other ||\r\n current.cyclesTo(other, except)\r\n )\r\n ) return true;\r\n\r\n // Mapother?,V->other?>\r\n } else if ((basePrototype = this.program.mapPrototype) && this.prototype.extends(basePrototype)) {\r\n let typeArguments = assert(this.getTypeArgumentsTo(basePrototype));\r\n assert(typeArguments.length == 2);\r\n if (\r\n (current = typeArguments[0].classReference) !== null &&\r\n (\r\n current === other ||\r\n current.cyclesTo(other, except)\r\n )\r\n ) return true;\r\n if (\r\n (current = typeArguments[1].classReference) !== null &&\r\n (\r\n current === other ||\r\n current.cyclesTo(other, except)\r\n )\r\n ) return true;\r\n }\r\n return false;\r\n }\r\n}\r\n\r\n/** A yet unresolved interface. */\r\nexport class InterfacePrototype extends ClassPrototype { // FIXME\r\n\r\n /** Constructs a new interface prototype. */\r\n constructor(\r\n name: string,\r\n parent: Element,\r\n declaration: InterfaceDeclaration,\r\n decoratorFlags: DecoratorFlags\r\n ) {\r\n super(\r\n name,\r\n parent,\r\n declaration,\r\n decoratorFlags,\r\n true\r\n );\r\n }\r\n}\r\n\r\n/** A resolved interface. */\r\nexport class Interface extends Class { // FIXME\r\n\r\n /** Constructs a new interface. */\r\n constructor(\r\n nameInclTypeParameters: string,\r\n prototype: InterfacePrototype,\r\n typeArguments: Type[] = [],\r\n base: Interface | null = null\r\n ) {\r\n super(\r\n nameInclTypeParameters,\r\n prototype,\r\n typeArguments,\r\n base,\r\n true\r\n );\r\n }\r\n}\r\n\r\n/** Registers a concrete element with a program. */\r\nfunction registerConcreteElement(program: Program, element: Element): void {\r\n assert(!program.instancesByName.has(element.internalName));\r\n program.instancesByName.set(element.internalName, element);\r\n}\r\n\r\n/** Attempts to merge two elements. Returns the merged element on success. */\r\nfunction tryMerge(older: Element, newer: Element): DeclaredElement | null {\r\n // NOTE: some of the following cases are not supported by TS, not sure why exactly.\r\n // suggesting to just merge what seems to be possible for now and revisit later.\r\n assert(older.program === newer.program);\r\n assert(!newer.members);\r\n var merged: DeclaredElement | null = null;\r\n switch (older.kind) {\r\n case ElementKind.FUNCTION_PROTOTYPE: {\r\n switch (newer.kind) {\r\n case ElementKind.NAMESPACE: {\r\n copyMembers(newer, older);\r\n merged = older;\r\n break;\r\n }\r\n case ElementKind.TYPEDEFINITION: {\r\n if (!older.shadowType) {\r\n older.shadowType = newer;\r\n copyMembers(newer, older);\r\n merged = older;\r\n }\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n case ElementKind.CLASS_PROTOTYPE:\r\n case ElementKind.ENUM: {\r\n if (newer.kind == ElementKind.NAMESPACE) {\r\n copyMembers(newer, older);\r\n merged = older;\r\n break;\r\n }\r\n break;\r\n }\r\n case ElementKind.NAMESPACE: {\r\n switch (newer.kind) {\r\n case ElementKind.ENUM:\r\n case ElementKind.CLASS_PROTOTYPE: // TS2434\r\n case ElementKind.FUNCTION_PROTOTYPE: { // TS2434\r\n copyMembers(older, newer);\r\n merged = newer;\r\n break;\r\n }\r\n case ElementKind.NAMESPACE: {\r\n copyMembers(newer, older);\r\n merged = older;\r\n break;\r\n }\r\n case ElementKind.TYPEDEFINITION: {\r\n if (!older.shadowType) {\r\n older.shadowType = newer;\r\n copyMembers(newer, older);\r\n merged = older;\r\n }\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n case ElementKind.GLOBAL: {\r\n if (newer.kind == ElementKind.TYPEDEFINITION) {\r\n if (!older.shadowType) {\r\n older.shadowType = newer;\r\n copyMembers(newer, older);\r\n merged = older;\r\n }\r\n }\r\n break;\r\n }\r\n case ElementKind.TYPEDEFINITION: {\r\n switch (newer.kind) {\r\n case ElementKind.GLOBAL:\r\n case ElementKind.FUNCTION_PROTOTYPE:\r\n case ElementKind.NAMESPACE: {\r\n if (!newer.shadowType) {\r\n newer.shadowType = older;\r\n copyMembers(older, newer);\r\n merged = newer;\r\n }\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n if (merged) {\r\n let olderIsExport = older.is(CommonFlags.EXPORT) || older.hasDecorator(DecoratorFlags.GLOBAL);\r\n let newerIsExport = newer.is(CommonFlags.EXPORT) || newer.hasDecorator(DecoratorFlags.GLOBAL);\r\n if (olderIsExport != newerIsExport) {\r\n older.program.error(\r\n DiagnosticCode.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local,\r\n merged.identifierNode.range, merged.identifierNode.text\r\n );\r\n }\r\n }\r\n return merged;\r\n}\r\n\r\n/** Copies the members of `src` to `dest`. */\r\nfunction copyMembers(src: Element, dest: Element): void {\r\n var srcMembers = src.members;\r\n if (srcMembers) {\r\n let destMembers = dest.members;\r\n if (!destMembers) dest.members = destMembers = new Map();\r\n for (let [memberName, member] of srcMembers) {\r\n destMembers.set(memberName, member);\r\n }\r\n }\r\n}\r\n\r\n/** Mangles the internal name of an element with the specified name that is a child of the given parent. */\r\nexport function mangleInternalName(name: string, parent: Element, isInstance: bool, asGlobal: bool = false): string {\r\n switch (parent.kind) {\r\n case ElementKind.FILE: {\r\n if (asGlobal) return name;\r\n return parent.internalName + PATH_DELIMITER + name;\r\n }\r\n case ElementKind.FUNCTION: {\r\n if (asGlobal) return name;\r\n assert(!isInstance);\r\n return parent.internalName + INNER_DELIMITER + name;\r\n }\r\n default: {\r\n return mangleInternalName(parent.name, parent.parent, parent.is(CommonFlags.INSTANCE), asGlobal)\r\n + (isInstance ? INSTANCE_DELIMITER : STATIC_DELIMITER) + name;\r\n }\r\n }\r\n}\r\n","/**\r\n * A thin wrapper around Binaryen's C-API.\r\n * @module module\r\n *//***/\r\n\r\nimport { Target } from \"./common\";\r\n\r\nexport type ModuleRef = usize;\r\nexport type FunctionTypeRef = usize;\r\nexport type FunctionRef = usize;\r\nexport type ExpressionRef = usize;\r\nexport type GlobalRef = usize;\r\nexport type ImportRef = usize;\r\nexport type ExportRef = usize;\r\nexport type RelooperRef = usize;\r\nexport type RelooperBlockRef = usize;\r\nexport type Index = u32;\r\n\r\nexport enum NativeType {\r\n None = _BinaryenTypeNone(),\r\n I32 = _BinaryenTypeInt32(),\r\n I64 = _BinaryenTypeInt64(),\r\n F32 = _BinaryenTypeFloat32(),\r\n F64 = _BinaryenTypeFloat64(),\r\n V128 = _BinaryenTypeVec128(),\r\n Unreachable = _BinaryenTypeUnreachable(),\r\n Auto = _BinaryenTypeAuto()\r\n}\r\n\r\nexport enum FeatureFlags {\r\n Atomics = _BinaryenFeatureAtomics(),\r\n MutableGloabls = _BinaryenFeatureMutableGlobals(),\r\n NontrappingFPToInt = _BinaryenFeatureNontrappingFPToInt(),\r\n SIMD128 = _BinaryenFeatureSIMD128(),\r\n BulkMemory = _BinaryenFeatureBulkMemory(),\r\n SignExt = _BinaryenFeatureSignExt(),\r\n ExceptionHandling = _BinaryenFeatureExceptionHandling()\r\n}\r\n\r\nexport enum ExpressionId {\r\n Invalid = _BinaryenInvalidId(),\r\n Block = _BinaryenBlockId(),\r\n If = _BinaryenIfId(),\r\n Loop = _BinaryenLoopId(),\r\n Break = _BinaryenBreakId(),\r\n Switch = _BinaryenSwitchId(),\r\n Call = _BinaryenCallId(),\r\n CallIndirect = _BinaryenCallIndirectId(),\r\n LocalGet = _BinaryenLocalGetId(),\r\n LocalSet = _BinaryenLocalSetId(),\r\n GlobalGet = _BinaryenGlobalGetId(),\r\n GlobalSet = _BinaryenGlobalSetId(),\r\n Load = _BinaryenLoadId(),\r\n Store = _BinaryenStoreId(),\r\n Const = _BinaryenConstId(),\r\n Unary = _BinaryenUnaryId(),\r\n Binary = _BinaryenBinaryId(),\r\n Select = _BinaryenSelectId(),\r\n Drop = _BinaryenDropId(),\r\n Return = _BinaryenReturnId(),\r\n Host = _BinaryenHostId(),\r\n Nop = _BinaryenNopId(),\r\n Unreachable = _BinaryenUnreachableId(),\r\n AtomicCmpxchg = _BinaryenAtomicCmpxchgId(),\r\n AtomicRMW = _BinaryenAtomicRMWId(),\r\n AtomicWait = _BinaryenAtomicWaitId(),\r\n AtomicNotify = _BinaryenAtomicNotifyId(),\r\n SIMDExtract = _BinaryenSIMDExtractId(),\r\n SIMDReplace = _BinaryenSIMDReplaceId(),\r\n SIMDShuffle = _BinaryenSIMDShuffleId(),\r\n SIMDBitselect = _BinaryenSIMDBitselectId(),\r\n SIMDShift = _BinaryenSIMDShiftId(),\r\n MemoryInit = _BinaryenMemoryInitId(),\r\n DataDrop = _BinaryenDataDropId(),\r\n MemoryCopy = _BinaryenMemoryCopyId(),\r\n MemoryFill = _BinaryenMemoryFillId()\r\n}\r\n\r\nexport enum UnaryOp {\r\n ClzI32 = _BinaryenClzInt32(),\r\n CtzI32 = _BinaryenCtzInt32(),\r\n PopcntI32 = _BinaryenPopcntInt32(),\r\n NegF32 = _BinaryenNegFloat32(),\r\n AbsF32 = _BinaryenAbsFloat32(),\r\n CeilF32 = _BinaryenCeilFloat32(),\r\n FloorF32 = _BinaryenFloorFloat32(),\r\n TruncF32 = _BinaryenTruncFloat32(),\r\n NearestF32 = _BinaryenNearestFloat32(),\r\n SqrtF32 = _BinaryenSqrtFloat32(),\r\n EqzI32 = _BinaryenEqZInt32(),\r\n ClzI64 = _BinaryenClzInt64(),\r\n CtzI64 = _BinaryenCtzInt64(),\r\n PopcntI64 = _BinaryenPopcntInt64(),\r\n NegF64 = _BinaryenNegFloat64(),\r\n AbsF64 = _BinaryenAbsFloat64(),\r\n CeilF64 = _BinaryenCeilFloat64(),\r\n FloorF64 = _BinaryenFloorFloat64(),\r\n TruncF64 = _BinaryenTruncFloat64(),\r\n NearestF64 = _BinaryenNearestFloat64(),\r\n SqrtF64 = _BinaryenSqrtFloat64(),\r\n EqzI64 = _BinaryenEqZInt64(),\r\n ExtendI32 = _BinaryenExtendSInt32(),\r\n ExtendU32 = _BinaryenExtendUInt32(),\r\n WrapI64 = _BinaryenWrapInt64(),\r\n TruncF32ToI32 = _BinaryenTruncSFloat32ToInt32(),\r\n TruncF32ToI64 = _BinaryenTruncSFloat32ToInt64(),\r\n TruncF32ToU32 = _BinaryenTruncUFloat32ToInt32(),\r\n TruncF32ToU64 = _BinaryenTruncUFloat32ToInt64(),\r\n TruncF64ToI32 = _BinaryenTruncSFloat64ToInt32(),\r\n TruncF64ToI64 = _BinaryenTruncSFloat64ToInt64(),\r\n TruncF64ToU32 = _BinaryenTruncUFloat64ToInt32(),\r\n TruncF64ToU64 = _BinaryenTruncUFloat64ToInt64(),\r\n ReinterpretF32 = _BinaryenReinterpretFloat32(),\r\n ReinterpretF64 = _BinaryenReinterpretFloat64(),\r\n ConvertI32ToF32 = _BinaryenConvertSInt32ToFloat32(),\r\n ConvertI32ToF64 = _BinaryenConvertSInt32ToFloat64(),\r\n ConvertU32ToF32 = _BinaryenConvertUInt32ToFloat32(),\r\n ConvertU32ToF64 = _BinaryenConvertUInt32ToFloat64(),\r\n ConvertI64ToF32 = _BinaryenConvertSInt64ToFloat32(),\r\n ConvertI64ToF64 = _BinaryenConvertSInt64ToFloat64(),\r\n ConvertU64ToF32 = _BinaryenConvertUInt64ToFloat32(),\r\n ConvertU64ToF64 = _BinaryenConvertUInt64ToFloat64(),\r\n PromoteF32 = _BinaryenPromoteFloat32(),\r\n DemoteF64 = _BinaryenDemoteFloat64(),\r\n ReinterpretI32 = _BinaryenReinterpretInt32(),\r\n ReinterpretI64 = _BinaryenReinterpretInt64(),\r\n\r\n // see: https://github.com/WebAssembly/sign-extension-ops\r\n ExtendI8ToI32 = _BinaryenExtendS8Int32(),\r\n ExtendI16ToI32 = _BinaryenExtendS16Int32(),\r\n ExtendI8ToI64 = _BinaryenExtendS8Int64(),\r\n ExtendI16ToI64 = _BinaryenExtendS16Int64(),\r\n ExtendI32ToI64 = _BinaryenExtendS32Int64(),\r\n\r\n // see: https://github.com/WebAssembly/nontrapping-float-to-int-conversions\r\n // TruncF32ToI32Sat\r\n // TruncF32ToU32Sat\r\n // TruncF64ToI32Sat\r\n // TruncF64ToU32Sat\r\n // TruncF32ToI64Sat\r\n // TruncF32ToU64Sat\r\n // TruncF64ToI64Sat\r\n // TruncF64ToU64Sat\r\n\r\n // see: https://github.com/WebAssembly/simd\r\n SplatVecI8x16 = _BinaryenSplatVecI8x16(),\r\n SplatVecI16x8 = _BinaryenSplatVecI16x8(),\r\n SplatVecI32x4 = _BinaryenSplatVecI32x4(),\r\n SplatVecI64x2 = _BinaryenSplatVecI64x2(),\r\n SplatVecF32x4 = _BinaryenSplatVecF32x4(),\r\n SplatVecF64x2 = _BinaryenSplatVecF64x2(),\r\n NotVec128 = _BinaryenNotVec128(),\r\n NegVecI8x16 = _BinaryenNegVecI8x16(),\r\n AnyTrueVecI8x16 = _BinaryenAnyTrueVecI8x16(),\r\n AllTrueVecI8x16 = _BinaryenAllTrueVecI8x16(),\r\n NegVecI16x8 = _BinaryenNegVecI16x8(),\r\n AnyTrueVecI16x8 = _BinaryenAnyTrueVecI16x8(),\r\n AllTrueVecI16x8 = _BinaryenAllTrueVecI16x8(),\r\n NegVecI32x4 = _BinaryenNegVecI32x4(),\r\n AnyTrueVecI32x4 = _BinaryenAnyTrueVecI32x4(),\r\n AllTrueVecI32x4 = _BinaryenAllTrueVecI32x4(),\r\n NegVecI64x2 = _BinaryenNegVecI64x2(),\r\n AnyTrueVecI64x2 = _BinaryenAnyTrueVecI64x2(),\r\n AllTrueVecI64x2 = _BinaryenAllTrueVecI64x2(),\r\n AbsVecF32x4 = _BinaryenAbsVecF32x4(),\r\n NegVecF32x4 = _BinaryenNegVecF32x4(),\r\n SqrtVecF32x4 = _BinaryenSqrtVecF32x4(),\r\n AbsVecF64x2 = _BinaryenAbsVecF64x2(),\r\n NegVecF64x2 = _BinaryenNegVecF64x2(),\r\n SqrtVecF64x2 = _BinaryenSqrtVecF64x2(),\r\n TruncSatSVecF32x4ToVecI32x4 = _BinaryenTruncSatSVecF32x4ToVecI32x4(),\r\n TruncSatUVecF32x4ToVecI32x4 = _BinaryenTruncSatUVecF32x4ToVecI32x4(),\r\n TruncSatSVecF64x2ToVecI64x2 = _BinaryenTruncSatSVecF64x2ToVecI64x2(),\r\n TruncSatUVecF64x2ToVecI64x2 = _BinaryenTruncSatUVecF64x2ToVecI64x2(),\r\n ConvertSVecI32x4ToVecF32x4 = _BinaryenConvertSVecI32x4ToVecF32x4(),\r\n ConvertUVecI32x4ToVecF32x4 = _BinaryenConvertUVecI32x4ToVecF32x4(),\r\n ConvertSVecI64x2ToVecF64x2 = _BinaryenConvertSVecI64x2ToVecF64x2(),\r\n ConvertUVecI64x2ToVecF64x2 = _BinaryenConvertUVecI64x2ToVecF64x2()\r\n}\r\n\r\nexport enum BinaryOp {\r\n AddI32 = _BinaryenAddInt32(),\r\n SubI32 = _BinaryenSubInt32(),\r\n MulI32 = _BinaryenMulInt32(),\r\n DivI32 = _BinaryenDivSInt32(),\r\n DivU32 = _BinaryenDivUInt32(),\r\n RemI32 = _BinaryenRemSInt32(),\r\n RemU32 = _BinaryenRemUInt32(),\r\n AndI32 = _BinaryenAndInt32(),\r\n OrI32 = _BinaryenOrInt32(),\r\n XorI32 = _BinaryenXorInt32(),\r\n ShlI32 = _BinaryenShlInt32(),\r\n ShrU32 = _BinaryenShrUInt32(),\r\n ShrI32 = _BinaryenShrSInt32(),\r\n RotlI32 = _BinaryenRotLInt32(),\r\n RotrI32 = _BinaryenRotRInt32(),\r\n EqI32 = _BinaryenEqInt32(),\r\n NeI32 = _BinaryenNeInt32(),\r\n LtI32 = _BinaryenLtSInt32(),\r\n LtU32 = _BinaryenLtUInt32(),\r\n LeI32 = _BinaryenLeSInt32(),\r\n LeU32 = _BinaryenLeUInt32(),\r\n GtI32 = _BinaryenGtSInt32(),\r\n GtU32 = _BinaryenGtUInt32(),\r\n GeI32 = _BinaryenGeSInt32(),\r\n GeU32 = _BinaryenGeUInt32(),\r\n AddI64 = _BinaryenAddInt64(),\r\n SubI64 = _BinaryenSubInt64(),\r\n MulI64 = _BinaryenMulInt64(),\r\n DivI64 = _BinaryenDivSInt64(),\r\n DivU64 = _BinaryenDivUInt64(),\r\n RemI64 = _BinaryenRemSInt64(),\r\n RemU64 = _BinaryenRemUInt64(),\r\n AndI64 = _BinaryenAndInt64(),\r\n OrI64 = _BinaryenOrInt64(),\r\n XorI64 = _BinaryenXorInt64(),\r\n ShlI64 = _BinaryenShlInt64(),\r\n ShrU64 = _BinaryenShrUInt64(),\r\n ShrI64 = _BinaryenShrSInt64(),\r\n RotlI64 = _BinaryenRotLInt64(),\r\n RotrI64 = _BinaryenRotRInt64(),\r\n EqI64 = _BinaryenEqInt64(),\r\n NeI64 = _BinaryenNeInt64(),\r\n LtI64 = _BinaryenLtSInt64(),\r\n LtU64 = _BinaryenLtUInt64(),\r\n LeI64 = _BinaryenLeSInt64(),\r\n LeU64 = _BinaryenLeUInt64(),\r\n GtI64 = _BinaryenGtSInt64(),\r\n GtU64 = _BinaryenGtUInt64(),\r\n GeI64 = _BinaryenGeSInt64(),\r\n GeU64 = _BinaryenGeUInt64(),\r\n AddF32 = _BinaryenAddFloat32(),\r\n SubF32 = _BinaryenSubFloat32(),\r\n MulF32 = _BinaryenMulFloat32(),\r\n DivF32 = _BinaryenDivFloat32(),\r\n CopysignF32 = _BinaryenCopySignFloat32(),\r\n MinF32 = _BinaryenMinFloat32(),\r\n MaxF32 = _BinaryenMaxFloat32(),\r\n EqF32 = _BinaryenEqFloat32(),\r\n NeF32 = _BinaryenNeFloat32(),\r\n LtF32 = _BinaryenLtFloat32(),\r\n LeF32 = _BinaryenLeFloat32(),\r\n GtF32 = _BinaryenGtFloat32(),\r\n GeF32 = _BinaryenGeFloat32(),\r\n AddF64 = _BinaryenAddFloat64(),\r\n SubF64 = _BinaryenSubFloat64(),\r\n MulF64 = _BinaryenMulFloat64(),\r\n DivF64 = _BinaryenDivFloat64(),\r\n CopysignF64 = _BinaryenCopySignFloat64(),\r\n MinF64 = _BinaryenMinFloat64(),\r\n MaxF64 = _BinaryenMaxFloat64(),\r\n EqF64 = _BinaryenEqFloat64(),\r\n NeF64 = _BinaryenNeFloat64(),\r\n LtF64 = _BinaryenLtFloat64(),\r\n LeF64 = _BinaryenLeFloat64(),\r\n GtF64 = _BinaryenGtFloat64(),\r\n GeF64 = _BinaryenGeFloat64(),\r\n\r\n // see: https://github.com/WebAssembly/simd\r\n EqVecI8x16 = _BinaryenEqVecI8x16(),\r\n NeVecI8x16 = _BinaryenNeVecI8x16(),\r\n LtSVecI8x16 = _BinaryenLtSVecI8x16(),\r\n LtUVecI8x16 = _BinaryenLtUVecI8x16(),\r\n LeSVecI8x16 = _BinaryenLeSVecI8x16(),\r\n LeUVecI8x16 = _BinaryenLeUVecI8x16(),\r\n GtSVecI8x16 = _BinaryenGtSVecI8x16(),\r\n GtUVecI8x16 = _BinaryenGtUVecI8x16(),\r\n GeSVecI8x16 = _BinaryenGeSVecI8x16(),\r\n GeUVecI8x16 = _BinaryenGeUVecI8x16(),\r\n EqVecI16x8 = _BinaryenEqVecI16x8(),\r\n NeVecI16x8 = _BinaryenNeVecI16x8(),\r\n LtSVecI16x8 = _BinaryenLtSVecI16x8(),\r\n LtUVecI16x8 = _BinaryenLtUVecI16x8(),\r\n LeSVecI16x8 = _BinaryenLeSVecI16x8(),\r\n LeUVecI16x8 = _BinaryenLeUVecI16x8(),\r\n GtSVecI16x8 = _BinaryenGtSVecI16x8(),\r\n GtUVecI16x8 = _BinaryenGtUVecI16x8(),\r\n GeSVecI16x8 = _BinaryenGeSVecI16x8(),\r\n GeUVecI16x8 = _BinaryenGeUVecI16x8(),\r\n EqVecI32x4 = _BinaryenEqVecI32x4(),\r\n NeVecI32x4 = _BinaryenNeVecI32x4(),\r\n LtSVecI32x4 = _BinaryenLtSVecI32x4(),\r\n LtUVecI32x4 = _BinaryenLtUVecI32x4(),\r\n LeSVecI32x4 = _BinaryenLeSVecI32x4(),\r\n LeUVecI32x4 = _BinaryenLeUVecI32x4(),\r\n GtSVecI32x4 = _BinaryenGtSVecI32x4(),\r\n GtUVecI32x4 = _BinaryenGtUVecI32x4(),\r\n GeSVecI32x4 = _BinaryenGeSVecI32x4(),\r\n GeUVecI32x4 = _BinaryenGeUVecI32x4(),\r\n EqVecF32x4 = _BinaryenEqVecF32x4(),\r\n NeVecF32x4 = _BinaryenNeVecF32x4(),\r\n LtVecF32x4 = _BinaryenLtVecF32x4(),\r\n LeVecF32x4 = _BinaryenLeVecF32x4(),\r\n GtVecF32x4 = _BinaryenGtVecF32x4(),\r\n GeVecF32x4 = _BinaryenGeVecF32x4(),\r\n EqVecF64x2 = _BinaryenEqVecF64x2(),\r\n NeVecF64x2 = _BinaryenNeVecF64x2(),\r\n LtVecF64x2 = _BinaryenLtVecF64x2(),\r\n LeVecF64x2 = _BinaryenLeVecF64x2(),\r\n GtVecF64x2 = _BinaryenGtVecF64x2(),\r\n GeVecF64x2 = _BinaryenGeVecF64x2(),\r\n AndVec128 = _BinaryenAndVec128(),\r\n OrVec128 = _BinaryenOrVec128(),\r\n XorVec128 = _BinaryenXorVec128(),\r\n AddVecI8x16 = _BinaryenAddVecI8x16(),\r\n AddSatSVecI8x16 = _BinaryenAddSatSVecI8x16(),\r\n AddSatUVecI8x16 = _BinaryenAddSatUVecI8x16(),\r\n SubVecI8x16 = _BinaryenSubVecI8x16(),\r\n SubSatSVecI8x16 = _BinaryenSubSatSVecI8x16(),\r\n SubSatUVecI8x16 = _BinaryenSubSatUVecI8x16(),\r\n MulVecI8x16 = _BinaryenMulVecI8x16(),\r\n AddVecI16x8 = _BinaryenAddVecI16x8(),\r\n AddSatSVecI16x8 = _BinaryenAddSatSVecI16x8(),\r\n AddSatUVecI16x8 = _BinaryenAddSatUVecI16x8(),\r\n SubVecI16x8 = _BinaryenSubVecI16x8(),\r\n SubSatSVecI16x8 = _BinaryenSubSatSVecI16x8(),\r\n SubSatUVecI16x8 = _BinaryenSubSatUVecI16x8(),\r\n MulVecI16x8 = _BinaryenMulVecI16x8(),\r\n AddVecI32x4 = _BinaryenAddVecI32x4(),\r\n SubVecI32x4 = _BinaryenSubVecI32x4(),\r\n MulVecI32x4 = _BinaryenMulVecI32x4(),\r\n AddVecI64x2 = _BinaryenAddVecI64x2(),\r\n SubVecI64x2 = _BinaryenSubVecI64x2(),\r\n AddVecF32x4 = _BinaryenAddVecF32x4(),\r\n SubVecF32x4 = _BinaryenSubVecF32x4(),\r\n MulVecF32x4 = _BinaryenMulVecF32x4(),\r\n DivVecF32x4 = _BinaryenDivVecF32x4(),\r\n MinVecF32x4 = _BinaryenMinVecF32x4(),\r\n MaxVecF32x4 = _BinaryenMaxVecF32x4(),\r\n AddVecF64x2 = _BinaryenAddVecF64x2(),\r\n SubVecF64x2 = _BinaryenSubVecF64x2(),\r\n MulVecF64x2 = _BinaryenMulVecF64x2(),\r\n DivVecF64x2 = _BinaryenDivVecF64x2(),\r\n MinVecF64x2 = _BinaryenMinVecF64x2(),\r\n MaxVecF64x2 = _BinaryenMaxVecF64x2()\r\n}\r\n\r\nexport enum HostOp {\r\n MemorySize = _BinaryenMemorySize(),\r\n MemoryGrow = _BinaryenMemoryGrow(),\r\n}\r\n\r\nexport enum AtomicRMWOp {\r\n Add = _BinaryenAtomicRMWAdd(),\r\n Sub = _BinaryenAtomicRMWSub(),\r\n And = _BinaryenAtomicRMWAnd(),\r\n Or = _BinaryenAtomicRMWOr(),\r\n Xor = _BinaryenAtomicRMWXor(),\r\n Xchg = _BinaryenAtomicRMWXchg()\r\n}\r\n\r\nexport enum SIMDExtractOp {\r\n ExtractLaneSVecI8x16 = _BinaryenExtractLaneSVecI8x16(),\r\n ExtractLaneUVecI8x16 = _BinaryenExtractLaneUVecI8x16(),\r\n ExtractLaneSVecI16x8 = _BinaryenExtractLaneSVecI16x8(),\r\n ExtractLaneUVecI16x8 = _BinaryenExtractLaneUVecI16x8(),\r\n ExtractLaneVecI32x4 = _BinaryenExtractLaneVecI32x4(),\r\n ExtractLaneVecI64x2 = _BinaryenExtractLaneVecI64x2(),\r\n ExtractLaneVecF32x4 = _BinaryenExtractLaneVecF32x4(),\r\n ExtractLaneVecF64x2 = _BinaryenExtractLaneVecF64x2(),\r\n}\r\n\r\nexport enum SIMDReplaceOp {\r\n ReplaceLaneVecI8x16 = _BinaryenReplaceLaneVecI8x16(),\r\n ReplaceLaneVecI16x8 = _BinaryenReplaceLaneVecI16x8(),\r\n ReplaceLaneVecI32x4 = _BinaryenReplaceLaneVecI32x4(),\r\n ReplaceLaneVecI64x2 = _BinaryenReplaceLaneVecI64x2(),\r\n ReplaceLaneVecF32x4 = _BinaryenReplaceLaneVecF32x4(),\r\n ReplaceLaneVecF64x2 = _BinaryenReplaceLaneVecF64x2()\r\n}\r\n\r\nexport enum SIMDShiftOp {\r\n ShlVecI8x16 = _BinaryenShlVecI8x16(),\r\n ShrSVecI8x16 = _BinaryenShrSVecI8x16(),\r\n ShrUVecI8x16 = _BinaryenShrUVecI8x16(),\r\n ShlVecI16x8 = _BinaryenShlVecI16x8(),\r\n ShrSVecI16x8 = _BinaryenShrSVecI16x8(),\r\n ShrUVecI16x8 = _BinaryenShrUVecI16x8(),\r\n ShlVecI32x4 = _BinaryenShlVecI32x4(),\r\n ShrSVecI32x4 = _BinaryenShrSVecI32x4(),\r\n ShrUVecI32x4 = _BinaryenShrUVecI32x4(),\r\n ShlVecI64x2 = _BinaryenShlVecI64x2(),\r\n ShrSVecI64x2 = _BinaryenShrSVecI64x2(),\r\n ShrUVecI64x2 = _BinaryenShrUVecI64x2()\r\n}\r\n\r\nexport class MemorySegment {\r\n\r\n buffer: Uint8Array;\r\n offset: I64;\r\n\r\n static create(buffer: Uint8Array, offset: I64): MemorySegment {\r\n var segment = new MemorySegment();\r\n segment.buffer = buffer;\r\n segment.offset = offset;\r\n return segment;\r\n }\r\n}\r\n\r\nexport class Module {\r\n\r\n ref: ModuleRef;\r\n\r\n private lit: usize;\r\n\r\n static create(): Module {\r\n var module = new Module();\r\n module.ref = _BinaryenModuleCreate();\r\n module.lit = memory.allocate(_BinaryenSizeofLiteral());\r\n return module;\r\n }\r\n\r\n static createFrom(buffer: Uint8Array): Module {\r\n var cArr = allocU8Array(buffer);\r\n try {\r\n let module = new Module();\r\n module.ref = _BinaryenModuleRead(cArr, buffer.length);\r\n module.lit = memory.allocate(_BinaryenSizeofLiteral());\r\n return module;\r\n } finally {\r\n memory.free(changetype(cArr));\r\n }\r\n }\r\n\r\n private constructor() { }\r\n\r\n // types\r\n\r\n addFunctionType(\r\n name: string,\r\n result: NativeType,\r\n paramTypes: NativeType[] | null\r\n ): FunctionRef {\r\n var cStr = this.allocStringCached(name);\r\n var cArr = allocI32Array(paramTypes);\r\n try {\r\n return _BinaryenAddFunctionType(this.ref, cStr, result, cArr, paramTypes ? paramTypes.length : 0);\r\n } finally {\r\n memory.free(cArr);\r\n }\r\n }\r\n\r\n getFunctionTypeBySignature(\r\n result: NativeType,\r\n paramTypes: NativeType[] | null\r\n ): FunctionTypeRef {\r\n var cArr = allocI32Array(paramTypes);\r\n try {\r\n return _BinaryenGetFunctionTypeBySignature(this.ref, result, cArr, paramTypes ? paramTypes.length : 0);\r\n } finally {\r\n memory.free(cArr);\r\n }\r\n }\r\n\r\n removeFunctionType(name: string): void {\r\n var cStr = this.allocStringCached(name);\r\n _BinaryenRemoveFunctionType(this.ref, cStr);\r\n }\r\n\r\n // constants\r\n\r\n i32(value: i32): ExpressionRef {\r\n var out = this.lit;\r\n _BinaryenLiteralInt32(out, value);\r\n return _BinaryenConst(this.ref, out);\r\n }\r\n\r\n i64(valueLow: i32, valueHigh: i32 = 0): ExpressionRef {\r\n var out = this.lit;\r\n _BinaryenLiteralInt64(out, valueLow, valueHigh);\r\n return _BinaryenConst(this.ref, out);\r\n }\r\n\r\n f32(value: f32): ExpressionRef {\r\n var out = this.lit;\r\n _BinaryenLiteralFloat32(out, value);\r\n return _BinaryenConst(this.ref, out);\r\n }\r\n\r\n f64(value: f64): ExpressionRef {\r\n var out = this.lit;\r\n _BinaryenLiteralFloat64(out, value);\r\n return _BinaryenConst(this.ref, out);\r\n }\r\n\r\n v128(bytes: Uint8Array): ExpressionRef {\r\n assert(bytes.length == 16);\r\n var out = this.lit;\r\n for (let i = 0; i < 16; ++i) store(out + i, bytes[i]);\r\n _BinaryenLiteralVec128(out, out);\r\n return _BinaryenConst(this.ref, out);\r\n }\r\n\r\n // expressions\r\n\r\n unary(\r\n op: UnaryOp,\r\n expr: ExpressionRef\r\n ): ExpressionRef {\r\n return _BinaryenUnary(this.ref, op, expr);\r\n }\r\n\r\n binary(\r\n op: BinaryOp,\r\n left: ExpressionRef,\r\n right: ExpressionRef\r\n ): ExpressionRef {\r\n return _BinaryenBinary(this.ref, op, left, right);\r\n }\r\n\r\n host(\r\n op: HostOp,\r\n name: string | null = null,\r\n operands: ExpressionRef[] | null = null\r\n ): ExpressionRef {\r\n var cStr = this.allocStringCached(name);\r\n var cArr = allocPtrArray(operands);\r\n try {\r\n return _BinaryenHost(this.ref, op, cStr, cArr, operands ? (operands).length : 0);\r\n } finally {\r\n memory.free(cArr);\r\n }\r\n }\r\n\r\n local_get(\r\n index: i32,\r\n type: NativeType\r\n ): ExpressionRef {\r\n return _BinaryenLocalGet(this.ref, index, type);\r\n }\r\n\r\n local_tee(\r\n index: i32,\r\n value: ExpressionRef\r\n ): ExpressionRef {\r\n return _BinaryenLocalTee(this.ref, index, value);\r\n }\r\n\r\n global_get(\r\n name: string,\r\n type: NativeType\r\n ): ExpressionRef {\r\n var cStr = this.allocStringCached(name);\r\n return _BinaryenGlobalGet(this.ref, cStr, type);\r\n }\r\n\r\n load(\r\n bytes: Index,\r\n signed: bool,\r\n ptr: ExpressionRef,\r\n type: NativeType,\r\n offset: Index = 0,\r\n align: Index = bytes // naturally aligned by default\r\n ): ExpressionRef {\r\n return _BinaryenLoad(this.ref, bytes, signed ? 1 : 0, offset, align, type, ptr);\r\n }\r\n\r\n store(\r\n bytes: Index,\r\n ptr: ExpressionRef,\r\n value: ExpressionRef,\r\n type: NativeType,\r\n offset: Index = 0,\r\n align: Index = bytes // naturally aligned by default\r\n ): ExpressionRef {\r\n if (type < NativeType.None || type > NativeType.V128) throw new Error(\"here: \" + type);\r\n return _BinaryenStore(this.ref, bytes, offset, align, ptr, value, type);\r\n }\r\n\r\n atomic_load(\r\n bytes: Index,\r\n ptr: ExpressionRef,\r\n type: NativeType,\r\n offset: Index = 0\r\n ): ExpressionRef {\r\n return _BinaryenAtomicLoad(this.ref, bytes, offset, type, ptr);\r\n }\r\n\r\n atomic_store(\r\n bytes: Index,\r\n ptr: ExpressionRef,\r\n value: ExpressionRef,\r\n type: NativeType,\r\n offset: Index = 0\r\n ): ExpressionRef {\r\n return _BinaryenAtomicStore(this.ref, bytes, offset, ptr, value, type);\r\n }\r\n\r\n atomic_rmw(\r\n op: AtomicRMWOp,\r\n bytes: Index,\r\n offset: Index,\r\n ptr: ExpressionRef,\r\n value: ExpressionRef,\r\n type: NativeType\r\n ): ExpressionRef {\r\n return _BinaryenAtomicRMW(this.ref, op, bytes, offset, ptr, value, type);\r\n }\r\n\r\n atomic_cmpxchg(\r\n bytes: Index,\r\n offset: Index,\r\n ptr: ExpressionRef,\r\n expected: ExpressionRef,\r\n replacement: ExpressionRef,\r\n type: NativeType\r\n ): ExpressionRef {\r\n return _BinaryenAtomicCmpxchg(this.ref, bytes, offset, ptr, expected, replacement, type);\r\n }\r\n\r\n atomic_wait(\r\n ptr: ExpressionRef,\r\n expected: ExpressionRef,\r\n timeout: ExpressionRef,\r\n expectedType: NativeType\r\n ): ExpressionRef {\r\n return _BinaryenAtomicWait(this.ref, ptr, expected, timeout, expectedType);\r\n }\r\n\r\n atomic_notify(\r\n ptr: ExpressionRef,\r\n notifyCount: ExpressionRef\r\n ): ExpressionRef {\r\n return _BinaryenAtomicNotify(this.ref, ptr, notifyCount);\r\n }\r\n\r\n // statements\r\n\r\n local_set(\r\n index: Index,\r\n value: ExpressionRef\r\n ): ExpressionRef {\r\n return _BinaryenLocalSet(this.ref, index, value);\r\n }\r\n\r\n global_set(\r\n name: string,\r\n value: ExpressionRef\r\n ): ExpressionRef {\r\n var cStr = this.allocStringCached(name);\r\n return _BinaryenGlobalSet(this.ref, cStr, value);\r\n }\r\n\r\n block(\r\n label: string | null,\r\n children: ExpressionRef[],\r\n type: NativeType = NativeType.None\r\n ): ExpressionRef {\r\n var cStr = this.allocStringCached(label);\r\n var cArr = allocPtrArray(children);\r\n try {\r\n return _BinaryenBlock(this.ref, cStr, cArr, children.length, type);\r\n } finally {\r\n memory.free(cArr);\r\n }\r\n }\r\n\r\n br(\r\n label: string | null,\r\n condition: ExpressionRef = 0,\r\n value: ExpressionRef = 0\r\n ): ExpressionRef {\r\n var cStr = this.allocStringCached(label);\r\n return _BinaryenBreak(this.ref, cStr, condition, value);\r\n }\r\n\r\n drop(\r\n expression: ExpressionRef\r\n ): ExpressionRef {\r\n return _BinaryenDrop(this.ref, expression);\r\n }\r\n\r\n loop(\r\n label: string | null,\r\n body: ExpressionRef\r\n ): ExpressionRef {\r\n var cStr = this.allocStringCached(label);\r\n return _BinaryenLoop(this.ref, cStr, body);\r\n }\r\n\r\n if(\r\n condition: ExpressionRef,\r\n ifTrue: ExpressionRef,\r\n ifFalse: ExpressionRef = 0\r\n ): ExpressionRef {\r\n return _BinaryenIf(this.ref, condition, ifTrue, ifFalse);\r\n }\r\n\r\n nop(): ExpressionRef {\r\n return _BinaryenNop(this.ref);\r\n }\r\n\r\n return(\r\n expression: ExpressionRef = 0\r\n ): ExpressionRef {\r\n return _BinaryenReturn(this.ref, expression);\r\n }\r\n\r\n select(\r\n ifTrue: ExpressionRef,\r\n ifFalse: ExpressionRef,\r\n condition: ExpressionRef\r\n ): ExpressionRef {\r\n return _BinaryenSelect(this.ref, condition, ifTrue, ifFalse);\r\n }\r\n\r\n switch(\r\n names: string[],\r\n defaultName: string | null,\r\n condition: ExpressionRef,\r\n value: ExpressionRef = 0\r\n ): ExpressionRef {\r\n var numNames = names.length;\r\n var strs = new Array(numNames);\r\n for (let i = 0; i < numNames; ++i) {\r\n strs[i] = this.allocStringCached(names[i]);\r\n }\r\n var cArr = allocI32Array(strs);\r\n var cStr = this.allocStringCached(defaultName);\r\n try {\r\n return _BinaryenSwitch(this.ref, cArr, numNames, cStr, condition, value);\r\n } finally {\r\n memory.free(cArr);\r\n }\r\n }\r\n\r\n call(\r\n target: string,\r\n operands: ExpressionRef[] | null,\r\n returnType: NativeType\r\n ): ExpressionRef {\r\n var cStr = this.allocStringCached(target);\r\n var cArr = allocPtrArray(operands);\r\n try {\r\n return _BinaryenCall(this.ref, cStr, cArr, operands && operands.length || 0, returnType);\r\n } finally {\r\n memory.free(cArr);\r\n }\r\n }\r\n\r\n call_indirect(\r\n index: ExpressionRef,\r\n operands: ExpressionRef[] | null,\r\n typeName: string\r\n ): ExpressionRef {\r\n var cStr = this.allocStringCached(typeName);\r\n var cArr = allocPtrArray(operands);\r\n try {\r\n return _BinaryenCallIndirect(this.ref, index, cArr, operands && operands.length || 0, cStr);\r\n } finally {\r\n memory.free(cArr);\r\n }\r\n }\r\n\r\n unreachable(): ExpressionRef {\r\n return _BinaryenUnreachable(this.ref);\r\n }\r\n\r\n // bulk memory\r\n\r\n memory_copy(\r\n dest: ExpressionRef,\r\n source: ExpressionRef,\r\n size: ExpressionRef\r\n ): ExpressionRef {\r\n return _BinaryenMemoryCopy(this.ref, dest, source, size);\r\n }\r\n\r\n memory_fill(\r\n dest: ExpressionRef,\r\n value: ExpressionRef,\r\n size: ExpressionRef\r\n ): ExpressionRef {\r\n return _BinaryenMemoryFill(this.ref, dest, value, size);\r\n }\r\n\r\n // simd\r\n\r\n simd_extract(\r\n op: SIMDExtractOp,\r\n vec: ExpressionRef,\r\n idx: u8\r\n ): ExpressionRef {\r\n return _BinaryenSIMDExtract(this.ref, op, vec, idx);\r\n }\r\n\r\n simd_replace(\r\n op: SIMDReplaceOp,\r\n vec: ExpressionRef,\r\n idx: u8,\r\n value: ExpressionRef\r\n ): ExpressionRef {\r\n return _BinaryenSIMDReplace(this.ref, op, vec, idx, value);\r\n }\r\n\r\n simd_shuffle(\r\n vec1: ExpressionRef,\r\n vec2: ExpressionRef,\r\n mask: Uint8Array\r\n ): ExpressionRef {\r\n assert(mask.length == 16);\r\n var cArr = allocU8Array(mask);\r\n try {\r\n return _BinaryenSIMDShuffle(this.ref, vec1, vec2, cArr);\r\n } finally {\r\n memory.free(cArr);\r\n }\r\n }\r\n\r\n simd_bitselect(\r\n vec1: ExpressionRef,\r\n vec2: ExpressionRef,\r\n cond: ExpressionRef\r\n ): ExpressionRef {\r\n return _BinaryenSIMDBitselect(this.ref, vec1, vec2, cond);\r\n }\r\n\r\n simd_shift(\r\n op: SIMDShiftOp,\r\n vec: ExpressionRef,\r\n shift: ExpressionRef\r\n ): ExpressionRef {\r\n return _BinaryenSIMDShift(this.ref, op, vec, shift);\r\n }\r\n\r\n // meta\r\n\r\n addGlobal(\r\n name: string,\r\n type: NativeType,\r\n mutable: bool,\r\n initializer: ExpressionRef\r\n ): GlobalRef {\r\n var cStr = this.allocStringCached(name);\r\n return _BinaryenAddGlobal(this.ref, cStr, type, mutable ? 1 : 0, initializer);\r\n }\r\n\r\n removeGlobal(\r\n name: string\r\n ): void {\r\n var cStr = this.allocStringCached(name);\r\n _BinaryenRemoveGlobal(this.ref, cStr);\r\n }\r\n\r\n addFunction(\r\n name: string,\r\n type: FunctionTypeRef,\r\n varTypes: NativeType[] | null,\r\n body: ExpressionRef\r\n ): FunctionRef {\r\n var cStr = this.allocStringCached(name);\r\n var cArr = allocI32Array(varTypes);\r\n try {\r\n return _BinaryenAddFunction(this.ref, cStr, type, cArr, varTypes ? varTypes.length : 0, body);\r\n } finally {\r\n memory.free(cArr);\r\n }\r\n }\r\n\r\n removeFunction(name: string): void {\r\n var cStr = this.allocStringCached(name);\r\n _BinaryenRemoveFunction(this.ref, cStr);\r\n }\r\n\r\n private hasTemporaryFunction: bool = false;\r\n\r\n addTemporaryFunction(result: NativeType, paramTypes: NativeType[] | null, body: ExpressionRef): FunctionRef {\r\n this.hasTemporaryFunction = assert(!this.hasTemporaryFunction);\r\n var tempName = this.allocStringCached(\"\");\r\n var cArr = allocI32Array(paramTypes);\r\n try {\r\n let typeRef = _BinaryenAddFunctionType(this.ref, tempName, result, cArr, paramTypes ? paramTypes.length : 0);\r\n return _BinaryenAddFunction(this.ref, tempName, typeRef, 0, 0, body);\r\n } finally {\r\n memory.free(cArr);\r\n }\r\n }\r\n\r\n removeTemporaryFunction(): void {\r\n this.hasTemporaryFunction = !assert(this.hasTemporaryFunction);\r\n var tempName = this.allocStringCached(\"\");\r\n _BinaryenRemoveFunction(this.ref, tempName);\r\n _BinaryenRemoveFunctionType(this.ref, tempName);\r\n }\r\n\r\n addFunctionExport(\r\n internalName: string,\r\n externalName: string\r\n ): ExportRef {\r\n var cStr1 = this.allocStringCached(internalName);\r\n var cStr2 = this.allocStringCached(externalName);\r\n return _BinaryenAddFunctionExport(this.ref, cStr1, cStr2);\r\n }\r\n\r\n addTableExport(\r\n internalName: string,\r\n externalName: string\r\n ): ExportRef {\r\n var cStr1 = this.allocStringCached(internalName);\r\n var cStr2 = this.allocStringCached(externalName);\r\n return _BinaryenAddTableExport(this.ref, cStr1, cStr2);\r\n }\r\n\r\n addMemoryExport(\r\n internalName: string,\r\n externalName: string\r\n ): ExportRef {\r\n var cStr1 = this.allocStringCached(internalName);\r\n var cStr2 = this.allocStringCached(externalName);\r\n return _BinaryenAddMemoryExport(this.ref, cStr1, cStr2);\r\n }\r\n\r\n addGlobalExport(\r\n internalName: string,\r\n externalName: string\r\n ): ExportRef {\r\n var cStr1 = this.allocStringCached(internalName);\r\n var cStr2 = this.allocStringCached(externalName);\r\n return _BinaryenAddGlobalExport(this.ref, cStr1, cStr2);\r\n }\r\n\r\n removeExport(externalName: string): void {\r\n var cStr = this.allocStringCached(externalName);\r\n _BinaryenRemoveExport(this.ref, cStr);\r\n }\r\n\r\n addFunctionImport(\r\n internalName: string,\r\n externalModuleName: string,\r\n externalBaseName: string,\r\n functionType: FunctionTypeRef\r\n ): ImportRef {\r\n var cStr1 = this.allocStringCached(internalName);\r\n var cStr2 = this.allocStringCached(externalModuleName);\r\n var cStr3 = this.allocStringCached(externalBaseName);\r\n return _BinaryenAddFunctionImport(this.ref, cStr1, cStr2, cStr3, functionType);\r\n }\r\n\r\n addTableImport(\r\n internalName: string,\r\n externalModuleName: string,\r\n externalBaseName: string\r\n ): ImportRef {\r\n var cStr1 = this.allocStringCached(internalName);\r\n var cStr2 = this.allocStringCached(externalModuleName);\r\n var cStr3 = this.allocStringCached(externalBaseName);\r\n return _BinaryenAddTableImport(this.ref, cStr1, cStr2, cStr3);\r\n }\r\n\r\n addMemoryImport(\r\n internalName: string,\r\n externalModuleName: string,\r\n externalBaseName: string,\r\n shared: bool = false,\r\n ): ImportRef {\r\n var cStr1 = this.allocStringCached(internalName);\r\n var cStr2 = this.allocStringCached(externalModuleName);\r\n var cStr3 = this.allocStringCached(externalBaseName);\r\n return _BinaryenAddMemoryImport(this.ref, cStr1, cStr2, cStr3, shared);\r\n }\r\n\r\n addGlobalImport(\r\n internalName: string,\r\n externalModuleName: string,\r\n externalBaseName: string,\r\n globalType: NativeType\r\n ): ImportRef {\r\n var cStr1 = this.allocStringCached(internalName);\r\n var cStr2 = this.allocStringCached(externalModuleName);\r\n var cStr3 = this.allocStringCached(externalBaseName);\r\n return _BinaryenAddGlobalImport(this.ref, cStr1, cStr2, cStr3, globalType);\r\n }\r\n\r\n /** Unlimited memory constant. */\r\n static readonly UNLIMITED_MEMORY: Index = -1;\r\n\r\n setMemory(\r\n initial: Index,\r\n maximum: Index,\r\n segments: MemorySegment[],\r\n target: Target,\r\n exportName: string | null = null,\r\n shared: bool = false\r\n ): void {\r\n var cStr = this.allocStringCached(exportName);\r\n var k = segments.length;\r\n var segs = new Array(k);\r\n var psvs = new Array(k);\r\n var offs = new Array(k);\r\n var sizs = new Array(k);\r\n for (let i = 0; i < k; ++i) {\r\n let buffer = segments[i].buffer;\r\n let offset = segments[i].offset;\r\n segs[i] = allocU8Array(buffer);\r\n psvs[i] = 0; // no passive segments currently\r\n offs[i] = target == Target.WASM64\r\n ? this.i64(i64_low(offset), i64_high(offset))\r\n : this.i32(i64_low(offset));\r\n sizs[i] = buffer.length;\r\n }\r\n var cArr1 = allocI32Array(segs);\r\n var cArr2 = allocU8Array(psvs);\r\n var cArr3 = allocI32Array(offs);\r\n var cArr4 = allocI32Array(sizs);\r\n try {\r\n _BinaryenSetMemory(this.ref, initial, maximum, cStr, cArr1, cArr2, cArr3, cArr4, k, shared);\r\n } finally {\r\n memory.free(cArr4);\r\n memory.free(cArr3);\r\n memory.free(cArr2);\r\n memory.free(cArr1);\r\n for (let i = k - 1; i >= 0; --i) memory.free(segs[i]);\r\n }\r\n }\r\n\r\n setFunctionTable(\r\n initial: Index,\r\n maximum: Index,\r\n funcs: string[]\r\n ): void {\r\n var numNames = funcs.length;\r\n var names = new Array(numNames);\r\n for (let i = 0; i < numNames; ++i) {\r\n names[i] = this.allocStringCached(funcs[i]);\r\n }\r\n var cArr = allocI32Array(names);\r\n try {\r\n _BinaryenSetFunctionTable(this.ref, initial, maximum, cArr, numNames);\r\n } finally {\r\n memory.free(cArr);\r\n }\r\n }\r\n\r\n setStart(func: FunctionRef): void {\r\n _BinaryenSetStart(this.ref, func);\r\n }\r\n\r\n getOptimizeLevel(): i32 {\r\n return _BinaryenGetOptimizeLevel();\r\n }\r\n\r\n setOptimizeLevel(level: i32 = 2): void {\r\n _BinaryenSetOptimizeLevel(level);\r\n }\r\n\r\n getShrinkLevel(): i32 {\r\n return _BinaryenGetShrinkLevel();\r\n }\r\n\r\n setShrinkLevel(level: i32 = 1): void {\r\n _BinaryenSetShrinkLevel(level);\r\n }\r\n\r\n setDebugInfo(on: bool = false): void {\r\n _BinaryenSetDebugInfo(on);\r\n }\r\n\r\n getFeatures(): BinaryenFeatureFlags {\r\n return _BinaryenModuleGetFeatures(this.ref);\r\n }\r\n\r\n setFeatures(featureFlags: BinaryenFeatureFlags): void {\r\n _BinaryenModuleSetFeatures(this.ref, featureFlags);\r\n }\r\n\r\n optimize(func: FunctionRef = 0): void {\r\n if (func) {\r\n _BinaryenFunctionOptimize(func, this.ref);\r\n } else {\r\n _BinaryenModuleOptimize(this.ref);\r\n }\r\n }\r\n\r\n runPasses(passes: string[], func: FunctionRef = 0): void {\r\n var numNames = passes.length;\r\n var names = new Array(numNames);\r\n for (let i = 0; i < numNames; ++i) {\r\n names[i] = allocString(passes[i]);\r\n }\r\n var cArr = allocI32Array(names);\r\n try {\r\n if (func) {\r\n _BinaryenFunctionRunPasses(func, this.ref, cArr, numNames);\r\n } else {\r\n _BinaryenModuleRunPasses(this.ref, cArr, numNames);\r\n }\r\n } finally {\r\n memory.free(cArr);\r\n for (let i = numNames; i >= 0; --i) memory.free(names[i]);\r\n }\r\n }\r\n\r\n private cachedPrecomputeNames: usize = 0;\r\n\r\n precomputeExpression(expr: ExpressionRef): ExpressionRef {\r\n // remember the previous optimize levels and set to max instead, to be sure\r\n var previousOptimizeLevel = _BinaryenGetOptimizeLevel();\r\n var previousShrinkLevel = _BinaryenGetShrinkLevel();\r\n var previousDebugInfo = _BinaryenGetDebugInfo();\r\n _BinaryenSetOptimizeLevel(4);\r\n _BinaryenSetShrinkLevel(0);\r\n _BinaryenSetDebugInfo(false);\r\n\r\n // wrap the expression in a temp. function and run the precompute pass on it\r\n var type = _BinaryenExpressionGetType(expr);\r\n var func = this.addTemporaryFunction(type, null, expr);\r\n var names = this.cachedPrecomputeNames;\r\n if (!names) {\r\n this.cachedPrecomputeNames = names = allocI32Array([ this.allocStringCached(\"precompute\") ]);\r\n }\r\n _BinaryenFunctionRunPasses(func, this.ref, names, 1);\r\n expr = _BinaryenFunctionGetBody(func);\r\n this.removeTemporaryFunction();\r\n\r\n // reset optimize levels to previous\r\n _BinaryenSetOptimizeLevel(previousOptimizeLevel);\r\n _BinaryenSetShrinkLevel(previousShrinkLevel);\r\n _BinaryenSetDebugInfo(previousDebugInfo);\r\n return expr;\r\n }\r\n\r\n validate(): bool {\r\n return _BinaryenModuleValidate(this.ref) == 1;\r\n }\r\n\r\n interpret(): void {\r\n _BinaryenModuleInterpret(this.ref);\r\n }\r\n\r\n toBinary(sourceMapUrl: string | null): BinaryModule {\r\n var out = this.lit; // safe to reuse as long as..\r\n assert(_BinaryenSizeofLiteral() >= 12);\r\n var cStr = allocString(sourceMapUrl);\r\n var binaryPtr: usize = 0;\r\n var sourceMapPtr: usize = 0;\r\n try {\r\n _BinaryenModuleAllocateAndWrite(out, this.ref, cStr);\r\n binaryPtr = readInt(out);\r\n let binaryBytes = readInt(out + 4);\r\n sourceMapPtr = readInt(out + 4 * 2);\r\n let ret = new BinaryModule();\r\n ret.output = readBuffer(binaryPtr, binaryBytes);\r\n ret.sourceMap = readString(sourceMapPtr);\r\n return ret;\r\n } finally {\r\n if (cStr) memory.free(cStr);\r\n if (binaryPtr) memory.free(binaryPtr);\r\n if (sourceMapPtr) memory.free(sourceMapPtr);\r\n }\r\n }\r\n\r\n toText(): string {\r\n throw new Error(\"not implemented\"); // JS glue overrides this\r\n }\r\n\r\n toAsmjs(): string {\r\n throw new Error(\"not implemented\"); // JS glue overrides this\r\n }\r\n\r\n private cachedStrings: Map = new Map();\r\n\r\n private allocStringCached(str: string | null): usize {\r\n if (str == null) return 0;\r\n var cachedStrings = this.cachedStrings;\r\n if (cachedStrings.has(str)) return cachedStrings.get(str);\r\n var ptr = allocString(str);\r\n cachedStrings.set(str, ptr);\r\n return ptr;\r\n }\r\n\r\n dispose(): void {\r\n assert(this.ref);\r\n for (let ptr of this.cachedStrings.values()) memory.free(ptr);\r\n this.cachedStrings = new Map();\r\n memory.free(this.lit);\r\n memory.free(this.cachedPrecomputeNames);\r\n this.cachedPrecomputeNames = 0;\r\n _BinaryenModuleDispose(this.ref);\r\n this.ref = 0;\r\n }\r\n\r\n createRelooper(): Relooper {\r\n return Relooper.create(this);\r\n }\r\n\r\n cloneExpression(\r\n expr: ExpressionRef,\r\n noSideEffects: bool = false,\r\n maxDepth: i32 = i32.MAX_VALUE\r\n ): ExpressionRef { // currently supports side effect free expressions only\r\n if (maxDepth < 0) return 0;\r\n maxDepth -= 1;\r\n\r\n var nested1: ExpressionRef,\r\n nested2: ExpressionRef;\r\n\r\n switch (_BinaryenExpressionGetId(expr)) {\r\n case ExpressionId.Const: {\r\n switch (_BinaryenExpressionGetType(expr)) {\r\n case NativeType.I32: {\r\n return this.i32(_BinaryenConstGetValueI32(expr));\r\n }\r\n case NativeType.I64: {\r\n return this.i64(\r\n _BinaryenConstGetValueI64Low(expr),\r\n _BinaryenConstGetValueI64High(expr)\r\n );\r\n }\r\n case NativeType.F32: {\r\n return this.f32(_BinaryenConstGetValueF32(expr));\r\n }\r\n case NativeType.F64: {\r\n return this.f64(_BinaryenConstGetValueF64(expr));\r\n }\r\n case NativeType.V128: {\r\n // TODO\r\n return 0;\r\n }\r\n default: {\r\n throw new Error(\"concrete type expected\");\r\n }\r\n }\r\n }\r\n case ExpressionId.LocalGet: {\r\n return _BinaryenLocalGet(this.ref,\r\n _BinaryenLocalGetGetIndex(expr),\r\n _BinaryenExpressionGetType(expr)\r\n );\r\n }\r\n case ExpressionId.GlobalGet: {\r\n let globalName = _BinaryenGlobalGetGetName(expr);\r\n if (!globalName) break;\r\n return _BinaryenGlobalGet(this.ref, globalName, _BinaryenExpressionGetType(expr));\r\n }\r\n case ExpressionId.Load: {\r\n if (!(nested1 = this.cloneExpression(_BinaryenLoadGetPtr(expr), noSideEffects, maxDepth))) {\r\n break;\r\n }\r\n return (\r\n _BinaryenLoadIsAtomic(expr)\r\n ? _BinaryenAtomicLoad(this.ref,\r\n _BinaryenLoadGetBytes(expr),\r\n _BinaryenLoadGetOffset(expr),\r\n _BinaryenExpressionGetType(expr),\r\n nested1\r\n )\r\n : _BinaryenLoad(this.ref,\r\n _BinaryenLoadGetBytes(expr),\r\n _BinaryenLoadIsSigned(expr) ? 1 : 0,\r\n _BinaryenLoadGetOffset(expr),\r\n _BinaryenLoadGetAlign(expr),\r\n _BinaryenExpressionGetType(expr),\r\n nested1\r\n )\r\n );\r\n }\r\n case ExpressionId.Unary: {\r\n if (!(nested1 = this.cloneExpression(_BinaryenUnaryGetValue(expr), noSideEffects, maxDepth))) {\r\n break;\r\n }\r\n return _BinaryenUnary(this.ref, _BinaryenUnaryGetOp(expr), nested1);\r\n }\r\n case ExpressionId.Binary: {\r\n if (!(nested1 = this.cloneExpression(_BinaryenBinaryGetLeft(expr), noSideEffects, maxDepth))) {\r\n break;\r\n }\r\n if (!(nested2 = this.cloneExpression(_BinaryenBinaryGetRight(expr), noSideEffects, maxDepth))) {\r\n break;\r\n }\r\n return _BinaryenBinary(this.ref, _BinaryenBinaryGetOp(expr), nested1, nested2);\r\n }\r\n }\r\n return 0;\r\n }\r\n\r\n // source map generation\r\n\r\n addDebugInfoFile(name: string): Index {\r\n var cStr = allocString(name);\r\n try {\r\n return _BinaryenModuleAddDebugInfoFileName(this.ref, cStr);\r\n } finally {\r\n memory.free(cStr);\r\n }\r\n }\r\n\r\n getDebugInfoFile(index: Index): string | null {\r\n return readString(_BinaryenModuleGetDebugInfoFileName(this.ref, index));\r\n }\r\n\r\n setDebugLocation(\r\n func: FunctionRef,\r\n expr: ExpressionRef,\r\n fileIndex: Index,\r\n lineNumber: Index,\r\n columnNumber: Index\r\n ): void {\r\n _BinaryenFunctionSetDebugLocation(func, expr, fileIndex, lineNumber, columnNumber);\r\n }\r\n}\r\n\r\n// expressions\r\n\r\nexport function getExpressionId(expr: ExpressionRef): ExpressionId {\r\n return _BinaryenExpressionGetId(expr);\r\n}\r\n\r\nexport function getExpressionType(expr: ExpressionRef): NativeType {\r\n return _BinaryenExpressionGetType(expr);\r\n}\r\n\r\nexport function getConstValueI32(expr: ExpressionRef): i32 {\r\n return _BinaryenConstGetValueI32(expr);\r\n}\r\n\r\nexport function getConstValueI64Low(expr: ExpressionRef): i32 {\r\n return _BinaryenConstGetValueI64Low(expr);\r\n}\r\n\r\nexport function getConstValueI64High(expr: ExpressionRef): i32 {\r\n return _BinaryenConstGetValueI64High(expr);\r\n}\r\n\r\nexport function getConstValueF32(expr: ExpressionRef): f32 {\r\n return _BinaryenConstGetValueF32(expr);\r\n}\r\n\r\nexport function getConstValueF64(expr: ExpressionRef): f32 {\r\n return _BinaryenConstGetValueF64(expr);\r\n}\r\n\r\nexport function getLocalGetIndex(expr: ExpressionRef): Index {\r\n return _BinaryenLocalGetGetIndex(expr);\r\n}\r\n\r\nexport function getLocalSetIndex(expr: ExpressionRef): Index {\r\n return _BinaryenLocalSetGetIndex(expr);\r\n}\r\n\r\nexport function getLocalSetValue(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenLocalSetGetValue(expr);\r\n}\r\n\r\nexport function isLocalTee(expr: ExpressionRef): bool {\r\n return _BinaryenLocalSetIsTee(expr);\r\n}\r\n\r\nexport function getGlobalGetName(expr: ExpressionRef): string | null {\r\n return readString(_BinaryenGlobalGetGetName(expr));\r\n}\r\n\r\nexport function getBinaryOp(expr: ExpressionRef): BinaryOp {\r\n return _BinaryenBinaryGetOp(expr);\r\n}\r\n\r\nexport function getBinaryLeft(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenBinaryGetLeft(expr);\r\n}\r\n\r\nexport function getBinaryRight(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenBinaryGetRight(expr);\r\n}\r\n\r\nexport function getUnaryOp(expr: ExpressionRef): UnaryOp {\r\n return _BinaryenUnaryGetOp(expr);\r\n}\r\n\r\nexport function getUnaryValue(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenUnaryGetValue(expr);\r\n}\r\n\r\nexport function getLoadBytes(expr: ExpressionRef): u32 {\r\n return _BinaryenLoadGetBytes(expr);\r\n}\r\n\r\nexport function getLoadOffset(expr: ExpressionRef): u32 {\r\n return _BinaryenLoadGetOffset(expr);\r\n}\r\n\r\nexport function getLoadPtr(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenLoadGetPtr(expr);\r\n}\r\n\r\nexport function isLoadSigned(expr: ExpressionRef): bool {\r\n return _BinaryenLoadIsSigned(expr);\r\n}\r\n\r\nexport function getStoreBytes(expr: ExpressionRef): u32 {\r\n return _BinaryenStoreGetBytes(expr);\r\n}\r\n\r\nexport function getStoreOffset(expr: ExpressionRef): u32 {\r\n return _BinaryenStoreGetOffset(expr);\r\n}\r\n\r\nexport function getStorePtr(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenStoreGetPtr(expr);\r\n}\r\n\r\nexport function getStoreValue(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenStoreGetValue(expr);\r\n}\r\n\r\nexport function getBlockName(expr: ExpressionRef): string | null {\r\n return readString(_BinaryenBlockGetName(expr));\r\n}\r\n\r\nexport function getBlockChildCount(expr: ExpressionRef): Index {\r\n return _BinaryenBlockGetNumChildren(expr);\r\n}\r\n\r\nexport function getBlockChild(expr: ExpressionRef, index: Index): ExpressionRef {\r\n return _BinaryenBlockGetChild(expr, index);\r\n}\r\n\r\nexport function getIfCondition(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenIfGetCondition(expr);\r\n}\r\n\r\nexport function getIfTrue(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenIfGetIfTrue(expr);\r\n}\r\n\r\nexport function getIfFalse(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenIfGetIfFalse(expr);\r\n}\r\n\r\nexport function getLoopName(expr: ExpressionRef): string | null {\r\n return readString(_BinaryenLoopGetName(expr));\r\n}\r\n\r\nexport function getLoopBody(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenLoopGetBody(expr);\r\n}\r\n\r\nexport function getBreakName(expr: ExpressionRef): string | null {\r\n return readString(_BinaryenBreakGetName(expr));\r\n}\r\n\r\nexport function getBreakCondition(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenBreakGetCondition(expr);\r\n}\r\n\r\nexport function getSelectThen(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenSelectGetIfTrue(expr);\r\n}\r\n\r\nexport function getSelectElse(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenSelectGetIfFalse(expr);\r\n}\r\n\r\nexport function getSelectCondition(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenSelectGetCondition(expr);\r\n}\r\n\r\nexport function getDropValue(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenDropGetValue(expr);\r\n}\r\n\r\nexport function getReturnValue(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenReturnGetValue(expr);\r\n}\r\n\r\nexport function getCallTarget(expr: ExpressionRef): string | null {\r\n return readString(_BinaryenCallGetTarget(expr));\r\n}\r\n\r\nexport function getCallOperandCount(expr: ExpressionRef): i32 {\r\n return _BinaryenCallGetNumOperands(expr);\r\n}\r\n\r\nexport function getCallOperand(expr: ExpressionRef, index: Index): ExpressionRef {\r\n return _BinaryenCallGetOperand(expr, index);\r\n}\r\n\r\nexport function getHostOp(expr: ExpressionRef): ExpressionRef {\r\n return _BinaryenHostGetOp(expr);\r\n}\r\n\r\nexport function getHostOperandCount(expr: ExpressionRef): Index {\r\n return _BinaryenHostGetNumOperands(expr);\r\n}\r\n\r\nexport function getHostOperand(expr: ExpressionRef, index: Index): ExpressionRef {\r\n return _BinaryenHostGetOperand(expr, index);\r\n}\r\n\r\nexport function getHostName(expr: ExpressionRef): string | null {\r\n return readString(_BinaryenHostGetNameOperand(expr));\r\n}\r\n\r\n// functions\r\n\r\nexport function getFunctionBody(func: FunctionRef): ExpressionRef {\r\n return _BinaryenFunctionGetBody(func);\r\n}\r\n\r\nexport function getFunctionName(func: FunctionRef): string | null {\r\n return readString(_BinaryenFunctionGetName(func));\r\n}\r\n\r\nexport function getFunctionParamCount(func: FunctionRef): Index {\r\n return _BinaryenFunctionGetNumParams(func);\r\n}\r\n\r\nexport function getFunctionParamType(func: FunctionRef, index: Index): NativeType {\r\n return _BinaryenFunctionGetParam(func, index);\r\n}\r\n\r\nexport function getFunctionResultType(func: FunctionRef): NativeType {\r\n return _BinaryenFunctionGetResult(func);\r\n}\r\n\r\nexport class Relooper {\r\n\r\n module: Module;\r\n ref: RelooperRef;\r\n\r\n static create(module: Module): Relooper {\r\n var relooper = new Relooper();\r\n relooper.module = module;\r\n relooper.ref = _RelooperCreate(module.ref);\r\n return relooper;\r\n }\r\n\r\n private constructor() {}\r\n\r\n addBlock(code: ExpressionRef): RelooperBlockRef {\r\n return _RelooperAddBlock(this.ref, code);\r\n }\r\n\r\n addBranch(\r\n from: RelooperBlockRef,\r\n to: RelooperBlockRef,\r\n condition: ExpressionRef = 0,\r\n code: ExpressionRef = 0\r\n ): void {\r\n _RelooperAddBranch(from, to, condition, code);\r\n }\r\n\r\n addBlockWithSwitch(code: ExpressionRef, condition: ExpressionRef): RelooperBlockRef {\r\n return _RelooperAddBlockWithSwitch(this.ref, code, condition);\r\n }\r\n\r\n addBranchForSwitch(\r\n from: RelooperBlockRef,\r\n to: RelooperBlockRef,\r\n indexes: i32[],\r\n code: ExpressionRef = 0\r\n ): void {\r\n var cArr = allocI32Array(indexes);\r\n try {\r\n _RelooperAddBranchForSwitch(from, to, cArr, indexes.length, code);\r\n } finally {\r\n memory.free(cArr);\r\n }\r\n }\r\n\r\n renderAndDispose(entry: RelooperBlockRef, labelHelper: Index): ExpressionRef {\r\n return _RelooperRenderAndDispose(this.ref, entry, labelHelper);\r\n }\r\n}\r\n\r\n// export function hasSideEffects(expr: ExpressionRef): bool {\r\n// switch (_BinaryenExpressionGetId(expr = getPtr(expr))) {\r\n// case ExpressionId.GetLocal:\r\n// case ExpressionId.GetGlobal:\r\n// case ExpressionId.Const:\r\n// case ExpressionId.Nop:\r\n// case ExpressionId.Unreachable: {\r\n// return false;\r\n// }\r\n// case ExpressionId.Block: {\r\n// for (let i = 0, k = _BinaryenBlockGetNumChildren(expr); i < k; ++i) {\r\n// if (hasSideEffects(_BinaryenBlockGetChild(expr, i))) return true;\r\n// }\r\n// return false;\r\n// }\r\n// case ExpressionId.If: {\r\n// return hasSideEffects(_BinaryenIfGetCondition(expr))\r\n// || hasSideEffects(_BinaryenIfGetIfTrue(expr))\r\n// || hasSideEffects(_BinaryenIfGetIfFalse(expr));\r\n// }\r\n// case ExpressionId.Unary: {\r\n// return hasSideEffects(_BinaryenUnaryGetValue(expr));\r\n// }\r\n// case ExpressionId.Binary: {\r\n// return hasSideEffects(_BinaryenBinaryGetLeft(expr))\r\n// || hasSideEffects(_BinaryenBinaryGetRight(expr));\r\n// }\r\n// case ExpressionId.Drop: {\r\n// return hasSideEffects(_BinaryenDropGetValue(expr));\r\n// }\r\n// case ExpressionId.Select: {\r\n// return hasSideEffects(_BinaryenSelectGetIfTrue(expr))\r\n// || hasSideEffects(_BinaryenSelectGetIfFalse(expr))\r\n// || hasSideEffects(_BinaryenSelectGetCondition(expr));\r\n// }\r\n// }\r\n// return true;\r\n// }\r\n\r\n// helpers\r\n// can't do stack allocation here: STACKTOP is a global in WASM but a hidden variable in asm.js\r\n\r\nfunction allocU8Array(u8s: Uint8Array | null): usize {\r\n if (!u8s) return 0;\r\n var numValues = u8s.length;\r\n var ptr = memory.allocate(numValues);\r\n var idx = ptr;\r\n for (let i = 0; i < numValues; ++i) {\r\n store(idx++, u8s[i]);\r\n }\r\n return ptr;\r\n}\r\n\r\nfunction allocI32Array(i32s: i32[] | null): usize {\r\n if (!i32s) return 0;\r\n var ptr = memory.allocate(i32s.length << 2);\r\n var idx = ptr;\r\n for (let i = 0, k = i32s.length; i < k; ++i) {\r\n let val = i32s[i];\r\n // store(idx, val) is not portable\r\n store(idx , ( val & 0xff) as u8);\r\n store(idx + 1, ((val >> 8) & 0xff) as u8);\r\n store(idx + 2, ((val >> 16) & 0xff) as u8);\r\n store(idx + 3, ( val >>> 24 ) as u8);\r\n idx += 4;\r\n }\r\n return ptr;\r\n}\r\n\r\nfunction allocPtrArray(ptrs: usize[] | null): usize {\r\n return allocI32Array(ptrs); // TODO: WASM64 one day\r\n}\r\n\r\nfunction stringLengthUTF8(str: string): usize {\r\n var len = 0;\r\n for (let i = 0, k = str.length; i < k; ++i) {\r\n let u = str.charCodeAt(i);\r\n if (u >= 0xD800 && u <= 0xDFFF && i + 1 < k) {\r\n u = 0x10000 + ((u & 0x3FF) << 10) | (str.charCodeAt(++i) & 0x3FF);\r\n }\r\n if (u <= 0x7F) {\r\n ++len;\r\n } else if (u <= 0x7FF) {\r\n len += 2;\r\n } else if (u <= 0xFFFF) {\r\n len += 3;\r\n } else if (u <= 0x1FFFFF) {\r\n len += 4;\r\n } else if (u <= 0x3FFFFFF) {\r\n len += 5;\r\n } else {\r\n len += 6;\r\n }\r\n }\r\n return len;\r\n}\r\n\r\nfunction allocString(str: string | null): usize {\r\n if (str == null) return 0;\r\n var ptr = memory.allocate(stringLengthUTF8(str) + 1);\r\n // the following is based on Emscripten's stringToUTF8Array\r\n var idx = ptr;\r\n for (let i = 0, k = str.length; i < k; ++i) {\r\n let u = str.charCodeAt(i);\r\n if (u >= 0xD800 && u <= 0xDFFF && i + 1 < k) {\r\n u = 0x10000 + ((u & 0x3FF) << 10) | (str.charCodeAt(++i) & 0x3FF);\r\n }\r\n if (u <= 0x7F) {\r\n store(idx++, u as u8);\r\n } else if (u <= 0x7FF) {\r\n store(idx++, (0xC0 | (u >>> 6) ) as u8);\r\n store(idx++, (0x80 | ( u & 63)) as u8);\r\n } else if (u <= 0xFFFF) {\r\n store(idx++, (0xE0 | (u >>> 12) ) as u8);\r\n store(idx++, (0x80 | ((u >>> 6) & 63)) as u8);\r\n store(idx++, (0x80 | ( u & 63)) as u8);\r\n } else if (u <= 0x1FFFFF) {\r\n store(idx++, (0xF0 | (u >>> 18) ) as u8);\r\n store(idx++, (0x80 | ((u >>> 12) & 63)) as u8);\r\n store(idx++, (0x80 | ((u >>> 6) & 63)) as u8);\r\n store(idx++, (0x80 | ( u & 63)) as u8);\r\n } else if (u <= 0x3FFFFFF) {\r\n store(idx++, (0xF8 | (u >>> 24) ) as u8);\r\n store(idx++, (0x80 | ((u >>> 18) & 63)) as u8);\r\n store(idx++, (0x80 | ((u >>> 12) & 63)) as u8);\r\n store(idx++, (0x80 | ((u >>> 6) & 63)) as u8);\r\n store(idx++, (0x80 | ( u & 63)) as u8);\r\n } else {\r\n store(idx++, (0xFC | (u >>> 30) ) as u8);\r\n store(idx++, (0x80 | ((u >>> 24) & 63)) as u8);\r\n store(idx++, (0x80 | ((u >>> 18) & 63)) as u8);\r\n store(idx++, (0x80 | ((u >>> 12) & 63)) as u8);\r\n store(idx++, (0x80 | ((u >>> 6) & 63)) as u8);\r\n store(idx++, (0x80 | ( u & 63)) as u8);\r\n }\r\n }\r\n store(idx, 0);\r\n return ptr;\r\n}\r\n\r\nfunction readInt(ptr: usize): i32 {\r\n return (\r\n load(ptr ) |\r\n (load(ptr + 1) << 8) |\r\n (load(ptr + 2) << 16) |\r\n (load(ptr + 3) << 24)\r\n );\r\n}\r\n\r\nfunction readBuffer(ptr: usize, length: usize): Uint8Array {\r\n var ret = new Uint8Array(length);\r\n for (let i: usize = 0; i < length; ++i) {\r\n ret[i] = load(ptr + i);\r\n }\r\n return ret;\r\n}\r\n\r\nexport function readString(ptr: usize): string | null {\r\n if (!ptr) return null;\r\n var arr = new Array();\r\n // the following is based on Emscripten's UTF8ArrayToString\r\n var cp: u32;\r\n var u1: u32, u2: u32, u3: u32, u4: u32, u5: u32;\r\n while (cp = load(ptr++)) {\r\n if (!(cp & 0x80)) {\r\n arr.push(cp);\r\n continue;\r\n }\r\n u1 = load(ptr++) & 63;\r\n if ((cp & 0xE0) == 0xC0) {\r\n arr.push(((cp & 31) << 6) | u1);\r\n continue;\r\n }\r\n u2 = load(ptr++) & 63;\r\n if ((cp & 0xF0) == 0xE0) {\r\n cp = ((cp & 15) << 12) | (u1 << 6) | u2;\r\n } else {\r\n u3 = load(ptr++) & 63;\r\n if ((cp & 0xF8) == 0xF0) {\r\n cp = ((cp & 7) << 18) | (u1 << 12) | (u2 << 6) | u3;\r\n } else {\r\n u4 = load(ptr++) & 63;\r\n if ((cp & 0xFC) == 0xF8) {\r\n cp = ((cp & 3) << 24) | (u1 << 18) | (u2 << 12) | (u3 << 6) | u4;\r\n } else {\r\n u5 = load(ptr++) & 63;\r\n cp = ((cp & 1) << 30) | (u1 << 24) | (u2 << 18) | (u3 << 12) | (u4 << 6) | u5;\r\n }\r\n }\r\n }\r\n arr.push(cp);\r\n // if (cp < 0x10000) {\r\n // arr.push(cp);\r\n // } else {\r\n // var ch = cp - 0x10000;\r\n // arr.push(0xD800 | (ch >> 10));\r\n // arr.push(0xDC00 | (ch & 0x3FF));\r\n // }\r\n }\r\n // return String.fromCharCodes(arr);\r\n return String.fromCodePoints(arr);\r\n}\r\n\r\n/** Result structure of {@link Module#toBinary}. */\r\nexport class BinaryModule {\r\n /** WebAssembly binary. */\r\n output: Uint8Array;\r\n /** Source map, if generated. */\r\n sourceMap: string | null;\r\n}\r\n\r\n/** Tests if an expression needs an explicit 'unreachable' when it is the terminating statement. */\r\nexport function needsExplicitUnreachable(expr: ExpressionRef): bool {\r\n // not applicable if pushing a value to the stack\r\n if (_BinaryenExpressionGetType(expr) != NativeType.Unreachable) return false;\r\n\r\n switch (_BinaryenExpressionGetId(expr)) {\r\n case ExpressionId.Unreachable:\r\n case ExpressionId.Return: return false;\r\n case ExpressionId.Break: return _BinaryenBreakGetCondition(expr) != 0;\r\n case ExpressionId.Block: {\r\n if (!_BinaryenBlockGetName(expr)) { // can't break out of it\r\n let numChildren = _BinaryenBlockGetNumChildren(expr); // last child needs unreachable\r\n return numChildren > 0 && needsExplicitUnreachable(_BinaryenBlockGetChild(expr, numChildren - 1));\r\n }\r\n }\r\n }\r\n return true;\r\n}\r\n\r\n/** Traverses all expression members of an expression, calling the given visitor. */\r\nexport function traverse(expr: ExpressionRef, data: T, visit: (expr: ExpressionRef, data: T) => void): bool {\r\n switch (getExpressionId(expr)) {\r\n case ExpressionId.Block: {\r\n for (let i = 0, n = _BinaryenBlockGetNumChildren(expr); i < n; ++i) {\r\n visit(_BinaryenBlockGetChild(expr, i), data);\r\n }\r\n break;\r\n }\r\n case ExpressionId.If: {\r\n visit(_BinaryenIfGetCondition(expr), data);\r\n visit(_BinaryenIfGetIfTrue(expr), data);\r\n let ifFalse = _BinaryenIfGetIfFalse(expr);\r\n if (ifFalse) visit(ifFalse, data);\r\n break;\r\n }\r\n case ExpressionId.Loop: {\r\n visit(_BinaryenLoopGetBody(expr), data);\r\n break;\r\n }\r\n case ExpressionId.Break: {\r\n let condition = _BinaryenBreakGetCondition(expr);\r\n if (condition) visit(condition, data);\r\n break;\r\n }\r\n case ExpressionId.Switch: {\r\n visit(_BinaryenSwitchGetCondition(expr), data);\r\n break;\r\n }\r\n case ExpressionId.Call: {\r\n for (let i = 0, n = _BinaryenCallGetNumOperands(expr); i < n; ++i) {\r\n visit(_BinaryenCallGetOperand(expr, i), data);\r\n }\r\n break;\r\n }\r\n case ExpressionId.CallIndirect: {\r\n for (let i = 0, n = _BinaryenCallIndirectGetNumOperands(expr); i < n; ++i) {\r\n visit(_BinaryenCallIndirectGetOperand(expr, i), data);\r\n }\r\n break;\r\n }\r\n case ExpressionId.LocalGet: {\r\n break;\r\n }\r\n case ExpressionId.LocalSet: {\r\n visit(_BinaryenLocalSetGetValue(expr), data);\r\n break;\r\n }\r\n case ExpressionId.GlobalGet: {\r\n break;\r\n }\r\n case ExpressionId.GlobalSet: {\r\n visit(_BinaryenGlobalSetGetValue(expr), data);\r\n break;\r\n }\r\n case ExpressionId.Load: {\r\n visit(_BinaryenLoadGetPtr(expr), data);\r\n break;\r\n }\r\n case ExpressionId.Store: {\r\n visit(_BinaryenStoreGetPtr(expr), data);\r\n visit(_BinaryenStoreGetValue(expr), data);\r\n break;\r\n }\r\n case ExpressionId.AtomicRMW: {\r\n visit(_BinaryenAtomicRMWGetPtr(expr), data);\r\n visit(_BinaryenAtomicRMWGetValue(expr), data);\r\n break;\r\n }\r\n case ExpressionId.AtomicCmpxchg: {\r\n visit(_BinaryenAtomicCmpxchgGetPtr(expr), data);\r\n visit(_BinaryenAtomicCmpxchgGetExpected(expr), data);\r\n visit(_BinaryenAtomicCmpxchgGetReplacement(expr), data);\r\n break;\r\n }\r\n case ExpressionId.AtomicWait: {\r\n visit(_BinaryenAtomicWaitGetPtr(expr), data);\r\n visit(_BinaryenAtomicWaitGetExpected(expr), data);\r\n visit(_BinaryenAtomicWaitGetTimeout(expr), data);\r\n break;\r\n }\r\n case ExpressionId.AtomicNotify: {\r\n visit(_BinaryenAtomicNotifyGetPtr(expr), data);\r\n break;\r\n }\r\n case ExpressionId.SIMDExtract: {\r\n visit(_BinaryenSIMDExtractGetVec(expr), data);\r\n break;\r\n }\r\n case ExpressionId.SIMDReplace: {\r\n visit(_BinaryenSIMDReplaceGetVec(expr), data);\r\n visit(_BinaryenSIMDReplaceGetValue(expr), data);\r\n break;\r\n }\r\n case ExpressionId.SIMDShuffle: {\r\n visit(_BinaryenSIMDShuffleGetLeft(expr), data);\r\n visit(_BinaryenSIMDShuffleGetRight(expr), data);\r\n break;\r\n }\r\n case ExpressionId.SIMDBitselect: {\r\n visit(_BinaryenSIMDBitselectGetLeft(expr), data);\r\n visit(_BinaryenSIMDBitselectGetRight(expr), data);\r\n visit(_BinaryenSIMDBitselectGetCond(expr), data);\r\n break;\r\n }\r\n case ExpressionId.SIMDShift: {\r\n visit(_BinaryenSIMDShiftGetVec(expr), data);\r\n visit(_BinaryenSIMDShiftGetShift(expr), data);\r\n break;\r\n }\r\n case ExpressionId.MemoryInit: {\r\n visit(_BinaryenMemoryInitGetDest(expr), data);\r\n visit(_BinaryenMemoryInitGetOffset(expr), data);\r\n visit(_BinaryenMemoryInitGetSize(expr), data);\r\n break;\r\n }\r\n case ExpressionId.DataDrop: {\r\n break;\r\n }\r\n case ExpressionId.MemoryCopy: {\r\n visit(_BinaryenMemoryCopyGetDest(expr), data);\r\n visit(_BinaryenMemoryCopyGetSource(expr), data);\r\n visit(_BinaryenMemoryCopyGetSize(expr), data);\r\n break;\r\n }\r\n case ExpressionId.MemoryFill: {\r\n visit(_BinaryenMemoryFillGetDest(expr), data);\r\n visit(_BinaryenMemoryFillGetValue(expr), data);\r\n visit(_BinaryenMemoryFillGetSize(expr), data);\r\n break;\r\n }\r\n case ExpressionId.Const: {\r\n break;\r\n }\r\n case ExpressionId.Unary: {\r\n visit(_BinaryenUnaryGetValue(expr), data);\r\n break;\r\n }\r\n case ExpressionId.Binary: {\r\n visit(_BinaryenBinaryGetLeft(expr), data);\r\n visit(_BinaryenBinaryGetRight(expr), data);\r\n break;\r\n }\r\n case ExpressionId.Select: {\r\n visit(_BinaryenSelectGetIfTrue(expr), data);\r\n visit(_BinaryenSelectGetIfFalse(expr), data);\r\n visit(_BinaryenSelectGetCondition(expr), data);\r\n break;\r\n }\r\n case ExpressionId.Drop: {\r\n visit(_BinaryenDropGetValue(expr), data);\r\n break;\r\n }\r\n case ExpressionId.Return: {\r\n visit(_BinaryenReturnGetValue(expr), data);\r\n break;\r\n }\r\n case ExpressionId.Host: {\r\n for (let i = 0, n = _BinaryenHostGetNumOperands(expr); i < n; ++i) {\r\n visit(_BinaryenHostGetOperand(expr, i), data);\r\n }\r\n break;\r\n }\r\n case ExpressionId.Nop: {\r\n break;\r\n }\r\n case ExpressionId.Unreachable: {\r\n break;\r\n }\r\n default: assert(false);\r\n }\r\n return true;\r\n}\r\n","/**\r\n * Abstract syntax tree representing a source file once parsed.\r\n * @module ast\r\n *//***/\r\n\r\nimport {\r\n CommonFlags,\r\n CommonSymbols,\r\n PATH_DELIMITER,\r\n LIBRARY_PREFIX\r\n} from \"./common\";\r\n\r\nimport {\r\n Token,\r\n Tokenizer,\r\n Range\r\n} from \"./tokenizer\";\r\n\r\nimport {\r\n normalizePath,\r\n resolvePath,\r\n CharCode\r\n} from \"./util\";\r\n\r\nexport { Token, Range };\r\n\r\n/** Indicates the kind of a node. */\r\nexport enum NodeKind {\r\n\r\n SOURCE,\r\n\r\n // types\r\n TYPE,\r\n TYPENAME,\r\n TYPEPARAMETER,\r\n PARAMETER,\r\n SIGNATURE,\r\n\r\n // expressions\r\n IDENTIFIER,\r\n ASSERTION,\r\n BINARY,\r\n CALL,\r\n CLASS,\r\n COMMA,\r\n ELEMENTACCESS,\r\n FALSE,\r\n FUNCTION,\r\n INSTANCEOF,\r\n LITERAL,\r\n NEW,\r\n NULL,\r\n PARENTHESIZED,\r\n PROPERTYACCESS,\r\n TERNARY,\r\n SUPER,\r\n THIS,\r\n TRUE,\r\n CONSTRUCTOR,\r\n UNARYPOSTFIX,\r\n UNARYPREFIX,\r\n\r\n // statements\r\n BLOCK,\r\n BREAK,\r\n CONTINUE,\r\n DO,\r\n EMPTY,\r\n EXPORT,\r\n EXPORTDEFAULT,\r\n EXPORTIMPORT,\r\n EXPRESSION,\r\n FOR,\r\n IF,\r\n IMPORT,\r\n RETURN,\r\n SWITCH,\r\n THROW,\r\n TRY,\r\n VARIABLE,\r\n VOID,\r\n WHILE,\r\n\r\n // declaration statements\r\n CLASSDECLARATION,\r\n ENUMDECLARATION,\r\n ENUMVALUEDECLARATION,\r\n FIELDDECLARATION,\r\n FUNCTIONDECLARATION,\r\n IMPORTDECLARATION,\r\n INDEXSIGNATUREDECLARATION,\r\n INTERFACEDECLARATION,\r\n METHODDECLARATION,\r\n NAMESPACEDECLARATION,\r\n TYPEDECLARATION,\r\n VARIABLEDECLARATION,\r\n\r\n // special\r\n DECORATOR,\r\n EXPORTMEMBER,\r\n SWITCHCASE,\r\n COMMENT\r\n}\r\n\r\n/** Checks if a node represents a constant value. */\r\nexport function nodeIsConstantValue(kind: NodeKind): bool {\r\n switch (kind) {\r\n case NodeKind.LITERAL:\r\n case NodeKind.NULL:\r\n case NodeKind.TRUE:\r\n case NodeKind.FALSE: return true;\r\n }\r\n return false;\r\n}\r\n\r\n/** Checks if a node might be callable. */\r\nexport function nodeIsCallable(kind: NodeKind): bool {\r\n switch (kind) {\r\n case NodeKind.IDENTIFIER:\r\n case NodeKind.ASSERTION: // if kind=NONNULL\r\n case NodeKind.CALL:\r\n case NodeKind.ELEMENTACCESS:\r\n case NodeKind.PARENTHESIZED:\r\n case NodeKind.PROPERTYACCESS:\r\n case NodeKind.SUPER: return true;\r\n }\r\n return false;\r\n}\r\n\r\n/** Checks if a node might be callable with generic arguments. */\r\nexport function nodeIsGenericCallable(kind: NodeKind): bool {\r\n switch (kind) {\r\n case NodeKind.IDENTIFIER:\r\n case NodeKind.PROPERTYACCESS: return true;\r\n }\r\n return false;\r\n}\r\n\r\n/** Base class of all nodes. */\r\nexport abstract class Node {\r\n\r\n /** Node kind indicator. */\r\n kind: NodeKind;\r\n /** Source range. */\r\n range: Range;\r\n\r\n // types\r\n\r\n static createTypeName(\r\n name: IdentifierExpression,\r\n range: Range\r\n ): TypeName {\r\n var typeName = new TypeName();\r\n typeName.range = range;\r\n typeName.identifier = name;\r\n typeName.next = null;\r\n return typeName;\r\n }\r\n\r\n static createSimpleTypeName(\r\n name: string,\r\n range: Range\r\n ): TypeName {\r\n return Node.createTypeName(Node.createIdentifierExpression(name, range), range);\r\n }\r\n\r\n static createType(\r\n name: TypeName,\r\n typeArguments: CommonTypeNode[] | null,\r\n isNullable: bool,\r\n range: Range\r\n ): TypeNode {\r\n var type = new TypeNode();\r\n type.range = range;\r\n type.name = name;\r\n type.typeArguments = typeArguments;\r\n type.isNullable = isNullable;\r\n return type;\r\n }\r\n\r\n static createOmittedType(\r\n range: Range\r\n ): TypeNode {\r\n return Node.createType(\r\n Node.createSimpleTypeName(\"\", range),\r\n null,\r\n false,\r\n range\r\n );\r\n }\r\n\r\n static createTypeParameter(\r\n name: IdentifierExpression,\r\n extendsType: TypeNode | null,\r\n defaultType: TypeNode | null,\r\n range: Range\r\n ): TypeParameterNode {\r\n var elem = new TypeParameterNode();\r\n elem.range = range;\r\n elem.name = name;\r\n elem.extendsType = extendsType;\r\n elem.defaultType = defaultType;\r\n return elem;\r\n }\r\n\r\n static createParameter(\r\n name: IdentifierExpression,\r\n type: CommonTypeNode,\r\n initializer: Expression | null,\r\n kind: ParameterKind,\r\n range: Range\r\n ): ParameterNode {\r\n var elem = new ParameterNode();\r\n elem.range = range;\r\n elem.name = name;\r\n elem.type = type;\r\n elem.initializer = initializer;\r\n elem.parameterKind = kind;\r\n return elem;\r\n }\r\n\r\n static createSignature(\r\n parameters: ParameterNode[],\r\n returnType: CommonTypeNode,\r\n explicitThisType: TypeNode | null,\r\n isNullable: bool,\r\n range: Range\r\n ): SignatureNode {\r\n var sig = new SignatureNode();\r\n sig.range = range;\r\n sig.parameters = parameters;\r\n sig.returnType = returnType;\r\n sig.explicitThisType = explicitThisType;\r\n sig.isNullable = isNullable;\r\n return sig;\r\n }\r\n\r\n // special\r\n\r\n static createDecorator(\r\n name: Expression,\r\n args: Expression[] | null,\r\n range: Range\r\n ): DecoratorNode {\r\n var stmt = new DecoratorNode();\r\n stmt.range = range;\r\n stmt.name = name;\r\n stmt.arguments = args;\r\n stmt.decoratorKind = decoratorNameToKind(name);\r\n return stmt;\r\n }\r\n\r\n static createComment(\r\n text: string,\r\n kind: CommentKind,\r\n range: Range\r\n ): CommentNode {\r\n var node = new CommentNode();\r\n node.range = range;\r\n node.commentKind = kind;\r\n node.text = text;\r\n return node;\r\n }\r\n\r\n // expressions\r\n\r\n static createIdentifierExpression(\r\n name: string,\r\n range: Range,\r\n isQuoted: bool = false\r\n ): IdentifierExpression {\r\n var expr = new IdentifierExpression();\r\n expr.range = range;\r\n expr.text = name; // TODO: extract from range\r\n expr.symbol = name; // TODO: Symbol.for(name)\r\n expr.isQuoted = isQuoted;\r\n return expr;\r\n }\r\n\r\n static createEmptyIdentifierExpression(\r\n range: Range\r\n ): IdentifierExpression {\r\n var expr = new IdentifierExpression();\r\n expr.range = range;\r\n expr.text = \"\";\r\n return expr;\r\n }\r\n\r\n static createArrayLiteralExpression(\r\n elements: (Expression | null)[],\r\n range: Range\r\n ): ArrayLiteralExpression {\r\n var expr = new ArrayLiteralExpression();\r\n expr.range = range;\r\n expr.elementExpressions = elements;\r\n return expr;\r\n }\r\n\r\n static createAssertionExpression(\r\n assertionKind: AssertionKind,\r\n expression: Expression,\r\n toType: CommonTypeNode | null,\r\n range: Range\r\n ): AssertionExpression {\r\n var expr = new AssertionExpression();\r\n expr.range = range;\r\n expr.assertionKind = assertionKind;\r\n expr.expression = expression;\r\n expr.toType = toType;\r\n return expr;\r\n }\r\n\r\n static createBinaryExpression(\r\n operator: Token,\r\n left: Expression,\r\n right: Expression,\r\n range: Range\r\n ): BinaryExpression {\r\n var expr = new BinaryExpression();\r\n expr.range = range;\r\n expr.operator = operator;\r\n expr.left = left;\r\n expr.right = right;\r\n return expr;\r\n }\r\n\r\n static createCallExpression(\r\n expression: Expression,\r\n typeArgs: CommonTypeNode[] | null,\r\n args: Expression[],\r\n range: Range\r\n ): CallExpression {\r\n var expr = new CallExpression();\r\n expr.range = range;\r\n expr.expression = expression;\r\n expr.typeArguments = typeArgs;\r\n expr.arguments = args;\r\n return expr;\r\n }\r\n\r\n static createClassExpression(\r\n declaration: ClassDeclaration\r\n ): ClassExpression {\r\n var expr = new ClassExpression();\r\n expr.range = declaration.range;\r\n expr.declaration = declaration;\r\n return expr;\r\n }\r\n\r\n static createCommaExpression(\r\n expressions: Expression[],\r\n range: Range\r\n ): CommaExpression {\r\n var expr = new CommaExpression();\r\n expr.range = range;\r\n expr.expressions = expressions;\r\n return expr;\r\n }\r\n\r\n static createConstructorExpression(\r\n range: Range\r\n ): ConstructorExpression {\r\n var expr = new ConstructorExpression();\r\n expr.range = range;\r\n return expr;\r\n }\r\n\r\n static createElementAccessExpression(\r\n expression: Expression,\r\n element: Expression,\r\n range: Range\r\n ): ElementAccessExpression {\r\n var expr = new ElementAccessExpression();\r\n expr.range = range;\r\n expr.expression = expression;\r\n expr.elementExpression = element;\r\n return expr;\r\n }\r\n\r\n static createFalseExpression(\r\n range: Range\r\n ): FalseExpression {\r\n var expr = new FalseExpression();\r\n expr.range = range;\r\n return expr;\r\n }\r\n\r\n static createFloatLiteralExpression(\r\n value: f64,\r\n range: Range\r\n ): FloatLiteralExpression {\r\n var expr = new FloatLiteralExpression();\r\n expr.range = range;\r\n expr.value = value;\r\n return expr;\r\n }\r\n\r\n static createFunctionExpression(\r\n declaration: FunctionDeclaration\r\n ): FunctionExpression {\r\n var expr = new FunctionExpression();\r\n expr.range = declaration.range;\r\n expr.declaration = declaration;\r\n return expr;\r\n }\r\n\r\n static createInstanceOfExpression(\r\n expression: Expression,\r\n isType: CommonTypeNode,\r\n range: Range\r\n ): InstanceOfExpression {\r\n var expr = new InstanceOfExpression();\r\n expr.range = range;\r\n expr.expression = expression;\r\n expr.isType = isType;\r\n return expr;\r\n }\r\n\r\n static createIntegerLiteralExpression(\r\n value: I64,\r\n range: Range\r\n ): IntegerLiteralExpression {\r\n var expr = new IntegerLiteralExpression();\r\n expr.range = range;\r\n expr.value = value;\r\n return expr;\r\n }\r\n\r\n static createNewExpression(\r\n expression: Expression,\r\n typeArgs: CommonTypeNode[] | null,\r\n args: Expression[],\r\n range: Range\r\n ): NewExpression {\r\n var expr = new NewExpression();\r\n expr.range = range;\r\n expr.expression = expression;\r\n expr.typeArguments = typeArgs;\r\n expr.arguments = args;\r\n return expr;\r\n }\r\n\r\n static createNullExpression(\r\n range: Range\r\n ): NullExpression {\r\n var expr = new NullExpression();\r\n expr.range = range;\r\n return expr;\r\n }\r\n\r\n static createObjectLiteralExpression(\r\n names: IdentifierExpression[],\r\n values: Expression[],\r\n range: Range\r\n ): ObjectLiteralExpression {\r\n var expr = new ObjectLiteralExpression();\r\n expr.range = range;\r\n expr.names = names;\r\n expr.values = values;\r\n return expr;\r\n }\r\n\r\n static createParenthesizedExpression(\r\n expression: Expression,\r\n range: Range\r\n ): ParenthesizedExpression {\r\n var expr = new ParenthesizedExpression();\r\n expr.range = range;\r\n expr.expression = expression;\r\n return expr;\r\n }\r\n\r\n static createPropertyAccessExpression(\r\n expression: Expression,\r\n property: IdentifierExpression,\r\n range: Range\r\n ): PropertyAccessExpression {\r\n var expr = new PropertyAccessExpression();\r\n expr.range = range;\r\n expr.expression = expression;\r\n expr.property = property;\r\n return expr;\r\n }\r\n\r\n static createRegexpLiteralExpression(\r\n pattern: string,\r\n flags: string,\r\n range: Range\r\n ): RegexpLiteralExpression {\r\n var expr = new RegexpLiteralExpression();\r\n expr.range = range;\r\n expr.pattern = pattern;\r\n expr.patternFlags = flags;\r\n return expr;\r\n }\r\n\r\n static createTernaryExpression(\r\n condition: Expression,\r\n ifThen: Expression,\r\n ifElse: Expression,\r\n range: Range\r\n ): TernaryExpression {\r\n var expr = new TernaryExpression();\r\n expr.range = range;\r\n expr.condition = condition;\r\n expr.ifThen = ifThen;\r\n expr.ifElse = ifElse;\r\n return expr;\r\n }\r\n\r\n static createStringLiteralExpression(\r\n value: string,\r\n range: Range\r\n ): StringLiteralExpression {\r\n var expr = new StringLiteralExpression();\r\n expr.range = range;\r\n expr.value = value;\r\n return expr;\r\n }\r\n\r\n static createSuperExpression(\r\n range: Range\r\n ): SuperExpression {\r\n var expr = new SuperExpression();\r\n expr.range = range;\r\n return expr;\r\n }\r\n\r\n static createThisExpression(\r\n range: Range\r\n ): ThisExpression {\r\n var expr = new ThisExpression();\r\n expr.range = range;\r\n return expr;\r\n }\r\n\r\n static createTrueExpression(\r\n range: Range\r\n ): TrueExpression {\r\n var expr = new TrueExpression();\r\n expr.range = range;\r\n return expr;\r\n }\r\n\r\n static createUnaryPostfixExpression(\r\n operator: Token,\r\n operand: Expression,\r\n range: Range\r\n ): UnaryPostfixExpression {\r\n var expr = new UnaryPostfixExpression();\r\n expr.range = range;\r\n expr.operator = operator;\r\n expr.operand = operand;\r\n return expr;\r\n }\r\n\r\n static createUnaryPrefixExpression(\r\n operator: Token,\r\n operand: Expression,\r\n range: Range\r\n ): UnaryPrefixExpression {\r\n var expr = new UnaryPrefixExpression();\r\n expr.range = range;\r\n expr.operator = operator;\r\n expr.operand = operand;\r\n return expr;\r\n }\r\n\r\n // statements\r\n\r\n static createBlockStatement(\r\n statements: Statement[],\r\n range: Range\r\n ): BlockStatement {\r\n var stmt = new BlockStatement();\r\n stmt.range = range;\r\n stmt.statements = statements;\r\n return stmt;\r\n }\r\n\r\n static createBreakStatement(\r\n label: IdentifierExpression | null,\r\n range: Range\r\n ): BreakStatement {\r\n var stmt = new BreakStatement();\r\n stmt.range = range;\r\n stmt.label = label;\r\n return stmt;\r\n }\r\n\r\n static createClassDeclaration(\r\n identifier: IdentifierExpression,\r\n typeParameters: TypeParameterNode[] | null,\r\n extendsType: TypeNode | null, // can't be a function\r\n implementsTypes: TypeNode[] | null, // can't be functions\r\n members: DeclarationStatement[],\r\n decorators: DecoratorNode[] | null,\r\n flags: CommonFlags,\r\n range: Range\r\n ): ClassDeclaration {\r\n var stmt = new ClassDeclaration();\r\n stmt.range = range;\r\n stmt.flags = flags;\r\n stmt.name = identifier;\r\n stmt.typeParameters = typeParameters;\r\n stmt.extendsType = extendsType;\r\n stmt.implementsTypes = implementsTypes;\r\n stmt.members = members;\r\n stmt.decorators = decorators;\r\n return stmt;\r\n }\r\n\r\n static createContinueStatement(\r\n label: IdentifierExpression | null,\r\n range: Range\r\n ): ContinueStatement {\r\n var stmt = new ContinueStatement();\r\n stmt.range = range;\r\n stmt.label = label;\r\n return stmt;\r\n }\r\n\r\n static createDoStatement(\r\n statement: Statement,\r\n condition: Expression,\r\n range: Range\r\n ): DoStatement {\r\n var stmt = new DoStatement();\r\n stmt.range = range;\r\n stmt.statement = statement;\r\n stmt.condition = condition;\r\n return stmt;\r\n }\r\n\r\n static createEmptyStatement(\r\n range: Range\r\n ): EmptyStatement {\r\n var stmt = new EmptyStatement();\r\n stmt.range = range;\r\n return stmt;\r\n }\r\n\r\n static createEnumDeclaration(\r\n name: IdentifierExpression,\r\n members: EnumValueDeclaration[],\r\n decorators: DecoratorNode[] | null,\r\n flags: CommonFlags,\r\n range: Range\r\n ): EnumDeclaration {\r\n var stmt = new EnumDeclaration();\r\n stmt.range = range;\r\n stmt.flags = flags;\r\n stmt.name = name;\r\n stmt.values = members;\r\n stmt.decorators = decorators;\r\n return stmt;\r\n }\r\n\r\n static createEnumValueDeclaration(\r\n name: IdentifierExpression,\r\n value: Expression | null,\r\n flags: CommonFlags,\r\n range: Range\r\n ): EnumValueDeclaration {\r\n var stmt = new EnumValueDeclaration();\r\n stmt.range = range;\r\n stmt.flags = flags;\r\n stmt.name = name;\r\n stmt.value = value;\r\n return stmt;\r\n }\r\n\r\n static createExportStatement(\r\n members: ExportMember[] | null,\r\n path: StringLiteralExpression | null,\r\n isDeclare: bool,\r\n range: Range\r\n ): ExportStatement {\r\n var stmt = new ExportStatement();\r\n stmt.range = range;\r\n stmt.members = members;\r\n stmt.path = path;\r\n if (path) {\r\n let normalizedPath = normalizePath(path.value);\r\n if (path.value.startsWith(\".\")) { // relative\r\n stmt.normalizedPath = resolvePath(\r\n normalizedPath,\r\n range.source.normalizedPath\r\n );\r\n } else { // absolute\r\n if (!normalizedPath.startsWith(LIBRARY_PREFIX)) {\r\n normalizedPath = LIBRARY_PREFIX + normalizedPath;\r\n }\r\n stmt.normalizedPath = normalizedPath;\r\n }\r\n stmt.internalPath = mangleInternalPath(stmt.normalizedPath);\r\n } else {\r\n stmt.normalizedPath = null;\r\n stmt.internalPath = null;\r\n }\r\n stmt.isDeclare = isDeclare;\r\n return stmt;\r\n }\r\n\r\n static createExportDefaultStatement(\r\n declaration: DeclarationStatement,\r\n range: Range\r\n ): ExportDefaultStatement {\r\n var stmt = new ExportDefaultStatement();\r\n stmt.declaration = declaration;\r\n stmt.range = range;\r\n return stmt;\r\n }\r\n\r\n static createExportImportStatement(\r\n name: IdentifierExpression,\r\n externalName: IdentifierExpression,\r\n range: Range\r\n ): ExportImportStatement {\r\n var stmt = new ExportImportStatement();\r\n stmt.range = range;\r\n stmt.name = name;\r\n stmt.externalName = externalName;\r\n return stmt;\r\n }\r\n\r\n static createExportMember(\r\n name: IdentifierExpression,\r\n externalName: IdentifierExpression | null,\r\n range: Range\r\n ): ExportMember {\r\n var elem = new ExportMember();\r\n elem.range = range;\r\n elem.localName = name;\r\n if (!externalName) externalName = name;\r\n elem.exportedName = externalName;\r\n return elem;\r\n }\r\n\r\n static createExpressionStatement(\r\n expression: Expression\r\n ): ExpressionStatement {\r\n var stmt = new ExpressionStatement();\r\n stmt.range = expression.range;\r\n stmt.expression = expression;\r\n return stmt;\r\n }\r\n\r\n static createIfStatement(\r\n condition: Expression,\r\n ifTrue: Statement,\r\n ifFalse: Statement | null,\r\n range: Range\r\n ): IfStatement {\r\n var stmt = new IfStatement();\r\n stmt.range = range;\r\n stmt.condition = condition;\r\n stmt.ifTrue = ifTrue;\r\n stmt.ifFalse = ifFalse;\r\n return stmt;\r\n }\r\n\r\n static createImportStatement(\r\n decls: ImportDeclaration[] | null,\r\n path: StringLiteralExpression,\r\n range: Range\r\n ): ImportStatement {\r\n var stmt = new ImportStatement();\r\n stmt.range = range;\r\n stmt.declarations = decls;\r\n stmt.namespaceName = null;\r\n stmt.path = path;\r\n var normalizedPath = normalizePath(path.value);\r\n if (path.value.startsWith(\".\")) { // relative in project\r\n stmt.normalizedPath = resolvePath(\r\n normalizedPath,\r\n range.source.normalizedPath\r\n );\r\n } else { // absolute in library\r\n if (!normalizedPath.startsWith(LIBRARY_PREFIX)) {\r\n normalizedPath = LIBRARY_PREFIX + normalizedPath;\r\n }\r\n stmt.normalizedPath = normalizedPath;\r\n }\r\n stmt.internalPath = mangleInternalPath(stmt.normalizedPath);\r\n return stmt;\r\n }\r\n\r\n static createImportStatementWithWildcard(\r\n identifier: IdentifierExpression,\r\n path: StringLiteralExpression,\r\n range: Range\r\n ): ImportStatement {\r\n var stmt = new ImportStatement();\r\n stmt.range = range;\r\n stmt.declarations = null;\r\n stmt.namespaceName = identifier;\r\n stmt.path = path;\r\n var normalizedPath = normalizePath(path.value);\r\n if (path.value.startsWith(\".\")) {\r\n stmt.normalizedPath = resolvePath(\r\n normalizedPath,\r\n range.source.normalizedPath\r\n );\r\n } else {\r\n if (!normalizedPath.startsWith(LIBRARY_PREFIX)) {\r\n normalizedPath = LIBRARY_PREFIX + normalizedPath;\r\n }\r\n stmt.normalizedPath = normalizedPath;\r\n }\r\n stmt.internalPath = mangleInternalPath(stmt.normalizedPath);\r\n return stmt;\r\n }\r\n\r\n static createImportDeclaration(\r\n foreignName: IdentifierExpression,\r\n name: IdentifierExpression | null,\r\n range: Range\r\n ): ImportDeclaration {\r\n var elem = new ImportDeclaration();\r\n elem.range = range;\r\n elem.foreignName = foreignName;\r\n if (!name) name = foreignName;\r\n elem.name = name;\r\n return elem;\r\n }\r\n\r\n static createInterfaceDeclaration(\r\n name: IdentifierExpression,\r\n typeParameters: TypeParameterNode[] | null,\r\n extendsType: TypeNode | null, // can't be a function\r\n members: DeclarationStatement[],\r\n decorators: DecoratorNode[] | null,\r\n flags: CommonFlags,\r\n range: Range\r\n ): InterfaceDeclaration {\r\n var stmt = new InterfaceDeclaration();\r\n stmt.range = range;\r\n stmt.flags = flags;\r\n stmt.name = name;\r\n stmt.typeParameters = typeParameters;\r\n stmt.extendsType = extendsType;\r\n stmt.members = members;\r\n stmt.decorators = decorators;\r\n return stmt;\r\n }\r\n\r\n static createFieldDeclaration(\r\n name: IdentifierExpression,\r\n type: CommonTypeNode | null,\r\n initializer: Expression | null,\r\n decorators: DecoratorNode[] | null,\r\n flags: CommonFlags,\r\n range: Range\r\n ): FieldDeclaration {\r\n var stmt = new FieldDeclaration();\r\n stmt.range = range;\r\n stmt.flags = flags;\r\n stmt.name = name;\r\n stmt.type = type;\r\n stmt.initializer = initializer;\r\n stmt.decorators = decorators;\r\n return stmt;\r\n }\r\n\r\n static createForStatement(\r\n initializer: Statement | null,\r\n condition: Expression | null,\r\n incrementor: Expression | null,\r\n statement: Statement,\r\n range: Range\r\n ): ForStatement {\r\n var stmt = new ForStatement();\r\n stmt.range = range;\r\n stmt.initializer = initializer;\r\n stmt.condition = condition;\r\n stmt.incrementor = incrementor;\r\n stmt.statement = statement;\r\n return stmt;\r\n }\r\n\r\n static createFunctionDeclaration(\r\n name: IdentifierExpression,\r\n typeParameters: TypeParameterNode[] | null,\r\n signature: SignatureNode,\r\n body: Statement | null,\r\n decorators: DecoratorNode[] | null,\r\n flags: CommonFlags,\r\n arrowKind: ArrowKind,\r\n range: Range\r\n ): FunctionDeclaration {\r\n var stmt = new FunctionDeclaration();\r\n stmt.range = range;\r\n stmt.flags = flags;\r\n stmt.name = name;\r\n stmt.typeParameters = typeParameters;\r\n stmt.signature = signature;\r\n stmt.body = body;\r\n stmt.decorators = decorators;\r\n stmt.arrowKind = arrowKind;\r\n return stmt;\r\n }\r\n\r\n static createIndexSignatureDeclaration(\r\n keyType: TypeNode,\r\n valueType: CommonTypeNode,\r\n range: Range\r\n ): IndexSignatureDeclaration {\r\n var elem = new IndexSignatureDeclaration();\r\n elem.range = range;\r\n elem.keyType = keyType;\r\n elem.valueType = valueType;\r\n return elem;\r\n }\r\n\r\n static createMethodDeclaration(\r\n name: IdentifierExpression,\r\n typeParameters: TypeParameterNode[] | null,\r\n signature: SignatureNode,\r\n body: Statement | null,\r\n decorators: DecoratorNode[] | null,\r\n flags: CommonFlags,\r\n range: Range\r\n ): MethodDeclaration {\r\n var stmt = new MethodDeclaration();\r\n stmt.range = range;\r\n stmt.flags = flags;\r\n stmt.name = name;\r\n stmt.typeParameters = typeParameters;\r\n stmt.signature = signature;\r\n stmt.body = body;\r\n stmt.decorators = decorators;\r\n return stmt;\r\n }\r\n\r\n static createNamespaceDeclaration(\r\n name: IdentifierExpression,\r\n members: Statement[],\r\n decorators: DecoratorNode[] | null,\r\n flags: CommonFlags,\r\n range: Range\r\n ): NamespaceDeclaration {\r\n var stmt = new NamespaceDeclaration();\r\n stmt.range = range;\r\n stmt.flags = flags;\r\n stmt.name = name;\r\n stmt.members = members;\r\n stmt.decorators = decorators;\r\n return stmt;\r\n }\r\n\r\n static createReturnStatement(\r\n value: Expression | null,\r\n range: Range\r\n ): ReturnStatement {\r\n var stmt = new ReturnStatement();\r\n stmt.range = range;\r\n stmt.value = value;\r\n return stmt;\r\n }\r\n\r\n static createSwitchStatement(\r\n condition: Expression,\r\n cases: SwitchCase[],\r\n range: Range\r\n ): SwitchStatement {\r\n var stmt = new SwitchStatement();\r\n stmt.range = range;\r\n stmt.condition = condition;\r\n stmt.cases = cases;\r\n return stmt;\r\n }\r\n\r\n static createSwitchCase(\r\n label: Expression | null,\r\n statements: Statement[],\r\n range: Range\r\n ): SwitchCase {\r\n var elem = new SwitchCase();\r\n elem.range = range;\r\n elem.label = label;\r\n elem.statements = statements;\r\n return elem;\r\n }\r\n\r\n static createThrowStatement(\r\n value: Expression,\r\n range: Range\r\n ): ThrowStatement {\r\n var stmt = new ThrowStatement();\r\n stmt.range = range;\r\n stmt.value = value;\r\n return stmt;\r\n }\r\n\r\n static createTryStatement(\r\n statements: Statement[],\r\n catchVariable: IdentifierExpression | null,\r\n catchStatements: Statement[] | null,\r\n finallyStatements: Statement[] | null,\r\n range: Range\r\n ): TryStatement {\r\n var stmt = new TryStatement();\r\n stmt.range = range;\r\n stmt.statements = statements;\r\n stmt.catchVariable = catchVariable;\r\n stmt.catchStatements = catchStatements;\r\n stmt.finallyStatements = finallyStatements;\r\n return stmt;\r\n }\r\n\r\n static createTypeDeclaration(\r\n name: IdentifierExpression,\r\n typeParameters: TypeParameterNode[] | null,\r\n alias: CommonTypeNode,\r\n decorators: DecoratorNode[] | null,\r\n flags: CommonFlags,\r\n range: Range\r\n ): TypeDeclaration {\r\n var stmt = new TypeDeclaration();\r\n stmt.range = range;\r\n stmt.flags = flags;\r\n stmt.name = name;\r\n stmt.typeParameters = typeParameters;\r\n stmt.type = alias;\r\n stmt.decorators = decorators;\r\n return stmt;\r\n }\r\n\r\n static createVariableStatement(\r\n declarations: VariableDeclaration[],\r\n decorators: DecoratorNode[] | null,\r\n range: Range\r\n ): VariableStatement {\r\n var stmt = new VariableStatement();\r\n stmt.range = range;\r\n stmt.declarations = declarations;\r\n stmt.decorators = decorators;\r\n return stmt;\r\n }\r\n\r\n static createVariableDeclaration(\r\n name: IdentifierExpression,\r\n type: CommonTypeNode | null,\r\n initializer: Expression | null,\r\n decorators: DecoratorNode[] | null,\r\n flags: CommonFlags,\r\n range: Range\r\n ): VariableDeclaration {\r\n var elem = new VariableDeclaration();\r\n elem.range = range;\r\n elem.flags = flags;\r\n elem.name = name;\r\n elem.type = type;\r\n elem.initializer = initializer;\r\n elem.decorators = decorators; // inherited\r\n return elem;\r\n }\r\n\r\n static createVoidStatement(\r\n expression: Expression,\r\n range: Range\r\n ): VoidStatement {\r\n var stmt = new VoidStatement();\r\n stmt.range = range;\r\n stmt.expression = expression;\r\n return stmt;\r\n }\r\n\r\n static createWhileStatement(\r\n condition: Expression,\r\n statement: Statement,\r\n range: Range\r\n ): WhileStatement {\r\n var stmt = new WhileStatement();\r\n stmt.range = range;\r\n stmt.condition = condition;\r\n stmt.statement = statement;\r\n return stmt;\r\n }\r\n}\r\n\r\n// types\r\n\r\nexport abstract class CommonTypeNode extends Node {\r\n // kind varies\r\n\r\n /** Whether nullable or not. */\r\n isNullable: bool;\r\n}\r\n\r\n/** Represents a type name. */\r\nexport class TypeName extends Node {\r\n kind = NodeKind.TYPENAME;\r\n\r\n /** Identifier of this part. */\r\n identifier: IdentifierExpression;\r\n /** Next part of the type name or `null` if this is the last part. */\r\n next: TypeName | null;\r\n}\r\n\r\n/** Represents a type annotation. */\r\nexport class TypeNode extends CommonTypeNode {\r\n kind = NodeKind.TYPE;\r\n\r\n /** Type name. */\r\n name: TypeName;\r\n /** Type argument references. */\r\n typeArguments: CommonTypeNode[] | null;\r\n}\r\n\r\n/** Represents a type parameter. */\r\nexport class TypeParameterNode extends Node {\r\n kind = NodeKind.TYPEPARAMETER;\r\n\r\n /** Identifier reference. */\r\n name: IdentifierExpression;\r\n /** Extended type reference, if any. */\r\n extendsType: TypeNode | null; // can't be a function\r\n /** Default type if omitted, if any. */\r\n defaultType: TypeNode | null; // can't be a function\r\n}\r\n\r\n/** Represents the kind of a parameter. */\r\nexport enum ParameterKind {\r\n /** No specific flags. */\r\n DEFAULT,\r\n /** Is an optional parameter. */\r\n OPTIONAL,\r\n /** Is a rest parameter. */\r\n REST\r\n}\r\n\r\n/** Represents a function parameter. */\r\nexport class ParameterNode extends Node {\r\n kind = NodeKind.PARAMETER;\r\n\r\n /** Parameter kind. */\r\n parameterKind: ParameterKind;\r\n /** Parameter name. */\r\n name: IdentifierExpression;\r\n /** Parameter type. */\r\n type: CommonTypeNode;\r\n /** Initializer expression, if present. */\r\n initializer: Expression | null;\r\n /** Implicit field declaration, if applicable. */\r\n implicitFieldDeclaration: FieldDeclaration | null = null;\r\n /** Common flags indicating specific traits. */\r\n flags: CommonFlags = CommonFlags.NONE;\r\n\r\n /** Tests if this node has the specified flag or flags. */\r\n is(flag: CommonFlags): bool { return (this.flags & flag) == flag; }\r\n /** Tests if this node has one of the specified flags. */\r\n isAny(flag: CommonFlags): bool { return (this.flags & flag) != 0; }\r\n /** Sets a specific flag or flags. */\r\n set(flag: CommonFlags): void { this.flags |= flag; }\r\n}\r\n\r\n/** Represents a function signature. */\r\nexport class SignatureNode extends CommonTypeNode {\r\n kind = NodeKind.SIGNATURE;\r\n\r\n /** Accepted parameters. */\r\n parameters: ParameterNode[];\r\n /** Return type. */\r\n returnType: CommonTypeNode;\r\n /** Explicitly provided this type, if any. */\r\n explicitThisType: TypeNode | null; // can't be a function\r\n}\r\n\r\n// special\r\n\r\n/** Built-in decorator kinds. */\r\nexport enum DecoratorKind {\r\n CUSTOM,\r\n GLOBAL,\r\n OPERATOR,\r\n OPERATOR_BINARY,\r\n OPERATOR_PREFIX,\r\n OPERATOR_POSTFIX,\r\n UNMANAGED,\r\n SEALED,\r\n INLINE,\r\n EXTERNAL,\r\n BUILTIN,\r\n LAZY,\r\n UNSAFE\r\n}\r\n\r\n/** Returns the kind of the specified decorator. Defaults to {@link DecoratorKind.CUSTOM}. */\r\nexport function decoratorNameToKind(name: Expression): DecoratorKind {\r\n // @global, @inline, @operator, @sealed, @unmanaged\r\n if (name.kind == NodeKind.IDENTIFIER) {\r\n let nameStr = (name).text;\r\n assert(nameStr.length);\r\n switch (nameStr.charCodeAt(0)) {\r\n case CharCode.b: {\r\n if (nameStr == \"builtin\") return DecoratorKind.BUILTIN;\r\n break;\r\n }\r\n case CharCode.e: {\r\n if (nameStr == \"external\") return DecoratorKind.EXTERNAL;\r\n break;\r\n }\r\n case CharCode.g: {\r\n if (nameStr == \"global\") return DecoratorKind.GLOBAL;\r\n break;\r\n }\r\n case CharCode.i: {\r\n if (nameStr == \"inline\") return DecoratorKind.INLINE;\r\n break;\r\n }\r\n case CharCode.l: {\r\n if (nameStr == \"lazy\") return DecoratorKind.LAZY;\r\n break;\r\n }\r\n case CharCode.o: {\r\n if (nameStr == \"operator\") return DecoratorKind.OPERATOR;\r\n break;\r\n }\r\n case CharCode.s: {\r\n if (nameStr == \"sealed\") return DecoratorKind.SEALED;\r\n break;\r\n }\r\n case CharCode.u: {\r\n if (nameStr == \"unmanaged\") return DecoratorKind.UNMANAGED;\r\n if (nameStr == \"unsafe\") return DecoratorKind.UNSAFE;\r\n break;\r\n }\r\n }\r\n } else if (\r\n name.kind == NodeKind.PROPERTYACCESS &&\r\n (name).expression.kind == NodeKind.IDENTIFIER\r\n ) {\r\n let nameStr = ((name).expression).text;\r\n assert(nameStr.length);\r\n let propStr = (name).property.text;\r\n assert(propStr.length);\r\n // @operator.binary, @operator.prefix, @operator.postfix\r\n if (nameStr == \"operator\") {\r\n switch (propStr.charCodeAt(0)) {\r\n case CharCode.b: {\r\n if (propStr == \"binary\") return DecoratorKind.OPERATOR_BINARY;\r\n break;\r\n }\r\n case CharCode.p: {\r\n switch (propStr) {\r\n case \"prefix\": return DecoratorKind.OPERATOR_PREFIX;\r\n case \"postfix\": return DecoratorKind.OPERATOR_POSTFIX;\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n return DecoratorKind.CUSTOM;\r\n}\r\n\r\n/** Represents a decorator. */\r\nexport class DecoratorNode extends Node {\r\n kind = NodeKind.DECORATOR;\r\n\r\n /** Built-in kind, if applicable. */\r\n decoratorKind: DecoratorKind;\r\n /** Name expression. */\r\n name: Expression;\r\n /** Argument expressions. */\r\n arguments: Expression[] | null;\r\n}\r\n\r\n/** Comment kinds. */\r\nexport enum CommentKind {\r\n /** Line comment. */\r\n LINE,\r\n /** Triple-slash comment. */\r\n TRIPLE,\r\n /** Block comment. */\r\n BLOCK\r\n}\r\n\r\n/** Represents a comment. */\r\nexport class CommentNode extends Node {\r\n kind = NodeKind.COMMENT;\r\n\r\n /** Comment kind. */\r\n commentKind: CommentKind;\r\n /** Comment text. */\r\n text: string;\r\n}\r\n\r\n// expressions\r\n\r\n/** Base class of all expression nodes. */\r\nexport abstract class Expression extends Node { }\r\n\r\n/** Represents an identifier expression. */\r\nexport class IdentifierExpression extends Expression {\r\n kind = NodeKind.IDENTIFIER;\r\n\r\n /** Textual name. */\r\n text: string;\r\n /** Symbol. */\r\n symbol: string; // TODO: symbol\r\n /** Whether quoted or not. */\r\n isQuoted: bool;\r\n}\r\n\r\n/** Indicates the kind of a literal. */\r\nexport enum LiteralKind {\r\n FLOAT,\r\n INTEGER,\r\n STRING,\r\n REGEXP,\r\n ARRAY,\r\n OBJECT\r\n}\r\n\r\n/** Base class of all literal expressions. */\r\nexport abstract class LiteralExpression extends Expression {\r\n kind = NodeKind.LITERAL;\r\n\r\n /** Specific literal kind. */\r\n literalKind: LiteralKind;\r\n}\r\n\r\n/** Represents an `[]` literal expression. */\r\nexport class ArrayLiteralExpression extends LiteralExpression {\r\n literalKind = LiteralKind.ARRAY;\r\n\r\n /** Nested element expressions. */\r\n elementExpressions: (Expression | null)[];\r\n}\r\n\r\n/** Indicates the kind of an assertion. */\r\nexport enum AssertionKind {\r\n PREFIX,\r\n AS,\r\n NONNULL\r\n}\r\n\r\n/** Represents an assertion expression. */\r\nexport class AssertionExpression extends Expression {\r\n kind = NodeKind.ASSERTION;\r\n\r\n /** Specific kind of this assertion. */\r\n assertionKind: AssertionKind;\r\n /** Expression being asserted. */\r\n expression: Expression;\r\n /** Target type. */\r\n toType: CommonTypeNode | null;\r\n}\r\n\r\n/** Represents a binary expression. */\r\nexport class BinaryExpression extends Expression {\r\n kind = NodeKind.BINARY;\r\n\r\n /** Operator token. */\r\n operator: Token;\r\n /** Left-hand side expression */\r\n left: Expression;\r\n /** Right-hand side expression. */\r\n right: Expression;\r\n}\r\n\r\n/** Represents a call expression. */\r\nexport class CallExpression extends Expression {\r\n kind = NodeKind.CALL;\r\n\r\n /** Called expression. Usually an identifier or property access expression. */\r\n expression: Expression;\r\n /** Provided type arguments. */\r\n typeArguments: CommonTypeNode[] | null;\r\n /** Provided arguments. */\r\n arguments: Expression[];\r\n\r\n /** Gets the type arguments range for reporting. */\r\n get typeArgumentsRange(): Range {\r\n var typeArguments = this.typeArguments;\r\n var numTypeArguments: i32;\r\n if (typeArguments && (numTypeArguments = typeArguments.length)) {\r\n return Range.join(typeArguments[0].range, typeArguments[numTypeArguments - 1].range);\r\n }\r\n return this.expression.range;\r\n }\r\n\r\n /** Gets the arguments range for reporting. */\r\n get argumentsRange(): Range {\r\n var args = this.arguments;\r\n var numArguments = args.length;\r\n if (numArguments) {\r\n return Range.join(args[0].range, args[numArguments - 1].range);\r\n }\r\n return this.expression.range;\r\n }\r\n}\r\n\r\n/** Represents a class expression using the 'class' keyword. */\r\nexport class ClassExpression extends Expression {\r\n kind = NodeKind.CLASS;\r\n\r\n /** Inline class declaration. */\r\n declaration: ClassDeclaration;\r\n}\r\n\r\n/** Represents a comma expression composed of multiple expressions. */\r\nexport class CommaExpression extends Expression {\r\n kind = NodeKind.COMMA;\r\n\r\n /** Sequential expressions. */\r\n expressions: Expression[];\r\n}\r\n\r\n/** Represents a `constructor` expression. */\r\nexport class ConstructorExpression extends IdentifierExpression {\r\n kind = NodeKind.CONSTRUCTOR;\r\n text = \"constructor\";\r\n symbol = CommonSymbols.constructor;\r\n}\r\n\r\n/** Represents an element access expression, e.g., array access. */\r\nexport class ElementAccessExpression extends Expression {\r\n kind = NodeKind.ELEMENTACCESS;\r\n\r\n /** Expression being accessed. */\r\n expression: Expression;\r\n /** Element of the expression being accessed. */\r\n elementExpression: Expression;\r\n}\r\n\r\n/** Represents a float literal expression. */\r\nexport class FloatLiteralExpression extends LiteralExpression {\r\n literalKind = LiteralKind.FLOAT;\r\n\r\n /** Float value. */\r\n value: f64;\r\n}\r\n\r\n/** Represents a function expression using the 'function' keyword. */\r\nexport class FunctionExpression extends Expression {\r\n kind = NodeKind.FUNCTION;\r\n\r\n /** Inline function declaration. */\r\n declaration: FunctionDeclaration;\r\n}\r\n\r\n/** Represents an `instanceof` expression. */\r\nexport class InstanceOfExpression extends Expression {\r\n kind = NodeKind.INSTANCEOF;\r\n\r\n /** Expression being asserted. */\r\n expression: Expression;\r\n /** Type to test for. */\r\n isType: CommonTypeNode;\r\n}\r\n\r\n/** Represents an integer literal expression. */\r\nexport class IntegerLiteralExpression extends LiteralExpression {\r\n literalKind = LiteralKind.INTEGER;\r\n\r\n /** Integer value. */\r\n value: I64;\r\n}\r\n\r\n/** Represents a `new` expression. Like a call but with its own kind. */\r\nexport class NewExpression extends CallExpression {\r\n kind = NodeKind.NEW;\r\n}\r\n\r\n/** Represents a `null` expression. */\r\nexport class NullExpression extends IdentifierExpression {\r\n kind = NodeKind.NULL;\r\n text = \"null\";\r\n symbol = CommonSymbols.null_;\r\n}\r\n\r\n/** Represents an object literal expression. */\r\nexport class ObjectLiteralExpression extends LiteralExpression {\r\n literalKind = LiteralKind.OBJECT;\r\n\r\n /** Field names. */\r\n names: IdentifierExpression[];\r\n /** Field values. */\r\n values: Expression[];\r\n}\r\n\r\n/** Represents a parenthesized expression. */\r\nexport class ParenthesizedExpression extends Expression {\r\n kind = NodeKind.PARENTHESIZED;\r\n\r\n /** Expression in parenthesis. */\r\n expression: Expression;\r\n}\r\n\r\n/** Represents a property access expression. */\r\nexport class PropertyAccessExpression extends Expression {\r\n kind = NodeKind.PROPERTYACCESS;\r\n\r\n /** Expression being accessed. */\r\n expression: Expression;\r\n /** Property of the expression being accessed. */\r\n property: IdentifierExpression;\r\n}\r\n\r\n/** Represents a regular expression literal expression. */\r\nexport class RegexpLiteralExpression extends LiteralExpression {\r\n literalKind = LiteralKind.REGEXP;\r\n\r\n /** Regular expression pattern. */\r\n pattern: string;\r\n /** Regular expression flags. */\r\n patternFlags: string;\r\n}\r\n\r\n/** Represents a ternary expression, i.e., short if notation. */\r\nexport class TernaryExpression extends Expression {\r\n kind = NodeKind.TERNARY;\r\n\r\n /** Condition expression. */\r\n condition: Expression;\r\n /** Expression executed when condition is `true`. */\r\n ifThen: Expression;\r\n /** Expression executed when condition is `false`. */\r\n ifElse: Expression;\r\n}\r\n\r\n/** Represents a string literal expression. */\r\nexport class StringLiteralExpression extends LiteralExpression {\r\n literalKind = LiteralKind.STRING;\r\n\r\n /** String value without quotes. */\r\n value: string;\r\n}\r\n\r\n/** Represents a `super` expression. */\r\nexport class SuperExpression extends IdentifierExpression {\r\n kind = NodeKind.SUPER;\r\n text = \"super\";\r\n symbol = CommonSymbols.super_;\r\n}\r\n\r\n/** Represents a `this` expression. */\r\nexport class ThisExpression extends IdentifierExpression {\r\n kind = NodeKind.THIS;\r\n text = \"this\";\r\n symbol = CommonSymbols.this_;\r\n}\r\n\r\n/** Represents a `true` expression. */\r\nexport class TrueExpression extends IdentifierExpression {\r\n kind = NodeKind.TRUE;\r\n text = \"true\";\r\n symbol = CommonSymbols.true_;\r\n}\r\n\r\n/** Represents a `false` expression. */\r\nexport class FalseExpression extends IdentifierExpression {\r\n kind = NodeKind.FALSE;\r\n text = \"false\";\r\n symbol = CommonSymbols.false_;\r\n}\r\n\r\n/** Base class of all unary expressions. */\r\nexport abstract class UnaryExpression extends Expression {\r\n\r\n /** Operator token. */\r\n operator: Token;\r\n /** Operand expression. */\r\n operand: Expression;\r\n}\r\n\r\n/** Represents a unary postfix expression, e.g. a postfix increment. */\r\nexport class UnaryPostfixExpression extends UnaryExpression {\r\n kind = NodeKind.UNARYPOSTFIX;\r\n}\r\n\r\n/** Represents a unary prefix expression, e.g. a negation. */\r\nexport class UnaryPrefixExpression extends UnaryExpression {\r\n kind = NodeKind.UNARYPREFIX;\r\n}\r\n\r\n// statements\r\n\r\n/** Base class of all statement nodes. */\r\nexport abstract class Statement extends Node { }\r\n\r\n/** Indicates the specific kind of a source. */\r\nexport enum SourceKind {\r\n /** Default source. Usually imported from an entry file. */\r\n DEFAULT,\r\n /** Entry file. */\r\n ENTRY,\r\n /** Library file. */\r\n LIBRARY\r\n}\r\n\r\n/** A top-level source node. */\r\nexport class Source extends Node {\r\n kind = NodeKind.SOURCE;\r\n parent = null;\r\n\r\n /** Source kind. */\r\n sourceKind: SourceKind;\r\n /** Normalized path. */\r\n normalizedPath: string;\r\n /** Path used internally. */\r\n internalPath: string;\r\n /** Simple path (last part without extension). */\r\n simplePath: string;\r\n /** Contained statements. */\r\n statements: Statement[];\r\n /** Full source text. */\r\n text: string;\r\n /** Tokenizer reference. */\r\n tokenizer: Tokenizer | null = null;\r\n /** Source map index. */\r\n debugInfoIndex: i32 = -1;\r\n /** Re-exported sources. */\r\n exportPaths: Set | null = null;\r\n\r\n /** Constructs a new source node. */\r\n constructor(normalizedPath: string, text: string, kind: SourceKind) {\r\n super();\r\n this.sourceKind = kind;\r\n this.normalizedPath = normalizedPath;\r\n var internalPath = mangleInternalPath(this.normalizedPath);\r\n this.internalPath = internalPath;\r\n var pos = internalPath.lastIndexOf(PATH_DELIMITER);\r\n this.simplePath = pos >= 0 ? internalPath.substring(pos + 1) : internalPath;\r\n this.statements = new Array();\r\n this.range = new Range(this, 0, text.length);\r\n this.text = text;\r\n }\r\n\r\n /** Tests if this source is an entry file. */\r\n get isEntry(): bool { return this.sourceKind == SourceKind.ENTRY; }\r\n /** Tests if this source is a stdlib file. */\r\n get isLibrary(): bool { return this.sourceKind == SourceKind.LIBRARY; }\r\n}\r\n\r\n/** Base class of all declaration statements. */\r\nexport abstract class DeclarationStatement extends Statement {\r\n /** Simple name being declared. */\r\n name: IdentifierExpression;\r\n /** Array of decorators. */\r\n decorators: DecoratorNode[] | null = null;\r\n /** Common flags indicating specific traits. */\r\n flags: CommonFlags = CommonFlags.NONE;\r\n\r\n /** Tests if this node has the specified flag or flags. */\r\n is(flag: CommonFlags): bool { return (this.flags & flag) == flag; }\r\n /** Tests if this node has one of the specified flags. */\r\n isAny(flag: CommonFlags): bool { return (this.flags & flag) != 0; }\r\n /** Sets a specific flag or flags. */\r\n set(flag: CommonFlags): void { this.flags |= flag; }\r\n}\r\n\r\n/** Represents an index signature declaration. */\r\nexport class IndexSignatureDeclaration extends DeclarationStatement {\r\n kind = NodeKind.INDEXSIGNATUREDECLARATION;\r\n\r\n /** Key type. */\r\n keyType: TypeNode;\r\n /** Value type. */\r\n valueType: CommonTypeNode;\r\n}\r\n\r\n/** Base class of all variable-like declaration statements. */\r\nexport abstract class VariableLikeDeclarationStatement extends DeclarationStatement {\r\n\r\n /** Variable type. */\r\n type: CommonTypeNode | null;\r\n /** Variable initializer. */\r\n initializer: Expression | null;\r\n}\r\n\r\n/** Represents a block statement. */\r\nexport class BlockStatement extends Statement {\r\n kind = NodeKind.BLOCK;\r\n\r\n /** Contained statements. */\r\n statements: Statement[];\r\n}\r\n\r\n/** Represents a `break` statement. */\r\nexport class BreakStatement extends Statement {\r\n kind = NodeKind.BREAK;\r\n\r\n /** Target label, if applicable. */\r\n label: IdentifierExpression | null;\r\n}\r\n\r\n/** Represents a `class` declaration. */\r\nexport class ClassDeclaration extends DeclarationStatement {\r\n kind = NodeKind.CLASSDECLARATION;\r\n\r\n /** Accepted type parameters. */\r\n typeParameters: TypeParameterNode[] | null;\r\n /** Base class type being extended, if any. */\r\n extendsType: TypeNode | null; // can't be a function\r\n /** Interface types being implemented, if any. */\r\n implementsTypes: TypeNode[] | null; // can't be functions\r\n /** Class member declarations. */\r\n members: DeclarationStatement[];\r\n\r\n get isGeneric(): bool {\r\n var typeParameters = this.typeParameters;\r\n return typeParameters != null && typeParameters.length > 0;\r\n }\r\n}\r\n\r\n/** Represents a `continue` statement. */\r\nexport class ContinueStatement extends Statement {\r\n kind = NodeKind.CONTINUE;\r\n\r\n /** Target label, if applicable. */\r\n label: IdentifierExpression | null;\r\n}\r\n\r\n/** Represents a `do` statement. */\r\nexport class DoStatement extends Statement {\r\n kind = NodeKind.DO;\r\n\r\n /** Statement being looped over. */\r\n statement: Statement;\r\n /** Condition when to repeat. */\r\n condition: Expression;\r\n}\r\n\r\n/** Represents an empty statement, i.e., a semicolon terminating nothing. */\r\nexport class EmptyStatement extends Statement {\r\n kind = NodeKind.EMPTY;\r\n}\r\n\r\n/** Represents an `enum` declaration. */\r\nexport class EnumDeclaration extends DeclarationStatement {\r\n kind = NodeKind.ENUMDECLARATION;\r\n\r\n /** Enum value declarations. */\r\n values: EnumValueDeclaration[];\r\n}\r\n\r\n/** Represents a value of an `enum` declaration. */\r\nexport class EnumValueDeclaration extends VariableLikeDeclarationStatement {\r\n kind = NodeKind.ENUMVALUEDECLARATION;\r\n // name is inherited\r\n\r\n /** Value expression. */\r\n value: Expression | null;\r\n}\r\n\r\n/** Represents an `export import` statement of an interface. */\r\nexport class ExportImportStatement extends Node {\r\n kind = NodeKind.EXPORTIMPORT;\r\n\r\n /** Identifier being imported. */\r\n name: IdentifierExpression;\r\n /** Identifier being exported. */\r\n externalName: IdentifierExpression;\r\n}\r\n\r\n/** Represents a member of an `export` statement. */\r\nexport class ExportMember extends Node {\r\n kind = NodeKind.EXPORTMEMBER;\r\n\r\n /** Local identifier. */\r\n localName: IdentifierExpression;\r\n /** Exported identifier. */\r\n exportedName: IdentifierExpression;\r\n}\r\n\r\n/** Represents an `export` statement. */\r\nexport class ExportStatement extends Statement {\r\n kind = NodeKind.EXPORT;\r\n\r\n /** Array of members if a set of named exports, or `null` if a file export. */\r\n members: ExportMember[] | null;\r\n /** Path being exported from, if applicable. */\r\n path: StringLiteralExpression | null;\r\n /** Normalized path, if `path` is set. */\r\n normalizedPath: string | null;\r\n /** Mangled internal path being referenced, if `path` is set. */\r\n internalPath: string | null;\r\n /** Whether this is a declared export. */\r\n isDeclare: bool;\r\n}\r\n\r\n/** Represents an `export default` statement. */\r\nexport class ExportDefaultStatement extends Statement {\r\n kind = NodeKind.EXPORTDEFAULT;\r\n\r\n /** Declaration being exported as default. */\r\n declaration: DeclarationStatement;\r\n}\r\n\r\n/** Represents an expression that is used as a statement. */\r\nexport class ExpressionStatement extends Statement {\r\n kind = NodeKind.EXPRESSION;\r\n\r\n /** Expression being used as a statement.*/\r\n expression: Expression;\r\n}\r\n\r\n/** Represents a field declaration within a `class`. */\r\nexport class FieldDeclaration extends VariableLikeDeclarationStatement {\r\n kind = NodeKind.FIELDDECLARATION;\r\n\r\n /** Parameter index if declared as a constructor parameter, otherwise `-1`. */\r\n parameterIndex: i32 = -1;\r\n}\r\n\r\n/** Represents a `for` statement. */\r\nexport class ForStatement extends Statement {\r\n kind = NodeKind.FOR;\r\n\r\n /**\r\n * Initializer statement, if present.\r\n * Either a {@link VariableStatement} or {@link ExpressionStatement}.\r\n */\r\n initializer: Statement | null;\r\n /** Condition expression, if present. */\r\n condition: Expression | null;\r\n /** Incrementor expression, if present. */\r\n incrementor: Expression | null;\r\n /** Statement being looped over. */\r\n statement: Statement;\r\n}\r\n\r\n/** Indicates the kind of an array function. */\r\nexport const enum ArrowKind {\r\n /** Not an arrow function. */\r\n NONE,\r\n /** Parenthesized parameter list. */\r\n ARROW_PARENTHESIZED,\r\n /** Single parameter without parenthesis. */\r\n ARROW_SINGLE\r\n}\r\n\r\n/** Represents a `function` declaration. */\r\nexport class FunctionDeclaration extends DeclarationStatement {\r\n kind = NodeKind.FUNCTIONDECLARATION;\r\n\r\n /** Type parameters, if any. */\r\n typeParameters: TypeParameterNode[] | null;\r\n /** Function signature. */\r\n signature: SignatureNode;\r\n /** Body statement. Usually a block. */\r\n body: Statement | null;\r\n /** Arrow function kind, if applicable. */\r\n arrowKind: ArrowKind;\r\n\r\n get isGeneric(): bool {\r\n var typeParameters = this.typeParameters;\r\n return typeParameters != null && typeParameters.length > 0;\r\n }\r\n\r\n /** Clones this function declaration. */\r\n clone(): FunctionDeclaration {\r\n return Node.createFunctionDeclaration(\r\n this.name,\r\n this.typeParameters,\r\n this.signature,\r\n this.body,\r\n this.decorators,\r\n this.flags,\r\n this.arrowKind,\r\n this.range\r\n );\r\n }\r\n}\r\n\r\n/** Represents an `if` statement. */\r\nexport class IfStatement extends Statement {\r\n kind = NodeKind.IF;\r\n\r\n /** Condition. */\r\n condition: Expression;\r\n /** Statement executed when condition is `true`. */\r\n ifTrue: Statement;\r\n /** Statement executed when condition is `false`. */\r\n ifFalse: Statement | null;\r\n}\r\n\r\n/** Represents an `import` declaration part of an {@link ImportStatement}. */\r\nexport class ImportDeclaration extends DeclarationStatement {\r\n kind = NodeKind.IMPORTDECLARATION;\r\n\r\n /** Identifier being imported. */\r\n foreignName: IdentifierExpression;\r\n}\r\n\r\n/** Represents an `import` statement. */\r\nexport class ImportStatement extends Statement {\r\n kind = NodeKind.IMPORT;\r\n\r\n /** Array of member declarations or `null` if an asterisk import. */\r\n declarations: ImportDeclaration[] | null;\r\n /** Name of the local namespace, if an asterisk import. */\r\n namespaceName: IdentifierExpression | null;\r\n /** Path being imported from. */\r\n path: StringLiteralExpression;\r\n /** Normalized path. */\r\n normalizedPath: string;\r\n /** Mangled internal path being referenced. */\r\n internalPath: string;\r\n}\r\n\r\n/** Represents an `interfarce` declaration. */\r\nexport class InterfaceDeclaration extends ClassDeclaration {\r\n kind = NodeKind.INTERFACEDECLARATION;\r\n}\r\n\r\n/** Represents a method declaration within a `class`. */\r\nexport class MethodDeclaration extends FunctionDeclaration {\r\n kind = NodeKind.METHODDECLARATION;\r\n}\r\n\r\n/** Represents a `namespace` declaration. */\r\nexport class NamespaceDeclaration extends DeclarationStatement {\r\n kind = NodeKind.NAMESPACEDECLARATION;\r\n\r\n /** Array of namespace members. */\r\n members: Statement[];\r\n}\r\n\r\n/** Represents a `return` statement. */\r\nexport class ReturnStatement extends Statement {\r\n kind = NodeKind.RETURN;\r\n\r\n /** Value expression being returned, if present. */\r\n value: Expression | null;\r\n}\r\n\r\n/** Represents a single `case` within a `switch` statement. */\r\nexport class SwitchCase extends Node {\r\n kind = NodeKind.SWITCHCASE;\r\n\r\n /** Label expression. `null` indicates the default case. */\r\n label: Expression | null;\r\n /** Contained statements. */\r\n statements: Statement[];\r\n}\r\n\r\n/** Represents a `switch` statement. */\r\nexport class SwitchStatement extends Statement {\r\n kind = NodeKind.SWITCH;\r\n\r\n /** Condition expression. */\r\n condition: Expression;\r\n /** Contained cases. */\r\n cases: SwitchCase[];\r\n}\r\n\r\n/** Represents a `throw` statement. */\r\nexport class ThrowStatement extends Statement {\r\n kind = NodeKind.THROW;\r\n\r\n /** Value expression being thrown. */\r\n value: Expression;\r\n}\r\n\r\n/** Represents a `try` statement. */\r\nexport class TryStatement extends Statement {\r\n kind = NodeKind.TRY;\r\n\r\n /** Contained statements. */\r\n statements: Statement[];\r\n /** Exception variable name, if a `catch` clause is present. */\r\n catchVariable: IdentifierExpression | null;\r\n /** Statements being executed on catch, if a `catch` clause is present. */\r\n catchStatements: Statement[] | null;\r\n /** Statements being executed afterwards, if a `finally` clause is present. */\r\n finallyStatements: Statement[] | null;\r\n}\r\n\r\n/** Represents a `type` declaration. */\r\nexport class TypeDeclaration extends DeclarationStatement {\r\n kind = NodeKind.TYPEDECLARATION;\r\n\r\n /** Type parameters, if any. */\r\n typeParameters: TypeParameterNode[] | null;\r\n /** Type being aliased. */\r\n type: CommonTypeNode;\r\n}\r\n\r\n/** Represents a variable declaration part of a {@link VariableStatement}. */\r\nexport class VariableDeclaration extends VariableLikeDeclarationStatement {\r\n kind = NodeKind.VARIABLEDECLARATION;\r\n}\r\n\r\n/** Represents a variable statement wrapping {@link VariableDeclaration}s. */\r\nexport class VariableStatement extends Statement {\r\n kind = NodeKind.VARIABLE;\r\n\r\n /** Array of decorators. */\r\n decorators: DecoratorNode[] | null;\r\n /** Array of member declarations. */\r\n declarations: VariableDeclaration[];\r\n}\r\n\r\n/** Represents a void statement dropping an expression's value. */\r\nexport class VoidStatement extends Statement {\r\n kind = NodeKind.VOID;\r\n\r\n /** Expression being dropped. */\r\n expression: Expression;\r\n}\r\n\r\n/** Represents a `while` statement. */\r\nexport class WhileStatement extends Statement {\r\n kind = NodeKind.WHILE;\r\n\r\n /** Condition expression. */\r\n condition: Expression;\r\n /** Statement being looped over. */\r\n statement: Statement;\r\n}\r\n\r\n/** Finds the first decorator matching the specified kind. */\r\nexport function findDecorator(kind: DecoratorKind, decorators: DecoratorNode[] | null): DecoratorNode | null {\r\n if (decorators) {\r\n for (let i = 0, k = decorators.length; i < k; ++i) {\r\n let decorator = decorators[i];\r\n if (decorator.decoratorKind == kind) return decorator;\r\n }\r\n }\r\n return null;\r\n}\r\n\r\n/** Mangles an external to an internal path. */\r\nexport function mangleInternalPath(path: string): string {\r\n if (path.endsWith(\".ts\")) path = path.substring(0, path.length - 3);\r\n return path;\r\n}\r\n\r\n/** Tests if the specified type node represents an omitted type. */\r\nexport function isTypeOmitted(type: CommonTypeNode): bool {\r\n if (type.kind == NodeKind.TYPE) {\r\n let name = (type).name;\r\n return !(name.next || name.identifier.text.length);\r\n }\r\n return false;\r\n}\r\n","/**\r\n * Mappings from AssemblyScript types to WebAssembly types.\r\n * @module types\r\n *//***/\r\n\r\nimport {\r\n Class,\r\n FunctionTarget,\r\n Program,\r\n DecoratorFlags\r\n} from \"./program\";\r\n\r\nimport {\r\n NativeType,\r\n ExpressionRef,\r\n Module\r\n} from \"./module\";\r\n\r\n/** Indicates the kind of a type. */\r\nexport const enum TypeKind {\r\n\r\n // signed integers\r\n\r\n /** An 8-bit signed integer. */\r\n I8,\r\n /** A 16-bit signed integer. */\r\n I16,\r\n /** A 32-bit signed integer. */\r\n I32,\r\n /** A 64-bit signed integer. */\r\n I64,\r\n /** A 32-bit/64-bit signed integer, depending on the target. */\r\n ISIZE,\r\n\r\n // unsigned integers\r\n\r\n /** An 8-bit unsigned integer. */\r\n U8,\r\n /** A 16-bit unsigned integer. */\r\n U16,\r\n /** A 32-bit unsigned integer. Also the base of function types. */\r\n U32,\r\n /** A 64-bit unsigned integer. */\r\n U64,\r\n /** A 32-bit/64-bit unsigned integer, depending on the target. Also the base of class types. */\r\n USIZE,\r\n /** A 1-bit unsigned integer. */\r\n BOOL, // sic\r\n\r\n // floats\r\n\r\n /** A 32-bit float. */\r\n F32,\r\n /** A 64-bit double. */\r\n F64,\r\n\r\n // vectors\r\n\r\n /** A 128-bit vector. */\r\n V128,\r\n\r\n // other\r\n\r\n /** No return type. */\r\n VOID\r\n}\r\n\r\n/** Indicates capabilities of a type. */\r\nexport const enum TypeFlags {\r\n NONE = 0,\r\n /** Is a signed type that can represent negative values. */\r\n SIGNED = 1 << 0,\r\n /** Is an unsigned type that cannot represent negative values. */\r\n UNSIGNED = 1 << 1,\r\n /** Is an integer type. */\r\n INTEGER = 1 << 2,\r\n /** Is a floating point type. */\r\n FLOAT = 1 << 3,\r\n /** Is a pointer type. */\r\n POINTER = 1 << 4,\r\n /** Is smaller than 32-bits. */\r\n SHORT = 1 << 5,\r\n /** Is larger than 32-bits. */\r\n LONG = 1 << 6,\r\n /** Is a value type. */\r\n VALUE = 1 << 7,\r\n /** Is a reference type. */\r\n REFERENCE = 1 << 8,\r\n /** Is a nullable type. */\r\n NULLABLE = 1 << 9,\r\n /** Is a vector type. */\r\n VECTOR = 1 << 10\r\n}\r\n\r\nconst v128_zero = new Uint8Array(16);\r\n\r\n/** Represents a resolved type. */\r\nexport class Type {\r\n\r\n /** Type kind. */\r\n kind: TypeKind;\r\n /** Type flags. */\r\n flags: TypeFlags;\r\n /** Size in bits. */\r\n size: u32;\r\n /** Size in bytes. */\r\n byteSize: i32;\r\n /** Underlying class reference, if a class type. */\r\n classReference: Class | null;\r\n /** Underlying signature reference, if a function type. */\r\n signatureReference: Signature | null;\r\n /** Respective non-nullable type, if nullable. */\r\n nonNullableType: Type;\r\n /** Cached nullable type, if non-nullable. */\r\n private cachedNullableType: Type | null = null;\r\n\r\n /** Constructs a new resolved type. */\r\n constructor(kind: TypeKind, flags: TypeFlags, size: u32) {\r\n this.kind = kind;\r\n this.flags = flags;\r\n this.size = size;\r\n this.byteSize = ceil(size / 8);\r\n this.classReference = null;\r\n this.signatureReference = null;\r\n this.nonNullableType = this;\r\n }\r\n\r\n /** Returns the closest int type representing this type. */\r\n get intType(): Type {\r\n switch (this.kind) {\r\n case TypeKind.I8: return Type.i8;\r\n case TypeKind.I16: return Type.i16;\r\n case TypeKind.F32:\r\n case TypeKind.I32: return Type.i32;\r\n case TypeKind.F64:\r\n case TypeKind.I64: return Type.i64;\r\n case TypeKind.ISIZE: return this.size == 64 ? Type.isize64 : Type.isize32;\r\n case TypeKind.U8: return Type.u8;\r\n case TypeKind.U16: return Type.u16;\r\n case TypeKind.U32: return Type.u32;\r\n case TypeKind.U64: return Type.u64;\r\n case TypeKind.USIZE: return this.size == 64 ? Type.usize64 : Type.usize32;\r\n case TypeKind.BOOL:\r\n default: return Type.i32;\r\n }\r\n }\r\n\r\n /** Gets this type's logarithmic alignment in memory. */\r\n get alignLog2(): i32 {\r\n return 31 - clz(this.byteSize);\r\n }\r\n\r\n /** Tests if this is a managed type that needs GC hooks. */\r\n get isManaged(): bool {\r\n var classReference = this.classReference;\r\n return classReference !== null && !classReference.hasDecorator(DecoratorFlags.UNMANAGED);\r\n }\r\n\r\n /** Tests if this is a class type explicitly annotated as unmanaged. */\r\n get isUnmanaged(): bool {\r\n var classReference = this.classReference;\r\n return classReference !== null && classReference.hasDecorator(DecoratorFlags.UNMANAGED);\r\n }\r\n\r\n /** Computes the sign-extending shift in the target type. */\r\n computeSmallIntegerShift(targetType: Type): u32 {\r\n return targetType.size - this.size;\r\n }\r\n\r\n /** Computes the truncating mask in the target type. */\r\n computeSmallIntegerMask(targetType: Type): u32 {\r\n var size = this.is(TypeFlags.UNSIGNED) ? this.size : this.size - 1;\r\n return ~0 >>> (targetType.size - size);\r\n }\r\n\r\n /** Tests if this type has (all of) the specified flags. */\r\n is(flags: TypeFlags): bool { return (this.flags & flags) == flags; }\r\n /** Tests if this type has any of the specified flags. */\r\n isAny(flags: TypeFlags): bool { return (this.flags & flags) != 0; }\r\n\r\n /** Composes a class type from this type and a class. */\r\n asClass(classType: Class): Type {\r\n assert(this.kind == TypeKind.USIZE && !this.classReference);\r\n var ret = new Type(this.kind, this.flags & ~TypeFlags.VALUE | TypeFlags.REFERENCE, this.size);\r\n ret.classReference = classType;\r\n return ret;\r\n }\r\n\r\n /** Composes a function type from this type and a function. */\r\n asFunction(signature: Signature): Type {\r\n assert(this.kind == TypeKind.U32 && !this.signatureReference);\r\n var ret = new Type(this.kind, this.flags & ~TypeFlags.VALUE | TypeFlags.REFERENCE, this.size);\r\n ret.signatureReference = signature;\r\n return ret;\r\n }\r\n\r\n /** Composes the respective nullable type of this type. */\r\n asNullable(): Type {\r\n assert(this.is(TypeFlags.REFERENCE));\r\n if (!this.cachedNullableType) {\r\n assert(!this.is(TypeFlags.NULLABLE));\r\n this.cachedNullableType = new Type(this.kind, this.flags | TypeFlags.NULLABLE, this.size);\r\n this.cachedNullableType.nonNullableType = this;\r\n this.cachedNullableType.classReference = this.classReference; // either a class reference\r\n this.cachedNullableType.signatureReference = this.signatureReference; // or a function reference\r\n }\r\n return this.cachedNullableType;\r\n }\r\n\r\n /** Tests if a value of this type is assignable to the target type incl. implicit conversion. */\r\n isAssignableTo(target: Type, signednessIsRelevant: bool = false): bool {\r\n var currentClass: Class | null;\r\n var targetClass: Class | null;\r\n var currentFunction: Signature | null;\r\n var targetFunction: Signature | null;\r\n if (this.is(TypeFlags.REFERENCE)) {\r\n if (target.is(TypeFlags.REFERENCE)) {\r\n if (!this.is(TypeFlags.NULLABLE) || target.is(TypeFlags.NULLABLE)) {\r\n if (currentClass = this.classReference) {\r\n if (targetClass = target.classReference) {\r\n return currentClass.isAssignableTo(targetClass);\r\n }\r\n } else if (currentFunction = this.signatureReference) {\r\n if (targetFunction = target.signatureReference) {\r\n return currentFunction.isAssignableTo(targetFunction);\r\n }\r\n }\r\n }\r\n }\r\n } else if (!target.is(TypeFlags.REFERENCE)) {\r\n if (this.is(TypeFlags.INTEGER)) {\r\n if (target.is(TypeFlags.INTEGER)) {\r\n if (\r\n !signednessIsRelevant ||\r\n this == Type.bool || // a bool (0 or 1) can be safely assigned to all sorts of integers\r\n this.is(TypeFlags.SIGNED) == target.is(TypeFlags.SIGNED)\r\n ) {\r\n return this.size <= target.size;\r\n }\r\n } else if (target.kind == TypeKind.F32) {\r\n return this.size <= 23; // mantissa bits\r\n } else if (target.kind == TypeKind.F64) {\r\n return this.size <= 52; // ^\r\n }\r\n } else if (this.is(TypeFlags.FLOAT)) {\r\n if (target.is(TypeFlags.FLOAT)) {\r\n return this.size <= target.size;\r\n }\r\n } else if (this.is(TypeFlags.VECTOR)) {\r\n if (target.is(TypeFlags.VECTOR)) {\r\n return this.size == target.size;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n /** Tests if a value of this type is assignable to the target type excl. implicit conversion. */\r\n isStrictlyAssignableTo(target: Type, signednessIsRelevant: bool = false): bool {\r\n if (this.is(TypeFlags.REFERENCE)) return this.isAssignableTo(target);\r\n else if (target.is(TypeFlags.REFERENCE)) return false;\r\n if (this.is(TypeFlags.INTEGER)) {\r\n return target.is(TypeFlags.INTEGER) && target.size == this.size && (\r\n !signednessIsRelevant || this.is(TypeFlags.SIGNED) == target.is(TypeFlags.SIGNED)\r\n );\r\n }\r\n return this.kind == target.kind;\r\n }\r\n\r\n /** Determines the common denominator type of two types, if there is any. */\r\n static commonDenominator(left: Type, right: Type, signednessIsImportant: bool): Type | null {\r\n if (right.isAssignableTo(left, signednessIsImportant)) return left;\r\n else if (left.isAssignableTo(right, signednessIsImportant)) return right;\r\n return null;\r\n }\r\n\r\n /** Converts this type to a string. */\r\n toString(): string {\r\n if (this.is(TypeFlags.REFERENCE)) {\r\n let classReference = this.classReference;\r\n if (classReference) {\r\n return this.is(TypeFlags.NULLABLE)\r\n ? classReference.internalName + \" | null\"\r\n : classReference.internalName;\r\n }\r\n let signatureReference = this.signatureReference;\r\n if (signatureReference) {\r\n return this.is(TypeFlags.NULLABLE)\r\n ? \"(\" + signatureReference.toString() + \") | null\"\r\n : signatureReference.toString();\r\n }\r\n assert(false);\r\n }\r\n switch (this.kind) {\r\n case TypeKind.I8: return \"i8\";\r\n case TypeKind.I16: return \"i16\";\r\n case TypeKind.I32: return \"i32\";\r\n case TypeKind.I64: return \"i64\";\r\n case TypeKind.ISIZE: return \"isize\";\r\n case TypeKind.U8: return \"u8\";\r\n case TypeKind.U16: return \"u16\";\r\n case TypeKind.U32: return \"u32\";\r\n case TypeKind.U64: return \"u64\";\r\n case TypeKind.USIZE: return \"usize\";\r\n case TypeKind.BOOL: return \"bool\";\r\n case TypeKind.F32: return \"f32\";\r\n case TypeKind.F64: return \"f64\";\r\n case TypeKind.V128: return \"v128\";\r\n default: assert(false);\r\n case TypeKind.VOID: return \"void\";\r\n }\r\n }\r\n\r\n // Binaryen specific\r\n\r\n /** Converts this type to its respective native type. */\r\n toNativeType(): NativeType {\r\n switch (this.kind) {\r\n default: return NativeType.I32;\r\n case TypeKind.I64:\r\n case TypeKind.U64: return NativeType.I64;\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: return this.size == 64 ? NativeType.I64 : NativeType.I32;\r\n case TypeKind.F32: return NativeType.F32;\r\n case TypeKind.F64: return NativeType.F64;\r\n case TypeKind.V128: return NativeType.V128;\r\n case TypeKind.VOID: return NativeType.None;\r\n }\r\n }\r\n\r\n /** Converts this type to its native `0` value. */\r\n toNativeZero(module: Module): ExpressionRef {\r\n switch (this.kind) {\r\n case TypeKind.VOID: assert(false);\r\n default: return module.i32(0);\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: if (this.size != 64) return module.i32(0);\r\n case TypeKind.I64:\r\n case TypeKind.U64: return module.i64(0);\r\n case TypeKind.F32: return module.f32(0);\r\n case TypeKind.F64: return module.f64(0);\r\n case TypeKind.V128: return module.v128(v128_zero);\r\n }\r\n }\r\n\r\n /** Converts this type to its native `1` value. */\r\n toNativeOne(module: Module): ExpressionRef {\r\n switch (this.kind) {\r\n case TypeKind.V128:\r\n case TypeKind.VOID: assert(false);\r\n default: return module.i32(1);\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: if (this.size != 64) return module.i32(1);\r\n case TypeKind.I64:\r\n case TypeKind.U64: return module.i64(1);\r\n case TypeKind.F32: return module.f32(1);\r\n case TypeKind.F64: return module.f64(1);\r\n }\r\n }\r\n\r\n /** Converts this type to its native `-1` value. */\r\n toNativeNegOne(module: Module): ExpressionRef {\r\n switch (this.kind) {\r\n case TypeKind.V128:\r\n case TypeKind.VOID: assert(false);\r\n default: return module.i32(-1);\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: if (this.size != 64) return module.i32(-1);\r\n case TypeKind.I64:\r\n case TypeKind.U64: return module.i64(-1, -1);\r\n case TypeKind.F32: return module.f32(-1);\r\n case TypeKind.F64: return module.f64(-1);\r\n }\r\n }\r\n\r\n /** Converts this type to its signature string. */\r\n toSignatureString(): string {\r\n switch (this.kind) {\r\n // same naming scheme as Binaryen\r\n case TypeKind.I8:\r\n case TypeKind.U8:\r\n case TypeKind.I16:\r\n case TypeKind.U16:\r\n case TypeKind.I32:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: return \"i\";\r\n case TypeKind.I64:\r\n case TypeKind.U64: return \"j\";\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: return this.size == 64 ? \"j\" : \"i\";\r\n case TypeKind.F32: return \"f\";\r\n case TypeKind.F64: return \"d\";\r\n case TypeKind.V128: return \"V\";\r\n case TypeKind.VOID: return \"v\";\r\n default: assert(false);\r\n }\r\n return \"i\";\r\n }\r\n\r\n // Types\r\n\r\n /** An 8-bit signed integer. */\r\n static readonly i8: Type = new Type(TypeKind.I8,\r\n TypeFlags.SIGNED |\r\n TypeFlags.SHORT |\r\n TypeFlags.INTEGER |\r\n TypeFlags.VALUE, 8\r\n );\r\n\r\n /** A 16-bit signed integer. */\r\n static readonly i16: Type = new Type(TypeKind.I16,\r\n TypeFlags.SIGNED |\r\n TypeFlags.SHORT |\r\n TypeFlags.INTEGER |\r\n TypeFlags.VALUE, 16\r\n );\r\n\r\n /** A 32-bit signed integer. */\r\n static readonly i32: Type = new Type(TypeKind.I32,\r\n TypeFlags.SIGNED |\r\n TypeFlags.INTEGER |\r\n TypeFlags.VALUE, 32\r\n );\r\n\r\n /** A 64-bit signed integer. */\r\n static readonly i64: Type = new Type(TypeKind.I64,\r\n TypeFlags.SIGNED |\r\n TypeFlags.LONG |\r\n TypeFlags.INTEGER |\r\n TypeFlags.VALUE, 64\r\n );\r\n\r\n /** A 32-bit signed size. WASM32 only. */\r\n static readonly isize32: Type = new Type(TypeKind.ISIZE,\r\n TypeFlags.SIGNED |\r\n TypeFlags.INTEGER |\r\n TypeFlags.POINTER |\r\n TypeFlags.VALUE, 32\r\n );\r\n\r\n /** A 64-bit signed size. WASM64 only. */\r\n static readonly isize64: Type = new Type(TypeKind.ISIZE,\r\n TypeFlags.SIGNED |\r\n TypeFlags.LONG |\r\n TypeFlags.INTEGER |\r\n TypeFlags.POINTER |\r\n TypeFlags.VALUE, 64\r\n );\r\n\r\n /** An 8-bit unsigned integer. */\r\n static readonly u8: Type = new Type(TypeKind.U8,\r\n TypeFlags.UNSIGNED |\r\n TypeFlags.SHORT |\r\n TypeFlags.INTEGER |\r\n TypeFlags.VALUE, 8\r\n );\r\n\r\n /** A 16-bit unsigned integer. */\r\n static readonly u16: Type = new Type(TypeKind.U16,\r\n TypeFlags.UNSIGNED |\r\n TypeFlags.SHORT |\r\n TypeFlags.INTEGER |\r\n TypeFlags.VALUE, 16\r\n );\r\n\r\n /** A 32-bit unsigned integer. */\r\n static readonly u32: Type = new Type(TypeKind.U32,\r\n TypeFlags.UNSIGNED |\r\n TypeFlags.INTEGER |\r\n TypeFlags.VALUE, 32\r\n );\r\n\r\n /** A 64-bit unsigned integer. */\r\n static readonly u64: Type = new Type(TypeKind.U64,\r\n TypeFlags.UNSIGNED |\r\n TypeFlags.LONG |\r\n TypeFlags.INTEGER |\r\n TypeFlags.VALUE, 64\r\n );\r\n\r\n /** A 32-bit unsigned size. WASM32 only. */\r\n static readonly usize32: Type = new Type(TypeKind.USIZE,\r\n TypeFlags.UNSIGNED |\r\n TypeFlags.INTEGER |\r\n TypeFlags.POINTER |\r\n TypeFlags.VALUE, 32\r\n );\r\n\r\n /** A 64-bit unsigned size. WASM64 only. */\r\n static readonly usize64: Type = new Type(TypeKind.USIZE,\r\n TypeFlags.UNSIGNED |\r\n TypeFlags.LONG |\r\n TypeFlags.INTEGER |\r\n TypeFlags.POINTER |\r\n TypeFlags.VALUE, 64\r\n );\r\n\r\n /** A 1-bit unsigned integer. */\r\n static readonly bool: Type = new Type(TypeKind.BOOL,\r\n TypeFlags.UNSIGNED |\r\n TypeFlags.SHORT |\r\n TypeFlags.INTEGER |\r\n TypeFlags.VALUE, 1\r\n );\r\n\r\n /** A 32-bit float. */\r\n static readonly f32: Type = new Type(TypeKind.F32,\r\n TypeFlags.SIGNED |\r\n TypeFlags.FLOAT |\r\n TypeFlags.VALUE, 32\r\n );\r\n\r\n /** A 64-bit float. */\r\n static readonly f64: Type = new Type(TypeKind.F64,\r\n TypeFlags.SIGNED |\r\n TypeFlags.LONG |\r\n TypeFlags.FLOAT |\r\n TypeFlags.VALUE, 64\r\n );\r\n\r\n /** A 128-bit vector. */\r\n static readonly v128: Type = new Type(TypeKind.V128,\r\n TypeFlags.VECTOR |\r\n TypeFlags.VALUE, 128\r\n );\r\n\r\n /** No return type. */\r\n static readonly void: Type = new Type(TypeKind.VOID, TypeFlags.NONE, 0);\r\n}\r\n\r\n/** Converts an array of types to an array of native types. */\r\nexport function typesToNativeTypes(types: Type[]): NativeType[] {\r\n var numTypes = types.length;\r\n var ret = new Array(numTypes);\r\n for (let i = 0; i < numTypes; ++i) ret[i] = types[i].toNativeType();\r\n return ret;\r\n}\r\n\r\n/** Converts an array of types to its combined string representation. */\r\nexport function typesToString(types: Type[]): string {\r\n var numTypes = types.length;\r\n if (!numTypes) return \"\";\r\n var sb = new Array(numTypes);\r\n for (let i = 0; i < numTypes; ++i) sb[i] = types[i].toString();\r\n return sb.join(\",\");\r\n}\r\n\r\n/** Represents a fully resolved function signature. */\r\nexport class Signature {\r\n\r\n /** Parameter types, if any, excluding `this`. */\r\n parameterTypes: Type[];\r\n /** Parameter names, if known, excluding `this`. */\r\n parameterNames: string[] | null;\r\n /** Number of required parameters excluding `this`. Other parameters are considered optional. */\r\n requiredParameters: i32;\r\n /** Return type. */\r\n returnType: Type;\r\n /** This type, if an instance signature. */\r\n thisType: Type | null;\r\n /** Whether the last parameter is a rest parameter. */\r\n hasRest: bool;\r\n /** Cached {@link FunctionTarget}. */\r\n cachedFunctionTarget: FunctionTarget | null = null;\r\n /** Respective function type. */\r\n type: Type;\r\n\r\n /** Constructs a new signature. */\r\n constructor(\r\n parameterTypes: Type[] | null = null,\r\n returnType: Type | null = null,\r\n thisType: Type | null = null\r\n ) {\r\n this.parameterTypes = parameterTypes ? parameterTypes : [];\r\n this.parameterNames = null;\r\n this.requiredParameters = 0;\r\n this.returnType = returnType ? returnType : Type.void;\r\n this.thisType = thisType;\r\n this.hasRest = false;\r\n this.type = Type.u32.asFunction(this);\r\n }\r\n\r\n asFunctionTarget(program: Program): FunctionTarget {\r\n var target = this.cachedFunctionTarget;\r\n if (!target) this.cachedFunctionTarget = target = new FunctionTarget(this, program);\r\n else assert(target.program == program);\r\n return target;\r\n }\r\n\r\n /** Gets the known or, alternatively, generic parameter name at the specified index. */\r\n getParameterName(index: i32): string {\r\n var parameterNames = this.parameterNames;\r\n return parameterNames && parameterNames.length > index\r\n ? parameterNames[index]\r\n : getDefaultParameterName(index);\r\n }\r\n\r\n /** Tests if a value of this function type is assignable to a target of the specified function type. */\r\n isAssignableTo(target: Signature): bool {\r\n // TODO: maybe cache results?\r\n\r\n // check `this` type\r\n var thisThisType = this.thisType;\r\n var targetThisType = target.thisType;\r\n if (thisThisType) {\r\n if (!(targetThisType && thisThisType.isAssignableTo(targetThisType))) return false;\r\n } else if (targetThisType) {\r\n return false;\r\n }\r\n\r\n // check rest parameter\r\n if (this.hasRest != target.hasRest) return false; // TODO\r\n\r\n // check parameter types\r\n var thisParameterTypes = this.parameterTypes;\r\n var targetParameterTypes = target.parameterTypes;\r\n var numParameters = thisParameterTypes.length;\r\n if (numParameters != targetParameterTypes.length) return false;\r\n for (let i = 0; i < numParameters; ++i) {\r\n let thisParameterType = thisParameterTypes[i];\r\n let targetParameterType = targetParameterTypes[i];\r\n if (!thisParameterType.isAssignableTo(targetParameterType)) return false;\r\n }\r\n\r\n // check return type\r\n var thisReturnType = this.returnType;\r\n var targetReturnType = target.returnType;\r\n return thisReturnType == targetReturnType || thisReturnType.isAssignableTo(targetReturnType);\r\n }\r\n\r\n /** Converts a signature to a function type string. */\r\n static makeSignatureString(parameterTypes: Type[] | null, returnType: Type, thisType: Type | null = null): string {\r\n var sb = [];\r\n sb.push(returnType.toSignatureString());\r\n if (thisType) sb.push(thisType.toSignatureString());\r\n if (parameterTypes) {\r\n for (let i = 0, k = parameterTypes.length; i < k; ++i) sb.push(parameterTypes[i].toSignatureString());\r\n }\r\n return \"FUNCSIG$\" + sb.join(\"\");\r\n }\r\n\r\n /** Converts this signature to a function type string. */\r\n toSignatureString(): string {\r\n return Signature.makeSignatureString(this.parameterTypes, this.returnType, this.thisType);\r\n }\r\n\r\n /** Converts this signature to a string. */\r\n toString(): string {\r\n var sb = new Array();\r\n sb.push(\"(\");\r\n var index = 0;\r\n var thisType = this.thisType;\r\n if (thisType) {\r\n sb.push(\"this: \");\r\n assert(!thisType.signatureReference);\r\n sb.push(thisType.toString());\r\n index = 1;\r\n }\r\n var parameters = this.parameterTypes;\r\n var numParameters = parameters.length;\r\n if (numParameters) {\r\n let names = this.parameterNames;\r\n let numNames = names ? names.length : 0;\r\n let optionalStart = this.requiredParameters;\r\n let restIndex = this.hasRest ? numParameters - 1 : -1;\r\n for (let i = 0; i < numParameters; ++i, ++index) {\r\n if (index) sb.push(\", \");\r\n if (i == restIndex) sb.push(\"...\");\r\n if (i < numNames) sb.push((names)[i]);\r\n else sb.push(getDefaultParameterName(i));\r\n if (i >= optionalStart && i != restIndex) sb.push(\"?: \");\r\n else sb.push(\": \");\r\n sb.push(parameters[i].toString());\r\n }\r\n }\r\n sb.push(\") => \");\r\n sb.push(this.returnType.toString());\r\n return sb.join(\"\");\r\n }\r\n}\r\n\r\n// helpers\r\n\r\n// Cached default parameter names used where names are unknown.\r\nvar cachedDefaultParameterNames: string[] | null = null;\r\n\r\n/** Gets the cached default parameter name for the specified index. */\r\nexport function getDefaultParameterName(index: i32): string {\r\n if (!cachedDefaultParameterNames) cachedDefaultParameterNames = [];\r\n for (let i = cachedDefaultParameterNames.length; i <= index; ++i) {\r\n cachedDefaultParameterNames.push(\"arg$\" + i.toString(10));\r\n }\r\n return cachedDefaultParameterNames[index - 1];\r\n}\r\n","/**\r\n * A TypeScript tokenizer modified for AssemblyScript.\r\n *\r\n * Skips over trivia and provides a general mark/reset mechanism for the parser to utilize on\r\n * ambiguous tokens.\r\n *\r\n * @module tokenizer\r\n *//***/\r\n\r\nimport {\r\n DiagnosticCode,\r\n DiagnosticMessage,\r\n DiagnosticEmitter\r\n} from \"./diagnostics\";\r\n\r\nimport {\r\n Source,\r\n CommentKind\r\n} from \"./ast\";\r\n\r\nimport {\r\n CharCode,\r\n isLineBreak,\r\n isWhiteSpace,\r\n isIdentifierStart,\r\n isIdentifierPart,\r\n isDecimalDigit,\r\n isOctalDigit,\r\n isKeywordCharacter\r\n} from \"./util\";\r\n\r\n/** Named token types. */\r\nexport enum Token {\r\n\r\n // keywords\r\n // discarded: ANY, BOOLEAN, NEVER, NUMBER, STRING, SYMBOL, UNDEFINED, LESSTHAN_SLASH\r\n\r\n ABSTRACT,\r\n AS,\r\n ASYNC,\r\n AWAIT, // ES2017\r\n BREAK, // ES2017\r\n CASE, // ES2017\r\n CATCH, // ES2017\r\n CLASS, // ES2017\r\n CONST, // ES2017\r\n CONTINUE, // ES2017\r\n CONSTRUCTOR,\r\n DEBUGGER, // ES2017\r\n DECLARE,\r\n DEFAULT, // ES2017\r\n DELETE, // ES2017\r\n DO, // ES2017\r\n ELSE, // ES2017\r\n ENUM, // ES2017 future\r\n EXPORT, // ES2017\r\n EXTENDS, // ES2017\r\n FALSE, // ES\r\n FINALLY, // ES2017\r\n FOR, // ES2017\r\n FROM, // AS possible identifier\r\n FUNCTION, // ES2017\r\n GET,\r\n IF, // ES2017\r\n IMPLEMENTS, // ES2017 non-lexical\r\n IMPORT, // ES2017\r\n IN, // ES2017\r\n INSTANCEOF, // ES2017\r\n INTERFACE, // ES2017 non-lexical\r\n IS,\r\n KEYOF,\r\n LET, // ES2017 non-lexical\r\n MODULE, // AS possible identifier\r\n NAMESPACE, // AS possible identifier\r\n NEW, // ES2017\r\n NULL, // ES\r\n OF,\r\n PACKAGE, // ES2017 non-lexical\r\n PRIVATE, // ES2017 non-lexical\r\n PROTECTED, // ES2017 non-lexical\r\n PUBLIC, // ES2017 non-lexical\r\n READONLY,\r\n RETURN, // ES2017\r\n SET,\r\n STATIC, // ES2017 non-lexical\r\n SUPER, // ES2017\r\n SWITCH, // ES2017\r\n THIS, // ES2017\r\n THROW, // ES2017\r\n TRUE, // ES\r\n TRY, // ES2017\r\n TYPE, // AS possible identifier\r\n TYPEOF, // ES2017\r\n VAR, // ES2017\r\n VOID, // ES2017\r\n WHILE, // ES2017\r\n WITH, // ES2017\r\n YIELD, // ES2017\r\n\r\n // punctuation\r\n\r\n OPENBRACE,\r\n CLOSEBRACE,\r\n OPENPAREN,\r\n CLOSEPAREN,\r\n OPENBRACKET,\r\n CLOSEBRACKET,\r\n DOT,\r\n DOT_DOT_DOT,\r\n SEMICOLON,\r\n COMMA,\r\n LESSTHAN,\r\n GREATERTHAN,\r\n LESSTHAN_EQUALS,\r\n GREATERTHAN_EQUALS,\r\n EQUALS_EQUALS,\r\n EXCLAMATION_EQUALS,\r\n EQUALS_EQUALS_EQUALS,\r\n EXCLAMATION_EQUALS_EQUALS,\r\n EQUALS_GREATERTHAN,\r\n PLUS,\r\n MINUS,\r\n ASTERISK_ASTERISK,\r\n ASTERISK,\r\n SLASH,\r\n PERCENT,\r\n PLUS_PLUS,\r\n MINUS_MINUS,\r\n LESSTHAN_LESSTHAN,\r\n GREATERTHAN_GREATERTHAN,\r\n GREATERTHAN_GREATERTHAN_GREATERTHAN,\r\n AMPERSAND,\r\n BAR,\r\n CARET,\r\n EXCLAMATION,\r\n TILDE,\r\n AMPERSAND_AMPERSAND,\r\n BAR_BAR,\r\n QUESTION,\r\n COLON,\r\n EQUALS,\r\n PLUS_EQUALS,\r\n MINUS_EQUALS,\r\n ASTERISK_EQUALS,\r\n ASTERISK_ASTERISK_EQUALS,\r\n SLASH_EQUALS,\r\n PERCENT_EQUALS,\r\n LESSTHAN_LESSTHAN_EQUALS,\r\n GREATERTHAN_GREATERTHAN_EQUALS,\r\n GREATERTHAN_GREATERTHAN_GREATERTHAN_EQUALS,\r\n AMPERSAND_EQUALS,\r\n BAR_EQUALS,\r\n CARET_EQUALS,\r\n AT,\r\n\r\n // literals\r\n\r\n IDENTIFIER,\r\n STRINGLITERAL,\r\n INTEGERLITERAL,\r\n FLOATLITERAL,\r\n\r\n // meta\r\n\r\n INVALID,\r\n ENDOFFILE\r\n}\r\n\r\nexport enum IdentifierHandling {\r\n DEFAULT,\r\n PREFER,\r\n ALWAYS\r\n}\r\n\r\nexport function tokenFromKeyword(text: string): Token {\r\n assert(text.length);\r\n switch (text.charCodeAt(0)) {\r\n case CharCode.a: {\r\n switch (text) {\r\n case \"abstract\": return Token.ABSTRACT;\r\n case \"as\": return Token.AS;\r\n case \"async\": return Token.ASYNC;\r\n case \"await\": return Token.AWAIT;\r\n }\r\n break;\r\n }\r\n case CharCode.b: {\r\n switch (text) {\r\n case \"break\": return Token.BREAK;\r\n }\r\n break;\r\n }\r\n case CharCode.c: {\r\n switch (text) {\r\n case \"case\": return Token.CASE;\r\n case \"catch\": return Token.CATCH;\r\n case \"class\": return Token.CLASS;\r\n case \"continue\": return Token.CONTINUE;\r\n case \"const\": return Token.CONST;\r\n case \"constructor\": return Token.CONSTRUCTOR;\r\n }\r\n break;\r\n }\r\n case CharCode.d: {\r\n switch (text) {\r\n case \"debugger\": return Token.DEBUGGER;\r\n case \"declare\": return Token.DECLARE;\r\n case \"default\": return Token.DEFAULT;\r\n case \"delete\": return Token.DELETE;\r\n case \"do\": return Token.DO;\r\n }\r\n break;\r\n }\r\n case CharCode.e: {\r\n switch (text) {\r\n case \"else\": return Token.ELSE;\r\n case \"enum\": return Token.ENUM;\r\n case \"export\": return Token.EXPORT;\r\n case \"extends\": return Token.EXTENDS;\r\n }\r\n break;\r\n }\r\n case CharCode.f: {\r\n switch (text) {\r\n case \"false\": return Token.FALSE;\r\n case \"finally\": return Token.FINALLY;\r\n case \"for\": return Token.FOR;\r\n case \"from\": return Token.FROM;\r\n case \"function\": return Token.FUNCTION;\r\n }\r\n break;\r\n }\r\n case CharCode.g: {\r\n switch (text) {\r\n case \"get\": return Token.GET;\r\n }\r\n break;\r\n }\r\n case CharCode.i: {\r\n switch (text) {\r\n case \"if\": return Token.IF;\r\n case \"implements\": return Token.IMPLEMENTS;\r\n case \"import\": return Token.IMPORT;\r\n case \"in\": return Token.IN;\r\n case \"instanceof\": return Token.INSTANCEOF;\r\n case \"interface\": return Token.INTERFACE;\r\n case \"is\": return Token.IS;\r\n }\r\n break;\r\n }\r\n case CharCode.k: {\r\n switch (text) {\r\n case \"keyof\": return Token.KEYOF;\r\n }\r\n break;\r\n }\r\n case CharCode.l: {\r\n switch (text) {\r\n case \"let\": return Token.LET;\r\n }\r\n break;\r\n }\r\n case CharCode.m: {\r\n switch (text) {\r\n case \"module\": return Token.MODULE;\r\n }\r\n break;\r\n }\r\n case CharCode.n: {\r\n switch (text) {\r\n case \"namespace\": return Token.NAMESPACE;\r\n case \"new\": return Token.NEW;\r\n case \"null\": return Token.NULL;\r\n }\r\n break;\r\n }\r\n case CharCode.o: {\r\n switch (text) {\r\n case \"of\": return Token.OF;\r\n }\r\n break;\r\n }\r\n case CharCode.p: {\r\n switch (text) {\r\n case \"package\": return Token.PACKAGE;\r\n case \"private\": return Token.PRIVATE;\r\n case \"protected\": return Token.PROTECTED;\r\n case \"public\": return Token.PUBLIC;\r\n }\r\n break;\r\n }\r\n case CharCode.r: {\r\n switch (text) {\r\n case \"readonly\": return Token.READONLY;\r\n case \"return\": return Token.RETURN;\r\n }\r\n break;\r\n }\r\n case CharCode.s: {\r\n switch (text) {\r\n case \"set\": return Token.SET;\r\n case \"static\": return Token.STATIC;\r\n case \"super\": return Token.SUPER;\r\n case \"switch\": return Token.SWITCH;\r\n }\r\n break;\r\n }\r\n case CharCode.t: {\r\n switch (text) {\r\n case \"this\": return Token.THIS;\r\n case \"throw\": return Token.THROW;\r\n case \"true\": return Token.TRUE;\r\n case \"try\": return Token.TRY;\r\n case \"type\": return Token.TYPE;\r\n case \"typeof\": return Token.TYPEOF;\r\n }\r\n break;\r\n }\r\n case CharCode.v: {\r\n switch (text) {\r\n case \"var\": return Token.VAR;\r\n case \"void\": return Token.VOID;\r\n }\r\n break;\r\n }\r\n case CharCode.w: {\r\n switch (text) {\r\n case \"while\": return Token.WHILE;\r\n case \"with\": return Token.WITH;\r\n }\r\n break;\r\n }\r\n case CharCode.y: {\r\n switch (text) {\r\n case \"yield\": return Token.YIELD;\r\n }\r\n break;\r\n }\r\n }\r\n return Token.INVALID;\r\n}\r\n\r\nexport function tokenIsAlsoIdentifier(token: Token): bool {\r\n switch (token) {\r\n case Token.ABSTRACT:\r\n case Token.AS:\r\n case Token.CONSTRUCTOR:\r\n case Token.DECLARE:\r\n case Token.DELETE:\r\n case Token.FROM:\r\n case Token.FOR:\r\n case Token.GET:\r\n case Token.INSTANCEOF:\r\n case Token.IS:\r\n case Token.KEYOF:\r\n case Token.MODULE:\r\n case Token.NAMESPACE:\r\n case Token.READONLY:\r\n case Token.SET:\r\n case Token.TYPE:\r\n case Token.VOID: return true;\r\n default: return false;\r\n }\r\n}\r\n\r\nexport function operatorTokenToString(token: Token): string {\r\n switch (token) {\r\n case Token.DELETE: return \"delete\";\r\n case Token.IN: return \"in\";\r\n case Token.INSTANCEOF: return \"instanceof\";\r\n case Token.NEW: return \"new\";\r\n case Token.TYPEOF: return \"typeof\";\r\n case Token.VOID: return \"void\";\r\n case Token.YIELD: return \"yield\";\r\n case Token.DOT_DOT_DOT: return \"...\";\r\n case Token.COMMA: return \",\";\r\n case Token.LESSTHAN: return \"<\";\r\n case Token.GREATERTHAN: return \">\";\r\n case Token.LESSTHAN_EQUALS: return \"<=\";\r\n case Token.GREATERTHAN_EQUALS: return \">=\";\r\n case Token.EQUALS_EQUALS: return \"==\";\r\n case Token.EXCLAMATION_EQUALS: return \"!=\";\r\n case Token.EQUALS_EQUALS_EQUALS: return \"===\";\r\n case Token.EXCLAMATION_EQUALS_EQUALS: return \"!==\";\r\n case Token.PLUS: return \"+\";\r\n case Token.MINUS: return \"-\";\r\n case Token.ASTERISK_ASTERISK: return \"**\";\r\n case Token.ASTERISK: return \"*\";\r\n case Token.SLASH: return \"/\";\r\n case Token.PERCENT: return \"%\";\r\n case Token.PLUS_PLUS: return \"++\";\r\n case Token.MINUS_MINUS: return \"--\";\r\n case Token.LESSTHAN_LESSTHAN: return \"<<\";\r\n case Token.GREATERTHAN_GREATERTHAN: return \">>\";\r\n case Token.GREATERTHAN_GREATERTHAN_GREATERTHAN: return \">>>\";\r\n case Token.AMPERSAND: return \"&\";\r\n case Token.BAR: return \"|\";\r\n case Token.CARET: return \"^\";\r\n case Token.EXCLAMATION: return \"!\";\r\n case Token.TILDE: return \"~\";\r\n case Token.AMPERSAND_AMPERSAND: return \"&&\";\r\n case Token.BAR_BAR: return \"||\";\r\n case Token.EQUALS: return \"=\";\r\n case Token.PLUS_EQUALS: return \"+=\";\r\n case Token.MINUS_EQUALS: return \"-=\";\r\n case Token.ASTERISK_EQUALS: return \"*=\";\r\n case Token.ASTERISK_ASTERISK_EQUALS: return \"**=\";\r\n case Token.SLASH_EQUALS: return \"/=\";\r\n case Token.PERCENT_EQUALS: return \"%=\";\r\n case Token.LESSTHAN_LESSTHAN_EQUALS: return \"<<=\";\r\n case Token.GREATERTHAN_GREATERTHAN_EQUALS: return \">>=\";\r\n case Token.GREATERTHAN_GREATERTHAN_GREATERTHAN_EQUALS: return \">>>=\";\r\n case Token.AMPERSAND_EQUALS: return \"&=\";\r\n case Token.BAR_EQUALS: return \"|=\";\r\n case Token.CARET_EQUALS: return \"^=\";\r\n default: {\r\n assert(false);\r\n return \"\";\r\n }\r\n }\r\n}\r\n\r\nexport class Range {\r\n\r\n source: Source;\r\n start: i32;\r\n end: i32;\r\n\r\n // TODO: set these while tokenizing\r\n // line: i32;\r\n // column: i32;\r\n\r\n constructor(source: Source, start: i32, end: i32) {\r\n this.source = source;\r\n this.start = start;\r\n this.end = end;\r\n }\r\n\r\n static join(a: Range, b: Range): Range {\r\n if (a.source != b.source) throw new Error(\"source mismatch\");\r\n return new Range(a.source,\r\n a.start < b.start ? a.start : b.start,\r\n a.end > b.end ? a.end : b.end\r\n );\r\n }\r\n\r\n get atStart(): Range {\r\n return new Range(this.source, this.start, this.start);\r\n }\r\n\r\n get atEnd(): Range {\r\n return new Range(this.source, this.end, this.end);\r\n }\r\n\r\n get line(): i32 {\r\n var text = this.source.text;\r\n var line = 1;\r\n for (let pos = this.start; pos >= 0; --pos) {\r\n if (text.charCodeAt(pos) == CharCode.LINEFEED) line++;\r\n }\r\n return line;\r\n }\r\n\r\n get column(): i32 {\r\n var text = this.source.text;\r\n var column = 0;\r\n for (let pos = this.start - 1; pos >= 0; --pos) {\r\n if (text.charCodeAt(pos) == CharCode.LINEFEED) break;\r\n ++column;\r\n }\r\n return column;\r\n }\r\n\r\n toString(): string {\r\n return this.source.text.substring(this.start, this.end);\r\n }\r\n\r\n debugInfoRef: usize = 0;\r\n}\r\n\r\ndeclare function parseFloat(str: string): f64;\r\n\r\n/** Handler for intercepting comments while tokenizing. */\r\nexport type CommentHandler = (kind: CommentKind, text: string, range: Range) => void;\r\n\r\n/** Tokenizes a source to individual {@link Token}s. */\r\nexport class Tokenizer extends DiagnosticEmitter {\r\n\r\n source: Source;\r\n end: i32 = 0;\r\n\r\n pos: i32 = 0;\r\n token: Token = -1;\r\n tokenPos: i32 = 0;\r\n\r\n nextToken: Token = -1;\r\n nextTokenPos: i32 = 0;\r\n nextTokenOnNewLine: bool = false;\r\n\r\n onComment: CommentHandler | null = null;\r\n\r\n /** Constructs a new tokenizer. */\r\n constructor(source: Source, diagnostics: DiagnosticMessage[] | null = null) {\r\n super(diagnostics);\r\n\r\n this.source = source;\r\n this.pos = 0;\r\n this.end = source.text.length;\r\n this.diagnostics = diagnostics || new Array();\r\n\r\n var end = this.end;\r\n var text = source.text;\r\n\r\n // skip bom\r\n if (\r\n this.pos < end &&\r\n text.charCodeAt(this.pos) == CharCode.BYTEORDERMARK\r\n ) {\r\n ++this.pos;\r\n }\r\n\r\n // skip shebang\r\n if (\r\n this.pos + 1 < end &&\r\n text.charCodeAt(this.pos) == CharCode.HASH &&\r\n text.charCodeAt(this.pos + 1) == CharCode.EXCLAMATION\r\n ) {\r\n this.pos += 2;\r\n while (\r\n this.pos < end &&\r\n text.charCodeAt(this.pos) != CharCode.LINEFEED\r\n ) {\r\n ++this.pos;\r\n }\r\n // 'next' now starts at lf or eof\r\n }\r\n }\r\n\r\n next(identifierHandling: IdentifierHandling = IdentifierHandling.DEFAULT): Token {\r\n this.nextToken = -1;\r\n return this.token = this.unsafeNext(identifierHandling);\r\n }\r\n\r\n private unsafeNext(\r\n identifierHandling: IdentifierHandling = IdentifierHandling.DEFAULT,\r\n maxTokenLength: i32 = i32.MAX_VALUE\r\n ): Token {\r\n var end = this.end;\r\n var text = this.source.text;\r\n while (this.pos < end) {\r\n this.tokenPos = this.pos;\r\n let c = text.charCodeAt(this.pos);\r\n switch (c) {\r\n case CharCode.CARRIAGERETURN: {\r\n if (!(\r\n ++this.pos < end &&\r\n text.charCodeAt(this.pos) == CharCode.LINEFEED\r\n )) break;\r\n // otherwise fall-through\r\n }\r\n case CharCode.LINEFEED:\r\n case CharCode.TAB:\r\n case CharCode.VERTICALTAB:\r\n case CharCode.FORMFEED:\r\n case CharCode.SPACE: {\r\n ++this.pos;\r\n break;\r\n }\r\n case CharCode.EXCLAMATION: {\r\n ++this.pos;\r\n if (\r\n maxTokenLength > 1 && this.pos < end &&\r\n text.charCodeAt(this.pos) == CharCode.EQUALS\r\n ) {\r\n ++this.pos;\r\n if (\r\n maxTokenLength > 2 && this.pos < end &&\r\n text.charCodeAt(this.pos) == CharCode.EQUALS\r\n ) {\r\n ++this.pos;\r\n return Token.EXCLAMATION_EQUALS_EQUALS;\r\n }\r\n return Token.EXCLAMATION_EQUALS;\r\n }\r\n return Token.EXCLAMATION;\r\n }\r\n case CharCode.DOUBLEQUOTE:\r\n case CharCode.SINGLEQUOTE:\r\n case CharCode.BACKTICK: { // TODO\r\n return Token.STRINGLITERAL; // expects a call to readString\r\n }\r\n case CharCode.PERCENT: {\r\n ++this.pos;\r\n if (\r\n maxTokenLength > 1 && this.pos < end &&\r\n text.charCodeAt(this.pos) == CharCode.EQUALS\r\n ) {\r\n ++this.pos;\r\n return Token.PERCENT_EQUALS;\r\n }\r\n return Token.PERCENT;\r\n }\r\n case CharCode.AMPERSAND: {\r\n ++this.pos;\r\n if (maxTokenLength > 1 && this.pos < end) {\r\n let chr = text.charCodeAt(this.pos);\r\n if (chr == CharCode.AMPERSAND) {\r\n ++this.pos;\r\n return Token.AMPERSAND_AMPERSAND;\r\n }\r\n if (chr == CharCode.EQUALS) {\r\n ++this.pos;\r\n return Token.AMPERSAND_EQUALS;\r\n }\r\n }\r\n return Token.AMPERSAND;\r\n }\r\n case CharCode.OPENPAREN: {\r\n ++this.pos;\r\n return Token.OPENPAREN;\r\n }\r\n case CharCode.CLOSEPAREN: {\r\n ++this.pos;\r\n return Token.CLOSEPAREN;\r\n }\r\n case CharCode.ASTERISK: {\r\n ++this.pos;\r\n if (maxTokenLength > 1 && this.pos < end) {\r\n let chr = text.charCodeAt(this.pos);\r\n if (chr == CharCode.EQUALS) {\r\n ++this.pos;\r\n return Token.ASTERISK_EQUALS;\r\n }\r\n if (chr == CharCode.ASTERISK) {\r\n ++this.pos;\r\n if (\r\n maxTokenLength > 2 && this.pos < end &&\r\n text.charCodeAt(this.pos) == CharCode.EQUALS\r\n ) {\r\n ++this.pos;\r\n return Token.ASTERISK_ASTERISK_EQUALS;\r\n }\r\n return Token.ASTERISK_ASTERISK;\r\n }\r\n }\r\n return Token.ASTERISK;\r\n }\r\n case CharCode.PLUS: {\r\n ++this.pos;\r\n if (maxTokenLength > 1 && this.pos < end) {\r\n let chr = text.charCodeAt(this.pos);\r\n if (chr == CharCode.PLUS) {\r\n ++this.pos;\r\n return Token.PLUS_PLUS;\r\n }\r\n if (chr == CharCode.EQUALS) {\r\n ++this.pos;\r\n return Token.PLUS_EQUALS;\r\n }\r\n }\r\n return Token.PLUS;\r\n }\r\n case CharCode.COMMA: {\r\n ++this.pos;\r\n return Token.COMMA;\r\n }\r\n case CharCode.MINUS: {\r\n ++this.pos;\r\n if (maxTokenLength > 1 && this.pos < end) {\r\n let chr = text.charCodeAt(this.pos);\r\n if (chr == CharCode.MINUS) {\r\n ++this.pos;\r\n return Token.MINUS_MINUS;\r\n }\r\n if (chr == CharCode.EQUALS) {\r\n ++this.pos;\r\n return Token.MINUS_EQUALS;\r\n }\r\n }\r\n return Token.MINUS;\r\n }\r\n case CharCode.DOT: {\r\n ++this.pos;\r\n if (maxTokenLength > 1 && this.pos < end) {\r\n let chr = text.charCodeAt(this.pos);\r\n if (isDecimalDigit(chr)) {\r\n --this.pos;\r\n return Token.FLOATLITERAL; // expects a call to readFloat\r\n }\r\n if (\r\n maxTokenLength > 2 && this.pos + 1 < end &&\r\n chr == CharCode.DOT &&\r\n text.charCodeAt(this.pos + 1) == CharCode.DOT\r\n ) {\r\n this.pos += 2;\r\n return Token.DOT_DOT_DOT;\r\n }\r\n }\r\n return Token.DOT;\r\n }\r\n case CharCode.SLASH: {\r\n let commentStartPos = this.pos;\r\n ++this.pos;\r\n if (maxTokenLength > 1 && this.pos < end) {\r\n let chr = text.charCodeAt(this.pos);\r\n if (chr == CharCode.SLASH) { // single-line\r\n let commentKind = CommentKind.LINE;\r\n if (\r\n this.pos + 1 < end &&\r\n text.charCodeAt(this.pos + 1) == CharCode.SLASH\r\n ) {\r\n ++this.pos;\r\n commentKind = CommentKind.TRIPLE;\r\n }\r\n while (++this.pos < end) {\r\n if (text.charCodeAt(this.pos) == CharCode.LINEFEED) {\r\n ++this.pos;\r\n break;\r\n }\r\n }\r\n if (this.onComment) {\r\n this.onComment(\r\n commentKind,\r\n text.substring(commentStartPos, this.pos),\r\n this.range(commentStartPos, this.pos)\r\n );\r\n }\r\n break;\r\n }\r\n if (chr == CharCode.ASTERISK) { // multi-line\r\n let closed = false;\r\n while (++this.pos < end) {\r\n c = text.charCodeAt(this.pos);\r\n if (\r\n c == CharCode.ASTERISK &&\r\n this.pos + 1 < end &&\r\n text.charCodeAt(this.pos + 1) == CharCode.SLASH\r\n ) {\r\n this.pos += 2;\r\n closed = true;\r\n break;\r\n }\r\n }\r\n if (!closed) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n this.range(this.pos), \"*/\"\r\n );\r\n } else if (this.onComment) {\r\n this.onComment(\r\n CommentKind.BLOCK,\r\n text.substring(commentStartPos, this.pos),\r\n this.range(commentStartPos, this.pos)\r\n );\r\n }\r\n break;\r\n }\r\n if (chr == CharCode.EQUALS) {\r\n ++this.pos;\r\n return Token.SLASH_EQUALS;\r\n }\r\n }\r\n return Token.SLASH;\r\n }\r\n case CharCode._0:\r\n case CharCode._1:\r\n case CharCode._2:\r\n case CharCode._3:\r\n case CharCode._4:\r\n case CharCode._5:\r\n case CharCode._6:\r\n case CharCode._7:\r\n case CharCode._8:\r\n case CharCode._9: {\r\n return this.testInteger()\r\n ? Token.INTEGERLITERAL // expects a call to readInteger\r\n : Token.FLOATLITERAL; // expects a call to readFloat\r\n }\r\n case CharCode.COLON: {\r\n ++this.pos;\r\n return Token.COLON;\r\n }\r\n case CharCode.SEMICOLON: {\r\n ++this.pos;\r\n return Token.SEMICOLON;\r\n }\r\n case CharCode.LESSTHAN: {\r\n ++this.pos;\r\n if (maxTokenLength > 1 && this.pos < end) {\r\n let chr = text.charCodeAt(this.pos);\r\n if (chr == CharCode.LESSTHAN) {\r\n ++this.pos;\r\n if (\r\n maxTokenLength > 2 &&\r\n this.pos < end &&\r\n text.charCodeAt(this.pos) == CharCode.EQUALS\r\n ) {\r\n ++this.pos;\r\n return Token.LESSTHAN_LESSTHAN_EQUALS;\r\n }\r\n return Token.LESSTHAN_LESSTHAN;\r\n }\r\n if (chr == CharCode.EQUALS) {\r\n ++this.pos;\r\n return Token.LESSTHAN_EQUALS;\r\n }\r\n }\r\n return Token.LESSTHAN;\r\n }\r\n case CharCode.EQUALS: {\r\n ++this.pos;\r\n if (maxTokenLength > 1 && this.pos < end) {\r\n let chr = text.charCodeAt(this.pos);\r\n if (chr == CharCode.EQUALS) {\r\n ++this.pos;\r\n if (\r\n maxTokenLength > 2 &&\r\n this.pos < end &&\r\n text.charCodeAt(this.pos) == CharCode.EQUALS\r\n ) {\r\n ++this.pos;\r\n return Token.EQUALS_EQUALS_EQUALS;\r\n }\r\n return Token.EQUALS_EQUALS;\r\n }\r\n if (chr == CharCode.GREATERTHAN) {\r\n ++this.pos;\r\n return Token.EQUALS_GREATERTHAN;\r\n }\r\n }\r\n return Token.EQUALS;\r\n }\r\n case CharCode.GREATERTHAN: {\r\n ++this.pos;\r\n if (maxTokenLength > 1 && this.pos < end) {\r\n let chr = text.charCodeAt(this.pos);\r\n if (chr == CharCode.GREATERTHAN) {\r\n ++this.pos;\r\n if (maxTokenLength > 2 && this.pos < end) {\r\n chr = text.charCodeAt(this.pos);\r\n if (chr == CharCode.GREATERTHAN) {\r\n ++this.pos;\r\n if (\r\n maxTokenLength > 3 && this.pos < end &&\r\n text.charCodeAt(this.pos) == CharCode.EQUALS\r\n ) {\r\n ++this.pos;\r\n return Token.GREATERTHAN_GREATERTHAN_GREATERTHAN_EQUALS;\r\n }\r\n return Token.GREATERTHAN_GREATERTHAN_GREATERTHAN;\r\n }\r\n if (chr == CharCode.EQUALS) {\r\n ++this.pos;\r\n return Token.GREATERTHAN_GREATERTHAN_EQUALS;\r\n }\r\n }\r\n return Token.GREATERTHAN_GREATERTHAN;\r\n }\r\n if (chr == CharCode.EQUALS) {\r\n ++this.pos;\r\n return Token.GREATERTHAN_EQUALS;\r\n }\r\n }\r\n return Token.GREATERTHAN;\r\n }\r\n case CharCode.QUESTION: {\r\n ++this.pos;\r\n return Token.QUESTION;\r\n }\r\n case CharCode.OPENBRACKET: {\r\n ++this.pos;\r\n return Token.OPENBRACKET;\r\n }\r\n case CharCode.CLOSEBRACKET: {\r\n ++this.pos;\r\n return Token.CLOSEBRACKET;\r\n }\r\n case CharCode.CARET: {\r\n ++this.pos;\r\n if (\r\n maxTokenLength > 1 && this.pos < end &&\r\n text.charCodeAt(this.pos) == CharCode.EQUALS\r\n ) {\r\n ++this.pos;\r\n return Token.CARET_EQUALS;\r\n }\r\n return Token.CARET;\r\n }\r\n case CharCode.OPENBRACE: {\r\n ++this.pos;\r\n return Token.OPENBRACE;\r\n }\r\n case CharCode.BAR: {\r\n ++this.pos;\r\n if (maxTokenLength > 1 && this.pos < end) {\r\n let chr = text.charCodeAt(this.pos);\r\n if (chr == CharCode.BAR) {\r\n ++this.pos;\r\n return Token.BAR_BAR;\r\n }\r\n if (chr == CharCode.EQUALS) {\r\n ++this.pos;\r\n return Token.BAR_EQUALS;\r\n }\r\n }\r\n return Token.BAR;\r\n }\r\n case CharCode.CLOSEBRACE: {\r\n ++this.pos;\r\n return Token.CLOSEBRACE;\r\n }\r\n case CharCode.TILDE: {\r\n ++this.pos;\r\n return Token.TILDE;\r\n }\r\n case CharCode.AT: {\r\n ++this.pos;\r\n return Token.AT;\r\n }\r\n default: {\r\n if (isIdentifierStart(c)) {\r\n if (isKeywordCharacter(c)) {\r\n let posBefore = this.pos;\r\n while (\r\n ++this.pos < end &&\r\n isIdentifierPart(c = text.charCodeAt(this.pos))\r\n ) {\r\n if (!isKeywordCharacter(c)) {\r\n this.pos = posBefore;\r\n return Token.IDENTIFIER;\r\n }\r\n }\r\n let keywordText = text.substring(posBefore, this.pos);\r\n let keywordToken = tokenFromKeyword(keywordText);\r\n if (\r\n keywordToken !== Token.INVALID &&\r\n identifierHandling !== IdentifierHandling.ALWAYS &&\r\n !(\r\n identifierHandling === IdentifierHandling.PREFER &&\r\n tokenIsAlsoIdentifier(keywordToken)\r\n )\r\n ) {\r\n return keywordToken;\r\n }\r\n this.pos = posBefore;\r\n }\r\n return Token.IDENTIFIER; // expects a call to readIdentifier\r\n } else if (isWhiteSpace(c)) {\r\n ++this.pos;\r\n break;\r\n }\r\n this.error(\r\n DiagnosticCode.Invalid_character,\r\n this.range(this.pos, this.pos + 1)\r\n );\r\n ++this.pos;\r\n return Token.INVALID;\r\n }\r\n }\r\n }\r\n return Token.ENDOFFILE;\r\n }\r\n\r\n peek(\r\n checkOnNewLine: bool = false,\r\n identifierHandling: IdentifierHandling = IdentifierHandling.DEFAULT,\r\n maxCompoundLength: i32 = i32.MAX_VALUE\r\n ): Token {\r\n var text = this.source.text;\r\n if (this.nextToken < 0) {\r\n let posBefore = this.pos;\r\n let tokenBefore = this.token;\r\n let tokenPosBefore = this.tokenPos;\r\n this.nextToken = this.unsafeNext(identifierHandling, maxCompoundLength);\r\n this.nextTokenPos = this.tokenPos;\r\n if (checkOnNewLine) {\r\n this.nextTokenOnNewLine = false;\r\n for (let pos = posBefore, end = this.nextTokenPos; pos < end; ++pos) {\r\n if (isLineBreak(text.charCodeAt(pos))) {\r\n this.nextTokenOnNewLine = true;\r\n break;\r\n }\r\n }\r\n }\r\n this.pos = posBefore;\r\n this.token = tokenBefore;\r\n this.tokenPos = tokenPosBefore;\r\n }\r\n return this.nextToken;\r\n }\r\n\r\n skipIdentifier(identifierHandling: IdentifierHandling = IdentifierHandling.PREFER): bool {\r\n return this.skip(Token.IDENTIFIER, identifierHandling);\r\n }\r\n\r\n skip(token: Token, identifierHandling: IdentifierHandling = IdentifierHandling.DEFAULT): bool {\r\n var posBefore = this.pos;\r\n var tokenBefore = this.token;\r\n var tokenPosBefore = this.tokenPos;\r\n var maxCompoundLength = i32.MAX_VALUE;\r\n switch (token) {\r\n case Token.GREATERTHAN: { // where parsing type arguments\r\n maxCompoundLength = 1;\r\n break;\r\n }\r\n }\r\n this.token = this.unsafeNext(identifierHandling, maxCompoundLength);\r\n if (this.token == token) {\r\n this.nextToken = -1;\r\n return true;\r\n } else {\r\n this.pos = posBefore;\r\n this.token = tokenBefore;\r\n this.tokenPos = tokenPosBefore;\r\n return false;\r\n }\r\n }\r\n\r\n mark(): State {\r\n var state: State;\r\n if (reusableState) {\r\n state = reusableState;\r\n reusableState = null;\r\n } else {\r\n state = new State();\r\n }\r\n state.pos = this.pos;\r\n state.token = this.token;\r\n state.tokenPos = this.tokenPos;\r\n return state;\r\n }\r\n\r\n discard(state: State): void {\r\n reusableState = state;\r\n }\r\n\r\n reset(state: State): void {\r\n this.pos = state.pos;\r\n this.token = state.token;\r\n this.tokenPos = state.tokenPos;\r\n this.nextToken = -1;\r\n }\r\n\r\n range(start: i32 = -1, end: i32 = -1): Range {\r\n if (start < 0) {\r\n start = this.tokenPos;\r\n end = this.pos;\r\n } else if (end < 0) {\r\n end = start;\r\n }\r\n return new Range(this.source, start, end);\r\n }\r\n\r\n readIdentifier(): string {\r\n var text = this.source.text;\r\n var start = this.pos;\r\n var end = this.end;\r\n while (\r\n ++this.pos < end &&\r\n isIdentifierPart(text.charCodeAt(this.pos))\r\n );\r\n return text.substring(start, this.pos);\r\n }\r\n\r\n readString(): string {\r\n var text = this.source.text;\r\n var quote = text.charCodeAt(this.pos++);\r\n var start = this.pos;\r\n var end = this.end;\r\n var result = \"\";\r\n while (true) {\r\n if (this.pos >= end) {\r\n result += text.substring(start, this.pos);\r\n this.error(\r\n DiagnosticCode.Unterminated_string_literal,\r\n this.range(start - 1, end)\r\n );\r\n break;\r\n }\r\n let c = text.charCodeAt(this.pos);\r\n if (c == quote) {\r\n result += text.substring(start, this.pos++);\r\n break;\r\n }\r\n if (c == CharCode.BACKSLASH) {\r\n result += text.substring(start, this.pos);\r\n result += this.readEscapeSequence();\r\n start = this.pos;\r\n continue;\r\n }\r\n if (isLineBreak(c)) {\r\n result += text.substring(start, this.pos);\r\n this.error(\r\n DiagnosticCode.Unterminated_string_literal,\r\n this.range(start - 1, this.pos)\r\n );\r\n break;\r\n }\r\n ++this.pos;\r\n }\r\n return result;\r\n }\r\n\r\n readEscapeSequence(): string {\r\n var end = this.end;\r\n if (++this.pos >= end) {\r\n this.error(\r\n DiagnosticCode.Unexpected_end_of_text,\r\n this.range(end)\r\n );\r\n return \"\";\r\n }\r\n\r\n var text = this.source.text;\r\n var c = text.charCodeAt(this.pos++);\r\n switch (c) {\r\n case CharCode._0: return \"\\0\";\r\n case CharCode.b: return \"\\b\";\r\n case CharCode.t: return \"\\t\";\r\n case CharCode.n: return \"\\n\";\r\n case CharCode.v: return \"\\v\";\r\n case CharCode.f: return \"\\f\";\r\n case CharCode.r: return \"\\r\";\r\n case CharCode.SINGLEQUOTE: return \"'\";\r\n case CharCode.DOUBLEQUOTE: return \"\\\"\";\r\n case CharCode.u: {\r\n if (\r\n this.pos < end &&\r\n text.charCodeAt(this.pos) == CharCode.OPENBRACE\r\n ) {\r\n ++this.pos;\r\n return this.readExtendedUnicodeEscape(); // \\u{DDDDDDDD}\r\n }\r\n return this.readUnicodeEscape(); // \\uDDDD\r\n }\r\n case CharCode.CARRIAGERETURN: {\r\n if (\r\n this.pos < end &&\r\n text.charCodeAt(this.pos) == CharCode.LINEFEED\r\n ) {\r\n ++this.pos;\r\n }\r\n // fall through\r\n }\r\n case CharCode.LINEFEED:\r\n case CharCode.LINESEPARATOR:\r\n case CharCode.PARAGRAPHSEPARATOR: return \"\";\r\n default: return String.fromCharCode(c);\r\n }\r\n }\r\n\r\n readRegexpPattern(): string {\r\n var text = this.source.text;\r\n var start = this.pos;\r\n var end = this.end;\r\n var escaped = false;\r\n while (true) {\r\n if (this.pos >= end) {\r\n this.error(\r\n DiagnosticCode.Unterminated_regular_expression_literal,\r\n this.range(start, end)\r\n );\r\n break;\r\n }\r\n if (text.charCodeAt(this.pos) == CharCode.BACKSLASH) {\r\n ++this.pos;\r\n escaped = true;\r\n continue;\r\n }\r\n let c = text.charCodeAt(this.pos);\r\n if (!escaped && c == CharCode.SLASH) break;\r\n if (isLineBreak(c)) {\r\n this.error(\r\n DiagnosticCode.Unterminated_regular_expression_literal,\r\n this.range(start, this.pos)\r\n );\r\n break;\r\n }\r\n ++this.pos;\r\n escaped = false;\r\n }\r\n return text.substring(start, this.pos);\r\n }\r\n\r\n readRegexpFlags(): string {\r\n var text = this.source.text;\r\n var start = this.pos;\r\n var end = this.end;\r\n var flags = 0;\r\n while (this.pos < end) {\r\n let c: i32 = text.charCodeAt(this.pos);\r\n if (!isIdentifierPart(c)) break;\r\n ++this.pos;\r\n\r\n // make sure each supported flag is unique\r\n switch (c) {\r\n case CharCode.g: {\r\n flags |= flags & 1 ? -1 : 1;\r\n break;\r\n }\r\n case CharCode.i: {\r\n flags |= flags & 2 ? -1 : 2;\r\n break;\r\n }\r\n case CharCode.m: {\r\n flags |= flags & 4 ? -1 : 4;\r\n break;\r\n }\r\n default: {\r\n flags = -1;\r\n break;\r\n }\r\n }\r\n }\r\n if (flags == -1) {\r\n this.error(\r\n DiagnosticCode.Invalid_regular_expression_flags,\r\n this.range(start, this.pos)\r\n );\r\n }\r\n return text.substring(start, this.pos);\r\n }\r\n\r\n testInteger(): bool {\r\n var end = this.end;\r\n var text = this.source.text;\r\n if (this.pos + 1 < end && text.charCodeAt(this.pos) == CharCode._0) {\r\n switch (text.charCodeAt(this.pos + 2)) {\r\n case CharCode.x:\r\n case CharCode.X:\r\n case CharCode.b:\r\n case CharCode.B:\r\n case CharCode.o:\r\n case CharCode.O: return true;\r\n }\r\n }\r\n var pos = this.pos;\r\n while (pos < end) {\r\n let c = text.charCodeAt(pos);\r\n if (c == CharCode.DOT || c == CharCode.e || c == CharCode.E) return false;\r\n if ((c < CharCode._0 || c > CharCode._9) && c != CharCode._) break;\r\n // does not validate separator placement (this is done in readXYInteger)\r\n pos++;\r\n }\r\n return true;\r\n }\r\n\r\n readInteger(): I64 {\r\n var text = this.source.text;\r\n if (this.pos + 2 < this.end && text.charCodeAt(this.pos) == CharCode._0) {\r\n switch (text.charCodeAt(this.pos + 1)) {\r\n case CharCode.x:\r\n case CharCode.X: {\r\n this.pos += 2;\r\n return this.readHexInteger();\r\n }\r\n case CharCode.b:\r\n case CharCode.B: {\r\n this.pos += 2;\r\n return this.readBinaryInteger();\r\n }\r\n case CharCode.o:\r\n case CharCode.O: {\r\n this.pos += 2;\r\n return this.readOctalInteger();\r\n }\r\n }\r\n if (isOctalDigit(text.charCodeAt(this.pos + 1))) {\r\n let start = this.pos;\r\n ++this.pos;\r\n let value = this.readOctalInteger();\r\n this.error(\r\n DiagnosticCode.Octal_literals_are_not_allowed_in_strict_mode,\r\n this.range(start, this.pos)\r\n );\r\n return value;\r\n }\r\n }\r\n return this.readDecimalInteger();\r\n }\r\n\r\n readHexInteger(): I64 {\r\n var text = this.source.text;\r\n var start = this.pos;\r\n var value = i64_new(0);\r\n var i64_4 = i64_new(4);\r\n var sepEnd = start;\r\n var end = this.end;\r\n while (this.pos < end) {\r\n let pos = this.pos;\r\n let c = text.charCodeAt(pos);\r\n if (c >= CharCode._0 && c <= CharCode._9) {\r\n // value = (value << 4) + c - CharCode._0;\r\n value = i64_add(\r\n i64_shl(value, i64_4),\r\n i64_new(c - CharCode._0)\r\n );\r\n } else if (c >= CharCode.A && c <= CharCode.F) {\r\n // value = (value << 4) + 10 + c - CharCode.A;\r\n value = i64_add(\r\n i64_shl(value, i64_4),\r\n i64_new(10 + c - CharCode.A)\r\n );\r\n } else if (c >= CharCode.a && c <= CharCode.f) {\r\n // value = (value << 4) + 10 + c - CharCode.a;\r\n value = i64_add(\r\n i64_shl(value, i64_4),\r\n i64_new(10 + c - CharCode.a)\r\n );\r\n } else if (c == CharCode._) {\r\n if (sepEnd == pos) {\r\n this.error(\r\n sepEnd == start\r\n ? DiagnosticCode.Numeric_separators_are_not_allowed_here\r\n : DiagnosticCode.Multiple_consecutive_numeric_separators_are_not_permitted,\r\n this.range(pos)\r\n );\r\n }\r\n sepEnd = pos + 1;\r\n } else {\r\n break;\r\n }\r\n this.pos = pos + 1;\r\n }\r\n if (this.pos == start) {\r\n this.error(\r\n DiagnosticCode.Hexadecimal_digit_expected,\r\n this.range(start)\r\n );\r\n } else if (sepEnd == this.pos) {\r\n this.error(\r\n DiagnosticCode.Numeric_separators_are_not_allowed_here,\r\n this.range(sepEnd - 1)\r\n );\r\n }\r\n return value;\r\n }\r\n\r\n readDecimalInteger(): I64 {\r\n var text = this.source.text;\r\n var start = this.pos;\r\n var end = this.end;\r\n var value = i64_new(0);\r\n var i64_10 = i64_new(10);\r\n var sepEnd = start;\r\n while (this.pos < end) {\r\n let pos = this.pos;\r\n let c = text.charCodeAt(pos);\r\n if (c >= CharCode._0 && c <= CharCode._9) {\r\n // value = value * 10 + c - CharCode._0;\r\n value = i64_add(\r\n i64_mul(value, i64_10),\r\n i64_new(c - CharCode._0)\r\n );\r\n } else if (c == CharCode._) {\r\n if (sepEnd == pos) {\r\n this.error(\r\n sepEnd == start\r\n ? DiagnosticCode.Numeric_separators_are_not_allowed_here\r\n : DiagnosticCode.Multiple_consecutive_numeric_separators_are_not_permitted,\r\n this.range(pos)\r\n );\r\n }\r\n sepEnd = pos + 1;\r\n } else {\r\n break;\r\n }\r\n this.pos = pos + 1;\r\n }\r\n if (this.pos == start) {\r\n this.error(\r\n DiagnosticCode.Digit_expected,\r\n this.range(start)\r\n );\r\n } else if (sepEnd == this.pos) {\r\n this.error(\r\n DiagnosticCode.Numeric_separators_are_not_allowed_here,\r\n this.range(sepEnd - 1)\r\n );\r\n }\r\n return value;\r\n }\r\n\r\n readOctalInteger(): I64 {\r\n var text = this.source.text;\r\n var start = this.pos;\r\n var value = i64_new(0);\r\n var i64_3 = i64_new(3);\r\n var sepEnd = start;\r\n var end = this.end;\r\n while (this.pos < end) {\r\n let pos = this.pos;\r\n let c = text.charCodeAt(pos);\r\n if (c >= CharCode._0 && c <= CharCode._7) {\r\n // value = (value << 3) + c - CharCode._0;\r\n value = i64_add(\r\n i64_shl(value, i64_3),\r\n i64_new(c - CharCode._0)\r\n );\r\n } else if (c == CharCode._) {\r\n if (sepEnd == pos) {\r\n this.error(\r\n sepEnd == start\r\n ? DiagnosticCode.Numeric_separators_are_not_allowed_here\r\n : DiagnosticCode.Multiple_consecutive_numeric_separators_are_not_permitted,\r\n this.range(pos)\r\n );\r\n }\r\n sepEnd = pos + 1;\r\n } else {\r\n break;\r\n }\r\n ++this.pos;\r\n }\r\n if (this.pos == start) {\r\n this.error(\r\n DiagnosticCode.Octal_digit_expected,\r\n this.range(start)\r\n );\r\n } else if (sepEnd == this.pos) {\r\n this.error(\r\n DiagnosticCode.Numeric_separators_are_not_allowed_here,\r\n this.range(sepEnd - 1)\r\n );\r\n }\r\n return value;\r\n }\r\n\r\n readBinaryInteger(): I64 {\r\n var text = this.source.text;\r\n var start = this.pos;\r\n var value = i64_new(0);\r\n var i64_1 = i64_new(1);\r\n var sepEnd = start;\r\n var end = this.end;\r\n while (this.pos < end) {\r\n let pos = this.pos;\r\n let c = text.charCodeAt(pos);\r\n if (c == CharCode._0) {\r\n // value = (value << 1);\r\n value = i64_shl(value, i64_1);\r\n } else if (c == CharCode._1) {\r\n // value = (value << 1) + 1;\r\n value = i64_add(\r\n i64_shl(value, i64_1),\r\n i64_1\r\n );\r\n } else if (c == CharCode._) {\r\n if (sepEnd == pos) {\r\n this.error(\r\n sepEnd == start\r\n ? DiagnosticCode.Numeric_separators_are_not_allowed_here\r\n : DiagnosticCode.Multiple_consecutive_numeric_separators_are_not_permitted,\r\n this.range(pos)\r\n );\r\n }\r\n sepEnd = pos + 1;\r\n } else {\r\n break;\r\n }\r\n this.pos = pos + 1;\r\n }\r\n if (this.pos == start) {\r\n this.error(\r\n DiagnosticCode.Binary_digit_expected,\r\n this.range(start)\r\n );\r\n } else if (sepEnd == this.pos) {\r\n this.error(\r\n DiagnosticCode.Numeric_separators_are_not_allowed_here,\r\n this.range(sepEnd - 1)\r\n );\r\n }\r\n return value;\r\n }\r\n\r\n readFloat(): f64 {\r\n // var text = this.source.text;\r\n // if (text.charCodeAt(this.pos) == CharCode._0 && this.pos + 2 < this.end) {\r\n // switch (text.charCodeAt(this.pos + 1)) {\r\n // case CharCode.X:\r\n // case CharCode.x: {\r\n // this.pos += 2;\r\n // return this.readHexFloat();\r\n // }\r\n // }\r\n // }\r\n return this.readDecimalFloat();\r\n }\r\n\r\n readDecimalFloat(): f64 {\r\n // TODO: numeric separators (parseFloat can't handle these)\r\n var start = this.pos;\r\n var end = this.end;\r\n var text = this.source.text;\r\n while (this.pos < end && isDecimalDigit(text.charCodeAt(this.pos))) {\r\n ++this.pos;\r\n }\r\n if (this.pos < end && text.charCodeAt(this.pos) == CharCode.DOT) {\r\n ++this.pos;\r\n while (this.pos < end && isDecimalDigit(text.charCodeAt(this.pos))) {\r\n ++this.pos;\r\n }\r\n }\r\n if (this.pos < end) {\r\n let c = text.charCodeAt(this.pos);\r\n if (c == CharCode.e || c == CharCode.E) {\r\n if (\r\n ++this.pos < end &&\r\n (c = text.charCodeAt(this.pos)) == CharCode.MINUS || c == CharCode.PLUS &&\r\n isDecimalDigit(text.charCodeAt(this.pos + 1))\r\n ) {\r\n ++this.pos;\r\n }\r\n while (this.pos < end && isDecimalDigit(text.charCodeAt(this.pos))) {\r\n ++this.pos;\r\n }\r\n }\r\n }\r\n return parseFloat(text.substring(start, this.pos));\r\n }\r\n\r\n readHexFloat(): f64 {\r\n throw new Error(\"not implemented\"); // TBD\r\n }\r\n\r\n readUnicodeEscape(): string {\r\n var remain = 4;\r\n var value = 0;\r\n var end = this.end;\r\n var text = this.source.text;\r\n while (this.pos < end) {\r\n let c = text.charCodeAt(this.pos++);\r\n if (c >= CharCode._0 && c <= CharCode._9) {\r\n value = (value << 4) + c - CharCode._0;\r\n } else if (c >= CharCode.A && c <= CharCode.F) {\r\n value = (value << 4) + c + (10 - CharCode.A);\r\n } else if (c >= CharCode.a && c <= CharCode.f) {\r\n value = (value << 4) + c + (10 - CharCode.a);\r\n } else {\r\n this.error(\r\n DiagnosticCode.Hexadecimal_digit_expected,\r\n this.range(this.pos - 1, this.pos)\r\n );\r\n return \"\";\r\n }\r\n if (--remain == 0) break;\r\n }\r\n if (remain) {\r\n this.error(\r\n DiagnosticCode.Unexpected_end_of_text,\r\n this.range(this.pos)\r\n );\r\n return \"\";\r\n }\r\n return String.fromCharCode(value);\r\n }\r\n\r\n private readExtendedUnicodeEscape(): string {\r\n var start = this.pos;\r\n var value = this.readHexInteger();\r\n var value32 = i64_low(value);\r\n var invalid = false;\r\n\r\n assert(!i64_high(value));\r\n if (value32 > 0x10FFFF) {\r\n this.error(\r\n DiagnosticCode.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive,\r\n this.range(start, this.pos)\r\n );\r\n invalid = true;\r\n }\r\n\r\n var end = this.end;\r\n var text = this.source.text;\r\n if (this.pos >= end) {\r\n this.error(\r\n DiagnosticCode.Unexpected_end_of_text,\r\n this.range(start, end)\r\n );\r\n invalid = true;\r\n } else if (text.charCodeAt(this.pos) == CharCode.CLOSEBRACE) {\r\n ++this.pos;\r\n } else {\r\n this.error(\r\n DiagnosticCode.Unterminated_Unicode_escape_sequence,\r\n this.range(start, this.pos)\r\n );\r\n invalid = true;\r\n }\r\n\r\n if (invalid) return \"\";\r\n return value32 < 65536\r\n ? String.fromCharCode(value32)\r\n : String.fromCharCode(\r\n ((value32 - 65536) >>> 10) + 0xD800,\r\n ((value32 - 65536) & 1023) + 0xDC00\r\n );\r\n }\r\n\r\n finish(): void {\r\n }\r\n}\r\n\r\n/** Tokenizer state as returned by {@link Tokenizer#mark} and consumed by {@link Tokenizer#reset}. */\r\nexport class State {\r\n /** Current position. */\r\n pos: i32;\r\n /** Current token. */\r\n token: Token;\r\n /** Current token's position. */\r\n tokenPos: i32;\r\n}\r\n\r\n// Reusable state object to reduce allocations\r\nvar reusableState: State | null = null;\r\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","/**\r\n * Resolve infrastructure to obtain types and elements.\r\n * @module resolver\r\n *//***/\r\n\r\nimport {\r\n DiagnosticEmitter,\r\n DiagnosticCode\r\n} from \"./diagnostics\";\r\n\r\nimport {\r\n Program,\r\n ElementKind,\r\n OperatorKind,\r\n Element,\r\n Class,\r\n ClassPrototype,\r\n Function,\r\n FunctionPrototype,\r\n VariableLikeElement,\r\n Property,\r\n PropertyPrototype,\r\n Field,\r\n FieldPrototype,\r\n Global,\r\n TypeDefinition\r\n} from \"./program\";\r\n\r\nimport {\r\n FlowFlags,\r\n Flow\r\n} from \"./flow\";\r\n\r\nimport {\r\n SignatureNode,\r\n ParameterKind,\r\n CommonTypeNode,\r\n NodeKind,\r\n TypeNode,\r\n TypeName,\r\n TypeParameterNode,\r\n Node,\r\n Range,\r\n IdentifierExpression,\r\n CallExpression,\r\n ElementAccessExpression,\r\n PropertyAccessExpression,\r\n LiteralExpression,\r\n LiteralKind,\r\n ParenthesizedExpression,\r\n AssertionExpression,\r\n Expression,\r\n IntegerLiteralExpression,\r\n UnaryPrefixExpression,\r\n UnaryPostfixExpression,\r\n AssertionKind,\r\n BinaryExpression,\r\n ThisExpression,\r\n SuperExpression,\r\n isTypeOmitted\r\n} from \"./ast\";\r\n\r\nimport {\r\n Type,\r\n Signature,\r\n typesToString,\r\n TypeKind,\r\n TypeFlags\r\n} from \"./types\";\r\n\r\nimport {\r\n CommonFlags,\r\n CommonSymbols\r\n} from \"./common\";\r\n\r\nimport {\r\n makeMap,\r\n isPowerOf2\r\n} from \"./util\";\r\n\r\nimport {\r\n Token\r\n} from \"./tokenizer\";\r\n\r\nimport {\r\n BuiltinSymbols\r\n} from \"./builtins\";\r\n\r\n/** Indicates whether errors are reported or not. */\r\nexport enum ReportMode {\r\n /** Report errors. */\r\n REPORT,\r\n /** Swallow errors. */\r\n SWALLOW\r\n}\r\n\r\n/** Provides tools to resolve types and expressions. */\r\nexport class Resolver extends DiagnosticEmitter {\r\n\r\n /** The program this resolver belongs to. */\r\n program: Program;\r\n\r\n /** Target expression of the previously resolved property or element access. */\r\n currentThisExpression: Expression | null = null;\r\n /** Element expression of the previously resolved element access. */\r\n currentElementExpression : Expression | null = null;\r\n\r\n /** Constructs the resolver for the specified program. */\r\n constructor(\r\n /** The program to construct a resolver for. */\r\n program: Program\r\n ) {\r\n super(program.diagnostics);\r\n this.program = program;\r\n }\r\n\r\n /** Resolves a {@link CommonTypeNode} to a concrete {@link Type}. */\r\n resolveType(\r\n /** The type to resolve. */\r\n node: CommonTypeNode,\r\n /** Relative context. */\r\n context: Element,\r\n /** Type arguments inherited through context, i.e. `T`. */\r\n contextualTypeArguments: Map | null = null,\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Type | null {\r\n\r\n // handle signature\r\n if (node.kind == NodeKind.SIGNATURE) {\r\n let explicitThisType = (node).explicitThisType;\r\n let thisType: Type | null = null;\r\n if (explicitThisType) {\r\n thisType = this.resolveType(\r\n explicitThisType,\r\n context,\r\n contextualTypeArguments,\r\n reportMode\r\n );\r\n if (!thisType) return null;\r\n }\r\n let parameterNodes = (node).parameters;\r\n let numParameters = parameterNodes.length;\r\n let parameterTypes = new Array(numParameters);\r\n let parameterNames = new Array(numParameters);\r\n let requiredParameters = 0;\r\n let hasRest = false;\r\n for (let i = 0; i < numParameters; ++i) {\r\n let parameterNode = parameterNodes[i];\r\n switch (parameterNode.parameterKind) {\r\n case ParameterKind.DEFAULT: {\r\n requiredParameters = i + 1;\r\n break;\r\n }\r\n case ParameterKind.REST: {\r\n assert(i == numParameters);\r\n hasRest = true;\r\n break;\r\n }\r\n }\r\n let parameterTypeNode = parameterNode.type;\r\n if (isTypeOmitted(parameterTypeNode)) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Type_expected,\r\n parameterTypeNode.range\r\n );\r\n }\r\n return null;\r\n }\r\n let parameterType = this.resolveType(\r\n parameterTypeNode,\r\n context,\r\n contextualTypeArguments,\r\n reportMode\r\n );\r\n if (!parameterType) return null;\r\n parameterTypes[i] = parameterType;\r\n parameterNames[i] = parameterNode.name.text;\r\n }\r\n let returnTypeNode = (node).returnType;\r\n if (isTypeOmitted(returnTypeNode)) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Type_expected,\r\n returnTypeNode.range\r\n );\r\n }\r\n return null;\r\n }\r\n let returnType: Type | null;\r\n if (returnTypeNode) {\r\n returnType = this.resolveType(\r\n returnTypeNode,\r\n context,\r\n contextualTypeArguments,\r\n reportMode\r\n );\r\n if (!returnType) return null;\r\n } else {\r\n returnType = Type.void;\r\n }\r\n let signature = new Signature(parameterTypes, returnType, thisType);\r\n signature.parameterNames = parameterNames;\r\n signature.requiredParameters = requiredParameters;\r\n signature.hasRest = hasRest;\r\n return node.isNullable ? signature.type.asNullable() : signature.type;\r\n }\r\n\r\n // now dealing with TypeNode\r\n assert(node.kind == NodeKind.TYPE);\r\n var typeNode = node;\r\n var typeName = typeNode.name;\r\n var typeArgumentNodes = typeNode.typeArguments;\r\n var possiblyPlaceholder = !typeName.next;\r\n\r\n // look up in contextual type arguments if possibly a placeholder\r\n if (possiblyPlaceholder) {\r\n if (contextualTypeArguments && contextualTypeArguments.has(typeName.identifier.text)) {\r\n let type = contextualTypeArguments.get(typeName.identifier.text)!;\r\n if (typeArgumentNodes !== null && typeArgumentNodes.length) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n node.range, type.toString()\r\n );\r\n }\r\n }\r\n if (node.isNullable) {\r\n if (!type.is(TypeFlags.REFERENCE)) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Basic_type_0_cannot_be_nullable,\r\n node.range, type.toString()\r\n );\r\n }\r\n }\r\n return type.asNullable();\r\n }\r\n return type;\r\n }\r\n }\r\n\r\n // look up in context\r\n var element = this.resolveTypeName(typeName, context, reportMode);\r\n if (!element) return null;\r\n\r\n // use shadow type if present (i.e. namespace sharing a type)\r\n if (element.shadowType) {\r\n element = element.shadowType;\r\n\r\n } else {\r\n // handle enums (become i32)\r\n if (element.kind == ElementKind.ENUM) {\r\n if (typeArgumentNodes !== null && typeArgumentNodes.length) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n node.range, element.internalName\r\n );\r\n }\r\n }\r\n if (node.isNullable) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Basic_type_0_cannot_be_nullable,\r\n node.range, element.name\r\n );\r\n }\r\n }\r\n return Type.i32;\r\n }\r\n\r\n // handle classes\r\n if (element.kind == ElementKind.CLASS_PROTOTYPE) {\r\n let instance = this.resolveClassInclTypeArguments(\r\n element,\r\n typeArgumentNodes,\r\n context,\r\n makeMap(contextualTypeArguments), // don't inherit\r\n node\r\n ); // reports\r\n if (!instance) return null;\r\n return node.isNullable ? instance.type.asNullable() : instance.type;\r\n }\r\n }\r\n\r\n // handle type definitions\r\n if (element.kind == ElementKind.TYPEDEFINITION) {\r\n\r\n // shortcut already resolved (mostly builtins)\r\n if (element.is(CommonFlags.RESOLVED)) {\r\n if (typeArgumentNodes !== null && typeArgumentNodes.length) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n node.range, element.internalName\r\n );\r\n }\r\n }\r\n let type = (element).type;\r\n if (node.isNullable) {\r\n if (!type.is(TypeFlags.REFERENCE)) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Basic_type_0_cannot_be_nullable,\r\n typeNode.name.range, typeName.identifier.text\r\n );\r\n }\r\n } else {\r\n return type.asNullable();\r\n }\r\n }\r\n return type;\r\n }\r\n\r\n // handle special native type\r\n if (possiblyPlaceholder && typeName.identifier.text == CommonSymbols.native) {\r\n if (!(typeArgumentNodes && typeArgumentNodes.length == 1)) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n typeNode.range, \"1\", (typeArgumentNodes ? typeArgumentNodes.length : 1).toString(10)\r\n );\r\n }\r\n return null;\r\n }\r\n let typeArgument = this.resolveType(\r\n typeArgumentNodes[0],\r\n context,\r\n contextualTypeArguments,\r\n reportMode\r\n );\r\n if (!typeArgument) return null;\r\n switch (typeArgument.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32: return Type.i32;\r\n case TypeKind.ISIZE: if (!this.program.options.isWasm64) return Type.i32;\r\n case TypeKind.I64: return Type.i64;\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: return Type.u32;\r\n case TypeKind.USIZE: if (!this.program.options.isWasm64) return Type.u32;\r\n case TypeKind.U64: return Type.u64;\r\n case TypeKind.F32: return Type.f32;\r\n case TypeKind.F64: return Type.f64;\r\n case TypeKind.V128: return Type.v128;\r\n case TypeKind.VOID: return Type.void;\r\n default: assert(false);\r\n }\r\n }\r\n\r\n // resolve normally\r\n let typeParameterNodes = (element).typeParameterNodes;\r\n let typeArguments: Type[] | null = null;\r\n if (typeParameterNodes) {\r\n typeArguments = this.resolveTypeArguments(\r\n typeParameterNodes,\r\n typeArgumentNodes,\r\n context,\r\n contextualTypeArguments = makeMap(contextualTypeArguments), // inherit\r\n node,\r\n reportMode\r\n );\r\n if (!typeArguments) return null;\r\n } else if (typeArgumentNodes && typeArgumentNodes.length) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n typeNode.range, typeName.identifier.text\r\n );\r\n // recoverable\r\n }\r\n let type = this.resolveType(\r\n (element).typeNode,\r\n element,\r\n contextualTypeArguments,\r\n reportMode\r\n );\r\n if (!type) return null;\r\n if (node.isNullable) {\r\n if (!type.is(TypeFlags.REFERENCE)) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Basic_type_0_cannot_be_nullable,\r\n typeNode.name.range, typeName.identifier.text\r\n );\r\n }\r\n } else {\r\n return type.asNullable();\r\n }\r\n }\r\n return type;\r\n }\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Cannot_find_name_0,\r\n typeNode.name.range, typeName.identifier.text\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n /** Resolves a type name to the program element it refers to. */\r\n resolveTypeName(\r\n /** The type name to resolve. */\r\n typeName: TypeName,\r\n /** Relative context. */\r\n context: Element,\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode = ReportMode.REPORT\r\n ): Element | null {\r\n var element = context.lookup(typeName.identifier.text);\r\n if (!element) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Cannot_find_name_0,\r\n typeName.range, typeName.identifier.text\r\n );\r\n }\r\n return null;\r\n }\r\n var prev = typeName;\r\n var next = typeName.next;\r\n while (next) {\r\n if (!(element = element.lookupInSelf(next.identifier.text))) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Property_0_does_not_exist_on_type_1,\r\n next.range, next.identifier.text, prev.identifier.text\r\n );\r\n }\r\n return null;\r\n }\r\n prev = next;\r\n next = next.next;\r\n }\r\n return element;\r\n }\r\n\r\n /** Resolves an array of type arguments to concrete types. */\r\n resolveTypeArguments(\r\n /** Actual type parameter nodes. */\r\n typeParameters: TypeParameterNode[],\r\n /** Type arguments provided. */\r\n typeArgumentNodes: CommonTypeNode[] | null,\r\n /** Relative context. */\r\n context: Element,\r\n /** Type arguments inherited through context, i.e. `T`. */\r\n contextualTypeArguments: Map = makeMap(),\r\n /** Alternative report node in case of empty type arguments. */\r\n alternativeReportNode: Node | null = null,\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Type[] | null {\r\n var minParameterCount = 0;\r\n var maxParameterCount = 0;\r\n for (let i = 0, k = typeParameters.length; i < k; ++i) {\r\n if (!typeParameters[i].defaultType) ++minParameterCount;\r\n ++maxParameterCount;\r\n }\r\n var argumentCount = typeArgumentNodes ? typeArgumentNodes.length : 0;\r\n if (argumentCount < minParameterCount || argumentCount > maxParameterCount) {\r\n this.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n argumentCount\r\n ? Range.join(\r\n (typeArgumentNodes)[0].range,\r\n (typeArgumentNodes)[argumentCount - 1].range\r\n )\r\n : assert(alternativeReportNode).range,\r\n (argumentCount < minParameterCount ? minParameterCount : maxParameterCount).toString(10),\r\n argumentCount.toString(10)\r\n );\r\n return null;\r\n }\r\n var typeArguments = new Array(maxParameterCount);\r\n for (let i = 0; i < maxParameterCount; ++i) {\r\n let type = i < argumentCount\r\n ? this.resolveType( // reports\r\n (typeArgumentNodes)[i],\r\n context,\r\n contextualTypeArguments,\r\n reportMode\r\n )\r\n : this.resolveType( // reports\r\n assert(typeParameters[i].defaultType),\r\n context,\r\n contextualTypeArguments,\r\n reportMode\r\n );\r\n if (!type) return null;\r\n // TODO: check extendsType\r\n contextualTypeArguments.set(typeParameters[i].name.text, type);\r\n typeArguments[i] = type;\r\n }\r\n return typeArguments;\r\n }\r\n\r\n /** Resolves an identifier to the program element it refers to. */\r\n resolveIdentifier(\r\n /** The expression to resolve. */\r\n identifier: IdentifierExpression,\r\n /** Optional flow to search for scoped locals. */\r\n flow: Flow | null,\r\n /** Optional context to search. */\r\n context: Element | null,\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Element | null {\r\n var name = identifier.text;\r\n var element: Element | null;\r\n if (flow) {\r\n if (element = flow.lookup(name)) {\r\n this.currentThisExpression = null;\r\n this.currentElementExpression = null;\r\n return element;\r\n }\r\n }\r\n if (context) {\r\n if (element = context.lookup(name)) {\r\n this.currentThisExpression = null;\r\n this.currentElementExpression = null;\r\n return element;\r\n }\r\n }\r\n if (element = this.program.lookupGlobal(name)) {\r\n this.currentThisExpression = null;\r\n this.currentElementExpression = null;\r\n return element;\r\n }\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Cannot_find_name_0,\r\n identifier.range, name\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n /** Resolves a lazily compiled global, i.e. a static class field. */\r\n ensureResolvedLazyGlobal(global: Global, reportMode: ReportMode = ReportMode.REPORT): bool {\r\n if (global.is(CommonFlags.RESOLVED)) return true;\r\n var typeNode = global.typeNode;\r\n if (!typeNode) return false;\r\n var type = this.resolveType( // reports\r\n typeNode,\r\n global.parent,\r\n null,\r\n reportMode\r\n );\r\n if (!type) return false;\r\n global.setType(type);\r\n return true;\r\n }\r\n\r\n /** Resolves a property access expression to the program element it refers to. */\r\n resolvePropertyAccessExpression(\r\n /** The expression to resolve. */\r\n propertyAccess: PropertyAccessExpression,\r\n /** Current flow. */\r\n flow: Flow,\r\n /** Current contextual type. */\r\n contextualType: Type,\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Element | null {\r\n var targetExpression = propertyAccess.expression;\r\n var target = this.resolveExpression(targetExpression, flow, contextualType, reportMode); // reports\r\n if (!target) return null;\r\n var propertyName = propertyAccess.property.text;\r\n\r\n // Resolve variable-likes to their class type first\r\n switch (target.kind) {\r\n case ElementKind.GLOBAL: if (!this.ensureResolvedLazyGlobal(target, reportMode)) return null;\r\n case ElementKind.LOCAL:\r\n case ElementKind.FIELD: {\r\n let type = (target).type; assert(type != Type.void);\r\n let classReference = type.classReference;\r\n if (!classReference) {\r\n let typeClasses = this.program.typeClasses;\r\n if (!type.is(TypeFlags.REFERENCE) && typeClasses.has(type.kind)) {\r\n classReference = typeClasses.get(type.kind)!;\r\n } else {\r\n this.error(\r\n DiagnosticCode.Property_0_does_not_exist_on_type_1,\r\n propertyAccess.property.range, propertyName, (target).type.toString()\r\n );\r\n return null;\r\n }\r\n }\r\n target = classReference;\r\n break;\r\n }\r\n case ElementKind.PROPERTY_PROTOTYPE: { // static\r\n let getterInstance = this.resolveFunction( // reports\r\n assert((target).getterPrototype), // must have a getter\r\n null,\r\n makeMap(),\r\n reportMode\r\n );\r\n if (!getterInstance) return null;\r\n let classReference = getterInstance.signature.returnType.classReference;\r\n if (!classReference) {\r\n this.error(\r\n DiagnosticCode.Property_0_does_not_exist_on_type_1,\r\n propertyAccess.property.range, propertyName, getterInstance.signature.returnType.toString()\r\n );\r\n return null;\r\n }\r\n target = classReference;\r\n break;\r\n }\r\n case ElementKind.PROPERTY: { // instance\r\n let getterInstance = assert((target).getterInstance); // must have a getter\r\n let classReference = getterInstance.signature.returnType.classReference;\r\n if (!classReference) {\r\n this.error(\r\n DiagnosticCode.Property_0_does_not_exist_on_type_1,\r\n propertyAccess.property.range, propertyName, getterInstance.signature.returnType.toString()\r\n );\r\n return null;\r\n }\r\n target = classReference;\r\n break;\r\n }\r\n case ElementKind.CLASS: { // property access on element access?\r\n let elementExpression = this.currentElementExpression;\r\n if (elementExpression) {\r\n // let arrayType = this.program.determineBuiltinArrayType(target);\r\n // if (!arrayType) {\r\n let indexedGet = (target).lookupOverload(OperatorKind.INDEXED_GET);\r\n if (!indexedGet) {\r\n this.error(\r\n DiagnosticCode.Index_signature_is_missing_in_type_0,\r\n elementExpression.range, (target).internalName\r\n );\r\n return null;\r\n }\r\n let arrayType = indexedGet.signature.returnType;\r\n // }\r\n if (!(target = arrayType.classReference)) {\r\n this.error(\r\n DiagnosticCode.Property_0_does_not_exist_on_type_1,\r\n propertyAccess.property.range, propertyName, arrayType.toString()\r\n );\r\n return null;\r\n }\r\n }\r\n break;\r\n }\r\n case ElementKind.FUNCTION_PROTOTYPE: { // function Symbol() + type Symbol = _Symbol\r\n let shadowType = target.shadowType;\r\n if (shadowType) {\r\n if (!shadowType.is(CommonFlags.RESOLVED)) {\r\n let resolvedType = this.resolveType(shadowType.typeNode, shadowType.parent, null, reportMode);\r\n if (resolvedType) shadowType.setType(resolvedType);\r\n }\r\n let classReference = shadowType.type.classReference;\r\n if (classReference) target = classReference.prototype;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // Look up the member within\r\n switch (target.kind) {\r\n case ElementKind.CLASS_PROTOTYPE:\r\n case ElementKind.CLASS: {\r\n do {\r\n let members = target.members;\r\n if (members && members.has(propertyName)) {\r\n this.currentThisExpression = targetExpression;\r\n this.currentElementExpression = null;\r\n return members.get(propertyName)!; // instance FIELD, static GLOBAL, FUNCTION_PROTOTYPE...\r\n }\r\n // traverse inherited static members on the base prototype if target is a class prototype\r\n if (target.kind == ElementKind.CLASS_PROTOTYPE) {\r\n if ((target).basePrototype) {\r\n target = (target).basePrototype;\r\n } else {\r\n break;\r\n }\r\n // traverse inherited instance members on the base class if target is a class instance\r\n } else if (target.kind == ElementKind.CLASS) {\r\n if ((target).base) {\r\n target = (target).base;\r\n } else {\r\n break;\r\n }\r\n } else {\r\n break;\r\n }\r\n } while (true);\r\n break;\r\n }\r\n default: { // enums or other namespace-like elements\r\n let members = target.members;\r\n if (members && members.has(propertyName)) {\r\n this.currentThisExpression = targetExpression;\r\n this.currentElementExpression = null;\r\n return members.get(propertyName)!; // static ENUMVALUE, static GLOBAL, static FUNCTION_PROTOTYPE...\r\n }\r\n break;\r\n }\r\n }\r\n\r\n this.error(\r\n DiagnosticCode.Property_0_does_not_exist_on_type_1,\r\n propertyAccess.property.range, propertyName, target.internalName\r\n );\r\n return null;\r\n }\r\n\r\n /** Resolves an element access expression to the program element it refers to. */\r\n resolveElementAccessExpression(\r\n /** The expression to resolve. */\r\n elementAccess: ElementAccessExpression,\r\n /** Current flow. */\r\n flow: Flow,\r\n /** Current contextual type. */\r\n contextualType: Type,\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Element | null {\r\n var targetExpression = elementAccess.expression;\r\n var target = this.resolveExpression(targetExpression, flow, contextualType, reportMode); // reports\r\n if (!target) return null;\r\n switch (target.kind) {\r\n case ElementKind.GLOBAL: if (!this.ensureResolvedLazyGlobal(target, reportMode)) return null;\r\n case ElementKind.LOCAL:\r\n case ElementKind.FIELD: {\r\n let type = (target).type;\r\n if (target = type.classReference) {\r\n this.currentThisExpression = targetExpression;\r\n this.currentElementExpression = elementAccess.elementExpression;\r\n return target;\r\n }\r\n break;\r\n }\r\n case ElementKind.CLASS: {\r\n // let arrayType = this.program.determineBuiltinArrayType(target);\r\n // if (!arrayType) {\r\n let indexedGet = (target).lookupOverload(OperatorKind.INDEXED_GET);\r\n if (!indexedGet) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Index_signature_is_missing_in_type_0,\r\n elementAccess.range, (target).internalName\r\n );\r\n }\r\n return null;\r\n }\r\n let arrayType = indexedGet.signature.returnType;\r\n // }\r\n if (targetExpression.kind == NodeKind.ELEMENTACCESS) { // nested element access\r\n if (target = arrayType.classReference) {\r\n this.currentThisExpression = targetExpression;\r\n this.currentElementExpression = elementAccess.elementExpression;\r\n return target;\r\n }\r\n return null;\r\n }\r\n this.currentThisExpression = targetExpression;\r\n this.currentElementExpression = elementAccess.elementExpression;\r\n return target;\r\n }\r\n }\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n targetExpression.range\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n /** Determines the final type of an integer literal given the specified contextual type. */\r\n determineIntegerLiteralType(\r\n /** Integer literal value. */\r\n intValue: I64,\r\n /** Current contextual type. */\r\n contextualType: Type\r\n ): Type {\r\n if (!contextualType.is(TypeFlags.REFERENCE)) {\r\n // compile to contextualType if matching\r\n switch (contextualType.kind) {\r\n case TypeKind.I8: {\r\n if (i64_is_i8(intValue)) return Type.i8;\r\n break;\r\n }\r\n case TypeKind.U8: {\r\n if (i64_is_u8(intValue)) return Type.u8;\r\n break;\r\n }\r\n case TypeKind.I16: {\r\n if (i64_is_i16(intValue)) return Type.i16;\r\n break;\r\n }\r\n case TypeKind.U16: {\r\n if (i64_is_u16(intValue)) return Type.u16;\r\n break;\r\n }\r\n case TypeKind.I32: {\r\n if (i64_is_i32(intValue)) return Type.i32;\r\n break;\r\n }\r\n case TypeKind.U32: {\r\n if (i64_is_u32(intValue)) return Type.u32;\r\n break;\r\n }\r\n case TypeKind.BOOL: {\r\n if (i64_is_bool(intValue)) return Type.bool;\r\n break;\r\n }\r\n case TypeKind.ISIZE: {\r\n if (!this.program.options.isWasm64) {\r\n if (i64_is_i32(intValue)) return Type.isize32;\r\n break;\r\n }\r\n return Type.isize64;\r\n }\r\n case TypeKind.USIZE: {\r\n if (!this.program.options.isWasm64) {\r\n if (i64_is_u32(intValue)) return Type.usize32;\r\n break;\r\n }\r\n return Type.usize64;\r\n }\r\n case TypeKind.I64: return Type.i64;\r\n case TypeKind.U64: return Type.u64;\r\n case TypeKind.F32: return Type.f32;\r\n case TypeKind.F64: return Type.f64;\r\n case TypeKind.VOID: break; // best fitting below\r\n default: assert(false);\r\n }\r\n }\r\n // otherwise compile to best fitting native type\r\n if (i64_is_i32(intValue)) return Type.i32;\r\n if (i64_is_u32(intValue)) return Type.u32;\r\n return Type.i64;\r\n }\r\n\r\n /** Resolves any expression to the program element it refers to. */\r\n resolveExpression(\r\n /** The expression to resolve. */\r\n expression: Expression,\r\n /** Current flow. */\r\n flow: Flow,\r\n /** Current contextual type. */\r\n contextualType: Type = Type.void,\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Element | null {\r\n while (expression.kind == NodeKind.PARENTHESIZED) { // simply skip\r\n expression = (expression).expression;\r\n }\r\n switch (expression.kind) {\r\n case NodeKind.ASSERTION: {\r\n return this.resolveAssertionExpression(\r\n expression,\r\n flow, contextualType, reportMode\r\n );\r\n }\r\n case NodeKind.UNARYPREFIX: {\r\n return this.resolveUnaryPrefixExpression(\r\n expression,\r\n flow, contextualType, reportMode\r\n );\r\n }\r\n case NodeKind.UNARYPOSTFIX: {\r\n return this.resolveUnaryPostfixExpression(\r\n expression,\r\n flow, contextualType, reportMode\r\n );\r\n }\r\n case NodeKind.BINARY: {\r\n return this.resolveBinaryExpression(\r\n expression,\r\n flow, contextualType, reportMode\r\n );\r\n }\r\n case NodeKind.THIS: {\r\n return this.resolveThisExpression(\r\n expression,\r\n flow, contextualType, reportMode\r\n );\r\n }\r\n case NodeKind.SUPER: {\r\n return this.resolveSuperExpression(\r\n expression,\r\n flow, contextualType, reportMode\r\n );\r\n }\r\n case NodeKind.IDENTIFIER: {\r\n return this.resolveIdentifier(\r\n expression,\r\n flow, flow.actualFunction, reportMode\r\n );\r\n }\r\n case NodeKind.LITERAL: {\r\n return this.resolveLiteralExpression(\r\n expression,\r\n flow, contextualType, reportMode\r\n );\r\n }\r\n case NodeKind.PROPERTYACCESS: {\r\n return this.resolvePropertyAccessExpression(\r\n expression,\r\n flow, contextualType, reportMode\r\n );\r\n }\r\n case NodeKind.ELEMENTACCESS: {\r\n return this.resolveElementAccessExpression(\r\n expression,\r\n flow, contextualType, reportMode\r\n );\r\n }\r\n case NodeKind.CALL: {\r\n return this.resolveCallExpression(\r\n expression,\r\n flow, contextualType, reportMode\r\n );\r\n }\r\n // TODO: everything else\r\n }\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n /** Resolves an assertion expression to the program element it refers to. */\r\n resolveAssertionExpression(\r\n /** The expression to resolve. */\r\n expression: AssertionExpression,\r\n /** Current flow. */\r\n flow: Flow,\r\n /** Current contextual type. */\r\n contextualType: Type = Type.void,\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Element | null {\r\n if (expression.assertionKind == AssertionKind.NONNULL) {\r\n return this.resolveExpression(\r\n expression.expression,\r\n flow,\r\n contextualType,\r\n reportMode\r\n );\r\n }\r\n var type = this.resolveType(\r\n assert(expression.toType), // must be set if not NONNULL\r\n flow.actualFunction,\r\n flow.contextualTypeArguments,\r\n reportMode\r\n );\r\n if (!type) return null;\r\n var element: Element | null = type.classReference;\r\n if (!element) {\r\n let signature = type.signatureReference;\r\n if (!signature) return null;\r\n element = signature.asFunctionTarget(this.program);\r\n }\r\n this.currentThisExpression = null;\r\n this.currentElementExpression = null;\r\n return element;\r\n }\r\n\r\n /** Resolves an unary prefix expression to the program element it refers to. */\r\n resolveUnaryPrefixExpression(\r\n /** The expression to resolve. */\r\n expression: UnaryPrefixExpression,\r\n /** Current flow. */\r\n flow: Flow,\r\n /** Current contextual type. */\r\n contextualType: Type = Type.void,\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Element | null {\r\n var operand = expression.operand;\r\n // TODO: operator overloads\r\n switch (expression.operator) {\r\n case Token.MINUS: {\r\n // implicitly negate if an integer literal to distinguish between i32/u32/i64\r\n if (operand.kind == NodeKind.LITERAL && (operand).literalKind == LiteralKind.INTEGER) {\r\n let type = this.determineIntegerLiteralType(\r\n i64_sub(i64_zero, (operand).value),\r\n contextualType\r\n );\r\n let typeClasses = this.program.typeClasses;\r\n return typeClasses.has(type.kind) ? typeClasses.get(type.kind)! : null;\r\n }\r\n return this.resolveExpression(\r\n operand,\r\n flow,\r\n contextualType,\r\n reportMode\r\n );\r\n }\r\n case Token.PLUS:\r\n case Token.PLUS_PLUS:\r\n case Token.MINUS_MINUS: {\r\n return this.resolveExpression(\r\n expression.operand,\r\n flow,\r\n contextualType,\r\n reportMode\r\n );\r\n }\r\n case Token.EXCLAMATION: {\r\n let typeClasses = this.program.typeClasses;\r\n return typeClasses.has(TypeKind.BOOL) ? typeClasses.get(TypeKind.BOOL)! : null;\r\n }\r\n case Token.TILDE: {\r\n let resolvedOperand = this.resolveExpression(\r\n expression.operand,\r\n flow,\r\n contextualType,\r\n reportMode\r\n );\r\n if (!resolvedOperand) return null;\r\n // TODO\r\n break;\r\n }\r\n default: assert(false);\r\n }\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n /** Resolves an unary postfix expression to the program element it refers to. */\r\n resolveUnaryPostfixExpression(\r\n /** The expression to resolve. */\r\n expression: UnaryPostfixExpression,\r\n /** Current flow. */\r\n flow: Flow,\r\n /** Current contextual type. */\r\n contextualType: Type = Type.void,\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Element | null {\r\n // TODO: operator overloads\r\n switch (expression.operator) {\r\n case Token.PLUS_PLUS:\r\n case Token.MINUS_MINUS: {\r\n return this.resolveExpression(\r\n expression.operand,\r\n flow,\r\n contextualType,\r\n reportMode\r\n );\r\n }\r\n default: assert(false);\r\n }\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n /** Resolves a binary expression to the program element it refers to. */\r\n resolveBinaryExpression(\r\n /** The expression to resolve. */\r\n expression: BinaryExpression,\r\n /** Current flow. */\r\n flow: Flow,\r\n /** Current contextual type. */\r\n contextualType: Type = Type.void,\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Element | null {\r\n // TODO\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n /** Resolves a this expression to the program element it refers to. */\r\n resolveThisExpression(\r\n /** The expression to resolve. */\r\n expression: ThisExpression,\r\n /** Current flow. */\r\n flow: Flow,\r\n /** Current contextual type. */\r\n contextualType: Type = Type.void,\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Element | null {\r\n if (flow.is(FlowFlags.INLINE_CONTEXT)) {\r\n let thisLocal = flow.lookupLocal(CommonSymbols.this_);\r\n if (thisLocal) {\r\n this.currentThisExpression = null;\r\n this.currentElementExpression = null;\r\n return thisLocal;\r\n }\r\n }\r\n var parent = flow.actualFunction.parent;\r\n if (parent) {\r\n this.currentThisExpression = null;\r\n this.currentElementExpression = null;\r\n return parent;\r\n }\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode._this_cannot_be_referenced_in_current_location,\r\n expression.range\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n /** Resolves a super expression to the program element it refers to. */\r\n resolveSuperExpression(\r\n /** The expression to resolve. */\r\n expression: SuperExpression,\r\n /** Current flow. */\r\n flow: Flow,\r\n /** Current contextual type. */\r\n contextualType: Type = Type.void,\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Element | null {\r\n if (flow.is(FlowFlags.INLINE_CONTEXT)) {\r\n let superLocal = flow.lookupLocal(CommonSymbols.super_);\r\n if (superLocal) {\r\n this.currentThisExpression = null;\r\n this.currentElementExpression = null;\r\n return superLocal;\r\n }\r\n }\r\n var parent: Element | null = flow.actualFunction.parent;\r\n if (parent && parent.kind == ElementKind.CLASS && (parent = (parent).base)) {\r\n this.currentThisExpression = null;\r\n this.currentElementExpression = null;\r\n return parent;\r\n }\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode._super_can_only_be_referenced_in_a_derived_class,\r\n expression.range\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n /** Resolves a literal expression to the program element it refers to. */\r\n resolveLiteralExpression(\r\n /** The expression to resolve. */\r\n expression: LiteralExpression,\r\n /** Current flow. */\r\n flow: Flow,\r\n /** Current contextual type. */\r\n contextualType: Type = Type.void,\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Element | null {\r\n switch (expression.literalKind) {\r\n case LiteralKind.INTEGER: {\r\n this.currentThisExpression = expression;\r\n this.currentElementExpression = null;\r\n let literalType = this.determineIntegerLiteralType(\r\n (expression).value,\r\n contextualType\r\n );\r\n let typeClasses = this.program.typeClasses;\r\n return typeClasses.has(literalType.kind) ? typeClasses.get(literalType.kind)! : null;\r\n }\r\n case LiteralKind.FLOAT: {\r\n this.currentThisExpression = expression;\r\n this.currentElementExpression = null;\r\n let literalType = contextualType == Type.f32 ? Type.f32 : Type.f64;\r\n let typeClasses = this.program.typeClasses;\r\n return typeClasses.has(literalType.kind) ? typeClasses.get(literalType.kind)! : null;\r\n }\r\n case LiteralKind.STRING: {\r\n this.currentThisExpression = expression;\r\n this.currentElementExpression = null;\r\n return this.program.stringInstance;\r\n }\r\n // TODO\r\n // case LiteralKind.ARRAY:\r\n }\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n /** Resolves a call expression to the program element it refers to. */\r\n resolveCallExpression(\r\n /** The expression to resolve. */\r\n expression: CallExpression,\r\n /** Current flow. */\r\n flow: Flow,\r\n /** Current contextual type. */\r\n contextualType: Type = Type.void,\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Element | null {\r\n var targetExpression = expression.expression;\r\n var target = this.resolveExpression( // reports\r\n targetExpression,\r\n flow,\r\n contextualType,\r\n reportMode\r\n );\r\n if (!target) return null;\r\n if (target.kind == ElementKind.FUNCTION_PROTOTYPE) {\r\n // `unchecked(expr: *): *` is special\r\n if (\r\n (target).internalName == BuiltinSymbols.unchecked &&\r\n expression.arguments.length > 0\r\n ) {\r\n return this.resolveExpression(expression.arguments[0], flow, contextualType, reportMode);\r\n }\r\n // otherwise resolve normally\r\n let instance = this.resolveFunctionInclTypeArguments(\r\n target,\r\n expression.typeArguments,\r\n flow.actualFunction,\r\n makeMap(flow.contextualTypeArguments), // don't inherit\r\n expression,\r\n reportMode\r\n );\r\n if (!instance) return null;\r\n let returnType = instance.signature.returnType;\r\n let classType = returnType.classReference;\r\n if (classType) {\r\n // reuse resolvedThisExpression (might be property access)\r\n // reuse resolvedElementExpression (might be element access)\r\n return classType;\r\n } else {\r\n let signature = returnType.signatureReference;\r\n if (signature) {\r\n let functionTarget = signature.asFunctionTarget(this.program);\r\n // reuse resolvedThisExpression (might be property access)\r\n // reuse resolvedElementExpression (might be element access)\r\n return functionTarget;\r\n }\r\n }\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures,\r\n targetExpression.range, target.internalName\r\n );\r\n }\r\n return null;\r\n }\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n /** Resolves a function prototype using the specified concrete type arguments. */\r\n resolveFunction(\r\n /** The prototype of the function. */\r\n prototype: FunctionPrototype,\r\n /** Concrete type arguments. */\r\n typeArguments: Type[] | null,\r\n /** Type arguments inherited through context, i.e. `T`. */\r\n contextualTypeArguments: Map = makeMap(),\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Function | null {\r\n var actualParent = prototype.parent.kind == ElementKind.PROPERTY_PROTOTYPE\r\n ? prototype.parent.parent\r\n : prototype.parent;\r\n var classInstance: Class | null = null; // if an instance method\r\n var instanceKey = typeArguments ? typesToString(typeArguments) : \"\";\r\n\r\n // Instance method prototypes are pre-bound to their concrete class as their parent\r\n if (prototype.is(CommonFlags.INSTANCE)) {\r\n assert(actualParent.kind == ElementKind.CLASS);\r\n classInstance = actualParent;\r\n\r\n // check if this exact concrete class and function combination is known already\r\n let resolvedInstance = prototype.getResolvedInstance(instanceKey);\r\n if (resolvedInstance) return resolvedInstance;\r\n\r\n // inherit class specific type arguments\r\n let classTypeArguments = classInstance.typeArguments;\r\n if (classTypeArguments) {\r\n let classTypeParameters = assert(classInstance.prototype.typeParameterNodes);\r\n let numClassTypeArguments = classTypeParameters.length;\r\n assert(numClassTypeArguments == classTypeParameters.length);\r\n for (let i = 0; i < numClassTypeArguments; ++i) {\r\n let classTypeParameterName = classTypeParameters[i].name.text;\r\n if (!contextualTypeArguments.has(classTypeParameterName)) {\r\n contextualTypeArguments.set(\r\n classTypeParameterName,\r\n classTypeArguments[i]\r\n );\r\n }\r\n }\r\n }\r\n } else {\r\n assert(actualParent.kind != ElementKind.CLASS); // must not be pre-bound\r\n let resolvedInstance = prototype.getResolvedInstance(instanceKey);\r\n if (resolvedInstance) return resolvedInstance;\r\n }\r\n\r\n // override whatever is contextual with actual function type arguments\r\n var signatureNode = prototype.signatureNode;\r\n var typeParameterNodes = prototype.typeParameterNodes;\r\n var numFunctionTypeArguments: i32;\r\n if (typeArguments && (numFunctionTypeArguments = typeArguments.length)) {\r\n assert(typeParameterNodes && numFunctionTypeArguments == typeParameterNodes.length);\r\n for (let i = 0; i < numFunctionTypeArguments; ++i) {\r\n contextualTypeArguments.set(\r\n (typeParameterNodes)[i].name.text,\r\n typeArguments[i]\r\n );\r\n }\r\n } else {\r\n assert(!typeParameterNodes || typeParameterNodes.length == 0);\r\n }\r\n\r\n // resolve `this` type if applicable\r\n var thisType: Type | null = null;\r\n var explicitThisType = signatureNode.explicitThisType;\r\n if (explicitThisType) {\r\n thisType = this.resolveType(\r\n explicitThisType,\r\n prototype.parent, // relative to function\r\n contextualTypeArguments,\r\n reportMode\r\n );\r\n if (!thisType) return null;\r\n contextualTypeArguments.set(CommonSymbols.this_, thisType);\r\n } else if (classInstance) {\r\n thisType = classInstance.type;\r\n contextualTypeArguments.set(CommonSymbols.this_, thisType);\r\n }\r\n\r\n // resolve parameter types\r\n var signatureParameters = signatureNode.parameters;\r\n var numSignatureParameters = signatureParameters.length;\r\n var parameterTypes = new Array(numSignatureParameters);\r\n var parameterNames = new Array(numSignatureParameters);\r\n var requiredParameters = 0;\r\n for (let i = 0; i < numSignatureParameters; ++i) {\r\n let parameterDeclaration = signatureParameters[i];\r\n if (parameterDeclaration.parameterKind == ParameterKind.DEFAULT) {\r\n requiredParameters = i + 1;\r\n }\r\n let typeNode = parameterDeclaration.type;\r\n if (isTypeOmitted(typeNode)) {\r\n this.error(\r\n DiagnosticCode.Type_expected,\r\n typeNode.range\r\n );\r\n return null;\r\n }\r\n let parameterType = this.resolveType(\r\n typeNode,\r\n prototype.parent, // relative to function\r\n contextualTypeArguments,\r\n reportMode\r\n );\r\n if (!parameterType) return null;\r\n parameterTypes[i] = parameterType;\r\n parameterNames[i] = parameterDeclaration.name.text;\r\n }\r\n\r\n // resolve return type\r\n var returnType: Type;\r\n if (prototype.is(CommonFlags.SET)) {\r\n returnType = Type.void; // not annotated\r\n } else if (prototype.is(CommonFlags.CONSTRUCTOR)) {\r\n returnType = assert(classInstance).type; // not annotated\r\n } else {\r\n let typeNode = signatureNode.returnType;\r\n if (isTypeOmitted(typeNode)) {\r\n this.error(\r\n DiagnosticCode.Type_expected,\r\n typeNode.range\r\n );\r\n return null;\r\n }\r\n let type = this.resolveType(\r\n typeNode,\r\n prototype.parent, // relative to function\r\n contextualTypeArguments,\r\n reportMode\r\n );\r\n if (!type) return null;\r\n returnType = type;\r\n }\r\n\r\n var signature = new Signature(parameterTypes, returnType, thisType);\r\n signature.parameterNames = parameterNames;\r\n signature.requiredParameters = requiredParameters;\r\n\r\n var nameInclTypeParameters = prototype.name;\r\n if (instanceKey.length) nameInclTypeParameters += \"<\" + instanceKey + \">\";\r\n var instance = new Function(\r\n nameInclTypeParameters,\r\n prototype,\r\n signature,\r\n contextualTypeArguments\r\n );\r\n prototype.setResolvedInstance(instanceKey, instance);\r\n return instance;\r\n }\r\n\r\n /** Resolves a function prototypeby first resolving the specified type arguments. */\r\n resolveFunctionInclTypeArguments(\r\n /** The prototype of the function. */\r\n prototype: FunctionPrototype,\r\n /** Type arguments provided. */\r\n typeArgumentNodes: CommonTypeNode[] | null,\r\n /** Relative context. Type arguments are resolved from here. */\r\n context: Element,\r\n /** Type arguments inherited through context, i.e. `T`. */\r\n contextualTypeArguments: Map,\r\n /** The node to use when reporting intermediate errors. */\r\n reportNode: Node,\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Function | null {\r\n var actualParent = prototype.parent.kind == ElementKind.PROPERTY_PROTOTYPE\r\n ? prototype.parent.parent\r\n : prototype.parent;\r\n var resolvedTypeArguments: Type[] | null = null;\r\n\r\n // Resolve type arguments if generic\r\n if (prototype.is(CommonFlags.GENERIC)) {\r\n\r\n // If this is an instance method, first apply the class's type arguments\r\n if (prototype.is(CommonFlags.INSTANCE)) {\r\n assert(actualParent.kind == ElementKind.CLASS);\r\n let classTypeArguments = (actualParent).typeArguments;\r\n if (classTypeArguments) {\r\n let typeParameterNodes = assert((actualParent).prototype.typeParameterNodes);\r\n let numClassTypeArguments = classTypeArguments.length;\r\n assert(numClassTypeArguments == typeParameterNodes.length);\r\n for (let i = 0; i < numClassTypeArguments; ++i) {\r\n contextualTypeArguments.set(\r\n typeParameterNodes[i].name.text,\r\n classTypeArguments[i]\r\n );\r\n }\r\n }\r\n }\r\n\r\n resolvedTypeArguments = this.resolveTypeArguments( // reports\r\n assert(prototype.typeParameterNodes),\r\n typeArgumentNodes,\r\n context,\r\n contextualTypeArguments,\r\n reportNode,\r\n reportMode\r\n );\r\n if (!resolvedTypeArguments) return null;\r\n\r\n // Otherwise make sure that no type arguments have been specified\r\n } else {\r\n if (typeArgumentNodes !== null && typeArgumentNodes.length) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n return null;\r\n }\r\n }\r\n\r\n // Continue with concrete types\r\n return this.resolveFunction(\r\n prototype,\r\n resolvedTypeArguments,\r\n contextualTypeArguments,\r\n reportMode\r\n );\r\n }\r\n\r\n /** Resolves a class prototype using the specified concrete type arguments. */\r\n resolveClass(\r\n /** The prototype of the class. */\r\n prototype: ClassPrototype,\r\n /** Concrete type arguments. */\r\n typeArguments: Type[] | null,\r\n /** Type arguments inherited through context, i.e. `T`. */\r\n contextualTypeArguments: Map = makeMap(),\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Class | null {\r\n var instanceKey = typeArguments ? typesToString(typeArguments) : \"\";\r\n\r\n // Check if this exact instance has already been resolved\r\n var instance = prototype.getResolvedInstance(instanceKey);\r\n if (instance) return instance;\r\n\r\n // Insert contextual type arguments for this operation. Internally, this method is always\r\n // called with matching type parameter / argument counts.\r\n if (typeArguments) {\r\n let typeParameterNodes = assert(prototype.typeParameterNodes);\r\n let numTypeParameters = typeParameterNodes.length;\r\n let numTypeArguments = typeArguments.length;\r\n assert(numTypeArguments == numTypeParameters);\r\n for (let i = 0; i < numTypeArguments; ++i) {\r\n contextualTypeArguments.set(typeParameterNodes[i].name.text, typeArguments[i]);\r\n }\r\n } else {\r\n let typeParameterNodes = prototype.typeParameterNodes;\r\n assert(!(typeParameterNodes && typeParameterNodes.length));\r\n }\r\n\r\n // Resolve base class if applicable\r\n var basePrototype = prototype.basePrototype;\r\n var baseClass: Class | null = null;\r\n if (basePrototype) {\r\n let extendsNode = assert(prototype.extendsNode); // must be present if it has a base prototype\r\n baseClass = this.resolveClassInclTypeArguments(\r\n basePrototype,\r\n extendsNode.typeArguments,\r\n prototype.parent, // relative to derived class\r\n makeMap(contextualTypeArguments), // don't inherit\r\n extendsNode,\r\n reportMode\r\n );\r\n if (!baseClass) return null;\r\n }\r\n\r\n // Construct the instance and remember that it has been resolved already\r\n var nameInclTypeParamters = prototype.name;\r\n if (instanceKey.length) nameInclTypeParamters += \"<\" + instanceKey + \">\";\r\n instance = new Class(nameInclTypeParamters, prototype, typeArguments, baseClass);\r\n instance.contextualTypeArguments = contextualTypeArguments;\r\n prototype.setResolvedInstance(instanceKey, instance);\r\n\r\n // Inherit base class members and set up the initial memory offset for own fields\r\n var memoryOffset: u32 = 0;\r\n if (baseClass) {\r\n let baseMembers = baseClass.members;\r\n if (baseMembers) {\r\n let instanceMembers = instance.members;\r\n if (!instanceMembers) instance.members = instanceMembers = new Map();\r\n for (let [baseMemberName, baseMember] of baseMembers) {\r\n instanceMembers.set(baseMemberName, baseMember);\r\n }\r\n }\r\n memoryOffset = baseClass.currentMemoryOffset;\r\n }\r\n\r\n // Resolve instance members\r\n var instanceMemberPrototypes = prototype.instanceMembers;\r\n if (instanceMemberPrototypes) {\r\n for (let member of instanceMemberPrototypes.values()) {\r\n switch (member.kind) {\r\n\r\n // Lay out fields in advance\r\n case ElementKind.FIELD_PROTOTYPE: {\r\n let instanceMembers = instance.members;\r\n if (!instanceMembers) instance.members = instanceMembers = new Map();\r\n else if (instanceMembers.has(member.name)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n (member).identifierNode.range,\r\n member.name\r\n );\r\n break;\r\n }\r\n let fieldTypeNode = (member).typeNode;\r\n let fieldType: Type | null = null;\r\n // TODO: handle duplicate non-private fields specifically?\r\n if (!fieldTypeNode) {\r\n if (baseClass) {\r\n let baseMembers = baseClass.members;\r\n if (baseMembers && baseMembers.has((member).name)) {\r\n let baseField = baseMembers.get((member).name)!;\r\n if (!baseField.is(CommonFlags.PRIVATE)) {\r\n assert(baseField.kind == ElementKind.FIELD);\r\n fieldType = (baseField).type;\r\n }\r\n }\r\n }\r\n if (!fieldType) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Type_expected,\r\n (member).identifierNode.range.atEnd\r\n );\r\n }\r\n }\r\n } else {\r\n fieldType = this.resolveType(\r\n fieldTypeNode,\r\n prototype.parent, // relative to class\r\n instance.contextualTypeArguments,\r\n reportMode\r\n );\r\n }\r\n if (!fieldType) break; // did report above\r\n let fieldInstance = new Field(member, instance, fieldType);\r\n assert(isPowerOf2(fieldType.byteSize));\r\n let mask = fieldType.byteSize - 1;\r\n if (memoryOffset & mask) memoryOffset = (memoryOffset | mask) + 1;\r\n fieldInstance.memoryOffset = memoryOffset;\r\n memoryOffset += fieldType.byteSize;\r\n instance.add(member.name, fieldInstance); // reports\r\n break;\r\n }\r\n case ElementKind.FUNCTION_PROTOTYPE: {\r\n let boundPrototype = (member).toBound(instance);\r\n instance.add(boundPrototype.name, boundPrototype); // reports\r\n break;\r\n }\r\n case ElementKind.PROPERTY_PROTOTYPE: {\r\n let propertyInstance = new Property(member, instance);\r\n let getterPrototype = (member).getterPrototype;\r\n if (getterPrototype) {\r\n let getterInstance = this.resolveFunction(\r\n getterPrototype.toBound(instance),\r\n null,\r\n makeMap(instance.contextualTypeArguments),\r\n reportMode\r\n );\r\n if (getterInstance) {\r\n propertyInstance.getterInstance = getterInstance;\r\n propertyInstance.setType(getterInstance.signature.returnType);\r\n }\r\n }\r\n let setterPrototype = (member).setterPrototype;\r\n if (setterPrototype) {\r\n let setterInstance = this.resolveFunction(\r\n setterPrototype.toBound(instance),\r\n null,\r\n makeMap(instance.contextualTypeArguments),\r\n reportMode\r\n );\r\n if (setterInstance) {\r\n propertyInstance.setterInstance = setterInstance;\r\n if (!propertyInstance.is(CommonFlags.RESOLVED)) {\r\n assert(setterInstance.signature.parameterTypes.length == 1);\r\n propertyInstance.setType(setterInstance.signature.parameterTypes[0]);\r\n }\r\n }\r\n }\r\n instance.add(propertyInstance.name, propertyInstance); // reports\r\n break;\r\n }\r\n default: assert(false);\r\n }\r\n }\r\n }\r\n\r\n // Finalize memory offset\r\n instance.currentMemoryOffset = memoryOffset;\r\n\r\n // Link _own_ constructor if present\r\n {\r\n let ctorPrototype = instance.lookupInSelf(CommonSymbols.constructor);\r\n if (ctorPrototype && ctorPrototype.parent === instance) {\r\n assert(ctorPrototype.kind == ElementKind.FUNCTION_PROTOTYPE);\r\n let ctorInstance = this.resolveFunction(\r\n ctorPrototype,\r\n null,\r\n instance.contextualTypeArguments,\r\n reportMode\r\n );\r\n if (ctorInstance) instance.constructorInstance = ctorInstance;\r\n }\r\n }\r\n\r\n // Fully resolve operator overloads (don't have type parameters on their own)\r\n for (let [kind, overloadPrototype] of prototype.overloadPrototypes) {\r\n assert(kind != OperatorKind.INVALID);\r\n let operatorInstance: Function | null;\r\n if (overloadPrototype.is(CommonFlags.INSTANCE)) {\r\n let boundPrototype = overloadPrototype.toBound(instance);\r\n operatorInstance = this.resolveFunction(\r\n boundPrototype,\r\n null,\r\n makeMap(),\r\n reportMode\r\n );\r\n } else {\r\n operatorInstance = this.resolveFunction(\r\n overloadPrototype,\r\n null,\r\n makeMap(),\r\n reportMode\r\n );\r\n }\r\n if (!operatorInstance) continue;\r\n let overloads = instance.overloads;\r\n if (!overloads) instance.overloads = overloads = new Map();\r\n overloads.set(kind, operatorInstance);\r\n }\r\n return instance;\r\n }\r\n\r\n /** Resolves a class prototype by first resolving the specified type arguments. */\r\n resolveClassInclTypeArguments(\r\n /** The prototype of the class. */\r\n prototype: ClassPrototype,\r\n /** Type argument nodes provided. */\r\n typeArgumentNodes: CommonTypeNode[] | null,\r\n /** Relative context. Type arguments are resolved from here. */\r\n context: Element,\r\n /** Type arguments inherited through context, i.e. `T`. */\r\n contextualTypeArguments: Map,\r\n /** The node to use when reporting intermediate errors. */\r\n reportNode: Node,\r\n /** How to proceed with eventualy diagnostics. */\r\n reportMode: ReportMode = ReportMode.REPORT\r\n ): Class | null {\r\n var resolvedTypeArguments: Type[] | null = null;\r\n\r\n // Resolve type arguments if generic\r\n if (prototype.is(CommonFlags.GENERIC)) {\r\n resolvedTypeArguments = this.resolveTypeArguments( // reports\r\n assert(prototype.typeParameterNodes), // must be present if generic\r\n typeArgumentNodes,\r\n context,\r\n contextualTypeArguments,\r\n reportNode,\r\n reportMode\r\n );\r\n if (!resolvedTypeArguments) return null;\r\n\r\n // Otherwise make sure that no type arguments have been specified\r\n } else {\r\n if (typeArgumentNodes !== null && typeArgumentNodes.length) {\r\n if (reportMode == ReportMode.REPORT) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.range, prototype.internalName\r\n );\r\n }\r\n return null;\r\n }\r\n }\r\n\r\n // Continue with concrete types\r\n return this.resolveClass(\r\n prototype,\r\n resolvedTypeArguments,\r\n contextualTypeArguments,\r\n reportMode\r\n );\r\n }\r\n}\r\n","/**\r\n * A control flow analyzer.\r\n * @module flow\r\n *//***/\r\n\r\nimport {\r\n Type,\r\n TypeFlags,\r\n TypeKind\r\n} from \"./types\";\r\n\r\nimport {\r\n Local,\r\n Function,\r\n Element,\r\n ElementKind,\r\n Global\r\n} from \"./program\";\r\n\r\nimport {\r\n NativeType,\r\n ExpressionId,\r\n ExpressionRef,\r\n\r\n getExpressionId,\r\n getLocalGetIndex,\r\n isLocalTee,\r\n getLocalSetValue,\r\n getGlobalGetName,\r\n getBinaryOp,\r\n BinaryOp,\r\n getBinaryLeft,\r\n getConstValueI32,\r\n getBinaryRight,\r\n getUnaryOp,\r\n UnaryOp,\r\n getExpressionType,\r\n getConstValueI64Low,\r\n getConstValueF32,\r\n getConstValueF64,\r\n getLoadBytes,\r\n isLoadSigned,\r\n getBlockName,\r\n getBlockChildCount,\r\n getBlockChild,\r\n getIfTrue,\r\n getIfFalse,\r\n getSelectThen,\r\n getSelectElse,\r\n getCallTarget,\r\n getLocalSetIndex,\r\n getIfCondition,\r\n getConstValueI64High,\r\n getUnaryValue,\r\n getCallOperand,\r\n traverse\r\n} from \"./module\";\r\n\r\nimport {\r\n CommonFlags\r\n} from \"./common\";\r\n\r\nimport {\r\n DiagnosticCode\r\n} from \"./diagnostics\";\r\n\r\nimport {\r\n Node\r\n} from \"./ast\";\r\n\r\n/** Control flow flags indicating specific conditions. */\r\nexport const enum FlowFlags {\r\n /** No specific conditions. */\r\n NONE = 0,\r\n\r\n // categorical\r\n\r\n /** This flow returns. */\r\n RETURNS = 1 << 0,\r\n /** This flow returns a wrapped value. */\r\n RETURNS_WRAPPED = 1 << 1,\r\n /** This flow returns a non-null value. */\r\n RETURNS_NONNULL = 1 << 2,\r\n /** This flow throws. */\r\n THROWS = 1 << 3,\r\n /** This flow breaks. */\r\n BREAKS = 1 << 4,\r\n /** This flow continues. */\r\n CONTINUES = 1 << 5,\r\n /** This flow allocates. Constructors only. */\r\n ALLOCATES = 1 << 6,\r\n /** This flow calls super. Constructors only. */\r\n CALLS_SUPER = 1 << 7,\r\n\r\n // conditional\r\n\r\n /** This flow conditionally returns in a child flow. */\r\n CONDITIONALLY_RETURNS = 1 << 8,\r\n /** This flow conditionally throws in a child flow. */\r\n CONDITIONALLY_THROWS = 1 << 9,\r\n /** This flow conditionally breaks in a child flow. */\r\n CONDITIONALLY_BREAKS = 1 << 10,\r\n /** This flow conditionally continues in a child flow. */\r\n CONDITIONALLY_CONTINUES = 1 << 11,\r\n /** This flow conditionally allocates in a child flow. Constructors only. */\r\n CONDITIONALLY_ALLOCATES = 1 << 12,\r\n\r\n // special\r\n\r\n /** This is an inlining flow. */\r\n INLINE_CONTEXT = 1 << 13,\r\n /** This is a flow with explicitly disabled bounds checking. */\r\n UNCHECKED_CONTEXT = 1 << 14,\r\n\r\n // masks\r\n\r\n /** Any terminating flag. */\r\n ANY_TERMINATING = FlowFlags.RETURNS\r\n | FlowFlags.THROWS\r\n | FlowFlags.BREAKS\r\n | FlowFlags.CONTINUES,\r\n\r\n /** Any categorical flag. */\r\n ANY_CATEGORICAL = FlowFlags.RETURNS\r\n | FlowFlags.RETURNS_WRAPPED\r\n | FlowFlags.RETURNS_NONNULL\r\n | FlowFlags.THROWS\r\n | FlowFlags.BREAKS\r\n | FlowFlags.CONTINUES\r\n | FlowFlags.ALLOCATES\r\n | FlowFlags.CALLS_SUPER,\r\n\r\n /** Any conditional flag. */\r\n ANY_CONDITIONAL = FlowFlags.CONDITIONALLY_RETURNS\r\n | FlowFlags.CONDITIONALLY_THROWS\r\n | FlowFlags.CONDITIONALLY_BREAKS\r\n | FlowFlags.CONDITIONALLY_CONTINUES\r\n | FlowFlags.CONDITIONALLY_ALLOCATES\r\n}\r\n\r\n/** Flags indicating the current state of a local. */\r\nexport enum LocalFlags {\r\n /** No specific conditions. */\r\n NONE = 0,\r\n\r\n /** Local is constant. */\r\n CONSTANT = 1 << 0,\r\n /** Local is properly wrapped. Relevant for small integers. */\r\n WRAPPED = 1 << 1,\r\n /** Local is non-null. */\r\n NONNULL = 1 << 2,\r\n /** Local is read from. */\r\n READFROM = 1 << 3,\r\n /** Local is written to. */\r\n WRITTENTO = 1 << 4,\r\n /** Local is retained. */\r\n RETAINED = 1 << 5,\r\n\r\n /** Local is conditionally read from. */\r\n CONDITIONALLY_READFROM = 1 << 6,\r\n /** Local is conditionally written to. */\r\n CONDITIONALLY_WRITTENTO = 1 << 7,\r\n /** Local must be conditionally retained. */\r\n CONDITIONALLY_RETAINED = 1 << 8,\r\n\r\n /** Any categorical flag. */\r\n ANY_CATEGORICAL = CONSTANT\r\n | WRAPPED\r\n | NONNULL\r\n | READFROM\r\n | WRITTENTO\r\n | RETAINED,\r\n\r\n /** Any conditional flag. */\r\n ANY_CONDITIONAL = RETAINED\r\n | CONDITIONALLY_READFROM\r\n | CONDITIONALLY_WRITTENTO\r\n | CONDITIONALLY_RETAINED,\r\n\r\n /** Any retained flag. */\r\n ANY_RETAINED = RETAINED\r\n | CONDITIONALLY_RETAINED\r\n}\r\nexport namespace LocalFlags {\r\n export function join(left: LocalFlags, right: LocalFlags): LocalFlags {\r\n return ((left & LocalFlags.ANY_CATEGORICAL) & (right & LocalFlags.ANY_CATEGORICAL))\r\n | (left & LocalFlags.ANY_CONDITIONAL) | (right & LocalFlags.ANY_CONDITIONAL);\r\n }\r\n}\r\n\r\n/** Flags indicating the current state of a field. */\r\nexport enum FieldFlags {\r\n /** No specific conditions. */\r\n NONE = 0,\r\n\r\n /** Field is initialized. Relevant in constructors. */\r\n INITIALIZED = 1 << 0,\r\n /** Field is conditionally initialized. Relevant in constructors. */\r\n CONDITIONALLY_INITIALIZED = 1 << 1,\r\n\r\n /** Any categorical flag. */\r\n ANY_CATEGORICAL = INITIALIZED,\r\n\r\n /** Any conditional flag. */\r\n ANY_CONDITIONAL = CONDITIONALLY_INITIALIZED\r\n}\r\nexport namespace FieldFlags {\r\n export function join(left: FieldFlags, right: FieldFlags): FieldFlags {\r\n return ((left & FieldFlags.ANY_CATEGORICAL) & (right & FieldFlags.ANY_CATEGORICAL))\r\n | (left & FieldFlags.ANY_CONDITIONAL) | (right & FieldFlags.ANY_CONDITIONAL);\r\n }\r\n}\r\n\r\n/** A control flow evaluator. */\r\nexport class Flow {\r\n\r\n /** Parent flow. */\r\n parent: Flow | null;\r\n /** Flow flags indicating specific conditions. */\r\n flags: FlowFlags;\r\n /** Function this flow belongs to. */\r\n parentFunction: Function;\r\n /** The label we break to when encountering a continue statement. */\r\n continueLabel: string | null;\r\n /** The label we break to when encountering a break statement. */\r\n breakLabel: string | null;\r\n /** The current return type. */\r\n returnType: Type;\r\n /** The current contextual type arguments. */\r\n contextualTypeArguments: Map | null;\r\n /** Scoped local variables. */\r\n scopedLocals: Map | null = null;\r\n /** Local flags. */\r\n localFlags: LocalFlags[];\r\n /** Field flags. Relevant in constructors. */\r\n fieldFlags: Map | null = null;\r\n /** Function being inlined, when inlining. */\r\n inlineFunction: Function | null;\r\n /** The label we break to when encountering a return statement, when inlining. */\r\n inlineReturnLabel: string | null;\r\n\r\n /** Creates the parent flow of the specified function. */\r\n static create(parentFunction: Function): Flow {\r\n var flow = new Flow();\r\n flow.parent = null;\r\n flow.flags = FlowFlags.NONE;\r\n flow.parentFunction = parentFunction;\r\n flow.continueLabel = null;\r\n flow.breakLabel = null;\r\n flow.returnType = parentFunction.signature.returnType;\r\n flow.contextualTypeArguments = parentFunction.contextualTypeArguments;\r\n flow.localFlags = [];\r\n flow.inlineFunction = null;\r\n flow.inlineReturnLabel = null;\r\n return flow;\r\n }\r\n\r\n /** Creates an inline flow within `parentFunction`. */\r\n static createInline(parentFunction: Function, inlineFunction: Function): Flow {\r\n var flow = Flow.create(parentFunction);\r\n flow.set(FlowFlags.INLINE_CONTEXT);\r\n flow.inlineFunction = inlineFunction;\r\n flow.inlineReturnLabel = inlineFunction.internalName + \"|inlined.\" + (inlineFunction.nextInlineId++).toString(10);\r\n flow.returnType = inlineFunction.signature.returnType;\r\n flow.contextualTypeArguments = inlineFunction.contextualTypeArguments;\r\n return flow;\r\n }\r\n\r\n private constructor() { }\r\n\r\n /** Gets the actual function being compiled, The inlined function when inlining, otherwise the parent function. */\r\n get actualFunction(): Function {\r\n return this.inlineFunction || this.parentFunction;\r\n }\r\n\r\n /** Tests if this flow has the specified flag or flags. */\r\n is(flag: FlowFlags): bool { return (this.flags & flag) == flag; }\r\n /** Tests if this flow has one of the specified flags. */\r\n isAny(flag: FlowFlags): bool { return (this.flags & flag) != 0; }\r\n /** Sets the specified flag or flags. */\r\n set(flag: FlowFlags): void { this.flags |= flag; }\r\n /** Unsets the specified flag or flags. */\r\n unset(flag: FlowFlags): void { this.flags &= ~flag; }\r\n\r\n /** Forks this flow to a child flow. */\r\n fork(): Flow {\r\n var branch = new Flow();\r\n branch.parent = this;\r\n branch.flags = this.flags;\r\n branch.parentFunction = this.parentFunction;\r\n branch.continueLabel = this.continueLabel;\r\n branch.breakLabel = this.breakLabel;\r\n branch.returnType = this.returnType;\r\n branch.contextualTypeArguments = this.contextualTypeArguments;\r\n branch.localFlags = this.localFlags.slice();\r\n branch.inlineFunction = this.inlineFunction;\r\n branch.inlineReturnLabel = this.inlineReturnLabel;\r\n return branch;\r\n }\r\n\r\n /** Gets a free temporary local of the specified type. */\r\n getTempLocal(type: Type, except: Set | null = null): Local {\r\n var parentFunction = this.parentFunction;\r\n var temps: Local[] | null;\r\n switch (type.toNativeType()) {\r\n case NativeType.I32: { temps = parentFunction.tempI32s; break; }\r\n case NativeType.I64: { temps = parentFunction.tempI64s; break; }\r\n case NativeType.F32: { temps = parentFunction.tempF32s; break; }\r\n case NativeType.F64: { temps = parentFunction.tempF64s; break; }\r\n case NativeType.V128: { temps = parentFunction.tempV128s; break; }\r\n default: throw new Error(\"concrete type expected\");\r\n }\r\n var local: Local;\r\n if (except) {\r\n if (temps && temps.length) {\r\n for (let i = 0, k = temps.length; i < k; ++i) {\r\n if (!except.has(temps[i].index)) {\r\n local = temps[i];\r\n let k = temps.length - 1;\r\n while (i < k) unchecked(temps[i] = temps[i++ + 1]);\r\n temps.length = k;\r\n local.type = type;\r\n local.flags = CommonFlags.NONE;\r\n this.unsetLocalFlag(local.index, ~0);\r\n return local;\r\n }\r\n }\r\n }\r\n local = parentFunction.addLocal(type);\r\n } else {\r\n if (temps && temps.length) {\r\n local = temps.pop();\r\n local.type = type;\r\n local.flags = CommonFlags.NONE;\r\n } else {\r\n local = parentFunction.addLocal(type);\r\n }\r\n }\r\n this.unsetLocalFlag(local.index, ~0);\r\n return local;\r\n }\r\n\r\n /** Gets a local that sticks around until this flow is exited, and then released. */\r\n getAutoreleaseLocal(type: Type, except: Set | null = null): Local {\r\n var local = this.getTempLocal(type, except);\r\n local.set(CommonFlags.SCOPED);\r\n var scopedLocals = this.scopedLocals;\r\n if (!scopedLocals) this.scopedLocals = scopedLocals = new Map();\r\n scopedLocals.set(\"~auto\" + (this.parentFunction.nextAutoreleaseId++), local);\r\n this.setLocalFlag(local.index, LocalFlags.RETAINED);\r\n return local;\r\n }\r\n\r\n /** Frees the temporary local for reuse. */\r\n freeTempLocal(local: Local): void {\r\n if (local.is(CommonFlags.INLINED)) return;\r\n assert(local.index >= 0);\r\n var parentFunction = this.parentFunction;\r\n var temps: Local[];\r\n assert(local.type != null); // internal error\r\n switch ((local.type).toNativeType()) {\r\n case NativeType.I32: {\r\n temps = parentFunction.tempI32s || (parentFunction.tempI32s = []);\r\n break;\r\n }\r\n case NativeType.I64: {\r\n temps = parentFunction.tempI64s || (parentFunction.tempI64s = []);\r\n break;\r\n }\r\n case NativeType.F32: {\r\n temps = parentFunction.tempF32s || (parentFunction.tempF32s = []);\r\n break;\r\n }\r\n case NativeType.F64: {\r\n temps = parentFunction.tempF64s || (parentFunction.tempF64s = []);\r\n break;\r\n }\r\n case NativeType.V128: {\r\n temps = parentFunction.tempV128s || (parentFunction.tempV128s = []);\r\n break;\r\n }\r\n default: throw new Error(\"concrete type expected\");\r\n }\r\n assert(local.index >= 0);\r\n temps.push(local);\r\n }\r\n\r\n /** Gets and immediately frees a temporary local of the specified type. */\r\n getAndFreeTempLocal(type: Type, except: Set | null = null): Local {\r\n var local = this.getTempLocal(type, except);\r\n this.freeTempLocal(local);\r\n return local;\r\n }\r\n\r\n /** Gets the scoped local of the specified name. */\r\n getScopedLocal(name: string): Local | null {\r\n var scopedLocals = this.scopedLocals;\r\n if (scopedLocals && scopedLocals.has(name)) return scopedLocals.get(name);\r\n return null;\r\n }\r\n\r\n /** Adds a new scoped local of the specified name. */\r\n addScopedLocal(name: string, type: Type, except: Set | null = null): Local {\r\n var scopedLocal = this.getTempLocal(type, except);\r\n var scopedLocals = this.scopedLocals;\r\n if (!scopedLocals) this.scopedLocals = scopedLocals = new Map();\r\n else assert(!scopedLocals.has(name));\r\n scopedLocal.set(CommonFlags.SCOPED);\r\n scopedLocals.set(name, scopedLocal);\r\n return scopedLocal;\r\n }\r\n\r\n /** Adds a new scoped alias for the specified local. For example `super` aliased to the `this` local. */\r\n addScopedAlias(name: string, type: Type, index: i32, reportNode: Node | null = null): Local {\r\n if (!this.scopedLocals) this.scopedLocals = new Map();\r\n else {\r\n let existingLocal = this.scopedLocals.get(name);\r\n if (existingLocal) {\r\n if (reportNode) {\r\n this.parentFunction.program.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n reportNode.range\r\n );\r\n }\r\n return existingLocal;\r\n }\r\n }\r\n assert(index < this.parentFunction.localsByIndex.length);\r\n var scopedAlias = new Local(name, index, type, this.parentFunction);\r\n // not flagged as SCOPED as it must not be free'd when the flow is finalized\r\n this.scopedLocals.set(name, scopedAlias);\r\n return scopedAlias;\r\n }\r\n\r\n /** Frees this flow's scoped variables and returns its parent flow. */\r\n freeScopedLocals(): void {\r\n if (this.scopedLocals) {\r\n for (let scopedLocal of this.scopedLocals.values()) {\r\n if (scopedLocal.is(CommonFlags.SCOPED)) { // otherwise an alias\r\n this.freeTempLocal(scopedLocal);\r\n }\r\n }\r\n this.scopedLocals = null;\r\n }\r\n }\r\n\r\n /** Looks up the local of the specified name in the current scope. */\r\n lookupLocal(name: string): Local | null {\r\n var current: Flow | null = this;\r\n var scope: Map | null;\r\n do if ((scope = current.scopedLocals) && (scope.has(name))) return scope.get(name);\r\n while (current = current.parent);\r\n return this.parentFunction.localsByName.get(name);\r\n }\r\n\r\n /** Looks up the element with the specified name relative to the scope of this flow. */\r\n lookup(name: string): Element | null {\r\n var element = this.lookupLocal(name);\r\n if (element) return element;\r\n return this.actualFunction.lookup(name);\r\n }\r\n\r\n /** Tests if the local at the specified index has the specified flag or flags. */\r\n isLocalFlag(index: i32, flag: LocalFlags, defaultIfInlined: bool = true): bool {\r\n if (index < 0) return defaultIfInlined;\r\n var localFlags = this.localFlags;\r\n return index < localFlags.length && (unchecked(this.localFlags[index]) & flag) == flag;\r\n }\r\n\r\n /** Tests if the local at the specified index has any of the specified flags. */\r\n isAnyLocalFlag(index: i32, flag: LocalFlags, defaultIfInlined: bool = true): bool {\r\n if (index < 0) return defaultIfInlined;\r\n var localFlags = this.localFlags;\r\n return index < localFlags.length && (unchecked(this.localFlags[index]) & flag) != 0;\r\n }\r\n\r\n /** Sets the specified flag or flags on the local at the specified index. */\r\n setLocalFlag(index: i32, flag: LocalFlags): void {\r\n if (index < 0) return;\r\n var localFlags = this.localFlags;\r\n var flags = index < localFlags.length ? unchecked(localFlags[index]) : 0;\r\n this.localFlags[index] = flags | flag;\r\n }\r\n\r\n /** Unsets the specified flag or flags on the local at the specified index. */\r\n unsetLocalFlag(index: i32, flag: LocalFlags): void {\r\n if (index < 0) return;\r\n var localFlags = this.localFlags;\r\n var flags = index < localFlags.length ? unchecked(localFlags[index]) : 0;\r\n this.localFlags[index] = flags & ~flag;\r\n }\r\n\r\n /** Pushes a new break label to the stack, for example when entering a loop that one can `break` from. */\r\n pushBreakLabel(): string {\r\n var parentFunction = this.parentFunction;\r\n var id = parentFunction.nextBreakId++;\r\n var stack = parentFunction.breakStack;\r\n if (!stack) parentFunction.breakStack = [ id ];\r\n else stack.push(id);\r\n return parentFunction.breakLabel = id.toString(10);\r\n }\r\n\r\n /** Pops the most recent break label from the stack. */\r\n popBreakLabel(): void {\r\n var parentFunction = this.parentFunction;\r\n var stack = assert(parentFunction.breakStack);\r\n var length = assert(stack.length);\r\n stack.pop();\r\n if (length > 1) {\r\n parentFunction.breakLabel = stack[length - 2].toString(10);\r\n } else {\r\n parentFunction.breakLabel = null;\r\n parentFunction.breakStack = null;\r\n }\r\n }\r\n\r\n /** Inherits flags and local wrap states from the specified flow (e.g. blocks). */\r\n inherit(other: Flow): void {\r\n this.flags |= other.flags & (FlowFlags.ANY_CATEGORICAL | FlowFlags.ANY_CONDITIONAL);\r\n this.localFlags = other.localFlags; // no need to slice because other flow is finished\r\n }\r\n\r\n /** Inherits categorical flags as conditional flags from the specified flow (e.g. then without else). */\r\n inheritConditional(other: Flow): void {\r\n if (other.is(FlowFlags.RETURNS)) {\r\n this.set(FlowFlags.CONDITIONALLY_RETURNS);\r\n }\r\n if (other.is(FlowFlags.THROWS)) {\r\n this.set(FlowFlags.CONDITIONALLY_THROWS);\r\n }\r\n if (other.is(FlowFlags.BREAKS) && other.breakLabel == this.breakLabel) {\r\n this.set(FlowFlags.CONDITIONALLY_BREAKS);\r\n }\r\n if (other.is(FlowFlags.CONTINUES) && other.continueLabel == this.continueLabel) {\r\n this.set(FlowFlags.CONDITIONALLY_CONTINUES);\r\n }\r\n if (other.is(FlowFlags.ALLOCATES)) {\r\n this.set(FlowFlags.CONDITIONALLY_ALLOCATES);\r\n }\r\n var localFlags = other.localFlags;\r\n for (let i = 0, k = localFlags.length; i < k; ++i) {\r\n let flags = localFlags[i];\r\n if (flags & LocalFlags.RETAINED) this.setLocalFlag(i, LocalFlags.CONDITIONALLY_RETAINED);\r\n if (flags & LocalFlags.READFROM) this.setLocalFlag(i, LocalFlags.CONDITIONALLY_READFROM);\r\n if (flags & LocalFlags.WRITTENTO) this.setLocalFlag(i, LocalFlags.CONDITIONALLY_WRITTENTO);\r\n }\r\n }\r\n\r\n /** Inherits mutual flags and local wrap states from the specified flows (e.g. then with else). */\r\n inheritMutual(left: Flow, right: Flow): void {\r\n // categorical flags set in both arms\r\n this.set(left.flags & right.flags & FlowFlags.ANY_CATEGORICAL);\r\n\r\n // conditional flags set in at least one arm\r\n this.set(left.flags & FlowFlags.ANY_CONDITIONAL);\r\n this.set(right.flags & FlowFlags.ANY_CONDITIONAL);\r\n\r\n // categorical local flags set in both arms / conditional local flags set in at least one arm\r\n var leftLocalFlags = left.localFlags;\r\n var numLeftLocalFlags = leftLocalFlags.length;\r\n var rightLocalFlags = right.localFlags;\r\n var numRightLocalFlags = rightLocalFlags.length;\r\n var combinedFlags = new Array(max(numLeftLocalFlags, numRightLocalFlags));\r\n for (let i = 0; i < numLeftLocalFlags; ++i) {\r\n combinedFlags[i] = LocalFlags.join(\r\n unchecked(leftLocalFlags[i]),\r\n i < numRightLocalFlags\r\n ? unchecked(rightLocalFlags[i])\r\n : 0\r\n );\r\n }\r\n for (let i = numLeftLocalFlags; i < numRightLocalFlags; ++i) {\r\n combinedFlags[i] = LocalFlags.join(\r\n 0,\r\n unchecked(rightLocalFlags[i])\r\n );\r\n }\r\n this.localFlags = combinedFlags;\r\n }\r\n\r\n /** Checks if an expression of the specified type is known to be non-null, even if the type might be nullable. */\r\n isNonnull(expr: ExpressionRef, type: Type): bool {\r\n if (!type.is(TypeFlags.NULLABLE)) return true;\r\n // below, only teeLocal/getLocal are relevant because these are the only expressions that\r\n // depend on a dynamic nullable state (flag = LocalFlags.NONNULL), while everything else\r\n // has already been handled by the nullable type check above.\r\n switch (getExpressionId(expr)) {\r\n case ExpressionId.LocalSet: {\r\n if (!isLocalTee(expr)) break;\r\n let local = this.parentFunction.localsByIndex[getLocalSetIndex(expr)];\r\n return !local.type.is(TypeFlags.NULLABLE) || this.isLocalFlag(local.index, LocalFlags.NONNULL, false);\r\n }\r\n case ExpressionId.LocalGet: {\r\n let local = this.parentFunction.localsByIndex[getLocalGetIndex(expr)];\r\n return !local.type.is(TypeFlags.NULLABLE) || this.isLocalFlag(local.index, LocalFlags.NONNULL, false);\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n /** Updates local states to reflect that this branch is only taken when `expr` is true-ish. */\r\n inheritNonnullIfTrue(expr: ExpressionRef): void {\r\n // A: `expr` is true-ish -> Q: how did that happen?\r\n switch (getExpressionId(expr)) {\r\n case ExpressionId.LocalSet: {\r\n if (!isLocalTee(expr)) break;\r\n let local = this.parentFunction.localsByIndex[getLocalSetIndex(expr)];\r\n this.setLocalFlag(local.index, LocalFlags.NONNULL);\r\n this.inheritNonnullIfTrue(getLocalSetValue(expr)); // must have been true-ish as well\r\n break;\r\n }\r\n case ExpressionId.LocalGet: {\r\n let local = this.parentFunction.localsByIndex[getLocalGetIndex(expr)];\r\n this.setLocalFlag(local.index, LocalFlags.NONNULL);\r\n break;\r\n }\r\n case ExpressionId.If: {\r\n let ifFalse = getIfFalse(expr);\r\n if (!ifFalse) break;\r\n if (getExpressionId(ifFalse) == ExpressionId.Const) {\r\n // Logical AND: (if (condition ifTrue 0))\r\n // the only way this had become true is if condition and ifTrue are true\r\n if (\r\n (getExpressionType(ifFalse) == NativeType.I32 && getConstValueI32(ifFalse) == 0) ||\r\n (getExpressionType(ifFalse) == NativeType.I64 && getConstValueI64Low(ifFalse) == 0 && getConstValueI64High(ifFalse) == 0)\r\n ) {\r\n this.inheritNonnullIfTrue(getIfCondition(expr));\r\n this.inheritNonnullIfTrue(getIfTrue(expr));\r\n }\r\n }\r\n break;\r\n }\r\n case ExpressionId.Unary: {\r\n switch (getUnaryOp(expr)) {\r\n case UnaryOp.EqzI32:\r\n case UnaryOp.EqzI64: {\r\n this.inheritNonnullIfFalse(getUnaryValue(expr)); // !value -> value must have been false\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n case ExpressionId.Binary: {\r\n switch (getBinaryOp(expr)) {\r\n case BinaryOp.EqI32: {\r\n let left = getBinaryLeft(expr);\r\n let right = getBinaryRight(expr);\r\n if (getExpressionId(left) == ExpressionId.Const && getConstValueI32(left) != 0) {\r\n this.inheritNonnullIfTrue(right); // TRUE == right -> right must have been true\r\n } else if (getExpressionId(right) == ExpressionId.Const && getConstValueI32(right) != 0) {\r\n this.inheritNonnullIfTrue(left); // left == TRUE -> left must have been true\r\n }\r\n break;\r\n }\r\n case BinaryOp.EqI64: {\r\n let left = getBinaryLeft(expr);\r\n let right = getBinaryRight(expr);\r\n if (getExpressionId(left) == ExpressionId.Const && (getConstValueI64Low(left) != 0 || getConstValueI64High(left) != 0)) {\r\n this.inheritNonnullIfTrue(right); // TRUE == right -> right must have been true\r\n } else if (getExpressionId(right) == ExpressionId.Const && (getConstValueI64Low(right) != 0 && getConstValueI64High(right) != 0)) {\r\n this.inheritNonnullIfTrue(left); // left == TRUE -> left must have been true\r\n }\r\n break;\r\n }\r\n case BinaryOp.NeI32: {\r\n let left = getBinaryLeft(expr);\r\n let right = getBinaryRight(expr);\r\n if (getExpressionId(left) == ExpressionId.Const && getConstValueI32(left) == 0) {\r\n this.inheritNonnullIfTrue(right); // FALSE != right -> right must have been true\r\n } else if (getExpressionId(right) == ExpressionId.Const && getConstValueI32(right) == 0) {\r\n this.inheritNonnullIfTrue(left); // left != FALSE -> left must have been true\r\n }\r\n break;\r\n }\r\n case BinaryOp.NeI64: {\r\n let left = getBinaryLeft(expr);\r\n let right = getBinaryRight(expr);\r\n if (getExpressionId(left) == ExpressionId.Const && getConstValueI64Low(left) == 0 && getConstValueI64High(left) == 0) {\r\n this.inheritNonnullIfTrue(right); // FALSE != right -> right must have been true\r\n } else if (getExpressionId(right) == ExpressionId.Const && getConstValueI64Low(right) == 0 && getConstValueI64High(right) == 0) {\r\n this.inheritNonnullIfTrue(left); // left != FALSE -> left must have been true\r\n }\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n case ExpressionId.Call: {\r\n let name = getCallTarget(expr);\r\n let program = this.parentFunction.program;\r\n switch (name) {\r\n case program.retainInstance.internalName: {\r\n this.inheritNonnullIfTrue(getCallOperand(expr, 0));\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n\r\n /** Updates local states to reflect that this branch is only taken when `expr` is false-ish. */\r\n inheritNonnullIfFalse(expr: ExpressionRef): void {\r\n // A: `expr` is false-ish -> Q: how did that happen?\r\n switch (getExpressionId(expr)) {\r\n case ExpressionId.Unary: {\r\n switch (getUnaryOp(expr)) {\r\n case UnaryOp.EqzI32:\r\n case UnaryOp.EqzI64: {\r\n this.inheritNonnullIfTrue(getUnaryValue(expr)); // !value -> value must have been true\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n case ExpressionId.If: {\r\n let ifTrue = getIfTrue(expr);\r\n if (getExpressionId(ifTrue) == ExpressionId.Const) {\r\n let ifFalse = getIfFalse(expr);\r\n if (!ifFalse) break;\r\n // Logical OR: (if (condition 1 ifFalse))\r\n // the only way this had become false is if condition and ifFalse are false\r\n if (\r\n (getExpressionType(ifTrue) == NativeType.I32 && getConstValueI32(ifTrue) != 0) ||\r\n (getExpressionType(ifTrue) == NativeType.I64 && (getConstValueI64Low(ifTrue) != 0 || getConstValueI64High(ifTrue) != 0))\r\n ) {\r\n this.inheritNonnullIfFalse(getIfCondition(expr));\r\n this.inheritNonnullIfFalse(getIfFalse(expr));\r\n }\r\n\r\n }\r\n break;\r\n }\r\n case ExpressionId.Binary: {\r\n switch (getBinaryOp(expr)) {\r\n // remember: we want to know how the _entire_ expression became FALSE (!)\r\n case BinaryOp.EqI32: {\r\n let left = getBinaryLeft(expr);\r\n let right = getBinaryRight(expr);\r\n if (getExpressionId(left) == ExpressionId.Const && getConstValueI32(left) == 0) {\r\n this.inheritNonnullIfTrue(right); // FALSE == right -> right must have been true\r\n } else if (getExpressionId(right) == ExpressionId.Const && getConstValueI32(right) == 0) {\r\n this.inheritNonnullIfTrue(left); // left == FALSE -> left must have been true\r\n }\r\n break;\r\n }\r\n case BinaryOp.EqI64: {\r\n let left = getBinaryLeft(expr);\r\n let right = getBinaryRight(expr);\r\n if (getExpressionId(left) == ExpressionId.Const && getConstValueI64Low(left) == 0 && getConstValueI64High(left) == 0) {\r\n this.inheritNonnullIfTrue(right); // FALSE == right -> right must have been true\r\n } else if (getExpressionId(right) == ExpressionId.Const && getConstValueI64Low(right) == 0 && getConstValueI64High(right) == 0) {\r\n this.inheritNonnullIfTrue(left); // left == FALSE -> left must have been true\r\n }\r\n break;\r\n }\r\n case BinaryOp.NeI32: {\r\n let left = getBinaryLeft(expr);\r\n let right = getBinaryRight(expr);\r\n if (getExpressionId(left) == ExpressionId.Const && getConstValueI32(left) != 0) {\r\n this.inheritNonnullIfTrue(right); // TRUE != right -> right must have been true\r\n } else if (getExpressionId(right) == ExpressionId.Const && getConstValueI32(right) != 0) {\r\n this.inheritNonnullIfTrue(left); // left != TRUE -> left must have been true\r\n }\r\n break;\r\n }\r\n case BinaryOp.NeI64: {\r\n let left = getBinaryLeft(expr);\r\n let right = getBinaryRight(expr);\r\n if (getExpressionId(left) == ExpressionId.Const && (getConstValueI64Low(left) != 0 || getConstValueI64High(left) != 0)) {\r\n this.inheritNonnullIfTrue(right); // TRUE != right -> right must have been true for this to become false\r\n } else if (getExpressionId(right) == ExpressionId.Const && (getConstValueI64Low(right) != 0 || getConstValueI64High(right) != 0)) {\r\n this.inheritNonnullIfTrue(left); // left != TRUE -> left must have been true for this to become false\r\n }\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Tests if an expression can possibly overflow in the context of this flow. Assumes that the\r\n * expression might already have overflown and returns `false` only if the operation neglects\r\n * any possible combination of garbage bits being present.\r\n */\r\n canOverflow(expr: ExpressionRef, type: Type): bool {\r\n // TODO: the following catches most common and a few uncommon cases, but there are additional\r\n // opportunities here, obviously.\r\n assert(type != Type.void);\r\n\r\n // types other than i8, u8, i16, u16 and bool do not overflow\r\n if (!type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) return false;\r\n\r\n var operand: ExpressionRef;\r\n switch (getExpressionId(expr)) {\r\n\r\n // overflows if the local isn't wrapped or the conversion does\r\n case ExpressionId.LocalGet: {\r\n let local = this.parentFunction.localsByIndex[getLocalGetIndex(expr)];\r\n return !this.isLocalFlag(local.index, LocalFlags.WRAPPED, true)\r\n || canConversionOverflow(local.type, type);\r\n }\r\n\r\n // overflows if the value does\r\n case ExpressionId.LocalSet: { // tee\r\n assert(isLocalTee(expr));\r\n return this.canOverflow(getLocalSetValue(expr), type);\r\n }\r\n\r\n // overflows if the conversion does (globals are wrapped on set)\r\n case ExpressionId.GlobalGet: {\r\n // TODO: this is inefficient because it has to read a string\r\n let global = assert(this.parentFunction.program.elementsByName.get(assert(getGlobalGetName(expr))));\r\n assert(global.kind == ElementKind.GLOBAL);\r\n return canConversionOverflow(assert((global).type), type);\r\n }\r\n\r\n case ExpressionId.Binary: {\r\n switch (getBinaryOp(expr)) {\r\n\r\n // comparisons do not overflow (result is 0 or 1)\r\n case BinaryOp.EqI32:\r\n case BinaryOp.EqI64:\r\n case BinaryOp.EqF32:\r\n case BinaryOp.EqF64:\r\n case BinaryOp.NeI32:\r\n case BinaryOp.NeI64:\r\n case BinaryOp.NeF32:\r\n case BinaryOp.NeF64:\r\n case BinaryOp.LtI32:\r\n case BinaryOp.LtU32:\r\n case BinaryOp.LtI64:\r\n case BinaryOp.LtU64:\r\n case BinaryOp.LtF32:\r\n case BinaryOp.LtF64:\r\n case BinaryOp.LeI32:\r\n case BinaryOp.LeU32:\r\n case BinaryOp.LeI64:\r\n case BinaryOp.LeU64:\r\n case BinaryOp.LeF32:\r\n case BinaryOp.LeF64:\r\n case BinaryOp.GtI32:\r\n case BinaryOp.GtU32:\r\n case BinaryOp.GtI64:\r\n case BinaryOp.GtU64:\r\n case BinaryOp.GtF32:\r\n case BinaryOp.GtF64:\r\n case BinaryOp.GeI32:\r\n case BinaryOp.GeU32:\r\n case BinaryOp.GeI64:\r\n case BinaryOp.GeU64:\r\n case BinaryOp.GeF32:\r\n case BinaryOp.GeF64: return false;\r\n\r\n // result won't overflow if one side is 0 or if one side is 1 and the other wrapped\r\n case BinaryOp.MulI32: {\r\n return !(\r\n (\r\n getExpressionId(operand = getBinaryLeft(expr)) == ExpressionId.Const &&\r\n (\r\n getConstValueI32(operand) == 0 ||\r\n (\r\n getConstValueI32(operand) == 1 &&\r\n !this.canOverflow(getBinaryRight(expr), type)\r\n )\r\n )\r\n ) || (\r\n getExpressionId(operand = getBinaryRight(expr)) == ExpressionId.Const &&\r\n (\r\n getConstValueI32(operand) == 0 ||\r\n (\r\n getConstValueI32(operand) == 1 &&\r\n !this.canOverflow(getBinaryLeft(expr), type)\r\n )\r\n )\r\n )\r\n );\r\n }\r\n\r\n // result won't overflow if one side is a constant less than this type's mask or one side\r\n // is wrapped\r\n case BinaryOp.AndI32: {\r\n // note that computeSmallIntegerMask returns the mask minus the MSB for signed types\r\n // because signed value garbage bits must be guaranteed to be equal to the MSB.\r\n return !(\r\n (\r\n (\r\n getExpressionId(operand = getBinaryLeft(expr)) == ExpressionId.Const &&\r\n getConstValueI32(operand) <= type.computeSmallIntegerMask(Type.i32)\r\n ) || !this.canOverflow(operand, type)\r\n ) || (\r\n (\r\n getExpressionId(operand = getBinaryRight(expr)) == ExpressionId.Const &&\r\n getConstValueI32(operand) <= type.computeSmallIntegerMask(Type.i32)\r\n ) || !this.canOverflow(operand, type)\r\n )\r\n );\r\n }\r\n\r\n // overflows if the shift doesn't clear potential garbage bits\r\n case BinaryOp.ShlI32: {\r\n let shift = 32 - type.size;\r\n return getExpressionId(operand = getBinaryRight(expr)) != ExpressionId.Const\r\n || getConstValueI32(operand) < shift;\r\n }\r\n\r\n // overflows if the value does and the shift doesn't clear potential garbage bits\r\n case BinaryOp.ShrI32: {\r\n let shift = 32 - type.size;\r\n return this.canOverflow(getBinaryLeft(expr), type) && (\r\n getExpressionId(operand = getBinaryRight(expr)) != ExpressionId.Const ||\r\n getConstValueI32(operand) < shift\r\n );\r\n }\r\n\r\n // overflows if the shift does not clear potential garbage bits. if an unsigned value is\r\n // wrapped, it can't overflow.\r\n case BinaryOp.ShrU32: {\r\n let shift = 32 - type.size;\r\n return type.is(TypeFlags.SIGNED)\r\n ? !(\r\n getExpressionId(operand = getBinaryRight(expr)) == ExpressionId.Const &&\r\n getConstValueI32(operand) > shift // must clear MSB\r\n )\r\n : this.canOverflow(getBinaryLeft(expr), type) && !(\r\n getExpressionId(operand = getBinaryRight(expr)) == ExpressionId.Const &&\r\n getConstValueI32(operand) >= shift // can leave MSB\r\n );\r\n }\r\n\r\n // overflows if any side does\r\n case BinaryOp.DivU32:\r\n case BinaryOp.RemI32:\r\n case BinaryOp.RemU32: {\r\n return this.canOverflow(getBinaryLeft(expr), type)\r\n || this.canOverflow(getBinaryRight(expr), type);\r\n }\r\n }\r\n break;\r\n }\r\n\r\n case ExpressionId.Unary: {\r\n switch (getUnaryOp(expr)) {\r\n\r\n // comparisons do not overflow (result is 0 or 1)\r\n case UnaryOp.EqzI32:\r\n case UnaryOp.EqzI64: return false;\r\n\r\n // overflow if the maximum result (32) cannot be represented in the target type\r\n case UnaryOp.ClzI32:\r\n case UnaryOp.CtzI32:\r\n case UnaryOp.PopcntI32: return type.size < 7;\r\n }\r\n break;\r\n }\r\n\r\n // overflows if the value cannot be represented in the target type\r\n case ExpressionId.Const: {\r\n let value: i32 = 0;\r\n switch (getExpressionType(expr)) {\r\n case NativeType.I32: { value = getConstValueI32(expr); break; }\r\n case NativeType.I64: { value = getConstValueI64Low(expr); break; } // discards upper bits\r\n case NativeType.F32: { value = i32(getConstValueF32(expr)); break; }\r\n case NativeType.F64: { value = i32(getConstValueF64(expr)); break; }\r\n default: assert(false);\r\n }\r\n switch (type.kind) {\r\n case TypeKind.I8: return value < i8.MIN_VALUE || value > i8.MAX_VALUE;\r\n case TypeKind.I16: return value < i16.MIN_VALUE || value > i16.MAX_VALUE;\r\n case TypeKind.U8: return value < 0 || value > u8.MAX_VALUE;\r\n case TypeKind.U16: return value < 0 || value > u16.MAX_VALUE;\r\n case TypeKind.BOOL: return (value & ~1) != 0;\r\n }\r\n break;\r\n }\r\n\r\n // overflows if the conversion does\r\n case ExpressionId.Load: {\r\n let fromType: Type;\r\n let signed = isLoadSigned(expr);\r\n switch (getLoadBytes(expr)) {\r\n case 1: { fromType = signed ? Type.i8 : Type.u8; break; }\r\n case 2: { fromType = signed ? Type.i16 : Type.u16; break; }\r\n default: { fromType = signed ? Type.i32 : Type.u32; break; }\r\n }\r\n return canConversionOverflow(fromType, type);\r\n }\r\n\r\n // overflows if the result does, which is either\r\n // - the last expression of the block, by contract, if the block doesn't have a label\r\n // - the last expression or the value of an inner br if the block has a label (TODO)\r\n case ExpressionId.Block: {\r\n if (!getBlockName(expr)) {\r\n let size = assert(getBlockChildCount(expr));\r\n let last = getBlockChild(expr, size - 1);\r\n return this.canOverflow(last, type);\r\n }\r\n break;\r\n }\r\n\r\n // overflows if either side does\r\n case ExpressionId.If: {\r\n return this.canOverflow(getIfTrue(expr), type)\r\n || this.canOverflow(assert(getIfFalse(expr)), type);\r\n }\r\n\r\n // overflows if either side does\r\n case ExpressionId.Select: {\r\n return this.canOverflow(getSelectThen(expr), type)\r\n || this.canOverflow(getSelectElse(expr), type);\r\n }\r\n\r\n // overflows if the call does not return a wrapped value or the conversion does\r\n case ExpressionId.Call: {\r\n let program = this.parentFunction.program;\r\n let instancesByName = program.instancesByName;\r\n let instanceName = assert(getCallTarget(expr));\r\n if (instancesByName.has(instanceName)) {\r\n let instance = instancesByName.get(instanceName)!;\r\n assert(instance.kind == ElementKind.FUNCTION);\r\n let returnType = (instance).signature.returnType;\r\n return !(instance).flow.is(FlowFlags.RETURNS_WRAPPED)\r\n || canConversionOverflow(returnType, type);\r\n }\r\n return false; // assume no overflow for builtins\r\n }\r\n\r\n // doesn't technically overflow\r\n case ExpressionId.Unreachable: return false;\r\n }\r\n return true;\r\n }\r\n\r\n toString(): string {\r\n var levels = 0;\r\n var parent = this.parent;\r\n while (parent) {\r\n parent = parent.parent;\r\n ++levels;\r\n }\r\n return \"Flow(\" + this.actualFunction + \")[\" + levels.toString() + \"]\";\r\n }\r\n}\r\n\r\n/** Tests if a conversion from one type to another can technically overflow. */\r\nfunction canConversionOverflow(fromType: Type, toType: Type): bool {\r\n return !fromType.is(TypeFlags.INTEGER) // non-i32 locals or returns\r\n || fromType.size > toType.size\r\n || fromType.is(TypeFlags.SIGNED) != toType.is(TypeFlags.SIGNED);\r\n}\r\n\r\n/** Finds all indexes of locals used in the specified expression. */\r\nexport function findUsedLocals(expr: ExpressionRef, used: Set = new Set()): Set {\r\n traverse(expr, used, findUsedLocalsVisit);\r\n return used;\r\n}\r\n\r\n/** A visitor function for use with `traverse` that finds all indexes of used locals. */\r\nfunction findUsedLocalsVisit(expr: ExpressionRef, used: Set): void {\r\n switch (getExpressionId(expr)) {\r\n case ExpressionId.LocalGet: {\r\n used.add(getLocalGetIndex(expr));\r\n break;\r\n }\r\n case ExpressionId.LocalSet: {\r\n used.add(getLocalSetIndex(expr));\r\n // fall-through for value\r\n }\r\n default: traverse(expr, used, findUsedLocalsVisit);\r\n }\r\n}\r\n","/**\r\n * The AssemblyScript compiler.\r\n * @module compiler\r\n *//***/\r\n\r\nimport {\r\n BuiltinSymbols,\r\n compileCall as compileBuiltinCall,\r\n compileAbort,\r\n compileVisitGlobals,\r\n compileVisitMembers,\r\n compileRTTI,\r\n} from \"./builtins\";\r\n\r\nimport {\r\n DiagnosticCode,\r\n DiagnosticEmitter\r\n} from \"./diagnostics\";\r\n\r\nimport {\r\n Module,\r\n MemorySegment,\r\n ExpressionRef,\r\n UnaryOp,\r\n BinaryOp,\r\n NativeType,\r\n FunctionRef,\r\n ExpressionId,\r\n FunctionTypeRef,\r\n GlobalRef,\r\n getExpressionId,\r\n getExpressionType,\r\n getConstValueI32,\r\n getConstValueI64Low,\r\n getConstValueI64High,\r\n getConstValueF32,\r\n getConstValueF64,\r\n getBlockChildCount,\r\n getBlockChild,\r\n getBlockName,\r\n needsExplicitUnreachable,\r\n getLocalGetIndex,\r\n FeatureFlags,\r\n isLocalTee,\r\n getLocalSetIndex\r\n} from \"./module\";\r\n\r\nimport {\r\n CommonFlags,\r\n INSTANCE_DELIMITER,\r\n STATIC_DELIMITER,\r\n GETTER_PREFIX,\r\n SETTER_PREFIX,\r\n CommonSymbols,\r\n INDEX_SUFFIX,\r\n Feature,\r\n Target\r\n} from \"./common\";\r\n\r\nimport {\r\n Program,\r\n ClassPrototype,\r\n Class,\r\n Element,\r\n ElementKind,\r\n Enum,\r\n Field,\r\n FunctionPrototype,\r\n Function,\r\n FunctionTarget,\r\n Global,\r\n Local,\r\n EnumValue,\r\n Property,\r\n VariableLikeElement,\r\n ConstantValueKind,\r\n OperatorKind,\r\n DecoratorFlags,\r\n PropertyPrototype,\r\n File,\r\n mangleInternalName\r\n} from \"./program\";\r\n\r\nimport {\r\n FlowFlags,\r\n Flow,\r\n LocalFlags,\r\n findUsedLocals\r\n} from \"./flow\";\r\n\r\nimport {\r\n Resolver, ReportMode\r\n} from \"./resolver\";\r\n\r\nimport {\r\n Token,\r\n operatorTokenToString\r\n} from \"./tokenizer\";\r\n\r\nimport {\r\n Node,\r\n NodeKind,\r\n TypeNode,\r\n Range,\r\n DecoratorKind,\r\n AssertionKind,\r\n\r\n Statement,\r\n BlockStatement,\r\n BreakStatement,\r\n ClassDeclaration,\r\n ContinueStatement,\r\n DeclarationStatement,\r\n DoStatement,\r\n EmptyStatement,\r\n EnumDeclaration,\r\n ExportStatement,\r\n ExpressionStatement,\r\n FieldDeclaration,\r\n ForStatement,\r\n FunctionDeclaration,\r\n IfStatement,\r\n ImportStatement,\r\n InstanceOfExpression,\r\n InterfaceDeclaration,\r\n NamespaceDeclaration,\r\n ReturnStatement,\r\n SwitchStatement,\r\n ThrowStatement,\r\n TryStatement,\r\n VariableStatement,\r\n VoidStatement,\r\n WhileStatement,\r\n\r\n Expression,\r\n AssertionExpression,\r\n BinaryExpression,\r\n CallExpression,\r\n CommaExpression,\r\n ElementAccessExpression,\r\n FloatLiteralExpression,\r\n FunctionExpression,\r\n IdentifierExpression,\r\n IntegerLiteralExpression,\r\n LiteralExpression,\r\n LiteralKind,\r\n NewExpression,\r\n ObjectLiteralExpression,\r\n ParenthesizedExpression,\r\n PropertyAccessExpression,\r\n TernaryExpression,\r\n ArrayLiteralExpression,\r\n StringLiteralExpression,\r\n UnaryPostfixExpression,\r\n UnaryPrefixExpression,\r\n\r\n nodeIsConstantValue,\r\n findDecorator,\r\n isTypeOmitted,\r\n ExportDefaultStatement\r\n} from \"./ast\";\r\n\r\nimport {\r\n Type,\r\n TypeKind,\r\n TypeFlags,\r\n Signature,\r\n typesToNativeTypes\r\n} from \"./types\";\r\n\r\nimport {\r\n writeI8,\r\n writeI16,\r\n writeI32,\r\n writeI64,\r\n writeF32,\r\n writeF64,\r\n makeMap\r\n} from \"./util\";\r\n\r\n/** Compiler options. */\r\nexport class Options {\r\n\r\n /** WebAssembly target. Defaults to {@link Target.WASM32}. */\r\n target: Target = Target.WASM32;\r\n /** If true, replaces assertions with nops. */\r\n noAssert: bool = false;\r\n /** If true, imports the memory provided by the embedder. */\r\n importMemory: bool = false;\r\n /** If greater than zero, declare memory as shared by setting max memory to sharedMemory. */\r\n sharedMemory: i32 = 0;\r\n /** If true, imports the function table provided by the embedder. */\r\n importTable: bool = false;\r\n /** If true, generates information necessary for source maps. */\r\n sourceMap: bool = false;\r\n /** If true, generates an explicit start function. */\r\n explicitStart: bool = false;\r\n /** Static memory start offset. */\r\n memoryBase: i32 = 0;\r\n /** Global aliases. */\r\n globalAliases: Map | null = null;\r\n /** Additional features to activate. */\r\n features: Feature = Feature.NONE;\r\n\r\n /** Hinted optimize level. Not applied by the compiler itself. */\r\n optimizeLevelHint: i32 = 0;\r\n /** Hinted shrink level. Not applied by the compiler itself. */\r\n shrinkLevelHint: i32 = 0;\r\n\r\n /** Tests if the target is WASM64 or, otherwise, WASM32. */\r\n get isWasm64(): bool {\r\n return this.target == Target.WASM64;\r\n }\r\n\r\n /** Gets the unsigned size type matching the target. */\r\n get usizeType(): Type {\r\n return this.target == Target.WASM64 ? Type.usize64 : Type.usize32;\r\n }\r\n\r\n /** Gets the signed size type matching the target. */\r\n get isizeType(): Type {\r\n return this.target == Target.WASM64 ? Type.isize64 : Type.isize32;\r\n }\r\n\r\n /** Gets the native size type matching the target. */\r\n get nativeSizeType(): NativeType {\r\n return this.target == Target.WASM64 ? NativeType.I64 : NativeType.I32;\r\n }\r\n\r\n /** Tests if a specific feature is activated. */\r\n hasFeature(feature: Feature): bool {\r\n return (this.features & feature) != 0;\r\n }\r\n}\r\n\r\n/** Requests or indicates compilation conditions of statements and expressions. */\r\nexport const enum ContextualFlags {\r\n NONE = 0,\r\n\r\n /** Implicit conversion required. */\r\n IMPLICIT = 1 << 0,\r\n /** Explicit conversion required. */\r\n EXPLICIT = 1 << 1,\r\n /** Small integer wrap required. */\r\n WRAP = 1 << 2,\r\n\r\n /** Value is known to be immediately dropped. */\r\n WILL_DROP = 1 << 3,\r\n /** Value is known to be immediately assigned to a retaining target. */\r\n SKIP_AUTORELEASE = 1 << 4,\r\n /** Is the last statement in a function body. */\r\n LAST_IN_BODY = 1 << 5,\r\n /** Data can be compiled statically. */\r\n STATIC_CAPABLE = 1 << 6\r\n}\r\n\r\n/** Runtime features to be activated by the compiler. */\r\nexport const enum RuntimeFeatures {\r\n NONE = 0,\r\n /** Requires heap setup. */\r\n HEAP = 1 << 0,\r\n /** Requires runtime type information setup. */\r\n RTTI = 1 << 1,\r\n /** Requires the built-in globals visitor. */\r\n visitGlobals = 1 << 2,\r\n /** Requires the built-in members visitor. */\r\n visitMembers = 1 << 3\r\n}\r\n\r\n/** Compiler interface. */\r\nexport class Compiler extends DiagnosticEmitter {\r\n\r\n /** Program reference. */\r\n program: Program;\r\n /** Resolver reference. */\r\n resolver: Resolver;\r\n /** Provided options. */\r\n options: Options;\r\n /** Module instance being compiled. */\r\n module: Module;\r\n /** Current control flow. */\r\n currentFlow: Flow;\r\n /** Current inline functions stack. */\r\n currentInlineFunctions: Function[] = [];\r\n /** Current enum in compilation. */\r\n currentEnum: Enum | null = null;\r\n /** Current type in compilation. */\r\n currentType: Type = Type.void;\r\n /** Start function statements. */\r\n currentBody: ExpressionRef[];\r\n /** Counting memory offset. */\r\n memoryOffset: I64;\r\n /** Memory segments being compiled. */\r\n memorySegments: MemorySegment[] = [];\r\n /** Map of already compiled static string segments. */\r\n stringSegments: Map = new Map();\r\n /** Function table being compiled. */\r\n functionTable: string[] = [ \"null\" ];\r\n /** Argument count helper global. */\r\n argcVar: GlobalRef = 0;\r\n /** Argument count helper setter. */\r\n argcSet: FunctionRef = 0;\r\n /** Requires runtime features. */\r\n runtimeFeatures: RuntimeFeatures = RuntimeFeatures.NONE;\r\n /** Expressions known to have skipped an autorelease. Usually function returns. */\r\n skippedAutoreleases: Set = new Set();\r\n\r\n /** Compiles a {@link Program} to a {@link Module} using the specified options. */\r\n static compile(program: Program, options: Options | null = null): Module {\r\n return new Compiler(program, options).compile();\r\n }\r\n\r\n /** Constructs a new compiler for a {@link Program} using the specified options. */\r\n constructor(program: Program, options: Options | null = null) {\r\n super(program.diagnostics);\r\n this.program = program;\r\n this.resolver = program.resolver;\r\n if (!options) options = new Options();\r\n this.options = options;\r\n this.memoryOffset = i64_new(\r\n // leave space for `null`. also functions as a sentinel for erroneous stores at offset 0.\r\n // note that Binaryen's asm.js output utilizes the first 8 bytes for reinterpretations (#1547)\r\n max(options.memoryBase, 8)\r\n );\r\n this.module = Module.create();\r\n var featureFlags: BinaryenFeatureFlags = 0;\r\n if (this.options.hasFeature(Feature.THREADS)) featureFlags |= FeatureFlags.Atomics;\r\n if (this.options.hasFeature(Feature.MUTABLE_GLOBAL)) featureFlags |= FeatureFlags.MutableGloabls;\r\n // if (this.options.hasFeature(Feature.TRUNC_SAT)) featureFlags |= FeatureFlags.NontrappingFPToInt;\r\n if (this.options.hasFeature(Feature.SIMD)) featureFlags |= FeatureFlags.SIMD128;\r\n if (this.options.hasFeature(Feature.BULK_MEMORY)) featureFlags |= FeatureFlags.BulkMemory;\r\n if (this.options.hasFeature(Feature.SIGN_EXTENSION)) featureFlags |= FeatureFlags.SignExt;\r\n // if (this.options.hasFeature(Feature.EXCEPTION_HANDLING)) featureFlags |= FeatureFlags.ExceptionHandling;\r\n this.module.setFeatures(featureFlags);\r\n }\r\n\r\n /** Performs compilation of the underlying {@link Program} to a {@link Module}. */\r\n compile(): Module {\r\n var options = this.options;\r\n var module = this.module;\r\n var program = this.program;\r\n\r\n // initialize lookup maps, built-ins, imports, exports, etc.\r\n program.initialize(options);\r\n\r\n // set up the main start function\r\n var startFunctionInstance = program.makeNativeFunction(\"start\", new Signature([], Type.void));\r\n startFunctionInstance.internalName = \"start\";\r\n var startFunctionBody = new Array();\r\n this.currentFlow = startFunctionInstance.flow;\r\n this.currentBody = startFunctionBody;\r\n\r\n // add a mutable heap and rtti base dummies\r\n if (options.isWasm64) {\r\n module.addGlobal(BuiltinSymbols.heap_base, NativeType.I64, true, module.i64(0));\r\n module.addGlobal(BuiltinSymbols.rtti_base, NativeType.I64, true, module.i64(0));\r\n } else {\r\n module.addGlobal(BuiltinSymbols.heap_base, NativeType.I32, true, module.i32(0));\r\n module.addGlobal(BuiltinSymbols.rtti_base, NativeType.I32, true, module.i32(0));\r\n }\r\n\r\n // compile entry file(s) while traversing reachable elements\r\n var files = program.filesByName;\r\n for (let file of files.values()) {\r\n if (file.source.isEntry) {\r\n this.compileFile(file);\r\n this.compileExports(file);\r\n }\r\n }\r\n\r\n // compile the start function if not empty or explicitly requested\r\n var startIsEmpty = !startFunctionBody.length;\r\n var explicitStart = options.explicitStart;\r\n if (!startIsEmpty || explicitStart) {\r\n let signature = startFunctionInstance.signature;\r\n if (!startIsEmpty && explicitStart) {\r\n module.addGlobal(BuiltinSymbols.started, NativeType.I32, true, module.i32(0));\r\n startFunctionBody.unshift(\r\n module.if(\r\n module.global_get(BuiltinSymbols.started, NativeType.I32),\r\n module.return(),\r\n module.global_set(BuiltinSymbols.started, module.i32(1))\r\n )\r\n );\r\n }\r\n let funcRef = module.addFunction(\r\n startFunctionInstance.internalName,\r\n this.ensureFunctionType(\r\n signature.parameterTypes,\r\n signature.returnType,\r\n signature.thisType\r\n ),\r\n typesToNativeTypes(startFunctionInstance.additionalLocals),\r\n module.block(null, startFunctionBody)\r\n );\r\n startFunctionInstance.finalize(module, funcRef);\r\n if (!explicitStart) module.setStart(funcRef);\r\n else module.addFunctionExport(startFunctionInstance.internalName, \"__start\");\r\n }\r\n\r\n // compile runtime features\r\n if (this.runtimeFeatures & RuntimeFeatures.visitGlobals) compileVisitGlobals(this);\r\n if (this.runtimeFeatures & RuntimeFeatures.visitMembers) compileVisitMembers(this);\r\n module.removeGlobal(BuiltinSymbols.rtti_base);\r\n if (this.runtimeFeatures & RuntimeFeatures.RTTI) compileRTTI(this);\r\n\r\n // update the heap base pointer\r\n var memoryOffset = this.memoryOffset;\r\n memoryOffset = i64_align(memoryOffset, options.usizeType.byteSize);\r\n this.memoryOffset = memoryOffset;\r\n module.removeGlobal(BuiltinSymbols.heap_base);\r\n if (this.runtimeFeatures & RuntimeFeatures.HEAP) {\r\n if (options.isWasm64) {\r\n module.addGlobal(\r\n BuiltinSymbols.heap_base,\r\n NativeType.I64,\r\n false,\r\n module.i64(i64_low(memoryOffset), i64_high(memoryOffset))\r\n );\r\n } else {\r\n module.addGlobal(\r\n BuiltinSymbols.heap_base,\r\n NativeType.I32,\r\n false,\r\n module.i32(i64_low(memoryOffset))\r\n );\r\n }\r\n }\r\n\r\n // set up memory\r\n var isSharedMemory = options.hasFeature(Feature.THREADS) && options.sharedMemory > 0;\r\n module.setMemory(\r\n this.options.memoryBase /* is specified */ || this.memorySegments.length\r\n ? i64_low(i64_shr_u(i64_align(memoryOffset, 0x10000), i64_new(16, 0)))\r\n : 0,\r\n isSharedMemory ? options.sharedMemory : Module.UNLIMITED_MEMORY,\r\n this.memorySegments,\r\n options.target,\r\n \"memory\",\r\n isSharedMemory\r\n );\r\n\r\n // import memory if requested (default memory is named '0' by Binaryen)\r\n if (options.importMemory) module.addMemoryImport(\"0\", \"env\", \"memory\", isSharedMemory);\r\n\r\n // set up function table\r\n var functionTable = this.functionTable;\r\n module.setFunctionTable(functionTable.length, 0xffffffff, functionTable);\r\n module.addFunction(\"null\", this.ensureFunctionType(null, Type.void), null, module.block(null, []));\r\n\r\n // import table if requested (default table is named '0' by Binaryen)\r\n if (options.importTable) module.addTableImport(\"0\", \"env\", \"table\");\r\n\r\n // set up module exports\r\n for (let file of this.program.filesByName.values()) {\r\n if (file.source.isEntry) this.ensureModuleExports(file);\r\n }\r\n return module;\r\n }\r\n\r\n /** Applies the respective module exports for the specified file. */\r\n private ensureModuleExports(file: File): void {\r\n var members = file.exports;\r\n if (members) for (let [name, member] of members) this.ensureModuleExport(name, member);\r\n var exportsStar = file.exportsStar;\r\n if (exportsStar) {\r\n for (let i = 0, k = exportsStar.length; i < k; ++i) this.ensureModuleExports(exportsStar[i]);\r\n }\r\n }\r\n\r\n /** Applies the respective module export(s) for the specified element. */\r\n private ensureModuleExport(name: string, element: Element, prefix: string = \"\"): void {\r\n switch (element.kind) {\r\n\r\n // traverse instances\r\n case ElementKind.FUNCTION_PROTOTYPE: {\r\n let instances = (element).instances;\r\n if (instances) {\r\n for (let instance of instances.values()) {\r\n let instanceName = name;\r\n if (instance.is(CommonFlags.GENERIC)) {\r\n let fullName = instance.internalName;\r\n instanceName += fullName.substring(fullName.lastIndexOf(\"<\"));\r\n }\r\n this.ensureModuleExport(instanceName, instance, prefix);\r\n }\r\n }\r\n break;\r\n }\r\n case ElementKind.CLASS_PROTOTYPE: {\r\n let instances = (element).instances;\r\n if (instances) {\r\n for (let instance of instances.values()) {\r\n let instanceName = name;\r\n if (instance.is(CommonFlags.GENERIC)) {\r\n let fullName = instance.internalName;\r\n instanceName += fullName.substring(fullName.lastIndexOf(\"<\"));\r\n }\r\n this.ensureModuleExport(instanceName, instance, prefix);\r\n }\r\n }\r\n break;\r\n }\r\n case ElementKind.PROPERTY_PROTOTYPE: {\r\n let getter = (element).getterPrototype;\r\n let setter = (element).setterPrototype;\r\n if (getter) this.ensureModuleExport(GETTER_PREFIX + name, getter, prefix);\r\n if (setter) this.ensureModuleExport(SETTER_PREFIX + name, setter, prefix);\r\n break;\r\n }\r\n\r\n // export concrete elements\r\n case ElementKind.GLOBAL: {\r\n let isConst = element.is(CommonFlags.CONST) || element.is(CommonFlags.STATIC | CommonFlags.READONLY);\r\n if (!isConst && !this.options.hasFeature(Feature.MUTABLE_GLOBAL)) {\r\n this.error(\r\n DiagnosticCode.Cannot_export_a_mutable_global,\r\n (element).identifierNode.range\r\n );\r\n } else {\r\n this.module.addGlobalExport(element.internalName, prefix + name);\r\n }\r\n break;\r\n }\r\n case ElementKind.ENUMVALUE: {\r\n if (!(element).isImmutable && !this.options.hasFeature(Feature.MUTABLE_GLOBAL)) {\r\n this.error(\r\n DiagnosticCode.Cannot_export_a_mutable_global,\r\n (element).identifierNode.range\r\n );\r\n } else {\r\n this.module.addGlobalExport(element.internalName, prefix + name);\r\n }\r\n break;\r\n }\r\n case ElementKind.FUNCTION: {\r\n let instance = element;\r\n let signature = instance.signature;\r\n if (signature.requiredParameters < signature.parameterTypes.length) {\r\n // utilize trampoline to fill in omitted arguments\r\n instance = this.ensureTrampoline(instance);\r\n this.ensureArgcSet();\r\n }\r\n if (instance.is(CommonFlags.COMPILED)) this.module.addFunctionExport(instance.internalName, prefix + name);\r\n break;\r\n }\r\n case ElementKind.PROPERTY: {\r\n let getter = (element).getterInstance;\r\n if (getter) this.ensureModuleExport(GETTER_PREFIX + name, getter, prefix);\r\n let setter = (element).setterInstance;\r\n if (setter) this.ensureModuleExport(SETTER_PREFIX + name, setter, prefix);\r\n break;\r\n }\r\n case ElementKind.FIELD: {\r\n this.ensureModuleFieldGetter(prefix + GETTER_PREFIX + name, element);\r\n if (!element.is(CommonFlags.READONLY)) {\r\n this.ensureModuleFieldSetter(prefix + SETTER_PREFIX + name, element);\r\n }\r\n break;\r\n }\r\n case ElementKind.CLASS: {\r\n // make the class name itself represent its runtime id\r\n if (!(element).type.isUnmanaged) {\r\n let module = this.module;\r\n let internalName = (element).internalName;\r\n module.addGlobal(internalName, NativeType.I32, false, module.i32((element).id));\r\n module.addGlobalExport(internalName, prefix + name);\r\n }\r\n break;\r\n }\r\n\r\n // just traverse members below\r\n case ElementKind.ENUM:\r\n case ElementKind.NAMESPACE:\r\n case ElementKind.FILE:\r\n case ElementKind.TYPEDEFINITION: break;\r\n\r\n default: assert(false); // unexpected module export\r\n }\r\n\r\n // traverse members\r\n var members = element.members;\r\n if (members) {\r\n let subPrefix = prefix + name + (element.kind == ElementKind.CLASS\r\n ? INSTANCE_DELIMITER\r\n : STATIC_DELIMITER\r\n );\r\n if (\r\n element.kind == ElementKind.NAMESPACE ||\r\n element.kind == ElementKind.FILE\r\n ) {\r\n for (let member of members.values()) {\r\n if (!member.is(CommonFlags.EXPORT)) continue;\r\n this.ensureModuleExport(member.name, member, subPrefix);\r\n }\r\n } else {\r\n for (let member of members.values()) {\r\n if (member.is(CommonFlags.PRIVATE)) continue;\r\n this.ensureModuleExport(member.name, member, subPrefix);\r\n }\r\n }\r\n }\r\n }\r\n\r\n /** Makes a function to get the value of a field of an exported class. */\r\n private ensureModuleFieldGetter(name: string, field: Field): void {\r\n var module = this.module;\r\n var type = field.type;\r\n var usizeType = this.options.usizeType;\r\n var loadExpr = module.load(type.byteSize, type.is(TypeFlags.SIGNED),\r\n module.local_get(0, usizeType.toNativeType()),\r\n type.toNativeType(), field.memoryOffset\r\n );\r\n // a user-defined getter would return a retained value, so:\r\n if (type.isManaged) loadExpr = this.makeRetain(loadExpr);\r\n module.addFunction(\r\n name,\r\n this.ensureFunctionType(null, type, usizeType),\r\n null,\r\n loadExpr\r\n );\r\n module.addFunctionExport(name, name);\r\n }\r\n\r\n /** Makes a function to set the value of a field of an exported class. */\r\n private ensureModuleFieldSetter(name: string, field: Field): void {\r\n var module = this.module;\r\n var type = field.type;\r\n var nativeType = type.toNativeType();\r\n var usizeType = this.options.usizeType;\r\n var nativeSizeType = usizeType.toNativeType();\r\n var valueExpr = module.local_get(1, nativeType);\r\n if (type.isManaged) {\r\n valueExpr = this.makeRetainRelease(\r\n module.load(type.byteSize, false, // oldRef\r\n module.local_get(0, nativeSizeType),\r\n nativeType, field.memoryOffset\r\n ),\r\n valueExpr // newRef\r\n );\r\n }\r\n module.addFunction(\r\n name,\r\n this.ensureFunctionType([ type ], Type.void, usizeType),\r\n null,\r\n module.store(\r\n type.byteSize,\r\n module.local_get(0, nativeSizeType),\r\n valueExpr,\r\n nativeType,\r\n field.memoryOffset\r\n )\r\n );\r\n module.addFunctionExport(name, name);\r\n }\r\n\r\n // === Elements =================================================================================\r\n\r\n /** Compiles any element. */\r\n compileElement(element: Element, compileMembers: bool = true): void {\r\n switch (element.kind) {\r\n case ElementKind.GLOBAL: {\r\n this.compileGlobal(element);\r\n break;\r\n }\r\n case ElementKind.ENUM: {\r\n this.compileEnum(element);\r\n break;\r\n }\r\n case ElementKind.FUNCTION_PROTOTYPE: {\r\n if (!element.is(CommonFlags.GENERIC)) {\r\n this.compileFunctionUsingTypeArguments(element, []);\r\n }\r\n break;\r\n }\r\n case ElementKind.CLASS_PROTOTYPE: {\r\n if (!element.is(CommonFlags.GENERIC)) {\r\n this.compileClassUsingTypeArguments(element, []);\r\n }\r\n break;\r\n }\r\n case ElementKind.PROPERTY_PROTOTYPE: {\r\n let getterPrototype = (element).getterPrototype;\r\n if (getterPrototype) {\r\n this.compileFunctionUsingTypeArguments(getterPrototype, []);\r\n }\r\n let setterPrototype = (element).setterPrototype;\r\n if (setterPrototype) {\r\n this.compileFunctionUsingTypeArguments(setterPrototype, []);\r\n }\r\n break;\r\n }\r\n case ElementKind.NAMESPACE:\r\n case ElementKind.TYPEDEFINITION:\r\n case ElementKind.ENUMVALUE: break;\r\n default: assert(false, ElementKind[element.kind]);\r\n }\r\n if (compileMembers) this.compileMembers(element);\r\n }\r\n\r\n /** Compiles an element's members. */\r\n compileMembers(element: Element): void {\r\n var members = element.members;\r\n if (members) for (let element of members.values()) this.compileElement(element);\r\n }\r\n\r\n /** Compiles a file's exports. */\r\n compileExports(file: File): void {\r\n var exports = file.exports;\r\n if (exports) for (let element of exports.values()) this.compileElement(element);\r\n var exportsStar = file.exportsStar;\r\n if (exportsStar) {\r\n for (let exportStar of exportsStar) {\r\n this.compileFile(exportStar);\r\n this.compileExports(exportStar);\r\n }\r\n }\r\n }\r\n\r\n // files\r\n\r\n /** Compiles the file matching the specified path. */\r\n compileFileByPath(normalizedPathWithoutExtension: string, reportNode: Node): void {\r\n var file: File;\r\n var filesByName = this.program.filesByName;\r\n var pathWithIndex: string;\r\n if (filesByName.has(normalizedPathWithoutExtension)) {\r\n file = filesByName.get(normalizedPathWithoutExtension)!;\r\n } else if (filesByName.has(pathWithIndex = normalizedPathWithoutExtension + INDEX_SUFFIX)) {\r\n file = filesByName.get(pathWithIndex)!;\r\n } else {\r\n this.error(\r\n DiagnosticCode.File_0_not_found,\r\n reportNode.range, normalizedPathWithoutExtension\r\n );\r\n return;\r\n }\r\n this.compileFile(file);\r\n }\r\n\r\n /** Compiles the specified file. */\r\n compileFile(file: File): void {\r\n if (file.is(CommonFlags.COMPILED)) return;\r\n file.set(CommonFlags.COMPILED);\r\n\r\n // compile top-level statements within the file's start function\r\n var startFunction = file.startFunction;\r\n var previousBody = this.currentBody;\r\n var startFunctionBody = new Array();\r\n this.currentBody = startFunctionBody;\r\n\r\n // compile top-level statements\r\n var previousFlow = this.currentFlow;\r\n var flow = startFunction.flow;\r\n this.currentFlow = flow;\r\n for (let statements = file.source.statements, i = 0, k = statements.length; i < k; ++i) {\r\n this.compileTopLevelStatement(statements[i], startFunctionBody);\r\n }\r\n this.finishAutoreleases(flow, startFunctionBody);\r\n this.currentFlow = previousFlow;\r\n this.currentBody = previousBody;\r\n\r\n // if top-level statements are present, make the per-file start function and call it in start\r\n if (startFunctionBody.length) {\r\n let module = this.module;\r\n let locals = startFunction.localsByIndex;\r\n let numLocals = locals.length;\r\n let varTypes = new Array(numLocals);\r\n for (let i = 0; i < numLocals; ++i) varTypes[i] = locals[i].type.toNativeType();\r\n module.addFunction(\r\n startFunction.internalName,\r\n this.ensureFunctionType(startFunction.signature.parameterTypes, startFunction.signature.returnType),\r\n varTypes,\r\n startFunctionBody.length > 1\r\n ? module.block(null, startFunctionBody)\r\n : startFunctionBody[0]\r\n );\r\n previousBody.push(\r\n module.call(startFunction.internalName, null, NativeType.None)\r\n );\r\n }\r\n }\r\n\r\n // === Globals ==================================================================================\r\n\r\n compileGlobal(global: Global): bool {\r\n if (global.is(CommonFlags.COMPILED)) return true;\r\n global.set(CommonFlags.COMPILED);\r\n\r\n var module = this.module;\r\n var initExpr: ExpressionRef = 0;\r\n var initAutoreleaseSkipped: bool = false;\r\n var typeNode = global.typeNode;\r\n var initializerNode = global.initializerNode;\r\n\r\n if (!global.is(CommonFlags.RESOLVED)) {\r\n\r\n // Resolve type if annotated\r\n if (typeNode) {\r\n let resolvedType = this.resolver.resolveType(typeNode, global.parent); // reports\r\n if (!resolvedType) return false;\r\n if (resolvedType == Type.void) {\r\n this.error(\r\n DiagnosticCode.Type_expected,\r\n typeNode.range\r\n );\r\n return false;\r\n }\r\n global.setType(resolvedType);\r\n\r\n // Otherwise infer type from initializer\r\n } else if (initializerNode) {\r\n let previousFlow = this.currentFlow;\r\n if (global.hasDecorator(DecoratorFlags.LAZY)) {\r\n this.currentFlow = global.file.startFunction.flow;\r\n }\r\n initExpr = this.compileExpression(initializerNode, Type.i32, // reports\r\n ContextualFlags.WRAP | ContextualFlags.SKIP_AUTORELEASE\r\n );\r\n if (this.skippedAutoreleases.has(initExpr)) initAutoreleaseSkipped = true;\r\n this.currentFlow = previousFlow;\r\n if (this.currentType == Type.void) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_assignable_to_type_1,\r\n initializerNode.range, this.currentType.toString(), \"\"\r\n );\r\n return false;\r\n }\r\n global.setType(this.currentType);\r\n\r\n // Error if there's neither a type nor an initializer\r\n } else {\r\n this.error(\r\n DiagnosticCode.Type_expected,\r\n global.identifierNode.range.atEnd\r\n );\r\n return false;\r\n }\r\n }\r\n\r\n // Handle ambient builtins like '__heap_base' that need to be resolved but are added explicitly\r\n if (global.is(CommonFlags.AMBIENT) && global.hasDecorator(DecoratorFlags.BUILTIN)) {\r\n if (global.internalName == BuiltinSymbols.heap_base) this.runtimeFeatures |= RuntimeFeatures.HEAP;\r\n else if (global.internalName == BuiltinSymbols.rtti_base) this.runtimeFeatures |= RuntimeFeatures.RTTI;\r\n return true;\r\n }\r\n\r\n var type = global.type;\r\n var nativeType = type.toNativeType();\r\n var isDeclaredConstant = global.is(CommonFlags.CONST) || global.is(CommonFlags.STATIC | CommonFlags.READONLY);\r\n var isDeclaredInline = global.hasDecorator(DecoratorFlags.INLINE);\r\n\r\n // Handle imports\r\n if (global.is(CommonFlags.AMBIENT)) {\r\n\r\n // Constant global or mutable globals enabled\r\n if (isDeclaredConstant || this.options.hasFeature(Feature.MUTABLE_GLOBAL)) {\r\n global.set(CommonFlags.MODULE_IMPORT);\r\n mangleImportName(global, global.declaration);\r\n module.addGlobalImport(\r\n global.internalName,\r\n mangleImportName_moduleName,\r\n mangleImportName_elementName,\r\n nativeType\r\n );\r\n global.set(CommonFlags.COMPILED);\r\n return true;\r\n\r\n // Importing mutable globals is not supported in the MVP\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n global.declaration.range\r\n );\r\n }\r\n return false;\r\n }\r\n\r\n // The MVP does not yet support initializer expressions other than constant values (and constant\r\n // get_globals), hence such initializations must be performed in the start function for now.\r\n var initializeInStart = false;\r\n\r\n // Evaluate initializer if present\r\n if (initializerNode) {\r\n if (!initExpr) {\r\n let previousFlow = this.currentFlow;\r\n if (global.hasDecorator(DecoratorFlags.LAZY)) {\r\n this.currentFlow = global.file.startFunction.flow;\r\n }\r\n initExpr = this.compileExpression(initializerNode, type,\r\n ContextualFlags.IMPLICIT | ContextualFlags.WRAP | ContextualFlags.SKIP_AUTORELEASE | ContextualFlags.STATIC_CAPABLE\r\n );\r\n if (this.skippedAutoreleases.has(initExpr)) initAutoreleaseSkipped = true;\r\n this.currentFlow = previousFlow;\r\n }\r\n\r\n if (getExpressionId(initExpr) != ExpressionId.Const) {\r\n if (isDeclaredConstant) {\r\n initExpr = module.precomputeExpression(initExpr);\r\n if (getExpressionId(initExpr) != ExpressionId.Const) initializeInStart = true;\r\n } else {\r\n initializeInStart = true;\r\n }\r\n }\r\n\r\n // Explicitly inline if annotated\r\n if (isDeclaredInline) {\r\n if (initializeInStart) {\r\n this.warning(\r\n DiagnosticCode.Mutable_value_cannot_be_inlined,\r\n initializerNode.range\r\n );\r\n } else {\r\n assert(getExpressionId(initExpr) == ExpressionId.Const);\r\n let exprType = getExpressionType(initExpr);\r\n switch (exprType) {\r\n case NativeType.I32: {\r\n global.constantValueKind = ConstantValueKind.INTEGER;\r\n global.constantIntegerValue = i64_new(getConstValueI32(initExpr), 0);\r\n break;\r\n }\r\n case NativeType.I64: {\r\n global.constantValueKind = ConstantValueKind.INTEGER;\r\n global.constantIntegerValue = i64_new(\r\n getConstValueI64Low(initExpr),\r\n getConstValueI64High(initExpr)\r\n );\r\n break;\r\n }\r\n case NativeType.F32: {\r\n global.constantValueKind = ConstantValueKind.FLOAT;\r\n global.constantFloatValue = getConstValueF32(initExpr);\r\n break;\r\n }\r\n case NativeType.F64: {\r\n global.constantValueKind = ConstantValueKind.FLOAT;\r\n global.constantFloatValue = getConstValueF64(initExpr);\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n return false;\r\n }\r\n }\r\n global.set(CommonFlags.INLINED); // inline the value from now on\r\n }\r\n }\r\n\r\n // Initialize to zero if there's no initializer\r\n } else {\r\n initExpr = type.toNativeZero(module);\r\n }\r\n\r\n var internalName = global.internalName;\r\n\r\n if (initializeInStart) { // initialize to mutable zero and set the actual value in start\r\n if (isDeclaredInline) {\r\n this.error(\r\n DiagnosticCode.Decorator_0_is_not_valid_here,\r\n assert(findDecorator(DecoratorKind.INLINE, global.decoratorNodes)).range, \"inline\"\r\n );\r\n }\r\n module.addGlobal(internalName, nativeType, true, type.toNativeZero(module));\r\n if (type.isManaged && !initAutoreleaseSkipped) initExpr = this.makeRetain(initExpr);\r\n this.currentBody.push(\r\n module.global_set(internalName, initExpr)\r\n );\r\n } else if (!isDeclaredInline) { // compile normally\r\n module.addGlobal(internalName, nativeType, !isDeclaredConstant, initExpr);\r\n }\r\n return true;\r\n }\r\n\r\n // === Enums ====================================================================================\r\n\r\n compileEnum(element: Enum): bool {\r\n if (element.is(CommonFlags.COMPILED)) return true;\r\n element.set(CommonFlags.COMPILED);\r\n\r\n var module = this.module;\r\n this.currentEnum = element;\r\n var previousValue: EnumValue | null = null;\r\n var previousValueIsMut = false;\r\n var isInline = element.is(CommonFlags.CONST) || element.hasDecorator(DecoratorFlags.INLINE);\r\n\r\n if (element.members) {\r\n for (let member of element.members.values()) {\r\n if (member.kind != ElementKind.ENUMVALUE) continue; // happens if an enum is also a namespace\r\n let initInStart = false;\r\n let val = member;\r\n let valueNode = val.valueNode;\r\n val.set(CommonFlags.COMPILED);\r\n let previousFlow = this.currentFlow;\r\n if (element.hasDecorator(DecoratorFlags.LAZY)) {\r\n this.currentFlow = element.file.startFunction.flow;\r\n }\r\n let initExpr: ExpressionRef;\r\n if (valueNode) {\r\n initExpr = this.compileExpression(valueNode, Type.i32,\r\n ContextualFlags.IMPLICIT // autorelease is not applicable in i32 context\r\n );\r\n if (getExpressionId(initExpr) != ExpressionId.Const) {\r\n initExpr = module.precomputeExpression(initExpr);\r\n if (getExpressionId(initExpr) != ExpressionId.Const) {\r\n if (element.is(CommonFlags.CONST)) {\r\n this.error(\r\n DiagnosticCode.In_const_enum_declarations_member_initializer_must_be_constant_expression,\r\n valueNode.range\r\n );\r\n }\r\n initInStart = true;\r\n }\r\n }\r\n } else if (previousValue == null) {\r\n initExpr = module.i32(0);\r\n } else {\r\n if (previousValueIsMut) {\r\n this.error(\r\n DiagnosticCode.Enum_member_must_have_initializer,\r\n (member).identifierNode.range.atEnd\r\n );\r\n }\r\n initExpr = module.binary(BinaryOp.AddI32,\r\n module.global_get(previousValue.internalName, NativeType.I32),\r\n module.i32(1)\r\n );\r\n initExpr = module.precomputeExpression(initExpr);\r\n if (getExpressionId(initExpr) != ExpressionId.Const) {\r\n if (element.is(CommonFlags.CONST)) {\r\n this.error(\r\n DiagnosticCode.In_const_enum_declarations_member_initializer_must_be_constant_expression,\r\n member.declaration.range\r\n );\r\n }\r\n initInStart = true;\r\n }\r\n }\r\n this.currentFlow = previousFlow;\r\n if (initInStart) {\r\n module.addGlobal(val.internalName, NativeType.I32, true, module.i32(0));\r\n this.currentBody.push(\r\n this.makeGlobalAssignment(val, initExpr, false)\r\n );\r\n previousValueIsMut = true;\r\n } else {\r\n if (isInline) {\r\n val.setConstantIntegerValue(i64_new(getConstValueI32(initExpr)), Type.i32);\r\n if (val.is(CommonFlags.MODULE_EXPORT)) {\r\n module.addGlobal(val.internalName, NativeType.I32, false, initExpr);\r\n }\r\n } else {\r\n module.addGlobal(val.internalName, NativeType.I32, false, initExpr);\r\n }\r\n val.isImmutable = true;\r\n previousValueIsMut = false;\r\n }\r\n previousValue = val;\r\n }\r\n }\r\n this.currentEnum = null;\r\n return true;\r\n }\r\n\r\n // === Functions ================================================================================\r\n\r\n /** Resolves the specified type arguments prior to compiling the resulting function instance. */\r\n compileFunctionUsingTypeArguments(\r\n prototype: FunctionPrototype,\r\n typeArguments: TypeNode[],\r\n contextualTypeArguments: Map = makeMap(),\r\n alternativeReportNode: Node | null = null\r\n ): Function | null {\r\n if (prototype.hasDecorator(DecoratorFlags.BUILTIN)) return null;\r\n var instance = this.resolver.resolveFunctionInclTypeArguments(\r\n prototype,\r\n typeArguments,\r\n prototype.parent, // relative to itself\r\n contextualTypeArguments,\r\n alternativeReportNode || prototype.declaration\r\n );\r\n if (!instance) return null;\r\n if (!this.compileFunction(instance)) return null; // reports\r\n return instance;\r\n }\r\n\r\n /** Either reuses or creates the function type matching the specified signature. */\r\n ensureFunctionType(\r\n parameterTypes: Type[] | null,\r\n returnType: Type,\r\n thisType: Type | null = null\r\n ): FunctionTypeRef {\r\n var numParameters = parameterTypes ? parameterTypes.length : 0;\r\n var paramTypes: NativeType[];\r\n var index = 0;\r\n if (thisType) {\r\n paramTypes = new Array(1 + numParameters);\r\n paramTypes[0] = thisType.toNativeType();\r\n index = 1;\r\n } else {\r\n paramTypes = new Array(numParameters);\r\n }\r\n if (parameterTypes) {\r\n for (let i = 0; i < numParameters; ++i, ++index) {\r\n paramTypes[index] = parameterTypes[i].toNativeType();\r\n }\r\n }\r\n var resultType = returnType.toNativeType();\r\n var module = this.module;\r\n var typeRef = module.getFunctionTypeBySignature(resultType, paramTypes);\r\n if (!typeRef) {\r\n let name = Signature.makeSignatureString(parameterTypes, returnType, thisType);\r\n typeRef = module.addFunctionType(name, resultType, paramTypes);\r\n }\r\n return typeRef;\r\n }\r\n\r\n /** Compiles the body of a function within the specified flow. */\r\n compileFunctionBody(\r\n /** Function to compile. */\r\n instance: Function,\r\n /** Target array of statements. */\r\n stmts: ExpressionRef[] | null = null\r\n ): ExpressionRef[] {\r\n var module = this.module;\r\n var bodyNode = assert(instance.prototype.bodyNode);\r\n var returnType = instance.signature.returnType;\r\n var flow = this.currentFlow;\r\n\r\n // compile statements\r\n if (bodyNode.kind == NodeKind.BLOCK) {\r\n stmts = this.compileStatements((bodyNode).statements, true, stmts);\r\n } else {\r\n // must be an expression statement if not a block\r\n assert(bodyNode.kind == NodeKind.EXPRESSION);\r\n\r\n // must be an arrow function\r\n assert(instance.prototype.arrowKind);\r\n\r\n // none of the following can be an arrow function\r\n assert(!instance.isAny(CommonFlags.CONSTRUCTOR | CommonFlags.GET | CommonFlags.SET | CommonFlags.MAIN));\r\n\r\n let expr = this.compileExpression((bodyNode).expression, returnType,\r\n ContextualFlags.IMPLICIT\r\n );\r\n if (!stmts) stmts = [ expr ];\r\n else stmts.push(expr);\r\n if (!flow.isAny(FlowFlags.ANY_TERMINATING)) { // TODO: detect if returning an autorelease local?\r\n let indexBefore = stmts.length;\r\n this.performAutoreleases(flow, stmts);\r\n this.finishAutoreleases(flow, stmts);\r\n let canOverflow = flow.canOverflow(expr, returnType);\r\n let nonNull = flow.isNonnull(expr, returnType);\r\n if (stmts.length > indexBefore) {\r\n let temp = flow.getAndFreeTempLocal(returnType);\r\n if (!canOverflow) flow.setLocalFlag(temp.index, LocalFlags.WRAPPED);\r\n if (nonNull) flow.setLocalFlag(temp.index, LocalFlags.NONNULL);\r\n stmts[indexBefore - 1] = module.local_set(temp.index, expr);\r\n stmts.push(module.local_get(temp.index, returnType.toNativeType()));\r\n }\r\n if (!canOverflow) flow.set(FlowFlags.RETURNS_WRAPPED);\r\n if (nonNull) flow.set(FlowFlags.RETURNS_NONNULL);\r\n flow.set(FlowFlags.RETURNS); // now is terminating\r\n }\r\n }\r\n\r\n // make constructors return their instance pointer\r\n if (instance.is(CommonFlags.CONSTRUCTOR)) {\r\n let nativeSizeType = this.options.nativeSizeType;\r\n assert(instance.is(CommonFlags.INSTANCE));\r\n let classInstance = assert(instance.parent); assert(classInstance.kind == ElementKind.CLASS);\r\n\r\n if (!flow.isAny(FlowFlags.ANY_TERMINATING)) {\r\n let thisLocal = assert(flow.lookupLocal(CommonSymbols.this_));\r\n\r\n // if `this` wasn't accessed before, allocate if necessary and initialize `this`\r\n if (!flow.is(FlowFlags.ALLOCATES)) {\r\n // {\r\n // if (!this) this = \r\n // this.a = X\r\n // this.b = Y\r\n // }\r\n stmts.push(\r\n module.if(\r\n module.unary(nativeSizeType == NativeType.I64 ? UnaryOp.EqzI64 : UnaryOp.EqzI32,\r\n module.local_get(thisLocal.index, nativeSizeType)\r\n ),\r\n module.local_set(thisLocal.index,\r\n this.makeRetain(\r\n this.makeAllocation(classInstance)\r\n ),\r\n )\r\n )\r\n );\r\n this.makeFieldInitialization(classInstance, stmts);\r\n }\r\n this.performAutoreleases(flow, stmts); // `this` is excluded anyway\r\n this.finishAutoreleases(flow, stmts);\r\n stmts.push(module.local_get(thisLocal.index, this.options.nativeSizeType));\r\n flow.set(FlowFlags.RETURNS | FlowFlags.RETURNS_NONNULL);\r\n }\r\n\r\n // check that super has been called if this is a derived class\r\n if ((classInstance).base && !flow.is(FlowFlags.CALLS_SUPER)) {\r\n this.error(\r\n DiagnosticCode.Constructors_for_derived_classes_must_contain_a_super_call,\r\n instance.prototype.declaration.range\r\n );\r\n }\r\n\r\n // if this is a normal function, make sure that all branches return\r\n } else if (returnType != Type.void && !flow.is(FlowFlags.RETURNS)) {\r\n this.error(\r\n DiagnosticCode.A_function_whose_declared_type_is_not_void_must_return_a_value,\r\n instance.prototype.signatureNode.returnType.range\r\n );\r\n }\r\n\r\n return stmts;\r\n }\r\n\r\n /** Compiles a readily resolved function instance. */\r\n compileFunction(instance: Function): bool {\r\n if (instance.is(CommonFlags.COMPILED)) return true;\r\n assert(!(instance.is(CommonFlags.AMBIENT) && instance.hasDecorator(DecoratorFlags.BUILTIN)));\r\n\r\n var previousType = this.currentType; // remember to retain it if compiling a function lazily\r\n instance.set(CommonFlags.COMPILED);\r\n\r\n var module = this.module;\r\n var signature = instance.signature;\r\n var bodyNode = instance.prototype.bodyNode;\r\n\r\n var typeRef = this.ensureFunctionType(signature.parameterTypes, signature.returnType, signature.thisType);\r\n var funcRef: FunctionRef;\r\n\r\n // concrete function\r\n if (bodyNode) {\r\n\r\n // must not be ambient\r\n if (instance.is(CommonFlags.AMBIENT)) {\r\n this.error(\r\n DiagnosticCode.An_implementation_cannot_be_declared_in_ambient_contexts,\r\n instance.identifierNode.range\r\n );\r\n }\r\n\r\n // cannot have an annotated external name\r\n if (instance.hasDecorator(DecoratorFlags.EXTERNAL)) {\r\n let decoratorNodes = instance.decoratorNodes;\r\n let decorator = assert(findDecorator(DecoratorKind.EXTERNAL, decoratorNodes));\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n decorator.range\r\n );\r\n }\r\n\r\n // compile body in this function's context\r\n let previousFlow = this.currentFlow;\r\n let flow = instance.flow;\r\n this.currentFlow = flow;\r\n let stmts = new Array();\r\n\r\n // retain each argument for as long as the function lives\r\n let index = 0;\r\n let thisType = signature.thisType;\r\n if (thisType) {\r\n // No need to retain `this` as it can't be reassigned and thus can't become prematurely released\r\n ++index;\r\n }\r\n let parameterTypes = signature.parameterTypes;\r\n for (let i = 0, k = parameterTypes.length; i < k; ++i, ++index) {\r\n let type = parameterTypes[i];\r\n if (type.isManaged) {\r\n stmts.push(\r\n module.drop(\r\n this.makeRetain(\r\n module.local_get(index, type.toNativeType())\r\n )\r\n )\r\n );\r\n flow.setLocalFlag(index, LocalFlags.RETAINED);\r\n }\r\n }\r\n\r\n this.compileFunctionBody(instance, stmts);\r\n if (!flow.isAny(FlowFlags.ANY_TERMINATING)) {\r\n this.performAutoreleases(flow, stmts);\r\n this.finishAutoreleases(flow, stmts);\r\n }\r\n this.currentFlow = previousFlow;\r\n\r\n // create the function\r\n funcRef = module.addFunction(\r\n instance.internalName,\r\n typeRef,\r\n typesToNativeTypes(instance.additionalLocals),\r\n flatten(module, stmts, instance.signature.returnType.toNativeType())\r\n );\r\n\r\n // imported function\r\n } else {\r\n if (!instance.is(CommonFlags.AMBIENT)) {\r\n this.error(\r\n DiagnosticCode.Function_implementation_is_missing_or_not_immediately_following_the_declaration,\r\n instance.identifierNode.range\r\n );\r\n }\r\n\r\n instance.set(CommonFlags.MODULE_IMPORT);\r\n mangleImportName(instance, instance.declaration); // TODO: check for duplicates\r\n\r\n // create the import\r\n funcRef = module.addFunctionImport(\r\n instance.internalName,\r\n mangleImportName_moduleName,\r\n mangleImportName_elementName,\r\n typeRef\r\n );\r\n }\r\n\r\n instance.finalize(module, funcRef);\r\n this.currentType = previousType;\r\n return true;\r\n }\r\n\r\n // === Classes ==================================================================================\r\n\r\n compileClassUsingTypeArguments(\r\n prototype: ClassPrototype,\r\n typeArguments: TypeNode[],\r\n contextualTypeArguments: Map = makeMap(),\r\n alternativeReportNode: Node | null = null\r\n ): void {\r\n var instance = this.resolver.resolveClassInclTypeArguments(\r\n prototype,\r\n typeArguments,\r\n prototype.parent, // relative to itself\r\n contextualTypeArguments,\r\n alternativeReportNode || prototype.declaration\r\n );\r\n if (!instance) return;\r\n this.compileClass(instance);\r\n }\r\n\r\n compileClass(instance: Class): bool {\r\n if (instance.is(CommonFlags.COMPILED)) return true;\r\n instance.set(CommonFlags.COMPILED);\r\n var prototype = instance.prototype;\r\n var staticMembers = (prototype).members;\r\n if (staticMembers) {\r\n for (let element of staticMembers.values()) {\r\n switch (element.kind) {\r\n case ElementKind.GLOBAL: {\r\n this.compileGlobal(element);\r\n break;\r\n }\r\n case ElementKind.FUNCTION_PROTOTYPE: {\r\n if (\r\n !(element).is(CommonFlags.GENERIC)\r\n ) {\r\n this.compileFunctionUsingTypeArguments(\r\n element,\r\n [],\r\n makeMap(),\r\n (element).identifierNode\r\n );\r\n }\r\n break;\r\n }\r\n case ElementKind.PROPERTY_PROTOTYPE: {\r\n let getter = (element).getterPrototype;\r\n if (getter) {\r\n this.compileFunctionUsingTypeArguments(\r\n getter,\r\n [],\r\n makeMap(),\r\n getter.identifierNode\r\n );\r\n }\r\n let setter = (element).setterPrototype;\r\n if (setter) {\r\n this.compileFunctionUsingTypeArguments(\r\n setter,\r\n [],\r\n makeMap(),\r\n setter.identifierNode\r\n );\r\n }\r\n break;\r\n }\r\n case ElementKind.PROPERTY: {\r\n }\r\n }\r\n }\r\n }\r\n var ctorInstance = instance.constructorInstance;\r\n if (ctorInstance) this.compileFunction(ctorInstance);\r\n var instanceMembers = instance.members;\r\n if (instanceMembers) {\r\n for (let element of instanceMembers.values()) {\r\n switch (element.kind) {\r\n case ElementKind.FUNCTION_PROTOTYPE: {\r\n if (\r\n !(element).is(CommonFlags.GENERIC)\r\n ) {\r\n this.compileFunctionUsingTypeArguments(\r\n element,\r\n [],\r\n makeMap(instance.contextualTypeArguments),\r\n (element).declaration.name\r\n );\r\n }\r\n break;\r\n }\r\n case ElementKind.FIELD_PROTOTYPE: {\r\n element.set(CommonFlags.COMPILED);\r\n break;\r\n }\r\n case ElementKind.PROPERTY: {\r\n let getter = (element).getterInstance;\r\n if (getter) this.compileFunction(getter);\r\n let setter = (element).setterInstance;\r\n if (setter) this.compileFunction(setter);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n compileInterfaceDeclaration(\r\n declaration: InterfaceDeclaration,\r\n typeArguments: TypeNode[],\r\n contextualTypeArguments: Map | null = null,\r\n alternativeReportNode: Node | null = null\r\n ): void {\r\n // TODO\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n declaration.range\r\n );\r\n }\r\n\r\n // === Memory ===================================================================================\r\n\r\n /** Adds a static memory segment with the specified data. */\r\n addMemorySegment(buffer: Uint8Array, alignment: i32 = 8): MemorySegment {\r\n var memoryOffset = i64_align(this.memoryOffset, alignment);\r\n var segment = MemorySegment.create(buffer, memoryOffset);\r\n this.memorySegments.push(segment);\r\n this.memoryOffset = i64_add(memoryOffset, i64_new(buffer.length, 0));\r\n return segment;\r\n }\r\n\r\n /** Ensures that the specified string exists in static memory and returns a pointer to it. */\r\n ensureStaticString(stringValue: string): ExpressionRef {\r\n var program = this.program;\r\n var rtHeaderSize = program.runtimeHeaderSize;\r\n var stringInstance = assert(program.stringInstance);\r\n var stringSegment: MemorySegment;\r\n var segments = this.stringSegments;\r\n if (segments.has(stringValue)) {\r\n stringSegment = segments.get(stringValue)!; // reuse\r\n } else {\r\n let length = stringValue.length;\r\n let buffer = new Uint8Array(rtHeaderSize + (length << 1));\r\n program.writeRuntimeHeader(buffer, 0, stringInstance, length << 1);\r\n for (let i = 0; i < length; ++i) {\r\n writeI16(stringValue.charCodeAt(i), buffer, rtHeaderSize + (i << 1));\r\n }\r\n stringSegment = this.addMemorySegment(buffer);\r\n segments.set(stringValue, stringSegment);\r\n }\r\n var ref = i64_add(stringSegment.offset, i64_new(rtHeaderSize));\r\n this.currentType = stringInstance.type;\r\n if (this.options.isWasm64) {\r\n return this.module.i64(i64_low(ref), i64_high(ref));\r\n } else {\r\n assert(i64_is_u32(ref));\r\n return this.module.i32(i64_low(ref));\r\n }\r\n }\r\n\r\n ensureStaticArrayBuffer(elementType: Type, values: ExpressionRef[]): MemorySegment {\r\n var program = this.program;\r\n var length = values.length;\r\n var byteSize = elementType.byteSize;\r\n var byteLength = length * byteSize;\r\n var bufferInstance = assert(program.arrayBufferInstance);\r\n var runtimeHeaderSize = program.runtimeHeaderSize;\r\n\r\n var buf = new Uint8Array(runtimeHeaderSize + byteLength);\r\n program.writeRuntimeHeader(buf, 0, bufferInstance, byteLength);\r\n var pos = runtimeHeaderSize;\r\n var nativeType = elementType.toNativeType();\r\n switch (nativeType) {\r\n case NativeType.I32: {\r\n switch (byteSize) {\r\n case 1: {\r\n for (let i = 0; i < length; ++i) {\r\n let value = values[i];\r\n assert(getExpressionType(value) == nativeType);\r\n assert(getExpressionId(value) == ExpressionId.Const);\r\n writeI8(getConstValueI32(value), buf, pos);\r\n pos += 1;\r\n }\r\n break;\r\n }\r\n case 2: {\r\n for (let i = 0; i < length; ++i) {\r\n let value = values[i];\r\n assert(getExpressionType(value) == nativeType);\r\n assert(getExpressionId(value) == ExpressionId.Const);\r\n writeI16(getConstValueI32(value), buf, pos);\r\n pos += 2;\r\n }\r\n break;\r\n }\r\n case 4: {\r\n for (let i = 0; i < length; ++i) {\r\n let value = values[i];\r\n assert(getExpressionType(value) == nativeType);\r\n assert(getExpressionId(value) == ExpressionId.Const);\r\n writeI32(getConstValueI32(value), buf, pos);\r\n pos += 4;\r\n }\r\n break;\r\n }\r\n default: assert(false);\r\n }\r\n break;\r\n }\r\n case NativeType.I64: {\r\n for (let i = 0; i < length; ++i) {\r\n let value = values[i];\r\n assert(getExpressionType(value) == nativeType);\r\n assert(getExpressionId(value) == ExpressionId.Const);\r\n writeI64(i64_new(getConstValueI64Low(value), getConstValueI64High(value)), buf, pos);\r\n pos += 8;\r\n }\r\n break;\r\n }\r\n case NativeType.F32: {\r\n for (let i = 0; i < length; ++i) {\r\n let value = values[i];\r\n assert(getExpressionType(value) == nativeType);\r\n assert(getExpressionId(value) == ExpressionId.Const);\r\n writeF32(getConstValueF32(value), buf, pos);\r\n pos += 4;\r\n }\r\n break;\r\n }\r\n case NativeType.F64: {\r\n for (let i = 0; i < length; ++i) {\r\n let value = values[i];\r\n assert(getExpressionType(value) == nativeType);\r\n assert(getExpressionId(value) == ExpressionId.Const);\r\n writeF64(getConstValueF64(value), buf, pos);\r\n pos += 8;\r\n }\r\n break;\r\n }\r\n default: assert(false);\r\n }\r\n assert(pos == buf.length);\r\n\r\n return this.addMemorySegment(buf);\r\n }\r\n\r\n ensureStaticArrayHeader(elementType: Type, bufferSegment: MemorySegment): MemorySegment {\r\n var program = this.program;\r\n var runtimeHeaderSize = program.runtimeHeaderSize;\r\n var arrayPrototype = assert(program.arrayPrototype);\r\n var arrayInstance = assert(this.resolver.resolveClass(arrayPrototype, [ elementType ]));\r\n var arrayInstanceSize = arrayInstance.currentMemoryOffset;\r\n var bufferLength = bufferSegment.buffer.length - runtimeHeaderSize;\r\n var arrayLength = i32(bufferLength / elementType.byteSize);\r\n\r\n var buf = new Uint8Array(runtimeHeaderSize + arrayInstanceSize);\r\n program.writeRuntimeHeader(buf, 0, arrayInstance, arrayInstanceSize);\r\n\r\n var bufferAddress32 = i64_low(bufferSegment.offset) + runtimeHeaderSize;\r\n assert(!program.options.isWasm64); // TODO\r\n assert(arrayInstance.writeField(\"data\", bufferAddress32, buf, runtimeHeaderSize));\r\n assert(arrayInstance.writeField(\"dataStart\", bufferAddress32, buf, runtimeHeaderSize));\r\n assert(arrayInstance.writeField(\"dataLength\", bufferLength, buf, runtimeHeaderSize));\r\n assert(arrayInstance.writeField(\"length_\", arrayLength, buf, runtimeHeaderSize));\r\n\r\n return this.addMemorySegment(buf);\r\n }\r\n\r\n // === Table ====================================================================================\r\n\r\n /** Ensures that a table entry exists for the specified function and returns its index. */\r\n ensureFunctionTableEntry(func: Function): i32 {\r\n assert(func.is(CommonFlags.COMPILED));\r\n if (func.functionTableIndex >= 0) {\r\n return func.functionTableIndex;\r\n }\r\n var functionTable = this.functionTable;\r\n var index = functionTable.length;\r\n if (!func.is(CommonFlags.TRAMPOLINE) && func.signature.requiredParameters < func.signature.parameterTypes.length) {\r\n // insert the trampoline if the function has optional parameters\r\n func = this.ensureTrampoline(func);\r\n }\r\n functionTable.push(func.internalName);\r\n func.functionTableIndex = index;\r\n return index;\r\n }\r\n\r\n // === Statements ===============================================================================\r\n\r\n compileTopLevelStatement(statement: Statement, body: ExpressionRef[]): void {\r\n if (statement.kind == NodeKind.EXPORTDEFAULT) {\r\n statement = (statement).declaration;\r\n }\r\n switch (statement.kind) {\r\n case NodeKind.CLASSDECLARATION: {\r\n let memberStatements = (statement).members;\r\n for (let i = 0, k = memberStatements.length; i < k; ++i) {\r\n this.compileTopLevelStatement(memberStatements[i], body);\r\n }\r\n break;\r\n }\r\n case NodeKind.ENUMDECLARATION: {\r\n let element = this.program.getElementByDeclaration(statement);\r\n assert(element.kind == ElementKind.ENUM);\r\n if (!element.hasDecorator(DecoratorFlags.LAZY)) this.compileEnum(element);\r\n break;\r\n }\r\n case NodeKind.NAMESPACEDECLARATION: {\r\n let memberStatements = (statement).members;\r\n for (let i = 0, k = memberStatements.length; i < k; ++i) {\r\n this.compileTopLevelStatement(memberStatements[i], body);\r\n }\r\n break;\r\n }\r\n case NodeKind.VARIABLE: {\r\n let declarations = (statement).declarations;\r\n for (let i = 0, k = declarations.length; i < k; ++i) {\r\n let element = this.program.getElementByDeclaration(declarations[i]);\r\n assert(element.kind == ElementKind.GLOBAL);\r\n if (\r\n !element.is(CommonFlags.AMBIENT) && // delay imports\r\n !element.hasDecorator(DecoratorFlags.LAZY)\r\n ) this.compileGlobal(element);\r\n }\r\n break;\r\n }\r\n case NodeKind.FIELDDECLARATION: {\r\n let element = this.program.getElementByDeclaration(statement);\r\n if (element.kind == ElementKind.GLOBAL) { // static\r\n if (!element.hasDecorator(DecoratorFlags.LAZY)) this.compileGlobal(element);\r\n }\r\n break;\r\n }\r\n case NodeKind.EXPORT: {\r\n if ((statement).normalizedPath != null) {\r\n this.compileFileByPath(\r\n (statement).normalizedPath,\r\n (statement).path\r\n );\r\n }\r\n break;\r\n }\r\n case NodeKind.IMPORT: {\r\n this.compileFileByPath(\r\n (statement).normalizedPath,\r\n (statement).path\r\n );\r\n break;\r\n }\r\n case NodeKind.FUNCTIONDECLARATION:\r\n case NodeKind.METHODDECLARATION:\r\n case NodeKind.INTERFACEDECLARATION:\r\n case NodeKind.INDEXSIGNATUREDECLARATION:\r\n case NodeKind.TYPEDECLARATION: break;\r\n default: { // otherwise a top-level statement that is part of the start function's body\r\n let stmt = this.compileStatement(statement);\r\n if (getExpressionId(stmt) != ExpressionId.Nop) body.push(stmt);\r\n break;\r\n }\r\n }\r\n }\r\n\r\n compileStatement(\r\n statement: Statement,\r\n contextualFlags: ContextualFlags = ContextualFlags.NONE\r\n ): ExpressionRef {\r\n var module = this.module;\r\n var stmt: ExpressionRef;\r\n switch (statement.kind) {\r\n case NodeKind.BLOCK: {\r\n stmt = this.compileBlockStatement(statement, contextualFlags);\r\n break;\r\n }\r\n case NodeKind.BREAK: {\r\n stmt = this.compileBreakStatement(statement, contextualFlags);\r\n break;\r\n }\r\n case NodeKind.CONTINUE: {\r\n stmt = this.compileContinueStatement(statement, contextualFlags);\r\n break;\r\n }\r\n case NodeKind.DO: {\r\n stmt = this.compileDoStatement(statement, contextualFlags);\r\n break;\r\n }\r\n case NodeKind.EMPTY: {\r\n stmt = this.compileEmptyStatement(statement, contextualFlags);\r\n break;\r\n }\r\n case NodeKind.EXPRESSION: {\r\n stmt = this.compileExpressionStatement(statement, contextualFlags);\r\n break;\r\n }\r\n case NodeKind.FOR: {\r\n stmt = this.compileForStatement(statement, contextualFlags);\r\n break;\r\n }\r\n case NodeKind.IF: {\r\n stmt = this.compileIfStatement(statement, contextualFlags);\r\n break;\r\n }\r\n case NodeKind.RETURN: {\r\n stmt = this.compileReturnStatement(statement, contextualFlags);\r\n break;\r\n }\r\n case NodeKind.SWITCH: {\r\n stmt = this.compileSwitchStatement(statement, contextualFlags);\r\n break;\r\n }\r\n case NodeKind.THROW: {\r\n stmt = this.compileThrowStatement(statement, contextualFlags);\r\n break;\r\n }\r\n case NodeKind.TRY: {\r\n stmt = this.compileTryStatement(statement, contextualFlags);\r\n break;\r\n }\r\n case NodeKind.VARIABLE: {\r\n stmt = this.compileVariableStatement(statement, contextualFlags);\r\n if (!stmt) stmt = module.nop();\r\n break;\r\n }\r\n case NodeKind.VOID: {\r\n stmt = this.compileVoidStatement(statement, contextualFlags);\r\n break;\r\n }\r\n case NodeKind.WHILE: {\r\n stmt = this.compileWhileStatement(statement, contextualFlags);\r\n break;\r\n }\r\n case NodeKind.TYPEDECLARATION: {\r\n // TODO: integrate inner type declaration into flow\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n statement.range\r\n );\r\n stmt = module.unreachable();\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n stmt = module.unreachable();\r\n }\r\n }\r\n if (this.options.sourceMap) this.addDebugLocation(stmt, statement.range);\r\n return stmt;\r\n }\r\n\r\n compileStatements(\r\n statements: Statement[],\r\n isBody: bool = false,\r\n stmts: ExpressionRef[] | null = null\r\n ): ExpressionRef[] {\r\n var numStatements = statements.length;\r\n if (!stmts) {\r\n stmts = new Array(numStatements);\r\n stmts.length = 0;\r\n }\r\n var flow = this.currentFlow;\r\n for (let i = 0; i < numStatements; ++i) {\r\n let stmt = this.compileStatement(statements[i],\r\n isBody && i == numStatements - 1\r\n ? ContextualFlags.LAST_IN_BODY\r\n : ContextualFlags.NONE\r\n );\r\n switch (getExpressionId(stmt)) {\r\n case ExpressionId.Block: {\r\n if (!getBlockName(stmt)) {\r\n for (let j = 0, k = getBlockChildCount(stmt); j < k; ++j) stmts.push(getBlockChild(stmt, j));\r\n break;\r\n }\r\n // fall-through\r\n }\r\n default: stmts.push(stmt);\r\n case ExpressionId.Nop:\r\n }\r\n if (flow.isAny(FlowFlags.ANY_TERMINATING)) {\r\n if (needsExplicitUnreachable(stmt)) stmts.push(this.module.unreachable());\r\n break;\r\n }\r\n }\r\n return stmts;\r\n }\r\n\r\n compileBlockStatement(\r\n statement: BlockStatement,\r\n contextualFlags: ContextualFlags\r\n ): ExpressionRef {\r\n var statements = statement.statements;\r\n var outerFlow = this.currentFlow;\r\n var innerFlow = outerFlow.fork();\r\n this.currentFlow = innerFlow;\r\n\r\n var stmts = this.compileStatements(statements);\r\n if (!innerFlow.isAny(FlowFlags.ANY_TERMINATING)) this.performAutoreleases(innerFlow, stmts);\r\n innerFlow.freeScopedLocals();\r\n outerFlow.inherit(innerFlow); // TODO: only if not terminated?\r\n this.currentFlow = outerFlow;\r\n return flatten(this.module, stmts, NativeType.None);\r\n }\r\n\r\n compileBreakStatement(\r\n statement: BreakStatement,\r\n contextualFlags: ContextualFlags\r\n ): ExpressionRef {\r\n var module = this.module;\r\n if (statement.label) {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n statement.label.range\r\n );\r\n return module.unreachable();\r\n }\r\n var flow = this.currentFlow;\r\n var breakLabel = flow.breakLabel;\r\n if (breakLabel == null) {\r\n this.error(\r\n DiagnosticCode.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement,\r\n statement.range\r\n );\r\n return module.unreachable();\r\n }\r\n var stmts = new Array();\r\n this.performAutoreleases(flow, stmts);\r\n var current: Flow | null = flow.parent;\r\n while (current && current.breakLabel === breakLabel) {\r\n this.performAutoreleases(current, stmts, /* clearFlags */ false);\r\n current = current.parent;\r\n }\r\n flow.freeScopedLocals();\r\n stmts.push(module.br(breakLabel));\r\n flow.set(FlowFlags.BREAKS);\r\n return flatten(module, stmts, NativeType.None);\r\n }\r\n\r\n compileContinueStatement(\r\n statement: ContinueStatement,\r\n contextualFlags: ContextualFlags\r\n ): ExpressionRef {\r\n var module = this.module;\r\n var label = statement.label;\r\n if (label) {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n label.range\r\n );\r\n return module.unreachable();\r\n }\r\n // Check if 'continue' is allowed here\r\n var flow = this.currentFlow;\r\n var continueLabel = flow.continueLabel;\r\n if (continueLabel == null) {\r\n this.error(\r\n DiagnosticCode.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement,\r\n statement.range\r\n );\r\n return module.unreachable();\r\n }\r\n flow.set(FlowFlags.CONTINUES);\r\n var stmts = new Array();\r\n this.performAutoreleases(flow, stmts);\r\n var current: Flow | null = flow.parent;\r\n while (current && current.continueLabel === continueLabel) {\r\n this.performAutoreleases(current, stmts, /* clearFlags */ false);\r\n current = current.parent;\r\n }\r\n flow.freeScopedLocals();\r\n stmts.push(module.br(continueLabel));\r\n return flatten(module, stmts, NativeType.None);\r\n }\r\n\r\n compileDoStatement(\r\n statement: DoStatement,\r\n contextualFlags: ContextualFlags\r\n ): ExpressionRef {\r\n var module = this.module;\r\n\r\n var outerFlow = this.currentFlow;\r\n var label = outerFlow.pushBreakLabel();\r\n var innerFlow = outerFlow.fork();\r\n this.currentFlow = innerFlow;\r\n var breakLabel = \"break|\" + label;\r\n innerFlow.breakLabel = breakLabel;\r\n var continueLabel = \"continue|\" + label;\r\n innerFlow.continueLabel = continueLabel;\r\n\r\n var stmts = new Array();\r\n if (statement.statement.kind == NodeKind.BLOCK) {\r\n this.compileStatements((statement.statement).statements, false, stmts);\r\n } else {\r\n stmts.push(\r\n this.compileStatement(statement.statement)\r\n );\r\n }\r\n var condExpr = this.makeIsTrueish(\r\n this.compileExpression(statement.condition, Type.i32),\r\n this.currentType\r\n );\r\n // TODO: check if condition is always false and if so, omit it (just a block)\r\n\r\n // Switch back to the parent flow\r\n var terminated = innerFlow.isAny(FlowFlags.ANY_TERMINATING);\r\n if (!terminated) this.performAutoreleases(innerFlow, stmts);\r\n innerFlow.freeScopedLocals();\r\n outerFlow.popBreakLabel();\r\n this.currentFlow = outerFlow;\r\n innerFlow.unset(\r\n FlowFlags.BREAKS |\r\n FlowFlags.CONDITIONALLY_BREAKS |\r\n FlowFlags.CONTINUES |\r\n FlowFlags.CONDITIONALLY_CONTINUES\r\n );\r\n outerFlow.inherit(innerFlow);\r\n\r\n var block: ExpressionRef[] = [\r\n module.loop(continueLabel,\r\n terminated\r\n ? flatten(module, stmts, NativeType.None) // skip trailing continue if unnecessary\r\n : module.block(null, [\r\n flatten(module, stmts, NativeType.None),\r\n module.br(continueLabel, condExpr)\r\n ], NativeType.None)\r\n )\r\n ];\r\n if (terminated) block.push(module.unreachable());\r\n return module.block(breakLabel, block);\r\n }\r\n\r\n compileEmptyStatement(\r\n statement: EmptyStatement,\r\n contextualFlags: ContextualFlags\r\n ): ExpressionRef {\r\n return this.module.nop();\r\n }\r\n\r\n compileExpressionStatement(\r\n statement: ExpressionStatement,\r\n contextualFlags: ContextualFlags,\r\n ): ExpressionRef {\r\n return this.compileExpression(statement.expression, Type.void,\r\n contextualFlags | ContextualFlags.EXPLICIT | ContextualFlags.WILL_DROP\r\n );\r\n }\r\n\r\n compileForStatement(\r\n statement: ForStatement,\r\n contextualFlags: ContextualFlags\r\n ): ExpressionRef {\r\n // A for statement initiates a new branch with its own scoped variables\r\n // possibly declared in its initializer, and break context.\r\n var outerFlow = this.currentFlow;\r\n var label = outerFlow.pushBreakLabel();\r\n var innerFlow = outerFlow.fork();\r\n this.currentFlow = innerFlow;\r\n var breakLabel = innerFlow.breakLabel = \"break|\" + label;\r\n innerFlow.breakLabel = breakLabel;\r\n var continueLabel = \"continue|\" + label;\r\n innerFlow.continueLabel = continueLabel;\r\n var repeatLabel = \"repeat|\" + label;\r\n\r\n // Compile in correct order\r\n var module = this.module;\r\n var initExpr = statement.initializer\r\n ? this.compileStatement(statement.initializer)\r\n : 0;\r\n var condExpr: ExpressionRef = 0;\r\n var alwaysTrue = false;\r\n if (statement.condition) {\r\n condExpr = module.precomputeExpression(\r\n this.makeIsTrueish(\r\n this.compileExpressionRetainType(statement.condition, Type.bool),\r\n this.currentType\r\n )\r\n );\r\n // check if the condition is always true\r\n if (getExpressionId(condExpr) == ExpressionId.Const) {\r\n assert(getExpressionType(condExpr) == NativeType.I32);\r\n if (getConstValueI32(condExpr) != 0) alwaysTrue = true;\r\n // TODO: could skip compilation if the condition is always false here, but beware that the\r\n // initializer could still declare new 'var's that are used later on.\r\n }\r\n } else {\r\n // omitted condition is always true\r\n condExpr = module.i32(1);\r\n alwaysTrue = true;\r\n }\r\n innerFlow.inheritNonnullIfTrue(condExpr);\r\n var incrExpr = statement.incrementor\r\n ? this.compileExpression(statement.incrementor, Type.void,\r\n ContextualFlags.IMPLICIT | ContextualFlags.WILL_DROP\r\n )\r\n : 0;\r\n var bodyStatement = statement.statement;\r\n var stmts = new Array();\r\n if (bodyStatement.kind == NodeKind.BLOCK) {\r\n this.compileStatements((bodyStatement).statements, false, stmts);\r\n } else {\r\n stmts.push(\r\n this.compileStatement(bodyStatement)\r\n );\r\n }\r\n if (!innerFlow.isAny(FlowFlags.ANY_TERMINATING)) this.performAutoreleases(innerFlow, stmts);\r\n\r\n // Switch back to the parent flow\r\n innerFlow.freeScopedLocals();\r\n outerFlow.popBreakLabel();\r\n this.currentFlow = outerFlow;\r\n var usesContinue = innerFlow.isAny(FlowFlags.CONTINUES | FlowFlags.CONDITIONALLY_CONTINUES);\r\n innerFlow.unset(\r\n FlowFlags.BREAKS |\r\n FlowFlags.CONDITIONALLY_BREAKS |\r\n FlowFlags.CONTINUES |\r\n FlowFlags.CONDITIONALLY_CONTINUES\r\n );\r\n if (alwaysTrue) outerFlow.inherit(innerFlow);\r\n else outerFlow.inheritConditional(innerFlow);\r\n\r\n var breakBlock = new Array(); // outer 'break' block\r\n if (initExpr) breakBlock.push(initExpr);\r\n\r\n var repeatBlock = new Array(); // block repeating the loop\r\n if (usesContinue) {\r\n stmts.unshift(\r\n module.br(breakLabel, module.unary(UnaryOp.EqzI32, condExpr))\r\n );\r\n repeatBlock.push(\r\n module.block(continueLabel, stmts, NativeType.None)\r\n );\r\n } else { // can omit the 'continue' block\r\n repeatBlock.push(\r\n module.br(breakLabel, module.unary(UnaryOp.EqzI32, condExpr))\r\n );\r\n for (let i = 0, k = stmts.length; i < k; ++i) {\r\n repeatBlock.push(stmts[i]);\r\n }\r\n }\r\n if (incrExpr) repeatBlock.push(incrExpr);\r\n repeatBlock.push(\r\n module.br(repeatLabel)\r\n );\r\n\r\n breakBlock.push(\r\n module.loop(repeatLabel, module.block(null, repeatBlock, NativeType.None))\r\n );\r\n\r\n return module.block(breakLabel, breakBlock);\r\n }\r\n\r\n compileIfStatement(\r\n statement: IfStatement,\r\n contextualFlags: ContextualFlags\r\n ): ExpressionRef {\r\n var module = this.module;\r\n var ifTrue = statement.ifTrue;\r\n var ifFalse = statement.ifFalse;\r\n var outerFlow = this.currentFlow;\r\n\r\n // The condition doesn't initiate a branch yet\r\n var condExpr = module.precomputeExpression(\r\n this.makeIsTrueish(\r\n this.compileExpressionRetainType(statement.condition, Type.bool),\r\n this.currentType\r\n )\r\n );\r\n\r\n // Try to eliminate unnecesssary branches if the condition is constant\r\n if (\r\n getExpressionId(condExpr) == ExpressionId.Const &&\r\n getExpressionType(condExpr) == NativeType.I32\r\n ) {\r\n return getConstValueI32(condExpr)\r\n ? this.compileStatement(ifTrue)\r\n : ifFalse\r\n ? this.compileStatement(ifFalse)\r\n : module.nop();\r\n }\r\n\r\n // Each arm initiates a branch\r\n var ifTrueStmts = new Array();\r\n var ifTrueFlow = outerFlow.fork();\r\n this.currentFlow = ifTrueFlow;\r\n ifTrueFlow.inheritNonnullIfTrue(condExpr);\r\n if (ifTrue.kind == NodeKind.BLOCK) {\r\n this.compileStatements((ifTrue).statements, false, ifTrueStmts);\r\n } else {\r\n ifTrueStmts.push(this.compileStatement(ifTrue));\r\n }\r\n if (!ifTrueFlow.isAny(FlowFlags.ANY_TERMINATING)) this.performAutoreleases(ifTrueFlow, ifTrueStmts);\r\n ifTrueFlow.freeScopedLocals();\r\n this.currentFlow = outerFlow;\r\n\r\n if (ifFalse) {\r\n let ifFalseFlow = outerFlow.fork();\r\n this.currentFlow = ifFalseFlow;\r\n ifFalseFlow.inheritNonnullIfFalse(condExpr);\r\n let ifFalseStmts = new Array();\r\n if (ifFalse.kind == NodeKind.BLOCK) {\r\n this.compileStatements((ifFalse).statements, false, ifFalseStmts);\r\n } else {\r\n ifFalseStmts.push(this.compileStatement(ifFalse));\r\n }\r\n if (!ifFalseFlow.isAny(FlowFlags.ANY_TERMINATING)) this.performAutoreleases(ifFalseFlow, ifFalseStmts);\r\n ifFalseFlow.freeScopedLocals();\r\n this.currentFlow = outerFlow;\r\n outerFlow.inheritMutual(ifTrueFlow, ifFalseFlow);\r\n return module.if(condExpr,\r\n flatten(module, ifTrueStmts, NativeType.None),\r\n flatten(module, ifFalseStmts, NativeType.None)\r\n );\r\n } else {\r\n outerFlow.inheritConditional(ifTrueFlow);\r\n if (ifTrueFlow.isAny(FlowFlags.ANY_TERMINATING)) {\r\n outerFlow.inheritNonnullIfFalse(condExpr);\r\n }\r\n return module.if(condExpr,\r\n flatten(module, ifTrueStmts, NativeType.None)\r\n );\r\n }\r\n // TODO: Detect neglected condition\r\n // if (!foo) {\r\n // foo = [notNull]\r\n // }\r\n // foo // is possibly null\r\n }\r\n\r\n compileReturnStatement(\r\n statement: ReturnStatement,\r\n contextualFlags: ContextualFlags\r\n ): ExpressionRef {\r\n var module = this.module;\r\n var expr: ExpressionRef = 0;\r\n var flow = this.currentFlow;\r\n var returnType = flow.returnType;\r\n\r\n // Remember that this flow returns\r\n flow.set(FlowFlags.RETURNS);\r\n\r\n var valueExpression = statement.value;\r\n if (valueExpression) {\r\n if (returnType == Type.void) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_assignable_to_type_1,\r\n valueExpression.range, this.currentType.toString(), returnType.toString()\r\n );\r\n this.currentType = Type.void;\r\n return module.unreachable();\r\n }\r\n let contextualFlags = ContextualFlags.IMPLICIT;\r\n if (flow.actualFunction.is(CommonFlags.MODULE_EXPORT)) contextualFlags |= ContextualFlags.WRAP;\r\n expr = this.compileExpression(valueExpression, returnType, contextualFlags | ContextualFlags.SKIP_AUTORELEASE);\r\n\r\n // when returning a local, and it is already retained, skip the final set\r\n // of retaining it as the return value and releasing it as a variable\r\n if (!this.skippedAutoreleases.has(expr)) {\r\n if (returnType.isManaged) {\r\n if (getExpressionId(expr) == ExpressionId.LocalGet) {\r\n if (flow.isAnyLocalFlag(getLocalGetIndex(expr), LocalFlags.ANY_RETAINED)) {\r\n flow.unsetLocalFlag(getLocalGetIndex(expr), LocalFlags.ANY_RETAINED);\r\n this.skippedAutoreleases.add(expr);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // remember return states\r\n if (!flow.canOverflow(expr, returnType)) flow.set(FlowFlags.RETURNS_WRAPPED);\r\n if (flow.isNonnull(expr, returnType)) flow.set(FlowFlags.RETURNS_NONNULL);\r\n\r\n } else if (returnType != Type.void) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_assignable_to_type_1,\r\n statement.range, \"void\", returnType.toString()\r\n );\r\n expr = module.unreachable();\r\n }\r\n\r\n var stmts = new Array();\r\n this.performAutoreleases(flow, stmts);\r\n this.finishAutoreleases(flow, stmts);\r\n\r\n // Make sure that the return value is retained for the caller\r\n if (returnType.isManaged && !this.skippedAutoreleases.has(expr)) expr = this.makeRetain(expr);\r\n\r\n if (returnType != Type.void && stmts.length) {\r\n let temp = flow.getAndFreeTempLocal(returnType);\r\n if (flow.isNonnull(expr, returnType)) flow.setLocalFlag(temp.index, LocalFlags.NONNULL);\r\n stmts.unshift(\r\n module.local_set(temp.index, expr)\r\n );\r\n expr = module.local_get(temp.index, returnType.toNativeType());\r\n }\r\n flow.freeScopedLocals();\r\n\r\n // If the last statement anyway, make it the block's return value\r\n if ((contextualFlags & ContextualFlags.LAST_IN_BODY) != 0 && expr && returnType != Type.void) {\r\n if (!stmts.length) return expr;\r\n stmts.push(expr);\r\n return module.block(null, stmts, returnType.toNativeType());\r\n }\r\n\r\n // When inlining, break to the end of the inlined function's block (no need to wrap)\r\n if (flow.is(FlowFlags.INLINE_CONTEXT)) {\r\n if (!stmts.length) return module.br(assert(flow.inlineReturnLabel), 0, expr);\r\n stmts.push(module.br(assert(flow.inlineReturnLabel), 0, expr));\r\n // stmts.push(module.createUnreachable());\r\n return module.block(null, stmts);\r\n }\r\n\r\n // Otherwise emit a normal return\r\n if (!stmts.length) return module.return(expr);\r\n stmts.push(module.return(expr));\r\n return module.block(null, stmts);\r\n }\r\n\r\n compileSwitchStatement(statement: SwitchStatement, contextualFlags: ContextualFlags): ExpressionRef {\r\n var module = this.module;\r\n\r\n var cases = statement.cases;\r\n var numCases = cases.length;\r\n if (!numCases) {\r\n return this.compileExpression(statement.condition, Type.void,\r\n ContextualFlags.IMPLICIT\r\n );\r\n }\r\n\r\n // Everything within a switch uses the same break context\r\n var outerFlow = this.currentFlow;\r\n var context = outerFlow.pushBreakLabel();\r\n\r\n // introduce a local for evaluating the condition (exactly once)\r\n var tempLocal = outerFlow.getTempLocal(Type.u32);\r\n var tempLocalIndex = tempLocal.index;\r\n\r\n // Prepend initializer to inner block. Does not initiate a new branch, yet.\r\n var breaks = new Array(1 + numCases);\r\n breaks[0] = module.local_set( // initializer\r\n tempLocalIndex,\r\n this.compileExpression(statement.condition, Type.u32,\r\n ContextualFlags.IMPLICIT\r\n )\r\n );\r\n\r\n // make one br_if per (possibly dynamic) labeled case (binaryen optimizes to br_table where possible)\r\n var breakIndex = 1;\r\n var defaultIndex = -1;\r\n for (let i = 0; i < numCases; ++i) {\r\n let case_ = cases[i];\r\n let label = case_.label;\r\n if (label) {\r\n breaks[breakIndex++] = module.br(\"case\" + i.toString(10) + \"|\" + context,\r\n module.binary(BinaryOp.EqI32,\r\n module.local_get(tempLocalIndex, NativeType.I32),\r\n this.compileExpression(label, Type.u32,\r\n ContextualFlags.IMPLICIT\r\n )\r\n )\r\n );\r\n } else {\r\n defaultIndex = i;\r\n }\r\n }\r\n\r\n outerFlow.freeTempLocal(tempLocal);\r\n\r\n // otherwise br to default respectively out of the switch if there is no default case\r\n breaks[breakIndex] = module.br((defaultIndex >= 0\r\n ? \"case\" + defaultIndex.toString(10)\r\n : \"break\"\r\n ) + \"|\" + context);\r\n\r\n // nest blocks in order\r\n var currentBlock = module.block(\"case0|\" + context, breaks, NativeType.None);\r\n var alwaysReturns = true;\r\n var alwaysReturnsWrapped = true;\r\n var alwaysThrows = true;\r\n var alwaysAllocates = true;\r\n for (let i = 0; i < numCases; ++i) {\r\n let case_ = cases[i];\r\n let statements = case_.statements;\r\n let numStatements = statements.length;\r\n\r\n // Each switch case initiates a new branch\r\n let innerFlow = outerFlow.fork();\r\n this.currentFlow = innerFlow;\r\n let breakLabel = \"break|\" + context;\r\n innerFlow.breakLabel = breakLabel;\r\n\r\n let isLast = i == numCases - 1;\r\n let nextLabel = isLast ? breakLabel : \"case\" + (i + 1).toString(10) + \"|\" + context;\r\n let stmts = new Array(1 + numStatements);\r\n stmts[0] = currentBlock;\r\n let count = 1;\r\n let terminated = false;\r\n for (let j = 0; j < numStatements; ++j) {\r\n let stmt = this.compileStatement(statements[j]);\r\n if (getExpressionId(stmt) != ExpressionId.Nop) {\r\n stmts[count++] = stmt;\r\n if (innerFlow.isAny(FlowFlags.ANY_TERMINATING)) {\r\n terminated = true;\r\n break;\r\n }\r\n }\r\n }\r\n stmts.length = count;\r\n if (terminated || isLast) {\r\n if (!innerFlow.is(FlowFlags.RETURNS)) alwaysReturns = false;\r\n if (!innerFlow.is(FlowFlags.RETURNS_WRAPPED)) alwaysReturnsWrapped = false;\r\n if (!innerFlow.is(FlowFlags.THROWS)) alwaysThrows = false;\r\n if (!innerFlow.is(FlowFlags.ALLOCATES)) alwaysAllocates = false;\r\n }\r\n\r\n // Switch back to the parent flow\r\n if (!innerFlow.isAny(FlowFlags.ANY_TERMINATING)) this.performAutoreleases(innerFlow, stmts);\r\n innerFlow.unset(\r\n FlowFlags.BREAKS |\r\n FlowFlags.CONDITIONALLY_BREAKS\r\n );\r\n innerFlow.freeScopedLocals();\r\n this.currentFlow = outerFlow;\r\n currentBlock = module.block(nextLabel, stmts, NativeType.None); // must be a labeled block\r\n }\r\n outerFlow.popBreakLabel();\r\n\r\n // If the switch has a default (guaranteed to handle any value), propagate common flags\r\n if (defaultIndex >= 0) {\r\n if (alwaysReturns) outerFlow.set(FlowFlags.RETURNS);\r\n if (alwaysReturnsWrapped) outerFlow.set(FlowFlags.RETURNS_WRAPPED);\r\n if (alwaysThrows) outerFlow.set(FlowFlags.THROWS);\r\n if (alwaysAllocates) outerFlow.set(FlowFlags.ALLOCATES);\r\n }\r\n return currentBlock;\r\n }\r\n\r\n compileThrowStatement(\r\n statement: ThrowStatement,\r\n contextualFlags: ContextualFlags\r\n ): ExpressionRef {\r\n var flow = this.currentFlow;\r\n\r\n // Remember that this branch throws\r\n flow.set(FlowFlags.THROWS);\r\n\r\n // FIXME: without try-catch it is safe to assume RETURNS as well for now\r\n flow.set(FlowFlags.RETURNS);\r\n\r\n var stmts = new Array();\r\n this.finishAutoreleases(flow, stmts);\r\n\r\n // TODO: requires exception-handling spec.\r\n var value = statement.value;\r\n var message: Expression | null = null;\r\n if (value.kind == NodeKind.NEW) {\r\n let newArgs = (value).arguments;\r\n if (newArgs.length) message = newArgs[0]; // FIXME: naively assumes type string\r\n }\r\n stmts.push(compileAbort(this, message, statement));\r\n\r\n return flatten(this.module, stmts, NativeType.None);\r\n }\r\n\r\n compileTryStatement(\r\n statement: TryStatement,\r\n contextualFlags: ContextualFlags\r\n ): ExpressionRef {\r\n // TODO: can't yet support something like: try { return ... } finally { ... }\r\n // worthwhile to investigate lowering returns to block results (here)?\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n statement.range\r\n );\r\n return this.module.unreachable();\r\n }\r\n\r\n /** Compiles a variable statement. Returns `0` if an initializer is not necessary. */\r\n compileVariableStatement(statement: VariableStatement, contextualFlags: ContextualFlags): ExpressionRef {\r\n var module = this.module;\r\n var declarations = statement.declarations;\r\n var numDeclarations = declarations.length;\r\n var flow = this.currentFlow;\r\n var initializers = new Array();\r\n var resolver = this.resolver;\r\n\r\n for (let i = 0; i < numDeclarations; ++i) {\r\n let declaration = declarations[i];\r\n let name = declaration.name.text;\r\n let type: Type | null = null;\r\n let initExpr: ExpressionRef = 0;\r\n let initAutoreleaseSkipped = false;\r\n\r\n // Resolve type if annotated\r\n if (declaration.type) {\r\n type = resolver.resolveType( // reports\r\n declaration.type,\r\n flow.actualFunction,\r\n flow.contextualTypeArguments\r\n );\r\n if (!type) continue;\r\n if (declaration.initializer) {\r\n initExpr = this.compileExpression(declaration.initializer, type, // reports\r\n ContextualFlags.IMPLICIT | ContextualFlags.SKIP_AUTORELEASE\r\n );\r\n initAutoreleaseSkipped = this.skippedAutoreleases.has(initExpr);\r\n }\r\n\r\n // Otherwise infer type from initializer\r\n } else if (declaration.initializer) {\r\n initExpr = this.compileExpressionRetainType(declaration.initializer, Type.void,\r\n ContextualFlags.SKIP_AUTORELEASE\r\n ); // reports\r\n initAutoreleaseSkipped = this.skippedAutoreleases.has(initExpr);\r\n if (this.currentType == Type.void) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_assignable_to_type_1,\r\n declaration.range, this.currentType.toString(), \"\"\r\n );\r\n continue;\r\n }\r\n type = this.currentType;\r\n\r\n // Error if there's neither a type nor an initializer\r\n } else {\r\n this.error(\r\n DiagnosticCode.Type_expected,\r\n declaration.name.range.atEnd\r\n );\r\n continue;\r\n }\r\n\r\n // Handle constants, and try to inline if value is static\r\n let isConst = declaration.is(CommonFlags.CONST);\r\n let isStatic = false;\r\n if (isConst) {\r\n if (initExpr) {\r\n initExpr = module.precomputeExpression(initExpr);\r\n if (getExpressionId(initExpr) == ExpressionId.Const) {\r\n let local = new Local(name, -1, type, flow.parentFunction);\r\n switch (getExpressionType(initExpr)) {\r\n case NativeType.I32: {\r\n local.setConstantIntegerValue(\r\n i64_new(\r\n getConstValueI32(initExpr),\r\n 0\r\n ),\r\n type\r\n );\r\n break;\r\n }\r\n case NativeType.I64: {\r\n local.setConstantIntegerValue(\r\n i64_new(\r\n getConstValueI64Low(initExpr),\r\n getConstValueI64High(initExpr)\r\n ),\r\n type\r\n );\r\n break;\r\n }\r\n case NativeType.F32: {\r\n local.setConstantFloatValue(getConstValueF32(initExpr), type);\r\n break;\r\n }\r\n case NativeType.F64: {\r\n local.setConstantFloatValue(getConstValueF64(initExpr), type);\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n return module.unreachable();\r\n }\r\n }\r\n // Create a virtual local that doesn't actually exist in WebAssembly\r\n let scopedLocals = flow.scopedLocals;\r\n if (!scopedLocals) flow.scopedLocals = scopedLocals = new Map();\r\n else if (scopedLocals.has(name)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, name\r\n );\r\n return this.module.unreachable();\r\n }\r\n scopedLocals.set(name, local);\r\n isStatic = true;\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._const_declarations_must_be_initialized,\r\n declaration.range\r\n );\r\n }\r\n }\r\n\r\n // Otherwise compile as mutable\r\n if (!isStatic) {\r\n let local: Local;\r\n if (\r\n declaration.isAny(CommonFlags.LET | CommonFlags.CONST) ||\r\n flow.is(FlowFlags.INLINE_CONTEXT)\r\n ) { // here: not top-level\r\n let existingLocal = flow.getScopedLocal(name);\r\n if (existingLocal) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, declaration.name.text\r\n );\r\n local = existingLocal;\r\n } else {\r\n local = flow.addScopedLocal(name, type);\r\n }\r\n if (isConst) flow.setLocalFlag(local.index, LocalFlags.CONSTANT);\r\n } else {\r\n if (flow.lookupLocal(name)) {\r\n this.error(\r\n DiagnosticCode.Duplicate_identifier_0,\r\n declaration.name.range, name\r\n );\r\n continue;\r\n }\r\n local = flow.parentFunction.addLocal(type, name, declaration);\r\n if (isConst) flow.setLocalFlag(local.index, LocalFlags.CONSTANT);\r\n }\r\n let isManaged = type.isManaged;\r\n if (initExpr) {\r\n if (flow.isNonnull(initExpr, type)) flow.setLocalFlag(local.index, LocalFlags.NONNULL);\r\n if (isManaged) {\r\n flow.setLocalFlag(local.index, LocalFlags.RETAINED);\r\n initializers.push(\r\n module.local_set(local.index,\r\n initAutoreleaseSkipped\r\n ? initExpr\r\n : this.makeRetain(initExpr)\r\n )\r\n );\r\n } else {\r\n initializers.push(\r\n module.local_set(local.index, initExpr)\r\n );\r\n if (local.type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) {\r\n if (!flow.canOverflow(initExpr, type)) flow.setLocalFlag(local.index, LocalFlags.WRAPPED);\r\n else flow.unsetLocalFlag(local.index, LocalFlags.WRAPPED);\r\n }\r\n }\r\n } else {\r\n if (isManaged) {\r\n // This is necessary because the first use (and assign) of the local could be taking place\r\n // in a loop, subsequently marking it retained, but the second iteration of the loop\r\n // still wouldn't release whatever is assigned in the first. Likewise, if the variable wasn't\r\n // initialized but becomes released later on, whatever was stored before would be released.\r\n // TODO: Detect this condition inside of a loop instead?\r\n initializers.push(\r\n module.local_set(local.index,\r\n type.toNativeZero(module)\r\n )\r\n );\r\n flow.setLocalFlag(local.index, LocalFlags.CONDITIONALLY_RETAINED);\r\n } else if (local.type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) {\r\n flow.setLocalFlag(local.index, LocalFlags.WRAPPED);\r\n }\r\n }\r\n }\r\n }\r\n return initializers.length == 0\r\n ? 0\r\n : flatten(module, initializers, NativeType.None);\r\n }\r\n\r\n compileVoidStatement(statement: VoidStatement, contextualFlags: ContextualFlags): ExpressionRef {\r\n return this.compileExpression(statement.expression, Type.void,\r\n ContextualFlags.EXPLICIT | ContextualFlags.WILL_DROP\r\n );\r\n }\r\n\r\n compileWhileStatement(statement: WhileStatement, contextualFlags: ContextualFlags): ExpressionRef {\r\n var module = this.module;\r\n var outerFlow = this.currentFlow;\r\n\r\n // The condition does not yet initialize a branch\r\n var condExpr = module.precomputeExpression(\r\n this.makeIsTrueish(\r\n this.compileExpressionRetainType(statement.condition, Type.bool),\r\n this.currentType\r\n )\r\n );\r\n\r\n // Try to eliminate unnecesssary loops if the condition is constant\r\n if (\r\n getExpressionId(condExpr) == ExpressionId.Const &&\r\n getExpressionType(condExpr) == NativeType.I32\r\n ) {\r\n if (!getConstValueI32(condExpr)) return module.nop();\r\n }\r\n\r\n // Statements initiate a new branch with its own break context\r\n var label = outerFlow.pushBreakLabel();\r\n var innerFlow = outerFlow.fork();\r\n this.currentFlow = innerFlow;\r\n var breakLabel = \"break|\" + label;\r\n innerFlow.breakLabel = breakLabel;\r\n var continueLabel = \"continue|\" + label;\r\n innerFlow.continueLabel = continueLabel;\r\n\r\n innerFlow.inheritNonnullIfTrue(condExpr);\r\n var stmts = new Array();\r\n if (statement.statement.kind == NodeKind.BLOCK) {\r\n this.compileStatements((statement.statement).statements, false, stmts);\r\n } else {\r\n stmts.push(this.compileStatement(statement.statement));\r\n }\r\n var alwaysTrue = false; // TODO\r\n var terminated = innerFlow.isAny(FlowFlags.ANY_TERMINATING);\r\n if (!terminated) {\r\n this.performAutoreleases(innerFlow, stmts);\r\n stmts.push(module.br(continueLabel));\r\n }\r\n innerFlow.freeScopedLocals();\r\n\r\n // Switch back to the parent flow\r\n outerFlow.popBreakLabel();\r\n this.currentFlow = outerFlow;\r\n innerFlow.unset(\r\n FlowFlags.BREAKS |\r\n FlowFlags.CONDITIONALLY_BREAKS |\r\n FlowFlags.CONTINUES |\r\n FlowFlags.CONDITIONALLY_CONTINUES\r\n );\r\n if (alwaysTrue) outerFlow.inherit(innerFlow);\r\n else outerFlow.inheritConditional(innerFlow);\r\n\r\n return module.block(breakLabel, [\r\n module.loop(continueLabel,\r\n module.if(condExpr,\r\n flatten(module, stmts, NativeType.None)\r\n )\r\n )\r\n ]);\r\n }\r\n\r\n // === Expressions ==============================================================================\r\n\r\n /** Compiles the value of an inlined constant element. */\r\n compileInlineConstant(\r\n element: VariableLikeElement,\r\n contextualType: Type,\r\n contextualFlags: ContextualFlags\r\n ): ExpressionRef {\r\n assert(element.is(CommonFlags.INLINED));\r\n var type = element.type;\r\n switch (\r\n !(contextualFlags & (ContextualFlags.IMPLICIT | ContextualFlags.EXPLICIT)) &&\r\n type.is(TypeFlags.INTEGER) &&\r\n contextualType.is(TypeFlags.INTEGER) &&\r\n type.size < contextualType.size\r\n ? (this.currentType = contextualType).kind // essentially precomputes a (sign-)extension\r\n : (this.currentType = type).kind\r\n ) {\r\n case TypeKind.I8:\r\n case TypeKind.I16: {\r\n let shift = type.computeSmallIntegerShift(Type.i32);\r\n return this.module.i32(\r\n element.constantValueKind == ConstantValueKind.INTEGER\r\n ? i64_low(element.constantIntegerValue) << shift >> shift\r\n : 0\r\n ); // recognized by canOverflow\r\n }\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.BOOL: {\r\n let mask = element.type.computeSmallIntegerMask(Type.i32);\r\n return this.module.i32(\r\n element.constantValueKind == ConstantValueKind.INTEGER\r\n ? i64_low(element.constantIntegerValue) & mask\r\n : 0\r\n ); // recognized by canOverflow\r\n }\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n return this.module.i32(\r\n element.constantValueKind == ConstantValueKind.INTEGER\r\n ? i64_low(element.constantIntegerValue)\r\n : 0\r\n );\r\n }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n if (!element.program.options.isWasm64) {\r\n return this.module.i32(\r\n element.constantValueKind == ConstantValueKind.INTEGER\r\n ? i64_low(element.constantIntegerValue)\r\n : 0\r\n );\r\n }\r\n // fall-through\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n return element.constantValueKind == ConstantValueKind.INTEGER\r\n ? this.module.i64(\r\n i64_low(element.constantIntegerValue),\r\n i64_high(element.constantIntegerValue)\r\n )\r\n : this.module.i64(0);\r\n }\r\n case TypeKind.F64: {\r\n // monkey-patch for converting built-in floats to f32 implicitly\r\n if (!(element.hasDecorator(DecoratorFlags.BUILTIN) && contextualType == Type.f32)) {\r\n return this.module.f64((element).constantFloatValue);\r\n }\r\n // otherwise fall-through: basically precomputes f32.demote/f64 of NaN / Infinity\r\n this.currentType = Type.f32;\r\n }\r\n case TypeKind.F32: {\r\n return this.module.f32((element).constantFloatValue);\r\n }\r\n default: {\r\n assert(false);\r\n return this.module.unreachable();\r\n }\r\n }\r\n }\r\n\r\n compileExpression(\r\n expression: Expression,\r\n contextualType: Type,\r\n contextualFlags: ContextualFlags = ContextualFlags.NONE\r\n ): ExpressionRef {\r\n this.currentType = contextualType;\r\n var expr: ExpressionRef;\r\n if (contextualType == Type.void) contextualFlags |= ContextualFlags.WILL_DROP;\r\n switch (expression.kind) {\r\n case NodeKind.ASSERTION: {\r\n expr = this.compileAssertionExpression(expression, contextualType, contextualFlags);\r\n break;\r\n }\r\n case NodeKind.BINARY: {\r\n expr = this.compileBinaryExpression(expression, contextualType, contextualFlags);\r\n break;\r\n }\r\n case NodeKind.CALL: {\r\n expr = this.compileCallExpression(expression, contextualType, contextualFlags);\r\n break;\r\n }\r\n case NodeKind.COMMA: {\r\n expr = this.compileCommaExpression(expression, contextualType, contextualFlags);\r\n break;\r\n }\r\n case NodeKind.ELEMENTACCESS: {\r\n expr = this.compileElementAccessExpression(expression, contextualType, contextualFlags);\r\n break;\r\n }\r\n case NodeKind.FUNCTION: {\r\n expr = this.compileFunctionExpression(expression, contextualType.signatureReference, contextualFlags);\r\n break;\r\n }\r\n case NodeKind.IDENTIFIER:\r\n case NodeKind.FALSE:\r\n case NodeKind.NULL:\r\n case NodeKind.THIS:\r\n case NodeKind.SUPER:\r\n case NodeKind.TRUE: {\r\n expr = this.compileIdentifierExpression(expression, contextualType, contextualFlags);\r\n break;\r\n }\r\n case NodeKind.INSTANCEOF: {\r\n expr = this.compileInstanceOfExpression(expression, contextualType, contextualFlags);\r\n break;\r\n }\r\n case NodeKind.LITERAL: {\r\n expr = this.compileLiteralExpression(expression, contextualType, contextualFlags);\r\n break;\r\n }\r\n case NodeKind.NEW: {\r\n expr = this.compileNewExpression(expression, contextualType, contextualFlags);\r\n break;\r\n }\r\n case NodeKind.PARENTHESIZED: {\r\n expr = this.compileExpression((expression).expression, contextualType, contextualFlags);\r\n break;\r\n }\r\n case NodeKind.PROPERTYACCESS: {\r\n expr = this.compilePropertyAccessExpression(expression, contextualType, contextualFlags);\r\n break;\r\n }\r\n case NodeKind.TERNARY: {\r\n expr = this.compileTernaryExpression(expression, contextualType, contextualFlags);\r\n break;\r\n }\r\n case NodeKind.UNARYPOSTFIX: {\r\n expr = this.compileUnaryPostfixExpression(expression, contextualType, contextualFlags);\r\n break;\r\n }\r\n case NodeKind.UNARYPREFIX: {\r\n expr = this.compileUnaryPrefixExpression(expression, contextualType, contextualFlags);\r\n break;\r\n }\r\n default: {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n expr = this.module.unreachable();\r\n }\r\n }\r\n // ensure conversion and wrapping in case the respective function doesn't on its own\r\n var currentType = this.currentType;\r\n var wrap = (contextualFlags & ContextualFlags.WRAP) != 0;\r\n if (currentType != contextualType) {\r\n if (contextualFlags & ContextualFlags.EXPLICIT) {\r\n expr = this.convertExpression(expr, currentType, contextualType, true, wrap, expression);\r\n wrap = false;\r\n this.currentType = contextualType;\r\n } else if (contextualFlags & ContextualFlags.IMPLICIT) {\r\n expr = this.convertExpression(expr, currentType, contextualType, false, wrap, expression);\r\n wrap = false;\r\n this.currentType = contextualType;\r\n }\r\n }\r\n if (wrap) expr = this.ensureSmallIntegerWrap(expr, currentType);\r\n // debug location is added here so the caller doesn't have to. means: compilation of an expression\r\n // must go through this function, with the respective per-kind functions not being used directly.\r\n if (this.options.sourceMap) this.addDebugLocation(expr, expression.range);\r\n return expr;\r\n }\r\n\r\n /** Compiles an expression while retaining the type, that is not void, it ultimately compiles to. */\r\n compileExpressionRetainType(\r\n expression: Expression,\r\n contextualType: Type,\r\n contextualFlags: ContextualFlags = ContextualFlags.NONE\r\n ): ExpressionRef {\r\n return this.compileExpression(expression,\r\n contextualType == Type.void\r\n ? Type.i32 // default to i32\r\n : contextualType,\r\n (contextualFlags & ~(ContextualFlags.IMPLICIT | ContextualFlags.EXPLICIT))\r\n );\r\n }\r\n\r\n /** Compiles and precomputes an expression, possibly yielding a costant value. */\r\n precomputeExpression(\r\n expression: Expression,\r\n contextualType: Type,\r\n contextualFlags: ContextualFlags = ContextualFlags.NONE\r\n ): ExpressionRef {\r\n return this.module.precomputeExpression(\r\n this.compileExpression(expression, contextualType, contextualFlags)\r\n );\r\n }\r\n\r\n convertExpression(\r\n expr: ExpressionRef,\r\n /** Original type. */\r\n fromType: Type,\r\n /** New type. */\r\n toType: Type,\r\n /** Whether the conversion is explicit.*/\r\n explicit: bool,\r\n /** Whether the result should be wrapped, if a small integer. */\r\n wrap: bool,\r\n reportNode: Node\r\n ): ExpressionRef {\r\n var module = this.module;\r\n\r\n // void to any\r\n if (fromType.kind == TypeKind.VOID) {\r\n assert(toType.kind != TypeKind.VOID); // convertExpression should not be called with void -> void\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_assignable_to_type_1,\r\n reportNode.range, fromType.toString(), toType.toString()\r\n );\r\n return module.unreachable();\r\n }\r\n\r\n // any to void\r\n if (toType.kind == TypeKind.VOID) return module.drop(expr);\r\n\r\n if (this.currentFlow.isNonnull(expr, fromType)) fromType = fromType.nonNullableType;\r\n\r\n if (!fromType.isAssignableTo(toType)) {\r\n if (!explicit) {\r\n if (fromType.nonNullableType == toType) {\r\n this.error(\r\n DiagnosticCode.Object_is_possibly_null,\r\n reportNode.range\r\n ); // recoverable\r\n } else {\r\n this.error(\r\n DiagnosticCode.Conversion_from_type_0_to_1_requires_an_explicit_cast,\r\n reportNode.range, fromType.toString(), toType.toString()\r\n ); // recoverable\r\n }\r\n }\r\n }\r\n\r\n if (fromType.is(TypeFlags.FLOAT)) {\r\n\r\n // float to float\r\n if (toType.is(TypeFlags.FLOAT)) {\r\n if (fromType.kind == TypeKind.F32) {\r\n\r\n // f32 to f64\r\n if (toType.kind == TypeKind.F64) {\r\n expr = module.unary(UnaryOp.PromoteF32, expr);\r\n }\r\n\r\n // otherwise f32 to f32\r\n\r\n // f64 to f32\r\n } else if (toType.kind == TypeKind.F32) {\r\n expr = module.unary(UnaryOp.DemoteF64, expr);\r\n }\r\n\r\n // otherwise f64 to f64\r\n\r\n // float to int\r\n } else if (toType.is(TypeFlags.INTEGER)) {\r\n\r\n // f32 to int\r\n if (fromType.kind == TypeKind.F32) {\r\n if (toType == Type.bool) {\r\n expr = module.binary(BinaryOp.NeF32, expr, module.f32(0));\r\n wrap = false;\r\n } else if (toType.is(TypeFlags.SIGNED)) {\r\n if (toType.is(TypeFlags.LONG)) {\r\n expr = module.unary(UnaryOp.TruncF32ToI64, expr);\r\n } else {\r\n expr = module.unary(UnaryOp.TruncF32ToI32, expr);\r\n }\r\n } else {\r\n if (toType.is(TypeFlags.LONG)) {\r\n expr = module.unary(UnaryOp.TruncF32ToU64, expr);\r\n } else {\r\n expr = module.unary(UnaryOp.TruncF32ToU32, expr);\r\n }\r\n }\r\n\r\n // f64 to int\r\n } else {\r\n if (toType == Type.bool) {\r\n expr = module.binary(BinaryOp.NeF64, expr, module.f64(0));\r\n wrap = false;\r\n } else if (toType.is(TypeFlags.SIGNED)) {\r\n if (toType.is(TypeFlags.LONG)) {\r\n expr = module.unary(UnaryOp.TruncF64ToI64, expr);\r\n } else {\r\n expr = module.unary(UnaryOp.TruncF64ToI32, expr);\r\n }\r\n } else {\r\n if (toType.is(TypeFlags.LONG)) {\r\n expr = module.unary(UnaryOp.TruncF64ToU64, expr);\r\n } else {\r\n expr = module.unary(UnaryOp.TruncF64ToU32, expr);\r\n }\r\n }\r\n }\r\n\r\n // float to void\r\n } else {\r\n assert(toType.flags == TypeFlags.NONE, \"void type expected\");\r\n expr = module.drop(expr);\r\n }\r\n\r\n // int to float\r\n } else if (fromType.is(TypeFlags.INTEGER) && toType.is(TypeFlags.FLOAT)) {\r\n\r\n // int to f32\r\n if (toType.kind == TypeKind.F32) {\r\n if (fromType.is(TypeFlags.LONG)) {\r\n expr = module.unary(\r\n fromType.is(TypeFlags.SIGNED)\r\n ? UnaryOp.ConvertI64ToF32\r\n : UnaryOp.ConvertU64ToF32,\r\n expr\r\n );\r\n } else {\r\n expr = module.unary(\r\n fromType.is(TypeFlags.SIGNED)\r\n ? UnaryOp.ConvertI32ToF32\r\n : UnaryOp.ConvertU32ToF32,\r\n expr\r\n );\r\n }\r\n\r\n // int to f64\r\n } else {\r\n if (fromType.is(TypeFlags.LONG)) {\r\n expr = module.unary(\r\n fromType.is(TypeFlags.SIGNED)\r\n ? UnaryOp.ConvertI64ToF64\r\n : UnaryOp.ConvertU64ToF64,\r\n expr\r\n );\r\n } else {\r\n expr = module.unary(\r\n fromType.is(TypeFlags.SIGNED)\r\n ? UnaryOp.ConvertI32ToF64\r\n : UnaryOp.ConvertU32ToF64,\r\n expr\r\n );\r\n }\r\n }\r\n\r\n // int to int\r\n } else {\r\n // i64 to ...\r\n if (fromType.is(TypeFlags.LONG)) {\r\n\r\n // i64 to i32 or smaller\r\n if (toType == Type.bool) {\r\n expr = module.binary(BinaryOp.NeI64, expr, module.i64(0));\r\n wrap = false;\r\n } else if (!toType.is(TypeFlags.LONG)) {\r\n expr = module.unary(UnaryOp.WrapI64, expr); // discards upper bits\r\n }\r\n\r\n // i32 or smaller to i64\r\n } else if (toType.is(TypeFlags.LONG)) {\r\n expr = module.unary(\r\n fromType.is(TypeFlags.SIGNED) ? UnaryOp.ExtendI32 : UnaryOp.ExtendU32,\r\n this.ensureSmallIntegerWrap(expr, fromType) // must clear garbage bits\r\n );\r\n wrap = false;\r\n\r\n // i32 to i32\r\n } else {\r\n // small i32 to ...\r\n if (fromType.is(TypeFlags.SHORT)) {\r\n // small i32 to larger i32\r\n if (fromType.size < toType.size) {\r\n expr = this.ensureSmallIntegerWrap(expr, fromType); // must clear garbage bits\r\n wrap = false;\r\n }\r\n }\r\n }\r\n }\r\n\r\n this.currentType = toType;\r\n return wrap\r\n ? this.ensureSmallIntegerWrap(expr, toType)\r\n : expr;\r\n }\r\n\r\n compileAssertionExpression(\r\n expression: AssertionExpression,\r\n contextualType: Type,\r\n contextualFlags: ContextualFlags\r\n ): ExpressionRef {\r\n switch (expression.assertionKind) {\r\n case AssertionKind.PREFIX:\r\n case AssertionKind.AS: {\r\n let flow = this.currentFlow;\r\n let toType = this.resolver.resolveType( // reports\r\n assert(expression.toType),\r\n flow.actualFunction,\r\n flow.contextualTypeArguments\r\n );\r\n if (!toType) return this.module.unreachable();\r\n return this.compileExpression(expression.expression, toType,\r\n contextualFlags | ContextualFlags.EXPLICIT\r\n );\r\n }\r\n case AssertionKind.NONNULL: {\r\n assert(!expression.toType);\r\n let expr = this.compileExpressionRetainType(expression.expression, contextualType);\r\n let type = this.currentType;\r\n if (this.currentFlow.isNonnull(expr, type)) {\r\n this.info(\r\n DiagnosticCode.Expression_is_never_null,\r\n expression.expression.range\r\n );\r\n } else if (!this.options.noAssert) {\r\n let module = this.module;\r\n let flow = this.currentFlow;\r\n let tempIndex = flow.getAndFreeTempLocal(type).index;\r\n if (!flow.canOverflow(expr, type)) flow.setLocalFlag(tempIndex, LocalFlags.WRAPPED);\r\n flow.setLocalFlag(tempIndex, LocalFlags.NONNULL);\r\n expr = module.if(\r\n module.local_tee(tempIndex, expr),\r\n module.local_get(tempIndex, type.toNativeType()),\r\n module.unreachable()\r\n );\r\n }\r\n this.currentType = this.currentType.nonNullableType;\r\n return expr;\r\n }\r\n default: assert(false);\r\n }\r\n return this.module.unreachable();\r\n }\r\n\r\n private f32ModInstance: Function | null = null;\r\n private f64ModInstance: Function | null = null;\r\n private f32PowInstance: Function | null = null;\r\n private f64PowInstance: Function | null = null;\r\n\r\n compileBinaryExpression(\r\n expression: BinaryExpression,\r\n contextualType: Type,\r\n contextualFlags: ContextualFlags\r\n ): ExpressionRef {\r\n var module = this.module;\r\n var left = expression.left;\r\n var right = expression.right;\r\n\r\n var leftExpr: ExpressionRef;\r\n var leftType: Type;\r\n var rightExpr: ExpressionRef;\r\n var rightType: Type;\r\n var commonType: Type | null;\r\n\r\n var expr: ExpressionRef;\r\n var compound = false;\r\n\r\n var operator = expression.operator;\r\n switch (operator) {\r\n case Token.LESSTHAN: {\r\n leftExpr = this.compileExpressionRetainType(left, contextualType);\r\n leftType = this.currentType;\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.LT);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.unreachable();\r\n }\r\n\r\n rightExpr = this.compileExpressionRetainType(right, leftType);\r\n rightType = this.currentType;\r\n if (commonType = Type.commonDenominator(leftType, rightType, true)) {\r\n leftExpr = this.convertExpression(leftExpr,\r\n leftType, leftType = commonType,\r\n false, true, // !\r\n left\r\n );\r\n rightExpr = this.convertExpression(rightExpr,\r\n rightType, rightType = commonType,\r\n false, true, // !\r\n right\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,\r\n expression.range, \"<\", leftType.toString(), rightType.toString()\r\n );\r\n this.currentType = contextualType;\r\n return module.unreachable();\r\n }\r\n switch (commonType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32: {\r\n expr = module.binary(BinaryOp.LtI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.I64: {\r\n expr = module.binary(BinaryOp.LtI64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.ISIZE: {\r\n expr = module.binary(\r\n this.options.isWasm64\r\n ? BinaryOp.LtI64\r\n : BinaryOp.LtI32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: {\r\n expr = module.binary(BinaryOp.LtU32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n expr = module.binary(\r\n this.options.isWasm64\r\n ? BinaryOp.LtU64\r\n : BinaryOp.LtU32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.U64: {\r\n expr = module.binary(BinaryOp.LtU64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n expr = module.binary(BinaryOp.LtF32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.binary(BinaryOp.LtF64, leftExpr, rightExpr);\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.unreachable();\r\n }\r\n }\r\n this.currentType = Type.bool;\r\n break;\r\n }\r\n case Token.GREATERTHAN: {\r\n leftExpr = this.compileExpressionRetainType(left, contextualType);\r\n leftType = this.currentType;\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.GT);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.unreachable();\r\n }\r\n\r\n rightExpr = this.compileExpressionRetainType(right, leftType);\r\n rightType = this.currentType;\r\n if (commonType = Type.commonDenominator(leftType, rightType, true)) {\r\n leftExpr = this.convertExpression(leftExpr,\r\n leftType, leftType = commonType,\r\n false, true, // !\r\n left\r\n );\r\n rightExpr = this.convertExpression(rightExpr,\r\n rightType, rightType = commonType,\r\n false, true, // !\r\n right\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,\r\n expression.range, \">\", leftType.toString(), rightType.toString()\r\n );\r\n this.currentType = contextualType;\r\n return module.unreachable();\r\n }\r\n switch (commonType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32: {\r\n expr = module.binary(BinaryOp.GtI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.ISIZE: {\r\n expr = module.binary(\r\n this.options.isWasm64\r\n ? BinaryOp.GtI64\r\n : BinaryOp.GtI32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.I64: {\r\n expr = module.binary(BinaryOp.GtI64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: {\r\n expr = module.binary(BinaryOp.GtU32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n expr = module.binary(\r\n this.options.isWasm64\r\n ? BinaryOp.GtU64\r\n : BinaryOp.GtU32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.U64: {\r\n expr = module.binary(BinaryOp.GtU64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n expr = module.binary(BinaryOp.GtF32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.binary(BinaryOp.GtF64, leftExpr, rightExpr);\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.unreachable();\r\n }\r\n }\r\n this.currentType = Type.bool;\r\n break;\r\n }\r\n case Token.LESSTHAN_EQUALS: {\r\n leftExpr = this.compileExpressionRetainType(left, contextualType);\r\n leftType = this.currentType;\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.LE);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.unreachable();\r\n }\r\n\r\n rightExpr = this.compileExpressionRetainType(right, leftType);\r\n rightType = this.currentType;\r\n if (commonType = Type.commonDenominator(leftType, rightType, true)) {\r\n leftExpr = this.convertExpression(leftExpr,\r\n leftType, leftType = commonType,\r\n false, true, // !\r\n left\r\n );\r\n rightExpr = this.convertExpression(rightExpr,\r\n rightType, rightType = commonType,\r\n false, true, // !\r\n right\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,\r\n expression.range, \"<=\", leftType.toString(), rightType.toString()\r\n );\r\n this.currentType = contextualType;\r\n return module.unreachable();\r\n }\r\n switch (commonType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32: {\r\n expr = module.binary(BinaryOp.LeI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.ISIZE: {\r\n expr = module.binary(\r\n this.options.isWasm64\r\n ? BinaryOp.LeI64\r\n : BinaryOp.LeI32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.I64: {\r\n expr = module.binary(BinaryOp.LeI64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: {\r\n expr = module.binary(BinaryOp.LeU32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n expr = module.binary(\r\n this.options.isWasm64\r\n ? BinaryOp.LeU64\r\n : BinaryOp.LeU32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.U64: {\r\n expr = module.binary(BinaryOp.LeU64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n expr = module.binary(BinaryOp.LeF32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.binary(BinaryOp.LeF64, leftExpr, rightExpr);\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.unreachable();\r\n }\r\n }\r\n this.currentType = Type.bool;\r\n break;\r\n }\r\n case Token.GREATERTHAN_EQUALS: {\r\n leftExpr = this.compileExpressionRetainType(left, contextualType);\r\n leftType = this.currentType;\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.GE);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.unreachable();\r\n }\r\n\r\n rightExpr = this.compileExpressionRetainType(right, leftType);\r\n rightType = this.currentType;\r\n if (commonType = Type.commonDenominator(leftType, rightType, true)) {\r\n leftExpr = this.convertExpression(leftExpr,\r\n leftType, leftType = commonType,\r\n false, true, // !\r\n left\r\n );\r\n rightExpr = this.convertExpression(rightExpr,\r\n rightType, rightType = commonType,\r\n false, true, // !\r\n right\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,\r\n expression.range, \">=\", leftType.toString(), rightType.toString()\r\n );\r\n this.currentType = contextualType;\r\n return module.unreachable();\r\n }\r\n switch (commonType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32: {\r\n expr = module.binary(BinaryOp.GeI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.ISIZE: {\r\n expr = module.binary(\r\n this.options.isWasm64\r\n ? BinaryOp.GeI64\r\n : BinaryOp.GeI32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.I64: {\r\n expr = module.binary(BinaryOp.GeI64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: {\r\n expr = module.binary(BinaryOp.GeU32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n expr = module.binary(\r\n this.options.isWasm64\r\n ? BinaryOp.GeU64\r\n : BinaryOp.GeU32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.U64: {\r\n expr = module.binary(BinaryOp.GeU64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n expr = module.binary(BinaryOp.GeF32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.binary(BinaryOp.GeF64, leftExpr, rightExpr);\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.unreachable();\r\n }\r\n }\r\n this.currentType = Type.bool;\r\n break;\r\n }\r\n\r\n case Token.EQUALS_EQUALS_EQUALS:\r\n case Token.EQUALS_EQUALS: {\r\n\r\n // NOTE that this favors correctness, in terms of emitting a binary expression, over\r\n // checking for a possible use of unary EQZ. while the most classic of all optimizations,\r\n // that's not what the source told us to do. for reference, `!left` emits unary EQZ.\r\n\r\n leftExpr = this.compileExpressionRetainType(left, contextualType);\r\n leftType = this.currentType;\r\n\r\n // check operator overload\r\n if (operator == Token.EQUALS_EQUALS && this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.EQ);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n // still allow '==' with references\r\n }\r\n\r\n rightExpr = this.compileExpressionRetainType(right, leftType);\r\n rightType = this.currentType;\r\n if (commonType = Type.commonDenominator(leftType, rightType, false)) {\r\n leftExpr = this.convertExpression(leftExpr,\r\n leftType, leftType = commonType,\r\n false, true, // !\r\n left\r\n );\r\n rightExpr = this.convertExpression(rightExpr,\r\n rightType, rightType = commonType,\r\n false, true, // !\r\n right\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,\r\n expression.range, operatorTokenToString(expression.operator), leftType.toString(), rightType.toString()\r\n );\r\n this.currentType = contextualType;\r\n return module.unreachable();\r\n }\r\n switch (commonType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: {\r\n expr = module.binary(BinaryOp.EqI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n expr = module.binary(\r\n this.options.isWasm64\r\n ? BinaryOp.EqI64\r\n : BinaryOp.EqI32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.binary(BinaryOp.EqI64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n expr = module.binary(BinaryOp.EqF32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.binary(BinaryOp.EqF64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.V128: {\r\n expr = module.unary(UnaryOp.AllTrueVecI8x16,\r\n module.binary(BinaryOp.EqVecI8x16, leftExpr, rightExpr)\r\n );\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.unreachable();\r\n }\r\n }\r\n this.currentType = Type.bool;\r\n break;\r\n }\r\n case Token.EXCLAMATION_EQUALS_EQUALS:\r\n case Token.EXCLAMATION_EQUALS: {\r\n leftExpr = this.compileExpressionRetainType(left, contextualType);\r\n leftType = this.currentType;\r\n\r\n // check operator overload\r\n if (operator == Token.EXCLAMATION_EQUALS && this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.NE);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n // still allow '!=' with references\r\n }\r\n\r\n rightExpr = this.compileExpressionRetainType(right, leftType);\r\n rightType = this.currentType;\r\n if (commonType = Type.commonDenominator(leftType, rightType, false)) {\r\n leftExpr = this.convertExpression(leftExpr,\r\n leftType, leftType = commonType,\r\n false, true, // !\r\n left\r\n );\r\n rightExpr = this.convertExpression(rightExpr,\r\n rightType, rightType = commonType,\r\n false, true, // !\r\n right\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,\r\n expression.range, operatorTokenToString(expression.operator), leftType.toString(), rightType.toString()\r\n );\r\n this.currentType = contextualType;\r\n return module.unreachable();\r\n }\r\n switch (commonType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: {\r\n expr = module.binary(BinaryOp.NeI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n expr = module.binary(\r\n this.options.isWasm64\r\n ? BinaryOp.NeI64\r\n : BinaryOp.NeI32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.binary(BinaryOp.NeI64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n expr = module.binary(BinaryOp.NeF32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.binary(BinaryOp.NeF64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.V128: {\r\n expr = module.unary(UnaryOp.AnyTrueVecI8x16,\r\n module.binary(BinaryOp.NeVecI8x16, leftExpr, rightExpr)\r\n );\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.unreachable();\r\n }\r\n }\r\n this.currentType = Type.bool;\r\n break;\r\n }\r\n case Token.EQUALS: {\r\n return this.compileAssignment(left, right, contextualType);\r\n }\r\n case Token.PLUS_EQUALS: compound = true;\r\n case Token.PLUS: {\r\n leftExpr = this.compileExpressionRetainType(left, contextualType);\r\n leftType = this.currentType;\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.ADD);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.unreachable();\r\n }\r\n\r\n if (compound) {\r\n rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT);\r\n } else {\r\n rightExpr = this.compileExpressionRetainType(right, leftType);\r\n rightType = this.currentType;\r\n if (commonType = Type.commonDenominator(leftType, rightType, false)) {\r\n leftExpr = this.convertExpression(leftExpr,\r\n leftType, leftType = commonType,\r\n false, false,\r\n left\r\n );\r\n rightExpr = this.convertExpression(rightExpr,\r\n rightType, rightType = commonType,\r\n false, false,\r\n right\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,\r\n expression.range, \"+\", leftType.toString(), rightType.toString()\r\n );\r\n this.currentType = contextualType;\r\n return module.unreachable();\r\n }\r\n }\r\n switch (this.currentType.kind) {\r\n case TypeKind.I8: // addition might overflow\r\n case TypeKind.I16: // ^\r\n case TypeKind.U8: // ^\r\n case TypeKind.U16: // ^\r\n case TypeKind.BOOL: // ^\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n expr = module.binary(BinaryOp.AddI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n expr = module.binary(\r\n this.options.isWasm64\r\n ? BinaryOp.AddI64\r\n : BinaryOp.AddI32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.binary(BinaryOp.AddI64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n expr = module.binary(BinaryOp.AddF32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.binary(BinaryOp.AddF64, leftExpr, rightExpr);\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.unreachable();\r\n }\r\n }\r\n break;\r\n }\r\n case Token.MINUS_EQUALS: compound = true;\r\n case Token.MINUS: {\r\n leftExpr = this.compileExpressionRetainType(left, contextualType);\r\n leftType = this.currentType;\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.SUB);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.unreachable();\r\n }\r\n\r\n if (compound) {\r\n rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT);\r\n rightType = this.currentType;\r\n } else {\r\n rightExpr = this.compileExpressionRetainType(right, leftType);\r\n rightType = this.currentType;\r\n if (commonType = Type.commonDenominator(leftType, rightType, false)) {\r\n leftExpr = this.convertExpression(leftExpr,\r\n leftType, leftType = commonType,\r\n false, false,\r\n left\r\n );\r\n rightExpr = this.convertExpression(rightExpr,\r\n rightType, rightType = commonType,\r\n false, false,\r\n right\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,\r\n expression.range, \"-\", leftType.toString(), rightType.toString()\r\n );\r\n this.currentType = contextualType;\r\n return module.unreachable();\r\n }\r\n }\r\n switch (this.currentType.kind) {\r\n case TypeKind.I8: // subtraction might overflow\r\n case TypeKind.I16: // ^\r\n case TypeKind.U8: // ^\r\n case TypeKind.U16: // ^\r\n case TypeKind.BOOL: // ^\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n expr = module.binary(BinaryOp.SubI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n expr = module.binary(\r\n this.options.isWasm64\r\n ? BinaryOp.SubI64\r\n : BinaryOp.SubI32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.binary(BinaryOp.SubI64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n expr = module.binary(BinaryOp.SubF32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.binary(BinaryOp.SubF64, leftExpr, rightExpr);\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.unreachable();\r\n }\r\n }\r\n break;\r\n }\r\n case Token.ASTERISK_EQUALS: compound = true;\r\n case Token.ASTERISK: {\r\n leftExpr = this.compileExpressionRetainType(left, contextualType);\r\n leftType = this.currentType;\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.MUL);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.unreachable();\r\n }\r\n\r\n if (compound) {\r\n leftExpr = this.ensureSmallIntegerWrap(leftExpr, leftType);\r\n rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT);\r\n } else {\r\n rightExpr = this.compileExpressionRetainType(right, leftType);\r\n rightType = this.currentType;\r\n if (commonType = Type.commonDenominator(leftType, rightType, false)) {\r\n leftExpr = this.convertExpression(leftExpr,\r\n leftType, leftType = commonType,\r\n false, false,\r\n left\r\n );\r\n rightExpr = this.convertExpression(rightExpr,\r\n rightType, rightType = commonType,\r\n false, false,\r\n right\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,\r\n expression.range, \"*\", leftType.toString(), rightType.toString()\r\n );\r\n this.currentType = contextualType;\r\n return module.unreachable();\r\n }\r\n }\r\n switch (this.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.BOOL:\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n expr = module.binary(BinaryOp.MulI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n expr = module.binary(\r\n this.options.isWasm64\r\n ? BinaryOp.MulI64\r\n : BinaryOp.MulI32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.binary(BinaryOp.MulI64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n expr = module.binary(BinaryOp.MulF32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.binary(BinaryOp.MulF64, leftExpr, rightExpr);\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.unreachable();\r\n }\r\n }\r\n break;\r\n }\r\n case Token.ASTERISK_ASTERISK_EQUALS: compound = true;\r\n case Token.ASTERISK_ASTERISK: {\r\n leftExpr = this.compileExpressionRetainType(left, contextualType);\r\n leftType = this.currentType;\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.POW);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.unreachable();\r\n }\r\n\r\n let instance: Function | null;\r\n\r\n // Mathf.pow if lhs is f32 (result is f32)\r\n if (this.currentType.kind == TypeKind.F32) {\r\n rightExpr = this.compileExpression(right, Type.f32, ContextualFlags.IMPLICIT);\r\n rightType = this.currentType;\r\n if (!(instance = this.f32PowInstance)) {\r\n let namespace = this.program.lookupGlobal(CommonSymbols.Mathf);\r\n if (!namespace) {\r\n this.error(\r\n DiagnosticCode.Cannot_find_name_0,\r\n expression.range, \"Mathf\"\r\n );\r\n expr = module.unreachable();\r\n break;\r\n }\r\n let prototype = namespace.members ? namespace.members.get(CommonSymbols.pow) : null;\r\n if (!prototype) {\r\n this.error(\r\n DiagnosticCode.Cannot_find_name_0,\r\n expression.range, \"Mathf.pow\"\r\n );\r\n expr = module.unreachable();\r\n break;\r\n }\r\n assert(prototype.kind == ElementKind.FUNCTION_PROTOTYPE);\r\n this.f32PowInstance = instance = this.resolver.resolveFunction(prototype, null);\r\n }\r\n\r\n // Math.pow otherwise (result is f64)\r\n // TODO: should the result be converted back?\r\n } else {\r\n leftExpr = this.convertExpression(leftExpr,\r\n this.currentType, Type.f64,\r\n false, false,\r\n left\r\n );\r\n leftType = this.currentType;\r\n rightExpr = this.compileExpression(right, Type.f64, ContextualFlags.IMPLICIT);\r\n rightType = this.currentType;\r\n if (!(instance = this.f64PowInstance)) {\r\n let namespace = this.program.lookupGlobal(CommonSymbols.Math);\r\n if (!namespace) {\r\n this.error(\r\n DiagnosticCode.Cannot_find_name_0,\r\n expression.range, \"Math\"\r\n );\r\n expr = module.unreachable();\r\n break;\r\n }\r\n let prototype = namespace.members ? namespace.members.get(CommonSymbols.pow) : null;\r\n if (!prototype) {\r\n this.error(\r\n DiagnosticCode.Cannot_find_name_0,\r\n expression.range, \"Math.pow\"\r\n );\r\n expr = module.unreachable();\r\n break;\r\n }\r\n assert(prototype.kind == ElementKind.FUNCTION_PROTOTYPE);\r\n this.f64PowInstance = instance = this.resolver.resolveFunction(prototype, null);\r\n }\r\n }\r\n if (!(instance && this.compileFunction(instance))) {\r\n expr = module.unreachable();\r\n } else {\r\n expr = this.makeCallDirect(instance, [ leftExpr, rightExpr ], expression);\r\n }\r\n break;\r\n }\r\n case Token.SLASH_EQUALS: compound = true;\r\n case Token.SLASH: {\r\n leftExpr = this.compileExpressionRetainType(left, contextualType);\r\n leftType = this.currentType;\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.DIV);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.unreachable();\r\n }\r\n\r\n if (compound) {\r\n leftExpr = this.ensureSmallIntegerWrap(leftExpr, leftType);\r\n rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT);\r\n rightType = this.currentType;\r\n } else {\r\n rightExpr = this.compileExpressionRetainType(right, leftType);\r\n rightType = this.currentType;\r\n if (commonType = Type.commonDenominator(leftType, rightType, false)) {\r\n leftExpr = this.convertExpression(leftExpr,\r\n leftType, leftType = commonType,\r\n false, true, // !\r\n left\r\n );\r\n rightExpr = this.convertExpression(rightExpr,\r\n rightType, rightType = commonType,\r\n false, true, // !\r\n right\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,\r\n expression.range, \"/\", leftType.toString(), rightType.toString()\r\n );\r\n this.currentType = contextualType;\r\n return module.unreachable();\r\n }\r\n }\r\n switch (this.currentType.kind) {\r\n case TypeKind.I8: // signed div on signed small integers might overflow, e.g. -128/-1\r\n case TypeKind.I16: // ^\r\n case TypeKind.I32: {\r\n expr = module.binary(BinaryOp.DivI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.ISIZE: {\r\n expr = module.binary(\r\n this.options.isWasm64\r\n ? BinaryOp.DivI64\r\n : BinaryOp.DivI32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.I64: {\r\n expr = module.binary(BinaryOp.DivI64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.BOOL: {\r\n expr = module.binary(BinaryOp.DivU32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.U32: {\r\n expr = module.binary(BinaryOp.DivU32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n expr = module.binary(\r\n this.options.isWasm64\r\n ? BinaryOp.DivU64\r\n : BinaryOp.DivU32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.U64: {\r\n expr = module.binary(BinaryOp.DivU64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n expr = module.binary(BinaryOp.DivF32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.binary(BinaryOp.DivF64, leftExpr, rightExpr);\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.unreachable();\r\n }\r\n }\r\n break;\r\n }\r\n case Token.PERCENT_EQUALS: compound = true;\r\n case Token.PERCENT: {\r\n leftExpr = this.compileExpressionRetainType(left, contextualType);\r\n leftType = this.currentType;\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.REM);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.unreachable();\r\n }\r\n\r\n if (compound) {\r\n leftExpr = this.ensureSmallIntegerWrap(leftExpr, leftType);\r\n rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT);\r\n rightType = this.currentType;\r\n } else {\r\n rightExpr = this.compileExpressionRetainType(right, leftType);\r\n rightType = this.currentType;\r\n if (commonType = Type.commonDenominator(leftType, rightType, false)) {\r\n leftExpr = this.convertExpression(leftExpr,\r\n leftType, leftType = commonType,\r\n false, true, // !\r\n left\r\n );\r\n rightExpr = this.convertExpression(rightExpr,\r\n rightType, rightType = commonType,\r\n false, true, // !\r\n right\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,\r\n expression.range, \"%\", leftType.toString(), rightType.toString()\r\n );\r\n this.currentType = contextualType;\r\n return module.unreachable();\r\n }\r\n }\r\n switch (this.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16: {\r\n expr = module.binary(BinaryOp.RemI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.I32: {\r\n expr = module.binary(BinaryOp.RemI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.ISIZE: {\r\n expr = module.binary(\r\n this.options.isWasm64\r\n ? BinaryOp.RemI64\r\n : BinaryOp.RemI32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.I64: {\r\n expr = module.binary(BinaryOp.RemI64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.BOOL: {\r\n expr = module.binary(BinaryOp.RemU32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.U32: {\r\n expr = module.binary(BinaryOp.RemU32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n expr = module.binary(\r\n this.options.isWasm64\r\n ? BinaryOp.RemU64\r\n : BinaryOp.RemU32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.U64: {\r\n expr = module.binary(BinaryOp.RemU64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n let instance = this.f32ModInstance;\r\n if (!instance) {\r\n let namespace = this.program.lookupGlobal(CommonSymbols.Mathf);\r\n if (!namespace) {\r\n this.error(\r\n DiagnosticCode.Cannot_find_name_0,\r\n expression.range, \"Mathf\"\r\n );\r\n expr = module.unreachable();\r\n break;\r\n }\r\n let prototype = namespace.members ? namespace.members.get(CommonSymbols.mod) : null;\r\n if (!prototype) {\r\n this.error(\r\n DiagnosticCode.Cannot_find_name_0,\r\n expression.range, \"Mathf.mod\"\r\n );\r\n expr = module.unreachable();\r\n break;\r\n }\r\n assert(prototype.kind == ElementKind.FUNCTION_PROTOTYPE);\r\n this.f32ModInstance = instance = this.resolver.resolveFunction(prototype, null);\r\n }\r\n if (!(instance && this.compileFunction(instance))) {\r\n expr = module.unreachable();\r\n } else {\r\n expr = this.makeCallDirect(instance, [ leftExpr, rightExpr ], expression);\r\n }\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n let instance = this.f64ModInstance;\r\n if (!instance) {\r\n let namespace = this.program.lookupGlobal(CommonSymbols.Math);\r\n if (!namespace) {\r\n this.error(\r\n DiagnosticCode.Cannot_find_name_0,\r\n expression.range, \"Math\"\r\n );\r\n expr = module.unreachable();\r\n break;\r\n }\r\n let prototype = namespace.members ? namespace.members.get(CommonSymbols.mod) : null;\r\n if (!prototype) {\r\n this.error(\r\n DiagnosticCode.Cannot_find_name_0,\r\n expression.range, \"Math.mod\"\r\n );\r\n expr = module.unreachable();\r\n break;\r\n }\r\n assert(prototype.kind == ElementKind.FUNCTION_PROTOTYPE);\r\n this.f64ModInstance = instance = this.resolver.resolveFunction(prototype, null);\r\n }\r\n if (!(instance && this.compileFunction(instance))) {\r\n expr = module.unreachable();\r\n } else {\r\n expr = this.makeCallDirect(instance, [ leftExpr, rightExpr ], expression);\r\n }\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.unreachable();\r\n }\r\n }\r\n break;\r\n }\r\n case Token.LESSTHAN_LESSTHAN_EQUALS: compound = true;\r\n case Token.LESSTHAN_LESSTHAN: {\r\n leftExpr = this.compileExpressionRetainType(left, contextualType.intType);\r\n leftType = this.currentType;\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.BITWISE_SHL);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.unreachable();\r\n }\r\n\r\n rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT);\r\n rightType = this.currentType;\r\n switch (this.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.BOOL:\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n expr = module.binary(BinaryOp.ShlI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.binary(BinaryOp.ShlI64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n expr = module.binary(\r\n this.options.isWasm64\r\n ? BinaryOp.ShlI64\r\n : BinaryOp.ShlI32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.F32:\r\n case TypeKind.F64: {\r\n this.error(\r\n DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,\r\n expression.range, operatorTokenToString(expression.operator), this.currentType.toString()\r\n );\r\n return module.unreachable();\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.unreachable();\r\n }\r\n }\r\n break;\r\n }\r\n case Token.GREATERTHAN_GREATERTHAN_EQUALS: compound = true;\r\n case Token.GREATERTHAN_GREATERTHAN: {\r\n leftExpr = this.compileExpressionRetainType(left, contextualType.intType);\r\n leftType = this.currentType;\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.BITWISE_SHR);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.unreachable();\r\n }\r\n\r\n leftExpr = this.ensureSmallIntegerWrap(leftExpr, leftType); // must clear garbage bits\r\n rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT);\r\n rightType = this.currentType;\r\n switch (this.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16: {\r\n expr = module.binary(BinaryOp.ShrI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.I32: {\r\n expr = module.binary(BinaryOp.ShrI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.I64: {\r\n expr = module.binary(BinaryOp.ShrI64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.ISIZE: {\r\n expr = module.binary(\r\n this.options.isWasm64\r\n ? BinaryOp.ShrI64\r\n : BinaryOp.ShrI32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.BOOL: {\r\n expr = module.binary(BinaryOp.ShrU32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.U32: {\r\n expr = module.binary(BinaryOp.ShrU32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.U64: {\r\n expr = module.binary(BinaryOp.ShrU64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n expr = module.binary(\r\n this.options.isWasm64\r\n ? BinaryOp.ShrU64\r\n : BinaryOp.ShrU32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.F32:\r\n case TypeKind.F64: {\r\n this.error(\r\n DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,\r\n expression.range, operatorTokenToString(expression.operator), this.currentType.toString()\r\n );\r\n return module.unreachable();\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.unreachable();\r\n }\r\n }\r\n break;\r\n }\r\n case Token.GREATERTHAN_GREATERTHAN_GREATERTHAN_EQUALS: compound = true;\r\n case Token.GREATERTHAN_GREATERTHAN_GREATERTHAN: {\r\n leftExpr = this.compileExpressionRetainType(left, contextualType.intType);\r\n leftType = this.currentType;\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.BITWISE_SHR_U);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.unreachable();\r\n }\r\n\r\n leftExpr = this.ensureSmallIntegerWrap(leftExpr, leftType); // must clear garbage bits\r\n rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT);\r\n rightType = this.currentType;\r\n switch (this.currentType.kind) {\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.BOOL: { // assumes that unsigned shr on unsigned small integers does not overflow\r\n expr = module.binary(BinaryOp.ShrU32, leftExpr, rightExpr);\r\n }\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n expr = module.binary(BinaryOp.ShrU32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.binary(BinaryOp.ShrU64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n expr = module.binary(\r\n this.options.isWasm64\r\n ? BinaryOp.ShrU64\r\n : BinaryOp.ShrU32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.F32:\r\n case TypeKind.F64: {\r\n this.error(\r\n DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,\r\n expression.range, operatorTokenToString(expression.operator), this.currentType.toString()\r\n );\r\n return module.unreachable();\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.unreachable();\r\n }\r\n }\r\n break;\r\n }\r\n case Token.AMPERSAND_EQUALS: compound = true;\r\n case Token.AMPERSAND: {\r\n leftExpr = this.compileExpressionRetainType(left, contextualType.intType);\r\n leftType = this.currentType;\r\n\r\n // check operator overloadd\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.BITWISE_AND);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.unreachable();\r\n }\r\n\r\n if (compound) {\r\n rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT);\r\n rightType = this.currentType;\r\n } else {\r\n rightExpr = this.compileExpressionRetainType(right, leftType);\r\n rightType = this.currentType;\r\n if (commonType = Type.commonDenominator(leftType, rightType, false)) {\r\n leftExpr = this.convertExpression(leftExpr,\r\n leftType, leftType = commonType,\r\n false, false,\r\n left\r\n );\r\n rightExpr = this.convertExpression(rightExpr,\r\n rightType, rightType = commonType,\r\n false, false,\r\n right\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,\r\n expression.range, \"&\", leftType.toString(), rightType.toString()\r\n );\r\n this.currentType = contextualType;\r\n return module.unreachable();\r\n }\r\n }\r\n switch (this.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.BOOL:\r\n case TypeKind.U32: {\r\n expr = module.binary(BinaryOp.AndI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.binary(BinaryOp.AndI64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n expr = module.binary(\r\n this.options.isWasm64\r\n ? BinaryOp.AndI64\r\n : BinaryOp.AndI32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.F32:\r\n case TypeKind.F64: {\r\n this.error(\r\n DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,\r\n expression.range, operatorTokenToString(expression.operator), this.currentType.toString()\r\n );\r\n return module.unreachable();\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.unreachable();\r\n }\r\n }\r\n break;\r\n }\r\n case Token.BAR_EQUALS: compound = true;\r\n case Token.BAR: {\r\n leftExpr = this.compileExpressionRetainType(left, contextualType.intType);\r\n leftType = this.currentType;\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.BITWISE_OR);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.unreachable();\r\n }\r\n\r\n if (compound) {\r\n rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT);\r\n rightType = this.currentType;\r\n } else {\r\n rightExpr = this.compileExpressionRetainType(right, leftType);\r\n rightType = this.currentType;\r\n if (commonType = Type.commonDenominator(leftType, rightType, false)) {\r\n leftExpr = this.convertExpression(leftExpr,\r\n leftType, leftType = commonType,\r\n false, false,\r\n left\r\n );\r\n rightExpr = this.convertExpression(rightExpr,\r\n rightType, rightType = commonType,\r\n false, false,\r\n right\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,\r\n expression.range, \"|\", leftType.toString(), rightType.toString()\r\n );\r\n this.currentType = contextualType;\r\n return module.unreachable();\r\n }\r\n }\r\n switch (this.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.BOOL: {\r\n expr = module.binary(BinaryOp.OrI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n expr = module.binary(BinaryOp.OrI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.binary(BinaryOp.OrI64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n expr = module.binary(\r\n this.options.isWasm64\r\n ? BinaryOp.OrI64\r\n : BinaryOp.OrI32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.F32:\r\n case TypeKind.F64: {\r\n this.error(\r\n DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,\r\n expression.range, operatorTokenToString(expression.operator), this.currentType.toString()\r\n );\r\n return module.unreachable();\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.unreachable();\r\n }\r\n }\r\n break;\r\n }\r\n case Token.CARET_EQUALS: compound = true;\r\n case Token.CARET: {\r\n leftExpr = this.compileExpressionRetainType(left, contextualType.intType);\r\n leftType = this.currentType;\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = leftType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.BITWISE_XOR);\r\n if (overload) {\r\n expr = this.compileBinaryOverload(overload, left, leftExpr, right, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.unreachable();\r\n }\r\n\r\n if (compound) {\r\n rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT);\r\n rightType = this.currentType;\r\n } else {\r\n rightExpr = this.compileExpressionRetainType(right, leftType);\r\n rightType = this.currentType;\r\n if (commonType = Type.commonDenominator(leftType, rightType, false)) {\r\n leftExpr = this.convertExpression(leftExpr,\r\n leftType, leftType = commonType,\r\n false, false,\r\n left\r\n );\r\n rightExpr = this.convertExpression(rightExpr,\r\n rightType, rightType = commonType,\r\n false, false,\r\n right\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,\r\n expression.range, \"^\", leftType.toString(), rightType.toString()\r\n );\r\n this.currentType = contextualType;\r\n return module.unreachable();\r\n }\r\n }\r\n switch (this.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.BOOL: {\r\n expr = module.binary(BinaryOp.XorI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n expr = module.binary(BinaryOp.XorI32, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.binary(BinaryOp.XorI64, leftExpr, rightExpr);\r\n break;\r\n }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n expr = module.binary(\r\n this.options.isWasm64\r\n ? BinaryOp.XorI64\r\n : BinaryOp.XorI32,\r\n leftExpr,\r\n rightExpr\r\n );\r\n break;\r\n }\r\n case TypeKind.F32:\r\n case TypeKind.F64: {\r\n this.error(\r\n DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1,\r\n expression.range, operatorTokenToString(expression.operator), this.currentType.toString()\r\n );\r\n return module.unreachable();\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.unreachable();\r\n }\r\n }\r\n break;\r\n }\r\n\r\n // logical (no overloading)\r\n\r\n case Token.AMPERSAND_AMPERSAND: { // left && right -> (t = left) ? right : t\r\n let flow = this.currentFlow;\r\n leftExpr = this.compileExpressionRetainType(left, contextualType, contextualFlags);\r\n leftType = this.currentType;\r\n\r\n let rightFlow = flow.fork();\r\n this.currentFlow = rightFlow;\r\n rightFlow.inheritNonnullIfTrue(leftExpr);\r\n rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT | (contextualFlags & ~ContextualFlags.WILL_DROP));\r\n rightType = leftType;\r\n\r\n // simplify if only interested in true or false\r\n if (contextualType == Type.bool || contextualType == Type.void) {\r\n rightExpr = this.performAutoreleasesWithValue(rightFlow, rightExpr, rightType);\r\n rightFlow.freeScopedLocals();\r\n this.currentFlow = flow;\r\n this.currentType = Type.bool;\r\n expr = module.if(\r\n this.makeIsTrueish(leftExpr, leftType),\r\n this.makeIsTrueish(rightExpr, rightType),\r\n module.i32(0)\r\n );\r\n\r\n // references must properly retain and release, with the same outcome independent of the branch taken\r\n } else if (leftType.isManaged) {\r\n let leftAutoreleaseSkipped = this.skippedAutoreleases.has(leftExpr);\r\n let rightAutoreleaseSkipped = this.skippedAutoreleases.has(rightExpr);\r\n let temp = flow.getTempLocal(leftType);\r\n leftExpr = module.local_tee(temp.index, leftExpr);\r\n\r\n // instead of retaining left and releasing it again in right when right\r\n // is taken, we can also just retain left if right is not taken\r\n let retainLeftInElse = false;\r\n if (leftAutoreleaseSkipped != rightAutoreleaseSkipped) { // xor\r\n if (!leftAutoreleaseSkipped) {\r\n retainLeftInElse = true;\r\n } else {\r\n rightExpr = this.makeRetain(rightExpr);\r\n rightAutoreleaseSkipped = true;\r\n }\r\n } else if (!(contextualFlags & ContextualFlags.SKIP_AUTORELEASE)) { // otherwise keep right alive a little longer\r\n rightExpr = this.moveAutorelease(rightExpr, rightFlow, flow);\r\n }\r\n\r\n let rightStmts = new Array();\r\n if (leftAutoreleaseSkipped) { // left turned out to be true'ish and is dropped\r\n rightStmts.unshift(\r\n this.makeRelease(\r\n module.local_get(temp.index, leftType.toNativeType())\r\n )\r\n );\r\n }\r\n rightExpr = this.performAutoreleasesWithValue(rightFlow, rightExpr, rightType, rightStmts);\r\n rightFlow.freeScopedLocals();\r\n this.currentFlow = flow;\r\n\r\n expr = module.if(\r\n this.makeIsTrueish(leftExpr, leftType),\r\n rightExpr,\r\n retainLeftInElse\r\n ? this.makeRetain(\r\n module.local_get(temp.index, leftType.toNativeType())\r\n )\r\n : module.local_get(temp.index, leftType.toNativeType())\r\n );\r\n if (leftAutoreleaseSkipped || rightAutoreleaseSkipped) this.skippedAutoreleases.add(expr);\r\n if (temp) flow.freeTempLocal(temp);\r\n\r\n // basic values can use more aggressive optimizations\r\n } else {\r\n rightExpr = this.performAutoreleasesWithValue(rightFlow, rightExpr, rightType);\r\n rightFlow.freeScopedLocals();\r\n this.currentFlow = flow;\r\n\r\n // simplify if cloning left without side effects is possible\r\n if (expr = module.cloneExpression(leftExpr, true, 0)) {\r\n expr = module.if(\r\n this.makeIsTrueish(leftExpr, this.currentType),\r\n rightExpr,\r\n expr\r\n );\r\n\r\n // if not possible, tee left to a temp\r\n } else {\r\n let tempLocal = flow.getTempLocal(leftType);\r\n if (!flow.canOverflow(leftExpr, leftType)) flow.setLocalFlag(tempLocal.index, LocalFlags.WRAPPED);\r\n if (flow.isNonnull(leftExpr, leftType)) flow.setLocalFlag(tempLocal.index, LocalFlags.NONNULL);\r\n expr = module.if(\r\n this.makeIsTrueish(module.local_tee(tempLocal.index, leftExpr), leftType),\r\n rightExpr,\r\n module.local_get(tempLocal.index, leftType.toNativeType())\r\n );\r\n }\r\n }\r\n this.currentType = leftType;\r\n break;\r\n }\r\n case Token.BAR_BAR: { // left || right -> ((t = left) ? t : right)\r\n let flow = this.currentFlow;\r\n leftExpr = this.compileExpressionRetainType(left, contextualType, contextualFlags);\r\n leftType = this.currentType;\r\n\r\n let rightFlow = flow.fork();\r\n this.currentFlow = rightFlow;\r\n rightFlow.inheritNonnullIfFalse(leftExpr);\r\n rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT | contextualFlags);\r\n rightType = leftType;\r\n\r\n // simplify if only interested in true or false\r\n if (contextualType == Type.bool || contextualType == Type.void) {\r\n rightExpr = this.performAutoreleasesWithValue(rightFlow, rightExpr, leftType);\r\n rightFlow.freeScopedLocals();\r\n this.currentFlow = flow;\r\n this.currentType = Type.bool;\r\n expr = module.if(\r\n this.makeIsTrueish(leftExpr, leftType),\r\n module.i32(1),\r\n this.makeIsTrueish(rightExpr, rightType)\r\n );\r\n\r\n // references must properly retain and release, with the same outcome independent of the branch taken\r\n } else if (leftType.isManaged) {\r\n let leftAutoreleaseSkipped = this.skippedAutoreleases.has(leftExpr);\r\n let rightAutoreleaseSkipped = this.skippedAutoreleases.has(rightExpr);\r\n let temp = flow.getTempLocal(leftType);\r\n leftExpr = module.local_tee(temp.index, leftExpr);\r\n\r\n // instead of retaining left and releasing it again in right when right\r\n // is taken, we can also just retain left if right is not taken\r\n let retainLeftInThen = false;\r\n if (leftAutoreleaseSkipped != rightAutoreleaseSkipped) { // xor\r\n if (!leftAutoreleaseSkipped) {\r\n retainLeftInThen = true;\r\n } else {\r\n rightExpr = this.makeRetain(rightExpr);\r\n rightAutoreleaseSkipped = true;\r\n }\r\n } else if (!(contextualFlags & ContextualFlags.SKIP_AUTORELEASE)) { // otherwise keep right alive a little longer\r\n rightExpr = this.moveAutorelease(rightExpr, rightFlow, flow);\r\n }\r\n\r\n let rightStmts = new Array();\r\n if (leftAutoreleaseSkipped) { // left turned out to be false'ish and is dropped\r\n // TODO: usually, false'ish means left is null, but this might not hold\r\n // once implicit conversion with strings is performed and left is \"\", so:\r\n rightStmts.unshift(\r\n this.makeRelease(\r\n module.local_get(temp.index, leftType.toNativeType())\r\n )\r\n );\r\n }\r\n rightExpr = this.performAutoreleasesWithValue(rightFlow, rightExpr, rightType, rightStmts);\r\n rightFlow.freeScopedLocals();\r\n this.currentFlow = flow;\r\n\r\n expr = module.if(\r\n this.makeIsTrueish(leftExpr, leftType),\r\n retainLeftInThen\r\n ? this.makeRetain(\r\n module.local_get(temp.index, leftType.toNativeType())\r\n )\r\n : module.local_get(temp.index, leftType.toNativeType()),\r\n rightExpr\r\n );\r\n if (leftAutoreleaseSkipped || rightAutoreleaseSkipped) this.skippedAutoreleases.add(expr);\r\n if (temp) flow.freeTempLocal(temp);\r\n\r\n // basic values can use more aggressive optimizations\r\n } else {\r\n rightExpr = this.performAutoreleasesWithValue(rightFlow, rightExpr, rightType);\r\n rightFlow.freeScopedLocals();\r\n this.currentFlow = flow;\r\n\r\n // simplify if cloning left without side effects is possible\r\n if (expr = module.cloneExpression(leftExpr, true, 0)) {\r\n expr = module.if(\r\n this.makeIsTrueish(leftExpr, leftType),\r\n expr,\r\n rightExpr\r\n );\r\n\r\n // if not possible, tee left to a temp. local\r\n } else {\r\n let tempLocal = flow.getAndFreeTempLocal(leftType);\r\n if (!flow.canOverflow(leftExpr, leftType)) flow.setLocalFlag(tempLocal.index, LocalFlags.WRAPPED);\r\n if (flow.isNonnull(leftExpr, leftType)) flow.setLocalFlag(tempLocal.index, LocalFlags.NONNULL);\r\n expr = module.if(\r\n this.makeIsTrueish(module.local_tee(tempLocal.index, leftExpr), leftType),\r\n module.local_get(tempLocal.index, leftType.toNativeType()),\r\n rightExpr\r\n );\r\n }\r\n }\r\n this.currentType = leftType;\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n expr = this.module.unreachable();\r\n }\r\n }\r\n if (!compound) return expr;\r\n var resolver = this.resolver;\r\n var target = this.resolver.resolveExpression(left, this.currentFlow);\r\n if (!target) return module.unreachable();\r\n return this.makeAssignment(\r\n target,\r\n expr, // TODO: delay release above if possible?\r\n left,\r\n resolver.currentThisExpression,\r\n resolver.currentElementExpression,\r\n contextualType != Type.void\r\n );\r\n }\r\n\r\n compileUnaryOverload(\r\n operatorInstance: Function,\r\n value: Expression,\r\n valueExpr: ExpressionRef,\r\n reportNode: Node\r\n ): ExpressionRef {\r\n // FIXME: see comment in compileBinaryOverload below why recompiling on type mismatch\r\n // is a bad idea currently. so this assumes that the type matches.\r\n return this.makeCallDirect(operatorInstance, [ valueExpr ], reportNode, false);\r\n }\r\n\r\n compileBinaryOverload(\r\n operatorInstance: Function,\r\n left: Expression,\r\n leftExpr: ExpressionRef,\r\n right: Expression,\r\n reportNode: Node\r\n ): ExpressionRef {\r\n var rightType: Type;\r\n if (operatorInstance.is(CommonFlags.INSTANCE)) {\r\n let classInstance = assert(operatorInstance.parent); assert(classInstance.kind == ElementKind.CLASS);\r\n rightType = operatorInstance.signature.parameterTypes[0];\r\n } else {\r\n // FIXME: if LHS type differs we can't recompile left because that'd completely confuse\r\n // local states, like having retained locals that actually do not even exist, possibly\r\n // releasing something random in that local before and evil things like that. Hence this\r\n // assumes that LHS type matches, which in turn means that static overloads must be\r\n // guaranteed to never mismatch LHS type, which in turn means that we can't have shiny\r\n // things like multiple static overloads for different combinations of LHS/RHS types.\r\n // We might want that at some point of course, but requires to complete the resolver so\r\n // it can actually resolve every kind of expression without ever having to recompile.\r\n rightType = operatorInstance.signature.parameterTypes[1];\r\n }\r\n var rightExpr = this.compileExpression(right, rightType, ContextualFlags.IMPLICIT);\r\n return this.makeCallDirect(operatorInstance, [ leftExpr, rightExpr ], reportNode);\r\n }\r\n\r\n compileAssignment(expression: Expression, valueExpression: Expression, contextualType: Type): ExpressionRef {\r\n var program = this.program;\r\n var resolver = program.resolver;\r\n var flow = this.currentFlow;\r\n var target = resolver.resolveExpression(expression, flow); // reports\r\n if (!target) return this.module.unreachable();\r\n var thisExpression = resolver.currentThisExpression;\r\n var elementExpression = resolver.currentElementExpression;\r\n\r\n // to compile just the value, we need to know the target's type\r\n var targetType: Type;\r\n switch (target.kind) {\r\n case ElementKind.GLOBAL: {\r\n // not yet compiled if a static field compiled as a global\r\n if (!this.compileGlobal(target)) return this.module.unreachable(); // reports\r\n // fall-through\r\n }\r\n case ElementKind.FIELD: {\r\n targetType = (target).type;\r\n break;\r\n }\r\n case ElementKind.LOCAL: {\r\n targetType = (target).type;\r\n break;\r\n }\r\n case ElementKind.PROPERTY_PROTOTYPE: { // static property\r\n let setterPrototype = (target).setterPrototype;\r\n if (!setterPrototype) {\r\n this.error(\r\n DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property,\r\n expression.range, (target).internalName\r\n );\r\n return this.module.unreachable();\r\n }\r\n let setterInstance = this.resolver.resolveFunction(setterPrototype, null, makeMap(), ReportMode.REPORT);\r\n if (!setterInstance) return this.module.unreachable();\r\n assert(setterInstance.signature.parameterTypes.length == 1); // parser must guarantee this\r\n targetType = setterInstance.signature.parameterTypes[0];\r\n break;\r\n }\r\n case ElementKind.PROPERTY: { // instance property\r\n let setterInstance = (target).setterInstance;\r\n if (!setterInstance) {\r\n this.error(\r\n DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property,\r\n expression.range, (target).internalName\r\n );\r\n return this.module.unreachable();\r\n }\r\n assert(setterInstance.signature.parameterTypes.length == 1); // parser must guarantee this\r\n targetType = setterInstance.signature.parameterTypes[0];\r\n break;\r\n }\r\n case ElementKind.CLASS: {\r\n if (elementExpression) { // indexed access\r\n let isUnchecked = flow.is(FlowFlags.UNCHECKED_CONTEXT);\r\n // if (isUnchecked) {\r\n // let arrayType = this.program.determineBuiltinArrayType(target);\r\n // if (arrayType) {\r\n // return compileBuiltinArraySet(\r\n // this,\r\n // target,\r\n // assert(this.resolver.currentThisExpression),\r\n // elementExpression,\r\n // valueExpression,\r\n // contextualType\r\n // );\r\n // }\r\n // }\r\n let indexedSet = (target).lookupOverload(OperatorKind.INDEXED_SET, isUnchecked);\r\n if (!indexedSet) {\r\n let indexedGet = (target).lookupOverload(OperatorKind.INDEXED_GET, isUnchecked);\r\n if (!indexedGet) {\r\n this.error(\r\n DiagnosticCode.Index_signature_is_missing_in_type_0,\r\n expression.range, (target).internalName\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Index_signature_in_type_0_only_permits_reading,\r\n expression.range, (target).internalName\r\n );\r\n }\r\n return this.module.unreachable();\r\n }\r\n assert(indexedSet.signature.parameterTypes.length == 2); // parser must guarantee this\r\n targetType = indexedSet.signature.parameterTypes[1]; // 2nd parameter is the element\r\n break;\r\n }\r\n // fall-through\r\n }\r\n default: {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.unreachable();\r\n }\r\n }\r\n\r\n // compile the value and do the assignment\r\n assert(targetType != Type.void);\r\n return this.makeAssignment(\r\n target,\r\n this.compileExpression(valueExpression, targetType, ContextualFlags.IMPLICIT | ContextualFlags.SKIP_AUTORELEASE),\r\n expression,\r\n thisExpression,\r\n elementExpression,\r\n contextualType != Type.void\r\n );\r\n }\r\n\r\n /** Makes an assignment expression or block, assigning a value to a target. */\r\n makeAssignment(\r\n /** Target element, e.g. a Local. */\r\n target: Element,\r\n /** Value expression that has been compiled in a previous step already. */\r\n valueExpr: ExpressionRef,\r\n /** Expression reference. Has already been compiled to `valueExpr`. */\r\n valueExpression: Expression,\r\n /** `this` expression reference if a field or property set. */\r\n thisExpression: Expression | null,\r\n /** Index expression reference if an indexed set. */\r\n indexExpression: Expression | null,\r\n /** Whether to tee the value. */\r\n tee: bool\r\n ): ExpressionRef {\r\n var module = this.module;\r\n var flow = this.currentFlow;\r\n\r\n // NOTE: Only locals, globals and fields can make use of skipped autoreleases while\r\n // everything else must insert the skipped autorelease now. See (*)\r\n\r\n switch (target.kind) {\r\n case ElementKind.LOCAL: {\r\n if (flow.isLocalFlag((target).index, LocalFlags.CONSTANT, true)) {\r\n this.error(\r\n DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property,\r\n valueExpression.range, target.internalName\r\n );\r\n this.currentType = tee ? (target).type : Type.void;\r\n return module.unreachable();\r\n }\r\n return this.makeLocalAssignment(target, valueExpr, tee);\r\n }\r\n case ElementKind.GLOBAL: {\r\n if (!this.compileGlobal(target)) return module.unreachable();\r\n if (target.isAny(CommonFlags.CONST | CommonFlags.READONLY)) {\r\n this.error(\r\n DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property,\r\n valueExpression.range,\r\n target.internalName\r\n );\r\n this.currentType = tee ? (target).type : Type.void;\r\n return module.unreachable();\r\n }\r\n return this.makeGlobalAssignment(target, valueExpr, tee);\r\n }\r\n case ElementKind.FIELD: {\r\n let initializerNode = (target).initializerNode;\r\n if (\r\n (target).is(CommonFlags.READONLY) &&\r\n !(\r\n flow.actualFunction.is(CommonFlags.CONSTRUCTOR) ||\r\n initializerNode\r\n )\r\n ) {\r\n this.error(\r\n DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property,\r\n valueExpression.range, (target).internalName\r\n );\r\n return module.unreachable();\r\n }\r\n return this.makeFieldAssignment(target,\r\n valueExpr,\r\n this.compileExpressionRetainType(\r\n assert(thisExpression),\r\n // FIXME: explicit type (currently fails due to missing null checking)\r\n this.options.usizeType\r\n ),\r\n tee\r\n );\r\n }\r\n case ElementKind.PROPERTY_PROTOTYPE: { // static property\r\n if (this.skippedAutoreleases.has(valueExpr)) valueExpr = this.makeAutorelease(valueExpr, flow); // (*)\r\n let setterPrototype = (target).setterPrototype;\r\n if (!setterPrototype) {\r\n this.error(\r\n DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property,\r\n valueExpression.range, target.internalName\r\n );\r\n return module.unreachable();\r\n }\r\n let setterInstance = this.resolver.resolveFunction(setterPrototype, null, makeMap(), ReportMode.REPORT);\r\n if (!setterInstance) return module.unreachable();\r\n // call just the setter if the return value isn't of interest\r\n if (!tee) return this.makeCallDirect(setterInstance, [ valueExpr ], valueExpression);\r\n // otherwise call the setter first, then the getter\r\n let getterPrototype = assert((target).getterPrototype); // must be present\r\n let getterInstance = this.resolver.resolveFunction(getterPrototype, null, makeMap(), ReportMode.REPORT);\r\n if (!getterInstance) return module.unreachable();\r\n let returnType = getterInstance.signature.returnType;\r\n let nativeReturnType = returnType.toNativeType();\r\n return module.block(null, [\r\n this.makeCallDirect(setterInstance, [ valueExpr ], valueExpression),\r\n this.makeCallDirect(getterInstance, null, valueExpression) // sets currentType\r\n ], nativeReturnType);\r\n }\r\n case ElementKind.PROPERTY: { // instance property\r\n if (this.skippedAutoreleases.has(valueExpr)) valueExpr = this.makeAutorelease(valueExpr, flow); // (*)\r\n let setterInstance = (target).setterInstance;\r\n if (!setterInstance) {\r\n this.error(\r\n DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property,\r\n valueExpression.range, target.internalName\r\n );\r\n return module.unreachable();\r\n }\r\n // call just the setter if the return value isn't of interest\r\n if (!tee) {\r\n let thisExpr = this.compileExpressionRetainType(\r\n assert(thisExpression),\r\n this.options.usizeType\r\n );\r\n return this.makeCallDirect(setterInstance, [ thisExpr, valueExpr ], valueExpression);\r\n }\r\n // otherwise call the setter first, then the getter\r\n let getterInstance = assert((target).getterInstance); // must be present\r\n let returnType = getterInstance.signature.returnType;\r\n let nativeReturnType = returnType.toNativeType();\r\n let thisExpr = this.compileExpressionRetainType(\r\n assert(thisExpression),\r\n this.options.usizeType\r\n );\r\n let tempLocal = flow.getAndFreeTempLocal(returnType);\r\n let tempLocalIndex = tempLocal.index;\r\n return module.block(null, [\r\n this.makeCallDirect(setterInstance, [ // set and remember the target\r\n module.local_tee(tempLocalIndex, thisExpr),\r\n valueExpr\r\n ], valueExpression),\r\n this.makeCallDirect(getterInstance, [ // get from remembered target\r\n module.local_get(tempLocalIndex, nativeReturnType)\r\n ], valueExpression)\r\n ], nativeReturnType);\r\n }\r\n case ElementKind.CLASS: {\r\n if (this.skippedAutoreleases.has(valueExpr)) valueExpr = this.makeAutorelease(valueExpr, flow); // (*)\r\n if (indexExpression) {\r\n let isUnchecked = flow.is(FlowFlags.UNCHECKED_CONTEXT);\r\n let indexedGet = (target).lookupOverload(OperatorKind.INDEXED_GET, isUnchecked);\r\n if (!indexedGet) {\r\n this.error(\r\n DiagnosticCode.Index_signature_is_missing_in_type_0,\r\n valueExpression.range, target.internalName\r\n );\r\n return module.unreachable();\r\n }\r\n let indexedSet = (target).lookupOverload(OperatorKind.INDEXED_SET, isUnchecked);\r\n if (!indexedSet) {\r\n this.error(\r\n DiagnosticCode.Index_signature_in_type_0_only_permits_reading,\r\n valueExpression.range, target.internalName\r\n );\r\n this.currentType = tee ? indexedGet.signature.returnType : Type.void;\r\n return module.unreachable();\r\n }\r\n let targetType = (target).type;\r\n let thisExpr = this.compileExpressionRetainType(\r\n assert(thisExpression),\r\n this.options.usizeType\r\n );\r\n let elementExpr = this.compileExpression(indexExpression, Type.i32, ContextualFlags.IMPLICIT);\r\n if (tee) {\r\n let tempLocalTarget = flow.getTempLocal(targetType);\r\n let tempLocalElement = flow.getAndFreeTempLocal(this.currentType);\r\n let returnType = indexedGet.signature.returnType;\r\n flow.freeTempLocal(tempLocalTarget);\r\n return module.block(null, [\r\n this.makeCallDirect(indexedSet, [\r\n module.local_tee(tempLocalTarget.index, thisExpr),\r\n module.local_tee(tempLocalElement.index, elementExpr),\r\n valueExpr\r\n ], valueExpression),\r\n this.makeCallDirect(indexedGet, [\r\n module.local_get(tempLocalTarget.index, tempLocalTarget.type.toNativeType()),\r\n module.local_get(tempLocalElement.index, tempLocalElement.type.toNativeType())\r\n ], valueExpression)\r\n ], returnType.toNativeType());\r\n } else {\r\n return this.makeCallDirect(indexedSet, [\r\n thisExpr,\r\n elementExpr,\r\n valueExpr\r\n ], valueExpression);\r\n }\r\n }\r\n // fall-through\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n valueExpression.range\r\n );\r\n return module.unreachable();\r\n }\r\n\r\n /** Makes an assignment to a local, possibly retaining and releasing affected references and keeping track of wrap and null states. */\r\n private makeLocalAssignment(\r\n /** The local to assign to. */\r\n local: Local,\r\n /** The value to assign. */\r\n valueExpr: ExpressionRef,\r\n /** Whether to tee the value. */\r\n tee: bool\r\n ): ExpressionRef {\r\n var type = local.type;\r\n assert(type != Type.void);\r\n var flow = this.currentFlow;\r\n var localIndex = local.index;\r\n\r\n if (type.is(TypeFlags.NULLABLE)) {\r\n if (flow.isNonnull(valueExpr, type)) flow.setLocalFlag(localIndex, LocalFlags.NONNULL);\r\n else flow.unsetLocalFlag(localIndex, LocalFlags.NONNULL);\r\n }\r\n flow.setLocalFlag(localIndex, LocalFlags.WRITTENTO);\r\n\r\n if (type.isManaged) {\r\n let module = this.module;\r\n let nativeType = type.toNativeType();\r\n\r\n if (flow.isAnyLocalFlag(localIndex, LocalFlags.ANY_RETAINED)) {\r\n if (this.skippedAutoreleases.has(valueExpr)) {\r\n valueExpr = this.makeSkippedRelease(\r\n module.local_get(localIndex, nativeType), // oldRef\r\n valueExpr // newRef\r\n );\r\n if (tee) { // TEE(local = __skippedRelease(local, value))\r\n this.currentType = type;\r\n return module.local_tee(localIndex, valueExpr);\r\n } else { // local = __skippedRelease(local, value)\r\n this.currentType = Type.void;\r\n return module.local_set(localIndex, valueExpr);\r\n }\r\n } else {\r\n valueExpr = this.makeRetainRelease(\r\n module.local_get(localIndex, nativeType), // oldRef\r\n valueExpr // newRef\r\n );\r\n if (tee) { // TEE(local = __retainRelease(local, value))\r\n this.currentType = type;\r\n return module.local_tee(localIndex, valueExpr);\r\n } else { // local = __retainRelease(local, value)\r\n this.currentType = Type.void;\r\n return module.local_set(localIndex, valueExpr);\r\n }\r\n }\r\n } else {\r\n flow.unsetLocalFlag(localIndex, LocalFlags.CONDITIONALLY_RETAINED);\r\n flow.setLocalFlag(localIndex, LocalFlags.RETAINED);\r\n if (!this.skippedAutoreleases.has(valueExpr)) valueExpr = this.makeRetain(valueExpr);\r\n if (tee) { // TEE(local = __retain(value, local))\r\n this.currentType = type;\r\n return module.local_tee(localIndex, valueExpr);\r\n } else { // local = __retain(value, local)\r\n this.currentType = Type.void;\r\n return module.local_set(localIndex, valueExpr);\r\n }\r\n }\r\n } else {\r\n if (type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) {\r\n if (!flow.canOverflow(valueExpr, type)) flow.setLocalFlag(localIndex, LocalFlags.WRAPPED);\r\n else flow.unsetLocalFlag(localIndex, LocalFlags.WRAPPED);\r\n }\r\n if (tee) { // TEE(local = value)\r\n this.currentType = type;\r\n return this.module.local_tee(localIndex, valueExpr);\r\n } else { // local = value\r\n this.currentType = Type.void;\r\n return this.module.local_set(localIndex, valueExpr);\r\n }\r\n }\r\n }\r\n\r\n /** Makes an assignment to a global, possibly retaining and releasing affected references. */\r\n private makeGlobalAssignment(\r\n /** The global to assign to. */\r\n global: Global,\r\n /** The value to assign. */\r\n valueExpr: ExpressionRef,\r\n /** Whether to tee the value. */\r\n tee: bool\r\n ): ExpressionRef {\r\n var module = this.module;\r\n var type = global.type;\r\n assert(type != Type.void);\r\n var nativeType = type.toNativeType();\r\n\r\n if (type.isManaged) {\r\n if (this.skippedAutoreleases.has(valueExpr)) {\r\n if (tee) { // (global = __skippedRelease(global, value)), global\r\n this.currentType = type;\r\n return module.block(null, [\r\n module.global_set(global.internalName,\r\n this.makeSkippedRelease(\r\n module.global_get(global.internalName, nativeType), // oldRef\r\n valueExpr // newRef\r\n )\r\n ),\r\n module.global_get(global.internalName, nativeType)\r\n ], nativeType);\r\n } else { // global = __skippedRelease(global, value)\r\n this.currentType = Type.void;\r\n return module.global_set(global.internalName,\r\n this.makeSkippedRelease(\r\n module.global_get(global.internalName, nativeType), // oldRef\r\n valueExpr // newRef\r\n )\r\n );\r\n }\r\n } else {\r\n if (tee) { // (global = __retainRelease(global, value)), global\r\n this.currentType = type;\r\n return module.block(null, [\r\n module.global_set(global.internalName,\r\n this.makeRetainRelease(\r\n module.global_get(global.internalName, nativeType), // oldRef\r\n valueExpr // newRef\r\n )\r\n ),\r\n module.global_get(global.internalName, nativeType)\r\n ], nativeType);\r\n } else { // global = __retainRelease(global, value)\r\n this.currentType = Type.void;\r\n return module.global_set(global.internalName,\r\n this.makeRetainRelease(\r\n module.global_get(global.internalName, nativeType), // oldRef\r\n valueExpr // newRef\r\n )\r\n );\r\n }\r\n }\r\n } else {\r\n valueExpr = this.ensureSmallIntegerWrap(valueExpr, type); // globals must be wrapped\r\n if (tee) { // (global = value), global\r\n this.currentType = type;\r\n return module.block(null, [\r\n module.global_set(global.internalName, valueExpr),\r\n module.global_get(global.internalName, nativeType)\r\n ], nativeType);\r\n } else { // global = value\r\n this.currentType = Type.void;\r\n return module.global_set(global.internalName,\r\n valueExpr\r\n );\r\n }\r\n }\r\n }\r\n\r\n /** Makes an assignment to a field, possibly retaining and releasing affected references. */\r\n makeFieldAssignment(\r\n /** The field to assign to. */\r\n field: Field,\r\n /** The value to assign. */\r\n valueExpr: ExpressionRef,\r\n /** The value of `this`. */\r\n thisExpr: ExpressionRef,\r\n /** Whether to tee the value. */\r\n tee: bool\r\n ): ExpressionRef {\r\n var module = this.module;\r\n var flow = this.currentFlow;\r\n var fieldType = field.type;\r\n var nativeFieldType = fieldType.toNativeType();\r\n assert(field.parent.kind == ElementKind.CLASS);\r\n var thisType = (field.parent).type;\r\n var nativeThisType = thisType.toNativeType();\r\n\r\n if (fieldType.isManaged && thisType.isManaged) {\r\n let tempThis = flow.getTempLocal(thisType);\r\n if (this.skippedAutoreleases.has(valueExpr)) {\r\n if (tee) { // ((t1 = this).field = __skippedRelease(t1.field, t2 = value)), t2\r\n let tempValue = flow.getAndFreeTempLocal(fieldType);\r\n if (!flow.canOverflow(valueExpr, fieldType)) flow.setLocalFlag(tempValue.index, LocalFlags.WRAPPED);\r\n if (flow.isNonnull(valueExpr, fieldType)) flow.setLocalFlag(tempValue.index, LocalFlags.NONNULL);\r\n flow.freeTempLocal(tempThis);\r\n this.currentType = fieldType;\r\n return module.block(null, [\r\n module.store(fieldType.byteSize,\r\n module.local_tee(tempThis.index, thisExpr),\r\n this.makeSkippedRelease(\r\n module.load(fieldType.byteSize, fieldType.is(TypeFlags.SIGNED), // oldRef\r\n module.local_get(tempThis.index, nativeThisType),\r\n nativeFieldType, field.memoryOffset\r\n ),\r\n module.local_tee(tempValue.index, valueExpr), // newRef\r\n ),\r\n nativeFieldType, field.memoryOffset\r\n ),\r\n module.local_get(tempValue.index, nativeFieldType)\r\n ], nativeFieldType);\r\n } else { // (t1 = this).field = __skippedRelease(t1.field, value)\r\n flow.freeTempLocal(tempThis);\r\n this.currentType = Type.void;\r\n return module.store(fieldType.byteSize,\r\n module.local_tee(tempThis.index, thisExpr),\r\n this.makeSkippedRelease(\r\n module.load(fieldType.byteSize, fieldType.is(TypeFlags.SIGNED), // oldRef\r\n module.local_get(tempThis.index, nativeThisType),\r\n nativeFieldType, field.memoryOffset\r\n ),\r\n valueExpr, // newRef\r\n ),\r\n nativeFieldType, field.memoryOffset\r\n );\r\n }\r\n } else {\r\n if (tee) { // ((t1 = this).field = __retainRelease(t1.field, t2 = value)), t2\r\n let tempValue = flow.getAndFreeTempLocal(fieldType);\r\n if (!flow.canOverflow(valueExpr, fieldType)) flow.setLocalFlag(tempValue.index, LocalFlags.WRAPPED);\r\n if (flow.isNonnull(valueExpr, fieldType)) flow.setLocalFlag(tempValue.index, LocalFlags.NONNULL);\r\n flow.freeTempLocal(tempThis);\r\n this.currentType = fieldType;\r\n return module.block(null, [\r\n module.store(fieldType.byteSize,\r\n module.local_tee(tempThis.index, thisExpr),\r\n this.makeRetainRelease(\r\n module.load(fieldType.byteSize, fieldType.is(TypeFlags.SIGNED), // oldRef\r\n module.local_get(tempThis.index, nativeThisType),\r\n nativeFieldType, field.memoryOffset\r\n ),\r\n module.local_tee(tempValue.index, valueExpr) // newRef\r\n ),\r\n nativeFieldType, field.memoryOffset\r\n ),\r\n module.local_get(tempValue.index, nativeFieldType)\r\n ], nativeFieldType);\r\n } else { // (t1 = this).field = __retainRelease(t1.field, value)\r\n flow.freeTempLocal(tempThis);\r\n this.currentType = Type.void;\r\n return module.store(fieldType.byteSize,\r\n module.local_tee(tempThis.index, thisExpr),\r\n this.makeRetainRelease(\r\n module.load(fieldType.byteSize, fieldType.is(TypeFlags.SIGNED), // oldRef\r\n module.local_get(tempThis.index, nativeThisType),\r\n nativeFieldType, field.memoryOffset\r\n ),\r\n valueExpr // newRef\r\n ),\r\n nativeFieldType, field.memoryOffset\r\n );\r\n }\r\n }\r\n } else {\r\n if (tee) { // (this.field = (t1 = value)), t1\r\n let tempValue = flow.getAndFreeTempLocal(fieldType);\r\n if (!flow.canOverflow(valueExpr, fieldType)) flow.setLocalFlag(tempValue.index, LocalFlags.WRAPPED);\r\n if (flow.isNonnull(valueExpr, fieldType)) flow.setLocalFlag(tempValue.index, LocalFlags.NONNULL);\r\n this.currentType = fieldType;\r\n return module.block(null, [\r\n module.store(fieldType.byteSize,\r\n thisExpr,\r\n module.local_tee(tempValue.index, valueExpr),\r\n nativeFieldType, field.memoryOffset\r\n ),\r\n module.local_get(tempValue.index, nativeFieldType)\r\n ], nativeFieldType);\r\n } else { // this.field = value\r\n this.currentType = Type.void;\r\n return module.store(fieldType.byteSize,\r\n thisExpr,\r\n valueExpr,\r\n nativeFieldType, field.memoryOffset\r\n );\r\n }\r\n }\r\n }\r\n\r\n /** Compiles a call expression according to the specified context. */\r\n compileCallExpression(\r\n /** Call expression to compile. */\r\n expression: CallExpression,\r\n /** Contextual type indicating the return type the caller expects, if any. */\r\n contextualType: Type,\r\n /** Contextual flags indicating contextual conditions. */\r\n contextualFlags: ContextualFlags\r\n ): ExpressionRef {\r\n\r\n var module = this.module;\r\n var flow = this.currentFlow;\r\n\r\n // handle call to super\r\n if (expression.expression.kind == NodeKind.SUPER) {\r\n let flow = this.currentFlow;\r\n let actualFunction = flow.actualFunction;\r\n if (!actualFunction.is(CommonFlags.CONSTRUCTOR)) {\r\n this.error(\r\n DiagnosticCode.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors,\r\n expression.range\r\n );\r\n return module.unreachable();\r\n }\r\n\r\n let classInstance = assert(actualFunction.parent); assert(classInstance.kind == ElementKind.CLASS);\r\n let baseClassInstance = assert((classInstance).base);\r\n let thisLocal = assert(flow.lookupLocal(CommonSymbols.this_));\r\n let nativeSizeType = this.options.nativeSizeType;\r\n\r\n // {\r\n // this = super(this || , ...args)\r\n // this.a = X\r\n // this.b = Y\r\n // }\r\n let theCall = this.compileCallDirect(\r\n this.ensureConstructor(baseClassInstance, expression),\r\n expression.arguments,\r\n expression,\r\n module.if(\r\n module.local_get(thisLocal.index, nativeSizeType),\r\n module.local_get(thisLocal.index, nativeSizeType),\r\n this.makeRetain(\r\n this.makeAllocation(classInstance)\r\n )\r\n ),\r\n ContextualFlags.SKIP_AUTORELEASE\r\n );\r\n assert(this.skippedAutoreleases.has(theCall)); // guaranteed\r\n let stmts: ExpressionRef[] = [\r\n module.local_set(thisLocal.index, theCall)\r\n ];\r\n this.makeFieldInitialization(classInstance, stmts);\r\n\r\n // check that super had been called before accessing `this`\r\n if (flow.isAny(\r\n FlowFlags.ALLOCATES |\r\n FlowFlags.CONDITIONALLY_ALLOCATES\r\n )) {\r\n this.error(\r\n DiagnosticCode._super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class,\r\n expression.range\r\n );\r\n return module.unreachable();\r\n }\r\n flow.set(FlowFlags.ALLOCATES | FlowFlags.CALLS_SUPER);\r\n this.currentType = Type.void;\r\n return module.block(null, stmts);\r\n }\r\n\r\n // otherwise resolve normally\r\n var target = this.resolver.resolveExpression(expression.expression, flow); // reports\r\n if (!target) return module.unreachable();\r\n\r\n var signature: Signature | null;\r\n var indexArg: ExpressionRef;\r\n switch (target.kind) {\r\n\r\n // direct call: concrete function\r\n case ElementKind.FUNCTION_PROTOTYPE: {\r\n let prototype = target;\r\n let typeArguments = expression.typeArguments;\r\n\r\n // builtins handle present respectively omitted type arguments on their own\r\n if (prototype.hasDecorator(DecoratorFlags.BUILTIN)) {\r\n return this.compileCallExpressionBuiltin(prototype, expression, contextualType);\r\n }\r\n\r\n let instance: Function | null = null;\r\n\r\n // resolve generic call if type arguments have been provided\r\n if (typeArguments) {\r\n if (!prototype.is(CommonFlags.GENERIC)) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n expression.expression.range, prototype.internalName\r\n );\r\n return module.unreachable();\r\n }\r\n instance = this.resolver.resolveFunctionInclTypeArguments(\r\n prototype,\r\n typeArguments,\r\n flow.actualFunction.parent, // relative to caller\r\n makeMap(flow.contextualTypeArguments),\r\n expression\r\n );\r\n\r\n // infer generic call if type arguments have been omitted\r\n } else if (prototype.is(CommonFlags.GENERIC)) {\r\n let inferredTypes = new Map();\r\n let typeParameterNodes = assert(prototype.typeParameterNodes);\r\n let numTypeParameters = typeParameterNodes.length;\r\n for (let i = 0; i < numTypeParameters; ++i) {\r\n inferredTypes.set(typeParameterNodes[i].name.text, null);\r\n }\r\n // let numInferred = 0;\r\n let parameterNodes = prototype.signatureNode.parameters;\r\n let numParameters = parameterNodes.length;\r\n let argumentNodes = expression.arguments;\r\n let numArguments = argumentNodes.length;\r\n let argumentExprs = new Array(numArguments);\r\n for (let i = 0; i < numParameters; ++i) {\r\n let typeNode = parameterNodes[i].type;\r\n let templateName = typeNode.kind == NodeKind.TYPE && !(typeNode).name.next\r\n ? (typeNode).name.identifier.text\r\n : null;\r\n let argumentExpression = i < numArguments\r\n ? argumentNodes[i]\r\n : parameterNodes[i].initializer;\r\n if (!argumentExpression) { // missing initializer -> too few arguments\r\n this.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n expression.range, numParameters.toString(10), numArguments.toString(10)\r\n );\r\n return module.unreachable();\r\n }\r\n if (templateName !== null && inferredTypes.has(templateName)) {\r\n let inferredType = inferredTypes.get(templateName);\r\n if (inferredType) {\r\n argumentExprs[i] = this.compileExpressionRetainType(argumentExpression, inferredType);\r\n let commonType: Type | null;\r\n if (!(commonType = Type.commonDenominator(inferredType, this.currentType, true))) {\r\n if (!(commonType = Type.commonDenominator(inferredType, this.currentType, false))) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_assignable_to_type_1,\r\n parameterNodes[i].type.range, this.currentType.toString(), inferredType.toString()\r\n );\r\n return module.unreachable();\r\n }\r\n }\r\n inferredType = commonType;\r\n } else {\r\n argumentExprs[i] = this.compileExpressionRetainType(argumentExpression, Type.i32);\r\n inferredType = this.currentType;\r\n // ++numInferred;\r\n }\r\n inferredTypes.set(templateName, inferredType);\r\n } else {\r\n let concreteType = this.resolver.resolveType(\r\n parameterNodes[i].type,\r\n flow.actualFunction,\r\n flow.contextualTypeArguments\r\n );\r\n if (!concreteType) return module.unreachable();\r\n argumentExprs[i] = this.compileExpression(argumentExpression, concreteType, ContextualFlags.IMPLICIT);\r\n }\r\n }\r\n let resolvedTypeArguments = new Array(numTypeParameters);\r\n for (let i = 0; i < numTypeParameters; ++i) {\r\n let inferredType = assert(inferredTypes.get(typeParameterNodes[i].name.text)); // TODO\r\n resolvedTypeArguments[i] = inferredType;\r\n }\r\n instance = this.resolver.resolveFunction(\r\n prototype,\r\n resolvedTypeArguments,\r\n makeMap(flow.contextualTypeArguments)\r\n );\r\n if (!instance) return this.module.unreachable();\r\n return this.makeCallDirect(instance, argumentExprs, expression, contextualType == Type.void);\r\n // TODO: this skips inlining because inlining requires compiling its temporary locals in\r\n // the scope of the inlined flow. might need another mechanism to lock temp. locals early,\r\n // so inlining can be performed in `makeCallDirect` instead?\r\n\r\n // otherwise resolve the non-generic call as usual\r\n } else {\r\n instance = this.resolver.resolveFunction(prototype, null);\r\n }\r\n if (!instance) return this.module.unreachable();\r\n\r\n // compile 'this' expression if an instance method\r\n let thisExpr: ExpressionRef = 0;\r\n if (instance.is(CommonFlags.INSTANCE)) {\r\n thisExpr = this.compileExpressionRetainType(\r\n assert(this.resolver.currentThisExpression),\r\n this.options.usizeType\r\n );\r\n }\r\n\r\n return this.compileCallDirect(\r\n instance,\r\n expression.arguments,\r\n expression,\r\n thisExpr,\r\n contextualFlags\r\n );\r\n }\r\n\r\n // indirect call: index argument with signature (non-generic, can't be inlined)\r\n case ElementKind.LOCAL: {\r\n if (signature = (target).type.signatureReference) {\r\n if ((target).is(CommonFlags.INLINED)) {\r\n indexArg = module.i32(i64_low((target).constantIntegerValue));\r\n } else {\r\n indexArg = module.local_get((target).index, NativeType.I32);\r\n }\r\n break;\r\n } else {\r\n this.error(\r\n DiagnosticCode.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures,\r\n expression.range, (target).type.toString()\r\n );\r\n return module.unreachable();\r\n }\r\n }\r\n case ElementKind.GLOBAL: {\r\n if (signature = (target).type.signatureReference) {\r\n indexArg = module.global_get((target).internalName, (target).type.toNativeType());\r\n break;\r\n } else {\r\n this.error(\r\n DiagnosticCode.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures,\r\n expression.range, (target).type.toString()\r\n );\r\n return module.unreachable();\r\n }\r\n }\r\n case ElementKind.FIELD: {\r\n let type = (target).type;\r\n if (signature = type.signatureReference) {\r\n let thisExpression = assert(this.resolver.currentThisExpression);\r\n let thisExpr = this.compileExpressionRetainType(\r\n thisExpression,\r\n this.options.usizeType\r\n );\r\n indexArg = module.load(\r\n 4,\r\n false,\r\n thisExpr,\r\n NativeType.I32,\r\n (target).memoryOffset\r\n );\r\n break;\r\n } else {\r\n this.error(\r\n DiagnosticCode.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures,\r\n expression.range, type.toString()\r\n );\r\n return module.unreachable();\r\n }\r\n }\r\n case ElementKind.FUNCTION_TARGET: {\r\n signature = (target).signature;\r\n indexArg = this.compileExpression(expression.expression, (target).type, ContextualFlags.IMPLICIT);\r\n break;\r\n }\r\n\r\n case ElementKind.PROPERTY_PROTOTYPE: { // static property\r\n let getterPrototype = assert((target).getterPrototype);\r\n let getterInstance = this.resolver.resolveFunction(getterPrototype, null);\r\n if (!getterInstance) return module.unreachable();\r\n indexArg = this.compileCallDirect(getterInstance, [], expression.expression);\r\n signature = this.currentType.signatureReference;\r\n if (!signature) {\r\n this.error(\r\n DiagnosticCode.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures,\r\n expression.range, this.currentType.toString()\r\n );\r\n return module.unreachable();\r\n }\r\n break;\r\n }\r\n case ElementKind.PROPERTY: { // instance property\r\n let getterInstance = assert((target).getterInstance);\r\n indexArg = this.compileCallDirect(getterInstance, [], expression.expression,\r\n this.compileExpressionRetainType(\r\n assert(this.resolver.currentThisExpression),\r\n this.options.usizeType\r\n )\r\n );\r\n signature = this.currentType.signatureReference;\r\n if (!signature) {\r\n this.error(\r\n DiagnosticCode.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures,\r\n expression.range, this.currentType.toString()\r\n );\r\n return module.unreachable();\r\n }\r\n break;\r\n }\r\n\r\n // not supported\r\n default: {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return module.unreachable();\r\n }\r\n }\r\n return this.compileCallIndirect(\r\n signature,\r\n indexArg,\r\n expression.arguments,\r\n expression,\r\n 0,\r\n contextualType == Type.void\r\n );\r\n }\r\n\r\n private compileCallExpressionBuiltin(\r\n prototype: FunctionPrototype,\r\n expression: CallExpression,\r\n contextualType: Type\r\n ): ExpressionRef {\r\n var typeArguments: Type[] | null = null;\r\n\r\n // builtins handle omitted type arguments on their own. if present, however, resolve them here\r\n // and pass them to the builtin, even if it's still up to the builtin how to handle them.\r\n var typeParameterNodes = prototype.typeParameterNodes;\r\n var typeArgumentNodes = expression.typeArguments;\r\n if (expression.typeArguments) {\r\n if (!prototype.is(CommonFlags.GENERIC)) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n expression.range, prototype.internalName\r\n );\r\n }\r\n typeArguments = this.resolver.resolveTypeArguments(\r\n assert(typeParameterNodes),\r\n typeArgumentNodes,\r\n this.currentFlow.actualFunction.parent,\r\n makeMap(this.currentFlow.contextualTypeArguments),\r\n expression\r\n );\r\n }\r\n\r\n // now compile the builtin, which usually returns a block of code that replaces the call.\r\n var expr = compileBuiltinCall(\r\n this,\r\n prototype,\r\n typeArguments,\r\n expression.arguments,\r\n contextualType,\r\n expression\r\n );\r\n if (!expr) {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.unreachable();\r\n }\r\n return expr;\r\n }\r\n\r\n /**\r\n * Checks that a call with the given number as arguments can be performed according to the\r\n * specified signature.\r\n */\r\n checkCallSignature(\r\n signature: Signature,\r\n numArguments: i32,\r\n hasThis: bool,\r\n reportNode: Node\r\n ): bool {\r\n\r\n // cannot call an instance method without a `this` argument (TODO: `.call`?)\r\n var thisType = signature.thisType;\r\n if (hasThis != (thisType != null)) {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported, // TODO: better message?\r\n reportNode.range\r\n );\r\n return false;\r\n }\r\n\r\n // not yet implemented (TODO: maybe some sort of an unmanaged/lightweight array?)\r\n var hasRest = signature.hasRest;\r\n if (hasRest) {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n return false;\r\n }\r\n\r\n var minimum = signature.requiredParameters;\r\n var maximum = signature.parameterTypes.length;\r\n\r\n // must at least be called with required arguments\r\n if (numArguments < minimum) {\r\n this.error(\r\n minimum < maximum\r\n ? DiagnosticCode.Expected_at_least_0_arguments_but_got_1\r\n : DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, minimum.toString(), numArguments.toString()\r\n );\r\n return false;\r\n }\r\n\r\n // must not be called with more than the maximum arguments\r\n if (numArguments > maximum && !hasRest) {\r\n this.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, maximum.toString(), numArguments.toString()\r\n );\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /** Compiles a direct call to a concrete function. */\r\n compileCallDirect(\r\n instance: Function,\r\n argumentExpressions: Expression[],\r\n reportNode: Node,\r\n thisArg: ExpressionRef = 0,\r\n contextualFlags: ContextualFlags = ContextualFlags.NONE\r\n ): ExpressionRef {\r\n var numArguments = argumentExpressions.length;\r\n var signature = instance.signature;\r\n if (!this.checkCallSignature( // reports\r\n signature,\r\n numArguments,\r\n thisArg != 0,\r\n reportNode\r\n )) {\r\n this.currentType = signature.returnType;\r\n return this.module.unreachable();\r\n }\r\n\r\n // Inline if explicitly requested\r\n if (instance.hasDecorator(DecoratorFlags.INLINE)) {\r\n assert(!instance.is(CommonFlags.TRAMPOLINE)); // doesn't make sense\r\n if (this.currentInlineFunctions.includes(instance)) {\r\n this.warning(\r\n DiagnosticCode.Function_0_cannot_be_inlined_into_itself,\r\n reportNode.range, instance.internalName\r\n );\r\n } else {\r\n this.currentInlineFunctions.push(instance);\r\n let parameterTypes = signature.parameterTypes;\r\n assert(numArguments <= parameterTypes.length);\r\n // compile argument expressions\r\n let args = new Array(numArguments);\r\n for (let i = 0; i < numArguments; ++i) {\r\n args[i] = this.compileExpression(argumentExpressions[i], parameterTypes[i],\r\n ContextualFlags.IMPLICIT | ContextualFlags.SKIP_AUTORELEASE\r\n );\r\n }\r\n // make the inlined call (is aware of autoreleases)\r\n let expr = this.makeCallInline(instance, args, thisArg, (contextualFlags & ContextualFlags.WILL_DROP) != 0);\r\n if (this.currentType.isManaged) {\r\n if (!(contextualFlags & ContextualFlags.SKIP_AUTORELEASE)) {\r\n expr = this.makeAutorelease(expr, this.currentFlow);\r\n } else {\r\n this.skippedAutoreleases.add(expr);\r\n }\r\n }\r\n this.currentInlineFunctions.pop();\r\n return expr;\r\n }\r\n }\r\n\r\n // Otherwise compile to just a call\r\n var numArgumentsInclThis = thisArg ? numArguments + 1 : numArguments;\r\n var operands = new Array(numArgumentsInclThis);\r\n var index = 0;\r\n if (thisArg) {\r\n operands[0] = thisArg;\r\n index = 1;\r\n }\r\n var parameterTypes = signature.parameterTypes;\r\n for (let i = 0; i < numArguments; ++i, ++index) {\r\n operands[index] = this.compileExpression(argumentExpressions[i], parameterTypes[i],\r\n ContextualFlags.IMPLICIT\r\n );\r\n }\r\n assert(index == numArgumentsInclThis);\r\n if (signature.returnType.isManaged) {\r\n if (contextualFlags & ContextualFlags.WILL_DROP) {\r\n // Skip autorelease and simply release\r\n return this.makeCallDirect(instance, operands, reportNode, true);\r\n } else if (contextualFlags & ContextualFlags.SKIP_AUTORELEASE) {\r\n // Skip autorelease and remember\r\n let expr = this.makeCallDirect(instance, operands, reportNode, false, true);\r\n this.skippedAutoreleases.add(expr);\r\n return expr;\r\n } else {\r\n return this.makeCallDirect(instance, operands, reportNode, false, false);\r\n }\r\n }\r\n return this.makeCallDirect(instance, operands, reportNode,\r\n (contextualFlags & ContextualFlags.WILL_DROP) != 0\r\n );\r\n }\r\n\r\n makeCallInline(\r\n instance: Function,\r\n operands: ExpressionRef[] | null,\r\n thisArg: ExpressionRef = 0,\r\n immediatelyDropped: bool = false\r\n ): ExpressionRef {\r\n var module = this.module;\r\n var numArguments = operands ? operands.length : 0;\r\n var signature = instance.signature;\r\n var parameterTypes = signature.parameterTypes;\r\n var numParameters = parameterTypes.length;\r\n\r\n // Create a new inline flow and use it to compile the function as a block\r\n var previousFlow = this.currentFlow;\r\n var flow = Flow.createInline(previousFlow.parentFunction, instance);\r\n var body = [];\r\n var usedLocals = new Set();\r\n\r\n // Prepare compiled arguments right to left, keeping track of used locals.\r\n for (let i = numArguments - 1; i >= 0; --i) {\r\n // This is necessary because a later expression must not set an earlier argument local, which\r\n // is also just a temporary, when being executed. Take for example `t1=1, t2=(t1 = 2)`, where\r\n // the right expression would reassign the foregoing argument local. So, we iterate from right\r\n // to left, remembering what's used later, and don't use these for earlier arguments, making\r\n // the example above essentially `t2=1, t1=(t1 = 2)`.\r\n let paramExpr = operands![i];\r\n let paramType = parameterTypes[i];\r\n let argumentLocal = flow.addScopedLocal(signature.getParameterName(i), paramType, usedLocals);\r\n findUsedLocals(paramExpr, usedLocals);\r\n // inlining is aware of wrap/nonnull states:\r\n if (!previousFlow.canOverflow(paramExpr, paramType)) flow.setLocalFlag(argumentLocal.index, LocalFlags.WRAPPED);\r\n if (flow.isNonnull(paramExpr, paramType)) flow.setLocalFlag(argumentLocal.index, LocalFlags.NONNULL);\r\n // inlining is aware of skipped autoreleases:\r\n if (paramType.isManaged) {\r\n if (!this.skippedAutoreleases.has(paramExpr)) paramExpr = this.makeRetain(paramExpr);\r\n flow.setLocalFlag(argumentLocal.index, LocalFlags.RETAINED);\r\n }\r\n body.unshift(\r\n module.local_set(argumentLocal.index, paramExpr)\r\n );\r\n }\r\n if (thisArg) {\r\n let classInstance = assert(instance.parent); assert(classInstance.kind == ElementKind.CLASS);\r\n let thisType = assert(instance.signature.thisType);\r\n let thisLocal = flow.addScopedLocal(CommonSymbols.this_, thisType, usedLocals);\r\n // No need to retain `this` as it can't be reassigned and thus can't become prematurely released\r\n body.unshift(\r\n module.local_set(thisLocal.index, thisArg)\r\n );\r\n let baseInstance = (classInstance).base;\r\n if (baseInstance) flow.addScopedAlias(CommonSymbols.super_, baseInstance.type, thisLocal.index);\r\n } else {\r\n assert(!instance.signature.thisType);\r\n }\r\n\r\n // Compile omitted arguments with final argument locals blocked. Doesn't need to take care of\r\n // side-effects within earlier expressions because these already happened on set.\r\n this.currentFlow = flow;\r\n for (let i = numArguments; i < numParameters; ++i) {\r\n let initType = parameterTypes[i];\r\n let initExpr = this.compileExpression(\r\n assert(instance.prototype.signatureNode.parameters[i].initializer),\r\n initType,\r\n ContextualFlags.IMPLICIT\r\n );\r\n let argumentLocal = flow.addScopedLocal(signature.getParameterName(i), initType);\r\n if (!flow.canOverflow(initExpr, initType)) flow.setLocalFlag(argumentLocal.index, LocalFlags.WRAPPED);\r\n if (flow.isNonnull(initExpr, initType)) flow.setLocalFlag(argumentLocal.index, LocalFlags.NONNULL);\r\n if (initType.isManaged) {\r\n flow.setLocalFlag(argumentLocal.index, LocalFlags.RETAINED);\r\n body.push(\r\n module.local_set(argumentLocal.index,\r\n this.makeRetain(initExpr)\r\n )\r\n );\r\n } else {\r\n body.push(\r\n module.local_set(argumentLocal.index, initExpr)\r\n );\r\n }\r\n }\r\n\r\n // Compile the called function's body in the scope of the inlined flow\r\n this.compileFunctionBody(instance, body);\r\n\r\n // Free any new scoped locals and reset to the original flow\r\n if (!flow.isAny(FlowFlags.ANY_TERMINATING)) {\r\n this.performAutoreleases(flow, body);\r\n this.finishAutoreleases(flow, body);\r\n }\r\n flow.freeScopedLocals();\r\n var returnType = flow.returnType;\r\n this.currentFlow = previousFlow;\r\n\r\n // Create an outer block that we can break to when returning a value out of order\r\n var expr = module.block(flow.inlineReturnLabel, body, returnType.toNativeType());\r\n this.currentType = returnType;\r\n if (returnType.isManaged) {\r\n if (immediatelyDropped) {\r\n expr = this.makeRelease(expr);\r\n this.currentType = Type.void;\r\n }\r\n }\r\n return expr;\r\n }\r\n\r\n /** Gets the trampoline for the specified function. */\r\n ensureTrampoline(original: Function): Function {\r\n // A trampoline is a function that takes a fixed amount of operands with some of them possibly\r\n // being zeroed. It takes one additional argument denoting the number of actual operands\r\n // provided to the call, and takes appropriate steps to initialize zeroed operands to their\r\n // default values using the optional parameter initializers of the original function. Doing so\r\n // allows calls to functions with optional parameters to circumvent the trampoline when all\r\n // parameters are provided as a fast route, respectively setting up omitted operands in a proper\r\n // context otherwise.\r\n var trampoline = original.trampoline;\r\n if (trampoline) return trampoline;\r\n\r\n var originalSignature = original.signature;\r\n var originalName = original.internalName;\r\n var originalParameterTypes = originalSignature.parameterTypes;\r\n var originalParameterDeclarations = original.prototype.signatureNode.parameters;\r\n var returnType = originalSignature.returnType;\r\n var thisType = originalSignature.thisType;\r\n var isInstance = original.is(CommonFlags.INSTANCE);\r\n\r\n // arguments excl. `this`, operands incl. `this`\r\n var minArguments = originalSignature.requiredParameters;\r\n var minOperands = minArguments;\r\n var maxArguments = originalParameterTypes.length;\r\n var maxOperands = maxArguments;\r\n if (isInstance) {\r\n ++minOperands;\r\n ++maxOperands;\r\n }\r\n var numOptional = assert(maxOperands - minOperands);\r\n\r\n var forwardedOperands = new Array(minOperands);\r\n var operandIndex = 0;\r\n\r\n // forward `this` if applicable\r\n var module = this.module;\r\n if (isInstance) {\r\n forwardedOperands[0] = module.local_get(0, this.options.nativeSizeType);\r\n operandIndex = 1;\r\n }\r\n\r\n // forward required arguments\r\n for (let i = 0; i < minArguments; ++i, ++operandIndex) {\r\n forwardedOperands[operandIndex] = module.local_get(operandIndex, originalParameterTypes[i].toNativeType());\r\n }\r\n assert(operandIndex == minOperands);\r\n\r\n // create the trampoline element\r\n var trampolineSignature = new Signature(originalParameterTypes, returnType, thisType);\r\n trampolineSignature.requiredParameters = maxArguments;\r\n trampolineSignature.parameterNames = originalSignature.parameterNames;\r\n trampoline = new Function(\r\n original.name + \"|trampoline\",\r\n original.prototype,\r\n trampolineSignature,\r\n original.contextualTypeArguments\r\n );\r\n trampoline.set(original.flags | CommonFlags.TRAMPOLINE | CommonFlags.COMPILED);\r\n original.trampoline = trampoline;\r\n\r\n // compile initializers of omitted arguments in scope of the trampoline function\r\n // this is necessary because initializers might need additional locals and a proper this context\r\n var previousFlow = this.currentFlow;\r\n var flow = trampoline.flow;\r\n this.currentFlow = flow;\r\n\r\n // create a br_table switching over the number of optional parameters provided\r\n var numNames = numOptional + 1; // incl. outer block\r\n var names = new Array(numNames);\r\n var ofN = \"of\" + numOptional.toString(10);\r\n for (let i = 0; i < numNames; ++i) {\r\n let label = i.toString(10) + ofN;\r\n names[i] = label;\r\n }\r\n var body = module.block(names[0], [\r\n module.block(\"outOfRange\", [\r\n module.switch(names, \"outOfRange\",\r\n // condition is number of provided optional arguments, so subtract required arguments\r\n minArguments\r\n ? module.binary(\r\n BinaryOp.SubI32,\r\n module.global_get(BuiltinSymbols.argc, NativeType.I32),\r\n module.i32(minArguments)\r\n )\r\n : module.global_get(BuiltinSymbols.argc, NativeType.I32)\r\n )\r\n ]),\r\n module.unreachable()\r\n ]);\r\n for (let i = 0; i < numOptional; ++i, ++operandIndex) {\r\n let type = originalParameterTypes[minArguments + i];\r\n let declaration = originalParameterDeclarations[minArguments + i];\r\n let initializer = declaration.initializer;\r\n let initExpr: ExpressionRef;\r\n if (initializer) {\r\n initExpr = module.local_set(operandIndex,\r\n this.compileExpression(\r\n initializer,\r\n type,\r\n ContextualFlags.IMPLICIT\r\n )\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Optional_parameter_must_have_an_initializer,\r\n declaration.range\r\n );\r\n initExpr = module.unreachable();\r\n }\r\n body = module.block(names[i + 1], [\r\n body,\r\n initExpr,\r\n ]);\r\n forwardedOperands[operandIndex] = module.local_get(operandIndex, type.toNativeType());\r\n }\r\n assert(operandIndex == maxOperands);\r\n\r\n var stmts: ExpressionRef[] = [ body ];\r\n var theCall = module.call(originalName, forwardedOperands, returnType.toNativeType());\r\n if (returnType != Type.void) {\r\n this.performAutoreleasesWithValue(flow, theCall, returnType, stmts);\r\n } else {\r\n stmts.push(theCall);\r\n this.performAutoreleases(flow, stmts);\r\n }\r\n flow.freeScopedLocals();\r\n this.currentFlow = previousFlow;\r\n\r\n var funcRef = module.addFunction(\r\n trampoline.internalName,\r\n this.ensureFunctionType(\r\n trampolineSignature.parameterTypes,\r\n returnType,\r\n thisType\r\n ),\r\n typesToNativeTypes(trampoline.additionalLocals),\r\n module.block(null, stmts, returnType.toNativeType())\r\n );\r\n trampoline.finalize(module, funcRef);\r\n return trampoline;\r\n }\r\n\r\n /** Makes sure that the argument count helper global is present and returns its name. */\r\n private ensureArgcVar(): string {\r\n if (!this.argcVar) {\r\n let module = this.module;\r\n this.argcVar = module.addGlobal(\r\n BuiltinSymbols.argc,\r\n NativeType.I32,\r\n true,\r\n module.i32(0)\r\n );\r\n }\r\n return BuiltinSymbols.argc;\r\n }\r\n\r\n /** Makes sure that the argument count helper setter is present and returns its name. */\r\n private ensureArgcSet(): string {\r\n if (!this.argcSet) {\r\n let module = this.module;\r\n this.argcSet = module.addFunction(BuiltinSymbols.setargc,\r\n this.ensureFunctionType([ Type.u32 ], Type.void),\r\n null,\r\n module.global_set(this.ensureArgcVar(),\r\n module.local_get(0, NativeType.I32)\r\n )\r\n );\r\n module.addFunctionExport(BuiltinSymbols.setargc, \"__setargc\");\r\n }\r\n return BuiltinSymbols.setargc;\r\n }\r\n\r\n // \r\n\r\n /** Makes retain call, retaining the expression's value. */\r\n makeRetain(expr: ExpressionRef): ExpressionRef {\r\n var retainInstance = this.program.retainInstance;\r\n this.compileFunction(retainInstance);\r\n return this.module.call(retainInstance.internalName, [ expr ], this.options.nativeSizeType);\r\n }\r\n\r\n /** Makes a retainRelease call, retaining the new expression's value and releasing the old expression's value, in this order. */\r\n makeRetainRelease(oldExpr: ExpressionRef, newExpr: ExpressionRef): ExpressionRef {\r\n // if ((t1=newExpr) != (t2=oldExpr)) {\r\n // __retain(t1);\r\n // __release(t2);\r\n // }, t1\r\n var module = this.module;\r\n var flow = this.currentFlow;\r\n var usizeType = this.options.usizeType;\r\n var nativeSizeType = this.options.nativeSizeType;\r\n var temp1 = flow.getTempLocal(usizeType, findUsedLocals(oldExpr));\r\n var temp2 = flow.getAndFreeTempLocal(usizeType);\r\n flow.freeTempLocal(temp1);\r\n return module.block(null, [\r\n module.if(\r\n module.binary(nativeSizeType == NativeType.I64 ? BinaryOp.NeI64 : BinaryOp.NeI32,\r\n module.local_tee(temp1.index, newExpr),\r\n module.local_tee(temp2.index, oldExpr)\r\n ),\r\n module.block(null, [\r\n module.drop(\r\n this.makeRetain(module.local_get(temp1.index, nativeSizeType))\r\n ),\r\n this.makeRelease(module.local_get(temp2.index, nativeSizeType))\r\n ])\r\n ),\r\n module.local_get(temp1.index, nativeSizeType)\r\n ], nativeSizeType);\r\n }\r\n\r\n /** Makes a skippedRelease call, ignoring the new expression's value and releasing the old expression's value, in this order. */\r\n makeSkippedRelease(oldExpr: ExpressionRef, newExpr: ExpressionRef): ExpressionRef {\r\n // TODO: this helper can be eliminated altogether if the current logic holds\r\n // (t1=newExpr), __release(oldExpr), t1\r\n var module = this.module;\r\n var flow = this.currentFlow;\r\n var usizeType = this.options.usizeType;\r\n var nativeSizeType = this.options.nativeSizeType;\r\n var temp = flow.getAndFreeTempLocal(usizeType, findUsedLocals(oldExpr));\r\n return module.block(null, [\r\n module.local_set(temp.index, newExpr),\r\n this.makeRelease(oldExpr),\r\n module.local_get(temp.index, nativeSizeType)\r\n ], nativeSizeType);\r\n }\r\n\r\n /** Makes a release call, releasing the expression's value. Changes the current type to void.*/\r\n makeRelease(expr: ExpressionRef): ExpressionRef {\r\n var releaseInstance = this.program.releaseInstance;\r\n this.compileFunction(releaseInstance);\r\n return this.module.call(releaseInstance.internalName, [ expr ], NativeType.None);\r\n }\r\n\r\n /** Makes an automatic release call at the end of the current flow. */\r\n makeAutorelease(expr: ExpressionRef, flow: Flow = this.currentFlow): ExpressionRef {\r\n return this.module.local_tee(flow.getAutoreleaseLocal(this.options.usizeType).index, expr);\r\n }\r\n\r\n /** Attempts to undo a final autorelease, returning the index of the previously retaining variable or -1 if not possible. */\r\n undoAutorelease(expr: ExpressionRef, flow: Flow): i32 {\r\n // NOTE: Can't remove the local.tee completely because it's already compiled\r\n // and a child of something else. Preventing the final release however should\r\n // make it optimize away.\r\n switch (getExpressionId(expr)) {\r\n case ExpressionId.LocalSet: { // local.tee(__retain(expr))\r\n if (isLocalTee(expr)) {\r\n let index = getLocalSetIndex(expr);\r\n if (flow.isAnyLocalFlag(index, LocalFlags.ANY_RETAINED)) {\r\n // Assumes that the expression actually belongs to the flow and that\r\n // top-level autoreleases are never undone. While that's true, it's\r\n // not necessary to check presence in scopedLocals.\r\n flow.unsetLocalFlag(index, LocalFlags.ANY_RETAINED);\r\n return index;\r\n }\r\n }\r\n break;\r\n }\r\n case ExpressionId.Block: { // { ..., local.tee(__retain(expr)) }\r\n if (getBlockName(expr) === null) { // must not be a break target\r\n let count = getBlockChildCount(expr);\r\n if (count) {\r\n return this.undoAutorelease(getBlockChild(expr, count - 1), flow);\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n return -1;\r\n }\r\n\r\n /**\r\n * Attemps to move a final autorelease from one flow to a parent.\r\n * It is crucial that from flow hasn't processed autoreleases yet because otherwise the final\r\n * retain would have been written already.\r\n */\r\n moveAutorelease(expr: ExpressionRef, fromInnerFlow: Flow, toOuterFlow: Flow): ExpressionRef {\r\n // NOTE: While this avoids an unnecessary set of retain and release, it cannot\r\n // eliminate the now unnecessary temporary local.tee because it is already part of\r\n // another expression in the tree. But optimizing should collapse locals again.\r\n var index = this.undoAutorelease(expr, fromInnerFlow);\r\n return ~index\r\n ? this.makeAutorelease(expr, toOuterFlow) // undone, can skip the retain\r\n : this.makeAutorelease(this.makeRetain(expr), toOuterFlow);\r\n }\r\n\r\n /** Performs any queued autoreleases in the specified flow. */\r\n performAutoreleases(flow: Flow, stmts: ExpressionRef[], clearFlags: bool = true): void {\r\n var scopedLocals = flow.scopedLocals;\r\n if (scopedLocals) {\r\n let module = this.module;\r\n for (let local of scopedLocals.values()) {\r\n if (local.is(CommonFlags.SCOPED)) { // otherwise an alias\r\n let localIndex = local.index;\r\n if (flow.isAnyLocalFlag(localIndex, LocalFlags.ANY_RETAINED)) {\r\n if (clearFlags) flow.unsetLocalFlag(localIndex, LocalFlags.ANY_RETAINED);\r\n stmts.push(\r\n this.makeRelease(\r\n module.local_get(localIndex, local.type.toNativeType())\r\n )\r\n );\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /** Performs any queued autoreleases in the specified flow and returns the value. */\r\n performAutoreleasesWithValue(\r\n flow: Flow,\r\n valueExpr: ExpressionRef,\r\n valueType: Type,\r\n stmts: ExpressionRef[] | null = null,\r\n clearFlags: bool = true\r\n ): ExpressionRef {\r\n if (!stmts) stmts = new Array();\r\n stmts.push(\r\n this.module.nop()\r\n );\r\n var lengthBefore = stmts.length;\r\n this.performAutoreleases(flow, stmts, clearFlags);\r\n if (stmts.length > lengthBefore) {\r\n let nativeType = valueType.toNativeType();\r\n let temp = flow.getAndFreeTempLocal(valueType);\r\n if (!flow.canOverflow(valueExpr, valueType)) flow.setLocalFlag(temp.index, LocalFlags.WRAPPED);\r\n if (flow.isNonnull(valueExpr, valueType)) flow.setLocalFlag(temp.index, LocalFlags.NONNULL);\r\n let module = this.module;\r\n stmts[lengthBefore - 1] = module.local_set(temp.index, valueExpr); // nop -> set\r\n stmts.push(\r\n module.local_get(temp.index, nativeType) // append get\r\n );\r\n return module.block(null, stmts, nativeType);\r\n } else if (stmts.length > 1) {\r\n stmts[lengthBefore - 1] = valueExpr; // nop -> value\r\n return this.module.block(null, stmts, valueType.toNativeType());\r\n }\r\n return valueExpr;\r\n }\r\n\r\n /** Finishes any queued top-level autoreleases in the actual function of the specified flow. */\r\n finishAutoreleases(flow: Flow, stmts: ExpressionRef[]): void {\r\n var module = this.module;\r\n if (flow.is(FlowFlags.INLINE_CONTEXT)) {\r\n // traverse to the top-most flow containing the inlined function's\r\n // locals as scoped locals and release these instead.\r\n let parent: Flow | null;\r\n while (parent = flow.parent) flow = parent;\r\n this.performAutoreleases(flow, stmts, false);\r\n } else {\r\n for (let local of flow.parentFunction.localsByIndex) {\r\n let localIndex = local.index;\r\n if (flow.isAnyLocalFlag(localIndex, LocalFlags.ANY_RETAINED)) {\r\n flow.unsetLocalFlag(localIndex, LocalFlags.ANY_RETAINED);\r\n stmts.push(\r\n this.makeRelease(\r\n module.local_get(localIndex, local.type.toNativeType())\r\n )\r\n );\r\n }\r\n }\r\n }\r\n }\r\n\r\n // \r\n\r\n /** Creates a direct call to the specified function. */\r\n makeCallDirect(\r\n instance: Function,\r\n operands: ExpressionRef[] | null,\r\n reportNode: Node,\r\n immediatelyDropped: bool = false,\r\n /** Skip the usual autorelease and manage this at the callsite instead. */\r\n skipAutorelease: bool = false\r\n ): ExpressionRef {\r\n if (instance.hasDecorator(DecoratorFlags.INLINE)) {\r\n this.warning(\r\n DiagnosticCode.TODO_Cannot_inline_inferred_calls_and_specific_internals_yet,\r\n reportNode.range, instance.internalName\r\n );\r\n }\r\n var numOperands = operands ? operands.length : 0;\r\n var numArguments = numOperands;\r\n var minArguments = instance.signature.requiredParameters;\r\n var minOperands = minArguments;\r\n var maxArguments = instance.signature.parameterTypes.length;\r\n var maxOperands = maxArguments;\r\n if (instance.is(CommonFlags.INSTANCE)) {\r\n ++minOperands;\r\n ++maxOperands;\r\n --numArguments;\r\n }\r\n assert(numOperands >= minOperands);\r\n\r\n var module = this.module;\r\n if (!this.compileFunction(instance)) return module.unreachable();\r\n var returnType = instance.signature.returnType;\r\n var isCallImport = instance.is(CommonFlags.MODULE_IMPORT);\r\n\r\n // fill up omitted arguments with their initializers, if constant, otherwise with zeroes.\r\n if (numOperands < maxOperands) {\r\n if (!operands) {\r\n operands = new Array(maxOperands);\r\n operands.length = 0;\r\n }\r\n let parameterTypes = instance.signature.parameterTypes;\r\n let parameterNodes = instance.prototype.signatureNode.parameters;\r\n assert(parameterNodes.length == parameterTypes.length);\r\n let allOptionalsAreConstant = true;\r\n for (let i = numArguments; i < maxArguments; ++i) {\r\n let initializer = parameterNodes[i].initializer;\r\n if (initializer) {\r\n if (nodeIsConstantValue(initializer.kind)) {\r\n operands.push(this.compileExpression(\r\n parameterNodes[i].initializer,\r\n parameterTypes[i],\r\n ContextualFlags.IMPLICIT\r\n ));\r\n continue;\r\n }\r\n let resolved = this.resolver.resolveExpression(initializer, instance.flow, parameterTypes[i]);\r\n if (resolved) {\r\n if (resolved.kind == ElementKind.GLOBAL) {\r\n let global = resolved;\r\n if (this.compileGlobal(global)) {\r\n if (global.is(CommonFlags.INLINED)) {\r\n operands.push(\r\n this.compileInlineConstant(global, parameterTypes[i], ContextualFlags.IMPLICIT)\r\n );\r\n } else {\r\n operands.push(\r\n this.convertExpression(\r\n module.global_get(global.internalName, global.type.toNativeType()),\r\n global.type, parameterTypes[i], false, false, initializer\r\n )\r\n );\r\n }\r\n continue;\r\n }\r\n }\r\n }\r\n }\r\n operands.push(parameterTypes[i].toNativeZero(module));\r\n allOptionalsAreConstant = false;\r\n }\r\n if (!allOptionalsAreConstant) {\r\n if (!isCallImport) {\r\n let original = instance;\r\n instance = this.ensureTrampoline(instance);\r\n if (!this.compileFunction(instance)) return module.unreachable();\r\n instance.flow.flags = original.flow.flags;\r\n let nativeReturnType = returnType.toNativeType();\r\n let expr = module.call(instance.internalName, operands, nativeReturnType);\r\n this.currentType = returnType;\r\n if (returnType.isManaged) {\r\n if (immediatelyDropped) {\r\n expr = this.makeRelease(expr);\r\n this.currentType = Type.void;\r\n } else if (!skipAutorelease) {\r\n expr = this.makeAutorelease(expr);\r\n } else {\r\n this.skippedAutoreleases.add(expr);\r\n }\r\n }\r\n return module.block(null, [\r\n module.global_set(this.ensureArgcVar(), module.i32(numArguments)),\r\n expr\r\n ], this.currentType.toNativeType());\r\n }\r\n }\r\n }\r\n\r\n // If the return value is of a reference type it has not yet been released but is in flight\r\n // which is equivalent to a skipped autorelease. Hence, insert either a release if it is\r\n // dropped anyway, preserve the skipped autorelease if explicitly requested or autorelease now.\r\n var expr = module.call(instance.internalName, operands, returnType.toNativeType());\r\n this.currentType = returnType;\r\n if (returnType.isManaged) {\r\n if (immediatelyDropped) {\r\n expr = this.makeRelease(expr);\r\n this.currentType = Type.void;\r\n } else if (!skipAutorelease) {\r\n expr = this.makeAutorelease(expr);\r\n }\r\n }\r\n return expr;\r\n }\r\n\r\n /** Compiles an indirect call using an index argument and a signature. */\r\n compileCallIndirect(\r\n signature: Signature,\r\n indexArg: ExpressionRef,\r\n argumentExpressions: Expression[],\r\n reportNode: Node,\r\n thisArg: ExpressionRef = 0,\r\n immediatelyDropped: bool = false\r\n ): ExpressionRef {\r\n var numArguments = argumentExpressions.length;\r\n\r\n if (!this.checkCallSignature( // reports\r\n signature,\r\n numArguments,\r\n thisArg != 0,\r\n reportNode\r\n )) {\r\n return this.module.unreachable();\r\n }\r\n\r\n var numArgumentsInclThis = thisArg ? numArguments + 1 : numArguments;\r\n var operands = new Array(numArgumentsInclThis);\r\n var index = 0;\r\n if (thisArg) {\r\n operands[0] = thisArg;\r\n index = 1;\r\n }\r\n var parameterTypes = signature.parameterTypes;\r\n for (let i = 0; i < numArguments; ++i, ++index) {\r\n operands[index] = this.compileExpression(argumentExpressions[i], parameterTypes[i],\r\n ContextualFlags.IMPLICIT\r\n );\r\n }\r\n assert(index == numArgumentsInclThis);\r\n return this.makeCallIndirect(signature, indexArg, operands, immediatelyDropped);\r\n }\r\n\r\n /** Creates an indirect call to the function at `indexArg` in the function table. */\r\n makeCallIndirect(\r\n signature: Signature,\r\n indexArg: ExpressionRef,\r\n operands: ExpressionRef[] | null = null,\r\n immediatelyDropped: bool = false\r\n ): ExpressionRef {\r\n var numOperands = operands ? operands.length : 0;\r\n var numArguments = numOperands;\r\n var minArguments = signature.requiredParameters;\r\n var minOperands = minArguments;\r\n var maxArguments = signature.parameterTypes.length;\r\n var maxOperands = maxArguments;\r\n if (signature.thisType) {\r\n ++minOperands;\r\n ++maxOperands;\r\n --numArguments;\r\n }\r\n assert(numOperands >= minOperands);\r\n\r\n this.ensureFunctionType(signature.parameterTypes, signature.returnType, signature.thisType);\r\n var module = this.module;\r\n\r\n // fill up omitted arguments with zeroes\r\n if (numOperands < maxOperands) {\r\n if (!operands) {\r\n operands = new Array(maxOperands);\r\n operands.length = 0;\r\n }\r\n let parameterTypes = signature.parameterTypes;\r\n for (let i = numArguments; i < maxArguments; ++i) {\r\n operands.push(parameterTypes[i].toNativeZero(module));\r\n }\r\n }\r\n\r\n var returnType = signature.returnType;\r\n var expr = module.call_indirect(indexArg, operands, signature.toSignatureString());\r\n this.currentType = returnType;\r\n if (returnType.isManaged) {\r\n if (immediatelyDropped) {\r\n expr = this.makeRelease(expr);\r\n this.currentType = Type.void;\r\n } else {\r\n expr = this.makeAutorelease(expr);\r\n }\r\n }\r\n return module.block(null, [\r\n module.global_set(this.ensureArgcVar(), // might be calling a trampoline\r\n module.i32(numArguments)\r\n ),\r\n expr\r\n ], this.currentType.toNativeType()); // not necessarily wrapped\r\n }\r\n\r\n compileCommaExpression(\r\n expression: CommaExpression,\r\n contextualType: Type,\r\n contextualFlags: ContextualFlags\r\n ): ExpressionRef {\r\n var expressions = expression.expressions;\r\n var numExpressions = expressions.length;\r\n var exprs = new Array(numExpressions--);\r\n for (let i = 0; i < numExpressions; ++i) {\r\n exprs[i] = this.compileExpression(expressions[i], Type.void, // drop all except last\r\n ContextualFlags.IMPLICIT | ContextualFlags.WILL_DROP\r\n );\r\n }\r\n exprs[numExpressions] = this.compileExpression(expressions[numExpressions], contextualType, contextualFlags);\r\n return this.module.block(null, exprs, this.currentType.toNativeType());\r\n }\r\n\r\n compileElementAccessExpression(\r\n expression: ElementAccessExpression,\r\n contextualType: Type,\r\n contextualFlags: ContextualFlags\r\n ): ExpressionRef {\r\n var target = this.resolver.resolveElementAccessExpression(\r\n expression,\r\n this.currentFlow,\r\n contextualType\r\n ); // reports\r\n if (!target) return this.module.unreachable();\r\n switch (target.kind) {\r\n case ElementKind.CLASS: {\r\n let indexedGet = (target).lookupOverload(OperatorKind.INDEXED_GET, this.currentFlow.is(FlowFlags.UNCHECKED_CONTEXT));\r\n if (!indexedGet) {\r\n this.error(\r\n DiagnosticCode.Index_signature_is_missing_in_type_0,\r\n expression.expression.range, (target).internalName\r\n );\r\n return this.module.unreachable();\r\n }\r\n let thisArg = this.compileExpression(expression.expression, (target).type,\r\n ContextualFlags.IMPLICIT\r\n );\r\n return this.compileCallDirect(indexedGet, [\r\n expression.elementExpression\r\n ], expression, thisArg, contextualFlags & (ContextualFlags.WILL_DROP | ContextualFlags.SKIP_AUTORELEASE));\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.unreachable();\r\n }\r\n\r\n compileFunctionExpression(\r\n expression: FunctionExpression,\r\n contextualSignature: Signature | null,\r\n contextualFlags: ContextualFlags\r\n ): ExpressionRef {\r\n var declaration = expression.declaration.clone(); // generic contexts can have multiple\r\n assert(!declaration.typeParameters); // function expression cannot be generic\r\n var flow = this.currentFlow;\r\n var actualFunction = flow.actualFunction;\r\n var prototype = new FunctionPrototype(\r\n declaration.name.text.length\r\n ? declaration.name.text\r\n : \"anonymous|\" + (actualFunction.nextAnonymousId++).toString(10),\r\n actualFunction,\r\n declaration,\r\n DecoratorFlags.NONE\r\n );\r\n var instance: Function | null;\r\n var contextualTypeArguments = makeMap(flow.contextualTypeArguments);\r\n\r\n // compile according to context. this differs from a normal function in that omitted parameter\r\n // and return types can be inferred and omitted arguments can be replaced with dummies.\r\n if (contextualSignature) {\r\n let signatureNode = prototype.signatureNode;\r\n let parameterNodes = signatureNode.parameters;\r\n let numPresentParameters = parameterNodes.length;\r\n\r\n // must not require more than the maximum number of parameters\r\n let parameterTypes = contextualSignature.parameterTypes;\r\n let numParameters = parameterTypes.length;\r\n if (numPresentParameters > numParameters) {\r\n this.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n expression.range, numParameters.toString(), numPresentParameters.toString()\r\n );\r\n return this.module.unreachable();\r\n }\r\n\r\n // check non-omitted parameter types\r\n let parameterNames = new Array(numPresentParameters);\r\n for (let i = 0; i < numPresentParameters; ++i) {\r\n let parameterNode = parameterNodes[i];\r\n parameterNames[i] = parameterNode.name.text; // use actual name\r\n if (!isTypeOmitted(parameterNode.type)) {\r\n let resolvedType = this.resolver.resolveType(\r\n parameterNode.type,\r\n actualFunction.parent,\r\n contextualTypeArguments\r\n );\r\n if (!resolvedType) return this.module.unreachable();\r\n if (!parameterTypes[i].isStrictlyAssignableTo(resolvedType)) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_assignable_to_type_1,\r\n parameterNode.range, parameterTypes[i].toString(), resolvedType.toString()\r\n );\r\n return this.module.unreachable();\r\n }\r\n }\r\n // any unused parameters are inherited but ignored\r\n }\r\n\r\n // check non-omitted return type\r\n let returnType = contextualSignature.returnType;\r\n if (!isTypeOmitted(signatureNode.returnType)) {\r\n let resolvedType = this.resolver.resolveType(\r\n signatureNode.returnType,\r\n actualFunction.parent,\r\n contextualTypeArguments\r\n );\r\n if (!resolvedType) return this.module.unreachable();\r\n if (\r\n returnType == Type.void\r\n ? resolvedType != Type.void\r\n : !resolvedType.isStrictlyAssignableTo(returnType)\r\n ) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_assignable_to_type_1,\r\n signatureNode.returnType.range, resolvedType.toString(), returnType.toString()\r\n );\r\n return this.module.unreachable();\r\n }\r\n }\r\n\r\n // check explicit this type\r\n let thisType = contextualSignature.thisType;\r\n let thisTypeNode = signatureNode.explicitThisType;\r\n if (thisTypeNode) {\r\n if (!thisType) {\r\n this.error(\r\n DiagnosticCode._this_cannot_be_referenced_in_current_location,\r\n thisTypeNode.range\r\n );\r\n return this.module.unreachable();\r\n }\r\n let resolvedType = this.resolver.resolveType(\r\n thisTypeNode,\r\n actualFunction.parent,\r\n contextualTypeArguments\r\n );\r\n if (!resolvedType) return this.module.unreachable();\r\n if (!thisType.isStrictlyAssignableTo(resolvedType)) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_assignable_to_type_1,\r\n thisTypeNode.range, thisType.toString(), resolvedType.toString()\r\n );\r\n return this.module.unreachable();\r\n }\r\n }\r\n\r\n let signature = new Signature(parameterTypes, returnType, thisType);\r\n signature.requiredParameters = numParameters; // !\r\n signature.parameterNames = parameterNames;\r\n instance = new Function(\r\n prototype.name,\r\n prototype,\r\n signature,\r\n contextualTypeArguments\r\n );\r\n if (!this.compileFunction(instance)) return this.module.unreachable();\r\n this.currentType = contextualSignature.type;\r\n\r\n // otherwise compile like a normal function\r\n } else {\r\n instance = this.compileFunctionUsingTypeArguments(\r\n prototype,\r\n [],\r\n contextualTypeArguments\r\n );\r\n if (!instance) return this.module.unreachable();\r\n this.currentType = instance.signature.type;\r\n }\r\n\r\n var index = this.ensureFunctionTableEntry(instance); // reports\r\n return index < 0\r\n ? this.module.unreachable()\r\n : this.module.i32(index);\r\n }\r\n\r\n /** Makes sure the enclosing source file of the specified expression has been compiled. */\r\n private maybeCompileEnclosingSource(expression: Expression): void {\r\n var internalPath = expression.range.source.internalPath;\r\n var filesByName = this.program.filesByName;\r\n assert(filesByName.has(internalPath));\r\n var enclosingFile = filesByName.get(internalPath)!;\r\n if (!enclosingFile.is(CommonFlags.COMPILED)) {\r\n this.compileFileByPath(internalPath, expression);\r\n }\r\n }\r\n\r\n /**\r\n * Compiles an identifier in the specified context.\r\n * @param retainConstantType Retains the type of inlined constants if `true`, otherwise\r\n * precomputes them according to context.\r\n */\r\n compileIdentifierExpression(\r\n expression: IdentifierExpression,\r\n contextualType: Type,\r\n contextualFlags: ContextualFlags\r\n ): ExpressionRef {\r\n var module = this.module;\r\n var flow = this.currentFlow;\r\n var actualFunction = flow.actualFunction;\r\n\r\n // check special keywords first\r\n switch (expression.kind) {\r\n case NodeKind.NULL: {\r\n let options = this.options;\r\n if (!contextualType.classReference) {\r\n this.currentType = options.usizeType;\r\n }\r\n return options.isWasm64\r\n ? module.i64(0)\r\n : module.i32(0);\r\n }\r\n case NodeKind.TRUE: {\r\n this.currentType = Type.bool;\r\n return module.i32(1);\r\n }\r\n case NodeKind.FALSE: {\r\n this.currentType = Type.bool;\r\n return module.i32(0);\r\n }\r\n case NodeKind.THIS: {\r\n if (actualFunction.is(CommonFlags.INSTANCE)) {\r\n let thisLocal = assert(flow.lookupLocal(CommonSymbols.this_));\r\n let classInstance = assert(actualFunction.parent); assert(classInstance.kind == ElementKind.CLASS);\r\n let nativeSizeType = this.options.nativeSizeType;\r\n if (actualFunction.is(CommonFlags.CONSTRUCTOR)) {\r\n if (!flow.is(FlowFlags.ALLOCATES)) {\r\n flow.set(FlowFlags.ALLOCATES);\r\n // {\r\n // if (!this) this = \r\n // this.a = X\r\n // this.b = Y\r\n // return this\r\n // }\r\n let stmts: ExpressionRef[] = [\r\n module.if(\r\n module.unary(nativeSizeType == NativeType.I64 ? UnaryOp.EqzI64 : UnaryOp.EqzI32,\r\n module.local_get(thisLocal.index, nativeSizeType)\r\n ),\r\n module.local_set(thisLocal.index,\r\n this.makeRetain(\r\n this.makeAllocation(classInstance)\r\n )\r\n )\r\n )\r\n ];\r\n this.makeFieldInitialization(classInstance, stmts);\r\n stmts.push(\r\n module.local_get(thisLocal.index, nativeSizeType)\r\n );\r\n this.currentType = thisLocal.type;\r\n return module.block(null, stmts, nativeSizeType);\r\n }\r\n }\r\n // if not a constructor, `this` type can differ\r\n let thisType = assert(actualFunction.signature.thisType);\r\n this.currentType = thisType;\r\n return module.local_get(thisLocal.index, thisType.toNativeType());\r\n }\r\n this.error(\r\n DiagnosticCode._this_cannot_be_referenced_in_current_location,\r\n expression.range\r\n );\r\n this.currentType = this.options.usizeType;\r\n return module.unreachable();\r\n }\r\n case NodeKind.SUPER: {\r\n let flow = this.currentFlow;\r\n let actualFunction = flow.actualFunction;\r\n if (actualFunction.is(CommonFlags.CONSTRUCTOR)) {\r\n if (!flow.is(FlowFlags.CALLS_SUPER)) {\r\n // TS1034 in the parser effectively limits this to property accesses\r\n this.error(\r\n DiagnosticCode._super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class,\r\n expression.range\r\n );\r\n }\r\n }\r\n if (flow.is(FlowFlags.INLINE_CONTEXT)) {\r\n let scopedThis = flow.lookupLocal(CommonSymbols.this_);\r\n if (scopedThis) {\r\n let scopedThisClass = assert(scopedThis.type.classReference);\r\n let base = scopedThisClass.base;\r\n if (base) {\r\n this.currentType = base.type;\r\n return module.local_get(scopedThis.index, base.type.toNativeType());\r\n }\r\n }\r\n }\r\n if (actualFunction.is(CommonFlags.INSTANCE)) {\r\n let classInstance = assert(actualFunction.parent); assert(classInstance.kind == ElementKind.CLASS);\r\n let baseClassInstance = (classInstance).base;\r\n if (baseClassInstance) {\r\n let superType = baseClassInstance.type;\r\n this.currentType = superType;\r\n return module.local_get(0, superType.toNativeType());\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode._super_can_only_be_referenced_in_a_derived_class,\r\n expression.range\r\n );\r\n this.currentType = this.options.usizeType;\r\n return module.unreachable();\r\n }\r\n }\r\n\r\n this.maybeCompileEnclosingSource(expression);\r\n\r\n // otherwise resolve\r\n var target = this.resolver.resolveIdentifier( // reports\r\n expression,\r\n flow,\r\n this.currentEnum || actualFunction\r\n );\r\n if (!target) return module.unreachable();\r\n\r\n switch (target.kind) {\r\n case ElementKind.LOCAL: {\r\n let type = (target).type;\r\n assert(type != Type.void);\r\n if ((target).is(CommonFlags.INLINED)) {\r\n return this.compileInlineConstant(target, contextualType, contextualFlags);\r\n }\r\n let localIndex = (target).index;\r\n assert(localIndex >= 0);\r\n if (type.is(TypeFlags.NULLABLE) && flow.isLocalFlag(localIndex, LocalFlags.NONNULL, false)) {\r\n type = type.nonNullableType;\r\n }\r\n this.currentType = type;\r\n return this.module.local_get(localIndex, type.toNativeType());\r\n }\r\n case ElementKind.GLOBAL: {\r\n if (!this.compileGlobal(target)) { // reports; not yet compiled if a static field\r\n return this.module.unreachable();\r\n }\r\n let type = (target).type;\r\n assert(type != Type.void);\r\n if ((target).is(CommonFlags.INLINED)) {\r\n return this.compileInlineConstant(target, contextualType, contextualFlags);\r\n }\r\n this.currentType = type;\r\n return this.module.global_get((target).internalName, type.toNativeType());\r\n }\r\n case ElementKind.ENUMVALUE: { // here: if referenced from within the same enum\r\n if (!target.is(CommonFlags.COMPILED)) {\r\n this.error(\r\n DiagnosticCode.A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums,\r\n expression.range\r\n );\r\n this.currentType = Type.i32;\r\n return this.module.unreachable();\r\n }\r\n this.currentType = Type.i32;\r\n if ((target).is(CommonFlags.INLINED)) {\r\n assert((target).constantValueKind == ConstantValueKind.INTEGER);\r\n return this.module.i32(i64_low((target).constantIntegerValue));\r\n }\r\n return this.module.global_get((target).internalName, NativeType.I32);\r\n }\r\n case ElementKind.FUNCTION_PROTOTYPE: {\r\n let instance = this.resolver.resolveFunction(\r\n target,\r\n null,\r\n makeMap(flow.contextualTypeArguments)\r\n );\r\n if (!(instance && this.compileFunction(instance))) return module.unreachable();\r\n let index = this.ensureFunctionTableEntry(instance);\r\n this.currentType = instance.signature.type;\r\n return this.module.i32(index);\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return this.module.unreachable();\r\n }\r\n\r\n compileInstanceOfExpression(\r\n expression: InstanceOfExpression,\r\n contextualType: Type,\r\n contextualFlags: ContextualFlags\r\n ): ExpressionRef {\r\n var module = this.module;\r\n // NOTE that this differs from TypeScript in that the rhs is a type, not an expression. at the\r\n // time of implementation, this seemed more useful because dynamic rhs expressions are not\r\n // possible in AS anyway. also note that the code generated below must preserve side-effects of\r\n // the LHS expression even when the result is a constant, i.e. return a block dropping `expr`.\r\n var expr = this.compileExpressionRetainType(expression.expression, this.options.usizeType);\r\n var actualType = this.currentType;\r\n var expectedType = this.resolver.resolveType(expression.isType, this.currentFlow.actualFunction);\r\n this.currentType = Type.bool;\r\n if (!expectedType) return module.unreachable();\r\n\r\n // instanceof - must be exact\r\n if (!expectedType.is(TypeFlags.REFERENCE)) {\r\n return module.block(null, [\r\n this.convertExpression(expr, actualType, Type.void, (contextualFlags & ContextualFlags.EXPLICIT) != 0, false, expression.expression),\r\n module.i32(actualType == expectedType ? 1 : 0)\r\n ], NativeType.I32);\r\n }\r\n\r\n // instanceof - always false\r\n if (!actualType.is(TypeFlags.REFERENCE)) {\r\n return module.block(null, [\r\n this.convertExpression(expr, actualType, Type.void, (contextualFlags & ContextualFlags.EXPLICIT) != 0,false, expression.expression),\r\n module.i32(0)\r\n ], NativeType.I32);\r\n }\r\n\r\n // both LHS and RHS are references now\r\n var nativeSizeType = actualType.toNativeType();\r\n\r\n // instanceof - LHS must be != 0\r\n if (actualType.is(TypeFlags.NULLABLE) && !expectedType.is(TypeFlags.NULLABLE)) {\r\n\r\n // downcast - check statically\r\n if (actualType.nonNullableType.isAssignableTo(expectedType)) {\r\n return module.binary(\r\n nativeSizeType == NativeType.I64\r\n ? BinaryOp.NeI64\r\n : BinaryOp.NeI32,\r\n expr,\r\n actualType.toNativeZero(module)\r\n );\r\n }\r\n\r\n // upcast - check dynamically\r\n if (expectedType.isAssignableTo(actualType)) {\r\n let program = this.program;\r\n if (!(actualType.isUnmanaged || expectedType.isUnmanaged)) {\r\n let flow = this.currentFlow;\r\n let tempLocal = flow.getAndFreeTempLocal(actualType);\r\n let instanceofInstance = assert(program.instanceofInstance);\r\n this.compileFunction(instanceofInstance);\r\n return module.if(\r\n module.unary(\r\n nativeSizeType == NativeType.I64\r\n ? UnaryOp.EqzI64\r\n : UnaryOp.EqzI32,\r\n module.local_tee(tempLocal.index, expr),\r\n ),\r\n module.i32(0),\r\n this.makeCallDirect(instanceofInstance, [\r\n module.local_get(tempLocal.index, nativeSizeType),\r\n module.i32(expectedType.classReference!.id)\r\n ], expression)\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n }\r\n }\r\n\r\n // either none or both nullable\r\n } else {\r\n\r\n // downcast - check statically\r\n if (actualType.isAssignableTo(expectedType)) {\r\n return module.block(null, [\r\n this.convertExpression(expr, actualType, Type.void, (contextualFlags & ContextualFlags.EXPLICIT) != 0, false, expression.expression),\r\n module.i32(1)\r\n ], NativeType.I32);\r\n\r\n // upcast - check dynamically\r\n } else if (expectedType.isAssignableTo(actualType)) {\r\n let program = this.program;\r\n if (!(actualType.isUnmanaged || expectedType.isUnmanaged)) {\r\n // FIXME: the temp local and the if can be removed here once flows\r\n // perform null checking, which would error earlier when checking\r\n // uninitialized (thus zero) `var a: A` to be an instance of something.\r\n let flow = this.currentFlow;\r\n let tempLocal = flow.getAndFreeTempLocal(actualType);\r\n let instanceofInstance = assert(program.instanceofInstance);\r\n this.compileFunction(instanceofInstance);\r\n return module.if(\r\n module.unary(\r\n nativeSizeType == NativeType.I64\r\n ? UnaryOp.EqzI64\r\n : UnaryOp.EqzI32,\r\n module.local_tee(tempLocal.index, expr),\r\n ),\r\n module.i32(0),\r\n this.makeCallDirect(instanceofInstance, [\r\n module.local_get(tempLocal.index, nativeSizeType),\r\n module.i32(expectedType.classReference!.id)\r\n ], expression)\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n }\r\n }\r\n }\r\n\r\n // false\r\n return module.block(null, [\r\n this.convertExpression(expr, actualType, Type.void, (contextualFlags & ContextualFlags.EXPLICIT) != 0, false, expression.expression),\r\n module.i32(0)\r\n ], NativeType.I32);\r\n }\r\n\r\n compileLiteralExpression(\r\n expression: LiteralExpression,\r\n contextualType: Type,\r\n contextualFlags: ContextualFlags,\r\n implicitlyNegate: bool = false\r\n ): ExpressionRef {\r\n var module = this.module;\r\n switch (expression.literalKind) {\r\n case LiteralKind.ARRAY: {\r\n assert(!implicitlyNegate);\r\n let classType = contextualType.classReference;\r\n if (classType) {\r\n if (classType.prototype == this.program.arrayPrototype) {\r\n return this.compileArrayLiteral(\r\n assert(classType.typeArguments)[0],\r\n (expression).elementExpressions,\r\n false, // TODO: isConst?\r\n contextualFlags,\r\n expression\r\n );\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return module.unreachable();\r\n }\r\n case LiteralKind.FLOAT: {\r\n let floatValue = (expression).value;\r\n if (implicitlyNegate) {\r\n floatValue = -floatValue;\r\n }\r\n if (contextualType == Type.f32) {\r\n return module.f32(floatValue);\r\n }\r\n this.currentType = Type.f64;\r\n return module.f64(floatValue);\r\n }\r\n case LiteralKind.INTEGER: {\r\n let intValue = (expression).value;\r\n if (implicitlyNegate) {\r\n intValue = i64_sub(\r\n i64_new(0),\r\n intValue\r\n );\r\n }\r\n let type = this.resolver.determineIntegerLiteralType(intValue, contextualType);\r\n this.currentType = type;\r\n switch (type.kind) {\r\n case TypeKind.ISIZE: if (!this.options.isWasm64) return module.i32(i64_low(intValue));\r\n case TypeKind.I64: return module.i64(i64_low(intValue), i64_high(intValue));\r\n case TypeKind.USIZE: if (!this.options.isWasm64) return module.i32(i64_low(intValue));\r\n case TypeKind.U64: return module.i64(i64_low(intValue), i64_high(intValue));\r\n case TypeKind.F32: return module.f32(i64_to_f32(intValue));\r\n case TypeKind.F64: return module.f64(i64_to_f64(intValue));\r\n default: return module.i32(i64_low(intValue));\r\n }\r\n }\r\n case LiteralKind.STRING: {\r\n assert(!implicitlyNegate);\r\n return this.compileStringLiteral(expression);\r\n }\r\n case LiteralKind.OBJECT: {\r\n assert(!implicitlyNegate);\r\n return this.compileObjectLiteral(expression, contextualType);\r\n }\r\n // case LiteralKind.REGEXP:\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n this.currentType = contextualType;\r\n return module.unreachable();\r\n }\r\n\r\n compileStringLiteral(expression: StringLiteralExpression): ExpressionRef {\r\n return this.ensureStaticString(expression.value);\r\n }\r\n\r\n compileArrayLiteral(\r\n elementType: Type,\r\n expressions: (Expression | null)[],\r\n isConst: bool,\r\n contextualFlags: ContextualFlags,\r\n reportNode: Node\r\n ): ExpressionRef {\r\n var module = this.module;\r\n var program = this.program;\r\n var arrayPrototype = assert(program.arrayPrototype);\r\n var arrayInstance = assert(this.resolver.resolveClass(arrayPrototype, [ elementType ]));\r\n var arrayBufferInstance = assert(program.arrayBufferInstance);\r\n var arrayType = arrayInstance.type;\r\n var flow = this.currentFlow;\r\n\r\n // block those here so compiling expressions doesn't conflict\r\n var tempThis = flow.getTempLocal(arrayType);\r\n var tempDataStart = flow.getTempLocal(arrayBufferInstance.type);\r\n\r\n // compile value expressions and find out whether all are constant\r\n var length = expressions.length;\r\n var values = new Array(length);\r\n var isStatic = true;\r\n var nativeElementType = elementType.toNativeType();\r\n for (let i = 0; i < length; ++i) {\r\n let expression = expressions[i];\r\n let expr = expression\r\n ? module.precomputeExpression(\r\n this.compileExpression(expression, elementType,\r\n ContextualFlags.IMPLICIT\r\n )\r\n )\r\n : elementType.toNativeZero(module);\r\n if (getExpressionId(expr) == ExpressionId.Const) {\r\n assert(getExpressionType(expr) == nativeElementType);\r\n } else {\r\n isStatic = false;\r\n }\r\n values[i] = expr;\r\n }\r\n\r\n // if the array is static, make a static arraybuffer segment\r\n if (isStatic) {\r\n flow.freeTempLocal(tempThis);\r\n flow.freeTempLocal(tempDataStart);\r\n\r\n let runtimeHeaderSize = program.runtimeHeaderSize;\r\n let bufferSegment = this.ensureStaticArrayBuffer(elementType, values);\r\n let bufferAddress = i64_add(bufferSegment.offset, i64_new(runtimeHeaderSize));\r\n\r\n // make both the buffer and array header static if assigned to a global. this can't be done\r\n // if inside of a function because each invocation must create a new array reference then.\r\n if (contextualFlags & ContextualFlags.STATIC_CAPABLE) {\r\n let arraySegment = this.ensureStaticArrayHeader(elementType, bufferSegment);\r\n let arrayAddress = i64_add(arraySegment.offset, i64_new(runtimeHeaderSize));\r\n this.currentType = arrayType;\r\n return program.options.isWasm64\r\n ? this.module.i64(i64_low(arrayAddress), i64_high(arrayAddress))\r\n : this.module.i32(i64_low(arrayAddress));\r\n\r\n // otherwise allocate a new array header and make it wrap a copy of the static buffer\r\n } else {\r\n // makeArray(length, alignLog2, classId, staticBuffer)\r\n let expr = this.makeCallDirect(program.allocArrayInstance, [\r\n module.i32(length),\r\n program.options.isWasm64\r\n ? module.i64(elementType.alignLog2)\r\n : module.i32(elementType.alignLog2),\r\n module.i32(arrayInstance.id),\r\n program.options.isWasm64\r\n ? module.i64(i64_low(bufferAddress), i64_high(bufferAddress))\r\n : module.i32(i64_low(bufferAddress))\r\n ], reportNode);\r\n this.currentType = arrayType;\r\n return this.makeAutorelease(this.makeRetain(expr));\r\n }\r\n }\r\n\r\n // otherwise compile an explicit instantiation with indexed sets\r\n var setter = arrayInstance.lookupOverload(OperatorKind.INDEXED_SET, true);\r\n if (!setter) {\r\n flow.freeTempLocal(tempThis);\r\n flow.freeTempLocal(tempDataStart);\r\n this.error(\r\n DiagnosticCode.Index_signature_in_type_0_only_permits_reading,\r\n reportNode.range, arrayInstance.internalName\r\n );\r\n this.currentType = arrayType;\r\n return module.unreachable();\r\n }\r\n var nativeArrayType = arrayType.toNativeType();\r\n\r\n var stmts = new Array();\r\n // tempThis = makeArray(length, alignLog2, classId, source = 0)\r\n stmts.push(\r\n module.local_set(tempThis.index,\r\n this.makeCallDirect(program.allocArrayInstance, [\r\n module.i32(length),\r\n program.options.isWasm64\r\n ? module.i64(elementType.alignLog2)\r\n : module.i32(elementType.alignLog2),\r\n module.i32(arrayInstance.id),\r\n program.options.isWasm64\r\n ? module.i64(0)\r\n : module.i32(0)\r\n ], reportNode),\r\n )\r\n );\r\n // tempData = tempThis.dataStart\r\n var dataStart = assert(arrayInstance.lookupInSelf(\"dataStart\"));\r\n assert(dataStart.kind == ElementKind.FIELD);\r\n stmts.push(\r\n module.local_set(tempDataStart.index,\r\n module.load(arrayType.byteSize, false,\r\n module.local_get(tempThis.index, nativeArrayType),\r\n nativeArrayType,\r\n (dataStart).memoryOffset\r\n )\r\n )\r\n );\r\n var isManaged = elementType.isManaged;\r\n for (let i = 0, alignLog2 = elementType.alignLog2; i < length; ++i) {\r\n let valueExpr = values[i];\r\n if (isManaged) {\r\n // value = __retain(value)\r\n valueExpr = this.makeRetain(valueExpr);\r\n }\r\n // store(tempData, value, immOffset)\r\n stmts.push(\r\n module.store(elementType.byteSize,\r\n module.local_get(tempDataStart.index, nativeArrayType),\r\n valueExpr,\r\n nativeElementType,\r\n i << alignLog2\r\n )\r\n );\r\n }\r\n // -> tempThis\r\n stmts.push(\r\n module.local_get(tempThis.index, nativeArrayType)\r\n );\r\n flow.freeTempLocal(tempThis);\r\n flow.freeTempLocal(tempDataStart);\r\n this.currentType = arrayType;\r\n return module.block(null, stmts, nativeArrayType);\r\n }\r\n\r\n compileObjectLiteral(expression: ObjectLiteralExpression, contextualType: Type): ExpressionRef {\r\n var module = this.module;\r\n\r\n // contextual type must be a class\r\n var classReference = contextualType.classReference;\r\n if (!classReference || classReference.is(CommonFlags.ABSTRACT)) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_assignable_to_type_1,\r\n expression.range, \"\", contextualType.toString()\r\n );\r\n return module.unreachable();\r\n }\r\n\r\n // if present, check that the constructor is compatible with object literals\r\n var ctor = classReference.constructorInstance;\r\n if (ctor) {\r\n // TODO: if the constructor requires parameters, check whether these are given as part of the\r\n // object literal and use them to call the ctor while not generating a store.\r\n if (ctor.signature.requiredParameters) {\r\n this.error(\r\n DiagnosticCode.Constructor_of_class_0_must_not_require_any_arguments,\r\n expression.range, classReference.toString()\r\n );\r\n return module.unreachable();\r\n }\r\n if (ctor.is(CommonFlags.PRIVATE)) {\r\n this.error(\r\n DiagnosticCode.Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration,\r\n expression.range, classReference.toString()\r\n );\r\n return module.unreachable();\r\n }\r\n if (ctor.is(CommonFlags.PROTECTED)) {\r\n this.error(\r\n DiagnosticCode.Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration,\r\n expression.range, classReference.toString()\r\n );\r\n return module.unreachable();\r\n }\r\n }\r\n\r\n // check and compile field values\r\n var names = expression.names;\r\n var numNames = names.length;\r\n var values = expression.values;\r\n var members = classReference.members;\r\n var hasErrors = false;\r\n var exprs = new Array(numNames + 2);\r\n var flow = this.currentFlow;\r\n var tempLocal = flow.getAutoreleaseLocal(this.options.usizeType);\r\n assert(numNames == values.length);\r\n for (let i = 0, k = numNames; i < k; ++i) {\r\n let member = members ? members.get(names[i].text) : null;\r\n if (!member || member.kind != ElementKind.FIELD) {\r\n this.error(\r\n DiagnosticCode.Property_0_does_not_exist_on_type_1,\r\n names[i].range, names[i].text, classReference.toString()\r\n );\r\n hasErrors = true;\r\n continue;\r\n }\r\n let type = (member).type;\r\n exprs[i + 1] = this.module.store( // TODO: handle setters as well\r\n type.byteSize,\r\n this.module.local_get(tempLocal.index, this.options.nativeSizeType),\r\n this.compileExpression(values[i], (member).type, ContextualFlags.IMPLICIT),\r\n type.toNativeType(),\r\n (member).memoryOffset\r\n );\r\n }\r\n this.currentType = classReference.type.nonNullableType;\r\n if (hasErrors) return module.unreachable();\r\n\r\n // allocate a new instance first and assign 'this' to the temp. local\r\n exprs[0] = module.local_set(\r\n tempLocal.index,\r\n this.makeRetain(\r\n this.makeAllocation(classReference)\r\n )\r\n );\r\n\r\n // once all field values have been set, return 'this'\r\n exprs[exprs.length - 1] = module.local_get(tempLocal.index, this.options.nativeSizeType);\r\n\r\n this.currentType = classReference.type;\r\n return module.block(null, exprs, this.options.nativeSizeType);\r\n }\r\n\r\n compileNewExpression(\r\n expression: NewExpression,\r\n contextualType: Type,\r\n contextualFlags: ContextualFlags\r\n ): ExpressionRef {\r\n var module = this.module;\r\n var flow = this.currentFlow;\r\n\r\n // obtain the class being instantiated\r\n var target = this.resolver.resolveExpression( // reports\r\n expression.expression,\r\n flow\r\n );\r\n if (!target) return module.unreachable();\r\n if (target.kind != ElementKind.CLASS_PROTOTYPE) {\r\n this.error(\r\n DiagnosticCode.Cannot_use_new_with_an_expression_whose_type_lacks_a_construct_signature,\r\n expression.expression.range\r\n );\r\n return this.module.unreachable();\r\n }\r\n var classPrototype = target;\r\n var classInstance: Class | null = null;\r\n var typeArguments = expression.typeArguments;\r\n var classReference: Class | null;\r\n if (\r\n !typeArguments &&\r\n (classReference = contextualType.classReference) !== null &&\r\n classReference.is(CommonFlags.GENERIC)\r\n ) {\r\n classInstance = this.resolver.resolveClass(\r\n classPrototype,\r\n classReference.typeArguments,\r\n makeMap(flow.contextualTypeArguments)\r\n );\r\n } else {\r\n classInstance = this.resolver.resolveClassInclTypeArguments(\r\n classPrototype,\r\n typeArguments,\r\n flow.actualFunction.parent, // relative to caller\r\n makeMap(flow.contextualTypeArguments),\r\n expression\r\n );\r\n }\r\n if (!classInstance) return module.unreachable();\r\n if (contextualType == Type.void) contextualFlags |= ContextualFlags.WILL_DROP;\r\n return this.compileInstantiate(classInstance, expression.arguments, contextualFlags, expression);\r\n }\r\n\r\n /** Gets the compiled constructor of the specified class or generates one if none is present. */\r\n ensureConstructor(classInstance: Class, reportNode: Node): Function {\r\n var instance = classInstance.constructorInstance;\r\n if (instance) {\r\n // do not attempt to compile it if inlined anyway\r\n if (!instance.hasDecorator(DecoratorFlags.INLINE)) this.compileFunction(instance);\r\n return instance;\r\n }\r\n\r\n // clone base constructor if a derived class\r\n var baseClass = classInstance.base;\r\n if (baseClass) {\r\n let baseCtor = this.ensureConstructor(baseClass, reportNode);\r\n instance = new Function(\r\n CommonSymbols.constructor,\r\n new FunctionPrototype(\r\n CommonSymbols.constructor,\r\n classInstance,\r\n // declaration is important, i.e. to access optional parameter initializers\r\n (baseCtor.declaration).clone()\r\n ),\r\n baseCtor.signature,\r\n null\r\n );\r\n\r\n // otherwise make a default constructor\r\n } else {\r\n instance = new Function(\r\n CommonSymbols.constructor,\r\n new FunctionPrototype(\r\n CommonSymbols.constructor,\r\n classInstance,\r\n this.program.makeNativeFunctionDeclaration(CommonSymbols.constructor,\r\n CommonFlags.INSTANCE | CommonFlags.CONSTRUCTOR\r\n )\r\n ),\r\n new Signature(null, classInstance.type, classInstance.type),\r\n null\r\n );\r\n }\r\n\r\n instance.internalName = classInstance.internalName + INSTANCE_DELIMITER + \"constructor\";\r\n instance.set(CommonFlags.COMPILED);\r\n instance.prototype.setResolvedInstance(\"\", instance);\r\n classInstance.constructorInstance = instance;\r\n var previousFlow = this.currentFlow;\r\n var flow = instance.flow;\r\n this.currentFlow = flow;\r\n\r\n // generate body\r\n var signature = instance.signature;\r\n var module = this.module;\r\n var nativeSizeType = this.options.nativeSizeType;\r\n var stmts = new Array();\r\n\r\n // {\r\n // if (!this) this = \r\n // IF_DERIVED: this = super(this, ...args)\r\n // this.a = X\r\n // this.b = Y\r\n // return this\r\n // }\r\n stmts.push(\r\n module.if(\r\n module.unary(nativeSizeType == NativeType.I64 ? UnaryOp.EqzI64 : UnaryOp.EqzI32,\r\n module.local_get(0, nativeSizeType)\r\n ),\r\n module.local_set(0,\r\n this.makeRetain(\r\n this.makeAllocation(classInstance)\r\n )\r\n )\r\n )\r\n );\r\n if (baseClass) {\r\n let parameterTypes = signature.parameterTypes;\r\n let numParameters = parameterTypes.length;\r\n let operands = new Array(1 + numParameters);\r\n operands[0] = module.local_get(0, nativeSizeType);\r\n for (let i = 0; i < numParameters; ++i) {\r\n operands[i + 1] = module.local_get(i + 1, parameterTypes[i].toNativeType());\r\n }\r\n // TODO: base constructor might be inlined, but makeCallDirect can't do this\r\n stmts.push(\r\n module.local_set(0,\r\n this.makeCallDirect(assert(baseClass.constructorInstance), operands, reportNode)\r\n )\r\n );\r\n }\r\n this.makeFieldInitialization(classInstance, stmts);\r\n var body = this.performAutoreleasesWithValue(flow, module.local_get(0, nativeSizeType), classInstance.type, stmts);\r\n flow.freeScopedLocals();\r\n this.currentFlow = previousFlow;\r\n\r\n // make the function\r\n var typeRef = this.ensureFunctionType(signature.parameterTypes, signature.returnType, signature.thisType);\r\n var locals = instance.localsByIndex;\r\n var varTypes = new Array(); // of temp. vars added while compiling initializers\r\n var numOperands = 1 + signature.parameterTypes.length;\r\n var numLocals = locals.length;\r\n if (numLocals > numOperands) {\r\n for (let i = numOperands; i < numLocals; ++i) varTypes.push(locals[i].type.toNativeType());\r\n }\r\n var funcRef = module.addFunction(instance.internalName, typeRef, varTypes, body);\r\n instance.finalize(module, funcRef);\r\n return instance;\r\n }\r\n\r\n compileInstantiate(\r\n /** Class to instantiate. */\r\n classInstance: Class,\r\n /** Constructor arguments. */\r\n argumentExpressions: Expression[],\r\n /** Contextual flags. */\r\n contextualFlags: ContextualFlags,\r\n /** Node to report on. */\r\n reportNode: Node\r\n ): ExpressionRef {\r\n var ctor = this.ensureConstructor(classInstance, reportNode);\r\n var expr = this.compileCallDirect( // no need for another autoreleased local\r\n ctor,\r\n argumentExpressions,\r\n reportNode,\r\n this.options.usizeType.toNativeZero(this.module),\r\n contextualFlags\r\n );\r\n if (getExpressionType(expr) != NativeType.None) { // possibly IMM_DROPPED\r\n this.currentType = classInstance.type; // important because a super ctor could be called\r\n }\r\n return expr;\r\n }\r\n\r\n /**\r\n * Compiles a property access in the specified context.\r\n * @param retainConstantType Retains the type of inlined constants if `true`, otherwise\r\n * precomputes them according to context.\r\n */\r\n compilePropertyAccessExpression(\r\n propertyAccess: PropertyAccessExpression,\r\n contextualType: Type,\r\n contextualFlags: ContextualFlags\r\n ): ExpressionRef {\r\n var module = this.module;\r\n var flow = this.currentFlow;\r\n\r\n this.maybeCompileEnclosingSource(propertyAccess);\r\n\r\n var target = this.resolver.resolvePropertyAccessExpression(propertyAccess, flow, contextualType); // reports\r\n if (!target) return module.unreachable();\r\n\r\n switch (target.kind) {\r\n case ElementKind.GLOBAL: { // static field\r\n if (!this.compileGlobal(target)) { // reports; not yet compiled if a static field\r\n return module.unreachable();\r\n }\r\n let globalType = (target).type;\r\n assert(globalType != Type.void);\r\n if ((target).is(CommonFlags.INLINED)) {\r\n return this.compileInlineConstant(target, contextualType, contextualFlags);\r\n }\r\n this.currentType = globalType;\r\n return module.global_get((target).internalName, globalType.toNativeType());\r\n }\r\n case ElementKind.ENUMVALUE: { // enum value\r\n let theEnum = assert((target).parent); assert(theEnum.kind == ElementKind.ENUM);\r\n if (!this.compileEnum(theEnum)) {\r\n this.currentType = Type.i32;\r\n return this.module.unreachable();\r\n }\r\n this.currentType = Type.i32;\r\n if ((target).is(CommonFlags.INLINED)) {\r\n assert((target).constantValueKind == ConstantValueKind.INTEGER);\r\n return module.i32(i64_low((target).constantIntegerValue));\r\n }\r\n return module.global_get((target).internalName, NativeType.I32);\r\n }\r\n case ElementKind.FIELD: { // instance field\r\n assert((target).memoryOffset >= 0);\r\n let thisExpr = this.compileExpressionRetainType(\r\n assert(this.resolver.currentThisExpression),\r\n this.options.usizeType\r\n );\r\n this.currentType = (target).type;\r\n return module.load(\r\n (target).type.byteSize,\r\n (target).type.is(TypeFlags.SIGNED | TypeFlags.INTEGER),\r\n thisExpr,\r\n (target).type.toNativeType(),\r\n (target).memoryOffset\r\n );\r\n }\r\n case ElementKind.PROPERTY_PROTOTYPE: {// static property\r\n let getterPrototype = (target).getterPrototype;\r\n if (getterPrototype) {\r\n let getter = this.resolver.resolveFunction(getterPrototype, null);\r\n if (getter) return this.compileCallDirect(getter, [], propertyAccess, 0);\r\n }\r\n return module.unreachable();\r\n }\r\n case ElementKind.PROPERTY: { // instance property\r\n let getterInstance = assert((target).getterInstance);\r\n return this.compileCallDirect(getterInstance, [], propertyAccess,\r\n this.compileExpressionRetainType(\r\n assert(this.resolver.currentThisExpression),\r\n this.options.usizeType\r\n )\r\n );\r\n }\r\n case ElementKind.FUNCTION_PROTOTYPE: {\r\n this.error(\r\n DiagnosticCode.Cannot_access_method_0_without_calling_it_as_it_requires_this_to_be_set,\r\n propertyAccess.range, (target).name\r\n );\r\n return module.unreachable();\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n propertyAccess.range\r\n );\r\n return module.unreachable();\r\n }\r\n\r\n compileTernaryExpression(\r\n expression: TernaryExpression,\r\n contextualType: Type,\r\n contextualFlags: ContextualFlags\r\n ): ExpressionRef {\r\n var ifThen = expression.ifThen;\r\n var ifElse = expression.ifElse;\r\n var outerFlow = this.currentFlow;\r\n\r\n var condExpr = this.module.precomputeExpression(\r\n this.makeIsTrueish(\r\n this.compileExpressionRetainType(expression.condition, Type.bool),\r\n this.currentType\r\n )\r\n );\r\n\r\n // Try to eliminate unnecesssary branches if the condition is constant\r\n if (\r\n getExpressionId(condExpr) == ExpressionId.Const &&\r\n getExpressionType(condExpr) == NativeType.I32\r\n ) {\r\n return getConstValueI32(condExpr)\r\n ? this.compileExpressionRetainType(ifThen, contextualType)\r\n : this.compileExpressionRetainType(ifElse, contextualType);\r\n }\r\n\r\n var ifThenFlow = outerFlow.fork();\r\n this.currentFlow = ifThenFlow;\r\n var ifThenExpr = this.compileExpressionRetainType(ifThen, contextualType, contextualFlags & ContextualFlags.SKIP_AUTORELEASE);\r\n var ifThenType = this.currentType;\r\n var IfThenAutoreleaseSkipped = this.skippedAutoreleases.has(ifThenExpr);\r\n\r\n var ifElseFlow = outerFlow.fork();\r\n this.currentFlow = ifElseFlow;\r\n var ifElseExpr = this.compileExpressionRetainType(ifElse, contextualType, contextualFlags & ContextualFlags.SKIP_AUTORELEASE);\r\n var ifElseType = this.currentType;\r\n var ifElseAutoreleaseSkipped = this.skippedAutoreleases.has(ifElseExpr);\r\n\r\n var commonType = Type.commonDenominator(ifThenType, ifElseType, false);\r\n if (!commonType) {\r\n this.error(\r\n DiagnosticCode.Type_0_is_not_assignable_to_type_1,\r\n ifElse.range, ifElseType.toString(), ifThenType.toString()\r\n );\r\n this.currentType = contextualType;\r\n return this.module.unreachable();\r\n }\r\n ifThenExpr = this.convertExpression(\r\n ifThenExpr,\r\n ifThenType, commonType,\r\n false, false,\r\n ifThen\r\n );\r\n ifElseExpr = this.convertExpression(\r\n ifElseExpr,\r\n ifElseType, commonType,\r\n false, false,\r\n ifElse\r\n );\r\n this.currentType = commonType;\r\n\r\n if (IfThenAutoreleaseSkipped != ifElseAutoreleaseSkipped) { // unify to both skipped\r\n if (!IfThenAutoreleaseSkipped) {\r\n ifThenExpr = this.makeRetain(ifThenExpr);\r\n IfThenAutoreleaseSkipped = true;\r\n } else {\r\n ifElseExpr = this.makeRetain(ifElseExpr);\r\n ifElseAutoreleaseSkipped = true;\r\n }\r\n } else if (!IfThenAutoreleaseSkipped && commonType.isManaged) { // keep alive a little longer\r\n // if (!(contextualFlags & ContextualFlags.SKIP_AUTORELEASE)) {\r\n ifThenExpr = this.moveAutorelease(ifThenExpr, ifThenFlow, outerFlow);\r\n ifElseExpr = this.moveAutorelease(ifElseExpr, ifElseFlow, outerFlow);\r\n // }\r\n }\r\n\r\n ifThenExpr = this.performAutoreleasesWithValue(ifThenFlow, ifThenExpr, commonType);\r\n ifThenFlow.freeScopedLocals();\r\n\r\n ifElseExpr = this.performAutoreleasesWithValue(ifElseFlow, ifElseExpr, commonType);\r\n ifElseFlow.freeScopedLocals();\r\n\r\n this.currentFlow = outerFlow;\r\n outerFlow.inheritMutual(ifThenFlow, ifElseFlow);\r\n\r\n var expr = this.module.if(condExpr, ifThenExpr, ifElseExpr);\r\n assert(IfThenAutoreleaseSkipped == ifElseAutoreleaseSkipped);\r\n if (IfThenAutoreleaseSkipped) this.skippedAutoreleases.add(expr);\r\n return expr;\r\n }\r\n\r\n compileUnaryPostfixExpression(\r\n expression: UnaryPostfixExpression,\r\n contextualType: Type,\r\n contextualFlags: ContextualFlags\r\n ): ExpressionRef {\r\n var module = this.module;\r\n var flow = this.currentFlow;\r\n\r\n // make a getter for the expression (also obtains the type)\r\n var getValue = this.compileExpression( // reports\r\n expression.operand,\r\n contextualType == Type.void\r\n ? Type.i32\r\n : contextualType,\r\n ContextualFlags.NONE\r\n );\r\n\r\n // shortcut if compiling the getter already failed\r\n if (getExpressionId(getValue) == ExpressionId.Unreachable) return getValue;\r\n\r\n // if the value isn't dropped, a temp. local is required to remember the original value\r\n var tempLocal: Local | null = null;\r\n if (contextualType != Type.void) {\r\n tempLocal = flow.getTempLocal(this.currentType);\r\n getValue = module.local_tee(\r\n tempLocal.index,\r\n getValue\r\n );\r\n }\r\n\r\n var expr: ExpressionRef;\r\n\r\n switch (expression.operator) {\r\n case Token.PLUS_PLUS: {\r\n switch (this.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: {\r\n expr = module.binary(\r\n BinaryOp.AddI32,\r\n getValue,\r\n module.i32(1)\r\n );\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = this.currentType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.POSTFIX_INC);\r\n if (overload) {\r\n expr = this.compileUnaryOverload(overload, expression.operand, getValue, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return module.unreachable();\r\n }\r\n }\r\n case TypeKind.ISIZE: {\r\n let options = this.options;\r\n expr = module.binary(\r\n options.isWasm64\r\n ? BinaryOp.AddI64\r\n : BinaryOp.AddI32,\r\n getValue,\r\n this.currentType.toNativeOne(module)\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.binary(\r\n BinaryOp.AddI64,\r\n getValue,\r\n module.i64(1)\r\n );\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n expr = module.binary(\r\n BinaryOp.AddF32,\r\n getValue,\r\n module.f32(1)\r\n );\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.binary(\r\n BinaryOp.AddF64,\r\n getValue,\r\n module.f64(1)\r\n );\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n return module.unreachable();\r\n }\r\n }\r\n break;\r\n }\r\n case Token.MINUS_MINUS: {\r\n switch (this.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: {\r\n expr = module.binary(\r\n BinaryOp.SubI32,\r\n getValue,\r\n module.i32(1)\r\n );\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = this.currentType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.POSTFIX_DEC);\r\n if (overload) {\r\n expr = this.compileUnaryOverload(overload, expression.operand, getValue, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return module.unreachable();\r\n }\r\n }\r\n case TypeKind.ISIZE: {\r\n let options = this.options;\r\n expr = module.binary(\r\n options.isWasm64\r\n ? BinaryOp.SubI64\r\n : BinaryOp.SubI32,\r\n getValue,\r\n this.currentType.toNativeOne(module)\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.binary(\r\n BinaryOp.SubI64,\r\n getValue,\r\n module.i64(1)\r\n );\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n expr = module.binary(\r\n BinaryOp.SubF32,\r\n getValue,\r\n module.f32(1)\r\n );\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.binary(\r\n BinaryOp.SubF64,\r\n getValue,\r\n module.f64(1)\r\n );\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n return module.unreachable();\r\n }\r\n }\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n return module.unreachable();\r\n }\r\n }\r\n\r\n var resolver = this.resolver;\r\n var target = resolver.resolveExpression(expression.operand, flow); // reports\r\n\r\n // simplify if dropped anyway\r\n if (!tempLocal) {\r\n this.currentType = Type.void;\r\n if (!target) return module.unreachable();\r\n return this.makeAssignment(\r\n target,\r\n expr,\r\n expression.operand,\r\n resolver.currentThisExpression,\r\n resolver.currentElementExpression,\r\n false\r\n );\r\n } else if (!target) {\r\n return module.unreachable();\r\n }\r\n\r\n // otherwise use the temp. local for the intermediate value (always possibly overflows)\r\n var setValue = this.makeAssignment(\r\n target,\r\n expr, // includes a tee of getValue to tempLocal\r\n expression.operand,\r\n resolver.currentThisExpression,\r\n resolver.currentElementExpression,\r\n false\r\n );\r\n\r\n this.currentType = tempLocal.type;\r\n flow.freeTempLocal(tempLocal);\r\n var nativeType = tempLocal.type.toNativeType();\r\n\r\n return module.block(null, [\r\n setValue,\r\n module.local_get(tempLocal.index, nativeType)\r\n ], nativeType); // result of 'x++' / 'x--' might overflow\r\n }\r\n\r\n compileUnaryPrefixExpression(\r\n expression: UnaryPrefixExpression,\r\n contextualType: Type,\r\n contextualFlags: ContextualFlags\r\n ): ExpressionRef {\r\n var module = this.module;\r\n var compound = false;\r\n var expr: ExpressionRef;\r\n\r\n switch (expression.operator) {\r\n case Token.PLUS: {\r\n expr = this.compileExpression(\r\n expression.operand,\r\n contextualType == Type.void\r\n ? Type.i32\r\n : contextualType,\r\n ContextualFlags.NONE\r\n );\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = this.currentType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.PLUS);\r\n if (overload) {\r\n expr = this.compileUnaryOverload(overload, expression.operand, expr, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return module.unreachable();\r\n }\r\n\r\n // nop\r\n break;\r\n }\r\n case Token.MINUS: {\r\n if (expression.operand.kind == NodeKind.LITERAL && (\r\n (expression.operand).literalKind == LiteralKind.INTEGER ||\r\n (expression.operand).literalKind == LiteralKind.FLOAT\r\n )) {\r\n // implicitly negate integer and float literals. also enables proper checking of literal ranges.\r\n expr = this.compileLiteralExpression(expression.operand, contextualType, ContextualFlags.NONE, true);\r\n // compileExpression normally does this:\r\n if (this.options.sourceMap) this.addDebugLocation(expr, expression.range);\r\n break;\r\n }\r\n\r\n expr = this.compileExpression(\r\n expression.operand,\r\n contextualType == Type.void\r\n ? Type.i32\r\n : contextualType,\r\n ContextualFlags.NONE\r\n );\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = this.currentType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.MINUS);\r\n if (overload) {\r\n expr = this.compileUnaryOverload(overload, expression.operand, expr, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return module.unreachable();\r\n }\r\n\r\n switch (this.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: {\r\n expr = module.binary(BinaryOp.SubI32, module.i32(0), expr);\r\n break;\r\n }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n expr = module.binary(\r\n this.options.isWasm64\r\n ? BinaryOp.SubI64\r\n : BinaryOp.SubI32,\r\n this.currentType.toNativeZero(module),\r\n expr\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.binary(BinaryOp.SubI64, module.i64(0), expr);\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n expr = module.unary(UnaryOp.NegF32, expr);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.unary(UnaryOp.NegF64, expr);\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.unreachable();\r\n }\r\n }\r\n break;\r\n }\r\n case Token.PLUS_PLUS: {\r\n compound = true;\r\n expr = this.compileExpression(\r\n expression.operand,\r\n contextualType == Type.void\r\n ? Type.i32\r\n : contextualType,\r\n ContextualFlags.NONE\r\n );\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = this.currentType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.PREFIX_INC);\r\n if (overload) {\r\n expr = this.compileUnaryOverload(overload, expression.operand, expr, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return module.unreachable();\r\n }\r\n\r\n switch (this.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: {\r\n expr = module.binary(BinaryOp.AddI32, expr, this.module.i32(1));\r\n break;\r\n }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n expr = module.binary(\r\n this.options.isWasm64\r\n ? BinaryOp.AddI64\r\n : BinaryOp.AddI32,\r\n expr,\r\n this.currentType.toNativeOne(module)\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.binary(BinaryOp.AddI64, expr, module.i64(1));\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n expr = module.binary(BinaryOp.AddF32, expr, module.f32(1));\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.binary(BinaryOp.AddF64, expr, module.f64(1));\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.unreachable();\r\n }\r\n }\r\n break;\r\n }\r\n case Token.MINUS_MINUS: {\r\n compound = true;\r\n expr = this.compileExpression(\r\n expression.operand,\r\n contextualType == Type.void\r\n ? Type.i32\r\n : contextualType,\r\n ContextualFlags.NONE\r\n );\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = this.currentType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.PREFIX_DEC);\r\n if (overload) {\r\n expr = this.compileUnaryOverload(overload, expression.operand, expr, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return module.unreachable();\r\n }\r\n\r\n switch (this.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: {\r\n expr = module.binary(BinaryOp.SubI32, expr, module.i32(1));\r\n break;\r\n }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n expr = module.binary(\r\n this.options.isWasm64\r\n ? BinaryOp.SubI64\r\n : BinaryOp.SubI32,\r\n expr,\r\n this.currentType.toNativeOne(module)\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.binary(BinaryOp.SubI64, expr, module.i64(1));\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n expr = module.binary(BinaryOp.SubF32, expr, module.f32(1));\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.binary(BinaryOp.SubF64, expr, module.f64(1));\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.unreachable();\r\n }\r\n }\r\n break;\r\n }\r\n case Token.EXCLAMATION: {\r\n expr = this.compileExpression(\r\n expression.operand,\r\n contextualType == Type.void\r\n ? Type.i32\r\n : contextualType,\r\n ContextualFlags.NONE\r\n );\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = this.currentType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.NOT);\r\n if (overload) {\r\n expr = this.compileUnaryOverload(overload, expression.operand, expr, expression);\r\n break;\r\n }\r\n }\r\n // allow '!' for references even without an overload\r\n }\r\n\r\n expr = this.makeIsFalseish(expr, this.currentType);\r\n this.currentType = Type.bool;\r\n break;\r\n }\r\n case Token.TILDE: {\r\n expr = this.compileExpression(\r\n expression.operand,\r\n contextualType == Type.void\r\n ? Type.i32\r\n : contextualType.is(TypeFlags.FLOAT)\r\n ? Type.i64\r\n : contextualType,\r\n ContextualFlags.NONE\r\n );\r\n\r\n // check operator overload\r\n if (this.currentType.is(TypeFlags.REFERENCE)) {\r\n let classReference = this.currentType.classReference;\r\n if (classReference) {\r\n let overload = classReference.lookupOverload(OperatorKind.BITWISE_NOT);\r\n if (overload) {\r\n expr = this.compileUnaryOverload(overload, expression.operand, expr, expression);\r\n break;\r\n }\r\n }\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return module.unreachable();\r\n } else {\r\n expr = this.convertExpression(expr,\r\n this.currentType, this.currentType.intType,\r\n false, false,\r\n expression.operand\r\n );\r\n }\r\n\r\n switch (this.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: {\r\n expr = module.binary(BinaryOp.XorI32, expr, module.i32(-1));\r\n break;\r\n }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n expr = module.binary(\r\n this.options.isWasm64\r\n ? BinaryOp.XorI64\r\n : BinaryOp.XorI32,\r\n expr,\r\n this.currentType.toNativeNegOne(module)\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.binary(BinaryOp.XorI64, expr, module.i64(-1, -1));\r\n break;\r\n }\r\n default: {\r\n assert(false);\r\n expr = module.unreachable();\r\n }\r\n }\r\n break;\r\n }\r\n case Token.TYPEOF: {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n expression.range\r\n );\r\n return module.unreachable();\r\n }\r\n default: {\r\n assert(false);\r\n return module.unreachable();\r\n }\r\n }\r\n if (!compound) return expr;\r\n var resolver = this.resolver;\r\n var target = resolver.resolveExpression(expression.operand, this.currentFlow);\r\n if (!target) return module.unreachable();\r\n return this.makeAssignment(\r\n target,\r\n expr,\r\n expression.operand,\r\n resolver.currentThisExpression,\r\n resolver.currentElementExpression,\r\n contextualType != Type.void\r\n );\r\n }\r\n\r\n /** Makes sure that a 32-bit integer value is wrapped to a valid value of the specified type. */\r\n ensureSmallIntegerWrap(expr: ExpressionRef, type: Type): ExpressionRef {\r\n var module = this.module;\r\n var flow = this.currentFlow;\r\n switch (type.kind) {\r\n case TypeKind.I8: {\r\n if (flow.canOverflow(expr, type)) {\r\n expr = this.options.hasFeature(Feature.SIGN_EXTENSION)\r\n ? module.unary(UnaryOp.ExtendI8ToI32, expr)\r\n : module.binary(BinaryOp.ShrI32,\r\n module.binary(BinaryOp.ShlI32,\r\n expr,\r\n module.i32(24)\r\n ),\r\n module.i32(24)\r\n );\r\n }\r\n break;\r\n }\r\n case TypeKind.I16: {\r\n if (flow.canOverflow(expr, type)) {\r\n expr = this.options.hasFeature(Feature.SIGN_EXTENSION)\r\n ? module.unary(UnaryOp.ExtendI16ToI32, expr)\r\n : module.binary(BinaryOp.ShrI32,\r\n module.binary(BinaryOp.ShlI32,\r\n expr,\r\n module.i32(16)\r\n ),\r\n module.i32(16)\r\n );\r\n }\r\n break;\r\n }\r\n case TypeKind.U8: {\r\n if (flow.canOverflow(expr, type)) {\r\n expr = module.binary(BinaryOp.AndI32,\r\n expr,\r\n module.i32(0xff)\r\n );\r\n }\r\n break;\r\n }\r\n case TypeKind.U16: {\r\n if (flow.canOverflow(expr, type)) {\r\n expr = module.binary(BinaryOp.AndI32,\r\n expr,\r\n module.i32(0xffff)\r\n );\r\n }\r\n break;\r\n }\r\n case TypeKind.BOOL: {\r\n if (flow.canOverflow(expr, type)) {\r\n // bool is special in that it compares to 0 instead of masking with 0x1\r\n expr = module.binary(BinaryOp.NeI32,\r\n expr,\r\n module.i32(0)\r\n );\r\n }\r\n break;\r\n }\r\n }\r\n return expr;\r\n }\r\n\r\n /** Adds the debug location of the specified expression at the specified range to the source map. */\r\n addDebugLocation(expr: ExpressionRef, range: Range): void {\r\n var parentFunction = this.currentFlow.parentFunction;\r\n var source = range.source;\r\n if (source.debugInfoIndex < 0) source.debugInfoIndex = this.module.addDebugInfoFile(source.normalizedPath);\r\n range.debugInfoRef = expr;\r\n parentFunction.debugLocations.push(range);\r\n }\r\n\r\n // === Specialized code generation ==============================================================\r\n\r\n /** Creates a comparison whether an expression is 'false' in a broader sense. */\r\n makeIsFalseish(expr: ExpressionRef, type: Type): ExpressionRef {\r\n var module = this.module;\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.BOOL: {\r\n expr = this.ensureSmallIntegerWrap(expr, type);\r\n // fall-through\r\n }\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n return module.unary(UnaryOp.EqzI32, expr);\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n return module.unary(UnaryOp.EqzI64, expr);\r\n }\r\n case TypeKind.USIZE: if (this.skippedAutoreleases.has(expr)) expr = this.makeAutorelease(expr);\r\n case TypeKind.ISIZE: {\r\n return module.unary(type.size == 64 ? UnaryOp.EqzI64 : UnaryOp.EqzI32, expr);\r\n }\r\n case TypeKind.F32: {\r\n return module.binary(BinaryOp.EqF32, expr, module.f32(0));\r\n }\r\n case TypeKind.F64: {\r\n return module.binary(BinaryOp.EqF64, expr, module.f64(0));\r\n }\r\n default: {\r\n assert(false);\r\n return module.i32(1);\r\n }\r\n }\r\n }\r\n\r\n /** Creates a comparison whether an expression is 'true' in a broader sense. */\r\n makeIsTrueish(expr: ExpressionRef, type: Type): ExpressionRef {\r\n var module = this.module;\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.U8:\r\n case TypeKind.U16: {\r\n expr = this.ensureSmallIntegerWrap(expr, type);\r\n // fall-through\r\n }\r\n case TypeKind.BOOL: // not a mask, just != 0\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n return expr;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n return module.binary(BinaryOp.NeI64, expr, module.i64(0));\r\n }\r\n case TypeKind.USIZE: if (this.skippedAutoreleases.has(expr)) expr = this.makeAutorelease(expr);\r\n case TypeKind.ISIZE: {\r\n return type.size == 64\r\n ? module.binary(BinaryOp.NeI64, expr, module.i64(0))\r\n : expr;\r\n }\r\n case TypeKind.F32: {\r\n return module.binary(BinaryOp.NeF32, expr, module.f32(0));\r\n }\r\n case TypeKind.F64: {\r\n return module.binary(BinaryOp.NeF64, expr, module.f64(0));\r\n }\r\n default: {\r\n assert(false);\r\n return module.i32(0);\r\n }\r\n }\r\n }\r\n\r\n /** Makes an allocation suitable to hold the data of an instance of the given class. */\r\n makeAllocation(\r\n classInstance: Class\r\n ): ExpressionRef {\r\n // TODO: investigate if it's possible to allocate with RC=1 immediately\r\n var program = this.program;\r\n assert(classInstance.program == program);\r\n var module = this.module;\r\n var options = this.options;\r\n this.currentType = classInstance.type;\r\n var allocInstance = program.allocInstance;\r\n this.compileFunction(allocInstance);\r\n return module.call(allocInstance.internalName, [\r\n options.isWasm64\r\n ? module.i64(classInstance.currentMemoryOffset)\r\n : module.i32(classInstance.currentMemoryOffset),\r\n module.i32(\r\n classInstance.hasDecorator(DecoratorFlags.UNMANAGED)\r\n ? 0\r\n : classInstance.id\r\n )\r\n ], options.nativeSizeType);\r\n }\r\n\r\n /** Makes the initializers for a class's fields. */\r\n makeFieldInitialization(\r\n classInstance: Class,\r\n stmts: ExpressionRef[] = []\r\n ): ExpressionRef[] {\r\n var members = classInstance.members;\r\n if (!members) return [];\r\n\r\n var module = this.module;\r\n var flow = this.currentFlow;\r\n var isInline = flow.is(FlowFlags.INLINE_CONTEXT);\r\n var thisLocalIndex = isInline\r\n ? assert(flow.lookupLocal(CommonSymbols.this_)).index\r\n : 0;\r\n var nativeSizeType = this.options.nativeSizeType;\r\n\r\n for (let member of members.values()) {\r\n if (\r\n member.kind != ElementKind.FIELD || // not a field\r\n member.parent != classInstance // inherited field\r\n ) continue;\r\n\r\n let field = member; assert(!field.isAny(CommonFlags.CONST));\r\n let fieldType = field.type;\r\n let nativeFieldType = fieldType.toNativeType();\r\n let initializerNode = field.prototype.initializerNode;\r\n if (initializerNode) { // use initializer\r\n let initExpr = this.compileExpression(initializerNode, fieldType, // reports\r\n ContextualFlags.IMPLICIT | ContextualFlags.SKIP_AUTORELEASE\r\n );\r\n if (fieldType.isManaged && !this.skippedAutoreleases.has(initExpr)) {\r\n initExpr = this.makeRetain(initExpr);\r\n }\r\n stmts.push(\r\n module.store(fieldType.byteSize,\r\n module.local_get(thisLocalIndex, nativeSizeType),\r\n initExpr,\r\n nativeFieldType,\r\n field.memoryOffset\r\n )\r\n );\r\n } else {\r\n let parameterIndex = field.prototype.parameterIndex;\r\n stmts.push(\r\n module.store(fieldType.byteSize,\r\n module.local_get(thisLocalIndex, nativeSizeType),\r\n parameterIndex >= 0 // initialized via parameter (here: a local)\r\n ? module.local_get(\r\n isInline\r\n ? assert(flow.lookupLocal(field.name)).index\r\n : 1 + parameterIndex, // this is local 0\r\n nativeFieldType\r\n )\r\n : fieldType.toNativeZero(module),\r\n nativeFieldType,\r\n field.memoryOffset\r\n )\r\n );\r\n }\r\n }\r\n return stmts;\r\n }\r\n\r\n makeInstanceOfClass(\r\n expr: ExpressionRef,\r\n classInstance: Class\r\n ): ExpressionRef {\r\n var module = this.module;\r\n var flow = this.currentFlow;\r\n var idTemp = flow.getTempLocal(Type.i32);\r\n var idExpr = module.load(4, false,\r\n module.binary(BinaryOp.SubI32,\r\n expr,\r\n module.i32(this.program.runtimeHeaderSize)\r\n ),\r\n NativeType.I32\r\n );\r\n var label = \"instanceof_\" + classInstance.name + \"|\" + flow.pushBreakLabel();\r\n var conditions: ExpressionRef[] = [];\r\n conditions.push(\r\n module.drop( // br_if returns the value too\r\n module.br(label,\r\n module.binary(BinaryOp.EqI32, // classId == class.id\r\n module.local_tee(idTemp.index, idExpr),\r\n module.i32(classInstance.id)\r\n ),\r\n module.i32(1) // ? true\r\n )\r\n )\r\n );\r\n // TODO: insert conditions for all possible subclasses (i.e. cat is also animal)\r\n // TODO: simplify if there are none\r\n conditions.push(\r\n module.i32(0) // : false\r\n );\r\n flow.freeTempLocal(idTemp);\r\n flow.popBreakLabel();\r\n return module.block(label, conditions, NativeType.I32);\r\n }\r\n}\r\n\r\n// helpers\r\n\r\nfunction mangleImportName(\r\n element: Element,\r\n declaration: DeclarationStatement\r\n): void {\r\n // by default, use the file name as the module name\r\n mangleImportName_moduleName = declaration.range.source.simplePath;\r\n // and the internal name of the element within that file as the element name\r\n mangleImportName_elementName = mangleInternalName(\r\n element.name, element.parent, element.is(CommonFlags.INSTANCE), true\r\n );\r\n if (!element.hasDecorator(DecoratorFlags.EXTERNAL)) return;\r\n\r\n var program = element.program;\r\n var decorator = assert(findDecorator(DecoratorKind.EXTERNAL, declaration.decorators));\r\n var args = decorator.arguments;\r\n if (args && args.length) {\r\n let arg = args[0];\r\n // if one argument is given, override just the element name\r\n // if two arguments are given, override both module and element name\r\n if (arg.kind == NodeKind.LITERAL && (arg).literalKind == LiteralKind.STRING) {\r\n mangleImportName_elementName = (arg).value;\r\n if (args.length >= 2) {\r\n arg = args[1];\r\n if (arg.kind == NodeKind.LITERAL && (arg).literalKind == LiteralKind.STRING) {\r\n mangleImportName_moduleName = mangleImportName_elementName;\r\n mangleImportName_elementName = (arg).value;\r\n if (args.length > 2) {\r\n program.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n decorator.range, \"2\", args.length.toString()\r\n );\r\n }\r\n } else {\r\n program.error(\r\n DiagnosticCode.String_literal_expected,\r\n arg.range\r\n );\r\n }\r\n }\r\n } else {\r\n program.error(\r\n DiagnosticCode.String_literal_expected,\r\n arg.range\r\n );\r\n }\r\n } else {\r\n program.error(\r\n DiagnosticCode.Expected_at_least_0_arguments_but_got_1,\r\n decorator.range, \"1\", \"0\"\r\n );\r\n }\r\n}\r\n\r\nvar mangleImportName_moduleName: string;\r\nvar mangleImportName_elementName: string;\r\n\r\n/** Flattens a series of expressions to a nop, a single statement or a block depending on statement count. */\r\nexport function flatten(module: Module, stmts: ExpressionRef[], type: NativeType): ExpressionRef {\r\n var length = stmts.length;\r\n if (length == 0) return module.nop(); // usually filtered out again\r\n if (length == 1) return stmts[0];\r\n return module.block(null, stmts,\r\n type == NativeType.Auto\r\n ? getExpressionType(stmts[length - 1])\r\n : type\r\n );\r\n}\r\n","/**\n * Generated from diagnosticsMessages.json. Do not edit.\n * @module diagnostics\n *//***/\n\n/* tslint:disable:max-line-length */\n\n/** Enum of available diagnostic codes. */\nexport enum DiagnosticCode {\n Operation_not_supported = 100,\n Operation_is_unsafe = 101,\n User_defined_0 = 102,\n Conversion_from_type_0_to_1_requires_an_explicit_cast = 200,\n Conversion_from_type_0_to_1_will_require_an_explicit_cast_when_switching_between_32_64_bit = 201,\n Type_0_cannot_be_changed_to_type_1 = 202,\n Type_0_cannot_be_reinterpreted_as_type_1 = 203,\n Basic_type_0_cannot_be_nullable = 204,\n Cannot_export_a_mutable_global = 205,\n Mutable_value_cannot_be_inlined = 206,\n Unmanaged_classes_cannot_extend_managed_classes_and_vice_versa = 207,\n Unmanaged_classes_cannot_implement_interfaces = 208,\n Invalid_regular_expression_flags = 209,\n Implementation_0_must_match_the_signature_1 = 210,\n Class_0_is_sealed_and_cannot_be_extended = 211,\n Decorator_0_is_not_valid_here = 212,\n Duplicate_decorator = 213,\n An_allocator_must_be_present_to_use_0 = 214,\n Optional_parameter_must_have_an_initializer = 215,\n Constructor_of_class_0_must_not_require_any_arguments = 216,\n Function_0_cannot_be_inlined_into_itself = 217,\n Cannot_access_method_0_without_calling_it_as_it_requires_this_to_be_set = 218,\n Optional_properties_are_not_supported = 219,\n Expression_must_be_a_compile_time_constant = 220,\n Module_cannot_have_multiple_start_functions = 221,\n _0_must_be_a_value_between_1_and_2_inclusive = 222,\n _0_must_be_a_power_of_two = 223,\n TODO_Cannot_inline_inferred_calls_and_specific_internals_yet = 224,\n Expression_is_never_null = 225,\n Unterminated_string_literal = 1002,\n Identifier_expected = 1003,\n _0_expected = 1005,\n A_file_cannot_have_a_reference_to_itself = 1006,\n Trailing_comma_not_allowed = 1009,\n Unexpected_token = 1012,\n A_rest_parameter_must_be_last_in_a_parameter_list = 1014,\n Parameter_cannot_have_question_mark_and_initializer = 1015,\n A_required_parameter_cannot_follow_an_optional_parameter = 1016,\n Statements_are_not_allowed_in_ambient_contexts = 1036,\n Initializers_are_not_allowed_in_ambient_contexts = 1039,\n _0_modifier_cannot_be_used_here = 1042,\n A_rest_parameter_cannot_be_optional = 1047,\n A_rest_parameter_cannot_have_an_initializer = 1048,\n A_set_accessor_must_have_exactly_one_parameter = 1049,\n A_set_accessor_parameter_cannot_have_an_initializer = 1052,\n A_get_accessor_cannot_have_parameters = 1054,\n Enum_member_must_have_initializer = 1061,\n Type_parameters_cannot_appear_on_a_constructor_declaration = 1092,\n Type_annotation_cannot_appear_on_a_constructor_declaration = 1093,\n An_accessor_cannot_have_type_parameters = 1094,\n A_set_accessor_cannot_have_a_return_type_annotation = 1095,\n Type_parameter_list_cannot_be_empty = 1098,\n A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement = 1104,\n A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement = 1105,\n A_return_statement_can_only_be_used_within_a_function_body = 1108,\n Expression_expected = 1109,\n Type_expected = 1110,\n A_default_clause_cannot_appear_more_than_once_in_a_switch_statement = 1113,\n Duplicate_label_0 = 1114,\n An_export_assignment_cannot_have_modifiers = 1120,\n Octal_literals_are_not_allowed_in_strict_mode = 1121,\n Digit_expected = 1124,\n Hexadecimal_digit_expected = 1125,\n Unexpected_end_of_text = 1126,\n Invalid_character = 1127,\n _case_or_default_expected = 1130,\n _super_must_be_followed_by_an_argument_list_or_member_access = 1034,\n A_declare_modifier_cannot_be_used_in_an_already_ambient_context = 1038,\n Type_argument_expected = 1140,\n String_literal_expected = 1141,\n Line_break_not_permitted_here = 1142,\n Declaration_expected = 1146,\n _const_declarations_must_be_initialized = 1155,\n Unterminated_regular_expression_literal = 1161,\n Interface_declaration_cannot_have_implements_clause = 1176,\n Binary_digit_expected = 1177,\n Octal_digit_expected = 1178,\n An_implementation_cannot_be_declared_in_ambient_contexts = 1183,\n An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive = 1198,\n Unterminated_Unicode_escape_sequence = 1199,\n Decorators_are_not_valid_here = 1206,\n _abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration = 1242,\n Method_0_cannot_have_an_implementation_because_it_is_marked_abstract = 1245,\n A_definite_assignment_assertion_is_not_permitted_in_this_context = 1255,\n A_class_may_only_extend_another_class = 1311,\n A_parameter_property_cannot_be_declared_using_a_rest_parameter = 1317,\n Duplicate_identifier_0 = 2300,\n Cannot_find_name_0 = 2304,\n Module_0_has_no_exported_member_1 = 2305,\n Generic_type_0_requires_1_type_argument_s = 2314,\n Type_0_is_not_generic = 2315,\n Type_0_is_not_assignable_to_type_1 = 2322,\n Index_signature_is_missing_in_type_0 = 2329,\n _this_cannot_be_referenced_in_current_location = 2332,\n _super_can_only_be_referenced_in_a_derived_class = 2335,\n Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors = 2337,\n Property_0_does_not_exist_on_type_1 = 2339,\n Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures = 2349,\n Cannot_use_new_with_an_expression_whose_type_lacks_a_construct_signature = 2351,\n A_function_whose_declared_type_is_not_void_must_return_a_value = 2355,\n The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access = 2357,\n The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access = 2364,\n Operator_0_cannot_be_applied_to_types_1_and_2 = 2365,\n A_super_call_must_be_the_first_statement_in_the_constructor = 2376,\n Constructors_for_derived_classes_must_contain_a_super_call = 2377,\n _get_and_set_accessor_must_have_the_same_type = 2380,\n Constructor_implementation_is_missing = 2390,\n Function_implementation_is_missing_or_not_immediately_following_the_declaration = 2391,\n Multiple_constructor_implementations_are_not_allowed = 2392,\n Duplicate_function_implementation = 2393,\n Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local = 2395,\n A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged = 2434,\n Type_0_has_no_property_1 = 2460,\n The_0_operator_cannot_be_applied_to_type_1 = 2469,\n In_const_enum_declarations_member_initializer_must_be_constant_expression = 2474,\n Export_declaration_conflicts_with_exported_declaration_of_0 = 2484,\n Object_is_possibly_null = 2531,\n Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property = 2540,\n The_target_of_an_assignment_must_be_a_variable_or_a_property_access = 2541,\n Index_signature_in_type_0_only_permits_reading = 2542,\n Expected_0_arguments_but_got_1 = 2554,\n Expected_at_least_0_arguments_but_got_1 = 2555,\n Expected_0_type_arguments_but_got_1 = 2558,\n A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums = 2651,\n Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration = 2673,\n Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration = 2674,\n Namespace_0_has_no_exported_member_1 = 2694,\n Required_type_parameters_may_not_follow_optional_type_parameters = 2706,\n Duplicate_property_0 = 2718,\n File_0_not_found = 6054,\n Numeric_separators_are_not_allowed_here = 6188,\n Multiple_consecutive_numeric_separators_are_not_permitted = 6189,\n _super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class = 17009,\n _super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class = 17011\n}\n\n/** Translates a diagnostic code to its respective string. */\nexport function diagnosticCodeToString(code: DiagnosticCode): string {\n switch (code) {\n case 100: return \"Operation not supported.\";\n case 101: return \"Operation is unsafe.\";\n case 102: return \"User-defined: {0}\";\n case 200: return \"Conversion from type '{0}' to '{1}' requires an explicit cast.\";\n case 201: return \"Conversion from type '{0}' to '{1}' will require an explicit cast when switching between 32/64-bit.\";\n case 202: return \"Type '{0}' cannot be changed to type '{1}'.\";\n case 203: return \"Type '{0}' cannot be reinterpreted as type '{1}'.\";\n case 204: return \"Basic type '{0}' cannot be nullable.\";\n case 205: return \"Cannot export a mutable global.\";\n case 206: return \"Mutable value cannot be inlined.\";\n case 207: return \"Unmanaged classes cannot extend managed classes and vice-versa.\";\n case 208: return \"Unmanaged classes cannot implement interfaces.\";\n case 209: return \"Invalid regular expression flags.\";\n case 210: return \"Implementation '{0}' must match the signature '{1}'.\";\n case 211: return \"Class '{0}' is sealed and cannot be extended.\";\n case 212: return \"Decorator '{0}' is not valid here.\";\n case 213: return \"Duplicate decorator.\";\n case 214: return \"An allocator must be present to use '{0}'.\";\n case 215: return \"Optional parameter must have an initializer.\";\n case 216: return \"Constructor of class '{0}' must not require any arguments.\";\n case 217: return \"Function '{0}' cannot be inlined into itself.\";\n case 218: return \"Cannot access method '{0}' without calling it as it requires 'this' to be set.\";\n case 219: return \"Optional properties are not supported.\";\n case 220: return \"Expression must be a compile-time constant.\";\n case 221: return \"Module cannot have multiple start functions.\";\n case 222: return \"'{0}' must be a value between '{1}' and '{2}' inclusive.\";\n case 223: return \"'{0}' must be a power of two.\";\n case 224: return \"TODO: Cannot inline inferred calls and specific internals yet.\";\n case 225: return \"Expression is never 'null'.\";\n case 1002: return \"Unterminated string literal.\";\n case 1003: return \"Identifier expected.\";\n case 1005: return \"'{0}' expected.\";\n case 1006: return \"A file cannot have a reference to itself.\";\n case 1009: return \"Trailing comma not allowed.\";\n case 1012: return \"Unexpected token.\";\n case 1014: return \"A rest parameter must be last in a parameter list.\";\n case 1015: return \"Parameter cannot have question mark and initializer.\";\n case 1016: return \"A required parameter cannot follow an optional parameter.\";\n case 1036: return \"Statements are not allowed in ambient contexts.\";\n case 1039: return \"Initializers are not allowed in ambient contexts.\";\n case 1042: return \"'{0}' modifier cannot be used here.\";\n case 1047: return \"A rest parameter cannot be optional.\";\n case 1048: return \"A rest parameter cannot have an initializer.\";\n case 1049: return \"A 'set' accessor must have exactly one parameter.\";\n case 1052: return \"A 'set' accessor parameter cannot have an initializer.\";\n case 1054: return \"A 'get' accessor cannot have parameters.\";\n case 1061: return \"Enum member must have initializer.\";\n case 1092: return \"Type parameters cannot appear on a constructor declaration.\";\n case 1093: return \"Type annotation cannot appear on a constructor declaration.\";\n case 1094: return \"An accessor cannot have type parameters.\";\n case 1095: return \"A 'set' accessor cannot have a return type annotation.\";\n case 1098: return \"Type parameter list cannot be empty.\";\n case 1104: return \"A 'continue' statement can only be used within an enclosing iteration statement.\";\n case 1105: return \"A 'break' statement can only be used within an enclosing iteration or switch statement.\";\n case 1108: return \"A 'return' statement can only be used within a function body.\";\n case 1109: return \"Expression expected.\";\n case 1110: return \"Type expected.\";\n case 1113: return \"A 'default' clause cannot appear more than once in a 'switch' statement.\";\n case 1114: return \"Duplicate label '{0}'.\";\n case 1120: return \"An export assignment cannot have modifiers.\";\n case 1121: return \"Octal literals are not allowed in strict mode.\";\n case 1124: return \"Digit expected.\";\n case 1125: return \"Hexadecimal digit expected.\";\n case 1126: return \"Unexpected end of text.\";\n case 1127: return \"Invalid character.\";\n case 1130: return \"'case' or 'default' expected.\";\n case 1034: return \"'super' must be followed by an argument list or member access.\";\n case 1038: return \"A 'declare' modifier cannot be used in an already ambient context.\";\n case 1140: return \"Type argument expected.\";\n case 1141: return \"String literal expected.\";\n case 1142: return \"Line break not permitted here.\";\n case 1146: return \"Declaration expected.\";\n case 1155: return \"'const' declarations must be initialized.\";\n case 1161: return \"Unterminated regular expression literal.\";\n case 1176: return \"Interface declaration cannot have 'implements' clause.\";\n case 1177: return \"Binary digit expected.\";\n case 1178: return \"Octal digit expected.\";\n case 1183: return \"An implementation cannot be declared in ambient contexts.\";\n case 1198: return \"An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.\";\n case 1199: return \"Unterminated Unicode escape sequence.\";\n case 1206: return \"Decorators are not valid here.\";\n case 1242: return \"'abstract' modifier can only appear on a class, method, or property declaration.\";\n case 1245: return \"Method '{0}' cannot have an implementation because it is marked abstract.\";\n case 1255: return \"A definite assignment assertion '!' is not permitted in this context.\";\n case 1311: return \"A class may only extend another class.\";\n case 1317: return \"A parameter property cannot be declared using a rest parameter.\";\n case 2300: return \"Duplicate identifier '{0}'.\";\n case 2304: return \"Cannot find name '{0}'.\";\n case 2305: return \"Module '{0}' has no exported member '{1}'.\";\n case 2314: return \"Generic type '{0}' requires {1} type argument(s).\";\n case 2315: return \"Type '{0}' is not generic.\";\n case 2322: return \"Type '{0}' is not assignable to type '{1}'.\";\n case 2329: return \"Index signature is missing in type '{0}'.\";\n case 2332: return \"'this' cannot be referenced in current location.\";\n case 2335: return \"'super' can only be referenced in a derived class.\";\n case 2337: return \"Super calls are not permitted outside constructors or in nested functions inside constructors.\";\n case 2339: return \"Property '{0}' does not exist on type '{1}'.\";\n case 2349: return \"Cannot invoke an expression whose type lacks a call signature. Type '{0}' has no compatible call signatures.\";\n case 2351: return \"Cannot use 'new' with an expression whose type lacks a construct signature.\";\n case 2355: return \"A function whose declared type is not 'void' must return a value.\";\n case 2357: return \"The operand of an increment or decrement operator must be a variable or a property access.\";\n case 2364: return \"The left-hand side of an assignment expression must be a variable or a property access.\";\n case 2365: return \"Operator '{0}' cannot be applied to types '{1}' and '{2}'.\";\n case 2376: return \"A 'super' call must be the first statement in the constructor.\";\n case 2377: return \"Constructors for derived classes must contain a 'super' call.\";\n case 2380: return \"'get' and 'set' accessor must have the same type.\";\n case 2390: return \"Constructor implementation is missing.\";\n case 2391: return \"Function implementation is missing or not immediately following the declaration.\";\n case 2392: return \"Multiple constructor implementations are not allowed.\";\n case 2393: return \"Duplicate function implementation.\";\n case 2395: return \"Individual declarations in merged declaration '{0}' must be all exported or all local.\";\n case 2434: return \"A namespace declaration cannot be located prior to a class or function with which it is merged.\";\n case 2460: return \"Type '{0}' has no property '{1}'.\";\n case 2469: return \"The '{0}' operator cannot be applied to type '{1}'.\";\n case 2474: return \"In 'const' enum declarations member initializer must be constant expression.\";\n case 2484: return \"Export declaration conflicts with exported declaration of '{0}'.\";\n case 2531: return \"Object is possibly 'null'.\";\n case 2540: return \"Cannot assign to '{0}' because it is a constant or a read-only property.\";\n case 2541: return \"The target of an assignment must be a variable or a property access.\";\n case 2542: return \"Index signature in type '{0}' only permits reading.\";\n case 2554: return \"Expected {0} arguments, but got {1}.\";\n case 2555: return \"Expected at least {0} arguments, but got {1}.\";\n case 2558: return \"Expected {0} type arguments, but got {1}.\";\n case 2651: return \"A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums.\";\n case 2673: return \"Constructor of class '{0}' is private and only accessible within the class declaration.\";\n case 2674: return \"Constructor of class '{0}' is protected and only accessible within the class declaration.\";\n case 2694: return \"Namespace '{0}' has no exported member '{1}'.\";\n case 2706: return \"Required type parameters may not follow optional type parameters.\";\n case 2718: return \"Duplicate property '{0}'.\";\n case 6054: return \"File '{0}' not found.\";\n case 6188: return \"Numeric separators are not allowed here.\";\n case 6189: return \"Multiple consecutive numeric separators are not permitted.\";\n case 17009: return \"'super' must be called before accessing 'this' in the constructor of a derived class.\";\n case 17011: return \"'super' must be called before accessing a property of 'super' in the constructor of a derived class.\";\n default: return \"\";\n }\n}\n","/**\r\n * Built-in elements providing WebAssembly core functionality.\r\n * @module builtins\r\n *//***/\r\n\r\n import {\r\n Compiler,\r\n ContextualFlags,\r\n RuntimeFeatures,\r\n flatten\r\n} from \"./compiler\";\r\n\r\nimport {\r\n DiagnosticCode\r\n} from \"./diagnostics\";\r\n\r\nimport {\r\n Node,\r\n NodeKind,\r\n Expression,\r\n LiteralKind,\r\n LiteralExpression,\r\n StringLiteralExpression,\r\n CallExpression\r\n} from \"./ast\";\r\n\r\nimport {\r\n Type,\r\n TypeKind,\r\n TypeFlags,\r\n Signature\r\n} from \"./types\";\r\n\r\nimport {\r\n BinaryOp,\r\n UnaryOp,\r\n HostOp,\r\n AtomicRMWOp,\r\n SIMDExtractOp,\r\n SIMDReplaceOp,\r\n SIMDShiftOp,\r\n NativeType,\r\n ExpressionRef,\r\n ExpressionId,\r\n getExpressionId,\r\n getExpressionType,\r\n getConstValueI64High,\r\n getConstValueI64Low,\r\n getConstValueI32,\r\n getConstValueF32,\r\n getConstValueF64,\r\n Relooper,\r\n RelooperBlockRef\r\n} from \"./module\";\r\n\r\nimport {\r\n ElementKind,\r\n FunctionPrototype,\r\n Field,\r\n Global,\r\n DecoratorFlags,\r\n Element\r\n} from \"./program\";\r\n\r\nimport {\r\n FlowFlags,\r\n LocalFlags\r\n} from \"./flow\";\r\n\r\nimport {\r\n ReportMode\r\n} from \"./resolver\";\r\n\r\nimport {\r\n CommonFlags,\r\n Feature,\r\n TypeinfoFlags\r\n} from \"./common\";\r\n\r\nimport {\r\n writeI8,\r\n writeI16,\r\n writeI32,\r\n writeF32,\r\n writeF64,\r\n isPowerOf2\r\n} from \"./util\";\r\n\r\n/** Symbols of various compiler built-ins. */\r\nexport namespace BuiltinSymbols {\r\n // std/builtins.ts\r\n export const isInteger = \"~lib/builtins/isInteger\";\r\n export const isFloat = \"~lib/builtins/isFloat\";\r\n export const isBoolean = \"~lib/builtins/isBoolean\";\r\n export const isSigned = \"~lib/builtins/isSigned\";\r\n export const isReference = \"~lib/builtins/isReference\";\r\n export const isString = \"~lib/builtins/isString\";\r\n export const isArray = \"~lib/builtins/isArray\";\r\n export const isArrayLike = \"~lib/builtins/isArrayLike\";\r\n export const isFunction = \"~lib/builtins/isFunction\";\r\n export const isNullable = \"~lib/builtins/isNullable\";\r\n export const isDefined = \"~lib/builtins/isDefined\";\r\n export const isConstant = \"~lib/builtins/isConstant\";\r\n export const isManaged = \"~lib/builtins/isManaged\";\r\n\r\n export const clz = \"~lib/builtins/clz\";\r\n export const ctz = \"~lib/builtins/ctz\";\r\n export const popcnt = \"~lib/builtins/popcnt\";\r\n export const rotl = \"~lib/builtins/rotl\";\r\n export const rotr = \"~lib/builtins/rotr\";\r\n export const abs = \"~lib/builtins/abs\";\r\n export const max = \"~lib/builtins/max\";\r\n export const min = \"~lib/builtins/min\";\r\n export const ceil = \"~lib/builtins/ceil\";\r\n export const floor = \"~lib/builtins/floor\";\r\n export const copysign = \"~lib/builtins/copysign\";\r\n export const nearest = \"~lib/builtins/nearest\";\r\n export const reinterpret = \"~lib/builtins/reinterpret\";\r\n export const sqrt = \"~lib/builtins/sqrt\";\r\n export const trunc = \"~lib/builtins/trunc\";\r\n export const load = \"~lib/builtins/load\";\r\n export const store = \"~lib/builtins/store\";\r\n export const atomic_load = \"~lib/builtins/atomic.load\";\r\n export const atomic_store = \"~lib/builtins/atomic.store\";\r\n export const atomic_add = \"~lib/builtins/atomic.add\";\r\n export const atomic_sub = \"~lib/builtins/atomic.sub\";\r\n export const atomic_and = \"~lib/builtins/atomic.and\";\r\n export const atomic_or = \"~lib/builtins/atomic.or\";\r\n export const atomic_xor = \"~lib/builtins/atomic.xor\";\r\n export const atomic_xchg = \"~lib/builtins/atomic.xchg\";\r\n export const atomic_cmpxchg = \"~lib/builtins/atomic.cmpxchg\";\r\n export const atomic_wait = \"~lib/builtins/atomic.wait\";\r\n export const atomic_notify = \"~lib/builtins/atomic.notify\";\r\n\r\n export const sizeof = \"~lib/builtins/sizeof\";\r\n export const alignof = \"~lib/builtins/alignof\";\r\n export const offsetof = \"~lib/builtins/offsetof\";\r\n export const select = \"~lib/builtins/select\";\r\n export const unreachable = \"~lib/builtins/unreachable\";\r\n export const changetype = \"~lib/builtins/changetype\";\r\n export const assert = \"~lib/builtins/assert\";\r\n export const unchecked = \"~lib/builtins/unchecked\";\r\n export const call_direct = \"~lib/builtins/call_direct\";\r\n export const call_indirect = \"~lib/builtins/call_indirect\";\r\n export const instantiate = \"~lib/builtins/instantiate\";\r\n export const idof = \"~lib/builtins/idof\";\r\n\r\n export const i8 = \"~lib/builtins/i8\";\r\n export const i16 = \"~lib/builtins/i16\";\r\n export const i32 = \"~lib/builtins/i32\";\r\n export const i64 = \"~lib/builtins/i64\";\r\n export const isize = \"~lib/builtins/isize\";\r\n export const u8 = \"~lib/builtins/u8\";\r\n export const u16 = \"~lib/builtins/u16\";\r\n export const u32 = \"~lib/builtins/u32\";\r\n export const u64 = \"~lib/builtins/u64\";\r\n export const usize = \"~lib/builtins/usize\";\r\n export const bool = \"~lib/builtins/bool\";\r\n export const f32 = \"~lib/builtins/f32\";\r\n export const f64 = \"~lib/builtins/f64\";\r\n export const v128 = \"~lib/builtins/v128\";\r\n export const void_ = \"~lib/builtins/void\";\r\n\r\n export const i32_clz = \"~lib/builtins/i32.clz\";\r\n export const i64_clz = \"~lib/builtins/i64.clz\";\r\n export const i32_ctz = \"~lib/builtins/i32.ctz\";\r\n export const i64_ctz = \"~lib/builtins/i64.ctz\";\r\n export const i32_popcnt = \"~lib/builtins/i32.popcnt\";\r\n export const i64_popcnt = \"~lib/builtins/i64.popcnt\";\r\n export const i32_rotl = \"~lib/builtins/i32.rotl\";\r\n export const i64_rotl = \"~lib/builtins/i64.rotl\";\r\n export const i32_rotr = \"~lib/builtins/i32.rotr\";\r\n export const i64_rotr = \"~lib/builtins/i64.rotr\";\r\n\r\n export const f32_abs = \"~lib/builtins/f32.abs\";\r\n export const f64_abs = \"~lib/builtins/f64.abs\";\r\n export const f32_max = \"~lib/builtins/f32.max\";\r\n export const f64_max = \"~lib/builtins/f64.max\";\r\n export const f32_min = \"~lib/builtins/f32.min\";\r\n export const f64_min = \"~lib/builtins/f64.min\";\r\n export const f32_ceil = \"~lib/builtins/f32.ceil\";\r\n export const f64_ceil = \"~lib/builtins/f64.ceil\";\r\n export const f32_floor = \"~lib/builtins/f32.floor\";\r\n export const f64_floor = \"~lib/builtins/f64.floor\";\r\n export const f32_copysign = \"~lib/builtins/f32.copysign\";\r\n export const f64_copysign = \"~lib/builtins/f64.copysign\";\r\n export const f32_nearest = \"~lib/builtins/f32.nearest\";\r\n export const f64_nearest = \"~lib/builtins/f64.nearest\";\r\n export const i32_reinterpret_f32 = \"~lib/builtins/i32.reinterpret_f32\";\r\n export const i64_reinterpret_f64 = \"~lib/builtins/i64.reinterpret_f64\";\r\n export const f32_reinterpret_i32 = \"~lib/builtins/f32.reinterpret_i32\";\r\n export const f64_reinterpret_i64 = \"~lib/builtins/f64.reinterpret_i64\";\r\n export const f32_sqrt = \"~lib/builtins/f32.sqrt\";\r\n export const f64_sqrt = \"~lib/builtins/f64.sqrt\";\r\n export const f32_trunc = \"~lib/builtins/f32.trunc\";\r\n export const f64_trunc = \"~lib/builtins/f64.trunc\";\r\n\r\n export const i32_load8_s = \"~lib/builtins/i32.load8_s\";\r\n export const i32_load8_u = \"~lib/builtins/i32.load8_u\";\r\n export const i32_load16_s = \"~lib/builtins/i32.load16_s\";\r\n export const i32_load16_u = \"~lib/builtins/i32.load16_u\";\r\n export const i32_load = \"~lib/builtins/i32.load\";\r\n export const i64_load8_s = \"~lib/builtins/i64.load8_s\";\r\n export const i64_load8_u = \"~lib/builtins/i64.load8_u\";\r\n export const i64_load16_s = \"~lib/builtins/i64.load16_s\";\r\n export const i64_load16_u = \"~lib/builtins/i64.load16_u\";\r\n export const i64_load32_s = \"~lib/builtins/i64.load32_s\";\r\n export const i64_load32_u = \"~lib/builtins/i64.load32_u\";\r\n export const i64_load = \"~lib/builtins/i64.load\";\r\n export const f32_load = \"~lib/builtins/f32.load\";\r\n export const f64_load = \"~lib/builtins/f64.load\";\r\n export const i32_store8 = \"~lib/builtins/i32.store8\";\r\n export const i32_store16 = \"~lib/builtins/i32.store16\";\r\n export const i32_store = \"~lib/builtins/i32.store\";\r\n export const i64_store8 = \"~lib/builtins/i64.store8\";\r\n export const i64_store16 = \"~lib/builtins/i64.store16\";\r\n export const i64_store32 = \"~lib/builtins/i64.store32\";\r\n export const i64_store = \"~lib/builtins/i64.store\";\r\n export const f32_store = \"~lib/builtins/f32.store\";\r\n export const f64_store = \"~lib/builtins/f64.store\";\r\n\r\n export const i32_atomic_load8_u = \"~lib/builtins/i32.atomic.load8_u\";\r\n export const i32_atomic_load16_u = \"~lib/builtins/i32.atomic.load16_u\";\r\n export const i32_atomic_load = \"~lib/builtins/i32.atomic.load\";\r\n export const i64_atomic_load8_u = \"~lib/builtins/i64.atomic.load8_u\";\r\n export const i64_atomic_load16_u = \"~lib/builtins/i64.atomic.load16_u\";\r\n export const i64_atomic_load32_u = \"~lib/builtins/i64.atomic.load32_u\";\r\n export const i64_atomic_load = \"~lib/builtins/i64.atomic.load\";\r\n export const i32_atomic_store8 = \"~lib/builtins/i32.atomic.store8\";\r\n export const i32_atomic_store16 = \"~lib/builtins/i32.atomic.store16\";\r\n export const i32_atomic_store = \"~lib/builtins/i32.atomic.store\";\r\n export const i64_atomic_store8 = \"~lib/builtins/i64.atomic.store8\";\r\n export const i64_atomic_store16 = \"~lib/builtins/i64.atomic.store16\";\r\n export const i64_atomic_store32 = \"~lib/builtins/i64.atomic.store32\";\r\n export const i64_atomic_store = \"~lib/builtins/i64.atomic.store\";\r\n export const i32_atomic_rmw8_add_u = \"~lib/builtins/i32.atomic.rmw8.add_u\";\r\n export const i32_atomic_rmw16_add_u = \"~lib/builtins/i32.atomic.rmw16.add_u\";\r\n export const i32_atomic_rmw_add = \"~lib/builtins/i32.atomic.rmw.add\";\r\n export const i64_atomic_rmw8_add_u = \"~lib/builtins/i64.atomic.rmw8.add_u\";\r\n export const i64_atomic_rmw16_add_u = \"~lib/builtins/i64.atomic.rmw16.add_u\";\r\n export const i64_atomic_rmw32_add_u = \"~lib/builtins/i64.atomic.rmw32.add_u\";\r\n export const i64_atomic_rmw_add = \"~lib/builtins/i64.atomic.rmw.add\";\r\n export const i32_atomic_rmw8_sub_u = \"~lib/builtins/i32.atomic.rmw8.sub_u\";\r\n export const i32_atomic_rmw16_sub_u = \"~lib/builtins/i32.atomic.rmw16.sub_u\";\r\n export const i32_atomic_rmw_sub = \"~lib/builtins/i32.atomic.rmw.sub\";\r\n export const i64_atomic_rmw8_sub_u = \"~lib/builtins/i64.atomic.rmw8.sub_u\";\r\n export const i64_atomic_rmw16_sub_u = \"~lib/builtins/i64.atomic.rmw16.sub_u\";\r\n export const i64_atomic_rmw32_sub_u = \"~lib/builtins/i64.atomic.rmw32.sub_u\";\r\n export const i64_atomic_rmw_sub = \"~lib/builtins/i64.atomic.rmw.sub\";\r\n export const i32_atomic_rmw8_and_u = \"~lib/builtins/i32.atomic.rmw8.and_u\";\r\n export const i32_atomic_rmw16_and_u = \"~lib/builtins/i32.atomic.rmw16.and_u\";\r\n export const i32_atomic_rmw_and = \"~lib/builtins/i32.atomic.rmw.and\";\r\n export const i64_atomic_rmw8_and_u = \"~lib/builtins/i64.atomic.rmw8.and_u\";\r\n export const i64_atomic_rmw16_and_u = \"~lib/builtins/i64.atomic.rmw16.and_u\";\r\n export const i64_atomic_rmw32_and_u = \"~lib/builtins/i64.atomic.rmw32.and_u\";\r\n export const i64_atomic_rmw_and = \"~lib/builtins/i64.atomic.rmw.and\";\r\n export const i32_atomic_rmw8_or_u = \"~lib/builtins/i32.atomic.rmw8.or_u\";\r\n export const i32_atomic_rmw16_or_u = \"~lib/builtins/i32.atomic.rmw16.or_u\";\r\n export const i32_atomic_rmw_or = \"~lib/builtins/i32.atomic.rmw.or\";\r\n export const i64_atomic_rmw8_or_u = \"~lib/builtins/i64.atomic.rmw8.or_u\";\r\n export const i64_atomic_rmw16_or_u = \"~lib/builtins/i64.atomic.rmw16.or_u\";\r\n export const i64_atomic_rmw32_or_u = \"~lib/builtins/i64.atomic.rmw32.or_u\";\r\n export const i64_atomic_rmw_or = \"~lib/builtins/i64.atomic.rmw.or\";\r\n export const i32_atomic_rmw8_u_xor = \"~lib/builtins/i32.atomic.rmw8.xor_u\";\r\n export const i32_atomic_rmw16_u_xor = \"~lib/builtins/i32.atomic.rmw16.xor_u\";\r\n export const i32_atomic_rmw_xor = \"~lib/builtins/i32.atomic.rmw.xor\";\r\n export const i64_atomic_rmw8_xor_u = \"~lib/builtins/i64.atomic.rmw8.xor_u\";\r\n export const i64_atomic_rmw16_xor_u = \"~lib/builtins/i64.atomic.rmw16.xor_u\";\r\n export const i64_atomic_rmw32_xor_u = \"~lib/builtins/i64.atomic.rmw32.xor_u\";\r\n export const i64_atomic_rmw_xor = \"~lib/builtins/i64.atomic.rmw.xor\";\r\n export const i32_atomic_rmw8_xchg_u = \"~lib/builtins/i32.atomic.rmw8.xchg_u\";\r\n export const i32_atomic_rmw16_xchg_u = \"~lib/builtins/i32.atomic.rmw16.xchg_u\";\r\n export const i32_atomic_rmw_xchg = \"~lib/builtins/i32.atomic.rmw.xchg\";\r\n export const i64_atomic_rmw8_xchg_u = \"~lib/builtins/i64.atomic.rmw8.xchg_u\";\r\n export const i64_atomic_rmw16_xchg_u = \"~lib/builtins/i64.atomic.rmw16.xchg_u\";\r\n export const i64_atomic_rmw32_xchg_u = \"~lib/builtins/i64.atomic.rmw32.xchg_u\";\r\n export const i64_atomic_rmw_xchg = \"~lib/builtins/i64.atomic.rmw.xchg\";\r\n export const i32_atomic_rmw8_cmpxchg_u = \"~lib/builtins/i32.atomic.rmw8.cmpxchg_u\";\r\n export const i32_atomic_rmw16_cmpxchg_u = \"~lib/builtins/i32.atomic.rmw16.cmpxchg_u\";\r\n export const i32_atomic_rmw_cmpxchg = \"~lib/builtins/i32.atomic.rmw.cmpxchg\";\r\n export const i64_atomic_rmw8_cmpxchg_u = \"~lib/builtins/i64.atomic.rmw8.cmpxchg_u\";\r\n export const i64_atomic_rmw16_cmpxchg_u = \"~lib/builtins/i64.atomic.rmw16.cmpxchg_u\";\r\n export const i64_atomic_rmw32_cmpxchg_u = \"~lib/builtins/i64.atomic.rmw32.cmpxchg_u\";\r\n export const i64_atomic_rmw_cmpxchg = \"~lib/builtins/i64.atomic.rmw.cmpxchg\";\r\n export const i32_wait = \"~lib/builtins/i32.wait\";\r\n export const i64_wait = \"~lib/builtins/i64.wait\";\r\n\r\n export const v128_splat = \"~lib/builtins/v128.splat\";\r\n export const v128_extract_lane = \"~lib/builtins/v128.extract_lane\";\r\n export const v128_replace_lane = \"~lib/builtins/v128.replace_lane\";\r\n export const v128_shuffle = \"~lib/builtins/v128.shuffle\";\r\n export const v128_load = \"~lib/builtins/v128.load\";\r\n export const v128_store = \"~lib/builtins/v128.store\";\r\n export const v128_add = \"~lib/builtins/v128.add\";\r\n export const v128_sub = \"~lib/builtins/v128.sub\";\r\n export const v128_mul = \"~lib/builtins/v128.mul\";\r\n export const v128_div = \"~lib/builtins/v128.div\";\r\n export const v128_neg = \"~lib/builtins/v128.neg\";\r\n export const v128_add_saturate = \"~lib/builtins/v128.add_saturate\";\r\n export const v128_sub_saturate = \"~lib/builtins/v128.sub_saturate\";\r\n export const v128_shl = \"~lib/builtins/v128.shl\";\r\n export const v128_shr = \"~lib/builtins/v128.shr\";\r\n export const v128_and = \"~lib/builtins/v128.and\";\r\n export const v128_or = \"~lib/builtins/v128.or\";\r\n export const v128_xor = \"~lib/builtins/v128.xor\";\r\n export const v128_not = \"~lib/builtins/v128.not\";\r\n export const v128_bitselect = \"~lib/builtins/v128.bitselect\";\r\n export const v128_any_true = \"~lib/builtins/v128.any_true\";\r\n export const v128_all_true = \"~lib/builtins/v128.all_true\";\r\n export const v128_min = \"~lib/builtins/v128.min\";\r\n export const v128_max = \"~lib/builtins/v128.max\";\r\n export const v128_abs = \"~lib/builtins/v128.abs\";\r\n export const v128_sqrt = \"~lib/builtins/v128.sqrt\";\r\n export const v128_eq = \"~lib/builtins/v128.eq\";\r\n export const v128_ne = \"~lib/builtins/v128.ne\";\r\n export const v128_lt = \"~lib/builtins/v128.lt\";\r\n export const v128_le = \"~lib/builtins/v128.le\";\r\n export const v128_gt = \"~lib/builtins/v128.gt\";\r\n export const v128_ge = \"~lib/builtins/v128.ge\";\r\n export const v128_convert = \"~lib/builtins/v128.convert\";\r\n export const v128_trunc = \"~lib/builtins/v128.trunc\";\r\n\r\n export const i8x16 = \"~lib/builtins/i8x16\";\r\n export const i16x8 = \"~lib/builtins/i16x8\";\r\n export const i32x4 = \"~lib/builtins/i32x4\";\r\n export const i64x2 = \"~lib/builtins/i64x2\";\r\n export const f32x4 = \"~lib/builtins/f32x4\";\r\n export const f64x2 = \"~lib/builtins/f64x2\";\r\n\r\n export const i8x16_splat = \"~lib/builtins/i8x16.splat\";\r\n export const i8x16_extract_lane_s = \"~lib/builtins/i8x16.extract_lane_s\";\r\n export const i8x16_extract_lane_u = \"~lib/builtins/i8x16.extract_lane_u\";\r\n export const i8x16_replace_lane = \"~lib/builtins/i8x16.replace_lane\";\r\n export const i8x16_add = \"~lib/builtins/i8x16.add\";\r\n export const i8x16_sub = \"~lib/builtins/i8x16.sub\";\r\n export const i8x16_mul = \"~lib/builtins/i8x16.mul\";\r\n export const i8x16_neg = \"~lib/builtins/i8x16.neg\";\r\n export const i8x16_add_saturate_s = \"~lib/builtins/i8x16.add_saturate_s\";\r\n export const i8x16_add_saturate_u = \"~lib/builtins/i8x16.add_saturate_u\";\r\n export const i8x16_sub_saturate_s = \"~lib/builtins/i8x16.sub_saturate_s\";\r\n export const i8x16_sub_saturate_u = \"~lib/builtins/i8x16.sub_saturate_u\";\r\n export const i8x16_shl = \"~lib/builtins/i8x16.shl\";\r\n export const i8x16_shr_s = \"~lib/builtins/i8x16.shr_s\";\r\n export const i8x16_shr_u = \"~lib/builtins/i8x16.shr_u\";\r\n export const i8x16_any_true = \"~lib/builtins/i8x16.any_true\";\r\n export const i8x16_all_true = \"~lib/builtins/i8x16.all_true\";\r\n export const i8x16_eq = \"~lib/builtins/i8x16.eq\";\r\n export const i8x16_ne = \"~lib/builtins/i8x16.ne\";\r\n export const i8x16_lt_s = \"~lib/builtins/i8x16.lt_s\";\r\n export const i8x16_lt_u = \"~lib/builtins/i8x16.lt_u\";\r\n export const i8x16_le_s = \"~lib/builtins/i8x16.le_s\";\r\n export const i8x16_le_u = \"~lib/builtins/i8x16.le_u\";\r\n export const i8x16_gt_s = \"~lib/builtins/i8x16.gt_s\";\r\n export const i8x16_gt_u = \"~lib/builtins/i8x16.gt_u\";\r\n export const i8x16_ge_s = \"~lib/builtins/i8x16.ge_s\";\r\n export const i8x16_ge_u = \"~lib/builtins/i8x16.ge_u\";\r\n\r\n export const i16x8_splat = \"~lib/builtins/i16x8.splat\";\r\n export const i16x8_extract_lane_s = \"~lib/builtins/i16x8.extract_lane_s\";\r\n export const i16x8_extract_lane_u = \"~lib/builtins/i16x8.extract_lane_u\";\r\n export const i16x8_replace_lane = \"~lib/builtins/i16x8.replace_lane\";\r\n export const i16x8_add = \"~lib/builtins/i16x8.add\";\r\n export const i16x8_sub = \"~lib/builtins/i16x8.sub\";\r\n export const i16x8_mul = \"~lib/builtins/i16x8.mul\";\r\n export const i16x8_neg = \"~lib/builtins/i16x8.neg\";\r\n export const i16x8_add_saturate_s = \"~lib/builtins/i16x8.add_saturate_s\";\r\n export const i16x8_add_saturate_u = \"~lib/builtins/i16x8.add_saturate_u\";\r\n export const i16x8_sub_saturate_s = \"~lib/builtins/i16x8.sub_saturate_s\";\r\n export const i16x8_sub_saturate_u = \"~lib/builtins/i16x8.sub_saturate_u\";\r\n export const i16x8_shl = \"~lib/builtins/i16x8.shl\";\r\n export const i16x8_shr_s = \"~lib/builtins/i16x8.shr_s\";\r\n export const i16x8_shr_u = \"~lib/builtins/i16x8.shr_u\";\r\n export const i16x8_any_true = \"~lib/builtins/i16x8.any_true\";\r\n export const i16x8_all_true = \"~lib/builtins/i16x8.all_true\";\r\n export const i16x8_eq = \"~lib/builtins/i16x8.eq\";\r\n export const i16x8_ne = \"~lib/builtins/i16x8.ne\";\r\n export const i16x8_lt_s = \"~lib/builtins/i16x8.lt_s\";\r\n export const i16x8_lt_u = \"~lib/builtins/i16x8.lt_u\";\r\n export const i16x8_le_s = \"~lib/builtins/i16x8.le_s\";\r\n export const i16x8_le_u = \"~lib/builtins/i16x8.le_u\";\r\n export const i16x8_gt_s = \"~lib/builtins/i16x8.gt_s\";\r\n export const i16x8_gt_u = \"~lib/builtins/i16x8.gt_u\";\r\n export const i16x8_ge_s = \"~lib/builtins/i16x8.ge_s\";\r\n export const i16x8_ge_u = \"~lib/builtins/i16x8.ge_u\";\r\n\r\n export const i32x4_splat = \"~lib/builtins/i32x4.splat\";\r\n export const i32x4_extract_lane = \"~lib/builtins/i32x4.extract_lane\";\r\n export const i32x4_replace_lane = \"~lib/builtins/i32x4.replace_lane\";\r\n export const i32x4_add = \"~lib/builtins/i32x4.add\";\r\n export const i32x4_sub = \"~lib/builtins/i32x4.sub\";\r\n export const i32x4_mul = \"~lib/builtins/i32x4.mul\";\r\n export const i32x4_neg = \"~lib/builtins/i32x4.neg\";\r\n export const i32x4_shl = \"~lib/builtins/i32x4.shl\";\r\n export const i32x4_shr_s = \"~lib/builtins/i32x4.shr_s\";\r\n export const i32x4_shr_u = \"~lib/builtins/i32x4.shr_u\";\r\n export const i32x4_any_true = \"~lib/builtins/i32x4.any_true\";\r\n export const i32x4_all_true = \"~lib/builtins/i32x4.all_true\";\r\n export const i32x4_eq = \"~lib/builtins/i32x4.eq\";\r\n export const i32x4_ne = \"~lib/builtins/i32x4.ne\";\r\n export const i32x4_lt_s = \"~lib/builtins/i32x4.lt_s\";\r\n export const i32x4_lt_u = \"~lib/builtins/i32x4.lt_u\";\r\n export const i32x4_le_s = \"~lib/builtins/i32x4.le_s\";\r\n export const i32x4_le_u = \"~lib/builtins/i32x4.le_u\";\r\n export const i32x4_gt_s = \"~lib/builtins/i32x4.gt_s\";\r\n export const i32x4_gt_u = \"~lib/builtins/i32x4.gt_u\";\r\n export const i32x4_ge_s = \"~lib/builtins/i32x4.ge_s\";\r\n export const i32x4_ge_u = \"~lib/builtins/i32x4.ge_u\";\r\n export const i32x4_trunc_s_f32x4_sat = \"~lib/builtins/i32x4.trunc_s_f32x4_sat\";\r\n export const i32x4_trunc_u_f32x4_sat = \"~lib/builtins/i32x4.trunc_u_f32x4_sat\";\r\n\r\n export const i64x2_splat = \"~lib/builtins/i64x2.splat\";\r\n export const i64x2_extract_lane = \"~lib/builtins/i64x2.extract_lane\";\r\n export const i64x2_replace_lane = \"~lib/builtins/i64x2.replace_lane\";\r\n export const i64x2_add = \"~lib/builtins/i64x2.add\";\r\n export const i64x2_sub = \"~lib/builtins/i64x2.sub\"; // i64x2 has no .mul\r\n export const i64x2_neg = \"~lib/builtins/i64x2.neg\";\r\n export const i64x2_shl = \"~lib/builtins/i64x2.shl\";\r\n export const i64x2_shr_s = \"~lib/builtins/i64x2.shr_s\";\r\n export const i64x2_shr_u = \"~lib/builtins/i64x2.shr_u\";\r\n export const i64x2_any_true = \"~lib/builtins/i64x2.any_true\";\r\n export const i64x2_all_true = \"~lib/builtins/i64x2.all_true\"; // i64x2 has no .eq etc.\r\n export const i64x2_trunc_s_f64x2_sat = \"~lib/builtins/i64x2.trunc_s_f64x2_sat\";\r\n export const i64x2_trunc_u_f64x2_sat = \"~lib/builtins/i64x2.trunc_u_f64x2_sat\";\r\n\r\n export const f32x4_splat = \"~lib/builtins/f32x4.splat\";\r\n export const f32x4_extract_lane = \"~lib/builtins/f32x4.extract_lane\";\r\n export const f32x4_replace_lane = \"~lib/builtins/f32x4.replace_lane\";\r\n export const f32x4_add = \"~lib/builtins/f32x4.add\";\r\n export const f32x4_sub = \"~lib/builtins/f32x4.sub\";\r\n export const f32x4_mul = \"~lib/builtins/f32x4.mul\";\r\n export const f32x4_div = \"~lib/builtins/f32x4.div\";\r\n export const f32x4_neg = \"~lib/builtins/f32x4.neg\";\r\n export const f32x4_min = \"~lib/builtins/f32x4.min\";\r\n export const f32x4_max = \"~lib/builtins/f32x4.max\";\r\n export const f32x4_abs = \"~lib/builtins/f32x4.abs\";\r\n export const f32x4_sqrt = \"~lib/builtins/f32x4.sqrt\";\r\n export const f32x4_eq = \"~lib/builtins/f32x4.eq\";\r\n export const f32x4_ne = \"~lib/builtins/f32x4.ne\";\r\n export const f32x4_lt = \"~lib/builtins/f32x4.lt\";\r\n export const f32x4_le = \"~lib/builtins/f32x4.le\";\r\n export const f32x4_gt = \"~lib/builtins/f32x4.gt\";\r\n export const f32x4_ge = \"~lib/builtins/f32x4.ge\";\r\n export const f32x4_convert_s_i32x4 = \"~lib/builtins/f32x4.convert_s_i32x4\";\r\n export const f32x4_convert_u_i32x4 = \"~lib/builtins/f32x4.convert_u_i32x4\";\r\n\r\n export const f64x2_splat = \"~lib/builtins/f64x2.splat\";\r\n export const f64x2_extract_lane = \"~lib/builtins/f64x2.extract_lane\";\r\n export const f64x2_replace_lane = \"~lib/builtins/f64x2.replace_lane\";\r\n export const f64x2_add = \"~lib/builtins/f64x2.add\";\r\n export const f64x2_sub = \"~lib/builtins/f64x2.sub\";\r\n export const f64x2_mul = \"~lib/builtins/f64x2.mul\";\r\n export const f64x2_div = \"~lib/builtins/f64x2.div\";\r\n export const f64x2_neg = \"~lib/builtins/f64x2.neg\";\r\n export const f64x2_min = \"~lib/builtins/f64x2.min\";\r\n export const f64x2_max = \"~lib/builtins/f64x2.max\";\r\n export const f64x2_abs = \"~lib/builtins/f64x2.abs\";\r\n export const f64x2_sqrt = \"~lib/builtins/f64x2.sqrt\";\r\n export const f64x2_eq = \"~lib/builtins/f64x2.eq\";\r\n export const f64x2_ne = \"~lib/builtins/f64x2.ne\";\r\n export const f64x2_lt = \"~lib/builtins/f64x2.lt\";\r\n export const f64x2_le = \"~lib/builtins/f64x2.le\";\r\n export const f64x2_gt = \"~lib/builtins/f64x2.gt\";\r\n export const f64x2_ge = \"~lib/builtins/f64x2.ge\";\r\n export const f64x2_convert_s_i64x2 = \"~lib/builtins/f64x2.convert_s_i64x2\";\r\n export const f64x2_convert_u_i64x2 = \"~lib/builtins/f64x2.convert_u_i64x2\";\r\n\r\n export const v8x16_shuffle = \"~lib/builtins/v8x16.shuffle\";\r\n\r\n // internals\r\n export const heap_base = \"~lib/heap/__heap_base\";\r\n export const rtti_base = \"~lib/rt/__rtti_base\";\r\n export const visit_globals = \"~lib/rt/__visit_globals\";\r\n export const visit_members = \"~lib/rt/__visit_members\";\r\n\r\n // std/diagnostics.ts\r\n export const ERROR = \"~lib/diagnostics/ERROR\";\r\n export const WARNING = \"~lib/diagnostics/WARNING\";\r\n export const INFO = \"~lib/diagnostics/INFO\";\r\n\r\n // std/memory.ts\r\n export const memory_size = \"~lib/memory/memory.size\";\r\n export const memory_grow = \"~lib/memory/memory.grow\";\r\n export const memory_copy = \"~lib/memory/memory.copy\";\r\n export const memory_fill = \"~lib/memory/memory.fill\";\r\n export const memory_allocate = \"~lib/memory/memory.allocate\";\r\n export const memory_free = \"~lib/memory/memory.free\";\r\n export const memory_reset = \"~lib/memory/memory.reset\";\r\n\r\n // std/runtime.ts\r\n export const runtime_instanceof = \"~lib/runtime/runtime.instanceof\";\r\n export const runtime_flags = \"~lib/runtime/runtime.flags\";\r\n export const runtime_allocate = \"~lib/util/runtime/allocate\";\r\n export const runtime_reallocate = \"~lib/util/runtime/reallocate\";\r\n export const runtime_register = \"~lib/util/runtime/register\";\r\n export const runtime_discard = \"~lib/util/runtime/discard\";\r\n export const runtime_makeArray = \"~lib/util/runtime/makeArray\";\r\n\r\n // std/typedarray.ts\r\n export const Int8Array = \"~lib/typedarray/Int8Array\";\r\n export const Uint8Array = \"~lib/typedarray/Uint8Array\";\r\n export const Int16Array = \"~lib/typedarray/Int16Array\";\r\n export const Uint16Array = \"~lib/typedarray/Uint16Array\";\r\n export const Int32Array = \"~lib/typedarray/Int32Array\";\r\n export const Uint32Array = \"~lib/typedarray/Uint32Array\";\r\n export const Int64Array = \"~lib/typedarray/Int64Array\";\r\n export const Uint64Array = \"~lib/typedarray/Uint64Array\";\r\n export const Uint8ClampedArray = \"~lib/typedarray/Uint8ClampedArray\";\r\n export const Float32Array = \"~lib/typedarray/Float32Array\";\r\n export const Float64Array = \"~lib/typedarray/Float64Array\";\r\n\r\n // compiler generated\r\n export const started = \"~lib/started\";\r\n export const argc = \"~lib/argc\";\r\n export const setargc = \"~lib/setargc\";\r\n export const capabilities = \"~lib/capabilities\";\r\n}\r\n\r\n/** Compiles a call to a built-in function. */\r\nexport function compileCall(\r\n /* Compiler reference. */\r\n compiler: Compiler,\r\n /** Respective function prototype. */\r\n prototype: FunctionPrototype,\r\n /** Pre-resolved type arguments. */\r\n typeArguments: Type[] | null,\r\n /** Operand expressions. */\r\n operands: Expression[],\r\n /** Contextual type. */\r\n contextualType: Type,\r\n /** Respective call expression. */\r\n reportNode: CallExpression,\r\n /** Indicates that contextual type is ASM type. */\r\n isAsm: bool = false\r\n): ExpressionRef {\r\n var module = compiler.module;\r\n\r\n // NOTE that some implementations below make use of the select expression where straight-forward.\r\n // whether worth or not should probably be tested once it's known if/how embedders handle it.\r\n // search: createSelect\r\n\r\n // NOTE that consolidation of individual instructions into a single case isn't exactly scientific\r\n // below, but rather done to make this file easier to work with. If there was a general rule it'd\r\n // most likely be \"three or more instructions that only differ in their actual opcode\".\r\n\r\n var directize = false;\r\n\r\n switch (prototype.internalName) {\r\n\r\n // === Static type evaluation =================================================================\r\n\r\n case BuiltinSymbols.isInteger: { // isInteger() / isInteger(value: T) -> bool\r\n let type = evaluateConstantType(compiler, typeArguments, operands, reportNode);\r\n compiler.currentType = Type.bool;\r\n if (!type) return module.unreachable();\r\n return type.is(TypeFlags.INTEGER) && !type.is(TypeFlags.REFERENCE)\r\n ? module.i32(1)\r\n : module.i32(0);\r\n }\r\n case BuiltinSymbols.isFloat: { // isFloat() / isFloat(value: T) -> bool\r\n let type = evaluateConstantType(compiler, typeArguments, operands, reportNode);\r\n compiler.currentType = Type.bool;\r\n if (!type) return module.unreachable();\r\n return type.is(TypeFlags.FLOAT)\r\n ? module.i32(1)\r\n : module.i32(0);\r\n }\r\n case BuiltinSymbols.isBoolean: { // isBoolean() / isBoolean(value: T) -> bool\r\n let type = evaluateConstantType(compiler, typeArguments, operands, reportNode);\r\n compiler.currentType = Type.bool;\r\n if (!type) return module.unreachable();\r\n return type == Type.bool\r\n ? module.i32(1)\r\n : module.i32(0);\r\n }\r\n case BuiltinSymbols.isSigned: { // isSigned() / isSigned(value: T) -> bool\r\n let type = evaluateConstantType(compiler, typeArguments, operands, reportNode);\r\n compiler.currentType = Type.bool;\r\n if (!type) return module.unreachable();\r\n return type.is(TypeFlags.SIGNED)\r\n ? module.i32(1)\r\n : module.i32(0);\r\n }\r\n case BuiltinSymbols.isReference: { // isReference() / isReference(value: T) -> bool\r\n let type = evaluateConstantType(compiler, typeArguments, operands, reportNode);\r\n compiler.currentType = Type.bool;\r\n if (!type) return module.unreachable();\r\n return type.is(TypeFlags.REFERENCE)\r\n ? module.i32(1)\r\n : module.i32(0);\r\n }\r\n case BuiltinSymbols.isString: { // isString() / isString(value: T) -> bool\r\n let type = evaluateConstantType(compiler, typeArguments, operands, reportNode);\r\n compiler.currentType = Type.bool;\r\n if (!type) return module.unreachable();\r\n let classType = type.classReference;\r\n if (classType) {\r\n let stringInstance = compiler.program.stringInstance;\r\n if (stringInstance && classType.isAssignableTo(stringInstance)) return module.i32(1);\r\n }\r\n return module.i32(0);\r\n }\r\n case BuiltinSymbols.isArray: { // isArray() / isArray(value: T) -> bool\r\n let type = evaluateConstantType(compiler, typeArguments, operands, reportNode);\r\n compiler.currentType = Type.bool;\r\n if (!type) return module.unreachable();\r\n let classReference = type.classReference;\r\n if (!classReference) return module.i32(0);\r\n let classPrototype = classReference.prototype;\r\n return module.i32(classPrototype.extends(compiler.program.arrayPrototype) ? 1 : 0);\r\n }\r\n case BuiltinSymbols.isArrayLike: { // isArrayLike() / isArrayLike(value: T) -> bool\r\n let type = evaluateConstantType(compiler, typeArguments, operands, reportNode);\r\n compiler.currentType = Type.bool;\r\n if (!type) return module.unreachable();\r\n let classReference = type.classReference;\r\n if (!classReference) return module.i32(0);\r\n return module.i32(classReference.isArrayLike ? 1 : 0);\r\n }\r\n case BuiltinSymbols.isFunction: { // isFunction / isFunction(value: T) -> bool\r\n let type = evaluateConstantType(compiler, typeArguments, operands, reportNode);\r\n compiler.currentType = Type.bool;\r\n if (!type) return module.unreachable();\r\n return module.i32(type.signatureReference ? 1 : 0);\r\n }\r\n case BuiltinSymbols.isNullable: { // isNullable / isNullable(value: T) -> bool\r\n let type = evaluateConstantType(compiler, typeArguments, operands, reportNode);\r\n compiler.currentType = Type.bool;\r\n if (!type) return module.unreachable();\r\n return module.i32(type.is(TypeFlags.NULLABLE) ? 1 : 0);\r\n }\r\n case BuiltinSymbols.isDefined: { // isDefined(expression) -> bool\r\n compiler.currentType = Type.bool;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) return module.unreachable();\r\n let element = compiler.resolver.resolveExpression(\r\n operands[0],\r\n compiler.currentFlow,\r\n Type.void,\r\n ReportMode.SWALLOW\r\n );\r\n return module.i32(element ? 1 : 0);\r\n }\r\n case BuiltinSymbols.isConstant: { // isConstant(expression) -> bool\r\n compiler.currentType = Type.bool;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) return module.unreachable();\r\n let expr = compiler.compileExpressionRetainType(operands[0], Type.i32);\r\n compiler.currentType = Type.bool;\r\n return module.i32(getExpressionId(expr) == ExpressionId.Const ? 1 : 0);\r\n }\r\n case BuiltinSymbols.isManaged: { // isManaged() -> bool\r\n let type = evaluateConstantType(compiler, typeArguments, operands, reportNode);\r\n compiler.currentType = Type.bool;\r\n if (!type) return module.unreachable();\r\n return module.i32(type.isManaged ? 1 : 0);\r\n }\r\n case BuiltinSymbols.sizeof: { // sizeof() -> usize\r\n compiler.currentType = compiler.options.usizeType;\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler) |\r\n checkArgsRequired(operands, 0, reportNode, compiler)\r\n ) return module.unreachable();\r\n let byteSize = (typeArguments)[0].byteSize;\r\n let expr: ExpressionRef;\r\n if (compiler.options.isWasm64) {\r\n // implicitly wrap if contextual type is a 32-bit integer\r\n if (contextualType.is(TypeFlags.INTEGER) && contextualType.size <= 32) {\r\n compiler.currentType = Type.u32;\r\n expr = module.i32(byteSize);\r\n } else {\r\n expr = module.i64(byteSize, 0);\r\n }\r\n } else {\r\n // implicitly extend if contextual type is a 64-bit integer\r\n if (contextualType.is(TypeFlags.INTEGER) && contextualType.size == 64) {\r\n compiler.currentType = Type.u64;\r\n expr = module.i64(byteSize, 0);\r\n } else {\r\n expr = module.i32(byteSize);\r\n }\r\n }\r\n return expr;\r\n }\r\n case BuiltinSymbols.alignof: { // alignof() -> usize\r\n compiler.currentType = compiler.options.usizeType;\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler) |\r\n checkArgsRequired(operands, 0, reportNode, compiler)\r\n ) return module.unreachable();\r\n let byteSize = (typeArguments)[0].byteSize;\r\n assert(isPowerOf2(byteSize));\r\n let alignLog2 = ctz(byteSize);\r\n let expr: ExpressionRef;\r\n if (compiler.options.isWasm64) {\r\n // implicitly wrap if contextual type is a 32-bit integer\r\n if (contextualType.is(TypeFlags.INTEGER) && contextualType.size <= 32) {\r\n compiler.currentType = Type.u32;\r\n expr = module.i32(alignLog2);\r\n } else {\r\n expr = module.i64(alignLog2, 0);\r\n }\r\n } else {\r\n // implicitly extend if contextual type is a 64-bit integer\r\n if (contextualType.is(TypeFlags.INTEGER) && contextualType.size == 64) {\r\n compiler.currentType = Type.u64;\r\n expr = module.i64(alignLog2, 0);\r\n } else {\r\n expr = module.i32(alignLog2);\r\n }\r\n }\r\n return expr;\r\n }\r\n case BuiltinSymbols.offsetof: { // offsetof(fieldName?: string) -> usize\r\n compiler.currentType = compiler.options.usizeType;\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler) |\r\n checkArgsOptional(operands, 0, 1, reportNode, compiler)\r\n ) return module.unreachable();\r\n let classType = typeArguments![0].classReference;\r\n if (!classType) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.unreachable();\r\n }\r\n let offset: i32;\r\n if (operands.length) {\r\n if (\r\n operands[0].kind != NodeKind.LITERAL ||\r\n (operands[0]).literalKind != LiteralKind.STRING\r\n ) {\r\n compiler.error(\r\n DiagnosticCode.String_literal_expected,\r\n operands[0].range\r\n );\r\n return module.unreachable();\r\n }\r\n let fieldName = (operands[0]).value;\r\n let field = classType.members ? classType.members.get(fieldName) : null;\r\n if (!(field && field.kind == ElementKind.FIELD)) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_has_no_property_1,\r\n operands[0].range, classType.internalName, fieldName\r\n );\r\n return module.unreachable();\r\n }\r\n offset = (field).memoryOffset;\r\n } else {\r\n offset = classType.currentMemoryOffset;\r\n }\r\n if (compiler.options.isWasm64) {\r\n // implicitly wrap if contextual type is a 32-bit integer\r\n if (contextualType.is(TypeFlags.INTEGER) && contextualType.size <= 32) {\r\n compiler.currentType = Type.u32;\r\n return module.i32(offset);\r\n } else {\r\n return module.i64(offset);\r\n }\r\n } else {\r\n // implicitly extend if contextual type is a 64-bit integer\r\n if (contextualType.is(TypeFlags.INTEGER) && contextualType.size == 64) {\r\n compiler.currentType = Type.u64;\r\n return module.i64(offset);\r\n } else {\r\n return module.i32(offset);\r\n }\r\n }\r\n }\r\n\r\n // === Math ===================================================================================\r\n\r\n case BuiltinSymbols.clz: // any_bitcount(value: T) -> T\r\n case BuiltinSymbols.ctz:\r\n case BuiltinSymbols.popcnt: {\r\n if (\r\n checkTypeOptional(typeArguments, reportNode, compiler, true) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) return module.unreachable();\r\n let arg0 = typeArguments\r\n ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT | ContextualFlags.WRAP)\r\n : compiler.compileExpression(operands[0], Type.i32, ContextualFlags.WRAP);\r\n let type = compiler.currentType;\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.unreachable();\r\n }\r\n let op: UnaryOp = -1;\r\n switch (prototype.internalName) {\r\n case BuiltinSymbols.clz: {\r\n switch (type.kind) {\r\n case TypeKind.BOOL:\r\n case TypeKind.I8:\r\n case TypeKind.U8:\r\n case TypeKind.I16:\r\n case TypeKind.U16:\r\n case TypeKind.I32:\r\n case TypeKind.U32: { op = UnaryOp.ClzI32; break; }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n op = compiler.options.isWasm64\r\n ? UnaryOp.ClzI64\r\n : UnaryOp.ClzI32;\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: { op = UnaryOp.ClzI64; break; }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.ctz: {\r\n switch (type.kind) {\r\n case TypeKind.BOOL:\r\n case TypeKind.I8:\r\n case TypeKind.U8:\r\n case TypeKind.I16:\r\n case TypeKind.U16:\r\n case TypeKind.I32:\r\n case TypeKind.U32: { op = UnaryOp.CtzI32; break; }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n op = compiler.options.isWasm64\r\n ? UnaryOp.CtzI64\r\n : UnaryOp.CtzI32;\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: { op = UnaryOp.CtzI64; break; }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.popcnt: {\r\n switch (compiler.currentType.kind) {\r\n case TypeKind.BOOL:\r\n case TypeKind.I8:\r\n case TypeKind.U8:\r\n case TypeKind.I16:\r\n case TypeKind.U16:\r\n case TypeKind.I32:\r\n case TypeKind.U32: { op = UnaryOp.PopcntI32; break; }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n op = compiler.options.isWasm64\r\n ? UnaryOp.PopcntI64\r\n : UnaryOp.PopcntI32;\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: { op = UnaryOp.PopcntI64; break; }\r\n }\r\n break;\r\n }\r\n }\r\n if (op == -1) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.unreachable();\r\n }\r\n return module.unary(op, arg0);\r\n }\r\n case BuiltinSymbols.rotl: { // rotl(value: T, shift: T) -> T\r\n if (\r\n checkTypeOptional(typeArguments, reportNode, compiler, true) |\r\n checkArgsRequired(operands, 2, reportNode, compiler)\r\n ) return module.unreachable();\r\n let arg0 = typeArguments\r\n ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT | ContextualFlags.WRAP)\r\n : compiler.compileExpression(operands[0], Type.i32, ContextualFlags.WRAP);\r\n let type = compiler.currentType;\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.unreachable();\r\n }\r\n let arg1 = compiler.compileExpression(operands[1], type, ContextualFlags.IMPLICIT);\r\n let expr: ExpressionRef;\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.BOOL: {\r\n expr = compiler.ensureSmallIntegerWrap(\r\n module.binary(BinaryOp.RotlI32, arg0, arg1),\r\n type\r\n );\r\n // fall-through\r\n }\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n expr = module.binary(BinaryOp.RotlI32, arg0, arg1);\r\n break;\r\n }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n expr = module.binary(\r\n compiler.options.isWasm64\r\n ? BinaryOp.RotlI64\r\n : BinaryOp.RotlI32,\r\n arg0, arg1\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.binary(BinaryOp.RotlI64, arg0, arg1);\r\n break;\r\n }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n expr = module.unreachable();\r\n break;\r\n }\r\n }\r\n return expr; // possibly overflows\r\n }\r\n case BuiltinSymbols.rotr: { // rotr(value: T, shift: T) -> T\r\n if (\r\n checkTypeOptional(typeArguments, reportNode, compiler, true) |\r\n checkArgsRequired(operands, 2, reportNode, compiler)\r\n ) return module.unreachable();\r\n let arg0 = typeArguments\r\n ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT | ContextualFlags.WRAP)\r\n : compiler.compileExpression(operands[0], Type.i32, ContextualFlags.WRAP);\r\n let type = compiler.currentType;\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.unreachable();\r\n }\r\n let arg1 = compiler.compileExpression(operands[1], type, ContextualFlags.IMPLICIT);\r\n let expr: ExpressionRef;\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.BOOL: {\r\n expr = compiler.ensureSmallIntegerWrap(\r\n module.binary(BinaryOp.RotrI32, arg0, arg1),\r\n type\r\n );\r\n break;\r\n }\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n expr = module.binary(BinaryOp.RotrI32, arg0, arg1);\r\n break;\r\n }\r\n case TypeKind.USIZE:\r\n case TypeKind.ISIZE: {\r\n expr = module.binary(\r\n compiler.options.isWasm64\r\n ? BinaryOp.RotrI64\r\n : BinaryOp.RotrI32,\r\n arg0, arg1\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.binary(BinaryOp.RotrI64, arg0, arg1);\r\n break;\r\n }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n expr = module.unreachable();\r\n break;\r\n }\r\n }\r\n return expr; // possibly overflowws\r\n }\r\n case BuiltinSymbols.abs: { // abs(value: T) -> T\r\n if (\r\n checkTypeOptional(typeArguments, reportNode, compiler, true) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) return module.unreachable();\r\n let arg0 = typeArguments\r\n ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT | ContextualFlags.WRAP)\r\n : compiler.compileExpression(operands[0], Type.f64, ContextualFlags.WRAP);\r\n let type = compiler.currentType;\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.unreachable();\r\n }\r\n let expr: ExpressionRef;\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32: {\r\n let flow = compiler.currentFlow;\r\n\r\n // possibly overflows, e.g. abs(-128) == 128\r\n let tempLocal1 = flow.getTempLocal(Type.i32);\r\n let tempLocalIndex2 = flow.getAndFreeTempLocal(Type.i32).index;\r\n let tempLocalIndex1 = tempLocal1.index;\r\n\r\n // (x + (x >> 31)) ^ (x >> 31)\r\n expr = module.binary(BinaryOp.XorI32,\r\n module.binary(BinaryOp.AddI32,\r\n module.local_tee(\r\n tempLocalIndex2,\r\n module.binary(BinaryOp.ShrI32,\r\n module.local_tee(tempLocalIndex1, arg0),\r\n module.i32(31)\r\n )\r\n ),\r\n module.local_get(tempLocalIndex1, NativeType.I32)\r\n ),\r\n module.local_get(tempLocalIndex2, NativeType.I32)\r\n );\r\n\r\n flow.freeTempLocal(tempLocal1);\r\n break;\r\n }\r\n case TypeKind.ISIZE: {\r\n let options = compiler.options;\r\n let flow = compiler.currentFlow;\r\n let wasm64 = options.isWasm64;\r\n\r\n let tempLocal1 = flow.getTempLocal(options.usizeType);\r\n let tempLocalIndex2 = flow.getAndFreeTempLocal(options.usizeType).index;\r\n let tempLocalIndex1 = tempLocal1.index;\r\n\r\n expr = module.binary(wasm64 ? BinaryOp.XorI64 : BinaryOp.XorI32,\r\n module.binary(wasm64 ? BinaryOp.AddI64 : BinaryOp.AddI32,\r\n module.local_tee(\r\n tempLocalIndex2,\r\n module.binary(wasm64 ? BinaryOp.ShrI64 : BinaryOp.ShrI32,\r\n module.local_tee(tempLocalIndex1, arg0),\r\n wasm64 ? module.i64(63) : module.i32(31)\r\n )\r\n ),\r\n module.local_get(tempLocalIndex1, options.nativeSizeType)\r\n ),\r\n module.local_get(tempLocalIndex2, options.nativeSizeType)\r\n );\r\n\r\n flow.freeTempLocal(tempLocal1);\r\n break;\r\n }\r\n case TypeKind.I64: {\r\n let flow = compiler.currentFlow;\r\n\r\n let tempLocal1 = flow.getTempLocal(Type.i64);\r\n let tempLocalIndex2 = flow.getAndFreeTempLocal(Type.i64).index;\r\n let tempLocalIndex1 = tempLocal1.index;\r\n\r\n // (x + (x >> 63)) ^ (x >> 63)\r\n expr = module.binary(BinaryOp.XorI64,\r\n module.binary(BinaryOp.AddI64,\r\n module.local_tee(\r\n tempLocalIndex2,\r\n module.binary(BinaryOp.ShrI64,\r\n module.local_tee(tempLocalIndex1, arg0),\r\n module.i64(63)\r\n )\r\n ),\r\n module.local_get(tempLocalIndex1, NativeType.I64)\r\n ),\r\n module.local_get(tempLocalIndex2, NativeType.I64)\r\n );\r\n\r\n flow.freeTempLocal(tempLocal1);\r\n break;\r\n }\r\n case TypeKind.USIZE:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.U64:\r\n case TypeKind.BOOL: {\r\n expr = arg0;\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n expr = module.unary(UnaryOp.AbsF32, arg0);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.unary(UnaryOp.AbsF64, arg0);\r\n break;\r\n }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n expr = module.unreachable();\r\n break;\r\n }\r\n }\r\n return expr;\r\n }\r\n case BuiltinSymbols.max: { // max(left: T, right: T) -> T\r\n if (\r\n checkTypeOptional(typeArguments, reportNode, compiler, true) |\r\n checkArgsRequired(operands, 2, reportNode, compiler)\r\n ) return module.unreachable();\r\n let arg0 = typeArguments\r\n ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT | ContextualFlags.WRAP)\r\n : compiler.compileExpression(operands[0], Type.f64, ContextualFlags.WRAP);\r\n let type = compiler.currentType;\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.unreachable();\r\n }\r\n let arg1 = compiler.compileExpression(operands[1], type, ContextualFlags.IMPLICIT | ContextualFlags.WRAP);\r\n let op: BinaryOp;\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32: { op = BinaryOp.GtI32; break; }\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: { op = BinaryOp.GtU32; break; }\r\n case TypeKind.I64: { op = BinaryOp.GtI64; break; }\r\n case TypeKind.U64: { op = BinaryOp.GtU64; break; }\r\n case TypeKind.ISIZE: {\r\n op = compiler.options.isWasm64\r\n ? BinaryOp.GtI64\r\n : BinaryOp.GtI32;\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n op = compiler.options.isWasm64\r\n ? BinaryOp.GtU64\r\n : BinaryOp.GtU32;\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n return module.binary(BinaryOp.MaxF32, arg0, arg1);\r\n }\r\n case TypeKind.F64: {\r\n return module.binary(BinaryOp.MaxF64, arg0, arg1);\r\n }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.unreachable();\r\n }\r\n }\r\n let flow = compiler.currentFlow;\r\n let nativeType = type.toNativeType();\r\n let tempLocal0 = flow.getTempLocal(type);\r\n flow.setLocalFlag(tempLocal0.index, LocalFlags.WRAPPED);\r\n let tempLocal1 = flow.getAndFreeTempLocal(type);\r\n flow.setLocalFlag(tempLocal1.index, LocalFlags.WRAPPED);\r\n flow.freeTempLocal(tempLocal0);\r\n return module.select(\r\n module.local_tee(tempLocal0.index, arg0),\r\n module.local_tee(tempLocal1.index, arg1),\r\n module.binary(op,\r\n module.local_get(tempLocal0.index, nativeType),\r\n module.local_get(tempLocal1.index, nativeType)\r\n )\r\n );\r\n }\r\n case BuiltinSymbols.min: { // min(left: T, right: T) -> T\r\n if (\r\n checkTypeOptional(typeArguments, reportNode, compiler, true) |\r\n checkArgsRequired(operands, 2, reportNode, compiler)\r\n ) return module.unreachable();\r\n let arg0 = typeArguments\r\n ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT | ContextualFlags.WRAP)\r\n : compiler.compileExpression(operands[0], Type.f64, ContextualFlags.WRAP);\r\n let type = compiler.currentType;\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.unreachable();\r\n }\r\n let arg1 = compiler.compileExpression(operands[1], type, ContextualFlags.IMPLICIT | ContextualFlags.WRAP);\r\n let op: BinaryOp;\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32: { op = BinaryOp.LtI32; break; }\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: { op = BinaryOp.LtU32; break; }\r\n case TypeKind.I64: { op = BinaryOp.LtI64; break; }\r\n case TypeKind.U64: { op = BinaryOp.LtU64; break; }\r\n case TypeKind.ISIZE: {\r\n op = compiler.options.isWasm64\r\n ? BinaryOp.LtI64\r\n : BinaryOp.LtI32;\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n op = compiler.options.isWasm64\r\n ? BinaryOp.LtU64\r\n : BinaryOp.LtU32;\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n return module.binary(BinaryOp.MinF32, arg0, arg1);\r\n }\r\n case TypeKind.F64: {\r\n return module.binary(BinaryOp.MinF64, arg0, arg1);\r\n }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.unreachable();\r\n }\r\n }\r\n let flow = compiler.currentFlow;\r\n let nativeType = type.toNativeType();\r\n let tempLocal0 = flow.getTempLocal(type);\r\n flow.setLocalFlag(tempLocal0.index, LocalFlags.WRAPPED);\r\n let tempLocal1 = flow.getAndFreeTempLocal(type);\r\n flow.setLocalFlag(tempLocal1.index, LocalFlags.WRAPPED);\r\n flow.freeTempLocal(tempLocal0);\r\n return module.select(\r\n module.local_tee(tempLocal0.index, arg0),\r\n module.local_tee(tempLocal1.index, arg1),\r\n module.binary(op,\r\n module.local_get(tempLocal0.index, nativeType),\r\n module.local_get(tempLocal1.index, nativeType)\r\n )\r\n );\r\n }\r\n case BuiltinSymbols.ceil: // any_rounding(value: T) -> T\r\n case BuiltinSymbols.floor: {\r\n if (\r\n checkTypeOptional(typeArguments, reportNode, compiler, true) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) return module.unreachable();\r\n let arg0 = typeArguments\r\n ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT)\r\n : compiler.compileExpression(operands[0], Type.f64, ContextualFlags.NONE);\r\n let type = compiler.currentType;\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.unreachable();\r\n }\r\n let op: UnaryOp;\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32:\r\n case TypeKind.I64:\r\n case TypeKind.ISIZE:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.U64:\r\n case TypeKind.USIZE:\r\n case TypeKind.BOOL: return arg0; // considered rounded\r\n case TypeKind.F32: {\r\n op = prototype.internalName == BuiltinSymbols.ceil\r\n ? UnaryOp.CeilF32\r\n : UnaryOp.FloorF32;\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n op = prototype.internalName == BuiltinSymbols.ceil\r\n ? UnaryOp.CeilF64\r\n : UnaryOp.FloorF64;\r\n break;\r\n }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.unreachable();\r\n }\r\n }\r\n return module.unary(op, arg0);\r\n }\r\n case BuiltinSymbols.copysign: { // copysign(left: T, right: T) -> T\r\n if (\r\n checkTypeOptional(typeArguments, reportNode, compiler, true) |\r\n checkArgsRequired(operands, 2, reportNode, compiler)\r\n ) return module.unreachable();\r\n let arg0 = typeArguments\r\n ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT)\r\n : compiler.compileExpression(operands[0], Type.f64, ContextualFlags.NONE);\r\n let type = compiler.currentType;\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.unreachable();\r\n }\r\n let arg1 = compiler.compileExpression(operands[1], type, ContextualFlags.IMPLICIT);\r\n let op: BinaryOp;\r\n switch (type.kind) {\r\n // TODO: does an integer version make sense?\r\n case TypeKind.F32: { op = BinaryOp.CopysignF32; break; }\r\n case TypeKind.F64: { op = BinaryOp.CopysignF64; break; }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.unreachable();\r\n }\r\n }\r\n return module.binary(op, arg0, arg1);\r\n }\r\n case BuiltinSymbols.nearest: { // nearest(value: T) -> T\r\n if (\r\n checkTypeOptional(typeArguments, reportNode, compiler, true) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) return module.unreachable();\r\n let arg0 = typeArguments\r\n ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT)\r\n : compiler.compileExpression(operands[0], Type.f64, ContextualFlags.NONE);\r\n let type = compiler.currentType;\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.unreachable();\r\n }\r\n let expr: ExpressionRef;\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32:\r\n case TypeKind.I64:\r\n case TypeKind.ISIZE:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.U64:\r\n case TypeKind.USIZE:\r\n case TypeKind.BOOL: {\r\n expr = arg0;\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n expr = module.unary(UnaryOp.NearestF32, arg0);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.unary(UnaryOp.NearestF64, arg0);\r\n break;\r\n }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n expr = module.unreachable();\r\n break;\r\n }\r\n }\r\n return expr;\r\n }\r\n case BuiltinSymbols.reinterpret: { // reinterpret(value: *) -> T\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler, true) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) return module.unreachable();\r\n let type = typeArguments![0];\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.currentType = type;\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.unreachable();\r\n }\r\n let expr: ExpressionRef;\r\n switch (type.kind) {\r\n case TypeKind.I32:\r\n case TypeKind.U32: {\r\n let arg0 = compiler.compileExpression(operands[0], Type.f32, ContextualFlags.IMPLICIT);\r\n expr = module.unary(UnaryOp.ReinterpretF32, arg0);\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n let arg0 = compiler.compileExpression(operands[0], Type.f64, ContextualFlags.IMPLICIT);\r\n expr = module.unary(UnaryOp.ReinterpretF64, arg0);\r\n break;\r\n }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n let arg0 = compiler.compileExpression(operands[0],\r\n compiler.options.isWasm64\r\n ? Type.f64\r\n : Type.f32,\r\n ContextualFlags.IMPLICIT\r\n );\r\n expr = module.unary(\r\n compiler.options.isWasm64\r\n ? UnaryOp.ReinterpretF64\r\n : UnaryOp.ReinterpretF32,\r\n arg0\r\n );\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n let arg0 = compiler.compileExpression(operands[0], Type.i32, ContextualFlags.IMPLICIT);\r\n expr = module.unary(UnaryOp.ReinterpretI32, arg0);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n let arg0 = compiler.compileExpression(operands[0], Type.i64, ContextualFlags.IMPLICIT);\r\n expr = module.unary(UnaryOp.ReinterpretI64, arg0);\r\n break;\r\n }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n expr = module.unreachable();\r\n break;\r\n }\r\n }\r\n compiler.currentType = type;\r\n return expr;\r\n }\r\n case BuiltinSymbols.sqrt: { // sqrt(value: T) -> T\r\n if (\r\n checkTypeOptional(typeArguments, reportNode, compiler, true) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) return module.unreachable();\r\n let arg0 = typeArguments\r\n ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT)\r\n : compiler.compileExpression(operands[0], Type.f64, ContextualFlags.NONE);\r\n let type = compiler.currentType;\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.currentType = type;\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.unreachable();\r\n }\r\n let expr: ExpressionRef;\r\n switch (type.kind) { // TODO: integer versions (that return f64 or convert)?\r\n case TypeKind.F32: {\r\n expr = module.unary(UnaryOp.SqrtF32, arg0);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.unary(UnaryOp.SqrtF64, arg0);\r\n break;\r\n }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n expr = module.unreachable();\r\n break;\r\n }\r\n }\r\n return expr;\r\n }\r\n case BuiltinSymbols.trunc: { // trunc(value: T) -> T\r\n if (\r\n checkTypeOptional(typeArguments, reportNode, compiler, true) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) return module.unreachable();\r\n let arg0 = typeArguments\r\n ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT)\r\n : compiler.compileExpression(operands[0], Type.f64, ContextualFlags.NONE);\r\n let type = compiler.currentType;\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n return module.unreachable();\r\n }\r\n let expr: ExpressionRef;\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32:\r\n case TypeKind.I64:\r\n case TypeKind.ISIZE:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.U64:\r\n case TypeKind.USIZE:\r\n case TypeKind.BOOL: {\r\n expr = arg0;\r\n break;\r\n }\r\n // TODO: truncate to contextual type directly (if not void etc.)?\r\n case TypeKind.F32: {\r\n expr = module.unary(UnaryOp.TruncF32, arg0);\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.unary(UnaryOp.TruncF64, arg0);\r\n break;\r\n }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n expr = module.unreachable();\r\n break;\r\n }\r\n }\r\n return expr;\r\n }\r\n\r\n // === Memory access ==========================================================================\r\n\r\n case BuiltinSymbols.load: { // load(offset: usize, immOffset?: usize, immAlign?: usize) -> T*\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler, true) |\r\n checkArgsOptional(operands, 1, 3, reportNode, compiler)\r\n ) return module.unreachable();\r\n let type = typeArguments![0];\r\n let outType = (\r\n type.is(TypeFlags.INTEGER) &&\r\n contextualType.is(TypeFlags.INTEGER) &&\r\n contextualType.size > type.size\r\n ) ? contextualType : type;\r\n let arg0 = compiler.compileExpression(operands[0],\r\n compiler.options.usizeType,\r\n ContextualFlags.IMPLICIT\r\n );\r\n let numOperands = operands.length;\r\n let immOffset = numOperands >= 2 ? evaluateImmediateOffset(operands[1], compiler) : 0; // reports\r\n if (immOffset < 0) {\r\n compiler.currentType = outType;\r\n return module.unreachable();\r\n }\r\n let immAlign: i32;\r\n let naturalAlign = type.byteSize;\r\n if (numOperands == 3) {\r\n immAlign = evaluateImmediateOffset(operands[2], compiler);\r\n if (immAlign < 0) {\r\n compiler.currentType = outType;\r\n return module.unreachable();\r\n }\r\n if (immAlign > naturalAlign) {\r\n compiler.error(\r\n DiagnosticCode._0_must_be_a_value_between_1_and_2_inclusive,\r\n operands[2].range, \"Alignment\", \"0\", naturalAlign.toString()\r\n );\r\n compiler.currentType = outType;\r\n return module.unreachable();\r\n }\r\n if (!isPowerOf2(immAlign)) {\r\n compiler.error(\r\n DiagnosticCode._0_must_be_a_power_of_two,\r\n operands[2].range, \"Alignment\"\r\n );\r\n compiler.currentType = outType;\r\n return module.unreachable();\r\n }\r\n } else {\r\n immAlign = naturalAlign;\r\n }\r\n compiler.currentType = outType;\r\n return module.load(\r\n type.byteSize,\r\n type.is(TypeFlags.SIGNED | TypeFlags.INTEGER),\r\n arg0,\r\n outType.toNativeType(),\r\n immOffset,\r\n immAlign\r\n );\r\n }\r\n case BuiltinSymbols.store: { // store(offset: usize, value: T*, offset?: usize, align?: usize) -> void\r\n compiler.currentType = Type.void;\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler) |\r\n checkArgsOptional(operands, 2, 4, reportNode, compiler)\r\n ) return module.unreachable();\r\n let type = typeArguments![0];\r\n let arg0 = compiler.compileExpression(operands[0],\r\n compiler.options.usizeType,\r\n ContextualFlags.IMPLICIT\r\n );\r\n let arg1 = isAsm\r\n ? compiler.compileExpression(operands[1],\r\n contextualType,\r\n ContextualFlags.IMPLICIT\r\n )\r\n : compiler.compileExpression(\r\n operands[1],\r\n type,\r\n type.is(TypeFlags.INTEGER)\r\n ? ContextualFlags.NONE // no need to convert to small int (but now might result in a float)\r\n : ContextualFlags.IMPLICIT\r\n );\r\n let inType = compiler.currentType;\r\n if (\r\n type.is(TypeFlags.INTEGER) &&\r\n (\r\n !inType.is(TypeFlags.INTEGER) || // float to int\r\n inType.size < type.size // int to larger int (clear garbage bits)\r\n )\r\n ) {\r\n arg1 = compiler.convertExpression(arg1,\r\n inType, type,\r\n false, false, // still clears garbage bits when not wrapping\r\n operands[1]\r\n );\r\n inType = type;\r\n }\r\n let immOffset = operands.length >= 3 ? evaluateImmediateOffset(operands[2], compiler) : 0; // reports\r\n if (immOffset < 0) {\r\n compiler.currentType = Type.void;\r\n return module.unreachable();\r\n }\r\n let immAlign: i32;\r\n let naturalAlign = type.byteSize;\r\n if (operands.length == 4) {\r\n immAlign = evaluateImmediateOffset(operands[3], compiler);\r\n if (immAlign < 0) {\r\n compiler.currentType = Type.void;\r\n return module.unreachable();\r\n }\r\n if (immAlign > naturalAlign) {\r\n compiler.error(\r\n DiagnosticCode._0_must_be_a_value_between_1_and_2_inclusive,\r\n operands[3].range, \"Alignment\", \"0\", naturalAlign.toString()\r\n );\r\n compiler.currentType = Type.void;\r\n return module.unreachable();\r\n }\r\n if (!isPowerOf2(immAlign)) {\r\n compiler.error(\r\n DiagnosticCode._0_must_be_a_power_of_two,\r\n operands[3].range, \"Alignment\"\r\n );\r\n compiler.currentType = Type.void;\r\n return module.unreachable();\r\n }\r\n } else {\r\n immAlign = naturalAlign;\r\n }\r\n compiler.currentType = Type.void;\r\n return module.store(type.byteSize, arg0, arg1, inType.toNativeType(), immOffset, immAlign);\r\n }\r\n\r\n // === Atomics ================================================================================\r\n\r\n case BuiltinSymbols.atomic_load: { // load(offset: usize, immOffset?: usize) -> T*\r\n if (!compiler.options.hasFeature(Feature.THREADS)) break;\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler, true) |\r\n checkArgsOptional(operands, 1, 2, reportNode, compiler)\r\n ) return module.unreachable();\r\n let type = typeArguments![0];\r\n let outType = (\r\n type.is(TypeFlags.INTEGER) &&\r\n contextualType.is(TypeFlags.INTEGER) &&\r\n contextualType.size > type.size\r\n ) ? contextualType : type;\r\n if (!type.is(TypeFlags.INTEGER)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n compiler.currentType = outType;\r\n return module.unreachable();\r\n }\r\n let arg0 = compiler.compileExpression(operands[0],\r\n compiler.options.usizeType,\r\n ContextualFlags.IMPLICIT\r\n );\r\n let immOffset = operands.length == 2 ? evaluateImmediateOffset(operands[1], compiler) : 0; // reports\r\n if (immOffset < 0) {\r\n compiler.currentType = outType;\r\n return module.unreachable();\r\n }\r\n compiler.currentType = outType;\r\n return module.atomic_load(\r\n type.byteSize,\r\n arg0,\r\n outType.toNativeType(),\r\n immOffset\r\n );\r\n }\r\n case BuiltinSymbols.atomic_store: { // store(offset: usize, value: T*, immOffset?: usize) -> void\r\n if (!compiler.options.hasFeature(Feature.THREADS)) break;\r\n compiler.currentType = Type.void;\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler) |\r\n checkArgsOptional(operands, 2, 3, reportNode, compiler)\r\n ) return module.unreachable();\r\n let type = typeArguments![0];\r\n if (!type.is(TypeFlags.INTEGER) || type.size < 8) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.unreachable();\r\n }\r\n let arg0 = compiler.compileExpression(operands[0],\r\n compiler.options.usizeType,\r\n ContextualFlags.IMPLICIT\r\n );\r\n let arg1 = isAsm\r\n ? compiler.compileExpression(\r\n operands[1],\r\n contextualType,\r\n ContextualFlags.IMPLICIT\r\n )\r\n : compiler.compileExpression(\r\n operands[1],\r\n type,\r\n type.is(TypeFlags.INTEGER)\r\n ? ContextualFlags.NONE // no need to convert to small int (but now might result in a float)\r\n : ContextualFlags.IMPLICIT\r\n );\r\n let inType = compiler.currentType;\r\n if (\r\n type.is(TypeFlags.INTEGER) &&\r\n (\r\n !inType.is(TypeFlags.INTEGER) || // float to int\r\n inType.size < type.size // int to larger int (clear garbage bits)\r\n )\r\n ) {\r\n arg1 = compiler.convertExpression(arg1,\r\n inType, type,\r\n false, false, // still clears garbage bits when not wrapping\r\n operands[1]\r\n );\r\n inType = type;\r\n }\r\n let immOffset = operands.length == 3 ? evaluateImmediateOffset(operands[2], compiler) : 0; // reports\r\n if (immOffset < 0) {\r\n compiler.currentType = Type.void;\r\n return module.unreachable();\r\n }\r\n compiler.currentType = Type.void;\r\n return module.atomic_store(type.byteSize, arg0, arg1, inType.toNativeType(), immOffset);\r\n }\r\n case BuiltinSymbols.atomic_add: // any_atomic_binary(ptr, value: T, immOffset?: usize) -> T\r\n case BuiltinSymbols.atomic_sub:\r\n case BuiltinSymbols.atomic_and:\r\n case BuiltinSymbols.atomic_or:\r\n case BuiltinSymbols.atomic_xor:\r\n case BuiltinSymbols.atomic_xchg: {\r\n if (!compiler.options.hasFeature(Feature.THREADS)) break;\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler, true) |\r\n checkArgsOptional(operands, 2, 3, reportNode, compiler)\r\n ) return module.unreachable();\r\n let type = typeArguments![0];\r\n if (!type.is(TypeFlags.INTEGER) || type.size < 8) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.unreachable();\r\n }\r\n let arg0 = compiler.compileExpression(operands[0],\r\n compiler.options.usizeType,\r\n ContextualFlags.IMPLICIT\r\n );\r\n let arg1 = isAsm\r\n ? compiler.compileExpression(operands[1],\r\n contextualType,\r\n ContextualFlags.IMPLICIT\r\n )\r\n : compiler.compileExpression(\r\n operands[1],\r\n type,\r\n type.is(TypeFlags.INTEGER)\r\n ? ContextualFlags.NONE // no need to convert to small int (but now might result in a float)\r\n : ContextualFlags.IMPLICIT\r\n );\r\n let inType = compiler.currentType;\r\n if (\r\n type.is(TypeFlags.INTEGER) &&\r\n (\r\n !inType.is(TypeFlags.INTEGER) || // float to int\r\n inType.size < type.size // int to larger int (clear garbage bits)\r\n )\r\n ) {\r\n arg1 = compiler.convertExpression(arg1,\r\n inType, type,\r\n false, false, // still clears garbage bits when not wrapping\r\n operands[1]\r\n );\r\n inType = type;\r\n }\r\n let immOffset = operands.length == 3 ? evaluateImmediateOffset(operands[2], compiler) : 0; // reports\r\n if (immOffset < 0) {\r\n compiler.currentType = inType;\r\n return module.unreachable();\r\n }\r\n let op: AtomicRMWOp;\r\n switch (prototype.internalName) {\r\n default: assert(false);\r\n case BuiltinSymbols.atomic_add: { op = AtomicRMWOp.Add; break; }\r\n case BuiltinSymbols.atomic_sub: { op = AtomicRMWOp.Sub; break; }\r\n case BuiltinSymbols.atomic_and: { op = AtomicRMWOp.And; break; }\r\n case BuiltinSymbols.atomic_or: { op = AtomicRMWOp.Or; break; }\r\n case BuiltinSymbols.atomic_xor: { op = AtomicRMWOp.Xor; break; }\r\n case BuiltinSymbols.atomic_xchg: { op = AtomicRMWOp.Xchg; break; }\r\n }\r\n compiler.currentType = inType;\r\n return module.atomic_rmw(\r\n op, type.byteSize, immOffset, arg0, arg1, inType.toNativeType()\r\n );\r\n }\r\n case BuiltinSymbols.atomic_cmpxchg: { // cmpxchg(ptr: usize, expected: T, replacement: T, off?: usize): T\r\n if (!compiler.options.hasFeature(Feature.THREADS)) break;\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler, true) |\r\n checkArgsOptional(operands, 3, 4, reportNode, compiler)\r\n ) return module.unreachable();\r\n let type = typeArguments![0];\r\n if (!type.is(TypeFlags.INTEGER) || type.size < 8) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.unreachable();\r\n }\r\n let arg0 = compiler.compileExpression(operands[0],\r\n compiler.options.usizeType,\r\n ContextualFlags.IMPLICIT\r\n );\r\n let arg1 = isAsm\r\n ? compiler.compileExpression(operands[1],\r\n contextualType,\r\n ContextualFlags.IMPLICIT\r\n )\r\n : compiler.compileExpression(\r\n operands[1],\r\n type,\r\n type.is(TypeFlags.INTEGER)\r\n ? ContextualFlags.NONE // no need to convert to small int (but now might result in a float)\r\n : ContextualFlags.IMPLICIT\r\n );\r\n let inType = compiler.currentType;\r\n let arg2 = compiler.compileExpression(operands[2],\r\n inType,\r\n ContextualFlags.IMPLICIT\r\n );\r\n if (\r\n type.is(TypeFlags.INTEGER) &&\r\n (\r\n !inType.is(TypeFlags.INTEGER) || // float to int\r\n inType.size < type.size // int to larger int (clear garbage bits)\r\n )\r\n ) {\r\n arg1 = compiler.convertExpression(arg1,\r\n inType, type,\r\n false, false, // still clears garbage bits when not wrapping\r\n operands[1]\r\n );\r\n arg2 = compiler.convertExpression(arg2,\r\n inType, type,\r\n false, false, // still clears garbage bits when not wrapping\r\n operands[2]\r\n );\r\n inType = type;\r\n }\r\n let immOffset = operands.length == 4 ? evaluateImmediateOffset(operands[3], compiler) : 0; // reports\r\n if (immOffset < 0) {\r\n compiler.currentType = inType;\r\n return module.unreachable();\r\n }\r\n compiler.currentType = inType;\r\n return module.atomic_cmpxchg(\r\n type.byteSize, immOffset, arg0, arg1, arg2, inType.toNativeType()\r\n );\r\n }\r\n case BuiltinSymbols.atomic_wait: { // wait(ptr: usize, expected: T, timeout: i64): i32;\r\n if (!compiler.options.hasFeature(Feature.THREADS)) break;\r\n compiler.currentType = Type.i32;\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler) |\r\n checkArgsRequired(operands, 3, reportNode, compiler)\r\n ) return module.unreachable();\r\n let type = typeArguments![0];\r\n if (!type.is(TypeFlags.INTEGER) || type.size < 32) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.unreachable();\r\n }\r\n let arg0 = compiler.compileExpression(operands[0],\r\n compiler.options.usizeType,\r\n ContextualFlags.IMPLICIT\r\n );\r\n let arg1 = compiler.compileExpression(operands[1], type,\r\n ContextualFlags.IMPLICIT\r\n );\r\n let arg2 = compiler.compileExpression(operands[2],\r\n Type.i64,\r\n ContextualFlags.IMPLICIT\r\n );\r\n compiler.currentType = Type.i32;\r\n return module.atomic_wait(arg0, arg1, arg2, type.toNativeType());\r\n }\r\n case BuiltinSymbols.atomic_notify: { // notify(ptr: usize, count: i32): i32;\r\n if (!compiler.options.hasFeature(Feature.THREADS)) break;\r\n compiler.currentType = Type.i32;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 2, reportNode, compiler)\r\n ) return module.unreachable();\r\n let arg0 = compiler.compileExpression(operands[0],\r\n compiler.options.usizeType,\r\n ContextualFlags.IMPLICIT\r\n );\r\n let arg1 = compiler.compileExpression(operands[1],\r\n Type.i32,\r\n ContextualFlags.IMPLICIT\r\n );\r\n compiler.currentType = Type.i32;\r\n return module.atomic_notify(arg0, arg1);\r\n }\r\n\r\n // === Control flow ===========================================================================\r\n\r\n case BuiltinSymbols.select: { // select(ifTrue: T, ifFalse: T, condition: bool) -> T\r\n if (\r\n checkTypeOptional(typeArguments, reportNode, compiler, true) |\r\n checkArgsRequired(operands, 3, reportNode, compiler)\r\n ) return module.unreachable();\r\n let arg0 = typeArguments\r\n ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT)\r\n : compiler.compileExpressionRetainType(operands[0], Type.i32);\r\n let type = compiler.currentType;\r\n if (!type.isAny(TypeFlags.VALUE | TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.unreachable();\r\n }\r\n let arg1 = compiler.compileExpression(operands[1], type, ContextualFlags.IMPLICIT);\r\n let arg2 = compiler.makeIsTrueish(\r\n compiler.compileExpressionRetainType(operands[2], Type.bool),\r\n compiler.currentType // ^\r\n );\r\n compiler.currentType = type;\r\n return module.select(arg0, arg1, arg2);\r\n }\r\n case BuiltinSymbols.unreachable: { // unreachable() -> *\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.typeArgumentsRange, prototype.internalName\r\n );\r\n }\r\n checkArgsRequired(operands, 0, reportNode, compiler);\r\n return module.unreachable();\r\n }\r\n\r\n // === Memory =================================================================================\r\n\r\n case BuiltinSymbols.memory_size: { // memory.size() -> i32\r\n compiler.currentType = Type.i32;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 0, reportNode, compiler)\r\n ) return module.unreachable();\r\n return module.host(HostOp.MemorySize);\r\n }\r\n case BuiltinSymbols.memory_grow: { // memory.grow(pages: i32) -> i32\r\n compiler.currentType = Type.i32;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) return module.unreachable();\r\n return module.host(HostOp.MemoryGrow, null, [\r\n compiler.compileExpression(operands[0], Type.i32, ContextualFlags.IMPLICIT)\r\n ]);\r\n }\r\n case BuiltinSymbols.memory_copy: { // memory.copy(dest: usize, src: usize: n: usize) -> void\r\n compiler.currentType = Type.void;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 3, reportNode, compiler)\r\n ) return module.unreachable();\r\n if (!compiler.options.hasFeature(Feature.BULK_MEMORY)) {\r\n let instance = compiler.resolver.resolveFunction(prototype, null); // reports\r\n compiler.currentType = Type.void;\r\n if (!instance) return module.unreachable();\r\n return compiler.compileCallDirect(instance, operands, reportNode);\r\n }\r\n let usizeType = compiler.options.usizeType;\r\n let arg0 = compiler.compileExpression(operands[0], usizeType, ContextualFlags.IMPLICIT);\r\n let arg1 = compiler.compileExpression(operands[1], usizeType, ContextualFlags.IMPLICIT);\r\n let arg2 = compiler.compileExpression(operands[2], usizeType, ContextualFlags.IMPLICIT);\r\n compiler.currentType = Type.void;\r\n return module.memory_copy(arg0, arg1, arg2);\r\n }\r\n case BuiltinSymbols.memory_fill: { // memory.fill(dest: usize, value: u8, n: usize) -> void\r\n compiler.currentType = Type.void;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 3, reportNode, compiler)\r\n ) return module.unreachable();\r\n if (!compiler.options.hasFeature(Feature.BULK_MEMORY)) {\r\n let instance = compiler.resolver.resolveFunction(prototype, null); // reports\r\n compiler.currentType = Type.void;\r\n if (!instance) return module.unreachable();\r\n return compiler.compileCallDirect(instance, operands, reportNode);\r\n }\r\n let usizeType = compiler.options.usizeType;\r\n let arg0 = compiler.compileExpression(operands[0], usizeType, ContextualFlags.IMPLICIT);\r\n let arg1 = compiler.compileExpression(operands[1], Type.u8, ContextualFlags.IMPLICIT);\r\n let arg2 = compiler.compileExpression(operands[2], usizeType, ContextualFlags.IMPLICIT);\r\n compiler.currentType = Type.void;\r\n return module.memory_fill(arg0, arg1, arg2);\r\n }\r\n\r\n // === Helpers ================================================================================\r\n\r\n case BuiltinSymbols.changetype: { // changetype(value: *) -> T\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler, true) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) return module.unreachable();\r\n let toType = typeArguments![0];\r\n let arg0 = compiler.compileExpressionRetainType(operands[0], toType);\r\n let fromType = compiler.currentType;\r\n compiler.currentType = toType;\r\n if (fromType.size != toType.size) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n return module.unreachable();\r\n }\r\n return arg0;\r\n }\r\n case BuiltinSymbols.assert: { // assert(isTrueish: T, message?: string) -> T{!= null}\r\n if (\r\n checkTypeOptional(typeArguments, reportNode, compiler) |\r\n checkArgsOptional(operands, 1, 2, reportNode, compiler)\r\n ) {\r\n if (typeArguments) {\r\n assert(typeArguments.length); // otherwise invalid, should not been set at all\r\n compiler.currentType = typeArguments[0].nonNullableType;\r\n }\r\n return module.unreachable();\r\n }\r\n let arg0 = typeArguments\r\n ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT | ContextualFlags.WRAP)\r\n : compiler.compileExpressionRetainType(operands[0], Type.bool, ContextualFlags.WRAP);\r\n let type = compiler.currentType;\r\n compiler.currentType = type.nonNullableType;\r\n\r\n // return ifTrueish if assertions are disabled\r\n if (compiler.options.noAssert) {\r\n if (contextualType == Type.void) { // simplify if dropped anyway\r\n compiler.currentType = Type.void;\r\n return module.nop();\r\n }\r\n return arg0;\r\n }\r\n\r\n // otherwise call abort if the assertion is false-ish\r\n let abort = compileAbort(compiler, operands.length == 2 ? operands[1] : null, reportNode);\r\n compiler.currentType = type.nonNullableType;\r\n let expr: ExpressionRef;\r\n if (contextualType == Type.void) { // simplify if dropped anyway\r\n compiler.currentType = Type.void;\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: {\r\n expr = module.if(\r\n module.unary(UnaryOp.EqzI32, arg0),\r\n abort\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n expr = module.if(\r\n module.unary(UnaryOp.EqzI64, arg0),\r\n abort\r\n );\r\n break;\r\n }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n expr = module.if(\r\n module.unary(\r\n compiler.options.isWasm64\r\n ? UnaryOp.EqzI64\r\n : UnaryOp.EqzI32,\r\n arg0\r\n ),\r\n abort\r\n );\r\n break;\r\n }\r\n // TODO: also check for NaN in float assertions, as in `Boolean(NaN) -> false`?\r\n case TypeKind.F32: {\r\n expr = module.if(\r\n module.binary(BinaryOp.EqF32,\r\n arg0,\r\n module.f32(0)\r\n ),\r\n abort\r\n );\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n expr = module.if(\r\n module.binary(BinaryOp.EqF64,\r\n arg0,\r\n module.f64(0)\r\n ),\r\n abort\r\n );\r\n break;\r\n }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n expr = abort;\r\n break;\r\n }\r\n }\r\n } else {\r\n compiler.currentType = type.nonNullableType;\r\n switch (compiler.currentType.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.BOOL: {\r\n let flow = compiler.currentFlow;\r\n let tempLocal = flow.getAndFreeTempLocal(type);\r\n flow.setLocalFlag(tempLocal.index, LocalFlags.WRAPPED); // arg0 is wrapped\r\n expr = module.if(\r\n module.local_tee(tempLocal.index, arg0),\r\n module.local_get(tempLocal.index, NativeType.I32),\r\n abort\r\n );\r\n break;\r\n }\r\n case TypeKind.I64:\r\n case TypeKind.U64: {\r\n let tempLocal = compiler.currentFlow.getAndFreeTempLocal(Type.i64);\r\n expr = module.if(\r\n module.unary(UnaryOp.EqzI64,\r\n module.local_tee(tempLocal.index, arg0)\r\n ),\r\n abort,\r\n module.local_get(tempLocal.index, NativeType.I64)\r\n );\r\n break;\r\n }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n let tempLocal = compiler.currentFlow.getAndFreeTempLocal(compiler.options.usizeType);\r\n expr = module.if(\r\n module.unary(\r\n compiler.options.isWasm64\r\n ? UnaryOp.EqzI64\r\n : UnaryOp.EqzI32,\r\n module.local_tee(tempLocal.index, arg0)\r\n ),\r\n abort,\r\n module.local_get(tempLocal.index, compiler.options.nativeSizeType)\r\n );\r\n break;\r\n }\r\n case TypeKind.F32: {\r\n let tempLocal = compiler.currentFlow.getAndFreeTempLocal(Type.f32);\r\n expr = module.if(\r\n module.binary(BinaryOp.EqF32,\r\n module.local_tee(tempLocal.index, arg0),\r\n module.f32(0)\r\n ),\r\n abort,\r\n module.local_get(tempLocal.index, NativeType.F32)\r\n );\r\n break;\r\n }\r\n case TypeKind.F64: {\r\n let tempLocal = compiler.currentFlow.getAndFreeTempLocal(Type.f64);\r\n expr = module.if(\r\n module.binary(BinaryOp.EqF64,\r\n module.local_tee(tempLocal.index, arg0),\r\n module.f64(0)\r\n ),\r\n abort,\r\n module.local_get(tempLocal.index, NativeType.F64)\r\n );\r\n break;\r\n }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n expr = abort;\r\n break;\r\n }\r\n }\r\n }\r\n return expr;\r\n }\r\n case BuiltinSymbols.unchecked: { // unchecked(expr: *) -> *\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) return module.unreachable();\r\n let flow = compiler.currentFlow;\r\n let alreadyUnchecked = flow.is(FlowFlags.UNCHECKED_CONTEXT);\r\n flow.set(FlowFlags.UNCHECKED_CONTEXT);\r\n // eliminate unnecessary tees by preferring contextualType(=void):\r\n let expr = compiler.compileExpression(operands[0], contextualType);\r\n if (!alreadyUnchecked) flow.unset(FlowFlags.UNCHECKED_CONTEXT);\r\n return expr;\r\n }\r\n case BuiltinSymbols.call_direct: directize = true;\r\n case BuiltinSymbols.call_indirect: { // call_indirect(target: Function | u32, ...args: *[]) -> T\r\n if (\r\n checkTypeOptional(typeArguments, reportNode, compiler, true) |\r\n checkArgsOptional(operands, 1, i32.MAX_VALUE, reportNode, compiler)\r\n ) return module.unreachable();\r\n let returnType = typeArguments ? typeArguments[0] : contextualType;\r\n let arg0 = compiler.compileExpressionRetainType(operands[0], Type.u32);\r\n let arg0Type = compiler.currentType;\r\n if (!(\r\n arg0Type == Type.u32 || // either plain index\r\n arg0Type.kind == TypeKind.U32 && arg0Type.signatureReference // or function reference\r\n )) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n operands[0].range\r\n );\r\n return module.unreachable();\r\n }\r\n let numOperands = operands.length - 1;\r\n let operandExprs = new Array(numOperands);\r\n let nativeReturnType = returnType.toNativeType();\r\n let parameterTypes = new Array(numOperands);\r\n let nativeParamTypes = new Array(numOperands);\r\n for (let i = 0; i < numOperands; ++i) {\r\n operandExprs[i] = compiler.compileExpressionRetainType(operands[1 + i], Type.i32);\r\n let operandType = compiler.currentType;\r\n parameterTypes[i] = operandType;\r\n nativeParamTypes[i] = operandType.toNativeType();\r\n }\r\n let typeName = Signature.makeSignatureString(parameterTypes, returnType);\r\n let typeRef = module.getFunctionTypeBySignature(nativeReturnType, nativeParamTypes);\r\n if (!typeRef) typeRef = module.addFunctionType(typeName, nativeReturnType, nativeParamTypes);\r\n compiler.currentType = returnType;\r\n if (directize) {\r\n // if the index expression is precomputable to a constant value, emit a direct call\r\n if (getExpressionId(arg0 = module.precomputeExpression(arg0)) == ExpressionId.Const) {\r\n assert(getExpressionType(arg0) == NativeType.I32);\r\n let index = getConstValueI32(arg0);\r\n let functionTable = compiler.functionTable;\r\n if (index >= 0 && index < functionTable.length) {\r\n return module.call(functionTable[index], operandExprs, nativeReturnType);\r\n }\r\n }\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n operands[0].range\r\n );\r\n return module.unreachable();\r\n }\r\n // of course this can easily result in a 'RuntimeError: function signature mismatch' trap and\r\n // thus must be used with care. it exists because it *might* be useful in specific scenarios.\r\n return module.call_indirect(arg0, operandExprs, typeName);\r\n }\r\n case BuiltinSymbols.instantiate: { // instantiate(...args: *[]) -> T\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler, true)\r\n ) return module.unreachable();\r\n let classInstance = typeArguments![0].classReference;\r\n if (!classInstance) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.unreachable();\r\n }\r\n compiler.currentType = classInstance.type;\r\n return compiler.compileInstantiate(classInstance, operands, ContextualFlags.NONE, reportNode);\r\n }\r\n\r\n // === User-defined diagnostics ===============================================================\r\n\r\n case BuiltinSymbols.ERROR: {\r\n checkTypeAbsent(typeArguments, reportNode, prototype);\r\n compiler.error(\r\n DiagnosticCode.User_defined_0,\r\n reportNode.range, (operands.length ? operands[0] : reportNode).range.toString()\r\n );\r\n return module.unreachable();\r\n }\r\n case BuiltinSymbols.WARNING: {\r\n checkTypeAbsent(typeArguments, reportNode, prototype);\r\n compiler.warning(\r\n DiagnosticCode.User_defined_0,\r\n reportNode.range, (operands.length ? operands[0] : reportNode).range.toString()\r\n );\r\n return module.nop();\r\n }\r\n case BuiltinSymbols.INFO: {\r\n checkTypeAbsent(typeArguments, reportNode, prototype);\r\n compiler.info(\r\n DiagnosticCode.User_defined_0,\r\n reportNode.range, (operands.length ? operands[0] : reportNode).range.toString()\r\n );\r\n return module.nop();\r\n }\r\n\r\n // === Portable type conversions ==============================================================\r\n\r\n case BuiltinSymbols.i8: {\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.i8;\r\n return module.unreachable();\r\n }\r\n return compiler.compileExpression(operands[0], Type.i8, ContextualFlags.EXPLICIT);\r\n }\r\n case BuiltinSymbols.i16: {\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.i16;\r\n return module.unreachable();\r\n }\r\n return compiler.compileExpression(operands[0], Type.i16, ContextualFlags.EXPLICIT);\r\n }\r\n case BuiltinSymbols.i32: {\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.i32;\r\n return module.unreachable();\r\n }\r\n return compiler.compileExpression(operands[0], Type.i32, ContextualFlags.EXPLICIT);\r\n }\r\n case BuiltinSymbols.i64: {\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.i64;\r\n return module.unreachable();\r\n }\r\n return compiler.compileExpression(operands[0], Type.i64, ContextualFlags.EXPLICIT);\r\n }\r\n case BuiltinSymbols.isize: {\r\n let isizeType = compiler.options.isizeType;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) {\r\n compiler.currentType = isizeType;\r\n return module.unreachable();\r\n }\r\n return compiler.compileExpression(operands[0], isizeType, ContextualFlags.EXPLICIT);\r\n }\r\n case BuiltinSymbols.u8: {\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.u8;\r\n return module.unreachable();\r\n }\r\n return compiler.compileExpression(operands[0], Type.u8, ContextualFlags.EXPLICIT);\r\n }\r\n case BuiltinSymbols.u16: {\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.u16;\r\n return module.unreachable();\r\n }\r\n return compiler.compileExpression(operands[0], Type.u16, ContextualFlags.EXPLICIT);\r\n }\r\n case BuiltinSymbols.u32: {\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.u32;\r\n return module.unreachable();\r\n }\r\n return compiler.compileExpression(operands[0], Type.u32, ContextualFlags.EXPLICIT);\r\n }\r\n case BuiltinSymbols.u64: {\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.u64;\r\n return module.unreachable();\r\n }\r\n return compiler.compileExpression(operands[0], Type.u64, ContextualFlags.EXPLICIT);\r\n }\r\n case BuiltinSymbols.usize: {\r\n let usizeType = compiler.options.usizeType;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) {\r\n compiler.currentType = usizeType;\r\n return module.unreachable();\r\n }\r\n return compiler.compileExpression(operands[0], usizeType, ContextualFlags.EXPLICIT);\r\n }\r\n case BuiltinSymbols.bool: {\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.bool;\r\n return module.unreachable();\r\n }\r\n return compiler.compileExpression(operands[0], Type.bool, ContextualFlags.EXPLICIT);\r\n }\r\n case BuiltinSymbols.f32: {\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.f32;\r\n return module.unreachable();\r\n }\r\n return compiler.compileExpression(operands[0], Type.f32, ContextualFlags.EXPLICIT);\r\n }\r\n case BuiltinSymbols.f64: {\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.f64;\r\n return module.unreachable();\r\n }\r\n return compiler.compileExpression(operands[0], Type.f64, ContextualFlags.EXPLICIT);\r\n }\r\n\r\n // === SIMD ===================================================================================\r\n\r\n case BuiltinSymbols.v128: // alias for now\r\n case BuiltinSymbols.i8x16: {\r\n if (!compiler.options.hasFeature(Feature.SIMD)) break;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 16, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n let bytes = new Uint8Array(16);\r\n for (let i = 0; i < 16; ++i) {\r\n let value = operands[i];\r\n if (value) {\r\n let expr = compiler.precomputeExpression(value, Type.i8, ContextualFlags.IMPLICIT);\r\n if (getExpressionId(expr) != ExpressionId.Const) {\r\n compiler.error(\r\n DiagnosticCode.Expression_must_be_a_compile_time_constant,\r\n value.range\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n assert(getExpressionType(expr) == NativeType.I32);\r\n writeI8(getConstValueI32(expr), bytes, i);\r\n }\r\n }\r\n compiler.currentType = Type.v128;\r\n return module.v128(bytes);\r\n }\r\n case BuiltinSymbols.i16x8: {\r\n if (!compiler.options.hasFeature(Feature.SIMD)) break;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 8, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n let bytes = new Uint8Array(16);\r\n for (let i = 0; i < 8; ++i) {\r\n let value = operands[i];\r\n if (value) {\r\n let expr = compiler.precomputeExpression(value, Type.i16, ContextualFlags.IMPLICIT);\r\n if (getExpressionId(expr) != ExpressionId.Const) {\r\n compiler.error(\r\n DiagnosticCode.Expression_must_be_a_compile_time_constant,\r\n value.range\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n assert(getExpressionType(expr) == NativeType.I32);\r\n writeI16(getConstValueI32(expr), bytes, i << 1);\r\n }\r\n }\r\n compiler.currentType = Type.v128;\r\n return module.v128(bytes);\r\n }\r\n case BuiltinSymbols.i32x4: {\r\n if (!compiler.options.hasFeature(Feature.SIMD)) break;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 4, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n let bytes = new Uint8Array(16);\r\n for (let i = 0; i < 4; ++i) {\r\n let value = operands[i];\r\n if (value) {\r\n let expr = compiler.precomputeExpression(value, Type.i32, ContextualFlags.IMPLICIT);\r\n if (getExpressionId(expr) != ExpressionId.Const) {\r\n compiler.error(\r\n DiagnosticCode.Expression_must_be_a_compile_time_constant,\r\n value.range\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n assert(getExpressionType(expr) == NativeType.I32);\r\n writeI32(getConstValueI32(expr), bytes, i << 2);\r\n }\r\n }\r\n compiler.currentType = Type.v128;\r\n return module.v128(bytes);\r\n }\r\n case BuiltinSymbols.i64x2: {\r\n if (!compiler.options.hasFeature(Feature.SIMD)) break;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 2, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n let bytes = new Uint8Array(16);\r\n for (let i = 0; i < 2; ++i) {\r\n let value = operands[i];\r\n if (value) {\r\n let expr = compiler.precomputeExpression(value, Type.i64, ContextualFlags.IMPLICIT);\r\n if (getExpressionId(expr) != ExpressionId.Const) {\r\n compiler.error(\r\n DiagnosticCode.Expression_must_be_a_compile_time_constant,\r\n value.range\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n assert(getExpressionType(expr) == NativeType.I64);\r\n let off = i << 3;\r\n writeI32(getConstValueI64Low(expr), bytes, off);\r\n writeI32(getConstValueI64High(expr), bytes, off + 4);\r\n }\r\n }\r\n compiler.currentType = Type.v128;\r\n return module.v128(bytes);\r\n }\r\n case BuiltinSymbols.f32x4: {\r\n if (!compiler.options.hasFeature(Feature.SIMD)) break;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 4, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n let bytes = new Uint8Array(16);\r\n for (let i = 0; i < 4; ++i) {\r\n let value = operands[i];\r\n if (value) {\r\n let expr = compiler.precomputeExpression(value, Type.f32, ContextualFlags.IMPLICIT);\r\n if (getExpressionId(expr) != ExpressionId.Const) {\r\n compiler.error(\r\n DiagnosticCode.Expression_must_be_a_compile_time_constant,\r\n value.range\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n assert(getExpressionType(expr) == NativeType.F32);\r\n writeF32(getConstValueF32(expr), bytes, i << 2);\r\n }\r\n }\r\n compiler.currentType = Type.v128;\r\n return module.v128(bytes);\r\n }\r\n case BuiltinSymbols.f64x2: {\r\n if (!compiler.options.hasFeature(Feature.SIMD)) break;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 2, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n let bytes = new Uint8Array(16);\r\n for (let i = 0; i < 2; ++i) {\r\n let value = operands[i];\r\n if (value) {\r\n let expr = compiler.precomputeExpression(value, Type.f64, ContextualFlags.IMPLICIT);\r\n if (getExpressionId(expr) != ExpressionId.Const) {\r\n compiler.error(\r\n DiagnosticCode.Expression_must_be_a_compile_time_constant,\r\n value.range\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n assert(getExpressionType(expr) == NativeType.F64);\r\n writeF64(getConstValueF64(expr), bytes, i << 3);\r\n }\r\n }\r\n compiler.currentType = Type.v128;\r\n return module.v128(bytes);\r\n }\r\n case BuiltinSymbols.v128_splat: { // splat(x: T) -> v128\r\n if (!compiler.options.hasFeature(Feature.SIMD)) break;\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n let type = typeArguments![0];\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n let op: UnaryOp;\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.U8: { op = UnaryOp.SplatVecI8x16; break; }\r\n case TypeKind.I16:\r\n case TypeKind.U16: { op = UnaryOp.SplatVecI16x8; break; }\r\n case TypeKind.I32:\r\n case TypeKind.U32: { op = UnaryOp.SplatVecI32x4; break; }\r\n case TypeKind.I64:\r\n case TypeKind.U64: { op = UnaryOp.SplatVecI64x2; break; }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n op = compiler.options.isWasm64\r\n ? UnaryOp.SplatVecI64x2\r\n : UnaryOp.SplatVecI32x4;\r\n break;\r\n }\r\n case TypeKind.F32: { op = UnaryOp.SplatVecF32x4; break; }\r\n case TypeKind.F64: { op = UnaryOp.SplatVecF64x2; break; }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n }\r\n let arg0 = compiler.compileExpression(operands[0], type, ContextualFlags.IMPLICIT);\r\n compiler.currentType = Type.v128;\r\n return module.unary(op, arg0);\r\n }\r\n case BuiltinSymbols.v128_extract_lane: { // extract_lane(x: v128, idx: u8) -> T\r\n if (!compiler.options.hasFeature(Feature.SIMD)) break;\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler, true) |\r\n checkArgsRequired(operands, 2, reportNode, compiler)\r\n ) return module.unreachable();\r\n let type = typeArguments![0];\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n compiler.currentType = type;\r\n return module.unreachable();\r\n }\r\n let op: SIMDExtractOp;\r\n switch (type.kind) {\r\n case TypeKind.I8: { op = SIMDExtractOp.ExtractLaneSVecI8x16; break; }\r\n case TypeKind.U8: { op = SIMDExtractOp.ExtractLaneUVecI8x16; break; }\r\n case TypeKind.I16: { op = SIMDExtractOp.ExtractLaneSVecI16x8; break; }\r\n case TypeKind.U16: { op = SIMDExtractOp.ExtractLaneUVecI16x8; break; }\r\n case TypeKind.I32:\r\n case TypeKind.U32: { op = SIMDExtractOp.ExtractLaneVecI32x4; break; }\r\n case TypeKind.I64:\r\n case TypeKind.U64: { op = SIMDExtractOp.ExtractLaneVecI64x2; break; }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n op = compiler.options.isWasm64\r\n ? SIMDExtractOp.ExtractLaneVecI64x2\r\n : SIMDExtractOp.ExtractLaneVecI32x4;\r\n break;\r\n }\r\n case TypeKind.F32: { op = SIMDExtractOp.ExtractLaneVecF32x4; break; }\r\n case TypeKind.F64: { op = SIMDExtractOp.ExtractLaneVecF64x2; break; }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n compiler.currentType = type;\r\n return module.unreachable();\r\n }\r\n }\r\n let arg0 = compiler.compileExpression(operands[0], Type.v128, ContextualFlags.IMPLICIT);\r\n let arg1 = compiler.precomputeExpression(operands[1], Type.u8, ContextualFlags.IMPLICIT);\r\n compiler.currentType = type;\r\n if (getExpressionId(arg1) != ExpressionId.Const) {\r\n compiler.error(\r\n DiagnosticCode.Expression_must_be_a_compile_time_constant,\r\n operands[1].range\r\n );\r\n return module.unreachable();\r\n }\r\n assert(getExpressionType(arg1) == NativeType.I32);\r\n let maxIdx = (16 / type.byteSize) - 1;\r\n let idx = getConstValueI32(arg1);\r\n if (idx < 0 || idx > maxIdx) {\r\n compiler.error(\r\n DiagnosticCode._0_must_be_a_value_between_1_and_2_inclusive,\r\n operands[1].range, \"Lane index\", \"0\", maxIdx.toString()\r\n );\r\n return module.unreachable();\r\n }\r\n return module.simd_extract(op, arg0, idx);\r\n }\r\n case BuiltinSymbols.v128_replace_lane: { // replace_lane(x: v128, idx: u8, value: T) -> v128\r\n if (!compiler.options.hasFeature(Feature.SIMD)) break;\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler) |\r\n checkArgsRequired(operands, 3, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n let type = typeArguments![0];\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n let op: SIMDReplaceOp;\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.U8: { op = SIMDReplaceOp.ReplaceLaneVecI8x16; break; }\r\n case TypeKind.I16:\r\n case TypeKind.U16: { op = SIMDReplaceOp.ReplaceLaneVecI16x8; break; }\r\n case TypeKind.I32:\r\n case TypeKind.U32: { op = SIMDReplaceOp.ReplaceLaneVecI32x4; break; }\r\n case TypeKind.I64:\r\n case TypeKind.U64: { op = SIMDReplaceOp.ReplaceLaneVecI64x2; break; }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n op = compiler.options.isWasm64\r\n ? SIMDReplaceOp.ReplaceLaneVecI64x2\r\n : SIMDReplaceOp.ReplaceLaneVecI32x4;\r\n break;\r\n }\r\n case TypeKind.F32: { op = SIMDReplaceOp.ReplaceLaneVecF32x4; break; }\r\n case TypeKind.F64: { op = SIMDReplaceOp.ReplaceLaneVecF64x2; break; }\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n }\r\n let arg0 = compiler.compileExpression(operands[0], Type.v128, ContextualFlags.IMPLICIT);\r\n let arg1 = compiler.precomputeExpression(operands[1], Type.u8, ContextualFlags.IMPLICIT);\r\n if (getExpressionId(arg1) != ExpressionId.Const) {\r\n compiler.error(\r\n DiagnosticCode.Expression_must_be_a_compile_time_constant,\r\n operands[1].range\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n assert(getExpressionType(arg1) == NativeType.I32);\r\n let maxIdx = (16 / type.byteSize) - 1;\r\n let idx = getConstValueI32(arg1);\r\n if (idx < 0 || idx > maxIdx) {\r\n compiler.error(\r\n DiagnosticCode._0_must_be_a_value_between_1_and_2_inclusive,\r\n operands[1].range, \"Lane index\", \"0\", maxIdx.toString()\r\n );\r\n return module.unreachable();\r\n }\r\n let arg2 = compiler.compileExpression(operands[2], type, ContextualFlags.IMPLICIT);\r\n compiler.currentType = Type.v128;\r\n return module.simd_replace(op, arg0, idx, arg2);\r\n }\r\n case BuiltinSymbols.v128_shuffle: { // shuffle(a: v128, b: v128, ...lanes: u8[]) -> v128\r\n if (!compiler.options.hasFeature(Feature.SIMD)) break;\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n let type = typeArguments![0];\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n let laneWidth = type.byteSize;\r\n let laneCount = 16 / laneWidth;\r\n assert(isInteger(laneCount) && isPowerOf2(laneCount));\r\n if (\r\n checkArgsRequired(operands, 2 + laneCount, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.I16:\r\n case TypeKind.I32:\r\n case TypeKind.I64:\r\n case TypeKind.ISIZE:\r\n case TypeKind.U8:\r\n case TypeKind.U16:\r\n case TypeKind.U32:\r\n case TypeKind.U64:\r\n case TypeKind.USIZE:\r\n case TypeKind.F32:\r\n case TypeKind.F64: break;\r\n default: {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n }\r\n let arg0 = compiler.compileExpression(operands[0], Type.v128, ContextualFlags.IMPLICIT);\r\n let arg1 = compiler.compileExpression(operands[1], Type.v128, ContextualFlags.IMPLICIT);\r\n let mask = new Uint8Array(16);\r\n let maxIdx = (laneCount << 1) - 1;\r\n for (let i = 0; i < laneCount; ++i) {\r\n let operand = operands[2 + i];\r\n let argN = compiler.precomputeExpression(operand, Type.u8, ContextualFlags.IMPLICIT);\r\n if (getExpressionId(argN) != ExpressionId.Const) {\r\n compiler.error(\r\n DiagnosticCode.Expression_must_be_a_compile_time_constant,\r\n operand.range\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n assert(getExpressionType(argN) == NativeType.I32);\r\n let idx = getConstValueI32(argN);\r\n if (idx < 0 || idx > maxIdx) {\r\n compiler.error(\r\n DiagnosticCode._0_must_be_a_value_between_1_and_2_inclusive,\r\n operand.range, \"Lane index\", \"0\", maxIdx.toString()\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n switch (laneWidth) {\r\n case 1: {\r\n writeI8(idx, mask, i);\r\n break;\r\n }\r\n case 2: {\r\n let off8 = i << 1;\r\n let idx8 = idx << 1;\r\n writeI8(idx8 , mask, off8);\r\n writeI8(idx8 + 1, mask, off8 + 1);\r\n break;\r\n }\r\n case 4: {\r\n let off8 = i << 2;\r\n let idx8 = idx << 2;\r\n writeI8(idx8 , mask, off8);\r\n writeI8(idx8 + 1, mask, off8 + 1);\r\n writeI8(idx8 + 2, mask, off8 + 2);\r\n writeI8(idx8 + 3, mask, off8 + 3);\r\n break;\r\n }\r\n case 8: {\r\n let off8 = i << 3;\r\n let idx8 = idx << 3;\r\n writeI8(idx8 , mask, off8);\r\n writeI8(idx8 + 1, mask, off8 + 1);\r\n writeI8(idx8 + 2, mask, off8 + 2);\r\n writeI8(idx8 + 3, mask, off8 + 3);\r\n writeI8(idx8 + 4, mask, off8 + 4);\r\n writeI8(idx8 + 5, mask, off8 + 5);\r\n writeI8(idx8 + 6, mask, off8 + 6);\r\n writeI8(idx8 + 7, mask, off8 + 7);\r\n break;\r\n }\r\n default: assert(false);\r\n }\r\n }\r\n compiler.currentType = Type.v128;\r\n return module.simd_shuffle(arg0, arg1, mask);\r\n }\r\n case BuiltinSymbols.v128_add: // any_binary(a: v128, b: v128) -> v128\r\n case BuiltinSymbols.v128_sub:\r\n case BuiltinSymbols.v128_mul:\r\n case BuiltinSymbols.v128_div:\r\n case BuiltinSymbols.v128_add_saturate:\r\n case BuiltinSymbols.v128_sub_saturate:\r\n case BuiltinSymbols.v128_min:\r\n case BuiltinSymbols.v128_max:\r\n case BuiltinSymbols.v128_eq:\r\n case BuiltinSymbols.v128_ne:\r\n case BuiltinSymbols.v128_lt:\r\n case BuiltinSymbols.v128_le:\r\n case BuiltinSymbols.v128_gt:\r\n case BuiltinSymbols.v128_ge: {\r\n if (!compiler.options.hasFeature(Feature.SIMD)) break;\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler) |\r\n checkArgsRequired(operands, 2, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n let type = typeArguments![0];\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n let op: BinaryOp = -1;\r\n switch (prototype.internalName) {\r\n case BuiltinSymbols.v128_add: {\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.U8: { op = BinaryOp.AddVecI8x16; break; }\r\n case TypeKind.I16:\r\n case TypeKind.U16: { op = BinaryOp.AddVecI16x8; break; }\r\n case TypeKind.I32:\r\n case TypeKind.U32: { op = BinaryOp.AddVecI32x4; break; }\r\n case TypeKind.I64:\r\n case TypeKind.U64: { op = BinaryOp.AddVecI64x2; break; }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n op = compiler.options.isWasm64\r\n ? BinaryOp.AddVecI64x2\r\n : BinaryOp.AddVecI32x4;\r\n break;\r\n }\r\n case TypeKind.F32: { op = BinaryOp.AddVecF32x4; break; }\r\n case TypeKind.F64: { op = BinaryOp.AddVecF64x2; break; }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_sub: {\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.U8: { op = BinaryOp.SubVecI8x16; break; }\r\n case TypeKind.I16:\r\n case TypeKind.U16: { op = BinaryOp.SubVecI16x8; break; }\r\n case TypeKind.I32:\r\n case TypeKind.U32: { op = BinaryOp.SubVecI32x4; break; }\r\n case TypeKind.I64:\r\n case TypeKind.U64: { op = BinaryOp.SubVecI64x2; break; }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n op = compiler.options.isWasm64\r\n ? BinaryOp.SubVecI64x2\r\n : BinaryOp.SubVecI32x4;\r\n break;\r\n }\r\n case TypeKind.F32: { op = BinaryOp.SubVecF32x4; break; }\r\n case TypeKind.F64: { op = BinaryOp.SubVecF64x2; break; }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_mul: {\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.U8: { op = BinaryOp.MulVecI8x16; break; }\r\n case TypeKind.I16:\r\n case TypeKind.U16: { op = BinaryOp.MulVecI16x8; break; }\r\n case TypeKind.I32:\r\n case TypeKind.U32: { op = BinaryOp.MulVecI32x4; break; }\r\n case TypeKind.F32: { op = BinaryOp.MulVecF32x4; break; }\r\n case TypeKind.F64: { op = BinaryOp.MulVecF64x2; break; }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n if (!compiler.options.isWasm64) op = BinaryOp.MulVecI32x4;\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_div: {\r\n switch (type.kind) {\r\n case TypeKind.F32: { op = BinaryOp.DivVecF32x4; break; }\r\n case TypeKind.F64: { op = BinaryOp.DivVecF64x2; break; }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_add_saturate: {\r\n switch (type.kind) {\r\n case TypeKind.I8: { op = BinaryOp.AddSatSVecI8x16; break; }\r\n case TypeKind.U8: { op = BinaryOp.AddSatUVecI8x16; break; }\r\n case TypeKind.I16: { op = BinaryOp.AddSatSVecI16x8; break; }\r\n case TypeKind.U16: { op = BinaryOp.AddSatUVecI16x8; break; }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_sub_saturate: {\r\n switch (type.kind) {\r\n case TypeKind.I8: { op = BinaryOp.SubSatSVecI8x16; break; }\r\n case TypeKind.U8: { op = BinaryOp.SubSatUVecI8x16; break; }\r\n case TypeKind.I16: { op = BinaryOp.SubSatSVecI16x8; break; }\r\n case TypeKind.U16: { op = BinaryOp.SubSatUVecI16x8; break; }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_min: {\r\n switch (type.kind) {\r\n case TypeKind.F32: { op = BinaryOp.MinVecF32x4; break; }\r\n case TypeKind.F64: { op = BinaryOp.MinVecF64x2; break; }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_max: {\r\n switch (type.kind) {\r\n case TypeKind.F32: { op = BinaryOp.MaxVecF32x4; break; }\r\n case TypeKind.F64: { op = BinaryOp.MaxVecF64x2; break; }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_eq: {\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.U8: { op = BinaryOp.EqVecI8x16; break; }\r\n case TypeKind.I16:\r\n case TypeKind.U16: { op = BinaryOp.EqVecI16x8; break; }\r\n case TypeKind.I32:\r\n case TypeKind.U32: { op = BinaryOp.EqVecI32x4; break; }\r\n case TypeKind.F32: { op = BinaryOp.EqVecF32x4; break; }\r\n case TypeKind.F64: { op = BinaryOp.EqVecF64x2; break; }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n if (!compiler.options.isWasm64) op = BinaryOp.EqVecI32x4;\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_ne: {\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.U8: { op = BinaryOp.NeVecI8x16; break; }\r\n case TypeKind.I16:\r\n case TypeKind.U16: { op = BinaryOp.NeVecI16x8; break; }\r\n case TypeKind.I32:\r\n case TypeKind.U32: { op = BinaryOp.NeVecI32x4; break; }\r\n case TypeKind.F32: { op = BinaryOp.NeVecF32x4; break; }\r\n case TypeKind.F64: { op = BinaryOp.NeVecF64x2; break; }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n if (!compiler.options.isWasm64) op = BinaryOp.NeVecI32x4;\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_lt: {\r\n switch (type.kind) {\r\n case TypeKind.I8: { op = BinaryOp.LtSVecI8x16; break; }\r\n case TypeKind.U8: { op = BinaryOp.LtUVecI8x16; break; }\r\n case TypeKind.I16: { op = BinaryOp.LtSVecI16x8; break; }\r\n case TypeKind.U16: { op = BinaryOp.LtUVecI16x8; break; }\r\n case TypeKind.I32: { op = BinaryOp.LtSVecI32x4; break; }\r\n case TypeKind.U32: { op = BinaryOp.LtUVecI32x4; break; }\r\n case TypeKind.F32: { op = BinaryOp.LtVecF32x4; break; }\r\n case TypeKind.F64: { op = BinaryOp.LtVecF64x2; break; }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n if (!compiler.options.isWasm64) {\r\n op = type.kind == TypeKind.ISIZE\r\n ? BinaryOp.LtSVecI32x4\r\n : BinaryOp.LtUVecI32x4;\r\n }\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_le: {\r\n switch (type.kind) {\r\n case TypeKind.I8: { op = BinaryOp.LeSVecI8x16; break; }\r\n case TypeKind.U8: { op = BinaryOp.LeUVecI8x16; break; }\r\n case TypeKind.I16: { op = BinaryOp.LeSVecI16x8; break; }\r\n case TypeKind.U16: { op = BinaryOp.LeUVecI16x8; break; }\r\n case TypeKind.I32: { op = BinaryOp.LeSVecI32x4; break; }\r\n case TypeKind.U32: { op = BinaryOp.LeUVecI32x4; break; }\r\n case TypeKind.F32: { op = BinaryOp.LeVecF32x4; break; }\r\n case TypeKind.F64: { op = BinaryOp.LeVecF64x2; break; }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n if (!compiler.options.isWasm64) {\r\n op = type.kind == TypeKind.ISIZE\r\n ? BinaryOp.LeSVecI32x4\r\n : BinaryOp.LeUVecI32x4;\r\n }\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_gt: {\r\n switch (type.kind) {\r\n case TypeKind.I8: { op = BinaryOp.GtSVecI8x16; break; }\r\n case TypeKind.U8: { op = BinaryOp.GtUVecI8x16; break; }\r\n case TypeKind.I16: { op = BinaryOp.GtSVecI16x8; break; }\r\n case TypeKind.U16: { op = BinaryOp.GtUVecI16x8; break; }\r\n case TypeKind.I32: { op = BinaryOp.GtSVecI32x4; break; }\r\n case TypeKind.U32: { op = BinaryOp.GtUVecI32x4; break; }\r\n case TypeKind.F32: { op = BinaryOp.GtVecF32x4; break; }\r\n case TypeKind.F64: { op = BinaryOp.GtVecF64x2; break; }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n if (!compiler.options.isWasm64) {\r\n op = type.kind == TypeKind.ISIZE\r\n ? BinaryOp.GtSVecI32x4\r\n : BinaryOp.GtUVecI32x4;\r\n }\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_ge: {\r\n switch (type.kind) {\r\n case TypeKind.I8: { op = BinaryOp.GeSVecI8x16; break; }\r\n case TypeKind.U8: { op = BinaryOp.GeUVecI8x16; break; }\r\n case TypeKind.I16: { op = BinaryOp.GeSVecI16x8; break; }\r\n case TypeKind.U16: { op = BinaryOp.GeUVecI16x8; break; }\r\n case TypeKind.I32: { op = BinaryOp.GeSVecI32x4; break; }\r\n case TypeKind.U32: { op = BinaryOp.GeUVecI32x4; break; }\r\n case TypeKind.F32: { op = BinaryOp.GeVecF32x4; break; }\r\n case TypeKind.F64: { op = BinaryOp.GeVecF64x2; break; }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n if (!compiler.options.isWasm64) {\r\n op = type.kind == TypeKind.ISIZE\r\n ? BinaryOp.GeSVecI32x4\r\n : BinaryOp.GeUVecI32x4;\r\n }\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n if (op == -1) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n let arg0 = compiler.compileExpression(operands[0], Type.v128, ContextualFlags.IMPLICIT);\r\n let arg1 = compiler.compileExpression(operands[1], Type.v128, ContextualFlags.IMPLICIT);\r\n compiler.currentType = Type.v128;\r\n return module.binary(op, arg0, arg1);\r\n }\r\n case BuiltinSymbols.v128_neg: // any_unary(a: v128) -> v128\r\n case BuiltinSymbols.v128_abs:\r\n case BuiltinSymbols.v128_sqrt:\r\n case BuiltinSymbols.v128_convert:\r\n case BuiltinSymbols.v128_trunc: {\r\n if (!compiler.options.hasFeature(Feature.SIMD)) break;\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n let type = typeArguments![0];\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n let op: UnaryOp = -1;\r\n switch (prototype.internalName) {\r\n case BuiltinSymbols.v128_neg: {\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.U8: { op = UnaryOp.NegVecI8x16; break; }\r\n case TypeKind.I16:\r\n case TypeKind.U16: { op = UnaryOp.NegVecI16x8; break; }\r\n case TypeKind.I32:\r\n case TypeKind.U32: { op = UnaryOp.NegVecI32x4; break; }\r\n case TypeKind.I64:\r\n case TypeKind.U64: { op = UnaryOp.NegVecI64x2; break; }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n op = compiler.options.isWasm64\r\n ? UnaryOp.NegVecI64x2\r\n : UnaryOp.NegVecI32x4;\r\n break;\r\n }\r\n case TypeKind.F32: { op = UnaryOp.NegVecF32x4; break; }\r\n case TypeKind.F64: { op = UnaryOp.NegVecF64x2; break; }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_abs: {\r\n switch (type.kind) {\r\n case TypeKind.F32: { op = UnaryOp.AbsVecF32x4; break; }\r\n case TypeKind.F64: { op = UnaryOp.AbsVecF64x2; break; }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_sqrt: {\r\n switch (type.kind) {\r\n case TypeKind.F32: { op = UnaryOp.SqrtVecF32x4; break; }\r\n case TypeKind.F64: { op = UnaryOp.SqrtVecF64x2; break; }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_convert: {\r\n switch (type.kind) {\r\n case TypeKind.I32: { op = UnaryOp.ConvertSVecI32x4ToVecF32x4; break; }\r\n case TypeKind.U32: { op = UnaryOp.ConvertUVecI32x4ToVecF32x4; break; }\r\n case TypeKind.I64: { op = UnaryOp.ConvertSVecI64x2ToVecF64x2; break; }\r\n case TypeKind.U64: { op = UnaryOp.ConvertUVecI64x2ToVecF64x2; break; }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_trunc: {\r\n switch (type.kind) {\r\n case TypeKind.I32: { op = UnaryOp.TruncSatSVecF32x4ToVecI32x4; break; }\r\n case TypeKind.U32: { op = UnaryOp.TruncSatUVecF32x4ToVecI32x4; break; }\r\n case TypeKind.I64: { op = UnaryOp.TruncSatSVecF64x2ToVecI64x2; break; }\r\n case TypeKind.U64: { op = UnaryOp.TruncSatUVecF64x2ToVecI64x2; break; }\r\n }\r\n break;\r\n }\r\n }\r\n if (op == -1) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n let arg0 = compiler.compileExpression(operands[0], Type.v128, ContextualFlags.IMPLICIT);\r\n compiler.currentType = Type.v128;\r\n return module.unary(op, arg0);\r\n }\r\n case BuiltinSymbols.v128_shl: // any_shift(a: v128, b: i32) -> v128\r\n case BuiltinSymbols.v128_shr: {\r\n if (!compiler.options.hasFeature(Feature.SIMD)) break;\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler) |\r\n checkArgsRequired(operands, 2, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n let type = typeArguments![0];\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n let op: SIMDShiftOp = -1;\r\n switch (prototype.internalName) {\r\n case BuiltinSymbols.v128_shl: {\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.U8: { op = SIMDShiftOp.ShlVecI8x16; break; }\r\n case TypeKind.I16:\r\n case TypeKind.U16: { op = SIMDShiftOp.ShlVecI16x8; break; }\r\n case TypeKind.I32:\r\n case TypeKind.U32: { op = SIMDShiftOp.ShlVecI32x4; break; }\r\n case TypeKind.I64:\r\n case TypeKind.U64: { op = SIMDShiftOp.ShlVecI64x2; break; }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n op = compiler.options.isWasm64\r\n ? SIMDShiftOp.ShlVecI64x2\r\n : SIMDShiftOp.ShlVecI32x4;\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_shr: {\r\n switch (type.kind) {\r\n case TypeKind.I8: { op = SIMDShiftOp.ShrSVecI8x16; break; }\r\n case TypeKind.U8: { op = SIMDShiftOp.ShrUVecI8x16; break; }\r\n case TypeKind.I16: { op = SIMDShiftOp.ShrSVecI16x8; break; }\r\n case TypeKind.U16: { op = SIMDShiftOp.ShrUVecI16x8; break; }\r\n case TypeKind.I32: { op = SIMDShiftOp.ShrSVecI32x4; break; }\r\n case TypeKind.U32: { op = SIMDShiftOp.ShrUVecI32x4; break; }\r\n case TypeKind.I64: { op = SIMDShiftOp.ShrSVecI64x2; break; }\r\n case TypeKind.U64: { op = SIMDShiftOp.ShrUVecI64x2; break; }\r\n case TypeKind.ISIZE: {\r\n op = compiler.options.isWasm64\r\n ? SIMDShiftOp.ShrSVecI64x2\r\n : SIMDShiftOp.ShrSVecI32x4;\r\n break;\r\n }\r\n case TypeKind.USIZE: {\r\n op = compiler.options.isWasm64\r\n ? SIMDShiftOp.ShrUVecI64x2\r\n : SIMDShiftOp.ShrUVecI32x4;\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n if (op == -1) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n let arg0 = compiler.compileExpression(operands[0], Type.v128, ContextualFlags.IMPLICIT);\r\n let arg1 = compiler.compileExpression(operands[1], Type.i32, ContextualFlags.IMPLICIT);\r\n compiler.currentType = Type.v128;\r\n return module.simd_shift(op, arg0, arg1);\r\n }\r\n case BuiltinSymbols.v128_and: // any_bitwise_binary(a: v128, b: v128) -> v128\r\n case BuiltinSymbols.v128_or:\r\n case BuiltinSymbols.v128_xor: {\r\n if (!compiler.options.hasFeature(Feature.SIMD)) break;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 2, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n let op: BinaryOp = -1;\r\n switch (prototype.internalName) {\r\n default: assert(false);\r\n case BuiltinSymbols.v128_and: { op = BinaryOp.AndVec128; break; }\r\n case BuiltinSymbols.v128_or: { op = BinaryOp.OrVec128; break; }\r\n case BuiltinSymbols.v128_xor: { op = BinaryOp.XorVec128; break; }\r\n }\r\n let arg0 = compiler.compileExpression(operands[0], Type.v128, ContextualFlags.IMPLICIT);\r\n let arg1 = compiler.compileExpression(operands[1], Type.v128, ContextualFlags.IMPLICIT);\r\n return module.binary(op, arg0, arg1);\r\n }\r\n case BuiltinSymbols.v128_not: { // any_bitwise_unary(a: v128) -> v128\r\n if (!compiler.options.hasFeature(Feature.SIMD)) break;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n let arg0 = compiler.compileExpression(operands[0], Type.v128, ContextualFlags.IMPLICIT);\r\n return module.unary(UnaryOp.NotVec128, arg0);\r\n }\r\n case BuiltinSymbols.v128_bitselect: { // bitselect(v1: v128, v2: v128, c: v128) -> v128\r\n if (!compiler.options.hasFeature(Feature.SIMD)) break;\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 3, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.v128;\r\n return module.unreachable();\r\n }\r\n let arg0 = compiler.compileExpression(operands[0], Type.v128, ContextualFlags.IMPLICIT);\r\n let arg1 = compiler.compileExpression(operands[1], Type.v128, ContextualFlags.IMPLICIT);\r\n let arg2 = compiler.compileExpression(operands[2], Type.v128, ContextualFlags.IMPLICIT);\r\n return module.simd_bitselect(arg0, arg1, arg2);\r\n }\r\n case BuiltinSymbols.v128_any_true: // any_test(a: v128) -> bool\r\n case BuiltinSymbols.v128_all_true: {\r\n if (!compiler.options.hasFeature(Feature.SIMD)) break;\r\n if (\r\n checkTypeRequired(typeArguments, reportNode, compiler) |\r\n checkArgsRequired(operands, 1, reportNode, compiler)\r\n ) {\r\n compiler.currentType = Type.bool;\r\n return module.unreachable();\r\n }\r\n let type = typeArguments![0];\r\n if (type.is(TypeFlags.REFERENCE)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n return module.unreachable();\r\n }\r\n let op: UnaryOp = -1;\r\n switch (prototype.internalName) {\r\n default: assert(false);\r\n case BuiltinSymbols.v128_any_true: {\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.U8: { op = UnaryOp.AnyTrueVecI8x16; break; }\r\n case TypeKind.I16:\r\n case TypeKind.U16: { op = UnaryOp.AnyTrueVecI16x8; break; }\r\n case TypeKind.I32:\r\n case TypeKind.U32: { op = UnaryOp.AnyTrueVecI32x4; break; }\r\n case TypeKind.I64:\r\n case TypeKind.U64: { op = UnaryOp.AnyTrueVecI64x2; break; }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n op = compiler.options.isWasm64\r\n ? UnaryOp.AnyTrueVecI64x2\r\n : UnaryOp.AnyTrueVecI32x4;\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n case BuiltinSymbols.v128_all_true: {\r\n switch (type.kind) {\r\n case TypeKind.I8:\r\n case TypeKind.U8: { op = UnaryOp.AllTrueVecI8x16; break; }\r\n case TypeKind.I16:\r\n case TypeKind.U16: { op = UnaryOp.AllTrueVecI16x8; break; }\r\n case TypeKind.I32:\r\n case TypeKind.U32: { op = UnaryOp.AllTrueVecI32x4; break; }\r\n case TypeKind.I64:\r\n case TypeKind.U64: { op = UnaryOp.AllTrueVecI64x2; break; }\r\n case TypeKind.ISIZE:\r\n case TypeKind.USIZE: {\r\n op = compiler.options.isWasm64\r\n ? UnaryOp.AllTrueVecI64x2\r\n : UnaryOp.AllTrueVecI32x4;\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n if (op == -1) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.typeArgumentsRange\r\n );\r\n compiler.currentType = Type.bool;\r\n return module.unreachable();\r\n }\r\n let arg0 = compiler.compileExpression(operands[0], Type.v128, ContextualFlags.IMPLICIT);\r\n compiler.currentType = Type.bool;\r\n return module.unary(op, arg0);\r\n }\r\n\r\n // === Internal runtime =======================================================================\r\n\r\n case BuiltinSymbols.idof: {\r\n let type = evaluateConstantType(compiler, typeArguments, operands, reportNode);\r\n compiler.currentType = Type.u32;\r\n if (!type) return module.unreachable();\r\n let classReference = type.classReference;\r\n if (!classReference || classReference.hasDecorator(DecoratorFlags.UNMANAGED)) {\r\n compiler.error(\r\n DiagnosticCode.Operation_not_supported,\r\n reportNode.range\r\n );\r\n return module.unreachable();\r\n }\r\n return module.i32(classReference.id);\r\n }\r\n case BuiltinSymbols.visit_globals: {\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 1, reportNode, compiler) // cookie\r\n ) {\r\n compiler.currentType = Type.void;\r\n return module.unreachable();\r\n }\r\n let arg0 = compiler.compileExpression(operands[0], Type.u32, ContextualFlags.IMPLICIT);\r\n compiler.runtimeFeatures |= RuntimeFeatures.visitGlobals;\r\n compiler.currentType = Type.void;\r\n return module.call(BuiltinSymbols.visit_globals, [ arg0 ], NativeType.None);\r\n }\r\n case BuiltinSymbols.visit_members: {\r\n if (\r\n checkTypeAbsent(typeArguments, reportNode, prototype) |\r\n checkArgsRequired(operands, 2, reportNode, compiler) // ref, cookie\r\n ) {\r\n compiler.currentType = Type.void;\r\n return module.unreachable();\r\n }\r\n let arg0 = compiler.compileExpression(operands[0], compiler.options.usizeType, ContextualFlags.IMPLICIT);\r\n let arg1 = compiler.compileExpression(operands[1], Type.u32, ContextualFlags.IMPLICIT);\r\n compiler.runtimeFeatures |= RuntimeFeatures.visitMembers;\r\n compiler.currentType = Type.void;\r\n return module.call(BuiltinSymbols.visit_members, [ arg0, arg1 ], NativeType.None);\r\n }\r\n }\r\n\r\n // try to defer inline asm to a concrete built-in\r\n {\r\n let expr = tryDeferASM(compiler, prototype, operands, reportNode);\r\n if (expr) {\r\n if (typeArguments) {\r\n compiler.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.typeArgumentsRange, prototype.internalName\r\n );\r\n }\r\n return expr;\r\n }\r\n }\r\n compiler.error(\r\n DiagnosticCode.Cannot_find_name_0,\r\n reportNode.expression.range, prototype.internalName\r\n );\r\n return module.unreachable();\r\n}\r\n\r\n/** Tries to defer an inline-assembler-like call to a built-in function. */\r\nfunction tryDeferASM(\r\n compiler: Compiler,\r\n prototype: FunctionPrototype,\r\n operands: Expression[],\r\n reportNode: CallExpression\r\n): ExpressionRef {\r\n /* tslint:disable:max-line-length */\r\n switch (prototype.internalName) {\r\n\r\n // TODO: Operators can't be just deferred (don't have a corresponding generic built-in)\r\n // add, sub, mul, div_s, div_u, rem_s, rem_u\r\n // and, or, xor, shl, shr_u, shr_s\r\n // eq, eqz, ne, lt_s, lt_u, le_s, le_u, gt_s, gt_u, ge_s, ge_u\r\n\r\n case BuiltinSymbols.i32_clz: return deferASM(BuiltinSymbols.clz, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64_clz: return deferASM(BuiltinSymbols.clz, compiler, Type.i64, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i32_ctz: return deferASM(BuiltinSymbols.ctz, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64_ctz: return deferASM(BuiltinSymbols.ctz, compiler, Type.i64, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i32_popcnt: return deferASM(BuiltinSymbols.popcnt, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64_popcnt: return deferASM(BuiltinSymbols.popcnt, compiler, Type.i64, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i32_rotl: return deferASM(BuiltinSymbols.rotl, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64_rotl: return deferASM(BuiltinSymbols.rotl, compiler, Type.i64, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i32_rotr: return deferASM(BuiltinSymbols.rotr, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64_rotr: return deferASM(BuiltinSymbols.rotr, compiler, Type.i64, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.f32_abs: return deferASM(BuiltinSymbols.abs, compiler, Type.f32, operands, Type.f32, reportNode);\r\n case BuiltinSymbols.f64_abs: return deferASM(BuiltinSymbols.abs, compiler, Type.f64, operands, Type.f64, reportNode);\r\n case BuiltinSymbols.f32_max: return deferASM(BuiltinSymbols.max, compiler, Type.f32, operands, Type.f32, reportNode);\r\n case BuiltinSymbols.f64_max: return deferASM(BuiltinSymbols.max, compiler, Type.f64, operands, Type.f64, reportNode);\r\n case BuiltinSymbols.f32_min: return deferASM(BuiltinSymbols.min, compiler, Type.f32, operands, Type.f32, reportNode);\r\n case BuiltinSymbols.f64_min: return deferASM(BuiltinSymbols.min, compiler, Type.f64, operands, Type.f64, reportNode);\r\n case BuiltinSymbols.f32_ceil: return deferASM(BuiltinSymbols.ceil, compiler, Type.f32, operands, Type.f32, reportNode);\r\n case BuiltinSymbols.f64_ceil: return deferASM(BuiltinSymbols.ceil, compiler, Type.f64, operands, Type.f64, reportNode);\r\n case BuiltinSymbols.f32_floor: return deferASM(BuiltinSymbols.floor, compiler, Type.f32, operands, Type.f32, reportNode);\r\n case BuiltinSymbols.f64_floor: return deferASM(BuiltinSymbols.floor, compiler, Type.f64, operands, Type.f64, reportNode);\r\n case BuiltinSymbols.f32_copysign: return deferASM(BuiltinSymbols.copysign, compiler, Type.f32, operands, Type.f32, reportNode);\r\n case BuiltinSymbols.f64_copysign: return deferASM(BuiltinSymbols.copysign, compiler, Type.f64, operands, Type.f64, reportNode);\r\n case BuiltinSymbols.f32_nearest: return deferASM(BuiltinSymbols.nearest, compiler, Type.f32, operands, Type.f32, reportNode);\r\n case BuiltinSymbols.f64_nearest: return deferASM(BuiltinSymbols.nearest, compiler, Type.f64, operands, Type.f64, reportNode);\r\n case BuiltinSymbols.i32_reinterpret_f32: return deferASM(BuiltinSymbols.reinterpret, compiler, Type.i32, operands, Type.f32, reportNode);\r\n case BuiltinSymbols.i64_reinterpret_f64: return deferASM(BuiltinSymbols.reinterpret, compiler, Type.i64, operands, Type.f64, reportNode);\r\n case BuiltinSymbols.f32_reinterpret_i32: return deferASM(BuiltinSymbols.reinterpret, compiler, Type.f32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.f64_reinterpret_i64: return deferASM(BuiltinSymbols.reinterpret, compiler, Type.f64, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.f32_sqrt: return deferASM(BuiltinSymbols.sqrt, compiler, Type.f32, operands, Type.f32, reportNode);\r\n case BuiltinSymbols.f64_sqrt: return deferASM(BuiltinSymbols.sqrt, compiler, Type.f64, operands, Type.f64, reportNode);\r\n case BuiltinSymbols.f32_trunc: return deferASM(BuiltinSymbols.trunc, compiler, Type.f32, operands, Type.f32, reportNode);\r\n case BuiltinSymbols.f64_trunc: return deferASM(BuiltinSymbols.trunc, compiler, Type.f64, operands, Type.f64, reportNode);\r\n case BuiltinSymbols.i32_load8_s: return deferASM(BuiltinSymbols.load, compiler, Type.i8, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_load8_u: return deferASM(BuiltinSymbols.load, compiler, Type.u8, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_load16_s: return deferASM(BuiltinSymbols.load, compiler, Type.i16, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_load16_u: return deferASM(BuiltinSymbols.load, compiler, Type.u16, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_load: return deferASM(BuiltinSymbols.load, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64_load8_s: return deferASM(BuiltinSymbols.load, compiler, Type.i8, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_load8_u: return deferASM(BuiltinSymbols.load, compiler, Type.u8, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_load16_s: return deferASM(BuiltinSymbols.load, compiler, Type.i16, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_load16_u: return deferASM(BuiltinSymbols.load, compiler, Type.u16, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_load32_s: return deferASM(BuiltinSymbols.load, compiler, Type.i32, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_load32_u: return deferASM(BuiltinSymbols.load, compiler, Type.u32, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_load: return deferASM(BuiltinSymbols.load, compiler, Type.i64, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.f32_load: return deferASM(BuiltinSymbols.load, compiler, Type.f32, operands, Type.f32, reportNode);\r\n case BuiltinSymbols.f64_load: return deferASM(BuiltinSymbols.load, compiler, Type.f64, operands, Type.f64, reportNode);\r\n case BuiltinSymbols.i32_store8: return deferASM(BuiltinSymbols.store, compiler, Type.i8, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_store16: return deferASM(BuiltinSymbols.store, compiler, Type.i16, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_store: return deferASM(BuiltinSymbols.store, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64_store8: return deferASM(BuiltinSymbols.store, compiler, Type.i8, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_store16: return deferASM(BuiltinSymbols.store, compiler, Type.i16, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_store32: return deferASM(BuiltinSymbols.store, compiler, Type.i32, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_store: return deferASM(BuiltinSymbols.store, compiler, Type.i64, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.f32_store: return deferASM(BuiltinSymbols.store, compiler, Type.f32, operands, Type.f32, reportNode);\r\n case BuiltinSymbols.f64_store: return deferASM(BuiltinSymbols.store, compiler, Type.f64, operands, Type.f64, reportNode);\r\n }\r\n if (compiler.options.hasFeature(Feature.THREADS)) {\r\n switch (prototype.internalName) {\r\n\r\n case BuiltinSymbols.i32_atomic_load8_u: return deferASM(BuiltinSymbols.atomic_load, compiler, Type.u8, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_load16_u: return deferASM(BuiltinSymbols.atomic_load, compiler, Type.u16, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_load: return deferASM(BuiltinSymbols.atomic_load, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64_atomic_load8_u: return deferASM(BuiltinSymbols.atomic_load, compiler, Type.u8, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_load16_u: return deferASM(BuiltinSymbols.atomic_load, compiler, Type.u16, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_load32_u: return deferASM(BuiltinSymbols.atomic_load, compiler, Type.u32, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_load: return deferASM(BuiltinSymbols.atomic_load, compiler, Type.i64, operands, Type.i64, reportNode);\r\n\r\n case BuiltinSymbols.i32_atomic_store8: return deferASM(BuiltinSymbols.atomic_store, compiler, Type.u8, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_store16: return deferASM(BuiltinSymbols.atomic_store, compiler, Type.u16, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_store: return deferASM(BuiltinSymbols.atomic_store, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64_atomic_store8: return deferASM(BuiltinSymbols.atomic_store, compiler, Type.u8, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_store16: return deferASM(BuiltinSymbols.atomic_store, compiler, Type.u16, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_store32: return deferASM(BuiltinSymbols.atomic_store, compiler, Type.u32, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_store: return deferASM(BuiltinSymbols.atomic_store, compiler, Type.i64, operands, Type.i64, reportNode);\r\n\r\n case BuiltinSymbols.i32_atomic_rmw8_add_u: return deferASM(BuiltinSymbols.atomic_add, compiler, Type.u8, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_rmw16_add_u: return deferASM(BuiltinSymbols.atomic_add, compiler, Type.u16, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_rmw_add: return deferASM(BuiltinSymbols.atomic_add, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw8_add_u: return deferASM(BuiltinSymbols.atomic_add, compiler, Type.u8, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw16_add_u: return deferASM(BuiltinSymbols.atomic_add, compiler, Type.u16, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw32_add_u: return deferASM(BuiltinSymbols.atomic_add, compiler, Type.u32, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw_add: return deferASM(BuiltinSymbols.atomic_add, compiler, Type.i64, operands, Type.i64, reportNode);\r\n\r\n case BuiltinSymbols.i32_atomic_rmw8_sub_u: return deferASM(BuiltinSymbols.atomic_sub, compiler, Type.u8, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_rmw16_sub_u: return deferASM(BuiltinSymbols.atomic_sub, compiler, Type.u16, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_rmw_sub: return deferASM(BuiltinSymbols.atomic_sub, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw8_sub_u: return deferASM(BuiltinSymbols.atomic_sub, compiler, Type.u8, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw16_sub_u: return deferASM(BuiltinSymbols.atomic_sub, compiler, Type.u16, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw32_sub_u: return deferASM(BuiltinSymbols.atomic_sub, compiler, Type.u32, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw_sub: return deferASM(BuiltinSymbols.atomic_sub, compiler, Type.i64, operands, Type.i64, reportNode);\r\n\r\n case BuiltinSymbols.i32_atomic_rmw8_and_u: return deferASM(BuiltinSymbols.atomic_and, compiler, Type.u8, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_rmw16_and_u: return deferASM(BuiltinSymbols.atomic_and, compiler, Type.u16, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_rmw_and: return deferASM(BuiltinSymbols.atomic_and, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw8_and_u: return deferASM(BuiltinSymbols.atomic_and, compiler, Type.u8, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw16_and_u: return deferASM(BuiltinSymbols.atomic_and, compiler, Type.u16, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw32_and_u: return deferASM(BuiltinSymbols.atomic_and, compiler, Type.u32, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw_and: return deferASM(BuiltinSymbols.atomic_and, compiler, Type.i64, operands, Type.i64, reportNode);\r\n\r\n case BuiltinSymbols.i32_atomic_rmw8_or_u: return deferASM(BuiltinSymbols.atomic_or, compiler, Type.u8, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_rmw16_or_u: return deferASM(BuiltinSymbols.atomic_or, compiler, Type.u16, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_rmw_or: return deferASM(BuiltinSymbols.atomic_or, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw8_or_u: return deferASM(BuiltinSymbols.atomic_or, compiler, Type.u8, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw16_or_u: return deferASM(BuiltinSymbols.atomic_or, compiler, Type.u16, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw32_or_u: return deferASM(BuiltinSymbols.atomic_or, compiler, Type.u32, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw_or: return deferASM(BuiltinSymbols.atomic_or, compiler, Type.i64, operands, Type.i64, reportNode);\r\n\r\n case BuiltinSymbols.i32_atomic_rmw8_u_xor: return deferASM(BuiltinSymbols.atomic_xor, compiler, Type.u8, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_rmw16_u_xor: return deferASM(BuiltinSymbols.atomic_xor, compiler, Type.u16, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_rmw_xor: return deferASM(BuiltinSymbols.atomic_xor, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw8_xor_u: return deferASM(BuiltinSymbols.atomic_xor, compiler, Type.u8, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw16_xor_u: return deferASM(BuiltinSymbols.atomic_xor, compiler, Type.u16, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw32_xor_u: return deferASM(BuiltinSymbols.atomic_xor, compiler, Type.u32, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw_xor: return deferASM(BuiltinSymbols.atomic_xor, compiler, Type.i64, operands, Type.i64, reportNode);\r\n\r\n case BuiltinSymbols.i32_atomic_rmw8_xchg_u: return deferASM(BuiltinSymbols.atomic_xchg, compiler, Type.u8, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_rmw16_xchg_u: return deferASM(BuiltinSymbols.atomic_xchg, compiler, Type.u16, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_rmw_xchg: return deferASM(BuiltinSymbols.atomic_xchg, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw8_xchg_u: return deferASM(BuiltinSymbols.atomic_xchg, compiler, Type.u8, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw16_xchg_u: return deferASM(BuiltinSymbols.atomic_xchg, compiler, Type.u16, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw32_xchg_u: return deferASM(BuiltinSymbols.atomic_xchg, compiler, Type.u32, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw_xchg: return deferASM(BuiltinSymbols.atomic_xchg, compiler, Type.i64, operands, Type.i64, reportNode);\r\n\r\n case BuiltinSymbols.i32_atomic_rmw8_cmpxchg_u: return deferASM(BuiltinSymbols.atomic_cmpxchg, compiler, Type.u8, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_rmw16_cmpxchg_u: return deferASM(BuiltinSymbols.atomic_cmpxchg, compiler, Type.u16, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32_atomic_rmw_cmpxchg: return deferASM(BuiltinSymbols.atomic_cmpxchg, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw8_cmpxchg_u: return deferASM(BuiltinSymbols.atomic_cmpxchg, compiler, Type.u8, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw16_cmpxchg_u: return deferASM(BuiltinSymbols.atomic_cmpxchg, compiler, Type.u16, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw32_cmpxchg_u: return deferASM(BuiltinSymbols.atomic_cmpxchg, compiler, Type.u32, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64_atomic_rmw_cmpxchg: return deferASM(BuiltinSymbols.atomic_cmpxchg, compiler, Type.i64, operands, Type.i64, reportNode);\r\n\r\n case BuiltinSymbols.i32_wait: return deferASM(BuiltinSymbols.atomic_wait, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64_wait: return deferASM(BuiltinSymbols.atomic_wait, compiler, Type.i64, operands, Type.i32, reportNode);\r\n }\r\n }\r\n if (compiler.options.hasFeature(Feature.SIMD)) {\r\n switch (prototype.internalName) {\r\n\r\n case BuiltinSymbols.v128_load: return deferASM(BuiltinSymbols.load, compiler, Type.v128, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.v128_store: return deferASM(BuiltinSymbols.store, compiler, Type.v128, operands, Type.void, reportNode);\r\n\r\n case BuiltinSymbols.i8x16_splat: return deferASM(BuiltinSymbols.v128_splat, compiler, Type.i8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_extract_lane_s: return deferASM(BuiltinSymbols.v128_extract_lane, compiler, Type.i8, operands, Type.i8, reportNode);\r\n case BuiltinSymbols.i8x16_extract_lane_u: return deferASM(BuiltinSymbols.v128_extract_lane, compiler, Type.u8, operands, Type.u8, reportNode);\r\n case BuiltinSymbols.i8x16_replace_lane: return deferASM(BuiltinSymbols.v128_replace_lane, compiler, Type.i8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_add: return deferASM(BuiltinSymbols.v128_add, compiler, Type.i8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_sub: return deferASM(BuiltinSymbols.v128_sub, compiler, Type.i8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_mul: return deferASM(BuiltinSymbols.v128_mul, compiler, Type.i8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_neg: return deferASM(BuiltinSymbols.v128_neg, compiler, Type.i8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_add_saturate_s: return deferASM(BuiltinSymbols.v128_add_saturate, compiler, Type.i8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_add_saturate_u: return deferASM(BuiltinSymbols.v128_add_saturate, compiler, Type.u8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_sub_saturate_s: return deferASM(BuiltinSymbols.v128_sub_saturate, compiler, Type.i8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_sub_saturate_u: return deferASM(BuiltinSymbols.v128_sub_saturate, compiler, Type.u8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_shl: return deferASM(BuiltinSymbols.v128_shl, compiler, Type.i8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_shr_s: return deferASM(BuiltinSymbols.v128_shr, compiler, Type.i8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_shr_u: return deferASM(BuiltinSymbols.v128_shr, compiler, Type.u8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_any_true: return deferASM(BuiltinSymbols.v128_any_true, compiler, Type.i8, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i8x16_all_true: return deferASM(BuiltinSymbols.v128_all_true, compiler, Type.i8, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i8x16_eq: return deferASM(BuiltinSymbols.v128_eq, compiler, Type.i8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_ne: return deferASM(BuiltinSymbols.v128_ne, compiler, Type.i8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_lt_s: return deferASM(BuiltinSymbols.v128_lt, compiler, Type.i8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_lt_u: return deferASM(BuiltinSymbols.v128_lt, compiler, Type.u8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_le_s: return deferASM(BuiltinSymbols.v128_le, compiler, Type.i8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_le_u: return deferASM(BuiltinSymbols.v128_le, compiler, Type.u8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_gt_s: return deferASM(BuiltinSymbols.v128_gt, compiler, Type.i8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_gt_u: return deferASM(BuiltinSymbols.v128_gt, compiler, Type.u8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_ge_s: return deferASM(BuiltinSymbols.v128_ge, compiler, Type.i8, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i8x16_ge_u: return deferASM(BuiltinSymbols.v128_ge, compiler, Type.u8, operands, Type.v128, reportNode);\r\n\r\n case BuiltinSymbols.i16x8_splat: return deferASM(BuiltinSymbols.v128_splat, compiler, Type.i16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_extract_lane_s: return deferASM(BuiltinSymbols.v128_extract_lane, compiler, Type.i16, operands, Type.i16, reportNode);\r\n case BuiltinSymbols.i16x8_extract_lane_u: return deferASM(BuiltinSymbols.v128_extract_lane, compiler, Type.u16, operands, Type.u16, reportNode);\r\n case BuiltinSymbols.i16x8_replace_lane: return deferASM(BuiltinSymbols.v128_replace_lane, compiler, Type.i16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_add: return deferASM(BuiltinSymbols.v128_add, compiler, Type.i16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_sub: return deferASM(BuiltinSymbols.v128_sub, compiler, Type.i16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_mul: return deferASM(BuiltinSymbols.v128_mul, compiler, Type.i16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_neg: return deferASM(BuiltinSymbols.v128_neg, compiler, Type.i16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_add_saturate_s: return deferASM(BuiltinSymbols.v128_add_saturate, compiler, Type.i16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_add_saturate_u: return deferASM(BuiltinSymbols.v128_add_saturate, compiler, Type.u16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_sub_saturate_s: return deferASM(BuiltinSymbols.v128_sub_saturate, compiler, Type.i16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_sub_saturate_u: return deferASM(BuiltinSymbols.v128_sub_saturate, compiler, Type.u16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_shl: return deferASM(BuiltinSymbols.v128_shl, compiler, Type.i16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_shr_s: return deferASM(BuiltinSymbols.v128_shr, compiler, Type.i16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_shr_u: return deferASM(BuiltinSymbols.v128_shr, compiler, Type.u16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_any_true: return deferASM(BuiltinSymbols.v128_any_true, compiler, Type.i16, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i16x8_all_true: return deferASM(BuiltinSymbols.v128_all_true, compiler, Type.i16, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i16x8_eq: return deferASM(BuiltinSymbols.v128_eq, compiler, Type.i16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_ne: return deferASM(BuiltinSymbols.v128_ne, compiler, Type.i16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_lt_s: return deferASM(BuiltinSymbols.v128_lt, compiler, Type.i16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_lt_u: return deferASM(BuiltinSymbols.v128_lt, compiler, Type.u16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_le_s: return deferASM(BuiltinSymbols.v128_le, compiler, Type.i16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_le_u: return deferASM(BuiltinSymbols.v128_le, compiler, Type.u16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_gt_s: return deferASM(BuiltinSymbols.v128_gt, compiler, Type.i16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_gt_u: return deferASM(BuiltinSymbols.v128_gt, compiler, Type.u16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_ge_s: return deferASM(BuiltinSymbols.v128_ge, compiler, Type.i16, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i16x8_ge_u: return deferASM(BuiltinSymbols.v128_ge, compiler, Type.u16, operands, Type.v128, reportNode);\r\n\r\n case BuiltinSymbols.i32x4_splat: return deferASM(BuiltinSymbols.v128_splat, compiler, Type.i32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_extract_lane: return deferASM(BuiltinSymbols.v128_extract_lane, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32x4_replace_lane: return deferASM(BuiltinSymbols.v128_replace_lane, compiler, Type.i32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_add: return deferASM(BuiltinSymbols.v128_add, compiler, Type.i32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_sub: return deferASM(BuiltinSymbols.v128_sub, compiler, Type.i32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_mul: return deferASM(BuiltinSymbols.v128_mul, compiler, Type.i32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_neg: return deferASM(BuiltinSymbols.v128_neg, compiler, Type.i32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_shl: return deferASM(BuiltinSymbols.v128_shl, compiler, Type.i32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_shr_s: return deferASM(BuiltinSymbols.v128_shr, compiler, Type.i32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_shr_u: return deferASM(BuiltinSymbols.v128_shr, compiler, Type.u32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_any_true: return deferASM(BuiltinSymbols.v128_any_true, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32x4_all_true: return deferASM(BuiltinSymbols.v128_all_true, compiler, Type.i32, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i32x4_eq: return deferASM(BuiltinSymbols.v128_eq, compiler, Type.i32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_ne: return deferASM(BuiltinSymbols.v128_ne, compiler, Type.i32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_lt_s: return deferASM(BuiltinSymbols.v128_lt, compiler, Type.i32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_lt_u: return deferASM(BuiltinSymbols.v128_lt, compiler, Type.u32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_le_s: return deferASM(BuiltinSymbols.v128_le, compiler, Type.i32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_le_u: return deferASM(BuiltinSymbols.v128_le, compiler, Type.u32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_gt_s: return deferASM(BuiltinSymbols.v128_gt, compiler, Type.i32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_gt_u: return deferASM(BuiltinSymbols.v128_gt, compiler, Type.u32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_ge_s: return deferASM(BuiltinSymbols.v128_ge, compiler, Type.i32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_ge_u: return deferASM(BuiltinSymbols.v128_ge, compiler, Type.u32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_trunc_s_f32x4_sat: return deferASM(BuiltinSymbols.v128_trunc, compiler, Type.i32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i32x4_trunc_u_f32x4_sat: return deferASM(BuiltinSymbols.v128_trunc, compiler, Type.u32, operands, Type.v128, reportNode);\r\n\r\n case BuiltinSymbols.i64x2_splat: return deferASM(BuiltinSymbols.v128_splat, compiler, Type.i64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i64x2_extract_lane: return deferASM(BuiltinSymbols.v128_extract_lane, compiler, Type.i64, operands, Type.i64, reportNode);\r\n case BuiltinSymbols.i64x2_replace_lane: return deferASM(BuiltinSymbols.v128_replace_lane, compiler, Type.i64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i64x2_add: return deferASM(BuiltinSymbols.v128_add, compiler, Type.i64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i64x2_sub: return deferASM(BuiltinSymbols.v128_sub, compiler, Type.i64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i64x2_neg: return deferASM(BuiltinSymbols.v128_neg, compiler, Type.i64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i64x2_shl: return deferASM(BuiltinSymbols.v128_shl, compiler, Type.i64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i64x2_shr_s: return deferASM(BuiltinSymbols.v128_shr, compiler, Type.i64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i64x2_shr_u: return deferASM(BuiltinSymbols.v128_shr, compiler, Type.u64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i64x2_any_true: return deferASM(BuiltinSymbols.v128_any_true, compiler, Type.i64, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64x2_all_true: return deferASM(BuiltinSymbols.v128_all_true, compiler, Type.i64, operands, Type.i32, reportNode);\r\n case BuiltinSymbols.i64x2_trunc_s_f64x2_sat: return deferASM(BuiltinSymbols.v128_trunc, compiler, Type.i64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.i64x2_trunc_u_f64x2_sat: return deferASM(BuiltinSymbols.v128_trunc, compiler, Type.u64, operands, Type.v128, reportNode);\r\n\r\n case BuiltinSymbols.f32x4_splat: return deferASM(BuiltinSymbols.v128_splat, compiler, Type.f32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_extract_lane: return deferASM(BuiltinSymbols.v128_extract_lane, compiler, Type.f32, operands, Type.f32, reportNode);\r\n case BuiltinSymbols.f32x4_replace_lane: return deferASM(BuiltinSymbols.v128_replace_lane, compiler, Type.f32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_add: return deferASM(BuiltinSymbols.v128_add, compiler, Type.f32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_sub: return deferASM(BuiltinSymbols.v128_sub, compiler, Type.f32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_mul: return deferASM(BuiltinSymbols.v128_mul, compiler, Type.f32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_div: return deferASM(BuiltinSymbols.v128_div, compiler, Type.f32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_neg: return deferASM(BuiltinSymbols.v128_neg, compiler, Type.f32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_min: return deferASM(BuiltinSymbols.v128_min, compiler, Type.f32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_max: return deferASM(BuiltinSymbols.v128_max, compiler, Type.f32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_abs: return deferASM(BuiltinSymbols.v128_abs, compiler, Type.f32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_sqrt: return deferASM(BuiltinSymbols.v128_sqrt, compiler, Type.f32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_eq: return deferASM(BuiltinSymbols.v128_eq, compiler, Type.f32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_ne: return deferASM(BuiltinSymbols.v128_ne, compiler, Type.f32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_lt: return deferASM(BuiltinSymbols.v128_lt, compiler, Type.f32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_le: return deferASM(BuiltinSymbols.v128_le, compiler, Type.f32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_gt: return deferASM(BuiltinSymbols.v128_gt, compiler, Type.f32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_ge: return deferASM(BuiltinSymbols.v128_ge, compiler, Type.f32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_convert_s_i32x4: return deferASM(BuiltinSymbols.v128_convert, compiler, Type.i32, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f32x4_convert_u_i32x4: return deferASM(BuiltinSymbols.v128_convert, compiler, Type.u32, operands, Type.v128, reportNode);\r\n\r\n case BuiltinSymbols.f64x2_splat: return deferASM(BuiltinSymbols.v128_splat, compiler, Type.f64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_extract_lane: return deferASM(BuiltinSymbols.v128_extract_lane, compiler, Type.f64, operands, Type.f64, reportNode);\r\n case BuiltinSymbols.f64x2_replace_lane: return deferASM(BuiltinSymbols.v128_replace_lane, compiler, Type.f64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_add: return deferASM(BuiltinSymbols.v128_add, compiler, Type.f64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_sub: return deferASM(BuiltinSymbols.v128_sub, compiler, Type.f64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_mul: return deferASM(BuiltinSymbols.v128_mul, compiler, Type.f64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_div: return deferASM(BuiltinSymbols.v128_div, compiler, Type.f64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_neg: return deferASM(BuiltinSymbols.v128_neg, compiler, Type.f64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_min: return deferASM(BuiltinSymbols.v128_min, compiler, Type.f64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_max: return deferASM(BuiltinSymbols.v128_max, compiler, Type.f64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_abs: return deferASM(BuiltinSymbols.v128_abs, compiler, Type.f64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_sqrt: return deferASM(BuiltinSymbols.v128_sqrt, compiler, Type.f64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_eq: return deferASM(BuiltinSymbols.v128_eq, compiler, Type.f64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_ne: return deferASM(BuiltinSymbols.v128_ne, compiler, Type.f64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_lt: return deferASM(BuiltinSymbols.v128_lt, compiler, Type.f64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_le: return deferASM(BuiltinSymbols.v128_le, compiler, Type.f64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_gt: return deferASM(BuiltinSymbols.v128_gt, compiler, Type.f64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_ge: return deferASM(BuiltinSymbols.v128_ge, compiler, Type.f64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_convert_s_i64x2: return deferASM(BuiltinSymbols.v128_convert, compiler, Type.i64, operands, Type.v128, reportNode);\r\n case BuiltinSymbols.f64x2_convert_u_i64x2: return deferASM(BuiltinSymbols.v128_convert, compiler, Type.u64, operands, Type.v128, reportNode);\r\n\r\n case BuiltinSymbols.v8x16_shuffle: return deferASM(BuiltinSymbols.v128_shuffle, compiler, Type.i8, operands, Type.v128, reportNode);\r\n }\r\n }\r\n /* tslint:enable:max-line-length */\r\n return 0;\r\n}\r\n\r\n/** A helper for deferring inline-assembler-like calls to built-in functions. */\r\nfunction deferASM(\r\n name: string,\r\n compiler: Compiler,\r\n typeArgument: Type,\r\n operands: Expression[],\r\n contextualType: Type,\r\n reportNode: CallExpression\r\n): ExpressionRef {\r\n assert(compiler.program.elementsByName.has(name));\r\n var prototype = compiler.program.elementsByName.get(name)!;\r\n assert(prototype.kind == ElementKind.FUNCTION_PROTOTYPE);\r\n return compileCall(\r\n compiler,\r\n prototype,\r\n [ typeArgument ],\r\n operands,\r\n contextualType,\r\n reportNode,\r\n /* isAsm */ true\r\n );\r\n}\r\n\r\n/** Compiles an abort wired to the conditionally imported 'abort' function. */\r\nexport function compileAbort(\r\n compiler: Compiler,\r\n message: Expression | null,\r\n reportNode: Node\r\n): ExpressionRef {\r\n var program = compiler.program;\r\n var module = compiler.module;\r\n\r\n var stringInstance = compiler.program.stringInstance;\r\n if (!stringInstance) return module.unreachable();\r\n\r\n var abortInstance = program.abortInstance;\r\n if (!(abortInstance && compiler.compileFunction(abortInstance))) return module.unreachable();\r\n\r\n var messageArg: ExpressionRef;\r\n if (message !== null) {\r\n // The message argument works much like an arm of an IF that does not become executed if the\r\n // assertion succeeds respectively is only being computed if the program actually crashes.\r\n // Hence, let's make it so that the autorelease is skipped at the end of the current block,\r\n // essentially ignoring the message GC-wise. Doesn't matter anyway on a crash.\r\n messageArg = compiler.compileExpression(message, stringInstance.type, ContextualFlags.IMPLICIT | ContextualFlags.SKIP_AUTORELEASE);\r\n } else {\r\n messageArg = stringInstance.type.toNativeZero(module);\r\n }\r\n\r\n var filenameArg = compiler.ensureStaticString(reportNode.range.source.normalizedPath);\r\n\r\n compiler.currentType = Type.void;\r\n return module.block(null, [\r\n module.call(\r\n abortInstance.internalName, [\r\n messageArg,\r\n filenameArg,\r\n module.i32(reportNode.range.line),\r\n module.i32(reportNode.range.column)\r\n ],\r\n NativeType.None\r\n ),\r\n module.unreachable()\r\n ]);\r\n}\r\n\r\n/** Compiles the `visit_globals` function. */\r\nexport function compileVisitGlobals(compiler: Compiler): void {\r\n var module = compiler.module;\r\n var exprs = new Array();\r\n var typeRef = compiler.ensureFunctionType([ Type.u32 ], Type.void); // cookie\r\n var nativeSizeType = compiler.options.nativeSizeType;\r\n var visitInstance = assert(compiler.program.visitInstance);\r\n\r\n compiler.compileFunction(visitInstance);\r\n\r\n for (let element of compiler.program.elementsByName.values()) {\r\n if (element.kind != ElementKind.GLOBAL) continue;\r\n let global = element;\r\n let classReference = global.type.classReference;\r\n if (\r\n global.is(CommonFlags.COMPILED) &&\r\n classReference !== null &&\r\n !classReference.hasDecorator(DecoratorFlags.UNMANAGED)\r\n ) {\r\n if (global.is(CommonFlags.INLINED)) {\r\n let value = global.constantIntegerValue;\r\n if (i64_low(value) || i64_high(value)) {\r\n exprs.push(\r\n module.call(visitInstance.internalName, [\r\n compiler.options.isWasm64\r\n ? module.i64(i64_low(value), i64_high(value))\r\n : module.i32(i64_low(value))\r\n ], NativeType.None)\r\n );\r\n }\r\n } else {\r\n exprs.push(\r\n module.if(\r\n module.local_tee(1,\r\n module.global_get(global.internalName, nativeSizeType)\r\n ),\r\n module.call(visitInstance.internalName, [\r\n module.local_get(1, nativeSizeType), // tempRef != null\r\n module.local_get(0, NativeType.I32) // cookie\r\n ], NativeType.None)\r\n )\r\n );\r\n }\r\n }\r\n }\r\n module.addFunction(BuiltinSymbols.visit_globals, typeRef, [ nativeSizeType ],\r\n exprs.length\r\n ? module.block(null, exprs)\r\n : module.nop()\r\n );\r\n}\r\n\r\n/** Compiles the `visit_members` function. */\r\nexport function compileVisitMembers(compiler: Compiler): void {\r\n var program = compiler.program;\r\n var module = compiler.module;\r\n var usizeType = program.options.usizeType;\r\n var nativeSizeType = usizeType.toNativeType();\r\n var nativeSizeSize = usizeType.byteSize;\r\n var ftype = compiler.ensureFunctionType([ usizeType, Type.i32 ], Type.void); // ref, cookie\r\n var managedClasses = program.managedClasses;\r\n var visitInstance = assert(program.visitInstance);\r\n var blocks = new Array();\r\n var relooper = Relooper.create(module);\r\n\r\n var outer = relooper.addBlockWithSwitch(\r\n module.nop(),\r\n module.load(nativeSizeSize, false,\r\n nativeSizeType == NativeType.I64\r\n ? module.binary(BinaryOp.SubI64,\r\n module.local_get(0, nativeSizeType),\r\n module.i64(8)\r\n )\r\n : module.binary(BinaryOp.SubI32,\r\n module.local_get(0, nativeSizeType),\r\n module.i32(8) // rtId is at -8\r\n ),\r\n NativeType.I32,\r\n 0\r\n )\r\n );\r\n\r\n var lastId = 0;\r\n for (let [id, instance] of managedClasses) {\r\n assert(instance.type.isManaged);\r\n assert(id == lastId++);\r\n\r\n let visitImpl: Element | null;\r\n\r\n // if a library element, check if it implements a custom traversal function\r\n if (instance.isDeclaredInLibrary && (visitImpl = instance.lookupInSelf(\"__visit_impl\"))) {\r\n assert(visitImpl.kind == ElementKind.FUNCTION_PROTOTYPE);\r\n let visitFunc = program.resolver.resolveFunction(visitImpl, null);\r\n let block: RelooperBlockRef;\r\n if (!visitFunc || !compiler.compileFunction(visitFunc)) {\r\n block = relooper.addBlock(\r\n module.unreachable()\r\n );\r\n } else {\r\n let visitSig = visitFunc.signature;\r\n assert(\r\n visitSig.parameterTypes.length == 1 &&\r\n visitSig.parameterTypes[0] == Type.u32 &&\r\n visitSig.returnType == Type.void &&\r\n visitSig.thisType == instance.type\r\n );\r\n let callExpr = module.call(visitFunc.internalName, [\r\n module.local_get(0, nativeSizeType), // ref\r\n module.local_get(1, NativeType.I32) // cookie\r\n ], NativeType.None);\r\n block = relooper.addBlock(\r\n instance.base\r\n ? callExpr // branch will be added later\r\n : module.block(null, [\r\n callExpr,\r\n module.return()\r\n ])\r\n );\r\n }\r\n relooper.addBranchForSwitch(outer, block, [ id ]);\r\n blocks.push(block);\r\n\r\n // otherwise generate one\r\n } else {\r\n // traverse references assigned to own fields\r\n let code = new Array();\r\n let members = instance.members;\r\n if (members) {\r\n for (let member of members.values()) {\r\n if (member.kind == ElementKind.FIELD) {\r\n if ((member).parent === instance) {\r\n let fieldType = (member).type;\r\n if (fieldType.isManaged) {\r\n let fieldOffset = (member).memoryOffset;\r\n assert(fieldOffset >= 0);\r\n code.push(\r\n // if ($2 = value) FIELDCLASS~traverse($2)\r\n module.if(\r\n module.local_tee(2,\r\n module.load(nativeSizeSize, false,\r\n module.local_get(0, nativeSizeType),\r\n nativeSizeType, fieldOffset\r\n )\r\n ),\r\n module.call(visitInstance.internalName, [\r\n module.local_get(2, nativeSizeType), // ref\r\n module.local_get(1, NativeType.I32) // cookie\r\n ], NativeType.None)\r\n )\r\n );\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if (!instance.base) code.push(module.return());\r\n let block = relooper.addBlock(\r\n flatten(module, code, NativeType.None)\r\n );\r\n relooper.addBranchForSwitch(outer, block, [ id ]);\r\n blocks.push(block);\r\n }\r\n }\r\n for (let [id, instance] of managedClasses) {\r\n let base = instance.base;\r\n if (base) {\r\n relooper.addBranch(blocks[id], blocks[base.id]);\r\n }\r\n }\r\n blocks.push(\r\n relooper.addBlock(\r\n module.unreachable()\r\n )\r\n );\r\n relooper.addBranchForSwitch(outer, blocks[blocks.length - 1], []); // default\r\n compiler.compileFunction(visitInstance);\r\n module.addFunction(BuiltinSymbols.visit_members, ftype, [ nativeSizeType ], relooper.renderAndDispose(outer, 2));\r\n}\r\n\r\nfunction typeToRuntimeFlags(type: Type): TypeinfoFlags {\r\n var flags = TypeinfoFlags.VALUE_ALIGN_0 * (1 << type.alignLog2);\r\n if (type.is(TypeFlags.SIGNED)) flags |= TypeinfoFlags.VALUE_SIGNED;\r\n if (type.is(TypeFlags.FLOAT)) flags |= TypeinfoFlags.VALUE_FLOAT;\r\n if (type.is(TypeFlags.NULLABLE)) flags |= TypeinfoFlags.VALUE_NULLABLE;\r\n if (type.isManaged) flags |= TypeinfoFlags.VALUE_MANAGED;\r\n return flags / TypeinfoFlags.VALUE_ALIGN_0;\r\n}\r\n\r\n/** Compiles runtime type information for use by stdlib. */\r\nexport function compileRTTI(compiler: Compiler): void {\r\n var program = compiler.program;\r\n var module = compiler.module;\r\n var managedClasses = program.managedClasses;\r\n var count = managedClasses.size;\r\n var size = 4 + 8 * count;\r\n var data = new Uint8Array(size);\r\n writeI32(count, data, 0);\r\n var off = 4;\r\n var abvInstance = program.arrayBufferViewInstance;\r\n var abvPrototype = abvInstance.prototype;\r\n var arrayPrototype = program.arrayPrototype;\r\n var setPrototype = program.setPrototype;\r\n var mapPrototype = program.mapPrototype;\r\n var lastId = 0;\r\n for (let [id, instance] of managedClasses) {\r\n assert(id == lastId++);\r\n let flags: TypeinfoFlags = 0;\r\n if (instance.isAcyclic) flags |= TypeinfoFlags.ACYCLIC;\r\n if (instance !== abvInstance && instance.extends(abvPrototype)) {\r\n let valueType = instance.getArrayValueType();\r\n flags |= TypeinfoFlags.ARRAYBUFFERVIEW;\r\n if (instance.extends(arrayPrototype)) flags |= TypeinfoFlags.ARRAY;\r\n flags |= TypeinfoFlags.VALUE_ALIGN_0 * typeToRuntimeFlags(valueType);\r\n } else if (instance.extends(setPrototype)) {\r\n let typeArguments = assert(instance.getTypeArgumentsTo(setPrototype));\r\n assert(typeArguments.length == 1);\r\n flags |= TypeinfoFlags.SET;\r\n flags |= TypeinfoFlags.VALUE_ALIGN_0 * typeToRuntimeFlags(typeArguments[0]);\r\n } else if (instance.extends(mapPrototype)) {\r\n let typeArguments = assert(instance.getTypeArgumentsTo(mapPrototype));\r\n assert(typeArguments.length == 2);\r\n flags |= TypeinfoFlags.MAP;\r\n flags |= TypeinfoFlags.KEY_ALIGN_0 * typeToRuntimeFlags(typeArguments[0]);\r\n flags |= TypeinfoFlags.VALUE_ALIGN_0 * typeToRuntimeFlags(typeArguments[1]);\r\n }\r\n writeI32(flags, data, off); off += 4;\r\n instance.rttiFlags = flags;\r\n let base = instance.base;\r\n writeI32(base ? base.id : 0, data, off); off += 4;\r\n }\r\n assert(off == size);\r\n var usizeType = program.options.usizeType;\r\n var segment = compiler.addMemorySegment(data);\r\n if (usizeType.size == 8) {\r\n let offset = segment.offset;\r\n module.addGlobal(BuiltinSymbols.rtti_base, NativeType.I64, false, module.i64(i64_low(offset), i64_high(offset)));\r\n } else {\r\n module.addGlobal(BuiltinSymbols.rtti_base, NativeType.I32, false, module.i32(i64_low(segment.offset)));\r\n }\r\n}\r\n\r\n// Helpers\r\n\r\n/** Evaluates the constant type of a type argument *or* expression. */\r\nfunction evaluateConstantType(\r\n compiler: Compiler,\r\n typeArguments: Type[] | null,\r\n operands: Expression[],\r\n reportNode: CallExpression\r\n): Type | null {\r\n if (operands.length == 0) { // requires type argument\r\n if (!typeArguments || typeArguments.length != 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.typeArgumentsRange, \"1\", typeArguments ? typeArguments.length.toString(10) : \"0\"\r\n );\r\n return null;\r\n }\r\n return typeArguments[0];\r\n }\r\n if (operands.length == 1) { // optional type argument\r\n if (typeArguments) {\r\n if (typeArguments.length == 1) {\r\n compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT);\r\n } else {\r\n if (typeArguments.length) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.typeArgumentsRange, \"1\", typeArguments.length.toString(10)\r\n );\r\n return null;\r\n }\r\n compiler.compileExpressionRetainType(operands[0], Type.i32);\r\n }\r\n } else {\r\n compiler.compileExpressionRetainType(operands[0], Type.i32);\r\n }\r\n return compiler.currentType;\r\n }\r\n if (typeArguments && typeArguments.length > 1) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.typeArgumentsRange, \"1\", typeArguments.length.toString(10)\r\n );\r\n }\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.argumentsRange, \"1\", operands.length.toString(10)\r\n );\r\n return null;\r\n}\r\n\r\n/** Evaluates a compile-time constant immediate offset argument.*/\r\nfunction evaluateImmediateOffset(expression: Expression, compiler: Compiler): i32 {\r\n var expr: ExpressionRef;\r\n var value: i32;\r\n if (compiler.options.isWasm64) {\r\n expr = compiler.precomputeExpression(expression, Type.usize64, ContextualFlags.IMPLICIT);\r\n if (\r\n getExpressionId(expr) != ExpressionId.Const ||\r\n getExpressionType(expr) != NativeType.I64 ||\r\n getConstValueI64High(expr) != 0 ||\r\n (value = getConstValueI64Low(expr)) < 0\r\n ) {\r\n compiler.error(\r\n DiagnosticCode.Expression_must_be_a_compile_time_constant,\r\n expression.range\r\n );\r\n value = -1;\r\n }\r\n } else {\r\n expr = compiler.precomputeExpression(expression, Type.usize32, ContextualFlags.IMPLICIT);\r\n if (\r\n getExpressionId(expr) != ExpressionId.Const ||\r\n getExpressionType(expr) != NativeType.I32 ||\r\n (value = getConstValueI32(expr)) < 0\r\n ) {\r\n compiler.error(\r\n DiagnosticCode.Expression_must_be_a_compile_time_constant,\r\n expression.range\r\n );\r\n value = -1;\r\n }\r\n }\r\n return value;\r\n}\r\n\r\n/** Checks a call with a single required type argument. Returns `1` on error. */\r\nfunction checkTypeRequired(\r\n typeArguments: Type[] | null,\r\n reportNode: CallExpression,\r\n compiler: Compiler,\r\n setCurrentTypeOnError: bool = false\r\n): i32 {\r\n if (typeArguments) {\r\n let numTypeArguments = typeArguments.length;\r\n if (numTypeArguments == 1) return 0;\r\n assert(numTypeArguments); // invalid if 0, must not be set at all instead\r\n if (setCurrentTypeOnError) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.typeArgumentsRange, \"1\", numTypeArguments.toString()\r\n );\r\n } else {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.range, \"1\", \"0\"\r\n );\r\n }\r\n return 1;\r\n}\r\n\r\n/** Checks a call with a single optional type argument. Returns `1` on error. */\r\nfunction checkTypeOptional(\r\n typeArguments: Type[] | null,\r\n reportNode: CallExpression,\r\n compiler: Compiler,\r\n setCurrentTypeOnError: bool = false\r\n): i32 {\r\n if (typeArguments) {\r\n let numTypeArguments = typeArguments.length;\r\n if (numTypeArguments == 1) return 0;\r\n assert(numTypeArguments); // invalid if 0, must not be set at all instead\r\n if (setCurrentTypeOnError) compiler.currentType = typeArguments[0];\r\n compiler.error(\r\n DiagnosticCode.Expected_0_type_arguments_but_got_1,\r\n reportNode.typeArgumentsRange, \"1\", numTypeArguments.toString()\r\n );\r\n return 1;\r\n }\r\n return 0;\r\n}\r\n\r\n/** Checks a call that is not generic. Returns `1` on error. */\r\nfunction checkTypeAbsent(\r\n typeArguments: Type[] | null,\r\n reportNode: CallExpression,\r\n prototype: FunctionPrototype\r\n): i32 {\r\n if (typeArguments) {\r\n prototype.program.error(\r\n DiagnosticCode.Type_0_is_not_generic,\r\n reportNode.typeArgumentsRange, prototype.internalName\r\n );\r\n return 1;\r\n }\r\n return 0;\r\n}\r\n\r\n/** Checks a call that requires a fixed number of arguments. Returns `1` on error. */\r\nfunction checkArgsRequired(\r\n operands: Expression[],\r\n expected: i32,\r\n reportNode: CallExpression,\r\n compiler: Compiler\r\n): i32 {\r\n if (operands.length != expected) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, expected.toString(), operands.length.toString()\r\n );\r\n return 1;\r\n }\r\n return 0;\r\n}\r\n\r\n/** Checks a call that requires a variable number of arguments. Returns `1` on error. */\r\nfunction checkArgsOptional(\r\n operands: Expression[],\r\n expectedMinimum: i32,\r\n expectedMaximum: i32,\r\n reportNode: CallExpression,\r\n compiler: Compiler\r\n): i32 {\r\n var numOperands = operands.length;\r\n if (numOperands < expectedMinimum) {\r\n compiler.error(\r\n DiagnosticCode.Expected_at_least_0_arguments_but_got_1,\r\n reportNode.range, expectedMinimum.toString(), numOperands.toString()\r\n );\r\n return 1;\r\n } else if (numOperands > expectedMaximum) {\r\n compiler.error(\r\n DiagnosticCode.Expected_0_arguments_but_got_1,\r\n reportNode.range, expectedMaximum.toString(), numOperands.toString()\r\n );\r\n return 1;\r\n }\r\n return 0;\r\n}\r\n","/**\r\n * A decompiler that generates low-level AssemblyScript from WebAssembly binaries.\r\n * @module decompiler\r\n *//***/\r\n\r\nimport {\r\n Module,\r\n NativeType,\r\n ExpressionId,\r\n UnaryOp,\r\n BinaryOp,\r\n HostOp,\r\n FunctionRef,\r\n ExpressionRef,\r\n Index,\r\n getFunctionName,\r\n getFunctionBody,\r\n getFunctionParamCount,\r\n getFunctionParamType,\r\n getFunctionResultType,\r\n getExpressionId,\r\n getExpressionType,\r\n getBlockName,\r\n getBlockChildCount,\r\n getBlockChild,\r\n getIfCondition,\r\n getIfTrue,\r\n getIfFalse,\r\n getLoopName,\r\n getLoopBody,\r\n getBreakName,\r\n getBreakCondition,\r\n getLocalGetIndex,\r\n getLocalSetIndex,\r\n getLocalSetValue,\r\n getLoadOffset,\r\n getLoadPtr,\r\n getStoreOffset,\r\n getStorePtr,\r\n getStoreValue,\r\n getConstValueI32,\r\n getConstValueI64Low,\r\n getConstValueI64High,\r\n getConstValueF32,\r\n getConstValueF64,\r\n getUnaryOp,\r\n getUnaryValue,\r\n getBinaryOp,\r\n getBinaryLeft,\r\n getBinaryRight,\r\n getSelectThen,\r\n getSelectElse,\r\n getSelectCondition,\r\n getDropValue,\r\n getReturnValue,\r\n getHostOp,\r\n getHostOperand\r\n} from \"./module\";\r\n\r\n// TODO :-)\r\n\r\nexport class Decompiler {\r\n\r\n static decompile(module: Module): string {\r\n var decompiler = new Decompiler();\r\n decompiler.decompile(module);\r\n return decompiler.finish();\r\n }\r\n\r\n text: string[] = [];\r\n functionId: i32 = 0;\r\n\r\n constructor() { }\r\n\r\n /** Decompiles a module to an AST that can then be serialized. */\r\n decompile(module: Module): void {\r\n throw new Error(\"not implemented\");\r\n }\r\n\r\n decompileFunction(func: FunctionRef): void {\r\n var name = getFunctionName(func) || \"$\" + this.functionId.toString(10);\r\n var body = getFunctionBody(func);\r\n this.push(\"function \");\r\n this.push(name);\r\n this.push(\"(\");\r\n for (let i: Index = 0, k: Index = getFunctionParamCount(func); i < k; ++i) {\r\n if (i > 0) this.push(\", \");\r\n this.push(\"$\");\r\n this.push(i.toString(10));\r\n this.push(\": \");\r\n this.push(nativeTypeToType(getFunctionParamType(func, i)));\r\n }\r\n this.push(\"): \");\r\n this.push(nativeTypeToType(getFunctionResultType(func)));\r\n this.push(\" \");\r\n if (getExpressionId(body) != ExpressionId.Block) {\r\n this.push(\"{\\n\");\r\n }\r\n this.decompileExpression(body);\r\n if (getExpressionId(body) != ExpressionId.Block) {\r\n this.push(\"\\n}\\n\");\r\n }\r\n ++this.functionId;\r\n }\r\n\r\n decompileExpression(expr: ExpressionRef): void {\r\n var id = getExpressionId(expr);\r\n var type = getExpressionType(expr);\r\n\r\n var nested: ExpressionRef;\r\n var string: string | null;\r\n var i: Index, k: Index;\r\n\r\n switch (id) {\r\n case ExpressionId.Block: { // TODO: magic\r\n if ((string = getBlockName(expr)) != null) {\r\n this.push(string);\r\n this.push(\": \");\r\n }\r\n this.push(\"{\\n\");\r\n k = getBlockChildCount(expr);\r\n for (i = 0; i < k; ++i) {\r\n this.decompileExpression(getBlockChild(expr, i));\r\n }\r\n this.push(\"}\\n\");\r\n return;\r\n }\r\n case ExpressionId.If: {\r\n if (type == NativeType.None) {\r\n this.push(\"if (\");\r\n this.decompileExpression(getIfCondition(expr));\r\n this.push(\") \");\r\n this.decompileExpression(getIfTrue(expr));\r\n if (nested = getIfFalse(expr)) {\r\n this.push(\" else \");\r\n this.decompileExpression(nested);\r\n }\r\n } else {\r\n this.decompileExpression(getIfCondition(expr));\r\n this.push(\" ? \");\r\n this.decompileExpression(getIfTrue(expr));\r\n this.push(\" : \");\r\n this.decompileExpression(getIfFalse(expr));\r\n }\r\n return;\r\n }\r\n case ExpressionId.Loop: {\r\n if ((string = getLoopName(expr)) != null) {\r\n this.push(string);\r\n this.push(\": \");\r\n }\r\n this.push(\"do \");\r\n this.decompileExpression(getLoopBody(expr));\r\n this.push(\"while (0);\\n\");\r\n }\r\n case ExpressionId.Break: {\r\n if (nested = getBreakCondition(expr)) {\r\n this.push(\"if (\");\r\n this.decompileExpression(nested);\r\n this.push(\") \");\r\n }\r\n if ((string = getBreakName(expr)) != null) {\r\n this.push(\"break \");\r\n this.push(string);\r\n this.push(\";\\n\");\r\n } else {\r\n this.push(\"break;\\n\");\r\n }\r\n return;\r\n }\r\n case ExpressionId.Switch:\r\n case ExpressionId.Call:\r\n case ExpressionId.CallIndirect: {\r\n throw new Error(\"not implemented\");\r\n }\r\n case ExpressionId.LocalGet: {\r\n this.push(\"$\");\r\n this.push(getLocalGetIndex(expr).toString(10));\r\n return;\r\n }\r\n case ExpressionId.LocalSet: {\r\n this.push(\"$\");\r\n this.push(getLocalSetIndex(expr).toString(10));\r\n this.push(\" = \");\r\n this.decompileExpression(getLocalSetValue(expr));\r\n return;\r\n }\r\n case ExpressionId.GlobalGet:\r\n case ExpressionId.GlobalSet: {\r\n throw new Error(\"not implemented\");\r\n }\r\n case ExpressionId.Load: {\r\n this.push(\"load<\");\r\n this.push(nativeTypeToType(type));\r\n this.push(\">(\");\r\n this.push(getLoadOffset(expr).toString(10));\r\n this.push(\" + \");\r\n this.decompileExpression(getLoadPtr(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case ExpressionId.Store: {\r\n this.push(\"store<\");\r\n this.push(nativeTypeToType(type));\r\n this.push(\">(\");\r\n this.push(getStoreOffset(expr).toString(10));\r\n this.push(\" + \");\r\n this.decompileExpression(getStorePtr(expr));\r\n this.push(\", \");\r\n this.decompileExpression(getStoreValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case ExpressionId.Const: {\r\n switch (type) {\r\n case NativeType.I32: {\r\n this.push(getConstValueI32(expr).toString(10));\r\n return;\r\n }\r\n case NativeType.I64: {\r\n this.push(\r\n i64_to_string(\r\n i64_new(\r\n getConstValueI64Low(expr),\r\n getConstValueI64High(expr)\r\n )\r\n )\r\n );\r\n return;\r\n }\r\n case NativeType.F32: {\r\n this.push(getConstValueF32(expr).toString(10));\r\n return;\r\n }\r\n case NativeType.F64: {\r\n this.push(getConstValueF64(expr).toString(10));\r\n return;\r\n }\r\n }\r\n break;\r\n }\r\n case ExpressionId.Unary: {\r\n switch (getUnaryOp(expr)) {\r\n case UnaryOp.ClzI32: {\r\n this.push(\"clz(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.CtzI32: {\r\n this.push(\"ctz(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.PopcntI32: {\r\n this.push(\"popcnt(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.NegF32:\r\n case UnaryOp.NegF64: {\r\n this.push(\"-\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.AbsF32: {\r\n this.push(\"abs(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.CeilF32: {\r\n this.push(\"ceil(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.FloorF32: {\r\n this.push(\"floor(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.TruncF32: {\r\n this.push(\"trunc(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.NearestF32: {\r\n this.push(\"nearest(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.SqrtF32: {\r\n this.push(\"sqrt(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.EqzI32:\r\n case UnaryOp.EqzI64: {\r\n this.push(\"!\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.ClzI64: {\r\n this.push(\"clz(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.CtzI64: {\r\n this.push(\"ctz(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.PopcntI64: {\r\n this.push(\"popcnt(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.AbsF64: {\r\n this.push(\"abs(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.CeilF64: {\r\n this.push(\"ceil(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.FloorF64: {\r\n this.push(\"floor(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.TruncF64: {\r\n this.push(\"trunc(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.NearestF64: {\r\n this.push(\"nearest(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.SqrtF64: {\r\n this.push(\"sqrt(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.ExtendI32: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.ExtendU32: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.WrapI64: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.TruncF32ToI32: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.TruncF32ToI64: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.TruncF32ToU32: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.TruncF32ToU64: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.TruncF64ToI32: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.TruncF64ToI64: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.TruncF64ToU32: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.TruncF64ToU64: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.ReinterpretF32: {\r\n this.push(\"reinterpret(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.ReinterpretF64: {\r\n this.push(\"reinterpret(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.ConvertI32ToF32: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.ConvertI32ToF64: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.ConvertU32ToF32: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.ConvertU32ToF64: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.ConvertI64ToF32: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.ConvertI64ToF64: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.ConvertU64ToF32: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.ConvertU64ToF64: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.PromoteF32: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.DemoteF64: {\r\n this.push(\"\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n return;\r\n }\r\n case UnaryOp.ReinterpretI32: {\r\n this.push(\"reinterpret(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case UnaryOp.ReinterpretI64: {\r\n this.push(\"reinterpret(\");\r\n this.decompileExpression(getUnaryValue(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n }\r\n break;\r\n }\r\n case ExpressionId.Binary: { // TODO: precedence\r\n switch (getBinaryOp(expr)) {\r\n case BinaryOp.AddI32:\r\n case BinaryOp.AddI64:\r\n case BinaryOp.AddF32:\r\n case BinaryOp.AddF64: {\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" + \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.SubI32:\r\n case BinaryOp.SubI64:\r\n case BinaryOp.SubF32:\r\n case BinaryOp.SubF64: {\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" - \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.MulI32:\r\n case BinaryOp.MulI64:\r\n case BinaryOp.MulF32:\r\n case BinaryOp.MulF64: {\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" * \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.DivI32:\r\n case BinaryOp.DivI64:\r\n case BinaryOp.DivF32:\r\n case BinaryOp.DivF64: {\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" / \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.DivU32: {\r\n this.push(\"(\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" / \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case BinaryOp.RemI32:\r\n case BinaryOp.RemI64: {\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" % \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.RemU32: {\r\n this.push(\"(\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" / \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case BinaryOp.AndI32:\r\n case BinaryOp.AndI64: {\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" & \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.OrI32:\r\n case BinaryOp.OrI64: {\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" | \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.XorI32:\r\n case BinaryOp.XorI64: {\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" ^ \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.ShlI32:\r\n case BinaryOp.ShlI64: {\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" << \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.ShrU32:\r\n case BinaryOp.ShrU64: {\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" >>> \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.ShrI32:\r\n case BinaryOp.ShrI64: {\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" >> \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.RotlI32: {\r\n this.push(\"rotl(\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\", \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case BinaryOp.RotrI32: {\r\n this.push(\"rotr(\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\", \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case BinaryOp.EqI32:\r\n case BinaryOp.EqI64:\r\n case BinaryOp.EqF32:\r\n case BinaryOp.EqF64: {\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" == \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.NeI32:\r\n case BinaryOp.NeI64:\r\n case BinaryOp.NeF32:\r\n case BinaryOp.NeF64: {\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" != \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.LtI32:\r\n case BinaryOp.LtI64:\r\n case BinaryOp.LtF32:\r\n case BinaryOp.LtF64: {\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" < \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.LtU32: {\r\n this.push(\"\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" < \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.LeI32:\r\n case BinaryOp.LeI64:\r\n case BinaryOp.LeF32:\r\n case BinaryOp.LeF64: {\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" <= \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.LeU32: {\r\n this.push(\"\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" <= \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.GtI32:\r\n case BinaryOp.GtI64:\r\n case BinaryOp.GtF32:\r\n case BinaryOp.GtF64: {\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" > \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.GtU32: {\r\n this.push(\"\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" > \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.GeI32:\r\n case BinaryOp.GeI64:\r\n case BinaryOp.GeF32:\r\n case BinaryOp.GeF64: {\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" >= \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.GeU32: {\r\n this.push(\"\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" >= \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.DivU64: {\r\n this.push(\"\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" / \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.RemU64: {\r\n this.push(\"\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" % \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.RotlI64: {\r\n this.push(\"rotl(\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\", \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case BinaryOp.RotrI64: {\r\n this.push(\"rotr(\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\", \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case BinaryOp.LtU64: {\r\n this.push(\"\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" < \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.LeU64: {\r\n this.push(\"\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" <= \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.GtU64: {\r\n this.push(\"\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" > \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.GeU64: {\r\n this.push(\"\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\" >= \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n return;\r\n }\r\n case BinaryOp.CopysignF32: {\r\n this.push(\"copysign(\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\", \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case BinaryOp.MinF32: {\r\n this.push(\"min(\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\", \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case BinaryOp.MaxF32: {\r\n this.push(\"max(\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\", \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case BinaryOp.CopysignF64: {\r\n this.push(\"copysign(\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\", \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case BinaryOp.MinF64: {\r\n this.push(\"min(\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\", \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case BinaryOp.MaxF64: {\r\n this.push(\"max(\");\r\n this.decompileExpression(getBinaryLeft(expr));\r\n this.push(\", \");\r\n this.decompileExpression(getBinaryRight(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n }\r\n return;\r\n }\r\n case ExpressionId.Select: {\r\n this.push(\"select<\");\r\n this.push(nativeTypeToType(type));\r\n this.push(\">(\");\r\n this.decompileExpression(getSelectThen(expr));\r\n this.push(\", \");\r\n this.decompileExpression(getSelectElse(expr));\r\n this.push(\", \");\r\n this.decompileExpression(getSelectCondition(expr));\r\n this.push(\")\");\r\n return;\r\n }\r\n case ExpressionId.Drop: {\r\n this.decompileExpression(getDropValue(expr));\r\n this.push(\";\\n\");\r\n return;\r\n }\r\n case ExpressionId.Return: {\r\n if (nested = getReturnValue(expr)) {\r\n this.push(\"return \");\r\n this.decompileExpression(nested);\r\n this.push(\";\\n\");\r\n } else {\r\n this.push(\"return;\\n\");\r\n }\r\n return;\r\n }\r\n case ExpressionId.Host: {\r\n switch (getHostOp(expr)) {\r\n case HostOp.MemorySize: {\r\n this.push(\"memory.size()\");\r\n return;\r\n }\r\n case HostOp.MemoryGrow: {\r\n this.push(\"memory.grow(\");\r\n this.decompileExpression(getHostOperand(expr, 0));\r\n this.push(\")\");\r\n return;\r\n }\r\n }\r\n break;\r\n }\r\n case ExpressionId.Nop: {\r\n this.push(\";\\n\");\r\n return;\r\n }\r\n case ExpressionId.Unreachable: {\r\n this.push(\"unreachable()\");\r\n return;\r\n }\r\n case ExpressionId.AtomicCmpxchg:\r\n case ExpressionId.AtomicRMW:\r\n case ExpressionId.AtomicWait:\r\n case ExpressionId.AtomicNotify:\r\n }\r\n throw new Error(\"not implemented\");\r\n }\r\n\r\n private push(text: string): void {\r\n // mostly here so we can add debugging if necessary\r\n this.text.push(text);\r\n }\r\n\r\n finish(): string {\r\n var ret = this.text.join(\"\");\r\n this.text = [];\r\n return ret;\r\n }\r\n}\r\n\r\nfunction nativeTypeToType(type: NativeType): string {\r\n switch (type) {\r\n case NativeType.None: return \"void\";\r\n case NativeType.I32: return \"i32\";\r\n case NativeType.I64: return \"i64\";\r\n case NativeType.F32: return \"f32\";\r\n case NativeType.F64: return \"f64\";\r\n case NativeType.V128: return \"v128\";\r\n case NativeType.Unreachable: throw new Error(\"unreachable type\");\r\n case NativeType.Auto: throw new Error(\"auto type\");\r\n default: throw new Error(\"unexpected type\");\r\n }\r\n}\r\n","/**\r\n * Definition builders for WebIDL and TypeScript.\r\n * @module definitions\r\n *//***/\r\n\r\n import {\r\n CommonFlags\r\n} from \"./common\";\r\n\r\nimport {\r\n Program,\r\n Element,\r\n ElementKind,\r\n Global,\r\n Enum,\r\n EnumValue,\r\n Field,\r\n Function,\r\n FunctionPrototype,\r\n Class,\r\n ClassPrototype,\r\n Namespace,\r\n ConstantValueKind,\r\n Interface,\r\n Property,\r\n PropertyPrototype,\r\n File\r\n} from \"./program\";\r\n\r\nimport {\r\n Type,\r\n TypeKind\r\n} from \"./types\";\r\n\r\nimport {\r\n indent\r\n} from \"./util\";\r\n\r\n/** Walker base class. */\r\nabstract class ExportsWalker {\r\n\r\n /** Program reference. */\r\n program: Program;\r\n /** Whether to include private members */\r\n includePrivate: bool;\r\n /** Already seen elements. */\r\n seen: Map = new Map();\r\n\r\n /** Constructs a new Element walker. */\r\n constructor(program: Program, includePrivate: bool = false) {\r\n this.program = program;\r\n this.includePrivate;\r\n }\r\n\r\n /** Walks all elements and calls the respective handlers. */\r\n walk(): void {\r\n for (let file of this.program.filesByName.values()) {\r\n if (file.source.isEntry) this.visitFile(file);\r\n }\r\n }\r\n\r\n /** Visits all exported elements of a file. */\r\n visitFile(file: File): void {\r\n var members = file.exports;\r\n if (members) {\r\n for (let [name, member] of members) this.visitElement(name, member);\r\n }\r\n var exportsStar = file.exportsStar;\r\n if (exportsStar) {\r\n for (let exportStar of exportsStar) this.visitFile(exportStar);\r\n }\r\n }\r\n\r\n /** Visits an element.*/\r\n visitElement(name: string, element: Element): void {\r\n if (element.is(CommonFlags.PRIVATE) && !this.includePrivate) return;\r\n var seen = this.seen;\r\n if (seen.has(element)) {\r\n this.visitAlias(name, element, seen.get(element));\r\n return;\r\n }\r\n seen.set(element, name);\r\n switch (element.kind) {\r\n case ElementKind.GLOBAL: {\r\n if (element.is(CommonFlags.COMPILED)) this.visitGlobal(name, element);\r\n break;\r\n }\r\n case ElementKind.ENUM: {\r\n if (element.is(CommonFlags.COMPILED)) this.visitEnum(name, element);\r\n break;\r\n }\r\n case ElementKind.FUNCTION_PROTOTYPE: {\r\n this.visitFunctionInstances(name, element);\r\n break;\r\n }\r\n case ElementKind.CLASS_PROTOTYPE: {\r\n this.visitClassInstances(name, element);\r\n break;\r\n }\r\n case ElementKind.FIELD: {\r\n if ((element).is(CommonFlags.COMPILED)) this.visitField(name, element);\r\n break;\r\n }\r\n case ElementKind.PROPERTY_PROTOTYPE: {\r\n this.visitPropertyInstances(name, element);\r\n break;\r\n }\r\n case ElementKind.PROPERTY: {\r\n let prop = element;\r\n let getter = prop.getterInstance;\r\n if (getter) this.visitFunction(name, getter);\r\n let setter = prop.setterInstance;\r\n if (setter) this.visitFunction(name, setter);\r\n break;\r\n }\r\n case ElementKind.NAMESPACE: {\r\n if (hasCompiledMember(element)) this.visitNamespace(name, element);\r\n break;\r\n }\r\n case ElementKind.TYPEDEFINITION: break;\r\n default: assert(false);\r\n }\r\n }\r\n\r\n private visitFunctionInstances(name: string, element: FunctionPrototype): void {\r\n var instances = element.instances;\r\n if (instances) {\r\n for (let instance of instances.values()) {\r\n if (instance.is(CommonFlags.COMPILED)) this.visitFunction(name, instance);\r\n }\r\n }\r\n }\r\n\r\n private visitClassInstances(name: string, element: ClassPrototype): void {\r\n var instances = element.instances;\r\n if (instances) {\r\n for (let instance of instances.values()) {\r\n if (instance.is(CommonFlags.COMPILED)) this.visitClass(name, instance);\r\n }\r\n }\r\n }\r\n\r\n private visitPropertyInstances(name: string, element: PropertyPrototype): void {\r\n // var instances = element.instances;\r\n // if (instances) {\r\n // for (let instance of instances.values()) {\r\n // if (instance.is(CommonFlags.COMPILED)) this.visitProperty(instance);\r\n // }\r\n // }\r\n assert(false);\r\n }\r\n\r\n abstract visitGlobal(name: string, element: Global): void;\r\n abstract visitEnum(name: string, element: Enum): void;\r\n abstract visitFunction(name: string, element: Function): void;\r\n abstract visitClass(name: string, element: Class): void;\r\n abstract visitInterface(name: string, element: Interface): void;\r\n abstract visitField(name: string, element: Field): void;\r\n abstract visitNamespace(name: string, element: Element): void;\r\n abstract visitAlias(name: string, element: Element, originalName: string): void;\r\n}\r\n\r\n/** A WebIDL definitions builder. */\r\nexport class IDLBuilder extends ExportsWalker {\r\n\r\n /** Builds WebIDL definitions for the specified program. */\r\n static build(program: Program): string {\r\n return new IDLBuilder(program).build();\r\n }\r\n\r\n private sb: string[] = [];\r\n private indentLevel: i32 = 0;\r\n\r\n /** Constructs a new WebIDL builder. */\r\n constructor(program: Program, includePrivate: bool = false) {\r\n super(program, includePrivate);\r\n }\r\n\r\n visitGlobal(name: string, element: Global): void {\r\n var sb = this.sb;\r\n var isConst = element.is(CommonFlags.INLINED);\r\n indent(sb, this.indentLevel);\r\n if (isConst) sb.push(\"const \");\r\n sb.push(this.typeToString(element.type));\r\n sb.push(\" \");\r\n sb.push(name);\r\n if (isConst) {\r\n switch (element.constantValueKind) {\r\n case ConstantValueKind.INTEGER: {\r\n sb.push(\" = \");\r\n sb.push(i64_to_string(element.constantIntegerValue));\r\n break;\r\n }\r\n case ConstantValueKind.FLOAT: {\r\n sb.push(\" = \");\r\n sb.push(element.constantFloatValue.toString());\r\n break;\r\n }\r\n default: assert(false);\r\n }\r\n }\r\n sb.push(\";\\n\");\r\n }\r\n\r\n visitEnum(name: string, element: Enum): void {\r\n var sb = this.sb;\r\n indent(sb, this.indentLevel++);\r\n sb.push(\"interface \");\r\n sb.push(name);\r\n sb.push(\" {\\n\");\r\n var members = element.members;\r\n if (members) {\r\n for (let [name, member] of members) {\r\n if (member.kind == ElementKind.ENUMVALUE) {\r\n let isConst = (member).is(CommonFlags.INLINED);\r\n indent(sb, this.indentLevel);\r\n if (isConst) sb.push(\"const \");\r\n else sb.push(\"readonly \");\r\n sb.push(\"unsigned long \");\r\n sb.push(name);\r\n if (isConst) {\r\n sb.push(\" = \");\r\n assert((member).constantValueKind == ConstantValueKind.INTEGER);\r\n sb.push(i64_low((member).constantIntegerValue).toString(10));\r\n }\r\n sb.push(\";\\n\");\r\n }\r\n }\r\n for (let member of members.values()) {\r\n if (member.kind != ElementKind.ENUMVALUE) this.visitElement(member.name, member);\r\n }\r\n }\r\n indent(sb, --this.indentLevel);\r\n sb.push(\"}\\n\");\r\n }\r\n\r\n visitFunction(name: string, element: Function): void {\r\n var sb = this.sb;\r\n var signature = element.signature;\r\n indent(sb, this.indentLevel);\r\n sb.push(this.typeToString(signature.returnType));\r\n sb.push(\" \");\r\n sb.push(name);\r\n sb.push(\"(\");\r\n var parameters = signature.parameterTypes;\r\n var numParameters = parameters.length;\r\n // var requiredParameters = signature.requiredParameters;\r\n for (let i = 0; i < numParameters; ++i) {\r\n if (i) sb.push(\", \");\r\n // if (i >= requiredParameters) sb.push(\"optional \");\r\n sb.push(this.typeToString(parameters[i]));\r\n sb.push(\" \");\r\n sb.push(signature.getParameterName(i));\r\n }\r\n sb.push(\");\\n\");\r\n var members = element.members;\r\n if (members && members.size) {\r\n indent(sb, this.indentLevel);\r\n sb.push(\"interface \");\r\n sb.push(element.name);\r\n sb.push(\" {\\n\");\r\n for (let member of members.values()) this.visitElement(member.name, member);\r\n indent(sb, --this.indentLevel);\r\n sb.push(\"}\\n\");\r\n }\r\n }\r\n\r\n visitClass(name: string, element: Class): void {\r\n var sb = this.sb;\r\n indent(sb, this.indentLevel++);\r\n sb.push(\"interface \");\r\n sb.push(name);\r\n sb.push(\" {\\n\");\r\n // TODO\r\n indent(sb, --this.indentLevel);\r\n sb.push(\"}\\n\");\r\n }\r\n\r\n visitInterface(name: string, element: Interface): void {\r\n this.visitClass(name, element);\r\n }\r\n\r\n visitField(name: string, element: Field): void {\r\n // TODO\r\n }\r\n\r\n visitNamespace(name: string, element: Namespace): void {\r\n var sb = this.sb;\r\n indent(sb, this.indentLevel++);\r\n sb.push(\"interface \");\r\n sb.push(name);\r\n sb.push(\" {\\n\");\r\n var members = element.members;\r\n if (members) {\r\n for (let member of members.values()) this.visitElement(member.name, member);\r\n }\r\n indent(sb, --this.indentLevel);\r\n sb.push(\"}\\n\");\r\n }\r\n\r\n visitAlias(name: string, element: Element, originalName: string): void {\r\n // TODO\r\n }\r\n\r\n typeToString(type: Type): string {\r\n switch (type.kind) {\r\n case TypeKind.I8: return \"byte\";\r\n case TypeKind.I16: return \"short\";\r\n case TypeKind.I32: return \"long\";\r\n case TypeKind.I64: return \"long long\";\r\n case TypeKind.ISIZE: return this.program.options.isWasm64 ? \"long long\" : \"long\";\r\n case TypeKind.U8: return \"octet\";\r\n case TypeKind.U16: return \"unsigned short\";\r\n case TypeKind.U32: return \"unsigned long\";\r\n // ^ TODO: function types\r\n case TypeKind.U64: return \"unsigned long long\";\r\n case TypeKind.USIZE: return this.program.options.isWasm64 ? \"unsigned long long\" : \"unsigned long\";\r\n // ^ TODO: class types\r\n case TypeKind.BOOL: return \"boolean\";\r\n case TypeKind.F32: return \"unrestricted float\";\r\n case TypeKind.F64: return \"unrestricted double\";\r\n case TypeKind.VOID: return \"void\";\r\n default: {\r\n assert(false);\r\n return \"\";\r\n }\r\n }\r\n }\r\n\r\n build(): string {\r\n var sb = this.sb;\r\n sb.push(\"interface ASModule {\\n\");\r\n ++this.indentLevel;\r\n this.walk();\r\n --this.indentLevel;\r\n sb.push(\"}\\n\");\r\n return sb.join(\"\");\r\n }\r\n}\r\n\r\n/** A TypeScript definitions builder. */\r\nexport class TSDBuilder extends ExportsWalker {\r\n\r\n /** Builds TypeScript definitions for the specified program. */\r\n static build(program: Program): string {\r\n return new TSDBuilder(program).build();\r\n }\r\n\r\n private sb: string[] = [];\r\n private indentLevel: i32 = 0;\r\n private unknown: Set = new Set();\r\n\r\n /** Constructs a new WebIDL builder. */\r\n constructor(program: Program, includePrivate: bool = false) {\r\n super(program, includePrivate);\r\n }\r\n\r\n visitGlobal(name: string, element: Global): void {\r\n var sb = this.sb;\r\n var isConst = element.is(CommonFlags.INLINED);\r\n indent(sb, this.indentLevel);\r\n if (element.is(CommonFlags.STATIC)) {\r\n if (isConst) sb.push(\"static readonly \");\r\n else sb.push(\"static \");\r\n } else {\r\n if (isConst) sb.push(\"export const \");\r\n else sb.push(\"export var \");\r\n }\r\n sb.push(name);\r\n sb.push(\": \");\r\n sb.push(this.typeToString(element.type));\r\n sb.push(\";\\n\");\r\n this.visitNamespace(name, element);\r\n }\r\n\r\n visitEnum(name: string, element: Enum): void {\r\n var sb = this.sb;\r\n indent(sb, this.indentLevel++);\r\n sb.push(\"export enum \");\r\n sb.push(name);\r\n sb.push(\" {\\n\");\r\n var members = element.members;\r\n if (members) {\r\n let numMembers = members.size;\r\n for (let [name, member] of members) {\r\n if (member.kind == ElementKind.ENUMVALUE) {\r\n indent(sb, this.indentLevel);\r\n sb.push(name);\r\n if (member.is(CommonFlags.INLINED)) {\r\n sb.push(\" = \");\r\n assert((member).constantValueKind == ConstantValueKind.INTEGER);\r\n sb.push(i64_low((member).constantIntegerValue).toString(10));\r\n }\r\n sb.push(\",\\n\");\r\n --numMembers;\r\n }\r\n }\r\n if (numMembers) this.visitNamespace(name, element);\r\n }\r\n indent(sb, --this.indentLevel);\r\n sb.push(\"}\\n\");\r\n }\r\n\r\n visitFunction(name: string, element: Function): void {\r\n if (element.isAny(CommonFlags.PRIVATE | CommonFlags.SET)) return;\r\n var sb = this.sb;\r\n var signature = element.signature;\r\n indent(sb, this.indentLevel);\r\n if (element.is(CommonFlags.PROTECTED)) sb.push(\"protected \");\r\n if (element.is(CommonFlags.STATIC)) sb.push(\"static \");\r\n if (element.is(CommonFlags.GET)) {\r\n sb.push(\"get \");\r\n sb.push(name); // 'get:funcName' internally\r\n sb.push(\"(): \");\r\n sb.push(this.typeToString(signature.returnType));\r\n sb.push(\";\\n\");\r\n return;\r\n } else {\r\n if (!element.isAny(CommonFlags.STATIC | CommonFlags.INSTANCE)) sb.push(\"export function \");\r\n sb.push(name);\r\n }\r\n sb.push(\"(\");\r\n var parameters = signature.parameterTypes;\r\n var numParameters = parameters.length;\r\n // var requiredParameters = signature.requiredParameters;\r\n for (let i = 0; i < numParameters; ++i) {\r\n if (i) sb.push(\", \");\r\n // if (i >= requiredParameters) sb.push(\"optional \");\r\n sb.push(signature.getParameterName(i));\r\n sb.push(\": \");\r\n sb.push(this.typeToString(parameters[i]));\r\n }\r\n if (element.isAny(CommonFlags.CONSTRUCTOR | CommonFlags.SET)) {\r\n sb.push(\")\");\r\n } else {\r\n sb.push(\"): \");\r\n sb.push(this.typeToString(signature.returnType));\r\n }\r\n sb.push(\";\\n\");\r\n this.visitNamespace(name, element);\r\n }\r\n\r\n visitClass(name: string, element: Class): void {\r\n var sb = this.sb;\r\n var isInterface = element.kind == ElementKind.INTERFACE;\r\n indent(sb, this.indentLevel++);\r\n if (isInterface) {\r\n sb.push(\"export interface \");\r\n } else {\r\n if (element.is(CommonFlags.ABSTRACT)) sb.push(\"abstract \");\r\n sb.push(\"export class \");\r\n }\r\n sb.push(name);\r\n // var base = element.base;\r\n // if (base && base.is(CommonFlags.COMPILED | CommonFlags.MODULE_EXPORT)) {\r\n // sb.push(\" extends \");\r\n // sb.push(base.name); // TODO: fqn\r\n // }\r\n sb.push(\" {\\n\");\r\n var staticMembers = element.prototype.members;\r\n if (staticMembers) {\r\n for (let member of staticMembers.values()) this.visitElement(member.name, member);\r\n }\r\n var instanceMembers = element.members;\r\n if (instanceMembers) {\r\n for (let member of instanceMembers.values()) this.visitElement(member.name, member);\r\n }\r\n indent(sb, --this.indentLevel);\r\n sb.push(\"}\\n\");\r\n }\r\n\r\n visitInterface(name: string, element: Interface): void {\r\n this.visitClass(name, element);\r\n }\r\n\r\n visitField(name: string, element: Field): void {\r\n if (element.is(CommonFlags.PRIVATE)) return;\r\n var sb = this.sb;\r\n indent(sb, this.indentLevel);\r\n if (element.is(CommonFlags.PROTECTED)) sb.push(\"protected \");\r\n if (element.is(CommonFlags.STATIC)) sb.push(\"static \");\r\n if (element.is(CommonFlags.READONLY)) sb.push(\"readonly \");\r\n sb.push(name);\r\n sb.push(\": \");\r\n sb.push(this.typeToString(element.type));\r\n sb.push(\";\\n\");\r\n }\r\n\r\n visitNamespace(name: string, element: Element): void {\r\n var members = element.members;\r\n if (members && members.size) {\r\n let sb = this.sb;\r\n indent(sb, this.indentLevel++);\r\n sb.push(\"export namespace \");\r\n sb.push(name);\r\n sb.push(\" {\\n\");\r\n for (let member of members.values()) this.visitElement(member.name, member);\r\n indent(sb, --this.indentLevel);\r\n sb.push(\"}\\n\");\r\n }\r\n }\r\n\r\n visitAlias(name: string, element: Element, originalName: string): void {\r\n var sb = this.sb;\r\n indent(sb, this.indentLevel);\r\n sb.push(\"export const \");\r\n sb.push(name);\r\n sb.push(\" = typeof \");\r\n sb.push(originalName);\r\n sb.push(\";\\n\");\r\n }\r\n\r\n typeToString(type: Type): string {\r\n switch (type.kind) {\r\n case TypeKind.I8: return \"i8\";\r\n case TypeKind.I16: return \"i16\";\r\n case TypeKind.I32: return \"i32\";\r\n case TypeKind.I64: return \"I64\";\r\n case TypeKind.ISIZE: return this.program.options.isWasm64 ? \"I64\" : \"i32\";\r\n case TypeKind.U8: return \"u8\";\r\n case TypeKind.U16: return \"u16\";\r\n case TypeKind.U32: return \"u32\";\r\n // ^ TODO: function types\r\n case TypeKind.U64: return \"U64\";\r\n case TypeKind.USIZE: return this.program.options.isWasm64 ? \"U64\" : \"u32\";\r\n // ^ TODO: class types\r\n case TypeKind.BOOL: return \"bool\";\r\n case TypeKind.F32: return \"f32\";\r\n case TypeKind.F64: return \"f64\";\r\n case TypeKind.V128: return \"v128\";\r\n case TypeKind.VOID: return \"void\";\r\n default: {\r\n assert(false);\r\n return \"any\";\r\n }\r\n }\r\n }\r\n\r\n build(): string {\r\n var sb = this.sb;\r\n sb.push(\"declare module ASModule {\\n\");\r\n sb.push(\" type i8 = number;\\n\");\r\n sb.push(\" type i16 = number;\\n\");\r\n sb.push(\" type i32 = number;\\n\");\r\n sb.push(\" type u8 = number;\\n\");\r\n sb.push(\" type u16 = number;\\n\");\r\n sb.push(\" type u32 = number;\\n\");\r\n sb.push(\" type f32 = number;\\n\");\r\n sb.push(\" type f64 = number;\\n\");\r\n sb.push(\" type bool = any;\\n\");\r\n ++this.indentLevel;\r\n this.walk();\r\n --this.indentLevel;\r\n sb.push(\"}\\n\");\r\n sb.push(\"export default ASModule;\\n\");\r\n return this.sb.join(\"\");\r\n }\r\n}\r\n\r\n// helpers\r\n\r\n/** Tests if a namespace-like element has at least one compiled member. */\r\nfunction hasCompiledMember(element: Element): bool {\r\n var members = element.members;\r\n if (members) {\r\n for (let member of members.values()) {\r\n switch (member.kind) {\r\n case ElementKind.FUNCTION_PROTOTYPE: {\r\n let instances = (member).instances;\r\n if (instances) {\r\n for (let instance of instances.values()) {\r\n if (instance.is(CommonFlags.COMPILED)) return true;\r\n }\r\n }\r\n break;\r\n }\r\n case ElementKind.CLASS_PROTOTYPE: {\r\n let instances = (member).instances;\r\n if (instances) {\r\n for (let instance of instances.values()) {\r\n if (instance.is(CommonFlags.COMPILED)) return true;\r\n }\r\n }\r\n break;\r\n }\r\n default: {\r\n if (member.is(CommonFlags.COMPILED) || hasCompiledMember(member)) return true;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n return false;\r\n}\r\n","/**\r\n * A TypeScript parser for the AssemblyScript subset.\r\n * @module parser\r\n *//***/\r\n\r\nimport {\r\n CommonFlags,\r\n LIBRARY_PREFIX,\r\n PATH_DELIMITER\r\n} from \"./common\";\r\n\r\nimport {\r\n Program\r\n} from \"./program\";\r\n\r\nimport {\r\n Tokenizer,\r\n Token,\r\n Range,\r\n CommentHandler,\r\n IdentifierHandling\r\n} from \"./tokenizer\";\r\n\r\nimport {\r\n DiagnosticCode,\r\n DiagnosticEmitter\r\n} from \"./diagnostics\";\r\n\r\nimport {\r\n normalizePath\r\n} from \"./util\";\r\n\r\nimport {\r\n Node,\r\n NodeKind,\r\n Source,\r\n SourceKind,\r\n CommonTypeNode,\r\n TypeNode,\r\n SignatureNode,\r\n ArrowKind,\r\n\r\n Expression,\r\n AssertionKind,\r\n CallExpression,\r\n ClassExpression,\r\n FunctionExpression,\r\n IdentifierExpression,\r\n StringLiteralExpression,\r\n\r\n Statement,\r\n BlockStatement,\r\n BreakStatement,\r\n ClassDeclaration,\r\n ContinueStatement,\r\n DeclarationStatement,\r\n DecoratorNode,\r\n DoStatement,\r\n EnumDeclaration,\r\n EnumValueDeclaration,\r\n ExportImportStatement,\r\n ExportMember,\r\n ExportStatement,\r\n ExpressionStatement,\r\n ForStatement,\r\n FunctionDeclaration,\r\n IfStatement,\r\n ImportDeclaration,\r\n ImportStatement,\r\n IndexSignatureDeclaration,\r\n NamespaceDeclaration,\r\n ParameterNode,\r\n ParameterKind,\r\n ReturnStatement,\r\n SwitchCase,\r\n SwitchStatement,\r\n ThrowStatement,\r\n TryStatement,\r\n TypeDeclaration,\r\n TypeParameterNode,\r\n VariableStatement,\r\n VariableDeclaration,\r\n VoidStatement,\r\n WhileStatement,\r\n\r\n mangleInternalPath,\r\n nodeIsCallable,\r\n nodeIsGenericCallable\r\n} from \"./ast\";\r\n\r\n/** Parser interface. */\r\nexport class Parser extends DiagnosticEmitter {\r\n\r\n /** Program being created. */\r\n program: Program;\r\n /** Source file names to be requested next. */\r\n backlog: string[] = new Array();\r\n /** Source file names already seen, that is processed or backlogged. */\r\n seenlog: Set = new Set();\r\n /** Source file names already completely processed. */\r\n donelog: Set = new Set();\r\n /** Optional handler to intercept comments while tokenizing. */\r\n onComment: CommentHandler | null = null;\r\n\r\n /** Constructs a new parser. */\r\n constructor() {\r\n super();\r\n this.program = new Program(this.diagnostics);\r\n }\r\n\r\n /** Parses a file and adds its definitions to the program. */\r\n parseFile(\r\n text: string,\r\n path: string,\r\n isEntry: bool\r\n ): void {\r\n var normalizedPath = normalizePath(path);\r\n var internalPath = mangleInternalPath(normalizedPath);\r\n\r\n // check if already processed\r\n if (this.donelog.has(internalPath)) return;\r\n this.donelog.add(internalPath); // do not parse again\r\n this.seenlog.add(internalPath); // do not request again\r\n\r\n // create the source element\r\n var source = new Source(\r\n normalizedPath,\r\n text,\r\n isEntry\r\n ? SourceKind.ENTRY\r\n : path.startsWith(LIBRARY_PREFIX) && path.indexOf(PATH_DELIMITER, LIBRARY_PREFIX.length) < 0\r\n ? SourceKind.LIBRARY\r\n : SourceKind.DEFAULT\r\n );\r\n var program = this.program;\r\n program.sources.push(source);\r\n\r\n // tokenize and parse\r\n var tn = new Tokenizer(source, program.diagnostics);\r\n tn.onComment = this.onComment;\r\n source.tokenizer = tn;\r\n var statements = source.statements;\r\n while (!tn.skip(Token.ENDOFFILE)) {\r\n let statement = this.parseTopLevelStatement(tn, null);\r\n if (statement) statements.push(statement);\r\n }\r\n tn.finish();\r\n }\r\n\r\n /** Parses a top-level statement. */\r\n parseTopLevelStatement(\r\n tn: Tokenizer,\r\n namespace: NamespaceDeclaration | null = null\r\n ): Statement | null {\r\n var flags = CommonFlags.NONE;\r\n var startPos: i32 = -1;\r\n\r\n // check decorators\r\n var decorators: DecoratorNode[] | null = null;\r\n while (tn.skip(Token.AT)) {\r\n if (startPos < 0) startPos = tn.tokenPos;\r\n let decorator = this.parseDecorator(tn);\r\n if (!decorator) {\r\n this.skipStatement(tn);\r\n continue;\r\n }\r\n if (!decorators) decorators = [decorator];\r\n else decorators.push(decorator);\r\n }\r\n\r\n // check modifiers\r\n var exportStart: i32 = 0;\r\n var exportEnd: i32 = 0;\r\n var defaultStart: i32 = 0;\r\n var defaultEnd: i32 = 0;\r\n if (tn.skip(Token.EXPORT)) {\r\n if (startPos < 0) startPos = tn.tokenPos;\r\n flags |= CommonFlags.EXPORT;\r\n exportStart = tn.tokenPos;\r\n exportEnd = tn.pos;\r\n if (tn.skip(Token.DEFAULT)) {\r\n defaultStart = tn.tokenPos;\r\n defaultEnd = tn.pos;\r\n }\r\n }\r\n\r\n var declareStart: i32 = 0;\r\n var declareEnd: i32 = 0;\r\n var contextIsAmbient = namespace != null && namespace.is(CommonFlags.AMBIENT);\r\n if (tn.skip(Token.DECLARE)) {\r\n if (contextIsAmbient) {\r\n this.error(\r\n DiagnosticCode.A_declare_modifier_cannot_be_used_in_an_already_ambient_context,\r\n tn.range()\r\n ); // recoverable\r\n } else {\r\n if (startPos < 0) startPos = tn.tokenPos;\r\n declareStart = startPos;\r\n declareEnd = tn.pos;\r\n flags |= CommonFlags.DECLARE | CommonFlags.AMBIENT;\r\n }\r\n } else if (contextIsAmbient) {\r\n flags |= CommonFlags.AMBIENT;\r\n }\r\n\r\n // parse the statement\r\n var statement: Statement | null = null;\r\n\r\n // handle declarations\r\n var first = tn.peek();\r\n if (startPos < 0) startPos = tn.nextTokenPos;\r\n switch (first) {\r\n case Token.CONST: {\r\n tn.next();\r\n flags |= CommonFlags.CONST;\r\n if (tn.skip(Token.ENUM)) {\r\n statement = this.parseEnum(tn, flags, decorators, startPos);\r\n } else {\r\n statement = this.parseVariable(tn, flags, decorators, startPos);\r\n }\r\n decorators = null;\r\n break;\r\n }\r\n case Token.LET: flags |= CommonFlags.LET;\r\n case Token.VAR: {\r\n tn.next();\r\n statement = this.parseVariable(tn, flags, decorators, startPos);\r\n decorators = null;\r\n break;\r\n }\r\n case Token.ENUM: {\r\n tn.next();\r\n statement = this.parseEnum(tn, flags, decorators, startPos);\r\n decorators = null;\r\n break;\r\n }\r\n case Token.FUNCTION: {\r\n tn.next();\r\n statement = this.parseFunction(tn, flags, decorators, startPos);\r\n decorators = null;\r\n break;\r\n }\r\n case Token.ABSTRACT: {\r\n let state = tn.mark();\r\n tn.next();\r\n if (!tn.skip(Token.CLASS)) {\r\n tn.reset(state);\r\n statement = this.parseStatement(tn, true);\r\n break;\r\n } else {\r\n tn.discard(state);\r\n }\r\n flags |= CommonFlags.ABSTRACT;\r\n // fall through\r\n }\r\n case Token.CLASS:\r\n case Token.INTERFACE: {\r\n tn.next();\r\n statement = this.parseClassOrInterface(tn, flags, decorators, startPos);\r\n decorators = null;\r\n break;\r\n }\r\n case Token.NAMESPACE: {\r\n let state = tn.mark();\r\n tn.next();\r\n if (tn.peek(false, IdentifierHandling.PREFER) == Token.IDENTIFIER) {\r\n tn.discard(state);\r\n statement = this.parseNamespace(tn, flags, decorators, startPos);\r\n decorators = null;\r\n } else {\r\n tn.reset(state);\r\n statement = this.parseStatement(tn, true);\r\n }\r\n break;\r\n }\r\n case Token.IMPORT: {\r\n tn.next();\r\n flags |= CommonFlags.IMPORT;\r\n if (flags & CommonFlags.EXPORT) {\r\n statement = this.parseExportImport(tn, startPos);\r\n } else {\r\n statement = this.parseImport(tn);\r\n }\r\n break;\r\n }\r\n case Token.TYPE: { // also identifier\r\n let state = tn.mark();\r\n tn.next();\r\n if (tn.peek(false, IdentifierHandling.PREFER) == Token.IDENTIFIER) {\r\n tn.discard(state);\r\n statement = this.parseTypeDeclaration(tn, flags, decorators, startPos);\r\n decorators = null;\r\n } else {\r\n tn.reset(state);\r\n statement = this.parseStatement(tn, true);\r\n }\r\n break;\r\n }\r\n default: {\r\n\r\n // handle plain exports\r\n if (flags & CommonFlags.EXPORT) {\r\n if (defaultEnd && tn.skipIdentifier(IdentifierHandling.PREFER)) {\r\n if (declareEnd) {\r\n this.error(\r\n DiagnosticCode.An_export_assignment_cannot_have_modifiers,\r\n tn.range(declareStart, declareEnd)\r\n );\r\n }\r\n statement = this.parseExportDefaultAlias(tn, startPos, defaultStart, defaultEnd);\r\n defaultStart = defaultEnd = 0; // consume\r\n } else {\r\n statement = this.parseExport(tn, startPos, (flags & CommonFlags.DECLARE) != 0);\r\n }\r\n\r\n // handle non-declaration statements\r\n } else {\r\n if (exportEnd) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(exportStart, exportEnd), \"export\"\r\n ); // recoverable\r\n }\r\n if (declareEnd) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(declareStart, declareEnd), \"declare\"\r\n ); // recoverable\r\n }\r\n if (!namespace) {\r\n statement = this.parseStatement(tn, true);\r\n } // TODO: else?\r\n }\r\n break;\r\n }\r\n }\r\n\r\n // check for decorators that weren't consumed\r\n if (decorators) {\r\n for (let i = 0, k = decorators.length; i < k; ++i) {\r\n this.error(\r\n DiagnosticCode.Decorators_are_not_valid_here,\r\n decorators[i].range\r\n );\r\n }\r\n }\r\n\r\n // check if this an `export default` declaration\r\n if (defaultEnd && statement !== null) {\r\n switch (statement.kind) {\r\n case NodeKind.ENUMDECLARATION:\r\n case NodeKind.FUNCTIONDECLARATION:\r\n case NodeKind.CLASSDECLARATION:\r\n case NodeKind.INTERFACEDECLARATION:\r\n case NodeKind.NAMESPACEDECLARATION: {\r\n return Node.createExportDefaultStatement(statement, tn.range(startPos, tn.pos));\r\n }\r\n default: {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(defaultStart, defaultEnd), \"default\"\r\n );\r\n }\r\n }\r\n }\r\n return statement;\r\n }\r\n\r\n /** Obtains the next file to parse. */\r\n nextFile(): string | null {\r\n var backlog = this.backlog;\r\n return backlog.length ? backlog.shift() : null;\r\n }\r\n\r\n /** Finishes parsing and returns the program. */\r\n finish(): Program {\r\n if (this.backlog.length) throw new Error(\"backlog is not empty\");\r\n this.backlog = [];\r\n this.seenlog.clear();\r\n this.donelog.clear();\r\n return this.program;\r\n }\r\n\r\n /** Parses a type. */\r\n parseType(\r\n tn: Tokenizer,\r\n acceptParenthesized: bool = true,\r\n suppressErrors: bool = false\r\n ): CommonTypeNode | null {\r\n\r\n // NOTE: this parses our limited subset\r\n var token = tn.next();\r\n var startPos = tn.tokenPos;\r\n\r\n var type: CommonTypeNode;\r\n\r\n // '(' ...\r\n if (token == Token.OPENPAREN) {\r\n\r\n // '(' FunctionSignature ')' '|' 'null'?\r\n let isNullableSignature = tn.skip(Token.OPENPAREN);\r\n // FunctionSignature?\r\n let signature = this.tryParseSignature(tn);\r\n if (signature) {\r\n if (isNullableSignature) {\r\n if (!tn.skip(Token.CLOSEPAREN)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \")\"\r\n );\r\n return null;\r\n }\r\n if (!tn.skip(Token.BAR)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"|\"\r\n );\r\n return null;\r\n }\r\n if (!tn.skip(Token.NULL)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"null\"\r\n );\r\n }\r\n signature.isNullable = true;\r\n }\r\n return signature;\r\n } else if (isNullableSignature || this.tryParseSignatureIsSignature) {\r\n this.error(\r\n DiagnosticCode.Unexpected_token,\r\n tn.range()\r\n );\r\n return null;\r\n }\r\n\r\n // Type (',' Type)* ')'\r\n if (acceptParenthesized) {\r\n let innerType = this.parseType(tn, false, suppressErrors);\r\n if (!innerType) return null;\r\n if (!tn.skip(Token.CLOSEPAREN)) {\r\n if (!suppressErrors) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(tn.pos), \"}\"\r\n );\r\n }\r\n return null;\r\n }\r\n type = innerType;\r\n type.range.start = startPos;\r\n type.range.end = tn.pos;\r\n } else {\r\n this.error(\r\n DiagnosticCode.Unexpected_token,\r\n tn.range()\r\n );\r\n return null;\r\n }\r\n\r\n // 'void'\r\n } else if (token == Token.VOID) {\r\n type = Node.createType(\r\n Node.createSimpleTypeName(\"void\", tn.range()), [], false, tn.range(startPos, tn.pos)\r\n );\r\n\r\n // 'this'\r\n } else if (token == Token.THIS) {\r\n type = Node.createType(\r\n Node.createSimpleTypeName(\"this\", tn.range()), [], false, tn.range(startPos, tn.pos)\r\n );\r\n\r\n // 'true'\r\n } else if (token == Token.TRUE || token == Token.FALSE) {\r\n type = Node.createType(\r\n Node.createSimpleTypeName(\"bool\", tn.range()), [], false, tn.range(startPos, tn.pos)\r\n );\r\n\r\n // StringLiteral\r\n } else if (token == Token.STRINGLITERAL) {\r\n tn.readString();\r\n type = Node.createType(\r\n Node.createSimpleTypeName(\"string\", tn.range()), [], false, tn.range(startPos, tn.pos)\r\n );\r\n\r\n // Identifier\r\n } else if (token == Token.IDENTIFIER) {\r\n let first = Node.createSimpleTypeName(tn.readIdentifier(), tn.range());\r\n let current = first;\r\n let parameters: TypeNode[] | null = null;\r\n let nullable = false;\r\n\r\n // Identifier ('.' Identifier)+\r\n while (tn.skip(Token.DOT)) {\r\n if (tn.skip(Token.IDENTIFIER)) {\r\n let next = Node.createSimpleTypeName(tn.readIdentifier(), tn.range());\r\n current.next = next;\r\n current = next;\r\n } else {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range(tn.pos)\r\n );\r\n return null;\r\n }\r\n }\r\n\r\n // Name\r\n if (tn.skip(Token.LESSTHAN)) {\r\n do {\r\n let parameter = this.parseType(tn, true, suppressErrors);\r\n if (!parameter) return null;\r\n if (!parameters) parameters = [parameter];\r\n else parameters.push(parameter);\r\n } while (tn.skip(Token.COMMA));\r\n if (!tn.skip(Token.GREATERTHAN)) {\r\n if (!suppressErrors) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(tn.pos), \">\"\r\n );\r\n }\r\n return null;\r\n }\r\n }\r\n // ... | null\r\n while (tn.skip(Token.BAR)) {\r\n if (tn.skip(Token.NULL)) {\r\n nullable = true;\r\n } else {\r\n if (!suppressErrors) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(tn.pos), \"null\"\r\n );\r\n }\r\n return null;\r\n }\r\n }\r\n type = Node.createType(first, parameters || [], nullable, tn.range(startPos, tn.pos));\r\n } else {\r\n if (!suppressErrors) {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n }\r\n return null;\r\n }\r\n // ... [][]\r\n while (tn.skip(Token.OPENBRACKET)) {\r\n let bracketStart = tn.tokenPos;\r\n if (!tn.skip(Token.CLOSEBRACKET)) {\r\n if (!suppressErrors) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"]\"\r\n );\r\n }\r\n return null;\r\n }\r\n let bracketRange = tn.range(bracketStart, tn.pos);\r\n\r\n // ...[] | null\r\n let nullable = false;\r\n if (tn.skip(Token.BAR)) {\r\n if (tn.skip(Token.NULL)) {\r\n nullable = true;\r\n } else {\r\n if (!suppressErrors) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"null\"\r\n );\r\n }\r\n return null;\r\n }\r\n }\r\n type = Node.createType(\r\n Node.createSimpleTypeName(\"Array\", bracketRange),\r\n [ type ],\r\n nullable,\r\n tn.range(startPos, tn.pos)\r\n );\r\n if (nullable) break;\r\n }\r\n\r\n return type;\r\n }\r\n\r\n // Indicates whether tryParseSignature determined that it is handling a Signature\r\n private tryParseSignatureIsSignature: bool = false;\r\n\r\n /** Parses a function signature, as used in type declarations. */\r\n tryParseSignature(\r\n tn: Tokenizer\r\n ): SignatureNode | null {\r\n\r\n // at '(': ('...'? Identifier '?'? ':' Type (',' '...'? Identifier '?'? ':' Type)* )? ')' '=>' Type\r\n\r\n var state = tn.mark();\r\n var startPos = tn.tokenPos;\r\n var parameters: ParameterNode[] | null = null;\r\n var thisType: TypeNode | null = null;\r\n var isSignature: bool = false;\r\n\r\n if (tn.skip(Token.CLOSEPAREN)) {\r\n isSignature = true;\r\n tn.discard(state);\r\n parameters = [];\r\n\r\n } else {\r\n isSignature = false; // not yet known\r\n do {\r\n let kind = ParameterKind.DEFAULT;\r\n if (tn.skip(Token.DOT_DOT_DOT)) {\r\n isSignature = true;\r\n tn.discard(state);\r\n kind = ParameterKind.REST;\r\n }\r\n if (tn.skip(Token.THIS)) {\r\n if (tn.skip(Token.COLON)) {\r\n isSignature = true;\r\n tn.discard(state);\r\n let t = this.parseType(tn, false);\r\n if (!t) return null;\r\n if (t.kind != NodeKind.TYPE) {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n t.range\r\n );\r\n this.tryParseSignatureIsSignature = true;\r\n return null;\r\n }\r\n thisType = t;\r\n } else {\r\n tn.reset(state);\r\n this.tryParseSignatureIsSignature = false;\r\n return null;\r\n }\r\n } else if (tn.skipIdentifier()) {\r\n let name = Node.createIdentifierExpression(tn.readIdentifier(), tn.range(tn.tokenPos, tn.pos));\r\n if (tn.skip(Token.QUESTION)) {\r\n isSignature = true;\r\n tn.discard(state);\r\n if (kind == ParameterKind.REST) {\r\n this.error(\r\n DiagnosticCode.A_rest_parameter_cannot_be_optional,\r\n tn.range()\r\n ); // recoverable\r\n } else {\r\n kind = ParameterKind.OPTIONAL;\r\n }\r\n }\r\n if (tn.skip(Token.COLON)) {\r\n isSignature = true;\r\n tn.discard(state);\r\n let type = this.parseType(tn); // not suppressing errors because known\r\n if (!type) {\r\n this.tryParseSignatureIsSignature = isSignature;\r\n return null;\r\n }\r\n let param = new ParameterNode();\r\n param.parameterKind = kind;\r\n param.name = name;\r\n param.type = type;\r\n if (!parameters) parameters = [ param ];\r\n else parameters.push(param);\r\n } else {\r\n if (isSignature) {\r\n this.error(\r\n DiagnosticCode.Type_expected,\r\n tn.range()\r\n ); // recoverable\r\n }\r\n }\r\n } else {\r\n if (isSignature) {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n } else {\r\n tn.reset(state);\r\n }\r\n this.tryParseSignatureIsSignature = isSignature;\r\n return null;\r\n }\r\n } while (tn.skip(Token.COMMA));\r\n if (!tn.skip(Token.CLOSEPAREN)) {\r\n if (isSignature) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \")\"\r\n );\r\n } else {\r\n tn.reset(state);\r\n }\r\n this.tryParseSignatureIsSignature = isSignature;\r\n return null;\r\n }\r\n }\r\n\r\n var returnType: CommonTypeNode | null;\r\n if (tn.skip(Token.EQUALS_GREATERTHAN)) {\r\n isSignature = true;\r\n tn.discard(state);\r\n returnType = this.parseType(tn);\r\n if (!returnType) {\r\n this.tryParseSignatureIsSignature = isSignature;\r\n return null;\r\n }\r\n } else {\r\n if (isSignature) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"=>\"\r\n );\r\n } else {\r\n tn.reset(state);\r\n }\r\n this.tryParseSignatureIsSignature = isSignature;\r\n return null;\r\n }\r\n this.tryParseSignatureIsSignature = true;\r\n return Node.createSignature(\r\n parameters || [],\r\n returnType,\r\n thisType,\r\n false,\r\n tn.range(startPos, tn.pos)\r\n );\r\n }\r\n\r\n // statements\r\n\r\n parseDecorator(\r\n tn: Tokenizer\r\n ): DecoratorNode | null {\r\n\r\n // at '@': Identifier ('.' Identifier)* '(' Arguments\r\n\r\n var startPos = tn.tokenPos;\r\n if (tn.skipIdentifier()) {\r\n let name = tn.readIdentifier();\r\n let expression: Expression = Node.createIdentifierExpression(name, tn.range(startPos, tn.pos));\r\n while (tn.skip(Token.DOT)) {\r\n if (tn.skipIdentifier()) {\r\n name = tn.readIdentifier();\r\n expression = Node.createPropertyAccessExpression(\r\n expression,\r\n Node.createIdentifierExpression(name, tn.range()),\r\n tn.range(startPos, tn.pos)\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n return null;\r\n }\r\n }\r\n let args: Expression[] | null;\r\n if (tn.skip(Token.OPENPAREN)) {\r\n args = this.parseArguments(tn);\r\n if (args) {\r\n return Node.createDecorator(expression, args, tn.range(startPos, tn.pos));\r\n }\r\n } else {\r\n return Node.createDecorator(expression, null, tn.range(startPos, tn.pos));\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n parseVariable(\r\n tn: Tokenizer,\r\n flags: CommonFlags,\r\n decorators: DecoratorNode[] | null,\r\n startPos: i32\r\n ): VariableStatement | null {\r\n\r\n // at ('const' | 'let' | 'var'): VariableDeclaration (',' VariableDeclaration)* ';'?\r\n\r\n var members = new Array();\r\n do {\r\n let member = this.parseVariableDeclaration(tn, flags, decorators);\r\n if (!member) return null;\r\n members.push(member);\r\n } while (tn.skip(Token.COMMA));\r\n\r\n var ret = Node.createVariableStatement(members, decorators, tn.range(startPos, tn.pos));\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n }\r\n\r\n parseVariableDeclaration(\r\n tn: Tokenizer,\r\n parentFlags: CommonFlags,\r\n parentDecorators: DecoratorNode[] | null\r\n ): VariableDeclaration | null {\r\n\r\n // before: Identifier (':' Type)? ('=' Expression)?\r\n\r\n if (!tn.skipIdentifier()) {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n return null;\r\n }\r\n var identifier = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n var flags = parentFlags;\r\n if (tn.skip(Token.EXCLAMATION)) {\r\n flags |= CommonFlags.DEFINITE_ASSIGNMENT;\r\n }\r\n\r\n var type: CommonTypeNode | null = null;\r\n if (tn.skip(Token.COLON)) {\r\n type = this.parseType(tn);\r\n }\r\n\r\n var initializer: Expression | null = null;\r\n if (tn.skip(Token.EQUALS)) {\r\n if (flags & CommonFlags.AMBIENT) {\r\n this.error(\r\n DiagnosticCode.Initializers_are_not_allowed_in_ambient_contexts,\r\n tn.range()\r\n ); // recoverable\r\n }\r\n initializer = this.parseExpression(tn, Precedence.COMMA + 1);\r\n if (!initializer) return null;\r\n } else {\r\n if (flags & CommonFlags.CONST) {\r\n if (!(flags & CommonFlags.AMBIENT)) {\r\n this.error(\r\n DiagnosticCode._const_declarations_must_be_initialized,\r\n identifier.range\r\n ); // recoverable\r\n }\r\n } else if (!type) { // neither type nor initializer\r\n this.error(\r\n DiagnosticCode.Type_expected,\r\n tn.range(tn.pos)\r\n ); // recoverable\r\n }\r\n }\r\n var range = Range.join(identifier.range, tn.range());\r\n if ((flags & CommonFlags.DEFINITE_ASSIGNMENT) && initializer) {\r\n this.error(\r\n DiagnosticCode.A_definite_assignment_assertion_is_not_permitted_in_this_context,\r\n range);\r\n }\r\n return Node.createVariableDeclaration(\r\n identifier,\r\n type,\r\n initializer,\r\n parentDecorators,\r\n flags,\r\n range\r\n );\r\n }\r\n\r\n parseEnum(\r\n tn: Tokenizer,\r\n flags: CommonFlags,\r\n decorators: DecoratorNode[] | null,\r\n startPos: i32\r\n ): EnumDeclaration | null {\r\n\r\n // at 'enum': Identifier '{' (EnumValueDeclaration (',' EnumValueDeclaration )*)? '}' ';'?\r\n\r\n if (tn.next() != Token.IDENTIFIER) {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n return null;\r\n }\r\n var identifier = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n if (tn.next() != Token.OPENBRACE) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"{\"\r\n );\r\n return null;\r\n }\r\n var members = new Array();\r\n while (!tn.skip(Token.CLOSEBRACE)) {\r\n let member = this.parseEnumValue(tn, CommonFlags.NONE);\r\n if (!member) return null;\r\n members.push(member);\r\n if (!tn.skip(Token.COMMA)) {\r\n if (tn.skip(Token.CLOSEBRACE)) {\r\n break;\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"}\"\r\n );\r\n return null;\r\n }\r\n }\r\n }\r\n var ret = Node.createEnumDeclaration(\r\n identifier,\r\n members,\r\n decorators,\r\n flags,\r\n tn.range(startPos, tn.pos)\r\n );\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n }\r\n\r\n parseEnumValue(\r\n tn: Tokenizer,\r\n parentFlags: CommonFlags\r\n ): EnumValueDeclaration | null {\r\n\r\n // before: Identifier ('=' Expression)?\r\n\r\n if (!tn.skipIdentifier()) {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n return null;\r\n }\r\n var identifier = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n var value: Expression | null = null;\r\n if (tn.skip(Token.EQUALS)) {\r\n value = this.parseExpression(tn, Precedence.COMMA + 1);\r\n if (!value) return null;\r\n }\r\n return Node.createEnumValueDeclaration(\r\n identifier,\r\n value,\r\n parentFlags,\r\n Range.join(identifier.range, tn.range())\r\n );\r\n }\r\n\r\n parseReturn(\r\n tn: Tokenizer\r\n ): ReturnStatement | null {\r\n\r\n // at 'return': Expression | (';' | '}' | ...'\\n')\r\n\r\n var expr: Expression | null = null;\r\n if (\r\n tn.peek(true) != Token.SEMICOLON &&\r\n tn.nextToken != Token.CLOSEBRACE &&\r\n !tn.nextTokenOnNewLine\r\n ) {\r\n if (!(expr = this.parseExpression(tn))) return null;\r\n }\r\n\r\n var ret = Node.createReturnStatement(expr, tn.range());\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n }\r\n\r\n parseTypeParameters(\r\n tn: Tokenizer\r\n ): TypeParameterNode[] | null {\r\n\r\n // at '<': TypeParameter (',' TypeParameter)* '>'\r\n\r\n var typeParameters: TypeParameterNode[] | null = null;\r\n var seenOptional = false;\r\n while (!tn.skip(Token.GREATERTHAN)) {\r\n let typeParameter = this.parseTypeParameter(tn);\r\n if (!typeParameter) return null;\r\n if (typeParameter.defaultType !== null) {\r\n seenOptional = true;\r\n } else if (seenOptional) {\r\n this.error(\r\n DiagnosticCode.Required_type_parameters_may_not_follow_optional_type_parameters,\r\n typeParameter.range\r\n );\r\n typeParameter.defaultType = null;\r\n }\r\n if (!typeParameters) typeParameters = [ typeParameter ];\r\n else typeParameters.push(typeParameter);\r\n if (!tn.skip(Token.COMMA)) {\r\n if (tn.skip(Token.GREATERTHAN)) {\r\n break;\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \">\"\r\n );\r\n return null;\r\n }\r\n }\r\n }\r\n if (!(typeParameters && typeParameters.length)) {\r\n this.error(\r\n DiagnosticCode.Type_parameter_list_cannot_be_empty,\r\n tn.range()\r\n ); // recoverable\r\n }\r\n return typeParameters;\r\n }\r\n\r\n parseTypeParameter(\r\n tn: Tokenizer\r\n ): TypeParameterNode | null {\r\n\r\n // before: Identifier ('extends' Type)? ('=' Type)?\r\n\r\n if (tn.next() == Token.IDENTIFIER) {\r\n let identifier = Node.createIdentifierExpression(\r\n tn.readIdentifier(),\r\n tn.range()\r\n );\r\n let extendsType: TypeNode | null = null;\r\n if (tn.skip(Token.EXTENDS)) {\r\n let t = this.parseType(tn);\r\n if (!t) return null;\r\n if (t.kind != NodeKind.TYPE) {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n t.range\r\n );\r\n return null;\r\n }\r\n extendsType = t;\r\n }\r\n let defaultType: TypeNode | null = null;\r\n if (tn.skip(Token.EQUALS)) {\r\n let t = this.parseType(tn);\r\n if (!t) return null;\r\n if (t.kind != NodeKind.TYPE) {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n t.range\r\n );\r\n return null;\r\n }\r\n defaultType = t;\r\n }\r\n return Node.createTypeParameter(\r\n identifier,\r\n extendsType,\r\n defaultType,\r\n Range.join(identifier.range, tn.range())\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n private parseParametersThis: TypeNode | null = null;\r\n\r\n parseParameters(\r\n tn: Tokenizer,\r\n isConstructor: bool = false\r\n ): ParameterNode[] | null {\r\n\r\n // at '(': (Parameter (',' Parameter)*)? ')'\r\n\r\n var parameters = new Array();\r\n var seenRest: ParameterNode | null = null;\r\n var seenOptional = false;\r\n var reportedRest = false;\r\n var thisType: CommonTypeNode | null = null;\r\n\r\n // check if there is a leading `this` parameter\r\n this.parseParametersThis = null;\r\n if (tn.skip(Token.THIS)) {\r\n if (tn.skip(Token.COLON)) {\r\n thisType = this.parseType(tn); // reports\r\n if (!thisType) return null;\r\n if (thisType.kind == NodeKind.TYPE) {\r\n this.parseParametersThis = thisType;\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n thisType.range\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \":\"\r\n );\r\n return null;\r\n }\r\n if (!tn.skip(Token.COMMA)) {\r\n if (tn.skip(Token.CLOSEPAREN)) {\r\n return parameters;\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \")\"\r\n );\r\n return null;\r\n }\r\n }\r\n }\r\n\r\n while (!tn.skip(Token.CLOSEPAREN)) {\r\n let param = this.parseParameter(tn, isConstructor); // reports\r\n if (!param) return null;\r\n if (seenRest && !reportedRest) {\r\n this.error(\r\n DiagnosticCode.A_rest_parameter_must_be_last_in_a_parameter_list,\r\n seenRest.name.range\r\n );\r\n reportedRest = true;\r\n }\r\n switch (param.parameterKind) {\r\n default: {\r\n if (seenOptional) {\r\n this.error(\r\n DiagnosticCode.A_required_parameter_cannot_follow_an_optional_parameter,\r\n param.name.range\r\n );\r\n }\r\n break;\r\n }\r\n case ParameterKind.OPTIONAL: {\r\n seenOptional = true;\r\n break;\r\n }\r\n case ParameterKind.REST: {\r\n seenRest = param;\r\n break;\r\n }\r\n }\r\n parameters.push(param);\r\n if (!tn.skip(Token.COMMA)) {\r\n if (tn.skip(Token.CLOSEPAREN)) {\r\n break;\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \")\"\r\n );\r\n return null;\r\n }\r\n }\r\n }\r\n return parameters;\r\n }\r\n\r\n parseParameter(\r\n tn: Tokenizer,\r\n isConstructor: bool = false\r\n ): ParameterNode | null {\r\n\r\n // before: ('public' | 'private' | 'protected' | '...')? Identifier '?'? (':' Type)? ('=' Expression)?\r\n\r\n var isRest = false;\r\n var isOptional = false;\r\n var startRange: Range | null = null;\r\n var accessFlags: CommonFlags = CommonFlags.NONE;\r\n if (isConstructor) {\r\n if (tn.skip(Token.PUBLIC)) {\r\n startRange = tn.range();\r\n accessFlags |= CommonFlags.PUBLIC;\r\n } else if (tn.skip(Token.PROTECTED)) {\r\n startRange = tn.range();\r\n accessFlags |= CommonFlags.PROTECTED;\r\n } else if (tn.skip(Token.PRIVATE)) {\r\n startRange = tn.range();\r\n accessFlags |= CommonFlags.PRIVATE;\r\n }\r\n if (tn.peek() == Token.READONLY) {\r\n let state = tn.mark();\r\n tn.next();\r\n if (tn.peek() != Token.COLON) { // modifier\r\n tn.discard(state);\r\n if (!startRange) startRange = tn.range();\r\n accessFlags |= CommonFlags.READONLY;\r\n } else { // identifier\r\n tn.reset(state);\r\n }\r\n }\r\n }\r\n if (tn.skip(Token.DOT_DOT_DOT)) {\r\n if (accessFlags) {\r\n this.error(\r\n DiagnosticCode.A_parameter_property_cannot_be_declared_using_a_rest_parameter,\r\n tn.range()\r\n );\r\n } else {\r\n startRange = tn.range();\r\n }\r\n isRest = true;\r\n }\r\n if (tn.skipIdentifier()) {\r\n if (!isRest) startRange = tn.range();\r\n let identifier = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n let type: CommonTypeNode | null = null;\r\n if (isOptional = tn.skip(Token.QUESTION)) {\r\n if (isRest) {\r\n this.error(\r\n DiagnosticCode.A_rest_parameter_cannot_be_optional,\r\n identifier.range\r\n );\r\n }\r\n }\r\n if (tn.skip(Token.COLON)) {\r\n type = this.parseType(tn);\r\n if (!type) return null;\r\n } else {\r\n type = Node.createOmittedType(tn.range(tn.pos));\r\n }\r\n let initializer: Expression | null = null;\r\n if (tn.skip(Token.EQUALS)) {\r\n if (isRest) {\r\n this.error(\r\n DiagnosticCode.A_rest_parameter_cannot_have_an_initializer,\r\n identifier.range\r\n );\r\n }\r\n if (isOptional) {\r\n this.error(\r\n DiagnosticCode.Parameter_cannot_have_question_mark_and_initializer,\r\n identifier.range\r\n );\r\n } else {\r\n isOptional = true;\r\n }\r\n initializer = this.parseExpression(tn, Precedence.COMMA + 1);\r\n if (!initializer) return null;\r\n }\r\n let param = Node.createParameter(\r\n identifier,\r\n type,\r\n initializer,\r\n isRest\r\n ? ParameterKind.REST\r\n : isOptional\r\n ? ParameterKind.OPTIONAL\r\n : ParameterKind.DEFAULT,\r\n Range.join(startRange, tn.range())\r\n );\r\n param.flags |= accessFlags;\r\n return param;\r\n } else {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n parseFunction(\r\n tn: Tokenizer,\r\n flags: CommonFlags,\r\n decorators: DecoratorNode[] | null,\r\n startPos: i32\r\n ): FunctionDeclaration | null {\r\n\r\n // at 'function':\r\n // Identifier\r\n // ('<' TypeParameters)?\r\n // '(' Parameters (':' Type)?\r\n // '{' Statement* '}'\r\n // ';'?\r\n\r\n if (!tn.skipIdentifier()) {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range(tn.pos)\r\n );\r\n return null;\r\n }\r\n\r\n var name = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n var signatureStart: i32 = -1;\r\n\r\n var typeParameters: TypeParameterNode[] | null = null;\r\n if (tn.skip(Token.LESSTHAN)) {\r\n signatureStart = tn.tokenPos;\r\n typeParameters = this.parseTypeParameters(tn);\r\n if (!typeParameters) return null;\r\n flags |= CommonFlags.GENERIC;\r\n }\r\n\r\n if (!tn.skip(Token.OPENPAREN)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(tn.pos), \"(\"\r\n );\r\n return null;\r\n }\r\n\r\n if (signatureStart < 0) {\r\n signatureStart = tn.tokenPos;\r\n }\r\n\r\n var parameters = this.parseParameters(tn);\r\n if (!parameters) return null;\r\n var thisType = this.parseParametersThis;\r\n\r\n var isSetter = (flags & CommonFlags.SET) != 0;\r\n if (isSetter) {\r\n if (parameters.length != 1) {\r\n this.error(\r\n DiagnosticCode.A_set_accessor_must_have_exactly_one_parameter,\r\n name.range\r\n ); // recoverable\r\n }\r\n if (parameters.length && parameters[0].initializer) {\r\n this.error(\r\n DiagnosticCode.A_set_accessor_parameter_cannot_have_an_initializer,\r\n name.range\r\n ); // recoverable\r\n }\r\n }\r\n\r\n if (flags & CommonFlags.GET) {\r\n if (parameters.length) {\r\n this.error(\r\n DiagnosticCode.A_get_accessor_cannot_have_parameters,\r\n name.range\r\n ); // recoverable\r\n }\r\n }\r\n\r\n var returnType: CommonTypeNode | null = null;\r\n if (tn.skip(Token.COLON)) {\r\n returnType = this.parseType(tn, true, isSetter);\r\n if (!returnType) return null;\r\n }\r\n\r\n if (!returnType) {\r\n returnType = Node.createOmittedType(\r\n tn.range(tn.pos)\r\n );\r\n if (!isSetter) {\r\n this.error(\r\n DiagnosticCode.Type_expected,\r\n returnType.range\r\n ); // recoverable\r\n }\r\n }\r\n\r\n var signature = Node.createSignature(\r\n parameters,\r\n returnType,\r\n thisType,\r\n false,\r\n tn.range(signatureStart, tn.pos)\r\n );\r\n\r\n var body: Statement | null = null;\r\n if (tn.skip(Token.OPENBRACE)) {\r\n if (flags & CommonFlags.AMBIENT) {\r\n this.error(\r\n DiagnosticCode.An_implementation_cannot_be_declared_in_ambient_contexts,\r\n tn.range()\r\n ); // recoverable\r\n }\r\n\r\n body = this.parseBlockStatement(tn, false);\r\n if (!body) return null;\r\n } else if (!(flags & CommonFlags.AMBIENT)) {\r\n this.error(\r\n DiagnosticCode.Function_implementation_is_missing_or_not_immediately_following_the_declaration,\r\n tn.range(tn.pos)\r\n );\r\n }\r\n\r\n var ret = Node.createFunctionDeclaration(\r\n name,\r\n typeParameters,\r\n signature,\r\n body,\r\n decorators,\r\n flags,\r\n ArrowKind.NONE,\r\n tn.range(startPos, tn.pos)\r\n );\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n }\r\n\r\n parseFunctionExpression(tn: Tokenizer): FunctionExpression | null {\r\n var startPos = tn.tokenPos;\r\n var name: IdentifierExpression;\r\n var arrowKind = ArrowKind.NONE;\r\n\r\n // either at 'function':\r\n // Identifier?\r\n // '(' Parameters (':' Type)?\r\n // Statement\r\n\r\n if (tn.token == Token.FUNCTION) {\r\n if (tn.skipIdentifier()) {\r\n name = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n } else { // empty name\r\n name = Node.createEmptyIdentifierExpression(tn.range(tn.pos));\r\n }\r\n if (!tn.skip(Token.OPENPAREN)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(tn.pos), \"(\"\r\n );\r\n return null;\r\n }\r\n\r\n // or at '(' of arrow function:\r\n // Parameters (':' Type)?\r\n // Statement\r\n\r\n } else {\r\n arrowKind = ArrowKind.ARROW_PARENTHESIZED;\r\n assert(tn.token == Token.OPENPAREN);\r\n name = Node.createEmptyIdentifierExpression(tn.range(tn.tokenPos));\r\n }\r\n\r\n // TODO: type parameters? doesn't seem worth it.\r\n\r\n var signatureStart = tn.pos;\r\n var parameters = this.parseParameters(tn);\r\n if (!parameters) return null;\r\n\r\n return this.parseFunctionExpressionCommon(tn, name, parameters, arrowKind, startPos, signatureStart);\r\n }\r\n\r\n private parseFunctionExpressionCommon(\r\n tn: Tokenizer,\r\n name: IdentifierExpression,\r\n parameters: ParameterNode[],\r\n arrowKind: ArrowKind,\r\n startPos: i32 = -1,\r\n signatureStart: i32 = -1\r\n ): FunctionExpression | null {\r\n if (startPos < 0) startPos = name.range.start;\r\n if (signatureStart < 0) signatureStart = startPos;\r\n\r\n var returnType: CommonTypeNode | null = null;\r\n if (arrowKind != ArrowKind.ARROW_SINGLE && tn.skip(Token.COLON)) {\r\n returnType = this.parseType(tn);\r\n if (!returnType) return null;\r\n } else {\r\n returnType = Node.createOmittedType(tn.range(tn.pos));\r\n }\r\n\r\n if (arrowKind) {\r\n if (!tn.skip(Token.EQUALS_GREATERTHAN)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(tn.pos), \"=>\"\r\n );\r\n return null;\r\n }\r\n }\r\n\r\n var signature = Node.createSignature(\r\n parameters,\r\n returnType,\r\n null, // TODO?\r\n false,\r\n tn.range(signatureStart, tn.pos)\r\n );\r\n\r\n var body: Statement | null = null;\r\n if (arrowKind) {\r\n if (tn.skip(Token.OPENBRACE)) {\r\n body = this.parseBlockStatement(tn, false);\r\n } else {\r\n let bodyExpression = this.parseExpression(tn, Precedence.COMMA + 1);\r\n if (bodyExpression) body = Node.createExpressionStatement(bodyExpression);\r\n }\r\n } else {\r\n if (!tn.skip(Token.OPENBRACE)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(tn.pos), \"{\"\r\n );\r\n return null;\r\n }\r\n body = this.parseBlockStatement(tn, false);\r\n }\r\n if (!body) return null;\r\n\r\n var declaration = Node.createFunctionDeclaration(\r\n name,\r\n null,\r\n signature,\r\n body,\r\n null,\r\n CommonFlags.NONE,\r\n arrowKind,\r\n tn.range(startPos, tn.pos)\r\n );\r\n return Node.createFunctionExpression(declaration);\r\n }\r\n\r\n parseClassOrInterface(\r\n tn: Tokenizer,\r\n flags: CommonFlags,\r\n decorators: DecoratorNode[] | null,\r\n startPos: i32\r\n ): ClassDeclaration | null {\r\n\r\n // at ('class' | 'interface'):\r\n // Identifier\r\n // ('<' TypeParameters)?\r\n // ('extends' Type)?\r\n // ('implements' Type (',' Type)*)?\r\n // '{' ClassMember* '}'\r\n\r\n var isInterface = tn.token == Token.INTERFACE;\r\n\r\n if (!tn.skipIdentifier()) {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n return null;\r\n }\r\n\r\n var identifier = Node.createIdentifierExpression(\r\n tn.readIdentifier(),\r\n tn.range()\r\n );\r\n\r\n var typeParameters: TypeParameterNode[] | null = null;\r\n if (tn.skip(Token.LESSTHAN)) {\r\n typeParameters = this.parseTypeParameters(tn);\r\n if (!typeParameters) return null;\r\n flags |= CommonFlags.GENERIC;\r\n }\r\n\r\n var extendsType: TypeNode | null = null;\r\n if (tn.skip(Token.EXTENDS)) {\r\n let t = this.parseType(tn);\r\n if (!t) return null;\r\n if (t.kind != NodeKind.TYPE) {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n t.range\r\n );\r\n return null;\r\n }\r\n extendsType = t;\r\n }\r\n\r\n var implementsTypes: TypeNode[] | null = null;\r\n if (tn.skip(Token.IMPLEMENTS)) {\r\n if (isInterface) {\r\n this.error(\r\n DiagnosticCode.Interface_declaration_cannot_have_implements_clause,\r\n tn.range()\r\n ); // recoverable\r\n }\r\n do {\r\n let type = this.parseType(tn);\r\n if (!type) return null;\r\n if (!isInterface) {\r\n if (!implementsTypes) implementsTypes = [type];\r\n else implementsTypes.push(type);\r\n }\r\n } while (tn.skip(Token.COMMA));\r\n }\r\n\r\n if (!tn.skip(Token.OPENBRACE)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"{\"\r\n );\r\n return null;\r\n }\r\n\r\n var members = new Array();\r\n var declaration: ClassDeclaration;\r\n if (isInterface) {\r\n assert(!implementsTypes);\r\n declaration = Node.createInterfaceDeclaration(\r\n identifier,\r\n typeParameters,\r\n extendsType,\r\n members,\r\n decorators,\r\n flags,\r\n tn.range(startPos, tn.pos)\r\n );\r\n } else {\r\n declaration = Node.createClassDeclaration(\r\n identifier,\r\n typeParameters,\r\n extendsType,\r\n implementsTypes,\r\n members,\r\n decorators,\r\n flags,\r\n tn.range(startPos, tn.pos)\r\n );\r\n }\r\n if (!tn.skip(Token.CLOSEBRACE)) {\r\n do {\r\n let member = this.parseClassMember(tn, declaration);\r\n if (member) members.push(member);\r\n else {\r\n this.skipStatement(tn);\r\n if (tn.skip(Token.ENDOFFILE)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"}\"\r\n );\r\n return null;\r\n }\r\n }\r\n } while (!tn.skip(Token.CLOSEBRACE));\r\n }\r\n declaration.range.end = tn.pos;\r\n return declaration;\r\n }\r\n\r\n parseClassExpression(tn: Tokenizer): ClassExpression | null {\r\n\r\n // at 'class': Identifier? '{' ... '}'\r\n\r\n var startPos = tn.tokenPos;\r\n var name: IdentifierExpression;\r\n\r\n if (tn.skipIdentifier()) {\r\n name = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n } else {\r\n name = Node.createEmptyIdentifierExpression(tn.range(tn.pos));\r\n }\r\n\r\n if (!tn.skip(Token.OPENBRACE)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(tn.pos), \"{\"\r\n );\r\n return null;\r\n }\r\n\r\n var members = new Array();\r\n var declaration = Node.createClassDeclaration(\r\n name,\r\n [],\r\n null,\r\n null,\r\n members,\r\n null,\r\n CommonFlags.NONE,\r\n tn.range(startPos, tn.pos)\r\n );\r\n if (!tn.skip(Token.CLOSEBRACE)) {\r\n do {\r\n let member = this.parseClassMember(tn, declaration);\r\n if (member) members.push(member);\r\n else {\r\n this.skipStatement(tn);\r\n if (tn.skip(Token.ENDOFFILE)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"}\"\r\n );\r\n return null;\r\n }\r\n }\r\n } while (!tn.skip(Token.CLOSEBRACE));\r\n }\r\n declaration.range.end = tn.pos;\r\n return Node.createClassExpression(declaration);\r\n }\r\n\r\n parseClassMember(\r\n tn: Tokenizer,\r\n parent: ClassDeclaration\r\n ): DeclarationStatement | null {\r\n\r\n // before:\r\n // ('public' | 'private' | 'protected')?\r\n // ('static' | 'abstract')?\r\n // 'readonly'?\r\n // ('get' | 'set')?\r\n // Identifier ...\r\n\r\n var startPos = tn.pos;\r\n var isInterface = parent.kind == NodeKind.INTERFACEDECLARATION;\r\n\r\n var decorators: DecoratorNode[] | null = null;\r\n if (tn.skip(Token.AT)) {\r\n do {\r\n let decorator = this.parseDecorator(tn);\r\n if (!decorator) break;\r\n if (!decorators) decorators = [decorator];\r\n else decorators.push(decorator);\r\n } while (tn.skip(Token.AT));\r\n if (decorators && isInterface) {\r\n this.error(\r\n DiagnosticCode.Decorators_are_not_valid_here,\r\n Range.join(decorators[0].range, decorators[decorators.length - 1].range)\r\n );\r\n }\r\n }\r\n\r\n // inherit ambient status\r\n var flags = parent.flags & CommonFlags.AMBIENT;\r\n\r\n // implemented methods are virtual\r\n if (isInterface) flags |= CommonFlags.VIRTUAL;\r\n\r\n var accessStart = 0;\r\n var accessEnd = 0;\r\n if (tn.skip(Token.PUBLIC)) {\r\n if (isInterface) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(), \"public\"\r\n );\r\n }\r\n flags |= CommonFlags.PUBLIC;\r\n accessStart = tn.tokenPos;\r\n accessEnd = tn.pos;\r\n } else if (tn.skip(Token.PRIVATE)) {\r\n if (isInterface) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(), \"private\"\r\n );\r\n }\r\n flags |= CommonFlags.PRIVATE;\r\n accessStart = tn.tokenPos;\r\n accessEnd = tn.pos;\r\n } else if (tn.skip(Token.PROTECTED)) {\r\n if (isInterface) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(), \"protected\"\r\n );\r\n }\r\n flags |= CommonFlags.PROTECTED;\r\n accessStart = tn.tokenPos;\r\n accessEnd = tn.pos;\r\n }\r\n\r\n var staticStart = 0;\r\n var staticEnd = 0;\r\n var abstractStart = 0;\r\n var abstractEnd = 0;\r\n if (tn.skip(Token.STATIC)) {\r\n if (isInterface) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(), \"static\"\r\n );\r\n }\r\n flags |= CommonFlags.STATIC;\r\n staticStart = tn.tokenPos;\r\n staticEnd = tn.pos;\r\n } else {\r\n flags |= CommonFlags.INSTANCE;\r\n if (tn.skip(Token.ABSTRACT)) {\r\n if (isInterface) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(), \"abstract\"\r\n );\r\n }\r\n flags |= CommonFlags.ABSTRACT;\r\n abstractStart = tn.tokenPos;\r\n abstractEnd = tn.pos;\r\n }\r\n if (parent.flags & CommonFlags.GENERIC) flags |= CommonFlags.GENERIC_CONTEXT;\r\n }\r\n\r\n var readonlyStart: i32 = 0;\r\n var readonlyEnd: i32 = 0;\r\n if (tn.skip(Token.READONLY)) {\r\n flags |= CommonFlags.READONLY;\r\n readonlyStart = tn.tokenPos;\r\n readonlyEnd = tn.pos;\r\n }\r\n\r\n // check if accessor: ('get' | 'set') ^\\n Identifier\r\n var state = tn.mark();\r\n var isConstructor = false;\r\n var isGetter = false;\r\n var getStart: i32 = 0;\r\n var getEnd: i32 = 0;\r\n var isSetter = false;\r\n var setStart: i32 = 0;\r\n var setEnd: i32 = 0;\r\n if (!isInterface) {\r\n if (tn.skip(Token.GET)) {\r\n if (tn.peek(true, IdentifierHandling.PREFER) == Token.IDENTIFIER && !tn.nextTokenOnNewLine) {\r\n flags |= CommonFlags.GET;\r\n isGetter = true;\r\n setStart = tn.tokenPos;\r\n setEnd = tn.pos;\r\n if (flags & CommonFlags.READONLY) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(readonlyStart, readonlyEnd), \"readonly\"\r\n ); // recoverable\r\n }\r\n } else {\r\n tn.reset(state);\r\n }\r\n } else if (tn.skip(Token.SET)) {\r\n if (tn.peek(true, IdentifierHandling.PREFER) == Token.IDENTIFIER && !tn.nextTokenOnNewLine) {\r\n flags |= CommonFlags.SET;\r\n isSetter = true;\r\n setStart = tn.tokenPos;\r\n setEnd = tn.pos;\r\n if (flags & CommonFlags.READONLY) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(readonlyStart, readonlyEnd), \"readonly\"\r\n ); // recoverable\r\n }\r\n } else {\r\n tn.reset(state);\r\n }\r\n } else if (tn.skip(Token.CONSTRUCTOR)) {\r\n flags |= CommonFlags.CONSTRUCTOR;\r\n isConstructor = true;\r\n if (flags & CommonFlags.STATIC) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(staticStart, staticEnd), \"static\"\r\n ); // recoverable\r\n }\r\n if (flags & CommonFlags.ABSTRACT) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(abstractStart, abstractEnd), \"abstract\"\r\n ); // recoverable\r\n }\r\n if (flags & CommonFlags.READONLY) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(readonlyStart, readonlyEnd), \"readonly\"\r\n ); // recoverable\r\n }\r\n }\r\n }\r\n\r\n var name: IdentifierExpression;\r\n if (isConstructor) {\r\n name = Node.createConstructorExpression(tn.range());\r\n } else {\r\n if (!(isGetter || isSetter) && tn.skip(Token.OPENBRACKET)) {\r\n // TODO: also handle symbols, which might have some of these modifiers\r\n if (flags & CommonFlags.PUBLIC) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(accessStart, accessEnd), \"public\"\r\n ); // recoverable\r\n } else if (flags & CommonFlags.PROTECTED) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(accessStart, accessEnd), \"protected\"\r\n ); // recoverable\r\n } else if (flags & CommonFlags.PRIVATE) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(accessStart, accessEnd), \"protected\"\r\n ); // recoverable\r\n }\r\n if (flags & CommonFlags.STATIC) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(staticStart, staticEnd), \"static\"\r\n ); // recoverable\r\n }\r\n if (flags & CommonFlags.ABSTRACT) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(abstractStart, abstractEnd), \"abstract\"\r\n ); // recoverable\r\n }\r\n if (flags & CommonFlags.READONLY) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(readonlyStart, readonlyEnd), \"readonly\"\r\n ); // recoverable\r\n }\r\n let retIndex = this.parseIndexSignatureDeclaration(tn, decorators);\r\n if (!retIndex) return null;\r\n tn.skip(Token.SEMICOLON);\r\n return retIndex;\r\n }\r\n if (!tn.skipIdentifier()) {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n return null;\r\n }\r\n name = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n }\r\n var typeParameters: TypeParameterNode[] | null = null;\r\n if (tn.skip(Token.LESSTHAN)) {\r\n let typeParametersStart = tn.tokenPos;\r\n typeParameters = this.parseTypeParameters(tn);\r\n if (!typeParameters) return null;\r\n if (isConstructor) {\r\n this.error(\r\n DiagnosticCode.Type_parameters_cannot_appear_on_a_constructor_declaration,\r\n tn.range(typeParametersStart, tn.pos)\r\n ); // recoverable\r\n } else if (isGetter || isSetter) {\r\n this.error(\r\n DiagnosticCode.An_accessor_cannot_have_type_parameters,\r\n tn.range(typeParametersStart, tn.pos)\r\n ); // recoverable\r\n } else {\r\n flags |= CommonFlags.GENERIC;\r\n }\r\n }\r\n\r\n // method: '(' Parameters (':' Type)? '{' Statement* '}' ';'?\r\n if (tn.skip(Token.OPENPAREN)) {\r\n let signatureStart = tn.tokenPos;\r\n let parameters = this.parseParameters(tn, isConstructor);\r\n if (!parameters) return null;\r\n let thisType = this.parseParametersThis;\r\n if (isConstructor) {\r\n for (let i = 0, k = parameters.length; i < k; ++i) {\r\n let parameter = parameters[i];\r\n if (parameter.isAny(\r\n CommonFlags.PUBLIC |\r\n CommonFlags.PROTECTED |\r\n CommonFlags.PRIVATE |\r\n CommonFlags.READONLY\r\n )) {\r\n let implicitFieldDeclaration = Node.createFieldDeclaration(\r\n parameter.name,\r\n parameter.type,\r\n null, // initialized via parameter\r\n null,\r\n parameter.flags | CommonFlags.INSTANCE,\r\n parameter.range\r\n );\r\n implicitFieldDeclaration.parameterIndex = i;\r\n parameter.implicitFieldDeclaration = implicitFieldDeclaration;\r\n parent.members.push(implicitFieldDeclaration);\r\n }\r\n }\r\n } else if (isGetter) {\r\n if (parameters.length) {\r\n this.error(\r\n DiagnosticCode.A_get_accessor_cannot_have_parameters,\r\n name.range\r\n );\r\n }\r\n } else if (isSetter) {\r\n if (parameters.length != 1) {\r\n this.error(\r\n DiagnosticCode.A_set_accessor_must_have_exactly_one_parameter,\r\n name.range\r\n );\r\n }\r\n if (parameters.length && parameters[0].initializer) {\r\n this.error(\r\n DiagnosticCode.A_set_accessor_parameter_cannot_have_an_initializer,\r\n name.range\r\n );\r\n }\r\n }\r\n\r\n let returnType: CommonTypeNode | null = null;\r\n if (tn.skip(Token.COLON)) {\r\n if (name.kind == NodeKind.CONSTRUCTOR) {\r\n this.error(\r\n DiagnosticCode.Type_annotation_cannot_appear_on_a_constructor_declaration,\r\n tn.range()\r\n );\r\n } else if (isSetter) {\r\n this.error(\r\n DiagnosticCode.A_set_accessor_cannot_have_a_return_type_annotation,\r\n tn.range()\r\n );\r\n }\r\n returnType = this.parseType(tn, name.kind == NodeKind.CONSTRUCTOR || isSetter);\r\n if (!returnType) return null;\r\n } else {\r\n returnType = Node.createOmittedType(tn.range(tn.pos));\r\n if (!isSetter && name.kind != NodeKind.CONSTRUCTOR) {\r\n this.error(\r\n DiagnosticCode.Type_expected,\r\n returnType.range\r\n ); // recoverable\r\n }\r\n }\r\n\r\n let signature = Node.createSignature(\r\n parameters,\r\n returnType,\r\n thisType,\r\n false,\r\n tn.range(signatureStart, tn.pos)\r\n );\r\n\r\n let body: Statement | null = null;\r\n if (tn.skip(Token.OPENBRACE)) {\r\n if (flags & CommonFlags.AMBIENT) {\r\n this.error(\r\n DiagnosticCode.An_implementation_cannot_be_declared_in_ambient_contexts,\r\n tn.range()\r\n ); // recoverable\r\n } else if (flags & CommonFlags.ABSTRACT) {\r\n this.error(\r\n DiagnosticCode.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract,\r\n tn.range(), name.text\r\n ); // recoverable\r\n }\r\n body = this.parseBlockStatement(tn, false);\r\n if (!body) return null;\r\n } else if (!(flags & CommonFlags.AMBIENT) && !isInterface) {\r\n this.error(\r\n DiagnosticCode.Function_implementation_is_missing_or_not_immediately_following_the_declaration,\r\n tn.range()\r\n ); // recoverable\r\n }\r\n\r\n let retMethod = Node.createMethodDeclaration(\r\n name,\r\n typeParameters,\r\n signature,\r\n body,\r\n decorators,\r\n flags,\r\n tn.range(startPos, tn.pos)\r\n );\r\n tn.skip(Token.SEMICOLON);\r\n return retMethod;\r\n\r\n } else if (isConstructor) {\r\n this.error(\r\n DiagnosticCode.Constructor_implementation_is_missing,\r\n name.range\r\n );\r\n\r\n } else if (isGetter || isSetter) {\r\n this.error(\r\n DiagnosticCode.Function_implementation_is_missing_or_not_immediately_following_the_declaration,\r\n name.range\r\n );\r\n\r\n // field: (':' Type)? ('=' Expression)? ';'?\r\n } else {\r\n if (flags & CommonFlags.ABSTRACT) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(abstractStart, abstractEnd), \"abstract\"\r\n ); // recoverable\r\n }\r\n\r\n if (flags & CommonFlags.GET) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(getStart, getEnd), \"get\"\r\n ); // recoverable\r\n }\r\n\r\n if (flags & CommonFlags.SET) {\r\n this.error(\r\n DiagnosticCode._0_modifier_cannot_be_used_here,\r\n tn.range(setStart, setEnd), \"set\"\r\n ); // recoverable\r\n }\r\n\r\n let type: CommonTypeNode | null = null;\r\n if (tn.skip(Token.QUESTION)) {\r\n this.error(\r\n DiagnosticCode.Optional_properties_are_not_supported,\r\n tn.range(startPos, tn.pos)\r\n );\r\n }\r\n if (tn.skip(Token.EXCLAMATION)) {\r\n flags |= CommonFlags.DEFINITE_ASSIGNMENT;\r\n }\r\n if (tn.skip(Token.COLON)) {\r\n type = this.parseType(tn);\r\n if (!type) return null;\r\n } else {\r\n this.error(\r\n DiagnosticCode.Type_expected,\r\n tn.range()\r\n ); // recoverable\r\n }\r\n let initializer: Expression | null = null;\r\n if (tn.skip(Token.EQUALS)) {\r\n initializer = this.parseExpression(tn);\r\n if (!initializer) return null;\r\n }\r\n let range = tn.range(startPos, tn.pos);\r\n if ((flags & CommonFlags.DEFINITE_ASSIGNMENT) && ((flags & CommonFlags.STATIC) || isInterface || initializer)) {\r\n this.error(\r\n DiagnosticCode.A_definite_assignment_assertion_is_not_permitted_in_this_context,\r\n range\r\n );\r\n }\r\n let retField = Node.createFieldDeclaration(\r\n name,\r\n type,\r\n initializer,\r\n decorators,\r\n flags,\r\n range\r\n );\r\n tn.skip(Token.SEMICOLON);\r\n return retField;\r\n }\r\n return null;\r\n }\r\n\r\n parseIndexSignatureDeclaration(tn: Tokenizer, decorators: DecoratorNode[] | null): IndexSignatureDeclaration | null {\r\n\r\n // at: '[': 'key' ':' Type ']' ':' Type\r\n\r\n if (decorators && decorators.length) {\r\n this.error(\r\n DiagnosticCode.Decorators_are_not_valid_here,\r\n Range.join(decorators[0].range, decorators[decorators.length - 1].range)\r\n ); // recoverable\r\n }\r\n\r\n var start = tn.tokenPos;\r\n if (tn.skipIdentifier()) {\r\n let id = tn.readIdentifier();\r\n if (id == \"key\") {\r\n if (tn.skip(Token.COLON)) {\r\n let keyType = this.parseType(tn);\r\n if (!keyType) return null;\r\n if (keyType.kind != NodeKind.TYPE) {\r\n this.error(\r\n DiagnosticCode.Type_expected,\r\n tn.range()\r\n );\r\n return null;\r\n }\r\n if (tn.skip(Token.CLOSEBRACKET)) {\r\n if (tn.skip(Token.COLON)) {\r\n let valueType = this.parseType(tn);\r\n if (!valueType) return null;\r\n return Node.createIndexSignatureDeclaration(keyType, valueType, tn.range(start, tn.pos));\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \":\"\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"]\"\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \":\"\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"key\"\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n parseNamespace(\r\n tn: Tokenizer,\r\n flags: CommonFlags,\r\n decorators: DecoratorNode[] | null,\r\n startPos: i32\r\n ): NamespaceDeclaration | null {\r\n\r\n // at 'namespace': Identifier '{' (Variable | Function)* '}'\r\n\r\n if (tn.skipIdentifier()) {\r\n let identifier = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n if (tn.skip(Token.OPENBRACE)) {\r\n let members = new Array();\r\n let declaration = Node.createNamespaceDeclaration(\r\n identifier,\r\n members,\r\n decorators,\r\n flags,\r\n tn.range(startPos, tn.pos)\r\n );\r\n while (!tn.skip(Token.CLOSEBRACE)) {\r\n let member = this.parseTopLevelStatement(tn, declaration);\r\n if (member) members.push(member);\r\n else {\r\n this.skipStatement(tn);\r\n if (tn.skip(Token.ENDOFFILE)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"}\"\r\n );\r\n return null;\r\n }\r\n }\r\n }\r\n declaration.range.end = tn.pos;\r\n tn.skip(Token.SEMICOLON);\r\n return declaration;\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"{\"\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n parseExport(\r\n tn: Tokenizer,\r\n startPos: i32,\r\n isDeclare: bool\r\n ): ExportStatement | null {\r\n\r\n // at 'export': '{' ExportMember (',' ExportMember)* }' ('from' StringLiteral)? ';'?\r\n\r\n var path: StringLiteralExpression | null = null;\r\n if (tn.skip(Token.OPENBRACE)) {\r\n let members = new Array();\r\n while (!tn.skip(Token.CLOSEBRACE)) {\r\n let member = this.parseExportMember(tn);\r\n if (!member) return null;\r\n members.push(member);\r\n if (!tn.skip(Token.COMMA)) {\r\n if (tn.skip(Token.CLOSEBRACE)) {\r\n break;\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"}\"\r\n );\r\n return null;\r\n }\r\n }\r\n }\r\n if (tn.skip(Token.FROM)) {\r\n if (tn.skip(Token.STRINGLITERAL)) {\r\n path = Node.createStringLiteralExpression(tn.readString(), tn.range());\r\n } else {\r\n this.error(\r\n DiagnosticCode.String_literal_expected,\r\n tn.range()\r\n );\r\n return null;\r\n }\r\n }\r\n let ret = Node.createExportStatement(members, path, isDeclare, tn.range(startPos, tn.pos));\r\n let internalPath = ret.internalPath;\r\n if (internalPath !== null && !this.seenlog.has(internalPath)) {\r\n this.backlog.push(internalPath);\r\n this.seenlog.add(internalPath);\r\n }\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n } else if (tn.skip(Token.ASTERISK)) {\r\n if (tn.skip(Token.FROM)) {\r\n if (tn.skip(Token.STRINGLITERAL)) {\r\n path = Node.createStringLiteralExpression(tn.readString(), tn.range());\r\n let ret = Node.createExportStatement(null, path, isDeclare, tn.range(startPos, tn.pos));\r\n let internalPath = assert(ret.internalPath);\r\n let source = tn.source;\r\n if (!source.exportPaths) source.exportPaths = new Set();\r\n source.exportPaths.add(internalPath);\r\n if (!this.seenlog.has(internalPath)) {\r\n this.backlog.push(internalPath);\r\n this.seenlog.add(internalPath);\r\n }\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n } else {\r\n this.error(\r\n DiagnosticCode.String_literal_expected,\r\n tn.range()\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"from\"\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"{\"\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n parseExportMember(\r\n tn: Tokenizer\r\n ): ExportMember | null {\r\n\r\n // before: Identifier ('as' Identifier)?\r\n\r\n if (tn.skipIdentifier()) {\r\n let identifier = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n let asIdentifier: IdentifierExpression | null = null;\r\n if (tn.skip(Token.AS)) {\r\n if (tn.skipIdentifier(IdentifierHandling.ALWAYS)) {\r\n asIdentifier = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n } else {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n return null;\r\n }\r\n }\r\n return Node.createExportMember(\r\n identifier,\r\n asIdentifier,\r\n asIdentifier\r\n ? Range.join(identifier.range, asIdentifier.range)\r\n : identifier.range\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n parseExportDefaultAlias(\r\n tn: Tokenizer,\r\n startPos: i32,\r\n defaultStart: i32,\r\n defaultEnd: i32\r\n ): ExportStatement {\r\n\r\n // at 'export' 'default': [Known-To-Be-]Identifier\r\n\r\n var name = tn.readIdentifier();\r\n var range = tn.range();\r\n var ret = Node.createExportStatement([\r\n Node.createExportMember(\r\n Node.createIdentifierExpression(name, range),\r\n Node.createIdentifierExpression(\"default\", tn.range(defaultStart, defaultEnd)),\r\n range\r\n )\r\n ], null, false, tn.range(startPos, tn.pos));\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n }\r\n\r\n parseImport(\r\n tn: Tokenizer\r\n ): ImportStatement | null {\r\n\r\n // at 'import':\r\n // ('{' (ImportMember (',' ImportMember)* '}') | ('*' 'as' Identifier)?\r\n // 'from' StringLiteral ';'?\r\n\r\n var startPos = tn.tokenPos;\r\n var members: ImportDeclaration[] | null = null;\r\n var namespaceName: IdentifierExpression | null = null;\r\n var skipFrom = false;\r\n if (tn.skip(Token.OPENBRACE)) { // import { ... } from \"file\"\r\n members = new Array();\r\n while (!tn.skip(Token.CLOSEBRACE)) {\r\n let member = this.parseImportDeclaration(tn);\r\n if (!member) return null;\r\n members.push(member);\r\n if (!tn.skip(Token.COMMA)) {\r\n if (tn.skip(Token.CLOSEBRACE)) {\r\n break;\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"}\"\r\n );\r\n return null;\r\n }\r\n }\r\n }\r\n } else if (tn.skip(Token.ASTERISK)) { // import * from \"file\"\r\n if (tn.skip(Token.AS)) {\r\n if (tn.skipIdentifier()) {\r\n namespaceName = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n } else {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n return null;\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"as\"\r\n );\r\n return null;\r\n }\r\n } else if (tn.skip(Token.IDENTIFIER, IdentifierHandling.PREFER)) { // import Name from \"file\"\r\n let name = tn.readIdentifier();\r\n let range = tn.range();\r\n members = [\r\n Node.createImportDeclaration(\r\n Node.createIdentifierExpression(\"default\", range),\r\n Node.createIdentifierExpression(name, range),\r\n range\r\n )\r\n ];\r\n if (tn.skip(Token.COMMA)) {\r\n // TODO: default + star, default + members\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n tn.range()\r\n );\r\n return null;\r\n }\r\n } else { // import \"file\"\r\n skipFrom = true;\r\n }\r\n\r\n if (skipFrom || tn.skip(Token.FROM)) {\r\n if (tn.skip(Token.STRINGLITERAL)) {\r\n let path = Node.createStringLiteralExpression(tn.readString(), tn.range());\r\n let ret: ImportStatement;\r\n if (namespaceName) {\r\n assert(!members);\r\n ret = Node.createImportStatementWithWildcard(namespaceName, path, tn.range(startPos, tn.pos));\r\n } else {\r\n ret = Node.createImportStatement(members, path, tn.range(startPos, tn.pos));\r\n }\r\n let internalPath = ret.internalPath;\r\n if (!this.seenlog.has(internalPath)) {\r\n this.backlog.push(internalPath);\r\n this.seenlog.add(internalPath);\r\n }\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n } else {\r\n this.error(\r\n DiagnosticCode.String_literal_expected,\r\n tn.range()\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"from\"\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n parseImportDeclaration(\r\n tn: Tokenizer\r\n ): ImportDeclaration | null {\r\n\r\n // before: Identifier ('as' Identifier)?\r\n\r\n if (tn.skipIdentifier(IdentifierHandling.ALWAYS)) {\r\n let identifier = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n let asIdentifier: IdentifierExpression | null = null;\r\n if (tn.skip(Token.AS)) {\r\n if (tn.skipIdentifier()) {\r\n asIdentifier = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n } else {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n return null;\r\n }\r\n }\r\n return Node.createImportDeclaration(\r\n identifier,\r\n asIdentifier,\r\n asIdentifier\r\n ? Range.join(identifier.range, asIdentifier.range)\r\n : identifier.range\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n parseExportImport(\r\n tn: Tokenizer,\r\n startPos: i32\r\n ): ExportImportStatement | null {\r\n\r\n // at 'export' 'import': Identifier ('=' Identifier)? ';'?\r\n\r\n if (tn.skipIdentifier()) {\r\n let asIdentifier = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n if (tn.skip(Token.EQUALS)) {\r\n if (tn.skipIdentifier()) {\r\n let identifier = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n let ret = Node.createExportImportStatement(identifier, asIdentifier, tn.range(startPos, tn.pos));\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n } else {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"=\"\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n parseStatement(\r\n tn: Tokenizer,\r\n topLevel: bool = false\r\n ): Statement | null {\r\n\r\n // at previous token\r\n\r\n var state = tn.mark();\r\n var token = tn.next();\r\n var statement: Statement | null = null;\r\n switch (token) {\r\n case Token.BREAK: {\r\n statement = this.parseBreak(tn);\r\n break;\r\n }\r\n case Token.CONST: {\r\n statement = this.parseVariable(tn, CommonFlags.CONST, null, tn.tokenPos);\r\n break;\r\n }\r\n case Token.CONTINUE: {\r\n statement = this.parseContinue(tn);\r\n break;\r\n }\r\n case Token.DO: {\r\n statement = this.parseDoStatement(tn);\r\n break;\r\n }\r\n case Token.FOR: {\r\n statement = this.parseForStatement(tn);\r\n break;\r\n }\r\n case Token.IF: {\r\n statement = this.parseIfStatement(tn);\r\n break;\r\n }\r\n case Token.LET: {\r\n statement = this.parseVariable(tn, CommonFlags.LET, null, tn.tokenPos);\r\n break;\r\n }\r\n case Token.VAR: {\r\n statement = this.parseVariable(tn, CommonFlags.NONE, null, tn.tokenPos);\r\n break;\r\n }\r\n case Token.OPENBRACE: {\r\n statement = this.parseBlockStatement(tn, topLevel);\r\n break;\r\n }\r\n case Token.RETURN: {\r\n if (topLevel) {\r\n this.error(\r\n DiagnosticCode.A_return_statement_can_only_be_used_within_a_function_body,\r\n tn.range()\r\n ); // recoverable\r\n }\r\n statement = this.parseReturn(tn);\r\n break;\r\n }\r\n case Token.SEMICOLON: {\r\n return Node.createEmptyStatement(tn.range(tn.tokenPos));\r\n }\r\n case Token.SWITCH: {\r\n statement = this.parseSwitchStatement(tn);\r\n break;\r\n }\r\n case Token.THROW: {\r\n statement = this.parseThrowStatement(tn);\r\n break;\r\n }\r\n case Token.TRY: {\r\n statement = this.parseTryStatement(tn);\r\n break;\r\n }\r\n case Token.VOID: {\r\n statement = this.parseVoidStatement(tn);\r\n break;\r\n }\r\n case Token.WHILE: {\r\n statement = this.parseWhileStatement(tn);\r\n break;\r\n }\r\n case Token.TYPE: { // also identifier\r\n if (tn.peek(false, IdentifierHandling.PREFER) == Token.IDENTIFIER) {\r\n statement = this.parseTypeDeclaration(tn, CommonFlags.NONE, null, tn.tokenPos);\r\n break;\r\n }\r\n // fall-through\r\n }\r\n default: {\r\n tn.reset(state);\r\n statement = this.parseExpressionStatement(tn);\r\n break;\r\n }\r\n }\r\n if (!statement) { // has been reported\r\n tn.reset(state);\r\n this.skipStatement(tn);\r\n } else {\r\n tn.discard(state);\r\n }\r\n return statement;\r\n }\r\n\r\n parseBlockStatement(\r\n tn: Tokenizer,\r\n topLevel: bool\r\n ): BlockStatement | null {\r\n\r\n // at '{': Statement* '}' ';'?\r\n\r\n var startPos = tn.tokenPos;\r\n var statements = new Array();\r\n while (!tn.skip(Token.CLOSEBRACE)) {\r\n let state = tn.mark();\r\n let statement = this.parseStatement(tn, topLevel);\r\n if (!statement) {\r\n if (tn.token == Token.ENDOFFILE) return null;\r\n tn.reset(state);\r\n this.skipStatement(tn);\r\n } else {\r\n tn.discard(state);\r\n statements.push(statement);\r\n }\r\n }\r\n var ret = Node.createBlockStatement(statements, tn.range(startPos, tn.pos));\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n }\r\n\r\n parseBreak(\r\n tn: Tokenizer\r\n ): BreakStatement | null {\r\n\r\n // at 'break': Identifier? ';'?\r\n\r\n var identifier: IdentifierExpression | null = null;\r\n if (tn.peek(true) == Token.IDENTIFIER && !tn.nextTokenOnNewLine) {\r\n tn.next(IdentifierHandling.PREFER);\r\n identifier = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n }\r\n var ret = Node.createBreakStatement(identifier, tn.range());\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n }\r\n\r\n parseContinue(\r\n tn: Tokenizer\r\n ): ContinueStatement | null {\r\n\r\n // at 'continue': Identifier? ';'?\r\n\r\n var identifier: IdentifierExpression | null = null;\r\n if (tn.peek(true) == Token.IDENTIFIER && !tn.nextTokenOnNewLine) {\r\n tn.next(IdentifierHandling.PREFER);\r\n identifier = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n }\r\n var ret = Node.createContinueStatement(identifier, tn.range());\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n }\r\n\r\n parseDoStatement(\r\n tn: Tokenizer\r\n ): DoStatement | null {\r\n\r\n // at 'do': Statement 'while' '(' Expression ')' ';'?\r\n\r\n var startPos = tn.tokenPos;\r\n var statement = this.parseStatement(tn);\r\n if (!statement) return null;\r\n\r\n if (tn.skip(Token.WHILE)) {\r\n\r\n if (tn.skip(Token.OPENPAREN)) {\r\n let condition = this.parseExpression(tn);\r\n if (!condition) return null;\r\n\r\n if (tn.skip(Token.CLOSEPAREN)) {\r\n let ret = Node.createDoStatement(statement, condition, tn.range(startPos, tn.pos));\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \")\"\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"(\"\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"while\"\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n parseExpressionStatement(\r\n tn: Tokenizer\r\n ): ExpressionStatement | null {\r\n\r\n // at previous token\r\n\r\n var expr = this.parseExpression(tn);\r\n if (!expr) return null;\r\n\r\n var ret = Node.createExpressionStatement(expr);\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n }\r\n\r\n parseForStatement(\r\n tn: Tokenizer\r\n ): ForStatement | null {\r\n\r\n // at 'for': '(' Statement? Expression? ';' Expression? ')' Statement\r\n\r\n var startPos = tn.tokenPos;\r\n\r\n if (tn.skip(Token.OPENPAREN)) {\r\n let initializer: Statement | null = null;\r\n\r\n if (tn.skip(Token.CONST)) {\r\n initializer = this.parseVariable(tn, CommonFlags.CONST, null, tn.tokenPos);\r\n } else if (tn.skip(Token.LET)) {\r\n initializer = this.parseVariable(tn, CommonFlags.LET, null, tn.tokenPos);\r\n } else if (tn.skip(Token.VAR)) {\r\n initializer = this.parseVariable(tn, CommonFlags.NONE, null, tn.tokenPos);\r\n\r\n } else if (!tn.skip(Token.SEMICOLON)) {\r\n initializer = this.parseExpressionStatement(tn);\r\n if (!initializer) return null;\r\n }\r\n\r\n if (tn.token == Token.SEMICOLON) {\r\n let condition: ExpressionStatement | null = null;\r\n if (!tn.skip(Token.SEMICOLON)) {\r\n condition = this.parseExpressionStatement(tn);\r\n if (!condition) return null;\r\n }\r\n\r\n if (tn.token == Token.SEMICOLON) {\r\n let incrementor: Expression | null = null;\r\n if (!tn.skip(Token.CLOSEPAREN)) {\r\n incrementor = this.parseExpression(tn);\r\n if (!incrementor) return null;\r\n\r\n if (!tn.skip(Token.CLOSEPAREN)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \")\"\r\n );\r\n return null;\r\n }\r\n }\r\n\r\n let statement = this.parseStatement(tn);\r\n if (!statement) return null;\r\n\r\n return Node.createForStatement(\r\n initializer,\r\n condition\r\n ? condition.expression\r\n : null,\r\n incrementor,\r\n statement,\r\n tn.range(startPos, tn.pos)\r\n );\r\n\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \";\"\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \";\"\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"(\"\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n parseIfStatement(\r\n tn: Tokenizer\r\n ): IfStatement | null {\r\n\r\n // at 'if': '(' Expression ')' Statement ('else' Statement)?\r\n\r\n var startPos = tn.tokenPos;\r\n if (tn.skip(Token.OPENPAREN)) {\r\n let condition = this.parseExpression(tn);\r\n if (!condition) return null;\r\n if (tn.skip(Token.CLOSEPAREN)) {\r\n let statement = this.parseStatement(tn);\r\n if (!statement) return null;\r\n let elseStatement: Statement | null = null;\r\n if (tn.skip(Token.ELSE)) {\r\n elseStatement = this.parseStatement(tn);\r\n if (!elseStatement) return null;\r\n }\r\n return Node.createIfStatement(\r\n condition,\r\n statement,\r\n elseStatement,\r\n tn.range(startPos, tn.pos)\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \")\"\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"(\"\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n parseSwitchStatement(\r\n tn: Tokenizer\r\n ): SwitchStatement | null {\r\n\r\n // at 'switch': '(' Expression ')' '{' SwitchCase* '}' ';'?\r\n\r\n var startPos = tn.tokenPos;\r\n if (tn.skip(Token.OPENPAREN)) {\r\n let condition = this.parseExpression(tn);\r\n if (!condition) return null;\r\n if (tn.skip(Token.CLOSEPAREN)) {\r\n if (tn.skip(Token.OPENBRACE)) {\r\n let cases = new Array();\r\n while (!tn.skip(Token.CLOSEBRACE)) {\r\n let case_ = this.parseSwitchCase(tn);\r\n if (!case_) return null;\r\n cases.push(case_);\r\n }\r\n let ret = Node.createSwitchStatement(condition, cases, tn.range(startPos, tn.pos));\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"{\"\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \")\"\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"(\"\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n parseSwitchCase(\r\n tn: Tokenizer\r\n ): SwitchCase | null {\r\n\r\n var startPos = tn.tokenPos;\r\n var statements: Statement[],\r\n statement: Statement | null;\r\n\r\n // 'case' Expression ':' Statement*\r\n\r\n if (tn.skip(Token.CASE)) {\r\n let label = this.parseExpression(tn);\r\n if (!label) return null;\r\n if (tn.skip(Token.COLON)) {\r\n statements = new Array();\r\n while (tn.peek() != Token.CASE && tn.nextToken != Token.DEFAULT && tn.nextToken != Token.CLOSEBRACE) {\r\n statement = this.parseStatement(tn);\r\n if (!statement) return null;\r\n statements.push(statement);\r\n }\r\n return Node.createSwitchCase(label, statements, tn.range(startPos, tn.pos));\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \":\"\r\n );\r\n }\r\n\r\n // 'default' ':' Statement*\r\n\r\n } else if (tn.skip(Token.DEFAULT)) {\r\n if (tn.skip(Token.COLON)) {\r\n statements = new Array();\r\n while (tn.peek() != Token.CASE && tn.nextToken != Token.DEFAULT && tn.nextToken != Token.CLOSEBRACE) {\r\n statement = this.parseStatement(tn);\r\n if (!statement) return null;\r\n statements.push(statement);\r\n }\r\n return Node.createSwitchCase(null, statements, tn.range(startPos, tn.pos));\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \":\"\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._case_or_default_expected,\r\n tn.range()\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n parseThrowStatement(\r\n tn: Tokenizer\r\n ): ThrowStatement | null {\r\n\r\n // at 'throw': Expression ';'?\r\n\r\n var startPos = tn.tokenPos;\r\n var expression = this.parseExpression(tn);\r\n if (!expression) return null;\r\n var ret = Node.createThrowStatement(expression, tn.range(startPos, tn.pos));\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n }\r\n\r\n parseTryStatement(\r\n tn: Tokenizer\r\n ): TryStatement | null {\r\n\r\n // at 'try':\r\n // '{' Statement* '}'\r\n // ('catch' '(' VariableMember ')' '{' Statement* '}')?\r\n // ('finally' '{' Statement* '}'? ';'?\r\n\r\n var startPos = tn.tokenPos;\r\n var stmt: Statement | null;\r\n if (tn.skip(Token.OPENBRACE)) {\r\n let statements = new Array();\r\n while (!tn.skip(Token.CLOSEBRACE)) {\r\n stmt = this.parseStatement(tn);\r\n if (!stmt) return null;\r\n statements.push(stmt);\r\n }\r\n let catchVariable: IdentifierExpression | null = null;\r\n let catchStatements: Statement[] | null = null;\r\n let finallyStatements: Statement[] | null = null;\r\n if (tn.skip(Token.CATCH)) {\r\n if (!tn.skip(Token.OPENPAREN)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"(\"\r\n );\r\n return null;\r\n }\r\n if (!tn.skipIdentifier()) {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n return null;\r\n }\r\n catchVariable = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n if (!tn.skip(Token.CLOSEPAREN)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \")\"\r\n );\r\n return null;\r\n }\r\n if (!tn.skip(Token.OPENBRACE)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"{\"\r\n );\r\n return null;\r\n }\r\n catchStatements = [];\r\n while (!tn.skip(Token.CLOSEBRACE)) {\r\n stmt = this.parseStatement(tn);\r\n if (!stmt) return null;\r\n catchStatements.push(stmt);\r\n }\r\n }\r\n if (tn.skip(Token.FINALLY)) {\r\n if (!tn.skip(Token.OPENBRACE)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"{\"\r\n );\r\n return null;\r\n }\r\n finallyStatements = [];\r\n while (!tn.skip(Token.CLOSEBRACE)) {\r\n stmt = this.parseStatement(tn);\r\n if (!stmt) return null;\r\n finallyStatements.push(stmt);\r\n }\r\n }\r\n if (!(catchStatements || finallyStatements)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"catch\"\r\n );\r\n return null;\r\n }\r\n let ret = Node.createTryStatement(\r\n statements,\r\n catchVariable,\r\n catchStatements,\r\n finallyStatements,\r\n tn.range(startPos, tn.pos)\r\n );\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"{\"\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n parseTypeDeclaration(\r\n tn: Tokenizer,\r\n flags: CommonFlags,\r\n decorators: DecoratorNode[] | null,\r\n startPos: i32\r\n ): TypeDeclaration | null {\r\n\r\n // at 'type': Identifier ('<' TypeParameters '>')? '=' Type ';'?\r\n\r\n if (tn.skipIdentifier()) {\r\n let name = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n let typeParameters: TypeParameterNode[] | null = null;\r\n if (tn.skip(Token.LESSTHAN)) {\r\n typeParameters = this.parseTypeParameters(tn);\r\n if (!typeParameters) return null;\r\n flags |= CommonFlags.GENERIC;\r\n }\r\n if (tn.skip(Token.EQUALS)) {\r\n let type = this.parseType(tn);\r\n if (!type) return null;\r\n let ret = Node.createTypeDeclaration(\r\n name,\r\n typeParameters,\r\n type,\r\n decorators,\r\n flags,\r\n tn.range(startPos, tn.pos)\r\n );\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"=\"\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range()\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n parseVoidStatement(\r\n tn: Tokenizer\r\n ): VoidStatement | null {\r\n\r\n // at 'void': Expression ';'?\r\n\r\n var startPos = tn.tokenPos;\r\n var expression = this.parseExpression(tn, Precedence.GROUPING);\r\n if (!expression) return null;\r\n var ret = Node.createVoidStatement(expression, tn.range(startPos, tn.pos));\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n }\r\n\r\n parseWhileStatement(\r\n tn: Tokenizer\r\n ): WhileStatement | null {\r\n\r\n // at 'while': '(' Expression ')' Statement ';'?\r\n\r\n var startPos = tn.tokenPos;\r\n if (tn.skip(Token.OPENPAREN)) {\r\n let expression = this.parseExpression(tn);\r\n if (!expression) return null;\r\n if (tn.skip(Token.CLOSEPAREN)) {\r\n let statement = this.parseStatement(tn);\r\n if (!statement) return null;\r\n let ret = Node.createWhileStatement(expression, statement, tn.range(startPos, tn.pos));\r\n tn.skip(Token.SEMICOLON);\r\n return ret;\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \")\"\r\n );\r\n }\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"(\"\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n // expressions\r\n // see: http://www.engr.mun.ca/~theo/Misc/exp_parsing.htm#climbing\r\n\r\n parseExpressionStart(\r\n tn: Tokenizer\r\n ): Expression | null {\r\n\r\n var token = tn.next(IdentifierHandling.PREFER);\r\n var startPos = tn.tokenPos;\r\n var precedence = determinePrecedenceStart(token);\r\n if (precedence != Precedence.NONE) {\r\n let operand: Expression | null;\r\n\r\n // TODO: SpreadExpression, YieldExpression (currently become unsupported UnaryPrefixExpressions)\r\n\r\n // NewExpression\r\n if (token == Token.NEW) {\r\n operand = this.parseExpression(tn, Precedence.CALL);\r\n if (!operand) return null;\r\n if (operand.kind == NodeKind.CALL) {\r\n return Node.createNewExpression(\r\n (operand).expression,\r\n (operand).typeArguments,\r\n (operand).arguments,\r\n tn.range(startPos, tn.pos)\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Operation_not_supported,\r\n tn.range()\r\n );\r\n }\r\n return null;\r\n } else {\r\n operand = this.parseExpression(tn, precedence);\r\n if (!operand) return null;\r\n }\r\n\r\n // UnaryPrefixExpression\r\n if (token == Token.PLUS_PLUS || token == Token.MINUS_MINUS) {\r\n if (\r\n operand.kind != NodeKind.IDENTIFIER &&\r\n operand.kind != NodeKind.ELEMENTACCESS &&\r\n operand.kind != NodeKind.PROPERTYACCESS\r\n ) {\r\n this.error(\r\n DiagnosticCode.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access,\r\n operand.range\r\n );\r\n }\r\n }\r\n return Node.createUnaryPrefixExpression(token, operand, tn.range(startPos, tn.pos));\r\n }\r\n\r\n var expr: Expression | null = null;\r\n switch (token) {\r\n\r\n case Token.NULL: return Node.createNullExpression(tn.range());\r\n case Token.TRUE: return Node.createTrueExpression(tn.range());\r\n case Token.FALSE: return Node.createFalseExpression(tn.range());\r\n\r\n // ParenthesizedExpression\r\n // FunctionExpression\r\n case Token.OPENPAREN: {\r\n\r\n // determine whether this is a function expression\r\n if (tn.skip(Token.CLOSEPAREN)) { // must be a function expression (fast route)\r\n return this.parseFunctionExpressionCommon(\r\n tn,\r\n Node.createEmptyIdentifierExpression(tn.range(startPos)),\r\n [],\r\n ArrowKind.ARROW_PARENTHESIZED\r\n );\r\n }\r\n let state = tn.mark();\r\n let again = true;\r\n do {\r\n switch (tn.next(IdentifierHandling.PREFER)) {\r\n\r\n // function expression\r\n case Token.DOT_DOT_DOT: {\r\n tn.reset(state);\r\n return this.parseFunctionExpression(tn);\r\n }\r\n // can be both\r\n case Token.IDENTIFIER: {\r\n tn.readIdentifier();\r\n switch (tn.next()) {\r\n\r\n // if we got here, check for arrow\r\n case Token.CLOSEPAREN: {\r\n if (\r\n !tn.skip(Token.COLON) &&\r\n !tn.skip(Token.EQUALS_GREATERTHAN)\r\n ) {\r\n again = false;\r\n break;\r\n }\r\n // fall-through\r\n }\r\n // function expression\r\n case Token.COLON: { // type annotation\r\n tn.reset(state);\r\n return this.parseFunctionExpression(tn);\r\n }\r\n // optional parameter or parenthesized\r\n case Token.QUESTION: {\r\n if (\r\n tn.skip(Token.COLON) || // optional parameter with type\r\n tn.skip(Token.COMMA) || // optional parameter without type\r\n tn.skip(Token.CLOSEPAREN) // last optional parameter without type\r\n ) {\r\n tn.reset(state);\r\n return this.parseFunctionExpression(tn);\r\n }\r\n again = false; // parenthesized\r\n break;\r\n }\r\n case Token.COMMA: {\r\n break; // continue\r\n }\r\n // parenthesized expression\r\n // case Token.EQUALS: // missing type annotation for simplicity\r\n default: {\r\n again = false;\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n // parenthesized expression\r\n default: {\r\n again = false;\r\n break;\r\n }\r\n }\r\n } while (again);\r\n tn.reset(state);\r\n\r\n // parse parenthesized\r\n expr = this.parseExpression(tn);\r\n if (!expr) return null;\r\n if (!tn.skip(Token.CLOSEPAREN)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \")\"\r\n );\r\n return null;\r\n }\r\n return Node.createParenthesizedExpression(expr, tn.range(startPos, tn.pos));\r\n }\r\n // ArrayLiteralExpression\r\n case Token.OPENBRACKET: {\r\n let elementExpressions = new Array();\r\n while (!tn.skip(Token.CLOSEBRACKET)) {\r\n if (tn.peek() == Token.COMMA) {\r\n expr = null; // omitted\r\n } else {\r\n expr = this.parseExpression(tn, Precedence.COMMA + 1);\r\n if (!expr) return null;\r\n }\r\n elementExpressions.push(expr);\r\n if (!tn.skip(Token.COMMA)) {\r\n if (tn.skip(Token.CLOSEBRACKET)) {\r\n break;\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"]\"\r\n );\r\n return null;\r\n }\r\n }\r\n }\r\n return Node.createArrayLiteralExpression(elementExpressions, tn.range(startPos, tn.pos));\r\n }\r\n // ObjectLiteralExpression\r\n case Token.OPENBRACE: {\r\n let startPos = tn.tokenPos;\r\n let names = new Array();\r\n let values = new Array();\r\n let name: IdentifierExpression;\r\n while (!tn.skip(Token.CLOSEBRACE)) {\r\n if (!tn.skipIdentifier()) {\r\n if (!tn.skip(Token.STRINGLITERAL)) {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n tn.range(),\r\n );\r\n return null;\r\n }\r\n name = Node.createIdentifierExpression(tn.readString(), tn.range());\r\n name.isQuoted = true;\r\n } else {\r\n name = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n }\r\n names.push(name);\r\n if (tn.skip(Token.COLON)) {\r\n let value = this.parseExpression(tn, Precedence.COMMA + 1);\r\n if (!value) return null;\r\n values.push(value);\r\n } else if (!name.isQuoted) {\r\n values.push(name);\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \":\"\r\n );\r\n return null;\r\n }\r\n if (!tn.skip(Token.COMMA)) {\r\n if (tn.skip(Token.CLOSEBRACE)) {\r\n break;\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"}\"\r\n );\r\n return null;\r\n }\r\n }\r\n }\r\n return Node.createObjectLiteralExpression(names, values, tn.range(startPos, tn.pos));\r\n }\r\n // AssertionExpression (unary prefix)\r\n case Token.LESSTHAN: {\r\n let toType = this.parseType(tn);\r\n if (!toType) return null;\r\n if (!tn.skip(Token.GREATERTHAN)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \">\"\r\n );\r\n return null;\r\n }\r\n expr = this.parseExpression(tn, Precedence.CALL);\r\n if (!expr) return null;\r\n return Node.createAssertionExpression(\r\n AssertionKind.PREFIX,\r\n expr,\r\n toType,\r\n tn.range(startPos, tn.pos)\r\n );\r\n }\r\n case Token.IDENTIFIER: {\r\n let identifier = Node.createIdentifierExpression(tn.readIdentifier(), tn.range(startPos, tn.pos));\r\n if (tn.peek(true) == Token.EQUALS_GREATERTHAN && !tn.nextTokenOnNewLine) {\r\n return this.parseFunctionExpressionCommon(\r\n tn,\r\n Node.createEmptyIdentifierExpression(tn.range(startPos)),\r\n [\r\n Node.createParameter(\r\n identifier,\r\n Node.createOmittedType(identifier.range.atEnd),\r\n null,\r\n ParameterKind.DEFAULT,\r\n identifier.range\r\n )\r\n ],\r\n ArrowKind.ARROW_SINGLE,\r\n startPos\r\n );\r\n }\r\n return identifier;\r\n }\r\n case Token.THIS: {\r\n return Node.createThisExpression(tn.range(startPos, tn.pos));\r\n }\r\n case Token.CONSTRUCTOR: {\r\n return Node.createConstructorExpression(tn.range(startPos, tn.pos));\r\n }\r\n case Token.SUPER: {\r\n if (tn.peek() != Token.DOT && tn.nextToken != Token.OPENPAREN) {\r\n this.error(\r\n DiagnosticCode._super_must_be_followed_by_an_argument_list_or_member_access,\r\n tn.range()\r\n );\r\n }\r\n return Node.createSuperExpression(tn.range(startPos, tn.pos));\r\n }\r\n case Token.STRINGLITERAL: {\r\n return Node.createStringLiteralExpression(tn.readString(), tn.range(startPos, tn.pos));\r\n }\r\n case Token.INTEGERLITERAL: {\r\n return Node.createIntegerLiteralExpression(tn.readInteger(), tn.range(startPos, tn.pos));\r\n }\r\n case Token.FLOATLITERAL: {\r\n return Node.createFloatLiteralExpression(tn.readFloat(), tn.range(startPos, tn.pos));\r\n }\r\n // RegexpLiteralExpression\r\n // note that this also continues on invalid ones so the surrounding AST remains intact\r\n case Token.SLASH: {\r\n let regexpPattern = tn.readRegexpPattern(); // also reports\r\n if (!tn.skip(Token.SLASH)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"/\"\r\n );\r\n return null;\r\n }\r\n return Node.createRegexpLiteralExpression(\r\n regexpPattern,\r\n tn.readRegexpFlags(), // also reports\r\n tn.range(startPos, tn.pos)\r\n );\r\n }\r\n case Token.FUNCTION: {\r\n return this.parseFunctionExpression(tn);\r\n }\r\n case Token.CLASS: {\r\n return this.parseClassExpression(tn);\r\n }\r\n default: {\r\n if (token == Token.ENDOFFILE) {\r\n this.error(\r\n DiagnosticCode.Unexpected_end_of_text,\r\n tn.range(startPos)\r\n );\r\n } else {\r\n this.error(\r\n DiagnosticCode.Expression_expected,\r\n tn.range()\r\n );\r\n }\r\n return null;\r\n }\r\n }\r\n }\r\n\r\n tryParseTypeArgumentsBeforeArguments(\r\n tn: Tokenizer\r\n ): CommonTypeNode[] | null {\r\n\r\n // at '<': Type (',' Type)* '>' '('\r\n\r\n var state = tn.mark();\r\n if (!tn.skip(Token.LESSTHAN)) return null;\r\n var typeArguments: CommonTypeNode[] | null = null;\r\n do {\r\n if (tn.peek() === Token.GREATERTHAN) {\r\n break;\r\n }\r\n let type = this.parseType(tn, true, true);\r\n if (!type) {\r\n tn.reset(state);\r\n return null;\r\n }\r\n if (!typeArguments) typeArguments = [ type ];\r\n else typeArguments.push(type);\r\n } while (tn.skip(Token.COMMA));\r\n if (tn.skip(Token.GREATERTHAN) && tn.skip(Token.OPENPAREN)) {\r\n return typeArguments;\r\n }\r\n tn.reset(state);\r\n return null;\r\n }\r\n\r\n parseArguments(\r\n tn: Tokenizer\r\n ): Expression[] | null {\r\n\r\n // at '(': (Expression (',' Expression)*)? ')'\r\n\r\n var args = new Array();\r\n while (!tn.skip(Token.CLOSEPAREN)) {\r\n let expr = this.parseExpression(tn, Precedence.COMMA + 1);\r\n if (!expr) return null;\r\n args.push(expr);\r\n if (!tn.skip(Token.COMMA)) {\r\n if (tn.skip(Token.CLOSEPAREN)) {\r\n break;\r\n } else {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \")\"\r\n );\r\n return null;\r\n }\r\n }\r\n }\r\n return args;\r\n }\r\n\r\n parseExpression(\r\n tn: Tokenizer,\r\n precedence: Precedence = Precedence.COMMA\r\n ): Expression | null {\r\n assert(precedence != Precedence.NONE);\r\n\r\n var expr = this.parseExpressionStart(tn);\r\n if (!expr) return null;\r\n expr = this.maybeParseCallExpression(tn, expr); // simple call like on an Identifier\r\n\r\n var startPos = expr.range.start;\r\n var token: Token;\r\n var next: Expression | null = null;\r\n var nextPrecedence: Precedence;\r\n while (\r\n (nextPrecedence = determinePrecedence(token = tn.peek())) >= precedence\r\n ) { // precedence climbing\r\n tn.next();\r\n switch (token) {\r\n // AssertionExpression\r\n case Token.AS: {\r\n let toType = this.parseType(tn); // reports\r\n if (!toType) return null;\r\n expr = Node.createAssertionExpression(\r\n AssertionKind.AS,\r\n expr,\r\n toType,\r\n tn.range(startPos, tn.pos)\r\n );\r\n break;\r\n }\r\n case Token.EXCLAMATION: {\r\n expr = Node.createAssertionExpression(\r\n AssertionKind.NONNULL,\r\n expr,\r\n null,\r\n tn.range(startPos, tn.pos)\r\n );\r\n break;\r\n }\r\n // InstanceOfExpression\r\n case Token.INSTANCEOF: {\r\n let isType = this.parseType(tn); // reports\r\n if (!isType) return null;\r\n expr = Node.createInstanceOfExpression(\r\n expr,\r\n isType,\r\n tn.range(startPos, tn.pos)\r\n );\r\n break;\r\n }\r\n // ElementAccessExpression\r\n case Token.OPENBRACKET: {\r\n next = this.parseExpression(tn); // reports\r\n if (!next) return null;\r\n if (!tn.skip(Token.CLOSEBRACKET)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"]\"\r\n );\r\n return null;\r\n }\r\n expr = Node.createElementAccessExpression(\r\n expr,\r\n next,\r\n tn.range(startPos, tn.pos)\r\n );\r\n break;\r\n }\r\n // UnaryPostfixExpression\r\n case Token.PLUS_PLUS:\r\n case Token.MINUS_MINUS: {\r\n if (\r\n expr.kind != NodeKind.IDENTIFIER &&\r\n expr.kind != NodeKind.ELEMENTACCESS &&\r\n expr.kind != NodeKind.PROPERTYACCESS\r\n ) {\r\n this.error(\r\n DiagnosticCode.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access,\r\n expr.range\r\n );\r\n }\r\n expr = Node.createUnaryPostfixExpression(\r\n token,\r\n expr,\r\n tn.range(startPos, tn.pos)\r\n );\r\n break;\r\n }\r\n // TernaryExpression\r\n case Token.QUESTION: {\r\n let ifThen = this.parseExpression(tn);\r\n if (!ifThen) return null;\r\n if (!tn.skip(Token.COLON)) {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \":\"\r\n );\r\n return null;\r\n }\r\n let ifElse = this.parseExpression(tn, precedence > Precedence.COMMA\r\n ? Precedence.COMMA + 1\r\n : Precedence.COMMA\r\n );\r\n if (!ifElse) return null;\r\n expr = Node.createTernaryExpression(\r\n expr,\r\n ifThen,\r\n ifElse,\r\n tn.range(startPos, tn.pos)\r\n );\r\n break;\r\n }\r\n // CommaExpression\r\n case Token.COMMA: {\r\n let commaExprs: Expression[] = [ expr ];\r\n do {\r\n expr = this.parseExpression(tn, Precedence.COMMA + 1);\r\n if (!expr) return null;\r\n commaExprs.push(expr);\r\n } while (tn.skip(Token.COMMA));\r\n expr = Node.createCommaExpression(commaExprs, tn.range(startPos, tn.pos));\r\n break;\r\n }\r\n default: {\r\n\r\n // PropertyAccessExpression\r\n if (token == Token.DOT) {\r\n if (tn.skipIdentifier()) {\r\n next = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());\r\n } else {\r\n next = this.parseExpression(tn,\r\n isRightAssociative(token)\r\n ? nextPrecedence\r\n : nextPrecedence + 1\r\n );\r\n if (!next) return null;\r\n }\r\n if (next.kind == NodeKind.IDENTIFIER) { // expr '.' Identifier\r\n expr = Node.createPropertyAccessExpression(\r\n expr,\r\n next,\r\n tn.range(startPos, tn.pos)\r\n );\r\n } else if (next.kind == NodeKind.CALL) { // expr '.' CallExpression\r\n expr = this.joinPropertyCall(tn, startPos, expr, next);\r\n if (!expr) return null;\r\n } else {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n next.range\r\n );\r\n return null;\r\n }\r\n\r\n // BinaryExpression\r\n } else {\r\n next = this.parseExpression(tn,\r\n isRightAssociative(token)\r\n ? nextPrecedence\r\n : nextPrecedence + 1\r\n );\r\n if (!next) return null;\r\n expr = Node.createBinaryExpression(token, expr, next, tn.range(startPos, tn.pos));\r\n }\r\n break;\r\n }\r\n }\r\n expr = this.maybeParseCallExpression(tn, expr); // compound call like on an ElementAccess\r\n }\r\n return expr;\r\n }\r\n\r\n private joinPropertyCall(\r\n tn: Tokenizer,\r\n startPos: i32,\r\n expr: Expression,\r\n call: CallExpression\r\n ): Expression | null {\r\n var callee = call.expression;\r\n switch (callee.kind) {\r\n case NodeKind.IDENTIFIER: { // join property access and use as call target\r\n call.expression = Node.createPropertyAccessExpression(\r\n expr,\r\n callee,\r\n tn.range(startPos, tn.pos)\r\n );\r\n break;\r\n }\r\n case NodeKind.CALL: { // join call target und wrap the original call around it\r\n let inner = this.joinPropertyCall(tn, startPos, expr, callee);\r\n if (!inner) return null;\r\n call.expression = inner;\r\n call.range = tn.range(startPos, tn.pos);\r\n break;\r\n }\r\n default: {\r\n this.error(\r\n DiagnosticCode.Identifier_expected,\r\n call.range\r\n );\r\n return null;\r\n }\r\n }\r\n return call;\r\n }\r\n\r\n private maybeParseCallExpression(\r\n tn: Tokenizer,\r\n expr: Expression\r\n ): Expression {\r\n if (nodeIsCallable(expr.kind)) {\r\n let typeArguments: CommonTypeNode[] | null = null;\r\n while (\r\n tn.skip(Token.OPENPAREN)\r\n ||\r\n nodeIsGenericCallable(expr.kind) && (typeArguments = this.tryParseTypeArgumentsBeforeArguments(tn)) !== null\r\n ) {\r\n let args = this.parseArguments(tn);\r\n if (!args) break;\r\n expr = Node.createCallExpression( // is again callable\r\n expr,\r\n typeArguments,\r\n args,\r\n tn.range(expr.range.start, tn.pos)\r\n );\r\n }\r\n }\r\n return expr;\r\n }\r\n\r\n /** Skips over a statement on errors in an attempt to reduce unnecessary diagnostic noise. */\r\n skipStatement(tn: Tokenizer): void {\r\n tn.peek(true);\r\n if (tn.nextTokenOnNewLine) tn.next(); // if reset() to the previous line\r\n do {\r\n let nextToken = tn.peek(true);\r\n if (\r\n nextToken == Token.ENDOFFILE || // next step should handle this\r\n nextToken == Token.SEMICOLON // end of the statement for sure\r\n ) {\r\n tn.next();\r\n break;\r\n }\r\n if (tn.nextTokenOnNewLine) break; // end of the statement maybe\r\n switch (tn.next()) {\r\n case Token.IDENTIFIER: {\r\n tn.readIdentifier();\r\n break;\r\n }\r\n case Token.STRINGLITERAL: {\r\n tn.readString();\r\n break;\r\n }\r\n case Token.INTEGERLITERAL: {\r\n tn.readInteger();\r\n break;\r\n }\r\n case Token.FLOATLITERAL: {\r\n tn.readFloat();\r\n break;\r\n }\r\n case Token.OPENBRACE: {\r\n this.skipBlock(tn);\r\n break;\r\n }\r\n }\r\n } while (true);\r\n }\r\n\r\n /** Skips over a block on errors in an attempt to reduce unnecessary diagnostic noise. */\r\n skipBlock(tn: Tokenizer): void {\r\n // at '{': ... '}'\r\n var depth = 1;\r\n var again = true;\r\n do {\r\n switch (tn.next()) {\r\n case Token.ENDOFFILE: {\r\n this.error(\r\n DiagnosticCode._0_expected,\r\n tn.range(), \"}\"\r\n );\r\n again = false;\r\n break;\r\n }\r\n case Token.OPENBRACE: {\r\n ++depth;\r\n break;\r\n }\r\n case Token.CLOSEBRACE: {\r\n --depth;\r\n if (!depth) again = false;\r\n break;\r\n }\r\n case Token.IDENTIFIER: {\r\n tn.readIdentifier();\r\n break;\r\n }\r\n case Token.STRINGLITERAL: {\r\n tn.readString();\r\n break;\r\n }\r\n case Token.INTEGERLITERAL: {\r\n tn.readInteger();\r\n break;\r\n }\r\n case Token.FLOATLITERAL: {\r\n tn.readFloat();\r\n break;\r\n }\r\n }\r\n } while (again);\r\n }\r\n}\r\n\r\n/** Operator precedence from least to largest. */\r\nexport const enum Precedence {\r\n NONE,\r\n COMMA,\r\n SPREAD,\r\n YIELD,\r\n ASSIGNMENT,\r\n CONDITIONAL,\r\n LOGICAL_OR,\r\n LOGICAL_AND,\r\n BITWISE_OR,\r\n BITWISE_XOR,\r\n BITWISE_AND,\r\n EQUALITY,\r\n RELATIONAL,\r\n SHIFT,\r\n ADDITIVE,\r\n MULTIPLICATIVE,\r\n EXPONENTIATED,\r\n UNARY_PREFIX,\r\n UNARY_POSTFIX,\r\n CALL,\r\n MEMBERACCESS,\r\n GROUPING\r\n}\r\n\r\n/** Determines the precedence of a starting token. */\r\nfunction determinePrecedenceStart(kind: Token): Precedence {\r\n switch (kind) {\r\n case Token.DOT_DOT_DOT: return Precedence.SPREAD;\r\n case Token.YIELD: return Precedence.YIELD;\r\n case Token.EXCLAMATION:\r\n case Token.TILDE:\r\n case Token.PLUS:\r\n case Token.MINUS:\r\n case Token.PLUS_PLUS:\r\n case Token.MINUS_MINUS:\r\n case Token.TYPEOF:\r\n case Token.VOID:\r\n case Token.DELETE: return Precedence.UNARY_PREFIX;\r\n case Token.NEW: return Precedence.MEMBERACCESS;\r\n }\r\n return Precedence.NONE;\r\n}\r\n\r\n/** Determines the precende of a non-starting token. */\r\nfunction determinePrecedence(kind: Token): Precedence {\r\n switch (kind) {\r\n case Token.COMMA: return Precedence.COMMA;\r\n case Token.EQUALS:\r\n case Token.PLUS_EQUALS:\r\n case Token.MINUS_EQUALS:\r\n case Token.ASTERISK_ASTERISK_EQUALS:\r\n case Token.ASTERISK_EQUALS:\r\n case Token.SLASH_EQUALS:\r\n case Token.PERCENT_EQUALS:\r\n case Token.LESSTHAN_LESSTHAN_EQUALS:\r\n case Token.GREATERTHAN_GREATERTHAN_EQUALS:\r\n case Token.GREATERTHAN_GREATERTHAN_GREATERTHAN_EQUALS:\r\n case Token.AMPERSAND_EQUALS:\r\n case Token.CARET_EQUALS:\r\n case Token.BAR_EQUALS: return Precedence.ASSIGNMENT;\r\n case Token.QUESTION: return Precedence.CONDITIONAL;\r\n case Token.BAR_BAR: return Precedence.LOGICAL_OR;\r\n case Token.AMPERSAND_AMPERSAND: return Precedence.LOGICAL_AND;\r\n case Token.BAR: return Precedence.BITWISE_OR;\r\n case Token.CARET: return Precedence.BITWISE_XOR;\r\n case Token.AMPERSAND: return Precedence.BITWISE_AND;\r\n case Token.EQUALS_EQUALS:\r\n case Token.EXCLAMATION_EQUALS:\r\n case Token.EQUALS_EQUALS_EQUALS:\r\n case Token.EXCLAMATION_EQUALS_EQUALS: return Precedence.EQUALITY;\r\n case Token.AS:\r\n case Token.IN:\r\n case Token.INSTANCEOF:\r\n case Token.LESSTHAN:\r\n case Token.GREATERTHAN:\r\n case Token.LESSTHAN_EQUALS:\r\n case Token.GREATERTHAN_EQUALS: return Precedence.RELATIONAL;\r\n case Token.LESSTHAN_LESSTHAN:\r\n case Token.GREATERTHAN_GREATERTHAN:\r\n case Token.GREATERTHAN_GREATERTHAN_GREATERTHAN: return Precedence.SHIFT;\r\n case Token.PLUS:\r\n case Token.MINUS: return Precedence.ADDITIVE;\r\n case Token.ASTERISK:\r\n case Token.SLASH:\r\n case Token.PERCENT: return Precedence.MULTIPLICATIVE;\r\n case Token.ASTERISK_ASTERISK: return Precedence.EXPONENTIATED;\r\n case Token.PLUS_PLUS:\r\n case Token.MINUS_MINUS: return Precedence.UNARY_POSTFIX;\r\n case Token.DOT:\r\n case Token.NEW:\r\n case Token.OPENBRACKET:\r\n case Token.EXCLAMATION: return Precedence.MEMBERACCESS;\r\n }\r\n return Precedence.NONE;\r\n}\r\n\r\n/** Determines whether a non-starting token is right associative. */\r\nfunction isRightAssociative(kind: Token): bool {\r\n switch (kind) {\r\n case Token.EQUALS:\r\n case Token.PLUS_EQUALS:\r\n case Token.MINUS_EQUALS:\r\n case Token.ASTERISK_ASTERISK_EQUALS:\r\n case Token.ASTERISK_EQUALS:\r\n case Token.SLASH_EQUALS:\r\n case Token.PERCENT_EQUALS:\r\n case Token.LESSTHAN_LESSTHAN_EQUALS:\r\n case Token.GREATERTHAN_GREATERTHAN_EQUALS:\r\n case Token.GREATERTHAN_GREATERTHAN_GREATERTHAN_EQUALS:\r\n case Token.AMPERSAND_EQUALS:\r\n case Token.CARET_EQUALS:\r\n case Token.BAR_EQUALS:\r\n case Token.QUESTION:\r\n case Token.ASTERISK_ASTERISK: return true;\r\n default: return false;\r\n }\r\n}\r\n","/**\r\n * JavaScript glue code.\r\n * @module glue/js\r\n * @preferred\r\n *//***/\r\n\r\n/// \r\n\r\nimport \"./binaryen\"; // must be first so portable can pick up the memory implementation\r\nimport \"../../../std/portable/index\";\r\nimport \"./float\";\r\nimport \"./i64\";\r\n\r\nimport { Module } from \"../../module\";\r\n\r\nModule.prototype.toText = function(this: Module) {\r\n return binaryen.wrapModule(this.ref).emitStackIR();\r\n};\r\n\r\nModule.prototype.toAsmjs = function(this: Module) {\r\n return binaryen.wrapModule(this.ref).emitAsmjs();\r\n};\r\n","// Copy Binaryen exports to global scope\r\n\r\nconst binaryen = global.Binaryen || require(\"binaryen\");\r\nglobal.binaryen = binaryen;\r\n\r\nfor (var key in binaryen) {\r\n if (key.startsWith(\"_Binaryen\") || key.startsWith(\"_Relooper\")) global[key] = binaryen[key];\r\n}\r\n\r\n// Utilize Binaryen's heap\r\n\r\nglobal.__memory_allocate = binaryen._malloc;\r\nglobal.__memory_free = binaryen._free;\r\nglobal.__memory_copy = binaryen._memmove;\r\nglobal.__store = function(ptr, val) { binaryen.HEAPU8[ptr] = val; };\r\nglobal.__load = function(ptr) { return binaryen.HEAPU8[ptr]; };\r\n","module.exports = __WEBPACK_EXTERNAL_MODULE__20__;","/** @module std/portable *//***/\r\n\r\nvar globalScope = typeof window !== \"undefined\" && window || typeof global !== \"undefined\" && global || self;\r\n\r\nglobalScope.ASC_TARGET = 2; // Target.JS\r\nglobalScope.ASC_NO_ASSERT = false;\r\nglobalScope.ASC_MEMORY_BASE = 0;\r\nglobalScope.ASC_OPTIMIZE_LEVEL = 3;\r\nglobalScope.ASC_SHRINK_LEVEL = 0;\r\nglobalScope.ASC_FEATURE_MUTABLE_GLOBAL = false;\r\nglobalScope.ASC_FEATURE_SIGN_EXTENSION = false;\r\nglobalScope.ASC_FEATURE_BULK_MEMORY = false;\r\nglobalScope.ASC_FEATURE_SIMD = false;\r\nglobalScope.ASC_FEATURE_THREADS = false;\r\n\r\nvar F64 = new Float64Array(1);\r\nvar U64 = new Uint32Array(F64.buffer);\r\n\r\nObject.defineProperties(\r\n globalScope[\"i8\"] = function i8(value) { return value << 24 >> 24; }\r\n, {\r\n \"MIN_VALUE\": { value: -128, writable: false },\r\n \"MAX_VALUE\": { value: 127, writable: false }\r\n});\r\n\r\nObject.defineProperties(\r\n globalScope[\"i16\"] = function i16(value) { return value << 16 >> 16; }\r\n, {\r\n \"MIN_VALUE\": { value: -32768, writable: false },\r\n \"MAX_VALUE\": { value: 32767, writable: false }\r\n});\r\n\r\nObject.defineProperties(\r\n globalScope[\"i32\"] = globalScope[\"isize\"] = function i32(value) { return value | 0; }\r\n, {\r\n \"MIN_VALUE\": { value: -2147483648, writable: false },\r\n \"MAX_VALUE\": { value: 2147483647, writable: false }\r\n});\r\n\r\nObject.defineProperties(\r\n globalScope[\"u8\"] = function u8(value) { return value & 0xff; }\r\n, {\r\n \"MIN_VALUE\": { value: 0, writable: false },\r\n \"MAX_VALUE\": { value: 255, writable: false }\r\n});\r\n\r\nObject.defineProperties(\r\n globalScope[\"u16\"] = function u16(value) { return value & 0xffff; }\r\n, {\r\n \"MIN_VALUE\": { value: 0, writable: false },\r\n \"MAX_VALUE\": { value: 65535, writable: false }\r\n});\r\n\r\nObject.defineProperties(\r\n globalScope[\"u32\"] = globalScope[\"usize\"] = function u32(value) { return value >>> 0; }\r\n, {\r\n \"MIN_VALUE\": { value: 0, writable: false },\r\n \"MAX_VALUE\": { value: 4294967295, writable: false }\r\n});\r\n\r\nObject.defineProperties(\r\n globalScope[\"bool\"] = function bool(value) { return !!value; }\r\n, {\r\n \"MIN_VALUE\": { value: false, writable: false },\r\n \"MAX_VALUE\": { value: true, writable: false }\r\n});\r\n\r\nObject.defineProperties(\r\n globalScope[\"f32\"] = function f32(value) { return Math.fround(value); }\r\n, {\r\n \"EPSILON\": { value: Math.fround(1.1920929e-07), writable: false },\r\n \"MIN_VALUE\": { value: Math.fround(1.4012985e-45), writable: false },\r\n \"MAX_VALUE\": { value: Math.fround(3.4028235e+38), writable: false },\r\n \"MIN_NORMAL_VALUE\": { value: Math.fround(1.17549435e-38), writable: false },\r\n \"MIN_SAFE_INTEGER\": { value: -16777215, writable: false },\r\n \"MAX_SAFE_INTEGER\": { value: 16777215, writable: false }\r\n});\r\n\r\nObject.defineProperties(\r\n globalScope[\"f64\"] = function f64(value) { return +value; }\r\n, {\r\n \"EPSILON\": { value: 2.2204460492503131e-16, writable: false },\r\n \"MIN_VALUE\": { value: 5e-324, writable: false },\r\n \"MAX_VALUE\": { value: 1.7976931348623157e+308, writable: false },\r\n \"MIN_NORMAL_VALUE\": { value: 2.2250738585072014e-308 , writable: false },\r\n \"MIN_SAFE_INTEGER\": { value: -9007199254740991, writable: false },\r\n \"MAX_SAFE_INTEGER\": { value: 9007199254740991, writable: false }\r\n});\r\n\r\nglobalScope[\"clz\"] = Math.clz32;\r\n\r\nglobalScope[\"ctz\"] = function ctz(value) {\r\n var c = Math.clz32(value & -value);\r\n return value ? 31 - c : c;\r\n};\r\n\r\nglobalScope[\"popcnt\"] = function popcnt(value) {\r\n value -= value >>> 1 & 0x55555555;\r\n value = (value & 0x33333333) + (value >>> 2 & 0x33333333);\r\n return (((value + (value >>> 4)) & 0x0F0F0F0F) * 0x01010101) >>> 24;\r\n};\r\n\r\nglobalScope[\"rotl\"] = function rotl(value, shift) {\r\n shift &= 31;\r\n return (value << shift) | (value >>> (32 - shift));\r\n};\r\n\r\nglobalScope[\"rotr\"] = function rotr(value, shift) {\r\n shift &= 31;\r\n return (value >>> shift) | (value << (32 - shift));\r\n};\r\n\r\nglobalScope[\"abs\"] = Math.abs;\r\n\r\nglobalScope[\"max\"] = Math.max;\r\n\r\nglobalScope[\"min\"] = Math.min;\r\n\r\nglobalScope[\"ceil\"] = Math.ceil;\r\n\r\nglobalScope[\"floor\"] = Math.floor;\r\n\r\n// Adopt code from https://github.com/rfk/wasm-polyfill\r\nglobalScope[\"nearest\"] = function nearest(value) {\r\n if (Math.abs(value - Math.trunc(value)) === 0.5) {\r\n return 2.0 * Math.round(value * 0.5);\r\n }\r\n return Math.round(value);\r\n};\r\n\r\nglobalScope[\"select\"] = function select(ifTrue, ifFalse, condition) {\r\n return condition ? ifTrue : ifFalse;\r\n};\r\n\r\nglobalScope[\"sqrt\"] = Math.sqrt;\r\n\r\nglobalScope[\"trunc\"] = Math.trunc;\r\n\r\nglobalScope[\"copysign\"] = function copysign(x, y) {\r\n return Math.abs(x) * Math.sign(y);\r\n};\r\n\r\nglobalScope[\"bswap\"] = function bswap(value) {\r\n var a = value >> 8 & 0x00FF00FF;\r\n var b = (value & 0x00FF00FF) << 8;\r\n value = a | b;\r\n a = value >> 16 & 0x0000FFFF;\r\n b = (value & 0x0000FFFF) << 16;\r\n return a | b;\r\n};\r\n\r\nglobalScope[\"bswap16\"] = function bswap16(value) {\r\n return ((value << 8) & 0xFF00) | ((value >> 8) & 0x00FF) | (value & 0xFFFF0000);\r\n};\r\n\r\nfunction UnreachableError() {\r\n if (Error.captureStackTrace) {\r\n Error.captureStackTrace(this, UnreachableError);\r\n } else {\r\n this.stack = this.name + \": \" + this.message + \"\\n\" + new Error().stack;\r\n }\r\n}\r\nUnreachableError.prototype = Object.create(Error.prototype);\r\nUnreachableError.prototype.name = \"UnreachableError\";\r\nUnreachableError.prototype.message = \"unreachable\";\r\n\r\nglobalScope[\"unreachable\"] = function unreachable() {\r\n throw new UnreachableError();\r\n};\r\n\r\nfunction AssertionError(message) {\r\n this.message = message || \"assertion failed\";\r\n if (Error.captureStackTrace) {\r\n Error.captureStackTrace(this, AssertionError);\r\n } else {\r\n this.stack = this.name + \": \" + this.message + \"\\n\" + new Error().stack;\r\n }\r\n}\r\nAssertionError.prototype = Object.create(Error.prototype);\r\nAssertionError.prototype.name = \"AssertionError\";\r\n\r\nglobalScope[\"assert\"] = function assert(isTrueish, message) {\r\n if (isTrueish) return isTrueish;\r\n throw new AssertionError(message);\r\n};\r\n\r\nglobalScope[\"changetype\"] = function changetype(value) {\r\n return value;\r\n};\r\n\r\nglobalScope[\"parseI32\"] = function parseI32(str, radix) {\r\n return parseInt(str, undefined) | 0;\r\n};\r\n\r\nString[\"fromCharCodes\"] = function fromCharCodes(arr) {\r\n return String.fromCharCode.apply(String, arr);\r\n};\r\n\r\nString[\"fromCodePoints\"] = function fromCodePoints(arr) {\r\n return String.fromCodePoint.apply(String, arr);\r\n};\r\n\r\nglobalScope[\"isInteger\"] = Number.isInteger;\r\n\r\nglobalScope[\"isFloat\"] = function isFloat(arg) {\r\n return typeof arg === \"number\";\r\n};\r\n\r\nglobalScope[\"isNullable\"] = function isNullable(arg) {\r\n return true;\r\n}\r\n\r\nglobalScope[\"isReference\"] = function isReference(arg) {\r\n return typeof arg === \"object\" || typeof arg === \"string\";\r\n};\r\n\r\nglobalScope[\"isFunction\"] = function isFunction(arg) {\r\n return typeof arg === \"function\";\r\n}\r\n\r\nglobalScope[\"isString\"] = function isString(arg) {\r\n return typeof arg === \"string\" || arg instanceof String;\r\n};\r\n\r\nglobalScope[\"isArray\"] = Array.isArray;\r\nglobalScope[\"isArrayLike\"] = function isArrayLike(expr) {\r\n return expr\r\n && typeof expr === 'object'\r\n && typeof expr.length === 'number'\r\n && expr.length >= 0\r\n && Math.trunc(expr.length) === expr.length;\r\n};\r\n\r\nArray.create = function(capacity) {\r\n var arr = new Array(capacity);\r\n arr.length = 0;\r\n return arr;\r\n};\r\n\r\nglobalScope[\"isDefined\"] = function isDefined(expr) {\r\n return typeof expr !== \"undefined\";\r\n}\r\n\r\nglobalScope[\"isConstant\"] = function isConstant(expr) {\r\n return false;\r\n};\r\n\r\nglobalScope[\"unchecked\"] = function unchecked(expr) {\r\n return expr;\r\n};\r\n\r\nglobalScope[\"fmod\"] = function fmod(x, y) {\r\n return x % y;\r\n};\r\n\r\nglobalScope[\"fmodf\"] = function fmodf(x, y) {\r\n return Math.fround(x % y);\r\n};\r\n\r\nglobalScope[\"JSMath\"] = Math;\r\n\r\nObject.defineProperties(globalScope[\"JSMath\"], {\r\n sincos_sin: { value: 0.0, writable: true },\r\n sincos_cos: { value: 0.0, writable: true },\r\n signbit: {\r\n value: function signbit(x) {\r\n F64[0] = x; return Boolean((U64[1] >>> 31) & (x == x));\r\n }\r\n },\r\n sincos: {\r\n value: function sincos(x) {\r\n this.sincos_sin = Math.sin(x);\r\n this.sincos_cos = Math.cos(x);\r\n }\r\n }\r\n});\r\n\r\nglobalScope[\"memory\"] = (() => {\r\n var HEAP = new Uint8Array(0);\r\n var HEAP_OFFSET = 0;\r\n return {\r\n allocate: globalScope[\"__memory_allocate\"] || function allocate(size) {\r\n if (!(size >>>= 0)) return 0;\r\n if (HEAP_OFFSET + size > HEAP.length) {\r\n var oldHeap = HEAP;\r\n HEAP = new Uint8Array(Math.max(65536, HEAP.length + size, HEAP.length * 2));\r\n HEAP.set(oldHeap);\r\n }\r\n var ptr = HEAP_OFFSET;\r\n if ((HEAP_OFFSET += size) & 7) HEAP_OFFSET = (HEAP_OFFSET | 7) + 1;\r\n return ptr;\r\n },\r\n fill: globalScope[\"__memory_fill\"] || function fill(dest, value, size) {\r\n HEAP.fill(value, dest, dest + size);\r\n },\r\n free: globalScope[\"__memory_free\"] || function free(ptr) { },\r\n copy: globalScope[\"__memory_copy\"] || function copy(dest, src, size) {\r\n HEAP.copyWithin(dest, src, src + size);\r\n },\r\n reset: globalScope[\"__memory_reset\"] || function reset() {\r\n HEAP = new Uint8Array(0);\r\n HEAP_OFFSET = 0;\r\n }\r\n };\r\n})();\r\n\r\nglobalScope[\"store\"] = globalScope[\"__store\"] || function store(ptr, value, offset) {\r\n HEAP[(ptr | 0) + (offset | 0)] = value;\r\n};\r\n\r\nglobalScope[\"load\"] = globalScope[\"__load\"] || function load(ptr, offset) {\r\n return HEAP[(ptr | 0) + (offset | 0)];\r\n};\r\n\r\nglobalScope[\"unmanaged\"] = function() {};\r\n","const F64 = new Float64Array(1);\r\nconst F32 = new Float32Array(F64.buffer);\r\nconst I32 = new Int32Array(F64.buffer);\r\n\r\nglobal.f32_as_i32 = function(value) {\r\n F32[0] = value;\r\n return I32[0];\r\n};\r\n\r\nglobal.i32_as_f32 = function(value) {\r\n I32[0] = value;\r\n return F32[0];\r\n};\r\n\r\nglobal.f64_as_i64 = function(value) {\r\n F64[0] = value;\r\n return i64_new(I32[0], I32[1]);\r\n};\r\n\r\nglobal.i64_as_f64 = function(value) {\r\n I32[0] = i64_low(value);\r\n I32[1] = i64_high(value);\r\n return F64[0];\r\n};\r\n","const Long = global.Long || require(\"long\");\r\n\r\nglobal.i64_zero = Long.ZERO;\r\n\r\nglobal.i64_one = Long.ONE;\r\n\r\nglobal.i64_new = function(lo, hi) {\r\n return Long.fromBits(lo, hi);\r\n};\r\n\r\nglobal.i64_low = function(value) {\r\n return value.low;\r\n};\r\n\r\nglobal.i64_high = function(value) {\r\n return value.high;\r\n};\r\n\r\nglobal.i64_add = function(left, right) {\r\n return left.add(right);\r\n};\r\n\r\nglobal.i64_sub = function(left, right) {\r\n return left.sub(right);\r\n};\r\n\r\nglobal.i64_mul = function(left, right) {\r\n return left.mul(right);\r\n};\r\n\r\nglobal.i64_div = function(left, right) {\r\n return left.div(right);\r\n};\r\n\r\nglobal.i64_div_u = function(left, right) {\r\n return left.toUnsigned().div(right.toUnsigned()).toSigned();\r\n};\r\n\r\nglobal.i64_rem = function(left, right) {\r\n return left.mod(right);\r\n};\r\n\r\nglobal.i64_rem_u = function(left, right) {\r\n return left.toUnsigned().mod(right.toUnsigned()).toSigned();\r\n};\r\n\r\nglobal.i64_and = function(left, right) {\r\n return left.and(right);\r\n};\r\n\r\nglobal.i64_or = function(left, right) {\r\n return left.or(right);\r\n};\r\n\r\nglobal.i64_xor = function(left, right) {\r\n return left.xor(right);\r\n};\r\n\r\nglobal.i64_shl = function(left, right) {\r\n return left.shl(right);\r\n};\r\n\r\nglobal.i64_shr = function(left, right) {\r\n return left.shr(right);\r\n};\r\n\r\nglobal.i64_shr_u = function(left, right) {\r\n return left.shru(right);\r\n};\r\n\r\nglobal.i64_not = function(value) {\r\n return value.not();\r\n};\r\n\r\nglobal.i64_eq = function(left, right) {\r\n return left.eq(right);\r\n};\r\n\r\nglobal.i64_ne = function(left, right) {\r\n return left.ne(right);\r\n};\r\n\r\nglobal.i64_align = function(value, alignment) {\r\n assert(alignment && (alignment & (alignment - 1)) == 0);\r\n var mask = Long.fromInt(alignment - 1);\r\n return value.add(mask).and(mask.not());\r\n};\r\n\r\nglobal.i64_is_i8 = function(value) {\r\n return value.high === 0 && (value.low >= 0 && value.low <= i8.MAX_VALUE)\r\n || value.high === -1 && (value.low >= i8.MIN_VALUE && value.low < 0);\r\n};\r\n\r\nglobal.i64_is_i16 = function(value) {\r\n return value.high === 0 && (value.low >= 0 && value.low <= i16.MAX_VALUE)\r\n || value.high === -1 && (value.low >= i16.MIN_VALUE && value.low < 0);\r\n};\r\n\r\nglobal.i64_is_i32 = function(value) {\r\n return (value.high === 0 && value.low >= 0)\r\n || (value.high === -1 && value.low < 0);\r\n};\r\n\r\nglobal.i64_is_u8 = function(value) {\r\n return value.high === 0 && value.low >= 0 && value.low <= u8.MAX_VALUE;\r\n};\r\n\r\nglobal.i64_is_u16 = function(value) {\r\n return value.high === 0 && value.low >= 0 && value.low <= u16.MAX_VALUE;\r\n};\r\n\r\nglobal.i64_is_u32 = function(value) {\r\n return value.high === 0;\r\n};\r\n\r\nglobal.i64_is_bool = function(value) {\r\n return value.high === 0 && (value.low === 0 || value.low === 1);\r\n};\r\n\r\nconst minSafeF32 = Long.fromNumber(f32.MIN_SAFE_INTEGER);\r\nconst maxSafeF32 = Long.fromNumber(f32.MAX_SAFE_INTEGER);\r\n\r\nglobal.i64_is_f32 = function(value) {\r\n return value.gte(minSafeF32) && value.lte(maxSafeF32);\r\n};\r\n\r\nconst minSafeF64 = Long.fromNumber(f64.MIN_SAFE_INTEGER);\r\nconst maxSafeF64 = Long.fromNumber(f64.MAX_SAFE_INTEGER);\r\n\r\nglobal.i64_is_f64 = function(value) {\r\n return value.gte(minSafeF64) && value.lte(maxSafeF64);\r\n};\r\n\r\nglobal.i64_to_f32 = function(value) {\r\n return global.Math.fround(value.toNumber());\r\n};\r\n\r\nglobal.i64_to_f64 = function(value) {\r\n return value.toNumber();\r\n};\r\n\r\nglobal.i64_to_string = function(value, unsigned) {\r\n return (unsigned ? value.toUnsigned() : value).toString(10);\r\n};\r\n","module.exports = Long;\r\n\r\n/**\r\n * wasm optimizations, to do native i64 multiplication and divide\r\n */\r\nvar wasm = null;\r\n\r\ntry {\r\n wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([\r\n 0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11\r\n ])), {}).exports;\r\n} catch (e) {\r\n // no wasm support :(\r\n}\r\n\r\n/**\r\n * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers.\r\n * See the from* functions below for more convenient ways of constructing Longs.\r\n * @exports Long\r\n * @class A Long class for representing a 64 bit two's-complement integer value.\r\n * @param {number} low The low (signed) 32 bits of the long\r\n * @param {number} high The high (signed) 32 bits of the long\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @constructor\r\n */\r\nfunction Long(low, high, unsigned) {\r\n\r\n /**\r\n * The low 32 bits as a signed value.\r\n * @type {number}\r\n */\r\n this.low = low | 0;\r\n\r\n /**\r\n * The high 32 bits as a signed value.\r\n * @type {number}\r\n */\r\n this.high = high | 0;\r\n\r\n /**\r\n * Whether unsigned or not.\r\n * @type {boolean}\r\n */\r\n this.unsigned = !!unsigned;\r\n}\r\n\r\n// The internal representation of a long is the two given signed, 32-bit values.\r\n// We use 32-bit pieces because these are the size of integers on which\r\n// Javascript performs bit-operations. For operations like addition and\r\n// multiplication, we split each number into 16 bit pieces, which can easily be\r\n// multiplied within Javascript's floating-point representation without overflow\r\n// or change in sign.\r\n//\r\n// In the algorithms below, we frequently reduce the negative case to the\r\n// positive case by negating the input(s) and then post-processing the result.\r\n// Note that we must ALWAYS check specially whether those values are MIN_VALUE\r\n// (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as\r\n// a positive number, it overflows back into a negative). Not handling this\r\n// case would often result in infinite recursion.\r\n//\r\n// Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from*\r\n// methods on which they depend.\r\n\r\n/**\r\n * An indicator used to reliably determine if an object is a Long or not.\r\n * @type {boolean}\r\n * @const\r\n * @private\r\n */\r\nLong.prototype.__isLong__;\r\n\r\nObject.defineProperty(Long.prototype, \"__isLong__\", { value: true });\r\n\r\n/**\r\n * @function\r\n * @param {*} obj Object\r\n * @returns {boolean}\r\n * @inner\r\n */\r\nfunction isLong(obj) {\r\n return (obj && obj[\"__isLong__\"]) === true;\r\n}\r\n\r\n/**\r\n * Tests if the specified object is a Long.\r\n * @function\r\n * @param {*} obj Object\r\n * @returns {boolean}\r\n */\r\nLong.isLong = isLong;\r\n\r\n/**\r\n * A cache of the Long representations of small integer values.\r\n * @type {!Object}\r\n * @inner\r\n */\r\nvar INT_CACHE = {};\r\n\r\n/**\r\n * A cache of the Long representations of small unsigned integer values.\r\n * @type {!Object}\r\n * @inner\r\n */\r\nvar UINT_CACHE = {};\r\n\r\n/**\r\n * @param {number} value\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromInt(value, unsigned) {\r\n var obj, cachedObj, cache;\r\n if (unsigned) {\r\n value >>>= 0;\r\n if (cache = (0 <= value && value < 256)) {\r\n cachedObj = UINT_CACHE[value];\r\n if (cachedObj)\r\n return cachedObj;\r\n }\r\n obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true);\r\n if (cache)\r\n UINT_CACHE[value] = obj;\r\n return obj;\r\n } else {\r\n value |= 0;\r\n if (cache = (-128 <= value && value < 128)) {\r\n cachedObj = INT_CACHE[value];\r\n if (cachedObj)\r\n return cachedObj;\r\n }\r\n obj = fromBits(value, value < 0 ? -1 : 0, false);\r\n if (cache)\r\n INT_CACHE[value] = obj;\r\n return obj;\r\n }\r\n}\r\n\r\n/**\r\n * Returns a Long representing the given 32 bit integer value.\r\n * @function\r\n * @param {number} value The 32 bit integer in question\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long} The corresponding Long value\r\n */\r\nLong.fromInt = fromInt;\r\n\r\n/**\r\n * @param {number} value\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromNumber(value, unsigned) {\r\n if (isNaN(value))\r\n return unsigned ? UZERO : ZERO;\r\n if (unsigned) {\r\n if (value < 0)\r\n return UZERO;\r\n if (value >= TWO_PWR_64_DBL)\r\n return MAX_UNSIGNED_VALUE;\r\n } else {\r\n if (value <= -TWO_PWR_63_DBL)\r\n return MIN_VALUE;\r\n if (value + 1 >= TWO_PWR_63_DBL)\r\n return MAX_VALUE;\r\n }\r\n if (value < 0)\r\n return fromNumber(-value, unsigned).neg();\r\n return fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned);\r\n}\r\n\r\n/**\r\n * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.\r\n * @function\r\n * @param {number} value The number in question\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long} The corresponding Long value\r\n */\r\nLong.fromNumber = fromNumber;\r\n\r\n/**\r\n * @param {number} lowBits\r\n * @param {number} highBits\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromBits(lowBits, highBits, unsigned) {\r\n return new Long(lowBits, highBits, unsigned);\r\n}\r\n\r\n/**\r\n * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is\r\n * assumed to use 32 bits.\r\n * @function\r\n * @param {number} lowBits The low 32 bits\r\n * @param {number} highBits The high 32 bits\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long} The corresponding Long value\r\n */\r\nLong.fromBits = fromBits;\r\n\r\n/**\r\n * @function\r\n * @param {number} base\r\n * @param {number} exponent\r\n * @returns {number}\r\n * @inner\r\n */\r\nvar pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4)\r\n\r\n/**\r\n * @param {string} str\r\n * @param {(boolean|number)=} unsigned\r\n * @param {number=} radix\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromString(str, unsigned, radix) {\r\n if (str.length === 0)\r\n throw Error('empty string');\r\n if (str === \"NaN\" || str === \"Infinity\" || str === \"+Infinity\" || str === \"-Infinity\")\r\n return ZERO;\r\n if (typeof unsigned === 'number') {\r\n // For goog.math.long compatibility\r\n radix = unsigned,\r\n unsigned = false;\r\n } else {\r\n unsigned = !! unsigned;\r\n }\r\n radix = radix || 10;\r\n if (radix < 2 || 36 < radix)\r\n throw RangeError('radix');\r\n\r\n var p;\r\n if ((p = str.indexOf('-')) > 0)\r\n throw Error('interior hyphen');\r\n else if (p === 0) {\r\n return fromString(str.substring(1), unsigned, radix).neg();\r\n }\r\n\r\n // Do several (8) digits each time through the loop, so as to\r\n // minimize the calls to the very expensive emulated div.\r\n var radixToPower = fromNumber(pow_dbl(radix, 8));\r\n\r\n var result = ZERO;\r\n for (var i = 0; i < str.length; i += 8) {\r\n var size = Math.min(8, str.length - i),\r\n value = parseInt(str.substring(i, i + size), radix);\r\n if (size < 8) {\r\n var power = fromNumber(pow_dbl(radix, size));\r\n result = result.mul(power).add(fromNumber(value));\r\n } else {\r\n result = result.mul(radixToPower);\r\n result = result.add(fromNumber(value));\r\n }\r\n }\r\n result.unsigned = unsigned;\r\n return result;\r\n}\r\n\r\n/**\r\n * Returns a Long representation of the given string, written using the specified radix.\r\n * @function\r\n * @param {string} str The textual representation of the Long\r\n * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to signed\r\n * @param {number=} radix The radix in which the text is written (2-36), defaults to 10\r\n * @returns {!Long} The corresponding Long value\r\n */\r\nLong.fromString = fromString;\r\n\r\n/**\r\n * @function\r\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\nfunction fromValue(val, unsigned) {\r\n if (typeof val === 'number')\r\n return fromNumber(val, unsigned);\r\n if (typeof val === 'string')\r\n return fromString(val, unsigned);\r\n // Throws for non-objects, converts non-instanceof Long:\r\n return fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned);\r\n}\r\n\r\n/**\r\n * Converts the specified value to a Long using the appropriate from* function for its type.\r\n * @function\r\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val Value\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {!Long}\r\n */\r\nLong.fromValue = fromValue;\r\n\r\n// NOTE: the compiler should inline these constant values below and then remove these variables, so there should be\r\n// no runtime penalty for these.\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_16_DBL = 1 << 16;\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_24_DBL = 1 << 24;\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL;\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL;\r\n\r\n/**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2;\r\n\r\n/**\r\n * @type {!Long}\r\n * @const\r\n * @inner\r\n */\r\nvar TWO_PWR_24 = fromInt(TWO_PWR_24_DBL);\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar ZERO = fromInt(0);\r\n\r\n/**\r\n * Signed zero.\r\n * @type {!Long}\r\n */\r\nLong.ZERO = ZERO;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar UZERO = fromInt(0, true);\r\n\r\n/**\r\n * Unsigned zero.\r\n * @type {!Long}\r\n */\r\nLong.UZERO = UZERO;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar ONE = fromInt(1);\r\n\r\n/**\r\n * Signed one.\r\n * @type {!Long}\r\n */\r\nLong.ONE = ONE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar UONE = fromInt(1, true);\r\n\r\n/**\r\n * Unsigned one.\r\n * @type {!Long}\r\n */\r\nLong.UONE = UONE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar NEG_ONE = fromInt(-1);\r\n\r\n/**\r\n * Signed negative one.\r\n * @type {!Long}\r\n */\r\nLong.NEG_ONE = NEG_ONE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar MAX_VALUE = fromBits(0xFFFFFFFF|0, 0x7FFFFFFF|0, false);\r\n\r\n/**\r\n * Maximum signed value.\r\n * @type {!Long}\r\n */\r\nLong.MAX_VALUE = MAX_VALUE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF|0, 0xFFFFFFFF|0, true);\r\n\r\n/**\r\n * Maximum unsigned value.\r\n * @type {!Long}\r\n */\r\nLong.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE;\r\n\r\n/**\r\n * @type {!Long}\r\n * @inner\r\n */\r\nvar MIN_VALUE = fromBits(0, 0x80000000|0, false);\r\n\r\n/**\r\n * Minimum signed value.\r\n * @type {!Long}\r\n */\r\nLong.MIN_VALUE = MIN_VALUE;\r\n\r\n/**\r\n * @alias Long.prototype\r\n * @inner\r\n */\r\nvar LongPrototype = Long.prototype;\r\n\r\n/**\r\n * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer.\r\n * @returns {number}\r\n */\r\nLongPrototype.toInt = function toInt() {\r\n return this.unsigned ? this.low >>> 0 : this.low;\r\n};\r\n\r\n/**\r\n * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa).\r\n * @returns {number}\r\n */\r\nLongPrototype.toNumber = function toNumber() {\r\n if (this.unsigned)\r\n return ((this.high >>> 0) * TWO_PWR_32_DBL) + (this.low >>> 0);\r\n return this.high * TWO_PWR_32_DBL + (this.low >>> 0);\r\n};\r\n\r\n/**\r\n * Converts the Long to a string written in the specified radix.\r\n * @param {number=} radix Radix (2-36), defaults to 10\r\n * @returns {string}\r\n * @override\r\n * @throws {RangeError} If `radix` is out of range\r\n */\r\nLongPrototype.toString = function toString(radix) {\r\n radix = radix || 10;\r\n if (radix < 2 || 36 < radix)\r\n throw RangeError('radix');\r\n if (this.isZero())\r\n return '0';\r\n if (this.isNegative()) { // Unsigned Longs are never negative\r\n if (this.eq(MIN_VALUE)) {\r\n // We need to change the Long value before it can be negated, so we remove\r\n // the bottom-most digit in this base and then recurse to do the rest.\r\n var radixLong = fromNumber(radix),\r\n div = this.div(radixLong),\r\n rem1 = div.mul(radixLong).sub(this);\r\n return div.toString(radix) + rem1.toInt().toString(radix);\r\n } else\r\n return '-' + this.neg().toString(radix);\r\n }\r\n\r\n // Do several (6) digits each time through the loop, so as to\r\n // minimize the calls to the very expensive emulated div.\r\n var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned),\r\n rem = this;\r\n var result = '';\r\n while (true) {\r\n var remDiv = rem.div(radixToPower),\r\n intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0,\r\n digits = intval.toString(radix);\r\n rem = remDiv;\r\n if (rem.isZero())\r\n return digits + result;\r\n else {\r\n while (digits.length < 6)\r\n digits = '0' + digits;\r\n result = '' + digits + result;\r\n }\r\n }\r\n};\r\n\r\n/**\r\n * Gets the high 32 bits as a signed integer.\r\n * @returns {number} Signed high bits\r\n */\r\nLongPrototype.getHighBits = function getHighBits() {\r\n return this.high;\r\n};\r\n\r\n/**\r\n * Gets the high 32 bits as an unsigned integer.\r\n * @returns {number} Unsigned high bits\r\n */\r\nLongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() {\r\n return this.high >>> 0;\r\n};\r\n\r\n/**\r\n * Gets the low 32 bits as a signed integer.\r\n * @returns {number} Signed low bits\r\n */\r\nLongPrototype.getLowBits = function getLowBits() {\r\n return this.low;\r\n};\r\n\r\n/**\r\n * Gets the low 32 bits as an unsigned integer.\r\n * @returns {number} Unsigned low bits\r\n */\r\nLongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() {\r\n return this.low >>> 0;\r\n};\r\n\r\n/**\r\n * Gets the number of bits needed to represent the absolute value of this Long.\r\n * @returns {number}\r\n */\r\nLongPrototype.getNumBitsAbs = function getNumBitsAbs() {\r\n if (this.isNegative()) // Unsigned Longs are never negative\r\n return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs();\r\n var val = this.high != 0 ? this.high : this.low;\r\n for (var bit = 31; bit > 0; bit--)\r\n if ((val & (1 << bit)) != 0)\r\n break;\r\n return this.high != 0 ? bit + 33 : bit + 1;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value equals zero.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isZero = function isZero() {\r\n return this.high === 0 && this.low === 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value equals zero. This is an alias of {@link Long#isZero}.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.eqz = LongPrototype.isZero;\r\n\r\n/**\r\n * Tests if this Long's value is negative.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isNegative = function isNegative() {\r\n return !this.unsigned && this.high < 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is positive.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isPositive = function isPositive() {\r\n return this.unsigned || this.high >= 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is odd.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isOdd = function isOdd() {\r\n return (this.low & 1) === 1;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is even.\r\n * @returns {boolean}\r\n */\r\nLongPrototype.isEven = function isEven() {\r\n return (this.low & 1) === 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value equals the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.equals = function equals(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n if (this.unsigned !== other.unsigned && (this.high >>> 31) === 1 && (other.high >>> 31) === 1)\r\n return false;\r\n return this.high === other.high && this.low === other.low;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.eq = LongPrototype.equals;\r\n\r\n/**\r\n * Tests if this Long's value differs from the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.notEquals = function notEquals(other) {\r\n return !this.eq(/* validates */ other);\r\n};\r\n\r\n/**\r\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.neq = LongPrototype.notEquals;\r\n\r\n/**\r\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.ne = LongPrototype.notEquals;\r\n\r\n/**\r\n * Tests if this Long's value is less than the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.lessThan = function lessThan(other) {\r\n return this.comp(/* validates */ other) < 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.lt = LongPrototype.lessThan;\r\n\r\n/**\r\n * Tests if this Long's value is less than or equal the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.lessThanOrEqual = function lessThanOrEqual(other) {\r\n return this.comp(/* validates */ other) <= 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.lte = LongPrototype.lessThanOrEqual;\r\n\r\n/**\r\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.le = LongPrototype.lessThanOrEqual;\r\n\r\n/**\r\n * Tests if this Long's value is greater than the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.greaterThan = function greaterThan(other) {\r\n return this.comp(/* validates */ other) > 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.gt = LongPrototype.greaterThan;\r\n\r\n/**\r\n * Tests if this Long's value is greater than or equal the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) {\r\n return this.comp(/* validates */ other) >= 0;\r\n};\r\n\r\n/**\r\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.gte = LongPrototype.greaterThanOrEqual;\r\n\r\n/**\r\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\nLongPrototype.ge = LongPrototype.greaterThanOrEqual;\r\n\r\n/**\r\n * Compares this Long's value with the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\r\n * if the given one is greater\r\n */\r\nLongPrototype.compare = function compare(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n if (this.eq(other))\r\n return 0;\r\n var thisNeg = this.isNegative(),\r\n otherNeg = other.isNegative();\r\n if (thisNeg && !otherNeg)\r\n return -1;\r\n if (!thisNeg && otherNeg)\r\n return 1;\r\n // At this point the sign bits are the same\r\n if (!this.unsigned)\r\n return this.sub(other).isNegative() ? -1 : 1;\r\n // Both are positive if at least one is unsigned\r\n return (other.high >>> 0) > (this.high >>> 0) || (other.high === this.high && (other.low >>> 0) > (this.low >>> 0)) ? -1 : 1;\r\n};\r\n\r\n/**\r\n * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\r\n * if the given one is greater\r\n */\r\nLongPrototype.comp = LongPrototype.compare;\r\n\r\n/**\r\n * Negates this Long's value.\r\n * @returns {!Long} Negated Long\r\n */\r\nLongPrototype.negate = function negate() {\r\n if (!this.unsigned && this.eq(MIN_VALUE))\r\n return MIN_VALUE;\r\n return this.not().add(ONE);\r\n};\r\n\r\n/**\r\n * Negates this Long's value. This is an alias of {@link Long#negate}.\r\n * @function\r\n * @returns {!Long} Negated Long\r\n */\r\nLongPrototype.neg = LongPrototype.negate;\r\n\r\n/**\r\n * Returns the sum of this and the specified Long.\r\n * @param {!Long|number|string} addend Addend\r\n * @returns {!Long} Sum\r\n */\r\nLongPrototype.add = function add(addend) {\r\n if (!isLong(addend))\r\n addend = fromValue(addend);\r\n\r\n // Divide each number into 4 chunks of 16 bits, and then sum the chunks.\r\n\r\n var a48 = this.high >>> 16;\r\n var a32 = this.high & 0xFFFF;\r\n var a16 = this.low >>> 16;\r\n var a00 = this.low & 0xFFFF;\r\n\r\n var b48 = addend.high >>> 16;\r\n var b32 = addend.high & 0xFFFF;\r\n var b16 = addend.low >>> 16;\r\n var b00 = addend.low & 0xFFFF;\r\n\r\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\r\n c00 += a00 + b00;\r\n c16 += c00 >>> 16;\r\n c00 &= 0xFFFF;\r\n c16 += a16 + b16;\r\n c32 += c16 >>> 16;\r\n c16 &= 0xFFFF;\r\n c32 += a32 + b32;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c48 += a48 + b48;\r\n c48 &= 0xFFFF;\r\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the difference of this and the specified Long.\r\n * @param {!Long|number|string} subtrahend Subtrahend\r\n * @returns {!Long} Difference\r\n */\r\nLongPrototype.subtract = function subtract(subtrahend) {\r\n if (!isLong(subtrahend))\r\n subtrahend = fromValue(subtrahend);\r\n return this.add(subtrahend.neg());\r\n};\r\n\r\n/**\r\n * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}.\r\n * @function\r\n * @param {!Long|number|string} subtrahend Subtrahend\r\n * @returns {!Long} Difference\r\n */\r\nLongPrototype.sub = LongPrototype.subtract;\r\n\r\n/**\r\n * Returns the product of this and the specified Long.\r\n * @param {!Long|number|string} multiplier Multiplier\r\n * @returns {!Long} Product\r\n */\r\nLongPrototype.multiply = function multiply(multiplier) {\r\n if (this.isZero())\r\n return ZERO;\r\n if (!isLong(multiplier))\r\n multiplier = fromValue(multiplier);\r\n\r\n // use wasm support if present\r\n if (wasm) {\r\n var low = wasm.mul(this.low,\r\n this.high,\r\n multiplier.low,\r\n multiplier.high);\r\n return fromBits(low, wasm.get_high(), this.unsigned);\r\n }\r\n\r\n if (multiplier.isZero())\r\n return ZERO;\r\n if (this.eq(MIN_VALUE))\r\n return multiplier.isOdd() ? MIN_VALUE : ZERO;\r\n if (multiplier.eq(MIN_VALUE))\r\n return this.isOdd() ? MIN_VALUE : ZERO;\r\n\r\n if (this.isNegative()) {\r\n if (multiplier.isNegative())\r\n return this.neg().mul(multiplier.neg());\r\n else\r\n return this.neg().mul(multiplier).neg();\r\n } else if (multiplier.isNegative())\r\n return this.mul(multiplier.neg()).neg();\r\n\r\n // If both longs are small, use float multiplication\r\n if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24))\r\n return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned);\r\n\r\n // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products.\r\n // We can skip products that would overflow.\r\n\r\n var a48 = this.high >>> 16;\r\n var a32 = this.high & 0xFFFF;\r\n var a16 = this.low >>> 16;\r\n var a00 = this.low & 0xFFFF;\r\n\r\n var b48 = multiplier.high >>> 16;\r\n var b32 = multiplier.high & 0xFFFF;\r\n var b16 = multiplier.low >>> 16;\r\n var b00 = multiplier.low & 0xFFFF;\r\n\r\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\r\n c00 += a00 * b00;\r\n c16 += c00 >>> 16;\r\n c00 &= 0xFFFF;\r\n c16 += a16 * b00;\r\n c32 += c16 >>> 16;\r\n c16 &= 0xFFFF;\r\n c16 += a00 * b16;\r\n c32 += c16 >>> 16;\r\n c16 &= 0xFFFF;\r\n c32 += a32 * b00;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c32 += a16 * b16;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c32 += a00 * b32;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;\r\n c48 &= 0xFFFF;\r\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}.\r\n * @function\r\n * @param {!Long|number|string} multiplier Multiplier\r\n * @returns {!Long} Product\r\n */\r\nLongPrototype.mul = LongPrototype.multiply;\r\n\r\n/**\r\n * Returns this Long divided by the specified. The result is signed if this Long is signed or\r\n * unsigned if this Long is unsigned.\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Quotient\r\n */\r\nLongPrototype.divide = function divide(divisor) {\r\n if (!isLong(divisor))\r\n divisor = fromValue(divisor);\r\n if (divisor.isZero())\r\n throw Error('division by zero');\r\n\r\n // use wasm support if present\r\n if (wasm) {\r\n // guard against signed division overflow: the largest\r\n // negative number / -1 would be 1 larger than the largest\r\n // positive number, due to two's complement.\r\n if (!this.unsigned &&\r\n this.high === -0x80000000 &&\r\n divisor.low === -1 && divisor.high === -1) {\r\n // be consistent with non-wasm code path\r\n return this;\r\n }\r\n var low = (this.unsigned ? wasm.div_u : wasm.div_s)(\r\n this.low,\r\n this.high,\r\n divisor.low,\r\n divisor.high\r\n );\r\n return fromBits(low, wasm.get_high(), this.unsigned);\r\n }\r\n\r\n if (this.isZero())\r\n return this.unsigned ? UZERO : ZERO;\r\n var approx, rem, res;\r\n if (!this.unsigned) {\r\n // This section is only relevant for signed longs and is derived from the\r\n // closure library as a whole.\r\n if (this.eq(MIN_VALUE)) {\r\n if (divisor.eq(ONE) || divisor.eq(NEG_ONE))\r\n return MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE\r\n else if (divisor.eq(MIN_VALUE))\r\n return ONE;\r\n else {\r\n // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.\r\n var halfThis = this.shr(1);\r\n approx = halfThis.div(divisor).shl(1);\r\n if (approx.eq(ZERO)) {\r\n return divisor.isNegative() ? ONE : NEG_ONE;\r\n } else {\r\n rem = this.sub(divisor.mul(approx));\r\n res = approx.add(rem.div(divisor));\r\n return res;\r\n }\r\n }\r\n } else if (divisor.eq(MIN_VALUE))\r\n return this.unsigned ? UZERO : ZERO;\r\n if (this.isNegative()) {\r\n if (divisor.isNegative())\r\n return this.neg().div(divisor.neg());\r\n return this.neg().div(divisor).neg();\r\n } else if (divisor.isNegative())\r\n return this.div(divisor.neg()).neg();\r\n res = ZERO;\r\n } else {\r\n // The algorithm below has not been made for unsigned longs. It's therefore\r\n // required to take special care of the MSB prior to running it.\r\n if (!divisor.unsigned)\r\n divisor = divisor.toUnsigned();\r\n if (divisor.gt(this))\r\n return UZERO;\r\n if (divisor.gt(this.shru(1))) // 15 >>> 1 = 7 ; with divisor = 8 ; true\r\n return UONE;\r\n res = UZERO;\r\n }\r\n\r\n // Repeat the following until the remainder is less than other: find a\r\n // floating-point that approximates remainder / other *from below*, add this\r\n // into the result, and subtract it from the remainder. It is critical that\r\n // the approximate value is less than or equal to the real value so that the\r\n // remainder never becomes negative.\r\n rem = this;\r\n while (rem.gte(divisor)) {\r\n // Approximate the result of division. This may be a little greater or\r\n // smaller than the actual value.\r\n approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber()));\r\n\r\n // We will tweak the approximate result by changing it in the 48-th digit or\r\n // the smallest non-fractional digit, whichever is larger.\r\n var log2 = Math.ceil(Math.log(approx) / Math.LN2),\r\n delta = (log2 <= 48) ? 1 : pow_dbl(2, log2 - 48),\r\n\r\n // Decrease the approximation until it is smaller than the remainder. Note\r\n // that if it is too large, the product overflows and is negative.\r\n approxRes = fromNumber(approx),\r\n approxRem = approxRes.mul(divisor);\r\n while (approxRem.isNegative() || approxRem.gt(rem)) {\r\n approx -= delta;\r\n approxRes = fromNumber(approx, this.unsigned);\r\n approxRem = approxRes.mul(divisor);\r\n }\r\n\r\n // We know the answer can't be zero... and actually, zero would cause\r\n // infinite recursion since we would make no progress.\r\n if (approxRes.isZero())\r\n approxRes = ONE;\r\n\r\n res = res.add(approxRes);\r\n rem = rem.sub(approxRem);\r\n }\r\n return res;\r\n};\r\n\r\n/**\r\n * Returns this Long divided by the specified. This is an alias of {@link Long#divide}.\r\n * @function\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Quotient\r\n */\r\nLongPrototype.div = LongPrototype.divide;\r\n\r\n/**\r\n * Returns this Long modulo the specified.\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Remainder\r\n */\r\nLongPrototype.modulo = function modulo(divisor) {\r\n if (!isLong(divisor))\r\n divisor = fromValue(divisor);\r\n\r\n // use wasm support if present\r\n if (wasm) {\r\n var low = (this.unsigned ? wasm.rem_u : wasm.rem_s)(\r\n this.low,\r\n this.high,\r\n divisor.low,\r\n divisor.high\r\n );\r\n return fromBits(low, wasm.get_high(), this.unsigned);\r\n }\r\n\r\n return this.sub(this.div(divisor).mul(divisor));\r\n};\r\n\r\n/**\r\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\r\n * @function\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Remainder\r\n */\r\nLongPrototype.mod = LongPrototype.modulo;\r\n\r\n/**\r\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\r\n * @function\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Remainder\r\n */\r\nLongPrototype.rem = LongPrototype.modulo;\r\n\r\n/**\r\n * Returns the bitwise NOT of this Long.\r\n * @returns {!Long}\r\n */\r\nLongPrototype.not = function not() {\r\n return fromBits(~this.low, ~this.high, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the bitwise AND of this Long and the specified.\r\n * @param {!Long|number|string} other Other Long\r\n * @returns {!Long}\r\n */\r\nLongPrototype.and = function and(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n return fromBits(this.low & other.low, this.high & other.high, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the bitwise OR of this Long and the specified.\r\n * @param {!Long|number|string} other Other Long\r\n * @returns {!Long}\r\n */\r\nLongPrototype.or = function or(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n return fromBits(this.low | other.low, this.high | other.high, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns the bitwise XOR of this Long and the given one.\r\n * @param {!Long|number|string} other Other Long\r\n * @returns {!Long}\r\n */\r\nLongPrototype.xor = function xor(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns this Long with bits shifted to the left by the given amount.\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shiftLeft = function shiftLeft(numBits) {\r\n if (isLong(numBits))\r\n numBits = numBits.toInt();\r\n if ((numBits &= 63) === 0)\r\n return this;\r\n else if (numBits < 32)\r\n return fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned);\r\n else\r\n return fromBits(0, this.low << (numBits - 32), this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shl = LongPrototype.shiftLeft;\r\n\r\n/**\r\n * Returns this Long with bits arithmetically shifted to the right by the given amount.\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shiftRight = function shiftRight(numBits) {\r\n if (isLong(numBits))\r\n numBits = numBits.toInt();\r\n if ((numBits &= 63) === 0)\r\n return this;\r\n else if (numBits < 32)\r\n return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned);\r\n else\r\n return fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned);\r\n};\r\n\r\n/**\r\n * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shr = LongPrototype.shiftRight;\r\n\r\n/**\r\n * Returns this Long with bits logically shifted to the right by the given amount.\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) {\r\n if (isLong(numBits))\r\n numBits = numBits.toInt();\r\n numBits &= 63;\r\n if (numBits === 0)\r\n return this;\r\n else {\r\n var high = this.high;\r\n if (numBits < 32) {\r\n var low = this.low;\r\n return fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned);\r\n } else if (numBits === 32)\r\n return fromBits(high, 0, this.unsigned);\r\n else\r\n return fromBits(high >>> (numBits - 32), 0, this.unsigned);\r\n }\r\n};\r\n\r\n/**\r\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shru = LongPrototype.shiftRightUnsigned;\r\n\r\n/**\r\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\nLongPrototype.shr_u = LongPrototype.shiftRightUnsigned;\r\n\r\n/**\r\n * Converts this Long to signed.\r\n * @returns {!Long} Signed long\r\n */\r\nLongPrototype.toSigned = function toSigned() {\r\n if (!this.unsigned)\r\n return this;\r\n return fromBits(this.low, this.high, false);\r\n};\r\n\r\n/**\r\n * Converts this Long to unsigned.\r\n * @returns {!Long} Unsigned long\r\n */\r\nLongPrototype.toUnsigned = function toUnsigned() {\r\n if (this.unsigned)\r\n return this;\r\n return fromBits(this.low, this.high, true);\r\n};\r\n\r\n/**\r\n * Converts this Long to its byte representation.\r\n * @param {boolean=} le Whether little or big endian, defaults to big endian\r\n * @returns {!Array.} Byte representation\r\n */\r\nLongPrototype.toBytes = function toBytes(le) {\r\n return le ? this.toBytesLE() : this.toBytesBE();\r\n};\r\n\r\n/**\r\n * Converts this Long to its little endian byte representation.\r\n * @returns {!Array.} Little endian byte representation\r\n */\r\nLongPrototype.toBytesLE = function toBytesLE() {\r\n var hi = this.high,\r\n lo = this.low;\r\n return [\r\n lo & 0xff,\r\n lo >>> 8 & 0xff,\r\n lo >>> 16 & 0xff,\r\n lo >>> 24 ,\r\n hi & 0xff,\r\n hi >>> 8 & 0xff,\r\n hi >>> 16 & 0xff,\r\n hi >>> 24\r\n ];\r\n};\r\n\r\n/**\r\n * Converts this Long to its big endian byte representation.\r\n * @returns {!Array.} Big endian byte representation\r\n */\r\nLongPrototype.toBytesBE = function toBytesBE() {\r\n var hi = this.high,\r\n lo = this.low;\r\n return [\r\n hi >>> 24 ,\r\n hi >>> 16 & 0xff,\r\n hi >>> 8 & 0xff,\r\n hi & 0xff,\r\n lo >>> 24 ,\r\n lo >>> 16 & 0xff,\r\n lo >>> 8 & 0xff,\r\n lo & 0xff\r\n ];\r\n};\r\n\r\n/**\r\n * Creates a Long from its byte representation.\r\n * @param {!Array.} bytes Byte representation\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @param {boolean=} le Whether little or big endian, defaults to big endian\r\n * @returns {Long} The corresponding Long value\r\n */\r\nLong.fromBytes = function fromBytes(bytes, unsigned, le) {\r\n return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned);\r\n};\r\n\r\n/**\r\n * Creates a Long from its little endian byte representation.\r\n * @param {!Array.} bytes Little endian byte representation\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {Long} The corresponding Long value\r\n */\r\nLong.fromBytesLE = function fromBytesLE(bytes, unsigned) {\r\n return new Long(\r\n bytes[0] |\r\n bytes[1] << 8 |\r\n bytes[2] << 16 |\r\n bytes[3] << 24,\r\n bytes[4] |\r\n bytes[5] << 8 |\r\n bytes[6] << 16 |\r\n bytes[7] << 24,\r\n unsigned\r\n );\r\n};\r\n\r\n/**\r\n * Creates a Long from its big endian byte representation.\r\n * @param {!Array.} bytes Big endian byte representation\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\r\n * @returns {Long} The corresponding Long value\r\n */\r\nLong.fromBytesBE = function fromBytesBE(bytes, unsigned) {\r\n return new Long(\r\n bytes[4] << 24 |\r\n bytes[5] << 16 |\r\n bytes[6] << 8 |\r\n bytes[7],\r\n bytes[0] << 24 |\r\n bytes[1] << 16 |\r\n bytes[2] << 8 |\r\n bytes[3],\r\n unsigned\r\n );\r\n};\r\n","// This file is shared with the compiler and must remain portable\r\n\r\n/** Indicates specific features to activate. */\r\nexport const enum Feature {\r\n /** No additional features. */\r\n NONE = 0,\r\n /** Sign extension operations. */\r\n SIGN_EXTENSION = 1 << 0, // see: https://github.com/WebAssembly/sign-extension-ops\r\n /** Mutable global imports and exports. */\r\n MUTABLE_GLOBAL = 1 << 1, // see: https://github.com/WebAssembly/mutable-global\r\n /** Bulk memory operations. */\r\n BULK_MEMORY = 1 << 2, // see: https://github.com/WebAssembly/bulk-memory-operations\r\n /** SIMD types and operations. */\r\n SIMD = 1 << 3, // see: https://github.com/WebAssembly/simd\r\n /** Threading and atomic operations. */\r\n THREADS = 1 << 4 // see: https://github.com/WebAssembly/threads\r\n}\r\n","// This file is shared with the compiler and must remain portable\r\n\r\n/** Compilation target. */\r\nexport enum Target {\r\n /** WebAssembly with 32-bit pointers. */\r\n WASM32,\r\n /** WebAssembly with 64-bit pointers. Experimental and not supported by any runtime yet. */\r\n WASM64,\r\n /** Portable. */\r\n JS\r\n}\r\n","// This file is shared with the compiler and must remain portable\r\n\r\n// ╒═══════════════════ Typeinfo interpretation ═══════════════════╕\r\n// 3 2 1\r\n// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits\r\n// ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┤ ◄─ __rtti_base\r\n// │ count │\r\n// ╞═══════════════════════════════════════════════════════════════╡ ┐\r\n// │ Typeinfo#flags [id=0] │ id < count\r\n// ├ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┤\r\n// │ Typeinfo#base [id=0] │\r\n// ├───────────────────────────────────────────────────────────────┤\r\n// │ ... │\r\n\r\n/** Runtime type information data structure. */\r\n@unmanaged\r\nexport class Typeinfo {\r\n /** Flags describing the shape of this class type. */\r\n flags: TypeinfoFlags;\r\n /** Base class id or `0` if none. */\r\n base: u32;\r\n}\r\n\r\n/** Runtime type information flags. */\r\nexport const enum TypeinfoFlags {\r\n /** No specific flags. */\r\n NONE = 0,\r\n /** Type is an `ArrayBufferView`. */\r\n ARRAYBUFFERVIEW = 1 << 0,\r\n /** Type is an `Array`. */\r\n ARRAY = 1 << 1,\r\n /** Type is a `Set`. */\r\n SET = 1 << 2,\r\n /** Type is a `Map`. */\r\n MAP = 1 << 3,\r\n /** Type is inherently acyclic. */\r\n ACYCLIC = 1 << 4,\r\n /** Value alignment of 1 byte. */\r\n VALUE_ALIGN_0 = 1 << 5,\r\n /** Value alignment of 2 bytes. */\r\n VALUE_ALIGN_1 = 1 << 6,\r\n /** Value alignment of 4 bytes. */\r\n VALUE_ALIGN_2 = 1 << 7,\r\n /** Value alignment of 8 bytes. */\r\n VALUE_ALIGN_3 = 1 << 8,\r\n /** Value alignment of 16 bytes. */\r\n VALUE_ALIGN_4 = 1 << 9,\r\n /** Value is a signed type. */\r\n VALUE_SIGNED = 1 << 10,\r\n /** Value is a float type. */\r\n VALUE_FLOAT = 1 << 11,\r\n /** Value type is nullable. */\r\n VALUE_NULLABLE = 1 << 12,\r\n /** Value type is managed. */\r\n VALUE_MANAGED = 1 << 13,\r\n /** Key alignment of 1 byte. */\r\n KEY_ALIGN_0 = 1 << 14,\r\n /** Key alignment of 2 bytes. */\r\n KEY_ALIGN_1 = 1 << 15,\r\n /** Key alignment of 4 bytes. */\r\n KEY_ALIGN_2 = 1 << 16,\r\n /** Key alignment of 8 bytes. */\r\n KEY_ALIGN_3 = 1 << 17,\r\n /** Key alignment of 16 bytes. */\r\n KEY_ALIGN_4 = 1 << 18,\r\n /** Value is a signed type. */\r\n KEY_SIGNED = 1 << 19,\r\n /** Value is a float type. */\r\n KEY_FLOAT = 1 << 20,\r\n /** Key type is nullable. */\r\n KEY_NULLABLE = 1 << 21,\r\n /** Key type is managed. */\r\n KEY_MANAGED = 1 << 22\r\n}\r\n","/**\r\n * Low-level C-like compiler API.\r\n * @module index\r\n *//***/\r\n\r\nimport { Target, Feature } from \"./common\";\r\nimport { Compiler, Options } from \"./compiler\";\r\nimport { Decompiler } from \"./decompiler\";\r\nimport { IDLBuilder, TSDBuilder } from \"./definitions\";\r\nimport { DiagnosticMessage, DiagnosticCategory, formatDiagnosticMessage } from \"./diagnostics\";\r\nimport { Module } from \"./module\";\r\nimport { Parser } from \"./parser\";\r\nimport { Program } from \"./program\";\r\n\r\n/** Parses a source file. If `parser` has been omitted a new one is created. */\r\nexport function parseFile(text: string, path: string, isEntry: bool = false,\r\n parser: Parser | null = null\r\n): Parser {\r\n if (!parser) parser = new Parser();\r\n parser.parseFile(text, path, isEntry);\r\n return parser;\r\n}\r\n\r\n/** Obtains the next required file's path. Returns `null` once complete. */\r\nexport function nextFile(parser: Parser): string | null {\r\n return parser.nextFile();\r\n}\r\n\r\n/** Obtains the next diagnostic message. Returns `null` once complete. */\r\nexport function nextDiagnostic(parser: Parser): DiagnosticMessage | null {\r\n var program = parser.program;\r\n return program.diagnosticsOffset < program.diagnostics.length\r\n ? program.diagnostics[program.diagnosticsOffset++]\r\n : null;\r\n}\r\n\r\n/** Formats a diagnostic message to a string. */\r\nexport { formatDiagnosticMessage as formatDiagnostic };\r\n\r\n/** Tests whether a diagnostic is informatory. */\r\nexport function isInfo(message: DiagnosticMessage): bool {\r\n return message.category == DiagnosticCategory.INFO;\r\n}\r\n\r\n/** Tests whether a diagnostic is a warning. */\r\nexport function isWarning(message: DiagnosticMessage): bool {\r\n return message.category == DiagnosticCategory.WARNING;\r\n}\r\n\r\n/** Tests whether a diagnostic is an error. */\r\nexport function isError(message: DiagnosticMessage): bool {\r\n return message.category == DiagnosticCategory.ERROR;\r\n}\r\n\r\n/** Creates a new set of compiler options. */\r\nexport function createOptions(): Options {\r\n return new Options();\r\n}\r\n\r\n/** Sets the `target` option. */\r\nexport function setTarget(options: Options, target: Target): void {\r\n options.target = target;\r\n}\r\n\r\n/** Sets the `noAssert` option. */\r\nexport function setNoAssert(options: Options, noAssert: bool): void {\r\n options.noAssert = noAssert;\r\n}\r\n\r\n/** Sets the `importMemory` option. */\r\nexport function setImportMemory(options: Options, importMemory: bool): void {\r\n options.importMemory = importMemory;\r\n}\r\n\r\n/** Sets the `sharedMemory` option. */\r\nexport function setSharedMemory(options: Options, sharedMemory: i32): void {\r\n options.sharedMemory = sharedMemory;\r\n}\r\n\r\n/** Sets the `importTable` option. */\r\nexport function setImportTable(options: Options, importTable: bool): void {\r\n options.importTable = importTable;\r\n}\r\n\r\n/** Sets the `sourceMap` option. */\r\nexport function setSourceMap(options: Options, sourceMap: bool): void {\r\n options.sourceMap = sourceMap;\r\n}\r\n\r\n/** Sets the `memoryBase` option. */\r\nexport function setMemoryBase(options: Options, memoryBase: u32): void {\r\n options.memoryBase = memoryBase;\r\n}\r\n\r\n/** Sets a 'globalAliases' value. */\r\nexport function setGlobalAlias(options: Options, name: string, alias: string): void {\r\n var globalAliases = options.globalAliases;\r\n if (!globalAliases) options.globalAliases = globalAliases = new Map();\r\n globalAliases.set(name, alias);\r\n}\r\n\r\n/** Sets the `explicitStart` option. */\r\nexport function setExplicitStart(options: Options, explicitStart: bool): void {\r\n options.explicitStart = explicitStart;\r\n}\r\n\r\n/** Sign extension operations. */\r\nexport const FEATURE_SIGN_EXTENSION = Feature.SIGN_EXTENSION;\r\n/** Mutable global imports and exports. */\r\nexport const FEATURE_MUTABLE_GLOBAL = Feature.MUTABLE_GLOBAL;\r\n/** Bulk memory operations. */\r\nexport const FEATURE_BULK_MEMORY = Feature.BULK_MEMORY;\r\n/** SIMD types and operations. */\r\nexport const FEATURE_SIMD = Feature.SIMD;\r\n/** Threading and atomic operations. */\r\nexport const FEATURE_THREADS = Feature.THREADS;\r\n\r\n/** Enables a specific feature. */\r\nexport function enableFeature(options: Options, feature: Feature): void {\r\n options.features |= feature;\r\n}\r\n\r\n/** Gives the compiler a hint at the optimize levels that will be used later on. */\r\nexport function setOptimizeLevelHints(options: Options, optimizeLevel: i32, shrinkLevel: i32): void {\r\n options.optimizeLevelHint = optimizeLevel;\r\n options.shrinkLevelHint = shrinkLevel;\r\n}\r\n\r\n/** Finishes parsing. */\r\nexport function finishParsing(parser: Parser): Program {\r\n return parser.finish();\r\n}\r\n\r\n/** Compiles the sources computed by the parser to a module. */\r\nexport function compileProgram(program: Program, options: Options | null = null): Module {\r\n return new Compiler(program, options).compile();\r\n}\r\n\r\n/** Decompiles a module to its (low level) source. */\r\nexport function decompileModule(module: Module): string {\r\n var decompiler = new Decompiler();\r\n decompiler.decompile(module);\r\n return decompiler.finish();\r\n}\r\n\r\n/** Builds WebIDL definitions for the specified program. */\r\nexport function buildIDL(program: Program): string {\r\n return IDLBuilder.build(program);\r\n}\r\n\r\n/** Builds TypeScript definitions for the specified program. */\r\nexport function buildTSD(program: Program): string {\r\n return TSDBuilder.build(program);\r\n}\r\n\r\n/** Builds a JSON file of a program's runtime type information. */\r\nexport function buildRTTI(program: Program): string {\r\n var sb = new Array();\r\n sb.push(\"{\\n \\\"names\\\": [\\n\");\r\n for (let cls of program.managedClasses.values()) {\r\n sb.push(\" \\\"\");\r\n sb.push(cls.internalName);\r\n sb.push(\"\\\",\\n\");\r\n }\r\n sb.push(\" ],\\n \\\"base\\\": [\\n\");\r\n for (let cls of program.managedClasses.values()) {\r\n let base = cls.base;\r\n sb.push(\" \");\r\n sb.push(base ? base.id.toString() : \"0\");\r\n sb.push(\",\\n\");\r\n }\r\n sb.push(\" ],\\n \\\"flags\\\": [\\n\");\r\n for (let cls of program.managedClasses.values()) {\r\n sb.push(\" \");\r\n sb.push(cls.rttiFlags.toString());\r\n sb.push(\",\\n\");\r\n }\r\n sb.push(\" ]\\n}\\n\");\r\n return sb.join(\"\");\r\n}\r\n\r\n/** Prefix indicating a library file. */\r\nexport { LIBRARY_PREFIX } from \"./common\";\r\n\r\n// Full API\r\nexport * from \"./ast\";\r\n// export * from \"./binary\";\r\nexport * from \"./common\";\r\nexport * from \"./compiler\";\r\nexport * from \"./decompiler\";\r\nexport * from \"./definitions\";\r\nexport * from \"./diagnosticMessages.generated\";\r\nexport * from \"./diagnostics\";\r\nexport * from \"./flow\";\r\nexport * from \"./module\";\r\nexport * from \"./parser\";\r\nexport * from \"./program\";\r\nexport * from \"./resolver\";\r\nexport * from \"./tokenizer\";\r\nexport * from \"./types\";\r\nexport * from \"./util\";\r\n","/** @module util *//***/\r\n\r\n/** Tests if the bit at the specified index is set within a 64-bit map. */\r\nexport function bitsetIs(map: I64, index: i32): bool {\r\n assert(index >= 0 && index < 64);\r\n return i64_ne(\r\n i64_and(\r\n map,\r\n i64_shl(\r\n i64_one,\r\n i64_new(index)\r\n )\r\n ),\r\n i64_zero\r\n );\r\n}\r\n\r\n/** Sets or unsets the bit at the specified index within a 64-bit map and returns the new map. */\r\nexport function bitsetSet(map: I64, index: i32, isSet: bool): I64 {\r\n assert(index >= 0 && index < 64);\r\n return isSet\r\n ? i64_or(\r\n map,\r\n i64_shl(\r\n i64_one,\r\n i64_new(index)\r\n )\r\n )\r\n : i64_and(\r\n map,\r\n i64_not(\r\n i64_shl(\r\n i64_one,\r\n i64_new(index)\r\n )\r\n )\r\n );\r\n}\r\n","/** @module util *//***/\r\n\r\n/** An enum of named character codes. */\r\nexport const enum CharCode {\r\n\r\n NULL = 0,\r\n LINEFEED = 0x0A,\r\n CARRIAGERETURN = 0x0D,\r\n LINESEPARATOR = 0x2028,\r\n PARAGRAPHSEPARATOR = 0x2029,\r\n NEXTLINE = 0x0085,\r\n\r\n SPACE = 0x20,\r\n NONBREAKINGSPACE = 0xA0,\r\n ENQUAD = 0x2000,\r\n EMQUAD = 0x2001,\r\n ENSPACE = 0x2002,\r\n EMSPACE = 0x2003,\r\n THREEPEREMSPACE = 0x2004,\r\n FOURPEREMSPACE = 0x2005,\r\n SIXPEREMSPACE = 0x2006,\r\n FIGURESPACE = 0x2007,\r\n PUNCTUATIONSPACE = 0x2008,\r\n THINSPACE = 0x2009,\r\n HAIRSPACE = 0x200A,\r\n ZEROWIDTHSPACE = 0x200B,\r\n NARROWNOBREAKSPACE = 0x202F,\r\n IDEOGRAPHICSPACE = 0x3000,\r\n MATHEMATICALSPACE = 0x205F,\r\n OGHAM = 0x1680,\r\n\r\n _ = 0x5F,\r\n\r\n _0 = 0x30,\r\n _1 = 0x31,\r\n _2 = 0x32,\r\n _3 = 0x33,\r\n _4 = 0x34,\r\n _5 = 0x35,\r\n _6 = 0x36,\r\n _7 = 0x37,\r\n _8 = 0x38,\r\n _9 = 0x39,\r\n\r\n a = 0x61,\r\n b = 0x62,\r\n c = 0x63,\r\n d = 0x64,\r\n e = 0x65,\r\n f = 0x66,\r\n g = 0x67,\r\n h = 0x68,\r\n i = 0x69,\r\n j = 0x6A,\r\n k = 0x6B,\r\n l = 0x6C,\r\n m = 0x6D,\r\n n = 0x6E,\r\n o = 0x6F,\r\n p = 0x70,\r\n q = 0x71,\r\n r = 0x72,\r\n s = 0x73,\r\n t = 0x74,\r\n u = 0x75,\r\n v = 0x76,\r\n w = 0x77,\r\n x = 0x78,\r\n y = 0x79,\r\n z = 0x7A,\r\n\r\n A = 0x41,\r\n B = 0x42,\r\n C = 0x43,\r\n D = 0x44,\r\n E = 0x45,\r\n F = 0x46,\r\n G = 0x47,\r\n H = 0x48,\r\n I = 0x49,\r\n J = 0x4A,\r\n K = 0x4B,\r\n L = 0x4C,\r\n M = 0x4D,\r\n N = 0x4E,\r\n O = 0x4F,\r\n P = 0x50,\r\n Q = 0x51,\r\n R = 0x52,\r\n S = 0x53,\r\n T = 0x54,\r\n U = 0x55,\r\n V = 0x56,\r\n W = 0x57,\r\n X = 0x58,\r\n Y = 0x59,\r\n Z = 0x5a,\r\n\r\n AMPERSAND = 0x26,\r\n ASTERISK = 0x2A,\r\n AT = 0x40,\r\n BACKSLASH = 0x5C,\r\n BACKTICK = 0x60,\r\n BAR = 0x7C,\r\n CARET = 0x5E,\r\n CLOSEBRACE = 0x7D,\r\n CLOSEBRACKET = 0x5D,\r\n CLOSEPAREN = 0x29,\r\n COLON = 0x3A,\r\n COMMA = 0x2C,\r\n DOLLAR = 0x24,\r\n DOT = 0x2E,\r\n DOUBLEQUOTE = 0x22,\r\n EQUALS = 0x3D,\r\n EXCLAMATION = 0x21,\r\n GREATERTHAN = 0x3E,\r\n HASH = 0x23,\r\n LESSTHAN = 0x3C,\r\n MINUS = 0x2D,\r\n OPENBRACE = 0x7B,\r\n OPENBRACKET = 0x5B,\r\n OPENPAREN = 0x28,\r\n PERCENT = 0x25,\r\n PLUS = 0x2B,\r\n QUESTION = 0x3F,\r\n SEMICOLON = 0x3B,\r\n SINGLEQUOTE = 0x27,\r\n SLASH = 0x2F,\r\n TILDE = 0x7E,\r\n\r\n BACKSPACE = 0x08,\r\n FORMFEED = 0x0C,\r\n BYTEORDERMARK = 0xFEFF,\r\n TAB = 0x09,\r\n VERTICALTAB = 0x0B\r\n}\r\n\r\n/** Tests if the specified character code is some sort of line break. */\r\nexport function isLineBreak(c: CharCode): bool {\r\n switch (c) {\r\n case CharCode.LINEFEED:\r\n case CharCode.CARRIAGERETURN:\r\n case CharCode.LINESEPARATOR:\r\n case CharCode.PARAGRAPHSEPARATOR: {\r\n return true;\r\n }\r\n default: {\r\n return false;\r\n }\r\n }\r\n}\r\n\r\n/** Tests if the specified character code is some sort of white space. */\r\nexport function isWhiteSpace(c: i32): bool {\r\n switch (c) {\r\n case CharCode.SPACE:\r\n case CharCode.TAB:\r\n case CharCode.VERTICALTAB:\r\n case CharCode.FORMFEED:\r\n case CharCode.NONBREAKINGSPACE:\r\n case CharCode.NEXTLINE:\r\n case CharCode.OGHAM:\r\n case CharCode.NARROWNOBREAKSPACE:\r\n case CharCode.MATHEMATICALSPACE:\r\n case CharCode.IDEOGRAPHICSPACE:\r\n case CharCode.BYTEORDERMARK: {\r\n return true;\r\n }\r\n default: {\r\n return c >= CharCode.ENQUAD && c <= CharCode.ZEROWIDTHSPACE;\r\n }\r\n }\r\n}\r\n\r\n/** Tests if the specified character code is a valid decimal digit. */\r\nexport function isDecimalDigit(c: i32): bool {\r\n return c >= CharCode._0 && c <= CharCode._9;\r\n}\r\n\r\n/** Tests if the specified character code is a valid octal digit. */\r\nexport function isOctalDigit(c: i32): bool {\r\n return c >= CharCode._0 && c <= CharCode._7;\r\n}\r\n\r\n/** Tests if the specified character code is a valid start of an identifier. */\r\nexport function isIdentifierStart(c: i32): bool {\r\n return c >= CharCode.a && c <= CharCode.z\r\n || c >= CharCode.A && c <= CharCode.Z\r\n || c == CharCode._\r\n || c == CharCode.DOLLAR\r\n || c > 0x7f && isUnicodeIdentifierStart(c);\r\n}\r\n\r\n/** Tests if the specified character code is a valid keyword character. */\r\nexport function isKeywordCharacter(c: i32): bool {\r\n return c >= CharCode.a && c <= CharCode.z;\r\n}\r\n\r\n/** Tests if the specified character code is a valid part of an identifier. */\r\nexport function isIdentifierPart(c: i32): bool {\r\n return c >= CharCode.a && c <= CharCode.z\r\n || c >= CharCode.A && c <= CharCode.Z\r\n || c >= CharCode._0 && c <= CharCode._9\r\n || c == CharCode._\r\n || c == CharCode.DOLLAR\r\n || c > 0x7f && isUnicodeIdentifierPart(c);\r\n}\r\n\r\n// storing as u16 to save memory\r\nconst unicodeIdentifierStart: u16[] = [\r\n 170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736,\r\n 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906,\r\n 908, 908, 910, 929, 931,\r\n 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514,\r\n 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774,\r\n 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969,\r\n 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088,\r\n 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384,\r\n 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474,\r\n 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529,\r\n 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613,\r\n 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705,\r\n 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784,\r\n 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873,\r\n 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958,\r\n 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986,\r\n 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125,\r\n 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240,\r\n 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333,\r\n 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455,\r\n 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634,\r\n 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725,\r\n 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757,\r\n 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840,\r\n 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186,\r\n 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293,\r\n 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696,\r\n 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798,\r\n 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992,\r\n 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872,\r\n 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016,\r\n 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389,\r\n 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688,\r\n 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141,\r\n 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424,\r\n 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025,\r\n 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130,\r\n 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188,\r\n 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469,\r\n 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505,\r\n 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584,\r\n 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520,\r\n 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670,\r\n 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720,\r\n 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329,\r\n 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540,\r\n 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893,\r\n 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538,\r\n 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888,\r\n 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013, 43015,\r\n 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259,\r\n 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520,\r\n 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695,\r\n 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739,\r\n 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798,\r\n 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243,\r\n 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285,\r\n 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323,\r\n 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019,\r\n 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474,\r\n 65479, 65482, 65487, 65490, 65495, 65498, 65500,\r\n];\r\nconst unicodeIdentifierPart: u16[] = [\r\n 170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736,\r\n 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906,\r\n 908, 908, 910, 929, 931,\r\n 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415,\r\n 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520,\r\n 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788,\r\n 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112,\r\n 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423,\r\n 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482,\r\n 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525,\r\n 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602,\r\n 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632,\r\n 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693,\r\n 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757,\r\n 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821,\r\n 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884,\r\n 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929,\r\n 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972,\r\n 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018,\r\n 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088,\r\n 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157,\r\n 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216,\r\n 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285,\r\n 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340,\r\n 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424,\r\n 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515,\r\n 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570,\r\n 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720,\r\n 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751,\r\n 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789,\r\n 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895,\r\n 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028,\r\n 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304,\r\n 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744,\r\n 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808,\r\n 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108,\r\n 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902,\r\n 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099,\r\n 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272,\r\n 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516,\r\n 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783,\r\n 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155,\r\n 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676,\r\n 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027,\r\n 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134,\r\n 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205,\r\n 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417,\r\n 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477,\r\n 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517,\r\n 8521, 8526, 8526, 8544, 8584,\r\n 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559,\r\n 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686,\r\n 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728,\r\n 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335,\r\n 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449,\r\n 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799,\r\n 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512,\r\n 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783,\r\n 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43047, 43072,\r\n 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309,\r\n 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584,\r\n 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741,\r\n 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808,\r\n 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203,\r\n 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275,\r\n 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321,\r\n 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008,\r\n 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140,\r\n 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382,\r\n 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,\r\n];\r\n\r\nfunction lookupInUnicodeMap(code: u16, map: u16[]): bool {\r\n if (code < map[0]) return false;\r\n\r\n var lo = 0;\r\n var hi = map.length;\r\n var mid: i32;\r\n var midVal: u16;\r\n\r\n while (lo + 1 < hi) {\r\n mid = lo + ((hi - lo) >> 1);\r\n mid -= (mid & 1);\r\n midVal = map[mid];\r\n if (midVal <= code && code <= map[mid + 1]) {\r\n return true;\r\n }\r\n if (code < midVal) {\r\n hi = mid;\r\n } else {\r\n lo = mid + 2;\r\n }\r\n }\r\n return false;\r\n}\r\n\r\nfunction isUnicodeIdentifierStart(code: i32): bool {\r\n return code < 0 || code > 0xffff ? false\r\n : lookupInUnicodeMap(code as u16, unicodeIdentifierStart);\r\n}\r\n\r\nfunction isUnicodeIdentifierPart(code: i32): bool {\r\n return code < 0 || code > 0xffff ? false\r\n : lookupInUnicodeMap(code as u16, unicodeIdentifierPart);\r\n}\r\n","export function makeArray(original: Array | null = null): Array {\r\n if (original) {\r\n let cloned = new Array(original.length);\r\n for (let i = 0, k = original.length; i < k; ++i) unchecked(cloned[i] = original[i]);\r\n return cloned;\r\n }\r\n return new Array();\r\n}\r\n\r\nexport function makeSet(original: Set | null = null): Set {\r\n if (original) {\r\n let cloned = new Set();\r\n for (let v of original) cloned.add(v);\r\n return cloned;\r\n }\r\n return new Set();\r\n}\r\n\r\nexport function makeMap(original: Map | null = null, overrides: Map | null = null): Map {\r\n var cloned = new Map();\r\n if (original) {\r\n for (let [k, v] of original) cloned.set(k, v);\r\n if (overrides) for (let [k, v] of overrides) cloned.set(k, v);\r\n } else if (overrides) {\r\n for (let [k, v] of overrides) cloned.set(k, v);\r\n }\r\n return cloned;\r\n}\r\n","/** @module util *//***/\r\n\r\nimport {\r\n CharCode\r\n} from \"./charcode\";\r\n\r\nimport {\r\n PATH_DELIMITER\r\n} from \"../common\";\r\n\r\nconst separator = CharCode.SLASH;\r\n\r\n/**\r\n * Normalizes the specified path, removing interior placeholders.\r\n * Expects a posix-compatible relative path (not Windows compatible).\r\n */\r\nexport function normalizePath(path: string): string {\r\n var pos = 0;\r\n var len = path.length;\r\n\r\n // trim leading './'\r\n while (pos + 1 < len &&\r\n path.charCodeAt(pos) == CharCode.DOT &&\r\n path.charCodeAt(pos + 1) == separator\r\n ) {\r\n pos += 2;\r\n }\r\n\r\n if (pos > 0 || len < path.length) {\r\n path = path.substring(pos, len);\r\n len -= pos;\r\n pos = 0;\r\n }\r\n\r\n var atEnd: bool;\r\n while (pos + 1 < len) {\r\n atEnd = false;\r\n\r\n // we are only interested in '/.' sequences ...\r\n if (\r\n path.charCodeAt(pos) == separator &&\r\n path.charCodeAt(pos + 1) == CharCode.DOT\r\n ) {\r\n // '/.' ( '/' | $ )\r\n atEnd = pos + 2 == len;\r\n if (atEnd ||\r\n pos + 2 < len &&\r\n path.charCodeAt(pos + 2) == separator\r\n ) {\r\n path = atEnd\r\n ? path.substring(0, pos)\r\n : path.substring(0, pos) + path.substring(pos + 2);\r\n len -= 2;\r\n continue;\r\n }\r\n\r\n // '/.' ( './' | '.' $ )\r\n atEnd = pos + 3 == len;\r\n if (atEnd && path.charCodeAt(pos + 2) == CharCode.DOT ||\r\n pos + 3 < len &&\r\n path.charCodeAt(pos + 2) == CharCode.DOT &&\r\n path.charCodeAt(pos + 3) == separator\r\n ) {\r\n // find preceeding '/'\r\n let ipos = pos;\r\n while (--ipos >= 0) {\r\n if (path.charCodeAt(ipos) == separator) {\r\n if (pos - ipos != 3 ||\r\n path.charCodeAt(ipos + 1) != CharCode.DOT ||\r\n path.charCodeAt(ipos + 2) != CharCode.DOT\r\n ) { // exclude '..' itself\r\n path = atEnd\r\n ? path.substring(0, ipos)\r\n : path.substring(0, ipos) + path.substring(pos + 3);\r\n len -= pos + 3 - ipos;\r\n pos = ipos - 1; // incremented again at end of loop\r\n }\r\n break;\r\n }\r\n }\r\n\r\n // if there's no preceeding '/', trim start if non-empty\r\n if (ipos < 0 && pos > 0) {\r\n if (pos != 2 ||\r\n path.charCodeAt(0) != CharCode.DOT ||\r\n path.charCodeAt(1) != CharCode.DOT\r\n ) { // exclude '..' itself\r\n path = path.substring(pos + 4);\r\n len = path.length;\r\n continue;\r\n }\r\n }\r\n }\r\n }\r\n pos++;\r\n }\r\n return len > 0 ? path : \".\";\r\n}\r\n\r\n/** Resolves the specified path relative to the specified origin. */\r\nexport function resolvePath(normalizedPath: string, origin: string): string {\r\n if (normalizedPath.startsWith(\"std/\")) {\r\n return normalizedPath;\r\n }\r\n return normalizePath(\r\n dirname(origin) + PATH_DELIMITER + normalizedPath\r\n );\r\n}\r\n\r\n/** Obtains the directory portion of a normalized path. */\r\nexport function dirname(normalizedPath: string): string {\r\n var pos = normalizedPath.length;\r\n if (pos <= 1) {\r\n if (pos == 0) return \".\";\r\n if (normalizedPath.charCodeAt(0) == separator) {\r\n return normalizedPath;\r\n }\r\n }\r\n while (--pos > 0) {\r\n if (normalizedPath.charCodeAt(pos) == separator) {\r\n return normalizedPath.substring(0, pos);\r\n }\r\n }\r\n return \".\";\r\n}\r\n","/** @module util *//***/\r\n\r\nconst indentX1 = \" \";\r\nconst indentX2 = \" \";\r\nconst indentX4 = \" \";\r\n\r\n/** Creates an indentation matching the number of specified levels. */\r\nexport function indent(sb: string[], level: i32): void {\r\n while (level >= 4) {\r\n sb.push(indentX4);\r\n level -= 4;\r\n }\r\n if (level >= 2) {\r\n sb.push(indentX2);\r\n level -= 2;\r\n }\r\n if (level) {\r\n sb.push(indentX1);\r\n }\r\n}\r\n","/** @module util *//***/\r\n\r\n/** Reads an 8-bit integer from the specified buffer. */\r\nexport function readI8(buffer: Uint8Array, offset: i32): i32 {\r\n return buffer[offset];\r\n}\r\n\r\n/** Writes an 8-bit integer to the specified buffer. */\r\nexport function writeI8(value: i32, buffer: Uint8Array, offset: i32): void {\r\n buffer[offset] = value;\r\n}\r\n\r\n/** Reads a 16-bit integer from the specified buffer. */\r\nexport function readI16(buffer: Uint8Array, offset: i32): i32 {\r\n return buffer[offset ]\r\n | buffer[offset + 1] << 8;\r\n}\r\n\r\n/** Writes a 16-bit integer to the specified buffer. */\r\nexport function writeI16(value: i32, buffer: Uint8Array, offset: i32): void {\r\n buffer[offset ] = value;\r\n buffer[offset + 1] = value >>> 8;\r\n}\r\n\r\n/** Reads a 32-bit integer from the specified buffer. */\r\nexport function readI32(buffer: Uint8Array, offset: i32): i32 {\r\n return buffer[offset ]\r\n | buffer[offset + 1] << 8\r\n | buffer[offset + 2] << 16\r\n | buffer[offset + 3] << 24;\r\n}\r\n\r\n/** Writes a 32-bit integer to the specified buffer. */\r\nexport function writeI32(value: i32, buffer: Uint8Array, offset: i32): void {\r\n buffer[offset ] = value;\r\n buffer[offset + 1] = value >>> 8;\r\n buffer[offset + 2] = value >>> 16;\r\n buffer[offset + 3] = value >>> 24;\r\n}\r\n\r\n/** Reads a 64-bit integer from the specified buffer. */\r\nexport function readI64(buffer: Uint8Array, offset: i32): I64 {\r\n var lo = readI32(buffer, offset);\r\n var hi = readI32(buffer, offset + 4);\r\n return i64_new(lo, hi);\r\n}\r\n\r\n/** Writes a 64-bit integer to the specified buffer. */\r\nexport function writeI64(value: I64, buffer: Uint8Array, offset: i32): void {\r\n writeI32(i64_low(value), buffer, offset);\r\n writeI32(i64_high(value), buffer, offset + 4);\r\n}\r\n\r\n/** Reads a 32-bit float from the specified buffer. */\r\nexport function readF32(buffer: Uint8Array, offset: i32): f32 {\r\n return i32_as_f32(readI32(buffer, offset));\r\n}\r\n\r\n/** Writes a 32-bit float to the specified buffer. */\r\nexport function writeF32(value: f32, buffer: Uint8Array, offset: i32): void {\r\n writeI32(f32_as_i32(value), buffer, offset);\r\n}\r\n\r\n/** Reads a 64-bit float from the specified buffer. */\r\nexport function readF64(buffer: Uint8Array, offset: i32): f64 {\r\n return i64_as_f64(readI64(buffer, offset));\r\n}\r\n\r\n/** Writes a 64-bit float to the specified buffer. */\r\nexport function writeF64(value: f64, buffer: Uint8Array, offset: i32): void {\r\n var valueI64 = f64_as_i64(value);\r\n writeI32(i64_low(valueI64), buffer, offset);\r\n writeI32(i64_high(valueI64), buffer, offset + 4);\r\n}\r\n"],"sourceRoot":""} \ No newline at end of file diff --git a/examples/game-of-life/build/optimized.d.ts b/examples/game-of-life/build/optimized.d.ts index 62152f45be..08e7e10a24 100644 --- a/examples/game-of-life/build/optimized.d.ts +++ b/examples/game-of-life/build/optimized.d.ts @@ -8,17 +8,8 @@ declare module ASModule { type f32 = number; type f64 = number; type bool = any; - namespace JSMath { - function random(): f64; - } - var w: i32; - var h: i32; - var s: i32; - function init(width: i32, height: i32): void; - function step(): void; - function fill(x: u32, y: u32, p: f64): void; - var BGR_ALIVE: u32; - var BGR_DEAD: u32; - var BIT_ROT: u32; + export function init(width: i32, height: i32): void; + export function step(): void; + export function fill(x: u32, y: u32, p: f64): void; } export default ASModule; diff --git a/examples/game-of-life/build/optimized.wasm b/examples/game-of-life/build/optimized.wasm index 7178bc54c3..17c21d1b0a 100644 Binary files a/examples/game-of-life/build/optimized.wasm and b/examples/game-of-life/build/optimized.wasm differ diff --git a/examples/game-of-life/build/optimized.wat b/examples/game-of-life/build/optimized.wat index a9e5754338..b8ed6f9532 100644 --- a/examples/game-of-life/build/optimized.wat +++ b/examples/game-of-life/build/optimized.wat @@ -8,13 +8,10 @@ (import "config" "BGR_ALIVE" (global $assembly/config/BGR_ALIVE i32)) (import "config" "BIT_ROT" (global $assembly/config/BIT_ROT i32)) (import "Math" "random" (func $~lib/bindings/Math/random (result f64))) - (table $0 1 funcref) - (elem (i32.const 0) $null) (global $assembly/index/w (mut i32) (i32.const 0)) (global $assembly/index/h (mut i32) (i32.const 0)) (global $assembly/index/s (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "init" (func $assembly/index/init)) (export "step" (func $assembly/index/step)) (export "fill" (func $assembly/index/fill)) @@ -136,7 +133,7 @@ local.get $7 local.get $1 select - local.tee $2 + local.tee $3 global.get $assembly/index/w local.get $4 i32.mul @@ -165,7 +162,7 @@ local.get $7 i32.eq select - local.tee $3 + local.tee $2 global.get $assembly/index/w local.get $4 i32.mul @@ -179,7 +176,7 @@ global.get $assembly/index/w local.get $0 i32.mul - local.get $2 + local.get $3 i32.add i32.const 2 i32.shl @@ -190,7 +187,7 @@ global.get $assembly/index/w local.get $0 i32.mul - local.get $3 + local.get $2 i32.add i32.const 2 i32.shl @@ -201,7 +198,7 @@ global.get $assembly/index/w local.get $5 i32.mul - local.get $2 + local.get $3 i32.add i32.const 2 i32.shl @@ -223,7 +220,7 @@ global.get $assembly/index/w local.get $5 i32.mul - local.get $3 + local.get $2 i32.add i32.const 2 i32.shl diff --git a/examples/game-of-life/build/untouched.wat b/examples/game-of-life/build/untouched.wat index c8a5ebf3cb..86c8e31035 100644 --- a/examples/game-of-life/build/untouched.wat +++ b/examples/game-of-life/build/untouched.wat @@ -13,9 +13,7 @@ (global $assembly/index/w (mut i32) (i32.const 0)) (global $assembly/index/h (mut i32) (i32.const 0)) (global $assembly/index/s (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "init" (func $assembly/index/init)) (export "step" (func $assembly/index/step)) (export "fill" (func $assembly/index/fill)) @@ -53,7 +51,7 @@ br_if $break|1 block $assembly/index/set|inlined.0 local.get $3 - local.set $4 + local.set $6 local.get $2 local.set $5 call $~lib/bindings/Math/random @@ -68,17 +66,17 @@ i32.const -16777216 i32.or end - local.set $6 + local.set $4 global.get $assembly/index/s local.get $5 global.get $assembly/index/w i32.mul i32.add - local.get $4 + local.get $6 i32.add i32.const 2 i32.shl - local.get $6 + local.get $4 i32.store end local.get $3 @@ -135,368 +133,364 @@ i32.lt_s i32.eqz br_if $break|0 - block + local.get $2 + i32.const 0 + i32.eq + if (result i32) + local.get $0 + else local.get $2 + i32.const 1 + i32.sub + end + local.set $3 + local.get $2 + local.get $0 + i32.eq + if (result i32) i32.const 0 - i32.eq - if (result i32) - local.get $0 - else - local.get $2 - i32.const 1 - i32.sub - end - local.set $3 + else local.get $2 - local.get $0 - i32.eq - if (result i32) + i32.const 1 + i32.add + end + local.set $4 + block $break|1 + i32.const 0 + local.set $5 + loop $repeat|1 + local.get $5 + global.get $assembly/index/w + i32.lt_s + i32.eqz + br_if $break|1 + local.get $5 i32.const 0 - else - local.get $2 + i32.eq + if (result i32) + local.get $1 + else + local.get $5 + i32.const 1 + i32.sub + end + local.set $6 + local.get $5 + local.get $1 + i32.eq + if (result i32) + i32.const 0 + else + local.get $5 + i32.const 1 + i32.add + end + local.set $7 + block $assembly/index/get|inlined.0 (result i32) + local.get $6 + local.set $9 + local.get $3 + local.set $8 + local.get $8 + global.get $assembly/index/w + i32.mul + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.load + end i32.const 1 + i32.and + block $assembly/index/get|inlined.1 (result i32) + local.get $5 + local.set $9 + local.get $3 + local.set $8 + local.get $8 + global.get $assembly/index/w + i32.mul + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.load + end + i32.const 1 + i32.and i32.add - end - local.set $4 - block $break|1 - i32.const 0 - local.set $5 - loop $repeat|1 + block $assembly/index/get|inlined.2 (result i32) + local.get $7 + local.set $9 + local.get $3 + local.set $8 + local.get $8 + global.get $assembly/index/w + i32.mul + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.load + end + i32.const 1 + i32.and + i32.add + block $assembly/index/get|inlined.3 (result i32) + local.get $6 + local.set $9 + local.get $2 + local.set $8 + local.get $8 + global.get $assembly/index/w + i32.mul + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.load + end + i32.const 1 + i32.and + i32.add + block $assembly/index/get|inlined.4 (result i32) + local.get $7 + local.set $9 + local.get $2 + local.set $8 + local.get $8 + global.get $assembly/index/w + i32.mul + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.load + end + i32.const 1 + i32.and + i32.add + block $assembly/index/get|inlined.5 (result i32) + local.get $6 + local.set $9 + local.get $4 + local.set $8 + local.get $8 + global.get $assembly/index/w + i32.mul + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.load + end + i32.const 1 + i32.and + i32.add + block $assembly/index/get|inlined.6 (result i32) + local.get $5 + local.set $9 + local.get $4 + local.set $8 + local.get $8 + global.get $assembly/index/w + i32.mul + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.load + end + i32.const 1 + i32.and + i32.add + block $assembly/index/get|inlined.7 (result i32) + local.get $7 + local.set $9 + local.get $4 + local.set $8 + local.get $8 + global.get $assembly/index/w + i32.mul + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.load + end + i32.const 1 + i32.and + i32.add + local.set $9 + block $assembly/index/get|inlined.8 (result i32) local.get $5 + local.set $10 + local.get $2 + local.set $8 + local.get $8 global.get $assembly/index/w - i32.lt_s - i32.eqz - br_if $break|1 - block + i32.mul + local.get $10 + i32.add + i32.const 2 + i32.shl + i32.load + end + local.set $10 + local.get $10 + i32.const 1 + i32.and + if + local.get $9 + i32.const 14 + i32.and + i32.const 2 + i32.eq + if local.get $5 + local.set $12 + local.get $2 + local.set $11 + local.get $10 + local.set $8 + local.get $8 + i32.const 24 + i32.shr_u + global.get $assembly/config/BIT_ROT + i32.sub + local.tee $13 i32.const 0 - i32.eq - if (result i32) - local.get $1 - else - local.get $5 - i32.const 1 - i32.sub - end - local.set $6 - local.get $5 - local.get $1 - i32.eq - if (result i32) - i32.const 0 - else - local.get $5 - i32.const 1 - i32.add - end - local.set $7 - block $assembly/index/get|inlined.0 (result i32) - local.get $6 - local.set $8 - local.get $3 - local.set $9 - local.get $9 - global.get $assembly/index/w - i32.mul - local.get $8 - i32.add - i32.const 2 + local.tee $14 + local.get $13 + local.get $14 + i32.gt_s + select + local.set $13 + block $assembly/index/set|inlined.1 + local.get $12 + local.set $16 + local.get $11 + local.set $15 + local.get $13 + i32.const 24 i32.shl - i32.load - end - i32.const 1 - i32.and - block $assembly/index/get|inlined.1 (result i32) - local.get $5 - local.set $9 - local.get $3 - local.set $8 local.get $8 + i32.const 16777215 + i32.and + i32.or + local.set $14 + global.get $assembly/index/s + local.get $15 global.get $assembly/index/w i32.mul - local.get $9 i32.add - i32.const 2 - i32.shl - i32.load - end - i32.const 1 - i32.and - i32.add - block $assembly/index/get|inlined.2 (result i32) - local.get $7 - local.set $8 - local.get $3 - local.set $9 - local.get $9 - global.get $assembly/index/w - i32.mul - local.get $8 + local.get $16 i32.add i32.const 2 i32.shl - i32.load + local.get $14 + i32.store end - i32.const 1 - i32.and + else + local.get $5 + local.set $16 + local.get $2 + local.set $15 + global.get $assembly/config/BGR_DEAD + i32.const -16777216 + i32.or + local.set $14 + global.get $assembly/index/s + local.get $15 + global.get $assembly/index/w + i32.mul i32.add - block $assembly/index/get|inlined.3 (result i32) - local.get $6 - local.set $9 - local.get $2 - local.set $8 - local.get $8 - global.get $assembly/index/w - i32.mul - local.get $9 - i32.add - i32.const 2 - i32.shl - i32.load - end - i32.const 1 - i32.and + local.get $16 i32.add - block $assembly/index/get|inlined.4 (result i32) - local.get $7 - local.set $8 - local.get $2 - local.set $9 - local.get $9 - global.get $assembly/index/w - i32.mul - local.get $8 - i32.add - i32.const 2 - i32.shl - i32.load - end - i32.const 1 - i32.and + i32.const 2 + i32.shl + local.get $14 + i32.store + end + else + local.get $9 + i32.const 3 + i32.eq + if + local.get $5 + local.set $12 + local.get $2 + local.set $11 + global.get $assembly/config/BGR_ALIVE + i32.const -16777216 + i32.or + local.set $8 + global.get $assembly/index/s + local.get $11 + global.get $assembly/index/w + i32.mul i32.add - block $assembly/index/get|inlined.5 (result i32) - local.get $6 - local.set $9 - local.get $4 - local.set $8 - local.get $8 - global.get $assembly/index/w - i32.mul - local.get $9 - i32.add - i32.const 2 - i32.shl - i32.load - end - i32.const 1 - i32.and + local.get $12 i32.add - block $assembly/index/get|inlined.6 (result i32) - local.get $5 + i32.const 2 + i32.shl + local.get $8 + i32.store + else + local.get $5 + local.set $15 + local.get $2 + local.set $14 + local.get $10 + local.set $13 + local.get $13 + i32.const 24 + i32.shr_u + global.get $assembly/config/BIT_ROT + i32.sub + local.tee $12 + i32.const 0 + local.tee $11 + local.get $12 + local.get $11 + i32.gt_s + select + local.set $12 + block $assembly/index/set|inlined.4 + local.get $15 + local.set $11 + local.get $14 local.set $8 - local.get $4 - local.set $9 - local.get $9 - global.get $assembly/index/w - i32.mul - local.get $8 - i32.add - i32.const 2 + local.get $12 + i32.const 24 i32.shl - i32.load - end - i32.const 1 - i32.and - i32.add - block $assembly/index/get|inlined.7 (result i32) - local.get $7 - local.set $9 - local.get $4 - local.set $8 + local.get $13 + i32.const 16777215 + i32.and + i32.or + local.set $16 + global.get $assembly/index/s local.get $8 global.get $assembly/index/w i32.mul - local.get $9 i32.add - i32.const 2 - i32.shl - i32.load - end - i32.const 1 - i32.and - i32.add - local.set $8 - block $assembly/index/get|inlined.8 (result i32) - local.get $5 - local.set $9 - local.get $2 - local.set $10 - local.get $10 - global.get $assembly/index/w - i32.mul - local.get $9 + local.get $11 i32.add i32.const 2 i32.shl - i32.load - end - local.set $10 - local.get $10 - i32.const 1 - i32.and - if - local.get $8 - i32.const 14 - i32.and - i32.const 2 - i32.eq - if - local.get $5 - local.set $9 - local.get $2 - local.set $11 - local.get $10 - local.set $12 - local.get $12 - i32.const 24 - i32.shr_u - global.get $assembly/config/BIT_ROT - i32.sub - local.tee $13 - i32.const 0 - local.tee $14 - local.get $13 - local.get $14 - i32.gt_s - select - local.set $13 - block $assembly/index/set|inlined.1 - local.get $9 - local.set $14 - local.get $11 - local.set $15 - local.get $13 - i32.const 24 - i32.shl - local.get $12 - i32.const 16777215 - i32.and - i32.or - local.set $16 - global.get $assembly/index/s - local.get $15 - global.get $assembly/index/w - i32.mul - i32.add - local.get $14 - i32.add - i32.const 2 - i32.shl - local.get $16 - i32.store - end - else - local.get $5 - local.set $13 - local.get $2 - local.set $12 - global.get $assembly/config/BGR_DEAD - i32.const -16777216 - i32.or - local.set $11 - global.get $assembly/index/s - local.get $12 - global.get $assembly/index/w - i32.mul - i32.add - local.get $13 - i32.add - i32.const 2 - i32.shl - local.get $11 - i32.store - end - else - local.get $8 - i32.const 3 - i32.eq - if - local.get $5 - local.set $11 - local.get $2 - local.set $12 - global.get $assembly/config/BGR_ALIVE - i32.const -16777216 - i32.or - local.set $13 - global.get $assembly/index/s - local.get $12 - global.get $assembly/index/w - i32.mul - i32.add - local.get $11 - i32.add - i32.const 2 - i32.shl - local.get $13 - i32.store - else - local.get $5 - local.set $13 - local.get $2 - local.set $12 - local.get $10 - local.set $11 - local.get $11 - i32.const 24 - i32.shr_u - global.get $assembly/config/BIT_ROT - i32.sub - local.tee $9 - i32.const 0 - local.tee $16 - local.get $9 - local.get $16 - i32.gt_s - select - local.set $9 - block $assembly/index/set|inlined.4 - local.get $13 - local.set $16 - local.get $12 - local.set $15 - local.get $9 - i32.const 24 - i32.shl - local.get $11 - i32.const 16777215 - i32.and - i32.or - local.set $14 - global.get $assembly/index/s - local.get $15 - global.get $assembly/index/w - i32.mul - i32.add - local.get $16 - i32.add - i32.const 2 - i32.shl - local.get $14 - i32.store - end - end + local.get $16 + i32.store end end - local.get $5 - i32.const 1 - i32.add - local.set $5 - br $repeat|1 - unreachable end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|1 unreachable end + unreachable end local.get $2 i32.const 1 @@ -527,23 +521,23 @@ f64.lt if local.get $3 - local.set $4 + local.set $6 local.get $1 local.set $5 global.get $assembly/config/BGR_ALIVE i32.const -16777216 i32.or - local.set $6 + local.set $4 global.get $assembly/index/s local.get $5 global.get $assembly/index/w i32.mul i32.add - local.get $4 + local.get $6 i32.add i32.const 2 i32.shl - local.get $6 + local.get $4 i32.store end local.get $3 diff --git a/examples/game-of-life/package.json b/examples/game-of-life/package.json index 3089b6afd1..93ff48f7ff 100644 --- a/examples/game-of-life/package.json +++ b/examples/game-of-life/package.json @@ -3,8 +3,8 @@ "version": "1.0.0", "private": true, "scripts": { - "asbuild:untouched": "asc assembly/index.ts -b build/untouched.wasm -t build/untouched.wat --use Math=JSMath --importMemory --sourceMap --debug --validate --measure", - "asbuild:optimized": "asc assembly/index.ts -b build/optimized.wasm -t build/optimized.wat -d build/optimized.d.ts --use Math=JSMath -O3 --importMemory --sourceMap --validate --measure", + "asbuild:untouched": "asc assembly/index.ts -b build/untouched.wasm -t build/untouched.wat --use Math=JSMath --runtime none --importMemory --sourceMap --debug --validate --measure", + "asbuild:optimized": "asc assembly/index.ts -b build/optimized.wasm -t build/optimized.wat -d build/optimized.d.ts --use Math=JSMath -O3 --runtime none --importMemory --sourceMap --validate --measure", "asbuild": "npm run asbuild:untouched && npm run asbuild:optimized", "server": "http-server . -o -c-1" }, diff --git a/examples/mandelbrot/assembly/index.ts b/examples/mandelbrot/assembly/index.ts index b7f2bb811e..30328077c0 100644 --- a/examples/mandelbrot/assembly/index.ts +++ b/examples/mandelbrot/assembly/index.ts @@ -43,7 +43,7 @@ export function computeLine(y: u32, width: u32, height: u32, limit: u32): void { let sqd = ix * ix + iy * iy; if (sqd > 1.0) { let frac = Math.log2(0.5 * Math.log(sqd)); - col = ((NUM_COLORS - 1) * clamp((iteration + 1 - frac) * invLimit, 0.0, 1.0)); + col = ((NUM_COLORS - 1) * clamp((iteration + 1 - frac) * invLimit, 0.0, 1.0)); } store(stride + (x << 1), col); } diff --git a/examples/mandelbrot/build/optimized.d.ts b/examples/mandelbrot/build/optimized.d.ts index 58fe356b06..6dffd81256 100644 --- a/examples/mandelbrot/build/optimized.d.ts +++ b/examples/mandelbrot/build/optimized.d.ts @@ -8,12 +8,6 @@ declare module ASModule { type f32 = number; type f64 = number; type bool = any; - namespace JSMath { - function log(x: f64): f64; - function log2(x: f64): f64; - } - var NUM_COLORS: i32; function computeLine(y: u32, width: u32, height: u32, limit: u32): void; - function clamp(value: f64, minValue: f64, maxValue: f64): f64; } export default ASModule; diff --git a/examples/mandelbrot/build/optimized.wasm b/examples/mandelbrot/build/optimized.wasm index 3439f6160b..4857d3a4b3 100644 Binary files a/examples/mandelbrot/build/optimized.wasm and b/examples/mandelbrot/build/optimized.wasm differ diff --git a/examples/mandelbrot/build/optimized.wat b/examples/mandelbrot/build/optimized.wat index 2936b04384..026da996c8 100644 --- a/examples/mandelbrot/build/optimized.wat +++ b/examples/mandelbrot/build/optimized.wat @@ -5,52 +5,51 @@ (import "env" "memory" (memory $0 0)) (import "Math" "log" (func $~lib/bindings/Math/log (param f64) (result f64))) (import "Math" "log2" (func $~lib/bindings/Math/log2 (param f64) (result f64))) - (table $0 1 funcref) - (elem (i32.const 0) $null) (export "memory" (memory $0)) - (export "table" (table $0)) (export "computeLine" (func $assembly/index/computeLine)) (func $assembly/index/computeLine (; 2 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 f64) (local $5 f64) (local $6 f64) (local $7 i32) - (local $8 f64) + (local $8 i32) (local $9 f64) (local $10 f64) (local $11 f64) (local $12 f64) (local $13 f64) (local $14 f64) - f64.const 10 - f64.const 3 + (local $15 f64) local.get $1 f64.convert_i32_u - local.tee $8 - f64.mul - f64.const 4 - local.get $2 - f64.convert_i32_u - local.tee $4 + local.tee $9 + f64.const 0.625 f64.mul - f64.min - f64.div - local.set $9 + local.set $4 local.get $0 f64.convert_i32_u - local.get $4 + local.get $2 + f64.convert_i32_u + local.tee $6 f64.const 0.5 f64.mul f64.sub + f64.const 10 + f64.const 3 local.get $9 f64.mul - local.set $10 - local.get $8 - f64.const 0.625 + f64.const 4 + local.get $6 f64.mul - local.get $9 + f64.min + f64.div + local.tee $10 f64.mul - local.set $12 + local.set $11 + local.get $4 + local.get $10 + f64.mul + local.set $13 local.get $0 local.get $1 i32.mul @@ -62,34 +61,35 @@ f64.convert_i32_u local.tee $6 f64.div - local.set $13 + local.set $14 f64.const 8 local.get $6 f64.min - local.set $8 + local.set $15 loop $repeat|0 - local.get $7 - local.get $1 - i32.lt_u - if - local.get $7 + block $break|0 + local.get $8 + local.get $1 + i32.ge_u + br_if $break|0 + local.get $8 f64.convert_i32_u - local.get $9 + local.get $10 f64.mul - local.get $12 + local.get $13 f64.sub - local.set $11 + local.set $12 f64.const 0 local.set $4 f64.const 0 local.set $5 i32.const 0 - local.set $2 + local.set $7 loop $continue|1 local.get $4 local.get $4 f64.mul - local.tee $14 + local.tee $9 local.get $5 local.get $5 f64.mul @@ -104,31 +104,31 @@ f64.mul local.get $5 f64.mul - local.get $10 + local.get $11 f64.add local.set $5 - local.get $14 + local.get $9 local.get $6 f64.sub - local.get $11 + local.get $12 f64.add local.set $4 - local.get $2 + local.get $7 local.get $3 i32.ge_u br_if $break|1 - local.get $2 + local.get $7 i32.const 1 i32.add - local.set $2 + local.set $7 br $continue|1 end end end loop $continue|2 - local.get $2 + local.get $7 f64.convert_i32_u - local.get $8 + local.get $15 f64.lt if local.get $4 @@ -138,7 +138,7 @@ local.get $5 f64.mul f64.sub - local.get $11 + local.get $12 f64.add local.set $6 f64.const 2 @@ -146,19 +146,21 @@ f64.mul local.get $5 f64.mul - local.get $10 + local.get $11 f64.add local.set $5 local.get $6 local.set $4 - local.get $2 + local.get $7 i32.const 1 i32.add - local.set $2 + local.set $7 br $continue|2 end end - local.get $7 + i32.const 2047 + local.set $2 + local.get $8 i32.const 1 i32.shl local.get $0 @@ -175,7 +177,7 @@ f64.gt if (result i32) f64.const 2047 - local.get $2 + local.get $7 i32.const 1 i32.add f64.convert_i32_u @@ -185,7 +187,7 @@ f64.mul call $~lib/bindings/Math/log2 f64.sub - local.get $13 + local.get $14 f64.mul f64.const 0 f64.max @@ -197,10 +199,10 @@ i32.const 2047 end i32.store16 - local.get $7 + local.get $8 i32.const 1 i32.add - local.set $7 + local.set $8 br $repeat|0 end end diff --git a/examples/mandelbrot/build/untouched.wat b/examples/mandelbrot/build/untouched.wat index db2e3fde91..b5efd7d462 100644 --- a/examples/mandelbrot/build/untouched.wat +++ b/examples/mandelbrot/build/untouched.wat @@ -1,7 +1,6 @@ (module (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$dd (func (param f64) (result f64))) - (type $FUNCSIG$dddd (func (param f64 f64 f64) (result f64))) (type $FUNCSIG$v (func)) (import "env" "memory" (memory $0 0)) (import "Math" "log" (func $~lib/bindings/Math/log (param f64) (result f64))) @@ -9,18 +8,9 @@ (table $0 1 funcref) (elem (i32.const 0) $null) (global $assembly/index/NUM_COLORS i32 (i32.const 2048)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "computeLine" (func $assembly/index/computeLine)) - (func $assembly/index/clamp (; 2 ;) (type $FUNCSIG$dddd) (param $0 f64) (param $1 f64) (param $2 f64) (result f64) - local.get $0 - local.get $1 - f64.max - local.get $2 - f64.min - ) - (func $assembly/index/computeLine (; 3 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $assembly/index/computeLine (; 2 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 f64) (local $5 f64) (local $6 f64) @@ -39,6 +29,9 @@ (local $19 f64) (local $20 i32) (local $21 f64) + (local $22 f64) + (local $23 f64) + (local $24 f64) local.get $1 f64.convert_i32_u f64.const 1 @@ -101,127 +94,123 @@ i32.lt_u i32.eqz br_if $break|0 - block - local.get $12 - f64.convert_i32_u - local.get $6 - f64.mul - local.get $8 - f64.sub - local.set $13 - f64.const 0 - local.set $14 - f64.const 0 - local.set $15 - i32.const 0 - local.set $18 - block $break|1 - loop $continue|1 - local.get $14 + local.get $12 + f64.convert_i32_u + local.get $6 + f64.mul + local.get $8 + f64.sub + local.set $13 + f64.const 0 + local.set $14 + f64.const 0 + local.set $15 + i32.const 0 + local.set $18 + block $break|1 + loop $continue|1 + local.get $14 + local.get $14 + f64.mul + local.tee $16 + local.get $15 + local.get $15 + f64.mul + local.tee $17 + f64.add + f64.const 4 + f64.le + if + f64.const 2 local.get $14 f64.mul - local.tee $16 - local.get $15 local.get $15 f64.mul - local.tee $17 + local.get $7 + f64.add + local.set $15 + local.get $16 + local.get $17 + f64.sub + local.get $13 f64.add - f64.const 4 - f64.le + local.set $14 + local.get $18 + local.get $3 + i32.ge_u if - block - f64.const 2 - local.get $14 - f64.mul - local.get $15 - f64.mul - local.get $7 - f64.add - local.set $15 - local.get $16 - local.get $17 - f64.sub - local.get $13 - f64.add - local.set $14 - local.get $18 - local.get $3 - i32.ge_u - if - br $break|1 - end - local.get $18 - i32.const 1 - i32.add - local.set $18 - end - br $continue|1 + br $break|1 end + local.get $18 + i32.const 1 + i32.add + local.set $18 + br $continue|1 end end - block $break|2 - loop $continue|2 + end + block $break|2 + loop $continue|2 + local.get $18 + f64.convert_i32_u + local.get $11 + f64.lt + if + local.get $14 + local.get $14 + f64.mul + local.get $15 + local.get $15 + f64.mul + f64.sub + local.get $13 + f64.add + local.set $19 + f64.const 2 + local.get $14 + f64.mul + local.get $15 + f64.mul + local.get $7 + f64.add + local.set $15 + local.get $19 + local.set $14 local.get $18 - f64.convert_i32_u - local.get $11 - f64.lt - if - block - local.get $14 - local.get $14 - f64.mul - local.get $15 - local.get $15 - f64.mul - f64.sub - local.get $13 - f64.add - local.set $19 - f64.const 2 - local.get $14 - f64.mul - local.get $15 - f64.mul - local.get $7 - f64.add - local.set $15 - local.get $19 - local.set $14 - local.get $18 - i32.const 1 - i32.add - local.set $18 - end - br $continue|2 - end + i32.const 1 + i32.add + local.set $18 + br $continue|2 end end + end + global.get $assembly/index/NUM_COLORS + i32.const 1 + i32.sub + local.set $20 + local.get $14 + local.get $14 + f64.mul + local.get $15 + local.get $15 + f64.mul + f64.add + local.set $19 + local.get $19 + f64.const 1 + f64.gt + if + f64.const 0.5 + local.get $19 + call $~lib/bindings/Math/log + f64.mul + call $~lib/bindings/Math/log2 + local.set $21 global.get $assembly/index/NUM_COLORS i32.const 1 i32.sub - local.set $20 - local.get $14 - local.get $14 - f64.mul - local.get $15 - local.get $15 - f64.mul - f64.add - local.set $19 - local.get $19 - f64.const 1 - f64.gt - if - f64.const 0.5 - local.get $19 - call $~lib/bindings/Math/log - f64.mul - call $~lib/bindings/Math/log2 - local.set $21 - global.get $assembly/index/NUM_COLORS - i32.const 1 - i32.sub - f64.convert_i32_s + f64.convert_i32_s + block $assembly/index/clamp|inlined.0 (result f64) local.get $18 i32.const 1 i32.add @@ -230,21 +219,28 @@ f64.sub local.get $10 f64.mul + local.set $24 f64.const 0 + local.set $23 f64.const 1 - call $assembly/index/clamp - f64.mul - i32.trunc_f64_u - local.set $20 + local.set $22 + local.get $24 + local.get $23 + f64.max + local.get $22 + f64.min end - local.get $9 - local.get $12 - i32.const 1 - i32.shl - i32.add - local.get $20 - i32.store16 + f64.mul + i32.trunc_f64_u + local.set $20 end + local.get $9 + local.get $12 + i32.const 1 + i32.shl + i32.add + local.get $20 + i32.store16 local.get $12 i32.const 1 i32.add @@ -255,6 +251,6 @@ unreachable end ) - (func $null (; 4 ;) (type $FUNCSIG$v) + (func $null (; 3 ;) (type $FUNCSIG$v) ) ) diff --git a/examples/mandelbrot/package.json b/examples/mandelbrot/package.json index 8d58368737..28f94c0160 100644 --- a/examples/mandelbrot/package.json +++ b/examples/mandelbrot/package.json @@ -3,8 +3,8 @@ "version": "1.0.0", "private": true, "scripts": { - "asbuild:untouched": "asc assembly/index.ts -b build/untouched.wasm -t build/untouched.wat --use Math=JSMath --importMemory --sourceMap --debug --validate --measure", - "asbuild:optimized": "asc assembly/index.ts -b build/optimized.wasm -t build/optimized.wat -d build/optimized.d.ts --use Math=JSMath -O3 --importMemory --sourceMap --validate --measure", + "asbuild:untouched": "asc assembly/index.ts -b build/untouched.wasm -t build/untouched.wat --use Math=JSMath --runtime none --importMemory --sourceMap --debug --validate --measure", + "asbuild:optimized": "asc assembly/index.ts -b build/optimized.wasm -t build/optimized.wat -d build/optimized.d.ts --use Math=JSMath --runtime none -O3 --importMemory --sourceMap --validate --measure", "asbuild": "npm run asbuild:untouched && npm run asbuild:optimized", "server": "http-server . -o -c-1" }, diff --git a/examples/n-body/assembly/index.js b/examples/n-body/assembly/index.js index 11c076b27a..3f84716427 100644 --- a/examples/n-body/assembly/index.js +++ b/examples/n-body/assembly/index.js @@ -9,7 +9,7 @@ const imports = { env: { memory: new WebAssembly.Memory({ initial: 10 }), abort: (filename, line, column) => { - throw Error("abort called at " + line + ":" + colum); + throw Error("abort called at " + line + ":" + column); } } }; diff --git a/examples/n-body/assembly/index.ts b/examples/n-body/assembly/index.ts index 6f3ea91260..4173cb117b 100644 --- a/examples/n-body/assembly/index.ts +++ b/examples/n-body/assembly/index.ts @@ -1,5 +1,3 @@ -import "allocator/arena"; - // From The Computer Language Benchmarks Game // http://benchmarksgame.alioth.debian.org @@ -96,7 +94,7 @@ class NBodySystem { py += b.vy * m; pz += b.vz * m; } - bodies[0].offsetMomentum(px, py, pz); + unchecked(bodies[0]).offsetMomentum(px, py, pz); } advance(dt: float): void { @@ -206,5 +204,5 @@ export function bench(steps: u32): void { export function getBody(index: i32): Body | null { var bodies = system.bodies; - return index < bodies.length ? bodies[index] : null; + return index < bodies.length ? unchecked(bodies[index]) : null; } diff --git a/examples/n-body/build/index.asm.js b/examples/n-body/build/index.asm.js index 8dd198d0fc..1f65685e7d 100644 --- a/examples/n-body/build/index.asm.js +++ b/examples/n-body/build/index.asm.js @@ -1,3 +1,4 @@ + function asmFunc(global, env, buffer) { "almost asm"; var HEAP8 = new global.Int8Array(buffer); @@ -20,427 +21,231 @@ function asmFunc(global, env, buffer) { var abort = env.abort; var nan = global.NaN; var infinity = global.Infinity; - var $lib_allocator_arena_startOffset = 0; - var $lib_allocator_arena_offset = 0; var assembly_index_system = 0; - var i64toi32_i32$HIGH_BITS = 0; - function $lib_allocator_arena___memory_allocate($0) { - $0 = $0 | 0; - var $1 = 0, $2 = 0, $3 = 0, wasm2js_i32$0 = 0, wasm2js_i32$1 = 0, wasm2js_i32$2 = 0; - if ($0 >>> 0 > 1073741824 >>> 0) abort(); - $1 = $lib_allocator_arena_offset; - $2 = (($1 + (wasm2js_i32$0 = $0, wasm2js_i32$1 = 1, wasm2js_i32$2 = $0 >>> 0 > 1 >>> 0, wasm2js_i32$2 ? wasm2js_i32$0 : wasm2js_i32$1) | 0) + 7 | 0) & 4294967288 | 0; - $3 = __wasm_current_memory(); - if ($2 >>> 0 > ($3 << 16 | 0) >>> 0) { - $0 = ((($2 - $1 | 0) + 65535 | 0) & 4294901760 | 0) >>> 16 | 0; - if ((__wasm_grow_memory((wasm2js_i32$0 = $3, wasm2js_i32$1 = $0, wasm2js_i32$2 = ($3 | 0) > ($0 | 0), wasm2js_i32$2 ? wasm2js_i32$0 : wasm2js_i32$1) | 0) | 0) < (0 | 0)) if ((__wasm_grow_memory($0 | 0) | 0) < (0 | 0)) abort();; + var $lib_rt_stub_startOffset = 0; + var $lib_rt_stub_offset = 0; + function $lib_rt_stub___alloc($0, $1) { + var $2 = 0, $3 = 0, $4 = 0, $5 = 0; + if ($0 >>> 0 > 1073741808 >>> 0) { + abort() } - $lib_allocator_arena_offset = $2; - return $1 | 0; + $3 = $lib_rt_stub_offset + 16 | 0; + $2 = (($3 + ($0 >>> 0 > 1 >>> 0 ? $0 : 1) | 0) + 15 | 0) & -16 | 0; + $4 = __wasm_memory_size(); + if ($2 >>> 0 > ($4 << 16 | 0) >>> 0) { + $5 = ((($2 - $3 | 0) + 65535 | 0) & -65536 | 0) >>> 16 | 0; + if ((__wasm_memory_grow((($4 | 0) > ($5 | 0) ? $4 : $5) | 0) | 0) < (0 | 0)) { + if ((__wasm_memory_grow($5 | 0) | 0) < (0 | 0)) { + abort() + } + } + } + $lib_rt_stub_offset = $2; + $2 = $3 - 16 | 0; + HEAP32[($2 + 8 | 0) >> 2] = $1; + HEAP32[($2 + 12 | 0) >> 2] = $0; + return $3; } function assembly_index_NBodySystem_constructor($0) { - $0 = $0 | 0; - var $1 = 0, $2 = 0, $3 = 0.0, $4 = 0.0, $5 = 0.0, $6 = 0.0, $7 = 0, $49 = 0, wasm2js_i32$0 = 0, wasm2js_f64$0 = 0.0, wasm2js_i32$1 = 0; - $7 = HEAP32[($0 + 4 | 0) >> 2] | 0; - repeat_0 : do { + var $1 = 0, $2 = 0, $3 = 0.0, $4 = 0.0, $5 = 0.0, $6 = 0.0, $7 = 0; + $7 = HEAP32[($0 + 12 | 0) >> 2]; + repeat_0 : while (1) { if (($1 | 0) < ($7 | 0)) { - $2 = HEAPU32[(((HEAPU32[$0 >> 2] | 0) + ($1 << 2 | 0) | 0) + 8 | 0) >> 2] | 0; - $3 = +HEAPF64[($2 + 48 | 0) >> 3]; - $4 = $4 + +HEAPF64[($2 + 24 | 0) >> 3] * $3; - $5 = $5 + +HEAPF64[($2 + 32 | 0) >> 3] * $3; - $6 = $6 + +HEAPF64[($2 + 40 | 0) >> 3] * $3; + $2 = HEAP32[(HEAP32[($0 + 4 | 0) >> 2] + ($1 << 2 | 0) | 0) >> 2]; + $3 = HEAPF64[($2 + 48 | 0) >> 3]; + $4 = $4 + HEAPF64[($2 + 24 | 0) >> 3] * $3; + $5 = $5 + HEAPF64[($2 + 32 | 0) >> 3] * $3; + $6 = $6 + HEAPF64[($2 + 40 | 0) >> 3] * $3; $1 = $1 + 1 | 0; continue repeat_0; } break repeat_0; - } while (1); - $1 = HEAPU32[$0 >> 2] | 0; - if (0 >>> 0 < ((HEAP32[$1 >> 2] | 0) >>> 2 | 0) >>> 0) $49 = HEAPU32[($1 + 8 | 0) >> 2] | 0; else abort(); - $1 = $49; - wasm2js_i32$0 = $1; - wasm2js_f64$0 = -$4 / 39.47841760435743; - HEAPF64[(wasm2js_i32$0 + 24 | 0) >> 3] = wasm2js_f64$0; - wasm2js_i32$0 = $1; - wasm2js_f64$0 = -$5 / 39.47841760435743; - HEAPF64[(wasm2js_i32$0 + 32 | 0) >> 3] = wasm2js_f64$0; - wasm2js_i32$0 = $1; - wasm2js_f64$0 = -$6 / 39.47841760435743; - HEAPF64[(wasm2js_i32$0 + 40 | 0) >> 3] = wasm2js_f64$0; - $1 = $lib_allocator_arena___memory_allocate(4 | 0) | 0; - wasm2js_i32$0 = $1; - wasm2js_i32$1 = $0; - HEAP32[wasm2js_i32$0 >> 2] = wasm2js_i32$1; - return $1 | 0; + }; + $1 = HEAP32[HEAP32[($0 + 4 | 0) >> 2] >> 2]; + HEAPF64[($1 + 24 | 0) >> 3] = -$4 / 39.47841760435743; + HEAPF64[($1 + 32 | 0) >> 3] = -$5 / 39.47841760435743; + HEAPF64[($1 + 40 | 0) >> 3] = -$6 / 39.47841760435743; + $1 = $lib_rt_stub___alloc(4, 3); + HEAP32[$1 >> 2] = $0; + return $1; } function assembly_index_Body_constructor($0, $1, $2, $3, $4, $5, $6) { - $0 = +$0; - $1 = +$1; - $2 = +$2; - $3 = +$3; - $4 = +$4; - $5 = +$5; - $6 = +$6; - var $7 = 0, wasm2js_i32$0 = 0, wasm2js_f64$0 = 0.0; - $7 = $lib_allocator_arena___memory_allocate(56 | 0) | 0; - wasm2js_i32$0 = $7; - wasm2js_f64$0 = $0; - HEAPF64[wasm2js_i32$0 >> 3] = wasm2js_f64$0; - wasm2js_i32$0 = $7; - wasm2js_f64$0 = $1; - HEAPF64[(wasm2js_i32$0 + 8 | 0) >> 3] = wasm2js_f64$0; - wasm2js_i32$0 = $7; - wasm2js_f64$0 = $2; - HEAPF64[(wasm2js_i32$0 + 16 | 0) >> 3] = wasm2js_f64$0; - wasm2js_i32$0 = $7; - wasm2js_f64$0 = $3; - HEAPF64[(wasm2js_i32$0 + 24 | 0) >> 3] = wasm2js_f64$0; - wasm2js_i32$0 = $7; - wasm2js_f64$0 = $4; - HEAPF64[(wasm2js_i32$0 + 32 | 0) >> 3] = wasm2js_f64$0; - wasm2js_i32$0 = $7; - wasm2js_f64$0 = $5; - HEAPF64[(wasm2js_i32$0 + 40 | 0) >> 3] = wasm2js_f64$0; - wasm2js_i32$0 = $7; - wasm2js_f64$0 = $6; - HEAPF64[(wasm2js_i32$0 + 48 | 0) >> 3] = wasm2js_f64$0; - return $7 | 0; + var $7 = 0; + $7 = $lib_rt_stub___alloc(56, 4); + HEAPF64[$7 >> 3] = $0; + HEAPF64[($7 + 8 | 0) >> 3] = $1; + HEAPF64[($7 + 16 | 0) >> 3] = $2; + HEAPF64[($7 + 24 | 0) >> 3] = $3; + HEAPF64[($7 + 32 | 0) >> 3] = $4; + HEAPF64[($7 + 40 | 0) >> 3] = $5; + HEAPF64[($7 + 48 | 0) >> 3] = $6; + return $7; } - function $lib_internal_memory_memset($0) { - $0 = $0 | 0; - var $1 = 0, $2 = 0, i64toi32_i32$1 = 0, i64toi32_i32$0 = 0, wasm2js_i32$0 = 0, wasm2js_i32$1 = 0, wasm2js_i32$2 = 0, wasm2js_i32$3 = 0; - wasm2js_i32$0 = $0; - wasm2js_i32$1 = 0; - HEAP8[wasm2js_i32$0 >> 0] = wasm2js_i32$1; - $1 = $0 + 20 | 0; - wasm2js_i32$0 = $1 - 1 | 0; - wasm2js_i32$1 = 0; - HEAP8[wasm2js_i32$0 >> 0] = wasm2js_i32$1; - wasm2js_i32$0 = $0 + 1 | 0; - wasm2js_i32$1 = 0; - HEAP8[wasm2js_i32$0 >> 0] = wasm2js_i32$1; - wasm2js_i32$0 = $0 + 2 | 0; - wasm2js_i32$1 = 0; - HEAP8[wasm2js_i32$0 >> 0] = wasm2js_i32$1; - wasm2js_i32$0 = $1 - 2 | 0; - wasm2js_i32$1 = 0; - HEAP8[wasm2js_i32$0 >> 0] = wasm2js_i32$1; - wasm2js_i32$0 = $1 - 3 | 0; - wasm2js_i32$1 = 0; - HEAP8[wasm2js_i32$0 >> 0] = wasm2js_i32$1; - wasm2js_i32$0 = $0 + 3 | 0; - wasm2js_i32$1 = 0; - HEAP8[wasm2js_i32$0 >> 0] = wasm2js_i32$1; - wasm2js_i32$0 = $1 - 4 | 0; - wasm2js_i32$1 = 0; - HEAP8[wasm2js_i32$0 >> 0] = wasm2js_i32$1; - $1 = (0 - $0 | 0) & 3 | 0; - $0 = $1 + $0 | 0; - wasm2js_i32$0 = $0; - wasm2js_i32$1 = 0; - HEAP32[wasm2js_i32$0 >> 2] = wasm2js_i32$1; - $2 = (20 - $1 | 0) & 4294967292 | 0; - wasm2js_i32$0 = ($2 + $0 | 0) - 4 | 0; - wasm2js_i32$1 = 0; - HEAP32[wasm2js_i32$0 >> 2] = wasm2js_i32$1; - if ($2 >>> 0 <= 8 >>> 0) return; - wasm2js_i32$0 = $0 + 4 | 0; - wasm2js_i32$1 = 0; - HEAP32[wasm2js_i32$0 >> 2] = wasm2js_i32$1; - wasm2js_i32$0 = $0 + 8 | 0; - wasm2js_i32$1 = 0; - HEAP32[wasm2js_i32$0 >> 2] = wasm2js_i32$1; - $1 = $0 + $2 | 0; - wasm2js_i32$0 = $1 - 12 | 0; - wasm2js_i32$1 = 0; - HEAP32[wasm2js_i32$0 >> 2] = wasm2js_i32$1; - wasm2js_i32$0 = $1 - 8 | 0; - wasm2js_i32$1 = 0; - HEAP32[wasm2js_i32$0 >> 2] = wasm2js_i32$1; - if ($2 >>> 0 <= 24 >>> 0) return; - wasm2js_i32$0 = $0 + 12 | 0; - wasm2js_i32$1 = 0; - HEAP32[wasm2js_i32$0 >> 2] = wasm2js_i32$1; - wasm2js_i32$0 = $0 + 16 | 0; - wasm2js_i32$1 = 0; - HEAP32[wasm2js_i32$0 >> 2] = wasm2js_i32$1; - wasm2js_i32$0 = $0 + 20 | 0; - wasm2js_i32$1 = 0; - HEAP32[wasm2js_i32$0 >> 2] = wasm2js_i32$1; - wasm2js_i32$0 = $0 + 24 | 0; - wasm2js_i32$1 = 0; - HEAP32[wasm2js_i32$0 >> 2] = wasm2js_i32$1; - $1 = $0 + $2 | 0; - wasm2js_i32$0 = $1 - 28 | 0; - wasm2js_i32$1 = 0; - HEAP32[wasm2js_i32$0 >> 2] = wasm2js_i32$1; - wasm2js_i32$0 = $1 - 24 | 0; - wasm2js_i32$1 = 0; - HEAP32[wasm2js_i32$0 >> 2] = wasm2js_i32$1; - wasm2js_i32$0 = $1 - 20 | 0; - wasm2js_i32$1 = 0; - HEAP32[wasm2js_i32$0 >> 2] = wasm2js_i32$1; - wasm2js_i32$0 = $1 - 16 | 0; - wasm2js_i32$1 = 0; - HEAP32[wasm2js_i32$0 >> 2] = wasm2js_i32$1; - $1 = ($0 & 4 | 0) + 24 | 0; - $0 = $1 + $0 | 0; - $2 = $2 - $1 | 0; - continue_0 : do { - if ($2 >>> 0 >= 32 >>> 0) { - i64toi32_i32$1 = $0; - i64toi32_i32$0 = 0; - wasm2js_i32$0 = $0; - wasm2js_i32$1 = 0; - HEAP32[wasm2js_i32$0 >> 2] = wasm2js_i32$1; - wasm2js_i32$0 = $0; - wasm2js_i32$1 = i64toi32_i32$0; - (wasm2js_i32$2 = wasm2js_i32$0, wasm2js_i32$3 = wasm2js_i32$1), ((HEAP8[(wasm2js_i32$2 + 4 | 0) >> 0] = wasm2js_i32$3 & 255 | 0, HEAP8[(wasm2js_i32$2 + 5 | 0) >> 0] = (wasm2js_i32$3 >>> 8 | 0) & 255 | 0), HEAP8[(wasm2js_i32$2 + 6 | 0) >> 0] = (wasm2js_i32$3 >>> 16 | 0) & 255 | 0), HEAP8[(wasm2js_i32$2 + 7 | 0) >> 0] = (wasm2js_i32$3 >>> 24 | 0) & 255 | 0; - i64toi32_i32$1 = $0 + 8 | 0; - i64toi32_i32$0 = 0; - wasm2js_i32$0 = i64toi32_i32$1; - wasm2js_i32$1 = 0; - HEAP32[wasm2js_i32$0 >> 2] = wasm2js_i32$1; - wasm2js_i32$0 = i64toi32_i32$1; - wasm2js_i32$1 = i64toi32_i32$0; - (wasm2js_i32$2 = wasm2js_i32$0, wasm2js_i32$3 = wasm2js_i32$1), ((HEAP8[(wasm2js_i32$2 + 4 | 0) >> 0] = wasm2js_i32$3 & 255 | 0, HEAP8[(wasm2js_i32$2 + 5 | 0) >> 0] = (wasm2js_i32$3 >>> 8 | 0) & 255 | 0), HEAP8[(wasm2js_i32$2 + 6 | 0) >> 0] = (wasm2js_i32$3 >>> 16 | 0) & 255 | 0), HEAP8[(wasm2js_i32$2 + 7 | 0) >> 0] = (wasm2js_i32$3 >>> 24 | 0) & 255 | 0; - i64toi32_i32$1 = $0 + 16 | 0; - i64toi32_i32$0 = 0; - wasm2js_i32$0 = i64toi32_i32$1; - wasm2js_i32$1 = 0; - HEAP32[wasm2js_i32$0 >> 2] = wasm2js_i32$1; - wasm2js_i32$0 = i64toi32_i32$1; - wasm2js_i32$1 = i64toi32_i32$0; - (wasm2js_i32$2 = wasm2js_i32$0, wasm2js_i32$3 = wasm2js_i32$1), ((HEAP8[(wasm2js_i32$2 + 4 | 0) >> 0] = wasm2js_i32$3 & 255 | 0, HEAP8[(wasm2js_i32$2 + 5 | 0) >> 0] = (wasm2js_i32$3 >>> 8 | 0) & 255 | 0), HEAP8[(wasm2js_i32$2 + 6 | 0) >> 0] = (wasm2js_i32$3 >>> 16 | 0) & 255 | 0), HEAP8[(wasm2js_i32$2 + 7 | 0) >> 0] = (wasm2js_i32$3 >>> 24 | 0) & 255 | 0; - i64toi32_i32$1 = $0 + 24 | 0; - i64toi32_i32$0 = 0; - wasm2js_i32$0 = i64toi32_i32$1; - wasm2js_i32$1 = 0; - HEAP32[wasm2js_i32$0 >> 2] = wasm2js_i32$1; - wasm2js_i32$0 = i64toi32_i32$1; - wasm2js_i32$1 = i64toi32_i32$0; - (wasm2js_i32$2 = wasm2js_i32$0, wasm2js_i32$3 = wasm2js_i32$1), ((HEAP8[(wasm2js_i32$2 + 4 | 0) >> 0] = wasm2js_i32$3 & 255 | 0, HEAP8[(wasm2js_i32$2 + 5 | 0) >> 0] = (wasm2js_i32$3 >>> 8 | 0) & 255 | 0), HEAP8[(wasm2js_i32$2 + 6 | 0) >> 0] = (wasm2js_i32$3 >>> 16 | 0) & 255 | 0), HEAP8[(wasm2js_i32$2 + 7 | 0) >> 0] = (wasm2js_i32$3 >>> 24 | 0) & 255 | 0; - $2 = $2 - 32 | 0; - $0 = $0 + 32 | 0; - continue continue_0; - } - break continue_0; - } while (1); - } - - function $lib_array_Array_Body__constructor() { - var $0 = 0, $1 = 0, wasm2js_i32$0 = 0, wasm2js_i32$1 = 0; - $1 = $lib_allocator_arena___memory_allocate(32 | 0) | 0; - wasm2js_i32$0 = $1; - wasm2js_i32$1 = 20; - HEAP32[wasm2js_i32$0 >> 2] = wasm2js_i32$1; - $0 = $lib_allocator_arena___memory_allocate(8 | 0) | 0; - wasm2js_i32$0 = $0; - wasm2js_i32$1 = 0; - HEAP32[wasm2js_i32$0 >> 2] = wasm2js_i32$1; - wasm2js_i32$0 = $0; - wasm2js_i32$1 = 0; - HEAP32[(wasm2js_i32$0 + 4 | 0) >> 2] = wasm2js_i32$1; - wasm2js_i32$0 = $0; - wasm2js_i32$1 = $1; - HEAP32[wasm2js_i32$0 >> 2] = wasm2js_i32$1; - wasm2js_i32$0 = $0; - wasm2js_i32$1 = 5; - HEAP32[(wasm2js_i32$0 + 4 | 0) >> 2] = wasm2js_i32$1; - $lib_internal_memory_memset($1 + 8 | 0 | 0); - return $0 | 0; + function $lib_rt___allocArray() { + var $0 = 0, $1 = 0; + $0 = $lib_rt_stub___alloc(16, 5); + $1 = $lib_rt_stub___alloc(20, 0); + HEAP32[$0 >> 2] = $1; + HEAP32[($0 + 4 | 0) >> 2] = $1; + HEAP32[($0 + 8 | 0) >> 2] = 20; + HEAP32[($0 + 12 | 0) >> 2] = 5; + return $0; } function assembly_index_init() { var $0 = 0, $1 = 0, wasm2js_i32$0 = 0, wasm2js_i32$1 = 0; - $1 = $lib_array_Array_Body__constructor() | 0; - $0 = assembly_index_Body_constructor(+(0.0), +(0.0), +(0.0), +(0.0), +(0.0), +(0.0), +(39.47841760435743)) | 0; - wasm2js_i32$0 = HEAPU32[$1 >> 2] | 0; - wasm2js_i32$1 = $0; - HEAP32[(wasm2js_i32$0 + 8 | 0) >> 2] = wasm2js_i32$1; - $0 = assembly_index_Body_constructor(+(4.841431442464721), +(-1.1603200440274284), +(-.10362204447112311), +(.606326392995832), +(2.81198684491626), +(-.02521836165988763), +(.03769367487038949)) | 0; - wasm2js_i32$0 = (HEAPU32[$1 >> 2] | 0) + 4 | 0; - wasm2js_i32$1 = $0; - HEAP32[(wasm2js_i32$0 + 8 | 0) >> 2] = wasm2js_i32$1; - $0 = assembly_index_Body_constructor(+(8.34336671824458), +(4.124798564124305), +(-.4035234171143214), +(-1.0107743461787924), +(1.8256623712304119), +(.008415761376584154), +(.011286326131968767)) | 0; - wasm2js_i32$0 = (HEAPU32[$1 >> 2] | 0) + 8 | 0; - wasm2js_i32$1 = $0; - HEAP32[(wasm2js_i32$0 + 8 | 0) >> 2] = wasm2js_i32$1; - $0 = assembly_index_Body_constructor(+(12.894369562139131), +(-15.111151401698631), +(-.22330757889265573), +(1.0827910064415354), +(.8687130181696082), +(-.010832637401363636), +(1.7237240570597112e-03)) | 0; - wasm2js_i32$0 = (HEAPU32[$1 >> 2] | 0) + 12 | 0; - wasm2js_i32$1 = $0; - HEAP32[(wasm2js_i32$0 + 8 | 0) >> 2] = wasm2js_i32$1; - $0 = assembly_index_Body_constructor(+(15.379697114850917), +(-25.919314609987964), +(.17925877295037118), +(.979090732243898), +(.5946989986476762), +(-.034755955504078104), +(2.0336868699246304e-03)) | 0; - wasm2js_i32$0 = (HEAPU32[$1 >> 2] | 0) + 16 | 0; - wasm2js_i32$1 = $0; - HEAP32[(wasm2js_i32$0 + 8 | 0) >> 2] = wasm2js_i32$1; - assembly_index_system = assembly_index_NBodySystem_constructor($1 | 0) | 0; + $1 = $lib_rt___allocArray(); + $0 = HEAP32[($1 + 4 | 0) >> 2]; + (wasm2js_i32$0 = $0, wasm2js_i32$1 = assembly_index_Body_constructor(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 39.47841760435743)), HEAP32[wasm2js_i32$0 >> 2] = wasm2js_i32$1; + (wasm2js_i32$0 = $0, wasm2js_i32$1 = assembly_index_Body_constructor(4.841431442464721, -1.1603200440274284, -.10362204447112311, .606326392995832, 2.81198684491626, -.02521836165988763, .03769367487038949)), HEAP32[(wasm2js_i32$0 + 4 | 0) >> 2] = wasm2js_i32$1; + (wasm2js_i32$0 = $0, wasm2js_i32$1 = assembly_index_Body_constructor(8.34336671824458, 4.124798564124305, -.4035234171143214, -1.0107743461787924, 1.8256623712304119, .008415761376584154, .011286326131968767)), HEAP32[(wasm2js_i32$0 + 8 | 0) >> 2] = wasm2js_i32$1; + (wasm2js_i32$0 = $0, wasm2js_i32$1 = assembly_index_Body_constructor(12.894369562139131, -15.111151401698631, -.22330757889265573, 1.0827910064415354, .8687130181696082, -.010832637401363636, 1.7237240570597112e-03)), HEAP32[(wasm2js_i32$0 + 12 | 0) >> 2] = wasm2js_i32$1; + (wasm2js_i32$0 = $0, wasm2js_i32$1 = assembly_index_Body_constructor(15.379697114850917, -25.919314609987964, .17925877295037118, .979090732243898, .5946989986476762, -.034755955504078104, 2.0336868699246304e-03)), HEAP32[(wasm2js_i32$0 + 16 | 0) >> 2] = wasm2js_i32$1; + assembly_index_system = assembly_index_NBodySystem_constructor($1); } function assembly_index_NBodySystem_advance($0) { - $0 = $0 | 0; - var $1 = 0, $2 = 0.0, $8 = 0.0, $3 = 0, $4 = 0.0, $5 = 0.0, $6 = 0.0, $7 = 0, $9 = 0.0, $10 = 0.0, $11 = 0.0, $12 = 0, $13 = 0, $18 = 0.0, $14 = 0.0, $15 = 0.0, $16 = 0.0, $17 = 0.0, wasm2js_i32$0 = 0, wasm2js_f64$0 = 0.0; - $12 = HEAPU32[$0 >> 2] | 0; - $13 = HEAP32[($12 + 4 | 0) >> 2] | 0; - repeat_0 : do { - if ($3 >>> 0 < $13 >>> 0) { - $0 = HEAPU32[(((HEAPU32[$12 >> 2] | 0) + ($3 << 2 | 0) | 0) + 8 | 0) >> 2] | 0; - $14 = +HEAPF64[$0 >> 3]; - $15 = +HEAPF64[($0 + 8 | 0) >> 3]; - $16 = +HEAPF64[($0 + 16 | 0) >> 3]; - $4 = +HEAPF64[($0 + 24 | 0) >> 3]; - $5 = +HEAPF64[($0 + 32 | 0) >> 3]; - $6 = +HEAPF64[($0 + 40 | 0) >> 3]; - $17 = +HEAPF64[($0 + 48 | 0) >> 3]; - $7 = $3 + 1 | 0; - repeat_1 : do { - if ($7 >>> 0 < $13 >>> 0) { - $1 = HEAPU32[(((HEAPU32[$12 >> 2] | 0) + ($7 << 2 | 0) | 0) + 8 | 0) >> 2] | 0; - $18 = $14 - +HEAPF64[$1 >> 3]; - $2 = $18; - $9 = $15 - +HEAPF64[($1 + 8 | 0) >> 3]; - $10 = $16 - +HEAPF64[($1 + 16 | 0) >> 3]; - $8 = $2 * $2 + $9 * $9 + $10 * $10; - $11 = Math_sqrt($8); - $11 = .01 / ($8 * $11); - $8 = +HEAPF64[($1 + 48 | 0) >> 3] * $11; - $4 = $4 - $2 * $8; - $5 = $5 - $9 * $8; - $6 = $6 - $10 * $8; + var $1 = 0, $2 = 0.0, $3 = 0.0, $4 = 0, $5 = 0.0, $6 = 0.0, $7 = 0.0, $8 = 0, $9 = 0.0, $10 = 0.0, $11 = 0.0, $12 = 0, $13 = 0, $14 = 0.0, $15 = 0.0, $16 = 0.0, $17 = 0.0; + $12 = HEAP32[$0 >> 2]; + $13 = HEAP32[($12 + 12 | 0) >> 2]; + repeat_0 : while (1) { + if ($4 >>> 0 < $13 >>> 0) { + $0 = HEAP32[(HEAP32[($12 + 4 | 0) >> 2] + ($4 << 2 | 0) | 0) >> 2]; + $14 = HEAPF64[$0 >> 3]; + $15 = HEAPF64[($0 + 8 | 0) >> 3]; + $16 = HEAPF64[($0 + 16 | 0) >> 3]; + $5 = HEAPF64[($0 + 24 | 0) >> 3]; + $6 = HEAPF64[($0 + 32 | 0) >> 3]; + $7 = HEAPF64[($0 + 40 | 0) >> 3]; + $17 = HEAPF64[($0 + 48 | 0) >> 3]; + $8 = $4 + 1 | 0; + repeat_1 : while (1) { + if ($8 >>> 0 < $13 >>> 0) { + $1 = HEAP32[(HEAP32[($12 + 4 | 0) >> 2] + ($8 << 2 | 0) | 0) >> 2]; + $2 = $14 - HEAPF64[$1 >> 3]; + $9 = $15 - HEAPF64[($1 + 8 | 0) >> 3]; + $10 = $16 - HEAPF64[($1 + 16 | 0) >> 3]; + $3 = $2 * $2 + $9 * $9 + $10 * $10; + $11 = Math_sqrt($3); + $11 = .01 / ($3 * $11); + $3 = HEAPF64[($1 + 48 | 0) >> 3] * $11; + $5 = $5 - $2 * $3; + $6 = $6 - $9 * $3; + $7 = $7 - $10 * $3; + $3 = $2; $2 = $17 * $11; - wasm2js_i32$0 = $1; - wasm2js_f64$0 = +HEAPF64[($1 + 24 | 0) >> 3] + $18 * $2; - HEAPF64[(wasm2js_i32$0 + 24 | 0) >> 3] = wasm2js_f64$0; - wasm2js_i32$0 = $1; - wasm2js_f64$0 = +HEAPF64[($1 + 32 | 0) >> 3] + $9 * $2; - HEAPF64[(wasm2js_i32$0 + 32 | 0) >> 3] = wasm2js_f64$0; - wasm2js_i32$0 = $1; - wasm2js_f64$0 = +HEAPF64[($1 + 40 | 0) >> 3] + $10 * $2; - HEAPF64[(wasm2js_i32$0 + 40 | 0) >> 3] = wasm2js_f64$0; - $7 = $7 + 1 | 0; + HEAPF64[($1 + 24 | 0) >> 3] = HEAPF64[($1 + 24 | 0) >> 3] + $3 * $2; + HEAPF64[($1 + 32 | 0) >> 3] = HEAPF64[($1 + 32 | 0) >> 3] + $9 * $2; + HEAPF64[($1 + 40 | 0) >> 3] = HEAPF64[($1 + 40 | 0) >> 3] + $10 * $2; + $8 = $8 + 1 | 0; continue repeat_1; } break repeat_1; - } while (1); - wasm2js_i32$0 = $0; - wasm2js_f64$0 = $4; - HEAPF64[(wasm2js_i32$0 + 24 | 0) >> 3] = wasm2js_f64$0; - wasm2js_i32$0 = $0; - wasm2js_f64$0 = $5; - HEAPF64[(wasm2js_i32$0 + 32 | 0) >> 3] = wasm2js_f64$0; - wasm2js_i32$0 = $0; - wasm2js_f64$0 = $6; - HEAPF64[(wasm2js_i32$0 + 40 | 0) >> 3] = wasm2js_f64$0; - wasm2js_i32$0 = $0; - wasm2js_f64$0 = +HEAPF64[$0 >> 3] + .01 * $4; - HEAPF64[wasm2js_i32$0 >> 3] = wasm2js_f64$0; - wasm2js_i32$0 = $0; - wasm2js_f64$0 = +HEAPF64[($0 + 8 | 0) >> 3] + .01 * $5; - HEAPF64[(wasm2js_i32$0 + 8 | 0) >> 3] = wasm2js_f64$0; - wasm2js_i32$0 = $0; - wasm2js_f64$0 = +HEAPF64[($0 + 16 | 0) >> 3] + .01 * $6; - HEAPF64[(wasm2js_i32$0 + 16 | 0) >> 3] = wasm2js_f64$0; - $3 = $3 + 1 | 0; + }; + HEAPF64[($0 + 24 | 0) >> 3] = $5; + HEAPF64[($0 + 32 | 0) >> 3] = $6; + HEAPF64[($0 + 40 | 0) >> 3] = $7; + HEAPF64[$0 >> 3] = HEAPF64[$0 >> 3] + .01 * $5; + HEAPF64[($0 + 8 | 0) >> 3] = HEAPF64[($0 + 8 | 0) >> 3] + .01 * $6; + HEAPF64[($0 + 16 | 0) >> 3] = HEAPF64[($0 + 16 | 0) >> 3] + .01 * $7; + $4 = $4 + 1 | 0; continue repeat_0; } break repeat_0; - } while (1); + }; } function assembly_index_NBodySystem_energy($0) { - $0 = $0 | 0; - var $1 = 0.0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $10 = 0.0, $6 = 0.0, $7 = 0.0, $8 = 0.0, $9 = 0.0, $30 = 0.0, $39 = 0.0, $45 = 0.0, $69 = 0.0, $84 = 0.0; - $4 = HEAPU32[$0 >> 2] | 0; - $5 = HEAP32[($4 + 4 | 0) >> 2] | 0; - repeat_0 : do { - if ($2 >>> 0 < $5 >>> 0) { - $0 = HEAPU32[(((HEAPU32[$4 >> 2] | 0) + ($2 << 2 | 0) | 0) + 8 | 0) >> 2] | 0; - $7 = +HEAPF64[$0 >> 3]; - $8 = +HEAPF64[($0 + 8 | 0) >> 3]; - $9 = +HEAPF64[($0 + 16 | 0) >> 3]; - $30 = $1; - $10 = +HEAPF64[($0 + 48 | 0) >> 3]; - $1 = +HEAPF64[($0 + 24 | 0) >> 3]; - $39 = $1 * $1; - $1 = +HEAPF64[($0 + 32 | 0) >> 3]; - $45 = $39 + $1 * $1; - $1 = +HEAPF64[($0 + 40 | 0) >> 3]; - $1 = $30 + .5 * $10 * ($45 + $1 * $1); - $0 = $2 + 1 | 0; - repeat_1 : do { - if ($0 >>> 0 < $5 >>> 0) { - $3 = HEAPU32[(((HEAPU32[$4 >> 2] | 0) + ($0 << 2 | 0) | 0) + 8 | 0) >> 2] | 0; - $6 = $7 - +HEAPF64[$3 >> 3]; - $69 = $1; - $1 = $8 - +HEAPF64[($3 + 8 | 0) >> 3]; - $84 = $6 * $6 + $1 * $1; - $1 = $9 - +HEAPF64[($3 + 16 | 0) >> 3]; - $1 = $69 - $10 * +HEAPF64[($3 + 48 | 0) >> 3] / Math_sqrt($84 + $1 * $1); + var $1 = 0.0, $2 = 0.0, $3 = 0, $4 = 0, $5 = 0, $6 = 0.0, $7 = 0, $8 = 0.0, $9 = 0.0, $10 = 0.0, $11 = 0.0; + $5 = HEAP32[$0 >> 2]; + $7 = HEAP32[($5 + 12 | 0) >> 2]; + repeat_0 : while (1) { + if ($3 >>> 0 < $7 >>> 0) { + $0 = HEAP32[(HEAP32[($5 + 4 | 0) >> 2] + ($3 << 2 | 0) | 0) >> 2]; + $9 = HEAPF64[$0 >> 3]; + $10 = HEAPF64[($0 + 8 | 0) >> 3]; + $11 = HEAPF64[($0 + 16 | 0) >> 3]; + $6 = $1; + $8 = HEAPF64[($0 + 48 | 0) >> 3]; + $1 = HEAPF64[($0 + 24 | 0) >> 3]; + $2 = $1 * $1; + $1 = HEAPF64[($0 + 32 | 0) >> 3]; + $2 = $2 + $1 * $1; + $1 = HEAPF64[($0 + 40 | 0) >> 3]; + $1 = $6 + .5 * $8 * ($2 + $1 * $1); + $0 = $3 + 1 | 0; + repeat_1 : while (1) { + if ($0 >>> 0 < $7 >>> 0) { + $4 = HEAP32[(HEAP32[($5 + 4 | 0) >> 2] + ($0 << 2 | 0) | 0) >> 2]; + $6 = $1; + $1 = $9 - HEAPF64[$4 >> 3]; + $2 = $1 * $1; + $1 = $10 - HEAPF64[($4 + 8 | 0) >> 3]; + $2 = $2 + $1 * $1; + $1 = $11 - HEAPF64[($4 + 16 | 0) >> 3]; + $1 = $6 - $8 * HEAPF64[($4 + 48 | 0) >> 3] / Math_sqrt($2 + $1 * $1); $0 = $0 + 1 | 0; continue repeat_1; } break repeat_1; - } while (1); - $2 = $2 + 1 | 0; + }; + $3 = $3 + 1 | 0; continue repeat_0; } break repeat_0; - } while (1); - return +$1; + }; + return $1; } function assembly_index_step() { - assembly_index_NBodySystem_advance(assembly_index_system | 0); - return +(+assembly_index_NBodySystem_energy(assembly_index_system | 0)); + assembly_index_NBodySystem_advance(assembly_index_system); + return +assembly_index_NBodySystem_energy(assembly_index_system); } function assembly_index_bench($0) { $0 = $0 | 0; var $1 = 0; - break_0 : { - repeat_0 : do { - if ($1 >>> 0 >= $0 >>> 0) break break_0; - assembly_index_NBodySystem_advance(assembly_index_system | 0); + repeat_0 : while (1) { + if (!($1 >>> 0 >= $0 >>> 0)) { + assembly_index_NBodySystem_advance(assembly_index_system); $1 = $1 + 1 | 0; continue repeat_0; - break repeat_0; - } while (1); + } + break repeat_0; }; } function assembly_index_getBody($0) { $0 = $0 | 0; - var $1 = 0, $22 = 0, $20 = 0; - $1 = HEAPU32[assembly_index_system >> 2] | 0; - if ($0 >>> 0 < (HEAP32[($1 + 4 | 0) >> 2] | 0) >>> 0) { - $1 = HEAPU32[$1 >> 2] | 0; - if ($0 >>> 0 < ((HEAP32[$1 >> 2] | 0) >>> 2 | 0) >>> 0) $20 = HEAPU32[((($0 << 2 | 0) + $1 | 0) + 8 | 0) >> 2] | 0; else abort(); - $22 = $20; - } else $22 = 0; - return $22 | 0; + var $1 = 0; + $1 = HEAP32[assembly_index_system >> 2]; + if ($0 >>> 0 < HEAP32[($1 + 12 | 0) >> 2] >>> 0) { + $0 = HEAP32[(HEAP32[($1 + 4 | 0) >> 2] + ($0 << 2 | 0) | 0) >> 2] + } else { + $0 = 0 + } + return $0 | 0; } function start() { - $lib_allocator_arena_startOffset = 40; - $lib_allocator_arena_offset = $lib_allocator_arena_startOffset; - } - - function null_() { - + $lib_rt_stub_startOffset = 16; + $lib_rt_stub_offset = $lib_rt_stub_startOffset; } - var FUNCTION_TABLE_v = [null_]; - function __wasm_grow_memory(pagesToAdd) { + var FUNCTION_TABLE = []; + function __wasm_memory_grow(pagesToAdd) { pagesToAdd = pagesToAdd | 0; - var oldPages = __wasm_current_memory() | 0; + var oldPages = __wasm_memory_size() | 0; var newPages = oldPages + pagesToAdd | 0; if ((oldPages < newPages) && (newPages < 65536)) { var newBuffer = new ArrayBuffer(Math_imul(newPages, 65536)); var newHEAP8 = new global.Int8Array(newBuffer); newHEAP8.set(HEAP8); HEAP8 = newHEAP8; + HEAP8 = new global.Int8Array(newBuffer); HEAP16 = new global.Int16Array(newBuffer); HEAP32 = new global.Int32Array(newBuffer); HEAPU8 = new global.Uint8Array(newBuffer); @@ -453,49 +258,33 @@ function asmFunc(global, env, buffer) { return oldPages; } - function __wasm_current_memory() { + function __wasm_memory_size() { return buffer.byteLength / 65536 | 0; } return { - memory: Object.create(Object.prototype, { - grow: { - value: __wasm_grow_memory + "memory": Object.create(Object.prototype, { + "grow": { + "value": __wasm_memory_grow }, - buffer: { - get: function () { + "buffer": { + "get": function () { return buffer; } } }), - init: assembly_index_init, - step: assembly_index_step, - bench: assembly_index_bench, - getBody: assembly_index_getBody + "init": assembly_index_init, + "step": assembly_index_step, + "bench": assembly_index_bench, + "getBody": assembly_index_getBody }; } -const memasmFunc = new ArrayBuffer(65536); -const assignasmFunc = ( - function(mem) { - const _mem = new Uint8Array(mem); - return function(offset, s) { - if (typeof Buffer === 'undefined') { - const bytes = atob(s); - for (let i = 0; i < bytes.length; i++) - _mem[offset + i] = bytes.charCodeAt(i); - } else { - const bytes = Buffer.from(s, 'base64'); - for (let i = 0; i < bytes.length; i++) - _mem[offset + i] = bytes[i]; - } - } - } - )(memasmFunc); -assignasmFunc(8, "DQAAAH4AbABpAGIALwBhAHIAcgBhAHkALgB0AHM="); -const retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); -export const memory = retasmFunc.memory; -export const init = retasmFunc.init; -export const step = retasmFunc.step; -export const bench = retasmFunc.bench; +var memasmFunc = new ArrayBuffer(65536); +var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +exports.memory = retasmFunc.memory; +exports.init = retasmFunc.init; +exports.step = retasmFunc.step; +exports.bench = retasmFunc.bench; +exports.getBody = retasmFunc.getBody; diff --git a/examples/n-body/build/index.js b/examples/n-body/build/index.js index 820b3773ed..ca3ead7976 100644 --- a/examples/n-body/build/index.js +++ b/examples/n-body/build/index.js @@ -49,7 +49,7 @@ class NBodySystem { py += b.vy * m; pz += b.vz * m; } - bodies[0].offsetMomentum(px, py, pz); + unchecked(bodies[0]).offsetMomentum(px, py, pz); } advance(dt) { var bodies = this.bodies; @@ -139,6 +139,6 @@ function bench(steps) { exports.bench = bench; function getBody(index) { var bodies = system.bodies; - return index < bodies.length ? bodies[index] : null; + return index < bodies.length ? unchecked(bodies[index]) : null; } exports.getBody = getBody; diff --git a/examples/n-body/build/optimized.wasm b/examples/n-body/build/optimized.wasm index e299a57663..a4fa268fd8 100644 Binary files a/examples/n-body/build/optimized.wasm and b/examples/n-body/build/optimized.wasm differ diff --git a/examples/n-body/build/optimized.wat b/examples/n-body/build/optimized.wat index de9adc85e5..e0b5e0820e 100644 --- a/examples/n-body/build/optimized.wat +++ b/examples/n-body/build/optimized.wat @@ -1,37 +1,37 @@ (module (type $FUNCSIG$v (func)) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$d (func (result f64))) (type $FUNCSIG$di (func (param i32) (result f64))) - (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$iddddddd (func (param f64 f64 f64 f64 f64 f64 f64) (result i32))) (type $FUNCSIG$i (func (result i32))) - (import "env" "memory" (memory $0 1)) - (data (i32.const 8) "\0d\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) + (import "env" "memory" (memory $0 0)) (global $assembly/index/system (mut i32) (i32.const 0)) + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "init" (func $assembly/index/init)) (export "step" (func $assembly/index/step)) (export "bench" (func $assembly/index/bench)) (export "getBody" (func $assembly/index/getBody)) (start $start) - (func $~lib/allocator/arena/__memory_allocate (; 0 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/rt/stub/__alloc (; 0 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) + (local $4 i32) + (local $5 i32) local.get $0 - i32.const 1073741824 + i32.const 1073741808 i32.gt_u if unreachable end - global.get $~lib/allocator/arena/offset - local.tee $1 + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.tee $3 local.get $0 i32.const 1 local.get $0 @@ -39,20 +39,20 @@ i32.gt_u select i32.add - i32.const 7 + i32.const 15 i32.add - i32.const -8 + i32.const -16 i32.and local.tee $2 - current_memory - local.tee $3 + memory.size + local.tee $4 i32.const 16 i32.shl i32.gt_u if - local.get $3 + local.get $4 local.get $2 - local.get $1 + local.get $3 i32.sub i32.const 65535 i32.add @@ -60,17 +60,17 @@ i32.and i32.const 16 i32.shr_u - local.tee $0 - local.get $3 - local.get $0 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select - grow_memory + memory.grow i32.const 0 i32.lt_s if - local.get $0 - grow_memory + local.get $5 + memory.grow i32.const 0 i32.lt_s if @@ -79,8 +79,17 @@ end end local.get $2 - global.set $~lib/allocator/arena/offset + global.set $~lib/rt/stub/offset + local.get $3 + i32.const 16 + i32.sub + local.tee $2 local.get $1 + i32.store offset=8 + local.get $2 + local.get $0 + i32.store offset=12 + local.get $3 ) (func $assembly/index/NBodySystem#constructor (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) @@ -91,7 +100,7 @@ (local $6 f64) (local $7 i32) local.get $0 - i32.load offset=4 + i32.load offset=12 local.set $7 loop $repeat|0 local.get $1 @@ -99,12 +108,12 @@ i32.lt_s if local.get $0 - i32.load + i32.load offset=4 local.get $1 i32.const 2 i32.shl i32.add - i32.load offset=8 + i32.load local.tee $2 f64.load offset=48 local.set $3 @@ -136,21 +145,10 @@ br $repeat|0 end end - i32.const 0 local.get $0 + i32.load offset=4 i32.load local.tee $1 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $1 - i32.load offset=8 - else - unreachable - end - local.tee $1 local.get $4 f64.neg f64.const 39.47841760435743 @@ -169,7 +167,8 @@ f64.div f64.store offset=40 i32.const 4 - call $~lib/allocator/arena/__memory_allocate + i32.const 3 + call $~lib/rt/stub/__alloc local.tee $1 local.get $0 i32.store @@ -178,7 +177,8 @@ (func $assembly/index/Body#constructor (; 2 ;) (type $FUNCSIG$iddddddd) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 f64) (param $5 f64) (param $6 f64) (result i32) (local $7 i32) i32.const 56 - call $~lib/allocator/arena/__memory_allocate + i32.const 4 + call $~lib/rt/stub/__alloc local.tee $7 local.get $0 f64.store @@ -202,232 +202,36 @@ f64.store offset=48 local.get $7 ) - (func $~lib/internal/memory/memset (; 3 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/__allocArray (; 3 ;) (type $FUNCSIG$i) (result i32) + (local $0 i32) (local $1 i32) - (local $2 i32) - local.get $0 - i32.const 0 - i32.store8 - local.get $0 - i32.const 20 - i32.add - local.tee $1 - i32.const 1 - i32.sub - i32.const 0 - i32.store8 - local.get $0 - i32.const 1 - i32.add - i32.const 0 - i32.store8 - local.get $0 - i32.const 2 - i32.add - i32.const 0 - i32.store8 - local.get $1 - i32.const 2 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 3 - i32.sub - i32.const 0 - i32.store8 - local.get $0 - i32.const 3 - i32.add - i32.const 0 - i32.store8 - local.get $1 - i32.const 4 - i32.sub - i32.const 0 - i32.store8 - i32.const 0 - local.get $0 - i32.sub - i32.const 3 - i32.and - local.tee $1 - local.get $0 - i32.add - local.tee $0 - i32.const 0 - i32.store - i32.const 20 - local.get $1 - i32.sub - i32.const -4 - i32.and - local.tee $2 - local.get $0 - i32.add - i32.const 4 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 8 - i32.le_u - if - return - end - local.get $0 - i32.const 4 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 8 - i32.add - i32.const 0 - i32.store - local.get $0 - local.get $2 - i32.add - local.tee $1 - i32.const 12 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 8 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 24 - i32.le_u - if - return - end - local.get $0 - i32.const 12 - i32.add - i32.const 0 - i32.store - local.get $0 i32.const 16 - i32.add - i32.const 0 - i32.store - local.get $0 + i32.const 5 + call $~lib/rt/stub/__alloc + local.tee $0 i32.const 20 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 24 - i32.add i32.const 0 - i32.store - local.get $0 - local.get $2 - i32.add + call $~lib/rt/stub/__alloc local.tee $1 - i32.const 28 - i32.sub - i32.const 0 i32.store - local.get $1 - i32.const 24 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 20 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 16 - i32.sub - i32.const 0 - i32.store - local.get $0 - i32.const 4 - i32.and - i32.const 24 - i32.add - local.tee $1 local.get $0 - i32.add - local.set $0 - local.get $2 local.get $1 - i32.sub - local.set $2 - loop $continue|0 - local.get $2 - i32.const 32 - i32.ge_u - if - local.get $0 - i64.const 0 - i64.store - local.get $0 - i32.const 8 - i32.add - i64.const 0 - i64.store - local.get $0 - i32.const 16 - i32.add - i64.const 0 - i64.store - local.get $0 - i32.const 24 - i32.add - i64.const 0 - i64.store - local.get $2 - i32.const 32 - i32.sub - local.set $2 - local.get $0 - i32.const 32 - i32.add - local.set $0 - br $continue|0 - end - end - ) - (func $~lib/array/Array#constructor (; 4 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) - (local $1 i32) - i32.const 32 - call $~lib/allocator/arena/__memory_allocate - local.tee $1 - i32.const 20 - i32.store - i32.const 8 - call $~lib/allocator/arena/__memory_allocate - local.tee $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 i32.store offset=4 local.get $0 - local.get $1 - i32.store + i32.const 20 + i32.store offset=8 local.get $0 i32.const 5 - i32.store offset=4 - local.get $1 - i32.const 8 - i32.add - call $~lib/internal/memory/memset + i32.store offset=12 local.get $0 ) - (func $assembly/index/init (; 5 ;) (type $FUNCSIG$v) + (func $assembly/index/init (; 4 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) - call $~lib/array/Array#constructor - local.set $1 + call $~lib/rt/__allocArray + local.tee $1 + i32.load offset=4 + local.tee $0 f64.const 0 f64.const 0 f64.const 0 @@ -436,11 +240,8 @@ f64.const 0 f64.const 39.47841760435743 call $assembly/index/Body#constructor - local.set $0 - local.get $1 - i32.load + i32.store local.get $0 - i32.store offset=8 f64.const 4.841431442464721 f64.const -1.1603200440274284 f64.const -0.10362204447112311 @@ -449,13 +250,8 @@ f64.const -0.02521836165988763 f64.const 0.03769367487038949 call $assembly/index/Body#constructor - local.set $0 - local.get $1 - i32.load - i32.const 4 - i32.add + i32.store offset=4 local.get $0 - i32.store offset=8 f64.const 8.34336671824458 f64.const 4.124798564124305 f64.const -0.4035234171143214 @@ -464,13 +260,8 @@ f64.const 0.008415761376584154 f64.const 0.011286326131968767 call $assembly/index/Body#constructor - local.set $0 - local.get $1 - i32.load - i32.const 8 - i32.add - local.get $0 i32.store offset=8 + local.get $0 f64.const 12.894369562139131 f64.const -15.111151401698631 f64.const -0.22330757889265573 @@ -479,13 +270,8 @@ f64.const -0.010832637401363636 f64.const 1.7237240570597112e-03 call $assembly/index/Body#constructor - local.set $0 - local.get $1 - i32.load - i32.const 12 - i32.add + i32.store offset=12 local.get $0 - i32.store offset=8 f64.const 15.379697114850917 f64.const -25.919314609987964 f64.const 0.17925877295037118 @@ -494,18 +280,12 @@ f64.const -0.034755955504078104 f64.const 2.0336868699246304e-03 call $assembly/index/Body#constructor - local.set $0 - local.get $1 - i32.load - i32.const 16 - i32.add - local.get $0 - i32.store offset=8 + i32.store offset=16 local.get $1 call $assembly/index/NBodySystem#constructor global.set $assembly/index/system ) - (func $assembly/index/NBodySystem#advance (; 6 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $assembly/index/NBodySystem#advance (; 5 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) (local $2 f64) (local $3 i32) @@ -523,11 +303,10 @@ (local $15 f64) (local $16 f64) (local $17 f64) - (local $18 f64) local.get $0 i32.load local.tee $12 - i32.load offset=4 + i32.load offset=12 local.set $13 loop $repeat|0 local.get $3 @@ -535,12 +314,12 @@ i32.lt_u if local.get $12 - i32.load + i32.load offset=4 local.get $3 i32.const 2 i32.shl i32.add - i32.load offset=8 + i32.load local.tee $0 f64.load local.set $14 @@ -573,16 +352,15 @@ if local.get $14 local.get $12 - i32.load + i32.load offset=4 local.get $7 i32.const 2 i32.shl i32.add - i32.load offset=8 + i32.load local.tee $1 f64.load f64.sub - local.tee $18 local.tee $2 local.get $2 f64.mul @@ -635,7 +413,7 @@ local.get $1 local.get $1 f64.load offset=24 - local.get $18 + local.get $2 local.get $17 local.get $11 f64.mul @@ -707,7 +485,7 @@ end end ) - (func $assembly/index/NBodySystem#energy (; 7 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) + (func $assembly/index/NBodySystem#energy (; 6 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) (local $1 f64) (local $2 i32) (local $3 i32) @@ -721,7 +499,7 @@ local.get $0 i32.load local.tee $4 - i32.load offset=4 + i32.load offset=12 local.set $5 loop $repeat|0 local.get $2 @@ -729,12 +507,12 @@ i32.lt_u if local.get $4 - i32.load + i32.load offset=4 local.get $2 i32.const 2 i32.shl i32.add - i32.load offset=8 + i32.load local.tee $0 f64.load local.set $7 @@ -781,12 +559,12 @@ if local.get $7 local.get $4 - i32.load + i32.load offset=4 local.get $0 i32.const 2 i32.shl i32.add - i32.load offset=8 + i32.load local.tee $3 f64.load f64.sub @@ -835,13 +613,13 @@ end local.get $1 ) - (func $assembly/index/step (; 8 ;) (type $FUNCSIG$d) (result f64) + (func $assembly/index/step (; 7 ;) (type $FUNCSIG$d) (result f64) global.get $assembly/index/system call $assembly/index/NBodySystem#advance global.get $assembly/index/system call $assembly/index/NBodySystem#energy ) - (func $assembly/index/bench (; 9 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $assembly/index/bench (; 8 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) block $break|0 loop $repeat|0 @@ -861,44 +639,33 @@ unreachable end ) - (func $assembly/index/getBody (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $assembly/index/getBody (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 global.get $assembly/index/system i32.load local.tee $1 - i32.load offset=4 + i32.load offset=12 i32.lt_u if (result i32) - local.get $0 local.get $1 - i32.load - local.tee $1 - i32.load + i32.load offset=4 + local.get $0 i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 2 - i32.shl - local.get $1 - i32.add - i32.load offset=8 - else - unreachable - end + i32.shl + i32.add + i32.load else i32.const 0 end ) - (func $start (; 11 ;) (type $FUNCSIG$v) - i32.const 40 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset + (func $start (; 10 ;) (type $FUNCSIG$v) + i32.const 16 + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset ) - (func $null (; 12 ;) (type $FUNCSIG$v) + (func $null (; 11 ;) (type $FUNCSIG$v) nop ) ) diff --git a/examples/n-body/build/untouched.wat b/examples/n-body/build/untouched.wat index 8077faeef7..d30d78e696 100644 --- a/examples/n-body/build/untouched.wat +++ b/examples/n-body/build/untouched.wat @@ -1,105 +1,54 @@ (module (type $FUNCSIG$v (func)) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) - (type $FUNCSIG$iiddd (func (param i32 f64 f64 f64) (result i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$iiddd (func (param i32 f64 f64 f64) (result i32))) (type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$iiddddddd (func (param i32 f64 f64 f64 f64 f64 f64 f64) (result i32))) - (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$iiiii (func (param i32 i32 i32 i32) (result i32))) (type $FUNCSIG$viii (func (param i32 i32 i32))) (type $FUNCSIG$d (func (result f64))) (type $FUNCSIG$vid (func (param i32 f64))) (type $FUNCSIG$di (func (param i32) (result f64))) - (type $FUNCSIG$vi (func (param i32))) - (import "env" "memory" (memory $0 1)) - (data (i32.const 8) "\0d\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") - (data (i32.const 40) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "memory" (memory $0 0)) (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) (global $~lib/math/NativeMath.PI f64 (f64.const 3.141592653589793)) (global $assembly/index/SOLAR_MASS f64 (f64.const 39.47841760435743)) (global $assembly/index/DAYS_PER_YEAR f64 (f64.const 365.24)) (global $assembly/index/system (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 100)) + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) + (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/heap/__heap_base i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "init" (func $assembly/index/init)) (export "step" (func $assembly/index/step)) (export "bench" (func $assembly/index/bench)) (export "getBody" (func $assembly/index/getBody)) (start $start) - (func $start:~lib/allocator/arena (; 1 ;) (type $FUNCSIG$v) - global.get $~lib/memory/HEAP_BASE - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset + (func $~lib/rt/stub/__retain (; 0 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 ) - (func $start:assembly/index (; 2 ;) (type $FUNCSIG$v) - call $start:~lib/allocator/arena + (func $~lib/array/Array#get:length (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=12 ) - (func $~lib/array/Array#__unchecked_get (; 3 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) + (func $~lib/array/Array#__unchecked_get (; 2 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 - i32.load - local.set $2 + i32.load offset=4 local.get $1 - local.set $3 - i32.const 0 - local.set $4 - local.get $2 - local.get $3 i32.const 2 i32.shl i32.add - local.get $4 - i32.add - i32.load offset=8 - ) - (func $~lib/array/Array#__get (; 4 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load - local.set $2 - local.get $1 - local.get $2 i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $2 - local.set $3 - local.get $1 - local.set $4 - i32.const 0 - local.set $5 - local.get $3 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $5 - i32.add - i32.load offset=8 - else - unreachable - end + call $~lib/rt/stub/__retain ) - (func $assembly/index/Body#offsetMomentum (; 5 ;) (type $FUNCSIG$iiddd) (param $0 i32) (param $1 f64) (param $2 f64) (param $3 f64) (result i32) + (func $~lib/rt/stub/__release (; 3 ;) (type $FUNCSIG$vi) (param $0 i32) + nop + ) + (func $assembly/index/Body#offsetMomentum (; 4 ;) (type $FUNCSIG$iiddd) (param $0 i32) (param $1 f64) (param $2 f64) (param $3 f64) (result i32) local.get $0 local.get $1 f64.neg @@ -119,49 +68,53 @@ f64.div f64.store offset=40 local.get $0 + call $~lib/rt/stub/__retain ) - (func $~lib/allocator/arena/__memory_allocate (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/rt/stub/__alloc (; 5 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) + (local $8 i32) local.get $0 - i32.const 1073741824 + i32.const 1073741808 i32.gt_u if unreachable end - global.get $~lib/allocator/arena/offset - local.set $1 - local.get $1 + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.set $2 + local.get $2 local.get $0 - local.tee $2 - i32.const 1 local.tee $3 - local.get $2 + i32.const 1 + local.tee $4 local.get $3 + local.get $4 i32.gt_u select i32.add - i32.const 7 + i32.const 15 i32.add - i32.const 7 + i32.const 15 i32.const -1 i32.xor i32.and - local.set $4 - current_memory local.set $5 - local.get $4 + memory.size + local.set $6 local.get $5 + local.get $6 i32.const 16 i32.shl i32.gt_u if - local.get $4 - local.get $1 + local.get $5 + local.get $2 i32.sub i32.const 65535 i32.add @@ -171,23 +124,23 @@ i32.and i32.const 16 i32.shr_u - local.set $2 - local.get $5 - local.tee $3 - local.get $2 - local.tee $6 - local.get $3 + local.set $3 local.get $6 + local.tee $4 + local.get $3 + local.tee $7 + local.get $4 + local.get $7 i32.gt_s select - local.set $3 - local.get $3 - grow_memory + local.set $4 + local.get $4 + memory.grow i32.const 0 i32.lt_s if - local.get $2 - grow_memory + local.get $3 + memory.grow i32.const 0 i32.lt_s if @@ -195,79 +148,88 @@ end end end - local.get $4 - global.set $~lib/allocator/arena/offset + local.get $5 + global.set $~lib/rt/stub/offset + local.get $2 + i32.const 16 + i32.sub + local.set $8 + local.get $8 local.get $1 - ) - (func $~lib/memory/memory.allocate (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.store offset=8 + local.get $8 local.get $0 - call $~lib/allocator/arena/__memory_allocate - return + i32.store offset=12 + local.get $2 ) - (func $assembly/index/NBodySystem#constructor (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $assembly/index/NBodySystem#constructor (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 f64) (local $3 f64) (local $4 f64) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 f64) + (local $8 i32) + (local $9 f64) + local.get $1 + call $~lib/rt/stub/__retain + drop f64.const 0 local.set $2 f64.const 0 local.set $3 f64.const 0 local.set $4 - block $~lib/array/Array#get:length|inlined.0 (result i32) - local.get $1 - local.set $5 - local.get $5 - i32.load offset=4 - end - local.set $6 + local.get $1 + call $~lib/array/Array#get:length + local.set $5 block $break|0 i32.const 0 - local.set $5 + local.set $6 loop $repeat|0 - local.get $5 local.get $6 + local.get $5 i32.lt_s i32.eqz br_if $break|0 - block - local.get $1 - local.get $5 - call $~lib/array/Array#__unchecked_get - local.set $7 - local.get $7 - f64.load offset=48 - local.set $8 - local.get $2 - local.get $7 - f64.load offset=24 - local.get $8 - f64.mul - f64.add - local.set $2 - local.get $3 - local.get $7 - f64.load offset=32 - local.get $8 - f64.mul - f64.add - local.set $3 - local.get $4 - local.get $7 - f64.load offset=40 - local.get $8 - f64.mul - f64.add - local.set $4 - end - local.get $5 + local.get $1 + local.get $6 + call $~lib/array/Array#__unchecked_get + local.tee $7 + call $~lib/rt/stub/__retain + local.set $8 + local.get $8 + f64.load offset=48 + local.set $9 + local.get $2 + local.get $8 + f64.load offset=24 + local.get $9 + f64.mul + f64.add + local.set $2 + local.get $3 + local.get $8 + f64.load offset=32 + local.get $9 + f64.mul + f64.add + local.set $3 + local.get $4 + local.get $8 + f64.load offset=40 + local.get $9 + f64.mul + f64.add + local.set $4 + local.get $7 + call $~lib/rt/stub/__release + local.get $8 + call $~lib/rt/stub/__release + local.get $6 i32.const 1 i32.add - local.set $5 + local.set $6 br $repeat|0 unreachable end @@ -275,17 +237,20 @@ end local.get $1 i32.const 0 - call $~lib/array/Array#__get + call $~lib/array/Array#__unchecked_get + local.tee $8 local.get $2 local.get $3 local.get $4 call $assembly/index/Body#offsetMomentum - drop + call $~lib/rt/stub/__release local.get $0 i32.eqz if i32.const 4 - call $~lib/memory/memory.allocate + i32.const 3 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain local.set $0 end local.get $0 @@ -293,12 +258,14 @@ i32.store local.get $0 ) - (func $assembly/index/Body#constructor (; 9 ;) (type $FUNCSIG$iiddddddd) (param $0 i32) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 f64) (param $5 f64) (param $6 f64) (param $7 f64) (result i32) + (func $assembly/index/Body#constructor (; 7 ;) (type $FUNCSIG$iiddddddd) (param $0 i32) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 f64) (param $5 f64) (param $6 f64) (param $7 f64) (result i32) local.get $0 i32.eqz if i32.const 56 - call $~lib/memory/memory.allocate + i32.const 4 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain local.set $0 end local.get $0 @@ -324,7 +291,7 @@ f64.store offset=48 local.get $0 ) - (func $assembly/index/Sun (; 10 ;) (type $FUNCSIG$i) (result i32) + (func $assembly/index/Sun (; 8 ;) (type $FUNCSIG$i) (result i32) i32.const 0 f64.const 0 f64.const 0 @@ -335,7 +302,7 @@ global.get $assembly/index/SOLAR_MASS call $assembly/index/Body#constructor ) - (func $assembly/index/Jupiter (; 11 ;) (type $FUNCSIG$i) (result i32) + (func $assembly/index/Jupiter (; 9 ;) (type $FUNCSIG$i) (result i32) i32.const 0 f64.const 4.841431442464721 f64.const -1.1603200440274284 @@ -354,7 +321,7 @@ f64.mul call $assembly/index/Body#constructor ) - (func $assembly/index/Saturn (; 12 ;) (type $FUNCSIG$i) (result i32) + (func $assembly/index/Saturn (; 10 ;) (type $FUNCSIG$i) (result i32) i32.const 0 f64.const 8.34336671824458 f64.const 4.124798564124305 @@ -373,7 +340,7 @@ f64.mul call $assembly/index/Body#constructor ) - (func $assembly/index/Uranus (; 13 ;) (type $FUNCSIG$i) (result i32) + (func $assembly/index/Uranus (; 11 ;) (type $FUNCSIG$i) (result i32) i32.const 0 f64.const 12.894369562139131 f64.const -15.111151401698631 @@ -392,7 +359,7 @@ f64.mul call $assembly/index/Body#constructor ) - (func $assembly/index/Neptune (; 14 ;) (type $FUNCSIG$i) (result i32) + (func $assembly/index/Neptune (; 12 ;) (type $FUNCSIG$i) (result i32) i32.const 0 f64.const 15.379697114850917 f64.const -25.919314609987964 @@ -411,681 +378,1797 @@ f64.mul call $assembly/index/Body#constructor ) - (func $~lib/internal/arraybuffer/computeSize (; 15 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 1 - i32.const 32 - local.get $0 - i32.const 8 - i32.add - i32.const 1 - i32.sub - i32.clz - i32.sub - i32.shl - ) - (func $~lib/internal/arraybuffer/allocateUnsafe (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - local.get $0 - i32.const 1073741816 - i32.le_u - i32.eqz - if - i32.const 0 - i32.const 40 - i32.const 26 - i32.const 2 - call $~lib/env/abort - unreachable - end - block $~lib/memory/memory.allocate|inlined.0 (result i32) - local.get $0 - call $~lib/internal/arraybuffer/computeSize - local.set $2 - local.get $2 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.0 - end - local.set $1 - local.get $1 - local.get $0 - i32.store - local.get $1 - ) - (func $~lib/internal/memory/memset (; 17 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/memory/memcpy (; 13 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - (local $5 i64) - local.get $2 - i32.eqz - if - return - end - local.get $0 - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 1 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 2 - i32.le_u - if - return - end - local.get $0 - i32.const 1 - i32.add - local.get $1 - i32.store8 - local.get $0 - i32.const 2 - i32.add - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 2 - i32.sub - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 3 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 6 - i32.le_u - if - return - end - local.get $0 - i32.const 3 - i32.add - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 4 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 8 - i32.le_u - if - return + (local $5 i32) + block $break|0 + loop $continue|0 + local.get $2 + if (result i32) + local.get $1 + i32.const 3 + i32.and + else + i32.const 0 + end + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $continue|0 + end + end end - i32.const 0 local.get $0 - i32.sub i32.const 3 i32.and - local.set $3 - local.get $0 - local.get $3 - i32.add - local.set $0 - local.get $2 - local.get $3 - i32.sub - local.set $2 - local.get $2 - i32.const -4 - i32.and - local.set $2 - i32.const -1 - i32.const 255 - i32.div_u - local.get $1 - i32.const 255 - i32.and - i32.mul - local.set $4 - local.get $0 - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 4 - i32.sub - local.get $4 - i32.store - local.get $2 - i32.const 8 - i32.le_u - if - return - end - local.get $0 - i32.const 4 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 12 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 8 - i32.sub - local.get $4 - i32.store - local.get $2 - i32.const 24 - i32.le_u + i32.const 0 + i32.eq if - return - end - local.get $0 - i32.const 12 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 16 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 20 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 24 - i32.add - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 28 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 24 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 20 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 16 - i32.sub - local.get $4 - i32.store - i32.const 24 - local.get $0 - i32.const 4 - i32.and - i32.add - local.set $3 - local.get $0 - local.get $3 - i32.add - local.set $0 - local.get $2 - local.get $3 - i32.sub - local.set $2 - local.get $4 - i64.extend_i32_u - local.get $4 - i64.extend_i32_u - i64.const 32 - i64.shl - i64.or - local.set $5 - block $break|0 - loop $continue|0 - local.get $2 - i32.const 32 - i32.ge_u - if - block + block $break|1 + loop $continue|1 + local.get $2 + i32.const 16 + i32.ge_u + if local.get $0 - local.get $5 - i64.store + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store local.get $0 i32.const 8 i32.add - local.get $5 - i64.store + local.get $1 + i32.const 8 + i32.add + i32.load + i32.store local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 12 + i32.add + i32.load + i32.store + local.get $1 i32.const 16 i32.add - local.get $5 - i64.store + local.set $1 local.get $0 - i32.const 24 + i32.const 16 i32.add - local.get $5 - i64.store + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|1 + end + end + end + local.get $2 + i32.const 8 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + end + local.get $2 + i32.const 4 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.set $0 + local.get $1 + i32.const 4 + i32.add + local.set $1 + end + local.get $2 + i32.const 2 + i32.and + if + local.get $0 + local.get $1 + i32.load16_u + i32.store16 + local.get $0 + i32.const 2 + i32.add + local.set $0 + local.get $1 + i32.const 2 + i32.add + local.set $1 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + return + end + local.get $2 + i32.const 32 + i32.ge_u + if + block $break|2 + block $case2|2 + block $case1|2 + block $case0|2 + local.get $0 + i32.const 3 + i32.and + local.set $5 + local.get $5 + i32.const 1 + i32.eq + br_if $case0|2 + local.get $5 + i32.const 2 + i32.eq + br_if $case1|2 + local.get $5 + i32.const 3 + i32.eq + br_if $case2|2 + br $break|2 + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 3 + i32.sub + local.set $2 + block $break|3 + loop $continue|3 + local.get $2 + i32.const 17 + i32.ge_u + if + local.get $1 + i32.const 1 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 5 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 9 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 13 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|3 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 local.get $2 - i32.const 32 + i32.const 2 i32.sub local.set $2 + block $break|4 + loop $continue|4 + local.get $2 + i32.const 18 + i32.ge_u + if + local.get $1 + i32.const 2 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 6 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 10 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 14 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|4 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) local.get $0 - i32.const 32 + local.tee $5 + i32.const 1 i32.add local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + block $break|5 + loop $continue|5 + local.get $2 + i32.const 19 + i32.ge_u + if + local.get $1 + i32.const 3 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 7 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 11 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 15 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|5 + end + end + end + br $break|2 + unreachable + end + unreachable + end + end + local.get $2 + i32.const 16 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 8 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 4 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 2 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + ) + (func $~lib/memory/memory.copy (; 14 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $4 + local.get $3 + i32.add + local.get $5 + i32.le_u + if (result i32) + i32.const 1 + else + local.get $5 + local.get $3 + i32.add + local.get $4 + i32.le_u + end + if + local.get $5 + local.get $4 + local.get $3 + call $~lib/util/memory/memcpy + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end end - br $continue|0 end end end ) - (func $~lib/array/Array#constructor (; 18 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) + (func $~lib/rt/__allocArray (; 15 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) - local.get $1 - i32.const 268435454 - i32.gt_u - if - i32.const 0 - i32.const 8 - i32.const 45 - i32.const 39 - call $~lib/env/abort - unreachable - end - local.get $1 - i32.const 2 - i32.shl - local.set $2 + i32.const 16 local.get $2 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $3 - block (result i32) - local.get $0 - i32.eqz - if - i32.const 8 - call $~lib/memory/memory.allocate - local.set $0 - end - local.get $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - end - local.get $3 - i32.store - local.get $0 - local.get $1 - i32.store offset=4 - block $~lib/memory/memory.fill|inlined.0 - local.get $3 - i32.const 8 - i32.add - local.set $4 - i32.const 0 - local.set $5 - local.get $2 - local.set $6 - local.get $4 - local.get $5 - local.get $6 - call $~lib/internal/memory/memset - end - local.get $0 - ) - (func $~lib/array/Array#__unchecked_set (; 19 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) + call $~lib/rt/stub/__alloc + local.set $4 local.get $0 - i32.load - local.set $3 local.get $1 - local.set $4 - local.get $2 + i32.shl local.set $5 + local.get $5 i32.const 0 + call $~lib/rt/stub/__alloc local.set $6 - local.get $3 local.get $4 - i32.const 2 - i32.shl - i32.add local.get $6 - i32.add + call $~lib/rt/stub/__retain + i32.store + local.get $4 + local.get $6 + i32.store offset=4 + local.get $4 local.get $5 i32.store offset=8 + local.get $4 + local.get $0 + i32.store offset=12 + local.get $3 + if + local.get $6 + local.get $3 + local.get $5 + call $~lib/memory/memory.copy + end + local.get $4 ) - (func $assembly/index/init (; 20 ;) (type $FUNCSIG$v) + (func $assembly/index/init (; 16 ;) (type $FUNCSIG$v) (local $0 i32) - i32.const 0 + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) block (result i32) i32.const 0 - i32.const 5 - call $~lib/array/Array#constructor + block (result i32) + i32.const 5 + i32.const 2 + i32.const 5 + i32.const 0 + call $~lib/rt/__allocArray + local.set $0 + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + call $assembly/index/Sun + local.tee $2 + call $~lib/rt/stub/__retain + i32.store + local.get $1 + call $assembly/index/Jupiter + local.tee $3 + call $~lib/rt/stub/__retain + i32.store offset=4 + local.get $1 + call $assembly/index/Saturn + local.tee $4 + call $~lib/rt/stub/__retain + i32.store offset=8 + local.get $1 + call $assembly/index/Uranus + local.tee $5 + call $~lib/rt/stub/__retain + i32.store offset=12 + local.get $1 + call $assembly/index/Neptune + local.tee $6 + call $~lib/rt/stub/__retain + i32.store offset=16 + local.get $0 + end + call $assembly/index/NBodySystem#constructor local.set $0 - local.get $0 - i32.const 0 - call $assembly/index/Sun - call $~lib/array/Array#__unchecked_set - local.get $0 - i32.const 1 - call $assembly/index/Jupiter - call $~lib/array/Array#__unchecked_set - local.get $0 - i32.const 2 - call $assembly/index/Saturn - call $~lib/array/Array#__unchecked_set - local.get $0 - i32.const 3 - call $assembly/index/Uranus - call $~lib/array/Array#__unchecked_set - local.get $0 - i32.const 4 - call $assembly/index/Neptune - call $~lib/array/Array#__unchecked_set + global.get $assembly/index/system + call $~lib/rt/stub/__release local.get $0 end - call $assembly/index/NBodySystem#constructor global.set $assembly/index/system + local.get $2 + call $~lib/rt/stub/__release + local.get $3 + call $~lib/rt/stub/__release + local.get $4 + call $~lib/rt/stub/__release + local.get $5 + call $~lib/rt/stub/__release + local.get $6 + call $~lib/rt/stub/__release ) - (func $assembly/index/NBodySystem#advance (; 21 ;) (type $FUNCSIG$vid) (param $0 i32) (param $1 f64) + (func $assembly/index/NBodySystem#advance (; 17 ;) (type $FUNCSIG$vid) (param $0 i32) (param $1 f64) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 f64) + (local $6 i32) (local $7 f64) (local $8 f64) (local $9 f64) (local $10 f64) (local $11 f64) (local $12 f64) - (local $13 i32) + (local $13 f64) (local $14 i32) - (local $15 f64) - (local $16 f64) + (local $15 i32) + (local $16 i32) (local $17 f64) (local $18 f64) (local $19 f64) (local $20 f64) (local $21 f64) (local $22 f64) + (local $23 f64) + (local $24 f64) local.get $0 i32.load + call $~lib/rt/stub/__retain local.set $2 - block $~lib/array/Array#get:length|inlined.1 (result i32) - local.get $2 - local.set $3 - local.get $3 - i32.load offset=4 - end - local.set $4 + local.get $2 + call $~lib/array/Array#get:length + local.set $3 block $break|0 i32.const 0 - local.set $3 + local.set $4 loop $repeat|0 - local.get $3 local.get $4 + local.get $3 i32.lt_u i32.eqz br_if $break|0 - block - local.get $2 - local.get $3 - call $~lib/array/Array#__unchecked_get - local.set $5 - local.get $5 - f64.load - local.set $6 - local.get $5 - f64.load offset=8 - local.set $7 - local.get $5 - f64.load offset=16 - local.set $8 - local.get $5 - f64.load offset=24 - local.set $9 - local.get $5 - f64.load offset=32 - local.set $10 - local.get $5 - f64.load offset=40 - local.set $11 - local.get $5 - f64.load offset=48 - local.set $12 - block $break|1 + local.get $2 + local.get $4 + call $~lib/array/Array#__unchecked_get + local.tee $5 + call $~lib/rt/stub/__retain + local.set $6 + local.get $6 + f64.load + local.set $7 + local.get $6 + f64.load offset=8 + local.set $8 + local.get $6 + f64.load offset=16 + local.set $9 + local.get $6 + f64.load offset=24 + local.set $10 + local.get $6 + f64.load offset=32 + local.set $11 + local.get $6 + f64.load offset=40 + local.set $12 + local.get $6 + f64.load offset=48 + local.set $13 + block $break|1 + local.get $4 + i32.const 1 + i32.add + local.set $14 + loop $repeat|1 + local.get $14 local.get $3 + i32.lt_u + i32.eqz + br_if $break|1 + local.get $2 + local.get $14 + call $~lib/array/Array#__unchecked_get + local.tee $15 + call $~lib/rt/stub/__retain + local.set $16 + local.get $7 + local.get $16 + f64.load + f64.sub + local.set $17 + local.get $8 + local.get $16 + f64.load offset=8 + f64.sub + local.set $18 + local.get $9 + local.get $16 + f64.load offset=16 + f64.sub + local.set $19 + local.get $17 + local.get $17 + f64.mul + local.get $18 + local.get $18 + f64.mul + f64.add + local.get $19 + local.get $19 + f64.mul + f64.add + local.set $20 + block $~lib/math/NativeMath.sqrt|inlined.0 (result f64) + local.get $20 + local.set $21 + local.get $21 + f64.sqrt + end + local.set $21 + local.get $1 + local.get $20 + local.get $21 + f64.mul + f64.div + local.set $22 + local.get $13 + local.get $22 + f64.mul + local.set $23 + local.get $16 + f64.load offset=48 + local.get $22 + f64.mul + local.set $24 + local.get $10 + local.get $17 + local.get $24 + f64.mul + f64.sub + local.set $10 + local.get $11 + local.get $18 + local.get $24 + f64.mul + f64.sub + local.set $11 + local.get $12 + local.get $19 + local.get $24 + f64.mul + f64.sub + local.set $12 + local.get $16 + local.get $16 + f64.load offset=24 + local.get $17 + local.get $23 + f64.mul + f64.add + f64.store offset=24 + local.get $16 + local.get $16 + f64.load offset=32 + local.get $18 + local.get $23 + f64.mul + f64.add + f64.store offset=32 + local.get $16 + local.get $16 + f64.load offset=40 + local.get $19 + local.get $23 + f64.mul + f64.add + f64.store offset=40 + local.get $15 + call $~lib/rt/stub/__release + local.get $16 + call $~lib/rt/stub/__release + local.get $14 i32.const 1 i32.add - local.set $13 - loop $repeat|1 - local.get $13 - local.get $4 - i32.lt_u - i32.eqz - br_if $break|1 - block - local.get $2 - local.get $13 - call $~lib/array/Array#__unchecked_get - local.set $14 - local.get $6 - local.get $14 - f64.load - f64.sub - local.set $15 - local.get $7 - local.get $14 - f64.load offset=8 - f64.sub - local.set $16 - local.get $8 - local.get $14 - f64.load offset=16 - f64.sub - local.set $17 - local.get $15 - local.get $15 - f64.mul - local.get $16 - local.get $16 - f64.mul - f64.add - local.get $17 - local.get $17 - f64.mul - f64.add - local.set $18 - block $~lib/math/NativeMath.sqrt|inlined.0 (result f64) - local.get $18 - local.set $19 - local.get $19 - f64.sqrt - end - local.set $19 - local.get $1 - local.get $18 - local.get $19 - f64.mul - f64.div - local.set $20 - local.get $12 - local.get $20 - f64.mul - local.set $21 - local.get $14 - f64.load offset=48 - local.get $20 - f64.mul - local.set $22 - local.get $9 - local.get $15 - local.get $22 - f64.mul - f64.sub - local.set $9 - local.get $10 - local.get $16 - local.get $22 - f64.mul - f64.sub - local.set $10 - local.get $11 - local.get $17 - local.get $22 - f64.mul - f64.sub - local.set $11 - local.get $14 - local.get $14 - f64.load offset=24 - local.get $15 - local.get $21 - f64.mul - f64.add - f64.store offset=24 - local.get $14 - local.get $14 - f64.load offset=32 - local.get $16 - local.get $21 - f64.mul - f64.add - f64.store offset=32 - local.get $14 - local.get $14 - f64.load offset=40 - local.get $17 - local.get $21 - f64.mul - f64.add - f64.store offset=40 - end - local.get $13 - i32.const 1 - i32.add - local.set $13 - br $repeat|1 - unreachable - end + local.set $14 + br $repeat|1 unreachable end - local.get $5 - local.get $9 - f64.store offset=24 - local.get $5 - local.get $10 - f64.store offset=32 - local.get $5 - local.get $11 - f64.store offset=40 - local.get $5 - local.get $5 - f64.load - local.get $1 - local.get $9 - f64.mul - f64.add - f64.store - local.get $5 - local.get $5 - f64.load offset=8 - local.get $1 - local.get $10 - f64.mul - f64.add - f64.store offset=8 - local.get $5 - local.get $5 - f64.load offset=16 - local.get $1 - local.get $11 - f64.mul - f64.add - f64.store offset=16 + unreachable end - local.get $3 + local.get $6 + local.get $10 + f64.store offset=24 + local.get $6 + local.get $11 + f64.store offset=32 + local.get $6 + local.get $12 + f64.store offset=40 + local.get $6 + local.get $6 + f64.load + local.get $1 + local.get $10 + f64.mul + f64.add + f64.store + local.get $6 + local.get $6 + f64.load offset=8 + local.get $1 + local.get $11 + f64.mul + f64.add + f64.store offset=8 + local.get $6 + local.get $6 + f64.load offset=16 + local.get $1 + local.get $12 + f64.mul + f64.add + f64.store offset=16 + local.get $5 + call $~lib/rt/stub/__release + local.get $6 + call $~lib/rt/stub/__release + local.get $4 i32.const 1 i32.add - local.set $3 + local.set $4 br $repeat|0 unreachable end unreachable end + local.get $2 + call $~lib/rt/stub/__release ) - (func $assembly/index/NBodySystem#energy (; 22 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) + (func $assembly/index/NBodySystem#energy (; 18 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) (local $1 f64) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 f64) + (local $6 i32) (local $7 f64) (local $8 f64) (local $9 f64) (local $10 f64) (local $11 f64) (local $12 f64) - (local $13 i32) + (local $13 f64) (local $14 i32) - (local $15 f64) - (local $16 f64) + (local $15 i32) + (local $16 i32) (local $17 f64) (local $18 f64) + (local $19 f64) + (local $20 f64) f64.const 0 local.set $1 local.get $0 i32.load + call $~lib/rt/stub/__retain local.set $2 block $break|0 block i32.const 0 local.set $3 - block $~lib/array/Array#get:length|inlined.2 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=4 - end + local.get $2 + call $~lib/array/Array#get:length local.set $4 end loop $repeat|0 @@ -1094,118 +2177,126 @@ i32.lt_u i32.eqz br_if $break|0 - block - local.get $2 + local.get $2 + local.get $3 + call $~lib/array/Array#__unchecked_get + local.tee $5 + call $~lib/rt/stub/__retain + local.set $6 + local.get $6 + f64.load + local.set $7 + local.get $6 + f64.load offset=8 + local.set $8 + local.get $6 + f64.load offset=16 + local.set $9 + local.get $6 + f64.load offset=24 + local.set $10 + local.get $6 + f64.load offset=32 + local.set $11 + local.get $6 + f64.load offset=40 + local.set $12 + local.get $6 + f64.load offset=48 + local.set $13 + local.get $1 + f64.const 0.5 + local.get $13 + f64.mul + local.get $10 + local.get $10 + f64.mul + local.get $11 + local.get $11 + f64.mul + f64.add + local.get $12 + local.get $12 + f64.mul + f64.add + f64.mul + f64.add + local.set $1 + block $break|1 local.get $3 - call $~lib/array/Array#__unchecked_get - local.set $5 - local.get $5 - f64.load - local.set $6 - local.get $5 - f64.load offset=8 - local.set $7 - local.get $5 - f64.load offset=16 - local.set $8 - local.get $5 - f64.load offset=24 - local.set $9 - local.get $5 - f64.load offset=32 - local.set $10 - local.get $5 - f64.load offset=40 - local.set $11 - local.get $5 - f64.load offset=48 - local.set $12 - local.get $1 - f64.const 0.5 - local.get $12 - f64.mul - local.get $9 - local.get $9 - f64.mul - local.get $10 - local.get $10 - f64.mul - f64.add - local.get $11 - local.get $11 - f64.mul - f64.add - f64.mul - f64.add - local.set $1 - block $break|1 - local.get $3 + i32.const 1 + i32.add + local.set $14 + loop $repeat|1 + local.get $14 + local.get $4 + i32.lt_u + i32.eqz + br_if $break|1 + local.get $2 + local.get $14 + call $~lib/array/Array#__unchecked_get + local.tee $15 + call $~lib/rt/stub/__retain + local.set $16 + local.get $7 + local.get $16 + f64.load + f64.sub + local.set $17 + local.get $8 + local.get $16 + f64.load offset=8 + f64.sub + local.set $18 + local.get $9 + local.get $16 + f64.load offset=16 + f64.sub + local.set $19 + block $~lib/math/NativeMath.sqrt|inlined.1 (result f64) + local.get $17 + local.get $17 + f64.mul + local.get $18 + local.get $18 + f64.mul + f64.add + local.get $19 + local.get $19 + f64.mul + f64.add + local.set $20 + local.get $20 + f64.sqrt + end + local.set $20 + local.get $1 + local.get $13 + local.get $16 + f64.load offset=48 + f64.mul + local.get $20 + f64.div + f64.sub + local.set $1 + local.get $15 + call $~lib/rt/stub/__release + local.get $16 + call $~lib/rt/stub/__release + local.get $14 i32.const 1 i32.add - local.set $13 - loop $repeat|1 - local.get $13 - local.get $4 - i32.lt_u - i32.eqz - br_if $break|1 - block - local.get $2 - local.get $13 - call $~lib/array/Array#__unchecked_get - local.set $14 - local.get $6 - local.get $14 - f64.load - f64.sub - local.set $15 - local.get $7 - local.get $14 - f64.load offset=8 - f64.sub - local.set $16 - local.get $8 - local.get $14 - f64.load offset=16 - f64.sub - local.set $17 - block $~lib/math/NativeMath.sqrt|inlined.1 (result f64) - local.get $15 - local.get $15 - f64.mul - local.get $16 - local.get $16 - f64.mul - f64.add - local.get $17 - local.get $17 - f64.mul - f64.add - local.set $18 - local.get $18 - f64.sqrt - end - local.set $18 - local.get $1 - local.get $12 - local.get $14 - f64.load offset=48 - f64.mul - local.get $18 - f64.div - f64.sub - local.set $1 - end - local.get $13 - i32.const 1 - i32.add - local.set $13 - br $repeat|1 - unreachable - end + local.set $14 + br $repeat|1 unreachable end + unreachable end + local.get $5 + call $~lib/rt/stub/__release + local.get $6 + call $~lib/rt/stub/__release local.get $3 i32.const 1 i32.add @@ -1216,15 +2307,19 @@ unreachable end local.get $1 + local.set $13 + local.get $2 + call $~lib/rt/stub/__release + local.get $13 ) - (func $assembly/index/step (; 23 ;) (type $FUNCSIG$d) (result f64) + (func $assembly/index/step (; 19 ;) (type $FUNCSIG$d) (result f64) global.get $assembly/index/system f64.const 0.01 call $assembly/index/NBodySystem#advance global.get $assembly/index/system call $assembly/index/NBodySystem#energy ) - (func $assembly/index/bench (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $assembly/index/bench (; 20 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) block $break|0 i32.const 0 @@ -1248,31 +2343,48 @@ unreachable end ) - (func $assembly/index/getBody (; 25 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $assembly/index/getBody (; 21 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) + (local $3 i32) + (local $4 i32) global.get $assembly/index/system i32.load + call $~lib/rt/stub/__retain local.set $1 local.get $0 - block $~lib/array/Array#get:length|inlined.4 (result i32) - local.get $1 - local.set $2 - local.get $2 - i32.load offset=4 - end + local.get $1 + call $~lib/array/Array#get:length i32.lt_u if (result i32) local.get $1 local.get $0 - call $~lib/array/Array#__get + call $~lib/array/Array#__unchecked_get + local.tee $2 + local.tee $3 else i32.const 0 + call $~lib/rt/stub/__retain + local.tee $4 end + call $~lib/rt/stub/__retain + local.set $2 + local.get $1 + call $~lib/rt/stub/__release + local.get $2 ) - (func $start (; 26 ;) (type $FUNCSIG$v) - call $start:assembly/index + (func $start (; 22 ;) (type $FUNCSIG$v) + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset ) - (func $null (; 27 ;) (type $FUNCSIG$v) + (func $null (; 23 ;) (type $FUNCSIG$v) ) ) diff --git a/examples/n-body/package.json b/examples/n-body/package.json index ce64e03a07..0fd4b4dbae 100644 --- a/examples/n-body/package.json +++ b/examples/n-body/package.json @@ -3,9 +3,9 @@ "version": "1.0.0", "private": true, "scripts": { - "asbuild:untouched": "asc assembly/index.ts -b build/untouched.wasm -t build/untouched.wat --sourceMap --debug --validate --importMemory", - "asbuild:optimized": "asc assembly/index.ts -b build/optimized.wasm -t build/optimized.wat -O3 --validate --noAssert --importMemory", - "asbuild:asmjs": "asc assembly/index.ts -a build/index.asm.js -O3 --validate --noAssert", + "asbuild:untouched": "asc assembly/index.ts -b build/untouched.wasm -t build/untouched.wat --sourceMap --debug --validate --runtime none --importMemory", + "asbuild:optimized": "asc assembly/index.ts -b build/optimized.wasm -t build/optimized.wat -O3 --validate --runtime none --noAssert --importMemory", + "asbuild:asmjs": "asc assembly/index.ts -a build/index.asm.js -O3 --validate --runtime none --noAssert && node scripts/postprocess-asmjs", "asbuild": "npm run asbuild:untouched && npm run asbuild:optimized && npm run asbuild:asmjs", "tsbuild": "tsc -p assembly -t ES2017 -m commonjs --outDir build", "build": "npm run asbuild && npm run tsbuild", diff --git a/examples/n-body/scripts/postprocess-asmjs.js b/examples/n-body/scripts/postprocess-asmjs.js new file mode 100644 index 0000000000..d331a75a75 --- /dev/null +++ b/examples/n-body/scripts/postprocess-asmjs.js @@ -0,0 +1,7 @@ +const fs = require("fs"); +const path = require("path"); + +const filename = path.join(__dirname, "..", "build" , "index.asm.js"); +var source = fs.readFileSync(filename, { encoding: "utf8" }); +source = source.replace(/^export var ([^ ]+) =/mg, ($0, $1) => "exports." + $1 + " = "); +fs.writeFileSync(filename, source); diff --git a/examples/pson/build/optimized.wat b/examples/pson/build/optimized.wat index e996c355e7..b8ba316970 100644 --- a/examples/pson/build/optimized.wat +++ b/examples/pson/build/optimized.wat @@ -21,11 +21,8 @@ (import "pson" "onString" (func $assembly/pson/onString (param i32 i32))) (import "pson" "onBinary" (func $assembly/pson/onBinary (param i32 i32))) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $null) (global $assembly/pson/offset (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "onNull" (func $assembly/pson/onNull)) (export "onTrue" (func $assembly/pson/onTrue)) (export "onFalse" (func $assembly/pson/onFalse)) @@ -120,7 +117,7 @@ (local $2 i64) block $break|0 global.get $assembly/pson/offset - local.tee $1 + local.tee $0 i32.const 1 i32.add global.set $assembly/pson/offset @@ -141,7 +138,7 @@ block $case1|0 block $case0|0 block $tablify|0 - local.get $1 + local.get $0 i32.load8_u local.tee $0 local.tee $1 diff --git a/examples/pson/build/untouched.wat b/examples/pson/build/untouched.wat index e7a6be1ed1..2f37a02804 100644 --- a/examples/pson/build/untouched.wat +++ b/examples/pson/build/untouched.wat @@ -24,9 +24,7 @@ (table $0 1 funcref) (elem (i32.const 0) $null) (global $assembly/pson/offset (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "onNull" (func $assembly/pson/onNull)) (export "onTrue" (func $assembly/pson/onTrue)) (export "onFalse" (func $assembly/pson/onFalse)) diff --git a/index.d.ts b/index.d.ts index 3bd16e178a..388aca2060 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1 +1,2 @@ -export * from "./src"; +/// +export * from "assemblyscript"; diff --git a/examples/i64-polyfill/README.md b/lib/i64/README.md similarity index 100% rename from examples/i64-polyfill/README.md rename to lib/i64/README.md diff --git a/examples/i64-polyfill/assembly/i64.ts b/lib/i64/assembly/i64.ts similarity index 100% rename from examples/i64-polyfill/assembly/i64.ts rename to lib/i64/assembly/i64.ts diff --git a/examples/i64-polyfill/assembly/tsconfig.json b/lib/i64/assembly/tsconfig.json similarity index 100% rename from examples/i64-polyfill/assembly/tsconfig.json rename to lib/i64/assembly/tsconfig.json diff --git a/examples/i64-polyfill/build/.gitignore b/lib/i64/build/.gitignore similarity index 100% rename from examples/i64-polyfill/build/.gitignore rename to lib/i64/build/.gitignore diff --git a/examples/i64-polyfill/build/optimized.d.ts b/lib/i64/build/optimized.d.ts similarity index 97% rename from examples/i64-polyfill/build/optimized.d.ts rename to lib/i64/build/optimized.d.ts index cd5d44508a..9a936f584b 100644 --- a/examples/i64-polyfill/build/optimized.d.ts +++ b/lib/i64/build/optimized.d.ts @@ -8,10 +8,6 @@ declare module ASModule { type f32 = number; type f64 = number; type bool = any; - const NaN: f64; - const Infinity: f64; - var lo: u32; - var hi: u32; function getLo(): u32; function getHi(): u32; function clz(loLeft: u32, hiLeft: u32): void; diff --git a/examples/i64-polyfill/build/optimized.wat b/lib/i64/build/optimized.wat similarity index 99% rename from examples/i64-polyfill/build/optimized.wat rename to lib/i64/build/optimized.wat index ad28e90a41..3c44151e21 100644 --- a/examples/i64-polyfill/build/optimized.wat +++ b/lib/i64/build/optimized.wat @@ -4,12 +4,9 @@ (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $null) (global $assembly/i64/lo (mut i32) (i32.const 0)) (global $assembly/i64/hi (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "getLo" (func $assembly/i64/getLo)) (export "getHi" (func $assembly/i64/getHi)) (export "clz" (func $assembly/i64/clz)) diff --git a/examples/i64-polyfill/build/untouched.wat b/lib/i64/build/untouched.wat similarity index 99% rename from examples/i64-polyfill/build/untouched.wat rename to lib/i64/build/untouched.wat index c90ef2b171..75dce31faf 100644 --- a/examples/i64-polyfill/build/untouched.wat +++ b/lib/i64/build/untouched.wat @@ -8,9 +8,7 @@ (elem (i32.const 0) $null) (global $assembly/i64/lo (mut i32) (i32.const 0)) (global $assembly/i64/hi (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "getLo" (func $assembly/i64/getLo)) (export "getHi" (func $assembly/i64/getHi)) (export "clz" (func $assembly/i64/clz)) diff --git a/examples/i64-polyfill/index.d.ts b/lib/i64/index.d.ts similarity index 100% rename from examples/i64-polyfill/index.d.ts rename to lib/i64/index.d.ts diff --git a/examples/i64-polyfill/index.js b/lib/i64/index.js similarity index 100% rename from examples/i64-polyfill/index.js rename to lib/i64/index.js diff --git a/examples/i64-polyfill/package.json b/lib/i64/package.json similarity index 74% rename from examples/i64-polyfill/package.json rename to lib/i64/package.json index af03821f1d..4f0781115c 100644 --- a/examples/i64-polyfill/package.json +++ b/lib/i64/package.json @@ -17,8 +17,8 @@ }, "scripts": { "asbuild": "npm run asbuild:untouched && npm run asbuild:optimized", - "asbuild:untouched": "asc assembly/i64.ts -t build/untouched.wat -b build/untouched.wasm --validate --sourceMap --debug --measure", - "asbuild:optimized": "asc -O assembly/i64.ts -b build/optimized.wasm -t build/optimized.wat -d build/optimized.d.ts --validate --sourceMap --measure", + "asbuild:untouched": "asc assembly/i64.ts -t build/untouched.wat -b build/untouched.wasm --runtime none --validate --sourceMap --debug --measure", + "asbuild:optimized": "asc assembly/i64.ts -b build/optimized.wasm -t build/optimized.wat -d build/optimized.d.ts -O3 --runtime none --validate --sourceMap --measure", "test": "node tests" }, "files": [ diff --git a/examples/i64-polyfill/tests/index.js b/lib/i64/tests/index.js similarity index 100% rename from examples/i64-polyfill/tests/index.js rename to lib/i64/tests/index.js diff --git a/lib/libm/README.md b/lib/libm/README.md new file mode 100644 index 0000000000..cc2cbdd966 --- /dev/null +++ b/lib/libm/README.md @@ -0,0 +1,11 @@ +# ![AS](https://avatars1.githubusercontent.com/u/28916798?s=48) libm + +AssemblyScript's math routines for double and single precision as a library. + +```ts +const libm = require("@assemblyscript/libm"); +const libmf = libm.libmf; +... +``` + +Both `libm` and `libmf` have the same general interface as JavaScript's `Math`, with `libmf` doing single precision math. diff --git a/lib/libm/assembly/libm.ts b/lib/libm/assembly/libm.ts new file mode 100644 index 0000000000..5bd3249dda --- /dev/null +++ b/lib/libm/assembly/libm.ts @@ -0,0 +1,144 @@ +export const E = Math.E; +export const LN10 = Math.LN10; +export const LN2 = Math.LN2; +export const LOG10E = Math.LOG10E; +export const LOG2E = Math.LOG2E; +export const PI = Math.PI; +export const SQRT1_2 = Math.SQRT1_2; +export const SQRT2 = Math.SQRT2; + +export function abs(x: f64): f64 { + return Math.abs(x); +} + +export function acos(x: f64): f64 { + return Math.acos(x); +} + +export function acosh(x: f64): f64 { + return Math.acosh(x); +} + +export function asin(x: f64): f64 { + return Math.asin(x); +} + +export function asinh(x: f64): f64 { + return Math.asinh(x); +} + +export function atan(x: f64): f64 { + return Math.atan(x); +} + +export function atanh(x: f64): f64 { + return Math.atanh(x); +} + +export function atan2(y: f64, x: f64): f64 { + return Math.atan2(y, x); +} + +export function cbrt(x: f64): f64 { + return Math.cbrt(x); +} + +export function ceil(x: f64): f64 { + return Math.ceil(x); +} + +export function clz32(x: f64): f64 { + return Math.clz32(x); +} + +export function cos(x: f64): f64 { + return Math.cos(x); +} + +export function cosh(x: f64): f64 { + return Math.cosh(x); +} + +export function exp(x: f64): f64 { + return Math.exp(x); +} + +export function expm1(x: f64): f64 { + return Math.expm1(x); +} + +export function floor(x: f64): f64 { + return Math.floor(x); +} + +export function fround(x: f64): f64 { + return Math.fround(x); +} + +export function hypot(a: f64, b: f64): f64 { + return Math.hypot(a, b); +} + +export function imul(a: f64, b: f64): f64 { + return Math.imul(a, b); +} + +export function log(x: f64): f64 { + return Math.log(x); +} + +export function log10(x: f64): f64 { + return Math.log10(x); +} + +export function log1p(x: f64): f64 { + return Math.log1p(x); +} + +export function log2(x: f64): f64 { + return Math.log2(x); +} + +export function max(a: f64, b: f64): f64 { + return Math.max(a, b); +} + +export function min(a: f64, b: f64): f64 { + return Math.min(a, b); +} + +export function pow(x: f64, y: f64): f64 { + return Math.pow(x, y); +} + +export function round(x: f64): f64 { + return Math.round(x); +} + +export function sign(x: f64): f64 { + return Math.sign(x); +} + +export function sin(x: f64): f64 { + return Math.sin(x); +} + +export function sinh(x: f64): f64 { + return Math.sinh(x); +} + +export function sqrt(x: f64): f64 { + return Math.sqrt(x); +} + +export function tan(x: f64): f64 { + return Math.tan(x); +} + +export function tanh(x: f64): f64 { + return Math.tanh(x); +} + +export function trunc(x: f64): f64 { + return Math.trunc(x); +} diff --git a/lib/libm/assembly/libmf.ts b/lib/libm/assembly/libmf.ts new file mode 100644 index 0000000000..25f5e9bc65 --- /dev/null +++ b/lib/libm/assembly/libmf.ts @@ -0,0 +1,144 @@ +export const E = Mathf.E; +export const LN10 = Mathf.LN10; +export const LN2 = Mathf.LN2; +export const LOG10E = Mathf.LOG10E; +export const LOG2E = Mathf.LOG2E; +export const PI = Mathf.PI; +export const SQRT1_2 = Mathf.SQRT1_2; +export const SQRT2 = Mathf.SQRT2; + +export function abs(x: f32): f32 { + return Mathf.abs(x); +} + +export function acos(x: f32): f32 { + return Mathf.acos(x); +} + +export function acosh(x: f32): f32 { + return Mathf.acosh(x); +} + +export function asin(x: f32): f32 { + return Mathf.asin(x); +} + +export function asinh(x: f32): f32 { + return Mathf.asinh(x); +} + +export function atan(x: f32): f32 { + return Mathf.atan(x); +} + +export function atanh(x: f32): f32 { + return Mathf.atanh(x); +} + +export function atan2(y: f32, x: f32): f32 { + return Mathf.atan2(y, x); +} + +export function cbrt(x: f32): f32 { + return Mathf.cbrt(x); +} + +export function ceil(x: f32): f32 { + return Mathf.ceil(x); +} + +export function clz32(x: f32): f32 { + return Mathf.clz32(x); +} + +export function cos(x: f32): f32 { + return Mathf.cos(x); +} + +export function cosh(x: f32): f32 { + return Mathf.cosh(x); +} + +export function exp(x: f32): f32 { + return Mathf.exp(x); +} + +export function expm1(x: f32): f32 { + return Mathf.expm1(x); +} + +export function floor(x: f32): f32 { + return Mathf.floor(x); +} + +export function fround(x: f32): f32 { + return Mathf.fround(x); +} + +export function hypot(a: f32, b: f32): f32 { + return Mathf.hypot(a, b); +} + +export function imul(a: f32, b: f32): f32 { + return Mathf.imul(a, b); +} + +export function log(x: f32): f32 { + return Mathf.log(x); +} + +export function log10(x: f32): f32 { + return Mathf.log10(x); +} + +export function log1p(x: f32): f32 { + return Mathf.log1p(x); +} + +export function log2(x: f32): f32 { + return Mathf.log2(x); +} + +export function max(a: f32, b: f32): f32 { + return Mathf.max(a, b); +} + +export function min(a: f32, b: f32): f32 { + return Mathf.min(a, b); +} + +export function pow(x: f32, y: f32): f32 { + return Mathf.pow(x, y); +} + +export function round(x: f32): f32 { + return Mathf.round(x); +} + +export function sign(x: f32): f32 { + return Mathf.sign(x); +} + +export function sin(x: f32): f32 { + return Mathf.sin(x); +} + +export function sinh(x: f32): f32 { + return Mathf.sinh(x); +} + +export function sqrt(x: f32): f32 { + return Mathf.sqrt(x); +} + +export function tan(x: f32): f32 { + return Mathf.tan(x); +} + +export function tanh(x: f32): f32 { + return Mathf.tanh(x); +} + +export function trunc(x: f32): f32 { + return Mathf.trunc(x); +} diff --git a/lib/libm/assembly/tsconfig.json b/lib/libm/assembly/tsconfig.json new file mode 100644 index 0000000000..6e52b21c48 --- /dev/null +++ b/lib/libm/assembly/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../../std/assembly.json", + "include": [ + "./**/*.ts" + ] +} diff --git a/lib/libm/build/.gitignore b/lib/libm/build/.gitignore new file mode 100644 index 0000000000..d873de2f78 --- /dev/null +++ b/lib/libm/build/.gitignore @@ -0,0 +1,2 @@ +*.wasm +*.wasm.map diff --git a/lib/libm/build/libm.wat b/lib/libm/build/libm.wat new file mode 100644 index 0000000000..8b8ce0e1d9 --- /dev/null +++ b/lib/libm/build/libm.wat @@ -0,0 +1,3934 @@ +(module + (type $FUNCSIG$dd (func (param f64) (result f64))) + (type $FUNCSIG$ddd (func (param f64 f64) (result f64))) + (type $FUNCSIG$ddi (func (param f64 i32) (result f64))) + (type $FUNCSIG$v (func)) + (import "Math" "cos" (func $~lib/bindings/Math/cos (param f64) (result f64))) + (import "Math" "sin" (func $~lib/bindings/Math/sin (param f64) (result f64))) + (import "Math" "tan" (func $~lib/bindings/Math/tan (param f64) (result f64))) + (memory $0 0) + (global $assembly/libm/E f64 (f64.const 2.718281828459045)) + (global $assembly/libm/LN10 f64 (f64.const 2.302585092994046)) + (global $assembly/libm/LN2 f64 (f64.const 0.6931471805599453)) + (global $assembly/libm/LOG10E f64 (f64.const 0.4342944819032518)) + (global $assembly/libm/LOG2E f64 (f64.const 1.4426950408889634)) + (global $assembly/libm/PI f64 (f64.const 3.141592653589793)) + (global $assembly/libm/SQRT1_2 f64 (f64.const 0.7071067811865476)) + (global $assembly/libm/SQRT2 f64 (f64.const 1.4142135623730951)) + (export "memory" (memory $0)) + (export "E" (global $assembly/libm/E)) + (export "LN10" (global $assembly/libm/LN10)) + (export "LN2" (global $assembly/libm/LN2)) + (export "LOG10E" (global $assembly/libm/LOG10E)) + (export "LOG2E" (global $assembly/libm/LOG2E)) + (export "PI" (global $assembly/libm/PI)) + (export "SQRT1_2" (global $assembly/libm/SQRT1_2)) + (export "SQRT2" (global $assembly/libm/SQRT2)) + (export "abs" (func $assembly/libm/abs)) + (export "acos" (func $assembly/libm/acos)) + (export "acosh" (func $assembly/libm/acosh)) + (export "asin" (func $assembly/libm/asin)) + (export "asinh" (func $assembly/libm/asinh)) + (export "atan" (func $assembly/libm/atan)) + (export "atanh" (func $assembly/libm/atanh)) + (export "atan2" (func $assembly/libm/atan2)) + (export "cbrt" (func $assembly/libm/cbrt)) + (export "ceil" (func $assembly/libm/ceil)) + (export "clz32" (func $assembly/libm/clz32)) + (export "cos" (func $assembly/libm/cos)) + (export "cosh" (func $assembly/libm/cosh)) + (export "exp" (func $assembly/libm/exp)) + (export "expm1" (func $assembly/libm/expm1)) + (export "floor" (func $assembly/libm/floor)) + (export "fround" (func $assembly/libm/fround)) + (export "hypot" (func $assembly/libm/hypot)) + (export "imul" (func $assembly/libm/imul)) + (export "log" (func $assembly/libm/log)) + (export "log10" (func $assembly/libm/log10)) + (export "log1p" (func $assembly/libm/log1p)) + (export "log2" (func $assembly/libm/log2)) + (export "max" (func $assembly/libm/max)) + (export "min" (func $assembly/libm/min)) + (export "pow" (func $assembly/libm/pow)) + (export "round" (func $assembly/libm/round)) + (export "sign" (func $assembly/libm/sign)) + (export "sin" (func $assembly/libm/sin)) + (export "sinh" (func $assembly/libm/sinh)) + (export "sqrt" (func $assembly/libm/sqrt)) + (export "tan" (func $assembly/libm/tan)) + (export "tanh" (func $assembly/libm/tanh)) + (export "trunc" (func $assembly/libm/trunc)) + (func $assembly/libm/abs (; 3 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + f64.abs + ) + (func $~lib/math/R (; 4 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + f64.const 0.16666666666666666 + local.get $0 + f64.const -0.3255658186224009 + local.get $0 + f64.const 0.20121253213486293 + local.get $0 + f64.const -0.04005553450067941 + local.get $0 + f64.const 7.915349942898145e-04 + local.get $0 + f64.const 3.479331075960212e-05 + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.const 1 + local.get $0 + f64.const -2.403394911734414 + local.get $0 + f64.const 2.0209457602335057 + local.get $0 + f64.const -0.6882839716054533 + local.get $0 + f64.const 0.07703815055590194 + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.div + ) + (func $~lib/math/NativeMath.acos (; 5 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (local $1 f64) + (local $2 i32) + (local $3 i32) + (local $4 f64) + local.get $0 + i64.reinterpret_f64 + i64.const 32 + i64.shr_u + i32.wrap_i64 + local.tee $3 + i32.const 2147483647 + i32.and + local.tee $2 + i32.const 1072693248 + i32.ge_u + if + local.get $0 + i64.reinterpret_f64 + i32.wrap_i64 + local.get $2 + i32.const 1072693248 + i32.sub + i32.or + i32.eqz + if + local.get $3 + i32.const 31 + i32.shr_u + if + f64.const 3.141592653589793 + return + end + f64.const 0 + return + end + f64.const 0 + local.get $0 + local.get $0 + f64.sub + f64.div + return + end + local.get $2 + i32.const 1071644672 + i32.lt_u + if + local.get $2 + i32.const 1012924416 + i32.le_u + if + f64.const 1.5707963267948966 + return + end + f64.const 1.5707963267948966 + local.get $0 + f64.const 6.123233995736766e-17 + local.get $0 + local.get $0 + local.get $0 + f64.mul + call $~lib/math/R + f64.mul + f64.sub + f64.sub + f64.sub + return + end + local.get $3 + i32.const 31 + i32.shr_u + if + f64.const 2 + f64.const 1.5707963267948966 + f64.const 0.5 + local.get $0 + f64.const 0.5 + f64.mul + f64.add + local.tee $0 + f64.sqrt + local.tee $1 + local.get $0 + call $~lib/math/R + local.get $1 + f64.mul + f64.const 6.123233995736766e-17 + f64.sub + f64.add + f64.sub + f64.mul + return + end + f64.const 2 + f64.const 0.5 + local.get $0 + f64.const 0.5 + f64.mul + f64.sub + local.tee $1 + f64.sqrt + local.tee $4 + i64.reinterpret_f64 + i64.const -4294967296 + i64.and + f64.reinterpret_i64 + local.tee $0 + local.get $1 + call $~lib/math/R + local.get $4 + f64.mul + local.get $1 + local.get $0 + local.get $0 + f64.mul + f64.sub + local.get $4 + local.get $0 + f64.add + f64.div + f64.add + f64.add + f64.mul + ) + (func $assembly/libm/acos (; 6 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + call $~lib/math/NativeMath.acos + ) + (func $~lib/math/NativeMath.log1p (; 7 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (local $1 f64) + (local $2 i32) + (local $3 i32) + (local $4 f64) + (local $5 f64) + (local $6 i64) + (local $7 f64) + i32.const 1 + local.set $3 + local.get $0 + i64.reinterpret_f64 + i64.const 32 + i64.shr_u + i32.wrap_i64 + local.tee $2 + i32.const 1071284858 + i32.lt_u + if (result i32) + i32.const 1 + else + local.get $2 + i32.const 31 + i32.shr_u + end + if + local.get $2 + i32.const -1074790400 + i32.ge_u + if + local.get $0 + f64.const -1 + f64.eq + if + local.get $0 + f64.const 0 + f64.div + return + end + local.get $0 + local.get $0 + f64.sub + f64.const 0 + f64.div + return + end + local.get $2 + i32.const 1 + i32.shl + i32.const 2034237440 + i32.lt_u + if + local.get $0 + return + end + local.get $2 + i32.const -1076707644 + i32.le_u + if + i32.const 0 + local.set $3 + local.get $0 + local.set $1 + end + else + local.get $2 + i32.const 2146435072 + i32.ge_u + if + local.get $0 + return + end + end + local.get $3 + if + f64.const 1 + local.get $0 + f64.add + i64.reinterpret_f64 + local.tee $6 + i64.const 32 + i64.shr_u + i32.wrap_i64 + i32.const 614242 + i32.add + local.tee $2 + i32.const 20 + i32.shr_u + i32.const 1023 + i32.sub + local.tee $3 + i32.const 54 + i32.lt_s + if (result f64) + local.get $6 + f64.reinterpret_i64 + local.set $1 + f64.const 1 + local.get $1 + local.get $0 + f64.sub + f64.sub + local.get $0 + local.get $1 + f64.const 1 + f64.sub + f64.sub + local.get $3 + i32.const 2 + i32.ge_s + select + local.get $1 + f64.div + else + f64.const 0 + end + local.set $5 + local.get $6 + i64.const 4294967295 + i64.and + local.get $2 + i32.const 1048575 + i32.and + i32.const 1072079006 + i32.add + i64.extend_i32_u + i64.const 32 + i64.shl + i64.or + f64.reinterpret_i64 + f64.const 1 + f64.sub + local.set $1 + end + local.get $1 + f64.const 2 + local.get $1 + f64.add + f64.div + local.tee $4 + local.get $4 + f64.mul + local.tee $7 + local.get $7 + f64.mul + local.set $0 + local.get $4 + f64.const 0.5 + local.get $1 + f64.mul + local.get $1 + f64.mul + local.tee $4 + local.get $7 + f64.const 0.6666666666666735 + local.get $0 + f64.const 0.2857142874366239 + local.get $0 + f64.const 0.1818357216161805 + local.get $0 + f64.const 0.14798198605116586 + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.mul + local.get $0 + f64.const 0.3999999999940942 + local.get $0 + f64.const 0.22222198432149784 + local.get $0 + f64.const 0.15313837699209373 + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.add + f64.mul + local.get $3 + f64.convert_i32_s + local.tee $0 + f64.const 1.9082149292705877e-10 + f64.mul + local.get $5 + f64.add + f64.add + local.get $4 + f64.sub + local.get $1 + f64.add + local.get $0 + f64.const 0.6931471803691238 + f64.mul + f64.add + ) + (func $~lib/math/NativeMath.log (; 8 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (local $1 i32) + (local $2 i64) + (local $3 f64) + (local $4 f64) + (local $5 i32) + (local $6 f64) + local.get $0 + i64.reinterpret_f64 + local.tee $2 + i64.const 32 + i64.shr_u + i32.wrap_i64 + local.tee $1 + i32.const 1048576 + i32.lt_u + if (result i32) + i32.const 1 + else + local.get $1 + i32.const 31 + i32.shr_u + end + if + local.get $2 + i64.const 1 + i64.shl + i64.const 0 + i64.eq + if + f64.const -1 + local.get $0 + local.get $0 + f64.mul + f64.div + return + end + local.get $1 + i32.const 31 + i32.shr_u + if + local.get $0 + local.get $0 + f64.sub + f64.const 0 + f64.div + return + end + i32.const -54 + local.set $5 + local.get $0 + f64.const 18014398509481984 + f64.mul + i64.reinterpret_f64 + local.tee $2 + i64.const 32 + i64.shr_u + i32.wrap_i64 + local.set $1 + else + local.get $1 + i32.const 2146435072 + i32.ge_u + if + local.get $0 + return + else + local.get $2 + i64.const 32 + i64.shl + i64.const 0 + i64.eq + i32.const 0 + local.get $1 + i32.const 1072693248 + i32.eq + select + if + f64.const 0 + return + end + end + end + local.get $2 + i64.const 4294967295 + i64.and + local.get $1 + i32.const 614242 + i32.add + local.tee $1 + i32.const 1048575 + i32.and + i32.const 1072079006 + i32.add + i64.extend_i32_u + i64.const 32 + i64.shl + i64.or + f64.reinterpret_i64 + f64.const 1 + f64.sub + local.tee $3 + f64.const 2 + local.get $3 + f64.add + f64.div + local.tee $4 + local.get $4 + f64.mul + local.tee $6 + local.get $6 + f64.mul + local.set $0 + local.get $4 + f64.const 0.5 + local.get $3 + f64.mul + local.get $3 + f64.mul + local.tee $4 + local.get $6 + f64.const 0.6666666666666735 + local.get $0 + f64.const 0.2857142874366239 + local.get $0 + f64.const 0.1818357216161805 + local.get $0 + f64.const 0.14798198605116586 + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.mul + local.get $0 + f64.const 0.3999999999940942 + local.get $0 + f64.const 0.22222198432149784 + local.get $0 + f64.const 0.15313837699209373 + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.add + f64.mul + local.get $1 + i32.const 20 + i32.shr_s + i32.const 1023 + i32.sub + local.get $5 + i32.add + f64.convert_i32_s + local.tee $0 + f64.const 1.9082149292705877e-10 + f64.mul + f64.add + local.get $4 + f64.sub + local.get $3 + f64.add + local.get $0 + f64.const 0.6931471803691238 + f64.mul + f64.add + ) + (func $~lib/math/NativeMath.acosh (; 9 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (local $1 i64) + local.get $0 + i64.reinterpret_f64 + i64.const 52 + i64.shr_u + i64.const 2047 + i64.and + local.tee $1 + i64.const 1024 + i64.lt_u + if + local.get $0 + f64.const 1 + f64.sub + local.tee $0 + local.get $0 + local.get $0 + f64.mul + f64.const 2 + local.get $0 + f64.mul + f64.add + f64.sqrt + f64.add + call $~lib/math/NativeMath.log1p + return + end + local.get $1 + i64.const 1049 + i64.lt_u + if + f64.const 2 + local.get $0 + f64.mul + f64.const 1 + local.get $0 + local.get $0 + local.get $0 + f64.mul + f64.const 1 + f64.sub + f64.sqrt + f64.add + f64.div + f64.sub + call $~lib/math/NativeMath.log + return + end + local.get $0 + call $~lib/math/NativeMath.log + f64.const 0.6931471805599453 + f64.add + ) + (func $assembly/libm/acosh (; 10 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + call $~lib/math/NativeMath.acosh + ) + (func $~lib/math/NativeMath.asin (; 11 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (local $1 f64) + (local $2 i32) + (local $3 f64) + (local $4 i32) + local.get $0 + i64.reinterpret_f64 + i64.const 32 + i64.shr_u + i32.wrap_i64 + local.tee $4 + i32.const 2147483647 + i32.and + local.tee $2 + i32.const 1072693248 + i32.ge_u + if + local.get $0 + i64.reinterpret_f64 + i32.wrap_i64 + local.get $2 + i32.const 1072693248 + i32.sub + i32.or + i32.eqz + if + local.get $0 + f64.const 1.5707963267948966 + f64.mul + f64.const 7.52316384526264e-37 + f64.add + return + end + f64.const 0 + local.get $0 + local.get $0 + f64.sub + f64.div + return + end + local.get $2 + i32.const 1071644672 + i32.lt_u + if + local.get $2 + i32.const 1048576 + i32.ge_u + i32.const 0 + local.get $2 + i32.const 1045430272 + i32.lt_u + select + if + local.get $0 + return + end + local.get $0 + local.get $0 + local.get $0 + local.get $0 + f64.mul + call $~lib/math/R + f64.mul + f64.add + return + end + f64.const 0.5 + local.get $0 + f64.abs + f64.const 0.5 + f64.mul + f64.sub + local.tee $1 + f64.sqrt + local.set $0 + local.get $1 + call $~lib/math/R + local.set $3 + local.get $2 + i32.const 1072640819 + i32.ge_u + if (result f64) + f64.const 1.5707963267948966 + f64.const 2 + local.get $0 + local.get $0 + local.get $3 + f64.mul + f64.add + f64.mul + f64.const 6.123233995736766e-17 + f64.sub + f64.sub + else + f64.const 0.7853981633974483 + f64.const 2 + local.get $0 + f64.mul + local.get $3 + f64.mul + f64.const 6.123233995736766e-17 + f64.const 2 + local.get $1 + local.get $0 + i64.reinterpret_f64 + i64.const -4294967296 + i64.and + f64.reinterpret_i64 + local.tee $1 + local.get $1 + f64.mul + f64.sub + local.get $0 + local.get $1 + f64.add + f64.div + f64.mul + f64.sub + f64.sub + f64.const 0.7853981633974483 + f64.const 2 + local.get $1 + f64.mul + f64.sub + f64.sub + f64.sub + end + local.set $0 + local.get $4 + i32.const 31 + i32.shr_u + if + local.get $0 + f64.neg + return + end + local.get $0 + ) + (func $assembly/libm/asin (; 12 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + call $~lib/math/NativeMath.asin + ) + (func $~lib/math/NativeMath.asinh (; 13 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (local $1 f64) + (local $2 i64) + local.get $0 + i64.reinterpret_f64 + local.tee $2 + i64.const 9223372036854775807 + i64.and + f64.reinterpret_i64 + local.set $1 + local.get $2 + i64.const 52 + i64.shr_u + i64.const 2047 + i64.and + local.tee $2 + i64.const 1049 + i64.ge_u + if (result f64) + local.get $1 + call $~lib/math/NativeMath.log + f64.const 0.6931471805599453 + f64.add + else + local.get $2 + i64.const 1024 + i64.ge_u + if (result f64) + f64.const 2 + local.get $1 + f64.mul + f64.const 1 + local.get $1 + local.get $1 + f64.mul + f64.const 1 + f64.add + f64.sqrt + local.get $1 + f64.add + f64.div + f64.add + call $~lib/math/NativeMath.log + else + local.get $2 + i64.const 997 + i64.ge_u + if (result f64) + local.get $1 + local.get $1 + local.get $1 + f64.mul + local.tee $1 + local.get $1 + f64.const 1 + f64.add + f64.sqrt + f64.const 1 + f64.add + f64.div + f64.add + call $~lib/math/NativeMath.log1p + else + local.get $1 + end + end + end + local.get $0 + f64.copysign + ) + (func $assembly/libm/asinh (; 14 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + call $~lib/math/NativeMath.asinh + ) + (func $~lib/math/NativeMath.atan (; 15 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (local $1 f64) + (local $2 i32) + (local $3 f64) + (local $4 f64) + local.get $0 + local.set $3 + local.get $0 + i64.reinterpret_f64 + i64.const 32 + i64.shr_u + i32.wrap_i64 + i32.const 2147483647 + i32.and + local.tee $2 + i32.const 1141899264 + i32.ge_u + if + local.get $0 + local.get $0 + f64.ne + if + local.get $0 + return + end + f64.const 1.5707963267948966 + local.get $3 + f64.copysign + return + end + local.get $2 + i32.const 1071382528 + i32.lt_u + if + local.get $2 + i32.const 1044381696 + i32.lt_u + if + local.get $0 + return + end + i32.const -1 + local.set $2 + else + local.get $0 + f64.abs + local.set $0 + local.get $2 + i32.const 1072889856 + i32.lt_u + if (result f64) + local.get $2 + i32.const 1072037888 + i32.lt_u + if (result f64) + i32.const 0 + local.set $2 + f64.const 2 + local.get $0 + f64.mul + f64.const 1 + f64.sub + f64.const 2 + local.get $0 + f64.add + f64.div + else + i32.const 1 + local.set $2 + local.get $0 + f64.const 1 + f64.sub + local.get $0 + f64.const 1 + f64.add + f64.div + end + else + local.get $2 + i32.const 1073971200 + i32.lt_u + if (result f64) + i32.const 2 + local.set $2 + local.get $0 + f64.const 1.5 + f64.sub + f64.const 1 + f64.const 1.5 + local.get $0 + f64.mul + f64.add + f64.div + else + i32.const 3 + local.set $2 + f64.const -1 + local.get $0 + f64.div + end + end + local.set $0 + end + local.get $0 + local.get $0 + f64.mul + local.tee $4 + local.get $4 + f64.mul + local.set $1 + local.get $0 + local.get $4 + f64.const 0.3333333333333293 + local.get $1 + f64.const 0.14285714272503466 + local.get $1 + f64.const 0.09090887133436507 + local.get $1 + f64.const 0.06661073137387531 + local.get $1 + f64.const 0.049768779946159324 + local.get $1 + f64.const 0.016285820115365782 + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.mul + local.get $1 + f64.const -0.19999999999876483 + local.get $1 + f64.const -0.11111110405462356 + local.get $1 + f64.const -0.0769187620504483 + local.get $1 + f64.const -0.058335701337905735 + local.get $1 + f64.const -0.036531572744216916 + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.mul + local.set $1 + local.get $2 + i32.const 0 + i32.lt_s + if + local.get $0 + local.get $1 + f64.sub + return + end + block $break|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + local.get $2 + if + local.get $2 + i32.const 1 + i32.sub + br_table $case1|0 $case2|0 $case3|0 $case4|0 + end + f64.const 0.4636476090008061 + local.get $1 + f64.const 2.2698777452961687e-17 + f64.sub + local.get $0 + f64.sub + f64.sub + local.set $0 + br $break|0 + end + f64.const 0.7853981633974483 + local.get $1 + f64.const 3.061616997868383e-17 + f64.sub + local.get $0 + f64.sub + f64.sub + local.set $0 + br $break|0 + end + f64.const 0.982793723247329 + local.get $1 + f64.const 1.3903311031230998e-17 + f64.sub + local.get $0 + f64.sub + f64.sub + local.set $0 + br $break|0 + end + f64.const 1.5707963267948966 + local.get $1 + f64.const 6.123233995736766e-17 + f64.sub + local.get $0 + f64.sub + f64.sub + local.set $0 + br $break|0 + end + unreachable + end + local.get $0 + local.get $3 + f64.copysign + ) + (func $assembly/libm/atan (; 16 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + call $~lib/math/NativeMath.atan + ) + (func $~lib/math/NativeMath.atanh (; 17 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (local $1 f64) + (local $2 i64) + (local $3 f64) + local.get $0 + i64.reinterpret_f64 + local.tee $2 + i64.const 9223372036854775807 + i64.and + f64.reinterpret_i64 + local.set $1 + local.get $2 + i64.const 52 + i64.shr_u + i64.const 2047 + i64.and + local.tee $2 + i64.const 1022 + i64.lt_u + if (result f64) + local.get $2 + i64.const 991 + i64.ge_u + if (result f64) + f64.const 0.5 + f64.const 2 + local.get $1 + f64.mul + local.tee $3 + local.get $3 + local.get $1 + f64.mul + f64.const 1 + local.get $1 + f64.sub + f64.div + f64.add + call $~lib/math/NativeMath.log1p + f64.mul + else + local.get $1 + end + else + f64.const 0.5 + f64.const 2 + local.get $1 + f64.const 1 + local.get $1 + f64.sub + f64.div + f64.mul + call $~lib/math/NativeMath.log1p + f64.mul + end + local.get $0 + f64.copysign + ) + (func $assembly/libm/atanh (; 18 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + call $~lib/math/NativeMath.atanh + ) + (func $~lib/math/NativeMath.atan2 (; 19 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i64) + (local $6 i32) + (local $7 i32) + i32.const 1 + local.get $0 + local.get $0 + f64.ne + local.get $1 + local.get $1 + f64.ne + select + if + local.get $1 + local.get $0 + f64.add + return + end + local.get $0 + i64.reinterpret_f64 + local.tee $5 + i64.const 32 + i64.shr_u + i32.wrap_i64 + local.set $3 + local.get $5 + i32.wrap_i64 + local.set $6 + local.get $1 + i64.reinterpret_f64 + local.tee $5 + i32.wrap_i64 + local.tee $7 + local.get $5 + i64.const 32 + i64.shr_u + i32.wrap_i64 + local.tee $4 + i32.const 1072693248 + i32.sub + i32.or + i32.eqz + if + local.get $0 + call $~lib/math/NativeMath.atan + return + end + local.get $4 + i32.const 30 + i32.shr_u + i32.const 2 + i32.and + local.get $3 + i32.const 31 + i32.shr_u + i32.or + local.set $2 + local.get $4 + i32.const 2147483647 + i32.and + local.set $4 + local.get $3 + i32.const 2147483647 + i32.and + local.tee $3 + local.get $6 + i32.or + i32.eqz + if + block $break|0 + block $case3|0 + block $case2|0 + block $case1|0 + local.get $2 + i32.eqz + br_if $case1|0 + block $tablify|0 + local.get $2 + i32.const 1 + i32.sub + br_table $case1|0 $case2|0 $case3|0 $tablify|0 + end + br $break|0 + end + local.get $0 + return + end + f64.const 3.141592653589793 + return + end + f64.const -3.141592653589793 + return + end + end + block $folding-inner0 + local.get $4 + local.get $7 + i32.or + i32.eqz + br_if $folding-inner0 + local.get $4 + i32.const 2146435072 + i32.eq + if + local.get $3 + i32.const 2146435072 + i32.eq + if + block $break|1 + block $case3|1 + block $case2|1 + block $case1|1 + local.get $2 + if + local.get $2 + i32.const 1 + i32.sub + br_table $case1|1 $case2|1 $case3|1 $break|1 + end + f64.const 0.7853981633974483 + return + end + f64.const -0.7853981633974483 + return + end + f64.const 2.356194490192345 + return + end + f64.const -2.356194490192345 + return + end + else + block $break|2 + block $case3|2 + block $case2|2 + block $case1|2 + local.get $2 + if + local.get $2 + i32.const 1 + i32.sub + br_table $case1|2 $case2|2 $case3|2 $break|2 + end + f64.const 0 + return + end + f64.const -0 + return + end + f64.const 3.141592653589793 + return + end + f64.const -3.141592653589793 + return + end + end + end + i32.const 1 + local.get $3 + i32.const 2146435072 + i32.eq + local.get $4 + i32.const 67108864 + i32.add + local.get $3 + i32.lt_u + select + br_if $folding-inner0 + local.get $3 + i32.const 67108864 + i32.add + local.get $4 + i32.lt_u + i32.const 0 + local.get $2 + i32.const 2 + i32.and + select + if (result f64) + f64.const 0 + else + local.get $0 + local.get $1 + f64.div + f64.abs + call $~lib/math/NativeMath.atan + end + local.set $0 + block $break|3 + block $case3|3 + block $case2|3 + block $case1|3 + local.get $2 + if + local.get $2 + i32.const 1 + i32.sub + br_table $case1|3 $case2|3 $case3|3 $break|3 + end + local.get $0 + return + end + local.get $0 + f64.neg + return + end + f64.const 3.141592653589793 + local.get $0 + f64.const 1.2246467991473532e-16 + f64.sub + f64.sub + return + end + local.get $0 + f64.const 1.2246467991473532e-16 + f64.sub + f64.const 3.141592653589793 + f64.sub + return + end + unreachable + end + f64.const -1.5707963267948966 + f64.const 1.5707963267948966 + local.get $2 + i32.const 1 + i32.and + select + ) + (func $assembly/libm/atan2 (; 20 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + local.get $0 + local.get $1 + call $~lib/math/NativeMath.atan2 + ) + (func $~lib/math/NativeMath.cbrt (; 21 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (local $1 f64) + (local $2 i32) + (local $3 f64) + (local $4 i64) + local.get $0 + i64.reinterpret_f64 + local.tee $4 + i64.const 32 + i64.shr_u + i32.wrap_i64 + i32.const 2147483647 + i32.and + local.tee $2 + i32.const 2146435072 + i32.ge_u + if + local.get $0 + local.get $0 + f64.add + return + end + local.get $2 + i32.const 1048576 + i32.lt_u + if (result i32) + local.get $0 + f64.const 18014398509481984 + f64.mul + i64.reinterpret_f64 + local.tee $4 + i64.const 32 + i64.shr_u + i32.wrap_i64 + i32.const 2147483647 + i32.and + local.tee $2 + i32.eqz + if + local.get $0 + return + end + local.get $2 + i32.const 3 + i32.div_u + i32.const 696219795 + i32.add + else + local.get $2 + i32.const 3 + i32.div_u + i32.const 715094163 + i32.add + end + local.set $2 + local.get $4 + i64.const -9223372036854775808 + i64.and + local.get $2 + i64.extend_i32_u + i64.const 32 + i64.shl + i64.or + f64.reinterpret_i64 + local.tee $3 + local.get $3 + f64.mul + local.get $3 + local.get $0 + f64.div + f64.mul + local.set $1 + local.get $0 + local.get $3 + f64.const 1.87595182427177 + local.get $1 + f64.const -1.8849797954337717 + local.get $1 + f64.const 1.6214297201053545 + f64.mul + f64.add + f64.mul + f64.add + local.get $1 + local.get $1 + f64.mul + local.get $1 + f64.mul + f64.const -0.758397934778766 + local.get $1 + f64.const 0.14599619288661245 + f64.mul + f64.add + f64.mul + f64.add + f64.mul + i64.reinterpret_f64 + i64.const 2147483648 + i64.add + i64.const -1073741824 + i64.and + f64.reinterpret_i64 + local.tee $0 + local.get $0 + f64.mul + f64.div + local.tee $1 + local.get $0 + f64.sub + f64.const 2 + local.get $0 + f64.mul + local.get $1 + f64.add + f64.div + local.set $1 + local.get $0 + local.get $0 + local.get $1 + f64.mul + f64.add + ) + (func $assembly/libm/cbrt (; 22 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + call $~lib/math/NativeMath.cbrt + ) + (func $assembly/libm/ceil (; 23 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + f64.ceil + ) + (func $~lib/math/NativeMath.clz32 (; 24 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + local.get $0 + f64.sub + f64.const 0 + f64.ne + if + f64.const 32 + return + end + local.get $0 + f64.const 4294967296 + local.get $0 + f64.const 2.3283064365386963e-10 + f64.mul + f64.floor + f64.mul + f64.sub + i64.trunc_f64_s + i32.wrap_i64 + i32.clz + f64.convert_i32_s + ) + (func $assembly/libm/clz32 (; 25 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + call $~lib/math/NativeMath.clz32 + ) + (func $assembly/libm/cos (; 26 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + call $~lib/bindings/Math/cos + ) + (func $~lib/math/NativeMath.expm1 (; 27 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (local $1 f64) + (local $2 f64) + (local $3 i32) + (local $4 f64) + (local $5 i32) + (local $6 i32) + (local $7 f64) + (local $8 i64) + local.get $0 + i64.reinterpret_f64 + local.tee $8 + i64.const 63 + i64.shr_u + i32.wrap_i64 + local.set $6 + local.get $8 + i64.const 32 + i64.shr_u + i64.const 2147483647 + i64.and + i32.wrap_i64 + local.tee $5 + i32.const 1078159482 + i32.ge_u + if + local.get $0 + local.get $0 + f64.ne + if + local.get $0 + return + end + local.get $6 + if + f64.const -1 + return + end + local.get $0 + f64.const 709.782712893384 + f64.gt + if + local.get $0 + f64.const 8988465674311579538646525e283 + f64.mul + return + end + end + local.get $5 + i32.const 1071001154 + i32.gt_u + if + local.get $0 + i32.const 1 + local.get $6 + i32.const 1 + i32.shl + i32.sub + f64.const 1.4426950408889634 + local.get $0 + f64.mul + f64.const 0.5 + local.get $0 + f64.copysign + f64.add + i32.trunc_f64_s + local.get $5 + i32.const 1072734898 + i32.lt_u + select + local.tee $3 + f64.convert_i32_s + local.tee $1 + f64.const 0.6931471803691238 + f64.mul + f64.sub + local.tee $0 + local.get $0 + local.get $1 + f64.const 1.9082149292705877e-10 + f64.mul + local.tee $1 + f64.sub + local.tee $0 + f64.sub + local.get $1 + f64.sub + local.set $7 + else + local.get $5 + i32.const 1016070144 + i32.lt_u + if + local.get $0 + return + end + end + local.get $0 + f64.const 0.5 + local.get $0 + f64.mul + local.tee $2 + f64.mul + local.tee $4 + local.get $4 + f64.mul + local.set $1 + f64.const 3 + f64.const 1 + local.get $4 + f64.const -0.03333333333333313 + f64.mul + f64.add + local.get $1 + f64.const 1.5873015872548146e-03 + local.get $4 + f64.const -7.93650757867488e-05 + f64.mul + f64.add + local.get $1 + f64.const 4.008217827329362e-06 + local.get $4 + f64.const -2.0109921818362437e-07 + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + local.tee $1 + local.get $2 + f64.mul + f64.sub + local.set $2 + local.get $4 + local.get $1 + local.get $2 + f64.sub + f64.const 6 + local.get $0 + local.get $2 + f64.mul + f64.sub + f64.div + f64.mul + local.set $1 + local.get $3 + i32.eqz + if + local.get $0 + local.get $0 + local.get $1 + f64.mul + local.get $4 + f64.sub + f64.sub + return + end + local.get $0 + local.get $1 + local.get $7 + f64.sub + f64.mul + local.get $7 + f64.sub + local.get $4 + f64.sub + local.set $2 + local.get $3 + i32.const -1 + i32.eq + if + f64.const 0.5 + local.get $0 + local.get $2 + f64.sub + f64.mul + f64.const 0.5 + f64.sub + return + end + local.get $3 + i32.const 1 + i32.eq + if + local.get $0 + f64.const -0.25 + f64.lt + if + f64.const -2 + local.get $2 + local.get $0 + f64.const 0.5 + f64.add + f64.sub + f64.mul + return + end + f64.const 1 + f64.const 2 + local.get $0 + local.get $2 + f64.sub + f64.mul + f64.add + return + end + local.get $3 + i64.extend_i32_s + i64.const 1023 + i64.add + i64.const 52 + i64.shl + f64.reinterpret_i64 + local.set $1 + i32.const 1 + local.get $3 + i32.const 56 + i32.gt_s + local.get $3 + i32.const 0 + i32.lt_s + select + if + local.get $0 + local.get $2 + f64.sub + f64.const 1 + f64.add + local.set $0 + local.get $3 + i32.const 1024 + i32.eq + if (result f64) + local.get $0 + f64.const 2 + f64.mul + f64.const 8988465674311579538646525e283 + f64.mul + else + local.get $0 + local.get $1 + f64.mul + end + f64.const 1 + f64.sub + return + end + local.get $0 + f64.const 1 + i64.const 1023 + local.get $3 + i64.extend_i32_s + i64.sub + i64.const 52 + i64.shl + f64.reinterpret_i64 + local.tee $0 + f64.sub + local.get $2 + f64.sub + f64.const 1 + local.get $2 + local.get $0 + f64.add + f64.sub + local.get $3 + i32.const 20 + i32.lt_s + select + f64.add + local.get $1 + f64.mul + ) + (func $~lib/math/NativeMath.scalbn (; 28 ;) (type $FUNCSIG$ddi) (param $0 f64) (param $1 i32) (result f64) + local.get $1 + i32.const 1023 + i32.gt_s + if (result f64) + local.get $0 + f64.const 8988465674311579538646525e283 + f64.mul + local.set $0 + local.get $1 + i32.const 1023 + i32.sub + local.tee $1 + i32.const 1023 + i32.gt_s + if (result f64) + local.get $1 + i32.const 1023 + i32.sub + local.tee $1 + i32.const 1023 + local.get $1 + i32.const 1023 + i32.lt_s + select + local.set $1 + local.get $0 + f64.const 8988465674311579538646525e283 + f64.mul + else + local.get $0 + end + else + local.get $1 + i32.const -1022 + i32.lt_s + if (result f64) + local.get $0 + f64.const 2.004168360008973e-292 + f64.mul + local.set $0 + local.get $1 + i32.const 969 + i32.add + local.tee $1 + i32.const -1022 + i32.lt_s + if (result f64) + local.get $1 + i32.const 969 + i32.add + local.tee $1 + i32.const -1022 + local.get $1 + i32.const -1022 + i32.gt_s + select + local.set $1 + local.get $0 + f64.const 2.004168360008973e-292 + f64.mul + else + local.get $0 + end + else + local.get $0 + end + end + local.get $1 + i64.extend_i32_s + i64.const 1023 + i64.add + i64.const 52 + i64.shl + f64.reinterpret_i64 + f64.mul + ) + (func $~lib/math/NativeMath.exp (; 29 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (local $1 i32) + (local $2 f64) + (local $3 i32) + (local $4 f64) + (local $5 f64) + (local $6 i32) + (local $7 f64) + local.get $0 + i64.reinterpret_f64 + i64.const 32 + i64.shr_u + i32.wrap_i64 + local.tee $1 + i32.const 31 + i32.shr_u + local.set $6 + local.get $1 + i32.const 2147483647 + i32.and + local.tee $3 + i32.const 1082532651 + i32.ge_u + if + local.get $0 + local.get $0 + f64.ne + if + local.get $0 + return + end + local.get $0 + f64.const 709.782712893384 + f64.gt + if + local.get $0 + f64.const 8988465674311579538646525e283 + f64.mul + return + end + local.get $0 + f64.const -745.1332191019411 + f64.lt + if + f64.const 0 + return + end + end + i32.const 0 + local.set $1 + local.get $3 + i32.const 1071001154 + i32.gt_u + if + local.get $0 + local.get $3 + i32.const 1072734898 + i32.ge_u + if (result i32) + f64.const 1.4426950408889634 + local.get $0 + f64.mul + f64.const 0.5 + local.get $0 + f64.copysign + f64.add + i32.trunc_f64_s + else + i32.const 1 + local.get $6 + i32.const 1 + i32.shl + i32.sub + end + local.tee $1 + f64.convert_i32_s + local.tee $0 + f64.const 0.6931471803691238 + f64.mul + f64.sub + local.tee $4 + local.get $0 + f64.const 1.9082149292705877e-10 + f64.mul + local.tee $7 + f64.sub + local.set $0 + else + local.get $3 + i32.const 1043333120 + i32.le_u + if + f64.const 1 + local.get $0 + f64.add + return + end + local.get $0 + local.set $4 + end + local.get $0 + local.get $0 + f64.mul + local.tee $2 + local.get $2 + f64.mul + local.set $5 + f64.const 1 + local.get $0 + local.get $0 + local.get $2 + f64.const 0.16666666666666602 + f64.mul + local.get $5 + f64.const -2.7777777777015593e-03 + local.get $2 + f64.const 6.613756321437934e-05 + f64.mul + f64.add + local.get $5 + f64.const -1.6533902205465252e-06 + local.get $2 + f64.const 4.1381367970572385e-08 + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.sub + local.tee $0 + f64.mul + f64.const 2 + local.get $0 + f64.sub + f64.div + local.get $7 + f64.sub + local.get $4 + f64.add + f64.add + local.set $0 + local.get $1 + i32.eqz + if + local.get $0 + return + end + local.get $0 + local.get $1 + call $~lib/math/NativeMath.scalbn + ) + (func $~lib/math/NativeMath.cosh (; 30 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (local $1 i32) + (local $2 i64) + local.get $0 + i64.reinterpret_f64 + i64.const 9223372036854775807 + i64.and + local.tee $2 + f64.reinterpret_i64 + local.set $0 + local.get $2 + i64.const 32 + i64.shr_u + i32.wrap_i64 + local.tee $1 + i32.const 1072049730 + i32.lt_u + if + local.get $1 + i32.const 1045430272 + i32.lt_u + if + f64.const 1 + return + end + f64.const 1 + local.get $0 + call $~lib/math/NativeMath.expm1 + local.tee $0 + local.get $0 + f64.mul + f64.const 2 + f64.const 2 + local.get $0 + f64.mul + f64.add + f64.div + f64.add + return + end + local.get $1 + i32.const 1082535490 + i32.lt_u + if + f64.const 0.5 + local.get $0 + call $~lib/math/NativeMath.exp + local.tee $0 + f64.const 1 + local.get $0 + f64.div + f64.add + f64.mul + return + end + local.get $0 + f64.const 1416.0996898839683 + f64.sub + call $~lib/math/NativeMath.exp + f64.const 2247116418577894884661631e283 + f64.mul + f64.const 2247116418577894884661631e283 + f64.mul + ) + (func $assembly/libm/cosh (; 31 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + call $~lib/math/NativeMath.cosh + ) + (func $assembly/libm/exp (; 32 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + call $~lib/math/NativeMath.exp + ) + (func $assembly/libm/expm1 (; 33 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + call $~lib/math/NativeMath.expm1 + ) + (func $assembly/libm/floor (; 34 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + f64.floor + ) + (func $assembly/libm/fround (; 35 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + f32.demote_f64 + f64.promote_f32 + ) + (func $~lib/math/NativeMath.hypot (; 36 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (local $2 i64) + (local $3 f64) + (local $4 i64) + (local $5 i32) + (local $6 f64) + (local $7 f64) + (local $8 f64) + (local $9 i32) + (local $10 f64) + (local $11 i64) + local.get $0 + i64.reinterpret_f64 + i64.const 9223372036854775807 + i64.and + local.tee $4 + local.get $1 + i64.reinterpret_f64 + i64.const 9223372036854775807 + i64.and + local.tee $2 + i64.lt_u + if + local.get $4 + local.set $11 + local.get $2 + local.set $4 + local.get $11 + local.set $2 + end + local.get $4 + i64.const 52 + i64.shr_u + i32.wrap_i64 + local.set $5 + local.get $2 + f64.reinterpret_i64 + local.set $1 + local.get $2 + i64.const 52 + i64.shr_u + i32.wrap_i64 + local.tee $9 + i32.const 2047 + i32.eq + if + local.get $1 + return + end + local.get $4 + f64.reinterpret_i64 + local.set $0 + i32.const 1 + local.get $2 + i64.const 0 + i64.eq + local.get $5 + i32.const 2047 + i32.eq + select + if + local.get $0 + return + end + local.get $5 + local.get $9 + i32.sub + i32.const 64 + i32.gt_s + if + local.get $0 + local.get $1 + f64.add + return + end + f64.const 1 + local.set $6 + local.get $5 + i32.const 1533 + i32.gt_s + if (result f64) + f64.const 5260135901548373507240989e186 + local.set $6 + local.get $1 + f64.const 1.90109156629516e-211 + f64.mul + local.set $1 + local.get $0 + f64.const 1.90109156629516e-211 + f64.mul + else + local.get $9 + i32.const 573 + i32.lt_s + if (result f64) + f64.const 1.90109156629516e-211 + local.set $6 + local.get $1 + f64.const 5260135901548373507240989e186 + f64.mul + local.set $1 + local.get $0 + f64.const 5260135901548373507240989e186 + f64.mul + else + local.get $0 + end + end + local.tee $0 + local.get $0 + local.get $0 + f64.const 134217729 + f64.mul + local.tee $3 + f64.sub + local.get $3 + f64.add + local.tee $7 + f64.sub + local.set $10 + local.get $1 + local.get $1 + local.get $1 + f64.const 134217729 + f64.mul + local.tee $3 + f64.sub + local.get $3 + f64.add + local.tee $8 + f64.sub + local.set $3 + local.get $6 + local.get $8 + local.get $8 + f64.mul + local.get $1 + local.get $1 + f64.mul + local.tee $1 + f64.sub + f64.const 2 + local.get $8 + f64.mul + local.get $3 + f64.add + local.get $3 + f64.mul + f64.add + local.get $7 + local.get $7 + f64.mul + local.get $0 + local.get $0 + f64.mul + local.tee $0 + f64.sub + f64.const 2 + local.get $7 + f64.mul + local.get $10 + f64.add + local.get $10 + f64.mul + f64.add + f64.add + local.get $1 + f64.add + local.get $0 + f64.add + f64.sqrt + f64.mul + ) + (func $assembly/libm/hypot (; 37 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + local.get $0 + local.get $1 + call $~lib/math/NativeMath.hypot + ) + (func $~lib/math/NativeMath.imul (; 38 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (local $2 f64) + local.get $0 + local.get $1 + f64.add + local.tee $2 + local.get $2 + f64.sub + f64.const 0 + f64.ne + if + f64.const 0 + return + end + local.get $0 + f64.const 4294967296 + local.get $0 + f64.const 2.3283064365386963e-10 + f64.mul + f64.floor + f64.mul + f64.sub + i64.trunc_f64_s + i32.wrap_i64 + local.get $1 + f64.const 4294967296 + local.get $1 + f64.const 2.3283064365386963e-10 + f64.mul + f64.floor + f64.mul + f64.sub + i64.trunc_f64_s + i32.wrap_i64 + i32.mul + f64.convert_i32_s + ) + (func $assembly/libm/imul (; 39 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + local.get $0 + local.get $1 + call $~lib/math/NativeMath.imul + ) + (func $assembly/libm/log (; 40 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + call $~lib/math/NativeMath.log + ) + (func $~lib/math/NativeMath.log10 (; 41 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (local $1 f64) + (local $2 i32) + (local $3 i64) + (local $4 f64) + (local $5 i32) + (local $6 f64) + (local $7 f64) + (local $8 f64) + local.get $0 + i64.reinterpret_f64 + local.tee $3 + i64.const 32 + i64.shr_u + i32.wrap_i64 + local.tee $2 + i32.const 1048576 + i32.lt_u + if (result i32) + i32.const 1 + else + local.get $2 + i32.const 31 + i32.shr_u + end + if + local.get $3 + i64.const 1 + i64.shl + i64.const 0 + i64.eq + if + f64.const -1 + local.get $0 + local.get $0 + f64.mul + f64.div + return + end + local.get $2 + i32.const 31 + i32.shr_u + if + local.get $0 + local.get $0 + f64.sub + f64.const 0 + f64.div + return + end + i32.const -54 + local.set $5 + local.get $0 + f64.const 18014398509481984 + f64.mul + i64.reinterpret_f64 + local.tee $3 + i64.const 32 + i64.shr_u + i32.wrap_i64 + local.set $2 + else + local.get $2 + i32.const 2146435072 + i32.ge_u + if + local.get $0 + return + else + local.get $3 + i64.const 32 + i64.shl + i64.const 0 + i64.eq + i32.const 0 + local.get $2 + i32.const 1072693248 + i32.eq + select + if + f64.const 0 + return + end + end + end + local.get $3 + i64.const 4294967295 + i64.and + local.get $2 + i32.const 614242 + i32.add + local.tee $2 + i32.const 1048575 + i32.and + i32.const 1072079006 + i32.add + i64.extend_i32_u + i64.const 32 + i64.shl + i64.or + f64.reinterpret_i64 + f64.const 1 + f64.sub + local.tee $1 + f64.const 2 + local.get $1 + f64.add + f64.div + local.tee $6 + local.get $6 + f64.mul + local.tee $7 + local.get $7 + f64.mul + local.set $0 + local.get $2 + i32.const 20 + i32.shr_u + i32.const 1023 + i32.sub + local.get $5 + i32.add + f64.convert_i32_s + local.tee $4 + f64.const 0.30102999566361177 + f64.mul + local.set $8 + local.get $4 + f64.const 3.694239077158931e-13 + f64.mul + local.get $1 + local.get $1 + f64.const 0.5 + local.get $1 + f64.mul + local.get $1 + f64.mul + local.tee $1 + f64.sub + i64.reinterpret_f64 + i64.const -4294967296 + i64.and + f64.reinterpret_i64 + local.tee $4 + f64.sub + local.get $1 + f64.sub + local.get $6 + local.get $1 + local.get $7 + f64.const 0.6666666666666735 + local.get $0 + f64.const 0.2857142874366239 + local.get $0 + f64.const 0.1818357216161805 + local.get $0 + f64.const 0.14798198605116586 + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.mul + local.get $0 + f64.const 0.3999999999940942 + local.get $0 + f64.const 0.22222198432149784 + local.get $0 + f64.const 0.15313837699209373 + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.add + f64.mul + f64.add + local.tee $0 + local.get $4 + f64.add + f64.const 2.5082946711645275e-11 + f64.mul + f64.add + local.get $0 + f64.const 0.4342944818781689 + f64.mul + f64.add + local.get $8 + local.get $8 + local.get $4 + f64.const 0.4342944818781689 + f64.mul + local.tee $0 + f64.add + local.tee $1 + f64.sub + local.get $0 + f64.add + f64.add + local.get $1 + f64.add + ) + (func $assembly/libm/log10 (; 42 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + call $~lib/math/NativeMath.log10 + ) + (func $assembly/libm/log1p (; 43 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + call $~lib/math/NativeMath.log1p + ) + (func $~lib/math/NativeMath.log2 (; 44 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (local $1 f64) + (local $2 i32) + (local $3 i64) + (local $4 f64) + (local $5 f64) + (local $6 i32) + (local $7 f64) + local.get $0 + i64.reinterpret_f64 + local.tee $3 + i64.const 32 + i64.shr_u + i32.wrap_i64 + local.tee $2 + i32.const 1048576 + i32.lt_u + if (result i32) + i32.const 1 + else + local.get $2 + i32.const 31 + i32.shr_u + end + if + local.get $3 + i64.const 1 + i64.shl + i64.const 0 + i64.eq + if + f64.const -1 + local.get $0 + local.get $0 + f64.mul + f64.div + return + end + local.get $2 + i32.const 31 + i32.shr_u + if + local.get $0 + local.get $0 + f64.sub + f64.const 0 + f64.div + return + end + i32.const -54 + local.set $6 + local.get $0 + f64.const 18014398509481984 + f64.mul + i64.reinterpret_f64 + local.tee $3 + i64.const 32 + i64.shr_u + i32.wrap_i64 + local.set $2 + else + local.get $2 + i32.const 2146435072 + i32.ge_u + if + local.get $0 + return + else + local.get $3 + i64.const 32 + i64.shl + i64.const 0 + i64.eq + i32.const 0 + local.get $2 + i32.const 1072693248 + i32.eq + select + if + f64.const 0 + return + end + end + end + local.get $3 + i64.const 4294967295 + i64.and + local.get $2 + i32.const 614242 + i32.add + local.tee $2 + i32.const 1048575 + i32.and + i32.const 1072079006 + i32.add + i64.extend_i32_u + i64.const 32 + i64.shl + i64.or + f64.reinterpret_i64 + f64.const 1 + f64.sub + local.tee $1 + f64.const 2 + local.get $1 + f64.add + f64.div + local.tee $4 + local.get $4 + f64.mul + local.tee $5 + local.get $5 + f64.mul + local.set $0 + local.get $1 + local.get $1 + f64.const 0.5 + local.get $1 + f64.mul + local.get $1 + f64.mul + local.tee $1 + f64.sub + i64.reinterpret_f64 + i64.const -4294967296 + i64.and + f64.reinterpret_i64 + local.tee $7 + f64.sub + local.get $1 + f64.sub + local.get $4 + local.get $1 + local.get $5 + f64.const 0.6666666666666735 + local.get $0 + f64.const 0.2857142874366239 + local.get $0 + f64.const 0.1818357216161805 + local.get $0 + f64.const 0.14798198605116586 + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.mul + local.get $0 + f64.const 0.3999999999940942 + local.get $0 + f64.const 0.22222198432149784 + local.get $0 + f64.const 0.15313837699209373 + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.add + f64.mul + f64.add + local.set $0 + local.get $2 + i32.const 20 + i32.shr_u + i32.const 1023 + i32.sub + local.get $6 + i32.add + f64.convert_i32_s + local.tee $4 + local.get $7 + f64.const 1.4426950407214463 + f64.mul + local.tee $5 + f64.add + local.set $1 + local.get $0 + local.get $7 + f64.add + f64.const 1.6751713164886512e-10 + f64.mul + local.get $0 + f64.const 1.4426950407214463 + f64.mul + f64.add + local.get $4 + local.get $1 + f64.sub + local.get $5 + f64.add + f64.add + local.get $1 + f64.add + ) + (func $assembly/libm/log2 (; 45 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + call $~lib/math/NativeMath.log2 + ) + (func $assembly/libm/max (; 46 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + local.get $0 + local.get $1 + f64.max + ) + (func $assembly/libm/min (; 47 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + local.get $0 + local.get $1 + f64.min + ) + (func $~lib/math/NativeMath.pow (; 48 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (local $2 f64) + (local $3 f64) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 f64) + (local $8 i32) + (local $9 i32) + (local $10 f64) + (local $11 i32) + (local $12 i32) + (local $13 i32) + (local $14 f64) + (local $15 f64) + (local $16 i64) + (local $17 i32) + (local $18 f64) + (local $19 i32) + (local $20 f64) + local.get $0 + i64.reinterpret_f64 + local.tee $16 + i32.wrap_i64 + local.set $19 + local.get $16 + i64.const 32 + i64.shr_u + i32.wrap_i64 + local.tee $17 + i32.const 2147483647 + i32.and + local.set $4 + local.get $1 + i64.reinterpret_f64 + local.tee $16 + i64.const 32 + i64.shr_u + i32.wrap_i64 + local.tee $9 + i32.const 2147483647 + i32.and + local.set $8 + local.get $8 + local.get $16 + i32.wrap_i64 + local.tee $6 + i32.or + i32.eqz + if + f64.const 1 + return + end + i32.const 1 + local.get $8 + i32.const 2146435072 + i32.gt_s + local.get $4 + i32.const 2146435072 + i32.gt_s + if (result i32) + i32.const 1 + else + local.get $19 + i32.const 0 + i32.ne + i32.const 0 + local.get $4 + i32.const 2146435072 + i32.eq + select + end + select + if (result i32) + i32.const 1 + else + local.get $6 + i32.const 0 + i32.ne + i32.const 0 + local.get $8 + i32.const 2146435072 + i32.eq + select + end + if + local.get $0 + local.get $1 + f64.add + return + end + local.get $17 + i32.const 0 + i32.lt_s + if + local.get $8 + i32.const 1128267776 + i32.ge_s + if (result i32) + i32.const 2 + else + local.get $8 + i32.const 1072693248 + i32.ge_s + if (result i32) + local.get $6 + local.get $8 + local.get $8 + i32.const 20 + i32.shr_s + i32.const 1023 + i32.sub + local.tee $12 + i32.const 20 + i32.gt_s + local.tee $13 + select + local.tee $5 + local.get $5 + i32.const 52 + i32.const 20 + local.get $13 + select + local.get $12 + i32.sub + local.tee $13 + i32.shr_s + local.tee $5 + local.get $13 + i32.shl + i32.eq + if (result i32) + i32.const 2 + local.get $5 + i32.const 1 + i32.and + i32.sub + else + i32.const 0 + end + else + i32.const 0 + end + end + local.set $11 + end + local.get $6 + i32.eqz + if + local.get $8 + i32.const 2146435072 + i32.eq + if + local.get $4 + i32.const 1072693248 + i32.sub + local.get $19 + i32.or + if + local.get $4 + i32.const 1072693248 + i32.ge_s + if + local.get $9 + i32.const 0 + i32.lt_s + if + f64.const 0 + local.set $1 + end + local.get $1 + return + else + f64.const 0 + local.get $1 + f64.neg + local.get $9 + i32.const 0 + i32.ge_s + select + return + end + unreachable + else + f64.const nan:0x8000000000000 + return + end + unreachable + end + local.get $8 + i32.const 1072693248 + i32.eq + if + local.get $9 + i32.const 0 + i32.ge_s + if + local.get $0 + return + end + f64.const 1 + local.get $0 + f64.div + return + end + local.get $9 + i32.const 1073741824 + i32.eq + if + local.get $0 + local.get $0 + f64.mul + return + end + local.get $9 + i32.const 1071644672 + i32.eq + if + local.get $17 + i32.const 0 + i32.ge_s + if + local.get $0 + f64.sqrt + return + end + end + end + local.get $0 + f64.abs + local.set $3 + local.get $19 + i32.eqz + if + i32.const 1 + local.get $4 + i32.const 1072693248 + i32.eq + local.get $4 + i32.const 2146435072 + i32.eq + i32.const 1 + local.get $4 + select + select + if + f64.const 1 + local.get $3 + f64.div + local.get $3 + local.get $9 + i32.const 0 + i32.lt_s + select + local.set $3 + local.get $17 + i32.const 0 + i32.lt_s + if (result f64) + local.get $4 + i32.const 1072693248 + i32.sub + local.get $11 + i32.or + if (result f64) + local.get $3 + f64.neg + local.get $3 + local.get $11 + i32.const 1 + i32.eq + select + else + local.get $3 + local.get $3 + f64.sub + local.tee $0 + local.get $0 + f64.div + end + else + local.get $3 + end + return + end + end + f64.const 1 + local.set $7 + local.get $17 + i32.const 0 + i32.lt_s + if + local.get $11 + i32.eqz + if + local.get $0 + local.get $0 + f64.sub + local.tee $0 + local.get $0 + f64.div + return + end + f64.const -1 + f64.const 1 + local.get $11 + i32.const 1 + i32.eq + select + local.set $7 + end + local.get $8 + i32.const 1105199104 + i32.gt_s + if (result f64) + local.get $8 + i32.const 1139802112 + i32.gt_s + if + local.get $4 + i32.const 1072693247 + i32.le_s + if + f64.const inf + f64.const 0 + local.get $9 + i32.const 0 + i32.lt_s + select + return + end + local.get $4 + i32.const 1072693248 + i32.ge_s + if + f64.const inf + f64.const 0 + local.get $9 + i32.const 0 + i32.gt_s + select + return + end + end + local.get $4 + i32.const 1072693247 + i32.lt_s + if + local.get $9 + i32.const 0 + i32.lt_s + if (result f64) + local.get $7 + f64.const 1.e+300 + f64.mul + f64.const 1.e+300 + f64.mul + else + local.get $7 + f64.const 1e-300 + f64.mul + f64.const 1e-300 + f64.mul + end + return + end + local.get $4 + i32.const 1072693248 + i32.gt_s + if + local.get $9 + i32.const 0 + i32.gt_s + if (result f64) + local.get $7 + f64.const 1.e+300 + f64.mul + f64.const 1.e+300 + f64.mul + else + local.get $7 + f64.const 1e-300 + f64.mul + f64.const 1e-300 + f64.mul + end + return + end + local.get $3 + f64.const 1 + f64.sub + local.tee $2 + local.get $2 + f64.mul + f64.const 0.5 + local.get $2 + f64.const 0.3333333333333333 + local.get $2 + f64.const 0.25 + f64.mul + f64.sub + f64.mul + f64.sub + f64.mul + local.set $0 + f64.const 1.4426950216293335 + local.get $2 + f64.mul + local.tee $3 + local.get $2 + f64.const 1.9259629911266175e-08 + f64.mul + local.get $0 + f64.const 1.4426950408889634 + f64.mul + f64.sub + local.tee $0 + f64.add + i64.reinterpret_f64 + i64.const -4294967296 + i64.and + f64.reinterpret_i64 + local.set $10 + local.get $0 + local.get $10 + local.get $3 + f64.sub + f64.sub + else + i32.const 0 + local.set $6 + local.get $4 + i32.const 1048576 + i32.lt_s + if (result i32) + local.get $3 + f64.const 9007199254740992 + f64.mul + local.tee $3 + i64.reinterpret_f64 + i64.const 32 + i64.shr_u + i32.wrap_i64 + local.set $4 + i32.const -53 + else + i32.const 0 + end + local.get $4 + i32.const 20 + i32.shr_s + i32.const 1023 + i32.sub + i32.add + local.set $6 + local.get $4 + i32.const 1048575 + i32.and + local.tee $5 + i32.const 1072693248 + i32.or + local.set $4 + local.get $5 + i32.const 235662 + i32.le_s + if (result i32) + i32.const 0 + else + local.get $5 + i32.const 767610 + i32.lt_s + if (result i32) + i32.const 1 + else + local.get $6 + i32.const 1 + i32.add + local.set $6 + local.get $4 + i32.const -1048576 + i32.add + local.set $4 + i32.const 0 + end + end + local.set $5 + local.get $3 + i64.reinterpret_f64 + i64.const 4294967295 + i64.and + local.get $4 + i64.extend_i32_s + i64.const 32 + i64.shl + i64.or + f64.reinterpret_i64 + local.tee $3 + f64.const 1.5 + f64.const 1 + local.get $5 + select + local.tee $0 + f64.sub + local.tee $10 + f64.const 1 + local.get $3 + local.get $0 + f64.add + f64.div + local.tee $2 + f64.mul + local.tee $18 + i64.reinterpret_f64 + i64.const -4294967296 + i64.and + f64.reinterpret_i64 + local.set $14 + local.get $3 + local.get $4 + i32.const 1 + i32.shr_s + i32.const 536870912 + i32.or + i32.const 524288 + i32.add + local.get $5 + i32.const 18 + i32.shl + i32.add + i64.extend_i32_s + i64.const 32 + i64.shl + f64.reinterpret_i64 + local.tee $3 + local.get $0 + f64.sub + f64.sub + local.set $0 + f64.const 0.9617967009544373 + local.get $14 + f64.const 3 + local.get $14 + local.get $14 + f64.mul + local.tee $20 + f64.add + local.get $18 + local.get $18 + f64.mul + local.tee $15 + local.get $15 + f64.mul + f64.const 0.5999999999999946 + local.get $15 + f64.const 0.4285714285785502 + local.get $15 + f64.const 0.33333332981837743 + local.get $15 + f64.const 0.272728123808534 + local.get $15 + f64.const 0.23066074577556175 + local.get $15 + f64.const 0.20697501780033842 + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.mul + local.get $2 + local.get $10 + local.get $14 + local.get $3 + f64.mul + f64.sub + local.get $14 + local.get $0 + f64.mul + f64.sub + f64.mul + local.tee $2 + local.get $14 + local.get $18 + f64.add + f64.mul + f64.add + local.tee $0 + f64.add + i64.reinterpret_f64 + i64.const -4294967296 + i64.and + f64.reinterpret_i64 + local.tee $10 + f64.mul + local.tee $3 + local.get $2 + local.get $10 + f64.mul + local.get $0 + local.get $10 + f64.const 3 + f64.sub + local.get $20 + f64.sub + f64.sub + local.get $18 + f64.mul + f64.add + local.tee $0 + f64.add + i64.reinterpret_f64 + i64.const -4294967296 + i64.and + f64.reinterpret_i64 + local.tee $2 + f64.mul + local.tee $20 + f64.const -7.028461650952758e-09 + local.get $2 + f64.mul + local.get $0 + local.get $2 + local.get $3 + f64.sub + f64.sub + f64.const 0.9617966939259756 + f64.mul + f64.add + f64.const 1.350039202129749e-08 + f64.const 0 + local.get $5 + select + f64.add + local.tee $2 + f64.add + f64.const 0.5849624872207642 + f64.const 0 + local.get $5 + select + local.tee $3 + f64.add + local.get $6 + f64.convert_i32_s + local.tee $0 + f64.add + i64.reinterpret_f64 + i64.const -4294967296 + i64.and + f64.reinterpret_i64 + local.set $10 + local.get $2 + local.get $10 + local.get $0 + f64.sub + local.get $3 + f64.sub + local.get $20 + f64.sub + f64.sub + end + local.set $3 + local.get $1 + local.get $1 + i64.reinterpret_f64 + i64.const -4294967296 + i64.and + f64.reinterpret_i64 + local.tee $0 + f64.sub + local.get $10 + f64.mul + local.get $1 + local.get $3 + f64.mul + f64.add + local.tee $1 + local.get $0 + local.get $10 + f64.mul + local.tee $2 + f64.add + local.tee $0 + i64.reinterpret_f64 + local.tee $16 + i32.wrap_i64 + local.set $5 + block $folding-inner1 + block $folding-inner0 + local.get $16 + i64.const 32 + i64.shr_u + i32.wrap_i64 + local.tee $12 + i32.const 1083179008 + i32.ge_s + if + local.get $12 + i32.const 1083179008 + i32.sub + local.get $5 + i32.or + br_if $folding-inner0 + local.get $1 + f64.const 8.008566259537294e-17 + f64.add + local.get $0 + local.get $2 + f64.sub + f64.gt + br_if $folding-inner0 + else + local.get $12 + i32.const 2147483647 + i32.and + i32.const 1083231232 + i32.ge_s + if + local.get $12 + i32.const -1064252416 + i32.sub + local.get $5 + i32.or + br_if $folding-inner1 + local.get $1 + local.get $0 + local.get $2 + f64.sub + f64.le + br_if $folding-inner1 + end + end + local.get $12 + i32.const 2147483647 + i32.and + local.tee $13 + i32.const 20 + i32.shr_s + i32.const 1023 + i32.sub + local.set $5 + i32.const 0 + local.set $6 + local.get $13 + i32.const 1071644672 + i32.gt_s + if + i32.const 1048576 + local.get $5 + i32.const 1 + i32.add + i32.shr_s + local.get $12 + i32.add + local.tee $13 + i32.const 2147483647 + i32.and + i32.const 20 + i32.shr_s + i32.const 1023 + i32.sub + local.set $5 + i32.const 1048575 + local.get $5 + i32.shr_s + i32.const -1 + i32.xor + local.get $13 + i32.and + i64.extend_i32_s + i64.const 32 + i64.shl + f64.reinterpret_i64 + local.set $0 + local.get $13 + i32.const 1048575 + i32.and + i32.const 1048576 + i32.or + i32.const 20 + local.get $5 + i32.sub + i32.shr_s + local.set $6 + i32.const 0 + local.get $6 + i32.sub + local.get $6 + local.get $12 + i32.const 0 + i32.lt_s + select + local.set $6 + local.get $2 + local.get $0 + f64.sub + local.set $2 + end + local.get $1 + local.get $2 + f64.add + i64.reinterpret_f64 + i64.const -4294967296 + i64.and + f64.reinterpret_i64 + local.tee $0 + f64.const 0.6931471824645996 + f64.mul + local.tee $3 + local.get $1 + local.get $0 + local.get $2 + f64.sub + f64.sub + f64.const 0.6931471805599453 + f64.mul + local.get $0 + f64.const -1.904654299957768e-09 + f64.mul + f64.add + local.tee $1 + f64.add + local.tee $2 + local.get $2 + f64.mul + local.set $0 + local.get $7 + f64.const 1 + local.get $2 + local.get $2 + local.get $0 + f64.const 0.16666666666666602 + local.get $0 + f64.const -2.7777777777015593e-03 + local.get $0 + f64.const 6.613756321437934e-05 + local.get $0 + f64.const -1.6533902205465252e-06 + local.get $0 + f64.const 4.1381367970572385e-08 + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.sub + local.tee $0 + f64.mul + local.get $0 + f64.const 2 + f64.sub + f64.div + local.get $1 + local.get $2 + local.get $3 + f64.sub + f64.sub + local.tee $0 + local.get $2 + local.get $0 + f64.mul + f64.add + f64.sub + local.get $2 + f64.sub + f64.sub + local.tee $0 + i64.reinterpret_f64 + i64.const 32 + i64.shr_u + i32.wrap_i64 + local.get $6 + i32.const 20 + i32.shl + i32.add + local.tee $5 + i32.const 20 + i32.shr_s + i32.const 0 + i32.le_s + if (result f64) + local.get $0 + local.get $6 + call $~lib/math/NativeMath.scalbn + else + local.get $0 + i64.reinterpret_f64 + i64.const 4294967295 + i64.and + local.get $5 + i64.extend_i32_s + i64.const 32 + i64.shl + i64.or + f64.reinterpret_i64 + end + f64.mul + return + end + local.get $7 + f64.const 1.e+300 + f64.mul + f64.const 1.e+300 + f64.mul + return + end + local.get $7 + f64.const 1e-300 + f64.mul + f64.const 1e-300 + f64.mul + ) + (func $assembly/libm/pow (; 49 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + local.get $0 + local.get $1 + call $~lib/math/NativeMath.pow + ) + (func $assembly/libm/round (; 50 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + f64.const 0.5 + f64.add + f64.floor + local.get $0 + f64.copysign + ) + (func $assembly/libm/sign (; 51 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + f64.const 0 + f64.gt + if + f64.const 1 + local.set $0 + else + local.get $0 + f64.const 0 + f64.lt + if + f64.const -1 + local.set $0 + end + end + local.get $0 + ) + (func $assembly/libm/sin (; 52 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + call $~lib/bindings/Math/sin + ) + (func $~lib/math/NativeMath.sinh (; 53 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (local $1 f64) + (local $2 f64) + (local $3 i32) + (local $4 i64) + local.get $0 + i64.reinterpret_f64 + i64.const 9223372036854775807 + i64.and + local.tee $4 + f64.reinterpret_i64 + local.set $1 + f64.const 0.5 + local.get $0 + f64.copysign + local.set $2 + local.get $4 + i64.const 32 + i64.shr_u + i32.wrap_i64 + local.tee $3 + i32.const 1082535490 + i32.lt_u + if + local.get $1 + call $~lib/math/NativeMath.expm1 + local.set $1 + local.get $3 + i32.const 1072693248 + i32.lt_u + if + local.get $3 + i32.const 1045430272 + i32.lt_u + if + local.get $0 + return + end + local.get $2 + f64.const 2 + local.get $1 + f64.mul + local.get $1 + local.get $1 + f64.mul + local.get $1 + f64.const 1 + f64.add + f64.div + f64.sub + f64.mul + return + end + local.get $2 + local.get $1 + local.get $1 + local.get $1 + f64.const 1 + f64.add + f64.div + f64.add + f64.mul + return + end + f64.const 2 + local.get $2 + f64.mul + local.get $1 + f64.const 1416.0996898839683 + f64.sub + call $~lib/math/NativeMath.exp + f64.const 2247116418577894884661631e283 + f64.mul + f64.const 2247116418577894884661631e283 + f64.mul + f64.mul + ) + (func $assembly/libm/sinh (; 54 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + call $~lib/math/NativeMath.sinh + ) + (func $assembly/libm/sqrt (; 55 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + f64.sqrt + ) + (func $assembly/libm/tan (; 56 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + call $~lib/bindings/Math/tan + ) + (func $~lib/math/NativeMath.tanh (; 57 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (local $1 f64) + (local $2 i32) + (local $3 i64) + local.get $0 + i64.reinterpret_f64 + i64.const 9223372036854775807 + i64.and + local.tee $3 + f64.reinterpret_i64 + local.set $1 + local.get $3 + i64.const 32 + i64.shr_u + i32.wrap_i64 + local.tee $2 + i32.const 1071748074 + i32.gt_u + if + local.get $2 + i32.const 1077149696 + i32.gt_u + if (result f64) + f64.const 1 + f64.const 0 + local.get $1 + f64.div + f64.sub + else + f64.const 1 + f64.const 2 + f64.const 2 + local.get $1 + f64.mul + call $~lib/math/NativeMath.expm1 + f64.const 2 + f64.add + f64.div + f64.sub + end + local.set $1 + else + local.get $2 + i32.const 1070618798 + i32.gt_u + if + f64.const 2 + local.get $1 + f64.mul + call $~lib/math/NativeMath.expm1 + local.tee $1 + local.get $1 + f64.const 2 + f64.add + f64.div + local.set $1 + else + local.get $2 + i32.const 1048576 + i32.ge_u + if + f64.const -2 + local.get $1 + f64.mul + call $~lib/math/NativeMath.expm1 + local.tee $1 + f64.neg + local.get $1 + f64.const 2 + f64.add + f64.div + local.set $1 + end + end + end + local.get $1 + local.get $0 + f64.copysign + ) + (func $assembly/libm/tanh (; 58 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + call $~lib/math/NativeMath.tanh + ) + (func $assembly/libm/trunc (; 59 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + f64.trunc + ) + (func $null (; 60 ;) (type $FUNCSIG$v) + nop + ) +) diff --git a/lib/libm/build/libmf.wat b/lib/libm/build/libmf.wat new file mode 100644 index 0000000000..6841cb6a45 --- /dev/null +++ b/lib/libm/build/libmf.wat @@ -0,0 +1,4763 @@ +(module + (type $FUNCSIG$ff (func (param f32) (result f32))) + (type $FUNCSIG$fff (func (param f32 f32) (result f32))) + (type $FUNCSIG$ffi (func (param f32 i32) (result f32))) + (type $FUNCSIG$v (func)) + (memory $0 1) + (data (i32.const 8) " \00\00\00\01\00\00\00\00\00\00\00 \00\00\00)\15DNn\83\f9\a2\c0\dd4\f5\d1W\'\fcA\90C<\99\95b\dba\c5\bb\de\abcQ\fe") + (data (i32.const 56) "\10\00\00\00\01\00\00\00\03\00\00\00\10\00\00\00\18\00\00\00\18\00\00\00 \00\00\00\04") + (global $assembly/libmf/E f32 (f32.const 2.7182817459106445)) + (global $assembly/libmf/LN10 f32 (f32.const 2.3025851249694824)) + (global $assembly/libmf/LN2 f32 (f32.const 0.6931471824645996)) + (global $assembly/libmf/LOG10E f32 (f32.const 0.4342944920063019)) + (global $assembly/libmf/LOG2E f32 (f32.const 1.4426950216293335)) + (global $assembly/libmf/PI f32 (f32.const 3.1415927410125732)) + (global $assembly/libmf/SQRT1_2 f32 (f32.const 0.7071067690849304)) + (global $assembly/libmf/SQRT2 f32 (f32.const 1.4142135381698608)) + (global $~lib/math/rempio2f_y (mut f64) (f64.const 0)) + (export "memory" (memory $0)) + (export "E" (global $assembly/libmf/E)) + (export "LN10" (global $assembly/libmf/LN10)) + (export "LN2" (global $assembly/libmf/LN2)) + (export "LOG10E" (global $assembly/libmf/LOG10E)) + (export "LOG2E" (global $assembly/libmf/LOG2E)) + (export "PI" (global $assembly/libmf/PI)) + (export "SQRT1_2" (global $assembly/libmf/SQRT1_2)) + (export "SQRT2" (global $assembly/libmf/SQRT2)) + (export "abs" (func $assembly/libmf/abs)) + (export "acos" (func $assembly/libmf/acos)) + (export "acosh" (func $assembly/libmf/acosh)) + (export "asin" (func $assembly/libmf/asin)) + (export "asinh" (func $assembly/libmf/asinh)) + (export "atan" (func $assembly/libmf/atan)) + (export "atanh" (func $assembly/libmf/atanh)) + (export "atan2" (func $assembly/libmf/atan2)) + (export "cbrt" (func $assembly/libmf/cbrt)) + (export "ceil" (func $assembly/libmf/ceil)) + (export "clz32" (func $assembly/libmf/clz32)) + (export "cos" (func $assembly/libmf/cos)) + (export "cosh" (func $assembly/libmf/cosh)) + (export "exp" (func $assembly/libmf/exp)) + (export "expm1" (func $assembly/libmf/expm1)) + (export "floor" (func $assembly/libmf/floor)) + (export "fround" (func $assembly/libmf/fround)) + (export "hypot" (func $assembly/libmf/hypot)) + (export "imul" (func $assembly/libmf/imul)) + (export "log" (func $assembly/libmf/log)) + (export "log10" (func $assembly/libmf/log10)) + (export "log1p" (func $assembly/libmf/log1p)) + (export "log2" (func $assembly/libmf/log2)) + (export "max" (func $assembly/libmf/max)) + (export "min" (func $assembly/libmf/min)) + (export "pow" (func $assembly/libmf/pow)) + (export "round" (func $assembly/libmf/round)) + (export "sign" (func $assembly/libmf/sign)) + (export "sin" (func $assembly/libmf/sin)) + (export "sinh" (func $assembly/libmf/sinh)) + (export "sqrt" (func $assembly/libmf/sqrt)) + (export "tan" (func $assembly/libmf/tan)) + (export "tanh" (func $assembly/libmf/tanh)) + (export "trunc" (func $assembly/libmf/trunc)) + (func $assembly/libmf/abs (; 0 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + f32.abs + ) + (func $~lib/math/NativeMathf.acos (; 1 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 f32) + (local $2 i32) + (local $3 i32) + (local $4 f32) + local.get $0 + i32.reinterpret_f32 + local.tee $3 + i32.const 2147483647 + i32.and + local.tee $2 + i32.const 1065353216 + i32.ge_u + if + local.get $2 + i32.const 1065353216 + i32.eq + if + local.get $3 + i32.const 31 + i32.shr_u + if + f32.const 3.141592502593994 + return + end + f32.const 0 + return + end + f32.const 0 + local.get $0 + local.get $0 + f32.sub + f32.div + return + end + local.get $2 + i32.const 1056964608 + i32.lt_u + if + local.get $2 + i32.const 847249408 + i32.le_u + if + f32.const 1.570796251296997 + return + end + f32.const 1.570796251296997 + local.get $0 + f32.const 7.549789415861596e-08 + local.get $0 + local.get $0 + local.get $0 + f32.mul + local.tee $0 + f32.const 0.16666586697101593 + local.get $0 + f32.const -0.04274342209100723 + local.get $0 + f32.const -0.008656363002955914 + f32.mul + f32.add + f32.mul + f32.add + f32.mul + f32.const 1 + local.get $0 + f32.const -0.7066296339035034 + f32.mul + f32.add + f32.div + f32.mul + f32.sub + f32.sub + f32.sub + return + end + local.get $3 + i32.const 31 + i32.shr_u + if + f32.const 0.5 + local.get $0 + f32.const 0.5 + f32.mul + f32.add + local.tee $0 + f32.const 0.16666586697101593 + local.get $0 + f32.const -0.04274342209100723 + local.get $0 + f32.const -0.008656363002955914 + f32.mul + f32.add + f32.mul + f32.add + f32.mul + f32.const 1 + local.get $0 + f32.const -0.7066296339035034 + f32.mul + f32.add + f32.div + local.set $1 + f32.const 2 + f32.const 1.570796251296997 + local.get $0 + f32.sqrt + local.tee $0 + local.get $1 + local.get $0 + f32.mul + f32.const 7.549789415861596e-08 + f32.sub + f32.add + f32.sub + f32.mul + return + end + f32.const 2 + f32.const 0.5 + local.get $0 + f32.const 0.5 + f32.mul + f32.sub + local.tee $0 + f32.sqrt + local.tee $4 + i32.reinterpret_f32 + i32.const -4096 + i32.and + f32.reinterpret_i32 + local.tee $1 + local.get $0 + f32.const 0.16666586697101593 + local.get $0 + f32.const -0.04274342209100723 + local.get $0 + f32.const -0.008656363002955914 + f32.mul + f32.add + f32.mul + f32.add + f32.mul + f32.const 1 + local.get $0 + f32.const -0.7066296339035034 + f32.mul + f32.add + f32.div + local.get $4 + f32.mul + local.get $0 + local.get $1 + local.get $1 + f32.mul + f32.sub + local.get $4 + local.get $1 + f32.add + f32.div + f32.add + f32.add + f32.mul + ) + (func $assembly/libmf/acos (; 2 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.acos + ) + (func $~lib/math/NativeMathf.log1p (; 3 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 f32) + (local $2 i32) + (local $3 i32) + (local $4 f32) + (local $5 f32) + (local $6 f32) + i32.const 1 + local.set $3 + local.get $0 + i32.reinterpret_f32 + local.tee $2 + i32.const 1054086096 + i32.lt_u + if (result i32) + i32.const 1 + else + local.get $2 + i32.const 31 + i32.shr_u + end + if + local.get $2 + i32.const -1082130432 + i32.ge_u + if + local.get $0 + f32.const -1 + f32.eq + if + local.get $0 + f32.const 0 + f32.div + return + end + local.get $0 + local.get $0 + f32.sub + f32.const 0 + f32.div + return + end + local.get $2 + i32.const 1 + i32.shl + i32.const 1728053248 + i32.lt_u + if + local.get $0 + return + end + local.get $2 + i32.const -1097468391 + i32.le_u + if + i32.const 0 + local.set $3 + local.get $0 + local.set $1 + end + else + local.get $2 + i32.const 2139095040 + i32.ge_u + if + local.get $0 + return + end + end + local.get $3 + if + f32.const 1 + local.get $0 + f32.add + local.tee $1 + i32.reinterpret_f32 + i32.const 4913933 + i32.add + local.tee $2 + i32.const 23 + i32.shr_u + i32.const 127 + i32.sub + local.tee $3 + i32.const 25 + i32.lt_s + if (result f32) + f32.const 1 + local.get $1 + local.get $0 + f32.sub + f32.sub + local.get $0 + local.get $1 + f32.const 1 + f32.sub + f32.sub + local.get $3 + i32.const 2 + i32.ge_s + select + local.get $1 + f32.div + else + f32.const 0 + end + local.set $5 + local.get $2 + i32.const 8388607 + i32.and + i32.const 1060439283 + i32.add + f32.reinterpret_i32 + f32.const 1 + f32.sub + local.set $1 + end + local.get $1 + f32.const 2 + local.get $1 + f32.add + f32.div + local.tee $4 + local.get $4 + f32.mul + local.tee $6 + local.get $6 + f32.mul + local.set $0 + local.get $4 + f32.const 0.5 + local.get $1 + f32.mul + local.get $1 + f32.mul + local.tee $4 + local.get $6 + f32.const 0.6666666269302368 + local.get $0 + f32.const 0.2849878668785095 + f32.mul + f32.add + f32.mul + local.get $0 + f32.const 0.40000972151756287 + local.get $0 + f32.const 0.24279078841209412 + f32.mul + f32.add + f32.mul + f32.add + f32.add + f32.mul + local.get $3 + f32.convert_i32_s + local.tee $0 + f32.const 9.05800061445916e-06 + f32.mul + local.get $5 + f32.add + f32.add + local.get $4 + f32.sub + local.get $1 + f32.add + local.get $0 + f32.const 0.6931381225585938 + f32.mul + f32.add + ) + (func $~lib/math/NativeMathf.log (; 4 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + (local $2 f32) + (local $3 f32) + (local $4 i32) + (local $5 f32) + local.get $0 + i32.reinterpret_f32 + local.tee $1 + i32.const 8388608 + i32.lt_u + if (result i32) + i32.const 1 + else + local.get $1 + i32.const 31 + i32.shr_u + end + if + local.get $1 + i32.const 1 + i32.shl + i32.eqz + if + f32.const -1 + local.get $0 + local.get $0 + f32.mul + f32.div + return + end + local.get $1 + i32.const 31 + i32.shr_u + if + local.get $0 + local.get $0 + f32.sub + f32.const 0 + f32.div + return + end + i32.const -25 + local.set $4 + local.get $0 + f32.const 33554432 + f32.mul + i32.reinterpret_f32 + local.set $1 + else + local.get $1 + i32.const 2139095040 + i32.ge_u + if + local.get $0 + return + else + local.get $1 + i32.const 1065353216 + i32.eq + if + f32.const 0 + return + end + end + end + local.get $1 + i32.const 4913933 + i32.add + local.tee $1 + i32.const 8388607 + i32.and + i32.const 1060439283 + i32.add + f32.reinterpret_i32 + f32.const 1 + f32.sub + local.tee $0 + f32.const 2 + local.get $0 + f32.add + f32.div + local.tee $3 + local.get $3 + f32.mul + local.tee $5 + local.get $5 + f32.mul + local.set $2 + local.get $3 + f32.const 0.5 + local.get $0 + f32.mul + local.get $0 + f32.mul + local.tee $3 + local.get $5 + f32.const 0.6666666269302368 + local.get $2 + f32.const 0.2849878668785095 + f32.mul + f32.add + f32.mul + local.get $2 + f32.const 0.40000972151756287 + local.get $2 + f32.const 0.24279078841209412 + f32.mul + f32.add + f32.mul + f32.add + f32.add + f32.mul + local.get $1 + i32.const 23 + i32.shr_s + i32.const 127 + i32.sub + local.get $4 + i32.add + f32.convert_i32_s + local.tee $2 + f32.const 9.05800061445916e-06 + f32.mul + f32.add + local.get $3 + f32.sub + local.get $0 + f32.add + local.get $2 + f32.const 0.6931381225585938 + f32.mul + f32.add + ) + (func $~lib/math/NativeMathf.acosh (; 5 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + local.get $0 + i32.reinterpret_f32 + i32.const 2147483647 + i32.and + local.tee $1 + i32.const 1073741824 + i32.lt_u + if + local.get $0 + f32.const 1 + f32.sub + local.tee $0 + local.get $0 + local.get $0 + f32.const 2 + f32.add + f32.mul + f32.sqrt + f32.add + call $~lib/math/NativeMathf.log1p + return + end + local.get $1 + i32.const 1166016512 + i32.lt_u + if + f32.const 2 + local.get $0 + f32.mul + f32.const 1 + local.get $0 + local.get $0 + local.get $0 + f32.mul + f32.const 1 + f32.sub + f32.sqrt + f32.add + f32.div + f32.sub + call $~lib/math/NativeMathf.log + return + end + local.get $0 + call $~lib/math/NativeMathf.log + f32.const 0.6931471824645996 + f32.add + ) + (func $assembly/libmf/acosh (; 6 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.acosh + ) + (func $~lib/math/NativeMathf.asin (; 7 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + (local $2 f32) + (local $3 f32) + (local $4 f64) + local.get $0 + i32.reinterpret_f32 + i32.const 2147483647 + i32.and + local.tee $1 + i32.const 1065353216 + i32.ge_u + if + local.get $1 + i32.const 1065353216 + i32.eq + if + local.get $0 + f32.const 1.5707963705062866 + f32.mul + f32.const 7.52316384526264e-37 + f32.add + return + end + f32.const 0 + local.get $0 + local.get $0 + f32.sub + f32.div + return + end + local.get $1 + i32.const 1056964608 + i32.lt_u + if + local.get $1 + i32.const 8388608 + i32.ge_u + i32.const 0 + local.get $1 + i32.const 964689920 + i32.lt_u + select + if + local.get $0 + return + end + local.get $0 + local.get $0 + local.get $0 + local.get $0 + f32.mul + local.tee $0 + f32.const 0.16666586697101593 + local.get $0 + f32.const -0.04274342209100723 + local.get $0 + f32.const -0.008656363002955914 + f32.mul + f32.add + f32.mul + f32.add + f32.mul + f32.const 1 + local.get $0 + f32.const -0.7066296339035034 + f32.mul + f32.add + f32.div + f32.mul + f32.add + return + end + f32.const 0.5 + local.get $0 + f32.abs + f32.const 0.5 + f32.mul + f32.sub + local.tee $2 + f32.const 0.16666586697101593 + local.get $2 + f32.const -0.04274342209100723 + local.get $2 + f32.const -0.008656363002955914 + f32.mul + f32.add + f32.mul + f32.add + f32.mul + f32.const 1 + local.get $2 + f32.const -0.7066296339035034 + f32.mul + f32.add + f32.div + local.set $3 + f64.const 1.5707963705062866 + f64.const 2 + local.get $2 + f64.promote_f32 + f64.sqrt + local.tee $4 + local.get $4 + local.get $3 + f64.promote_f32 + f64.mul + f64.add + f64.mul + f64.sub + f32.demote_f64 + local.get $0 + f32.copysign + ) + (func $assembly/libmf/asin (; 8 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.asin + ) + (func $~lib/math/NativeMathf.asinh (; 9 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 f32) + (local $2 i32) + local.get $0 + i32.reinterpret_f32 + i32.const 2147483647 + i32.and + local.tee $2 + f32.reinterpret_i32 + local.set $1 + local.get $2 + i32.const 1166016512 + i32.ge_u + if (result f32) + local.get $1 + call $~lib/math/NativeMathf.log + f32.const 0.6931471824645996 + f32.add + else + local.get $2 + i32.const 1073741824 + i32.ge_u + if (result f32) + f32.const 2 + local.get $1 + f32.mul + f32.const 1 + local.get $1 + local.get $1 + f32.mul + f32.const 1 + f32.add + f32.sqrt + local.get $1 + f32.add + f32.div + f32.add + call $~lib/math/NativeMathf.log + else + local.get $2 + i32.const 964689920 + i32.ge_u + if (result f32) + local.get $1 + local.get $1 + local.get $1 + f32.mul + local.tee $1 + local.get $1 + f32.const 1 + f32.add + f32.sqrt + f32.const 1 + f32.add + f32.div + f32.add + call $~lib/math/NativeMathf.log1p + else + local.get $1 + end + end + end + local.get $0 + f32.copysign + ) + (func $assembly/libmf/asinh (; 10 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.asinh + ) + (func $~lib/math/NativeMathf.atan (; 11 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + (local $2 f32) + (local $3 f32) + (local $4 f32) + local.get $0 + local.set $3 + local.get $0 + i32.reinterpret_f32 + i32.const 2147483647 + i32.and + local.tee $1 + i32.const 1283457024 + i32.ge_u + if + local.get $0 + local.get $0 + f32.ne + if + local.get $0 + return + end + f32.const 1.570796251296997 + local.get $3 + f32.copysign + return + end + local.get $1 + i32.const 1054867456 + i32.lt_u + if + local.get $1 + i32.const 964689920 + i32.lt_u + if + local.get $0 + return + end + i32.const -1 + local.set $1 + else + local.get $0 + f32.abs + local.set $0 + local.get $1 + i32.const 1066926080 + i32.lt_u + if (result f32) + local.get $1 + i32.const 1060110336 + i32.lt_u + if (result f32) + i32.const 0 + local.set $1 + f32.const 2 + local.get $0 + f32.mul + f32.const 1 + f32.sub + f32.const 2 + local.get $0 + f32.add + f32.div + else + i32.const 1 + local.set $1 + local.get $0 + f32.const 1 + f32.sub + local.get $0 + f32.const 1 + f32.add + f32.div + end + else + local.get $1 + i32.const 1075576832 + i32.lt_u + if (result f32) + i32.const 2 + local.set $1 + local.get $0 + f32.const 1.5 + f32.sub + f32.const 1 + f32.const 1.5 + local.get $0 + f32.mul + f32.add + f32.div + else + i32.const 3 + local.set $1 + f32.const -1 + local.get $0 + f32.div + end + end + local.set $0 + end + local.get $0 + local.get $0 + f32.mul + local.tee $4 + local.get $4 + f32.mul + local.set $2 + local.get $0 + local.get $4 + f32.const 0.333333283662796 + local.get $2 + f32.const 0.14253635704517365 + local.get $2 + f32.const 0.06168760731816292 + f32.mul + f32.add + f32.mul + f32.add + f32.mul + local.get $2 + f32.const -0.19999158382415771 + local.get $2 + f32.const -0.106480173766613 + f32.mul + f32.add + f32.mul + f32.add + f32.mul + local.set $2 + local.get $1 + i32.const 0 + i32.lt_s + if + local.get $0 + local.get $2 + f32.sub + return + end + block $break|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + local.get $1 + if + local.get $1 + i32.const 1 + i32.sub + br_table $case1|0 $case2|0 $case3|0 $case4|0 + end + f32.const 0.46364760398864746 + local.get $2 + f32.const 5.01215824399992e-09 + f32.sub + local.get $0 + f32.sub + f32.sub + local.set $0 + br $break|0 + end + f32.const 0.7853981256484985 + local.get $2 + f32.const 3.774894707930798e-08 + f32.sub + local.get $0 + f32.sub + f32.sub + local.set $0 + br $break|0 + end + f32.const 0.9827936887741089 + local.get $2 + f32.const 3.447321716976148e-08 + f32.sub + local.get $0 + f32.sub + f32.sub + local.set $0 + br $break|0 + end + f32.const 1.570796251296997 + local.get $2 + f32.const 7.549789415861596e-08 + f32.sub + local.get $0 + f32.sub + f32.sub + local.set $0 + br $break|0 + end + unreachable + end + local.get $0 + local.get $3 + f32.copysign + ) + (func $assembly/libmf/atan (; 12 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.atan + ) + (func $~lib/math/NativeMathf.atanh (; 13 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 f32) + (local $2 i32) + local.get $0 + i32.reinterpret_f32 + i32.const 2147483647 + i32.and + local.tee $2 + f32.reinterpret_i32 + local.set $1 + local.get $2 + i32.const 1056964608 + i32.lt_u + if (result f32) + local.get $2 + i32.const 796917760 + i32.ge_u + if (result f32) + f32.const 0.5 + f32.const 2 + local.get $1 + f32.mul + f32.const 1 + local.get $1 + f32.const 1 + local.get $1 + f32.sub + f32.div + f32.add + f32.mul + call $~lib/math/NativeMathf.log1p + f32.mul + else + local.get $1 + end + else + f32.const 0.5 + f32.const 2 + local.get $1 + f32.const 1 + local.get $1 + f32.sub + f32.div + f32.mul + call $~lib/math/NativeMathf.log1p + f32.mul + end + local.get $0 + f32.copysign + ) + (func $assembly/libmf/atanh (; 14 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.atanh + ) + (func $~lib/math/NativeMathf.atan2 (; 15 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + i32.const 1 + local.get $0 + local.get $0 + f32.ne + local.get $1 + local.get $1 + f32.ne + select + if + local.get $1 + local.get $0 + f32.add + return + end + local.get $0 + i32.reinterpret_f32 + local.set $3 + local.get $1 + i32.reinterpret_f32 + local.tee $4 + i32.const 1065353216 + i32.eq + if + local.get $0 + call $~lib/math/NativeMathf.atan + return + end + local.get $4 + i32.const 30 + i32.shr_u + i32.const 2 + i32.and + local.get $3 + i32.const 31 + i32.shr_u + i32.or + local.set $2 + local.get $4 + i32.const 2147483647 + i32.and + local.set $4 + local.get $3 + i32.const 2147483647 + i32.and + local.tee $3 + i32.eqz + if + block $break|0 + block $case3|0 + block $case2|0 + block $case1|0 + local.get $2 + i32.eqz + br_if $case1|0 + block $tablify|0 + local.get $2 + i32.const 1 + i32.sub + br_table $case1|0 $case2|0 $case3|0 $tablify|0 + end + br $break|0 + end + local.get $0 + return + end + f32.const 3.1415927410125732 + return + end + f32.const -3.1415927410125732 + return + end + end + block $folding-inner0 + local.get $4 + i32.eqz + br_if $folding-inner0 + local.get $4 + i32.const 2139095040 + i32.eq + if + local.get $3 + i32.const 2139095040 + i32.eq + if + block $break|1 + block $case3|1 + block $case2|1 + block $case1|1 + local.get $2 + if + local.get $2 + i32.const 1 + i32.sub + br_table $case1|1 $case2|1 $case3|1 $break|1 + end + f32.const 0.7853981852531433 + return + end + f32.const -0.7853981852531433 + return + end + f32.const 2.356194496154785 + return + end + f32.const -2.356194496154785 + return + end + else + block $break|2 + block $case3|2 + block $case2|2 + block $case1|2 + local.get $2 + if + local.get $2 + i32.const 1 + i32.sub + br_table $case1|2 $case2|2 $case3|2 $break|2 + end + f32.const 0 + return + end + f32.const 0 + return + end + f32.const 3.1415927410125732 + return + end + f32.const -3.1415927410125732 + return + end + end + end + i32.const 1 + local.get $3 + i32.const 2139095040 + i32.eq + local.get $4 + i32.const 218103808 + i32.add + local.get $3 + i32.lt_u + select + br_if $folding-inner0 + local.get $3 + i32.const 218103808 + i32.add + local.get $4 + i32.lt_u + i32.const 0 + local.get $2 + i32.const 2 + i32.and + select + if (result f32) + f32.const 0 + else + local.get $0 + local.get $1 + f32.div + f32.abs + call $~lib/math/NativeMathf.atan + end + local.set $0 + block $break|3 + block $case3|3 + block $case2|3 + block $case1|3 + local.get $2 + if + local.get $2 + i32.const 1 + i32.sub + br_table $case1|3 $case2|3 $case3|3 $break|3 + end + local.get $0 + return + end + local.get $0 + f32.neg + return + end + f32.const 3.1415927410125732 + local.get $0 + f32.const -8.742277657347586e-08 + f32.sub + f32.sub + return + end + local.get $0 + f32.const -8.742277657347586e-08 + f32.sub + f32.const 3.1415927410125732 + f32.sub + return + end + unreachable + end + f32.const -1.5707963705062866 + f32.const 1.5707963705062866 + local.get $2 + i32.const 1 + i32.and + select + ) + (func $assembly/libmf/atan2 (; 16 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + local.get $0 + local.get $1 + call $~lib/math/NativeMathf.atan2 + ) + (func $~lib/math/NativeMathf.cbrt (; 17 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 f64) + (local $2 f64) + (local $3 i32) + (local $4 f64) + (local $5 i32) + (local $6 f64) + local.get $0 + i32.reinterpret_f32 + local.tee $5 + i32.const 2147483647 + i32.and + local.tee $3 + i32.const 2139095040 + i32.ge_u + if + local.get $0 + local.get $0 + f32.add + return + end + local.get $3 + i32.const 8388608 + i32.lt_u + if (result i32) + local.get $3 + i32.eqz + if + local.get $0 + return + end + local.get $0 + f32.const 16777216 + f32.mul + i32.reinterpret_f32 + local.tee $5 + i32.const 2147483647 + i32.and + i32.const 3 + i32.div_u + i32.const 642849266 + i32.add + else + local.get $3 + i32.const 3 + i32.div_u + i32.const 709958130 + i32.add + end + local.get $5 + i32.const -2147483648 + i32.and + i32.or + f32.reinterpret_i32 + f64.promote_f32 + local.tee $1 + local.get $1 + f64.mul + local.get $1 + f64.mul + local.set $2 + local.get $1 + local.get $0 + f64.promote_f32 + local.tee $1 + local.get $1 + f64.add + local.tee $6 + local.get $2 + f64.add + f64.mul + local.get $1 + local.get $2 + f64.add + local.get $2 + f64.add + f64.div + local.tee $2 + local.get $2 + f64.mul + local.get $2 + f64.mul + local.set $4 + local.get $2 + local.get $6 + local.get $4 + f64.add + f64.mul + local.get $1 + local.get $4 + f64.add + local.get $4 + f64.add + f64.div + f32.demote_f64 + ) + (func $assembly/libmf/cbrt (; 18 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.cbrt + ) + (func $assembly/libmf/ceil (; 19 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + f32.ceil + ) + (func $~lib/math/NativeMathf.clz32 (; 20 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + local.get $0 + f32.sub + f32.const 0 + f32.ne + if + f32.const 32 + return + end + local.get $0 + f32.const 4294967296 + local.get $0 + f32.const 2.3283064365386963e-10 + f32.mul + f32.floor + f32.mul + f32.sub + i64.trunc_f32_s + i32.wrap_i64 + i32.clz + f32.convert_i32_s + ) + (func $assembly/libmf/clz32 (; 21 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.clz32 + ) + (func $~lib/math/NativeMathf.cos (; 22 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 f64) + (local $2 f64) + (local $3 i32) + (local $4 i64) + (local $5 i32) + (local $6 i32) + (local $7 f64) + (local $8 i64) + (local $9 i32) + (local $10 i64) + (local $11 i64) + local.get $0 + i32.reinterpret_f32 + local.tee $3 + i32.const 31 + i32.shr_u + local.set $6 + block $folding-inner1 + block $folding-inner0 + local.get $3 + i32.const 2147483647 + i32.and + local.tee $3 + i32.const 1061752794 + i32.le_u + if + local.get $3 + i32.const 964689920 + i32.lt_u + if + f32.const 1 + return + end + local.get $0 + f64.promote_f32 + local.tee $1 + local.get $1 + f64.mul + local.tee $1 + local.get $1 + f64.mul + local.set $2 + br $folding-inner0 + end + local.get $3 + i32.const 1081824209 + i32.le_u + if + local.get $3 + i32.const 1075235811 + i32.gt_u + if + local.get $0 + f64.promote_f32 + local.tee $1 + f64.const 3.141592653589793 + f64.add + local.get $1 + f64.const 3.141592653589793 + f64.sub + local.get $6 + select + local.tee $1 + local.get $1 + f64.mul + local.tee $1 + local.get $1 + f64.mul + local.set $2 + f64.const 1 + local.get $1 + f64.const -0.499999997251031 + f64.mul + f64.add + local.get $2 + f64.const 0.04166662332373906 + f64.mul + f64.add + local.get $2 + local.get $1 + f64.mul + f64.const -0.001388676377460993 + local.get $1 + f64.const 2.439044879627741e-05 + f64.mul + f64.add + f64.mul + f64.add + f32.demote_f64 + f32.neg + return + else + local.get $6 + if (result f64) + local.get $0 + f64.promote_f32 + f64.const 1.5707963267948966 + f64.add + local.tee $2 + local.get $2 + f64.mul + local.tee $1 + local.get $2 + f64.mul + else + f64.const 1.5707963267948966 + local.get $0 + f64.promote_f32 + f64.sub + local.tee $2 + local.get $2 + f64.mul + local.tee $1 + local.get $2 + f64.mul + end + local.set $7 + br $folding-inner1 + end + unreachable + end + local.get $3 + i32.const 1088565717 + i32.le_u + if + local.get $3 + i32.const 1085271519 + i32.gt_u + if + local.get $0 + f64.promote_f32 + local.tee $1 + f64.const 6.283185307179586 + f64.add + local.get $1 + f64.const 6.283185307179586 + f64.sub + local.get $6 + select + local.tee $1 + local.get $1 + f64.mul + local.tee $1 + local.get $1 + f64.mul + local.set $2 + br $folding-inner0 + else + local.get $6 + if (result f64) + local.get $0 + f32.neg + f64.promote_f32 + f64.const 4.71238898038469 + f64.sub + local.tee $2 + local.get $2 + f64.mul + local.tee $1 + local.get $2 + f64.mul + else + local.get $0 + f64.promote_f32 + f64.const 4.71238898038469 + f64.sub + local.tee $2 + local.get $2 + f64.mul + local.tee $1 + local.get $2 + f64.mul + end + local.set $7 + br $folding-inner1 + end + unreachable + end + local.get $3 + i32.const 2139095040 + i32.ge_u + if + local.get $0 + local.get $0 + f32.sub + return + end + block $~lib/math/rempio2f|inlined.0 (result i32) + local.get $3 + i32.const 1305022427 + i32.lt_u + if + local.get $0 + f64.promote_f32 + local.tee $2 + f64.const 0.6366197723675814 + f64.mul + f64.nearest + local.set $1 + local.get $2 + local.get $1 + f64.const 1.5707963109016418 + f64.mul + f64.sub + local.get $1 + f64.const 1.5893254773528196e-08 + f64.mul + f64.sub + global.set $~lib/math/rempio2f_y + local.get $1 + i32.trunc_f64_s + br $~lib/math/rempio2f|inlined.0 + end + i32.const 76 + i32.load + local.get $3 + i32.const 23 + i32.shr_s + i32.const 152 + i32.sub + local.tee $5 + i32.const 6 + i32.shr_s + local.tee $9 + i32.const 3 + i32.shl + i32.add + i64.load + local.set $10 + i32.const 76 + i32.load + local.get $9 + i32.const 1 + i32.add + i32.const 3 + i32.shl + i32.add + i64.load + local.set $4 + local.get $5 + i32.const 63 + i32.and + local.tee $5 + i32.const 32 + i32.gt_s + if (result i64) + local.get $4 + local.get $5 + i32.const 32 + i32.sub + i64.extend_i32_s + i64.shl + i32.const 76 + i32.load + local.get $9 + i32.const 2 + i32.add + i32.const 3 + i32.shl + i32.add + i64.load + i64.const 96 + local.get $5 + i64.extend_i32_s + i64.sub + i64.shr_u + i64.or + else + local.get $4 + i64.const 32 + local.get $5 + i64.extend_i32_s + i64.sub + i64.shr_u + end + local.set $8 + f64.const 8.515303950216386e-20 + local.get $0 + f64.promote_f32 + f64.copysign + local.get $3 + i32.const 8388607 + i32.and + i32.const 8388608 + i32.or + i64.extend_i32_s + local.tee $11 + local.get $4 + i64.const 64 + local.get $5 + i64.extend_i32_s + local.tee $4 + i64.sub + i64.shr_u + local.get $10 + local.get $4 + i64.shl + i64.or + i64.mul + local.get $8 + local.get $11 + i64.mul + i64.const 32 + i64.shr_u + i64.add + local.tee $4 + i64.const 2 + i64.shl + local.tee $8 + f64.convert_i64_s + f64.mul + global.set $~lib/math/rempio2f_y + i32.const 0 + local.get $4 + i64.const 62 + i64.shr_u + local.get $8 + i64.const 63 + i64.shr_u + i64.add + i32.wrap_i64 + local.tee $3 + i32.sub + local.get $3 + local.get $6 + select + end + local.set $3 + global.get $~lib/math/rempio2f_y + local.set $1 + local.get $3 + i32.const 1 + i32.and + if (result f32) + local.get $1 + local.get $1 + local.get $1 + f64.mul + local.tee $2 + local.get $1 + f64.mul + local.tee $1 + f64.const -0.16666666641626524 + local.get $2 + f64.const 0.008333329385889463 + f64.mul + f64.add + f64.mul + f64.add + local.get $1 + local.get $2 + local.get $2 + f64.mul + f64.mul + f64.const -1.9839334836096632e-04 + local.get $2 + f64.const 2.718311493989822e-06 + f64.mul + f64.add + f64.mul + f64.add + f32.demote_f64 + else + local.get $1 + local.get $1 + f64.mul + local.tee $1 + local.get $1 + f64.mul + local.set $2 + f64.const 1 + local.get $1 + f64.const -0.499999997251031 + f64.mul + f64.add + local.get $2 + f64.const 0.04166662332373906 + f64.mul + f64.add + local.get $2 + local.get $1 + f64.mul + f64.const -0.001388676377460993 + local.get $1 + f64.const 2.439044879627741e-05 + f64.mul + f64.add + f64.mul + f64.add + f32.demote_f64 + end + local.set $0 + local.get $0 + f32.neg + local.get $0 + local.get $3 + i32.const 1 + i32.add + i32.const 2 + i32.and + select + return + end + f64.const 1 + local.get $1 + f64.const -0.499999997251031 + f64.mul + f64.add + local.get $2 + f64.const 0.04166662332373906 + f64.mul + f64.add + local.get $2 + local.get $1 + f64.mul + f64.const -0.001388676377460993 + local.get $1 + f64.const 2.439044879627741e-05 + f64.mul + f64.add + f64.mul + f64.add + f32.demote_f64 + return + end + local.get $2 + local.get $7 + f64.const -0.16666666641626524 + local.get $1 + f64.const 0.008333329385889463 + f64.mul + f64.add + f64.mul + f64.add + local.get $7 + local.get $1 + local.get $1 + f64.mul + f64.mul + f64.const -1.9839334836096632e-04 + local.get $1 + f64.const 2.718311493989822e-06 + f64.mul + f64.add + f64.mul + f64.add + f32.demote_f64 + ) + (func $assembly/libmf/cos (; 23 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.cos + ) + (func $~lib/math/NativeMathf.expm1 (; 24 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + (local $2 f32) + (local $3 f32) + (local $4 f32) + (local $5 i32) + (local $6 f32) + local.get $0 + i32.reinterpret_f32 + local.tee $1 + i32.const 31 + i32.shr_u + local.set $5 + local.get $1 + i32.const 2147483647 + i32.and + local.tee $1 + i32.const 1100331076 + i32.ge_u + if + local.get $1 + i32.const 2139095040 + i32.gt_u + if + local.get $0 + return + end + local.get $5 + if + f32.const -1 + return + end + local.get $0 + f32.const 88.7216796875 + f32.gt + if + local.get $0 + f32.const 1701411834604692317316873e14 + f32.mul + return + end + end + local.get $1 + i32.const 1051816472 + i32.gt_u + if + local.get $0 + i32.const 1 + local.get $5 + i32.const 1 + i32.shl + i32.sub + f32.const 1.4426950216293335 + local.get $0 + f32.mul + f32.const 0.5 + local.get $0 + f32.copysign + f32.add + i32.trunc_f32_s + local.get $1 + i32.const 1065686418 + i32.lt_u + select + local.tee $1 + f32.convert_i32_s + local.tee $0 + f32.const 0.6931381225585938 + f32.mul + f32.sub + local.tee $2 + local.get $2 + local.get $0 + f32.const 9.05800061445916e-06 + f32.mul + local.tee $2 + f32.sub + local.tee $0 + f32.sub + local.get $2 + f32.sub + local.set $4 + else + local.get $1 + i32.const 855638016 + i32.lt_u + if (result i32) + local.get $0 + return + else + i32.const 0 + end + local.set $1 + end + f32.const 3 + f32.const 1 + local.get $0 + f32.const 0.5 + local.get $0 + f32.mul + local.tee $3 + f32.mul + local.tee $2 + f32.const -0.03333321213722229 + local.get $2 + f32.const 1.5807170420885086e-03 + f32.mul + f32.add + f32.mul + f32.add + local.tee $6 + local.get $3 + f32.mul + f32.sub + local.set $3 + local.get $2 + local.get $6 + local.get $3 + f32.sub + f32.const 6 + local.get $0 + local.get $3 + f32.mul + f32.sub + f32.div + f32.mul + local.set $3 + local.get $1 + i32.eqz + if + local.get $0 + local.get $0 + local.get $3 + f32.mul + local.get $2 + f32.sub + f32.sub + return + end + local.get $0 + local.get $3 + local.get $4 + f32.sub + f32.mul + local.get $4 + f32.sub + local.get $2 + f32.sub + local.set $2 + local.get $1 + i32.const -1 + i32.eq + if + f32.const 0.5 + local.get $0 + local.get $2 + f32.sub + f32.mul + f32.const 0.5 + f32.sub + return + end + local.get $1 + i32.const 1 + i32.eq + if + local.get $0 + f32.const -0.25 + f32.lt + if + f32.const -2 + local.get $2 + local.get $0 + f32.const 0.5 + f32.add + f32.sub + f32.mul + return + end + f32.const 1 + f32.const 2 + local.get $0 + local.get $2 + f32.sub + f32.mul + f32.add + return + end + local.get $1 + i32.const 127 + i32.add + i32.const 23 + i32.shl + f32.reinterpret_i32 + local.set $4 + i32.const 1 + local.get $1 + i32.const 56 + i32.gt_s + local.get $1 + i32.const 0 + i32.lt_s + select + if + local.get $0 + local.get $2 + f32.sub + f32.const 1 + f32.add + local.set $0 + local.get $1 + i32.const 128 + i32.eq + if (result f32) + local.get $0 + f32.const 2 + f32.mul + f32.const 1701411834604692317316873e14 + f32.mul + else + local.get $0 + local.get $4 + f32.mul + end + f32.const 1 + f32.sub + return + end + i32.const 127 + local.get $1 + i32.sub + i32.const 23 + i32.shl + f32.reinterpret_i32 + local.set $3 + local.get $0 + f32.const 1 + local.get $3 + f32.sub + local.get $2 + f32.sub + f32.const 1 + local.get $2 + local.get $3 + f32.add + f32.sub + local.get $1 + i32.const 20 + i32.lt_s + select + f32.add + local.get $4 + f32.mul + ) + (func $~lib/math/NativeMathf.scalbn (; 25 ;) (type $FUNCSIG$ffi) (param $0 f32) (param $1 i32) (result f32) + local.get $1 + i32.const 127 + i32.gt_s + if (result f32) + local.get $0 + f32.const 1701411834604692317316873e14 + f32.mul + local.set $0 + local.get $1 + i32.const 127 + i32.sub + local.tee $1 + i32.const 127 + i32.gt_s + if (result f32) + local.get $1 + i32.const 127 + i32.sub + local.tee $1 + i32.const 127 + local.get $1 + i32.const 127 + i32.lt_s + select + local.set $1 + local.get $0 + f32.const 1701411834604692317316873e14 + f32.mul + else + local.get $0 + end + else + local.get $1 + i32.const -126 + i32.lt_s + if (result f32) + local.get $0 + f32.const 1.9721522630525295e-31 + f32.mul + local.set $0 + local.get $1 + i32.const 102 + i32.add + local.tee $1 + i32.const -126 + i32.lt_s + if (result f32) + local.get $1 + i32.const 102 + i32.add + local.tee $1 + i32.const -126 + local.get $1 + i32.const -126 + i32.gt_s + select + local.set $1 + local.get $0 + f32.const 1.9721522630525295e-31 + f32.mul + else + local.get $0 + end + else + local.get $0 + end + end + local.get $1 + i32.const 127 + i32.add + i32.const 23 + i32.shl + f32.reinterpret_i32 + f32.mul + ) + (func $~lib/math/NativeMathf.exp (; 26 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + (local $2 i32) + (local $3 f32) + (local $4 f32) + local.get $0 + i32.reinterpret_f32 + local.tee $1 + i32.const 31 + i32.shr_u + local.set $2 + local.get $1 + i32.const 2147483647 + i32.and + local.tee $1 + i32.const 1118743632 + i32.ge_u + if + local.get $1 + i32.const 1118925336 + i32.ge_u + if + local.get $2 + if + local.get $1 + i32.const 1120924085 + i32.ge_u + if + f32.const 0 + return + end + else + local.get $0 + f32.const 1701411834604692317316873e14 + f32.mul + return + end + end + end + local.get $1 + i32.const 1051816472 + i32.gt_u + if + local.get $0 + local.get $1 + i32.const 1065686418 + i32.gt_u + if (result i32) + f32.const 1.4426950216293335 + local.get $0 + f32.mul + f32.const 0.5 + local.get $0 + f32.copysign + f32.add + i32.trunc_f32_s + else + i32.const 1 + local.get $2 + i32.const 1 + i32.shl + i32.sub + end + local.tee $1 + f32.convert_i32_s + local.tee $0 + f32.const 0.693145751953125 + f32.mul + f32.sub + local.tee $3 + local.get $0 + f32.const 1.428606765330187e-06 + f32.mul + local.tee $4 + f32.sub + local.set $0 + else + local.get $1 + i32.const 956301312 + i32.gt_u + if (result f32) + i32.const 0 + local.set $1 + local.get $0 + else + f32.const 1 + local.get $0 + f32.add + return + end + local.set $3 + end + f32.const 1 + local.get $0 + local.get $0 + local.get $0 + local.get $0 + f32.mul + local.tee $0 + f32.const 0.16666625440120697 + local.get $0 + f32.const -2.7667332906275988e-03 + f32.mul + f32.add + f32.mul + f32.sub + local.tee $0 + f32.mul + f32.const 2 + local.get $0 + f32.sub + f32.div + local.get $4 + f32.sub + local.get $3 + f32.add + f32.add + local.set $0 + local.get $1 + i32.eqz + if + local.get $0 + return + end + local.get $0 + local.get $1 + call $~lib/math/NativeMathf.scalbn + ) + (func $~lib/math/NativeMathf.cosh (; 27 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + local.get $0 + i32.reinterpret_f32 + i32.const 2147483647 + i32.and + local.tee $1 + f32.reinterpret_i32 + local.set $0 + local.get $1 + i32.const 1060205079 + i32.lt_u + if + local.get $1 + i32.const 964689920 + i32.lt_u + if + f32.const 1 + return + end + f32.const 1 + local.get $0 + call $~lib/math/NativeMathf.expm1 + local.tee $0 + local.get $0 + f32.mul + f32.const 2 + f32.const 2 + local.get $0 + f32.mul + f32.add + f32.div + f32.add + return + end + local.get $1 + i32.const 1118925335 + i32.lt_u + if + f32.const 0.5 + local.get $0 + call $~lib/math/NativeMathf.exp + local.tee $0 + f32.mul + f32.const 0.5 + local.get $0 + f32.div + f32.add + return + end + local.get $0 + f32.const 162.88958740234375 + f32.sub + call $~lib/math/NativeMathf.exp + f32.const 1661534994731144841129758e11 + f32.mul + f32.const 1661534994731144841129758e11 + f32.mul + ) + (func $assembly/libmf/cosh (; 28 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.cosh + ) + (func $assembly/libmf/exp (; 29 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.exp + ) + (func $assembly/libmf/expm1 (; 30 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.expm1 + ) + (func $assembly/libmf/floor (; 31 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + f32.floor + ) + (func $assembly/libmf/fround (; 32 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + ) + (func $~lib/math/NativeMathf.hypot (; 33 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + (local $2 i32) + (local $3 i32) + (local $4 f32) + (local $5 f64) + (local $6 i32) + local.get $0 + i32.reinterpret_f32 + i32.const 2147483647 + i32.and + local.tee $3 + local.get $1 + i32.reinterpret_f32 + i32.const 2147483647 + i32.and + local.tee $2 + i32.lt_u + if + local.get $3 + local.set $6 + local.get $2 + local.set $3 + local.get $6 + local.set $2 + end + local.get $3 + f32.reinterpret_i32 + local.set $0 + local.get $2 + f32.reinterpret_i32 + local.set $1 + local.get $2 + i32.const 2139095040 + i32.eq + if + local.get $1 + return + end + i32.const 1 + local.get $3 + local.get $2 + i32.sub + i32.const 209715200 + i32.ge_u + i32.const 1 + local.get $2 + i32.eqz + local.get $3 + i32.const 2139095040 + i32.ge_u + select + select + if + local.get $0 + local.get $1 + f32.add + return + end + f32.const 1 + local.set $4 + local.get $3 + i32.const 1568669696 + i32.ge_u + if (result f32) + f32.const 1237940039285380274899124e3 + local.set $4 + local.get $1 + f32.const 8.077935669463161e-28 + f32.mul + local.set $1 + local.get $0 + f32.const 8.077935669463161e-28 + f32.mul + else + local.get $2 + i32.const 562036736 + i32.lt_u + if (result f32) + f32.const 8.077935669463161e-28 + local.set $4 + local.get $1 + f32.const 1237940039285380274899124e3 + f32.mul + local.set $1 + local.get $0 + f32.const 1237940039285380274899124e3 + f32.mul + else + local.get $0 + end + end + local.set $0 + local.get $4 + local.get $0 + f64.promote_f32 + local.tee $5 + local.get $5 + f64.mul + local.get $1 + f64.promote_f32 + local.tee $5 + local.get $5 + f64.mul + f64.add + f32.demote_f64 + f32.sqrt + f32.mul + ) + (func $assembly/libmf/hypot (; 34 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + local.get $0 + local.get $1 + call $~lib/math/NativeMathf.hypot + ) + (func $assembly/libmf/imul (; 35 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + (local $2 f64) + (local $3 f32) + block $~lib/math/NativeMathf.imul|inlined.0 (result f32) + f32.const 0 + local.get $0 + local.get $1 + f32.add + local.tee $3 + local.get $3 + f32.sub + f32.const 0 + f32.ne + br_if $~lib/math/NativeMathf.imul|inlined.0 + drop + local.get $0 + f64.promote_f32 + local.tee $2 + f64.const 4294967296 + local.get $2 + f64.const 2.3283064365386963e-10 + f64.mul + f64.floor + f64.mul + f64.sub + i64.trunc_f64_s + i32.wrap_i64 + local.get $1 + f64.promote_f32 + local.tee $2 + f64.const 4294967296 + local.get $2 + f64.const 2.3283064365386963e-10 + f64.mul + f64.floor + f64.mul + f64.sub + i64.trunc_f64_s + i32.wrap_i64 + i32.mul + f32.convert_i32_s + end + ) + (func $assembly/libmf/log (; 36 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.log + ) + (func $~lib/math/NativeMathf.log10 (; 37 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + (local $2 f32) + (local $3 i32) + (local $4 f32) + (local $5 f32) + (local $6 f32) + (local $7 f32) + local.get $0 + i32.reinterpret_f32 + local.tee $1 + i32.const 8388608 + i32.lt_u + if (result i32) + i32.const 1 + else + local.get $1 + i32.const 31 + i32.shr_u + end + if + local.get $1 + i32.const 1 + i32.shl + i32.eqz + if + f32.const -1 + local.get $0 + local.get $0 + f32.mul + f32.div + return + end + local.get $1 + i32.const 31 + i32.shr_u + if + local.get $0 + local.get $0 + f32.sub + f32.const 0 + f32.div + return + end + i32.const -25 + local.set $3 + local.get $0 + f32.const 33554432 + f32.mul + i32.reinterpret_f32 + local.set $1 + else + local.get $1 + i32.const 2139095040 + i32.ge_u + if + local.get $0 + return + else + local.get $1 + i32.const 1065353216 + i32.eq + if + f32.const 0 + return + end + end + end + local.get $1 + i32.const 4913933 + i32.add + local.tee $1 + i32.const 8388607 + i32.and + i32.const 1060439283 + i32.add + f32.reinterpret_i32 + f32.const 1 + f32.sub + local.tee $0 + f32.const 2 + local.get $0 + f32.add + f32.div + local.tee $4 + local.get $4 + f32.mul + local.tee $5 + local.get $5 + f32.mul + local.set $2 + local.get $1 + i32.const 23 + i32.shr_u + i32.const 127 + i32.sub + local.get $3 + i32.add + f32.convert_i32_s + local.tee $7 + f32.const 7.903415166765626e-07 + f32.mul + local.get $0 + local.get $0 + f32.const 0.5 + local.get $0 + f32.mul + local.get $0 + f32.mul + local.tee $0 + f32.sub + i32.reinterpret_f32 + i32.const -4096 + i32.and + f32.reinterpret_i32 + local.tee $6 + f32.sub + local.get $0 + f32.sub + local.get $4 + local.get $0 + local.get $5 + f32.const 0.6666666269302368 + local.get $2 + f32.const 0.2849878668785095 + f32.mul + f32.add + f32.mul + local.get $2 + f32.const 0.40000972151756287 + local.get $2 + f32.const 0.24279078841209412 + f32.mul + f32.add + f32.mul + f32.add + f32.add + f32.mul + f32.add + local.tee $0 + local.get $6 + f32.add + f32.const -3.168997136526741e-05 + f32.mul + f32.add + local.get $0 + f32.const 0.434326171875 + f32.mul + f32.add + local.get $6 + f32.const 0.434326171875 + f32.mul + f32.add + local.get $7 + f32.const 0.3010292053222656 + f32.mul + f32.add + ) + (func $assembly/libmf/log10 (; 38 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.log10 + ) + (func $assembly/libmf/log1p (; 39 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.log1p + ) + (func $~lib/math/NativeMathf.log2 (; 40 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + (local $2 f32) + (local $3 i32) + (local $4 f32) + (local $5 f32) + (local $6 f32) + local.get $0 + i32.reinterpret_f32 + local.tee $1 + i32.const 8388608 + i32.lt_u + if (result i32) + i32.const 1 + else + local.get $1 + i32.const 31 + i32.shr_u + end + if + local.get $1 + i32.const 1 + i32.shl + i32.eqz + if + f32.const -1 + local.get $0 + local.get $0 + f32.mul + f32.div + return + end + local.get $1 + i32.const 31 + i32.shr_u + if + local.get $0 + local.get $0 + f32.sub + f32.const 0 + f32.div + return + end + i32.const -25 + local.set $3 + local.get $0 + f32.const 33554432 + f32.mul + i32.reinterpret_f32 + local.set $1 + else + local.get $1 + i32.const 2139095040 + i32.ge_u + if + local.get $0 + return + else + local.get $1 + i32.const 1065353216 + i32.eq + if + f32.const 0 + return + end + end + end + local.get $1 + i32.const 4913933 + i32.add + local.tee $1 + i32.const 8388607 + i32.and + i32.const 1060439283 + i32.add + f32.reinterpret_i32 + f32.const 1 + f32.sub + local.tee $0 + f32.const 2 + local.get $0 + f32.add + f32.div + local.tee $4 + local.get $4 + f32.mul + local.tee $5 + local.get $5 + f32.mul + local.set $2 + local.get $0 + local.get $0 + f32.const 0.5 + local.get $0 + f32.mul + local.get $0 + f32.mul + local.tee $0 + f32.sub + i32.reinterpret_f32 + i32.const -4096 + i32.and + f32.reinterpret_i32 + local.tee $6 + f32.sub + local.get $0 + f32.sub + local.get $4 + local.get $0 + local.get $5 + f32.const 0.6666666269302368 + local.get $2 + f32.const 0.2849878668785095 + f32.mul + f32.add + f32.mul + local.get $2 + f32.const 0.40000972151756287 + local.get $2 + f32.const 0.24279078841209412 + f32.mul + f32.add + f32.mul + f32.add + f32.add + f32.mul + f32.add + local.tee $0 + local.get $6 + f32.add + f32.const -1.7605285393074155e-04 + f32.mul + local.get $0 + f32.const 1.44287109375 + f32.mul + f32.add + local.get $6 + f32.const 1.44287109375 + f32.mul + f32.add + local.get $1 + i32.const 23 + i32.shr_u + i32.const 127 + i32.sub + local.get $3 + i32.add + f32.convert_i32_s + f32.add + ) + (func $assembly/libmf/log2 (; 41 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.log2 + ) + (func $assembly/libmf/max (; 42 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + local.get $0 + local.get $1 + f32.max + ) + (func $assembly/libmf/min (; 43 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + local.get $0 + local.get $1 + f32.min + ) + (func $~lib/math/NativeMathf.pow (; 44 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + (local $2 f32) + (local $3 f32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 f32) + (local $8 i32) + (local $9 f32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 f32) + (local $14 f32) + (local $15 f32) + (local $16 f32) + local.get $0 + i32.reinterpret_f32 + local.tee $8 + i32.const 2147483647 + i32.and + local.set $5 + local.get $1 + i32.reinterpret_f32 + local.tee $11 + i32.const 2147483647 + i32.and + local.tee $10 + i32.eqz + if + f32.const 1 + return + end + i32.const 1 + local.get $10 + i32.const 2139095040 + i32.gt_s + local.get $5 + i32.const 2139095040 + i32.gt_s + select + if + local.get $0 + local.get $1 + f32.add + return + end + local.get $8 + i32.const 0 + i32.lt_s + if + local.get $10 + i32.const 1266679808 + i32.ge_s + if (result i32) + i32.const 2 + else + local.get $10 + i32.const 1065353216 + i32.ge_s + if (result i32) + local.get $10 + i32.const 150 + local.get $10 + i32.const 23 + i32.shr_s + i32.sub + local.tee $12 + i32.shr_s + local.tee $6 + local.get $12 + i32.shl + local.get $10 + i32.eq + if (result i32) + i32.const 2 + local.get $6 + i32.const 1 + i32.and + i32.sub + else + i32.const 0 + end + else + i32.const 0 + end + end + local.set $4 + end + local.get $10 + i32.const 2139095040 + i32.eq + if + local.get $5 + i32.const 1065353216 + i32.eq + if + f32.const nan:0x400000 + return + else + local.get $5 + i32.const 1065353216 + i32.gt_s + if + local.get $11 + i32.const 0 + i32.lt_s + if + f32.const 0 + local.set $1 + end + local.get $1 + return + else + f32.const 0 + local.get $1 + f32.neg + local.get $11 + i32.const 0 + i32.ge_s + select + return + end + unreachable + end + unreachable + end + local.get $10 + i32.const 1065353216 + i32.eq + if + local.get $11 + i32.const 0 + i32.lt_s + if + f32.const 1 + local.get $0 + f32.div + local.set $0 + end + local.get $0 + return + end + local.get $11 + i32.const 1073741824 + i32.eq + if + local.get $0 + local.get $0 + f32.mul + return + end + local.get $11 + i32.const 1056964608 + i32.eq + if + local.get $8 + i32.const 0 + i32.ge_s + if + local.get $0 + f32.sqrt + return + end + end + local.get $0 + f32.abs + local.set $3 + i32.const 1 + local.get $5 + i32.const 1065353216 + i32.eq + i32.const 1 + local.get $5 + i32.eqz + local.get $5 + i32.const 2139095040 + i32.eq + select + select + if + f32.const 1 + local.get $3 + f32.div + local.get $3 + local.get $11 + i32.const 0 + i32.lt_s + select + local.set $3 + local.get $8 + i32.const 0 + i32.lt_s + if (result f32) + local.get $5 + i32.const 1065353216 + i32.sub + local.get $4 + i32.or + if (result f32) + local.get $3 + f32.neg + local.get $3 + local.get $4 + i32.const 1 + i32.eq + select + else + local.get $3 + local.get $3 + f32.sub + local.tee $0 + local.get $0 + f32.div + end + else + local.get $3 + end + return + end + f32.const 1 + local.set $7 + local.get $8 + i32.const 0 + i32.lt_s + if + local.get $4 + i32.eqz + if + local.get $0 + local.get $0 + f32.sub + local.tee $0 + local.get $0 + f32.div + return + end + f32.const -1 + f32.const 1 + local.get $4 + i32.const 1 + i32.eq + select + local.set $7 + end + local.get $10 + i32.const 1291845632 + i32.gt_s + if (result f32) + local.get $5 + i32.const 1065353208 + i32.lt_s + if + local.get $11 + i32.const 0 + i32.lt_s + if (result f32) + local.get $7 + f32.const 1000000015047466219876688e6 + f32.mul + f32.const 1000000015047466219876688e6 + f32.mul + else + local.get $7 + f32.const 1.0000000031710769e-30 + f32.mul + f32.const 1.0000000031710769e-30 + f32.mul + end + return + end + local.get $5 + i32.const 1065353223 + i32.gt_s + if + local.get $11 + i32.const 0 + i32.gt_s + if (result f32) + local.get $7 + f32.const 1000000015047466219876688e6 + f32.mul + f32.const 1000000015047466219876688e6 + f32.mul + else + local.get $7 + f32.const 1.0000000031710769e-30 + f32.mul + f32.const 1.0000000031710769e-30 + f32.mul + end + return + end + local.get $3 + f32.const 1 + f32.sub + local.tee $2 + local.get $2 + f32.mul + f32.const 0.5 + local.get $2 + f32.const 0.3333333432674408 + local.get $2 + f32.const 0.25 + f32.mul + f32.sub + f32.mul + f32.sub + f32.mul + local.set $0 + f32.const 1.44268798828125 + local.get $2 + f32.mul + local.tee $3 + local.get $2 + f32.const 7.052607543300837e-06 + f32.mul + local.get $0 + f32.const 1.4426950216293335 + f32.mul + f32.sub + local.tee $0 + f32.add + i32.reinterpret_f32 + i32.const -4096 + i32.and + f32.reinterpret_i32 + local.set $9 + local.get $0 + local.get $9 + local.get $3 + f32.sub + f32.sub + else + i32.const 0 + local.set $4 + local.get $5 + i32.const 8388608 + i32.lt_s + if (result i32) + local.get $3 + f32.const 16777216 + f32.mul + i32.reinterpret_f32 + local.set $5 + i32.const -24 + else + i32.const 0 + end + local.get $5 + i32.const 23 + i32.shr_s + i32.const 127 + i32.sub + i32.add + local.set $4 + local.get $5 + i32.const 8388607 + i32.and + local.tee $6 + i32.const 1065353216 + i32.or + local.set $5 + local.get $6 + i32.const 1885297 + i32.le_s + if (result i32) + i32.const 0 + else + local.get $6 + i32.const 6140887 + i32.lt_s + if (result i32) + i32.const 1 + else + local.get $4 + i32.const 1 + i32.add + local.set $4 + local.get $5 + i32.const 8388608 + i32.sub + local.set $5 + i32.const 0 + end + end + local.set $6 + local.get $5 + f32.reinterpret_i32 + local.tee $3 + f32.const 1.5 + f32.const 1 + local.get $6 + select + local.tee $0 + f32.sub + local.tee $9 + f32.const 1 + local.get $3 + local.get $0 + f32.add + f32.div + local.tee $2 + f32.mul + local.tee $15 + i32.reinterpret_f32 + i32.const -4096 + i32.and + f32.reinterpret_i32 + local.set $13 + local.get $3 + local.get $5 + i32.const 1 + i32.shr_s + i32.const -4096 + i32.and + i32.const 536870912 + i32.or + i32.const 4194304 + i32.add + local.get $6 + i32.const 21 + i32.shl + i32.add + f32.reinterpret_i32 + local.tee $3 + local.get $0 + f32.sub + f32.sub + local.set $0 + f32.const 0.9619140625 + local.get $13 + f32.const 3 + local.get $13 + local.get $13 + f32.mul + local.tee $16 + f32.add + local.get $15 + local.get $15 + f32.mul + local.tee $14 + local.get $14 + f32.mul + f32.const 0.6000000238418579 + local.get $14 + f32.const 0.4285714328289032 + local.get $14 + f32.const 0.3333333432674408 + local.get $14 + f32.const 0.2727281153202057 + local.get $14 + f32.const 0.23066075146198273 + local.get $14 + f32.const 0.20697501301765442 + f32.mul + f32.add + f32.mul + f32.add + f32.mul + f32.add + f32.mul + f32.add + f32.mul + f32.add + f32.mul + local.get $2 + local.get $9 + local.get $13 + local.get $3 + f32.mul + f32.sub + local.get $13 + local.get $0 + f32.mul + f32.sub + f32.mul + local.tee $2 + local.get $13 + local.get $15 + f32.add + f32.mul + f32.add + local.tee $0 + f32.add + i32.reinterpret_f32 + i32.const -4096 + i32.and + f32.reinterpret_i32 + local.tee $9 + f32.mul + local.tee $3 + local.get $2 + local.get $9 + f32.mul + local.get $0 + local.get $9 + f32.const 3 + f32.sub + local.get $16 + f32.sub + f32.sub + local.get $15 + f32.mul + f32.add + local.tee $0 + f32.add + i32.reinterpret_f32 + i32.const -4096 + i32.and + f32.reinterpret_i32 + local.tee $2 + f32.mul + local.tee $16 + f32.const -1.1736857413779944e-04 + local.get $2 + f32.mul + local.get $0 + local.get $2 + local.get $3 + f32.sub + f32.sub + f32.const 0.9617967009544373 + f32.mul + f32.add + f32.const 1.5632208487659227e-06 + f32.const 0 + local.get $6 + select + f32.add + local.tee $2 + f32.add + f32.const 0.5849609375 + f32.const 0 + local.get $6 + select + local.tee $3 + f32.add + local.get $4 + f32.convert_i32_s + local.tee $0 + f32.add + i32.reinterpret_f32 + i32.const -4096 + i32.and + f32.reinterpret_i32 + local.set $9 + local.get $2 + local.get $9 + local.get $0 + f32.sub + local.get $3 + f32.sub + local.get $16 + f32.sub + f32.sub + end + local.set $3 + block $folding-inner1 + block $folding-inner0 + local.get $1 + local.get $1 + i32.reinterpret_f32 + i32.const -4096 + i32.and + f32.reinterpret_i32 + local.tee $0 + f32.sub + local.get $9 + f32.mul + local.get $1 + local.get $3 + f32.mul + f32.add + local.tee $1 + local.get $0 + local.get $9 + f32.mul + local.tee $2 + f32.add + local.tee $0 + i32.reinterpret_f32 + local.tee $8 + i32.const 1124073472 + i32.gt_s + br_if $folding-inner0 + local.get $8 + i32.const 1124073472 + i32.eq + if + local.get $1 + f32.const 4.299566569443414e-08 + f32.add + local.get $0 + local.get $2 + f32.sub + f32.gt + br_if $folding-inner0 + else + local.get $8 + i32.const 2147483647 + i32.and + i32.const 1125515264 + i32.gt_s + if + br $folding-inner1 + else + local.get $8 + i32.const -1021968384 + i32.eq + if + local.get $1 + local.get $0 + local.get $2 + f32.sub + f32.le + br_if $folding-inner1 + end + end + end + local.get $8 + i32.const 2147483647 + i32.and + local.tee $12 + i32.const 23 + i32.shr_s + i32.const 127 + i32.sub + local.set $6 + i32.const 0 + local.set $4 + local.get $12 + i32.const 1056964608 + i32.gt_s + if + i32.const 8388608 + local.get $6 + i32.const 1 + i32.add + i32.shr_s + local.get $8 + i32.add + local.tee $12 + i32.const 2147483647 + i32.and + i32.const 23 + i32.shr_s + i32.const 127 + i32.sub + local.set $6 + i32.const 8388607 + local.get $6 + i32.shr_s + i32.const -1 + i32.xor + local.get $12 + i32.and + f32.reinterpret_i32 + local.set $0 + local.get $12 + i32.const 8388607 + i32.and + i32.const 8388608 + i32.or + i32.const 23 + local.get $6 + i32.sub + i32.shr_s + local.set $4 + i32.const 0 + local.get $4 + i32.sub + local.get $4 + local.get $8 + i32.const 0 + i32.lt_s + select + local.set $4 + local.get $2 + local.get $0 + f32.sub + local.set $2 + end + local.get $1 + local.get $2 + f32.add + i32.reinterpret_f32 + i32.const -32768 + i32.and + f32.reinterpret_i32 + local.tee $0 + f32.const 0.693145751953125 + f32.mul + local.tee $3 + local.get $1 + local.get $0 + local.get $2 + f32.sub + f32.sub + f32.const 0.6931471824645996 + f32.mul + local.get $0 + f32.const 1.4286065379565116e-06 + f32.mul + f32.add + local.tee $1 + f32.add + local.tee $2 + local.get $2 + f32.mul + local.set $0 + local.get $7 + f32.const 1 + local.get $2 + local.get $2 + local.get $0 + f32.const 0.1666666716337204 + local.get $0 + f32.const -2.7777778450399637e-03 + local.get $0 + f32.const 6.61375597701408e-05 + local.get $0 + f32.const -1.6533901998627698e-06 + local.get $0 + f32.const 4.138136944220605e-08 + f32.mul + f32.add + f32.mul + f32.add + f32.mul + f32.add + f32.mul + f32.add + f32.mul + f32.sub + local.tee $0 + f32.mul + local.get $0 + f32.const 2 + f32.sub + f32.div + local.get $1 + local.get $2 + local.get $3 + f32.sub + f32.sub + local.tee $0 + local.get $2 + local.get $0 + f32.mul + f32.add + f32.sub + local.get $2 + f32.sub + f32.sub + local.tee $0 + i32.reinterpret_f32 + local.get $4 + i32.const 23 + i32.shl + i32.add + local.tee $6 + i32.const 23 + i32.shr_s + i32.const 0 + i32.le_s + if (result f32) + local.get $0 + local.get $4 + call $~lib/math/NativeMathf.scalbn + else + local.get $6 + f32.reinterpret_i32 + end + f32.mul + return + end + local.get $7 + f32.const 1000000015047466219876688e6 + f32.mul + f32.const 1000000015047466219876688e6 + f32.mul + return + end + local.get $7 + f32.const 1.0000000031710769e-30 + f32.mul + f32.const 1.0000000031710769e-30 + f32.mul + ) + (func $assembly/libmf/pow (; 45 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + local.get $0 + local.get $1 + call $~lib/math/NativeMathf.pow + ) + (func $assembly/libmf/round (; 46 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + f32.const 0.5 + f32.add + f32.floor + local.get $0 + f32.copysign + ) + (func $assembly/libmf/sign (; 47 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + f32.const 0 + f32.gt + if + f32.const 1 + local.set $0 + else + local.get $0 + f32.const 0 + f32.lt + if + f32.const -1 + local.set $0 + end + end + local.get $0 + ) + (func $~lib/math/NativeMathf.sin (; 48 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 f64) + (local $2 f64) + (local $3 i32) + (local $4 i64) + (local $5 f64) + (local $6 i32) + (local $7 i32) + (local $8 i64) + (local $9 i32) + (local $10 i64) + (local $11 i64) + local.get $0 + i32.reinterpret_f32 + local.tee $3 + i32.const 31 + i32.shr_u + local.set $7 + block $folding-inner0 + local.get $3 + i32.const 2147483647 + i32.and + local.tee $3 + i32.const 1061752794 + i32.le_u + if + local.get $3 + i32.const 964689920 + i32.lt_u + if + local.get $0 + return + end + local.get $0 + f64.promote_f32 + local.tee $1 + local.get $1 + f64.mul + local.tee $2 + local.get $1 + f64.mul + local.set $5 + br $folding-inner0 + end + local.get $3 + i32.const 1081824209 + i32.le_u + if + local.get $3 + i32.const 1075235811 + i32.le_u + if + local.get $7 + if (result f32) + local.get $0 + f64.promote_f32 + f64.const 1.5707963267948966 + f64.add + local.tee $1 + local.get $1 + f64.mul + local.tee $1 + local.get $1 + f64.mul + local.set $2 + f64.const 1 + local.get $1 + f64.const -0.499999997251031 + f64.mul + f64.add + local.get $2 + f64.const 0.04166662332373906 + f64.mul + f64.add + local.get $2 + local.get $1 + f64.mul + f64.const -0.001388676377460993 + local.get $1 + f64.const 2.439044879627741e-05 + f64.mul + f64.add + f64.mul + f64.add + f32.demote_f64 + f32.neg + else + local.get $0 + f64.promote_f32 + f64.const 1.5707963267948966 + f64.sub + local.tee $1 + local.get $1 + f64.mul + local.tee $1 + local.get $1 + f64.mul + local.set $2 + f64.const 1 + local.get $1 + f64.const -0.499999997251031 + f64.mul + f64.add + local.get $2 + f64.const 0.04166662332373906 + f64.mul + f64.add + local.get $2 + local.get $1 + f64.mul + f64.const -0.001388676377460993 + local.get $1 + f64.const 2.439044879627741e-05 + f64.mul + f64.add + f64.mul + f64.add + f32.demote_f64 + end + return + end + local.get $0 + f64.promote_f32 + local.tee $1 + f64.const 3.141592653589793 + f64.add + local.get $1 + f64.const 3.141592653589793 + f64.sub + local.get $7 + select + f64.neg + local.tee $1 + local.get $1 + f64.mul + local.tee $2 + local.get $1 + f64.mul + local.set $5 + br $folding-inner0 + end + local.get $3 + i32.const 1088565717 + i32.le_u + if + local.get $3 + i32.const 1085271519 + i32.le_u + if + local.get $7 + if (result f32) + local.get $0 + f64.promote_f32 + f64.const 4.71238898038469 + f64.add + local.tee $1 + local.get $1 + f64.mul + local.tee $1 + local.get $1 + f64.mul + local.set $2 + f64.const 1 + local.get $1 + f64.const -0.499999997251031 + f64.mul + f64.add + local.get $2 + f64.const 0.04166662332373906 + f64.mul + f64.add + local.get $2 + local.get $1 + f64.mul + f64.const -0.001388676377460993 + local.get $1 + f64.const 2.439044879627741e-05 + f64.mul + f64.add + f64.mul + f64.add + f32.demote_f64 + else + local.get $0 + f64.promote_f32 + f64.const 4.71238898038469 + f64.sub + local.tee $1 + local.get $1 + f64.mul + local.tee $1 + local.get $1 + f64.mul + local.set $2 + f64.const 1 + local.get $1 + f64.const -0.499999997251031 + f64.mul + f64.add + local.get $2 + f64.const 0.04166662332373906 + f64.mul + f64.add + local.get $2 + local.get $1 + f64.mul + f64.const -0.001388676377460993 + local.get $1 + f64.const 2.439044879627741e-05 + f64.mul + f64.add + f64.mul + f64.add + f32.demote_f64 + f32.neg + end + return + end + local.get $0 + f64.promote_f32 + local.tee $1 + f64.const 6.283185307179586 + f64.add + local.get $1 + f64.const 6.283185307179586 + f64.sub + local.get $7 + select + local.tee $2 + local.get $2 + f64.mul + local.tee $1 + local.get $2 + f64.mul + local.set $5 + local.get $2 + local.get $5 + f64.const -0.16666666641626524 + local.get $1 + f64.const 0.008333329385889463 + f64.mul + f64.add + f64.mul + f64.add + local.get $5 + local.get $1 + local.get $1 + f64.mul + f64.mul + f64.const -1.9839334836096632e-04 + local.get $1 + f64.const 2.718311493989822e-06 + f64.mul + f64.add + f64.mul + f64.add + f32.demote_f64 + return + end + local.get $3 + i32.const 2139095040 + i32.ge_u + if + local.get $0 + local.get $0 + f32.sub + return + end + block $~lib/math/rempio2f|inlined.1 (result i32) + local.get $3 + i32.const 1305022427 + i32.lt_u + if + local.get $0 + f64.promote_f32 + local.tee $2 + f64.const 0.6366197723675814 + f64.mul + f64.nearest + local.set $1 + local.get $2 + local.get $1 + f64.const 1.5707963109016418 + f64.mul + f64.sub + local.get $1 + f64.const 1.5893254773528196e-08 + f64.mul + f64.sub + global.set $~lib/math/rempio2f_y + local.get $1 + i32.trunc_f64_s + br $~lib/math/rempio2f|inlined.1 + end + i32.const 76 + i32.load + local.get $3 + i32.const 23 + i32.shr_s + i32.const 152 + i32.sub + local.tee $6 + i32.const 6 + i32.shr_s + local.tee $9 + i32.const 3 + i32.shl + i32.add + i64.load + local.set $10 + i32.const 76 + i32.load + local.get $9 + i32.const 1 + i32.add + i32.const 3 + i32.shl + i32.add + i64.load + local.set $4 + local.get $6 + i32.const 63 + i32.and + local.tee $6 + i32.const 32 + i32.gt_s + if (result i64) + local.get $4 + local.get $6 + i32.const 32 + i32.sub + i64.extend_i32_s + i64.shl + i32.const 76 + i32.load + local.get $9 + i32.const 2 + i32.add + i32.const 3 + i32.shl + i32.add + i64.load + i64.const 96 + local.get $6 + i64.extend_i32_s + i64.sub + i64.shr_u + i64.or + else + local.get $4 + i64.const 32 + local.get $6 + i64.extend_i32_s + i64.sub + i64.shr_u + end + local.set $8 + f64.const 8.515303950216386e-20 + local.get $0 + f64.promote_f32 + f64.copysign + local.get $3 + i32.const 8388607 + i32.and + i32.const 8388608 + i32.or + i64.extend_i32_s + local.tee $11 + local.get $4 + i64.const 64 + local.get $6 + i64.extend_i32_s + local.tee $4 + i64.sub + i64.shr_u + local.get $10 + local.get $4 + i64.shl + i64.or + i64.mul + local.get $8 + local.get $11 + i64.mul + i64.const 32 + i64.shr_u + i64.add + local.tee $4 + i64.const 2 + i64.shl + local.tee $8 + f64.convert_i64_s + f64.mul + global.set $~lib/math/rempio2f_y + i32.const 0 + local.get $4 + i64.const 62 + i64.shr_u + local.get $8 + i64.const 63 + i64.shr_u + i64.add + i32.wrap_i64 + local.tee $3 + i32.sub + local.get $3 + local.get $7 + select + end + local.set $3 + global.get $~lib/math/rempio2f_y + local.set $1 + local.get $3 + i32.const 1 + i32.and + if (result f32) + local.get $1 + local.get $1 + f64.mul + local.tee $1 + local.get $1 + f64.mul + local.set $2 + f64.const 1 + local.get $1 + f64.const -0.499999997251031 + f64.mul + f64.add + local.get $2 + f64.const 0.04166662332373906 + f64.mul + f64.add + local.get $2 + local.get $1 + f64.mul + f64.const -0.001388676377460993 + local.get $1 + f64.const 2.439044879627741e-05 + f64.mul + f64.add + f64.mul + f64.add + f32.demote_f64 + else + local.get $1 + local.get $1 + local.get $1 + f64.mul + local.tee $2 + local.get $1 + f64.mul + local.tee $1 + f64.const -0.16666666641626524 + local.get $2 + f64.const 0.008333329385889463 + f64.mul + f64.add + f64.mul + f64.add + local.get $1 + local.get $2 + local.get $2 + f64.mul + f64.mul + f64.const -1.9839334836096632e-04 + local.get $2 + f64.const 2.718311493989822e-06 + f64.mul + f64.add + f64.mul + f64.add + f32.demote_f64 + end + local.set $0 + local.get $0 + f32.neg + local.get $0 + local.get $3 + i32.const 2 + i32.and + select + return + end + local.get $1 + local.get $5 + f64.const -0.16666666641626524 + local.get $2 + f64.const 0.008333329385889463 + f64.mul + f64.add + f64.mul + f64.add + local.get $5 + local.get $2 + local.get $2 + f64.mul + f64.mul + f64.const -1.9839334836096632e-04 + local.get $2 + f64.const 2.718311493989822e-06 + f64.mul + f64.add + f64.mul + f64.add + f32.demote_f64 + ) + (func $assembly/libmf/sin (; 49 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.sin + ) + (func $~lib/math/NativeMathf.sinh (; 50 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 f32) + (local $2 i32) + (local $3 f32) + local.get $0 + i32.reinterpret_f32 + i32.const 2147483647 + i32.and + local.tee $2 + f32.reinterpret_i32 + local.set $1 + f32.const 0.5 + local.get $0 + f32.copysign + local.set $3 + local.get $2 + i32.const 1118925335 + i32.lt_u + if + local.get $1 + call $~lib/math/NativeMathf.expm1 + local.set $1 + local.get $2 + i32.const 1065353216 + i32.lt_u + if + local.get $2 + i32.const 964689920 + i32.lt_u + if + local.get $0 + return + end + local.get $3 + f32.const 2 + local.get $1 + f32.mul + local.get $1 + local.get $1 + f32.mul + local.get $1 + f32.const 1 + f32.add + f32.div + f32.sub + f32.mul + return + end + local.get $3 + local.get $1 + local.get $1 + local.get $1 + f32.const 1 + f32.add + f32.div + f32.add + f32.mul + return + end + f32.const 2 + local.get $3 + f32.mul + local.get $1 + f32.const 162.88958740234375 + f32.sub + call $~lib/math/NativeMathf.exp + f32.const 1661534994731144841129758e11 + f32.mul + f32.const 1661534994731144841129758e11 + f32.mul + f32.mul + ) + (func $assembly/libmf/sinh (; 51 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.sinh + ) + (func $assembly/libmf/sqrt (; 52 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + f32.sqrt + ) + (func $~lib/math/NativeMathf.tan (; 53 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 f64) + (local $2 f64) + (local $3 f64) + (local $4 i32) + (local $5 i64) + (local $6 i32) + (local $7 i32) + (local $8 i64) + (local $9 i32) + (local $10 i64) + (local $11 i64) + local.get $0 + i32.reinterpret_f32 + local.tee $4 + i32.const 31 + i32.shr_u + local.set $7 + block $folding-inner1 + block $folding-inner0 + local.get $4 + i32.const 2147483647 + i32.and + local.tee $4 + i32.const 1061752794 + i32.le_u + if + local.get $4 + i32.const 964689920 + i32.lt_u + if + local.get $0 + return + end + local.get $0 + f64.promote_f32 + local.tee $2 + local.get $2 + f64.mul + local.tee $1 + local.get $2 + f64.mul + local.set $3 + br $folding-inner0 + end + local.get $4 + i32.const 1081824209 + i32.le_u + if + local.get $4 + i32.const 1075235811 + i32.le_u + if + local.get $0 + f64.promote_f32 + local.tee $1 + f64.const 1.5707963267948966 + f64.add + local.get $1 + f64.const 1.5707963267948966 + f64.sub + local.get $7 + select + local.tee $2 + local.get $2 + f64.mul + local.tee $1 + local.get $2 + f64.mul + local.set $3 + br $folding-inner1 + else + local.get $0 + f64.promote_f32 + local.tee $1 + f64.const 3.141592653589793 + f64.add + local.get $1 + f64.const 3.141592653589793 + f64.sub + local.get $7 + select + local.tee $2 + local.get $2 + f64.mul + local.tee $1 + local.get $2 + f64.mul + local.set $3 + br $folding-inner0 + end + unreachable + end + local.get $4 + i32.const 1088565717 + i32.le_u + if + local.get $4 + i32.const 1085271519 + i32.le_u + if + local.get $0 + f64.promote_f32 + local.tee $1 + f64.const 4.71238898038469 + f64.add + local.get $1 + f64.const 4.71238898038469 + f64.sub + local.get $7 + select + local.tee $2 + local.get $2 + f64.mul + local.tee $1 + local.get $2 + f64.mul + local.set $3 + br $folding-inner1 + else + local.get $0 + f64.promote_f32 + local.tee $1 + f64.const 6.283185307179586 + f64.add + local.get $1 + f64.const 6.283185307179586 + f64.sub + local.get $7 + select + local.tee $2 + local.get $2 + f64.mul + local.tee $1 + local.get $2 + f64.mul + local.set $3 + br $folding-inner0 + end + unreachable + end + local.get $4 + i32.const 2139095040 + i32.ge_u + if + local.get $0 + local.get $0 + f32.sub + return + end + block $~lib/math/rempio2f|inlined.2 (result i32) + local.get $4 + i32.const 1305022427 + i32.lt_u + if + local.get $0 + f64.promote_f32 + local.tee $2 + f64.const 0.6366197723675814 + f64.mul + f64.nearest + local.set $1 + local.get $2 + local.get $1 + f64.const 1.5707963109016418 + f64.mul + f64.sub + local.get $1 + f64.const 1.5893254773528196e-08 + f64.mul + f64.sub + global.set $~lib/math/rempio2f_y + local.get $1 + i32.trunc_f64_s + br $~lib/math/rempio2f|inlined.2 + end + i32.const 76 + i32.load + local.get $4 + i32.const 23 + i32.shr_s + i32.const 152 + i32.sub + local.tee $6 + i32.const 6 + i32.shr_s + local.tee $9 + i32.const 3 + i32.shl + i32.add + i64.load + local.set $10 + i32.const 76 + i32.load + local.get $9 + i32.const 1 + i32.add + i32.const 3 + i32.shl + i32.add + i64.load + local.set $5 + local.get $6 + i32.const 63 + i32.and + local.tee $6 + i32.const 32 + i32.gt_s + if (result i64) + local.get $5 + local.get $6 + i32.const 32 + i32.sub + i64.extend_i32_s + i64.shl + i32.const 76 + i32.load + local.get $9 + i32.const 2 + i32.add + i32.const 3 + i32.shl + i32.add + i64.load + i64.const 96 + local.get $6 + i64.extend_i32_s + i64.sub + i64.shr_u + i64.or + else + local.get $5 + i64.const 32 + local.get $6 + i64.extend_i32_s + i64.sub + i64.shr_u + end + local.set $8 + f64.const 8.515303950216386e-20 + local.get $0 + f64.promote_f32 + f64.copysign + local.get $4 + i32.const 8388607 + i32.and + i32.const 8388608 + i32.or + i64.extend_i32_s + local.tee $11 + local.get $5 + i64.const 64 + local.get $6 + i64.extend_i32_s + local.tee $5 + i64.sub + i64.shr_u + local.get $10 + local.get $5 + i64.shl + i64.or + i64.mul + local.get $8 + local.get $11 + i64.mul + i64.const 32 + i64.shr_u + i64.add + local.tee $5 + i64.const 2 + i64.shl + local.tee $8 + f64.convert_i64_s + f64.mul + global.set $~lib/math/rempio2f_y + i32.const 0 + local.get $5 + i64.const 62 + i64.shr_u + local.get $8 + i64.const 63 + i64.shr_u + i64.add + i32.wrap_i64 + local.tee $4 + i32.sub + local.get $4 + local.get $7 + select + end + local.set $4 + global.get $~lib/math/rempio2f_y + local.tee $2 + local.get $2 + f64.mul + local.tee $1 + local.get $2 + f64.mul + local.set $3 + local.get $2 + local.get $3 + f64.const 0.3333313950307914 + local.get $1 + f64.const 0.13339200271297674 + f64.mul + f64.add + f64.mul + f64.add + local.get $3 + local.get $1 + local.get $1 + f64.mul + local.tee $2 + f64.mul + f64.const 0.05338123784456704 + local.get $1 + f64.const 0.024528318116654728 + f64.mul + f64.add + local.get $2 + f64.const 0.002974357433599673 + local.get $1 + f64.const 0.009465647849436732 + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + local.set $1 + f64.const -1 + local.get $1 + f64.div + local.get $1 + local.get $4 + i32.const 1 + i32.and + select + f32.demote_f64 + return + end + local.get $2 + local.get $3 + f64.const 0.3333313950307914 + local.get $1 + f64.const 0.13339200271297674 + f64.mul + f64.add + f64.mul + f64.add + local.get $3 + local.get $1 + local.get $1 + f64.mul + local.tee $2 + f64.mul + f64.const 0.05338123784456704 + local.get $1 + f64.const 0.024528318116654728 + f64.mul + f64.add + local.get $2 + f64.const 0.002974357433599673 + local.get $1 + f64.const 0.009465647849436732 + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f32.demote_f64 + return + end + f64.const -1 + local.get $2 + local.get $3 + f64.const 0.3333313950307914 + local.get $1 + f64.const 0.13339200271297674 + f64.mul + f64.add + f64.mul + f64.add + local.get $3 + local.get $1 + local.get $1 + f64.mul + local.tee $2 + f64.mul + f64.const 0.05338123784456704 + local.get $1 + f64.const 0.024528318116654728 + f64.mul + f64.add + local.get $2 + f64.const 0.002974357433599673 + local.get $1 + f64.const 0.009465647849436732 + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.div + f32.demote_f64 + ) + (func $assembly/libmf/tan (; 54 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.tan + ) + (func $~lib/math/NativeMathf.tanh (; 55 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 f32) + (local $2 i32) + local.get $0 + i32.reinterpret_f32 + i32.const 2147483647 + i32.and + local.tee $2 + f32.reinterpret_i32 + local.set $1 + local.get $2 + i32.const 1057791828 + i32.gt_u + if + local.get $2 + i32.const 1092616192 + i32.gt_u + if (result f32) + f32.const 1 + f32.const 0 + local.get $1 + f32.div + f32.add + else + f32.const 1 + f32.const 2 + f32.const 2 + local.get $1 + f32.mul + call $~lib/math/NativeMathf.expm1 + f32.const 2 + f32.add + f32.div + f32.sub + end + local.set $1 + else + local.get $2 + i32.const 1048757624 + i32.gt_u + if + f32.const 2 + local.get $1 + f32.mul + call $~lib/math/NativeMathf.expm1 + local.tee $1 + local.get $1 + f32.const 2 + f32.add + f32.div + local.set $1 + else + local.get $2 + i32.const 8388608 + i32.ge_u + if + f32.const -2 + local.get $1 + f32.mul + call $~lib/math/NativeMathf.expm1 + local.tee $1 + f32.neg + local.get $1 + f32.const 2 + f32.add + f32.div + local.set $1 + end + end + end + local.get $1 + local.get $0 + f32.copysign + ) + (func $assembly/libmf/tanh (; 56 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.tanh + ) + (func $assembly/libmf/trunc (; 57 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + f32.trunc + ) + (func $null (; 58 ;) (type $FUNCSIG$v) + nop + ) +) diff --git a/lib/libm/index.d.ts b/lib/libm/index.d.ts new file mode 100644 index 0000000000..84cb74c812 --- /dev/null +++ b/lib/libm/index.d.ts @@ -0,0 +1,2 @@ +declare const libm: typeof Math & { libm: typeof Math, libmf: typeof Math }; +export = libm; diff --git a/lib/libm/index.js b/lib/libm/index.js new file mode 100644 index 0000000000..8fb0769ce2 --- /dev/null +++ b/lib/libm/index.js @@ -0,0 +1,7 @@ +const fs = require("fs"); +const libm = new WebAssembly.Instance(new WebAssembly.Module(fs.readFileSync("./build/libm.wasm")), { Math }).exports; +const libmf = new WebAssembly.Instance(new WebAssembly.Module(fs.readFileSync("./build/libmf.wasm")), {}).exports; +module.exports = Object.create(libm, { + libm: { value: libm, enumerable: true }, + libmf: { value: libmf, enumerable: true } +}); diff --git a/lib/libm/package.json b/lib/libm/package.json new file mode 100644 index 0000000000..36309ebcf2 --- /dev/null +++ b/lib/libm/package.json @@ -0,0 +1,23 @@ +{ + "name": "@assemblyscript/libm", + "version": "1.0.0", + "license": "Apache-2.0", + "main": "index.js", + "types": "index.d.ts", + "scripts": { + "asbuild": "npm run asbuild:libm && npm run asbuild:libmf", + "asbuild:libm": "asc assembly/libm.ts -O3 -b build/libm.wasm -t build/libm.wat --runtime none --validate", + "asbuild:libmf": "asc assembly/libmf.ts -O3 -b build/libmf.wasm -t build/libmf.wat --runtime none --validate" + }, + "files": [ + "package.json", + "index.d.ts", + "index.js", + "build/*.wasm", + "README.md" + ], + "dependencies": {}, + "devDependencies": { + "assemblyscript": "AssemblyScript/assemblyscript" + } +} diff --git a/lib/lint/base.json b/lib/lint/base.json index 5fd658b493..7c9f781f0c 100644 --- a/lib/lint/base.json +++ b/lib/lint/base.json @@ -39,12 +39,6 @@ "no-debugger": { "severity": "error" }, - "no-default-export": { - "severity": "error" - }, - "no-duplicate-imports": { - "severity": "error" - }, "no-duplicate-super": { "severity": "error" }, diff --git a/lib/loader/README.md b/lib/loader/README.md index 7bc145afb4..141256ddc4 100644 --- a/lib/loader/README.md +++ b/lib/loader/README.md @@ -7,7 +7,7 @@ Usage ----- ```js -const loader = require("@assemblyscript/loader"); +const loader = require("assemblyscript/lib/loader"); ... ``` @@ -26,131 +26,176 @@ API * **demangle**<`T`>(exports: `WasmExports`, baseModule?: `Object`): `T`
Demangles an AssemblyScript module's exports to a friendly object structure. You usually don't have to call this manually as instantiation does this implicitly. -**Note:** `T` above can either be omitted if the structure of the module is unknown, or can reference a `.d.ts` (i.e. `typeof MyModule`) as produced by the compiler with the `-d` option. +**Note** that `T` above can either be omitted if the structure of the module is unknown, or can reference a `.d.ts` (i.e. `typeof MyModule`) as produced by the compiler with the `-d` option. -Instances are automatically populated with useful utility: +Besides demangling classes exported from your entry file to a handy object structure one can use like JS objects, instances are automatically populated with useful utility: * **I8**: `Int8Array`
An 8-bit signed integer view on the memory. + ```ts + var value = module.I8[ptr]; + ``` + * **U8**: `Uint8Array`
An 8-bit unsigned integer view on the memory. + ```ts + var value = module.U8[ptr]; + ``` + * **I16**: `Int16Array`
A 16-bit signed integer view on the memory. + ```ts + var value = module.I16[ptr >>> 1]; + ``` + * **U16**: `Uint16Array`
A 16-bit unsigned integer view on the memory. + ```ts + var value = module.U16[ptr >>> 1]; + ``` + * **I32**: `Int32Array`
A 32-bit signed integer view on the memory. + ```ts + var value = module.I32[ptr >>> 2]; + ``` + * **U32**: `Uint32Array`
A 32-bit unsigned integer view on the memory. + ```ts + var value = module.U32[ptr >>> 2]; + ``` + * **I64**: `BigInt64Array`
- A 64-bit signed integer view on the memory1. + A 64-bit signed integer view on the memory, if supported by the VM. + + ```ts + var value = module.I64[ptr >>> 3]; + ``` * **U64**: `BigUint64Array`
- A 64-bit unsigned integer view on the memory1. + A 64-bit unsigned integer view on the memory, if supported by the VM. + + ```ts + var value = module.U64[ptr >>> 3]; + ``` * **F32**: `Float32Array`
A 32-bit float view on the memory. + ```ts + var value = module.I32[ptr >>> 2]; + ``` + * **F64**: `Float64Array`
A 64-bit float view on the memory. -* **newString**(str: `string`): `number`
- Allocates a new string in the module's memory and returns its pointer.2 + ```ts + var value = module.F64[ptr >>> 3]; + ``` -* **getString**(ptr: `number`): `string`
- Gets a string from the module's memory by its pointer. +* **__start**(): `void`
+ Explicit start function if the `--explicitStart` option is used. Must be called before any other exports if present. -* **newArray**(view: `TypedArray`, length?: `number`, unsafe?: `boolean`): `number`
- Copies a typed array into the module's memory and returns its pointer.2 +* **__allocString**(str: `string`): `number`
+ Allocates a new string in the module's memory and returns a reference (pointer) to it. -* **newArray**(ctor: `TypedArrayConstructor`, length: `number`, unsafe?: `boolean`): `number`
- Creates a typed array in the module's memory and returns its pointer.2 + ```ts + var ref = module.__retain(module.__allocString("hello world")); + ... + module.__release(ref); + ``` -* **getArray**(ctor: `TypedArrayConstructor`, ptr: `number`): `TypedArray`
- Gets a view on a typed array in the module's memory by its pointer. +* **__getString**(ref: `number`): `string`
+ Reads (copies) the value of a string from the module's memory. -* **freeArray**(ptr: `number`): `void`
- Frees a typed array in the module's memory. Must not be accessed anymore afterwards. + ```ts + var str = module.__getString(ref); + ... + ``` -* **getFunction**(ptr: `number`): `function`
- Gets a function by its pointer. +* **__allocArray**(id: `number`, values: `number[]`): `number`
+ Allocates a new array in the module's memory and returns a reference (pointer) to it. + Automatically retains interior pointers. The `id` is the unique runtime id of the respective array class. If you are using `Int32Array` for example, the best way to know the id is an `export const INT32ARRAY_ID = idof()`. When done with the array, make sure to release it. -* **newFunction**(fn: `function`): `number`
- Creates a new function in the module's table and returns its pointer. Note that only actual - WebAssembly functions, i.e. as exported by the module, are supported. + ```ts + var ref = module.__retain(module.__allocArray(module.INT32ARRAY, [1, 2, 3])); + ... + module.__release(ref); + ``` -1 This feature has not yet landed in any VM as of this writing.
-2 Requires that memory utilities have been exported through `export { memory }` within the entry file. +* **__getArray**(ref: `number`): `number[]`
+ Reads (copies) the values of an array from the module's memory. -Examples --------- + ```ts + var arr = module.__getArray(ref); + ... + ``` -### Instantiating a module +* **__getArrayView**(ref: `number`): `TypedArray`
+ Gets a view on the values of an array in the module's memory. This differs from `__getArray` in that the data isn't copied but remains *live* in both directions. That's faster but also unsafe because if the array grows or becomes released, the view will no longer represent the correct memory region and modifying its values in this state will most likely corrupt memory. Use, but use with care. -```js -// From a module provided as a buffer, i.e. as returned by fs.readFileSync -const myModule = loader.instantiateBuffer(fs.readFileSync("myModule.wasm"), myImports); +* **__retain**(ref: `number`): `number`
+ Retains a reference externally, making sure that it doesn't become collected prematurely. Returns the reference. -// From a response object, i.e. as returned by window.fetch -const myModule = await loader.instantiateStreaming(fetch("myModule.wasm"), myImports); -``` - -### Reading/writing basic values to/from memory - -```js -var ptrToInt8 = ...; -var value = myModule.I8[ptrToInt8]; // alignment of log2(1)=0 +* **__release**(ref: `number`): `void`
+ Releases a previously retained reference to an object, allowing the runtime to collect it once its reference count reaches zero. -var ptrToInt16 = ...; -var value = myModule.I16[ptrToInt16 >>> 1]; // alignment of log2(2)=1 +* **__alloc**(size: `number`, id: `number`): `number`
+ Allocates an instance of the class represented by the specified id. If you are using `MyClass` for example, the best way to know the id and the necessary size is an `export const MYCLASS_ID = idof()` and an `export const MYCLASS_SIZE = offsetof()`. Afterwards, use the respective views to assign values to the class's memory while making sure to retain interior references to other managed objects once. When done with the class, make sure to release it, which will automatically release any interior references once the class becomes collected. -var ptrToInt32 = ...; -var value = myModule.I32[ptrToInt32 >>> 2]; // alignment of log2(4)=2 + ```ts + var ref = module.__retain(module.__alloc(module.MYCLASS_SIZE, module.MYCLASS_ID)); + F32[ref + MYCLASS_BASICFIELD1_OFFSET >>> 2] = field1_value_f32; + U32[ref + MYCLASS_MANAGEDFIELD2_OFFSET >>> 2] = module.__retain(field2_value_ref); + ... + module.__release(ref); + ``` -var ptrToInt64 = ...; -var value = myModule.I64[ptrToInt64 >>> 3]; // alignment of log2(8)=3 +* **__instanceof**(ref: `number`, baseId: `number`): `boolean`
+ Tests whether an object is an instance of the class represented by the specified base id. -var ptrToFloat32 = ...; -var value = myModule.F32[ptrToFloat32 >>> 2]; // alignment of log2(4)=2 + ```ts + if (module.__instanceof(ref, module.MYCLASS_ID)) { + ... + } + ``` -var ptrToFloat64 = ...; -var value = myModule.F64[ptrToFloat64 >>> 3]; // alignment of log2(8)=3 +* **__collect**(): `void`
+ Forces a cycle collection. Only relevant if objects potentially forming reference cycles are used. -// Likewise, for writing -myModule.I8[ptrToInt8] = newValue; -myModule.I16[ptrToInt16 >>> 1] = newValue; -myModule.I32[ptrToInt32 >>> 2] = newValue; -myModule.I64[ptrToInt64 >>> 3] = newValue; -myModule.F32[ptrToFloat32 >>> 2] = newValue; -myModule.F64[ptrToFloat64 >>> 3] = newValue; -``` +**Note** that the views like `I32` above will automatically be updated when the module's memory grows. Don't cache these if this can happen. -**Note:** Make sure to reference the views as shown above as these will automatically be updated when the module's memory grows. +**Note** that the allocation and ownership features above require the `full` (this is the default) or the `stub` runtime to be present in your module. Other runtime variations do not export this functionality without further ado (so the compiler can eliminate what's dead code). -### Working with strings and arrays +**Note** that references returned from exported functions have already been retained for you and the runtime expects that you release them once not needed anymore. This is also true for constructors and getters. -Strings and arrays cannot yet flow in and out of WebAssembly naturally, hence it is necessary to create them in the module's memory using the `newString` and `newArray` helpers. Afterwards, instead of passing the string or array directly, the resulting reference (pointer) is provided instead: +**Beware that your module is likely going to explode with seemingly random errors when using the allocation and ownership features incorrectly!** -```js -var str = "Hello world!"; -var ptr = module.newString(str); +* Use the correct ids, sizes and layouts (C-style non-packed, export `offsetof("myField")` in case of doubt) +* Clear unused memory to zero +* Retain what you allocate +* Retain interior pointers (except in `__allocArray`) +* Don't retain what's returned (is already retained for you) +* Release when you're done with something and don't ever use it again -// ... do something with ptr, i.e. call a WebAssembly export ... -``` +Examples +-------- -Similarly, when a string or array is returned from a WebAssembly function, a reference (pointer) is received on the JS side and the `getString` and `getArray` helpers can be used to obtain their values: +### Instantiating a module ```js -var ptrToString = ...; -var str = module.getString(ptrToString); +// From a module provided as a buffer, i.e. as returned by fs.readFileSync +const myModule = loader.instantiateBuffer(fs.readFileSync("myModule.wasm"), myImports); -// ... do something with str ... +// From a response object, i.e. as returned by window.fetch +const myModule = await loader.instantiateStreaming(fetch("myModule.wasm"), myImports); ``` ### Usage with TypeScript definitions produced by the compiler diff --git a/lib/loader/index.d.ts b/lib/loader/index.d.ts index b4814d273f..fa239e99db 100644 --- a/lib/loader/index.d.ts +++ b/lib/loader/index.d.ts @@ -1,18 +1,19 @@ import "@types/webassembly-js-api"; /** WebAssembly imports with two levels of nesting. */ -interface ImportsObject { - [key: string]: {}, - env: { +interface ImportsObject extends Record { + env?: { memory?: WebAssembly.Memory, table?: WebAssembly.Table, - abort?: (msg: number, file: number, line: number, column: number) => void + abort?: (msg: number, file: number, line: number, column: number) => void, + trace?: (msg: number, numArgs?: number, ...args: any[]) => void } } type TypedArray = Int8Array | Uint8Array + | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array @@ -20,16 +21,6 @@ type TypedArray | Float32Array | Float64Array; -type TypedArrayConstructor - = Int8ArrayConstructor - | Uint8ArrayConstructor - | Int16ArrayConstructor - | Uint16ArrayConstructor - | Int32ArrayConstructor - | Uint32ArrayConstructor - | Float32ArrayConstructor - | Float32ArrayConstructor; - /** Utility mixed in by the loader. */ interface ASUtil { /** An 8-bit signed integer view on the memory. */ @@ -52,25 +43,28 @@ interface ASUtil { readonly F32: Float32Array; /** A 64-bit float view on the memory. */ readonly F64: Float64Array; - /** Allocates a new string in the module's memory and returns its pointer. */ - newString(str: string): number; - /** Gets a string from the module's memory by its pointer. */ - getString(ptr: number): string; - /** Copies a typed array into the module's memory and returns its pointer. */ - newArray(view: TypedArray, length?: number): number; - /** Creates a typed array in the module's memory and returns its pointer. */ - newArray(ctor: TypedArrayConstructor, length: number, unsafe?: boolean): number; - /** Gets a view on a typed array in the module's memory by its pointer. */ - getArray(ctor: TypedArrayConstructor, ptr: number): T; - /** Frees a typed array in the module's memory. Must not be accessed anymore afterwards. */ - freeArray(ptr: number): void; - /** Gets a function by its pointer. */ - getFunction(ptr: number): (...args: any[]) => R; - /** - * Creates a new function in the module's table and returns its pointer. Note that only actual - * WebAssembly functions, i.e. as exported by the module, are supported. - */ - newFunction(fn: (...args: any[]) => any): number; + /** Explicit start function, if requested. */ + __start(): void; + /** Allocates a new string in the module's memory and returns a reference (pointer) to it. */ + __allocString(str: string): number; + /** Reads (copies) the value of a string from the module's memory. */ + __getString(ref: number): string; + /** Allocates a new array in the module's memory and returns a reference (pointer) to it. */ + __allocArray(id: number, values: number[]): number; + /** Reads (copies) the values of an array from the module's memory. */ + __getArray(ref: number): number[]; + /** Gets a view on the values of an array in the module's memory. */ + __getArrayView(ref: number): TypedArray; + /** Retains a reference externally, making sure that it doesn't become collected prematurely. Returns the reference. */ + __retain(ref: number): number; + /** Releases a previously retained reference to an object, allowing the runtime to collect it once its reference count reaches zero. */ + __release(ref: number): void; + /** Allocates an instance of the class represented by the specified id. */ + __alloc(size: number, id: number): number; + /** Tests whether an object is an instance of the class represented by the specified base id. */ + __instanceof(ref: number, baseId: number): boolean; + /** Forces a cycle collection. Only relevant if objects potentially forming reference cycles are used. */ + __collect(): void; } /** Instantiates an AssemblyScript module using the specified imports. */ diff --git a/lib/loader/index.js b/lib/loader/index.js index 7f79027bdb..5864874886 100644 --- a/lib/loader/index.js +++ b/lib/loader/index.js @@ -1,43 +1,75 @@ "use strict"; -const hasBigInt64 = typeof BigUint64Array !== "undefined"; -const thisPtr = Symbol(); +// Runtime header offsets +const ID_OFFSET = -8; +const SIZE_OFFSET = -4; + +// Runtime ids +const ARRAYBUFFER_ID = 0; +const STRING_ID = 1; +const ARRAYBUFFERVIEW_ID = 2; + +// Runtime type information +const ARRAYBUFFERVIEW = 1 << 0; +const ARRAY = 1 << 1; +const SET = 1 << 2; +const MAP = 1 << 3; +const VAL_ALIGN = 1 << 5; +const VAL_SIGNED = 1 << 10; +const VAL_FLOAT = 1 << 11; +const VAL_NULLABLE = 1 << 12; +const VAL_MANAGED = 1 << 13; +const KEY_ALIGN = 1 << 14; +const KEY_SIGNED = 1 << 19; +const KEY_FLOAT = 1 << 20; +const KEY_NULLABLE = 1 << 21; +const KEY_MANAGED = 1 << 22; + +// Array(BufferView) layout +const ARRAYBUFFERVIEW_BUFFER_OFFSET = 0; +const ARRAYBUFFERVIEW_DATASTART_OFFSET = 4; +const ARRAYBUFFERVIEW_DATALENGTH_OFFSET = 8; +const ARRAYBUFFERVIEW_SIZE = 12; +const ARRAY_LENGTH_OFFSET = 12; +const ARRAY_SIZE = 16; + +const BIGINT = typeof BigUint64Array !== "undefined"; +const THIS = Symbol(); +const CHUNKSIZE = 1024; /** Gets a string from an U32 and an U16 view on a memory. */ -function getStringImpl(U32, U16, ptr) { - var dataLength = U32[ptr >>> 2]; - var dataOffset = (ptr + 4) >>> 1; - var dataRemain = dataLength; - var parts = []; - const chunkSize = 1024; - while (dataRemain > chunkSize) { - let last = U16[dataOffset + chunkSize - 1]; - let size = last >= 0xD800 && last < 0xDC00 ? chunkSize - 1 : chunkSize; - let part = U16.subarray(dataOffset, dataOffset += size); - parts.push(String.fromCharCode.apply(String, part)); - dataRemain -= size; - } - return parts.join("") + String.fromCharCode.apply(String, U16.subarray(dataOffset, dataOffset + dataRemain)); +function getStringImpl(U32, U16, ref) { + var length = U32[(ref + SIZE_OFFSET) >>> 2] >>> 1; + var offset = ref >>> 1; + if (length <= CHUNKSIZE) return String.fromCharCode.apply(String, U16.subarray(offset, offset + length)); + const parts = []; + do { + const last = U16[offset + CHUNKSIZE - 1]; + const size = last >= 0xD800 && last < 0xDC00 ? CHUNKSIZE - 1 : CHUNKSIZE; + parts.push(String.fromCharCode.apply(String, U16.subarray(offset, offset += size))); + length -= size; + } while (length > CHUNKSIZE); + return parts.join("") + String.fromCharCode.apply(String, U16.subarray(offset, offset + length)); } /** Prepares the base module prior to instantiation. */ function preInstantiate(imports) { - var baseModule = {}; + const baseModule = {}; - function getString(memory, ptr) { + function getString(memory, ref) { if (!memory) return ""; - var buffer = memory.buffer; - return getStringImpl(new Uint32Array(buffer), new Uint16Array(buffer), ptr); + const buffer = memory.buffer; + return getStringImpl(new Uint32Array(buffer), new Uint16Array(buffer), ref); } // add common imports used by stdlib for convenience - var env = (imports.env = imports.env || {}); + const env = (imports.env = imports.env || {}); env.abort = env.abort || function abort(mesg, file, line, colm) { - var memory = baseModule.memory || env.memory; // prefer exported, otherwise try imported + const memory = baseModule.memory || env.memory; // prefer exported, otherwise try imported throw Error("abort: " + getString(memory, mesg) + " at " + getString(memory, file) + ":" + line + ":" + colm); } env.trace = env.trace || function trace(mesg, n) { - var memory = baseModule.memory || env.memory; + const memory = baseModule.memory || env.memory; console.log("trace: " + getString(memory, mesg) + (n ? " " : "") + Array.prototype.slice.call(arguments, 2, 2 + n).join(", ")); } imports.Math = imports.Math || Math; @@ -48,13 +80,12 @@ function preInstantiate(imports) { /** Prepares the final module once instantiation is complete. */ function postInstantiate(baseModule, instance) { - var rawExports = instance.exports; - var memory = rawExports.memory; - var memory_allocate = rawExports["memory.allocate"]; - var memory_fill = rawExports["memory.fill"]; - var memory_free = rawExports["memory.free"]; - var table = rawExports.table; - var setargc = rawExports._setargc || function() {}; + const rawExports = instance.exports; + const memory = rawExports.memory; + const table = rawExports.table; + const alloc = rawExports["__alloc"]; + const retain = rawExports["__retain"]; + const rttiBase = rawExports["__rtti_base"] || ~0; // oob if not present // Provide views for all sorts of basic values var buffer, I8, U8, I16, U16, I32, U32, F32, F64, I64, U64; @@ -70,7 +101,7 @@ function postInstantiate(baseModule, instance) { U16 = new Uint16Array(buffer); I32 = new Int32Array(buffer); U32 = new Uint32Array(buffer); - if (hasBigInt64) { + if (BIGINT) { I64 = new BigInt64Array(buffer); U64 = new BigUint64Array(buffer); } @@ -80,109 +111,120 @@ function postInstantiate(baseModule, instance) { } checkMem(); - /** Allocates a new string in the module's memory and returns its pointer. */ - function newString(str) { - var dataLength = str.length; - var ptr = memory_allocate(4 + (dataLength << 1)); - var dataOffset = (4 + ptr) >>> 1; - checkMem(); - U32[ptr >>> 2] = dataLength; - for (let i = 0; i < dataLength; ++i) U16[dataOffset + i] = str.charCodeAt(i); - return ptr; + /** Gets the runtime type info for the given id. */ + function getInfo(id) { + const count = U32[rttiBase >>> 2]; + if ((id >>>= 0) >= count) throw Error("invalid id: " + id); + return U32[(rttiBase + 4 >>> 2) + id * 2]; + } + + /** Gets the runtime base id for the given id. */ + function getBase(id) { + const count = U32[rttiBase >>> 2]; + if ((id >>>= 0) >= count) throw Error("invalid id: " + id); + return U32[(rttiBase + 4 >>> 2) + id * 2 + 1]; } - baseModule.newString = newString; + /** Gets the runtime alignment of a collection's values or keys. */ + function getAlign(which, info) { + return 31 - Math.clz32((info / which) & 31); // -1 if none + } - /** Gets a string from the module's memory by its pointer. */ - function getString(ptr) { + /** Allocates a new string in the module's memory and returns its retained pointer. */ + function __allocString(str) { + const length = str.length; + const ref = alloc(length << 1, STRING_ID); checkMem(); - return getStringImpl(U32, U16, ptr); + for (let i = 0, j = ref >>> 1; i < length; ++i) U16[j + i] = str.charCodeAt(i); + return ref; } - baseModule.getString = getString; + baseModule.__allocString = __allocString; - function computeBufferSize(byteLength) { - const HEADER_SIZE = 8; - return 1 << (32 - Math.clz32(byteLength + HEADER_SIZE - 1)); + /** Reads a string from the module's memory by its pointer. */ + function __getString(ref) { + checkMem(); + const id = U32[ref + ID_OFFSET >>> 2]; + if (id !== STRING_ID) throw Error("not a string: " + ref); + return getStringImpl(U32, U16, ref); } - /** Creates a new typed array in the module's memory and returns its pointer. */ - function newArray(view, length, unsafe) { - var ctor = view.constructor; - if (ctor === Function) { // TypedArray constructor created in memory - ctor = view; - view = null; - } else { // TypedArray instance copied into memory - if (length === undefined) length = view.length; - } - var elementSize = ctor.BYTES_PER_ELEMENT; - if (!elementSize) throw Error("not a typed array"); - var byteLength = elementSize * length; - var ptr = memory_allocate(12); // TypedArray header - var buf = memory_allocate(computeBufferSize(byteLength)); // ArrayBuffer - checkMem(); - U32[ ptr >>> 2] = buf; // .buffer - U32[(ptr + 4) >>> 2] = 0; // .byteOffset - U32[(ptr + 8) >>> 2] = byteLength; // .byteLength - U32[ buf >>> 2] = byteLength; // .byteLength - U32[(buf + 4) >>> 2] = 0; // 0 - if (view) { - new ctor(buffer, buf + 8, length).set(view); - if (view.length < length && !unsafe) { - let setLength = elementSize * view.length; - memory_fill(buf + 8 + setLength, 0, byteLength - setLength); + baseModule.__getString = __getString; + + /** Gets the view matching the specified alignment, signedness and floatness. */ + function getView(align, signed, float) { + if (float) { + switch (align) { + case 2: return F32; + case 3: return F64; + } + } else { + switch (align) { + case 0: return signed ? I8 : U8; + case 1: return signed ? I16 : U16; + case 2: return signed ? I32 : U32; + case 3: return signed ? I64 : U64; } - } else if (!unsafe) { - memory_fill(buf + 8, 0, byteLength); } - return ptr; + throw Error("unsupported align: " + align); } - baseModule.newArray = newArray; - - /** Gets a view on a typed array in the module's memory by its pointer. */ - function getArray(ctor, ptr) { - var elementSize = ctor.BYTES_PER_ELEMENT; - if (!elementSize) throw Error("not a typed array"); + /** Allocates a new array in the module's memory and returns its retained pointer. */ + function __allocArray(id, values) { + const info = getInfo(id); + if (!(info & (ARRAYBUFFERVIEW | ARRAY))) throw Error("not an array: " + id + " @ " + info); + const align = getAlign(VAL_ALIGN, info); + const length = values.length; + const buf = alloc(length << align, ARRAYBUFFER_ID); + const arr = alloc(info & ARRAY ? ARRAY_SIZE : ARRAYBUFFERVIEW_SIZE, id); checkMem(); - var buf = U32[ ptr >>> 2]; - var byteOffset = U32[(ptr + 4) >>> 2]; - var byteLength = U32[(ptr + 8) >>> 2]; - return new ctor(buffer, buf + 8 + byteOffset, (byteLength - byteOffset) / elementSize); + U32[arr + ARRAYBUFFERVIEW_BUFFER_OFFSET >>> 2] = retain(buf); + U32[arr + ARRAYBUFFERVIEW_DATASTART_OFFSET >>> 2] = buf; + U32[arr + ARRAYBUFFERVIEW_DATALENGTH_OFFSET >>> 2] = length << align; + if (info & ARRAY) U32[arr + ARRAY_LENGTH_OFFSET >>> 2] = length; + const view = getView(align, info & VAL_SIGNED, info & VAL_FLOAT); + for (let i = 0; i < length; ++i) view[(buf >> align) + i] = values[i]; + if (info & VAL_MANAGED) for (let i = 0; i < length; ++i) retain(values[i]); + return arr; } - baseModule.getArray = getArray; + baseModule.__allocArray = __allocArray; - /** Frees a typed array in the module's memory. Must not be accessed anymore afterwards. */ - function freeArray(ptr) { + /** Gets a view on the values of an array in the module's memory. */ + function __getArrayView(arr) { checkMem(); - var buf = U32[ptr >>> 2]; - memory_free(buf); - memory_free(ptr); + const id = U32[arr + ID_OFFSET >>> 2]; + const info = getInfo(id); + if (!(info & ARRAYBUFFERVIEW)) throw Error("not an array: " + id); + const align = getAlign(VAL_ALIGN, info); + var buf = U32[arr + ARRAYBUFFERVIEW_DATASTART_OFFSET >>> 2]; + const length = info & ARRAY + ? U32[arr + ARRAY_LENGTH_OFFSET >>> 2] + : U32[buf + SIZE_OFFSET >>> 2] >>> align; + return getView(align, info & VAL_SIGNED, info & VAL_FLOAT) + .slice(buf >>>= align, buf + length); } - baseModule.freeArray = freeArray; - - /** - * Creates a new function in the module's table and returns its pointer. Note that only actual - * WebAssembly functions, i.e. as exported by the module, are supported. - */ - function newFunction(fn) { - if (typeof fn.original === "function") fn = fn.original; - var index = table.length; - table.grow(1); - table.set(index, fn); - return index; + baseModule.__getArrayView = __getArrayView; + + /** Reads (copies) the values of an array from the module's memory. */ + function __getArray(arr) { + return Array.from(__getArrayView(arr)); } - baseModule.newFunction = newFunction; + baseModule.__getArray = __getArray; - /** Gets a function by its pointer. */ - function getFunction(ptr) { - return wrapFunction(table.get(ptr), setargc); + /** Tests whether an object is an instance of the class represented by the specified base id. */ + function __instanceof(ref, baseId) { + var id = U32[(ref + ID_OFFSET) >>> 2]; + if (id <= U32[rttiBase >>> 2]) { + do if (id == baseId) return true; + while (id = getBase(id)); + } + return false; } - baseModule.getFunction = getFunction; + baseModule.__instanceof = __instanceof; // Pull basic exports to baseModule so code in preInstantiate can use them baseModule.memory = baseModule.memory || memory; @@ -209,8 +251,6 @@ function wrapFunction(fn, setargc) { setargc(args.length); return fn(...args); } - // adding a function to the table with `newFunction` is limited to actual WebAssembly functions, - // hence we can't use the wrapper and instead need to provide a reference to the original wrap.original = fn; return wrap; } @@ -245,7 +285,7 @@ exports.instantiateStreaming = instantiateStreaming; /** Demangles an AssemblyScript module's exports to a friendly object structure. */ function demangle(exports, baseModule) { var module = baseModule ? Object.create(baseModule) : {}; - var setargc = exports._setargc || function() {}; + var setargc = exports["__setargc"] || function() {}; function hasOwnProperty(elem, prop) { return Object.prototype.hasOwnProperty.call(elem, prop); } @@ -268,9 +308,13 @@ function demangle(exports, baseModule) { let ctor = function(...args) { return ctor.wrap(ctor.prototype.constructor(0, ...args)); }; - ctor.prototype = {}; + ctor.prototype = { + valueOf: function valueOf() { + return this[THIS]; + } + }; ctor.wrap = function(thisValue) { - return Object.create(ctor.prototype, { [thisPtr]: { value: thisValue, writable: false } }); + return Object.create(ctor.prototype, { [THIS]: { value: thisValue, writable: false } }); }; if (classElem) Object.getOwnPropertyNames(classElem).forEach(name => Object.defineProperty(ctor, name, Object.getOwnPropertyDescriptor(classElem, name)) @@ -284,8 +328,8 @@ function demangle(exports, baseModule) { let getter = exports[internalName.replace("set:", "get:")]; let setter = exports[internalName.replace("get:", "set:")]; Object.defineProperty(curr, name, { - get: function() { return getter(this[thisPtr]); }, - set: function(value) { setter(this[thisPtr], value); }, + get: function() { return getter(this[THIS]); }, + set: function(value) { setter(this[THIS], value); }, enumerable: true }); } @@ -296,7 +340,7 @@ function demangle(exports, baseModule) { Object.defineProperty(curr, name, { value: function (...args) { setargc(args.length); - return elem(this[thisPtr], ...args); + return elem(this[THIS], ...args); } }); } diff --git a/lib/loader/tests/assembly/index.ts b/lib/loader/tests/assembly/index.ts index 1c60c32727..3b68e105aa 100644 --- a/lib/loader/tests/assembly/index.ts +++ b/lib/loader/tests/assembly/index.ts @@ -1,5 +1,3 @@ -import "allocator/tlsf"; - export { memory }; export const COLOR: string = "red"; @@ -39,10 +37,6 @@ export class Car { this.doorsOpen = false; return true; } - - dispose(): void { - memory.free(changetype(this)); - } } export function sum(arr: Int32Array): i32 { @@ -51,11 +45,15 @@ export function sum(arr: Int32Array): i32 { return v; } +export function changeLength(arr: Array, length: i32): void { + arr.length = length; +} + export function varadd(a: i32 = 1, b: i32 = 2): i32 { return a + b; } -export const varadd_ptr = varadd; +export const varadd_ref = varadd; export function calladd(fn: (a: i32, b: i32) => i32, a: i32, b: i32): i32 { return fn(a, b); @@ -64,3 +62,8 @@ export function calladd(fn: (a: i32, b: i32) => i32, a: i32, b: i32): i32 { export function dotrace(num: f64): void { trace("The answer is", 1, num); } + +export const INT32ARRAY_ID = idof(); +export const UINT32ARRAY_ID = idof(); +export const FLOAT32ARRAY_ID = idof(); +export const ARRAYI32_ID = idof>(); diff --git a/lib/loader/tests/build/untouched.wasm b/lib/loader/tests/build/untouched.wasm index 656568dff5..fd6471c9dc 100644 Binary files a/lib/loader/tests/build/untouched.wasm and b/lib/loader/tests/build/untouched.wasm differ diff --git a/lib/loader/tests/index.js b/lib/loader/tests/index.js index 133dda77f7..c45ab474c0 100644 --- a/lib/loader/tests/index.js +++ b/lib/loader/tests/index.js @@ -21,44 +21,87 @@ assert(proto.F64 instanceof Float64Array); // should export memory assert(module.memory instanceof WebAssembly.Memory); -assert(typeof module.memory.free === "function"); +assert(typeof module.memory.copy === "function"); // should be able to get an exported string -assert.strictEqual(module.getString(module.COLOR), "red"); +assert.strictEqual(module.__getString(module.COLOR), "red"); // should be able to allocate and work with a new string -var str = "Hello world!𤭢"; -var ptr = module.newString(str); -assert.strictEqual(module.getString(ptr), str); -assert.strictEqual(module.strlen(ptr), str.length); +{ + let str = "Hello world!𤭢"; + let ref = module.__retain(module.__allocString(str)); + assert.strictEqual(module.__getString(ref), str); + assert.strictEqual(module.strlen(ref), str.length); + module.__release(ref); +} -// should be able to allocate a typed array and sum up its values -var arr = [1, 2, 3, 4, 5, 0x7fffffff]; -ptr = module.newArray(new Int32Array(arr)); -assert.strictEqual(module.sum(ptr), arr.reduce((a, b) => a + b, 0) | 0); +// should be able to allocate a typed array +{ + var arr = [1, 2, 3, 4, 5, 0x80000000 | 0]; + let ref = module.__retain(module.__allocArray(module.INT32ARRAY_ID, arr)); + assert(module.__instanceof(ref, module.INT32ARRAY_ID)); -// should be able to get a view on an internal typed array -assert.deepEqual(module.getArray(Int32Array, ptr), arr); + // should be able to get the values of an array + assert.deepEqual(module.__getArray(ref), arr); -// should be able to free and reuse the space of an internal typed array -module.freeArray(ptr); -var ptr2 = module.newArray(new Int32Array(arr)); -assert.strictEqual(ptr, ptr2); + // should be able to get a view on an array + assert.deepEqual(module.__getArrayView(ref), new Int32Array(arr)); -// should be able to just call a function with variable arguments + // should be able to sum up its values + assert.strictEqual(module.sum(ref), arr.reduce((a, b) => (a + b) | 0, 0) | 0); + + // should be able to release no longer needed references + module.__release(ref); + try { module.__release(ref); assert(false); } catch (e) {}; +} + +// should be able to distinguish between signed and unsigned +{ + let arr = [1, -1 >>> 0, 0x80000000]; + let ref = module.__retain(module.__allocArray(module.UINT32ARRAY_ID, arr)); + assert(module.__instanceof(ref, module.UINT32ARRAY_ID)); + assert.deepEqual(module.__getArray(ref), arr); + module.__release(ref); + try { module.__release(ref); assert(false); } catch (e) {}; +} + +// should be able to distinguish between integer and float +{ + let arr = [0.0, 1.5, 2.5]; + let ref = module.__retain(module.__allocArray(module.FLOAT32ARRAY_ID, arr)); + assert(module.__instanceof(ref, module.FLOAT32ARRAY_ID)); + assert.deepEqual(module.__getArray(ref), arr); + module.__release(ref); + try { module.__release(ref); assert(false); } catch (e) {}; +} + +// should be able to work with normal arrays +{ + let arr = [1, 2, 3, 4, 5]; + let ref = module.__retain(module.__allocArray(module.ARRAYI32_ID, arr)); + assert(module.__instanceof(ref, module.ARRAYI32_ID)); + module.changeLength(ref, 3); + assert.deepEqual(module.__getArray(ref), [1, 2, 3]); + module.__release(ref); + try { module.__release(ref); assert(false); } catch (e) {}; +} + +// should be able to correctly call a function with variable arguments assert.strictEqual(module.varadd(), 3); assert.strictEqual(module.varadd(2, 3), 5); assert.strictEqual(module.varadd(2), 4); +// TBD: table is no more exported by default to allow more optimizations + // should be able to get a function from the table and just call it with variable arguments -var fn = module.getFunction(module.varadd_ptr); -assert.strictEqual(fn(), 3); -assert.strictEqual(fn(2, 3), 5); -assert.strictEqual(fn(2), 4); +// var fn = module.getFunction(module.varadd_ref); +// assert.strictEqual(fn(), 3); +// assert.strictEqual(fn(2, 3), 5); +// assert.strictEqual(fn(2), 4); // should be able to create a new function and call it from WASM -ptr = module.newFunction(module.varadd); -assert.strictEqual(module.calladd(ptr, 2, 3), 5); +// ref = module.newFunction(module.varadd); +// assert.strictEqual(module.calladd(ref, 2, 3), 5); // should be able to use a class var car = new module.Car(5); @@ -68,6 +111,7 @@ car.openDoors(); assert.strictEqual(car.isDoorsOpen, 1); car.closeDoors(); assert.strictEqual(car.isDoorsOpen, 0); +module.__release(car); // uses Car.prototype.valueOf to obtain `thisPtr` // should be able to use trace -module.dotrace(42); \ No newline at end of file +module.dotrace(42); diff --git a/lib/parse/build/index.wat b/lib/parse/build/index.wat index 4955d09220..1d63582a92 100644 --- a/lib/parse/build/index.wat +++ b/lib/parse/build/index.wat @@ -29,36 +29,8 @@ (import "options" "onFunctionName" (func $assembly/options/onFunctionName (param i32 i32 i32))) (import "options" "onLocalName" (func $assembly/options/onLocalName (param i32 i32 i32 i32))) (import "options" "onSourceMappingURL" (func $assembly/options/onSourceMappingURL (param i32 i32))) - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $src/common/SectionId.Custom (mut i32) (i32.const 0)) - (global $src/common/SectionId.Type (mut i32) (i32.const 1)) - (global $src/common/SectionId.Import (mut i32) (i32.const 2)) - (global $src/common/SectionId.Function (mut i32) (i32.const 3)) - (global $src/common/SectionId.Table (mut i32) (i32.const 4)) - (global $src/common/SectionId.Memory (mut i32) (i32.const 5)) - (global $src/common/SectionId.Global (mut i32) (i32.const 6)) - (global $src/common/SectionId.Export (mut i32) (i32.const 7)) - (global $src/common/SectionId.Start (mut i32) (i32.const 8)) - (global $src/common/SectionId.Element (mut i32) (i32.const 9)) - (global $src/common/SectionId.Code (mut i32) (i32.const 10)) - (global $src/common/SectionId.Data (mut i32) (i32.const 11)) - (global $src/common/ExternalKind.Function (mut i32) (i32.const 0)) - (global $src/common/ExternalKind.Table (mut i32) (i32.const 1)) - (global $src/common/ExternalKind.Memory (mut i32) (i32.const 2)) - (global $src/common/ExternalKind.Global (mut i32) (i32.const 3)) - (global $src/common/NameType.Module (mut i32) (i32.const 0)) - (global $src/common/NameType.Function (mut i32) (i32.const 1)) - (global $src/common/NameType.Local (mut i32) (i32.const 2)) - (global $src/common/Opcode.end (mut i32) (i32.const 11)) - (global $src/common/Opcode.get_global (mut i32) (i32.const 35)) - (global $src/common/Opcode.i32_const (mut i32) (i32.const 65)) - (global $src/common/Opcode.i64_const (mut i32) (i32.const 66)) - (global $src/common/Opcode.f32_const (mut i32) (i32.const 67)) - (global $src/common/Opcode.f64_const (mut i32) (i32.const 68)) (global $assembly/index/off (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "parse" (func $assembly/index/parse)) (func $assembly/index/readVaruint (; 19 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) @@ -103,57 +75,51 @@ (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) global.get $assembly/index/off - local.set $2 + local.set $4 loop $continue|0 - local.get $2 - local.tee $4 + local.get $4 + local.tee $3 i32.const 1 i32.add - local.set $2 - local.get $4 + local.set $4 + local.get $3 i32.load8_u - local.tee $5 + local.tee $3 i32.const 127 i32.and local.get $1 i32.shl - local.get $3 + local.get $2 i32.or - local.set $3 + local.set $2 local.get $1 i32.const 7 i32.add local.set $1 - local.get $5 + local.get $3 i32.const 128 i32.and br_if $continue|0 end - local.get $2 + local.get $4 global.set $assembly/index/off i32.const -1 local.get $1 i32.shl - local.get $3 + local.get $2 i32.or - local.set $2 + local.get $2 + local.get $3 + i32.const 64 + i32.and + i32.const 0 + i32.ne + i32.const 0 local.get $1 local.get $0 i32.lt_u - local.tee $4 - if - local.get $5 - i32.const 64 - i32.and - i32.const 0 - i32.ne - local.set $4 - end - local.get $2 - local.get $3 - local.get $4 + select select ) (func $assembly/index/readVarint64 (; 21 ;) (type $FUNCSIG$v) @@ -211,24 +177,24 @@ block $case3|0 block $case2|0 block $case1|0 - global.get $src/common/Opcode.i32_const local.get $0 + i32.const 65 i32.ne if - global.get $src/common/Opcode.i64_const local.get $0 + i32.const 66 i32.eq br_if $case1|0 - global.get $src/common/Opcode.f32_const local.get $0 + i32.const 67 i32.eq br_if $case2|0 - global.get $src/common/Opcode.f64_const local.get $0 + i32.const 68 i32.eq br_if $case3|0 - global.get $src/common/Opcode.get_global local.get $0 + i32.const 35 i32.eq br_if $case4|0 br $case5|0 @@ -275,8 +241,8 @@ i32.const 1 i32.add global.set $assembly/index/off - global.get $src/common/Opcode.end local.get $0 + i32.const 11 i32.ne if unreachable @@ -301,12 +267,12 @@ global.get $assembly/index/off local.tee $0 i32.load - local.set $6 + local.set $2 local.get $0 i32.const 4 i32.add global.set $assembly/index/off - local.get $6 + local.get $2 i32.const 1836278016 i32.ne if @@ -315,60 +281,62 @@ global.get $assembly/index/off local.tee $0 i32.load - local.set $6 + local.set $2 local.get $0 i32.const 4 i32.add global.set $assembly/index/off - local.get $6 + local.get $2 i32.const 1 i32.ne if unreachable end + i32.const 0 + local.set $0 loop $continue|0 global.get $assembly/index/off local.get $1 i32.lt_u if call $assembly/index/readVaruint - local.set $2 + local.set $4 call $assembly/index/readVaruint - local.set $8 + local.set $3 i32.const 0 - local.set $4 + local.set $5 i32.const 0 - local.set $0 - local.get $2 + local.set $2 + local.get $4 if - local.get $2 - global.get $src/common/SectionId.Data + local.get $4 + i32.const 11 i32.gt_u if unreachable end else global.get $assembly/index/off - local.set $5 + local.set $6 call $assembly/index/readVaruint - local.tee $0 + local.tee $2 global.get $assembly/index/off - local.tee $4 + local.tee $5 i32.add global.set $assembly/index/off - local.get $8 + local.get $3 global.get $assembly/index/off - local.get $5 + local.get $6 i32.sub i32.sub - local.set $8 + local.set $3 end - local.get $2 - global.get $assembly/index/off - local.tee $5 - local.get $8 local.get $4 - local.get $0 + global.get $assembly/index/off + local.tee $6 + local.get $3 + local.get $5 + local.get $2 call $assembly/options/onSection if block $break|1 @@ -382,66 +350,30 @@ block $case3|1 block $case2|1 block $case1|1 - global.get $src/common/SectionId.Type - local.get $2 + local.get $4 + i32.const 1 i32.ne if - global.get $src/common/SectionId.Import - local.get $2 + local.get $4 + i32.const 2 i32.eq br_if $case1|1 - global.get $src/common/SectionId.Function - local.get $2 - i32.eq - br_if $case2|1 - global.get $src/common/SectionId.Table - local.get $2 - i32.eq - br_if $case3|1 - global.get $src/common/SectionId.Memory - local.get $2 - i32.eq - br_if $case4|1 - global.get $src/common/SectionId.Global - local.get $2 - i32.eq - br_if $case5|1 - global.get $src/common/SectionId.Export - local.get $2 - i32.eq - br_if $case6|1 - global.get $src/common/SectionId.Start - local.get $2 - i32.eq - br_if $case7|1 - global.get $src/common/SectionId.Custom - local.get $2 - i32.eq - br_if $case8|1 - global.get $src/common/SectionId.Element - local.get $2 - i32.eq - br_if $case11|1 - global.get $src/common/SectionId.Code - local.get $2 - i32.eq - br_if $case11|1 - global.get $src/common/SectionId.Data - local.get $2 - i32.eq - br_if $case11|1 + block $tablify|0 + local.get $4 + br_table $case8|1 $tablify|0 $tablify|0 $case2|1 $case3|1 $case4|1 $case5|1 $case6|1 $case7|1 $case11|1 $case11|1 $case11|1 $tablify|0 + end br $case12|1 end call $assembly/index/readVaruint - local.set $2 + local.set $4 i32.const 0 - local.set $3 + local.set $2 loop $repeat|2 - local.get $3 local.get $2 + local.get $4 i32.lt_u if - local.get $3 + local.get $2 i32.const 7 call $assembly/index/readVarint i32.const 127 @@ -450,126 +382,112 @@ call $assembly/index/readVaruint local.set $5 i32.const 0 - local.set $7 + local.set $3 loop $repeat|3 - local.get $7 + local.get $3 local.get $5 i32.lt_u if + local.get $2 local.get $3 - local.get $7 i32.const 7 call $assembly/index/readVarint i32.const 127 i32.and call $assembly/options/onTypeParam - local.get $7 + local.get $3 i32.const 1 i32.add - local.set $7 + local.set $3 br $repeat|3 end end call $assembly/index/readVaruint - local.set $7 + local.set $5 i32.const 0 - local.set $4 + local.set $3 loop $repeat|4 - local.get $4 - local.get $7 + local.get $3 + local.get $5 i32.lt_u if + local.get $2 local.get $3 - local.get $4 i32.const 7 call $assembly/index/readVarint i32.const 127 i32.and call $assembly/options/onTypeReturn - local.get $4 + local.get $3 i32.const 1 i32.add - local.set $4 + local.set $3 br $repeat|4 end end - local.get $3 + local.get $2 i32.const 1 i32.add - local.set $3 + local.set $2 br $repeat|2 end end br $break|1 end call $assembly/index/readVaruint - local.set $2 + local.set $7 i32.const 0 - local.set $3 + local.set $4 loop $repeat|5 - local.get $3 - local.get $2 + local.get $4 + local.get $7 i32.lt_u if call $assembly/index/readVaruint - local.set $7 - local.get $7 + local.tee $3 global.get $assembly/index/off local.tee $5 i32.add global.set $assembly/index/off call $assembly/index/readVaruint - local.set $9 - local.get $9 + local.tee $6 global.get $assembly/index/off - local.tee $4 + local.tee $8 i32.add global.set $assembly/index/off global.get $assembly/index/off - local.tee $6 + local.tee $9 i32.load8_u - local.set $0 - local.get $6 + local.set $2 + local.get $9 i32.const 1 i32.add global.set $assembly/index/off - local.get $3 - local.get $0 - local.get $5 - local.get $7 local.get $4 - local.get $9 + local.get $2 + local.get $5 + local.get $3 + local.get $8 + local.get $6 call $assembly/options/onImport block $break|6 block $case4|6 block $case3|6 block $case2|6 block $case1|6 - local.get $0 - local.tee $6 - global.get $src/common/ExternalKind.Function - i32.ne + local.get $2 if - global.get $src/common/ExternalKind.Table - local.get $6 - i32.eq - br_if $case1|6 - global.get $src/common/ExternalKind.Memory - local.get $6 - i32.eq - br_if $case2|6 - global.get $src/common/ExternalKind.Global - local.get $6 - i32.eq - br_if $case3|6 - br $case4|6 + local.get $2 + i32.const 1 + i32.sub + br_table $case1|6 $case2|6 $case3|6 $case4|6 end - local.get $11 - local.tee $10 + local.get $10 + local.tee $2 i32.const 1 i32.add - local.set $11 - local.get $10 + local.set $10 + local.get $2 call $assembly/index/readVaruint call $assembly/options/onFunctionImport br $break|6 @@ -578,18 +496,18 @@ call $assembly/index/readVarint i32.const 127 i32.and - local.set $6 + local.set $3 call $assembly/index/readVaruint - local.set $10 - local.get $12 - local.tee $0 + local.set $5 + local.get $0 + local.tee $2 i32.const 1 i32.add - local.set $12 - local.get $0 - local.get $6 + local.set $0 + local.get $2 + local.get $3 call $assembly/index/readVaruint - local.get $10 + local.get $5 i32.const 1 i32.and if (result i32) @@ -597,20 +515,20 @@ else i32.const -1 end - local.get $10 + local.get $5 call $assembly/options/onTableImport br $break|6 end call $assembly/index/readVaruint - local.set $8 - local.get $13 - local.tee $6 + local.set $3 + local.get $11 + local.tee $2 i32.const 1 i32.add - local.set $13 - local.get $6 + local.set $11 + local.get $2 call $assembly/index/readVaruint - local.get $8 + local.get $3 i32.const 1 i32.and if (result i32) @@ -618,16 +536,16 @@ else i32.const 65535 end - local.get $8 + local.get $3 call $assembly/options/onMemoryImport br $break|6 end - local.get $14 - local.tee $8 + local.get $12 + local.tee $2 i32.const 1 i32.add - local.set $14 - local.get $8 + local.set $12 + local.get $2 i32.const 7 call $assembly/index/readVarint i32.const 127 @@ -638,30 +556,30 @@ end unreachable end - local.get $3 + local.get $4 i32.const 1 i32.add - local.set $3 + local.set $4 br $repeat|5 end end br $break|1 end call $assembly/index/readVaruint - local.set $2 + local.set $4 i32.const 0 local.set $3 loop $repeat|7 local.get $3 - local.get $2 + local.get $4 i32.lt_u if - local.get $11 - local.tee $4 + local.get $10 + local.tee $2 i32.const 1 i32.add - local.set $11 - local.get $4 + local.set $10 + local.get $2 call $assembly/index/readVaruint call $assembly/options/onFunction local.get $3 @@ -674,29 +592,29 @@ br $break|1 end call $assembly/index/readVaruint - local.set $2 + local.set $7 i32.const 0 - local.set $3 + local.set $4 loop $repeat|8 - local.get $3 - local.get $2 + local.get $4 + local.get $7 i32.lt_u if call $assembly/index/readVaruint i32.const 127 i32.and - local.set $0 + local.set $3 call $assembly/index/readVaruint - local.set $4 - local.get $12 - local.tee $7 + local.set $5 + local.get $0 + local.tee $2 i32.const 1 i32.add - local.set $12 - local.get $7 - local.get $0 + local.set $0 + local.get $2 + local.get $3 call $assembly/index/readVaruint - local.get $4 + local.get $5 i32.const 1 i32.and if (result i32) @@ -704,36 +622,36 @@ else i32.const -1 end - local.get $4 + local.get $5 call $assembly/options/onTable - local.get $3 + local.get $4 i32.const 1 i32.add - local.set $3 + local.set $4 br $repeat|8 end end br $break|1 end call $assembly/index/readVaruint - local.set $2 + local.set $6 i32.const 0 local.set $3 loop $repeat|9 local.get $3 - local.get $2 + local.get $6 i32.lt_u if call $assembly/index/readVaruint - local.set $5 - local.get $13 - local.tee $0 + local.set $4 + local.get $11 + local.tee $2 i32.const 1 i32.add - local.set $13 - local.get $0 + local.set $11 + local.get $2 call $assembly/index/readVaruint - local.get $5 + local.get $4 i32.const 1 i32.and if (result i32) @@ -741,7 +659,7 @@ else i32.const 65535 end - local.get $5 + local.get $4 call $assembly/options/onMemory local.get $3 i32.const 1 @@ -753,30 +671,30 @@ br $break|1 end call $assembly/index/readVaruint - local.set $2 + local.set $4 i32.const 0 local.set $3 loop $repeat|10 local.get $3 - local.get $2 + local.get $4 i32.lt_u if i32.const 7 call $assembly/index/readVarint i32.const 127 i32.and - local.set $4 + local.set $5 call $assembly/index/readVaruint - local.set $9 + local.set $6 call $assembly/index/skipInitExpr - local.get $14 - local.tee $5 + local.get $12 + local.tee $2 i32.const 1 i32.add - local.set $14 + local.set $12 + local.get $2 local.get $5 - local.get $4 - local.get $9 + local.get $6 call $assembly/options/onGlobal local.get $3 i32.const 1 @@ -788,39 +706,38 @@ br $break|1 end call $assembly/index/readVaruint - local.set $2 - i32.const 0 local.set $3 + i32.const 0 + local.set $2 loop $repeat|11 - local.get $3 local.get $2 + local.get $3 i32.lt_u if call $assembly/index/readVaruint - local.set $9 - local.get $9 - global.get $assembly/index/off local.tee $4 + global.get $assembly/index/off + local.tee $5 i32.add global.set $assembly/index/off global.get $assembly/index/off - local.tee $0 + local.tee $6 i32.load8_u - local.set $6 - local.get $0 + local.set $7 + local.get $6 i32.const 1 i32.add global.set $assembly/index/off - local.get $3 - local.get $6 + local.get $2 + local.get $7 call $assembly/index/readVaruint + local.get $5 local.get $4 - local.get $9 call $assembly/options/onExport - local.get $3 + local.get $2 i32.const 1 i32.add - local.set $3 + local.set $2 br $repeat|11 end end @@ -830,126 +747,121 @@ call $assembly/options/onStart br $break|1 end - local.get $0 + local.get $2 i32.const 4 i32.eq - local.tee $2 if (result i32) - local.get $4 + local.get $5 i32.load i32.const 1701667182 i32.eq else - local.get $2 + i32.const 0 end if call $assembly/index/readVaruint local.set $2 call $assembly/index/readVaruint - local.set $3 + local.set $4 global.get $assembly/index/off - local.set $0 + local.set $5 block $break|12 block $case3|12 block $case2|12 block $case1|12 local.get $2 - local.tee $5 - global.get $src/common/NameType.Module - i32.ne if - global.get $src/common/NameType.Function - local.get $5 + local.get $2 + i32.const 1 i32.eq br_if $case1|12 - global.get $src/common/NameType.Local - local.get $5 + local.get $2 + i32.const 2 i32.eq br_if $case2|12 br $case3|12 end call $assembly/index/readVaruint - local.set $5 + local.set $2 global.get $assembly/index/off - local.get $5 + local.get $2 call $assembly/options/onModuleName br $break|12 end call $assembly/index/readVaruint - local.set $4 + local.set $2 i32.const 0 - local.set $5 + local.set $3 loop $repeat|13 - local.get $5 - local.get $4 + local.get $3 + local.get $2 i32.lt_u if call $assembly/index/readVaruint - local.set $9 + local.set $6 call $assembly/index/readVaruint - local.set $7 - local.get $7 + local.tee $7 global.get $assembly/index/off - local.tee $2 + local.tee $8 i32.add global.set $assembly/index/off - local.get $9 - local.get $2 + local.get $6 + local.get $8 local.get $7 call $assembly/options/onFunctionName - local.get $5 + local.get $3 i32.const 1 i32.add - local.set $5 + local.set $3 br $repeat|13 end end br $break|12 end call $assembly/index/readVaruint - local.set $4 + local.set $6 i32.const 0 - local.set $5 + local.set $2 loop $repeat|14 - local.get $5 - local.get $4 + local.get $2 + local.get $6 i32.lt_u if - call $assembly/index/readVaruint - local.set $2 call $assembly/index/readVaruint local.set $7 + call $assembly/index/readVaruint + local.set $8 i32.const 0 - local.set $9 + local.set $3 loop $repeat|15 - local.get $9 - local.get $7 + local.get $3 + local.get $8 i32.lt_u if call $assembly/index/readVaruint - local.set $10 + local.set $9 call $assembly/index/readVaruint - local.tee $8 + local.tee $13 global.get $assembly/index/off - local.tee $6 + local.tee $14 i32.add global.set $assembly/index/off - local.get $2 - local.get $10 - local.get $6 - local.get $8 - call $assembly/options/onLocalName + local.get $7 local.get $9 + local.get $14 + local.get $13 + call $assembly/options/onLocalName + local.get $3 i32.const 1 i32.add - local.set $9 + local.set $3 br $repeat|15 end end - local.get $5 + local.get $2 i32.const 1 i32.add - local.set $5 + local.set $2 br $repeat|14 end end @@ -957,56 +869,53 @@ end unreachable end - local.get $0 - local.get $3 + local.get $4 + local.get $5 i32.add global.set $assembly/index/off br $break|1 else - block (result i32) - local.get $0 - i32.const 16 - i32.eq - local.tee $0 - if - local.get $4 - i64.load - i64.const 7011371672682196851 - i64.eq - local.set $0 - end - local.get $0 + local.get $2 + i32.const 16 + i32.eq + if (result i32) + local.get $5 + i64.load + i64.const 7011371672682196851 + i64.eq + else + i32.const 0 end if (result i32) - local.get $4 + local.get $5 i32.const 8 i32.add i64.load i64.const 5499551997695193200 i64.eq else - local.get $0 + i32.const 0 end if call $assembly/index/readVaruint - local.tee $0 + local.tee $2 global.get $assembly/index/off - local.tee $3 + local.tee $4 i32.add global.set $assembly/index/off - local.get $3 - local.get $0 + local.get $4 + local.get $2 call $assembly/options/onSourceMappingURL end end - local.get $5 - local.get $8 + local.get $3 + local.get $6 i32.add global.set $assembly/index/off br $break|1 end global.get $assembly/index/off - local.get $8 + local.get $3 i32.add global.set $assembly/index/off br $break|1 @@ -1015,7 +924,7 @@ end else global.get $assembly/index/off - local.get $8 + local.get $3 i32.add global.set $assembly/index/off end diff --git a/lib/parse/index.js b/lib/parse/index.js index 9c6ea07603..79b2952d67 100644 --- a/lib/parse/index.js +++ b/lib/parse/index.js @@ -1,2 +1,2 @@ -!function(A,B){"object"==typeof exports&&"object"==typeof module?module.exports=B():"function"==typeof define&&define.amd?define([],B):"object"==typeof exports?exports.asparse=B():A.asparse=B()}("undefined"!=typeof self?self:this,function(){return function(A){var B={};function n(e){if(B[e])return B[e].exports;var o=B[e]={i:e,l:!1,exports:{}};return A[e].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=A,n.c=B,n.d=function(A,B,e){n.o(A,B)||Object.defineProperty(A,B,{enumerable:!0,get:e})},n.r=function(A){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})},n.t=function(A,B){if(1&B&&(A=n(A)),8&B)return A;if(4&B&&"object"==typeof A&&A&&A.__esModule)return A;var e=Object.create(null);if(n.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:A}),2&B&&"string"!=typeof A)for(var o in A)n.d(e,o,function(B){return A[B]}.bind(null,o));return e},n.n=function(A){var B=A&&A.__esModule?function(){return A.default}:function(){return A};return n.d(B,"a",B),B},n.o=function(A,B){return Object.prototype.hasOwnProperty.call(A,B)},n.p="",n(n.s=0)}([function(A,B,n){A.exports=n(1)},function(A,B,n){"use strict";B.__esModule=!0;var e=n(2);B.Type=e.Type,B.SectionId=e.SectionId,B.ExternalKind=e.ExternalKind;var o=null;B.parse=function A(B,n){n||(n={}),o||(o=new WebAssembly.Module(function(A){var B=A.length;if(B){for(var n=0,e=B;--e%4>1&&61===A.charCodeAt(e);)++n;B=Math.ceil(3*B)/4-n}for(var o=new Uint8Array(B),E=0,t=0,C=0,I=0,r=A.length;I1)break;if(void 0===(i=Q[i]))throw Error();switch(E){case 0:C=i,E=1;break;case 1:o[t++]=C<<2|(48&i)>>4,C=i,E=2;break;case 2:o[t++]=(15&C)<<4|(60&i)>>2,C=i,E=3;break;case 3:o[t++]=(3&C)<<6|i,E=0}}if(1===E)throw Error();return o}("AGFzbQEAAAABQQtgAn9/AGABfwF/YAV/f39/fwF/YAN/f38AYAZ/f39/f38AYAV/f39/fwBgBH9/f38AYAAAYAABfmABfwBgAAF/Aq4DFAdvcHRpb25zCW9uU2VjdGlvbgACB29wdGlvbnMGb25UeXBlAAAHb3B0aW9ucwtvblR5cGVQYXJhbQADB29wdGlvbnMMb25UeXBlUmV0dXJuAAMHb3B0aW9ucwhvbkltcG9ydAAEB29wdGlvbnMQb25GdW5jdGlvbkltcG9ydAAAB29wdGlvbnMNb25UYWJsZUltcG9ydAAFB29wdGlvbnMOb25NZW1vcnlJbXBvcnQABgdvcHRpb25zDm9uR2xvYmFsSW1wb3J0AAMHb3B0aW9ucwpvbkZ1bmN0aW9uAAAHb3B0aW9ucwdvblRhYmxlAAUHb3B0aW9ucwhvbk1lbW9yeQAGB29wdGlvbnMIb25HbG9iYWwAAwdvcHRpb25zCG9uRXhwb3J0AAUHb3B0aW9ucwdvblN0YXJ0AAkHb3B0aW9ucwxvbk1vZHVsZU5hbWUAAAdvcHRpb25zDm9uRnVuY3Rpb25OYW1lAAMHb3B0aW9ucwtvbkxvY2FsTmFtZQAGB29wdGlvbnMSb25Tb3VyY2VNYXBwaW5nVVJMAAADZW52Bm1lbW9yeQIAAAMHBgoBCAcABwQEAXAAAQaHARp/AUEAC38BQQALfwFBAQt/AUECC38BQQMLfwFBBAt/AUEFC38BQQYLfwFBBwt/AUEIC38BQQkLfwFBCgt/AUELC38BQQALfwFBAQt/AUECC38BQQMLfwFBCwt/AUEjC38BQcEAC38BQcIAC38BQcMAC38BQcQAC38BQQALfwFBAQt/AUECCwcaAwZtZW1vcnkCAAV0YWJsZQEABXBhcnNlABcJBwEAQQALARgK5w0GPwEEfyMAIQADQCAAI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KQMAQvDgpfP2rJWpzABRBSAACwRAEBMiACMAIgNqJAAgAyAAEBILCyAFIAhqJAAMAgsjACAIaiQADAELAAsFIwAgCGokAAsMAQsLIwAgAUcEQAALCwMAAQsAIBBzb3VyY2VNYXBwaW5nVVJMDmluZGV4Lndhc20ubWFw")));var e=B.length,E=(e+65535&-65536)>>16,t=new WebAssembly.Memory({initial:E}),C=new Uint8Array(t.buffer);C.set(B),A.readString=function(A,B){return function(A,B,n){if(n-B<1)return"";for(var e=null,o=[],Q=0,E=0;B191&&E<224?o[Q++]=(31&E)<<6|63&A[B++]:E>239&&E<365?(E=((7&E)<<18|(63&A[B++])<<12|(63&A[B++])<<6|63&A[B++])-65536,o[Q++]=55296+(E>>10),o[Q++]=56320+(1023&E)):o[Q++]=(15&E)<<12|(63&A[B++])<<6|63&A[B++],Q>8191&&((e||(e=[])).push(String.fromCharCode.apply(String,o)),Q=0);return e?(Q&&e.push(String.fromCharCode.apply(String,o.slice(0,Q))),e.join("")):String.fromCharCode.apply(String,o.slice(0,Q))}(C,A,A+B)};var I={env:{memory:t},options:{}};["onSection","onType","onTypeParam","onTypeReturn","onImport","onFunctionImport","onTableImport","onMemoryImport","onGlobalImport","onMemory","onFunction","onTable","onGlobal","onExport","onStart","onSourceMappingURL","onModuleName","onFunctionName","onLocalName"].forEach(function(A){return I.options[A]=n[A]||function(){}}),new WebAssembly.Instance(o,I).exports.parse(0,e)};for(var Q=new Array(123),E=0;E<64;)Q[E<26?E+65:E<52?E+71:E<62?E-4:E-59|43]=E++},function(A,B,n){"use strict";B.__esModule=!0,function(A){A[A.i32=127]="i32",A[A.i64=126]="i64",A[A.f32=125]="f32",A[A.f64=124]="f64",A[A.anyfunc=112]="anyfunc",A[A.func=96]="func",A[A.none=64]="none"}(B.Type||(B.Type={})),function(A){A[A.Custom=0]="Custom",A[A.Type=1]="Type",A[A.Import=2]="Import",A[A.Function=3]="Function",A[A.Table=4]="Table",A[A.Memory=5]="Memory",A[A.Global=6]="Global",A[A.Export=7]="Export",A[A.Start=8]="Start",A[A.Element=9]="Element",A[A.Code=10]="Code",A[A.Data=11]="Data"}(B.SectionId||(B.SectionId={})),function(A){A[A.Function=0]="Function",A[A.Table=1]="Table",A[A.Memory=2]="Memory",A[A.Global=3]="Global"}(B.ExternalKind||(B.ExternalKind={})),function(A){A[A.Module=0]="Module",A[A.Function=1]="Function",A[A.Local=2]="Local"}(B.NameType||(B.NameType={})),B.MAX_PAGES=65535,B.MAX_ELEMS=4294967295,function(A){A[A.end=11]="end",A[A.get_global=35]="get_global",A[A.i32_const=65]="i32_const",A[A.i64_const=66]="i64_const",A[A.f32_const=67]="f32_const",A[A.f64_const=68]="f64_const"}(B.Opcode||(B.Opcode={}))}])}); +!function(A,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.asparse=e():A.asparse=e()}("undefined"!=typeof self?self:this,function(){return function(A){var e={};function n(o){if(e[o])return e[o].exports;var Q=e[o]={i:o,l:!1,exports:{}};return A[o].call(Q.exports,Q,Q.exports,n),Q.l=!0,Q.exports}return n.m=A,n.c=e,n.d=function(A,e,o){n.o(A,e)||Object.defineProperty(A,e,{enumerable:!0,get:o})},n.r=function(A){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})},n.t=function(A,e){if(1&e&&(A=n(A)),8&e)return A;if(4&e&&"object"==typeof A&&A&&A.__esModule)return A;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:A}),2&e&&"string"!=typeof A)for(var Q in A)n.d(o,Q,function(e){return A[e]}.bind(null,Q));return o},n.n=function(A){var e=A&&A.__esModule?function(){return A.default}:function(){return A};return n.d(e,"a",e),e},n.o=function(A,e){return Object.prototype.hasOwnProperty.call(A,e)},n.p="",n(n.s=0)}([function(A,e,n){A.exports=n(1)},function(A,e,n){"use strict";e.__esModule=!0;var o=n(2);e.Type=o.Type,e.SectionId=o.SectionId,e.ExternalKind=o.ExternalKind;var Q=null;e.parse=function A(e,n){n||(n={}),Q||(Q=new WebAssembly.Module(function(A){var e=A.length;if(e){for(var n=0,o=e;--o%4>1&&61===A.charCodeAt(o);)++n;e=Math.ceil(3*e)/4-n}for(var Q=new Uint8Array(e),B=0,I=0,E=0,r=0,i=A.length;r1)break;if(void 0===(C=t[C]))throw Error();switch(B){case 0:E=C,B=1;break;case 1:Q[I++]=E<<2|(48&C)>>4,E=C,B=2;break;case 2:Q[I++]=(15&E)<<4|(60&C)>>2,E=C,B=3;break;case 3:Q[I++]=(3&E)<<6|C,B=0}}if(1===B)throw Error();return Q}("AGFzbQEAAAABPQpgAn9/AGABfwF/YAV/f39/fwF/YAN/f38AYAZ/f39/f38AYAV/f39/fwBgBH9/f38AYAAAYAF/AGAAAX8CrgMUB29wdGlvbnMJb25TZWN0aW9uAAIHb3B0aW9ucwZvblR5cGUAAAdvcHRpb25zC29uVHlwZVBhcmFtAAMHb3B0aW9ucwxvblR5cGVSZXR1cm4AAwdvcHRpb25zCG9uSW1wb3J0AAQHb3B0aW9ucxBvbkZ1bmN0aW9uSW1wb3J0AAAHb3B0aW9ucw1vblRhYmxlSW1wb3J0AAUHb3B0aW9ucw5vbk1lbW9yeUltcG9ydAAGB29wdGlvbnMOb25HbG9iYWxJbXBvcnQAAwdvcHRpb25zCm9uRnVuY3Rpb24AAAdvcHRpb25zB29uVGFibGUABQdvcHRpb25zCG9uTWVtb3J5AAYHb3B0aW9ucwhvbkdsb2JhbAADB29wdGlvbnMIb25FeHBvcnQABQdvcHRpb25zB29uU3RhcnQACAdvcHRpb25zDG9uTW9kdWxlTmFtZQAAB29wdGlvbnMOb25GdW5jdGlvbk5hbWUAAwdvcHRpb25zC29uTG9jYWxOYW1lAAYHb3B0aW9ucxJvblNvdXJjZU1hcHBpbmdVUkwAAANlbnYGbWVtb3J5AgAAAwcGCQEHBwAHBgYBfwFBAAsHEgIGbWVtb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VSTA5pbmRleC53YXNtLm1hcA==")));var o=e.length,B=(o+65535&-65536)>>16,I=new WebAssembly.Memory({initial:B}),E=new Uint8Array(I.buffer);E.set(e),A.readString=function(A,e){return function(A,e,n){if(n-e<1)return"";for(var o=null,Q=[],t=0,B=0;e191&&B<224?Q[t++]=(31&B)<<6|63&A[e++]:B>239&&B<365?(B=((7&B)<<18|(63&A[e++])<<12|(63&A[e++])<<6|63&A[e++])-65536,Q[t++]=55296+(B>>10),Q[t++]=56320+(1023&B)):Q[t++]=(15&B)<<12|(63&A[e++])<<6|63&A[e++],t>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,Q)),t=0);return o?(t&&o.push(String.fromCharCode.apply(String,Q.slice(0,t))),o.join("")):String.fromCharCode.apply(String,Q.slice(0,t))}(E,A,A+e)};var r={env:{memory:I},options:{}};["onSection","onType","onTypeParam","onTypeReturn","onImport","onFunctionImport","onTableImport","onMemoryImport","onGlobalImport","onMemory","onFunction","onTable","onGlobal","onExport","onStart","onSourceMappingURL","onModuleName","onFunctionName","onLocalName"].forEach(function(A){return r.options[A]=n[A]||function(){}}),new WebAssembly.Instance(Q,r).exports.parse(0,o)};for(var t=new Array(123),B=0;B<64;)t[B<26?B+65:B<52?B+71:B<62?B-4:B-59|43]=B++},function(A,e,n){"use strict";e.__esModule=!0,function(A){A[A.i32=127]="i32",A[A.i64=126]="i64",A[A.f32=125]="f32",A[A.f64=124]="f64",A[A.anyfunc=112]="anyfunc",A[A.func=96]="func",A[A.none=64]="none"}(e.Type||(e.Type={})),function(A){A[A.Custom=0]="Custom",A[A.Type=1]="Type",A[A.Import=2]="Import",A[A.Function=3]="Function",A[A.Table=4]="Table",A[A.Memory=5]="Memory",A[A.Global=6]="Global",A[A.Export=7]="Export",A[A.Start=8]="Start",A[A.Element=9]="Element",A[A.Code=10]="Code",A[A.Data=11]="Data"}(e.SectionId||(e.SectionId={})),function(A){A[A.Function=0]="Function",A[A.Table=1]="Table",A[A.Memory=2]="Memory",A[A.Global=3]="Global"}(e.ExternalKind||(e.ExternalKind={})),function(A){A[A.Module=0]="Module",A[A.Function=1]="Function",A[A.Local=2]="Local"}(e.NameType||(e.NameType={})),e.MAX_PAGES=65535,e.MAX_ELEMS=4294967295,function(A){A[A.end=11]="end",A[A.get_global=35]="get_global",A[A.i32_const=65]="i32_const",A[A.i64_const=66]="i64_const",A[A.f32_const=67]="f32_const",A[A.f64_const=68]="f64_const"}(e.Opcode||(e.Opcode={}))}])}); //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/parse/index.js.map b/lib/parse/index.js.map index 174cbb9804..0253c777cb 100644 --- a/lib/parse/index.js.map +++ b/lib/parse/index.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://asparse/webpack/universalModuleDefinition","webpack://asparse/webpack/bootstrap","webpack://asparse/./src/index.ts","webpack://asparse/./src/common.ts"],"names":["root","factory","exports","module","define","amd","self","this","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","common_1","Type","SectionId","ExternalKind","compiled","parse","binary","options","WebAssembly","Module","string","length","charCodeAt","Math","ceil","buffer","Uint8Array","j","k","undefined","s64","Error","base64_decode","nBytes","nPages","memory","Memory","initial","set","readString","offset","start","end","parts","chunk","push","String","fromCharCode","apply","slice","join","utf8_read","imports","env","forEach","Instance","Array","NameType","MAX_PAGES","MAX_ELEMS","Opcode"],"mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,eAAAC,IACAD,UAAAH,GACA,iBAAAC,QACAA,QAAA,QAAAD,IAEAD,EAAA,QAAAC,IARA,CASC,oBAAAK,UAAAC,KAAA,WACD,mBCTA,IAAAC,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAR,QAGA,IAAAC,E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YAAA,EAGA,SAAAa,GACAA,IAAA,eACAA,IAAA,eACAA,IAAA,eACAA,IAAA,eACAA,IAAA,uBACAA,IAAA,gBACAA,IAAA,gBAPA,CAQC1C,EAAA0C,OAAA1C,EAAA0C,UAGD,SAAAC,GACAA,IAAA,mBACAA,IAAA,eACAA,IAAA,mBACAA,IAAA,uBACAA,IAAA,iBACAA,IAAA,mBACAA,IAAA,mBACAA,IAAA,mBACAA,IAAA,iBACAA,IAAA,qBACAA,IAAA,gBACAA,IAAA,gBAZA,CAaC3C,EAAA2C,YAAA3C,EAAA2C,eAGD,SAAAC,GACAA,IAAA,uBACAA,IAAA,iBACAA,IAAA,mBACAA,IAAA,mBAJA,CAKC5C,EAAA4C,eAAA5C,EAAA4C,kBAGD,SAAA4C,GACAA,IAAA,mBACAA,IAAA,uBACAA,IAAA,iBAHA,CAICxF,EAAAwF,WAAAxF,EAAAwF,cAEDxF,EAAAyF,UAAA,MAEAzF,EAAA0F,UAAA,WAGA,SAAAC,GAOAA,IAAA,cAYAA,IAAA,4BA2BAA,IAAA,0BACAA,IAAA,0BACAA,IAAA,0BACAA,IAAA,0BAjDA,CA6KC3F,EAAA2F,SAAA3F,EAAA2F","file":"index.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"asparse\"] = factory();\n\telse\n\t\troot[\"asparse\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","\"use strict\";\r\nexports.__esModule = true;\r\nvar common_1 = require(\"./common\");\r\nexports.Type = common_1.Type;\r\nexports.SectionId = common_1.SectionId;\r\nexports.ExternalKind = common_1.ExternalKind;\r\n/** Cached compiled parser. */\r\nvar compiled = null;\r\nif (typeof WASM_DATA !== \"string\")\r\n WASM_DATA = require(\"fs\").readFileSync(__dirname + \"/../build/index.wasm\", \"base64\");\r\n/** Parses the contents of a WebAssembly binary according to the specified options. */\r\nfunction parse(binary, options) {\r\n if (!options)\r\n options = {};\r\n // compile the parser if not yet compiled\r\n if (!compiled)\r\n compiled = new WebAssembly.Module(base64_decode(WASM_DATA));\r\n // use the binary as the parser's memory\r\n var nBytes = binary.length;\r\n var nPages = ((nBytes + 0xffff) & ~0xffff) >> 16;\r\n var memory = new WebAssembly.Memory({ initial: nPages });\r\n var buffer = new Uint8Array(memory.buffer);\r\n buffer.set(binary);\r\n // provide a way to read strings from memory\r\n parse.readString = function (offset, length) { return utf8_read(buffer, offset, offset + length); };\r\n // instantiate the parser and return its exports\r\n var imports = {\r\n env: {\r\n memory: memory\r\n },\r\n options: {}\r\n };\r\n [\"onSection\",\r\n \"onType\",\r\n \"onTypeParam\",\r\n \"onTypeReturn\",\r\n \"onImport\",\r\n \"onFunctionImport\",\r\n \"onTableImport\",\r\n \"onMemoryImport\",\r\n \"onGlobalImport\",\r\n \"onMemory\",\r\n \"onFunction\",\r\n \"onTable\",\r\n \"onGlobal\",\r\n \"onExport\",\r\n \"onStart\",\r\n \"onSourceMappingURL\",\r\n \"onModuleName\",\r\n \"onFunctionName\",\r\n \"onLocalName\"\r\n ].forEach(function (name) { return imports.options[name] = options[name] || function () { }; });\r\n var instance = new WebAssembly.Instance(compiled, imports);\r\n instance.exports.parse(0, nBytes);\r\n}\r\nexports.parse = parse;\r\n// see: https://github.com/dcodeIO/protobuf.js/tree/master/lib/utf8\r\nfunction utf8_read(buffer, start, end) {\r\n var len = end - start;\r\n if (len < 1)\r\n return \"\";\r\n var parts = null, chunk = [], i = 0, // char offset\r\n t = 0; // temporary\r\n while (start < end) {\r\n t = buffer[start++];\r\n if (t < 128) {\r\n chunk[i++] = t;\r\n }\r\n else if (t > 191 && t < 224) {\r\n chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;\r\n }\r\n else if (t > 239 && t < 365) {\r\n t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;\r\n chunk[i++] = 0xD800 + (t >> 10);\r\n chunk[i++] = 0xDC00 + (t & 1023);\r\n }\r\n else {\r\n chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;\r\n }\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n}\r\n// see: https://github.com/dcodeIO/protobuf.js/tree/master/lib/base64\r\nfunction base64_decode(string) {\r\n var length = string.length;\r\n if (length) {\r\n var n = 0, p = length;\r\n while (--p % 4 > 1 && string.charCodeAt(p) === 61)\r\n ++n;\r\n length = Math.ceil(length * 3) / 4 - n;\r\n }\r\n var buffer = new Uint8Array(length);\r\n var j = 0, o = 0, t = 0;\r\n for (var i = 0, k = string.length; i < k;) {\r\n var c = string.charCodeAt(i++);\r\n if (c === 61 && j > 1)\r\n break;\r\n if ((c = s64[c]) === undefined)\r\n throw Error();\r\n switch (j) {\r\n case 0: {\r\n t = c;\r\n j = 1;\r\n break;\r\n }\r\n case 1: {\r\n buffer[o++] = t << 2 | (c & 48) >> 4;\r\n t = c;\r\n j = 2;\r\n break;\r\n }\r\n case 2: {\r\n buffer[o++] = (t & 15) << 4 | (c & 60) >> 2;\r\n t = c;\r\n j = 3;\r\n break;\r\n }\r\n case 3: {\r\n buffer[o++] = (t & 3) << 6 | c;\r\n j = 0;\r\n break;\r\n }\r\n }\r\n }\r\n if (j === 1)\r\n throw Error();\r\n return buffer;\r\n}\r\nvar s64 = new Array(123);\r\nfor (var i = 0; i < 64;)\r\n s64[i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;\r\n","\"use strict\";\r\n/** Common constants shared between AssemblyScript and TypeScript. */\r\nexports.__esModule = true;\r\n/** WebAssembly types. */\r\nvar Type;\r\n(function (Type) {\r\n Type[Type[\"i32\"] = 127] = \"i32\";\r\n Type[Type[\"i64\"] = 126] = \"i64\";\r\n Type[Type[\"f32\"] = 125] = \"f32\";\r\n Type[Type[\"f64\"] = 124] = \"f64\";\r\n Type[Type[\"anyfunc\"] = 112] = \"anyfunc\";\r\n Type[Type[\"func\"] = 96] = \"func\";\r\n Type[Type[\"none\"] = 64] = \"none\";\r\n})(Type = exports.Type || (exports.Type = {}));\r\n/** WebAssembly section ids. */\r\nvar SectionId;\r\n(function (SectionId) {\r\n SectionId[SectionId[\"Custom\"] = 0] = \"Custom\";\r\n SectionId[SectionId[\"Type\"] = 1] = \"Type\";\r\n SectionId[SectionId[\"Import\"] = 2] = \"Import\";\r\n SectionId[SectionId[\"Function\"] = 3] = \"Function\";\r\n SectionId[SectionId[\"Table\"] = 4] = \"Table\";\r\n SectionId[SectionId[\"Memory\"] = 5] = \"Memory\";\r\n SectionId[SectionId[\"Global\"] = 6] = \"Global\";\r\n SectionId[SectionId[\"Export\"] = 7] = \"Export\";\r\n SectionId[SectionId[\"Start\"] = 8] = \"Start\";\r\n SectionId[SectionId[\"Element\"] = 9] = \"Element\";\r\n SectionId[SectionId[\"Code\"] = 10] = \"Code\";\r\n SectionId[SectionId[\"Data\"] = 11] = \"Data\";\r\n})(SectionId = exports.SectionId || (exports.SectionId = {}));\r\n/** WebAssembly external kinds. */\r\nvar ExternalKind;\r\n(function (ExternalKind) {\r\n ExternalKind[ExternalKind[\"Function\"] = 0] = \"Function\";\r\n ExternalKind[ExternalKind[\"Table\"] = 1] = \"Table\";\r\n ExternalKind[ExternalKind[\"Memory\"] = 2] = \"Memory\";\r\n ExternalKind[ExternalKind[\"Global\"] = 3] = \"Global\";\r\n})(ExternalKind = exports.ExternalKind || (exports.ExternalKind = {}));\r\n/** Name section types. */\r\nvar NameType;\r\n(function (NameType) {\r\n NameType[NameType[\"Module\"] = 0] = \"Module\";\r\n NameType[NameType[\"Function\"] = 1] = \"Function\";\r\n NameType[NameType[\"Local\"] = 2] = \"Local\";\r\n})(NameType = exports.NameType || (exports.NameType = {}));\r\n/** Maximum number of memory pages. */\r\nexports.MAX_PAGES = 0xffff;\r\n/** Maximum number of table elements. */\r\nexports.MAX_ELEMS = 0xffffffff;\r\n/** WebAssembly opcodes. */\r\nvar Opcode;\r\n(function (Opcode) {\r\n // unreachable = 0x00,\r\n // nop = 0x01,\r\n // block = 0x02,\r\n // loop = 0x03,\r\n // if_ = 0x04,\r\n // else_ = 0x05,\r\n Opcode[Opcode[\"end\"] = 11] = \"end\";\r\n // br = 0x0c,\r\n // br_if = 0x0d,\r\n // br_table = 0x0e,\r\n // return_ = 0x0f,\r\n // call = 0x10,\r\n // call_indirect = 0x11,\r\n // drop = 0x1a,\r\n // select = 0x1b,\r\n // get_local = 0x20,\r\n // set_local = 0x21,\r\n // tee_local = 0x22,\r\n Opcode[Opcode[\"get_global\"] = 35] = \"get_global\";\r\n // set_global = 0x24,\r\n // i32_load = 0x28,\r\n // i64_load = 0x29,\r\n // f32_load = 0x2a,\r\n // f64_load = 0x2b,\r\n // i32_load8_s = 0x2c,\r\n // i32_load8_u = 0x2d,\r\n // i32_load16_s = 0x2e,\r\n // i32_load16_u = 0x2f,\r\n // i64_load8_s = 0x30,\r\n // i64_load8_u = 0x31,\r\n // i64_load16_s = 0x32,\r\n // i64_load16_u = 0x33,\r\n // i64_load32_s = 0x34,\r\n // i64_load32_u = 0x35,\r\n // i32_store = 0x36,\r\n // i64_store = 0x37,\r\n // f32_store = 0x38,\r\n // f64_store = 0x39,\r\n // i32_store8 = 0x3a,\r\n // i32_store16 = 0x3b,\r\n // i64_store8 = 0x3c,\r\n // i64_store16 = 0x3d,\r\n // i64_store32 = 0x3e,\r\n // current_memory = 0x3f,\r\n // grow_memory = 0x40,\r\n Opcode[Opcode[\"i32_const\"] = 65] = \"i32_const\";\r\n Opcode[Opcode[\"i64_const\"] = 66] = \"i64_const\";\r\n Opcode[Opcode[\"f32_const\"] = 67] = \"f32_const\";\r\n Opcode[Opcode[\"f64_const\"] = 68] = \"f64_const\";\r\n // i32_eqz = 0x45,\r\n // i32_eq = 0x46,\r\n // i32_ne = 0x47,\r\n // i32_lt_s = 0x48,\r\n // i32_lt_u = 0x49,\r\n // i32_gt_s = 0x4a,\r\n // i32_gt_u = 0x4b,\r\n // i32_le_s = 0x4c,\r\n // i32_le_u = 0x4d,\r\n // i32_ge_s = 0x4e,\r\n // i32_ge_u = 0x4f,\r\n // i64_eqz = 0x50,\r\n // i64_eq = 0x51,\r\n // i64_ne = 0x52,\r\n // i64_lt_s = 0x53,\r\n // i64_lt_u = 0x54,\r\n // i64_gt_s = 0x55,\r\n // i64_gt_u = 0x56,\r\n // i64_le_s = 0x57,\r\n // i64_le_u = 0x58,\r\n // i64_ge_s = 0x59,\r\n // i64_ge_u = 0x5a,\r\n // f32_eq = 0x5b,\r\n // f32_ne = 0x5c,\r\n // f32_lt = 0x5d,\r\n // f32_gt = 0x5e,\r\n // f32_le = 0x5f,\r\n // f32_ge = 0x60,\r\n // f64_eq = 0x61,\r\n // f64_ne = 0x62,\r\n // f64_lt = 0x63,\r\n // f64_gt = 0x64,\r\n // f64_le = 0x65,\r\n // f64_ge = 0x66,\r\n // i32_clz = 0x67,\r\n // i32_ctz = 0x68,\r\n // i32_popcnt = 0x69,\r\n // i32_add = 0x6a,\r\n // i32_sub = 0x6b,\r\n // i32_mul = 0x6c,\r\n // i32_div_s = 0x6d,\r\n // i32_div_u = 0x6e,\r\n // i32_rem_s = 0x6f,\r\n // i32_rem_u = 0x70,\r\n // i32_and = 0x71,\r\n // i32_or = 0x72,\r\n // i32_xor = 0x73,\r\n // i32_shl = 0x74,\r\n // i32_shr_s = 0x75,\r\n // i32_shr_u = 0x76,\r\n // i32_rotl = 0x77,\r\n // i32_rotr = 0x78,\r\n // i64_clz = 0x79,\r\n // i64_ctz = 0x7a,\r\n // i64_popcnt = 0x7b,\r\n // i64_add = 0x7c,\r\n // i64_sub = 0x7d,\r\n // i64_mul = 0x7e,\r\n // i64_div_s = 0x7f,\r\n // i64_div_u = 0x80,\r\n // i64_rem_s = 0x81,\r\n // i64_rem_u = 0x82,\r\n // i64_and = 0x83,\r\n // i64_or = 0x84,\r\n // i64_xor = 0x85,\r\n // i64_shl = 0x86,\r\n // i64_shr_s = 0x87,\r\n // i64_shr_u = 0x88,\r\n // i64_rotl = 0x89,\r\n // i64_rotr = 0x8a,\r\n // f32_abs = 0x8b,\r\n // f32_neg = 0x8c,\r\n // f32_ceil = 0x8d,\r\n // f32_floor = 0x8e,\r\n // f32_trunc = 0x8f,\r\n // f32_nearest = 0x90,\r\n // f32_sqrt = 0x91,\r\n // f32_add = 0x92,\r\n // f32_sub = 0x93,\r\n // f32_mul = 0x94,\r\n // f32_div = 0x95,\r\n // f32_min = 0x96,\r\n // f32_max = 0x97,\r\n // f32_copysign = 0x98,\r\n // f64_abs = 0x99,\r\n // f64_neg = 0x9a,\r\n // f64_ceil = 0x9b,\r\n // f64_floor = 0x9c,\r\n // f64_trunc = 0x9d,\r\n // f64_nearest = 0x9e,\r\n // f64_sqrt = 0x9f,\r\n // f64_add = 0xa0,\r\n // f64_sub = 0xa1,\r\n // f64_mul = 0xa2,\r\n // f64_div = 0xa3,\r\n // f64_min = 0xa4,\r\n // f64_max = 0xa5,\r\n // f64_copysign = 0xa6,\r\n // i32_wrap_i64 = 0xa7,\r\n // i32_trunc_s_f32 = 0xa8,\r\n // i32_trunc_u_f32 = 0xa9,\r\n // i32_trunc_s_f64 = 0xaa,\r\n // i32_trunc_u_f64 = 0xab,\r\n // i64_extend_s_i32 = 0xac,\r\n // i64_extend_u_i32 = 0xad,\r\n // i64_trunc_s_f32 = 0xae,\r\n // i64_trunc_u_f32 = 0xaf,\r\n // i64_trunc_s_f64 = 0xb0,\r\n // i64_trunc_u_f64 = 0xb1,\r\n // f32_convert_s_i32 = 0xb2,\r\n // f32_convert_u_i32 = 0xb3,\r\n // f32_convert_s_i64 = 0xb4,\r\n // f32_convert_u_i64 = 0xb5,\r\n // f32_demote_f64 = 0xb6,\r\n // f64_convert_s_i32 = 0xb7,\r\n // f64_convert_u_i32 = 0xb8,\r\n // f64_convert_s_i64 = 0xb9,\r\n // f64_convert_u_i64 = 0xba,\r\n // f64_promote_f32 = 0xbb,\r\n // i32_reinterpret_f32 = 0xbc,\r\n // i64_reinterpret_f64 = 0xbd,\r\n // f32_reinterpret_i32 = 0xbe,\r\n // f64_reinterpret_i64 = 0xbf\r\n})(Opcode = exports.Opcode || (exports.Opcode = {}));\r\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://asparse/webpack/universalModuleDefinition","webpack://asparse/webpack/bootstrap","webpack://asparse/./src/index.ts","webpack://asparse/./src/common.ts"],"names":["root","factory","exports","module","define","amd","self","this","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","common_1","Type","SectionId","ExternalKind","compiled","parse","binary","options","WebAssembly","Module","string","length","charCodeAt","Math","ceil","buffer","Uint8Array","j","k","undefined","s64","Error","base64_decode","nBytes","nPages","memory","Memory","initial","set","readString","offset","start","end","parts","chunk","push","String","fromCharCode","apply","slice","join","utf8_read","imports","env","forEach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,eACAqC,QAAA,SAAArE,GAA+B,OAAAmE,EAAAnC,QAAAhC,GAAAgC,EAAAhC,IAAA,eAC/B,IAAAiC,YAAAqC,SAAAzC,EAAAsC,GACAnF,QAAA8C,MAAA,EAAAkB,IAqFA,IADA,IAAAH,EAAA,IAAA0B,MAAA,KACA9E,EAAA,EAAeA,EAAA,IACfoD,EAAApD,EAAA,GAAAA,EAAA,GAAAA,EAAA,GAAAA,EAAA,GAAAA,EAAA,GAAAA,EAAA,EAAAA,EAAA,OAAAA,kCCzIAT,EAAA6B,YAAA,EAGA,SAAAa,GACAA,IAAA,eACAA,IAAA,eACAA,IAAA,eACAA,IAAA,eACAA,IAAA,uBACAA,IAAA,gBACAA,IAAA,gBAPA,CAQC1C,EAAA0C,OAAA1C,EAAA0C,UAGD,SAAAC,GACAA,IAAA,mBACAA,IAAA,eACAA,IAAA,mBACAA,IAAA,uBACAA,IAAA,iBACAA,IAAA,mBACAA,IAAA,mBACAA,IAAA,mBACAA,IAAA,iBACAA,IAAA,qBACAA,IAAA,gBACAA,IAAA,gBAZA,CAaC3C,EAAA2C,YAAA3C,EAAA2C,eAGD,SAAAC,GACAA,IAAA,uBACAA,IAAA,iBACAA,IAAA,mBACAA,IAAA,mBAJA,CAKC5C,EAAA4C,eAAA5C,EAAA4C,kBAGD,SAAA4C,GACAA,IAAA,mBACAA,IAAA,uBACAA,IAAA,iBAHA,CAICxF,EAAAwF,WAAAxF,EAAAwF,cAEDxF,EAAAyF,UAAA,MAEAzF,EAAA0F,UAAA,WAGA,SAAAC,GAOAA,IAAA,cAYAA,IAAA,4BA2BAA,IAAA,0BACAA,IAAA,0BACAA,IAAA,0BACAA,IAAA,0BAjDA,CA6KC3F,EAAA2F,SAAA3F,EAAA2F","file":"index.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"asparse\"] = factory();\n\telse\n\t\troot[\"asparse\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","\"use strict\";\r\nexports.__esModule = true;\r\nvar common_1 = require(\"./common\");\r\nexports.Type = common_1.Type;\r\nexports.SectionId = common_1.SectionId;\r\nexports.ExternalKind = common_1.ExternalKind;\r\n/** Cached compiled parser. */\r\nvar compiled = null;\r\nif (typeof WASM_DATA !== \"string\")\r\n WASM_DATA = require(\"fs\").readFileSync(__dirname + \"/../build/index.wasm\", \"base64\");\r\n/** Parses the contents of a WebAssembly binary according to the specified options. */\r\nfunction parse(binary, options) {\r\n if (!options)\r\n options = {};\r\n // compile the parser if not yet compiled\r\n if (!compiled)\r\n compiled = new WebAssembly.Module(base64_decode(WASM_DATA));\r\n // use the binary as the parser's memory\r\n var nBytes = binary.length;\r\n var nPages = ((nBytes + 0xffff) & ~0xffff) >> 16;\r\n var memory = new WebAssembly.Memory({ initial: nPages });\r\n var buffer = new Uint8Array(memory.buffer);\r\n buffer.set(binary);\r\n // provide a way to read strings from memory\r\n parse.readString = function (offset, length) { return utf8_read(buffer, offset, offset + length); };\r\n // instantiate the parser and return its exports\r\n var imports = {\r\n env: {\r\n memory: memory\r\n },\r\n options: {}\r\n };\r\n [\"onSection\",\r\n \"onType\",\r\n \"onTypeParam\",\r\n \"onTypeReturn\",\r\n \"onImport\",\r\n \"onFunctionImport\",\r\n \"onTableImport\",\r\n \"onMemoryImport\",\r\n \"onGlobalImport\",\r\n \"onMemory\",\r\n \"onFunction\",\r\n \"onTable\",\r\n \"onGlobal\",\r\n \"onExport\",\r\n \"onStart\",\r\n \"onSourceMappingURL\",\r\n \"onModuleName\",\r\n \"onFunctionName\",\r\n \"onLocalName\"\r\n ].forEach(function (name) { return imports.options[name] = options[name] || function () { }; });\r\n var instance = new WebAssembly.Instance(compiled, imports);\r\n instance.exports.parse(0, nBytes);\r\n}\r\nexports.parse = parse;\r\n// see: https://github.com/dcodeIO/protobuf.js/tree/master/lib/utf8\r\nfunction utf8_read(buffer, start, end) {\r\n var len = end - start;\r\n if (len < 1)\r\n return \"\";\r\n var parts = null, chunk = [], i = 0, // char offset\r\n t = 0; // temporary\r\n while (start < end) {\r\n t = buffer[start++];\r\n if (t < 128) {\r\n chunk[i++] = t;\r\n }\r\n else if (t > 191 && t < 224) {\r\n chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;\r\n }\r\n else if (t > 239 && t < 365) {\r\n t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;\r\n chunk[i++] = 0xD800 + (t >> 10);\r\n chunk[i++] = 0xDC00 + (t & 1023);\r\n }\r\n else {\r\n chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;\r\n }\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n}\r\n// see: https://github.com/dcodeIO/protobuf.js/tree/master/lib/base64\r\nfunction base64_decode(string) {\r\n var length = string.length;\r\n if (length) {\r\n var n = 0, p = length;\r\n while (--p % 4 > 1 && string.charCodeAt(p) === 61)\r\n ++n;\r\n length = Math.ceil(length * 3) / 4 - n;\r\n }\r\n var buffer = new Uint8Array(length);\r\n var j = 0, o = 0, t = 0;\r\n for (var i = 0, k = string.length; i < k;) {\r\n var c = string.charCodeAt(i++);\r\n if (c === 61 && j > 1)\r\n break;\r\n if ((c = s64[c]) === undefined)\r\n throw Error();\r\n switch (j) {\r\n case 0: {\r\n t = c;\r\n j = 1;\r\n break;\r\n }\r\n case 1: {\r\n buffer[o++] = t << 2 | (c & 48) >> 4;\r\n t = c;\r\n j = 2;\r\n break;\r\n }\r\n case 2: {\r\n buffer[o++] = (t & 15) << 4 | (c & 60) >> 2;\r\n t = c;\r\n j = 3;\r\n break;\r\n }\r\n case 3: {\r\n buffer[o++] = (t & 3) << 6 | c;\r\n j = 0;\r\n break;\r\n }\r\n }\r\n }\r\n if (j === 1)\r\n throw Error();\r\n return buffer;\r\n}\r\nvar s64 = new Array(123);\r\nfor (var i = 0; i < 64;)\r\n s64[i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;\r\n","\"use strict\";\r\n/** Common constants shared between AssemblyScript and TypeScript. */\r\nexports.__esModule = true;\r\n/** WebAssembly types. */\r\nvar Type;\r\n(function (Type) {\r\n Type[Type[\"i32\"] = 127] = \"i32\";\r\n Type[Type[\"i64\"] = 126] = \"i64\";\r\n Type[Type[\"f32\"] = 125] = \"f32\";\r\n Type[Type[\"f64\"] = 124] = \"f64\";\r\n Type[Type[\"anyfunc\"] = 112] = \"anyfunc\";\r\n Type[Type[\"func\"] = 96] = \"func\";\r\n Type[Type[\"none\"] = 64] = \"none\";\r\n})(Type = exports.Type || (exports.Type = {}));\r\n/** WebAssembly section ids. */\r\nvar SectionId;\r\n(function (SectionId) {\r\n SectionId[SectionId[\"Custom\"] = 0] = \"Custom\";\r\n SectionId[SectionId[\"Type\"] = 1] = \"Type\";\r\n SectionId[SectionId[\"Import\"] = 2] = \"Import\";\r\n SectionId[SectionId[\"Function\"] = 3] = \"Function\";\r\n SectionId[SectionId[\"Table\"] = 4] = \"Table\";\r\n SectionId[SectionId[\"Memory\"] = 5] = \"Memory\";\r\n SectionId[SectionId[\"Global\"] = 6] = \"Global\";\r\n SectionId[SectionId[\"Export\"] = 7] = \"Export\";\r\n SectionId[SectionId[\"Start\"] = 8] = \"Start\";\r\n SectionId[SectionId[\"Element\"] = 9] = \"Element\";\r\n SectionId[SectionId[\"Code\"] = 10] = \"Code\";\r\n SectionId[SectionId[\"Data\"] = 11] = \"Data\";\r\n})(SectionId = exports.SectionId || (exports.SectionId = {}));\r\n/** WebAssembly external kinds. */\r\nvar ExternalKind;\r\n(function (ExternalKind) {\r\n ExternalKind[ExternalKind[\"Function\"] = 0] = \"Function\";\r\n ExternalKind[ExternalKind[\"Table\"] = 1] = \"Table\";\r\n ExternalKind[ExternalKind[\"Memory\"] = 2] = \"Memory\";\r\n ExternalKind[ExternalKind[\"Global\"] = 3] = \"Global\";\r\n})(ExternalKind = exports.ExternalKind || (exports.ExternalKind = {}));\r\n/** Name section types. */\r\nvar NameType;\r\n(function (NameType) {\r\n NameType[NameType[\"Module\"] = 0] = \"Module\";\r\n NameType[NameType[\"Function\"] = 1] = \"Function\";\r\n NameType[NameType[\"Local\"] = 2] = \"Local\";\r\n})(NameType = exports.NameType || (exports.NameType = {}));\r\n/** Maximum number of memory pages. */\r\nexports.MAX_PAGES = 0xffff;\r\n/** Maximum number of table elements. */\r\nexports.MAX_ELEMS = 0xffffffff;\r\n/** WebAssembly opcodes. */\r\nvar Opcode;\r\n(function (Opcode) {\r\n // unreachable = 0x00,\r\n // nop = 0x01,\r\n // block = 0x02,\r\n // loop = 0x03,\r\n // if_ = 0x04,\r\n // else_ = 0x05,\r\n Opcode[Opcode[\"end\"] = 11] = \"end\";\r\n // br = 0x0c,\r\n // br_if = 0x0d,\r\n // br_table = 0x0e,\r\n // return_ = 0x0f,\r\n // call = 0x10,\r\n // call_indirect = 0x11,\r\n // drop = 0x1a,\r\n // select = 0x1b,\r\n // get_local = 0x20,\r\n // set_local = 0x21,\r\n // tee_local = 0x22,\r\n Opcode[Opcode[\"get_global\"] = 35] = \"get_global\";\r\n // set_global = 0x24,\r\n // i32_load = 0x28,\r\n // i64_load = 0x29,\r\n // f32_load = 0x2a,\r\n // f64_load = 0x2b,\r\n // i32_load8_s = 0x2c,\r\n // i32_load8_u = 0x2d,\r\n // i32_load16_s = 0x2e,\r\n // i32_load16_u = 0x2f,\r\n // i64_load8_s = 0x30,\r\n // i64_load8_u = 0x31,\r\n // i64_load16_s = 0x32,\r\n // i64_load16_u = 0x33,\r\n // i64_load32_s = 0x34,\r\n // i64_load32_u = 0x35,\r\n // i32_store = 0x36,\r\n // i64_store = 0x37,\r\n // f32_store = 0x38,\r\n // f64_store = 0x39,\r\n // i32_store8 = 0x3a,\r\n // i32_store16 = 0x3b,\r\n // i64_store8 = 0x3c,\r\n // i64_store16 = 0x3d,\r\n // i64_store32 = 0x3e,\r\n // current_memory = 0x3f,\r\n // grow_memory = 0x40,\r\n Opcode[Opcode[\"i32_const\"] = 65] = \"i32_const\";\r\n Opcode[Opcode[\"i64_const\"] = 66] = \"i64_const\";\r\n Opcode[Opcode[\"f32_const\"] = 67] = \"f32_const\";\r\n Opcode[Opcode[\"f64_const\"] = 68] = \"f64_const\";\r\n // i32_eqz = 0x45,\r\n // i32_eq = 0x46,\r\n // i32_ne = 0x47,\r\n // i32_lt_s = 0x48,\r\n // i32_lt_u = 0x49,\r\n // i32_gt_s = 0x4a,\r\n // i32_gt_u = 0x4b,\r\n // i32_le_s = 0x4c,\r\n // i32_le_u = 0x4d,\r\n // i32_ge_s = 0x4e,\r\n // i32_ge_u = 0x4f,\r\n // i64_eqz = 0x50,\r\n // i64_eq = 0x51,\r\n // i64_ne = 0x52,\r\n // i64_lt_s = 0x53,\r\n // i64_lt_u = 0x54,\r\n // i64_gt_s = 0x55,\r\n // i64_gt_u = 0x56,\r\n // i64_le_s = 0x57,\r\n // i64_le_u = 0x58,\r\n // i64_ge_s = 0x59,\r\n // i64_ge_u = 0x5a,\r\n // f32_eq = 0x5b,\r\n // f32_ne = 0x5c,\r\n // f32_lt = 0x5d,\r\n // f32_gt = 0x5e,\r\n // f32_le = 0x5f,\r\n // f32_ge = 0x60,\r\n // f64_eq = 0x61,\r\n // f64_ne = 0x62,\r\n // f64_lt = 0x63,\r\n // f64_gt = 0x64,\r\n // f64_le = 0x65,\r\n // f64_ge = 0x66,\r\n // i32_clz = 0x67,\r\n // i32_ctz = 0x68,\r\n // i32_popcnt = 0x69,\r\n // i32_add = 0x6a,\r\n // i32_sub = 0x6b,\r\n // i32_mul = 0x6c,\r\n // i32_div_s = 0x6d,\r\n // i32_div_u = 0x6e,\r\n // i32_rem_s = 0x6f,\r\n // i32_rem_u = 0x70,\r\n // i32_and = 0x71,\r\n // i32_or = 0x72,\r\n // i32_xor = 0x73,\r\n // i32_shl = 0x74,\r\n // i32_shr_s = 0x75,\r\n // i32_shr_u = 0x76,\r\n // i32_rotl = 0x77,\r\n // i32_rotr = 0x78,\r\n // i64_clz = 0x79,\r\n // i64_ctz = 0x7a,\r\n // i64_popcnt = 0x7b,\r\n // i64_add = 0x7c,\r\n // i64_sub = 0x7d,\r\n // i64_mul = 0x7e,\r\n // i64_div_s = 0x7f,\r\n // i64_div_u = 0x80,\r\n // i64_rem_s = 0x81,\r\n // i64_rem_u = 0x82,\r\n // i64_and = 0x83,\r\n // i64_or = 0x84,\r\n // i64_xor = 0x85,\r\n // i64_shl = 0x86,\r\n // i64_shr_s = 0x87,\r\n // i64_shr_u = 0x88,\r\n // i64_rotl = 0x89,\r\n // i64_rotr = 0x8a,\r\n // f32_abs = 0x8b,\r\n // f32_neg = 0x8c,\r\n // f32_ceil = 0x8d,\r\n // f32_floor = 0x8e,\r\n // f32_trunc = 0x8f,\r\n // f32_nearest = 0x90,\r\n // f32_sqrt = 0x91,\r\n // f32_add = 0x92,\r\n // f32_sub = 0x93,\r\n // f32_mul = 0x94,\r\n // f32_div = 0x95,\r\n // f32_min = 0x96,\r\n // f32_max = 0x97,\r\n // f32_copysign = 0x98,\r\n // f64_abs = 0x99,\r\n // f64_neg = 0x9a,\r\n // f64_ceil = 0x9b,\r\n // f64_floor = 0x9c,\r\n // f64_trunc = 0x9d,\r\n // f64_nearest = 0x9e,\r\n // f64_sqrt = 0x9f,\r\n // f64_add = 0xa0,\r\n // f64_sub = 0xa1,\r\n // f64_mul = 0xa2,\r\n // f64_div = 0xa3,\r\n // f64_min = 0xa4,\r\n // f64_max = 0xa5,\r\n // f64_copysign = 0xa6,\r\n // i32_wrap_i64 = 0xa7,\r\n // i32_trunc_s_f32 = 0xa8,\r\n // i32_trunc_u_f32 = 0xa9,\r\n // i32_trunc_s_f64 = 0xaa,\r\n // i32_trunc_u_f64 = 0xab,\r\n // i64_extend_s_i32 = 0xac,\r\n // i64_extend_u_i32 = 0xad,\r\n // i64_trunc_s_f32 = 0xae,\r\n // i64_trunc_u_f32 = 0xaf,\r\n // i64_trunc_s_f64 = 0xb0,\r\n // i64_trunc_u_f64 = 0xb1,\r\n // f32_convert_s_i32 = 0xb2,\r\n // f32_convert_u_i32 = 0xb3,\r\n // f32_convert_s_i64 = 0xb4,\r\n // f32_convert_u_i64 = 0xb5,\r\n // f32_demote_f64 = 0xb6,\r\n // f64_convert_s_i32 = 0xb7,\r\n // f64_convert_u_i32 = 0xb8,\r\n // f64_convert_s_i64 = 0xb9,\r\n // f64_convert_u_i64 = 0xba,\r\n // f64_promote_f32 = 0xbb,\r\n // i32_reinterpret_f32 = 0xbc,\r\n // i64_reinterpret_f64 = 0xbd,\r\n // f32_reinterpret_i32 = 0xbe,\r\n // f64_reinterpret_i64 = 0xbf\r\n})(Opcode = exports.Opcode || (exports.Opcode = {}));\r\n"],"sourceRoot":""} \ No newline at end of file diff --git a/lib/parse/package.json b/lib/parse/package.json index 23d02b8e43..f81f9aef68 100644 --- a/lib/parse/package.json +++ b/lib/parse/package.json @@ -5,7 +5,7 @@ "main": "index.js", "types": "index.d.ts", "scripts": { - "asbuild": "asc assembly/index.ts -O3 -b build/index.wasm -t build/index.wat --importMemory --sourceMap --validate", + "asbuild": "asc assembly/index.ts -O3 -b build/index.wasm -t build/index.wat --importMemory --runtime none --sourceMap --validate", "build": "npm run asbuild && webpack --mode production --display-modules", "test": "ts-node tests/" }, diff --git a/lib/rtrace/README.md b/lib/rtrace/README.md new file mode 100644 index 0000000000..72411f2640 --- /dev/null +++ b/lib/rtrace/README.md @@ -0,0 +1,26 @@ +# ![AS](https://avatars1.githubusercontent.com/u/28916798?s=48) rtrace + +A tiny utility that records allocations, retains, releases and frees performed by the runtime and emits an error if something is off. Also checks for leaks. + +Instructions +------------ + +Compile your module that uses the full or half runtime with `-use ASC_RTRACE=1` and include an instance of this module as the import named `rtrace`. + +```js +var rtr = rtrace(e => { + // handle error +}); + +WebAssembly.instantiate(..., { rtrace: rtr, ... }); +... + +if (rtr.active) { + let leakCount = rtr.check(); + if (leakCount) { + // handle error + } +} +``` + +Note that references retained in globals which are not cleared before execution concludes appear as leaks, including their inner members. A TypedArray would leak itself and its backing ArrayBuffer in this case for example. This is perfectly normal and clearing all globals avoids this. diff --git a/lib/rtrace/index.js b/lib/rtrace/index.js new file mode 100644 index 0000000000..af0d66c768 --- /dev/null +++ b/lib/rtrace/index.js @@ -0,0 +1,73 @@ +function rtrace(onerror, oninfo) { + if (!onerror) onerror = function() {}; + if (!oninfo) oninfo = function() {}; + var blocks = new Map(); + var rtrace = { + + allocCount: 0, + freeCount: 0, + incrementCount: 0, + decrementCount: 0, + + onalloc: function(block) { + ++rtrace.allocCount; + if (blocks.has(block)) { + onerror(Error("duplicate alloc: " + block)); + } else { + oninfo("ALLOC " + block); + blocks.set(block, 0); + } + }, + + onfree: function(block) { + ++rtrace.freeCount; + if (!blocks.has(block)) { + onerror(Error("orphaned free: " + block)); + } else { + oninfo("FREE " + block + " @ " + blocks.get(block)); + blocks.delete(block); + } + }, + + onincrement: function(block) { + ++rtrace.incrementCount; + if (!blocks.has(block)) { + onerror(Error("orphaned increment: " + block)); + } else { + let rc = blocks.get(block); + oninfo("++ " + block + " @ " + rc + "->" + (rc + 1)); + blocks.set(block, rc + 1); + } + }, + + ondecrement: function(block) { + ++rtrace.decrementCount; + if (!blocks.has(block)) { + onerror(Error("orphaned decrement: " + block)); + } else { + let rc = blocks.get(block); + if (rc < 1) { + onerror(Error("invalid decrement: " + block)); + } else { + oninfo("-- " + block + " @ " + rc + "->" + (rc - 1)); + blocks.set(block, rc - 1); + } + } + }, + + get active() { + return Boolean(rtrace.allocCount || rtrace.freeCount || rtrace.incrementCount || rtrace.decrementCount); + }, + + check() { + if (oninfo) { + for (let [block, rc ] of blocks) { + oninfo("LEAKING " + block + " @ " + rc); + } + } + return blocks.size; + } + }; + return rtrace; +} +module.exports = rtrace; diff --git a/lib/rtrace/package.json b/lib/rtrace/package.json new file mode 100644 index 0000000000..eea8332daf --- /dev/null +++ b/lib/rtrace/package.json @@ -0,0 +1,6 @@ +{ + "name": "@assemblyscript/rtrace", + "version": "0.1.0", + "license": "Apache-2.0", + "main": "index.js" +} diff --git a/package-lock.json b/package-lock.json index 756fa25bbf..670594fcc1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "assemblyscript", - "version": "0.6.0", + "version": "0.7.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -9,78 +9,12 @@ "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" }, - "@types/events": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", - "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", - "dev": true - }, - "@types/fs-extra": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-5.0.5.tgz", - "integrity": "sha512-w7iqhDH9mN8eLClQOYTkhdYUOSpp25eXxfc6VbFOGtzxW34JcvctH2bKjj4jD4++z4R5iO5D+pg48W2e03I65A==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/glob": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz", - "integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==", - "dev": true, - "requires": { - "@types/events": "*", - "@types/minimatch": "*", - "@types/node": "*" - } - }, - "@types/handlebars": { - "version": "4.0.40", - "resolved": "https://registry.npmjs.org/@types/handlebars/-/handlebars-4.0.40.tgz", - "integrity": "sha512-sGWNtsjNrLOdKha2RV1UeF8+UbQnPSG7qbe5wwbni0mw4h2gHXyPFUMOC+xwGirIiiydM/HSqjDO4rk6NFB18w==", - "dev": true - }, - "@types/highlight.js": { - "version": "9.12.3", - "resolved": "https://registry.npmjs.org/@types/highlight.js/-/highlight.js-9.12.3.tgz", - "integrity": "sha512-pGF/zvYOACZ/gLGWdQH8zSwteQS1epp68yRcVLJMgUck/MjEn/FBYmPub9pXT8C1e4a8YZfHo1CKyV8q1vKUnQ==", - "dev": true - }, - "@types/lodash": { - "version": "4.14.121", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.121.tgz", - "integrity": "sha512-ORj7IBWj13iYufXt/VXrCNMbUuCTJfhzme5kx9U/UtcIPdJYuvPDUAlHlbNhz/8lKCLy9XGIZnGrqXOtQbPGoQ==", - "dev": true - }, - "@types/marked": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@types/marked/-/marked-0.4.2.tgz", - "integrity": "sha512-cDB930/7MbzaGF6U3IwSQp6XBru8xWajF5PV2YZZeV8DyiliTuld11afVztGI9+yJZ29il5E+NpGA6ooV/Cjkg==", - "dev": true - }, - "@types/minimatch": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", - "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", - "dev": true - }, "@types/node": { "version": "11.13.0", "resolved": "https://registry.npmjs.org/@types/node/-/node-11.13.0.tgz", "integrity": "sha512-rx29MMkRdVmzunmiA4lzBYJNnXsW/PhG4kMBy2ATsYaDjGGR75dCFEVVROKpNwlVdcUX3xxlghKQOeDPBJobng==", "dev": true }, - "@types/shelljs": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/@types/shelljs/-/shelljs-0.8.3.tgz", - "integrity": "sha512-miY41hqc5SkRlsZDod3heDa4OS9xv8G77EMBQuSpqq86HBn66l7F+f8y9YKm+1PIuwC8QEZVwN8YxOOG7Y67fA==", - "dev": true, - "requires": { - "@types/glob": "*", - "@types/node": "*" - } - }, "@webassemblyjs/ast": { "version": "1.8.5", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.8.5.tgz", @@ -429,15 +363,6 @@ "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", "dev": true }, - "async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", - "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", - "dev": true, - "requires": { - "lodash": "^4.17.11" - } - }, "async-each": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", @@ -567,9 +492,9 @@ "dev": true }, "binaryen": { - "version": "77.0.0-nightly.20190407", - "resolved": "https://registry.npmjs.org/binaryen/-/binaryen-77.0.0-nightly.20190407.tgz", - "integrity": "sha512-1mxYNvQ0xywMe582K7V6Vo2zzhZZxMTeGHH8aE/+/AND8f64D8Q1GThVY3RVRwGY/4p+p95ccw9Xbw2ovFXRIg==" + "version": "84.0.0-nightly.20190522", + "resolved": "https://registry.npmjs.org/binaryen/-/binaryen-84.0.0-nightly.20190522.tgz", + "integrity": "sha512-bxSPi3MOkFmK5W6VIlqxnOc1nYzpUCzT/tHz3C7sgbz7jTR2lOBlZnKStTJlBt018xeZK9/JpK/jXdduH7eQFg==" }, "bluebird": { "version": "3.5.3", @@ -1564,17 +1489,6 @@ "readable-stream": "^2.0.0" } }, - "fs-extra": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", - "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, "fs-write-stream-atomic": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", @@ -2225,26 +2139,6 @@ "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", "dev": true }, - "handlebars": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.0.tgz", - "integrity": "sha512-l2jRuU1NAWK6AW5qqcTATWQJvNPEwkM7NEKSiv/gqOsoSQbVoWyqVEY5GS+XPQ88zLNmqASRpzfdm8d79hJS+w==", - "dev": true, - "requires": { - "async": "^2.5.0", - "optimist": "^0.6.1", - "source-map": "^0.6.1", - "uglify-js": "^3.1.4" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, "has-ansi": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", @@ -2312,12 +2206,6 @@ "minimalistic-assert": "^1.0.1" } }, - "highlight.js": { - "version": "9.14.2", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.14.2.tgz", - "integrity": "sha512-Nc6YNECYpxyJABGYJAyw7dBAYbXEuIzwzkqoJnwbc1nIpCiN+3ioYf0XrBnLiyyG0JLuJhpPtt2iTSbXiKLoyA==", - "dev": true - }, "hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", @@ -2607,15 +2495,6 @@ "minimist": "^1.2.0" } }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, "kind-of": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", @@ -2658,12 +2537,6 @@ "path-exists": "^3.0.0" } }, - "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", - "dev": true - }, "long": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", @@ -2723,12 +2596,6 @@ "object-visit": "^1.0.0" } }, - "marked": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-0.4.0.tgz", - "integrity": "sha512-tMsdNBgOsrUophCAFQl0XPe6Zqk/uy9gnue+jIIKhykO51hxyu6uNx7zBPy0+y/WKYVZZMspV9YeXLNdKk+iYw==", - "dev": true - }, "md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -3060,24 +2927,6 @@ "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.2.tgz", "integrity": "sha512-pVOEP16TrAO2/fjej1IdOyupJY8KDUM1CvsaScRbw6oddvpQoOfGk4ywha0HKKVAD6RkW4x6Q+tNBwhf3Bgpuw==" }, - "optimist": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", - "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", - "dev": true, - "requires": { - "minimist": "~0.0.1", - "wordwrap": "~0.0.2" - }, - "dependencies": { - "minimist": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", - "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", - "dev": true - } - } - }, "os-browserify": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", @@ -3261,12 +3110,6 @@ "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "dev": true }, - "progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true - }, "promise-inflight": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", @@ -3389,15 +3232,6 @@ "readable-stream": "^2.0.2" } }, - "rechoir": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", - "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", - "dev": true, - "requires": { - "resolve": "^1.1.6" - } - }, "regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", @@ -3610,17 +3444,6 @@ "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true }, - "shelljs": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.3.tgz", - "integrity": "sha512-fc0BKlAWiLpwZljmOvAOTE/gXawtCoNrP5oaY7KIaQbbyHeQVg01pSEuEGvGh3HEdBU4baCD7wQBwADmM/7f7A==", - "dev": true, - "requires": { - "glob": "^7.0.0", - "interpret": "^1.0.0", - "rechoir": "^0.6.2" - } - }, "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", @@ -4140,45 +3963,6 @@ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", "dev": true }, - "typedoc": { - "version": "0.14.2", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.14.2.tgz", - "integrity": "sha512-aEbgJXV8/KqaVhcedT7xG6d2r+mOvB5ep3eIz1KuB5sc4fDYXcepEEMdU7XSqLFO5hVPu0nllHi1QxX2h/QlpQ==", - "dev": true, - "requires": { - "@types/fs-extra": "^5.0.3", - "@types/handlebars": "^4.0.38", - "@types/highlight.js": "^9.12.3", - "@types/lodash": "^4.14.110", - "@types/marked": "^0.4.0", - "@types/minimatch": "3.0.3", - "@types/shelljs": "^0.8.0", - "fs-extra": "^7.0.0", - "handlebars": "^4.0.6", - "highlight.js": "^9.13.1", - "lodash": "^4.17.10", - "marked": "^0.4.0", - "minimatch": "^3.0.0", - "progress": "^2.0.0", - "shelljs": "^0.8.2", - "typedoc-default-themes": "^0.5.0", - "typescript": "3.2.x" - }, - "dependencies": { - "typescript": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.2.4.tgz", - "integrity": "sha512-0RNDbSdEokBeEAkgNbxJ+BLwSManFy9TeXz8uW+48j/xhEXv1ePME60olyzw2XzUqUBNAYFeJadIqAgNqIACwg==", - "dev": true - } - } - }, - "typedoc-default-themes": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.5.0.tgz", - "integrity": "sha1-bcJDPnjti+qOiHo6zeLzF4W9Yic=", - "dev": true - }, "typedoc-plugin-external-module-name": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/typedoc-plugin-external-module-name/-/typedoc-plugin-external-module-name-2.0.0.tgz", @@ -4191,33 +3975,6 @@ "integrity": "sha512-Og2Vn6Mk7JAuWA1hQdDQN/Ekm/SchX80VzLhjKN9ETYrIepBFAd8PkOdOTK2nKt0FCkmMZKBJvQ1dV1gIxPu/A==", "dev": true }, - "uglify-js": { - "version": "3.4.9", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.9.tgz", - "integrity": "sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==", - "dev": true, - "optional": true, - "requires": { - "commander": "~2.17.1", - "source-map": "~0.6.1" - }, - "dependencies": { - "commander": { - "version": "2.17.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", - "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", - "dev": true, - "optional": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "optional": true - } - } - }, "union-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", @@ -4271,12 +4028,6 @@ "imurmurhash": "^0.1.4" } }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true - }, "unset-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", @@ -4487,12 +4238,6 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, - "wordwrap": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", - "dev": true - }, "worker-farm": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.6.0.tgz", diff --git a/package.json b/package.json index 21b0ec2681..cd82261740 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "assemblyscript", - "version": "0.6.0", + "version": "0.7.0", "author": "Daniel Wirtz ", "license": "Apache-2.0", "repository": { @@ -12,7 +12,7 @@ }, "dependencies": { "@protobufjs/utf8": "^1.1.0", - "binaryen": "77.0.0-nightly.20190407", + "binaryen": "84.0.0-nightly.20190522", "glob": "^7.1.3", "long": "^4.0.0", "opencollective-postinstall": "^2.0.0", @@ -25,7 +25,6 @@ "ts-loader": "^5.3.3", "ts-node": "^6.2.0", "tslint": "^5.15.0", - "typedoc": "^0.14.0", "typedoc-plugin-external-module-name": "^2.0.0", "typescript": "^3.4.2", "webpack": "^4.29.6", @@ -41,12 +40,13 @@ "node": ">=8" }, "scripts": { - "build": "webpack --mode production --display-modules", + "build": "npm run build:bundle && npm run build:dts", + "build:bundle": "webpack --mode production --display-modules", + "build:dts": "node scripts/build-dts", "clean": "node scripts/clean", - "check": "npm run check:config && npm run check:compiler && npm run check:library", + "check": "npm run check:config && npm run check:compiler", "check:config": "tsc --noEmit -p src --diagnostics --listFiles", "check:compiler": "tslint -c tslint.json --project src --formatters-dir lib/lint/formatters --format as", - "check:library": "tslint -c tslint.json --project std/assembly --formatters-dir lib/lint/formatters --format as", "test": "npm run test:parser && npm run test:compiler", "test:parser": "node tests/parser", "test:compiler": "node tests/compiler", @@ -69,7 +69,6 @@ "package.json", "package-lock.json", "README.md", - "src/", "std/", "tsconfig-base.json" ], diff --git a/scripts/build-dts.js b/scripts/build-dts.js new file mode 100644 index 0000000000..d301245153 --- /dev/null +++ b/scripts/build-dts.js @@ -0,0 +1,450 @@ +// © 2015-2019 SitePen, Inc. New BSD License. +// see: https://github.com/SitePen/dts-generator +(function (factory) { + var v = factory(require, exports); + if (v !== undefined) module.exports = v; +})(function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + const fs = require("fs"); + const glob = require("glob"); + const mkdirp = require("mkdirp"); + const os = require("os"); + const pathUtil = require("path"); + const ts = require("typescript"); + // declare some constants so we don't have magic integers without explanation + const DTSLEN = '.d.ts'.length; + const filenameToMid = (function () { + if (pathUtil.sep === '/') { + return function (filename) { + return filename; + }; + } + else { + const separatorExpression = new RegExp(pathUtil.sep.replace('\\', '\\\\'), 'g'); + return function (filename) { + return filename.replace(separatorExpression, '/'); + }; + } + })(); + /** + * A helper function that takes TypeScript diagnostic errors and returns an error + * object. + * @param diagnostics The array of TypeScript Diagnostic objects + */ + function getError(diagnostics) { + let message = 'Declaration generation failed'; + diagnostics.forEach(function (diagnostic) { + // not all errors have an associated file: in particular, problems with a + // the tsconfig.json don't; the messageText is enough to diagnose in those + // cases. + if (diagnostic.file) { + const position = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); + message += + `\n${diagnostic.file.fileName}(${position.line + 1},${position.character + 1}): ` + + `error TS${diagnostic.code}: ${diagnostic.messageText}`; + } + else { + message += `\nerror TS${diagnostic.code}: ${diagnostic.messageText}`; + } + }); + const error = new Error(message); + error.name = 'EmitterError'; + return error; + } + function getFilenames(baseDir, files) { + return files.map(function (filename) { + const resolvedFilename = pathUtil.resolve(filename); + if (resolvedFilename.indexOf(baseDir) === 0) { + return resolvedFilename; + } + return pathUtil.resolve(baseDir, filename); + }); + } + function processTree(sourceFile, replacer) { + let code = ''; + let cursorPosition = 0; + function skip(node) { + cursorPosition = node.end; + } + function readThrough(node) { + code += sourceFile.text.slice(cursorPosition, node.pos); + cursorPosition = node.pos; + } + function visit(node) { + readThrough(node); + const replacement = replacer(node); + if (replacement != null) { + code += replacement; + skip(node); + } + else { + ts.forEachChild(node, visit); + } + } + visit(sourceFile); + code += sourceFile.text.slice(cursorPosition); + return code; + } + /** + * Load and parse a TSConfig File + * @param options The dts-generator options to load config into + * @param fileName The path to the file + */ + function getTSConfig(fileName) { + // TODO this needs a better design than merging stuff into options. + // the trouble is what to do when no tsconfig is specified... + const configText = fs.readFileSync(fileName, { encoding: 'utf8' }); + const result = ts.parseConfigFileTextToJson(fileName, configText); + if (result.error) { + throw getError([result.error]); + } + const configObject = result.config; + const configParseResult = ts.parseJsonConfigFileContent(configObject, ts.sys, pathUtil.dirname(fileName)); + if (configParseResult.errors && configParseResult.errors.length) { + throw getError(configParseResult.errors); + } + return [ + configParseResult.fileNames, + configParseResult.options + ]; + } + function isNodeKindImportDeclaration(value) { + return value && value.kind === ts.SyntaxKind.ImportDeclaration; + } + function isNodeKindExternalModuleReference(value) { + return value && value.kind === ts.SyntaxKind.ExternalModuleReference; + } + function isNodeKindStringLiteral(value) { + return value && value.kind === ts.SyntaxKind.StringLiteral; + } + function isNodeKindExportDeclaration(value) { + return value && value.kind === ts.SyntaxKind.ExportDeclaration; + } + function isNodeKindExportAssignment(value) { + return value && value.kind === ts.SyntaxKind.ExportAssignment; + } + function isNodeKindModuleDeclaration(value) { + return value && value.kind === ts.SyntaxKind.ModuleDeclaration; + } + function generate(options) { + if (Boolean(options.main) !== Boolean(options.name)) { + if (Boolean(options.name)) { + // since options.name used to do double duty as the prefix, let's be + // considerate and point out that name should be replaced with prefix. + // TODO update this error message when we finalize which version this change + // will be released in. + throw new Error(`name and main must be used together. Perhaps you want prefix instead of + name? In dts-generator version 2.1, name did double duty as the option to + use to prefix module names with, but in >=2.2 the name option was split + into two; prefix is what is now used to prefix imports and module names + in the output.`); + } + else { + throw new Error('name and main must be used together.'); + } + } + const noop = function () { }; + const sendMessage = options.sendMessage || noop; + const verboseMessage = options.verbose ? sendMessage : noop; + let compilerOptions = {}; + let files = options.files; + /* following tsc behaviour, if a project is specified, or if no files are specified then + * attempt to load tsconfig.json */ + if (options.project || !options.files || options.files.length === 0) { + verboseMessage(`project = "${options.project || options.baseDir}"`); + // if project isn't specified, use baseDir. If it is and it's a directory, + // assume we want tsconfig.json in that directory. If it is a file, though + // use that as our tsconfig.json. This allows for projects that have more + // than one tsconfig.json file. + let tsconfigFilename; + if (Boolean(options.project)) { + if (fs.lstatSync(options.project).isDirectory()) { + tsconfigFilename = pathUtil.join(options.project, 'tsconfig.json'); + } + else { + // project isn't a diretory, it's a file + tsconfigFilename = options.project; + } + } + else { + tsconfigFilename = pathUtil.join(options.baseDir, 'tsconfig.json'); + } + if (fs.existsSync(tsconfigFilename)) { + verboseMessage(` parsing "${tsconfigFilename}"`); + [files, compilerOptions] = getTSConfig(tsconfigFilename); + } + else { + sendMessage(`No "tsconfig.json" found at "${tsconfigFilename}"!`); + return new Promise(function ({}, reject) { + reject(new SyntaxError('Unable to resolve configuration.')); + }); + } + } + const eol = options.eol || os.EOL; + const nonEmptyLineStart = new RegExp(eol + '(?!' + eol + '|$)', 'g'); + const indent = options.indent === undefined ? '\t' : options.indent; + // use input values if tsconfig leaves any of these undefined. + // this is for backwards compatibility + compilerOptions.declaration = true; + compilerOptions.target = compilerOptions.target || ts.ScriptTarget.Latest; // is this necessary? + compilerOptions.moduleResolution = compilerOptions.moduleResolution || options.moduleResolution; + compilerOptions.outDir = compilerOptions.outDir || options.outDir; + // TODO should compilerOptions.baseDir come into play? + const baseDir = pathUtil.resolve(compilerOptions.rootDir || options.project || options.baseDir); + const outDir = compilerOptions.outDir; + verboseMessage(`baseDir = "${baseDir}"`); + verboseMessage(`target = ${compilerOptions.target}`); + verboseMessage(`outDir = ${compilerOptions.outDir}`); + verboseMessage(`rootDir = ${compilerOptions.rootDir}`); + verboseMessage(`moduleResolution = ${compilerOptions.moduleResolution}`); + const filenames = getFilenames(baseDir, files); + verboseMessage('filenames:'); + filenames.forEach(name => { verboseMessage(' ' + name); }); + const excludesMap = {}; + options.exclude = options.exclude || ['node_modules/**/*.d.ts']; + options.exclude && options.exclude.forEach(function (filename) { + glob.sync(filename, { cwd: baseDir }).forEach(function (globFileName) { + excludesMap[filenameToMid(pathUtil.resolve(baseDir, globFileName))] = true; + }); + }); + if (options.exclude) { + verboseMessage('exclude:'); + options.exclude.forEach(name => { verboseMessage(' ' + name); }); + } + if (!options.stdout) mkdirp.sync(pathUtil.dirname(options.out)); + /* node.js typings are missing the optional mode in createWriteStream options and therefore + * in TS 1.6 the strict object literal checking is throwing, therefore a hammer to the nut */ + const output = options.stdout || fs.createWriteStream(options.out, { mode: parseInt('644', 8) }); + const host = ts.createCompilerHost(compilerOptions); + const program = ts.createProgram(filenames, compilerOptions, host); + function writeFile(filename, data) { + // Compiler is emitting the non-declaration file, which we do not care about + if (filename.slice(-DTSLEN) !== '.d.ts') { + return; + } + writeDeclaration(ts.createSourceFile(filename, data, compilerOptions.target, true), true); + } + let declaredExternalModules = []; + return new Promise(function (resolve, reject) { + output.on('close', () => { resolve(undefined); }); + output.on('error', reject); + if (options.externs) { + options.externs.forEach(function (path) { + sendMessage(`Writing external dependency ${path}`); + output.write(`/// ` + eol); + }); + } + if (options.types) { + options.types.forEach(function (type) { + sendMessage(`Writing external @types package dependency ${type}`); + output.write(`/// ` + eol); + }); + } + sendMessage('processing:'); + let mainExportDeclaration = false; + let mainExportAssignment = false; + let foundMain = false; + program.getSourceFiles().forEach(function (sourceFile) { + processTree(sourceFile, function (node) { + if (isNodeKindModuleDeclaration(node)) { + const name = node.name; + if (isNodeKindStringLiteral(name)) { + declaredExternalModules.push(name.text); + } + } + return null; + }); + }); + program.getSourceFiles().some(function (sourceFile) { + // Source file is a default library, or other dependency from another project, that should not be included in + // our bundled output + if (pathUtil.normalize(sourceFile.fileName).indexOf(baseDir + pathUtil.sep) !== 0) { + return; + } + if (excludesMap[filenameToMid(pathUtil.normalize(sourceFile.fileName))]) { + return; + } + sendMessage(` ${sourceFile.fileName}`); + // Source file is already a declaration file so should does not need to be pre-processed by the emitter + if (sourceFile.fileName.slice(-DTSLEN) === '.d.ts') { + writeDeclaration(sourceFile, false); + return; + } + // We can optionally output the main module if there's something to export. + if (options.main && options.main === (options.prefix + filenameToMid(sourceFile.fileName.slice(baseDir.length, -3)))) { + foundMain = true; + ts.forEachChild(sourceFile, function (node) { + mainExportDeclaration = mainExportDeclaration || isNodeKindExportDeclaration(node); + mainExportAssignment = mainExportAssignment || isNodeKindExportAssignment(node); + }); + } + const emitOutput = program.emit(sourceFile, writeFile); + if (emitOutput.emitSkipped || emitOutput.diagnostics.length > 0) { + reject(getError(emitOutput.diagnostics + .concat(program.getSemanticDiagnostics(sourceFile)) + .concat(program.getSyntacticDiagnostics(sourceFile)) + .concat(program.getDeclarationDiagnostics(sourceFile)))); + return true; + } + }); + if (options.main && !foundMain) { + throw new Error(`main module ${options.main} was not found`); + } + if (options.main) { + output.write(`declare module '${options.name}' {` + eol + indent); + if (compilerOptions.target >= ts.ScriptTarget.ES2015) { + if (mainExportAssignment) { + output.write(`export {default} from '${options.main}';` + eol + indent); + } + if (mainExportDeclaration) { + output.write(`export * from '${options.main}';` + eol); + } + } + else { + output.write(`import main = require('${options.main}');` + eol + indent); + output.write('export = main;' + eol); + } + output.write('}' + eol); + sendMessage(`Aliased main module ${options.name} to ${options.main}`); + } + if (!options.stdout) { + sendMessage(`output to "${options.out}"`); + output.end(); + } + }); + function writeDeclaration(declarationFile, isOutput) { + // resolving is important for dealting with relative outDirs + const filename = pathUtil.resolve(declarationFile.fileName); + // use the outDir here, not the baseDir, because the declarationFiles are + // outputs of the build process; baseDir points instead to the inputs. + // However we have to account for .d.ts files in our inputs that this code + // is also used for. Also if no outDir is used, the compiled code ends up + // alongside the source, so use baseDir in that case too. + const outputDir = (isOutput && Boolean(outDir)) ? pathUtil.resolve(outDir) : baseDir; + const sourceModuleId = filenameToMid(filename.slice(outputDir.length + 1, -DTSLEN)); + const currentModuleId = filenameToMid(filename.slice(outputDir.length + 1, -DTSLEN)); + function resolveModuleImport(moduleId) { + const isDeclaredExternalModule = declaredExternalModules.indexOf(moduleId) !== -1; + let resolved; + if (options.resolveModuleImport) { + resolved = options.resolveModuleImport({ + importedModuleId: moduleId, + currentModuleId: currentModuleId, + isDeclaredExternalModule: isDeclaredExternalModule + }); + } + if (!resolved) { + // resolve relative imports relative to the current module id. + if (moduleId.charAt(0) === '.') { + resolved = filenameToMid(pathUtil.join(pathUtil.dirname(sourceModuleId), moduleId)); + } + else { + resolved = moduleId; + } + // prefix the import with options.prefix, so that both non-relative imports + // and relative imports end up prefixed with options.prefix. We only + // do this when no resolveModuleImport function is given so that that + // function has complete control of the imports that get outputed. + // NOTE: we may want to revisit the isDeclaredExternalModule behavior. + // discussion is on https://github.com/SitePen/dts-generator/pull/94 + // but currently there's no strong argument against this behavior. + if (Boolean(options.prefix) && !isDeclaredExternalModule) { + resolved = `${options.prefix}/${resolved}`; + } + } + return resolved; + } + /* For some reason, SourceFile.externalModuleIndicator is missing from 1.6+, so having + * to use a sledgehammer on the nut */ + if (declarationFile.externalModuleIndicator) { + let resolvedModuleId = sourceModuleId; + if (options.resolveModuleId) { + const resolveModuleIdResult = options.resolveModuleId({ + currentModuleId: currentModuleId + }); + if (resolveModuleIdResult) { + resolvedModuleId = resolveModuleIdResult; + } + else if (options.prefix) { + resolvedModuleId = `${options.prefix}/${resolvedModuleId}`; + } + } + else if (options.prefix) { + resolvedModuleId = `${options.prefix}/${resolvedModuleId}`; + } + output.write('declare module \'' + resolvedModuleId + '\' {' + eol + indent); + const content = processTree(declarationFile, function (node) { + if (isNodeKindExternalModuleReference(node)) { + // TODO figure out if this branch is possible, and if so, write a test + // that covers it. + const expression = node.expression; + // convert both relative and non-relative module names in import = require(...) + // statements. + const resolved = resolveModuleImport(expression.text); + return ` require('${resolved}')`; + } + else if (node.kind === ts.SyntaxKind.DeclareKeyword) { + return ''; + } + else if (isNodeKindStringLiteral(node) && node.parent && + (isNodeKindExportDeclaration(node.parent) || isNodeKindImportDeclaration(node.parent))) { + // This block of code is modifying the names of imported modules + const text = node.text; + const resolved = resolveModuleImport(text); + if (resolved) { + return ` '${resolved}'`; + } + } + }); + output.write(content.replace(nonEmptyLineStart, '$&' + indent)); + output.write(eol + '}' + eol); + } + else { + output.write(declarationFile.text); + } + } + } + exports.default = generate; +}); + +const prelude = `declare type bool = boolean; +declare type i8 = number; +declare type i16 = number; +declare type i32 = number; +declare type isize = number; +declare type u8 = number; +declare type u16 = number; +declare type u32 = number; +declare type usize = number; +declare type f32 = number; +declare type f64 = number; +declare module 'assemblyscript' { + export * from 'assemblyscript/src/index'; +} +`; + +var path = require("path"); +var fs = require("fs"); +var stdout = fs.createWriteStream(path.resolve(__dirname, "..", "dist", "assemblyscript.d.ts")); +stdout.write(prelude); +stdout.write = (function(_write) { + return function(...args) { + if (typeof args[0] === "string") { + args[0] = args[0].replace(/\/\/\/ ]*>\r?\n/g, ""); + } + return _write.apply(stdout, args); + }; +})(stdout.write); + +module.exports.default({ + project: path.resolve(__dirname, "..", "src"), + prefix: "assemblyscript", + exclude: [ + "glue/js/index.ts", + "glue/js/node.d.ts" + ], + verbose: true, + sendMessage: console.log, + stdout: stdout +}); diff --git a/src/ast.ts b/src/ast.ts index b0fdd9db55..e833ca4400 100644 --- a/src/ast.ts +++ b/src/ast.ts @@ -67,6 +67,7 @@ export enum NodeKind { DO, EMPTY, EXPORT, + EXPORTDEFAULT, EXPORTIMPORT, EXPRESSION, FOR, @@ -687,6 +688,9 @@ export abstract class Node { range.source.normalizedPath ); } else { // absolute + if (!normalizedPath.startsWith(LIBRARY_PREFIX)) { + normalizedPath = LIBRARY_PREFIX + normalizedPath; + } stmt.normalizedPath = normalizedPath; } stmt.internalPath = mangleInternalPath(stmt.normalizedPath); @@ -698,6 +702,16 @@ export abstract class Node { return stmt; } + static createExportDefaultStatement( + declaration: DeclarationStatement, + range: Range + ): ExportDefaultStatement { + var stmt = new ExportDefaultStatement(); + stmt.declaration = declaration; + stmt.range = range; + return stmt; + } + static createExportImportStatement( name: IdentifierExpression, externalName: IdentifierExpression, @@ -782,10 +796,18 @@ export abstract class Node { stmt.declarations = null; stmt.namespaceName = identifier; stmt.path = path; - stmt.normalizedPath = resolvePath( - normalizePath(path.value), - range.source.normalizedPath - ); + var normalizedPath = normalizePath(path.value); + if (path.value.startsWith(".")) { + stmt.normalizedPath = resolvePath( + normalizedPath, + range.source.normalizedPath + ); + } else { + if (!normalizedPath.startsWith(LIBRARY_PREFIX)) { + normalizedPath = LIBRARY_PREFIX + normalizedPath; + } + stmt.normalizedPath = normalizedPath; + } stmt.internalPath = mangleInternalPath(stmt.normalizedPath); return stmt; } @@ -1162,7 +1184,7 @@ export enum DecoratorKind { EXTERNAL, BUILTIN, LAZY, - START + UNSAFE } /** Returns the kind of the specified decorator. Defaults to {@link DecoratorKind.CUSTOM}. */ @@ -1198,11 +1220,11 @@ export function decoratorNameToKind(name: Expression): DecoratorKind { } case CharCode.s: { if (nameStr == "sealed") return DecoratorKind.SEALED; - if (nameStr == "start") return DecoratorKind.START; break; } case CharCode.u: { if (nameStr == "unmanaged") return DecoratorKind.UNMANAGED; + if (nameStr == "unsafe") return DecoratorKind.UNSAFE; break; } } @@ -1762,6 +1784,14 @@ export class ExportStatement extends Statement { isDeclare: bool; } +/** Represents an `export default` statement. */ +export class ExportDefaultStatement extends Statement { + kind = NodeKind.EXPORTDEFAULT; + + /** Declaration being exported as default. */ + declaration: DeclarationStatement; +} + /** Represents an expression that is used as a statement. */ export class ExpressionStatement extends Statement { kind = NodeKind.EXPRESSION; diff --git a/src/builtins.ts b/src/builtins.ts index 580bc858ec..7bd978cebd 100644 --- a/src/builtins.ts +++ b/src/builtins.ts @@ -5,9 +5,9 @@ import { Compiler, - ConversionKind, - WrapMode, - Feature + ContextualFlags, + RuntimeFeatures, + flatten } from "./compiler"; import { @@ -48,22 +48,23 @@ import { getConstValueI64Low, getConstValueI32, getConstValueF32, - getConstValueF64 + getConstValueF64, + Relooper, + RelooperBlockRef } from "./module"; import { ElementKind, - OperatorKind, FunctionPrototype, - Class, Field, Global, DecoratorFlags, - ClassPrototype + Element } from "./program"; import { - FlowFlags + FlowFlags, + LocalFlags } from "./flow"; import { @@ -71,7 +72,9 @@ import { } from "./resolver"; import { - CommonFlags + CommonFlags, + Feature, + TypeinfoFlags } from "./common"; import { @@ -88,6 +91,7 @@ export namespace BuiltinSymbols { // std/builtins.ts export const isInteger = "~lib/builtins/isInteger"; export const isFloat = "~lib/builtins/isFloat"; + export const isBoolean = "~lib/builtins/isBoolean"; export const isSigned = "~lib/builtins/isSigned"; export const isReference = "~lib/builtins/isReference"; export const isString = "~lib/builtins/isString"; @@ -136,8 +140,10 @@ export namespace BuiltinSymbols { export const changetype = "~lib/builtins/changetype"; export const assert = "~lib/builtins/assert"; export const unchecked = "~lib/builtins/unchecked"; + export const call_direct = "~lib/builtins/call_direct"; export const call_indirect = "~lib/builtins/call_indirect"; export const instantiate = "~lib/builtins/instantiate"; + export const idof = "~lib/builtins/idof"; export const i8 = "~lib/builtins/i8"; export const i16 = "~lib/builtins/i16"; @@ -460,18 +466,53 @@ export namespace BuiltinSymbols { export const v8x16_shuffle = "~lib/builtins/v8x16.shuffle"; + // internals + export const heap_base = "~lib/heap/__heap_base"; + export const rtti_base = "~lib/rt/__rtti_base"; + export const visit_globals = "~lib/rt/__visit_globals"; + export const visit_members = "~lib/rt/__visit_members"; + // std/diagnostics.ts export const ERROR = "~lib/diagnostics/ERROR"; export const WARNING = "~lib/diagnostics/WARNING"; export const INFO = "~lib/diagnostics/INFO"; + // std/memory.ts - export const HEAP_BASE = "~lib/memory/HEAP_BASE"; export const memory_size = "~lib/memory/memory.size"; export const memory_grow = "~lib/memory/memory.grow"; export const memory_copy = "~lib/memory/memory.copy"; export const memory_fill = "~lib/memory/memory.fill"; - // std/gc.ts - export const iterateRoots = "~lib/gc/iterateRoots"; + export const memory_allocate = "~lib/memory/memory.allocate"; + export const memory_free = "~lib/memory/memory.free"; + export const memory_reset = "~lib/memory/memory.reset"; + + // std/runtime.ts + export const runtime_instanceof = "~lib/runtime/runtime.instanceof"; + export const runtime_flags = "~lib/runtime/runtime.flags"; + export const runtime_allocate = "~lib/util/runtime/allocate"; + export const runtime_reallocate = "~lib/util/runtime/reallocate"; + export const runtime_register = "~lib/util/runtime/register"; + export const runtime_discard = "~lib/util/runtime/discard"; + export const runtime_makeArray = "~lib/util/runtime/makeArray"; + + // std/typedarray.ts + export const Int8Array = "~lib/typedarray/Int8Array"; + export const Uint8Array = "~lib/typedarray/Uint8Array"; + export const Int16Array = "~lib/typedarray/Int16Array"; + export const Uint16Array = "~lib/typedarray/Uint16Array"; + export const Int32Array = "~lib/typedarray/Int32Array"; + export const Uint32Array = "~lib/typedarray/Uint32Array"; + export const Int64Array = "~lib/typedarray/Int64Array"; + export const Uint64Array = "~lib/typedarray/Uint64Array"; + export const Uint8ClampedArray = "~lib/typedarray/Uint8ClampedArray"; + export const Float32Array = "~lib/typedarray/Float32Array"; + export const Float64Array = "~lib/typedarray/Float64Array"; + + // compiler generated + export const started = "~lib/started"; + export const argc = "~lib/argc"; + export const setargc = "~lib/setargc"; + export const capabilities = "~lib/capabilities"; } /** Compiles a call to a built-in function. */ @@ -501,6 +542,8 @@ export function compileCall( // below, but rather done to make this file easier to work with. If there was a general rule it'd // most likely be "three or more instructions that only differ in their actual opcode". + var directize = false; + switch (prototype.internalName) { // === Static type evaluation ================================================================= @@ -508,144 +551,136 @@ export function compileCall( case BuiltinSymbols.isInteger: { // isInteger() / isInteger(value: T) -> bool let type = evaluateConstantType(compiler, typeArguments, operands, reportNode); compiler.currentType = Type.bool; - if (!type) return module.createUnreachable(); + if (!type) return module.unreachable(); return type.is(TypeFlags.INTEGER) && !type.is(TypeFlags.REFERENCE) - ? module.createI32(1) - : module.createI32(0); + ? module.i32(1) + : module.i32(0); } case BuiltinSymbols.isFloat: { // isFloat() / isFloat(value: T) -> bool let type = evaluateConstantType(compiler, typeArguments, operands, reportNode); compiler.currentType = Type.bool; - if (!type) return module.createUnreachable(); + if (!type) return module.unreachable(); return type.is(TypeFlags.FLOAT) - ? module.createI32(1) - : module.createI32(0); + ? module.i32(1) + : module.i32(0); + } + case BuiltinSymbols.isBoolean: { // isBoolean() / isBoolean(value: T) -> bool + let type = evaluateConstantType(compiler, typeArguments, operands, reportNode); + compiler.currentType = Type.bool; + if (!type) return module.unreachable(); + return type == Type.bool + ? module.i32(1) + : module.i32(0); } case BuiltinSymbols.isSigned: { // isSigned() / isSigned(value: T) -> bool let type = evaluateConstantType(compiler, typeArguments, operands, reportNode); compiler.currentType = Type.bool; - if (!type) return module.createUnreachable(); + if (!type) return module.unreachable(); return type.is(TypeFlags.SIGNED) - ? module.createI32(1) - : module.createI32(0); + ? module.i32(1) + : module.i32(0); } case BuiltinSymbols.isReference: { // isReference() / isReference(value: T) -> bool let type = evaluateConstantType(compiler, typeArguments, operands, reportNode); compiler.currentType = Type.bool; - if (!type) return module.createUnreachable(); + if (!type) return module.unreachable(); return type.is(TypeFlags.REFERENCE) - ? module.createI32(1) - : module.createI32(0); + ? module.i32(1) + : module.i32(0); } case BuiltinSymbols.isString: { // isString() / isString(value: T) -> bool let type = evaluateConstantType(compiler, typeArguments, operands, reportNode); compiler.currentType = Type.bool; - if (!type) return module.createUnreachable(); + if (!type) return module.unreachable(); let classType = type.classReference; if (classType) { let stringInstance = compiler.program.stringInstance; - if (stringInstance && classType.isAssignableTo(stringInstance)) return module.createI32(1); + if (stringInstance && classType.isAssignableTo(stringInstance)) return module.i32(1); } - return module.createI32(0); + return module.i32(0); } case BuiltinSymbols.isArray: { // isArray() / isArray(value: T) -> bool let type = evaluateConstantType(compiler, typeArguments, operands, reportNode); compiler.currentType = Type.bool; - if (!type) return module.createUnreachable(); + if (!type) return module.unreachable(); let classReference = type.classReference; - if (!classReference) return module.createI32(0); + if (!classReference) return module.i32(0); let classPrototype = classReference.prototype; - return module.createI32( - (classPrototype).extends(compiler.program.arrayPrototype) - ? 1 - : 0 - ); + return module.i32(classPrototype.extends(compiler.program.arrayPrototype) ? 1 : 0); } case BuiltinSymbols.isArrayLike: { // isArrayLike() / isArrayLike(value: T) -> bool let type = evaluateConstantType(compiler, typeArguments, operands, reportNode); compiler.currentType = Type.bool; - if (!type) return module.createUnreachable(); + if (!type) return module.unreachable(); let classReference = type.classReference; - if (!classReference) return module.createI32(0); - return module.createI32( - classReference.lookupInSelf("length") && ( - classReference.lookupOverload(OperatorKind.INDEXED_GET) || - classReference.lookupOverload(OperatorKind.UNCHECKED_INDEXED_GET) - ) ? 1 : 0 - ); + if (!classReference) return module.i32(0); + return module.i32(classReference.isArrayLike ? 1 : 0); } case BuiltinSymbols.isFunction: { // isFunction / isFunction(value: T) -> bool let type = evaluateConstantType(compiler, typeArguments, operands, reportNode); compiler.currentType = Type.bool; - if (!type) return module.createUnreachable(); - return module.createI32(type.signatureReference ? 1 : 0); + if (!type) return module.unreachable(); + return module.i32(type.signatureReference ? 1 : 0); } case BuiltinSymbols.isNullable: { // isNullable / isNullable(value: T) -> bool let type = evaluateConstantType(compiler, typeArguments, operands, reportNode); compiler.currentType = Type.bool; - if (!type) return module.createUnreachable(); - return module.createI32(type.is(TypeFlags.NULLABLE) ? 1 : 0); + if (!type) return module.unreachable(); + return module.i32(type.is(TypeFlags.NULLABLE) ? 1 : 0); } case BuiltinSymbols.isDefined: { // isDefined(expression) -> bool compiler.currentType = Type.bool; if ( checkTypeAbsent(typeArguments, reportNode, prototype) | checkArgsRequired(operands, 1, reportNode, compiler) - ) return module.createUnreachable(); + ) return module.unreachable(); let element = compiler.resolver.resolveExpression( operands[0], compiler.currentFlow, Type.void, ReportMode.SWALLOW ); - return module.createI32(element ? 1 : 0); + return module.i32(element ? 1 : 0); } case BuiltinSymbols.isConstant: { // isConstant(expression) -> bool compiler.currentType = Type.bool; if ( checkTypeAbsent(typeArguments, reportNode, prototype) | checkArgsRequired(operands, 1, reportNode, compiler) - ) return module.createUnreachable(); - let expr = compiler.compileExpressionRetainType(operands[0], Type.i32, WrapMode.NONE); + ) return module.unreachable(); + let expr = compiler.compileExpressionRetainType(operands[0], Type.i32); compiler.currentType = Type.bool; - return module.createI32(getExpressionId(expr) == ExpressionId.Const ? 1 : 0); + return module.i32(getExpressionId(expr) == ExpressionId.Const ? 1 : 0); } case BuiltinSymbols.isManaged: { // isManaged() -> bool - if (!compiler.program.hasGC) { - compiler.currentType = Type.bool; - return module.createI32(0); - } let type = evaluateConstantType(compiler, typeArguments, operands, reportNode); compiler.currentType = Type.bool; - if (!type) return module.createUnreachable(); - let classType = type.classReference; - return classType !== null && !classType.hasDecorator(DecoratorFlags.UNMANAGED) - ? module.createI32(1) - : module.createI32(0); + if (!type) return module.unreachable(); + return module.i32(type.isManaged ? 1 : 0); } case BuiltinSymbols.sizeof: { // sizeof() -> usize compiler.currentType = compiler.options.usizeType; if ( checkTypeRequired(typeArguments, reportNode, compiler) | checkArgsRequired(operands, 0, reportNode, compiler) - ) return module.createUnreachable(); + ) return module.unreachable(); let byteSize = (typeArguments)[0].byteSize; let expr: ExpressionRef; if (compiler.options.isWasm64) { // implicitly wrap if contextual type is a 32-bit integer if (contextualType.is(TypeFlags.INTEGER) && contextualType.size <= 32) { compiler.currentType = Type.u32; - expr = module.createI32(byteSize); + expr = module.i32(byteSize); } else { - expr = module.createI64(byteSize, 0); + expr = module.i64(byteSize, 0); } } else { // implicitly extend if contextual type is a 64-bit integer if (contextualType.is(TypeFlags.INTEGER) && contextualType.size == 64) { compiler.currentType = Type.u64; - expr = module.createI64(byteSize, 0); + expr = module.i64(byteSize, 0); } else { - expr = module.createI32(byteSize); + expr = module.i32(byteSize); } } return expr; @@ -655,7 +690,7 @@ export function compileCall( if ( checkTypeRequired(typeArguments, reportNode, compiler) | checkArgsRequired(operands, 0, reportNode, compiler) - ) return module.createUnreachable(); + ) return module.unreachable(); let byteSize = (typeArguments)[0].byteSize; assert(isPowerOf2(byteSize)); let alignLog2 = ctz(byteSize); @@ -664,17 +699,17 @@ export function compileCall( // implicitly wrap if contextual type is a 32-bit integer if (contextualType.is(TypeFlags.INTEGER) && contextualType.size <= 32) { compiler.currentType = Type.u32; - expr = module.createI32(alignLog2); + expr = module.i32(alignLog2); } else { - expr = module.createI64(alignLog2, 0); + expr = module.i64(alignLog2, 0); } } else { // implicitly extend if contextual type is a 64-bit integer if (contextualType.is(TypeFlags.INTEGER) && contextualType.size == 64) { compiler.currentType = Type.u64; - expr = module.createI64(alignLog2, 0); + expr = module.i64(alignLog2, 0); } else { - expr = module.createI32(alignLog2); + expr = module.i32(alignLog2); } } return expr; @@ -684,14 +719,14 @@ export function compileCall( if ( checkTypeRequired(typeArguments, reportNode, compiler) | checkArgsOptional(operands, 0, 1, reportNode, compiler) - ) return module.createUnreachable(); + ) return module.unreachable(); let classType = typeArguments![0].classReference; if (!classType) { compiler.error( DiagnosticCode.Operation_not_supported, reportNode.typeArgumentsRange ); - return module.createUnreachable(); + return module.unreachable(); } let offset: i32; if (operands.length) { @@ -703,7 +738,7 @@ export function compileCall( DiagnosticCode.String_literal_expected, operands[0].range ); - return module.createUnreachable(); + return module.unreachable(); } let fieldName = (operands[0]).value; let field = classType.members ? classType.members.get(fieldName) : null; @@ -712,7 +747,7 @@ export function compileCall( DiagnosticCode.Type_0_has_no_property_1, operands[0].range, classType.internalName, fieldName ); - return module.createUnreachable(); + return module.unreachable(); } offset = (field).memoryOffset; } else { @@ -722,17 +757,17 @@ export function compileCall( // implicitly wrap if contextual type is a 32-bit integer if (contextualType.is(TypeFlags.INTEGER) && contextualType.size <= 32) { compiler.currentType = Type.u32; - return module.createI32(offset); + return module.i32(offset); } else { - return module.createI64(offset); + return module.i64(offset); } } else { // implicitly extend if contextual type is a 64-bit integer if (contextualType.is(TypeFlags.INTEGER) && contextualType.size == 64) { compiler.currentType = Type.u64; - return module.createI64(offset); + return module.i64(offset); } else { - return module.createI32(offset); + return module.i32(offset); } } } @@ -745,17 +780,17 @@ export function compileCall( if ( checkTypeOptional(typeArguments, reportNode, compiler, true) | checkArgsRequired(operands, 1, reportNode, compiler) - ) return module.createUnreachable(); + ) return module.unreachable(); let arg0 = typeArguments - ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP) - : compiler.compileExpression(operands[0], Type.i32, ConversionKind.NONE, WrapMode.WRAP); + ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT | ContextualFlags.WRAP) + : compiler.compileExpression(operands[0], Type.i32, ContextualFlags.WRAP); let type = compiler.currentType; if (type.is(TypeFlags.REFERENCE)) { compiler.error( DiagnosticCode.Operation_not_supported, reportNode.typeArgumentsRange ); - return module.createUnreachable(); + return module.unreachable(); } let op: UnaryOp = -1; switch (prototype.internalName) { @@ -828,27 +863,27 @@ export function compileCall( DiagnosticCode.Operation_not_supported, reportNode.typeArgumentsRange ); - return module.createUnreachable(); + return module.unreachable(); } - return module.createUnary(op, arg0); + return module.unary(op, arg0); } case BuiltinSymbols.rotl: { // rotl(value: T, shift: T) -> T if ( checkTypeOptional(typeArguments, reportNode, compiler, true) | checkArgsRequired(operands, 2, reportNode, compiler) - ) return module.createUnreachable(); + ) return module.unreachable(); let arg0 = typeArguments - ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP) - : compiler.compileExpression(operands[0], Type.i32, ConversionKind.NONE, WrapMode.WRAP); + ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT | ContextualFlags.WRAP) + : compiler.compileExpression(operands[0], Type.i32, ContextualFlags.WRAP); let type = compiler.currentType; if (type.is(TypeFlags.REFERENCE)) { compiler.error( DiagnosticCode.Operation_not_supported, reportNode.typeArgumentsRange ); - return module.createUnreachable(); + return module.unreachable(); } - let arg1 = compiler.compileExpression(operands[1], type, ConversionKind.IMPLICIT, WrapMode.NONE); + let arg1 = compiler.compileExpression(operands[1], type, ContextualFlags.IMPLICIT); let expr: ExpressionRef; switch (type.kind) { case TypeKind.I8: @@ -857,19 +892,19 @@ export function compileCall( case TypeKind.U16: case TypeKind.BOOL: { expr = compiler.ensureSmallIntegerWrap( - module.createBinary(BinaryOp.RotlI32, arg0, arg1), + module.binary(BinaryOp.RotlI32, arg0, arg1), type ); // fall-through } case TypeKind.I32: case TypeKind.U32: { - expr = module.createBinary(BinaryOp.RotlI32, arg0, arg1); + expr = module.binary(BinaryOp.RotlI32, arg0, arg1); break; } case TypeKind.USIZE: case TypeKind.ISIZE: { - expr = module.createBinary( + expr = module.binary( compiler.options.isWasm64 ? BinaryOp.RotlI64 : BinaryOp.RotlI32, @@ -879,7 +914,7 @@ export function compileCall( } case TypeKind.I64: case TypeKind.U64: { - expr = module.createBinary(BinaryOp.RotlI64, arg0, arg1); + expr = module.binary(BinaryOp.RotlI64, arg0, arg1); break; } default: { @@ -887,7 +922,7 @@ export function compileCall( DiagnosticCode.Operation_not_supported, reportNode.typeArgumentsRange ); - expr = module.createUnreachable(); + expr = module.unreachable(); break; } } @@ -897,19 +932,19 @@ export function compileCall( if ( checkTypeOptional(typeArguments, reportNode, compiler, true) | checkArgsRequired(operands, 2, reportNode, compiler) - ) return module.createUnreachable(); + ) return module.unreachable(); let arg0 = typeArguments - ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP) - : compiler.compileExpression(operands[0], Type.i32, ConversionKind.NONE, WrapMode.WRAP); + ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT | ContextualFlags.WRAP) + : compiler.compileExpression(operands[0], Type.i32, ContextualFlags.WRAP); let type = compiler.currentType; if (type.is(TypeFlags.REFERENCE)) { compiler.error( DiagnosticCode.Operation_not_supported, reportNode.typeArgumentsRange ); - return module.createUnreachable(); + return module.unreachable(); } - let arg1 = compiler.compileExpression(operands[1], type, ConversionKind.IMPLICIT, WrapMode.NONE); + let arg1 = compiler.compileExpression(operands[1], type, ContextualFlags.IMPLICIT); let expr: ExpressionRef; switch (type.kind) { case TypeKind.I8: @@ -918,19 +953,19 @@ export function compileCall( case TypeKind.U16: case TypeKind.BOOL: { expr = compiler.ensureSmallIntegerWrap( - module.createBinary(BinaryOp.RotrI32, arg0, arg1), + module.binary(BinaryOp.RotrI32, arg0, arg1), type ); break; } case TypeKind.I32: case TypeKind.U32: { - expr = module.createBinary(BinaryOp.RotrI32, arg0, arg1); + expr = module.binary(BinaryOp.RotrI32, arg0, arg1); break; } case TypeKind.USIZE: case TypeKind.ISIZE: { - expr = module.createBinary( + expr = module.binary( compiler.options.isWasm64 ? BinaryOp.RotrI64 : BinaryOp.RotrI32, @@ -940,7 +975,7 @@ export function compileCall( } case TypeKind.I64: case TypeKind.U64: { - expr = module.createBinary(BinaryOp.RotrI64, arg0, arg1); + expr = module.binary(BinaryOp.RotrI64, arg0, arg1); break; } default: { @@ -948,7 +983,7 @@ export function compileCall( DiagnosticCode.Operation_not_supported, reportNode.typeArgumentsRange ); - expr = module.createUnreachable(); + expr = module.unreachable(); break; } } @@ -958,17 +993,17 @@ export function compileCall( if ( checkTypeOptional(typeArguments, reportNode, compiler, true) | checkArgsRequired(operands, 1, reportNode, compiler) - ) return module.createUnreachable(); + ) return module.unreachable(); let arg0 = typeArguments - ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP) - : compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.WRAP); + ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT | ContextualFlags.WRAP) + : compiler.compileExpression(operands[0], Type.f64, ContextualFlags.WRAP); let type = compiler.currentType; if (type.is(TypeFlags.REFERENCE)) { compiler.error( DiagnosticCode.Operation_not_supported, reportNode.typeArgumentsRange ); - return module.createUnreachable(); + return module.unreachable(); } let expr: ExpressionRef; switch (type.kind) { @@ -978,23 +1013,23 @@ export function compileCall( let flow = compiler.currentFlow; // possibly overflows, e.g. abs(-128) == 128 - let tempLocal1 = flow.getTempLocal(Type.i32, false); - let tempLocalIndex2 = flow.getAndFreeTempLocal(Type.i32, false).index; + let tempLocal1 = flow.getTempLocal(Type.i32); + let tempLocalIndex2 = flow.getAndFreeTempLocal(Type.i32).index; let tempLocalIndex1 = tempLocal1.index; // (x + (x >> 31)) ^ (x >> 31) - expr = module.createBinary(BinaryOp.XorI32, - module.createBinary(BinaryOp.AddI32, - module.createTeeLocal( + expr = module.binary(BinaryOp.XorI32, + module.binary(BinaryOp.AddI32, + module.local_tee( tempLocalIndex2, - module.createBinary(BinaryOp.ShrI32, - module.createTeeLocal(tempLocalIndex1, arg0), - module.createI32(31) + module.binary(BinaryOp.ShrI32, + module.local_tee(tempLocalIndex1, arg0), + module.i32(31) ) ), - module.createGetLocal(tempLocalIndex1, NativeType.I32) + module.local_get(tempLocalIndex1, NativeType.I32) ), - module.createGetLocal(tempLocalIndex2, NativeType.I32) + module.local_get(tempLocalIndex2, NativeType.I32) ); flow.freeTempLocal(tempLocal1); @@ -1005,22 +1040,22 @@ export function compileCall( let flow = compiler.currentFlow; let wasm64 = options.isWasm64; - let tempLocal1 = flow.getTempLocal(options.usizeType, false); - let tempLocalIndex2 = flow.getAndFreeTempLocal(options.usizeType, false).index; + let tempLocal1 = flow.getTempLocal(options.usizeType); + let tempLocalIndex2 = flow.getAndFreeTempLocal(options.usizeType).index; let tempLocalIndex1 = tempLocal1.index; - expr = module.createBinary(wasm64 ? BinaryOp.XorI64 : BinaryOp.XorI32, - module.createBinary(wasm64 ? BinaryOp.AddI64 : BinaryOp.AddI32, - module.createTeeLocal( + expr = module.binary(wasm64 ? BinaryOp.XorI64 : BinaryOp.XorI32, + module.binary(wasm64 ? BinaryOp.AddI64 : BinaryOp.AddI32, + module.local_tee( tempLocalIndex2, - module.createBinary(wasm64 ? BinaryOp.ShrI64 : BinaryOp.ShrI32, - module.createTeeLocal(tempLocalIndex1, arg0), - wasm64 ? module.createI64(63) : module.createI32(31) + module.binary(wasm64 ? BinaryOp.ShrI64 : BinaryOp.ShrI32, + module.local_tee(tempLocalIndex1, arg0), + wasm64 ? module.i64(63) : module.i32(31) ) ), - module.createGetLocal(tempLocalIndex1, options.nativeSizeType) + module.local_get(tempLocalIndex1, options.nativeSizeType) ), - module.createGetLocal(tempLocalIndex2, options.nativeSizeType) + module.local_get(tempLocalIndex2, options.nativeSizeType) ); flow.freeTempLocal(tempLocal1); @@ -1029,23 +1064,23 @@ export function compileCall( case TypeKind.I64: { let flow = compiler.currentFlow; - let tempLocal1 = flow.getTempLocal(Type.i64, false); - let tempLocalIndex2 = flow.getAndFreeTempLocal(Type.i64, false).index; + let tempLocal1 = flow.getTempLocal(Type.i64); + let tempLocalIndex2 = flow.getAndFreeTempLocal(Type.i64).index; let tempLocalIndex1 = tempLocal1.index; // (x + (x >> 63)) ^ (x >> 63) - expr = module.createBinary(BinaryOp.XorI64, - module.createBinary(BinaryOp.AddI64, - module.createTeeLocal( + expr = module.binary(BinaryOp.XorI64, + module.binary(BinaryOp.AddI64, + module.local_tee( tempLocalIndex2, - module.createBinary(BinaryOp.ShrI64, - module.createTeeLocal(tempLocalIndex1, arg0), - module.createI64(63) + module.binary(BinaryOp.ShrI64, + module.local_tee(tempLocalIndex1, arg0), + module.i64(63) ) ), - module.createGetLocal(tempLocalIndex1, NativeType.I64) + module.local_get(tempLocalIndex1, NativeType.I64) ), - module.createGetLocal(tempLocalIndex2, NativeType.I64) + module.local_get(tempLocalIndex2, NativeType.I64) ); flow.freeTempLocal(tempLocal1); @@ -1061,11 +1096,11 @@ export function compileCall( break; } case TypeKind.F32: { - expr = module.createUnary(UnaryOp.AbsF32, arg0); + expr = module.unary(UnaryOp.AbsF32, arg0); break; } case TypeKind.F64: { - expr = module.createUnary(UnaryOp.AbsF64, arg0); + expr = module.unary(UnaryOp.AbsF64, arg0); break; } default: { @@ -1073,7 +1108,7 @@ export function compileCall( DiagnosticCode.Operation_not_supported, reportNode.typeArgumentsRange ); - expr = module.createUnreachable(); + expr = module.unreachable(); break; } } @@ -1083,19 +1118,19 @@ export function compileCall( if ( checkTypeOptional(typeArguments, reportNode, compiler, true) | checkArgsRequired(operands, 2, reportNode, compiler) - ) return module.createUnreachable(); + ) return module.unreachable(); let arg0 = typeArguments - ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP) - : compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.WRAP); + ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT | ContextualFlags.WRAP) + : compiler.compileExpression(operands[0], Type.f64, ContextualFlags.WRAP); let type = compiler.currentType; if (type.is(TypeFlags.REFERENCE)) { compiler.error( DiagnosticCode.Operation_not_supported, reportNode.typeArgumentsRange ); - return module.createUnreachable(); + return module.unreachable(); } - let arg1 = compiler.compileExpression(operands[1], type, ConversionKind.IMPLICIT, WrapMode.WRAP); + let arg1 = compiler.compileExpression(operands[1], type, ContextualFlags.IMPLICIT | ContextualFlags.WRAP); let op: BinaryOp; switch (type.kind) { case TypeKind.I8: @@ -1120,30 +1155,32 @@ export function compileCall( break; } case TypeKind.F32: { - return module.createBinary(BinaryOp.MaxF32, arg0, arg1); + return module.binary(BinaryOp.MaxF32, arg0, arg1); } case TypeKind.F64: { - return module.createBinary(BinaryOp.MaxF64, arg0, arg1); + return module.binary(BinaryOp.MaxF64, arg0, arg1); } default: { compiler.error( DiagnosticCode.Operation_not_supported, reportNode.typeArgumentsRange ); - return module.createUnreachable(); + return module.unreachable(); } } let flow = compiler.currentFlow; let nativeType = type.toNativeType(); - let tempLocal0 = flow.getTempLocal(type, true); - let tempLocal1 = flow.getAndFreeTempLocal(type, true); + let tempLocal0 = flow.getTempLocal(type); + flow.setLocalFlag(tempLocal0.index, LocalFlags.WRAPPED); + let tempLocal1 = flow.getAndFreeTempLocal(type); + flow.setLocalFlag(tempLocal1.index, LocalFlags.WRAPPED); flow.freeTempLocal(tempLocal0); - return module.createSelect( - module.createTeeLocal(tempLocal0.index, arg0), - module.createTeeLocal(tempLocal1.index, arg1), - module.createBinary(op, - module.createGetLocal(tempLocal0.index, nativeType), - module.createGetLocal(tempLocal1.index, nativeType) + return module.select( + module.local_tee(tempLocal0.index, arg0), + module.local_tee(tempLocal1.index, arg1), + module.binary(op, + module.local_get(tempLocal0.index, nativeType), + module.local_get(tempLocal1.index, nativeType) ) ); } @@ -1151,19 +1188,19 @@ export function compileCall( if ( checkTypeOptional(typeArguments, reportNode, compiler, true) | checkArgsRequired(operands, 2, reportNode, compiler) - ) return module.createUnreachable(); + ) return module.unreachable(); let arg0 = typeArguments - ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP) - : compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.WRAP); + ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT | ContextualFlags.WRAP) + : compiler.compileExpression(operands[0], Type.f64, ContextualFlags.WRAP); let type = compiler.currentType; if (type.is(TypeFlags.REFERENCE)) { compiler.error( DiagnosticCode.Operation_not_supported, reportNode.typeArgumentsRange ); - return module.createUnreachable(); + return module.unreachable(); } - let arg1 = compiler.compileExpression(operands[1], type, ConversionKind.IMPLICIT, WrapMode.WRAP); + let arg1 = compiler.compileExpression(operands[1], type, ContextualFlags.IMPLICIT | ContextualFlags.WRAP); let op: BinaryOp; switch (type.kind) { case TypeKind.I8: @@ -1188,30 +1225,32 @@ export function compileCall( break; } case TypeKind.F32: { - return module.createBinary(BinaryOp.MinF32, arg0, arg1); + return module.binary(BinaryOp.MinF32, arg0, arg1); } case TypeKind.F64: { - return module.createBinary(BinaryOp.MinF64, arg0, arg1); + return module.binary(BinaryOp.MinF64, arg0, arg1); } default: { compiler.error( DiagnosticCode.Operation_not_supported, reportNode.typeArgumentsRange ); - return module.createUnreachable(); + return module.unreachable(); } } let flow = compiler.currentFlow; let nativeType = type.toNativeType(); - let tempLocal0 = flow.getTempLocal(type, true); - let tempLocal1 = flow.getAndFreeTempLocal(type, true); + let tempLocal0 = flow.getTempLocal(type); + flow.setLocalFlag(tempLocal0.index, LocalFlags.WRAPPED); + let tempLocal1 = flow.getAndFreeTempLocal(type); + flow.setLocalFlag(tempLocal1.index, LocalFlags.WRAPPED); flow.freeTempLocal(tempLocal0); - return module.createSelect( - module.createTeeLocal(tempLocal0.index, arg0), - module.createTeeLocal(tempLocal1.index, arg1), - module.createBinary(op, - module.createGetLocal(tempLocal0.index, nativeType), - module.createGetLocal(tempLocal1.index, nativeType) + return module.select( + module.local_tee(tempLocal0.index, arg0), + module.local_tee(tempLocal1.index, arg1), + module.binary(op, + module.local_get(tempLocal0.index, nativeType), + module.local_get(tempLocal1.index, nativeType) ) ); } @@ -1220,17 +1259,17 @@ export function compileCall( if ( checkTypeOptional(typeArguments, reportNode, compiler, true) | checkArgsRequired(operands, 1, reportNode, compiler) - ) return module.createUnreachable(); + ) return module.unreachable(); let arg0 = typeArguments - ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.NONE) - : compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.NONE); + ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT) + : compiler.compileExpression(operands[0], Type.f64, ContextualFlags.NONE); let type = compiler.currentType; if (type.is(TypeFlags.REFERENCE)) { compiler.error( DiagnosticCode.Operation_not_supported, reportNode.typeArgumentsRange ); - return module.createUnreachable(); + return module.unreachable(); } let op: UnaryOp; switch (type.kind) { @@ -1262,28 +1301,28 @@ export function compileCall( DiagnosticCode.Operation_not_supported, reportNode.typeArgumentsRange ); - return module.createUnreachable(); + return module.unreachable(); } } - return module.createUnary(op, arg0); + return module.unary(op, arg0); } case BuiltinSymbols.copysign: { // copysign(left: T, right: T) -> T if ( checkTypeOptional(typeArguments, reportNode, compiler, true) | checkArgsRequired(operands, 2, reportNode, compiler) - ) return module.createUnreachable(); + ) return module.unreachable(); let arg0 = typeArguments - ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.NONE) - : compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.NONE); + ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT) + : compiler.compileExpression(operands[0], Type.f64, ContextualFlags.NONE); let type = compiler.currentType; if (type.is(TypeFlags.REFERENCE)) { compiler.error( DiagnosticCode.Operation_not_supported, reportNode.typeArgumentsRange ); - return module.createUnreachable(); + return module.unreachable(); } - let arg1 = compiler.compileExpression(operands[1], type, ConversionKind.IMPLICIT, WrapMode.NONE); + let arg1 = compiler.compileExpression(operands[1], type, ContextualFlags.IMPLICIT); let op: BinaryOp; switch (type.kind) { // TODO: does an integer version make sense? @@ -1294,26 +1333,26 @@ export function compileCall( DiagnosticCode.Operation_not_supported, reportNode.typeArgumentsRange ); - return module.createUnreachable(); + return module.unreachable(); } } - return module.createBinary(op, arg0, arg1); + return module.binary(op, arg0, arg1); } case BuiltinSymbols.nearest: { // nearest(value: T) -> T if ( checkTypeOptional(typeArguments, reportNode, compiler, true) | checkArgsRequired(operands, 1, reportNode, compiler) - ) return module.createUnreachable(); + ) return module.unreachable(); let arg0 = typeArguments - ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.NONE) - : compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.NONE); + ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT) + : compiler.compileExpression(operands[0], Type.f64, ContextualFlags.NONE); let type = compiler.currentType; if (type.is(TypeFlags.REFERENCE)) { compiler.error( DiagnosticCode.Operation_not_supported, reportNode.typeArgumentsRange ); - return module.createUnreachable(); + return module.unreachable(); } let expr: ExpressionRef; switch (type.kind) { @@ -1332,11 +1371,11 @@ export function compileCall( break; } case TypeKind.F32: { - expr = module.createUnary(UnaryOp.NearestF32, arg0); + expr = module.unary(UnaryOp.NearestF32, arg0); break; } case TypeKind.F64: { - expr = module.createUnary(UnaryOp.NearestF64, arg0); + expr = module.unary(UnaryOp.NearestF64, arg0); break; } default: { @@ -1344,7 +1383,7 @@ export function compileCall( DiagnosticCode.Operation_not_supported, reportNode.typeArgumentsRange ); - expr = module.createUnreachable(); + expr = module.unreachable(); break; } } @@ -1354,7 +1393,7 @@ export function compileCall( if ( checkTypeRequired(typeArguments, reportNode, compiler, true) | checkArgsRequired(operands, 1, reportNode, compiler) - ) return module.createUnreachable(); + ) return module.unreachable(); let type = typeArguments![0]; if (type.is(TypeFlags.REFERENCE)) { compiler.currentType = type; @@ -1362,33 +1401,31 @@ export function compileCall( DiagnosticCode.Operation_not_supported, reportNode.typeArgumentsRange ); - return module.createUnreachable(); + return module.unreachable(); } let expr: ExpressionRef; switch (type.kind) { case TypeKind.I32: case TypeKind.U32: { - let arg0 = compiler.compileExpression(operands[0], Type.f32, ConversionKind.IMPLICIT, WrapMode.NONE); - expr = module.createUnary(UnaryOp.ReinterpretF32, arg0); + let arg0 = compiler.compileExpression(operands[0], Type.f32, ContextualFlags.IMPLICIT); + expr = module.unary(UnaryOp.ReinterpretF32, arg0); break; } case TypeKind.I64: case TypeKind.U64: { - let arg0 = compiler.compileExpression(operands[0], Type.f64, ConversionKind.IMPLICIT, WrapMode.NONE); - expr = module.createUnary(UnaryOp.ReinterpretF64, arg0); + let arg0 = compiler.compileExpression(operands[0], Type.f64, ContextualFlags.IMPLICIT); + expr = module.unary(UnaryOp.ReinterpretF64, arg0); break; } case TypeKind.ISIZE: case TypeKind.USIZE: { - let arg0 = compiler.compileExpression( - operands[0], + let arg0 = compiler.compileExpression(operands[0], compiler.options.isWasm64 ? Type.f64 : Type.f32, - ConversionKind.IMPLICIT, - WrapMode.NONE + ContextualFlags.IMPLICIT ); - expr = module.createUnary( + expr = module.unary( compiler.options.isWasm64 ? UnaryOp.ReinterpretF64 : UnaryOp.ReinterpretF32, @@ -1397,13 +1434,13 @@ export function compileCall( break; } case TypeKind.F32: { - let arg0 = compiler.compileExpression(operands[0], Type.i32, ConversionKind.IMPLICIT, WrapMode.NONE); - expr = module.createUnary(UnaryOp.ReinterpretI32, arg0); + let arg0 = compiler.compileExpression(operands[0], Type.i32, ContextualFlags.IMPLICIT); + expr = module.unary(UnaryOp.ReinterpretI32, arg0); break; } case TypeKind.F64: { - let arg0 = compiler.compileExpression(operands[0], Type.i64, ConversionKind.IMPLICIT, WrapMode.NONE); - expr = module.createUnary(UnaryOp.ReinterpretI64, arg0); + let arg0 = compiler.compileExpression(operands[0], Type.i64, ContextualFlags.IMPLICIT); + expr = module.unary(UnaryOp.ReinterpretI64, arg0); break; } default: { @@ -1411,7 +1448,7 @@ export function compileCall( DiagnosticCode.Operation_not_supported, reportNode.typeArgumentsRange ); - expr = module.createUnreachable(); + expr = module.unreachable(); break; } } @@ -1422,10 +1459,10 @@ export function compileCall( if ( checkTypeOptional(typeArguments, reportNode, compiler, true) | checkArgsRequired(operands, 1, reportNode, compiler) - ) return module.createUnreachable(); + ) return module.unreachable(); let arg0 = typeArguments - ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.NONE) - : compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.NONE); + ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT) + : compiler.compileExpression(operands[0], Type.f64, ContextualFlags.NONE); let type = compiler.currentType; if (type.is(TypeFlags.REFERENCE)) { compiler.currentType = type; @@ -1433,16 +1470,16 @@ export function compileCall( DiagnosticCode.Operation_not_supported, reportNode.typeArgumentsRange ); - return module.createUnreachable(); + return module.unreachable(); } let expr: ExpressionRef; switch (type.kind) { // TODO: integer versions (that return f64 or convert)? case TypeKind.F32: { - expr = module.createUnary(UnaryOp.SqrtF32, arg0); + expr = module.unary(UnaryOp.SqrtF32, arg0); break; } case TypeKind.F64: { - expr = module.createUnary(UnaryOp.SqrtF64, arg0); + expr = module.unary(UnaryOp.SqrtF64, arg0); break; } default: { @@ -1450,7 +1487,7 @@ export function compileCall( DiagnosticCode.Operation_not_supported, reportNode.typeArgumentsRange ); - expr = module.createUnreachable(); + expr = module.unreachable(); break; } } @@ -1460,17 +1497,17 @@ export function compileCall( if ( checkTypeOptional(typeArguments, reportNode, compiler, true) | checkArgsRequired(operands, 1, reportNode, compiler) - ) return module.createUnreachable(); + ) return module.unreachable(); let arg0 = typeArguments - ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.NONE) - : compiler.compileExpression(operands[0], Type.f64, ConversionKind.NONE, WrapMode.NONE); + ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT) + : compiler.compileExpression(operands[0], Type.f64, ContextualFlags.NONE); let type = compiler.currentType; if (type.is(TypeFlags.REFERENCE)) { compiler.error( DiagnosticCode.Operation_not_supported, reportNode.range ); - return module.createUnreachable(); + return module.unreachable(); } let expr: ExpressionRef; switch (type.kind) { @@ -1490,11 +1527,11 @@ export function compileCall( } // TODO: truncate to contextual type directly (if not void etc.)? case TypeKind.F32: { - expr = module.createUnary(UnaryOp.TruncF32, arg0); + expr = module.unary(UnaryOp.TruncF32, arg0); break; } case TypeKind.F64: { - expr = module.createUnary(UnaryOp.TruncF64, arg0); + expr = module.unary(UnaryOp.TruncF64, arg0); break; } default: { @@ -1502,7 +1539,7 @@ export function compileCall( DiagnosticCode.Operation_not_supported, reportNode.typeArgumentsRange ); - expr = module.createUnreachable(); + expr = module.unreachable(); break; } } @@ -1515,24 +1552,22 @@ export function compileCall( if ( checkTypeRequired(typeArguments, reportNode, compiler, true) | checkArgsOptional(operands, 1, 3, reportNode, compiler) - ) return module.createUnreachable(); + ) return module.unreachable(); let type = typeArguments![0]; let outType = ( type.is(TypeFlags.INTEGER) && contextualType.is(TypeFlags.INTEGER) && contextualType.size > type.size ) ? contextualType : type; - let arg0 = compiler.compileExpression( - operands[0], + let arg0 = compiler.compileExpression(operands[0], compiler.options.usizeType, - ConversionKind.IMPLICIT, - WrapMode.NONE + ContextualFlags.IMPLICIT ); let numOperands = operands.length; let immOffset = numOperands >= 2 ? evaluateImmediateOffset(operands[1], compiler) : 0; // reports if (immOffset < 0) { compiler.currentType = outType; - return module.createUnreachable(); + return module.unreachable(); } let immAlign: i32; let naturalAlign = type.byteSize; @@ -1540,7 +1575,7 @@ export function compileCall( immAlign = evaluateImmediateOffset(operands[2], compiler); if (immAlign < 0) { compiler.currentType = outType; - return module.createUnreachable(); + return module.unreachable(); } if (immAlign > naturalAlign) { compiler.error( @@ -1548,7 +1583,7 @@ export function compileCall( operands[2].range, "Alignment", "0", naturalAlign.toString() ); compiler.currentType = outType; - return module.createUnreachable(); + return module.unreachable(); } if (!isPowerOf2(immAlign)) { compiler.error( @@ -1556,13 +1591,13 @@ export function compileCall( operands[2].range, "Alignment" ); compiler.currentType = outType; - return module.createUnreachable(); + return module.unreachable(); } } else { immAlign = naturalAlign; } compiler.currentType = outType; - return module.createLoad( + return module.load( type.byteSize, type.is(TypeFlags.SIGNED | TypeFlags.INTEGER), arg0, @@ -1576,28 +1611,23 @@ export function compileCall( if ( checkTypeRequired(typeArguments, reportNode, compiler) | checkArgsOptional(operands, 2, 4, reportNode, compiler) - ) return module.createUnreachable(); + ) return module.unreachable(); let type = typeArguments![0]; - let arg0 = compiler.compileExpression( - operands[0], + let arg0 = compiler.compileExpression(operands[0], compiler.options.usizeType, - ConversionKind.IMPLICIT, - WrapMode.NONE + ContextualFlags.IMPLICIT ); let arg1 = isAsm - ? compiler.compileExpression( - operands[1], + ? compiler.compileExpression(operands[1], contextualType, - ConversionKind.IMPLICIT, - WrapMode.NONE + ContextualFlags.IMPLICIT ) : compiler.compileExpression( operands[1], type, type.is(TypeFlags.INTEGER) - ? ConversionKind.NONE // no need to convert to small int (but now might result in a float) - : ConversionKind.IMPLICIT, - WrapMode.NONE + ? ContextualFlags.NONE // no need to convert to small int (but now might result in a float) + : ContextualFlags.IMPLICIT ); let inType = compiler.currentType; if ( @@ -1607,11 +1637,9 @@ export function compileCall( inType.size < type.size // int to larger int (clear garbage bits) ) ) { - arg1 = compiler.convertExpression( - arg1, + arg1 = compiler.convertExpression(arg1, inType, type, - ConversionKind.IMPLICIT, - WrapMode.NONE, // still clears garbage bits + false, false, // still clears garbage bits when not wrapping operands[1] ); inType = type; @@ -1619,7 +1647,7 @@ export function compileCall( let immOffset = operands.length >= 3 ? evaluateImmediateOffset(operands[2], compiler) : 0; // reports if (immOffset < 0) { compiler.currentType = Type.void; - return module.createUnreachable(); + return module.unreachable(); } let immAlign: i32; let naturalAlign = type.byteSize; @@ -1627,7 +1655,7 @@ export function compileCall( immAlign = evaluateImmediateOffset(operands[3], compiler); if (immAlign < 0) { compiler.currentType = Type.void; - return module.createUnreachable(); + return module.unreachable(); } if (immAlign > naturalAlign) { compiler.error( @@ -1635,7 +1663,7 @@ export function compileCall( operands[3].range, "Alignment", "0", naturalAlign.toString() ); compiler.currentType = Type.void; - return module.createUnreachable(); + return module.unreachable(); } if (!isPowerOf2(immAlign)) { compiler.error( @@ -1643,13 +1671,13 @@ export function compileCall( operands[3].range, "Alignment" ); compiler.currentType = Type.void; - return module.createUnreachable(); + return module.unreachable(); } } else { immAlign = naturalAlign; } compiler.currentType = Type.void; - return module.createStore(type.byteSize, arg0, arg1, inType.toNativeType(), immOffset, immAlign); + return module.store(type.byteSize, arg0, arg1, inType.toNativeType(), immOffset, immAlign); } // === Atomics ================================================================================ @@ -1659,7 +1687,7 @@ export function compileCall( if ( checkTypeRequired(typeArguments, reportNode, compiler, true) | checkArgsOptional(operands, 1, 2, reportNode, compiler) - ) return module.createUnreachable(); + ) return module.unreachable(); let type = typeArguments![0]; let outType = ( type.is(TypeFlags.INTEGER) && @@ -1672,21 +1700,19 @@ export function compileCall( reportNode.typeArgumentsRange ); compiler.currentType = outType; - return module.createUnreachable(); + return module.unreachable(); } - let arg0 = compiler.compileExpression( - operands[0], + let arg0 = compiler.compileExpression(operands[0], compiler.options.usizeType, - ConversionKind.IMPLICIT, - WrapMode.NONE + ContextualFlags.IMPLICIT ); let immOffset = operands.length == 2 ? evaluateImmediateOffset(operands[1], compiler) : 0; // reports if (immOffset < 0) { compiler.currentType = outType; - return module.createUnreachable(); + return module.unreachable(); } compiler.currentType = outType; - return module.createAtomicLoad( + return module.atomic_load( type.byteSize, arg0, outType.toNativeType(), @@ -1699,35 +1725,31 @@ export function compileCall( if ( checkTypeRequired(typeArguments, reportNode, compiler) | checkArgsOptional(operands, 2, 3, reportNode, compiler) - ) return module.createUnreachable(); + ) return module.unreachable(); let type = typeArguments![0]; if (!type.is(TypeFlags.INTEGER) || type.size < 8) { compiler.error( DiagnosticCode.Operation_not_supported, reportNode.typeArgumentsRange ); - return module.createUnreachable(); + return module.unreachable(); } - let arg0 = compiler.compileExpression( - operands[0], + let arg0 = compiler.compileExpression(operands[0], compiler.options.usizeType, - ConversionKind.IMPLICIT, - WrapMode.NONE + ContextualFlags.IMPLICIT ); let arg1 = isAsm ? compiler.compileExpression( operands[1], contextualType, - ConversionKind.IMPLICIT, - WrapMode.NONE + ContextualFlags.IMPLICIT ) : compiler.compileExpression( operands[1], type, type.is(TypeFlags.INTEGER) - ? ConversionKind.NONE // no need to convert to small int (but now might result in a float) - : ConversionKind.IMPLICIT, - WrapMode.NONE + ? ContextualFlags.NONE // no need to convert to small int (but now might result in a float) + : ContextualFlags.IMPLICIT ); let inType = compiler.currentType; if ( @@ -1737,11 +1759,9 @@ export function compileCall( inType.size < type.size // int to larger int (clear garbage bits) ) ) { - arg1 = compiler.convertExpression( - arg1, + arg1 = compiler.convertExpression(arg1, inType, type, - ConversionKind.IMPLICIT, - WrapMode.NONE, // still clears garbage bits + false, false, // still clears garbage bits when not wrapping operands[1] ); inType = type; @@ -1749,10 +1769,10 @@ export function compileCall( let immOffset = operands.length == 3 ? evaluateImmediateOffset(operands[2], compiler) : 0; // reports if (immOffset < 0) { compiler.currentType = Type.void; - return module.createUnreachable(); + return module.unreachable(); } compiler.currentType = Type.void; - return module.createAtomicStore(type.byteSize, arg0, arg1, inType.toNativeType(), immOffset); + return module.atomic_store(type.byteSize, arg0, arg1, inType.toNativeType(), immOffset); } case BuiltinSymbols.atomic_add: // any_atomic_binary(ptr, value: T, immOffset?: usize) -> T case BuiltinSymbols.atomic_sub: @@ -1764,35 +1784,30 @@ export function compileCall( if ( checkTypeRequired(typeArguments, reportNode, compiler, true) | checkArgsOptional(operands, 2, 3, reportNode, compiler) - ) return module.createUnreachable(); + ) return module.unreachable(); let type = typeArguments![0]; if (!type.is(TypeFlags.INTEGER) || type.size < 8) { compiler.error( DiagnosticCode.Operation_not_supported, reportNode.typeArgumentsRange ); - return module.createUnreachable(); + return module.unreachable(); } - let arg0 = compiler.compileExpression( - operands[0], + let arg0 = compiler.compileExpression(operands[0], compiler.options.usizeType, - ConversionKind.IMPLICIT, - WrapMode.NONE + ContextualFlags.IMPLICIT ); let arg1 = isAsm - ? compiler.compileExpression( - operands[1], + ? compiler.compileExpression(operands[1], contextualType, - ConversionKind.IMPLICIT, - WrapMode.NONE + ContextualFlags.IMPLICIT ) : compiler.compileExpression( operands[1], type, type.is(TypeFlags.INTEGER) - ? ConversionKind.NONE // no need to convert to small int (but now might result in a float) - : ConversionKind.IMPLICIT, - WrapMode.NONE + ? ContextualFlags.NONE // no need to convert to small int (but now might result in a float) + : ContextualFlags.IMPLICIT ); let inType = compiler.currentType; if ( @@ -1802,11 +1817,9 @@ export function compileCall( inType.size < type.size // int to larger int (clear garbage bits) ) ) { - arg1 = compiler.convertExpression( - arg1, + arg1 = compiler.convertExpression(arg1, inType, type, - ConversionKind.IMPLICIT, - WrapMode.NONE, // still clears garbage bits + false, false, // still clears garbage bits when not wrapping operands[1] ); inType = type; @@ -1814,7 +1827,7 @@ export function compileCall( let immOffset = operands.length == 3 ? evaluateImmediateOffset(operands[2], compiler) : 0; // reports if (immOffset < 0) { compiler.currentType = inType; - return module.createUnreachable(); + return module.unreachable(); } let op: AtomicRMWOp; switch (prototype.internalName) { @@ -1827,7 +1840,7 @@ export function compileCall( case BuiltinSymbols.atomic_xchg: { op = AtomicRMWOp.Xchg; break; } } compiler.currentType = inType; - return module.createAtomicRMW( + return module.atomic_rmw( op, type.byteSize, immOffset, arg0, arg1, inType.toNativeType() ); } @@ -1836,42 +1849,35 @@ export function compileCall( if ( checkTypeRequired(typeArguments, reportNode, compiler, true) | checkArgsOptional(operands, 3, 4, reportNode, compiler) - ) return module.createUnreachable(); + ) return module.unreachable(); let type = typeArguments![0]; if (!type.is(TypeFlags.INTEGER) || type.size < 8) { compiler.error( DiagnosticCode.Operation_not_supported, reportNode.typeArgumentsRange ); - return module.createUnreachable(); + return module.unreachable(); } - let arg0 = compiler.compileExpression( - operands[0], + let arg0 = compiler.compileExpression(operands[0], compiler.options.usizeType, - ConversionKind.IMPLICIT, - WrapMode.NONE + ContextualFlags.IMPLICIT ); let arg1 = isAsm - ? compiler.compileExpression( - operands[1], + ? compiler.compileExpression(operands[1], contextualType, - ConversionKind.IMPLICIT, - WrapMode.NONE + ContextualFlags.IMPLICIT ) : compiler.compileExpression( operands[1], type, type.is(TypeFlags.INTEGER) - ? ConversionKind.NONE // no need to convert to small int (but now might result in a float) - : ConversionKind.IMPLICIT, - WrapMode.NONE + ? ContextualFlags.NONE // no need to convert to small int (but now might result in a float) + : ContextualFlags.IMPLICIT ); let inType = compiler.currentType; - let arg2 = compiler.compileExpression( - operands[2], + let arg2 = compiler.compileExpression(operands[2], inType, - ConversionKind.IMPLICIT, - WrapMode.NONE + ContextualFlags.IMPLICIT ); if ( type.is(TypeFlags.INTEGER) && @@ -1880,18 +1886,14 @@ export function compileCall( inType.size < type.size // int to larger int (clear garbage bits) ) ) { - arg1 = compiler.convertExpression( - arg1, + arg1 = compiler.convertExpression(arg1, inType, type, - ConversionKind.IMPLICIT, - WrapMode.NONE, // still clears garbage bits + false, false, // still clears garbage bits when not wrapping operands[1] ); - arg2 = compiler.convertExpression( - arg2, + arg2 = compiler.convertExpression(arg2, inType, type, - ConversionKind.IMPLICIT, - WrapMode.NONE, // still clears garbage bits + false, false, // still clears garbage bits when not wrapping operands[2] ); inType = type; @@ -1899,10 +1901,10 @@ export function compileCall( let immOffset = operands.length == 4 ? evaluateImmediateOffset(operands[3], compiler) : 0; // reports if (immOffset < 0) { compiler.currentType = inType; - return module.createUnreachable(); + return module.unreachable(); } compiler.currentType = inType; - return module.createAtomicCmpxchg( + return module.atomic_cmpxchg( type.byteSize, immOffset, arg0, arg1, arg2, inType.toNativeType() ); } @@ -1912,35 +1914,28 @@ export function compileCall( if ( checkTypeRequired(typeArguments, reportNode, compiler) | checkArgsRequired(operands, 3, reportNode, compiler) - ) return module.createUnreachable(); + ) return module.unreachable(); let type = typeArguments![0]; if (!type.is(TypeFlags.INTEGER) || type.size < 32) { compiler.error( DiagnosticCode.Operation_not_supported, reportNode.typeArgumentsRange ); - return module.createUnreachable(); + return module.unreachable(); } - let arg0 = compiler.compileExpression( - operands[0], + let arg0 = compiler.compileExpression(operands[0], compiler.options.usizeType, - ConversionKind.IMPLICIT, - WrapMode.NONE + ContextualFlags.IMPLICIT ); - let arg1 = compiler.compileExpression( - operands[1], - type, - ConversionKind.IMPLICIT, - WrapMode.NONE + let arg1 = compiler.compileExpression(operands[1], type, + ContextualFlags.IMPLICIT ); - let arg2 = compiler.compileExpression( - operands[2], + let arg2 = compiler.compileExpression(operands[2], Type.i64, - ConversionKind.IMPLICIT, - WrapMode.NONE + ContextualFlags.IMPLICIT ); compiler.currentType = Type.i32; - return module.createAtomicWait(arg0, arg1, arg2, type.toNativeType()); + return module.atomic_wait(arg0, arg1, arg2, type.toNativeType()); } case BuiltinSymbols.atomic_notify: { // notify(ptr: usize, count: i32): i32; if (!compiler.options.hasFeature(Feature.THREADS)) break; @@ -1948,21 +1943,17 @@ export function compileCall( if ( checkTypeAbsent(typeArguments, reportNode, prototype) | checkArgsRequired(operands, 2, reportNode, compiler) - ) return module.createUnreachable(); - let arg0 = compiler.compileExpression( - operands[0], + ) return module.unreachable(); + let arg0 = compiler.compileExpression(operands[0], compiler.options.usizeType, - ConversionKind.IMPLICIT, - WrapMode.NONE + ContextualFlags.IMPLICIT ); - let arg1 = compiler.compileExpression( - operands[1], + let arg1 = compiler.compileExpression(operands[1], Type.i32, - ConversionKind.IMPLICIT, - WrapMode.NONE + ContextualFlags.IMPLICIT ); compiler.currentType = Type.i32; - return module.createAtomicNotify(arg0, arg1); + return module.atomic_notify(arg0, arg1); } // === Control flow =========================================================================== @@ -1971,25 +1962,25 @@ export function compileCall( if ( checkTypeOptional(typeArguments, reportNode, compiler, true) | checkArgsRequired(operands, 3, reportNode, compiler) - ) return module.createUnreachable(); + ) return module.unreachable(); let arg0 = typeArguments - ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.NONE) - : compiler.compileExpressionRetainType(operands[0], Type.i32, WrapMode.NONE); + ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT) + : compiler.compileExpressionRetainType(operands[0], Type.i32); let type = compiler.currentType; if (!type.isAny(TypeFlags.VALUE | TypeFlags.REFERENCE)) { compiler.error( DiagnosticCode.Operation_not_supported, reportNode.typeArgumentsRange ); - return module.createUnreachable(); + return module.unreachable(); } - let arg1 = compiler.compileExpression(operands[1], type, ConversionKind.IMPLICIT, WrapMode.NONE); + let arg1 = compiler.compileExpression(operands[1], type, ContextualFlags.IMPLICIT); let arg2 = compiler.makeIsTrueish( - compiler.compileExpressionRetainType(operands[2], Type.bool, WrapMode.NONE), + compiler.compileExpressionRetainType(operands[2], Type.bool), compiler.currentType // ^ ); compiler.currentType = type; - return module.createSelect(arg0, arg1, arg2); + return module.select(arg0, arg1, arg2); } case BuiltinSymbols.unreachable: { // unreachable() -> * if (typeArguments) { @@ -1999,7 +1990,7 @@ export function compileCall( ); } checkArgsRequired(operands, 0, reportNode, compiler); - return module.createUnreachable(); + return module.unreachable(); } // === Memory ================================================================================= @@ -2009,17 +2000,17 @@ export function compileCall( if ( checkTypeAbsent(typeArguments, reportNode, prototype) | checkArgsRequired(operands, 0, reportNode, compiler) - ) return module.createUnreachable(); - return module.createHost(HostOp.CurrentMemory); + ) return module.unreachable(); + return module.host(HostOp.MemorySize); } case BuiltinSymbols.memory_grow: { // memory.grow(pages: i32) -> i32 compiler.currentType = Type.i32; if ( checkTypeAbsent(typeArguments, reportNode, prototype) | checkArgsRequired(operands, 1, reportNode, compiler) - ) return module.createUnreachable(); - return module.createHost(HostOp.GrowMemory, null, [ - compiler.compileExpression(operands[0], Type.i32, ConversionKind.IMPLICIT, WrapMode.NONE) + ) return module.unreachable(); + return module.host(HostOp.MemoryGrow, null, [ + compiler.compileExpression(operands[0], Type.i32, ContextualFlags.IMPLICIT) ]); } case BuiltinSymbols.memory_copy: { // memory.copy(dest: usize, src: usize: n: usize) -> void @@ -2027,68 +2018,38 @@ export function compileCall( if ( checkTypeAbsent(typeArguments, reportNode, prototype) | checkArgsRequired(operands, 3, reportNode, compiler) - ) return module.createUnreachable(); + ) return module.unreachable(); if (!compiler.options.hasFeature(Feature.BULK_MEMORY)) { let instance = compiler.resolver.resolveFunction(prototype, null); // reports compiler.currentType = Type.void; - if (!instance) return module.createUnreachable(); + if (!instance) return module.unreachable(); return compiler.compileCallDirect(instance, operands, reportNode); } let usizeType = compiler.options.usizeType; - let arg0 = compiler.compileExpression( - operands[0], - usizeType, - ConversionKind.IMPLICIT, - WrapMode.NONE - ); - let arg1 = compiler.compileExpression( - operands[1], - usizeType, - ConversionKind.IMPLICIT, - WrapMode.NONE - ); - let arg2 = compiler.compileExpression( - operands[2], - usizeType, - ConversionKind.IMPLICIT, - WrapMode.NONE - ); + let arg0 = compiler.compileExpression(operands[0], usizeType, ContextualFlags.IMPLICIT); + let arg1 = compiler.compileExpression(operands[1], usizeType, ContextualFlags.IMPLICIT); + let arg2 = compiler.compileExpression(operands[2], usizeType, ContextualFlags.IMPLICIT); compiler.currentType = Type.void; - return module.createMemoryCopy(arg0, arg1, arg2); + return module.memory_copy(arg0, arg1, arg2); } case BuiltinSymbols.memory_fill: { // memory.fill(dest: usize, value: u8, n: usize) -> void compiler.currentType = Type.void; if ( checkTypeAbsent(typeArguments, reportNode, prototype) | checkArgsRequired(operands, 3, reportNode, compiler) - ) return module.createUnreachable(); + ) return module.unreachable(); if (!compiler.options.hasFeature(Feature.BULK_MEMORY)) { let instance = compiler.resolver.resolveFunction(prototype, null); // reports compiler.currentType = Type.void; - if (!instance) return module.createUnreachable(); + if (!instance) return module.unreachable(); return compiler.compileCallDirect(instance, operands, reportNode); } let usizeType = compiler.options.usizeType; - let arg0 = compiler.compileExpression( - operands[0], - usizeType, - ConversionKind.IMPLICIT, - WrapMode.NONE - ); - let arg1 = compiler.compileExpression( - operands[1], - Type.u8, - ConversionKind.IMPLICIT, - WrapMode.NONE - ); - let arg2 = compiler.compileExpression( - operands[2], - usizeType, - ConversionKind.IMPLICIT, - WrapMode.NONE - ); + let arg0 = compiler.compileExpression(operands[0], usizeType, ContextualFlags.IMPLICIT); + let arg1 = compiler.compileExpression(operands[1], Type.u8, ContextualFlags.IMPLICIT); + let arg2 = compiler.compileExpression(operands[2], usizeType, ContextualFlags.IMPLICIT); compiler.currentType = Type.void; - return module.createMemoryFill(arg0, arg1, arg2); + return module.memory_fill(arg0, arg1, arg2); } // === Helpers ================================================================================ @@ -2097,13 +2058,9 @@ export function compileCall( if ( checkTypeRequired(typeArguments, reportNode, compiler, true) | checkArgsRequired(operands, 1, reportNode, compiler) - ) return module.createUnreachable(); + ) return module.unreachable(); let toType = typeArguments![0]; - let arg0 = compiler.compileExpressionRetainType( - operands[0], - toType, - WrapMode.NONE - ); + let arg0 = compiler.compileExpressionRetainType(operands[0], toType); let fromType = compiler.currentType; compiler.currentType = toType; if (fromType.size != toType.size) { @@ -2111,7 +2068,7 @@ export function compileCall( DiagnosticCode.Operation_not_supported, reportNode.range ); - return module.createUnreachable(); + return module.unreachable(); } return arg0; } @@ -2124,11 +2081,11 @@ export function compileCall( assert(typeArguments.length); // otherwise invalid, should not been set at all compiler.currentType = typeArguments[0].nonNullableType; } - return module.createUnreachable(); + return module.unreachable(); } let arg0 = typeArguments - ? compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.WRAP) - : compiler.compileExpressionRetainType(operands[0], Type.bool, WrapMode.WRAP); + ? compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT | ContextualFlags.WRAP) + : compiler.compileExpressionRetainType(operands[0], Type.bool, ContextualFlags.WRAP); let type = compiler.currentType; compiler.currentType = type.nonNullableType; @@ -2136,7 +2093,7 @@ export function compileCall( if (compiler.options.noAssert) { if (contextualType == Type.void) { // simplify if dropped anyway compiler.currentType = Type.void; - return module.createNop(); + return module.nop(); } return arg0; } @@ -2155,24 +2112,24 @@ export function compileCall( case TypeKind.U16: case TypeKind.U32: case TypeKind.BOOL: { - expr = module.createIf( - module.createUnary(UnaryOp.EqzI32, arg0), + expr = module.if( + module.unary(UnaryOp.EqzI32, arg0), abort ); break; } case TypeKind.I64: case TypeKind.U64: { - expr = module.createIf( - module.createUnary(UnaryOp.EqzI64, arg0), + expr = module.if( + module.unary(UnaryOp.EqzI64, arg0), abort ); break; } case TypeKind.ISIZE: case TypeKind.USIZE: { - expr = module.createIf( - module.createUnary( + expr = module.if( + module.unary( compiler.options.isWasm64 ? UnaryOp.EqzI64 : UnaryOp.EqzI32, @@ -2184,20 +2141,20 @@ export function compileCall( } // TODO: also check for NaN in float assertions, as in `Boolean(NaN) -> false`? case TypeKind.F32: { - expr = module.createIf( - module.createBinary(BinaryOp.EqF32, + expr = module.if( + module.binary(BinaryOp.EqF32, arg0, - module.createF32(0) + module.f32(0) ), abort ); break; } case TypeKind.F64: { - expr = module.createIf( - module.createBinary(BinaryOp.EqF64, + expr = module.if( + module.binary(BinaryOp.EqF64, arg0, - module.createF64(0) + module.f64(0) ), abort ); @@ -2222,62 +2179,64 @@ export function compileCall( case TypeKind.U16: case TypeKind.U32: case TypeKind.BOOL: { - let tempLocal = compiler.currentFlow.getAndFreeTempLocal(type, true /* arg0 is wrapped */); - expr = module.createIf( - module.createTeeLocal(tempLocal.index, arg0), - module.createGetLocal(tempLocal.index, NativeType.I32), + let flow = compiler.currentFlow; + let tempLocal = flow.getAndFreeTempLocal(type); + flow.setLocalFlag(tempLocal.index, LocalFlags.WRAPPED); // arg0 is wrapped + expr = module.if( + module.local_tee(tempLocal.index, arg0), + module.local_get(tempLocal.index, NativeType.I32), abort ); break; } case TypeKind.I64: case TypeKind.U64: { - let tempLocal = compiler.currentFlow.getAndFreeTempLocal(Type.i64, false); - expr = module.createIf( - module.createUnary(UnaryOp.EqzI64, - module.createTeeLocal(tempLocal.index, arg0) + let tempLocal = compiler.currentFlow.getAndFreeTempLocal(Type.i64); + expr = module.if( + module.unary(UnaryOp.EqzI64, + module.local_tee(tempLocal.index, arg0) ), abort, - module.createGetLocal(tempLocal.index, NativeType.I64) + module.local_get(tempLocal.index, NativeType.I64) ); break; } case TypeKind.ISIZE: case TypeKind.USIZE: { - let tempLocal = compiler.currentFlow.getAndFreeTempLocal(compiler.options.usizeType, false); - expr = module.createIf( - module.createUnary( + let tempLocal = compiler.currentFlow.getAndFreeTempLocal(compiler.options.usizeType); + expr = module.if( + module.unary( compiler.options.isWasm64 ? UnaryOp.EqzI64 : UnaryOp.EqzI32, - module.createTeeLocal(tempLocal.index, arg0) + module.local_tee(tempLocal.index, arg0) ), abort, - module.createGetLocal(tempLocal.index, compiler.options.nativeSizeType) + module.local_get(tempLocal.index, compiler.options.nativeSizeType) ); break; } case TypeKind.F32: { - let tempLocal = compiler.currentFlow.getAndFreeTempLocal(Type.f32, false); - expr = module.createIf( - module.createBinary(BinaryOp.EqF32, - module.createTeeLocal(tempLocal.index, arg0), - module.createF32(0) + let tempLocal = compiler.currentFlow.getAndFreeTempLocal(Type.f32); + expr = module.if( + module.binary(BinaryOp.EqF32, + module.local_tee(tempLocal.index, arg0), + module.f32(0) ), abort, - module.createGetLocal(tempLocal.index, NativeType.F32) + module.local_get(tempLocal.index, NativeType.F32) ); break; } case TypeKind.F64: { - let tempLocal = compiler.currentFlow.getAndFreeTempLocal(Type.f64, false); - expr = module.createIf( - module.createBinary(BinaryOp.EqF64, - module.createTeeLocal(tempLocal.index, arg0), - module.createF64(0) + let tempLocal = compiler.currentFlow.getAndFreeTempLocal(Type.f64); + expr = module.if( + module.binary(BinaryOp.EqF64, + module.local_tee(tempLocal.index, arg0), + module.f64(0) ), abort, - module.createGetLocal(tempLocal.index, NativeType.F64) + module.local_get(tempLocal.index, NativeType.F64) ); break; } @@ -2297,21 +2256,23 @@ export function compileCall( if ( checkTypeAbsent(typeArguments, reportNode, prototype) | checkArgsRequired(operands, 1, reportNode, compiler) - ) return module.createUnreachable(); + ) return module.unreachable(); let flow = compiler.currentFlow; let alreadyUnchecked = flow.is(FlowFlags.UNCHECKED_CONTEXT); flow.set(FlowFlags.UNCHECKED_CONTEXT); - let expr = compiler.compileExpressionRetainType(operands[0], contextualType, WrapMode.NONE); + // eliminate unnecessary tees by preferring contextualType(=void): + let expr = compiler.compileExpression(operands[0], contextualType); if (!alreadyUnchecked) flow.unset(FlowFlags.UNCHECKED_CONTEXT); return expr; } + case BuiltinSymbols.call_direct: directize = true; case BuiltinSymbols.call_indirect: { // call_indirect(target: Function | u32, ...args: *[]) -> T if ( checkTypeOptional(typeArguments, reportNode, compiler, true) | checkArgsOptional(operands, 1, i32.MAX_VALUE, reportNode, compiler) - ) return module.createUnreachable(); + ) return module.unreachable(); let returnType = typeArguments ? typeArguments[0] : contextualType; - let arg0 = compiler.compileExpressionRetainType(operands[0], Type.u32, WrapMode.NONE); + let arg0 = compiler.compileExpressionRetainType(operands[0], Type.u32); let arg0Type = compiler.currentType; if (!( arg0Type == Type.u32 || // either plain index @@ -2321,7 +2282,7 @@ export function compileCall( DiagnosticCode.Operation_not_supported, operands[0].range ); - return module.createUnreachable(); + return module.unreachable(); } let numOperands = operands.length - 1; let operandExprs = new Array(numOperands); @@ -2329,7 +2290,7 @@ export function compileCall( let parameterTypes = new Array(numOperands); let nativeParamTypes = new Array(numOperands); for (let i = 0; i < numOperands; ++i) { - operandExprs[i] = compiler.compileExpressionRetainType(operands[1 + i], Type.i32, WrapMode.NONE); + operandExprs[i] = compiler.compileExpressionRetainType(operands[1 + i], Type.i32); let operandType = compiler.currentType; parameterTypes[i] = operandType; nativeParamTypes[i] = operandType.toNativeType(); @@ -2338,24 +2299,40 @@ export function compileCall( let typeRef = module.getFunctionTypeBySignature(nativeReturnType, nativeParamTypes); if (!typeRef) typeRef = module.addFunctionType(typeName, nativeReturnType, nativeParamTypes); compiler.currentType = returnType; + if (directize) { + // if the index expression is precomputable to a constant value, emit a direct call + if (getExpressionId(arg0 = module.precomputeExpression(arg0)) == ExpressionId.Const) { + assert(getExpressionType(arg0) == NativeType.I32); + let index = getConstValueI32(arg0); + let functionTable = compiler.functionTable; + if (index >= 0 && index < functionTable.length) { + return module.call(functionTable[index], operandExprs, nativeReturnType); + } + } + compiler.error( + DiagnosticCode.Operation_not_supported, + operands[0].range + ); + return module.unreachable(); + } // of course this can easily result in a 'RuntimeError: function signature mismatch' trap and // thus must be used with care. it exists because it *might* be useful in specific scenarios. - return module.createCallIndirect(arg0, operandExprs, typeName); + return module.call_indirect(arg0, operandExprs, typeName); } case BuiltinSymbols.instantiate: { // instantiate(...args: *[]) -> T if ( checkTypeRequired(typeArguments, reportNode, compiler, true) - ) return module.createUnreachable(); + ) return module.unreachable(); let classInstance = typeArguments![0].classReference; if (!classInstance) { compiler.error( DiagnosticCode.Operation_not_supported, reportNode.typeArgumentsRange ); - return module.createUnreachable(); + return module.unreachable(); } compiler.currentType = classInstance.type; - return compiler.compileInstantiate(classInstance, operands, reportNode); + return compiler.compileInstantiate(classInstance, operands, ContextualFlags.NONE, reportNode); } // === User-defined diagnostics =============================================================== @@ -2366,7 +2343,7 @@ export function compileCall( DiagnosticCode.User_defined_0, reportNode.range, (operands.length ? operands[0] : reportNode).range.toString() ); - return module.createUnreachable(); + return module.unreachable(); } case BuiltinSymbols.WARNING: { checkTypeAbsent(typeArguments, reportNode, prototype); @@ -2374,7 +2351,7 @@ export function compileCall( DiagnosticCode.User_defined_0, reportNode.range, (operands.length ? operands[0] : reportNode).range.toString() ); - return module.createNop(); + return module.nop(); } case BuiltinSymbols.INFO: { checkTypeAbsent(typeArguments, reportNode, prototype); @@ -2382,7 +2359,7 @@ export function compileCall( DiagnosticCode.User_defined_0, reportNode.range, (operands.length ? operands[0] : reportNode).range.toString() ); - return module.createNop(); + return module.nop(); } // === Portable type conversions ============================================================== @@ -2393,9 +2370,9 @@ export function compileCall( checkArgsRequired(operands, 1, reportNode, compiler) ) { compiler.currentType = Type.i8; - return module.createUnreachable(); + return module.unreachable(); } - return compiler.compileExpression(operands[0], Type.i8, ConversionKind.EXPLICIT, WrapMode.NONE); + return compiler.compileExpression(operands[0], Type.i8, ContextualFlags.EXPLICIT); } case BuiltinSymbols.i16: { if ( @@ -2403,9 +2380,9 @@ export function compileCall( checkArgsRequired(operands, 1, reportNode, compiler) ) { compiler.currentType = Type.i16; - return module.createUnreachable(); + return module.unreachable(); } - return compiler.compileExpression(operands[0], Type.i16, ConversionKind.EXPLICIT, WrapMode.NONE); + return compiler.compileExpression(operands[0], Type.i16, ContextualFlags.EXPLICIT); } case BuiltinSymbols.i32: { if ( @@ -2413,9 +2390,9 @@ export function compileCall( checkArgsRequired(operands, 1, reportNode, compiler) ) { compiler.currentType = Type.i32; - return module.createUnreachable(); + return module.unreachable(); } - return compiler.compileExpression(operands[0], Type.i32, ConversionKind.EXPLICIT, WrapMode.NONE); + return compiler.compileExpression(operands[0], Type.i32, ContextualFlags.EXPLICIT); } case BuiltinSymbols.i64: { if ( @@ -2423,9 +2400,9 @@ export function compileCall( checkArgsRequired(operands, 1, reportNode, compiler) ) { compiler.currentType = Type.i64; - return module.createUnreachable(); + return module.unreachable(); } - return compiler.compileExpression(operands[0], Type.i64, ConversionKind.EXPLICIT, WrapMode.NONE); + return compiler.compileExpression(operands[0], Type.i64, ContextualFlags.EXPLICIT); } case BuiltinSymbols.isize: { let isizeType = compiler.options.isizeType; @@ -2434,9 +2411,9 @@ export function compileCall( checkArgsRequired(operands, 1, reportNode, compiler) ) { compiler.currentType = isizeType; - return module.createUnreachable(); + return module.unreachable(); } - return compiler.compileExpression(operands[0], isizeType, ConversionKind.EXPLICIT, WrapMode.NONE); + return compiler.compileExpression(operands[0], isizeType, ContextualFlags.EXPLICIT); } case BuiltinSymbols.u8: { if ( @@ -2444,9 +2421,9 @@ export function compileCall( checkArgsRequired(operands, 1, reportNode, compiler) ) { compiler.currentType = Type.u8; - return module.createUnreachable(); + return module.unreachable(); } - return compiler.compileExpression(operands[0], Type.u8, ConversionKind.EXPLICIT, WrapMode.NONE); + return compiler.compileExpression(operands[0], Type.u8, ContextualFlags.EXPLICIT); } case BuiltinSymbols.u16: { if ( @@ -2454,9 +2431,9 @@ export function compileCall( checkArgsRequired(operands, 1, reportNode, compiler) ) { compiler.currentType = Type.u16; - return module.createUnreachable(); + return module.unreachable(); } - return compiler.compileExpression(operands[0], Type.u16, ConversionKind.EXPLICIT, WrapMode.NONE); + return compiler.compileExpression(operands[0], Type.u16, ContextualFlags.EXPLICIT); } case BuiltinSymbols.u32: { if ( @@ -2464,9 +2441,9 @@ export function compileCall( checkArgsRequired(operands, 1, reportNode, compiler) ) { compiler.currentType = Type.u32; - return module.createUnreachable(); + return module.unreachable(); } - return compiler.compileExpression(operands[0], Type.u32, ConversionKind.EXPLICIT, WrapMode.NONE); + return compiler.compileExpression(operands[0], Type.u32, ContextualFlags.EXPLICIT); } case BuiltinSymbols.u64: { if ( @@ -2474,9 +2451,9 @@ export function compileCall( checkArgsRequired(operands, 1, reportNode, compiler) ) { compiler.currentType = Type.u64; - return module.createUnreachable(); + return module.unreachable(); } - return compiler.compileExpression(operands[0], Type.u64, ConversionKind.EXPLICIT, WrapMode.NONE); + return compiler.compileExpression(operands[0], Type.u64, ContextualFlags.EXPLICIT); } case BuiltinSymbols.usize: { let usizeType = compiler.options.usizeType; @@ -2485,9 +2462,9 @@ export function compileCall( checkArgsRequired(operands, 1, reportNode, compiler) ) { compiler.currentType = usizeType; - return module.createUnreachable(); + return module.unreachable(); } - return compiler.compileExpression(operands[0], usizeType, ConversionKind.EXPLICIT, WrapMode.NONE); + return compiler.compileExpression(operands[0], usizeType, ContextualFlags.EXPLICIT); } case BuiltinSymbols.bool: { if ( @@ -2495,9 +2472,9 @@ export function compileCall( checkArgsRequired(operands, 1, reportNode, compiler) ) { compiler.currentType = Type.bool; - return module.createUnreachable(); + return module.unreachable(); } - return compiler.compileExpression(operands[0], Type.bool, ConversionKind.EXPLICIT, WrapMode.NONE); + return compiler.compileExpression(operands[0], Type.bool, ContextualFlags.EXPLICIT); } case BuiltinSymbols.f32: { if ( @@ -2505,9 +2482,9 @@ export function compileCall( checkArgsRequired(operands, 1, reportNode, compiler) ) { compiler.currentType = Type.f32; - return module.createUnreachable(); + return module.unreachable(); } - return compiler.compileExpression(operands[0], Type.f32, ConversionKind.EXPLICIT, WrapMode.NONE); + return compiler.compileExpression(operands[0], Type.f32, ContextualFlags.EXPLICIT); } case BuiltinSymbols.f64: { if ( @@ -2515,9 +2492,9 @@ export function compileCall( checkArgsRequired(operands, 1, reportNode, compiler) ) { compiler.currentType = Type.f64; - return module.createUnreachable(); + return module.unreachable(); } - return compiler.compileExpression(operands[0], Type.f64, ConversionKind.EXPLICIT, WrapMode.NONE); + return compiler.compileExpression(operands[0], Type.f64, ContextualFlags.EXPLICIT); } // === SIMD =================================================================================== @@ -2530,29 +2507,27 @@ export function compileCall( checkArgsRequired(operands, 16, reportNode, compiler) ) { compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } let bytes = new Uint8Array(16); for (let i = 0; i < 16; ++i) { let value = operands[i]; if (value) { - let expr = module.precomputeExpression( - compiler.compileExpression(value, Type.i8, ConversionKind.IMPLICIT, WrapMode.NONE) - ); + let expr = compiler.precomputeExpression(value, Type.i8, ContextualFlags.IMPLICIT); if (getExpressionId(expr) != ExpressionId.Const) { compiler.error( DiagnosticCode.Expression_must_be_a_compile_time_constant, value.range ); compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } assert(getExpressionType(expr) == NativeType.I32); writeI8(getConstValueI32(expr), bytes, i); } } compiler.currentType = Type.v128; - return module.createV128(bytes); + return module.v128(bytes); } case BuiltinSymbols.i16x8: { if (!compiler.options.hasFeature(Feature.SIMD)) break; @@ -2561,29 +2536,27 @@ export function compileCall( checkArgsRequired(operands, 8, reportNode, compiler) ) { compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } let bytes = new Uint8Array(16); for (let i = 0; i < 8; ++i) { let value = operands[i]; if (value) { - let expr = module.precomputeExpression( - compiler.compileExpression(value, Type.i16, ConversionKind.IMPLICIT, WrapMode.NONE) - ); + let expr = compiler.precomputeExpression(value, Type.i16, ContextualFlags.IMPLICIT); if (getExpressionId(expr) != ExpressionId.Const) { compiler.error( DiagnosticCode.Expression_must_be_a_compile_time_constant, value.range ); compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } assert(getExpressionType(expr) == NativeType.I32); writeI16(getConstValueI32(expr), bytes, i << 1); } } compiler.currentType = Type.v128; - return module.createV128(bytes); + return module.v128(bytes); } case BuiltinSymbols.i32x4: { if (!compiler.options.hasFeature(Feature.SIMD)) break; @@ -2592,29 +2565,27 @@ export function compileCall( checkArgsRequired(operands, 4, reportNode, compiler) ) { compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } let bytes = new Uint8Array(16); for (let i = 0; i < 4; ++i) { let value = operands[i]; if (value) { - let expr = module.precomputeExpression( - compiler.compileExpression(value, Type.i32, ConversionKind.IMPLICIT, WrapMode.NONE) - ); + let expr = compiler.precomputeExpression(value, Type.i32, ContextualFlags.IMPLICIT); if (getExpressionId(expr) != ExpressionId.Const) { compiler.error( DiagnosticCode.Expression_must_be_a_compile_time_constant, value.range ); compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } assert(getExpressionType(expr) == NativeType.I32); writeI32(getConstValueI32(expr), bytes, i << 2); } } compiler.currentType = Type.v128; - return module.createV128(bytes); + return module.v128(bytes); } case BuiltinSymbols.i64x2: { if (!compiler.options.hasFeature(Feature.SIMD)) break; @@ -2623,22 +2594,20 @@ export function compileCall( checkArgsRequired(operands, 2, reportNode, compiler) ) { compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } let bytes = new Uint8Array(16); for (let i = 0; i < 2; ++i) { let value = operands[i]; if (value) { - let expr = module.precomputeExpression( - compiler.compileExpression(value, Type.i64, ConversionKind.IMPLICIT, WrapMode.NONE) - ); + let expr = compiler.precomputeExpression(value, Type.i64, ContextualFlags.IMPLICIT); if (getExpressionId(expr) != ExpressionId.Const) { compiler.error( DiagnosticCode.Expression_must_be_a_compile_time_constant, value.range ); compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } assert(getExpressionType(expr) == NativeType.I64); let off = i << 3; @@ -2647,7 +2616,7 @@ export function compileCall( } } compiler.currentType = Type.v128; - return module.createV128(bytes); + return module.v128(bytes); } case BuiltinSymbols.f32x4: { if (!compiler.options.hasFeature(Feature.SIMD)) break; @@ -2656,29 +2625,27 @@ export function compileCall( checkArgsRequired(operands, 4, reportNode, compiler) ) { compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } let bytes = new Uint8Array(16); for (let i = 0; i < 4; ++i) { let value = operands[i]; if (value) { - let expr = module.precomputeExpression( - compiler.compileExpression(value, Type.f32, ConversionKind.IMPLICIT, WrapMode.NONE) - ); + let expr = compiler.precomputeExpression(value, Type.f32, ContextualFlags.IMPLICIT); if (getExpressionId(expr) != ExpressionId.Const) { compiler.error( DiagnosticCode.Expression_must_be_a_compile_time_constant, value.range ); compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } assert(getExpressionType(expr) == NativeType.F32); writeF32(getConstValueF32(expr), bytes, i << 2); } } compiler.currentType = Type.v128; - return module.createV128(bytes); + return module.v128(bytes); } case BuiltinSymbols.f64x2: { if (!compiler.options.hasFeature(Feature.SIMD)) break; @@ -2687,29 +2654,27 @@ export function compileCall( checkArgsRequired(operands, 2, reportNode, compiler) ) { compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } let bytes = new Uint8Array(16); for (let i = 0; i < 2; ++i) { let value = operands[i]; if (value) { - let expr = module.precomputeExpression( - compiler.compileExpression(value, Type.f64, ConversionKind.IMPLICIT, WrapMode.NONE) - ); + let expr = compiler.precomputeExpression(value, Type.f64, ContextualFlags.IMPLICIT); if (getExpressionId(expr) != ExpressionId.Const) { compiler.error( DiagnosticCode.Expression_must_be_a_compile_time_constant, value.range ); compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } assert(getExpressionType(expr) == NativeType.F64); writeF64(getConstValueF64(expr), bytes, i << 3); } } compiler.currentType = Type.v128; - return module.createV128(bytes); + return module.v128(bytes); } case BuiltinSymbols.v128_splat: { // splat(x: T) -> v128 if (!compiler.options.hasFeature(Feature.SIMD)) break; @@ -2718,7 +2683,7 @@ export function compileCall( checkArgsRequired(operands, 1, reportNode, compiler) ) { compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } let type = typeArguments![0]; if (type.is(TypeFlags.REFERENCE)) { @@ -2727,7 +2692,7 @@ export function compileCall( reportNode.typeArgumentsRange ); compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } let op: UnaryOp; switch (type.kind) { @@ -2754,19 +2719,19 @@ export function compileCall( reportNode.typeArgumentsRange ); compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } } - let arg0 = compiler.compileExpression(operands[0], type, ConversionKind.IMPLICIT, WrapMode.NONE); + let arg0 = compiler.compileExpression(operands[0], type, ContextualFlags.IMPLICIT); compiler.currentType = Type.v128; - return module.createUnary(op, arg0); + return module.unary(op, arg0); } case BuiltinSymbols.v128_extract_lane: { // extract_lane(x: v128, idx: u8) -> T if (!compiler.options.hasFeature(Feature.SIMD)) break; if ( checkTypeRequired(typeArguments, reportNode, compiler, true) | checkArgsRequired(operands, 2, reportNode, compiler) - ) return module.createUnreachable(); + ) return module.unreachable(); let type = typeArguments![0]; if (type.is(TypeFlags.REFERENCE)) { compiler.error( @@ -2774,7 +2739,7 @@ export function compileCall( reportNode.typeArgumentsRange ); compiler.currentType = type; - return module.createUnreachable(); + return module.unreachable(); } let op: SIMDExtractOp; switch (type.kind) { @@ -2801,20 +2766,18 @@ export function compileCall( reportNode.typeArgumentsRange ); compiler.currentType = type; - return module.createUnreachable(); + return module.unreachable(); } } - let arg0 = compiler.compileExpression(operands[0], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE); - let arg1 = module.precomputeExpression( - compiler.compileExpression(operands[1], Type.u8, ConversionKind.IMPLICIT, WrapMode.NONE) - ); + let arg0 = compiler.compileExpression(operands[0], Type.v128, ContextualFlags.IMPLICIT); + let arg1 = compiler.precomputeExpression(operands[1], Type.u8, ContextualFlags.IMPLICIT); compiler.currentType = type; if (getExpressionId(arg1) != ExpressionId.Const) { compiler.error( DiagnosticCode.Expression_must_be_a_compile_time_constant, operands[1].range ); - return module.createUnreachable(); + return module.unreachable(); } assert(getExpressionType(arg1) == NativeType.I32); let maxIdx = (16 / type.byteSize) - 1; @@ -2824,9 +2787,9 @@ export function compileCall( DiagnosticCode._0_must_be_a_value_between_1_and_2_inclusive, operands[1].range, "Lane index", "0", maxIdx.toString() ); - return module.createUnreachable(); + return module.unreachable(); } - return module.createSIMDExtract(op, arg0, idx); + return module.simd_extract(op, arg0, idx); } case BuiltinSymbols.v128_replace_lane: { // replace_lane(x: v128, idx: u8, value: T) -> v128 if (!compiler.options.hasFeature(Feature.SIMD)) break; @@ -2835,7 +2798,7 @@ export function compileCall( checkArgsRequired(operands, 3, reportNode, compiler) ) { compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } let type = typeArguments![0]; if (type.is(TypeFlags.REFERENCE)) { @@ -2844,7 +2807,7 @@ export function compileCall( reportNode.typeArgumentsRange ); compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } let op: SIMDReplaceOp; switch (type.kind) { @@ -2871,20 +2834,18 @@ export function compileCall( reportNode.typeArgumentsRange ); compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } } - let arg0 = compiler.compileExpression(operands[0], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE); - let arg1 = module.precomputeExpression( - compiler.compileExpression(operands[1], Type.u8, ConversionKind.IMPLICIT, WrapMode.NONE) - ); + let arg0 = compiler.compileExpression(operands[0], Type.v128, ContextualFlags.IMPLICIT); + let arg1 = compiler.precomputeExpression(operands[1], Type.u8, ContextualFlags.IMPLICIT); if (getExpressionId(arg1) != ExpressionId.Const) { compiler.error( DiagnosticCode.Expression_must_be_a_compile_time_constant, operands[1].range ); compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } assert(getExpressionType(arg1) == NativeType.I32); let maxIdx = (16 / type.byteSize) - 1; @@ -2894,11 +2855,11 @@ export function compileCall( DiagnosticCode._0_must_be_a_value_between_1_and_2_inclusive, operands[1].range, "Lane index", "0", maxIdx.toString() ); - return module.createUnreachable(); + return module.unreachable(); } - let arg2 = compiler.compileExpression(operands[2], type, ConversionKind.IMPLICIT, WrapMode.NONE); + let arg2 = compiler.compileExpression(operands[2], type, ContextualFlags.IMPLICIT); compiler.currentType = Type.v128; - return module.createSIMDReplace(op, arg0, idx, arg2); + return module.simd_replace(op, arg0, idx, arg2); } case BuiltinSymbols.v128_shuffle: { // shuffle(a: v128, b: v128, ...lanes: u8[]) -> v128 if (!compiler.options.hasFeature(Feature.SIMD)) break; @@ -2906,7 +2867,7 @@ export function compileCall( checkTypeRequired(typeArguments, reportNode, compiler) ) { compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } let type = typeArguments![0]; if (type.is(TypeFlags.REFERENCE)) { @@ -2915,7 +2876,7 @@ export function compileCall( reportNode.typeArgumentsRange ); compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } let laneWidth = type.byteSize; let laneCount = 16 / laneWidth; @@ -2924,7 +2885,7 @@ export function compileCall( checkArgsRequired(operands, 2 + laneCount, reportNode, compiler) ) { compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } switch (type.kind) { case TypeKind.I8: @@ -2945,25 +2906,23 @@ export function compileCall( reportNode.typeArgumentsRange ); compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } } - let arg0 = compiler.compileExpression(operands[0], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE); - let arg1 = compiler.compileExpression(operands[1], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE); + let arg0 = compiler.compileExpression(operands[0], Type.v128, ContextualFlags.IMPLICIT); + let arg1 = compiler.compileExpression(operands[1], Type.v128, ContextualFlags.IMPLICIT); let mask = new Uint8Array(16); let maxIdx = (laneCount << 1) - 1; for (let i = 0; i < laneCount; ++i) { let operand = operands[2 + i]; - let argN = module.precomputeExpression( - compiler.compileExpression(operand, Type.u8, ConversionKind.IMPLICIT, WrapMode.NONE) - ); + let argN = compiler.precomputeExpression(operand, Type.u8, ContextualFlags.IMPLICIT); if (getExpressionId(argN) != ExpressionId.Const) { compiler.error( DiagnosticCode.Expression_must_be_a_compile_time_constant, operand.range ); compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } assert(getExpressionType(argN) == NativeType.I32); let idx = getConstValueI32(argN); @@ -2973,7 +2932,7 @@ export function compileCall( operand.range, "Lane index", "0", maxIdx.toString() ); compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } switch (laneWidth) { case 1: { @@ -3013,7 +2972,7 @@ export function compileCall( } } compiler.currentType = Type.v128; - return module.createSIMDShuffle(arg0, arg1, mask); + return module.simd_shuffle(arg0, arg1, mask); } case BuiltinSymbols.v128_add: // any_binary(a: v128, b: v128) -> v128 case BuiltinSymbols.v128_sub: @@ -3035,7 +2994,7 @@ export function compileCall( checkArgsRequired(operands, 2, reportNode, compiler) ) { compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } let type = typeArguments![0]; if (type.is(TypeFlags.REFERENCE)) { @@ -3044,7 +3003,7 @@ export function compileCall( reportNode.typeArgumentsRange ); compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } let op: BinaryOp = -1; switch (prototype.internalName) { @@ -3280,12 +3239,12 @@ export function compileCall( reportNode.typeArgumentsRange ); compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } - let arg0 = compiler.compileExpression(operands[0], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE); - let arg1 = compiler.compileExpression(operands[1], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE); + let arg0 = compiler.compileExpression(operands[0], Type.v128, ContextualFlags.IMPLICIT); + let arg1 = compiler.compileExpression(operands[1], Type.v128, ContextualFlags.IMPLICIT); compiler.currentType = Type.v128; - return module.createBinary(op, arg0, arg1); + return module.binary(op, arg0, arg1); } case BuiltinSymbols.v128_neg: // any_unary(a: v128) -> v128 case BuiltinSymbols.v128_abs: @@ -3298,7 +3257,7 @@ export function compileCall( checkArgsRequired(operands, 1, reportNode, compiler) ) { compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } let type = typeArguments![0]; if (type.is(TypeFlags.REFERENCE)) { @@ -3307,7 +3266,7 @@ export function compileCall( reportNode.range ); compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } let op: UnaryOp = -1; switch (prototype.internalName) { @@ -3372,11 +3331,11 @@ export function compileCall( reportNode.typeArgumentsRange ); compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } - let arg0 = compiler.compileExpression(operands[0], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE); + let arg0 = compiler.compileExpression(operands[0], Type.v128, ContextualFlags.IMPLICIT); compiler.currentType = Type.v128; - return module.createUnary(op, arg0); + return module.unary(op, arg0); } case BuiltinSymbols.v128_shl: // any_shift(a: v128, b: i32) -> v128 case BuiltinSymbols.v128_shr: { @@ -3386,7 +3345,7 @@ export function compileCall( checkArgsRequired(operands, 2, reportNode, compiler) ) { compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } let type = typeArguments![0]; if (type.is(TypeFlags.REFERENCE)) { @@ -3395,7 +3354,7 @@ export function compileCall( reportNode.typeArgumentsRange ); compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } let op: SIMDShiftOp = -1; switch (prototype.internalName) { @@ -3451,12 +3410,12 @@ export function compileCall( reportNode.range ); compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } - let arg0 = compiler.compileExpression(operands[0], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE); - let arg1 = compiler.compileExpression(operands[1], Type.i32, ConversionKind.IMPLICIT, WrapMode.NONE); + let arg0 = compiler.compileExpression(operands[0], Type.v128, ContextualFlags.IMPLICIT); + let arg1 = compiler.compileExpression(operands[1], Type.i32, ContextualFlags.IMPLICIT); compiler.currentType = Type.v128; - return module.createSIMDShift(op, arg0, arg1); + return module.simd_shift(op, arg0, arg1); } case BuiltinSymbols.v128_and: // any_bitwise_binary(a: v128, b: v128) -> v128 case BuiltinSymbols.v128_or: @@ -3467,7 +3426,7 @@ export function compileCall( checkArgsRequired(operands, 2, reportNode, compiler) ) { compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } let op: BinaryOp = -1; switch (prototype.internalName) { @@ -3476,9 +3435,9 @@ export function compileCall( case BuiltinSymbols.v128_or: { op = BinaryOp.OrVec128; break; } case BuiltinSymbols.v128_xor: { op = BinaryOp.XorVec128; break; } } - let arg0 = compiler.compileExpression(operands[0], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE); - let arg1 = compiler.compileExpression(operands[1], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE); - return module.createBinary(op, arg0, arg1); + let arg0 = compiler.compileExpression(operands[0], Type.v128, ContextualFlags.IMPLICIT); + let arg1 = compiler.compileExpression(operands[1], Type.v128, ContextualFlags.IMPLICIT); + return module.binary(op, arg0, arg1); } case BuiltinSymbols.v128_not: { // any_bitwise_unary(a: v128) -> v128 if (!compiler.options.hasFeature(Feature.SIMD)) break; @@ -3487,10 +3446,10 @@ export function compileCall( checkArgsRequired(operands, 1, reportNode, compiler) ) { compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } - let arg0 = compiler.compileExpression(operands[0], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE); - return module.createUnary(UnaryOp.NotVec128, arg0); + let arg0 = compiler.compileExpression(operands[0], Type.v128, ContextualFlags.IMPLICIT); + return module.unary(UnaryOp.NotVec128, arg0); } case BuiltinSymbols.v128_bitselect: { // bitselect(v1: v128, v2: v128, c: v128) -> v128 if (!compiler.options.hasFeature(Feature.SIMD)) break; @@ -3499,12 +3458,12 @@ export function compileCall( checkArgsRequired(operands, 3, reportNode, compiler) ) { compiler.currentType = Type.v128; - return module.createUnreachable(); + return module.unreachable(); } - let arg0 = compiler.compileExpression(operands[0], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE); - let arg1 = compiler.compileExpression(operands[1], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE); - let arg2 = compiler.compileExpression(operands[2], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE); - return module.createSIMDBitselect(arg0, arg1, arg2); + let arg0 = compiler.compileExpression(operands[0], Type.v128, ContextualFlags.IMPLICIT); + let arg1 = compiler.compileExpression(operands[1], Type.v128, ContextualFlags.IMPLICIT); + let arg2 = compiler.compileExpression(operands[2], Type.v128, ContextualFlags.IMPLICIT); + return module.simd_bitselect(arg0, arg1, arg2); } case BuiltinSymbols.v128_any_true: // any_test(a: v128) -> bool case BuiltinSymbols.v128_all_true: { @@ -3514,7 +3473,7 @@ export function compileCall( checkArgsRequired(operands, 1, reportNode, compiler) ) { compiler.currentType = Type.bool; - return module.createUnreachable(); + return module.unreachable(); } let type = typeArguments![0]; if (type.is(TypeFlags.REFERENCE)) { @@ -3522,7 +3481,7 @@ export function compileCall( DiagnosticCode.Operation_not_supported, reportNode.typeArgumentsRange ); - return module.createUnreachable(); + return module.unreachable(); } let op: UnaryOp = -1; switch (prototype.internalName) { @@ -3574,43 +3533,55 @@ export function compileCall( reportNode.typeArgumentsRange ); compiler.currentType = Type.bool; - return module.createUnreachable(); + return module.unreachable(); } - let arg0 = compiler.compileExpression(operands[0], Type.v128, ConversionKind.IMPLICIT, WrapMode.NONE); + let arg0 = compiler.compileExpression(operands[0], Type.v128, ContextualFlags.IMPLICIT); compiler.currentType = Type.bool; - return module.createUnary(op, arg0); + return module.unary(op, arg0); } - // === GC integration ========================================================================= + // === Internal runtime ======================================================================= - case BuiltinSymbols.iterateRoots: { + case BuiltinSymbols.idof: { + let type = evaluateConstantType(compiler, typeArguments, operands, reportNode); + compiler.currentType = Type.u32; + if (!type) return module.unreachable(); + let classReference = type.classReference; + if (!classReference || classReference.hasDecorator(DecoratorFlags.UNMANAGED)) { + compiler.error( + DiagnosticCode.Operation_not_supported, + reportNode.range + ); + return module.unreachable(); + } + return module.i32(classReference.id); + } + case BuiltinSymbols.visit_globals: { if ( checkTypeAbsent(typeArguments, reportNode, prototype) | - checkArgsRequired(operands, 1, reportNode, compiler) + checkArgsRequired(operands, 1, reportNode, compiler) // cookie ) { compiler.currentType = Type.void; - return module.createUnreachable(); + return module.unreachable(); } - let expr = compiler.compileExpressionRetainType(operands[0], Type.u32, WrapMode.NONE); - let type = compiler.currentType; - let signatureReference = type.signatureReference; + let arg0 = compiler.compileExpression(operands[0], Type.u32, ContextualFlags.IMPLICIT); + compiler.runtimeFeatures |= RuntimeFeatures.visitGlobals; + compiler.currentType = Type.void; + return module.call(BuiltinSymbols.visit_globals, [ arg0 ], NativeType.None); + } + case BuiltinSymbols.visit_members: { if ( - !type.is(TypeFlags.REFERENCE) || - !signatureReference || - signatureReference.parameterTypes.length != 1 || - signatureReference.parameterTypes[0] != compiler.options.usizeType - ) { - compiler.error( - DiagnosticCode.Type_0_is_not_assignable_to_type_1, - reportNode.range, type.toString(), "(ref: usize) => void" - ); + checkTypeAbsent(typeArguments, reportNode, prototype) | + checkArgsRequired(operands, 2, reportNode, compiler) // ref, cookie + ) { compiler.currentType = Type.void; - return module.createUnreachable(); + return module.unreachable(); } - // just emit a call even if the function doesn't yet exist - compiler.needsIterateRoots = true; + let arg0 = compiler.compileExpression(operands[0], compiler.options.usizeType, ContextualFlags.IMPLICIT); + let arg1 = compiler.compileExpression(operands[1], Type.u32, ContextualFlags.IMPLICIT); + compiler.runtimeFeatures |= RuntimeFeatures.visitMembers; compiler.currentType = Type.void; - return module.createCall("~iterateRoots", [ expr ], NativeType.None); + return module.call(BuiltinSymbols.visit_members, [ arg0, arg1 ], NativeType.None); } } @@ -3631,7 +3602,7 @@ export function compileCall( DiagnosticCode.Cannot_find_name_0, reportNode.expression.range, prototype.internalName ); - return module.createUnreachable(); + return module.unreachable(); } /** Tries to defer an inline-assembler-like call to a built-in function. */ @@ -3967,38 +3938,48 @@ export function compileAbort( var module = compiler.module; var stringInstance = compiler.program.stringInstance; - if (!stringInstance) return module.createUnreachable(); + if (!stringInstance) return module.unreachable(); var abortInstance = program.abortInstance; - if (!(abortInstance && compiler.compileFunction(abortInstance))) return module.createUnreachable(); + if (!(abortInstance && compiler.compileFunction(abortInstance))) return module.unreachable(); - var messageArg = message != null - ? compiler.compileExpression(message, stringInstance.type, ConversionKind.IMPLICIT, WrapMode.NONE) - : stringInstance.type.toNativeZero(module); + var messageArg: ExpressionRef; + if (message !== null) { + // The message argument works much like an arm of an IF that does not become executed if the + // assertion succeeds respectively is only being computed if the program actually crashes. + // Hence, let's make it so that the autorelease is skipped at the end of the current block, + // essentially ignoring the message GC-wise. Doesn't matter anyway on a crash. + messageArg = compiler.compileExpression(message, stringInstance.type, ContextualFlags.IMPLICIT | ContextualFlags.SKIP_AUTORELEASE); + } else { + messageArg = stringInstance.type.toNativeZero(module); + } var filenameArg = compiler.ensureStaticString(reportNode.range.source.normalizedPath); compiler.currentType = Type.void; - return module.createBlock(null, [ - module.createCall( + return module.block(null, [ + module.call( abortInstance.internalName, [ messageArg, filenameArg, - module.createI32(reportNode.range.line), - module.createI32(reportNode.range.column) + module.i32(reportNode.range.line), + module.i32(reportNode.range.column) ], NativeType.None ), - module.createUnreachable() + module.unreachable() ]); } -/** Compiles the iterateRoots function if required. */ -export function compileIterateRoots(compiler: Compiler): void { +/** Compiles the `visit_globals` function. */ +export function compileVisitGlobals(compiler: Compiler): void { var module = compiler.module; var exprs = new Array(); - var typeName = Signature.makeSignatureString([ Type.i32 ], Type.void); - var typeRef = compiler.ensureFunctionType([ Type.i32 ], Type.void); + var typeRef = compiler.ensureFunctionType([ Type.u32 ], Type.void); // cookie + var nativeSizeType = compiler.options.nativeSizeType; + var visitInstance = assert(compiler.program.visitInstance); + + compiler.compileFunction(visitInstance); for (let element of compiler.program.elementsByName.values()) { if (element.kind != ElementKind.GLOBAL) continue; @@ -4011,159 +3992,224 @@ export function compileIterateRoots(compiler: Compiler): void { ) { if (global.is(CommonFlags.INLINED)) { let value = global.constantIntegerValue; - exprs.push( - module.createCallIndirect( - module.createGetLocal(0, NativeType.I32), - [ + if (i64_low(value) || i64_high(value)) { + exprs.push( + module.call(visitInstance.internalName, [ compiler.options.isWasm64 - ? module.createI64(i64_low(value), i64_high(value)) - : module.createI32(i64_low(value)) - ], - typeName - ) - ); + ? module.i64(i64_low(value), i64_high(value)) + : module.i32(i64_low(value)) + ], NativeType.None) + ); + } } else { exprs.push( - module.createCallIndirect( - module.createGetLocal(0, NativeType.I32), - [ - module.createGetGlobal( - global.internalName, - compiler.options.nativeSizeType - ) - ], - typeName + module.if( + module.local_tee(1, + module.global_get(global.internalName, nativeSizeType) + ), + module.call(visitInstance.internalName, [ + module.local_get(1, nativeSizeType), // tempRef != null + module.local_get(0, NativeType.I32) // cookie + ], NativeType.None) ) ); } } } - module.addFunction("~iterateRoots", typeRef, [], + module.addFunction(BuiltinSymbols.visit_globals, typeRef, [ nativeSizeType ], exprs.length - ? module.createBlock(null, exprs) - : module.createNop() + ? module.block(null, exprs) + : module.nop() ); } -/** Ensures that the specified class's GC hook exists and returns its function table index. */ -export function ensureGCHook( - compiler: Compiler, - classInstance: Class -): u32 { +/** Compiles the `visit_members` function. */ +export function compileVisitMembers(compiler: Compiler): void { var program = compiler.program; - assert(classInstance.type.isManaged(program)); - - // check if the GC hook has already been created - { - let existingIndex = classInstance.gcHookIndex; - if (existingIndex != -1) return existingIndex; - } - - // check if the class implements a custom GC function (only valid for library elements) - var members = classInstance.members; - if (classInstance.isDeclaredInLibrary) { - if (members !== null && members.has("__gc")) { - let gcPrototype = assert(members.get("__gc")); - assert(gcPrototype.kind == ElementKind.FUNCTION_PROTOTYPE); - let gcInstance = assert(program.resolver.resolveFunction(gcPrototype, null)); - assert(gcInstance.is(CommonFlags.PRIVATE | CommonFlags.INSTANCE)); - assert(!gcInstance.isAny(CommonFlags.AMBIENT | CommonFlags.VIRTUAL)); - assert(gcInstance.signature.parameterTypes.length == 0); - assert(gcInstance.signature.returnType == Type.void); - gcInstance.internalName = classInstance.internalName + "~gc"; - assert(compiler.compileFunction(gcInstance)); - let index = compiler.ensureFunctionTableEntry(gcInstance); - classInstance.gcHookIndex = index; - return index; - } - } - var module = compiler.module; - var options = compiler.options; - var nativeSizeType = options.nativeSizeType; - var nativeSizeSize = options.usizeType.byteSize; - var body = new Array(); + var usizeType = program.options.usizeType; + var nativeSizeType = usizeType.toNativeType(); + var nativeSizeSize = usizeType.byteSize; + var ftype = compiler.ensureFunctionType([ usizeType, Type.i32 ], Type.void); // ref, cookie + var managedClasses = program.managedClasses; + var visitInstance = assert(program.visitInstance); + var blocks = new Array(); + var relooper = Relooper.create(module); - // nothing to mark if 'this' is null - body.push( - module.createIf( - module.createUnary( - options.isWasm64 - ? UnaryOp.EqzI64 - : UnaryOp.EqzI32, - module.createGetLocal(0, nativeSizeType) - ), - module.createReturn() + var outer = relooper.addBlockWithSwitch( + module.nop(), + module.load(nativeSizeSize, false, + nativeSizeType == NativeType.I64 + ? module.binary(BinaryOp.SubI64, + module.local_get(0, nativeSizeType), + module.i64(8) + ) + : module.binary(BinaryOp.SubI32, + module.local_get(0, nativeSizeType), + module.i32(8) // rtId is at -8 + ), + NativeType.I32, + 0 ) ); - // remember the function index so we don't recurse infinitely - var functionTable = compiler.functionTable; - var gcHookIndex = functionTable.length; - functionTable.push(""); - classInstance.gcHookIndex = gcHookIndex; + var lastId = 0; + for (let [id, instance] of managedClasses) { + assert(instance.type.isManaged); + assert(id == lastId++); - // if the class extends a base class, call its hook first (calls mark) - var baseInstance = classInstance.base; - if (baseInstance) { - assert(baseInstance.type.isManaged(program)); - body.push( - module.createCallIndirect( - module.createI32( - ensureGCHook(compiler, baseInstance.type.classReference) - ), - [ - module.createGetLocal(0, nativeSizeType) - ], - "FUNCSIG$" + (nativeSizeType == NativeType.I64 ? "vj" : "vi") - ) - ); + let visitImpl: Element | null; - // if this class is the top-most base class, mark the instance - } else { - body.push( - module.createCall(assert(program.gcMarkInstance).internalName, [ - module.createGetLocal(0, nativeSizeType) - ], NativeType.None) - ); - } + // if a library element, check if it implements a custom traversal function + if (instance.isDeclaredInLibrary && (visitImpl = instance.lookupInSelf("__visit_impl"))) { + assert(visitImpl.kind == ElementKind.FUNCTION_PROTOTYPE); + let visitFunc = program.resolver.resolveFunction(visitImpl, null); + let block: RelooperBlockRef; + if (!visitFunc || !compiler.compileFunction(visitFunc)) { + block = relooper.addBlock( + module.unreachable() + ); + } else { + let visitSig = visitFunc.signature; + assert( + visitSig.parameterTypes.length == 1 && + visitSig.parameterTypes[0] == Type.u32 && + visitSig.returnType == Type.void && + visitSig.thisType == instance.type + ); + let callExpr = module.call(visitFunc.internalName, [ + module.local_get(0, nativeSizeType), // ref + module.local_get(1, NativeType.I32) // cookie + ], NativeType.None); + block = relooper.addBlock( + instance.base + ? callExpr // branch will be added later + : module.block(null, [ + callExpr, + module.return() + ]) + ); + } + relooper.addBranchForSwitch(outer, block, [ id ]); + blocks.push(block); - // mark instances assigned to own fields that are again references - if (members) { - for (let member of members.values()) { - if (member.kind == ElementKind.FIELD) { - if ((member).parent === classInstance) { - let type = (member).type; - if (type.isManaged(program)) { - let offset = (member).memoryOffset; - assert(offset >= 0); - body.push( - module.createCall(assert(program.gcMarkInstance).internalName, [ - module.createLoad( - nativeSizeSize, - false, - module.createGetLocal(0, nativeSizeType), - nativeSizeType, - offset - ) - ], NativeType.None) - ); + // otherwise generate one + } else { + // traverse references assigned to own fields + let code = new Array(); + let members = instance.members; + if (members) { + for (let member of members.values()) { + if (member.kind == ElementKind.FIELD) { + if ((member).parent === instance) { + let fieldType = (member).type; + if (fieldType.isManaged) { + let fieldOffset = (member).memoryOffset; + assert(fieldOffset >= 0); + code.push( + // if ($2 = value) FIELDCLASS~traverse($2) + module.if( + module.local_tee(2, + module.load(nativeSizeSize, false, + module.local_get(0, nativeSizeType), + nativeSizeType, fieldOffset + ) + ), + module.call(visitInstance.internalName, [ + module.local_get(2, nativeSizeType), // ref + module.local_get(1, NativeType.I32) // cookie + ], NativeType.None) + ) + ); + } + } } } } + if (!instance.base) code.push(module.return()); + let block = relooper.addBlock( + flatten(module, code, NativeType.None) + ); + relooper.addBranchForSwitch(outer, block, [ id ]); + blocks.push(block); } } - - // add the function to the module and return its table index - var funcName = classInstance.internalName + "~gc"; - module.addFunction( - funcName, - compiler.ensureFunctionType(null, Type.void, options.usizeType), - null, - module.createBlock(null, body) + for (let [id, instance] of managedClasses) { + let base = instance.base; + if (base) { + relooper.addBranch(blocks[id], blocks[base.id]); + } + } + blocks.push( + relooper.addBlock( + module.unreachable() + ) ); - functionTable[gcHookIndex] = funcName; - return gcHookIndex; + relooper.addBranchForSwitch(outer, blocks[blocks.length - 1], []); // default + compiler.compileFunction(visitInstance); + module.addFunction(BuiltinSymbols.visit_members, ftype, [ nativeSizeType ], relooper.renderAndDispose(outer, 2)); +} + +function typeToRuntimeFlags(type: Type): TypeinfoFlags { + var flags = TypeinfoFlags.VALUE_ALIGN_0 * (1 << type.alignLog2); + if (type.is(TypeFlags.SIGNED)) flags |= TypeinfoFlags.VALUE_SIGNED; + if (type.is(TypeFlags.FLOAT)) flags |= TypeinfoFlags.VALUE_FLOAT; + if (type.is(TypeFlags.NULLABLE)) flags |= TypeinfoFlags.VALUE_NULLABLE; + if (type.isManaged) flags |= TypeinfoFlags.VALUE_MANAGED; + return flags / TypeinfoFlags.VALUE_ALIGN_0; +} + +/** Compiles runtime type information for use by stdlib. */ +export function compileRTTI(compiler: Compiler): void { + var program = compiler.program; + var module = compiler.module; + var managedClasses = program.managedClasses; + var count = managedClasses.size; + var size = 4 + 8 * count; + var data = new Uint8Array(size); + writeI32(count, data, 0); + var off = 4; + var abvInstance = program.arrayBufferViewInstance; + var abvPrototype = abvInstance.prototype; + var arrayPrototype = program.arrayPrototype; + var setPrototype = program.setPrototype; + var mapPrototype = program.mapPrototype; + var lastId = 0; + for (let [id, instance] of managedClasses) { + assert(id == lastId++); + let flags: TypeinfoFlags = 0; + if (instance.isAcyclic) flags |= TypeinfoFlags.ACYCLIC; + if (instance !== abvInstance && instance.extends(abvPrototype)) { + let valueType = instance.getArrayValueType(); + flags |= TypeinfoFlags.ARRAYBUFFERVIEW; + if (instance.extends(arrayPrototype)) flags |= TypeinfoFlags.ARRAY; + flags |= TypeinfoFlags.VALUE_ALIGN_0 * typeToRuntimeFlags(valueType); + } else if (instance.extends(setPrototype)) { + let typeArguments = assert(instance.getTypeArgumentsTo(setPrototype)); + assert(typeArguments.length == 1); + flags |= TypeinfoFlags.SET; + flags |= TypeinfoFlags.VALUE_ALIGN_0 * typeToRuntimeFlags(typeArguments[0]); + } else if (instance.extends(mapPrototype)) { + let typeArguments = assert(instance.getTypeArgumentsTo(mapPrototype)); + assert(typeArguments.length == 2); + flags |= TypeinfoFlags.MAP; + flags |= TypeinfoFlags.KEY_ALIGN_0 * typeToRuntimeFlags(typeArguments[0]); + flags |= TypeinfoFlags.VALUE_ALIGN_0 * typeToRuntimeFlags(typeArguments[1]); + } + writeI32(flags, data, off); off += 4; + instance.rttiFlags = flags; + let base = instance.base; + writeI32(base ? base.id : 0, data, off); off += 4; + } + assert(off == size); + var usizeType = program.options.usizeType; + var segment = compiler.addMemorySegment(data); + if (usizeType.size == 8) { + let offset = segment.offset; + module.addGlobal(BuiltinSymbols.rtti_base, NativeType.I64, false, module.i64(i64_low(offset), i64_high(offset))); + } else { + module.addGlobal(BuiltinSymbols.rtti_base, NativeType.I32, false, module.i32(i64_low(segment.offset))); + } } // Helpers @@ -4188,7 +4234,7 @@ function evaluateConstantType( if (operands.length == 1) { // optional type argument if (typeArguments) { if (typeArguments.length == 1) { - compiler.compileExpression(operands[0], typeArguments[0], ConversionKind.IMPLICIT, WrapMode.NONE); + compiler.compileExpression(operands[0], typeArguments[0], ContextualFlags.IMPLICIT); } else { if (typeArguments.length) { compiler.error( @@ -4197,10 +4243,10 @@ function evaluateConstantType( ); return null; } - compiler.compileExpressionRetainType(operands[0], Type.i32, WrapMode.NONE); + compiler.compileExpressionRetainType(operands[0], Type.i32); } } else { - compiler.compileExpressionRetainType(operands[0], Type.i32, WrapMode.NONE); + compiler.compileExpressionRetainType(operands[0], Type.i32); } return compiler.currentType; } @@ -4222,7 +4268,7 @@ function evaluateImmediateOffset(expression: Expression, compiler: Compiler): i3 var expr: ExpressionRef; var value: i32; if (compiler.options.isWasm64) { - expr = compiler.precomputeExpression(expression, Type.usize64, ConversionKind.IMPLICIT, WrapMode.NONE); + expr = compiler.precomputeExpression(expression, Type.usize64, ContextualFlags.IMPLICIT); if ( getExpressionId(expr) != ExpressionId.Const || getExpressionType(expr) != NativeType.I64 || @@ -4236,7 +4282,7 @@ function evaluateImmediateOffset(expression: Expression, compiler: Compiler): i3 value = -1; } } else { - expr = compiler.precomputeExpression(expression, Type.usize32, ConversionKind.IMPLICIT, WrapMode.NONE); + expr = compiler.precomputeExpression(expression, Type.usize32, ContextualFlags.IMPLICIT); if ( getExpressionId(expr) != ExpressionId.Const || getExpressionType(expr) != NativeType.I32 || diff --git a/src/common.ts b/src/common.ts index e2518b28a3..3191265603 100644 --- a/src/common.ts +++ b/src/common.ts @@ -75,6 +75,7 @@ export enum CommonFlags { // Other + /** Is quoted. */ QUOTED = 1 << 28 } @@ -141,10 +142,6 @@ export namespace CommonSymbols { export const this_ = "this"; export const super_ = "super"; export const constructor = "constructor"; -} - -/** Common standard library symbols. */ -export namespace LibrarySymbols { // constants export const ASC_TARGET = "ASC_TARGET"; export const ASC_NO_TREESHAKING = "ASC_NO_TREESHAKING"; @@ -174,17 +171,41 @@ export namespace LibrarySymbols { export const V128 = "V128"; export const String = "String"; export const Array = "Array"; + export const FixedArray = "FixedArray"; + export const Set = "Set"; + export const Map = "Map"; + export const ArrayBufferView = "ArrayBufferView"; export const ArrayBuffer = "ArrayBuffer"; export const Math = "Math"; export const Mathf = "Mathf"; + export const Int8Array = "Int8Array"; + export const Int16Array = "Int16Array"; + export const Int32Array = "Int32Array"; + export const Int64Array = "Int64Array"; + export const Uint8Array = "Uint8Array"; + export const Uint8ClampedArray = "Uint8ClampedArray"; + export const Uint16Array = "Uint16Array"; + export const Uint32Array = "Uint32Array"; + export const Uint64Array = "Uint64Array"; + export const Float32Array = "Float32Array"; + export const Float64Array = "Float64Array"; // runtime - export const memory = "memory"; - export const allocate = "allocate"; export const abort = "abort"; - export const main = "main"; - // other - export const length = "length"; - export const byteLength = "byteLength"; export const pow = "pow"; export const mod = "mod"; + export const alloc = "__alloc"; + export const realloc = "__realloc"; + export const free = "__free"; + export const retain = "__retain"; + export const release = "__release"; + export const collect = "__collect"; + export const typeinfo = "__typeinfo"; + export const instanceof_ = "__instanceof"; + export const visit = "__visit"; + export const allocArray = "__allocArray"; } + +// shared +export { Feature } from "../std/assembly/shared/feature"; +export { Target } from "../std/assembly/shared/target"; +export { Typeinfo, TypeinfoFlags } from "../std/assembly/shared/typeinfo"; diff --git a/src/compiler.ts b/src/compiler.ts index 534d08ca33..cedc477cb9 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -4,11 +4,12 @@ *//***/ import { + BuiltinSymbols, compileCall as compileBuiltinCall, compileAbort, - compileIterateRoots, - ensureGCHook, - BuiltinSymbols + compileVisitGlobals, + compileVisitMembers, + compileRTTI, } from "./builtins"; import { @@ -37,7 +38,11 @@ import { getBlockChildCount, getBlockChild, getBlockName, - needsExplicitUnreachable + needsExplicitUnreachable, + getLocalGetIndex, + FeatureFlags, + isLocalTee, + getLocalSetIndex } from "./module"; import { @@ -46,9 +51,10 @@ import { STATIC_DELIMITER, GETTER_PREFIX, SETTER_PREFIX, - LibrarySymbols, CommonSymbols, - INDEX_SUFFIX + INDEX_SUFFIX, + Feature, + Target } from "./common"; import { @@ -77,7 +83,9 @@ import { import { FlowFlags, - Flow + Flow, + LocalFlags, + findUsedLocals } from "./flow"; import { @@ -148,7 +156,8 @@ import { nodeIsConstantValue, findDecorator, - isTypeOmitted + isTypeOmitted, + ExportDefaultStatement } from "./ast"; import { @@ -156,7 +165,6 @@ import { TypeKind, TypeFlags, Signature, - typesToNativeTypes } from "./types"; @@ -170,14 +178,6 @@ import { makeMap } from "./util"; -/** Compilation target. */ -export enum Target { - /** WebAssembly with 32-bit pointers. */ - WASM32, - /** WebAssembly with 64-bit pointers. Experimental and not supported by any runtime yet. */ - WASM64 -} - /** Compiler options. */ export class Options { @@ -193,6 +193,8 @@ export class Options { importTable: bool = false; /** If true, generates information necessary for source maps. */ sourceMap: bool = false; + /** If true, generates an explicit start function. */ + explicitStart: bool = false; /** Static memory start offset. */ memoryBase: i32 = 0; /** Global aliases. */ @@ -231,38 +233,38 @@ export class Options { } } -/** Indicates specific features to activate. */ -export const enum Feature { - /** No additional features. */ +/** Requests or indicates compilation conditions of statements and expressions. */ +export const enum ContextualFlags { NONE = 0, - /** Sign extension operations. */ - SIGN_EXTENSION = 1 << 0, // see: https://github.com/WebAssembly/sign-extension-ops - /** Mutable global imports and exports. */ - MUTABLE_GLOBAL = 1 << 1, // see: https://github.com/WebAssembly/mutable-global - /** Bulk memory operations. */ - BULK_MEMORY = 1 << 2, // see: https://github.com/WebAssembly/bulk-memory-operations - /** SIMD types and operations. */ - SIMD = 1 << 3, // see: https://github.com/WebAssembly/simd - /** Threading and atomic operations. */ - THREADS = 1 << 4 // see: https://github.com/WebAssembly/threads -} -/** Indicates the desired kind of a conversion. */ -export const enum ConversionKind { - /** No conversion. */ - NONE, - /** Implicit conversion. */ - IMPLICIT, - /** Explicit conversion. */ - EXPLICIT + /** Implicit conversion required. */ + IMPLICIT = 1 << 0, + /** Explicit conversion required. */ + EXPLICIT = 1 << 1, + /** Small integer wrap required. */ + WRAP = 1 << 2, + + /** Value is known to be immediately dropped. */ + WILL_DROP = 1 << 3, + /** Value is known to be immediately assigned to a retaining target. */ + SKIP_AUTORELEASE = 1 << 4, + /** Is the last statement in a function body. */ + LAST_IN_BODY = 1 << 5, + /** Data can be compiled statically. */ + STATIC_CAPABLE = 1 << 6 } -/** Indicates the desired wrap mode of a conversion. */ -export const enum WrapMode { - /** No wrapping. */ - NONE, - /** Wrap small integer values. */ - WRAP +/** Runtime features to be activated by the compiler. */ +export const enum RuntimeFeatures { + NONE = 0, + /** Requires heap setup. */ + HEAP = 1 << 0, + /** Requires runtime type information setup. */ + RTTI = 1 << 1, + /** Requires the built-in globals visitor. */ + visitGlobals = 1 << 2, + /** Requires the built-in members visitor. */ + visitMembers = 1 << 3 } /** Compiler interface. */ @@ -298,8 +300,10 @@ export class Compiler extends DiagnosticEmitter { argcVar: GlobalRef = 0; /** Argument count helper setter. */ argcSet: FunctionRef = 0; - /** Indicates whether the iterateRoots function must be generated. */ - needsIterateRoots: bool = false; + /** Requires runtime features. */ + runtimeFeatures: RuntimeFeatures = RuntimeFeatures.NONE; + /** Expressions known to have skipped an autorelease. Usually function returns. */ + skippedAutoreleases: Set = new Set(); /** Compiles a {@link Program} to a {@link Module} using the specified options. */ static compile(program: Program, options: Options | null = null): Module { @@ -319,6 +323,15 @@ export class Compiler extends DiagnosticEmitter { max(options.memoryBase, 8) ); this.module = Module.create(); + var featureFlags: BinaryenFeatureFlags = 0; + if (this.options.hasFeature(Feature.THREADS)) featureFlags |= FeatureFlags.Atomics; + if (this.options.hasFeature(Feature.MUTABLE_GLOBAL)) featureFlags |= FeatureFlags.MutableGloabls; + // if (this.options.hasFeature(Feature.TRUNC_SAT)) featureFlags |= FeatureFlags.NontrappingFPToInt; + if (this.options.hasFeature(Feature.SIMD)) featureFlags |= FeatureFlags.SIMD128; + if (this.options.hasFeature(Feature.BULK_MEMORY)) featureFlags |= FeatureFlags.BulkMemory; + if (this.options.hasFeature(Feature.SIGN_EXTENSION)) featureFlags |= FeatureFlags.SignExt; + // if (this.options.hasFeature(Feature.EXCEPTION_HANDLING)) featureFlags |= FeatureFlags.ExceptionHandling; + this.module.setFeatures(featureFlags); } /** Performs compilation of the underlying {@link Program} to a {@link Module}. */ @@ -337,21 +350,13 @@ export class Compiler extends DiagnosticEmitter { this.currentFlow = startFunctionInstance.flow; this.currentBody = startFunctionBody; - // add a mutable heap base dummy + // add a mutable heap and rtti base dummies if (options.isWasm64) { - module.addGlobal( - BuiltinSymbols.HEAP_BASE, - NativeType.I64, - true, - module.createI64(0, 0) - ); + module.addGlobal(BuiltinSymbols.heap_base, NativeType.I64, true, module.i64(0)); + module.addGlobal(BuiltinSymbols.rtti_base, NativeType.I64, true, module.i64(0)); } else { - module.addGlobal( - BuiltinSymbols.HEAP_BASE, - NativeType.I32, - false, - module.createI32(0) - ); + module.addGlobal(BuiltinSymbols.heap_base, NativeType.I32, true, module.i32(0)); + module.addGlobal(BuiltinSymbols.rtti_base, NativeType.I32, true, module.i32(0)); } // compile entry file(s) while traversing reachable elements @@ -363,10 +368,21 @@ export class Compiler extends DiagnosticEmitter { } } - // compile the start function if not empty or called by main - var explicitStartFunction = program.explicitStartFunction; - if (startFunctionBody.length || explicitStartFunction) { + // compile the start function if not empty or explicitly requested + var startIsEmpty = !startFunctionBody.length; + var explicitStart = options.explicitStart; + if (!startIsEmpty || explicitStart) { let signature = startFunctionInstance.signature; + if (!startIsEmpty && explicitStart) { + module.addGlobal(BuiltinSymbols.started, NativeType.I32, true, module.i32(0)); + startFunctionBody.unshift( + module.if( + module.global_get(BuiltinSymbols.started, NativeType.I32), + module.return(), + module.global_set(BuiltinSymbols.started, module.i32(1)) + ) + ); + } let funcRef = module.addFunction( startFunctionInstance.internalName, this.ensureFunctionType( @@ -375,31 +391,40 @@ export class Compiler extends DiagnosticEmitter { signature.thisType ), typesToNativeTypes(startFunctionInstance.additionalLocals), - module.createBlock(null, startFunctionBody) + module.block(null, startFunctionBody) ); startFunctionInstance.finalize(module, funcRef); - if (!explicitStartFunction) module.setStart(funcRef); + if (!explicitStart) module.setStart(funcRef); + else module.addFunctionExport(startFunctionInstance.internalName, "__start"); } + // compile runtime features + if (this.runtimeFeatures & RuntimeFeatures.visitGlobals) compileVisitGlobals(this); + if (this.runtimeFeatures & RuntimeFeatures.visitMembers) compileVisitMembers(this); + module.removeGlobal(BuiltinSymbols.rtti_base); + if (this.runtimeFeatures & RuntimeFeatures.RTTI) compileRTTI(this); + // update the heap base pointer var memoryOffset = this.memoryOffset; memoryOffset = i64_align(memoryOffset, options.usizeType.byteSize); this.memoryOffset = memoryOffset; - module.removeGlobal(BuiltinSymbols.HEAP_BASE); - if (options.isWasm64) { - module.addGlobal( - BuiltinSymbols.HEAP_BASE, - NativeType.I64, - false, - module.createI64(i64_low(memoryOffset), i64_high(memoryOffset)) - ); - } else { - module.addGlobal( - BuiltinSymbols.HEAP_BASE, - NativeType.I32, - false, - module.createI32(i64_low(memoryOffset)) - ); + module.removeGlobal(BuiltinSymbols.heap_base); + if (this.runtimeFeatures & RuntimeFeatures.HEAP) { + if (options.isWasm64) { + module.addGlobal( + BuiltinSymbols.heap_base, + NativeType.I64, + false, + module.i64(i64_low(memoryOffset), i64_high(memoryOffset)) + ); + } else { + module.addGlobal( + BuiltinSymbols.heap_base, + NativeType.I32, + false, + module.i32(i64_low(memoryOffset)) + ); + } } // set up memory @@ -421,35 +446,30 @@ export class Compiler extends DiagnosticEmitter { // set up function table var functionTable = this.functionTable; module.setFunctionTable(functionTable.length, 0xffffffff, functionTable); - module.addTableExport("0", "table"); - module.addFunction("null", this.ensureFunctionType(null, Type.void), null, module.createBlock(null, [])); + module.addFunction("null", this.ensureFunctionType(null, Type.void), null, module.block(null, [])); // import table if requested (default table is named '0' by Binaryen) if (options.importTable) module.addTableImport("0", "env", "table"); // set up module exports for (let file of this.program.filesByName.values()) { - if (file.source.isEntry) this.makeModuleExports(file); + if (file.source.isEntry) this.ensureModuleExports(file); } - - // set up gc - if (this.needsIterateRoots) compileIterateRoots(this); - return module; } /** Applies the respective module exports for the specified file. */ - private makeModuleExports(file: File): void { + private ensureModuleExports(file: File): void { var members = file.exports; - if (members) for (let [name, member] of members) this.makeModuleExport(name, member); + if (members) for (let [name, member] of members) this.ensureModuleExport(name, member); var exportsStar = file.exportsStar; if (exportsStar) { - for (let i = 0, k = exportsStar.length; i < k; ++i) this.makeModuleExports(exportsStar[i]); + for (let i = 0, k = exportsStar.length; i < k; ++i) this.ensureModuleExports(exportsStar[i]); } } /** Applies the respective module export(s) for the specified element. */ - private makeModuleExport(name: string, element: Element, prefix: string = ""): void { + private ensureModuleExport(name: string, element: Element, prefix: string = ""): void { switch (element.kind) { // traverse instances @@ -462,7 +482,7 @@ export class Compiler extends DiagnosticEmitter { let fullName = instance.internalName; instanceName += fullName.substring(fullName.lastIndexOf("<")); } - this.makeModuleExport(instanceName, instance, prefix); + this.ensureModuleExport(instanceName, instance, prefix); } } break; @@ -476,7 +496,7 @@ export class Compiler extends DiagnosticEmitter { let fullName = instance.internalName; instanceName += fullName.substring(fullName.lastIndexOf("<")); } - this.makeModuleExport(instanceName, instance, prefix); + this.ensureModuleExport(instanceName, instance, prefix); } } break; @@ -484,8 +504,8 @@ export class Compiler extends DiagnosticEmitter { case ElementKind.PROPERTY_PROTOTYPE: { let getter = (element).getterPrototype; let setter = (element).setterPrototype; - if (getter) this.makeModuleExport(GETTER_PREFIX + name, getter, prefix); - if (setter) this.makeModuleExport(SETTER_PREFIX + name, setter, prefix); + if (getter) this.ensureModuleExport(GETTER_PREFIX + name, getter, prefix); + if (setter) this.ensureModuleExport(SETTER_PREFIX + name, setter, prefix); break; } @@ -526,58 +546,31 @@ export class Compiler extends DiagnosticEmitter { } case ElementKind.PROPERTY: { let getter = (element).getterInstance; - if (getter) this.makeModuleExport(GETTER_PREFIX + name, getter, prefix); + if (getter) this.ensureModuleExport(GETTER_PREFIX + name, getter, prefix); let setter = (element).setterInstance; - if (setter) this.makeModuleExport(SETTER_PREFIX + name, setter, prefix); + if (setter) this.ensureModuleExport(SETTER_PREFIX + name, setter, prefix); break; } case ElementKind.FIELD: { - let module = this.module; - let type = (element).type; - let nativeType = type.toNativeType(); - let offset = (element).memoryOffset; - let usizeType = this.options.usizeType; - let nativeSizeType = this.options.nativeSizeType; - - // make a getter - let getterName = prefix + GETTER_PREFIX + name; - module.addFunction( - getterName, - this.ensureFunctionType(null, type, usizeType), - null, - module.createLoad( - type.byteSize, - type.is(TypeFlags.SIGNED), - module.createGetLocal(0, nativeSizeType), - nativeType, - offset - ) - ); - module.addFunctionExport(getterName, getterName); - - // make a setter + this.ensureModuleFieldGetter(prefix + GETTER_PREFIX + name, element); if (!element.is(CommonFlags.READONLY)) { - let setterName = prefix + SETTER_PREFIX + name; - module.addFunction( - setterName, - this.ensureFunctionType([ type ], Type.void, usizeType), - null, - module.createStore( - type.byteSize, - module.createGetLocal(0, nativeSizeType), - module.createGetLocal(1, nativeType), - nativeType, - offset - ) - ); - module.addFunctionExport(setterName, setterName); + this.ensureModuleFieldSetter(prefix + SETTER_PREFIX + name, element); + } + break; + } + case ElementKind.CLASS: { + // make the class name itself represent its runtime id + if (!(element).type.isUnmanaged) { + let module = this.module; + let internalName = (element).internalName; + module.addGlobal(internalName, NativeType.I32, false, module.i32((element).id)); + module.addGlobalExport(internalName, prefix + name); } break; } // just traverse members below case ElementKind.ENUM: - case ElementKind.CLASS: case ElementKind.NAMESPACE: case ElementKind.FILE: case ElementKind.TYPEDEFINITION: break; @@ -598,18 +591,70 @@ export class Compiler extends DiagnosticEmitter { ) { for (let member of members.values()) { if (!member.is(CommonFlags.EXPORT)) continue; - this.makeModuleExport(member.name, member, subPrefix); + this.ensureModuleExport(member.name, member, subPrefix); } } else { for (let member of members.values()) { if (member.is(CommonFlags.PRIVATE)) continue; - this.makeModuleExport(member.name, member, subPrefix); + this.ensureModuleExport(member.name, member, subPrefix); } } } } - // general + /** Makes a function to get the value of a field of an exported class. */ + private ensureModuleFieldGetter(name: string, field: Field): void { + var module = this.module; + var type = field.type; + var usizeType = this.options.usizeType; + var loadExpr = module.load(type.byteSize, type.is(TypeFlags.SIGNED), + module.local_get(0, usizeType.toNativeType()), + type.toNativeType(), field.memoryOffset + ); + // a user-defined getter would return a retained value, so: + if (type.isManaged) loadExpr = this.makeRetain(loadExpr); + module.addFunction( + name, + this.ensureFunctionType(null, type, usizeType), + null, + loadExpr + ); + module.addFunctionExport(name, name); + } + + /** Makes a function to set the value of a field of an exported class. */ + private ensureModuleFieldSetter(name: string, field: Field): void { + var module = this.module; + var type = field.type; + var nativeType = type.toNativeType(); + var usizeType = this.options.usizeType; + var nativeSizeType = usizeType.toNativeType(); + var valueExpr = module.local_get(1, nativeType); + if (type.isManaged) { + valueExpr = this.makeRetainRelease( + module.load(type.byteSize, false, // oldRef + module.local_get(0, nativeSizeType), + nativeType, field.memoryOffset + ), + valueExpr // newRef + ); + } + module.addFunction( + name, + this.ensureFunctionType([ type ], Type.void, usizeType), + null, + module.store( + type.byteSize, + module.local_get(0, nativeSizeType), + valueExpr, + nativeType, + field.memoryOffset + ) + ); + module.addFunctionExport(name, name); + } + + // === Elements ================================================================================= /** Compiles any element. */ compileElement(element: Element, compileMembers: bool = true): void { @@ -664,7 +709,12 @@ export class Compiler extends DiagnosticEmitter { var exports = file.exports; if (exports) for (let element of exports.values()) this.compileElement(element); var exportsStar = file.exportsStar; - if (exportsStar) for (let exportStar of exportsStar) this.compileFile(exportStar); + if (exportsStar) { + for (let exportStar of exportsStar) { + this.compileFile(exportStar); + this.compileExports(exportStar); + } + } } // files @@ -701,10 +751,12 @@ export class Compiler extends DiagnosticEmitter { // compile top-level statements var previousFlow = this.currentFlow; - this.currentFlow = startFunction.flow; + var flow = startFunction.flow; + this.currentFlow = flow; for (let statements = file.source.statements, i = 0, k = statements.length; i < k; ++i) { this.compileTopLevelStatement(statements[i], startFunctionBody); } + this.finishAutoreleases(flow, startFunctionBody); this.currentFlow = previousFlow; this.currentBody = previousBody; @@ -720,16 +772,16 @@ export class Compiler extends DiagnosticEmitter { this.ensureFunctionType(startFunction.signature.parameterTypes, startFunction.signature.returnType), varTypes, startFunctionBody.length > 1 - ? module.createBlock(null, startFunctionBody) + ? module.block(null, startFunctionBody) : startFunctionBody[0] ); previousBody.push( - module.createCall(startFunction.internalName, null, NativeType.None) + module.call(startFunction.internalName, null, NativeType.None) ); } } - // globals + // === Globals ================================================================================== compileGlobal(global: Global): bool { if (global.is(CommonFlags.COMPILED)) return true; @@ -737,12 +789,13 @@ export class Compiler extends DiagnosticEmitter { var module = this.module; var initExpr: ExpressionRef = 0; + var initAutoreleaseSkipped: bool = false; var typeNode = global.typeNode; var initializerNode = global.initializerNode; if (!global.is(CommonFlags.RESOLVED)) { - // resolve now if annotated + // Resolve type if annotated if (typeNode) { let resolvedType = this.resolver.resolveType(typeNode, global.parent); // reports if (!resolvedType) return false; @@ -755,17 +808,16 @@ export class Compiler extends DiagnosticEmitter { } global.setType(resolvedType); - // infer from initializer if not annotated - } else if (initializerNode) { // infer type using void/NONE for literal inference + // Otherwise infer type from initializer + } else if (initializerNode) { let previousFlow = this.currentFlow; if (global.hasDecorator(DecoratorFlags.LAZY)) { this.currentFlow = global.file.startFunction.flow; } - initExpr = this.compileExpressionRetainType( // reports - initializerNode, - Type.void, - WrapMode.WRAP + initExpr = this.compileExpression(initializerNode, Type.i32, // reports + ContextualFlags.WRAP | ContextualFlags.SKIP_AUTORELEASE ); + if (this.skippedAutoreleases.has(initExpr)) initAutoreleaseSkipped = true; this.currentFlow = previousFlow; if (this.currentType == Type.void) { this.error( @@ -776,7 +828,7 @@ export class Compiler extends DiagnosticEmitter { } global.setType(this.currentType); - // must either be annotated or have an initializer + // Error if there's neither a type nor an initializer } else { this.error( DiagnosticCode.Type_expected, @@ -786,16 +838,22 @@ export class Compiler extends DiagnosticEmitter { } } - // ambient builtins like 'HEAP_BASE' need to be resolved but are added explicitly - if (global.is(CommonFlags.AMBIENT) && global.hasDecorator(DecoratorFlags.BUILTIN)) return true; + // Handle ambient builtins like '__heap_base' that need to be resolved but are added explicitly + if (global.is(CommonFlags.AMBIENT) && global.hasDecorator(DecoratorFlags.BUILTIN)) { + if (global.internalName == BuiltinSymbols.heap_base) this.runtimeFeatures |= RuntimeFeatures.HEAP; + else if (global.internalName == BuiltinSymbols.rtti_base) this.runtimeFeatures |= RuntimeFeatures.RTTI; + return true; + } - var nativeType = global.type.toNativeType(); + var type = global.type; + var nativeType = type.toNativeType(); var isDeclaredConstant = global.is(CommonFlags.CONST) || global.is(CommonFlags.STATIC | CommonFlags.READONLY); + var isDeclaredInline = global.hasDecorator(DecoratorFlags.INLINE); - // handle imports + // Handle imports if (global.is(CommonFlags.AMBIENT)) { - // constant global + // Constant global or mutable globals enabled if (isDeclaredConstant || this.options.hasFeature(Feature.MUTABLE_GLOBAL)) { global.set(CommonFlags.MODULE_IMPORT); mangleImportName(global, global.declaration); @@ -808,7 +866,7 @@ export class Compiler extends DiagnosticEmitter { global.set(CommonFlags.COMPILED); return true; - // importing mutable globals is not supported in the MVP + // Importing mutable globals is not supported in the MVP } else { this.error( DiagnosticCode.Operation_not_supported, @@ -818,44 +876,41 @@ export class Compiler extends DiagnosticEmitter { return false; } - // the MVP does not yet support initializer expressions other than constant values (and constant + // The MVP does not yet support initializer expressions other than constant values (and constant // get_globals), hence such initializations must be performed in the start function for now. var initializeInStart = false; - // evaluate initializer if present + // Evaluate initializer if present if (initializerNode) { if (!initExpr) { let previousFlow = this.currentFlow; if (global.hasDecorator(DecoratorFlags.LAZY)) { this.currentFlow = global.file.startFunction.flow; } - initExpr = this.compileExpression( - initializerNode, - global.type, - ConversionKind.IMPLICIT, - WrapMode.WRAP + initExpr = this.compileExpression(initializerNode, type, + ContextualFlags.IMPLICIT | ContextualFlags.WRAP | ContextualFlags.SKIP_AUTORELEASE | ContextualFlags.STATIC_CAPABLE ); + if (this.skippedAutoreleases.has(initExpr)) initAutoreleaseSkipped = true; this.currentFlow = previousFlow; } if (getExpressionId(initExpr) != ExpressionId.Const) { if (isDeclaredConstant) { initExpr = module.precomputeExpression(initExpr); - if (getExpressionId(initExpr) != ExpressionId.Const) { - this.warning( - DiagnosticCode.Compiling_constant_with_non_constant_initializer_as_mutable, - initializerNode.range - ); - initializeInStart = true; - } + if (getExpressionId(initExpr) != ExpressionId.Const) initializeInStart = true; } else { initializeInStart = true; } } - // explicitly inline if annotated - if (global.hasDecorator(DecoratorFlags.INLINE)) { - if (!initializeInStart) { // reported above + // Explicitly inline if annotated + if (isDeclaredInline) { + if (initializeInStart) { + this.warning( + DiagnosticCode.Mutable_value_cannot_be_inlined, + initializerNode.range + ); + } else { assert(getExpressionId(initExpr) == ExpressionId.Const); let exprType = getExpressionType(initExpr); switch (exprType) { @@ -891,30 +946,32 @@ export class Compiler extends DiagnosticEmitter { } } - // initialize to zero if there's no initializer + // Initialize to zero if there's no initializer } else { - initExpr = global.type.toNativeZero(module); + initExpr = type.toNativeZero(module); } var internalName = global.internalName; if (initializeInStart) { // initialize to mutable zero and set the actual value in start - if (global.hasDecorator(DecoratorFlags.INLINE)) { + if (isDeclaredInline) { this.error( DiagnosticCode.Decorator_0_is_not_valid_here, - global.identifierNode.range, "inline" + assert(findDecorator(DecoratorKind.INLINE, global.decoratorNodes)).range, "inline" ); } - module.addGlobal(internalName, nativeType, true, global.type.toNativeZero(module)); - this.currentBody.push(module.createSetGlobal(internalName, initExpr)); - - } else if (!global.hasDecorator(DecoratorFlags.INLINE)) { // compile normally + module.addGlobal(internalName, nativeType, true, type.toNativeZero(module)); + if (type.isManaged && !initAutoreleaseSkipped) initExpr = this.makeRetain(initExpr); + this.currentBody.push( + module.global_set(internalName, initExpr) + ); + } else if (!isDeclaredInline) { // compile normally module.addGlobal(internalName, nativeType, !isDeclaredConstant, initExpr); } return true; } - // enums + // === Enums ==================================================================================== compileEnum(element: Enum): bool { if (element.is(CommonFlags.COMPILED)) return true; @@ -939,11 +996,8 @@ export class Compiler extends DiagnosticEmitter { } let initExpr: ExpressionRef; if (valueNode) { - initExpr = this.compileExpression( - valueNode, - Type.i32, - ConversionKind.IMPLICIT, - WrapMode.NONE + initExpr = this.compileExpression(valueNode, Type.i32, + ContextualFlags.IMPLICIT // autorelease is not applicable in i32 context ); if (getExpressionId(initExpr) != ExpressionId.Const) { initExpr = module.precomputeExpression(initExpr); @@ -958,7 +1012,7 @@ export class Compiler extends DiagnosticEmitter { } } } else if (previousValue == null) { - initExpr = module.createI32(0); + initExpr = module.i32(0); } else { if (previousValueIsMut) { this.error( @@ -966,9 +1020,9 @@ export class Compiler extends DiagnosticEmitter { (member).identifierNode.range.atEnd ); } - initExpr = module.createBinary(BinaryOp.AddI32, - module.createGetGlobal(previousValue.internalName, NativeType.I32), - module.createI32(1) + initExpr = module.binary(BinaryOp.AddI32, + module.global_get(previousValue.internalName, NativeType.I32), + module.i32(1) ); initExpr = module.precomputeExpression(initExpr); if (getExpressionId(initExpr) != ExpressionId.Const) { @@ -983,9 +1037,9 @@ export class Compiler extends DiagnosticEmitter { } this.currentFlow = previousFlow; if (initInStart) { - module.addGlobal(val.internalName, NativeType.I32, true, module.createI32(0)); + module.addGlobal(val.internalName, NativeType.I32, true, module.i32(0)); this.currentBody.push( - module.createSetGlobal(val.internalName, initExpr) + this.makeGlobalAssignment(val, initExpr, false) ); previousValueIsMut = true; } else { @@ -1007,7 +1061,7 @@ export class Compiler extends DiagnosticEmitter { return true; } - // functions + // === Functions ================================================================================ /** Resolves the specified type arguments prior to compiling the resulting function instance. */ compileFunctionUsingTypeArguments( @@ -1061,16 +1115,20 @@ export class Compiler extends DiagnosticEmitter { } /** Compiles the body of a function within the specified flow. */ - private compileFunctionBody(instance: Function): ExpressionRef[] { + compileFunctionBody( + /** Function to compile. */ + instance: Function, + /** Target array of statements. */ + stmts: ExpressionRef[] | null = null + ): ExpressionRef[] { var module = this.module; var bodyNode = assert(instance.prototype.bodyNode); var returnType = instance.signature.returnType; var flow = this.currentFlow; // compile statements - var stmts: BinaryenExportRef[]; if (bodyNode.kind == NodeKind.BLOCK) { - stmts = this.compileStatements((bodyNode).statements, true); + stmts = this.compileStatements((bodyNode).statements, true, stmts); } else { // must be an expression statement if not a block assert(bodyNode.kind == NodeKind.EXPRESSION); @@ -1081,32 +1139,28 @@ export class Compiler extends DiagnosticEmitter { // none of the following can be an arrow function assert(!instance.isAny(CommonFlags.CONSTRUCTOR | CommonFlags.GET | CommonFlags.SET | CommonFlags.MAIN)); - let stmt = this.compileExpression( - (bodyNode).expression, - returnType, - ConversionKind.IMPLICIT, - WrapMode.NONE - ); - flow.set(FlowFlags.RETURNS); - if (!flow.canOverflow(stmt, returnType)) flow.set(FlowFlags.RETURNS_WRAPPED); - stmts = [ stmt ]; - } - - // make the main function call `start` implicitly, but only once - if (instance.prototype == this.program.explicitStartFunction) { - module.addGlobal(CompilerSymbols.started, NativeType.I32, true, module.createI32(0)); - stmts.unshift( - module.createIf( - module.createUnary( - UnaryOp.EqzI32, - module.createGetGlobal(CompilerSymbols.started, NativeType.I32) - ), - module.createBlock(null, [ - module.createCall("start", null, NativeType.None), - module.createSetGlobal(CompilerSymbols.started, module.createI32(1)) - ]) - ) + let expr = this.compileExpression((bodyNode).expression, returnType, + ContextualFlags.IMPLICIT ); + if (!stmts) stmts = [ expr ]; + else stmts.push(expr); + if (!flow.isAny(FlowFlags.ANY_TERMINATING)) { // TODO: detect if returning an autorelease local? + let indexBefore = stmts.length; + this.performAutoreleases(flow, stmts); + this.finishAutoreleases(flow, stmts); + let canOverflow = flow.canOverflow(expr, returnType); + let nonNull = flow.isNonnull(expr, returnType); + if (stmts.length > indexBefore) { + let temp = flow.getAndFreeTempLocal(returnType); + if (!canOverflow) flow.setLocalFlag(temp.index, LocalFlags.WRAPPED); + if (nonNull) flow.setLocalFlag(temp.index, LocalFlags.NONNULL); + stmts[indexBefore - 1] = module.local_set(temp.index, expr); + stmts.push(module.local_get(temp.index, returnType.toNativeType())); + } + if (!canOverflow) flow.set(FlowFlags.RETURNS_WRAPPED); + if (nonNull) flow.set(FlowFlags.RETURNS_NONNULL); + flow.set(FlowFlags.RETURNS); // now is terminating + } } // make constructors return their instance pointer @@ -1116,9 +1170,7 @@ export class Compiler extends DiagnosticEmitter { let classInstance = assert(instance.parent); assert(classInstance.kind == ElementKind.CLASS); if (!flow.isAny(FlowFlags.ANY_TERMINATING)) { - let thisLocalIndex = flow.is(FlowFlags.INLINE_CONTEXT) - ? assert(flow.lookupLocal(CommonSymbols.this_)).index - : 0; + let thisLocal = assert(flow.lookupLocal(CommonSymbols.this_)); // if `this` wasn't accessed before, allocate if necessary and initialize `this` if (!flow.is(FlowFlags.ALLOCATES)) { @@ -1128,22 +1180,23 @@ export class Compiler extends DiagnosticEmitter { // this.b = Y // } stmts.push( - module.createIf( - module.createUnary(nativeSizeType == NativeType.I64 ? UnaryOp.EqzI64 : UnaryOp.EqzI32, - module.createGetLocal(thisLocalIndex, nativeSizeType) + module.if( + module.unary(nativeSizeType == NativeType.I64 ? UnaryOp.EqzI64 : UnaryOp.EqzI32, + module.local_get(thisLocal.index, nativeSizeType) ), - module.createSetLocal(thisLocalIndex, - this.makeAllocation(classInstance) + module.local_set(thisLocal.index, + this.makeRetain( + this.makeAllocation(classInstance) + ), ) ) ); this.makeFieldInitialization(classInstance, stmts); } - - // implicitly return `this` - stmts.push( - module.createGetLocal(thisLocalIndex, nativeSizeType) - ); + this.performAutoreleases(flow, stmts); // `this` is excluded anyway + this.finishAutoreleases(flow, stmts); + stmts.push(module.local_get(thisLocal.index, this.options.nativeSizeType)); + flow.set(FlowFlags.RETURNS | FlowFlags.RETURNS_NONNULL); } // check that super has been called if this is a derived class @@ -1169,6 +1222,8 @@ export class Compiler extends DiagnosticEmitter { compileFunction(instance: Function): bool { if (instance.is(CommonFlags.COMPILED)) return true; assert(!(instance.is(CommonFlags.AMBIENT) && instance.hasDecorator(DecoratorFlags.BUILTIN))); + + var previousType = this.currentType; // remember to retain it if compiling a function lazily instance.set(CommonFlags.COMPILED); var module = this.module; @@ -1201,8 +1256,37 @@ export class Compiler extends DiagnosticEmitter { // compile body in this function's context let previousFlow = this.currentFlow; - this.currentFlow = instance.flow; - let stmts = this.compileFunctionBody(instance); + let flow = instance.flow; + this.currentFlow = flow; + let stmts = new Array(); + + // retain each argument for as long as the function lives + let index = 0; + let thisType = signature.thisType; + if (thisType) { + // No need to retain `this` as it can't be reassigned and thus can't become prematurely released + ++index; + } + let parameterTypes = signature.parameterTypes; + for (let i = 0, k = parameterTypes.length; i < k; ++i, ++index) { + let type = parameterTypes[i]; + if (type.isManaged) { + stmts.push( + module.drop( + this.makeRetain( + module.local_get(index, type.toNativeType()) + ) + ) + ); + flow.setLocalFlag(index, LocalFlags.RETAINED); + } + } + + this.compileFunctionBody(instance, stmts); + if (!flow.isAny(FlowFlags.ANY_TERMINATING)) { + this.performAutoreleases(flow, stmts); + this.finishAutoreleases(flow, stmts); + } this.currentFlow = previousFlow; // create the function @@ -1210,11 +1294,7 @@ export class Compiler extends DiagnosticEmitter { instance.internalName, typeRef, typesToNativeTypes(instance.additionalLocals), - stmts.length - ? stmts.length == 1 - ? stmts[0] - : module.createBlock(null, stmts, instance.signature.returnType.toNativeType()) - : module.createNop() + flatten(module, stmts, instance.signature.returnType.toNativeType()) ); // imported function @@ -1239,10 +1319,11 @@ export class Compiler extends DiagnosticEmitter { } instance.finalize(module, funcRef); + this.currentType = previousType; return true; } - // classes + // === Classes ================================================================================== compileClassUsingTypeArguments( prototype: ClassPrototype, @@ -1361,7 +1442,7 @@ export class Compiler extends DiagnosticEmitter { ); } - // memory + // === Memory =================================================================================== /** Adds a static memory segment with the specified data. */ addMemorySegment(buffer: Uint8Array, alignment: i32 = 8): MemorySegment { @@ -1372,7 +1453,144 @@ export class Compiler extends DiagnosticEmitter { return segment; } - // function table + /** Ensures that the specified string exists in static memory and returns a pointer to it. */ + ensureStaticString(stringValue: string): ExpressionRef { + var program = this.program; + var rtHeaderSize = program.runtimeHeaderSize; + var stringInstance = assert(program.stringInstance); + var stringSegment: MemorySegment; + var segments = this.stringSegments; + if (segments.has(stringValue)) { + stringSegment = segments.get(stringValue)!; // reuse + } else { + let length = stringValue.length; + let buffer = new Uint8Array(rtHeaderSize + (length << 1)); + program.writeRuntimeHeader(buffer, 0, stringInstance, length << 1); + for (let i = 0; i < length; ++i) { + writeI16(stringValue.charCodeAt(i), buffer, rtHeaderSize + (i << 1)); + } + stringSegment = this.addMemorySegment(buffer); + segments.set(stringValue, stringSegment); + } + var ref = i64_add(stringSegment.offset, i64_new(rtHeaderSize)); + this.currentType = stringInstance.type; + if (this.options.isWasm64) { + return this.module.i64(i64_low(ref), i64_high(ref)); + } else { + assert(i64_is_u32(ref)); + return this.module.i32(i64_low(ref)); + } + } + + ensureStaticArrayBuffer(elementType: Type, values: ExpressionRef[]): MemorySegment { + var program = this.program; + var length = values.length; + var byteSize = elementType.byteSize; + var byteLength = length * byteSize; + var bufferInstance = assert(program.arrayBufferInstance); + var runtimeHeaderSize = program.runtimeHeaderSize; + + var buf = new Uint8Array(runtimeHeaderSize + byteLength); + program.writeRuntimeHeader(buf, 0, bufferInstance, byteLength); + var pos = runtimeHeaderSize; + var nativeType = elementType.toNativeType(); + switch (nativeType) { + case NativeType.I32: { + switch (byteSize) { + case 1: { + for (let i = 0; i < length; ++i) { + let value = values[i]; + assert(getExpressionType(value) == nativeType); + assert(getExpressionId(value) == ExpressionId.Const); + writeI8(getConstValueI32(value), buf, pos); + pos += 1; + } + break; + } + case 2: { + for (let i = 0; i < length; ++i) { + let value = values[i]; + assert(getExpressionType(value) == nativeType); + assert(getExpressionId(value) == ExpressionId.Const); + writeI16(getConstValueI32(value), buf, pos); + pos += 2; + } + break; + } + case 4: { + for (let i = 0; i < length; ++i) { + let value = values[i]; + assert(getExpressionType(value) == nativeType); + assert(getExpressionId(value) == ExpressionId.Const); + writeI32(getConstValueI32(value), buf, pos); + pos += 4; + } + break; + } + default: assert(false); + } + break; + } + case NativeType.I64: { + for (let i = 0; i < length; ++i) { + let value = values[i]; + assert(getExpressionType(value) == nativeType); + assert(getExpressionId(value) == ExpressionId.Const); + writeI64(i64_new(getConstValueI64Low(value), getConstValueI64High(value)), buf, pos); + pos += 8; + } + break; + } + case NativeType.F32: { + for (let i = 0; i < length; ++i) { + let value = values[i]; + assert(getExpressionType(value) == nativeType); + assert(getExpressionId(value) == ExpressionId.Const); + writeF32(getConstValueF32(value), buf, pos); + pos += 4; + } + break; + } + case NativeType.F64: { + for (let i = 0; i < length; ++i) { + let value = values[i]; + assert(getExpressionType(value) == nativeType); + assert(getExpressionId(value) == ExpressionId.Const); + writeF64(getConstValueF64(value), buf, pos); + pos += 8; + } + break; + } + default: assert(false); + } + assert(pos == buf.length); + + return this.addMemorySegment(buf); + } + + ensureStaticArrayHeader(elementType: Type, bufferSegment: MemorySegment): MemorySegment { + var program = this.program; + var runtimeHeaderSize = program.runtimeHeaderSize; + var arrayPrototype = assert(program.arrayPrototype); + var arrayInstance = assert(this.resolver.resolveClass(arrayPrototype, [ elementType ])); + var arrayInstanceSize = arrayInstance.currentMemoryOffset; + var bufferLength = bufferSegment.buffer.length - runtimeHeaderSize; + var arrayLength = i32(bufferLength / elementType.byteSize); + + var buf = new Uint8Array(runtimeHeaderSize + arrayInstanceSize); + program.writeRuntimeHeader(buf, 0, arrayInstance, arrayInstanceSize); + + var bufferAddress32 = i64_low(bufferSegment.offset) + runtimeHeaderSize; + assert(!program.options.isWasm64); // TODO + assert(arrayInstance.writeField("data", bufferAddress32, buf, runtimeHeaderSize)); + assert(arrayInstance.writeField("dataStart", bufferAddress32, buf, runtimeHeaderSize)); + assert(arrayInstance.writeField("dataLength", bufferLength, buf, runtimeHeaderSize)); + assert(arrayInstance.writeField("length_", arrayLength, buf, runtimeHeaderSize)); + + return this.addMemorySegment(buf); + } + + // === Table ==================================================================================== /** Ensures that a table entry exists for the specified function and returns its index. */ ensureFunctionTableEntry(func: Function): i32 { @@ -1391,9 +1609,12 @@ export class Compiler extends DiagnosticEmitter { return index; } - // statements + // === Statements =============================================================================== compileTopLevelStatement(statement: Statement, body: ExpressionRef[]): void { + if (statement.kind == NodeKind.EXPORTDEFAULT) { + statement = (statement).declaration; + } switch (statement.kind) { case NodeKind.CLASSDECLARATION: { let memberStatements = (statement).members; @@ -1463,69 +1684,72 @@ export class Compiler extends DiagnosticEmitter { } } - compileStatement(statement: Statement, isLastStatementInBody: bool = false): ExpressionRef { + compileStatement( + statement: Statement, + contextualFlags: ContextualFlags = ContextualFlags.NONE + ): ExpressionRef { var module = this.module; var stmt: ExpressionRef; switch (statement.kind) { case NodeKind.BLOCK: { - stmt = this.compileBlockStatement(statement); + stmt = this.compileBlockStatement(statement, contextualFlags); break; } case NodeKind.BREAK: { - stmt = this.compileBreakStatement(statement); + stmt = this.compileBreakStatement(statement, contextualFlags); break; } case NodeKind.CONTINUE: { - stmt = this.compileContinueStatement(statement); + stmt = this.compileContinueStatement(statement, contextualFlags); break; } case NodeKind.DO: { - stmt = this.compileDoStatement(statement); + stmt = this.compileDoStatement(statement, contextualFlags); break; } case NodeKind.EMPTY: { - stmt = this.compileEmptyStatement(statement); + stmt = this.compileEmptyStatement(statement, contextualFlags); break; } case NodeKind.EXPRESSION: { - stmt = this.compileExpressionStatement(statement); + stmt = this.compileExpressionStatement(statement, contextualFlags); break; } case NodeKind.FOR: { - stmt = this.compileForStatement(statement); + stmt = this.compileForStatement(statement, contextualFlags); break; } case NodeKind.IF: { - stmt = this.compileIfStatement(statement); + stmt = this.compileIfStatement(statement, contextualFlags); break; } case NodeKind.RETURN: { - stmt = this.compileReturnStatement(statement, isLastStatementInBody); + stmt = this.compileReturnStatement(statement, contextualFlags); break; } case NodeKind.SWITCH: { - stmt = this.compileSwitchStatement(statement); + stmt = this.compileSwitchStatement(statement, contextualFlags); break; } case NodeKind.THROW: { - stmt = this.compileThrowStatement(statement); + stmt = this.compileThrowStatement(statement, contextualFlags); break; } case NodeKind.TRY: { - stmt = this.compileTryStatement(statement); + stmt = this.compileTryStatement(statement, contextualFlags); break; } case NodeKind.VARIABLE: { - stmt = this.compileVariableStatement(statement); - if (!stmt) stmt = module.createNop(); + stmt = this.compileVariableStatement(statement, contextualFlags); + if (!stmt) stmt = module.nop(); break; } case NodeKind.VOID: { - stmt = this.compileVoidStatement(statement); + stmt = this.compileVoidStatement(statement, contextualFlags); break; } case NodeKind.WHILE: { - stmt = this.compileWhileStatement(statement); + stmt = this.compileWhileStatement(statement, contextualFlags); break; } case NodeKind.TYPEDECLARATION: { @@ -1534,25 +1758,35 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Operation_not_supported, statement.range ); - stmt = module.createUnreachable(); + stmt = module.unreachable(); break; } default: { assert(false); - stmt = module.createUnreachable(); + stmt = module.unreachable(); } } if (this.options.sourceMap) this.addDebugLocation(stmt, statement.range); return stmt; } - compileStatements(statements: Statement[], isBody: bool = false): ExpressionRef[] { + compileStatements( + statements: Statement[], + isBody: bool = false, + stmts: ExpressionRef[] | null = null + ): ExpressionRef[] { var numStatements = statements.length; - var stmts = new Array(numStatements); - stmts.length = 0; + if (!stmts) { + stmts = new Array(numStatements); + stmts.length = 0; + } var flow = this.currentFlow; for (let i = 0; i < numStatements; ++i) { - let stmt = this.compileStatement(statements[i], isBody && i == numStatements - 1); + let stmt = this.compileStatement(statements[i], + isBody && i == numStatements - 1 + ? ContextualFlags.LAST_IN_BODY + : ContextualFlags.NONE + ); switch (getExpressionId(stmt)) { case ExpressionId.Block: { if (!getBlockName(stmt)) { @@ -1565,40 +1799,41 @@ export class Compiler extends DiagnosticEmitter { case ExpressionId.Nop: } if (flow.isAny(FlowFlags.ANY_TERMINATING)) { - if (needsExplicitUnreachable(stmt)) stmts.push(this.module.createUnreachable()); + if (needsExplicitUnreachable(stmt)) stmts.push(this.module.unreachable()); break; } } return stmts; } - compileBlockStatement(statement: BlockStatement): ExpressionRef { + compileBlockStatement( + statement: BlockStatement, + contextualFlags: ContextualFlags + ): ExpressionRef { var statements = statement.statements; var outerFlow = this.currentFlow; var innerFlow = outerFlow.fork(); this.currentFlow = innerFlow; var stmts = this.compileStatements(statements); - var stmt = stmts.length == 0 - ? this.module.createNop() - : stmts.length == 1 - ? stmts[0] - : this.module.createBlock(null, stmts,getExpressionType(stmts[stmts.length - 1])); - + if (!innerFlow.isAny(FlowFlags.ANY_TERMINATING)) this.performAutoreleases(innerFlow, stmts); innerFlow.freeScopedLocals(); - outerFlow.inherit(innerFlow); + outerFlow.inherit(innerFlow); // TODO: only if not terminated? this.currentFlow = outerFlow; - return stmt; + return flatten(this.module, stmts, NativeType.None); } - compileBreakStatement(statement: BreakStatement): ExpressionRef { + compileBreakStatement( + statement: BreakStatement, + contextualFlags: ContextualFlags + ): ExpressionRef { var module = this.module; if (statement.label) { this.error( DiagnosticCode.Operation_not_supported, statement.label.range ); - return module.createUnreachable(); + return module.unreachable(); } var flow = this.currentFlow; var breakLabel = flow.breakLabel; @@ -1607,13 +1842,25 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement, statement.range ); - return module.createUnreachable(); + return module.unreachable(); } + var stmts = new Array(); + this.performAutoreleases(flow, stmts); + var current: Flow | null = flow.parent; + while (current && current.breakLabel === breakLabel) { + this.performAutoreleases(current, stmts, /* clearFlags */ false); + current = current.parent; + } + flow.freeScopedLocals(); + stmts.push(module.br(breakLabel)); flow.set(FlowFlags.BREAKS); - return module.createBreak(breakLabel); + return flatten(module, stmts, NativeType.None); } - compileContinueStatement(statement: ContinueStatement): ExpressionRef { + compileContinueStatement( + statement: ContinueStatement, + contextualFlags: ContextualFlags + ): ExpressionRef { var module = this.module; var label = statement.label; if (label) { @@ -1621,7 +1868,7 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Operation_not_supported, label.range ); - return module.createUnreachable(); + return module.unreachable(); } // Check if 'continue' is allowed here var flow = this.currentFlow; @@ -1631,13 +1878,25 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement, statement.range ); - return module.createUnreachable(); + return module.unreachable(); } flow.set(FlowFlags.CONTINUES); - return module.createBreak(continueLabel); + var stmts = new Array(); + this.performAutoreleases(flow, stmts); + var current: Flow | null = flow.parent; + while (current && current.continueLabel === continueLabel) { + this.performAutoreleases(current, stmts, /* clearFlags */ false); + current = current.parent; + } + flow.freeScopedLocals(); + stmts.push(module.br(continueLabel)); + return flatten(module, stmts, NativeType.None); } - compileDoStatement(statement: DoStatement): ExpressionRef { + compileDoStatement( + statement: DoStatement, + contextualFlags: ContextualFlags + ): ExpressionRef { var module = this.module; var outerFlow = this.currentFlow; @@ -1649,18 +1908,26 @@ export class Compiler extends DiagnosticEmitter { var continueLabel = "continue|" + label; innerFlow.continueLabel = continueLabel; - var body = this.compileStatement(statement.statement); + var stmts = new Array(); + if (statement.statement.kind == NodeKind.BLOCK) { + this.compileStatements((statement.statement).statements, false, stmts); + } else { + stmts.push( + this.compileStatement(statement.statement) + ); + } var condExpr = this.makeIsTrueish( - this.compileExpression(statement.condition, Type.i32, ConversionKind.NONE, WrapMode.NONE), + this.compileExpression(statement.condition, Type.i32), this.currentType ); // TODO: check if condition is always false and if so, omit it (just a block) // Switch back to the parent flow + var terminated = innerFlow.isAny(FlowFlags.ANY_TERMINATING); + if (!terminated) this.performAutoreleases(innerFlow, stmts); innerFlow.freeScopedLocals(); outerFlow.popBreakLabel(); this.currentFlow = outerFlow; - var terminated = innerFlow.isAny(FlowFlags.ANY_TERMINATING); innerFlow.unset( FlowFlags.BREAKS | FlowFlags.CONDITIONALLY_BREAKS | @@ -1670,33 +1937,39 @@ export class Compiler extends DiagnosticEmitter { outerFlow.inherit(innerFlow); var block: ExpressionRef[] = [ - module.createLoop(continueLabel, + module.loop(continueLabel, terminated - ? body // skip trailing continue if unnecessary - : module.createBlock(null, [ - body, - module.createBreak(continueLabel, condExpr) + ? flatten(module, stmts, NativeType.None) // skip trailing continue if unnecessary + : module.block(null, [ + flatten(module, stmts, NativeType.None), + module.br(continueLabel, condExpr) ], NativeType.None) ) ]; - if (terminated) block.push(module.createUnreachable()); - return module.createBlock(breakLabel, block); + if (terminated) block.push(module.unreachable()); + return module.block(breakLabel, block); } - compileEmptyStatement(statement: EmptyStatement): ExpressionRef { - return this.module.createNop(); + compileEmptyStatement( + statement: EmptyStatement, + contextualFlags: ContextualFlags + ): ExpressionRef { + return this.module.nop(); } - compileExpressionStatement(statement: ExpressionStatement): ExpressionRef { - var expr = this.compileExpression(statement.expression, Type.void, ConversionKind.NONE, WrapMode.NONE); - if (this.currentType != Type.void) { - expr = this.module.createDrop(expr); - this.currentType = Type.void; - } - return expr; + compileExpressionStatement( + statement: ExpressionStatement, + contextualFlags: ContextualFlags, + ): ExpressionRef { + return this.compileExpression(statement.expression, Type.void, + contextualFlags | ContextualFlags.EXPLICIT | ContextualFlags.WILL_DROP + ); } - compileForStatement(statement: ForStatement): ExpressionRef { + compileForStatement( + statement: ForStatement, + contextualFlags: ContextualFlags + ): ExpressionRef { // A for statement initiates a new branch with its own scoped variables // possibly declared in its initializer, and break context. var outerFlow = this.currentFlow; @@ -1717,35 +1990,40 @@ export class Compiler extends DiagnosticEmitter { var condExpr: ExpressionRef = 0; var alwaysTrue = false; if (statement.condition) { - condExpr = this.makeIsTrueish( - this.compileExpressionRetainType(statement.condition, Type.bool, WrapMode.NONE), - this.currentType + condExpr = module.precomputeExpression( + this.makeIsTrueish( + this.compileExpressionRetainType(statement.condition, Type.bool), + this.currentType + ) ); // check if the condition is always true - let condPre = module.precomputeExpression(condExpr); - if (getExpressionId(condPre) == ExpressionId.Const) { - assert(getExpressionType(condPre) == NativeType.I32); - if (getConstValueI32(condPre) != 0) alwaysTrue = true; + if (getExpressionId(condExpr) == ExpressionId.Const) { + assert(getExpressionType(condExpr) == NativeType.I32); + if (getConstValueI32(condExpr) != 0) alwaysTrue = true; // TODO: could skip compilation if the condition is always false here, but beware that the // initializer could still declare new 'var's that are used later on. } - // recompile to original - condExpr = this.makeIsTrueish( - this.compileExpressionRetainType(statement.condition, Type.bool, WrapMode.NONE), - this.currentType - ); } else { // omitted condition is always true - condExpr = module.createI32(1); + condExpr = module.i32(1); alwaysTrue = true; } + innerFlow.inheritNonnullIfTrue(condExpr); var incrExpr = statement.incrementor - ? this.compileExpression(statement.incrementor, Type.void, ConversionKind.IMPLICIT, WrapMode.NONE) - : 0; + ? this.compileExpression(statement.incrementor, Type.void, + ContextualFlags.IMPLICIT | ContextualFlags.WILL_DROP + ) + : 0; var bodyStatement = statement.statement; - var bodyExpr = bodyStatement.kind == NodeKind.BLOCK && (bodyStatement).statements.length == 1 - ? this.compileStatement((bodyStatement).statements[0]) - : this.compileStatement(bodyStatement); + var stmts = new Array(); + if (bodyStatement.kind == NodeKind.BLOCK) { + this.compileStatements((bodyStatement).statements, false, stmts); + } else { + stmts.push( + this.compileStatement(bodyStatement) + ); + } + if (!innerFlow.isAny(FlowFlags.ANY_TERMINATING)) this.performAutoreleases(innerFlow, stmts); // Switch back to the parent flow innerFlow.freeScopedLocals(); @@ -1766,85 +2044,113 @@ export class Compiler extends DiagnosticEmitter { var repeatBlock = new Array(); // block repeating the loop if (usesContinue) { + stmts.unshift( + module.br(breakLabel, module.unary(UnaryOp.EqzI32, condExpr)) + ); repeatBlock.push( - module.createBlock(continueLabel, [ // inner 'continue' block - module.createBreak(breakLabel, module.createUnary(UnaryOp.EqzI32, condExpr)), - bodyExpr - ], NativeType.None) + module.block(continueLabel, stmts, NativeType.None) ); } else { // can omit the 'continue' block repeatBlock.push( - module.createBreak(breakLabel, module.createUnary(UnaryOp.EqzI32, condExpr)) + module.br(breakLabel, module.unary(UnaryOp.EqzI32, condExpr)) ); - repeatBlock.push(bodyExpr); + for (let i = 0, k = stmts.length; i < k; ++i) { + repeatBlock.push(stmts[i]); + } } if (incrExpr) repeatBlock.push(incrExpr); repeatBlock.push( - module.createBreak(repeatLabel) + module.br(repeatLabel) ); breakBlock.push( - module.createLoop(repeatLabel, module.createBlock(null, repeatBlock, NativeType.None)) + module.loop(repeatLabel, module.block(null, repeatBlock, NativeType.None)) ); - return module.createBlock(breakLabel, breakBlock); + return module.block(breakLabel, breakBlock); } - compileIfStatement(statement: IfStatement): ExpressionRef { + compileIfStatement( + statement: IfStatement, + contextualFlags: ContextualFlags + ): ExpressionRef { var module = this.module; var ifTrue = statement.ifTrue; var ifFalse = statement.ifFalse; var outerFlow = this.currentFlow; - var actualFunction = outerFlow.actualFunction; // The condition doesn't initiate a branch yet - var condExpr = this.makeIsTrueish( - this.compileExpressionRetainType(statement.condition, Type.bool, WrapMode.NONE), - this.currentType + var condExpr = module.precomputeExpression( + this.makeIsTrueish( + this.compileExpressionRetainType(statement.condition, Type.bool), + this.currentType + ) ); // Try to eliminate unnecesssary branches if the condition is constant - var condExprPrecomp = module.precomputeExpression(condExpr); if ( - getExpressionId(condExprPrecomp) == ExpressionId.Const && - getExpressionType(condExprPrecomp) == NativeType.I32 + getExpressionId(condExpr) == ExpressionId.Const && + getExpressionType(condExpr) == NativeType.I32 ) { - return getConstValueI32(condExprPrecomp) + return getConstValueI32(condExpr) ? this.compileStatement(ifTrue) : ifFalse ? this.compileStatement(ifFalse) - : module.createNop(); - - // Otherwise recompile to the original and let the optimizer decide - } else /* if (condExpr != condExprPrecomp) <- not guaranteed */ { - condExpr = this.makeIsTrueish( - this.compileExpressionRetainType(statement.condition, Type.bool, WrapMode.NONE), - this.currentType - ); + : module.nop(); } // Each arm initiates a branch + var ifTrueStmts = new Array(); var ifTrueFlow = outerFlow.fork(); this.currentFlow = ifTrueFlow; - var ifTrueExpr = this.compileStatement(ifTrue); + ifTrueFlow.inheritNonnullIfTrue(condExpr); + if (ifTrue.kind == NodeKind.BLOCK) { + this.compileStatements((ifTrue).statements, false, ifTrueStmts); + } else { + ifTrueStmts.push(this.compileStatement(ifTrue)); + } + if (!ifTrueFlow.isAny(FlowFlags.ANY_TERMINATING)) this.performAutoreleases(ifTrueFlow, ifTrueStmts); ifTrueFlow.freeScopedLocals(); this.currentFlow = outerFlow; - var ifFalseExpr: ExpressionRef = 0; if (ifFalse) { let ifFalseFlow = outerFlow.fork(); this.currentFlow = ifFalseFlow; - ifFalseExpr = this.compileStatement(ifFalse); + ifFalseFlow.inheritNonnullIfFalse(condExpr); + let ifFalseStmts = new Array(); + if (ifFalse.kind == NodeKind.BLOCK) { + this.compileStatements((ifFalse).statements, false, ifFalseStmts); + } else { + ifFalseStmts.push(this.compileStatement(ifFalse)); + } + if (!ifFalseFlow.isAny(FlowFlags.ANY_TERMINATING)) this.performAutoreleases(ifFalseFlow, ifFalseStmts); ifFalseFlow.freeScopedLocals(); this.currentFlow = outerFlow; outerFlow.inheritMutual(ifTrueFlow, ifFalseFlow); + return module.if(condExpr, + flatten(module, ifTrueStmts, NativeType.None), + flatten(module, ifFalseStmts, NativeType.None) + ); } else { outerFlow.inheritConditional(ifTrueFlow); + if (ifTrueFlow.isAny(FlowFlags.ANY_TERMINATING)) { + outerFlow.inheritNonnullIfFalse(condExpr); + } + return module.if(condExpr, + flatten(module, ifTrueStmts, NativeType.None) + ); } - return module.createIf(condExpr, ifTrueExpr, ifFalseExpr); + // TODO: Detect neglected condition + // if (!foo) { + // foo = [notNull] + // } + // foo // is possibly null } - compileReturnStatement(statement: ReturnStatement, isLastStatementInBody: bool): ExpressionRef { + compileReturnStatement( + statement: ReturnStatement, + contextualFlags: ContextualFlags + ): ExpressionRef { var module = this.module; var expr: ExpressionRef = 0; var flow = this.currentFlow; @@ -1853,52 +2159,92 @@ export class Compiler extends DiagnosticEmitter { // Remember that this flow returns flow.set(FlowFlags.RETURNS); - if (statement.value) { + var valueExpression = statement.value; + if (valueExpression) { if (returnType == Type.void) { - this.compileExpressionRetainType(statement.value, returnType, WrapMode.NONE); this.error( DiagnosticCode.Type_0_is_not_assignable_to_type_1, - statement.value.range, this.currentType.toString(), returnType.toString() + valueExpression.range, this.currentType.toString(), returnType.toString() ); this.currentType = Type.void; - return module.createUnreachable(); + return module.unreachable(); + } + let contextualFlags = ContextualFlags.IMPLICIT; + if (flow.actualFunction.is(CommonFlags.MODULE_EXPORT)) contextualFlags |= ContextualFlags.WRAP; + expr = this.compileExpression(valueExpression, returnType, contextualFlags | ContextualFlags.SKIP_AUTORELEASE); + + // when returning a local, and it is already retained, skip the final set + // of retaining it as the return value and releasing it as a variable + if (!this.skippedAutoreleases.has(expr)) { + if (returnType.isManaged) { + if (getExpressionId(expr) == ExpressionId.LocalGet) { + if (flow.isAnyLocalFlag(getLocalGetIndex(expr), LocalFlags.ANY_RETAINED)) { + flow.unsetLocalFlag(getLocalGetIndex(expr), LocalFlags.ANY_RETAINED); + this.skippedAutoreleases.add(expr); + } + } + } } - expr = this.compileExpression( - statement.value, - returnType, - ConversionKind.IMPLICIT, - flow.actualFunction.is(CommonFlags.MODULE_EXPORT) - ? WrapMode.WRAP - : WrapMode.NONE - ); - // Remember whether returning a properly wrapped value + // remember return states if (!flow.canOverflow(expr, returnType)) flow.set(FlowFlags.RETURNS_WRAPPED); + if (flow.isNonnull(expr, returnType)) flow.set(FlowFlags.RETURNS_NONNULL); } else if (returnType != Type.void) { this.error( DiagnosticCode.Type_0_is_not_assignable_to_type_1, statement.range, "void", returnType.toString() ); - expr = module.createUnreachable(); + expr = module.unreachable(); } - // If the last statement anyway, make it the block's return value - if (isLastStatementInBody) return expr ? expr : module.createNop(); + var stmts = new Array(); + this.performAutoreleases(flow, stmts); + this.finishAutoreleases(flow, stmts); + + // Make sure that the return value is retained for the caller + if (returnType.isManaged && !this.skippedAutoreleases.has(expr)) expr = this.makeRetain(expr); + + if (returnType != Type.void && stmts.length) { + let temp = flow.getAndFreeTempLocal(returnType); + if (flow.isNonnull(expr, returnType)) flow.setLocalFlag(temp.index, LocalFlags.NONNULL); + stmts.unshift( + module.local_set(temp.index, expr) + ); + expr = module.local_get(temp.index, returnType.toNativeType()); + } + flow.freeScopedLocals(); + + // If the last statement anyway, make it the block's return value + if ((contextualFlags & ContextualFlags.LAST_IN_BODY) != 0 && expr && returnType != Type.void) { + if (!stmts.length) return expr; + stmts.push(expr); + return module.block(null, stmts, returnType.toNativeType()); + } // When inlining, break to the end of the inlined function's block (no need to wrap) - if (flow.is(FlowFlags.INLINE_CONTEXT)) return module.createBreak(assert(flow.inlineReturnLabel), 0, expr); + if (flow.is(FlowFlags.INLINE_CONTEXT)) { + if (!stmts.length) return module.br(assert(flow.inlineReturnLabel), 0, expr); + stmts.push(module.br(assert(flow.inlineReturnLabel), 0, expr)); + // stmts.push(module.createUnreachable()); + return module.block(null, stmts); + } - return module.createReturn(expr); + // Otherwise emit a normal return + if (!stmts.length) return module.return(expr); + stmts.push(module.return(expr)); + return module.block(null, stmts); } - compileSwitchStatement(statement: SwitchStatement): ExpressionRef { + compileSwitchStatement(statement: SwitchStatement, contextualFlags: ContextualFlags): ExpressionRef { var module = this.module; var cases = statement.cases; var numCases = cases.length; if (!numCases) { - return this.compileExpression(statement.condition, Type.void, ConversionKind.IMPLICIT, WrapMode.NONE); + return this.compileExpression(statement.condition, Type.void, + ContextualFlags.IMPLICIT + ); } // Everything within a switch uses the same break context @@ -1906,14 +2252,16 @@ export class Compiler extends DiagnosticEmitter { var context = outerFlow.pushBreakLabel(); // introduce a local for evaluating the condition (exactly once) - var tempLocal = outerFlow.getTempLocal(Type.u32, false); + var tempLocal = outerFlow.getTempLocal(Type.u32); var tempLocalIndex = tempLocal.index; // Prepend initializer to inner block. Does not initiate a new branch, yet. var breaks = new Array(1 + numCases); - breaks[0] = module.createSetLocal( // initializer + breaks[0] = module.local_set( // initializer tempLocalIndex, - this.compileExpression(statement.condition, Type.u32, ConversionKind.IMPLICIT, WrapMode.NONE) + this.compileExpression(statement.condition, Type.u32, + ContextualFlags.IMPLICIT + ) ); // make one br_if per (possibly dynamic) labeled case (binaryen optimizes to br_table where possible) @@ -1923,10 +2271,12 @@ export class Compiler extends DiagnosticEmitter { let case_ = cases[i]; let label = case_.label; if (label) { - breaks[breakIndex++] = module.createBreak("case" + i.toString(10) + "|" + context, - module.createBinary(BinaryOp.EqI32, - module.createGetLocal(tempLocalIndex, NativeType.I32), - this.compileExpression(label, Type.u32, ConversionKind.IMPLICIT, WrapMode.NONE) + breaks[breakIndex++] = module.br("case" + i.toString(10) + "|" + context, + module.binary(BinaryOp.EqI32, + module.local_get(tempLocalIndex, NativeType.I32), + this.compileExpression(label, Type.u32, + ContextualFlags.IMPLICIT + ) ) ); } else { @@ -1937,13 +2287,13 @@ export class Compiler extends DiagnosticEmitter { outerFlow.freeTempLocal(tempLocal); // otherwise br to default respectively out of the switch if there is no default case - breaks[breakIndex] = module.createBreak((defaultIndex >= 0 + breaks[breakIndex] = module.br((defaultIndex >= 0 ? "case" + defaultIndex.toString(10) : "break" ) + "|" + context); // nest blocks in order - var currentBlock = module.createBlock("case0|" + context, breaks, NativeType.None); + var currentBlock = module.block("case0|" + context, breaks, NativeType.None); var alwaysReturns = true; var alwaysReturnsWrapped = true; var alwaysThrows = true; @@ -1984,13 +2334,14 @@ export class Compiler extends DiagnosticEmitter { } // Switch back to the parent flow + if (!innerFlow.isAny(FlowFlags.ANY_TERMINATING)) this.performAutoreleases(innerFlow, stmts); innerFlow.unset( FlowFlags.BREAKS | FlowFlags.CONDITIONALLY_BREAKS ); innerFlow.freeScopedLocals(); this.currentFlow = outerFlow; - currentBlock = module.createBlock(nextLabel, stmts, NativeType.None); // must be a labeled block + currentBlock = module.block(nextLabel, stmts, NativeType.None); // must be a labeled block } outerFlow.popBreakLabel(); @@ -2004,7 +2355,10 @@ export class Compiler extends DiagnosticEmitter { return currentBlock; } - compileThrowStatement(statement: ThrowStatement): ExpressionRef { + compileThrowStatement( + statement: ThrowStatement, + contextualFlags: ContextualFlags + ): ExpressionRef { var flow = this.currentFlow; // Remember that this branch throws @@ -2013,32 +2367,51 @@ export class Compiler extends DiagnosticEmitter { // FIXME: without try-catch it is safe to assume RETURNS as well for now flow.set(FlowFlags.RETURNS); + var stmts = new Array(); + this.finishAutoreleases(flow, stmts); + // TODO: requires exception-handling spec. - return compileAbort(this, null, statement); + var value = statement.value; + var message: Expression | null = null; + if (value.kind == NodeKind.NEW) { + let newArgs = (value).arguments; + if (newArgs.length) message = newArgs[0]; // FIXME: naively assumes type string + } + stmts.push(compileAbort(this, message, statement)); + + return flatten(this.module, stmts, NativeType.None); } - compileTryStatement(statement: TryStatement): ExpressionRef { + compileTryStatement( + statement: TryStatement, + contextualFlags: ContextualFlags + ): ExpressionRef { // TODO: can't yet support something like: try { return ... } finally { ... } // worthwhile to investigate lowering returns to block results (here)? this.error( DiagnosticCode.Operation_not_supported, statement.range ); - return this.module.createUnreachable(); + return this.module.unreachable(); } /** Compiles a variable statement. Returns `0` if an initializer is not necessary. */ - compileVariableStatement(statement: VariableStatement): ExpressionRef { + compileVariableStatement(statement: VariableStatement, contextualFlags: ContextualFlags): ExpressionRef { + var module = this.module; var declarations = statement.declarations; var numDeclarations = declarations.length; var flow = this.currentFlow; var initializers = new Array(); var resolver = this.resolver; + for (let i = 0; i < numDeclarations; ++i) { let declaration = declarations[i]; let name = declaration.name.text; let type: Type | null = null; let initExpr: ExpressionRef = 0; + let initAutoreleaseSkipped = false; + + // Resolve type if annotated if (declaration.type) { type = resolver.resolveType( // reports declaration.type, @@ -2047,19 +2420,18 @@ export class Compiler extends DiagnosticEmitter { ); if (!type) continue; if (declaration.initializer) { - initExpr = this.compileExpression( // reports - declaration.initializer, - type, - ConversionKind.IMPLICIT, - WrapMode.NONE + initExpr = this.compileExpression(declaration.initializer, type, // reports + ContextualFlags.IMPLICIT | ContextualFlags.SKIP_AUTORELEASE ); + initAutoreleaseSkipped = this.skippedAutoreleases.has(initExpr); } - } else if (declaration.initializer) { // infer type using void/NONE for proper literal inference - initExpr = this.compileExpressionRetainType( // reports - declaration.initializer, - Type.void, - WrapMode.NONE - ); + + // Otherwise infer type from initializer + } else if (declaration.initializer) { + initExpr = this.compileExpressionRetainType(declaration.initializer, Type.void, + ContextualFlags.SKIP_AUTORELEASE + ); // reports + initAutoreleaseSkipped = this.skippedAutoreleases.has(initExpr); if (this.currentType == Type.void) { this.error( DiagnosticCode.Type_0_is_not_assignable_to_type_1, @@ -2068,6 +2440,8 @@ export class Compiler extends DiagnosticEmitter { continue; } type = this.currentType; + + // Error if there's neither a type nor an initializer } else { this.error( DiagnosticCode.Type_expected, @@ -2075,10 +2449,13 @@ export class Compiler extends DiagnosticEmitter { ); continue; } - let isInlined = false; - if (declaration.is(CommonFlags.CONST)) { + + // Handle constants, and try to inline if value is static + let isConst = declaration.is(CommonFlags.CONST); + let isStatic = false; + if (isConst) { if (initExpr) { - initExpr = this.module.precomputeExpression(initExpr); + initExpr = module.precomputeExpression(initExpr); if (getExpressionId(initExpr) == ExpressionId.Const) { let local = new Local(name, -1, type, flow.parentFunction); switch (getExpressionType(initExpr)) { @@ -2112,7 +2489,7 @@ export class Compiler extends DiagnosticEmitter { } default: { assert(false); - return this.module.createUnreachable(); + return module.unreachable(); } } // Create a virtual local that doesn't actually exist in WebAssembly @@ -2123,15 +2500,10 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Duplicate_identifier_0, declaration.name.range, name ); - return this.module.createUnreachable(); + return this.module.unreachable(); } scopedLocals.set(name, local); - isInlined = true; - } else { - this.warning( - DiagnosticCode.Compiling_constant_with_non_constant_initializer_as_mutable, - declaration.range - ); + isStatic = true; } } else { this.error( @@ -2140,13 +2512,25 @@ export class Compiler extends DiagnosticEmitter { ); } } - if (!isInlined) { + + // Otherwise compile as mutable + if (!isStatic) { let local: Local; if ( declaration.isAny(CommonFlags.LET | CommonFlags.CONST) || flow.is(FlowFlags.INLINE_CONTEXT) ) { // here: not top-level - local = flow.addScopedLocal(name, type, false, declaration.name); // reports if duplicate + let existingLocal = flow.getScopedLocal(name); + if (existingLocal) { + this.error( + DiagnosticCode.Duplicate_identifier_0, + declaration.name.range, declaration.name.text + ); + local = existingLocal; + } else { + local = flow.addScopedLocal(name, type); + } + if (isConst) flow.setLocalFlag(local.index, LocalFlags.CONSTANT); } else { if (flow.lookupLocal(name)) { this.error( @@ -2156,54 +2540,77 @@ export class Compiler extends DiagnosticEmitter { continue; } local = flow.parentFunction.addLocal(type, name, declaration); + if (isConst) flow.setLocalFlag(local.index, LocalFlags.CONSTANT); } + let isManaged = type.isManaged; if (initExpr) { - initializers.push( - this.compileAssignmentWithValue(declaration.name, initExpr) - ); - if (local.type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) { - flow.setLocalWrapped(local.index, !flow.canOverflow(initExpr, type)); + if (flow.isNonnull(initExpr, type)) flow.setLocalFlag(local.index, LocalFlags.NONNULL); + if (isManaged) { + flow.setLocalFlag(local.index, LocalFlags.RETAINED); + initializers.push( + module.local_set(local.index, + initAutoreleaseSkipped + ? initExpr + : this.makeRetain(initExpr) + ) + ); + } else { + initializers.push( + module.local_set(local.index, initExpr) + ); + if (local.type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) { + if (!flow.canOverflow(initExpr, type)) flow.setLocalFlag(local.index, LocalFlags.WRAPPED); + else flow.unsetLocalFlag(local.index, LocalFlags.WRAPPED); + } + } + } else { + if (isManaged) { + // This is necessary because the first use (and assign) of the local could be taking place + // in a loop, subsequently marking it retained, but the second iteration of the loop + // still wouldn't release whatever is assigned in the first. Likewise, if the variable wasn't + // initialized but becomes released later on, whatever was stored before would be released. + // TODO: Detect this condition inside of a loop instead? + initializers.push( + module.local_set(local.index, + type.toNativeZero(module) + ) + ); + flow.setLocalFlag(local.index, LocalFlags.CONDITIONALLY_RETAINED); + } else if (local.type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) { + flow.setLocalFlag(local.index, LocalFlags.WRAPPED); } - } else if (local.type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) { - flow.setLocalWrapped(local.index, true); // zero } } } - return initializers.length // we can unwrap these here because the - ? initializers.length == 1 // source didn't tell us exactly what to do - ? initializers[0] - : this.module.createBlock(null, initializers, NativeType.None) - : 0; + return initializers.length == 0 + ? 0 + : flatten(module, initializers, NativeType.None); } - compileVoidStatement(statement: VoidStatement): ExpressionRef { - return this.compileExpression(statement.expression, Type.void, ConversionKind.EXPLICIT, WrapMode.NONE); + compileVoidStatement(statement: VoidStatement, contextualFlags: ContextualFlags): ExpressionRef { + return this.compileExpression(statement.expression, Type.void, + ContextualFlags.EXPLICIT | ContextualFlags.WILL_DROP + ); } - compileWhileStatement(statement: WhileStatement): ExpressionRef { + compileWhileStatement(statement: WhileStatement, contextualFlags: ContextualFlags): ExpressionRef { var module = this.module; var outerFlow = this.currentFlow; // The condition does not yet initialize a branch - var condExpr = this.makeIsTrueish( - this.compileExpressionRetainType(statement.condition, Type.bool, WrapMode.NONE), - this.currentType + var condExpr = module.precomputeExpression( + this.makeIsTrueish( + this.compileExpressionRetainType(statement.condition, Type.bool), + this.currentType + ) ); // Try to eliminate unnecesssary loops if the condition is constant - var condExprPrecomp = module.precomputeExpression(condExpr); if ( - getExpressionId(condExprPrecomp) == ExpressionId.Const && - getExpressionType(condExprPrecomp) == NativeType.I32 + getExpressionId(condExpr) == ExpressionId.Const && + getExpressionType(condExpr) == NativeType.I32 ) { - if (!getConstValueI32(condExprPrecomp)) return module.createNop(); - - // Otherwise recompile to the original and let the optimizer decide - } else /* if (condExpr != condExprPrecomp) <- not guaranteed */ { - condExpr = this.makeIsTrueish( - this.compileExpressionRetainType(statement.condition, Type.bool, WrapMode.NONE), - this.currentType - ); + if (!getConstValueI32(condExpr)) return module.nop(); } // Statements initiate a new branch with its own break context @@ -2215,12 +2622,22 @@ export class Compiler extends DiagnosticEmitter { var continueLabel = "continue|" + label; innerFlow.continueLabel = continueLabel; - var body = this.compileStatement(statement.statement); + innerFlow.inheritNonnullIfTrue(condExpr); + var stmts = new Array(); + if (statement.statement.kind == NodeKind.BLOCK) { + this.compileStatements((statement.statement).statements, false, stmts); + } else { + stmts.push(this.compileStatement(statement.statement)); + } var alwaysTrue = false; // TODO var terminated = innerFlow.isAny(FlowFlags.ANY_TERMINATING); + if (!terminated) { + this.performAutoreleases(innerFlow, stmts); + stmts.push(module.br(continueLabel)); + } + innerFlow.freeScopedLocals(); // Switch back to the parent flow - innerFlow.freeScopedLocals(); outerFlow.popBreakLabel(); this.currentFlow = outerFlow; innerFlow.unset( @@ -2232,36 +2649,27 @@ export class Compiler extends DiagnosticEmitter { if (alwaysTrue) outerFlow.inherit(innerFlow); else outerFlow.inheritConditional(innerFlow); - return module.createBlock(breakLabel, [ - module.createLoop(continueLabel, - module.createIf(condExpr, - terminated - ? body // skip trailing continue if unnecessary - : module.createBlock(null, [ - body, - module.createBreak(continueLabel) - ], NativeType.None) + return module.block(breakLabel, [ + module.loop(continueLabel, + module.if(condExpr, + flatten(module, stmts, NativeType.None) ) ) ]); } - // expressions + // === Expressions ============================================================================== - /** - * Compiles the value of an inlined constant element. - * @param retainType If true, the annotated type of the constant is retained. Otherwise, the value - * is precomputed according to context. - */ + /** Compiles the value of an inlined constant element. */ compileInlineConstant( element: VariableLikeElement, contextualType: Type, - retainType: bool + contextualFlags: ContextualFlags ): ExpressionRef { assert(element.is(CommonFlags.INLINED)); var type = element.type; switch ( - !retainType && + !(contextualFlags & (ContextualFlags.IMPLICIT | ContextualFlags.EXPLICIT)) && type.is(TypeFlags.INTEGER) && contextualType.is(TypeFlags.INTEGER) && type.size < contextualType.size @@ -2271,7 +2679,7 @@ export class Compiler extends DiagnosticEmitter { case TypeKind.I8: case TypeKind.I16: { let shift = type.computeSmallIntegerShift(Type.i32); - return this.module.createI32( + return this.module.i32( element.constantValueKind == ConstantValueKind.INTEGER ? i64_low(element.constantIntegerValue) << shift >> shift : 0 @@ -2281,7 +2689,7 @@ export class Compiler extends DiagnosticEmitter { case TypeKind.U16: case TypeKind.BOOL: { let mask = element.type.computeSmallIntegerMask(Type.i32); - return this.module.createI32( + return this.module.i32( element.constantValueKind == ConstantValueKind.INTEGER ? i64_low(element.constantIntegerValue) & mask : 0 @@ -2289,7 +2697,7 @@ export class Compiler extends DiagnosticEmitter { } case TypeKind.I32: case TypeKind.U32: { - return this.module.createI32( + return this.module.i32( element.constantValueKind == ConstantValueKind.INTEGER ? i64_low(element.constantIntegerValue) : 0 @@ -2298,7 +2706,7 @@ export class Compiler extends DiagnosticEmitter { case TypeKind.ISIZE: case TypeKind.USIZE: { if (!element.program.options.isWasm64) { - return this.module.createI32( + return this.module.i32( element.constantValueKind == ConstantValueKind.INTEGER ? i64_low(element.constantIntegerValue) : 0 @@ -2309,26 +2717,26 @@ export class Compiler extends DiagnosticEmitter { case TypeKind.I64: case TypeKind.U64: { return element.constantValueKind == ConstantValueKind.INTEGER - ? this.module.createI64( + ? this.module.i64( i64_low(element.constantIntegerValue), i64_high(element.constantIntegerValue) ) - : this.module.createI64(0); + : this.module.i64(0); } case TypeKind.F64: { // monkey-patch for converting built-in floats to f32 implicitly if (!(element.hasDecorator(DecoratorFlags.BUILTIN) && contextualType == Type.f32)) { - return this.module.createF64((element).constantFloatValue); + return this.module.f64((element).constantFloatValue); } // otherwise fall-through: basically precomputes f32.demote/f64 of NaN / Infinity this.currentType = Type.f32; } case TypeKind.F32: { - return this.module.createF32((element).constantFloatValue); + return this.module.f32((element).constantFloatValue); } default: { assert(false); - return this.module.createUnreachable(); + return this.module.unreachable(); } } } @@ -2336,34 +2744,34 @@ export class Compiler extends DiagnosticEmitter { compileExpression( expression: Expression, contextualType: Type, - conversionKind: ConversionKind, - wrapMode: WrapMode + contextualFlags: ContextualFlags = ContextualFlags.NONE ): ExpressionRef { this.currentType = contextualType; var expr: ExpressionRef; + if (contextualType == Type.void) contextualFlags |= ContextualFlags.WILL_DROP; switch (expression.kind) { case NodeKind.ASSERTION: { - expr = this.compileAssertionExpression(expression, contextualType); + expr = this.compileAssertionExpression(expression, contextualType, contextualFlags); break; } case NodeKind.BINARY: { - expr = this.compileBinaryExpression(expression, contextualType); + expr = this.compileBinaryExpression(expression, contextualType, contextualFlags); break; } case NodeKind.CALL: { - expr = this.compileCallExpression(expression, contextualType); + expr = this.compileCallExpression(expression, contextualType, contextualFlags); break; } case NodeKind.COMMA: { - expr = this.compileCommaExpression(expression, contextualType); + expr = this.compileCommaExpression(expression, contextualType, contextualFlags); break; } case NodeKind.ELEMENTACCESS: { - expr = this.compileElementAccessExpression(expression, contextualType); + expr = this.compileElementAccessExpression(expression, contextualType, contextualFlags); break; } case NodeKind.FUNCTION: { - expr = this.compileFunctionExpression(expression, contextualType.signatureReference); + expr = this.compileFunctionExpression(expression, contextualType.signatureReference, contextualFlags); break; } case NodeKind.IDENTIFIER: @@ -2372,47 +2780,39 @@ export class Compiler extends DiagnosticEmitter { case NodeKind.THIS: case NodeKind.SUPER: case NodeKind.TRUE: { - expr = this.compileIdentifierExpression( - expression, - contextualType, - conversionKind == ConversionKind.NONE // retain type of inlined constants - ); + expr = this.compileIdentifierExpression(expression, contextualType, contextualFlags); break; } case NodeKind.INSTANCEOF: { - expr = this.compileInstanceOfExpression(expression, contextualType); + expr = this.compileInstanceOfExpression(expression, contextualType, contextualFlags); break; } case NodeKind.LITERAL: { - expr = this.compileLiteralExpression(expression, contextualType); + expr = this.compileLiteralExpression(expression, contextualType, contextualFlags); break; } case NodeKind.NEW: { - expr = this.compileNewExpression(expression, contextualType); + expr = this.compileNewExpression(expression, contextualType, contextualFlags); break; } case NodeKind.PARENTHESIZED: { - expr = this.compileParenthesizedExpression(expression, contextualType); + expr = this.compileExpression((expression).expression, contextualType, contextualFlags); break; } case NodeKind.PROPERTYACCESS: { - expr = this.compilePropertyAccessExpression( - expression, - contextualType, - conversionKind == ConversionKind.NONE // retain type of inlined constants - ); + expr = this.compilePropertyAccessExpression(expression, contextualType, contextualFlags); break; } case NodeKind.TERNARY: { - expr = this.compileTernaryExpression(expression, contextualType); + expr = this.compileTernaryExpression(expression, contextualType, contextualFlags); break; } case NodeKind.UNARYPOSTFIX: { - expr = this.compileUnaryPostfixExpression(expression, contextualType); + expr = this.compileUnaryPostfixExpression(expression, contextualType, contextualFlags); break; } case NodeKind.UNARYPREFIX: { - expr = this.compileUnaryPrefixExpression(expression, contextualType); + expr = this.compileUnaryPrefixExpression(expression, contextualType, contextualFlags); break; } default: { @@ -2420,56 +2820,67 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Operation_not_supported, expression.range ); - expr = this.module.createUnreachable(); + expr = this.module.unreachable(); } } + // ensure conversion and wrapping in case the respective function doesn't on its own var currentType = this.currentType; - if (conversionKind != ConversionKind.NONE && currentType != contextualType) { - expr = this.convertExpression(expr, currentType, contextualType, conversionKind, wrapMode, expression); - this.currentType = contextualType; - } else if (wrapMode == WrapMode.WRAP) { - expr = this.ensureSmallIntegerWrap(expr, currentType); - } - + var wrap = (contextualFlags & ContextualFlags.WRAP) != 0; + if (currentType != contextualType) { + if (contextualFlags & ContextualFlags.EXPLICIT) { + expr = this.convertExpression(expr, currentType, contextualType, true, wrap, expression); + wrap = false; + this.currentType = contextualType; + } else if (contextualFlags & ContextualFlags.IMPLICIT) { + expr = this.convertExpression(expr, currentType, contextualType, false, wrap, expression); + wrap = false; + this.currentType = contextualType; + } + } + if (wrap) expr = this.ensureSmallIntegerWrap(expr, currentType); + // debug location is added here so the caller doesn't have to. means: compilation of an expression + // must go through this function, with the respective per-kind functions not being used directly. if (this.options.sourceMap) this.addDebugLocation(expr, expression.range); return expr; } + /** Compiles an expression while retaining the type, that is not void, it ultimately compiles to. */ compileExpressionRetainType( expression: Expression, contextualType: Type, - wrapMode: WrapMode + contextualFlags: ContextualFlags = ContextualFlags.NONE ): ExpressionRef { - return this.compileExpression( - expression, + return this.compileExpression(expression, contextualType == Type.void - ? Type.i32 + ? Type.i32 // default to i32 : contextualType, - ConversionKind.NONE, - wrapMode + (contextualFlags & ~(ContextualFlags.IMPLICIT | ContextualFlags.EXPLICIT)) ); } + /** Compiles and precomputes an expression, possibly yielding a costant value. */ precomputeExpression( expression: Expression, contextualType: Type, - conversionKind: ConversionKind, - wrapMode: WrapMode + contextualFlags: ContextualFlags = ContextualFlags.NONE ): ExpressionRef { return this.module.precomputeExpression( - this.compileExpression(expression, contextualType, conversionKind, wrapMode) + this.compileExpression(expression, contextualType, contextualFlags) ); } convertExpression( expr: ExpressionRef, + /** Original type. */ fromType: Type, + /** New type. */ toType: Type, - conversionKind: ConversionKind, - wrapMode: WrapMode, + /** Whether the conversion is explicit.*/ + explicit: bool, + /** Whether the result should be wrapped, if a small integer. */ + wrap: bool, reportNode: Node ): ExpressionRef { - assert(conversionKind != ConversionKind.NONE); var module = this.module; // void to any @@ -2479,18 +2890,27 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Type_0_is_not_assignable_to_type_1, reportNode.range, fromType.toString(), toType.toString() ); - return module.createUnreachable(); + return module.unreachable(); } // any to void - if (toType.kind == TypeKind.VOID) return module.createDrop(expr); + if (toType.kind == TypeKind.VOID) return module.drop(expr); + + if (this.currentFlow.isNonnull(expr, fromType)) fromType = fromType.nonNullableType; if (!fromType.isAssignableTo(toType)) { - if (conversionKind == ConversionKind.IMPLICIT) { - this.error( - DiagnosticCode.Conversion_from_type_0_to_1_requires_an_explicit_cast, - reportNode.range, fromType.toString(), toType.toString() - ); // recoverable + if (!explicit) { + if (fromType.nonNullableType == toType) { + this.error( + DiagnosticCode.Object_is_possibly_null, + reportNode.range + ); // recoverable + } else { + this.error( + DiagnosticCode.Conversion_from_type_0_to_1_requires_an_explicit_cast, + reportNode.range, fromType.toString(), toType.toString() + ); // recoverable + } } } @@ -2502,14 +2922,14 @@ export class Compiler extends DiagnosticEmitter { // f32 to f64 if (toType.kind == TypeKind.F64) { - expr = module.createUnary(UnaryOp.PromoteF32, expr); + expr = module.unary(UnaryOp.PromoteF32, expr); } // otherwise f32 to f32 // f64 to f32 } else if (toType.kind == TypeKind.F32) { - expr = module.createUnary(UnaryOp.DemoteF64, expr); + expr = module.unary(UnaryOp.DemoteF64, expr); } // otherwise f64 to f64 @@ -2520,38 +2940,38 @@ export class Compiler extends DiagnosticEmitter { // f32 to int if (fromType.kind == TypeKind.F32) { if (toType == Type.bool) { - expr = module.createBinary(BinaryOp.NeF32, expr, module.createF32(0)); - wrapMode = WrapMode.NONE; + expr = module.binary(BinaryOp.NeF32, expr, module.f32(0)); + wrap = false; } else if (toType.is(TypeFlags.SIGNED)) { if (toType.is(TypeFlags.LONG)) { - expr = module.createUnary(UnaryOp.TruncF32ToI64, expr); + expr = module.unary(UnaryOp.TruncF32ToI64, expr); } else { - expr = module.createUnary(UnaryOp.TruncF32ToI32, expr); + expr = module.unary(UnaryOp.TruncF32ToI32, expr); } } else { if (toType.is(TypeFlags.LONG)) { - expr = module.createUnary(UnaryOp.TruncF32ToU64, expr); + expr = module.unary(UnaryOp.TruncF32ToU64, expr); } else { - expr = module.createUnary(UnaryOp.TruncF32ToU32, expr); + expr = module.unary(UnaryOp.TruncF32ToU32, expr); } } // f64 to int } else { if (toType == Type.bool) { - expr = module.createBinary(BinaryOp.NeF64, expr, module.createF64(0)); - wrapMode = WrapMode.NONE; + expr = module.binary(BinaryOp.NeF64, expr, module.f64(0)); + wrap = false; } else if (toType.is(TypeFlags.SIGNED)) { if (toType.is(TypeFlags.LONG)) { - expr = module.createUnary(UnaryOp.TruncF64ToI64, expr); + expr = module.unary(UnaryOp.TruncF64ToI64, expr); } else { - expr = module.createUnary(UnaryOp.TruncF64ToI32, expr); + expr = module.unary(UnaryOp.TruncF64ToI32, expr); } } else { if (toType.is(TypeFlags.LONG)) { - expr = module.createUnary(UnaryOp.TruncF64ToU64, expr); + expr = module.unary(UnaryOp.TruncF64ToU64, expr); } else { - expr = module.createUnary(UnaryOp.TruncF64ToU32, expr); + expr = module.unary(UnaryOp.TruncF64ToU32, expr); } } } @@ -2559,7 +2979,7 @@ export class Compiler extends DiagnosticEmitter { // float to void } else { assert(toType.flags == TypeFlags.NONE, "void type expected"); - expr = module.createDrop(expr); + expr = module.drop(expr); } // int to float @@ -2568,14 +2988,14 @@ export class Compiler extends DiagnosticEmitter { // int to f32 if (toType.kind == TypeKind.F32) { if (fromType.is(TypeFlags.LONG)) { - expr = module.createUnary( + expr = module.unary( fromType.is(TypeFlags.SIGNED) ? UnaryOp.ConvertI64ToF32 : UnaryOp.ConvertU64ToF32, expr ); } else { - expr = module.createUnary( + expr = module.unary( fromType.is(TypeFlags.SIGNED) ? UnaryOp.ConvertI32ToF32 : UnaryOp.ConvertU32ToF32, @@ -2586,14 +3006,14 @@ export class Compiler extends DiagnosticEmitter { // int to f64 } else { if (fromType.is(TypeFlags.LONG)) { - expr = module.createUnary( + expr = module.unary( fromType.is(TypeFlags.SIGNED) ? UnaryOp.ConvertI64ToF64 : UnaryOp.ConvertU64ToF64, expr ); } else { - expr = module.createUnary( + expr = module.unary( fromType.is(TypeFlags.SIGNED) ? UnaryOp.ConvertI32ToF64 : UnaryOp.ConvertU32ToF64, @@ -2609,19 +3029,19 @@ export class Compiler extends DiagnosticEmitter { // i64 to i32 or smaller if (toType == Type.bool) { - expr = module.createBinary(BinaryOp.NeI64, expr, module.createI64(0)); - wrapMode = WrapMode.NONE; + expr = module.binary(BinaryOp.NeI64, expr, module.i64(0)); + wrap = false; } else if (!toType.is(TypeFlags.LONG)) { - expr = module.createUnary(UnaryOp.WrapI64, expr); // discards upper bits + expr = module.unary(UnaryOp.WrapI64, expr); // discards upper bits } // i32 or smaller to i64 } else if (toType.is(TypeFlags.LONG)) { - expr = module.createUnary( + expr = module.unary( fromType.is(TypeFlags.SIGNED) ? UnaryOp.ExtendI32 : UnaryOp.ExtendU32, this.ensureSmallIntegerWrap(expr, fromType) // must clear garbage bits ); - wrapMode = WrapMode.NONE; + wrap = false; // i32 to i32 } else { @@ -2630,39 +3050,64 @@ export class Compiler extends DiagnosticEmitter { // small i32 to larger i32 if (fromType.size < toType.size) { expr = this.ensureSmallIntegerWrap(expr, fromType); // must clear garbage bits - wrapMode = WrapMode.NONE; + wrap = false; } } } } this.currentType = toType; - return wrapMode == WrapMode.WRAP + return wrap ? this.ensureSmallIntegerWrap(expr, toType) : expr; } - compileAssertionExpression(expression: AssertionExpression, contextualType: Type): ExpressionRef { + compileAssertionExpression( + expression: AssertionExpression, + contextualType: Type, + contextualFlags: ContextualFlags + ): ExpressionRef { switch (expression.assertionKind) { case AssertionKind.PREFIX: case AssertionKind.AS: { + let flow = this.currentFlow; let toType = this.resolver.resolveType( // reports assert(expression.toType), - this.currentFlow.actualFunction, - this.currentFlow.contextualTypeArguments + flow.actualFunction, + flow.contextualTypeArguments + ); + if (!toType) return this.module.unreachable(); + return this.compileExpression(expression.expression, toType, + contextualFlags | ContextualFlags.EXPLICIT ); - if (!toType) return this.module.createUnreachable(); - return this.compileExpression(expression.expression, toType, ConversionKind.EXPLICIT, WrapMode.NONE); } case AssertionKind.NONNULL: { assert(!expression.toType); - let expr = this.compileExpressionRetainType(expression.expression, contextualType, WrapMode.NONE); + let expr = this.compileExpressionRetainType(expression.expression, contextualType); + let type = this.currentType; + if (this.currentFlow.isNonnull(expr, type)) { + this.info( + DiagnosticCode.Expression_is_never_null, + expression.expression.range + ); + } else if (!this.options.noAssert) { + let module = this.module; + let flow = this.currentFlow; + let tempIndex = flow.getAndFreeTempLocal(type).index; + if (!flow.canOverflow(expr, type)) flow.setLocalFlag(tempIndex, LocalFlags.WRAPPED); + flow.setLocalFlag(tempIndex, LocalFlags.NONNULL); + expr = module.if( + module.local_tee(tempIndex, expr), + module.local_get(tempIndex, type.toNativeType()), + module.unreachable() + ); + } this.currentType = this.currentType.nonNullableType; return expr; } default: assert(false); } - return this.module.createUnreachable(); + return this.module.unreachable(); } private f32ModInstance: Function | null = null; @@ -2672,7 +3117,8 @@ export class Compiler extends DiagnosticEmitter { compileBinaryExpression( expression: BinaryExpression, - contextualType: Type + contextualType: Type, + contextualFlags: ContextualFlags ): ExpressionRef { var module = this.module; var left = expression.left; @@ -2690,7 +3136,7 @@ export class Compiler extends DiagnosticEmitter { var operator = expression.operator; switch (operator) { case Token.LESSTHAN: { - leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType); leftType = this.currentType; // check operator overload @@ -2707,26 +3153,20 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Operation_not_supported, expression.range ); - return this.module.createUnreachable(); + return this.module.unreachable(); } - rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE); + rightExpr = this.compileExpressionRetainType(right, leftType); rightType = this.currentType; if (commonType = Type.commonDenominator(leftType, rightType, true)) { - leftExpr = this.convertExpression( - leftExpr, - leftType, - leftType = commonType, - ConversionKind.IMPLICIT, - WrapMode.WRAP, + leftExpr = this.convertExpression(leftExpr, + leftType, leftType = commonType, + false, true, // ! left ); - rightExpr = this.convertExpression( - rightExpr, - rightType, - rightType = commonType, - ConversionKind.IMPLICIT, - WrapMode.WRAP, + rightExpr = this.convertExpression(rightExpr, + rightType, rightType = commonType, + false, true, // ! right ); } else { @@ -2735,21 +3175,21 @@ export class Compiler extends DiagnosticEmitter { expression.range, "<", leftType.toString(), rightType.toString() ); this.currentType = contextualType; - return module.createUnreachable(); + return module.unreachable(); } switch (commonType.kind) { case TypeKind.I8: case TypeKind.I16: case TypeKind.I32: { - expr = module.createBinary(BinaryOp.LtI32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.LtI32, leftExpr, rightExpr); break; } case TypeKind.I64: { - expr = module.createBinary(BinaryOp.LtI64, leftExpr, rightExpr); + expr = module.binary(BinaryOp.LtI64, leftExpr, rightExpr); break; } case TypeKind.ISIZE: { - expr = module.createBinary( + expr = module.binary( this.options.isWasm64 ? BinaryOp.LtI64 : BinaryOp.LtI32, @@ -2762,11 +3202,11 @@ export class Compiler extends DiagnosticEmitter { case TypeKind.U16: case TypeKind.U32: case TypeKind.BOOL: { - expr = module.createBinary(BinaryOp.LtU32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.LtU32, leftExpr, rightExpr); break; } case TypeKind.USIZE: { - expr = module.createBinary( + expr = module.binary( this.options.isWasm64 ? BinaryOp.LtU64 : BinaryOp.LtU32, @@ -2776,27 +3216,27 @@ export class Compiler extends DiagnosticEmitter { break; } case TypeKind.U64: { - expr = module.createBinary(BinaryOp.LtU64, leftExpr, rightExpr); + expr = module.binary(BinaryOp.LtU64, leftExpr, rightExpr); break; } case TypeKind.F32: { - expr = module.createBinary(BinaryOp.LtF32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.LtF32, leftExpr, rightExpr); break; } case TypeKind.F64: { - expr = module.createBinary(BinaryOp.LtF64, leftExpr, rightExpr); + expr = module.binary(BinaryOp.LtF64, leftExpr, rightExpr); break; } default: { assert(false); - expr = module.createUnreachable(); + expr = module.unreachable(); } } this.currentType = Type.bool; break; } case Token.GREATERTHAN: { - leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType); leftType = this.currentType; // check operator overload @@ -2813,26 +3253,20 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Operation_not_supported, expression.range ); - return this.module.createUnreachable(); + return this.module.unreachable(); } - rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE); + rightExpr = this.compileExpressionRetainType(right, leftType); rightType = this.currentType; if (commonType = Type.commonDenominator(leftType, rightType, true)) { - leftExpr = this.convertExpression( - leftExpr, - leftType, - leftType = commonType, - ConversionKind.IMPLICIT, - WrapMode.WRAP, + leftExpr = this.convertExpression(leftExpr, + leftType, leftType = commonType, + false, true, // ! left ); - rightExpr = this.convertExpression( - rightExpr, - rightType, - rightType = commonType, - ConversionKind.IMPLICIT, - WrapMode.WRAP, + rightExpr = this.convertExpression(rightExpr, + rightType, rightType = commonType, + false, true, // ! right ); } else { @@ -2841,17 +3275,17 @@ export class Compiler extends DiagnosticEmitter { expression.range, ">", leftType.toString(), rightType.toString() ); this.currentType = contextualType; - return module.createUnreachable(); + return module.unreachable(); } switch (commonType.kind) { case TypeKind.I8: case TypeKind.I16: case TypeKind.I32: { - expr = module.createBinary(BinaryOp.GtI32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.GtI32, leftExpr, rightExpr); break; } case TypeKind.ISIZE: { - expr = module.createBinary( + expr = module.binary( this.options.isWasm64 ? BinaryOp.GtI64 : BinaryOp.GtI32, @@ -2861,18 +3295,18 @@ export class Compiler extends DiagnosticEmitter { break; } case TypeKind.I64: { - expr = module.createBinary(BinaryOp.GtI64, leftExpr, rightExpr); + expr = module.binary(BinaryOp.GtI64, leftExpr, rightExpr); break; } case TypeKind.U8: case TypeKind.U16: case TypeKind.U32: case TypeKind.BOOL: { - expr = module.createBinary(BinaryOp.GtU32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.GtU32, leftExpr, rightExpr); break; } case TypeKind.USIZE: { - expr = module.createBinary( + expr = module.binary( this.options.isWasm64 ? BinaryOp.GtU64 : BinaryOp.GtU32, @@ -2882,27 +3316,27 @@ export class Compiler extends DiagnosticEmitter { break; } case TypeKind.U64: { - expr = module.createBinary(BinaryOp.GtU64, leftExpr, rightExpr); + expr = module.binary(BinaryOp.GtU64, leftExpr, rightExpr); break; } case TypeKind.F32: { - expr = module.createBinary(BinaryOp.GtF32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.GtF32, leftExpr, rightExpr); break; } case TypeKind.F64: { - expr = module.createBinary(BinaryOp.GtF64, leftExpr, rightExpr); + expr = module.binary(BinaryOp.GtF64, leftExpr, rightExpr); break; } default: { assert(false); - expr = module.createUnreachable(); + expr = module.unreachable(); } } this.currentType = Type.bool; break; } case Token.LESSTHAN_EQUALS: { - leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType); leftType = this.currentType; // check operator overload @@ -2919,26 +3353,20 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Operation_not_supported, expression.range ); - return this.module.createUnreachable(); + return this.module.unreachable(); } - rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE); + rightExpr = this.compileExpressionRetainType(right, leftType); rightType = this.currentType; if (commonType = Type.commonDenominator(leftType, rightType, true)) { - leftExpr = this.convertExpression( - leftExpr, - leftType, - leftType = commonType, - ConversionKind.IMPLICIT, - WrapMode.WRAP, + leftExpr = this.convertExpression(leftExpr, + leftType, leftType = commonType, + false, true, // ! left ); - rightExpr = this.convertExpression( - rightExpr, - rightType, - rightType = commonType, - ConversionKind.IMPLICIT, - WrapMode.WRAP, + rightExpr = this.convertExpression(rightExpr, + rightType, rightType = commonType, + false, true, // ! right ); } else { @@ -2947,17 +3375,17 @@ export class Compiler extends DiagnosticEmitter { expression.range, "<=", leftType.toString(), rightType.toString() ); this.currentType = contextualType; - return module.createUnreachable(); + return module.unreachable(); } switch (commonType.kind) { case TypeKind.I8: case TypeKind.I16: case TypeKind.I32: { - expr = module.createBinary(BinaryOp.LeI32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.LeI32, leftExpr, rightExpr); break; } case TypeKind.ISIZE: { - expr = module.createBinary( + expr = module.binary( this.options.isWasm64 ? BinaryOp.LeI64 : BinaryOp.LeI32, @@ -2967,18 +3395,18 @@ export class Compiler extends DiagnosticEmitter { break; } case TypeKind.I64: { - expr = module.createBinary(BinaryOp.LeI64, leftExpr, rightExpr); + expr = module.binary(BinaryOp.LeI64, leftExpr, rightExpr); break; } case TypeKind.U8: case TypeKind.U16: case TypeKind.U32: case TypeKind.BOOL: { - expr = module.createBinary(BinaryOp.LeU32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.LeU32, leftExpr, rightExpr); break; } case TypeKind.USIZE: { - expr = module.createBinary( + expr = module.binary( this.options.isWasm64 ? BinaryOp.LeU64 : BinaryOp.LeU32, @@ -2988,27 +3416,27 @@ export class Compiler extends DiagnosticEmitter { break; } case TypeKind.U64: { - expr = module.createBinary(BinaryOp.LeU64, leftExpr, rightExpr); + expr = module.binary(BinaryOp.LeU64, leftExpr, rightExpr); break; } case TypeKind.F32: { - expr = module.createBinary(BinaryOp.LeF32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.LeF32, leftExpr, rightExpr); break; } case TypeKind.F64: { - expr = module.createBinary(BinaryOp.LeF64, leftExpr, rightExpr); + expr = module.binary(BinaryOp.LeF64, leftExpr, rightExpr); break; } default: { assert(false); - expr = module.createUnreachable(); + expr = module.unreachable(); } } this.currentType = Type.bool; break; } case Token.GREATERTHAN_EQUALS: { - leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType); leftType = this.currentType; // check operator overload @@ -3025,26 +3453,20 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Operation_not_supported, expression.range ); - return this.module.createUnreachable(); + return this.module.unreachable(); } - rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE); + rightExpr = this.compileExpressionRetainType(right, leftType); rightType = this.currentType; if (commonType = Type.commonDenominator(leftType, rightType, true)) { - leftExpr = this.convertExpression( - leftExpr, - leftType, - leftType = commonType, - ConversionKind.IMPLICIT, - WrapMode.WRAP, + leftExpr = this.convertExpression(leftExpr, + leftType, leftType = commonType, + false, true, // ! left ); - rightExpr = this.convertExpression( - rightExpr, - rightType, - rightType = commonType, - ConversionKind.IMPLICIT, - WrapMode.WRAP, + rightExpr = this.convertExpression(rightExpr, + rightType, rightType = commonType, + false, true, // ! right ); } else { @@ -3053,17 +3475,17 @@ export class Compiler extends DiagnosticEmitter { expression.range, ">=", leftType.toString(), rightType.toString() ); this.currentType = contextualType; - return module.createUnreachable(); + return module.unreachable(); } switch (commonType.kind) { case TypeKind.I8: case TypeKind.I16: case TypeKind.I32: { - expr = module.createBinary(BinaryOp.GeI32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.GeI32, leftExpr, rightExpr); break; } case TypeKind.ISIZE: { - expr = module.createBinary( + expr = module.binary( this.options.isWasm64 ? BinaryOp.GeI64 : BinaryOp.GeI32, @@ -3073,18 +3495,18 @@ export class Compiler extends DiagnosticEmitter { break; } case TypeKind.I64: { - expr = module.createBinary(BinaryOp.GeI64, leftExpr, rightExpr); + expr = module.binary(BinaryOp.GeI64, leftExpr, rightExpr); break; } case TypeKind.U8: case TypeKind.U16: case TypeKind.U32: case TypeKind.BOOL: { - expr = module.createBinary(BinaryOp.GeU32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.GeU32, leftExpr, rightExpr); break; } case TypeKind.USIZE: { - expr = module.createBinary( + expr = module.binary( this.options.isWasm64 ? BinaryOp.GeU64 : BinaryOp.GeU32, @@ -3094,20 +3516,20 @@ export class Compiler extends DiagnosticEmitter { break; } case TypeKind.U64: { - expr = module.createBinary(BinaryOp.GeU64, leftExpr, rightExpr); + expr = module.binary(BinaryOp.GeU64, leftExpr, rightExpr); break; } case TypeKind.F32: { - expr = module.createBinary(BinaryOp.GeF32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.GeF32, leftExpr, rightExpr); break; } case TypeKind.F64: { - expr = module.createBinary(BinaryOp.GeF64, leftExpr, rightExpr); + expr = module.binary(BinaryOp.GeF64, leftExpr, rightExpr); break; } default: { assert(false); - expr = module.createUnreachable(); + expr = module.unreachable(); } } this.currentType = Type.bool; @@ -3121,7 +3543,7 @@ export class Compiler extends DiagnosticEmitter { // checking for a possible use of unary EQZ. while the most classic of all optimizations, // that's not what the source told us to do. for reference, `!left` emits unary EQZ. - leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType); leftType = this.currentType; // check operator overload @@ -3137,23 +3559,17 @@ export class Compiler extends DiagnosticEmitter { // still allow '==' with references } - rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE); + rightExpr = this.compileExpressionRetainType(right, leftType); rightType = this.currentType; if (commonType = Type.commonDenominator(leftType, rightType, false)) { - leftExpr = this.convertExpression( - leftExpr, - leftType, - leftType = commonType, - ConversionKind.IMPLICIT, - WrapMode.WRAP, + leftExpr = this.convertExpression(leftExpr, + leftType, leftType = commonType, + false, true, // ! left ); - rightExpr = this.convertExpression( - rightExpr, - rightType, - rightType = commonType, - ConversionKind.IMPLICIT, - WrapMode.WRAP, + rightExpr = this.convertExpression(rightExpr, + rightType, rightType = commonType, + false, true, // ! right ); } else { @@ -3162,7 +3578,7 @@ export class Compiler extends DiagnosticEmitter { expression.range, operatorTokenToString(expression.operator), leftType.toString(), rightType.toString() ); this.currentType = contextualType; - return module.createUnreachable(); + return module.unreachable(); } switch (commonType.kind) { case TypeKind.I8: @@ -3172,12 +3588,12 @@ export class Compiler extends DiagnosticEmitter { case TypeKind.U16: case TypeKind.U32: case TypeKind.BOOL: { - expr = module.createBinary(BinaryOp.EqI32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.EqI32, leftExpr, rightExpr); break; } case TypeKind.USIZE: case TypeKind.ISIZE: { - expr = module.createBinary( + expr = module.binary( this.options.isWasm64 ? BinaryOp.EqI64 : BinaryOp.EqI32, @@ -3188,26 +3604,26 @@ export class Compiler extends DiagnosticEmitter { } case TypeKind.I64: case TypeKind.U64: { - expr = module.createBinary(BinaryOp.EqI64, leftExpr, rightExpr); + expr = module.binary(BinaryOp.EqI64, leftExpr, rightExpr); break; } case TypeKind.F32: { - expr = module.createBinary(BinaryOp.EqF32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.EqF32, leftExpr, rightExpr); break; } case TypeKind.F64: { - expr = module.createBinary(BinaryOp.EqF64, leftExpr, rightExpr); + expr = module.binary(BinaryOp.EqF64, leftExpr, rightExpr); break; } case TypeKind.V128: { - expr = module.createUnary(UnaryOp.AllTrueVecI8x16, - module.createBinary(BinaryOp.EqVecI8x16, leftExpr, rightExpr) + expr = module.unary(UnaryOp.AllTrueVecI8x16, + module.binary(BinaryOp.EqVecI8x16, leftExpr, rightExpr) ); break; } default: { assert(false); - expr = module.createUnreachable(); + expr = module.unreachable(); } } this.currentType = Type.bool; @@ -3215,7 +3631,7 @@ export class Compiler extends DiagnosticEmitter { } case Token.EXCLAMATION_EQUALS_EQUALS: case Token.EXCLAMATION_EQUALS: { - leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType); leftType = this.currentType; // check operator overload @@ -3231,23 +3647,17 @@ export class Compiler extends DiagnosticEmitter { // still allow '!=' with references } - rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE); + rightExpr = this.compileExpressionRetainType(right, leftType); rightType = this.currentType; if (commonType = Type.commonDenominator(leftType, rightType, false)) { - leftExpr = this.convertExpression( - leftExpr, - leftType, - leftType = commonType, - ConversionKind.IMPLICIT, - WrapMode.WRAP, + leftExpr = this.convertExpression(leftExpr, + leftType, leftType = commonType, + false, true, // ! left ); - rightExpr = this.convertExpression( - rightExpr, - rightType, - rightType = commonType, - ConversionKind.IMPLICIT, - WrapMode.WRAP, + rightExpr = this.convertExpression(rightExpr, + rightType, rightType = commonType, + false, true, // ! right ); } else { @@ -3256,7 +3666,7 @@ export class Compiler extends DiagnosticEmitter { expression.range, operatorTokenToString(expression.operator), leftType.toString(), rightType.toString() ); this.currentType = contextualType; - return module.createUnreachable(); + return module.unreachable(); } switch (commonType.kind) { case TypeKind.I8: @@ -3266,12 +3676,12 @@ export class Compiler extends DiagnosticEmitter { case TypeKind.U16: case TypeKind.U32: case TypeKind.BOOL: { - expr = module.createBinary(BinaryOp.NeI32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.NeI32, leftExpr, rightExpr); break; } case TypeKind.USIZE: case TypeKind.ISIZE: { - expr = module.createBinary( + expr = module.binary( this.options.isWasm64 ? BinaryOp.NeI64 : BinaryOp.NeI32, @@ -3282,26 +3692,26 @@ export class Compiler extends DiagnosticEmitter { } case TypeKind.I64: case TypeKind.U64: { - expr = module.createBinary(BinaryOp.NeI64, leftExpr, rightExpr); + expr = module.binary(BinaryOp.NeI64, leftExpr, rightExpr); break; } case TypeKind.F32: { - expr = module.createBinary(BinaryOp.NeF32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.NeF32, leftExpr, rightExpr); break; } case TypeKind.F64: { - expr = module.createBinary(BinaryOp.NeF64, leftExpr, rightExpr); + expr = module.binary(BinaryOp.NeF64, leftExpr, rightExpr); break; } case TypeKind.V128: { - expr = module.createUnary(UnaryOp.AnyTrueVecI8x16, - module.createBinary(BinaryOp.NeVecI8x16, leftExpr, rightExpr) + expr = module.unary(UnaryOp.AnyTrueVecI8x16, + module.binary(BinaryOp.NeVecI8x16, leftExpr, rightExpr) ); break; } default: { assert(false); - expr = module.createUnreachable(); + expr = module.unreachable(); } } this.currentType = Type.bool; @@ -3312,7 +3722,7 @@ export class Compiler extends DiagnosticEmitter { } case Token.PLUS_EQUALS: compound = true; case Token.PLUS: { - leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType); leftType = this.currentType; // check operator overload @@ -3329,29 +3739,23 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Operation_not_supported, expression.range ); - return this.module.createUnreachable(); + return this.module.unreachable(); } if (compound) { - rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.NONE); + rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT); } else { - rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE); + rightExpr = this.compileExpressionRetainType(right, leftType); rightType = this.currentType; if (commonType = Type.commonDenominator(leftType, rightType, false)) { - leftExpr = this.convertExpression( - leftExpr, - leftType, - leftType = commonType, - ConversionKind.IMPLICIT, - WrapMode.NONE, + leftExpr = this.convertExpression(leftExpr, + leftType, leftType = commonType, + false, false, left ); - rightExpr = this.convertExpression( - rightExpr, - rightType, - rightType = commonType, - ConversionKind.IMPLICIT, - WrapMode.NONE, + rightExpr = this.convertExpression(rightExpr, + rightType, rightType = commonType, + false, false, right ); } else { @@ -3360,7 +3764,7 @@ export class Compiler extends DiagnosticEmitter { expression.range, "+", leftType.toString(), rightType.toString() ); this.currentType = contextualType; - return module.createUnreachable(); + return module.unreachable(); } } switch (this.currentType.kind) { @@ -3371,12 +3775,12 @@ export class Compiler extends DiagnosticEmitter { case TypeKind.BOOL: // ^ case TypeKind.I32: case TypeKind.U32: { - expr = module.createBinary(BinaryOp.AddI32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.AddI32, leftExpr, rightExpr); break; } case TypeKind.USIZE: case TypeKind.ISIZE: { - expr = module.createBinary( + expr = module.binary( this.options.isWasm64 ? BinaryOp.AddI64 : BinaryOp.AddI32, @@ -3387,27 +3791,27 @@ export class Compiler extends DiagnosticEmitter { } case TypeKind.I64: case TypeKind.U64: { - expr = module.createBinary(BinaryOp.AddI64, leftExpr, rightExpr); + expr = module.binary(BinaryOp.AddI64, leftExpr, rightExpr); break; } case TypeKind.F32: { - expr = module.createBinary(BinaryOp.AddF32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.AddF32, leftExpr, rightExpr); break; } case TypeKind.F64: { - expr = module.createBinary(BinaryOp.AddF64, leftExpr, rightExpr); + expr = module.binary(BinaryOp.AddF64, leftExpr, rightExpr); break; } default: { assert(false); - expr = module.createUnreachable(); + expr = module.unreachable(); } } break; } case Token.MINUS_EQUALS: compound = true; case Token.MINUS: { - leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType); leftType = this.currentType; // check operator overload @@ -3424,30 +3828,24 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Operation_not_supported, expression.range ); - return this.module.createUnreachable(); + return this.module.unreachable(); } if (compound) { - rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.NONE); + rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT); rightType = this.currentType; } else { - rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE); + rightExpr = this.compileExpressionRetainType(right, leftType); rightType = this.currentType; if (commonType = Type.commonDenominator(leftType, rightType, false)) { - leftExpr = this.convertExpression( - leftExpr, - leftType, - leftType = commonType, - ConversionKind.IMPLICIT, - WrapMode.NONE, + leftExpr = this.convertExpression(leftExpr, + leftType, leftType = commonType, + false, false, left ); - rightExpr = this.convertExpression( - rightExpr, - rightType, - rightType = commonType, - ConversionKind.IMPLICIT, - WrapMode.NONE, + rightExpr = this.convertExpression(rightExpr, + rightType, rightType = commonType, + false, false, right ); } else { @@ -3456,7 +3854,7 @@ export class Compiler extends DiagnosticEmitter { expression.range, "-", leftType.toString(), rightType.toString() ); this.currentType = contextualType; - return module.createUnreachable(); + return module.unreachable(); } } switch (this.currentType.kind) { @@ -3467,12 +3865,12 @@ export class Compiler extends DiagnosticEmitter { case TypeKind.BOOL: // ^ case TypeKind.I32: case TypeKind.U32: { - expr = module.createBinary(BinaryOp.SubI32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.SubI32, leftExpr, rightExpr); break; } case TypeKind.USIZE: case TypeKind.ISIZE: { - expr = module.createBinary( + expr = module.binary( this.options.isWasm64 ? BinaryOp.SubI64 : BinaryOp.SubI32, @@ -3483,27 +3881,27 @@ export class Compiler extends DiagnosticEmitter { } case TypeKind.I64: case TypeKind.U64: { - expr = module.createBinary(BinaryOp.SubI64, leftExpr, rightExpr); + expr = module.binary(BinaryOp.SubI64, leftExpr, rightExpr); break; } case TypeKind.F32: { - expr = module.createBinary(BinaryOp.SubF32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.SubF32, leftExpr, rightExpr); break; } case TypeKind.F64: { - expr = module.createBinary(BinaryOp.SubF64, leftExpr, rightExpr); + expr = module.binary(BinaryOp.SubF64, leftExpr, rightExpr); break; } default: { assert(false); - expr = module.createUnreachable(); + expr = module.unreachable(); } } break; } case Token.ASTERISK_EQUALS: compound = true; case Token.ASTERISK: { - leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType); leftType = this.currentType; // check operator overload @@ -3520,30 +3918,24 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Operation_not_supported, expression.range ); - return this.module.createUnreachable(); + return this.module.unreachable(); } if (compound) { leftExpr = this.ensureSmallIntegerWrap(leftExpr, leftType); - rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.WRAP); + rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT); } else { - rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE); + rightExpr = this.compileExpressionRetainType(right, leftType); rightType = this.currentType; if (commonType = Type.commonDenominator(leftType, rightType, false)) { - leftExpr = this.convertExpression( - leftExpr, - leftType, - leftType = commonType, - ConversionKind.IMPLICIT, - WrapMode.NONE, + leftExpr = this.convertExpression(leftExpr, + leftType, leftType = commonType, + false, false, left ); - rightExpr = this.convertExpression( - rightExpr, - rightType, - rightType = commonType, - ConversionKind.IMPLICIT, - WrapMode.NONE, + rightExpr = this.convertExpression(rightExpr, + rightType, rightType = commonType, + false, false, right ); } else { @@ -3552,7 +3944,7 @@ export class Compiler extends DiagnosticEmitter { expression.range, "*", leftType.toString(), rightType.toString() ); this.currentType = contextualType; - return module.createUnreachable(); + return module.unreachable(); } } switch (this.currentType.kind) { @@ -3563,12 +3955,12 @@ export class Compiler extends DiagnosticEmitter { case TypeKind.BOOL: case TypeKind.I32: case TypeKind.U32: { - expr = module.createBinary(BinaryOp.MulI32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.MulI32, leftExpr, rightExpr); break; } case TypeKind.USIZE: case TypeKind.ISIZE: { - expr = module.createBinary( + expr = module.binary( this.options.isWasm64 ? BinaryOp.MulI64 : BinaryOp.MulI32, @@ -3579,27 +3971,27 @@ export class Compiler extends DiagnosticEmitter { } case TypeKind.I64: case TypeKind.U64: { - expr = module.createBinary(BinaryOp.MulI64, leftExpr, rightExpr); + expr = module.binary(BinaryOp.MulI64, leftExpr, rightExpr); break; } case TypeKind.F32: { - expr = module.createBinary(BinaryOp.MulF32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.MulF32, leftExpr, rightExpr); break; } case TypeKind.F64: { - expr = module.createBinary(BinaryOp.MulF64, leftExpr, rightExpr); + expr = module.binary(BinaryOp.MulF64, leftExpr, rightExpr); break; } default: { assert(false); - expr = module.createUnreachable(); + expr = module.unreachable(); } } break; } case Token.ASTERISK_ASTERISK_EQUALS: compound = true; case Token.ASTERISK_ASTERISK: { - leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType); leftType = this.currentType; // check operator overload @@ -3616,32 +4008,32 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Operation_not_supported, expression.range ); - return this.module.createUnreachable(); + return this.module.unreachable(); } let instance: Function | null; // Mathf.pow if lhs is f32 (result is f32) if (this.currentType.kind == TypeKind.F32) { - rightExpr = this.compileExpression(right, Type.f32, ConversionKind.IMPLICIT, WrapMode.NONE); + rightExpr = this.compileExpression(right, Type.f32, ContextualFlags.IMPLICIT); rightType = this.currentType; if (!(instance = this.f32PowInstance)) { - let namespace = this.program.lookupGlobal(LibrarySymbols.Mathf); + let namespace = this.program.lookupGlobal(CommonSymbols.Mathf); if (!namespace) { this.error( DiagnosticCode.Cannot_find_name_0, expression.range, "Mathf" ); - expr = module.createUnreachable(); + expr = module.unreachable(); break; } - let prototype = namespace.members ? namespace.members.get(LibrarySymbols.pow) : null; + let prototype = namespace.members ? namespace.members.get(CommonSymbols.pow) : null; if (!prototype) { this.error( DiagnosticCode.Cannot_find_name_0, expression.range, "Mathf.pow" ); - expr = module.createUnreachable(); + expr = module.unreachable(); break; } assert(prototype.kind == ElementKind.FUNCTION_PROTOTYPE); @@ -3651,39 +4043,31 @@ export class Compiler extends DiagnosticEmitter { // Math.pow otherwise (result is f64) // TODO: should the result be converted back? } else { - leftExpr = this.convertExpression( - leftExpr, - this.currentType, - Type.f64, - ConversionKind.IMPLICIT, - WrapMode.NONE, + leftExpr = this.convertExpression(leftExpr, + this.currentType, Type.f64, + false, false, left ); leftType = this.currentType; - rightExpr = this.compileExpression( - right, - Type.f64, - ConversionKind.IMPLICIT, - WrapMode.NONE - ); + rightExpr = this.compileExpression(right, Type.f64, ContextualFlags.IMPLICIT); rightType = this.currentType; if (!(instance = this.f64PowInstance)) { - let namespace = this.program.lookupGlobal(LibrarySymbols.Math); + let namespace = this.program.lookupGlobal(CommonSymbols.Math); if (!namespace) { this.error( DiagnosticCode.Cannot_find_name_0, expression.range, "Math" ); - expr = module.createUnreachable(); + expr = module.unreachable(); break; } - let prototype = namespace.members ? namespace.members.get(LibrarySymbols.pow) : null; + let prototype = namespace.members ? namespace.members.get(CommonSymbols.pow) : null; if (!prototype) { this.error( DiagnosticCode.Cannot_find_name_0, expression.range, "Math.pow" ); - expr = module.createUnreachable(); + expr = module.unreachable(); break; } assert(prototype.kind == ElementKind.FUNCTION_PROTOTYPE); @@ -3691,15 +4075,15 @@ export class Compiler extends DiagnosticEmitter { } } if (!(instance && this.compileFunction(instance))) { - expr = module.createUnreachable(); + expr = module.unreachable(); } else { - expr = this.makeCallDirect(instance, [ leftExpr, rightExpr ]); + expr = this.makeCallDirect(instance, [ leftExpr, rightExpr ], expression); } break; } case Token.SLASH_EQUALS: compound = true; case Token.SLASH: { - leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType); leftType = this.currentType; // check operator overload @@ -3716,31 +4100,25 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Operation_not_supported, expression.range ); - return this.module.createUnreachable(); + return this.module.unreachable(); } if (compound) { leftExpr = this.ensureSmallIntegerWrap(leftExpr, leftType); - rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.WRAP); + rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT); rightType = this.currentType; } else { - rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE); + rightExpr = this.compileExpressionRetainType(right, leftType); rightType = this.currentType; if (commonType = Type.commonDenominator(leftType, rightType, false)) { - leftExpr = this.convertExpression( - leftExpr, - leftType, - leftType = commonType, - ConversionKind.IMPLICIT, - WrapMode.WRAP, // ! + leftExpr = this.convertExpression(leftExpr, + leftType, leftType = commonType, + false, true, // ! left ); - rightExpr = this.convertExpression( - rightExpr, - rightType, - rightType = commonType, - ConversionKind.IMPLICIT, - WrapMode.WRAP, // ! + rightExpr = this.convertExpression(rightExpr, + rightType, rightType = commonType, + false, true, // ! right ); } else { @@ -3749,18 +4127,18 @@ export class Compiler extends DiagnosticEmitter { expression.range, "/", leftType.toString(), rightType.toString() ); this.currentType = contextualType; - return module.createUnreachable(); + return module.unreachable(); } } switch (this.currentType.kind) { case TypeKind.I8: // signed div on signed small integers might overflow, e.g. -128/-1 case TypeKind.I16: // ^ case TypeKind.I32: { - expr = module.createBinary(BinaryOp.DivI32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.DivI32, leftExpr, rightExpr); break; } case TypeKind.ISIZE: { - expr = module.createBinary( + expr = module.binary( this.options.isWasm64 ? BinaryOp.DivI64 : BinaryOp.DivI32, @@ -3770,21 +4148,21 @@ export class Compiler extends DiagnosticEmitter { break; } case TypeKind.I64: { - expr = module.createBinary(BinaryOp.DivI64, leftExpr, rightExpr); + expr = module.binary(BinaryOp.DivI64, leftExpr, rightExpr); break; } case TypeKind.U8: case TypeKind.U16: case TypeKind.BOOL: { - expr = module.createBinary(BinaryOp.DivU32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.DivU32, leftExpr, rightExpr); break; } case TypeKind.U32: { - expr = module.createBinary(BinaryOp.DivU32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.DivU32, leftExpr, rightExpr); break; } case TypeKind.USIZE: { - expr = module.createBinary( + expr = module.binary( this.options.isWasm64 ? BinaryOp.DivU64 : BinaryOp.DivU32, @@ -3794,27 +4172,27 @@ export class Compiler extends DiagnosticEmitter { break; } case TypeKind.U64: { - expr = module.createBinary(BinaryOp.DivU64, leftExpr, rightExpr); + expr = module.binary(BinaryOp.DivU64, leftExpr, rightExpr); break; } case TypeKind.F32: { - expr = module.createBinary(BinaryOp.DivF32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.DivF32, leftExpr, rightExpr); break; } case TypeKind.F64: { - expr = module.createBinary(BinaryOp.DivF64, leftExpr, rightExpr); + expr = module.binary(BinaryOp.DivF64, leftExpr, rightExpr); break; } default: { assert(false); - expr = module.createUnreachable(); + expr = module.unreachable(); } } break; } case Token.PERCENT_EQUALS: compound = true; case Token.PERCENT: { - leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType); leftType = this.currentType; // check operator overload @@ -3831,31 +4209,25 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Operation_not_supported, expression.range ); - return this.module.createUnreachable(); + return this.module.unreachable(); } if (compound) { leftExpr = this.ensureSmallIntegerWrap(leftExpr, leftType); - rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.WRAP); + rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT); rightType = this.currentType; } else { - rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE); + rightExpr = this.compileExpressionRetainType(right, leftType); rightType = this.currentType; if (commonType = Type.commonDenominator(leftType, rightType, false)) { - leftExpr = this.convertExpression( - leftExpr, - leftType, - leftType = commonType, - ConversionKind.IMPLICIT, - WrapMode.WRAP, // ! + leftExpr = this.convertExpression(leftExpr, + leftType, leftType = commonType, + false, true, // ! left ); - rightExpr = this.convertExpression( - rightExpr, - rightType, - rightType = commonType, - ConversionKind.IMPLICIT, - WrapMode.WRAP, // ! + rightExpr = this.convertExpression(rightExpr, + rightType, rightType = commonType, + false, true, // ! right ); } else { @@ -3864,21 +4236,21 @@ export class Compiler extends DiagnosticEmitter { expression.range, "%", leftType.toString(), rightType.toString() ); this.currentType = contextualType; - return module.createUnreachable(); + return module.unreachable(); } } switch (this.currentType.kind) { case TypeKind.I8: case TypeKind.I16: { - expr = module.createBinary(BinaryOp.RemI32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.RemI32, leftExpr, rightExpr); break; } case TypeKind.I32: { - expr = module.createBinary(BinaryOp.RemI32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.RemI32, leftExpr, rightExpr); break; } case TypeKind.ISIZE: { - expr = module.createBinary( + expr = module.binary( this.options.isWasm64 ? BinaryOp.RemI64 : BinaryOp.RemI32, @@ -3888,21 +4260,21 @@ export class Compiler extends DiagnosticEmitter { break; } case TypeKind.I64: { - expr = module.createBinary(BinaryOp.RemI64, leftExpr, rightExpr); + expr = module.binary(BinaryOp.RemI64, leftExpr, rightExpr); break; } case TypeKind.U8: case TypeKind.U16: case TypeKind.BOOL: { - expr = module.createBinary(BinaryOp.RemU32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.RemU32, leftExpr, rightExpr); break; } case TypeKind.U32: { - expr = module.createBinary(BinaryOp.RemU32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.RemU32, leftExpr, rightExpr); break; } case TypeKind.USIZE: { - expr = module.createBinary( + expr = module.binary( this.options.isWasm64 ? BinaryOp.RemU64 : BinaryOp.RemU32, @@ -3912,81 +4284,81 @@ export class Compiler extends DiagnosticEmitter { break; } case TypeKind.U64: { - expr = module.createBinary(BinaryOp.RemU64, leftExpr, rightExpr); + expr = module.binary(BinaryOp.RemU64, leftExpr, rightExpr); break; } case TypeKind.F32: { let instance = this.f32ModInstance; if (!instance) { - let namespace = this.program.lookupGlobal(LibrarySymbols.Mathf); + let namespace = this.program.lookupGlobal(CommonSymbols.Mathf); if (!namespace) { this.error( DiagnosticCode.Cannot_find_name_0, expression.range, "Mathf" ); - expr = module.createUnreachable(); + expr = module.unreachable(); break; } - let prototype = namespace.members ? namespace.members.get(LibrarySymbols.mod) : null; + let prototype = namespace.members ? namespace.members.get(CommonSymbols.mod) : null; if (!prototype) { this.error( DiagnosticCode.Cannot_find_name_0, expression.range, "Mathf.mod" ); - expr = module.createUnreachable(); + expr = module.unreachable(); break; } assert(prototype.kind == ElementKind.FUNCTION_PROTOTYPE); this.f32ModInstance = instance = this.resolver.resolveFunction(prototype, null); } if (!(instance && this.compileFunction(instance))) { - expr = module.createUnreachable(); + expr = module.unreachable(); } else { - expr = this.makeCallDirect(instance, [ leftExpr, rightExpr ]); + expr = this.makeCallDirect(instance, [ leftExpr, rightExpr ], expression); } break; } case TypeKind.F64: { let instance = this.f64ModInstance; if (!instance) { - let namespace = this.program.lookupGlobal(LibrarySymbols.Math); + let namespace = this.program.lookupGlobal(CommonSymbols.Math); if (!namespace) { this.error( DiagnosticCode.Cannot_find_name_0, expression.range, "Math" ); - expr = module.createUnreachable(); + expr = module.unreachable(); break; } - let prototype = namespace.members ? namespace.members.get(LibrarySymbols.mod) : null; + let prototype = namespace.members ? namespace.members.get(CommonSymbols.mod) : null; if (!prototype) { this.error( DiagnosticCode.Cannot_find_name_0, expression.range, "Math.mod" ); - expr = module.createUnreachable(); + expr = module.unreachable(); break; } assert(prototype.kind == ElementKind.FUNCTION_PROTOTYPE); this.f64ModInstance = instance = this.resolver.resolveFunction(prototype, null); } if (!(instance && this.compileFunction(instance))) { - expr = module.createUnreachable(); + expr = module.unreachable(); } else { - expr = this.makeCallDirect(instance, [ leftExpr, rightExpr ]); + expr = this.makeCallDirect(instance, [ leftExpr, rightExpr ], expression); } break; } default: { assert(false); - expr = module.createUnreachable(); + expr = module.unreachable(); } } break; } case Token.LESSTHAN_LESSTHAN_EQUALS: compound = true; case Token.LESSTHAN_LESSTHAN: { - leftExpr = this.compileExpressionRetainType(left, contextualType.intType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType.intType); leftType = this.currentType; // check operator overload @@ -4003,10 +4375,10 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Operation_not_supported, expression.range ); - return this.module.createUnreachable(); + return this.module.unreachable(); } - rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.NONE); + rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT); rightType = this.currentType; switch (this.currentType.kind) { case TypeKind.I8: @@ -4016,17 +4388,17 @@ export class Compiler extends DiagnosticEmitter { case TypeKind.BOOL: case TypeKind.I32: case TypeKind.U32: { - expr = module.createBinary(BinaryOp.ShlI32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.ShlI32, leftExpr, rightExpr); break; } case TypeKind.I64: case TypeKind.U64: { - expr = module.createBinary(BinaryOp.ShlI64, leftExpr, rightExpr); + expr = module.binary(BinaryOp.ShlI64, leftExpr, rightExpr); break; } case TypeKind.USIZE: case TypeKind.ISIZE: { - expr = module.createBinary( + expr = module.binary( this.options.isWasm64 ? BinaryOp.ShlI64 : BinaryOp.ShlI32, @@ -4041,18 +4413,18 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1, expression.range, operatorTokenToString(expression.operator), this.currentType.toString() ); - return module.createUnreachable(); + return module.unreachable(); } default: { assert(false); - expr = module.createUnreachable(); + expr = module.unreachable(); } } break; } case Token.GREATERTHAN_GREATERTHAN_EQUALS: compound = true; case Token.GREATERTHAN_GREATERTHAN: { - leftExpr = this.compileExpressionRetainType(left, contextualType.intType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType.intType); leftType = this.currentType; // check operator overload @@ -4069,28 +4441,28 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Operation_not_supported, expression.range ); - return this.module.createUnreachable(); + return this.module.unreachable(); } leftExpr = this.ensureSmallIntegerWrap(leftExpr, leftType); // must clear garbage bits - rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.WRAP); + rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT); rightType = this.currentType; switch (this.currentType.kind) { case TypeKind.I8: case TypeKind.I16: { - expr = module.createBinary(BinaryOp.ShrI32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.ShrI32, leftExpr, rightExpr); break; } case TypeKind.I32: { - expr = module.createBinary(BinaryOp.ShrI32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.ShrI32, leftExpr, rightExpr); break; } case TypeKind.I64: { - expr = module.createBinary(BinaryOp.ShrI64, leftExpr, rightExpr); + expr = module.binary(BinaryOp.ShrI64, leftExpr, rightExpr); break; } case TypeKind.ISIZE: { - expr = module.createBinary( + expr = module.binary( this.options.isWasm64 ? BinaryOp.ShrI64 : BinaryOp.ShrI32, @@ -4102,19 +4474,19 @@ export class Compiler extends DiagnosticEmitter { case TypeKind.U8: case TypeKind.U16: case TypeKind.BOOL: { - expr = module.createBinary(BinaryOp.ShrU32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.ShrU32, leftExpr, rightExpr); break; } case TypeKind.U32: { - expr = module.createBinary(BinaryOp.ShrU32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.ShrU32, leftExpr, rightExpr); break; } case TypeKind.U64: { - expr = module.createBinary(BinaryOp.ShrU64, leftExpr, rightExpr); + expr = module.binary(BinaryOp.ShrU64, leftExpr, rightExpr); break; } case TypeKind.USIZE: { - expr = module.createBinary( + expr = module.binary( this.options.isWasm64 ? BinaryOp.ShrU64 : BinaryOp.ShrU32, @@ -4129,18 +4501,18 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1, expression.range, operatorTokenToString(expression.operator), this.currentType.toString() ); - return module.createUnreachable(); + return module.unreachable(); } default: { assert(false); - expr = module.createUnreachable(); + expr = module.unreachable(); } } break; } case Token.GREATERTHAN_GREATERTHAN_GREATERTHAN_EQUALS: compound = true; case Token.GREATERTHAN_GREATERTHAN_GREATERTHAN: { - leftExpr = this.compileExpressionRetainType(left, contextualType.intType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType.intType); leftType = this.currentType; // check operator overload @@ -4157,33 +4529,33 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Operation_not_supported, expression.range ); - return this.module.createUnreachable(); + return this.module.unreachable(); } leftExpr = this.ensureSmallIntegerWrap(leftExpr, leftType); // must clear garbage bits - rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.NONE); + rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT); rightType = this.currentType; switch (this.currentType.kind) { case TypeKind.U8: case TypeKind.U16: case TypeKind.BOOL: { // assumes that unsigned shr on unsigned small integers does not overflow - expr = module.createBinary(BinaryOp.ShrU32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.ShrU32, leftExpr, rightExpr); } case TypeKind.I8: case TypeKind.I16: case TypeKind.I32: case TypeKind.U32: { - expr = module.createBinary(BinaryOp.ShrU32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.ShrU32, leftExpr, rightExpr); break; } case TypeKind.I64: case TypeKind.U64: { - expr = module.createBinary(BinaryOp.ShrU64, leftExpr, rightExpr); + expr = module.binary(BinaryOp.ShrU64, leftExpr, rightExpr); break; } case TypeKind.USIZE: case TypeKind.ISIZE: { - expr = module.createBinary( + expr = module.binary( this.options.isWasm64 ? BinaryOp.ShrU64 : BinaryOp.ShrU32, @@ -4198,18 +4570,18 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1, expression.range, operatorTokenToString(expression.operator), this.currentType.toString() ); - return module.createUnreachable(); + return module.unreachable(); } default: { assert(false); - expr = module.createUnreachable(); + expr = module.unreachable(); } } break; } case Token.AMPERSAND_EQUALS: compound = true; case Token.AMPERSAND: { - leftExpr = this.compileExpressionRetainType(left, contextualType.intType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType.intType); leftType = this.currentType; // check operator overloadd @@ -4226,30 +4598,24 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Operation_not_supported, expression.range ); - return this.module.createUnreachable(); + return this.module.unreachable(); } if (compound) { - rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.NONE); + rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT); rightType = this.currentType; } else { - rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE); + rightExpr = this.compileExpressionRetainType(right, leftType); rightType = this.currentType; if (commonType = Type.commonDenominator(leftType, rightType, false)) { - leftExpr = this.convertExpression( - leftExpr, - leftType, - leftType = commonType, - ConversionKind.IMPLICIT, - WrapMode.NONE, + leftExpr = this.convertExpression(leftExpr, + leftType, leftType = commonType, + false, false, left ); - rightExpr = this.convertExpression( - rightExpr, - rightType, - rightType = commonType, - ConversionKind.IMPLICIT, - WrapMode.NONE, + rightExpr = this.convertExpression(rightExpr, + rightType, rightType = commonType, + false, false, right ); } else { @@ -4258,7 +4624,7 @@ export class Compiler extends DiagnosticEmitter { expression.range, "&", leftType.toString(), rightType.toString() ); this.currentType = contextualType; - return module.createUnreachable(); + return module.unreachable(); } } switch (this.currentType.kind) { @@ -4269,17 +4635,17 @@ export class Compiler extends DiagnosticEmitter { case TypeKind.U16: case TypeKind.BOOL: case TypeKind.U32: { - expr = module.createBinary(BinaryOp.AndI32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.AndI32, leftExpr, rightExpr); break; } case TypeKind.I64: case TypeKind.U64: { - expr = module.createBinary(BinaryOp.AndI64, leftExpr, rightExpr); + expr = module.binary(BinaryOp.AndI64, leftExpr, rightExpr); break; } case TypeKind.USIZE: case TypeKind.ISIZE: { - expr = module.createBinary( + expr = module.binary( this.options.isWasm64 ? BinaryOp.AndI64 : BinaryOp.AndI32, @@ -4294,18 +4660,18 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1, expression.range, operatorTokenToString(expression.operator), this.currentType.toString() ); - return module.createUnreachable(); + return module.unreachable(); } default: { assert(false); - expr = module.createUnreachable(); + expr = module.unreachable(); } } break; } case Token.BAR_EQUALS: compound = true; case Token.BAR: { - leftExpr = this.compileExpressionRetainType(left, contextualType.intType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType.intType); leftType = this.currentType; // check operator overload @@ -4322,30 +4688,24 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Operation_not_supported, expression.range ); - return this.module.createUnreachable(); + return this.module.unreachable(); } if (compound) { - rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.NONE); + rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT); rightType = this.currentType; } else { - rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE); + rightExpr = this.compileExpressionRetainType(right, leftType); rightType = this.currentType; if (commonType = Type.commonDenominator(leftType, rightType, false)) { - leftExpr = this.convertExpression( - leftExpr, - leftType, - leftType = commonType, - ConversionKind.IMPLICIT, - WrapMode.NONE, + leftExpr = this.convertExpression(leftExpr, + leftType, leftType = commonType, + false, false, left ); - rightExpr = this.convertExpression( - rightExpr, - rightType, - rightType = commonType, - ConversionKind.IMPLICIT, - WrapMode.NONE, + rightExpr = this.convertExpression(rightExpr, + rightType, rightType = commonType, + false, false, right ); } else { @@ -4354,7 +4714,7 @@ export class Compiler extends DiagnosticEmitter { expression.range, "|", leftType.toString(), rightType.toString() ); this.currentType = contextualType; - return module.createUnreachable(); + return module.unreachable(); } } switch (this.currentType.kind) { @@ -4363,22 +4723,22 @@ export class Compiler extends DiagnosticEmitter { case TypeKind.U8: case TypeKind.U16: case TypeKind.BOOL: { - expr = module.createBinary(BinaryOp.OrI32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.OrI32, leftExpr, rightExpr); break; } case TypeKind.I32: case TypeKind.U32: { - expr = module.createBinary(BinaryOp.OrI32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.OrI32, leftExpr, rightExpr); break; } case TypeKind.I64: case TypeKind.U64: { - expr = module.createBinary(BinaryOp.OrI64, leftExpr, rightExpr); + expr = module.binary(BinaryOp.OrI64, leftExpr, rightExpr); break; } case TypeKind.USIZE: case TypeKind.ISIZE: { - expr = module.createBinary( + expr = module.binary( this.options.isWasm64 ? BinaryOp.OrI64 : BinaryOp.OrI32, @@ -4393,18 +4753,18 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1, expression.range, operatorTokenToString(expression.operator), this.currentType.toString() ); - return module.createUnreachable(); + return module.unreachable(); } default: { assert(false); - expr = module.createUnreachable(); + expr = module.unreachable(); } } break; } case Token.CARET_EQUALS: compound = true; case Token.CARET: { - leftExpr = this.compileExpressionRetainType(left, contextualType.intType, WrapMode.NONE); + leftExpr = this.compileExpressionRetainType(left, contextualType.intType); leftType = this.currentType; // check operator overload @@ -4421,30 +4781,24 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Operation_not_supported, expression.range ); - return this.module.createUnreachable(); + return this.module.unreachable(); } if (compound) { - rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.NONE); + rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT); rightType = this.currentType; } else { - rightExpr = this.compileExpressionRetainType(right, leftType, WrapMode.NONE); + rightExpr = this.compileExpressionRetainType(right, leftType); rightType = this.currentType; if (commonType = Type.commonDenominator(leftType, rightType, false)) { - leftExpr = this.convertExpression( - leftExpr, - leftType, - leftType = commonType, - ConversionKind.IMPLICIT, - WrapMode.NONE, + leftExpr = this.convertExpression(leftExpr, + leftType, leftType = commonType, + false, false, left ); - rightExpr = this.convertExpression( - rightExpr, - rightType, - rightType = commonType, - ConversionKind.IMPLICIT, - WrapMode.NONE, + rightExpr = this.convertExpression(rightExpr, + rightType, rightType = commonType, + false, false, right ); } else { @@ -4453,7 +4807,7 @@ export class Compiler extends DiagnosticEmitter { expression.range, "^", leftType.toString(), rightType.toString() ); this.currentType = contextualType; - return module.createUnreachable(); + return module.unreachable(); } } switch (this.currentType.kind) { @@ -4462,22 +4816,22 @@ export class Compiler extends DiagnosticEmitter { case TypeKind.U8: case TypeKind.U16: case TypeKind.BOOL: { - expr = module.createBinary(BinaryOp.XorI32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.XorI32, leftExpr, rightExpr); break; } case TypeKind.I32: case TypeKind.U32: { - expr = module.createBinary(BinaryOp.XorI32, leftExpr, rightExpr); + expr = module.binary(BinaryOp.XorI32, leftExpr, rightExpr); break; } case TypeKind.I64: case TypeKind.U64: { - expr = module.createBinary(BinaryOp.XorI64, leftExpr, rightExpr); + expr = module.binary(BinaryOp.XorI64, leftExpr, rightExpr); break; } case TypeKind.USIZE: case TypeKind.ISIZE: { - expr = module.createBinary( + expr = module.binary( this.options.isWasm64 ? BinaryOp.XorI64 : BinaryOp.XorI32, @@ -4492,11 +4846,11 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.The_0_operator_cannot_be_applied_to_type_1, expression.range, operatorTokenToString(expression.operator), this.currentType.toString() ); - return module.createUnreachable(); + return module.unreachable(); } default: { assert(false); - expr = module.createUnreachable(); + expr = module.unreachable(); } } break; @@ -4504,84 +4858,219 @@ export class Compiler extends DiagnosticEmitter { // logical (no overloading) - case Token.AMPERSAND_AMPERSAND: { // left && right - leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE); + case Token.AMPERSAND_AMPERSAND: { // left && right -> (t = left) ? right : t + let flow = this.currentFlow; + leftExpr = this.compileExpressionRetainType(left, contextualType, contextualFlags); leftType = this.currentType; - rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.NONE); - rightType = this.currentType; - // simplify if cloning left without side effects is possible - if (expr = module.cloneExpression(leftExpr, true, 0)) { - expr = module.createIf( - this.makeIsTrueish(leftExpr, this.currentType), - rightExpr, - expr + let rightFlow = flow.fork(); + this.currentFlow = rightFlow; + rightFlow.inheritNonnullIfTrue(leftExpr); + rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT | (contextualFlags & ~ContextualFlags.WILL_DROP)); + rightType = leftType; + + // simplify if only interested in true or false + if (contextualType == Type.bool || contextualType == Type.void) { + rightExpr = this.performAutoreleasesWithValue(rightFlow, rightExpr, rightType); + rightFlow.freeScopedLocals(); + this.currentFlow = flow; + this.currentType = Type.bool; + expr = module.if( + this.makeIsTrueish(leftExpr, leftType), + this.makeIsTrueish(rightExpr, rightType), + module.i32(0) ); - // if not possible, tee left to a temp. local - } else { - let flow = this.currentFlow; - let tempLocal = flow.getAndFreeTempLocal( - this.currentType, - !flow.canOverflow(leftExpr, this.currentType) - ); - expr = module.createIf( - this.makeIsTrueish( - module.createTeeLocal(tempLocal.index, leftExpr), - this.currentType - ), + // references must properly retain and release, with the same outcome independent of the branch taken + } else if (leftType.isManaged) { + let leftAutoreleaseSkipped = this.skippedAutoreleases.has(leftExpr); + let rightAutoreleaseSkipped = this.skippedAutoreleases.has(rightExpr); + let temp = flow.getTempLocal(leftType); + leftExpr = module.local_tee(temp.index, leftExpr); + + // instead of retaining left and releasing it again in right when right + // is taken, we can also just retain left if right is not taken + let retainLeftInElse = false; + if (leftAutoreleaseSkipped != rightAutoreleaseSkipped) { // xor + if (!leftAutoreleaseSkipped) { + retainLeftInElse = true; + } else { + rightExpr = this.makeRetain(rightExpr); + rightAutoreleaseSkipped = true; + } + } else if (!(contextualFlags & ContextualFlags.SKIP_AUTORELEASE)) { // otherwise keep right alive a little longer + rightExpr = this.moveAutorelease(rightExpr, rightFlow, flow); + } + + let rightStmts = new Array(); + if (leftAutoreleaseSkipped) { // left turned out to be true'ish and is dropped + rightStmts.unshift( + this.makeRelease( + module.local_get(temp.index, leftType.toNativeType()) + ) + ); + } + rightExpr = this.performAutoreleasesWithValue(rightFlow, rightExpr, rightType, rightStmts); + rightFlow.freeScopedLocals(); + this.currentFlow = flow; + + expr = module.if( + this.makeIsTrueish(leftExpr, leftType), rightExpr, - module.createGetLocal( - assert(tempLocal).index, // to be sure - this.currentType.toNativeType() - ) + retainLeftInElse + ? this.makeRetain( + module.local_get(temp.index, leftType.toNativeType()) + ) + : module.local_get(temp.index, leftType.toNativeType()) ); + if (leftAutoreleaseSkipped || rightAutoreleaseSkipped) this.skippedAutoreleases.add(expr); + if (temp) flow.freeTempLocal(temp); + + // basic values can use more aggressive optimizations + } else { + rightExpr = this.performAutoreleasesWithValue(rightFlow, rightExpr, rightType); + rightFlow.freeScopedLocals(); + this.currentFlow = flow; + + // simplify if cloning left without side effects is possible + if (expr = module.cloneExpression(leftExpr, true, 0)) { + expr = module.if( + this.makeIsTrueish(leftExpr, this.currentType), + rightExpr, + expr + ); + + // if not possible, tee left to a temp + } else { + let tempLocal = flow.getTempLocal(leftType); + if (!flow.canOverflow(leftExpr, leftType)) flow.setLocalFlag(tempLocal.index, LocalFlags.WRAPPED); + if (flow.isNonnull(leftExpr, leftType)) flow.setLocalFlag(tempLocal.index, LocalFlags.NONNULL); + expr = module.if( + this.makeIsTrueish(module.local_tee(tempLocal.index, leftExpr), leftType), + rightExpr, + module.local_get(tempLocal.index, leftType.toNativeType()) + ); + } } + this.currentType = leftType; break; } - case Token.BAR_BAR: { // left || right - leftExpr = this.compileExpressionRetainType(left, contextualType, WrapMode.NONE); + case Token.BAR_BAR: { // left || right -> ((t = left) ? t : right) + let flow = this.currentFlow; + leftExpr = this.compileExpressionRetainType(left, contextualType, contextualFlags); leftType = this.currentType; - rightExpr = this.compileExpression(right, leftType, ConversionKind.IMPLICIT, WrapMode.NONE); - rightType = this.currentType; - // simplify if cloning left without side effects is possible - if (expr = this.module.cloneExpression(leftExpr, true, 0)) { - expr = this.module.createIf( - this.makeIsTrueish(leftExpr, this.currentType), - expr, - rightExpr + let rightFlow = flow.fork(); + this.currentFlow = rightFlow; + rightFlow.inheritNonnullIfFalse(leftExpr); + rightExpr = this.compileExpression(right, leftType, ContextualFlags.IMPLICIT | contextualFlags); + rightType = leftType; + + // simplify if only interested in true or false + if (contextualType == Type.bool || contextualType == Type.void) { + rightExpr = this.performAutoreleasesWithValue(rightFlow, rightExpr, leftType); + rightFlow.freeScopedLocals(); + this.currentFlow = flow; + this.currentType = Type.bool; + expr = module.if( + this.makeIsTrueish(leftExpr, leftType), + module.i32(1), + this.makeIsTrueish(rightExpr, rightType) ); - // if not possible, tee left to a temp. local - } else { - let flow = this.currentFlow; - let tempLocal = flow.getAndFreeTempLocal( - this.currentType, - !flow.canOverflow(leftExpr, this.currentType) - ); - expr = module.createIf( - this.makeIsTrueish( - module.createTeeLocal(tempLocal.index, leftExpr), - this.currentType - ), - module.createGetLocal( - assert(tempLocal).index, // to be sure - this.currentType.toNativeType() - ), + // references must properly retain and release, with the same outcome independent of the branch taken + } else if (leftType.isManaged) { + let leftAutoreleaseSkipped = this.skippedAutoreleases.has(leftExpr); + let rightAutoreleaseSkipped = this.skippedAutoreleases.has(rightExpr); + let temp = flow.getTempLocal(leftType); + leftExpr = module.local_tee(temp.index, leftExpr); + + // instead of retaining left and releasing it again in right when right + // is taken, we can also just retain left if right is not taken + let retainLeftInThen = false; + if (leftAutoreleaseSkipped != rightAutoreleaseSkipped) { // xor + if (!leftAutoreleaseSkipped) { + retainLeftInThen = true; + } else { + rightExpr = this.makeRetain(rightExpr); + rightAutoreleaseSkipped = true; + } + } else if (!(contextualFlags & ContextualFlags.SKIP_AUTORELEASE)) { // otherwise keep right alive a little longer + rightExpr = this.moveAutorelease(rightExpr, rightFlow, flow); + } + + let rightStmts = new Array(); + if (leftAutoreleaseSkipped) { // left turned out to be false'ish and is dropped + // TODO: usually, false'ish means left is null, but this might not hold + // once implicit conversion with strings is performed and left is "", so: + rightStmts.unshift( + this.makeRelease( + module.local_get(temp.index, leftType.toNativeType()) + ) + ); + } + rightExpr = this.performAutoreleasesWithValue(rightFlow, rightExpr, rightType, rightStmts); + rightFlow.freeScopedLocals(); + this.currentFlow = flow; + + expr = module.if( + this.makeIsTrueish(leftExpr, leftType), + retainLeftInThen + ? this.makeRetain( + module.local_get(temp.index, leftType.toNativeType()) + ) + : module.local_get(temp.index, leftType.toNativeType()), rightExpr ); + if (leftAutoreleaseSkipped || rightAutoreleaseSkipped) this.skippedAutoreleases.add(expr); + if (temp) flow.freeTempLocal(temp); + + // basic values can use more aggressive optimizations + } else { + rightExpr = this.performAutoreleasesWithValue(rightFlow, rightExpr, rightType); + rightFlow.freeScopedLocals(); + this.currentFlow = flow; + + // simplify if cloning left without side effects is possible + if (expr = module.cloneExpression(leftExpr, true, 0)) { + expr = module.if( + this.makeIsTrueish(leftExpr, leftType), + expr, + rightExpr + ); + + // if not possible, tee left to a temp. local + } else { + let tempLocal = flow.getAndFreeTempLocal(leftType); + if (!flow.canOverflow(leftExpr, leftType)) flow.setLocalFlag(tempLocal.index, LocalFlags.WRAPPED); + if (flow.isNonnull(leftExpr, leftType)) flow.setLocalFlag(tempLocal.index, LocalFlags.NONNULL); + expr = module.if( + this.makeIsTrueish(module.local_tee(tempLocal.index, leftExpr), leftType), + module.local_get(tempLocal.index, leftType.toNativeType()), + rightExpr + ); + } } + this.currentType = leftType; break; } default: { assert(false); - expr = this.module.createUnreachable(); + expr = this.module.unreachable(); } } - return compound - ? this.compileAssignmentWithValue(left, expr, contextualType != Type.void) - : expr; + if (!compound) return expr; + var resolver = this.resolver; + var target = this.resolver.resolveExpression(left, this.currentFlow); + if (!target) return module.unreachable(); + return this.makeAssignment( + target, + expr, // TODO: delay release above if possible? + left, + resolver.currentThisExpression, + resolver.currentElementExpression, + contextualType != Type.void + ); } compileUnaryOverload( @@ -4590,20 +5079,9 @@ export class Compiler extends DiagnosticEmitter { valueExpr: ExpressionRef, reportNode: Node ): ExpressionRef { - var argumentExpressions: Expression[]; - var thisArg: ExpressionRef = 0; - if (operatorInstance.is(CommonFlags.INSTANCE)) { - thisArg = valueExpr; // can reuse the previously evaluated expr as the this value here - argumentExpressions = []; - } else { - argumentExpressions = [ value ]; // annotated type might differ -> recompile - } - return this.compileCallDirect( - operatorInstance, - argumentExpressions, - reportNode, - thisArg - ); + // FIXME: see comment in compileBinaryOverload below why recompiling on type mismatch + // is a bad idea currently. so this assumes that the type matches. + return this.makeCallDirect(operatorInstance, [ valueExpr ], reportNode, false); } compileBinaryOverload( @@ -4613,22 +5091,23 @@ export class Compiler extends DiagnosticEmitter { right: Expression, reportNode: Node ): ExpressionRef { - var argumentExpressions: Expression[]; - var thisArg: ExpressionRef = 0; + var rightType: Type; if (operatorInstance.is(CommonFlags.INSTANCE)) { let classInstance = assert(operatorInstance.parent); assert(classInstance.kind == ElementKind.CLASS); - thisArg = leftExpr; // can reuse the previously evaluated leftExpr as the this value here - argumentExpressions = [ right ]; + rightType = operatorInstance.signature.parameterTypes[0]; } else { - argumentExpressions = [ left, right ]; // annotated type of LHS might differ -> recompile - } - var ret = this.compileCallDirect( - operatorInstance, - argumentExpressions, - reportNode, - thisArg - ); - return ret; + // FIXME: if LHS type differs we can't recompile left because that'd completely confuse + // local states, like having retained locals that actually do not even exist, possibly + // releasing something random in that local before and evil things like that. Hence this + // assumes that LHS type matches, which in turn means that static overloads must be + // guaranteed to never mismatch LHS type, which in turn means that we can't have shiny + // things like multiple static overloads for different combinations of LHS/RHS types. + // We might want that at some point of course, but requires to complete the resolver so + // it can actually resolve every kind of expression without ever having to recompile. + rightType = operatorInstance.signature.parameterTypes[1]; + } + var rightExpr = this.compileExpression(right, rightType, ContextualFlags.IMPLICIT); + return this.makeCallDirect(operatorInstance, [ leftExpr, rightExpr ], reportNode); } compileAssignment(expression: Expression, valueExpression: Expression, contextualType: Type): ExpressionRef { @@ -4636,23 +5115,26 @@ export class Compiler extends DiagnosticEmitter { var resolver = program.resolver; var flow = this.currentFlow; var target = resolver.resolveExpression(expression, flow); // reports - if (!target) return this.module.createUnreachable(); + if (!target) return this.module.unreachable(); + var thisExpression = resolver.currentThisExpression; + var elementExpression = resolver.currentElementExpression; // to compile just the value, we need to know the target's type var targetType: Type; switch (target.kind) { case ElementKind.GLOBAL: { - if (!this.compileGlobal(target)) { // reports; not yet compiled if a static field compiled as a global - return this.module.createUnreachable(); - } - assert((target).type != Type.void); // compileGlobal must guarantee this + // not yet compiled if a static field compiled as a global + if (!this.compileGlobal(target)) return this.module.unreachable(); // reports // fall-through } - case ElementKind.LOCAL: case ElementKind.FIELD: { targetType = (target).type; break; } + case ElementKind.LOCAL: { + targetType = (target).type; + break; + } case ElementKind.PROPERTY_PROTOTYPE: { // static property let setterPrototype = (target).setterPrototype; if (!setterPrototype) { @@ -4660,10 +5142,10 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, expression.range, (target).internalName ); - return this.module.createUnreachable(); + return this.module.unreachable(); } let setterInstance = this.resolver.resolveFunction(setterPrototype, null, makeMap(), ReportMode.REPORT); - if (!setterInstance) return this.module.createUnreachable(); + if (!setterInstance) return this.module.unreachable(); assert(setterInstance.signature.parameterTypes.length == 1); // parser must guarantee this targetType = setterInstance.signature.parameterTypes[0]; break; @@ -4675,15 +5157,28 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, expression.range, (target).internalName ); - return this.module.createUnreachable(); + return this.module.unreachable(); } assert(setterInstance.signature.parameterTypes.length == 1); // parser must guarantee this targetType = setterInstance.signature.parameterTypes[0]; break; } case ElementKind.CLASS: { - if (resolver.currentElementExpression) { // indexed access + if (elementExpression) { // indexed access let isUnchecked = flow.is(FlowFlags.UNCHECKED_CONTEXT); + // if (isUnchecked) { + // let arrayType = this.program.determineBuiltinArrayType(target); + // if (arrayType) { + // return compileBuiltinArraySet( + // this, + // target, + // assert(this.resolver.currentThisExpression), + // elementExpression, + // valueExpression, + // contextualType + // ); + // } + // } let indexedSet = (target).lookupOverload(OperatorKind.INDEXED_SET, isUnchecked); if (!indexedSet) { let indexedGet = (target).lookupOverload(OperatorKind.INDEXED_GET, isUnchecked); @@ -4698,10 +5193,10 @@ export class Compiler extends DiagnosticEmitter { expression.range, (target).internalName ); } - return this.module.createUnreachable(); + return this.module.unreachable(); } assert(indexedSet.signature.parameterTypes.length == 2); // parser must guarantee this - targetType = indexedSet.signature.parameterTypes[1]; // 2nd parameter is the element + targetType = indexedSet.signature.parameterTypes[1]; // 2nd parameter is the element break; } // fall-through @@ -4711,73 +5206,67 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Operation_not_supported, expression.range ); - return this.module.createUnreachable(); + return this.module.unreachable(); } } // compile the value and do the assignment assert(targetType != Type.void); - var valueExpr = this.compileExpression(valueExpression, targetType, ConversionKind.IMPLICIT, WrapMode.NONE); - return this.compileAssignmentWithValue( + return this.makeAssignment( + target, + this.compileExpression(valueExpression, targetType, ContextualFlags.IMPLICIT | ContextualFlags.SKIP_AUTORELEASE), expression, - valueExpr, + thisExpression, + elementExpression, contextualType != Type.void ); } - compileAssignmentWithValue( - expression: Expression, - valueWithCorrectType: ExpressionRef, - tee: bool = false + /** Makes an assignment expression or block, assigning a value to a target. */ + makeAssignment( + /** Target element, e.g. a Local. */ + target: Element, + /** Value expression that has been compiled in a previous step already. */ + valueExpr: ExpressionRef, + /** Expression reference. Has already been compiled to `valueExpr`. */ + valueExpression: Expression, + /** `this` expression reference if a field or property set. */ + thisExpression: Expression | null, + /** Index expression reference if an indexed set. */ + indexExpression: Expression | null, + /** Whether to tee the value. */ + tee: bool ): ExpressionRef { var module = this.module; var flow = this.currentFlow; - var target = this.resolver.resolveExpression(expression, flow); // reports - if (!target) return module.createUnreachable(); + + // NOTE: Only locals, globals and fields can make use of skipped autoreleases while + // everything else must insert the skipped autorelease now. See (*) switch (target.kind) { case ElementKind.LOCAL: { - let type = (target).type; - assert(type != Type.void); - this.currentType = tee ? type : Type.void; - if ((target).is(CommonFlags.CONST)) { + if (flow.isLocalFlag((target).index, LocalFlags.CONSTANT, true)) { this.error( DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, - expression.range, target.internalName + valueExpression.range, target.internalName ); - return module.createUnreachable(); - } - if (type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) { - flow.setLocalWrapped((target).index, !flow.canOverflow(valueWithCorrectType, type)); + this.currentType = tee ? (target).type : Type.void; + return module.unreachable(); } - return tee - ? module.createTeeLocal((target).index, valueWithCorrectType) - : module.createSetLocal((target).index, valueWithCorrectType); + return this.makeLocalAssignment(target, valueExpr, tee); } case ElementKind.GLOBAL: { - if (!this.compileGlobal(target)) return module.createUnreachable(); - let type = (target).type; - assert(type != Type.void); - this.currentType = tee ? type : Type.void; - if ((target).is(CommonFlags.CONST)) { + if (!this.compileGlobal(target)) return module.unreachable(); + if (target.isAny(CommonFlags.CONST | CommonFlags.READONLY)) { this.error( DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, - expression.range, + valueExpression.range, target.internalName ); - return module.createUnreachable(); - } - valueWithCorrectType = this.ensureSmallIntegerWrap(valueWithCorrectType, type); // guaranteed - if (tee) { - let nativeType = type.toNativeType(); - let internalName = target.internalName; - return module.createBlock(null, [ // emulated teeGlobal - module.createSetGlobal(internalName, valueWithCorrectType), - module.createGetGlobal(internalName, nativeType) - ], nativeType); - } else { - return module.createSetGlobal(target.internalName, valueWithCorrectType); + this.currentType = tee ? (target).type : Type.void; + return module.unreachable(); } + return this.makeGlobalAssignment(target, valueExpr, tee); } case ElementKind.FIELD: { let initializerNode = (target).initializerNode; @@ -4790,173 +5279,132 @@ export class Compiler extends DiagnosticEmitter { ) { this.error( DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, - expression.range, (target).internalName + valueExpression.range, (target).internalName ); - return module.createUnreachable(); + return module.unreachable(); } - let thisExpression = assert(this.resolver.currentThisExpression); - let thisExpr = this.compileExpressionRetainType( - thisExpression, - this.options.usizeType, - WrapMode.NONE + return this.makeFieldAssignment(target, + valueExpr, + this.compileExpressionRetainType( + assert(thisExpression), + // FIXME: explicit type (currently fails due to missing null checking) + this.options.usizeType + ), + tee ); - let type = (target).type; - this.currentType = tee ? type : Type.void; - let nativeType = type.toNativeType(); - if (type.kind == TypeKind.BOOL) { - // make sure bools are wrapped (usually are) when storing as 8 bits - valueWithCorrectType = this.ensureSmallIntegerWrap(valueWithCorrectType, type); - } - if (tee) { - let flow = this.currentFlow; - let tempLocal = flow.getAndFreeTempLocal( - type, - !flow.canOverflow(valueWithCorrectType, type) - ); - let tempLocalIndex = tempLocal.index; - // TODO: simplify if valueWithCorrectType has no side effects - // TODO: call __gc_link here if a GC is present - return module.createBlock(null, [ - module.createSetLocal(tempLocalIndex, valueWithCorrectType), - module.createStore( - type.byteSize, - thisExpr, - module.createGetLocal(tempLocalIndex, nativeType), - nativeType, - (target).memoryOffset - ), - module.createGetLocal(tempLocalIndex, nativeType) - ], nativeType); - } else { - // TODO: call __gc_link here if a GC is present - return module.createStore( - type.byteSize, - thisExpr, - valueWithCorrectType, - nativeType, - (target).memoryOffset - ); - } } case ElementKind.PROPERTY_PROTOTYPE: { // static property + if (this.skippedAutoreleases.has(valueExpr)) valueExpr = this.makeAutorelease(valueExpr, flow); // (*) let setterPrototype = (target).setterPrototype; if (!setterPrototype) { this.error( DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, - expression.range, target.internalName + valueExpression.range, target.internalName ); - return module.createUnreachable(); + return module.unreachable(); } let setterInstance = this.resolver.resolveFunction(setterPrototype, null, makeMap(), ReportMode.REPORT); - if (!setterInstance) return module.createUnreachable(); + if (!setterInstance) return module.unreachable(); // call just the setter if the return value isn't of interest - if (!tee) return this.makeCallDirect(setterInstance, [ valueWithCorrectType ]); + if (!tee) return this.makeCallDirect(setterInstance, [ valueExpr ], valueExpression); // otherwise call the setter first, then the getter let getterPrototype = assert((target).getterPrototype); // must be present let getterInstance = this.resolver.resolveFunction(getterPrototype, null, makeMap(), ReportMode.REPORT); - if (!getterInstance) return module.createUnreachable(); + if (!getterInstance) return module.unreachable(); let returnType = getterInstance.signature.returnType; let nativeReturnType = returnType.toNativeType(); - return module.createBlock(null, [ - this.makeCallDirect(setterInstance, [ valueWithCorrectType ]), - this.makeCallDirect(getterInstance) // sets currentType + return module.block(null, [ + this.makeCallDirect(setterInstance, [ valueExpr ], valueExpression), + this.makeCallDirect(getterInstance, null, valueExpression) // sets currentType ], nativeReturnType); } case ElementKind.PROPERTY: { // instance property + if (this.skippedAutoreleases.has(valueExpr)) valueExpr = this.makeAutorelease(valueExpr, flow); // (*) let setterInstance = (target).setterInstance; if (!setterInstance) { this.error( DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, - expression.range, target.internalName + valueExpression.range, target.internalName ); - return module.createUnreachable(); + return module.unreachable(); } // call just the setter if the return value isn't of interest if (!tee) { let thisExpr = this.compileExpressionRetainType( - assert(this.resolver.currentThisExpression), - this.options.usizeType, - WrapMode.NONE + assert(thisExpression), + this.options.usizeType ); - return this.makeCallDirect(setterInstance, [ thisExpr, valueWithCorrectType ]); + return this.makeCallDirect(setterInstance, [ thisExpr, valueExpr ], valueExpression); } // otherwise call the setter first, then the getter let getterInstance = assert((target).getterInstance); // must be present let returnType = getterInstance.signature.returnType; let nativeReturnType = returnType.toNativeType(); let thisExpr = this.compileExpressionRetainType( - assert(this.resolver.currentThisExpression), - this.options.usizeType, - WrapMode.NONE + assert(thisExpression), + this.options.usizeType ); - let tempLocal = flow.getAndFreeTempLocal(returnType, false); + let tempLocal = flow.getAndFreeTempLocal(returnType); let tempLocalIndex = tempLocal.index; - return module.createBlock(null, [ + return module.block(null, [ this.makeCallDirect(setterInstance, [ // set and remember the target - module.createTeeLocal(tempLocalIndex, thisExpr), - valueWithCorrectType - ]), + module.local_tee(tempLocalIndex, thisExpr), + valueExpr + ], valueExpression), this.makeCallDirect(getterInstance, [ // get from remembered target - module.createGetLocal(tempLocalIndex, nativeReturnType) - ]) + module.local_get(tempLocalIndex, nativeReturnType) + ], valueExpression) ], nativeReturnType); } case ElementKind.CLASS: { - let elementExpression = this.resolver.currentElementExpression; - if (elementExpression) { + if (this.skippedAutoreleases.has(valueExpr)) valueExpr = this.makeAutorelease(valueExpr, flow); // (*) + if (indexExpression) { let isUnchecked = flow.is(FlowFlags.UNCHECKED_CONTEXT); let indexedGet = (target).lookupOverload(OperatorKind.INDEXED_GET, isUnchecked); if (!indexedGet) { this.error( DiagnosticCode.Index_signature_is_missing_in_type_0, - expression.range, target.internalName + valueExpression.range, target.internalName ); - return module.createUnreachable(); + return module.unreachable(); } let indexedSet = (target).lookupOverload(OperatorKind.INDEXED_SET, isUnchecked); if (!indexedSet) { this.error( DiagnosticCode.Index_signature_in_type_0_only_permits_reading, - expression.range, target.internalName + valueExpression.range, target.internalName ); this.currentType = tee ? indexedGet.signature.returnType : Type.void; - return module.createUnreachable(); + return module.unreachable(); } let targetType = (target).type; - let thisExpression = assert(this.resolver.currentThisExpression); let thisExpr = this.compileExpressionRetainType( - thisExpression, - this.options.usizeType, - WrapMode.NONE - ); - let elementExpr = this.compileExpression( - elementExpression, - Type.i32, - ConversionKind.IMPLICIT, - WrapMode.NONE + assert(thisExpression), + this.options.usizeType ); + let elementExpr = this.compileExpression(indexExpression, Type.i32, ContextualFlags.IMPLICIT); if (tee) { - let tempLocalTarget = flow.getTempLocal(targetType, false); - let tempLocalElement = flow.getAndFreeTempLocal(this.currentType, false); + let tempLocalTarget = flow.getTempLocal(targetType); + let tempLocalElement = flow.getAndFreeTempLocal(this.currentType); let returnType = indexedGet.signature.returnType; flow.freeTempLocal(tempLocalTarget); - return module.createBlock(null, [ + return module.block(null, [ this.makeCallDirect(indexedSet, [ - module.createTeeLocal(tempLocalTarget.index, thisExpr), - module.createTeeLocal(tempLocalElement.index, elementExpr), - valueWithCorrectType - ]), + module.local_tee(tempLocalTarget.index, thisExpr), + module.local_tee(tempLocalElement.index, elementExpr), + valueExpr + ], valueExpression), this.makeCallDirect(indexedGet, [ - module.createGetLocal(tempLocalTarget.index, tempLocalTarget.type.toNativeType()), - module.createGetLocal(tempLocalElement.index, tempLocalElement.type.toNativeType()) - ]) + module.local_get(tempLocalTarget.index, tempLocalTarget.type.toNativeType()), + module.local_get(tempLocalElement.index, tempLocalElement.type.toNativeType()) + ], valueExpression) ], returnType.toNativeType()); } else { return this.makeCallDirect(indexedSet, [ thisExpr, elementExpr, - valueWithCorrectType - ]); + valueExpr + ], valueExpression); } } // fall-through @@ -4964,72 +5412,355 @@ export class Compiler extends DiagnosticEmitter { } this.error( DiagnosticCode.Operation_not_supported, - expression.range + valueExpression.range ); - return module.createUnreachable(); + return module.unreachable(); } - compileCallExpression(expression: CallExpression, contextualType: Type): ExpressionRef { - var module = this.module; + /** Makes an assignment to a local, possibly retaining and releasing affected references and keeping track of wrap and null states. */ + private makeLocalAssignment( + /** The local to assign to. */ + local: Local, + /** The value to assign. */ + valueExpr: ExpressionRef, + /** Whether to tee the value. */ + tee: bool + ): ExpressionRef { + var type = local.type; + assert(type != Type.void); var flow = this.currentFlow; + var localIndex = local.index; - // handle call to super - if (expression.expression.kind == NodeKind.SUPER) { - let flow = this.currentFlow; - let actualFunction = flow.actualFunction; - if (!actualFunction.is(CommonFlags.CONSTRUCTOR)) { - this.error( - DiagnosticCode.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors, - expression.range - ); - return module.createUnreachable(); - } - - let classInstance = assert(actualFunction.parent); assert(classInstance.kind == ElementKind.CLASS); - let baseClassInstance = assert((classInstance).base); - let thisLocal = assert(flow.lookupLocal(CommonSymbols.this_)); - let nativeSizeType = this.options.nativeSizeType; + if (type.is(TypeFlags.NULLABLE)) { + if (flow.isNonnull(valueExpr, type)) flow.setLocalFlag(localIndex, LocalFlags.NONNULL); + else flow.unsetLocalFlag(localIndex, LocalFlags.NONNULL); + } + flow.setLocalFlag(localIndex, LocalFlags.WRITTENTO); - // { - // this = super(this || , ...args) - // this.a = X - // this.b = Y - // } - let stmts: ExpressionRef[] = [ - module.createSetLocal(thisLocal.index, - this.compileCallDirect( - this.ensureConstructor(baseClassInstance, expression), - expression.arguments, - expression, - module.createIf( - module.createGetLocal(thisLocal.index, nativeSizeType), - module.createGetLocal(thisLocal.index, nativeSizeType), - this.makeAllocation(classInstance) - ) - ) - ) - ]; - this.makeFieldInitialization(classInstance, stmts); + if (type.isManaged) { + let module = this.module; + let nativeType = type.toNativeType(); - // check that super had been called before accessing allocating `this` - if (flow.isAny( - FlowFlags.ALLOCATES | - FlowFlags.CONDITIONALLY_ALLOCATES - )) { - this.error( + if (flow.isAnyLocalFlag(localIndex, LocalFlags.ANY_RETAINED)) { + if (this.skippedAutoreleases.has(valueExpr)) { + valueExpr = this.makeSkippedRelease( + module.local_get(localIndex, nativeType), // oldRef + valueExpr // newRef + ); + if (tee) { // TEE(local = __skippedRelease(local, value)) + this.currentType = type; + return module.local_tee(localIndex, valueExpr); + } else { // local = __skippedRelease(local, value) + this.currentType = Type.void; + return module.local_set(localIndex, valueExpr); + } + } else { + valueExpr = this.makeRetainRelease( + module.local_get(localIndex, nativeType), // oldRef + valueExpr // newRef + ); + if (tee) { // TEE(local = __retainRelease(local, value)) + this.currentType = type; + return module.local_tee(localIndex, valueExpr); + } else { // local = __retainRelease(local, value) + this.currentType = Type.void; + return module.local_set(localIndex, valueExpr); + } + } + } else { + flow.unsetLocalFlag(localIndex, LocalFlags.CONDITIONALLY_RETAINED); + flow.setLocalFlag(localIndex, LocalFlags.RETAINED); + if (!this.skippedAutoreleases.has(valueExpr)) valueExpr = this.makeRetain(valueExpr); + if (tee) { // TEE(local = __retain(value, local)) + this.currentType = type; + return module.local_tee(localIndex, valueExpr); + } else { // local = __retain(value, local) + this.currentType = Type.void; + return module.local_set(localIndex, valueExpr); + } + } + } else { + if (type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) { + if (!flow.canOverflow(valueExpr, type)) flow.setLocalFlag(localIndex, LocalFlags.WRAPPED); + else flow.unsetLocalFlag(localIndex, LocalFlags.WRAPPED); + } + if (tee) { // TEE(local = value) + this.currentType = type; + return this.module.local_tee(localIndex, valueExpr); + } else { // local = value + this.currentType = Type.void; + return this.module.local_set(localIndex, valueExpr); + } + } + } + + /** Makes an assignment to a global, possibly retaining and releasing affected references. */ + private makeGlobalAssignment( + /** The global to assign to. */ + global: Global, + /** The value to assign. */ + valueExpr: ExpressionRef, + /** Whether to tee the value. */ + tee: bool + ): ExpressionRef { + var module = this.module; + var type = global.type; + assert(type != Type.void); + var nativeType = type.toNativeType(); + + if (type.isManaged) { + if (this.skippedAutoreleases.has(valueExpr)) { + if (tee) { // (global = __skippedRelease(global, value)), global + this.currentType = type; + return module.block(null, [ + module.global_set(global.internalName, + this.makeSkippedRelease( + module.global_get(global.internalName, nativeType), // oldRef + valueExpr // newRef + ) + ), + module.global_get(global.internalName, nativeType) + ], nativeType); + } else { // global = __skippedRelease(global, value) + this.currentType = Type.void; + return module.global_set(global.internalName, + this.makeSkippedRelease( + module.global_get(global.internalName, nativeType), // oldRef + valueExpr // newRef + ) + ); + } + } else { + if (tee) { // (global = __retainRelease(global, value)), global + this.currentType = type; + return module.block(null, [ + module.global_set(global.internalName, + this.makeRetainRelease( + module.global_get(global.internalName, nativeType), // oldRef + valueExpr // newRef + ) + ), + module.global_get(global.internalName, nativeType) + ], nativeType); + } else { // global = __retainRelease(global, value) + this.currentType = Type.void; + return module.global_set(global.internalName, + this.makeRetainRelease( + module.global_get(global.internalName, nativeType), // oldRef + valueExpr // newRef + ) + ); + } + } + } else { + valueExpr = this.ensureSmallIntegerWrap(valueExpr, type); // globals must be wrapped + if (tee) { // (global = value), global + this.currentType = type; + return module.block(null, [ + module.global_set(global.internalName, valueExpr), + module.global_get(global.internalName, nativeType) + ], nativeType); + } else { // global = value + this.currentType = Type.void; + return module.global_set(global.internalName, + valueExpr + ); + } + } + } + + /** Makes an assignment to a field, possibly retaining and releasing affected references. */ + makeFieldAssignment( + /** The field to assign to. */ + field: Field, + /** The value to assign. */ + valueExpr: ExpressionRef, + /** The value of `this`. */ + thisExpr: ExpressionRef, + /** Whether to tee the value. */ + tee: bool + ): ExpressionRef { + var module = this.module; + var flow = this.currentFlow; + var fieldType = field.type; + var nativeFieldType = fieldType.toNativeType(); + assert(field.parent.kind == ElementKind.CLASS); + var thisType = (field.parent).type; + var nativeThisType = thisType.toNativeType(); + + if (fieldType.isManaged && thisType.isManaged) { + let tempThis = flow.getTempLocal(thisType); + if (this.skippedAutoreleases.has(valueExpr)) { + if (tee) { // ((t1 = this).field = __skippedRelease(t1.field, t2 = value)), t2 + let tempValue = flow.getAndFreeTempLocal(fieldType); + if (!flow.canOverflow(valueExpr, fieldType)) flow.setLocalFlag(tempValue.index, LocalFlags.WRAPPED); + if (flow.isNonnull(valueExpr, fieldType)) flow.setLocalFlag(tempValue.index, LocalFlags.NONNULL); + flow.freeTempLocal(tempThis); + this.currentType = fieldType; + return module.block(null, [ + module.store(fieldType.byteSize, + module.local_tee(tempThis.index, thisExpr), + this.makeSkippedRelease( + module.load(fieldType.byteSize, fieldType.is(TypeFlags.SIGNED), // oldRef + module.local_get(tempThis.index, nativeThisType), + nativeFieldType, field.memoryOffset + ), + module.local_tee(tempValue.index, valueExpr), // newRef + ), + nativeFieldType, field.memoryOffset + ), + module.local_get(tempValue.index, nativeFieldType) + ], nativeFieldType); + } else { // (t1 = this).field = __skippedRelease(t1.field, value) + flow.freeTempLocal(tempThis); + this.currentType = Type.void; + return module.store(fieldType.byteSize, + module.local_tee(tempThis.index, thisExpr), + this.makeSkippedRelease( + module.load(fieldType.byteSize, fieldType.is(TypeFlags.SIGNED), // oldRef + module.local_get(tempThis.index, nativeThisType), + nativeFieldType, field.memoryOffset + ), + valueExpr, // newRef + ), + nativeFieldType, field.memoryOffset + ); + } + } else { + if (tee) { // ((t1 = this).field = __retainRelease(t1.field, t2 = value)), t2 + let tempValue = flow.getAndFreeTempLocal(fieldType); + if (!flow.canOverflow(valueExpr, fieldType)) flow.setLocalFlag(tempValue.index, LocalFlags.WRAPPED); + if (flow.isNonnull(valueExpr, fieldType)) flow.setLocalFlag(tempValue.index, LocalFlags.NONNULL); + flow.freeTempLocal(tempThis); + this.currentType = fieldType; + return module.block(null, [ + module.store(fieldType.byteSize, + module.local_tee(tempThis.index, thisExpr), + this.makeRetainRelease( + module.load(fieldType.byteSize, fieldType.is(TypeFlags.SIGNED), // oldRef + module.local_get(tempThis.index, nativeThisType), + nativeFieldType, field.memoryOffset + ), + module.local_tee(tempValue.index, valueExpr) // newRef + ), + nativeFieldType, field.memoryOffset + ), + module.local_get(tempValue.index, nativeFieldType) + ], nativeFieldType); + } else { // (t1 = this).field = __retainRelease(t1.field, value) + flow.freeTempLocal(tempThis); + this.currentType = Type.void; + return module.store(fieldType.byteSize, + module.local_tee(tempThis.index, thisExpr), + this.makeRetainRelease( + module.load(fieldType.byteSize, fieldType.is(TypeFlags.SIGNED), // oldRef + module.local_get(tempThis.index, nativeThisType), + nativeFieldType, field.memoryOffset + ), + valueExpr // newRef + ), + nativeFieldType, field.memoryOffset + ); + } + } + } else { + if (tee) { // (this.field = (t1 = value)), t1 + let tempValue = flow.getAndFreeTempLocal(fieldType); + if (!flow.canOverflow(valueExpr, fieldType)) flow.setLocalFlag(tempValue.index, LocalFlags.WRAPPED); + if (flow.isNonnull(valueExpr, fieldType)) flow.setLocalFlag(tempValue.index, LocalFlags.NONNULL); + this.currentType = fieldType; + return module.block(null, [ + module.store(fieldType.byteSize, + thisExpr, + module.local_tee(tempValue.index, valueExpr), + nativeFieldType, field.memoryOffset + ), + module.local_get(tempValue.index, nativeFieldType) + ], nativeFieldType); + } else { // this.field = value + this.currentType = Type.void; + return module.store(fieldType.byteSize, + thisExpr, + valueExpr, + nativeFieldType, field.memoryOffset + ); + } + } + } + + /** Compiles a call expression according to the specified context. */ + compileCallExpression( + /** Call expression to compile. */ + expression: CallExpression, + /** Contextual type indicating the return type the caller expects, if any. */ + contextualType: Type, + /** Contextual flags indicating contextual conditions. */ + contextualFlags: ContextualFlags + ): ExpressionRef { + + var module = this.module; + var flow = this.currentFlow; + + // handle call to super + if (expression.expression.kind == NodeKind.SUPER) { + let flow = this.currentFlow; + let actualFunction = flow.actualFunction; + if (!actualFunction.is(CommonFlags.CONSTRUCTOR)) { + this.error( + DiagnosticCode.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors, + expression.range + ); + return module.unreachable(); + } + + let classInstance = assert(actualFunction.parent); assert(classInstance.kind == ElementKind.CLASS); + let baseClassInstance = assert((classInstance).base); + let thisLocal = assert(flow.lookupLocal(CommonSymbols.this_)); + let nativeSizeType = this.options.nativeSizeType; + + // { + // this = super(this || , ...args) + // this.a = X + // this.b = Y + // } + let theCall = this.compileCallDirect( + this.ensureConstructor(baseClassInstance, expression), + expression.arguments, + expression, + module.if( + module.local_get(thisLocal.index, nativeSizeType), + module.local_get(thisLocal.index, nativeSizeType), + this.makeRetain( + this.makeAllocation(classInstance) + ) + ), + ContextualFlags.SKIP_AUTORELEASE + ); + assert(this.skippedAutoreleases.has(theCall)); // guaranteed + let stmts: ExpressionRef[] = [ + module.local_set(thisLocal.index, theCall) + ]; + this.makeFieldInitialization(classInstance, stmts); + + // check that super had been called before accessing `this` + if (flow.isAny( + FlowFlags.ALLOCATES | + FlowFlags.CONDITIONALLY_ALLOCATES + )) { + this.error( DiagnosticCode._super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class, expression.range ); - return module.createUnreachable(); + return module.unreachable(); } flow.set(FlowFlags.ALLOCATES | FlowFlags.CALLS_SUPER); this.currentType = Type.void; - return module.createBlock(null, stmts); + return module.block(null, stmts); } // otherwise resolve normally var target = this.resolver.resolveExpression(expression.expression, flow); // reports - if (!target) return module.createUnreachable(); + if (!target) return module.unreachable(); var signature: Signature | null; var indexArg: ExpressionRef; @@ -5054,7 +5785,7 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Type_0_is_not_generic, expression.expression.range, prototype.internalName ); - return module.createUnreachable(); + return module.unreachable(); } instance = this.resolver.resolveFunctionInclTypeArguments( prototype, @@ -5091,12 +5822,12 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Expected_0_arguments_but_got_1, expression.range, numParameters.toString(10), numArguments.toString(10) ); - return module.createUnreachable(); + return module.unreachable(); } if (templateName !== null && inferredTypes.has(templateName)) { let inferredType = inferredTypes.get(templateName); if (inferredType) { - argumentExprs[i] = this.compileExpressionRetainType(argumentExpression, inferredType, WrapMode.NONE); + argumentExprs[i] = this.compileExpressionRetainType(argumentExpression, inferredType); let commonType: Type | null; if (!(commonType = Type.commonDenominator(inferredType, this.currentType, true))) { if (!(commonType = Type.commonDenominator(inferredType, this.currentType, false))) { @@ -5104,12 +5835,12 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Type_0_is_not_assignable_to_type_1, parameterNodes[i].type.range, this.currentType.toString(), inferredType.toString() ); - return module.createUnreachable(); + return module.unreachable(); } } inferredType = commonType; } else { - argumentExprs[i] = this.compileExpressionRetainType(argumentExpression, Type.i32, WrapMode.NONE); + argumentExprs[i] = this.compileExpressionRetainType(argumentExpression, Type.i32); inferredType = this.currentType; // ++numInferred; } @@ -5120,13 +5851,8 @@ export class Compiler extends DiagnosticEmitter { flow.actualFunction, flow.contextualTypeArguments ); - if (!concreteType) return module.createUnreachable(); - argumentExprs[i] = this.compileExpression( - argumentExpression, - concreteType, - ConversionKind.IMPLICIT, - WrapMode.NONE - ); + if (!concreteType) return module.unreachable(); + argumentExprs[i] = this.compileExpression(argumentExpression, concreteType, ContextualFlags.IMPLICIT); } } let resolvedTypeArguments = new Array(numTypeParameters); @@ -5139,8 +5865,8 @@ export class Compiler extends DiagnosticEmitter { resolvedTypeArguments, makeMap(flow.contextualTypeArguments) ); - if (!instance) return this.module.createUnreachable(); - return this.makeCallDirect(instance, argumentExprs); + if (!instance) return this.module.unreachable(); + return this.makeCallDirect(instance, argumentExprs, expression, contextualType == Type.void); // TODO: this skips inlining because inlining requires compiling its temporary locals in // the scope of the inlined flow. might need another mechanism to lock temp. locals early, // so inlining can be performed in `makeCallDirect` instead? @@ -5149,15 +5875,14 @@ export class Compiler extends DiagnosticEmitter { } else { instance = this.resolver.resolveFunction(prototype, null); } - if (!instance) return this.module.createUnreachable(); + if (!instance) return this.module.unreachable(); // compile 'this' expression if an instance method let thisExpr: ExpressionRef = 0; if (instance.is(CommonFlags.INSTANCE)) { thisExpr = this.compileExpressionRetainType( assert(this.resolver.currentThisExpression), - this.options.usizeType, - WrapMode.NONE + this.options.usizeType ); } @@ -5165,7 +5890,8 @@ export class Compiler extends DiagnosticEmitter { instance, expression.arguments, expression, - thisExpr + thisExpr, + contextualFlags ); } @@ -5173,9 +5899,9 @@ export class Compiler extends DiagnosticEmitter { case ElementKind.LOCAL: { if (signature = (target).type.signatureReference) { if ((target).is(CommonFlags.INLINED)) { - indexArg = module.createI32(i64_low((target).constantIntegerValue)); + indexArg = module.i32(i64_low((target).constantIntegerValue)); } else { - indexArg = module.createGetLocal((target).index, NativeType.I32); + indexArg = module.local_get((target).index, NativeType.I32); } break; } else { @@ -5183,19 +5909,19 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures, expression.range, (target).type.toString() ); - return module.createUnreachable(); + return module.unreachable(); } } case ElementKind.GLOBAL: { if (signature = (target).type.signatureReference) { - indexArg = module.createGetGlobal((target).internalName, (target).type.toNativeType()); + indexArg = module.global_get((target).internalName, (target).type.toNativeType()); break; } else { this.error( DiagnosticCode.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures, expression.range, (target).type.toString() ); - return module.createUnreachable(); + return module.unreachable(); } } case ElementKind.FIELD: { @@ -5204,10 +5930,9 @@ export class Compiler extends DiagnosticEmitter { let thisExpression = assert(this.resolver.currentThisExpression); let thisExpr = this.compileExpressionRetainType( thisExpression, - this.options.usizeType, - WrapMode.NONE + this.options.usizeType ); - indexArg = module.createLoad( + indexArg = module.load( 4, false, thisExpr, @@ -5220,24 +5945,19 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures, expression.range, type.toString() ); - return module.createUnreachable(); + return module.unreachable(); } } case ElementKind.FUNCTION_TARGET: { signature = (target).signature; - indexArg = this.compileExpression( - expression.expression, - (target).type, - ConversionKind.IMPLICIT, - WrapMode.NONE - ); + indexArg = this.compileExpression(expression.expression, (target).type, ContextualFlags.IMPLICIT); break; } case ElementKind.PROPERTY_PROTOTYPE: { // static property let getterPrototype = assert((target).getterPrototype); let getterInstance = this.resolver.resolveFunction(getterPrototype, null); - if (!getterInstance) return module.createUnreachable(); + if (!getterInstance) return module.unreachable(); indexArg = this.compileCallDirect(getterInstance, [], expression.expression); signature = this.currentType.signatureReference; if (!signature) { @@ -5245,7 +5965,7 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures, expression.range, this.currentType.toString() ); - return module.createUnreachable(); + return module.unreachable(); } break; } @@ -5254,8 +5974,7 @@ export class Compiler extends DiagnosticEmitter { indexArg = this.compileCallDirect(getterInstance, [], expression.expression, this.compileExpressionRetainType( assert(this.resolver.currentThisExpression), - this.options.usizeType, - WrapMode.NONE + this.options.usizeType ) ); signature = this.currentType.signatureReference; @@ -5264,7 +5983,7 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures, expression.range, this.currentType.toString() ); - return module.createUnreachable(); + return module.unreachable(); } break; } @@ -5275,14 +5994,16 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Operation_not_supported, expression.range ); - return module.createUnreachable(); + return module.unreachable(); } } return this.compileCallIndirect( signature, indexArg, expression.arguments, - expression + expression, + 0, + contextualType == Type.void ); } @@ -5327,7 +6048,7 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Operation_not_supported, expression.range ); - return this.module.createUnreachable(); + return this.module.unreachable(); } return expr; } @@ -5394,18 +6115,19 @@ export class Compiler extends DiagnosticEmitter { instance: Function, argumentExpressions: Expression[], reportNode: Node, - thisArg: ExpressionRef = 0 + thisArg: ExpressionRef = 0, + contextualFlags: ContextualFlags = ContextualFlags.NONE ): ExpressionRef { var numArguments = argumentExpressions.length; var signature = instance.signature; - if (!this.checkCallSignature( // reports signature, numArguments, thisArg != 0, reportNode )) { - return this.module.createUnreachable(); + this.currentType = signature.returnType; + return this.module.unreachable(); } // Inline if explicitly requested @@ -5418,7 +6140,24 @@ export class Compiler extends DiagnosticEmitter { ); } else { this.currentInlineFunctions.push(instance); - let expr = this.compileCallInlinePrechecked(instance, argumentExpressions, thisArg); + let parameterTypes = signature.parameterTypes; + assert(numArguments <= parameterTypes.length); + // compile argument expressions + let args = new Array(numArguments); + for (let i = 0; i < numArguments; ++i) { + args[i] = this.compileExpression(argumentExpressions[i], parameterTypes[i], + ContextualFlags.IMPLICIT | ContextualFlags.SKIP_AUTORELEASE + ); + } + // make the inlined call (is aware of autoreleases) + let expr = this.makeCallInline(instance, args, thisArg, (contextualFlags & ContextualFlags.WILL_DROP) != 0); + if (this.currentType.isManaged) { + if (!(contextualFlags & ContextualFlags.SKIP_AUTORELEASE)) { + expr = this.makeAutorelease(expr, this.currentFlow); + } else { + this.skippedAutoreleases.add(expr); + } + } this.currentInlineFunctions.pop(); return expr; } @@ -5434,98 +6173,133 @@ export class Compiler extends DiagnosticEmitter { } var parameterTypes = signature.parameterTypes; for (let i = 0; i < numArguments; ++i, ++index) { - operands[index] = this.compileExpression( - argumentExpressions[i], - parameterTypes[i], - ConversionKind.IMPLICIT, - WrapMode.NONE + operands[index] = this.compileExpression(argumentExpressions[i], parameterTypes[i], + ContextualFlags.IMPLICIT ); } assert(index == numArgumentsInclThis); - return this.makeCallDirect(instance, operands); + if (signature.returnType.isManaged) { + if (contextualFlags & ContextualFlags.WILL_DROP) { + // Skip autorelease and simply release + return this.makeCallDirect(instance, operands, reportNode, true); + } else if (contextualFlags & ContextualFlags.SKIP_AUTORELEASE) { + // Skip autorelease and remember + let expr = this.makeCallDirect(instance, operands, reportNode, false, true); + this.skippedAutoreleases.add(expr); + return expr; + } else { + return this.makeCallDirect(instance, operands, reportNode, false, false); + } + } + return this.makeCallDirect(instance, operands, reportNode, + (contextualFlags & ContextualFlags.WILL_DROP) != 0 + ); } - // Depends on being pre-checked in compileCallDirect - private compileCallInlinePrechecked( + makeCallInline( instance: Function, - argumentExpressions: Expression[], - thisArg: ExpressionRef = 0 + operands: ExpressionRef[] | null, + thisArg: ExpressionRef = 0, + immediatelyDropped: bool = false ): ExpressionRef { var module = this.module; + var numArguments = operands ? operands.length : 0; + var signature = instance.signature; + var parameterTypes = signature.parameterTypes; + var numParameters = parameterTypes.length; // Create a new inline flow and use it to compile the function as a block var previousFlow = this.currentFlow; var flow = Flow.createInline(previousFlow.parentFunction, instance); - - // Convert provided call arguments to temporary locals. It is important that these are compiled - // here, with their respective locals being blocked. There is no 'makeCallInline'. var body = []; - + var usedLocals = new Set(); + + // Prepare compiled arguments right to left, keeping track of used locals. + for (let i = numArguments - 1; i >= 0; --i) { + // This is necessary because a later expression must not set an earlier argument local, which + // is also just a temporary, when being executed. Take for example `t1=1, t2=(t1 = 2)`, where + // the right expression would reassign the foregoing argument local. So, we iterate from right + // to left, remembering what's used later, and don't use these for earlier arguments, making + // the example above essentially `t2=1, t1=(t1 = 2)`. + let paramExpr = operands![i]; + let paramType = parameterTypes[i]; + let argumentLocal = flow.addScopedLocal(signature.getParameterName(i), paramType, usedLocals); + findUsedLocals(paramExpr, usedLocals); + // inlining is aware of wrap/nonnull states: + if (!previousFlow.canOverflow(paramExpr, paramType)) flow.setLocalFlag(argumentLocal.index, LocalFlags.WRAPPED); + if (flow.isNonnull(paramExpr, paramType)) flow.setLocalFlag(argumentLocal.index, LocalFlags.NONNULL); + // inlining is aware of skipped autoreleases: + if (paramType.isManaged) { + if (!this.skippedAutoreleases.has(paramExpr)) paramExpr = this.makeRetain(paramExpr); + flow.setLocalFlag(argumentLocal.index, LocalFlags.RETAINED); + } + body.unshift( + module.local_set(argumentLocal.index, paramExpr) + ); + } if (thisArg) { let classInstance = assert(instance.parent); assert(classInstance.kind == ElementKind.CLASS); let thisType = assert(instance.signature.thisType); - let thisLocal = flow.addScopedLocal(CommonSymbols.this_, thisType, false); - body.push( - module.createSetLocal(thisLocal.index, thisArg) + let thisLocal = flow.addScopedLocal(CommonSymbols.this_, thisType, usedLocals); + // No need to retain `this` as it can't be reassigned and thus can't become prematurely released + body.unshift( + module.local_set(thisLocal.index, thisArg) ); let baseInstance = (classInstance).base; if (baseInstance) flow.addScopedAlias(CommonSymbols.super_, baseInstance.type, thisLocal.index); + } else { + assert(!instance.signature.thisType); } - var numArguments = argumentExpressions.length; - var signature = instance.signature; - var parameterTypes = signature.parameterTypes; - for (let i = 0; i < numArguments; ++i) { - let paramExpr = this.compileExpression( - argumentExpressions[i], - parameterTypes[i], - ConversionKind.IMPLICIT, - WrapMode.NONE - ); - let argumentLocal = flow.addScopedLocal( - signature.getParameterName(i), - parameterTypes[i], - !previousFlow.canOverflow(paramExpr, parameterTypes[i]) - ); - body.push( - module.createSetLocal(argumentLocal.index, paramExpr) - ); - } - - // Compile optional parameter initializers in the scope of the inlined flow + // Compile omitted arguments with final argument locals blocked. Doesn't need to take care of + // side-effects within earlier expressions because these already happened on set. this.currentFlow = flow; - var numParameters = signature.parameterTypes.length; for (let i = numArguments; i < numParameters; ++i) { + let initType = parameterTypes[i]; let initExpr = this.compileExpression( assert(instance.prototype.signatureNode.parameters[i].initializer), - parameterTypes[i], - ConversionKind.IMPLICIT, - WrapMode.WRAP - ); - let argumentLocal = flow.addScopedLocal( - signature.getParameterName(i), - parameterTypes[i], - !flow.canOverflow(initExpr, parameterTypes[i]) - ); - body.push( - module.createSetLocal(argumentLocal.index, initExpr) + initType, + ContextualFlags.IMPLICIT ); + let argumentLocal = flow.addScopedLocal(signature.getParameterName(i), initType); + if (!flow.canOverflow(initExpr, initType)) flow.setLocalFlag(argumentLocal.index, LocalFlags.WRAPPED); + if (flow.isNonnull(initExpr, initType)) flow.setLocalFlag(argumentLocal.index, LocalFlags.NONNULL); + if (initType.isManaged) { + flow.setLocalFlag(argumentLocal.index, LocalFlags.RETAINED); + body.push( + module.local_set(argumentLocal.index, + this.makeRetain(initExpr) + ) + ); + } else { + body.push( + module.local_set(argumentLocal.index, initExpr) + ); + } } // Compile the called function's body in the scope of the inlined flow - { - let stmts = this.compileFunctionBody(instance); - for (let i = 0, k = stmts.length; i < k; ++i) body.push(stmts[i]); - } + this.compileFunctionBody(instance, body); // Free any new scoped locals and reset to the original flow + if (!flow.isAny(FlowFlags.ANY_TERMINATING)) { + this.performAutoreleases(flow, body); + this.finishAutoreleases(flow, body); + } flow.freeScopedLocals(); var returnType = flow.returnType; this.currentFlow = previousFlow; - this.currentType = returnType; // Create an outer block that we can break to when returning a value out of order - return module.createBlock(flow.inlineReturnLabel, body, returnType.toNativeType()); + var expr = module.block(flow.inlineReturnLabel, body, returnType.toNativeType()); + this.currentType = returnType; + if (returnType.isManaged) { + if (immediatelyDropped) { + expr = this.makeRelease(expr); + this.currentType = Type.void; + } + } + return expr; } /** Gets the trampoline for the specified function. */ @@ -5544,8 +6318,8 @@ export class Compiler extends DiagnosticEmitter { var originalName = original.internalName; var originalParameterTypes = originalSignature.parameterTypes; var originalParameterDeclarations = original.prototype.signatureNode.parameters; - var commonReturnType = originalSignature.returnType; - var commonThisType = originalSignature.thisType; + var returnType = originalSignature.returnType; + var thisType = originalSignature.thisType; var isInstance = original.is(CommonFlags.INSTANCE); // arguments excl. `this`, operands incl. `this` @@ -5565,19 +6339,20 @@ export class Compiler extends DiagnosticEmitter { // forward `this` if applicable var module = this.module; if (isInstance) { - forwardedOperands[0] = module.createGetLocal(0, this.options.nativeSizeType); + forwardedOperands[0] = module.local_get(0, this.options.nativeSizeType); operandIndex = 1; } // forward required arguments for (let i = 0; i < minArguments; ++i, ++operandIndex) { - forwardedOperands[operandIndex] = module.createGetLocal(operandIndex, originalParameterTypes[i].toNativeType()); + forwardedOperands[operandIndex] = module.local_get(operandIndex, originalParameterTypes[i].toNativeType()); } assert(operandIndex == minOperands); // create the trampoline element - var trampolineSignature = new Signature(originalParameterTypes, commonReturnType, commonThisType); + var trampolineSignature = new Signature(originalParameterTypes, returnType, thisType); trampolineSignature.requiredParameters = maxArguments; + trampolineSignature.parameterNames = originalSignature.parameterNames; trampoline = new Function( original.name + "|trampoline", original.prototype, @@ -5590,7 +6365,8 @@ export class Compiler extends DiagnosticEmitter { // compile initializers of omitted arguments in scope of the trampoline function // this is necessary because initializers might need additional locals and a proper this context var previousFlow = this.currentFlow; - this.currentFlow = trampoline.flow; + var flow = trampoline.flow; + this.currentFlow = flow; // create a br_table switching over the number of optional parameters provided var numNames = numOptional + 1; // incl. outer block @@ -5600,20 +6376,20 @@ export class Compiler extends DiagnosticEmitter { let label = i.toString(10) + ofN; names[i] = label; } - var body = module.createBlock(names[0], [ - module.createBlock("outOfRange", [ - module.createSwitch(names, "outOfRange", + var body = module.block(names[0], [ + module.block("outOfRange", [ + module.switch(names, "outOfRange", // condition is number of provided optional arguments, so subtract required arguments minArguments - ? module.createBinary( + ? module.binary( BinaryOp.SubI32, - module.createGetGlobal(CompilerSymbols.argc, NativeType.I32), - module.createI32(minArguments) + module.global_get(BuiltinSymbols.argc, NativeType.I32), + module.i32(minArguments) ) - : module.createGetGlobal(CompilerSymbols.argc, NativeType.I32) + : module.global_get(BuiltinSymbols.argc, NativeType.I32) ) ]), - module.createUnreachable() + module.unreachable() ]); for (let i = 0; i < numOptional; ++i, ++operandIndex) { let type = originalParameterTypes[minArguments + i]; @@ -5621,12 +6397,11 @@ export class Compiler extends DiagnosticEmitter { let initializer = declaration.initializer; let initExpr: ExpressionRef; if (initializer) { - initExpr = module.createSetLocal(operandIndex, + initExpr = module.local_set(operandIndex, this.compileExpression( initializer, type, - ConversionKind.IMPLICIT, - WrapMode.WRAP + ContextualFlags.IMPLICIT ) ); } else { @@ -5634,33 +6409,36 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Optional_parameter_must_have_an_initializer, declaration.range ); - initExpr = module.createUnreachable(); + initExpr = module.unreachable(); } - body = module.createBlock(names[i + 1], [ + body = module.block(names[i + 1], [ body, initExpr, ]); - forwardedOperands[operandIndex] = module.createGetLocal(operandIndex, type.toNativeType()); + forwardedOperands[operandIndex] = module.local_get(operandIndex, type.toNativeType()); } - this.currentFlow = previousFlow; assert(operandIndex == maxOperands); + var stmts: ExpressionRef[] = [ body ]; + var theCall = module.call(originalName, forwardedOperands, returnType.toNativeType()); + if (returnType != Type.void) { + this.performAutoreleasesWithValue(flow, theCall, returnType, stmts); + } else { + stmts.push(theCall); + this.performAutoreleases(flow, stmts); + } + flow.freeScopedLocals(); + this.currentFlow = previousFlow; + var funcRef = module.addFunction( trampoline.internalName, this.ensureFunctionType( trampolineSignature.parameterTypes, - trampolineSignature.returnType, - trampolineSignature.thisType + returnType, + thisType ), typesToNativeTypes(trampoline.additionalLocals), - module.createBlock(null, [ - body, - module.createCall( - originalName, - forwardedOperands, - commonReturnType.toNativeType() - ) - ], commonReturnType.toNativeType()) + module.block(null, stmts, returnType.toNativeType()) ); trampoline.finalize(module, funcRef); return trampoline; @@ -5671,37 +6449,239 @@ export class Compiler extends DiagnosticEmitter { if (!this.argcVar) { let module = this.module; this.argcVar = module.addGlobal( - CompilerSymbols.argc, + BuiltinSymbols.argc, NativeType.I32, true, - module.createI32(0) + module.i32(0) ); } - return CompilerSymbols.argc; + return BuiltinSymbols.argc; } /** Makes sure that the argument count helper setter is present and returns its name. */ private ensureArgcSet(): string { - var internalName = CompilerSymbols.setargc; if (!this.argcSet) { let module = this.module; - this.argcSet = module.addFunction(internalName, + this.argcSet = module.addFunction(BuiltinSymbols.setargc, this.ensureFunctionType([ Type.u32 ], Type.void), null, - module.createSetGlobal(this.ensureArgcVar(), - module.createGetLocal(0, NativeType.I32) + module.global_set(this.ensureArgcVar(), + module.local_get(0, NativeType.I32) ) ); - module.addFunctionExport(internalName, "_setargc"); + module.addFunctionExport(BuiltinSymbols.setargc, "__setargc"); + } + return BuiltinSymbols.setargc; + } + + // + + /** Makes retain call, retaining the expression's value. */ + makeRetain(expr: ExpressionRef): ExpressionRef { + var retainInstance = this.program.retainInstance; + this.compileFunction(retainInstance); + return this.module.call(retainInstance.internalName, [ expr ], this.options.nativeSizeType); + } + + /** Makes a retainRelease call, retaining the new expression's value and releasing the old expression's value, in this order. */ + makeRetainRelease(oldExpr: ExpressionRef, newExpr: ExpressionRef): ExpressionRef { + // if ((t1=newExpr) != (t2=oldExpr)) { + // __retain(t1); + // __release(t2); + // }, t1 + var module = this.module; + var flow = this.currentFlow; + var usizeType = this.options.usizeType; + var nativeSizeType = this.options.nativeSizeType; + var temp1 = flow.getTempLocal(usizeType, findUsedLocals(oldExpr)); + var temp2 = flow.getAndFreeTempLocal(usizeType); + flow.freeTempLocal(temp1); + return module.block(null, [ + module.if( + module.binary(nativeSizeType == NativeType.I64 ? BinaryOp.NeI64 : BinaryOp.NeI32, + module.local_tee(temp1.index, newExpr), + module.local_tee(temp2.index, oldExpr) + ), + module.block(null, [ + module.drop( + this.makeRetain(module.local_get(temp1.index, nativeSizeType)) + ), + this.makeRelease(module.local_get(temp2.index, nativeSizeType)) + ]) + ), + module.local_get(temp1.index, nativeSizeType) + ], nativeSizeType); + } + + /** Makes a skippedRelease call, ignoring the new expression's value and releasing the old expression's value, in this order. */ + makeSkippedRelease(oldExpr: ExpressionRef, newExpr: ExpressionRef): ExpressionRef { + // TODO: this helper can be eliminated altogether if the current logic holds + // (t1=newExpr), __release(oldExpr), t1 + var module = this.module; + var flow = this.currentFlow; + var usizeType = this.options.usizeType; + var nativeSizeType = this.options.nativeSizeType; + var temp = flow.getAndFreeTempLocal(usizeType, findUsedLocals(oldExpr)); + return module.block(null, [ + module.local_set(temp.index, newExpr), + this.makeRelease(oldExpr), + module.local_get(temp.index, nativeSizeType) + ], nativeSizeType); + } + + /** Makes a release call, releasing the expression's value. Changes the current type to void.*/ + makeRelease(expr: ExpressionRef): ExpressionRef { + var releaseInstance = this.program.releaseInstance; + this.compileFunction(releaseInstance); + return this.module.call(releaseInstance.internalName, [ expr ], NativeType.None); + } + + /** Makes an automatic release call at the end of the current flow. */ + makeAutorelease(expr: ExpressionRef, flow: Flow = this.currentFlow): ExpressionRef { + return this.module.local_tee(flow.getAutoreleaseLocal(this.options.usizeType).index, expr); + } + + /** Attempts to undo a final autorelease, returning the index of the previously retaining variable or -1 if not possible. */ + undoAutorelease(expr: ExpressionRef, flow: Flow): i32 { + // NOTE: Can't remove the local.tee completely because it's already compiled + // and a child of something else. Preventing the final release however should + // make it optimize away. + switch (getExpressionId(expr)) { + case ExpressionId.LocalSet: { // local.tee(__retain(expr)) + if (isLocalTee(expr)) { + let index = getLocalSetIndex(expr); + if (flow.isAnyLocalFlag(index, LocalFlags.ANY_RETAINED)) { + // Assumes that the expression actually belongs to the flow and that + // top-level autoreleases are never undone. While that's true, it's + // not necessary to check presence in scopedLocals. + flow.unsetLocalFlag(index, LocalFlags.ANY_RETAINED); + return index; + } + } + break; + } + case ExpressionId.Block: { // { ..., local.tee(__retain(expr)) } + if (getBlockName(expr) === null) { // must not be a break target + let count = getBlockChildCount(expr); + if (count) { + return this.undoAutorelease(getBlockChild(expr, count - 1), flow); + } + } + break; + } + } + return -1; + } + + /** + * Attemps to move a final autorelease from one flow to a parent. + * It is crucial that from flow hasn't processed autoreleases yet because otherwise the final + * retain would have been written already. + */ + moveAutorelease(expr: ExpressionRef, fromInnerFlow: Flow, toOuterFlow: Flow): ExpressionRef { + // NOTE: While this avoids an unnecessary set of retain and release, it cannot + // eliminate the now unnecessary temporary local.tee because it is already part of + // another expression in the tree. But optimizing should collapse locals again. + var index = this.undoAutorelease(expr, fromInnerFlow); + return ~index + ? this.makeAutorelease(expr, toOuterFlow) // undone, can skip the retain + : this.makeAutorelease(this.makeRetain(expr), toOuterFlow); + } + + /** Performs any queued autoreleases in the specified flow. */ + performAutoreleases(flow: Flow, stmts: ExpressionRef[], clearFlags: bool = true): void { + var scopedLocals = flow.scopedLocals; + if (scopedLocals) { + let module = this.module; + for (let local of scopedLocals.values()) { + if (local.is(CommonFlags.SCOPED)) { // otherwise an alias + let localIndex = local.index; + if (flow.isAnyLocalFlag(localIndex, LocalFlags.ANY_RETAINED)) { + if (clearFlags) flow.unsetLocalFlag(localIndex, LocalFlags.ANY_RETAINED); + stmts.push( + this.makeRelease( + module.local_get(localIndex, local.type.toNativeType()) + ) + ); + } + } + } + } + } + + /** Performs any queued autoreleases in the specified flow and returns the value. */ + performAutoreleasesWithValue( + flow: Flow, + valueExpr: ExpressionRef, + valueType: Type, + stmts: ExpressionRef[] | null = null, + clearFlags: bool = true + ): ExpressionRef { + if (!stmts) stmts = new Array(); + stmts.push( + this.module.nop() + ); + var lengthBefore = stmts.length; + this.performAutoreleases(flow, stmts, clearFlags); + if (stmts.length > lengthBefore) { + let nativeType = valueType.toNativeType(); + let temp = flow.getAndFreeTempLocal(valueType); + if (!flow.canOverflow(valueExpr, valueType)) flow.setLocalFlag(temp.index, LocalFlags.WRAPPED); + if (flow.isNonnull(valueExpr, valueType)) flow.setLocalFlag(temp.index, LocalFlags.NONNULL); + let module = this.module; + stmts[lengthBefore - 1] = module.local_set(temp.index, valueExpr); // nop -> set + stmts.push( + module.local_get(temp.index, nativeType) // append get + ); + return module.block(null, stmts, nativeType); + } else if (stmts.length > 1) { + stmts[lengthBefore - 1] = valueExpr; // nop -> value + return this.module.block(null, stmts, valueType.toNativeType()); } - return internalName; + return valueExpr; } + /** Finishes any queued top-level autoreleases in the actual function of the specified flow. */ + finishAutoreleases(flow: Flow, stmts: ExpressionRef[]): void { + var module = this.module; + if (flow.is(FlowFlags.INLINE_CONTEXT)) { + // traverse to the top-most flow containing the inlined function's + // locals as scoped locals and release these instead. + let parent: Flow | null; + while (parent = flow.parent) flow = parent; + this.performAutoreleases(flow, stmts, false); + } else { + for (let local of flow.parentFunction.localsByIndex) { + let localIndex = local.index; + if (flow.isAnyLocalFlag(localIndex, LocalFlags.ANY_RETAINED)) { + flow.unsetLocalFlag(localIndex, LocalFlags.ANY_RETAINED); + stmts.push( + this.makeRelease( + module.local_get(localIndex, local.type.toNativeType()) + ) + ); + } + } + } + } + + // + /** Creates a direct call to the specified function. */ makeCallDirect( instance: Function, - operands: ExpressionRef[] | null = null + operands: ExpressionRef[] | null, + reportNode: Node, + immediatelyDropped: bool = false, + /** Skip the usual autorelease and manage this at the callsite instead. */ + skipAutorelease: bool = false ): ExpressionRef { + if (instance.hasDecorator(DecoratorFlags.INLINE)) { + this.warning( + DiagnosticCode.TODO_Cannot_inline_inferred_calls_and_specific_internals_yet, + reportNode.range, instance.internalName + ); + } var numOperands = operands ? operands.length : 0; var numArguments = numOperands; var minArguments = instance.signature.requiredParameters; @@ -5716,7 +6696,7 @@ export class Compiler extends DiagnosticEmitter { assert(numOperands >= minOperands); var module = this.module; - if (!this.compileFunction(instance)) return module.createUnreachable(); + if (!this.compileFunction(instance)) return module.unreachable(); var returnType = instance.signature.returnType; var isCallImport = instance.is(CommonFlags.MODULE_IMPORT); @@ -5732,44 +6712,81 @@ export class Compiler extends DiagnosticEmitter { let allOptionalsAreConstant = true; for (let i = numArguments; i < maxArguments; ++i) { let initializer = parameterNodes[i].initializer; - if (!(initializer && nodeIsConstantValue(initializer.kind))) { - allOptionalsAreConstant = false; - break; - } - } - if (allOptionalsAreConstant) { // inline into the call - for (let i = numArguments; i < maxArguments; ++i) { - operands.push( - this.compileExpression( + if (initializer) { + if (nodeIsConstantValue(initializer.kind)) { + operands.push(this.compileExpression( parameterNodes[i].initializer, parameterTypes[i], - ConversionKind.IMPLICIT, - WrapMode.NONE - ) - ); - } - } else { // otherwise fill up with zeroes and call the trampoline - for (let i = numArguments; i < maxArguments; ++i) { - operands.push(parameterTypes[i].toNativeZero(module)); + ContextualFlags.IMPLICIT + )); + continue; + } + let resolved = this.resolver.resolveExpression(initializer, instance.flow, parameterTypes[i]); + if (resolved) { + if (resolved.kind == ElementKind.GLOBAL) { + let global = resolved; + if (this.compileGlobal(global)) { + if (global.is(CommonFlags.INLINED)) { + operands.push( + this.compileInlineConstant(global, parameterTypes[i], ContextualFlags.IMPLICIT) + ); + } else { + operands.push( + this.convertExpression( + module.global_get(global.internalName, global.type.toNativeType()), + global.type, parameterTypes[i], false, false, initializer + ) + ); + } + continue; + } + } + } } + operands.push(parameterTypes[i].toNativeZero(module)); + allOptionalsAreConstant = false; + } + if (!allOptionalsAreConstant) { if (!isCallImport) { let original = instance; instance = this.ensureTrampoline(instance); - if (!this.compileFunction(instance)) return module.createUnreachable(); + if (!this.compileFunction(instance)) return module.unreachable(); instance.flow.flags = original.flow.flags; let nativeReturnType = returnType.toNativeType(); + let expr = module.call(instance.internalName, operands, nativeReturnType); this.currentType = returnType; - return module.createBlock(null, [ - module.createSetGlobal(this.ensureArgcVar(), module.createI32(numArguments)), - module.createCall(instance.internalName, operands, nativeReturnType) - ], nativeReturnType); + if (returnType.isManaged) { + if (immediatelyDropped) { + expr = this.makeRelease(expr); + this.currentType = Type.void; + } else if (!skipAutorelease) { + expr = this.makeAutorelease(expr); + } else { + this.skippedAutoreleases.add(expr); + } + } + return module.block(null, [ + module.global_set(this.ensureArgcVar(), module.i32(numArguments)), + expr + ], this.currentType.toNativeType()); } } } - // otherwise just call through + // If the return value is of a reference type it has not yet been released but is in flight + // which is equivalent to a skipped autorelease. Hence, insert either a release if it is + // dropped anyway, preserve the skipped autorelease if explicitly requested or autorelease now. + var expr = module.call(instance.internalName, operands, returnType.toNativeType()); this.currentType = returnType; - return module.createCall(instance.internalName, operands, returnType.toNativeType()); + if (returnType.isManaged) { + if (immediatelyDropped) { + expr = this.makeRelease(expr); + this.currentType = Type.void; + } else if (!skipAutorelease) { + expr = this.makeAutorelease(expr); + } + } + return expr; } /** Compiles an indirect call using an index argument and a signature. */ @@ -5778,7 +6795,8 @@ export class Compiler extends DiagnosticEmitter { indexArg: ExpressionRef, argumentExpressions: Expression[], reportNode: Node, - thisArg: ExpressionRef = 0 + thisArg: ExpressionRef = 0, + immediatelyDropped: bool = false ): ExpressionRef { var numArguments = argumentExpressions.length; @@ -5788,7 +6806,7 @@ export class Compiler extends DiagnosticEmitter { thisArg != 0, reportNode )) { - return this.module.createUnreachable(); + return this.module.unreachable(); } var numArgumentsInclThis = thisArg ? numArguments + 1 : numArguments; @@ -5800,22 +6818,20 @@ export class Compiler extends DiagnosticEmitter { } var parameterTypes = signature.parameterTypes; for (let i = 0; i < numArguments; ++i, ++index) { - operands[index] = this.compileExpression( - argumentExpressions[i], - parameterTypes[i], - ConversionKind.IMPLICIT, - WrapMode.NONE + operands[index] = this.compileExpression(argumentExpressions[i], parameterTypes[i], + ContextualFlags.IMPLICIT ); } assert(index == numArgumentsInclThis); - return this.makeCallIndirect(signature, indexArg, operands); + return this.makeCallIndirect(signature, indexArg, operands, immediatelyDropped); } /** Creates an indirect call to the function at `indexArg` in the function table. */ makeCallIndirect( signature: Signature, indexArg: ExpressionRef, - operands: ExpressionRef[] | null = null + operands: ExpressionRef[] | null = null, + immediatelyDropped: bool = false ): ExpressionRef { var numOperands = operands ? operands.length : 0; var numArguments = numOperands; @@ -5846,75 +6862,81 @@ export class Compiler extends DiagnosticEmitter { } var returnType = signature.returnType; + var expr = module.call_indirect(indexArg, operands, signature.toSignatureString()); this.currentType = returnType; - return module.createBlock(null, [ - module.createSetGlobal(this.ensureArgcVar(), // might still be calling a trampoline - module.createI32(numArguments) + if (returnType.isManaged) { + if (immediatelyDropped) { + expr = this.makeRelease(expr); + this.currentType = Type.void; + } else { + expr = this.makeAutorelease(expr); + } + } + return module.block(null, [ + module.global_set(this.ensureArgcVar(), // might be calling a trampoline + module.i32(numArguments) ), - module.createCallIndirect(indexArg, operands, signature.toSignatureString()) - ], returnType.toNativeType()); // not necessarily wrapped + expr + ], this.currentType.toNativeType()); // not necessarily wrapped } - compileCommaExpression(expression: CommaExpression, contextualType: Type): ExpressionRef { + compileCommaExpression( + expression: CommaExpression, + contextualType: Type, + contextualFlags: ContextualFlags + ): ExpressionRef { var expressions = expression.expressions; var numExpressions = expressions.length; var exprs = new Array(numExpressions--); for (let i = 0; i < numExpressions; ++i) { - exprs[i] = this.compileExpression( - expressions[i], - Type.void, // drop all - ConversionKind.EXPLICIT, - WrapMode.NONE + exprs[i] = this.compileExpression(expressions[i], Type.void, // drop all except last + ContextualFlags.IMPLICIT | ContextualFlags.WILL_DROP ); } - exprs[numExpressions] = this.compileExpression( - expressions[numExpressions], - contextualType, // except last - ConversionKind.IMPLICIT, - WrapMode.NONE - ); - return this.module.createBlock(null, exprs, this.currentType.toNativeType()); + exprs[numExpressions] = this.compileExpression(expressions[numExpressions], contextualType, contextualFlags); + return this.module.block(null, exprs, this.currentType.toNativeType()); } - compileElementAccessExpression(expression: ElementAccessExpression, contextualType: Type): ExpressionRef { + compileElementAccessExpression( + expression: ElementAccessExpression, + contextualType: Type, + contextualFlags: ContextualFlags + ): ExpressionRef { var target = this.resolver.resolveElementAccessExpression( expression, this.currentFlow, contextualType ); // reports - if (!target) return this.module.createUnreachable(); + if (!target) return this.module.unreachable(); switch (target.kind) { case ElementKind.CLASS: { - let isUnchecked = this.currentFlow.is(FlowFlags.UNCHECKED_CONTEXT); - let indexedGet = (target).lookupOverload(OperatorKind.INDEXED_GET, isUnchecked); + let indexedGet = (target).lookupOverload(OperatorKind.INDEXED_GET, this.currentFlow.is(FlowFlags.UNCHECKED_CONTEXT)); if (!indexedGet) { this.error( DiagnosticCode.Index_signature_is_missing_in_type_0, expression.expression.range, (target).internalName ); - return this.module.createUnreachable(); + return this.module.unreachable(); } - let thisArg = this.compileExpression( - expression.expression, - (target).type, - ConversionKind.IMPLICIT, - WrapMode.NONE + let thisArg = this.compileExpression(expression.expression, (target).type, + ContextualFlags.IMPLICIT ); return this.compileCallDirect(indexedGet, [ expression.elementExpression - ], expression, thisArg); + ], expression, thisArg, contextualFlags & (ContextualFlags.WILL_DROP | ContextualFlags.SKIP_AUTORELEASE)); } } this.error( DiagnosticCode.Operation_not_supported, expression.range ); - return this.module.createUnreachable(); + return this.module.unreachable(); } compileFunctionExpression( expression: FunctionExpression, - contextualSignature: Signature | null + contextualSignature: Signature | null, + contextualFlags: ContextualFlags ): ExpressionRef { var declaration = expression.declaration.clone(); // generic contexts can have multiple assert(!declaration.typeParameters); // function expression cannot be generic @@ -5946,7 +6968,7 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Expected_0_arguments_but_got_1, expression.range, numParameters.toString(), numPresentParameters.toString() ); - return this.module.createUnreachable(); + return this.module.unreachable(); } // check non-omitted parameter types @@ -5960,13 +6982,13 @@ export class Compiler extends DiagnosticEmitter { actualFunction.parent, contextualTypeArguments ); - if (!resolvedType) return this.module.createUnreachable(); + if (!resolvedType) return this.module.unreachable(); if (!parameterTypes[i].isStrictlyAssignableTo(resolvedType)) { this.error( DiagnosticCode.Type_0_is_not_assignable_to_type_1, parameterNode.range, parameterTypes[i].toString(), resolvedType.toString() ); - return this.module.createUnreachable(); + return this.module.unreachable(); } } // any unused parameters are inherited but ignored @@ -5980,7 +7002,7 @@ export class Compiler extends DiagnosticEmitter { actualFunction.parent, contextualTypeArguments ); - if (!resolvedType) return this.module.createUnreachable(); + if (!resolvedType) return this.module.unreachable(); if ( returnType == Type.void ? resolvedType != Type.void @@ -5990,7 +7012,7 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Type_0_is_not_assignable_to_type_1, signatureNode.returnType.range, resolvedType.toString(), returnType.toString() ); - return this.module.createUnreachable(); + return this.module.unreachable(); } } @@ -6003,20 +7025,20 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode._this_cannot_be_referenced_in_current_location, thisTypeNode.range ); - return this.module.createUnreachable(); + return this.module.unreachable(); } let resolvedType = this.resolver.resolveType( thisTypeNode, actualFunction.parent, contextualTypeArguments ); - if (!resolvedType) return this.module.createUnreachable(); + if (!resolvedType) return this.module.unreachable(); if (!thisType.isStrictlyAssignableTo(resolvedType)) { this.error( DiagnosticCode.Type_0_is_not_assignable_to_type_1, thisTypeNode.range, thisType.toString(), resolvedType.toString() ); - return this.module.createUnreachable(); + return this.module.unreachable(); } } @@ -6029,7 +7051,7 @@ export class Compiler extends DiagnosticEmitter { signature, contextualTypeArguments ); - if (!this.compileFunction(instance)) return this.module.createUnreachable(); + if (!this.compileFunction(instance)) return this.module.unreachable(); this.currentType = contextualSignature.type; // otherwise compile like a normal function @@ -6039,14 +7061,14 @@ export class Compiler extends DiagnosticEmitter { [], contextualTypeArguments ); - if (!instance) return this.module.createUnreachable(); + if (!instance) return this.module.unreachable(); this.currentType = instance.signature.type; } var index = this.ensureFunctionTableEntry(instance); // reports return index < 0 - ? this.module.createUnreachable() - : this.module.createI32(index); + ? this.module.unreachable() + : this.module.i32(index); } /** Makes sure the enclosing source file of the specified expression has been compiled. */ @@ -6068,7 +7090,7 @@ export class Compiler extends DiagnosticEmitter { compileIdentifierExpression( expression: IdentifierExpression, contextualType: Type, - retainConstantType: bool + contextualFlags: ContextualFlags ): ExpressionRef { var module = this.module; var flow = this.currentFlow; @@ -6082,16 +7104,16 @@ export class Compiler extends DiagnosticEmitter { this.currentType = options.usizeType; } return options.isWasm64 - ? module.createI64(0) - : module.createI32(0); + ? module.i64(0) + : module.i32(0); } case NodeKind.TRUE: { this.currentType = Type.bool; - return module.createI32(1); + return module.i32(1); } case NodeKind.FALSE: { this.currentType = Type.bool; - return module.createI32(0); + return module.i32(0); } case NodeKind.THIS: { if (actualFunction.is(CommonFlags.INSTANCE)) { @@ -6108,34 +7130,36 @@ export class Compiler extends DiagnosticEmitter { // return this // } let stmts: ExpressionRef[] = [ - module.createIf( - module.createUnary(nativeSizeType == NativeType.I64 ? UnaryOp.EqzI64 : UnaryOp.EqzI32, - module.createGetLocal(thisLocal.index, nativeSizeType) + module.if( + module.unary(nativeSizeType == NativeType.I64 ? UnaryOp.EqzI64 : UnaryOp.EqzI32, + module.local_get(thisLocal.index, nativeSizeType) ), - module.createSetLocal(thisLocal.index, - this.makeAllocation(classInstance) + module.local_set(thisLocal.index, + this.makeRetain( + this.makeAllocation(classInstance) + ) ) ) ]; this.makeFieldInitialization(classInstance, stmts); stmts.push( - module.createGetLocal(thisLocal.index, nativeSizeType) + module.local_get(thisLocal.index, nativeSizeType) ); this.currentType = thisLocal.type; - return module.createBlock(null, stmts, nativeSizeType); + return module.block(null, stmts, nativeSizeType); } } // if not a constructor, `this` type can differ let thisType = assert(actualFunction.signature.thisType); this.currentType = thisType; - return module.createGetLocal(thisLocal.index, thisType.toNativeType()); + return module.local_get(thisLocal.index, thisType.toNativeType()); } this.error( DiagnosticCode._this_cannot_be_referenced_in_current_location, expression.range ); this.currentType = this.options.usizeType; - return module.createUnreachable(); + return module.unreachable(); } case NodeKind.SUPER: { let flow = this.currentFlow; @@ -6156,7 +7180,7 @@ export class Compiler extends DiagnosticEmitter { let base = scopedThisClass.base; if (base) { this.currentType = base.type; - return module.createGetLocal(scopedThis.index, base.type.toNativeType()); + return module.local_get(scopedThis.index, base.type.toNativeType()); } } } @@ -6166,7 +7190,7 @@ export class Compiler extends DiagnosticEmitter { if (baseClassInstance) { let superType = baseClassInstance.type; this.currentType = superType; - return module.createGetLocal(0, superType.toNativeType()); + return module.local_get(0, superType.toNativeType()); } } this.error( @@ -6174,7 +7198,7 @@ export class Compiler extends DiagnosticEmitter { expression.range ); this.currentType = this.options.usizeType; - return module.createUnreachable(); + return module.unreachable(); } } @@ -6186,31 +7210,34 @@ export class Compiler extends DiagnosticEmitter { flow, this.currentEnum || actualFunction ); - if (!target) return module.createUnreachable(); + if (!target) return module.unreachable(); switch (target.kind) { case ElementKind.LOCAL: { - let localType = (target).type; - assert(localType != Type.void); + let type = (target).type; + assert(type != Type.void); if ((target).is(CommonFlags.INLINED)) { - return this.compileInlineConstant(target, contextualType, retainConstantType); + return this.compileInlineConstant(target, contextualType, contextualFlags); } let localIndex = (target).index; assert(localIndex >= 0); - this.currentType = localType; - return this.module.createGetLocal(localIndex, localType.toNativeType()); + if (type.is(TypeFlags.NULLABLE) && flow.isLocalFlag(localIndex, LocalFlags.NONNULL, false)) { + type = type.nonNullableType; + } + this.currentType = type; + return this.module.local_get(localIndex, type.toNativeType()); } case ElementKind.GLOBAL: { if (!this.compileGlobal(target)) { // reports; not yet compiled if a static field - return this.module.createUnreachable(); + return this.module.unreachable(); } - let globalType = (target).type; - assert(globalType != Type.void); + let type = (target).type; + assert(type != Type.void); if ((target).is(CommonFlags.INLINED)) { - return this.compileInlineConstant(target, contextualType, retainConstantType); + return this.compileInlineConstant(target, contextualType, contextualFlags); } - this.currentType = globalType; - return this.module.createGetGlobal((target).internalName, globalType.toNativeType()); + this.currentType = type; + return this.module.global_get((target).internalName, type.toNativeType()); } case ElementKind.ENUMVALUE: { // here: if referenced from within the same enum if (!target.is(CommonFlags.COMPILED)) { @@ -6219,14 +7246,14 @@ export class Compiler extends DiagnosticEmitter { expression.range ); this.currentType = Type.i32; - return this.module.createUnreachable(); + return this.module.unreachable(); } this.currentType = Type.i32; if ((target).is(CommonFlags.INLINED)) { assert((target).constantValueKind == ConstantValueKind.INTEGER); - return this.module.createI32(i64_low((target).constantIntegerValue)); + return this.module.i32(i64_low((target).constantIntegerValue)); } - return this.module.createGetGlobal((target).internalName, NativeType.I32); + return this.module.global_get((target).internalName, NativeType.I32); } case ElementKind.FUNCTION_PROTOTYPE: { let instance = this.resolver.resolveFunction( @@ -6234,406 +7261,373 @@ export class Compiler extends DiagnosticEmitter { null, makeMap(flow.contextualTypeArguments) ); - if (!(instance && this.compileFunction(instance))) return module.createUnreachable(); + if (!(instance && this.compileFunction(instance))) return module.unreachable(); let index = this.ensureFunctionTableEntry(instance); this.currentType = instance.signature.type; - return this.module.createI32(index); + return this.module.i32(index); } } this.error( DiagnosticCode.Operation_not_supported, expression.range ); - return this.module.createUnreachable(); + return this.module.unreachable(); } compileInstanceOfExpression( expression: InstanceOfExpression, - contextualType: Type + contextualType: Type, + contextualFlags: ContextualFlags ): ExpressionRef { var module = this.module; // NOTE that this differs from TypeScript in that the rhs is a type, not an expression. at the // time of implementation, this seemed more useful because dynamic rhs expressions are not - // possible in AS anyway. - var expr = this.compileExpressionRetainType(expression.expression, this.options.usizeType, WrapMode.NONE); + // possible in AS anyway. also note that the code generated below must preserve side-effects of + // the LHS expression even when the result is a constant, i.e. return a block dropping `expr`. + var expr = this.compileExpressionRetainType(expression.expression, this.options.usizeType); var actualType = this.currentType; - var expectedType = this.resolver.resolveType( - expression.isType, - this.currentFlow.actualFunction - ); + var expectedType = this.resolver.resolveType(expression.isType, this.currentFlow.actualFunction); this.currentType = Type.bool; - if (!expectedType) return module.createUnreachable(); + if (!expectedType) return module.unreachable(); - // instanceof must be exact + // instanceof - must be exact if (!expectedType.is(TypeFlags.REFERENCE)) { - return module.createI32(actualType == expectedType ? 1 : 0); - } - // instanceof must be != 0 - if ( - actualType.is(TypeFlags.NULLABLE) && !expectedType.is(TypeFlags.NULLABLE) && - actualType.nonNullableType.isAssignableTo(expectedType) - ) { - return module.createBinary( - actualType.is(TypeFlags.LONG) - ? BinaryOp.NeI64 - : BinaryOp.NeI32, - expr, - actualType.toNativeZero(module) - ); - } - return module.createI32(actualType.isAssignableTo(expectedType) ? 1 : 0); - } - - compileLiteralExpression( - expression: LiteralExpression, - contextualType: Type, - implicitNegate: bool = false - ): ExpressionRef { - var module = this.module; - switch (expression.literalKind) { - case LiteralKind.ARRAY: { - assert(!implicitNegate); - let classType = contextualType.classReference; - if ( - classType && - classType.prototype == this.program.arrayPrototype - ) { - return this.compileArrayLiteral( - assert(classType.typeArguments)[0], - (expression).elementExpressions, - false, // TODO: isConst? - expression - ); - } - this.error( - DiagnosticCode.Operation_not_supported, - expression.range + return module.block(null, [ + this.convertExpression(expr, actualType, Type.void, (contextualFlags & ContextualFlags.EXPLICIT) != 0, false, expression.expression), + module.i32(actualType == expectedType ? 1 : 0) + ], NativeType.I32); + } + + // instanceof - always false + if (!actualType.is(TypeFlags.REFERENCE)) { + return module.block(null, [ + this.convertExpression(expr, actualType, Type.void, (contextualFlags & ContextualFlags.EXPLICIT) != 0,false, expression.expression), + module.i32(0) + ], NativeType.I32); + } + + // both LHS and RHS are references now + var nativeSizeType = actualType.toNativeType(); + + // instanceof - LHS must be != 0 + if (actualType.is(TypeFlags.NULLABLE) && !expectedType.is(TypeFlags.NULLABLE)) { + + // downcast - check statically + if (actualType.nonNullableType.isAssignableTo(expectedType)) { + return module.binary( + nativeSizeType == NativeType.I64 + ? BinaryOp.NeI64 + : BinaryOp.NeI32, + expr, + actualType.toNativeZero(module) ); - return module.createUnreachable(); } - case LiteralKind.FLOAT: { - let floatValue = (expression).value; - if (implicitNegate) { - floatValue = -floatValue; - } - if (contextualType == Type.f32) { - return module.createF32(floatValue); - } - this.currentType = Type.f64; - return module.createF64(floatValue); - } - case LiteralKind.INTEGER: { - let intValue = (expression).value; - if (implicitNegate) { - intValue = i64_sub( - i64_new(0), - intValue + + // upcast - check dynamically + if (expectedType.isAssignableTo(actualType)) { + let program = this.program; + if (!(actualType.isUnmanaged || expectedType.isUnmanaged)) { + let flow = this.currentFlow; + let tempLocal = flow.getAndFreeTempLocal(actualType); + let instanceofInstance = assert(program.instanceofInstance); + this.compileFunction(instanceofInstance); + return module.if( + module.unary( + nativeSizeType == NativeType.I64 + ? UnaryOp.EqzI64 + : UnaryOp.EqzI32, + module.local_tee(tempLocal.index, expr), + ), + module.i32(0), + this.makeCallDirect(instanceofInstance, [ + module.local_get(tempLocal.index, nativeSizeType), + module.i32(expectedType.classReference!.id) + ], expression) + ); + } else { + this.error( + DiagnosticCode.Operation_not_supported, + expression.range ); } - let type = this.resolver.determineIntegerLiteralType(intValue, contextualType); - this.currentType = type; - switch (type.kind) { - case TypeKind.ISIZE: if (!this.options.isWasm64) return module.createI32(i64_low(intValue)); - case TypeKind.I64: return module.createI64(i64_low(intValue), i64_high(intValue)); - case TypeKind.USIZE: if (!this.options.isWasm64) return module.createI32(i64_low(intValue)); - case TypeKind.U64: return module.createI64(i64_low(intValue), i64_high(intValue)); - case TypeKind.F32: return module.createF32(i64_to_f32(intValue)); - case TypeKind.F64: return module.createF64(i64_to_f64(intValue)); - default: return module.createI32(i64_low(intValue)); - } - } - case LiteralKind.STRING: { - assert(!implicitNegate); - return this.compileStringLiteral(expression); - } - case LiteralKind.OBJECT: { - assert(!implicitNegate); - return this.compileObjectLiteral(expression, contextualType); - } - // case LiteralKind.REGEXP: - } - this.error( - DiagnosticCode.Operation_not_supported, - expression.range - ); - this.currentType = contextualType; - return module.createUnreachable(); - } - - /** Ensures that the specified string exists in static memory and returns a pointer to it. */ - ensureStaticString(stringValue: string): ExpressionRef { - var program = this.program; - var hasGC = program.hasGC; - var gcHeaderSize = program.gcHeaderSize; - - var stringInstance = assert(program.stringInstance); - var stringSegment: MemorySegment; - - // if the string already exists, reuse it - var segments = this.stringSegments; - if (segments.has(stringValue)) { - stringSegment = segments.get(stringValue); - - // otherwise create it - } else { - let length = stringValue.length; - let headerSize = (stringInstance.currentMemoryOffset + 1) & ~1; - let totalSize = headerSize + length * 2; - - let buf: Uint8Array; - let pos: u32; - - if (hasGC) { - buf = new Uint8Array(gcHeaderSize + totalSize); - pos = gcHeaderSize; - writeI32(ensureGCHook(this, stringInstance), buf, program.gcHookOffset); - } else { - buf = new Uint8Array(totalSize); - pos = 0; - } - writeI32(length, buf, pos + stringInstance.offsetof(LibrarySymbols.length)); - pos += headerSize; - for (let i = 0; i < length; ++i) { - writeI16(stringValue.charCodeAt(i), buf, pos + (i << 1)); - } - stringSegment = this.addMemorySegment(buf); - segments.set(stringValue, stringSegment); - } - var stringOffset = stringSegment.offset; - if (hasGC) stringOffset = i64_add(stringOffset, i64_new(gcHeaderSize)); - - this.currentType = stringInstance.type; - if (this.options.isWasm64) { - return this.module.createI64(i64_low(stringOffset), i64_high(stringOffset)); - } else { - assert(i64_is_u32(stringOffset)); - return this.module.createI32(i64_low(stringOffset)); - } - } - - compileStringLiteral(expression: StringLiteralExpression): ExpressionRef { - return this.ensureStaticString(expression.value); - } - - /** Ensures that the specified array exists in static memory and returns a pointer to it. */ - ensureStaticArray(elementType: Type, values: ExpressionRef[]): ExpressionRef { - var program = this.program; - var hasGC = program.hasGC; - var gcHeaderSize = program.gcHeaderSize; - - var length = values.length; - var byteSize = elementType.byteSize; - var byteLength = length * byteSize; - var usizeTypeSize = this.options.usizeType.byteSize; - - var buf: Uint8Array; - var pos: u32; - - // create the backing ArrayBuffer segment - var bufferInstance = assert(program.arrayBufferInstance); - var bufferHeaderSize = (bufferInstance.currentMemoryOffset + 7) & ~7; - var bufferTotalSize = 1 << (32 - clz(bufferHeaderSize + byteLength - 1)); - if (hasGC) { - buf = new Uint8Array(gcHeaderSize + bufferTotalSize); - pos = gcHeaderSize; - writeI32(ensureGCHook(this, bufferInstance), buf, program.gcHookOffset); - } else { - buf = new Uint8Array(bufferTotalSize); - pos = 0; - } - writeI32(byteLength, buf, pos + bufferInstance.offsetof(LibrarySymbols.byteLength)); - pos += bufferHeaderSize; - var nativeType = elementType.toNativeType(); - switch (nativeType) { - case NativeType.I32: { - switch (byteSize) { - case 1: { - for (let i = 0; i < length; ++i) { - let value = values[i]; - assert(getExpressionType(value) == nativeType); - assert(getExpressionId(value) == ExpressionId.Const); - writeI8(getConstValueI32(value), buf, pos); - pos += 1; - } - break; - } - case 2: { - for (let i = 0; i < length; ++i) { - let value = values[i]; - assert(getExpressionType(value) == nativeType); - assert(getExpressionId(value) == ExpressionId.Const); - writeI16(getConstValueI32(value), buf, pos); - pos += 2; - } - break; - } - case 4: { - for (let i = 0; i < length; ++i) { - let value = values[i]; - assert(getExpressionType(value) == nativeType); - assert(getExpressionId(value) == ExpressionId.Const); - writeI32(getConstValueI32(value), buf, pos); - pos += 4; - } - break; - } - default: assert(false); + } + + // either none or both nullable + } else { + + // downcast - check statically + if (actualType.isAssignableTo(expectedType)) { + return module.block(null, [ + this.convertExpression(expr, actualType, Type.void, (contextualFlags & ContextualFlags.EXPLICIT) != 0, false, expression.expression), + module.i32(1) + ], NativeType.I32); + + // upcast - check dynamically + } else if (expectedType.isAssignableTo(actualType)) { + let program = this.program; + if (!(actualType.isUnmanaged || expectedType.isUnmanaged)) { + // FIXME: the temp local and the if can be removed here once flows + // perform null checking, which would error earlier when checking + // uninitialized (thus zero) `var a: A` to be an instance of something. + let flow = this.currentFlow; + let tempLocal = flow.getAndFreeTempLocal(actualType); + let instanceofInstance = assert(program.instanceofInstance); + this.compileFunction(instanceofInstance); + return module.if( + module.unary( + nativeSizeType == NativeType.I64 + ? UnaryOp.EqzI64 + : UnaryOp.EqzI32, + module.local_tee(tempLocal.index, expr), + ), + module.i32(0), + this.makeCallDirect(instanceofInstance, [ + module.local_get(tempLocal.index, nativeSizeType), + module.i32(expectedType.classReference!.id) + ], expression) + ); + } else { + this.error( + DiagnosticCode.Operation_not_supported, + expression.range + ); } - break; } - case NativeType.I64: { - for (let i = 0; i < length; ++i) { - let value = values[i]; - assert(getExpressionType(value) == nativeType); - assert(getExpressionId(value) == ExpressionId.Const); - writeI64(i64_new(getConstValueI64Low(value), getConstValueI64High(value)), buf, pos); - pos += 8; + } + + // false + return module.block(null, [ + this.convertExpression(expr, actualType, Type.void, (contextualFlags & ContextualFlags.EXPLICIT) != 0, false, expression.expression), + module.i32(0) + ], NativeType.I32); + } + + compileLiteralExpression( + expression: LiteralExpression, + contextualType: Type, + contextualFlags: ContextualFlags, + implicitlyNegate: bool = false + ): ExpressionRef { + var module = this.module; + switch (expression.literalKind) { + case LiteralKind.ARRAY: { + assert(!implicitlyNegate); + let classType = contextualType.classReference; + if (classType) { + if (classType.prototype == this.program.arrayPrototype) { + return this.compileArrayLiteral( + assert(classType.typeArguments)[0], + (expression).elementExpressions, + false, // TODO: isConst? + contextualFlags, + expression + ); + } } - break; + this.error( + DiagnosticCode.Operation_not_supported, + expression.range + ); + return module.unreachable(); } - case NativeType.F32: { - for (let i = 0; i < length; ++i) { - let value = values[i]; - assert(getExpressionType(value) == nativeType); - assert(getExpressionId(value) == ExpressionId.Const); - writeF32(getConstValueF32(value), buf, pos); - pos += 4; + case LiteralKind.FLOAT: { + let floatValue = (expression).value; + if (implicitlyNegate) { + floatValue = -floatValue; } - break; + if (contextualType == Type.f32) { + return module.f32(floatValue); + } + this.currentType = Type.f64; + return module.f64(floatValue); } - case NativeType.F64: { - for (let i = 0; i < length; ++i) { - let value = values[i]; - assert(getExpressionType(value) == nativeType); - assert(getExpressionId(value) == ExpressionId.Const); - writeF64(getConstValueF64(value), buf, pos); - pos += 8; + case LiteralKind.INTEGER: { + let intValue = (expression).value; + if (implicitlyNegate) { + intValue = i64_sub( + i64_new(0), + intValue + ); + } + let type = this.resolver.determineIntegerLiteralType(intValue, contextualType); + this.currentType = type; + switch (type.kind) { + case TypeKind.ISIZE: if (!this.options.isWasm64) return module.i32(i64_low(intValue)); + case TypeKind.I64: return module.i64(i64_low(intValue), i64_high(intValue)); + case TypeKind.USIZE: if (!this.options.isWasm64) return module.i32(i64_low(intValue)); + case TypeKind.U64: return module.i64(i64_low(intValue), i64_high(intValue)); + case TypeKind.F32: return module.f32(i64_to_f32(intValue)); + case TypeKind.F64: return module.f64(i64_to_f64(intValue)); + default: return module.i32(i64_low(intValue)); } - break; } - default: assert(false); + case LiteralKind.STRING: { + assert(!implicitlyNegate); + return this.compileStringLiteral(expression); + } + case LiteralKind.OBJECT: { + assert(!implicitlyNegate); + return this.compileObjectLiteral(expression, contextualType); + } + // case LiteralKind.REGEXP: } - var bufferSegment = this.addMemorySegment(buf); - var bufferOffset = bufferSegment.offset; - if (hasGC) bufferOffset = i64_add(bufferOffset, i64_new(gcHeaderSize)); + this.error( + DiagnosticCode.Operation_not_supported, + expression.range + ); + this.currentType = contextualType; + return module.unreachable(); + } - // create the Array segment and return a pointer to it - var arrayPrototype = assert(program.arrayPrototype); - var arrayInstance = assert(this.resolver.resolveClass( - arrayPrototype, - [ elementType ], - makeMap() - )); - var arrayHeaderSize = (arrayInstance.currentMemoryOffset + 7) & ~7; - if (hasGC) { - buf = new Uint8Array(gcHeaderSize + arrayHeaderSize); - pos = gcHeaderSize; - writeI32(ensureGCHook(this, arrayInstance), buf, program.gcHookOffset); - } else { - buf = new Uint8Array(arrayHeaderSize); - pos = 0; - } - var arraySegment = this.addMemorySegment(buf); - var arrayOffset = arraySegment.offset; - if (hasGC) arrayOffset = i64_add(arrayOffset, i64_new(gcHeaderSize)); - this.currentType = arrayInstance.type; - var buffer_offset = pos + arrayInstance.offsetof("buffer_"); - var length_offset = pos + arrayInstance.offsetof("length_"); - if (usizeTypeSize == 8) { - writeI64(bufferOffset, buf, buffer_offset); - writeI32(length, buf, length_offset); - return this.module.createI64(i64_low(arrayOffset), i64_high(arrayOffset)); - } else { - assert(i64_is_u32(bufferOffset)); - writeI32(i64_low(bufferOffset), buf, buffer_offset); - writeI32(length, buf, length_offset); - assert(i64_is_u32(arrayOffset)); - return this.module.createI32(i64_low(arrayOffset)); - } + compileStringLiteral(expression: StringLiteralExpression): ExpressionRef { + return this.ensureStaticString(expression.value); } compileArrayLiteral( elementType: Type, expressions: (Expression | null)[], isConst: bool, + contextualFlags: ContextualFlags, reportNode: Node ): ExpressionRef { var module = this.module; + var program = this.program; + var arrayPrototype = assert(program.arrayPrototype); + var arrayInstance = assert(this.resolver.resolveClass(arrayPrototype, [ elementType ])); + var arrayBufferInstance = assert(program.arrayBufferInstance); + var arrayType = arrayInstance.type; + var flow = this.currentFlow; + + // block those here so compiling expressions doesn't conflict + var tempThis = flow.getTempLocal(arrayType); + var tempDataStart = flow.getTempLocal(arrayBufferInstance.type); - // find out whether all elements are constant (array is static) + // compile value expressions and find out whether all are constant var length = expressions.length; - var compiledValues = new Array(length); - var constantValues = new Array(length); - var nativeElementType = elementType.toNativeType(); + var values = new Array(length); var isStatic = true; + var nativeElementType = elementType.toNativeType(); for (let i = 0; i < length; ++i) { let expression = expressions[i]; let expr = expression - ? this.compileExpression(expression, elementType, ConversionKind.IMPLICIT, WrapMode.NONE) + ? module.precomputeExpression( + this.compileExpression(expression, elementType, + ContextualFlags.IMPLICIT + ) + ) : elementType.toNativeZero(module); - compiledValues[i] = expr; - if (isStatic) { - expr = module.precomputeExpression(expr); - if (getExpressionId(expr) == ExpressionId.Const) { - assert(getExpressionType(expr) == nativeElementType); - constantValues[i] = expr; - } else { - if (isConst) { - this.warning( - DiagnosticCode.Compiling_constant_with_non_constant_initializer_as_mutable, - reportNode.range - ); - } - isStatic = false; - } + if (getExpressionId(expr) == ExpressionId.Const) { + assert(getExpressionType(expr) == nativeElementType); + } else { + isStatic = false; } + values[i] = expr; } - // make a static array if possible - if (isStatic) return this.ensureStaticArray(elementType, constantValues); + // if the array is static, make a static arraybuffer segment + if (isStatic) { + flow.freeTempLocal(tempThis); + flow.freeTempLocal(tempDataStart); - // otherwise obtain the array type - var arrayPrototype = assert(this.program.arrayPrototype); - var arrayInstance = assert(this.resolver.resolveClass( - arrayPrototype, - [ elementType ], - makeMap() - )); - var arrayType = arrayInstance.type; + let runtimeHeaderSize = program.runtimeHeaderSize; + let bufferSegment = this.ensureStaticArrayBuffer(elementType, values); + let bufferAddress = i64_add(bufferSegment.offset, i64_new(runtimeHeaderSize)); - // and compile an explicit instantiation - this.currentType = arrayType; + // make both the buffer and array header static if assigned to a global. this can't be done + // if inside of a function because each invocation must create a new array reference then. + if (contextualFlags & ContextualFlags.STATIC_CAPABLE) { + let arraySegment = this.ensureStaticArrayHeader(elementType, bufferSegment); + let arrayAddress = i64_add(arraySegment.offset, i64_new(runtimeHeaderSize)); + this.currentType = arrayType; + return program.options.isWasm64 + ? this.module.i64(i64_low(arrayAddress), i64_high(arrayAddress)) + : this.module.i32(i64_low(arrayAddress)); + + // otherwise allocate a new array header and make it wrap a copy of the static buffer + } else { + // makeArray(length, alignLog2, classId, staticBuffer) + let expr = this.makeCallDirect(program.allocArrayInstance, [ + module.i32(length), + program.options.isWasm64 + ? module.i64(elementType.alignLog2) + : module.i32(elementType.alignLog2), + module.i32(arrayInstance.id), + program.options.isWasm64 + ? module.i64(i64_low(bufferAddress), i64_high(bufferAddress)) + : module.i32(i64_low(bufferAddress)) + ], reportNode); + this.currentType = arrayType; + return this.makeAutorelease(this.makeRetain(expr)); + } + } + + // otherwise compile an explicit instantiation with indexed sets var setter = arrayInstance.lookupOverload(OperatorKind.INDEXED_SET, true); if (!setter) { + flow.freeTempLocal(tempThis); + flow.freeTempLocal(tempDataStart); this.error( DiagnosticCode.Index_signature_in_type_0_only_permits_reading, reportNode.range, arrayInstance.internalName ); - return module.createUnreachable(); + this.currentType = arrayType; + return module.unreachable(); } var nativeArrayType = arrayType.toNativeType(); - var flow = this.currentFlow; - var tempLocal = flow.parentFunction.addLocal(arrayType); // can't reuse a temp (used in compiledValues) - var stmts = new Array(2 + length); - var index = 0; - stmts[index++] = module.createSetLocal(tempLocal.index, - this.makeCallDirect(assert(arrayInstance.constructorInstance), [ - module.createI32(0), // this - module.createI32(length) - ]) + + var stmts = new Array(); + // tempThis = makeArray(length, alignLog2, classId, source = 0) + stmts.push( + module.local_set(tempThis.index, + this.makeCallDirect(program.allocArrayInstance, [ + module.i32(length), + program.options.isWasm64 + ? module.i64(elementType.alignLog2) + : module.i32(elementType.alignLog2), + module.i32(arrayInstance.id), + program.options.isWasm64 + ? module.i64(0) + : module.i32(0) + ], reportNode), + ) ); - for (let i = 0; i < length; ++i) { - stmts[index++] = this.makeCallDirect(setter, [ - module.createGetLocal(tempLocal.index, nativeArrayType), // this - module.createI32(i), - compiledValues[i] - ]); + // tempData = tempThis.dataStart + var dataStart = assert(arrayInstance.lookupInSelf("dataStart")); + assert(dataStart.kind == ElementKind.FIELD); + stmts.push( + module.local_set(tempDataStart.index, + module.load(arrayType.byteSize, false, + module.local_get(tempThis.index, nativeArrayType), + nativeArrayType, + (dataStart).memoryOffset + ) + ) + ); + var isManaged = elementType.isManaged; + for (let i = 0, alignLog2 = elementType.alignLog2; i < length; ++i) { + let valueExpr = values[i]; + if (isManaged) { + // value = __retain(value) + valueExpr = this.makeRetain(valueExpr); + } + // store(tempData, value, immOffset) + stmts.push( + module.store(elementType.byteSize, + module.local_get(tempDataStart.index, nativeArrayType), + valueExpr, + nativeElementType, + i << alignLog2 + ) + ); } - assert(index + 1 == stmts.length); - stmts[index] = module.createGetLocal(tempLocal.index, nativeArrayType); - flow.freeTempLocal(tempLocal); // but can be reused now + // -> tempThis + stmts.push( + module.local_get(tempThis.index, nativeArrayType) + ); + flow.freeTempLocal(tempThis); + flow.freeTempLocal(tempDataStart); this.currentType = arrayType; - return module.createBlock(null, stmts, nativeArrayType); + return module.block(null, stmts, nativeArrayType); } compileObjectLiteral(expression: ObjectLiteralExpression, contextualType: Type): ExpressionRef { @@ -6646,7 +7640,7 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Type_0_is_not_assignable_to_type_1, expression.range, "", contextualType.toString() ); - return module.createUnreachable(); + return module.unreachable(); } // if present, check that the constructor is compatible with object literals @@ -6659,21 +7653,21 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Constructor_of_class_0_must_not_require_any_arguments, expression.range, classReference.toString() ); - return module.createUnreachable(); + return module.unreachable(); } if (ctor.is(CommonFlags.PRIVATE)) { this.error( DiagnosticCode.Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration, expression.range, classReference.toString() ); - return module.createUnreachable(); + return module.unreachable(); } if (ctor.is(CommonFlags.PROTECTED)) { this.error( DiagnosticCode.Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration, expression.range, classReference.toString() ); - return module.createUnreachable(); + return module.unreachable(); } } @@ -6685,7 +7679,7 @@ export class Compiler extends DiagnosticEmitter { var hasErrors = false; var exprs = new Array(numNames + 2); var flow = this.currentFlow; - var tempLocal = flow.getTempLocal(this.options.usizeType); + var tempLocal = flow.getAutoreleaseLocal(this.options.usizeType); assert(numNames == values.length); for (let i = 0, k = numNames; i < k; ++i) { let member = members ? members.get(names[i].text) : null; @@ -6698,30 +7692,37 @@ export class Compiler extends DiagnosticEmitter { continue; } let type = (member).type; - exprs[i + 1] = this.module.createStore( // TODO: handle setters as well + exprs[i + 1] = this.module.store( // TODO: handle setters as well type.byteSize, - this.module.createGetLocal(tempLocal.index, this.options.nativeSizeType), - this.compileExpression(values[i], (member).type, ConversionKind.IMPLICIT, WrapMode.NONE), + this.module.local_get(tempLocal.index, this.options.nativeSizeType), + this.compileExpression(values[i], (member).type, ContextualFlags.IMPLICIT), type.toNativeType(), (member).memoryOffset ); } this.currentType = classReference.type.nonNullableType; - if (hasErrors) return module.createUnreachable(); + if (hasErrors) return module.unreachable(); // allocate a new instance first and assign 'this' to the temp. local - exprs[0] = module.createSetLocal( + exprs[0] = module.local_set( tempLocal.index, - this.makeAllocation(classReference) + this.makeRetain( + this.makeAllocation(classReference) + ) ); // once all field values have been set, return 'this' - exprs[exprs.length - 1] = module.createGetLocal(tempLocal.index, this.options.nativeSizeType); + exprs[exprs.length - 1] = module.local_get(tempLocal.index, this.options.nativeSizeType); - return module.createBlock(null, exprs, this.options.nativeSizeType); + this.currentType = classReference.type; + return module.block(null, exprs, this.options.nativeSizeType); } - compileNewExpression(expression: NewExpression, contextualType: Type): ExpressionRef { + compileNewExpression( + expression: NewExpression, + contextualType: Type, + contextualFlags: ContextualFlags + ): ExpressionRef { var module = this.module; var flow = this.currentFlow; @@ -6730,13 +7731,13 @@ export class Compiler extends DiagnosticEmitter { expression.expression, flow ); - if (!target) return module.createUnreachable(); + if (!target) return module.unreachable(); if (target.kind != ElementKind.CLASS_PROTOTYPE) { this.error( DiagnosticCode.Cannot_use_new_with_an_expression_whose_type_lacks_a_construct_signature, expression.expression.range ); - return this.module.createUnreachable(); + return this.module.unreachable(); } var classPrototype = target; var classInstance: Class | null = null; @@ -6761,8 +7762,9 @@ export class Compiler extends DiagnosticEmitter { expression ); } - if (!classInstance) return module.createUnreachable(); - return this.compileInstantiate(classInstance, expression.arguments, expression); + if (!classInstance) return module.unreachable(); + if (contextualType == Type.void) contextualFlags |= ContextualFlags.WILL_DROP; + return this.compileInstantiate(classInstance, expression.arguments, contextualFlags, expression); } /** Gets the compiled constructor of the specified class or generates one if none is present. */ @@ -6811,7 +7813,8 @@ export class Compiler extends DiagnosticEmitter { instance.prototype.setResolvedInstance("", instance); classInstance.constructorInstance = instance; var previousFlow = this.currentFlow; - this.currentFlow = instance.flow; + var flow = instance.flow; + this.currentFlow = flow; // generate body var signature = instance.signature; @@ -6827,12 +7830,14 @@ export class Compiler extends DiagnosticEmitter { // return this // } stmts.push( - module.createIf( - module.createUnary(nativeSizeType == NativeType.I64 ? UnaryOp.EqzI64 : UnaryOp.EqzI32, - module.createGetLocal(0, nativeSizeType) + module.if( + module.unary(nativeSizeType == NativeType.I64 ? UnaryOp.EqzI64 : UnaryOp.EqzI32, + module.local_get(0, nativeSizeType) ), - module.createSetLocal(0, - this.makeAllocation(classInstance) + module.local_set(0, + this.makeRetain( + this.makeAllocation(classInstance) + ) ) ) ); @@ -6840,21 +7845,21 @@ export class Compiler extends DiagnosticEmitter { let parameterTypes = signature.parameterTypes; let numParameters = parameterTypes.length; let operands = new Array(1 + numParameters); - operands[0] = module.createGetLocal(0, nativeSizeType); + operands[0] = module.local_get(0, nativeSizeType); for (let i = 0; i < numParameters; ++i) { - operands[i + 1] = module.createGetLocal(i + 1, parameterTypes[i].toNativeType()); + operands[i + 1] = module.local_get(i + 1, parameterTypes[i].toNativeType()); } // TODO: base constructor might be inlined, but makeCallDirect can't do this stmts.push( - module.createSetLocal(0, - this.makeCallDirect(assert(baseClass.constructorInstance), operands) + module.local_set(0, + this.makeCallDirect(assert(baseClass.constructorInstance), operands, reportNode) ) ); } this.makeFieldInitialization(classInstance, stmts); - stmts.push( - module.createGetLocal(0, nativeSizeType) - ); + var body = this.performAutoreleasesWithValue(flow, module.local_get(0, nativeSizeType), classInstance.type, stmts); + flow.freeScopedLocals(); + this.currentFlow = previousFlow; // make the function var typeRef = this.ensureFunctionType(signature.parameterTypes, signature.returnType, signature.thisType); @@ -6865,41 +7870,35 @@ export class Compiler extends DiagnosticEmitter { if (numLocals > numOperands) { for (let i = numOperands; i < numLocals; ++i) varTypes.push(locals[i].type.toNativeType()); } - var funcRef = module.addFunction(instance.internalName, typeRef, varTypes, - stmts.length == 1 - ? stmts[0] - : module.createBlock(null, stmts, nativeSizeType) - ); + var funcRef = module.addFunction(instance.internalName, typeRef, varTypes, body); instance.finalize(module, funcRef); - this.currentFlow = previousFlow; return instance; } - compileInstantiate(classInstance: Class, argumentExpressions: Expression[], reportNode: Node): ExpressionRef { + compileInstantiate( + /** Class to instantiate. */ + classInstance: Class, + /** Constructor arguments. */ + argumentExpressions: Expression[], + /** Contextual flags. */ + contextualFlags: ContextualFlags, + /** Node to report on. */ + reportNode: Node + ): ExpressionRef { var ctor = this.ensureConstructor(classInstance, reportNode); - var expr = this.compileCallDirect( + var expr = this.compileCallDirect( // no need for another autoreleased local ctor, argumentExpressions, reportNode, - this.options.usizeType.toNativeZero(this.module) + this.options.usizeType.toNativeZero(this.module), + contextualFlags ); - this.currentType = classInstance.type; + if (getExpressionType(expr) != NativeType.None) { // possibly IMM_DROPPED + this.currentType = classInstance.type; // important because a super ctor could be called + } return expr; } - compileParenthesizedExpression( - expression: ParenthesizedExpression, - contextualType: Type - ): ExpressionRef { - // does not change types, just order - return this.compileExpression( - expression.expression, - contextualType, - ConversionKind.NONE, - WrapMode.NONE - ); - } - /** * Compiles a property access in the specified context. * @param retainConstantType Retains the type of inlined constants if `true`, otherwise @@ -6908,7 +7907,7 @@ export class Compiler extends DiagnosticEmitter { compilePropertyAccessExpression( propertyAccess: PropertyAccessExpression, contextualType: Type, - retainConstantType: bool + contextualFlags: ContextualFlags ): ExpressionRef { var module = this.module; var flow = this.currentFlow; @@ -6916,43 +7915,42 @@ export class Compiler extends DiagnosticEmitter { this.maybeCompileEnclosingSource(propertyAccess); var target = this.resolver.resolvePropertyAccessExpression(propertyAccess, flow, contextualType); // reports - if (!target) return module.createUnreachable(); + if (!target) return module.unreachable(); switch (target.kind) { case ElementKind.GLOBAL: { // static field if (!this.compileGlobal(target)) { // reports; not yet compiled if a static field - return module.createUnreachable(); + return module.unreachable(); } let globalType = (target).type; assert(globalType != Type.void); if ((target).is(CommonFlags.INLINED)) { - return this.compileInlineConstant(target, contextualType, retainConstantType); + return this.compileInlineConstant(target, contextualType, contextualFlags); } this.currentType = globalType; - return module.createGetGlobal((target).internalName, globalType.toNativeType()); + return module.global_get((target).internalName, globalType.toNativeType()); } case ElementKind.ENUMVALUE: { // enum value let theEnum = assert((target).parent); assert(theEnum.kind == ElementKind.ENUM); if (!this.compileEnum(theEnum)) { this.currentType = Type.i32; - return this.module.createUnreachable(); + return this.module.unreachable(); } this.currentType = Type.i32; if ((target).is(CommonFlags.INLINED)) { assert((target).constantValueKind == ConstantValueKind.INTEGER); - return module.createI32(i64_low((target).constantIntegerValue)); + return module.i32(i64_low((target).constantIntegerValue)); } - return module.createGetGlobal((target).internalName, NativeType.I32); + return module.global_get((target).internalName, NativeType.I32); } case ElementKind.FIELD: { // instance field assert((target).memoryOffset >= 0); let thisExpr = this.compileExpressionRetainType( assert(this.resolver.currentThisExpression), - this.options.usizeType, - WrapMode.NONE + this.options.usizeType ); this.currentType = (target).type; - return module.createLoad( + return module.load( (target).type.byteSize, (target).type.is(TypeFlags.SIGNED | TypeFlags.INTEGER), thisExpr, @@ -6966,15 +7964,14 @@ export class Compiler extends DiagnosticEmitter { let getter = this.resolver.resolveFunction(getterPrototype, null); if (getter) return this.compileCallDirect(getter, [], propertyAccess, 0); } - return module.createUnreachable(); + return module.unreachable(); } case ElementKind.PROPERTY: { // instance property let getterInstance = assert((target).getterInstance); return this.compileCallDirect(getterInstance, [], propertyAccess, this.compileExpressionRetainType( assert(this.resolver.currentThisExpression), - this.options.usizeType, - WrapMode.NONE + this.options.usizeType ) ); } @@ -6983,126 +7980,112 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Cannot_access_method_0_without_calling_it_as_it_requires_this_to_be_set, propertyAccess.range, (target).name ); - return module.createUnreachable(); + return module.unreachable(); } } this.error( DiagnosticCode.Operation_not_supported, propertyAccess.range ); - return module.createUnreachable(); - } - - private compileGetter(target: PropertyPrototype, reportNode: Node): ExpressionRef { - var prototype = target.getterPrototype; - if (prototype) { - let instance = this.resolver.resolveFunction(prototype, null); - if (!instance) return this.module.createUnreachable(); - let signature = instance.signature; - if (!this.checkCallSignature( // reports - signature, - 0, - instance.is(CommonFlags.INSTANCE), - reportNode - )) { - return this.module.createUnreachable(); - } - if (instance.is(CommonFlags.INSTANCE)) { - let classInstance = assert(instance.parent); assert(classInstance.kind == ElementKind.CLASS); - let thisExpression = assert(this.resolver.currentThisExpression); //!!! - let thisExpr = this.compileExpressionRetainType( - thisExpression, - this.options.usizeType, - WrapMode.NONE - ); - this.currentType = signature.returnType; - return this.compileCallDirect(instance, [], reportNode, thisExpr); - } else { - this.currentType = signature.returnType; - return this.compileCallDirect(instance, [], reportNode, 0); - } - } else { - this.error( - DiagnosticCode.Property_0_does_not_exist_on_type_1, - reportNode.range, (target).name, (target).parent.toString() - ); - return this.module.createUnreachable(); - } + return module.unreachable(); } - compileTernaryExpression(expression: TernaryExpression, contextualType: Type): ExpressionRef { + compileTernaryExpression( + expression: TernaryExpression, + contextualType: Type, + contextualFlags: ContextualFlags + ): ExpressionRef { var ifThen = expression.ifThen; var ifElse = expression.ifElse; var outerFlow = this.currentFlow; - var condExpr = this.makeIsTrueish( - this.compileExpressionRetainType(expression.condition, Type.bool, WrapMode.NONE), - this.currentType + var condExpr = this.module.precomputeExpression( + this.makeIsTrueish( + this.compileExpressionRetainType(expression.condition, Type.bool), + this.currentType + ) ); // Try to eliminate unnecesssary branches if the condition is constant - var condExprPrecomp = this.module.precomputeExpression(condExpr); if ( - getExpressionId(condExprPrecomp) == ExpressionId.Const && - getExpressionType(condExprPrecomp) == NativeType.I32 + getExpressionId(condExpr) == ExpressionId.Const && + getExpressionType(condExpr) == NativeType.I32 ) { - return getConstValueI32(condExprPrecomp) - ? this.compileExpressionRetainType(ifThen, contextualType, WrapMode.NONE) - : this.compileExpressionRetainType(ifElse, contextualType, WrapMode.NONE); - - // Otherwise recompile to the original and let the optimizer decide - } else /* if (condExpr != condExprPrecomp) <- not guaranteed */ { - condExpr = this.makeIsTrueish( - this.compileExpressionRetainType(expression.condition, Type.bool, WrapMode.NONE), - this.currentType - ); + return getConstValueI32(condExpr) + ? this.compileExpressionRetainType(ifThen, contextualType) + : this.compileExpressionRetainType(ifElse, contextualType); } var ifThenFlow = outerFlow.fork(); this.currentFlow = ifThenFlow; - var ifThenExpr = this.compileExpressionRetainType(ifThen, contextualType, WrapMode.NONE); + var ifThenExpr = this.compileExpressionRetainType(ifThen, contextualType, contextualFlags & ContextualFlags.SKIP_AUTORELEASE); var ifThenType = this.currentType; - ifThenFlow.freeScopedLocals(); + var IfThenAutoreleaseSkipped = this.skippedAutoreleases.has(ifThenExpr); var ifElseFlow = outerFlow.fork(); this.currentFlow = ifElseFlow; - var ifElseExpr = this.compileExpressionRetainType(ifElse, contextualType, WrapMode.NONE); + var ifElseExpr = this.compileExpressionRetainType(ifElse, contextualType, contextualFlags & ContextualFlags.SKIP_AUTORELEASE); var ifElseType = this.currentType; - ifElseFlow.freeScopedLocals(); - this.currentFlow = outerFlow; - - outerFlow.inheritMutual(ifThenFlow, ifElseFlow); + var ifElseAutoreleaseSkipped = this.skippedAutoreleases.has(ifElseExpr); var commonType = Type.commonDenominator(ifThenType, ifElseType, false); if (!commonType) { this.error( DiagnosticCode.Type_0_is_not_assignable_to_type_1, - expression.range, ifThenType.toString(), ifElseType.toString() + ifElse.range, ifElseType.toString(), ifThenType.toString() ); this.currentType = contextualType; - return this.module.createUnreachable(); + return this.module.unreachable(); } ifThenExpr = this.convertExpression( ifThenExpr, - ifThenType, - commonType, - ConversionKind.IMPLICIT, - WrapMode.NONE, + ifThenType, commonType, + false, false, ifThen ); ifElseExpr = this.convertExpression( ifElseExpr, - ifElseType, - commonType, - ConversionKind.IMPLICIT, - WrapMode.NONE, + ifElseType, commonType, + false, false, ifElse ); this.currentType = commonType; - return this.module.createIf(condExpr, ifThenExpr, ifElseExpr); + + if (IfThenAutoreleaseSkipped != ifElseAutoreleaseSkipped) { // unify to both skipped + if (!IfThenAutoreleaseSkipped) { + ifThenExpr = this.makeRetain(ifThenExpr); + IfThenAutoreleaseSkipped = true; + } else { + ifElseExpr = this.makeRetain(ifElseExpr); + ifElseAutoreleaseSkipped = true; + } + } else if (!IfThenAutoreleaseSkipped && commonType.isManaged) { // keep alive a little longer + // if (!(contextualFlags & ContextualFlags.SKIP_AUTORELEASE)) { + ifThenExpr = this.moveAutorelease(ifThenExpr, ifThenFlow, outerFlow); + ifElseExpr = this.moveAutorelease(ifElseExpr, ifElseFlow, outerFlow); + // } + } + + ifThenExpr = this.performAutoreleasesWithValue(ifThenFlow, ifThenExpr, commonType); + ifThenFlow.freeScopedLocals(); + + ifElseExpr = this.performAutoreleasesWithValue(ifElseFlow, ifElseExpr, commonType); + ifElseFlow.freeScopedLocals(); + + this.currentFlow = outerFlow; + outerFlow.inheritMutual(ifThenFlow, ifElseFlow); + + var expr = this.module.if(condExpr, ifThenExpr, ifElseExpr); + assert(IfThenAutoreleaseSkipped == ifElseAutoreleaseSkipped); + if (IfThenAutoreleaseSkipped) this.skippedAutoreleases.add(expr); + return expr; } - compileUnaryPostfixExpression(expression: UnaryPostfixExpression, contextualType: Type): ExpressionRef { + compileUnaryPostfixExpression( + expression: UnaryPostfixExpression, + contextualType: Type, + contextualFlags: ContextualFlags + ): ExpressionRef { var module = this.module; var flow = this.currentFlow; @@ -7112,30 +8095,27 @@ export class Compiler extends DiagnosticEmitter { contextualType == Type.void ? Type.i32 : contextualType, - ConversionKind.NONE, - WrapMode.NONE + ContextualFlags.NONE ); // shortcut if compiling the getter already failed if (getExpressionId(getValue) == ExpressionId.Unreachable) return getValue; - var currentType = this.currentType; - // if the value isn't dropped, a temp. local is required to remember the original value var tempLocal: Local | null = null; if (contextualType != Type.void) { - tempLocal = flow.getTempLocal(currentType, false); - getValue = module.createTeeLocal( + tempLocal = flow.getTempLocal(this.currentType); + getValue = module.local_tee( tempLocal.index, getValue ); } - var calcValue: ExpressionRef; + var expr: ExpressionRef; switch (expression.operator) { case Token.PLUS_PLUS: { - switch (currentType.kind) { + switch (this.currentType.kind) { case TypeKind.I8: case TypeKind.I16: case TypeKind.I32: @@ -7143,10 +8123,10 @@ export class Compiler extends DiagnosticEmitter { case TypeKind.U16: case TypeKind.U32: case TypeKind.BOOL: { - calcValue = module.createBinary( + expr = module.binary( BinaryOp.AddI32, getValue, - module.createI32(1) + module.i32(1) ); break; } @@ -7157,7 +8137,7 @@ export class Compiler extends DiagnosticEmitter { if (classReference) { let overload = classReference.lookupOverload(OperatorKind.POSTFIX_INC); if (overload) { - calcValue = this.compileUnaryOverload(overload, expression.operand, getValue, expression); + expr = this.compileUnaryOverload(overload, expression.operand, getValue, expression); break; } } @@ -7165,54 +8145,54 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Operation_not_supported, expression.range ); - return module.createUnreachable(); + return module.unreachable(); } } case TypeKind.ISIZE: { let options = this.options; - calcValue = module.createBinary( + expr = module.binary( options.isWasm64 ? BinaryOp.AddI64 : BinaryOp.AddI32, getValue, - currentType.toNativeOne(module) + this.currentType.toNativeOne(module) ); break; } case TypeKind.I64: case TypeKind.U64: { - calcValue = module.createBinary( + expr = module.binary( BinaryOp.AddI64, getValue, - module.createI64(1) + module.i64(1) ); break; } case TypeKind.F32: { - calcValue = module.createBinary( + expr = module.binary( BinaryOp.AddF32, getValue, - module.createF32(1) + module.f32(1) ); break; } case TypeKind.F64: { - calcValue = module.createBinary( + expr = module.binary( BinaryOp.AddF64, getValue, - module.createF64(1) + module.f64(1) ); break; } default: { assert(false); - return module.createUnreachable(); + return module.unreachable(); } } break; } case Token.MINUS_MINUS: { - switch (currentType.kind) { + switch (this.currentType.kind) { case TypeKind.I8: case TypeKind.I16: case TypeKind.I32: @@ -7220,10 +8200,10 @@ export class Compiler extends DiagnosticEmitter { case TypeKind.U16: case TypeKind.U32: case TypeKind.BOOL: { - calcValue = module.createBinary( + expr = module.binary( BinaryOp.SubI32, getValue, - module.createI32(1) + module.i32(1) ); break; } @@ -7234,7 +8214,7 @@ export class Compiler extends DiagnosticEmitter { if (classReference) { let overload = classReference.lookupOverload(OperatorKind.POSTFIX_DEC); if (overload) { - calcValue = this.compileUnaryOverload(overload, expression.operand, getValue, expression); + expr = this.compileUnaryOverload(overload, expression.operand, getValue, expression); break; } } @@ -7242,70 +8222,84 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Operation_not_supported, expression.range ); - return module.createUnreachable(); + return module.unreachable(); } } case TypeKind.ISIZE: { let options = this.options; - calcValue = module.createBinary( + expr = module.binary( options.isWasm64 ? BinaryOp.SubI64 : BinaryOp.SubI32, getValue, - currentType.toNativeOne(module) + this.currentType.toNativeOne(module) ); break; } case TypeKind.I64: case TypeKind.U64: { - calcValue = module.createBinary( + expr = module.binary( BinaryOp.SubI64, getValue, - module.createI64(1) + module.i64(1) ); break; } case TypeKind.F32: { - calcValue = module.createBinary( + expr = module.binary( BinaryOp.SubF32, getValue, - module.createF32(1) + module.f32(1) ); break; } case TypeKind.F64: { - calcValue = module.createBinary( + expr = module.binary( BinaryOp.SubF64, getValue, - module.createF64(1) + module.f64(1) ); break; } default: { assert(false); - return module.createUnreachable(); + return module.unreachable(); } } break; } default: { assert(false); - return module.createUnreachable(); + return module.unreachable(); } } + var resolver = this.resolver; + var target = resolver.resolveExpression(expression.operand, flow); // reports + // simplify if dropped anyway if (!tempLocal) { this.currentType = Type.void; - return this.compileAssignmentWithValue(expression.operand, - calcValue, + if (!target) return module.unreachable(); + return this.makeAssignment( + target, + expr, + expression.operand, + resolver.currentThisExpression, + resolver.currentElementExpression, false ); + } else if (!target) { + return module.unreachable(); } // otherwise use the temp. local for the intermediate value (always possibly overflows) - var setValue = this.compileAssignmentWithValue(expression.operand, - calcValue, // also tees getValue to tempLocal + var setValue = this.makeAssignment( + target, + expr, // includes a tee of getValue to tempLocal + expression.operand, + resolver.currentThisExpression, + resolver.currentElementExpression, false ); @@ -7313,15 +8307,16 @@ export class Compiler extends DiagnosticEmitter { flow.freeTempLocal(tempLocal); var nativeType = tempLocal.type.toNativeType(); - return module.createBlock(null, [ + return module.block(null, [ setValue, - module.createGetLocal(tempLocal.index, nativeType) + module.local_get(tempLocal.index, nativeType) ], nativeType); // result of 'x++' / 'x--' might overflow } compileUnaryPrefixExpression( expression: UnaryPrefixExpression, - contextualType: Type + contextualType: Type, + contextualFlags: ContextualFlags ): ExpressionRef { var module = this.module; var compound = false; @@ -7334,8 +8329,7 @@ export class Compiler extends DiagnosticEmitter { contextualType == Type.void ? Type.i32 : contextualType, - ConversionKind.NONE, - WrapMode.NONE + ContextualFlags.NONE ); // check operator overload @@ -7352,7 +8346,7 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Operation_not_supported, expression.range ); - return module.createUnreachable(); + return module.unreachable(); } // nop @@ -7364,7 +8358,7 @@ export class Compiler extends DiagnosticEmitter { (expression.operand).literalKind == LiteralKind.FLOAT )) { // implicitly negate integer and float literals. also enables proper checking of literal ranges. - expr = this.compileLiteralExpression(expression.operand, contextualType, true); + expr = this.compileLiteralExpression(expression.operand, contextualType, ContextualFlags.NONE, true); // compileExpression normally does this: if (this.options.sourceMap) this.addDebugLocation(expr, expression.range); break; @@ -7375,8 +8369,7 @@ export class Compiler extends DiagnosticEmitter { contextualType == Type.void ? Type.i32 : contextualType, - ConversionKind.NONE, - WrapMode.NONE + ContextualFlags.NONE ); // check operator overload @@ -7393,7 +8386,7 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Operation_not_supported, expression.range ); - return module.createUnreachable(); + return module.unreachable(); } switch (this.currentType.kind) { @@ -7404,12 +8397,12 @@ export class Compiler extends DiagnosticEmitter { case TypeKind.U16: case TypeKind.U32: case TypeKind.BOOL: { - expr = module.createBinary(BinaryOp.SubI32, module.createI32(0), expr); + expr = module.binary(BinaryOp.SubI32, module.i32(0), expr); break; } case TypeKind.USIZE: case TypeKind.ISIZE: { - expr = module.createBinary( + expr = module.binary( this.options.isWasm64 ? BinaryOp.SubI64 : BinaryOp.SubI32, @@ -7420,20 +8413,20 @@ export class Compiler extends DiagnosticEmitter { } case TypeKind.I64: case TypeKind.U64: { - expr = module.createBinary(BinaryOp.SubI64, module.createI64(0), expr); + expr = module.binary(BinaryOp.SubI64, module.i64(0), expr); break; } case TypeKind.F32: { - expr = module.createUnary(UnaryOp.NegF32, expr); + expr = module.unary(UnaryOp.NegF32, expr); break; } case TypeKind.F64: { - expr = module.createUnary(UnaryOp.NegF64, expr); + expr = module.unary(UnaryOp.NegF64, expr); break; } default: { assert(false); - expr = module.createUnreachable(); + expr = module.unreachable(); } } break; @@ -7445,8 +8438,7 @@ export class Compiler extends DiagnosticEmitter { contextualType == Type.void ? Type.i32 : contextualType, - ConversionKind.NONE, - WrapMode.NONE + ContextualFlags.NONE ); // check operator overload @@ -7463,7 +8455,7 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Operation_not_supported, expression.range ); - return module.createUnreachable(); + return module.unreachable(); } switch (this.currentType.kind) { @@ -7474,12 +8466,12 @@ export class Compiler extends DiagnosticEmitter { case TypeKind.U16: case TypeKind.U32: case TypeKind.BOOL: { - expr = module.createBinary(BinaryOp.AddI32, expr, this.module.createI32(1)); + expr = module.binary(BinaryOp.AddI32, expr, this.module.i32(1)); break; } case TypeKind.USIZE: case TypeKind.ISIZE: { - expr = module.createBinary( + expr = module.binary( this.options.isWasm64 ? BinaryOp.AddI64 : BinaryOp.AddI32, @@ -7490,20 +8482,20 @@ export class Compiler extends DiagnosticEmitter { } case TypeKind.I64: case TypeKind.U64: { - expr = module.createBinary(BinaryOp.AddI64, expr, module.createI64(1)); + expr = module.binary(BinaryOp.AddI64, expr, module.i64(1)); break; } case TypeKind.F32: { - expr = module.createBinary(BinaryOp.AddF32, expr, module.createF32(1)); + expr = module.binary(BinaryOp.AddF32, expr, module.f32(1)); break; } case TypeKind.F64: { - expr = module.createBinary(BinaryOp.AddF64, expr, module.createF64(1)); + expr = module.binary(BinaryOp.AddF64, expr, module.f64(1)); break; } default: { assert(false); - expr = module.createUnreachable(); + expr = module.unreachable(); } } break; @@ -7515,8 +8507,7 @@ export class Compiler extends DiagnosticEmitter { contextualType == Type.void ? Type.i32 : contextualType, - ConversionKind.NONE, - WrapMode.NONE + ContextualFlags.NONE ); // check operator overload @@ -7533,7 +8524,7 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Operation_not_supported, expression.range ); - return module.createUnreachable(); + return module.unreachable(); } switch (this.currentType.kind) { @@ -7544,12 +8535,12 @@ export class Compiler extends DiagnosticEmitter { case TypeKind.U16: case TypeKind.U32: case TypeKind.BOOL: { - expr = module.createBinary(BinaryOp.SubI32, expr, module.createI32(1)); + expr = module.binary(BinaryOp.SubI32, expr, module.i32(1)); break; } case TypeKind.USIZE: case TypeKind.ISIZE: { - expr = module.createBinary( + expr = module.binary( this.options.isWasm64 ? BinaryOp.SubI64 : BinaryOp.SubI32, @@ -7560,20 +8551,20 @@ export class Compiler extends DiagnosticEmitter { } case TypeKind.I64: case TypeKind.U64: { - expr = module.createBinary(BinaryOp.SubI64, expr, module.createI64(1)); + expr = module.binary(BinaryOp.SubI64, expr, module.i64(1)); break; } case TypeKind.F32: { - expr = module.createBinary(BinaryOp.SubF32, expr, module.createF32(1)); + expr = module.binary(BinaryOp.SubF32, expr, module.f32(1)); break; } case TypeKind.F64: { - expr = module.createBinary(BinaryOp.SubF64, expr, module.createF64(1)); + expr = module.binary(BinaryOp.SubF64, expr, module.f64(1)); break; } default: { assert(false); - expr = module.createUnreachable(); + expr = module.unreachable(); } } break; @@ -7584,8 +8575,7 @@ export class Compiler extends DiagnosticEmitter { contextualType == Type.void ? Type.i32 : contextualType, - ConversionKind.NONE, - WrapMode.NONE + ContextualFlags.NONE ); // check operator overload @@ -7613,8 +8603,7 @@ export class Compiler extends DiagnosticEmitter { : contextualType.is(TypeFlags.FLOAT) ? Type.i64 : contextualType, - ConversionKind.NONE, - WrapMode.NONE + ContextualFlags.NONE ); // check operator overload @@ -7631,12 +8620,11 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Operation_not_supported, expression.range ); - return module.createUnreachable(); + return module.unreachable(); } else { - expr = this.convertExpression( - expr, + expr = this.convertExpression(expr, this.currentType, this.currentType.intType, - ConversionKind.IMPLICIT, WrapMode.NONE, + false, false, expression.operand ); } @@ -7649,12 +8637,12 @@ export class Compiler extends DiagnosticEmitter { case TypeKind.U16: case TypeKind.U32: case TypeKind.BOOL: { - expr = module.createBinary(BinaryOp.XorI32, expr, module.createI32(-1)); + expr = module.binary(BinaryOp.XorI32, expr, module.i32(-1)); break; } case TypeKind.USIZE: case TypeKind.ISIZE: { - expr = module.createBinary( + expr = module.binary( this.options.isWasm64 ? BinaryOp.XorI64 : BinaryOp.XorI32, @@ -7665,12 +8653,12 @@ export class Compiler extends DiagnosticEmitter { } case TypeKind.I64: case TypeKind.U64: { - expr = module.createBinary(BinaryOp.XorI64, expr, module.createI64(-1, -1)); + expr = module.binary(BinaryOp.XorI64, expr, module.i64(-1, -1)); break; } default: { assert(false); - expr = module.createUnreachable(); + expr = module.unreachable(); } } break; @@ -7680,16 +8668,25 @@ export class Compiler extends DiagnosticEmitter { DiagnosticCode.Operation_not_supported, expression.range ); - return module.createUnreachable(); + return module.unreachable(); } default: { assert(false); - return module.createUnreachable(); + return module.unreachable(); } } - return compound - ? this.compileAssignmentWithValue(expression.operand, expr, contextualType != Type.void) - : expr; + if (!compound) return expr; + var resolver = this.resolver; + var target = resolver.resolveExpression(expression.operand, this.currentFlow); + if (!target) return module.unreachable(); + return this.makeAssignment( + target, + expr, + expression.operand, + resolver.currentThisExpression, + resolver.currentElementExpression, + contextualType != Type.void + ); } /** Makes sure that a 32-bit integer value is wrapped to a valid value of the specified type. */ @@ -7700,13 +8697,13 @@ export class Compiler extends DiagnosticEmitter { case TypeKind.I8: { if (flow.canOverflow(expr, type)) { expr = this.options.hasFeature(Feature.SIGN_EXTENSION) - ? module.createUnary(UnaryOp.ExtendI8ToI32, expr) - : module.createBinary(BinaryOp.ShrI32, - module.createBinary(BinaryOp.ShlI32, + ? module.unary(UnaryOp.ExtendI8ToI32, expr) + : module.binary(BinaryOp.ShrI32, + module.binary(BinaryOp.ShlI32, expr, - module.createI32(24) + module.i32(24) ), - module.createI32(24) + module.i32(24) ); } break; @@ -7714,31 +8711,31 @@ export class Compiler extends DiagnosticEmitter { case TypeKind.I16: { if (flow.canOverflow(expr, type)) { expr = this.options.hasFeature(Feature.SIGN_EXTENSION) - ? module.createUnary(UnaryOp.ExtendI16ToI32, expr) - : module.createBinary(BinaryOp.ShrI32, - module.createBinary(BinaryOp.ShlI32, + ? module.unary(UnaryOp.ExtendI16ToI32, expr) + : module.binary(BinaryOp.ShrI32, + module.binary(BinaryOp.ShlI32, expr, - module.createI32(16) + module.i32(16) ), - module.createI32(16) + module.i32(16) ); } break; } case TypeKind.U8: { if (flow.canOverflow(expr, type)) { - expr = module.createBinary(BinaryOp.AndI32, + expr = module.binary(BinaryOp.AndI32, expr, - module.createI32(0xff) + module.i32(0xff) ); } break; } case TypeKind.U16: { if (flow.canOverflow(expr, type)) { - expr = module.createBinary(BinaryOp.AndI32, + expr = module.binary(BinaryOp.AndI32, expr, - module.createI32(0xffff) + module.i32(0xffff) ); } break; @@ -7746,9 +8743,9 @@ export class Compiler extends DiagnosticEmitter { case TypeKind.BOOL: { if (flow.canOverflow(expr, type)) { // bool is special in that it compares to 0 instead of masking with 0x1 - expr = module.createBinary(BinaryOp.NeI32, + expr = module.binary(BinaryOp.NeI32, expr, - module.createI32(0) + module.i32(0) ); } break; @@ -7757,6 +8754,17 @@ export class Compiler extends DiagnosticEmitter { return expr; } + /** Adds the debug location of the specified expression at the specified range to the source map. */ + addDebugLocation(expr: ExpressionRef, range: Range): void { + var parentFunction = this.currentFlow.parentFunction; + var source = range.source; + if (source.debugInfoIndex < 0) source.debugInfoIndex = this.module.addDebugInfoFile(source.normalizedPath); + range.debugInfoRef = expr; + parentFunction.debugLocations.push(range); + } + + // === Specialized code generation ============================================================== + /** Creates a comparison whether an expression is 'false' in a broader sense. */ makeIsFalseish(expr: ExpressionRef, type: Type): ExpressionRef { var module = this.module; @@ -7771,25 +8779,25 @@ export class Compiler extends DiagnosticEmitter { } case TypeKind.I32: case TypeKind.U32: { - return module.createUnary(UnaryOp.EqzI32, expr); + return module.unary(UnaryOp.EqzI32, expr); } case TypeKind.I64: case TypeKind.U64: { - return module.createUnary(UnaryOp.EqzI64, expr); + return module.unary(UnaryOp.EqzI64, expr); } - case TypeKind.USIZE: // TODO: strings? + case TypeKind.USIZE: if (this.skippedAutoreleases.has(expr)) expr = this.makeAutorelease(expr); case TypeKind.ISIZE: { - return module.createUnary(type.size == 64 ? UnaryOp.EqzI64 : UnaryOp.EqzI32, expr); + return module.unary(type.size == 64 ? UnaryOp.EqzI64 : UnaryOp.EqzI32, expr); } case TypeKind.F32: { - return module.createBinary(BinaryOp.EqF32, expr, module.createF32(0)); + return module.binary(BinaryOp.EqF32, expr, module.f32(0)); } case TypeKind.F64: { - return module.createBinary(BinaryOp.EqF64, expr, module.createF64(0)); + return module.binary(BinaryOp.EqF64, expr, module.f64(0)); } default: { assert(false); - return module.createI32(1); + return module.i32(1); } } } @@ -7801,80 +8809,67 @@ export class Compiler extends DiagnosticEmitter { case TypeKind.I8: case TypeKind.I16: case TypeKind.U8: - case TypeKind.U16: - case TypeKind.BOOL: { + case TypeKind.U16: { expr = this.ensureSmallIntegerWrap(expr, type); // fall-through } + case TypeKind.BOOL: // not a mask, just != 0 case TypeKind.I32: case TypeKind.U32: { return expr; } case TypeKind.I64: case TypeKind.U64: { - return module.createBinary(BinaryOp.NeI64, expr, module.createI64(0)); + return module.binary(BinaryOp.NeI64, expr, module.i64(0)); } - case TypeKind.USIZE: // TODO: strings? + case TypeKind.USIZE: if (this.skippedAutoreleases.has(expr)) expr = this.makeAutorelease(expr); case TypeKind.ISIZE: { return type.size == 64 - ? module.createBinary(BinaryOp.NeI64, expr, module.createI64(0)) + ? module.binary(BinaryOp.NeI64, expr, module.i64(0)) : expr; } case TypeKind.F32: { - return module.createBinary(BinaryOp.NeF32, expr, module.createF32(0)); + return module.binary(BinaryOp.NeF32, expr, module.f32(0)); } case TypeKind.F64: { - return module.createBinary(BinaryOp.NeF64, expr, module.createF64(0)); + return module.binary(BinaryOp.NeF64, expr, module.f64(0)); } default: { assert(false); - return module.createI32(0); + return module.i32(0); } } } /** Makes an allocation suitable to hold the data of an instance of the given class. */ - makeAllocation(classInstance: Class): ExpressionRef { + makeAllocation( + classInstance: Class + ): ExpressionRef { + // TODO: investigate if it's possible to allocate with RC=1 immediately var program = this.program; assert(classInstance.program == program); var module = this.module; var options = this.options; - - // __gc_allocate(size, markFn) - if (program.hasGC && classInstance.type.isManaged(program)) { - let allocateInstance = assert(program.gcAllocateInstance); - if (!this.compileFunction(allocateInstance)) return module.createUnreachable(); - this.currentType = classInstance.type; - return module.createCall( - allocateInstance.internalName, [ - options.isWasm64 - ? module.createI64(classInstance.currentMemoryOffset) - : module.createI32(classInstance.currentMemoryOffset), - module.createI32( - ensureGCHook(this, classInstance) - ) - ], - options.nativeSizeType - ); - - // memory.allocate(size) - } else { - let allocateInstance = program.memoryAllocateInstance; - if (!allocateInstance || !this.compileFunction(allocateInstance)) return module.createUnreachable(); - this.currentType = classInstance.type; - return module.createCall( - allocateInstance.internalName, [ - options.isWasm64 - ? module.createI64(classInstance.currentMemoryOffset) - : module.createI32(classInstance.currentMemoryOffset) - ], - options.nativeSizeType - ); - } + this.currentType = classInstance.type; + var allocInstance = program.allocInstance; + this.compileFunction(allocInstance); + return module.call(allocInstance.internalName, [ + options.isWasm64 + ? module.i64(classInstance.currentMemoryOffset) + : module.i32(classInstance.currentMemoryOffset), + module.i32( + classInstance.hasDecorator(DecoratorFlags.UNMANAGED) + ? 0 + : classInstance.id + ) + ], options.nativeSizeType); } /** Makes the initializers for a class's fields. */ - makeFieldInitialization(classInstance: Class, stmts: ExpressionRef[] = []): ExpressionRef[] { + makeFieldInitialization( + classInstance: Class, + stmts: ExpressionRef[] = [] + ): ExpressionRef[] { var members = classInstance.members; if (!members) return []; @@ -7897,15 +8892,16 @@ export class Compiler extends DiagnosticEmitter { let nativeFieldType = fieldType.toNativeType(); let initializerNode = field.prototype.initializerNode; if (initializerNode) { // use initializer + let initExpr = this.compileExpression(initializerNode, fieldType, // reports + ContextualFlags.IMPLICIT | ContextualFlags.SKIP_AUTORELEASE + ); + if (fieldType.isManaged && !this.skippedAutoreleases.has(initExpr)) { + initExpr = this.makeRetain(initExpr); + } stmts.push( - module.createStore(fieldType.byteSize, - module.createGetLocal(thisLocalIndex, nativeSizeType), - this.compileExpression( // reports - initializerNode, - fieldType, - ConversionKind.IMPLICIT, - WrapMode.NONE - ), + module.store(fieldType.byteSize, + module.local_get(thisLocalIndex, nativeSizeType), + initExpr, nativeFieldType, field.memoryOffset ) @@ -7913,10 +8909,10 @@ export class Compiler extends DiagnosticEmitter { } else { let parameterIndex = field.prototype.parameterIndex; stmts.push( - module.createStore(fieldType.byteSize, - module.createGetLocal(thisLocalIndex, nativeSizeType), + module.store(fieldType.byteSize, + module.local_get(thisLocalIndex, nativeSizeType), parameterIndex >= 0 // initialized via parameter (here: a local) - ? module.createGetLocal( + ? module.local_get( isInline ? assert(flow.lookupLocal(field.name)).index : 1 + parameterIndex, // this is local 0 @@ -7932,13 +8928,41 @@ export class Compiler extends DiagnosticEmitter { return stmts; } - /** Adds the debug location of the specified expression at the specified range to the source map. */ - addDebugLocation(expr: ExpressionRef, range: Range): void { - var parentFunction = this.currentFlow.parentFunction; - var source = range.source; - if (source.debugInfoIndex < 0) source.debugInfoIndex = this.module.addDebugInfoFile(source.normalizedPath); - range.debugInfoRef = expr; - parentFunction.debugLocations.push(range); + makeInstanceOfClass( + expr: ExpressionRef, + classInstance: Class + ): ExpressionRef { + var module = this.module; + var flow = this.currentFlow; + var idTemp = flow.getTempLocal(Type.i32); + var idExpr = module.load(4, false, + module.binary(BinaryOp.SubI32, + expr, + module.i32(this.program.runtimeHeaderSize) + ), + NativeType.I32 + ); + var label = "instanceof_" + classInstance.name + "|" + flow.pushBreakLabel(); + var conditions: ExpressionRef[] = []; + conditions.push( + module.drop( // br_if returns the value too + module.br(label, + module.binary(BinaryOp.EqI32, // classId == class.id + module.local_tee(idTemp.index, idExpr), + module.i32(classInstance.id) + ), + module.i32(1) // ? true + ) + ) + ); + // TODO: insert conditions for all possible subclasses (i.e. cat is also animal) + // TODO: simplify if there are none + conditions.push( + module.i32(0) // : false + ); + flow.freeTempLocal(idTemp); + flow.popBreakLabel(); + return module.block(label, conditions, NativeType.I32); } } @@ -8000,12 +9024,14 @@ function mangleImportName( var mangleImportName_moduleName: string; var mangleImportName_elementName: string; -/** Special compiler symbols. */ -namespace CompilerSymbols { - /** Module started global. Used if an explicit start function is present. */ - export const started = "~lib/started"; - /** Argument count global. Used to call trampolines for varargs functions. */ - export const argc = "~lib/argc"; - /** Argument count setter. Exported for use by host calls. */ - export const setargc = "~lib/setargc"; +/** Flattens a series of expressions to a nop, a single statement or a block depending on statement count. */ +export function flatten(module: Module, stmts: ExpressionRef[], type: NativeType): ExpressionRef { + var length = stmts.length; + if (length == 0) return module.nop(); // usually filtered out again + if (length == 1) return stmts[0]; + return module.block(null, stmts, + type == NativeType.Auto + ? getExpressionType(stmts[length - 1]) + : type + ); } diff --git a/src/decompiler.ts b/src/decompiler.ts index b0f586629d..774c8fb804 100644 --- a/src/decompiler.ts +++ b/src/decompiler.ts @@ -30,9 +30,9 @@ import { getLoopBody, getBreakName, getBreakCondition, - getGetLocalIndex, - getSetLocalIndex, - getSetLocalValue, + getLocalGetIndex, + getLocalSetIndex, + getLocalSetValue, getLoadOffset, getLoadPtr, getStoreOffset, @@ -173,20 +173,20 @@ export class Decompiler { case ExpressionId.CallIndirect: { throw new Error("not implemented"); } - case ExpressionId.GetLocal: { + case ExpressionId.LocalGet: { this.push("$"); - this.push(getGetLocalIndex(expr).toString(10)); + this.push(getLocalGetIndex(expr).toString(10)); return; } - case ExpressionId.SetLocal: { + case ExpressionId.LocalSet: { this.push("$"); - this.push(getSetLocalIndex(expr).toString(10)); + this.push(getLocalSetIndex(expr).toString(10)); this.push(" = "); - this.decompileExpression(getSetLocalValue(expr)); + this.decompileExpression(getLocalSetValue(expr)); return; } - case ExpressionId.GetGlobal: - case ExpressionId.SetGlobal: { + case ExpressionId.GlobalGet: + case ExpressionId.GlobalSet: { throw new Error("not implemented"); } case ExpressionId.Load: { @@ -832,11 +832,11 @@ export class Decompiler { } case ExpressionId.Host: { switch (getHostOp(expr)) { - case HostOp.CurrentMemory: { + case HostOp.MemorySize: { this.push("memory.size()"); return; } - case HostOp.GrowMemory: { + case HostOp.MemoryGrow: { this.push("memory.grow("); this.decompileExpression(getHostOperand(expr, 0)); this.push(")"); diff --git a/src/definitions.ts b/src/definitions.ts index 1ef6e38128..990a079b41 100644 --- a/src/definitions.ts +++ b/src/definitions.ts @@ -3,7 +3,7 @@ * @module definitions *//***/ -import { + import { CommonFlags } from "./common"; @@ -23,7 +23,8 @@ import { ConstantValueKind, Interface, Property, - PropertyPrototype + PropertyPrototype, + File } from "./program"; import { @@ -42,10 +43,8 @@ abstract class ExportsWalker { program: Program; /** Whether to include private members */ includePrivate: bool; - /** Elements still to do. */ - todo: Element[] = []; /** Already seen elements. */ - seen: Set = new Set(); + seen: Map = new Map(); /** Constructs a new Element walker. */ constructor(program: Program, includePrivate: bool = false) { @@ -56,57 +55,66 @@ abstract class ExportsWalker { /** Walks all elements and calls the respective handlers. */ walk(): void { for (let file of this.program.filesByName.values()) { - let members = file.members; - if (!members) continue; - for (let member of members.values()) { - // FIXME: doesn't honor the actual externally visible name - this.visitElement(member); - } + if (file.source.isEntry) this.visitFile(file); + } + } + + /** Visits all exported elements of a file. */ + visitFile(file: File): void { + var members = file.exports; + if (members) { + for (let [name, member] of members) this.visitElement(name, member); + } + var exportsStar = file.exportsStar; + if (exportsStar) { + for (let exportStar of exportsStar) this.visitFile(exportStar); } - var todo = this.todo; - for (let i = 0; i < todo.length; ) this.visitElement(todo[i]); } /** Visits an element.*/ - visitElement(element: Element): void { + visitElement(name: string, element: Element): void { if (element.is(CommonFlags.PRIVATE) && !this.includePrivate) return; - if (this.seen.has(element)) return; - this.seen.add(element); + var seen = this.seen; + if (seen.has(element)) { + this.visitAlias(name, element, seen.get(element)); + return; + } + seen.set(element, name); switch (element.kind) { case ElementKind.GLOBAL: { - if (element.is(CommonFlags.COMPILED)) this.visitGlobal(element); + if (element.is(CommonFlags.COMPILED)) this.visitGlobal(name, element); break; } case ElementKind.ENUM: { - if (element.is(CommonFlags.COMPILED)) this.visitEnum(element); + if (element.is(CommonFlags.COMPILED)) this.visitEnum(name, element); break; } case ElementKind.FUNCTION_PROTOTYPE: { - this.visitFunctionInstances(element); + this.visitFunctionInstances(name, element); break; } case ElementKind.CLASS_PROTOTYPE: { - this.visitClassInstances(element); + this.visitClassInstances(name, element); break; } case ElementKind.FIELD: { - if ((element).is(CommonFlags.COMPILED)) this.visitField(element); + if ((element).is(CommonFlags.COMPILED)) this.visitField(name, element); break; } case ElementKind.PROPERTY_PROTOTYPE: { - this.visitPropertyInstances(element); + this.visitPropertyInstances(name, element); break; } case ElementKind.PROPERTY: { let prop = element; let getter = prop.getterInstance; - if (getter) this.visitFunction(getter); + if (getter) this.visitFunction(name, getter); let setter = prop.setterInstance; - if (setter) this.visitFunction(setter); + if (setter) this.visitFunction(name, setter); break; } case ElementKind.NAMESPACE: { - if (hasCompiledMember(element)) this.visitNamespace(element); + if (hasCompiledMember(element)) this.visitNamespace(name, element); break; } case ElementKind.TYPEDEFINITION: break; @@ -114,25 +122,25 @@ abstract class ExportsWalker { } } - private visitFunctionInstances(element: FunctionPrototype): void { + private visitFunctionInstances(name: string, element: FunctionPrototype): void { var instances = element.instances; if (instances) { for (let instance of instances.values()) { - if (instance.is(CommonFlags.COMPILED)) this.visitFunction(instance); + if (instance.is(CommonFlags.COMPILED)) this.visitFunction(name, instance); } } } - private visitClassInstances(element: ClassPrototype): void { + private visitClassInstances(name: string, element: ClassPrototype): void { var instances = element.instances; if (instances) { for (let instance of instances.values()) { - if (instance.is(CommonFlags.COMPILED)) this.visitClass(instance); + if (instance.is(CommonFlags.COMPILED)) this.visitClass(name, instance); } } } - private visitPropertyInstances(element: PropertyPrototype): void { + private visitPropertyInstances(name: string, element: PropertyPrototype): void { // var instances = element.instances; // if (instances) { // for (let instance of instances.values()) { @@ -142,13 +150,14 @@ abstract class ExportsWalker { assert(false); } - abstract visitGlobal(element: Global): void; - abstract visitEnum(element: Enum): void; - abstract visitFunction(element: Function): void; - abstract visitClass(element: Class): void; - abstract visitInterface(element: Interface): void; - abstract visitField(element: Field): void; - abstract visitNamespace(element: Element): void; + abstract visitGlobal(name: string, element: Global): void; + abstract visitEnum(name: string, element: Enum): void; + abstract visitFunction(name: string, element: Function): void; + abstract visitClass(name: string, element: Class): void; + abstract visitInterface(name: string, element: Interface): void; + abstract visitField(name: string, element: Field): void; + abstract visitNamespace(name: string, element: Element): void; + abstract visitAlias(name: string, element: Element, originalName: string): void; } /** A WebIDL definitions builder. */ @@ -167,14 +176,14 @@ export class IDLBuilder extends ExportsWalker { super(program, includePrivate); } - visitGlobal(element: Global): void { + visitGlobal(name: string, element: Global): void { var sb = this.sb; var isConst = element.is(CommonFlags.INLINED); indent(sb, this.indentLevel); if (isConst) sb.push("const "); sb.push(this.typeToString(element.type)); sb.push(" "); - sb.push(element.name); + sb.push(name); if (isConst) { switch (element.constantValueKind) { case ConstantValueKind.INTEGER: { @@ -193,11 +202,11 @@ export class IDLBuilder extends ExportsWalker { sb.push(";\n"); } - visitEnum(element: Enum): void { + visitEnum(name: string, element: Enum): void { var sb = this.sb; indent(sb, this.indentLevel++); sb.push("interface "); - sb.push(element.name); + sb.push(name); sb.push(" {\n"); var members = element.members; if (members) { @@ -218,20 +227,20 @@ export class IDLBuilder extends ExportsWalker { } } for (let member of members.values()) { - if (member.kind != ElementKind.ENUMVALUE) this.visitElement(member); + if (member.kind != ElementKind.ENUMVALUE) this.visitElement(member.name, member); } } indent(sb, --this.indentLevel); sb.push("}\n"); } - visitFunction(element: Function): void { + visitFunction(name: string, element: Function): void { var sb = this.sb; var signature = element.signature; indent(sb, this.indentLevel); sb.push(this.typeToString(signature.returnType)); sb.push(" "); - sb.push(element.name); + sb.push(name); sb.push("("); var parameters = signature.parameterTypes; var numParameters = parameters.length; @@ -250,45 +259,49 @@ export class IDLBuilder extends ExportsWalker { sb.push("interface "); sb.push(element.name); sb.push(" {\n"); - for (let member of members.values()) this.visitElement(member); + for (let member of members.values()) this.visitElement(member.name, member); indent(sb, --this.indentLevel); sb.push("}\n"); } } - visitClass(element: Class): void { + visitClass(name: string, element: Class): void { var sb = this.sb; indent(sb, this.indentLevel++); sb.push("interface "); - sb.push(element.name); + sb.push(name); sb.push(" {\n"); // TODO indent(sb, --this.indentLevel); sb.push("}\n"); } - visitInterface(element: Interface): void { - this.visitClass(element); + visitInterface(name: string, element: Interface): void { + this.visitClass(name, element); } - visitField(element: Field): void { + visitField(name: string, element: Field): void { // TODO } - visitNamespace(element: Namespace): void { + visitNamespace(name: string, element: Namespace): void { var sb = this.sb; indent(sb, this.indentLevel++); sb.push("interface "); - sb.push(element.name); + sb.push(name); sb.push(" {\n"); var members = element.members; if (members) { - for (let member of members.values()) this.visitElement(member); + for (let member of members.values()) this.visitElement(member.name, member); } indent(sb, --this.indentLevel); sb.push("}\n"); } + visitAlias(name: string, element: Element, originalName: string): void { + // TODO + } + typeToString(type: Type): string { switch (type.kind) { case TypeKind.I8: return "byte"; @@ -335,13 +348,14 @@ export class TSDBuilder extends ExportsWalker { private sb: string[] = []; private indentLevel: i32 = 0; + private unknown: Set = new Set(); /** Constructs a new WebIDL builder. */ constructor(program: Program, includePrivate: bool = false) { super(program, includePrivate); } - visitGlobal(element: Global): void { + visitGlobal(name: string, element: Global): void { var sb = this.sb; var isConst = element.is(CommonFlags.INLINED); indent(sb, this.indentLevel); @@ -349,21 +363,21 @@ export class TSDBuilder extends ExportsWalker { if (isConst) sb.push("static readonly "); else sb.push("static "); } else { - if (isConst) sb.push("const "); - else sb.push("var "); + if (isConst) sb.push("export const "); + else sb.push("export var "); } - sb.push(element.name); + sb.push(name); sb.push(": "); sb.push(this.typeToString(element.type)); sb.push(";\n"); - this.visitNamespace(element); + this.visitNamespace(name, element); } - visitEnum(element: Enum): void { + visitEnum(name: string, element: Enum): void { var sb = this.sb; indent(sb, this.indentLevel++); - sb.push("enum "); - sb.push(element.name); + sb.push("export enum "); + sb.push(name); sb.push(" {\n"); var members = element.members; if (members) { @@ -381,13 +395,13 @@ export class TSDBuilder extends ExportsWalker { --numMembers; } } - if (numMembers) this.visitNamespace(element); + if (numMembers) this.visitNamespace(name, element); } indent(sb, --this.indentLevel); sb.push("}\n"); } - visitFunction(element: Function): void { + visitFunction(name: string, element: Function): void { if (element.isAny(CommonFlags.PRIVATE | CommonFlags.SET)) return; var sb = this.sb; var signature = element.signature; @@ -395,14 +409,15 @@ export class TSDBuilder extends ExportsWalker { if (element.is(CommonFlags.PROTECTED)) sb.push("protected "); if (element.is(CommonFlags.STATIC)) sb.push("static "); if (element.is(CommonFlags.GET)) { - sb.push(element.identifierNode.text); // 'get:funcName' internally - sb.push(": "); + sb.push("get "); + sb.push(name); // 'get:funcName' internally + sb.push("(): "); sb.push(this.typeToString(signature.returnType)); sb.push(";\n"); return; } else { - if (!element.isAny(CommonFlags.STATIC | CommonFlags.INSTANCE)) sb.push("function "); - sb.push(element.name); + if (!element.isAny(CommonFlags.STATIC | CommonFlags.INSTANCE)) sb.push("export function "); + sb.push(name); } sb.push("("); var parameters = signature.parameterTypes; @@ -422,73 +437,79 @@ export class TSDBuilder extends ExportsWalker { sb.push(this.typeToString(signature.returnType)); } sb.push(";\n"); - this.visitNamespace(element); + this.visitNamespace(name, element); } - visitClass(element: Class): void { + visitClass(name: string, element: Class): void { var sb = this.sb; var isInterface = element.kind == ElementKind.INTERFACE; indent(sb, this.indentLevel++); if (isInterface) { - sb.push("interface "); + sb.push("export interface "); } else { if (element.is(CommonFlags.ABSTRACT)) sb.push("abstract "); - sb.push("class "); - } - sb.push(element.name); - var base = element.base; - if (base && base.is(CommonFlags.COMPILED | CommonFlags.MODULE_EXPORT)) { - sb.push(" extends "); - sb.push(base.name); // TODO: fqn + sb.push("export class "); } + sb.push(name); + // var base = element.base; + // if (base && base.is(CommonFlags.COMPILED | CommonFlags.MODULE_EXPORT)) { + // sb.push(" extends "); + // sb.push(base.name); // TODO: fqn + // } sb.push(" {\n"); - var members = element.parent.members; // static - if (members) { - for (let member of members.values()) { - this.visitElement(member); - } + var staticMembers = element.prototype.members; + if (staticMembers) { + for (let member of staticMembers.values()) this.visitElement(member.name, member); } - var ctor = element.constructorInstance; - if (ctor) this.visitFunction(ctor); - members = element.members; // instance - if (members) { - for (let member of members.values()) this.visitElement(member); + var instanceMembers = element.members; + if (instanceMembers) { + for (let member of instanceMembers.values()) this.visitElement(member.name, member); } indent(sb, --this.indentLevel); sb.push("}\n"); } - visitInterface(element: Interface): void { - this.visitClass(element); + visitInterface(name: string, element: Interface): void { + this.visitClass(name, element); } - visitField(element: Field): void { + visitField(name: string, element: Field): void { if (element.is(CommonFlags.PRIVATE)) return; var sb = this.sb; indent(sb, this.indentLevel); if (element.is(CommonFlags.PROTECTED)) sb.push("protected "); if (element.is(CommonFlags.STATIC)) sb.push("static "); if (element.is(CommonFlags.READONLY)) sb.push("readonly "); - sb.push(element.name); + sb.push(name); sb.push(": "); sb.push(this.typeToString(element.type)); sb.push(";\n"); } - visitNamespace(element: Element): void { + visitNamespace(name: string, element: Element): void { var members = element.members; if (members && members.size) { let sb = this.sb; indent(sb, this.indentLevel++); - sb.push("namespace "); - sb.push(element.name); + sb.push("export namespace "); + sb.push(name); sb.push(" {\n"); - for (let member of members.values()) this.visitElement(member); + for (let member of members.values()) this.visitElement(member.name, member); indent(sb, --this.indentLevel); sb.push("}\n"); } } + visitAlias(name: string, element: Element, originalName: string): void { + var sb = this.sb; + indent(sb, this.indentLevel); + sb.push("export const "); + sb.push(name); + sb.push(" = typeof "); + sb.push(originalName); + sb.push(";\n"); + } + typeToString(type: Type): string { switch (type.kind) { case TypeKind.I8: return "i8"; @@ -510,7 +531,7 @@ export class TSDBuilder extends ExportsWalker { case TypeKind.VOID: return "void"; default: { assert(false); - return ""; + return "any"; } } } diff --git a/src/diagnosticMessages.generated.ts b/src/diagnosticMessages.generated.ts index dd8d451261..4542f564f1 100644 --- a/src/diagnosticMessages.generated.ts +++ b/src/diagnosticMessages.generated.ts @@ -16,7 +16,7 @@ export enum DiagnosticCode { Type_0_cannot_be_reinterpreted_as_type_1 = 203, Basic_type_0_cannot_be_nullable = 204, Cannot_export_a_mutable_global = 205, - Compiling_constant_with_non_constant_initializer_as_mutable = 206, + Mutable_value_cannot_be_inlined = 206, Unmanaged_classes_cannot_extend_managed_classes_and_vice_versa = 207, Unmanaged_classes_cannot_implement_interfaces = 208, Invalid_regular_expression_flags = 209, @@ -24,7 +24,7 @@ export enum DiagnosticCode { Class_0_is_sealed_and_cannot_be_extended = 211, Decorator_0_is_not_valid_here = 212, Duplicate_decorator = 213, - An_allocator_must_be_declared_to_allocate_memory_Try_importing_allocator_arena_or_allocator_tlsf = 214, + An_allocator_must_be_present_to_use_0 = 214, Optional_parameter_must_have_an_initializer = 215, Constructor_of_class_0_must_not_require_any_arguments = 216, Function_0_cannot_be_inlined_into_itself = 217, @@ -34,6 +34,8 @@ export enum DiagnosticCode { Module_cannot_have_multiple_start_functions = 221, _0_must_be_a_value_between_1_and_2_inclusive = 222, _0_must_be_a_power_of_two = 223, + TODO_Cannot_inline_inferred_calls_and_specific_internals_yet = 224, + Expression_is_never_null = 225, Unterminated_string_literal = 1002, Identifier_expected = 1003, _0_expected = 1005, @@ -64,6 +66,7 @@ export enum DiagnosticCode { Type_expected = 1110, A_default_clause_cannot_appear_more_than_once_in_a_switch_statement = 1113, Duplicate_label_0 = 1114, + An_export_assignment_cannot_have_modifiers = 1120, Octal_literals_are_not_allowed_in_strict_mode = 1121, Digit_expected = 1124, Hexadecimal_digit_expected = 1125, @@ -120,6 +123,7 @@ export enum DiagnosticCode { The_0_operator_cannot_be_applied_to_type_1 = 2469, In_const_enum_declarations_member_initializer_must_be_constant_expression = 2474, Export_declaration_conflicts_with_exported_declaration_of_0 = 2484, + Object_is_possibly_null = 2531, Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property = 2540, The_target_of_an_assignment_must_be_a_variable_or_a_property_access = 2541, Index_signature_in_type_0_only_permits_reading = 2542, @@ -151,7 +155,7 @@ export function diagnosticCodeToString(code: DiagnosticCode): string { case 203: return "Type '{0}' cannot be reinterpreted as type '{1}'."; case 204: return "Basic type '{0}' cannot be nullable."; case 205: return "Cannot export a mutable global."; - case 206: return "Compiling constant with non-constant initializer as mutable."; + case 206: return "Mutable value cannot be inlined."; case 207: return "Unmanaged classes cannot extend managed classes and vice-versa."; case 208: return "Unmanaged classes cannot implement interfaces."; case 209: return "Invalid regular expression flags."; @@ -159,7 +163,7 @@ export function diagnosticCodeToString(code: DiagnosticCode): string { case 211: return "Class '{0}' is sealed and cannot be extended."; case 212: return "Decorator '{0}' is not valid here."; case 213: return "Duplicate decorator."; - case 214: return "An allocator must be declared to allocate memory. Try importing allocator/arena or allocator/tlsf."; + case 214: return "An allocator must be present to use '{0}'."; case 215: return "Optional parameter must have an initializer."; case 216: return "Constructor of class '{0}' must not require any arguments."; case 217: return "Function '{0}' cannot be inlined into itself."; @@ -169,6 +173,8 @@ export function diagnosticCodeToString(code: DiagnosticCode): string { case 221: return "Module cannot have multiple start functions."; case 222: return "'{0}' must be a value between '{1}' and '{2}' inclusive."; case 223: return "'{0}' must be a power of two."; + case 224: return "TODO: Cannot inline inferred calls and specific internals yet."; + case 225: return "Expression is never 'null'."; case 1002: return "Unterminated string literal."; case 1003: return "Identifier expected."; case 1005: return "'{0}' expected."; @@ -199,6 +205,7 @@ export function diagnosticCodeToString(code: DiagnosticCode): string { case 1110: return "Type expected."; case 1113: return "A 'default' clause cannot appear more than once in a 'switch' statement."; case 1114: return "Duplicate label '{0}'."; + case 1120: return "An export assignment cannot have modifiers."; case 1121: return "Octal literals are not allowed in strict mode."; case 1124: return "Digit expected."; case 1125: return "Hexadecimal digit expected."; @@ -255,6 +262,7 @@ export function diagnosticCodeToString(code: DiagnosticCode): string { case 2469: return "The '{0}' operator cannot be applied to type '{1}'."; case 2474: return "In 'const' enum declarations member initializer must be constant expression."; case 2484: return "Export declaration conflicts with exported declaration of '{0}'."; + case 2531: return "Object is possibly 'null'."; case 2540: return "Cannot assign to '{0}' because it is a constant or a read-only property."; case 2541: return "The target of an assignment must be a variable or a property access."; case 2542: return "Index signature in type '{0}' only permits reading."; diff --git a/src/diagnosticMessages.json b/src/diagnosticMessages.json index 128062772e..673ebe2e1e 100644 --- a/src/diagnosticMessages.json +++ b/src/diagnosticMessages.json @@ -8,7 +8,7 @@ "Type '{0}' cannot be reinterpreted as type '{1}'.": 203, "Basic type '{0}' cannot be nullable.": 204, "Cannot export a mutable global.": 205, - "Compiling constant with non-constant initializer as mutable.": 206, + "Mutable value cannot be inlined.": 206, "Unmanaged classes cannot extend managed classes and vice-versa.": 207, "Unmanaged classes cannot implement interfaces.": 208, "Invalid regular expression flags.": 209, @@ -16,7 +16,7 @@ "Class '{0}' is sealed and cannot be extended.": 211, "Decorator '{0}' is not valid here.": 212, "Duplicate decorator.": 213, - "An allocator must be declared to allocate memory. Try importing allocator/arena or allocator/tlsf.": 214, + "An allocator must be present to use '{0}'.": 214, "Optional parameter must have an initializer.": 215, "Constructor of class '{0}' must not require any arguments.": 216, "Function '{0}' cannot be inlined into itself.": 217, @@ -26,6 +26,8 @@ "Module cannot have multiple start functions.": 221, "'{0}' must be a value between '{1}' and '{2}' inclusive.": 222, "'{0}' must be a power of two.": 223, + "TODO: Cannot inline inferred calls and specific internals yet.": 224, + "Expression is never 'null'.": 225, "Unterminated string literal.": 1002, "Identifier expected.": 1003, @@ -57,6 +59,7 @@ "Type expected.": 1110, "A 'default' clause cannot appear more than once in a 'switch' statement.": 1113, "Duplicate label '{0}'.": 1114, + "An export assignment cannot have modifiers.": 1120, "Octal literals are not allowed in strict mode.": 1121, "Digit expected.": 1124, "Hexadecimal digit expected.": 1125, @@ -114,6 +117,7 @@ "The '{0}' operator cannot be applied to type '{1}'.": 2469, "In 'const' enum declarations member initializer must be constant expression.": 2474, "Export declaration conflicts with exported declaration of '{0}'.": 2484, + "Object is possibly 'null'.": 2531, "Cannot assign to '{0}' because it is a constant or a read-only property.": 2540, "The target of an assignment must be a variable or a property access.": 2541, "Index signature in type '{0}' only permits reading.": 2542, diff --git a/src/diagnostics.ts b/src/diagnostics.ts index b7f3f4061f..9368bf9484 100644 --- a/src/diagnostics.ts +++ b/src/diagnostics.ts @@ -14,7 +14,7 @@ import { } from "./diagnosticMessages.generated"; import { - isLineBreak + isLineBreak, CharCode } from "./util"; export { @@ -244,7 +244,13 @@ export function formatDiagnosticContext(range: Range, useColors: bool = false): if (range.start == range.end) { sb.push("^"); } else { - while (start++ < range.end) sb.push("~"); + while (start++ < range.end) { + if (isLineBreak(text.charCodeAt(start))) { + sb.push(start == range.start + 1 ? "^" : "~"); + break; + } + sb.push("~"); + } } if (useColors) sb.push(COLOR_RESET); return sb.join(""); diff --git a/src/extra/ast.ts b/src/extra/ast.ts index 04c7ceeba8..0f843af63e 100644 --- a/src/extra/ast.ts +++ b/src/extra/ast.ts @@ -52,6 +52,7 @@ import { EmptyStatement, ExportImportStatement, ExportStatement, + ExportDefaultStatement, ExpressionStatement, ForStatement, IfStatement, @@ -230,6 +231,10 @@ export class ASTBuilder { this.visitExportStatement(node); break; } + case NodeKind.EXPORTDEFAULT: { + this.visitExportDefaultStatement(node); + break; + } case NodeKind.EXPORTIMPORT: { this.visitExportImportStatement(node); break; @@ -851,15 +856,19 @@ export class ASTBuilder { } } - visitClassDeclaration(node: ClassDeclaration): void { + visitClassDeclaration(node: ClassDeclaration, isDefault: bool = false): void { var decorators = node.decorators; if (decorators) { for (let i = 0, k = decorators.length; i < k; ++i) { this.serializeDecorator(decorators[i]); } } - this.serializeExternalModifiers(node); var sb = this.sb; + if (isDefault) { + sb.push("export default "); + } else { + this.serializeExternalModifiers(node); + } if (node.is(CommonFlags.ABSTRACT)) sb.push("abstract "); if (node.name.text.length) { sb.push("class "); @@ -931,9 +940,13 @@ export class ASTBuilder { visitEmptyStatement(node: EmptyStatement): void { } - visitEnumDeclaration(node: EnumDeclaration): void { + visitEnumDeclaration(node: EnumDeclaration, isDefault: bool = false): void { var sb = this.sb; - this.serializeExternalModifiers(node); + if (isDefault) { + sb.push("export default "); + } else { + this.serializeExternalModifiers(node); + } if (node.is(CommonFlags.CONST)) sb.push("const "); sb.push("enum "); this.visitIdentifierExpression(node.name); @@ -1011,6 +1024,33 @@ export class ASTBuilder { sb.push(";"); } + visitExportDefaultStatement(node: ExportDefaultStatement): void { + var declaration = node.declaration; + switch (declaration.kind) { + case NodeKind.ENUMDECLARATION: { + this.visitEnumDeclaration(declaration, true); + break; + } + case NodeKind.FUNCTIONDECLARATION: { + this.visitFunctionDeclaration(declaration, true); + break; + } + case NodeKind.CLASSDECLARATION: { + this.visitClassDeclaration(declaration, true); + break; + } + case NodeKind.INTERFACEDECLARATION: { + this.visitInterfaceDeclaration(declaration, true); + break; + } + case NodeKind.NAMESPACEDECLARATION: { + this.visitNamespaceDeclaration(declaration, true); + break; + } + default: assert(false); + } + } + visitExpressionStatement(node: ExpressionStatement): void { this.visitNode(node.expression); } @@ -1065,7 +1105,7 @@ export class ASTBuilder { this.visitNode(node.statement); } - visitFunctionDeclaration(node: FunctionDeclaration): void { + visitFunctionDeclaration(node: FunctionDeclaration, isDefault: bool = false): void { var sb = this.sb; var decorators = node.decorators; if (decorators) { @@ -1073,8 +1113,12 @@ export class ASTBuilder { this.serializeDecorator(decorators[i]); } } - this.serializeExternalModifiers(node); - this.serializeAccessModifiers(node); + if (isDefault) { + sb.push("export default "); + } else { + this.serializeExternalModifiers(node); + this.serializeAccessModifiers(node); + } if (node.name.text.length) { sb.push("function "); } else { @@ -1230,15 +1274,19 @@ export class ASTBuilder { this.visitTypeNode(node.valueType); } - visitInterfaceDeclaration(node: InterfaceDeclaration): void { + visitInterfaceDeclaration(node: InterfaceDeclaration, isDefault: bool = false): void { var decorators = node.decorators; if (decorators) { for (let i = 0, k = decorators.length; i < k; ++i) { this.serializeDecorator(decorators[i]); } } - this.serializeExternalModifiers(node); var sb = this.sb; + if (isDefault) { + sb.push("export default "); + } else { + this.serializeExternalModifiers(node); + } sb.push("interface "); this.visitIdentifierExpression(node.name); var typeParameters = node.typeParameters; @@ -1284,15 +1332,19 @@ export class ASTBuilder { this.visitFunctionCommon(node); } - visitNamespaceDeclaration(node: NamespaceDeclaration): void { + visitNamespaceDeclaration(node: NamespaceDeclaration, isDefault: bool = false): void { var decorators = node.decorators; if (decorators) { for (let i = 0, k = decorators.length; i < k; ++i) { this.serializeDecorator(decorators[i]); } } - this.serializeExternalModifiers(node); var sb = this.sb; + if (isDefault) { + sb.push("export default "); + } else { + this.serializeExternalModifiers(node); + } sb.push("namespace "); this.visitIdentifierExpression(node.name); var members = node.members; diff --git a/src/flow.ts b/src/flow.ts index ceae0a1b70..f8822def28 100644 --- a/src/flow.ts +++ b/src/flow.ts @@ -23,10 +23,10 @@ import { ExpressionRef, getExpressionId, - getGetLocalIndex, - isTeeLocal, - getSetLocalValue, - getGetGlobalName, + getLocalGetIndex, + isLocalTee, + getLocalSetValue, + getGlobalGetName, getBinaryOp, BinaryOp, getBinaryLeft, @@ -47,7 +47,13 @@ import { getIfFalse, getSelectThen, getSelectElse, - getCallTarget + getCallTarget, + getLocalSetIndex, + getIfCondition, + getConstValueI64High, + getUnaryValue, + getCallOperand, + traverse } from "./module"; import { @@ -62,11 +68,6 @@ import { Node } from "./ast"; -import { - bitsetIs, - bitsetSet -} from "./util"; - /** Control flow flags indicating specific conditions. */ export const enum FlowFlags { /** No specific conditions. */ @@ -78,36 +79,38 @@ export const enum FlowFlags { RETURNS = 1 << 0, /** This flow returns a wrapped value. */ RETURNS_WRAPPED = 1 << 1, + /** This flow returns a non-null value. */ + RETURNS_NONNULL = 1 << 2, /** This flow throws. */ - THROWS = 1 << 2, + THROWS = 1 << 3, /** This flow breaks. */ - BREAKS = 1 << 3, + BREAKS = 1 << 4, /** This flow continues. */ - CONTINUES = 1 << 4, + CONTINUES = 1 << 5, /** This flow allocates. Constructors only. */ - ALLOCATES = 1 << 5, + ALLOCATES = 1 << 6, /** This flow calls super. Constructors only. */ - CALLS_SUPER = 1 << 6, + CALLS_SUPER = 1 << 7, // conditional /** This flow conditionally returns in a child flow. */ - CONDITIONALLY_RETURNS = 1 << 7, + CONDITIONALLY_RETURNS = 1 << 8, /** This flow conditionally throws in a child flow. */ - CONDITIONALLY_THROWS = 1 << 8, + CONDITIONALLY_THROWS = 1 << 9, /** This flow conditionally breaks in a child flow. */ - CONDITIONALLY_BREAKS = 1 << 9, + CONDITIONALLY_BREAKS = 1 << 10, /** This flow conditionally continues in a child flow. */ - CONDITIONALLY_CONTINUES = 1 << 10, + CONDITIONALLY_CONTINUES = 1 << 11, /** This flow conditionally allocates in a child flow. Constructors only. */ - CONDITIONALLY_ALLOCATES = 1 << 11, + CONDITIONALLY_ALLOCATES = 1 << 12, // special /** This is an inlining flow. */ - INLINE_CONTEXT = 1 << 12, + INLINE_CONTEXT = 1 << 13, /** This is a flow with explicitly disabled bounds checking. */ - UNCHECKED_CONTEXT = 1 << 13, + UNCHECKED_CONTEXT = 1 << 14, // masks @@ -120,6 +123,7 @@ export const enum FlowFlags { /** Any categorical flag. */ ANY_CATEGORICAL = FlowFlags.RETURNS | FlowFlags.RETURNS_WRAPPED + | FlowFlags.RETURNS_NONNULL | FlowFlags.THROWS | FlowFlags.BREAKS | FlowFlags.CONTINUES @@ -134,6 +138,79 @@ export const enum FlowFlags { | FlowFlags.CONDITIONALLY_ALLOCATES } +/** Flags indicating the current state of a local. */ +export enum LocalFlags { + /** No specific conditions. */ + NONE = 0, + + /** Local is constant. */ + CONSTANT = 1 << 0, + /** Local is properly wrapped. Relevant for small integers. */ + WRAPPED = 1 << 1, + /** Local is non-null. */ + NONNULL = 1 << 2, + /** Local is read from. */ + READFROM = 1 << 3, + /** Local is written to. */ + WRITTENTO = 1 << 4, + /** Local is retained. */ + RETAINED = 1 << 5, + + /** Local is conditionally read from. */ + CONDITIONALLY_READFROM = 1 << 6, + /** Local is conditionally written to. */ + CONDITIONALLY_WRITTENTO = 1 << 7, + /** Local must be conditionally retained. */ + CONDITIONALLY_RETAINED = 1 << 8, + + /** Any categorical flag. */ + ANY_CATEGORICAL = CONSTANT + | WRAPPED + | NONNULL + | READFROM + | WRITTENTO + | RETAINED, + + /** Any conditional flag. */ + ANY_CONDITIONAL = RETAINED + | CONDITIONALLY_READFROM + | CONDITIONALLY_WRITTENTO + | CONDITIONALLY_RETAINED, + + /** Any retained flag. */ + ANY_RETAINED = RETAINED + | CONDITIONALLY_RETAINED +} +export namespace LocalFlags { + export function join(left: LocalFlags, right: LocalFlags): LocalFlags { + return ((left & LocalFlags.ANY_CATEGORICAL) & (right & LocalFlags.ANY_CATEGORICAL)) + | (left & LocalFlags.ANY_CONDITIONAL) | (right & LocalFlags.ANY_CONDITIONAL); + } +} + +/** Flags indicating the current state of a field. */ +export enum FieldFlags { + /** No specific conditions. */ + NONE = 0, + + /** Field is initialized. Relevant in constructors. */ + INITIALIZED = 1 << 0, + /** Field is conditionally initialized. Relevant in constructors. */ + CONDITIONALLY_INITIALIZED = 1 << 1, + + /** Any categorical flag. */ + ANY_CATEGORICAL = INITIALIZED, + + /** Any conditional flag. */ + ANY_CONDITIONAL = CONDITIONALLY_INITIALIZED +} +export namespace FieldFlags { + export function join(left: FieldFlags, right: FieldFlags): FieldFlags { + return ((left & FieldFlags.ANY_CATEGORICAL) & (right & FieldFlags.ANY_CATEGORICAL)) + | (left & FieldFlags.ANY_CONDITIONAL) | (right & FieldFlags.ANY_CONDITIONAL); + } +} + /** A control flow evaluator. */ export class Flow { @@ -153,10 +230,10 @@ export class Flow { contextualTypeArguments: Map | null; /** Scoped local variables. */ scopedLocals: Map | null = null; - /** Local variable wrap states for the first 64 locals. */ - wrappedLocals: I64; - /** Local variable wrap states for locals with index >= 64. */ - wrappedLocalsExt: I64[] | null; + /** Local flags. */ + localFlags: LocalFlags[]; + /** Field flags. Relevant in constructors. */ + fieldFlags: Map | null = null; /** Function being inlined, when inlining. */ inlineFunction: Function | null; /** The label we break to when encountering a return statement, when inlining. */ @@ -172,14 +249,13 @@ export class Flow { flow.breakLabel = null; flow.returnType = parentFunction.signature.returnType; flow.contextualTypeArguments = parentFunction.contextualTypeArguments; - flow.wrappedLocals = i64_new(0); - flow.wrappedLocalsExt = null; + flow.localFlags = []; flow.inlineFunction = null; flow.inlineReturnLabel = null; return flow; } - /** Creates an inline flow within `currentFunction`. */ + /** Creates an inline flow within `parentFunction`. */ static createInline(parentFunction: Function, inlineFunction: Function): Flow { var flow = Flow.create(parentFunction); flow.set(FlowFlags.INLINE_CONTEXT); @@ -216,15 +292,14 @@ export class Flow { branch.breakLabel = this.breakLabel; branch.returnType = this.returnType; branch.contextualTypeArguments = this.contextualTypeArguments; - branch.wrappedLocals = this.wrappedLocals; - branch.wrappedLocalsExt = this.wrappedLocalsExt ? this.wrappedLocalsExt.slice() : null; + branch.localFlags = this.localFlags.slice(); branch.inlineFunction = this.inlineFunction; branch.inlineReturnLabel = this.inlineReturnLabel; return branch; } /** Gets a free temporary local of the specified type. */ - getTempLocal(type: Type, wrapped: bool = false): Local { + getTempLocal(type: Type, except: Set | null = null): Local { var parentFunction = this.parentFunction; var temps: Local[] | null; switch (type.toNativeType()) { @@ -236,14 +311,43 @@ export class Flow { default: throw new Error("concrete type expected"); } var local: Local; - if (temps && temps.length) { - local = temps.pop(); - local.type = type; - local.flags = CommonFlags.NONE; - } else { + if (except) { + if (temps && temps.length) { + for (let i = 0, k = temps.length; i < k; ++i) { + if (!except.has(temps[i].index)) { + local = temps[i]; + let k = temps.length - 1; + while (i < k) unchecked(temps[i] = temps[i++ + 1]); + temps.length = k; + local.type = type; + local.flags = CommonFlags.NONE; + this.unsetLocalFlag(local.index, ~0); + return local; + } + } + } local = parentFunction.addLocal(type); + } else { + if (temps && temps.length) { + local = temps.pop(); + local.type = type; + local.flags = CommonFlags.NONE; + } else { + local = parentFunction.addLocal(type); + } } - if (type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) this.setLocalWrapped(local.index, wrapped); + this.unsetLocalFlag(local.index, ~0); + return local; + } + + /** Gets a local that sticks around until this flow is exited, and then released. */ + getAutoreleaseLocal(type: Type, except: Set | null = null): Local { + var local = this.getTempLocal(type, except); + local.set(CommonFlags.SCOPED); + var scopedLocals = this.scopedLocals; + if (!scopedLocals) this.scopedLocals = scopedLocals = new Map(); + scopedLocals.set("~auto" + (this.parentFunction.nextAutoreleaseId++), local); + this.setLocalFlag(local.index, LocalFlags.RETAINED); return local; } @@ -282,65 +386,27 @@ export class Flow { } /** Gets and immediately frees a temporary local of the specified type. */ - getAndFreeTempLocal(type: Type, wrapped: bool): Local { - var parentFunction = this.parentFunction; - var temps: Local[]; - switch (type.toNativeType()) { - case NativeType.I32: { - temps = parentFunction.tempI32s || (parentFunction.tempI32s = []); - break; - } - case NativeType.I64: { - temps = parentFunction.tempI64s || (parentFunction.tempI64s = []); - break; - } - case NativeType.F32: { - temps = parentFunction.tempF32s || (parentFunction.tempF32s = []); - break; - } - case NativeType.F64: { - temps = parentFunction.tempF64s || (parentFunction.tempF64s = []); - break; - } - case NativeType.V128: { - temps = parentFunction.tempV128s || (parentFunction.tempV128s = []); - break; - } - default: throw new Error("concrete type expected"); - } - var local: Local; - if (temps.length) { - local = temps[temps.length - 1]; - local.type = type; - } else { - local = parentFunction.addLocal(type); - temps.push(local); - } - if (type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) this.setLocalWrapped(local.index, wrapped); + getAndFreeTempLocal(type: Type, except: Set | null = null): Local { + var local = this.getTempLocal(type, except); + this.freeTempLocal(local); return local; } + /** Gets the scoped local of the specified name. */ + getScopedLocal(name: string): Local | null { + var scopedLocals = this.scopedLocals; + if (scopedLocals && scopedLocals.has(name)) return scopedLocals.get(name); + return null; + } + /** Adds a new scoped local of the specified name. */ - addScopedLocal(name: string, type: Type, wrapped: bool, reportNode: Node | null = null): Local { - var scopedLocal = this.getTempLocal(type, false); - if (!this.scopedLocals) this.scopedLocals = new Map(); - else { - let existingLocal = this.scopedLocals.get(name); - if (existingLocal) { - if (reportNode) { - this.parentFunction.program.error( - DiagnosticCode.Duplicate_identifier_0, - reportNode.range - ); - } - return existingLocal; - } - } + addScopedLocal(name: string, type: Type, except: Set | null = null): Local { + var scopedLocal = this.getTempLocal(type, except); + var scopedLocals = this.scopedLocals; + if (!scopedLocals) this.scopedLocals = scopedLocals = new Map(); + else assert(!scopedLocals.has(name)); scopedLocal.set(CommonFlags.SCOPED); - this.scopedLocals.set(name, scopedLocal); - if (type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) { - this.setLocalWrapped(scopedLocal.index, wrapped); - } + scopedLocals.set(name, scopedLocal); return scopedLocal; } @@ -360,12 +426,7 @@ export class Flow { } } assert(index < this.parentFunction.localsByIndex.length); - var scopedAlias = new Local( - name, - index, - type, - this.parentFunction - ); + var scopedAlias = new Local(name, index, type, this.parentFunction); // not flagged as SCOPED as it must not be free'd when the flow is finalized this.scopedLocals.set(name, scopedAlias); return scopedAlias; @@ -399,32 +460,34 @@ export class Flow { return this.actualFunction.lookup(name); } - /** Tests if the value of the local at the specified index is considered wrapped. */ - isLocalWrapped(index: i32): bool { - if (index < 0) return true; // inlined constant - if (index < 64) return bitsetIs(this.wrappedLocals, index); - var ext = this.wrappedLocalsExt; - var i = ((index - 64) / 64) | 0; - if (!(ext && i < ext.length)) return false; - return bitsetIs(ext[i], index - (i + 1) * 64); + /** Tests if the local at the specified index has the specified flag or flags. */ + isLocalFlag(index: i32, flag: LocalFlags, defaultIfInlined: bool = true): bool { + if (index < 0) return defaultIfInlined; + var localFlags = this.localFlags; + return index < localFlags.length && (unchecked(this.localFlags[index]) & flag) == flag; } - /** Sets if the value of the local at the specified index is considered wrapped. */ - setLocalWrapped(index: i32, wrapped: bool): void { - if (index < 0) return; // inlined constant - if (index < 64) { - this.wrappedLocals = bitsetSet(this.wrappedLocals, index, wrapped); - return; - } - var ext = this.wrappedLocalsExt; - var i = ((index - 64) / 64) | 0; - if (!ext) { - this.wrappedLocalsExt = ext = new Array(i + 1); - for (let j = 0; j <= i; ++j) ext[j] = i64_new(0); - } else { - while (ext.length <= i) ext.push(i64_new(0)); - } - ext[i] = bitsetSet(ext[i], index - (i + 1) * 64, wrapped); + /** Tests if the local at the specified index has any of the specified flags. */ + isAnyLocalFlag(index: i32, flag: LocalFlags, defaultIfInlined: bool = true): bool { + if (index < 0) return defaultIfInlined; + var localFlags = this.localFlags; + return index < localFlags.length && (unchecked(this.localFlags[index]) & flag) != 0; + } + + /** Sets the specified flag or flags on the local at the specified index. */ + setLocalFlag(index: i32, flag: LocalFlags): void { + if (index < 0) return; + var localFlags = this.localFlags; + var flags = index < localFlags.length ? unchecked(localFlags[index]) : 0; + this.localFlags[index] = flags | flag; + } + + /** Unsets the specified flag or flags on the local at the specified index. */ + unsetLocalFlag(index: i32, flag: LocalFlags): void { + if (index < 0) return; + var localFlags = this.localFlags; + var flags = index < localFlags.length ? unchecked(localFlags[index]) : 0; + this.localFlags[index] = flags & ~flag; } /** Pushes a new break label to the stack, for example when entering a loop that one can `break` from. */ @@ -454,8 +517,7 @@ export class Flow { /** Inherits flags and local wrap states from the specified flow (e.g. blocks). */ inherit(other: Flow): void { this.flags |= other.flags & (FlowFlags.ANY_CATEGORICAL | FlowFlags.ANY_CONDITIONAL); - this.wrappedLocals = other.wrappedLocals; - this.wrappedLocalsExt = other.wrappedLocalsExt; // no need to slice because other flow is finished + this.localFlags = other.localFlags; // no need to slice because other flow is finished } /** Inherits categorical flags as conditional flags from the specified flow (e.g. then without else). */ @@ -475,33 +537,245 @@ export class Flow { if (other.is(FlowFlags.ALLOCATES)) { this.set(FlowFlags.CONDITIONALLY_ALLOCATES); } + var localFlags = other.localFlags; + for (let i = 0, k = localFlags.length; i < k; ++i) { + let flags = localFlags[i]; + if (flags & LocalFlags.RETAINED) this.setLocalFlag(i, LocalFlags.CONDITIONALLY_RETAINED); + if (flags & LocalFlags.READFROM) this.setLocalFlag(i, LocalFlags.CONDITIONALLY_READFROM); + if (flags & LocalFlags.WRITTENTO) this.setLocalFlag(i, LocalFlags.CONDITIONALLY_WRITTENTO); + } } /** Inherits mutual flags and local wrap states from the specified flows (e.g. then with else). */ inheritMutual(left: Flow, right: Flow): void { // categorical flags set in both arms - this.flags |= left.flags & right.flags & FlowFlags.ANY_CATEGORICAL; + this.set(left.flags & right.flags & FlowFlags.ANY_CATEGORICAL); // conditional flags set in at least one arm - this.flags |= left.flags & FlowFlags.ANY_CONDITIONAL; - this.flags |= right.flags & FlowFlags.ANY_CONDITIONAL; - - // locals wrapped in both arms - this.wrappedLocals = i64_and(left.wrappedLocals, right.wrappedLocals); - var leftExt = left.wrappedLocalsExt; - var rightExt = right.wrappedLocalsExt; - if (leftExt != null && rightExt != null) { - let thisExt = this.wrappedLocalsExt; - let minLength = min(leftExt.length, rightExt.length); - if (minLength) { - if (!thisExt) thisExt = new Array(minLength); - else while (thisExt.length < minLength) thisExt.push(i64_new(0)); - for (let i = 0; i < minLength; ++i) { - thisExt[i] = i64_and( - leftExt[i], - rightExt[i] - ); + this.set(left.flags & FlowFlags.ANY_CONDITIONAL); + this.set(right.flags & FlowFlags.ANY_CONDITIONAL); + + // categorical local flags set in both arms / conditional local flags set in at least one arm + var leftLocalFlags = left.localFlags; + var numLeftLocalFlags = leftLocalFlags.length; + var rightLocalFlags = right.localFlags; + var numRightLocalFlags = rightLocalFlags.length; + var combinedFlags = new Array(max(numLeftLocalFlags, numRightLocalFlags)); + for (let i = 0; i < numLeftLocalFlags; ++i) { + combinedFlags[i] = LocalFlags.join( + unchecked(leftLocalFlags[i]), + i < numRightLocalFlags + ? unchecked(rightLocalFlags[i]) + : 0 + ); + } + for (let i = numLeftLocalFlags; i < numRightLocalFlags; ++i) { + combinedFlags[i] = LocalFlags.join( + 0, + unchecked(rightLocalFlags[i]) + ); + } + this.localFlags = combinedFlags; + } + + /** Checks if an expression of the specified type is known to be non-null, even if the type might be nullable. */ + isNonnull(expr: ExpressionRef, type: Type): bool { + if (!type.is(TypeFlags.NULLABLE)) return true; + // below, only teeLocal/getLocal are relevant because these are the only expressions that + // depend on a dynamic nullable state (flag = LocalFlags.NONNULL), while everything else + // has already been handled by the nullable type check above. + switch (getExpressionId(expr)) { + case ExpressionId.LocalSet: { + if (!isLocalTee(expr)) break; + let local = this.parentFunction.localsByIndex[getLocalSetIndex(expr)]; + return !local.type.is(TypeFlags.NULLABLE) || this.isLocalFlag(local.index, LocalFlags.NONNULL, false); + } + case ExpressionId.LocalGet: { + let local = this.parentFunction.localsByIndex[getLocalGetIndex(expr)]; + return !local.type.is(TypeFlags.NULLABLE) || this.isLocalFlag(local.index, LocalFlags.NONNULL, false); + } + } + return false; + } + + /** Updates local states to reflect that this branch is only taken when `expr` is true-ish. */ + inheritNonnullIfTrue(expr: ExpressionRef): void { + // A: `expr` is true-ish -> Q: how did that happen? + switch (getExpressionId(expr)) { + case ExpressionId.LocalSet: { + if (!isLocalTee(expr)) break; + let local = this.parentFunction.localsByIndex[getLocalSetIndex(expr)]; + this.setLocalFlag(local.index, LocalFlags.NONNULL); + this.inheritNonnullIfTrue(getLocalSetValue(expr)); // must have been true-ish as well + break; + } + case ExpressionId.LocalGet: { + let local = this.parentFunction.localsByIndex[getLocalGetIndex(expr)]; + this.setLocalFlag(local.index, LocalFlags.NONNULL); + break; + } + case ExpressionId.If: { + let ifFalse = getIfFalse(expr); + if (!ifFalse) break; + if (getExpressionId(ifFalse) == ExpressionId.Const) { + // Logical AND: (if (condition ifTrue 0)) + // the only way this had become true is if condition and ifTrue are true + if ( + (getExpressionType(ifFalse) == NativeType.I32 && getConstValueI32(ifFalse) == 0) || + (getExpressionType(ifFalse) == NativeType.I64 && getConstValueI64Low(ifFalse) == 0 && getConstValueI64High(ifFalse) == 0) + ) { + this.inheritNonnullIfTrue(getIfCondition(expr)); + this.inheritNonnullIfTrue(getIfTrue(expr)); + } + } + break; + } + case ExpressionId.Unary: { + switch (getUnaryOp(expr)) { + case UnaryOp.EqzI32: + case UnaryOp.EqzI64: { + this.inheritNonnullIfFalse(getUnaryValue(expr)); // !value -> value must have been false + break; + } + } + break; + } + case ExpressionId.Binary: { + switch (getBinaryOp(expr)) { + case BinaryOp.EqI32: { + let left = getBinaryLeft(expr); + let right = getBinaryRight(expr); + if (getExpressionId(left) == ExpressionId.Const && getConstValueI32(left) != 0) { + this.inheritNonnullIfTrue(right); // TRUE == right -> right must have been true + } else if (getExpressionId(right) == ExpressionId.Const && getConstValueI32(right) != 0) { + this.inheritNonnullIfTrue(left); // left == TRUE -> left must have been true + } + break; + } + case BinaryOp.EqI64: { + let left = getBinaryLeft(expr); + let right = getBinaryRight(expr); + if (getExpressionId(left) == ExpressionId.Const && (getConstValueI64Low(left) != 0 || getConstValueI64High(left) != 0)) { + this.inheritNonnullIfTrue(right); // TRUE == right -> right must have been true + } else if (getExpressionId(right) == ExpressionId.Const && (getConstValueI64Low(right) != 0 && getConstValueI64High(right) != 0)) { + this.inheritNonnullIfTrue(left); // left == TRUE -> left must have been true + } + break; + } + case BinaryOp.NeI32: { + let left = getBinaryLeft(expr); + let right = getBinaryRight(expr); + if (getExpressionId(left) == ExpressionId.Const && getConstValueI32(left) == 0) { + this.inheritNonnullIfTrue(right); // FALSE != right -> right must have been true + } else if (getExpressionId(right) == ExpressionId.Const && getConstValueI32(right) == 0) { + this.inheritNonnullIfTrue(left); // left != FALSE -> left must have been true + } + break; + } + case BinaryOp.NeI64: { + let left = getBinaryLeft(expr); + let right = getBinaryRight(expr); + if (getExpressionId(left) == ExpressionId.Const && getConstValueI64Low(left) == 0 && getConstValueI64High(left) == 0) { + this.inheritNonnullIfTrue(right); // FALSE != right -> right must have been true + } else if (getExpressionId(right) == ExpressionId.Const && getConstValueI64Low(right) == 0 && getConstValueI64High(right) == 0) { + this.inheritNonnullIfTrue(left); // left != FALSE -> left must have been true + } + break; + } + } + break; + } + case ExpressionId.Call: { + let name = getCallTarget(expr); + let program = this.parentFunction.program; + switch (name) { + case program.retainInstance.internalName: { + this.inheritNonnullIfTrue(getCallOperand(expr, 0)); + break; + } } + break; + } + } + } + + /** Updates local states to reflect that this branch is only taken when `expr` is false-ish. */ + inheritNonnullIfFalse(expr: ExpressionRef): void { + // A: `expr` is false-ish -> Q: how did that happen? + switch (getExpressionId(expr)) { + case ExpressionId.Unary: { + switch (getUnaryOp(expr)) { + case UnaryOp.EqzI32: + case UnaryOp.EqzI64: { + this.inheritNonnullIfTrue(getUnaryValue(expr)); // !value -> value must have been true + break; + } + } + break; + } + case ExpressionId.If: { + let ifTrue = getIfTrue(expr); + if (getExpressionId(ifTrue) == ExpressionId.Const) { + let ifFalse = getIfFalse(expr); + if (!ifFalse) break; + // Logical OR: (if (condition 1 ifFalse)) + // the only way this had become false is if condition and ifFalse are false + if ( + (getExpressionType(ifTrue) == NativeType.I32 && getConstValueI32(ifTrue) != 0) || + (getExpressionType(ifTrue) == NativeType.I64 && (getConstValueI64Low(ifTrue) != 0 || getConstValueI64High(ifTrue) != 0)) + ) { + this.inheritNonnullIfFalse(getIfCondition(expr)); + this.inheritNonnullIfFalse(getIfFalse(expr)); + } + + } + break; + } + case ExpressionId.Binary: { + switch (getBinaryOp(expr)) { + // remember: we want to know how the _entire_ expression became FALSE (!) + case BinaryOp.EqI32: { + let left = getBinaryLeft(expr); + let right = getBinaryRight(expr); + if (getExpressionId(left) == ExpressionId.Const && getConstValueI32(left) == 0) { + this.inheritNonnullIfTrue(right); // FALSE == right -> right must have been true + } else if (getExpressionId(right) == ExpressionId.Const && getConstValueI32(right) == 0) { + this.inheritNonnullIfTrue(left); // left == FALSE -> left must have been true + } + break; + } + case BinaryOp.EqI64: { + let left = getBinaryLeft(expr); + let right = getBinaryRight(expr); + if (getExpressionId(left) == ExpressionId.Const && getConstValueI64Low(left) == 0 && getConstValueI64High(left) == 0) { + this.inheritNonnullIfTrue(right); // FALSE == right -> right must have been true + } else if (getExpressionId(right) == ExpressionId.Const && getConstValueI64Low(right) == 0 && getConstValueI64High(right) == 0) { + this.inheritNonnullIfTrue(left); // left == FALSE -> left must have been true + } + break; + } + case BinaryOp.NeI32: { + let left = getBinaryLeft(expr); + let right = getBinaryRight(expr); + if (getExpressionId(left) == ExpressionId.Const && getConstValueI32(left) != 0) { + this.inheritNonnullIfTrue(right); // TRUE != right -> right must have been true + } else if (getExpressionId(right) == ExpressionId.Const && getConstValueI32(right) != 0) { + this.inheritNonnullIfTrue(left); // left != TRUE -> left must have been true + } + break; + } + case BinaryOp.NeI64: { + let left = getBinaryLeft(expr); + let right = getBinaryRight(expr); + if (getExpressionId(left) == ExpressionId.Const && (getConstValueI64Low(left) != 0 || getConstValueI64High(left) != 0)) { + this.inheritNonnullIfTrue(right); // TRUE != right -> right must have been true for this to become false + } else if (getExpressionId(right) == ExpressionId.Const && (getConstValueI64Low(right) != 0 || getConstValueI64High(right) != 0)) { + this.inheritNonnullIfTrue(left); // left != TRUE -> left must have been true for this to become false + } + break; + } + } + break; } } } @@ -523,22 +797,22 @@ export class Flow { switch (getExpressionId(expr)) { // overflows if the local isn't wrapped or the conversion does - case ExpressionId.GetLocal: { - let local = this.parentFunction.localsByIndex[getGetLocalIndex(expr)]; - return !this.isLocalWrapped(local.index) + case ExpressionId.LocalGet: { + let local = this.parentFunction.localsByIndex[getLocalGetIndex(expr)]; + return !this.isLocalFlag(local.index, LocalFlags.WRAPPED, true) || canConversionOverflow(local.type, type); } // overflows if the value does - case ExpressionId.SetLocal: { // tee - assert(isTeeLocal(expr)); - return this.canOverflow(getSetLocalValue(expr), type); + case ExpressionId.LocalSet: { // tee + assert(isLocalTee(expr)); + return this.canOverflow(getLocalSetValue(expr), type); } // overflows if the conversion does (globals are wrapped on set) - case ExpressionId.GetGlobal: { + case ExpressionId.GlobalGet: { // TODO: this is inefficient because it has to read a string - let global = assert(this.parentFunction.program.elementsByName.get(assert(getGetGlobalName(expr)))); + let global = assert(this.parentFunction.program.elementsByName.get(assert(getGlobalGetName(expr)))); assert(global.kind == ElementKind.GLOBAL); return canConversionOverflow(assert((global).type), type); } @@ -705,10 +979,11 @@ export class Flow { // overflows if the conversion does case ExpressionId.Load: { let fromType: Type; + let signed = isLoadSigned(expr); switch (getLoadBytes(expr)) { - case 1: { fromType = isLoadSigned(expr) ? Type.i8 : Type.u8; break; } - case 2: { fromType = isLoadSigned(expr) ? Type.i16 : Type.u16; break; } - default: { fromType = isLoadSigned(expr) ? Type.i32 : Type.u32; break; } + case 1: { fromType = signed ? Type.i8 : Type.u8; break; } + case 2: { fromType = signed ? Type.i16 : Type.u16; break; } + default: { fromType = signed ? Type.i32 : Type.u32; break; } } return canConversionOverflow(fromType, type); } @@ -740,11 +1015,16 @@ export class Flow { // overflows if the call does not return a wrapped value or the conversion does case ExpressionId.Call: { let program = this.parentFunction.program; - let instance = assert(program.instancesByName.get(assert(getCallTarget(expr)))); - assert(instance.kind == ElementKind.FUNCTION); - let returnType = (instance).signature.returnType; - return !(instance).flow.is(FlowFlags.RETURNS_WRAPPED) - || canConversionOverflow(returnType, type); + let instancesByName = program.instancesByName; + let instanceName = assert(getCallTarget(expr)); + if (instancesByName.has(instanceName)) { + let instance = instancesByName.get(instanceName)!; + assert(instance.kind == ElementKind.FUNCTION); + let returnType = (instance).signature.returnType; + return !(instance).flow.is(FlowFlags.RETURNS_WRAPPED) + || canConversionOverflow(returnType, type); + } + return false; // assume no overflow for builtins } // doesn't technically overflow @@ -752,6 +1032,16 @@ export class Flow { } return true; } + + toString(): string { + var levels = 0; + var parent = this.parent; + while (parent) { + parent = parent.parent; + ++levels; + } + return "Flow(" + this.actualFunction + ")[" + levels.toString() + "]"; + } } /** Tests if a conversion from one type to another can technically overflow. */ @@ -760,3 +1050,24 @@ function canConversionOverflow(fromType: Type, toType: Type): bool { || fromType.size > toType.size || fromType.is(TypeFlags.SIGNED) != toType.is(TypeFlags.SIGNED); } + +/** Finds all indexes of locals used in the specified expression. */ +export function findUsedLocals(expr: ExpressionRef, used: Set = new Set()): Set { + traverse(expr, used, findUsedLocalsVisit); + return used; +} + +/** A visitor function for use with `traverse` that finds all indexes of used locals. */ +function findUsedLocalsVisit(expr: ExpressionRef, used: Set): void { + switch (getExpressionId(expr)) { + case ExpressionId.LocalGet: { + used.add(getLocalGetIndex(expr)); + break; + } + case ExpressionId.LocalSet: { + used.add(getLocalSetIndex(expr)); + // fall-through for value + } + default: traverse(expr, used, findUsedLocalsVisit); + } +} diff --git a/src/glue/binaryen.d.ts b/src/glue/binaryen.d.ts index 2235487b63..e23f89c78f 100644 --- a/src/glue/binaryen.d.ts +++ b/src/glue/binaryen.d.ts @@ -22,6 +22,16 @@ declare function _BinaryenTypeVec128(): BinaryenType; declare function _BinaryenTypeUnreachable(): BinaryenType; declare function _BinaryenTypeAuto(): BinaryenType; +declare type BinaryenFeatureFlags = u32; + +declare function _BinaryenFeatureAtomics(): BinaryenFeatureFlags; +declare function _BinaryenFeatureMutableGlobals(): BinaryenFeatureFlags; +declare function _BinaryenFeatureNontrappingFPToInt(): BinaryenFeatureFlags; +declare function _BinaryenFeatureSIMD128(): BinaryenFeatureFlags; +declare function _BinaryenFeatureBulkMemory(): BinaryenFeatureFlags; +declare function _BinaryenFeatureSignExt(): BinaryenFeatureFlags; +declare function _BinaryenFeatureExceptionHandling(): BinaryenFeatureFlags; + declare type BinaryenExpressionId = i32; declare function _BinaryenInvalidId(): BinaryenExpressionId; @@ -32,10 +42,10 @@ declare function _BinaryenBreakId(): BinaryenExpressionId; declare function _BinaryenSwitchId(): BinaryenExpressionId; declare function _BinaryenCallId(): BinaryenExpressionId; declare function _BinaryenCallIndirectId(): BinaryenExpressionId; -declare function _BinaryenGetLocalId(): BinaryenExpressionId; -declare function _BinaryenSetLocalId(): BinaryenExpressionId; -declare function _BinaryenGetGlobalId(): BinaryenExpressionId; -declare function _BinaryenSetGlobalId(): BinaryenExpressionId; +declare function _BinaryenLocalGetId(): BinaryenExpressionId; +declare function _BinaryenLocalSetId(): BinaryenExpressionId; +declare function _BinaryenGlobalGetId(): BinaryenExpressionId; +declare function _BinaryenGlobalSetId(): BinaryenExpressionId; declare function _BinaryenLoadId(): BinaryenExpressionId; declare function _BinaryenStoreId(): BinaryenExpressionId; declare function _BinaryenConstId(): BinaryenExpressionId; @@ -211,8 +221,8 @@ declare function _BinaryenGeFloat64(): BinaryenOp; declare type BinaryenHostOp = BinaryenOp; -declare function _BinaryenCurrentMemory(): BinaryenHostOp; -declare function _BinaryenGrowMemory(): BinaryenHostOp; +declare function _BinaryenMemorySize(): BinaryenHostOp; +declare function _BinaryenMemoryGrow(): BinaryenHostOp; declare type BinaryenAtomicRMWOp = BinaryenOp; @@ -370,11 +380,11 @@ declare function _BinaryenBreak(module: BinaryenModuleRef, name: usize, conditio declare function _BinaryenSwitch(module: BinaryenModuleRef, names: usize, numNames: BinaryenIndex, defaultName: usize, condition: BinaryenExpressionRef, value: BinaryenExpressionRef): BinaryenExpressionRef; declare function _BinaryenCall(module: BinaryenModuleRef, target: usize, operands: usize, numOperands: BinaryenIndex, returnType: BinaryenType): BinaryenExpressionRef; declare function _BinaryenCallIndirect(module: BinaryenModuleRef, target: BinaryenExpressionRef, operands: usize, numOperands: BinaryenIndex, type: usize): BinaryenExpressionRef; -declare function _BinaryenGetLocal(module: BinaryenModuleRef, index: BinaryenIndex, type: BinaryenType): BinaryenExpressionRef; -declare function _BinaryenSetLocal(module: BinaryenModuleRef, index: BinaryenIndex, value: BinaryenExpressionRef): BinaryenExpressionRef; -declare function _BinaryenTeeLocal(module: BinaryenModuleRef, index: BinaryenIndex, value: BinaryenExpressionRef): BinaryenExpressionRef; -declare function _BinaryenGetGlobal(module: BinaryenModuleRef, name: usize, type: BinaryenType): BinaryenExpressionRef; -declare function _BinaryenSetGlobal(module: BinaryenModuleRef, name: usize, value: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenLocalGet(module: BinaryenModuleRef, index: BinaryenIndex, type: BinaryenType): BinaryenExpressionRef; +declare function _BinaryenLocalSet(module: BinaryenModuleRef, index: BinaryenIndex, value: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenLocalTee(module: BinaryenModuleRef, index: BinaryenIndex, value: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenGlobalGet(module: BinaryenModuleRef, name: usize, type: BinaryenType): BinaryenExpressionRef; +declare function _BinaryenGlobalSet(module: BinaryenModuleRef, name: usize, value: BinaryenExpressionRef): BinaryenExpressionRef; declare function _BinaryenLoad(module: BinaryenModuleRef, bytes: u32, signed: i8, offset: u32, align: u32, type: BinaryenType, ptr: BinaryenExpressionRef): BinaryenExpressionRef; declare function _BinaryenStore(module: BinaryenModuleRef, bytes: u32, offset: u32, align: u32, ptr: BinaryenExpressionRef, value: BinaryenExpressionRef, type: BinaryenType): BinaryenExpressionRef; declare function _BinaryenConst(module: BinaryenModuleRef, value: usize): BinaryenExpressionRef; @@ -438,16 +448,16 @@ declare function _BinaryenCallIndirectGetTarget(expr: BinaryenExpressionRef): Bi declare function _BinaryenCallIndirectGetNumOperands(expr: BinaryenExpressionRef): BinaryenIndex; declare function _BinaryenCallIndirectGetOperand(expr: BinaryenExpressionRef, index: BinaryenIndex): BinaryenExpressionRef; -declare function _BinaryenGetLocalGetIndex(expr: BinaryenExpressionRef): BinaryenIndex; +declare function _BinaryenLocalGetGetIndex(expr: BinaryenExpressionRef): BinaryenIndex; -declare function _BinaryenSetLocalIsTee(expr: BinaryenExpressionRef): bool; -declare function _BinaryenSetLocalGetIndex(expr: BinaryenExpressionRef): BinaryenIndex; -declare function _BinaryenSetLocalGetValue(expr: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenLocalSetIsTee(expr: BinaryenExpressionRef): bool; +declare function _BinaryenLocalSetGetIndex(expr: BinaryenExpressionRef): BinaryenIndex; +declare function _BinaryenLocalSetGetValue(expr: BinaryenExpressionRef): BinaryenExpressionRef; -declare function _BinaryenGetGlobalGetName(expr: BinaryenExpressionRef): usize; +declare function _BinaryenGlobalGetGetName(expr: BinaryenExpressionRef): usize; -declare function _BinaryenSetGlobalGetName(expr: BinaryenExpressionRef): usize; -declare function _BinaryenSetGlobalGetValue(expr: BinaryenExpressionRef): BinaryenExpressionRef; +declare function _BinaryenGlobalSetGetName(expr: BinaryenExpressionRef): usize; +declare function _BinaryenGlobalSetGetValue(expr: BinaryenExpressionRef): BinaryenExpressionRef; declare function _BinaryenHostGetOp(expr: BinaryenExpressionRef): BinaryenOp; declare function _BinaryenHostGetNameOperand(expr: BinaryenExpressionRef): usize; @@ -612,6 +622,8 @@ declare function _BinaryenModuleRead(input: usize, inputSize: usize): BinaryenMo declare function _BinaryenModuleInterpret(module: BinaryenModuleRef): void; declare function _BinaryenModuleAddDebugInfoFileName(module: BinaryenModuleRef, filename: usize): BinaryenIndex; declare function _BinaryenModuleGetDebugInfoFileName(module: BinaryenModuleRef, index: BinaryenIndex): usize; +declare function _BinaryenModuleGetFeatures(module: BinaryenModuleRef): BinaryenFeatureFlags; +declare function _BinaryenModuleSetFeatures(module: BinaryenModuleRef, featureFlags: BinaryenFeatureFlags): void; declare type BinaryenRelooperRef = usize; declare type BinaryenRelooperBlockRef = usize; diff --git a/src/index.ts b/src/index.ts index 9de7375109..eabe27f9c7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,39 +3,14 @@ * @module index *//***/ -import { - Compiler, - Options, - Target, - Feature -} from "./compiler"; - -import { - Decompiler -} from "./decompiler"; - -import { - IDLBuilder, - TSDBuilder -} from "./definitions"; - -import { - DiagnosticMessage, - DiagnosticCategory, - formatDiagnosticMessage -} from "./diagnostics"; - -import { - Module -} from "./module"; - -import { - Parser -} from "./parser"; - -import { - Program -} from "./program"; +import { Target, Feature } from "./common"; +import { Compiler, Options } from "./compiler"; +import { Decompiler } from "./decompiler"; +import { IDLBuilder, TSDBuilder } from "./definitions"; +import { DiagnosticMessage, DiagnosticCategory, formatDiagnosticMessage } from "./diagnostics"; +import { Module } from "./module"; +import { Parser } from "./parser"; +import { Program } from "./program"; /** Parses a source file. If `parser` has been omitted a new one is created. */ export function parseFile(text: string, path: string, isEntry: bool = false, @@ -124,6 +99,11 @@ export function setGlobalAlias(options: Options, name: string, alias: string): v globalAliases.set(name, alias); } +/** Sets the `explicitStart` option. */ +export function setExplicitStart(options: Options, explicitStart: bool): void { + options.explicitStart = explicitStart; +} + /** Sign extension operations. */ export const FEATURE_SIGN_EXTENSION = Feature.SIGN_EXTENSION; /** Mutable global imports and exports. */ @@ -173,6 +153,32 @@ export function buildTSD(program: Program): string { return TSDBuilder.build(program); } +/** Builds a JSON file of a program's runtime type information. */ +export function buildRTTI(program: Program): string { + var sb = new Array(); + sb.push("{\n \"names\": [\n"); + for (let cls of program.managedClasses.values()) { + sb.push(" \""); + sb.push(cls.internalName); + sb.push("\",\n"); + } + sb.push(" ],\n \"base\": [\n"); + for (let cls of program.managedClasses.values()) { + let base = cls.base; + sb.push(" "); + sb.push(base ? base.id.toString() : "0"); + sb.push(",\n"); + } + sb.push(" ],\n \"flags\": [\n"); + for (let cls of program.managedClasses.values()) { + sb.push(" "); + sb.push(cls.rttiFlags.toString()); + sb.push(",\n"); + } + sb.push(" ]\n}\n"); + return sb.join(""); +} + /** Prefix indicating a library file. */ export { LIBRARY_PREFIX } from "./common"; diff --git a/src/module.ts b/src/module.ts index 7193516bb3..d8396671d9 100644 --- a/src/module.ts +++ b/src/module.ts @@ -3,9 +3,7 @@ * @module module *//***/ -import { - Target -} from "./compiler"; +import { Target } from "./common"; export type ModuleRef = usize; export type FunctionTypeRef = usize; @@ -29,6 +27,16 @@ export enum NativeType { Auto = _BinaryenTypeAuto() } +export enum FeatureFlags { + Atomics = _BinaryenFeatureAtomics(), + MutableGloabls = _BinaryenFeatureMutableGlobals(), + NontrappingFPToInt = _BinaryenFeatureNontrappingFPToInt(), + SIMD128 = _BinaryenFeatureSIMD128(), + BulkMemory = _BinaryenFeatureBulkMemory(), + SignExt = _BinaryenFeatureSignExt(), + ExceptionHandling = _BinaryenFeatureExceptionHandling() +} + export enum ExpressionId { Invalid = _BinaryenInvalidId(), Block = _BinaryenBlockId(), @@ -38,10 +46,10 @@ export enum ExpressionId { Switch = _BinaryenSwitchId(), Call = _BinaryenCallId(), CallIndirect = _BinaryenCallIndirectId(), - GetLocal = _BinaryenGetLocalId(), - SetLocal = _BinaryenSetLocalId(), - GetGlobal = _BinaryenGetGlobalId(), - SetGlobal = _BinaryenSetGlobalId(), + LocalGet = _BinaryenLocalGetId(), + LocalSet = _BinaryenLocalSetId(), + GlobalGet = _BinaryenGlobalGetId(), + GlobalSet = _BinaryenGlobalSetId(), Load = _BinaryenLoadId(), Store = _BinaryenStoreId(), Const = _BinaryenConstId(), @@ -328,8 +336,8 @@ export enum BinaryOp { } export enum HostOp { - CurrentMemory = _BinaryenCurrentMemory(), - GrowMemory = _BinaryenGrowMemory(), + MemorySize = _BinaryenMemorySize(), + MemoryGrow = _BinaryenMemoryGrow(), } export enum AtomicRMWOp { @@ -451,31 +459,31 @@ export class Module { // constants - createI32(value: i32): ExpressionRef { + i32(value: i32): ExpressionRef { var out = this.lit; _BinaryenLiteralInt32(out, value); return _BinaryenConst(this.ref, out); } - createI64(valueLow: i32, valueHigh: i32 = 0): ExpressionRef { + i64(valueLow: i32, valueHigh: i32 = 0): ExpressionRef { var out = this.lit; _BinaryenLiteralInt64(out, valueLow, valueHigh); return _BinaryenConst(this.ref, out); } - createF32(value: f32): ExpressionRef { + f32(value: f32): ExpressionRef { var out = this.lit; _BinaryenLiteralFloat32(out, value); return _BinaryenConst(this.ref, out); } - createF64(value: f64): ExpressionRef { + f64(value: f64): ExpressionRef { var out = this.lit; _BinaryenLiteralFloat64(out, value); return _BinaryenConst(this.ref, out); } - createV128(bytes: Uint8Array): ExpressionRef { + v128(bytes: Uint8Array): ExpressionRef { assert(bytes.length == 16); var out = this.lit; for (let i = 0; i < 16; ++i) store(out + i, bytes[i]); @@ -485,14 +493,14 @@ export class Module { // expressions - createUnary( + unary( op: UnaryOp, expr: ExpressionRef ): ExpressionRef { return _BinaryenUnary(this.ref, op, expr); } - createBinary( + binary( op: BinaryOp, left: ExpressionRef, right: ExpressionRef @@ -500,7 +508,7 @@ export class Module { return _BinaryenBinary(this.ref, op, left, right); } - createHost( + host( op: HostOp, name: string | null = null, operands: ExpressionRef[] | null = null @@ -514,29 +522,29 @@ export class Module { } } - createGetLocal( + local_get( index: i32, type: NativeType ): ExpressionRef { - return _BinaryenGetLocal(this.ref, index, type); + return _BinaryenLocalGet(this.ref, index, type); } - createTeeLocal( + local_tee( index: i32, value: ExpressionRef ): ExpressionRef { - return _BinaryenTeeLocal(this.ref, index, value); + return _BinaryenLocalTee(this.ref, index, value); } - createGetGlobal( + global_get( name: string, type: NativeType ): ExpressionRef { var cStr = this.allocStringCached(name); - return _BinaryenGetGlobal(this.ref, cStr, type); + return _BinaryenGlobalGet(this.ref, cStr, type); } - createLoad( + load( bytes: Index, signed: bool, ptr: ExpressionRef, @@ -547,7 +555,7 @@ export class Module { return _BinaryenLoad(this.ref, bytes, signed ? 1 : 0, offset, align, type, ptr); } - createStore( + store( bytes: Index, ptr: ExpressionRef, value: ExpressionRef, @@ -555,10 +563,11 @@ export class Module { offset: Index = 0, align: Index = bytes // naturally aligned by default ): ExpressionRef { + if (type < NativeType.None || type > NativeType.V128) throw new Error("here: " + type); return _BinaryenStore(this.ref, bytes, offset, align, ptr, value, type); } - createAtomicLoad( + atomic_load( bytes: Index, ptr: ExpressionRef, type: NativeType, @@ -567,7 +576,7 @@ export class Module { return _BinaryenAtomicLoad(this.ref, bytes, offset, type, ptr); } - createAtomicStore( + atomic_store( bytes: Index, ptr: ExpressionRef, value: ExpressionRef, @@ -577,7 +586,7 @@ export class Module { return _BinaryenAtomicStore(this.ref, bytes, offset, ptr, value, type); } - createAtomicRMW( + atomic_rmw( op: AtomicRMWOp, bytes: Index, offset: Index, @@ -588,7 +597,7 @@ export class Module { return _BinaryenAtomicRMW(this.ref, op, bytes, offset, ptr, value, type); } - createAtomicCmpxchg( + atomic_cmpxchg( bytes: Index, offset: Index, ptr: ExpressionRef, @@ -599,7 +608,7 @@ export class Module { return _BinaryenAtomicCmpxchg(this.ref, bytes, offset, ptr, expected, replacement, type); } - createAtomicWait( + atomic_wait( ptr: ExpressionRef, expected: ExpressionRef, timeout: ExpressionRef, @@ -608,7 +617,7 @@ export class Module { return _BinaryenAtomicWait(this.ref, ptr, expected, timeout, expectedType); } - createAtomicNotify( + atomic_notify( ptr: ExpressionRef, notifyCount: ExpressionRef ): ExpressionRef { @@ -617,22 +626,22 @@ export class Module { // statements - createSetLocal( + local_set( index: Index, value: ExpressionRef ): ExpressionRef { - return _BinaryenSetLocal(this.ref, index, value); + return _BinaryenLocalSet(this.ref, index, value); } - createSetGlobal( + global_set( name: string, value: ExpressionRef ): ExpressionRef { var cStr = this.allocStringCached(name); - return _BinaryenSetGlobal(this.ref, cStr, value); + return _BinaryenGlobalSet(this.ref, cStr, value); } - createBlock( + block( label: string | null, children: ExpressionRef[], type: NativeType = NativeType.None @@ -646,7 +655,7 @@ export class Module { } } - createBreak( + br( label: string | null, condition: ExpressionRef = 0, value: ExpressionRef = 0 @@ -655,13 +664,13 @@ export class Module { return _BinaryenBreak(this.ref, cStr, condition, value); } - createDrop( + drop( expression: ExpressionRef ): ExpressionRef { return _BinaryenDrop(this.ref, expression); } - createLoop( + loop( label: string | null, body: ExpressionRef ): ExpressionRef { @@ -669,7 +678,7 @@ export class Module { return _BinaryenLoop(this.ref, cStr, body); } - createIf( + if( condition: ExpressionRef, ifTrue: ExpressionRef, ifFalse: ExpressionRef = 0 @@ -677,17 +686,17 @@ export class Module { return _BinaryenIf(this.ref, condition, ifTrue, ifFalse); } - createNop(): ExpressionRef { + nop(): ExpressionRef { return _BinaryenNop(this.ref); } - createReturn( + return( expression: ExpressionRef = 0 ): ExpressionRef { return _BinaryenReturn(this.ref, expression); } - createSelect( + select( ifTrue: ExpressionRef, ifFalse: ExpressionRef, condition: ExpressionRef @@ -695,7 +704,7 @@ export class Module { return _BinaryenSelect(this.ref, condition, ifTrue, ifFalse); } - createSwitch( + switch( names: string[], defaultName: string | null, condition: ExpressionRef, @@ -715,7 +724,7 @@ export class Module { } } - createCall( + call( target: string, operands: ExpressionRef[] | null, returnType: NativeType @@ -729,7 +738,7 @@ export class Module { } } - createCallIndirect( + call_indirect( index: ExpressionRef, operands: ExpressionRef[] | null, typeName: string @@ -743,13 +752,13 @@ export class Module { } } - createUnreachable(): ExpressionRef { + unreachable(): ExpressionRef { return _BinaryenUnreachable(this.ref); } // bulk memory - createMemoryCopy( + memory_copy( dest: ExpressionRef, source: ExpressionRef, size: ExpressionRef @@ -757,7 +766,7 @@ export class Module { return _BinaryenMemoryCopy(this.ref, dest, source, size); } - createMemoryFill( + memory_fill( dest: ExpressionRef, value: ExpressionRef, size: ExpressionRef @@ -767,7 +776,7 @@ export class Module { // simd - createSIMDExtract( + simd_extract( op: SIMDExtractOp, vec: ExpressionRef, idx: u8 @@ -775,7 +784,7 @@ export class Module { return _BinaryenSIMDExtract(this.ref, op, vec, idx); } - createSIMDReplace( + simd_replace( op: SIMDReplaceOp, vec: ExpressionRef, idx: u8, @@ -784,7 +793,7 @@ export class Module { return _BinaryenSIMDReplace(this.ref, op, vec, idx, value); } - createSIMDShuffle( + simd_shuffle( vec1: ExpressionRef, vec2: ExpressionRef, mask: Uint8Array @@ -798,7 +807,7 @@ export class Module { } } - createSIMDBitselect( + simd_bitselect( vec1: ExpressionRef, vec2: ExpressionRef, cond: ExpressionRef @@ -806,7 +815,7 @@ export class Module { return _BinaryenSIMDBitselect(this.ref, vec1, vec2, cond); } - createSIMDShift( + simd_shift( op: SIMDShiftOp, vec: ExpressionRef, shift: ExpressionRef @@ -985,8 +994,8 @@ export class Module { segs[i] = allocU8Array(buffer); psvs[i] = 0; // no passive segments currently offs[i] = target == Target.WASM64 - ? this.createI64(i64_low(offset), i64_high(offset)) - : this.createI32(i64_low(offset)); + ? this.i64(i64_low(offset), i64_high(offset)) + : this.i32(i64_low(offset)); sizs[i] = buffer.length; } var cArr1 = allocI32Array(segs); @@ -1046,6 +1055,14 @@ export class Module { _BinaryenSetDebugInfo(on); } + getFeatures(): BinaryenFeatureFlags { + return _BinaryenModuleGetFeatures(this.ref); + } + + setFeatures(featureFlags: BinaryenFeatureFlags): void { + _BinaryenModuleSetFeatures(this.ref, featureFlags); + } + optimize(func: FunctionRef = 0): void { if (func) { _BinaryenFunctionOptimize(func, this.ref); @@ -1181,19 +1198,19 @@ export class Module { case ExpressionId.Const: { switch (_BinaryenExpressionGetType(expr)) { case NativeType.I32: { - return this.createI32(_BinaryenConstGetValueI32(expr)); + return this.i32(_BinaryenConstGetValueI32(expr)); } case NativeType.I64: { - return this.createI64( + return this.i64( _BinaryenConstGetValueI64Low(expr), _BinaryenConstGetValueI64High(expr) ); } case NativeType.F32: { - return this.createF32(_BinaryenConstGetValueF32(expr)); + return this.f32(_BinaryenConstGetValueF32(expr)); } case NativeType.F64: { - return this.createF64(_BinaryenConstGetValueF64(expr)); + return this.f64(_BinaryenConstGetValueF64(expr)); } case NativeType.V128: { // TODO @@ -1204,16 +1221,16 @@ export class Module { } } } - case ExpressionId.GetLocal: { - return _BinaryenGetLocal(this.ref, - _BinaryenGetLocalGetIndex(expr), + case ExpressionId.LocalGet: { + return _BinaryenLocalGet(this.ref, + _BinaryenLocalGetGetIndex(expr), _BinaryenExpressionGetType(expr) ); } - case ExpressionId.GetGlobal: { - let globalName = _BinaryenGetGlobalGetName(expr); + case ExpressionId.GlobalGet: { + let globalName = _BinaryenGlobalGetGetName(expr); if (!globalName) break; - return _BinaryenGetGlobal(this.ref, globalName, _BinaryenExpressionGetType(expr)); + return _BinaryenGlobalGet(this.ref, globalName, _BinaryenExpressionGetType(expr)); } case ExpressionId.Load: { if (!(nested1 = this.cloneExpression(_BinaryenLoadGetPtr(expr), noSideEffects, maxDepth))) { @@ -1312,24 +1329,24 @@ export function getConstValueF64(expr: ExpressionRef): f32 { return _BinaryenConstGetValueF64(expr); } -export function getGetLocalIndex(expr: ExpressionRef): Index { - return _BinaryenGetLocalGetIndex(expr); +export function getLocalGetIndex(expr: ExpressionRef): Index { + return _BinaryenLocalGetGetIndex(expr); } -export function getSetLocalIndex(expr: ExpressionRef): Index { - return _BinaryenSetLocalGetIndex(expr); +export function getLocalSetIndex(expr: ExpressionRef): Index { + return _BinaryenLocalSetGetIndex(expr); } -export function getSetLocalValue(expr: ExpressionRef): ExpressionRef { - return _BinaryenSetLocalGetValue(expr); +export function getLocalSetValue(expr: ExpressionRef): ExpressionRef { + return _BinaryenLocalSetGetValue(expr); } -export function isTeeLocal(expr: ExpressionRef): bool { - return _BinaryenSetLocalIsTee(expr); +export function isLocalTee(expr: ExpressionRef): bool { + return _BinaryenLocalSetIsTee(expr); } -export function getGetGlobalName(expr: ExpressionRef): string | null { - return readString(_BinaryenGetGlobalGetName(expr)); +export function getGlobalGetName(expr: ExpressionRef): string | null { + return readString(_BinaryenGlobalGetGetName(expr)); } export function getBinaryOp(expr: ExpressionRef): BinaryOp { @@ -1448,6 +1465,14 @@ export function getCallTarget(expr: ExpressionRef): string | null { return readString(_BinaryenCallGetTarget(expr)); } +export function getCallOperandCount(expr: ExpressionRef): i32 { + return _BinaryenCallGetNumOperands(expr); +} + +export function getCallOperand(expr: ExpressionRef, index: Index): ExpressionRef { + return _BinaryenCallGetOperand(expr, index); +} + export function getHostOp(expr: ExpressionRef): ExpressionRef { return _BinaryenHostGetOp(expr); } @@ -1765,3 +1790,177 @@ export function needsExplicitUnreachable(expr: ExpressionRef): bool { } return true; } + +/** Traverses all expression members of an expression, calling the given visitor. */ +export function traverse(expr: ExpressionRef, data: T, visit: (expr: ExpressionRef, data: T) => void): bool { + switch (getExpressionId(expr)) { + case ExpressionId.Block: { + for (let i = 0, n = _BinaryenBlockGetNumChildren(expr); i < n; ++i) { + visit(_BinaryenBlockGetChild(expr, i), data); + } + break; + } + case ExpressionId.If: { + visit(_BinaryenIfGetCondition(expr), data); + visit(_BinaryenIfGetIfTrue(expr), data); + let ifFalse = _BinaryenIfGetIfFalse(expr); + if (ifFalse) visit(ifFalse, data); + break; + } + case ExpressionId.Loop: { + visit(_BinaryenLoopGetBody(expr), data); + break; + } + case ExpressionId.Break: { + let condition = _BinaryenBreakGetCondition(expr); + if (condition) visit(condition, data); + break; + } + case ExpressionId.Switch: { + visit(_BinaryenSwitchGetCondition(expr), data); + break; + } + case ExpressionId.Call: { + for (let i = 0, n = _BinaryenCallGetNumOperands(expr); i < n; ++i) { + visit(_BinaryenCallGetOperand(expr, i), data); + } + break; + } + case ExpressionId.CallIndirect: { + for (let i = 0, n = _BinaryenCallIndirectGetNumOperands(expr); i < n; ++i) { + visit(_BinaryenCallIndirectGetOperand(expr, i), data); + } + break; + } + case ExpressionId.LocalGet: { + break; + } + case ExpressionId.LocalSet: { + visit(_BinaryenLocalSetGetValue(expr), data); + break; + } + case ExpressionId.GlobalGet: { + break; + } + case ExpressionId.GlobalSet: { + visit(_BinaryenGlobalSetGetValue(expr), data); + break; + } + case ExpressionId.Load: { + visit(_BinaryenLoadGetPtr(expr), data); + break; + } + case ExpressionId.Store: { + visit(_BinaryenStoreGetPtr(expr), data); + visit(_BinaryenStoreGetValue(expr), data); + break; + } + case ExpressionId.AtomicRMW: { + visit(_BinaryenAtomicRMWGetPtr(expr), data); + visit(_BinaryenAtomicRMWGetValue(expr), data); + break; + } + case ExpressionId.AtomicCmpxchg: { + visit(_BinaryenAtomicCmpxchgGetPtr(expr), data); + visit(_BinaryenAtomicCmpxchgGetExpected(expr), data); + visit(_BinaryenAtomicCmpxchgGetReplacement(expr), data); + break; + } + case ExpressionId.AtomicWait: { + visit(_BinaryenAtomicWaitGetPtr(expr), data); + visit(_BinaryenAtomicWaitGetExpected(expr), data); + visit(_BinaryenAtomicWaitGetTimeout(expr), data); + break; + } + case ExpressionId.AtomicNotify: { + visit(_BinaryenAtomicNotifyGetPtr(expr), data); + break; + } + case ExpressionId.SIMDExtract: { + visit(_BinaryenSIMDExtractGetVec(expr), data); + break; + } + case ExpressionId.SIMDReplace: { + visit(_BinaryenSIMDReplaceGetVec(expr), data); + visit(_BinaryenSIMDReplaceGetValue(expr), data); + break; + } + case ExpressionId.SIMDShuffle: { + visit(_BinaryenSIMDShuffleGetLeft(expr), data); + visit(_BinaryenSIMDShuffleGetRight(expr), data); + break; + } + case ExpressionId.SIMDBitselect: { + visit(_BinaryenSIMDBitselectGetLeft(expr), data); + visit(_BinaryenSIMDBitselectGetRight(expr), data); + visit(_BinaryenSIMDBitselectGetCond(expr), data); + break; + } + case ExpressionId.SIMDShift: { + visit(_BinaryenSIMDShiftGetVec(expr), data); + visit(_BinaryenSIMDShiftGetShift(expr), data); + break; + } + case ExpressionId.MemoryInit: { + visit(_BinaryenMemoryInitGetDest(expr), data); + visit(_BinaryenMemoryInitGetOffset(expr), data); + visit(_BinaryenMemoryInitGetSize(expr), data); + break; + } + case ExpressionId.DataDrop: { + break; + } + case ExpressionId.MemoryCopy: { + visit(_BinaryenMemoryCopyGetDest(expr), data); + visit(_BinaryenMemoryCopyGetSource(expr), data); + visit(_BinaryenMemoryCopyGetSize(expr), data); + break; + } + case ExpressionId.MemoryFill: { + visit(_BinaryenMemoryFillGetDest(expr), data); + visit(_BinaryenMemoryFillGetValue(expr), data); + visit(_BinaryenMemoryFillGetSize(expr), data); + break; + } + case ExpressionId.Const: { + break; + } + case ExpressionId.Unary: { + visit(_BinaryenUnaryGetValue(expr), data); + break; + } + case ExpressionId.Binary: { + visit(_BinaryenBinaryGetLeft(expr), data); + visit(_BinaryenBinaryGetRight(expr), data); + break; + } + case ExpressionId.Select: { + visit(_BinaryenSelectGetIfTrue(expr), data); + visit(_BinaryenSelectGetIfFalse(expr), data); + visit(_BinaryenSelectGetCondition(expr), data); + break; + } + case ExpressionId.Drop: { + visit(_BinaryenDropGetValue(expr), data); + break; + } + case ExpressionId.Return: { + visit(_BinaryenReturnGetValue(expr), data); + break; + } + case ExpressionId.Host: { + for (let i = 0, n = _BinaryenHostGetNumOperands(expr); i < n; ++i) { + visit(_BinaryenHostGetOperand(expr, i), data); + } + break; + } + case ExpressionId.Nop: { + break; + } + case ExpressionId.Unreachable: { + break; + } + default: assert(false); + } + return true; +} diff --git a/src/parser.ts b/src/parser.ts index 95939e11d2..55ca4982f1 100644 --- a/src/parser.ts +++ b/src/parser.ts @@ -171,31 +171,34 @@ export class Parser extends DiagnosticEmitter { // check modifiers var exportStart: i32 = 0; var exportEnd: i32 = 0; + var defaultStart: i32 = 0; + var defaultEnd: i32 = 0; if (tn.skip(Token.EXPORT)) { - if (tn.skip(Token.DEFAULT)) { - this.error( - DiagnosticCode.Operation_not_supported, - tn.range() - ); - } if (startPos < 0) startPos = tn.tokenPos; flags |= CommonFlags.EXPORT; exportStart = tn.tokenPos; exportEnd = tn.pos; + if (tn.skip(Token.DEFAULT)) { + defaultStart = tn.tokenPos; + defaultEnd = tn.pos; + } } var declareStart: i32 = 0; var declareEnd: i32 = 0; var contextIsAmbient = namespace != null && namespace.is(CommonFlags.AMBIENT); if (tn.skip(Token.DECLARE)) { - if (startPos < 0) startPos = tn.tokenPos; if (contextIsAmbient) { this.error( DiagnosticCode.A_declare_modifier_cannot_be_used_in_an_already_ambient_context, tn.range() ); // recoverable + } else { + if (startPos < 0) startPos = tn.tokenPos; + declareStart = startPos; + declareEnd = tn.pos; + flags |= CommonFlags.DECLARE | CommonFlags.AMBIENT; } - flags |= CommonFlags.DECLARE | CommonFlags.AMBIENT; } else if (contextIsAmbient) { flags |= CommonFlags.AMBIENT; } @@ -297,7 +300,18 @@ export class Parser extends DiagnosticEmitter { // handle plain exports if (flags & CommonFlags.EXPORT) { - statement = this.parseExport(tn, startPos, (flags & CommonFlags.DECLARE) != 0); + if (defaultEnd && tn.skipIdentifier(IdentifierHandling.PREFER)) { + if (declareEnd) { + this.error( + DiagnosticCode.An_export_assignment_cannot_have_modifiers, + tn.range(declareStart, declareEnd) + ); + } + statement = this.parseExportDefaultAlias(tn, startPos, defaultStart, defaultEnd); + defaultStart = defaultEnd = 0; // consume + } else { + statement = this.parseExport(tn, startPos, (flags & CommonFlags.DECLARE) != 0); + } // handle non-declaration statements } else { @@ -330,6 +344,25 @@ export class Parser extends DiagnosticEmitter { ); } } + + // check if this an `export default` declaration + if (defaultEnd && statement !== null) { + switch (statement.kind) { + case NodeKind.ENUMDECLARATION: + case NodeKind.FUNCTIONDECLARATION: + case NodeKind.CLASSDECLARATION: + case NodeKind.INTERFACEDECLARATION: + case NodeKind.NAMESPACEDECLARATION: { + return Node.createExportDefaultStatement(statement, tn.range(startPos, tn.pos)); + } + default: { + this.error( + DiagnosticCode._0_modifier_cannot_be_used_here, + tn.range(defaultStart, defaultEnd), "default" + ); + } + } + } return statement; } @@ -1588,6 +1621,7 @@ export class Parser extends DiagnosticEmitter { } } while (!tn.skip(Token.CLOSEBRACE)); } + declaration.range.end = tn.pos; return declaration; } @@ -1639,6 +1673,7 @@ export class Parser extends DiagnosticEmitter { } } while (!tn.skip(Token.CLOSEBRACE)); } + declaration.range.end = tn.pos; return Node.createClassExpression(declaration); } @@ -2162,7 +2197,7 @@ export class Parser extends DiagnosticEmitter { let identifier = Node.createIdentifierExpression(tn.readIdentifier(), tn.range()); if (tn.skip(Token.OPENBRACE)) { let members = new Array(); - let ns = Node.createNamespaceDeclaration( + let declaration = Node.createNamespaceDeclaration( identifier, members, decorators, @@ -2170,7 +2205,7 @@ export class Parser extends DiagnosticEmitter { tn.range(startPos, tn.pos) ); while (!tn.skip(Token.CLOSEBRACE)) { - let member = this.parseTopLevelStatement(tn, ns); + let member = this.parseTopLevelStatement(tn, declaration); if (member) members.push(member); else { this.skipStatement(tn); @@ -2183,8 +2218,9 @@ export class Parser extends DiagnosticEmitter { } } } + declaration.range.end = tn.pos; tn.skip(Token.SEMICOLON); - return ns; + return declaration; } else { this.error( DiagnosticCode._0_expected, @@ -2318,6 +2354,28 @@ export class Parser extends DiagnosticEmitter { return null; } + parseExportDefaultAlias( + tn: Tokenizer, + startPos: i32, + defaultStart: i32, + defaultEnd: i32 + ): ExportStatement { + + // at 'export' 'default': [Known-To-Be-]Identifier + + var name = tn.readIdentifier(); + var range = tn.range(); + var ret = Node.createExportStatement([ + Node.createExportMember( + Node.createIdentifierExpression(name, range), + Node.createIdentifierExpression("default", tn.range(defaultStart, defaultEnd)), + range + ) + ], null, false, tn.range(startPos, tn.pos)); + tn.skip(Token.SEMICOLON); + return ret; + } + parseImport( tn: Tokenizer ): ImportStatement | null { @@ -2330,7 +2388,7 @@ export class Parser extends DiagnosticEmitter { var members: ImportDeclaration[] | null = null; var namespaceName: IdentifierExpression | null = null; var skipFrom = false; - if (tn.skip(Token.OPENBRACE)) { + if (tn.skip(Token.OPENBRACE)) { // import { ... } from "file" members = new Array(); while (!tn.skip(Token.CLOSEBRACE)) { let member = this.parseImportDeclaration(tn); @@ -2348,7 +2406,7 @@ export class Parser extends DiagnosticEmitter { } } } - } else if (tn.skip(Token.ASTERISK)) { + } else if (tn.skip(Token.ASTERISK)) { // import * from "file" if (tn.skip(Token.AS)) { if (tn.skipIdentifier()) { namespaceName = Node.createIdentifierExpression(tn.readIdentifier(), tn.range()); @@ -2366,7 +2424,25 @@ export class Parser extends DiagnosticEmitter { ); return null; } - } else { + } else if (tn.skip(Token.IDENTIFIER, IdentifierHandling.PREFER)) { // import Name from "file" + let name = tn.readIdentifier(); + let range = tn.range(); + members = [ + Node.createImportDeclaration( + Node.createIdentifierExpression("default", range), + Node.createIdentifierExpression(name, range), + range + ) + ]; + if (tn.skip(Token.COMMA)) { + // TODO: default + star, default + members + this.error( + DiagnosticCode.Operation_not_supported, + tn.range() + ); + return null; + } + } else { // import "file" skipFrom = true; } diff --git a/src/program.ts b/src/program.ts index e10467f04b..9fd16a6600 100644 --- a/src/program.ts +++ b/src/program.ts @@ -14,12 +14,12 @@ import { LIBRARY_SUBST, INDEX_SUFFIX, CommonSymbols, - LibrarySymbols + Feature, + Target } from "./common"; import { - Options, - Feature + Options } from "./compiler"; import { @@ -75,7 +75,8 @@ import { VariableStatement, decoratorNameToKind, - findDecorator + findDecorator, + ExportDefaultStatement } from "./ast"; import { @@ -84,7 +85,12 @@ import { } from "./module"; import { - CharCode + CharCode, + writeI8, + writeI16, + writeI32, + writeF32, + writeF64 } from "./util"; import { @@ -315,8 +321,6 @@ export class Program extends DiagnosticEmitter { nativeSource: Source; /** Special native code file. */ nativeFile: File; - /** Explicitly annotated start function. */ - explicitStartFunction: FunctionPrototype | null = null; // lookup maps @@ -330,34 +334,75 @@ export class Program extends DiagnosticEmitter { instancesByName: Map = new Map(); /** Classes backing basic types like `i32`. */ typeClasses: Map = new Map(); + /** Managed classes contained in the program, by id. */ + managedClasses: Map = new Map(); - // runtime references + // standard references + /** ArrayBufferView reference. */ + arrayBufferViewInstance: Class; /** ArrayBuffer instance reference. */ - arrayBufferInstance: Class | null = null; + arrayBufferInstance: Class; /** Array prototype reference. */ - arrayPrototype: ClassPrototype | null = null; + arrayPrototype: ClassPrototype; + /** Set prototype reference. */ + setPrototype: ClassPrototype; + /** Map prototype reference. */ + mapPrototype: ClassPrototype; + /** Fixed array prototype reference. */ + fixedArrayPrototype: ClassPrototype; + /** Int8Array prototype. */ + i8ArrayPrototype: ClassPrototype; + /** Int16Array prototype. */ + i16ArrayPrototype: ClassPrototype; + /** Int32Array prototype. */ + i32ArrayPrototype: ClassPrototype; + /** Int64Array prototype. */ + i64ArrayPrototype: ClassPrototype; + /** Uint8Array prototype. */ + u8ArrayPrototype: ClassPrototype; + /** Uint8ClampedArray prototype. */ + u8ClampedArrayPrototype: ClassPrototype; + /** Uint16Array prototype. */ + u16ArrayPrototype: ClassPrototype; + /** Uint32Array prototype. */ + u32ArrayPrototype: ClassPrototype; + /** Uint64Array prototype. */ + u64ArrayPrototype: ClassPrototype; + /** Float32Array prototype. */ + f32ArrayPrototype: ClassPrototype; + /** Float64Array prototype. */ + f64ArrayPrototype: ClassPrototype; /** String instance reference. */ - stringInstance: Class | null = null; + stringInstance: Class; /** Abort function reference, if present. */ - abortInstance: Function | null = null; - /** Memory allocation function. */ - memoryAllocateInstance: Function | null = null; - - // gc integration - - /** Whether a garbage collector is present or not. */ - hasGC: bool = false; - /** Garbage collector allocation function. */ - gcAllocateInstance: Function | null = null; - /** Garbage collector link function called when a managed object is referenced from a parent. */ - gcLinkInstance: Function | null = null; - /** Garbage collector mark function called to on reachable managed objects. */ - gcMarkInstance: Function | null = null; - /** Size of a managed object header. */ - gcHeaderSize: u32 = 0; - /** Offset of the GC hook. */ - gcHookOffset: u32 = 0; + abortInstance: Function; + + // runtime references + + /** RT `__alloc(size: usize, id: u32): usize` */ + allocInstance: Function; + /** RT `__realloc(ref: usize, newSize: usize): usize` */ + reallocInstance: Function; + /** RT `__free(ref: usize): void` */ + freeInstance: Function; + /** RT `__retain(ref: usize): usize` */ + retainInstance: Function; + /** RT `__release(ref: usize): void` */ + releaseInstance: Function; + /** RT `__collect(): void` */ + collectInstance: Function; + /** RT `__visit(ref: usize, cookie: u32): void` */ + visitInstance: Function; + /** RT `__typeinfo(id: u32): RTTIFlags` */ + typeinfoInstance: Function; + /** RT `__instanceof(ref: usize, superId: u32): bool` */ + instanceofInstance: Function; + /** RT `__allocArray(length: i32, alignLog2: usize, id: u32, data: usize = 0): usize` */ + allocArrayInstance: Function; + + /** Next class id. */ + nextClassId: u32 = 0; /** Constructs a new program, optionally inheriting parser diagnostics. */ constructor( @@ -373,6 +418,26 @@ export class Program extends DiagnosticEmitter { this.resolver = new Resolver(this); } + /** Writes a common runtime header to the specified buffer. */ + writeRuntimeHeader(buffer: Uint8Array, offset: i32, classInstance: Class, payloadSize: u32): void { + // BLOCK { + // mmInfo: usize // WASM64 TODO + // gcInfo: u32 + // rtId: u32 + // rtSize: u32 + // } + assert(payloadSize < (1 << 28)); // 1 bit BUFFERED + 3 bits color + writeI32(payloadSize, buffer, offset); + writeI32(1, buffer, offset + 4); // RC=1 + writeI32(classInstance.id, buffer, offset + 8); + writeI32(payloadSize, buffer, offset + 12); + } + + /** Gets the size of a runtime header. */ + get runtimeHeaderSize(): i32 { + return 16; + } + /** Creates a native variable declaration. */ makeNativeVariableDeclaration( /** The simple name of the variable */ @@ -505,25 +570,25 @@ export class Program extends DiagnosticEmitter { if (options.hasFeature(Feature.SIMD)) this.registerNativeType(CommonSymbols.v128, Type.v128); // register compiler hints - this.registerConstantInteger(LibrarySymbols.ASC_TARGET, Type.i32, - i64_new(options.isWasm64 ? 2 : 1)); - this.registerConstantInteger(LibrarySymbols.ASC_NO_ASSERT, Type.bool, + this.registerConstantInteger(CommonSymbols.ASC_TARGET, Type.i32, + i64_new(options.isWasm64 ? Target.WASM64 : Target.WASM32)); + this.registerConstantInteger(CommonSymbols.ASC_NO_ASSERT, Type.bool, i64_new(options.noAssert ? 1 : 0, 0)); - this.registerConstantInteger(LibrarySymbols.ASC_MEMORY_BASE, Type.i32, + this.registerConstantInteger(CommonSymbols.ASC_MEMORY_BASE, Type.i32, i64_new(options.memoryBase, 0)); - this.registerConstantInteger(LibrarySymbols.ASC_OPTIMIZE_LEVEL, Type.i32, + this.registerConstantInteger(CommonSymbols.ASC_OPTIMIZE_LEVEL, Type.i32, i64_new(options.optimizeLevelHint, 0)); - this.registerConstantInteger(LibrarySymbols.ASC_SHRINK_LEVEL, Type.i32, + this.registerConstantInteger(CommonSymbols.ASC_SHRINK_LEVEL, Type.i32, i64_new(options.shrinkLevelHint, 0)); - this.registerConstantInteger(LibrarySymbols.ASC_FEATURE_MUTABLE_GLOBAL, Type.bool, + this.registerConstantInteger(CommonSymbols.ASC_FEATURE_MUTABLE_GLOBAL, Type.bool, i64_new(options.hasFeature(Feature.MUTABLE_GLOBAL) ? 1 : 0, 0)); - this.registerConstantInteger(LibrarySymbols.ASC_FEATURE_SIGN_EXTENSION, Type.bool, + this.registerConstantInteger(CommonSymbols.ASC_FEATURE_SIGN_EXTENSION, Type.bool, i64_new(options.hasFeature(Feature.SIGN_EXTENSION) ? 1 : 0, 0)); - this.registerConstantInteger(LibrarySymbols.ASC_FEATURE_BULK_MEMORY, Type.bool, + this.registerConstantInteger(CommonSymbols.ASC_FEATURE_BULK_MEMORY, Type.bool, i64_new(options.hasFeature(Feature.BULK_MEMORY) ? 1 : 0, 0)); - this.registerConstantInteger(LibrarySymbols.ASC_FEATURE_SIMD, Type.bool, + this.registerConstantInteger(CommonSymbols.ASC_FEATURE_SIMD, Type.bool, i64_new(options.hasFeature(Feature.SIMD) ? 1 : 0, 0)); - this.registerConstantInteger(LibrarySymbols.ASC_FEATURE_THREADS, Type.bool, + this.registerConstantInteger(CommonSymbols.ASC_FEATURE_THREADS, Type.bool, i64_new(options.hasFeature(Feature.THREADS) ? 1 : 0, 0)); // remember deferred elements @@ -546,6 +611,10 @@ export class Program extends DiagnosticEmitter { this.initializeExports(statement, file, queuedExports, queuedExportsStar); break; } + case NodeKind.EXPORTDEFAULT: { + this.initializeExportDefault(statement, file, queuedExtends, queuedImplements); + break; + } case NodeKind.IMPORT: { this.initializeImports(statement, file, queuedImports, queuedExports); break; @@ -616,11 +685,10 @@ export class Program extends DiagnosticEmitter { true // isImport ); } else { + // FIXME: file not found is not reported if this happens? this.error( DiagnosticCode.Module_0_has_no_exported_member_1, - foreignIdentifier.range, - queuedImport.foreignPath, - foreignIdentifier.text + foreignIdentifier.range, queuedImport.foreignPath, foreignIdentifier.text ); } } else { // i.e. import * as bar from "./bar" @@ -683,21 +751,43 @@ export class Program extends DiagnosticEmitter { } } + // register ArrayBuffer (id=0), String (id=1), ArrayBufferView (id=2) + assert(this.nextClassId == 0); + this.arrayBufferInstance = this.requireClass(CommonSymbols.ArrayBuffer); + assert(this.arrayBufferInstance.id == 0); + this.stringInstance = this.requireClass(CommonSymbols.String); + assert(this.stringInstance.id == 1); + this.arrayBufferViewInstance = this.requireClass(CommonSymbols.ArrayBufferView); + assert(this.arrayBufferViewInstance.id == 2); + // register classes backing basic types - this.registerNativeTypeClass(TypeKind.I8, LibrarySymbols.I8); - this.registerNativeTypeClass(TypeKind.I16, LibrarySymbols.I16); - this.registerNativeTypeClass(TypeKind.I32, LibrarySymbols.I32); - this.registerNativeTypeClass(TypeKind.I64, LibrarySymbols.I64); - this.registerNativeTypeClass(TypeKind.ISIZE, LibrarySymbols.Isize); - this.registerNativeTypeClass(TypeKind.U8, LibrarySymbols.U8); - this.registerNativeTypeClass(TypeKind.U16, LibrarySymbols.U16); - this.registerNativeTypeClass(TypeKind.U32, LibrarySymbols.U32); - this.registerNativeTypeClass(TypeKind.U64, LibrarySymbols.U64); - this.registerNativeTypeClass(TypeKind.USIZE, LibrarySymbols.Usize); - this.registerNativeTypeClass(TypeKind.BOOL, LibrarySymbols.Bool); - this.registerNativeTypeClass(TypeKind.F32, LibrarySymbols.F32); - this.registerNativeTypeClass(TypeKind.F64, LibrarySymbols.F64); - if (options.hasFeature(Feature.SIMD)) this.registerNativeTypeClass(TypeKind.V128, LibrarySymbols.V128); + this.registerNativeTypeClass(TypeKind.I8, CommonSymbols.I8); + this.registerNativeTypeClass(TypeKind.I16, CommonSymbols.I16); + this.registerNativeTypeClass(TypeKind.I32, CommonSymbols.I32); + this.registerNativeTypeClass(TypeKind.I64, CommonSymbols.I64); + this.registerNativeTypeClass(TypeKind.ISIZE, CommonSymbols.Isize); + this.registerNativeTypeClass(TypeKind.U8, CommonSymbols.U8); + this.registerNativeTypeClass(TypeKind.U16, CommonSymbols.U16); + this.registerNativeTypeClass(TypeKind.U32, CommonSymbols.U32); + this.registerNativeTypeClass(TypeKind.U64, CommonSymbols.U64); + this.registerNativeTypeClass(TypeKind.USIZE, CommonSymbols.Usize); + this.registerNativeTypeClass(TypeKind.BOOL, CommonSymbols.Bool); + this.registerNativeTypeClass(TypeKind.F32, CommonSymbols.F32); + this.registerNativeTypeClass(TypeKind.F64, CommonSymbols.F64); + if (options.hasFeature(Feature.SIMD)) this.registerNativeTypeClass(TypeKind.V128, CommonSymbols.V128); + + // register views but don't instantiate them yet + this.i8ArrayPrototype = this.require(CommonSymbols.Int8Array, ElementKind.CLASS_PROTOTYPE); + this.i16ArrayPrototype = this.require(CommonSymbols.Int16Array, ElementKind.CLASS_PROTOTYPE); + this.i32ArrayPrototype = this.require(CommonSymbols.Int32Array, ElementKind.CLASS_PROTOTYPE); + this.i64ArrayPrototype = this.require(CommonSymbols.Int64Array, ElementKind.CLASS_PROTOTYPE); + this.u8ArrayPrototype = this.require(CommonSymbols.Uint8Array, ElementKind.CLASS_PROTOTYPE); + this.u8ClampedArrayPrototype = this.require(CommonSymbols.Uint8ClampedArray, ElementKind.CLASS_PROTOTYPE); + this.u16ArrayPrototype = this.require(CommonSymbols.Uint16Array, ElementKind.CLASS_PROTOTYPE); + this.u32ArrayPrototype = this.require(CommonSymbols.Uint32Array, ElementKind.CLASS_PROTOTYPE); + this.u64ArrayPrototype = this.require(CommonSymbols.Uint64Array, ElementKind.CLASS_PROTOTYPE); + this.f32ArrayPrototype = this.require(CommonSymbols.Float32Array, ElementKind.CLASS_PROTOTYPE); + this.f64ArrayPrototype = this.require(CommonSymbols.Float64Array, ElementKind.CLASS_PROTOTYPE); // resolve base prototypes of derived classes var resolver = this.resolver; @@ -738,90 +828,38 @@ export class Program extends DiagnosticEmitter { if (globalAliases) { for (let [alias, name] of globalAliases) { if (!name.length) continue; // explicitly disabled - let elementsByName = this.elementsByName; - let element = elementsByName.get(name); - if (element) { - if (elementsByName.has(alias)) throw new Error("duplicate global element: " + name); - elementsByName.set(alias, element); + let firstChar = name.charCodeAt(0); + if (firstChar >= CharCode._0 && firstChar <= CharCode._9) { + this.registerConstantInteger(alias, Type.i32, i64_new(parseI32(name, 10))); + } else { + let elementsByName = this.elementsByName; + let element = elementsByName.get(name); + if (element) { + if (elementsByName.has(alias)) throw new Error("duplicate global element: " + name); + elementsByName.set(alias, element); + } + else throw new Error("no such global element: " + name); } - else throw new Error("no such global element: " + name); } } } - // register global library elements - { - let element: Element | null; - if (element = this.lookupGlobal(LibrarySymbols.String)) { - assert(element.kind == ElementKind.CLASS_PROTOTYPE); - this.stringInstance = resolver.resolveClass(element, null); - } - if (element = this.lookupGlobal(LibrarySymbols.ArrayBuffer)) { - assert(element.kind == ElementKind.CLASS_PROTOTYPE); - this.arrayBufferInstance = resolver.resolveClass(element, null); - } - if (element = this.lookupGlobal(LibrarySymbols.Array)) { - assert(element.kind == ElementKind.CLASS_PROTOTYPE); - this.arrayPrototype = element; - } - if (element = this.lookupGlobal(LibrarySymbols.abort)) { - assert(element.kind == ElementKind.FUNCTION_PROTOTYPE); - this.abortInstance = this.resolver.resolveFunction(element, null); - } - if (element = this.lookupGlobal(LibrarySymbols.memory)) { - if (element = element.lookupInSelf(LibrarySymbols.allocate)) { - assert(element.kind == ElementKind.FUNCTION_PROTOTYPE); - this.memoryAllocateInstance = this.resolver.resolveFunction(element, null); - } - } - } - - // register GC hooks if present - // FIXME: think about a better way than globals to model this, maybe a GC namespace that can be - // dynamically extended by a concrete implementation but then has `@unsafe` methods that normal - // code cannot call without explicitly enabling it with a flag. - if ( - this.elementsByName.has("__gc_allocate") && - this.elementsByName.has("__gc_link") && - this.elementsByName.has("__gc_mark") - ) { - // __gc_allocate(usize, (ref: usize) => void): usize - let element = this.elementsByName.get("__gc_allocate"); - assert(element.kind == ElementKind.FUNCTION_PROTOTYPE); - let gcAllocateInstance = assert(this.resolver.resolveFunction(element, null)); - let signature = gcAllocateInstance.signature; - assert(signature.parameterTypes.length == 2); - assert(signature.parameterTypes[0] == this.options.usizeType); - assert(signature.parameterTypes[1].signatureReference); - assert(signature.returnType == this.options.usizeType); - - // __gc_link(usize, usize): void - element = this.elementsByName.get("__gc_link"); - assert(element.kind == ElementKind.FUNCTION_PROTOTYPE); - let gcLinkInstance = assert(this.resolver.resolveFunction(element, null)); - signature = gcLinkInstance.signature; - assert(signature.parameterTypes.length == 2); - assert(signature.parameterTypes[0] == this.options.usizeType); - assert(signature.parameterTypes[1] == this.options.usizeType); - assert(signature.returnType == Type.void); - - // __gc_mark(usize): void - element = this.elementsByName.get("__gc_mark"); - assert(element.kind == ElementKind.FUNCTION_PROTOTYPE); - let gcMarkInstance = assert(this.resolver.resolveFunction(element, null)); - signature = gcMarkInstance.signature; - assert(signature.parameterTypes.length == 1); - assert(signature.parameterTypes[0] == this.options.usizeType); - assert(signature.returnType == Type.void); - - this.gcAllocateInstance = gcAllocateInstance; - this.gcLinkInstance = gcLinkInstance; - this.gcMarkInstance = gcMarkInstance; - let gcHookOffset = 2 * options.usizeType.byteSize; // .next + .prev - this.gcHookOffset = gcHookOffset; - this.gcHeaderSize = (gcHookOffset + 4 + 7) & ~7; // + .hook index + alignment - this.hasGC = true; - } + // register stdlib components + this.arrayPrototype = this.require(CommonSymbols.Array, ElementKind.CLASS_PROTOTYPE); + this.fixedArrayPrototype = this.require(CommonSymbols.FixedArray, ElementKind.CLASS_PROTOTYPE); + this.setPrototype = this.require(CommonSymbols.Set, ElementKind.CLASS_PROTOTYPE); + this.mapPrototype = this.require(CommonSymbols.Map, ElementKind.CLASS_PROTOTYPE); + this.abortInstance = this.requireFunction(CommonSymbols.abort); + this.allocInstance = this.requireFunction(CommonSymbols.alloc); + this.reallocInstance = this.requireFunction(CommonSymbols.realloc); + this.freeInstance = this.requireFunction(CommonSymbols.free); + this.retainInstance = this.requireFunction(CommonSymbols.retain); + this.releaseInstance = this.requireFunction(CommonSymbols.release); + this.collectInstance = this.requireFunction(CommonSymbols.collect); + this.typeinfoInstance = this.requireFunction(CommonSymbols.typeinfo); + this.instanceofInstance = this.requireFunction(CommonSymbols.instanceof_); + this.visitInstance = this.requireFunction(CommonSymbols.visit); + this.allocArrayInstance = this.requireFunction(CommonSymbols.allocArray); // mark module exports, i.e. to apply proper wrapping behavior on the boundaries for (let file of this.filesByName.values()) { @@ -831,6 +869,30 @@ export class Program extends DiagnosticEmitter { } } + /** Requires that a global library element of the specified kind is present and returns it. */ + private require(name: string, kind: ElementKind): Element { + var element = this.lookupGlobal(name); + if (!element) throw new Error("missing " + name); + if (element.kind != kind) throw new Error("unexpected " + name); + return element; + } + + /** Requires that a non-generic global class is present and returns it. */ + private requireClass(name: string): Class { + var prototype = this.require(name, ElementKind.CLASS_PROTOTYPE); + var resolved = this.resolver.resolveClass(prototype, null); + if (!resolved) throw new Error("invalid " + name); + return resolved; + } + + /** Requires that a non-generic global function is present and returns it. */ + private requireFunction(name: string): Function { + var prototype = this.require(name, ElementKind.FUNCTION_PROTOTYPE); + var resolved = this.resolver.resolveFunction(prototype, null); + if (!resolved) throw new Error("invalid " + name); + return resolved; + } + /** Marks an element and its children as a module export. */ private markModuleExport(element: Element): void { element.set(CommonFlags.MODULE_EXPORT); @@ -908,10 +970,10 @@ export class Program extends DiagnosticEmitter { } /** Ensures that the given global element exists. Attempts to merge duplicates. */ - ensureGlobal(name: string, element: DeclaredElement): void { + ensureGlobal(name: string, element: DeclaredElement): DeclaredElement { var elementsByName = this.elementsByName; if (elementsByName.has(name)) { - let actual = elementsByName.get(name); + let actual = elementsByName.get(name)!; // NOTE: this is effectively only performed when merging native types with // their respective namespaces in std/builtins, but can also trigger when a // user has multiple global elements of the same name in different files, @@ -924,12 +986,13 @@ export class Program extends DiagnosticEmitter { DiagnosticCode.Duplicate_identifier_0, element.identifierNode.range, name ); - return; + return element; } element = merged; } } elementsByName.set(name, element); + return element; } /** Looks up the element of the specified name in the global scope. */ @@ -939,6 +1002,13 @@ export class Program extends DiagnosticEmitter { return null; } + /** Looks up the element of the specified name in the global scope. Errors if not present. */ + requireGlobal(name: string): Element { + var elements = this.elementsByName; + if (elements.has(name)) return elements.get(name)!; + throw new Error("missing global"); + } + /** Tries to locate a foreign file given its normalized path. */ private lookupForeignFile( /** Normalized path to the other file. */ @@ -1009,13 +1079,13 @@ export class Program extends DiagnosticEmitter { let flag = decoratorKindToFlag(kind); if (flag) { if (flag == DecoratorFlags.BUILTIN) { - if (decorator.range.source.isLibrary) { - flags |= flag; - } else { + if (!(acceptedFlags & flag) && !decorator.range.source.isLibrary) { this.error( DiagnosticCode.Decorator_0_is_not_valid_here, decorator.range, decorator.name.range.toString() ); + } else { + flags |= flag; } } else if (!(acceptedFlags & flag)) { this.error( @@ -1046,7 +1116,7 @@ export class Program extends DiagnosticEmitter { queuedExtends: ClassPrototype[], /** So far queued `implements` clauses. */ queuedImplements: ClassPrototype[] - ): void { + ): ClassPrototype | null { var name = declaration.name.text; var element = new ClassPrototype( name, @@ -1058,7 +1128,7 @@ export class Program extends DiagnosticEmitter { DecoratorFlags.UNMANAGED ) ); - if (!parent.add(name, element)) return; + if (!parent.add(name, element)) return null; var implementsTypes = declaration.implementsTypes; if (implementsTypes) { @@ -1109,6 +1179,7 @@ export class Program extends DiagnosticEmitter { default: assert(false); // class member expected } } + return element; } /** Initializes a field of a class or interface. */ @@ -1130,7 +1201,7 @@ export class Program extends DiagnosticEmitter { (declaration.is(CommonFlags.READONLY) ? DecoratorFlags.INLINE : DecoratorFlags.NONE - ) | DecoratorFlags.LAZY + ) | DecoratorFlags.LAZY | DecoratorFlags.UNSAFE ), declaration ); @@ -1141,7 +1212,7 @@ export class Program extends DiagnosticEmitter { name, parent, declaration, - this.checkDecorators(decorators, DecoratorFlags.NONE) + this.checkDecorators(decorators, DecoratorFlags.UNSAFE) ); if (!parent.addInstance(name, element)) return; } @@ -1156,7 +1227,7 @@ export class Program extends DiagnosticEmitter { ): void { var name = declaration.name.text; var isStatic = declaration.is(CommonFlags.STATIC); - var acceptedFlags = DecoratorFlags.INLINE; + var acceptedFlags = DecoratorFlags.INLINE | DecoratorFlags.UNSAFE; if (!declaration.is(CommonFlags.GENERIC)) { acceptedFlags |= DecoratorFlags.OPERATOR_BINARY | DecoratorFlags.OPERATOR_PREFIX @@ -1309,7 +1380,7 @@ export class Program extends DiagnosticEmitter { property, declaration, this.checkDecorators(declaration.decorators, - DecoratorFlags.INLINE + DecoratorFlags.INLINE | DecoratorFlags.UNSAFE ) ); if (isGetter) { @@ -1325,7 +1396,7 @@ export class Program extends DiagnosticEmitter { declaration: EnumDeclaration, /** Parent element, usually a file or namespace. */ parent: Element - ): void { + ): Enum | null { var name = declaration.name.text; var element = new Enum( name, @@ -1337,11 +1408,12 @@ export class Program extends DiagnosticEmitter { DecoratorFlags.LAZY ) ); - if (!parent.add(name, element)) return; + if (!parent.add(name, element)) return null; var values = declaration.values; for (let i = 0, k = values.length; i < k; ++i) { this.initializeEnumValue(values[i], element); } + return element; } /** Initializes an enum value. */ @@ -1452,6 +1524,55 @@ export class Program extends DiagnosticEmitter { } } + private initializeExportDefault( + /** The statement to initialize. */ + statement: ExportDefaultStatement, + /** Parent file. */ + parent: File, + /** So far queued `extends` clauses. */ + queuedExtends: Array, + /** So far queued `implements` clauses. */ + queuedImplements: ClassPrototype[] + ): void { + var declaration = statement.declaration; + var element: DeclaredElement | null = null; + switch (declaration.kind) { + case NodeKind.ENUMDECLARATION: { + element = this.initializeEnum(declaration, parent); + break; + } + case NodeKind.FUNCTIONDECLARATION: { + element = this.initializeFunction(declaration, parent); + break; + } + case NodeKind.CLASSDECLARATION: { + element = this.initializeClass(declaration, parent, queuedExtends, queuedImplements); + break; + } + case NodeKind.INTERFACEDECLARATION: { + element = this.initializeInterface(declaration, parent); + break; + } + case NodeKind.NAMESPACEDECLARATION: { + element = this.initializeNamespace(declaration, parent, queuedExtends, queuedImplements); + break; + } + default: assert(false); + } + if (element) { + let exports = parent.exports; + if (!exports) parent.exports = exports = new Map(); + else if (exports.has("default")) { + this.error( + DiagnosticCode.Duplicate_identifier_0, + declaration.name.range, "default" + ) + return; + } + exports.set("default", element); + } + } + /** Initializes an `import` statement. */ private initializeImports( /** The statement to initialize. */ @@ -1460,7 +1581,7 @@ export class Program extends DiagnosticEmitter { parent: File, /** So far queued `import`s. */ queuedImports: QueuedImport[], - /** SO far queued `export`s. */ + /** So far queued `export`s. */ queuedExports: Map> ): void { var declarations = statement.declarations; @@ -1527,9 +1648,9 @@ export class Program extends DiagnosticEmitter { declaration: FunctionDeclaration, /** Parent element, usually a file or namespace. */ parent: Element - ): void { + ): FunctionPrototype | null { var name = declaration.name.text; - var validDecorators = DecoratorFlags.NONE; + var validDecorators = DecoratorFlags.UNSAFE | DecoratorFlags.BUILTIN; if (declaration.is(CommonFlags.AMBIENT)) { validDecorators |= DecoratorFlags.EXTERNAL; } else { @@ -1540,26 +1661,14 @@ export class Program extends DiagnosticEmitter { validDecorators |= DecoratorFlags.GLOBAL; } } - if (!declaration.is(CommonFlags.GENERIC)) { - if (parent.kind == ElementKind.FILE && (parent).source.isEntry) { - validDecorators |= DecoratorFlags.START; - } - } var element = new FunctionPrototype( name, parent, declaration, this.checkDecorators(declaration.decorators, validDecorators) ); - if (!parent.add(name, element)) return; - if (element.hasDecorator(DecoratorFlags.START)) { - if (this.explicitStartFunction) { - this.error( - DiagnosticCode.Module_cannot_have_multiple_start_functions, - assert(findDecorator(DecoratorKind.START, declaration.decorators)).range - ); - } else this.explicitStartFunction = element; - } + if (!parent.add(name, element)) return null; + return element; } /** Initializes an interface. */ @@ -1568,7 +1677,7 @@ export class Program extends DiagnosticEmitter { declaration: InterfaceDeclaration, /** Parent element, usually a file or namespace. */ parent: Element - ): void { + ): InterfacePrototype | null { var name = declaration.name.text; var element = new InterfacePrototype( name, @@ -1578,7 +1687,7 @@ export class Program extends DiagnosticEmitter { DecoratorFlags.GLOBAL ) ); - if (!parent.add(name, element)) return; + if (!parent.add(name, element)) return null; var memberDeclarations = declaration.members; for (let i = 0, k = memberDeclarations.length; i < k; ++i) { let memberDeclaration = memberDeclarations[i]; @@ -1598,6 +1707,7 @@ export class Program extends DiagnosticEmitter { default: assert(false); // interface member expected } } + return element; } /** Initializes a namespace. */ @@ -1610,46 +1720,53 @@ export class Program extends DiagnosticEmitter { queuedExtends: ClassPrototype[], /** So far queued `implements` clauses. */ queuedImplements: ClassPrototype[] - ): void { + ): Namespace | null { var name = declaration.name.text; - var element = new Namespace(name, parent, declaration); - if (!parent.add(name, element)) return; - element = assert(parent.lookupInSelf(name)); // possibly merged + var original = new Namespace( + name, + parent, + declaration, + this.checkDecorators(declaration.decorators, DecoratorFlags.GLOBAL) + ); + if (!parent.add(name, original)) return null; + var element = assert(parent.lookupInSelf(name)); // possibly merged var members = declaration.members; for (let i = 0, k = members.length; i < k; ++i) { let member = members[i]; switch (member.kind) { case NodeKind.CLASSDECLARATION: { - this.initializeClass(member, element, queuedExtends, queuedImplements); + this.initializeClass(member, original, queuedExtends, queuedImplements); break; } case NodeKind.ENUMDECLARATION: { - this.initializeEnum(member, element); + this.initializeEnum(member, original); break; } case NodeKind.FUNCTIONDECLARATION: { - this.initializeFunction(member, element); + this.initializeFunction(member, original); break; } case NodeKind.INTERFACEDECLARATION: { - this.initializeInterface(member, element); + this.initializeInterface(member, original); break; } case NodeKind.NAMESPACEDECLARATION: { - this.initializeNamespace(member, element, queuedExtends, queuedImplements); + this.initializeNamespace(member, original, queuedExtends, queuedImplements); break; } case NodeKind.TYPEDECLARATION: { - this.initializeTypeDefinition(member, element); + this.initializeTypeDefinition(member, original); break; } case NodeKind.VARIABLE: { - this.initializeVariables(member, element); + this.initializeVariables(member, original); break; } default: assert(false); // namespace member expected } } + if (original != element) copyMembers(original, element); // retain original parent + return element; } /** Initializes a `type` definition. */ @@ -1696,6 +1813,33 @@ export class Program extends DiagnosticEmitter { if (!parent.add(name, element)) continue; // reports } } + + /** Determines the element type of a built-in array. */ + // determineBuiltinArrayType(target: Class): Type | null { + // switch (target.internalName) { + // case BuiltinSymbols.Int8Array: return Type.i8; + // case BuiltinSymbols.Uint8ClampedArray: + // case BuiltinSymbols.Uint8Array: return Type.u8; + // case BuiltinSymbols.Int16Array: return Type.i16; + // case BuiltinSymbols.Uint16Array: return Type.u16; + // case BuiltinSymbols.Int32Array: return Type.i32; + // case BuiltinSymbols.Uint32Array: return Type.u32; + // case BuiltinSymbols.Int64Array: return Type.i64; + // case BuiltinSymbols.Uint64Array: return Type.u64; + // case BuiltinSymbols.Float32Array: return Type.f32; + // case BuiltinSymbols.Float64Array: return Type.f64; + // } + // var current: Class | null = target; + // var arrayPrototype = this.arrayPrototype; + // do { + // if (current.prototype == arrayPrototype) { // Array + // let typeArguments = assert(current.typeArguments); + // assert(typeArguments.length == 1); + // return typeArguments[0]; + // } + // } while (current = current.base); + // return null; + // } } /** Indicates the specific kind of an {@link Element}. */ @@ -1762,8 +1906,8 @@ export enum DecoratorFlags { BUILTIN = 1 << 8, /** Is compiled lazily. */ LAZY = 1 << 9, - /** Is the explicit start function. */ - START = 1 << 10 + /** Is considered unsafe code. */ + UNSAFE = 1 << 10 } /** Translates a decorator kind to the respective decorator flag. */ @@ -1780,7 +1924,7 @@ export function decoratorKindToFlag(kind: DecoratorKind): DecoratorFlags { case DecoratorKind.EXTERNAL: return DecoratorFlags.EXTERNAL; case DecoratorKind.BUILTIN: return DecoratorFlags.BUILTIN; case DecoratorKind.LAZY: return DecoratorFlags.LAZY; - case DecoratorKind.START: return DecoratorFlags.START; + case DecoratorKind.UNSAFE: return DecoratorFlags.UNSAFE; default: return DecoratorFlags.NONE; } } @@ -1836,6 +1980,8 @@ export abstract class Element { isAny(flags: CommonFlags): bool { return (this.flags & flags) != 0; } /** Sets a specific flag or flags. */ set(flag: CommonFlags): void { this.flags |= flag; } + /** Unsets the specific flag or flags. */ + unset(flag: CommonFlags): void {this.flags &= ~flag; } /** Tests if this element has a specific decorator flag or flags. */ hasDecorator(flag: DecoratorFlags): bool { return (this.decoratorFlags & flag) == flag; } @@ -1984,15 +2130,17 @@ export class File extends Element { /* @override */ add(name: string, element: DeclaredElement, isImport: bool = false): bool { + if (element.hasDecorator(DecoratorFlags.GLOBAL)) { + element = this.program.ensureGlobal(name, element); // possibly merged globally + } if (!super.add(name, element)) return false; - element = assert(this.lookupInSelf(name)); // possibly merged + element = assert(this.lookupInSelf(name)); // possibly merged locally if (element.is(CommonFlags.EXPORT) && !isImport) { this.ensureExport( element.name, element ); } - if (element.hasDecorator(DecoratorFlags.GLOBAL)) this.program.ensureGlobal(name, element); return true; } @@ -2114,7 +2262,9 @@ export class Namespace extends DeclaredElement { /** Parent element, usually a file or another namespace. */ parent: Element, /** Declaration reference. */ - declaration: NamespaceDeclaration + declaration: NamespaceDeclaration, + /** Pre-checked flags indicating built-in decorators. */ + decoratorFlags: DecoratorFlags = DecoratorFlags.NONE ) { super( ElementKind.NAMESPACE, @@ -2124,6 +2274,7 @@ export class Namespace extends DeclaredElement { parent, declaration ); + this.decoratorFlags = decoratorFlags; } /* @override */ @@ -2358,7 +2509,7 @@ export class FunctionPrototype extends DeclaredElement { /** Constructs a new function prototype. */ constructor( - /** Simple na,e */ + /** Simple name */ name: string, /** Parent element, usually a file, namespace or class (if a method). */ parent: Element, @@ -2477,6 +2628,8 @@ export class Function extends TypedElement { nextInlineId: i32 = 0; /** Counting id of anonymous inner functions. */ nextAnonymousId: i32 = 0; + /** Counting id of autorelease variables. */ + nextAutoreleaseId: i32 = 0; /** Constructs a new concrete function. */ constructor( @@ -2831,12 +2984,18 @@ export class ClassPrototype extends DeclaredElement { return (this.declaration).implementsTypes; } + /** Tests if this prototype is of a builtin array type (Array/TypedArray). */ + get isBuiltinArray(): bool { + var arrayBufferViewInstance = this.program.arrayBufferViewInstance; + return arrayBufferViewInstance !== null + && this.extends(arrayBufferViewInstance.prototype); + } + /** Tests if this prototype extends the specified. */ extends(basePtototype: ClassPrototype | null): bool { var current: ClassPrototype | null = this; - do { - if (current === basePtototype) return true; - } while (current = current.basePrototype); + do if (current === basePtototype) return true; + while (current = current.basePrototype); return false; } @@ -2885,6 +3044,12 @@ export class ClassPrototype extends DeclaredElement { } } +const enum AcyclicState { + UNKNOWN, + ACYCLIC, + NOT_ACYCLIC +} + /** A resolved class. */ export class Class extends TypedElement { @@ -2902,8 +3067,38 @@ export class Class extends TypedElement { constructorInstance: Function | null = null; /** Operator overloads. */ overloads: Map | null = null; - /** Function index of the GC hook. */ - gcHookIndex: u32 = -1; + /** Unique class id. */ + private _id: u32 = 0; + /** Remembers acyclic state. */ + private _acyclic: AcyclicState = AcyclicState.UNKNOWN; + /** Runtime type information flags. */ + rttiFlags: u32 = 0; + + /** Gets the unique runtime id of this class. */ + get id(): u32 { + return this._id; // unmanaged remains 0 (=ArrayBuffer) + } + + /** Tests if this class is of a builtin array type (Array/TypedArray). */ + get isBuiltinArray(): bool { + return this.prototype.isBuiltinArray; + } + + /** Tests if this class is array-like. */ + get isArrayLike(): bool { + if (this.isBuiltinArray) return true; + var lengthField = this.lookupInSelf("length"); + return lengthField !== null && ( + lengthField.kind == ElementKind.FIELD || + ( + lengthField.kind == ElementKind.PROPERTY && + (lengthField).getterInstance !== null // TODO: resolve & check type? + ) + ) && ( + this.lookupOverload(OperatorKind.INDEXED_GET) !== null || + this.lookupOverload(OperatorKind.UNCHECKED_INDEXED_GET) !== null + ); + } /** Constructs a new class. */ constructor( @@ -2925,13 +3120,20 @@ export class Class extends TypedElement { prototype.parent, prototype.declaration ); + var program = this.program; this.prototype = prototype; this.flags = prototype.flags; this.decoratorFlags = prototype.decoratorFlags; this.typeArguments = typeArguments; - this.setType(this.program.options.usizeType.asClass(this)); + this.setType(program.options.usizeType.asClass(this)); this.base = base; + if (!this.hasDecorator(DecoratorFlags.UNMANAGED)) { + let id = program.nextClassId++; + this._id = id; + program.managedClasses.set(id, this); + } + // inherit static members and contextual type arguments from base class if (base) { let inheritedTypeArguments = base.contextualTypeArguments; @@ -2960,7 +3162,7 @@ export class Class extends TypedElement { } else if (typeParameters && typeParameters.length) { throw new Error("type argument count mismatch"); } - registerConcreteElement(this.program, this); + registerConcreteElement(program, this); } /** Tests if a value of this class type is assignable to a target of the specified class type. */ @@ -3012,6 +3214,177 @@ export class Class extends TypedElement { assert(field.kind == ElementKind.FIELD); return (field).memoryOffset; } + + /** Writes a field value to a buffer and returns the number of bytes written. */ + writeField(name: string, value: T, buffer: Uint8Array, baseOffset: i32): i32 { + var field = this.lookupInSelf(name); + if (field && field.kind == ElementKind.FIELD) { + let offset = baseOffset + (field).memoryOffset; + switch ((field).type.kind) { + case TypeKind.I8: + case TypeKind.U8: { + writeI8(i32(value), buffer, offset); + return 1; + } + case TypeKind.I16: + case TypeKind.U16: { + writeI16(i32(value), buffer, offset); + return 2; + } + case TypeKind.I32: + case TypeKind.U32: { + writeI32(i32(value), buffer, offset); + return 4; + } + case TypeKind.ISIZE: + case TypeKind.USIZE: { + assert(!this.program.options.isWasm64); // TODO + writeI32(i32(value), buffer, offset); + return 4; + } + case TypeKind.F32: { + writeF32(f32(value), buffer, offset); + return 4; + } + case TypeKind.F64: { + writeF64(f64(value), buffer, offset); + return 8; + } + } + } + assert(false); + return 0; + } + + /** Tests if this class extends the specified prototype. */ + extends(prototype: ClassPrototype): bool { + return this.prototype.extends(prototype); + } + + /** Gets the concrete type arguments to the specified extendend prototype. */ + getTypeArgumentsTo(extendedPrototype: ClassPrototype): Type[] | null { + var current: Class | null = this; + do if (current.prototype === extendedPrototype) return current.typeArguments; + while (current = current.base); + return null; + } + + /** Gets the value type of an array. Must be an array. */ + getArrayValueType(): Type { + var current: Class = this; + var program = this.program; + var abvInstance = program.arrayBufferViewInstance; + while (current.base !== abvInstance) { + current = assert(current.base); + } + switch (current.prototype) { + case program.i8ArrayPrototype: return Type.i8; + case program.i16ArrayPrototype: return Type.i16; + case program.i32ArrayPrototype: return Type.i32; + case program.i64ArrayPrototype: return Type.i64; + case program.u8ArrayPrototype: + case program.u8ClampedArrayPrototype: return Type.u8; + case program.u16ArrayPrototype: return Type.u16; + case program.u32ArrayPrototype: return Type.u32; + case program.u64ArrayPrototype: return Type.u64; + case program.f32ArrayPrototype: return Type.f32; + case program.f64ArrayPrototype: return Type.f64; + case program.arrayPrototype: return assert(this.getTypeArgumentsTo(program.arrayPrototype))[0]; + default: assert(false); + } + return Type.void; + } + + /** Tests if this class is inherently acyclic. */ + get isAcyclic(): bool { + var acyclic = this._acyclic; + if (acyclic == AcyclicState.UNKNOWN) { + let hasCycle = this.cyclesTo(this); + if (hasCycle) this._acyclic = acyclic = AcyclicState.NOT_ACYCLIC; + else this._acyclic = acyclic = AcyclicState.ACYCLIC; + } + return acyclic == AcyclicState.ACYCLIC; + } + + /** Tests if this class potentially forms a reference cycle to another one. */ + private cyclesTo(other: Class, except: Set = new Set()): bool { + // TODO: The pure RC paper describes acyclic data structures as classes that may contain + // + // - scalars + // - references to classes that are both acyclic and final (here: Java); and + // - arrays (in our case: also sets, maps) of either of the above + // + // Our implementation, however, treats all objects that do not reference themselves directly + // or indirectly as acylic, allowing them to contain inner cycles of other non-acyclic objects. + // This contradicts the second assumption and must be revisited when actually implementing RC. + + if (except.has(this)) return false; + except.add(this); // don't recurse indefinitely + + // Find out if any field references 'other' directly or indirectly + var current: Class | null; + var members = this.members; + if (members) { + for (let member of members.values()) { + if ( + member.kind == ElementKind.FIELD && + (current = (member).type.classReference) !== null && + ( + current === other || + current.cyclesTo(other, except) + ) + ) return true; + } + } + + // Do the same for non-field data + var basePrototype: ClassPrototype | null; + + // Arrayother?> + if ((basePrototype = this.program.arrayPrototype) && this.prototype.extends(basePrototype)) { + let typeArguments = assert(this.getTypeArgumentsTo(basePrototype)); + assert(typeArguments.length == 1); + if ( + (current = typeArguments[0].classReference) !== null && + ( + current === other || + current.cyclesTo(other, except) + ) + ) return true; + + // Setother?> + } else if ((basePrototype = this.program.setPrototype) && this.prototype.extends(basePrototype)) { + let typeArguments = assert(this.getTypeArgumentsTo(basePrototype)); + assert(typeArguments.length == 1); + if ( + (current = typeArguments[0].classReference) !== null && + ( + current === other || + current.cyclesTo(other, except) + ) + ) return true; + + // Mapother?,V->other?> + } else if ((basePrototype = this.program.mapPrototype) && this.prototype.extends(basePrototype)) { + let typeArguments = assert(this.getTypeArgumentsTo(basePrototype)); + assert(typeArguments.length == 2); + if ( + (current = typeArguments[0].classReference) !== null && + ( + current === other || + current.cyclesTo(other, except) + ) + ) return true; + if ( + (current = typeArguments[1].classReference) !== null && + ( + current === other || + current.cyclesTo(other, except) + ) + ) return true; + } + return false; + } } /** A yet unresolved interface. */ @@ -3147,7 +3520,9 @@ function tryMerge(older: Element, newer: Element): DeclaredElement | null { } } if (merged) { - if (older.is(CommonFlags.EXPORT) != newer.is(CommonFlags.EXPORT)) { + let olderIsExport = older.is(CommonFlags.EXPORT) || older.hasDecorator(DecoratorFlags.GLOBAL); + let newerIsExport = newer.is(CommonFlags.EXPORT) || newer.hasDecorator(DecoratorFlags.GLOBAL); + if (olderIsExport != newerIsExport) { older.program.error( DiagnosticCode.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local, merged.identifierNode.range, merged.identifierNode.text diff --git a/src/resolver.ts b/src/resolver.ts index 43f8ba37b1..cdc7857e92 100644 --- a/src/resolver.ts +++ b/src/resolver.ts @@ -82,6 +82,10 @@ import { Token } from "./tokenizer"; +import { + BuiltinSymbols +} from "./builtins"; + /** Indicates whether errors are reported or not. */ export enum ReportMode { /** Report errors. */ @@ -368,12 +372,26 @@ export class Resolver extends DiagnosticEmitter { ); // recoverable } - return this.resolveType( + let type = this.resolveType( (element).typeNode, element, contextualTypeArguments, reportMode ); + if (!type) return null; + if (node.isNullable) { + if (!type.is(TypeFlags.REFERENCE)) { + if (reportMode == ReportMode.REPORT) { + this.error( + DiagnosticCode.Basic_type_0_cannot_be_nullable, + typeNode.name.range, typeName.identifier.text + ); + } + } else { + return type.asNullable(); + } + } + return type; } if (reportMode == ReportMode.REPORT) { this.error( @@ -438,7 +456,7 @@ export class Resolver extends DiagnosticEmitter { ): Type[] | null { var minParameterCount = 0; var maxParameterCount = 0; - for (let i = 0; i < typeParameters.length; ++i) { + for (let i = 0, k = typeParameters.length; i < k; ++i) { if (!typeParameters[i].defaultType) ++minParameterCount; ++maxParameterCount; } @@ -610,25 +628,40 @@ export class Resolver extends DiagnosticEmitter { case ElementKind.CLASS: { // property access on element access? let elementExpression = this.currentElementExpression; if (elementExpression) { - let indexedGet = (target).lookupOverload(OperatorKind.INDEXED_GET); - if (!indexedGet) { - this.error( - DiagnosticCode.Index_signature_is_missing_in_type_0, - elementExpression.range, (target).internalName - ); - return null; - } - let returnType = indexedGet.signature.returnType; - if (!(target = returnType.classReference)) { + // let arrayType = this.program.determineBuiltinArrayType(target); + // if (!arrayType) { + let indexedGet = (target).lookupOverload(OperatorKind.INDEXED_GET); + if (!indexedGet) { + this.error( + DiagnosticCode.Index_signature_is_missing_in_type_0, + elementExpression.range, (target).internalName + ); + return null; + } + let arrayType = indexedGet.signature.returnType; + // } + if (!(target = arrayType.classReference)) { this.error( DiagnosticCode.Property_0_does_not_exist_on_type_1, - propertyAccess.property.range, propertyName, returnType.toString() + propertyAccess.property.range, propertyName, arrayType.toString() ); return null; } } break; } + case ElementKind.FUNCTION_PROTOTYPE: { // function Symbol() + type Symbol = _Symbol + let shadowType = target.shadowType; + if (shadowType) { + if (!shadowType.is(CommonFlags.RESOLVED)) { + let resolvedType = this.resolveType(shadowType.typeNode, shadowType.parent, null, reportMode); + if (resolvedType) shadowType.setType(resolvedType); + } + let classReference = shadowType.type.classReference; + if (classReference) target = classReference.prototype; + break; + } + } } // Look up the member within @@ -672,6 +705,7 @@ export class Resolver extends DiagnosticEmitter { break; } } + this.error( DiagnosticCode.Property_0_does_not_exist_on_type_1, propertyAccess.property.range, propertyName, target.internalName @@ -706,19 +740,22 @@ export class Resolver extends DiagnosticEmitter { break; } case ElementKind.CLASS: { - let indexedGet = (target).lookupOverload(OperatorKind.INDEXED_GET); - if (!indexedGet) { - if (reportMode == ReportMode.REPORT) { - this.error( - DiagnosticCode.Index_signature_is_missing_in_type_0, - elementAccess.range, (target).internalName - ); + // let arrayType = this.program.determineBuiltinArrayType(target); + // if (!arrayType) { + let indexedGet = (target).lookupOverload(OperatorKind.INDEXED_GET); + if (!indexedGet) { + if (reportMode == ReportMode.REPORT) { + this.error( + DiagnosticCode.Index_signature_is_missing_in_type_0, + elementAccess.range, (target).internalName + ); + } + return null; } - return null; - } + let arrayType = indexedGet.signature.returnType; + // } if (targetExpression.kind == NodeKind.ELEMENTACCESS) { // nested element access - let returnType = indexedGet.signature.returnType; - if (target = returnType.classReference) { + if (target = arrayType.classReference) { this.currentThisExpression = targetExpression; this.currentElementExpression = elementAccess.elementExpression; return target; @@ -1189,6 +1226,14 @@ export class Resolver extends DiagnosticEmitter { ); if (!target) return null; if (target.kind == ElementKind.FUNCTION_PROTOTYPE) { + // `unchecked(expr: *): *` is special + if ( + (target).internalName == BuiltinSymbols.unchecked && + expression.arguments.length > 0 + ) { + return this.resolveExpression(expression.arguments[0], flow, contextualType, reportMode); + } + // otherwise resolve normally let instance = this.resolveFunctionInclTypeArguments( target, expression.typeArguments, diff --git a/src/tokenizer.ts b/src/tokenizer.ts index 75088508ca..d9c38b829d 100644 --- a/src/tokenizer.ts +++ b/src/tokenizer.ts @@ -350,6 +350,7 @@ export function tokenIsAlsoIdentifier(token: Token): bool { case Token.FROM: case Token.FOR: case Token.GET: + case Token.INSTANCEOF: case Token.IS: case Token.KEYOF: case Token.MODULE: @@ -446,6 +447,7 @@ export class Range { get atStart(): Range { return new Range(this.source, this.start, this.start); } + get atEnd(): Range { return new Range(this.source, this.end, this.end); } @@ -504,13 +506,14 @@ export class Tokenizer extends DiagnosticEmitter { this.source = source; this.pos = 0; this.end = source.text.length; - this.diagnostics = diagnostics ? diagnostics : new Array(); + this.diagnostics = diagnostics || new Array(); + var end = this.end; var text = source.text; // skip bom if ( - this.pos < this.end && + this.pos < end && text.charCodeAt(this.pos) == CharCode.BYTEORDERMARK ) { ++this.pos; @@ -518,13 +521,13 @@ export class Tokenizer extends DiagnosticEmitter { // skip shebang if ( - this.pos + 1 < this.end && + this.pos + 1 < end && text.charCodeAt(this.pos) == CharCode.HASH && text.charCodeAt(this.pos + 1) == CharCode.EXCLAMATION ) { this.pos += 2; while ( - this.pos < this.end && + this.pos < end && text.charCodeAt(this.pos) != CharCode.LINEFEED ) { ++this.pos; @@ -542,14 +545,15 @@ export class Tokenizer extends DiagnosticEmitter { identifierHandling: IdentifierHandling = IdentifierHandling.DEFAULT, maxTokenLength: i32 = i32.MAX_VALUE ): Token { + var end = this.end; var text = this.source.text; - while (this.pos < this.end) { + while (this.pos < end) { this.tokenPos = this.pos; let c = text.charCodeAt(this.pos); switch (c) { case CharCode.CARRIAGERETURN: { if (!( - ++this.pos < this.end && + ++this.pos < end && text.charCodeAt(this.pos) == CharCode.LINEFEED )) break; // otherwise fall-through @@ -565,12 +569,12 @@ export class Tokenizer extends DiagnosticEmitter { case CharCode.EXCLAMATION: { ++this.pos; if ( - maxTokenLength > 1 && this.pos < this.end && + maxTokenLength > 1 && this.pos < end && text.charCodeAt(this.pos) == CharCode.EQUALS ) { ++this.pos; if ( - maxTokenLength > 2 && this.pos < this.end && + maxTokenLength > 2 && this.pos < end && text.charCodeAt(this.pos) == CharCode.EQUALS ) { ++this.pos; @@ -588,7 +592,7 @@ export class Tokenizer extends DiagnosticEmitter { case CharCode.PERCENT: { ++this.pos; if ( - maxTokenLength > 1 && this.pos < this.end && + maxTokenLength > 1 && this.pos < end && text.charCodeAt(this.pos) == CharCode.EQUALS ) { ++this.pos; @@ -598,7 +602,7 @@ export class Tokenizer extends DiagnosticEmitter { } case CharCode.AMPERSAND: { ++this.pos; - if (maxTokenLength > 1 && this.pos < this.end) { + if (maxTokenLength > 1 && this.pos < end) { let chr = text.charCodeAt(this.pos); if (chr == CharCode.AMPERSAND) { ++this.pos; @@ -621,7 +625,7 @@ export class Tokenizer extends DiagnosticEmitter { } case CharCode.ASTERISK: { ++this.pos; - if (maxTokenLength > 1 && this.pos < this.end) { + if (maxTokenLength > 1 && this.pos < end) { let chr = text.charCodeAt(this.pos); if (chr == CharCode.EQUALS) { ++this.pos; @@ -630,7 +634,7 @@ export class Tokenizer extends DiagnosticEmitter { if (chr == CharCode.ASTERISK) { ++this.pos; if ( - maxTokenLength > 2 && this.pos < this.end && + maxTokenLength > 2 && this.pos < end && text.charCodeAt(this.pos) == CharCode.EQUALS ) { ++this.pos; @@ -643,7 +647,7 @@ export class Tokenizer extends DiagnosticEmitter { } case CharCode.PLUS: { ++this.pos; - if (maxTokenLength > 1 && this.pos < this.end) { + if (maxTokenLength > 1 && this.pos < end) { let chr = text.charCodeAt(this.pos); if (chr == CharCode.PLUS) { ++this.pos; @@ -662,7 +666,7 @@ export class Tokenizer extends DiagnosticEmitter { } case CharCode.MINUS: { ++this.pos; - if (maxTokenLength > 1 && this.pos < this.end) { + if (maxTokenLength > 1 && this.pos < end) { let chr = text.charCodeAt(this.pos); if (chr == CharCode.MINUS) { ++this.pos; @@ -677,14 +681,14 @@ export class Tokenizer extends DiagnosticEmitter { } case CharCode.DOT: { ++this.pos; - if (maxTokenLength > 1 && this.pos < this.end) { + if (maxTokenLength > 1 && this.pos < end) { let chr = text.charCodeAt(this.pos); if (isDecimalDigit(chr)) { --this.pos; return Token.FLOATLITERAL; // expects a call to readFloat } if ( - maxTokenLength > 2 && this.pos + 1 < this.end && + maxTokenLength > 2 && this.pos + 1 < end && chr == CharCode.DOT && text.charCodeAt(this.pos + 1) == CharCode.DOT ) { @@ -697,18 +701,18 @@ export class Tokenizer extends DiagnosticEmitter { case CharCode.SLASH: { let commentStartPos = this.pos; ++this.pos; - if (maxTokenLength > 1 && this.pos < this.end) { + if (maxTokenLength > 1 && this.pos < end) { let chr = text.charCodeAt(this.pos); if (chr == CharCode.SLASH) { // single-line let commentKind = CommentKind.LINE; if ( - this.pos + 1 < this.end && + this.pos + 1 < end && text.charCodeAt(this.pos + 1) == CharCode.SLASH ) { ++this.pos; commentKind = CommentKind.TRIPLE; } - while (++this.pos < this.end) { + while (++this.pos < end) { if (text.charCodeAt(this.pos) == CharCode.LINEFEED) { ++this.pos; break; @@ -725,11 +729,11 @@ export class Tokenizer extends DiagnosticEmitter { } if (chr == CharCode.ASTERISK) { // multi-line let closed = false; - while (++this.pos < this.end) { + while (++this.pos < end) { c = text.charCodeAt(this.pos); if ( c == CharCode.ASTERISK && - this.pos + 1 < this.end && + this.pos + 1 < end && text.charCodeAt(this.pos + 1) == CharCode.SLASH ) { this.pos += 2; @@ -782,13 +786,13 @@ export class Tokenizer extends DiagnosticEmitter { } case CharCode.LESSTHAN: { ++this.pos; - if (maxTokenLength > 1 && this.pos < this.end) { + if (maxTokenLength > 1 && this.pos < end) { let chr = text.charCodeAt(this.pos); if (chr == CharCode.LESSTHAN) { ++this.pos; if ( maxTokenLength > 2 && - this.pos < this.end && + this.pos < end && text.charCodeAt(this.pos) == CharCode.EQUALS ) { ++this.pos; @@ -805,13 +809,13 @@ export class Tokenizer extends DiagnosticEmitter { } case CharCode.EQUALS: { ++this.pos; - if (maxTokenLength > 1 && this.pos < this.end) { + if (maxTokenLength > 1 && this.pos < end) { let chr = text.charCodeAt(this.pos); if (chr == CharCode.EQUALS) { ++this.pos; if ( maxTokenLength > 2 && - this.pos < this.end && + this.pos < end && text.charCodeAt(this.pos) == CharCode.EQUALS ) { ++this.pos; @@ -828,16 +832,16 @@ export class Tokenizer extends DiagnosticEmitter { } case CharCode.GREATERTHAN: { ++this.pos; - if (maxTokenLength > 1 && this.pos < this.end) { + if (maxTokenLength > 1 && this.pos < end) { let chr = text.charCodeAt(this.pos); if (chr == CharCode.GREATERTHAN) { ++this.pos; - if (maxTokenLength > 2 && this.pos < this.end) { + if (maxTokenLength > 2 && this.pos < end) { chr = text.charCodeAt(this.pos); if (chr == CharCode.GREATERTHAN) { ++this.pos; if ( - maxTokenLength > 3 && this.pos < this.end && + maxTokenLength > 3 && this.pos < end && text.charCodeAt(this.pos) == CharCode.EQUALS ) { ++this.pos; @@ -874,7 +878,7 @@ export class Tokenizer extends DiagnosticEmitter { case CharCode.CARET: { ++this.pos; if ( - maxTokenLength > 1 && this.pos < this.end && + maxTokenLength > 1 && this.pos < end && text.charCodeAt(this.pos) == CharCode.EQUALS ) { ++this.pos; @@ -888,7 +892,7 @@ export class Tokenizer extends DiagnosticEmitter { } case CharCode.BAR: { ++this.pos; - if (maxTokenLength > 1 && this.pos < this.end) { + if (maxTokenLength > 1 && this.pos < end) { let chr = text.charCodeAt(this.pos); if (chr == CharCode.BAR) { ++this.pos; @@ -918,7 +922,7 @@ export class Tokenizer extends DiagnosticEmitter { if (isKeywordCharacter(c)) { let posBefore = this.pos; while ( - ++this.pos < this.end && + ++this.pos < end && isIdentifierPart(c = text.charCodeAt(this.pos)) ) { if (!isKeywordCharacter(c)) { @@ -1050,8 +1054,9 @@ export class Tokenizer extends DiagnosticEmitter { readIdentifier(): string { var text = this.source.text; var start = this.pos; + var end = this.end; while ( - ++this.pos < this.end && + ++this.pos < end && isIdentifierPart(text.charCodeAt(this.pos)) ); return text.substring(start, this.pos); @@ -1061,13 +1066,14 @@ export class Tokenizer extends DiagnosticEmitter { var text = this.source.text; var quote = text.charCodeAt(this.pos++); var start = this.pos; + var end = this.end; var result = ""; while (true) { - if (this.pos >= this.end) { + if (this.pos >= end) { result += text.substring(start, this.pos); this.error( DiagnosticCode.Unterminated_string_literal, - this.range(start - 1, this.end) + this.range(start - 1, end) ); break; } @@ -1096,10 +1102,11 @@ export class Tokenizer extends DiagnosticEmitter { } readEscapeSequence(): string { - if (++this.pos >= this.end) { + var end = this.end; + if (++this.pos >= end) { this.error( DiagnosticCode.Unexpected_end_of_text, - this.range(this.end) + this.range(end) ); return ""; } @@ -1118,7 +1125,7 @@ export class Tokenizer extends DiagnosticEmitter { case CharCode.DOUBLEQUOTE: return "\""; case CharCode.u: { if ( - this.pos < this.end && + this.pos < end && text.charCodeAt(this.pos) == CharCode.OPENBRACE ) { ++this.pos; @@ -1128,7 +1135,7 @@ export class Tokenizer extends DiagnosticEmitter { } case CharCode.CARRIAGERETURN: { if ( - this.pos < this.end && + this.pos < end && text.charCodeAt(this.pos) == CharCode.LINEFEED ) { ++this.pos; @@ -1145,12 +1152,13 @@ export class Tokenizer extends DiagnosticEmitter { readRegexpPattern(): string { var text = this.source.text; var start = this.pos; + var end = this.end; var escaped = false; while (true) { - if (this.pos >= this.end) { + if (this.pos >= end) { this.error( DiagnosticCode.Unterminated_regular_expression_literal, - this.range(start, this.end) + this.range(start, end) ); break; } @@ -1177,8 +1185,9 @@ export class Tokenizer extends DiagnosticEmitter { readRegexpFlags(): string { var text = this.source.text; var start = this.pos; + var end = this.end; var flags = 0; - while (this.pos < this.end) { + while (this.pos < end) { let c: i32 = text.charCodeAt(this.pos); if (!isIdentifierPart(c)) break; ++this.pos; @@ -1213,8 +1222,9 @@ export class Tokenizer extends DiagnosticEmitter { } testInteger(): bool { + var end = this.end; var text = this.source.text; - if (this.pos + 1 < this.end && text.charCodeAt(this.pos) == CharCode._0) { + if (this.pos + 1 < end && text.charCodeAt(this.pos) == CharCode._0) { switch (text.charCodeAt(this.pos + 2)) { case CharCode.x: case CharCode.X: @@ -1225,11 +1235,9 @@ export class Tokenizer extends DiagnosticEmitter { } } var pos = this.pos; - while (pos < this.end) { + while (pos < end) { let c = text.charCodeAt(pos); - if (c == CharCode.DOT || c == CharCode.e || c == CharCode.E) { - return false; - } + if (c == CharCode.DOT || c == CharCode.e || c == CharCode.E) return false; if ((c < CharCode._0 || c > CharCode._9) && c != CharCode._) break; // does not validate separator placement (this is done in readXYInteger) pos++; @@ -1277,7 +1285,8 @@ export class Tokenizer extends DiagnosticEmitter { var value = i64_new(0); var i64_4 = i64_new(4); var sepEnd = start; - while (this.pos < this.end) { + var end = this.end; + while (this.pos < end) { let pos = this.pos; let c = text.charCodeAt(pos); if (c >= CharCode._0 && c <= CharCode._9) { @@ -1330,10 +1339,11 @@ export class Tokenizer extends DiagnosticEmitter { readDecimalInteger(): I64 { var text = this.source.text; var start = this.pos; + var end = this.end; var value = i64_new(0); var i64_10 = i64_new(10); var sepEnd = start; - while (this.pos < this.end) { + while (this.pos < end) { let pos = this.pos; let c = text.charCodeAt(pos); if (c >= CharCode._0 && c <= CharCode._9) { @@ -1377,7 +1387,8 @@ export class Tokenizer extends DiagnosticEmitter { var value = i64_new(0); var i64_3 = i64_new(3); var sepEnd = start; - while (this.pos < this.end) { + var end = this.end; + while (this.pos < end) { let pos = this.pos; let c = text.charCodeAt(pos); if (c >= CharCode._0 && c <= CharCode._7) { @@ -1421,7 +1432,8 @@ export class Tokenizer extends DiagnosticEmitter { var value = i64_new(0); var i64_1 = i64_new(1); var sepEnd = start; - while (this.pos < this.end) { + var end = this.end; + while (this.pos < end) { let pos = this.pos; let c = text.charCodeAt(pos); if (c == CharCode._0) { @@ -1479,27 +1491,28 @@ export class Tokenizer extends DiagnosticEmitter { readDecimalFloat(): f64 { // TODO: numeric separators (parseFloat can't handle these) var start = this.pos; + var end = this.end; var text = this.source.text; - while (this.pos < this.end && isDecimalDigit(text.charCodeAt(this.pos))) { + while (this.pos < end && isDecimalDigit(text.charCodeAt(this.pos))) { ++this.pos; } - if (this.pos < this.end && text.charCodeAt(this.pos) == CharCode.DOT) { + if (this.pos < end && text.charCodeAt(this.pos) == CharCode.DOT) { ++this.pos; - while (this.pos < this.end && isDecimalDigit(text.charCodeAt(this.pos))) { + while (this.pos < end && isDecimalDigit(text.charCodeAt(this.pos))) { ++this.pos; } } - if (this.pos < this.end) { + if (this.pos < end) { let c = text.charCodeAt(this.pos); if (c == CharCode.e || c == CharCode.E) { if ( - ++this.pos < this.end && + ++this.pos < end && (c = text.charCodeAt(this.pos)) == CharCode.MINUS || c == CharCode.PLUS && isDecimalDigit(text.charCodeAt(this.pos + 1)) ) { ++this.pos; } - while (this.pos < this.end && isDecimalDigit(text.charCodeAt(this.pos))) { + while (this.pos < end && isDecimalDigit(text.charCodeAt(this.pos))) { ++this.pos; } } @@ -1514,8 +1527,9 @@ export class Tokenizer extends DiagnosticEmitter { readUnicodeEscape(): string { var remain = 4; var value = 0; + var end = this.end; var text = this.source.text; - while (this.pos < this.end) { + while (this.pos < end) { let c = text.charCodeAt(this.pos++); if (c >= CharCode._0 && c <= CharCode._9) { value = (value << 4) + c - CharCode._0; @@ -1557,11 +1571,12 @@ export class Tokenizer extends DiagnosticEmitter { invalid = true; } + var end = this.end; var text = this.source.text; - if (this.pos >= this.end) { + if (this.pos >= end) { this.error( DiagnosticCode.Unexpected_end_of_text, - this.range(start, this.end) + this.range(start, end) ); invalid = true; } else if (text.charCodeAt(this.pos) == CharCode.CLOSEBRACE) { diff --git a/src/tsconfig.json b/src/tsconfig.json index 1917198b6c..1dc9d5da76 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -2,6 +2,7 @@ "extends": "../std/portable.json", "compilerOptions": { "outDir": "../out", + "allowJs": false, "sourceMap": true }, "include": [ diff --git a/src/types.ts b/src/types.ts index d060f5538e..166584c39d 100644 --- a/src/types.ts +++ b/src/types.ts @@ -145,13 +145,21 @@ export class Type { } } + /** Gets this type's logarithmic alignment in memory. */ + get alignLog2(): i32 { + return 31 - clz(this.byteSize); + } + /** Tests if this is a managed type that needs GC hooks. */ - isManaged(program: Program): bool { - if (program.hasGC) { - let classReference = this.classReference; - return classReference !== null && !classReference.hasDecorator(DecoratorFlags.UNMANAGED); - } - return false; + get isManaged(): bool { + var classReference = this.classReference; + return classReference !== null && !classReference.hasDecorator(DecoratorFlags.UNMANAGED); + } + + /** Tests if this is a class type explicitly annotated as unmanaged. */ + get isUnmanaged(): bool { + var classReference = this.classReference; + return classReference !== null && classReference.hasDecorator(DecoratorFlags.UNMANAGED); } /** Computes the sign-extending shift in the target type. */ @@ -324,14 +332,14 @@ export class Type { toNativeZero(module: Module): ExpressionRef { switch (this.kind) { case TypeKind.VOID: assert(false); - default: return module.createI32(0); + default: return module.i32(0); case TypeKind.ISIZE: - case TypeKind.USIZE: if (this.size != 64) return module.createI32(0); + case TypeKind.USIZE: if (this.size != 64) return module.i32(0); case TypeKind.I64: - case TypeKind.U64: return module.createI64(0); - case TypeKind.F32: return module.createF32(0); - case TypeKind.F64: return module.createF64(0); - case TypeKind.V128: return module.createV128(v128_zero); + case TypeKind.U64: return module.i64(0); + case TypeKind.F32: return module.f32(0); + case TypeKind.F64: return module.f64(0); + case TypeKind.V128: return module.v128(v128_zero); } } @@ -340,13 +348,13 @@ export class Type { switch (this.kind) { case TypeKind.V128: case TypeKind.VOID: assert(false); - default: return module.createI32(1); + default: return module.i32(1); case TypeKind.ISIZE: - case TypeKind.USIZE: if (this.size != 64) return module.createI32(1); + case TypeKind.USIZE: if (this.size != 64) return module.i32(1); case TypeKind.I64: - case TypeKind.U64: return module.createI64(1); - case TypeKind.F32: return module.createF32(1); - case TypeKind.F64: return module.createF64(1); + case TypeKind.U64: return module.i64(1); + case TypeKind.F32: return module.f32(1); + case TypeKind.F64: return module.f64(1); } } @@ -355,13 +363,13 @@ export class Type { switch (this.kind) { case TypeKind.V128: case TypeKind.VOID: assert(false); - default: return module.createI32(-1); + default: return module.i32(-1); case TypeKind.ISIZE: - case TypeKind.USIZE: if (this.size != 64) return module.createI32(-1); + case TypeKind.USIZE: if (this.size != 64) return module.i32(-1); case TypeKind.I64: - case TypeKind.U64: return module.createI64(-1, -1); - case TypeKind.F32: return module.createF32(-1); - case TypeKind.F64: return module.createF64(-1); + case TypeKind.U64: return module.i64(-1, -1); + case TypeKind.F32: return module.f32(-1); + case TypeKind.F64: return module.f64(-1); } } diff --git a/std/assembly/allocator/arena.ts b/std/assembly/allocator/arena.ts deleted file mode 100644 index 5d74b56c93..0000000000 --- a/std/assembly/allocator/arena.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Arena Memory Allocator - * - * Provides a `memory.reset` function to reset the heap to its initial state. A user has to make - * sure that there are no more references to cleared memory afterwards. Always aligns to 8 bytes. - * - * @module std/assembly/allocator/arena - *//***/ - -import { AL_MASK, MAX_SIZE_32 } from "../internal/allocator"; - -var startOffset: usize = (HEAP_BASE + AL_MASK) & ~AL_MASK; -var offset: usize = startOffset; - -// Memory allocator interface - -@global export function __memory_allocate(size: usize): usize { - if (size > MAX_SIZE_32) unreachable(); - var ptr = offset; - var newPtr = (ptr + max(size, 1) + AL_MASK) & ~AL_MASK; - var pagesBefore = memory.size(); - if (newPtr > pagesBefore << 16) { - let pagesNeeded = ((newPtr - ptr + 0xffff) & ~0xffff) >>> 16; - let pagesWanted = max(pagesBefore, pagesNeeded); // double memory - if (memory.grow(pagesWanted) < 0) { - if (memory.grow(pagesNeeded) < 0) { - unreachable(); // out of memory - } - } - } - offset = newPtr; - return ptr; -} - -@global export function __memory_free(ptr: usize): void { /* nop */ } - -@global export function __memory_reset(): void { - offset = startOffset; -} diff --git a/std/assembly/allocator/emscripten.ts b/std/assembly/allocator/emscripten.ts deleted file mode 100644 index 92956b764d..0000000000 --- a/std/assembly/allocator/emscripten.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Emscripten Memory Allocator. - * - * Uses Emscripten's exported _malloc and _free implementations, i.e., when linking with - * Emscripten-compiled programs that already provide these. Differs from 'system' in that their - * names are prefixed with an underscore. - * - * @module std/assembly/allocator/emscripten - *//***/ - -declare function _malloc(size: usize): usize; -declare function _free(ptr: usize): void; - -// Memory allocator interface - -@global export function __memory_allocate(size: usize): usize { - return _malloc(size); -} - -@global export function __memory_free(ptr: usize): void { - _free(ptr); -} diff --git a/std/assembly/allocator/system.ts b/std/assembly/allocator/system.ts deleted file mode 100644 index 76b3293b0c..0000000000 --- a/std/assembly/allocator/system.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * System Memory Allocator. - * - * Uses the environment's malloc and free implementations, i.e., when linking with other C-like - * programs that already provide these. - * - * @module std/assembly/allocator/system - *//***/ - -declare function malloc(size: usize): usize; -declare function free(ptr: usize): void; - -// Memory allocator interface - -@global export function __memory_allocate(size: usize): usize { - return malloc(size); -} - -@global export function __memory_free(ptr: usize): void { - free(ptr); -} diff --git a/std/assembly/allocator/tlsf.ts b/std/assembly/allocator/tlsf.ts deleted file mode 100644 index 04b027dc55..0000000000 --- a/std/assembly/allocator/tlsf.ts +++ /dev/null @@ -1,503 +0,0 @@ -/** - * Two-Level Segregate Fit Memory Allocator. - * - * A general purpose dynamic memory allocator specifically designed to meet real-time requirements. - * Always aligns to 8 bytes. - * - * @module std/assembly/allocator/tlsf - *//***/ - -// ╒══════════════ Block size interpretation (32-bit) ═════════════╕ -// 3 2 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits -// ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┼─┴─┴─┴─┴─╫─┴─┴─┤ -// │ | FL │ SB = SL + AL │ ◄─ usize -// └───────────────────────────────────────────────┴─────────╨─────┘ -// FL: first level, SL: second level, AL: alignment, SB: small block - -import { - AL_BITS, - AL_SIZE, - AL_MASK -} from "../internal/allocator"; - -const SL_BITS: u32 = 5; -const SL_SIZE: usize = 1 << SL_BITS; - -const SB_BITS: usize = (SL_BITS + AL_BITS); -const SB_SIZE: usize = 1 << SB_BITS; - -const FL_BITS: u32 = (sizeof() == sizeof() - ? 30 // ^= up to 1GB per block - : 32 // ^= up to 4GB per block -) - SB_BITS; - -// ╒════════════════ Block structure layout (32-bit) ══════════════╕ -// 3 2 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits -// ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┼─┼─┤ -// │ size │L│F│ ◄─┐ info -// ╞═══════════════════════════════════════════════════════════╧═╧═╡ │ ┐ -// │ if free: ◄ prev │ ◄─┤ usize -// ├───────────────────────────────────────────────────────────────┤ │ -// │ if free: next ► │ ◄─┤ -// ├───────────────────────────────────────────────────────────────┤ │ -// │ ... unused free space >= 0 ... │ │ = 0 -// ├ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┤ │ -// │ if free: jump ▲ │ ◄─┘ -// └───────────────────────────────────────────────────────────────┘ MIN SIZE ┘ -// F: FREE, L: LEFT_FREE - -/** Tag indicating that this block is free. */ -const FREE: usize = 1 << 0; -/** Tag indicating that this block's left block is free. */ -const LEFT_FREE: usize = 1 << 1; -/** Mask to obtain all tags. */ -const TAGS: usize = FREE | LEFT_FREE; - -/** Block structure. */ -@unmanaged -class Block { - - /** Info field holding this block's size and tags. */ - info: usize; - - /** End offset of the {@link Block#info} field. User data starts here. */ - static readonly INFO: usize = (sizeof() + AL_MASK) & ~AL_MASK; - - /** Previous free block, if any. Only valid if free. */ - prev: Block | null; - /** Next free block, if any. Only valid if free. */ - next: Block | null; - - /** Minimum size of a block, excluding {@link Block#info}. */ - static readonly MIN_SIZE: usize = (3 * sizeof() + AL_MASK) & ~AL_MASK;// prev + next + jump - - /** Maximum size of a used block, excluding {@link Block#info}. */ - static readonly MAX_SIZE: usize = 1 << (FL_BITS + SB_BITS); - - /** Gets this block's left (free) block in memory. */ - get left(): Block { - assert(this.info & LEFT_FREE); // must be free to contain a jump - return assert( - load(changetype(this) - sizeof()) - ); // can't be null - } - - /** Gets this block's right block in memory. */ - get right(): Block { - assert(this.info & ~TAGS); // can't skip beyond the tail block - return assert( - changetype( - changetype(this) + Block.INFO + (this.info & ~TAGS) - ) - ); // can't be null - } -} - -// ╒════════════════ Root structure layout (32-bit) ═══════════════╕ -// 3 2 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits -// ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┤ ┐ -// │ 0 | flMap S│ ◄────┐ -// ╞═══════════════════════════════════════════════════════════════╡ │ -// │ slMap[0] S │ ◄─┐ │ -// ├───────────────────────────────────────────────────────────────┤ │ │ -// │ slMap[1] │ ◄─┤ │ -// ├───────────────────────────────────────────────────────────────┤ u32 │ -// │ ... │ ◄─┤ │ -// ├───────────────────────────────────────────────────────────────┤ │ │ -// │ slMap[22] P │ ◄─┘ │ -// ╞═══════════════════════════════════════════════════════════════╡ usize -// │ head[0] │ ◄────┤ -// ├───────────────────────────────────────────────────────────────┤ │ -// │ ... │ ◄────┤ -// ├───────────────────────────────────────────────────────────────┤ │ -// │ head[736] │ ◄────┤ -// ╞═══════════════════════════════════════════════════════════════╡ │ -// │ tailRef │ ◄────┘ -// └───────────────────────────────────────────────────────────────┘ SIZE ┘ -// S: Small blocks map, P: Possibly padded if 64-bit - -assert((1 << SL_BITS) <= 32); // second level must fit into 32 bits - -/** Root structure. */ -@unmanaged -class Root { - - /** First level bitmap. */ - flMap: usize = 0; - - /** Start offset of second level maps. */ - private static readonly SL_START: usize = sizeof(); - - // Using *one* SL map per *FL bit* - - /** Gets the second level map for the specified first level. */ - getSLMap(fl: usize): u32 { - assert(fl < FL_BITS); // fl out of range - return load(changetype(this) + fl * 4, Root.SL_START); - } - - /** Sets the second level map for the specified first level. */ - setSLMap(fl: usize, value: u32): void { - assert(fl < FL_BITS); // fl out of range - store(changetype(this) + fl * 4, value, Root.SL_START); - } - - /** End offset of second level maps. */ - private static readonly SL_END: usize = Root.SL_START + FL_BITS * 4; - - // Using *number bits per SL* heads per *FL bit* - - /** Start offset of FL/SL heads. */ - private static readonly HL_START: usize = (Root.SL_END + AL_MASK) & ~AL_MASK; - - /** Gets the head of the specified first and second level index. */ - getHead(fl: usize, sl: u32): Block | null { - assert(fl < FL_BITS); // fl out of range - assert(sl < SL_SIZE); // sl out of range - return changetype(load( - changetype(this) + (fl * SL_SIZE + sl) * sizeof() - , Root.HL_START)); - } - - /** Sets the head of the specified first and second level index. */ - setHead(fl: usize, sl: u32, value: Block | null): void { - assert(fl < FL_BITS); // fl out of range - assert(sl < SL_SIZE); // sl out of range - store( - changetype(this) + (fl * SL_SIZE + sl) * sizeof() - , changetype(value) - , Root.HL_START); - } - - /** End offset of FL/SL heads. */ - private static readonly HL_END: usize = ( - Root.HL_START + FL_BITS * SL_SIZE * sizeof() - ); - - get tailRef(): usize { return load(0, Root.HL_END); } - set tailRef(value: usize) { store(0, value, Root.HL_END); } - - /** Total size of the {@link Root} structure. */ - static readonly SIZE: usize = Root.HL_END + sizeof(); - - /** Inserts a previously used block back into the free list. */ - insert(block: Block): void { - // check as much as possible here to prevent invalid free blocks - assert(block); // cannot be null - var blockInfo = block.info; - assert(blockInfo & FREE); // must be free - var size: usize; - assert( - (size = block.info & ~TAGS) >= Block.MIN_SIZE && size < Block.MAX_SIZE - ); // must be valid, not necessary to compute yet if noAssert=true - - var right: Block = assert(block.right); // can't be null - var rightInfo = right.info; - - // merge with right block if also free - if (rightInfo & FREE) { - this.remove(right); - block.info = (blockInfo += Block.INFO + (rightInfo & ~TAGS)); - right = block.right; - rightInfo = right.info; - // jump is set below - } - - // merge with left block if also free - if (blockInfo & LEFT_FREE) { - let left: Block = assert(block.left); // can't be null - let leftInfo = left.info; - assert(leftInfo & FREE); // must be free according to tags - this.remove(left); - left.info = (leftInfo += Block.INFO + (blockInfo & ~TAGS)); - block = left; - blockInfo = leftInfo; - // jump is set below - } - - right.info = rightInfo | LEFT_FREE; - this.setJump(block, right); - // right is no longer used now, hence rightInfo is not synced - - size = blockInfo & ~TAGS; - assert(size >= Block.MIN_SIZE && size < Block.MAX_SIZE); // must be valid - - // mapping_insert - var fl: usize, sl: u32; - if (size < SB_SIZE) { - fl = 0; - sl = (size / AL_SIZE); - } else { - fl = fls(size); - sl = ((size >> (fl - SL_BITS)) ^ (1 << SL_BITS)); - fl -= SB_BITS - 1; - } - - // perform insertion - var head = this.getHead(fl, sl); - block.prev = null; - block.next = head; - if (head) head.prev = block; - this.setHead(fl, sl, block); - - // update first and second level maps - this.flMap |= (1 << fl); - this.setSLMap(fl, this.getSLMap(fl) | (1 << sl)); - } - - /** - * Removes a free block from FL/SL maps. Does not alter left/jump because it - * is likely that splitting is performed afterwards, invalidating any changes - * again. - */ - private remove(block: Block): void { - var blockInfo = block.info; - assert(blockInfo & FREE); // must be free - var size = blockInfo & ~TAGS; - assert(size >= Block.MIN_SIZE && size < Block.MAX_SIZE); // must be valid - - // mapping_insert - var fl: usize, sl: u32; - if (size < SB_SIZE) { - fl = 0; - sl = (size / AL_SIZE); - } else { - fl = fls(size); - sl = ((size >> (fl - SL_BITS)) ^ (1 << SL_BITS)); - fl -= SB_BITS - 1; - } - - // link previous and next free block - var prev = block.prev; - var next = block.next; - if (prev) prev.next = next; - if (next) next.prev = prev; - - // update head if we are removing it - if (block == this.getHead(fl, sl)) { - this.setHead(fl, sl, next); - - // clear second level map if head is empty now - if (!next) { - let slMap = this.getSLMap(fl); - this.setSLMap(fl, slMap &= ~(1 << sl)); - - // clear first level map if second level is empty now - if (!slMap) this.flMap &= ~(1 << fl); - } - } - } - - /** Searches for a free block of at least the specified size. */ - search(size: usize): Block | null { - assert(size >= Block.MIN_SIZE && size < Block.MAX_SIZE); - - // mapping_search - var fl: usize, sl: u32; - if (size < SB_SIZE) { - fl = 0; - sl = (size / AL_SIZE); - } else { - // (*) size += (1 << (fls(size) - SL_BITS)) - 1; - fl = fls(size); - sl = ((size >> (fl - SL_BITS)) ^ (1 << SL_BITS)); - fl -= SB_BITS - 1; - // (*) instead of rounding up, use next second level list for better fit - if (sl < SL_SIZE - 1) ++sl; - else ++fl, sl = 0; - } - - // search second level - var slMap = this.getSLMap(fl) & (~0 << sl); - var head: Block | null; - if (!slMap) { - // search next larger first level - let flMap = this.flMap & (~0 << (fl + 1)); - if (!flMap) { - head = null; - } else { - fl = ffs(flMap); - slMap = assert(this.getSLMap(fl)); // can't be zero if fl points here - head = this.getHead(fl, ffs(slMap)); - } - } else { - head = this.getHead(fl, ffs(slMap)); - } - return head; - } - - /** Links a free left with its right block in memory. */ - private setJump(left: Block, right: Block): void { - assert(left.info & FREE); // must be free - assert(left.right == right); // right block must match - assert(right.info & LEFT_FREE); // right block must be tagged as LEFT_FREE - store( - changetype(right) - sizeof() - , left); // last word in left block's (free) data region - } - - /** - * Uses the specified free block, removing it from internal maps and - * splitting it if possible, and returns its data pointer. - */ - use(block: Block, size: usize): usize { - var blockInfo = block.info; - assert(blockInfo & FREE); // must be free so we can use it - assert(size >= Block.MIN_SIZE && size < Block.MAX_SIZE); // must be valid - assert(!(size & AL_MASK)); // size must be aligned so the new block is - - this.remove(block); - - // split if the block can hold another MIN_SIZE block - var remaining = (blockInfo & ~TAGS) - size; - if (remaining >= Block.INFO + Block.MIN_SIZE) { - block.info = size | (blockInfo & LEFT_FREE); // also discards FREE - - let spare = changetype( - changetype(block) + Block.INFO + size - ); - spare.info = (remaining - Block.INFO) | FREE; // not LEFT_FREE - this.insert(spare); // also sets jump - - // otherwise tag block as no longer FREE and right as no longer LEFT_FREE - } else { - block.info = blockInfo & ~FREE; - let right: Block = assert(block.right); // can't be null (tail) - right.info &= ~LEFT_FREE; - } - - return changetype(block) + Block.INFO; - } - - /** Adds more memory to the pool. */ - addMemory(start: usize, end: usize): bool { - assert(start <= end); - assert(!(start & AL_MASK)); // must be aligned - assert(!(end & AL_MASK)); // must be aligned - - var tailRef = this.tailRef; - var tailInfo: usize = 0; - if (tailRef) { - assert(start >= tailRef + sizeof()); // starts after tail - - // merge with current tail if adjacent - if (start - Block.INFO == tailRef) { - start -= Block.INFO; - tailInfo = changetype(tailRef).info; - } - - } else { - assert(start >= changetype(this) + Root.SIZE); // starts after root - } - - // check if size is large enough for a free block and the tail block - var size = end - start; - if (size < Block.INFO + Block.MIN_SIZE + Block.INFO) { - return false; - } - - // left size is total minus its own and the zero-length tail's header - var leftSize = size - 2 * Block.INFO; - var left = changetype(start); - left.info = leftSize | FREE | (tailInfo & LEFT_FREE); - left.prev = null; - left.next = null; - - // tail is a zero-length used block - var tail = changetype(start + size - Block.INFO); - tail.info = 0 | LEFT_FREE; - this.tailRef = changetype(tail); - - this.insert(left); // also merges with free left before tail / sets jump - - return true; - } -} - -/** Determines the first (LSB to MSB) set bit's index of a word. */ -function ffs(word: T): T { - assert(word != 0); // word cannot be 0 - return ctz(word); // differs from ffs only for 0 -} - -/** Determines the last (LSB to MSB) set bit's index of a word. */ -function fls(word: T): T { - assert(word != 0); // word cannot be 0 - const inv: T = (sizeof() << 3) - 1; - return inv - clz(word); -} - -/** Reference to the initialized {@link Root} structure, once initialized. */ -var ROOT: Root = changetype(0); - -// Memory allocator interface - -/** Allocates a chunk of memory. */ -@global export function __memory_allocate(size: usize): usize { - - // initialize if necessary - var root = ROOT; - if (!root) { - let rootOffset = (HEAP_BASE + AL_MASK) & ~AL_MASK; - let pagesBefore = memory.size(); - let pagesNeeded = ((((rootOffset + Root.SIZE) + 0xffff) & ~0xffff) >>> 16); - if (pagesNeeded > pagesBefore && memory.grow(pagesNeeded - pagesBefore) < 0) unreachable(); - ROOT = root = changetype(rootOffset); - root.tailRef = 0; - root.flMap = 0; - for (let fl: usize = 0; fl < FL_BITS; ++fl) { - root.setSLMap(fl, 0); - for (let sl: u32 = 0; sl < SL_SIZE; ++sl) { - root.setHead(fl, sl, null); - } - } - root.addMemory((rootOffset + Root.SIZE + AL_MASK) & ~AL_MASK, memory.size() << 16); - } - - // search for a suitable block - if (size > Block.MAX_SIZE) unreachable(); - - // 32-bit MAX_SIZE is 1 << 30 and itself aligned, hence the following can't overflow MAX_SIZE - size = max((size + AL_MASK) & ~AL_MASK, Block.MIN_SIZE); - - var block = root.search(size); - if (!block) { - - // request more memory - let pagesBefore = memory.size(); - let pagesNeeded = (((size + 0xffff) & ~0xffff) >>> 16); - let pagesWanted = max(pagesBefore, pagesNeeded); // double memory - if (memory.grow(pagesWanted) < 0) { - if (memory.grow(pagesNeeded) < 0) { - unreachable(); // out of memory - } - } - let pagesAfter = memory.size(); - root.addMemory(pagesBefore << 16, pagesAfter << 16); - block = assert(root.search(size)); // must be found now - } - - assert((block.info & ~TAGS) >= size); - return root.use(block, size); -} - -/** Frees the chunk of memory at the specified address. */ -@global export function __memory_free(data: usize): void { - if (data) { - let root = ROOT; - if (root) { - let block = changetype(data - Block.INFO); - let blockInfo = block.info; - assert(!(blockInfo & FREE)); // must be used - block.info = blockInfo | FREE; - root.insert(changetype(data - Block.INFO)); - } - } -} - -@global export function __memory_reset(): void { - unreachable(); -} diff --git a/std/assembly/array.ts b/std/assembly/array.ts index 059d5650ca..2fcdf6fd3b 100644 --- a/std/assembly/array.ts +++ b/std/assembly/array.ts @@ -1,219 +1,245 @@ -import { - MAX_BLENGTH, - HEADER_SIZE, - allocateUnsafe, - reallocateUnsafe, - LOAD, - STORE -} from "./internal/arraybuffer"; - -import { - allocateUnsafe as allocateUnsafeString, - freeUnsafe as freeUnsafeString, - copyUnsafe as copyUnsafeString -} from "./internal/string"; - -import { - COMPARATOR, - SORT -} from "./internal/sort"; - -import { - itoa, - dtoa, - itoa_stream, - dtoa_stream, - MAX_DOUBLE_LENGTH -} from "./internal/number"; - -import { - isArray as builtin_isArray -} from "./builtins"; - -export class Array { - [key: number]: T; // compatibility only - - /* @internal */ buffer_: ArrayBuffer; - /* @internal */ length_: i32; - - @inline static isArray(value: U): bool { +/// + +import { BLOCK_MAXSIZE } from "./rt/common"; +import { COMPARATOR, SORT } from "./util/sort"; +import { ArrayBuffer, ArrayBufferView } from "./arraybuffer"; +import { itoa, dtoa, itoa_stream, dtoa_stream, MAX_DOUBLE_LENGTH } from "./util/number"; +import { idof, isArray as builtin_isArray } from "./builtins"; +import { E_INDEXOUTOFRANGE, E_INVALIDLENGTH, E_EMPTYARRAY, E_HOLEYARRAY } from "./util/error"; + +/** Ensures that the given array has _at least_ the specified backing size. */ +function ensureSize(array: usize, minSize: usize, alignLog2: u32): void { + var oldCapacity = changetype(array).dataLength; + if (minSize > oldCapacity >>> alignLog2) { + if (minSize > BLOCK_MAXSIZE >>> alignLog2) throw new RangeError(E_INVALIDLENGTH); + let oldData = changetype(changetype(array).data); + let newCapacity = minSize << alignLog2; + let newData = __realloc(oldData, newCapacity); + memory.fill(newData + oldCapacity, 0, newCapacity - oldCapacity); + if (newData !== oldData) { // oldData has been free'd + store(changetype(array), __retain(newData), offsetof("data")); + changetype(array).dataStart = newData; + } + changetype(array).dataLength = newCapacity; + } +} + +export class Array extends ArrayBufferView { + [key: number]: T; + + // Implementing ArrayBufferView isn't strictly necessary here but is done to allow glue code + // to work with typed and normal arrays interchangeably. Technically, normal arrays do not need + // `dataStart` (equals `data`) and `dataLength` (equals computed `data.byteLength`). + + // Also note that Array with non-nullable T must guard against implicit null values whenever + // length is modified in a way that a null value would exist. Otherwise, the compiler wouldn't be + // able to guarantee type-safety anymore. For lack of a better word, such an array is "holey". + + private length_: i32; + + static isArray(value: U): bool { return builtin_isArray(value) && value !== null; } + static create(capacity: i32 = 0): Array { + if (capacity > BLOCK_MAXSIZE >>> alignof()) throw new RangeError(E_INVALIDLENGTH); + var array = changetype>(__allocArray(capacity, alignof(), idof())); // retains + changetype>(array).length_ = 0; // safe even if T is a non-nullable reference + memory.fill(array.dataStart, 0, array.dataLength); + return array; + } + constructor(length: i32 = 0) { - const MAX_LENGTH = MAX_BLENGTH >>> alignof(); - if (length > MAX_LENGTH) throw new RangeError("Invalid array length"); - var byteLength = length << alignof(); - var buffer = allocateUnsafe(byteLength); - this.buffer_ = buffer; + super(length, alignof()); + if (isReference()) { + if (!isNullable()) { + if (length) throw new Error(E_HOLEYARRAY); + } + } this.length_ = length; - memory.fill( - changetype(buffer) + HEADER_SIZE, - 0, - byteLength - ); } - @inline + @unsafe get buffer(): ArrayBuffer { + return this.data; + } + get length(): i32 { return this.length_; } - set length(length: i32) { - var buffer = this.buffer_; - var capacity = buffer.byteLength >>> alignof(); - if (length > capacity) { - const MAX_LENGTH = MAX_BLENGTH >>> alignof(); - if (length > MAX_LENGTH) throw new RangeError("Invalid array length"); - buffer = reallocateUnsafe(buffer, length << alignof()); - this.buffer_ = buffer; + set length(newLength: i32) { + var oldLength = this.length_; + if (isReference()) { + if (!isNullable()) { + if (newLength > oldLength) throw new Error(E_HOLEYARRAY); + } } - this.length_ = length; + ensureSize(changetype(this), newLength, alignof()); + if (isManaged()) { // release no longer used refs + if (oldLength > newLength) { + let dataStart = this.dataStart; + do __release(load(dataStart + (--oldLength << alignof()))); + while (oldLength > newLength); + // no need to zero memory on shrink -> is zeroed on grow + } + } + this.length_ = newLength; } - every(callbackfn: (element: T, index: i32, array: Array) => bool): bool { + every(fn: (value: T, index: i32, array: Array) => bool): bool { for (let index = 0, length = this.length_; index < min(length, this.length_); ++index) { - if (!callbackfn(LOAD(this.buffer_, index), index, this)) return false; + if (!fn(load(this.dataStart + (index << alignof())), index, this)) return false; } return true; } - findIndex(predicate: (element: T, index: i32, array: Array) => bool): i32 { + findIndex(predicate: (value: T, index: i32, array: Array) => bool): i32 { for (let index = 0, length = this.length_; index < min(length, this.length_); ++index) { - if (predicate(LOAD(this.buffer_, index), index, this)) return index; + if (predicate(load(this.dataStart + (index << alignof())), index, this)) return index; } return -1; } - @operator("[]") - private __get(index: i32): T { - var buffer = this.buffer_; - return index < (buffer.byteLength >>> alignof()) - ? LOAD(buffer, index) - : unreachable(); + @operator("[]") private __get(index: i32): T { + if (isReference()) { + if (!isNullable()) { + if (index >= this.length_) throw new Error(E_HOLEYARRAY); + } + } + if (index >= this.dataLength >>> alignof()) throw new RangeError(E_INDEXOUTOFRANGE); + return this.__unchecked_get(index); } - @operator("{}") - private __unchecked_get(index: i32): T { - return LOAD(this.buffer_, index); + @operator("{}") private __unchecked_get(index: i32): T { + return load(this.dataStart + (index << alignof())); } - @operator("[]=") - private __set(index: i32, value: T): void { - var buffer = this.buffer_; - var capacity = buffer.byteLength >>> alignof(); - if (index >= capacity) { - const MAX_LENGTH = MAX_BLENGTH >>> alignof(); - if (index >= MAX_LENGTH) throw new Error("Invalid array length"); - buffer = reallocateUnsafe(buffer, (index + 1) << alignof()); - this.buffer_ = buffer; - this.length_ = index + 1; + @operator("[]=") private __set(index: i32, value: T): void { + var length = this.length_; + if (isReference()) { + if (!isNullable()) { + if (index > length) throw new Error(E_HOLEYARRAY); + } } - STORE(buffer, index, value); - if (isManaged()) __gc_link(changetype(this), changetype(value)); // tslint:disable-line + ensureSize(changetype(this), index + 1, alignof()); + this.__unchecked_set(index, value); + if (index >= length) this.length_ = index + 1; } - @operator("{}=") - private __unchecked_set(index: i32, value: T): void { - STORE(this.buffer_, index, value); - if (isManaged()) __gc_link(changetype(this), changetype(value)); // tslint:disable-line + @operator("{}=") private __unchecked_set(index: i32, value: T): void { + if (isManaged()) { + let offset = this.dataStart + (index << alignof()); + let oldRef: usize = load(offset); + if (changetype(value) != oldRef) { + store(offset, __retain(changetype(value))); + __release(oldRef); + } + } else { + store(this.dataStart + (index << alignof()), value); + } } fill(value: T, start: i32 = 0, end: i32 = i32.MAX_VALUE): this { - var buffer = this.buffer_; - var len = this.length_; - - start = start < 0 ? max(len + start, 0) : min(start, len); - end = end < 0 ? max(len + end, 0) : min(end, len); - - if (sizeof() == 1) { + var dataStart = this.dataStart; + var length = this.length_; + start = start < 0 ? max(length + start, 0) : min(start, length); + end = end < 0 ? max(length + end, 0) : min(end, length); + if (isManaged()) { + for (; start < end; ++start) { + let oldRef: usize = load(dataStart + (start << alignof())); + if (changetype(value) != oldRef) { + store(dataStart + (start << alignof()), __retain(changetype(value))); + __release(oldRef); + } + } + } else if (sizeof() == 1) { if (start < end) { memory.fill( - changetype(buffer) + start + HEADER_SIZE, - value, + dataStart + start, + u8(value), (end - start) ); } } else { for (; start < end; ++start) { - STORE(buffer, start, value); + store(dataStart + (start << alignof()), value); } } return this; } - @inline - includes(searchElement: T, fromIndex: i32 = 0): bool { - return this.indexOf(searchElement, fromIndex) >= 0; + includes(value: T, fromIndex: i32 = 0): bool { + return this.indexOf(value, fromIndex) >= 0; } - indexOf(searchElement: T, fromIndex: i32 = 0): i32 { + indexOf(value: T, fromIndex: i32 = 0): i32 { var length = this.length_; if (length == 0 || fromIndex >= length) return -1; if (fromIndex < 0) fromIndex = max(length + fromIndex, 0); - var buffer = this.buffer_; + var dataStart = this.dataStart; while (fromIndex < length) { - if (LOAD(buffer, fromIndex) == searchElement) return fromIndex; + if (load(dataStart + (fromIndex << alignof())) == value) return fromIndex; ++fromIndex; } return -1; } - lastIndexOf(searchElement: T, fromIndex: i32 = this.length_): i32 { + lastIndexOf(value: T, fromIndex: i32 = this.length_): i32 { var length = this.length_; if (length == 0) return -1; - if (fromIndex < 0) fromIndex = length + fromIndex; // no need to clamp + if (fromIndex < 0) fromIndex = length + fromIndex; else if (fromIndex >= length) fromIndex = length - 1; - var buffer = this.buffer_; - while (fromIndex >= 0) { // ^ - if (LOAD(buffer, fromIndex) == searchElement) return fromIndex; + var dataStart = this.dataStart; + while (fromIndex >= 0) { + if (load(dataStart + (fromIndex << alignof())) == value) return fromIndex; --fromIndex; } return -1; } - push(element: T): i32 { + push(value: T): i32 { var length = this.length_; - var buffer = this.buffer_; - var capacity = buffer.byteLength >>> alignof(); - var newLength = length + 1; // safe only if length is checked - if (length >= capacity) { - const MAX_LENGTH = MAX_BLENGTH >>> alignof(); - if (length >= MAX_LENGTH) throw new Error("Invalid array length"); - buffer = reallocateUnsafe(buffer, newLength << alignof()); - this.buffer_ = buffer; + var newLength = length + 1; + ensureSize(changetype(this), newLength, alignof()); + if (isManaged()) { + store(this.dataStart + (length << alignof()), __retain(changetype(value))); + } else { + store(this.dataStart + (length << alignof()), value); } this.length_ = newLength; - STORE(buffer, length, element); - if (isManaged()) __gc_link(changetype(this), changetype(element)); // tslint:disable-line return newLength; } - concat(items: Array): Array { + concat(other: Array): Array { var thisLen = this.length_; - var otherLen = select(0, items.length_, items === null); + var otherLen = select(0, other.length_, other === null); var outLen = thisLen + otherLen; - var out = new Array(outLen); - - if (thisLen) { - memory.copy( - changetype(out.buffer_) + HEADER_SIZE, - changetype(this.buffer_) + HEADER_SIZE, - thisLen << alignof() - ); - } - if (otherLen) { - memory.copy( - changetype(out.buffer_) + HEADER_SIZE + (thisLen << alignof()), - changetype(items.buffer_) + HEADER_SIZE, - otherLen << alignof() - ); + if (outLen > BLOCK_MAXSIZE >>> alignof()) throw new Error(E_INVALIDLENGTH); + var out = changetype>(__allocArray(outLen, alignof(), idof>())); // retains + var outStart = out.dataStart; + var thisSize = thisLen << alignof(); + if (isManaged()) { + let thisStart = this.dataStart; + for (let offset: usize = 0; offset < thisSize; offset += sizeof()) { + let ref = load(thisStart + offset); + store(outStart + offset, __retain(ref)); + } + outStart += thisSize; + let otherStart = other.dataStart; + let otherSize = otherLen << alignof(); + for (let offset: usize = 0; offset < otherSize; offset += sizeof()) { + let ref = load(otherStart + offset); + store(outStart + offset, __retain(ref)); + } + } else { + memory.copy(outStart, this.dataStart, thisSize); + memory.copy(outStart + thisSize, other.dataStart, otherLen << alignof()); } return out; } copyWithin(target: i32, start: i32, end: i32 = i32.MAX_VALUE): this { - var buffer = this.buffer_; + var dataStart = this.dataStart; var len = this.length_; end = min(end, len); @@ -222,17 +248,34 @@ export class Array { var last = end < 0 ? max(len + end, 0) : min(end, len); var count = min(last - from, len - to); - if (from < to && to < (from + count)) { - from += count - 1; - to += count - 1; - while (count) { - STORE(buffer, to, LOAD(buffer, from)); - --from, --to, --count; + if (isManaged()) { + if (from < to && to < (from + count)) { // right to left + from += count - 1; + to += count - 1; + while (count) { + let oldRef: usize = load(dataStart + (to << alignof())); + let newRef: usize = load(dataStart + (from << alignof())); + if (newRef != oldRef) { + store(dataStart + (to << alignof()), __retain(newRef)); + __release(oldRef); + } + --from, --to, --count; + } + } else { // left to right + while (count) { + let oldRef: usize = load(dataStart + (to << alignof())); + let newRef: usize = load(dataStart + (from << alignof())); + if (newRef != oldRef) { + store(dataStart + (to << alignof()), __retain(newRef)); + __release(oldRef); + } + ++from, ++to, --count; + } } } else { - memory.copy( - changetype(buffer) + HEADER_SIZE + (to << alignof()), - changetype(buffer) + HEADER_SIZE + (from << alignof()), + memory.copy( // is memmove + dataStart + (to << alignof()), + dataStart + (from << alignof()), count << alignof() ); } @@ -241,344 +284,456 @@ export class Array { pop(): T { var length = this.length_; - if (length < 1) throw new RangeError("Array is empty"); - var element = LOAD(this.buffer_, --length); + if (length < 1) throw new RangeError(E_EMPTYARRAY); + var element = load(this.dataStart + ((--length) << alignof())); this.length_ = length; - return element; + return element; // no need to retain -> is moved } - forEach(callbackfn: (value: T, index: i32, array: Array) => void): void { + forEach(fn: (value: T, index: i32, array: Array) => void): void { for (let index = 0, length = this.length_; index < min(length, this.length_); ++index) { - callbackfn(LOAD(this.buffer_, index), index, this); + fn(load(this.dataStart + (index << alignof())), index, this); } } - map(callbackfn: (value: T, index: i32, array: Array) => U): Array { + map(fn: (value: T, index: i32, array: Array) => U): Array { var length = this.length_; - var result = new Array(length); - var buffer = result.buffer_; + var out = changetype>(__allocArray(length, alignof(), idof>())); // retains + var outStart = out.dataStart; for (let index = 0; index < min(length, this.length_); ++index) { - STORE(buffer, index, callbackfn(LOAD(this.buffer_, index), index, this)); + let result = fn(load(this.dataStart + (index << alignof())), index, this); // retains + if (isManaged()) { + store(outStart + (index << alignof()), __retain(changetype(result))); + } else { + store(outStart + (index << alignof()), result); + } + // releases result } - return result; + return out; } - filter(callbackfn: (value: T, index: i32, array: Array) => bool): Array { - var result = new Array(); + filter(fn: (value: T, index: i32, array: Array) => bool): Array { + var result = changetype>(__allocArray(0, alignof(), idof>())); // retains for (let index = 0, length = this.length_; index < min(length, this.length_); ++index) { - let value = LOAD(this.buffer_, index); - if (callbackfn(value, index, this)) result.push(value); + let value = load(this.dataStart + (index << alignof())); + if (fn(value, index, this)) result.push(value); } return result; } reduce( - callbackfn: (previousValue: U, currentValue: T, currentIndex: i32, array: Array) => U, + fn: (previousValue: U, currentValue: T, currentIndex: i32, array: Array) => U, initialValue: U ): U { var accum = initialValue; for (let index = 0, length = this.length_; index < min(length, this.length_); ++index) { - accum = callbackfn(accum, LOAD(this.buffer_, index), index, this); + accum = fn(accum, load(this.dataStart + (index << alignof())), index, this); } return accum; } reduceRight( - callbackfn: (previousValue: U, currentValue: T, currentIndex: i32, array: Array) => U, + fn: (previousValue: U, currentValue: T, currentIndex: i32, array: Array) => U, initialValue: U ): U { var accum = initialValue; for (let index = this.length_ - 1; index >= 0; --index) { - accum = callbackfn(accum, LOAD(this.buffer_, index), index, this); + accum = fn(accum, load(this.dataStart + (index << alignof())), index, this); } return accum; } shift(): T { var length = this.length_; - if (length < 1) throw new RangeError("Array is empty"); - var buffer = this.buffer_; - var element = LOAD(buffer, 0); + if (length < 1) throw new RangeError(E_EMPTYARRAY); + var base = this.dataStart; + var element = load(base); var lastIndex = length - 1; memory.copy( - changetype(buffer) + HEADER_SIZE, - changetype(buffer) + HEADER_SIZE + sizeof(), + base, + base + sizeof(), lastIndex << alignof() ); - STORE(buffer, lastIndex, null); + store(base + (lastIndex << alignof()), + // @ts-ignore: cast + null + ); this.length_ = lastIndex; - return element; + return element; // no need to retain -> is moved } - some(callbackfn: (element: T, index: i32, array: Array) => bool): bool { + some(fn: (value: T, index: i32, array: Array) => bool): bool { for (let index = 0, length = this.length_; index < min(length, this.length_); ++index) { - if (callbackfn(LOAD(this.buffer_, index), index, this)) return true; + if (fn(load(this.dataStart + (index << alignof())), index, this)) return true; } return false; } - unshift(element: T): i32 { - var buffer = this.buffer_; - var capacity = buffer.byteLength >>> alignof(); - var length = this.length_; - var newLength = length + 1; // safe only if length is checked - if (length >= capacity) { - const MAX_LENGTH = MAX_BLENGTH >>> alignof(); - if (length >= MAX_LENGTH) throw new Error("Invalid array length"); - buffer = reallocateUnsafe(buffer, newLength << alignof()); - capacity = buffer.byteLength >>> alignof(); - this.buffer_ = buffer; - } + unshift(value: T): i32 { + var newLength = this.length_ + 1; + ensureSize(changetype(this), newLength, alignof()); + var dataStart = this.dataStart; memory.copy( - changetype(buffer) + HEADER_SIZE + sizeof(), - changetype(buffer) + HEADER_SIZE, - (capacity - 1) << alignof() + dataStart + sizeof(), + dataStart, + (newLength - 1) << alignof() ); - STORE(buffer, 0, element); + if (isManaged()) { + store(dataStart, __retain(changetype(value))); + } else { + store(dataStart, value); + } this.length_ = newLength; - if (isManaged()) __gc_link(changetype(this), changetype(element)); // tslint:disable-line return newLength; } - slice(begin: i32 = 0, end: i32 = i32.MAX_VALUE): Array { - var len = this.length_; - begin = begin < 0 ? max(begin + len, 0) : min(begin, len); - end = end < 0 ? max(end + len, 0) : min(end, len); - len = max(end - begin, 0); - var sliced = new Array(len); - if (len) { - memory.copy( - changetype(sliced.buffer_) + HEADER_SIZE, - changetype(this.buffer_) + HEADER_SIZE + (begin << alignof()), - len << alignof() - ); + slice(start: i32 = 0, end: i32 = i32.MAX_VALUE): Array { + var length = this.length_; + start = start < 0 ? max(start + length, 0) : min(start, length); + end = end < 0 ? max(end + length, 0) : min(end , length); + length = max(end - start, 0); + var slice = changetype>(__allocArray(length, alignof(), idof>())); // retains + var sliceBase = slice.dataStart; + var thisBase = this.dataStart + (start << alignof()); + if (isManaged()) { + let off = 0; + let end = length << alignof(); + while (off < end) { + let ref = load(thisBase + off); + store(sliceBase + off, __retain(ref)); + off += sizeof(); + } + } else { + memory.copy(sliceBase, thisBase, length << alignof()); } - return sliced; + return slice; } splice(start: i32, deleteCount: i32 = i32.MAX_VALUE): Array { var length = this.length_; start = start < 0 ? max(length + start, 0) : min(start, length); deleteCount = max(min(deleteCount, length - start), 0); - var buffer = this.buffer_; - var spliced = new Array(deleteCount); - var source = changetype(buffer) + HEADER_SIZE + (start << alignof()); - memory.copy( - changetype(spliced.buffer_) + HEADER_SIZE, - source, - deleteCount << alignof() - ); + var result = changetype>(__allocArray(deleteCount, alignof(), idof>())); // retains + var resultStart = result.dataStart; + var thisStart = this.dataStart; + var thisBase = thisStart + (start << alignof()); + if (isManaged()) { + for (let i = 0; i < deleteCount; ++i) { + store(resultStart + (i << alignof()), + load(thisBase + (i << alignof())) + ); + // no need to retain -> is moved + } + } else { + memory.copy( + resultStart, + thisBase, + deleteCount << alignof() + ); + } var offset = start + deleteCount; if (length != offset) { memory.copy( - source, - changetype(buffer) + HEADER_SIZE + (offset << alignof()), + thisBase, + thisStart + (offset << alignof()), (length - offset) << alignof() ); } this.length_ = length - deleteCount; - return spliced; + return result; } reverse(): Array { - var buffer = this.buffer_; - for (let front = 0, back = this.length_ - 1; front < back; ++front, --back) { - let temp = LOAD(buffer, front); - STORE(buffer, front, LOAD(buffer, back)); - STORE(buffer, back, temp); + var length = this.length_; + if (length) { + let front = this.dataStart; + let back = this.dataStart + ((length - 1) << alignof()); + while (front < back) { + let temp = load(front); + store(front, load(back)); + store(back, temp); + front += sizeof(); + back -= sizeof(); + } } return this; } sort(comparator: (a: T, b: T) => i32 = COMPARATOR()): this { - // TODO remove this when flow will allow trackcing null - assert(comparator); // The comparison function must be a function - var length = this.length_; if (length <= 1) return this; - var buffer = this.buffer_; + var base = this.dataStart; if (length == 2) { - let a = LOAD(buffer, 1); // a = arr[1] - let b = LOAD(buffer, 0); // b = arr[0] + let a: T = load(base, sizeof()); // a = arr[1] + let b: T = load(base); // b = arr[0] if (comparator(a, b) < 0) { - STORE(buffer, 1, b); // arr[1] = b; - STORE(buffer, 0, a); // arr[0] = a; + store(base, b, sizeof()); // arr[1] = b; + store(base, a); // arr[0] = a; } return this; } - SORT(buffer, 0, length, comparator); + SORT(base, length, comparator); return this; } join(separator: string = ","): string { + if (isBoolean()) return this.join_bool(separator); + if (isInteger()) return this.join_int(separator); + if (isFloat()) return this.join_flt(separator); + if (isString()) return this.join_str(separator); + if (isArray()) return this.join_arr(separator); + if (isReference()) return this.join_ref(separator); + ERROR("unspported element type"); + return unreachable(); + } + + private join_bool(separator: string = ","): string { var lastIndex = this.length_ - 1; if (lastIndex < 0) return ""; - var result = ""; - var value: T; - var buffer = this.buffer_; + var dataStart = this.dataStart; + if (!lastIndex) return select("true", "false", load(dataStart)); + var sepLen = separator.length; - var hasSeparator = sepLen != 0; - if (value instanceof bool) { - if (!lastIndex) return select("true", "false", LOAD(buffer, 0)); - - let valueLen = 5; // max possible length of element len("false") - let estLen = (valueLen + sepLen) * lastIndex + valueLen; - let result = allocateUnsafeString(estLen); - let offset = 0; - for (let i = 0; i < lastIndex; ++i) { - value = LOAD(buffer, i); - valueLen = 4 + (!value); - copyUnsafeString(result, offset, select("true", "false", value), 0, valueLen); - offset += valueLen; - if (hasSeparator) { - copyUnsafeString(result, offset, changetype(separator), 0, sepLen); - offset += sepLen; - } - } - value = LOAD(buffer, lastIndex); - valueLen = 4 + (!value); - copyUnsafeString(result, offset, select("true", "false", value), 0, valueLen); + var valueLen = 5; // max possible length of element len("false") + var estLen = (valueLen + sepLen) * lastIndex + valueLen; + var result = changetype(__alloc(estLen << 1, idof())); // retains + var offset = 0; + var value: bool; + for (let i = 0; i < lastIndex; ++i) { + value = load(dataStart + i); + valueLen = 4 + i32(!value); + memory.copy( + changetype(result) + (offset << 1), + changetype(select("true", "false", value)), + valueLen << 1 + ); offset += valueLen; - - let out = result; - if (estLen > offset) { - out = result.substring(0, offset); - freeUnsafeString(result); - } - return out; - } else if (isInteger()) { - if (!lastIndex) return changetype(itoa(LOAD(buffer, 0))); - - const valueLen = (sizeof() <= 4 ? 10 : 20) + isSigned(); - let estLen = (valueLen + sepLen) * lastIndex + valueLen; - let result = allocateUnsafeString(estLen); - let offset = 0; - for (let i = 0; i < lastIndex; ++i) { - value = LOAD(buffer, i); - offset += itoa_stream(changetype(result), offset, value); - if (hasSeparator) { - copyUnsafeString(result, offset, separator, 0, sepLen); - offset += sepLen; - } + if (sepLen) { + memory.copy( + changetype(result) + (offset << 1), + changetype(separator), + sepLen << 1 + ); + offset += sepLen; } - value = LOAD(buffer, lastIndex); + } + value = load(dataStart + lastIndex); + valueLen = 4 + i32(!value); + memory.copy( + changetype(result) + (offset << 1), + changetype(select("true", "false", value)), + valueLen << 1 + ); + offset += valueLen; + + if (estLen > offset) return result.substring(0, offset); + return result; + } + + private join_int(separator: string = ","): string { + var lastIndex = this.length_ - 1; + if (lastIndex < 0) return ""; + var dataStart = this.dataStart; + // @ts-ignore: type + if (!lastIndex) return changetype(itoa(load(dataStart))); // retains + + var sepLen = separator.length; + const valueLen = (sizeof() <= 4 ? 10 : 20) + i32(isSigned()); + var estLen = (valueLen + sepLen) * lastIndex + valueLen; + var result = changetype(__alloc(estLen << 1, idof())); // retains + var offset = 0; + var value: T; + for (let i = 0; i < lastIndex; ++i) { + value = load(dataStart + (i << alignof())); + // @ts-ignore: type offset += itoa_stream(changetype(result), offset, value); - let out = result; - if (estLen > offset) { - out = result.substring(0, offset); - freeUnsafeString(result); - } - return out; - } else if (isFloat()) { - if (!lastIndex) return changetype(dtoa(LOAD(buffer, 0))); - - const valueLen = MAX_DOUBLE_LENGTH; - let estLen = (valueLen + sepLen) * lastIndex + valueLen; - let result = allocateUnsafeString(estLen); - let offset = 0; - for (let i = 0; i < lastIndex; ++i) { - value = LOAD(buffer, i); - offset += dtoa_stream(changetype(result), offset, value); - if (hasSeparator) { - copyUnsafeString(result, offset, separator, 0, sepLen); - offset += sepLen; - } + if (sepLen) { + memory.copy( + changetype(result) + (offset << 1), + changetype(separator), + sepLen << 1 + ); + offset += sepLen; } - value = LOAD(buffer, lastIndex); - offset += dtoa_stream(changetype(result), offset, value); - let out = result; - if (estLen > offset) { - out = result.substring(0, offset); - freeUnsafeString(result); + } + value = load(dataStart + (lastIndex << alignof())); + // @ts-ignore: type + offset += itoa_stream(changetype(result), offset, value); + if (estLen > offset) return result.substring(0, offset); + return result; + } + + private join_flt(separator: string = ","): string { + var lastIndex = this.length_ - 1; + if (lastIndex < 0) return ""; + var dataStart = this.dataStart; + if (!lastIndex) { + return changetype(dtoa( + // @ts-ignore: type + load(dataStart)) + ); // retains + } + + const valueLen = MAX_DOUBLE_LENGTH; + var sepLen = separator.length; + var estLen = (valueLen + sepLen) * lastIndex + valueLen; + var result = changetype(__alloc(estLen << 1, idof())); // retains + var offset = 0; + var value: T; + for (let i = 0; i < lastIndex; ++i) { + value = load(dataStart + (i << alignof())); + offset += dtoa_stream(changetype(result), offset, + // @ts-ignore: type + value + ); + if (sepLen) { + memory.copy( + changetype(result) + (offset << 1), + changetype(separator), + sepLen << 1 + ); + offset += sepLen; } - return out; - } else if (isString()) { - if (!lastIndex) return LOAD(buffer, 0); + } + value = load(dataStart + (lastIndex << alignof())); + offset += dtoa_stream(changetype(result), offset, + // @ts-ignore: type + value + ); + if (estLen > offset) return result.substring(0, offset); + return result; + } - let estLen = 0; - for (let i = 0, len = lastIndex + 1; i < len; ++i) { - estLen += LOAD(buffer, i).length; + private join_str(separator: string = ","): string { + var lastIndex = this.length_ - 1; + if (lastIndex < 0) return ""; + var dataStart = this.dataStart; + if (!lastIndex) return load(dataStart); + + var sepLen = separator.length; + var estLen = 0; + var value: string | null; + for (let i = 0, len = lastIndex + 1; i < len; ++i) { + value = load(dataStart + (i << alignof())); + if (value !== null) estLen += value.length; + } + var offset = 0; + var result = changetype(__alloc((estLen + sepLen * lastIndex) << 1, idof())); // retains + for (let i = 0; i < lastIndex; ++i) { + value = load(dataStart + (i << alignof())); + if (value !== null) { + let valueLen = changetype(value).length; + memory.copy( + changetype(result) + (offset << 1), + changetype(value), + valueLen << 1 + ); + offset += valueLen; } - let offset = 0; - let result = allocateUnsafeString(estLen + sepLen * lastIndex); - for (let i = 0; i < lastIndex; ++i) { - value = LOAD(buffer, i); - if (value) { - let valueLen = value.length; // tslint:disable-line:no-unsafe-any - copyUnsafeString(result, offset, value, 0, valueLen); // tslint:disable-line:no-unsafe-any - offset += valueLen; // tslint:disable-line:no-unsafe-any - } - if (hasSeparator) { - copyUnsafeString(result, offset, separator, 0, sepLen); - offset += sepLen; - } + if (sepLen) { + memory.copy( + changetype(result) + (offset << 1), + changetype(separator), + sepLen << 1 + ); + offset += sepLen; } - value = LOAD(buffer, lastIndex); + } + value = load(dataStart + (lastIndex << alignof())); + if (value !== null) { + memory.copy( + changetype(result) + (offset << 1), + changetype(value), + changetype(value).length << 1 + ); + } + return result; + } + + private join_arr(separator: string = ","): string { + var lastIndex = this.length_ - 1; + if (lastIndex < 0) return ""; + + var result = ""; + var sepLen = separator.length; + var base = this.dataStart; + var value: T; + if (!lastIndex) { + value = load(base); + // @ts-ignore: type + return value ? value.join(separator) : ""; + } + for (let i = 0; i < lastIndex; ++i) { + value = load(base + (i << alignof())); + // @ts-ignore: type + if (value) result += value.join(separator); + if (sepLen) result += separator; + } + value = load(base + (lastIndex << alignof())); + // @ts-ignore: type + if (value) result += value.join(separator); + return result; // registered by concatenation (FIXME: lots of garbage) + } + + private join_ref(separator: string = ","): string { + var lastIndex = this.length_ - 1; + if (lastIndex < 0) return ""; + var base = this.dataStart; + if (!lastIndex) return "[object Object]"; + + const valueLen = 15; // max possible length of element len("[object Object]") + var sepLen = separator.length; + var estLen = (valueLen + sepLen) * lastIndex + valueLen; + var result = changetype(__alloc(estLen << 1, idof())); + var offset = 0; + var value: T; + for (let i = 0; i < lastIndex; ++i) { + value = load(base + (i << alignof())); if (value) { - let valueLen = value.length; // tslint:disable-line:no-unsafe-any - copyUnsafeString(result, offset, value, 0, valueLen); // tslint:disable-line:no-unsafe-any - } - return result; - } else if (isArray()) { - if (!lastIndex) { - value = LOAD(buffer, 0); - return value ? value.join(separator) : ""; // tslint:disable-line:no-unsafe-any - } - for (let i = 0; i < lastIndex; ++i) { - value = LOAD(buffer, i); - if (value) result += value.join(separator); // tslint:disable-line:no-unsafe-any - if (hasSeparator) result += separator; - } - value = LOAD(buffer, lastIndex); - if (value) result += value.join(separator); // tslint:disable-line:no-unsafe-any - return result; - } else if (isReference()) { // References - if (!lastIndex) return "[object Object]"; - const valueLen = 15; // max possible length of element len("[object Object]") - let estLen = (valueLen + sepLen) * lastIndex + valueLen; - let result = allocateUnsafeString(estLen); - let offset = 0; - for (let i = 0; i < lastIndex; ++i) { - value = LOAD(buffer, i); - if (value) { - copyUnsafeString(result, offset, changetype("[object Object]"), 0, valueLen); - offset += valueLen; - } - if (hasSeparator) { - copyUnsafeString(result, offset, changetype(separator), 0, sepLen); - offset += sepLen; - } - } - if (LOAD(buffer, lastIndex)) { - copyUnsafeString(result, offset, changetype("[object Object]"), 0, valueLen); + memory.copy( + changetype(result) + (offset << 1), + changetype("[object Object]"), + valueLen << 1 + ); offset += valueLen; } - let out = result; - if (estLen > offset) { - out = result.substring(0, offset); - freeUnsafeString(result); + if (sepLen) { + memory.copy( + changetype(result) + (offset << 1), + changetype(separator), + sepLen << 1 + ); + offset += sepLen; } - return out; - } else { - assert(false); // Unsupported generic typename } + if (load(base + (lastIndex << alignof()))) { + memory.copy( + changetype(result) + (offset << 1), + changetype("[object Object]"), + valueLen << 1 + ); + offset += valueLen; + } + if (estLen > offset) return result.substring(0, offset); + return result; } - @inline toString(): string { return this.join(); } - private __gc(): void { - var buffer = this.buffer_; - __gc_mark(changetype(buffer)); // tslint:disable-line + // RT integration + + @unsafe private __visit_impl(cookie: u32): void { if (isManaged()) { - let offset: usize = 0; - let end = this.length_ << alignof(); - while (offset < end) { - __gc_mark(load(changetype(buffer) + offset, HEADER_SIZE)); // tslint:disable-line - offset += sizeof(); + let cur = this.dataStart; + let end = cur + (this.length_ << alignof()); + while (cur < end) { + let val = load(cur); + if (val) __visit(val, cookie); + cur += sizeof(); } } + // automatically visits ArrayBufferView (.data) next } } diff --git a/std/assembly/arraybuffer.ts b/std/assembly/arraybuffer.ts index 9014d73bd3..9725098a05 100644 --- a/std/assembly/arraybuffer.ts +++ b/std/assembly/arraybuffer.ts @@ -1,67 +1,76 @@ -import { - HEADER_SIZE, - MAX_BLENGTH, - allocateUnsafe -} from "./internal/arraybuffer"; +/// -import { - Uint8ClampedArray, - Uint8Array, - Int8Array, - Uint16Array, - Int16Array, - Uint32Array, - Int32Array, - Uint64Array, - Int64Array -} from "./typedarray"; +import { BLOCK, BLOCK_MAXSIZE, BLOCK_OVERHEAD } from "./rt/common"; +import { idof } from "./builtins"; +import { E_INVALIDLENGTH } from "./util/error"; -import { - DataView -} from "./dataview"; +export abstract class ArrayBufferView { -@sealed -export class ArrayBuffer { + @unsafe data: ArrayBuffer; + @unsafe dataStart: usize; + @unsafe dataLength: u32; - readonly byteLength: i32; // capped to [0, MAX_LENGTH] + protected constructor(length: i32, alignLog2: i32) { + if (length > BLOCK_MAXSIZE >>> alignLog2) throw new RangeError(E_INVALIDLENGTH); + var buffer = __alloc(length = length << alignLog2, idof()); + this.data = changetype(buffer); // retains + this.dataStart = buffer; + this.dataLength = length; + } + + get byteOffset(): i32 { + return (this.dataStart - changetype(this.data)); + } + + get byteLength(): i32 { + return this.dataLength; + } - @inline static isView(value: T): bool { - if (value === null) return false; - if (value instanceof Uint8ClampedArray) return true; - if (value instanceof Uint8Array) return true; - if (value instanceof Int8Array) return true; - if (value instanceof Uint16Array) return true; - if (value instanceof Int16Array) return true; - if (value instanceof Uint32Array) return true; - if (value instanceof Int32Array) return true; - if (value instanceof Uint64Array) return true; - if (value instanceof Int64Array) return true; - if (value instanceof DataView) return true; + get length(): i32 { + ERROR("missing implementation: subclasses must implement ArrayBufferView#length"); + return unreachable(); + } +} + +@sealed export class ArrayBuffer { + + static isView(value: T): bool { + if (value) { + if (value instanceof Int8Array) return true; + if (value instanceof Uint8Array) return true; + if (value instanceof Uint8ClampedArray) return true; + if (value instanceof Int16Array) return true; + if (value instanceof Uint16Array) return true; + if (value instanceof Int32Array) return true; + if (value instanceof Uint32Array) return true; + if (value instanceof Int64Array) return true; + if (value instanceof Uint64Array) return true; + if (value instanceof Float32Array) return true; + if (value instanceof Float64Array) return true; + if (value instanceof DataView) return true; + } return false; } - // @unsafe - @inline get data(): usize { return changetype(this) + HEADER_SIZE; } + constructor(length: i32) { + if (length > BLOCK_MAXSIZE) throw new RangeError(E_INVALIDLENGTH); + var buffer = __alloc(length, idof()); + memory.fill(buffer, 0, length); + return changetype(buffer); // retains + } - constructor(length: i32, unsafe: bool = false) { - if (length > MAX_BLENGTH) throw new RangeError("Invalid array buffer length"); - var buffer = allocateUnsafe(length); - if (!unsafe) memory.fill(changetype(buffer) + HEADER_SIZE, 0, length); - return buffer; + get byteLength(): i32 { + return changetype(changetype(this) - BLOCK_OVERHEAD).rtSize; } - slice(begin: i32 = 0, end: i32 = MAX_BLENGTH): ArrayBuffer { - var len = this.byteLength; - begin = begin < 0 ? max(len + begin, 0) : min(begin, len); - end = end < 0 ? max(len + end, 0) : min(end, len); - len = max(end - begin, 0); - var buffer = allocateUnsafe(len); - memory.copy( - changetype(buffer) + HEADER_SIZE, - changetype(this) + HEADER_SIZE + begin, - len - ); - return buffer; + slice(begin: i32 = 0, end: i32 = BLOCK_MAXSIZE): ArrayBuffer { + var length = this.byteLength; + begin = begin < 0 ? max(length + begin, 0) : min(begin, length); + end = end < 0 ? max(length + end , 0) : min(end , length); + var outSize = max(end - begin, 0); + var out = __alloc(outSize, idof()); + memory.copy(out, changetype(this) + begin, outSize); + return changetype(out); // retains } toString(): string { diff --git a/std/assembly/builtins.ts b/std/assembly/builtins.ts index 65d13dea8a..8cc2878233 100644 --- a/std/assembly/builtins.ts +++ b/std/assembly/builtins.ts @@ -1,501 +1,1734 @@ -/* tslint:disable */ - -@builtin @inline export const NaN: f64 = 0 / 0; -@builtin @inline export const Infinity: f64 = 1 / 0; - -@builtin export declare function isInteger(value?: T): bool; -@builtin export declare function isFloat(value?: T): bool; -@builtin export declare function isSigned(value?: T): bool; -@builtin export declare function isReference(value?: T): bool; -@builtin export declare function isString(value?: T): bool; -@builtin export declare function isArray(value?: T): bool; -@builtin export declare function isArrayLike(value?: T): bool; -@builtin export declare function isFunction(value?: T): bool; -@builtin export declare function isNullable(value?: T): bool; -@builtin export declare function isDefined(expression: void): bool; -@builtin export declare function isConstant(expression: void): bool; -@builtin export declare function isManaged(value?: T): bool; -@inline export function isNaN(value: T): bool { return value != value; } -@inline export function isFinite(value: T): bool { return value - value == 0; } - -@builtin export declare function clz(value: T): T; -@builtin export declare function ctz(value: T): T; -@builtin export declare function popcnt(value: T): T; -@builtin export declare function rotl(value: T, shift: T): T; -@builtin export declare function rotr(value: T, shift: T): T; -@builtin export declare function abs(value: T): T; -@builtin export declare function max(left: T, right: T): T; -@builtin export declare function min(left: T, right: T): T; -@builtin export declare function ceil(value: T): T; -@builtin export declare function floor(value: T): T; -@builtin export declare function copysign(left: T, right: T): T; -@builtin export declare function nearest(value: T): T; -@builtin export declare function reinterpret(value: void): T; -@builtin export declare function sqrt(value: T): T; -@builtin export declare function trunc(value: T): T; -@builtin export declare function load(offset: usize, immOffset?: usize, immAlign?: usize): T; -@builtin export declare function store(offset: usize, value: void, immOffset?: usize, immAlign?: usize): void; -@builtin export declare function sizeof(): usize; // | u32 / u64 -@builtin export declare function alignof(): usize; // | u32 / u64 -@builtin export declare function offsetof(fieldName?: string): usize; // | u32 / u64 -@builtin export declare function select(ifTrue: T, ifFalse: T, condition: bool): T; -@builtin export declare function unreachable(): void; -@builtin export declare function changetype(value: void): T; -@builtin export declare function assert(isTrueish: T, message?: string): T; -@builtin export declare function unchecked(expr: T): T; -@builtin export declare function call_indirect(target: void, ...args: void[]): T; -@builtin export declare function instantiate(...args: void[]): T; +// @ts-ignore: decorator +@builtin @inline +export const NaN: f64 = 0 / 0; + +// @ts-ignore: decorator +@builtin @inline +export const Infinity: f64 = 1 / 0; + +// @ts-ignore: decorator +@builtin +export declare function isInteger(value?: T): bool; + +// @ts-ignore: decorator +@builtin +export declare function isFloat(value?: T): bool; + +// @ts-ignore: decorator +@builtin +export declare function isBoolean(value?: T): bool; + +// @ts-ignore: decorator +@builtin +export declare function isSigned(value?: T): bool; + +// @ts-ignore: decorator +@builtin +export declare function isReference(value?: T): bool; + +// @ts-ignore: decorator +@builtin +export declare function isString(value?: T): bool; + +// @ts-ignore: decorator +@builtin +export declare function isArray(value?: T): bool; + +// @ts-ignore: decorator +@builtin +export declare function isArrayLike(value?: T): bool; + +// @ts-ignore: decorator +@builtin +export declare function isFunction(value?: T): bool; + +// @ts-ignore: decorator +@builtin +export declare function isNullable(value?: T): bool; + +// @ts-ignore: decorator +@builtin +export declare function isDefined(expression: void): bool; + +// @ts-ignore: decorator +@builtin +export declare function isConstant(expression: void): bool; + +// @ts-ignore: decorator +@builtin +export declare function isManaged(value?: T): bool; + +export function isNaN(value: T): bool { + if (!isFloat()) { + if (!isInteger()) ERROR("numeric type expected"); + } + return value != value; +} + +export function isFinite(value: T): bool { + if (!isFloat()) { + if (!isInteger()) ERROR("numeric type expected"); + } + return value - value == 0; +} + +// @ts-ignore: decorator +@builtin +export declare function clz(value: T): T; + +// @ts-ignore: decorator +@builtin +export declare function ctz(value: T): T; + +// @ts-ignore: decorator +@builtin +export declare function popcnt(value: T): T; + +// @ts-ignore: decorator +@builtin +export declare function rotl(value: T, shift: T): T; + +// @ts-ignore: decorator +@builtin +export declare function rotr(value: T, shift: T): T; + +// @ts-ignore: decorator +@builtin +export declare function abs(value: T): T; + +// @ts-ignore: decorator +@builtin +export declare function max(left: T, right: T): T; + +// @ts-ignore: decorator +@builtin +export declare function min(left: T, right: T): T; + +// @ts-ignore: decorator +@builtin +export declare function ceil(value: T): T; + +// @ts-ignore: decorator +@builtin +export declare function floor(value: T): T; + +// @ts-ignore: decorator +@builtin +export declare function copysign(left: T, right: T): T; + +// @ts-ignore: decorator +@builtin +export declare function nearest(value: T): T; + +// @ts-ignore: decorator +@builtin +export declare function reinterpret(value: number): T; + +// @ts-ignore: decorator +@builtin +export declare function sqrt(value: T): T; + +// @ts-ignore: decorator +@builtin +export declare function trunc(value: T): T; + +// @ts-ignore: decorator +@builtin +export declare function load(offset: usize, immOffset?: usize, immAlign?: usize): T; + +// @ts-ignore: decorator +@builtin +export declare function store(offset: usize, value: void, immOffset?: usize, immAlign?: usize): void; + +// @ts-ignore: decorator +@builtin +export declare function sizeof(): usize; // | u32 / u64 + +// @ts-ignore: decorator +@builtin +export declare function alignof(): usize; // | u32 / u64 + +// @ts-ignore: decorator +@builtin +export declare function offsetof(fieldName?: string): usize; // | u32 / u64 + +// @ts-ignore: decorator +@builtin +export declare function idof(): u32; + +// @ts-ignore: decorator +@builtin +export declare function select(ifTrue: T, ifFalse: T, condition: bool): T; + +// @ts-ignore: decorator +@unsafe @builtin +export declare function unreachable(): void; + +// @ts-ignore: decorator +@builtin +export declare function changetype(value: void): T; + +// @ts-ignore: decorator +@builtin +export declare function assert(isTrueish: T, message?: string): T; + +// @ts-ignore: decorator +@builtin +export declare function unchecked(expr: T): T; + +// @ts-ignore: decorator +@builtin +export declare function call_indirect(target: void, ...args: void[]): T; + +// @ts-ignore: decorator +@builtin +export declare function call_direct(target: void, ...args: void[]): T; + +// @ts-ignore: decorator +@builtin +export declare function instantiate(...args: void[]): T; export namespace atomic { - @builtin export declare function load(offset: usize, immOffset?: usize): T; - @builtin export declare function store(offset: usize, value: T, immOffset?: usize): void; - @builtin export declare function add(ptr: usize, value: T, immOffset?: usize): T; - @builtin export declare function sub(ptr: usize, value: T, immOffset?: usize): T; - @builtin export declare function and(ptr: usize, value: T, immOffset?: usize): T; - @builtin export declare function or(ptr: usize, value: T, immOffset?: usize): T; - @builtin export declare function xor(ptr: usize, value: T, immOffset?: usize): T; - @builtin export declare function xchg(ptr: usize, value: T, immOffset?: usize): T; - @builtin export declare function cmpxchg(ptr: usize, expected: T, replacement: T, immOffset?: usize): T; - @builtin export declare function wait(ptr: usize, expected: T, timeout: i64): AtomicWaitResult; - @builtin export declare function notify(ptr: usize, count: i32): i32; + // @ts-ignore: decorator + @builtin + export declare function load(offset: usize, immOffset?: usize): T; + + // @ts-ignore: decorator + @builtin + export declare function store(offset: usize, value: T, immOffset?: usize): void; + + // @ts-ignore: decorator + @builtin + export declare function add(ptr: usize, value: T, immOffset?: usize): T; + + // @ts-ignore: decorator + @builtin + export declare function sub(ptr: usize, value: T, immOffset?: usize): T; + + // @ts-ignore: decorator + @builtin + export declare function and(ptr: usize, value: T, immOffset?: usize): T; + + // @ts-ignore: decorator + @builtin + export declare function or(ptr: usize, value: T, immOffset?: usize): T; + + // @ts-ignore: decorator + @builtin + export declare function xor(ptr: usize, value: T, immOffset?: usize): T; + + // @ts-ignore: decorator + @builtin + export declare function xchg(ptr: usize, value: T, immOffset?: usize): T; + + // @ts-ignore: decorator + @builtin + export declare function cmpxchg(ptr: usize, expected: T, replacement: T, immOffset?: usize): T; + + // @ts-ignore: decorator + @builtin + export declare function wait(ptr: usize, expected: T, timeout: i64): AtomicWaitResult; + + // @ts-ignore: decorator + @builtin + export declare function notify(ptr: usize, count: i32): i32; } -@lazy export const enum AtomicWaitResult { +// @ts-ignore: decorator +@lazy +export const enum AtomicWaitResult { OK = 0, NOT_EQUAL = 1, TIMED_OUT = 2 } -@builtin export declare function i8(value: void): i8; +// @ts-ignore: decorator +@builtin +export declare function i8(value: void): i8; + export namespace i8 { - @lazy export const MIN_VALUE: i8 = -128; - @lazy export const MAX_VALUE: i8 = 127; + + // @ts-ignore: decorator + @lazy + export const MIN_VALUE: i8 = -128; + + // @ts-ignore: decorator + @lazy + export const MAX_VALUE: i8 = 127; } -@builtin export declare function i16(value: void): i16; +// @ts-ignore: decorator +@builtin +export declare function i16(value: void): i16; + export namespace i16 { - @lazy export const MIN_VALUE: i16 = -32768; - @lazy export const MAX_VALUE: i16 = 32767; + + // @ts-ignore: decorator + @lazy + export const MIN_VALUE: i16 = -32768; + + // @ts-ignore: decorator + @lazy + export const MAX_VALUE: i16 = 32767; } -@builtin export declare function i32(value: void): i32; +// @ts-ignore: decorator +@builtin +export declare function i32(value: void): i32; + export namespace i32 { - @lazy export const MIN_VALUE: i32 = -2147483648; - @lazy export const MAX_VALUE: i32 = 2147483647; - @builtin export declare function clz(value: i32): i32; - @builtin export declare function ctz(value: i32): i32; - @builtin export declare function popcnt(value: i32): i32; - @builtin export declare function rotl(value: i32, shift: i32): i32; - @builtin export declare function rotr(value: i32, shift: i32): i32; - @builtin export declare function reinterpret_f32(value: f32): i32; - @builtin export declare function load8_s(offset: usize, immOffset?: usize, immAlign?: usize): i32; - @builtin export declare function load8_u(offset: usize, immOffset?: usize, immAlign?: usize): i32; - @builtin export declare function load16_s(offset: usize, immOffset?: usize, immAlign?: usize): i32; - @builtin export declare function load16_u(offset: usize, immOffset?: usize, immAlign?: usize): i32; - @builtin export declare function load(offset: usize, immOffset?: usize, immAlign?: usize): i32; - @builtin export declare function store8(offset: usize, value: i32, immOffset?: usize, immAlign?: usize): void; - @builtin export declare function store16(offset: usize, value: i32, immOffset?: usize, immAlign?: usize): void; - @builtin export declare function store(offset: usize, value: i32, immOffset?: usize, immAlign?: usize): void; - + + // @ts-ignore: decorator + @lazy + export const MIN_VALUE: i32 = -2147483648; + + // @ts-ignore: decorator + @lazy + export const MAX_VALUE: i32 = 2147483647; + + // @ts-ignore: decorator + @builtin + export declare function clz(value: i32): i32; + + // @ts-ignore: decorator + @builtin + export declare function ctz(value: i32): i32; + + // @ts-ignore: decorator + @builtin + export declare function popcnt(value: i32): i32; + + // @ts-ignore: decorator + @builtin + export declare function rotl(value: i32, shift: i32): i32; + + // @ts-ignore: decorator + @builtin + export declare function rotr(value: i32, shift: i32): i32; + + // @ts-ignore: decorator + @builtin + export declare function reinterpret_f32(value: f32): i32; + + // @ts-ignore: decorator + @builtin + export declare function load8_s(offset: usize, immOffset?: usize, immAlign?: usize): i32; + + // @ts-ignore: decorator + @builtin + export declare function load8_u(offset: usize, immOffset?: usize, immAlign?: usize): i32; + + // @ts-ignore: decorator + @builtin + export declare function load16_s(offset: usize, immOffset?: usize, immAlign?: usize): i32; + + // @ts-ignore: decorator + @builtin + export declare function load16_u(offset: usize, immOffset?: usize, immAlign?: usize): i32; + + // @ts-ignore: decorator + @builtin + export declare function load(offset: usize, immOffset?: usize, immAlign?: usize): i32; + + // @ts-ignore: decorator + @builtin + export declare function store8(offset: usize, value: i32, immOffset?: usize, immAlign?: usize): void; + + // @ts-ignore: decorator + @builtin + export declare function store16(offset: usize, value: i32, immOffset?: usize, immAlign?: usize): void; + + // @ts-ignore: decorator + @builtin + export declare function store(offset: usize, value: i32, immOffset?: usize, immAlign?: usize): void; + export namespace atomic { - @builtin export declare function load8_u(offset: usize, immOffset?: usize): i32; - @builtin export declare function load16_u(offset: usize, immOffset?: usize): i32; - @builtin export declare function load(offset: usize, immOffset?: usize): i32; - @builtin export declare function store8(offset: usize, value: i32, immOffset?: usize): void; - @builtin export declare function store16(offset: usize, value: i32, immOffset?: usize): void; - @builtin export declare function store(offset: usize, value: i32, immOffset?: usize): void; - @builtin export declare function wait(ptr: usize, expected: i32, timeout: i64): AtomicWaitResult; + + // @ts-ignore: decorator + @builtin + export declare function load8_u(offset: usize, immOffset?: usize): i32; + + // @ts-ignore: decorator + @builtin + export declare function load16_u(offset: usize, immOffset?: usize): i32; + + // @ts-ignore: decorator + @builtin + export declare function load(offset: usize, immOffset?: usize): i32; + + // @ts-ignore: decorator + @builtin + export declare function store8(offset: usize, value: i32, immOffset?: usize): void; + + // @ts-ignore: decorator + @builtin + export declare function store16(offset: usize, value: i32, immOffset?: usize): void; + + // @ts-ignore: decorator + @builtin + export declare function store(offset: usize, value: i32, immOffset?: usize): void; + + // @ts-ignore: decorator + @builtin + export declare function wait(ptr: usize, expected: i32, timeout: i64): AtomicWaitResult; export namespace rmw8 { - @builtin export declare function add_u(offset: usize, value: i32, immOffset?: usize): i32; - @builtin export declare function sub_u(offset: usize, value: i32, immOffset?: usize): i32; - @builtin export declare function and_u(offset: usize, value: i32, immOffset?: usize): i32; - @builtin export declare function or_u(offset: usize, value: i32, immOffset?: usize): i32; - @builtin export declare function xor_u(offset: usize, value: i32, immOffset?: usize): i32; - @builtin export declare function xchg_u(offset: usize, value: i32, immOffset?: usize): i32; - @builtin export declare function cmpxchg_u(offset: usize, expected: i32, replacement: i32, immOffset?: usize): i32; + + // @ts-ignore: decorator + @builtin + export declare function add_u(offset: usize, value: i32, immOffset?: usize): i32; + + // @ts-ignore: decorator + @builtin + export declare function sub_u(offset: usize, value: i32, immOffset?: usize): i32; + + // @ts-ignore: decorator + @builtin + export declare function and_u(offset: usize, value: i32, immOffset?: usize): i32; + + // @ts-ignore: decorator + @builtin + export declare function or_u(offset: usize, value: i32, immOffset?: usize): i32; + + // @ts-ignore: decorator + @builtin + export declare function xor_u(offset: usize, value: i32, immOffset?: usize): i32; + + // @ts-ignore: decorator + @builtin + export declare function xchg_u(offset: usize, value: i32, immOffset?: usize): i32; + + // @ts-ignore: decorator + @builtin + export declare function cmpxchg_u(offset: usize, expected: i32, replacement: i32, immOffset?: usize): i32; } + export namespace rmw16 { - @builtin export declare function add_u(offset: usize, value: i32, immOffset?: usize): i32; - @builtin export declare function sub_u(offset: usize, value: i32, immOffset?: usize): i32; - @builtin export declare function and_u(offset: usize, value: i32, immOffset?: usize): i32; - @builtin export declare function or_u(offset: usize, value: i32, immOffset?: usize): i32; - @builtin export declare function xor_u(offset: usize, value: i32, immOffset?: usize): i32; - @builtin export declare function xchg_u(offset: usize, value: i32, immOffset?: usize): i32; - @builtin export declare function cmpxchg_u(offset: usize, expected: i32, replacement: i32, immOffset?: usize): i32; + + // @ts-ignore: decorator + @builtin + export declare function add_u(offset: usize, value: i32, immOffset?: usize): i32; + + // @ts-ignore: decorator + @builtin + export declare function sub_u(offset: usize, value: i32, immOffset?: usize): i32; + + // @ts-ignore: decorator + @builtin + export declare function and_u(offset: usize, value: i32, immOffset?: usize): i32; + + // @ts-ignore: decorator + @builtin + export declare function or_u(offset: usize, value: i32, immOffset?: usize): i32; + + // @ts-ignore: decorator + @builtin + export declare function xor_u(offset: usize, value: i32, immOffset?: usize): i32; + + // @ts-ignore: decorator + @builtin + export declare function xchg_u(offset: usize, value: i32, immOffset?: usize): i32; + + // @ts-ignore: decorator + @builtin + export declare function cmpxchg_u(offset: usize, expected: i32, replacement: i32, immOffset?: usize): i32; } + export namespace rmw { - @builtin export declare function add(offset: usize, value: i32, immOffset?: usize): i32; - @builtin export declare function sub(offset: usize, value: i32, immOffset?: usize): i32; - @builtin export declare function and(offset: usize, value: i32, immOffset?: usize): i32; - @builtin export declare function or(offset: usize, value: i32, immOffset?: usize): i32; - @builtin export declare function xor(offset: usize, value: i32, immOffset?: usize): i32; - @builtin export declare function xchg(offset: usize, value: i32, immOffset?: usize): i32; - @builtin export declare function cmpxchg(offset: usize, expected: i32, replacement: i32, immOffset?: usize): i32; + + // @ts-ignore: decorator + @builtin + export declare function add(offset: usize, value: i32, immOffset?: usize): i32; + + // @ts-ignore: decorator + @builtin + export declare function sub(offset: usize, value: i32, immOffset?: usize): i32; + + // @ts-ignore: decorator + @builtin + export declare function and(offset: usize, value: i32, immOffset?: usize): i32; + + // @ts-ignore: decorator + @builtin + export declare function or(offset: usize, value: i32, immOffset?: usize): i32; + + // @ts-ignore: decorator + @builtin + export declare function xor(offset: usize, value: i32, immOffset?: usize): i32; + + // @ts-ignore: decorator + @builtin + export declare function xchg(offset: usize, value: i32, immOffset?: usize): i32; + + // @ts-ignore: decorator + @builtin + export declare function cmpxchg(offset: usize, expected: i32, replacement: i32, immOffset?: usize): i32; } } } -@builtin export declare function i64(value: void): i64; +// @ts-ignore: decorator +@builtin +export declare function i64(value: void): i64; + export namespace i64 { - @lazy export const MIN_VALUE: i64 = -9223372036854775808; - @lazy export const MAX_VALUE: i64 = 9223372036854775807; - @builtin export declare function clz(value: i64): i64; - @builtin export declare function ctz(value: i64): i64; - @builtin export declare function load8_s(offset: usize, immOffset?: usize, immAlign?: usize): i64; - @builtin export declare function load8_u(offset: usize, immOffset?: usize, immAlign?: usize): i64; - @builtin export declare function load16_s(offset: usize, immOffset?: usize, immAlign?: usize): i64; - @builtin export declare function load16_u(offset: usize, immOffset?: usize, immAlign?: usize): i64; - @builtin export declare function load32_s(offset: usize, immOffset?: usize, immAlign?: usize): i64; - @builtin export declare function load32_u(offset: usize, immOffset?: usize, immAlign?: usize): i64; - @builtin export declare function load(offset: usize, immOffset?: usize): i64; - @builtin export declare function popcnt(value: i64): i64; - @builtin export declare function rotl(value: i64, shift: i64): i64; - @builtin export declare function rotr(value: i64, shift: i64): i64; - @builtin export declare function reinterpret_f64(value: f64): i64; - @builtin export declare function store8(offset: usize, value: i64, immOffset?: usize, immAlign?: usize): void; - @builtin export declare function store16(offset: usize, value: i64, immOffset?: usize, immAlign?: usize): void; - @builtin export declare function store32(offset: usize, value: i64, immOffset?: usize, immAlign?: usize): void; - @builtin export declare function store(offset: usize, value: i64, immOffset?: usize, immAlign?: usize): void; + + // @ts-ignore: decorator + @lazy + export const MIN_VALUE: i64 = -9223372036854775808; + + // @ts-ignore: decorator + @lazy + export const MAX_VALUE: i64 = 9223372036854775807; + + // @ts-ignore: decorator + @builtin + export declare function clz(value: i64): i64; + + // @ts-ignore: decorator + @builtin + export declare function ctz(value: i64): i64; + + // @ts-ignore: decorator + @builtin + export declare function load8_s(offset: usize, immOffset?: usize, immAlign?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function load8_u(offset: usize, immOffset?: usize, immAlign?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function load16_s(offset: usize, immOffset?: usize, immAlign?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function load16_u(offset: usize, immOffset?: usize, immAlign?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function load32_s(offset: usize, immOffset?: usize, immAlign?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function load32_u(offset: usize, immOffset?: usize, immAlign?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function load(offset: usize, immOffset?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function popcnt(value: i64): i64; + + // @ts-ignore: decorator + @builtin + export declare function rotl(value: i64, shift: i64): i64; + + // @ts-ignore: decorator + @builtin + export declare function rotr(value: i64, shift: i64): i64; + + // @ts-ignore: decorator + @builtin + export declare function reinterpret_f64(value: f64): i64; + + // @ts-ignore: decorator + @builtin + export declare function store8(offset: usize, value: i64, immOffset?: usize, immAlign?: usize): void; + + // @ts-ignore: decorator + @builtin + export declare function store16(offset: usize, value: i64, immOffset?: usize, immAlign?: usize): void; + + // @ts-ignore: decorator + @builtin + export declare function store32(offset: usize, value: i64, immOffset?: usize, immAlign?: usize): void; + + // @ts-ignore: decorator + @builtin + export declare function store(offset: usize, value: i64, immOffset?: usize, immAlign?: usize): void; export namespace atomic { - @builtin export declare function load8_u(offset: usize, immOffset?: usize): i64; - @builtin export declare function load16_u(offset: usize, immOffset?: usize): i64; - @builtin export declare function load32_u(offset: usize, immOffset?: usize): i64; - @builtin export declare function load(offset: usize, immOffset?: usize): i64; - @builtin export declare function store8(offset: usize, value: i64, immOffset?: usize): void; - @builtin export declare function store16(offset: usize, value: i64, immOffset?: usize): void; - @builtin export declare function store32(offset: usize, value: i64, immOffset?: usize): void; - @builtin export declare function store(offset: usize, value: i64, immOffset?: usize): void; - @builtin export declare function wait(ptr: usize, expected: i64, timeout: i64): AtomicWaitResult; + + // @ts-ignore: decorator + @builtin + export declare function load8_u(offset: usize, immOffset?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function load16_u(offset: usize, immOffset?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function load32_u(offset: usize, immOffset?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function load(offset: usize, immOffset?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function store8(offset: usize, value: i64, immOffset?: usize): void; + + // @ts-ignore: decorator + @builtin + export declare function store16(offset: usize, value: i64, immOffset?: usize): void; + + // @ts-ignore: decorator + @builtin + export declare function store32(offset: usize, value: i64, immOffset?: usize): void; + + // @ts-ignore: decorator + @builtin + export declare function store(offset: usize, value: i64, immOffset?: usize): void; + + // @ts-ignore: decorator + @builtin + export declare function wait(ptr: usize, expected: i64, timeout: i64): AtomicWaitResult; export namespace rmw8 { - @builtin export declare function add_u(offset: usize, value: i64, immOffset?: usize): i64; - @builtin export declare function sub_u(offset: usize, value: i64, immOffset?: usize): i64; - @builtin export declare function and_u(offset: usize, value: i64, immOffset?: usize): i64; - @builtin export declare function or_u(offset: usize, value: i64, immOffset?: usize): i64; - @builtin export declare function xor_u(offset: usize, value: i64, immOffset?: usize): i64; - @builtin export declare function xchg_u(offset: usize, value: i64, immOffset?: usize): i64; - @builtin export declare function cmpxchg_u(offset: usize, expected: i64, replacement: i64, immOffset?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function add_u(offset: usize, value: i64, immOffset?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function sub_u(offset: usize, value: i64, immOffset?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function and_u(offset: usize, value: i64, immOffset?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function or_u(offset: usize, value: i64, immOffset?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function xor_u(offset: usize, value: i64, immOffset?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function xchg_u(offset: usize, value: i64, immOffset?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function cmpxchg_u(offset: usize, expected: i64, replacement: i64, immOffset?: usize): i64; } + export namespace rmw16 { - @builtin export declare function add_u(offset: usize, value: i64, immOffset?: usize): i64; - @builtin export declare function sub_u(offset: usize, value: i64, immOffset?: usize): i64; - @builtin export declare function and_u(offset: usize, value: i64, immOffset?: usize): i64; - @builtin export declare function or_u(offset: usize, value: i64, immOffset?: usize): i64; - @builtin export declare function xor_u(offset: usize, value: i64, immOffset?: usize): i64; - @builtin export declare function xchg_u(offset: usize, value: i64, immOffset?: usize): i64; - @builtin export declare function cmpxchg_u(offset: usize, expected: i64, replacement: i64, immOffset?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function add_u(offset: usize, value: i64, immOffset?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function sub_u(offset: usize, value: i64, immOffset?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function and_u(offset: usize, value: i64, immOffset?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function or_u(offset: usize, value: i64, immOffset?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function xor_u(offset: usize, value: i64, immOffset?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function xchg_u(offset: usize, value: i64, immOffset?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function cmpxchg_u(offset: usize, expected: i64, replacement: i64, immOffset?: usize): i64; } + export namespace rmw32 { - @builtin export declare function add_u(offset: usize, value: i64, immOffset?: usize): i64; - @builtin export declare function sub_u(offset: usize, value: i64, immOffset?: usize): i64; - @builtin export declare function and_u(offset: usize, value: i64, immOffset?: usize): i64; - @builtin export declare function or_u(offset: usize, value: i64, immOffset?: usize): i64; - @builtin export declare function xor_u(offset: usize, value: i64, immOffset?: usize): i64; - @builtin export declare function xchg_u(offset: usize, value: i64, immOffset?: usize): i64; - @builtin export declare function cmpxchg_u(offset: usize, expected: i64, replacement: i64, immOffset?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function add_u(offset: usize, value: i64, immOffset?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function sub_u(offset: usize, value: i64, immOffset?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function and_u(offset: usize, value: i64, immOffset?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function or_u(offset: usize, value: i64, immOffset?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function xor_u(offset: usize, value: i64, immOffset?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function xchg_u(offset: usize, value: i64, immOffset?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function cmpxchg_u(offset: usize, expected: i64, replacement: i64, immOffset?: usize): i64; } + export namespace rmw { - @builtin export declare function add(offset: usize, value: i64, immOffset?: usize): i64; - @builtin export declare function sub(offset: usize, value: i64, immOffset?: usize): i64; - @builtin export declare function and(offset: usize, value: i64, immOffset?: usize): i64; - @builtin export declare function or(offset: usize, value: i64, immOffset?: usize): i64; - @builtin export declare function xor(offset: usize, value: i64, immOffset?: usize): i64; - @builtin export declare function xchg(offset: usize, value: i64, immOffset?: usize): i64; - @builtin export declare function cmpxchg(offset: usize, expected: i64, replacement: i64, immOffset?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function add(offset: usize, value: i64, immOffset?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function sub(offset: usize, value: i64, immOffset?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function and(offset: usize, value: i64, immOffset?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function or(offset: usize, value: i64, immOffset?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function xor(offset: usize, value: i64, immOffset?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function xchg(offset: usize, value: i64, immOffset?: usize): i64; + + // @ts-ignore: decorator + @builtin + export declare function cmpxchg(offset: usize, expected: i64, replacement: i64, immOffset?: usize): i64; } } } -@builtin export declare function isize(value: void): isize; +// @ts-ignore: decorator +@builtin +export declare function isize(value: void): isize; + export namespace isize { - @lazy export const MIN_VALUE: isize = sizeof() == sizeof() + + // @ts-ignore: decorator + @lazy + export const MIN_VALUE: isize = sizeof() == sizeof() ? -2147483648 : -9223372036854775808; - @lazy export const MAX_VALUE: isize = sizeof() == sizeof() + + // @ts-ignore: decorator + @lazy + export const MAX_VALUE: isize = sizeof() == sizeof() ? 2147483647 : 9223372036854775807; } -@builtin export declare function u8(value: void): u8; +// @ts-ignore: decorator +@builtin +export declare function u8(value: void): u8; + export namespace u8 { - @lazy export const MIN_VALUE: u8 = 0; - @lazy export const MAX_VALUE: u8 = 255; + + // @ts-ignore: decorator + @lazy + export const MIN_VALUE: u8 = 0; + + // @ts-ignore: decorator + @lazy + export const MAX_VALUE: u8 = 255; } -@builtin export declare function u16(value: void): u16; +// @ts-ignore: decorator +@builtin +export declare function u16(value: void): u16; + export namespace u16 { - @lazy export const MIN_VALUE: u16 = 0; - @lazy export const MAX_VALUE: u16 = 65535; + + // @ts-ignore: decorator + @lazy + export const MIN_VALUE: u16 = 0; + + // @ts-ignore: decorator + @lazy + export const MAX_VALUE: u16 = 65535; } -@builtin export declare function u32(value: void): u32; +// @ts-ignore: decorator +@builtin +export declare function u32(value: void): u32; + export namespace u32 { - @lazy export const MIN_VALUE: u32 = 0; - @lazy export const MAX_VALUE: u32 = 4294967295; + + // @ts-ignore: decorator + @lazy + export const MIN_VALUE: u32 = 0; + + // @ts-ignore: decorator + @lazy + export const MAX_VALUE: u32 = 4294967295; } -@builtin export declare function u64(value: void): u64; +// @ts-ignore: decorator +@builtin +export declare function u64(value: void): u64; + export namespace u64 { - @lazy export const MIN_VALUE: u64 = 0; - @lazy export const MAX_VALUE: u64 = 18446744073709551615; + + // @ts-ignore: decorator + @lazy + export const MIN_VALUE: u64 = 0; + + // @ts-ignore: decorator + @lazy + export const MAX_VALUE: u64 = 18446744073709551615; } -@builtin export declare function usize(value: void): usize; +// @ts-ignore: decorator +@builtin +export declare function usize(value: void): usize; + export namespace usize { - @lazy export const MIN_VALUE: usize = 0; - @lazy export const MAX_VALUE: usize = sizeof() == sizeof() + + // @ts-ignore: decorator + @lazy + export const MIN_VALUE: usize = 0; + + // @ts-ignore: decorator + @lazy + export const MAX_VALUE: usize = sizeof() == sizeof() ? 4294967295 : 18446744073709551615; } -@builtin export declare function bool(value: void): bool; +// @ts-ignore: decorator +@builtin +export declare function bool(value: void): bool; + export namespace bool { - @lazy export const MIN_VALUE: bool = false; - @lazy export const MAX_VALUE: bool = true; + + // @ts-ignore: decorator + @lazy + export const MIN_VALUE: bool = false; + + // @ts-ignore: decorator + @lazy + export const MAX_VALUE: bool = true; } -@builtin export declare function f32(value: void): f32; +// @ts-ignore: decorator +@builtin +export declare function f32(value: void): f32; + export namespace f32 { - @lazy export const EPSILON = reinterpret(0x34000000); // 0x1p-23f - @lazy export const MIN_VALUE = reinterpret(0x00000001); // 0x0.000001p+0f - @lazy export const MAX_VALUE = reinterpret(0x7F7FFFFF); // 0x1.fffffep+127f - @lazy export const MIN_NORMAL_VALUE = reinterpret(0x00800000); // 0x1p-126f - @lazy export const MIN_SAFE_INTEGER: f32 = -16777215; - @lazy export const MAX_SAFE_INTEGER: f32 = 16777215; - @builtin export declare function abs(value: f32): f32; - @builtin export declare function ceil(value: f32): f32; - @builtin export declare function copysign(x: f32, y: f32): f32; - @builtin export declare function floor(value: f32): f32; - @builtin export declare function load(offset: usize, immOffset?: usize, immAlign?: usize): f32; - @builtin export declare function max(left: f32, right: f32): f32; - @builtin export declare function min(left: f32, right: f32): f32; - @builtin export declare function nearest(value: f32): f32; - @builtin export declare function reinterpret_i32(value: i32): f32; - @builtin export declare function sqrt(value: f32): f32; - @builtin export declare function store(offset: usize, value: f32, immOffset?: usize, immAlign?: usize): void; - @builtin export declare function trunc(value: f32): f32; + + // @ts-ignore: decorator + @lazy + export const EPSILON = reinterpret(0x34000000); // 0x1p-23f + + // @ts-ignore: decorator + @lazy + export const MIN_VALUE = reinterpret(0x00000001); // 0x0.000001p+0f + + // @ts-ignore: decorator + @lazy + export const MAX_VALUE = reinterpret(0x7F7FFFFF); // 0x1.fffffep+127f + + // @ts-ignore: decorator + @lazy + export const MIN_NORMAL_VALUE = reinterpret(0x00800000); // 0x1p-126f + + // @ts-ignore: decorator + @lazy + export const MIN_SAFE_INTEGER: f32 = -16777215; + + // @ts-ignore: decorator + @lazy + export const MAX_SAFE_INTEGER: f32 = 16777215; + + // @ts-ignore: decorator + @builtin + export declare function abs(value: f32): f32; + + // @ts-ignore: decorator + @builtin + export declare function ceil(value: f32): f32; + + // @ts-ignore: decorator + @builtin + export declare function copysign(x: f32, y: f32): f32; + + // @ts-ignore: decorator + @builtin + export declare function floor(value: f32): f32; + + // @ts-ignore: decorator + @builtin + export declare function load(offset: usize, immOffset?: usize, immAlign?: usize): f32; + + // @ts-ignore: decorator + @builtin + export declare function max(left: f32, right: f32): f32; + + // @ts-ignore: decorator + @builtin + export declare function min(left: f32, right: f32): f32; + + // @ts-ignore: decorator + @builtin + export declare function nearest(value: f32): f32; + + // @ts-ignore: decorator + @builtin + export declare function reinterpret_i32(value: i32): f32; + + // @ts-ignore: decorator + @builtin + export declare function sqrt(value: f32): f32; + + // @ts-ignore: decorator + @builtin + export declare function store(offset: usize, value: f32, immOffset?: usize, immAlign?: usize): void; + + // @ts-ignore: decorator + @builtin + export declare function trunc(value: f32): f32; } -@builtin export declare function f64(value: void): f64; +// @ts-ignore: decorator +@builtin +export declare function f64(value: void): f64; + export namespace f64 { - @lazy export const EPSILON = reinterpret(0x3CB0000000000000); // 0x1p-52 - @lazy export const MIN_VALUE = reinterpret(0x0000000000000001); // 0x0.0000000000001p+0 - @lazy export const MAX_VALUE = reinterpret(0x7FEFFFFFFFFFFFFF); // 0x1.fffffffffffffp+1023 - @lazy export const MIN_NORMAL_VALUE = reinterpret(0x0010000000000000); // 0x1p-1022 - @lazy export const MIN_SAFE_INTEGER: f64 = -9007199254740991; - @lazy export const MAX_SAFE_INTEGER: f64 = 9007199254740991; - @builtin export declare function abs(value: f64): f64; - @builtin export declare function ceil(value: f64): f64; - @builtin export declare function copysign(x: f64, y: f64): f64; - @builtin export declare function floor(value: f64): f64; - @builtin export declare function load(offset: usize, immOffset?: usize, immAlign?: usize): f64; - @builtin export declare function max(left: f64, right: f64): f64; - @builtin export declare function min(left: f64, right: f64): f64; - @builtin export declare function nearest(value: f64): f64; - @builtin export declare function reinterpret_i64(value: i64): f64; - @builtin export declare function sqrt(value: f64): f64; - @builtin export declare function store(offset: usize, value: f64, immOffset?: usize, immAlign?: usize): void; - @builtin export declare function trunc(value: f64): f64; + + // @ts-ignore: decorator + @lazy + export const EPSILON = reinterpret(0x3CB0000000000000); // 0x1p-52 + + // @ts-ignore: decorator + @lazy + export const MIN_VALUE = reinterpret(0x0000000000000001); // 0x0.0000000000001p+0 + + // @ts-ignore: decorator + @lazy + export const MAX_VALUE = reinterpret(0x7FEFFFFFFFFFFFFF); // 0x1.fffffffffffffp+1023 + + // @ts-ignore: decorator + @lazy + export const MIN_NORMAL_VALUE = reinterpret(0x0010000000000000); // 0x1p-1022 + + // @ts-ignore: decorator + @lazy + export const MIN_SAFE_INTEGER: f64 = -9007199254740991; + + // @ts-ignore: decorator + @lazy + export const MAX_SAFE_INTEGER: f64 = 9007199254740991; + + // @ts-ignore: decorator + @builtin + export declare function abs(value: f64): f64; + + // @ts-ignore: decorator + @builtin + export declare function ceil(value: f64): f64; + + // @ts-ignore: decorator + @builtin + export declare function copysign(x: f64, y: f64): f64; + + // @ts-ignore: decorator + @builtin + export declare function floor(value: f64): f64; + + // @ts-ignore: decorator + @builtin + export declare function load(offset: usize, immOffset?: usize, immAlign?: usize): f64; + + // @ts-ignore: decorator + @builtin + export declare function max(left: f64, right: f64): f64; + + // @ts-ignore: decorator + @builtin + export declare function min(left: f64, right: f64): f64; + + // @ts-ignore: decorator + @builtin + export declare function nearest(value: f64): f64; + + // @ts-ignore: decorator + @builtin + export declare function reinterpret_i64(value: i64): f64; + + // @ts-ignore: decorator + @builtin + export declare function sqrt(value: f64): f64; + + // @ts-ignore: decorator + @builtin + export declare function store(offset: usize, value: f64, immOffset?: usize, immAlign?: usize): void; + + // @ts-ignore: decorator + @builtin + export declare function trunc(value: f64): f64; } -@builtin export declare function v128(a: i8, b: i8, c: i8, d: i8, e: i8, f: i8, g: i8, h: i8, i: i8, j: i8, k: i8, l: i8, m: i8, n: i8, o: i8, p: i8): v128; +// @ts-ignore: decorator +@builtin +export declare function v128( + a: i8, b: i8, c: i8, d: i8, e: i8, f: i8, g: i8, h: i8, + i: i8, j: i8, k: i8, l: i8, m: i8, n: i8, o: i8, p: i8 +): v128; + export namespace v128 { - @builtin export declare function splat(x: T): v128; - @builtin export declare function extract_lane(x: v128, idx: u8): T; - @builtin export declare function replace_lane(x: v128, idx: u8, value: T): v128; - @builtin export declare function shuffle(a: v128, b: v128, ...lanes: u8[]): v128; - @builtin export declare function load(offset: usize, immOffset?: usize, immAlign?: usize): v128; - @builtin export declare function store(offset: usize, value: v128, immOffset?: usize, immAlign?: usize): void; - @builtin export declare function add(a: v128, b: v128): v128; - @builtin export declare function sub(a: v128, b: v128): v128; - @builtin export declare function mul(a: v128, b: v128): v128; // except i64 - @builtin export declare function div(a: v128, b: v128): v128; // f32, f64 only - @builtin export declare function neg(a: v128): v128; - @builtin export declare function add_saturate(a: v128, b: v128): v128; - @builtin export declare function sub_saturate(a: v128, b: v128): v128; - @builtin export declare function shl(a: v128, b: i32): v128; - @builtin export declare function shr(a: v128, b: i32): v128; - @builtin export declare function and(a: v128, b: v128): v128; - @builtin export declare function or(a: v128, b: v128): v128; - @builtin export declare function xor(a: v128, b: v128): v128; - @builtin export declare function not(a: v128): v128; - @builtin export declare function bitselect(v1: v128, v2: v128, c: v128): v128; - @builtin export declare function any_true(a: v128): bool; - @builtin export declare function all_true(a: v128): bool; - @builtin export declare function min(a: v128, b: v128): v128; // f32, f64 only - @builtin export declare function max(a: v128, b: v128): v128; // f32, f64 only - @builtin export declare function abs(a: v128): v128; // f32, f64 only - @builtin export declare function sqrt(a: v128): v128; // f32, f64 only - @builtin export declare function eq(a: v128, b: v128): v128; - @builtin export declare function ne(a: v128, b: v128): v128; - @builtin export declare function lt(a: v128, b: v128): v128; - @builtin export declare function le(a: v128, b: v128): v128; - @builtin export declare function gt(a: v128, b: v128): v128; - @builtin export declare function ge(a: v128, b: v128): v128; - @builtin export declare function convert(a: v128): v128; - @builtin export declare function trunc(a: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function splat(x: T): v128; + + // @ts-ignore: decorator + @builtin + export declare function extract_lane(x: v128, idx: u8): T; + + // @ts-ignore: decorator + @builtin + export declare function replace_lane(x: v128, idx: u8, value: T): v128; + + // @ts-ignore: decorator + @builtin + export declare function shuffle(a: v128, b: v128, ...lanes: u8[]): v128; + + // @ts-ignore: decorator + @builtin + export declare function load(offset: usize, immOffset?: usize, immAlign?: usize): v128; + + // @ts-ignore: decorator + @builtin + export declare function store(offset: usize, value: v128, immOffset?: usize, immAlign?: usize): void; + + // @ts-ignore: decorator + @builtin + export declare function add(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function sub(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function mul(a: v128, b: v128): v128; // except i64 + + // @ts-ignore: decorator + @builtin + export declare function div(a: v128, b: v128): v128; // f32, f64 only + + // @ts-ignore: decorator + @builtin + export declare function neg(a: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function add_saturate(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function sub_saturate(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function shl(a: v128, b: i32): v128; + + // @ts-ignore: decorator + @builtin + export declare function shr(a: v128, b: i32): v128; + + // @ts-ignore: decorator + @builtin + export declare function and(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function or(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function xor(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function not(a: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function bitselect(v1: v128, v2: v128, c: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function any_true(a: v128): bool; + + // @ts-ignore: decorator + @builtin + export declare function all_true(a: v128): bool; + + // @ts-ignore: decorator + @builtin + export declare function min(a: v128, b: v128): v128; // f32, f64 only + + // @ts-ignore: decorator + @builtin + export declare function max(a: v128, b: v128): v128; // f32, f64 only + + // @ts-ignore: decorator + @builtin + export declare function abs(a: v128): v128; // f32, f64 only + + // @ts-ignore: decorator + @builtin + export declare function sqrt(a: v128): v128; // f32, f64 only + + // @ts-ignore: decorator + @builtin + export declare function eq(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function ne(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function lt(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function le(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function gt(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function ge(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function convert(a: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function trunc(a: v128): v128; } -@builtin export declare function i8x16(a: i8, b: i8, c: i8, d: i8, e: i8, f: i8, g: i8, h: i8, i: i8, j: i8, k: i8, l: i8, m: i8, n: i8, o: i8, p: i8): v128; +// @ts-ignore: decorator +@builtin +export declare function i8x16( + a: i8, b: i8, c: i8, d: i8, e: i8, f: i8, g: i8, h: i8, + i: i8, j: i8, k: i8, l: i8, m: i8, n: i8, o: i8, p: i8 +): v128; + export namespace i8x16 { - @builtin export declare function splat(x: i8): v128; - @builtin export declare function extract_lane_s(x: v128, idx: u8): i8; - @builtin export declare function extract_lane_u(x: v128, idx: u8): u8; - @builtin export declare function replace_lane(x: v128, idx: u8, value: i8): v128; - @builtin export declare function add(a: v128, b: v128): v128; - @builtin export declare function sub(a: v128, b: v128): v128; - @builtin export declare function mul(a: v128, b: v128): v128; - @builtin export declare function neg(a: v128): v128; - @builtin export declare function add_saturate_s(a: v128, b: v128): v128; - @builtin export declare function add_saturate_u(a: v128, b: v128): v128; - @builtin export declare function sub_saturate_s(a: v128, b: v128): v128; - @builtin export declare function sub_saturate_u(a: v128, b: v128): v128; - @builtin export declare function shl(a: v128, b: i32): v128; - @builtin export declare function shr_s(a: v128, b: i32): v128; - @builtin export declare function shr_u(a: v128, b: i32): v128; - @builtin export declare function any_true(a: v128): bool; - @builtin export declare function all_true(a: v128): bool; - @builtin export declare function eq(a: v128, b: v128): v128; - @builtin export declare function ne(a: v128, b: v128): v128; - @builtin export declare function lt_s(a: v128, b: v128): v128; - @builtin export declare function lt_u(a: v128, b: v128): v128; - @builtin export declare function le_s(a: v128, b: v128): v128; - @builtin export declare function le_u(a: v128, b: v128): v128; - @builtin export declare function gt_s(a: v128, b: v128): v128; - @builtin export declare function gt_u(a: v128, b: v128): v128; - @builtin export declare function ge_s(a: v128, b: v128): v128; - @builtin export declare function ge_u(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function splat(x: i8): v128; + + // @ts-ignore: decorator + @builtin + export declare function extract_lane_s(x: v128, idx: u8): i8; + + // @ts-ignore: decorator + @builtin + export declare function extract_lane_u(x: v128, idx: u8): u8; + + // @ts-ignore: decorator + @builtin + export declare function replace_lane(x: v128, idx: u8, value: i8): v128; + + // @ts-ignore: decorator + @builtin + export declare function add(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function sub(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function mul(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function neg(a: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function add_saturate_s(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function add_saturate_u(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function sub_saturate_s(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function sub_saturate_u(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function shl(a: v128, b: i32): v128; + + // @ts-ignore: decorator + @builtin + export declare function shr_s(a: v128, b: i32): v128; + + // @ts-ignore: decorator + @builtin + export declare function shr_u(a: v128, b: i32): v128; + + // @ts-ignore: decorator + @builtin + export declare function any_true(a: v128): bool; + + // @ts-ignore: decorator + @builtin + export declare function all_true(a: v128): bool; + + // @ts-ignore: decorator + @builtin + export declare function eq(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function ne(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function lt_s(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function lt_u(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function le_s(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function le_u(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function gt_s(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function gt_u(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function ge_s(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function ge_u(a: v128, b: v128): v128; } -@builtin export declare function i16x8(a: i16, b: i16, c: i16, d: i16, e: i16, f: i16, g: i16, h: i16): v128; +// @ts-ignore: decorator +@builtin +export declare function i16x8(a: i16, b: i16, c: i16, d: i16, e: i16, f: i16, g: i16, h: i16): v128; + export namespace i16x8 { - @builtin export declare function splat(x: i16): v128; - @builtin export declare function extract_lane_s(x: v128, idx: u8): i16; - @builtin export declare function extract_lane_u(x: v128, idx: u8): u16; - @builtin export declare function replace_lane(x: v128, idx: u8, value: i16): v128; - @builtin export declare function add(a: v128, b: v128): v128; - @builtin export declare function sub(a: v128, b: v128): v128; - @builtin export declare function mul(a: v128, b: v128): v128; - @builtin export declare function neg(a: v128): v128; - @builtin export declare function add_saturate_s(a: v128, b: v128): v128; - @builtin export declare function add_saturate_u(a: v128, b: v128): v128; - @builtin export declare function sub_saturate_s(a: v128, b: v128): v128; - @builtin export declare function sub_saturate_u(a: v128, b: v128): v128; - @builtin export declare function shl(a: v128, b: i32): v128; - @builtin export declare function shr_s(a: v128, b: i32): v128; - @builtin export declare function shr_u(a: v128, b: i32): v128; - @builtin export declare function any_true(a: v128): bool; - @builtin export declare function all_true(a: v128): bool; - @builtin export declare function eq(a: v128, b: v128): v128; - @builtin export declare function ne(a: v128, b: v128): v128; - @builtin export declare function lt_s(a: v128, b: v128): v128; - @builtin export declare function lt_u(a: v128, b: v128): v128; - @builtin export declare function le_s(a: v128, b: v128): v128; - @builtin export declare function le_u(a: v128, b: v128): v128; - @builtin export declare function gt_s(a: v128, b: v128): v128; - @builtin export declare function gt_u(a: v128, b: v128): v128; - @builtin export declare function ge_s(a: v128, b: v128): v128; - @builtin export declare function ge_u(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function splat(x: i16): v128; + + // @ts-ignore: decorator + @builtin + export declare function extract_lane_s(x: v128, idx: u8): i16; + + // @ts-ignore: decorator + @builtin + export declare function extract_lane_u(x: v128, idx: u8): u16; + + // @ts-ignore: decorator + @builtin + export declare function replace_lane(x: v128, idx: u8, value: i16): v128; + + // @ts-ignore: decorator + @builtin + export declare function add(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function sub(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function mul(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function neg(a: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function add_saturate_s(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function add_saturate_u(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function sub_saturate_s(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function sub_saturate_u(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function shl(a: v128, b: i32): v128; + + // @ts-ignore: decorator + @builtin + export declare function shr_s(a: v128, b: i32): v128; + + // @ts-ignore: decorator + @builtin + export declare function shr_u(a: v128, b: i32): v128; + + // @ts-ignore: decorator + @builtin + export declare function any_true(a: v128): bool; + + // @ts-ignore: decorator + @builtin + export declare function all_true(a: v128): bool; + + // @ts-ignore: decorator + @builtin + export declare function eq(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function ne(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function lt_s(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function lt_u(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function le_s(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function le_u(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function gt_s(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function gt_u(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function ge_s(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function ge_u(a: v128, b: v128): v128; } -@builtin export declare function i32x4(a: i32, b: i32, c: i32, d: i32): v128; +// @ts-ignore: decorator +@builtin +export declare function i32x4(a: i32, b: i32, c: i32, d: i32): v128; + export namespace i32x4 { - @builtin export declare function splat(x: i32): v128; - @builtin export declare function extract_lane(x: v128, idx: u8): i32; - @builtin export declare function replace_lane(x: v128, idx: u8, value: i32): v128; - @builtin export declare function add(a: v128, b: v128): v128; - @builtin export declare function sub(a: v128, b: v128): v128; - @builtin export declare function mul(a: v128, b: v128): v128; - @builtin export declare function neg(a: v128): v128; - @builtin export declare function shl(a: v128, b: i32): v128; - @builtin export declare function shr_s(a: v128, b: i32): v128; - @builtin export declare function shr_u(a: v128, b: i32): v128; - @builtin export declare function any_true(a: v128): bool; - @builtin export declare function all_true(a: v128): bool; - @builtin export declare function eq(a: v128, b: v128): v128; - @builtin export declare function ne(a: v128, b: v128): v128; - @builtin export declare function lt_s(a: v128, b: v128): v128; - @builtin export declare function lt_u(a: v128, b: v128): v128; - @builtin export declare function le_s(a: v128, b: v128): v128; - @builtin export declare function le_u(a: v128, b: v128): v128; - @builtin export declare function gt_s(a: v128, b: v128): v128; - @builtin export declare function gt_u(a: v128, b: v128): v128; - @builtin export declare function ge_s(a: v128, b: v128): v128; - @builtin export declare function ge_u(a: v128, b: v128): v128; - @builtin export declare function trunc_s_f32x4_sat(a: v128): v128; - @builtin export declare function trunc_u_f32x4_sat(a: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function splat(x: i32): v128; + + // @ts-ignore: decorator + @builtin + export declare function extract_lane(x: v128, idx: u8): i32; + + // @ts-ignore: decorator + @builtin + export declare function replace_lane(x: v128, idx: u8, value: i32): v128; + + // @ts-ignore: decorator + @builtin + export declare function add(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function sub(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function mul(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function neg(a: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function shl(a: v128, b: i32): v128; + + // @ts-ignore: decorator + @builtin + export declare function shr_s(a: v128, b: i32): v128; + + // @ts-ignore: decorator + @builtin + export declare function shr_u(a: v128, b: i32): v128; + + // @ts-ignore: decorator + @builtin + export declare function any_true(a: v128): bool; + + // @ts-ignore: decorator + @builtin + export declare function all_true(a: v128): bool; + + // @ts-ignore: decorator + @builtin + export declare function eq(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function ne(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function lt_s(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function lt_u(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function le_s(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function le_u(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function gt_s(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function gt_u(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function ge_s(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function ge_u(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function trunc_s_f32x4_sat(a: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function trunc_u_f32x4_sat(a: v128): v128; } -@builtin export declare function i64x2(a: i64, b: i64): v128; +// @ts-ignore: decorator +@builtin +export declare function i64x2(a: i64, b: i64): v128; + export namespace i64x2 { - @builtin export declare function splat(x: i64): v128; - @builtin export declare function extract_lane(x: v128, idx: u8): i64; - @builtin export declare function replace_lane(x: v128, idx: u8, value: i64): v128; - @builtin export declare function add(a: v128, b: v128): v128; - @builtin export declare function sub(a: v128, b: v128): v128; - @builtin export declare function mul(a: v128, b: v128): v128; - @builtin export declare function neg(a: v128): v128; - @builtin export declare function shl(a: v128, b: i32): v128; - @builtin export declare function shr_s(a: v128, b: i32): v128; - @builtin export declare function shr_u(a: v128, b: i32): v128; - @builtin export declare function any_true(a: v128): bool; - @builtin export declare function all_true(a: v128): bool; - @builtin export declare function trunc_s_f64x2_sat(a: v128): v128; - @builtin export declare function trunc_u_f64x2_sat(a: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function splat(x: i64): v128; + + // @ts-ignore: decorator + @builtin + export declare function extract_lane(x: v128, idx: u8): i64; + + // @ts-ignore: decorator + @builtin + export declare function replace_lane(x: v128, idx: u8, value: i64): v128; + + // @ts-ignore: decorator + @builtin + export declare function add(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function sub(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function mul(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function neg(a: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function shl(a: v128, b: i32): v128; + + // @ts-ignore: decorator + @builtin + export declare function shr_s(a: v128, b: i32): v128; + + // @ts-ignore: decorator + @builtin + export declare function shr_u(a: v128, b: i32): v128; + + // @ts-ignore: decorator + @builtin + export declare function any_true(a: v128): bool; + + // @ts-ignore: decorator + @builtin + export declare function all_true(a: v128): bool; + + // @ts-ignore: decorator + @builtin + export declare function trunc_s_f64x2_sat(a: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function trunc_u_f64x2_sat(a: v128): v128; } -@builtin export declare function f32x4(a: f32, b: f32, c: f32, d: f32): v128; +// @ts-ignore: decorator +@builtin +export declare function f32x4(a: f32, b: f32, c: f32, d: f32): v128; + export namespace f32x4 { - @builtin export declare function splat(x: f32): v128; - @builtin export declare function extract_lane(x: v128, idx: u8): f32; - @builtin export declare function replace_lane(x: v128, idx: u8, value: f32): v128; - @builtin export declare function add(a: v128, b: v128): v128; - @builtin export declare function sub(a: v128, b: v128): v128; - @builtin export declare function mul(a: v128, b: v128): v128; - @builtin export declare function div(a: v128, b: v128): v128; - @builtin export declare function neg(a: v128): v128; - @builtin export declare function min(a: v128, b: v128): v128; - @builtin export declare function max(a: v128, b: v128): v128; - @builtin export declare function abs(a: v128): v128; - @builtin export declare function sqrt(a: v128): v128; - @builtin export declare function eq(a: v128, b: v128): v128; - @builtin export declare function ne(a: v128, b: v128): v128; - @builtin export declare function lt(a: v128, b: v128): v128; - @builtin export declare function le(a: v128, b: v128): v128; - @builtin export declare function gt(a: v128, b: v128): v128; - @builtin export declare function ge(a: v128, b: v128): v128; - @builtin export declare function convert_s_i32x4(a: v128): v128; - @builtin export declare function convert_u_i32x4(a: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function splat(x: f32): v128; + + // @ts-ignore: decorator + @builtin + export declare function extract_lane(x: v128, idx: u8): f32; + + // @ts-ignore: decorator + @builtin + export declare function replace_lane(x: v128, idx: u8, value: f32): v128; + + // @ts-ignore: decorator + @builtin + export declare function add(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function sub(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function mul(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function div(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function neg(a: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function min(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function max(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function abs(a: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function sqrt(a: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function eq(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function ne(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function lt(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function le(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function gt(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function ge(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function convert_s_i32x4(a: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function convert_u_i32x4(a: v128): v128; } -@builtin export declare function f64x2(a: f64, b: f64): v128; +// @ts-ignore: decorator +@builtin +export declare function f64x2(a: f64, b: f64): v128; + export namespace f64x2 { - @builtin export declare function splat(x: f64): v128; - @builtin export declare function extract_lane(x: v128, idx: u8): f64; - @builtin export declare function replace_lane(x: v128, idx: u8, value: f64): v128; - @builtin export declare function add(a: v128, b: v128): v128; - @builtin export declare function sub(a: v128, b: v128): v128; - @builtin export declare function mul(a: v128, b: v128): v128; - @builtin export declare function div(a: v128, b: v128): v128; - @builtin export declare function neg(a: v128): v128; - @builtin export declare function min(a: v128, b: v128): v128; - @builtin export declare function max(a: v128, b: v128): v128; - @builtin export declare function abs(a: v128): v128; - @builtin export declare function sqrt(a: v128): v128; - @builtin export declare function eq(a: v128, b: v128): v128; - @builtin export declare function ne(a: v128, b: v128): v128; - @builtin export declare function lt(a: v128, b: v128): v128; - @builtin export declare function le(a: v128, b: v128): v128; - @builtin export declare function gt(a: v128, b: v128): v128; - @builtin export declare function ge(a: v128, b: v128): v128; - @builtin export declare function convert_s_i64x2(a: v128): v128; - @builtin export declare function convert_u_i64x2(a: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function splat(x: f64): v128; + + // @ts-ignore: decorator + @builtin + export declare function extract_lane(x: v128, idx: u8): f64; + + // @ts-ignore: decorator + @builtin + export declare function replace_lane(x: v128, idx: u8, value: f64): v128; + + // @ts-ignore: decorator + @builtin + export declare function add(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function sub(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function mul(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function div(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function neg(a: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function min(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function max(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function abs(a: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function sqrt(a: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function eq(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function ne(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function lt(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function le(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function gt(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function ge(a: v128, b: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function convert_s_i64x2(a: v128): v128; + + // @ts-ignore: decorator + @builtin + export declare function convert_u_i64x2(a: v128): v128; } export namespace v8x16 { - @builtin export declare function shuffle(a: v128, b: v128, l0: u8, l1: u8, l2: u8, l3: u8, l4: u8, l5: u8, l6: u8, l7: u8, l8: u8, l9: u8, l10: u8, l11: u8, l12: u8, l13: u8, l14: u8, l15: u8): v128; + + // @ts-ignore: decorator + @builtin + export declare function shuffle( + a: v128, b: v128, + l0: u8, l1: u8, l2: u8, l3: u8, l4: u8, l5: u8, l6: u8, l7: u8, + l8: u8, l9: u8, l10: u8, l11: u8, l12: u8, l13: u8, l14: u8, l15: u8 + ): v128; } -@builtin export declare function start(): void; +// @ts-ignore: decorator +@external("env", "abort") +declare function abort( + message?: string | null, + fileName?: string | null, + lineNumber?: u32, + columnNumber?: u32 +): void; + +// @ts-ignore: decorator +@external("env", "trace") +declare function trace( + message: string, + n?: i32, + a0?: f64, + a1?: f64, + a2?: f64, + a3?: f64, + a4?: f64 +): void; diff --git a/std/assembly/collector/itcm.ts b/std/assembly/collector/itcm.ts deleted file mode 100644 index 0dbeb5487c..0000000000 --- a/std/assembly/collector/itcm.ts +++ /dev/null @@ -1,244 +0,0 @@ -/** - * Incremental Tri-Color-Marking Garbage Collector. - * - * @module std/assembly/collector/itcm - *//***/ - -// Largely based on Bach Le's μgc, see: https://github.com/bullno1/ugc - -@inline const TRACE = false; - -/** Size of a managed object header. */ -@inline export const HEADER_SIZE: usize = (offsetof() + AL_MASK) & ~AL_MASK; - -import { AL_MASK, MAX_SIZE_32 } from "../internal/allocator"; -import { iterateRoots } from "../gc"; - -/** Collector states. */ -const enum State { - /** Not yet initialized. */ - INIT = 0, - /** Currently transitioning from SWEEP to MARK state. */ - IDLE = 1, - /** Currently marking reachable objects. */ - MARK = 2, - /** Currently sweeping unreachable objects. */ - SWEEP = 3 -} - -/** Current collector state. */ -var state = State.INIT; -/** Current white color value. */ -var white = 0; - -// From and to spaces -var fromSpace: ManagedObjectList; -var toSpace: ManagedObjectList; -var iter: ManagedObject; - -// ╒═══════════════ Managed object layout (32-bit) ════════════════╕ -// 3 2 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits -// ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┼─┼─┴─┤ ┐ -// │ next │0│ C │ ◄─┐ = nextWithColor -// ├─────────────────────────────────────────────────────────┴─┴───┤ │ usize -// │ prev │ ◄─┘ -// ├───────────────────────────────────────────────────────────────┤ -// │ hookFn │ -// ╞═══════════════════════════════════════════════════════════════╡ SIZE ┘ ◄─ user-space reference -// │ ... data ... │ -// └───────────────────────────────────────────────────────────────┘ -// C: color - -/** Represents a managed object in memory, consisting of a header followed by the object's data. */ -@unmanaged class ManagedObject { - - /** Pointer to the next object with color flags stored in the alignment bits. */ - nextWithColor: usize; - - /** Pointer to the previous object. */ - prev: ManagedObject; - - /** Class-specific hook function called with the user-space reference. */ - hookFn: (ref: usize) => void; - - /** Gets the pointer to the next object. */ - get next(): ManagedObject { - return changetype(this.nextWithColor & ~3); - } - - /** Sets the pointer to the next object. */ - set next(obj: ManagedObject) { - this.nextWithColor = changetype(obj) | (this.nextWithColor & 3); - } - - /** Gets this object's color. */ - get color(): i32 { - return this.nextWithColor & 3; - } - - /** Sets this object's color. */ - set color(color: i32) { - this.nextWithColor = (this.nextWithColor & ~3) | color; - } - - /** Unlinks this object from its list. */ - unlink(): void { - var next = this.next; - var prev = this.prev; - if (TRACE) trace(" unlink", 3, objToRef(prev), objToRef(this), objToRef(next)); - next.prev = prev; - prev.next = next; - } - - /** Marks this object as gray, that is reachable with unscanned children. */ - makeGray(): void { - if (TRACE) trace(" makeGray", 1, objToRef(this)); - const gray = 2; - if (this == iter) iter = this.prev; - this.unlink(); - toSpace.push(this); - this.nextWithColor = (this.nextWithColor & ~3) | gray; - } -} - -/** A list of managed objects. Used for the from and to spaces. */ -@unmanaged class ManagedObjectList extends ManagedObject { - - /** Inserts an object. */ - push(obj: ManagedObject): void { - var prev = this.prev; - if (TRACE) trace(" push", 3, objToRef(prev), objToRef(obj), objToRef(this)); - obj.next = this; - obj.prev = prev; - prev.next = obj; - this.prev = obj; - } - - /** Clears this list. */ - clear(): void { - if (TRACE) trace(" clear", 1, objToRef(this)); - this.nextWithColor = changetype(this); - this.prev = this; - } -} - -/** Performs a single step according to the current state. */ -function step(): void { - var obj: ManagedObject; - switch (state) { - case State.INIT: { - if (TRACE) trace("gc~step/INIT"); - fromSpace = changetype(memory.allocate(HEADER_SIZE)); - fromSpace.hookFn = changetype<(ref: usize) => void>(-1); // would error - fromSpace.clear(); - toSpace = changetype(memory.allocate(HEADER_SIZE)); - toSpace.hookFn = changetype<(ref: usize) => void>(-1); // would error - toSpace.clear(); - iter = toSpace; - state = State.IDLE; - if (TRACE) trace("gc~state = IDLE"); - // fall-through - } - case State.IDLE: { - if (TRACE) trace("gc~step/IDLE"); - iterateRoots(__gc_mark); - state = State.MARK; - if (TRACE) trace("gc~state = MARK"); - break; - } - case State.MARK: { - obj = iter.next; - if (obj !== toSpace) { - if (TRACE) trace("gc~step/MARK iterate", 1, objToRef(obj)); - iter = obj; - obj.color = !white; - // if (TRACE) { - // trace(" next/prev/hook", 3, - // changetype(obj.next), - // changetype(obj.prev), - // changetype(obj.hookFn) - // ); - // } - obj.hookFn(objToRef(obj)); - } else { - if (TRACE) trace("gc~step/MARK finish"); - iterateRoots(__gc_mark); - obj = iter.next; - if (obj === toSpace) { - let from = fromSpace; - fromSpace = toSpace; - toSpace = from; - white = !white; - iter = from.next; - state = State.SWEEP; - if (TRACE) trace("gc~state = SWEEP"); - } - } - break; - } - case State.SWEEP: { - obj = iter; - if (obj !== toSpace) { - if (TRACE) trace("gc~step/SWEEP free", 1, objToRef(obj)); - iter = obj.next; - if (changetype(obj) >= HEAP_BASE) memory.free(changetype(obj)); - } else { - if (TRACE) trace("gc~step/SWEEP finish"); - toSpace.clear(); - state = State.IDLE; - if (TRACE) trace("gc~state = IDLE"); - } - break; - } - } -} - -@inline function refToObj(ref: usize): ManagedObject { - return changetype(ref - HEADER_SIZE); -} - -@inline function objToRef(obj: ManagedObject): usize { - return changetype(obj) + HEADER_SIZE; -} - -// Garbage collector interface - -@global export function __gc_allocate( - size: usize, - markFn: (ref: usize) => void -): usize { - if (TRACE) trace("gc.allocate", 1, size); - if (size > MAX_SIZE_32 - HEADER_SIZE) unreachable(); - step(); // also makes sure it's initialized - var obj = changetype(memory.allocate(HEADER_SIZE + size)); - obj.hookFn = markFn; - obj.color = white; - fromSpace.push(obj); - return objToRef(obj); -} - -@global export function __gc_link(parentRef: usize, childRef: usize): void { - if (TRACE) trace("gc.link", 2, parentRef, childRef); - var parent = refToObj(parentRef); - if (parent.color == !white && refToObj(childRef).color == white) parent.makeGray(); -} - -@global export function __gc_mark(ref: usize): void { - if (TRACE) trace("gc.mark", 1, ref); - if (ref) { - let obj = refToObj(ref); - if (obj.color == white) obj.makeGray(); - } -} - -@global export function __gc_collect(): void { - if (TRACE) trace("gc.collect"); - // begin collecting if not yet collecting - switch (state) { - case State.INIT: - case State.IDLE: step(); - } - // finish the cycle - while (state != State.IDLE) step(); -} diff --git a/std/assembly/dataview.ts b/std/assembly/dataview.ts index 0e65466ffb..48e1ed8079 100644 --- a/std/assembly/dataview.ts +++ b/std/assembly/dataview.ts @@ -1,189 +1,213 @@ -import { - HEADER_SIZE, - MAX_BLENGTH -} from "./internal/arraybuffer"; +import { BLOCK_MAXSIZE } from "./rt/common"; +import { ArrayBuffer } from "./arraybuffer"; +import { E_INDEXOUTOFRANGE, E_INVALIDLENGTH } from "./util/error"; + +// TODO: there is probably a smarter way to check byteOffset for accesses larger than 1 byte export class DataView { + private data: ArrayBuffer; + private dataStart: usize; + private dataLength: i32; + constructor( - readonly buffer: ArrayBuffer, - readonly byteOffset: i32 = 0, - readonly byteLength: i32 = i32.MIN_VALUE // FIXME + buffer: ArrayBuffer, + byteOffset: i32 = 0, + byteLength: i32 = buffer.byteLength ) { - if (byteLength === i32.MIN_VALUE) byteLength = buffer.byteLength - byteOffset; // FIXME - if (byteOffset > MAX_BLENGTH) throw new RangeError("Invalid byteOffset"); - if (byteLength > MAX_BLENGTH) throw new RangeError("Invalid byteLength"); - if (byteOffset + byteLength > buffer.byteLength) throw new RangeError("Invalid length"); + if ( + i32(byteLength > BLOCK_MAXSIZE) | + i32(byteOffset + byteLength > buffer.byteLength) + ) throw new RangeError(E_INVALIDLENGTH); + this.data = buffer; // retains + var dataStart = changetype(buffer) + byteOffset; + this.dataStart = dataStart; + this.dataLength = byteLength; + } + + get buffer(): ArrayBuffer { + return this.data; + } + + get byteOffset(): i32 { + return (this.dataStart - changetype(this.data)); + } + + get byteLength(): i32 { + return this.dataLength; } getFloat32(byteOffset: i32, littleEndian: boolean = false): f32 { - checkOffset(byteOffset, 4, this.byteLength); + if ( + i32(byteOffset < 0) | + i32(byteOffset + 4 > this.dataLength) + ) throw new RangeError(E_INDEXOUTOFRANGE); return littleEndian - ? load(changetype(this.buffer) + this.byteOffset + byteOffset, HEADER_SIZE) + ? load(this.dataStart + byteOffset) : reinterpret( bswap( - load(changetype(this.buffer) + this.byteOffset + byteOffset, HEADER_SIZE) + load(this.dataStart + byteOffset) ) ); } getFloat64(byteOffset: i32, littleEndian: boolean = false): f64 { - checkOffset(byteOffset, 8, this.byteLength); + if ( + i32(byteOffset < 0) | + i32(byteOffset + 8 > this.dataLength) + ) throw new RangeError(E_INDEXOUTOFRANGE); return littleEndian - ? load(changetype(this.buffer) + this.byteOffset + byteOffset, HEADER_SIZE) + ? load(this.dataStart + byteOffset) : reinterpret( - bswap( - load(changetype(this.buffer) + this.byteOffset + byteOffset, HEADER_SIZE) + bswap( + load(this.dataStart + byteOffset) ) ); } getInt8(byteOffset: i32): i8 { - checkOffset(byteOffset, 1, this.byteLength); - return load(changetype(this.buffer) + this.byteOffset + byteOffset, HEADER_SIZE); + if (byteOffset >= this.dataLength) throw new RangeError(E_INDEXOUTOFRANGE); + return load(this.dataStart + byteOffset); } getInt16(byteOffset: i32, littleEndian: boolean = false): i16 { - checkOffset(byteOffset, 2, this.byteLength); - var result: i16 = load(changetype(this.buffer) + this.byteOffset + byteOffset, HEADER_SIZE); + if ( + i32(byteOffset < 0) | + i32(byteOffset + 2 > this.dataLength) + ) throw new RangeError(E_INDEXOUTOFRANGE); + var result: i16 = load(this.dataStart + byteOffset); return littleEndian ? result : bswap(result); } getInt32(byteOffset: i32, littleEndian: boolean = false): i32 { - checkOffset(byteOffset, 4, this.byteLength); - var result = load(changetype(this.buffer) + this.byteOffset + byteOffset, HEADER_SIZE); + if ( + i32(byteOffset < 0) | + i32(byteOffset + 4 > this.dataLength) + ) throw new RangeError(E_INDEXOUTOFRANGE); + var result: i32 = load(this.dataStart + byteOffset); return littleEndian ? result : bswap(result); } getUint8(byteOffset: i32): u8 { - checkOffset(byteOffset, 1, this.byteLength); - return load(changetype(this.buffer) + this.byteOffset + byteOffset, HEADER_SIZE); + if (byteOffset >= this.dataLength) throw new RangeError(E_INDEXOUTOFRANGE); + return load(this.dataStart + byteOffset); } getUint16(byteOffset: i32, littleEndian: boolean = false): u16 { - checkOffset(byteOffset, 2, this.byteLength); - var result: u16 = load(changetype(this.buffer) + this.byteOffset + byteOffset, HEADER_SIZE); + if ( + i32(byteOffset < 0) | + i32(byteOffset + 2 > this.dataLength) + ) throw new RangeError(E_INDEXOUTOFRANGE); + var result: u16 = load(this.dataStart + byteOffset); return littleEndian ? result : bswap(result); } getUint32(byteOffset: i32, littleEndian: boolean = false): u32 { - checkOffset(byteOffset, 4, this.byteLength); - var result = load(changetype(this.buffer) + this.byteOffset + byteOffset, HEADER_SIZE); + if ( + i32(byteOffset < 0) | + i32(byteOffset + 4 > this.dataLength) + ) throw new RangeError(E_INDEXOUTOFRANGE); + var result: u32 = load(this.dataStart + byteOffset); return littleEndian ? result : bswap(result); } setFloat32(byteOffset: i32, value: f32, littleEndian: boolean = false): void { - checkOffset(byteOffset, 4, this.byteLength); - if (littleEndian) { - store(changetype(this.buffer) + this.byteOffset + byteOffset, value, HEADER_SIZE); - } else { - store(changetype(this.buffer) + this.byteOffset + byteOffset, - bswap( - reinterpret(value) - ), - HEADER_SIZE - ); - } + if ( + i32(byteOffset < 0) | + i32(byteOffset + 4 > this.dataLength) + ) throw new RangeError(E_INDEXOUTOFRANGE); + if (littleEndian) store(this.dataStart + byteOffset, value); + else store(this.dataStart + byteOffset, bswap(reinterpret(value))); } setFloat64(byteOffset: i32, value: f64, littleEndian: boolean = false): void { - checkOffset(byteOffset, 8, this.byteLength); - if (littleEndian) { - store(changetype(this.buffer) + this.byteOffset + byteOffset, value, HEADER_SIZE); - } else { - store(changetype(this.buffer) + this.byteOffset + byteOffset, - bswap( - reinterpret(value) - ), - HEADER_SIZE - ); - } + if ( + i32(byteOffset < 0) | + i32(byteOffset + 8 > this.dataLength) + ) throw new RangeError(E_INDEXOUTOFRANGE); + if (littleEndian) store(this.dataStart + byteOffset, value); + else store(this.dataStart + byteOffset, bswap(reinterpret(value))); } setInt8(byteOffset: i32, value: i8): void { - checkOffset(byteOffset, 1, this.byteLength); - store(changetype(this.buffer) + this.byteOffset + byteOffset, value, HEADER_SIZE); + if (byteOffset >= this.dataLength) throw new RangeError(E_INDEXOUTOFRANGE); + store(this.dataStart + byteOffset, value); } setInt16(byteOffset: i32, value: i16, littleEndian: boolean = false): void { - checkOffset(byteOffset, 2, this.byteLength); - store( - changetype(this.buffer) + this.byteOffset + byteOffset, - littleEndian ? value : bswap(value), - HEADER_SIZE - ); + if ( + i32(byteOffset < 0) | + i32(byteOffset + 2 > this.dataLength) + ) throw new RangeError(E_INDEXOUTOFRANGE); + store(this.dataStart + byteOffset, littleEndian ? value : bswap(value)); } setInt32(byteOffset: i32, value: i32, littleEndian: boolean = false): void { - checkOffset(byteOffset, 4, this.byteLength); - store( - changetype(this.buffer) + this.byteOffset + byteOffset, - littleEndian ? value : bswap(value), - HEADER_SIZE - ); + if ( + i32(byteOffset < 0) | + i32(byteOffset + 4 > this.dataLength) + ) throw new RangeError(E_INDEXOUTOFRANGE); + store(this.dataStart + byteOffset, littleEndian ? value : bswap(value)); } setUint8(byteOffset: i32, value: u8): void { - checkOffset(byteOffset, 1, this.byteLength); - store(changetype(this.buffer) + this.byteOffset + byteOffset, value, HEADER_SIZE); + if (byteOffset >= this.dataLength) throw new RangeError(E_INDEXOUTOFRANGE); + store(this.dataStart + byteOffset, value); } setUint16(byteOffset: i32, value: u16, littleEndian: boolean = false): void { - checkOffset(byteOffset, 2, this.byteLength); - store( - changetype(this.buffer) + this.byteOffset + byteOffset, - littleEndian ? value : bswap(value), - HEADER_SIZE - ); + if ( + i32(byteOffset < 0) | + i32(byteOffset + 2 > this.dataLength) + ) throw new RangeError(E_INDEXOUTOFRANGE); + store(this.dataStart + byteOffset, littleEndian ? value : bswap(value)); } setUint32(byteOffset: i32, value: u32, littleEndian: boolean = false): void { - checkOffset(byteOffset, 4, this.byteLength); - store( - changetype(this.buffer) + this.byteOffset + byteOffset, - littleEndian ? value : bswap(value), - HEADER_SIZE - ); + if ( + i32(byteOffset < 0) | + i32(byteOffset + 4 > this.dataLength) + ) throw new RangeError(E_INDEXOUTOFRANGE); + store(this.dataStart + byteOffset, littleEndian ? value : bswap(value)); } // Non-standard additions that make sense in WebAssembly, but won't work in JS: getInt64(byteOffset: i32, littleEndian: boolean = false): i64 { - checkOffset(byteOffset, 8, this.byteLength); - var result = load(changetype(this.buffer) + this.byteOffset + byteOffset, HEADER_SIZE); - return littleEndian ? result : bswap(result); + if ( + i32(byteOffset < 0) | + i32(byteOffset + 8 > this.dataLength) + ) throw new RangeError(E_INDEXOUTOFRANGE); + var result: i64 = load(this.dataStart + byteOffset); + return littleEndian ? result : bswap(result); } getUint64(byteOffset: i32, littleEndian: boolean = false): u64 { - checkOffset(byteOffset, 8, this.byteLength); - var result = load(changetype(this.buffer) + this.byteOffset + byteOffset, HEADER_SIZE); - return littleEndian ? result : bswap(result); + if ( + i32(byteOffset < 0) | + i32(byteOffset + 8 > this.dataLength) + ) throw new RangeError(E_INDEXOUTOFRANGE); + var result = load(this.dataStart + byteOffset); + return littleEndian ? result : bswap(result); } setInt64(byteOffset: i32, value: i64, littleEndian: boolean = false): void { - checkOffset(byteOffset, 8, this.byteLength); - store( - changetype(this.buffer) + this.byteOffset + byteOffset, - littleEndian ? value : bswap(value), - HEADER_SIZE - ); + if ( + i32(byteOffset < 0) | + i32(byteOffset + 8 > this.dataLength) + ) throw new RangeError(E_INDEXOUTOFRANGE); + store(this.dataStart + byteOffset, littleEndian ? value : bswap(value)); } setUint64(byteOffset: i32, value: u64, littleEndian: boolean = false): void { - checkOffset(byteOffset, 8, this.byteLength); - store( - changetype(this.buffer) + this.byteOffset + byteOffset, - littleEndian ? value : bswap(value), - HEADER_SIZE - ); + if ( + i32(byteOffset < 0) | + i32(byteOffset + 8 > this.dataLength) + ) throw new RangeError(E_INDEXOUTOFRANGE); + store(this.dataStart + byteOffset, littleEndian ? value : bswap(value)); } toString(): string { return "[object DataView]"; } } - -@inline function checkOffset(byteOffset: i32, n: i32, byteLength: i32): void { - // n and byteLength must be known to be in bounds - if (byteOffset > MAX_BLENGTH || byteOffset + n > byteLength) throw new Error("Offset out of bounds"); -} diff --git a/std/assembly/diagnostics.ts b/std/assembly/diagnostics.ts index 9e797ad187..065364db95 100644 --- a/std/assembly/diagnostics.ts +++ b/std/assembly/diagnostics.ts @@ -1,5 +1,11 @@ -/* tslint:disable */ +// @ts-ignore: decorator +@builtin +export declare function ERROR(message?: string): void; -@builtin export declare function ERROR(message?: void): void; -@builtin export declare function WARNING(message?: void): void; -@builtin export declare function INFO(message?: void): void; +// @ts-ignore: decorator +@builtin +export declare function WARNING(message?: string): void; + +// @ts-ignore: decorator +@builtin +export declare function INFO(message?: string): void; diff --git a/std/assembly/env.ts b/std/assembly/env.ts deleted file mode 100644 index 381e482c11..0000000000 --- a/std/assembly/env.ts +++ /dev/null @@ -1,16 +0,0 @@ -declare function abort( - message?: string | null, - fileName?: string | null, - lineNumber?: u32, - columnNumber?: u32 -): void; - -declare function trace( - message: string, - n?: i32, - a0?: f64, - a1?: f64, - a2?: f64, - a3?: f64, - a4?: f64 -): void; diff --git a/std/assembly/fixedarray.ts b/std/assembly/fixedarray.ts new file mode 100644 index 0000000000..7bf1b7149f --- /dev/null +++ b/std/assembly/fixedarray.ts @@ -0,0 +1,72 @@ +/// + +import { BLOCK, BLOCK_OVERHEAD, BLOCK_MAXSIZE } from "./rt/common"; +import { idof } from "./builtins"; +import { E_INDEXOUTOFRANGE, E_INVALIDLENGTH, E_HOLEYARRAY } from "./util/error"; + +// NOTE: DO NOT USE YET! + +// TODO: FixedArray with S being the static size, i.e. `new FixedArray`. +// Then hard-wire this special type to the compiler and do static length checks instead :) + +export class FixedArray { + [key: number]: T; + + constructor(length: i32) { + if (length > BLOCK_MAXSIZE >>> alignof()) throw new RangeError(E_INVALIDLENGTH); + if (isReference()) { + if (!isNullable()) { + if (length) throw new Error(E_HOLEYARRAY); + } + } + var outSize = length << alignof(); + var out = __alloc(outSize, idof>()); + memory.fill(out, 0, outSize); + return changetype>(out); // retains + } + + get length(): i32 { + return changetype(changetype(this) - BLOCK_OVERHEAD).rtSize >>> alignof(); + } + + @operator("[]") private __get(index: i32): T { + if (index >= this.length) throw new RangeError(E_INDEXOUTOFRANGE); + return this.__unchecked_get(index); + } + + @operator("[]=") private __set(index: i32, value: T): void { + if (index >= this.length) throw new RangeError(E_INDEXOUTOFRANGE); + this.__unchecked_set(index, value); + } + + @operator("{}") private __unchecked_get(index: i32): T { + return load(changetype(this) + (index << alignof())); + } + + @operator("{}=") private __unchecked_set(index: i32, value: T): void { + if (isManaged()) { + let offset = changetype(this) + (index << alignof()); + let oldValue = load(offset); + if (changetype(value) != oldValue) { + store(offset, __retain(changetype(value))); + __release(changetype(oldValue)); + } + } else { + store(changetype(this) + (index << alignof()), value); + } + } + + // RT integration + + @unsafe private __visit_impl(cookie: u32): void { + if (isManaged()) { + let cur = changetype(this); + let end = cur + changetype(changetype(this) - BLOCK_OVERHEAD).rtSize; + while (cur < end) { + let val = load(cur); + if (val) __visit(val, cookie); + cur += sizeof(); + } + } + } +} diff --git a/std/assembly/gc.ts b/std/assembly/gc.ts deleted file mode 100644 index ceaf6d98ec..0000000000 --- a/std/assembly/gc.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* tslint:disable */ - -@builtin export declare function iterateRoots(fn: (ref: usize) => void): void; - -export namespace gc { - - export function collect(): void { - if (isDefined(__gc_collect)) { __gc_collect(); return; } - WARNING("Calling 'gc.collect' requires a garbage collector to be present."); - unreachable(); - } -} diff --git a/std/assembly/heap.ts b/std/assembly/heap.ts new file mode 100644 index 0000000000..4640442d60 --- /dev/null +++ b/std/assembly/heap.ts @@ -0,0 +1,3 @@ +// @ts-ignore: decorator +@builtin +export declare const __heap_base: usize; diff --git a/std/assembly/index.d.ts b/std/assembly/index.d.ts index 68b46c256c..65a266a8af 100644 --- a/std/assembly/index.d.ts +++ b/std/assembly/index.d.ts @@ -105,19 +105,23 @@ declare const NaN: f32 | f64; /** Positive infinity as a 32-bit or 64-bit float depending on context. */ declare const Infinity: f32 | f64; /** Heap base offset. */ -declare const HEAP_BASE: usize; +declare const __heap_base: usize; /** Determines the byte size of the specified underlying core type. Compiles to a constant. */ declare function sizeof(): usize; /** Determines the alignment (log2) of the specified underlying core type. Compiles to a constant. */ declare function alignof(): usize; /** Determines the offset of the specified field within the given class type. Returns the class type's end offset if field name has been omitted. Compiles to a constant. */ declare function offsetof(fieldName?: string): usize; +/** Determines the unique runtime id of a class type. Compiles to a constant. */ +declare function idof(): u32; /** Changes the type of any value of `usize` kind to another one of `usize` kind. Useful for casting class instances to their pointer values and vice-versa. Beware that this is unsafe.*/ declare function changetype(value: any): T; /** Explicitly requests no bounds checks on the provided expression. Useful for array accesses. */ declare function unchecked(value: T): T; /** Emits a `call_indirect` instruction, calling the specified function in the function table by index with the specified arguments. Does result in a runtime error if the arguments do not match the called function. */ declare function call_indirect(target: Function | u32, ...args: any[]): T; +/** Emits a `call` instruction, calling the specified function in the function table directly with the specified arguments. Function index must be a compile-time constant. */ +declare function call_direct(target: Function | u32, ...args: any[]): T; /** Instantiates a new instance of `T` using the specified constructor arguments. */ declare function instantiate(...args: any[]): T; /** Tests if a 32-bit or 64-bit float is `NaN`. */ @@ -128,6 +132,8 @@ declare function isFinite(value: T): bool; declare function isInteger(value?: any): value is number; /** Tests if the specified type *or* expression is of a float type. Compiles to a constant. */ declare function isFloat(value?: any): value is number; +/** Tests if the specified type *or* expression is of a boolean type. */ +declare function isBoolean(value?: any): value is number; /** Tests if the specified type *or* expression can represent negative numbers. Compiles to a constant. */ declare function isSigned(value?: any): value is number; /** Tests if the specified type *or* expression is of a reference type. Compiles to a constant. */ @@ -200,7 +206,7 @@ declare enum AtomicWaitResult { } /** Converts any other numeric value to an 8-bit signed integer. */ -declare function i8(value: i8 | i16 | i32 | i64 | isize | u8 | u16 | u32 | u64 | usize | bool | f32 | f64): i8; +declare function i8(value: any): i8; declare namespace i8 { /** Smallest representable value. */ export const MIN_VALUE: i8; @@ -208,7 +214,7 @@ declare namespace i8 { export const MAX_VALUE: i8; } /** Converts any other numeric value to a 16-bit signed integer. */ -declare function i16(value: i8 | i16 | i32 | i64 | isize | u8 | u16 | u32 | u64 | usize | bool | f32 | f64): i8; +declare function i16(value: any): i8; declare namespace i16 { /** Smallest representable value. */ export const MIN_VALUE: i16; @@ -216,7 +222,7 @@ declare namespace i16 { export const MAX_VALUE: i16; } /** Converts any other numeric value to a 32-bit signed integer. */ -declare function i32(value: i8 | i16 | i32 | i64 | isize | u8 | u16 | u32 | u64 | usize | bool | f32 | f64): i32; +declare function i32(value: any): i32; declare namespace i32 { /** Smallest representable value. */ export const MIN_VALUE: i32; @@ -308,7 +314,7 @@ declare namespace i32 { } } /** Converts any other numeric value to a 64-bit signed integer. */ -declare function i64(value: i8 | i16 | i32 | i64 | isize | u8 | u16 | u32 | u64 | usize | bool | f32 | f64): i64; +declare function i64(value: any): i64; declare namespace i64 { /** Smallest representable value. */ export const MIN_VALUE: i64; @@ -429,7 +435,7 @@ declare namespace i64 { /** Converts any other numeric value to a 32-bit (in WASM32) respectivel 64-bit (in WASM64) signed integer. */ declare var isize: typeof i32 | typeof i64; /** Converts any other numeric value to an 8-bit unsigned integer. */ -declare function u8(value: i8 | i16 | i32 | i64 | isize | u8 | u16 | u32 | u64 | usize | bool | f32 | f64): i8; +declare function u8(value: any): i8; declare namespace u8 { /** Smallest representable value. */ export const MIN_VALUE: u8; @@ -437,7 +443,7 @@ declare namespace u8 { export const MAX_VALUE: u8; } /** Converts any other numeric value to a 16-bit unsigned integer. */ -declare function u16(value: i8 | i16 | i32 | i64 | isize | u8 | u16 | u32 | u64 | usize | bool | f32 | f64): i8; +declare function u16(value: any): i8; declare namespace u16 { /** Smallest representable value. */ export const MIN_VALUE: u16; @@ -445,7 +451,7 @@ declare namespace u16 { export const MAX_VALUE: u16; } /** Converts any other numeric value to a 32-bit unsigned integer. */ -declare function u32(value: i8 | i16 | i32 | i64 | isize | u8 | u16 | u32 | u64 | usize | bool | f32 | f64): i32; +declare function u32(value: any): i32; declare namespace u32 { /** Smallest representable value. */ export const MIN_VALUE: u32; @@ -453,7 +459,7 @@ declare namespace u32 { export const MAX_VALUE: u32; } /** Converts any other numeric value to a 64-bit unsigned integer. */ -declare function u64(value: i8 | i16 | i32 | i64 | isize | u8 | u16 | u32 | u64 | usize | bool | f32 | f64): i64; +declare function u64(value: any): i64; declare namespace u64 { /** Smallest representable value. */ export const MIN_VALUE: u64; @@ -463,7 +469,7 @@ declare namespace u64 { /** Converts any other numeric value to a 32-bit (in WASM32) respectivel 64-bit (in WASM64) unsigned integer. */ declare var usize: typeof u32 | typeof u64; /** Converts any other numeric value to a 1-bit unsigned integer. */ -declare function bool(value: i8 | i16 | i32 | i64 | isize | u8 | u16 | u32 | u64 | usize | bool | f32 | f64): bool; +declare function bool(value: any): bool; declare namespace bool { /** Smallest representable value. */ export const MIN_VALUE: bool; @@ -471,7 +477,7 @@ declare namespace bool { export const MAX_VALUE: bool; } /** Converts any other numeric value to a 32-bit float. */ -declare function f32(value: i8 | i16 | i32 | i64 | isize | u8 | u16 | u32 | u64 | usize | bool | f32 | f64): f32; +declare function f32(value: any): f32; declare namespace f32 { /** Smallest representable value. */ export const MIN_VALUE: f32; @@ -491,7 +497,7 @@ declare namespace f32 { export function store(offset: usize, value: f32, immOffset?: usize, immAlign?: usize): void; } /** Converts any other numeric value to a 64-bit float. */ -declare function f64(value: i8 | i16 | i32 | i64 | isize | u8 | u16 | u32 | u64 | usize | bool | f32 | f64): f64; +declare function f64(value: any): f64; declare namespace f64 { /** Smallest representable value. */ export const MIN_VALUE: f64; @@ -533,7 +539,7 @@ declare namespace v128 { export function mul(a: v128, b: v128): v128; // except i64 /** Divides each lane of two 128-bit vectors. */ export function div(a: v128, b: v128): v128; - /** Negates each lane of a 128-bit vector */ + /** Negates each lane of a 128-bit vector. */ export function neg(a: v128): v128; /** Adds each lane of two 128-bit vectors using saturation. */ export function add_saturate(a: v128, b: v128): v128; @@ -968,6 +974,8 @@ declare function bswap16(value: T): T; /** Memory operations. */ declare namespace memory { + /** Whether the memory managed interface is implemented. */ + export const implemented: bool; /** Returns the current memory size in units of pages. One page is 64kb. */ export function size(): i32; /** Grows linear memory by a given unsigned delta of pages. One page is 64kb. Returns the previous memory size in units of pages or `-1` on failure. */ @@ -976,48 +984,46 @@ declare namespace memory { export function fill(dst: usize, value: u8, count: usize): void; /** Copies n bytes from the specified source to the specified destination in memory. These regions may overlap. */ export function copy(dst: usize, src: usize, n: usize): void; + /** Repeats `src` of length `srcLength` `count` times at `dst`. */ + export function repeat(dst: usize, src: usize, srcLength: usize, count: usize): void; /** Copies elements from a passive element segment to a table. */ - // export function init(segmentIndex: u32, srcOffset: usize, dstOffset: usize, n: usize): void; + export function init(segmentIndex: u32, srcOffset: usize, dstOffset: usize, n: usize): void; /** Prevents further use of a passive element segment. */ - // export function drop(segmentIndex: u32): void; - /** Copies elements from one region of a table to another region. */ - export function allocate(size: usize): usize; - /** Disposes a chunk of memory by its pointer. */ - export function free(ptr: usize): void; + export function drop(segmentIndex: u32): void; /** Compares two chunks of memory. Returns `0` if equal, otherwise the difference of the first differing bytes. */ export function compare(vl: usize, vr: usize, n: usize): i32; - /** Resets the allocator to its initial state, if supported. */ - export function reset(): void; } /** Garbage collector operations. */ declare namespace gc { - /** Allocates a managed object identified by its visitor function. */ - export function allocate(size: usize, visitFn: (ref: usize) => void): usize; + /** Whether the garbage collector interface is implemented. */ + export const implemented: bool; /** Performs a full garbage collection cycle. */ export function collect(): void; + /** Retains a reference, making sure that it doesn't become collected. */ + export function retain(ref: usize): void; + /** Releases a reference, allowing it to become collected. */ + export function release(ref: usize): void; } /** Table operations. */ declare namespace table { /** Copies elements from a passive element segment to a table. */ - // export function init(elementIndex: u32, srcOffset: u32, dstOffset: u32, n: u32): void; + export function init(elementIndex: u32, srcOffset: u32, dstOffset: u32, n: u32): void; /** Prevents further use of a passive element segment. */ - // export function drop(elementIndex: u32): void; + export function drop(elementIndex: u32): void; /** Copies elements from one region of a table to another region. */ - // export function copy(dest: u32, src: u32, n: u32): void; + export function copy(dest: u32, src: u32, n: u32): void; } /** Class representing a generic, fixed-length raw binary data buffer. */ declare class ArrayBuffer { /** The size, in bytes, of the array. */ readonly byteLength: i32; - /** Unsafe pointer to the start of the data in memory. */ - readonly data: usize; /** Returns true if value is one of the ArrayBuffer views, such as typed array or a DataView **/ static isView(value: T): bool; /** Constructs a new array buffer of the given length in bytes. */ - constructor(length: i32, unsafe?: bool); + constructor(length: i32); /** Returns a copy of this array buffer's bytes from begin, inclusive, up to end, exclusive. */ slice(begin?: i32, end?: i32): ArrayBuffer; /** Returns a string representation of ArrayBuffer. */ @@ -1165,12 +1171,15 @@ declare class Float64Array extends TypedArray {} /** Class representing a sequence of values of type `T`. */ declare class Array { + /** Tests if a value is an array. */ static isArray(value: any): value is Array; + /** Creates a new array with at least the specified capacity and length zero. */ + static create(capacity?: i32): Array; [key: number]: T; /** Current length of the array. */ length: i32; - /** Constructs a new array. */ + /** Constructs a new array. If length is greater than zero and T is a non-nullable reference, use `Array.create` instead.*/ constructor(capacity?: i32); fill(value: T, start?: i32, end?: i32): this; @@ -1199,6 +1208,13 @@ declare class Array { toString(): string; } +/** Class representing a fixed sequence of values of type `T`. */ +declare class FixedArray { + [key: number]: T; + readonly length: i32; + constructor(capacity?: i32); +} + /** Class representing a sequence of characters. */ declare class String { @@ -1277,15 +1293,18 @@ declare class Map { get(key: K): V; delete(key: K): bool; clear(): void; + keys(): K[]; // preliminary + values(): V[]; // preliminary toString(): string; } -declare class Set { +declare class Set { readonly size: i32; - has(value: T): bool; - add(value: T): void; - delete(value: T): bool; + has(value: K): bool; + add(value: K): void; + delete(value: K): bool; clear(): void; + values(): K[]; // preliminary toString(): string; } @@ -1332,7 +1351,7 @@ interface IMath { acos(x: T): T; /** Returns the hyperbolic arc-cosine of `x`. */ acosh(x: T): T; - /** Returns the arcsine (in radians) of `x` */ + /** Returns the arcsine (in radians) of `x`. */ asin(x: T): T; /** Returns the hyperbolic arcsine of `x`. */ asinh(x: T): T; @@ -1359,7 +1378,7 @@ interface IMath { /** Returns the largest integer less than or equal to `x`. */ floor(x: T): T; /** Returns the nearest 32-bit single precision float representation of `x`. */ - fround(x: T): f32; + fround(x: T): T; /** Returns the square root of the sum of squares of its arguments. */ hypot(value1: T, value2: T): T; // TODO: rest /** Returns the result of the C-like 32-bit multiplication of `a` and `b`. */ @@ -1384,7 +1403,7 @@ interface IMath { round(x: T): T; /** Returns the sign of `x`, indicating whether the number is positive, negative or zero. */ sign(x: T): T; - /** Returns whether the sign bit of `x` is set */ + /** Returns whether the sign bit of `x` is set. */ signbit(x: T): bool; /** Returns the sine of `x`. */ sin(x: T): T; @@ -1461,13 +1480,6 @@ interface TypedPropertyDescriptor { set?(value: T): void; } -/** Annotates an element as a program global. */ -declare function global( - target: any, - propertyKey: string, - descriptor: TypedPropertyDescriptor -): TypedPropertyDescriptor | void; - /** Annotates a method as a binary operator overload for the specified `token`. */ declare function operator(token: "[]" | "[]=" | "{}" | "{}=" | "==" | "!=" | ">" | "<" | "<=" | ">=" | @@ -1502,6 +1514,9 @@ declare namespace operator { ) => TypedPropertyDescriptor | void; } +/** Annotates an element as a program global. */ +declare function global(...args: any[]): any; + /** Annotates a class as being unmanaged with limited capabilities. */ declare function unmanaged(constructor: Function): void; @@ -1509,29 +1524,16 @@ declare function unmanaged(constructor: Function): void; declare function sealed(constructor: Function): void; /** Annotates a method, function or constant global as always inlined. */ -declare function inline( - target: any, - propertyKey: string, - descriptor: TypedPropertyDescriptor -): TypedPropertyDescriptor | void; +declare function inline(...args: any[]): any; + +/** Annotates a method, function or constant global as unsafe. */ +declare function unsafe(...args: any[]): any; /** Annotates an explicit external name of a function or global. */ -declare function external(namespace: string, name: string): ( - target: any, - propertyKey: string, - descriptor: TypedPropertyDescriptor -) => TypedPropertyDescriptor | void; +declare function external(...args: any[]): any; /** Annotates a global for lazy compilation. */ -declare function lazy( - target: any, - propertyKey: string, - descriptor: TypedPropertyDescriptor -): TypedPropertyDescriptor | void; +declare function lazy(...args: any[]): any; /** Annotates a function as the explicit start function. */ -declare function start( - target: any, - propertyKey: string, - descriptor: TypedPropertyDescriptor -): TypedPropertyDescriptor | void; +declare function start(...args: any[]): any; diff --git a/std/assembly/internal/allocator.ts b/std/assembly/internal/allocator.ts deleted file mode 100644 index 508710c6cf..0000000000 --- a/std/assembly/internal/allocator.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** Number of alignment bits. */ -@inline export const AL_BITS: u32 = 3; -/** Number of possible alignment values. */ -@inline export const AL_SIZE: usize = 1 << AL_BITS; -/** Mask to obtain just the alignment bits. */ -@inline export const AL_MASK: usize = AL_SIZE - 1; -/** Maximum 32-bit allocation size. */ -@inline export const MAX_SIZE_32: usize = 1 << 30; // 1GB diff --git a/std/assembly/internal/arraybuffer.ts b/std/assembly/internal/arraybuffer.ts deleted file mode 100644 index 4545d8e0d3..0000000000 --- a/std/assembly/internal/arraybuffer.ts +++ /dev/null @@ -1,84 +0,0 @@ -import { - AL_MASK, - MAX_SIZE_32 - } from "./allocator"; - -/** Size of an ArrayBuffer header. */ -@inline export const HEADER_SIZE: usize = (offsetof() + AL_MASK) & ~AL_MASK; -/** Maximum byte length of an ArrayBuffer. */ -@inline export const MAX_BLENGTH: i32 = MAX_SIZE_32 - HEADER_SIZE; - -function computeSize(byteLength: i32): usize { - // round up to power of 2, with HEADER_SIZE=8: - // 0 -> 2^3 = 8 - // 1..8 -> 2^4 = 16 - // 9..24 -> 2^5 = 32 - // ... - // MAX_LENGTH -> 2^30 = 0x40000000 (MAX_SIZE_32) - return 1 << (32 - clz(byteLength + HEADER_SIZE - 1)); -} - -// Low-level utility - -function __gc(ref: usize): void {} - -export function allocateUnsafe(byteLength: i32): ArrayBuffer { - assert(byteLength <= MAX_BLENGTH); - var buffer: usize; - if (isManaged()) { - buffer = __gc_allocate(computeSize(byteLength), __gc); // tslint:disable-line - } else { - buffer = memory.allocate(computeSize(byteLength)); - } - store(buffer, byteLength, offsetof("byteLength")); - return changetype(buffer); -} - -export function reallocateUnsafe(buffer: ArrayBuffer, newByteLength: i32): ArrayBuffer { - var oldByteLength = buffer.byteLength; - if (newByteLength > oldByteLength) { - assert(newByteLength <= MAX_BLENGTH); - if (newByteLength <= (computeSize(oldByteLength) - HEADER_SIZE)) { // fast path: zero out additional space - store(changetype(buffer), newByteLength, offsetof("byteLength")); - } else { // slow path: copy to new buffer - let newBuffer = allocateUnsafe(newByteLength); - memory.copy( - changetype(newBuffer) + HEADER_SIZE, - changetype(buffer) + HEADER_SIZE, - oldByteLength - ); - if (!isManaged()) { - memory.free(changetype(buffer)); - } - buffer = newBuffer; - } - memory.fill( - changetype(buffer) + HEADER_SIZE + oldByteLength, - 0, - (newByteLength - oldByteLength) - ); - } else if (newByteLength < oldByteLength) { // fast path: override size - // TBD: worth to copy and release if size is significantly less than before? - assert(newByteLength >= 0); - store(changetype(buffer), newByteLength, offsetof("byteLength")); - } - return buffer; -} - -// The helpers below use two different types in order to emit loads and stores that load respectively -// store one type to/from memory while returning/taking the desired output/input type. This allows to -// emit instructions like -// -// * `i32.load8` ^= `load(...)` that reads an i8 but returns an i32, or -// * `i64.load32_s` ^= `load(...)`) that reads a 32-bit as a 64-bit integer -// -// without having to emit an additional instruction for conversion purposes. The second parameter -// can be omitted for references and other loads and stores that simply return the exact type. - -@inline export function LOAD(buffer: ArrayBuffer, index: i32, byteOffset: i32 = 0): TOut { - return load(changetype(buffer) + (index << alignof()) + byteOffset, HEADER_SIZE); -} - -@inline export function STORE(buffer: ArrayBuffer, index: i32, value: TIn, byteOffset: i32 = 0): void { - store(changetype(buffer) + (index << alignof()) + byteOffset, value, HEADER_SIZE); -} diff --git a/std/assembly/internal/memory.ts b/std/assembly/internal/memory.ts deleted file mode 100644 index ea240fb80f..0000000000 --- a/std/assembly/internal/memory.ts +++ /dev/null @@ -1,254 +0,0 @@ -// this function will go away once `memory.copy` becomes an intrinsic -export function memcpy(dest: usize, src: usize, n: usize): void { // see: musl/src/string/memcpy.c - var w: u32, x: u32; - - // copy 1 byte each until src is aligned to 4 bytes - while (n && (src & 3)) { - store(dest++, load(src++)); - n--; - } - - // if dst is aligned to 4 bytes as well, copy 4 bytes each - if ((dest & 3) == 0) { - while (n >= 16) { - store(dest , load(src )); - store(dest + 4, load(src + 4)); - store(dest + 8, load(src + 8)); - store(dest + 12, load(src + 12)); - src += 16; dest += 16; n -= 16; - } - if (n & 8) { - store(dest , load(src )); - store(dest + 4, load(src + 4)); - dest += 8; src += 8; - } - if (n & 4) { - store(dest, load(src)); - dest += 4; src += 4; - } - if (n & 2) { // drop to 2 bytes each - store(dest, load(src)); - dest += 2; src += 2; - } - if (n & 1) { // drop to 1 byte - store(dest++, load(src++)); - } - return; - } - - // if dst is not aligned to 4 bytes, use alternating shifts to copy 4 bytes each - // doing shifts if faster when copying enough bytes (here: 32 or more) - if (n >= 32) { - switch (dest & 3) { - // known to be != 0 - case 1: { - w = load(src); - store(dest++, load(src++)); - store(dest++, load(src++)); - store(dest++, load(src++)); - n -= 3; - while (n >= 17) { - x = load(src + 1); - store(dest, w >> 24 | x << 8); - w = load(src + 5); - store(dest + 4, x >> 24 | w << 8); - x = load(src + 9); - store(dest + 8, w >> 24 | x << 8); - w = load(src + 13); - store(dest + 12, x >> 24 | w << 8); - src += 16; dest += 16; n -= 16; - } - break; - } - case 2: { - w = load(src); - store(dest++, load(src++)); - store(dest++, load(src++)); - n -= 2; - while (n >= 18) { - x = load(src + 2); - store(dest, w >> 16 | x << 16); - w = load(src + 6); - store(dest + 4, x >> 16 | w << 16); - x = load(src + 10); - store(dest + 8, w >> 16 | x << 16); - w = load(src + 14); - store(dest + 12, x >> 16 | w << 16); - src += 16; dest += 16; n -= 16; - } - break; - } - case 3: { - w = load(src); - store(dest++, load(src++)); - n -= 1; - while (n >= 19) { - x = load(src + 3); - store(dest, w >> 8 | x << 24); - w = load(src + 7); - store(dest + 4, x >> 8 | w << 24); - x = load(src + 11); - store(dest + 8, w >> 8 | x << 24); - w = load(src + 15); - store(dest + 12, x >> 8 | w << 24); - src += 16; dest += 16; n -= 16; - } - break; - } - } - } - - // copy remaining bytes one by one - if (n & 16) { - store(dest++, load(src++)); - store(dest++, load(src++)); - store(dest++, load(src++)); - store(dest++, load(src++)); - store(dest++, load(src++)); - store(dest++, load(src++)); - store(dest++, load(src++)); - store(dest++, load(src++)); - store(dest++, load(src++)); - store(dest++, load(src++)); - store(dest++, load(src++)); - store(dest++, load(src++)); - store(dest++, load(src++)); - store(dest++, load(src++)); - store(dest++, load(src++)); - store(dest++, load(src++)); - } - if (n & 8) { - store(dest++, load(src++)); - store(dest++, load(src++)); - store(dest++, load(src++)); - store(dest++, load(src++)); - store(dest++, load(src++)); - store(dest++, load(src++)); - store(dest++, load(src++)); - store(dest++, load(src++)); - } - if (n & 4) { - store(dest++, load(src++)); - store(dest++, load(src++)); - store(dest++, load(src++)); - store(dest++, load(src++)); - } - if (n & 2) { - store(dest++, load(src++)); - store(dest++, load(src++)); - } - if (n & 1) { - store(dest++, load(src++)); - } -} - -// this function will go away once `memory.copy` becomes an intrinsic -export function memmove(dest: usize, src: usize, n: usize): void { // see: musl/src/string/memmove.c - if (dest === src) return; - if (src + n <= dest || dest + n <= src) { - memcpy(dest, src, n); - return; - } - if (dest < src) { - if ((src & 7) == (dest & 7)) { - while (dest & 7) { - if (!n) return; - --n; - store(dest++, load(src++)); - } - while (n >= 8) { - store(dest, load(src)); - n -= 8; - dest += 8; - src += 8; - } - } - while (n) { - store(dest++, load(src++)); - --n; - } - } else { - if ((src & 7) == (dest & 7)) { - while ((dest + n) & 7) { - if (!n) return; - store(dest + --n, load(src + n)); - } - while (n >= 8) { - n -= 8; - store(dest + n, load(src + n)); - } - } - while (n) { - store(dest + --n, load(src + n)); - } - } -} - -// this function will go away once `memory.fill` becomes an intrinsic -export function memset(dest: usize, c: u8, n: usize): void { // see: musl/src/string/memset - - // fill head and tail with minimal branching - if (!n) return; - store(dest, c); - store(dest + n - 1, c); - if (n <= 2) return; - - store(dest + 1, c); - store(dest + 2, c); - store(dest + n - 2, c); - store(dest + n - 3, c); - if (n <= 6) return; - store(dest + 3, c); - store(dest + n - 4, c); - if (n <= 8) return; - - // advance pointer to align it at 4-byte boundary - var k: usize = -dest & 3; - dest += k; - n -= k; - n &= -4; - - var c32: u32 = -1 / 255 * c; - - // fill head/tail up to 28 bytes each in preparation - store(dest, c32); - store(dest + n - 4, c32); - if (n <= 8) return; - store(dest + 4, c32); - store(dest + 8, c32); - store(dest + n - 12, c32); - store(dest + n - 8, c32); - if (n <= 24) return; - store(dest + 12, c32); - store(dest + 16, c32); - store(dest + 20, c32); - store(dest + 24, c32); - store(dest + n - 28, c32); - store(dest + n - 24, c32); - store(dest + n - 20, c32); - store(dest + n - 16, c32); - - // align to a multiple of 8 - k = 24 + (dest & 4); - dest += k; - n -= k; - - // copy 32 bytes each - var c64: u64 = c32 | (c32 << 32); - while (n >= 32) { - store(dest, c64); - store(dest + 8, c64); - store(dest + 16, c64); - store(dest + 24, c64); - n -= 32; - dest += 32; - } -} - -export function memcmp(vl: usize, vr: usize, n: usize): i32 { // see: musl/src/string/memcmp.c - if (vl == vr) return 0; - while (n != 0 && load(vl) == load(vr)) { - n--; vl++; vr++; - } - return n ? load(vl) - load(vr) : 0; -} diff --git a/std/assembly/internal/sort.ts b/std/assembly/internal/sort.ts deleted file mode 100644 index 8d50efb115..0000000000 --- a/std/assembly/internal/sort.ts +++ /dev/null @@ -1,152 +0,0 @@ -import { - LOAD, - STORE -} from "./arraybuffer"; - -import { - compareUnsafe -} from "./string"; - -/** Obtains the default comparator for the specified value type. */ -@inline -export function COMPARATOR(): (a: T, b: T) => i32 { - if (isInteger()) { - if (isSigned() && sizeof() <= 4) { - return (a: T, b: T): i32 => ((a - b)); - } else { - return (a: T, b: T): i32 => ((a > b) - (a < b)); - } - } else if (isFloat()) { - if (sizeof() == 4) { - return (a: T, b: T): i32 => { - var ia = reinterpret(a); - var ib = reinterpret(b); - ia ^= (ia >> 31) >>> 1; - ib ^= (ib >> 31) >>> 1; - return (ia > ib) - (ia < ib); - }; - } else { - return (a: T, b: T): i32 => { - var ia = reinterpret(a); - var ib = reinterpret(b); - ia ^= (ia >> 63) >>> 1; - ib ^= (ib >> 63) >>> 1; - return (ia > ib) - (ia < ib); - }; - } - } else if (isString()) { - return (a: T, b: T): i32 => { - if (a === b || a === null || b === null) return 0; - var alen = (a).length; - var blen = (b).length; - if (!alen && !blen) return 0; - if (!alen) return -1; - if (!blen) return 1; - return compareUnsafe(a, 0, b, 0, min(alen, blen)); - }; - } else { - return (a: T, b: T): i32 => ((a > b) - (a < b)); - } -} - -@inline -export function SORT( - buffer: ArrayBuffer, - byteOffset: i32, - length: i32, - comparator: (a: T, b: T) => i32 -): void { - if (isReference()) { - // TODO replace this to faster stable sort (TimSort) when it implemented - insertionSort(buffer, byteOffset, length, comparator); - } else { - if (length < 256) { - insertionSort(buffer, byteOffset, length, comparator); - } else { - weakHeapSort(buffer, byteOffset, length, comparator); - } - } -} - -/** Sorts an Array with the 'Insertion Sort' algorithm. */ -function insertionSort( - buffer: ArrayBuffer, - byteOffset: i32, - length: i32, - comparator: (a: T, b: T) => i32 -): void { - for (let i = 0; i < length; i++) { - let a = LOAD(buffer, i, byteOffset); // a = arr[i] - let j = i - 1; - while (j >= 0) { - let b = LOAD(buffer, j, byteOffset); // b = arr[j] - if (comparator(a, b) < 0) { - STORE(buffer, j-- + 1, b, byteOffset); // arr[j + 1] = b - } else break; - } - STORE(buffer, j + 1, a, byteOffset); // arr[j + 1] = a - } -} - -/** Sorts an Array with the 'Weak Heap Sort' algorithm. */ -function weakHeapSort( - buffer: ArrayBuffer, - byteOffset: i32, - length: i32, - comparator: (a: T, b: T) => i32 -): void { - const shift32 = alignof(); - - var bitsetSize = (length + 31) >> 5 << shift32; - var bitset = memory.allocate(bitsetSize); // indexed in 32-bit chunks below - memory.fill(bitset, 0, bitsetSize); - - // see: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.21.1863&rep=rep1&type=pdf - - for (let i = length - 1; i > 0; i--) { - let j = i; - while ((j & 1) == (load(bitset + (j >> 6 << shift32)) >> (j >> 1 & 31) & 1)) j >>= 1; - - let p = j >> 1; - let a = LOAD(buffer, p, byteOffset); // a = arr[p] - let b = LOAD(buffer, i, byteOffset); // b = arr[i] - if (comparator(a, b) < 0) { - store( - bitset + (i >> 5 << shift32), - load(bitset + (i >> 5 << shift32)) ^ (1 << (i & 31)) - ); - STORE(buffer, i, a, byteOffset); // arr[i] = a - STORE(buffer, p, b, byteOffset); // arr[p] = b - } - } - - for (let i = length - 1; i >= 2; i--) { - let a = LOAD(buffer, 0, byteOffset); - STORE(buffer, 0, LOAD(buffer, i, byteOffset), byteOffset); - STORE(buffer, i, a, byteOffset); - - let x = 1, y: i32; - while ((y = (x << 1) + ((load(bitset + (x >> 5 << shift32)) >> (x & 31)) & 1)) < i) x = y; - - while (x > 0) { - a = LOAD(buffer, 0, byteOffset); // a = arr[0] - let b = LOAD(buffer, x, byteOffset); // b = arr[x] - - if (comparator(a, b) < 0) { - store( - bitset + (x >> 5 << shift32), - load(bitset + (x >> 5 << shift32)) ^ (1 << (x & 31)) - ); - STORE(buffer, x, a, byteOffset); // arr[x] = a - STORE(buffer, 0, b, byteOffset); // arr[0] = b - } - x >>= 1; - } - } - - memory.free(bitset); - - var t = LOAD(buffer, 1, byteOffset); // t = arr[1] - STORE(buffer, 1, LOAD(buffer, 0, byteOffset), byteOffset); - STORE(buffer, 0, t, byteOffset); // arr[0] = t -} diff --git a/std/assembly/internal/string.ts b/std/assembly/internal/string.ts deleted file mode 100644 index 7d903c498b..0000000000 --- a/std/assembly/internal/string.ts +++ /dev/null @@ -1,225 +0,0 @@ -import { MAX_SIZE_32 } from "./allocator"; -import { String } from "../string"; - -/** Size of a String header. */ -@inline export const HEADER_SIZE = (offsetof() + 1) & ~1; // 2 byte aligned -/** Maximum length of a String. */ -@inline export const MAX_LENGTH = (MAX_SIZE_32 - HEADER_SIZE) >>> 1; - -// Low-level utility - -function __gc(ref: usize): void {} - -export function allocateUnsafe(length: i32): String { - assert(length > 0 && length <= MAX_LENGTH); - var buffer: usize; - if (isManaged()) { - buffer = __gc_allocate(HEADER_SIZE + (length << 1), __gc); // tslint:disable-line - } else { - buffer = memory.allocate(HEADER_SIZE + (length << 1)); - } - store(buffer, length); - return changetype(buffer); -} - -@inline -export function freeUnsafe(buffer: String): void { - if (!isManaged()) { - assert(buffer); - memory.free(changetype(buffer)); - } -} - -export function copyUnsafe(dest: String, destOffset: usize, src: String, srcOffset: usize, len: usize): void { - memory.copy( - changetype(dest) + (destOffset << 1) + HEADER_SIZE, - changetype(src) + (srcOffset << 1) + HEADER_SIZE, - len << 1 - ); -} - -export function compareUnsafe(str1: String, offset1: usize, str2: String, offset2: usize, len: usize): i32 { - var cmp: i32 = 0; - var ptr1 = changetype(str1) + (offset1 << 1); - var ptr2 = changetype(str2) + (offset2 << 1); - while (len && !(cmp = load(ptr1, HEADER_SIZE) - load(ptr2, HEADER_SIZE))) { - --len, ptr1 += 2, ptr2 += 2; - } - return cmp; -} - -export function repeatUnsafe(dest: String, destOffset: usize, src: String, count: i32): void { - var length = src.length; - if (ASC_SHRINK_LEVEL > 1) { - let strLen = length << 1; - let to = changetype(dest) + HEADER_SIZE + (destOffset << 1); - let from = changetype(src) + HEADER_SIZE; - for (let i = 0, len = strLen * count; i < len; i += strLen) { - memory.copy(to + i, from, strLen); - } - } else { - switch (length) { - case 0: break; - case 1: { - let cc = load(changetype(src), HEADER_SIZE); - let out = changetype(dest) + (destOffset << 1); - for (let i = 0; i < count; ++i) { - store(out + (i << 1), cc, HEADER_SIZE); - } - break; - } - case 2: { - let cc = load(changetype(src), HEADER_SIZE); - let out = changetype(dest) + (destOffset << 1); - for (let i = 0; i < count; ++i) { - store(out + (i << 2), cc, HEADER_SIZE); - } - break; - } - case 3: { - let cc1 = load(changetype(src), HEADER_SIZE + 0); - let cc2 = load(changetype(src), HEADER_SIZE + 4); - let out = changetype(dest) + (destOffset << 1); - for (let i = 0; i < count; ++i) { - store(out + (i << 2), cc1, HEADER_SIZE + 0); - store(out + (i << 1), cc2, HEADER_SIZE + 4); - } - break; - } - case 4: { - let cc = load(changetype(src), HEADER_SIZE); - let out = changetype(dest) + (destOffset << 1); - for (let i = 0; i < count; ++i) { - store(out + (i << 3), cc, HEADER_SIZE); - } - break; - } - default: { - let strLen = length << 1; - let to = changetype(dest) + HEADER_SIZE + (destOffset << 1); - let from = changetype(src) + HEADER_SIZE; - for (let i = 0, len = strLen * count; i < len; i += strLen) { - memory.copy(to + i, from, strLen); - } - break; - } - } - } -} - -// Helpers - -@inline export const enum CharCode { - PLUS = 0x2B, - MINUS = 0x2D, - DOT = 0x2E, - _0 = 0x30, - _1 = 0x31, - _2 = 0x32, - _3 = 0x33, - _4 = 0x34, - _5 = 0x35, - _6 = 0x36, - _7 = 0x37, - _8 = 0x38, - _9 = 0x39, - A = 0x41, - B = 0x42, - E = 0x45, - N = 0x4E, - O = 0x4F, - X = 0x58, - Z = 0x5a, - a = 0x61, - b = 0x62, - e = 0x65, - n = 0x6E, - o = 0x6F, - x = 0x78, - z = 0x7A -} - -export function isWhiteSpaceOrLineTerminator(c: u16): bool { - switch (c) { - case 9: // - case 10: // - case 13: // - case 11: // - case 12: // - case 32: // - case 160: // - case 8232: // - case 8233: // - case 65279: return true; // - default: return false; - } -} - -/** Parses a string to an integer (usually), using the specified radix. */ -export function parse(str: String, radix: i32 = 0): T { - var len: i32 = str.length; - if (!len) return NaN; - - var ptr = changetype(str) /* + HEAD -> offset */; - var code = load(ptr, HEADER_SIZE); - - // determine sign - var sign: T; - if (code == CharCode.MINUS) { - if (!--len) return NaN; - code = load(ptr += 2, HEADER_SIZE); - sign = -1; - } else if (code == CharCode.PLUS) { - if (!--len) return NaN; - code = load(ptr += 2, HEADER_SIZE); - sign = 1; - } else { - sign = 1; - } - - // determine radix - if (!radix) { - if (code == CharCode._0 && len > 2) { - switch (load(ptr + 2, HEADER_SIZE)) { - case CharCode.B: - case CharCode.b: { - ptr += 4; len -= 2; - radix = 2; - break; - } - case CharCode.O: - case CharCode.o: { - ptr += 4; len -= 2; - radix = 8; - break; - } - case CharCode.X: - case CharCode.x: { - ptr += 4; len -= 2; - radix = 16; - break; - } - default: radix = 10; - } - } else radix = 10; - } else if (radix < 2 || radix > 36) { - return NaN; - } - - // calculate value - var num: T = 0; - while (len--) { - code = load(ptr, HEADER_SIZE); - if (code >= CharCode._0 && code <= CharCode._9) { - code -= CharCode._0; - } else if (code >= CharCode.A && code <= CharCode.Z) { - code -= CharCode.A - 10; - } else if (code >= CharCode.a && code <= CharCode.z) { - code -= CharCode.a - 10; - } else break; - if (code >= radix) break; - num = (num * radix) + code; - ptr += 2; - } - return sign * num; -} diff --git a/std/assembly/internal/typedarray.ts b/std/assembly/internal/typedarray.ts deleted file mode 100644 index 0fb265ae69..0000000000 --- a/std/assembly/internal/typedarray.ts +++ /dev/null @@ -1,259 +0,0 @@ -import { - HEADER_SIZE as AB_HEADER_SIZE, - MAX_BLENGTH as AB_MAX_BLENGTH, - allocateUnsafe, - LOAD, - STORE -} from "./arraybuffer"; - -import { - SORT as SORT_IMPL -} from "./sort"; - -/** Typed array base class. Not a global object. */ -export abstract class TypedArray { - [key: number]: T; // compatibility only - - readonly buffer: ArrayBuffer; - readonly byteOffset: i32; - readonly byteLength: i32; - - constructor(length: i32) { - const MAX_LENGTH = AB_MAX_BLENGTH / sizeof(); - if (length > MAX_LENGTH) throw new RangeError("Invalid typed array length"); - var byteLength = length << alignof(); - var buffer = allocateUnsafe(byteLength); - memory.fill(changetype(buffer) + AB_HEADER_SIZE, 0, byteLength); - this.buffer = buffer; - this.byteOffset = 0; - this.byteLength = byteLength; - } - - @inline - get length(): i32 { - return this.byteLength >>> alignof(); - } - - @operator("[]") - protected __get(index: i32): T { - if (index >= (this.byteLength >>> alignof())) throw new Error("Index out of bounds"); - return LOAD(this.buffer, index, this.byteOffset); - } - - @inline @operator("{}") - protected __unchecked_get(index: i32): T { - return LOAD(this.buffer, index, this.byteOffset); - } - - @operator("[]=") - protected __set(index: i32, value: native): void { - if (index >= (this.byteLength >>> alignof())) throw new Error("Index out of bounds"); - STORE>(this.buffer, index, value, this.byteOffset); - } - - @inline @operator("{}=") - protected __unchecked_set(index: i32, value: native): void { - STORE>(this.buffer, index, value, this.byteOffset); - } - - // copyWithin(target: i32, start: i32, end: i32 = this.length): this -} - -@inline -export function FILL, T extends number>( - array: TArray, - value: native, - start: i32, - end: i32 -): TArray { - var buffer = array.buffer; - var byteOffset = array.byteOffset; - var len = array.length; - start = start < 0 ? max(len + start, 0) : min(start, len); - end = end < 0 ? max(len + end, 0) : min(end, len); - if (sizeof() == 1) { - if (start < end) { - memory.fill( - changetype(buffer) + start + byteOffset + AB_HEADER_SIZE, - value, - (end - start) - ); - } - } else { - for (; start < end; ++start) { - STORE>(buffer, start, value, byteOffset); - } - } - return array; -} - -@inline -export function SORT, T>( - array: TArray, - comparator: (a: T, b: T) => i32 -): TArray { - var byteOffset = array.byteOffset; - var length = array.length; - if (length <= 1) return array; - var buffer = array.buffer; - if (length == 2) { - let a = LOAD(buffer, 1, byteOffset); - let b = LOAD(buffer, 0, byteOffset); - if (comparator(a, b) < 0) { - STORE(buffer, 1, b, byteOffset); - STORE(buffer, 0, a, byteOffset); - } - return array; - } - SORT_IMPL(buffer, byteOffset, length, comparator); - return array; -} - -@inline -export function SUBARRAY, T>( - array: TArray, - begin: i32, - end: i32 -): TArray { - var length = array.length; - if (begin < 0) begin = max(length + begin, 0); - else begin = min(begin, length); - if (end < 0) end = max(length + end, begin); - else end = max(min(end, length), begin); - var slice = memory.allocate(offsetof()); - store(slice, array.buffer, offsetof("buffer")); - store(slice, array.byteOffset + (begin << alignof()), offsetof("byteOffset")); - store(slice, (end - begin) << alignof(), offsetof("byteLength")); - return changetype(slice); -} - -@inline -export function REDUCE, T, TRet>( - array: TArray, - callbackfn: (accumulator: TRet, value: T, index: i32, array: TArray) => TRet, - initialValue: TRet -): TRet { - var length = array.length; - var buffer = array.buffer; - var byteOffset = array.byteOffset; - for (let i = 0; i < length; i++) { - initialValue = callbackfn( - initialValue, - LOAD(buffer, i, byteOffset), - i, - array, - ); - } - return initialValue; -} - -@inline -export function REDUCE_RIGHT, T, TRet>( - array: TArray, - callbackfn: (accumulator: TRet, value: T, index: i32, array: TArray) => TRet, - initialValue: TRet -): TRet { - var buffer = array.buffer; - var byteOffset = array.byteOffset; - for (let i = array.length - 1; i >= 0; i--) { - initialValue = callbackfn( - initialValue, - LOAD(buffer, i, byteOffset), - i, - array, - ); - } - return initialValue; -} - -@inline -export function MAP, T>( - array: TArray, - callbackfn: (value: T, index: i32, self: TArray) => T, -): TArray { - var length = array.length; - var buffer = array.buffer; - var byteOffset = array.byteOffset; - var result = instantiate(length); - var resultBuffer = result.buffer; - for (let i = 0; i < length; i++) { - STORE>(resultBuffer, i, >callbackfn(LOAD(buffer, i, byteOffset), i, array)); - } - - return result; -} - -@inline -export function FIND_INDEX, T>( - array: TArray, - callbackfn: (value: T, index: i32, array: TArray) => bool, -): i32 { - var length = array.length; - var buffer = array.buffer; - var byteOffset = array.byteOffset; - for (let i = 0; i < length; i++) { - if (callbackfn(LOAD(buffer, i, byteOffset), i, array)) { - return i; - } - } - return -1; -} - -@inline -export function SOME, T>( - array: TArray, - callbackfn: (value: T, index: i32, array: TArray) => bool, -): bool { - var length = array.length; - var buffer = array.buffer; - var byteOffset = array.byteOffset; - for (let i = 0; i < length; i++) { - if (callbackfn(LOAD(buffer, i, byteOffset), i, array)) { - return true; - } - } - return false; -} - -@inline -export function EVERY, T>( - array: TArray, - callbackfn: (value: T, index: i32, array: TArray) => bool, -): bool { - var length = array.length; - var buffer = array.buffer; - var byteOffset = array.byteOffset; - for (let i = 0; i < length; i++) { - if (callbackfn(LOAD(buffer, i, byteOffset), i, array)) { - continue; - } - return false; - } - return true; -} - -@inline -export function FOREACH, T>( - array: TArray, - callbackfn: (value: T, index: i32, array: TArray) => void, -): void { - var length = array.length; - var buffer = array.buffer; - var byteOffset = array.byteOffset; - for (let i = 0; i < length; i++) { - callbackfn(LOAD(buffer, i, byteOffset), i, array); - } -} - -@inline -export function REVERSE, T>(array: TArray): TArray { - var buffer = array.buffer; - var byteOffset = array.byteOffset; - - for (let front = 0, back = array.length - 1; front < back; ++front, --back) { - let temp = LOAD(buffer, front, byteOffset); - STORE(buffer, front, LOAD(buffer, back, byteOffset), byteOffset); - STORE(buffer, back, temp, byteOffset); - } - return array; -} diff --git a/std/assembly/map.ts b/std/assembly/map.ts index 076962bf0c..9430ad6fef 100644 --- a/std/assembly/map.ts +++ b/std/assembly/map.ts @@ -1,16 +1,20 @@ -import { - HEADER_SIZE as HEADER_SIZE_AB -} from "./internal/arraybuffer"; +/// -import { - HASH -} from "./internal/hash"; +import { HASH } from "./util/hash"; // A deterministic hash map based on CloseTable from https://github.com/jorendorff/dht -@inline const INITIAL_CAPACITY = 4; -@inline const FILL_FACTOR: f64 = 8 / 3; -@inline const FREE_FACTOR: f64 = 3 / 4; +// @ts-ignore: decorator +@inline +const INITIAL_CAPACITY = 4; + +// @ts-ignore: decorator +@inline +const FILL_FACTOR: f64 = 8 / 3; + +// @ts-ignore: decorator +@inline +const FREE_FACTOR: f64 = 3 / 4; /** Structure of a map entry. */ @unmanaged class MapEntry { @@ -20,13 +24,19 @@ import { } /** Empty bit. */ -@inline const EMPTY: usize = 1 << 0; +// @ts-ignore: decorator +@inline +const EMPTY: usize = 1 << 0; /** Size of a bucket. */ -@inline const BUCKET_SIZE = sizeof(); +// @ts-ignore: decorator +@inline +const BUCKET_SIZE = sizeof(); /** Computes the alignment of an entry. */ -@inline function ENTRY_ALIGN(): usize { +// @ts-ignore: decorator +@inline +function ENTRY_ALIGN(): usize { // can align to 4 instead of 8 if 32-bit and K/V is <= 32-bits const maxkv = sizeof() > sizeof() ? sizeof() : sizeof(); const align = (maxkv > sizeof() ? maxkv : sizeof()) - 1; @@ -34,7 +44,9 @@ import { } /** Computes the aligned size of an entry. */ -@inline function ENTRY_SIZE(): usize { +// @ts-ignore: decorator +@inline +function ENTRY_SIZE(): usize { const align = ENTRY_ALIGN(); const size = (offsetof>() + align) & ~align; return size; @@ -54,23 +66,24 @@ export class Map { get size(): i32 { return this.entriesCount; } - constructor() { this.clear(); } + constructor() { + this.clear(); + } clear(): void { const bucketsSize = INITIAL_CAPACITY * BUCKET_SIZE; this.buckets = new ArrayBuffer(bucketsSize); this.bucketsMask = INITIAL_CAPACITY - 1; const entriesSize = INITIAL_CAPACITY * ENTRY_SIZE(); - this.entries = new ArrayBuffer(entriesSize, true); + this.entries = new ArrayBuffer(entriesSize); this.entriesCapacity = INITIAL_CAPACITY; this.entriesOffset = 0; this.entriesCount = 0; } private find(key: K, hashCode: u32): MapEntry | null { - var entry = load>( - changetype(this.buckets) + (hashCode & this.bucketsMask) * BUCKET_SIZE, - HEADER_SIZE_AB + var entry = load>( // unmanaged! + changetype(this.buckets) + (hashCode & this.bucketsMask) * BUCKET_SIZE ); while (entry) { if (!(entry.taggedNext & EMPTY) && entry.key == key) return entry; @@ -90,9 +103,17 @@ export class Map { set(key: K, value: V): void { var hashCode = HASH(key); - var entry = this.find(key, hashCode); + var entry = this.find(key, hashCode); // unmanaged! if (entry) { - entry.value = value; + if (isManaged()) { + let oldRef = changetype(entry.value); + if (changetype(value) != oldRef) { + entry.value = changetype(__retain(changetype(value))); + __release(oldRef); + } + } else { + entry.value = value; + } } else { // check if rehashing is necessary if (this.entriesOffset == this.entriesCapacity) { @@ -104,24 +125,27 @@ export class Map { } // append new entry let entries = this.entries; - entry = changetype>( - changetype(entries) + HEADER_SIZE_AB + this.entriesOffset++ * ENTRY_SIZE() - ); - entry.key = key; - entry.value = value; + entry = changetype>(changetype(entries) + this.entriesOffset++ * ENTRY_SIZE()); + // link with the map + entry.key = isManaged() + ? changetype(__retain(changetype(key))) + : key; + entry.value = isManaged() + ? changetype(__retain(changetype(value))) + : value; ++this.entriesCount; // link with previous entry in bucket let bucketPtrBase = changetype(this.buckets) + (hashCode & this.bucketsMask) * BUCKET_SIZE; - entry.taggedNext = load(bucketPtrBase, HEADER_SIZE_AB); - store(bucketPtrBase, changetype(entry), HEADER_SIZE_AB); - if (isManaged()) __gc_link(changetype(this), changetype(key)); // tslint:disable-line - if (isManaged()) __gc_link(changetype(this), changetype(value)); // tslint:disable-line + entry.taggedNext = load(bucketPtrBase); + store(bucketPtrBase, changetype(entry)); } } delete(key: K): bool { var entry = this.find(key, HASH(key)); if (!entry) return false; + if (isManaged()) __release(changetype(entry.key)); + if (isManaged()) __release(changetype(entry.value)); entry.taggedNext |= EMPTY; --this.entriesCount; // check if rehashing is appropriate @@ -137,12 +161,12 @@ export class Map { var newBucketsCapacity = (newBucketsMask + 1); var newBuckets = new ArrayBuffer(newBucketsCapacity * BUCKET_SIZE); var newEntriesCapacity = (newBucketsCapacity * FILL_FACTOR); - var newEntries = new ArrayBuffer(newEntriesCapacity * ENTRY_SIZE(), true); + var newEntries = new ArrayBuffer(newEntriesCapacity * ENTRY_SIZE()); // copy old entries to new entries - var oldPtr = changetype(this.entries) + HEADER_SIZE_AB; + var oldPtr = changetype(this.entries); var oldEnd = oldPtr + this.entriesOffset * ENTRY_SIZE(); - var newPtr = changetype(newEntries) + HEADER_SIZE_AB; + var newPtr = changetype(newEntries); while (oldPtr != oldEnd) { let oldEntry = changetype>(oldPtr); if (!(oldEntry.taggedNext & EMPTY)) { @@ -151,8 +175,8 @@ export class Map { newEntry.value = oldEntry.value; let newBucketIndex = HASH(oldEntry.key) & newBucketsMask; let newBucketPtrBase = changetype(newBuckets) + newBucketIndex * BUCKET_SIZE; - newEntry.taggedNext = load(newBucketPtrBase, HEADER_SIZE_AB); - store(newBucketPtrBase, newPtr, HEADER_SIZE_AB); + newEntry.taggedNext = load(newBucketPtrBase); + store(newBucketPtrBase, newPtr); newPtr += ENTRY_SIZE(); } oldPtr += ENTRY_SIZE(); @@ -165,27 +189,65 @@ export class Map { this.entriesOffset = this.entriesCount; } + keys(): K[] { + // FIXME: this is preliminary, needs iterators/closures + var start = changetype(this.entries); + var size = this.entriesOffset; + var keys = Array.create(size); + for (let i = 0; i < size; ++i) { + let entry = changetype>(start + i * ENTRY_SIZE()); + if (!(entry.taggedNext & EMPTY)) { + keys.push(entry.key); + } + } + return keys; + } + + values(): V[] { + // FIXME: this is preliminary, needs iterators/closures + var start = changetype(this.entries); + var size = this.entriesOffset; + var values = Array.create(size); + for (let i = 0; i < size; ++i) { + let entry = changetype>(start + i * ENTRY_SIZE()); + if (!(entry.taggedNext & EMPTY)) { + values.push(entry.value); + } + } + return values; + } + toString(): string { return "[object Map]"; } - private __gc(): void { - __gc_mark(changetype(this.buckets)); // tslint:disable-line - var entries = this.entries; - __gc_mark(changetype(entries)); // tslint:disable-line + // RT integration + + @unsafe private __visit_impl(cookie: u32): void { + __visit(changetype(this.buckets), cookie); + var entries = changetype(this.entries); if (isManaged() || isManaged()) { - let offset: usize = 0; - let end: usize = this.entriesOffset * ENTRY_SIZE(); - while (offset < end) { - let entry = changetype>( - changetype(entries) + HEADER_SIZE_AB + offset * ENTRY_SIZE() - ); + let cur = entries; + let end = cur + this.entriesOffset * ENTRY_SIZE(); + while (cur < end) { + let entry = changetype>(cur); if (!(entry.taggedNext & EMPTY)) { - if (isManaged()) __gc_mark(changetype(entry.key)); // tslint:disable-line - if (isManaged()) __gc_mark(changetype(entry.value)); // tslint:disable-line + if (isManaged()) { + let val = changetype(entry.key); + if (isNullable()) { + if (val) __visit(val, cookie); + } else __visit(val, cookie); + } + if (isManaged()) { + let val = changetype(entry.value); + if (isNullable()) { + if (val) __visit(val, cookie); + } else __visit(val, cookie); + } } - offset += ENTRY_SIZE(); + cur += ENTRY_SIZE(); } } + __visit(entries, cookie); } } diff --git a/std/assembly/math.ts b/std/assembly/math.ts index f899f1b082..62bc20fdd6 100644 --- a/std/assembly/math.ts +++ b/std/assembly/math.ts @@ -42,7 +42,9 @@ function R(z: f64): f64 { // Rational approximation of (asin(x)-x)/x^3 return p / q; } -@inline function expo2(x: f64): f64 { // exp(x)/2 for x >= log(DBL_MAX) +// @ts-ignore: decorator +@inline +function expo2(x: f64): f64 { // exp(x)/2 for x >= log(DBL_MAX) const // see: musl/src/math/__expo2.c k = 2043, kln2 = reinterpret(0x40962066151ADD8B); // 0x1.62066151add8bp+10 @@ -50,12 +52,25 @@ function R(z: f64): f64 { // Rational approximation of (asin(x)-x)/x^3 return NativeMath.exp(x - kln2) * scale * scale; } -/** @internal */ -@lazy var random_seeded = false; -@lazy var random_state0_64: u64; -@lazy var random_state1_64: u64; -@lazy var random_state0_32: u32; -@lazy var random_state1_32: u32; +// @ts-ignore: decorator +@lazy +var random_seeded = false; + +// @ts-ignore: decorator +@lazy +var random_state0_64: u64; + +// @ts-ignore: decorator +@lazy +var random_state1_64: u64; + +// @ts-ignore: decorator +@lazy +var random_state0_32: u32; + +// @ts-ignore: decorator +@lazy +var random_state1_32: u32; function murmurHash3(h: u64): u64 { // Force all bits of a hash block to avalanche h ^= h >> 33; // see: https://github.com/aappleby/smhasher @@ -75,17 +90,40 @@ function splitMix32(h: u32): u32 { export namespace NativeMath { - @lazy export const E = reinterpret(0x4005BF0A8B145769); // 2.7182818284590452354 - @lazy export const LN2 = reinterpret(0x3FE62E42FEFA39EF); // 0.69314718055994530942 - @lazy export const LN10 = reinterpret(0x40026BB1BBB55516); // 2.30258509299404568402 - @lazy export const LOG2E = reinterpret(0x3FF71547652B82FE); // 1.4426950408889634074 - @lazy export const LOG10E = reinterpret(0x3FDBCB7B1526E50E); // 0.43429448190325182765 - @lazy export const PI = reinterpret(0x400921FB54442D18); // 3.14159265358979323846 - @lazy export const SQRT1_2 = reinterpret(0x3FE6A09E667F3BCD); // 0.70710678118654752440 - @lazy export const SQRT2 = reinterpret(0x3FF6A09E667F3BCD); // 1.41421356237309504880 + // @ts-ignore: decorator + @lazy + export const E = reinterpret(0x4005BF0A8B145769); // 2.7182818284590452354 - @inline - export function abs(x: f64): f64 { + // @ts-ignore: decorator + @lazy + export const LN2 = reinterpret(0x3FE62E42FEFA39EF); // 0.69314718055994530942 + + // @ts-ignore: decorator + @lazy + export const LN10 = reinterpret(0x40026BB1BBB55516); // 2.30258509299404568402 + + // @ts-ignore: decorator + @lazy + export const LOG2E = reinterpret(0x3FF71547652B82FE); // 1.4426950408889634074 + + // @ts-ignore: decorator + @lazy + export const LOG10E = reinterpret(0x3FDBCB7B1526E50E); // 0.43429448190325182765 + + // @ts-ignore: decorator + @lazy + export const PI = reinterpret(0x400921FB54442D18); // 3.14159265358979323846 + + // @ts-ignore: decorator + @lazy + export const SQRT1_2 = reinterpret(0x3FE6A09E667F3BCD); // 0.70710678118654752440 + + // @ts-ignore: decorator + @lazy + export const SQRT2 = reinterpret(0x3FF6A09E667F3BCD); // 1.41421356237309504880 + + // @ts-ignore: decorator + @inline export function abs(x: f64): f64 { return builtin_abs(x); } @@ -346,6 +384,7 @@ export namespace NativeMath { return t; } + // @ts-ignore: decorator @inline export function ceil(x: f64): f64 { return builtin_ceil(x); @@ -365,8 +404,7 @@ export namespace NativeMath { } export function cos(x: f64): f64 { // TODO - unreachable(); - return 0; + return JSMath.cos(x); } export function cosh(x: f64): f64 { // see: musl/src/math/cosh.c @@ -497,13 +535,15 @@ export namespace NativeMath { return (x + y) * twopk; } + // @ts-ignore: decorator @inline export function floor(x: f64): f64 { return builtin_floor(x); } + // @ts-ignore: decorator @inline - export function fround(x: f64): f32 { + export function fround(x: f64): f64 { return x; } @@ -763,11 +803,13 @@ export namespace NativeMath { return val_lo + val_hi; } + // @ts-ignore: decorator @inline export function max(value1: f64, value2: f64): f64 { return builtin_max(value1, value2); } + // @ts-ignore: decorator @inline export function min(value1: f64, value2: f64): f64 { return builtin_min(value1, value2); @@ -997,11 +1039,13 @@ export namespace NativeMath { return reinterpret(r) - 1; } + // @ts-ignore: decorator @inline export function round(x: f64): f64 { return builtin_copysign(builtin_floor(x + 0.5), x); } + // @ts-ignore: decorator @inline export function sign(x: f64): f64 { if (ASC_SHRINK_LEVEL > 0) { @@ -1011,16 +1055,16 @@ export namespace NativeMath { } } + // @ts-ignore: decorator @inline export function signbit(x: f64): bool { // In ECMAScript all NaN values are indistinguishable from each other // so we need handle NaN and negative NaN in similar way - return ((reinterpret(x) >>> 63) & (x == x)); + return ((reinterpret(x) >>> 63) & i32(x == x)); } export function sin(x: f64): f64 { // TODO - unreachable(); - return 0; + return JSMath.sin(x); } export function sinh(x: f64): f64 { // see: musl/src/math/sinh.c @@ -1041,14 +1085,14 @@ export namespace NativeMath { return t; } + // @ts-ignore: decorator @inline export function sqrt(x: f64): f64 { return builtin_sqrt(x); } export function tan(x: f64): f64 { // TODO - unreachable(); - return 0; + return JSMath.tan(x); } export function tanh(x: f64): f64 { // see: musl/src/math/tanh.c @@ -1074,6 +1118,7 @@ export namespace NativeMath { return builtin_copysign(t, x); } + // @ts-ignore: decorator @inline export function trunc(x: f64): f64 { return builtin_trunc(x); @@ -1232,16 +1277,19 @@ export namespace NativeMath { } } -/** @internal */ -@lazy var rempio2f_y: f64; -@lazy const PIO2_TABLE: u64[] = [ +// @ts-ignore: decorator +@lazy +var rempio2f_y: f64; + +// @ts-ignore: decorator +@lazy +const PIO2_TABLE: u64[] = [ 0xA2F9836E4E441529, 0xFC2757D1F534DDC0, 0xDB6295993C439041, 0xFE5163ABDEBBC561 ]; -/** @internal */ function Rf(z: f32): f32 { // Rational approximation of (asin(x)-x)/x^3 const // see: musl/src/math/asinf.c and SUN COPYRIGHT NOTICE above pS0 = reinterpret(0x3E2AAA75), // 1.6666586697e-01f @@ -1253,7 +1301,9 @@ function Rf(z: f32): f32 { // Rational approximation of (asin(x)-x)/x^3 return p / q; } -@inline function expo2f(x: f32): f32 { // exp(x)/2 for x >= log(DBL_MAX) +// @ts-ignore: decorator +@inline +function expo2f(x: f32): f32 { // exp(x)/2 for x >= log(DBL_MAX) const // see: musl/src/math/__expo2f.c k = 235, kln2 = reinterpret(0x4322E3BC); // 0x1.45c778p+7f @@ -1261,8 +1311,9 @@ function Rf(z: f32): f32 { // Rational approximation of (asin(x)-x)/x^3 return NativeMathf.exp(x - kln2) * scale * scale; } -@inline /** @internal */ -function pio2_large_quot(x: f32, u: i32): i32 { // see: jdh8/metallic/blob/master/src/math/float/rem_pio2f.c +// @ts-ignore: decorator +@inline +function pio2_large_quot(x: f32, u: i32): i32 { // see: jdh8/metallic/blob/master/src/math/float/rem_pio2f.c const coeff = reinterpret(0x3BF921FB54442D18); // π * 0x1p-65 = 8.51530395021638647334e-20 const bits = PIO2_TABLE; @@ -1291,8 +1342,9 @@ function pio2_large_quot(x: f32, u: i32): i32 { // see: jdh8/metallic/blob return q; } -@inline /** @internal */ -function rempio2f(x: f32, u: u32, sign: i32): i32 { // see: jdh8/metallic/blob/master/src/math/float/rem_pio2f.c +// @ts-ignore: decorator +@inline +function rempio2f(x: f32, u: u32, sign: i32): i32 { // see: jdh8/metallic/blob/master/src/math/float/rem_pio2f.c const pi2hi = reinterpret(0x3FF921FB50000000); // 1.57079631090164184570 const pi2lo = reinterpret(0x3E5110B4611A6263); // 1.58932547735281966916e-8 const _2_pi = reinterpret(0x3FE45F306DC9C883); // 0.63661977236758134308 @@ -1308,7 +1360,8 @@ function rempio2f(x: f32, u: u32, sign: i32): i32 { // see: jdh8/metallic/blob } /* |sin(x)/x - s(x)| < 2**-37.5 (~[-4.89e-12, 4.824e-12]). */ -@inline /** @internal */ +// @ts-ignore: decorator +@inline function sin_kernf(x: f64): f32 { // see: musl/tree/src/math/__sindf.c const S1 = reinterpret(0xBFC5555554CBAC77); // -0x15555554cbac77.0p-55 const S2 = reinterpret(0x3F811110896EFBB2); // 0x111110896efbb2.0p-59 @@ -1323,7 +1376,8 @@ function sin_kernf(x: f64): f32 { // see: musl/tree/src/math/__sindf.c } /* |cos(x) - c(x)| < 2**-34.1 (~[-5.37e-11, 5.295e-11]). */ -@inline /** @internal */ +// @ts-ignore: decorator +@inline function cos_kernf(x: f64): f32 { // see: musl/tree/src/math/__cosdf.c const C0 = reinterpret(0xBFDFFFFFFD0C5E81); // -0x1ffffffd0c5e81.0p-54 const C1 = reinterpret(0x3FA55553E1053A42); // 0x155553e1053a42.0p-57 @@ -1337,7 +1391,8 @@ function cos_kernf(x: f64): f32 { // see: musl/tree/src/math/__cosdf.c } /* |tan(x)/x - t(x)| < 2**-25.5 (~[-2e-08, 2e-08]). */ -@inline /** @internal */ +// @ts-ignore: decorator +@inline function tan_kernf(x: f64, odd: i32): f32 { // see: musl/tree/src/math/__tandf.c const T0 = reinterpret(0x3FD5554D3418C99F); /* 0x15554d3418c99f.0p-54 */ @@ -1360,19 +1415,47 @@ function tan_kernf(x: f64, odd: i32): f32 { // see: musl/tree/src/math/__tandf.c export namespace NativeMathf { - @lazy export const E = NativeMath.E; - @lazy export const LN2 = NativeMath.LN2; - @lazy export const LN10 = NativeMath.LN10; - @lazy export const LOG2E = NativeMath.LOG2E; - @lazy export const LOG10E = NativeMath.LOG10E; - @lazy export const PI = NativeMath.PI; - @lazy export const SQRT1_2 = NativeMath.SQRT1_2; - @lazy export const SQRT2 = NativeMath.SQRT2; + // @ts-ignore: decorator + @lazy + export const E = NativeMath.E; + + // @ts-ignore: decorator + @lazy + export const LN2 = NativeMath.LN2; + + // @ts-ignore: decorator + @lazy + export const LN10 = NativeMath.LN10; - /** Used as return values from Mathf.sincos */ - @lazy export var sincos_sin: f32 = 0; - @lazy export var sincos_cos: f32 = 0; + // @ts-ignore: decorator + @lazy + export const LOG2E = NativeMath.LOG2E; + // @ts-ignore: decorator + @lazy + export const LOG10E = NativeMath.LOG10E; + + // @ts-ignore: decorator + @lazy + export const PI = NativeMath.PI; + + // @ts-ignore: decorator + @lazy + export const SQRT1_2 = NativeMath.SQRT1_2; + + // @ts-ignore: decorator + @lazy + export const SQRT2 = NativeMath.SQRT2; + + // @ts-ignore: decorator + @lazy + export var sincos_sin: f32 = 0; + + // @ts-ignore: decorator + @lazy + export var sincos_cos: f32 = 0; + + // @ts-ignore: decorator @inline export function abs(x: f32): f32 { return builtin_abs(x); @@ -1609,6 +1692,7 @@ export namespace NativeMathf { return t; } + // @ts-ignore: decorator @inline export function ceil(x: f32): f32 { return builtin_ceil(x); @@ -1616,7 +1700,7 @@ export namespace NativeMathf { export function clz32(x: f32): f32 { if (!isFinite(x)) return 32; - return builtin_clz( + return builtin_clz( (x - 4294967296 * builtin_floor(x * (1.0 / 4294967296))) ); } @@ -1685,6 +1769,7 @@ export namespace NativeMathf { return expo2f(x); } + // @ts-ignore: decorator @inline export function floor(x: f32): f32 { return builtin_floor(x); @@ -1796,6 +1881,7 @@ export namespace NativeMathf { return (x + y) * twopk; } + // @ts-ignore: decorator @inline export function fround(x: f32): f32 { return x; @@ -1831,6 +1917,7 @@ export namespace NativeMathf { return z * builtin_sqrt((x * x + y * y)); } + // @ts-ignore: decorator @inline export function imul(x: f32, y: f32): f32 { /* @@ -1841,7 +1928,7 @@ export namespace NativeMathf { */ if (!isFinite(x + y)) return 0; const inv32 = 1.0 / 4294967296; - return ( + return ( (x - 4294967296 * builtin_floor(x * inv32)) * (y - 4294967296 * builtin_floor(y * inv32)) ); @@ -2010,11 +2097,13 @@ export namespace NativeMathf { return (lo + hi) * ivln2lo + lo * ivln2hi + hi * ivln2hi + dk; } + // @ts-ignore: decorator @inline export function max(value1: f32, value2: f32): f32 { return builtin_max(value1, value2); } + // @ts-ignore: decorator @inline export function min(value1: f32, value2: f32): f32 { return builtin_min(value1, value2); @@ -2209,6 +2298,7 @@ export namespace NativeMathf { return sn * z; } + // @ts-ignore: decorator @inline export function seedRandom(value: i64): void { NativeMath.seedRandom(value); @@ -2229,11 +2319,13 @@ export namespace NativeMathf { return reinterpret((r >> 9) | (127 << 23)) - 1.0; } + // @ts-ignore: decorator @inline export function round(x: f32): f32 { return builtin_copysign(builtin_floor(x + 0.5), x); } + // @ts-ignore: decorator @inline export function sign(x: f32): f32 { if (ASC_SHRINK_LEVEL > 0) { @@ -2243,8 +2335,10 @@ export namespace NativeMathf { } } + // @ts-ignore: decorator @inline export function signbit(x: f32): bool { + // @ts-ignore: type return ((reinterpret(x) >>> 31) & (x == x)); } @@ -2308,6 +2402,7 @@ export namespace NativeMathf { return t; } + // @ts-ignore: decorator @inline export function sqrt(x: f32): f32 { return builtin_sqrt(x); @@ -2377,6 +2472,7 @@ export namespace NativeMathf { return builtin_copysign(t, x); } + // @ts-ignore: decorator @inline export function trunc(x: f32): f32 { return builtin_trunc(x); @@ -2541,12 +2637,12 @@ export namespace NativeMathf { if (ix <= 0x3f490fda) { /* |x| ~<= π/4 */ if (ix < 0x39800000) { /* |x| < 2**-12 */ - sincos_s32 = x; - sincos_c32 = 1; + sincos_sin = x; + sincos_cos = 1; return; } - sincos_s32 = sin_kernf(x); - sincos_c32 = cos_kernf(x); + sincos_sin = sin_kernf(x); + sincos_cos = cos_kernf(x); return; } @@ -2554,33 +2650,33 @@ export namespace NativeMathf { if (ix <= 0x407b53d1) { /* |x| ~<= 5π/4 */ if (ix <= 0x4016cbe3) { /* |x| ~<= 3π/4 */ if (sign) { - sincos_s32 = -cos_kernf(x + s1pio2); - sincos_c32 = sin_kernf(x + s1pio2); + sincos_sin = -cos_kernf(x + s1pio2); + sincos_cos = sin_kernf(x + s1pio2); } else { - sincos_s32 = cos_kernf(s1pio2 - x); - sincos_c32 = sin_kernf(s1pio2 - x); + sincos_sin = cos_kernf(s1pio2 - x); + sincos_cos = sin_kernf(s1pio2 - x); } return; } /* -sin(x + c) is not correct if x+c could be 0: -0 vs +0 */ - sincos_s32 = -sin_kernf(sign ? x + s2pio2 : x - s2pio2); - sincos_c32 = -cos_kernf(sign ? x + s2pio2 : x - s2pio2); + sincos_sin = -sin_kernf(sign ? x + s2pio2 : x - s2pio2); + sincos_cos = -cos_kernf(sign ? x + s2pio2 : x - s2pio2); return; } if (ix <= 0x40e231d5) { /* |x| ~<= 9π/4 */ if (ix <= 0x40afeddf) { /* |x| ~<= 7π/4 */ if (sign) { - sincos_s32 = cos_kernf(x + s3pio2); - sincos_c32 = -sin_kernf(x + s3pio2); + sincos_sin = cos_kernf(x + s3pio2); + sincos_cos = -sin_kernf(x + s3pio2); } else { - sincos_s32 = -cos_kernf(x - s3pio2); - sincos_c32 = sin_kernf(x - s3pio2); + sincos_sin = -cos_kernf(x - s3pio2); + sincos_cos = sin_kernf(x - s3pio2); } return; } - sincos_s32 = sin_kernf(sign ? x + s4pio2 : x - s4pio2); - sincos_c32 = cos_kernf(sign ? x + s4pio2 : x - s4pio2); + sincos_sin = sin_kernf(sign ? x + s4pio2 : x - s4pio2); + sincos_cos = cos_kernf(sign ? x + s4pio2 : x - s4pio2); return; } } @@ -2588,8 +2684,8 @@ export namespace NativeMathf { /* sin(Inf or NaN) is NaN */ if (ix >= 0x7f800000) { let xx = x - x; - sincos_s32 = xx; - sincos_c32 = xx; + sincos_sin = xx; + sincos_cos = xx; return; } @@ -2601,24 +2697,24 @@ export namespace NativeMathf { switch (n & 3) { case 0: { - sincos_s32 = s; - sincos_c32 = c; + sincos_sin = s; + sincos_cos = c; break; } case 1: { - sincos_s32 = c; - sincos_c32 = -s; + sincos_sin = c; + sincos_cos = -s; break; } case 2: { - sincos_s32 = -s; - sincos_c32 = -c; + sincos_sin = -s; + sincos_cos = -c; break; } case 3: default: { - sincos_s32 = -c; - sincos_c32 = s; + sincos_sin = -c; + sincos_cos = s; break; } } diff --git a/std/assembly/memory.ts b/std/assembly/memory.ts index 7c92f50e46..8337f95c29 100644 --- a/std/assembly/memory.ts +++ b/std/assembly/memory.ts @@ -1,55 +1,63 @@ -import { memcmp, memmove, memset } from "./internal/memory"; - -@builtin export declare const HEAP_BASE: usize; // tslint:disable-line - -/* tslint:disable */ +import { memcmp, memmove, memset } from "./util/memory"; +import { E_NOTIMPLEMENTED } from "./util/error"; +/** Memory manager interface. */ export namespace memory { - @builtin export declare function size(): i32; - - @builtin export declare function grow(pages: i32): i32; - - @builtin @inline - export function fill(dest: usize, c: u8, n: usize): void { // see: musl/src/string/memset - memset(dest, c, n); // fallback if "bulk-memory" isn't enabled + /** Gets the size of the memory in pages. */ + // @ts-ignore: decorator + @builtin + export declare function size(): i32; + + /** Grows the memory by the given size in pages and returns the previous size in pages. */ + // @ts-ignore: decorator + @unsafe @builtin + export declare function grow(pages: i32): i32; + + /** Fills a section in memory with the specified byte value. */ + // @ts-ignore: decorator + @unsafe @builtin + export function fill(dst: usize, c: u8, n: usize): void { + memset(dst, c, n); // fallback if "bulk-memory" isn't enabled } - @builtin @inline - export function copy(dest: usize, src: usize, n: usize): void { // see: musl/src/string/memmove.c - memmove(dest, src, n); // fallback if "bulk-memory" isn't enabled + /** Copies a section of memory to another. Has move semantics. */ + // @ts-ignore: decorator + @unsafe @builtin + export function copy(dst: usize, src: usize, n: usize): void { + memmove(dst, src, n); // fallback if "bulk-memory" isn't enabled } - @inline export function compare(vl: usize, vr: usize, n: usize): i32 { // see: musl/src/string/memcmp.c - return memcmp(vl, vr, n); + /** Initializes a memory segment. */ + // @ts-ignore: decorator + @unsafe + export function init(segmentIndex: u32, srcOffset: usize, dstOffset: usize, n: usize): void { + throw new Error(E_NOTIMPLEMENTED); } - // Passive segments - - // export function init(segmentIndex: u32, srcOffset: usize, dstOffset: usize, n: usize): void { - // __memory_init(segmentIndex, srcOffset, dstOffset); - // } - - // export function drop(segmentIndex: u32): void { - // __memory_drop(segmentIndex); - // } - - // Allocator - - @inline export function allocate(size: usize): usize { - if (isDefined(__memory_allocate)) return __memory_allocate(size); - WARNING("Calling 'memory.allocate' requires a memory manager to be present."); - return unreachable(); + /** Drops a memory segment. */ + // @ts-ignore: decorator + @unsafe + export function drop(segmentIndex: u32): void { + throw new Error(E_NOTIMPLEMENTED); } - @inline export function free(ptr: usize): void { - if (isDefined(__memory_free)) { __memory_free(ptr); return; } - WARNING("Calling 'memory.free' requires a memory manager to be present."); - unreachable(); + /** Repeats a section of memory at a specific address. */ + // @ts-ignore: decorator + @unsafe + export function repeat(dst: usize, src: usize, srcLength: usize, count: usize): void { + var index: usize = 0; + var total = srcLength * count; + while (index < total) { + memory.copy(dst + index, src, srcLength); + index += srcLength; + } } - @inline export function reset(): void { - if (isDefined(__memory_reset)) { __memory_reset(); return; } - unreachable(); + /** Compares a section of memory to another. */ + // @ts-ignore: decorator + @inline + export function compare(vl: usize, vr: usize, n: usize): i32 { + return memcmp(vl, vr, n); } } diff --git a/std/assembly/number.ts b/std/assembly/number.ts index 20288e1913..a2937286c9 100644 --- a/std/assembly/number.ts +++ b/std/assembly/number.ts @@ -1,18 +1,16 @@ -import { - itoa, - dtoa -} from "./internal/number"; +import { itoa, dtoa } from "./util/number"; +import { isNaN as builtin_isNaN, isFinite as builtin_isFinite } from "./builtins"; -import { - isNaN as builtin_isNaN, - isFinite as builtin_isFinite -} from "./builtins"; - -@sealed +@sealed @unmanaged export abstract class I8 { - @lazy static readonly MIN_VALUE: i8 = i8.MIN_VALUE; - @lazy static readonly MAX_VALUE: i8 = i8.MAX_VALUE; + // @ts-ignore: decorator + @lazy + static readonly MIN_VALUE: i8 = i8.MIN_VALUE; + + // @ts-ignore: decorator + @lazy + static readonly MAX_VALUE: i8 = i8.MAX_VALUE; static parseInt(value: string, radix: i32 = 0): i8 { return parseI32(value, radix); @@ -24,11 +22,16 @@ export abstract class I8 { } } -@sealed +@sealed @unmanaged export abstract class I16 { - @lazy static readonly MIN_VALUE: i16 = i16.MIN_VALUE; - @lazy static readonly MAX_VALUE: i16 = i16.MAX_VALUE; + // @ts-ignore: decorator + @lazy + static readonly MIN_VALUE: i16 = i16.MIN_VALUE; + + // @ts-ignore: decorator + @lazy + static readonly MAX_VALUE: i16 = i16.MAX_VALUE; static parseInt(value: string, radix: i32 = 0): i16 { return parseI32(value, radix); @@ -40,11 +43,16 @@ export abstract class I16 { } } -@sealed +@sealed @unmanaged export abstract class I32 { - @lazy static readonly MIN_VALUE: i32 = i32.MIN_VALUE; - @lazy static readonly MAX_VALUE: i32 = i32.MAX_VALUE; + // @ts-ignore: decorator + @lazy + static readonly MIN_VALUE: i32 = i32.MIN_VALUE; + + // @ts-ignore: decorator + @lazy + static readonly MAX_VALUE: i32 = i32.MAX_VALUE; static parseInt(value: string, radix: i32 = 0): i32 { return parseI32(value, radix); @@ -56,11 +64,16 @@ export abstract class I32 { } } -@sealed +@sealed @unmanaged export abstract class I64 { - @lazy static readonly MIN_VALUE: i64 = i64.MIN_VALUE; - @lazy static readonly MAX_VALUE: i64 = i64.MAX_VALUE; + // @ts-ignore: decorator + @lazy + static readonly MIN_VALUE: i64 = i64.MIN_VALUE; + + // @ts-ignore: decorator + @lazy + static readonly MAX_VALUE: i64 = i64.MAX_VALUE; static parseInt(value: string, radix: i32 = 0): i64 { return parseI64(value, radix); @@ -72,11 +85,16 @@ export abstract class I64 { } } -@sealed +@sealed @unmanaged export abstract class Isize { - @lazy static readonly MIN_VALUE: isize = isize.MIN_VALUE; - @lazy static readonly MAX_VALUE: isize = isize.MAX_VALUE; + // @ts-ignore: decorator + @lazy + static readonly MIN_VALUE: isize = isize.MIN_VALUE; + + // @ts-ignore: decorator + @lazy + static readonly MAX_VALUE: isize = isize.MAX_VALUE; static parseInt(value: string, radix: i32 = 0): isize { return parseI64(value, radix); @@ -88,11 +106,16 @@ export abstract class Isize { } } -@sealed +@sealed @unmanaged export abstract class U8 { - @lazy static readonly MIN_VALUE: u8 = u8.MIN_VALUE; - @lazy static readonly MAX_VALUE: u8 = u8.MAX_VALUE; + // @ts-ignore: decorator + @lazy + static readonly MIN_VALUE: u8 = u8.MIN_VALUE; + + // @ts-ignore: decorator + @lazy + static readonly MAX_VALUE: u8 = u8.MAX_VALUE; static parseInt(value: string, radix: i32 = 0): u8 { return parseI32(value, radix); @@ -104,11 +127,16 @@ export abstract class U8 { } } -@sealed +@sealed @unmanaged export abstract class U16 { - @lazy static readonly MIN_VALUE: u16 = u16.MIN_VALUE; - @lazy static readonly MAX_VALUE: u16 = u16.MAX_VALUE; + // @ts-ignore: decorator + @lazy + static readonly MIN_VALUE: u16 = u16.MIN_VALUE; + + // @ts-ignore: decorator + @lazy + static readonly MAX_VALUE: u16 = u16.MAX_VALUE; static parseInt(value: string, radix: i32 = 0): u16 { return parseI32(value, radix); @@ -120,11 +148,16 @@ export abstract class U16 { } } -@sealed +@sealed @unmanaged export abstract class U32 { - @lazy static readonly MIN_VALUE: u32 = u32.MIN_VALUE; - @lazy static readonly MAX_VALUE: u32 = u32.MAX_VALUE; + // @ts-ignore: decorator + @lazy + static readonly MIN_VALUE: u32 = u32.MIN_VALUE; + + // @ts-ignore: decorator + @lazy + static readonly MAX_VALUE: u32 = u32.MAX_VALUE; static parseInt(value: string, radix: i32 = 0): u32 { return parseI32(value, radix); @@ -136,11 +169,16 @@ export abstract class U32 { } } -@sealed +@sealed @unmanaged export abstract class U64 { - @lazy static readonly MIN_VALUE: u64 = u64.MIN_VALUE; - @lazy static readonly MAX_VALUE: u64 = u64.MAX_VALUE; + // @ts-ignore: decorator + @lazy + static readonly MIN_VALUE: u64 = u64.MIN_VALUE; + + // @ts-ignore: decorator + @lazy + static readonly MAX_VALUE: u64 = u64.MAX_VALUE; static parseInt(value: string, radix: i32 = 0): u64 { return parseI64(value, radix); @@ -152,11 +190,16 @@ export abstract class U64 { } } -@sealed +@sealed @unmanaged export abstract class Usize { - @lazy static readonly MIN_VALUE: usize = usize.MIN_VALUE; - @lazy static readonly MAX_VALUE: usize = usize.MAX_VALUE; + // @ts-ignore: decorator + @lazy + static readonly MIN_VALUE: usize = usize.MIN_VALUE; + + // @ts-ignore: decorator + @lazy + static readonly MAX_VALUE: usize = usize.MAX_VALUE; static parseInt(value: string, radix: i32 = 0): usize { return parseI64(value, radix); @@ -168,11 +211,16 @@ export abstract class Usize { } } -@sealed +@sealed @unmanaged export abstract class Bool { - @lazy static readonly MIN_VALUE: bool = bool.MIN_VALUE; - @lazy static readonly MAX_VALUE: bool = bool.MAX_VALUE; + // @ts-ignore: decorator + @lazy + static readonly MIN_VALUE: bool = bool.MIN_VALUE; + + // @ts-ignore: decorator + @lazy + static readonly MAX_VALUE: bool = bool.MAX_VALUE; toString(this: bool): String { // TODO: radix? @@ -182,17 +230,40 @@ export abstract class Bool { export { Bool as Boolean }; -@sealed +@sealed @unmanaged export abstract class F32 { - @lazy static readonly EPSILON: f32 = f32.EPSILON; - @lazy static readonly MIN_VALUE: f32 = f32.MIN_VALUE; - @lazy static readonly MAX_VALUE: f32 = f32.MAX_VALUE; - @lazy static readonly MIN_SAFE_INTEGER: f32 = f32.MIN_SAFE_INTEGER; - @lazy static readonly MAX_SAFE_INTEGER: f32 = f32.MAX_SAFE_INTEGER; - @lazy static readonly POSITIVE_INFINITY: f32 = Infinity; - @lazy static readonly NEGATIVE_INFINITY: f32 = -Infinity; - @lazy static readonly NaN: f32 = NaN; + // @ts-ignore: decorator + @lazy + static readonly EPSILON: f32 = f32.EPSILON; + + // @ts-ignore: decorator + @lazy + static readonly MIN_VALUE: f32 = f32.MIN_VALUE; + + // @ts-ignore: decorator + @lazy + static readonly MAX_VALUE: f32 = f32.MAX_VALUE; + + // @ts-ignore: decorator + @lazy + static readonly MIN_SAFE_INTEGER: f32 = f32.MIN_SAFE_INTEGER; + + // @ts-ignore: decorator + @lazy + static readonly MAX_SAFE_INTEGER: f32 = f32.MAX_SAFE_INTEGER; + + // @ts-ignore: decorator + @lazy + static readonly POSITIVE_INFINITY: f32 = Infinity; + + // @ts-ignore: decorator + @lazy + static readonly NEGATIVE_INFINITY: f32 = -Infinity; + + // @ts-ignore: decorator + @lazy + static readonly NaN: f32 = NaN; static isNaN(value: f32): bool { return isNaN(value); @@ -224,17 +295,40 @@ export abstract class F32 { } } -@sealed +@sealed @unmanaged export abstract class F64 { - @lazy static readonly EPSILON: f64 = f64.EPSILON; - @lazy static readonly MIN_VALUE: f64 = f64.MIN_VALUE; - @lazy static readonly MAX_VALUE: f64 = f64.MAX_VALUE; - @lazy static readonly MIN_SAFE_INTEGER: f64 = f64.MIN_SAFE_INTEGER; - @lazy static readonly MAX_SAFE_INTEGER: f64 = f64.MAX_SAFE_INTEGER; - @lazy static readonly POSITIVE_INFINITY: f64 = Infinity; - @lazy static readonly NEGATIVE_INFINITY: f64 = -Infinity; - @lazy static readonly NaN: f64 = NaN; + // @ts-ignore: decorator + @lazy + static readonly EPSILON: f64 = f64.EPSILON; + + // @ts-ignore: decorator + @lazy + static readonly MIN_VALUE: f64 = f64.MIN_VALUE; + + // @ts-ignore: decorator + @lazy + static readonly MAX_VALUE: f64 = f64.MAX_VALUE; + + // @ts-ignore: decorator + @lazy + static readonly MIN_SAFE_INTEGER: f64 = f64.MIN_SAFE_INTEGER; + + // @ts-ignore: decorator + @lazy + static readonly MAX_SAFE_INTEGER: f64 = f64.MAX_SAFE_INTEGER; + + // @ts-ignore: decorator + @lazy + static readonly POSITIVE_INFINITY: f64 = Infinity; + + // @ts-ignore: decorator + @lazy + static readonly NEGATIVE_INFINITY: f64 = -Infinity; + + // @ts-ignore: decorator + @lazy + static readonly NaN: f64 = NaN; static isNaN(value: f64): bool { return builtin_isNaN(value); diff --git a/std/assembly/polyfills.ts b/std/assembly/polyfills.ts index 77228ec340..87b7bc4db4 100644 --- a/std/assembly/polyfills.ts +++ b/std/assembly/polyfills.ts @@ -1,4 +1,4 @@ -export function bswap(value: T): T { +export function bswap(value: T): T { if (isInteger()) { if (sizeof() == 2) { return ((value << 8) | ((value >> 8) & 0x00FF)); @@ -25,8 +25,7 @@ export function bswap(value: T): T { return value; } -@inline -export function bswap16(value: T): T { +export function bswap16(value: T): T { if (isInteger() && sizeof() <= 4) { if (sizeof() == 2) { return ((value << 8) | ((value >> 8) & 0x00FF)); diff --git a/std/assembly/rt.ts b/std/assembly/rt.ts new file mode 100644 index 0000000000..de9b855386 --- /dev/null +++ b/std/assembly/rt.ts @@ -0,0 +1,79 @@ +import { Typeinfo, TypeinfoFlags } from "./shared/typeinfo"; +import { E_INDEXOUTOFRANGE } from "./util/error"; +import { BLOCK, BLOCK_OVERHEAD } from "./rt/common"; +import { ArrayBufferView } from "./arraybuffer"; + +// @ts-ignore: decorator +@builtin +export declare const __rtti_base: usize; + +// @ts-ignore: decorator +@builtin @unsafe +export declare function __visit_globals(cookie: u32): void; + +// @ts-ignore: decorator +@builtin @unsafe +export declare function __visit_members(ref: usize, cookie: u32): void; + +// @ts-ignore: decorator +@unsafe +export function __typeinfo(id: u32): TypeinfoFlags { + var ptr = __rtti_base; + if (id > load(ptr)) throw new Error(E_INDEXOUTOFRANGE); + return changetype(ptr + sizeof() + id * offsetof()).flags; +} + +// @ts-ignore: decorator +@unsafe +export function __instanceof(ref: usize, superId: u32): bool { // keyword + var id = changetype(ref - BLOCK_OVERHEAD).rtId; + var ptr = __rtti_base; + if (id <= load(ptr)) { + do if (id == superId) return true; + while (id = changetype(ptr + sizeof() + id * offsetof()).base); + } + return false; +} + +// @ts-ignore: decorator +@unsafe +export function __allocArray(length: i32, alignLog2: usize, id: u32, data: usize = 0): usize { + var array = __alloc(offsetof(), id); + var bufferSize = length << alignLog2; + var buffer = __alloc(bufferSize, idof()); + store(array, __retain(buffer), offsetof("data")); + changetype(array).dataStart = buffer; + changetype(array).dataLength = bufferSize; + store(changetype(array), length, offsetof("length_")); + if (data) memory.copy(buffer, data, bufferSize); + return array; +} + +// These are provided by the respective implementation, included as another entry file by asc: + +// @builtin @unsafe +// export declare function __alloc(size: usize, id: u32): usize; + +// // @ts-ignore: decorator +// @builtin @unsafe +// export declare function __realloc(ref: usize, size: usize): usize; + +// // @ts-ignore: decorator +// @builtin @unsafe +// export declare function __free(ref: usize): void; + +// // @ts-ignore: decorator +// @builtin @unsafe +// export declare function __retain(ref: usize): usize; + +// // @ts-ignore: decorator +// @builtin @unsafe +// export declare function __release(ref: usize): void; + +// // @ts-ignore: decorator +// @builtin @unsafe +// export declare function __collect(): void; + +// // @ts-ignore: decorator +// @builtin @unsafe +// export declare function __visit(ref: usize, cookie: u32): void; diff --git a/std/assembly/rt/README.md b/std/assembly/rt/README.md new file mode 100644 index 0000000000..67c6a5b45c --- /dev/null +++ b/std/assembly/rt/README.md @@ -0,0 +1,94 @@ +The AssemblyScript Runtime +========================== + +The runtime provides the functionality necessary to dynamically allocate and deallocate memory of objects, arrays and buffers, as well as keep track of references that are no longer used. + +Interface +--------- + +* **__alloc**(size: `usize`, id: `u32` = 0): `usize`
+ Dynamically allocates a chunk of memory of at least the specified size and returns its address. + Alignment is guaranteed to be 16 bytes to fit up to v128 values naturally. + +* **__realloc**(ref: `usize`, size: `usize`): `usize`
+ Dynamically changes the size of a chunk of memory, possibly moving it to a new address. + +* **__free**(ref: `usize`): `void`
+ Frees a dynamically allocated chunk of memory by its address. + +* **__retain**(ref: `usize`): `usize`
+ Retains a reference to an object. The object doesn't become collected as long as there's at least one retained reference. Returns the retained reference. + +* **__release**(ref: `usize`): `void`
+ Releases a reference to an object. The object is considered for collection once all references to it have been released. + +* **__collect**(): `void`
+ Forces a full garbage collection cycle. By default this means that reference cycles are resolved and possibly collected. + +### Internals + +* **__visit**(ref: `usize`, cookie: `u32`): `void`
+ Concrete visitor implementation called during traversal. Cookie can be used to indicate one of multiple operations. + +### Built-ins + +* **__typeinfo**(id: `u32`): `RTTIFlags`
+ Obtains the runtime type information for objects with the specified runtime id. Runtime type information is a set of flags indicating whether a reference type is managed, an array or similar, and what the relevant alignments when creating an instance externally are etc. + +* **__instanceof** + +* **__visit_globals**(cookie: `u32`): `void`
+ Calls `__visit` on each global that is of a reference type. Not used anymore (originally provided to support tracing GCs) but still here for possible future use. + +* **__visit_members**(ref: `usize`, cookie: `u32`): `void`
+ Calls `__visit` on each member of the object pointed to by `ref`. + +### Related + +* **idof**<`T`>(): `u32`
+ Obtains the unique internal class id of a reference type. + +Full/half +--------- + +The [full](./index-full.ts) runtime is based on [the TLSF memory manager](./tlsf.ts) and [a pure reference counting garbage collector](./pure.ts) and provides all the functionality necessary. The [half](./index-half.ts) alias is essentially the same, but doesn't expose the runtime API so unused runtime code can be DCE'ed. + +Stub/none +--------- + +The [stub](./index-stub.ts) runtime, though fully functional, provides minimal dynamic memory allocation but no deallocation. Useful for prototyping or very short-lived programs with hardly any memory footprint. The [none](./index-none.ts) alias is the same, but doesn't expose the runtime API so unused runtime code can be DCE'ed. + +Integration notes +----------------- + +The underlying reference counting implementation works very similar to other implementations. When an object is stored in a local, global or field, its reference becomes retained (reference count is incremented by 1), respectively when it becomes deleted, it is released (reference count is decremented by 1). Once the reference count reaches zero, the object is considered for collection and the reference count of all contained objects (fields, array elements etc.) is decremented by 1. Now, if an object is inherently acyclic (most objects are), it is free'd right away, while otherwise it is added to a cycle pool and considered for cycle collection on the next `__collect`. + +Differences to other implementations include: + +* A new object from `__alloc` doesn't start with a reference count of 1, but 0. +* When an object is returned from a function, it remains at RC + 1 and the caller is expected to release it. +* Functions with reference type arguments retain each such argument when called, and release it again when exited. This can't be counted on, however, because the compiler may decide to eliminate these where unnecessary. +* Getters, setters, operator overloads and constructors are function calls and behave like one. + +Even though the rules are simple, working with the runtime internals within standard library code can be tricky and requires knowledge of where the compiler will insert runtime calls automatically. For instance + +* `changetype`ing a pointer to a reference type or vice-versa has no side-effects. For example in a `changetype(ptr)` the pointer is untracked before, and the reference becomes tracked afterwards, but there's nothing inserted in between. +* `load`, `store` and similar built-ins aren't functions but intrinsics and as such have no side-effects. For example a `load(...)` is equivalent to a `changetype(load(...))` and a `store(..., ref)` equivalent to a `store(..., changetype(ref))`. + +**GOOD:** In case of doubt, the following pattern is universal: + +```ts +var ref = changetype(__alloc(SIZE, idof())); // assignment retains, RC=1 +// ... safe ... +return ref; // knows `ref` is already retained and simply returns it +``` + +**BAD:** A pattern one shouldn't use is: + +```ts +var ptr = __alloc(SIZE, idof()); // RC=0 +// ... not safe while RC=0 ... e.g.: +someFunc(changetype(ptr)); // might, or might not, free the object! +``` + +**BONUS:** Beware of runtime calls in conditional expressions like a ternary IF, logical AND or OR. Each arm can be in either of two states: Either in-flight if immediately retained/returned or not if the expression or the target doesn't support it. Don't fight the compiler there. diff --git a/std/assembly/rt/common.ts b/std/assembly/rt/common.ts new file mode 100644 index 0000000000..0c046c770f --- /dev/null +++ b/std/assembly/rt/common.ts @@ -0,0 +1,43 @@ +// Alignment guarantees + +// @ts-ignore: decorator +@inline export const AL_BITS: u32 = 4; // 16 bytes to fit up to v128 +// @ts-ignore: decorator +@inline export const AL_SIZE: usize = 1 << AL_BITS; +// @ts-ignore: decorator +@inline export const AL_MASK: usize = AL_SIZE - 1; + +// Extra debugging + +// @ts-ignore: decorator +@inline export const DEBUG = true; + +// ╒════════════════ Common block layout (32-bit) ═════════════════╕ +// 3 2 1 +// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits +// ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┤ +// │ MM info │ -16 +// ├───────────────────────────────────────────────────────────────┤ +// │ GC info │ -12 +// ├───────────────────────────────────────────────────────────────┤ +// │ runtime id │ -8 +// ├───────────────────────────────────────────────────────────────┤ +// │ runtime size │ -4 +// ╞═══════════════════════════════════════════════════════════════╡ +// │ ... │ ref +@unmanaged export class BLOCK { + /** Memory manager info. */ + mmInfo: usize; // WASM64 needs adaption + /** Garbage collector info. */ + gcInfo: u32; + /** Runtime class id. */ + rtId: u32; + /** Runtime object size. */ + rtSize: u32; +} + +// @ts-ignore: decorator +@inline export const BLOCK_OVERHEAD = (offsetof() + AL_MASK) & ~AL_MASK; + +// @ts-ignore: decorator +@inline export const BLOCK_MAXSIZE: usize = (1 << 30) - BLOCK_OVERHEAD; diff --git a/std/assembly/rt/index-full.ts b/std/assembly/rt/index-full.ts new file mode 100644 index 0000000000..c9fa6549d0 --- /dev/null +++ b/std/assembly/rt/index-full.ts @@ -0,0 +1,3 @@ +export { __alloc } from "rt/tlsf"; +export { __retain, __release, __collect } from "rt/pure"; +export { __rtti_base } from "rt"; diff --git a/std/assembly/rt/index-half.ts b/std/assembly/rt/index-half.ts new file mode 100644 index 0000000000..eb6e7b3697 --- /dev/null +++ b/std/assembly/rt/index-half.ts @@ -0,0 +1 @@ +import "rt/index-full"; diff --git a/std/assembly/rt/index-none.ts b/std/assembly/rt/index-none.ts new file mode 100644 index 0000000000..f3b0d9ad08 --- /dev/null +++ b/std/assembly/rt/index-none.ts @@ -0,0 +1 @@ +import "rt/index-stub"; diff --git a/std/assembly/rt/index-stub.ts b/std/assembly/rt/index-stub.ts new file mode 100644 index 0000000000..251aa346c5 --- /dev/null +++ b/std/assembly/rt/index-stub.ts @@ -0,0 +1,2 @@ +export { __alloc, __retain, __release, __collect } from "rt/stub"; +export { __rtti_base } from "rt"; diff --git a/std/assembly/rt/index.d.ts b/std/assembly/rt/index.d.ts new file mode 100644 index 0000000000..55a80a9b11 --- /dev/null +++ b/std/assembly/rt/index.d.ts @@ -0,0 +1,12 @@ +declare function __alloc(size: usize, id: u32): usize; +declare function __realloc(ref: usize, size: usize): usize; +declare function __free(ref: usize): void; +declare function __retain(ref: usize): usize; +declare function __release(ref: usize): void; +declare function __collect(): void; +declare function __typeinfo(id: u32): u32; +declare function __instanceof(ref: usize, superId: u32): bool; +declare function __visit(ref: usize, cookie: i32): void; +declare function __visit_globals(cookie: u32): void; +declare function __visit_members(ref: usize, cookie: u32): void; +declare function __allocArray(length: i32, alignLog2: usize, id: u32, data?: usize): usize; diff --git a/std/assembly/rt/pure.ts b/std/assembly/rt/pure.ts new file mode 100644 index 0000000000..8fdc7d94ea --- /dev/null +++ b/std/assembly/rt/pure.ts @@ -0,0 +1,262 @@ +import { DEBUG, BLOCK_OVERHEAD } from "rt/common"; +import { Block, freeBlock, ROOT } from "rt/tlsf"; +import { TypeinfoFlags } from "shared/typeinfo"; +import { onincrement, ondecrement, onfree, onalloc } from "./rtrace"; + +/////////////////////////// A Pure Reference Counting Garbage Collector /////////////////////////// +// see: https://researcher.watson.ibm.com/researcher/files/us-bacon/Bacon03Pure.pdf + +// ╒══════════════════════ GC Info structure ══════════════════════╕ +// │ 3 2 1 │ +// │1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0│ +// ├─┼─┴─┴─┼─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┤ +// │B│color│ refCount │ +// └─┴─────┴───────────────────────────────────────────────────────┘ +// B: buffered + +// @ts-ignore: decorator +@inline const BUFFERED_MASK: u32 = 1 << (sizeof() * 8 - 1); +// @ts-ignore: decorator +@inline const COLOR_BITS = 3; +// @ts-ignore: decorator +@inline const COLOR_SHIFT: u32 = ctz(BUFFERED_MASK) - COLOR_BITS; +// @ts-ignore: decorator +@inline const COLOR_MASK: u32 = ((1 << COLOR_BITS) - 1) << COLOR_SHIFT; +// @ts-ignore: decorator +@inline const REFCOUNT_MASK: u32 = (1 << COLOR_SHIFT) - 1; + +// ╒════════╤═══════════════════ Colors ═══════════════════════════╕ +// │ Color │ Meaning │ +// ├────────┼──────────────────────────────────────────────────────┤ +// │ BLACK │ In use or free │ +// │ GRAY │ Possible member of cycle │ +// │ WHITE │ Member of garbage cycle │ +// │ PURPLE │ Possible root of cycle │ +// │ RED │ Candidate cycle undergoing Σ-computation *concurrent │ +// │ ORANGE │ Candidate cycle awaiting epoch boundary *concurrent │ +// └────────┴──────────────────────────────────────────────────────┘ +// Acyclic detection has been decoupled, hence no GREEN. + +// @ts-ignore: decorator +@inline const COLOR_BLACK: u32 = 0 << COLOR_SHIFT; +// @ts-ignore: decorator +@inline const COLOR_GRAY: u32 = 1 << COLOR_SHIFT; +// @ts-ignore: decorator +@inline const COLOR_WHITE: u32 = 2 << COLOR_SHIFT; +// @ts-ignore: decorator +@inline const COLOR_PURPLE: u32 = 3 << COLOR_SHIFT; +// @ts-ignore: decorator +@inline const COLOR_RED: u32 = 4 << COLOR_SHIFT; +// @ts-ignore: decorator +@inline const COLOR_ORANGE: u32 = 5 << COLOR_SHIFT; + +// @ts-ignore: decorator +@inline const VISIT_DECREMENT = 1; // guard 0 +// @ts-ignore: decorator +@inline const VISIT_MARKGRAY = 2; +// @ts-ignore: decorator +@inline const VISIT_SCAN = 3; +// @ts-ignore: decorator +@inline const VISIT_SCANBLACK = 4; +// @ts-ignore: decorator +@inline const VISIT_COLLECTWHITE = 5; + +// @ts-ignore: decorator +@global @unsafe +function __visit(ref: usize, cookie: i32): void { + if (ref < __heap_base) return; + var s = changetype(ref - BLOCK_OVERHEAD); + switch (cookie) { + case VISIT_DECREMENT: { + decrement(s); + break; + } + case VISIT_MARKGRAY: { + if (DEBUG) assert((s.gcInfo & REFCOUNT_MASK) > 0); + s.gcInfo = s.gcInfo - 1; + markGray(s); + break; + } + case VISIT_SCAN: { + scan(s); + break; + } + case VISIT_SCANBLACK: { + let info = s.gcInfo; + assert((info & ~REFCOUNT_MASK) == ((info + 1) & ~REFCOUNT_MASK)); // overflow + s.gcInfo = info + 1; + if ((info & COLOR_MASK) != COLOR_BLACK) { + scanBlack(s); + } + break; + } + case VISIT_COLLECTWHITE: { + collectWhite(s); + break; + } + default: if (DEBUG) assert(false); + } +} + +/** Increments the reference count of the specified block by one.*/ +function increment(s: Block): void { + var info = s.gcInfo; + assert((info & ~REFCOUNT_MASK) == ((info + 1) & ~REFCOUNT_MASK)); // overflow + s.gcInfo = info + 1; + if (isDefined(ASC_RTRACE)) onincrement(s); + if (DEBUG) assert(!(s.mmInfo & 1)); // used +} + +/** Decrements the reference count of the specified block by one, possibly freeing it. */ +function decrement(s: Block): void { + var info = s.gcInfo; + var rc = info & REFCOUNT_MASK; + if (isDefined(ASC_RTRACE)) ondecrement(s); + if (DEBUG) assert(!(s.mmInfo & 1)); // used + if (rc == 1) { + __visit_members(changetype(s) + BLOCK_OVERHEAD, VISIT_DECREMENT); + if (!(info & BUFFERED_MASK)) { + freeBlock(ROOT, s); + } else { + s.gcInfo = BUFFERED_MASK | COLOR_BLACK | 0; + } + } else { + if (DEBUG) assert(rc > 0); + if (!(__typeinfo(s.rtId) & TypeinfoFlags.ACYCLIC)) { + s.gcInfo = BUFFERED_MASK | COLOR_PURPLE | (rc - 1); + if (!(info & BUFFERED_MASK)) { + appendRoot(s); + } + } else { + s.gcInfo = (info & ~REFCOUNT_MASK) | (rc - 1); + } + } +} + +/** Buffer of possible roots. */ +// @ts-ignore: decorator +@lazy var ROOTS: usize; +/** Current absolute offset into the `ROOTS` buffer. */ +// @ts-ignore: decorator +@lazy var CUR: usize = 0; +/** Current absolute end offset into the `ROOTS` buffer. */ +// @ts-ignore: decorator +@lazy var END: usize = 0; + +/** Appends a block to possible roots. */ +function appendRoot(s: Block): void { + var cur = CUR; + if (cur >= END) { + growRoots(); // TBD: either that or pick a default and force collection on overflow + cur = CUR; + } + store(cur, s); + CUR = cur + sizeof(); +} + +/** Grows the roots buffer if it ran full. */ +function growRoots(): void { + var oldRoots = ROOTS; + var oldSize = CUR - oldRoots; + var newSize = max(oldSize * 2, 64 << alignof()); + var newRoots = __alloc(newSize, 0); + if (isDefined(ASC_RTRACE)) onfree(changetype(newRoots - BLOCK_OVERHEAD)); // neglect unmanaged + memory.copy(newRoots, oldRoots, oldSize); + if (oldRoots) { + if (isDefined(ASC_RTRACE)) onalloc(changetype(oldRoots - BLOCK_OVERHEAD)); // neglect unmanaged + __free(oldRoots); + } + ROOTS = newRoots; + CUR = newRoots + oldSize; + END = newRoots + newSize; +} + +/** Collects cyclic garbage. */ +// @ts-ignore: decorator +@global @unsafe +export function __collect(): void { + + // markRoots + var roots = ROOTS; + var cur = roots; + for (let pos = cur, end = CUR; pos < end; pos += sizeof()) { + let s = load(pos); + let info = s.gcInfo; + if ((info & COLOR_MASK) == COLOR_PURPLE && (info & REFCOUNT_MASK) > 0) { + markGray(s); + store(cur, s); + cur += sizeof(); + } else { + if ((info & COLOR_MASK) == COLOR_BLACK && !(info & REFCOUNT_MASK)) { + freeBlock(ROOT, s); + } else { + s.gcInfo = info & ~BUFFERED_MASK; + } + } + } + CUR = cur; + + // scanRoots + for (let pos = roots; pos < cur; pos += sizeof()) { + scan(load(pos)); + } + + // collectRoots + for (let pos = roots; pos < cur; pos += sizeof()) { + let s = load(pos); + s.gcInfo = s.gcInfo & ~BUFFERED_MASK; + collectWhite(s); + } + CUR = roots; +} + +/** Marks a block as gray (possible member of cycle) during the collection phase. */ +function markGray(s: Block): void { + var info = s.gcInfo; + if ((info & COLOR_MASK) != COLOR_GRAY) { + s.gcInfo = (info & ~COLOR_MASK) | COLOR_GRAY; + __visit_members(changetype(s) + BLOCK_OVERHEAD, VISIT_MARKGRAY); + } +} + +/** Scans a block during the collection phase, determining whether it is garbage or not. */ +function scan(s: Block): void { + var info = s.gcInfo; + if ((info & COLOR_MASK) == COLOR_GRAY) { + if ((info & REFCOUNT_MASK) > 0) { + scanBlack(s); + } else { + s.gcInfo = (info & ~COLOR_MASK) | COLOR_WHITE; + __visit_members(changetype(s) + BLOCK_OVERHEAD, VISIT_SCAN); + } + } +} + +/** Marks a block as black (in use) if it was found to be reachable during the collection phase. */ +function scanBlack(s: Block): void { + s.gcInfo = (s.gcInfo & ~COLOR_MASK) | COLOR_BLACK; + __visit_members(changetype(s) + BLOCK_OVERHEAD, VISIT_SCANBLACK); +} + +/** Collects all white (member of a garbage cycle) nodes when completing the collection phase. */ +function collectWhite(s: Block): void { + var info = s.gcInfo; + if ((info & COLOR_MASK) == COLOR_WHITE && !(info & BUFFERED_MASK)) { + s.gcInfo = (info & ~COLOR_MASK) | COLOR_BLACK; + __visit_members(changetype(s) + BLOCK_OVERHEAD, VISIT_COLLECTWHITE); + freeBlock(ROOT, s); + } +} + +// @ts-ignore: decorator +@global @unsafe +export function __retain(ref: usize): usize { + if (ref > __heap_base) increment(changetype(ref - BLOCK_OVERHEAD)); + return ref; +} + +// @ts-ignore: decorator +@global @unsafe +export function __release(ref: usize): void { + if (ref > __heap_base) decrement(changetype(ref - BLOCK_OVERHEAD)); +} diff --git a/std/assembly/rt/rtrace.ts b/std/assembly/rt/rtrace.ts new file mode 100644 index 0000000000..ac0a895d27 --- /dev/null +++ b/std/assembly/rt/rtrace.ts @@ -0,0 +1,6 @@ +import { BLOCK } from "./common"; + +export declare function onalloc(s: BLOCK): void; +export declare function onincrement(s: BLOCK): void; +export declare function ondecrement(s: BLOCK): void; +export declare function onfree(s: BLOCK): void; diff --git a/std/assembly/rt/stub.ts b/std/assembly/rt/stub.ts new file mode 100644 index 0000000000..9c4f10ac82 --- /dev/null +++ b/std/assembly/rt/stub.ts @@ -0,0 +1,77 @@ +import { AL_MASK, BLOCK, BLOCK_OVERHEAD, BLOCK_MAXSIZE } from "rt/common"; + +// @ts-ignore: decorator +@lazy +var startOffset: usize = (__heap_base + AL_MASK) & ~AL_MASK; + +// @ts-ignore: decorator +@lazy +var offset: usize = startOffset; + +// @ts-ignore: decorator +@unsafe @global +export function __alloc(size: usize, id: u32): usize { + if (size > BLOCK_MAXSIZE) unreachable(); + var ptr = offset + BLOCK_OVERHEAD; + var newPtr = (ptr + max(size, 1) + AL_MASK) & ~AL_MASK; + var pagesBefore = memory.size(); + if (newPtr > pagesBefore << 16) { + let pagesNeeded = ((newPtr - ptr + 0xffff) & ~0xffff) >>> 16; + let pagesWanted = max(pagesBefore, pagesNeeded); // double memory + if (memory.grow(pagesWanted) < 0) { + if (memory.grow(pagesNeeded) < 0) unreachable(); // out of memory + } + } + offset = newPtr; + var block = changetype(ptr - BLOCK_OVERHEAD); + block.rtId = id; + block.rtSize = size; + return ptr; +} + +// @ts-ignore: decorator +@unsafe @global +export function __realloc(ref: usize, size: usize): usize { + var block = changetype(ref - BLOCK_OVERHEAD); + var oldSize = block.rtSize; + if (size > oldSize) { + let newRef = __alloc(size, block.rtId); + memory.copy(newRef, ref, oldSize); + ref = newRef; + } else { + block.rtSize = size; + } + return ref; +} + +// @ts-ignore: decorator +@unsafe @global +export function __free(ref: usize): void { +} + +// @ts-ignore: decorator +@unsafe @global +function __reset(): void { // special + offset = startOffset; +} + +// @ts-ignore: decorator +@global @unsafe +export function __retain(ref: usize): usize { + return ref; +} + +// @ts-ignore: decorator +@global @unsafe +export function __release(ref: usize): void { +} + +// @ts-ignore: decorator +@global @unsafe +export function __visit(ref: usize, cookie: u32): void { +} + +// @ts-ignore: decorator +@global @unsafe +export function __collect(): void { +} diff --git a/std/assembly/rt/tlsf.ts b/std/assembly/rt/tlsf.ts new file mode 100644 index 0000000000..44366125b0 --- /dev/null +++ b/std/assembly/rt/tlsf.ts @@ -0,0 +1,564 @@ +import { AL_BITS, AL_MASK, DEBUG, BLOCK, BLOCK_OVERHEAD, BLOCK_MAXSIZE } from "rt/common"; +import { onfree, onalloc } from "./rtrace"; + +/////////////////////// The TLSF (Two-Level Segregate Fit) memory allocator /////////////////////// +// see: http://www.gii.upv.es/tlsf/ + +// - `ffs(x)` is equivalent to `ctz(x)` with x != 0 +// - `fls(x)` is equivalent to `sizeof(x) * 8 - clz(x) - 1` + +// ╒══════════════ Block size interpretation (32-bit) ═════════════╕ +// 3 2 1 +// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits +// ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┼─┴─┴─┴─╫─┴─┴─┴─┤ +// │ | FL │ SB = SL + AL │ ◄─ usize +// └───────────────────────────────────────────────┴───────╨───────┘ +// FL: first level, SL: second level, AL: alignment, SB: small block + +// @ts-ignore: decorator +@inline const SL_BITS: u32 = 4; +// @ts-ignore: decorator +@inline const SL_SIZE: usize = 1 << SL_BITS; + +// @ts-ignore: decorator +@inline const SB_BITS: usize = (SL_BITS + AL_BITS); +// @ts-ignore: decorator +@inline const SB_SIZE: usize = 1 << SB_BITS; + +// @ts-ignore: decorator +@inline const FL_BITS: u32 = 31 - SB_BITS; + +// [00]: < 256B (SB) [12]: < 1M +// [01]: < 512B [13]: < 2M +// [02]: < 1K [14]: < 4M +// [03]: < 2K [15]: < 8M +// [04]: < 4K [16]: < 16M +// [05]: < 8K [17]: < 32M +// [06]: < 16K [18]: < 64M +// [07]: < 32K [19]: < 128M +// [08]: < 64K [20]: < 256M +// [09]: < 128K [21]: < 512M +// [10]: < 256K [22]: <= 1G - OVERHEAD +// [11]: < 512K +// VMs limit to 2GB total (currently), making one 1G block max (or three 512M etc.) due to block overhead + +// Tags stored in otherwise unused alignment bits + +// @ts-ignore: decorator +@inline const FREE: usize = 1 << 0; +// @ts-ignore: decorator +@inline const LEFTFREE: usize = 1 << 1; +// @ts-ignore: decorator +@inline const TAGS_MASK: usize = FREE | LEFTFREE; // <= AL_MASK + +// ╒════════════════════ Block layout (32-bit) ════════════════════╕ +// 3 2 1 +// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits +// ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┼─┼─┼─┤ overhead ┐ +// │ size │0│L│F│ ◄─┐ info +// ├─────────────────────────────────────────────────────────┴─┴─┴─┤ │ +// │ │ │ +// │ ... additional runtime overhead ... │ │ +// │ │ │ +// ╞═══════════════════════════════════════════════════════════════╡ │ ┐ ┘ +// │ if free: ◄ prev │ ◄─┤ usize +// ├───────────────────────────────────────────────────────────────┤ │ +// │ if free: next ► │ ◄─┤ +// ├───────────────────────────────────────────────────────────────┤ │ +// │ ... │ │ = 0 +// ├───────────────────────────────────────────────────────────────┤ │ +// │ if free: back ▲ │ ◄─┘ +// └───────────────────────────────────────────────────────────────┘ payload ┘ >= MIN SIZE +// F: FREE, L: LEFTFREE +@unmanaged export class Block extends BLOCK { + + /** Previous free block, if any. Only valid if free, otherwise part of payload. */ + prev: Block | null; + /** Next free block, if any. Only valid if free, otherwise part of payload. */ + next: Block | null; + + // If the block is free, there is a 'back'reference at its end pointing at its start. +} + +// Block constants. A block must have a minimum size of three pointers so it can hold `prev`, +// `next` and `back` if free. + +// @ts-ignore: decorator +@inline const BLOCK_MINSIZE: usize = (3 * sizeof() + AL_MASK) & ~AL_MASK; // prev + next + back +// @ts-ignore: decorator +// @inline const BLOCK_MAXSIZE: usize = 1 << (FL_BITS + SB_BITS - 1); // exclusive, lives in common.ts + +/** Gets the left block of a block. Only valid if the left block is free. */ +// @ts-ignore: decorator +@inline function GETFREELEFT(block: Block): Block { + return load(changetype(block) - sizeof()); +} + +/** Gets the right block of of a block by advancing to the right by its size. */ +// @ts-ignore: decorator +@inline function GETRIGHT(block: Block): Block { + return changetype(changetype(block) + BLOCK_OVERHEAD + (block.mmInfo & ~TAGS_MASK)); +} + +// ╒═════════════════════ Root layout (32-bit) ════════════════════╕ +// 3 2 1 +// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits +// ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┤ ┐ +// │ 0 | flMap S│ ◄────┐ +// ╞═══════════════════════════════════════════════════════════════╡ │ +// │ slMap[0] S │ ◄─┐ │ +// ├───────────────────────────────────────────────────────────────┤ │ │ +// │ slMap[1] │ ◄─┤ │ +// ├───────────────────────────────────────────────────────────────┤ u32 │ +// │ slMap[22] │ ◄─┘ │ +// ╞═══════════════════════════════════════════════════════════════╡ usize +// │ head[0] │ ◄────┤ +// ├───────────────────────────────────────────────────────────────┤ │ +// │ ... │ ◄────┤ +// ├───────────────────────────────────────────────────────────────┤ │ +// │ head[367] │ ◄────┤ +// ╞═══════════════════════════════════════════════════════════════╡ │ +// │ tail │ ◄────┘ +// └───────────────────────────────────────────────────────────────┘ SIZE ┘ +// S: Small blocks map +@unmanaged class Root { + /** First level bitmap. */ + flMap: usize; +} + +// Root constants. Where stuff is stored inside of the root structure. + +// @ts-ignore: decorator +@inline const SL_START = sizeof(); +// @ts-ignore: decorator +@inline const SL_END = SL_START + (FL_BITS << alignof()); +// @ts-ignore: decorator +@inline const HL_START = (SL_END + AL_MASK) & ~AL_MASK; +// @ts-ignore: decorator +@inline const HL_END = HL_START + FL_BITS * SL_SIZE * sizeof(); +// @ts-ignore: decorator +@inline const ROOT_SIZE = HL_END + sizeof(); + +// @ts-ignore: decorator +@lazy export var ROOT: Root; + +/** Gets the second level map of the specified first level. */ +// @ts-ignore: decorator +@inline function GETSL(root: Root, fl: usize): u32 { + return load( + changetype(root) + (fl << alignof()), + SL_START + ); +} + +/** Sets the second level map of the specified first level. */ +// @ts-ignore: decorator +@inline function SETSL(root: Root, fl: usize, slMap: u32): void { + store( + changetype(root) + (fl << alignof()), + slMap, + SL_START + ); +} + +/** Gets the head of the free list for the specified combination of first and second level. */ +// @ts-ignore: decorator +@inline function GETHEAD(root: Root, fl: usize, sl: u32): Block | null { + return load( + changetype(root) + (((fl << SL_BITS) + sl) << alignof()), + HL_START + ); +} + +/** Sets the head of the free list for the specified combination of first and second level. */ +// @ts-ignore: decorator +@inline function SETHEAD(root: Root, fl: usize, sl: u32, head: Block | null): void { + store( + changetype(root) + (((fl << SL_BITS) + sl) << alignof()), + head, + HL_START + ); +} + +/** Gets the tail block.. */ +// @ts-ignore: decorator +@inline function GETTAIL(root: Root): Block { + return load( + changetype(root), + HL_END + ); +} + +/** Sets the tail block. */ +// @ts-ignore: decorator +@inline function SETTAIL(root: Root, tail: Block): void { + store( + changetype(root), + tail, + HL_END + ); +} + +/** Inserts a previously used block back into the free list. */ +function insertBlock(root: Root, block: Block): void { + if (DEBUG) assert(block); // cannot be null + var blockInfo = block.mmInfo; + if (DEBUG) assert(blockInfo & FREE); // must be free + + var right = GETRIGHT(block); + var rightInfo = right.mmInfo; + + // merge with right block if also free + if (rightInfo & FREE) { + let newSize = (blockInfo & ~TAGS_MASK) + BLOCK_OVERHEAD + (rightInfo & ~TAGS_MASK); + if (newSize < BLOCK_MAXSIZE) { + removeBlock(root, right); + block.mmInfo = blockInfo = (blockInfo & TAGS_MASK) | newSize; + right = GETRIGHT(block); + rightInfo = right.mmInfo; + // 'back' is set below + } + } + + // merge with left block if also free + if (blockInfo & LEFTFREE) { + let left = GETFREELEFT(block); + let leftInfo = left.mmInfo; + if (DEBUG) assert(leftInfo & FREE); // must be free according to right tags + let newSize = (leftInfo & ~TAGS_MASK) + BLOCK_OVERHEAD + (blockInfo & ~TAGS_MASK); + if (newSize < BLOCK_MAXSIZE) { + removeBlock(root, left); + left.mmInfo = blockInfo = (leftInfo & TAGS_MASK) | newSize; + block = left; + // 'back' is set below + } + } + + right.mmInfo = rightInfo | LEFTFREE; + // right is no longer used now, hence rightInfo is not synced + + // we now know the size of the block + var size = blockInfo & ~TAGS_MASK; + if (DEBUG) assert(size >= BLOCK_MINSIZE && size < BLOCK_MAXSIZE); // must be a valid size + if (DEBUG) assert(changetype(block) + BLOCK_OVERHEAD + size == changetype(right)); // must match + + // set 'back' to itself at the end of block + store(changetype(right) - sizeof(), block); + + // mapping_insert + var fl: usize, sl: u32; + if (size < SB_SIZE) { + fl = 0; + sl = (size >> AL_BITS); + } else { + const inv: usize = sizeof() * 8 - 1; + fl = inv - clz(size); + sl = ((size >> (fl - SL_BITS)) ^ (1 << SL_BITS)); + fl -= SB_BITS - 1; + } + if (DEBUG) assert(fl < FL_BITS && sl < SL_SIZE); // fl/sl out of range + + // perform insertion + var head = GETHEAD(root, fl, sl); + block.prev = null; + block.next = head; + if (head) head.prev = block; + SETHEAD(root, fl, sl, block); + + // update first and second level maps + root.flMap |= (1 << fl); + SETSL(root, fl, GETSL(root, fl) | (1 << sl)); +} + +/** Removes a free block from internal lists. */ +function removeBlock(root: Root, block: Block): void { + var blockInfo = block.mmInfo; + if (DEBUG) assert(blockInfo & FREE); // must be free + var size = blockInfo & ~TAGS_MASK; + if (DEBUG) assert(size >= BLOCK_MINSIZE && size < BLOCK_MAXSIZE); // must be valid + + // mapping_insert + var fl: usize, sl: u32; + if (size < SB_SIZE) { + fl = 0; + sl = (size >> AL_BITS); + } else { + const inv: usize = sizeof() * 8 - 1; + fl = inv - clz(size); + sl = ((size >> (fl - SL_BITS)) ^ (1 << SL_BITS)); + fl -= SB_BITS - 1; + } + if (DEBUG) assert(fl < FL_BITS && sl < SL_SIZE); // fl/sl out of range + + // link previous and next free block + var prev = block.prev; + var next = block.next; + if (prev) prev.next = next; + if (next) next.prev = prev; + + // update head if we are removing it + if (block == GETHEAD(root, fl, sl)) { + SETHEAD(root, fl, sl, next); + + // clear second level map if head is empty now + if (!next) { + let slMap = GETSL(root, fl); + SETSL(root, fl, slMap &= ~(1 << sl)); + + // clear first level map if second level is empty now + if (!slMap) root.flMap &= ~(1 << fl); + } + } + // note: does not alter left/back because it is likely that splitting + // is performed afterwards, invalidating those changes. so, the caller + // must perform those updates. +} + +/** Searches for a free block of at least the specified size. */ +function searchBlock(root: Root, size: usize): Block | null { + // size was already asserted by caller + + // mapping_search + var fl: usize, sl: u32; + if (size < SB_SIZE) { + fl = 0; + sl = (size >> AL_BITS); + } else { + const halfMaxSize = BLOCK_MAXSIZE >> 1; // don't round last fl + const inv: usize = sizeof() * 8 - 1; + const invRound = inv - SL_BITS; + let requestSize = size < halfMaxSize + ? size + (1 << (invRound - clz(size))) - 1 + : size; + fl = inv - clz(requestSize); + sl = ((requestSize >> (fl - SL_BITS)) ^ (1 << SL_BITS)); + fl -= SB_BITS - 1; + } + if (DEBUG) assert(fl < FL_BITS && sl < SL_SIZE); // fl/sl out of range + + // search second level + var slMap = GETSL(root, fl) & (~0 << sl); + var head: Block | null = null; + if (!slMap) { + // search next larger first level + let flMap = root.flMap & (~0 << (fl + 1)); + if (!flMap) { + head = null; + } else { + fl = ctz(flMap); + slMap = GETSL(root, fl); + if (DEBUG) assert(slMap); // can't be zero if fl points here + head = GETHEAD(root, fl, ctz(slMap)); + } + } else { + head = GETHEAD(root, fl, ctz(slMap)); + } + return head; +} + +/** Prepares the specified block before (re-)use, possibly splitting it. */ +function prepareBlock(root: Root, block: Block, size: usize): void { + // size was already asserted by caller + + var blockInfo = block.mmInfo; + if (DEBUG) assert(!(size & AL_MASK)); // size must be aligned so the new block is + + // split if the block can hold another MINSIZE block incl. overhead + var remaining = (blockInfo & ~TAGS_MASK) - size; + if (remaining >= BLOCK_OVERHEAD + BLOCK_MINSIZE) { + block.mmInfo = size | (blockInfo & LEFTFREE); // also discards FREE + + let spare = changetype(changetype(block) + BLOCK_OVERHEAD + size); + spare.mmInfo = (remaining - BLOCK_OVERHEAD) | FREE; // not LEFTFREE + insertBlock(root, spare); // also sets 'back' + + // otherwise tag block as no longer FREE and right as no longer LEFTFREE + } else { + block.mmInfo = blockInfo & ~FREE; + GETRIGHT(block).mmInfo &= ~LEFTFREE; + } +} + +/** Adds more memory to the pool. */ +function addMemory(root: Root, start: usize, end: usize): bool { + if (DEBUG) { + assert( + start <= end && // must be valid + !(start & AL_MASK) && // must be aligned + !(end & AL_MASK) // must be aligned + ); + } + + var tail = GETTAIL(root); + var tailInfo: usize = 0; + if (tail) { // more memory + if (DEBUG) assert(start >= changetype(tail) + BLOCK_OVERHEAD); + + // merge with current tail if adjacent + if (start - BLOCK_OVERHEAD == changetype(tail)) { + start -= BLOCK_OVERHEAD; + tailInfo = tail.mmInfo; + } else { + // We don't do this, but a user might `memory.grow` manually + // leading to non-adjacent pages managed by TLSF. + } + + } else if (DEBUG) { // first memory + assert(start >= changetype(root) + ROOT_SIZE); // starts after root + } + + // check if size is large enough for a free block and the tail block + var size = end - start; + if (size < BLOCK_OVERHEAD + BLOCK_MINSIZE + BLOCK_OVERHEAD) { + return false; + } + + // left size is total minus its own and the zero-length tail's header + var leftSize = size - 2 * BLOCK_OVERHEAD; + var left = changetype(start); + left.mmInfo = leftSize | FREE | (tailInfo & LEFTFREE); + left.prev = null; + left.next = null; + + // tail is a zero-length used block + tail = changetype(start + size - BLOCK_OVERHEAD); + tail.mmInfo = 0 | LEFTFREE; + SETTAIL(root, tail); + + insertBlock(root, left); // also merges with free left before tail / sets 'back' + + return true; +} + +/** Grows memory to fit at least another block of the specified size. */ +function growMemory(root: Root, size: usize): void { + var pagesBefore = memory.size(); + var pagesNeeded = (((size + 0xffff) & ~0xffff) >>> 16); + var pagesWanted = max(pagesBefore, pagesNeeded); // double memory + if (memory.grow(pagesWanted) < 0) { + if (memory.grow(pagesNeeded) < 0) unreachable(); + } + var pagesAfter = memory.size(); + addMemory(root, pagesBefore << 16, pagesAfter << 16); +} + +/** Prepares and checks an allocation size. */ +function prepareSize(size: usize): usize { + if (size >= BLOCK_MAXSIZE) throw new Error("allocation too large"); + return max((size + AL_MASK) & ~AL_MASK, BLOCK_MINSIZE); // align and ensure min size +} + +/** Initilizes the root structure. */ +export function initializeRoot(): void { + var rootOffset = (__heap_base + AL_MASK) & ~AL_MASK; + var pagesBefore = memory.size(); + var pagesNeeded = ((((rootOffset + ROOT_SIZE) + 0xffff) & ~0xffff) >>> 16); + if (pagesNeeded > pagesBefore && memory.grow(pagesNeeded - pagesBefore) < 0) unreachable(); + var root = changetype(rootOffset); + root.flMap = 0; + SETTAIL(root, changetype(0)); + for (let fl: usize = 0; fl < FL_BITS; ++fl) { + SETSL(root, fl, 0); + for (let sl: u32 = 0; sl < SL_SIZE; ++sl) { + SETHEAD(root, fl, sl, null); + } + } + addMemory(root, (rootOffset + ROOT_SIZE + AL_MASK) & ~AL_MASK, memory.size() << 16); + ROOT = root; +} + +/** Allocates a block of the specified size. */ +export function allocateBlock(root: Root, size: usize): Block { + var payloadSize = prepareSize(size); + var block = searchBlock(root, payloadSize); + if (!block) { + growMemory(root, payloadSize); + block = searchBlock(root, payloadSize); + if (DEBUG) assert(block); // must be found now + } + if (DEBUG) assert((block.mmInfo & ~TAGS_MASK) >= payloadSize); // must fit + block.gcInfo = 0; // RC=0 + // block.rtId = 0; // set by the caller (__alloc) + block.rtSize = size; + removeBlock(root, block); + prepareBlock(root, block, payloadSize); + if (isDefined(ASC_RTRACE)) onalloc(block); + return block; +} + +/** Reallocates a block to the specified size. */ +export function reallocateBlock(root: Root, block: Block, size: usize): Block { + var payloadSize = prepareSize(size); + var blockInfo = block.mmInfo; + if (DEBUG) assert(!(blockInfo & FREE)); // must be used + + // possibly split and update runtime size if it still fits + if (payloadSize <= (blockInfo & ~TAGS_MASK)) { + prepareBlock(root, block, payloadSize); + block.rtSize = size; + return block; + } + + // merge with right free block if merger is large enough + var right = GETRIGHT(block); + var rightInfo = right.mmInfo; + if (rightInfo & FREE) { + let mergeSize = (blockInfo & ~TAGS_MASK) + BLOCK_OVERHEAD + (rightInfo & ~TAGS_MASK); + if (mergeSize >= payloadSize) { + removeBlock(root, right); + // TODO: this can yield an intermediate block larger than BLOCK_MAXSIZE, which + // is immediately split though. does this trigger any assertions / issues? + block.mmInfo = (blockInfo & TAGS_MASK) | mergeSize; + block.rtSize = size; + prepareBlock(root, block, payloadSize); + return block; + } + } + + // otherwise move the block + var newBlock = allocateBlock(root, size); + newBlock.gcInfo = block.gcInfo; + newBlock.rtId = block.rtId; + memory.copy(changetype(newBlock) + BLOCK_OVERHEAD, changetype(block) + BLOCK_OVERHEAD, size); + block.mmInfo = blockInfo | FREE; + insertBlock(root, block); + return newBlock; +} + +/** Frees a block. */ +export function freeBlock(root: Root, block: Block): void { + var blockInfo = block.mmInfo; + assert(!(blockInfo & FREE)); // must be used (user might call through to this) + block.mmInfo = blockInfo | FREE; + insertBlock(root, block); + if (isDefined(ASC_RTRACE)) onfree(block); +} + +// @ts-ignore: decorator +@global @unsafe +export function __alloc(size: usize, id: u32): usize { + var root = ROOT; + if (!root) { + initializeRoot(); + root = ROOT; + } + var block = allocateBlock(root, size); + block.rtId = id; + return changetype(block) + BLOCK_OVERHEAD; +} + +// @ts-ignore: decorator +@global @unsafe +export function __realloc(ref: usize, size: usize): usize { + if (DEBUG) assert(ROOT); // must be initialized + assert(ref != 0 && !(ref & AL_MASK)); // must exist and be aligned + return changetype(reallocateBlock(ROOT, changetype(ref - BLOCK_OVERHEAD), size)) + BLOCK_OVERHEAD; +} + +// @ts-ignore: decorator +@global @unsafe +export function __free(ref: usize): void { + if (DEBUG) assert(ROOT); // must be initialized + assert(ref != 0 && !(ref & AL_MASK)); // must exist and be aligned + freeBlock(ROOT, changetype(ref - BLOCK_OVERHEAD)); +} diff --git a/std/assembly/set.ts b/std/assembly/set.ts index e7f527ef4f..a235410545 100644 --- a/std/assembly/set.ts +++ b/std/assembly/set.ts @@ -1,16 +1,20 @@ -import { - HEADER_SIZE as HEADER_SIZE_AB -} from "./internal/arraybuffer"; +/// -import { - HASH -} from "./internal/hash"; +import { HASH } from "./util/hash"; // A deterministic hash set based on CloseTable from https://github.com/jorendorff/dht -@inline const INITIAL_CAPACITY = 4; -@inline const FILL_FACTOR: f64 = 8 / 3; -@inline const FREE_FACTOR: f64 = 3 / 4; +// @ts-ignore: decorator +@inline +const INITIAL_CAPACITY = 4; + +// @ts-ignore: decorator +@inline +const FILL_FACTOR: f64 = 8 / 3; + +// @ts-ignore: decorator +@inline +const FREE_FACTOR: f64 = 3 / 4; /** Structure of a set entry. */ @unmanaged class SetEntry { @@ -19,26 +23,34 @@ import { } /** Empty bit. */ -@inline const EMPTY: usize = 1 << 0; +// @ts-ignore: decorator +@inline +const EMPTY: usize = 1 << 0; /** Size of a bucket. */ -@inline const BUCKET_SIZE = sizeof(); +// @ts-ignore: decorator +@inline +const BUCKET_SIZE = sizeof(); /** Computes the alignment of an entry. */ -@inline function ENTRY_ALIGN(): usize { +// @ts-ignore: decorator +@inline +function ENTRY_ALIGN(): usize { // can align to 4 instead of 8 if 32-bit and K is <= 32-bits - const align = (sizeof() > sizeof() ? sizeof() : sizeof()) - 1; + const align = (sizeof() > sizeof() ? sizeof() : sizeof()) - 1; return align; } /** Computes the aligned size of an entry. */ -@inline function ENTRY_SIZE(): usize { - const align = ENTRY_ALIGN(); - const size = (offsetof>() + align) & ~align; +// @ts-ignore: decorator +@inline +function ENTRY_SIZE(): usize { + const align = ENTRY_ALIGN(); + const size = (offsetof>() + align) & ~align; return size; } -export class Set { +export class Set { // buckets holding references to the respective first entry within private buckets: ArrayBuffer; // usize[bucketsMask + 1] @@ -58,32 +70,31 @@ export class Set { const bucketsSize = INITIAL_CAPACITY * BUCKET_SIZE; this.buckets = new ArrayBuffer(bucketsSize); this.bucketsMask = INITIAL_CAPACITY - 1; - const entriesSize = INITIAL_CAPACITY * ENTRY_SIZE(); - this.entries = new ArrayBuffer(entriesSize, true); + const entriesSize = INITIAL_CAPACITY * ENTRY_SIZE(); + this.entries = new ArrayBuffer(entriesSize); this.entriesCapacity = INITIAL_CAPACITY; this.entriesOffset = 0; this.entriesCount = 0; } - private find(key: K, hashCode: u32): SetEntry | null { - var entry = load>( - changetype(this.buckets) + (hashCode & this.bucketsMask) * BUCKET_SIZE, - HEADER_SIZE_AB + private find(key: T, hashCode: u32): SetEntry | null { + var entry = load>( // unmanaged! + changetype(this.buckets) + (hashCode & this.bucketsMask) * BUCKET_SIZE ); while (entry) { if (!(entry.taggedNext & EMPTY) && entry.key == key) return entry; - entry = changetype>(entry.taggedNext & ~EMPTY); + entry = changetype>(entry.taggedNext & ~EMPTY); } return null; } - has(key: K): bool { - return this.find(key, HASH(key)) !== null; + has(key: T): bool { + return this.find(key, HASH(key)) !== null; } - add(key: K): void { - var hashCode = HASH(key); - var entry = this.find(key, hashCode); + add(key: T): void { + var hashCode = HASH(key); + var entry = this.find(key, hashCode); // unmanaged! if (!entry) { // check if rehashing is necessary if (this.entriesOffset == this.entriesCapacity) { @@ -94,23 +105,22 @@ export class Set { ); } // append new entry - let entries = this.entries; - entry = changetype>( - changetype(entries) + HEADER_SIZE_AB + this.entriesOffset++ * ENTRY_SIZE() - ); - entry.key = key; + entry = changetype>(changetype(this.entries) + this.entriesOffset++ * ENTRY_SIZE()); + entry.key = isManaged() + ? changetype(__retain(changetype(key))) + : key; ++this.entriesCount; // link with previous entry in bucket let bucketPtrBase = changetype(this.buckets) + (hashCode & this.bucketsMask) * BUCKET_SIZE; - entry.taggedNext = load(bucketPtrBase, HEADER_SIZE_AB); - store(bucketPtrBase, changetype(entry), HEADER_SIZE_AB); - if (isManaged()) __gc_link(changetype(this), changetype(key)); // tslint:disable-line + entry.taggedNext = load(bucketPtrBase); + store(bucketPtrBase, changetype(entry)); } } - delete(key: K): bool { - var entry = this.find(key, HASH(key)); + delete(key: T): bool { + var entry = this.find(key, HASH(key)); // unmanaged! if (!entry) return false; + if (isManaged()) __release(changetype(entry.key)); // exact 'key' entry.taggedNext |= EMPTY; --this.entriesCount; // check if rehashing is appropriate @@ -126,24 +136,24 @@ export class Set { var newBucketsCapacity = (newBucketsMask + 1); var newBuckets = new ArrayBuffer(newBucketsCapacity * BUCKET_SIZE); var newEntriesCapacity = (newBucketsCapacity * FILL_FACTOR); - var newEntries = new ArrayBuffer(newEntriesCapacity * ENTRY_SIZE(), true); + var newEntries = new ArrayBuffer(newEntriesCapacity * ENTRY_SIZE()); // copy old entries to new entries - var oldPtr = changetype(this.entries) + HEADER_SIZE_AB; - var oldEnd = oldPtr + this.entriesOffset * ENTRY_SIZE(); - var newPtr = changetype(newEntries) + HEADER_SIZE_AB; + var oldPtr = changetype(this.entries); + var oldEnd = oldPtr + this.entriesOffset * ENTRY_SIZE(); + var newPtr = changetype(newEntries); while (oldPtr != oldEnd) { - let oldEntry = changetype>(oldPtr); + let oldEntry = changetype>(oldPtr); // unmanaged! if (!(oldEntry.taggedNext & EMPTY)) { - let newEntry = changetype>(newPtr); + let newEntry = changetype>(newPtr); // unmanaged! newEntry.key = oldEntry.key; - let newBucketIndex = HASH(oldEntry.key) & newBucketsMask; + let newBucketIndex = HASH(oldEntry.key) & newBucketsMask; let newBucketPtrBase = changetype(newBuckets) + newBucketIndex * BUCKET_SIZE; - newEntry.taggedNext = load(newBucketPtrBase, HEADER_SIZE_AB); - store(newBucketPtrBase, newPtr, HEADER_SIZE_AB); - newPtr += ENTRY_SIZE(); + newEntry.taggedNext = load(newBucketPtrBase); + store(newBucketPtrBase, newPtr); + newPtr += ENTRY_SIZE(); } - oldPtr += ENTRY_SIZE(); + oldPtr += ENTRY_SIZE(); } this.buckets = newBuckets; @@ -153,24 +163,43 @@ export class Set { this.entriesOffset = this.entriesCount; } + values(): T[] { + // FIXME: this is preliminary, needs iterators/closures + var start = changetype(this.entries); + var size = this.entriesOffset; + var values = Array.create(size); + for (let i = 0; i < size; ++i) { + let entry = changetype>(start + i * ENTRY_SIZE()); + if (!(entry.taggedNext & EMPTY)) { + values.push(entry.key); + } + } + return values; + } + toString(): string { return "[object Set]"; } - private __gc(): void { - __gc_mark(changetype(this.buckets)); // tslint:disable-line - var entries = this.entries; - __gc_mark(changetype(entries)); // tslint:disable-line - if (isManaged()) { - let offset: usize = 0; - let end: usize = this.entriesOffset * ENTRY_SIZE(); - while (offset < end) { - let entry = changetype>( - changetype(entries) + HEADER_SIZE_AB + offset * ENTRY_SIZE() - ); - if (!(entry.taggedNext & EMPTY)) __gc_mark(changetype(entry.key)); // tslint:disable-line - offset += ENTRY_SIZE(); + // RT integration + + @unsafe private __visit_impl(cookie: u32): void { + __visit(changetype(this.buckets), cookie); + var entries = changetype(this.entries); + if (isManaged()) { + let cur = entries; + let end = cur + this.entriesOffset * ENTRY_SIZE(); + while (cur < end) { + let entry = changetype>(cur); + if (!(entry.taggedNext & EMPTY)) { + let val = changetype(entry.key); + if (isNullable()) { + if (val) __visit(val, cookie); + } else __visit(val, cookie); + } + cur += ENTRY_SIZE(); } } + __visit(entries, cookie); } } diff --git a/std/assembly/shared/feature.ts b/std/assembly/shared/feature.ts new file mode 100644 index 0000000000..13ae7e027a --- /dev/null +++ b/std/assembly/shared/feature.ts @@ -0,0 +1,17 @@ +// This file is shared with the compiler and must remain portable + +/** Indicates specific features to activate. */ +export const enum Feature { + /** No additional features. */ + NONE = 0, + /** Sign extension operations. */ + SIGN_EXTENSION = 1 << 0, // see: https://github.com/WebAssembly/sign-extension-ops + /** Mutable global imports and exports. */ + MUTABLE_GLOBAL = 1 << 1, // see: https://github.com/WebAssembly/mutable-global + /** Bulk memory operations. */ + BULK_MEMORY = 1 << 2, // see: https://github.com/WebAssembly/bulk-memory-operations + /** SIMD types and operations. */ + SIMD = 1 << 3, // see: https://github.com/WebAssembly/simd + /** Threading and atomic operations. */ + THREADS = 1 << 4 // see: https://github.com/WebAssembly/threads +} diff --git a/std/assembly/shared/target.ts b/std/assembly/shared/target.ts new file mode 100644 index 0000000000..8aecd4705e --- /dev/null +++ b/std/assembly/shared/target.ts @@ -0,0 +1,11 @@ +// This file is shared with the compiler and must remain portable + +/** Compilation target. */ +export enum Target { + /** WebAssembly with 32-bit pointers. */ + WASM32, + /** WebAssembly with 64-bit pointers. Experimental and not supported by any runtime yet. */ + WASM64, + /** Portable. */ + JS +} diff --git a/std/assembly/shared/typeinfo.ts b/std/assembly/shared/typeinfo.ts new file mode 100644 index 0000000000..737ce3d745 --- /dev/null +++ b/std/assembly/shared/typeinfo.ts @@ -0,0 +1,74 @@ +// This file is shared with the compiler and must remain portable + +// ╒═══════════════════ Typeinfo interpretation ═══════════════════╕ +// 3 2 1 +// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits +// ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┤ ◄─ __rtti_base +// │ count │ +// ╞═══════════════════════════════════════════════════════════════╡ ┐ +// │ Typeinfo#flags [id=0] │ id < count +// ├ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┤ +// │ Typeinfo#base [id=0] │ +// ├───────────────────────────────────────────────────────────────┤ +// │ ... │ + +/** Runtime type information data structure. */ +@unmanaged +export class Typeinfo { + /** Flags describing the shape of this class type. */ + flags: TypeinfoFlags; + /** Base class id or `0` if none. */ + base: u32; +} + +/** Runtime type information flags. */ +export const enum TypeinfoFlags { + /** No specific flags. */ + NONE = 0, + /** Type is an `ArrayBufferView`. */ + ARRAYBUFFERVIEW = 1 << 0, + /** Type is an `Array`. */ + ARRAY = 1 << 1, + /** Type is a `Set`. */ + SET = 1 << 2, + /** Type is a `Map`. */ + MAP = 1 << 3, + /** Type is inherently acyclic. */ + ACYCLIC = 1 << 4, + /** Value alignment of 1 byte. */ + VALUE_ALIGN_0 = 1 << 5, + /** Value alignment of 2 bytes. */ + VALUE_ALIGN_1 = 1 << 6, + /** Value alignment of 4 bytes. */ + VALUE_ALIGN_2 = 1 << 7, + /** Value alignment of 8 bytes. */ + VALUE_ALIGN_3 = 1 << 8, + /** Value alignment of 16 bytes. */ + VALUE_ALIGN_4 = 1 << 9, + /** Value is a signed type. */ + VALUE_SIGNED = 1 << 10, + /** Value is a float type. */ + VALUE_FLOAT = 1 << 11, + /** Value type is nullable. */ + VALUE_NULLABLE = 1 << 12, + /** Value type is managed. */ + VALUE_MANAGED = 1 << 13, + /** Key alignment of 1 byte. */ + KEY_ALIGN_0 = 1 << 14, + /** Key alignment of 2 bytes. */ + KEY_ALIGN_1 = 1 << 15, + /** Key alignment of 4 bytes. */ + KEY_ALIGN_2 = 1 << 16, + /** Key alignment of 8 bytes. */ + KEY_ALIGN_3 = 1 << 17, + /** Key alignment of 16 bytes. */ + KEY_ALIGN_4 = 1 << 18, + /** Value is a signed type. */ + KEY_SIGNED = 1 << 19, + /** Value is a float type. */ + KEY_FLOAT = 1 << 20, + /** Key type is nullable. */ + KEY_NULLABLE = 1 << 21, + /** Key type is managed. */ + KEY_MANAGED = 1 << 22 +} diff --git a/std/assembly/string.ts b/std/assembly/string.ts index c1a343c224..3e7f06c7c6 100644 --- a/std/assembly/string.ts +++ b/std/assembly/string.ts @@ -1,243 +1,185 @@ -import { - HEADER_SIZE, - MAX_LENGTH, - allocateUnsafe, - compareUnsafe, - repeatUnsafe, - copyUnsafe, - isWhiteSpaceOrLineTerminator, - CharCode, - parse -} from "./internal/string"; - -import { - STORE -} from "./internal/arraybuffer"; - -@sealed -export class String { - - readonly length: i32; // capped to [0, MAX_LENGTH] - - // TODO Add and handle second argument - static fromCharCode(code: i32): String { - var out = allocateUnsafe(1); - store( - changetype(out), - code, - HEADER_SIZE - ); - return out; +/// + +import { BLOCK, BLOCK_OVERHEAD, BLOCK_MAXSIZE } from "./rt/common"; +import { compareImpl, parse, CharCode, isWhiteSpaceOrLineTerminator } from "./util/string"; +import { E_INVALIDLENGTH } from "./util/error"; +import { ArrayBufferView } from "./arraybuffer"; +import { idof } from "./builtins"; + +@sealed export abstract class String { + + @lazy static readonly MAX_LENGTH: i32 = BLOCK_MAXSIZE >>> alignof(); + + static fromCharCode(unit: i32, surr: i32 = -1): string { + var out: usize; + if (~surr) { + out = __alloc(4, idof()); + store(out, unit); + store(out, surr, 2); + } else { + out = __alloc(2, idof()); + store(out, unit); + } + return changetype(out); // retains } - static fromCodePoint(code: i32): String { + static fromCodePoint(code: i32): string { assert(code <= 0x10FFFF); var sur = code > 0xFFFF; - var out = allocateUnsafe(sur + 1); + var out = __alloc((i32(sur) + 1) << 1, idof()); if (!sur) { - store( - changetype(out), - code, - HEADER_SIZE - ); + store(out, code); } else { code -= 0x10000; let hi: u32 = (code >>> 10) + 0xD800; let lo: u32 = (code & 0x3FF) + 0xDC00; - store( - changetype(out), - (hi << 16) | lo, - HEADER_SIZE - ); + store(out, (hi << 16) | lo); } - return out; + return changetype(out); // retains } - @operator("[]") - charAt(pos: i32): String { - assert(this !== null); + get length(): i32 { + return changetype(changetype(this) - BLOCK_OVERHEAD).rtSize >> 1; + } + @operator("[]") charAt(pos: i32): String { + assert(this !== null); if (pos >= this.length) return changetype(""); - - var out = allocateUnsafe(1); - store( - changetype(out), - load( - changetype(this) + (pos << 1), - HEADER_SIZE - ), - HEADER_SIZE - ); - return out; + var out = __alloc(2, idof()); + store(out, load(changetype(this) + (pos << 1))); + return changetype(out); // retains } charCodeAt(pos: i32): i32 { - assert(this !== null); if (pos >= this.length) return -1; // (NaN) - - return load( - changetype(this) + (pos << 1), - HEADER_SIZE - ); + return load(changetype(this) + (pos << 1)); } codePointAt(pos: i32): i32 { - assert(this !== null); if (pos >= this.length) return -1; // (undefined) - - var first = load( - changetype(this) + (pos << 1), - HEADER_SIZE - ); - if (first < 0xD800 || first > 0xDBFF || pos + 1 == this.length) { - return first; - } - var second = load( - changetype(this) + ((pos + 1) << 1), - HEADER_SIZE - ); + var first = load(changetype(this) + (pos << 1)); + if (first < 0xD800 || first > 0xDBFF || pos + 1 == this.length) return first; + var second = load(changetype(this) + ((pos + 1) << 1)); if (second < 0xDC00 || second > 0xDFFF) return first; return ((first - 0xD800) << 10) + (second - 0xDC00) + 0x10000; } - @operator("+") - private static __concat(left: String, right: String): String { - if (!changetype(left)) left = changetype("null"); - return left.concat(right); + @operator("+") private static __concat(left: String, right: String): String { + return select(left, changetype("null"), left !== null).concat(right); } concat(other: String): String { - assert(this !== null); if (other === null) other = changetype("null"); - - var thisLen: isize = this.length; - var otherLen: isize = other.length; - var outLen: usize = thisLen + otherLen; - if (outLen == 0) return changetype(""); - var out = allocateUnsafe(outLen); - copyUnsafe(out, 0, this, 0, thisLen); - copyUnsafe(out, thisLen, other, 0, otherLen); + var thisSize: isize = this.length << 1; + var otherSize: isize = other.length << 1; + var outSize: usize = thisSize + otherSize; + if (outSize == 0) return changetype(""); + var out = changetype(__alloc(outSize, idof())); // retains + memory.copy(changetype(out), changetype(this), thisSize); + memory.copy(changetype(out) + thisSize, changetype(other), otherSize); return out; } - endsWith(searchString: String, endPosition: i32 = MAX_LENGTH): bool { + endsWith(search: String, end: i32 = String.MAX_LENGTH): bool { assert(this !== null); - if (searchString === null) return false; - var end = min(max(endPosition, 0), this.length); - var searchLength: isize = searchString.length; - var start: isize = end - searchLength; - if (start < 0) return false; - return !compareUnsafe(this, start, searchString, 0, searchLength); + if (search === null) return false; + end = min(max(end, 0), this.length); + var searchLength = search.length; + var searchStart = end - searchLength; + if (searchStart < 0) return false; + // @ts-ignore: string <-> String + return !compareImpl(this, searchStart, search, 0, searchLength); } - @operator("==") - private static __eq(left: String, right: String): bool { + @operator("==") private static __eq(left: String | null, right: String | null): bool { if (left === right) return true; if (left === null || right === null) return false; - var leftLength = left.length; if (leftLength != right.length) return false; - - return !compareUnsafe(left, 0, right, 0, leftLength); + // @ts-ignore: string <-> String + return !compareImpl(left, 0, right, 0, leftLength); } @operator.prefix("!") - private static __not(str: String): bool { + private static __not(str: String | null): bool { return str === null || !str.length; } @operator("!=") - private static __ne(left: String, right: String): bool { + private static __ne(left: String | null, right: String | null): bool { return !this.__eq(left, right); } - @operator(">") - private static __gt(left: String, right: String): bool { + @operator(">") private static __gt(left: String | null, right: String | null): bool { if (left === right || left === null || right === null) return false; - var leftLength = left.length; var rightLength = right.length; - if (!leftLength) return false; if (!rightLength) return true; - - var length = min(leftLength, rightLength); - return compareUnsafe(left, 0, right, 0, length) > 0; + // @ts-ignore: string <-> String + return compareImpl(left, 0, right, 0, min(leftLength, rightLength)) > 0; } - @operator(">=") - private static __gte(left: String, right: String): bool { + @operator(">=") private static __gte(left: String, right: String): bool { return !this.__lt(left, right); } - @operator("<") - private static __lt(left: String, right: String): bool { + @operator("<") private static __lt(left: String, right: String): bool { if (left === right || left === null || right === null) return false; - var leftLength = left.length; var rightLength = right.length; - if (!rightLength) return false; if (!leftLength) return true; - - var length = min(leftLength, rightLength); - return compareUnsafe(left, 0, right, 0, length) < 0; + // @ts-ignore: string <-> String + return compareImpl(left, 0, right, 0, min(leftLength, rightLength)) < 0; } - @operator("<=") - private static __lte(left: String, right: String): bool { + @operator("<=") private static __lte(left: String, right: String): bool { return !this.__gt(left, right); } - @inline - includes(searchString: String, position: i32 = 0): bool { - return this.indexOf(searchString, position) != -1; + includes(search: String, start: i32 = 0): bool { + return this.indexOf(search, start) != -1; } - indexOf(searchString: String, fromIndex: i32 = 0): i32 { - assert(this !== null); - if (searchString === null) searchString = changetype("null"); - - var searchLen: isize = searchString.length; + indexOf(search: String, start: i32 = 0): i32 { + var searchLen = search.length; if (!searchLen) return 0; - var len: isize = this.length; + var len = this.length; if (!len) return -1; - var start = min(max(fromIndex, 0), len); - len -= searchLen; - for (let k: isize = start; k <= len; ++k) { - if (!compareUnsafe(this, k, searchString, 0, searchLen)) return k; + var searchStart = min(max(start, 0), len); + for (len -= searchLen; searchStart <= len; ++searchStart) { + // @ts-ignore: string <-> String + if (!compareImpl(this, searchStart, search, 0, searchLen)) return searchStart; } return -1; } - lastIndexOf(searchString: String, fromIndex: i32 = i32.MAX_VALUE): i32 { - assert(this !== null); - if (searchString === null) searchString = changetype("null"); - - var len: isize = this.length; - var searchLen: isize = searchString.length; - if (!searchLen) return len; + lastIndexOf(search: String, start: i32 = i32.MAX_VALUE): i32 { + var searchLen = search.length; + if (!searchLen) return this.length; + var len = this.length; if (!len) return -1; - var start = min(max(fromIndex, 0), len - searchLen); - for (let k = start; k >= 0; --k) { - if (!compareUnsafe(this, k, searchString, 0, searchLen)) return k; + var searchStart = min(max(start, 0), len - searchLen); + for (; searchStart >= 0; --searchStart) { + // @ts-ignore: string <-> String + if (!compareImpl(this, searchStart, search, 0, searchLen)) return searchStart; } return -1; } - startsWith(searchString: String, position: i32 = 0): bool { + startsWith(search: String, start: i32 = 0): bool { assert(this !== null); - if (searchString === null) searchString = changetype("null"); - - var pos: isize = position; - var len: isize = this.length; - var start = min(max(pos, 0), len); - var searchLength: isize = searchString.length; - if (searchLength + start > len) return false; - return !compareUnsafe(this, start, searchString, 0, searchLength); + if (search === null) search = changetype("null"); + var len = this.length; + var searchStart = min(max(start, 0), len); + var searchLength = search.length; + if (searchLength + searchStart > len) return false; + // @ts-ignore: string <-> String + return !compareImpl(this, searchStart, search, 0, searchLength); } - substr(start: i32, length: i32 = i32.MAX_VALUE): String { + substr(start: i32, length: i32 = i32.MAX_VALUE): String { // legacy assert(this !== null); var intStart: isize = start; var end: isize = length; @@ -245,52 +187,52 @@ export class String { if (intStart < 0) intStart = max(size + intStart, 0); var resultLength = min(max(end, 0), size - intStart); if (resultLength <= 0) return changetype(""); - var out = allocateUnsafe(resultLength); - copyUnsafe(out, 0, this, intStart, resultLength); - return out; + var out = __alloc(resultLength << 1, idof()); + memory.copy(out, changetype(this) + intStart, resultLength); + return changetype(out); // retains } substring(start: i32, end: i32 = i32.MAX_VALUE): String { assert(this !== null); - var len = this.length; - var finalStart = min(max(start, 0), len); - var finalEnd = min(max(end, 0), len); - var from = min(finalStart, finalEnd); - var to = max(finalStart, finalEnd); - len = to - from; + var len: isize = this.length; + var finalStart = min(max(start, 0), len); + var finalEnd = min(max(end, 0), len); + var fromPos = min(finalStart, finalEnd) << 1; + var toPos = max(finalStart, finalEnd) << 1; + len = toPos - fromPos; if (!len) return changetype(""); - if (!from && to == this.length) return this; - var out = allocateUnsafe(len); - copyUnsafe(out, 0, this, from, len); - return out; + if (!fromPos && toPos == this.length << 1) return this; + var out = __alloc(len, idof()); + memory.copy(out, changetype(this) + fromPos, len); + return changetype(out); // retains } trim(): String { assert(this !== null); - var length: usize = this.length; - + var length = this.length; + var size: usize = length << 1; while ( - length && + size && isWhiteSpaceOrLineTerminator( - load(changetype(this) + (length << 1), HEADER_SIZE) + load(changetype(this) + size) ) ) { - --length; + size -= 2; } - var start: usize = 0; + var offset: usize = 0; while ( - start < length && + offset < size && isWhiteSpaceOrLineTerminator( - load(changetype(this) + (start << 1), HEADER_SIZE) + load(changetype(this) + offset) ) ) { - ++start, --length; + offset += 2; size -= 2; } - if (!length) return changetype(""); - if (!start && length == this.length) return this; - var out = allocateUnsafe(length); - copyUnsafe(out, 0, this, start, length); - return out; + if (!size) return changetype(""); + if (!start && size == length << 1) return this; + var out = __alloc(size, idof()); + memory.copy(out, changetype(this) + offset, size); + return changetype(out); // retains } @inline @@ -305,80 +247,83 @@ export class String { trimStart(): String { assert(this !== null); - var start: isize = 0; - var len: isize = this.length; + var size = this.length << 1; + var offset: usize = 0; while ( - start < len && + offset < size && isWhiteSpaceOrLineTerminator( - load(changetype(this) + (start << 1), HEADER_SIZE) + load(changetype(this) + offset) ) ) { - ++start; + offset += 2; } - if (!start) return this; - var outLen = len - start; - if (!outLen) return changetype(""); - var out = allocateUnsafe(outLen); - copyUnsafe(out, 0, this, start, outLen); - return out; + if (!offset) return this; + size -= offset; + if (!size) return changetype(""); + var out = __alloc(size, idof()); + memory.copy(out, changetype(this) + offset, size); + return changetype(out); // retains } trimEnd(): String { assert(this !== null); - var len: isize = this.length; + var originalSize = this.length << 1; + var size = originalSize; while ( - len > 0 && + size && isWhiteSpaceOrLineTerminator( - load(changetype(this) + (len << 1), HEADER_SIZE) + load(changetype(this) + size) ) ) { - --len; + size -= 2; } - if (len <= 0) return changetype(""); - if (len == this.length) return this; - var out = allocateUnsafe(len); - copyUnsafe(out, 0, this, 0, len); - return out; + if (!size) return changetype(""); + if (size == originalSize) return this; + var out = __alloc(size, idof()); + memory.copy(out, changetype(this), size); + return changetype(out); // retains } - padStart(targetLength: i32, padString: String = changetype(" ")): String { + padStart(length: i32, pad: string = " "): String { assert(this !== null); - var length = this.length; - var padLen = padString.length; - if (targetLength < length || !padLen) return this; - var len = targetLength - length; - var out = allocateUnsafe(targetLength); - if (len > padLen) { - let count = (len - 1) / padLen; - let base = count * padLen; - let rest = len - base; - repeatUnsafe(out, 0, padString, count); - if (rest) copyUnsafe(out, base, padString, 0, rest); + var thisSize = this.length << 1; + var targetSize = length << 1; + var padSize = pad.length << 1; + if (targetSize < thisSize || !padSize) return this; + var prependSize = targetSize - thisSize; + var out = __alloc(targetSize, idof()); + if (prependSize > padSize) { + let repeatCount = (prependSize - 2) / padSize; + let restBase = repeatCount * padSize; + let restSize = prependSize - restBase; + memory.repeat(out, changetype(pad), padSize, repeatCount); + memory.copy(out + restBase, changetype(pad), restSize); } else { - copyUnsafe(out, 0, padString, 0, len); + memory.copy(out, changetype(pad), prependSize); } - if (length) copyUnsafe(out, len, this, 0, length); - return out; + memory.copy(out + prependSize, changetype(this), thisSize); + return changetype(out); // retains } - padEnd(targetLength: i32, padString: String = changetype(" ")): String { + padEnd(length: i32, pad: string = " "): String { assert(this !== null); - var length = this.length; - var padLen = padString.length; - if (targetLength < length || !padLen) return this; - var len = targetLength - length; - var out = allocateUnsafe(targetLength); - if (length) copyUnsafe(out, 0, this, 0, length); - if (len > padLen) { - let count = (len - 1) / padLen; - let base = count * padLen; - let rest = len - base; - repeatUnsafe(out, length, padString, count); - if (rest) copyUnsafe(out, base + length, padString, 0, rest); + var thisSize = this.length << 1; + var targetSize = length << 1; + var padSize = pad.length << 1; + if (targetSize < thisSize || !padSize) return this; + var appendSize = targetSize - thisSize; + var out = __alloc(targetSize, idof()); + memory.copy(out, changetype(this), thisSize); + if (appendSize > padSize) { + let repeatCount = (appendSize - 2) / padSize; + let restBase = repeatCount * padSize; + let restSize = appendSize - restBase; + memory.repeat(out + thisSize, changetype(pad), padSize, repeatCount); + memory.copy(out + thisSize + restBase, changetype(pad), restSize); } else { - copyUnsafe(out, length, padString, 0, len); + memory.copy(out + thisSize, changetype(pad), appendSize); } - return out; + return changetype(out); // retains } repeat(count: i32 = 0): String { @@ -386,88 +331,81 @@ export class String { var length = this.length; // Most browsers can't handle strings 1 << 28 chars or longer - if (count < 0 || length * count > (1 << 28)) { - throw new RangeError("Invalid count value"); + if (count < 0 || length * count > (1 << 28)) { + throw new RangeError(E_INVALIDLENGTH); } if (count == 0 || !length) return changetype(""); if (count == 1) return this; - - var result = allocateUnsafe(length * count); - repeatUnsafe(result, 0, this, count); - return result; + var out = __alloc((length * count) << 1, idof()); + memory.repeat(out, changetype(this), length << 1, count); + return changetype(out); // retains } - slice(beginIndex: i32, endIndex: i32 = i32.MAX_VALUE): String { + slice(start: i32, end: i32 = i32.MAX_VALUE): String { var len = this.length; - var begin = beginIndex < 0 ? max(beginIndex + len, 0) : min(beginIndex, len); - var end = endIndex < 0 ? max(endIndex + len, 0) : min(endIndex, len); - len = end - begin; + start = start < 0 ? max(start + len, 0) : min(start, len); + end = end < 0 ? max(end + len, 0) : min(end, len); + len = end - start; if (len <= 0) return changetype(""); - var out = allocateUnsafe(len); - copyUnsafe(out, 0, this, begin, len); - return out; + var out = __alloc(len << 1, idof()); + memory.copy(out, changetype(this) + (start << 1), len << 1); + return changetype(out); // retains } - split(separator: String = null, limit: i32 = i32.MAX_VALUE): String[] { + split(separator: String | null = null, limit: i32 = i32.MAX_VALUE): String[] { assert(this !== null); - if (!limit) return new Array(); + if (!limit) return changetype>(__allocArray(0, alignof(), idof>())); // retains if (separator === null) return [this]; var length: isize = this.length; var sepLen: isize = separator.length; if (limit < 0) limit = i32.MAX_VALUE; if (!sepLen) { - if (!length) return new Array(); + if (!length) return changetype>(__allocArray(0, alignof(), idof>())); // retains // split by chars length = min(length, limit); - let result = new Array(length); - let buffer = result.buffer_; + let result = __allocArray(length, alignof(), idof>()); + let resultStart = changetype(result).dataStart; for (let i: isize = 0; i < length; ++i) { - let char = allocateUnsafe(1); - store( - changetype(char), - load( - changetype(this) + (i << 1), - HEADER_SIZE - ), - HEADER_SIZE - ); - STORE(buffer, i, char); + let charStr = __alloc(2, idof()); + store(charStr, load(changetype(this) + (i << 1))); + store(resultStart + (i << alignof()), charStr); // result[i] = charStr + if (isManaged()) __retain(charStr); } - return result; + return changetype>(result); // retains } else if (!length) { - let result = new Array(1); - unchecked(result[0] = changetype("")); - return result; + let result = __allocArray(1, alignof(), idof>()); + store(changetype(result).dataStart, changetype("")); // static "" + return changetype>(result); // retains } - var result = new Array(); + var result = changetype>(__allocArray(0, alignof(), idof>())); // retains var end = 0, start = 0, i = 0; while ((end = this.indexOf(separator, start)) != -1) { let len = end - start; if (len > 0) { - let out = allocateUnsafe(len); - copyUnsafe(out, 0, this, start, len); - result.push(out); + let out = __alloc(len << 1, idof()); + memory.copy(out, changetype(this) + (start << 1), len << 1); + result.push(changetype(out)); } else { result.push(changetype("")); } - if (++i == limit) return result; + if (++i == limit) return changetype>(result); // retains start = end + sepLen; } - if (!start) { - let result = new Array(1); - unchecked(result[0] = this); - return result; + if (!start) { // also means: loop above didn't do anything + result.push(this); + return changetype>(result); // retains } var len = length - start; if (len > 0) { - let out = allocateUnsafe(len); - copyUnsafe(out, 0, this, start, len); - result.push(out); + let out = __alloc(len << 1, idof()); + memory.copy(out, changetype(this) + (start << 1), len << 1); + result.push(changetype(out)); // retains } else { - result.push(changetype("")); + result.push(changetype("")); // static "" } - return result; + return changetype>(result); // retains + // releases result } toString(): String { @@ -479,7 +417,7 @@ export class String { var pos: usize = 0; var end = this.length; while (pos < end) { - let c = load(changetype(this) + (pos << 1), HEADER_SIZE); + let c = load(changetype(this) + (pos << 1)); if (c < 128) { len += 1; ++pos; } else if (c < 2048) { @@ -487,7 +425,7 @@ export class String { } else { if ( (c & 0xFC00) == 0xD800 && pos + 1 < end && - (load(changetype(this) + ((pos + 1) << 1), HEADER_SIZE) & 0xFC00) == 0xDC00 + (load(changetype(this) + ((pos + 1) << 1)) & 0xFC00) == 0xDC00 ) { len += 4; pos += 2; } else { @@ -501,7 +439,7 @@ export class String { static fromUTF8(ptr: usize, len: usize): String { if (len < 1) return changetype(""); var ptrPos = 0; - var buf = memory.allocate(len << 1); + var buf = __alloc(len << 1, 0); var bufPos = 0; while (ptrPos < len) { let cp = load(ptr + ptrPos++); @@ -535,19 +473,19 @@ export class String { } } assert(ptrPos == len); - var str = allocateUnsafe((bufPos >> 1)); - memory.copy(changetype(str) + HEADER_SIZE, buf, bufPos); - memory.free(buf); - return str; + var out = __alloc(bufPos, idof()); + memory.copy(out, buf, bufPos); + __free(buf); + return changetype(out); // retains } toUTF8(): usize { - var buf = memory.allocate(this.lengthUTF8); + var buf = __alloc(this.lengthUTF8, 0); var pos: usize = 0; var end = this.length; var off: usize = 0; while (pos < end) { - let c1 = load(changetype(this) + (pos << 1), HEADER_SIZE); + let c1 = load(changetype(this) + (pos << 1)); if (c1 < 128) { store(buf + off, c1); ++off; ++pos; @@ -559,7 +497,7 @@ export class String { } else { let ptr = buf + off; if ((c1 & 0xFC00) == 0xD800 && pos + 1 < end) { - let c2 = load(changetype(this) + ((pos + 1) << 1), HEADER_SIZE); + let c2 = load(changetype(this) + ((pos + 1) << 1)); if ((c2 & 0xFC00) == 0xDC00) { c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF); store(ptr, c1 >> 18 | 240); @@ -581,17 +519,21 @@ export class String { } } +// @ts-ignore: nolib export type string = String; export function parseInt(str: String, radix: i32 = 0): f64 { + // @ts-ignore: string <-> String return parse(str, radix); } export function parseI32(str: String, radix: i32 = 0): i32 { + // @ts-ignore: string <-> String return parse(str, radix); } export function parseI64(str: String, radix: i32 = 0): i64 { + // @ts-ignore: string <-> String return parse(str, radix); } @@ -600,18 +542,23 @@ export function parseFloat(str: String): f64 { var len: i32 = str.length; if (!len) return NaN; - var ptr = changetype(str) /* + HEAD -> offset */; - var code = load(ptr, HEADER_SIZE); + var ptr = changetype(str); + var code = load(ptr); // determine sign var sign: f64; + // trim white spaces + while (isWhiteSpaceOrLineTerminator(code)) { + code = load(ptr += 2); + --len; + } if (code == CharCode.MINUS) { if (!--len) return NaN; - code = load(ptr += 2, HEADER_SIZE); + code = load(ptr += 2); sign = -1; } else if (code == CharCode.PLUS) { if (!--len) return NaN; - code = load(ptr += 2, HEADER_SIZE); + code = load(ptr += 2); sign = 1; } else { sign = 1; @@ -620,12 +567,12 @@ export function parseFloat(str: String): f64 { // calculate value var num: f64 = 0; while (len--) { - code = load(ptr, HEADER_SIZE); + code = load(ptr); if (code == CharCode.DOT) { ptr += 2; let fac: f64 = 0.1; // precision :( while (len--) { - code = load(ptr, HEADER_SIZE); + code = load(ptr); if (code == CharCode.E || code == CharCode.e) { assert(false); // TODO } diff --git a/std/assembly/symbol.ts b/std/assembly/symbol.ts index 625b2c0b90..97baef4d58 100644 --- a/std/assembly/symbol.ts +++ b/std/assembly/symbol.ts @@ -1,10 +1,87 @@ import { Map } from "./map"; -@lazy var stringToId: Map; -@lazy var idToString: Map; -@lazy var nextId: usize = 12; // Symbol.unscopables + 1 +// @ts-ignore: decorator +@lazy +var stringToId: Map; + +// @ts-ignore: decorator +@lazy +var idToString: Map; + +// @ts-ignore: decorator +@lazy +var nextId: usize = 12; // Symbol.unscopables + 1 + +@unmanaged @sealed abstract class _Symbol { + + // TODO: all of the following default symbols are unused currently yet add to + // binary size if #toString becomes compiled. Ultimately we'll most likely want + // to remove the unsupported ones and only keep what's actually supported. + + // @ts-ignore: decorator + @lazy + static readonly hasInstance: symbol = changetype(1); + + // @ts-ignore: decorator + @lazy + static readonly isConcatSpreadable: symbol = changetype(2); + + // @ts-ignore: decorator + @lazy + static readonly isRegExp: symbol = changetype(3); + + // @ts-ignore: decorator + @lazy + static readonly iterator: symbol = changetype(3); + + // @ts-ignore: decorator + @lazy + static readonly match: symbol = changetype(4); + + // @ts-ignore: decorator + @lazy + static readonly replace: symbol = changetype(5); + + // @ts-ignore: decorator + @lazy + static readonly search: symbol = changetype(6); + + // @ts-ignore: decorator + @lazy + static readonly species: symbol = changetype(7); + + // @ts-ignore: decorator + @lazy + static readonly split: symbol = changetype(8); + + // @ts-ignore: decorator + @lazy + static readonly toPrimitive: symbol = changetype(9); + + // @ts-ignore: decorator + @lazy + static readonly toStringTag: symbol = changetype(10); + + // @ts-ignore: decorator + @lazy + static readonly unscopables: symbol = changetype(11); + + static for(key: string): symbol { + if (!stringToId) { stringToId = new Map(); idToString = new Map(); } + else if (stringToId.has(key)) return changetype(stringToId.get(key)); + var id = nextId++; + if (!id) unreachable(); // out of ids + stringToId.set(key, id); + idToString.set(id, key); + return changetype(id); + } + + static keyFor(sym: symbol): string | null { + return idToString !== null && idToString.has(changetype(sym)) + ? idToString.get(changetype(sym)) + : null; + } -@unmanaged export class symbol { toString(): string { var id = changetype(this); var str = ""; @@ -35,37 +112,7 @@ export function Symbol(description: string | null = null): symbol { return changetype(id); } -export namespace Symbol { - - // well-known symbols - @lazy export const hasInstance = changetype(1); - @lazy export const isConcatSpreadable = changetype(2); - @lazy export const isRegExp = changetype(3); - @lazy export const iterator = changetype(3); - @lazy export const match = changetype(4); - @lazy export const replace = changetype(5); - @lazy export const search = changetype(6); - @lazy export const species = changetype(7); - @lazy export const split = changetype(8); - @lazy export const toPrimitive = changetype(9); - @lazy export const toStringTag = changetype(10); - @lazy export const unscopables = changetype(11); - - /* tslint:disable */// not valid TS - export function for(key: string): symbol { - if (!stringToId) { stringToId = new Map(); idToString = new Map(); } - else if (stringToId.has(key)) return changetype(stringToId.get(key)); - var id = nextId++; - if (!id) unreachable(); // out of ids - stringToId.set(key, id); - idToString.set(id, key); - return changetype(id); - } - /* tslint:enable */ +export type Symbol = _Symbol; - export function keyFor(sym: symbol): string | null { - return idToString !== null && idToString.has(changetype(sym)) - ? idToString.get(changetype(sym)) - : null; - } -} +// @ts-ignore: nolib +export type symbol = _Symbol; diff --git a/std/assembly/table.ts b/std/assembly/table.ts index b0f9c1cdda..5598bc88ae 100644 --- a/std/assembly/table.ts +++ b/std/assembly/table.ts @@ -1,16 +1,16 @@ -export namespace table { +import { E_NOTIMPLEMENTED } from "./util/error"; - // export function copy(dst: u32, src: u32, n: u32): void { - // __table_copy(dst, src, n); - // } +export namespace table { - // Passive elements + export function copy(dst: u32, src: u32, n: u32): void { + throw new Error(E_NOTIMPLEMENTED); + } - // export function init(elementIndex: u32, srcOffset: u32, dstOffset: u32, n: u32): void { - // __table_init(elementIndex, srcOffset, dstOffset, n); - // } + export function init(elementIndex: u32, srcOffset: u32, dstOffset: u32, n: u32): void { + throw new Error(E_NOTIMPLEMENTED); + } - // export function drop(elementIndex: u32): void { - // __table_drop(elementIndex); - // } + export function drop(elementIndex: u32): void { + throw new Error(E_NOTIMPLEMENTED); + } } diff --git a/std/assembly/typedarray.ts b/std/assembly/typedarray.ts index 216a5a1475..3965de7199 100644 --- a/std/assembly/typedarray.ts +++ b/std/assembly/typedarray.ts @@ -1,28 +1,38 @@ -import { - TypedArray, - FILL, - SORT, - SUBARRAY, - REDUCE, - REDUCE_RIGHT, - MAP, - FIND_INDEX, - SOME, - EVERY, - FOREACH, - REVERSE, -} from "./internal/typedarray"; - -import { - COMPARATOR -} from "./internal/sort"; - -function clampToByte(value: i32): i32 { - return ~(value >> 31) & (((255 - value) >> 31) | value); // & 255 -} +import { COMPARATOR, SORT as SORT_IMPL } from "./util/sort"; +import { E_INDEXOUTOFRANGE } from "./util/error"; +import { idof } from "./builtins"; +import { ArrayBufferView } from "./arraybuffer"; + +export class Int8Array extends ArrayBufferView { + [key: number]: i8; + + // @ts-ignore: decorator + @lazy + static readonly BYTES_PER_ELEMENT: usize = sizeof(); + + constructor(length: i32) { + super(length, alignof()); + } + + get buffer(): ArrayBuffer { + return this.data; + } + + get length(): i32 { + return this.byteLength; + } -export class Int8Array extends TypedArray { - @lazy static readonly BYTES_PER_ELEMENT: usize = sizeof(); + @operator("[]") // unchecked is built-in + private __get(index: i32): i8 { + if (index >= this.dataLength) throw new RangeError(E_INDEXOUTOFRANGE); + return load(this.dataStart + index); + } + + @operator("[]=") // unchecked is built-in + private __set(index: i32, value: native): void { + if (index >= this.dataLength) throw new RangeError(E_INDEXOUTOFRANGE); + store(this.dataStart + index, value); + } fill(value: i32, start: i32 = 0, end: i32 = i32.MAX_VALUE): Int8Array { return FILL(this, value, start, end); @@ -37,37 +47,37 @@ export class Int8Array extends TypedArray { } reduce( - callbackfn: (accumulator: T, value: i8, index: i32, array: Int8Array) => T, + fn: (accumulator: T, value: i8, index: i32, array: Int8Array) => T, initialValue: T, ): T { - return REDUCE(this, callbackfn, initialValue); + return REDUCE(this, fn, initialValue); } reduceRight( - callbackfn: (accumulator: T, value: i8, index: i32, array: Int8Array) => T, + fn: (accumulator: T, value: i8, index: i32, array: Int8Array) => T, initialValue: T, ): T { - return REDUCE_RIGHT(this, callbackfn, initialValue); + return REDUCE_RIGHT(this, fn, initialValue); } - map(callbackfn: (value: i8, index: i32, self: Int8Array) => i8): Int8Array { - return MAP(this, callbackfn); + map(fn: (value: i8, index: i32, self: Int8Array) => i8): Int8Array { + return MAP(this, fn); } - findIndex(callbackfn: (value: i8, index: i32, self: Int8Array) => bool): i32 { - return FIND_INDEX(this, callbackfn); + findIndex(fn: (value: i8, index: i32, self: Int8Array) => bool): i32 { + return FIND_INDEX(this, fn); } - some(callbackfn: (value: i8, index: i32, self: Int8Array) => bool): bool { - return SOME(this, callbackfn); + some(fn: (value: i8, index: i32, self: Int8Array) => bool): bool { + return SOME(this, fn); } - every(callbackfn: (value: i8, index: i32, self: Int8Array) => bool): bool { - return EVERY(this, callbackfn); + every(fn: (value: i8, index: i32, self: Int8Array) => bool): bool { + return EVERY(this, fn); } - forEach(callbackfn: (value: i8, index: i32, self: Int8Array) => void): void { - FOREACH(this, callbackfn); + forEach(fn: (value: i8, index: i32, self: Int8Array) => void): void { + FOREACH(this, fn); } reverse(): this { @@ -75,8 +85,36 @@ export class Int8Array extends TypedArray { } } -export class Uint8Array extends TypedArray { - @lazy static readonly BYTES_PER_ELEMENT: usize = sizeof(); +export class Uint8Array extends ArrayBufferView { + [key: number]: u8; + + // @ts-ignore: decorator + @lazy + static readonly BYTES_PER_ELEMENT: usize = sizeof(); + + constructor(length: i32) { + super(length, alignof()); + } + + get buffer(): ArrayBuffer { + return this.data; + } + + get length(): i32 { + return this.byteLength; + } + + @operator("[]") // unchecked is built-in + private __get(index: i32): u8 { + if (index >= this.dataLength) throw new RangeError(E_INDEXOUTOFRANGE); + return load(this.dataStart + index); + } + + @operator("[]=") // unchecked is built-in + private __set(index: i32, value: native): void { + if (index >= this.dataLength) throw new RangeError(E_INDEXOUTOFRANGE); + store(this.dataStart + index, value); + } fill(value: u32, start: i32 = 0, end: i32 = i32.MAX_VALUE): Uint8Array { return FILL(this, value, start, end); @@ -91,37 +129,37 @@ export class Uint8Array extends TypedArray { } reduce( - callbackfn: (accumulator: T, value: u8, index: i32, array: Uint8Array) => T, + fn: (accumulator: T, value: u8, index: i32, array: Uint8Array) => T, initialValue: T, ): T { - return REDUCE(this, callbackfn, initialValue); + return REDUCE(this, fn, initialValue); } reduceRight( - callbackfn: (accumulator: T, value: u8, index: i32, array: Uint8Array) => T, + fn: (accumulator: T, value: u8, index: i32, array: Uint8Array) => T, initialValue: T, ): T { - return REDUCE_RIGHT(this, callbackfn, initialValue); + return REDUCE_RIGHT(this, fn, initialValue); } - map(callbackfn: (value: u8, index: i32, self: Uint8Array) => u8): Uint8Array { - return MAP(this, callbackfn); + map(fn: (value: u8, index: i32, self: Uint8Array) => u8): Uint8Array { + return MAP(this, fn); } - findIndex(callbackfn: (value: u8, index: i32, self: Uint8Array) => bool): i32 { - return FIND_INDEX(this, callbackfn); + findIndex(fn: (value: u8, index: i32, self: Uint8Array) => bool): i32 { + return FIND_INDEX(this, fn); } - some(callbackfn: (value: u8, index: i32, self: Uint8Array) => bool): bool { - return SOME(this, callbackfn); + some(fn: (value: u8, index: i32, self: Uint8Array) => bool): bool { + return SOME(this, fn); } - every(callbackfn: (value: u8, index: i32, self: Uint8Array) => bool): bool { - return EVERY(this, callbackfn); + every(fn: (value: u8, index: i32, self: Uint8Array) => bool): bool { + return EVERY(this, fn); } - forEach(callbackfn: (value: u8, index: i32, self: Uint8Array) => void): void { - FOREACH(this, callbackfn); + forEach(fn: (value: u8, index: i32, self: Uint8Array) => void): void { + FOREACH(this, fn); } reverse(): this { @@ -129,63 +167,81 @@ export class Uint8Array extends TypedArray { } } -export class Uint8ClampedArray extends Uint8Array { - @lazy static readonly BYTES_PER_ELEMENT: usize = sizeof(); +export class Uint8ClampedArray extends ArrayBufferView { + [key: number]: u8; + + // @ts-ignore: decorator + @lazy + static readonly BYTES_PER_ELEMENT: usize = sizeof(); + + constructor(length: i32) { + super(length, alignof()); + } + + get buffer(): ArrayBuffer { + return this.data; + } + + get length(): i32 { + return this.byteLength; + } - @inline @operator("[]=") - protected __set(index: i32, value: i32): void { - super.__set(index, clampToByte(value)); + @operator("[]") // unchecked is built-in + private __get(index: i32): u8 { + if (index >= this.dataLength) throw new RangeError(E_INDEXOUTOFRANGE); + return load(this.dataStart + index); } - @inline @operator("{}=") - protected __unchecked_set(index: i32, value: i32): void { - super.__unchecked_set(index, clampToByte(value)); + @operator("[]=") // unchecked is built-in + private __set(index: i32, value: native): void { + if (index >= this.dataLength) throw new RangeError(E_INDEXOUTOFRANGE); + store(this.dataStart + index, ~(value >> 31) & (((255 - value) >> 31) | value)); } fill(value: u32, start: i32 = 0, end: i32 = i32.MAX_VALUE): Uint8ClampedArray { - return changetype(super.fill(value, start, end)); // safe because '.fill' reuses 'this' + return FILL(this, value, start, end); } - sort(comparator: (a: u8, b: u8) => i32 = COMPARATOR()): Uint8ClampedArray { - return changetype(super.sort(comparator)); // safe because '.sort' reuses 'this' + sort(fn: (a: u8, b: u8) => i32 = COMPARATOR()): Uint8ClampedArray { + return SORT(this, fn); } - subarray(begin: i32 = 0, end: i32 = 0x7fffffff): Uint8ClampedArray { - return SUBARRAY(this, begin, end); + subarray(start: i32 = 0, end: i32 = 0x7fffffff): Uint8ClampedArray { + return SUBARRAY(this, start, end); } reduce( - callbackfn: (accumulator: T, value: u8, index: i32, array: Uint8ClampedArray) => T, + fn: (accumulator: T, value: u8, index: i32, array: Uint8ClampedArray) => T, initialValue: T, ): T { - return REDUCE(this, callbackfn, initialValue); + return REDUCE(this, fn, initialValue); } reduceRight( - callbackfn: (accumulator: T, value: u8, index: i32, array: Uint8ClampedArray) => T, + fn: (accumulator: T, value: u8, index: i32, array: Uint8ClampedArray) => T, initialValue: T, ): T { - return REDUCE_RIGHT(this, callbackfn, initialValue); + return REDUCE_RIGHT(this, fn, initialValue); } - map(callbackfn: (value: u8, index: i32, self: Uint8ClampedArray) => u8): Uint8ClampedArray { - return MAP(this, callbackfn); + map(fn: (value: u8, index: i32, self: Uint8ClampedArray) => u8): Uint8ClampedArray { + return MAP(this, fn); } - findIndex(callbackfn: (value: u8, index: i32, self: Uint8ClampedArray) => bool): i32 { - return FIND_INDEX(this, callbackfn); + findIndex(fn: (value: u8, index: i32, self: Uint8ClampedArray) => bool): i32 { + return FIND_INDEX(this, fn); } - some(callbackfn: (value: u8, index: i32, self: Uint8ClampedArray) => bool): bool { - return SOME(this, callbackfn); + some(fn: (value: u8, index: i32, self: Uint8ClampedArray) => bool): bool { + return SOME(this, fn); } - every(callbackfn: (value: u8, index: i32, self: Uint8ClampedArray) => bool): bool { - return EVERY(this, callbackfn); + every(fn: (value: u8, index: i32, self: Uint8ClampedArray) => bool): bool { + return EVERY(this, fn); } - forEach(callbackfn: (value: u8, index: i32, self: Uint8ClampedArray) => void): void { - FOREACH(this, callbackfn); + forEach(fn: (value: u8, index: i32, self: Uint8ClampedArray) => void): void { + FOREACH(this, fn); } reverse(): this { @@ -193,8 +249,36 @@ export class Uint8ClampedArray extends Uint8Array { } } -export class Int16Array extends TypedArray { - @lazy static readonly BYTES_PER_ELEMENT: usize = sizeof(); +export class Int16Array extends ArrayBufferView { + [key: number]: i16; + + // @ts-ignore: decorator + @lazy + static readonly BYTES_PER_ELEMENT: usize = sizeof(); + + constructor(length: i32) { + super(length, alignof()); + } + + get buffer(): ArrayBuffer { + return this.data; + } + + get length(): i32 { + return this.byteLength >>> alignof(); + } + + @operator("[]") // unchecked is built-in + private __get(index: i32): i16 { + if (index >= this.dataLength >>> alignof()) throw new RangeError(E_INDEXOUTOFRANGE); + return load(this.dataStart + (index << alignof())); + } + + @operator("[]=") // unchecked is built-in + private __set(index: i32, value: native): void { + if (index >= this.dataLength >>> alignof()) throw new RangeError(E_INDEXOUTOFRANGE); + store(this.dataStart + (index << alignof()), value); + } fill(value: i32, start: i32 = 0, end: i32 = i32.MAX_VALUE): Int16Array { return FILL(this, value, start, end); @@ -209,37 +293,37 @@ export class Int16Array extends TypedArray { } reduce( - callbackfn: (accumulator: T, value: i16, index: i32, array: Int16Array) => T, + fn: (accumulator: T, value: i16, index: i32, array: Int16Array) => T, initialValue: T, ): T { - return REDUCE(this, callbackfn, initialValue); + return REDUCE(this, fn, initialValue); } reduceRight( - callbackfn: (accumulator: T, value: i16, index: i32, array: Int16Array) => T, + fn: (accumulator: T, value: i16, index: i32, array: Int16Array) => T, initialValue: T, ): T { - return REDUCE_RIGHT(this, callbackfn, initialValue); + return REDUCE_RIGHT(this, fn, initialValue); } - map(callbackfn: (value: i16, index: i32, self: Int16Array) => i16): Int16Array { - return MAP(this, callbackfn); + map(fn: (value: i16, index: i32, self: Int16Array) => i16): Int16Array { + return MAP(this, fn); } - findIndex(callbackfn: (value: i16, index: i32, self: Int16Array) => bool): i32 { - return FIND_INDEX(this, callbackfn); + findIndex(fn: (value: i16, index: i32, self: Int16Array) => bool): i32 { + return FIND_INDEX(this, fn); } - some(callbackfn: (value: i16, index: i32, self: Int16Array) => bool): bool { - return SOME(this, callbackfn); + some(fn: (value: i16, index: i32, self: Int16Array) => bool): bool { + return SOME(this, fn); } - every(callbackfn: (value: i16, index: i32, self: Int16Array) => bool): bool { - return EVERY(this, callbackfn); + every(fn: (value: i16, index: i32, self: Int16Array) => bool): bool { + return EVERY(this, fn); } - forEach(callbackfn: (value: i16, index: i32, self: Int16Array) => void): void { - FOREACH(this, callbackfn); + forEach(fn: (value: i16, index: i32, self: Int16Array) => void): void { + FOREACH(this, fn); } reverse(): this { @@ -247,8 +331,36 @@ export class Int16Array extends TypedArray { } } -export class Uint16Array extends TypedArray { - @lazy static readonly BYTES_PER_ELEMENT: usize = sizeof(); +export class Uint16Array extends ArrayBufferView { + [key: number]: u16; + + // @ts-ignore: decorator + @lazy + static readonly BYTES_PER_ELEMENT: usize = sizeof(); + + constructor(length: i32) { + super(length, alignof()); + } + + get buffer(): ArrayBuffer { + return this.data; + } + + get length(): i32 { + return this.byteLength >>> alignof(); + } + + @operator("[]") // unchecked is built-in + private __get(index: i32): u16 { + if (index >= this.dataLength >>> alignof()) throw new RangeError(E_INDEXOUTOFRANGE); + return load(this.dataStart + (index << alignof())); + } + + @operator("[]=") // unchecked is built-in + private __set(index: i32, value: native): void { + if (index >= this.dataLength >>> alignof()) throw new RangeError(E_INDEXOUTOFRANGE); + store(this.dataStart + (index << alignof()), value); + } fill(value: u32, start: i32 = 0, end: i32 = i32.MAX_VALUE): Uint16Array { return FILL(this, value, start, end); @@ -263,37 +375,37 @@ export class Uint16Array extends TypedArray { } reduce( - callbackfn: (accumulator: T, value: u16, index: i32, array: Uint16Array) => T, + fn: (accumulator: T, value: u16, index: i32, array: Uint16Array) => T, initialValue: T, ): T { - return REDUCE(this, callbackfn, initialValue); + return REDUCE(this, fn, initialValue); } reduceRight( - callbackfn: (accumulator: T, value: u16, index: i32, array: Uint16Array) => T, + fn: (accumulator: T, value: u16, index: i32, array: Uint16Array) => T, initialValue: T, ): T { - return REDUCE_RIGHT(this, callbackfn, initialValue); + return REDUCE_RIGHT(this, fn, initialValue); } - map(callbackfn: (value: u16, index: i32, self: Uint16Array) => u16): Uint16Array { - return MAP(this, callbackfn); + map(fn: (value: u16, index: i32, self: Uint16Array) => u16): Uint16Array { + return MAP(this, fn); } - findIndex(callbackfn: (value: u16, index: i32, self: Uint16Array) => bool): i32 { - return FIND_INDEX(this, callbackfn); + findIndex(fn: (value: u16, index: i32, self: Uint16Array) => bool): i32 { + return FIND_INDEX(this, fn); } - some(callbackfn: (value: u16, index: i32, self: Uint16Array) => bool): bool { - return SOME(this, callbackfn); + some(fn: (value: u16, index: i32, self: Uint16Array) => bool): bool { + return SOME(this, fn); } - every(callbackfn: (value: u16, index: i32, self: Uint16Array) => bool): bool { - return EVERY(this, callbackfn); + every(fn: (value: u16, index: i32, self: Uint16Array) => bool): bool { + return EVERY(this, fn); } - forEach(callbackfn: (value: u16, index: i32, self: Uint16Array) => void): void { - FOREACH(this, callbackfn); + forEach(fn: (value: u16, index: i32, self: Uint16Array) => void): void { + FOREACH(this, fn); } reverse(): this { @@ -301,8 +413,36 @@ export class Uint16Array extends TypedArray { } } -export class Int32Array extends TypedArray { - @lazy static readonly BYTES_PER_ELEMENT: usize = sizeof(); +export class Int32Array extends ArrayBufferView { + [key: number]: i32; + + // @ts-ignore: decorator + @lazy + static readonly BYTES_PER_ELEMENT: usize = sizeof(); + + constructor(length: i32) { + super(length, alignof()); + } + + get buffer(): ArrayBuffer { + return this.data; + } + + get length(): i32 { + return this.byteLength >>> alignof(); + } + + @operator("[]") // unchecked is built-in + private __get(index: i32): i32 { + if (index >= this.dataLength >>> alignof()) throw new RangeError(E_INDEXOUTOFRANGE); + return load(this.dataStart + (index << alignof())); + } + + @operator("[]=") // unchecked is built-in + private __set(index: i32, value: i32): void { + if (index >= this.dataLength >>> alignof()) throw new RangeError(E_INDEXOUTOFRANGE); + store(this.dataStart + (index << alignof()), value); + } fill(value: i32, start: i32 = 0, end: i32 = i32.MAX_VALUE): Int32Array { return FILL(this, value, start, end); @@ -317,37 +457,37 @@ export class Int32Array extends TypedArray { } reduce( - callbackfn: (accumulator: T, value: i32, index: i32, array: Int32Array) => T, + fn: (accumulator: T, value: i32, index: i32, array: Int32Array) => T, initialValue: T, ): T { - return REDUCE(this, callbackfn, initialValue); + return REDUCE(this, fn, initialValue); } reduceRight( - callbackfn: (accumulator: T, value: i32, index: i32, array: Int32Array) => T, + fn: (accumulator: T, value: i32, index: i32, array: Int32Array) => T, initialValue: T, ): T { - return REDUCE_RIGHT(this, callbackfn, initialValue); + return REDUCE_RIGHT(this, fn, initialValue); } - map(callbackfn: (value: i32, index: i32, self: Int32Array) => i32): Int32Array { - return MAP(this, callbackfn); + map(fn: (value: i32, index: i32, self: Int32Array) => i32): Int32Array { + return MAP(this, fn); } - findIndex(callbackfn: (value: i32, index: i32, self: Int32Array) => bool): i32 { - return FIND_INDEX(this, callbackfn); + findIndex(fn: (value: i32, index: i32, self: Int32Array) => bool): i32 { + return FIND_INDEX(this, fn); } - some(callbackfn: (value: i32, index: i32, self: Int32Array) => bool): bool { - return SOME(this, callbackfn); + some(fn: (value: i32, index: i32, self: Int32Array) => bool): bool { + return SOME(this, fn); } - every(callbackfn: (value: i32, index: i32, self: Int32Array) => bool): bool { - return EVERY(this, callbackfn); + every(fn: (value: i32, index: i32, self: Int32Array) => bool): bool { + return EVERY(this, fn); } - forEach(callbackfn: (value: i32, index: i32, self: Int32Array) => void): void { - FOREACH(this, callbackfn); + forEach(fn: (value: i32, index: i32, self: Int32Array) => void): void { + FOREACH(this, fn); } reverse(): this { @@ -355,8 +495,36 @@ export class Int32Array extends TypedArray { } } -export class Uint32Array extends TypedArray { - @lazy static readonly BYTES_PER_ELEMENT: usize = sizeof(); +export class Uint32Array extends ArrayBufferView { + [key: number]: u32; + + // @ts-ignore: decorator + @lazy + static readonly BYTES_PER_ELEMENT: usize = sizeof(); + + constructor(length: i32) { + super(length, alignof()); + } + + get buffer(): ArrayBuffer { + return this.data; + } + + get length(): i32 { + return this.byteLength >>> alignof(); + } + + @operator("[]") // unchecked is built-in + private __get(index: i32): u32 { + if (index >= this.dataLength >>> alignof()) throw new RangeError(E_INDEXOUTOFRANGE); + return load(this.dataStart + (index << alignof())); + } + + @operator("[]=") // unchecked is built-in + private __set(index: i32, value: u32): void { + if (index >= this.dataLength >>> alignof()) throw new RangeError(E_INDEXOUTOFRANGE); + store(this.dataStart + (index << alignof()), value); + } fill(value: u32, start: i32 = 0, end: i32 = i32.MAX_VALUE): Uint32Array { return FILL(this, value, start, end); @@ -371,37 +539,37 @@ export class Uint32Array extends TypedArray { } reduce( - callbackfn: (accumulator: T, value: u32, index: i32, array: Uint32Array) => T, + fn: (accumulator: T, value: u32, index: i32, array: Uint32Array) => T, initialValue: T, ): T { - return REDUCE(this, callbackfn, initialValue); + return REDUCE(this, fn, initialValue); } reduceRight( - callbackfn: (accumulator: T, value: u32, index: i32, array: Uint32Array) => T, + fn: (accumulator: T, value: u32, index: i32, array: Uint32Array) => T, initialValue: T, ): T { - return REDUCE_RIGHT(this, callbackfn, initialValue); + return REDUCE_RIGHT(this, fn, initialValue); } - map(callbackfn: (value: u32, index: i32, self: Uint32Array) => u32): Uint32Array { - return MAP(this, callbackfn); + map(fn: (value: u32, index: i32, self: Uint32Array) => u32): Uint32Array { + return MAP(this, fn); } - findIndex(callbackfn: (value: u32, index: i32, self: Uint32Array) => bool): i32 { - return FIND_INDEX(this, callbackfn); + findIndex(fn: (value: u32, index: i32, self: Uint32Array) => bool): i32 { + return FIND_INDEX(this, fn); } - some(callbackfn: (value: u32, index: i32, self: Uint32Array) => bool): bool { - return SOME(this, callbackfn); + some(fn: (value: u32, index: i32, self: Uint32Array) => bool): bool { + return SOME(this, fn); } - every(callbackfn: (value: u32, index: i32, self: Uint32Array) => bool): bool { - return EVERY(this, callbackfn); + every(fn: (value: u32, index: i32, self: Uint32Array) => bool): bool { + return EVERY(this, fn); } - forEach(callbackfn: (value: u32, index: i32, self: Uint32Array) => void): void { - FOREACH(this, callbackfn); + forEach(fn: (value: u32, index: i32, self: Uint32Array) => void): void { + FOREACH(this, fn); } reverse(): this { @@ -409,8 +577,36 @@ export class Uint32Array extends TypedArray { } } -export class Int64Array extends TypedArray { - @lazy static readonly BYTES_PER_ELEMENT: usize = sizeof(); +export class Int64Array extends ArrayBufferView { + [key: number]: i64; + + // @ts-ignore: decorator + @lazy + static readonly BYTES_PER_ELEMENT: usize = sizeof(); + + constructor(length: i32) { + super(length, alignof()); + } + + get buffer(): ArrayBuffer { + return this.data; + } + + get length(): i32 { + return this.byteLength >>> alignof(); + } + + @operator("[]") // unchecked is built-in + private __get(index: i32): i64 { + if (index >= this.dataLength >>> alignof()) throw new RangeError(E_INDEXOUTOFRANGE); + return load(this.dataStart + (index << alignof())); + } + + @operator("[]=") // unchecked is built-in + private __set(index: i32, value: i64): void { + if (index >= this.dataLength >>> alignof()) throw new RangeError(E_INDEXOUTOFRANGE); + store(this.dataStart + (index << alignof()), value); + } fill(value: i64, start: i32 = 0, end: i32 = i32.MAX_VALUE): Int64Array { return FILL(this, value, start, end); @@ -425,37 +621,37 @@ export class Int64Array extends TypedArray { } reduce( - callbackfn: (accumulator: T, value: i64, index: i32, array: Int64Array) => T, + fn: (accumulator: T, value: i64, index: i32, array: Int64Array) => T, initialValue: T, ): T { - return REDUCE(this, callbackfn, initialValue); + return REDUCE(this, fn, initialValue); } reduceRight( - callbackfn: (accumulator: T, value: i64, index: i32, array: Int64Array) => T, + fn: (accumulator: T, value: i64, index: i32, array: Int64Array) => T, initialValue: T, ): T { - return REDUCE_RIGHT(this, callbackfn, initialValue); + return REDUCE_RIGHT(this, fn, initialValue); } - map(callbackfn: (value: i64, index: i32, self: Int64Array) => i64): Int64Array { - return MAP(this, callbackfn); + map(fn: (value: i64, index: i32, self: Int64Array) => i64): Int64Array { + return MAP(this, fn); } - findIndex(callbackfn: (value: i64, index: i32, self: Int64Array) => bool): i32 { - return FIND_INDEX(this, callbackfn); + findIndex(fn: (value: i64, index: i32, self: Int64Array) => bool): i32 { + return FIND_INDEX(this, fn); } - some(callbackfn: (value: i64, index: i32, self: Int64Array) => bool): bool { - return SOME(this, callbackfn); + some(fn: (value: i64, index: i32, self: Int64Array) => bool): bool { + return SOME(this, fn); } - every(callbackfn: (value: i64, index: i32, self: Int64Array) => bool): bool { - return EVERY(this, callbackfn); + every(fn: (value: i64, index: i32, self: Int64Array) => bool): bool { + return EVERY(this, fn); } - forEach(callbackfn: (value: i64, index: i32, self: Int64Array) => void): void { - FOREACH(this, callbackfn); + forEach(fn: (value: i64, index: i32, self: Int64Array) => void): void { + FOREACH(this, fn); } reverse(): this { @@ -463,8 +659,36 @@ export class Int64Array extends TypedArray { } } -export class Uint64Array extends TypedArray { - @lazy static readonly BYTES_PER_ELEMENT: usize = sizeof(); +export class Uint64Array extends ArrayBufferView { + [key: number]: u64; + + // @ts-ignore: decorator + @lazy + static readonly BYTES_PER_ELEMENT: usize = sizeof(); + + constructor(length: i32) { + super(length, alignof()); + } + + get buffer(): ArrayBuffer { + return this.data; + } + + get length(): i32 { + return this.byteLength >>> alignof(); + } + + @operator("[]") // unchecked is built-in + private __get(index: i32): u64 { + if (index >= this.dataLength >>> alignof()) throw new RangeError(E_INDEXOUTOFRANGE); + return load(this.dataStart + (index << alignof())); + } + + @operator("[]=") // unchecked is built-in + private __set(index: i32, value: u64): void { + if (index >= this.dataLength >>> alignof()) throw new RangeError(E_INDEXOUTOFRANGE); + store(this.dataStart + (index << alignof()), value); + } fill(value: u64, start: i32 = 0, end: i32 = i32.MAX_VALUE): Uint64Array { return FILL(this, value, start, end); @@ -479,37 +703,37 @@ export class Uint64Array extends TypedArray { } reduce( - callbackfn: (accumulator: T, value: u64, index: i32, array: Uint64Array) => T, + fn: (accumulator: T, value: u64, index: i32, array: Uint64Array) => T, initialValue: T, ): T { - return REDUCE(this, callbackfn, initialValue); + return REDUCE(this, fn, initialValue); } reduceRight( - callbackfn: (accumulator: T, value: u64, index: i32, array: Uint64Array) => T, + fn: (accumulator: T, value: u64, index: i32, array: Uint64Array) => T, initialValue: T, ): T { - return REDUCE_RIGHT(this, callbackfn, initialValue); + return REDUCE_RIGHT(this, fn, initialValue); } - map(callbackfn: (value: u64, index: i32, self: Uint64Array) => u64): Uint64Array { - return MAP(this, callbackfn); + map(fn: (value: u64, index: i32, self: Uint64Array) => u64): Uint64Array { + return MAP(this, fn); } - findIndex(callbackfn: (value: u64, index: i32, self: Uint64Array) => bool): i32 { - return FIND_INDEX(this, callbackfn); + findIndex(fn: (value: u64, index: i32, self: Uint64Array) => bool): i32 { + return FIND_INDEX(this, fn); } - some(callbackfn: (value: u64, index: i32, self: Uint64Array) => bool): bool { - return SOME(this, callbackfn); + some(fn: (value: u64, index: i32, self: Uint64Array) => bool): bool { + return SOME(this, fn); } - every(callbackfn: (value: u64, index: i32, self: Uint64Array) => bool): bool { - return EVERY(this, callbackfn); + every(fn: (value: u64, index: i32, self: Uint64Array) => bool): bool { + return EVERY(this, fn); } - forEach(callbackfn: (value: u64, index: i32, self: Uint64Array) => void): void { - FOREACH(this, callbackfn); + forEach(fn: (value: u64, index: i32, self: Uint64Array) => void): void { + FOREACH(this, fn); } reverse(): this { @@ -517,8 +741,36 @@ export class Uint64Array extends TypedArray { } } -export class Float32Array extends TypedArray { - @lazy static readonly BYTES_PER_ELEMENT: usize = sizeof(); +export class Float32Array extends ArrayBufferView { + [key: number]: f32; + + // @ts-ignore: decorator + @lazy + static readonly BYTES_PER_ELEMENT: usize = sizeof(); + + constructor(length: i32) { + super(length, alignof()); + } + + get buffer(): ArrayBuffer { + return this.data; + } + + get length(): i32 { + return this.byteLength >>> alignof(); + } + + @operator("[]") // unchecked is built-in + private __get(index: i32): f32 { + if (index >= this.dataLength >>> alignof()) throw new RangeError(E_INDEXOUTOFRANGE); + return load(this.dataStart + (index << alignof())); + } + + @operator("[]=") // unchecked is built-in + private __set(index: i32, value: f32): void { + if (index >= this.dataLength >>> alignof()) throw new RangeError(E_INDEXOUTOFRANGE); + store(this.dataStart + (index << alignof()), value); + } fill(value: f32, start: i32 = 0, end: i32 = i32.MAX_VALUE): Float32Array { return FILL(this, value, start, end); @@ -533,37 +785,37 @@ export class Float32Array extends TypedArray { } reduce( - callbackfn: (accumulator: T, value: f32, index: i32, array: Float32Array) => T, + fn: (accumulator: T, value: f32, index: i32, array: Float32Array) => T, initialValue: T, ): T { - return REDUCE(this, callbackfn, initialValue); + return REDUCE(this, fn, initialValue); } reduceRight( - callbackfn: (accumulator: T, value: f32, index: i32, array: Float32Array) => T, + fn: (accumulator: T, value: f32, index: i32, array: Float32Array) => T, initialValue: T, ): T { - return REDUCE_RIGHT(this, callbackfn, initialValue); + return REDUCE_RIGHT(this, fn, initialValue); } - map(callbackfn: (value: f32, index: i32, self: Float32Array) => f32): Float32Array { - return MAP(this, callbackfn); + map(fn: (value: f32, index: i32, self: Float32Array) => f32): Float32Array { + return MAP(this, fn); } - findIndex(callbackfn: (value: f32, index: i32, self: Float32Array) => bool): i32 { - return FIND_INDEX(this, callbackfn); + findIndex(fn: (value: f32, index: i32, self: Float32Array) => bool): i32 { + return FIND_INDEX(this, fn); } - some(callbackfn: (value: f32, index: i32, self: Float32Array) => bool): bool { - return SOME(this, callbackfn); + some(fn: (value: f32, index: i32, self: Float32Array) => bool): bool { + return SOME(this, fn); } - every(callbackfn: (value: f32, index: i32, self: Float32Array) => bool): bool { - return EVERY(this, callbackfn); + every(fn: (value: f32, index: i32, self: Float32Array) => bool): bool { + return EVERY(this, fn); } - forEach(callbackfn: (value: f32, index: i32, self: Float32Array) => void): void { - FOREACH(this, callbackfn); + forEach(fn: (value: f32, index: i32, self: Float32Array) => void): void { + FOREACH(this, fn); } reverse(): this { @@ -571,8 +823,36 @@ export class Float32Array extends TypedArray { } } -export class Float64Array extends TypedArray { - @lazy static readonly BYTES_PER_ELEMENT: usize = sizeof(); +export class Float64Array extends ArrayBufferView { + [key: number]: f64; + + // @ts-ignore: decorator + @lazy + static readonly BYTES_PER_ELEMENT: usize = sizeof(); + + constructor(length: i32) { + super(length, alignof()); + } + + get buffer(): ArrayBuffer { + return this.data; + } + + get length(): i32 { + return this.byteLength >>> alignof(); + } + + @operator("[]") // unchecked is built-in + private __get(index: i32): f64 { + if (index >= this.dataLength >>> alignof()) throw new RangeError(E_INDEXOUTOFRANGE); + return load(this.dataStart + (index << alignof())); + } + + @operator("[]=") // unchecked is built-in + private __set(index: i32, value: f64): void { + if (index >= this.dataLength >>> alignof()) throw new RangeError(E_INDEXOUTOFRANGE); + store(this.dataStart + (index << alignof()), value); + } fill(value: f64, start: i32 = 0, end: i32 = i32.MAX_VALUE): Float64Array { return FILL(this, value, start, end); @@ -587,40 +867,215 @@ export class Float64Array extends TypedArray { } reduce( - callbackfn: (accumulator: T, value: f64, index: i32, array: Float64Array) => T, + fn: (accumulator: T, value: f64, index: i32, array: Float64Array) => T, initialValue: T, ): T { - return REDUCE(this, callbackfn, initialValue); + return REDUCE(this, fn, initialValue); } reduceRight( - callbackfn: (accumulator: T, value: f64, index: i32, array: Float64Array) => T, + fn: (accumulator: T, value: f64, index: i32, array: Float64Array) => T, initialValue: T, ): T { - return REDUCE_RIGHT(this, callbackfn, initialValue); + return REDUCE_RIGHT(this, fn, initialValue); } - map(callbackfn: (value: f64, index: i32, self: Float64Array) => f64): Float64Array { - return MAP(this, callbackfn); + map(fn: (value: f64, index: i32, self: Float64Array) => f64): Float64Array { + return MAP(this, fn); } - findIndex(callbackfn: (value: f64, index: i32, self: Float64Array) => bool): i32 { - return FIND_INDEX(this, callbackfn); + findIndex(fn: (value: f64, index: i32, self: Float64Array) => bool): i32 { + return FIND_INDEX(this, fn); } - some(callbackfn: (value: f64, index: i32, self: Float64Array) => bool): bool { - return SOME(this, callbackfn); + some(fn: (value: f64, index: i32, self: Float64Array) => bool): bool { + return SOME(this, fn); } - every(callbackfn: (value: f64, index: i32, self: Float64Array) => bool): bool { - return EVERY(this, callbackfn); + every(fn: (value: f64, index: i32, self: Float64Array) => bool): bool { + return EVERY(this, fn); } - forEach(callbackfn: (value: f64, index: i32, self: Float64Array) => void): void { - FOREACH(this, callbackfn); + forEach(fn: (value: f64, index: i32, self: Float64Array) => void): void { + FOREACH(this, fn); } reverse(): this { return REVERSE(this); } } + +// @ts-ignore: decorator +@inline +function FILL( + array: TArray, + value: native, + start: i32, + end: i32 +): TArray { + var dataStart = array.dataStart; + var length = array.length; + start = start < 0 ? max(length + start, 0) : min(start, length); + end = end < 0 ? max(length + end, 0) : min(end, length); + if (sizeof() == 1) { + if (start < end) memory.fill(dataStart + start, value, (end - start)); + } else { + for (; start < end; ++start) { + store(dataStart + (start << alignof()), value); + } + } + return array; +} + +// @ts-ignore: decorator +@inline +function SORT( + array: TArray, + comparator: (a: T, b: T) => i32 +): TArray { + var length = array.length; + if (length <= 1) return array; + var base = array.dataStart; + if (length == 2) { + let a: T = load(base, sizeof()); // a = arr[1] + let b: T = load(base); // b = arr[0] + if (comparator(a, b) < 0) { + store(base, b, sizeof()); // arr[1] = b + store(base, a); // arr[0] = a + } + return array; + } + SORT_IMPL(base, length, comparator); + return array; +} + +// @ts-ignore: decorator +@inline +function SUBARRAY( + array: TArray, + begin: i32, + end: i32 +): TArray { + var len = array.length; + begin = begin < 0 ? max(len + begin, 0) : min(begin, len); + end = end < 0 ? max(len + end, 0) : min(end, len); + end = max(end, begin); + var out = changetype(__alloc(offsetof(), idof())); // retains + out.data = array.data; // retains + out.dataStart = array.dataStart + (begin << alignof()); + out.dataLength = (end - begin) << alignof(); + return out; +} + +// @ts-ignore: decorator +@inline +function REDUCE( + array: TArray, + fn: (accumulator: TRet, value: T, index: i32, array: TArray) => TRet, + initialValue: TRet +): TRet { + var dataStart = array.dataStart; + for (let i = 0, k = array.length; i < k; i++) { + initialValue = fn(initialValue, load(dataStart + (i << alignof())), i, array); + } + return initialValue; +} + +// @ts-ignore: decorator +@inline +function REDUCE_RIGHT( + array: TArray, + fn: (accumulator: TRet, value: T, index: i32, array: TArray) => TRet, + initialValue: TRet +): TRet { + var dataStart = array.dataStart; + for (let i = array.length - 1; i >= 0; i--) { + initialValue = fn(initialValue, load(dataStart + (i << alignof())), i, array); + } + return initialValue; +} + +// @ts-ignore: decorator +@inline +function MAP( + array: TArray, + fn: (value: T, index: i32, self: TArray) => T, +): TArray { + var length = array.length; + var dataStart = array.dataStart; + var out = instantiate(length); + var outDataStart = out.dataStart; + for (let i = 0; i < length; i++) { + store( + outDataStart + (i << alignof()), + fn(load(dataStart + (i << alignof())), i, array) + ); + } + return out; +} + +// @ts-ignore: decorator +@inline +function FIND_INDEX( + array: TArray, + fn: (value: T, index: i32, array: TArray) => bool, +): i32 { + var dataStart = array.dataStart; + for (let i = 0, k = array.length; i < k; i++) { + if (fn(load(dataStart + (i << alignof())), i, array)) return i; + } + return -1; +} + +// @ts-ignore: decorator +@inline +function SOME( + array: TArray, + fn: (value: T, index: i32, array: TArray) => bool, +): bool { + var dataStart = array.dataStart; + for (let i = 0, k = array.length; i < k; i++) { + if (fn(load(dataStart + (i << alignof())), i, array)) return true; + } + return false; +} + +// @ts-ignore: decorator +@inline +function EVERY( + array: TArray, + fn: (value: T, index: i32, array: TArray) => bool, +): bool { + var dataStart = array.dataStart; + for (let i = 0, k = array.length; i < k; i++) { + if (fn(load(dataStart + (i << alignof())), i, array)) continue; + return false; + } + return true; +} + +// @ts-ignore: decorator +@inline +function FOREACH( + array: TArray, + fn: (value: T, index: i32, array: TArray) => void, +): void { + var dataStart = array.dataStart; + for (let i = 0, k = array.length; i < k; i++) { + fn(load(dataStart + (i << alignof())), i, array); + } +} + +// @ts-ignore: decorator +@inline +export function REVERSE(array: TArray): TArray { + var dataStart = array.dataStart; + for (let front = 0, back = array.length - 1; front < back; ++front, --back) { + let frontPtr = dataStart + (front << alignof()); + let backPtr = dataStart + (back << alignof()); + let temp = load(frontPtr); + store(frontPtr, load(backPtr)); + store(backPtr, temp); + } + return array; +} diff --git a/std/assembly/util/error.ts b/std/assembly/util/error.ts new file mode 100644 index 0000000000..cbee8cbffa --- /dev/null +++ b/std/assembly/util/error.ts @@ -0,0 +1,22 @@ +// Common error messages for use accross the standard library. Keeping error messages compact +// and reusing them where possible ensures minimal static data in binaries. + +// @ts-ignore: decorator +@lazy @inline +export const E_INDEXOUTOFRANGE: string = "Index out of range"; + +// @ts-ignore: decorator +@lazy @inline +export const E_INVALIDLENGTH: string = "Invalid length"; + +// @ts-ignore: decorator +@lazy @inline +export const E_EMPTYARRAY: string = "Array is empty"; + +// @ts-ignore: decorator +@lazy @inline +export const E_HOLEYARRAY: string = "Element type must be nullable if array is holey"; + +// @ts-ignore: decorator +@lazy @inline +export const E_NOTIMPLEMENTED: string = "Not implemented"; diff --git a/std/assembly/internal/hash.ts b/std/assembly/util/hash.ts similarity index 63% rename from std/assembly/internal/hash.ts rename to std/assembly/util/hash.ts index dd7c740325..2d58d92909 100644 --- a/std/assembly/internal/hash.ts +++ b/std/assembly/util/hash.ts @@ -1,32 +1,32 @@ -import { - HEADER_SIZE -} from "./string"; - -/** Computes the 32-bit hash of a value of any type. */ +// @ts-ignore: decorator @inline export function HASH(key: T): u32 { - // branch-level tree-shaking makes this a `(return (call ...))` - if (isString(key)) { - return hashStr(key); + if (isString()) { + return hashStr(changetype(key)); } else if (isReference()) { if (sizeof() == 4) return hash32(changetype(key)); if (sizeof() == 8) return hash64(changetype(key)); } else if (isFloat()) { - if (sizeof() == 4) return hash32(reinterpret(key)); - if (sizeof() == 8) return hash64(reinterpret(key)); + if (sizeof() == 4) return hash32(reinterpret(f32(key))); + if (sizeof() == 8) return hash64(reinterpret(f64(key))); } else { - if (sizeof() == 1) return hash8 (key); - if (sizeof() == 2) return hash16(key); - if (sizeof() == 4) return hash32(key); - if (sizeof() == 8) return hash64(key); + if (sizeof() == 1) return hash8 (u32(key)); + if (sizeof() == 2) return hash16(u32(key)); + if (sizeof() == 4) return hash32(u32(key)); + if (sizeof() == 8) return hash64(u64(key)); } - unreachable(); + return unreachable(); } // FNV-1a 32-bit as a starting point, see: http://isthe.com/chongo/tech/comp/fnv/ -@inline const FNV_OFFSET: u32 = 2166136261; -@inline const FNV_PRIME: u32 = 16777619; +// @ts-ignore: decorator +@inline +const FNV_OFFSET: u32 = 2166136261; + +// @ts-ignore: decorator +@inline +const FNV_PRIME: u32 = 16777619; function hash8(key: u32): u32 { return (FNV_OFFSET ^ key) * FNV_PRIME; @@ -65,8 +65,10 @@ function hash64(key: u64): u32 { function hashStr(key: string): u32 { var v = FNV_OFFSET; - for (let i: usize = 0, k: usize = key.length << 1; i < k; ++i) { - v = (v ^ load(changetype(key) + i, HEADER_SIZE)) * FNV_PRIME; + if (key !== null) { + for (let i: usize = 0, k: usize = key.length << 1; i < k; ++i) { + v = (v ^ load(changetype(key) + i)) * FNV_PRIME; + } } return v; } diff --git a/std/assembly/util/memory.ts b/std/assembly/util/memory.ts new file mode 100644 index 0000000000..81469171c6 --- /dev/null +++ b/std/assembly/util/memory.ts @@ -0,0 +1,272 @@ +export function memcpy(dest: usize, src: usize, n: usize): void { // see: musl/src/string/memcpy.c + if (ASC_SHRINK_LEVEL > 1) { + while (n) { + store(dest++, load(src++)); + --n; + } + } else { + let w: u32, x: u32; + + // copy 1 byte each until src is aligned to 4 bytes + while (n && (src & 3)) { + store(dest++, load(src++)); + n--; + } + + // if dst is aligned to 4 bytes as well, copy 4 bytes each + if ((dest & 3) == 0) { + while (n >= 16) { + store(dest , load(src )); + store(dest + 4, load(src + 4)); + store(dest + 8, load(src + 8)); + store(dest + 12, load(src + 12)); + src += 16; dest += 16; n -= 16; + } + if (n & 8) { + store(dest , load(src )); + store(dest + 4, load(src + 4)); + dest += 8; src += 8; + } + if (n & 4) { + store(dest, load(src)); + dest += 4; src += 4; + } + if (n & 2) { // drop to 2 bytes each + store(dest, load(src)); + dest += 2; src += 2; + } + if (n & 1) { // drop to 1 byte + store(dest++, load(src++)); + } + return; + } + + // if dst is not aligned to 4 bytes, use alternating shifts to copy 4 bytes each + // doing shifts if faster when copying enough bytes (here: 32 or more) + if (n >= 32) { + switch (dest & 3) { + // known to be != 0 + case 1: { + w = load(src); + store(dest++, load(src++)); + store(dest++, load(src++)); + store(dest++, load(src++)); + n -= 3; + while (n >= 17) { + x = load(src + 1); + store(dest, w >> 24 | x << 8); + w = load(src + 5); + store(dest + 4, x >> 24 | w << 8); + x = load(src + 9); + store(dest + 8, w >> 24 | x << 8); + w = load(src + 13); + store(dest + 12, x >> 24 | w << 8); + src += 16; dest += 16; n -= 16; + } + break; + } + case 2: { + w = load(src); + store(dest++, load(src++)); + store(dest++, load(src++)); + n -= 2; + while (n >= 18) { + x = load(src + 2); + store(dest, w >> 16 | x << 16); + w = load(src + 6); + store(dest + 4, x >> 16 | w << 16); + x = load(src + 10); + store(dest + 8, w >> 16 | x << 16); + w = load(src + 14); + store(dest + 12, x >> 16 | w << 16); + src += 16; dest += 16; n -= 16; + } + break; + } + case 3: { + w = load(src); + store(dest++, load(src++)); + n -= 1; + while (n >= 19) { + x = load(src + 3); + store(dest, w >> 8 | x << 24); + w = load(src + 7); + store(dest + 4, x >> 8 | w << 24); + x = load(src + 11); + store(dest + 8, w >> 8 | x << 24); + w = load(src + 15); + store(dest + 12, x >> 8 | w << 24); + src += 16; dest += 16; n -= 16; + } + break; + } + } + } + + // copy remaining bytes one by one + if (n & 16) { + store(dest++, load(src++)); + store(dest++, load(src++)); + store(dest++, load(src++)); + store(dest++, load(src++)); + store(dest++, load(src++)); + store(dest++, load(src++)); + store(dest++, load(src++)); + store(dest++, load(src++)); + store(dest++, load(src++)); + store(dest++, load(src++)); + store(dest++, load(src++)); + store(dest++, load(src++)); + store(dest++, load(src++)); + store(dest++, load(src++)); + store(dest++, load(src++)); + store(dest++, load(src++)); + } + if (n & 8) { + store(dest++, load(src++)); + store(dest++, load(src++)); + store(dest++, load(src++)); + store(dest++, load(src++)); + store(dest++, load(src++)); + store(dest++, load(src++)); + store(dest++, load(src++)); + store(dest++, load(src++)); + } + if (n & 4) { + store(dest++, load(src++)); + store(dest++, load(src++)); + store(dest++, load(src++)); + store(dest++, load(src++)); + } + if (n & 2) { + store(dest++, load(src++)); + store(dest++, load(src++)); + } + if (n & 1) { + store(dest++, load(src++)); + } + } +} + +// @ts-ignore: decorator +@inline +export function memmove(dest: usize, src: usize, n: usize): void { // see: musl/src/string/memmove.c + if (dest === src) return; + if (ASC_SHRINK_LEVEL < 1) { + if (src + n <= dest || dest + n <= src) { + memcpy(dest, src, n); + return; + } + } + if (dest < src) { + if ((src & 7) == (dest & 7)) { + while (dest & 7) { + if (!n) return; + --n; + store(dest++, load(src++)); + } + while (n >= 8) { + store(dest, load(src)); + n -= 8; + dest += 8; + src += 8; + } + } + while (n) { + store(dest++, load(src++)); + --n; + } + } else { + if ((src & 7) == (dest & 7)) { + while ((dest + n) & 7) { + if (!n) return; + store(dest + --n, load(src + n)); + } + while (n >= 8) { + n -= 8; + store(dest + n, load(src + n)); + } + } + while (n) { + store(dest + --n, load(src + n)); + } + } +} + +// @ts-ignore: decorator +@inline +export function memset(dest: usize, c: u8, n: usize): void { // see: musl/src/string/memset + if (ASC_SHRINK_LEVEL > 1) { + while (n) { + store(dest++, c); + --n; + } + } else { + // fill head and tail with minimal branching + if (!n) return; + store(dest, c); + store(dest + n - 1, c); + if (n <= 2) return; + + store(dest + 1, c); + store(dest + 2, c); + store(dest + n - 2, c); + store(dest + n - 3, c); + if (n <= 6) return; + store(dest + 3, c); + store(dest + n - 4, c); + if (n <= 8) return; + + // advance pointer to align it at 4-byte boundary + let k: usize = -dest & 3; + dest += k; + n -= k; + n &= -4; + + let c32: u32 = -1 / 255 * c; + + // fill head/tail up to 28 bytes each in preparation + store(dest, c32); + store(dest + n - 4, c32); + if (n <= 8) return; + store(dest + 4, c32); + store(dest + 8, c32); + store(dest + n - 12, c32); + store(dest + n - 8, c32); + if (n <= 24) return; + store(dest + 12, c32); + store(dest + 16, c32); + store(dest + 20, c32); + store(dest + 24, c32); + store(dest + n - 28, c32); + store(dest + n - 24, c32); + store(dest + n - 20, c32); + store(dest + n - 16, c32); + + // align to a multiple of 8 + k = 24 + (dest & 4); + dest += k; + n -= k; + + // copy 32 bytes each + let c64: u64 = c32 | (c32 << 32); + while (n >= 32) { + store(dest, c64); + store(dest + 8, c64); + store(dest + 16, c64); + store(dest + 24, c64); + n -= 32; + dest += 32; + } + } +} + +// @ts-ignore: decorator +@inline +export function memcmp(vl: usize, vr: usize, n: usize): i32 { // see: musl/src/string/memcmp.c + if (vl == vr) return 0; + while (n != 0 && load(vl) == load(vr)) { + n--; vl++; vr++; + } + return n ? load(vl) - load(vr) : 0; +} diff --git a/std/assembly/internal/number.ts b/std/assembly/util/number.ts similarity index 66% rename from std/assembly/internal/number.ts rename to std/assembly/util/number.ts index e254aecea5..32d98c6398 100644 --- a/std/assembly/internal/number.ts +++ b/std/assembly/util/number.ts @@ -1,17 +1,16 @@ -import { - CharCode, - allocateUnsafe as allocateUnsafeString, - freeUnsafe as freeUnsafeString, - HEADER_SIZE as STRING_HEADER_SIZE -} from "./string"; +/// -import { - LOAD -} from "./arraybuffer"; +import { idof } from "../builtins"; +import { CharCode } from "./string"; +import { ArrayBufferView } from "../arraybuffer"; -@inline export const MAX_DOUBLE_LENGTH = 28; +// @ts-ignore: decorator +@inline +export const MAX_DOUBLE_LENGTH = 28; -@lazy @inline const POWERS10: u32[] = [ +// @ts-ignore: decorator +@lazy @inline +const POWERS10: u32[] = [ 1, 10, 100, @@ -38,7 +37,9 @@ import { "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99" */ -@lazy @inline const DIGITS: u32[] = [ +// @ts-ignore: decorator +@lazy @inline +const DIGITS: u32[] = [ 0x00300030, 0x00310030, 0x00320030, 0x00330030, 0x00340030, 0x00350030, 0x00360030, 0x00370030, 0x00380030, 0x00390030, 0x00300031, 0x00310031, 0x00320031, 0x00330031, 0x00340031, @@ -61,7 +62,9 @@ import { 0x00350039, 0x00360039, 0x00370039, 0x00380039, 0x00390039 ]; -@lazy @inline const EXP_POWERS: i16[] = [ +// @ts-ignore: decorator +@lazy @inline +const EXP_POWERS: i16[] = [ -1220, -1193, -1166, -1140, -1113, -1087, -1060, -1034, -1007, -980, -954, -927, -901, -874, -847, -821, -794, -768, -741, -715, -688, -661, -635, -608, -582, -555, -529, -502, -475, -449, @@ -74,7 +77,9 @@ import { ]; // 1e-348, 1e-340, ..., 1e340 -@lazy @inline const FRC_POWERS: u64[] = [ +// @ts-ignore: decorator +@lazy @inline +const FRC_POWERS: u64[] = [ 0xFA8FD5A0081C0288, 0xBAAEE17FA23EBF76, 0x8B16FB203055AC76, 0xCF42894A5DCE35EA, 0x9A6BB0AA55653B2D, 0xE61ACF033D1A45DF, 0xAB70FE17C79AC6CA, 0xFF77B1FCBEBCDC4F, 0xBE5691EF416BD60C, 0x8DD01FAD907FFC3C, 0xD3515C2831559A83, 0x9D71AC8FADA6C9B5, @@ -102,29 +107,19 @@ import { // Count number of decimals for u32 values // In our case input value always non-zero so we can simplify some parts export function decimalCount32(value: u32): u32 { - if (ASC_SHRINK_LEVEL >= 1) { - let l: u32 = 32 - clz(value); // log2 - let t = l * 1233 >>> 12; // log10 - - let lutbuf = POWERS10.buffer_; - let power = LOAD(lutbuf, t); - t -= (value < power); - return t + 1; + if (value < 100000) { + if (value < 100) { + return select(1, 2, value < 10); + } else { + let m = select(4, 5, value < 10000); + return select(3, m, value < 1000); + } } else { - if (value < 100000) { - if (value < 100) { - return select(1, 2, value < 10); - } else { - let m = select(4, 5, value < 10000); - return select(3, m, value < 1000); - } + if (value < 10000000) { + return select(6, 7, value < 1000000); } else { - if (value < 10000000) { - return select(6, 7, value < 1000000); - } else { - let m = select(9, 10, value < 1000000000); - return select(8, m, value < 100000000); - } + let m = select(9, 10, value < 1000000000); + return select(8, m, value < 100000000); } } } @@ -132,36 +127,25 @@ export function decimalCount32(value: u32): u32 { // Count number of decimals for u64 values // In our case input value always greater than 2^32-1 so we can skip some parts export function decimalCount64(value: u64): u32 { - if (ASC_SHRINK_LEVEL >= 1) { - let l: u32 = 64 - clz(value); // log2 - let t = l * 1233 >>> 12; // log10 - - let lutbuf = POWERS10.buffer_; - let power = LOAD(lutbuf, t - 10); - t -= (value < 10000000000 * power); - return t + 1; + if (value < 1000000000000000) { + if (value < 1000000000000) { + return select(11, 12, value < 100000000000); + } else { + let m = select(14, 15, value < 100000000000000); + return select(13, m, value < 10000000000000); + } } else { - if (value < 1000000000000000) { - if (value < 1000000000000) { - return select(11, 12, value < 100000000000); - } else { - let m = select(14, 15, value < 100000000000000); - return select(13, m, value < 10000000000000); - } + if (value < 100000000000000000) { + return select(16, 17, value < 10000000000000000); } else { - if (value < 100000000000000000) { - return select(16, 17, value < 10000000000000000); - } else { - let m = select(19, 20, value < 10000000000000000000); - return select(18, m, value < 1000000000000000000); - } + let m = select(19, 20, value < 10000000000000000000); + return select(18, m, value < 1000000000000000000); } } } function utoa32_lut(buffer: usize, num: u32, offset: usize): void { - var lutbuf = DIGITS.buffer_; - + var lut = changetype(DIGITS).dataStart; while (num >= 10000) { // in most VMs i32/u32 div and modulo by constant can be shared and simplificate let t = num / 10000; @@ -171,11 +155,11 @@ function utoa32_lut(buffer: usize, num: u32, offset: usize): void { let d1 = r / 100; let d2 = r % 100; - let digits1 = LOAD(lutbuf, d1); - let digits2 = LOAD(lutbuf, d2); + let digits1 = load(lut + (d1 << alignof())); + let digits2 = load(lut + (d2 << alignof())); offset -= 4; - store(buffer + (offset << 1), digits1 | (digits2 << 32), STRING_HEADER_SIZE); + store(buffer + (offset << 1), digits1 | (digits2 << 32)); } if (num >= 100) { @@ -183,24 +167,23 @@ function utoa32_lut(buffer: usize, num: u32, offset: usize): void { let d1 = num % 100; num = t; offset -= 2; - let digits = LOAD(lutbuf, d1); - store(buffer + (offset << 1), digits, STRING_HEADER_SIZE); + let digits = load(lut + (d1 << alignof())); + store(buffer + (offset << 1), digits); } if (num >= 10) { offset -= 2; - let digits = LOAD(lutbuf, num); - store(buffer + (offset << 1), digits, STRING_HEADER_SIZE); + let digits = load(lut + (num << alignof())); + store(buffer + (offset << 1), digits); } else { offset -= 1; let digit = CharCode._0 + num; - store(buffer + (offset << 1), digit, STRING_HEADER_SIZE); + store(buffer + (offset << 1), digit); } } function utoa64_lut(buffer: usize, num: u64, offset: usize): void { - var lutbuf = DIGITS.buffer_; - + var lut = changetype(DIGITS).dataStart; while (num >= 100000000) { let t = num / 100000000; let r = (num - t * 100000000); @@ -214,32 +197,33 @@ function utoa64_lut(buffer: usize, num: u64, offset: usize): void { let c1 = c / 100; let c2 = c % 100; - let digits1 = LOAD(lutbuf, c1); - let digits2 = LOAD(lutbuf, c2); + let digits1 = load(lut + (c1 << alignof())); + let digits2 = load(lut + (c2 << alignof())); offset -= 4; - store(buffer + (offset << 1), digits1 | (digits2 << 32), STRING_HEADER_SIZE); + store(buffer + (offset << 1), digits1 | (digits2 << 32)); - digits1 = LOAD(lutbuf, b1); - digits2 = LOAD(lutbuf, b2); + digits1 = load(lut + (b1 << alignof())); + digits2 = load(lut + (b2 << alignof())); offset -= 4; - store(buffer + (offset << 1), digits1 | (digits2 << 32), STRING_HEADER_SIZE); + store(buffer + (offset << 1), digits1 | (digits2 << 32)); } utoa32_lut(buffer, num, offset); } -function utoa_simple(buffer: usize, num: T, offset: usize): void { +function utoa_simple(buffer: usize, num: T, offset: usize): void { do { let t = num / 10; let r = (num % 10); - num = t; + num = changetype(t); offset -= 1; - store(buffer + (offset << 1), CharCode._0 + r, STRING_HEADER_SIZE); + store(buffer + (offset << 1), CharCode._0 + r); } while (num); } +// @ts-ignore: decorator @inline export function utoa32_core(buffer: usize, num: u32, offset: u32): void { if (ASC_SHRINK_LEVEL >= 1) { @@ -249,6 +233,7 @@ export function utoa32_core(buffer: usize, num: u32, offset: u32): void { } } +// @ts-ignore: decorator @inline export function utoa64_core(buffer: usize, num: u64, offset: u32): void { if (ASC_SHRINK_LEVEL >= 1) { @@ -262,10 +247,10 @@ export function utoa32(value: u32): String { if (!value) return "0"; var decimals = decimalCount32(value); - var buffer = allocateUnsafeString(decimals); + var out = __alloc(decimals << 1, idof()); - utoa32_core(changetype(buffer), value, decimals); - return buffer; + utoa32_core(out, value, decimals); + return changetype(out); // retains } export function itoa32(value: i32): String { @@ -274,30 +259,29 @@ export function itoa32(value: i32): String { var sign = value < 0; if (sign) value = -value; - var decimals = decimalCount32(value) + sign; - var buffer = allocateUnsafeString(decimals); - - utoa32_core(changetype(buffer), value, decimals); - if (sign) store(changetype(buffer), CharCode.MINUS, STRING_HEADER_SIZE); + var decimals = decimalCount32(value) + u32(sign); + var out = __alloc(decimals << 1, idof()); - return buffer; + utoa32_core(out, value, decimals); + if (sign) store(out, CharCode.MINUS); + return changetype(out); // retains } export function utoa64(value: u64): String { if (!value) return "0"; - var buffer: String; + var out: usize; if (value <= u32.MAX_VALUE) { let val32 = value; let decimals = decimalCount32(val32); - buffer = allocateUnsafeString(decimals); - utoa32_core(changetype(buffer), val32, decimals); + out = __alloc(decimals << 1, idof()); + utoa32_core(out, val32, decimals); } else { let decimals = decimalCount64(value); - buffer = allocateUnsafeString(decimals); - utoa64_core(changetype(buffer), value, decimals); + out = __alloc(decimals << 1, idof()); + utoa64_core(out, value, decimals); } - return buffer; + return changetype(out); // retains } export function itoa64(value: i64): String { @@ -306,50 +290,68 @@ export function itoa64(value: i64): String { var sign = value < 0; if (sign) value = -value; - var buffer: String; + var out: usize; if (value <= u32.MAX_VALUE) { let val32 = value; - let decimals = decimalCount32(val32) + sign; - buffer = allocateUnsafeString(decimals); - utoa32_core(changetype(buffer), val32, decimals); + let decimals = decimalCount32(val32) + u32(sign); + out = __alloc(decimals << 1, idof()); + utoa32_core(out, val32, decimals); } else { - let decimals = decimalCount64(value) + sign; - buffer = allocateUnsafeString(decimals); - utoa64_core(changetype(buffer), value, decimals); + let decimals = decimalCount64(value) + u32(sign); + out = __alloc(decimals << 1, idof()); + utoa64_core(out, value, decimals); } - if (sign) store(changetype(buffer), CharCode.MINUS, STRING_HEADER_SIZE); + if (sign) store(out, CharCode.MINUS); - return buffer; + return changetype(out); // retains } -export function itoa(value: T): String { - if (!isInteger()) { - assert(false); // unexpecteble non-integer generic type +export function itoa(value: T): String { + if (!isInteger()) ERROR("integer type expected"); + if (isSigned()) { + if (sizeof() <= 4) { + return itoa32(value); + } else { + return itoa64(value); + } } else { - if (isSigned()) { - if (sizeof() <= 4) { - return itoa32(value); - } else { - return itoa64(value); - } + if (sizeof() <= 4) { + return utoa32(value); } else { - if (sizeof() <= 4) { - return utoa32(value); - } else { - return utoa64(value); - } + return utoa64(value); } } } -@lazy var _K: i32 = 0; -// @lazy var _frc: u64 = 0; -@lazy var _exp: i32 = 0; -@lazy var _frc_minus: u64 = 0; -@lazy var _frc_plus: u64 = 0; -@lazy var _frc_pow: u64 = 0; -@lazy var _exp_pow: i32 = 0; +// @ts-ignore: decorator +@lazy +var _K: i32 = 0; + +// // @ts-ignore: decorator +// @lazy +// var _frc: u64 = 0; + +// @ts-ignore: decorator +@lazy +var _exp: i32 = 0; + +// @ts-ignore: decorator +@lazy +var _frc_minus: u64 = 0; + +// @ts-ignore: decorator +@lazy +var _frc_plus: u64 = 0; + +// @ts-ignore: decorator +@lazy +var _frc_pow: u64 = 0; + +// @ts-ignore: decorator +@lazy +var _exp_pow: i32 = 0; +// @ts-ignore: decorator @inline function umul64f(u: u64, v: u64): u64 { var u0 = u & 0xFFFFFFFF; @@ -370,11 +372,13 @@ function umul64f(u: u64, v: u64): u64 { return u1 * v1 + t + w; } +// @ts-ignore: decorator @inline function umul64e(e1: i32, e2: i32): i32 { return e1 + e2 + 64; // where 64 is significand size } +// @ts-ignore: decorator @inline function normalizedBoundaries(f: u64, e: i32): void { var frc = (f << 1) + 1; @@ -383,17 +387,18 @@ function normalizedBoundaries(f: u64, e: i32): void { frc <<= off; exp -= off; - var m = 1 + (f == 0x0010000000000000); + var m = 1 + i32(f == 0x0010000000000000); _frc_plus = frc; _frc_minus = ((f << m) - 1) << e - m - exp; _exp = exp; } +// @ts-ignore: decorator @inline function grisuRound(buffer: usize, len: i32, delta: u64, rest: u64, ten_kappa: u64, wp_w: u64): void { var lastp = buffer + ((len - 1) << 1); - var digit = load(lastp, STRING_HEADER_SIZE); + var digit = load(lastp); while ( rest < wp_w && delta - rest >= ten_kappa && ( @@ -404,24 +409,24 @@ function grisuRound(buffer: usize, len: i32, delta: u64, rest: u64, ten_kappa: u --digit; rest += ten_kappa; } - store(lastp, digit, STRING_HEADER_SIZE); + store(lastp, digit); } +// @ts-ignore: decorator @inline function getCachedPower(minExp: i32): void { const c = reinterpret(0x3FD34413509F79FE); // 1 / lg(10) = 0.30102999566398114 var dk = (-61 - minExp) * c + 347; // dk must be positive, so can do ceiling in positive var k = dk; - k += (k != dk); // conversion with ceil + k += i32(k != dk); // conversion with ceil var index = (k >> 3) + 1; _K = 348 - (index << 3); // decimal exponent no need lookup table - var frcPowers = FRC_POWERS.buffer_; - var expPowers = EXP_POWERS.buffer_; - _frc_pow = LOAD(frcPowers, index); - _exp_pow = LOAD(expPowers, index); + _frc_pow = unchecked(FRC_POWERS[index]); + _exp_pow = unchecked(EXP_POWERS[index]); } +// @ts-ignore: decorator @inline function grisu2(value: f64, buffer: usize, sign: i32): i32 { @@ -429,7 +434,7 @@ function grisu2(value: f64, buffer: usize, sign: i32): i32 { var uv = reinterpret(value); var exp = ((uv & 0x7FF0000000000000) >>> 52); var sid = uv & 0x000FFFFFFFFFFFFF; - var frc = ((exp != 0) << 52) + sid; + var frc = (u64(exp != 0) << 52) + sid; exp = select(exp, 1, exp != 0) - (0x3FF + 52); normalizedBoundaries(frc, exp); @@ -469,7 +474,7 @@ function genDigits(buffer: usize, w_frc: u64, w_exp: i32, mp_frc: u64, mp_exp: i var kappa = decimalCount32(p1); var len = sign; - var powers10 = POWERS10.buffer_; + var lut = changetype(POWERS10).dataStart; while (kappa > 0) { let d: u32; @@ -487,13 +492,13 @@ function genDigits(buffer: usize, w_frc: u64, w_exp: i32, mp_frc: u64, mp_exp: i default: { d = 0; break; } } - if (d | len) store(buffer + (len++ << 1), CharCode._0 + d, STRING_HEADER_SIZE); + if (d | len) store(buffer + (len++ << 1), CharCode._0 + d); --kappa; let tmp = ((p1) << one_exp) + p2; if (tmp <= delta) { _K += kappa; - grisuRound(buffer, len, delta, tmp, LOAD(powers10, kappa) << one_exp, wp_w_frc); + grisuRound(buffer, len, delta, tmp, load(lut + (kappa << alignof())) << one_exp, wp_w_frc); return len; } } @@ -503,13 +508,13 @@ function genDigits(buffer: usize, w_frc: u64, w_exp: i32, mp_frc: u64, mp_exp: i delta *= 10; let d = p2 >> one_exp; - if (d | len) store(buffer + (len++ << 1), CharCode._0 + d, STRING_HEADER_SIZE); + if (d | len) store(buffer + (len++ << 1), CharCode._0 + d); p2 &= mask; --kappa; if (p2 < delta) { _K += kappa; - wp_w_frc *= LOAD(powers10, -kappa); + wp_w_frc *= load(lut + (-kappa << alignof())); grisuRound(buffer, len, delta, p2, one_frc, wp_w_frc); return len; } @@ -518,19 +523,20 @@ function genDigits(buffer: usize, w_frc: u64, w_exp: i32, mp_frc: u64, mp_exp: i return len; } +// @ts-ignore: decorator @inline function genExponent(buffer: usize, k: i32): i32 { var sign = k < 0; if (sign) k = -k; var decimals = decimalCount32(k) + 1; utoa32_core(buffer, k, decimals); - store(buffer, select(CharCode.MINUS, CharCode.PLUS, sign), STRING_HEADER_SIZE); + store(buffer, select(CharCode.MINUS, CharCode.PLUS, sign)); return decimals; } function prettify(buffer: usize, length: i32, k: i32): i32 { if (!k) { - store(buffer + (length << 1), CharCode.DOT | (CharCode._0 << 16), STRING_HEADER_SIZE); + store(buffer + (length << 1), CharCode.DOT | (CharCode._0 << 16)); return length + 2; } @@ -538,57 +544,57 @@ function prettify(buffer: usize, length: i32, k: i32): i32 { if (length <= kk && kk <= 21) { // 1234e7 -> 12340000000 for (let i = length; i < kk; ++i) { - store(buffer + (i << 1), CharCode._0, STRING_HEADER_SIZE); + store(buffer + (i << 1), CharCode._0); } - store(buffer + (kk << 1), CharCode.DOT | (CharCode._0 << 16), STRING_HEADER_SIZE); + store(buffer + (kk << 1), CharCode.DOT | (CharCode._0 << 16)); return kk + 2; } else if (kk > 0 && kk <= 21) { // 1234e-2 -> 12.34 let ptr = buffer + (kk << 1); memory.copy( - ptr + STRING_HEADER_SIZE + 2, - ptr + STRING_HEADER_SIZE, + ptr + 2, + ptr, -k << 1 ); - store(buffer + (kk << 1), CharCode.DOT, STRING_HEADER_SIZE); + store(buffer + (kk << 1), CharCode.DOT); return length + 1; } else if (-6 < kk && kk <= 0) { // 1234e-6 -> 0.001234 let offset = 2 - kk; memory.copy( - buffer + STRING_HEADER_SIZE + (offset << 1), - buffer + STRING_HEADER_SIZE, + buffer + (offset << 1), + buffer, length << 1 ); - store(buffer, CharCode._0 | (CharCode.DOT << 16), STRING_HEADER_SIZE); + store(buffer, CharCode._0 | (CharCode.DOT << 16)); for (let i = 2; i < offset; ++i) { - store(buffer + (i << 1), CharCode._0, STRING_HEADER_SIZE); + store(buffer + (i << 1), CharCode._0); } return length + offset; } else if (length == 1) { // 1e30 - store(buffer, CharCode.e, STRING_HEADER_SIZE + 2); + store(buffer, CharCode.e, 2); length = genExponent(buffer + 4, kk - 1); return length + 2; } else { let len = length << 1; memory.copy( - buffer + STRING_HEADER_SIZE + 4, - buffer + STRING_HEADER_SIZE + 2, + buffer + 4, + buffer + 2, len - 2 ); - store(buffer, CharCode.DOT, STRING_HEADER_SIZE + 2); - store(buffer + len, CharCode.e, STRING_HEADER_SIZE + 2); + store(buffer, CharCode.DOT, 2); + store(buffer + len, CharCode.e, 2); length += genExponent(buffer + len + 4, kk - 1); return length + 2; } } export function dtoa_core(buffer: usize, value: f64): i32 { - var sign = (value < 0); + var sign = i32(value < 0); if (sign) { value = -value; - store(buffer, CharCode.MINUS, STRING_HEADER_SIZE); + store(buffer, CharCode.MINUS); } // assert(value > 0 && value <= 1.7976931348623157e308); var len = grisu2(value, buffer, sign); @@ -598,27 +604,28 @@ export function dtoa_core(buffer: usize, value: f64): i32 { export function dtoa(value: f64): String { if (value == 0) return "0.0"; - if (!isFinite(value)) { - if (isNaN(value)) return "NaN"; + if (!isFinite(value)) { + if (isNaN(value)) return "NaN"; return select("-Infinity", "Infinity", value < 0); } - var buffer = allocateUnsafeString(MAX_DOUBLE_LENGTH); - var length = dtoa_core(changetype(buffer), value); - var result = buffer.substring(0, length); - freeUnsafeString(buffer); + var buffer = __alloc(MAX_DOUBLE_LENGTH << 1, idof()); + var length = dtoa_core(buffer, value); + if (length == MAX_DOUBLE_LENGTH) return changetype(buffer); + var result = changetype(buffer).substring(0, length); + __free(buffer); return result; } -export function itoa_stream(buffer: usize, offset: usize, value: T): u32 { +export function itoa_stream(buffer: usize, offset: usize, value: T): u32 { buffer += (offset << 1); if (!value) { - store(buffer, CharCode._0, STRING_HEADER_SIZE); + store(buffer, CharCode._0); return 1; } var decimals: u32 = 0; if (isSigned()) { - let sign = value < 0; - if (sign) value = -value; + let sign = i32(value < 0); + if (sign) value = changetype(-value); if (sizeof() <= 4) { decimals = decimalCount32(value) + sign; utoa32_core(buffer, value, decimals); @@ -632,7 +639,7 @@ export function itoa_stream(buffer: usize, offset: usize, value: T): u32 { utoa64_core(buffer, value, decimals); } } - if (sign) store(buffer, CharCode.MINUS, STRING_HEADER_SIZE); + if (sign) store(buffer, CharCode.MINUS); } else { if (sizeof() <= 4) { decimals = decimalCount32(value); @@ -654,22 +661,21 @@ export function itoa_stream(buffer: usize, offset: usize, value: T): u32 { export function dtoa_stream(buffer: usize, offset: usize, value: f64): u32 { buffer += (offset << 1); if (value == 0.0) { - store(buffer, CharCode._0, STRING_HEADER_SIZE + 0); - store(buffer, CharCode.DOT, STRING_HEADER_SIZE + 2); - store(buffer, CharCode._0, STRING_HEADER_SIZE + 4); + store(buffer, CharCode._0); + store(buffer, CharCode.DOT, 2); + store(buffer, CharCode._0, 4); return 3; } - if (!isFinite(value)) { - if (isNaN(value)) { - store(buffer, CharCode.N, STRING_HEADER_SIZE + 0); - store(buffer, CharCode.a, STRING_HEADER_SIZE + 2); - store(buffer, CharCode.N, STRING_HEADER_SIZE + 4); + if (!isFinite(value)) { + if (isNaN(value)) { + store(buffer, CharCode.N); + store(buffer, CharCode.a, 2); + store(buffer, CharCode.N, 4); return 3; } else { - let sign = (value < 0); + let sign = i32(value < 0); let len = 8 + sign; - let source = changetype(select("-Infinity", "Infinity", sign)); - memory.copy(buffer + STRING_HEADER_SIZE, source + STRING_HEADER_SIZE, len << 1); + memory.copy(buffer, changetype(select("-Infinity", "Infinity", sign)), len << 1); return len; } } diff --git a/std/assembly/util/sort.ts b/std/assembly/util/sort.ts new file mode 100644 index 0000000000..0bd18f0a52 --- /dev/null +++ b/std/assembly/util/sort.ts @@ -0,0 +1,141 @@ +import { compareImpl } from "./string"; + +// @ts-ignore: decorator +@inline +export function COMPARATOR(): (a: T, b: T) => i32 { + if (isInteger()) { + if (isSigned() && sizeof() <= 4) { + return (a: T, b: T): i32 => (i32(a) - i32(b)); + } else { + return (a: T, b: T): i32 => (i32(a > b) - i32(a < b)); + } + } else if (isFloat()) { + if (sizeof() == 4) { + return (a: T, b: T): i32 => { + var ia = reinterpret(f32(a)); + var ib = reinterpret(f32(b)); + ia ^= (ia >> 31) >>> 1; + ib ^= (ib >> 31) >>> 1; + return i32(ia > ib) - i32(ia < ib); + }; + } else { + return (a: T, b: T): i32 => { + var ia = reinterpret(f64(a)); + var ib = reinterpret(f64(b)); + ia ^= (ia >> 63) >>> 1; + ib ^= (ib >> 63) >>> 1; + return i32(ia > ib) - i32(ia < ib); + }; + } + } else if (isString()) { + return (a: T, b: T): i32 => { + if (a === b || a === null || b === null) return 0; + var alen = changetype(a).length; + var blen = changetype(b).length; + if (!alen && !blen) return 0; + if (!alen) return -1; + if (!blen) return 1; + return compareImpl(changetype(a), 0, changetype(b), 0, min(alen, blen)); + }; + } else { + return (a: T, b: T): i32 => (i32(a > b) - i32(a < b)); + } +} + +// @ts-ignore: decorator +@inline +export function SORT( + dataStart: usize, + length: i32, + comparator: (a: T, b: T) => i32 +): void { + if (isReference()) { + // TODO replace this to faster stable sort (TimSort) when it implemented + insertionSort(dataStart, length, comparator); + } else { + if (length < 256) { + insertionSort(dataStart, length, comparator); + } else { + weakHeapSort(dataStart, length, comparator); + } + } +} + +function insertionSort( + dataStart: usize, + length: i32, + comparator: (a: T, b: T) => i32 +): void { + for (let i = 0; i < length; i++) { + let a: T = load(dataStart + (i << alignof())); // a = arr[i] + let j = i - 1; + while (j >= 0) { + let b: T = load(dataStart + (j << alignof())); // b = arr[j] + if (comparator(a, b) < 0) { + store(dataStart + ((j-- + 1) << alignof()), b); // arr[j + 1] = b + } else break; + } + store(dataStart + ((j + 1) << alignof()), a); // arr[j + 1] = a + } +} + +function weakHeapSort( + dataStart: usize, + length: i32, + comparator: (a: T, b: T) => i32 +): void { + const shift32 = alignof(); + + var bitsetSize = (length + 31) >> 5 << shift32; + var bitset = __alloc(bitsetSize, 0); // indexed in 32-bit chunks below + memory.fill(bitset, 0, bitsetSize); + + // see: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.21.1863&rep=rep1&type=pdf + + for (let i = length - 1; i > 0; i--) { + let j = i; + while ((j & 1) == (load(bitset + (j >> 6 << shift32)) >> (j >> 1 & 31) & 1)) j >>= 1; + + let p = j >> 1; + let a: T = load(dataStart + (p << alignof())); // a = arr[p] + let b: T = load(dataStart + (i << alignof())); // b = arr[i] + if (comparator(a, b) < 0) { + store( + bitset + (i >> 5 << shift32), + load(bitset + (i >> 5 << shift32)) ^ (1 << (i & 31)) + ); + store(dataStart + (i << alignof()), a); // arr[i] = a + store(dataStart + (p << alignof()), b); // arr[p] = b + } + } + + for (let i = length - 1; i >= 2; i--) { + let a: T = load(dataStart); // a = arr[0] + store(dataStart, load(dataStart + (i << alignof()))); // arr[0] = arr[i] + store(dataStart + (i << alignof()), a); // arr[i] = a + + let x = 1, y: i32; + while ((y = (x << 1) + ((load(bitset + (x >> 5 << shift32)) >> (x & 31)) & 1)) < i) x = y; + + while (x > 0) { + a = load(dataStart); // a = arr[0] + let b: T = load(dataStart + (x << alignof())); // b = arr[x] + + if (comparator(a, b) < 0) { + store( + bitset + (x >> 5 << shift32), + load(bitset + (x >> 5 << shift32)) ^ (1 << (x & 31)) + ); + store(dataStart + (x << alignof()), a); // arr[x] = a + store(dataStart, b); // arr[0] = b + } + x >>= 1; + } + } + + __free(bitset); + + var t: T = load(dataStart, sizeof()); // t = arr[1] + store(dataStart, load(dataStart), sizeof()); // arr[1] = arr[0] + store(dataStart, t); // arr[0] = t +} diff --git a/std/assembly/util/string.ts b/std/assembly/util/string.ts new file mode 100644 index 0000000000..f03a936e2d --- /dev/null +++ b/std/assembly/util/string.ts @@ -0,0 +1,141 @@ +export function compareImpl(str1: string, index1: usize, str2: string, index2: usize, len: usize): i32 { + var result: i32 = 0; + var ptr1 = changetype(str1) + (index1 << 1); + var ptr2 = changetype(str2) + (index2 << 1); + while (len && !(result = load(ptr1) - load(ptr2))) { + --len, ptr1 += 2, ptr2 += 2; + } + return result; +} + +// @ts-ignore: decorator +@inline +export const enum CharCode { + PLUS = 0x2B, + MINUS = 0x2D, + DOT = 0x2E, + _0 = 0x30, + _1 = 0x31, + _2 = 0x32, + _3 = 0x33, + _4 = 0x34, + _5 = 0x35, + _6 = 0x36, + _7 = 0x37, + _8 = 0x38, + _9 = 0x39, + A = 0x41, + B = 0x42, + E = 0x45, + N = 0x4E, + O = 0x4F, + X = 0x58, + Z = 0x5a, + a = 0x61, + b = 0x62, + e = 0x65, + n = 0x6E, + o = 0x6F, + x = 0x78, + z = 0x7A +} + +export function isWhiteSpaceOrLineTerminator(c: i32): bool { + switch (c) { + case 9: // + case 10: // + case 13: // + case 11: // + case 12: // + case 32: // + case 160: // + case 8232: // + case 8233: // + case 65279: return true; // + default: return false; + } +} + +/** Parses a string to an integer (usually), using the specified radix. */ +export function parse(str: string, radix: i32 = 0): T { + var len: i32 = str.length; + // @ts-ignore: cast + if (!len) return NaN; + + var ptr = changetype(str) /* + HEAD -> offset */; + var code = load(ptr); + + // determine sign + var sign: T; + // trim white spaces + while (isWhiteSpaceOrLineTerminator(code)) { + code = load(ptr += 2); + --len; + } + if (code == CharCode.MINUS) { + // @ts-ignore: cast + if (!--len) return NaN; + code = load(ptr += 2); + // @ts-ignore: type + sign = -1; + } else if (code == CharCode.PLUS) { + // @ts-ignore: cast + if (!--len) return NaN; + code = load(ptr += 2); + // @ts-ignore: type + sign = 1; + } else { + // @ts-ignore: type + sign = 1; + } + + // determine radix + if (!radix) { + if (code == CharCode._0 && len > 2) { + switch (load(ptr + 2)) { + case CharCode.B: + case CharCode.b: { + ptr += 4; len -= 2; + radix = 2; + break; + } + case CharCode.O: + case CharCode.o: { + ptr += 4; len -= 2; + radix = 8; + break; + } + case CharCode.X: + case CharCode.x: { + ptr += 4; len -= 2; + radix = 16; + break; + } + default: radix = 10; + } + } else radix = 10; + } else if (radix < 2 || radix > 36) { + // @ts-ignore: cast + return NaN; + } + + // calculate value + // @ts-ignore: type + var num: T = 0; + while (len--) { + code = load(ptr); + if (code >= CharCode._0 && code <= CharCode._9) { + code -= CharCode._0; + } else if (code >= CharCode.A && code <= CharCode.Z) { + code -= CharCode.A - 10; + } else if (code >= CharCode.a && code <= CharCode.z) { + code -= CharCode.a - 10; + } else break; + if (code >= radix) break; + // @ts-ignore: type + num = (num * radix) + code; + ptr += 2; + } + // @ts-ignore: type + return sign * num; +} diff --git a/std/assembly/vector.ts b/std/assembly/vector.ts index 0b264a39ca..c7f1afa358 100644 --- a/std/assembly/vector.ts +++ b/std/assembly/vector.ts @@ -1,3 +1,4 @@ -@sealed +/** Vector abstraction. */ +@sealed @unmanaged export abstract class V128 { } diff --git a/std/portable/index.d.ts b/std/portable/index.d.ts index 1fbc7e41e0..b42237c2bc 100644 --- a/std/portable/index.d.ts +++ b/std/portable/index.d.ts @@ -130,7 +130,7 @@ declare function fmod(x: f64, y: f64): f64; declare function fmodf(x: f32, y: f32): f32; /** Converts any other numeric value to an 8-bit signed integer. */ -declare function i8(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): i8; +declare function i8(value: any): i8; declare namespace i8 { /** Smallest representable value. */ export const MIN_VALUE: i8; @@ -142,7 +142,7 @@ declare namespace i8 { export function parseInt(string: string, radix?: i32): i8; } /** Converts any other numeric value to a 16-bit signed integer. */ -declare function i16(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): i8; +declare function i16(value: any): i16; declare namespace i16 { /** Smallest representable value. */ export const MIN_VALUE: i16; @@ -154,7 +154,7 @@ declare namespace i16 { export function parseInt(string: string, radix?: i32): i16; } /** Converts any other numeric value to a 32-bit signed integer. */ -declare function i32(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): i32; +declare function i32(value: any): i32; declare namespace i32 { /** Smallest representable value. */ export const MIN_VALUE: i32; @@ -166,7 +166,7 @@ declare namespace i32 { export function parseInt(string: string, radix?: i32): i32; } /** Converts any other numeric value to a 32-bit (in WASM32) respectivel 64-bit (in WASM64) signed integer. */ -declare function isize(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): isize; +declare function isize(value: any): isize; declare namespace isize { /** Smallest representable value. */ export const MIN_VALUE: isize; @@ -178,7 +178,7 @@ declare namespace isize { export function parseInt(string: string, radix?: i32): isize; } /** Converts any other numeric value to an 8-bit unsigned integer. */ -declare function u8(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): i8; +declare function u8(value: any): u8; declare namespace u8 { /** Smallest representable value. */ export const MIN_VALUE: u8; @@ -190,7 +190,7 @@ declare namespace u8 { export function parseInt(string: string, radix?: i32): u8; } /** Converts any other numeric value to a 16-bit unsigned integer. */ -declare function u16(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): i8; +declare function u16(value: any): u16; declare namespace u16 { /** Smallest representable value. */ export const MIN_VALUE: u16; @@ -202,7 +202,7 @@ declare namespace u16 { export function parseInt(string: string, radix?: i32): u16; } /** Converts any other numeric value to a 32-bit unsigned integer. */ -declare function u32(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): i32; +declare function u32(value: any): u32; declare namespace u32 { /** Smallest representable value. */ export const MIN_VALUE: u32; @@ -214,7 +214,7 @@ declare namespace u32 { export function parseInt(string: string, radix?: i32): u32; } /** Converts any other numeric value to a 32-bit (in WASM32) respectivel 64-bit (in WASM64) unsigned integer. */ -declare function usize(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): isize; +declare function usize(value: any): isize; declare namespace usize { /** Smallest representable value. */ export const MIN_VALUE: usize; @@ -226,7 +226,7 @@ declare namespace usize { export function parseInt(string: string, radix?: i32): usize; } /** Converts any other numeric value to a 1-bit unsigned integer. */ -declare function bool(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): bool; +declare function bool(value: any): bool; declare namespace bool { /** Smallest representable value. */ export const MIN_VALUE: bool; @@ -234,7 +234,7 @@ declare namespace bool { export const MAX_VALUE: bool; } /** Converts any other numeric value to a 32-bit float. */ -declare function f32(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): f32; +declare function f32(value: any): f32; declare namespace f32 { /** Smallest representable value. */ export const MIN_VALUE: f32; @@ -262,7 +262,7 @@ declare namespace f32 { export function parseInt(string: string, radix?: i32): f32; } /** Converts any other numeric value to a 64-bit float. */ -declare function f64(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): f64; +declare function f64(value: any): f64; declare namespace f64 { /** Smallest representable value. */ export const MIN_VALUE: f64; @@ -376,6 +376,7 @@ declare class DataView { declare class Array { static isArray(value: any): value is Array; + static create(capacity?: i32): Array; [key: number]: T; length: i32; @@ -643,3 +644,6 @@ declare namespace console { /** @deprecated */ function log(message: string): void; } + +/** Annotates a class as being unmanaged with limited capabilities. */ +declare function unmanaged(constructor: Function): void; diff --git a/std/portable/index.js b/std/portable/index.js index 00aa35e1af..1c8173ce13 100644 --- a/std/portable/index.js +++ b/std/portable/index.js @@ -2,7 +2,7 @@ var globalScope = typeof window !== "undefined" && window || typeof global !== "undefined" && global || self; -globalScope.ASC_TARGET = 0; // JS +globalScope.ASC_TARGET = 2; // Target.JS globalScope.ASC_NO_ASSERT = false; globalScope.ASC_MEMORY_BASE = 0; globalScope.ASC_OPTIMIZE_LEVEL = 3; @@ -229,7 +229,13 @@ globalScope["isArrayLike"] = function isArrayLike(expr) { && typeof expr.length === 'number' && expr.length >= 0 && Math.trunc(expr.length) === expr.length; -} +}; + +Array.create = function(capacity) { + var arr = new Array(capacity); + arr.length = 0; + return arr; +}; globalScope["isDefined"] = function isDefined(expr) { return typeof expr !== "undefined"; @@ -305,3 +311,5 @@ globalScope["store"] = globalScope["__store"] || function store(ptr, value, offs globalScope["load"] = globalScope["__load"] || function load(ptr, offset) { return HEAP[(ptr | 0) + (offset | 0)]; }; + +globalScope["unmanaged"] = function() {}; diff --git a/tests/.gitignore b/tests/.gitignore index d873de2f78..2b6e30eded 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -1,2 +1,3 @@ *.wasm *.wasm.map +temp.* diff --git a/tests/allocators/arena/assembly/index.ts b/tests/allocators/arena/assembly/index.ts deleted file mode 100644 index 5d2618bb34..0000000000 --- a/tests/allocators/arena/assembly/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -import "allocator/arena"; -export { memory }; diff --git a/tests/allocators/arena/optimized.wat b/tests/allocators/arena/optimized.wat deleted file mode 100644 index 0756cb695a..0000000000 --- a/tests/allocators/arena/optimized.wat +++ /dev/null @@ -1,159 +0,0 @@ -(module - (type $_ (func)) - (type $iiii (func (param i32 i32 i32) (result i32))) - (type $ii (func (param i32) (result i32))) - (type $i_ (func (param i32))) - (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) - (export "memory" (memory $0)) - (export "table" (table $0)) - (export "memory.compare" (func $~lib/memory/memory.compare)) - (export "memory.allocate" (func $~lib/memory/memory.allocate)) - (export "memory.free" (func $~lib/memory/memory.free)) - (export "memory.reset" (func $~lib/memory/memory.reset)) - (start $start) - (func $~lib/internal/memory/memcmp (; 0 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - local.get $0 - local.get $1 - i32.eq - if - i32.const 0 - return - end - loop $continue|0 - local.get $2 - i32.const 0 - i32.ne - local.tee $3 - if (result i32) - local.get $0 - i32.load8_u - local.get $1 - i32.load8_u - i32.eq - else - local.get $3 - end - if - local.get $2 - i32.const 1 - i32.sub - local.set $2 - local.get $0 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.set $1 - br $continue|0 - end - end - local.get $2 - if (result i32) - local.get $0 - i32.load8_u - local.get $1 - i32.load8_u - i32.sub - else - i32.const 0 - end - ) - (func $~lib/memory/memory.compare (; 1 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $0 - local.get $1 - local.get $2 - call $~lib/internal/memory/memcmp - ) - (func $~lib/allocator/arena/__memory_allocate (; 2 ;) (type $ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - local.get $0 - i32.const 1073741824 - i32.gt_u - if - unreachable - end - global.get $~lib/allocator/arena/offset - local.tee $2 - local.get $0 - i32.const 1 - local.tee $1 - local.get $0 - local.get $1 - i32.gt_u - select - i32.add - i32.const 7 - i32.add - i32.const -8 - i32.and - local.tee $3 - current_memory - local.tee $1 - i32.const 16 - i32.shl - i32.gt_u - if - local.get $1 - local.get $3 - local.get $2 - i32.sub - i32.const 65535 - i32.add - i32.const -65536 - i32.and - i32.const 16 - i32.shr_u - local.tee $0 - local.tee $4 - local.get $1 - local.get $4 - i32.gt_s - select - grow_memory - i32.const 0 - i32.lt_s - if - local.get $0 - grow_memory - i32.const 0 - i32.lt_s - if - unreachable - end - end - end - local.get $3 - global.set $~lib/allocator/arena/offset - local.get $2 - ) - (func $~lib/memory/memory.allocate (; 3 ;) (type $ii) (param $0 i32) (result i32) - local.get $0 - call $~lib/allocator/arena/__memory_allocate - ) - (func $~lib/memory/memory.free (; 4 ;) (type $i_) (param $0 i32) - nop - ) - (func $~lib/memory/memory.reset (; 5 ;) (type $_) - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - ) - (func $start (; 6 ;) (type $_) - i32.const 8 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - ) - (func $null (; 7 ;) (type $_) - nop - ) -) diff --git a/tests/allocators/arena/untouched.wat b/tests/allocators/arena/untouched.wat deleted file mode 100644 index 664649377e..0000000000 --- a/tests/allocators/arena/untouched.wat +++ /dev/null @@ -1,199 +0,0 @@ -(module - (type $_ (func)) - (type $iiii (func (param i32 i32 i32) (result i32))) - (type $ii (func (param i32) (result i32))) - (type $i_ (func (param i32))) - (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) - (export "memory" (memory $0)) - (export "table" (table $0)) - (export "memory.compare" (func $~lib/memory/memory.compare)) - (export "memory.allocate" (func $~lib/memory/memory.allocate)) - (export "memory.free" (func $~lib/memory/memory.free)) - (export "memory.reset" (func $~lib/memory/memory.reset)) - (start $start) - (func $start:~lib/allocator/arena (; 0 ;) (type $_) - global.get $~lib/memory/HEAP_BASE - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - ) - (func $start:assembly/index (; 1 ;) (type $_) - call $start:~lib/allocator/arena - ) - (func $~lib/internal/memory/memcmp (; 2 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - local.get $0 - local.get $1 - i32.eq - if - i32.const 0 - return - end - block $break|0 - loop $continue|0 - local.get $2 - i32.const 0 - i32.ne - local.tee $3 - if (result i32) - local.get $0 - i32.load8_u - local.get $1 - i32.load8_u - i32.eq - else - local.get $3 - end - if - block - local.get $2 - i32.const 1 - i32.sub - local.set $2 - local.get $0 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.set $1 - end - br $continue|0 - end - end - end - local.get $2 - if (result i32) - local.get $0 - i32.load8_u - local.get $1 - i32.load8_u - i32.sub - else - i32.const 0 - end - ) - (func $~lib/memory/memory.compare (; 3 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $0 - local.get $1 - local.get $2 - call $~lib/internal/memory/memcmp - ) - (func $~lib/allocator/arena/__memory_allocate (; 4 ;) (type $ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $0 - i32.const 1073741824 - i32.gt_u - if - unreachable - end - global.get $~lib/allocator/arena/offset - local.set $1 - local.get $1 - local.get $0 - local.tee $2 - i32.const 1 - local.tee $3 - local.get $2 - local.get $3 - i32.gt_u - select - i32.add - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - local.set $4 - current_memory - local.set $5 - local.get $4 - local.get $5 - i32.const 16 - i32.shl - i32.gt_u - if - local.get $4 - local.get $1 - i32.sub - i32.const 65535 - i32.add - i32.const 65535 - i32.const -1 - i32.xor - i32.and - i32.const 16 - i32.shr_u - local.set $2 - local.get $5 - local.tee $3 - local.get $2 - local.tee $6 - local.get $3 - local.get $6 - i32.gt_s - select - local.set $3 - local.get $3 - grow_memory - i32.const 0 - i32.lt_s - if - local.get $2 - grow_memory - i32.const 0 - i32.lt_s - if - unreachable - end - end - end - local.get $4 - global.set $~lib/allocator/arena/offset - local.get $1 - ) - (func $~lib/memory/memory.allocate (; 5 ;) (type $ii) (param $0 i32) (result i32) - local.get $0 - call $~lib/allocator/arena/__memory_allocate - return - ) - (func $~lib/allocator/arena/__memory_free (; 6 ;) (type $i_) (param $0 i32) - nop - ) - (func $~lib/memory/memory.free (; 7 ;) (type $i_) (param $0 i32) - local.get $0 - call $~lib/allocator/arena/__memory_free - return - ) - (func $~lib/allocator/arena/__memory_reset (; 8 ;) (type $_) - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - ) - (func $~lib/memory/memory.reset (; 9 ;) (type $_) - call $~lib/allocator/arena/__memory_reset - return - ) - (func $start (; 10 ;) (type $_) - call $start:assembly/index - ) - (func $null (; 11 ;) (type $_) - ) -) diff --git a/std/assembly/allocator/buddy.ts b/tests/allocators/buddy/assembly/buddy.ts similarity index 98% rename from std/assembly/allocator/buddy.ts rename to tests/allocators/buddy/assembly/buddy.ts index 2aea2240ba..2e8963f22c 100644 --- a/std/assembly/allocator/buddy.ts +++ b/tests/allocators/buddy/assembly/buddy.ts @@ -1,8 +1,3 @@ -/** - * Buddy Memory Allocator. - * @module std/assembly/allocator/buddy - *//***/ - /* Copyright 2018 Evan Wallace @@ -94,7 +89,7 @@ class List { * for that size. The bucket at index 0 corresponds to an allocation size of * MAX_ALLOC (i.e. the whole address space). */ -var BUCKETS_START: usize = HEAP_BASE; +var BUCKETS_START: usize = __heap_base; var BUCKETS_END: usize = BUCKETS_START + BUCKET_COUNT * List.SIZE; function buckets$get(index: usize): List { @@ -340,7 +335,7 @@ function lower_bucket_limit(bucket: usize): u32 { // Memory allocator interface -@global export function __memory_allocate(request: usize): usize { +@global export function __mem_allocate(request: usize): usize { var original_bucket: usize, bucket: usize; /* @@ -474,7 +469,7 @@ function lower_bucket_limit(bucket: usize): u32 { return 0; } -@global export function __memory_free(ptr: usize): void { +@global export function __mem_free(ptr: usize): void { var bucket: usize, i: usize; /* diff --git a/tests/allocators/buddy/assembly/index.ts b/tests/allocators/buddy/assembly/index.ts index 2fe5eda08a..0f9f2e0055 100644 --- a/tests/allocators/buddy/assembly/index.ts +++ b/tests/allocators/buddy/assembly/index.ts @@ -1,2 +1,3 @@ -import "allocator/buddy"; +import "./buddy"; export { memory }; +export { __mem_allocate as __alloc, __mem_free as __free }; diff --git a/tests/allocators/buddy/optimized.wat b/tests/allocators/buddy/optimized.wat index 234ec45d80..be3fc9f349 100644 --- a/tests/allocators/buddy/optimized.wat +++ b/tests/allocators/buddy/optimized.wat @@ -1,87 +1,295 @@ (module - (type $_ (func)) - (type $iiii (func (param i32 i32 i32) (result i32))) - (type $ii (func (param i32) (result i32))) - (type $i_ (func (param i32))) - (type $ii_ (func (param i32 i32))) - (type $iii (func (param i32 i32) (result i32))) - (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $~lib/allocator/buddy/BUCKETS_START (mut i32) (i32.const 0)) - (global $~lib/allocator/buddy/BUCKETS_END (mut i32) (i32.const 0)) - (global $~lib/allocator/buddy/bucket_limit (mut i32) (i32.const 0)) - (global $~lib/allocator/buddy/NODE_IS_SPLIT_START (mut i32) (i32.const 0)) - (global $~lib/allocator/buddy/NODE_IS_SPLIT_END (mut i32) (i32.const 0)) - (global $~lib/allocator/buddy/base_ptr (mut i32) (i32.const 0)) - (global $~lib/allocator/buddy/max_ptr (mut i32) (i32.const 0)) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (memory $0 1) + (data (i32.const 8) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00N\00o\00t\00 \00i\00m\00p\00l\00e\00m\00e\00n\00t\00e\00d") + (data (i32.const 56) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00~\00l\00i\00b\00/\00m\00e\00m\00o\00r\00y\00.\00t\00s") + (global $assembly/buddy/BUCKETS_START (mut i32) (i32.const 0)) + (global $assembly/buddy/BUCKETS_END (mut i32) (i32.const 0)) + (global $assembly/buddy/bucket_limit (mut i32) (i32.const 0)) + (global $assembly/buddy/NODE_IS_SPLIT_START (mut i32) (i32.const 0)) + (global $assembly/buddy/NODE_IS_SPLIT_END (mut i32) (i32.const 0)) + (global $assembly/buddy/base_ptr (mut i32) (i32.const 0)) + (global $assembly/buddy/max_ptr (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) + (export "memory.copy" (func $~lib/memory/memory.copy)) + (export "memory.init" (func $~lib/memory/memory.init)) + (export "memory.drop" (func $~lib/memory/memory.drop)) + (export "memory.repeat" (func $~lib/memory/memory.repeat)) (export "memory.compare" (func $~lib/memory/memory.compare)) - (export "memory.allocate" (func $~lib/memory/memory.allocate)) - (export "memory.free" (func $~lib/memory/memory.free)) - (export "memory.reset" (func $~lib/memory/memory.reset)) + (export "__alloc" (func $assembly/buddy/__mem_allocate)) + (export "__free" (func $assembly/buddy/__mem_free)) (start $start) - (func $~lib/internal/memory/memcmp (; 0 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/memory/memory.init (; 1 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + i32.const 24 + i32.const 72 + i32.const 35 + i32.const 4 + call $~lib/builtins/abort + unreachable + ) + (func $~lib/memory/memory.drop (; 2 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 24 + i32.const 72 + i32.const 42 + i32.const 4 + call $~lib/builtins/abort + unreachable + ) + (func $~lib/memory/memory.copy (; 3 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - local.get $0 - local.get $1 - i32.eq - if - i32.const 0 - return - end - loop $continue|0 + (local $4 i32) + block $~lib/util/memory/memmove|inlined.0 local.get $2 - i32.const 0 - i32.ne - local.tee $3 - if (result i32) - local.get $0 - i32.load8_u + local.set $3 + local.get $0 + local.get $1 + i32.eq + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $1 + i32.lt_u + if local.get $1 - i32.load8_u + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and i32.eq + if + loop $continue|0 + local.get $0 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + br $continue|0 + end + end + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $1 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + br $continue|1 + end + end + end + loop $continue|2 + local.get $3 + if + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end else - local.get $3 + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|3 + local.get $0 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $3 + i32.const 8 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + loop $continue|5 + local.get $3 + if + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end end + end + ) + (func $~lib/memory/memory.repeat (; 4 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (local $4 i32) + local.get $2 + local.get $3 + i32.mul + local.set $3 + loop $continue|0 + local.get $4 + local.get $3 + i32.lt_u if - local.get $2 - i32.const 1 - i32.sub - local.set $2 local.get $0 - i32.const 1 + local.get $4 i32.add - local.set $0 local.get $1 - i32.const 1 + local.get $2 + call $~lib/memory/memory.copy + local.get $2 + local.get $4 i32.add - local.set $1 + local.set $4 br $continue|0 end end - local.get $2 - if (result i32) - local.get $0 - i32.load8_u - local.get $1 - i32.load8_u - i32.sub - else - i32.const 0 - end ) - (func $~lib/memory/memory.compare (; 1 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/memory/memory.compare (; 5 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 local.get $1 - local.get $2 - call $~lib/internal/memory/memcmp + i32.eq + if (result i32) + i32.const 0 + else + loop $continue|0 + local.get $2 + if (result i32) + local.get $0 + i32.load8_u + local.get $1 + i32.load8_u + i32.eq + else + i32.const 0 + end + if + local.get $2 + i32.const 1 + i32.sub + local.set $2 + local.get $0 + i32.const 1 + i32.add + local.set $0 + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $continue|0 + end + end + local.get $2 + if (result i32) + local.get $0 + i32.load8_u + local.get $1 + i32.load8_u + i32.sub + else + i32.const 0 + end + end ) - (func $~lib/allocator/buddy/update_max_ptr (; 2 ;) (type $ii) (param $0 i32) (result i32) - (local $1 i32) + (func $assembly/buddy/update_max_ptr (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - global.get $~lib/allocator/buddy/max_ptr + global.get $assembly/buddy/max_ptr i32.gt_u if local.get $0 @@ -91,31 +299,31 @@ i32.and i32.const 16 i32.shr_u - local.tee $1 - current_memory + local.tee $0 + memory.size i32.sub - grow_memory + memory.grow i32.const 0 i32.lt_s if i32.const 0 return end - local.get $1 + local.get $0 i32.const 16 i32.shl - global.set $~lib/allocator/buddy/max_ptr + global.set $assembly/buddy/max_ptr end i32.const 1 ) - (func $~lib/allocator/buddy/buckets$get (; 3 ;) (type $ii) (param $0 i32) (result i32) - global.get $~lib/allocator/buddy/BUCKETS_START + (func $assembly/buddy/buckets$get (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + global.get $assembly/buddy/BUCKETS_START local.get $0 i32.const 3 i32.shl i32.add ) - (func $~lib/allocator/buddy/list_init (; 4 ;) (type $i_) (param $0 i32) + (func $assembly/buddy/list_init (; 8 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 local.get $0 i32.store @@ -123,7 +331,7 @@ local.get $0 i32.store offset=4 ) - (func $~lib/allocator/buddy/list_push (; 5 ;) (type $ii_) (param $0 i32) (param $1 i32) + (func $assembly/buddy/list_push (; 9 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) local.get $1 local.get $0 @@ -140,7 +348,7 @@ local.get $1 i32.store ) - (func $~lib/allocator/buddy/bucket_for_request (; 6 ;) (type $ii) (param $0 i32) (result i32) + (func $assembly/buddy/bucket_for_request (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) i32.const 26 @@ -165,12 +373,12 @@ end local.get $1 ) - (func $~lib/allocator/buddy/node_for_ptr (; 7 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $assembly/buddy/node_for_ptr (; 11 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) i32.const 1 local.get $1 i32.shl local.get $0 - global.get $~lib/allocator/buddy/base_ptr + global.get $assembly/buddy/base_ptr i32.sub i32.const 30 local.get $1 @@ -180,13 +388,13 @@ i32.const 1 i32.sub ) - (func $~lib/allocator/buddy/node_is_split$get (; 8 ;) (type $ii) (param $0 i32) (result i32) - global.get $~lib/allocator/buddy/NODE_IS_SPLIT_START + (func $assembly/buddy/node_is_split$get (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + global.get $assembly/buddy/NODE_IS_SPLIT_START local.get $0 i32.add i32.load8_u ) - (func $~lib/allocator/buddy/parent_is_split (; 9 ;) (type $ii) (param $0 i32) (result i32) + (func $assembly/buddy/parent_is_split (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 1 i32.sub @@ -195,7 +403,7 @@ local.tee $0 i32.const 8 i32.div_u - call $~lib/allocator/buddy/node_is_split$get + call $assembly/buddy/node_is_split$get local.get $0 i32.const 7 i32.and @@ -205,7 +413,7 @@ i32.const 1 i32.eq ) - (func $~lib/allocator/buddy/list_remove (; 10 ;) (type $i_) (param $0 i32) + (func $assembly/buddy/list_remove (; 14 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) local.get $0 i32.load @@ -218,8 +426,8 @@ local.get $1 i32.store ) - (func $~lib/allocator/buddy/ptr_for_node (; 11 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - global.get $~lib/allocator/buddy/base_ptr + (func $assembly/buddy/ptr_for_node (; 15 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + global.get $assembly/buddy/base_ptr local.get $0 i32.const 1 local.get $1 @@ -233,9 +441,8 @@ i32.shl i32.add ) - (func $~lib/allocator/buddy/flip_parent_is_split (; 12 ;) (type $i_) (param $0 i32) + (func $assembly/buddy/flip_parent_is_split (; 16 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) - (local $2 i32) local.get $0 i32.const 1 i32.sub @@ -245,9 +452,7 @@ i32.const 8 i32.div_u local.tee $1 - local.set $2 - local.get $1 - call $~lib/allocator/buddy/node_is_split$get + call $assembly/buddy/node_is_split$get i32.const 1 local.get $0 i32.const 7 @@ -255,71 +460,67 @@ i32.shl i32.xor local.set $0 - global.get $~lib/allocator/buddy/NODE_IS_SPLIT_START - local.get $2 + global.get $assembly/buddy/NODE_IS_SPLIT_START + local.get $1 i32.add local.get $0 i32.store8 ) - (func $~lib/allocator/buddy/lower_bucket_limit (; 13 ;) (type $ii) (param $0 i32) (result i32) + (func $assembly/buddy/lower_bucket_limit (; 17 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) loop $continue|0 local.get $0 - global.get $~lib/allocator/buddy/bucket_limit + global.get $assembly/buddy/bucket_limit i32.lt_u if - global.get $~lib/allocator/buddy/base_ptr - global.get $~lib/allocator/buddy/bucket_limit - call $~lib/allocator/buddy/node_for_ptr + global.get $assembly/buddy/base_ptr + global.get $assembly/buddy/bucket_limit + call $assembly/buddy/node_for_ptr local.tee $1 - call $~lib/allocator/buddy/parent_is_split + call $assembly/buddy/parent_is_split i32.eqz if - global.get $~lib/allocator/buddy/base_ptr - call $~lib/allocator/buddy/list_remove - block (result i32) - global.get $~lib/allocator/buddy/bucket_limit - i32.const 1 - i32.sub - global.set $~lib/allocator/buddy/bucket_limit - global.get $~lib/allocator/buddy/bucket_limit - end - call $~lib/allocator/buddy/buckets$get - call $~lib/allocator/buddy/list_init - global.get $~lib/allocator/buddy/bucket_limit - call $~lib/allocator/buddy/buckets$get - global.get $~lib/allocator/buddy/base_ptr - call $~lib/allocator/buddy/list_push + global.get $assembly/buddy/base_ptr + call $assembly/buddy/list_remove + global.get $assembly/buddy/bucket_limit + i32.const 1 + i32.sub + global.set $assembly/buddy/bucket_limit + global.get $assembly/buddy/bucket_limit + call $assembly/buddy/buckets$get + call $assembly/buddy/list_init + global.get $assembly/buddy/bucket_limit + call $assembly/buddy/buckets$get + global.get $assembly/buddy/base_ptr + call $assembly/buddy/list_push br $continue|0 end local.get $1 i32.const 1 i32.add - global.get $~lib/allocator/buddy/bucket_limit - call $~lib/allocator/buddy/ptr_for_node + global.get $assembly/buddy/bucket_limit + call $assembly/buddy/ptr_for_node local.tee $2 i32.const 8 i32.add - call $~lib/allocator/buddy/update_max_ptr + call $assembly/buddy/update_max_ptr i32.eqz if i32.const 0 return end - global.get $~lib/allocator/buddy/bucket_limit - call $~lib/allocator/buddy/buckets$get + global.get $assembly/buddy/bucket_limit + call $assembly/buddy/buckets$get local.get $2 - call $~lib/allocator/buddy/list_push - block (result i32) - global.get $~lib/allocator/buddy/bucket_limit - i32.const 1 - i32.sub - global.set $~lib/allocator/buddy/bucket_limit - global.get $~lib/allocator/buddy/bucket_limit - end - call $~lib/allocator/buddy/buckets$get - call $~lib/allocator/buddy/list_init + call $assembly/buddy/list_push + global.get $assembly/buddy/bucket_limit + i32.const 1 + i32.sub + global.set $assembly/buddy/bucket_limit + global.get $assembly/buddy/bucket_limit + call $assembly/buddy/buckets$get + call $assembly/buddy/list_init local.get $1 i32.const 1 i32.sub @@ -328,29 +529,28 @@ local.tee $1 if local.get $1 - call $~lib/allocator/buddy/flip_parent_is_split + call $assembly/buddy/flip_parent_is_split end br $continue|0 end end i32.const 1 ) - (func $~lib/allocator/buddy/list_pop (; 14 ;) (type $ii) (param $0 i32) (result i32) - (local $1 i32) + (func $assembly/buddy/list_pop (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - i32.load - local.tee $1 local.get $0 + i32.load + local.tee $0 i32.eq if i32.const 0 return end - local.get $1 - call $~lib/allocator/buddy/list_remove - local.get $1 + local.get $0 + call $assembly/buddy/list_remove + local.get $0 ) - (func $~lib/allocator/buddy/__memory_allocate (; 15 ;) (type $ii) (param $0 i32) (result i32) + (func $assembly/buddy/__mem_allocate (; 19 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -361,42 +561,42 @@ if unreachable end - global.get $~lib/allocator/buddy/base_ptr + global.get $assembly/buddy/base_ptr i32.eqz if - global.get $~lib/allocator/buddy/NODE_IS_SPLIT_END + global.get $assembly/buddy/NODE_IS_SPLIT_END i32.const 7 i32.add i32.const -8 i32.and - global.set $~lib/allocator/buddy/base_ptr - current_memory + global.set $assembly/buddy/base_ptr + memory.size i32.const 16 i32.shl - global.set $~lib/allocator/buddy/max_ptr + global.set $assembly/buddy/max_ptr i32.const 26 - global.set $~lib/allocator/buddy/bucket_limit - global.get $~lib/allocator/buddy/base_ptr + global.set $assembly/buddy/bucket_limit + global.get $assembly/buddy/base_ptr i32.const 8 i32.add - call $~lib/allocator/buddy/update_max_ptr + call $assembly/buddy/update_max_ptr i32.eqz if i32.const 0 return end i32.const 26 - call $~lib/allocator/buddy/buckets$get - call $~lib/allocator/buddy/list_init + call $assembly/buddy/buckets$get + call $assembly/buddy/list_init i32.const 26 - call $~lib/allocator/buddy/buckets$get - global.get $~lib/allocator/buddy/base_ptr - call $~lib/allocator/buddy/list_push + call $assembly/buddy/buckets$get + global.get $assembly/buddy/base_ptr + call $assembly/buddy/list_push end local.get $0 i32.const 8 i32.add - call $~lib/allocator/buddy/bucket_for_request + call $assembly/buddy/bucket_for_request local.tee $1 local.set $4 loop $continue|0 @@ -405,28 +605,25 @@ i32.ne if local.get $1 - call $~lib/allocator/buddy/lower_bucket_limit + call $assembly/buddy/lower_bucket_limit i32.eqz if i32.const 0 return end local.get $1 - call $~lib/allocator/buddy/buckets$get - call $~lib/allocator/buddy/list_pop - local.tee $2 + call $assembly/buddy/buckets$get + call $assembly/buddy/list_pop + local.tee $3 i32.eqz if + i32.const 1 + local.get $1 + i32.eqz + global.get $assembly/buddy/bucket_limit local.get $1 - global.get $~lib/allocator/buddy/bucket_limit i32.ne - local.tee $2 - if (result i32) - local.get $2 - else - local.get $1 - i32.eqz - end + select if local.get $1 i32.const 1 @@ -437,85 +634,85 @@ local.get $1 i32.const 1 i32.sub - call $~lib/allocator/buddy/lower_bucket_limit + call $assembly/buddy/lower_bucket_limit i32.eqz if i32.const 0 return end local.get $1 - call $~lib/allocator/buddy/buckets$get - call $~lib/allocator/buddy/list_pop - local.set $2 + call $assembly/buddy/buckets$get + call $assembly/buddy/list_pop + local.set $3 end i32.const 1 i32.const 30 local.get $1 i32.sub i32.shl - local.set $3 + local.set $2 local.get $1 local.get $4 i32.lt_u - if (result i32) - local.get $3 + if + local.get $2 i32.const 2 i32.div_u i32.const 8 i32.add - else - local.get $3 + local.set $2 end local.get $2 + local.get $3 i32.add - call $~lib/allocator/buddy/update_max_ptr + call $assembly/buddy/update_max_ptr i32.eqz if local.get $1 - call $~lib/allocator/buddy/buckets$get - local.get $2 - call $~lib/allocator/buddy/list_push + call $assembly/buddy/buckets$get + local.get $3 + call $assembly/buddy/list_push i32.const 0 return end - local.get $2 + local.get $3 local.get $1 - call $~lib/allocator/buddy/node_for_ptr - local.tee $3 + call $assembly/buddy/node_for_ptr + local.tee $2 if - local.get $3 - call $~lib/allocator/buddy/flip_parent_is_split + local.get $2 + call $assembly/buddy/flip_parent_is_split end loop $continue|1 local.get $1 local.get $4 i32.lt_u if - local.get $3 + local.get $2 i32.const 1 i32.shl i32.const 1 i32.add - local.tee $3 - call $~lib/allocator/buddy/flip_parent_is_split + local.tee $2 + call $assembly/buddy/flip_parent_is_split local.get $1 i32.const 1 i32.add local.tee $1 - call $~lib/allocator/buddy/buckets$get - local.get $3 + call $assembly/buddy/buckets$get + local.get $2 i32.const 1 i32.add local.get $1 - call $~lib/allocator/buddy/ptr_for_node - call $~lib/allocator/buddy/list_push + call $assembly/buddy/ptr_for_node + call $assembly/buddy/list_push br $continue|1 end end - local.get $2 + local.get $3 local.get $0 i32.store - local.get $2 + local.get $3 i32.const 8 i32.add return @@ -523,13 +720,8 @@ end i32.const 0 ) - (func $~lib/memory/memory.allocate (; 16 ;) (type $ii) (param $0 i32) (result i32) - local.get $0 - call $~lib/allocator/buddy/__memory_allocate - ) - (func $~lib/allocator/buddy/__memory_free (; 17 ;) (type $i_) (param $0 i32) + (func $assembly/buddy/__mem_free (; 20 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) - (local $2 i32) local.get $0 i32.eqz if @@ -538,86 +730,77 @@ local.get $0 i32.const 8 i32.sub - local.tee $0 + local.tee $1 i32.load i32.const 8 i32.add - call $~lib/allocator/buddy/bucket_for_request - local.set $1 - local.get $0 - local.get $1 - call $~lib/allocator/buddy/node_for_ptr + call $assembly/buddy/bucket_for_request local.set $0 + local.get $1 + local.get $0 + call $assembly/buddy/node_for_ptr + local.set $1 loop $continue|0 - local.get $0 + local.get $1 if block $break|0 - local.get $0 - call $~lib/allocator/buddy/flip_parent_is_split - local.get $0 - call $~lib/allocator/buddy/parent_is_split - local.tee $2 + local.get $1 + call $assembly/buddy/flip_parent_is_split + local.get $1 + call $assembly/buddy/parent_is_split if (result i32) - local.get $2 + i32.const 1 else - local.get $1 - global.get $~lib/allocator/buddy/bucket_limit + global.get $assembly/buddy/bucket_limit + local.get $0 i32.eq end br_if $break|0 - local.get $0 + local.get $1 i32.const 1 i32.sub + local.tee $1 i32.const 1 i32.xor i32.const 1 i32.add - local.get $1 - call $~lib/allocator/buddy/ptr_for_node - call $~lib/allocator/buddy/list_remove local.get $0 - i32.const 1 - i32.sub + call $assembly/buddy/ptr_for_node + call $assembly/buddy/list_remove + local.get $1 i32.const 2 i32.div_u - local.set $0 - local.get $1 + local.set $1 + local.get $0 i32.const 1 i32.sub - local.set $1 + local.set $0 br $continue|0 end end end - local.get $1 - call $~lib/allocator/buddy/buckets$get local.get $0 + call $assembly/buddy/buckets$get local.get $1 - call $~lib/allocator/buddy/ptr_for_node - call $~lib/allocator/buddy/list_push - ) - (func $~lib/memory/memory.free (; 18 ;) (type $i_) (param $0 i32) local.get $0 - call $~lib/allocator/buddy/__memory_free + call $assembly/buddy/ptr_for_node + call $assembly/buddy/list_push ) - (func $~lib/memory/memory.reset (; 19 ;) (type $_) - unreachable - ) - (func $start (; 20 ;) (type $_) - i32.const 8 - global.set $~lib/allocator/buddy/BUCKETS_START - global.get $~lib/allocator/buddy/BUCKETS_START + (func $start (; 21 ;) (type $FUNCSIG$v) + i32.const 100 + global.set $assembly/buddy/BUCKETS_START + global.get $assembly/buddy/BUCKETS_START i32.const 216 i32.add - global.set $~lib/allocator/buddy/BUCKETS_END - global.get $~lib/allocator/buddy/BUCKETS_END - global.set $~lib/allocator/buddy/NODE_IS_SPLIT_START - global.get $~lib/allocator/buddy/NODE_IS_SPLIT_START + global.set $assembly/buddy/BUCKETS_END + global.get $assembly/buddy/BUCKETS_END + global.set $assembly/buddy/NODE_IS_SPLIT_START + global.get $assembly/buddy/NODE_IS_SPLIT_START i32.const 8388608 i32.add - global.set $~lib/allocator/buddy/NODE_IS_SPLIT_END + global.set $assembly/buddy/NODE_IS_SPLIT_END ) - (func $null (; 21 ;) (type $_) + (func $null (; 22 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/allocators/buddy/package.json b/tests/allocators/buddy/package.json index 68fede664c..dc760bf282 100644 --- a/tests/allocators/buddy/package.json +++ b/tests/allocators/buddy/package.json @@ -2,7 +2,7 @@ "private": true, "scripts": { "build": "npm run build:untouched && npm run build:optimized", - "build:untouched": "node ../../../bin/asc assembly/index.ts -t untouched.wat -b untouched.wasm --validate --sourceMap --measure", - "build:optimized": "node ../../../bin/asc assembly/index.ts -t optimized.wat -b optimized.wasm --validate --sourceMap --measure --noAssert --optimize" + "build:untouched": "node ../../../bin/asc assembly/index.ts -t untouched.wat -b untouched.wasm --runtime none --validate --sourceMap --measure", + "build:optimized": "node ../../../bin/asc assembly/index.ts -t optimized.wat -b optimized.wasm --runtime none --validate --sourceMap --measure --noAssert --optimize" } } diff --git a/tests/allocators/buddy/untouched.wat b/tests/allocators/buddy/untouched.wat index b67987cb56..7c40826518 100644 --- a/tests/allocators/buddy/untouched.wat +++ b/tests/allocators/buddy/untouched.wat @@ -1,128 +1,1599 @@ (module - (type $_ (func)) - (type $iiii (func (param i32 i32 i32) (result i32))) - (type $ii (func (param i32) (result i32))) - (type $iiii_ (func (param i32 i32 i32 i32))) - (type $i_ (func (param i32))) - (type $ii_ (func (param i32 i32))) - (type $iii (func (param i32 i32) (result i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\17\00\00\00~\00l\00i\00b\00/\00a\00l\00l\00o\00c\00a\00t\00o\00r\00/\00b\00u\00d\00d\00y\00.\00t\00s\00") + (data (i32.const 8) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00N\00o\00t\00 \00i\00m\00p\00l\00e\00m\00e\00n\00t\00e\00d\00") + (data (i32.const 56) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00~\00l\00i\00b\00/\00m\00e\00m\00o\00r\00y\00.\00t\00s\00") + (data (i32.const 104) "\"\00\00\00\01\00\00\00\01\00\00\00\"\00\00\00a\00s\00s\00e\00m\00b\00l\00y\00/\00b\00u\00d\00d\00y\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/allocator/buddy/HEADER_SIZE i32 (i32.const 8)) - (global $~lib/allocator/buddy/MIN_ALLOC_LOG2 i32 (i32.const 4)) - (global $~lib/allocator/buddy/MIN_ALLOC i32 (i32.const 16)) - (global $~lib/allocator/buddy/MAX_ALLOC_LOG2 i32 (i32.const 30)) - (global $~lib/allocator/buddy/MAX_ALLOC i32 (i32.const 1073741824)) - (global $~lib/allocator/buddy/BUCKET_COUNT i32 (i32.const 27)) - (global $~lib/allocator/buddy/List.SIZE i32 (i32.const 8)) - (global $~lib/allocator/buddy/BUCKETS_START (mut i32) (i32.const 0)) - (global $~lib/allocator/buddy/BUCKETS_END (mut i32) (i32.const 0)) - (global $~lib/allocator/buddy/bucket_limit (mut i32) (i32.const 0)) - (global $~lib/allocator/buddy/SPLIT_COUNT i32 (i32.const 8388608)) - (global $~lib/allocator/buddy/NODE_IS_SPLIT_START (mut i32) (i32.const 0)) - (global $~lib/allocator/buddy/NODE_IS_SPLIT_END (mut i32) (i32.const 0)) - (global $~lib/allocator/buddy/base_ptr (mut i32) (i32.const 0)) - (global $~lib/allocator/buddy/max_ptr (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 60)) + (global $assembly/buddy/HEADER_SIZE i32 (i32.const 8)) + (global $assembly/buddy/MIN_ALLOC_LOG2 i32 (i32.const 4)) + (global $assembly/buddy/MIN_ALLOC i32 (i32.const 16)) + (global $assembly/buddy/MAX_ALLOC_LOG2 i32 (i32.const 30)) + (global $assembly/buddy/MAX_ALLOC i32 (i32.const 1073741824)) + (global $assembly/buddy/BUCKET_COUNT i32 (i32.const 27)) + (global $assembly/buddy/List.SIZE i32 (i32.const 8)) + (global $assembly/buddy/BUCKETS_START (mut i32) (i32.const 0)) + (global $assembly/buddy/BUCKETS_END (mut i32) (i32.const 0)) + (global $assembly/buddy/bucket_limit (mut i32) (i32.const 0)) + (global $assembly/buddy/SPLIT_COUNT i32 (i32.const 8388608)) + (global $assembly/buddy/NODE_IS_SPLIT_START (mut i32) (i32.const 0)) + (global $assembly/buddy/NODE_IS_SPLIT_END (mut i32) (i32.const 0)) + (global $assembly/buddy/base_ptr (mut i32) (i32.const 0)) + (global $assembly/buddy/max_ptr (mut i32) (i32.const 0)) + (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/heap/__heap_base i32 (i32.const 156)) (export "memory" (memory $0)) - (export "table" (table $0)) + (export "memory.copy" (func $~lib/memory/memory.copy)) + (export "memory.init" (func $~lib/memory/memory.init)) + (export "memory.drop" (func $~lib/memory/memory.drop)) + (export "memory.repeat" (func $~lib/memory/memory.repeat)) (export "memory.compare" (func $~lib/memory/memory.compare)) - (export "memory.allocate" (func $~lib/memory/memory.allocate)) - (export "memory.free" (func $~lib/memory/memory.free)) - (export "memory.reset" (func $~lib/memory/memory.reset)) + (export "__alloc" (func $assembly/buddy/__mem_allocate)) + (export "__free" (func $assembly/buddy/__mem_free)) (start $start) - (func $start:~lib/allocator/buddy (; 1 ;) (type $_) - global.get $~lib/memory/HEAP_BASE - global.set $~lib/allocator/buddy/BUCKETS_START - global.get $~lib/allocator/buddy/BUCKETS_START - global.get $~lib/allocator/buddy/BUCKET_COUNT - global.get $~lib/allocator/buddy/List.SIZE + (func $start:assembly/buddy (; 1 ;) (type $FUNCSIG$v) + global.get $~lib/heap/__heap_base + global.set $assembly/buddy/BUCKETS_START + global.get $assembly/buddy/BUCKETS_START + global.get $assembly/buddy/BUCKET_COUNT + global.get $assembly/buddy/List.SIZE i32.mul i32.add - global.set $~lib/allocator/buddy/BUCKETS_END - global.get $~lib/allocator/buddy/BUCKETS_END - global.set $~lib/allocator/buddy/NODE_IS_SPLIT_START - global.get $~lib/allocator/buddy/NODE_IS_SPLIT_START - global.get $~lib/allocator/buddy/SPLIT_COUNT + global.set $assembly/buddy/BUCKETS_END + global.get $assembly/buddy/BUCKETS_END + global.set $assembly/buddy/NODE_IS_SPLIT_START + global.get $assembly/buddy/NODE_IS_SPLIT_START + global.get $assembly/buddy/SPLIT_COUNT i32.const 1 i32.mul i32.add - global.set $~lib/allocator/buddy/NODE_IS_SPLIT_END + global.set $assembly/buddy/NODE_IS_SPLIT_END ) - (func $start:assembly/index (; 2 ;) (type $_) - call $start:~lib/allocator/buddy + (func $start:assembly/index (; 2 ;) (type $FUNCSIG$v) + call $start:assembly/buddy ) - (func $~lib/internal/memory/memcmp (; 3 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/memory/memory.init (; 3 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + i32.const 24 + i32.const 72 + i32.const 35 + i32.const 4 + call $~lib/builtins/abort + unreachable + ) + (func $~lib/memory/memory.drop (; 4 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 24 + i32.const 72 + i32.const 42 + i32.const 4 + call $~lib/builtins/abort + unreachable + ) + (func $~lib/util/memory/memcpy (; 5 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) + (local $4 i32) + (local $5 i32) + block $break|0 + loop $continue|0 + local.get $2 + if (result i32) + local.get $1 + i32.const 3 + i32.and + else + i32.const 0 + end + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $continue|0 + end + end + end local.get $0 - local.get $1 + i32.const 3 + i32.and + i32.const 0 i32.eq if - i32.const 0 + block $break|1 + loop $continue|1 + local.get $2 + i32.const 16 + i32.ge_u + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 8 + i32.add + i32.load + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 12 + i32.add + i32.load + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|1 + end + end + end + local.get $2 + i32.const 8 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + end + local.get $2 + i32.const 4 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.set $0 + local.get $1 + i32.const 4 + i32.add + local.set $1 + end + local.get $2 + i32.const 2 + i32.and + if + local.get $0 + local.get $1 + i32.load16_u + i32.store16 + local.get $0 + i32.const 2 + i32.add + local.set $0 + local.get $1 + i32.const 2 + i32.add + local.set $1 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end return end + local.get $2 + i32.const 32 + i32.ge_u + if + block $break|2 + block $case2|2 + block $case1|2 + block $case0|2 + local.get $0 + i32.const 3 + i32.and + local.set $5 + local.get $5 + i32.const 1 + i32.eq + br_if $case0|2 + local.get $5 + i32.const 2 + i32.eq + br_if $case1|2 + local.get $5 + i32.const 3 + i32.eq + br_if $case2|2 + br $break|2 + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 3 + i32.sub + local.set $2 + block $break|3 + loop $continue|3 + local.get $2 + i32.const 17 + i32.ge_u + if + local.get $1 + i32.const 1 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 5 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 9 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 13 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|3 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + block $break|4 + loop $continue|4 + local.get $2 + i32.const 18 + i32.ge_u + if + local.get $1 + i32.const 2 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 6 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 10 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 14 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|4 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + block $break|5 + loop $continue|5 + local.get $2 + i32.const 19 + i32.ge_u + if + local.get $1 + i32.const 3 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 7 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 11 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 15 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|5 + end + end + end + br $break|2 + unreachable + end + unreachable + end + end + local.get $2 + i32.const 16 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 8 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 4 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 2 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + ) + (func $~lib/memory/memory.copy (; 6 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $4 + local.get $3 + i32.add + local.get $5 + i32.le_u + if (result i32) + i32.const 1 + else + local.get $5 + local.get $3 + i32.add + local.get $4 + i32.le_u + end + if + local.get $5 + local.get $4 + local.get $3 + call $~lib/util/memory/memcpy + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/memory/memory.repeat (; 7 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (local $4 i32) + (local $5 i32) + i32.const 0 + local.set $4 + local.get $2 + local.get $3 + i32.mul + local.set $5 block $break|0 loop $continue|0 - local.get $2 - i32.const 0 - i32.ne - local.tee $3 - if (result i32) + local.get $4 + local.get $5 + i32.lt_u + if local.get $0 - i32.load8_u + local.get $4 + i32.add local.get $1 - i32.load8_u - i32.eq - else - local.get $3 + local.get $2 + call $~lib/memory/memory.copy + local.get $4 + local.get $2 + i32.add + local.set $4 + br $continue|0 end - if - block - local.get $2 + end + end + ) + (func $~lib/memory/memory.compare (; 8 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + block $~lib/util/memory/memcmp|inlined.0 (result i32) + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + i32.const 0 + br $~lib/util/memory/memcmp|inlined.0 + end + block $break|0 + loop $continue|0 + local.get $3 + i32.const 0 + i32.ne + if (result i32) + local.get $5 + i32.load8_u + local.get $4 + i32.load8_u + i32.eq + else + i32.const 0 + end + if + local.get $3 i32.const 1 i32.sub - local.set $2 - local.get $0 + local.set $3 + local.get $5 i32.const 1 i32.add - local.set $0 - local.get $1 + local.set $5 + local.get $4 i32.const 1 i32.add - local.set $1 + local.set $4 + br $continue|0 end - br $continue|0 end end - end - local.get $2 - if (result i32) - local.get $0 - i32.load8_u - local.get $1 - i32.load8_u - i32.sub - else - i32.const 0 + local.get $3 + if (result i32) + local.get $5 + i32.load8_u + local.get $4 + i32.load8_u + i32.sub + else + i32.const 0 + end end ) - (func $~lib/memory/memory.compare (; 4 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $0 - local.get $1 - local.get $2 - call $~lib/internal/memory/memcmp - ) - (func $~lib/allocator/buddy/update_max_ptr (; 5 ;) (type $ii) (param $0 i32) (result i32) + (func $assembly/buddy/update_max_ptr (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) local.get $0 - global.get $~lib/allocator/buddy/max_ptr + global.get $assembly/buddy/max_ptr i32.gt_u if - current_memory + memory.size local.set $1 local.get $0 i32.const 65535 @@ -140,16 +1611,16 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 181 + i32.const 120 + i32.const 176 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $2 local.get $1 i32.sub - grow_memory + memory.grow i32.const 0 i32.lt_s if @@ -159,30 +1630,30 @@ local.get $2 i32.const 16 i32.shl - global.set $~lib/allocator/buddy/max_ptr + global.set $assembly/buddy/max_ptr end i32.const 1 ) - (func $~lib/allocator/buddy/buckets$get (; 6 ;) (type $ii) (param $0 i32) (result i32) + (func $assembly/buddy/buckets$get (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - global.get $~lib/allocator/buddy/BUCKET_COUNT + global.get $assembly/buddy/BUCKET_COUNT i32.lt_u i32.eqz if i32.const 0 - i32.const 8 - i32.const 101 + i32.const 120 + i32.const 96 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $~lib/allocator/buddy/BUCKETS_START + global.get $assembly/buddy/BUCKETS_START local.get $0 - global.get $~lib/allocator/buddy/List.SIZE + global.get $assembly/buddy/List.SIZE i32.mul i32.add ) - (func $~lib/allocator/buddy/list_init (; 7 ;) (type $i_) (param $0 i32) + (func $assembly/buddy/list_init (; 11 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 local.get $0 i32.store @@ -190,7 +1661,7 @@ local.get $0 i32.store offset=4 ) - (func $~lib/allocator/buddy/list_push (; 8 ;) (type $ii_) (param $0 i32) (param $1 i32) + (func $assembly/buddy/list_push (; 12 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 i32.load @@ -208,14 +1679,14 @@ local.get $1 i32.store ) - (func $~lib/allocator/buddy/bucket_for_request (; 9 ;) (type $ii) (param $0 i32) (result i32) + (func $assembly/buddy/bucket_for_request (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - global.get $~lib/allocator/buddy/BUCKET_COUNT + global.get $assembly/buddy/BUCKET_COUNT i32.const 1 i32.sub local.set $1 - global.get $~lib/allocator/buddy/MIN_ALLOC + global.get $assembly/buddy/MIN_ALLOC local.set $2 block $break|0 loop $continue|0 @@ -223,27 +1694,25 @@ local.get $0 i32.lt_u if - block - local.get $1 - i32.const 1 - i32.sub - local.set $1 - local.get $2 - i32.const 2 - i32.mul - local.set $2 - end + local.get $1 + i32.const 1 + i32.sub + local.set $1 + local.get $2 + i32.const 2 + i32.mul + local.set $2 br $continue|0 end end end local.get $1 ) - (func $~lib/allocator/buddy/node_for_ptr (; 10 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $assembly/buddy/node_for_ptr (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 - global.get $~lib/allocator/buddy/base_ptr + global.get $assembly/buddy/base_ptr i32.sub - global.get $~lib/allocator/buddy/MAX_ALLOC_LOG2 + global.get $assembly/buddy/MAX_ALLOC_LOG2 local.get $1 i32.sub i32.shr_u @@ -254,25 +1723,25 @@ i32.const 1 i32.sub ) - (func $~lib/allocator/buddy/node_is_split$get (; 11 ;) (type $ii) (param $0 i32) (result i32) + (func $assembly/buddy/node_is_split$get (; 15 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - global.get $~lib/allocator/buddy/SPLIT_COUNT + global.get $assembly/buddy/SPLIT_COUNT i32.lt_u i32.eqz if i32.const 0 - i32.const 8 - i32.const 147 + i32.const 120 + i32.const 142 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $~lib/allocator/buddy/NODE_IS_SPLIT_START + global.get $assembly/buddy/NODE_IS_SPLIT_START local.get $0 i32.add i32.load8_u ) - (func $~lib/allocator/buddy/parent_is_split (; 12 ;) (type $ii) (param $0 i32) (result i32) + (func $assembly/buddy/parent_is_split (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 1 i32.sub @@ -282,7 +1751,7 @@ local.get $0 i32.const 8 i32.div_u - call $~lib/allocator/buddy/node_is_split$get + call $assembly/buddy/node_is_split$get local.get $0 i32.const 8 i32.rem_u @@ -292,7 +1761,7 @@ i32.const 1 i32.eq ) - (func $~lib/allocator/buddy/list_remove (; 13 ;) (type $i_) (param $0 i32) + (func $assembly/buddy/list_remove (; 17 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) (local $2 i32) local.get $0 @@ -308,8 +1777,8 @@ local.get $1 i32.store ) - (func $~lib/allocator/buddy/ptr_for_node (; 14 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - global.get $~lib/allocator/buddy/base_ptr + (func $assembly/buddy/ptr_for_node (; 18 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + global.get $assembly/buddy/base_ptr local.get $0 i32.const 1 local.get $1 @@ -317,32 +1786,32 @@ i32.sub i32.const 1 i32.add - global.get $~lib/allocator/buddy/MAX_ALLOC_LOG2 + global.get $assembly/buddy/MAX_ALLOC_LOG2 local.get $1 i32.sub i32.shl i32.add ) - (func $~lib/allocator/buddy/node_is_split$set (; 15 ;) (type $ii_) (param $0 i32) (param $1 i32) + (func $assembly/buddy/node_is_split$set (; 19 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) local.get $0 - global.get $~lib/allocator/buddy/SPLIT_COUNT + global.get $assembly/buddy/SPLIT_COUNT i32.lt_u i32.eqz if i32.const 0 - i32.const 8 - i32.const 152 + i32.const 120 + i32.const 147 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $~lib/allocator/buddy/NODE_IS_SPLIT_START + global.get $assembly/buddy/NODE_IS_SPLIT_START local.get $0 i32.add local.get $1 i32.store8 ) - (func $~lib/allocator/buddy/flip_parent_is_split (; 16 ;) (type $i_) (param $0 i32) + (func $assembly/buddy/flip_parent_is_split (; 20 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) local.get $0 i32.const 1 @@ -356,91 +1825,89 @@ local.set $1 local.get $1 local.get $1 - call $~lib/allocator/buddy/node_is_split$get + call $assembly/buddy/node_is_split$get i32.const 1 local.get $0 i32.const 8 i32.rem_u i32.shl i32.xor - call $~lib/allocator/buddy/node_is_split$set + call $assembly/buddy/node_is_split$set ) - (func $~lib/allocator/buddy/lower_bucket_limit (; 17 ;) (type $ii) (param $0 i32) (result i32) + (func $assembly/buddy/lower_bucket_limit (; 21 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) block $break|0 loop $continue|0 local.get $0 - global.get $~lib/allocator/buddy/bucket_limit + global.get $assembly/buddy/bucket_limit i32.lt_u if - block - global.get $~lib/allocator/buddy/base_ptr - global.get $~lib/allocator/buddy/bucket_limit - call $~lib/allocator/buddy/node_for_ptr - local.set $1 - local.get $1 - call $~lib/allocator/buddy/parent_is_split - i32.eqz - if - global.get $~lib/allocator/buddy/base_ptr - call $~lib/allocator/buddy/list_remove - block (result i32) - global.get $~lib/allocator/buddy/bucket_limit - i32.const 1 - i32.sub - global.set $~lib/allocator/buddy/bucket_limit - global.get $~lib/allocator/buddy/bucket_limit - end - call $~lib/allocator/buddy/buckets$get - call $~lib/allocator/buddy/list_init - global.get $~lib/allocator/buddy/bucket_limit - call $~lib/allocator/buddy/buckets$get - global.get $~lib/allocator/buddy/base_ptr - call $~lib/allocator/buddy/list_push - br $continue|0 - end - local.get $1 - i32.const 1 - i32.add - global.get $~lib/allocator/buddy/bucket_limit - call $~lib/allocator/buddy/ptr_for_node - local.set $2 - local.get $2 - global.get $~lib/allocator/buddy/List.SIZE - i32.add - call $~lib/allocator/buddy/update_max_ptr - i32.eqz - if - i32.const 0 - return - end - global.get $~lib/allocator/buddy/bucket_limit - call $~lib/allocator/buddy/buckets$get - local.get $2 - call $~lib/allocator/buddy/list_push + global.get $assembly/buddy/base_ptr + global.get $assembly/buddy/bucket_limit + call $assembly/buddy/node_for_ptr + local.set $1 + local.get $1 + call $assembly/buddy/parent_is_split + i32.eqz + if + global.get $assembly/buddy/base_ptr + call $assembly/buddy/list_remove block (result i32) - global.get $~lib/allocator/buddy/bucket_limit + global.get $assembly/buddy/bucket_limit i32.const 1 i32.sub - global.set $~lib/allocator/buddy/bucket_limit - global.get $~lib/allocator/buddy/bucket_limit + global.set $assembly/buddy/bucket_limit + global.get $assembly/buddy/bucket_limit end - call $~lib/allocator/buddy/buckets$get - call $~lib/allocator/buddy/list_init - local.get $1 + call $assembly/buddy/buckets$get + call $assembly/buddy/list_init + global.get $assembly/buddy/bucket_limit + call $assembly/buddy/buckets$get + global.get $assembly/buddy/base_ptr + call $assembly/buddy/list_push + br $continue|0 + end + local.get $1 + i32.const 1 + i32.add + global.get $assembly/buddy/bucket_limit + call $assembly/buddy/ptr_for_node + local.set $2 + local.get $2 + i32.const 8 + i32.add + call $assembly/buddy/update_max_ptr + i32.eqz + if + i32.const 0 + return + end + global.get $assembly/buddy/bucket_limit + call $assembly/buddy/buckets$get + local.get $2 + call $assembly/buddy/list_push + block (result i32) + global.get $assembly/buddy/bucket_limit i32.const 1 i32.sub - i32.const 2 - i32.div_u - local.set $1 + global.set $assembly/buddy/bucket_limit + global.get $assembly/buddy/bucket_limit + end + call $assembly/buddy/buckets$get + call $assembly/buddy/list_init + local.get $1 + i32.const 1 + i32.sub + i32.const 2 + i32.div_u + local.set $1 + local.get $1 + i32.const 0 + i32.ne + if local.get $1 - i32.const 0 - i32.ne - if - local.get $1 - call $~lib/allocator/buddy/flip_parent_is_split - end + call $assembly/buddy/flip_parent_is_split end br $continue|0 end @@ -448,7 +1915,7 @@ end i32.const 1 ) - (func $~lib/allocator/buddy/list_pop (; 18 ;) (type $ii) (param $0 i32) (result i32) + (func $assembly/buddy/list_pop (; 22 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 i32.load @@ -461,70 +1928,67 @@ return end local.get $1 - call $~lib/allocator/buddy/list_remove + call $assembly/buddy/list_remove local.get $1 ) - (func $~lib/allocator/buddy/__memory_allocate (; 19 ;) (type $ii) (param $0 i32) (result i32) + (func $assembly/buddy/__mem_allocate (; 23 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) local.get $0 - global.get $~lib/allocator/buddy/MAX_ALLOC - global.get $~lib/allocator/buddy/HEADER_SIZE - i32.sub + i32.const 1073741816 i32.gt_u if unreachable end - global.get $~lib/allocator/buddy/base_ptr + global.get $assembly/buddy/base_ptr i32.const 0 i32.eq if - global.get $~lib/allocator/buddy/NODE_IS_SPLIT_END + global.get $assembly/buddy/NODE_IS_SPLIT_END i32.const 7 i32.add i32.const 7 i32.const -1 i32.xor i32.and - global.set $~lib/allocator/buddy/base_ptr - current_memory + global.set $assembly/buddy/base_ptr + memory.size i32.const 16 i32.shl - global.set $~lib/allocator/buddy/max_ptr - global.get $~lib/allocator/buddy/BUCKET_COUNT + global.set $assembly/buddy/max_ptr + global.get $assembly/buddy/BUCKET_COUNT i32.const 1 i32.sub - global.set $~lib/allocator/buddy/bucket_limit - global.get $~lib/allocator/buddy/base_ptr - global.get $~lib/allocator/buddy/List.SIZE + global.set $assembly/buddy/bucket_limit + global.get $assembly/buddy/base_ptr + i32.const 8 i32.add - call $~lib/allocator/buddy/update_max_ptr + call $assembly/buddy/update_max_ptr i32.eqz if i32.const 0 return end - global.get $~lib/allocator/buddy/BUCKET_COUNT + global.get $assembly/buddy/BUCKET_COUNT i32.const 1 i32.sub - call $~lib/allocator/buddy/buckets$get - call $~lib/allocator/buddy/list_init - global.get $~lib/allocator/buddy/BUCKET_COUNT + call $assembly/buddy/buckets$get + call $assembly/buddy/list_init + global.get $assembly/buddy/BUCKET_COUNT i32.const 1 i32.sub - call $~lib/allocator/buddy/buckets$get - global.get $~lib/allocator/buddy/base_ptr - call $~lib/allocator/buddy/list_push + call $assembly/buddy/buckets$get + global.get $assembly/buddy/base_ptr + call $assembly/buddy/list_push end local.get $0 - global.get $~lib/allocator/buddy/HEADER_SIZE + global.get $assembly/buddy/HEADER_SIZE i32.add - call $~lib/allocator/buddy/bucket_for_request + call $assembly/buddy/bucket_for_request local.set $2 local.get $2 local.set $1 @@ -537,25 +2001,24 @@ i32.ne if local.get $2 - call $~lib/allocator/buddy/lower_bucket_limit + call $assembly/buddy/lower_bucket_limit i32.eqz if i32.const 0 return end local.get $2 - call $~lib/allocator/buddy/buckets$get - call $~lib/allocator/buddy/list_pop + call $assembly/buddy/buckets$get + call $assembly/buddy/list_pop local.set $6 local.get $6 i32.eqz if local.get $2 - global.get $~lib/allocator/buddy/bucket_limit + global.get $assembly/buddy/bucket_limit i32.ne - local.tee $7 if (result i32) - local.get $7 + i32.const 1 else local.get $2 i32.const 0 @@ -571,19 +2034,19 @@ local.get $2 i32.const 1 i32.sub - call $~lib/allocator/buddy/lower_bucket_limit + call $assembly/buddy/lower_bucket_limit i32.eqz if i32.const 0 return end local.get $2 - call $~lib/allocator/buddy/buckets$get - call $~lib/allocator/buddy/list_pop + call $assembly/buddy/buckets$get + call $assembly/buddy/list_pop local.set $6 end i32.const 1 - global.get $~lib/allocator/buddy/MAX_ALLOC_LOG2 + global.get $assembly/buddy/MAX_ALLOC_LOG2 local.get $2 i32.sub i32.shl @@ -595,7 +2058,7 @@ local.get $3 i32.const 2 i32.div_u - global.get $~lib/allocator/buddy/List.SIZE + global.get $assembly/buddy/List.SIZE i32.add else local.get $3 @@ -604,26 +2067,26 @@ local.get $6 local.get $4 i32.add - call $~lib/allocator/buddy/update_max_ptr + call $assembly/buddy/update_max_ptr i32.eqz if local.get $2 - call $~lib/allocator/buddy/buckets$get + call $assembly/buddy/buckets$get local.get $6 - call $~lib/allocator/buddy/list_push + call $assembly/buddy/list_push i32.const 0 return end local.get $6 local.get $2 - call $~lib/allocator/buddy/node_for_ptr + call $assembly/buddy/node_for_ptr local.set $5 local.get $5 i32.const 0 i32.ne if local.get $5 - call $~lib/allocator/buddy/flip_parent_is_split + call $assembly/buddy/flip_parent_is_split end block $break|1 loop $continue|1 @@ -631,28 +2094,26 @@ local.get $1 i32.lt_u if - block - local.get $5 - i32.const 2 - i32.mul - i32.const 1 - i32.add - local.set $5 - local.get $2 - i32.const 1 - i32.add - local.set $2 - local.get $5 - call $~lib/allocator/buddy/flip_parent_is_split - local.get $2 - call $~lib/allocator/buddy/buckets$get - local.get $5 - i32.const 1 - i32.add - local.get $2 - call $~lib/allocator/buddy/ptr_for_node - call $~lib/allocator/buddy/list_push - end + local.get $5 + i32.const 2 + i32.mul + i32.const 1 + i32.add + local.set $5 + local.get $2 + i32.const 1 + i32.add + local.set $2 + local.get $5 + call $assembly/buddy/flip_parent_is_split + local.get $2 + call $assembly/buddy/buckets$get + local.get $5 + i32.const 1 + i32.add + local.get $2 + call $assembly/buddy/ptr_for_node + call $assembly/buddy/list_push br $continue|1 end end @@ -661,7 +2122,7 @@ local.get $0 i32.store local.get $6 - global.get $~lib/allocator/buddy/HEADER_SIZE + global.get $assembly/buddy/HEADER_SIZE i32.add return end @@ -669,33 +2130,27 @@ end i32.const 0 ) - (func $~lib/memory/memory.allocate (; 20 ;) (type $ii) (param $0 i32) (result i32) - local.get $0 - call $~lib/allocator/buddy/__memory_allocate - return - ) - (func $~lib/allocator/buddy/__memory_free (; 21 ;) (type $i_) (param $0 i32) + (func $assembly/buddy/__mem_free (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) (local $2 i32) - (local $3 i32) local.get $0 i32.eqz if return end local.get $0 - global.get $~lib/allocator/buddy/HEADER_SIZE + global.get $assembly/buddy/HEADER_SIZE i32.sub local.set $0 local.get $0 i32.load - global.get $~lib/allocator/buddy/HEADER_SIZE + global.get $assembly/buddy/HEADER_SIZE i32.add - call $~lib/allocator/buddy/bucket_for_request + call $assembly/buddy/bucket_for_request local.set $1 local.get $0 local.get $1 - call $~lib/allocator/buddy/node_for_ptr + call $assembly/buddy/node_for_ptr local.set $2 block $break|0 loop $continue|0 @@ -703,65 +2158,54 @@ i32.const 0 i32.ne if - block - local.get $2 - call $~lib/allocator/buddy/flip_parent_is_split - local.get $2 - call $~lib/allocator/buddy/parent_is_split - local.tee $3 - if (result i32) - local.get $3 - else - local.get $1 - global.get $~lib/allocator/buddy/bucket_limit - i32.eq - end - if - br $break|0 - end - local.get $2 - i32.const 1 - i32.sub - i32.const 1 - i32.xor - i32.const 1 - i32.add - local.get $1 - call $~lib/allocator/buddy/ptr_for_node - call $~lib/allocator/buddy/list_remove - local.get $2 + local.get $2 + call $assembly/buddy/flip_parent_is_split + local.get $2 + call $assembly/buddy/parent_is_split + if (result i32) i32.const 1 - i32.sub - i32.const 2 - i32.div_u - local.set $2 + else local.get $1 - i32.const 1 - i32.sub - local.set $1 + global.get $assembly/buddy/bucket_limit + i32.eq + end + if + br $break|0 end + local.get $2 + i32.const 1 + i32.sub + i32.const 1 + i32.xor + i32.const 1 + i32.add + local.get $1 + call $assembly/buddy/ptr_for_node + call $assembly/buddy/list_remove + local.get $2 + i32.const 1 + i32.sub + i32.const 2 + i32.div_u + local.set $2 + local.get $1 + i32.const 1 + i32.sub + local.set $1 br $continue|0 end end end local.get $1 - call $~lib/allocator/buddy/buckets$get + call $assembly/buddy/buckets$get local.get $2 local.get $1 - call $~lib/allocator/buddy/ptr_for_node - call $~lib/allocator/buddy/list_push - ) - (func $~lib/memory/memory.free (; 22 ;) (type $i_) (param $0 i32) - local.get $0 - call $~lib/allocator/buddy/__memory_free - return - ) - (func $~lib/memory/memory.reset (; 23 ;) (type $_) - unreachable + call $assembly/buddy/ptr_for_node + call $assembly/buddy/list_push ) - (func $start (; 24 ;) (type $_) + (func $start (; 25 ;) (type $FUNCSIG$v) call $start:assembly/index ) - (func $null (; 25 ;) (type $_) + (func $null (; 26 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/allocators/index.js b/tests/allocators/index.js index f87bd13ed6..4f742b1605 100644 --- a/tests/allocators/index.js +++ b/tests/allocators/index.js @@ -14,10 +14,15 @@ function test(file) { } }).exports; + const RUNTIME_HEADER_SIZE = exports[".capabilities"] & 2 ? 16 : 8; + function getString(ptr) { - var len = new Uint32Array(exports.memory.buffer, ptr)[0]; - var str = new Uint16Array(exports.memory.buffer, ptr + 4).subarray(0, len); - return String.fromCharCode.apply(String, str); + if (!ptr) return "null"; + var U32 = new Uint32Array(exports.memory.buffer); + var U16 = new Uint16Array(exports.memory.buffer); + var len16 = U32[(ptr - RUNTIME_HEADER_SIZE + 4) >>> 2] >>> 1; + var ptr16 = ptr >>> 1; + return String.fromCharCode.apply(String, U16.subarray(ptr16, ptr16 + len16)); } require("./runner")(exports, 20, 20000); @@ -25,7 +30,7 @@ function test(file) { console.log("mem final: " + exports.memory.buffer.byteLength); console.log(); - const alloc = exports["memory.allocate"]; + const alloc = exports["__alloc"]; var overflow = false; try { alloc(COMMON_MAX + 1); // unreachable diff --git a/tests/allocators/package.json b/tests/allocators/package.json index 8ec334df5b..561e8362d0 100644 --- a/tests/allocators/package.json +++ b/tests/allocators/package.json @@ -3,6 +3,6 @@ "scripts": { "test": "node ./index", "test:forever": "node ./forever", - "test:all": "npm run test tlsf && npm run test buddy && npm run test arena" + "test:all": "npm run test rt-full && npm run test rt-stub && npm run test buddy" } } diff --git a/tests/allocators/rt-full/assembly/index.ts b/tests/allocators/rt-full/assembly/index.ts new file mode 100644 index 0000000000..c9701ae34b --- /dev/null +++ b/tests/allocators/rt-full/assembly/index.ts @@ -0,0 +1,2 @@ +export { memory } from "memory"; +export { __free }; diff --git a/tests/allocators/tlsf/assembly/tsconfig.json b/tests/allocators/rt-full/assembly/tsconfig.json similarity index 100% rename from tests/allocators/tlsf/assembly/tsconfig.json rename to tests/allocators/rt-full/assembly/tsconfig.json diff --git a/tests/allocators/rt-full/optimized.wat b/tests/allocators/rt-full/optimized.wat new file mode 100644 index 0000000000..0e383fb271 --- /dev/null +++ b/tests/allocators/rt-full/optimized.wat @@ -0,0 +1,1552 @@ +(module + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (memory $0 1) + (data (i32.const 8) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e") + (data (i32.const 64) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s") + (data (i32.const 112) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e") + (data (i32.const 168) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s") + (data (i32.const 208) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00N\00o\00t\00 \00i\00m\00p\00l\00e\00m\00e\00n\00t\00e\00d") + (data (i32.const 256) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00~\00l\00i\00b\00/\00m\00e\00m\00o\00r\00y\00.\00t\00s") + (data (i32.const 304) "\03\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10") + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) + (global $~lib/rt/__rtti_base i32 (i32.const 304)) + (export "memory" (memory $0)) + (export "__alloc" (func $~lib/rt/tlsf/__alloc)) + (export "__retain" (func $~lib/rt/pure/__retain)) + (export "__release" (func $~lib/rt/pure/__release)) + (export "__collect" (func $~lib/rt/pure/__collect)) + (export "__rtti_base" (global $~lib/rt/__rtti_base)) + (export "memory.copy" (func $~lib/memory/memory.copy)) + (export "memory.init" (func $~lib/memory/memory.init)) + (export "memory.drop" (func $~lib/memory/memory.drop)) + (export "memory.repeat" (func $~lib/memory/memory.repeat)) + (export "memory.compare" (func $~lib/memory/memory.compare)) + (export "__free" (func $~lib/rt/tlsf/__free)) + (func $~lib/rt/tlsf/removeBlock (; 1 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + i32.const -4 + i32.and + local.tee $2 + i32.const 256 + i32.lt_u + if (result i32) + local.get $2 + i32.const 4 + i32.shr_u + local.set $4 + i32.const 0 + else + local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $3 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $4 + local.get $3 + i32.const 7 + i32.sub + end + local.set $3 + local.get $1 + i32.load offset=20 + local.set $2 + local.get $1 + i32.load offset=16 + local.tee $5 + if + local.get $5 + local.get $2 + i32.store offset=20 + end + local.get $2 + if + local.get $2 + local.get $5 + i32.store offset=16 + end + local.get $3 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + local.get $1 + i32.eq + if + local.get $3 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $2 + i32.store offset=96 + local.get $2 + i32.eqz + if + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.store offset=4 + local.get $1 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $3 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 2 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + local.get $1 + i32.load + local.set $3 + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.tee $5 + i32.const 1 + i32.and + if + local.get $3 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const -4 + i32.and + i32.add + local.tee $2 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $3 + i32.const 3 + i32.and + local.get $2 + i32.or + local.tee $3 + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.set $5 + end + end + local.get $3 + i32.const 2 + i32.and + if + local.get $1 + i32.const 4 + i32.sub + i32.load + local.tee $2 + i32.load + local.tee $6 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $3 + i32.const -4 + i32.and + i32.add + local.tee $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $2 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $3 + i32.store + local.get $2 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $3 + i32.const -4 + i32.and + local.tee $2 + i32.const 256 + i32.lt_u + if (result i32) + local.get $2 + i32.const 4 + i32.shr_u + local.set $4 + i32.const 0 + else + local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $4 + local.get $2 + i32.const 7 + i32.sub + end + local.set $3 + local.get $3 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + local.set $2 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $2 + i32.store offset=20 + local.get $2 + if + local.get $2 + local.get $1 + i32.store offset=16 + end + local.get $3 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $1 + i32.store offset=96 + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $3 + i32.shl + i32.or + i32.store + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const 1 + local.get $4 + i32.shl + i32.or + i32.store offset=4 + ) + (func $~lib/rt/tlsf/addMemory (; 3 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + local.get $2 + block (result i32) + local.get $0 + i32.load offset=1568 + local.tee $2 + if + local.get $1 + i32.const 16 + i32.sub + local.get $2 + i32.eq + if + local.get $2 + i32.load + local.set $3 + local.get $1 + i32.const 16 + i32.sub + local.set $1 + end + end + local.get $1 + end + i32.sub + local.tee $2 + i32.const 48 + i32.lt_u + if + return + end + local.get $1 + local.get $3 + i32.const 2 + i32.and + local.get $2 + i32.const 32 + i32.sub + i32.const 1 + i32.or + i32.or + i32.store + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $2 + i32.add + i32.const 16 + i32.sub + local.tee $2 + i32.const 2 + i32.store + local.get $0 + local.get $2 + i32.store offset=1568 + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/tlsf/initializeRoot (; 4 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 1 + memory.size + local.tee $0 + i32.gt_s + if (result i32) + i32.const 1 + local.get $0 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + i32.const 336 + i32.const 0 + i32.store + i32.const 1904 + i32.const 0 + i32.store + i32.const 0 + local.set $0 + loop $repeat|0 + block $break|0 + local.get $0 + i32.const 23 + i32.ge_u + br_if $break|0 + local.get $0 + i32.const 2 + i32.shl + i32.const 336 + i32.add + i32.const 0 + i32.store offset=4 + i32.const 0 + local.set $1 + loop $repeat|1 + block $break|1 + local.get $1 + i32.const 16 + i32.ge_u + br_if $break|1 + local.get $0 + i32.const 4 + i32.shl + local.get $1 + i32.add + i32.const 2 + i32.shl + i32.const 336 + i32.add + i32.const 0 + i32.store offset=96 + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|1 + end + end + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + end + i32.const 336 + i32.const 1920 + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + i32.const 336 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 24 + i32.const 80 + i32.const 447 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const -16 + i32.and + local.tee $0 + i32.const 16 + local.get $0 + i32.const 16 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + i32.const 256 + i32.lt_u + if (result i32) + local.get $1 + i32.const 4 + i32.shr_u + local.set $1 + i32.const 0 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + local.get $1 + i32.add + i32.const 1 + i32.sub + local.set $1 + end + local.get $1 + i32.const 31 + local.get $1 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $1 + local.get $2 + i32.const 7 + i32.sub + end + local.tee $2 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const -1 + local.get $1 + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $1 + i32.ctz + local.get $2 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + else + local.get $0 + i32.load + i32.const -1 + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $0 + local.get $0 + local.get $1 + i32.ctz + local.tee $0 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + i32.ctz + local.get $0 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + else + i32.const 0 + end + end + ) + (func $~lib/rt/tlsf/growMemory (; 7 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + memory.size + local.tee $2 + local.get $1 + i32.const 65535 + i32.add + i32.const -65536 + i32.and + i32.const 16 + i32.shr_u + local.tee $1 + local.get $2 + local.get $1 + i32.gt_s + select + memory.grow + i32.const 0 + i32.lt_s + if + local.get $1 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + local.get $0 + local.get $2 + i32.const 16 + i32.shl + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + ) + (func $~lib/rt/tlsf/prepareBlock (; 8 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $1 + i32.load + local.tee $3 + i32.const -4 + i32.and + local.get $2 + i32.sub + local.tee $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $3 + i32.const 2 + i32.and + local.get $2 + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.tee $1 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const -2 + i32.and + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + i32.load + i32.const -3 + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.tee $3 + call $~lib/rt/tlsf/searchBlock + local.tee $2 + i32.eqz + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $3 + call $~lib/rt/tlsf/searchBlock + local.set $2 + end + local.get $2 + i32.const 0 + i32.store offset=4 + local.get $2 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $2 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $2 + ) + (func $~lib/rt/tlsf/__alloc (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + global.get $~lib/rt/tlsf/ROOT + local.tee $2 + if (result i32) + local.get $2 + else + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + end + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.tee $0 + local.get $1 + i32.store offset=8 + local.get $0 + i32.const 16 + i32.add + ) + (func $~lib/rt/pure/__retain (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + i32.const 332 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + local.tee $1 + local.get $1 + i32.load offset=4 + i32.const 1 + i32.add + i32.store offset=4 + end + local.get $0 + ) + (func $~lib/rt/tlsf/freeBlock (; 12 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + local.get $1 + local.get $1 + i32.load + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/__typeinfo (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 304 + i32.load + i32.gt_u + if + i32.const 128 + i32.const 184 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 3 + i32.shl + i32.const 308 + i32.add + i32.load + ) + (func $~lib/memory/memory.copy (; 14 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $2 + local.set $3 + local.get $0 + local.get $1 + i32.eq + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $1 + i32.lt_u + if + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|0 + local.get $0 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + br $continue|0 + end + end + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $1 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + br $continue|1 + end + end + end + loop $continue|2 + local.get $3 + if + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + else + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|3 + local.get $0 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $3 + i32.const 8 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + loop $continue|5 + local.get $3 + if + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + ) + (func $~lib/rt/tlsf/__free (; 15 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/growRoots (; 16 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/pure/CUR + global.get $~lib/rt/pure/ROOTS + local.tee $1 + i32.sub + local.tee $2 + i32.const 1 + i32.shl + local.tee $0 + i32.const 256 + local.get $0 + i32.const 256 + i32.gt_u + select + local.tee $3 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.tee $0 + local.get $1 + local.get $2 + call $~lib/memory/memory.copy + local.get $1 + if + local.get $1 + call $~lib/rt/tlsf/__free + end + local.get $0 + global.set $~lib/rt/pure/ROOTS + local.get $0 + local.get $2 + i32.add + global.set $~lib/rt/pure/CUR + local.get $0 + local.get $3 + i32.add + global.set $~lib/rt/pure/END + ) + (func $~lib/rt/pure/appendRoot (; 17 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/pure/CUR + local.tee $1 + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 4 + i32.add + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/decrement (; 18 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 268435455 + i32.and + local.tee $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/rt/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + if + local.get $0 + i32.const -2147483648 + i32.store offset=4 + else + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + else + local.get $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 16 + i32.and + if + local.get $0 + local.get $2 + i32.const 1 + i32.sub + local.get $1 + i32.const -268435456 + i32.and + i32.or + i32.store offset=4 + else + local.get $0 + local.get $2 + i32.const 1 + i32.sub + i32.const -1342177280 + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/appendRoot + end + end + end + ) + (func $~lib/rt/pure/__release (; 19 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + i32.const 332 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + end + ) + (func $~lib/rt/pure/markGray (; 20 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members + end + ) + (func $~lib/rt/pure/scanBlack (; 21 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 22 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + ) + (func $~lib/rt/pure/__collect (; 24 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/pure/ROOTS + local.tee $5 + local.tee $2 + local.set $3 + global.get $~lib/rt/pure/CUR + local.set $0 + loop $repeat|0 + block $break|0 + local.get $3 + local.get $0 + i32.ge_u + br_if $break|0 + local.get $3 + i32.load + local.tee $4 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 805306368 + i32.eq + if (result i32) + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + else + i32.const 0 + end + if + local.get $4 + call $~lib/rt/pure/markGray + local.get $2 + local.get $4 + i32.store + local.get $2 + i32.const 4 + i32.add + local.set $2 + else + i32.const 0 + local.get $1 + i32.const 268435455 + i32.and + i32.eqz + local.get $1 + i32.const 1879048192 + i32.and + select + if + global.get $~lib/rt/tlsf/ROOT + local.get $4 + call $~lib/rt/tlsf/freeBlock + else + local.get $4 + local.get $1 + i32.const 2147483647 + i32.and + i32.store offset=4 + end + end + local.get $3 + i32.const 4 + i32.add + local.set $3 + br $repeat|0 + end + end + local.get $2 + global.set $~lib/rt/pure/CUR + local.get $5 + local.set $0 + loop $repeat|1 + block $break|1 + local.get $0 + local.get $2 + i32.ge_u + br_if $break|1 + local.get $0 + i32.load + call $~lib/rt/pure/scan + local.get $0 + i32.const 4 + i32.add + local.set $0 + br $repeat|1 + end + end + local.get $5 + local.set $0 + loop $repeat|2 + block $break|2 + local.get $0 + local.get $2 + i32.ge_u + br_if $break|2 + local.get $0 + i32.load + local.tee $1 + local.get $1 + i32.load offset=4 + i32.const 2147483647 + i32.and + i32.store offset=4 + local.get $1 + call $~lib/rt/pure/collectWhite + local.get $0 + i32.const 4 + i32.add + local.set $0 + br $repeat|2 + end + end + local.get $5 + global.set $~lib/rt/pure/CUR + ) + (func $~lib/memory/memory.init (; 25 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + i32.const 224 + i32.const 272 + i32.const 35 + i32.const 4 + call $~lib/builtins/abort + unreachable + ) + (func $~lib/memory/memory.drop (; 26 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 224 + i32.const 272 + i32.const 42 + i32.const 4 + call $~lib/builtins/abort + unreachable + ) + (func $~lib/memory/memory.repeat (; 27 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (local $4 i32) + local.get $2 + local.get $3 + i32.mul + local.set $3 + loop $continue|0 + local.get $4 + local.get $3 + i32.lt_u + if + local.get $0 + local.get $4 + i32.add + local.get $1 + local.get $2 + call $~lib/memory/memory.copy + local.get $2 + local.get $4 + i32.add + local.set $4 + br $continue|0 + end + end + ) + (func $~lib/memory/memory.compare (; 28 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $0 + local.get $1 + i32.eq + if (result i32) + i32.const 0 + else + loop $continue|0 + local.get $2 + if (result i32) + local.get $0 + i32.load8_u + local.get $1 + i32.load8_u + i32.eq + else + i32.const 0 + end + if + local.get $2 + i32.const 1 + i32.sub + local.set $2 + local.get $0 + i32.const 1 + i32.add + local.set $0 + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $continue|0 + end + end + local.get $2 + if (result i32) + local.get $0 + i32.load8_u + local.get $1 + i32.load8_u + i32.sub + else + i32.const 0 + end + end + ) + (func $~lib/rt/pure/__visit (; 29 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + local.get $0 + i32.const 332 + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $0 + block $break|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + local.get $1 + i32.const 1 + i32.ne + if + local.get $1 + i32.const 2 + i32.eq + br_if $case1|0 + block $tablify|0 + local.get $1 + i32.const 3 + i32.sub + br_table $case2|0 $case3|0 $case4|0 $tablify|0 + end + br $break|0 + end + local.get $0 + call $~lib/rt/pure/decrement + br $break|0 + end + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $0 + call $~lib/rt/pure/markGray + br $break|0 + end + local.get $0 + call $~lib/rt/pure/scan + br $break|0 + end + local.get $0 + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $1 + i32.const 1879048192 + i32.and + if + local.get $0 + call $~lib/rt/pure/scanBlack + end + br $break|0 + end + local.get $0 + call $~lib/rt/pure/collectWhite + end + ) + (func $~lib/rt/__visit_members (; 30 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + block $switch$1$default + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$default + end + return + end + local.get $0 + i32.load + local.tee $0 + if + local.get $0 + local.get $1 + call $~lib/rt/pure/__visit + end + return + end + unreachable + ) + (func $null (; 31 ;) (type $FUNCSIG$v) + nop + ) +) diff --git a/tests/allocators/tlsf/package.json b/tests/allocators/rt-full/package.json similarity index 55% rename from tests/allocators/tlsf/package.json rename to tests/allocators/rt-full/package.json index 68fede664c..65e77bbb6e 100644 --- a/tests/allocators/tlsf/package.json +++ b/tests/allocators/rt-full/package.json @@ -2,7 +2,7 @@ "private": true, "scripts": { "build": "npm run build:untouched && npm run build:optimized", - "build:untouched": "node ../../../bin/asc assembly/index.ts -t untouched.wat -b untouched.wasm --validate --sourceMap --measure", - "build:optimized": "node ../../../bin/asc assembly/index.ts -t optimized.wat -b optimized.wasm --validate --sourceMap --measure --noAssert --optimize" + "build:untouched": "node ../../../bin/asc assembly/index.ts -t untouched.wat -b untouched.wasm --runtime full --validate --sourceMap --measure", + "build:optimized": "node ../../../bin/asc assembly/index.ts -t optimized.wat -b optimized.wasm --runtime full --validate --sourceMap --measure --noAssert --optimize" } } diff --git a/tests/allocators/rt-full/untouched.wat b/tests/allocators/rt-full/untouched.wat new file mode 100644 index 0000000000..addfbf47c6 --- /dev/null +++ b/tests/allocators/rt-full/untouched.wat @@ -0,0 +1,3722 @@ +(module + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (memory $0 1) + (data (i32.const 8) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 56) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 112) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s\00") + (data (i32.const 160) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 216) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s\00") + (data (i32.const 256) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00N\00o\00t\00 \00i\00m\00p\00l\00e\00m\00e\00n\00t\00e\00d\00") + (data (i32.const 304) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00~\00l\00i\00b\00/\00m\00e\00m\00o\00r\00y\00.\00t\00s\00") + (data (i32.const 352) "\03\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) + (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/rt/__rtti_base i32 (i32.const 352)) + (global $~lib/heap/__heap_base i32 (i32.const 380)) + (export "memory" (memory $0)) + (export "__alloc" (func $~lib/rt/tlsf/__alloc)) + (export "__retain" (func $~lib/rt/pure/__retain)) + (export "__release" (func $~lib/rt/pure/__release)) + (export "__collect" (func $~lib/rt/pure/__collect)) + (export "__rtti_base" (global $~lib/rt/__rtti_base)) + (export "memory.copy" (func $~lib/memory/memory.copy)) + (export "memory.init" (func $~lib/memory/memory.init)) + (export "memory.drop" (func $~lib/memory/memory.drop)) + (export "memory.repeat" (func $~lib/memory/memory.repeat)) + (export "memory.compare" (func $~lib/memory/memory.compare)) + (export "__free" (func $~lib/rt/tlsf/__free)) + (func $~lib/rt/tlsf/removeBlock (; 1 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 276 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $3 + local.get $3 + i32.const 16 + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 278 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 + local.get $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) + local.get $5 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 291 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end + local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $9 + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $8 + local.get $4 + local.set $11 + local.get $9 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $9 + local.set $10 + local.get $8 + local.get $11 + i32.const 2 + i32.shl + i32.add + local.get $10 + i32.store offset=4 + end + local.get $9 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 2 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 204 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 206 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 + i32.const 1 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end + local.get $2 + i32.const 2 + i32.and + if + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 4 + i32.sub + i32.load + end + local.set $6 + local.get $6 + i32.load + local.set $3 + local.get $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 227 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $6 + call $~lib/rt/tlsf/removeBlock + local.get $6 + local.get $3 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $6 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $8 + i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 243 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $8 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 259 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $7 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $7 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $0 + local.set $12 + local.get $9 + local.set $7 + local.get $10 + local.set $3 + local.get $1 + local.set $6 + local.get $12 + local.get $7 + i32.const 4 + i32.shl + local.get $3 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + end + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $0 + local.set $13 + local.get $9 + local.set $12 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + end + ) + (func $~lib/rt/tlsf/addMemory (; 3 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + local.get $2 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 385 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 395 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 407 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 4 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + memory.size + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end + block $break|0 + i32.const 0 + local.set $5 + loop $repeat|0 + local.get $5 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $3 + local.set $7 + local.get $5 + local.set $6 + i32.const 0 + local.set $4 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $7 + loop $repeat|1 + local.get $7 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $3 + local.set $9 + local.get $5 + local.set $8 + local.get $7 + local.set $6 + i32.const 0 + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store offset=96 + end + local.get $7 + i32.const 1 + i32.add + local.set $7 + br $repeat|1 + unreachable + end + unreachable + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 72 + i32.const 24 + i32.const 447 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 337 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + i32.const 0 + local.set $7 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $5 + local.get $5 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $5 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $4 + local.get $8 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 350 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 7 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + memory.size + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + memory.grow + i32.const 0 + i32.lt_s + if + local.get $3 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + memory.size + local.set $7 + local.get $0 + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (; 8 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 364 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 477 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 479 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/rt/pure/increment (; 11 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 107 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/pure/__retain (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment + end + local.get $0 + ) + (func $~lib/rt/tlsf/freeBlock (; 13 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 531 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/__typeinfo (; 14 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/rt/__rtti_base + local.set $1 + local.get $0 + local.get $1 + i32.load + i32.gt_u + if + i32.const 176 + i32.const 232 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 4 + i32.add + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/util/memory/memcpy (; 15 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + block $break|0 + loop $continue|0 + local.get $2 + if (result i32) + local.get $1 + i32.const 3 + i32.and + else + i32.const 0 + end + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $continue|0 + end + end + end + local.get $0 + i32.const 3 + i32.and + i32.const 0 + i32.eq + if + block $break|1 + loop $continue|1 + local.get $2 + i32.const 16 + i32.ge_u + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 8 + i32.add + i32.load + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 12 + i32.add + i32.load + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|1 + end + end + end + local.get $2 + i32.const 8 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + end + local.get $2 + i32.const 4 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.set $0 + local.get $1 + i32.const 4 + i32.add + local.set $1 + end + local.get $2 + i32.const 2 + i32.and + if + local.get $0 + local.get $1 + i32.load16_u + i32.store16 + local.get $0 + i32.const 2 + i32.add + local.set $0 + local.get $1 + i32.const 2 + i32.add + local.set $1 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + return + end + local.get $2 + i32.const 32 + i32.ge_u + if + block $break|2 + block $case2|2 + block $case1|2 + block $case0|2 + local.get $0 + i32.const 3 + i32.and + local.set $5 + local.get $5 + i32.const 1 + i32.eq + br_if $case0|2 + local.get $5 + i32.const 2 + i32.eq + br_if $case1|2 + local.get $5 + i32.const 3 + i32.eq + br_if $case2|2 + br $break|2 + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 3 + i32.sub + local.set $2 + block $break|3 + loop $continue|3 + local.get $2 + i32.const 17 + i32.ge_u + if + local.get $1 + i32.const 1 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 5 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 9 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 13 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|3 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + block $break|4 + loop $continue|4 + local.get $2 + i32.const 18 + i32.ge_u + if + local.get $1 + i32.const 2 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 6 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 10 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 14 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|4 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + block $break|5 + loop $continue|5 + local.get $2 + i32.const 19 + i32.ge_u + if + local.get $1 + i32.const 3 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 7 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 11 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 15 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|5 + end + end + end + br $break|2 + unreachable + end + unreachable + end + end + local.get $2 + i32.const 16 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 8 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 4 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 2 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + ) + (func $~lib/memory/memory.copy (; 16 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $4 + local.get $3 + i32.add + local.get $5 + i32.le_u + if (result i32) + i32.const 1 + else + local.get $5 + local.get $3 + i32.add + local.get $4 + i32.le_u + end + if + local.get $5 + local.get $4 + local.get $3 + call $~lib/util/memory/memcpy + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/rt/tlsf/__free (; 17 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 561 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 562 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/growRoots (; 18 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/pure/ROOTS + local.set $0 + global.get $~lib/rt/pure/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $0 + if + local.get $0 + call $~lib/rt/tlsf/__free + end + local.get $5 + global.set $~lib/rt/pure/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/pure/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/pure/END + ) + (func $~lib/rt/pure/appendRoot (; 19 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/pure/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 4 + i32.add + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/decrement (; 20 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 115 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/rt/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 124 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 16 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/pure/__release (; 21 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + end + ) + (func $~lib/rt/pure/markGray (; 22 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members + end + ) + (func $~lib/rt/pure/scanBlack (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + ) + (func $~lib/rt/pure/__collect (; 26 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/pure/ROOTS + local.set $0 + local.get $0 + local.set $1 + block $break|0 + block + local.get $1 + local.set $2 + global.get $~lib/rt/pure/CUR + local.set $3 + end + loop $repeat|0 + local.get $2 + local.get $3 + i32.lt_u + i32.eqz + br_if $break|0 + local.get $2 + i32.load + local.set $4 + local.get $4 + i32.load offset=4 + local.set $5 + local.get $5 + i32.const 1879048192 + i32.and + i32.const 805306368 + i32.eq + if (result i32) + local.get $5 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + else + i32.const 0 + end + if + local.get $4 + call $~lib/rt/pure/markGray + local.get $1 + local.get $4 + i32.store + local.get $1 + i32.const 4 + i32.add + local.set $1 + else + local.get $5 + i32.const 1879048192 + i32.and + i32.const 0 + i32.eq + if (result i32) + local.get $5 + i32.const 268435455 + i32.and + i32.eqz + else + i32.const 0 + end + if + global.get $~lib/rt/tlsf/ROOT + local.get $4 + call $~lib/rt/tlsf/freeBlock + else + local.get $4 + local.get $5 + i32.const -2147483648 + i32.const -1 + i32.xor + i32.and + i32.store offset=4 + end + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + global.set $~lib/rt/pure/CUR + block $break|1 + local.get $0 + local.set $5 + loop $repeat|1 + local.get $5 + local.get $1 + i32.lt_u + i32.eqz + br_if $break|1 + local.get $5 + i32.load + call $~lib/rt/pure/scan + local.get $5 + i32.const 4 + i32.add + local.set $5 + br $repeat|1 + unreachable + end + unreachable + end + block $break|2 + local.get $0 + local.set $5 + loop $repeat|2 + local.get $5 + local.get $1 + i32.lt_u + i32.eqz + br_if $break|2 + local.get $5 + i32.load + local.set $4 + local.get $4 + local.get $4 + i32.load offset=4 + i32.const -2147483648 + i32.const -1 + i32.xor + i32.and + i32.store offset=4 + local.get $4 + call $~lib/rt/pure/collectWhite + local.get $5 + i32.const 4 + i32.add + local.set $5 + br $repeat|2 + unreachable + end + unreachable + end + local.get $0 + global.set $~lib/rt/pure/CUR + ) + (func $~lib/memory/memory.init (; 27 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + i32.const 272 + i32.const 320 + i32.const 35 + i32.const 4 + call $~lib/builtins/abort + unreachable + ) + (func $~lib/memory/memory.drop (; 28 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 272 + i32.const 320 + i32.const 42 + i32.const 4 + call $~lib/builtins/abort + unreachable + ) + (func $~lib/memory/memory.repeat (; 29 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (local $4 i32) + (local $5 i32) + i32.const 0 + local.set $4 + local.get $2 + local.get $3 + i32.mul + local.set $5 + block $break|0 + loop $continue|0 + local.get $4 + local.get $5 + i32.lt_u + if + local.get $0 + local.get $4 + i32.add + local.get $1 + local.get $2 + call $~lib/memory/memory.copy + local.get $4 + local.get $2 + i32.add + local.set $4 + br $continue|0 + end + end + end + ) + (func $~lib/memory/memory.compare (; 30 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + block $~lib/util/memory/memcmp|inlined.0 (result i32) + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + i32.const 0 + br $~lib/util/memory/memcmp|inlined.0 + end + block $break|0 + loop $continue|0 + local.get $3 + i32.const 0 + i32.ne + if (result i32) + local.get $5 + i32.load8_u + local.get $4 + i32.load8_u + i32.eq + else + i32.const 0 + end + if + local.get $3 + i32.const 1 + i32.sub + local.set $3 + local.get $5 + i32.const 1 + i32.add + local.set $5 + local.get $4 + i32.const 1 + i32.add + local.set $4 + br $continue|0 + end + end + end + local.get $3 + if (result i32) + local.get $5 + i32.load8_u + local.get $4 + i32.load8_u + i32.sub + else + i32.const 0 + end + end + ) + (func $~lib/rt/pure/__visit (; 31 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/pure/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 75 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/pure/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 86 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/pure/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 97 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + end + ) + (func $~lib/rt/__visit_members (; 32 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block + end + block $switch$1$leave + block $switch$1$default + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$default + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + ) + (func $null (; 33 ;) (type $FUNCSIG$v) + ) +) diff --git a/tests/allocators/rt-stub/assembly/index.ts b/tests/allocators/rt-stub/assembly/index.ts new file mode 100644 index 0000000000..714330ba88 --- /dev/null +++ b/tests/allocators/rt-stub/assembly/index.ts @@ -0,0 +1,2 @@ +export { memory } from "memory"; +export { __free, __reset }; diff --git a/tests/allocators/arena/assembly/package.json b/tests/allocators/rt-stub/assembly/tsconfig.json similarity index 100% rename from tests/allocators/arena/assembly/package.json rename to tests/allocators/rt-stub/assembly/tsconfig.json diff --git a/tests/allocators/rt-stub/optimized.wat b/tests/allocators/rt-stub/optimized.wat new file mode 100644 index 0000000000..4efc9e128f --- /dev/null +++ b/tests/allocators/rt-stub/optimized.wat @@ -0,0 +1,384 @@ +(module + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (memory $0 1) + (data (i32.const 8) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00N\00o\00t\00 \00i\00m\00p\00l\00e\00m\00e\00n\00t\00e\00d") + (data (i32.const 56) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00~\00l\00i\00b\00/\00m\00e\00m\00o\00r\00y\00.\00t\00s") + (data (i32.const 104) "\03\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10") + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) + (global $~lib/rt/__rtti_base i32 (i32.const 104)) + (export "memory" (memory $0)) + (export "__alloc" (func $~lib/rt/stub/__alloc)) + (export "__retain" (func $~lib/rt/stub/__retain)) + (export "__release" (func $~lib/rt/stub/__release)) + (export "__collect" (func $~lib/rt/stub/__collect)) + (export "__rtti_base" (global $~lib/rt/__rtti_base)) + (export "memory.copy" (func $~lib/memory/memory.copy)) + (export "memory.init" (func $~lib/memory/memory.init)) + (export "memory.drop" (func $~lib/memory/memory.drop)) + (export "memory.repeat" (func $~lib/memory/memory.repeat)) + (export "memory.compare" (func $~lib/memory/memory.compare)) + (export "__free" (func $~lib/rt/stub/__release)) + (export "__reset" (func $~lib/rt/stub/__reset)) + (start $start) + (func $~lib/rt/stub/__alloc (; 1 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + i32.const 1073741808 + i32.gt_u + if + unreachable + end + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.tee $3 + local.get $0 + i32.const 1 + local.get $0 + i32.const 1 + i32.gt_u + select + i32.add + i32.const 15 + i32.add + i32.const -16 + i32.and + local.tee $2 + memory.size + local.tee $4 + i32.const 16 + i32.shl + i32.gt_u + if + local.get $4 + local.get $2 + local.get $3 + i32.sub + i32.const 65535 + i32.add + i32.const -65536 + i32.and + i32.const 16 + i32.shr_u + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + memory.grow + i32.const 0 + i32.lt_s + if + local.get $5 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + end + local.get $2 + global.set $~lib/rt/stub/offset + local.get $3 + i32.const 16 + i32.sub + local.tee $2 + local.get $1 + i32.store offset=8 + local.get $2 + local.get $0 + i32.store offset=12 + local.get $3 + ) + (func $~lib/rt/stub/__retain (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + ) + (func $~lib/rt/stub/__release (; 3 ;) (type $FUNCSIG$vi) (param $0 i32) + nop + ) + (func $~lib/rt/stub/__collect (; 4 ;) (type $FUNCSIG$v) + nop + ) + (func $~lib/memory/memory.init (; 5 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + i32.const 24 + i32.const 72 + i32.const 35 + i32.const 4 + call $~lib/builtins/abort + unreachable + ) + (func $~lib/memory/memory.drop (; 6 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 24 + i32.const 72 + i32.const 42 + i32.const 4 + call $~lib/builtins/abort + unreachable + ) + (func $~lib/memory/memory.copy (; 7 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $2 + local.set $3 + local.get $0 + local.get $1 + i32.eq + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $1 + i32.lt_u + if + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|0 + local.get $0 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + br $continue|0 + end + end + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $1 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + br $continue|1 + end + end + end + loop $continue|2 + local.get $3 + if + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + else + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|3 + local.get $0 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $3 + i32.const 8 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + loop $continue|5 + local.get $3 + if + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + ) + (func $~lib/memory/memory.repeat (; 8 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (local $4 i32) + local.get $2 + local.get $3 + i32.mul + local.set $3 + loop $continue|0 + local.get $4 + local.get $3 + i32.lt_u + if + local.get $0 + local.get $4 + i32.add + local.get $1 + local.get $2 + call $~lib/memory/memory.copy + local.get $2 + local.get $4 + i32.add + local.set $4 + br $continue|0 + end + end + ) + (func $~lib/memory/memory.compare (; 9 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $0 + local.get $1 + i32.eq + if (result i32) + i32.const 0 + else + loop $continue|0 + local.get $2 + if (result i32) + local.get $0 + i32.load8_u + local.get $1 + i32.load8_u + i32.eq + else + i32.const 0 + end + if + local.get $2 + i32.const 1 + i32.sub + local.set $2 + local.get $0 + i32.const 1 + i32.add + local.set $0 + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $continue|0 + end + end + local.get $2 + if (result i32) + local.get $0 + i32.load8_u + local.get $1 + i32.load8_u + i32.sub + else + i32.const 0 + end + end + ) + (func $~lib/rt/stub/__reset (; 10 ;) (type $FUNCSIG$v) + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset + ) + (func $start (; 11 ;) (type $FUNCSIG$v) + i32.const 144 + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset + ) +) diff --git a/tests/allocators/arena/package.json b/tests/allocators/rt-stub/package.json similarity index 55% rename from tests/allocators/arena/package.json rename to tests/allocators/rt-stub/package.json index 68fede664c..fb943b7d46 100644 --- a/tests/allocators/arena/package.json +++ b/tests/allocators/rt-stub/package.json @@ -2,7 +2,7 @@ "private": true, "scripts": { "build": "npm run build:untouched && npm run build:optimized", - "build:untouched": "node ../../../bin/asc assembly/index.ts -t untouched.wat -b untouched.wasm --validate --sourceMap --measure", - "build:optimized": "node ../../../bin/asc assembly/index.ts -t optimized.wat -b optimized.wasm --validate --sourceMap --measure --noAssert --optimize" + "build:untouched": "node ../../../bin/asc assembly/index.ts -t untouched.wat -b untouched.wasm --runtime stub --validate --sourceMap --measure", + "build:optimized": "node ../../../bin/asc assembly/index.ts -t optimized.wat -b optimized.wasm --runtime stub --validate --sourceMap --measure --noAssert --optimize" } } diff --git a/tests/compiler/std/allocator_arena.untouched.wat b/tests/allocators/rt-stub/untouched.wat similarity index 59% rename from tests/compiler/std/allocator_arena.untouched.wat rename to tests/allocators/rt-stub/untouched.wat index 7b16588c60..97f25aaef7 100644 --- a/tests/compiler/std/allocator_arena.untouched.wat +++ b/tests/allocators/rt-stub/untouched.wat @@ -1,79 +1,82 @@ (module - (type $FUNCSIG$v (func)) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$v (func)) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$viii (func (param i32 i32 i32))) (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) - (type $FUNCSIG$vi (func (param i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\16\00\00\00s\00t\00d\00/\00a\00l\00l\00o\00c\00a\00t\00o\00r\00_\00a\00r\00e\00n\00a\00.\00t\00s\00") + (data (i32.const 8) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00N\00o\00t\00 \00i\00m\00p\00l\00e\00m\00e\00n\00t\00e\00d\00") + (data (i32.const 56) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00~\00l\00i\00b\00/\00m\00e\00m\00o\00r\00y\00.\00t\00s\00") + (data (i32.const 104) "\03\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00") (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) - (global $std/allocator_arena/size i32 (i32.const 42)) - (global $std/allocator_arena/ptr1 (mut i32) (i32.const 0)) - (global $std/allocator_arena/ptr2 (mut i32) (i32.const 0)) - (global $std/allocator_arena/i (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 56)) + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) + (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/rt/__rtti_base i32 (i32.const 104)) + (global $~lib/heap/__heap_base i32 (i32.const 132)) (export "memory" (memory $0)) - (export "table" (table $0)) + (export "__alloc" (func $~lib/rt/stub/__alloc)) + (export "__retain" (func $~lib/rt/stub/__retain)) + (export "__release" (func $~lib/rt/stub/__release)) + (export "__collect" (func $~lib/rt/stub/__collect)) + (export "__rtti_base" (global $~lib/rt/__rtti_base)) + (export "memory.copy" (func $~lib/memory/memory.copy)) + (export "memory.init" (func $~lib/memory/memory.init)) + (export "memory.drop" (func $~lib/memory/memory.drop)) + (export "memory.repeat" (func $~lib/memory/memory.repeat)) + (export "memory.compare" (func $~lib/memory/memory.compare)) + (export "__free" (func $~lib/rt/stub/__free)) + (export "__reset" (func $~lib/rt/stub/__reset)) (start $start) - (func $start:~lib/allocator/arena (; 1 ;) (type $FUNCSIG$v) - global.get $~lib/memory/HEAP_BASE - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - ) - (func $~lib/allocator/arena/__memory_allocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/rt/stub/__alloc (; 1 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) + (local $8 i32) local.get $0 - i32.const 1073741824 + i32.const 1073741808 i32.gt_u if unreachable end - global.get $~lib/allocator/arena/offset - local.set $1 - local.get $1 + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.set $2 + local.get $2 local.get $0 - local.tee $2 - i32.const 1 local.tee $3 - local.get $2 + i32.const 1 + local.tee $4 local.get $3 + local.get $4 i32.gt_u select i32.add - i32.const 7 + i32.const 15 i32.add - i32.const 7 + i32.const 15 i32.const -1 i32.xor i32.and - local.set $4 - current_memory local.set $5 - local.get $4 + memory.size + local.set $6 local.get $5 + local.get $6 i32.const 16 i32.shl i32.gt_u if - local.get $4 - local.get $1 + local.get $5 + local.get $2 i32.sub i32.const 65535 i32.add @@ -83,23 +86,23 @@ i32.and i32.const 16 i32.shr_u - local.set $2 - local.get $5 - local.tee $3 - local.get $2 - local.tee $6 - local.get $3 + local.set $3 local.get $6 + local.tee $4 + local.get $3 + local.tee $7 + local.get $4 + local.get $7 i32.gt_s select - local.set $3 - local.get $3 - grow_memory + local.set $4 + local.get $4 + memory.grow i32.const 0 i32.lt_s if - local.get $2 - grow_memory + local.get $3 + memory.grow i32.const 0 i32.lt_s if @@ -107,265 +110,46 @@ end end end - local.get $4 - global.set $~lib/allocator/arena/offset - local.get $1 - ) - (func $~lib/internal/memory/memset (; 3 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i64) - local.get $2 - i32.eqz - if - return - end - local.get $0 - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 1 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 2 - i32.le_u - if - return - end - local.get $0 - i32.const 1 - i32.add - local.get $1 - i32.store8 - local.get $0 - i32.const 2 - i32.add - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 2 - i32.sub - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 3 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 6 - i32.le_u - if - return - end - local.get $0 - i32.const 3 - i32.add - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 4 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 8 - i32.le_u - if - return - end - i32.const 0 - local.get $0 - i32.sub - i32.const 3 - i32.and - local.set $3 - local.get $0 - local.get $3 - i32.add - local.set $0 + local.get $5 + global.set $~lib/rt/stub/offset local.get $2 - local.get $3 + i32.const 16 i32.sub - local.set $2 - local.get $2 - i32.const -4 - i32.and - local.set $2 - i32.const -1 - i32.const 255 - i32.div_u + local.set $8 + local.get $8 local.get $1 - i32.const 255 - i32.and - i32.mul - local.set $4 - local.get $0 - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 4 - i32.sub - local.get $4 - i32.store - local.get $2 - i32.const 8 - i32.le_u - if - return - end - local.get $0 - i32.const 4 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 12 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 8 - i32.sub - local.get $4 - i32.store - local.get $2 - i32.const 24 - i32.le_u - if - return - end - local.get $0 - i32.const 12 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 16 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 20 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 24 - i32.add - local.get $4 - i32.store + i32.store offset=8 + local.get $8 local.get $0 + i32.store offset=12 local.get $2 - i32.add - i32.const 28 - i32.sub - local.get $4 - i32.store + ) + (func $~lib/rt/stub/__retain (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - local.get $2 - i32.add + ) + (func $~lib/rt/stub/__release (; 3 ;) (type $FUNCSIG$vi) (param $0 i32) + nop + ) + (func $~lib/rt/stub/__collect (; 4 ;) (type $FUNCSIG$v) + nop + ) + (func $~lib/memory/memory.init (; 5 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) i32.const 24 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 20 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 16 - i32.sub - local.get $4 - i32.store + i32.const 72 + i32.const 35 + i32.const 4 + call $~lib/builtins/abort + unreachable + ) + (func $~lib/memory/memory.drop (; 6 ;) (type $FUNCSIG$vi) (param $0 i32) i32.const 24 - local.get $0 + i32.const 72 + i32.const 42 i32.const 4 - i32.and - i32.add - local.set $3 - local.get $0 - local.get $3 - i32.add - local.set $0 - local.get $2 - local.get $3 - i32.sub - local.set $2 - local.get $4 - i64.extend_i32_u - local.get $4 - i64.extend_i32_u - i64.const 32 - i64.shl - i64.or - local.set $5 - block $break|0 - loop $continue|0 - local.get $2 - i32.const 32 - i32.ge_u - if - block - local.get $0 - local.get $5 - i64.store - local.get $0 - i32.const 8 - i32.add - local.get $5 - i64.store - local.get $0 - i32.const 16 - i32.add - local.get $5 - i64.store - local.get $0 - i32.const 24 - i32.add - local.get $5 - i64.store - local.get $2 - i32.const 32 - i32.sub - local.set $2 - local.get $0 - i32.const 32 - i32.add - local.set $0 - end - br $continue|0 - end - end - end + call $~lib/builtins/abort + unreachable ) - (func $~lib/internal/memory/memcpy (; 4 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/memory/memcpy (; 7 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -377,33 +161,31 @@ i32.const 3 i32.and else - local.get $2 + i32.const 0 end if - block - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 br $continue|0 end end @@ -420,48 +202,46 @@ i32.const 16 i32.ge_u if - block - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $1 - i32.const 4 - i32.add - i32.load - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $1 - i32.const 8 - i32.add - i32.load - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 12 - i32.add - i32.load - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - end + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 8 + i32.add + i32.load + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 12 + i32.add + i32.load + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 br $continue|1 end end @@ -644,158 +424,22 @@ i32.const 17 i32.ge_u if - block - local.get $1 - i32.const 1 - i32.add - i32.load - local.set $4 - local.get $0 - local.get $3 - i32.const 24 - i32.shr_u - local.get $4 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 5 - i32.add - i32.load - local.set $3 - local.get $0 - i32.const 4 - i32.add - local.get $4 - i32.const 24 - i32.shr_u - local.get $3 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 9 - i32.add - i32.load - local.set $4 - local.get $0 - i32.const 8 - i32.add - local.get $3 - i32.const 24 - i32.shr_u - local.get $4 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 13 - i32.add - i32.load - local.set $3 - local.get $0 - i32.const 12 - i32.add - local.get $4 - i32.const 24 - i32.shr_u - local.get $3 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - end - br $continue|3 - end - end - end - br $break|2 - unreachable - end - unreachable - end - block - local.get $1 - i32.load - local.set $3 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - local.get $2 - i32.const 2 - i32.sub - local.set $2 - block $break|4 - loop $continue|4 - local.get $2 - i32.const 18 - i32.ge_u - if - block local.get $1 - i32.const 2 + i32.const 1 i32.add i32.load local.set $4 local.get $0 local.get $3 - i32.const 16 + i32.const 24 i32.shr_u local.get $4 - i32.const 16 + i32.const 8 i32.shl i32.or i32.store local.get $1 - i32.const 6 + i32.const 5 i32.add i32.load local.set $3 @@ -803,15 +447,15 @@ i32.const 4 i32.add local.get $4 - i32.const 16 + i32.const 24 i32.shr_u local.get $3 - i32.const 16 + i32.const 8 i32.shl i32.or i32.store local.get $1 - i32.const 10 + i32.const 9 i32.add i32.load local.set $4 @@ -819,15 +463,15 @@ i32.const 8 i32.add local.get $3 - i32.const 16 + i32.const 24 i32.shr_u local.get $4 - i32.const 16 + i32.const 8 i32.shl i32.or i32.store local.get $1 - i32.const 14 + i32.const 13 i32.add i32.load local.set $3 @@ -835,10 +479,10 @@ i32.const 12 i32.add local.get $4 - i32.const 16 + i32.const 24 i32.shr_u local.get $3 - i32.const 16 + i32.const 8 i32.shl i32.or i32.store @@ -854,65 +498,81 @@ i32.const 16 i32.sub local.set $2 + br $continue|3 end - br $continue|4 end end + br $break|2 + unreachable end - br $break|2 unreachable end - unreachable - end - block - local.get $1 - i32.load - local.set $3 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) + block local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - block $break|5 - loop $continue|5 - local.get $2 - i32.const 19 - i32.ge_u - if - block + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + block $break|4 + loop $continue|4 + local.get $2 + i32.const 18 + i32.ge_u + if local.get $1 - i32.const 3 + i32.const 2 i32.add i32.load local.set $4 local.get $0 local.get $3 - i32.const 8 + i32.const 16 i32.shr_u local.get $4 - i32.const 24 + i32.const 16 i32.shl i32.or i32.store local.get $1 - i32.const 7 + i32.const 6 i32.add i32.load local.set $3 @@ -920,15 +580,15 @@ i32.const 4 i32.add local.get $4 - i32.const 8 + i32.const 16 i32.shr_u local.get $3 - i32.const 24 + i32.const 16 i32.shl i32.or i32.store local.get $1 - i32.const 11 + i32.const 10 i32.add i32.load local.set $4 @@ -936,15 +596,15 @@ i32.const 8 i32.add local.get $3 - i32.const 8 + i32.const 16 i32.shr_u local.get $4 - i32.const 24 + i32.const 16 i32.shl i32.or i32.store local.get $1 - i32.const 15 + i32.const 14 i32.add i32.load local.set $3 @@ -952,10 +612,10 @@ i32.const 12 i32.add local.get $4 - i32.const 8 + i32.const 16 i32.shr_u local.get $3 - i32.const 24 + i32.const 16 i32.shl i32.or i32.store @@ -971,7 +631,121 @@ i32.const 16 i32.sub local.set $2 + br $continue|4 end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + block $break|5 + loop $continue|5 + local.get $2 + i32.const 19 + i32.ge_u + if + local.get $1 + i32.const 3 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 7 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 11 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 15 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 br $continue|5 end end @@ -1566,488 +1340,343 @@ i32.store8 end ) - (func $~lib/internal/memory/memmove (; 5 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/memory/memory.copy (; 8 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - local.get $0 - local.get $1 - i32.eq - if - return - end - local.get $1 - local.get $2 - i32.add - local.get $0 - i32.le_u - local.tee $3 - if (result i32) - local.get $3 - else - local.get $0 - local.get $2 - i32.add - local.get $1 - i32.le_u - end - if + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 local.get $0 + local.set $5 local.get $1 + local.set $4 local.get $2 - call $~lib/internal/memory/memcpy - return - end - local.get $0 - local.get $1 - i32.lt_u - if - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and + local.set $3 + local.get $5 + local.get $4 i32.eq if - block $break|0 - loop $continue|0 - local.get $0 - i32.const 7 - i32.and - if - block - local.get $2 + br $~lib/util/memory/memmove|inlined.0 + end + local.get $4 + local.get $3 + i32.add + local.get $5 + i32.le_u + if (result i32) + i32.const 1 + else + local.get $5 + local.get $3 + i32.add + local.get $4 + i32.le_u + end + if + local.get $5 + local.get $4 + local.get $3 + call $~lib/util/memory/memcpy + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 i32.eqz if - return + br $~lib/util/memory/memmove|inlined.0 end - local.get $2 + local.get $3 i32.const 1 i32.sub - local.set $2 + local.set $3 block (result i32) - local.get $0 - local.tee $3 + local.get $5 + local.tee $6 i32.const 1 i32.add - local.set $0 - local.get $3 + local.set $5 + local.get $6 end block (result i32) - local.get $1 - local.tee $3 + local.get $4 + local.tee $6 i32.const 1 i32.add - local.set $1 - local.get $3 + local.set $4 + local.get $6 end i32.load8_u i32.store8 + br $continue|0 end - br $continue|0 end end - end - block $break|1 - loop $continue|1 - local.get $2 - i32.const 8 - i32.ge_u - if - block - local.get $0 - local.get $1 + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 i64.load i64.store - local.get $2 + local.get $3 i32.const 8 i32.sub - local.set $2 - local.get $0 + local.set $3 + local.get $5 i32.const 8 i32.add - local.set $0 - local.get $1 + local.set $5 + local.get $4 i32.const 8 i32.add - local.set $1 + local.set $4 + br $continue|1 end - br $continue|1 end end end - end - block $break|2 - loop $continue|2 - local.get $2 - if - block + block $break|2 + loop $continue|2 + local.get $3 + if block (result i32) - local.get $0 - local.tee $3 + local.get $5 + local.tee $6 i32.const 1 i32.add - local.set $0 - local.get $3 + local.set $5 + local.get $6 end block (result i32) - local.get $1 - local.tee $3 + local.get $4 + local.tee $6 i32.const 1 i32.add - local.set $1 - local.get $3 + local.set $4 + local.get $6 end i32.load8_u i32.store8 - local.get $2 + local.get $3 i32.const 1 i32.sub - local.set $2 + local.set $3 + br $continue|2 end - br $continue|2 end end - end - else - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and - i32.eq - if - block $break|3 - loop $continue|3 - local.get $0 - local.get $2 - i32.add - i32.const 7 - i32.and - if - block - local.get $2 + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 i32.eqz if - return + br $~lib/util/memory/memmove|inlined.0 end - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.const 1 i32.sub - local.tee $2 + local.tee $3 i32.add - local.get $1 - local.get $2 + local.get $4 + local.get $3 i32.add i32.load8_u i32.store8 + br $continue|3 end - br $continue|3 end end - end - block $break|4 - loop $continue|4 - local.get $2 - i32.const 8 - i32.ge_u - if - block - local.get $2 + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 i32.const 8 i32.sub - local.set $2 - local.get $0 - local.get $2 + local.set $3 + local.get $5 + local.get $3 i32.add - local.get $1 - local.get $2 + local.get $4 + local.get $3 i32.add i64.load i64.store + br $continue|4 end - br $continue|4 end end end - end - block $break|5 - loop $continue|5 - local.get $2 - if - local.get $0 - local.get $2 - i32.const 1 - i32.sub - local.tee $2 - i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 - br $continue|5 + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end end end end end ) - (func $~lib/internal/memory/memcmp (; 6 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - local.get $0 - local.get $1 - i32.eq - if - i32.const 0 - return - end + (func $~lib/memory/memory.repeat (; 9 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (local $4 i32) + (local $5 i32) + i32.const 0 + local.set $4 + local.get $2 + local.get $3 + i32.mul + local.set $5 block $break|0 loop $continue|0 - local.get $2 - i32.const 0 - i32.ne - local.tee $3 - if (result i32) + local.get $4 + local.get $5 + i32.lt_u + if local.get $0 - i32.load8_u + local.get $4 + i32.add local.get $1 - i32.load8_u - i32.eq - else - local.get $3 + local.get $2 + call $~lib/memory/memory.copy + local.get $4 + local.get $2 + i32.add + local.set $4 + br $continue|0 end - if - block - local.get $2 + end + end + ) + (func $~lib/memory/memory.compare (; 10 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + block $~lib/util/memory/memcmp|inlined.0 (result i32) + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + i32.const 0 + br $~lib/util/memory/memcmp|inlined.0 + end + block $break|0 + loop $continue|0 + local.get $3 + i32.const 0 + i32.ne + if (result i32) + local.get $5 + i32.load8_u + local.get $4 + i32.load8_u + i32.eq + else + i32.const 0 + end + if + local.get $3 i32.const 1 i32.sub - local.set $2 - local.get $0 + local.set $3 + local.get $5 i32.const 1 i32.add - local.set $0 - local.get $1 + local.set $5 + local.get $4 i32.const 1 i32.add - local.set $1 + local.set $4 + br $continue|0 end - br $continue|0 end end - end - local.get $2 - if (result i32) - local.get $0 - i32.load8_u - local.get $1 - i32.load8_u - i32.sub - else - i32.const 0 + local.get $3 + if (result i32) + local.get $5 + i32.load8_u + local.get $4 + i32.load8_u + i32.sub + else + i32.const 0 + end end ) - (func $~lib/allocator/arena/__memory_free (; 7 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/stub/__free (; 11 ;) (type $FUNCSIG$vi) (param $0 i32) nop ) - (func $~lib/allocator/arena/__memory_reset (; 8 ;) (type $FUNCSIG$v) - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset + (func $~lib/rt/stub/__reset (; 12 ;) (type $FUNCSIG$v) + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset ) - (func $start:std/allocator_arena (; 9 ;) (type $FUNCSIG$v) - (local $0 i32) - (local $1 i32) - (local $2 i32) - call $start:~lib/allocator/arena - block $~lib/memory/memory.allocate|inlined.0 (result i32) - global.get $std/allocator_arena/size - local.set $0 - local.get $0 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.0 - end - global.set $std/allocator_arena/ptr1 - block $~lib/memory/memory.allocate|inlined.1 (result i32) - global.get $std/allocator_arena/size - local.set $0 - local.get $0 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.1 - end - global.set $std/allocator_arena/ptr2 - global.get $std/allocator_arena/ptr1 - global.get $std/allocator_arena/ptr2 - i32.ne - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 7 - i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/memory/memory.fill|inlined.0 - global.get $std/allocator_arena/ptr1 - local.set $0 - i32.const 18 - local.set $1 - global.get $std/allocator_arena/size - local.set $2 - local.get $0 - local.get $1 - local.get $2 - call $~lib/internal/memory/memset - end - block $break|0 - i32.const 0 - global.set $std/allocator_arena/i - loop $repeat|0 - global.get $std/allocator_arena/i - global.get $std/allocator_arena/size - i32.lt_u - i32.eqz - br_if $break|0 - global.get $std/allocator_arena/ptr1 - global.get $std/allocator_arena/i - i32.add - i32.load8_u - i32.const 18 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 12 - i32.const 27 - call $~lib/env/abort - unreachable - end - global.get $std/allocator_arena/i - i32.const 1 - i32.add - global.set $std/allocator_arena/i - br $repeat|0 - unreachable - end - unreachable - end - block $~lib/memory/memory.copy|inlined.0 - global.get $std/allocator_arena/ptr2 - local.set $2 - global.get $std/allocator_arena/ptr1 - local.set $1 - global.get $std/allocator_arena/size - local.set $0 - local.get $2 - local.get $1 - local.get $0 - call $~lib/internal/memory/memmove - end - block $break|1 - i32.const 0 - global.set $std/allocator_arena/i - loop $repeat|1 - global.get $std/allocator_arena/i - global.get $std/allocator_arena/size - i32.lt_u - i32.eqz - br_if $break|1 - global.get $std/allocator_arena/ptr2 - global.get $std/allocator_arena/i - i32.add - i32.load8_u - i32.const 18 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 16 - i32.const 27 - call $~lib/env/abort - unreachable - end - global.get $std/allocator_arena/i - i32.const 1 - i32.add - global.set $std/allocator_arena/i - br $repeat|1 - unreachable - end - unreachable - end - block $~lib/memory/memory.compare|inlined.0 (result i32) - global.get $std/allocator_arena/ptr1 - local.set $0 - global.get $std/allocator_arena/ptr2 - local.set $1 - global.get $std/allocator_arena/size - local.set $2 - local.get $0 - local.get $1 - local.get $2 - call $~lib/internal/memory/memcmp - end - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 18 - i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/memory/memory.free|inlined.0 - global.get $std/allocator_arena/ptr1 - local.set $2 - local.get $2 - call $~lib/allocator/arena/__memory_free - br $~lib/memory/memory.free|inlined.0 - end - block $~lib/memory/memory.free|inlined.1 - global.get $std/allocator_arena/ptr2 - local.set $2 - local.get $2 - call $~lib/allocator/arena/__memory_free - br $~lib/memory/memory.free|inlined.1 - end - block $~lib/memory/memory.reset|inlined.0 - call $~lib/allocator/arena/__memory_reset - br $~lib/memory/memory.reset|inlined.0 - end - block $~lib/memory/memory.allocate|inlined.2 (result i32) - global.get $std/allocator_arena/size - local.set $2 - local.get $2 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.2 - end - global.set $std/allocator_arena/ptr1 - global.get $std/allocator_arena/ptr1 - global.get $~lib/memory/HEAP_BASE - i32.const 7 + (func $start (; 13 ;) (type $FUNCSIG$v) + global.get $~lib/heap/__heap_base + i32.const 15 i32.add - i32.const 7 + i32.const 15 i32.const -1 i32.xor i32.and - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 25 - i32.const 0 - call $~lib/env/abort - unreachable - end - ) - (func $start (; 10 ;) (type $FUNCSIG$v) - call $start:std/allocator_arena + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset ) - (func $null (; 11 ;) (type $FUNCSIG$v) + (func $null (; 14 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/allocators/runner.js b/tests/allocators/runner.js index 1a7bdaa5fb..d023ef344d 100644 --- a/tests/allocators/runner.js +++ b/tests/allocators/runner.js @@ -1,10 +1,8 @@ -const useFill = false; - function runner(exports, runs, allocs) { - const alloc = exports["memory.allocate"]; - const free = exports["memory.free"]; + const alloc = exports["__alloc"]; + const free = exports["__free"]; + const reset = exports["__reset"]; const fill = exports["memory.fill"]; - const reset = exports["memory.reset"]; const ptrs = []; @@ -16,7 +14,7 @@ function runner(exports, runs, allocs) { if (!ptr) throw Error(); if ((ptr & 7) != 0) throw Error("invalid alignment: " + (ptr & 7) + " on " + ptr); if (ptrs.indexOf(ptr) >= 0) throw Error("duplicate pointer"); - if (useFill) fill(ptr, 0xdc, size); + if (fill) fill(ptr, ptr % 8, size); ptrs.push(ptr); return ptr; } @@ -86,14 +84,14 @@ function runner(exports, runs, allocs) { // SL+1 for allocations in TLSF var size = ((exports.memory.buffer.byteLength - base) * 9 / 10) >>> 0; var ptr = alloc(size); - if (useFill) fill(ptr, 0xac, size); + // if (fill) fill(ptr, 0xac, size); if (ptr !== base) throw Error("expected " + base + " but got " + ptr); free(ptr); } testMemChanged(); } } finally { - // mem(allocator.memory, 0, 0x10000); + // mem(exports.memory, 0, 0x800); } } diff --git a/tests/allocators/tlsf/assembly/index.ts b/tests/allocators/tlsf/assembly/index.ts deleted file mode 100644 index 19faa6f7c1..0000000000 --- a/tests/allocators/tlsf/assembly/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -import "allocator/tlsf"; -export { memory }; diff --git a/tests/allocators/tlsf/optimized.wat b/tests/allocators/tlsf/optimized.wat deleted file mode 100644 index a0da81d08a..0000000000 --- a/tests/allocators/tlsf/optimized.wat +++ /dev/null @@ -1,785 +0,0 @@ -(module - (type $iiii (func (param i32 i32 i32) (result i32))) - (type $ii (func (param i32) (result i32))) - (type $ii_ (func (param i32 i32))) - (type $iii_ (func (param i32 i32 i32))) - (type $iiii_ (func (param i32 i32 i32 i32))) - (type $iii (func (param i32 i32) (result i32))) - (type $i_ (func (param i32))) - (type $_ (func)) - (type $FUNCSIG$vi (func (param i32))) - (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $~lib/allocator/tlsf/ROOT (mut i32) (i32.const 0)) - (export "memory" (memory $0)) - (export "table" (table $0)) - (export "memory.compare" (func $~lib/memory/memory.compare)) - (export "memory.allocate" (func $~lib/memory/memory.allocate)) - (export "memory.free" (func $~lib/memory/memory.free)) - (export "memory.reset" (func $~lib/memory/memory.reset)) - (func $~lib/internal/memory/memcmp (; 0 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - local.get $0 - local.get $1 - i32.eq - if - i32.const 0 - return - end - loop $continue|0 - local.get $2 - i32.const 0 - i32.ne - local.tee $3 - if (result i32) - local.get $0 - i32.load8_u - local.get $1 - i32.load8_u - i32.eq - else - local.get $3 - end - if - local.get $2 - i32.const 1 - i32.sub - local.set $2 - local.get $0 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.set $1 - br $continue|0 - end - end - local.get $2 - if (result i32) - local.get $0 - i32.load8_u - local.get $1 - i32.load8_u - i32.sub - else - i32.const 0 - end - ) - (func $~lib/memory/memory.compare (; 1 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $0 - local.get $1 - local.get $2 - call $~lib/internal/memory/memcmp - ) - (func $~lib/allocator/tlsf/Root#set:tailRef (; 2 ;) (type $FUNCSIG$vi) (param $0 i32) - i32.const 2912 - local.get $0 - i32.store - ) - (func $~lib/allocator/tlsf/Root#setSLMap (; 3 ;) (type $iii_) (param $0 i32) (param $1 i32) (param $2 i32) - local.get $0 - local.get $1 - i32.const 2 - i32.shl - i32.add - local.get $2 - i32.store offset=4 - ) - (func $~lib/allocator/tlsf/Root#setHead (; 4 ;) (type $iiii_) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - local.get $0 - local.get $1 - i32.const 5 - i32.shl - local.get $2 - i32.add - i32.const 2 - i32.shl - i32.add - local.get $3 - i32.store offset=96 - ) - (func $~lib/allocator/tlsf/Block#get:right (; 5 ;) (type $ii) (param $0 i32) (result i32) - local.get $0 - i32.const 8 - i32.add - local.get $0 - i32.load - i32.const -4 - i32.and - i32.add - ) - (func $~lib/allocator/tlsf/fls (; 6 ;) (type $ii) (param $0 i32) (result i32) - i32.const 31 - local.get $0 - i32.clz - i32.sub - ) - (func $~lib/allocator/tlsf/Root#getHead (; 7 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $0 - local.get $1 - i32.const 5 - i32.shl - local.get $2 - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - ) - (func $~lib/allocator/tlsf/Root#getSLMap (; 8 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 - local.get $1 - i32.const 2 - i32.shl - i32.add - i32.load offset=4 - ) - (func $~lib/allocator/tlsf/Root#remove (; 9 ;) (type $ii_) (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $1 - i32.load - i32.const -4 - i32.and - local.tee $2 - i32.const 256 - i32.lt_u - if (result i32) - local.get $2 - i32.const 8 - i32.div_u - local.set $4 - i32.const 0 - else - local.get $2 - local.get $2 - call $~lib/allocator/tlsf/fls - local.tee $3 - i32.const 5 - i32.sub - i32.shr_u - i32.const 32 - i32.xor - local.set $4 - local.get $3 - i32.const 7 - i32.sub - end - local.set $3 - local.get $1 - i32.load offset=8 - local.set $2 - local.get $1 - i32.load offset=4 - local.tee $5 - if - local.get $5 - local.get $2 - i32.store offset=8 - end - local.get $2 - if - local.get $2 - local.get $5 - i32.store offset=4 - end - local.get $0 - local.get $3 - local.get $4 - call $~lib/allocator/tlsf/Root#getHead - local.get $1 - i32.eq - if - local.get $0 - local.get $3 - local.get $4 - local.get $2 - call $~lib/allocator/tlsf/Root#setHead - local.get $2 - i32.eqz - if - local.get $0 - local.get $3 - local.get $0 - local.get $3 - call $~lib/allocator/tlsf/Root#getSLMap - i32.const 1 - local.get $4 - i32.shl - i32.const -1 - i32.xor - i32.and - local.tee $1 - call $~lib/allocator/tlsf/Root#setSLMap - local.get $1 - i32.eqz - if - local.get $0 - local.get $0 - i32.load - i32.const 1 - local.get $3 - i32.shl - i32.const -1 - i32.xor - i32.and - i32.store - end - end - end - ) - (func $~lib/allocator/tlsf/Root#insert (; 10 ;) (type $ii_) (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $1 - i32.load - local.set $2 - local.get $1 - call $~lib/allocator/tlsf/Block#get:right - local.tee $4 - i32.load - local.tee $5 - i32.const 1 - i32.and - if - local.get $0 - local.get $4 - call $~lib/allocator/tlsf/Root#remove - local.get $1 - local.get $2 - local.get $5 - i32.const -4 - i32.and - i32.const 8 - i32.add - i32.add - local.tee $2 - i32.store - local.get $1 - call $~lib/allocator/tlsf/Block#get:right - local.tee $4 - i32.load - local.set $5 - end - local.get $2 - i32.const 2 - i32.and - if - local.get $1 - i32.const 4 - i32.sub - i32.load - local.tee $1 - i32.load - local.set $3 - local.get $0 - local.get $1 - call $~lib/allocator/tlsf/Root#remove - local.get $1 - local.get $3 - local.get $2 - i32.const -4 - i32.and - i32.const 8 - i32.add - i32.add - local.tee $3 - i32.store - local.get $3 - local.set $2 - end - local.get $4 - local.get $5 - i32.const 2 - i32.or - i32.store - local.get $4 - i32.const 4 - i32.sub - local.get $1 - i32.store - local.get $0 - local.get $2 - i32.const -4 - i32.and - local.tee $3 - i32.const 256 - i32.lt_u - if (result i32) - local.get $3 - i32.const 8 - i32.div_u - local.set $3 - i32.const 0 - else - local.get $3 - local.get $3 - call $~lib/allocator/tlsf/fls - local.tee $2 - i32.const 5 - i32.sub - i32.shr_u - i32.const 32 - i32.xor - local.set $3 - local.get $2 - i32.const 7 - i32.sub - end - local.tee $2 - local.get $3 - call $~lib/allocator/tlsf/Root#getHead - local.set $4 - local.get $1 - i32.const 0 - i32.store offset=4 - local.get $1 - local.get $4 - i32.store offset=8 - local.get $4 - if - local.get $4 - local.get $1 - i32.store offset=4 - end - local.get $0 - local.get $2 - local.get $3 - local.get $1 - call $~lib/allocator/tlsf/Root#setHead - local.get $0 - local.get $0 - i32.load - i32.const 1 - local.get $2 - i32.shl - i32.or - i32.store - local.get $0 - local.get $2 - local.get $0 - local.get $2 - call $~lib/allocator/tlsf/Root#getSLMap - i32.const 1 - local.get $3 - i32.shl - i32.or - call $~lib/allocator/tlsf/Root#setSLMap - ) - (func $~lib/allocator/tlsf/Root#addMemory (; 11 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - local.get $2 - block (result i32) - i32.const 2912 - i32.load - local.tee $2 - if - local.get $1 - i32.const 8 - i32.sub - local.get $2 - i32.eq - if - local.get $2 - i32.load - local.set $3 - local.get $1 - i32.const 8 - i32.sub - local.set $1 - end - end - local.get $1 - end - i32.sub - local.tee $2 - i32.const 32 - i32.lt_u - if - i32.const 0 - return - end - local.get $1 - local.get $3 - i32.const 2 - i32.and - local.get $2 - i32.const 16 - i32.sub - i32.const 1 - i32.or - i32.or - i32.store - local.get $1 - i32.const 0 - i32.store offset=4 - local.get $1 - i32.const 0 - i32.store offset=8 - local.get $1 - local.get $2 - i32.add - i32.const 8 - i32.sub - local.tee $2 - i32.const 2 - i32.store - local.get $2 - call $~lib/allocator/tlsf/Root#set:tailRef - local.get $0 - local.get $1 - call $~lib/allocator/tlsf/Root#insert - i32.const 1 - ) - (func $~lib/allocator/tlsf/Root#search (; 12 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - local.get $1 - i32.const 256 - i32.lt_u - if (result i32) - local.get $1 - i32.const 8 - i32.div_u - else - local.get $1 - local.get $1 - call $~lib/allocator/tlsf/fls - local.tee $2 - i32.const 5 - i32.sub - i32.shr_u - i32.const 32 - i32.xor - local.set $1 - local.get $2 - i32.const 7 - i32.sub - local.set $2 - local.get $1 - i32.const 31 - i32.lt_u - if (result i32) - local.get $1 - i32.const 1 - i32.add - else - local.get $2 - i32.const 1 - i32.add - local.set $2 - i32.const 0 - end - end - local.set $1 - local.get $0 - local.get $2 - call $~lib/allocator/tlsf/Root#getSLMap - i32.const -1 - local.get $1 - i32.shl - i32.and - local.tee $1 - if (result i32) - local.get $0 - local.get $2 - local.get $1 - i32.ctz - call $~lib/allocator/tlsf/Root#getHead - else - local.get $0 - i32.load - i32.const -1 - local.get $2 - i32.const 1 - i32.add - i32.shl - i32.and - local.tee $1 - if (result i32) - local.get $0 - local.get $1 - i32.ctz - local.tee $2 - call $~lib/allocator/tlsf/Root#getSLMap - local.set $1 - local.get $0 - local.get $2 - local.get $1 - i32.ctz - call $~lib/allocator/tlsf/Root#getHead - else - i32.const 0 - end - end - ) - (func $~lib/allocator/tlsf/Root#use (; 13 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - local.get $1 - i32.load - local.set $3 - local.get $0 - local.get $1 - call $~lib/allocator/tlsf/Root#remove - local.get $3 - i32.const -4 - i32.and - local.get $2 - i32.sub - local.tee $4 - i32.const 24 - i32.ge_u - if - local.get $1 - local.get $2 - local.get $3 - i32.const 2 - i32.and - i32.or - i32.store - local.get $1 - i32.const 8 - i32.add - local.get $2 - i32.add - local.tee $2 - local.get $4 - i32.const 8 - i32.sub - i32.const 1 - i32.or - i32.store - local.get $0 - local.get $2 - call $~lib/allocator/tlsf/Root#insert - else - local.get $1 - local.get $3 - i32.const -2 - i32.and - i32.store - local.get $1 - call $~lib/allocator/tlsf/Block#get:right - local.tee $2 - local.get $2 - i32.load - i32.const -3 - i32.and - i32.store - end - local.get $1 - i32.const 8 - i32.add - ) - (func $~lib/allocator/tlsf/__memory_allocate (; 14 ;) (type $ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - global.get $~lib/allocator/tlsf/ROOT - local.tee $1 - i32.eqz - if - i32.const 8 - local.tee $4 - i32.const 68451 - i32.add - i32.const -65536 - i32.and - i32.const 16 - i32.shr_u - local.tee $5 - current_memory - local.tee $2 - i32.gt_s - local.tee $3 - if (result i32) - local.get $5 - local.get $2 - i32.sub - grow_memory - i32.const 0 - i32.lt_s - else - local.get $3 - end - if - unreachable - end - local.get $4 - local.tee $1 - global.set $~lib/allocator/tlsf/ROOT - i32.const 0 - call $~lib/allocator/tlsf/Root#set:tailRef - local.get $1 - i32.const 0 - i32.store - i32.const 0 - local.set $3 - loop $repeat|0 - block $break|0 - local.get $3 - i32.const 22 - i32.ge_u - br_if $break|0 - local.get $1 - local.get $3 - i32.const 0 - call $~lib/allocator/tlsf/Root#setSLMap - i32.const 0 - local.set $2 - loop $repeat|1 - block $break|1 - local.get $2 - i32.const 32 - i32.ge_u - br_if $break|1 - local.get $1 - local.get $3 - local.get $2 - i32.const 0 - call $~lib/allocator/tlsf/Root#setHead - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $repeat|1 - end - end - local.get $3 - i32.const 1 - i32.add - local.set $3 - br $repeat|0 - end - end - local.get $1 - local.get $4 - i32.const 2923 - i32.add - i32.const -8 - i32.and - current_memory - i32.const 16 - i32.shl - call $~lib/allocator/tlsf/Root#addMemory - drop - end - local.get $0 - i32.const 1073741824 - i32.gt_u - if - unreachable - end - local.get $1 - local.get $1 - local.get $0 - i32.const 7 - i32.add - i32.const -8 - i32.and - local.tee $5 - i32.const 16 - local.tee $2 - local.get $5 - local.get $2 - i32.gt_u - select - local.tee $0 - call $~lib/allocator/tlsf/Root#search - local.tee $4 - if (result i32) - local.get $4 - else - current_memory - local.tee $5 - local.tee $4 - local.get $0 - i32.const 65535 - i32.add - i32.const -65536 - i32.and - i32.const 16 - i32.shr_u - local.tee $2 - local.tee $3 - local.get $4 - local.get $3 - i32.gt_s - select - grow_memory - i32.const 0 - i32.lt_s - if - local.get $2 - grow_memory - i32.const 0 - i32.lt_s - if - unreachable - end - end - local.get $1 - local.get $5 - i32.const 16 - i32.shl - current_memory - i32.const 16 - i32.shl - call $~lib/allocator/tlsf/Root#addMemory - drop - local.get $1 - local.get $0 - call $~lib/allocator/tlsf/Root#search - end - local.get $0 - call $~lib/allocator/tlsf/Root#use - ) - (func $~lib/memory/memory.allocate (; 15 ;) (type $ii) (param $0 i32) (result i32) - local.get $0 - call $~lib/allocator/tlsf/__memory_allocate - ) - (func $~lib/allocator/tlsf/__memory_free (; 16 ;) (type $i_) (param $0 i32) - (local $1 i32) - (local $2 i32) - local.get $0 - if - global.get $~lib/allocator/tlsf/ROOT - local.tee $1 - if - local.get $0 - i32.const 8 - i32.sub - local.tee $2 - local.get $2 - i32.load - i32.const 1 - i32.or - i32.store - local.get $1 - local.get $0 - i32.const 8 - i32.sub - call $~lib/allocator/tlsf/Root#insert - end - end - ) - (func $~lib/memory/memory.free (; 17 ;) (type $i_) (param $0 i32) - local.get $0 - call $~lib/allocator/tlsf/__memory_free - ) - (func $~lib/memory/memory.reset (; 18 ;) (type $_) - unreachable - ) - (func $null (; 19 ;) (type $_) - nop - ) -) diff --git a/tests/allocators/tlsf/untouched.wat b/tests/allocators/tlsf/untouched.wat deleted file mode 100644 index ba07ee7756..0000000000 --- a/tests/allocators/tlsf/untouched.wat +++ /dev/null @@ -1,1544 +0,0 @@ -(module - (type $iiii_ (func (param i32 i32 i32 i32))) - (type $_ (func)) - (type $iiii (func (param i32 i32 i32) (result i32))) - (type $ii (func (param i32) (result i32))) - (type $ii_ (func (param i32 i32))) - (type $iii_ (func (param i32 i32 i32))) - (type $iii (func (param i32 i32) (result i32))) - (type $i_ (func (param i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) - (memory $0 1) - (data (i32.const 8) "\16\00\00\00~\00l\00i\00b\00/\00a\00l\00l\00o\00c\00a\00t\00o\00r\00/\00t\00l\00s\00f\00.\00t\00s\00") - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $~lib/allocator/tlsf/SL_BITS i32 (i32.const 5)) - (global $~lib/allocator/tlsf/SL_SIZE i32 (i32.const 32)) - (global $~lib/allocator/tlsf/SB_BITS i32 (i32.const 8)) - (global $~lib/allocator/tlsf/SB_SIZE i32 (i32.const 256)) - (global $~lib/allocator/tlsf/FL_BITS i32 (i32.const 22)) - (global $~lib/allocator/tlsf/FREE i32 (i32.const 1)) - (global $~lib/allocator/tlsf/LEFT_FREE i32 (i32.const 2)) - (global $~lib/allocator/tlsf/TAGS i32 (i32.const 3)) - (global $~lib/allocator/tlsf/Block.INFO i32 (i32.const 8)) - (global $~lib/allocator/tlsf/Block.MIN_SIZE i32 (i32.const 16)) - (global $~lib/allocator/tlsf/Block.MAX_SIZE i32 (i32.const 1073741824)) - (global $~lib/allocator/tlsf/Root.SL_START i32 (i32.const 4)) - (global $~lib/allocator/tlsf/Root.SL_END i32 (i32.const 92)) - (global $~lib/allocator/tlsf/Root.HL_START i32 (i32.const 96)) - (global $~lib/allocator/tlsf/Root.HL_END i32 (i32.const 2912)) - (global $~lib/allocator/tlsf/Root.SIZE i32 (i32.const 2916)) - (global $~lib/allocator/tlsf/ROOT (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 56)) - (export "memory" (memory $0)) - (export "table" (table $0)) - (export "memory.compare" (func $~lib/memory/memory.compare)) - (export "memory.allocate" (func $~lib/memory/memory.allocate)) - (export "memory.free" (func $~lib/memory/memory.free)) - (export "memory.reset" (func $~lib/memory/memory.reset)) - (start $start) - (func $start:~lib/allocator/tlsf (; 1 ;) (type $_) - i32.const 1 - global.get $~lib/allocator/tlsf/SL_BITS - i32.shl - i32.const 32 - i32.le_s - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 122 - i32.const 0 - call $~lib/env/abort - unreachable - end - ) - (func $start:assembly/index (; 2 ;) (type $_) - call $start:~lib/allocator/tlsf - ) - (func $~lib/internal/memory/memcmp (; 3 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - local.get $0 - local.get $1 - i32.eq - if - i32.const 0 - return - end - block $break|0 - loop $continue|0 - local.get $2 - i32.const 0 - i32.ne - local.tee $3 - if (result i32) - local.get $0 - i32.load8_u - local.get $1 - i32.load8_u - i32.eq - else - local.get $3 - end - if - block - local.get $2 - i32.const 1 - i32.sub - local.set $2 - local.get $0 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.set $1 - end - br $continue|0 - end - end - end - local.get $2 - if (result i32) - local.get $0 - i32.load8_u - local.get $1 - i32.load8_u - i32.sub - else - i32.const 0 - end - ) - (func $~lib/memory/memory.compare (; 4 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $0 - local.get $1 - local.get $2 - call $~lib/internal/memory/memcmp - ) - (func $~lib/allocator/tlsf/Root#set:tailRef (; 5 ;) (type $ii_) (param $0 i32) (param $1 i32) - i32.const 0 - local.get $1 - i32.store offset=2912 - ) - (func $~lib/allocator/tlsf/Root#setSLMap (; 6 ;) (type $iii_) (param $0 i32) (param $1 i32) (param $2 i32) - local.get $1 - global.get $~lib/allocator/tlsf/FL_BITS - i32.lt_u - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 144 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 4 - i32.mul - i32.add - local.get $2 - i32.store offset=4 - ) - (func $~lib/allocator/tlsf/Root#setHead (; 7 ;) (type $iiii_) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - local.get $1 - global.get $~lib/allocator/tlsf/FL_BITS - i32.lt_u - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 167 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $2 - global.get $~lib/allocator/tlsf/SL_SIZE - i32.lt_u - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 168 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - global.get $~lib/allocator/tlsf/SL_SIZE - i32.mul - local.get $2 - i32.add - i32.const 4 - i32.mul - i32.add - local.get $3 - i32.store offset=96 - ) - (func $~lib/allocator/tlsf/Root#get:tailRef (; 8 ;) (type $ii) (param $0 i32) (result i32) - i32.const 0 - i32.load offset=2912 - ) - (func $~lib/allocator/tlsf/Block#get:right (; 9 ;) (type $ii) (param $0 i32) (result i32) - (local $1 i32) - local.get $0 - i32.load - global.get $~lib/allocator/tlsf/TAGS - i32.const -1 - i32.xor - i32.and - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 89 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - global.get $~lib/allocator/tlsf/Block.INFO - i32.add - local.get $0 - i32.load - global.get $~lib/allocator/tlsf/TAGS - i32.const -1 - i32.xor - i32.and - i32.add - local.tee $1 - i32.eqz - if (result i32) - i32.const 0 - i32.const 8 - i32.const 90 - i32.const 11 - call $~lib/env/abort - unreachable - else - local.get $1 - end - ) - (func $~lib/allocator/tlsf/fls (; 10 ;) (type $ii) (param $0 i32) (result i32) - local.get $0 - i32.const 0 - i32.ne - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 428 - i32.const 2 - call $~lib/env/abort - unreachable - end - i32.const 31 - local.get $0 - i32.clz - i32.sub - ) - (func $~lib/allocator/tlsf/Root#getHead (; 11 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $1 - global.get $~lib/allocator/tlsf/FL_BITS - i32.lt_u - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 158 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $2 - global.get $~lib/allocator/tlsf/SL_SIZE - i32.lt_u - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 159 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - global.get $~lib/allocator/tlsf/SL_SIZE - i32.mul - local.get $2 - i32.add - i32.const 4 - i32.mul - i32.add - i32.load offset=96 - ) - (func $~lib/allocator/tlsf/Root#getSLMap (; 12 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - local.get $1 - global.get $~lib/allocator/tlsf/FL_BITS - i32.lt_u - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 138 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 4 - i32.mul - i32.add - i32.load offset=4 - ) - (func $~lib/allocator/tlsf/Root#remove (; 13 ;) (type $ii_) (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - local.get $1 - i32.load - local.set $2 - local.get $2 - global.get $~lib/allocator/tlsf/FREE - i32.and - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 258 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $2 - global.get $~lib/allocator/tlsf/TAGS - i32.const -1 - i32.xor - i32.and - local.set $3 - local.get $3 - global.get $~lib/allocator/tlsf/Block.MIN_SIZE - i32.ge_u - local.tee $4 - if (result i32) - local.get $3 - global.get $~lib/allocator/tlsf/Block.MAX_SIZE - i32.lt_u - else - local.get $4 - end - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 260 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $3 - global.get $~lib/allocator/tlsf/SB_SIZE - i32.lt_u - if - i32.const 0 - local.set $5 - local.get $3 - i32.const 8 - i32.div_u - local.set $6 - else - local.get $3 - call $~lib/allocator/tlsf/fls - local.set $5 - local.get $3 - local.get $5 - global.get $~lib/allocator/tlsf/SL_BITS - i32.sub - i32.shr_u - i32.const 1 - global.get $~lib/allocator/tlsf/SL_BITS - i32.shl - i32.xor - local.set $6 - local.get $5 - global.get $~lib/allocator/tlsf/SB_BITS - i32.const 1 - i32.sub - i32.sub - local.set $5 - end - local.get $1 - i32.load offset=4 - local.set $7 - local.get $1 - i32.load offset=8 - local.set $8 - local.get $7 - if - local.get $7 - local.get $8 - i32.store offset=8 - end - local.get $8 - if - local.get $8 - local.get $7 - i32.store offset=4 - end - local.get $1 - local.get $0 - local.get $5 - local.get $6 - call $~lib/allocator/tlsf/Root#getHead - i32.eq - if - local.get $0 - local.get $5 - local.get $6 - local.get $8 - call $~lib/allocator/tlsf/Root#setHead - local.get $8 - i32.eqz - if - local.get $0 - local.get $5 - call $~lib/allocator/tlsf/Root#getSLMap - local.set $4 - local.get $0 - local.get $5 - local.get $4 - i32.const 1 - local.get $6 - i32.shl - i32.const -1 - i32.xor - i32.and - local.tee $4 - call $~lib/allocator/tlsf/Root#setSLMap - local.get $4 - i32.eqz - if - local.get $0 - local.get $0 - i32.load - i32.const 1 - local.get $5 - i32.shl - i32.const -1 - i32.xor - i32.and - i32.store - end - end - end - ) - (func $~lib/allocator/tlsf/Block#get:left (; 14 ;) (type $ii) (param $0 i32) (result i32) - (local $1 i32) - local.get $0 - i32.load - global.get $~lib/allocator/tlsf/LEFT_FREE - i32.and - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 81 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - i32.const 4 - i32.sub - i32.load - local.tee $1 - i32.eqz - if (result i32) - i32.const 0 - i32.const 8 - i32.const 82 - i32.const 11 - call $~lib/env/abort - unreachable - else - local.get $1 - end - ) - (func $~lib/allocator/tlsf/Root#setJump (; 15 ;) (type $iii_) (param $0 i32) (param $1 i32) (param $2 i32) - local.get $1 - i32.load - global.get $~lib/allocator/tlsf/FREE - i32.and - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 334 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $1 - call $~lib/allocator/tlsf/Block#get:right - local.get $2 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 335 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $2 - i32.load - global.get $~lib/allocator/tlsf/LEFT_FREE - i32.and - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 336 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $2 - i32.const 4 - i32.sub - local.get $1 - i32.store - ) - (func $~lib/allocator/tlsf/Root#insert (; 16 ;) (type $ii_) (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - local.get $1 - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 189 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $1 - i32.load - local.set $2 - local.get $2 - global.get $~lib/allocator/tlsf/FREE - i32.and - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 191 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $1 - i32.load - global.get $~lib/allocator/tlsf/TAGS - i32.const -1 - i32.xor - i32.and - local.tee $3 - global.get $~lib/allocator/tlsf/Block.MIN_SIZE - i32.ge_u - local.tee $4 - if (result i32) - local.get $3 - global.get $~lib/allocator/tlsf/Block.MAX_SIZE - i32.lt_u - else - local.get $4 - end - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 193 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $1 - call $~lib/allocator/tlsf/Block#get:right - local.tee $4 - i32.eqz - if (result i32) - i32.const 0 - i32.const 8 - i32.const 197 - i32.const 23 - call $~lib/env/abort - unreachable - else - local.get $4 - end - local.set $5 - local.get $5 - i32.load - local.set $6 - local.get $6 - global.get $~lib/allocator/tlsf/FREE - i32.and - if - local.get $0 - local.get $5 - call $~lib/allocator/tlsf/Root#remove - local.get $1 - local.get $2 - global.get $~lib/allocator/tlsf/Block.INFO - local.get $6 - global.get $~lib/allocator/tlsf/TAGS - i32.const -1 - i32.xor - i32.and - i32.add - i32.add - local.tee $2 - i32.store - local.get $1 - call $~lib/allocator/tlsf/Block#get:right - local.set $5 - local.get $5 - i32.load - local.set $6 - end - local.get $2 - global.get $~lib/allocator/tlsf/LEFT_FREE - i32.and - if - local.get $1 - call $~lib/allocator/tlsf/Block#get:left - local.tee $4 - i32.eqz - if (result i32) - i32.const 0 - i32.const 8 - i32.const 211 - i32.const 24 - call $~lib/env/abort - unreachable - else - local.get $4 - end - local.set $4 - local.get $4 - i32.load - local.set $7 - local.get $7 - global.get $~lib/allocator/tlsf/FREE - i32.and - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 213 - i32.const 6 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $4 - call $~lib/allocator/tlsf/Root#remove - local.get $4 - local.get $7 - global.get $~lib/allocator/tlsf/Block.INFO - local.get $2 - global.get $~lib/allocator/tlsf/TAGS - i32.const -1 - i32.xor - i32.and - i32.add - i32.add - local.tee $7 - i32.store - local.get $4 - local.set $1 - local.get $7 - local.set $2 - end - local.get $5 - local.get $6 - global.get $~lib/allocator/tlsf/LEFT_FREE - i32.or - i32.store - local.get $0 - local.get $1 - local.get $5 - call $~lib/allocator/tlsf/Root#setJump - local.get $2 - global.get $~lib/allocator/tlsf/TAGS - i32.const -1 - i32.xor - i32.and - local.set $3 - local.get $3 - global.get $~lib/allocator/tlsf/Block.MIN_SIZE - i32.ge_u - local.tee $7 - if (result i32) - local.get $3 - global.get $~lib/allocator/tlsf/Block.MAX_SIZE - i32.lt_u - else - local.get $7 - end - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 226 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $3 - global.get $~lib/allocator/tlsf/SB_SIZE - i32.lt_u - if - i32.const 0 - local.set $8 - local.get $3 - i32.const 8 - i32.div_u - local.set $9 - else - local.get $3 - call $~lib/allocator/tlsf/fls - local.set $8 - local.get $3 - local.get $8 - global.get $~lib/allocator/tlsf/SL_BITS - i32.sub - i32.shr_u - i32.const 1 - global.get $~lib/allocator/tlsf/SL_BITS - i32.shl - i32.xor - local.set $9 - local.get $8 - global.get $~lib/allocator/tlsf/SB_BITS - i32.const 1 - i32.sub - i32.sub - local.set $8 - end - local.get $0 - local.get $8 - local.get $9 - call $~lib/allocator/tlsf/Root#getHead - local.set $10 - local.get $1 - i32.const 0 - i32.store offset=4 - local.get $1 - local.get $10 - i32.store offset=8 - local.get $10 - if - local.get $10 - local.get $1 - i32.store offset=4 - end - local.get $0 - local.get $8 - local.get $9 - local.get $1 - call $~lib/allocator/tlsf/Root#setHead - local.get $0 - local.get $0 - i32.load - i32.const 1 - local.get $8 - i32.shl - i32.or - i32.store - local.get $0 - local.get $8 - local.get $0 - local.get $8 - call $~lib/allocator/tlsf/Root#getSLMap - i32.const 1 - local.get $9 - i32.shl - i32.or - call $~lib/allocator/tlsf/Root#setSLMap - ) - (func $~lib/allocator/tlsf/Root#addMemory (; 17 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - local.get $1 - local.get $2 - i32.le_u - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 377 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $1 - i32.const 7 - i32.and - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 378 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $2 - i32.const 7 - i32.and - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 379 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - call $~lib/allocator/tlsf/Root#get:tailRef - local.set $3 - i32.const 0 - local.set $4 - local.get $3 - if - local.get $1 - local.get $3 - i32.const 4 - i32.add - i32.ge_u - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 384 - i32.const 6 - call $~lib/env/abort - unreachable - end - local.get $1 - global.get $~lib/allocator/tlsf/Block.INFO - i32.sub - local.get $3 - i32.eq - if - local.get $1 - global.get $~lib/allocator/tlsf/Block.INFO - i32.sub - local.set $1 - local.get $3 - i32.load - local.set $4 - end - else - local.get $1 - local.get $0 - global.get $~lib/allocator/tlsf/Root.SIZE - i32.add - i32.ge_u - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 393 - i32.const 6 - call $~lib/env/abort - unreachable - end - end - local.get $2 - local.get $1 - i32.sub - local.set $5 - local.get $5 - global.get $~lib/allocator/tlsf/Block.INFO - global.get $~lib/allocator/tlsf/Block.MIN_SIZE - i32.add - global.get $~lib/allocator/tlsf/Block.INFO - i32.add - i32.lt_u - if - i32.const 0 - return - end - local.get $5 - i32.const 2 - global.get $~lib/allocator/tlsf/Block.INFO - i32.mul - i32.sub - local.set $6 - local.get $1 - local.set $7 - local.get $7 - local.get $6 - global.get $~lib/allocator/tlsf/FREE - i32.or - local.get $4 - global.get $~lib/allocator/tlsf/LEFT_FREE - i32.and - i32.or - i32.store - local.get $7 - i32.const 0 - i32.store offset=4 - local.get $7 - i32.const 0 - i32.store offset=8 - local.get $1 - local.get $5 - i32.add - global.get $~lib/allocator/tlsf/Block.INFO - i32.sub - local.set $8 - local.get $8 - i32.const 0 - global.get $~lib/allocator/tlsf/LEFT_FREE - i32.or - i32.store - local.get $0 - local.get $8 - call $~lib/allocator/tlsf/Root#set:tailRef - local.get $0 - local.get $7 - call $~lib/allocator/tlsf/Root#insert - i32.const 1 - ) - (func $~lib/allocator/tlsf/ffs (; 18 ;) (type $ii) (param $0 i32) (result i32) - local.get $0 - i32.const 0 - i32.ne - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 422 - i32.const 2 - call $~lib/env/abort - unreachable - end - local.get $0 - i32.ctz - ) - (func $~lib/allocator/tlsf/ffs (; 19 ;) (type $ii) (param $0 i32) (result i32) - local.get $0 - i32.const 0 - i32.ne - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 422 - i32.const 2 - call $~lib/env/abort - unreachable - end - local.get $0 - i32.ctz - ) - (func $~lib/allocator/tlsf/Root#search (; 20 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - local.get $1 - global.get $~lib/allocator/tlsf/Block.MIN_SIZE - i32.ge_u - local.tee $2 - if (result i32) - local.get $1 - global.get $~lib/allocator/tlsf/Block.MAX_SIZE - i32.lt_u - else - local.get $2 - end - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 296 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $1 - global.get $~lib/allocator/tlsf/SB_SIZE - i32.lt_u - if - i32.const 0 - local.set $3 - local.get $1 - i32.const 8 - i32.div_u - local.set $4 - else - local.get $1 - call $~lib/allocator/tlsf/fls - local.set $3 - local.get $1 - local.get $3 - global.get $~lib/allocator/tlsf/SL_BITS - i32.sub - i32.shr_u - i32.const 1 - global.get $~lib/allocator/tlsf/SL_BITS - i32.shl - i32.xor - local.set $4 - local.get $3 - global.get $~lib/allocator/tlsf/SB_BITS - i32.const 1 - i32.sub - i32.sub - local.set $3 - local.get $4 - global.get $~lib/allocator/tlsf/SL_SIZE - i32.const 1 - i32.sub - i32.lt_u - if - local.get $4 - i32.const 1 - i32.add - local.set $4 - else - local.get $3 - i32.const 1 - i32.add - local.set $3 - i32.const 0 - local.set $4 - end - end - local.get $0 - local.get $3 - call $~lib/allocator/tlsf/Root#getSLMap - i32.const 0 - i32.const -1 - i32.xor - local.get $4 - i32.shl - i32.and - local.set $5 - local.get $5 - i32.eqz - if - local.get $0 - i32.load - i32.const 0 - i32.const -1 - i32.xor - local.get $3 - i32.const 1 - i32.add - i32.shl - i32.and - local.set $2 - local.get $2 - i32.eqz - if - i32.const 0 - local.set $6 - else - local.get $2 - call $~lib/allocator/tlsf/ffs - local.set $3 - local.get $0 - local.get $3 - call $~lib/allocator/tlsf/Root#getSLMap - local.tee $7 - if (result i32) - local.get $7 - else - i32.const 0 - i32.const 8 - i32.const 323 - i32.const 16 - call $~lib/env/abort - unreachable - end - local.set $5 - local.get $0 - local.get $3 - local.get $5 - call $~lib/allocator/tlsf/ffs - call $~lib/allocator/tlsf/Root#getHead - local.set $6 - end - else - local.get $0 - local.get $3 - local.get $5 - call $~lib/allocator/tlsf/ffs - call $~lib/allocator/tlsf/Root#getHead - local.set $6 - end - local.get $6 - ) - (func $~lib/allocator/tlsf/Root#use (; 21 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $1 - i32.load - local.set $3 - local.get $3 - global.get $~lib/allocator/tlsf/FREE - i32.and - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 348 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $2 - global.get $~lib/allocator/tlsf/Block.MIN_SIZE - i32.ge_u - local.tee $4 - if (result i32) - local.get $2 - global.get $~lib/allocator/tlsf/Block.MAX_SIZE - i32.lt_u - else - local.get $4 - end - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 349 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $2 - i32.const 7 - i32.and - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 350 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/allocator/tlsf/Root#remove - local.get $3 - global.get $~lib/allocator/tlsf/TAGS - i32.const -1 - i32.xor - i32.and - local.get $2 - i32.sub - local.set $5 - local.get $5 - global.get $~lib/allocator/tlsf/Block.INFO - global.get $~lib/allocator/tlsf/Block.MIN_SIZE - i32.add - i32.ge_u - if - local.get $1 - local.get $2 - local.get $3 - global.get $~lib/allocator/tlsf/LEFT_FREE - i32.and - i32.or - i32.store - local.get $1 - global.get $~lib/allocator/tlsf/Block.INFO - i32.add - local.get $2 - i32.add - local.set $4 - local.get $4 - local.get $5 - global.get $~lib/allocator/tlsf/Block.INFO - i32.sub - global.get $~lib/allocator/tlsf/FREE - i32.or - i32.store - local.get $0 - local.get $4 - call $~lib/allocator/tlsf/Root#insert - else - local.get $1 - local.get $3 - global.get $~lib/allocator/tlsf/FREE - i32.const -1 - i32.xor - i32.and - i32.store - local.get $1 - call $~lib/allocator/tlsf/Block#get:right - local.tee $4 - i32.eqz - if (result i32) - i32.const 0 - i32.const 8 - i32.const 368 - i32.const 25 - call $~lib/env/abort - unreachable - else - local.get $4 - end - local.set $4 - local.get $4 - local.get $4 - i32.load - global.get $~lib/allocator/tlsf/LEFT_FREE - i32.const -1 - i32.xor - i32.and - i32.store - end - local.get $1 - global.get $~lib/allocator/tlsf/Block.INFO - i32.add - ) - (func $~lib/allocator/tlsf/__memory_allocate (; 22 ;) (type $ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - global.get $~lib/allocator/tlsf/ROOT - local.set $1 - local.get $1 - i32.eqz - if - global.get $~lib/memory/HEAP_BASE - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - local.set $2 - current_memory - local.set $3 - local.get $2 - global.get $~lib/allocator/tlsf/Root.SIZE - i32.add - i32.const 65535 - i32.add - i32.const 65535 - i32.const -1 - i32.xor - i32.and - i32.const 16 - i32.shr_u - local.set $4 - local.get $4 - local.get $3 - i32.gt_s - local.tee $5 - if (result i32) - local.get $4 - local.get $3 - i32.sub - grow_memory - i32.const 0 - i32.lt_s - else - local.get $5 - end - if - unreachable - end - local.get $2 - local.tee $1 - global.set $~lib/allocator/tlsf/ROOT - local.get $1 - i32.const 0 - call $~lib/allocator/tlsf/Root#set:tailRef - local.get $1 - i32.const 0 - i32.store - block $break|0 - i32.const 0 - local.set $5 - loop $repeat|0 - local.get $5 - global.get $~lib/allocator/tlsf/FL_BITS - i32.lt_u - i32.eqz - br_if $break|0 - block - local.get $1 - local.get $5 - i32.const 0 - call $~lib/allocator/tlsf/Root#setSLMap - block $break|1 - i32.const 0 - local.set $6 - loop $repeat|1 - local.get $6 - global.get $~lib/allocator/tlsf/SL_SIZE - i32.lt_u - i32.eqz - br_if $break|1 - local.get $1 - local.get $5 - local.get $6 - i32.const 0 - call $~lib/allocator/tlsf/Root#setHead - local.get $6 - i32.const 1 - i32.add - local.set $6 - br $repeat|1 - unreachable - end - unreachable - end - end - local.get $5 - i32.const 1 - i32.add - local.set $5 - br $repeat|0 - unreachable - end - unreachable - end - local.get $1 - local.get $2 - global.get $~lib/allocator/tlsf/Root.SIZE - i32.add - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - current_memory - i32.const 16 - i32.shl - call $~lib/allocator/tlsf/Root#addMemory - drop - end - local.get $0 - global.get $~lib/allocator/tlsf/Block.MAX_SIZE - i32.gt_u - if - unreachable - end - local.get $0 - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - local.tee $4 - global.get $~lib/allocator/tlsf/Block.MIN_SIZE - local.tee $3 - local.get $4 - local.get $3 - i32.gt_u - select - local.set $0 - local.get $1 - local.get $0 - call $~lib/allocator/tlsf/Root#search - local.set $7 - local.get $7 - i32.eqz - if - current_memory - local.set $4 - local.get $0 - i32.const 65535 - i32.add - i32.const 65535 - i32.const -1 - i32.xor - i32.and - i32.const 16 - i32.shr_u - local.set $3 - local.get $4 - local.tee $2 - local.get $3 - local.tee $5 - local.get $2 - local.get $5 - i32.gt_s - select - local.set $2 - local.get $2 - grow_memory - i32.const 0 - i32.lt_s - if - local.get $3 - grow_memory - i32.const 0 - i32.lt_s - if - unreachable - end - end - current_memory - local.set $5 - local.get $1 - local.get $4 - i32.const 16 - i32.shl - local.get $5 - i32.const 16 - i32.shl - call $~lib/allocator/tlsf/Root#addMemory - drop - local.get $1 - local.get $0 - call $~lib/allocator/tlsf/Root#search - local.tee $6 - i32.eqz - if (result i32) - i32.const 0 - i32.const 8 - i32.const 480 - i32.const 12 - call $~lib/env/abort - unreachable - else - local.get $6 - end - local.set $7 - end - local.get $7 - i32.load - global.get $~lib/allocator/tlsf/TAGS - i32.const -1 - i32.xor - i32.and - local.get $0 - i32.ge_u - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 483 - i32.const 2 - call $~lib/env/abort - unreachable - end - local.get $1 - local.get $7 - local.get $0 - call $~lib/allocator/tlsf/Root#use - ) - (func $~lib/memory/memory.allocate (; 23 ;) (type $ii) (param $0 i32) (result i32) - local.get $0 - call $~lib/allocator/tlsf/__memory_allocate - return - ) - (func $~lib/allocator/tlsf/__memory_free (; 24 ;) (type $i_) (param $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - local.get $0 - if - global.get $~lib/allocator/tlsf/ROOT - local.set $1 - local.get $1 - if - local.get $0 - global.get $~lib/allocator/tlsf/Block.INFO - i32.sub - local.set $2 - local.get $2 - i32.load - local.set $3 - local.get $3 - global.get $~lib/allocator/tlsf/FREE - i32.and - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 494 - i32.const 6 - call $~lib/env/abort - unreachable - end - local.get $2 - local.get $3 - global.get $~lib/allocator/tlsf/FREE - i32.or - i32.store - local.get $1 - local.get $0 - global.get $~lib/allocator/tlsf/Block.INFO - i32.sub - call $~lib/allocator/tlsf/Root#insert - end - end - ) - (func $~lib/memory/memory.free (; 25 ;) (type $i_) (param $0 i32) - local.get $0 - call $~lib/allocator/tlsf/__memory_free - return - ) - (func $~lib/allocator/tlsf/__memory_reset (; 26 ;) (type $_) - unreachable - ) - (func $~lib/memory/memory.reset (; 27 ;) (type $_) - call $~lib/allocator/tlsf/__memory_reset - return - ) - (func $start (; 28 ;) (type $_) - call $start:assembly/index - ) - (func $null (; 29 ;) (type $_) - ) -) diff --git a/tests/binaryen/block-pre.js b/tests/binaryen/block-pre.js new file mode 100644 index 0000000000..90689be029 --- /dev/null +++ b/tests/binaryen/block-pre.js @@ -0,0 +1,26 @@ +var binaryen = require("binaryen"); +var mod = binaryen.parseText(` +(module + (global $ref (mut i32) (i32.const 1)) + (func $test + (call $release + (block (result i32) + (global.get $ref) + (global.set $ref + (call $retain + (i32.const 2) (; some-expression-that-might-conflict-with-a-temp ;) + ) + ) + ) + ) + ) + (func $retain (param i32) (result i32) + (local.get 0) + ) + (func $release (param i32) + (nop) + ) +) +`); +if (!mod.validate()) console.log(":-("); +else console.log(mod.emitText()); diff --git a/tests/binaryen/break-value.js b/tests/binaryen/break-value.js new file mode 100644 index 0000000000..dc280ddd90 --- /dev/null +++ b/tests/binaryen/break-value.js @@ -0,0 +1,24 @@ +var binaryen = require("binaryen"); + +var mod = new binaryen.Module(); +var ftype = mod.addFunctionType("ii", binaryen.i32, [ binaryen.i32 ]); +mod.addFunction("test", ftype, [], + mod.block("label", [ + mod.drop( // "br_if returns the value too" + mod.break("label", + // condition: $0 == 1 + mod.i32.eq( + mod.getLocal(0, binaryen.i32), + mod.i32.const(1) + ), + // value: 1 + mod.i32.const(1) + ) + ), + // push: 0 + mod.i32.const(0) + ], binaryen.i32) +); +console.log(mod.emitText()); + +mod.validate(); diff --git a/tests/binaryen/constant-indirect-arg.js b/tests/binaryen/constant-indirect-arg.js new file mode 100644 index 0000000000..080faed8db --- /dev/null +++ b/tests/binaryen/constant-indirect-arg.js @@ -0,0 +1,26 @@ +var binaryen = require("binaryen"); + +var mod = new binaryen.Module(); + +var ftype_v = mod.addFunctionType("v", binaryen.none, []); +var ftype_vi = mod.addFunctionType("vi", binaryen.none, [ binaryen.i32 ]); + +mod.addFunction("callee-2", ftype_v, [], mod.block(null, [ +])); +mod.addFunction("callee-1", ftype_vi, [], mod.block(null, [ + mod.call_indirect(mod.getLocal(0, binaryen.i32), [], "v"), +])); +mod.setFunctionTable(2, 2, [ "callee-1", "callee-2" ]); + +mod.addFunction("caller", ftype_vi, [ binaryen.i32 ], mod.block(null, [ + mod.call_indirect(mod.getLocal(0, binaryen.i32), [ mod.i32.const(1) ], "vi"), +])); +mod.addFunctionExport("caller", "main"); + +binaryen.setOptimizeLevel(4); +binaryen.setShrinkLevel(0); +binaryen.setDebugInfo(false); +mod.optimize(); +if (!mod.validate()) + console.log("-> does not validate"); +console.log(mod.emitText()); diff --git a/tests/binaryen/constant-indirect.js b/tests/binaryen/constant-indirect.js new file mode 100644 index 0000000000..2b017703de --- /dev/null +++ b/tests/binaryen/constant-indirect.js @@ -0,0 +1,22 @@ +var binaryen = require("binaryen"); + +var mod = new binaryen.Module(); + +var ftype = mod.addFunctionType("v", binaryen.none, []); + +mod.addFunction("callee", ftype, [], mod.block(null, [ +])); +mod.setFunctionTable(1, 1, [ "callee" ]); + +mod.addFunction("caller", ftype, [], mod.block(null, [ + mod.call_indirect(mod.i32.const(0), [], "v"), +])); +mod.addFunctionExport("caller", "main"); + +binaryen.setOptimizeLevel(4); +binaryen.setShrinkLevel(0); +binaryen.setDebugInfo(false); +mod.optimize(); +if (!mod.validate()) + console.log("-> does not validate"); +console.log(mod.emitText()); diff --git a/tests/compiler.js b/tests/compiler.js index 077e39b567..7db6ee9124 100644 --- a/tests/compiler.js +++ b/tests/compiler.js @@ -7,6 +7,7 @@ const colorsUtil = require("../cli/util/colors"); const optionsUtil = require("../cli/util/options"); const diff = require("./util/diff"); const asc = require("../cli/asc.js"); +const rtrace = require("../lib/rtrace"); const config = { "create": { @@ -28,6 +29,11 @@ const config = { ], "type": "b" }, + "rtraceVerbose": { + "description": [ + "Enables verbose rtrace output." + ] + }, "help": { "description": "Prints this message and exits.", "type": "b", @@ -52,9 +58,9 @@ if (args.help) { const features = process.env.ASC_FEATURES ? process.env.ASC_FEATURES.split(",") : []; const featuresConfig = require("./features.json"); -var failedTests = []; +var failedTests = new Set(); var failedMessages = new Map(); -var skippedTests = []; +var skippedTests = new Set(); var skippedMessages = new Map(); const basedir = path.join(__dirname, "compiler"); @@ -124,7 +130,7 @@ tests.forEach(filename => { }); if (missing_features.length) { console.log("- " + colorsUtil.yellow("feature SKIPPED") + " (" + missing_features.join(", ") + ")\n"); - skippedTests.push(basename); + skippedTests.add(basename); skippedMessages.set(basename, "feature not enabled"); return; } @@ -152,6 +158,8 @@ tests.forEach(filename => { Array.prototype.push.apply(cmd, asc_flags); if (args.createBinary) cmd.push("--binaryFile", basename + ".untouched.wasm"); + else + cmd.push("--binaryFile", "temp.wasm"); asc.main(cmd, { stdout: stdout, stderr: stderr @@ -164,7 +172,7 @@ tests.forEach(filename => { if (!stderrString.includes(expectedError)) { console.log(`Expected error "${expectedError}" was not in the error output.`); console.log("- " + colorsUtil.red("error check ERROR")); - failedTests.push(basename); + failedTests.add(basename); console.log(); return; } @@ -186,6 +194,7 @@ tests.forEach(filename => { if (expected != actual) { console.log("- " + colorsUtil.red("compare ERROR")); failed = true; + failedTests.add(basename); } else { console.log("- " + colorsUtil.green("compare OK")); } @@ -195,6 +204,7 @@ tests.forEach(filename => { console.log(diffs); console.log("- " + colorsUtil.red("diff ERROR")); failed = true; + failedTests.add(basename); } else { console.log("- " + colorsUtil.green("diff OK")); } @@ -212,7 +222,7 @@ tests.forEach(filename => { "--validate", "--measure", "--binaryFile", // -> stdout - "-O3" + "-O" ]; if (asc_flags) Array.prototype.push.apply(cmd, asc_flags); @@ -225,91 +235,23 @@ tests.forEach(filename => { console.log(); if (err) { stderr.write(err.stack + os.EOL); + failed = true; failedMessages.set(basename, err.message); - failedTests.push(basename); + failedTests.add(basename); return 1; } - - // Instantiate - try { - let memory = new WebAssembly.Memory({ initial: 10 }); - let exports = {}; - - function getString(ptr) { - if (!ptr) return "null"; - var U32 = new Uint32Array(exports.memory ? exports.memory.buffer : memory.buffer); - var U16 = new Uint16Array(exports.memory ? exports.memory.buffer : memory.buffer); - var dataLength = U32[ptr >>> 2]; - var dataOffset = (ptr + 4) >>> 1; - var dataRemain = dataLength; - var parts = []; - const chunkSize = 1024; - while (dataRemain > chunkSize) { - let last = U16[dataOffset + chunkSize - 1]; - let size = last >= 0xD800 && last < 0xDC00 ? chunkSize - 1 : chunkSize; - let part = U16.subarray(dataOffset, dataOffset += size); - parts.push(String.fromCharCode.apply(String, part)); - dataRemain -= size; - } - return parts.join("") + String.fromCharCode.apply(String, U16.subarray(dataOffset, dataOffset + dataRemain)); - } - - var binaryBuffer = stdout.toBuffer(); - if (args.createBinary) - fs.writeFileSync(path.join(basedir, basename + ".optimized.wasm"), binaryBuffer); - let runTime = asc.measure(() => { - exports = new WebAssembly.Instance(new WebAssembly.Module(binaryBuffer), { - env: { - memory, - abort: function(msg, file, line, column) { - console.log(colorsUtil.red(" abort: " + getString(msg) + " at " + getString(file) + ":" + line + ":" + column)); - }, - trace: function(msg, n) { - console.log(" trace: " + getString(msg) + (n ? " " : "") + Array.prototype.slice.call(arguments, 2, 2 + n).join(", ")); - }, - externalFunction: function() { }, - externalConstant: 1 - }, - math: { - mod: function(a, b) { return a % b; } - }, - Math, - Date, - - // tests/declare - declare: { - externalFunction: function() { }, - externalConstant: 1, - "my.externalFunction": function() { }, - "my.externalConstant": 2 - }, - - // tests/external - external: { - foo: function() {}, - "foo.bar": function() {}, - bar: function() {} - }, - foo: { - baz: function() {}, - "var": 3 - } - }).exports; - if (exports.main) { - console.log(colorsUtil.white(" [main]")); - var code = exports.main(); - console.log(colorsUtil.white(" [exit " + code + "]\n")); - } - }); - console.log("- " + colorsUtil.green("instantiate OK") + " (" + asc.formatTime(runTime) + ")"); - console.log("\n " + Object.keys(exports).map(key => "[" + (typeof exports[key]).substring(0, 3) + "] " + key).join("\n ")); - } catch (e) { - console.log("- " + colorsUtil.red("instantiate ERROR: ") + e.stack); + let untouchedBuffer = fs.readFileSync(path.join(basedir, "temp.wasm")); + let optimizedBuffer = stdout.toBuffer(); + if (!testInstantiate(basename, untouchedBuffer, "untouched")) { failed = true; - failedMessages.set(basename, e.message); + failedTests.add(basename); + } else { + console.log(); + if (!testInstantiate(basename, optimizedBuffer, "optimized")) { + failed = true; + failedTests.add(basename); + } } - - if (failed) failedTests.push(basename); console.log(); }); if (failed) return 1; @@ -317,17 +259,17 @@ tests.forEach(filename => { if (v8_no_flags) v8.setFlagsFromString(v8_no_flags); }); -if (skippedTests.length) { - console.log(colorsUtil.yellow("WARNING: ") + colorsUtil.white(skippedTests.length + " compiler tests have been skipped:\n")); +if (skippedTests.size) { + console.log(colorsUtil.yellow("WARNING: ") + colorsUtil.white(skippedTests.size + " compiler tests have been skipped:\n")); skippedTests.forEach(name => { var message = skippedMessages.has(name) ? colorsUtil.gray("[" + skippedMessages.get(name) + "]") : ""; console.log(" " + name + " " + message); }); console.log(); } -if (failedTests.length) { +if (failedTests.size) { process.exitCode = 1; - console.log(colorsUtil.red("ERROR: ") + colorsUtil.white(failedTests.length + " compiler tests had failures:\n")); + console.log(colorsUtil.red("ERROR: ") + colorsUtil.white(failedTests.size + " compiler tests had failures:\n")); failedTests.forEach(name => { var message = failedMessages.has(name) ? colorsUtil.gray("[" + failedMessages.get(name) + "]") : ""; console.log(" " + name + " " + message); @@ -337,3 +279,109 @@ if (failedTests.length) { if (!process.exitCode) { console.log("[ " + colorsUtil.white("OK") + " ]"); } + +function testInstantiate(basename, binaryBuffer, name) { + var failed = false; + try { + let memory = new WebAssembly.Memory({ initial: 10 }); + let exports = {}; + + function getString(ptr) { + const RUNTIME_HEADER_SIZE = 16; + if (!ptr) return "null"; + var U32 = new Uint32Array(exports.memory ? exports.memory.buffer : memory.buffer); + var U16 = new Uint16Array(exports.memory ? exports.memory.buffer : memory.buffer); + var len16 = U32[(ptr - RUNTIME_HEADER_SIZE + 12) >>> 2] >>> 1; + var ptr16 = ptr >>> 1; + return String.fromCharCode.apply(String, U16.subarray(ptr16, ptr16 + len16)); + } + + function onerror(e) { + console.log(" ERROR: " + e); + failed = true; + failedMessages.set(basename, e.message); + } + + function oninfo(i) { + console.log(" " + i); + } + + let rtr = rtrace(onerror, args.rtraceVerbose ? oninfo : null); + + let runTime = asc.measure(() => { + exports = new WebAssembly.Instance(new WebAssembly.Module(binaryBuffer), { + rtrace: rtr, + env: { + memory, + abort: function(msg, file, line, column) { + console.log(colorsUtil.red(" abort: " + getString(msg) + " at " + getString(file) + ":" + line + ":" + column)); + }, + trace: function(msg, n) { + console.log(" trace: " + getString(msg) + (n ? " " : "") + Array.prototype.slice.call(arguments, 2, 2 + n).join(", ")); + }, + externalFunction: function() { }, + externalConstant: 1 + }, + + // bindings + Math, + Date, + + // tests/math + math: { + mod: function(a, b) { return a % b; } + }, + + // tests/declare + declare: { + externalFunction: function() { }, + externalConstant: 1, + "my.externalFunction": function() { }, + "my.externalConstant": 2 + }, + + // tests/external + external: { + foo: function() {}, + "foo.bar": function() {}, + bar: function() {} + }, + foo: { + baz: function() {}, + "var": 3 + } + }).exports; + if (exports.__start) { + console.log(colorsUtil.white(" [start]")); + exports.__start(); + } + }); + let leakCount = rtr.check(); + if (leakCount) { + let msg = "memory leak detected: " + leakCount + " leaking"; + console.log("- " + colorsUtil.red("rtrace " + name + " ERROR: ") + msg); + failed = true; + failedMessages.set(basename, msg); + } + if (!failed) { + console.log("- " + colorsUtil.green("instantiate " + name + " OK") + " (" + asc.formatTime(runTime) + ")"); + if (rtr.active) { + console.log(" " + + rtr.allocCount + " allocs, " + + rtr.freeCount + " frees, " + + rtr.incrementCount + " increments, " + + rtr.decrementCount + " decrements" + ); + } + console.log("\n " + Object.keys(exports).map(key => { + return "[" + (typeof exports[key]).substring(0, 3) + "] " + key + " = " + exports[key] + }).join("\n ")); + return true; + } + } catch (e) { + console.log("- " + colorsUtil.red("instantiate " + name + " ERROR: ") + e.stack); + failed = true; + failedMessages.set(basename, e.message); + } + return false; +} diff --git a/tests/compiler/abi.json b/tests/compiler/abi.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/abi.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/abi.optimized.wat b/tests/compiler/abi.optimized.wat index d8df07cdda..8e470f0dbd 100644 --- a/tests/compiler/abi.optimized.wat +++ b/tests/compiler/abi.optimized.wat @@ -2,15 +2,12 @@ (type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\06\00\00\00a\00b\00i\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $null) + (data (i32.const 8) "\0c\00\00\00\01\00\00\00\01\00\00\00\0c\00\00\00a\00b\00i\00.\00t\00s") (global $abi/condition (mut i32) (i32.const 0)) (global $abi/y (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "exported" (func $abi/exported)) (export "exportedExported" (func $abi/exported)) (export "exportedInternal" (func $abi/exported)) @@ -26,10 +23,10 @@ global.get $abi/y if i32.const 0 - i32.const 8 + i32.const 24 i32.const 65 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/abi.untouched.wat b/tests/compiler/abi.untouched.wat index f0b87c252d..93d816db12 100644 --- a/tests/compiler/abi.untouched.wat +++ b/tests/compiler/abi.untouched.wat @@ -2,16 +2,14 @@ (type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\06\00\00\00a\00b\00i\00.\00t\00s\00") + (data (i32.const 8) "\0c\00\00\00\01\00\00\00\01\00\00\00\0c\00\00\00a\00b\00i\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) (global $abi/condition (mut i32) (i32.const 0)) (global $abi/y (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 24)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "exported" (func $abi/exported)) (export "exportedExported" (func $abi/exportedExported)) (export "exportedInternal" (func $abi/exportedInternal)) @@ -39,10 +37,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 32 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end end @@ -78,10 +76,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 45 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end end @@ -109,10 +107,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 58 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end end @@ -128,10 +126,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 65 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end end @@ -145,10 +143,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 72 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -160,10 +158,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 74 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2 @@ -173,10 +171,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 77 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -186,10 +184,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 79 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end end diff --git a/tests/compiler/asc-constants.json b/tests/compiler/asc-constants.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/asc-constants.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/asc-constants.optimized.wat b/tests/compiler/asc-constants.optimized.wat index 86b388ad0a..e2acb0a3b8 100644 --- a/tests/compiler/asc-constants.optimized.wat +++ b/tests/compiler/asc-constants.optimized.wat @@ -1,10 +1,7 @@ (module (type $FUNCSIG$v (func)) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $start) (export "memory" (memory $0)) - (export "table" (table $0)) (func $start (; 0 ;) (type $FUNCSIG$v) nop ) diff --git a/tests/compiler/asc-constants.untouched.wat b/tests/compiler/asc-constants.untouched.wat index 1ccafb9b5e..3edd831f17 100644 --- a/tests/compiler/asc-constants.untouched.wat +++ b/tests/compiler/asc-constants.untouched.wat @@ -13,12 +13,10 @@ (global $~lib/ASC_FEATURE_BULK_MEMORY i32 (i32.const 0)) (global $~lib/ASC_FEATURE_SIMD i32 (i32.const 0)) (global $~lib/ASC_FEATURE_THREADS i32 (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $start:asc-constants (; 0 ;) (type $FUNCSIG$v) - i32.const 1 + i32.const 0 drop i32.const 0 drop diff --git a/tests/compiler/assert-nonnull.json b/tests/compiler/assert-nonnull.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/assert-nonnull.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/assert-nonnull.optimized.wat b/tests/compiler/assert-nonnull.optimized.wat new file mode 100644 index 0000000000..ed5bd82378 --- /dev/null +++ b/tests/compiler/assert-nonnull.optimized.wat @@ -0,0 +1,194 @@ +(module + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$i (func (result i32))) + (type $FUNCSIG$v (func)) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (memory $0 1) + (data (i32.const 8) "^\00\00\00\01\00\00\00\01\00\00\00^\00\00\00E\00l\00e\00m\00e\00n\00t\00 \00t\00y\00p\00e\00 \00m\00u\00s\00t\00 \00b\00e\00 \00n\00u\00l\00l\00a\00b\00l\00e\00 \00i\00f\00 \00a\00r\00r\00a\00y\00 \00i\00s\00 \00h\00o\00l\00e\00y") + (data (i32.const 120) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s") + (data (i32.const 168) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $~lib/argc (mut i32) (i32.const 0)) + (export "memory" (memory $0)) + (export "testVar" (func $assert-nonnull/testVar)) + (export "testObj" (func $assert-nonnull/testObj)) + (export "testProp" (func $assert-nonnull/testProp)) + (export "testArr" (func $assert-nonnull/testArr)) + (export "testElem" (func $assert-nonnull/testElem)) + (export "testAll" (func $assert-nonnull/testAll)) + (export "testAll2" (func $assert-nonnull/testAll)) + (export "testFn" (func $assert-nonnull/testFn)) + (export "testFn2" (func $assert-nonnull/testFn2)) + (export "testRet" (func $assert-nonnull/testRet)) + (export "testObjFn" (func $assert-nonnull/testObjFn)) + (export "testObjRet" (func $assert-nonnull/testObjRet)) + (func $assert-nonnull/testVar (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + unreachable + end + local.get $0 + ) + (func $assert-nonnull/testObj (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + unreachable + end + local.get $0 + i32.load + ) + (func $assert-nonnull/testProp (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load + local.tee $0 + i32.eqz + if + unreachable + end + local.get $0 + ) + (func $~lib/array/Array#__unchecked_get (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=4 + i32.load + ) + (func $~lib/array/Array#__get (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.const 0 + local.get $0 + i32.load offset=12 + i32.ge_u + if + i32.const 24 + i32.const 136 + i32.const 106 + i32.const 45 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ge_u + if + i32.const 184 + i32.const 136 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/array/Array#__unchecked_get + ) + (func $assert-nonnull/testArr (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + unreachable + end + local.get $0 + call $~lib/array/Array#__get + ) + (func $~lib/array/Array#__get (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.const 0 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ge_u + if + i32.const 184 + i32.const 136 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/array/Array#__unchecked_get + ) + (func $assert-nonnull/testElem (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + call $~lib/array/Array#__get + ) + (func $assert-nonnull/testAll (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + unreachable + end + local.get $0 + call $~lib/array/Array#__get + i32.load + local.tee $0 + i32.eqz + if + unreachable + end + local.get $0 + ) + (func $assert-nonnull/testFn (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.const 0 + global.set $~lib/argc + local.get $0 + call_indirect (type $FUNCSIG$i) + ) + (func $assert-nonnull/testFn2 (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + unreachable + end + i32.const 0 + global.set $~lib/argc + local.get $0 + call_indirect (type $FUNCSIG$i) + ) + (func $assert-nonnull/testRet (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + i32.const 0 + global.set $~lib/argc + local.get $0 + call_indirect (type $FUNCSIG$i) + local.tee $0 + local.set $1 + local.get $0 + i32.eqz + if + unreachable + end + local.get $1 + ) + (func $assert-nonnull/testObjFn (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.const 0 + global.set $~lib/argc + local.get $0 + i32.load offset=4 + call_indirect (type $FUNCSIG$i) + ) + (func $assert-nonnull/testObjRet (; 14 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + i32.const 0 + global.set $~lib/argc + local.get $0 + i32.load offset=4 + call_indirect (type $FUNCSIG$i) + local.tee $0 + local.set $1 + local.get $0 + i32.eqz + if + unreachable + end + local.get $1 + ) + (func $null (; 15 ;) (type $FUNCSIG$v) + nop + ) +) diff --git a/tests/compiler/nonNullAssertion.ts b/tests/compiler/assert-nonnull.ts similarity index 93% rename from tests/compiler/nonNullAssertion.ts rename to tests/compiler/assert-nonnull.ts index 73aa8be880..b50dcb9a9b 100644 --- a/tests/compiler/nonNullAssertion.ts +++ b/tests/compiler/assert-nonnull.ts @@ -1,5 +1,3 @@ -import "allocator/arena"; - export function testVar(n: Error | null): Error { return n!; } @@ -30,7 +28,7 @@ export function testAll(foo: Array | null): Foo { } export function testAll2(foo: Array | null): Foo { - return foo!![0]!!!.bar!!!!; + return foo!![0]!!.bar!!; // 3x AS225: Expression is never 'null' } export function testFn(fn: (() => Foo | null) | null): Foo | null { diff --git a/tests/compiler/assert-nonnull.untouched.wat b/tests/compiler/assert-nonnull.untouched.wat new file mode 100644 index 0000000000..780007f7bd --- /dev/null +++ b/tests/compiler/assert-nonnull.untouched.wat @@ -0,0 +1,375 @@ +(module + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$i (func (result i32))) + (type $FUNCSIG$v (func)) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (memory $0 1) + (data (i32.const 8) "^\00\00\00\01\00\00\00\01\00\00\00^\00\00\00E\00l\00e\00m\00e\00n\00t\00 \00t\00y\00p\00e\00 \00m\00u\00s\00t\00 \00b\00e\00 \00n\00u\00l\00l\00a\00b\00l\00e\00 \00i\00f\00 \00a\00r\00r\00a\00y\00 \00i\00s\00 \00h\00o\00l\00e\00y\00") + (data (i32.const 120) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") + (data (i32.const 168) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $~lib/argc (mut i32) (i32.const 0)) + (export "memory" (memory $0)) + (export "testVar" (func $assert-nonnull/testVar)) + (export "testObj" (func $assert-nonnull/testObj)) + (export "testProp" (func $assert-nonnull/testProp)) + (export "testArr" (func $assert-nonnull/testArr)) + (export "testElem" (func $assert-nonnull/testElem)) + (export "testAll" (func $assert-nonnull/testAll)) + (export "testAll2" (func $assert-nonnull/testAll2)) + (export "testFn" (func $assert-nonnull/testFn)) + (export "testFn2" (func $assert-nonnull/testFn2)) + (export "testRet" (func $assert-nonnull/testRet)) + (export "testObjFn" (func $assert-nonnull/testObjFn)) + (export "testObjRet" (func $assert-nonnull/testObjRet)) + (func $~lib/rt/stub/__retain (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + ) + (func $~lib/rt/stub/__release (; 2 ;) (type $FUNCSIG$vi) (param $0 i32) + nop + ) + (func $assert-nonnull/testVar (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $0 + local.tee $1 + if (result i32) + local.get $1 + else + unreachable + end + call $~lib/rt/stub/__retain + local.set $1 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + ) + (func $assert-nonnull/testObj (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $0 + local.tee $1 + if (result i32) + local.get $1 + else + unreachable + end + i32.load + call $~lib/rt/stub/__retain + local.set $1 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + ) + (func $assert-nonnull/testProp (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $0 + i32.load + local.tee $1 + if (result i32) + local.get $1 + else + unreachable + end + call $~lib/rt/stub/__retain + local.set $1 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + ) + (func $~lib/array/Array#__unchecked_get (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + i32.load + call $~lib/rt/stub/__retain + ) + (func $~lib/array/Array#__get (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 + local.get $0 + i32.load offset=12 + i32.ge_u + if + i32.const 24 + i32.const 136 + i32.const 106 + i32.const 45 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ge_u + if + i32.const 184 + i32.const 136 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/array/Array#__unchecked_get + ) + (func $assert-nonnull/testArr (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $0 + local.tee $1 + if (result i32) + local.get $1 + else + unreachable + end + i32.const 0 + call $~lib/array/Array#__get + local.set $1 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + ) + (func $~lib/array/Array#__unchecked_get (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + i32.load + call $~lib/rt/stub/__retain + ) + (func $~lib/array/Array#__get (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ge_u + if + i32.const 184 + i32.const 136 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/array/Array#__unchecked_get + ) + (func $assert-nonnull/testElem (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $0 + i32.const 0 + call $~lib/array/Array#__get + local.tee $1 + call $~lib/rt/stub/__retain + local.set $2 + local.get $1 + call $~lib/rt/stub/__release + local.get $0 + call $~lib/rt/stub/__release + local.get $2 + ) + (func $assert-nonnull/testAll (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $0 + local.tee $1 + if (result i32) + local.get $1 + else + unreachable + end + i32.const 0 + call $~lib/array/Array#__get + local.tee $1 + i32.load + local.tee $2 + if (result i32) + local.get $2 + else + unreachable + end + call $~lib/rt/stub/__retain + local.set $2 + local.get $1 + call $~lib/rt/stub/__release + local.get $0 + call $~lib/rt/stub/__release + local.get $2 + ) + (func $assert-nonnull/testAll2 (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $0 + local.tee $1 + if (result i32) + local.get $1 + else + unreachable + end + i32.const 0 + call $~lib/array/Array#__get + local.tee $1 + i32.load + local.tee $2 + if (result i32) + local.get $2 + else + unreachable + end + call $~lib/rt/stub/__retain + local.set $2 + local.get $1 + call $~lib/rt/stub/__release + local.get $0 + call $~lib/rt/stub/__release + local.get $2 + ) + (func $assert-nonnull/testFn (; 14 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + block (result i32) + i32.const 0 + global.set $~lib/argc + local.get $0 + call_indirect (type $FUNCSIG$i) + local.tee $1 + end + call $~lib/rt/stub/__retain + local.set $2 + local.get $1 + call $~lib/rt/stub/__release + local.get $2 + ) + (func $assert-nonnull/testFn2 (; 15 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + local.tee $1 + if (result i32) + local.get $1 + else + unreachable + end + local.set $2 + block (result i32) + i32.const 0 + global.set $~lib/argc + local.get $2 + call_indirect (type $FUNCSIG$i) + local.tee $1 + end + call $~lib/rt/stub/__retain + local.set $3 + local.get $1 + call $~lib/rt/stub/__release + local.get $3 + ) + (func $assert-nonnull/testRet (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + block (result i32) + i32.const 0 + global.set $~lib/argc + local.get $0 + call_indirect (type $FUNCSIG$i) + local.tee $1 + end + local.tee $2 + if (result i32) + local.get $2 + else + unreachable + end + call $~lib/rt/stub/__retain + local.set $2 + local.get $1 + call $~lib/rt/stub/__release + local.get $2 + ) + (func $assert-nonnull/testObjFn (; 17 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + block (result i32) + i32.const 0 + global.set $~lib/argc + local.get $0 + i32.load offset=4 + call_indirect (type $FUNCSIG$i) + local.tee $1 + end + call $~lib/rt/stub/__retain + local.set $2 + local.get $1 + call $~lib/rt/stub/__release + local.get $0 + call $~lib/rt/stub/__release + local.get $2 + ) + (func $assert-nonnull/testObjRet (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + block (result i32) + i32.const 0 + global.set $~lib/argc + local.get $0 + i32.load offset=4 + call_indirect (type $FUNCSIG$i) + local.tee $1 + end + local.tee $2 + if (result i32) + local.get $2 + else + unreachable + end + call $~lib/rt/stub/__retain + local.set $2 + local.get $1 + call $~lib/rt/stub/__release + local.get $0 + call $~lib/rt/stub/__release + local.get $2 + ) + (func $null (; 19 ;) (type $FUNCSIG$v) + ) +) diff --git a/tests/compiler/assert.json b/tests/compiler/assert.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/assert.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/assert.optimized.wat b/tests/compiler/assert.optimized.wat index 56e77c21a5..b90324ac9b 100644 --- a/tests/compiler/assert.optimized.wat +++ b/tests/compiler/assert.optimized.wat @@ -1,12 +1,9 @@ (module (type $FUNCSIG$v (func)) (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") - (table $0 1 funcref) - (elem (i32.const 0) $start) + (data (i32.const 8) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\00a\00s\00s\00e\00r\00t\00.\00t\00s") + (data (i32.const 48) "\18\00\00\00\01\00\00\00\01\00\00\00\18\00\00\00m\00u\00s\00t\00 \00b\00e\00 \00t\00r\00u\00e") (export "memory" (memory $0)) - (export "table" (table $0)) (func $start (; 0 ;) (type $FUNCSIG$v) nop ) diff --git a/tests/compiler/assert.untouched.wat b/tests/compiler/assert.untouched.wat index c9f2eafc38..413ab66a84 100644 --- a/tests/compiler/assert.untouched.wat +++ b/tests/compiler/assert.untouched.wat @@ -1,15 +1,13 @@ (module (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/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\00") - (data (i32.const 32) "\0c\00\00\00m\00u\00s\00t\00 \00b\00e\00 \00t\00r\00u\00e\00") + (data (i32.const 8) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\00a\00s\00s\00e\00r\00t\00.\00t\00s\00") + (data (i32.const 48) "\18\00\00\00\01\00\00\00\01\00\00\00\18\00\00\00m\00u\00s\00t\00 \00b\00e\00 \00t\00r\00u\00e\00") (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/memory/HEAP_BASE i32 (i32.const 60)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $start:assert (; 1 ;) (type $FUNCSIG$v) (local $0 i32) @@ -17,20 +15,20 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -39,10 +37,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -50,10 +48,10 @@ f64.eq if i32.const 0 - i32.const 8 + i32.const 24 i32.const 4 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -62,20 +60,20 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 5 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 4294967296 i64.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 6 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 4294967296 @@ -84,10 +82,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 7 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -95,11 +93,11 @@ if (result i32) local.get $0 else - i32.const 32 - i32.const 8 + i32.const 64 + i32.const 24 i32.const 10 i32.const 5 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.eqz diff --git a/tests/compiler/basic-nullable.json b/tests/compiler/basic-nullable.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/basic-nullable.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/binary.json b/tests/compiler/binary.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/binary.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/binary.optimized.wat b/tests/compiler/binary.optimized.wat index 9edaf4902e..cfa4016d55 100644 --- a/tests/compiler/binary.optimized.wat +++ b/tests/compiler/binary.optimized.wat @@ -3,70 +3,47 @@ (type $FUNCSIG$dd (func (param f64) (result f64))) (type $FUNCSIG$ff (func (param f32) (result f32))) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $null) (global $binary/b (mut i32) (i32.const 0)) (global $binary/i (mut i32) (i32.const 0)) (global $binary/I (mut i64) (i64.const 0)) (global $binary/f (mut f32) (f32.const 0)) (global $binary/F (mut f64) (f64.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $~lib/math/NativeMath.pow (; 0 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i32) (local $2 i64) (local $3 i32) - (local $4 i32) - (local $5 i32) local.get $0 i64.reinterpret_f64 local.tee $2 + i64.const 32 + i64.shr_u i32.wrap_i64 - local.set $3 - block (result i32) - block (result i32) - block (result i32) - local.get $2 - i64.const 32 - i64.shr_u - i32.wrap_i64 - local.tee $4 - i32.const 2147483647 - i32.and - local.tee $5 - i32.const 2146435072 - i32.gt_s - local.tee $1 - i32.eqz - if - local.get $5 - i32.const 2146435072 - i32.eq - local.tee $1 - if - local.get $3 - i32.const 0 - i32.ne - local.set $1 - end - end - local.get $1 - i32.eqz - end - if - i32.const 0 - local.set $1 - end - local.get $1 - i32.eqz - end - if - i32.const 0 - local.set $1 - end - local.get $1 - end + local.set $1 + i32.const 1 + i32.const 0 + i32.const 1 + i32.const 0 + i32.const 1 + local.get $2 + i32.wrap_i64 + i32.const 0 + i32.ne + i32.const 0 + local.get $1 + i32.const 2147483647 + i32.and + local.tee $3 + i32.const 2146435072 + i32.eq + select + local.get $3 + i32.const 2146435072 + i32.gt_s + select + select + select if local.get $0 f64.const 1 @@ -82,22 +59,20 @@ (local $4 i32) local.get $0 i32.reinterpret_f32 - local.tee $3 - i32.const 23 - i32.shr_u - i32.const 255 - i32.and - local.set $2 - local.get $3 + local.tee $2 i32.const -2147483648 i32.and local.set $4 local.get $2 + i32.const 23 + i32.shr_u + i32.const 255 + i32.and + local.tee $3 i32.const 255 i32.eq - local.tee $1 if (result i32) - local.get $1 + i32.const 1 else i32.const 0 end @@ -108,7 +83,7 @@ return end block $folding-inner0 - local.get $3 + local.get $2 i32.const 1 i32.shl local.tee $1 @@ -122,36 +97,36 @@ local.get $0 return end - local.get $2 + local.get $3 if (result i32) - local.get $3 + local.get $2 i32.const 8388607 i32.and i32.const 8388608 i32.or else - local.get $3 - i32.const 1 local.get $2 + i32.const 1 local.get $3 + local.get $2 i32.const 9 i32.shl i32.clz i32.sub - local.tee $2 + local.tee $3 i32.sub i32.shl end local.set $1 loop $continue|0 - local.get $2 + local.get $3 i32.const 127 i32.gt_s if local.get $1 i32.const 8388608 i32.ge_u - if + if (result i32) local.get $1 i32.const 8388608 i32.eq @@ -159,16 +134,16 @@ local.get $1 i32.const 8388608 i32.sub - local.set $1 + else + local.get $1 end - local.get $1 i32.const 1 i32.shl local.set $1 - local.get $2 + local.get $3 i32.const 1 i32.sub - local.set $2 + local.set $3 br $continue|0 end end @@ -190,27 +165,27 @@ i32.const 8 i32.shl i32.clz - local.tee $3 + local.tee $1 i32.shl - local.set $1 - local.get $2 + local.set $2 local.get $3 + local.get $1 i32.sub - local.tee $2 + local.tee $1 i32.const 0 i32.gt_s if (result i32) - local.get $1 + local.get $2 i32.const 8388608 i32.sub - local.get $2 + local.get $1 i32.const 23 i32.shl i32.or else - local.get $1 - i32.const 1 local.get $2 + i32.const 1 + local.get $1 i32.sub i32.shr_u end @@ -225,23 +200,16 @@ ) (func $~lib/math/NativeMathf.pow (; 2 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 i32) - (local $2 i32) - block (result i32) - local.get $0 - i32.reinterpret_f32 - local.tee $2 - i32.const 2147483647 - i32.and - i32.const 2139095040 - i32.gt_s - local.tee $1 - i32.eqz - if - i32.const 0 - local.set $1 - end - local.get $1 - end + i32.const 1 + i32.const 0 + local.get $0 + i32.reinterpret_f32 + local.tee $1 + i32.const 2147483647 + i32.and + i32.const 2139095040 + i32.gt_s + select if local.get $0 f32.const 1 @@ -255,25 +223,22 @@ (local $2 i64) (local $3 i64) (local $4 i64) - (local $5 i32) local.get $0 i64.reinterpret_f64 - local.tee $1 - i64.const 52 - i64.shr_u - i64.const 2047 - i64.and - local.set $2 - local.get $1 + local.tee $2 i64.const 63 i64.shr_u local.set $4 local.get $2 + i64.const 52 + i64.shr_u + i64.const 2047 + i64.and + local.tee $3 i64.const 2047 i64.eq - local.tee $5 if (result i32) - local.get $5 + i32.const 1 else i32.const 0 end @@ -284,38 +249,38 @@ return end block $folding-inner0 - local.get $1 + local.get $2 i64.const 1 i64.shl - local.tee $3 + local.tee $1 i64.const 9214364837600034816 i64.le_u if - local.get $3 + local.get $1 i64.const 9214364837600034816 i64.eq br_if $folding-inner0 local.get $0 return end - local.get $2 + local.get $3 i64.eqz if (result i64) - local.get $1 + local.get $2 i64.const 0 + local.get $3 local.get $2 - local.get $1 i64.const 12 i64.shl i64.clz i64.sub - local.tee $2 + local.tee $3 i64.sub i64.const 1 i64.add i64.shl else - local.get $1 + local.get $2 i64.const 4503599627370495 i64.and i64.const 4503599627370496 @@ -323,14 +288,14 @@ end local.set $1 loop $continue|0 - local.get $2 + local.get $3 i64.const 1023 i64.gt_s if local.get $1 i64.const 4503599627370496 i64.ge_u - if + if (result i64) local.get $1 i64.const 4503599627370496 i64.eq @@ -338,16 +303,16 @@ local.get $1 i64.const 4503599627370496 i64.sub - local.set $1 + else + local.get $1 end - local.get $1 i64.const 1 i64.shl local.set $1 - local.get $2 + local.get $3 i64.const 1 i64.sub - local.set $2 + local.set $3 br $continue|0 end end @@ -369,27 +334,27 @@ i64.const 11 i64.shl i64.clz - local.tee $3 + local.tee $1 i64.shl - local.set $1 - local.get $2 + local.set $2 local.get $3 + local.get $1 i64.sub - local.tee $2 + local.tee $1 i64.const 0 i64.gt_s if (result i64) - local.get $1 + local.get $2 i64.const 4503599627370496 i64.sub - local.get $2 + local.get $1 i64.const 52 i64.shl i64.or else - local.get $1 - i64.const 0 local.get $2 + i64.const 0 + local.get $1 i64.sub i64.const 1 i64.add @@ -407,45 +372,39 @@ f64.mul ) (func $start:binary (; 4 ;) (type $FUNCSIG$v) - (local $0 i32) - (local $1 i64) - (local $2 f32) - (local $3 f64) - (local $4 i32) global.get $binary/i - local.tee $0 i32.const 1 i32.rem_s drop - local.get $0 + global.get $binary/i f64.convert_i32_s call $~lib/math/NativeMath.pow drop global.get $binary/i - local.tee $0 i32.const 1 i32.lt_s global.set $binary/b - local.get $0 + global.get $binary/i i32.const 1 i32.gt_s global.set $binary/b - local.get $0 + global.get $binary/i i32.const 1 i32.le_s global.set $binary/b - local.get $0 + global.get $binary/i i32.const 1 i32.ge_s global.set $binary/b - local.get $0 + global.get $binary/i i32.const 1 i32.eq - local.tee $4 global.set $binary/b - local.get $4 + global.get $binary/i + i32.const 1 + i32.eq global.set $binary/b - local.get $0 + global.get $binary/i i32.const 1 i32.add global.set $binary/i @@ -523,39 +482,38 @@ i32.xor global.set $binary/i global.get $binary/I - local.tee $1 i64.const 1 i64.rem_s drop - local.get $1 + global.get $binary/I f64.convert_i64_s call $~lib/math/NativeMath.pow drop global.get $binary/I - local.tee $1 i64.const 1 i64.lt_s global.set $binary/b - local.get $1 + global.get $binary/I i64.const 1 i64.gt_s global.set $binary/b - local.get $1 + global.get $binary/I i64.const 1 i64.le_s global.set $binary/b - local.get $1 + global.get $binary/I i64.const 1 i64.ge_s global.set $binary/b - local.get $1 + global.get $binary/I i64.const 1 i64.eq - local.tee $0 global.set $binary/b - local.get $0 + global.get $binary/I + i64.const 1 + i64.eq global.set $binary/b - local.get $1 + global.get $binary/I i64.const 1 i64.add global.set $binary/I @@ -639,30 +597,30 @@ call $~lib/math/NativeMathf.pow drop global.get $binary/f - local.tee $2 f32.const 1 f32.lt global.set $binary/b - local.get $2 + global.get $binary/f f32.const 1 f32.gt global.set $binary/b - local.get $2 + global.get $binary/f f32.const 1 f32.le global.set $binary/b - local.get $2 + global.get $binary/f f32.const 1 f32.ge global.set $binary/b - local.get $2 + global.get $binary/f f32.const 1 f32.eq - local.tee $0 global.set $binary/b - local.get $0 + global.get $binary/f + f32.const 1 + f32.eq global.set $binary/b - local.get $2 + global.get $binary/f f32.const 1 f32.add global.set $binary/f @@ -697,30 +655,30 @@ call $~lib/math/NativeMath.pow drop global.get $binary/F - local.tee $3 f64.const 1 f64.lt global.set $binary/b - local.get $3 + global.get $binary/F f64.const 1 f64.gt global.set $binary/b - local.get $3 + global.get $binary/F f64.const 1 f64.le global.set $binary/b - local.get $3 + global.get $binary/F f64.const 1 f64.ge global.set $binary/b - local.get $3 + global.get $binary/F f64.const 1 f64.eq - local.tee $0 global.set $binary/b - local.get $0 + global.get $binary/F + f64.const 1 + f64.eq global.set $binary/b - local.get $3 + global.get $binary/F f64.const 1 f64.add global.set $binary/F diff --git a/tests/compiler/binary.untouched.wat b/tests/compiler/binary.untouched.wat index d029b4474b..38ab0e52ec 100644 --- a/tests/compiler/binary.untouched.wat +++ b/tests/compiler/binary.untouched.wat @@ -2,7 +2,9 @@ (type $FUNCSIG$ddd (func (param f64 f64) (result f64))) (type $FUNCSIG$ddi (func (param f64 i32) (result f64))) (type $FUNCSIG$fff (func (param f32 f32) (result f32))) + (type $FUNCSIG$if (func (param f32) (result i32))) (type $FUNCSIG$ffi (func (param f32 i32) (result f32))) + (type $FUNCSIG$id (func (param f64) (result i32))) (type $FUNCSIG$v (func)) (memory $0 0) (table $0 1 funcref) @@ -12,9 +14,7 @@ (global $binary/I (mut i64) (i64.const 0)) (global $binary/f (mut f32) (f32.const 0)) (global $binary/F (mut f64) (f64.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $~lib/math/NativeMath.scalbn (; 0 ;) (type $FUNCSIG$ddi) (param $0 f64) (param $1 i32) (result f64) (local $2 f64) @@ -190,44 +190,39 @@ local.get $7 i32.const 2146435072 i32.gt_s - local.tee $9 if (result i32) - local.get $9 + i32.const 1 else local.get $7 i32.const 2146435072 i32.eq - local.tee $9 if (result i32) local.get $4 i32.const 0 i32.ne else - local.get $9 + i32.const 0 end end - local.tee $9 if (result i32) - local.get $9 + i32.const 1 else local.get $8 i32.const 2146435072 i32.gt_s end - local.tee $9 if (result i32) - local.get $9 + i32.const 1 else local.get $8 i32.const 2146435072 i32.eq - local.tee $9 if (result i32) local.get $6 i32.const 0 i32.ne else - local.get $9 + i32.const 0 end end if @@ -237,7 +232,7 @@ return end i32.const 0 - local.set $10 + local.set $9 local.get $3 i32.const 0 i32.lt_s @@ -247,7 +242,7 @@ i32.ge_s if i32.const 2 - local.set $10 + local.set $9 else local.get $8 i32.const 1072693248 @@ -258,21 +253,21 @@ i32.shr_s i32.const 1023 i32.sub - local.set $11 - local.get $11 + local.set $10 + local.get $10 i32.const 20 i32.gt_s - local.set $9 + local.set $11 i32.const 52 i32.const 20 - local.get $9 - select local.get $11 + select + local.get $10 i32.sub local.set $12 local.get $6 local.get $8 - local.get $9 + local.get $11 select local.set $13 local.get $13 @@ -290,7 +285,7 @@ i32.const 1 i32.and i32.sub - local.set $10 + local.set $9 end end end @@ -393,17 +388,15 @@ local.get $7 i32.const 0 i32.eq - local.tee $14 if (result i32) - local.get $14 + i32.const 1 else local.get $7 i32.const 2146435072 i32.eq end - local.tee $14 if (result i32) - local.get $14 + i32.const 1 else local.get $7 i32.const 1072693248 @@ -428,7 +421,7 @@ local.get $7 i32.const 1072693248 i32.sub - local.get $10 + local.get $9 i32.or i32.const 0 i32.eq @@ -442,7 +435,7 @@ f64.div local.set $16 else - local.get $10 + local.get $9 i32.const 1 i32.eq if @@ -462,7 +455,7 @@ i32.const 0 i32.lt_s if - local.get $10 + local.get $9 i32.const 0 i32.eq if @@ -475,7 +468,7 @@ f64.div return end - local.get $10 + local.get $9 i32.const 1 i32.eq if @@ -661,17 +654,17 @@ i32.le_s if i32.const 0 - local.set $11 + local.set $10 else local.get $28 i32.const 767610 i32.lt_s if i32.const 1 - local.set $11 + local.set $10 else i32.const 0 - local.set $11 + local.set $10 local.get $29 i32.const 1 i32.add @@ -695,7 +688,7 @@ local.set $15 f64.const 1.5 f64.const 1 - local.get $11 + local.get $10 select local.set $35 local.get $15 @@ -727,7 +720,7 @@ i32.or i32.const 524288 i32.add - local.get $11 + local.get $10 i32.const 18 i32.shl i32.add @@ -850,7 +843,7 @@ local.set $36 f64.const 1.350039202129749e-08 f64.const 0 - local.get $11 + local.get $10 select local.set $37 f64.const -7.028461650952758e-09 @@ -868,7 +861,7 @@ local.set $24 f64.const 0.5849624872207642 f64.const 0 - local.get $11 + local.get $10 select local.set $39 local.get $36 @@ -1013,7 +1006,7 @@ i32.shr_s i32.const 1023 i32.sub - local.set $11 + local.set $10 i32.const 0 local.set $29 local.get $41 @@ -1022,7 +1015,7 @@ if local.get $28 i32.const 1048576 - local.get $11 + local.get $10 i32.const 1 i32.add i32.shr_s @@ -1035,12 +1028,12 @@ i32.shr_s i32.const 1023 i32.sub - local.set $11 + local.set $10 f64.const 0 local.set $24 local.get $29 i32.const 1048575 - local.get $11 + local.get $10 i32.shr_s i32.const -1 i32.xor @@ -1056,7 +1049,7 @@ i32.const 1048576 i32.or i32.const 20 - local.get $11 + local.get $10 i32.sub i32.shr_s local.set $29 @@ -1195,17 +1188,21 @@ local.get $16 f64.mul ) - (func $~lib/math/NativeMathf.mod (; 2 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + (func $~lib/builtins/isNaN (; 2 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) + local.get $0 + local.get $0 + f32.ne + ) + (func $~lib/math/NativeMathf.mod (; 3 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 f32) + (local $8 f32) + (local $9 i32) (local $10 i32) - (local $11 i32) local.get $0 i32.reinterpret_f32 local.set $2 @@ -1235,45 +1232,38 @@ local.get $7 i32.const 0 i32.eq - local.tee $8 if (result i32) - local.get $8 + i32.const 1 else local.get $4 i32.const 255 i32.eq end - local.tee $8 if (result i32) - local.get $8 + i32.const 1 else local.get $1 - local.set $9 - local.get $9 - local.get $9 - f32.ne + call $~lib/builtins/isNaN end - i32.const 0 - i32.ne if local.get $0 local.get $1 f32.mul - local.set $9 - local.get $9 - local.get $9 + local.set $8 + local.get $8 + local.get $8 f32.div return end local.get $2 i32.const 1 i32.shl - local.set $10 - local.get $10 + local.set $9 + local.get $9 local.get $7 i32.le_u if - local.get $10 + local.get $9 local.get $7 i32.eq if @@ -1355,34 +1345,32 @@ local.get $5 i32.gt_s if - block + local.get $2 + local.get $3 + i32.ge_u + if local.get $2 local.get $3 - i32.ge_u + i32.eq if - local.get $2 - local.get $3 - i32.eq - if - f32.const 0 - local.get $0 - f32.mul - return - end - local.get $2 - local.get $3 - i32.sub - local.set $2 + f32.const 0 + local.get $0 + f32.mul + return end local.get $2 - i32.const 1 - i32.shl - local.set $2 - local.get $4 - i32.const 1 + local.get $3 i32.sub - local.set $4 + local.set $2 end + local.get $2 + i32.const 1 + i32.shl + local.set $2 + local.get $4 + i32.const 1 + i32.sub + local.set $4 br $continue|0 end end @@ -1409,13 +1397,13 @@ i32.const 8 i32.shl i32.clz - local.set $11 + local.set $10 local.get $4 - local.get $11 + local.get $10 i32.sub local.set $4 local.get $2 - local.get $11 + local.get $10 i32.shl local.set $2 local.get $4 @@ -1451,7 +1439,7 @@ local.get $2 f32.reinterpret_i32 ) - (func $~lib/math/NativeMathf.scalbn (; 3 ;) (type $FUNCSIG$ffi) (param $0 f32) (param $1 i32) (result f32) + (func $~lib/math/NativeMathf.scalbn (; 4 ;) (type $FUNCSIG$ffi) (param $0 f32) (param $1 i32) (result f32) (local $2 f32) (local $3 i32) (local $4 i32) @@ -1541,7 +1529,7 @@ f32.reinterpret_i32 f32.mul ) - (func $~lib/math/NativeMathf.pow (; 4 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + (func $~lib/math/NativeMathf.pow (; 5 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1601,9 +1589,8 @@ local.get $4 i32.const 2139095040 i32.gt_s - local.tee $6 if (result i32) - local.get $6 + i32.const 1 else local.get $5 i32.const 2139095040 @@ -1616,7 +1603,7 @@ return end i32.const 0 - local.set $7 + local.set $6 local.get $2 i32.const 0 i32.lt_s @@ -1626,7 +1613,7 @@ i32.ge_s if i32.const 2 - local.set $7 + local.set $6 else local.get $5 i32.const 1065353216 @@ -1637,27 +1624,27 @@ i32.shr_s i32.const 127 i32.sub - local.set $9 + local.set $8 i32.const 23 - local.get $9 + local.get $8 i32.sub - local.set $6 + local.set $9 local.get $5 - local.get $6 + local.get $9 i32.shr_s - local.set $8 - local.get $8 - local.get $6 + local.set $7 + local.get $7 + local.get $9 i32.shl local.get $5 i32.eq if i32.const 2 - local.get $8 + local.get $7 i32.const 1 i32.and i32.sub - local.set $7 + local.set $6 end end end @@ -1747,17 +1734,15 @@ local.get $4 i32.const 2139095040 i32.eq - local.tee $6 if (result i32) - local.get $6 + i32.const 1 else local.get $4 i32.const 0 i32.eq end - local.tee $6 if (result i32) - local.get $6 + i32.const 1 else local.get $4 i32.const 1065353216 @@ -1782,7 +1767,7 @@ local.get $4 i32.const 1065353216 i32.sub - local.get $7 + local.get $6 i32.or i32.const 0 i32.eq @@ -1796,7 +1781,7 @@ f32.div local.set $11 else - local.get $7 + local.get $6 i32.const 1 i32.eq if @@ -1815,7 +1800,7 @@ i32.const 0 i32.lt_s if - local.get $7 + local.get $6 i32.const 0 i32.eq if @@ -1828,7 +1813,7 @@ f32.div return end - local.get $7 + local.get $6 i32.const 1 i32.eq if @@ -1962,27 +1947,27 @@ local.get $4 i32.const 8388607 i32.and - local.set $8 - local.get $8 + local.set $7 + local.get $7 i32.const 1065353216 i32.or local.set $4 - local.get $8 + local.get $7 i32.const 1885297 i32.le_s if i32.const 0 - local.set $9 + local.set $8 else - local.get $8 + local.get $7 i32.const 6140887 i32.lt_s if i32.const 1 - local.set $9 + local.set $8 else i32.const 0 - local.set $9 + local.set $8 local.get $24 i32.const 1 i32.add @@ -1998,7 +1983,7 @@ local.set $10 f32.const 1.5 f32.const 1 - local.get $9 + local.get $8 select local.set $30 local.get $10 @@ -2036,7 +2021,7 @@ local.get $25 i32.const 4194304 i32.add - local.get $9 + local.get $8 i32.const 21 i32.shl i32.add @@ -2160,7 +2145,7 @@ local.set $31 f32.const 1.5632208487659227e-06 f32.const 0 - local.get $9 + local.get $8 select local.set $32 f32.const -1.1736857413779944e-04 @@ -2178,7 +2163,7 @@ local.set $18 f32.const 0.5849609375 f32.const 0 - local.get $9 + local.get $8 select local.set $34 local.get $31 @@ -2236,8 +2221,8 @@ local.set $11 local.get $11 i32.reinterpret_f32 - local.set $8 - local.get $8 + local.set $7 + local.get $7 i32.const 1124073472 i32.gt_s if @@ -2248,7 +2233,7 @@ f32.mul return else - local.get $8 + local.get $7 i32.const 1124073472 i32.eq if @@ -2268,7 +2253,7 @@ return end else - local.get $8 + local.get $7 i32.const 2147483647 i32.and i32.const 1125515264 @@ -2281,7 +2266,7 @@ f32.mul return else - local.get $8 + local.get $7 i32.const -1021968384 i32.eq if @@ -2302,7 +2287,7 @@ end end end - local.get $8 + local.get $7 i32.const 2147483647 i32.and local.set $36 @@ -2311,16 +2296,16 @@ i32.shr_s i32.const 127 i32.sub - local.set $9 + local.set $8 i32.const 0 local.set $24 local.get $36 i32.const 1056964608 i32.gt_s if - local.get $8 + local.get $7 i32.const 8388608 - local.get $9 + local.get $8 i32.const 1 i32.add i32.shr_s @@ -2333,10 +2318,10 @@ i32.shr_s i32.const 127 i32.sub - local.set $9 + local.set $8 local.get $24 i32.const 8388607 - local.get $9 + local.get $8 i32.shr_s i32.const -1 i32.xor @@ -2349,11 +2334,11 @@ i32.const 8388608 i32.or i32.const 23 - local.get $9 + local.get $8 i32.sub i32.shr_s local.set $24 - local.get $8 + local.get $7 i32.const 0 i32.lt_s if @@ -2453,14 +2438,14 @@ local.set $11 local.get $11 i32.reinterpret_f32 - local.set $8 - local.get $8 + local.set $7 + local.get $7 local.get $24 i32.const 23 i32.shl i32.add - local.set $8 - local.get $8 + local.set $7 + local.get $7 i32.const 23 i32.shr_s i32.const 0 @@ -2471,7 +2456,7 @@ call $~lib/math/NativeMathf.scalbn local.set $11 else - local.get $8 + local.get $7 f32.reinterpret_i32 local.set $11 end @@ -2479,17 +2464,21 @@ local.get $11 f32.mul ) - (func $~lib/math/NativeMath.mod (; 5 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $~lib/builtins/isNaN (; 6 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + local.get $0 + f64.ne + ) + (func $~lib/math/NativeMath.mod (; 7 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) (local $2 i64) (local $3 i64) (local $4 i64) (local $5 i64) (local $6 i64) (local $7 i64) - (local $8 i32) - (local $9 f64) + (local $8 f64) + (local $9 i64) (local $10 i64) - (local $11 i64) local.get $0 i64.reinterpret_f64 local.set $2 @@ -2519,45 +2508,38 @@ local.get $7 i64.const 0 i64.eq - local.tee $8 if (result i32) - local.get $8 + i32.const 1 else local.get $4 i64.const 2047 i64.eq end - local.tee $8 if (result i32) - local.get $8 + i32.const 1 else local.get $1 - local.set $9 - local.get $9 - local.get $9 - f64.ne + call $~lib/builtins/isNaN end - i32.const 0 - i32.ne if local.get $0 local.get $1 f64.mul - local.set $9 - local.get $9 - local.get $9 + local.set $8 + local.get $8 + local.get $8 f64.div return end local.get $2 i64.const 1 i64.shl - local.set $10 - local.get $10 + local.set $9 + local.get $9 local.get $7 i64.le_u if - local.get $10 + local.get $9 local.get $7 i64.eq if @@ -2639,34 +2621,32 @@ local.get $5 i64.gt_s if - block + local.get $2 + local.get $3 + i64.ge_u + if local.get $2 local.get $3 - i64.ge_u + i64.eq if - local.get $2 - local.get $3 - i64.eq - if - f64.const 0 - local.get $0 - f64.mul - return - end - local.get $2 - local.get $3 - i64.sub - local.set $2 + f64.const 0 + local.get $0 + f64.mul + return end local.get $2 - i64.const 1 - i64.shl - local.set $2 - local.get $4 - i64.const 1 + local.get $3 i64.sub - local.set $4 + local.set $2 end + local.get $2 + i64.const 1 + i64.shl + local.set $2 + local.get $4 + i64.const 1 + i64.sub + local.set $4 br $continue|0 end end @@ -2693,13 +2673,13 @@ i64.const 11 i64.shl i64.clz - local.set $11 + local.set $10 local.get $4 - local.get $11 + local.get $10 i64.sub local.set $4 local.get $2 - local.get $11 + local.get $10 i64.shl local.set $2 local.get $4 @@ -2737,7 +2717,7 @@ local.get $2 f64.reinterpret_i64 ) - (func $start:binary (; 6 ;) (type $FUNCSIG$v) + (func $start:binary (; 8 ;) (type $FUNCSIG$v) global.get $binary/i i32.const 1 i32.lt_s @@ -3345,9 +3325,9 @@ call $~lib/math/NativeMath.pow global.set $binary/F ) - (func $start (; 7 ;) (type $FUNCSIG$v) + (func $start (; 9 ;) (type $FUNCSIG$v) call $start:binary ) - (func $null (; 8 ;) (type $FUNCSIG$v) + (func $null (; 10 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/bool.json b/tests/compiler/bool.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/bool.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/bool.optimized.wat b/tests/compiler/bool.optimized.wat index 8389baed19..eed8bb5a67 100644 --- a/tests/compiler/bool.optimized.wat +++ b/tests/compiler/bool.optimized.wat @@ -1,20 +1,17 @@ (module (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\07\00\00\00b\00o\00o\00l\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $bool/i (mut i32) (i32.const 2)) - (global $bool/I (mut i64) (i64.const 2)) - (global $bool/u (mut i32) (i32.const 2)) - (global $bool/U (mut i64) (i64.const 2)) - (global $bool/f (mut f32) (f32.const 2)) - (global $bool/F (mut f64) (f64.const 2)) - (global $bool/uu (mut i32) (i32.const 2)) + (data (i32.const 8) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\00b\00o\00o\00l\00.\00t\00s") + (global $bool/i i32 (i32.const 2)) + (global $bool/I i64 (i64.const 2)) + (global $bool/u i32 (i32.const 2)) + (global $bool/U i64 (i64.const 2)) + (global $bool/f f32 (f32.const 2)) + (global $bool/F f64 (f64.const 2)) + (global $bool/uu i32 (i32.const 2)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $start:bool (; 1 ;) (type $FUNCSIG$v) global.get $bool/i @@ -24,10 +21,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $bool/I @@ -37,10 +34,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 4 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $bool/u @@ -50,10 +47,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 6 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $bool/U @@ -63,10 +60,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 8 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $bool/f @@ -76,10 +73,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 10 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $bool/F @@ -89,10 +86,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 12 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $bool/uu @@ -102,10 +99,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 14 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/bool.untouched.wat b/tests/compiler/bool.untouched.wat index 1c4604055d..c22f19cecb 100644 --- a/tests/compiler/bool.untouched.wat +++ b/tests/compiler/bool.untouched.wat @@ -1,9 +1,9 @@ (module (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\07\00\00\00b\00o\00o\00l\00.\00t\00s\00") + (data (i32.const 8) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\00b\00o\00o\00l\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) (global $bool/i (mut i32) (i32.const 2)) @@ -13,9 +13,7 @@ (global $bool/f (mut f32) (f32.const 2)) (global $bool/F (mut f64) (f64.const 2)) (global $bool/uu (mut i32) (i32.const 2)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 28)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $start:bool (; 1 ;) (type $FUNCSIG$v) global.get $bool/i @@ -26,10 +24,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $bool/I @@ -40,10 +38,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 4 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $bool/u @@ -54,10 +52,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 6 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $bool/U @@ -68,10 +66,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 8 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $bool/f @@ -82,10 +80,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 10 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $bool/F @@ -96,10 +94,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 12 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $bool/uu @@ -110,10 +108,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 14 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/builtins.json b/tests/compiler/builtins.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/builtins.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/builtins.optimized.wat b/tests/compiler/builtins.optimized.wat index 99c4172deb..d5b505b6fd 100644 --- a/tests/compiler/builtins.optimized.wat +++ b/tests/compiler/builtins.optimized.wat @@ -1,11 +1,14 @@ (module (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$if (func (param f32) (result i32))) + (type $FUNCSIG$id (func (param f64) (result i32))) (type $FUNCSIG$vii (func (param i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\0b\00\00\00b\00u\00i\00l\00t\00i\00n\00s\00.\00t\00s") - (data (i32.const 40) "\01\00\00\001") + (data (i32.const 8) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00b\00u\00i\00l\00t\00i\00n\00s\00.\00t\00s") + (data (i32.const 52) "\01\00\00\00\01") + (data (i32.const 64) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00a\00b\00c") (table $0 2 funcref) (elem (i32.const 0) $builtins/test $start:builtins~anonymous|0) (global $builtins/b (mut i32) (i32.const 0)) @@ -16,15 +19,38 @@ (global $builtins/u (mut i32) (i32.const 0)) (global $builtins/U (mut i64) (i64.const 0)) (global $builtins/s (mut i32) (i32.const 0)) - (global $builtins/fn (mut i32) (i32.const 1)) + (global $builtins/fn i32 (i32.const 1)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "test" (func $builtins/test)) (start $start) - (func $start:builtins~anonymous|0 (; 1 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/builtins/isNaN (; 1 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) + local.get $0 + local.get $0 + f32.ne + ) + (func $~lib/builtins/isFinite (; 2 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) + local.get $0 + local.get $0 + f32.sub + f32.const 0 + f32.eq + ) + (func $~lib/builtins/isNaN (; 3 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + local.get $0 + f64.ne + ) + (func $~lib/builtins/isFinite (; 4 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + local.get $0 + f64.sub + f64.const 0 + f64.eq + ) + (func $start:builtins~anonymous|0 (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) nop ) - (func $start:builtins (; 2 ;) (type $FUNCSIG$v) + (func $start:builtins (; 6 ;) (type $FUNCSIG$v) i32.const 31 global.set $builtins/i i32.const 0 @@ -42,10 +68,10 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 66 + i32.const 24 + i32.const 67 i32.const 19 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2 @@ -55,10 +81,10 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 67 + i32.const 24 + i32.const 68 i32.const 20 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -68,10 +94,10 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 68 + i32.const 24 + i32.const 69 i32.const 20 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 63 @@ -91,10 +117,10 @@ i64.ne if i32.const 0 - i32.const 8 - i32.const 84 + i32.const 24 + i32.const 85 i32.const 19 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 2 @@ -104,10 +130,10 @@ i64.ne if i32.const 0 - i32.const 8 - i32.const 85 + i32.const 24 + i32.const 86 i32.const 20 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 1 @@ -117,10 +143,74 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 86 + i32.const 24 + i32.const 87 i32.const 20 - call $~lib/env/abort + call $~lib/builtins/abort + unreachable + end + f32.const 1.25 + call $~lib/builtins/isNaN + if + i32.const 0 + i32.const 24 + i32.const 104 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const nan:0x400000 + call $~lib/builtins/isNaN + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 105 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const 1.25 + call $~lib/builtins/isFinite + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 106 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const inf + call $~lib/builtins/isFinite + if + i32.const 0 + i32.const 24 + i32.const 107 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const -inf + call $~lib/builtins/isFinite + if + i32.const 0 + i32.const 24 + i32.const 108 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const nan:0x400000 + call $~lib/builtins/isFinite + if + i32.const 0 + i32.const 24 + i32.const 109 + i32.const 0 + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -145,10 +235,76 @@ global.set $builtins/f f32.const 1 global.set $builtins/f - i32.const 0 + f32.const 1.25 + call $~lib/builtins/isNaN global.set $builtins/b - i32.const 1 + f32.const 1.25 + call $~lib/builtins/isFinite global.set $builtins/b + f64.const 1.25 + call $~lib/builtins/isNaN + if + i32.const 0 + i32.const 24 + i32.const 140 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const nan:0x8000000000000 + call $~lib/builtins/isNaN + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 141 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const 1.25 + call $~lib/builtins/isFinite + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 142 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const inf + call $~lib/builtins/isFinite + if + i32.const 0 + i32.const 24 + i32.const 143 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const -inf + call $~lib/builtins/isFinite + if + i32.const 0 + i32.const 24 + i32.const 144 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const nan:0x8000000000000 + call $~lib/builtins/isFinite + if + i32.const 0 + i32.const 24 + i32.const 145 + i32.const 0 + call $~lib/builtins/abort + unreachable + end f64.const nan:0x8000000000000 global.set $builtins/F f64.const inf @@ -171,9 +327,11 @@ global.set $builtins/F f64.const 1 global.set $builtins/F - i32.const 0 + f64.const 1.25 + call $~lib/builtins/isNaN global.set $builtins/b - i32.const 1 + f64.const 1.25 + call $~lib/builtins/isFinite global.set $builtins/b i32.const 8 i32.load @@ -347,15 +505,15 @@ global.set $builtins/I f64.const 1.24e-322 global.set $builtins/F - current_memory + memory.size drop i32.const 1 - grow_memory + memory.grow drop - current_memory + memory.size global.set $builtins/s i32.const 1 - grow_memory + memory.grow global.set $builtins/s i32.const 10 global.set $builtins/i @@ -374,6 +532,90 @@ i32.const 2 global.get $builtins/fn call_indirect (type $FUNCSIG$vii) + f32.const nan:0x400000 + call $~lib/builtins/isNaN + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 294 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const nan:0x8000000000000 + call $~lib/builtins/isNaN + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 295 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const nan:0x400000 + call $~lib/builtins/isFinite + if + i32.const 0 + i32.const 24 + i32.const 296 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const inf + call $~lib/builtins/isFinite + if + i32.const 0 + i32.const 24 + i32.const 297 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const nan:0x8000000000000 + call $~lib/builtins/isFinite + if + i32.const 0 + i32.const 24 + i32.const 298 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const inf + call $~lib/builtins/isFinite + if + i32.const 0 + i32.const 24 + i32.const 299 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const 0 + call $~lib/builtins/isFinite + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 300 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const 0 + call $~lib/builtins/isFinite + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 301 + i32.const 0 + call $~lib/builtins/abort + unreachable + end i32.const 8 i32.load8_s drop @@ -443,11 +685,14 @@ i32.const 8 f64.const 1 f64.store + f64.const 1 + call $~lib/builtins/isNaN + drop ) - (func $builtins/test (; 3 ;) (type $FUNCSIG$v) + (func $builtins/test (; 7 ;) (type $FUNCSIG$v) nop ) - (func $start (; 4 ;) (type $FUNCSIG$v) + (func $start (; 8 ;) (type $FUNCSIG$v) call $start:builtins ) ) diff --git a/tests/compiler/builtins.ts b/tests/compiler/builtins.ts index 32f6d11174..0ed738f8af 100644 --- a/tests/compiler/builtins.ts +++ b/tests/compiler/builtins.ts @@ -26,7 +26,8 @@ assert(isFloat(1)); assert(!isFloat(1)); assert(isReference(changetype(null))); assert(!isReference(changetype(null))); -assert(isString("1")); +assert(isString("")); +assert(isString("abc")); assert(!isString(1)); assert(isArray(changetype(null))); assert(isArrayLike(changetype(null))); diff --git a/tests/compiler/builtins.untouched.wat b/tests/compiler/builtins.untouched.wat index cea0d32b97..c872652fcf 100644 --- a/tests/compiler/builtins.untouched.wat +++ b/tests/compiler/builtins.untouched.wat @@ -1,11 +1,14 @@ (module (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$if (func (param f32) (result i32))) + (type $FUNCSIG$id (func (param f64) (result i32))) (type $FUNCSIG$vii (func (param i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\0b\00\00\00b\00u\00i\00l\00t\00i\00n\00s\00.\00t\00s\00") - (data (i32.const 40) "\01\00\00\001\00") + (data (i32.const 8) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00b\00u\00i\00l\00t\00i\00n\00s\00.\00t\00s\00") + (data (i32.const 48) "\00\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00") + (data (i32.const 64) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00a\00b\00c\00") (table $0 2 funcref) (elem (i32.const 0) $null $start:builtins~anonymous|0) (global $builtins/b (mut i32) (i32.const 0)) @@ -48,29 +51,49 @@ (global $~lib/builtins/f64.MIN_SAFE_INTEGER f64 (f64.const -9007199254740991)) (global $~lib/builtins/f64.MAX_SAFE_INTEGER f64 (f64.const 9007199254740991)) (global $~lib/builtins/f64.EPSILON f64 (f64.const 2.220446049250313e-16)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 48)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "test" (func $builtins/test)) (start $start) - (func $start:builtins~anonymous|0 (; 1 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/builtins/isNaN (; 1 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) + local.get $0 + local.get $0 + f32.ne + ) + (func $~lib/builtins/isFinite (; 2 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) + local.get $0 + local.get $0 + f32.sub + f32.const 0 + f32.eq + ) + (func $~lib/builtins/isNaN (; 3 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + local.get $0 + f64.ne + ) + (func $~lib/builtins/isFinite (; 4 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + local.get $0 + f64.sub + f64.const 0 + f64.eq + ) + (func $start:builtins~anonymous|0 (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) nop ) - (func $start:builtins (; 2 ;) (type $FUNCSIG$v) + (func $start:builtins (; 6 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i64) (local $3 i64) - (local $4 f32) - (local $5 f64) i32.const 1 i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 6 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -78,20 +101,20 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 7 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 8 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -99,20 +122,20 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 9 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 10 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -120,20 +143,20 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 11 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 12 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -141,40 +164,40 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 13 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 14 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 15 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 16 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -182,20 +205,20 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 17 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 18 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -203,20 +226,20 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 19 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 20 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -224,20 +247,20 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 21 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 23 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -245,20 +268,20 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 24 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 25 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -266,20 +289,20 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 26 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 27 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -287,71 +310,81 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 28 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 29 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 0 - i32.eqz + i32.const 1 i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 30 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 + i32.const 0 + i32.eqz i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 31 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 32 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 33 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 34 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort + unreachable + end + i32.const 1 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 35 + i32.const 0 + call $~lib/builtins/abort unreachable end i32.const 0 @@ -359,20 +392,20 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 35 + i32.const 24 + i32.const 36 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 i32.eqz if i32.const 0 - i32.const 8 - i32.const 36 + i32.const 24 + i32.const 37 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -380,20 +413,20 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 37 + i32.const 24 + i32.const 38 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 i32.eqz if i32.const 0 - i32.const 8 - i32.const 38 + i32.const 24 + i32.const 39 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -401,20 +434,20 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 39 + i32.const 24 + i32.const 40 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 i32.eqz if i32.const 0 - i32.const 8 - i32.const 43 + i32.const 24 + i32.const 44 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -422,20 +455,20 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 44 + i32.const 24 + i32.const 45 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 i32.eqz if i32.const 0 - i32.const 8 - i32.const 45 + i32.const 24 + i32.const 46 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -443,10 +476,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 46 + i32.const 24 + i32.const 47 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -527,10 +560,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 66 + i32.const 24 + i32.const 67 i32.const 19 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -548,10 +581,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 67 + i32.const 24 + i32.const 68 i32.const 20 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -569,10 +602,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 68 + i32.const 24 + i32.const 69 i32.const 20 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 1 @@ -635,10 +668,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 84 + i32.const 24 + i32.const 85 i32.const 19 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 1 @@ -656,10 +689,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 85 + i32.const 24 + i32.const 86 i32.const 20 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 1 @@ -677,10 +710,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 86 + i32.const 24 + i32.const 87 i32.const 20 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -717,133 +750,83 @@ f32.const 1.25 f32.trunc drop - block $~lib/builtins/isNaN|inlined.0 (result i32) - f32.const 1.25 - local.set $4 - local.get $4 - local.get $4 - f32.ne - end - i32.const 0 - i32.ne + f32.const 1.25 + call $~lib/builtins/isNaN i32.const 0 i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 103 + i32.const 24 + i32.const 104 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/builtins/isNaN|inlined.1 (result i32) - f32.const nan:0x400000 - local.set $4 - local.get $4 - local.get $4 - f32.ne - end - i32.const 0 - i32.ne + f32.const nan:0x400000 + call $~lib/builtins/isNaN i32.const 1 i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 104 + i32.const 24 + i32.const 105 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/builtins/isFinite|inlined.0 (result i32) - f32.const 1.25 - local.set $4 - local.get $4 - local.get $4 - f32.sub - f32.const 0 - f32.eq - end - i32.const 0 - i32.ne + f32.const 1.25 + call $~lib/builtins/isFinite i32.const 1 i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 105 + i32.const 24 + i32.const 106 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/builtins/isFinite|inlined.1 (result i32) - f32.const inf - local.set $4 - local.get $4 - local.get $4 - f32.sub - f32.const 0 - f32.eq - end - i32.const 0 - i32.ne + f32.const inf + call $~lib/builtins/isFinite i32.const 0 i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 106 + i32.const 24 + i32.const 107 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/builtins/isFinite|inlined.2 (result i32) - f32.const inf - f32.neg - local.set $4 - local.get $4 - local.get $4 - f32.sub - f32.const 0 - f32.eq - end - i32.const 0 - i32.ne + f32.const inf + f32.neg + call $~lib/builtins/isFinite i32.const 0 i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 107 + i32.const 24 + i32.const 108 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/builtins/isFinite|inlined.3 (result i32) - f32.const nan:0x400000 - local.set $4 - local.get $4 - local.get $4 - f32.sub - f32.const 0 - f32.eq - end - i32.const 0 - i32.ne + f32.const nan:0x400000 + call $~lib/builtins/isFinite i32.const 0 i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 108 + i32.const 24 + i32.const 109 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -880,27 +863,11 @@ f32.const 1.25 f32.trunc global.set $builtins/f - block $~lib/builtins/isNaN|inlined.2 (result i32) - f32.const 1.25 - local.set $4 - local.get $4 - local.get $4 - f32.ne - end - i32.const 0 - i32.ne + f32.const 1.25 + call $~lib/builtins/isNaN global.set $builtins/b - block $~lib/builtins/isFinite|inlined.4 (result i32) - f32.const 1.25 - local.set $4 - local.get $4 - local.get $4 - f32.sub - f32.const 0 - f32.eq - end - i32.const 0 - i32.ne + f32.const 1.25 + call $~lib/builtins/isFinite global.set $builtins/b f64.const nan:0x8000000000000 drop @@ -940,133 +907,83 @@ f64.const 1.25 f64.trunc drop - block $~lib/builtins/isNaN|inlined.0 (result i32) - f64.const 1.25 - local.set $5 - local.get $5 - local.get $5 - f64.ne - end - i32.const 0 - i32.ne + f64.const 1.25 + call $~lib/builtins/isNaN i32.const 0 i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 139 + i32.const 24 + i32.const 140 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/builtins/isNaN|inlined.1 (result i32) - f64.const nan:0x8000000000000 - local.set $5 - local.get $5 - local.get $5 - f64.ne - end - i32.const 0 - i32.ne + f64.const nan:0x8000000000000 + call $~lib/builtins/isNaN i32.const 1 i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 140 + i32.const 24 + i32.const 141 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/builtins/isFinite|inlined.0 (result i32) - f64.const 1.25 - local.set $5 - local.get $5 - local.get $5 - f64.sub - f64.const 0 - f64.eq - end - i32.const 0 - i32.ne + f64.const 1.25 + call $~lib/builtins/isFinite i32.const 1 i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 141 + i32.const 24 + i32.const 142 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/builtins/isFinite|inlined.1 (result i32) - f64.const inf - local.set $5 - local.get $5 - local.get $5 - f64.sub - f64.const 0 - f64.eq - end - i32.const 0 - i32.ne + f64.const inf + call $~lib/builtins/isFinite i32.const 0 i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 142 + i32.const 24 + i32.const 143 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/builtins/isFinite|inlined.2 (result i32) - f64.const inf - f64.neg - local.set $5 - local.get $5 - local.get $5 - f64.sub - f64.const 0 - f64.eq - end - i32.const 0 - i32.ne + f64.const inf + f64.neg + call $~lib/builtins/isFinite i32.const 0 i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 143 + i32.const 24 + i32.const 144 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/builtins/isFinite|inlined.3 (result i32) - f64.const nan:0x8000000000000 - local.set $5 - local.get $5 - local.get $5 - f64.sub - f64.const 0 - f64.eq - end - i32.const 0 - i32.ne + f64.const nan:0x8000000000000 + call $~lib/builtins/isFinite i32.const 0 i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 144 + i32.const 24 + i32.const 145 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -1103,27 +1020,11 @@ f64.const 1.25 f64.trunc global.set $builtins/F - block $~lib/builtins/isNaN|inlined.2 (result i32) - f64.const 1.25 - local.set $5 - local.get $5 - local.get $5 - f64.ne - end - i32.const 0 - i32.ne + f64.const 1.25 + call $~lib/builtins/isNaN global.set $builtins/b - block $~lib/builtins/isFinite|inlined.4 (result i32) - f64.const 1.25 - local.set $5 - local.get $5 - local.get $5 - f64.sub - f64.const 0 - f64.eq - end - i32.const 0 - i32.ne + f64.const 1.25 + call $~lib/builtins/isFinite global.set $builtins/b i32.const 8 i32.load @@ -1314,15 +1215,15 @@ i64.const 25 f64.reinterpret_i64 global.set $builtins/F - current_memory + memory.size drop i32.const 1 - grow_memory + memory.grow drop - current_memory + memory.size global.set $builtins/s i32.const 1 - grow_memory + memory.grow global.set $builtins/s i32.const 10 i32.const 20 @@ -1379,10 +1280,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 263 + i32.const 24 + i32.const 264 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2 @@ -1391,10 +1292,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 264 + i32.const 24 + i32.const 265 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 4 @@ -1403,10 +1304,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 265 + i32.const 24 + i32.const 266 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 8 @@ -1415,10 +1316,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 266 + i32.const 24 + i32.const 267 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 4 @@ -1429,10 +1330,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 268 + i32.const 24 + i32.const 269 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -1441,10 +1342,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 269 + i32.const 24 + i32.const 270 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2 @@ -1453,10 +1354,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 270 + i32.const 24 + i32.const 271 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 4 @@ -1465,10 +1366,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 271 + i32.const 24 + i32.const 272 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 8 @@ -1477,10 +1378,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 272 + i32.const 24 + i32.const 273 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 4 @@ -1491,10 +1392,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 274 + i32.const 24 + i32.const 275 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 8 @@ -1503,10 +1404,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 275 + i32.const 24 + i32.const 276 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -1515,10 +1416,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 277 + i32.const 24 + i32.const 278 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -1527,10 +1428,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 278 + i32.const 24 + i32.const 279 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2 @@ -1539,10 +1440,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 279 + i32.const 24 + i32.const 280 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 3 @@ -1551,10 +1452,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 280 + i32.const 24 + i32.const 281 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -1563,10 +1464,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 281 + i32.const 24 + i32.const 282 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -1575,10 +1476,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 284 + i32.const 24 + i32.const 285 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 4 @@ -1587,10 +1488,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 285 + i32.const 24 + i32.const 286 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -1599,10 +1500,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 286 + i32.const 24 + i32.const 287 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2 @@ -1611,10 +1512,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 287 + i32.const 24 + i32.const 288 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -1623,10 +1524,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 289 + i32.const 24 + i32.const 290 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 8 @@ -1635,10 +1536,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 290 + i32.const 24 + i32.const 291 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -1647,170 +1548,102 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 292 - i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/builtins/isNaN|inlined.3 (result i32) - f32.const nan:0x400000 - local.set $4 - local.get $4 - local.get $4 - f32.ne - end - i32.const 0 - i32.ne - i32.eqz - if - i32.const 0 - i32.const 8 + i32.const 24 i32.const 293 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/builtins/isNaN|inlined.3 (result i32) - f64.const nan:0x8000000000000 - local.set $5 - local.get $5 - local.get $5 - f64.ne - end - i32.const 0 - i32.ne + f32.const nan:0x400000 + call $~lib/builtins/isNaN i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 294 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/builtins/isFinite|inlined.5 (result i32) - f32.const nan:0x400000 - local.set $4 - local.get $4 - local.get $4 - f32.sub - f32.const 0 - f32.eq - end - i32.const 0 - i32.ne - i32.eqz + f64.const nan:0x8000000000000 + call $~lib/builtins/isNaN i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 295 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/builtins/isFinite|inlined.6 (result i32) - f32.const inf - local.set $4 - local.get $4 - local.get $4 - f32.sub - f32.const 0 - f32.eq - end - i32.const 0 - i32.ne + f32.const nan:0x400000 + call $~lib/builtins/isFinite i32.eqz i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 296 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/builtins/isFinite|inlined.5 (result i32) - f64.const nan:0x8000000000000 - local.set $5 - local.get $5 - local.get $5 - f64.sub - f64.const 0 - f64.eq - end - i32.const 0 - i32.ne + f32.const inf + call $~lib/builtins/isFinite i32.eqz i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 297 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/builtins/isFinite|inlined.6 (result i32) - f64.const inf - local.set $5 - local.get $5 - local.get $5 - f64.sub - f64.const 0 - f64.eq - end - i32.const 0 - i32.ne + f64.const nan:0x8000000000000 + call $~lib/builtins/isFinite i32.eqz i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 298 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/builtins/isFinite|inlined.7 (result i32) - f32.const 0 - local.set $4 - local.get $4 - local.get $4 - f32.sub - f32.const 0 - f32.eq - end - i32.const 0 - i32.ne + f64.const inf + call $~lib/builtins/isFinite + i32.eqz i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 299 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/builtins/isFinite|inlined.7 (result i32) - f64.const 0 - local.set $5 - local.get $5 - local.get $5 - f64.sub - f64.const 0 - f64.eq - end - i32.const 0 - i32.ne + f32.const 0 + call $~lib/builtins/isFinite i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 300 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort + unreachable + end + f64.const 0 + call $~lib/builtins/isFinite + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 301 + i32.const 0 + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/i8.MIN_VALUE @@ -1823,10 +1656,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 313 + i32.const 24 + i32.const 314 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/i8.MAX_VALUE @@ -1835,10 +1668,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 314 + i32.const 24 + i32.const 315 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/i16.MIN_VALUE @@ -1851,10 +1684,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 315 + i32.const 24 + i32.const 316 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/i16.MAX_VALUE @@ -1863,10 +1696,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 316 + i32.const 24 + i32.const 317 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/i32.MIN_VALUE @@ -1875,10 +1708,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 317 + i32.const 24 + i32.const 318 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/i32.MAX_VALUE @@ -1887,10 +1720,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 318 + i32.const 24 + i32.const 319 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/i64.MIN_VALUE @@ -1899,10 +1732,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 319 + i32.const 24 + i32.const 320 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/i64.MAX_VALUE @@ -1911,10 +1744,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 320 + i32.const 24 + i32.const 321 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/u8.MIN_VALUE @@ -1923,10 +1756,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 322 + i32.const 24 + i32.const 323 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/u8.MAX_VALUE @@ -1935,10 +1768,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 323 + i32.const 24 + i32.const 324 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/u16.MIN_VALUE @@ -1947,10 +1780,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 324 + i32.const 24 + i32.const 325 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/u16.MAX_VALUE @@ -1959,10 +1792,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 325 + i32.const 24 + i32.const 326 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/u32.MIN_VALUE @@ -1971,10 +1804,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 326 + i32.const 24 + i32.const 327 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/u32.MAX_VALUE @@ -1983,10 +1816,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 327 + i32.const 24 + i32.const 328 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/u64.MIN_VALUE @@ -1995,10 +1828,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 328 + i32.const 24 + i32.const 329 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/u64.MAX_VALUE @@ -2007,10 +1840,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 329 + i32.const 24 + i32.const 330 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/bool.MIN_VALUE @@ -2019,10 +1852,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 330 + i32.const 24 + i32.const 331 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/bool.MIN_VALUE @@ -2031,10 +1864,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 330 + i32.const 24 + i32.const 331 i32.const 29 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/bool.MAX_VALUE @@ -2043,10 +1876,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 331 + i32.const 24 + i32.const 332 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/bool.MAX_VALUE @@ -2055,10 +1888,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 331 + i32.const 24 + i32.const 332 i32.const 29 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f32.MIN_NORMAL_VALUE @@ -2067,10 +1900,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 333 + i32.const 24 + i32.const 334 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f32.MIN_VALUE @@ -2079,10 +1912,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 334 + i32.const 24 + i32.const 335 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f32.MAX_VALUE @@ -2091,10 +1924,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 335 + i32.const 24 + i32.const 336 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f32.MIN_SAFE_INTEGER @@ -2103,10 +1936,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 336 + i32.const 24 + i32.const 337 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f32.MAX_SAFE_INTEGER @@ -2115,10 +1948,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 337 + i32.const 24 + i32.const 338 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f32.EPSILON @@ -2127,10 +1960,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 338 + i32.const 24 + i32.const 339 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f64.MIN_NORMAL_VALUE @@ -2139,10 +1972,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 340 + i32.const 24 + i32.const 341 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f64.MIN_VALUE @@ -2151,10 +1984,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 341 + i32.const 24 + i32.const 342 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f64.MAX_VALUE @@ -2163,10 +1996,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 342 + i32.const 24 + i32.const 343 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f64.MIN_SAFE_INTEGER @@ -2175,10 +2008,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 343 + i32.const 24 + i32.const 344 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f64.MAX_SAFE_INTEGER @@ -2187,10 +2020,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 344 + i32.const 24 + i32.const 345 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f64.EPSILON @@ -2199,10 +2032,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 345 + i32.const 24 + i32.const 346 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -2380,21 +2213,16 @@ f64.const 1 f64.trunc drop - block $~lib/builtins/isNaN|inlined.4 (result i32) - f64.const 1 - local.set $5 - local.get $5 - local.get $5 - f64.ne - end + f64.const 1 + call $~lib/builtins/isNaN drop ) - (func $builtins/test (; 3 ;) (type $FUNCSIG$v) + (func $builtins/test (; 7 ;) (type $FUNCSIG$v) nop ) - (func $start (; 4 ;) (type $FUNCSIG$v) + (func $start (; 8 ;) (type $FUNCSIG$v) call $start:builtins ) - (func $null (; 5 ;) (type $FUNCSIG$v) + (func $null (; 9 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/call-inferred.json b/tests/compiler/call-inferred.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/call-inferred.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/call-inferred.optimized.wat b/tests/compiler/call-inferred.optimized.wat index 5b82cabfa8..a9c60e8c7f 100644 --- a/tests/compiler/call-inferred.optimized.wat +++ b/tests/compiler/call-inferred.optimized.wat @@ -1,11 +1,8 @@ (module (type $FUNCSIG$v (func)) (memory $0 1) - (data (i32.const 8) "\10\00\00\00c\00a\00l\00l\00-\00i\00n\00f\00e\00r\00r\00e\00d\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $start) + (data (i32.const 8) " \00\00\00\01\00\00\00\01\00\00\00 \00\00\00c\00a\00l\00l\00-\00i\00n\00f\00e\00r\00r\00e\00d\00.\00t\00s") (export "memory" (memory $0)) - (export "table" (table $0)) (func $start (; 0 ;) (type $FUNCSIG$v) nop ) diff --git a/tests/compiler/call-inferred.untouched.wat b/tests/compiler/call-inferred.untouched.wat index dbda18ce07..4d8f89f101 100644 --- a/tests/compiler/call-inferred.untouched.wat +++ b/tests/compiler/call-inferred.untouched.wat @@ -4,14 +4,12 @@ (type $FUNCSIG$dd (func (param f64) (result f64))) (type $FUNCSIG$ff (func (param f32) (result f32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00c\00a\00l\00l\00-\00i\00n\00f\00e\00r\00r\00e\00d\00.\00t\00s\00") + (data (i32.const 8) " \00\00\00\01\00\00\00\01\00\00\00 \00\00\00c\00a\00l\00l\00-\00i\00n\00f\00e\00r\00r\00e\00d\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/memory/HEAP_BASE i32 (i32.const 44)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $call-inferred/foo (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 @@ -33,10 +31,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 5 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 42 @@ -46,10 +44,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 6 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 42 @@ -59,10 +57,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 7 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 42 @@ -72,10 +70,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 13 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/call-optional.json b/tests/compiler/call-optional.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/call-optional.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/call-optional.optimized.wat b/tests/compiler/call-optional.optimized.wat index 57463721a6..f7c91e7000 100644 --- a/tests/compiler/call-optional.optimized.wat +++ b/tests/compiler/call-optional.optimized.wat @@ -2,17 +2,23 @@ (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00c\00a\00l\00l\00-\00o\00p\00t\00i\00o\00n\00a\00l\00.\00t\00s") + (data (i32.const 8) " \00\00\00\01\00\00\00\01\00\00\00 \00\00\00c\00a\00l\00l\00-\00o\00p\00t\00i\00o\00n\00a\00l\00.\00t\00s") (table $0 2 funcref) (elem (i32.const 0) $null $call-optional/opt|trampoline) (global $~lib/argc (mut i32) (i32.const 0)) - (global $call-optional/optIndirect (mut i32) (i32.const 1)) + (global $call-optional/optIndirect i32 (i32.const 1)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) - (func $call-optional/opt|trampoline (; 1 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $call-optional/opt (; 1 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $0 + local.get $1 + i32.add + local.get $2 + i32.add + ) + (func $call-optional/opt|trampoline (; 2 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) block $2of2 block $1of2 block $0of2 @@ -32,81 +38,52 @@ end local.get $0 local.get $1 - i32.add local.get $2 - i32.add + call $call-optional/opt ) - (func $start:call-optional (; 2 ;) (type $FUNCSIG$v) - (local $0 i32) - (local $1 i32) + (func $start:call-optional (; 3 ;) (type $FUNCSIG$v) i32.const 1 global.set $~lib/argc - block $2of2 - block $1of2 - block $0of2 - block $outOfRange - global.get $~lib/argc - i32.const 1 - i32.sub - br_table $0of2 $1of2 $2of2 $outOfRange - end - unreachable - end - i32.const -1 - local.set $0 - end - i32.const -2 - local.set $1 - end - local.get $0 i32.const 3 - i32.add - local.get $1 - i32.add + i32.const 0 + i32.const 0 + call $call-optional/opt|trampoline if i32.const 0 - i32.const 8 + i32.const 24 i32.const 4 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2 global.set $~lib/argc + i32.const 3 i32.const 4 - local.set $0 i32.const 0 - local.set $1 - block $2of21 - block $1of22 - block $0of23 - block $outOfRange4 - global.get $~lib/argc - i32.const 1 - i32.sub - br_table $0of23 $1of22 $2of21 $outOfRange4 - end - unreachable - end - i32.const -1 - local.set $0 - end - i32.const -2 - local.set $1 + call $call-optional/opt|trampoline + i32.const 5 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 5 + i32.const 0 + call $~lib/builtins/abort + unreachable end - local.get $0 i32.const 3 - i32.add - local.get $1 - i32.add + i32.const 4 i32.const 5 + call $call-optional/opt + i32.const 12 i32.ne if i32.const 0 - i32.const 8 - i32.const 5 + i32.const 24 + i32.const 6 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -118,10 +95,10 @@ call_indirect (type $FUNCSIG$iiii) if i32.const 0 - i32.const 8 + i32.const 24 i32.const 9 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2 @@ -135,10 +112,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 10 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 3 @@ -152,17 +129,17 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 11 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) - (func $start (; 3 ;) (type $FUNCSIG$v) + (func $start (; 4 ;) (type $FUNCSIG$v) call $start:call-optional ) - (func $null (; 4 ;) (type $FUNCSIG$v) + (func $null (; 5 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/call-optional.untouched.wat b/tests/compiler/call-optional.untouched.wat index 1bd4adf597..da1f755b53 100644 --- a/tests/compiler/call-optional.untouched.wat +++ b/tests/compiler/call-optional.untouched.wat @@ -2,16 +2,14 @@ (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00c\00a\00l\00l\00-\00o\00p\00t\00i\00o\00n\00a\00l\00.\00t\00s\00") + (data (i32.const 8) " \00\00\00\01\00\00\00\01\00\00\00 \00\00\00c\00a\00l\00l\00-\00o\00p\00t\00i\00o\00n\00a\00l\00.\00t\00s\00") (table $0 2 funcref) (elem (i32.const 0) $null $call-optional/opt|trampoline) (global $~lib/argc (mut i32) (i32.const 0)) (global $call-optional/optIndirect (mut i32) (i32.const 1)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 44)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $call-optional/opt (; 1 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 @@ -57,10 +55,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 4 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block (result i32) @@ -76,10 +74,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 5 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 3 @@ -91,10 +89,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 6 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block (result i32) @@ -111,10 +109,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 9 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block (result i32) @@ -131,10 +129,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 10 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block (result i32) @@ -151,10 +149,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 11 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/call-super.json b/tests/compiler/call-super.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/call-super.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/call-super.optimized.wat b/tests/compiler/call-super.optimized.wat index 4f45da51fd..17f181cb6c 100644 --- a/tests/compiler/call-super.optimized.wat +++ b/tests/compiler/call-super.optimized.wat @@ -1,30 +1,31 @@ (module (type $FUNCSIG$v (func)) (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$i (func (result i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\0d\00\00\00c\00a\00l\00l\00-\00s\00u\00p\00e\00r\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) + (data (i32.const 8) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00c\00a\00l\00l\00-\00s\00u\00p\00e\00r\00.\00t\00s") + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) - (func $~lib/allocator/arena/__memory_allocate (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/rt/stub/__alloc (; 1 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) + (local $4 i32) + (local $5 i32) local.get $0 - i32.const 1073741824 + i32.const 1073741808 i32.gt_u if unreachable end - global.get $~lib/allocator/arena/offset - local.tee $1 + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.tee $3 local.get $0 i32.const 1 local.get $0 @@ -32,20 +33,20 @@ i32.gt_u select i32.add - i32.const 7 + i32.const 15 i32.add - i32.const -8 + i32.const -16 i32.and - local.tee $0 - current_memory local.tee $2 + memory.size + local.tee $4 i32.const 16 i32.shl i32.gt_u if + local.get $4 local.get $2 - local.get $0 - local.get $1 + local.get $3 i32.sub i32.const 65535 i32.add @@ -53,17 +54,17 @@ i32.and i32.const 16 i32.shr_u - local.tee $3 - local.get $2 - local.get $3 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select - grow_memory + memory.grow i32.const 0 i32.lt_s if - local.get $3 - grow_memory + local.get $5 + memory.grow i32.const 0 i32.lt_s if @@ -71,16 +72,26 @@ end end end - local.get $0 - global.set $~lib/allocator/arena/offset + local.get $2 + global.set $~lib/rt/stub/offset + local.get $3 + i32.const 16 + i32.sub + local.tee $2 local.get $1 + i32.store offset=8 + local.get $2 + local.get $0 + i32.store offset=12 + local.get $3 ) (func $call-super/A#constructor (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.eqz if i32.const 4 - call $~lib/allocator/arena/__memory_allocate + i32.const 3 + call $~lib/rt/stub/__alloc local.set $0 end local.get $0 @@ -92,10 +103,10 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 8 + i32.const 24 + i32.const 6 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -103,7 +114,8 @@ (func $call-super/B#constructor (; 3 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 8 - call $~lib/allocator/arena/__memory_allocate + i32.const 4 + call $~lib/rt/stub/__alloc call $call-super/A#constructor local.tee $0 i32.const 2 @@ -114,10 +126,10 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 17 + i32.const 24 + i32.const 15 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -126,10 +138,10 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 18 + i32.const 24 + i32.const 16 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -143,10 +155,10 @@ i32.ne if i32.const 0 - i32.const 8 i32.const 24 + i32.const 22 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -155,32 +167,30 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 25 + i32.const 24 + i32.const 23 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) - (func $call-super/C#constructor (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 + (func $call-super/D#constructor (; 5 ;) (type $FUNCSIG$i) (result i32) + (local $0 i32) + i32.const 8 + i32.const 6 + call $~lib/rt/stub/__alloc + local.tee $0 i32.eqz if i32.const 4 - call $~lib/allocator/arena/__memory_allocate + i32.const 5 + call $~lib/rt/stub/__alloc local.set $0 end local.get $0 i32.const 1 i32.store local.get $0 - ) - (func $call-super/D#constructor (; 6 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) - i32.const 8 - call $~lib/allocator/arena/__memory_allocate - call $call-super/C#constructor - local.tee $0 i32.const 2 i32.store offset=4 local.get $0 @@ -189,10 +199,10 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 40 + i32.const 24 + i32.const 38 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -201,15 +211,15 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 41 + i32.const 24 + i32.const 39 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 ) - (func $call-super/test2 (; 7 ;) (type $FUNCSIG$v) + (func $call-super/test2 (; 6 ;) (type $FUNCSIG$v) (local $0 i32) call $call-super/D#constructor local.tee $0 @@ -218,10 +228,10 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 47 + i32.const 24 + i32.const 45 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -230,19 +240,20 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 48 + i32.const 24 + i32.const 46 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) - (func $call-super/E#constructor (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $call-super/E#constructor (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.eqz if i32.const 4 - call $~lib/allocator/arena/__memory_allocate + i32.const 7 + call $~lib/rt/stub/__alloc local.set $0 end local.get $0 @@ -254,18 +265,19 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 58 + i32.const 24 + i32.const 56 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 ) - (func $call-super/test3 (; 9 ;) (type $FUNCSIG$v) + (func $call-super/test3 (; 8 ;) (type $FUNCSIG$v) (local $0 i32) i32.const 8 - call $~lib/allocator/arena/__memory_allocate + i32.const 8 + call $~lib/rt/stub/__alloc call $call-super/E#constructor local.tee $0 i32.const 2 @@ -276,10 +288,10 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 68 + i32.const 24 + i32.const 66 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -288,36 +300,49 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 69 + i32.const 24 + i32.const 67 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) - (func $call-super/H#constructor (; 10 ;) (type $FUNCSIG$i) (result i32) + (func $call-super/H#constructor (; 9 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 8 - call $~lib/allocator/arena/__memory_allocate - call $call-super/C#constructor + i32.const 10 + call $~lib/rt/stub/__alloc local.tee $0 + i32.eqz + if + i32.const 4 + i32.const 9 + call $~lib/rt/stub/__alloc + local.set $0 + end + local.get $0 + i32.const 1 + i32.store + local.get $0 i32.const 2 i32.store offset=4 local.get $0 ) - (func $call-super/test4 (; 11 ;) (type $FUNCSIG$v) + (func $call-super/test4 (; 10 ;) (type $FUNCSIG$v) (local $0 i32) - call $call-super/H#constructor + block (result i32) + call $call-super/H#constructor + end local.tee $0 i32.load i32.const 1 i32.ne if i32.const 0 - i32.const 8 - i32.const 86 + i32.const 24 + i32.const 84 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -326,26 +351,49 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 87 + i32.const 24 + i32.const 85 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) + (func $call-super/J#constructor (; 11 ;) (type $FUNCSIG$i) (result i32) + (local $0 i32) + i32.const 8 + i32.const 12 + call $~lib/rt/stub/__alloc + local.tee $0 + i32.eqz + if + i32.const 4 + i32.const 11 + call $~lib/rt/stub/__alloc + local.set $0 + end + local.get $0 + i32.const 1 + i32.store + local.get $0 + i32.const 2 + i32.store offset=4 + local.get $0 + ) (func $call-super/test5 (; 12 ;) (type $FUNCSIG$v) (local $0 i32) - call $call-super/H#constructor + block (result i32) + call $call-super/J#constructor + end local.tee $0 i32.load i32.const 1 i32.ne if i32.const 0 - i32.const 8 - i32.const 106 + i32.const 24 + i32.const 104 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -354,18 +402,18 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 107 + i32.const 24 + i32.const 105 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) (func $start (; 13 ;) (type $FUNCSIG$v) - i32.const 40 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset + i32.const 64 + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset call $call-super/test1 call $call-super/test2 call $call-super/test3 diff --git a/tests/compiler/call-super.ts b/tests/compiler/call-super.ts index 4145cbceab..aaa5a107dc 100644 --- a/tests/compiler/call-super.ts +++ b/tests/compiler/call-super.ts @@ -1,5 +1,3 @@ -import "allocator/arena"; - // both constructors present class A { diff --git a/tests/compiler/call-super.untouched.wat b/tests/compiler/call-super.untouched.wat index 5005235d83..d6d81f8794 100644 --- a/tests/compiler/call-super.untouched.wat +++ b/tests/compiler/call-super.untouched.wat @@ -1,72 +1,64 @@ (module (type $FUNCSIG$v (func)) (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\0d\00\00\00c\00a\00l\00l\00-\00s\00u\00p\00e\00r\00.\00t\00s\00") + (data (i32.const 8) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00c\00a\00l\00l\00-\00s\00u\00p\00e\00r\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 40)) + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) + (global $~lib/heap/__heap_base i32 (i32.const 52)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) - (func $start:~lib/allocator/arena (; 1 ;) (type $FUNCSIG$v) - global.get $~lib/memory/HEAP_BASE - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - ) - (func $~lib/allocator/arena/__memory_allocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/rt/stub/__alloc (; 1 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) + (local $8 i32) local.get $0 - i32.const 1073741824 + i32.const 1073741808 i32.gt_u if unreachable end - global.get $~lib/allocator/arena/offset - local.set $1 - local.get $1 + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.set $2 + local.get $2 local.get $0 - local.tee $2 - i32.const 1 local.tee $3 - local.get $2 + i32.const 1 + local.tee $4 local.get $3 + local.get $4 i32.gt_u select i32.add - i32.const 7 + i32.const 15 i32.add - i32.const 7 + i32.const 15 i32.const -1 i32.xor i32.and - local.set $4 - current_memory local.set $5 - local.get $4 + memory.size + local.set $6 local.get $5 + local.get $6 i32.const 16 i32.shl i32.gt_u if - local.get $4 - local.get $1 + local.get $5 + local.get $2 i32.sub i32.const 65535 i32.add @@ -76,23 +68,23 @@ i32.and i32.const 16 i32.shr_u - local.set $2 - local.get $5 - local.tee $3 - local.get $2 - local.tee $6 - local.get $3 + local.set $3 local.get $6 + local.tee $4 + local.get $3 + local.tee $7 + local.get $4 + local.get $7 i32.gt_s select - local.set $3 - local.get $3 - grow_memory + local.set $4 + local.get $4 + memory.grow i32.const 0 i32.lt_s if - local.get $2 - grow_memory + local.get $3 + memory.grow i32.const 0 i32.lt_s if @@ -100,22 +92,32 @@ end end end - local.get $4 - global.set $~lib/allocator/arena/offset + local.get $5 + global.set $~lib/rt/stub/offset + local.get $2 + i32.const 16 + i32.sub + local.set $8 + local.get $8 local.get $1 + i32.store offset=8 + local.get $8 + local.get $0 + i32.store offset=12 + local.get $2 ) - (func $~lib/memory/memory.allocate (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/rt/stub/__retain (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - call $~lib/allocator/arena/__memory_allocate - return ) - (func $call-super/A#constructor (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $call-super/A#constructor (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 4 - call $~lib/memory/memory.allocate + i32.const 3 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain local.set $0 end local.get $0 @@ -129,21 +131,23 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 8 + i32.const 24 + i32.const 6 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 ) - (func $call-super/B#constructor (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $call-super/B#constructor (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 if (result i32) local.get $0 else i32.const 8 - call $~lib/memory/memory.allocate + i32.const 4 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain end call $call-super/A#constructor local.set $0 @@ -157,10 +161,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 17 + i32.const 24 + i32.const 15 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -170,14 +174,17 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 18 + i32.const 24 + i32.const 16 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 ) + (func $~lib/rt/stub/__release (; 5 ;) (type $FUNCSIG$vi) (param $0 i32) + nop + ) (func $call-super/test1 (; 6 ;) (type $FUNCSIG$v) (local $0 i32) i32.const 0 @@ -190,10 +197,10 @@ i32.eqz if i32.const 0 - i32.const 8 i32.const 24 + i32.const 22 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -203,19 +210,23 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 25 + i32.const 24 + i32.const 23 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/stub/__release ) (func $call-super/C#constructor (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.eqz if i32.const 4 - call $~lib/memory/memory.allocate + i32.const 5 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain local.set $0 end local.get $0 @@ -229,7 +240,9 @@ local.get $0 else i32.const 8 - call $~lib/memory/memory.allocate + i32.const 6 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain end call $call-super/C#constructor local.set $0 @@ -243,10 +256,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 40 + i32.const 24 + i32.const 38 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -256,10 +269,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 41 + i32.const 24 + i32.const 39 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -276,10 +289,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 47 + i32.const 24 + i32.const 45 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -289,12 +302,14 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 48 + i32.const 24 + i32.const 46 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/stub/__release ) (func $call-super/E#constructor (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) @@ -302,7 +317,9 @@ i32.eqz if i32.const 4 - call $~lib/memory/memory.allocate + i32.const 7 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain local.set $0 end local.get $0 @@ -316,29 +333,38 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 58 + i32.const 24 + i32.const 56 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 ) (func $call-super/F#constructor (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) local.get $0 i32.eqz if i32.const 8 - call $~lib/memory/memory.allocate + i32.const 8 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain local.set $0 end local.get $0 call $call-super/E#constructor + local.tee $1 local.set $0 local.get $0 i32.const 2 i32.store offset=4 local.get $0 + local.set $2 + local.get $1 + call $~lib/rt/stub/__release + local.get $2 ) (func $call-super/test3 (; 12 ;) (type $FUNCSIG$v) (local $0 i32) @@ -352,10 +378,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 68 + i32.const 24 + i32.const 66 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -365,19 +391,23 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 69 + i32.const 24 + i32.const 67 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/stub/__release ) (func $call-super/G#constructor (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.eqz if i32.const 4 - call $~lib/memory/memory.allocate + i32.const 9 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain local.set $0 end local.get $0 @@ -386,20 +416,29 @@ local.get $0 ) (func $call-super/H#constructor (; 14 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) local.get $0 i32.eqz if i32.const 8 - call $~lib/memory/memory.allocate + i32.const 10 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain local.set $0 end local.get $0 call $call-super/G#constructor + local.tee $1 local.set $0 local.get $0 i32.const 2 i32.store offset=4 local.get $0 + local.set $2 + local.get $1 + call $~lib/rt/stub/__release + local.get $2 ) (func $call-super/test4 (; 15 ;) (type $FUNCSIG$v) (local $0 i32) @@ -413,10 +452,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 86 + i32.const 24 + i32.const 84 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -426,19 +465,23 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 87 + i32.const 24 + i32.const 85 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/stub/__release ) (func $call-super/I#constructor (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.eqz if i32.const 4 - call $~lib/memory/memory.allocate + i32.const 11 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain local.set $0 end local.get $0 @@ -447,20 +490,29 @@ local.get $0 ) (func $call-super/J#constructor (; 17 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) local.get $0 i32.eqz if i32.const 8 - call $~lib/memory/memory.allocate + i32.const 12 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain local.set $0 end local.get $0 call $call-super/I#constructor + local.tee $1 local.set $0 local.get $0 i32.const 2 i32.store offset=4 local.get $0 + local.set $2 + local.get $1 + call $~lib/rt/stub/__release + local.get $2 ) (func $call-super/test5 (; 18 ;) (type $FUNCSIG$v) (local $0 i32) @@ -474,10 +526,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 106 + i32.const 24 + i32.const 104 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -487,15 +539,26 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 107 + i32.const 24 + i32.const 105 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/stub/__release ) (func $start:call-super (; 19 ;) (type $FUNCSIG$v) - call $start:~lib/allocator/arena + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset call $call-super/test1 call $call-super/test2 call $call-super/test3 diff --git a/tests/compiler/class-extends.json b/tests/compiler/class-extends.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/class-extends.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/class-extends.optimized.wat b/tests/compiler/class-extends.optimized.wat index 6f25e5d32c..38988d5695 100644 --- a/tests/compiler/class-extends.optimized.wat +++ b/tests/compiler/class-extends.optimized.wat @@ -2,10 +2,7 @@ (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$v (func)) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $null) (export "memory" (memory $0)) - (export "table" (table $0)) (export "test" (func $class-extends/test)) (func $class-extends/test (; 0 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 diff --git a/tests/compiler/class-extends.untouched.wat b/tests/compiler/class-extends.untouched.wat index 52e5585c48..ea085c090d 100644 --- a/tests/compiler/class-extends.untouched.wat +++ b/tests/compiler/class-extends.untouched.wat @@ -1,14 +1,22 @@ (module (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$v (func)) (memory $0 0) (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "test" (func $class-extends/test)) - (func $class-extends/test (; 0 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/stub/__retain (; 0 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + ) + (func $~lib/rt/stub/__release (; 1 ;) (type $FUNCSIG$vi) (param $0 i32) + nop + ) + (func $class-extends/test (; 2 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop local.get $0 i32.load drop @@ -21,7 +29,9 @@ local.get $0 i32.const 3 i32.store16 offset=4 + local.get $0 + call $~lib/rt/stub/__release ) - (func $null (; 1 ;) (type $FUNCSIG$v) + (func $null (; 3 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/class-overloading.json b/tests/compiler/class-overloading.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/class-overloading.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/class-overloading.optimized.wat b/tests/compiler/class-overloading.optimized.wat index cf31b250ca..763941477c 100644 --- a/tests/compiler/class-overloading.optimized.wat +++ b/tests/compiler/class-overloading.optimized.wat @@ -2,10 +2,7 @@ (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$v (func)) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $start) (export "memory" (memory $0)) - (export "table" (table $0)) (export "test" (func $class-overloading/test)) (func $class-overloading/test (; 0 ;) (type $FUNCSIG$vi) (param $0 i32) nop diff --git a/tests/compiler/class-overloading.untouched.wat b/tests/compiler/class-overloading.untouched.wat index e81b67a4cc..65b67365da 100644 --- a/tests/compiler/class-overloading.untouched.wat +++ b/tests/compiler/class-overloading.untouched.wat @@ -1,28 +1,38 @@ (module (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$v (func)) (memory $0 0) (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "test" (func $class-overloading/test)) (start $start) - (func $class-overloading/Foo#baz (; 0 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/stub/__retain (; 0 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + ) + (func $class-overloading/Foo#baz (; 1 ;) (type $FUNCSIG$vi) (param $0 i32) + nop + ) + (func $~lib/rt/stub/__release (; 2 ;) (type $FUNCSIG$vi) (param $0 i32) nop ) - (func $class-overloading/test (; 1 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $class-overloading/test (; 3 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop local.get $0 call $class-overloading/Foo#baz + local.get $0 + call $~lib/rt/stub/__release ) - (func $start:class-overloading (; 2 ;) (type $FUNCSIG$v) + (func $start:class-overloading (; 4 ;) (type $FUNCSIG$v) i32.const 0 call $class-overloading/test ) - (func $start (; 3 ;) (type $FUNCSIG$v) + (func $start (; 5 ;) (type $FUNCSIG$v) call $start:class-overloading ) - (func $null (; 4 ;) (type $FUNCSIG$v) + (func $null (; 6 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/class.json b/tests/compiler/class.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/class.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/class.optimized.wat b/tests/compiler/class.optimized.wat index 56082bcd13..db8cd3d8ca 100644 --- a/tests/compiler/class.optimized.wat +++ b/tests/compiler/class.optimized.wat @@ -2,11 +2,8 @@ (type $FUNCSIG$v (func)) (type $FUNCSIG$ii (func (param i32) (result i32))) (memory $0 1) - (data (i32.const 8) "\08\00\00\00c\00l\00a\00s\00s\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $start) + (data (i32.const 8) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00c\00l\00a\00s\00s\00.\00t\00s") (export "memory" (memory $0)) - (export "table" (table $0)) (export "test" (func $class/test)) (func $class/test (; 0 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 diff --git a/tests/compiler/class.untouched.wat b/tests/compiler/class.untouched.wat index 4f077de801..b8f42eac20 100644 --- a/tests/compiler/class.untouched.wat +++ b/tests/compiler/class.untouched.wat @@ -6,15 +6,14 @@ (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$fiff (func (param i32 f32 f32) (result f32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\08\00\00\00c\00l\00a\00s\00s\00.\00t\00s\00") + (data (i32.const 8) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00c\00l\00a\00s\00s\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) (global $class/Animal.ONE (mut i32) (i32.const 1)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 28)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "test" (func $class/test)) (start $start) (func $class/Animal.add (; 1 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) @@ -39,10 +38,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 13 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $class/Animal.ONE @@ -56,14 +55,17 @@ call $class/Animal.sub drop ) - (func $class/Animal#instanceAdd (; 4 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/rt/stub/__retain (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + ) + (func $class/Animal#instanceAdd (; 5 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $1 local.get $2 i32.add global.get $class/Animal.ONE i32.add ) - (func $class/Animal#instanceSub (; 5 ;) (type $FUNCSIG$fiff) (param $0 i32) (param $1 f32) (param $2 f32) (result f32) + (func $class/Animal#instanceSub (; 6 ;) (type $FUNCSIG$fiff) (param $0 i32) (param $1 f32) (param $2 f32) (result f32) local.get $1 local.get $2 f32.sub @@ -71,9 +73,16 @@ f32.convert_i32_s f32.add ) - (func $class/test (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/rt/stub/__release (; 7 ;) (type $FUNCSIG$vi) (param $0 i32) + nop + ) + (func $class/test (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) + (local $3 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop local.get $0 i32.const 1 i32.const 2 @@ -113,12 +122,17 @@ local.get $0 local.set $1 local.get $1 + call $~lib/rt/stub/__retain local.set $2 local.get $2 + local.set $3 + local.get $0 + call $~lib/rt/stub/__release + local.get $3 ) - (func $start (; 7 ;) (type $FUNCSIG$v) + (func $start (; 9 ;) (type $FUNCSIG$v) call $start:class ) - (func $null (; 8 ;) (type $FUNCSIG$v) + (func $null (; 10 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/closure.json b/tests/compiler/closure.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/closure.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/closure.optimized.wat b/tests/compiler/closure.optimized.wat index 587c7142d7..bb456a1172 100644 --- a/tests/compiler/closure.optimized.wat +++ b/tests/compiler/closure.optimized.wat @@ -1,10 +1,7 @@ (module (type $FUNCSIG$v (func)) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $null) (export "memory" (memory $0)) - (export "table" (table $0)) (func $null (; 0 ;) (type $FUNCSIG$v) nop ) diff --git a/tests/compiler/closure.untouched.wat b/tests/compiler/closure.untouched.wat index 4560a6a15a..29ee81b836 100644 --- a/tests/compiler/closure.untouched.wat +++ b/tests/compiler/closure.untouched.wat @@ -3,9 +3,7 @@ (memory $0 0) (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (func $null (; 0 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/comma.json b/tests/compiler/comma.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/comma.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/comma.optimized.wat b/tests/compiler/comma.optimized.wat index 8b11cbe40b..c8e6b507f1 100644 --- a/tests/compiler/comma.optimized.wat +++ b/tests/compiler/comma.optimized.wat @@ -1,15 +1,12 @@ (module (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\08\00\00\00c\00o\00m\00m\00a\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $null) + (data (i32.const 8) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00c\00o\00m\00m\00a\00.\00t\00s") (global $comma/a (mut i32) (i32.const 0)) (global $comma/b (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $start:comma (; 1 ;) (type $FUNCSIG$v) (local $0 i32) @@ -25,19 +22,19 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 4 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $comma/b if i32.const 0 - i32.const 8 + i32.const 24 i32.const 5 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $comma/a @@ -45,17 +42,16 @@ i32.add global.set $comma/a global.get $comma/a - local.tee $0 global.set $comma/b - local.get $0 + global.get $comma/a i32.const 2 i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 8 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $comma/b @@ -63,10 +59,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 9 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -78,17 +74,16 @@ i32.add global.set $comma/a global.get $comma/a - local.tee $0 global.set $comma/b - local.get $0 + global.get $comma/a i32.const 1 i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 14 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $comma/b @@ -96,10 +91,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 15 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $comma/a @@ -115,10 +110,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 18 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $comma/b @@ -126,10 +121,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 19 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -156,10 +151,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 22 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/comma.untouched.wat b/tests/compiler/comma.untouched.wat index dc8c2f295a..8dac9f76ac 100644 --- a/tests/compiler/comma.untouched.wat +++ b/tests/compiler/comma.untouched.wat @@ -1,16 +1,14 @@ (module (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\08\00\00\00c\00o\00m\00m\00a\00.\00t\00s\00") + (data (i32.const 8) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00c\00o\00m\00m\00a\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) (global $comma/a (mut i32) (i32.const 0)) (global $comma/b (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 28)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $start:comma (; 1 ;) (type $FUNCSIG$v) (local $0 i32) @@ -34,10 +32,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 4 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $comma/b @@ -46,10 +44,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 5 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block @@ -66,10 +64,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 8 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $comma/b @@ -78,10 +76,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 9 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block (result i32) @@ -104,10 +102,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 14 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $comma/b @@ -116,10 +114,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 15 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block (result i32) @@ -140,10 +138,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 18 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $comma/b @@ -152,10 +150,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 19 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|0 @@ -189,10 +187,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 22 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block diff --git a/tests/compiler/constant-assign.json b/tests/compiler/constant-assign.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/constant-assign.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/constant-assign.optimized.wat b/tests/compiler/constant-assign.optimized.wat new file mode 100644 index 0000000000..342a301dbb --- /dev/null +++ b/tests/compiler/constant-assign.optimized.wat @@ -0,0 +1,319 @@ +(module + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (memory $0 1) + (data (i32.const 8) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\02") + (data (i32.const 32) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01") + (data (i32.const 56) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\02") + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) + (export "memory" (memory $0)) + (start $start) + (func $~lib/rt/stub/__alloc (; 0 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + i32.const 1073741808 + i32.gt_u + if + unreachable + end + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.tee $3 + local.get $0 + i32.const 1 + local.get $0 + i32.const 1 + i32.gt_u + select + i32.add + i32.const 15 + i32.add + i32.const -16 + i32.and + local.tee $2 + memory.size + local.tee $4 + i32.const 16 + i32.shl + i32.gt_u + if + local.get $4 + local.get $2 + local.get $3 + i32.sub + i32.const 65535 + i32.add + i32.const -65536 + i32.and + i32.const 16 + i32.shr_u + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + memory.grow + i32.const 0 + i32.lt_s + if + local.get $5 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + end + local.get $2 + global.set $~lib/rt/stub/offset + local.get $3 + i32.const 16 + i32.sub + local.tee $2 + local.get $1 + i32.store offset=8 + local.get $2 + local.get $0 + i32.store offset=12 + local.get $3 + ) + (func $~lib/memory/memory.copy (; 1 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + block $~lib/util/memory/memmove|inlined.0 + i32.const 4 + local.set $2 + local.get $0 + local.get $1 + i32.eq + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $1 + i32.lt_u + if + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|0 + local.get $0 + i32.const 7 + i32.and + if + local.get $2 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + local.get $0 + local.tee $3 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $3 + local.get $4 + i32.load8_u + i32.store8 + br $continue|0 + end + end + loop $continue|1 + local.get $2 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $1 + i64.load + i64.store + local.get $2 + i32.const 8 + i32.sub + local.set $2 + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + br $continue|1 + end + end + end + loop $continue|2 + local.get $2 + if + local.get $0 + local.tee $3 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $3 + local.get $4 + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $continue|2 + end + end + else + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|3 + local.get $0 + local.get $2 + i32.add + i32.const 7 + i32.and + if + local.get $2 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $2 + i32.const 1 + i32.sub + local.tee $2 + local.get $0 + i32.add + local.get $1 + local.get $2 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + loop $continue|4 + local.get $2 + i32.const 8 + i32.ge_u + if + local.get $2 + i32.const 8 + i32.sub + local.tee $2 + local.get $0 + i32.add + local.get $1 + local.get $2 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + loop $continue|5 + local.get $2 + if + local.get $2 + i32.const 1 + i32.sub + local.tee $2 + local.get $0 + i32.add + local.get $1 + local.get $2 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + ) + (func $~lib/rt/__allocArray (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + i32.const 16 + i32.const 3 + call $~lib/rt/stub/__alloc + local.tee $1 + i32.const 4 + i32.const 0 + call $~lib/rt/stub/__alloc + local.tee $2 + i32.store + local.get $1 + local.get $2 + i32.store offset=4 + local.get $1 + i32.const 4 + i32.store offset=8 + local.get $1 + i32.const 1 + i32.store offset=12 + local.get $0 + if + local.get $2 + local.get $0 + call $~lib/memory/memory.copy + end + local.get $1 + ) + (func $start:constant-assign (; 3 ;) (type $FUNCSIG$v) + i32.const 80 + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset + i32.const 0 + call $~lib/rt/__allocArray + i32.load offset=4 + i32.const 1 + i32.store + i32.const 24 + call $~lib/rt/__allocArray + drop + i32.const 48 + call $~lib/rt/__allocArray + drop + i32.const 72 + call $~lib/rt/__allocArray + drop + ) + (func $start (; 4 ;) (type $FUNCSIG$v) + block + call $start:constant-assign + end + ) + (func $null (; 5 ;) (type $FUNCSIG$v) + nop + ) +) diff --git a/tests/compiler/constant-assign.ts b/tests/compiler/constant-assign.ts new file mode 100644 index 0000000000..af26b295e5 --- /dev/null +++ b/tests/compiler/constant-assign.ts @@ -0,0 +1,30 @@ +// Expect error: TS2540 +// ^ TODO: Properly handle multiple + +function localConst(a: i32): void { + const b = a + 1; + b = 3; +} +localConst(1); + +function localConstInline(): void { + const a = 1; + a = 2; +} +localConstInline(); + +function localConstArray(a: i32): void { + const b: i32[] = [ a ]; + b = [ 2 ]; +} +localConstArray(1); + +function localConstArrayInline(): void { + const a: i32[] = [ 1 ]; + a = [ 2 ]; +} +localConstArrayInline(); + +// globalConst +const a = 1; +a = 2; diff --git a/tests/compiler/constant-assign.untouched.wat b/tests/compiler/constant-assign.untouched.wat new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/compiler/constructor.json b/tests/compiler/constructor.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/constructor.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/constructor.optimized.wat b/tests/compiler/constructor.optimized.wat index c5195d5172..3e80c484a2 100644 --- a/tests/compiler/constructor.optimized.wat +++ b/tests/compiler/constructor.optimized.wat @@ -1,12 +1,9 @@ (module + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$v (func)) - (type $FUNCSIG$ii (func (param i32) (result i32))) - (type $FUNCSIG$i (func (result i32))) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) (global $constructor/emptyCtor (mut i32) (i32.const 0)) (global $constructor/emptyCtorWithFieldInit (mut i32) (i32.const 0)) (global $constructor/emptyCtorWithFieldNoInit (mut i32) (i32.const 0)) @@ -14,25 +11,27 @@ (global $constructor/justFieldInit (mut i32) (i32.const 0)) (global $constructor/justFieldNoInit (mut i32) (i32.const 0)) (global $constructor/ctorReturns (mut i32) (i32.const 0)) - (global $constructor/b (mut i32) (i32.const 1)) + (global $constructor/b i32 (i32.const 1)) (global $constructor/ctorConditionallyReturns (mut i32) (i32.const 0)) (global $constructor/ctorAllocates (mut i32) (i32.const 0)) (global $constructor/ctorConditionallyAllocates (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) - (func $~lib/allocator/arena/__memory_allocate (; 0 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/rt/stub/__alloc (; 0 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) + (local $4 i32) + (local $5 i32) local.get $0 - i32.const 1073741824 + i32.const 1073741808 i32.gt_u if unreachable end - global.get $~lib/allocator/arena/offset - local.tee $1 + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.tee $3 local.get $0 i32.const 1 local.get $0 @@ -40,20 +39,20 @@ i32.gt_u select i32.add - i32.const 7 + i32.const 15 i32.add - i32.const -8 + i32.const -16 i32.and - local.tee $0 - current_memory local.tee $2 + memory.size + local.tee $4 i32.const 16 i32.shl i32.gt_u if + local.get $4 local.get $2 - local.get $0 - local.get $1 + local.get $3 i32.sub i32.const 65535 i32.add @@ -61,17 +60,17 @@ i32.and i32.const 16 i32.shr_u - local.tee $3 - local.get $2 - local.get $3 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select - grow_memory + memory.grow i32.const 0 i32.lt_s if - local.get $3 - grow_memory + local.get $5 + memory.grow i32.const 0 i32.lt_s if @@ -79,70 +78,88 @@ end end end - local.get $0 - global.set $~lib/allocator/arena/offset + local.get $2 + global.set $~lib/rt/stub/offset + local.get $3 + i32.const 16 + i32.sub + local.tee $2 local.get $1 + i32.store offset=8 + local.get $2 + local.get $0 + i32.store offset=12 + local.get $3 ) - (func $constructor/EmptyCtorWithFieldInit#constructor (; 1 ;) (type $FUNCSIG$i) (result i32) + (func $start:constructor (; 1 ;) (type $FUNCSIG$v) (local $0 i32) + i32.const 16 + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset + i32.const 0 + i32.const 3 + call $~lib/rt/stub/__alloc + global.set $constructor/emptyCtor + i32.const 4 i32.const 4 - call $~lib/allocator/arena/__memory_allocate + call $~lib/rt/stub/__alloc local.tee $0 i32.const 1 i32.store local.get $0 - ) - (func $constructor/EmptyCtorWithFieldNoInit#constructor (; 2 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) + global.set $constructor/emptyCtorWithFieldInit i32.const 4 - call $~lib/allocator/arena/__memory_allocate + i32.const 5 + call $~lib/rt/stub/__alloc local.tee $0 i32.const 0 i32.store local.get $0 - ) - (func $start:constructor (; 3 ;) (type $FUNCSIG$v) - (local $0 i32) - i32.const 8 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - i32.const 0 - call $~lib/allocator/arena/__memory_allocate - global.set $constructor/emptyCtor - call $constructor/EmptyCtorWithFieldInit#constructor - global.set $constructor/emptyCtorWithFieldInit - call $constructor/EmptyCtorWithFieldNoInit#constructor global.set $constructor/emptyCtorWithFieldNoInit i32.const 0 - call $~lib/allocator/arena/__memory_allocate + i32.const 6 + call $~lib/rt/stub/__alloc global.set $constructor/none - call $constructor/EmptyCtorWithFieldInit#constructor + i32.const 4 + i32.const 7 + call $~lib/rt/stub/__alloc + local.tee $0 + i32.const 1 + i32.store + local.get $0 global.set $constructor/justFieldInit - call $constructor/EmptyCtorWithFieldNoInit#constructor + i32.const 4 + i32.const 8 + call $~lib/rt/stub/__alloc + local.tee $0 + i32.const 0 + i32.store + local.get $0 global.set $constructor/justFieldNoInit i32.const 0 - call $~lib/allocator/arena/__memory_allocate global.set $constructor/ctorReturns - block $__inlined_func$constructor/CtorConditionallyReturns#constructor (result i32) - global.get $constructor/b - if - i32.const 0 - call $~lib/allocator/arena/__memory_allocate - br $__inlined_func$constructor/CtorConditionallyReturns#constructor - end + global.get $constructor/b + if (result i32) i32.const 0 - call $~lib/allocator/arena/__memory_allocate + else + i32.const 0 + i32.const 10 + call $~lib/rt/stub/__alloc end global.set $constructor/ctorConditionallyReturns i32.const 0 - call $~lib/allocator/arena/__memory_allocate + i32.const 11 + call $~lib/rt/stub/__alloc global.set $constructor/ctorAllocates + i32.const 0 + local.set $0 block (result i32) global.get $constructor/b if i32.const 0 - call $~lib/allocator/arena/__memory_allocate + i32.const 12 + call $~lib/rt/stub/__alloc local.set $0 end local.get $0 @@ -150,16 +167,17 @@ end if i32.const 0 - call $~lib/allocator/arena/__memory_allocate + i32.const 12 + call $~lib/rt/stub/__alloc local.set $0 end local.get $0 global.set $constructor/ctorConditionallyAllocates ) - (func $start (; 4 ;) (type $FUNCSIG$v) + (func $start (; 2 ;) (type $FUNCSIG$v) call $start:constructor ) - (func $null (; 5 ;) (type $FUNCSIG$v) + (func $null (; 3 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/constructor.ts b/tests/compiler/constructor.ts index c039c67710..d24a43402f 100644 --- a/tests/compiler/constructor.ts +++ b/tests/compiler/constructor.ts @@ -1,5 +1,3 @@ -import "allocator/arena"; - // trailing conditional allocate class EmptyCtor { constructor() {} @@ -46,7 +44,7 @@ var justFieldNoInit = new JustFieldNoInit(); // explicit allocation with no extra checks class CtorReturns { constructor() { - return changetype(memory.allocate(0)); + return changetype(0); } } @@ -58,7 +56,7 @@ var b: bool = true; class CtorConditionallyReturns { constructor() { if (b) { - return changetype(memory.allocate(0)); + return changetype(0); } } } diff --git a/tests/compiler/constructor.untouched.wat b/tests/compiler/constructor.untouched.wat index f1a500b8c3..c9e0782087 100644 --- a/tests/compiler/constructor.untouched.wat +++ b/tests/compiler/constructor.untouched.wat @@ -1,11 +1,12 @@ (module - (type $FUNCSIG$v (func)) (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$v (func)) (memory $0 0) (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) (global $constructor/emptyCtor (mut i32) (i32.const 0)) (global $constructor/emptyCtorWithFieldInit (mut i32) (i32.const 0)) (global $constructor/emptyCtorWithFieldNoInit (mut i32) (i32.const 0)) @@ -17,64 +18,54 @@ (global $constructor/ctorConditionallyReturns (mut i32) (i32.const 0)) (global $constructor/ctorAllocates (mut i32) (i32.const 0)) (global $constructor/ctorConditionallyAllocates (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) + (global $~lib/heap/__heap_base i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) - (func $start:~lib/allocator/arena (; 0 ;) (type $FUNCSIG$v) - global.get $~lib/memory/HEAP_BASE - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - ) - (func $~lib/allocator/arena/__memory_allocate (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/rt/stub/__alloc (; 0 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) + (local $8 i32) local.get $0 - i32.const 1073741824 + i32.const 1073741808 i32.gt_u if unreachable end - global.get $~lib/allocator/arena/offset - local.set $1 - local.get $1 + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.set $2 + local.get $2 local.get $0 - local.tee $2 - i32.const 1 local.tee $3 - local.get $2 + i32.const 1 + local.tee $4 local.get $3 + local.get $4 i32.gt_u select i32.add - i32.const 7 + i32.const 15 i32.add - i32.const 7 + i32.const 15 i32.const -1 i32.xor i32.and - local.set $4 - current_memory local.set $5 - local.get $4 + memory.size + local.set $6 local.get $5 + local.get $6 i32.const 16 i32.shl i32.gt_u if - local.get $4 - local.get $1 + local.get $5 + local.get $2 i32.sub i32.const 65535 i32.add @@ -84,23 +75,23 @@ i32.and i32.const 16 i32.shr_u - local.set $2 - local.get $5 - local.tee $3 - local.get $2 - local.tee $6 - local.get $3 + local.set $3 local.get $6 + local.tee $4 + local.get $3 + local.tee $7 + local.get $4 + local.get $7 i32.gt_s select - local.set $3 - local.get $3 - grow_memory + local.set $4 + local.get $4 + memory.grow i32.const 0 i32.lt_s if - local.get $2 - grow_memory + local.get $3 + memory.grow i32.const 0 i32.lt_s if @@ -108,31 +99,43 @@ end end end - local.get $4 - global.set $~lib/allocator/arena/offset + local.get $5 + global.set $~lib/rt/stub/offset + local.get $2 + i32.const 16 + i32.sub + local.set $8 + local.get $8 local.get $1 + i32.store offset=8 + local.get $8 + local.get $0 + i32.store offset=12 + local.get $2 ) - (func $~lib/memory/memory.allocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/rt/stub/__retain (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - call $~lib/allocator/arena/__memory_allocate - return ) - (func $constructor/EmptyCtor#constructor (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $constructor/EmptyCtor#constructor (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.eqz if i32.const 0 - call $~lib/memory/memory.allocate + i32.const 3 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain local.set $0 end local.get $0 ) - (func $constructor/EmptyCtorWithFieldInit#constructor (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $constructor/EmptyCtorWithFieldInit#constructor (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.eqz if i32.const 4 - call $~lib/memory/memory.allocate + i32.const 4 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain local.set $0 end local.get $0 @@ -140,12 +143,14 @@ i32.store local.get $0 ) - (func $constructor/EmptyCtorWithFieldNoInit#constructor (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $constructor/EmptyCtorWithFieldNoInit#constructor (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.eqz if i32.const 4 - call $~lib/memory/memory.allocate + i32.const 5 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain local.set $0 end local.get $0 @@ -153,22 +158,26 @@ i32.store local.get $0 ) - (func $constructor/None#constructor (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $constructor/None#constructor (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.eqz if i32.const 0 - call $~lib/memory/memory.allocate + i32.const 6 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain local.set $0 end local.get $0 ) - (func $constructor/JustFieldInit#constructor (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $constructor/JustFieldInit#constructor (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.eqz if i32.const 4 - call $~lib/memory/memory.allocate + i32.const 7 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain local.set $0 end local.get $0 @@ -176,12 +185,14 @@ i32.store local.get $0 ) - (func $constructor/JustFieldNoInit#constructor (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $constructor/JustFieldNoInit#constructor (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.eqz if i32.const 4 - call $~lib/memory/memory.allocate + i32.const 8 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain local.set $0 end local.get $0 @@ -189,45 +200,37 @@ i32.store local.get $0 ) - (func $constructor/CtorReturns#constructor (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - block $~lib/memory/memory.allocate|inlined.0 (result i32) - i32.const 0 - local.set $1 - local.get $1 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.0 - end + (func $constructor/CtorReturns#constructor (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.const 0 + call $~lib/rt/stub/__retain ) - (func $constructor/CtorConditionallyReturns#constructor (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $constructor/CtorConditionallyReturns#constructor (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) global.get $constructor/b if - block $~lib/memory/memory.allocate|inlined.1 (result i32) - i32.const 0 - local.set $1 - local.get $1 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.1 - end + i32.const 0 + call $~lib/rt/stub/__retain return end local.get $0 i32.eqz if i32.const 0 - call $~lib/memory/memory.allocate + i32.const 10 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain local.set $0 end local.get $0 ) - (func $constructor/CtorAllocates#constructor (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $constructor/CtorAllocates#constructor (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 0 - call $~lib/memory/memory.allocate + i32.const 11 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain local.set $0 end local.get $0 @@ -235,7 +238,7 @@ drop local.get $0 ) - (func $constructor/CtorConditionallyAllocates#constructor (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $constructor/CtorConditionallyAllocates#constructor (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) global.get $constructor/b if block (result i32) @@ -243,7 +246,9 @@ i32.eqz if i32.const 0 - call $~lib/memory/memory.allocate + i32.const 12 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain local.set $0 end local.get $0 @@ -254,13 +259,24 @@ i32.eqz if i32.const 0 - call $~lib/memory/memory.allocate + i32.const 12 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain local.set $0 end local.get $0 ) - (func $start:constructor (; 13 ;) (type $FUNCSIG$v) - call $start:~lib/allocator/arena + (func $start:constructor (; 12 ;) (type $FUNCSIG$v) + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset i32.const 0 call $constructor/EmptyCtor#constructor global.set $constructor/emptyCtor @@ -292,9 +308,9 @@ call $constructor/CtorConditionallyAllocates#constructor global.set $constructor/ctorConditionallyAllocates ) - (func $start (; 14 ;) (type $FUNCSIG$v) + (func $start (; 13 ;) (type $FUNCSIG$v) call $start:constructor ) - (func $null (; 15 ;) (type $FUNCSIG$v) + (func $null (; 14 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/declare.json b/tests/compiler/declare.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/declare.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/declare.optimized.wat b/tests/compiler/declare.optimized.wat index ef4530a9f9..7da25a0ead 100644 --- a/tests/compiler/declare.optimized.wat +++ b/tests/compiler/declare.optimized.wat @@ -4,14 +4,11 @@ (import "declare" "externalConstant" (global $declare/externalConstant i32)) (import "declare" "my.externalConstant" (global $declare/my.externalConstant i32)) (import "declare" "externalFunction" (func $declare/externalFunction)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (import "declare" "my.externalFunction" (func $declare/my.externalFunction)) (memory $0 1) - (data (i32.const 8) "\n\00\00\00d\00e\00c\00l\00a\00r\00e\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $null) + (data (i32.const 8) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00d\00e\00c\00l\00a\00r\00e\00.\00t\00s") (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $start:declare (; 3 ;) (type $FUNCSIG$v) call $declare/externalFunction @@ -20,10 +17,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 5 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end call $declare/my.externalFunction @@ -32,10 +29,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 13 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/declare.untouched.wat b/tests/compiler/declare.untouched.wat index ab37d9bb49..2946358847 100644 --- a/tests/compiler/declare.untouched.wat +++ b/tests/compiler/declare.untouched.wat @@ -4,15 +4,13 @@ (import "declare" "externalConstant" (global $declare/externalConstant i32)) (import "declare" "my.externalConstant" (global $declare/my.externalConstant i32)) (import "declare" "externalFunction" (func $declare/externalFunction)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (import "declare" "my.externalFunction" (func $declare/my.externalFunction)) (memory $0 1) - (data (i32.const 8) "\n\00\00\00d\00e\00c\00l\00a\00r\00e\00.\00t\00s\00") + (data (i32.const 8) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00d\00e\00c\00l\00a\00r\00e\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/memory/HEAP_BASE i32 (i32.const 32)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $start:declare (; 3 ;) (type $FUNCSIG$v) call $declare/externalFunction @@ -22,10 +20,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 5 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end call $declare/my.externalFunction @@ -35,10 +33,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 13 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/do.json b/tests/compiler/do.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/do.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/do.optimized.wat b/tests/compiler/do.optimized.wat index 0705d6fa4f..a951a3ca7d 100644 --- a/tests/compiler/do.optimized.wat +++ b/tests/compiler/do.optimized.wat @@ -1,16 +1,13 @@ (module (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\05\00\00\00d\00o\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $null) + (data (i32.const 8) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00d\00o\00.\00t\00s") (global $do/n (mut i32) (i32.const 10)) (global $do/m (mut i32) (i32.const 0)) (global $do/o (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $start:do (; 1 ;) (type $FUNCSIG$v) (local $0 i32) @@ -29,10 +26,10 @@ global.get $do/n if i32.const 0 - i32.const 8 + i32.const 24 i32.const 7 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $do/m @@ -40,10 +37,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 8 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 10 @@ -62,10 +59,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 12 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 10 @@ -96,10 +93,10 @@ global.get $do/n if i32.const 0 - i32.const 8 + i32.const 24 i32.const 24 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $do/o @@ -107,10 +104,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 25 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $do/n @@ -119,10 +116,10 @@ global.get $do/n if i32.const 0 - i32.const 8 + i32.const 24 i32.const 27 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $do/m @@ -130,10 +127,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 28 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $do/o @@ -141,10 +138,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 29 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/do.untouched.wat b/tests/compiler/do.untouched.wat index b26b20c534..90ae424b12 100644 --- a/tests/compiler/do.untouched.wat +++ b/tests/compiler/do.untouched.wat @@ -1,17 +1,15 @@ (module (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\05\00\00\00d\00o\00.\00t\00s\00") + (data (i32.const 8) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00d\00o\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) (global $do/n (mut i32) (i32.const 10)) (global $do/m (mut i32) (i32.const 0)) (global $do/o (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 24)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $start:do (; 1 ;) (type $FUNCSIG$v) (local $0 i32) @@ -37,10 +35,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 7 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $do/m @@ -49,10 +47,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 8 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 10 @@ -77,10 +75,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 12 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 10 @@ -120,10 +118,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 24 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $do/o @@ -132,10 +130,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 25 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end end @@ -149,10 +147,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 27 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $do/m @@ -161,10 +159,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 28 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $do/o @@ -173,10 +171,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 29 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/empty.json b/tests/compiler/empty.json new file mode 100644 index 0000000000..8ee35e6e7f --- /dev/null +++ b/tests/compiler/empty.json @@ -0,0 +1,6 @@ +{ + "asc_flags": [ + "--runtime half", + "--use ASC_RTRACE=1" + ] +} diff --git a/tests/compiler/empty.optimized.wat b/tests/compiler/empty.optimized.wat index 587c7142d7..bb456a1172 100644 --- a/tests/compiler/empty.optimized.wat +++ b/tests/compiler/empty.optimized.wat @@ -1,10 +1,7 @@ (module (type $FUNCSIG$v (func)) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $null) (export "memory" (memory $0)) - (export "table" (table $0)) (func $null (; 0 ;) (type $FUNCSIG$v) nop ) diff --git a/tests/compiler/empty.untouched.wat b/tests/compiler/empty.untouched.wat index 4560a6a15a..29ee81b836 100644 --- a/tests/compiler/empty.untouched.wat +++ b/tests/compiler/empty.untouched.wat @@ -3,9 +3,7 @@ (memory $0 0) (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (func $null (; 0 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/enum.json b/tests/compiler/enum.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/enum.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/enum.optimized.wat b/tests/compiler/enum.optimized.wat index ef489ff645..918613db6f 100644 --- a/tests/compiler/enum.optimized.wat +++ b/tests/compiler/enum.optimized.wat @@ -1,8 +1,6 @@ (module (type $FUNCSIG$v (func)) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $null) (global $enum/Implicit.ZERO i32 (i32.const 0)) (global $enum/Implicit.ONE i32 (i32.const 1)) (global $enum/Implicit.TWO i32 (i32.const 2)) @@ -34,7 +32,6 @@ (global $enum/SelfReferenceConst.ZERO i32 (i32.const 0)) (global $enum/SelfReferenceConst.ONE i32 (i32.const 1)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "Implicit.ZERO" (global $enum/Implicit.ZERO)) (export "Implicit.ONE" (global $enum/Implicit.ONE)) (export "Implicit.TWO" (global $enum/Implicit.TWO)) diff --git a/tests/compiler/enum.untouched.wat b/tests/compiler/enum.untouched.wat index 1df56dd14d..51d9aa74ba 100644 --- a/tests/compiler/enum.untouched.wat +++ b/tests/compiler/enum.untouched.wat @@ -35,9 +35,7 @@ (global $enum/SelfReferenceConst.ZERO i32 (i32.const 0)) (global $enum/SelfReferenceConst.ONE i32 (i32.const 1)) (global $enum/enumType (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "Implicit.ZERO" (global $enum/Implicit.ZERO)) (export "Implicit.ONE" (global $enum/Implicit.ONE)) (export "Implicit.TWO" (global $enum/Implicit.TWO)) diff --git a/tests/compiler/export-default.json b/tests/compiler/export-default.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/export-default.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/export-default.optimized.wat b/tests/compiler/export-default.optimized.wat new file mode 100644 index 0000000000..fbdbee4154 --- /dev/null +++ b/tests/compiler/export-default.optimized.wat @@ -0,0 +1,10 @@ +(module + (type $FUNCSIG$v (func)) + (memory $0 0) + (export "memory" (memory $0)) + (export "theDefault" (func $export-default/theDefault)) + (export "default" (func $export-default/theDefault)) + (func $export-default/theDefault (; 0 ;) (type $FUNCSIG$v) + nop + ) +) diff --git a/tests/compiler/export-default.ts b/tests/compiler/export-default.ts new file mode 100644 index 0000000000..71b0a13ae6 --- /dev/null +++ b/tests/compiler/export-default.ts @@ -0,0 +1 @@ +export default function theDefault(): void {} diff --git a/tests/compiler/export-default.untouched.wat b/tests/compiler/export-default.untouched.wat new file mode 100644 index 0000000000..f367647567 --- /dev/null +++ b/tests/compiler/export-default.untouched.wat @@ -0,0 +1,14 @@ +(module + (type $FUNCSIG$v (func)) + (memory $0 0) + (table $0 1 funcref) + (elem (i32.const 0) $null) + (export "memory" (memory $0)) + (export "theDefault" (func $export-default/theDefault)) + (export "default" (func $export-default/theDefault)) + (func $export-default/theDefault (; 0 ;) (type $FUNCSIG$v) + nop + ) + (func $null (; 1 ;) (type $FUNCSIG$v) + ) +) diff --git a/tests/compiler/export.json b/tests/compiler/export.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/export.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/export.optimized.wat b/tests/compiler/export.optimized.wat index be7678c324..b5b3be4fa2 100644 --- a/tests/compiler/export.optimized.wat +++ b/tests/compiler/export.optimized.wat @@ -2,13 +2,10 @@ (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$v (func)) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $export/ns.one) (global $export/a i32 (i32.const 1)) (global $export/b i32 (i32.const 2)) (global $export/c i32 (i32.const 3)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "add" (func $export/add)) (export "sub" (func $export/sub)) (export "renamed_mul" (func $export/mul)) @@ -16,6 +13,7 @@ (export "b" (global $export/b)) (export "renamed_c" (global $export/c)) (export "ns.two" (func $export/ns.one)) + (export "default.two" (func $export/ns.one)) (func $export/add (; 0 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 diff --git a/tests/compiler/export.ts b/tests/compiler/export.ts index ef50645fb4..b1ac15ac2f 100644 --- a/tests/compiler/export.ts +++ b/tests/compiler/export.ts @@ -28,3 +28,5 @@ export namespace ns { function one(): void {} export function two(): void {} } + +export default ns; diff --git a/tests/compiler/export.untouched.wat b/tests/compiler/export.untouched.wat index ea0955dfd5..fb06dd5c75 100644 --- a/tests/compiler/export.untouched.wat +++ b/tests/compiler/export.untouched.wat @@ -7,9 +7,7 @@ (global $export/a i32 (i32.const 1)) (global $export/b i32 (i32.const 2)) (global $export/c i32 (i32.const 3)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "add" (func $export/add)) (export "sub" (func $export/sub)) (export "renamed_mul" (func $export/mul)) @@ -17,6 +15,7 @@ (export "b" (global $export/b)) (export "renamed_c" (global $export/c)) (export "ns.two" (func $export/ns.two)) + (export "default.two" (func $export/ns.two)) (func $export/add (; 0 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 diff --git a/tests/compiler/exports.json b/tests/compiler/exports.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/exports.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/exports.optimized.wat b/tests/compiler/exports.optimized.wat index 7f2e633d79..41ec64f57d 100644 --- a/tests/compiler/exports.optimized.wat +++ b/tests/compiler/exports.optimized.wat @@ -1,15 +1,11 @@ (module - (type $FUNCSIG$v (func)) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$vii (func (param i32 i32))) (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$v (func)) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) (global $exports/Animal.CAT i32 (i32.const 0)) (global $exports/Animal.DOG i32 (i32.const 1)) (global $exports/animals.Animal.CAT i32 (i32.const 0)) @@ -17,17 +13,21 @@ (global $exports/Car.TIRES i32 (i32.const 4)) (global $exports/vehicles.Car.TIRES i32 (i32.const 4)) (global $exports/outer.inner.a i32 (i32.const 42)) + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) (global $~lib/argc (mut i32) (i32.const 0)) + (global $exports/Car i32 (i32.const 3)) + (global $exports/vehicles.Car i32 (i32.const 4)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "add" (func $exports/add)) - (export "_setargc" (func $~lib/setargc)) + (export "__setargc" (func $~lib/setargc)) (export "subOpt" (func $exports/subOpt|trampoline)) (export "math.sub" (func $exports/subOpt)) (export "Animal.CAT" (global $exports/Animal.CAT)) (export "Animal.DOG" (global $exports/Animal.DOG)) (export "animals.Animal.CAT" (global $exports/animals.Animal.CAT)) (export "animals.Animal.DOG" (global $exports/animals.Animal.DOG)) + (export "Car" (global $exports/Car)) (export "Car#get:doors" (func $exports/Car#get:numDoors)) (export "Car#set:doors" (func $exports/Car#set:numDoors)) (export "Car#constructor" (func $exports/Car#constructor|trampoline)) @@ -36,9 +36,10 @@ (export "Car#openDoors" (func $exports/Car#openDoors)) (export "Car.TIRES" (global $exports/Car.TIRES)) (export "Car.getNumTires" (func $exports/Car.getNumTires)) + (export "vehicles.Car" (global $exports/vehicles.Car)) (export "vehicles.Car#get:doors" (func $exports/Car#get:numDoors)) (export "vehicles.Car#set:doors" (func $exports/Car#set:numDoors)) - (export "vehicles.Car#constructor" (func $exports/Car#constructor|trampoline)) + (export "vehicles.Car#constructor" (func $exports/vehicles.Car#constructor|trampoline)) (export "vehicles.Car#get:numDoors" (func $exports/Car#get:numDoors)) (export "vehicles.Car#set:numDoors" (func $exports/Car#set:numDoors)) (export "vehicles.Car#openDoors" (func $exports/Car#openDoors)) @@ -59,27 +60,29 @@ (func $exports/Car.getNumTires (; 2 ;) (type $FUNCSIG$i) (result i32) i32.const 4 ) - (func $~lib/allocator/arena/__memory_allocate (; 3 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) + (func $~lib/rt/stub/__alloc (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) - global.get $~lib/allocator/arena/offset - local.tee $0 - i32.const 11 + (local $4 i32) + global.get $~lib/rt/stub/offset + i32.const 16 i32.add - i32.const -8 + local.tee $2 + i32.const 19 + i32.add + i32.const -16 i32.and local.tee $1 - current_memory - local.tee $2 + memory.size + local.tee $3 i32.const 16 i32.shl i32.gt_u if - local.get $2 + local.get $3 local.get $1 - local.get $0 + local.get $2 i32.sub i32.const 65535 i32.add @@ -87,17 +90,17 @@ i32.and i32.const 16 i32.shr_u - local.tee $3 - local.get $2 + local.tee $4 local.get $3 + local.get $4 i32.gt_s select - grow_memory + memory.grow i32.const 0 i32.lt_s if - local.get $3 - grow_memory + local.get $4 + memory.grow i32.const 0 i32.lt_s if @@ -106,8 +109,17 @@ end end local.get $1 - global.set $~lib/allocator/arena/offset + global.set $~lib/rt/stub/offset + local.get $2 + i32.const 16 + i32.sub + local.tee $1 local.get $0 + i32.store offset=8 + local.get $1 + i32.const 4 + i32.store offset=12 + local.get $2 ) (func $exports/Car#get:numDoors (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 @@ -122,10 +134,10 @@ nop ) (func $start (; 7 ;) (type $FUNCSIG$v) - i32.const 8 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset + i32.const 16 + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset ) (func $null (; 8 ;) (type $FUNCSIG$v) nop @@ -146,7 +158,7 @@ end local.get $0 local.get $1 - i32.sub + call $exports/subOpt ) (func $~lib/setargc (; 10 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 @@ -167,7 +179,35 @@ local.get $0 i32.eqz if - call $~lib/allocator/arena/__memory_allocate + i32.const 3 + call $~lib/rt/stub/__alloc + local.set $0 + end + local.get $0 + local.get $1 + i32.store + local.get $0 + local.get $1 + i32.store + local.get $0 + ) + (func $exports/vehicles.Car#constructor|trampoline (; 12 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + block $1of1 + block $0of1 + block $outOfRange + global.get $~lib/argc + br_table $0of1 $1of1 $outOfRange + end + unreachable + end + i32.const 2 + local.set $1 + end + local.get $0 + i32.eqz + if + i32.const 4 + call $~lib/rt/stub/__alloc local.set $0 end local.get $0 diff --git a/tests/compiler/exports.ts b/tests/compiler/exports.ts index eb4c58f8b1..5953536e4a 100644 --- a/tests/compiler/exports.ts +++ b/tests/compiler/exports.ts @@ -1,5 +1,3 @@ -import "allocator/arena"; - // top-level function export function add(a: i32, b: i32): i32 { return a + b; diff --git a/tests/compiler/exports.untouched.wat b/tests/compiler/exports.untouched.wat index 2fee8385e9..1284679a8f 100644 --- a/tests/compiler/exports.untouched.wat +++ b/tests/compiler/exports.untouched.wat @@ -1,15 +1,13 @@ (module - (type $FUNCSIG$v (func)) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$vii (func (param i32 i32))) (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$v (func)) (memory $0 0) (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) (global $exports/Animal.CAT i32 (i32.const 0)) (global $exports/Animal.DOG i32 (i32.const 1)) (global $exports/animals.Animal.CAT i32 (i32.const 0)) @@ -17,18 +15,22 @@ (global $exports/Car.TIRES i32 (i32.const 4)) (global $exports/vehicles.Car.TIRES i32 (i32.const 4)) (global $exports/outer.inner.a i32 (i32.const 42)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) + (global $~lib/heap/__heap_base i32 (i32.const 8)) (global $~lib/argc (mut i32) (i32.const 0)) + (global $exports/Car i32 (i32.const 3)) + (global $exports/vehicles.Car i32 (i32.const 4)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "add" (func $exports/add)) - (export "_setargc" (func $~lib/setargc)) + (export "__setargc" (func $~lib/setargc)) (export "subOpt" (func $exports/subOpt|trampoline)) (export "math.sub" (func $exports/math.sub)) (export "Animal.CAT" (global $exports/Animal.CAT)) (export "Animal.DOG" (global $exports/Animal.DOG)) (export "animals.Animal.CAT" (global $exports/animals.Animal.CAT)) (export "animals.Animal.DOG" (global $exports/animals.Animal.DOG)) + (export "Car" (global $exports/Car)) (export "Car#get:doors" (func $Car#get:doors)) (export "Car#set:doors" (func $Car#set:doors)) (export "Car#constructor" (func $exports/Car#constructor|trampoline)) @@ -37,6 +39,7 @@ (export "Car#openDoors" (func $exports/Car#openDoors)) (export "Car.TIRES" (global $exports/Car.TIRES)) (export "Car.getNumTires" (func $exports/Car.getNumTires)) + (export "vehicles.Car" (global $exports/vehicles.Car)) (export "vehicles.Car#get:doors" (func $vehicles.Car#get:doors)) (export "vehicles.Car#set:doors" (func $vehicles.Car#set:doors)) (export "vehicles.Car#constructor" (func $exports/vehicles.Car#constructor|trampoline)) @@ -47,81 +50,69 @@ (export "vehicles.Car.getNumTires" (func $exports/vehicles.Car.getNumTires)) (export "outer.inner.a" (global $exports/outer.inner.a)) (start $start) - (func $start:~lib/allocator/arena (; 0 ;) (type $FUNCSIG$v) - global.get $~lib/memory/HEAP_BASE - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - ) - (func $start:exports (; 1 ;) (type $FUNCSIG$v) - call $start:~lib/allocator/arena - ) - (func $exports/add (; 2 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $exports/add (; 0 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 i32.add ) - (func $exports/subOpt (; 3 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $exports/subOpt (; 1 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 i32.sub ) - (func $exports/math.sub (; 4 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $exports/math.sub (; 2 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 i32.sub ) - (func $exports/Car.getNumTires (; 5 ;) (type $FUNCSIG$i) (result i32) + (func $exports/Car.getNumTires (; 3 ;) (type $FUNCSIG$i) (result i32) global.get $exports/Car.TIRES ) - (func $~lib/allocator/arena/__memory_allocate (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/rt/stub/__alloc (; 4 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) + (local $8 i32) local.get $0 - i32.const 1073741824 + i32.const 1073741808 i32.gt_u if unreachable end - global.get $~lib/allocator/arena/offset - local.set $1 - local.get $1 + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.set $2 + local.get $2 local.get $0 - local.tee $2 - i32.const 1 local.tee $3 - local.get $2 + i32.const 1 + local.tee $4 local.get $3 + local.get $4 i32.gt_u select i32.add - i32.const 7 + i32.const 15 i32.add - i32.const 7 + i32.const 15 i32.const -1 i32.xor i32.and - local.set $4 - current_memory local.set $5 - local.get $4 + memory.size + local.set $6 local.get $5 + local.get $6 i32.const 16 i32.shl i32.gt_u if - local.get $4 - local.get $1 + local.get $5 + local.get $2 i32.sub i32.const 65535 i32.add @@ -131,23 +122,23 @@ i32.and i32.const 16 i32.shr_u - local.set $2 - local.get $5 - local.tee $3 - local.get $2 - local.tee $6 - local.get $3 + local.set $3 local.get $6 + local.tee $4 + local.get $3 + local.tee $7 + local.get $4 + local.get $7 i32.gt_s select - local.set $3 - local.get $3 - grow_memory + local.set $4 + local.get $4 + memory.grow i32.const 0 i32.lt_s if - local.get $2 - grow_memory + local.get $3 + memory.grow i32.const 0 i32.lt_s if @@ -155,22 +146,32 @@ end end end - local.get $4 - global.set $~lib/allocator/arena/offset + local.get $5 + global.set $~lib/rt/stub/offset + local.get $2 + i32.const 16 + i32.sub + local.set $8 + local.get $8 local.get $1 + i32.store offset=8 + local.get $8 + local.get $0 + i32.store offset=12 + local.get $2 ) - (func $~lib/memory/memory.allocate (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/rt/stub/__retain (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - call $~lib/allocator/arena/__memory_allocate - return ) - (func $exports/Car#constructor (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $exports/Car#constructor (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 4 - call $~lib/memory/memory.allocate + i32.const 3 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain local.set $0 end local.get $0 @@ -182,28 +183,30 @@ i32.store local.get $0 ) - (func $exports/Car#get:numDoors (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $exports/Car#get:numDoors (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load ) - (func $exports/Car#set:numDoors (; 10 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $exports/Car#set:numDoors (; 8 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) local.get $0 local.get $1 i32.store ) - (func $exports/Car#openDoors (; 11 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $exports/Car#openDoors (; 9 ;) (type $FUNCSIG$vi) (param $0 i32) nop ) - (func $exports/vehicles.Car.getNumTires (; 12 ;) (type $FUNCSIG$i) (result i32) + (func $exports/vehicles.Car.getNumTires (; 10 ;) (type $FUNCSIG$i) (result i32) global.get $exports/vehicles.Car.TIRES ) - (func $exports/vehicles.Car#constructor (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $exports/vehicles.Car#constructor (; 11 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 4 - call $~lib/memory/memory.allocate + i32.const 4 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain local.set $0 end local.get $0 @@ -215,24 +218,33 @@ i32.store local.get $0 ) - (func $exports/vehicles.Car#get:numDoors (; 14 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $exports/vehicles.Car#get:numDoors (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load ) - (func $exports/vehicles.Car#set:numDoors (; 15 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $exports/vehicles.Car#set:numDoors (; 13 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) local.get $0 local.get $1 i32.store ) - (func $exports/vehicles.Car#openDoors (; 16 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $exports/vehicles.Car#openDoors (; 14 ;) (type $FUNCSIG$vi) (param $0 i32) nop ) - (func $start (; 17 ;) (type $FUNCSIG$v) - call $start:exports + (func $start (; 15 ;) (type $FUNCSIG$v) + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset ) - (func $null (; 18 ;) (type $FUNCSIG$v) + (func $null (; 16 ;) (type $FUNCSIG$v) ) - (func $exports/subOpt|trampoline (; 19 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $exports/subOpt|trampoline (; 17 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) block $1of1 block $0of1 block $outOfRange @@ -250,20 +262,20 @@ local.get $1 call $exports/subOpt ) - (func $~lib/setargc (; 20 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/setargc (; 18 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 global.set $~lib/argc ) - (func $Car#get:doors (; 21 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $Car#get:doors (; 19 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load ) - (func $Car#set:doors (; 22 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $Car#set:doors (; 20 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) local.get $0 local.get $1 i32.store ) - (func $exports/Car#constructor|trampoline (; 23 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $exports/Car#constructor|trampoline (; 21 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) block $1of1 block $0of1 block $outOfRange @@ -279,16 +291,16 @@ local.get $1 call $exports/Car#constructor ) - (func $vehicles.Car#get:doors (; 24 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $vehicles.Car#get:doors (; 22 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load ) - (func $vehicles.Car#set:doors (; 25 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $vehicles.Car#set:doors (; 23 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) local.get $0 local.get $1 i32.store ) - (func $exports/vehicles.Car#constructor|trampoline (; 26 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $exports/vehicles.Car#constructor|trampoline (; 24 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) block $1of1 block $0of1 block $outOfRange diff --git a/tests/compiler/external.json b/tests/compiler/external.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/external.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/external.optimized.wat b/tests/compiler/external.optimized.wat index 694a47c7e4..3cd8fa2698 100644 --- a/tests/compiler/external.optimized.wat +++ b/tests/compiler/external.optimized.wat @@ -6,10 +6,7 @@ (import "external" "bar" (func $external/two)) (import "foo" "baz" (func $external/three)) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $null) (export "memory" (memory $0)) - (export "table" (table $0)) (export "foo" (func $external/foo)) (export "foo.bar" (func $external/foo.bar)) (export "two" (func $external/two)) diff --git a/tests/compiler/external.untouched.wat b/tests/compiler/external.untouched.wat index f3f10b1e4c..664061dcc0 100644 --- a/tests/compiler/external.untouched.wat +++ b/tests/compiler/external.untouched.wat @@ -8,9 +8,7 @@ (memory $0 0) (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "foo" (func $external/foo)) (export "foo.bar" (func $external/foo.bar)) (export "two" (func $external/two)) diff --git a/tests/compiler/for.json b/tests/compiler/for.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/for.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/for.optimized.wat b/tests/compiler/for.optimized.wat index 11e8c6032e..b3875d78ec 100644 --- a/tests/compiler/for.optimized.wat +++ b/tests/compiler/for.optimized.wat @@ -1,14 +1,11 @@ (module (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\06\00\00\00f\00o\00r\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $null) + (data (i32.const 8) "\0c\00\00\00\01\00\00\00\01\00\00\00\0c\00\00\00f\00o\00r\00.\00t\00s") (global $for/i (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $start:for (; 1 ;) (type $FUNCSIG$v) (local $0 i32) @@ -33,10 +30,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 5 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end loop $repeat|1 @@ -68,10 +65,10 @@ global.get $for/i if i32.const 0 - i32.const 8 + i32.const 24 i32.const 12 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end loop $repeat|3 @@ -115,10 +112,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 19 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 diff --git a/tests/compiler/for.untouched.wat b/tests/compiler/for.untouched.wat index 9502a23466..11e16036ce 100644 --- a/tests/compiler/for.untouched.wat +++ b/tests/compiler/for.untouched.wat @@ -1,15 +1,13 @@ (module (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\06\00\00\00f\00o\00r\00.\00t\00s\00") + (data (i32.const 8) "\0c\00\00\00\01\00\00\00\01\00\00\00\0c\00\00\00f\00o\00r\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) (global $for/i (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 24)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $start:for (; 1 ;) (type $FUNCSIG$v) (local $0 i32) @@ -25,7 +23,6 @@ i32.lt_s i32.eqz br_if $break|0 - nop global.get $for/i i32.const 1 i32.add @@ -41,10 +38,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 5 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|1 @@ -56,7 +53,6 @@ i32.lt_s i32.eqz br_if $break|1 - nop local.get $0 i32.const 1 i32.add @@ -89,10 +85,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 12 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|3 @@ -164,10 +160,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 19 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|6 diff --git a/tests/compiler/function-expression.json b/tests/compiler/function-expression.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/function-expression.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/function-expression.optimized.wat b/tests/compiler/function-expression.optimized.wat index 1a71339c3e..6690a0daca 100644 --- a/tests/compiler/function-expression.optimized.wat +++ b/tests/compiler/function-expression.optimized.wat @@ -4,18 +4,17 @@ (type $FUNCSIG$v (func)) (type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\16\00\00\00f\00u\00n\00c\00t\00i\00o\00n\00-\00e\00x\00p\00r\00e\00s\00s\00i\00o\00n\00.\00t\00s") + (data (i32.const 8) ",\00\00\00\01\00\00\00\01\00\00\00,\00\00\00f\00u\00n\00c\00t\00i\00o\00n\00-\00e\00x\00p\00r\00e\00s\00s\00i\00o\00n\00.\00t\00s") (table $0 11 funcref) (elem (i32.const 0) $start:function-expression~someName $start:function-expression~anonymous|0 $start:function-expression~anonymous|0 $start:function-expression~someName $start:function-expression~anonymous|2 $start:function-expression~anonymous|3 $start:function-expression~anonymous|4 $start:function-expression~anonymous|5 $start:function-expression~anonymous|3 $start:function-expression~anonymous|4 $start:function-expression~anonymous|5) - (global $function-expression/f1 (mut i32) (i32.const 1)) + (global $function-expression/f1 i32 (i32.const 1)) (global $~lib/argc (mut i32) (i32.const 0)) - (global $function-expression/f2 (mut i32) (i32.const 2)) - (global $function-expression/f3 (mut i32) (i32.const 3)) - (global $function-expression/f4 (mut i32) (i32.const 4)) + (global $function-expression/f2 i32 (i32.const 2)) + (global $function-expression/f3 i32 (i32.const 3)) + (global $function-expression/f4 i32 (i32.const 4)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $start:function-expression~anonymous|0 (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 @@ -31,13 +30,21 @@ local.get $1 i32.add ) - (func $start:function-expression~anonymous|4 (; 5 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $function-expression/testOmitted (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.const 2 + global.set $~lib/argc + i32.const 1 + i32.const 2 + local.get $0 + call_indirect (type $FUNCSIG$iii) + ) + (func $start:function-expression~anonymous|4 (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 ) - (func $start:function-expression~anonymous|5 (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $start:function-expression~anonymous|5 (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) i32.const 42 ) - (func $start:function-expression (; 7 ;) (type $FUNCSIG$v) + (func $start:function-expression (; 8 ;) (type $FUNCSIG$v) i32.const 1 global.set $~lib/argc i32.const 1 @@ -47,10 +54,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 4 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -62,10 +69,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 9 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -80,110 +87,95 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 16 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 2 - global.set $~lib/argc - i32.const 1 - i32.const 2 i32.const 5 - call_indirect (type $FUNCSIG$iii) + call $function-expression/testOmitted i32.const 3 i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 21 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 2 - global.set $~lib/argc - i32.const 1 - i32.const 2 i32.const 6 - call_indirect (type $FUNCSIG$iii) + call $function-expression/testOmitted i32.const 1 i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 22 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 2 - global.set $~lib/argc - i32.const 1 - i32.const 2 i32.const 7 - call_indirect (type $FUNCSIG$iii) + call $function-expression/testOmitted i32.const 42 i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 23 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2 global.set $~lib/argc i32.const 1 i32.const 2 - i32.const 8 - call_indirect (type $FUNCSIG$iii) + call $start:function-expression~anonymous|3 i32.const 3 i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 34 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2 global.set $~lib/argc i32.const 1 i32.const 2 - i32.const 9 - call_indirect (type $FUNCSIG$iii) + call $start:function-expression~anonymous|4 i32.const 1 i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 35 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2 global.set $~lib/argc i32.const 1 i32.const 2 - i32.const 10 - call_indirect (type $FUNCSIG$iii) + call $start:function-expression~anonymous|5 i32.const 42 i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 36 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) - (func $start (; 8 ;) (type $FUNCSIG$v) + (func $start (; 9 ;) (type $FUNCSIG$v) call $start:function-expression ) ) diff --git a/tests/compiler/function-expression.untouched.wat b/tests/compiler/function-expression.untouched.wat index a3747b794f..c57513578f 100644 --- a/tests/compiler/function-expression.untouched.wat +++ b/tests/compiler/function-expression.untouched.wat @@ -4,9 +4,9 @@ (type $FUNCSIG$v (func)) (type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\16\00\00\00f\00u\00n\00c\00t\00i\00o\00n\00-\00e\00x\00p\00r\00e\00s\00s\00i\00o\00n\00.\00t\00s\00") + (data (i32.const 8) ",\00\00\00\01\00\00\00\01\00\00\00,\00\00\00f\00u\00n\00c\00t\00i\00o\00n\00-\00e\00x\00p\00r\00e\00s\00s\00i\00o\00n\00.\00t\00s\00") (table $0 11 funcref) (elem (i32.const 0) $null $start:function-expression~anonymous|0 $start:function-expression~anonymous|1 $start:function-expression~someName $start:function-expression~anonymous|2 $start:function-expression~anonymous|3 $start:function-expression~anonymous|4 $start:function-expression~anonymous|5 $function-expression/testOmittedReturn1~anonymous|0 $function-expression/testOmittedReturn2~anonymous|0 $function-expression/testOmittedReturn3~anonymous|0) (global $function-expression/f1 (mut i32) (i32.const 1)) @@ -14,9 +14,7 @@ (global $function-expression/f2 (mut i32) (i32.const 2)) (global $function-expression/f3 (mut i32) (i32.const 3)) (global $function-expression/f4 (mut i32) (i32.const 4)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 56)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $start:function-expression~anonymous|0 (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 @@ -82,10 +80,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 4 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block (result i32) @@ -100,10 +98,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 9 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block @@ -123,10 +121,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 16 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 5 @@ -136,10 +134,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 21 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 6 @@ -149,10 +147,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 22 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 7 @@ -162,10 +160,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 23 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block (result i32) @@ -181,10 +179,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 34 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block (result i32) @@ -200,10 +198,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 35 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block (result i32) @@ -219,10 +217,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 36 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/function-types.json b/tests/compiler/function-types.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/function-types.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/function-types.optimized.wat b/tests/compiler/function-types.optimized.wat index 00fd577caa..dd5f05c0ea 100644 --- a/tests/compiler/function-types.optimized.wat +++ b/tests/compiler/function-types.optimized.wat @@ -3,17 +3,17 @@ (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$jjj (func (param i64 i64) (result i64))) (type $FUNCSIG$ddd (func (param f64 f64) (result f64))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\11\00\00\00f\00u\00n\00c\00t\00i\00o\00n\00-\00t\00y\00p\00e\00s\00.\00t\00s") + (data (i32.const 8) "\"\00\00\00\01\00\00\00\01\00\00\00\"\00\00\00f\00u\00n\00c\00t\00i\00o\00n\00-\00t\00y\00p\00e\00s\00.\00t\00s") (table $0 5 funcref) (elem (i32.const 0) $null $function-types/makeAdder~anonymous|0 $function-types/makeAdder~anonymous|0 $function-types/makeAdder~anonymous|0 $function-types/makeAdder~anonymous|0) (global $function-types/i32Adder (mut i32) (i32.const 0)) (global $~lib/argc (mut i32) (i32.const 0)) (global $function-types/i64Adder (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $function-types/makeAdder~anonymous|0 (; 1 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 @@ -30,7 +30,15 @@ local.get $1 f64.add ) - (func $start:function-types (; 4 ;) (type $FUNCSIG$v) + (func $function-types/doAddWithFn (; 4 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + i32.const 2 + global.set $~lib/argc + local.get $0 + local.get $1 + local.get $2 + call_indirect (type $FUNCSIG$iii) + ) + (func $start:function-types (; 5 ;) (type $FUNCSIG$v) (local $0 i32) i32.const 1 global.set $function-types/i32Adder @@ -44,10 +52,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 11 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2 @@ -62,74 +70,68 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 15 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2 global.set $~lib/argc f64.const 1.5 f64.const 2.5 - i32.const 3 - call_indirect (type $FUNCSIG$ddd) + call $function-types/makeAdder~anonymous|0 f64.const 4 f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 17 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2 - global.set $~lib/argc - i32.const 2 i32.const 3 global.get $function-types/i32Adder - call_indirect (type $FUNCSIG$iii) + call $function-types/doAddWithFn i32.const 5 i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 23 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2 global.set $~lib/argc i32.const 3 i32.const 4 - i32.const 1 - call_indirect (type $FUNCSIG$iii) + call $function-types/makeAdder~anonymous|0 i32.const 7 i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 29 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 2 - global.set $~lib/argc i32.const 4 i32.const 5 i32.const 4 - call_indirect (type $FUNCSIG$iii) + call $function-types/doAddWithFn i32.const 9 i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 35 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2 @@ -147,43 +149,39 @@ i32.const 1 local.set $0 end - i32.const 2 - global.set $~lib/argc i32.const 1 i32.const 2 local.get $0 - call_indirect (type $FUNCSIG$iii) + call $function-types/doAddWithFn i32.const 3 i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 41 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 2 - global.set $~lib/argc i32.const 1 i32.const 2 i32.const 1 - call_indirect (type $FUNCSIG$iii) + call $function-types/doAddWithFn i32.const 3 i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 42 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) - (func $start (; 5 ;) (type $FUNCSIG$v) + (func $start (; 6 ;) (type $FUNCSIG$v) call $start:function-types ) - (func $null (; 6 ;) (type $FUNCSIG$v) + (func $null (; 7 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/function-types.untouched.wat b/tests/compiler/function-types.untouched.wat index b63eaf8255..a02dbe06cb 100644 --- a/tests/compiler/function-types.untouched.wat +++ b/tests/compiler/function-types.untouched.wat @@ -6,17 +6,15 @@ (type $FUNCSIG$ddd (func (param f64 f64) (result f64))) (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\11\00\00\00f\00u\00n\00c\00t\00i\00o\00n\00-\00t\00y\00p\00e\00s\00.\00t\00s\00") + (data (i32.const 8) "\"\00\00\00\01\00\00\00\01\00\00\00\"\00\00\00f\00u\00n\00c\00t\00i\00o\00n\00-\00t\00y\00p\00e\00s\00.\00t\00s\00") (table $0 5 funcref) (elem (i32.const 0) $null $function-types/makeAdder~anonymous|0 $function-types/makeAdder~anonymous|0 $function-types/makeAdder~anonymous|0 $function-types/addI32) (global $function-types/i32Adder (mut i32) (i32.const 0)) (global $~lib/argc (mut i32) (i32.const 0)) (global $function-types/i64Adder (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 48)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $function-types/makeAdder~anonymous|0 (; 1 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 @@ -106,10 +104,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 11 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end call $function-types/makeAdder @@ -127,10 +125,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 15 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block (result f64) @@ -146,10 +144,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 17 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2 @@ -161,10 +159,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 23 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 3 @@ -175,10 +173,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 29 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 4 @@ -190,10 +188,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 35 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block (result i32) @@ -209,10 +207,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 41 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -224,10 +222,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 42 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/function.json b/tests/compiler/function.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/function.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/function.optimized.wat b/tests/compiler/function.optimized.wat index 86b388ad0a..e2acb0a3b8 100644 --- a/tests/compiler/function.optimized.wat +++ b/tests/compiler/function.optimized.wat @@ -1,10 +1,7 @@ (module (type $FUNCSIG$v (func)) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $start) (export "memory" (memory $0)) - (export "table" (table $0)) (func $start (; 0 ;) (type $FUNCSIG$v) nop ) diff --git a/tests/compiler/function.untouched.wat b/tests/compiler/function.untouched.wat index b76f67e92f..1e51a1fe49 100644 --- a/tests/compiler/function.untouched.wat +++ b/tests/compiler/function.untouched.wat @@ -17,15 +17,13 @@ (memory $0 0) (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $function/_ (; 0 ;) (type $FUNCSIG$v) nop ) (func $function/v (; 1 ;) (type $FUNCSIG$v) - nop + return ) (func $function/i (; 2 ;) (type $FUNCSIG$i) (result i32) i32.const 0 @@ -43,7 +41,7 @@ nop ) (func $function/iv (; 7 ;) (type $FUNCSIG$vi) (param $0 i32) - nop + return ) (func $function/ii (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 @@ -61,7 +59,7 @@ nop ) (func $function/iiv (; 13 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - nop + return ) (func $function/iii (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 diff --git a/tests/compiler/getter-call.json b/tests/compiler/getter-call.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/getter-call.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/getter-call.optimized.wat b/tests/compiler/getter-call.optimized.wat index e8a68bcf42..83ce54dcb4 100644 --- a/tests/compiler/getter-call.optimized.wat +++ b/tests/compiler/getter-call.optimized.wat @@ -1,37 +1,38 @@ (module - (type $FUNCSIG$v (func)) (type $FUNCSIG$i (func (result i32))) + (type $FUNCSIG$v (func)) (memory $0 0) (table $0 2 funcref) (elem (i32.const 0) $null $getter-call/C#get:x~anonymous|0) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) (global $~lib/argc (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "test" (func $getter-call/test)) (start $start) - (func $~lib/allocator/arena/__memory_allocate (; 0 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/rt/stub/__alloc (; 0 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) - global.get $~lib/allocator/arena/offset - local.tee $0 - i32.const 8 + global.get $~lib/rt/stub/offset + i32.const 16 i32.add - i32.const -8 - i32.and local.tee $1 - current_memory + i32.const 16 + i32.add + i32.const -16 + i32.and + local.tee $0 + memory.size local.tee $2 i32.const 16 i32.shl i32.gt_u if local.get $2 - local.get $1 local.get $0 + local.get $1 i32.sub i32.const 65535 i32.add @@ -44,12 +45,12 @@ local.get $3 i32.gt_s select - grow_memory + memory.grow i32.const 0 i32.lt_s if local.get $3 - grow_memory + memory.grow i32.const 0 i32.lt_s if @@ -57,26 +58,34 @@ end end end + local.get $0 + global.set $~lib/rt/stub/offset local.get $1 - global.set $~lib/allocator/arena/offset + i32.const 16 + i32.sub + local.tee $0 + i32.const 3 + i32.store offset=8 local.get $0 + i32.const 0 + i32.store offset=12 + local.get $1 ) (func $getter-call/C#get:x~anonymous|0 (; 1 ;) (type $FUNCSIG$i) (result i32) i32.const 42 ) (func $getter-call/test (; 2 ;) (type $FUNCSIG$i) (result i32) - call $~lib/allocator/arena/__memory_allocate + call $~lib/rt/stub/__alloc drop i32.const 0 global.set $~lib/argc - i32.const 1 - call_indirect (type $FUNCSIG$i) + call $getter-call/C#get:x~anonymous|0 ) (func $start (; 3 ;) (type $FUNCSIG$v) - i32.const 8 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset + i32.const 16 + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset ) (func $null (; 4 ;) (type $FUNCSIG$v) nop diff --git a/tests/compiler/getter-call.ts b/tests/compiler/getter-call.ts index a75450f230..968abc6acc 100644 --- a/tests/compiler/getter-call.ts +++ b/tests/compiler/getter-call.ts @@ -1,5 +1,3 @@ -import "allocator/arena"; - class C { get x(): () => i32 { return (): i32 => 42; diff --git a/tests/compiler/getter-call.untouched.wat b/tests/compiler/getter-call.untouched.wat index a275537b5e..fa86224e21 100644 --- a/tests/compiler/getter-call.untouched.wat +++ b/tests/compiler/getter-call.untouched.wat @@ -1,75 +1,64 @@ (module - (type $FUNCSIG$v (func)) (type $FUNCSIG$i (func (result i32))) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$v (func)) (memory $0 0) (table $0 2 funcref) (elem (i32.const 0) $null $getter-call/C#get:x~anonymous|0) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) (global $~lib/argc (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) + (global $~lib/heap/__heap_base i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "test" (func $getter-call/test)) (start $start) - (func $start:~lib/allocator/arena (; 0 ;) (type $FUNCSIG$v) - global.get $~lib/memory/HEAP_BASE - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - ) - (func $start:getter-call (; 1 ;) (type $FUNCSIG$v) - call $start:~lib/allocator/arena - ) - (func $~lib/allocator/arena/__memory_allocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/rt/stub/__alloc (; 0 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) + (local $8 i32) local.get $0 - i32.const 1073741824 + i32.const 1073741808 i32.gt_u if unreachable end - global.get $~lib/allocator/arena/offset - local.set $1 - local.get $1 + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.set $2 + local.get $2 local.get $0 - local.tee $2 - i32.const 1 local.tee $3 - local.get $2 + i32.const 1 + local.tee $4 local.get $3 + local.get $4 i32.gt_u select i32.add - i32.const 7 + i32.const 15 i32.add - i32.const 7 + i32.const 15 i32.const -1 i32.xor i32.and - local.set $4 - current_memory local.set $5 - local.get $4 + memory.size + local.set $6 local.get $5 + local.get $6 i32.const 16 i32.shl i32.gt_u if - local.get $4 - local.get $1 + local.get $5 + local.get $2 i32.sub i32.const 65535 i32.add @@ -79,23 +68,23 @@ i32.and i32.const 16 i32.shr_u - local.set $2 - local.get $5 - local.tee $3 - local.get $2 - local.tee $6 - local.get $3 + local.set $3 local.get $6 + local.tee $4 + local.get $3 + local.tee $7 + local.get $4 + local.get $7 i32.gt_s select - local.set $3 - local.get $3 - grow_memory + local.set $4 + local.get $4 + memory.grow i32.const 0 i32.lt_s if - local.get $2 - grow_memory + local.get $3 + memory.grow i32.const 0 i32.lt_s if @@ -103,45 +92,74 @@ end end end - local.get $4 - global.set $~lib/allocator/arena/offset + local.get $5 + global.set $~lib/rt/stub/offset + local.get $2 + i32.const 16 + i32.sub + local.set $8 + local.get $8 local.get $1 + i32.store offset=8 + local.get $8 + local.get $0 + i32.store offset=12 + local.get $2 ) - (func $~lib/memory/memory.allocate (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/rt/stub/__retain (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - call $~lib/allocator/arena/__memory_allocate - return ) - (func $getter-call/C#constructor (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $getter-call/C#constructor (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.eqz if i32.const 0 - call $~lib/memory/memory.allocate + i32.const 3 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain local.set $0 end local.get $0 ) - (func $getter-call/C#get:x~anonymous|0 (; 5 ;) (type $FUNCSIG$i) (result i32) + (func $getter-call/C#get:x~anonymous|0 (; 3 ;) (type $FUNCSIG$i) (result i32) i32.const 42 ) - (func $getter-call/C#get:x (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $getter-call/C#get:x (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 ) - (func $getter-call/test (; 7 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/rt/stub/__release (; 5 ;) (type $FUNCSIG$vi) (param $0 i32) + nop + ) + (func $getter-call/test (; 6 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) + (local $1 i32) i32.const 0 call $getter-call/C#constructor local.set $0 - i32.const 0 - global.set $~lib/argc + block (result i32) + i32.const 0 + global.set $~lib/argc + local.get $0 + call $getter-call/C#get:x + call_indirect (type $FUNCSIG$i) + end + local.set $1 local.get $0 - call $getter-call/C#get:x - call_indirect (type $FUNCSIG$i) + call $~lib/rt/stub/__release + local.get $1 ) - (func $start (; 8 ;) (type $FUNCSIG$v) - call $start:getter-call + (func $start (; 7 ;) (type $FUNCSIG$v) + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset ) - (func $null (; 9 ;) (type $FUNCSIG$v) + (func $null (; 8 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/getter-setter.json b/tests/compiler/getter-setter.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/getter-setter.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/getter-setter.optimized.wat b/tests/compiler/getter-setter.optimized.wat index 4cd6c0de5b..d966cb489e 100644 --- a/tests/compiler/getter-setter.optimized.wat +++ b/tests/compiler/getter-setter.optimized.wat @@ -1,23 +1,20 @@ (module (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00g\00e\00t\00t\00e\00r\00-\00s\00e\00t\00t\00e\00r\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $null) + (data (i32.const 8) " \00\00\00\01\00\00\00\01\00\00\00 \00\00\00g\00e\00t\00t\00e\00r\00-\00s\00e\00t\00t\00e\00r\00.\00t\00s") (global $getter-setter/Foo._bar (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $start:getter-setter (; 1 ;) (type $FUNCSIG$v) global.get $getter-setter/Foo._bar if i32.const 0 - i32.const 8 + i32.const 24 i32.const 13 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -27,10 +24,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 15 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2 @@ -40,10 +37,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 16 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/getter-setter.untouched.wat b/tests/compiler/getter-setter.untouched.wat index a2b8434942..e6322ce222 100644 --- a/tests/compiler/getter-setter.untouched.wat +++ b/tests/compiler/getter-setter.untouched.wat @@ -3,15 +3,13 @@ (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00g\00e\00t\00t\00e\00r\00-\00s\00e\00t\00t\00e\00r\00.\00t\00s\00") + (data (i32.const 8) " \00\00\00\01\00\00\00\01\00\00\00 \00\00\00g\00e\00t\00t\00e\00r\00-\00s\00e\00t\00t\00e\00r\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) (global $getter-setter/Foo._bar (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 44)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $getter-setter/Foo.bar.get:bar (; 1 ;) (type $FUNCSIG$i) (result i32) global.get $getter-setter/Foo._bar @@ -27,10 +25,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 13 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -41,10 +39,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 15 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block (result i32) @@ -57,10 +55,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 16 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/i64-polyfill.json b/tests/compiler/i64-polyfill.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/i64-polyfill.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/i64-polyfill.optimized.wat b/tests/compiler/i64-polyfill.optimized.wat index 4a46ba16d3..c05e3d9b3f 100644 --- a/tests/compiler/i64-polyfill.optimized.wat +++ b/tests/compiler/i64-polyfill.optimized.wat @@ -4,50 +4,47 @@ (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $../../examples/i64-polyfill/assembly/i64/lo (mut i32) (i32.const 0)) - (global $../../examples/i64-polyfill/assembly/i64/hi (mut i32) (i32.const 0)) + (global $../../lib/i64/assembly/i64/lo (mut i32) (i32.const 0)) + (global $../../lib/i64/assembly/i64/hi (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) - (export "getHi" (func $../../examples/i64-polyfill/assembly/i64/getHi)) - (export "getLo" (func $../../examples/i64-polyfill/assembly/i64/getLo)) - (export "clz" (func $../../examples/i64-polyfill/assembly/i64/clz)) - (export "ctz" (func $../../examples/i64-polyfill/assembly/i64/ctz)) - (export "popcnt" (func $../../examples/i64-polyfill/assembly/i64/popcnt)) - (export "eqz" (func $../../examples/i64-polyfill/assembly/i64/eqz)) - (export "add" (func $../../examples/i64-polyfill/assembly/i64/add)) - (export "sub" (func $../../examples/i64-polyfill/assembly/i64/sub)) - (export "mul" (func $../../examples/i64-polyfill/assembly/i64/mul)) - (export "div_s" (func $../../examples/i64-polyfill/assembly/i64/div_s)) - (export "div_u" (func $../../examples/i64-polyfill/assembly/i64/div_u)) - (export "rem_s" (func $../../examples/i64-polyfill/assembly/i64/rem_s)) - (export "rem_u" (func $../../examples/i64-polyfill/assembly/i64/rem_u)) - (export "and" (func $../../examples/i64-polyfill/assembly/i64/and)) - (export "or" (func $../../examples/i64-polyfill/assembly/i64/or)) - (export "xor" (func $../../examples/i64-polyfill/assembly/i64/xor)) - (export "shl" (func $../../examples/i64-polyfill/assembly/i64/shl)) - (export "shr_s" (func $../../examples/i64-polyfill/assembly/i64/shr_s)) - (export "shr_u" (func $../../examples/i64-polyfill/assembly/i64/shr_u)) - (export "rotl" (func $../../examples/i64-polyfill/assembly/i64/rotl)) - (export "rotr" (func $../../examples/i64-polyfill/assembly/i64/rotr)) - (export "eq" (func $../../examples/i64-polyfill/assembly/i64/eq)) - (export "ne" (func $../../examples/i64-polyfill/assembly/i64/ne)) - (export "lt_s" (func $../../examples/i64-polyfill/assembly/i64/lt_s)) - (export "lt_u" (func $../../examples/i64-polyfill/assembly/i64/lt_u)) - (export "le_s" (func $../../examples/i64-polyfill/assembly/i64/le_s)) - (export "le_u" (func $../../examples/i64-polyfill/assembly/i64/le_u)) - (export "gt_s" (func $../../examples/i64-polyfill/assembly/i64/gt_s)) - (export "gt_u" (func $../../examples/i64-polyfill/assembly/i64/gt_u)) - (export "ge_s" (func $../../examples/i64-polyfill/assembly/i64/ge_s)) - (export "ge_u" (func $../../examples/i64-polyfill/assembly/i64/ge_u)) - (func $../../examples/i64-polyfill/assembly/i64/getHi (; 0 ;) (type $FUNCSIG$i) (result i32) - global.get $../../examples/i64-polyfill/assembly/i64/hi - ) - (func $../../examples/i64-polyfill/assembly/i64/getLo (; 1 ;) (type $FUNCSIG$i) (result i32) - global.get $../../examples/i64-polyfill/assembly/i64/lo - ) - (func $../../examples/i64-polyfill/assembly/i64/clz (; 2 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (export "getHi" (func $../../lib/i64/assembly/i64/getHi)) + (export "getLo" (func $../../lib/i64/assembly/i64/getLo)) + (export "clz" (func $../../lib/i64/assembly/i64/clz)) + (export "ctz" (func $../../lib/i64/assembly/i64/ctz)) + (export "popcnt" (func $../../lib/i64/assembly/i64/popcnt)) + (export "eqz" (func $../../lib/i64/assembly/i64/eqz)) + (export "add" (func $../../lib/i64/assembly/i64/add)) + (export "sub" (func $../../lib/i64/assembly/i64/sub)) + (export "mul" (func $../../lib/i64/assembly/i64/mul)) + (export "div_s" (func $../../lib/i64/assembly/i64/div_s)) + (export "div_u" (func $../../lib/i64/assembly/i64/div_u)) + (export "rem_s" (func $../../lib/i64/assembly/i64/rem_s)) + (export "rem_u" (func $../../lib/i64/assembly/i64/rem_u)) + (export "and" (func $../../lib/i64/assembly/i64/and)) + (export "or" (func $../../lib/i64/assembly/i64/or)) + (export "xor" (func $../../lib/i64/assembly/i64/xor)) + (export "shl" (func $../../lib/i64/assembly/i64/shl)) + (export "shr_s" (func $../../lib/i64/assembly/i64/shr_s)) + (export "shr_u" (func $../../lib/i64/assembly/i64/shr_u)) + (export "rotl" (func $../../lib/i64/assembly/i64/rotl)) + (export "rotr" (func $../../lib/i64/assembly/i64/rotr)) + (export "eq" (func $../../lib/i64/assembly/i64/eq)) + (export "ne" (func $../../lib/i64/assembly/i64/ne)) + (export "lt_s" (func $../../lib/i64/assembly/i64/lt_s)) + (export "lt_u" (func $../../lib/i64/assembly/i64/lt_u)) + (export "le_s" (func $../../lib/i64/assembly/i64/le_s)) + (export "le_u" (func $../../lib/i64/assembly/i64/le_u)) + (export "gt_s" (func $../../lib/i64/assembly/i64/gt_s)) + (export "gt_u" (func $../../lib/i64/assembly/i64/gt_u)) + (export "ge_s" (func $../../lib/i64/assembly/i64/ge_s)) + (export "ge_u" (func $../../lib/i64/assembly/i64/ge_u)) + (func $../../lib/i64/assembly/i64/getHi (; 0 ;) (type $FUNCSIG$i) (result i32) + global.get $../../lib/i64/assembly/i64/hi + ) + (func $../../lib/i64/assembly/i64/getLo (; 1 ;) (type $FUNCSIG$i) (result i32) + global.get $../../lib/i64/assembly/i64/lo + ) + (func $../../lib/i64/assembly/i64/clz (; 2 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) local.get $0 i64.extend_i32_u local.get $1 @@ -57,11 +54,11 @@ i64.or i64.clz i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo i32.const 0 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/ctz (; 3 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $../../lib/i64/assembly/i64/ctz (; 3 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) local.get $0 i64.extend_i32_u local.get $1 @@ -71,11 +68,11 @@ i64.or i64.ctz i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo i32.const 0 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/popcnt (; 4 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $../../lib/i64/assembly/i64/popcnt (; 4 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) local.get $0 i64.extend_i32_u local.get $1 @@ -85,11 +82,11 @@ i64.or i64.popcnt i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo i32.const 0 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/eqz (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $../../lib/i64/assembly/i64/eqz (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) local.get $0 i64.extend_i32_u local.get $1 @@ -98,11 +95,11 @@ i64.shl i64.or i64.eqz - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo i32.const 0 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/add (; 6 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/add (; 6 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) local.get $0 i64.extend_i32_u @@ -121,14 +118,14 @@ i64.add local.tee $4 i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo local.get $4 i64.const 32 i64.shr_u i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/sub (; 7 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/sub (; 7 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) local.get $0 i64.extend_i32_u @@ -147,14 +144,14 @@ i64.sub local.tee $4 i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo local.get $4 i64.const 32 i64.shr_u i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/mul (; 8 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/mul (; 8 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) local.get $0 i64.extend_i32_u @@ -173,14 +170,14 @@ i64.mul local.tee $4 i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo local.get $4 i64.const 32 i64.shr_u i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/div_s (; 9 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/div_s (; 9 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) local.get $0 i64.extend_i32_u @@ -199,14 +196,14 @@ i64.div_s local.tee $4 i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo local.get $4 i64.const 32 i64.shr_u i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/div_u (; 10 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/div_u (; 10 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) local.get $0 i64.extend_i32_u @@ -225,14 +222,14 @@ i64.div_u local.tee $4 i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo local.get $4 i64.const 32 i64.shr_u i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/rem_s (; 11 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/rem_s (; 11 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) local.get $0 i64.extend_i32_u @@ -251,14 +248,14 @@ i64.rem_s local.tee $4 i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo local.get $4 i64.const 32 i64.shr_u i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/rem_u (; 12 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/rem_u (; 12 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) local.get $0 i64.extend_i32_u @@ -277,14 +274,14 @@ i64.rem_u local.tee $4 i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo local.get $4 i64.const 32 i64.shr_u i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/and (; 13 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/and (; 13 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) local.get $0 i64.extend_i32_u @@ -303,14 +300,14 @@ i64.and local.tee $4 i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo local.get $4 i64.const 32 i64.shr_u i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/or (; 14 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/or (; 14 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) local.get $0 i64.extend_i32_u @@ -329,14 +326,14 @@ i64.or local.tee $4 i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo local.get $4 i64.const 32 i64.shr_u i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/xor (; 15 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/xor (; 15 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) local.get $0 i64.extend_i32_u @@ -355,14 +352,14 @@ i64.xor local.tee $4 i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo local.get $4 i64.const 32 i64.shr_u i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/shl (; 16 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/shl (; 16 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) local.get $0 i64.extend_i32_u @@ -381,14 +378,14 @@ i64.shl local.tee $4 i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo local.get $4 i64.const 32 i64.shr_u i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/shr_s (; 17 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/shr_s (; 17 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) local.get $0 i64.extend_i32_u @@ -407,14 +404,14 @@ i64.shr_s local.tee $4 i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo local.get $4 i64.const 32 i64.shr_u i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/shr_u (; 18 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/shr_u (; 18 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) local.get $0 i64.extend_i32_u @@ -433,14 +430,14 @@ i64.shr_u local.tee $4 i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo local.get $4 i64.const 32 i64.shr_u i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/rotl (; 19 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/rotl (; 19 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) local.get $0 i64.extend_i32_u @@ -459,14 +456,14 @@ i64.rotl local.tee $4 i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo local.get $4 i64.const 32 i64.shr_u i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/rotr (; 20 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/rotr (; 20 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) local.get $0 i64.extend_i32_u @@ -485,14 +482,14 @@ i64.rotr local.tee $4 i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo local.get $4 i64.const 32 i64.shr_u i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/eq (; 21 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/eq (; 21 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) local.get $0 i64.extend_i32_u local.get $1 @@ -508,11 +505,11 @@ i64.shl i64.or i64.eq - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo i32.const 0 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/ne (; 22 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/ne (; 22 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) local.get $0 i64.extend_i32_u local.get $1 @@ -528,11 +525,11 @@ i64.shl i64.or i64.ne - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo i32.const 0 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/lt_s (; 23 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/lt_s (; 23 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) local.get $0 i64.extend_i32_u local.get $1 @@ -548,11 +545,11 @@ i64.shl i64.or i64.lt_s - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo i32.const 0 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/lt_u (; 24 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/lt_u (; 24 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) local.get $0 i64.extend_i32_u local.get $1 @@ -568,11 +565,11 @@ i64.shl i64.or i64.lt_u - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo i32.const 0 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/le_s (; 25 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/le_s (; 25 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) local.get $0 i64.extend_i32_u local.get $1 @@ -588,11 +585,11 @@ i64.shl i64.or i64.le_s - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo i32.const 0 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/le_u (; 26 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/le_u (; 26 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) local.get $0 i64.extend_i32_u local.get $1 @@ -608,11 +605,11 @@ i64.shl i64.or i64.le_u - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo i32.const 0 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/gt_s (; 27 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/gt_s (; 27 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) local.get $0 i64.extend_i32_u local.get $1 @@ -628,11 +625,11 @@ i64.shl i64.or i64.gt_s - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo i32.const 0 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/gt_u (; 28 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/gt_u (; 28 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) local.get $0 i64.extend_i32_u local.get $1 @@ -648,11 +645,11 @@ i64.shl i64.or i64.gt_u - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo i32.const 0 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/ge_s (; 29 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/ge_s (; 29 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) local.get $0 i64.extend_i32_u local.get $1 @@ -668,11 +665,11 @@ i64.shl i64.or i64.ge_s - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo i32.const 0 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/ge_u (; 30 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/ge_u (; 30 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) local.get $0 i64.extend_i32_u local.get $1 @@ -688,9 +685,9 @@ i64.shl i64.or i64.ge_u - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo i32.const 0 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) (func $null (; 31 ;) (type $FUNCSIG$v) nop diff --git a/tests/compiler/i64-polyfill.ts b/tests/compiler/i64-polyfill.ts index c4f52b480d..05cc27a3e5 100644 --- a/tests/compiler/i64-polyfill.ts +++ b/tests/compiler/i64-polyfill.ts @@ -31,4 +31,4 @@ export { gt_u, ge_s, ge_u -} from "../../examples/i64-polyfill/assembly/i64"; +} from "../../lib/i64/assembly/i64"; diff --git a/tests/compiler/i64-polyfill.untouched.wat b/tests/compiler/i64-polyfill.untouched.wat index 429af491ce..e1d468da83 100644 --- a/tests/compiler/i64-polyfill.untouched.wat +++ b/tests/compiler/i64-polyfill.untouched.wat @@ -6,49 +6,47 @@ (memory $0 0) (table $0 1 funcref) (elem (i32.const 0) $null) - (global $../../examples/i64-polyfill/assembly/i64/lo (mut i32) (i32.const 0)) - (global $../../examples/i64-polyfill/assembly/i64/hi (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) + (global $../../lib/i64/assembly/i64/lo (mut i32) (i32.const 0)) + (global $../../lib/i64/assembly/i64/hi (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) - (export "getHi" (func $../../examples/i64-polyfill/assembly/i64/getHi)) - (export "getLo" (func $../../examples/i64-polyfill/assembly/i64/getLo)) - (export "clz" (func $../../examples/i64-polyfill/assembly/i64/clz)) - (export "ctz" (func $../../examples/i64-polyfill/assembly/i64/ctz)) - (export "popcnt" (func $../../examples/i64-polyfill/assembly/i64/popcnt)) - (export "eqz" (func $../../examples/i64-polyfill/assembly/i64/eqz)) - (export "add" (func $../../examples/i64-polyfill/assembly/i64/add)) - (export "sub" (func $../../examples/i64-polyfill/assembly/i64/sub)) - (export "mul" (func $../../examples/i64-polyfill/assembly/i64/mul)) - (export "div_s" (func $../../examples/i64-polyfill/assembly/i64/div_s)) - (export "div_u" (func $../../examples/i64-polyfill/assembly/i64/div_u)) - (export "rem_s" (func $../../examples/i64-polyfill/assembly/i64/rem_s)) - (export "rem_u" (func $../../examples/i64-polyfill/assembly/i64/rem_u)) - (export "and" (func $../../examples/i64-polyfill/assembly/i64/and)) - (export "or" (func $../../examples/i64-polyfill/assembly/i64/or)) - (export "xor" (func $../../examples/i64-polyfill/assembly/i64/xor)) - (export "shl" (func $../../examples/i64-polyfill/assembly/i64/shl)) - (export "shr_s" (func $../../examples/i64-polyfill/assembly/i64/shr_s)) - (export "shr_u" (func $../../examples/i64-polyfill/assembly/i64/shr_u)) - (export "rotl" (func $../../examples/i64-polyfill/assembly/i64/rotl)) - (export "rotr" (func $../../examples/i64-polyfill/assembly/i64/rotr)) - (export "eq" (func $../../examples/i64-polyfill/assembly/i64/eq)) - (export "ne" (func $../../examples/i64-polyfill/assembly/i64/ne)) - (export "lt_s" (func $../../examples/i64-polyfill/assembly/i64/lt_s)) - (export "lt_u" (func $../../examples/i64-polyfill/assembly/i64/lt_u)) - (export "le_s" (func $../../examples/i64-polyfill/assembly/i64/le_s)) - (export "le_u" (func $../../examples/i64-polyfill/assembly/i64/le_u)) - (export "gt_s" (func $../../examples/i64-polyfill/assembly/i64/gt_s)) - (export "gt_u" (func $../../examples/i64-polyfill/assembly/i64/gt_u)) - (export "ge_s" (func $../../examples/i64-polyfill/assembly/i64/ge_s)) - (export "ge_u" (func $../../examples/i64-polyfill/assembly/i64/ge_u)) - (func $../../examples/i64-polyfill/assembly/i64/getHi (; 0 ;) (type $FUNCSIG$i) (result i32) - global.get $../../examples/i64-polyfill/assembly/i64/hi - ) - (func $../../examples/i64-polyfill/assembly/i64/getLo (; 1 ;) (type $FUNCSIG$i) (result i32) - global.get $../../examples/i64-polyfill/assembly/i64/lo - ) - (func $../../examples/i64-polyfill/assembly/i64/clz (; 2 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (export "getHi" (func $../../lib/i64/assembly/i64/getHi)) + (export "getLo" (func $../../lib/i64/assembly/i64/getLo)) + (export "clz" (func $../../lib/i64/assembly/i64/clz)) + (export "ctz" (func $../../lib/i64/assembly/i64/ctz)) + (export "popcnt" (func $../../lib/i64/assembly/i64/popcnt)) + (export "eqz" (func $../../lib/i64/assembly/i64/eqz)) + (export "add" (func $../../lib/i64/assembly/i64/add)) + (export "sub" (func $../../lib/i64/assembly/i64/sub)) + (export "mul" (func $../../lib/i64/assembly/i64/mul)) + (export "div_s" (func $../../lib/i64/assembly/i64/div_s)) + (export "div_u" (func $../../lib/i64/assembly/i64/div_u)) + (export "rem_s" (func $../../lib/i64/assembly/i64/rem_s)) + (export "rem_u" (func $../../lib/i64/assembly/i64/rem_u)) + (export "and" (func $../../lib/i64/assembly/i64/and)) + (export "or" (func $../../lib/i64/assembly/i64/or)) + (export "xor" (func $../../lib/i64/assembly/i64/xor)) + (export "shl" (func $../../lib/i64/assembly/i64/shl)) + (export "shr_s" (func $../../lib/i64/assembly/i64/shr_s)) + (export "shr_u" (func $../../lib/i64/assembly/i64/shr_u)) + (export "rotl" (func $../../lib/i64/assembly/i64/rotl)) + (export "rotr" (func $../../lib/i64/assembly/i64/rotr)) + (export "eq" (func $../../lib/i64/assembly/i64/eq)) + (export "ne" (func $../../lib/i64/assembly/i64/ne)) + (export "lt_s" (func $../../lib/i64/assembly/i64/lt_s)) + (export "lt_u" (func $../../lib/i64/assembly/i64/lt_u)) + (export "le_s" (func $../../lib/i64/assembly/i64/le_s)) + (export "le_u" (func $../../lib/i64/assembly/i64/le_u)) + (export "gt_s" (func $../../lib/i64/assembly/i64/gt_s)) + (export "gt_u" (func $../../lib/i64/assembly/i64/gt_u)) + (export "ge_s" (func $../../lib/i64/assembly/i64/ge_s)) + (export "ge_u" (func $../../lib/i64/assembly/i64/ge_u)) + (func $../../lib/i64/assembly/i64/getHi (; 0 ;) (type $FUNCSIG$i) (result i32) + global.get $../../lib/i64/assembly/i64/hi + ) + (func $../../lib/i64/assembly/i64/getLo (; 1 ;) (type $FUNCSIG$i) (result i32) + global.get $../../lib/i64/assembly/i64/lo + ) + (func $../../lib/i64/assembly/i64/clz (; 2 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i64) local.get $0 i64.extend_i32_u @@ -61,11 +59,11 @@ local.set $2 local.get $2 i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo i32.const 0 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/ctz (; 3 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $../../lib/i64/assembly/i64/ctz (; 3 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i64) local.get $0 i64.extend_i32_u @@ -78,11 +76,11 @@ local.set $2 local.get $2 i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo i32.const 0 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/popcnt (; 4 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $../../lib/i64/assembly/i64/popcnt (; 4 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i64) local.get $0 i64.extend_i32_u @@ -95,11 +93,11 @@ local.set $2 local.get $2 i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo i32.const 0 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/eqz (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $../../lib/i64/assembly/i64/eqz (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 i64.extend_i32_u @@ -111,11 +109,11 @@ i64.eqz local.set $2 local.get $2 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo i32.const 0 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/add (; 6 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/add (; 6 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) local.get $0 i64.extend_i32_u @@ -135,14 +133,14 @@ local.set $4 local.get $4 i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo local.get $4 i64.const 32 i64.shr_u i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/sub (; 7 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/sub (; 7 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) local.get $0 i64.extend_i32_u @@ -162,14 +160,14 @@ local.set $4 local.get $4 i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo local.get $4 i64.const 32 i64.shr_u i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/mul (; 8 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/mul (; 8 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) local.get $0 i64.extend_i32_u @@ -189,14 +187,14 @@ local.set $4 local.get $4 i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo local.get $4 i64.const 32 i64.shr_u i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/div_s (; 9 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/div_s (; 9 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) local.get $0 i64.extend_i32_u @@ -216,14 +214,14 @@ local.set $4 local.get $4 i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo local.get $4 i64.const 32 i64.shr_u i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/div_u (; 10 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/div_u (; 10 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) local.get $0 i64.extend_i32_u @@ -243,14 +241,14 @@ local.set $4 local.get $4 i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo local.get $4 i64.const 32 i64.shr_u i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/rem_s (; 11 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/rem_s (; 11 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) local.get $0 i64.extend_i32_u @@ -270,14 +268,14 @@ local.set $4 local.get $4 i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo local.get $4 i64.const 32 i64.shr_u i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/rem_u (; 12 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/rem_u (; 12 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) local.get $0 i64.extend_i32_u @@ -297,14 +295,14 @@ local.set $4 local.get $4 i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo local.get $4 i64.const 32 i64.shr_u i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/and (; 13 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/and (; 13 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) local.get $0 i64.extend_i32_u @@ -324,14 +322,14 @@ local.set $4 local.get $4 i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo local.get $4 i64.const 32 i64.shr_u i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/or (; 14 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/or (; 14 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) local.get $0 i64.extend_i32_u @@ -351,14 +349,14 @@ local.set $4 local.get $4 i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo local.get $4 i64.const 32 i64.shr_u i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/xor (; 15 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/xor (; 15 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) local.get $0 i64.extend_i32_u @@ -378,14 +376,14 @@ local.set $4 local.get $4 i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo local.get $4 i64.const 32 i64.shr_u i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/shl (; 16 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/shl (; 16 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) local.get $0 i64.extend_i32_u @@ -405,14 +403,14 @@ local.set $4 local.get $4 i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo local.get $4 i64.const 32 i64.shr_u i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/shr_s (; 17 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/shr_s (; 17 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) local.get $0 i64.extend_i32_u @@ -432,14 +430,14 @@ local.set $4 local.get $4 i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo local.get $4 i64.const 32 i64.shr_u i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/shr_u (; 18 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/shr_u (; 18 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) local.get $0 i64.extend_i32_u @@ -459,14 +457,14 @@ local.set $4 local.get $4 i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo local.get $4 i64.const 32 i64.shr_u i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/rotl (; 19 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/rotl (; 19 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) local.get $0 i64.extend_i32_u @@ -486,14 +484,14 @@ local.set $4 local.get $4 i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo local.get $4 i64.const 32 i64.shr_u i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/rotr (; 20 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/rotr (; 20 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i64) local.get $0 i64.extend_i32_u @@ -513,14 +511,14 @@ local.set $4 local.get $4 i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo local.get $4 i64.const 32 i64.shr_u i32.wrap_i64 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/eq (; 21 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/eq (; 21 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) local.get $0 i64.extend_i32_u @@ -539,11 +537,11 @@ i64.eq local.set $4 local.get $4 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo i32.const 0 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/ne (; 22 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/ne (; 22 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) local.get $0 i64.extend_i32_u @@ -562,11 +560,11 @@ i64.ne local.set $4 local.get $4 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo i32.const 0 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/lt_s (; 23 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/lt_s (; 23 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) local.get $0 i64.extend_i32_u @@ -585,11 +583,11 @@ i64.lt_s local.set $4 local.get $4 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo i32.const 0 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/lt_u (; 24 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/lt_u (; 24 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) local.get $0 i64.extend_i32_u @@ -608,11 +606,11 @@ i64.lt_u local.set $4 local.get $4 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo i32.const 0 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/le_s (; 25 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/le_s (; 25 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) local.get $0 i64.extend_i32_u @@ -631,11 +629,11 @@ i64.le_s local.set $4 local.get $4 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo i32.const 0 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/le_u (; 26 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/le_u (; 26 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) local.get $0 i64.extend_i32_u @@ -654,11 +652,11 @@ i64.le_u local.set $4 local.get $4 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo i32.const 0 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/gt_s (; 27 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/gt_s (; 27 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) local.get $0 i64.extend_i32_u @@ -677,11 +675,11 @@ i64.gt_s local.set $4 local.get $4 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo i32.const 0 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/gt_u (; 28 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/gt_u (; 28 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) local.get $0 i64.extend_i32_u @@ -700,11 +698,11 @@ i64.gt_u local.set $4 local.get $4 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo i32.const 0 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/ge_s (; 29 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/ge_s (; 29 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) local.get $0 i64.extend_i32_u @@ -723,11 +721,11 @@ i64.ge_s local.set $4 local.get $4 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo i32.const 0 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) - (func $../../examples/i64-polyfill/assembly/i64/ge_u (; 30 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../lib/i64/assembly/i64/ge_u (; 30 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) local.get $0 i64.extend_i32_u @@ -746,9 +744,9 @@ i64.ge_u local.set $4 local.get $4 - global.set $../../examples/i64-polyfill/assembly/i64/lo + global.set $../../lib/i64/assembly/i64/lo i32.const 0 - global.set $../../examples/i64-polyfill/assembly/i64/hi + global.set $../../lib/i64/assembly/i64/hi ) (func $null (; 31 ;) (type $FUNCSIG$v) ) diff --git a/tests/compiler/if.json b/tests/compiler/if.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/if.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/if.optimized.wat b/tests/compiler/if.optimized.wat index 45e0fc4136..45fe42261f 100644 --- a/tests/compiler/if.optimized.wat +++ b/tests/compiler/if.optimized.wat @@ -2,17 +2,16 @@ (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\05\00\00\00i\00f\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $start) + (data (i32.const 8) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00i\00f\00.\00t\00s") + (data (i32.const 40) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00e\00r\00r\00o\00r") (export "memory" (memory $0)) - (export "table" (table $0)) (export "ifThenElse" (func $if/ifThenElse)) (export "ifThen" (func $if/ifThen)) (export "ifThenElseBlock" (func $if/ifThenElse)) (export "ifAlwaysReturns" (func $if/ifAlwaysReturns)) + (start $start) (func $if/ifThenElse (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 0 @@ -27,20 +26,91 @@ end i32.const 0 ) - (func $if/ifAlwaysReturns (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $start:if (; 3 ;) (type $FUNCSIG$v) + i32.const 0 + call $if/ifThenElse + if + i32.const 0 + i32.const 24 + i32.const 8 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1 + call $if/ifThenElse + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 9 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + call $if/ifThen + if + i32.const 0 + i32.const 24 + i32.const 17 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1 + call $if/ifThen + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 18 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + call $if/ifThenElse + if + i32.const 0 + i32.const 24 + i32.const 30 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1 + call $if/ifThenElse + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 31 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + ) + (func $if/ifAlwaysReturns (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 if (result i32) i32.const 1 else - i32.const 0 - i32.const 8 + i32.const 56 + i32.const 24 i32.const 37 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) - (func $start (; 4 ;) (type $FUNCSIG$v) + (func $start (; 5 ;) (type $FUNCSIG$v) + call $start:if + ) + (func $null (; 6 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/if.untouched.wat b/tests/compiler/if.untouched.wat index 689321a103..b89e81e9ff 100644 --- a/tests/compiler/if.untouched.wat +++ b/tests/compiler/if.untouched.wat @@ -2,14 +2,13 @@ (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\05\00\00\00i\00f\00.\00t\00s\00") + (data (i32.const 8) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00i\00f\00.\00t\00s\00") + (data (i32.const 40) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00e\00r\00r\00o\00r\00") (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/memory/HEAP_BASE i32 (i32.const 24)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "ifThenElse" (func $if/ifThenElse)) (export "ifThen" (func $if/ifThen)) (export "ifThenElseBlock" (func $if/ifThenElseBlock)) @@ -55,10 +54,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 8 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -68,10 +67,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 9 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -81,10 +80,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 17 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -94,10 +93,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 18 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -107,10 +106,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 30 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -120,10 +119,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 31 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) @@ -133,11 +132,11 @@ i32.const 1 return else - i32.const 0 - i32.const 8 + i32.const 56 + i32.const 24 i32.const 37 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end unreachable diff --git a/tests/compiler/import.json b/tests/compiler/import.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/import.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/import.optimized.wat b/tests/compiler/import.optimized.wat index 86b388ad0a..e2acb0a3b8 100644 --- a/tests/compiler/import.optimized.wat +++ b/tests/compiler/import.optimized.wat @@ -1,10 +1,7 @@ (module (type $FUNCSIG$v (func)) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $start) (export "memory" (memory $0)) - (export "table" (table $0)) (func $start (; 0 ;) (type $FUNCSIG$v) nop ) diff --git a/tests/compiler/import.ts b/tests/compiler/import.ts index 35e127c8e7..ca6c73650c 100644 --- a/tests/compiler/import.ts +++ b/tests/compiler/import.ts @@ -21,3 +21,11 @@ other.sub(other.b, other.renamed_c) + other.renamed_mul(other.renamed_c, other.a); other.ns.two(); + +import theDefault from "./export"; + +theDefault.two(); + +import theOtherDefault from "./export-default"; + +theOtherDefault(); diff --git a/tests/compiler/import.untouched.wat b/tests/compiler/import.untouched.wat index ddade6dbc1..e47595b19f 100644 --- a/tests/compiler/import.untouched.wat +++ b/tests/compiler/import.untouched.wat @@ -7,9 +7,7 @@ (global $export/a i32 (i32.const 1)) (global $export/b i32 (i32.const 2)) (global $export/c i32 (i32.const 3)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $export/add (; 0 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 @@ -29,7 +27,10 @@ (func $export/ns.two (; 3 ;) (type $FUNCSIG$v) nop ) - (func $start:import (; 4 ;) (type $FUNCSIG$v) + (func $export-default/theDefault (; 4 ;) (type $FUNCSIG$v) + nop + ) + (func $start:import (; 5 ;) (type $FUNCSIG$v) global.get $export/a global.get $export/b call $export/add @@ -56,10 +57,12 @@ i32.add drop call $export/ns.two + call $export/ns.two + call $export-default/theDefault ) - (func $start (; 5 ;) (type $FUNCSIG$v) + (func $start (; 6 ;) (type $FUNCSIG$v) call $start:import ) - (func $null (; 6 ;) (type $FUNCSIG$v) + (func $null (; 7 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/infer-type.json b/tests/compiler/infer-type.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/infer-type.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/infer-type.optimized.wat b/tests/compiler/infer-type.optimized.wat index 1f64441e8e..e299ad1a8b 100644 --- a/tests/compiler/infer-type.optimized.wat +++ b/tests/compiler/infer-type.optimized.wat @@ -1,15 +1,12 @@ (module (type $FUNCSIG$v (func)) (memory $0 1) - (data (i32.const 8) "\0d\00\00\00i\00n\00f\00e\00r\00-\00t\00y\00p\00e\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $null) + (data (i32.const 8) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00i\00n\00f\00e\00r\00-\00t\00y\00p\00e\00.\00t\00s") (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)) (global $infer-type/rF (mut f64) (f64.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $start:infer-type (; 0 ;) (type $FUNCSIG$v) (local $0 i32) diff --git a/tests/compiler/infer-type.untouched.wat b/tests/compiler/infer-type.untouched.wat index 10490e5e4f..66b69e7ed1 100644 --- a/tests/compiler/infer-type.untouched.wat +++ b/tests/compiler/infer-type.untouched.wat @@ -5,9 +5,9 @@ (type $FUNCSIG$f (func (result f32))) (type $FUNCSIG$d (func (result f64))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\0d\00\00\00i\00n\00f\00e\00r\00-\00t\00y\00p\00e\00.\00t\00s\00") + (data (i32.const 8) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00i\00n\00f\00e\00r\00-\00t\00y\00p\00e\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) (global $infer-type/i i32 (i32.const 10)) @@ -19,9 +19,7 @@ (global $infer-type/rF (mut f64) (f64.const 0)) (global $infer-type/inferi (mut i32) (i32.const -2147483648)) (global $infer-type/inferu (mut i32) (i32.const 2147483647)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 40)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $infer-type/locals (; 1 ;) (type $FUNCSIG$v) (local $0 i32) @@ -94,7 +92,6 @@ i32.lt_s i32.eqz br_if $break|0 - nop local.get $0 i32.const 1 i32.add @@ -109,20 +106,20 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 49 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 52 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/inlining-blocklocals.json b/tests/compiler/inlining-blocklocals.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/inlining-blocklocals.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/inlining-blocklocals.optimized.wat b/tests/compiler/inlining-blocklocals.optimized.wat new file mode 100644 index 0000000000..5fee10c696 --- /dev/null +++ b/tests/compiler/inlining-blocklocals.optimized.wat @@ -0,0 +1,66 @@ +(module + (type $FUNCSIG$v (func)) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (memory $0 1) + (data (i32.const 8) ".\00\00\00\01\00\00\00\01\00\00\00.\00\00\00i\00n\00l\00i\00n\00i\00n\00g\00-\00b\00l\00o\00c\00k\00l\00o\00c\00a\00l\00s\00.\00t\00s") + (global $inlining-blocklocals/b (mut i32) (i32.const 2)) + (global $inlining-blocklocals/theCall_a (mut i32) (i32.const 0)) + (global $inlining-blocklocals/theCall_b (mut i32) (i32.const 0)) + (global $inlining-blocklocals/theCall_c (mut i32) (i32.const 0)) + (export "memory" (memory $0)) + (start $start) + (func $inlining-blocklocals/test (; 1 ;) (type $FUNCSIG$v) + (local $0 i32) + global.get $inlining-blocklocals/b + local.tee $0 + i32.const 1 + i32.add + global.set $inlining-blocklocals/b + i32.const 1 + global.set $inlining-blocklocals/theCall_a + local.get $0 + global.set $inlining-blocklocals/theCall_b + i32.const 3 + global.set $inlining-blocklocals/theCall_c + global.get $inlining-blocklocals/theCall_a + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 18 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $inlining-blocklocals/theCall_b + i32.const 2 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 19 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $inlining-blocklocals/theCall_c + i32.const 3 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 20 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $start (; 2 ;) (type $FUNCSIG$v) + call $inlining-blocklocals/test + ) + (func $null (; 3 ;) (type $FUNCSIG$v) + nop + ) +) diff --git a/tests/compiler/inlining-blocklocals.ts b/tests/compiler/inlining-blocklocals.ts new file mode 100644 index 0000000000..b11815ad71 --- /dev/null +++ b/tests/compiler/inlining-blocklocals.ts @@ -0,0 +1,23 @@ +var b: i32 = 2; + +var theCall_a: i32; +var theCall_b: i32; +var theCall_c: i32; + +@inline function theCall(a: i32, b: i32, c: i32): void { + theCall_a = a; + theCall_b = b; + theCall_c = c; +} + +function test(): void { + var a = 1; + // see comment in Compiler#makeCallInlinePrechecked + // theCall($3, $2=[except $3], $1=[except $3,$2]) + theCall(a++, b++, ++a); + assert(theCall_a == 1); + assert(theCall_b == 2); + assert(theCall_c == 3); + assert(a == 3); +} +test(); diff --git a/tests/compiler/inlining-blocklocals.untouched.wat b/tests/compiler/inlining-blocklocals.untouched.wat new file mode 100644 index 0000000000..7f265c3634 --- /dev/null +++ b/tests/compiler/inlining-blocklocals.untouched.wat @@ -0,0 +1,110 @@ +(module + (type $FUNCSIG$v (func)) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (memory $0 1) + (data (i32.const 8) ".\00\00\00\01\00\00\00\01\00\00\00.\00\00\00i\00n\00l\00i\00n\00i\00n\00g\00-\00b\00l\00o\00c\00k\00l\00o\00c\00a\00l\00s\00.\00t\00s\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $inlining-blocklocals/b (mut i32) (i32.const 2)) + (global $inlining-blocklocals/theCall_a (mut i32) (i32.const 0)) + (global $inlining-blocklocals/theCall_b (mut i32) (i32.const 0)) + (global $inlining-blocklocals/theCall_c (mut i32) (i32.const 0)) + (export "memory" (memory $0)) + (start $start) + (func $inlining-blocklocals/test (; 1 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + i32.const 1 + local.set $0 + block $inlining-blocklocals/theCall|inlined.0 + block (result i32) + local.get $0 + local.tee $1 + i32.const 1 + i32.add + local.set $0 + local.get $1 + end + local.set $3 + block (result i32) + global.get $inlining-blocklocals/b + local.tee $1 + i32.const 1 + i32.add + global.set $inlining-blocklocals/b + local.get $1 + end + local.set $2 + local.get $0 + i32.const 1 + i32.add + local.tee $0 + local.set $1 + local.get $3 + global.set $inlining-blocklocals/theCall_a + local.get $2 + global.set $inlining-blocklocals/theCall_b + local.get $1 + global.set $inlining-blocklocals/theCall_c + end + global.get $inlining-blocklocals/theCall_a + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 18 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $inlining-blocklocals/theCall_b + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 19 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $inlining-blocklocals/theCall_c + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 20 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 21 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $start:inlining-blocklocals (; 2 ;) (type $FUNCSIG$v) + call $inlining-blocklocals/test + ) + (func $start (; 3 ;) (type $FUNCSIG$v) + call $start:inlining-blocklocals + ) + (func $null (; 4 ;) (type $FUNCSIG$v) + ) +) diff --git a/tests/compiler/inlining-recursive.json b/tests/compiler/inlining-recursive.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/inlining-recursive.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/inlining-recursive.optimized.wat b/tests/compiler/inlining-recursive.optimized.wat index ae83157f80..d75cc7c9bd 100644 --- a/tests/compiler/inlining-recursive.optimized.wat +++ b/tests/compiler/inlining-recursive.optimized.wat @@ -1,10 +1,7 @@ (module (type $FUNCSIG$v (func)) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $null) (export "memory" (memory $0)) - (export "table" (table $0)) (export "foo" (func $inlining-recursive/foo)) (export "bar" (func $inlining-recursive/baz)) (export "baz" (func $inlining-recursive/baz)) diff --git a/tests/compiler/inlining-recursive.untouched.wat b/tests/compiler/inlining-recursive.untouched.wat index 89e671958e..c8f5c4fa9d 100644 --- a/tests/compiler/inlining-recursive.untouched.wat +++ b/tests/compiler/inlining-recursive.untouched.wat @@ -3,9 +3,7 @@ (memory $0 0) (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "foo" (func $inlining-recursive/foo)) (export "bar" (func $inlining-recursive/bar)) (export "baz" (func $inlining-recursive/baz)) diff --git a/tests/compiler/inlining.json b/tests/compiler/inlining.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/inlining.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/inlining.optimized.wat b/tests/compiler/inlining.optimized.wat index 338feffb9c..4a6cea5bd8 100644 --- a/tests/compiler/inlining.optimized.wat +++ b/tests/compiler/inlining.optimized.wat @@ -3,16 +3,16 @@ (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) (type $FUNCSIG$ii (func (param i32) (result i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\0b\00\00\00i\00n\00l\00i\00n\00i\00n\00g\00.\00t\00s") + (data (i32.const 8) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00i\00n\00l\00i\00n\00i\00n\00g\00.\00t\00s") (table $0 2 funcref) (elem (i32.const 0) $null $inlining/func_fe~anonymous|0) (global $~lib/argc (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "test" (func $inlining/test)) (start $start) (func $inlining/test (; 1 ;) (type $FUNCSIG$i) (result i32) @@ -25,31 +25,33 @@ i32.const 1 global.set $~lib/argc i32.const 2 - i32.const 1 - call_indirect (type $FUNCSIG$ii) + call $inlining/func_fe~anonymous|0 i32.const 2 i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 68 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) - (func $~lib/allocator/arena/__memory_allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/rt/stub/__alloc (; 4 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) + (local $4 i32) + (local $5 i32) local.get $0 - i32.const 1073741824 + i32.const 1073741808 i32.gt_u if unreachable end - global.get $~lib/allocator/arena/offset - local.tee $1 + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.tee $3 local.get $0 i32.const 1 local.get $0 @@ -57,20 +59,20 @@ i32.gt_u select i32.add - i32.const 7 + i32.const 15 i32.add - i32.const -8 + i32.const -16 i32.and - local.tee $0 - current_memory local.tee $2 + memory.size + local.tee $4 i32.const 16 i32.shl i32.gt_u if + local.get $4 local.get $2 - local.get $0 - local.get $1 + local.get $3 i32.sub i32.const 65535 i32.add @@ -78,17 +80,17 @@ i32.and i32.const 16 i32.shr_u - local.tee $3 - local.get $2 - local.get $3 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select - grow_memory + memory.grow i32.const 0 i32.lt_s if - local.get $3 - grow_memory + local.get $5 + memory.grow i32.const 0 i32.lt_s if @@ -96,19 +98,30 @@ end end end - local.get $0 - global.set $~lib/allocator/arena/offset + local.get $2 + global.set $~lib/rt/stub/offset + local.get $3 + i32.const 16 + i32.sub + local.tee $2 local.get $1 + i32.store offset=8 + local.get $2 + local.get $0 + i32.store offset=12 + local.get $3 ) (func $inlining/test_ctor (; 5 ;) (type $FUNCSIG$v) (local $0 i32) i32.const 16 - call $~lib/allocator/arena/__memory_allocate + i32.const 5 + call $~lib/rt/stub/__alloc local.tee $0 i32.eqz if i32.const 8 - call $~lib/allocator/arena/__memory_allocate + i32.const 4 + call $~lib/rt/stub/__alloc local.set $0 end local.get $0 @@ -135,10 +148,10 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 97 + i32.const 24 + i32.const 95 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -147,10 +160,10 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 98 + i32.const 24 + i32.const 96 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -159,10 +172,10 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 99 + i32.const 24 + i32.const 97 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -171,19 +184,19 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 100 + i32.const 24 + i32.const 98 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) (func $start (; 6 ;) (type $FUNCSIG$v) call $inlining/test_funcs - i32.const 40 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset + i32.const 48 + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset call $inlining/test_ctor ) (func $null (; 7 ;) (type $FUNCSIG$v) diff --git a/tests/compiler/inlining.ts b/tests/compiler/inlining.ts index 44f2198411..4c34d848d3 100644 --- a/tests/compiler/inlining.ts +++ b/tests/compiler/inlining.ts @@ -73,8 +73,6 @@ function test_funcs(): void { test_funcs(); -import "allocator/arena"; - class Baz { a: i32 = 1; b: i32; diff --git a/tests/compiler/inlining.untouched.wat b/tests/compiler/inlining.untouched.wat index 39dc34d745..986f76a3cd 100644 --- a/tests/compiler/inlining.untouched.wat +++ b/tests/compiler/inlining.untouched.wat @@ -3,18 +3,19 @@ (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) (type $FUNCSIG$ii (func (param i32) (result i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\0b\00\00\00i\00n\00l\00i\00n\00i\00n\00g\00.\00t\00s\00") + (data (i32.const 8) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00i\00n\00l\00i\00n\00i\00n\00g\00.\00t\00s\00") (table $0 2 funcref) (elem (i32.const 0) $null $inlining/func_fe~anonymous|0) (global $inlining/constantGlobal i32 (i32.const 1)) (global $~lib/argc (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 36)) + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) + (global $~lib/heap/__heap_base i32 (i32.const 48)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "test" (func $inlining/test)) (start $start) (func $inlining/test (; 1 ;) (type $FUNCSIG$i) (result i32) @@ -25,7 +26,13 @@ (func $inlining/func_fe~anonymous|0 (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 ) - (func $inlining/test_funcs (; 3 ;) (type $FUNCSIG$v) + (func $~lib/rt/stub/__retain (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + ) + (func $~lib/rt/stub/__release (; 4 ;) (type $FUNCSIG$vi) (param $0 i32) + nop + ) + (func $inlining/test_funcs (; 5 ;) (type $FUNCSIG$v) (local $0 f32) (local $1 f64) (local $2 i32) @@ -62,10 +69,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 60 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $inlining/func_ii|inlined.1 (result i32) @@ -92,10 +99,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 61 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $inlining/func_ii|inlined.2 (result i32) @@ -122,10 +129,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 62 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $inlining/func_ii_opt|inlined.0 (result i32) @@ -138,10 +145,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 63 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $inlining/func_ii_opt|inlined.1 (result i32) @@ -154,10 +161,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 64 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $inlining/func_ii_loc|inlined.0 (result i32) @@ -180,36 +187,36 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 65 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $inlining/func_ii_loc|inlined.1 (result i32) i32.const 3 + local.set $5 + local.get $5 local.set $4 local.get $4 - local.set $3 - local.get $3 + local.set $2 + local.get $2 local.set $6 local.get $6 - local.set $5 - local.get $5 i32.const 1 i32.add - local.set $2 - local.get $2 + local.set $3 + local.get $3 end i32.const 4 i32.eq i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 66 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $inlining/func_iv|inlined.0 @@ -230,19 +237,19 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 68 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $inlining/Foo.method_static|inlined.0 (result i32) i32.const 42 - local.set $2 + local.set $6 i32.const 2 - local.set $3 + local.set $2 + local.get $6 local.get $2 - local.get $3 i32.add end i32.const 44 @@ -250,89 +257,87 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 69 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 123 + call $~lib/rt/stub/__retain local.set $7 block $inlining/Foo#method_this|inlined.0 (result i32) local.get $7 - local.set $3 + local.set $4 i32.const 43 - local.set $2 + local.set $5 i32.const 3 - local.set $4 - local.get $3 + local.set $2 + local.get $4 + call $~lib/rt/stub/__retain end + local.tee $2 i32.const 123 i32.eq i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 71 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $2 + call $~lib/rt/stub/__release + local.get $7 + call $~lib/rt/stub/__release ) - (func $start:~lib/allocator/arena (; 4 ;) (type $FUNCSIG$v) - global.get $~lib/memory/HEAP_BASE - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - ) - (func $~lib/allocator/arena/__memory_allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/rt/stub/__alloc (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) + (local $8 i32) local.get $0 - i32.const 1073741824 + i32.const 1073741808 i32.gt_u if unreachable end - global.get $~lib/allocator/arena/offset - local.set $1 - local.get $1 + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.set $2 + local.get $2 local.get $0 - local.tee $2 - i32.const 1 local.tee $3 - local.get $2 + i32.const 1 + local.tee $4 local.get $3 + local.get $4 i32.gt_u select i32.add - i32.const 7 + i32.const 15 i32.add - i32.const 7 + i32.const 15 i32.const -1 i32.xor i32.and - local.set $4 - current_memory local.set $5 - local.get $4 + memory.size + local.set $6 local.get $5 + local.get $6 i32.const 16 i32.shl i32.gt_u if - local.get $4 - local.get $1 + local.get $5 + local.get $2 i32.sub i32.const 65535 i32.add @@ -342,23 +347,23 @@ i32.and i32.const 16 i32.shr_u - local.set $2 - local.get $5 - local.tee $3 - local.get $2 - local.tee $6 - local.get $3 + local.set $3 local.get $6 + local.tee $4 + local.get $3 + local.tee $7 + local.get $4 + local.get $7 i32.gt_s select - local.set $3 - local.get $3 - grow_memory + local.set $4 + local.get $4 + memory.grow i32.const 0 i32.lt_s if - local.get $2 - grow_memory + local.get $3 + memory.grow i32.const 0 i32.lt_s if @@ -366,14 +371,19 @@ end end end - local.get $4 - global.set $~lib/allocator/arena/offset + local.get $5 + global.set $~lib/rt/stub/offset + local.get $2 + i32.const 16 + i32.sub + local.set $8 + local.get $8 local.get $1 - ) - (func $~lib/memory/memory.allocate (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.store offset=8 + local.get $8 local.get $0 - call $~lib/allocator/arena/__memory_allocate - return + i32.store offset=12 + local.get $2 ) (func $inlining/test_ctor (; 7 ;) (type $FUNCSIG$v) (local $0 i32) @@ -383,51 +393,55 @@ (local $4 i32) block $inlining/Bar#constructor|inlined.0 (result i32) i32.const 0 - local.set $0 - i32.const 4 local.set $1 + i32.const 4 + local.set $0 block $inlining/Baz#constructor|inlined.0 (result i32) - local.get $0 + local.get $1 if (result i32) - local.get $0 + local.get $1 else i32.const 16 - call $~lib/memory/memory.allocate + i32.const 5 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain end - local.set $2 - i32.const 2 local.set $3 + i32.const 2 + local.set $2 block (result i32) - local.get $2 + local.get $3 i32.eqz if i32.const 8 - call $~lib/memory/memory.allocate - local.set $2 + i32.const 4 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain + local.set $3 end - local.get $2 + local.get $3 i32.const 1 i32.store - local.get $2 + local.get $3 i32.const 0 i32.store offset=4 - local.get $2 + local.get $3 end - local.get $3 - i32.store offset=4 local.get $2 + i32.store offset=4 + local.get $3 end - local.set $0 - local.get $0 + local.set $1 + local.get $1 i32.const 3 i32.store offset=8 - local.get $0 + local.get $1 i32.const 0 i32.store offset=12 - local.get $0 local.get $1 - i32.store offset=12 local.get $0 + i32.store offset=12 + local.get $1 end local.set $4 local.get $4 @@ -437,10 +451,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 97 + i32.const 24 + i32.const 95 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $4 @@ -450,10 +464,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 98 + i32.const 24 + i32.const 96 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $4 @@ -463,10 +477,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 99 + i32.const 24 + i32.const 97 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $4 @@ -476,12 +490,14 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 100 + i32.const 24 + i32.const 98 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $4 + call $~lib/rt/stub/__release ) (func $start:inlining (; 8 ;) (type $FUNCSIG$v) call $inlining/test @@ -490,14 +506,23 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 10 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end call $inlining/test_funcs - call $start:~lib/allocator/arena + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset call $inlining/test_ctor ) (func $start (; 9 ;) (type $FUNCSIG$v) diff --git a/tests/compiler/instanceof.json b/tests/compiler/instanceof.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/instanceof.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/instanceof.optimized.wat b/tests/compiler/instanceof.optimized.wat index e49cba3a51..ea52f4791a 100644 --- a/tests/compiler/instanceof.optimized.wat +++ b/tests/compiler/instanceof.optimized.wat @@ -1,23 +1,20 @@ (module (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\0d\00\00\00i\00n\00s\00t\00a\00n\00c\00e\00o\00f\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $null) + (data (i32.const 8) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00i\00n\00s\00t\00a\00n\00c\00e\00o\00f\00.\00t\00s") (global $instanceof/an (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $start:instanceof (; 1 ;) (type $FUNCSIG$v) global.get $instanceof/an if i32.const 0 - i32.const 8 + i32.const 24 i32.const 68 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -26,10 +23,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 71 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/instanceof.ts b/tests/compiler/instanceof.ts index 64d96b039c..b5b103294e 100644 --- a/tests/compiler/instanceof.ts +++ b/tests/compiler/instanceof.ts @@ -15,7 +15,7 @@ assert(!(I instanceof A)); assert(!(f instanceof A)); assert(!(F instanceof A)); -assert(!(a instanceof B)); +// assert(!(a instanceof B)); // dynamic upcast, checked in runtime/instanceof assert( b instanceof B ); assert(!(i instanceof B)); assert(!(I instanceof B)); diff --git a/tests/compiler/instanceof.untouched.wat b/tests/compiler/instanceof.untouched.wat index 8dd1d677ea..891442640a 100644 --- a/tests/compiler/instanceof.untouched.wat +++ b/tests/compiler/instanceof.untouched.wat @@ -2,10 +2,11 @@ (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$id (func (param f64) (result i32))) + (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\0d\00\00\00i\00n\00s\00t\00a\00n\00c\00e\00o\00f\00.\00t\00s\00") + (data (i32.const 8) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00i\00n\00s\00t\00a\00n\00c\00e\00o\00f\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) (global $instanceof/a (mut i32) (i32.const 0)) @@ -15,414 +16,597 @@ (global $instanceof/f (mut f32) (f32.const 0)) (global $instanceof/F (mut f64) (f64.const 0)) (global $instanceof/an (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 40)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $instanceof/isI32 (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 1 - return + block (result i32) + local.get $0 + drop + i32.const 1 + end + if + i32.const 1 + return + else + i32.const 0 + return + end + unreachable + unreachable ) (func $instanceof/isI32 (; 2 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) - i32.const 0 - return + block (result i32) + local.get $0 + drop + i32.const 0 + end + if + i32.const 1 + return + else + i32.const 0 + return + end + unreachable + unreachable ) (func $instanceof/isI32 (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 0 - return + block (result i32) + local.get $0 + drop + i32.const 0 + end + if + i32.const 1 + return + else + i32.const 0 + return + end + unreachable + unreachable ) (func $instanceof/isI32 (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 0 - return + block (result i32) + local.get $0 + drop + i32.const 0 + end + if + i32.const 1 + return + else + i32.const 0 + return + end + unreachable + unreachable + ) + (func $~lib/rt/stub/__retain (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + ) + (func $~lib/rt/stub/__release (; 6 ;) (type $FUNCSIG$vi) (param $0 i32) + nop ) - (func $start:instanceof (; 5 ;) (type $FUNCSIG$v) - i32.const 1 + (func $start:instanceof (; 7 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + block (result i32) + global.get $instanceof/a + drop + i32.const 1 + end i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 11 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 + block (result i32) + global.get $instanceof/b + drop + i32.const 1 + end i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 12 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 0 + block (result i32) + global.get $instanceof/i + drop + i32.const 0 + end i32.eqz i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 13 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 0 + block (result i32) + global.get $instanceof/I + drop + i32.const 0 + end i32.eqz i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 14 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 0 + block (result i32) + global.get $instanceof/f + drop + i32.const 0 + end i32.eqz i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 15 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 0 - i32.eqz - i32.eqz - if + block (result i32) + global.get $instanceof/F + drop i32.const 0 - i32.const 8 - i32.const 16 - i32.const 0 - call $~lib/env/abort - unreachable end - i32.const 0 i32.eqz i32.eqz if i32.const 0 - i32.const 8 - i32.const 18 + i32.const 24 + i32.const 16 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 + block (result i32) + global.get $instanceof/b + drop + i32.const 1 + end i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 19 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 0 + block (result i32) + global.get $instanceof/i + drop + i32.const 0 + end i32.eqz i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 20 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 0 + block (result i32) + global.get $instanceof/I + drop + i32.const 0 + end i32.eqz i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 21 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 0 + block (result i32) + global.get $instanceof/f + drop + i32.const 0 + end i32.eqz i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 22 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 0 + block (result i32) + global.get $instanceof/F + drop + i32.const 0 + end i32.eqz i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 23 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 0 + block (result i32) + global.get $instanceof/a + drop + i32.const 0 + end i32.eqz i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 25 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 0 + block (result i32) + global.get $instanceof/b + drop + i32.const 0 + end i32.eqz i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 26 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 + block (result i32) + global.get $instanceof/i + drop + i32.const 1 + end i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 27 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 0 + block (result i32) + global.get $instanceof/I + drop + i32.const 0 + end i32.eqz i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 28 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 0 + block (result i32) + global.get $instanceof/f + drop + i32.const 0 + end i32.eqz i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 29 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 0 + block (result i32) + global.get $instanceof/F + drop + i32.const 0 + end i32.eqz i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 30 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 0 + block (result i32) + global.get $instanceof/a + drop + i32.const 0 + end i32.eqz i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 32 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 0 + block (result i32) + global.get $instanceof/b + drop + i32.const 0 + end i32.eqz i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 33 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 0 + block (result i32) + global.get $instanceof/i + drop + i32.const 0 + end i32.eqz i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 34 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 + block (result i32) + global.get $instanceof/I + drop + i32.const 1 + end i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 35 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 0 + block (result i32) + global.get $instanceof/f + drop + i32.const 0 + end i32.eqz i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 36 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 0 + block (result i32) + global.get $instanceof/F + drop + i32.const 0 + end i32.eqz i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 37 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 0 + block (result i32) + global.get $instanceof/a + drop + i32.const 0 + end i32.eqz i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 39 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 0 + block (result i32) + global.get $instanceof/b + drop + i32.const 0 + end i32.eqz i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 40 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 0 + block (result i32) + global.get $instanceof/i + drop + i32.const 0 + end i32.eqz i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 41 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 0 + block (result i32) + global.get $instanceof/I + drop + i32.const 0 + end i32.eqz i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 42 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 + block (result i32) + global.get $instanceof/f + drop + i32.const 1 + end i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 43 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 0 + block (result i32) + global.get $instanceof/F + drop + i32.const 0 + end i32.eqz i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 44 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 0 + block (result i32) + global.get $instanceof/a + drop + i32.const 0 + end i32.eqz i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 46 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 0 + block (result i32) + global.get $instanceof/b + drop + i32.const 0 + end i32.eqz i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 47 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 0 + block (result i32) + global.get $instanceof/i + drop + i32.const 0 + end i32.eqz i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 48 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 0 + block (result i32) + global.get $instanceof/I + drop + i32.const 0 + end i32.eqz i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 49 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 0 + block (result i32) + global.get $instanceof/f + drop + i32.const 0 + end i32.eqz i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 50 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 + block (result i32) + global.get $instanceof/F + drop + i32.const 1 + end i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 51 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -430,10 +614,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 62 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -442,10 +626,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 63 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -454,10 +638,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 64 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -466,10 +650,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 65 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $instanceof/an @@ -479,23 +663,41 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 68 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 + block (result i32) + global.get $instanceof/an + drop + i32.const 1 + end i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 69 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 + block (result i32) + i32.const 1 + local.tee $0 + global.get $instanceof/an + local.tee $1 + i32.ne + if + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $1 + call $~lib/rt/stub/__release + end + local.get $0 + end global.set $instanceof/an global.get $instanceof/an i32.const 0 @@ -503,26 +705,30 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 71 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 + block (result i32) + global.get $instanceof/an + drop + i32.const 1 + end i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 72 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) - (func $start (; 6 ;) (type $FUNCSIG$v) + (func $start (; 8 ;) (type $FUNCSIG$v) call $start:instanceof ) - (func $null (; 7 ;) (type $FUNCSIG$v) + (func $null (; 9 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/limits.json b/tests/compiler/limits.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/limits.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/limits.optimized.wat b/tests/compiler/limits.optimized.wat index 86b388ad0a..e2acb0a3b8 100644 --- a/tests/compiler/limits.optimized.wat +++ b/tests/compiler/limits.optimized.wat @@ -1,10 +1,7 @@ (module (type $FUNCSIG$v (func)) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $start) (export "memory" (memory $0)) - (export "table" (table $0)) (func $start (; 0 ;) (type $FUNCSIG$v) nop ) diff --git a/tests/compiler/limits.untouched.wat b/tests/compiler/limits.untouched.wat index 16d076f1f4..73017341a9 100644 --- a/tests/compiler/limits.untouched.wat +++ b/tests/compiler/limits.untouched.wat @@ -29,9 +29,7 @@ (global $~lib/builtins/f32.MAX_SAFE_INTEGER f32 (f32.const 16777215)) (global $~lib/builtins/f64.MIN_SAFE_INTEGER f64 (f64.const -9007199254740991)) (global $~lib/builtins/f64.MAX_SAFE_INTEGER f64 (f64.const 9007199254740991)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $start:limits (; 0 ;) (type $FUNCSIG$v) global.get $~lib/builtins/i8.MIN_VALUE diff --git a/tests/compiler/literals.json b/tests/compiler/literals.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/literals.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/literals.optimized.wat b/tests/compiler/literals.optimized.wat index 86b388ad0a..e2acb0a3b8 100644 --- a/tests/compiler/literals.optimized.wat +++ b/tests/compiler/literals.optimized.wat @@ -1,10 +1,7 @@ (module (type $FUNCSIG$v (func)) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $start) (export "memory" (memory $0)) - (export "table" (table $0)) (func $start (; 0 ;) (type $FUNCSIG$v) nop ) diff --git a/tests/compiler/literals.untouched.wat b/tests/compiler/literals.untouched.wat index c40324953e..947b448255 100644 --- a/tests/compiler/literals.untouched.wat +++ b/tests/compiler/literals.untouched.wat @@ -3,9 +3,7 @@ (memory $0 0) (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $start:literals (; 0 ;) (type $FUNCSIG$v) i32.const 0 diff --git a/tests/compiler/logical.json b/tests/compiler/logical.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/logical.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/logical.optimized.wat b/tests/compiler/logical.optimized.wat index 62d8c41c95..ef1c6385b9 100644 --- a/tests/compiler/logical.optimized.wat +++ b/tests/compiler/logical.optimized.wat @@ -1,17 +1,14 @@ (module (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\n\00\00\00l\00o\00g\00i\00c\00a\00l\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $null) + (data (i32.const 8) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00l\00o\00g\00i\00c\00a\00l\00.\00t\00s") (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)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $start:logical (; 1 ;) (type $FUNCSIG$v) i32.const 2 @@ -21,10 +18,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 12 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -34,10 +31,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 15 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 2 @@ -47,10 +44,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 20 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 1 @@ -60,10 +57,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 23 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2 @@ -73,10 +70,10 @@ f32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 28 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -86,10 +83,10 @@ f32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 31 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2 @@ -99,10 +96,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 36 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -112,10 +109,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 39 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/logical.untouched.wat b/tests/compiler/logical.untouched.wat index bd2d5637f6..e4115bc678 100644 --- a/tests/compiler/logical.untouched.wat +++ b/tests/compiler/logical.untouched.wat @@ -1,22 +1,18 @@ (module (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\n\00\00\00l\00o\00g\00i\00c\00a\00l\00.\00t\00s\00") + (data (i32.const 8) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00l\00o\00g\00i\00c\00a\00l\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) (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 $~lib/memory/HEAP_BASE i32 (i32.const 32)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $start:logical (; 1 ;) (type $FUNCSIG$v) - (local $0 i32) - (local $1 f64) i32.const 0 if (result i32) unreachable @@ -27,10 +23,12 @@ f64.const 0 f64.const 0 f64.ne - if (result f64) + if (result i32) unreachable - else f64.const 0 + unreachable + else + i32.const 0 end drop i32.const 1 @@ -43,10 +41,12 @@ f64.const 1 f64.const 0 f64.ne - if (result f64) - f64.const 1 + if (result i32) + i32.const 1 else unreachable + f64.const 0 + unreachable end drop i32.const 1 @@ -55,9 +55,8 @@ else i32.const 1 end - local.tee $0 if (result i32) - local.get $0 + i32.const 1 else unreachable end @@ -70,13 +69,14 @@ else f64.const 1 end - local.tee $1 f64.const 0 f64.ne - if (result f64) - local.get $1 + if (result i32) + i32.const 1 else unreachable + f64.const 0 + unreachable end drop i32.const 1 @@ -92,10 +92,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 12 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -111,10 +111,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 15 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 1 @@ -132,10 +132,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 20 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 0 @@ -153,10 +153,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 23 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -174,10 +174,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 28 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -195,10 +195,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 31 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -216,10 +216,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 36 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -237,10 +237,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 39 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/main.optimized.wat b/tests/compiler/main.optimized.wat deleted file mode 100644 index 4316755194..0000000000 --- a/tests/compiler/main.optimized.wat +++ /dev/null @@ -1,26 +0,0 @@ -(module - (type $FUNCSIG$v (func)) - (type $FUNCSIG$iii (func (param i32 i32) (result i32))) - (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $main/code (mut i32) (i32.const 0)) - (global $~lib/started (mut i32) (i32.const 0)) - (export "memory" (memory $0)) - (export "table" (table $0)) - (export "main" (func $main/main)) - (func $main/main (; 0 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - global.get $~lib/started - i32.eqz - if - i32.const 1 - global.set $main/code - i32.const 1 - global.set $~lib/started - end - global.get $main/code - ) - (func $null (; 1 ;) (type $FUNCSIG$v) - nop - ) -) diff --git a/tests/compiler/main.ts b/tests/compiler/main.ts deleted file mode 100644 index 391e22b94c..0000000000 --- a/tests/compiler/main.ts +++ /dev/null @@ -1,7 +0,0 @@ -var code = 0; -code = 1; - -@start -export function main(argc: i32, argv: usize): i32 { - return code; -} diff --git a/tests/compiler/main.untouched.wat b/tests/compiler/main.untouched.wat deleted file mode 100644 index 1483eb58c4..0000000000 --- a/tests/compiler/main.untouched.wat +++ /dev/null @@ -1,32 +0,0 @@ -(module - (type $FUNCSIG$v (func)) - (type $FUNCSIG$iii (func (param i32 i32) (result i32))) - (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $main/code (mut i32) (i32.const 0)) - (global $~lib/started (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) - (export "memory" (memory $0)) - (export "table" (table $0)) - (export "main" (func $main/main)) - (func $start:main (; 0 ;) (type $FUNCSIG$v) - i32.const 1 - global.set $main/code - ) - (func $main/main (; 1 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - global.get $~lib/started - i32.eqz - if - call $start - i32.const 1 - global.set $~lib/started - end - global.get $main/code - ) - (func $start (; 2 ;) (type $FUNCSIG$v) - call $start:main - ) - (func $null (; 3 ;) (type $FUNCSIG$v) - ) -) diff --git a/tests/compiler/mandelbrot.json b/tests/compiler/mandelbrot.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/mandelbrot.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/mandelbrot.optimized.wat b/tests/compiler/mandelbrot.optimized.wat index b94c86ea2a..d7074dd099 100644 --- a/tests/compiler/mandelbrot.optimized.wat +++ b/tests/compiler/mandelbrot.optimized.wat @@ -3,39 +3,33 @@ (type $FUNCSIG$dd (func (param f64) (result f64))) (type $FUNCSIG$v (func)) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $null) (export "memory" (memory $0)) - (export "table" (table $0)) (export "computeLine" (func $../../examples/mandelbrot/assembly/index/computeLine)) (func $~lib/math/NativeMath.log (; 0 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i32) - (local $2 i32) - (local $3 i64) + (local $2 i64) + (local $3 f64) (local $4 f64) - (local $5 f64) - (local $6 i32) - (local $7 f64) + (local $5 i32) + (local $6 f64) local.get $0 i64.reinterpret_f64 - local.tee $3 + local.tee $2 i64.const 32 i64.shr_u i32.wrap_i64 - local.tee $2 + local.tee $1 i32.const 1048576 i32.lt_u - local.tee $1 - i32.eqz - if - local.get $2 + if (result i32) + i32.const 1 + else + local.get $1 i32.const 31 i32.shr_u - local.set $1 end - local.get $1 if - local.get $3 + local.get $2 i64.const 1 i64.shl i64.const 0 @@ -48,7 +42,7 @@ f64.div return end - local.get $2 + local.get $1 i32.const 31 i32.shr_u if @@ -60,18 +54,18 @@ return end i32.const -54 - local.set $6 + local.set $5 local.get $0 f64.const 18014398509481984 f64.mul i64.reinterpret_f64 - local.tee $3 + local.tee $2 i64.const 32 i64.shr_u i32.wrap_i64 - local.set $2 + local.set $1 else - local.get $2 + local.get $1 i32.const 2146435072 i32.ge_u if @@ -79,28 +73,25 @@ return else local.get $2 + i64.const 32 + i64.shl + i64.const 0 + i64.eq + i32.const 0 + local.get $1 i32.const 1072693248 i32.eq - local.tee $1 - if - local.get $3 - i64.const 32 - i64.shl - i64.const 0 - i64.eq - local.set $1 - end - local.get $1 + select if f64.const 0 return end end end - local.get $3 + local.get $2 i64.const 4294967295 i64.and - local.get $2 + local.get $1 i32.const 614242 i32.add local.tee $1 @@ -115,26 +106,26 @@ f64.reinterpret_i64 f64.const 1 f64.sub - local.tee $4 + local.tee $3 f64.const 2 - local.get $4 + local.get $3 f64.add f64.div - local.tee $5 - local.get $5 + local.tee $4 + local.get $4 f64.mul - local.tee $7 - local.get $7 + local.tee $6 + local.get $6 f64.mul local.set $0 - local.get $5 - f64.const 0.5 local.get $4 + f64.const 0.5 + local.get $3 f64.mul - local.get $4 + local.get $3 f64.mul - local.tee $5 - local.get $7 + local.tee $4 + local.get $6 f64.const 0.6666666666666735 local.get $0 f64.const 0.2857142874366239 @@ -168,18 +159,19 @@ i32.shr_s i32.const 1023 i32.sub - local.get $6 + local.get $5 i32.add + local.tee $1 f64.convert_i32_s - local.tee $0 f64.const 1.9082149292705877e-10 f64.mul f64.add - local.get $5 - f64.sub local.get $4 + f64.sub + local.get $3 f64.add - local.get $0 + local.get $1 + f64.convert_i32_s f64.const 0.6931471803691238 f64.mul f64.add @@ -187,32 +179,29 @@ (func $~lib/math/NativeMath.log2 (; 1 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) - (local $3 i32) - (local $4 i64) + (local $3 i64) + (local $4 f64) (local $5 f64) - (local $6 f64) - (local $7 i32) - (local $8 f64) + (local $6 i32) + (local $7 f64) local.get $0 i64.reinterpret_f64 - local.tee $4 + local.tee $3 i64.const 32 i64.shr_u i32.wrap_i64 - local.tee $3 + local.tee $2 i32.const 1048576 i32.lt_u - local.tee $2 - i32.eqz - if - local.get $3 + if (result i32) + i32.const 1 + else + local.get $2 i32.const 31 i32.shr_u - local.set $2 end - local.get $2 if - local.get $4 + local.get $3 i64.const 1 i64.shl i64.const 0 @@ -225,7 +214,7 @@ f64.div return end - local.get $3 + local.get $2 i32.const 31 i32.shr_u if @@ -237,18 +226,18 @@ return end i32.const -54 - local.set $7 + local.set $6 local.get $0 f64.const 18014398509481984 f64.mul i64.reinterpret_f64 - local.tee $4 + local.tee $3 i64.const 32 i64.shr_u i32.wrap_i64 - local.set $3 + local.set $2 else - local.get $3 + local.get $2 i32.const 2146435072 i32.ge_u if @@ -256,28 +245,25 @@ return else local.get $3 + i64.const 32 + i64.shl + i64.const 0 + i64.eq + i32.const 0 + local.get $2 i32.const 1072693248 i32.eq - local.tee $2 - if - local.get $4 - i64.const 32 - i64.shl - i64.const 0 - i64.eq - local.set $2 - end - local.get $2 + select if f64.const 0 return end end end - local.get $4 + local.get $3 i64.const 4294967295 i64.and - local.get $3 + local.get $2 i32.const 614242 i32.add local.tee $2 @@ -297,12 +283,12 @@ local.get $1 f64.add f64.div + local.tee $4 + local.get $4 + f64.mul local.tee $5 local.get $5 f64.mul - local.tee $6 - local.get $6 - f64.mul local.set $0 local.get $1 local.get $1 @@ -317,13 +303,13 @@ i64.const -4294967296 i64.and f64.reinterpret_i64 - local.tee $8 + local.tee $7 f64.sub local.get $1 f64.sub - local.get $5 + local.get $4 local.get $1 - local.get $6 + local.get $5 f64.const 0.6666666666666735 local.get $0 f64.const 0.2857142874366239 @@ -359,18 +345,18 @@ i32.shr_u i32.const 1023 i32.sub - local.get $7 + local.get $6 i32.add f64.convert_i32_s - local.tee $5 - local.get $8 + local.tee $4 + local.get $7 f64.const 1.4426950407214463 f64.mul - local.tee $6 + local.tee $5 f64.add local.set $1 local.get $0 - local.get $8 + local.get $7 f64.add f64.const 1.6751713164886512e-10 f64.mul @@ -378,10 +364,10 @@ f64.const 1.4426950407214463 f64.mul f64.add - local.get $5 + local.get $4 local.get $1 f64.sub - local.get $6 + local.get $5 f64.add f64.add local.get $1 @@ -390,7 +376,7 @@ (func $../../examples/mandelbrot/assembly/index/computeLine (; 2 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 f64) (local $5 f64) - (local $6 f64) + (local $6 i32) (local $7 i32) (local $8 f64) (local $9 f64) @@ -399,78 +385,79 @@ (local $12 f64) (local $13 f64) (local $14 f64) + (local $15 f64) + local.get $0 + f64.convert_i32_u + local.get $2 + f64.convert_i32_u + f64.const 0.5 + f64.mul + f64.sub f64.const 10 f64.const 3 local.get $1 f64.convert_i32_u - local.tee $4 f64.mul f64.const 4 local.get $2 f64.convert_i32_u - local.tee $6 f64.mul f64.min f64.div - local.set $8 - local.get $0 - f64.convert_i32_u - local.get $6 - f64.const 0.5 + local.tee $9 f64.mul - f64.sub - local.get $8 - f64.mul - local.set $9 - local.get $4 + local.set $10 + local.get $1 + f64.convert_i32_u f64.const 0.625 f64.mul - local.get $8 + local.get $9 f64.mul - local.set $11 + local.set $12 local.get $0 local.get $1 i32.mul i32.const 1 i32.shl - local.set $2 + local.set $0 f64.const 1 local.get $3 f64.convert_i32_u - local.tee $6 f64.div - local.set $12 + local.set $13 f64.const 8 - local.get $6 + local.get $3 + f64.convert_i32_u f64.min - local.set $13 + local.set $14 loop $repeat|0 - local.get $7 - local.get $1 - i32.lt_u - if + block $break|0 + local.get $7 + local.get $1 + i32.ge_u + br_if $break|0 local.get $7 f64.convert_i32_u - local.get $8 + local.get $9 f64.mul - local.get $11 + local.get $12 f64.sub - local.set $10 + local.set $11 f64.const 0 local.set $4 f64.const 0 local.set $5 i32.const 0 - local.set $0 + local.set $6 loop $continue|1 local.get $4 local.get $4 f64.mul - local.tee $14 + local.tee $15 local.get $5 local.get $5 f64.mul - local.tee $6 + local.tee $8 f64.add f64.const 4 f64.le @@ -481,31 +468,31 @@ f64.mul local.get $5 f64.mul - local.get $9 + local.get $10 f64.add local.set $5 - local.get $14 - local.get $6 + local.get $15 + local.get $8 f64.sub - local.get $10 + local.get $11 f64.add local.set $4 - local.get $0 + local.get $6 local.get $3 i32.ge_u br_if $break|1 - local.get $0 + local.get $6 i32.const 1 i32.add - local.set $0 + local.set $6 br $continue|1 end end end loop $continue|2 - local.get $0 + local.get $6 f64.convert_i32_u - local.get $13 + local.get $14 f64.lt if local.get $4 @@ -515,30 +502,32 @@ local.get $5 f64.mul f64.sub - local.get $10 + local.get $11 f64.add - local.set $6 + local.set $8 f64.const 2 local.get $4 f64.mul local.get $5 f64.mul - local.get $9 + local.get $10 f64.add local.set $5 - local.get $6 + local.get $8 local.set $4 - local.get $0 + local.get $6 i32.const 1 i32.add - local.set $0 + local.set $6 br $continue|2 end end + i32.const 2047 + local.set $2 local.get $7 i32.const 1 i32.shl - local.get $2 + local.get $0 i32.add local.get $4 local.get $4 @@ -547,22 +536,22 @@ local.get $5 f64.mul f64.add - local.tee $6 + local.tee $8 f64.const 1 f64.gt if (result i32) f64.const 2047 - local.get $0 + local.get $6 i32.const 1 i32.add f64.convert_i32_u f64.const 0.5 - local.get $6 + local.get $8 call $~lib/math/NativeMath.log f64.mul call $~lib/math/NativeMath.log2 f64.sub - local.get $12 + local.get $13 f64.mul f64.const 0 f64.max diff --git a/tests/compiler/mandelbrot.untouched.wat b/tests/compiler/mandelbrot.untouched.wat index 6ba4f0f28f..0b686f8990 100644 --- a/tests/compiler/mandelbrot.untouched.wat +++ b/tests/compiler/mandelbrot.untouched.wat @@ -1,21 +1,18 @@ (module (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$dd (func (param f64) (result f64))) - (type $FUNCSIG$dddd (func (param f64 f64 f64) (result f64))) (type $FUNCSIG$v (func)) (memory $0 0) (table $0 1 funcref) (elem (i32.const 0) $null) (global $../../examples/mandelbrot/assembly/index/NUM_COLORS i32 (i32.const 2048)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "computeLine" (func $../../examples/mandelbrot/assembly/index/computeLine)) (func $~lib/math/NativeMath.log (; 0 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i64) (local $2 i32) (local $3 i32) - (local $4 i32) + (local $4 f64) (local $5 f64) (local $6 f64) (local $7 f64) @@ -23,8 +20,7 @@ (local $9 f64) (local $10 f64) (local $11 f64) - (local $12 f64) - (local $13 i32) + (local $12 i32) local.get $0 i64.reinterpret_f64 local.set $1 @@ -38,9 +34,8 @@ local.get $2 i32.const 1048576 i32.lt_u - local.tee $4 if (result i32) - local.get $4 + i32.const 1 else local.get $2 i32.const 31 @@ -98,7 +93,6 @@ local.get $2 i32.const 1072693248 i32.eq - local.tee $4 if (result i32) local.get $1 i64.const 32 @@ -106,7 +100,7 @@ i64.const 0 i64.eq else - local.get $4 + i32.const 0 end if f64.const 0 @@ -149,46 +143,46 @@ local.get $0 f64.const 1 f64.sub - local.set $5 + local.set $4 f64.const 0.5 - local.get $5 + local.get $4 f64.mul - local.get $5 + local.get $4 f64.mul - local.set $6 - local.get $5 + local.set $5 + local.get $4 f64.const 2 - local.get $5 + local.get $4 f64.add f64.div + local.set $6 + local.get $6 + local.get $6 + f64.mul local.set $7 local.get $7 local.get $7 f64.mul local.set $8 local.get $8 - local.get $8 - f64.mul - local.set $9 - local.get $9 f64.const 0.3999999999940942 - local.get $9 + local.get $8 f64.const 0.22222198432149784 - local.get $9 + local.get $8 f64.const 0.15313837699209373 f64.mul f64.add f64.mul f64.add f64.mul - local.set $10 - local.get $8 + local.set $9 + local.get $7 f64.const 0.6666666666666735 - local.get $9 + local.get $8 f64.const 0.2857142874366239 - local.get $9 + local.get $8 f64.const 0.1818357216161805 - local.get $9 + local.get $8 f64.const 0.14798198605116586 f64.mul f64.add @@ -197,28 +191,28 @@ f64.mul f64.add f64.mul - local.set $11 - local.get $11 + local.set $10 local.get $10 + local.get $9 f64.add - local.set $12 + local.set $11 local.get $3 - local.set $13 - local.get $7 + local.set $12 local.get $6 - local.get $12 + local.get $5 + local.get $11 f64.add f64.mul - local.get $13 + local.get $12 f64.convert_i32_s f64.const 1.9082149292705877e-10 f64.mul f64.add - local.get $6 - f64.sub local.get $5 + f64.sub + local.get $4 f64.add - local.get $13 + local.get $12 f64.convert_i32_s f64.const 0.6931471803691238 f64.mul @@ -228,7 +222,7 @@ (local $1 i64) (local $2 i32) (local $3 i32) - (local $4 i32) + (local $4 f64) (local $5 f64) (local $6 f64) (local $7 f64) @@ -241,7 +235,6 @@ (local $14 f64) (local $15 f64) (local $16 f64) - (local $17 f64) local.get $0 i64.reinterpret_f64 local.set $1 @@ -255,9 +248,8 @@ local.get $2 i32.const 1048576 i32.lt_u - local.tee $4 if (result i32) - local.get $4 + i32.const 1 else local.get $2 i32.const 31 @@ -315,7 +307,6 @@ local.get $2 i32.const 1072693248 i32.eq - local.tee $4 if (result i32) local.get $1 i64.const 32 @@ -323,7 +314,7 @@ i64.const 0 i64.eq else - local.get $4 + i32.const 0 end if f64.const 0 @@ -366,46 +357,46 @@ local.get $0 f64.const 1 f64.sub - local.set $5 + local.set $4 f64.const 0.5 - local.get $5 + local.get $4 f64.mul - local.get $5 + local.get $4 f64.mul - local.set $6 - local.get $5 + local.set $5 + local.get $4 f64.const 2 - local.get $5 + local.get $4 f64.add f64.div + local.set $6 + local.get $6 + local.get $6 + f64.mul local.set $7 local.get $7 local.get $7 f64.mul local.set $8 local.get $8 - local.get $8 - f64.mul - local.set $9 - local.get $9 f64.const 0.3999999999940942 - local.get $9 + local.get $8 f64.const 0.22222198432149784 - local.get $9 + local.get $8 f64.const 0.15313837699209373 f64.mul f64.add f64.mul f64.add f64.mul - local.set $10 - local.get $8 + local.set $9 + local.get $7 f64.const 0.6666666666666735 - local.get $9 + local.get $8 f64.const 0.2857142874366239 - local.get $9 + local.get $8 f64.const 0.1818357216161805 - local.get $9 + local.get $8 f64.const 0.14798198605116586 f64.mul f64.add @@ -414,16 +405,16 @@ f64.mul f64.add f64.mul - local.set $11 - local.get $11 + local.set $10 local.get $10 + local.get $9 f64.add - local.set $12 + local.set $11 + local.get $4 local.get $5 - local.get $6 f64.sub - local.set $13 - local.get $13 + local.set $12 + local.get $12 i64.reinterpret_f64 local.set $1 local.get $1 @@ -432,62 +423,55 @@ local.set $1 local.get $1 f64.reinterpret_i64 - local.set $13 - local.get $5 - local.get $13 + local.set $12 + local.get $4 + local.get $12 f64.sub - local.get $6 + local.get $5 f64.sub - local.get $7 local.get $6 - local.get $12 + local.get $5 + local.get $11 f64.add f64.mul f64.add - local.set $14 - local.get $13 + local.set $13 + local.get $12 f64.const 1.4426950407214463 f64.mul - local.set $15 - local.get $14 + local.set $14 local.get $13 + local.get $12 f64.add f64.const 1.6751713164886512e-10 f64.mul - local.get $14 + local.get $13 f64.const 1.4426950407214463 f64.mul f64.add - local.set $16 + local.set $15 local.get $3 f64.convert_i32_s - local.set $17 - local.get $17 - local.get $15 + local.set $16 + local.get $16 + local.get $14 f64.add - local.set $9 + local.set $8 + local.get $15 local.get $16 - local.get $17 - local.get $9 + local.get $8 f64.sub - local.get $15 + local.get $14 f64.add f64.add - local.set $16 - local.get $9 local.set $15 - local.get $16 + local.get $8 + local.set $14 local.get $15 + local.get $14 f64.add ) - (func $../../examples/mandelbrot/assembly/index/clamp (; 2 ;) (type $FUNCSIG$dddd) (param $0 f64) (param $1 f64) (param $2 f64) (result f64) - local.get $0 - local.get $1 - f64.max - local.get $2 - f64.min - ) - (func $../../examples/mandelbrot/assembly/index/computeLine (; 3 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $../../examples/mandelbrot/assembly/index/computeLine (; 2 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 f64) (local $5 f64) (local $6 f64) @@ -506,6 +490,9 @@ (local $19 f64) (local $20 i32) (local $21 f64) + (local $22 f64) + (local $23 f64) + (local $24 f64) local.get $1 f64.convert_i32_u f64.const 1 @@ -568,127 +555,123 @@ i32.lt_u i32.eqz br_if $break|0 - block - local.get $12 - f64.convert_i32_u - local.get $6 - f64.mul - local.get $8 - f64.sub - local.set $13 - f64.const 0 - local.set $14 - f64.const 0 - local.set $15 - i32.const 0 - local.set $18 - block $break|1 - loop $continue|1 - local.get $14 + local.get $12 + f64.convert_i32_u + local.get $6 + f64.mul + local.get $8 + f64.sub + local.set $13 + f64.const 0 + local.set $14 + f64.const 0 + local.set $15 + i32.const 0 + local.set $18 + block $break|1 + loop $continue|1 + local.get $14 + local.get $14 + f64.mul + local.tee $16 + local.get $15 + local.get $15 + f64.mul + local.tee $17 + f64.add + f64.const 4 + f64.le + if + f64.const 2 local.get $14 f64.mul - local.tee $16 - local.get $15 local.get $15 f64.mul - local.tee $17 + local.get $7 + f64.add + local.set $15 + local.get $16 + local.get $17 + f64.sub + local.get $13 f64.add - f64.const 4 - f64.le + local.set $14 + local.get $18 + local.get $3 + i32.ge_u if - block - f64.const 2 - local.get $14 - f64.mul - local.get $15 - f64.mul - local.get $7 - f64.add - local.set $15 - local.get $16 - local.get $17 - f64.sub - local.get $13 - f64.add - local.set $14 - local.get $18 - local.get $3 - i32.ge_u - if - br $break|1 - end - local.get $18 - i32.const 1 - i32.add - local.set $18 - end - br $continue|1 + br $break|1 end + local.get $18 + i32.const 1 + i32.add + local.set $18 + br $continue|1 end end - block $break|2 - loop $continue|2 + end + block $break|2 + loop $continue|2 + local.get $18 + f64.convert_i32_u + local.get $11 + f64.lt + if + local.get $14 + local.get $14 + f64.mul + local.get $15 + local.get $15 + f64.mul + f64.sub + local.get $13 + f64.add + local.set $19 + f64.const 2 + local.get $14 + f64.mul + local.get $15 + f64.mul + local.get $7 + f64.add + local.set $15 + local.get $19 + local.set $14 local.get $18 - f64.convert_i32_u - local.get $11 - f64.lt - if - block - local.get $14 - local.get $14 - f64.mul - local.get $15 - local.get $15 - f64.mul - f64.sub - local.get $13 - f64.add - local.set $19 - f64.const 2 - local.get $14 - f64.mul - local.get $15 - f64.mul - local.get $7 - f64.add - local.set $15 - local.get $19 - local.set $14 - local.get $18 - i32.const 1 - i32.add - local.set $18 - end - br $continue|2 - end + i32.const 1 + i32.add + local.set $18 + br $continue|2 end end + end + global.get $../../examples/mandelbrot/assembly/index/NUM_COLORS + i32.const 1 + i32.sub + local.set $20 + local.get $14 + local.get $14 + f64.mul + local.get $15 + local.get $15 + f64.mul + f64.add + local.set $19 + local.get $19 + f64.const 1 + f64.gt + if + f64.const 0.5 + local.get $19 + call $~lib/math/NativeMath.log + f64.mul + call $~lib/math/NativeMath.log2 + local.set $21 global.get $../../examples/mandelbrot/assembly/index/NUM_COLORS i32.const 1 i32.sub - local.set $20 - local.get $14 - local.get $14 - f64.mul - local.get $15 - local.get $15 - f64.mul - f64.add - local.set $19 - local.get $19 - f64.const 1 - f64.gt - if - f64.const 0.5 - local.get $19 - call $~lib/math/NativeMath.log - f64.mul - call $~lib/math/NativeMath.log2 - local.set $21 - global.get $../../examples/mandelbrot/assembly/index/NUM_COLORS - i32.const 1 - i32.sub - f64.convert_i32_s + f64.convert_i32_s + block $../../examples/mandelbrot/assembly/index/clamp|inlined.0 (result f64) local.get $18 i32.const 1 i32.add @@ -697,21 +680,28 @@ f64.sub local.get $10 f64.mul + local.set $24 f64.const 0 + local.set $23 f64.const 1 - call $../../examples/mandelbrot/assembly/index/clamp - f64.mul - i32.trunc_f64_u - local.set $20 + local.set $22 + local.get $24 + local.get $23 + f64.max + local.get $22 + f64.min end - local.get $9 - local.get $12 - i32.const 1 - i32.shl - i32.add - local.get $20 - i32.store16 + f64.mul + i32.trunc_f64_u + local.set $20 end + local.get $9 + local.get $12 + i32.const 1 + i32.shl + i32.add + local.get $20 + i32.store16 local.get $12 i32.const 1 i32.add @@ -722,6 +712,6 @@ unreachable end ) - (func $null (; 4 ;) (type $FUNCSIG$v) + (func $null (; 3 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/many-locals.json b/tests/compiler/many-locals.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/many-locals.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/many-locals.optimized.wat b/tests/compiler/many-locals.optimized.wat index 8883c436a0..7722178879 100644 --- a/tests/compiler/many-locals.optimized.wat +++ b/tests/compiler/many-locals.optimized.wat @@ -1,25 +1,39 @@ (module (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\0e\00\00\00m\00a\00n\00y\00-\00l\00o\00c\00a\00l\00s\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $start) + (data (i32.const 8) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00m\00a\00n\00y\00-\00l\00o\00c\00a\00l\00s\00.\00t\00s") (export "memory" (memory $0)) - (export "table" (table $0)) (export "testI32" (func $many-locals/testI32)) (export "testI8" (func $many-locals/testI8)) - (func $many-locals/testI32 (; 0 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (start $start) + (func $many-locals/testI32 (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 ) - (func $many-locals/testI8 (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $many-locals/testI8 (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 24 i32.shl i32.const 24 i32.shr_s ) - (func $start (; 2 ;) (type $FUNCSIG$v) + (func $start (; 3 ;) (type $FUNCSIG$v) + i32.const 42 + call $many-locals/testI8 + i32.const 42 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 267 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + ) + (func $null (; 4 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/many-locals.untouched.wat b/tests/compiler/many-locals.untouched.wat index 10bd0b5dbd..89dbe39434 100644 --- a/tests/compiler/many-locals.untouched.wat +++ b/tests/compiler/many-locals.untouched.wat @@ -2,14 +2,12 @@ (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\0e\00\00\00m\00a\00n\00y\00-\00l\00o\00c\00a\00l\00s\00.\00t\00s\00") + (data (i32.const 8) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00m\00a\00n\00y\00-\00l\00o\00c\00a\00l\00s\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/memory/HEAP_BASE i32 (i32.const 40)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "testI32" (func $many-locals/testI32)) (export "testI8" (func $many-locals/testI8)) (start $start) @@ -799,10 +797,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 133 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 42 @@ -812,10 +810,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 267 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/memcpy.json b/tests/compiler/memcpy.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/memcpy.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/memcpy.optimized.wat b/tests/compiler/memcpy.optimized.wat index 371321f69e..e6b913ca0b 100644 --- a/tests/compiler/memcpy.optimized.wat +++ b/tests/compiler/memcpy.optimized.wat @@ -2,14 +2,11 @@ (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\t\00\00\00m\00e\00m\00c\00p\00y\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $null) + (data (i32.const 8) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\00m\00e\00m\00c\00p\00y\00.\00t\00s") (global $memcpy/dest (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "memcpy" (func $memcpy/memcpy)) (start $start) (func $memcpy/memcpy (; 1 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) @@ -23,7 +20,7 @@ local.get $1 i32.const 3 i32.and - local.get $2 + i32.const 0 local.get $2 select if @@ -887,10 +884,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 151 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 8 @@ -899,10 +896,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 152 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 8 @@ -915,10 +912,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 155 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 8 @@ -927,10 +924,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 156 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 16 @@ -939,10 +936,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 157 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 24 @@ -951,10 +948,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 158 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 32 @@ -963,10 +960,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 159 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 13 @@ -980,10 +977,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 162 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 16 @@ -997,10 +994,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 165 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 16 @@ -1009,10 +1006,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 166 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 24 @@ -1021,10 +1018,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 167 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 32 @@ -1033,10 +1030,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 168 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/memcpy.untouched.wat b/tests/compiler/memcpy.untouched.wat index 1bc3694e60..8c39b266d5 100644 --- a/tests/compiler/memcpy.untouched.wat +++ b/tests/compiler/memcpy.untouched.wat @@ -2,16 +2,14 @@ (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\t\00\00\00m\00e\00m\00c\00p\00y\00.\00t\00s\00") + (data (i32.const 8) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\00m\00e\00m\00c\00p\00y\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) (global $memcpy/base i32 (i32.const 8)) (global $memcpy/dest (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 32)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "memcpy" (func $memcpy/memcpy)) (start $start) (func $memcpy/memcpy (; 1 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) @@ -29,33 +27,31 @@ i32.const 4 i32.rem_u else - local.get $2 + i32.const 0 end if - block - block (result i32) - local.get $0 - local.tee $6 - i32.const 1 - i32.add - local.set $0 - local.get $6 - end - block (result i32) - local.get $1 - local.tee $6 - i32.const 1 - i32.add - local.set $1 - local.get $6 - end - i32.load8_u - i32.store8 - local.get $2 + block (result i32) + local.get $0 + local.tee $6 i32.const 1 - i32.sub - local.set $2 + i32.add + local.set $0 + local.get $6 end + block (result i32) + local.get $1 + local.tee $6 + i32.const 1 + i32.add + local.set $1 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 br $continue|0 end end @@ -72,48 +68,46 @@ i32.const 16 i32.ge_u if - block - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $1 - i32.const 4 - i32.add - i32.load - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $1 - i32.const 8 - i32.add - i32.load - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 12 - i32.add - i32.load - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - end + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 8 + i32.add + i32.load + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 12 + i32.add + i32.load + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 br $continue|1 end end @@ -296,154 +290,22 @@ i32.const 17 i32.ge_u if - block - local.get $1 - i32.const 1 - i32.add - i32.load - local.set $5 - local.get $0 - local.get $4 - i32.const 24 - i32.shr_u - local.get $5 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 5 - i32.add - i32.load - local.set $4 - local.get $0 - i32.const 4 - i32.add - local.get $5 - i32.const 24 - i32.shr_u - local.get $4 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 9 - i32.add - i32.load - local.set $5 - local.get $0 - i32.const 8 - i32.add - local.get $4 - i32.const 24 - i32.shr_u - local.get $5 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 13 - i32.add - i32.load - local.set $4 - local.get $0 - i32.const 12 - i32.add - local.get $5 - i32.const 24 - i32.shr_u - local.get $4 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - end - br $continue|3 - end - end - end - br $break|2 - end - local.get $1 - i32.load - local.set $4 - block (result i32) - local.get $0 - local.tee $6 - i32.const 1 - i32.add - local.set $0 - local.get $6 - end - block (result i32) - local.get $1 - local.tee $6 - i32.const 1 - i32.add - local.set $1 - local.get $6 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $6 - i32.const 1 - i32.add - local.set $0 - local.get $6 - end - block (result i32) - local.get $1 - local.tee $6 - i32.const 1 - i32.add - local.set $1 - local.get $6 - end - i32.load8_u - i32.store8 - local.get $2 - i32.const 2 - i32.sub - local.set $2 - block $break|4 - loop $continue|4 - local.get $2 - i32.const 18 - i32.ge_u - if - block local.get $1 - i32.const 2 + i32.const 1 i32.add i32.load local.set $5 local.get $0 local.get $4 - i32.const 16 + i32.const 24 i32.shr_u local.get $5 - i32.const 16 + i32.const 8 i32.shl i32.or i32.store local.get $1 - i32.const 6 + i32.const 5 i32.add i32.load local.set $4 @@ -451,15 +313,15 @@ i32.const 4 i32.add local.get $5 - i32.const 16 + i32.const 24 i32.shr_u local.get $4 - i32.const 16 + i32.const 8 i32.shl i32.or i32.store local.get $1 - i32.const 10 + i32.const 9 i32.add i32.load local.set $5 @@ -467,15 +329,15 @@ i32.const 8 i32.add local.get $4 - i32.const 16 + i32.const 24 i32.shr_u local.get $5 - i32.const 16 + i32.const 8 i32.shl i32.or i32.store local.get $1 - i32.const 14 + i32.const 13 i32.add i32.load local.set $4 @@ -483,10 +345,10 @@ i32.const 12 i32.add local.get $5 - i32.const 16 + i32.const 24 i32.shr_u local.get $4 - i32.const 16 + i32.const 8 i32.shl i32.or i32.store @@ -502,61 +364,77 @@ i32.const 16 i32.sub local.set $2 + br $continue|3 end - br $continue|4 end end + br $break|2 end - br $break|2 - end - local.get $1 - i32.load - local.set $4 - block (result i32) - local.get $0 - local.tee $6 - i32.const 1 - i32.add - local.set $0 - local.get $6 - end - block (result i32) local.get $1 - local.tee $6 - i32.const 1 - i32.add - local.set $1 - local.get $6 - end - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - block $break|5 - loop $continue|5 - local.get $2 - i32.const 19 - i32.ge_u - if - block + i32.load + local.set $4 + block (result i32) + local.get $0 + local.tee $6 + i32.const 1 + i32.add + local.set $0 + local.get $6 + end + block (result i32) + local.get $1 + local.tee $6 + i32.const 1 + i32.add + local.set $1 + local.get $6 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $6 + i32.const 1 + i32.add + local.set $0 + local.get $6 + end + block (result i32) + local.get $1 + local.tee $6 + i32.const 1 + i32.add + local.set $1 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + block $break|4 + loop $continue|4 + local.get $2 + i32.const 18 + i32.ge_u + if local.get $1 - i32.const 3 + i32.const 2 i32.add i32.load local.set $5 local.get $0 local.get $4 - i32.const 8 + i32.const 16 i32.shr_u local.get $5 - i32.const 24 + i32.const 16 i32.shl i32.or i32.store local.get $1 - i32.const 7 + i32.const 6 i32.add i32.load local.set $4 @@ -564,15 +442,15 @@ i32.const 4 i32.add local.get $5 - i32.const 8 + i32.const 16 i32.shr_u local.get $4 - i32.const 24 + i32.const 16 i32.shl i32.or i32.store local.get $1 - i32.const 11 + i32.const 10 i32.add i32.load local.set $5 @@ -580,15 +458,15 @@ i32.const 8 i32.add local.get $4 - i32.const 8 + i32.const 16 i32.shr_u local.get $5 - i32.const 24 + i32.const 16 i32.shl i32.or i32.store local.get $1 - i32.const 15 + i32.const 14 i32.add i32.load local.set $4 @@ -596,10 +474,10 @@ i32.const 12 i32.add local.get $5 - i32.const 8 + i32.const 16 i32.shr_u local.get $4 - i32.const 24 + i32.const 16 i32.shl i32.or i32.store @@ -615,7 +493,117 @@ i32.const 16 i32.sub local.set $2 + br $continue|4 end + end + end + br $break|2 + end + local.get $1 + i32.load + local.set $4 + block (result i32) + local.get $0 + local.tee $6 + i32.const 1 + i32.add + local.set $0 + local.get $6 + end + block (result i32) + local.get $1 + local.tee $6 + i32.const 1 + i32.add + local.set $1 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + block $break|5 + loop $continue|5 + local.get $2 + i32.const 19 + i32.ge_u + if + local.get $1 + i32.const 3 + i32.add + i32.load + local.set $5 + local.get $0 + local.get $4 + i32.const 8 + i32.shr_u + local.get $5 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 7 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 4 + i32.add + local.get $5 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 11 + i32.add + i32.load + local.set $5 + local.get $0 + i32.const 8 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $5 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 15 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 12 + i32.add + local.get $5 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 br $continue|5 end end @@ -1244,10 +1232,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 151 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $memcpy/base @@ -1257,10 +1245,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 152 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $memcpy/base @@ -1274,10 +1262,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 155 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $memcpy/base @@ -1287,10 +1275,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 156 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $memcpy/base @@ -1302,10 +1290,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 157 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $memcpy/base @@ -1317,10 +1305,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 158 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $memcpy/base @@ -1332,10 +1320,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 159 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $memcpy/base @@ -1354,10 +1342,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 162 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $memcpy/base @@ -1376,10 +1364,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 165 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $memcpy/base @@ -1391,10 +1379,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 166 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $memcpy/base @@ -1406,10 +1394,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 167 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $memcpy/base @@ -1421,10 +1409,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 168 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/memmove.json b/tests/compiler/memmove.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/memmove.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/memmove.optimized.wat b/tests/compiler/memmove.optimized.wat index af49c1b14b..151315b55d 100644 --- a/tests/compiler/memmove.optimized.wat +++ b/tests/compiler/memmove.optimized.wat @@ -2,14 +2,11 @@ (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\n\00\00\00m\00e\00m\00m\00o\00v\00e\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $null) + (data (i32.const 8) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00m\00e\00m\00m\00o\00v\00e\00.\00t\00s") (global $memmove/dest (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $memmove/memmove (; 1 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -216,10 +213,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 55 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 8 @@ -228,10 +225,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 56 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 8 @@ -244,10 +241,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 59 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 8 @@ -256,10 +253,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 60 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 16 @@ -268,10 +265,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 61 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 24 @@ -280,10 +277,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 62 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 32 @@ -292,10 +289,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 63 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 13 @@ -309,10 +306,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 66 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 16 @@ -326,10 +323,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 69 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 16 @@ -338,10 +335,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 70 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 24 @@ -350,10 +347,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 71 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 32 @@ -362,10 +359,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 72 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/memmove.untouched.wat b/tests/compiler/memmove.untouched.wat index 0a0707b916..8b820dde8e 100644 --- a/tests/compiler/memmove.untouched.wat +++ b/tests/compiler/memmove.untouched.wat @@ -2,16 +2,14 @@ (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\n\00\00\00m\00e\00m\00m\00o\00v\00e\00.\00t\00s\00") + (data (i32.const 8) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00m\00e\00m\00m\00o\00v\00e\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) (global $memmove/base i32 (i32.const 8)) (global $memmove/dest (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 32)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $memmove/memmove (; 1 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -43,74 +41,16 @@ i32.const 8 i32.rem_u if - block - local.get $2 - i32.eqz - if - local.get $3 - return - end - local.get $2 - i32.const 1 - i32.sub - local.set $2 - block (result i32) - local.get $0 - local.tee $4 - i32.const 1 - i32.add - local.set $0 - local.get $4 - end - block (result i32) - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $4 - end - i32.load8_u - i32.store8 - end - br $continue|0 - end - end - end - block $break|1 - loop $continue|1 - local.get $2 - i32.const 8 - i32.ge_u - if - block - local.get $0 - local.get $1 - i64.load - i64.store - local.get $2 - i32.const 8 - i32.sub - local.set $2 - local.get $0 - i32.const 8 - i32.add - local.set $0 - local.get $1 - i32.const 8 - i32.add - local.set $1 + local.get $2 + i32.eqz + if + local.get $3 + return end - br $continue|1 - end - end - end - end - block $break|2 - loop $continue|2 - local.get $2 - if - block + local.get $2 + i32.const 1 + i32.sub + local.set $2 block (result i32) local.get $0 local.tee $4 @@ -129,11 +69,63 @@ end i32.load8_u i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $2 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $1 + i64.load + i64.store local.get $2 - i32.const 1 + i32.const 8 i32.sub local.set $2 + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $2 + if + block (result i32) + local.get $0 + local.tee $4 + i32.const 1 + i32.add + local.set $0 + local.get $4 + end + block (result i32) + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $4 end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 br $continue|2 end end @@ -155,25 +147,23 @@ i32.const 8 i32.rem_u if - block - local.get $2 - i32.eqz - if - local.get $3 - return - end - local.get $0 - local.get $2 - i32.const 1 - i32.sub - local.tee $2 - i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 + local.get $2 + i32.eqz + if + local.get $3 + return end + local.get $0 + local.get $2 + i32.const 1 + i32.sub + local.tee $2 + i32.add + local.get $1 + local.get $2 + i32.add + i32.load8_u + i32.store8 br $continue|3 end end @@ -184,20 +174,18 @@ i32.const 8 i32.ge_u if - block - local.get $2 - i32.const 8 - i32.sub - local.set $2 - local.get $0 - local.get $2 - i32.add - local.get $1 - local.get $2 - i32.add - i64.load - i64.store - end + local.get $2 + i32.const 8 + i32.sub + local.set $2 + local.get $0 + local.get $2 + i32.add + local.get $1 + local.get $2 + i32.add + i64.load + i64.store br $continue|4 end end @@ -261,10 +249,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 55 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $memmove/base @@ -274,10 +262,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 56 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $memmove/base @@ -291,10 +279,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 59 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $memmove/base @@ -304,10 +292,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 60 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $memmove/base @@ -319,10 +307,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 61 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $memmove/base @@ -334,10 +322,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 62 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $memmove/base @@ -349,10 +337,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 63 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $memmove/base @@ -371,10 +359,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 66 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $memmove/base @@ -393,10 +381,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 69 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $memmove/base @@ -408,10 +396,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 70 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $memmove/base @@ -423,10 +411,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 71 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $memmove/base @@ -438,10 +426,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 72 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/memset.json b/tests/compiler/memset.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/memset.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/memset.optimized.wat b/tests/compiler/memset.optimized.wat index a74f638c0f..c5d4ebd39a 100644 --- a/tests/compiler/memset.optimized.wat +++ b/tests/compiler/memset.optimized.wat @@ -2,14 +2,11 @@ (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) (type $FUNCSIG$viii (func (param i32 i32 i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\t\00\00\00m\00e\00m\00s\00e\00t\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $null) + (data (i32.const 8) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\00m\00e\00m\00s\00e\00t\00.\00t\00s") (global $memset/dest (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $memset/memset (; 1 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) @@ -194,8 +191,8 @@ local.set $2 local.get $1 i64.extend_i32_u - local.tee $4 - local.get $4 + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or @@ -237,7 +234,7 @@ end ) (func $start:memset (; 2 ;) (type $FUNCSIG$v) - i32.const 32 + i32.const 44 global.set $memset/dest global.get $memset/dest i32.const 1 @@ -249,10 +246,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 72 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $memset/dest @@ -263,10 +260,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 73 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $memset/dest @@ -281,10 +278,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 77 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $memset/dest @@ -295,10 +292,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 78 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $memset/dest @@ -309,10 +306,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 79 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $memset/dest @@ -323,10 +320,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 80 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/memset.ts b/tests/compiler/memset.ts index f1c028fe50..5379fd8259 100644 --- a/tests/compiler/memset.ts +++ b/tests/compiler/memset.ts @@ -66,7 +66,7 @@ function memset(dest: usize, c: u8, n: usize): usize { return ret; } -var dest = HEAP_BASE; +var dest = __heap_base; memset(dest, 1, 16); assert(load(dest) == 1); diff --git a/tests/compiler/memset.untouched.wat b/tests/compiler/memset.untouched.wat index e4acbbb5f0..e9ebe3ba40 100644 --- a/tests/compiler/memset.untouched.wat +++ b/tests/compiler/memset.untouched.wat @@ -2,15 +2,14 @@ (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\t\00\00\00m\00e\00m\00s\00e\00t\00.\00t\00s\00") + (data (i32.const 8) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\00m\00e\00m\00s\00e\00t\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) (global $memset/dest (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 32)) + (global $~lib/heap/__heap_base i32 (i32.const 44)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $memset/memset (; 1 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -242,34 +241,32 @@ i32.const 32 i32.ge_u if - block - local.get $0 - local.get $6 - i64.store - local.get $0 - i32.const 8 - i32.add - local.get $6 - i64.store - local.get $0 - i32.const 16 - i32.add - local.get $6 - i64.store - local.get $0 - i32.const 24 - i32.add - local.get $6 - i64.store - local.get $2 - i32.const 32 - i32.sub - local.set $2 - local.get $0 - i32.const 32 - i32.add - local.set $0 - end + local.get $0 + local.get $6 + i64.store + local.get $0 + i32.const 8 + i32.add + local.get $6 + i64.store + local.get $0 + i32.const 16 + i32.add + local.get $6 + i64.store + local.get $0 + i32.const 24 + i32.add + local.get $6 + i64.store + local.get $2 + i32.const 32 + i32.sub + local.set $2 + local.get $0 + i32.const 32 + i32.add + local.set $0 br $continue|0 end end @@ -277,7 +274,7 @@ local.get $3 ) (func $start:memset (; 2 ;) (type $FUNCSIG$v) - global.get $~lib/memory/HEAP_BASE + global.get $~lib/heap/__heap_base global.set $memset/dest global.get $memset/dest i32.const 1 @@ -291,10 +288,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 72 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $memset/dest @@ -306,10 +303,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 73 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $memset/dest @@ -326,10 +323,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 77 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $memset/dest @@ -341,10 +338,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 78 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $memset/dest @@ -356,10 +353,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 79 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $memset/dest @@ -371,10 +368,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 80 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/merge.json b/tests/compiler/merge.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/merge.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/merge.optimized.wat b/tests/compiler/merge.optimized.wat index 86b388ad0a..e2acb0a3b8 100644 --- a/tests/compiler/merge.optimized.wat +++ b/tests/compiler/merge.optimized.wat @@ -1,10 +1,7 @@ (module (type $FUNCSIG$v (func)) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $start) (export "memory" (memory $0)) - (export "table" (table $0)) (func $start (; 0 ;) (type $FUNCSIG$v) nop ) diff --git a/tests/compiler/merge.untouched.wat b/tests/compiler/merge.untouched.wat index b4d854ae7c..e1dceafa81 100644 --- a/tests/compiler/merge.untouched.wat +++ b/tests/compiler/merge.untouched.wat @@ -13,9 +13,7 @@ (global $merge/typeFunction_test (mut i32) (i32.const 0)) (global $merge/enumNamespace.val i32 (i32.const 1)) (global $merge/namespaceEnum.val i32 (i32.const 2)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $merge/namespaceType.test (; 0 ;) (type $FUNCSIG$v) nop diff --git a/tests/compiler/named-export-default.json b/tests/compiler/named-export-default.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/named-export-default.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/named-export-default.optimized.wat b/tests/compiler/named-export-default.optimized.wat index 2249847b51..0886d5cce7 100644 --- a/tests/compiler/named-export-default.optimized.wat +++ b/tests/compiler/named-export-default.optimized.wat @@ -2,10 +2,7 @@ (type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$v (func)) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $null) (export "memory" (memory $0)) - (export "table" (table $0)) (export "default" (func $named-export-default/get3)) (func $named-export-default/get3 (; 0 ;) (type $FUNCSIG$i) (result i32) i32.const 3 diff --git a/tests/compiler/named-export-default.untouched.wat b/tests/compiler/named-export-default.untouched.wat index 4aae7011ac..3f1ff0ab82 100644 --- a/tests/compiler/named-export-default.untouched.wat +++ b/tests/compiler/named-export-default.untouched.wat @@ -4,9 +4,7 @@ (memory $0 0) (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "default" (func $named-export-default/get3)) (func $named-export-default/get3 (; 0 ;) (type $FUNCSIG$i) (result i32) i32.const 3 diff --git a/tests/compiler/named-import-default.json b/tests/compiler/named-import-default.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/named-import-default.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/named-import-default.optimized.wat b/tests/compiler/named-import-default.optimized.wat index 55fca5c159..e9b05938fc 100644 --- a/tests/compiler/named-import-default.optimized.wat +++ b/tests/compiler/named-import-default.optimized.wat @@ -2,10 +2,7 @@ (type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$v (func)) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $null) (export "memory" (memory $0)) - (export "table" (table $0)) (export "getValue" (func $named-import-default/getValue)) (func $named-import-default/getValue (; 0 ;) (type $FUNCSIG$i) (result i32) i32.const 3 diff --git a/tests/compiler/named-import-default.untouched.wat b/tests/compiler/named-import-default.untouched.wat index d54881d010..f24ee8a33a 100644 --- a/tests/compiler/named-import-default.untouched.wat +++ b/tests/compiler/named-import-default.untouched.wat @@ -4,9 +4,7 @@ (memory $0 0) (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "getValue" (func $named-import-default/getValue)) (func $named-export-default/get3 (; 0 ;) (type $FUNCSIG$i) (result i32) i32.const 3 diff --git a/tests/compiler/namespace.json b/tests/compiler/namespace.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/namespace.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/namespace.optimized.wat b/tests/compiler/namespace.optimized.wat index 86b388ad0a..e2acb0a3b8 100644 --- a/tests/compiler/namespace.optimized.wat +++ b/tests/compiler/namespace.optimized.wat @@ -1,10 +1,7 @@ (module (type $FUNCSIG$v (func)) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $start) (export "memory" (memory $0)) - (export "table" (table $0)) (func $start (; 0 ;) (type $FUNCSIG$v) nop ) diff --git a/tests/compiler/namespace.untouched.wat b/tests/compiler/namespace.untouched.wat index 13bbb9ab71..39966a5e53 100644 --- a/tests/compiler/namespace.untouched.wat +++ b/tests/compiler/namespace.untouched.wat @@ -7,9 +7,7 @@ (global $namespace/Outer.Inner.aVar (mut i32) (i32.const 0)) (global $namespace/Outer.Inner.anEnum.ONE i32 (i32.const 1)) (global $namespace/Outer.Inner.anEnum.TWO i32 (i32.const 2)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $namespace/Outer.Inner.aFunc (; 0 ;) (type $FUNCSIG$i) (result i32) global.get $namespace/Outer.Inner.aVar diff --git a/tests/compiler/new-without-allocator.optimized.wat b/tests/compiler/new-without-allocator.optimized.wat deleted file mode 100644 index ee41ed9fc1..0000000000 --- a/tests/compiler/new-without-allocator.optimized.wat +++ /dev/null @@ -1,16 +0,0 @@ -(module - (type $FUNCSIG$i (func (result i32))) - (type $FUNCSIG$v (func)) - (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $null) - (export "memory" (memory $0)) - (export "table" (table $0)) - (export "test" (func $new-without-allocator/test)) - (func $new-without-allocator/test (; 0 ;) (type $FUNCSIG$i) (result i32) - unreachable - ) - (func $null (; 1 ;) (type $FUNCSIG$v) - nop - ) -) diff --git a/tests/compiler/new-without-allocator.ts b/tests/compiler/new-without-allocator.ts deleted file mode 100644 index ff9548d52d..0000000000 --- a/tests/compiler/new-without-allocator.ts +++ /dev/null @@ -1,6 +0,0 @@ -class A {} - -export function test(): i32 { - var a = new A(); - return 3; -} diff --git a/tests/compiler/new-without-allocator.untouched.wat b/tests/compiler/new-without-allocator.untouched.wat deleted file mode 100644 index 8f3933bc3b..0000000000 --- a/tests/compiler/new-without-allocator.untouched.wat +++ /dev/null @@ -1,34 +0,0 @@ -(module - (type $FUNCSIG$i (func (result i32))) - (type $FUNCSIG$ii (func (param i32) (result i32))) - (type $FUNCSIG$v (func)) - (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) - (export "memory" (memory $0)) - (export "table" (table $0)) - (export "test" (func $new-without-allocator/test)) - (func $~lib/memory/memory.allocate (; 0 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - unreachable - ) - (func $new-without-allocator/A#constructor (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.eqz - if - i32.const 0 - call $~lib/memory/memory.allocate - local.set $0 - end - local.get $0 - ) - (func $new-without-allocator/test (; 2 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) - i32.const 0 - call $new-without-allocator/A#constructor - local.set $0 - i32.const 3 - ) - (func $null (; 3 ;) (type $FUNCSIG$v) - ) -) diff --git a/tests/compiler/nonNullAssertion.optimized.wat b/tests/compiler/nonNullAssertion.optimized.wat deleted file mode 100644 index 4e6f8471fd..0000000000 --- a/tests/compiler/nonNullAssertion.optimized.wat +++ /dev/null @@ -1,88 +0,0 @@ -(module - (type $FUNCSIG$v (func)) - (type $FUNCSIG$ii (func (param i32) (result i32))) - (type $FUNCSIG$i (func (result i32))) - (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) - (global $~lib/argc (mut i32) (i32.const 0)) - (export "memory" (memory $0)) - (export "table" (table $0)) - (export "testVar" (func $nonNullAssertion/testVar)) - (export "testObj" (func $nonNullAssertion/testObj)) - (export "testProp" (func $nonNullAssertion/testObj)) - (export "testArr" (func $nonNullAssertion/testArr)) - (export "testElem" (func $nonNullAssertion/testArr)) - (export "testAll" (func $nonNullAssertion/testAll)) - (export "testAll2" (func $nonNullAssertion/testAll)) - (export "testFn" (func $nonNullAssertion/testFn)) - (export "testFn2" (func $nonNullAssertion/testFn)) - (export "testRet" (func $nonNullAssertion/testFn)) - (export "testObjFn" (func $nonNullAssertion/testObjFn)) - (export "testObjRet" (func $nonNullAssertion/testObjFn)) - (start $start) - (func $nonNullAssertion/testVar (; 0 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - ) - (func $nonNullAssertion/testObj (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.load - ) - (func $nonNullAssertion/testArr (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 0 - local.get $0 - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end - ) - (func $nonNullAssertion/testAll (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 0 - local.get $0 - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end - i32.load - ) - (func $nonNullAssertion/testFn (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 0 - global.set $~lib/argc - local.get $0 - call_indirect (type $FUNCSIG$i) - ) - (func $nonNullAssertion/testObjFn (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 0 - global.set $~lib/argc - local.get $0 - i32.load offset=4 - call_indirect (type $FUNCSIG$i) - ) - (func $start (; 6 ;) (type $FUNCSIG$v) - i32.const 8 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - ) - (func $null (; 7 ;) (type $FUNCSIG$v) - nop - ) -) diff --git a/tests/compiler/nonNullAssertion.untouched.wat b/tests/compiler/nonNullAssertion.untouched.wat deleted file mode 100644 index a46d255321..0000000000 --- a/tests/compiler/nonNullAssertion.untouched.wat +++ /dev/null @@ -1,182 +0,0 @@ -(module - (type $FUNCSIG$v (func)) - (type $FUNCSIG$ii (func (param i32) (result i32))) - (type $FUNCSIG$iii (func (param i32 i32) (result i32))) - (type $FUNCSIG$i (func (result i32))) - (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) - (global $~lib/argc (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) - (export "memory" (memory $0)) - (export "table" (table $0)) - (export "testVar" (func $nonNullAssertion/testVar)) - (export "testObj" (func $nonNullAssertion/testObj)) - (export "testProp" (func $nonNullAssertion/testProp)) - (export "testArr" (func $nonNullAssertion/testArr)) - (export "testElem" (func $nonNullAssertion/testElem)) - (export "testAll" (func $nonNullAssertion/testAll)) - (export "testAll2" (func $nonNullAssertion/testAll2)) - (export "testFn" (func $nonNullAssertion/testFn)) - (export "testFn2" (func $nonNullAssertion/testFn2)) - (export "testRet" (func $nonNullAssertion/testRet)) - (export "testObjFn" (func $nonNullAssertion/testObjFn)) - (export "testObjRet" (func $nonNullAssertion/testObjRet)) - (start $start) - (func $start:~lib/allocator/arena (; 0 ;) (type $FUNCSIG$v) - global.get $~lib/memory/HEAP_BASE - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - ) - (func $start:nonNullAssertion (; 1 ;) (type $FUNCSIG$v) - call $start:~lib/allocator/arena - ) - (func $nonNullAssertion/testVar (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - ) - (func $nonNullAssertion/testObj (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.load - ) - (func $nonNullAssertion/testProp (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.load - ) - (func $~lib/array/Array#__get (; 5 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load - local.set $2 - local.get $1 - local.get $2 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $2 - local.set $3 - local.get $1 - local.set $4 - i32.const 0 - local.set $5 - local.get $3 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $5 - i32.add - i32.load offset=8 - else - unreachable - end - ) - (func $nonNullAssertion/testArr (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.const 0 - call $~lib/array/Array#__get - ) - (func $~lib/array/Array#__get (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load - local.set $2 - local.get $1 - local.get $2 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $2 - local.set $3 - local.get $1 - local.set $4 - i32.const 0 - local.set $5 - local.get $3 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $5 - i32.add - i32.load offset=8 - else - unreachable - end - ) - (func $nonNullAssertion/testElem (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.const 0 - call $~lib/array/Array#__get - ) - (func $nonNullAssertion/testAll (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.const 0 - call $~lib/array/Array#__get - i32.load - ) - (func $nonNullAssertion/testAll2 (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.const 0 - call $~lib/array/Array#__get - i32.load - ) - (func $nonNullAssertion/testFn (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 0 - global.set $~lib/argc - local.get $0 - call_indirect (type $FUNCSIG$i) - ) - (func $nonNullAssertion/testFn2 (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - local.get $0 - local.set $1 - i32.const 0 - global.set $~lib/argc - local.get $1 - call_indirect (type $FUNCSIG$i) - ) - (func $nonNullAssertion/testRet (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 0 - global.set $~lib/argc - local.get $0 - call_indirect (type $FUNCSIG$i) - ) - (func $nonNullAssertion/testObjFn (; 14 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 0 - global.set $~lib/argc - local.get $0 - i32.load offset=4 - call_indirect (type $FUNCSIG$i) - ) - (func $nonNullAssertion/testObjRet (; 15 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 0 - global.set $~lib/argc - local.get $0 - i32.load offset=4 - call_indirect (type $FUNCSIG$i) - ) - (func $start (; 16 ;) (type $FUNCSIG$v) - call $start:nonNullAssertion - ) - (func $null (; 17 ;) (type $FUNCSIG$v) - ) -) diff --git a/tests/compiler/number.json b/tests/compiler/number.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/number.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/number.optimized.wat b/tests/compiler/number.optimized.wat index 30eaa20237..46c69f1494 100644 --- a/tests/compiler/number.optimized.wat +++ b/tests/compiler/number.optimized.wat @@ -1,118 +1,112 @@ (module - (type $FUNCSIG$v (func)) (type $FUNCSIG$ii (func (param i32) (result i32))) - (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) - (type $FUNCSIG$viii (func (param i32 i32 i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$id (func (param f64) (result i32))) (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$if (func (param f32) (result i32))) + (type $FUNCSIG$v (func)) (type $FUNCSIG$iijijij (func (param i32 i64 i32 i64 i32 i64) (result i32))) (type $FUNCSIG$i (func (result i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\01\00\00\000") - (data (i32.const 16) "\17\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s") - (data (i32.const 72) "\90\01\00\00\00\00\00\000\000\000\001\000\002\000\003\000\004\000\005\000\006\000\007\000\008\000\009\001\000\001\001\001\002\001\003\001\004\001\005\001\006\001\007\001\008\001\009\002\000\002\001\002\002\002\003\002\004\002\005\002\006\002\007\002\008\002\009\003\000\003\001\003\002\003\003\003\004\003\005\003\006\003\007\003\008\003\009\004\000\004\001\004\002\004\003\004\004\004\005\004\006\004\007\004\008\004\009\005\000\005\001\005\002\005\003\005\004\005\005\005\006\005\007\005\008\005\009\006\000\006\001\006\002\006\003\006\004\006\005\006\006\006\007\006\008\006\009\007\000\007\001\007\002\007\003\007\004\007\005\007\006\007\007\007\008\007\009\008\000\008\001\008\002\008\003\008\004\008\005\008\006\008\007\008\008\008\009\009\000\009\001\009\002\009\003\009\004\009\005\009\006\009\007\009\008\009\009") - (data (i32.const 584) "H\00\00\00d") - (data (i32.const 592) "\01\00\00\001") - (data (i32.const 600) "\t\00\00\00n\00u\00m\00b\00e\00r\00.\00t\00s") - (data (i32.const 624) "\03\00\00\000\00.\000") - (data (i32.const 640) "\03\00\00\00N\00a\00N") - (data (i32.const 656) "\t\00\00\00-\00I\00n\00f\00i\00n\00i\00t\00y") - (data (i32.const 680) "\08\00\00\00I\00n\00f\00i\00n\00i\00t\00y") - (data (i32.const 704) "\b8\02\00\00\00\00\00\00\88\02\1c\08\a0\d5\8f\fav\bf>\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a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si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8 (; 3 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - (local $4 i32) - i32.const 584 - i32.load - local.set $3 loop $continue|0 local.get $1 - i32.const 10000 - i32.ge_u - if - local.get $1 - i32.const 10000 - i32.rem_u - local.set $4 - local.get $1 - i32.const 10000 - i32.div_u - local.set $1 - local.get $2 - i32.const 4 - i32.sub - local.tee $2 - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $3 - local.get $4 - i32.const 100 - i32.div_u - i32.const 2 - i32.shl - i32.add - i64.load32_u offset=8 - local.get $3 - local.get $4 - i32.const 100 - i32.rem_u - i32.const 2 - i32.shl - i32.add - i64.load32_u offset=8 - i64.const 32 - i64.shl - i64.or - i64.store offset=4 - br $continue|0 - end - end - local.get $1 - i32.const 100 - i32.ge_u - if - local.get $1 - i32.const 100 - i32.rem_u - local.set $4 - local.get $1 - i32.const 100 + i32.const 10 i32.div_u - local.set $1 - local.get $2 - i32.const 2 - i32.sub - local.tee $2 - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $3 - local.get $4 - i32.const 2 - i32.shl - i32.add - i32.load offset=8 - i32.store offset=4 - end - local.get $1 - i32.const 10 - i32.ge_u - if - local.get $2 - i32.const 2 - i32.sub - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $3 - local.get $1 - i32.const 2 - i32.shl - i32.add - i32.load offset=8 - i32.store offset=4 - else + local.set $3 local.get $2 i32.const 1 i32.sub + local.tee $2 i32.const 1 i32.shl local.get $0 i32.add local.get $1 + i32.const 10 + i32.rem_u i32.const 48 i32.add - i32.store16 offset=4 + i32.store16 + local.get $3 + local.tee $1 + br_if $continue|0 end ) - (func $~lib/internal/number/itoa32 (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/itoa32 (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) local.get $0 i32.eqz if - i32.const 8 + i32.const 24 return end local.get $0 @@ -327,37 +213,47 @@ local.set $0 end local.get $0 - call $~lib/internal/number/decimalCount32 + call $~lib/util/number/decimalCount32 local.get $1 i32.add local.tee $3 - call $~lib/internal/string/allocateUnsafe + i32.const 1 + i32.shl + call $~lib/rt/stub/__alloc local.tee $2 local.get $0 local.get $3 - call $~lib/internal/number/utoa32_lut + call $~lib/util/number/utoa_simple local.get $1 if local.get $2 i32.const 45 - i32.store16 offset=4 + i32.store16 end local.get $2 ) - (func $~lib/internal/string/compareUnsafe (; 6 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/string/String#get:length (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u + ) + (func $~lib/util/string/compareImpl (; 6 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) loop $continue|0 local.get $2 if (result i32) local.get $0 - i32.load16_u offset=4 + i32.load16_u local.get $1 - i32.load16_u offset=4 + i32.load16_u i32.sub local.tee $3 i32.eqz else - local.get $2 + i32.const 0 end if local.get $2 @@ -386,77 +282,82 @@ i32.const 1 return end - local.get $0 - i32.eqz - local.tee $2 - i32.eqz - if + block $folding-inner0 local.get $1 i32.eqz - local.set $2 - end - local.get $2 - if - i32.const 0 + i32.const 1 + local.get $0 + select + br_if $folding-inner0 + local.get $0 + call $~lib/string/String#get:length + local.tee $2 + local.get $1 + call $~lib/string/String#get:length + i32.ne + br_if $folding-inner0 + local.get $0 + local.get $1 + local.get $2 + call $~lib/util/string/compareImpl + i32.eqz return end + i32.const 0 + ) + (func $~lib/builtins/isFinite (; 8 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) local.get $0 - i32.load - local.tee $2 - local.get $1 - i32.load - i32.ne - if - i32.const 0 - return - end local.get $0 - local.get $1 - local.get $2 - call $~lib/internal/string/compareUnsafe - i32.eqz + f64.sub + f64.const 0 + f64.eq + ) + (func $~lib/builtins/isNaN (; 9 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + local.get $0 + f64.ne ) - (func $~lib/internal/number/genDigits (; 8 ;) (type $FUNCSIG$iijijij) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (result i32) + (func $~lib/util/number/genDigits (; 10 ;) (type $FUNCSIG$iijijij) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (result i32) (local $6 i32) (local $7 i32) (local $8 i64) - (local $9 i32) - (local $10 i64) + (local $9 i64) + (local $10 i32) (local $11 i64) (local $12 i32) - (local $13 i32) - (local $14 i64) + (local $13 i64) + (local $14 i32) i32.const 0 local.set $2 local.get $3 local.get $1 i64.sub - local.set $10 + local.set $9 i64.const 1 i32.const 0 local.get $4 i32.sub - local.tee $12 + local.tee $10 i64.extend_i32_s - local.tee $1 i64.shl local.tee $11 i64.const 1 i64.sub - local.tee $14 + local.tee $13 local.get $3 i64.and local.set $8 local.get $3 - local.get $1 + local.get $10 + i64.extend_i32_s i64.shr_u i32.wrap_i64 local.tee $6 - call $~lib/internal/number/decimalCount32 + call $~lib/util/number/decimalCount32 local.set $4 - i32.const 2064 + i32.const 1260 i32.load - local.set $13 + local.set $12 loop $continue|0 local.get $4 i32.const 0 @@ -593,11 +494,11 @@ i32.or if local.get $2 - local.tee $9 + local.tee $14 i32.const 1 i32.add local.set $2 - local.get $9 + local.get $14 i32.const 1 i32.shl local.get $0 @@ -607,7 +508,7 @@ i32.and i32.const 48 i32.add - i32.store16 offset=4 + i32.store16 end local.get $4 i32.const 1 @@ -615,7 +516,7 @@ local.set $4 local.get $6 i64.extend_i32_u - local.get $12 + local.get $10 i64.extend_i32_s i64.shl local.get $8 @@ -624,17 +525,17 @@ local.get $5 i64.le_u if - global.get $~lib/internal/number/_K + global.get $~lib/util/number/_K local.get $4 i32.add - global.set $~lib/internal/number/_K + global.set $~lib/util/number/_K local.get $4 i32.const 2 i32.shl - local.get $13 - i32.add - i64.load32_u offset=8 local.get $12 + i32.add + i64.load32_u + local.get $10 i64.extend_i32_s i64.shl local.set $3 @@ -645,48 +546,37 @@ i32.shl local.get $0 i32.add - local.tee $9 - i32.load16_u offset=4 + local.tee $0 + i32.load16_u local.set $4 loop $continue|2 - block (result i32) - local.get $1 - local.get $10 - i64.lt_u - local.tee $0 - if - local.get $5 - local.get $1 - i64.sub - local.get $3 - i64.ge_u - local.set $0 - end - local.get $0 - end - if (result i32) - local.get $1 - local.get $3 - i64.add - local.get $10 - i64.lt_u - local.tee $0 - if (result i32) - local.get $0 - else - local.get $10 - local.get $1 - i64.sub - local.get $1 - local.get $3 - i64.add - local.get $10 - i64.sub - i64.gt_u - end - else - local.get $0 - end + i32.const 1 + local.get $9 + local.get $1 + i64.sub + local.get $1 + local.get $3 + i64.add + local.tee $8 + local.get $9 + i64.sub + i64.gt_u + local.get $8 + local.get $9 + i64.lt_u + select + i32.const 0 + local.get $5 + local.get $1 + i64.sub + local.get $3 + i64.ge_u + i32.const 0 + local.get $1 + local.get $9 + i64.lt_u + select + select if local.get $4 i32.const 1 @@ -699,9 +589,9 @@ br $continue|2 end end - local.get $9 + local.get $0 local.get $4 - i32.store16 offset=4 + i32.store16 local.get $2 return end @@ -716,11 +606,11 @@ local.get $8 i64.const 10 i64.mul - local.tee $3 - local.get $12 + local.tee $1 + local.get $10 i64.extend_i32_s i64.shr_u - local.tee $1 + local.tee $3 local.get $2 i64.extend_i32_s i64.or @@ -728,50 +618,52 @@ i64.ne if local.get $2 - local.tee $9 + local.tee $6 i32.const 1 i32.add local.set $2 - local.get $9 + local.get $6 i32.const 1 i32.shl local.get $0 i32.add - local.get $1 + local.get $3 i32.wrap_i64 i32.const 65535 i32.and i32.const 48 i32.add - i32.store16 offset=4 + i32.store16 end local.get $4 i32.const 1 i32.sub local.set $4 - local.get $3 - local.get $14 + local.get $1 + local.get $13 i64.and local.tee $8 local.get $5 i64.ge_u br_if $continue|3 end - global.get $~lib/internal/number/_K + global.get $~lib/util/number/_K local.get $4 i32.add - global.set $~lib/internal/number/_K + global.set $~lib/util/number/_K + local.get $8 + local.set $1 i32.const 0 local.get $4 i32.sub i32.const 2 i32.shl - local.get $13 + local.get $12 i32.add - i64.load32_u offset=8 - local.get $10 + i64.load32_u + local.get $9 i64.mul - local.set $1 + local.set $3 local.get $2 i32.const 1 i32.sub @@ -779,1847 +671,1446 @@ i32.shl local.get $0 i32.add - local.tee $9 - i32.load16_u offset=4 + local.tee $0 + i32.load16_u local.set $4 loop $continue|4 - block (result i32) - local.get $8 - local.get $1 - i64.lt_u - local.tee $0 - if - local.get $5 - local.get $8 - i64.sub - local.get $11 - i64.ge_u - local.set $0 - end - local.get $0 - end - if (result i32) - local.get $8 - local.get $11 - i64.add - local.get $1 - i64.lt_u - local.tee $0 - if (result i32) - local.get $0 - else - local.get $1 - local.get $8 - i64.sub - local.get $8 - local.get $11 - i64.add - local.get $1 - i64.sub - i64.gt_u - end - else - local.get $0 - end + i32.const 1 + local.get $3 + local.get $1 + i64.sub + local.get $1 + local.get $11 + i64.add + local.tee $8 + local.get $3 + i64.sub + i64.gt_u + local.get $8 + local.get $3 + i64.lt_u + select + i32.const 0 + local.get $5 + local.get $1 + i64.sub + local.get $11 + i64.ge_u + i32.const 0 + local.get $1 + local.get $3 + i64.lt_u + select + select if local.get $4 i32.const 1 i32.sub local.set $4 - local.get $8 + local.get $1 local.get $11 i64.add - local.set $8 + local.set $1 br $continue|4 end end - local.get $9 + local.get $0 local.get $4 - i32.store16 offset=4 + i32.store16 local.get $2 ) - (func $~lib/internal/memory/memcpy (; 9 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/memory/memory.copy (; 11 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - loop $continue|0 - local.get $1 - i32.const 3 - i32.and - local.get $2 - local.get $2 - select - if - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - br $continue|0 - end - end - local.get $0 - i32.const 3 - i32.and - i32.eqz - if - loop $continue|1 - local.get $2 - i32.const 16 - i32.ge_u - if - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $1 - i32.const 4 - i32.add - i32.load - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $1 - i32.const 8 - i32.add - i32.load - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 12 - i32.add - i32.load - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - br $continue|1 - end - end - local.get $2 - i32.const 8 - i32.and - if - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $1 - i32.const 4 - i32.add - i32.load - i32.store - local.get $1 - i32.const 8 - i32.add - local.set $1 - local.get $0 - i32.const 8 - i32.add - local.set $0 - end - local.get $2 - i32.const 4 - i32.and - if - local.get $0 - local.get $1 - i32.load - i32.store - local.get $1 - i32.const 4 - i32.add - local.set $1 - local.get $0 - i32.const 4 - i32.add - local.set $0 - end + block $~lib/util/memory/memmove|inlined.0 local.get $2 - i32.const 2 - i32.and + local.set $3 + local.get $0 + local.get $1 + i32.eq + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $1 + i32.lt_u if - local.get $0 - local.get $1 - i32.load16_u - i32.store16 local.get $1 - i32.const 2 - i32.add - local.set $1 - local.get $0 - i32.const 2 - i32.add - local.set $0 - end - local.get $2 - i32.const 1 - i32.and - if + i32.const 7 + i32.and local.get $0 - local.get $1 - i32.load8_u - i32.store8 - end - return - end - local.get $2 - i32.const 32 - i32.ge_u - if - block $break|2 - block $case2|2 - block $case1|2 + i32.const 7 + i32.and + i32.eq + if + loop $continue|0 local.get $0 - i32.const 3 + i32.const 7 i32.and - local.tee $3 - i32.const 1 - i32.ne if local.get $3 - i32.const 2 - i32.eq - br_if $case1|2 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + br $continue|0 + end + end + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $1 + i64.load + i64.store local.get $3 - i32.const 3 - i32.eq - br_if $case2|2 - br $break|2 + i32.const 8 + i32.sub + local.set $3 + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + br $continue|1 end - local.get $1 - i32.load - local.set $5 - local.get $0 - local.get $1 - i32.load8_u - i32.store8 + end + end + loop $continue|2 + local.get $3 + if local.get $0 + local.tee $2 i32.const 1 i32.add - local.tee $0 + local.set $0 local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add local.tee $4 i32.const 1 i32.add local.set $1 - local.get $3 + local.get $2 local.get $4 i32.load8_u i32.store8 - local.get $2 - i32.const 3 + local.get $3 + i32.const 1 i32.sub - local.set $2 - loop $continue|3 - local.get $2 - i32.const 17 - i32.ge_u - if - local.get $0 - local.get $1 - i32.const 1 - i32.add - i32.load - local.tee $3 - i32.const 8 - i32.shl - local.get $5 - i32.const 24 - i32.shr_u - i32.or - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $3 - i32.const 24 - i32.shr_u - local.get $1 - i32.const 5 - i32.add - i32.load - local.tee $3 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $3 - i32.const 24 - i32.shr_u - local.get $1 - i32.const 9 - i32.add - i32.load - local.tee $3 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 13 - i32.add - i32.load - local.tee $5 - i32.const 8 - i32.shl - local.get $3 - i32.const 24 - i32.shr_u - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - br $continue|3 - end - end - br $break|2 + local.set $3 + br $continue|2 end - local.get $1 - i32.load - local.set $5 - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 2 - i32.sub - local.set $2 - loop $continue|4 - local.get $2 - i32.const 18 - i32.ge_u + end + else + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|3 + local.get $0 + local.get $3 + i32.add + i32.const 7 + i32.and if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 local.get $0 - local.get $1 - i32.const 2 - i32.add - i32.load + local.get $3 + i32.const 1 + i32.sub local.tee $3 - i32.const 16 - i32.shl - local.get $5 - i32.const 16 - i32.shr_u - i32.or - i32.store - local.get $0 - i32.const 4 i32.add - local.get $3 - i32.const 16 - i32.shr_u local.get $1 - i32.const 6 + local.get $3 i32.add - i32.load - local.tee $3 - i32.const 16 - i32.shl - i32.or - i32.store + i32.load8_u + i32.store8 + br $continue|3 + end + end + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if local.get $0 - i32.const 8 - i32.add local.get $3 - i32.const 16 - i32.shr_u - local.get $1 - i32.const 10 - i32.add - i32.load + i32.const 8 + i32.sub local.tee $3 - i32.const 16 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 12 i32.add local.get $1 - i32.const 14 - i32.add - i32.load - local.tee $5 - i32.const 16 - i32.shl local.get $3 - i32.const 16 - i32.shr_u - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 + i64.load + i64.store br $continue|4 end end - br $break|2 end - local.get $1 - i32.load - local.set $5 - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 loop $continue|5 - local.get $2 - i32.const 19 - i32.ge_u + local.get $3 if local.get $0 - local.get $1 - i32.const 3 - i32.add - i32.load - local.tee $3 - i32.const 24 - i32.shl - local.get $5 - i32.const 8 - i32.shr_u - i32.or - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $3 - i32.const 8 - i32.shr_u - local.get $1 - i32.const 7 - i32.add - i32.load - local.tee $3 - i32.const 24 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 8 - i32.add local.get $3 - i32.const 8 - i32.shr_u - local.get $1 - i32.const 11 - i32.add - i32.load + i32.const 1 + i32.sub local.tee $3 - i32.const 24 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 12 i32.add local.get $1 - i32.const 15 - i32.add - i32.load - local.tee $5 - i32.const 24 - i32.shl local.get $3 - i32.const 8 - i32.shr_u - i32.or - i32.store - local.get $1 - i32.const 16 i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 + i32.load8_u + i32.store8 br $continue|5 end end end end + ) + (func $~lib/util/number/prettify (; 12 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) local.get $2 - i32.const 16 - i32.and + i32.eqz if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 local.get $1 i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 + i32.shl local.get $0 - i32.const 1 i32.add - local.tee $0 + i32.const 3145774 + i32.store local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 + i32.const 2 i32.add - local.tee $0 - local.get $1 + return + end + local.get $1 + local.get $1 + local.get $2 + i32.add + local.tee $3 + i32.le_s + if (result i32) + local.get $3 + i32.const 21 + i32.le_s + else + i32.const 0 + end + if (result i32) + loop $repeat|0 + block $break|0 + local.get $1 + local.get $3 + i32.ge_s + br_if $break|0 + local.get $1 + i32.const 1 + i32.shl + local.get $0 + i32.add + i32.const 48 + i32.store16 + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|0 + end + end + local.get $3 i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 + i32.shl local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 + i32.const 3145774 + i32.store + local.get $3 + i32.const 2 i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 + else local.get $3 - local.get $4 - i32.load8_u - i32.store8 - end - local.get $2 - i32.const 8 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 + i32.const 21 + i32.le_s + i32.const 0 local.get $3 - local.get $4 - i32.load8_u - i32.store8 + i32.const 0 + i32.gt_s + select + if (result i32) + local.get $3 + i32.const 1 + i32.shl + local.get $0 + i32.add + local.tee $0 + i32.const 2 + i32.add + local.get $0 + i32.const 0 + local.get $2 + i32.sub + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $0 + i32.const 46 + i32.store16 + local.get $1 + i32.const 1 + i32.add + else + local.get $3 + i32.const 0 + i32.le_s + i32.const 0 + i32.const -6 + local.get $3 + i32.lt_s + select + if (result i32) + i32.const 2 + local.get $3 + i32.sub + local.tee $3 + i32.const 1 + i32.shl + local.get $0 + i32.add + local.get $0 + local.get $1 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $0 + i32.const 3014704 + i32.store + i32.const 2 + local.set $2 + loop $repeat|1 + block $break|1 + local.get $2 + local.get $3 + i32.ge_s + br_if $break|1 + local.get $2 + i32.const 1 + i32.shl + local.get $0 + i32.add + i32.const 48 + i32.store16 + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $repeat|1 + end + end + local.get $1 + local.get $3 + i32.add + else + local.get $1 + i32.const 1 + i32.eq + if (result i32) + local.get $0 + i32.const 101 + i32.store16 offset=2 + local.get $0 + i32.const 4 + i32.add + local.tee $0 + block (result i32) + local.get $3 + i32.const 1 + i32.sub + local.tee $2 + i32.const 0 + i32.lt_s + local.tee $1 + if + i32.const 0 + local.get $2 + i32.sub + local.set $2 + end + local.get $2 + end + local.get $2 + call $~lib/util/number/decimalCount32 + i32.const 1 + i32.add + local.tee $2 + call $~lib/util/number/utoa_simple + local.get $0 + i32.const 45 + i32.const 43 + local.get $1 + select + i32.store16 + local.get $2 + i32.const 2 + i32.add + else + local.get $0 + i32.const 4 + i32.add + local.get $0 + i32.const 2 + i32.add + local.get $1 + i32.const 1 + i32.shl + local.tee $2 + i32.const 2 + i32.sub + call $~lib/memory/memory.copy + local.get $0 + i32.const 46 + i32.store16 offset=2 + local.get $0 + local.get $2 + i32.add + local.tee $0 + i32.const 101 + i32.store16 offset=2 + local.get $0 + i32.const 4 + i32.add + local.tee $2 + block (result i32) + local.get $3 + i32.const 1 + i32.sub + local.tee $0 + i32.const 0 + i32.lt_s + local.tee $3 + if + i32.const 0 + local.get $0 + i32.sub + local.set $0 + end + local.get $0 + end + local.get $0 + call $~lib/util/number/decimalCount32 + i32.const 1 + i32.add + local.tee $0 + call $~lib/util/number/utoa_simple + local.get $2 + i32.const 45 + i32.const 43 + local.get $3 + select + i32.store16 + local.get $0 + local.get $1 + i32.add + i32.const 2 + i32.add + end + end + end end + ) + (func $~lib/util/number/dtoa_core (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i64) + (local $2 i64) + (local $3 i64) + (local $4 i32) + (local $5 i64) + (local $6 f64) + i64.const -9223372036854774784 + global.set $~lib/util/number/_frc_plus + i64.const 9223372036854775296 + global.set $~lib/util/number/_frc_minus + i32.const -62 + global.set $~lib/util/number/_exp + i32.const 348 + i32.const -61 + global.get $~lib/util/number/_exp + i32.sub + f64.convert_i32_s + f64.const 0.30102999566398114 + f64.mul + f64.const 347 + f64.add + local.tee $6 + i32.trunc_f64_s + local.tee $4 + local.get $4 + f64.convert_i32_s + local.get $6 + f64.ne + i32.add + i32.const 3 + i32.shr_s + i32.const 1 + i32.add + local.tee $4 + i32.const 3 + i32.shl + i32.sub + global.set $~lib/util/number/_K + i32.const 948 + i32.load + local.get $4 + i32.const 3 + i32.shl + i32.add + i64.load + global.set $~lib/util/number/_frc_pow + i32.const 1172 + i32.load + local.get $4 + i32.const 1 + i32.shl + i32.add + i32.load16_s + global.set $~lib/util/number/_exp_pow + global.get $~lib/util/number/_frc_plus + local.tee $1 + i64.const 4294967295 + i64.and + local.tee $3 + global.get $~lib/util/number/_frc_pow + local.tee $2 + i64.const 32 + i64.shr_u + local.tee $5 + i64.mul local.get $2 - i32.const 4 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - end + i64.const 4294967295 + i64.and + local.tee $2 + local.get $1 + i64.const 32 + i64.shr_u + local.tee $1 + i64.mul + local.get $2 + local.get $3 + i64.mul + i64.const 32 + i64.shr_u + i64.add + local.tee $3 + i64.const 4294967295 + i64.and + i64.add + i64.const 2147483647 + i64.add + i64.const 32 + i64.shr_u + local.get $1 + local.get $5 + i64.mul + local.get $3 + i64.const 32 + i64.shr_u + i64.add + i64.add + i64.const 1 + i64.sub + local.set $1 + local.get $0 + local.get $0 local.get $2 + i64.const 2147483648 + i64.mul + i64.const 0 + i64.add + local.tee $3 + i64.const 4294967295 + i64.and + i64.const 0 + i64.add + i64.const 2147483647 + i64.add + i64.const 32 + i64.shr_u + local.get $5 + i64.const 2147483648 + i64.mul + local.get $3 + i64.const 32 + i64.shr_u + i64.add + i64.add + global.get $~lib/util/number/_exp_pow + local.tee $0 i32.const 2 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - end + i32.add + local.get $1 + global.get $~lib/util/number/_exp + local.get $0 + i32.add + i32.const -64 + i32.sub + local.get $1 + global.get $~lib/util/number/_frc_minus + local.tee $1 + i64.const 4294967295 + i64.and + local.tee $3 + local.get $5 + i64.mul + local.get $1 + i64.const 32 + i64.shr_u + local.tee $1 local.get $2 - i32.const 1 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - end + i64.mul + local.get $2 + local.get $3 + i64.mul + i64.const 32 + i64.shr_u + i64.add + local.tee $2 + i64.const 4294967295 + i64.and + i64.add + i64.const 2147483647 + i64.add + i64.const 32 + i64.shr_u + local.get $1 + local.get $5 + i64.mul + local.get $2 + i64.const 32 + i64.shr_u + i64.add + i64.add + i64.const 1 + i64.add + i64.sub + call $~lib/util/number/genDigits + global.get $~lib/util/number/_K + call $~lib/util/number/prettify ) - (func $~lib/internal/memory/memmove (; 10 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/string/String#substring (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) (local $3 i32) - (local $4 i32) local.get $0 - local.get $1 - i32.eq + i32.eqz if - return + i32.const 0 + i32.const 1288 + i32.const 196 + i32.const 4 + call $~lib/builtins/abort + unreachable end + i32.const 0 + local.get $0 + call $~lib/string/String#get:length + local.tee $2 + i32.const 0 + local.get $2 + i32.lt_s + select + local.tee $3 + local.get $1 + i32.const 0 + local.get $1 + i32.const 0 + i32.gt_s + select + local.tee $1 + local.get $2 local.get $1 local.get $2 - i32.add - local.get $0 - i32.le_u + i32.lt_s + select + local.tee $2 + local.get $3 + local.get $2 + i32.gt_s + select + i32.const 1 + i32.shl + local.tee $1 + local.get $3 + local.get $2 + local.get $3 + local.get $2 + i32.lt_s + select + i32.const 1 + i32.shl local.tee $3 + i32.sub + local.tee $2 i32.eqz if + i32.const 1336 + return + end + local.get $3 + if (result i32) + i32.const 0 + else local.get $0 - local.get $2 - i32.add + call $~lib/string/String#get:length + i32.const 1 + i32.shl local.get $1 - i32.le_u - local.set $3 + i32.eq end - local.get $3 if local.get $0 - local.get $1 - local.get $2 - call $~lib/internal/memory/memcpy return end + local.get $2 + call $~lib/rt/stub/__alloc + local.tee $1 local.get $0 + local.get $3 + i32.add + local.get $2 + call $~lib/memory/memory.copy local.get $1 - i32.lt_u + ) + (func $~lib/util/number/dtoa (; 15 ;) (type $FUNCSIG$i) (result i32) + (local $0 i32) + (local $1 i32) + f64.const 2 + call $~lib/builtins/isFinite + i32.eqz if - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and - i32.eq - if - loop $continue|0 - local.get $0 - i32.const 7 - i32.and - if - local.get $2 - i32.eqz - if - return - end - local.get $2 - i32.const 1 - i32.sub - local.set $2 - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - br $continue|0 - end - end - loop $continue|1 - local.get $2 - i32.const 8 - i32.ge_u - if - local.get $0 - local.get $1 - i64.load - i64.store - local.get $2 - i32.const 8 - i32.sub - local.set $2 - local.get $0 - i32.const 8 - i32.add - local.set $0 - local.get $1 - i32.const 8 - i32.add - local.set $1 - br $continue|1 - end - end - end - loop $continue|2 - local.get $2 - if - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - br $continue|2 - end - end - else - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and - i32.eq + f64.const 2 + call $~lib/builtins/isNaN if - loop $continue|3 - local.get $0 - local.get $2 - i32.add - i32.const 7 - i32.and - if - local.get $2 - i32.eqz - if - return - end - local.get $2 - i32.const 1 - i32.sub - local.tee $2 - local.get $0 - i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 - br $continue|3 - end - end - loop $continue|4 - local.get $2 - i32.const 8 - i32.ge_u - if - local.get $2 - i32.const 8 - i32.sub - local.tee $2 - local.get $0 - i32.add - local.get $1 - local.get $2 - i32.add - i64.load - i64.store - br $continue|4 - end - end - end - loop $continue|5 - local.get $2 - if - local.get $2 - i32.const 1 - i32.sub - local.tee $2 - local.get $0 - i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 - br $continue|5 - end + i32.const 136 + return end + i32.const 200 + return end - ) - (func $~lib/internal/number/prettify (; 11 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - local.get $2 - i32.eqz + i32.const 56 + call $~lib/rt/stub/__alloc + local.tee $0 + call $~lib/util/number/dtoa_core + local.tee $1 + i32.const 28 + i32.eq if - local.get $1 - i32.const 1 - i32.shl local.get $0 - i32.add - i32.const 3145774 - i32.store offset=4 - local.get $1 - i32.const 2 - i32.add return end + local.get $0 local.get $1 - local.get $1 - local.get $2 - i32.add - local.tee $3 - i32.le_s - local.tee $4 - if - local.get $3 - i32.const 21 - i32.le_s - local.set $4 - end - local.get $4 + call $~lib/string/String#substring + ) + (func $~lib/number/Bool#toString (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.const 1472 + i32.const 1496 + local.get $0 + select + ) + (func $~lib/number/F32.isSafeInteger (; 17 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) + local.get $0 + f32.trunc + local.get $0 + f32.eq + i32.const 0 + local.get $0 + f32.abs + f32.const 16777215 + f32.le + select + ) + (func $~lib/number/F32.isInteger (; 18 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) + local.get $0 + f32.trunc + local.get $0 + f32.eq + i32.const 0 + local.get $0 + local.get $0 + f32.sub + f32.const 0 + f32.eq + select + ) + (func $~lib/number/F64.isSafeInteger (; 19 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + f64.trunc + local.get $0 + f64.eq + i32.const 0 + local.get $0 + f64.abs + f64.const 9007199254740991 + f64.le + select + ) + (func $~lib/number/F64.isInteger (; 20 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + call $~lib/builtins/isFinite if (result i32) - loop $repeat|0 - block $break|0 - local.get $1 - local.get $3 - i32.ge_s - br_if $break|0 - local.get $1 - i32.const 1 - i32.shl - local.get $0 - i32.add - i32.const 48 - i32.store16 offset=4 - local.get $1 - i32.const 1 - i32.add - local.set $1 - br $repeat|0 - end - end - local.get $3 - i32.const 1 - i32.shl local.get $0 - i32.add - i32.const 3145774 - i32.store offset=4 - local.get $3 - i32.const 2 - i32.add + f64.trunc + local.get $0 + f64.eq else - local.get $3 i32.const 0 - i32.gt_s - local.tee $4 - if - local.get $3 - i32.const 21 - i32.le_s - local.set $4 - end - local.get $4 - if (result i32) - local.get $3 - i32.const 1 - i32.shl - local.get $0 - i32.add - i32.const 4 - i32.add - local.tee $4 - i32.const 2 - i32.add - local.get $4 - i32.const 0 - local.get $2 - i32.sub - i32.const 1 - i32.shl - call $~lib/internal/memory/memmove - local.get $3 - i32.const 1 - i32.shl - local.get $0 - i32.add - i32.const 46 - i32.store16 offset=4 - local.get $1 - i32.const 1 - i32.add - else - i32.const -6 - local.get $3 - i32.lt_s - local.tee $2 - if - local.get $3 - i32.const 0 - i32.le_s - local.set $2 - end - local.get $2 - if (result i32) - local.get $0 - i32.const 4 - i32.add - local.tee $2 - i32.const 2 - local.get $3 - i32.sub - local.tee $4 - i32.const 1 - i32.shl - i32.add - local.get $2 - local.get $1 - i32.const 1 - i32.shl - call $~lib/internal/memory/memmove - local.get $0 - i32.const 3014704 - i32.store offset=4 - i32.const 2 - local.set $2 - loop $repeat|1 - block $break|1 - local.get $2 - local.get $4 - i32.ge_s - br_if $break|1 - local.get $2 - i32.const 1 - i32.shl - local.get $0 - i32.add - i32.const 48 - i32.store16 offset=4 - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $repeat|1 - end - end - local.get $1 - local.get $4 - i32.add - else - local.get $1 - i32.const 1 - i32.eq - if (result i32) - local.get $0 - i32.const 101 - i32.store16 offset=6 - local.get $0 - i32.const 4 - i32.add - local.tee $0 - block (result i32) - local.get $3 - i32.const 1 - i32.sub - local.tee $2 - i32.const 0 - i32.lt_s - local.tee $1 - if - i32.const 0 - local.get $2 - i32.sub - local.set $2 - end - local.get $2 - end - local.get $2 - call $~lib/internal/number/decimalCount32 - i32.const 1 - i32.add - local.tee $2 - call $~lib/internal/number/utoa32_lut - local.get $0 - i32.const 45 - i32.const 43 - local.get $1 - select - i32.store16 offset=4 - local.get $2 - i32.const 2 - i32.add - else - local.get $0 - i32.const 4 - i32.add - local.tee $2 - i32.const 4 - i32.add - local.get $2 - i32.const 2 - i32.add - local.get $1 - i32.const 1 - i32.shl - local.tee $2 - i32.const 2 - i32.sub - call $~lib/internal/memory/memmove - local.get $0 - i32.const 46 - i32.store16 offset=6 - local.get $0 - local.get $2 - i32.add - local.tee $0 - i32.const 101 - i32.store16 offset=6 - local.get $0 - i32.const 4 - i32.add - local.tee $0 - block (result i32) - local.get $3 - i32.const 1 - i32.sub - local.tee $2 - i32.const 0 - i32.lt_s - local.tee $4 - if - i32.const 0 - local.get $2 - i32.sub - local.set $2 - end - local.get $2 - end - local.get $2 - call $~lib/internal/number/decimalCount32 - i32.const 1 - i32.add - local.tee $2 - call $~lib/internal/number/utoa32_lut - local.get $0 - i32.const 45 - i32.const 43 - local.get $4 - select - i32.store16 offset=4 - local.get $1 - local.get $2 - i32.add - i32.const 2 - i32.add - end - end - end end ) - (func $~lib/internal/number/dtoa_core (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i64) - (local $2 i64) - (local $3 i64) - (local $4 i64) - (local $5 i32) - (local $6 i64) - (local $7 i32) - (local $8 f64) - (local $9 i32) - (local $10 i32) - i64.const -9223372036854774784 - global.set $~lib/internal/number/_frc_plus - i64.const 9223372036854775296 - global.set $~lib/internal/number/_frc_minus - i32.const -62 - global.set $~lib/internal/number/_exp - i32.const 348 - i32.const -61 - global.get $~lib/internal/number/_exp - local.tee $7 - i32.sub - f64.convert_i32_s - f64.const 0.30102999566398114 - f64.mul - f64.const 347 - f64.add - local.tee $8 - i32.trunc_f64_s - local.tee $5 - local.get $5 - f64.convert_i32_s - local.get $8 - f64.ne - i32.add + (func $start:number (; 21 ;) (type $FUNCSIG$v) + (local $0 i32) + i32.const 1520 + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset + global.get $number/a + call $~lib/util/number/itoa32 + i32.const 48 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 5 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + call $~lib/util/number/dtoa + i32.const 1352 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 7 + i32.const 0 + call $~lib/builtins/abort + unreachable + end i32.const 3 - i32.shr_s + call $~lib/util/number/itoa32 + i32.const 1376 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 8 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const -5 + call $~lib/util/number/itoa32 + i32.const 1400 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 10 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 4 + call $~lib/util/number/itoa32 + i32.const 1424 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 11 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $number/a i32.const 1 i32.add - local.tee $5 - i32.const 3 - i32.shl - local.tee $9 + global.set $number/a + global.get $number/a + call $~lib/util/number/itoa32 + i32.const 1448 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 12 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $number/a + i32.const 1 i32.sub - global.set $~lib/internal/number/_K - i32.const 1992 - i32.load - local.set $10 - i32.const 1728 - i32.load - local.get $9 - i32.add - i64.load offset=8 - global.set $~lib/internal/number/_frc_pow - local.get $5 + global.set $number/a + global.get $number/a + call $~lib/util/number/itoa32 + i32.const 48 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 13 + i32.const 0 + call $~lib/builtins/abort + unreachable + end i32.const 1 - i32.shl - local.get $10 - i32.add - i32.load16_s offset=8 - global.set $~lib/internal/number/_exp_pow - global.get $~lib/internal/number/_frc_pow - local.tee $3 - i64.const 4294967295 - i64.and - local.set $2 - global.get $~lib/internal/number/_frc_plus - local.tee $4 - i64.const 4294967295 - i64.and - local.tee $1 - local.get $3 - i64.const 32 - i64.shr_u - local.tee $3 - i64.mul - local.get $4 - i64.const 32 - i64.shr_u - local.tee $4 - local.get $2 - i64.mul - local.get $1 - local.get $2 - i64.mul - i64.const 32 - i64.shr_u - i64.add - local.tee $1 - i64.const 4294967295 - i64.and - i64.add - i64.const 2147483647 - i64.add - i64.const 32 - i64.shr_u - local.get $3 - local.get $4 - i64.mul - local.get $1 - i64.const 32 - i64.shr_u - i64.add - i64.add - i64.const 1 - i64.sub - local.tee $4 - local.get $3 - global.get $~lib/internal/number/_frc_minus - local.tee $1 - i64.const 4294967295 - i64.and - local.tee $6 - i64.mul - local.get $1 - i64.const 32 - i64.shr_u - local.tee $1 - local.get $2 - i64.mul - local.get $2 - local.get $6 - i64.mul - i64.const 32 - i64.shr_u - i64.add - local.tee $6 - i64.const 4294967295 - i64.and - i64.add - i64.const 2147483647 - i64.add - i64.const 32 - i64.shr_u - local.get $1 - local.get $3 - i64.mul - local.get $6 - i64.const 32 - i64.shr_u - i64.add - i64.add - i64.const 1 - i64.add - i64.sub - local.set $1 - local.get $0 - local.get $0 - local.get $2 - i64.const 2147483648 - i64.mul - i64.const 0 - i64.add - local.tee $2 - i64.const 4294967295 - i64.and - i64.const 0 - i64.add - i64.const 2147483647 - i64.add - i64.const 32 - i64.shr_u - local.get $3 - i64.const 2147483648 - i64.mul - local.get $2 - i64.const 32 - i64.shr_u - i64.add - i64.add - global.get $~lib/internal/number/_exp_pow + call $~lib/number/Bool#toString + i32.const 1472 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 14 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + call $~lib/number/Bool#toString + i32.const 1496 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 15 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $number/a local.tee $0 - i32.const 2 + i32.const 1 i32.add - local.get $4 + global.set $number/a local.get $0 - local.get $7 - i32.add - i32.const -64 + call $~lib/util/number/itoa32 + i32.const 48 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 18 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $number/a + local.tee $0 + i32.const 1 i32.sub - local.get $1 - call $~lib/internal/number/genDigits - global.get $~lib/internal/number/_K - call $~lib/internal/number/prettify - ) - (func $~lib/string/String#substring (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) + global.set $number/a local.get $0 + call $~lib/util/number/itoa32 + i32.const 1448 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 2072 - i32.const 254 - i32.const 4 - call $~lib/env/abort + i32.const 72 + i32.const 19 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const -16777216 + call $~lib/number/F32.isSafeInteger + if + i32.const 0 + i32.const 72 + i32.const 25 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const -16777215 + call $~lib/number/F32.isSafeInteger + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 72 + i32.const 26 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const 0 + call $~lib/number/F32.isSafeInteger + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 72 + i32.const 27 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const -0 + call $~lib/number/F32.isSafeInteger + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 72 + i32.const 28 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const nan:0x400000 + call $~lib/number/F32.isSafeInteger + if + i32.const 0 + i32.const 72 + i32.const 29 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const inf + call $~lib/number/F32.isSafeInteger + if + i32.const 0 + i32.const 72 + i32.const 30 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const 16777215 + call $~lib/number/F32.isSafeInteger + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 72 + i32.const 31 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const 16777216 + call $~lib/number/F32.isSafeInteger + if + i32.const 0 + i32.const 72 + i32.const 32 + i32.const 0 + call $~lib/builtins/abort unreachable end - i32.const 0 - local.get $0 - i32.load - local.tee $2 - i32.const 0 - local.get $2 - i32.lt_s - select - local.tee $3 - local.get $1 - i32.const 0 - local.get $1 - i32.const 0 - i32.gt_s - select - local.tee $1 - local.get $2 - local.get $1 - local.get $2 - i32.lt_s - select - local.tee $1 - local.get $3 - local.get $1 - i32.gt_s - select - local.tee $4 - local.get $3 - local.get $1 - local.get $3 - local.get $1 - i32.lt_s - select - local.tee $2 - i32.sub - local.tee $3 - i32.eqz + f32.const 0.5 + call $~lib/number/F32.isSafeInteger if - i32.const 2104 - return + i32.const 0 + i32.const 72 + i32.const 33 + i32.const 0 + call $~lib/builtins/abort + unreachable end - local.get $2 - i32.eqz - local.tee $1 + f32.const 0 + call $~lib/number/F32.isInteger + i32.const 1 + i32.ne if - local.get $0 - i32.load - local.get $4 - i32.eq - local.set $1 + i32.const 0 + i32.const 72 + i32.const 34 + i32.const 0 + call $~lib/builtins/abort + unreachable end - local.get $1 + f32.const -0 + call $~lib/number/F32.isInteger + i32.const 1 + i32.ne if - local.get $0 - return + i32.const 0 + i32.const 72 + i32.const 35 + i32.const 0 + call $~lib/builtins/abort + unreachable end - local.get $3 - call $~lib/internal/string/allocateUnsafe - local.tee $1 - i32.const 4 - i32.add - local.get $2 + f32.const nan:0x400000 + call $~lib/number/F32.isInteger + if + i32.const 0 + i32.const 72 + i32.const 36 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const inf + call $~lib/number/F32.isInteger + if + i32.const 0 + i32.const 72 + i32.const 37 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const 1.1920928955078125e-07 + call $~lib/number/F32.isInteger + if + i32.const 0 + i32.const 72 + i32.const 38 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const 1 + call $~lib/number/F32.isInteger i32.const 1 - i32.shl - local.get $0 - i32.add - i32.const 4 - i32.add - local.get $3 + i32.ne + if + i32.const 0 + i32.const 72 + i32.const 39 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const -1 + call $~lib/number/F32.isInteger i32.const 1 - i32.shl - call $~lib/internal/memory/memmove - local.get $1 - ) - (func $~lib/internal/number/dtoa (; 14 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) - (local $1 i32) - i32.const 28 - call $~lib/internal/string/allocateUnsafe - local.tee $1 - call $~lib/internal/number/dtoa_core - local.set $0 - local.get $1 - local.get $0 - call $~lib/string/String#substring - local.set $0 - local.get $1 - i32.eqz + i32.ne if i32.const 0 - i32.const 16 - i32.const 28 - i32.const 4 - call $~lib/env/abort + i32.const 72 + i32.const 40 + i32.const 0 + call $~lib/builtins/abort unreachable end - local.get $0 - ) - (func $start:number (; 15 ;) (type $FUNCSIG$v) - (local $0 i32) - i32.const 2192 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - global.get $number/a - call $~lib/internal/number/itoa32 - i32.const 592 - call $~lib/string/String.__eq - i32.eqz + f32.const -16777215 + call $~lib/number/F32.isInteger + i32.const 1 + i32.ne if i32.const 0 - i32.const 600 - i32.const 7 + i32.const 72 + i32.const 41 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - call $~lib/internal/number/dtoa - i32.const 2112 - call $~lib/string/String.__eq - i32.eqz + f32.const 16777215 + call $~lib/number/F32.isInteger + i32.const 1 + i32.ne if i32.const 0 - i32.const 600 - i32.const 9 + i32.const 72 + i32.const 42 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 3 - call $~lib/internal/number/itoa32 - i32.const 2128 - call $~lib/string/String.__eq - i32.eqz + f32.const 0.5 + call $~lib/number/F32.isInteger if i32.const 0 - i32.const 600 - i32.const 10 + i32.const 72 + i32.const 43 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const -5 - call $~lib/internal/number/itoa32 - i32.const 2136 - call $~lib/string/String.__eq - i32.eqz + f32.const -1.5 + call $~lib/number/F32.isInteger if i32.const 0 - i32.const 600 - i32.const 12 + i32.const 72 + i32.const 44 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 4 - call $~lib/internal/number/itoa32 - i32.const 2144 - call $~lib/string/String.__eq + f64.const nan:0x8000000000000 + call $~lib/builtins/isNaN i32.eqz if i32.const 0 - i32.const 600 - i32.const 13 + i32.const 72 + i32.const 46 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $number/a + f64.const -9007199254740992 + call $~lib/number/F64.isSafeInteger + if + i32.const 0 + i32.const 72 + i32.const 48 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const -9007199254740991 + call $~lib/number/F64.isSafeInteger i32.const 1 - i32.add - global.set $number/a - global.get $number/a - call $~lib/internal/number/itoa32 - i32.const 2152 - call $~lib/string/String.__eq - i32.eqz + i32.ne if i32.const 0 - i32.const 600 - i32.const 14 + i32.const 72 + i32.const 49 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $number/a + f64.const 0 + call $~lib/number/F64.isSafeInteger i32.const 1 - i32.sub - global.set $number/a - global.get $number/a - call $~lib/internal/number/itoa32 - i32.const 592 - call $~lib/string/String.__eq - i32.eqz + i32.ne if i32.const 0 - i32.const 600 - i32.const 15 + i32.const 72 + i32.const 50 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 2160 - i32.const 2160 - call $~lib/string/String.__eq - i32.eqz + f64.const -0 + call $~lib/number/F64.isSafeInteger + i32.const 1 + i32.ne if i32.const 0 - i32.const 600 - i32.const 16 + i32.const 72 + i32.const 51 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 2176 - i32.const 2176 - call $~lib/string/String.__eq - i32.eqz + f64.const nan:0x8000000000000 + call $~lib/number/F64.isSafeInteger if i32.const 0 - i32.const 600 - i32.const 17 + i32.const 72 + i32.const 52 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $number/a - local.tee $0 + f64.const inf + call $~lib/number/F64.isSafeInteger + if + i32.const 0 + i32.const 72 + i32.const 53 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const 9007199254740991 + call $~lib/number/F64.isSafeInteger i32.const 1 - i32.add - global.set $number/a - local.get $0 - call $~lib/internal/number/itoa32 - i32.const 592 - call $~lib/string/String.__eq - i32.eqz + i32.ne if i32.const 0 - i32.const 600 - i32.const 20 + i32.const 72 + i32.const 54 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $number/a - local.tee $0 + f64.const 9007199254740992 + call $~lib/number/F64.isSafeInteger + if + i32.const 0 + i32.const 72 + i32.const 55 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const 0.5 + call $~lib/number/F64.isSafeInteger + if + i32.const 0 + i32.const 72 + i32.const 56 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const 0 + call $~lib/number/F64.isInteger i32.const 1 - i32.sub - global.set $number/a - local.get $0 - call $~lib/internal/number/itoa32 - i32.const 2152 - call $~lib/string/String.__eq - i32.eqz + i32.ne if i32.const 0 - i32.const 600 - i32.const 21 + i32.const 72 + i32.const 57 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const -0 + call $~lib/number/F64.isInteger + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 72 + i32.const 58 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const nan:0x8000000000000 + call $~lib/number/F64.isInteger + if + i32.const 0 + i32.const 72 + i32.const 59 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const inf + call $~lib/number/F64.isInteger + if + i32.const 0 + i32.const 72 + i32.const 60 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const 2.220446049250313e-16 + call $~lib/number/F64.isInteger + if + i32.const 0 + i32.const 72 + i32.const 61 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const 1 + call $~lib/number/F64.isInteger + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 72 + i32.const 62 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const -1 + call $~lib/number/F64.isInteger + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 72 + i32.const 63 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const -9007199254740991 + call $~lib/number/F64.isInteger + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 72 + i32.const 64 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const 9007199254740991 + call $~lib/number/F64.isInteger + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 72 + i32.const 65 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const 0.5 + call $~lib/number/F64.isInteger + if + i32.const 0 + i32.const 72 + i32.const 66 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const -1.5 + call $~lib/number/F64.isInteger + if + i32.const 0 + i32.const 72 + i32.const 67 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) - (func $start (; 16 ;) (type $FUNCSIG$v) + (func $start (; 22 ;) (type $FUNCSIG$v) call $start:number ) - (func $null (; 17 ;) (type $FUNCSIG$v) + (func $null (; 23 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/number.ts b/tests/compiler/number.ts index 853dcb12ad..cf7c76dbfa 100644 --- a/tests/compiler/number.ts +++ b/tests/compiler/number.ts @@ -1,5 +1,3 @@ -import "allocator/arena"; - // basic class bindings // variable diff --git a/tests/compiler/number.untouched.wat b/tests/compiler/number.untouched.wat index 8a36243e05..eca663d2a7 100644 --- a/tests/compiler/number.untouched.wat +++ b/tests/compiler/number.untouched.wat @@ -1,56 +1,55 @@ (module - (type $FUNCSIG$v (func)) (type $FUNCSIG$ii (func (param i32) (result i32))) - (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) - (type $FUNCSIG$viii (func (param i32 i32 i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$iiiiii (func (param i32 i32 i32 i32 i32) (result i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$id (func (param f64) (result i32))) (type $FUNCSIG$iid (func (param i32 f64) (result i32))) + (type $FUNCSIG$jii (func (param i32 i32) (result i64))) (type $FUNCSIG$iijijiji (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) - (type $FUNCSIG$viiiii (func (param i32 i32 i32 i32 i32))) - (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$if (func (param f32) (result i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (type $FUNCSIG$v (func)) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\01\00\00\000\00") - (data (i32.const 16) "\17\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s\00") - (data (i32.const 72) "\90\01\00\00\00\00\00\000\000\000\001\000\002\000\003\000\004\000\005\000\006\000\007\000\008\000\009\001\000\001\001\001\002\001\003\001\004\001\005\001\006\001\007\001\008\001\009\002\000\002\001\002\002\002\003\002\004\002\005\002\006\002\007\002\008\002\009\003\000\003\001\003\002\003\003\003\004\003\005\003\006\003\007\003\008\003\009\004\000\004\001\004\002\004\003\004\004\004\005\004\006\004\007\004\008\004\009\005\000\005\001\005\002\005\003\005\004\005\005\005\006\005\007\005\008\005\009\006\000\006\001\006\002\006\003\006\004\006\005\006\006\006\007\006\008\006\009\007\000\007\001\007\002\007\003\007\004\007\005\007\006\007\007\007\008\007\009\008\000\008\001\008\002\008\003\008\004\008\005\008\006\008\007\008\008\008\009\009\000\009\001\009\002\009\003\009\004\009\005\009\006\009\007\009\008\009\009\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 584) "H\00\00\00d\00\00\00") - (data (i32.const 592) "\01\00\00\001\00") - (data (i32.const 600) "\t\00\00\00n\00u\00m\00b\00e\00r\00.\00t\00s\00") - (data (i32.const 624) "\03\00\00\000\00.\000\00") - (data (i32.const 640) "\03\00\00\00N\00a\00N\00") - (data (i32.const 656) "\t\00\00\00-\00I\00n\00f\00i\00n\00i\00t\00y\00") - (data (i32.const 680) "\08\00\00\00I\00n\00f\00i\00n\00i\00t\00y\00") - (data (i32.const 704) "\b8\02\00\00\00\00\00\00\88\02\1c\08\a0\d5\8f\fav\bf>\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00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f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8|inlined.0 (result i64) - local.get $3 - local.set $8 - local.get $6 - local.set $9 - i32.const 0 - local.set $10 - local.get $8 - local.get $9 - i32.const 2 - i32.shl - i32.add - local.get $10 - i32.add - i64.load32_u offset=8 - end - local.set $11 - block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i64) - local.get $3 - local.set $10 - local.get $7 - local.set $9 - i32.const 0 - local.set $8 - local.get $10 - local.get $9 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.add - i64.load32_u offset=8 - end - local.set $12 - local.get $2 - i32.const 4 - i32.sub - local.set $2 - local.get $0 - local.get $2 - i32.const 1 - i32.shl - i32.add - local.get $11 - local.get $12 - i64.const 32 - i64.shl - i64.or - i64.store offset=4 - end + local.get $1 + i32.const 10000 + i32.div_u + local.set $4 + local.get $1 + i32.const 10000 + i32.rem_u + local.set $5 + local.get $4 + local.set $1 + local.get $5 + i32.const 100 + i32.div_u + local.set $6 + local.get $5 + i32.const 100 + i32.rem_u + local.set $7 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $8 + local.get $3 + local.get $7 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $9 + local.get $2 + i32.const 4 + i32.sub + local.set $2 + local.get $0 + local.get $2 + i32.const 1 + i32.shl + i32.add + local.get $8 + local.get $9 + i64.const 32 + i64.shl + i64.or + i64.store br $continue|0 end end @@ -374,30 +311,20 @@ i32.const 2 i32.sub local.set $2 - block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) - local.get $3 - local.set $5 - local.get $6 - local.set $4 - i32.const 0 - local.set $8 - local.get $5 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.add - i32.load offset=8 - end - local.set $8 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $5 local.get $0 local.get $2 i32.const 1 i32.shl i32.add - local.get $8 - i32.store offset=4 + local.get $5 + i32.store end local.get $1 i32.const 10 @@ -407,30 +334,20 @@ i32.const 2 i32.sub local.set $2 - block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i32) - local.get $3 - local.set $8 - local.get $1 - local.set $6 - i32.const 0 - local.set $7 - local.get $8 - local.get $6 - i32.const 2 - i32.shl - i32.add - local.get $7 - i32.add - i32.load offset=8 - end - local.set $7 + local.get $3 + local.get $1 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $5 local.get $0 local.get $2 i32.const 1 i32.shl i32.add - local.get $7 - i32.store offset=4 + local.get $5 + i32.store else local.get $2 i32.const 1 @@ -439,17 +356,17 @@ i32.const 48 local.get $1 i32.add - local.set $7 + local.set $5 local.get $0 local.get $2 i32.const 1 i32.shl i32.add - local.get $7 - i32.store16 offset=4 + local.get $5 + i32.store16 end ) - (func $~lib/internal/number/itoa32 (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/itoa32 (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -459,7 +376,8 @@ local.get $0 i32.eqz if - i32.const 8 + i32.const 24 + call $~lib/rt/stub/__retain return end local.get $0 @@ -474,46 +392,76 @@ local.set $0 end local.get $0 - call $~lib/internal/number/decimalCount32 + call $~lib/util/number/decimalCount32 local.get $1 i32.add local.set $2 local.get $2 - call $~lib/internal/string/allocateUnsafe + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/stub/__alloc local.set $3 - block $~lib/internal/number/utoa32_core|inlined.0 + block $~lib/util/number/utoa32_core|inlined.0 local.get $3 - local.set $4 + local.set $6 local.get $0 local.set $5 local.get $2 - local.set $6 - local.get $4 - local.get $5 + local.set $4 local.get $6 - call $~lib/internal/number/utoa32_lut + local.get $5 + local.get $4 + call $~lib/util/number/utoa32_lut end local.get $1 if local.get $3 i32.const 45 - i32.store16 offset=4 + i32.store16 end local.get $3 + call $~lib/rt/stub/__retain ) - (func $~lib/internal/number/itoa (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/itoa (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - call $~lib/internal/number/itoa32 + call $~lib/util/number/itoa32 return ) + (func $~lib/rt/stub/__release (; 7 ;) (type $FUNCSIG$vi) (param $0 i32) + nop + ) (func $~lib/number/I32#toString (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + call $~lib/util/number/itoa + local.tee $1 + call $~lib/rt/stub/__retain + local.set $2 + local.get $1 + call $~lib/rt/stub/__release + local.get $2 + ) + (func $~lib/string/String#get:length (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - call $~lib/internal/number/itoa + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u ) - (func $~lib/internal/string/compareUnsafe (; 9 ;) (type $FUNCSIG$iiiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) + (func $~lib/util/string/compareImpl (; 10 ;) (type $FUNCSIG$iiiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) (local $5 i32) (local $6 i32) (local $7 i32) + (local $8 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $2 + call $~lib/rt/stub/__retain + drop i32.const 0 local.set $5 local.get $0 @@ -533,52 +481,67 @@ local.get $4 if (result i32) local.get $6 - i32.load16_u offset=4 + i32.load16_u local.get $7 - i32.load16_u offset=4 + i32.load16_u i32.sub local.tee $5 i32.eqz else - local.get $4 + i32.const 0 end if - block - local.get $4 - i32.const 1 - i32.sub - local.set $4 - local.get $6 - i32.const 2 - i32.add - local.set $6 - local.get $7 - i32.const 2 - i32.add - local.set $7 - end + local.get $4 + i32.const 1 + i32.sub + local.set $4 + local.get $6 + i32.const 2 + i32.add + local.set $6 + local.get $7 + i32.const 2 + i32.add + local.set $7 br $continue|0 end end end local.get $5 + local.set $8 + local.get $0 + call $~lib/rt/stub/__release + local.get $2 + call $~lib/rt/stub/__release + local.get $8 ) - (func $~lib/string/String.__eq (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__eq (; 11 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $1 + call $~lib/rt/stub/__retain + drop + local.get $0 local.get $1 i32.eq if i32.const 1 + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 return end local.get $0 i32.const 0 i32.eq - local.tee $2 if (result i32) - local.get $2 + i32.const 1 else local.get $1 i32.const 0 @@ -586,17 +549,29 @@ end if i32.const 0 + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 return end local.get $0 - i32.load + call $~lib/string/String#get:length local.set $3 local.get $3 local.get $1 - i32.load + call $~lib/string/String#get:length i32.ne if i32.const 0 + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 return end local.get $0 @@ -604,22 +579,46 @@ local.get $1 i32.const 0 local.get $3 - call $~lib/internal/string/compareUnsafe + call $~lib/util/string/compareImpl i32.eqz + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 ) - (func $~lib/builtins/isFinite (; 11 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + (func $~lib/builtins/isFinite (; 12 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) local.get $0 local.get $0 f64.sub f64.const 0 f64.eq ) - (func $~lib/builtins/isNaN (; 12 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + (func $~lib/builtins/isNaN (; 13 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) local.get $0 local.get $0 f64.ne ) - (func $~lib/internal/number/genDigits (; 13 ;) (type $FUNCSIG$iijijiji) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (param $6 i32) (result i32) + (func $~lib/array/Array#__unchecked_get (; 14 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 3 + i32.shl + i32.add + i64.load + ) + (func $~lib/array/Array#__unchecked_get (; 15 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 1 + i32.shl + i32.add + i32.load16_s + ) + (func $~lib/util/number/genDigits (; 16 ;) (type $FUNCSIG$iijijiji) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (param $6 i32) (result i32) (local $7 i32) (local $8 i64) (local $9 i64) @@ -633,14 +632,13 @@ (local $17 i32) (local $18 i32) (local $19 i64) - (local $20 i32) + (local $20 i64) (local $21 i64) (local $22 i64) - (local $23 i32) + (local $23 i64) (local $24 i32) (local $25 i32) - (local $26 i64) - (local $27 i64) + (local $26 i32) i32.const 0 local.get $4 i32.sub @@ -671,12 +669,12 @@ i64.and local.set $13 local.get $12 - call $~lib/internal/number/decimalCount32 + call $~lib/util/number/decimalCount32 local.set $14 local.get $6 local.set $15 - i32.const 2064 - i32.load + i32.const 1704 + i32.load offset=4 local.set $16 block $break|0 loop $continue|0 @@ -684,84 +682,69 @@ i32.const 0 i32.gt_s if - block - block $break|1 - block $case10|1 - block $case9|1 - block $case8|1 - block $case7|1 - block $case6|1 - block $case5|1 - block $case4|1 - block $case3|1 - block $case2|1 - block $case1|1 - block $case0|1 - local.get $14 - local.set $18 - local.get $18 - i32.const 10 - i32.eq - br_if $case0|1 - local.get $18 - i32.const 9 - i32.eq - br_if $case1|1 - local.get $18 - i32.const 8 - i32.eq - br_if $case2|1 - local.get $18 - i32.const 7 - i32.eq - br_if $case3|1 - local.get $18 - i32.const 6 - i32.eq - br_if $case4|1 - local.get $18 - i32.const 5 - i32.eq - br_if $case5|1 - local.get $18 - i32.const 4 - i32.eq - br_if $case6|1 - local.get $18 - i32.const 3 - i32.eq - br_if $case7|1 - local.get $18 - i32.const 2 - i32.eq - br_if $case8|1 - local.get $18 - i32.const 1 - i32.eq - br_if $case9|1 - br $case10|1 - end - block - local.get $12 - i32.const 1000000000 - i32.div_u - local.set $17 - local.get $12 - i32.const 1000000000 - i32.rem_u - local.set $12 - br $break|1 - unreachable - end - unreachable + block $break|1 + block $case10|1 + block $case9|1 + block $case8|1 + block $case7|1 + block $case6|1 + block $case5|1 + block $case4|1 + block $case3|1 + block $case2|1 + block $case1|1 + block $case0|1 + local.get $14 + local.set $18 + local.get $18 + i32.const 10 + i32.eq + br_if $case0|1 + local.get $18 + i32.const 9 + i32.eq + br_if $case1|1 + local.get $18 + i32.const 8 + i32.eq + br_if $case2|1 + local.get $18 + i32.const 7 + i32.eq + br_if $case3|1 + local.get $18 + i32.const 6 + i32.eq + br_if $case4|1 + local.get $18 + i32.const 5 + i32.eq + br_if $case5|1 + local.get $18 + i32.const 4 + i32.eq + br_if $case6|1 + local.get $18 + i32.const 3 + i32.eq + br_if $case7|1 + local.get $18 + i32.const 2 + i32.eq + br_if $case8|1 + local.get $18 + i32.const 1 + i32.eq + br_if $case9|1 + br $case10|1 end block local.get $12 - i32.const 100000000 + i32.const 1000000000 i32.div_u local.set $17 local.get $12 - i32.const 100000000 + i32.const 1000000000 i32.rem_u local.set $12 br $break|1 @@ -771,11 +754,11 @@ end block local.get $12 - i32.const 10000000 + i32.const 100000000 i32.div_u local.set $17 local.get $12 - i32.const 10000000 + i32.const 100000000 i32.rem_u local.set $12 br $break|1 @@ -785,11 +768,11 @@ end block local.get $12 - i32.const 1000000 + i32.const 10000000 i32.div_u local.set $17 local.get $12 - i32.const 1000000 + i32.const 10000000 i32.rem_u local.set $12 br $break|1 @@ -799,11 +782,11 @@ end block local.get $12 - i32.const 100000 + i32.const 1000000 i32.div_u local.set $17 local.get $12 - i32.const 100000 + i32.const 1000000 i32.rem_u local.set $12 br $break|1 @@ -813,11 +796,11 @@ end block local.get $12 - i32.const 10000 + i32.const 100000 i32.div_u local.set $17 local.get $12 - i32.const 10000 + i32.const 100000 i32.rem_u local.set $12 br $break|1 @@ -827,11 +810,11 @@ end block local.get $12 - i32.const 1000 + i32.const 10000 i32.div_u local.set $17 local.get $12 - i32.const 1000 + i32.const 10000 i32.rem_u local.set $12 br $break|1 @@ -841,11 +824,11 @@ end block local.get $12 - i32.const 100 + i32.const 1000 i32.div_u local.set $17 local.get $12 - i32.const 100 + i32.const 1000 i32.rem_u local.set $12 br $break|1 @@ -855,11 +838,11 @@ end block local.get $12 - i32.const 10 + i32.const 100 i32.div_u local.set $17 local.get $12 - i32.const 10 + i32.const 100 i32.rem_u local.set $12 br $break|1 @@ -869,8 +852,12 @@ end block local.get $12 + i32.const 10 + i32.div_u local.set $17 - i32.const 0 + local.get $12 + i32.const 10 + i32.rem_u local.set $12 br $break|1 unreachable @@ -878,159 +865,153 @@ unreachable end block - i32.const 0 + local.get $12 local.set $17 + i32.const 0 + local.set $12 br $break|1 unreachable end unreachable end - local.get $17 - local.get $15 - i32.or - if - local.get $0 - block (result i32) - local.get $15 - local.tee $18 - i32.const 1 - i32.add - local.set $15 - local.get $18 - end + block + i32.const 0 + local.set $17 + br $break|1 + unreachable + end + unreachable + end + local.get $17 + local.get $15 + i32.or + if + local.get $0 + block (result i32) + local.get $15 + local.tee $18 i32.const 1 - i32.shl i32.add - i32.const 48 - local.get $17 - i32.const 65535 - i32.and - i32.add - i32.store16 offset=4 + local.set $15 + local.get $18 end - local.get $14 i32.const 1 - i32.sub - local.set $14 - local.get $12 - i64.extend_i32_u - local.get $7 - i64.extend_i32_s - i64.shl - local.get $13 - i64.add - local.set $19 - local.get $19 - local.get $5 - i64.le_u - if - global.get $~lib/internal/number/_K + i32.shl + i32.add + i32.const 48 + local.get $17 + i32.const 65535 + i32.and + i32.add + i32.store16 + end + local.get $14 + i32.const 1 + i32.sub + local.set $14 + local.get $12 + i64.extend_i32_u + local.get $7 + i64.extend_i32_s + i64.shl + local.get $13 + i64.add + local.set $19 + local.get $19 + local.get $5 + i64.le_u + if + global.get $~lib/util/number/_K + local.get $14 + i32.add + global.set $~lib/util/number/_K + block $~lib/util/number/grisuRound|inlined.0 + local.get $0 + local.set $24 + local.get $15 + local.set $18 + local.get $5 + local.set $23 + local.get $19 + local.set $22 + local.get $16 local.get $14 + i32.const 2 + i32.shl i32.add - global.set $~lib/internal/number/_K - block $~lib/internal/number/grisuRound|inlined.0 - local.get $0 - local.set $18 - local.get $15 - local.set $20 - local.get $5 - local.set $21 - local.get $19 - local.set $22 - block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i64) - local.get $16 - local.set $23 - local.get $14 - local.set $24 - i32.const 0 - local.set $25 - local.get $23 - local.get $24 - i32.const 2 - i32.shl - i32.add - local.get $25 - i32.add - i64.load32_u offset=8 - end - local.get $7 - i64.extend_i32_s - i64.shl - local.set $26 - local.get $10 - local.set $27 - local.get $18 - local.get $20 - i32.const 1 - i32.sub - i32.const 1 - i32.shl - i32.add - local.set $25 - local.get $25 - i32.load16_u offset=4 - local.set $24 - block $break|2 - loop $continue|2 + i64.load32_u + local.get $7 + i64.extend_i32_s + i64.shl + local.set $21 + local.get $10 + local.set $20 + local.get $24 + local.get $18 + i32.const 1 + i32.sub + i32.const 1 + i32.shl + i32.add + local.set $25 + local.get $25 + i32.load16_u + local.set $26 + block $break|2 + loop $continue|2 + local.get $22 + local.get $20 + i64.lt_u + if (result i32) + local.get $23 + local.get $22 + i64.sub + local.get $21 + i64.ge_u + else + i32.const 0 + end + if (result i32) local.get $22 - local.get $27 + local.get $21 + i64.add + local.get $20 i64.lt_u - local.tee $23 if (result i32) - local.get $21 + i32.const 1 + else + local.get $20 local.get $22 i64.sub - local.get $26 - i64.ge_u - else - local.get $23 - end - local.tee $23 - if (result i32) local.get $22 - local.get $26 + local.get $21 i64.add - local.get $27 - i64.lt_u - local.tee $23 - if (result i32) - local.get $23 - else - local.get $27 - local.get $22 - i64.sub - local.get $22 - local.get $26 - i64.add - local.get $27 - i64.sub - i64.gt_u - end - else - local.get $23 - end - if - block - local.get $24 - i32.const 1 - i32.sub - local.set $24 - local.get $22 - local.get $26 - i64.add - local.set $22 - end - br $continue|2 + local.get $20 + i64.sub + i64.gt_u end + else + i32.const 0 + end + if + local.get $26 + i32.const 1 + i32.sub + local.set $26 + local.get $22 + local.get $21 + i64.add + local.set $22 + br $continue|2 end end - local.get $25 - local.get $24 - i32.store16 offset=4 end - local.get $15 - return + local.get $25 + local.get $26 + i32.store16 end + local.get $15 + return end br $continue|0 end @@ -1040,169 +1021,152 @@ loop $continue|3 i32.const 1 if - block - local.get $13 - i64.const 10 - i64.mul - local.set $13 - local.get $5 - i64.const 10 - i64.mul - local.set $5 - local.get $13 - local.get $7 - i64.extend_i32_s - i64.shr_u - local.set $19 - local.get $19 - local.get $15 - i64.extend_i32_s - i64.or - i64.const 0 - i64.ne - if - local.get $0 - block (result i32) - local.get $15 - local.tee $17 - i32.const 1 - i32.add - local.set $15 - local.get $17 - end + local.get $13 + i64.const 10 + i64.mul + local.set $13 + local.get $5 + i64.const 10 + i64.mul + local.set $5 + local.get $13 + local.get $7 + i64.extend_i32_s + i64.shr_u + local.set $19 + local.get $19 + local.get $15 + i64.extend_i32_s + i64.or + i64.const 0 + i64.ne + if + local.get $0 + block (result i32) + local.get $15 + local.tee $17 i32.const 1 - i32.shl i32.add - i32.const 48 - local.get $19 - i32.wrap_i64 - i32.const 65535 - i32.and - i32.add - i32.store16 offset=4 + local.set $15 + local.get $17 end - local.get $13 - local.get $9 - i64.and - local.set $13 - local.get $14 i32.const 1 + i32.shl + i32.add + i32.const 48 + local.get $19 + i32.wrap_i64 + i32.const 65535 + i32.and + i32.add + i32.store16 + end + local.get $13 + local.get $9 + i64.and + local.set $13 + local.get $14 + i32.const 1 + i32.sub + local.set $14 + local.get $13 + local.get $5 + i64.lt_u + if + global.get $~lib/util/number/_K + local.get $14 + i32.add + global.set $~lib/util/number/_K + local.get $10 + local.get $16 + i32.const 0 + local.get $14 i32.sub - local.set $14 - local.get $13 - local.get $5 - i64.lt_u - if - global.get $~lib/internal/number/_K - local.get $14 - i32.add - global.set $~lib/internal/number/_K - local.get $10 - block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i64) - local.get $16 - local.set $17 - i32.const 0 - local.get $14 - i32.sub - local.set $24 - i32.const 0 - local.set $25 - local.get $17 - local.get $24 - i32.const 2 - i32.shl - i32.add - local.get $25 - i32.add - i64.load32_u offset=8 - end - i64.mul - local.set $10 - block $~lib/internal/number/grisuRound|inlined.1 - local.get $0 - local.set $25 - local.get $15 - local.set $24 - local.get $5 - local.set $27 - local.get $13 - local.set $26 - local.get $8 - local.set $22 - local.get $10 - local.set $21 - local.get $25 - local.get $24 - i32.const 1 - i32.sub - i32.const 1 - i32.shl - i32.add - local.set $17 - local.get $17 - i32.load16_u offset=4 - local.set $20 - block $break|4 - loop $continue|4 - local.get $26 + i32.const 2 + i32.shl + i32.add + i64.load32_u + i64.mul + local.set $10 + block $~lib/util/number/grisuRound|inlined.1 + local.get $0 + local.set $24 + local.get $15 + local.set $18 + local.get $5 + local.set $23 + local.get $13 + local.set $22 + local.get $8 + local.set $21 + local.get $10 + local.set $20 + local.get $24 + local.get $18 + i32.const 1 + i32.sub + i32.const 1 + i32.shl + i32.add + local.set $17 + local.get $17 + i32.load16_u + local.set $26 + block $break|4 + loop $continue|4 + local.get $22 + local.get $20 + i64.lt_u + if (result i32) + local.get $23 + local.get $22 + i64.sub + local.get $21 + i64.ge_u + else + i32.const 0 + end + if (result i32) + local.get $22 local.get $21 + i64.add + local.get $20 i64.lt_u - local.tee $18 if (result i32) - local.get $27 - local.get $26 - i64.sub - local.get $22 - i64.ge_u + i32.const 1 else - local.get $18 - end - local.tee $18 - if (result i32) - local.get $26 + local.get $20 + local.get $22 + i64.sub local.get $22 - i64.add local.get $21 - i64.lt_u - local.tee $18 - if (result i32) - local.get $18 - else - local.get $21 - local.get $26 - i64.sub - local.get $26 - local.get $22 - i64.add - local.get $21 - i64.sub - i64.gt_u - end - else - local.get $18 - end - if - block - local.get $20 - i32.const 1 - i32.sub - local.set $20 - local.get $26 - local.get $22 - i64.add - local.set $26 - end - br $continue|4 + i64.add + local.get $20 + i64.sub + i64.gt_u end + else + i32.const 0 + end + if + local.get $26 + i32.const 1 + i32.sub + local.set $26 + local.get $22 + local.get $21 + i64.add + local.set $22 + br $continue|4 end end - local.get $17 - local.get $20 - i32.store16 offset=4 end - local.get $15 - return + local.get $17 + local.get $26 + i32.store16 end + local.get $15 + return end br $continue|3 end @@ -1210,7 +1174,7 @@ end local.get $15 ) - (func $~lib/internal/memory/memcpy (; 14 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/memory/memcpy (; 17 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -1222,33 +1186,31 @@ i32.const 3 i32.and else - local.get $2 + i32.const 0 end if - block - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - local.get $2 + block (result i32) + local.get $0 + local.tee $5 i32.const 1 - i32.sub - local.set $2 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 br $continue|0 end end @@ -1265,48 +1227,46 @@ i32.const 16 i32.ge_u if - block - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $1 - i32.const 4 - i32.add - i32.load - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $1 - i32.const 8 - i32.add - i32.load - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 12 - i32.add - i32.load - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - end + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 8 + i32.add + i32.load + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 12 + i32.add + i32.load + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 br $continue|1 end end @@ -1489,158 +1449,22 @@ i32.const 17 i32.ge_u if - block - local.get $1 - i32.const 1 - i32.add - i32.load - local.set $4 - local.get $0 - local.get $3 - i32.const 24 - i32.shr_u - local.get $4 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 5 - i32.add - i32.load - local.set $3 - local.get $0 - i32.const 4 - i32.add - local.get $4 - i32.const 24 - i32.shr_u - local.get $3 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 9 - i32.add - i32.load - local.set $4 - local.get $0 - i32.const 8 - i32.add - local.get $3 - i32.const 24 - i32.shr_u - local.get $4 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 13 - i32.add - i32.load - local.set $3 - local.get $0 - i32.const 12 - i32.add - local.get $4 - i32.const 24 - i32.shr_u - local.get $3 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - end - br $continue|3 - end - end - end - br $break|2 - unreachable - end - unreachable - end - block - local.get $1 - i32.load - local.set $3 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - local.get $2 - i32.const 2 - i32.sub - local.set $2 - block $break|4 - loop $continue|4 - local.get $2 - i32.const 18 - i32.ge_u - if - block local.get $1 - i32.const 2 + i32.const 1 i32.add i32.load local.set $4 local.get $0 local.get $3 - i32.const 16 + i32.const 24 i32.shr_u local.get $4 - i32.const 16 + i32.const 8 i32.shl i32.or i32.store local.get $1 - i32.const 6 + i32.const 5 i32.add i32.load local.set $3 @@ -1648,15 +1472,15 @@ i32.const 4 i32.add local.get $4 - i32.const 16 + i32.const 24 i32.shr_u local.get $3 - i32.const 16 + i32.const 8 i32.shl i32.or i32.store local.get $1 - i32.const 10 + i32.const 9 i32.add i32.load local.set $4 @@ -1664,15 +1488,15 @@ i32.const 8 i32.add local.get $3 - i32.const 16 + i32.const 24 i32.shr_u local.get $4 - i32.const 16 + i32.const 8 i32.shl i32.or i32.store local.get $1 - i32.const 14 + i32.const 13 i32.add i32.load local.set $3 @@ -1680,10 +1504,10 @@ i32.const 12 i32.add local.get $4 - i32.const 16 + i32.const 24 i32.shr_u local.get $3 - i32.const 16 + i32.const 8 i32.shl i32.or i32.store @@ -1699,65 +1523,81 @@ i32.const 16 i32.sub local.set $2 + br $continue|3 end - br $continue|4 end end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 end - br $break|2 - unreachable - end - unreachable - end - block - local.get $1 - i32.load - local.set $3 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - block $break|5 - loop $continue|5 - local.get $2 - i32.const 19 - i32.ge_u - if - block + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + block $break|4 + loop $continue|4 + local.get $2 + i32.const 18 + i32.ge_u + if local.get $1 - i32.const 3 + i32.const 2 i32.add i32.load local.set $4 local.get $0 local.get $3 - i32.const 8 + i32.const 16 i32.shr_u local.get $4 - i32.const 24 + i32.const 16 i32.shl i32.or i32.store local.get $1 - i32.const 7 + i32.const 6 i32.add i32.load local.set $3 @@ -1765,15 +1605,15 @@ i32.const 4 i32.add local.get $4 - i32.const 8 + i32.const 16 i32.shr_u local.get $3 - i32.const 24 + i32.const 16 i32.shl i32.or i32.store local.get $1 - i32.const 11 + i32.const 10 i32.add i32.load local.set $4 @@ -1781,15 +1621,15 @@ i32.const 8 i32.add local.get $3 - i32.const 8 + i32.const 16 i32.shr_u local.get $4 - i32.const 24 + i32.const 16 i32.shl i32.or i32.store local.get $1 - i32.const 15 + i32.const 14 i32.add i32.load local.set $3 @@ -1797,10 +1637,10 @@ i32.const 12 i32.add local.get $4 - i32.const 8 + i32.const 16 i32.shr_u local.get $3 - i32.const 24 + i32.const 16 i32.shl i32.or i32.store @@ -1816,7 +1656,121 @@ i32.const 16 i32.sub local.set $2 + br $continue|4 end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + block $break|5 + loop $continue|5 + local.get $2 + i32.const 19 + i32.ge_u + if + local.get $1 + i32.const 3 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 7 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 11 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 15 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 br $continue|5 end end @@ -2411,234 +2365,234 @@ i32.store8 end ) - (func $~lib/internal/memory/memmove (; 15 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/memory/memory.copy (; 18 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - local.get $0 - local.get $1 - i32.eq - if - return - end - local.get $1 - local.get $2 - i32.add - local.get $0 - i32.le_u - local.tee $3 - if (result i32) - local.get $3 - else - local.get $0 - local.get $2 - i32.add - local.get $1 - i32.le_u - end - if + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 local.get $0 + local.set $5 local.get $1 + local.set $4 local.get $2 - call $~lib/internal/memory/memcpy - return - end - local.get $0 - local.get $1 - i32.lt_u - if - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and + local.set $3 + local.get $5 + local.get $4 i32.eq if - block $break|0 - loop $continue|0 - local.get $0 - i32.const 7 - i32.and - if - block - local.get $2 + br $~lib/util/memory/memmove|inlined.0 + end + local.get $4 + local.get $3 + i32.add + local.get $5 + i32.le_u + if (result i32) + i32.const 1 + else + local.get $5 + local.get $3 + i32.add + local.get $4 + i32.le_u + end + if + local.get $5 + local.get $4 + local.get $3 + call $~lib/util/memory/memcpy + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 i32.eqz if - return + br $~lib/util/memory/memmove|inlined.0 end - local.get $2 + local.get $3 i32.const 1 i32.sub - local.set $2 + local.set $3 block (result i32) - local.get $0 - local.tee $3 + local.get $5 + local.tee $6 i32.const 1 i32.add - local.set $0 - local.get $3 + local.set $5 + local.get $6 end block (result i32) - local.get $1 - local.tee $3 + local.get $4 + local.tee $6 i32.const 1 i32.add - local.set $1 - local.get $3 + local.set $4 + local.get $6 end i32.load8_u i32.store8 + br $continue|0 end - br $continue|0 end end - end - block $break|1 - loop $continue|1 - local.get $2 - i32.const 8 - i32.ge_u - if - block - local.get $0 - local.get $1 + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 i64.load i64.store - local.get $2 + local.get $3 i32.const 8 i32.sub - local.set $2 - local.get $0 + local.set $3 + local.get $5 i32.const 8 i32.add - local.set $0 - local.get $1 + local.set $5 + local.get $4 i32.const 8 i32.add - local.set $1 + local.set $4 + br $continue|1 end - br $continue|1 end end end - end - block $break|2 - loop $continue|2 - local.get $2 - if - block + block $break|2 + loop $continue|2 + local.get $3 + if block (result i32) - local.get $0 - local.tee $3 + local.get $5 + local.tee $6 i32.const 1 i32.add - local.set $0 - local.get $3 + local.set $5 + local.get $6 end block (result i32) - local.get $1 - local.tee $3 + local.get $4 + local.tee $6 i32.const 1 i32.add - local.set $1 - local.get $3 + local.set $4 + local.get $6 end i32.load8_u i32.store8 - local.get $2 + local.get $3 i32.const 1 i32.sub - local.set $2 + local.set $3 + br $continue|2 end - br $continue|2 end end - end - else - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and - i32.eq - if - block $break|3 - loop $continue|3 - local.get $0 - local.get $2 - i32.add - i32.const 7 - i32.and - if - block - local.get $2 + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 i32.eqz if - return + br $~lib/util/memory/memmove|inlined.0 end - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.const 1 i32.sub - local.tee $2 + local.tee $3 i32.add - local.get $1 - local.get $2 + local.get $4 + local.get $3 i32.add i32.load8_u i32.store8 + br $continue|3 end - br $continue|3 end end - end - block $break|4 - loop $continue|4 - local.get $2 - i32.const 8 - i32.ge_u - if - block - local.get $2 + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 i32.const 8 i32.sub - local.set $2 - local.get $0 - local.get $2 + local.set $3 + local.get $5 + local.get $3 i32.add - local.get $1 - local.get $2 + local.get $4 + local.get $3 i32.add i64.load i64.store + br $continue|4 end - br $continue|4 end end end - end - block $break|5 - loop $continue|5 - local.get $2 - if - local.get $0 - local.get $2 - i32.const 1 - i32.sub - local.tee $2 - i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 - br $continue|5 + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end end end end end ) - (func $~lib/internal/number/prettify (; 16 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/prettify (; 19 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -2661,7 +2615,7 @@ i32.const 16 i32.shl i32.or - i32.store offset=4 + i32.store local.get $1 i32.const 2 i32.add @@ -2674,13 +2628,12 @@ local.get $1 local.get $3 i32.le_s - local.tee $4 if (result i32) local.get $3 i32.const 21 i32.le_s else - local.get $4 + i32.const 0 end if block $break|0 @@ -2698,7 +2651,7 @@ i32.shl i32.add i32.const 48 - i32.store16 offset=4 + i32.store16 local.get $4 i32.const 1 i32.add @@ -2718,7 +2671,7 @@ i32.const 16 i32.shl i32.or - i32.store offset=4 + i32.store local.get $3 i32.const 2 i32.add @@ -2727,13 +2680,12 @@ local.get $3 i32.const 0 i32.gt_s - local.tee $4 if (result i32) local.get $3 i32.const 21 i32.le_s else - local.get $4 + i32.const 0 end if local.get $0 @@ -2742,35 +2694,23 @@ i32.shl i32.add local.set $4 - block $~lib/memory/memory.copy|inlined.0 - local.get $4 - i32.const 4 - i32.add - i32.const 2 - i32.add - local.set $5 - local.get $4 - i32.const 4 - i32.add - local.set $6 - i32.const 0 - local.get $2 - i32.sub - i32.const 1 - i32.shl - local.set $7 - local.get $5 - local.get $6 - local.get $7 - call $~lib/internal/memory/memmove - end + local.get $4 + i32.const 2 + i32.add + local.get $4 + i32.const 0 + local.get $2 + i32.sub + i32.const 1 + i32.shl + call $~lib/memory/memory.copy local.get $0 local.get $3 i32.const 1 i32.shl i32.add i32.const 46 - i32.store16 offset=4 + i32.store16 local.get $1 i32.const 1 i32.add @@ -2779,48 +2719,35 @@ i32.const -6 local.get $3 i32.lt_s - local.tee $4 if (result i32) local.get $3 i32.const 0 i32.le_s else - local.get $4 + i32.const 0 end if i32.const 2 local.get $3 i32.sub local.set $4 - block $~lib/memory/memory.copy|inlined.1 - local.get $0 - i32.const 4 - i32.add - local.get $4 - i32.const 1 - i32.shl - i32.add - local.set $7 - local.get $0 - i32.const 4 - i32.add - local.set $6 - local.get $1 - i32.const 1 - i32.shl - local.set $5 - local.get $7 - local.get $6 - local.get $5 - call $~lib/internal/memory/memmove - end + local.get $0 + local.get $4 + i32.const 1 + i32.shl + i32.add + local.get $0 + local.get $1 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy local.get $0 i32.const 48 i32.const 46 i32.const 16 i32.shl i32.or - i32.store offset=4 + i32.store block $break|1 i32.const 2 local.set $5 @@ -2836,7 +2763,7 @@ i32.shl i32.add i32.const 48 - i32.store16 offset=4 + i32.store16 local.get $5 i32.const 1 i32.add @@ -2857,8 +2784,8 @@ if local.get $0 i32.const 101 - i32.store16 offset=6 - block $~lib/internal/number/genExponent|inlined.0 (result i32) + i32.store16 offset=2 + block $~lib/util/number/genExponent|inlined.0 (result i32) local.get $0 i32.const 4 i32.add @@ -2879,28 +2806,28 @@ local.set $5 end local.get $5 - call $~lib/internal/number/decimalCount32 + call $~lib/util/number/decimalCount32 i32.const 1 i32.add local.set $7 - block $~lib/internal/number/utoa32_core|inlined.1 + block $~lib/util/number/utoa32_core|inlined.1 local.get $4 - local.set $8 + local.set $10 local.get $5 local.set $9 local.get $7 - local.set $10 - local.get $8 - local.get $9 + local.set $8 local.get $10 - call $~lib/internal/number/utoa32_lut + local.get $9 + local.get $8 + call $~lib/util/number/utoa32_lut end local.get $4 i32.const 45 i32.const 43 local.get $6 select - i32.store16 offset=4 + i32.store16 local.get $7 end local.set $1 @@ -2913,83 +2840,71 @@ i32.const 1 i32.shl local.set $7 - block $~lib/memory/memory.copy|inlined.2 - local.get $0 - i32.const 4 - i32.add - i32.const 4 - i32.add - local.set $6 - local.get $0 - i32.const 4 - i32.add - i32.const 2 - i32.add - local.set $5 - local.get $7 - i32.const 2 - i32.sub - local.set $4 - local.get $6 - local.get $5 - local.get $4 - call $~lib/internal/memory/memmove - end + local.get $0 + i32.const 4 + i32.add + local.get $0 + i32.const 2 + i32.add + local.get $7 + i32.const 2 + i32.sub + call $~lib/memory/memory.copy local.get $0 i32.const 46 - i32.store16 offset=6 + i32.store16 offset=2 local.get $0 local.get $7 i32.add i32.const 101 - i32.store16 offset=6 + i32.store16 offset=2 local.get $1 - block $~lib/internal/number/genExponent|inlined.1 (result i32) + block $~lib/util/number/genExponent|inlined.1 (result i32) local.get $0 local.get $7 i32.add i32.const 4 i32.add - local.set $4 + local.set $9 local.get $3 i32.const 1 i32.sub - local.set $5 - local.get $5 + local.set $8 + local.get $8 i32.const 0 i32.lt_s local.set $6 local.get $6 if i32.const 0 - local.get $5 + local.get $8 i32.sub - local.set $5 + local.set $8 end - local.get $5 - call $~lib/internal/number/decimalCount32 + local.get $8 + call $~lib/util/number/decimalCount32 i32.const 1 i32.add - local.set $10 - block $~lib/internal/number/utoa32_core|inlined.2 - local.get $4 - local.set $9 - local.get $5 - local.set $8 - local.get $10 - local.set $11 + local.set $4 + block $~lib/util/number/utoa32_core|inlined.2 local.get $9 + local.set $11 local.get $8 + local.set $5 + local.get $4 + local.set $10 local.get $11 - call $~lib/internal/number/utoa32_lut + local.get $5 + local.get $10 + call $~lib/util/number/utoa32_lut end - local.get $4 + local.get $9 i32.const 45 i32.const 43 local.get $6 select - i32.store16 offset=4 - local.get $10 + i32.store16 + local.get $4 end i32.add local.set $1 @@ -3007,37 +2922,34 @@ unreachable unreachable ) - (func $~lib/internal/number/dtoa_core (; 17 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/util/number/dtoa_core (; 20 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) (local $2 i32) - (local $3 f64) + (local $3 i32) (local $4 i32) - (local $5 i32) + (local $5 f64) (local $6 i64) (local $7 i32) (local $8 i64) (local $9 i64) - (local $10 i64) - (local $11 i32) + (local $10 i32) + (local $11 i64) (local $12 i64) (local $13 i32) (local $14 i32) (local $15 i32) (local $16 f64) - (local $17 i32) - (local $18 i32) - (local $19 i32) - (local $20 i32) + (local $17 i64) + (local $18 i64) + (local $19 i64) + (local $20 i64) (local $21 i64) (local $22 i64) (local $23 i64) (local $24 i64) (local $25 i64) - (local $26 i64) + (local $26 i32) (local $27 i64) - (local $28 i64) - (local $29 i64) - (local $30 i64) - (local $31 i32) + (local $28 i32) local.get $1 f64.const 0 f64.lt @@ -3049,16 +2961,16 @@ local.set $1 local.get $0 i32.const 45 - i32.store16 offset=4 + i32.store16 end - block $~lib/internal/number/grisu2|inlined.0 (result i32) + block $~lib/util/number/grisu2|inlined.0 (result i32) local.get $1 - local.set $3 + local.set $5 local.get $0 local.set $4 local.get $2 - local.set $5 - local.get $3 + local.set $3 + local.get $5 i64.reinterpret_f64 local.set $6 local.get $6 @@ -3092,18 +3004,18 @@ i32.add i32.sub local.set $7 - block $~lib/internal/number/normalizedBoundaries|inlined.0 + block $~lib/util/number/normalizedBoundaries|inlined.0 local.get $9 - local.set $10 - local.get $7 local.set $11 - local.get $10 + local.get $7 + local.set $10 + local.get $11 i64.const 1 i64.shl i64.const 1 i64.add local.set $12 - local.get $11 + local.get $10 i32.const 1 i32.sub local.set $13 @@ -3121,35 +3033,35 @@ i32.sub local.set $13 i32.const 1 - local.get $10 + local.get $11 i64.const 4503599627370496 i64.eq i32.add local.set $15 local.get $12 - global.set $~lib/internal/number/_frc_plus - local.get $10 + global.set $~lib/util/number/_frc_plus + local.get $11 local.get $15 i64.extend_i32_s i64.shl i64.const 1 i64.sub - local.get $11 + local.get $10 local.get $15 i32.sub local.get $13 i32.sub i64.extend_i32_s i64.shl - global.set $~lib/internal/number/_frc_minus + global.set $~lib/util/number/_frc_minus local.get $13 - global.set $~lib/internal/number/_exp + global.set $~lib/util/number/_exp end - block $~lib/internal/number/getCachedPower|inlined.0 - global.get $~lib/internal/number/_exp - local.set $15 + block $~lib/util/number/getCachedPower|inlined.0 + global.get $~lib/util/number/_exp + local.set $10 i32.const -61 - local.get $15 + local.get $10 i32.sub f64.convert_i32_s f64.const 0.30102999566398114 @@ -3159,357 +3071,296 @@ local.set $16 local.get $16 i32.trunc_f64_s - local.set $14 - local.get $14 - local.get $14 + local.set $15 + local.get $15 + local.get $15 f64.convert_i32_s local.get $16 f64.ne i32.add - local.set $14 - local.get $14 + local.set $15 + local.get $15 i32.const 3 i32.shr_s i32.const 1 i32.add - local.set $13 + local.set $14 i32.const 348 - local.get $13 + local.get $14 i32.const 3 i32.shl i32.sub - global.set $~lib/internal/number/_K - i32.const 1728 - i32.load - local.set $11 - i32.const 1992 - i32.load - local.set $17 - block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i64) - local.get $11 - local.set $18 - local.get $13 - local.set $19 - i32.const 0 - local.set $20 - local.get $18 - local.get $19 - i32.const 3 - i32.shl - i32.add - local.get $20 - i32.add - i64.load offset=8 - end - global.set $~lib/internal/number/_frc_pow - block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) - local.get $17 - local.set $20 - local.get $13 - local.set $19 - i32.const 0 - local.set $18 - local.get $20 - local.get $19 - i32.const 1 - i32.shl - i32.add - local.get $18 - i32.add - i32.load16_s offset=8 - end - global.set $~lib/internal/number/_exp_pow + global.set $~lib/util/number/_K + i32.const 1392 + local.get $14 + call $~lib/array/Array#__unchecked_get + global.set $~lib/util/number/_frc_pow + i32.const 1616 + local.get $14 + call $~lib/array/Array#__unchecked_get + global.set $~lib/util/number/_exp_pow end local.get $9 i64.clz i32.wrap_i64 - local.set $17 + local.set $14 local.get $9 - local.get $17 + local.get $14 i64.extend_i32_s i64.shl local.set $9 local.get $7 - local.get $17 + local.get $14 i32.sub local.set $7 - global.get $~lib/internal/number/_frc_pow + global.get $~lib/util/number/_frc_pow local.set $12 - global.get $~lib/internal/number/_exp_pow - local.set $11 - block $~lib/internal/number/umul64f|inlined.0 (result i64) + global.get $~lib/util/number/_exp_pow + local.set $15 + block $~lib/util/number/umul64f|inlined.0 (result i64) local.get $9 - local.set $10 + local.set $17 local.get $12 - local.set $21 - local.get $10 + local.set $11 + local.get $17 i64.const 4294967295 i64.and - local.set $22 - local.get $21 + local.set $18 + local.get $11 i64.const 4294967295 i64.and - local.set $23 - local.get $10 + local.set $19 + local.get $17 i64.const 32 i64.shr_u - local.set $24 - local.get $21 + local.set $20 + local.get $11 i64.const 32 i64.shr_u - local.set $25 - local.get $22 - local.get $23 + local.set $21 + local.get $18 + local.get $19 i64.mul - local.set $26 - local.get $24 - local.get $23 + local.set $22 + local.get $20 + local.get $19 i64.mul - local.get $26 + local.get $22 i64.const 32 i64.shr_u i64.add - local.set $27 - local.get $22 - local.get $25 + local.set $23 + local.get $18 + local.get $21 i64.mul - local.get $27 + local.get $23 i64.const 4294967295 i64.and i64.add - local.set $28 - local.get $28 + local.set $24 + local.get $24 i64.const 2147483647 i64.add - local.set $28 - local.get $27 + local.set $24 + local.get $23 i64.const 32 i64.shr_u - local.set $27 - local.get $28 + local.set $23 + local.get $24 i64.const 32 i64.shr_u - local.set $28 - local.get $24 - local.get $25 + local.set $24 + local.get $20 + local.get $21 i64.mul - local.get $27 + local.get $23 i64.add - local.get $28 + local.get $24 i64.add end - local.set $28 - block $~lib/internal/number/umul64e|inlined.0 (result i32) + local.set $24 + block $~lib/util/number/umul64e|inlined.0 (result i32) local.get $7 + local.set $10 + local.get $15 local.set $13 - local.get $11 - local.set $14 + local.get $10 local.get $13 - local.get $14 i32.add i32.const 64 i32.add end - local.set $14 - block $~lib/internal/number/umul64f|inlined.1 (result i64) - global.get $~lib/internal/number/_frc_plus - local.set $27 + local.set $10 + block $~lib/util/number/umul64f|inlined.1 (result i64) + global.get $~lib/util/number/_frc_plus + local.set $17 local.get $12 - local.set $26 - local.get $27 + local.set $11 + local.get $17 i64.const 4294967295 i64.and - local.set $25 - local.get $26 + local.set $23 + local.get $11 i64.const 4294967295 i64.and - local.set $24 - local.get $27 + local.set $22 + local.get $17 i64.const 32 i64.shr_u - local.set $23 - local.get $26 + local.set $21 + local.get $11 i64.const 32 i64.shr_u - local.set $22 - local.get $25 - local.get $24 - i64.mul - local.set $21 + local.set $20 local.get $23 - local.get $24 + local.get $22 i64.mul + local.set $19 local.get $21 + local.get $22 + i64.mul + local.get $19 i64.const 32 i64.shr_u i64.add - local.set $10 - local.get $25 - local.get $22 + local.set $18 + local.get $23 + local.get $20 i64.mul - local.get $10 + local.get $18 i64.const 4294967295 i64.and i64.add - local.set $29 - local.get $29 + local.set $25 + local.get $25 i64.const 2147483647 i64.add - local.set $29 - local.get $10 + local.set $25 + local.get $18 i64.const 32 i64.shr_u - local.set $10 - local.get $29 + local.set $18 + local.get $25 i64.const 32 i64.shr_u - local.set $29 - local.get $23 - local.get $22 + local.set $25 + local.get $21 + local.get $20 i64.mul - local.get $10 + local.get $18 i64.add - local.get $29 + local.get $25 i64.add end i64.const 1 i64.sub - local.set $29 - block $~lib/internal/number/umul64e|inlined.1 (result i32) - global.get $~lib/internal/number/_exp + local.set $25 + block $~lib/util/number/umul64e|inlined.1 (result i32) + global.get $~lib/util/number/_exp + local.set $26 + local.get $15 local.set $13 - local.get $11 - local.set $15 + local.get $26 local.get $13 - local.get $15 i32.add i32.const 64 i32.add end - local.set $15 - block $~lib/internal/number/umul64f|inlined.2 (result i64) - global.get $~lib/internal/number/_frc_minus - local.set $10 + local.set $26 + block $~lib/util/number/umul64f|inlined.2 (result i64) + global.get $~lib/util/number/_frc_minus + local.set $17 local.get $12 - local.set $21 - local.get $10 + local.set $11 + local.get $17 i64.const 4294967295 i64.and - local.set $22 - local.get $21 + local.set $18 + local.get $11 i64.const 4294967295 i64.and - local.set $23 - local.get $10 + local.set $19 + local.get $17 i64.const 32 i64.shr_u - local.set $24 - local.get $21 + local.set $20 + local.get $11 i64.const 32 i64.shr_u - local.set $25 - local.get $22 - local.get $23 + local.set $21 + local.get $18 + local.get $19 i64.mul - local.set $26 - local.get $24 - local.get $23 + local.set $22 + local.get $20 + local.get $19 i64.mul - local.get $26 + local.get $22 i64.const 32 i64.shr_u i64.add - local.set $27 - local.get $22 - local.get $25 + local.set $23 + local.get $18 + local.get $21 i64.mul - local.get $27 + local.get $23 i64.const 4294967295 i64.and i64.add - local.set $30 - local.get $30 + local.set $27 + local.get $27 i64.const 2147483647 i64.add - local.set $30 - local.get $27 + local.set $27 + local.get $23 i64.const 32 i64.shr_u - local.set $27 - local.get $30 + local.set $23 + local.get $27 i64.const 32 i64.shr_u - local.set $30 - local.get $24 - local.get $25 + local.set $27 + local.get $20 + local.get $21 i64.mul - local.get $27 + local.get $23 i64.add - local.get $30 + local.get $27 i64.add end i64.const 1 i64.add - local.set $30 - local.get $29 - local.get $30 - i64.sub local.set $27 - local.get $4 - local.get $28 - local.get $14 - local.get $29 - local.get $15 + local.get $25 local.get $27 - local.get $5 - call $~lib/internal/number/genDigits + i64.sub + local.set $23 + local.get $4 + local.get $24 + local.get $10 + local.get $25 + local.get $26 + local.get $23 + local.get $3 + call $~lib/util/number/genDigits end - local.set $31 + local.set $28 local.get $0 local.get $2 i32.const 1 i32.shl i32.add - local.get $31 + local.get $28 local.get $2 i32.sub - global.get $~lib/internal/number/_K - call $~lib/internal/number/prettify - local.set $31 - local.get $31 - local.get $2 - i32.add - ) - (func $~lib/internal/string/copyUnsafe (; 18 ;) (type $FUNCSIG$viiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - local.get $0 - local.get $1 - i32.const 1 - i32.shl - i32.add - i32.const 4 - i32.add - local.set $5 + global.get $~lib/util/number/_K + call $~lib/util/number/prettify + local.set $28 + local.get $28 local.get $2 - local.get $3 - i32.const 1 - i32.shl - i32.add - i32.const 4 i32.add - local.set $6 - local.get $4 - i32.const 1 - i32.shl - local.set $7 - local.get $5 - local.get $6 - local.get $7 - call $~lib/internal/memory/memmove ) - (func $~lib/string/String#substring (; 19 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/string/String#substring (; 21 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -3524,14 +3375,14 @@ i32.eqz if i32.const 0 - i32.const 2072 - i32.const 254 + i32.const 1736 + i32.const 196 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 - i32.load + call $~lib/string/String#get:length local.set $3 local.get $1 local.tee $4 @@ -3573,6 +3424,8 @@ local.get $5 i32.lt_s select + i32.const 1 + i32.shl local.set $8 local.get $6 local.tee $4 @@ -3582,6 +3435,8 @@ local.get $5 i32.gt_s select + i32.const 1 + i32.shl local.set $9 local.get $9 local.get $8 @@ -3590,49 +3445,53 @@ local.get $3 i32.eqz if - i32.const 2104 + i32.const 1784 + call $~lib/rt/stub/__retain return end local.get $8 i32.eqz - local.tee $4 if (result i32) local.get $9 local.get $0 - i32.load + call $~lib/string/String#get:length + i32.const 1 + i32.shl i32.eq else - local.get $4 + i32.const 0 end if local.get $0 + call $~lib/rt/stub/__retain return end local.get $3 - call $~lib/internal/string/allocateUnsafe + i32.const 1 + call $~lib/rt/stub/__alloc local.set $10 local.get $10 - i32.const 0 local.get $0 local.get $8 + i32.add local.get $3 - call $~lib/internal/string/copyUnsafe + call $~lib/memory/memory.copy local.get $10 + call $~lib/rt/stub/__retain ) - (func $~lib/allocator/arena/__memory_free (; 20 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/stub/__free (; 22 ;) (type $FUNCSIG$vi) (param $0 i32) nop ) - (func $~lib/internal/number/dtoa (; 21 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + (func $~lib/util/number/dtoa (; 23 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) - (local $4 i32) - (local $5 i32) local.get $0 f64.const 0 f64.eq if - i32.const 624 + i32.const 560 + call $~lib/rt/stub/__retain return end local.get $0 @@ -3642,214 +3501,219 @@ local.get $0 call $~lib/builtins/isNaN if - i32.const 640 + i32.const 584 + call $~lib/rt/stub/__retain return end - i32.const 656 - i32.const 680 + i32.const 608 + i32.const 648 local.get $0 f64.const 0 f64.lt select + call $~lib/rt/stub/__retain return end i32.const 28 - call $~lib/internal/string/allocateUnsafe + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/stub/__alloc local.set $1 local.get $1 local.get $0 - call $~lib/internal/number/dtoa_core + call $~lib/util/number/dtoa_core local.set $2 + local.get $2 + i32.const 28 + i32.eq + if + local.get $1 + call $~lib/rt/stub/__retain + return + end local.get $1 i32.const 0 local.get $2 call $~lib/string/String#substring local.set $3 - block $~lib/internal/string/freeUnsafe|inlined.0 - local.get $1 - local.set $4 - local.get $4 - i32.eqz - if - i32.const 0 - i32.const 16 - i32.const 28 - i32.const 4 - call $~lib/env/abort - unreachable - end - block $~lib/memory/memory.free|inlined.0 - local.get $4 - local.set $5 - local.get $5 - call $~lib/allocator/arena/__memory_free - br $~lib/memory/memory.free|inlined.0 - end - end + local.get $1 + call $~lib/rt/stub/__free local.get $3 ) - (func $~lib/number/F64#toString (; 22 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + (func $~lib/number/F64#toString (; 24 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) local.get $0 - call $~lib/internal/number/dtoa + call $~lib/util/number/dtoa ) - (func $~lib/number/Bool#toString (; 23 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/number/Bool#toString (; 25 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) local.get $0 - i32.const 0 - i32.ne if (result i32) - i32.const 2160 + i32.const 1920 + call $~lib/rt/stub/__retain + local.tee $1 else - i32.const 2176 + i32.const 1944 + call $~lib/rt/stub/__retain + local.tee $2 end + call $~lib/rt/stub/__retain ) - (func $~lib/number/F32.isSafeInteger (; 24 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) - (local $1 i32) + (func $~lib/builtins/isNaN (; 26 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) + local.get $0 + local.get $0 + f32.ne + ) + (func $~lib/number/F32.isSafeInteger (; 27 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) local.get $0 f32.abs global.get $~lib/builtins/f32.MAX_SAFE_INTEGER f32.le - local.tee $1 if (result i32) local.get $0 f32.trunc local.get $0 f32.eq else - local.get $1 + i32.const 0 end ) - (func $~lib/number/F32.isInteger (; 25 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) - (local $1 f32) - (local $2 i32) - block $~lib/builtins/isFinite|inlined.0 (result i32) - local.get $0 - local.set $1 - local.get $1 - local.get $1 - f32.sub - f32.const 0 - f32.eq - end - local.tee $2 - i32.const 0 - i32.ne + (func $~lib/builtins/isFinite (; 28 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) + local.get $0 + local.get $0 + f32.sub + f32.const 0 + f32.eq + ) + (func $~lib/number/F32.isInteger (; 29 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) + local.get $0 + call $~lib/builtins/isFinite if (result i32) local.get $0 f32.trunc local.get $0 f32.eq else - local.get $2 + i32.const 0 end ) - (func $~lib/number/F64.isSafeInteger (; 26 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) - (local $1 i32) + (func $~lib/number/F64.isSafeInteger (; 30 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) local.get $0 f64.abs global.get $~lib/builtins/f64.MAX_SAFE_INTEGER f64.le - local.tee $1 if (result i32) local.get $0 f64.trunc local.get $0 f64.eq else - local.get $1 + i32.const 0 end ) - (func $~lib/number/F64.isInteger (; 27 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) - (local $1 f64) - (local $2 i32) - block $~lib/builtins/isFinite|inlined.0 (result i32) - local.get $0 - local.set $1 - local.get $1 - local.get $1 - f64.sub - f64.const 0 - f64.eq - end - local.tee $2 - i32.const 0 - i32.ne + (func $~lib/number/F64.isInteger (; 31 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + call $~lib/builtins/isFinite if (result i32) local.get $0 f64.trunc local.get $0 f64.eq else - local.get $2 + i32.const 0 end ) - (func $start:number (; 28 ;) (type $FUNCSIG$v) + (func $start:number (; 32 ;) (type $FUNCSIG$v) (local $0 i32) - (local $1 f32) - (local $2 f64) - call $start:~lib/allocator/arena + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset global.get $number/a call $~lib/number/I32#toString - i32.const 592 + local.tee $0 + i32.const 496 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 600 - i32.const 7 + i32.const 520 + i32.const 5 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2 call $~lib/number/F64#toString - i32.const 2112 + local.tee $1 + i32.const 1800 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 600 - i32.const 9 + i32.const 520 + i32.const 7 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 3 call $~lib/number/I32#toString - i32.const 2128 + local.tee $2 + i32.const 1824 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 600 - i32.const 10 + i32.const 520 + i32.const 8 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const -5 call $~lib/number/I32#toString - i32.const 2136 + local.tee $3 + i32.const 1848 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 600 - i32.const 12 + i32.const 520 + i32.const 10 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 4 call $~lib/number/I32#toString - i32.const 2144 + local.tee $4 + i32.const 1872 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 600 - i32.const 13 + i32.const 520 + i32.const 11 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block (result i32) @@ -3860,15 +3724,16 @@ global.get $number/a end call $~lib/number/I32#toString - i32.const 2152 + local.tee $5 + i32.const 1896 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 600 - i32.const 14 + i32.const 520 + i32.const 12 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block (result i32) @@ -3879,101 +3744,99 @@ global.get $number/a end call $~lib/number/I32#toString - i32.const 592 + local.tee $6 + i32.const 496 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 600 - i32.const 15 + i32.const 520 + i32.const 13 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 i32.eqz call $~lib/number/Bool#toString - i32.const 2160 + local.tee $7 + i32.const 1920 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 600 - i32.const 16 + i32.const 520 + i32.const 14 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 i32.eqz call $~lib/number/Bool#toString - i32.const 2176 + local.tee $8 + i32.const 1944 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 600 - i32.const 17 + i32.const 520 + i32.const 15 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block (result i32) global.get $number/a - local.tee $0 + local.tee $9 i32.const 1 i32.add global.set $number/a - local.get $0 + local.get $9 end call $~lib/number/I32#toString - i32.const 592 + local.tee $9 + i32.const 496 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 600 - i32.const 20 + i32.const 520 + i32.const 18 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block (result i32) global.get $number/a - local.tee $0 + local.tee $10 i32.const 1 i32.sub global.set $number/a - local.get $0 + local.get $10 end call $~lib/number/I32#toString - i32.const 2152 + local.tee $10 + i32.const 1896 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 600 - i32.const 21 + i32.const 520 + i32.const 19 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/builtins/isNaN|inlined.0 (result i32) - global.get $~lib/number/F32.NaN - local.set $1 - local.get $1 - local.get $1 - f32.ne - end - i32.const 0 - i32.ne + global.get $~lib/number/F32.NaN + call $~lib/builtins/isNaN i32.eqz if i32.const 0 - i32.const 600 - i32.const 25 + i32.const 520 + i32.const 23 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f32.MIN_SAFE_INTEGER @@ -3985,10 +3848,10 @@ i32.eqz if i32.const 0 - i32.const 600 - i32.const 27 + i32.const 520 + i32.const 25 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f32.MIN_SAFE_INTEGER @@ -3998,10 +3861,10 @@ i32.eqz if i32.const 0 - i32.const 600 - i32.const 28 + i32.const 520 + i32.const 26 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -4011,10 +3874,10 @@ i32.eqz if i32.const 0 - i32.const 600 - i32.const 29 + i32.const 520 + i32.const 27 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -4024,10 +3887,10 @@ i32.eqz if i32.const 0 - i32.const 600 - i32.const 30 + i32.const 520 + i32.const 28 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -4037,10 +3900,10 @@ i32.eqz if i32.const 0 - i32.const 600 - i32.const 31 + i32.const 520 + i32.const 29 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -4050,10 +3913,10 @@ i32.eqz if i32.const 0 - i32.const 600 - i32.const 32 + i32.const 520 + i32.const 30 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f32.MAX_SAFE_INTEGER @@ -4063,10 +3926,10 @@ i32.eqz if i32.const 0 - i32.const 600 - i32.const 33 + i32.const 520 + i32.const 31 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f32.MAX_SAFE_INTEGER @@ -4078,10 +3941,10 @@ i32.eqz if i32.const 0 - i32.const 600 - i32.const 34 + i32.const 520 + i32.const 32 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -4091,193 +3954,164 @@ i32.eqz if i32.const 0 - i32.const 600 - i32.const 35 + i32.const 520 + i32.const 33 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 call $~lib/number/F32.isInteger - i32.const 0 - i32.ne i32.const 1 i32.eq i32.eqz if i32.const 0 - i32.const 600 - i32.const 36 + i32.const 520 + i32.const 34 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 call $~lib/number/F32.isInteger - i32.const 0 - i32.ne i32.const 1 i32.eq i32.eqz if i32.const 0 - i32.const 600 - i32.const 37 + i32.const 520 + i32.const 35 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 call $~lib/number/F32.isInteger i32.const 0 - i32.ne - i32.const 0 i32.eq i32.eqz if i32.const 0 - i32.const 600 - i32.const 38 + i32.const 520 + i32.const 36 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf call $~lib/number/F32.isInteger i32.const 0 - i32.ne - i32.const 0 i32.eq i32.eqz if i32.const 0 - i32.const 600 - i32.const 39 + i32.const 520 + i32.const 37 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f32.EPSILON call $~lib/number/F32.isInteger i32.const 0 - i32.ne - i32.const 0 i32.eq i32.eqz if i32.const 0 - i32.const 600 - i32.const 40 + i32.const 520 + i32.const 38 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 call $~lib/number/F32.isInteger - i32.const 0 - i32.ne i32.const 1 i32.eq i32.eqz if i32.const 0 - i32.const 600 - i32.const 41 + i32.const 520 + i32.const 39 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 call $~lib/number/F32.isInteger - i32.const 0 - i32.ne i32.const 1 i32.eq i32.eqz if i32.const 0 - i32.const 600 - i32.const 42 + i32.const 520 + i32.const 40 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f32.MIN_SAFE_INTEGER call $~lib/number/F32.isInteger - i32.const 0 - i32.ne i32.const 1 i32.eq i32.eqz if i32.const 0 - i32.const 600 - i32.const 43 + i32.const 520 + i32.const 41 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f32.MAX_SAFE_INTEGER call $~lib/number/F32.isInteger - i32.const 0 - i32.ne i32.const 1 i32.eq i32.eqz if i32.const 0 - i32.const 600 - i32.const 44 + i32.const 520 + i32.const 42 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 call $~lib/number/F32.isInteger i32.const 0 - i32.ne - i32.const 0 i32.eq i32.eqz if i32.const 0 - i32.const 600 - i32.const 45 + i32.const 520 + i32.const 43 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.5 call $~lib/number/F32.isInteger i32.const 0 - i32.ne - i32.const 0 i32.eq i32.eqz if i32.const 0 - i32.const 600 - i32.const 46 + i32.const 520 + i32.const 44 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/builtins/isNaN|inlined.0 (result i32) - global.get $~lib/number/F64.NaN - local.set $2 - local.get $2 - local.get $2 - f64.ne - end - i32.const 0 - i32.ne + global.get $~lib/number/F64.NaN + call $~lib/builtins/isNaN i32.eqz if i32.const 0 - i32.const 600 - i32.const 48 + i32.const 520 + i32.const 46 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f64.MIN_SAFE_INTEGER @@ -4289,10 +4123,10 @@ i32.eqz if i32.const 0 - i32.const 600 - i32.const 50 + i32.const 520 + i32.const 48 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f64.MIN_SAFE_INTEGER @@ -4302,10 +4136,10 @@ i32.eqz if i32.const 0 - i32.const 600 - i32.const 51 + i32.const 520 + i32.const 49 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -4315,10 +4149,10 @@ i32.eqz if i32.const 0 - i32.const 600 - i32.const 52 + i32.const 520 + i32.const 50 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -4328,10 +4162,10 @@ i32.eqz if i32.const 0 - i32.const 600 - i32.const 53 + i32.const 520 + i32.const 51 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -4341,10 +4175,10 @@ i32.eqz if i32.const 0 - i32.const 600 - i32.const 54 + i32.const 520 + i32.const 52 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -4354,10 +4188,10 @@ i32.eqz if i32.const 0 - i32.const 600 - i32.const 55 + i32.const 520 + i32.const 53 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f64.MAX_SAFE_INTEGER @@ -4367,10 +4201,10 @@ i32.eqz if i32.const 0 - i32.const 600 - i32.const 56 + i32.const 520 + i32.const 54 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f64.MAX_SAFE_INTEGER @@ -4382,10 +4216,10 @@ i32.eqz if i32.const 0 - i32.const 600 - i32.const 57 + i32.const 520 + i32.const 55 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -4395,181 +4229,181 @@ i32.eqz if i32.const 0 - i32.const 600 - i32.const 58 + i32.const 520 + i32.const 56 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 call $~lib/number/F64.isInteger - i32.const 0 - i32.ne i32.const 1 i32.eq i32.eqz if i32.const 0 - i32.const 600 - i32.const 59 + i32.const 520 + i32.const 57 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 call $~lib/number/F64.isInteger - i32.const 0 - i32.ne i32.const 1 i32.eq i32.eqz if i32.const 0 - i32.const 600 - i32.const 60 + i32.const 520 + i32.const 58 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 call $~lib/number/F64.isInteger i32.const 0 - i32.ne - i32.const 0 i32.eq i32.eqz if i32.const 0 - i32.const 600 - i32.const 61 + i32.const 520 + i32.const 59 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf call $~lib/number/F64.isInteger i32.const 0 - i32.ne - i32.const 0 i32.eq i32.eqz if i32.const 0 - i32.const 600 - i32.const 62 + i32.const 520 + i32.const 60 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f64.EPSILON call $~lib/number/F64.isInteger i32.const 0 - i32.ne - i32.const 0 i32.eq i32.eqz if i32.const 0 - i32.const 600 - i32.const 63 + i32.const 520 + i32.const 61 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 call $~lib/number/F64.isInteger - i32.const 0 - i32.ne i32.const 1 i32.eq i32.eqz if i32.const 0 - i32.const 600 - i32.const 64 + i32.const 520 + i32.const 62 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 call $~lib/number/F64.isInteger - i32.const 0 - i32.ne i32.const 1 i32.eq i32.eqz if i32.const 0 - i32.const 600 - i32.const 65 + i32.const 520 + i32.const 63 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f64.MIN_SAFE_INTEGER call $~lib/number/F64.isInteger - i32.const 0 - i32.ne i32.const 1 i32.eq i32.eqz if i32.const 0 - i32.const 600 - i32.const 66 + i32.const 520 + i32.const 64 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f64.MAX_SAFE_INTEGER call $~lib/number/F64.isInteger - i32.const 0 - i32.ne i32.const 1 i32.eq i32.eqz if i32.const 0 - i32.const 600 - i32.const 67 + i32.const 520 + i32.const 65 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 call $~lib/number/F64.isInteger i32.const 0 - i32.ne - i32.const 0 i32.eq i32.eqz if i32.const 0 - i32.const 600 - i32.const 68 + i32.const 520 + i32.const 66 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.5 call $~lib/number/F64.isInteger i32.const 0 - i32.ne - i32.const 0 i32.eq i32.eqz if i32.const 0 - i32.const 600 - i32.const 69 + i32.const 520 + i32.const 67 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 + call $~lib/rt/stub/__release + local.get $3 + call $~lib/rt/stub/__release + local.get $4 + call $~lib/rt/stub/__release + local.get $5 + call $~lib/rt/stub/__release + local.get $6 + call $~lib/rt/stub/__release + local.get $7 + call $~lib/rt/stub/__release + local.get $8 + call $~lib/rt/stub/__release + local.get $9 + call $~lib/rt/stub/__release + local.get $10 + call $~lib/rt/stub/__release ) - (func $start (; 29 ;) (type $FUNCSIG$v) + (func $start (; 33 ;) (type $FUNCSIG$v) call $start:number ) - (func $null (; 30 ;) (type $FUNCSIG$v) + (func $null (; 34 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/object-literal.optimized.wat b/tests/compiler/object-literal.optimized.wat deleted file mode 100644 index 3c219403b3..0000000000 --- a/tests/compiler/object-literal.optimized.wat +++ /dev/null @@ -1,235 +0,0 @@ -(module - (type $FUNCSIG$v (func)) - (type $FUNCSIG$ii (func (param i32) (result i32))) - (type $FUNCSIG$vi (func (param i32))) - (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) - (type $FUNCSIG$iii (func (param i32 i32) (result i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) - (memory $0 1) - (data (i32.const 8) "\0b\00\00\00h\00e\00l\00l\00o\00 \00w\00o\00r\00l\00d") - (data (i32.const 40) "\11\00\00\00o\00b\00j\00e\00c\00t\00-\00l\00i\00t\00e\00r\00a\00l\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) - (export "memory" (memory $0)) - (export "table" (table $0)) - (start $start) - (func $~lib/allocator/arena/__memory_allocate (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - local.get $0 - i32.const 1073741824 - i32.gt_u - if - unreachable - end - global.get $~lib/allocator/arena/offset - local.tee $1 - local.get $0 - i32.const 1 - local.get $0 - i32.const 1 - i32.gt_u - select - i32.add - i32.const 7 - i32.add - i32.const -8 - i32.and - local.tee $0 - current_memory - local.tee $2 - i32.const 16 - i32.shl - i32.gt_u - if - local.get $2 - local.get $0 - local.get $1 - i32.sub - i32.const 65535 - i32.add - i32.const -65536 - i32.and - i32.const 16 - i32.shr_u - local.tee $3 - local.get $2 - local.get $3 - i32.gt_s - select - grow_memory - i32.const 0 - i32.lt_s - if - local.get $3 - grow_memory - i32.const 0 - i32.lt_s - if - unreachable - end - end - end - local.get $0 - global.set $~lib/allocator/arena/offset - local.get $1 - ) - (func $~lib/internal/string/compareUnsafe (; 2 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - i32.const 8 - local.set $2 - loop $continue|0 - local.get $1 - if (result i32) - local.get $0 - i32.load16_u offset=4 - local.get $2 - i32.load16_u offset=4 - i32.sub - local.tee $3 - i32.eqz - else - local.get $1 - end - if - local.get $1 - i32.const 1 - i32.sub - local.set $1 - local.get $0 - i32.const 2 - i32.add - local.set $0 - local.get $2 - i32.const 2 - i32.add - local.set $2 - br $continue|0 - end - end - local.get $3 - ) - (func $~lib/string/String.__eq (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - local.get $0 - i32.const 8 - i32.eq - if - i32.const 1 - return - end - local.get $0 - i32.eqz - local.tee $1 - if (result i32) - local.get $1 - else - i32.const 0 - end - if - i32.const 0 - return - end - local.get $0 - i32.load - local.tee $1 - i32.const 8 - i32.load - i32.ne - if - i32.const 0 - return - end - local.get $0 - local.get $1 - call $~lib/internal/string/compareUnsafe - i32.eqz - ) - (func $object-literal/bar (; 4 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 - i32.load - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 40 - i32.const 9 - i32.const 2 - call $~lib/env/abort - unreachable - end - local.get $0 - i32.load offset=4 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 40 - i32.const 10 - i32.const 2 - call $~lib/env/abort - unreachable - end - ) - (func $start:object-literal (; 5 ;) (type $FUNCSIG$v) - (local $0 i32) - i32.const 80 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - i32.const 8 - call $~lib/allocator/arena/__memory_allocate - local.tee $0 - i32.const 1 - i32.store - local.get $0 - i32.const 8 - i32.store offset=4 - local.get $0 - call $object-literal/bar - i32.const 4 - call $~lib/allocator/arena/__memory_allocate - local.tee $0 - i32.const 2 - i32.store - local.get $0 - i32.load - i32.const 2 - i32.ne - if - i32.const 0 - i32.const 40 - i32.const 26 - i32.const 2 - call $~lib/env/abort - unreachable - end - i32.const 4 - call $~lib/allocator/arena/__memory_allocate - local.tee $0 - i32.const 3 - i32.store - local.get $0 - i32.load - i32.const 3 - i32.ne - if - i32.const 0 - i32.const 40 - i32.const 21 - i32.const 4 - call $~lib/env/abort - unreachable - end - ) - (func $start (; 6 ;) (type $FUNCSIG$v) - call $start:object-literal - ) - (func $null (; 7 ;) (type $FUNCSIG$v) - nop - ) -) diff --git a/tests/compiler/object-literal.untouched.wat b/tests/compiler/object-literal.untouched.wat deleted file mode 100644 index f5dc9f1ccf..0000000000 --- a/tests/compiler/object-literal.untouched.wat +++ /dev/null @@ -1,315 +0,0 @@ -(module - (type $FUNCSIG$v (func)) - (type $FUNCSIG$ii (func (param i32) (result i32))) - (type $FUNCSIG$vi (func (param i32))) - (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) - (type $FUNCSIG$iii (func (param i32 i32) (result i32))) - (type $FUNCSIG$iiiiii (func (param i32 i32 i32 i32 i32) (result i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) - (memory $0 1) - (data (i32.const 8) "\0b\00\00\00h\00e\00l\00l\00o\00 \00w\00o\00r\00l\00d\00") - (data (i32.const 40) "\11\00\00\00o\00b\00j\00e\00c\00t\00-\00l\00i\00t\00e\00r\00a\00l\00.\00t\00s\00") - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 80)) - (export "memory" (memory $0)) - (export "table" (table $0)) - (start $start) - (func $start:~lib/allocator/arena (; 1 ;) (type $FUNCSIG$v) - global.get $~lib/memory/HEAP_BASE - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - ) - (func $~lib/allocator/arena/__memory_allocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $0 - i32.const 1073741824 - i32.gt_u - if - unreachable - end - global.get $~lib/allocator/arena/offset - local.set $1 - local.get $1 - local.get $0 - local.tee $2 - i32.const 1 - local.tee $3 - local.get $2 - local.get $3 - i32.gt_u - select - i32.add - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - local.set $4 - current_memory - local.set $5 - local.get $4 - local.get $5 - i32.const 16 - i32.shl - i32.gt_u - if - local.get $4 - local.get $1 - i32.sub - i32.const 65535 - i32.add - i32.const 65535 - i32.const -1 - i32.xor - i32.and - i32.const 16 - i32.shr_u - local.set $2 - local.get $5 - local.tee $3 - local.get $2 - local.tee $6 - local.get $3 - local.get $6 - i32.gt_s - select - local.set $3 - local.get $3 - grow_memory - i32.const 0 - i32.lt_s - if - local.get $2 - grow_memory - i32.const 0 - i32.lt_s - if - unreachable - end - end - end - local.get $4 - global.set $~lib/allocator/arena/offset - local.get $1 - ) - (func $~lib/memory/memory.allocate (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - call $~lib/allocator/arena/__memory_allocate - return - ) - (func $~lib/internal/string/compareUnsafe (; 4 ;) (type $FUNCSIG$iiiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - i32.const 0 - local.set $5 - local.get $0 - local.get $1 - i32.const 1 - i32.shl - i32.add - local.set $6 - local.get $2 - local.get $3 - i32.const 1 - i32.shl - i32.add - local.set $7 - block $break|0 - loop $continue|0 - local.get $4 - if (result i32) - local.get $6 - i32.load16_u offset=4 - local.get $7 - i32.load16_u offset=4 - i32.sub - local.tee $5 - i32.eqz - else - local.get $4 - end - if - block - local.get $4 - i32.const 1 - i32.sub - local.set $4 - local.get $6 - i32.const 2 - i32.add - local.set $6 - local.get $7 - i32.const 2 - i32.add - local.set $7 - end - br $continue|0 - end - end - end - local.get $5 - ) - (func $~lib/string/String.__eq (; 5 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - local.get $0 - local.get $1 - i32.eq - if - i32.const 1 - return - end - local.get $0 - i32.const 0 - i32.eq - local.tee $2 - if (result i32) - local.get $2 - else - local.get $1 - i32.const 0 - i32.eq - end - if - i32.const 0 - return - end - local.get $0 - i32.load - local.set $3 - local.get $3 - local.get $1 - i32.load - i32.ne - if - i32.const 0 - return - end - local.get $0 - i32.const 0 - local.get $1 - i32.const 0 - local.get $3 - call $~lib/internal/string/compareUnsafe - i32.eqz - ) - (func $object-literal/bar (; 6 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 - i32.load - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 40 - i32.const 9 - i32.const 2 - call $~lib/env/abort - unreachable - end - local.get $0 - i32.load offset=4 - i32.const 8 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 40 - i32.const 10 - i32.const 2 - call $~lib/env/abort - unreachable - end - ) - (func $object-literal/bar2 (; 7 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 - i32.load - i32.const 2 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 40 - i32.const 26 - i32.const 2 - call $~lib/env/abort - unreachable - end - ) - (func $object-literal/Foo2#test (; 8 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 - i32.load - i32.const 3 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 40 - i32.const 21 - i32.const 4 - call $~lib/env/abort - unreachable - end - ) - (func $start:object-literal (; 9 ;) (type $FUNCSIG$v) - (local $0 i32) - (local $1 i32) - (local $2 i32) - call $start:~lib/allocator/arena - block (result i32) - i32.const 8 - call $~lib/memory/memory.allocate - local.set $0 - local.get $0 - i32.const 1 - i32.store - local.get $0 - i32.const 8 - i32.store offset=4 - local.get $0 - end - call $object-literal/bar - block (result i32) - i32.const 4 - call $~lib/memory/memory.allocate - local.set $1 - local.get $1 - i32.const 2 - i32.store - local.get $1 - end - call $object-literal/bar2 - block (result i32) - i32.const 4 - call $~lib/memory/memory.allocate - local.set $2 - local.get $2 - i32.const 3 - i32.store - local.get $2 - end - call $object-literal/Foo2#test - ) - (func $start (; 10 ;) (type $FUNCSIG$v) - call $start:object-literal - ) - (func $null (; 11 ;) (type $FUNCSIG$v) - ) -) diff --git a/tests/compiler/optional-typeparameters.json b/tests/compiler/optional-typeparameters.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/optional-typeparameters.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/optional-typeparameters.optimized.wat b/tests/compiler/optional-typeparameters.optimized.wat index 2364edb5b5..64a1f4e32d 100644 --- a/tests/compiler/optional-typeparameters.optimized.wat +++ b/tests/compiler/optional-typeparameters.optimized.wat @@ -1,37 +1,36 @@ (module (type $FUNCSIG$v (func)) - (type $FUNCSIG$i (func (result i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) (global $optional-typeparameters/tConcrete (mut i32) (i32.const 0)) (global $optional-typeparameters/tDerived (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) - (func $~lib/allocator/arena/__memory_allocate (; 0 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) + (func $~lib/rt/stub/__alloc (; 0 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) - global.get $~lib/allocator/arena/offset - local.tee $0 - i32.const 8 + (local $4 i32) + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.tee $2 + i32.const 16 i32.add - i32.const -8 + i32.const -16 i32.and local.tee $1 - current_memory - local.tee $2 + memory.size + local.tee $3 i32.const 16 i32.shl i32.gt_u if - local.get $2 + local.get $3 local.get $1 - local.get $0 + local.get $2 i32.sub i32.const 65535 i32.add @@ -39,17 +38,17 @@ i32.and i32.const 16 i32.shr_u - local.tee $3 - local.get $2 + local.tee $4 local.get $3 + local.get $4 i32.gt_s select - grow_memory + memory.grow i32.const 0 i32.lt_s if - local.get $3 - grow_memory + local.get $4 + memory.grow i32.const 0 i32.lt_s if @@ -58,17 +57,28 @@ end end local.get $1 - global.set $~lib/allocator/arena/offset + global.set $~lib/rt/stub/offset + local.get $2 + i32.const 16 + i32.sub + local.tee $1 local.get $0 + i32.store offset=8 + local.get $1 + i32.const 0 + i32.store offset=12 + local.get $2 ) (func $start (; 1 ;) (type $FUNCSIG$v) - i32.const 8 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - call $~lib/allocator/arena/__memory_allocate + i32.const 16 + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset + i32.const 3 + call $~lib/rt/stub/__alloc global.set $optional-typeparameters/tConcrete - call $~lib/allocator/arena/__memory_allocate + i32.const 4 + call $~lib/rt/stub/__alloc global.set $optional-typeparameters/tDerived ) (func $null (; 2 ;) (type $FUNCSIG$v) diff --git a/tests/compiler/optional-typeparameters.ts b/tests/compiler/optional-typeparameters.ts index d4361fb166..4974050030 100644 --- a/tests/compiler/optional-typeparameters.ts +++ b/tests/compiler/optional-typeparameters.ts @@ -21,7 +21,6 @@ class TestDerived { } } -import "allocator/arena"; var tConcrete = new TestConcrete(); tConcrete.test(1, 2); var tDerived = new TestDerived() diff --git a/tests/compiler/optional-typeparameters.untouched.wat b/tests/compiler/optional-typeparameters.untouched.wat index 066794dc33..a95982f0a4 100644 --- a/tests/compiler/optional-typeparameters.untouched.wat +++ b/tests/compiler/optional-typeparameters.untouched.wat @@ -1,18 +1,18 @@ (module (type $FUNCSIG$ii (func (param i32) (result i32))) - (type $FUNCSIG$v (func)) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$didd (func (param i32 f64 f64) (result f64))) + (type $FUNCSIG$v (func)) (memory $0 0) (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) (global $optional-typeparameters/tConcrete (mut i32) (i32.const 0)) (global $optional-typeparameters/tDerived (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) + (global $~lib/heap/__heap_base i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $optional-typeparameters/testConcrete (; 0 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 @@ -20,60 +20,51 @@ (func $optional-typeparameters/testDerived (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 ) - (func $start:~lib/allocator/arena (; 2 ;) (type $FUNCSIG$v) - global.get $~lib/memory/HEAP_BASE - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - ) - (func $~lib/allocator/arena/__memory_allocate (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/rt/stub/__alloc (; 2 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) + (local $8 i32) local.get $0 - i32.const 1073741824 + i32.const 1073741808 i32.gt_u if unreachable end - global.get $~lib/allocator/arena/offset - local.set $1 - local.get $1 + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.set $2 + local.get $2 local.get $0 - local.tee $2 - i32.const 1 local.tee $3 - local.get $2 + i32.const 1 + local.tee $4 local.get $3 + local.get $4 i32.gt_u select i32.add - i32.const 7 + i32.const 15 i32.add - i32.const 7 + i32.const 15 i32.const -1 i32.xor i32.and - local.set $4 - current_memory local.set $5 - local.get $4 + memory.size + local.set $6 local.get $5 + local.get $6 i32.const 16 i32.shl i32.gt_u if - local.get $4 - local.get $1 + local.get $5 + local.get $2 i32.sub i32.const 65535 i32.add @@ -83,23 +74,23 @@ i32.and i32.const 16 i32.shr_u - local.set $2 - local.get $5 - local.tee $3 - local.get $2 - local.tee $6 - local.get $3 + local.set $3 local.get $6 + local.tee $4 + local.get $3 + local.tee $7 + local.get $4 + local.get $7 i32.gt_s select - local.set $3 - local.get $3 - grow_memory + local.set $4 + local.get $4 + memory.grow i32.const 0 i32.lt_s if - local.get $2 - grow_memory + local.get $3 + memory.grow i32.const 0 i32.lt_s if @@ -107,53 +98,74 @@ end end end - local.get $4 - global.set $~lib/allocator/arena/offset + local.get $5 + global.set $~lib/rt/stub/offset + local.get $2 + i32.const 16 + i32.sub + local.set $8 + local.get $8 local.get $1 + i32.store offset=8 + local.get $8 + local.get $0 + i32.store offset=12 + local.get $2 ) - (func $~lib/memory/memory.allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/rt/stub/__retain (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - call $~lib/allocator/arena/__memory_allocate - return ) - (func $optional-typeparameters/TestConcrete#constructor (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $optional-typeparameters/TestConcrete#constructor (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.eqz if i32.const 0 - call $~lib/memory/memory.allocate + i32.const 3 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain local.set $0 end local.get $0 ) - (func $optional-typeparameters/TestConcrete#test (; 6 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $optional-typeparameters/TestConcrete#test (; 5 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $1 local.get $2 i32.add ) - (func $optional-typeparameters/TestDerived#constructor (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $optional-typeparameters/TestDerived#constructor (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.eqz if i32.const 0 - call $~lib/memory/memory.allocate + i32.const 4 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain local.set $0 end local.get $0 ) - (func $optional-typeparameters/TestDerived#test (; 8 ;) (type $FUNCSIG$didd) (param $0 i32) (param $1 f64) (param $2 f64) (result f64) + (func $optional-typeparameters/TestDerived#test (; 7 ;) (type $FUNCSIG$didd) (param $0 i32) (param $1 f64) (param $2 f64) (result f64) local.get $1 local.get $2 f64.add ) - (func $start:optional-typeparameters (; 9 ;) (type $FUNCSIG$v) + (func $start:optional-typeparameters (; 8 ;) (type $FUNCSIG$v) i32.const 1 call $optional-typeparameters/testConcrete drop i32.const 2 call $optional-typeparameters/testDerived drop - call $start:~lib/allocator/arena + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset i32.const 0 call $optional-typeparameters/TestConcrete#constructor global.set $optional-typeparameters/tConcrete @@ -171,9 +183,9 @@ call $optional-typeparameters/TestDerived#test drop ) - (func $start (; 10 ;) (type $FUNCSIG$v) + (func $start (; 9 ;) (type $FUNCSIG$v) call $start:optional-typeparameters ) - (func $null (; 11 ;) (type $FUNCSIG$v) + (func $null (; 10 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/overflow.json b/tests/compiler/overflow.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/overflow.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/overflow.optimized.wat b/tests/compiler/overflow.optimized.wat index 75d5ba7122..4bc2888fd3 100644 --- a/tests/compiler/overflow.optimized.wat +++ b/tests/compiler/overflow.optimized.wat @@ -1,11 +1,8 @@ (module (type $FUNCSIG$v (func)) (memory $0 1) - (data (i32.const 8) "\0b\00\00\00o\00v\00e\00r\00f\00l\00o\00w\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $start) + (data (i32.const 8) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00o\00v\00e\00r\00f\00l\00o\00w\00.\00t\00s") (export "memory" (memory $0)) - (export "table" (table $0)) (func $start (; 0 ;) (type $FUNCSIG$v) nop ) diff --git a/tests/compiler/overflow.untouched.wat b/tests/compiler/overflow.untouched.wat index bae4097a2e..67e0bb93ef 100644 --- a/tests/compiler/overflow.untouched.wat +++ b/tests/compiler/overflow.untouched.wat @@ -1,14 +1,12 @@ (module (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\0b\00\00\00o\00v\00e\00r\00f\00l\00o\00w\00.\00t\00s\00") + (data (i32.const 8) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00o\00v\00e\00r\00f\00l\00o\00w\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/memory/HEAP_BASE i32 (i32.const 36)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $start:overflow (; 1 ;) (type $FUNCSIG$v) (local $0 i32) @@ -31,10 +29,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 10 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -51,10 +49,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 13 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block (result i32) @@ -76,10 +74,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 16 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block (result i32) @@ -101,10 +99,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 19 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -121,10 +119,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 22 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -141,10 +139,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 25 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -162,10 +160,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 28 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -183,10 +181,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 31 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -201,10 +199,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 33 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end end @@ -225,10 +223,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 42 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -245,10 +243,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 45 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block (result i32) @@ -270,10 +268,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 48 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block (result i32) @@ -295,10 +293,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 51 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -315,10 +313,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 54 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -335,10 +333,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 57 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -356,10 +354,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 60 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -377,10 +375,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 63 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -395,10 +393,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 65 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end end @@ -417,10 +415,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 74 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -435,10 +433,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 77 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block (result i32) @@ -458,10 +456,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 80 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block (result i32) @@ -481,10 +479,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 83 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -499,10 +497,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 86 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -517,10 +515,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 89 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -536,10 +534,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 92 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -555,10 +553,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 95 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -571,10 +569,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 97 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end end @@ -593,10 +591,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 106 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -611,10 +609,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 109 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block (result i32) @@ -634,10 +632,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 112 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block (result i32) @@ -657,10 +655,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 115 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -675,10 +673,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 118 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -693,10 +691,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 121 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -712,10 +710,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 124 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -731,10 +729,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 127 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -747,10 +745,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 129 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end end diff --git a/tests/compiler/portable-conversions.json b/tests/compiler/portable-conversions.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/portable-conversions.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/portable-conversions.optimized.wat b/tests/compiler/portable-conversions.optimized.wat index ab02e83b04..bdadf6535f 100644 --- a/tests/compiler/portable-conversions.optimized.wat +++ b/tests/compiler/portable-conversions.optimized.wat @@ -1,17 +1,14 @@ (module (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\17\00\00\00p\00o\00r\00t\00a\00b\00l\00e\00-\00c\00o\00n\00v\00e\00r\00s\00i\00o\00n\00s\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $portable-conversions/i (mut i32) (i32.const 1)) - (global $portable-conversions/I (mut i64) (i64.const 1)) - (global $portable-conversions/f (mut f32) (f32.const 1)) - (global $portable-conversions/F (mut f64) (f64.const 1)) + (data (i32.const 8) ".\00\00\00\01\00\00\00\01\00\00\00.\00\00\00p\00o\00r\00t\00a\00b\00l\00e\00-\00c\00o\00n\00v\00e\00r\00s\00i\00o\00n\00s\00.\00t\00s") + (global $portable-conversions/i i32 (i32.const 1)) + (global $portable-conversions/I i64 (i64.const 1)) + (global $portable-conversions/f f32 (f32.const 1)) + (global $portable-conversions/F f64 (f64.const 1)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $start:portable-conversions (; 1 ;) (type $FUNCSIG$v) global.get $portable-conversions/i @@ -20,10 +17,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 6 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/I @@ -33,10 +30,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 7 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/f @@ -46,10 +43,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 8 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/F @@ -59,10 +56,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 9 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/i @@ -71,10 +68,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 11 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/I @@ -84,10 +81,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 12 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/f @@ -97,10 +94,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 13 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/F @@ -110,20 +107,20 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 14 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/i i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 16 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/I @@ -131,10 +128,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 17 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/f @@ -142,10 +139,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 18 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/F @@ -153,10 +150,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 19 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/i @@ -164,20 +161,20 @@ i64.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 21 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/I i64.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 22 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/f @@ -185,10 +182,10 @@ i64.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 23 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/F @@ -196,20 +193,20 @@ i64.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 24 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/i i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 26 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/I @@ -217,10 +214,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 27 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/f @@ -228,10 +225,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 28 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/F @@ -239,10 +236,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 29 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/i @@ -251,10 +248,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 31 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/I @@ -264,10 +261,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 32 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/f @@ -277,10 +274,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 33 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/F @@ -290,10 +287,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 34 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/i @@ -302,10 +299,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 36 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/I @@ -315,10 +312,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 37 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/f @@ -328,10 +325,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 38 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/F @@ -341,20 +338,20 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 39 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/i i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 41 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/I @@ -362,10 +359,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 42 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/f @@ -373,10 +370,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 43 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/F @@ -384,10 +381,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 44 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/i @@ -395,20 +392,20 @@ i64.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 46 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/I i64.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 47 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/f @@ -416,10 +413,10 @@ i64.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 48 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/F @@ -427,20 +424,20 @@ i64.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 49 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/i i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 51 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/I @@ -448,10 +445,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 52 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/f @@ -459,10 +456,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 53 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/F @@ -470,20 +467,20 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 54 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/i i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 56 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/I @@ -491,10 +488,10 @@ i64.eq if i32.const 0 - i32.const 8 + i32.const 24 i32.const 57 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/f @@ -502,10 +499,10 @@ f32.eq if i32.const 0 - i32.const 8 + i32.const 24 i32.const 58 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/F @@ -513,10 +510,10 @@ f64.eq if i32.const 0 - i32.const 8 + i32.const 24 i32.const 59 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/i @@ -525,10 +522,10 @@ f32.eq if i32.const 0 - i32.const 8 + i32.const 24 i32.const 61 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/I @@ -537,10 +534,10 @@ f32.eq if i32.const 0 - i32.const 8 + i32.const 24 i32.const 62 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/f @@ -548,10 +545,10 @@ f32.eq if i32.const 0 - i32.const 8 + i32.const 24 i32.const 63 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/F @@ -560,10 +557,10 @@ f32.eq if i32.const 0 - i32.const 8 + i32.const 24 i32.const 64 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/i @@ -572,10 +569,10 @@ f64.eq if i32.const 0 - i32.const 8 + i32.const 24 i32.const 66 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/I @@ -584,10 +581,10 @@ f64.eq if i32.const 0 - i32.const 8 + i32.const 24 i32.const 67 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/f @@ -596,10 +593,10 @@ f64.eq if i32.const 0 - i32.const 8 + i32.const 24 i32.const 68 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/F @@ -607,10 +604,10 @@ f64.eq if i32.const 0 - i32.const 8 + i32.const 24 i32.const 69 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/portable-conversions.untouched.wat b/tests/compiler/portable-conversions.untouched.wat index 6ca1d6f251..11f2e775c1 100644 --- a/tests/compiler/portable-conversions.untouched.wat +++ b/tests/compiler/portable-conversions.untouched.wat @@ -1,18 +1,16 @@ (module (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\17\00\00\00p\00o\00r\00t\00a\00b\00l\00e\00-\00c\00o\00n\00v\00e\00r\00s\00i\00o\00n\00s\00.\00t\00s\00") + (data (i32.const 8) ".\00\00\00\01\00\00\00\01\00\00\00.\00\00\00p\00o\00r\00t\00a\00b\00l\00e\00-\00c\00o\00n\00v\00e\00r\00s\00i\00o\00n\00s\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) (global $portable-conversions/i (mut i32) (i32.const 1)) (global $portable-conversions/I (mut i64) (i64.const 1)) (global $portable-conversions/f (mut f32) (f32.const 1)) (global $portable-conversions/F (mut f64) (f64.const 1)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 60)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $start:portable-conversions (; 1 ;) (type $FUNCSIG$v) global.get $portable-conversions/i @@ -23,10 +21,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 6 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/I @@ -38,10 +36,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 7 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/f @@ -53,10 +51,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 8 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/F @@ -68,10 +66,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 9 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/i @@ -82,10 +80,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 11 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/I @@ -97,10 +95,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 12 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/f @@ -112,10 +110,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 13 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/F @@ -127,20 +125,20 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 14 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/i i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 16 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/I @@ -148,10 +146,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 17 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/f @@ -159,10 +157,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 18 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/F @@ -170,10 +168,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 19 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/i @@ -181,20 +179,20 @@ i64.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 21 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/I i64.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 22 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/f @@ -202,10 +200,10 @@ i64.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 23 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/F @@ -213,20 +211,20 @@ i64.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 24 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/i i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 26 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/I @@ -234,10 +232,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 27 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/f @@ -245,10 +243,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 28 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/F @@ -256,10 +254,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 29 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/i @@ -268,10 +266,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 31 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/I @@ -281,10 +279,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 32 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/f @@ -294,10 +292,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 33 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/F @@ -307,10 +305,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 34 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/i @@ -319,10 +317,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 36 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/I @@ -332,10 +330,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 37 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/f @@ -345,10 +343,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 38 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/F @@ -358,20 +356,20 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 39 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/i i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 41 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/I @@ -379,10 +377,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 42 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/f @@ -390,10 +388,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 43 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/F @@ -401,10 +399,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 44 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/i @@ -412,20 +410,20 @@ i64.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 46 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/I i64.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 47 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/f @@ -433,10 +431,10 @@ i64.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 48 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/F @@ -444,20 +442,20 @@ i64.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 49 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/i i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 51 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/I @@ -465,10 +463,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 52 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/f @@ -476,10 +474,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 53 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/F @@ -487,10 +485,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 54 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/i @@ -499,10 +497,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 56 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/I @@ -511,10 +509,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 57 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/f @@ -523,10 +521,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 58 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/F @@ -535,10 +533,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 59 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/i @@ -547,10 +545,10 @@ f32.eq if i32.const 0 - i32.const 8 + i32.const 24 i32.const 61 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/I @@ -559,10 +557,10 @@ f32.eq if i32.const 0 - i32.const 8 + i32.const 24 i32.const 62 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/f @@ -570,10 +568,10 @@ f32.eq if i32.const 0 - i32.const 8 + i32.const 24 i32.const 63 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/F @@ -582,10 +580,10 @@ f32.eq if i32.const 0 - i32.const 8 + i32.const 24 i32.const 64 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/i @@ -594,10 +592,10 @@ f64.eq if i32.const 0 - i32.const 8 + i32.const 24 i32.const 66 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/I @@ -606,10 +604,10 @@ f64.eq if i32.const 0 - i32.const 8 + i32.const 24 i32.const 67 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/f @@ -618,10 +616,10 @@ f64.eq if i32.const 0 - i32.const 8 + i32.const 24 i32.const 68 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $portable-conversions/F @@ -629,10 +627,10 @@ f64.eq if i32.const 0 - i32.const 8 + i32.const 24 i32.const 69 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/possibly-null.json b/tests/compiler/possibly-null.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/possibly-null.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/possibly-null.optimized.wat b/tests/compiler/possibly-null.optimized.wat new file mode 100644 index 0000000000..4af480291f --- /dev/null +++ b/tests/compiler/possibly-null.optimized.wat @@ -0,0 +1,67 @@ +(module + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$v (func)) + (memory $0 0) + (export "memory" (memory $0)) + (export "testTrue" (func $possibly-null/testTrue)) + (export "testFalseElse" (func $possibly-null/testTrue)) + (export "testFalseContinuation" (func $possibly-null/testTrue)) + (export "testNeNull" (func $possibly-null/testTrue)) + (export "testEqNullElse" (func $possibly-null/testTrue)) + (export "testEqNullContinuation" (func $possibly-null/testTrue)) + (export "testNotEqNull" (func $possibly-null/testTrue)) + (export "testNotNeNullElse" (func $possibly-null/testTrue)) + (export "testNotNeNullContinuation" (func $possibly-null/testTrue)) + (export "testWhile" (func $possibly-null/testWhile)) + (export "testWhile2" (func $possibly-null/testWhile2)) + (export "testWhile3" (func $possibly-null/testWhile3)) + (export "testLogicalAnd" (func $possibly-null/testTrue)) + (export "testLogicalOr" (func $possibly-null/testTrue)) + (export "testLogicalAndMulti" (func $possibly-null/testLogicalAndMulti)) + (export "testLogicalOrMulti" (func $possibly-null/testLogicalAndMulti)) + (export "testAssign" (func $possibly-null/testLogicalAndMulti)) + (export "testNeverNull" (func $possibly-null/testTrue)) + (func $possibly-null/testTrue (; 0 ;) (type $FUNCSIG$vi) (param $0 i32) + nop + ) + (func $possibly-null/testWhile (; 1 ;) (type $FUNCSIG$vi) (param $0 i32) + loop $continue|0 + local.get $0 + if + i32.const 0 + local.set $0 + br $continue|0 + end + end + ) + (func $possibly-null/testWhile2 (; 2 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + loop $continue|0 + local.get $0 + if + local.get $1 + local.set $0 + br $continue|0 + end + end + ) + (func $possibly-null/testWhile3 (; 3 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + loop $continue|0 + local.get $0 + if + local.get $1 + local.get $0 + local.get $1 + select + local.set $0 + br $continue|0 + end + end + ) + (func $possibly-null/testLogicalAndMulti (; 4 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $null (; 5 ;) (type $FUNCSIG$v) + nop + ) +) diff --git a/tests/compiler/possibly-null.ts b/tests/compiler/possibly-null.ts new file mode 100644 index 0000000000..4e1d79a989 --- /dev/null +++ b/tests/compiler/possibly-null.ts @@ -0,0 +1,127 @@ +class Ref {} + +// the following makes use of the fact that branches that can be eliminated statically +// won't become compiled, hence the ERROR statement is never executed. + +export function testTrue(a: Ref | null): void { + if (a) { + if (isNullable(a)) ERROR("should be non-nullable"); + } +} + +export function testFalseElse(a: Ref | null): void { + if (!a) return; + else { + if (isNullable(a)) ERROR("should be non-nullable"); + } +} + +export function testFalseContinuation(a: Ref | null): void { + if (!a) return; + if (isNullable(a)) ERROR("should be non-nullable"); +} + +export function testNeNull(a: Ref | null): void { + if (a != null) { + if (isNullable(a)) ERROR("should be non-nullable"); + } +} + +export function testEqNullElse(a: Ref | null): void { + if (a == null) return; + else { + if (isNullable(a)) ERROR("should be non-nullable"); + } +} + +export function testEqNullContinuation(a: Ref | null): void { + if (a == null) return; + if (isNullable(a)) ERROR("should be non-nullable"); +} + +export function testNotEqNull(a: Ref | null): void { + if (!(a == null)) { + if (isNullable(a)) ERROR("should be non-nullable"); + } +} + +export function testNotNeNullElse(a: Ref | null): void { + if (!(a != null)) return; + else { + if (isNullable(a)) ERROR("should be non-nullable"); + } +} + +export function testNotNeNullContinuation(a: Ref | null): void { + if (!(a != null)) return; + if (isNullable(a)) ERROR("should be non-nullable"); +} + +export function testWhile(a: Ref | null): void { + while (a) { + if (isNullable(a)) ERROR("should be non-nullable"); + a = null; + if (!isNullable(a)) ERROR("should be nullable again"); + } +} + +export function testWhile2(a: Ref | null, b: Ref | null): void { + while (a) { + if (isNullable(a)) ERROR("should be non-nullable"); + a = b; + if (!isNullable(a)) ERROR("should be nullable again"); + } +} + +export function testWhile3(a: Ref | null, b: Ref | null): void { + while (a) { + if (isNullable(a)) ERROR("should be non-nullable"); + if (b) { + a = b; + if (isNullable(a)) ERROR("should be non-nullable still"); + } + } +} + +function requireNonNull(a: Ref): Ref { + return a; +} + +export function testLogicalAnd(a: Ref | null): void { + a && requireNonNull(a); +} + +export function testLogicalOr(a: Ref | null): void { + !a || requireNonNull(a) != null; +} + +export function testLogicalAndMulti(a: Ref | null, b: Ref | null): void { + if (a && b) { + if (isNullable(a)) ERROR("should be non-nullable"); + if (isNullable(b)) ERROR("should be non-nullable"); + } else { + if (!isNullable(a)) ERROR("should be nullable"); + if (!isNullable(b)) ERROR("should be nullable"); + } +} + +export function testLogicalOrMulti(a: Ref | null, b: Ref | null): void { + if (!a || !b) { + if (!isNullable(a)) ERROR("should be nullable"); + if (!isNullable(b)) ERROR("should be nullable"); + } else { + if (isNullable(a)) ERROR("should be non-nullable"); + if (isNullable(b)) ERROR("should be non-nullable"); + } +} + +export function testAssign(a: Ref | null, b: Ref): void { + a = b; + if (isNullable(a)) ERROR("should be non-nullable"); +} + +export function testNeverNull(a: Ref | null): void { + if (a) { + a!; // INFO AS225: Expression is never 'null'. + } +} diff --git a/tests/compiler/possibly-null.untouched.wat b/tests/compiler/possibly-null.untouched.wat new file mode 100644 index 0000000000..f597c77ffa --- /dev/null +++ b/tests/compiler/possibly-null.untouched.wat @@ -0,0 +1,425 @@ +(module + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$v (func)) + (memory $0 0) + (table $0 1 funcref) + (elem (i32.const 0) $null) + (export "memory" (memory $0)) + (export "testTrue" (func $possibly-null/testTrue)) + (export "testFalseElse" (func $possibly-null/testFalseElse)) + (export "testFalseContinuation" (func $possibly-null/testFalseContinuation)) + (export "testNeNull" (func $possibly-null/testNeNull)) + (export "testEqNullElse" (func $possibly-null/testEqNullElse)) + (export "testEqNullContinuation" (func $possibly-null/testEqNullContinuation)) + (export "testNotEqNull" (func $possibly-null/testNotEqNull)) + (export "testNotNeNullElse" (func $possibly-null/testNotNeNullElse)) + (export "testNotNeNullContinuation" (func $possibly-null/testNotNeNullContinuation)) + (export "testWhile" (func $possibly-null/testWhile)) + (export "testWhile2" (func $possibly-null/testWhile2)) + (export "testWhile3" (func $possibly-null/testWhile3)) + (export "testLogicalAnd" (func $possibly-null/testLogicalAnd)) + (export "testLogicalOr" (func $possibly-null/testLogicalOr)) + (export "testLogicalAndMulti" (func $possibly-null/testLogicalAndMulti)) + (export "testLogicalOrMulti" (func $possibly-null/testLogicalOrMulti)) + (export "testAssign" (func $possibly-null/testAssign)) + (export "testNeverNull" (func $possibly-null/testNeverNull)) + (func $~lib/rt/stub/__retain (; 0 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + ) + (func $~lib/rt/stub/__release (; 1 ;) (type $FUNCSIG$vi) (param $0 i32) + nop + ) + (func $possibly-null/testTrue (; 2 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $0 + if + nop + end + local.get $0 + call $~lib/rt/stub/__release + ) + (func $possibly-null/testFalseElse (; 3 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $0 + i32.eqz + if + local.get $0 + call $~lib/rt/stub/__release + return + else + nop + end + local.get $0 + call $~lib/rt/stub/__release + ) + (func $possibly-null/testFalseContinuation (; 4 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $0 + i32.eqz + if + local.get $0 + call $~lib/rt/stub/__release + return + end + local.get $0 + call $~lib/rt/stub/__release + ) + (func $possibly-null/testNeNull (; 5 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $0 + i32.const 0 + i32.ne + if + nop + end + local.get $0 + call $~lib/rt/stub/__release + ) + (func $possibly-null/testEqNullElse (; 6 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $0 + i32.const 0 + i32.eq + if + local.get $0 + call $~lib/rt/stub/__release + return + else + nop + end + local.get $0 + call $~lib/rt/stub/__release + ) + (func $possibly-null/testEqNullContinuation (; 7 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $0 + i32.const 0 + i32.eq + if + local.get $0 + call $~lib/rt/stub/__release + return + end + local.get $0 + call $~lib/rt/stub/__release + ) + (func $possibly-null/testNotEqNull (; 8 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $0 + i32.const 0 + i32.eq + i32.eqz + if + nop + end + local.get $0 + call $~lib/rt/stub/__release + ) + (func $possibly-null/testNotNeNullElse (; 9 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $0 + i32.const 0 + i32.ne + i32.eqz + if + local.get $0 + call $~lib/rt/stub/__release + return + else + nop + end + local.get $0 + call $~lib/rt/stub/__release + ) + (func $possibly-null/testNotNeNullContinuation (; 10 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $0 + i32.const 0 + i32.ne + i32.eqz + if + local.get $0 + call $~lib/rt/stub/__release + return + end + local.get $0 + call $~lib/rt/stub/__release + ) + (func $possibly-null/testWhile (; 11 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + block $break|0 + loop $continue|0 + local.get $0 + if + block (result i32) + i32.const 0 + local.tee $1 + local.get $0 + local.tee $2 + i32.ne + if + local.get $1 + call $~lib/rt/stub/__retain + drop + local.get $2 + call $~lib/rt/stub/__release + end + local.get $1 + end + local.set $0 + br $continue|0 + end + end + end + local.get $0 + call $~lib/rt/stub/__release + ) + (func $possibly-null/testWhile2 (; 12 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $1 + call $~lib/rt/stub/__retain + drop + block $break|0 + loop $continue|0 + local.get $0 + if + block (result i32) + local.get $1 + local.tee $2 + local.get $0 + local.tee $3 + i32.ne + if + local.get $2 + call $~lib/rt/stub/__retain + drop + local.get $3 + call $~lib/rt/stub/__release + end + local.get $2 + end + local.set $0 + br $continue|0 + end + end + end + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + ) + (func $possibly-null/testWhile3 (; 13 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $1 + call $~lib/rt/stub/__retain + drop + block $break|0 + loop $continue|0 + local.get $0 + if + local.get $1 + if + block (result i32) + local.get $1 + local.tee $2 + local.get $0 + local.tee $3 + i32.ne + if + local.get $2 + call $~lib/rt/stub/__retain + drop + local.get $3 + call $~lib/rt/stub/__release + end + local.get $2 + end + local.set $0 + end + br $continue|0 + end + end + end + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + ) + (func $possibly-null/requireNonNull (; 14 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $0 + ) + (func $possibly-null/testLogicalAnd (; 15 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $0 + if (result i32) + local.get $0 + call $possibly-null/requireNonNull + local.tee $1 + local.set $2 + local.get $1 + call $~lib/rt/stub/__release + local.get $2 + else + i32.const 0 + end + drop + local.get $0 + call $~lib/rt/stub/__release + ) + (func $possibly-null/testLogicalOr (; 16 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $0 + i32.eqz + if (result i32) + i32.const 1 + else + local.get $0 + call $possibly-null/requireNonNull + local.tee $1 + i32.const 0 + i32.ne + local.set $2 + local.get $1 + call $~lib/rt/stub/__release + local.get $2 + end + drop + local.get $0 + call $~lib/rt/stub/__release + ) + (func $possibly-null/testLogicalAndMulti (; 17 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $1 + call $~lib/rt/stub/__retain + drop + local.get $0 + if (result i32) + local.get $1 + else + i32.const 0 + end + if + nop + else + nop + end + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + ) + (func $possibly-null/testLogicalOrMulti (; 18 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $1 + call $~lib/rt/stub/__retain + drop + local.get $0 + i32.eqz + if (result i32) + i32.const 1 + else + local.get $1 + i32.eqz + end + if + nop + else + nop + end + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + ) + (func $possibly-null/testAssign (; 19 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $1 + call $~lib/rt/stub/__retain + drop + block (result i32) + local.get $1 + local.tee $2 + local.get $0 + local.tee $3 + i32.ne + if + local.get $2 + call $~lib/rt/stub/__retain + drop + local.get $3 + call $~lib/rt/stub/__release + end + local.get $2 + end + local.set $0 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + ) + (func $possibly-null/testNeverNull (; 20 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $0 + if + local.get $0 + drop + end + local.get $0 + call $~lib/rt/stub/__release + ) + (func $null (; 21 ;) (type $FUNCSIG$v) + ) +) diff --git a/tests/compiler/rc/global-init.json b/tests/compiler/rc/global-init.json new file mode 100644 index 0000000000..9f7878d475 --- /dev/null +++ b/tests/compiler/rc/global-init.json @@ -0,0 +1,6 @@ +{ + "asc_flags": [ + "--runtime half", + "--use ASC_RTRACE=1" + ] +} \ No newline at end of file diff --git a/tests/compiler/rc/global-init.optimized.wat b/tests/compiler/rc/global-init.optimized.wat new file mode 100644 index 0000000000..35711e9afc --- /dev/null +++ b/tests/compiler/rc/global-init.optimized.wat @@ -0,0 +1,1773 @@ +(module + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "onincrement" (func $~lib/rt/rtrace/onincrement (param i32))) + (import "rtrace" "ondecrement" (func $~lib/rt/rtrace/ondecrement (param i32))) + (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) + (import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32))) + (memory $0 1) + (data (i32.const 12) "\01\00\00\00\01") + (data (i32.const 24) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s") + (data (i32.const 72) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s") + (data (i32.const 120) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e") + (data (i32.const 176) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s") + (data (i32.const 216) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e") + (data (i32.const 272) "\03\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10") + (global $rc/global-init/a (mut i32) (i32.const 0)) + (global $rc/global-init/b (mut i32) (i32.const 0)) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) + (export "memory" (memory $0)) + (start $start) + (func $~lib/rt/pure/increment (; 5 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const -268435456 + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne + if + i32.const 0 + i32.const 40 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/rtrace/onincrement + local.get $0 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 40 + i32.const 107 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/pure/__retain (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 300 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment + end + local.get $0 + ) + (func $~lib/rt/tlsf/removeBlock (; 7 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.tee $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 276 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const -4 + i32.and + local.tee $2 + i32.const 16 + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 278 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 256 + i32.lt_u + if (result i32) + local.get $2 + i32.const 4 + i32.shr_u + local.set $2 + i32.const 0 + else + local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $3 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $2 + local.get $3 + i32.const 7 + i32.sub + end + local.tee $3 + i32.const 23 + i32.lt_u + if (result i32) + local.get $2 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 291 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=20 + local.set $4 + local.get $1 + i32.load offset=16 + local.tee $5 + if + local.get $5 + local.get $4 + i32.store offset=20 + end + local.get $4 + if + local.get $4 + local.get $5 + i32.store offset=16 + end + local.get $3 + i32.const 4 + i32.shl + local.get $2 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + local.get $1 + i32.eq + if + local.get $3 + i32.const 4 + i32.shl + local.get $2 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $4 + i32.store offset=96 + local.get $4 + i32.eqz + if + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const 1 + local.get $2 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.store offset=4 + local.get $1 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $3 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 8 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 204 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.tee $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 206 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.tee $5 + i32.const 1 + i32.and + if + local.get $3 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const -4 + i32.and + i32.add + local.tee $2 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $3 + i32.const 3 + i32.and + local.get $2 + i32.or + local.tee $3 + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.set $5 + end + end + local.get $3 + i32.const 2 + i32.and + if + local.get $1 + i32.const 4 + i32.sub + i32.load + local.tee $2 + i32.load + local.tee $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 227 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $3 + i32.const -4 + i32.and + i32.add + local.tee $7 + i32.const 1073741808 + i32.lt_u + if (result i32) + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $2 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $3 + i32.store + local.get $2 + else + local.get $1 + end + local.set $1 + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $3 + i32.const -4 + i32.and + local.tee $2 + i32.const 16 + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + i32.ne + if + i32.const 0 + i32.const 88 + i32.const 243 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $2 + i32.const 256 + i32.lt_u + if (result i32) + local.get $2 + i32.const 4 + i32.shr_u + local.set $4 + i32.const 0 + else + local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $4 + local.get $2 + i32.const 7 + i32.sub + end + local.tee $3 + i32.const 23 + i32.lt_u + if (result i32) + local.get $4 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 259 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + local.set $2 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $2 + i32.store offset=20 + local.get $2 + if + local.get $2 + local.get $1 + i32.store offset=16 + end + local.get $3 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $1 + i32.store offset=96 + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $3 + i32.shl + i32.or + i32.store + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const 1 + local.get $4 + i32.shl + i32.or + i32.store offset=4 + ) + (func $~lib/rt/tlsf/freeBlock (; 9 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.tee $2 + i32.const 1 + i32.and + if + i32.const 0 + i32.const 88 + i32.const 531 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/rtrace/onfree + ) + (func $~lib/rt/__typeinfo (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 272 + i32.load + i32.gt_u + if + i32.const 136 + i32.const 192 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 3 + i32.shl + i32.const 276 + i32.add + i32.load + ) + (func $~lib/rt/tlsf/addMemory (; 11 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $1 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $1 + local.get $2 + i32.le_u + select + select + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 385 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=1568 + local.tee $3 + if + local.get $1 + local.get $3 + i32.const 16 + i32.add + i32.lt_u + if + i32.const 0 + i32.const 88 + i32.const 395 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $3 + i32.eq + if + local.get $3 + i32.load + local.set $4 + local.get $1 + i32.const 16 + i32.sub + local.set $1 + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.lt_u + if + i32.const 0 + i32.const 88 + i32.const 407 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.tee $2 + i32.const 48 + i32.lt_u + if + return + end + local.get $1 + local.get $4 + i32.const 2 + i32.and + local.get $2 + i32.const 32 + i32.sub + i32.const 1 + i32.or + i32.or + i32.store + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $2 + i32.add + i32.const 16 + i32.sub + local.tee $2 + i32.const 2 + i32.store + local.get $0 + local.get $2 + i32.store offset=1568 + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/tlsf/initializeRoot (; 12 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 1 + memory.size + local.tee $0 + i32.gt_s + if (result i32) + i32.const 1 + local.get $0 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + i32.const 304 + i32.const 0 + i32.store + i32.const 1872 + i32.const 0 + i32.store + i32.const 0 + local.set $0 + loop $repeat|0 + block $break|0 + local.get $0 + i32.const 23 + i32.ge_u + br_if $break|0 + local.get $0 + i32.const 2 + i32.shl + i32.const 304 + i32.add + i32.const 0 + i32.store offset=4 + i32.const 0 + local.set $1 + loop $repeat|1 + block $break|1 + local.get $1 + i32.const 16 + i32.ge_u + br_if $break|1 + local.get $0 + i32.const 4 + i32.shl + local.get $1 + i32.add + i32.const 2 + i32.shl + i32.const 304 + i32.add + i32.const 0 + i32.store offset=96 + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|1 + end + end + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + end + i32.const 304 + i32.const 1888 + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + i32.const 304 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 232 + i32.const 88 + i32.const 447 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const -16 + i32.and + local.tee $0 + i32.const 16 + local.get $0 + i32.const 16 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + i32.const 256 + i32.lt_u + if (result i32) + local.get $1 + i32.const 4 + i32.shr_u + local.set $1 + i32.const 0 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + local.get $1 + i32.add + i32.const 1 + i32.sub + local.set $1 + end + local.get $1 + i32.const 31 + local.get $1 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $1 + local.get $2 + i32.const 7 + i32.sub + end + local.tee $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $1 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 337 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const -1 + local.get $1 + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $1 + i32.ctz + local.get $2 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + else + local.get $0 + i32.load + i32.const -1 + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $1 + i32.ctz + local.tee $1 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 350 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.ctz + local.get $1 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + else + i32.const 0 + end + end + ) + (func $~lib/rt/tlsf/growMemory (; 15 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + memory.size + local.tee $2 + local.get $1 + i32.const 65535 + i32.add + i32.const -65536 + i32.and + i32.const 16 + i32.shr_u + local.tee $1 + local.get $2 + local.get $1 + i32.gt_s + select + memory.grow + i32.const 0 + i32.lt_s + if + local.get $1 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + local.get $0 + local.get $2 + i32.const 16 + i32.shl + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + ) + (func $~lib/rt/tlsf/prepareBlock (; 16 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + if + i32.const 0 + i32.const 88 + i32.const 364 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const -4 + i32.and + local.get $2 + i32.sub + local.tee $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $3 + i32.const 2 + i32.and + local.get $2 + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.tee $1 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const -2 + i32.and + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + i32.load + i32.const -3 + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 17 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.tee $3 + call $~lib/rt/tlsf/searchBlock + local.tee $2 + i32.eqz + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $3 + call $~lib/rt/tlsf/searchBlock + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 477 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + i32.load + i32.const -4 + i32.and + local.get $3 + i32.lt_u + if + i32.const 0 + i32.const 88 + i32.const 479 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 0 + i32.store offset=4 + local.get $2 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $2 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $2 + call $~lib/rt/rtrace/onalloc + local.get $2 + ) + (func $~lib/rt/tlsf/__alloc (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/rt/tlsf/ROOT + local.tee $1 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $1 + end + local.get $1 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.tee $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 16 + i32.add + ) + (func $~lib/memory/memory.copy (; 19 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $2 + local.set $3 + local.get $0 + local.get $1 + i32.eq + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $1 + i32.lt_u + if + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|0 + local.get $0 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + br $continue|0 + end + end + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $1 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + br $continue|1 + end + end + end + loop $continue|2 + local.get $3 + if + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + else + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|3 + local.get $0 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $3 + i32.const 8 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + loop $continue|5 + local.get $3 + if + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + ) + (func $~lib/rt/tlsf/__free (; 20 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 561 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $0 + select + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 562 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/growRoots (; 21 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/pure/CUR + global.get $~lib/rt/pure/ROOTS + local.tee $1 + i32.sub + local.tee $2 + i32.const 1 + i32.shl + local.tee $0 + i32.const 256 + local.get $0 + i32.const 256 + i32.gt_u + select + local.tee $3 + call $~lib/rt/tlsf/__alloc + local.tee $0 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onfree + local.get $0 + local.get $1 + local.get $2 + call $~lib/memory/memory.copy + local.get $1 + if + local.get $1 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onalloc + local.get $1 + call $~lib/rt/tlsf/__free + end + local.get $0 + global.set $~lib/rt/pure/ROOTS + local.get $0 + local.get $2 + i32.add + global.set $~lib/rt/pure/CUR + local.get $0 + local.get $3 + i32.add + global.set $~lib/rt/pure/END + ) + (func $~lib/rt/pure/appendRoot (; 22 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/pure/CUR + local.tee $1 + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 4 + i32.add + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/decrement (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.tee $2 + i32.const 268435455 + i32.and + local.set $1 + local.get $0 + call $~lib/rt/rtrace/ondecrement + local.get $0 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 40 + i32.const 115 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/rt/__visit_members + local.get $2 + i32.const -2147483648 + i32.and + if + local.get $0 + i32.const -2147483648 + i32.store offset=4 + else + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + else + local.get $1 + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 40 + i32.const 124 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 16 + i32.and + if + local.get $0 + local.get $1 + i32.const 1 + i32.sub + local.get $2 + i32.const -268435456 + i32.and + i32.or + i32.store offset=4 + else + local.get $0 + local.get $1 + i32.const 1 + i32.sub + i32.const -1342177280 + i32.or + i32.store offset=4 + local.get $2 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/appendRoot + end + end + end + ) + (func $~lib/rt/pure/__release (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + i32.const 300 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + end + ) + (func $start:rc/global-init (; 25 ;) (type $FUNCSIG$v) + (local $0 i32) + i32.const 24 + call $~lib/rt/pure/__retain + global.set $rc/global-init/a + i32.const 24 + call $~lib/rt/pure/__retain + global.set $rc/global-init/b + global.get $rc/global-init/a + local.tee $0 + if + i32.const 0 + call $~lib/rt/pure/__retain + drop + local.get $0 + call $~lib/rt/pure/__release + end + i32.const 0 + global.set $rc/global-init/a + global.get $rc/global-init/b + local.tee $0 + if + i32.const 0 + call $~lib/rt/pure/__retain + drop + local.get $0 + call $~lib/rt/pure/__release + end + i32.const 0 + global.set $rc/global-init/b + ) + (func $start (; 26 ;) (type $FUNCSIG$v) + call $start:rc/global-init + ) + (func $~lib/rt/pure/markGray (; 27 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members + end + ) + (func $~lib/rt/pure/scanBlack (; 28 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 29 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (; 30 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + ) + (func $~lib/rt/pure/__visit (; 31 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + local.get $0 + i32.const 300 + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $0 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + local.get $1 + i32.const 1 + i32.ne + if + local.get $1 + i32.const 2 + i32.eq + br_if $case1|0 + block $tablify|0 + local.get $1 + i32.const 3 + i32.sub + br_table $case2|0 $case3|0 $case4|0 $tablify|0 + end + br $case5|0 + end + local.get $0 + call $~lib/rt/pure/decrement + br $break|0 + end + local.get $0 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 40 + i32.const 75 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $0 + call $~lib/rt/pure/markGray + br $break|0 + end + local.get $0 + call $~lib/rt/pure/scan + br $break|0 + end + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const -268435456 + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne + if + i32.const 0 + i32.const 40 + i32.const 86 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $1 + i32.const 1879048192 + i32.and + if + local.get $0 + call $~lib/rt/pure/scanBlack + end + br $break|0 + end + local.get $0 + call $~lib/rt/pure/collectWhite + br $break|0 + end + i32.const 0 + i32.const 40 + i32.const 97 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/__visit_members (; 32 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + block $switch$1$default + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$default + end + return + end + local.get $0 + i32.load + local.tee $0 + if + local.get $0 + local.get $1 + call $~lib/rt/pure/__visit + end + return + end + unreachable + ) + (func $null (; 33 ;) (type $FUNCSIG$v) + nop + ) +) diff --git a/tests/compiler/rc/global-init.ts b/tests/compiler/rc/global-init.ts new file mode 100644 index 0000000000..54d5402294 --- /dev/null +++ b/tests/compiler/rc/global-init.ts @@ -0,0 +1,14 @@ +function getRef(): string { + return ""; +} + +// Assignment of a return value picks up its delayed release state and skips +// one set of retain/release. + +var a: string = getRef(); +var b = getRef(); // same, but inferred + +// Unleak + +a = /* __retainRelease( */ changetype(0) /* , a) */; +b = /* __retainRelease( */ changetype(0) /* , a) */; diff --git a/tests/compiler/rc/global-init.untouched.wat b/tests/compiler/rc/global-init.untouched.wat new file mode 100644 index 0000000000..ee4ba17c3c --- /dev/null +++ b/tests/compiler/rc/global-init.untouched.wat @@ -0,0 +1,3526 @@ +(module + (type $FUNCSIG$i (func (result i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "onincrement" (func $~lib/rt/rtrace/onincrement (param i32))) + (import "rtrace" "ondecrement" (func $~lib/rt/rtrace/ondecrement (param i32))) + (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) + (import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32))) + (memory $0 1) + (data (i32.const 8) "\00\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00") + (data (i32.const 24) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s\00") + (data (i32.const 72) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 120) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 176) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s\00") + (data (i32.const 216) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 272) "\03\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $rc/global-init/a (mut i32) (i32.const 0)) + (global $rc/global-init/b (mut i32) (i32.const 0)) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) + (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/rt/__rtti_base i32 (i32.const 272)) + (global $~lib/heap/__heap_base i32 (i32.const 300)) + (export "memory" (memory $0)) + (start $start) + (func $~lib/rt/pure/increment (; 5 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/rtrace/onincrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 107 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/pure/__retain (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment + end + local.get $0 + ) + (func $rc/global-init/getRef (; 7 ;) (type $FUNCSIG$i) (result i32) + i32.const 24 + call $~lib/rt/pure/__retain + ) + (func $~lib/rt/tlsf/removeBlock (; 8 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 276 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $3 + local.get $3 + i32.const 16 + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 278 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 + local.get $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) + local.get $5 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 291 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end + local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $9 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $0 + local.set $8 + local.get $4 + local.set $11 + local.get $9 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $9 + local.set $10 + local.get $8 + local.get $11 + i32.const 2 + i32.shl + i32.add + local.get $10 + i32.store offset=4 + end + local.get $9 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 9 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 204 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 206 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 + i32.const 1 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end + local.get $2 + i32.const 2 + i32.and + if + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 4 + i32.sub + i32.load + end + local.set $6 + local.get $6 + i32.load + local.set $3 + local.get $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 227 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $6 + call $~lib/rt/tlsf/removeBlock + local.get $6 + local.get $3 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $6 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $8 + i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 243 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $8 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 259 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $7 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $7 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $12 + local.get $9 + local.set $7 + local.get $10 + local.set $3 + local.get $1 + local.set $6 + local.get $12 + local.get $7 + i32.const 4 + i32.shl + local.get $3 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + end + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $13 + local.get $9 + local.set $12 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + end + ) + (func $~lib/rt/tlsf/freeBlock (; 10 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 531 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/rtrace/onfree + ) + (func $~lib/rt/__typeinfo (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/rt/__rtti_base + local.set $1 + local.get $0 + local.get $1 + i32.load + i32.gt_u + if + i32.const 136 + i32.const 192 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 4 + i32.add + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/rt/tlsf/addMemory (; 12 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + local.get $2 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 385 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 395 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 407 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 13 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + memory.size + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end + block $break|0 + i32.const 0 + local.set $5 + loop $repeat|0 + local.get $5 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $3 + local.set $7 + local.get $5 + local.set $6 + i32.const 0 + local.set $4 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $7 + loop $repeat|1 + local.get $7 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $3 + local.set $9 + local.get $5 + local.set $8 + local.get $7 + local.set $6 + i32.const 0 + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store offset=96 + end + local.get $7 + i32.const 1 + i32.add + local.set $7 + br $repeat|1 + unreachable + end + unreachable + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 14 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 232 + i32.const 88 + i32.const 447 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 15 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 337 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + i32.const 0 + local.set $7 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $5 + local.get $5 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $5 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $4 + local.get $8 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 350 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 16 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + memory.size + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + memory.grow + i32.const 0 + i32.lt_s + if + local.get $3 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + memory.size + local.set $7 + local.get $0 + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (; 17 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 364 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 18 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 477 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 479 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + call $~lib/rt/rtrace/onalloc + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 19 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/util/memory/memcpy (; 20 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + block $break|0 + loop $continue|0 + local.get $2 + if (result i32) + local.get $1 + i32.const 3 + i32.and + else + i32.const 0 + end + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $continue|0 + end + end + end + local.get $0 + i32.const 3 + i32.and + i32.const 0 + i32.eq + if + block $break|1 + loop $continue|1 + local.get $2 + i32.const 16 + i32.ge_u + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 8 + i32.add + i32.load + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 12 + i32.add + i32.load + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|1 + end + end + end + local.get $2 + i32.const 8 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + end + local.get $2 + i32.const 4 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.set $0 + local.get $1 + i32.const 4 + i32.add + local.set $1 + end + local.get $2 + i32.const 2 + i32.and + if + local.get $0 + local.get $1 + i32.load16_u + i32.store16 + local.get $0 + i32.const 2 + i32.add + local.set $0 + local.get $1 + i32.const 2 + i32.add + local.set $1 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + return + end + local.get $2 + i32.const 32 + i32.ge_u + if + block $break|2 + block $case2|2 + block $case1|2 + block $case0|2 + local.get $0 + i32.const 3 + i32.and + local.set $5 + local.get $5 + i32.const 1 + i32.eq + br_if $case0|2 + local.get $5 + i32.const 2 + i32.eq + br_if $case1|2 + local.get $5 + i32.const 3 + i32.eq + br_if $case2|2 + br $break|2 + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 3 + i32.sub + local.set $2 + block $break|3 + loop $continue|3 + local.get $2 + i32.const 17 + i32.ge_u + if + local.get $1 + i32.const 1 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 5 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 9 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 13 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|3 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + block $break|4 + loop $continue|4 + local.get $2 + i32.const 18 + i32.ge_u + if + local.get $1 + i32.const 2 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 6 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 10 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 14 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|4 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + block $break|5 + loop $continue|5 + local.get $2 + i32.const 19 + i32.ge_u + if + local.get $1 + i32.const 3 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 7 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 11 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 15 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|5 + end + end + end + br $break|2 + unreachable + end + unreachable + end + end + local.get $2 + i32.const 16 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 8 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 4 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 2 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + ) + (func $~lib/memory/memory.copy (; 21 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $4 + local.get $3 + i32.add + local.get $5 + i32.le_u + if (result i32) + i32.const 1 + else + local.get $5 + local.get $3 + i32.add + local.get $4 + i32.le_u + end + if + local.get $5 + local.get $4 + local.get $3 + call $~lib/util/memory/memcpy + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/rt/tlsf/__free (; 22 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 561 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 562 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/growRoots (; 23 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/pure/ROOTS + local.set $0 + global.get $~lib/rt/pure/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onfree + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $0 + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onalloc + local.get $0 + call $~lib/rt/tlsf/__free + end + local.get $5 + global.set $~lib/rt/pure/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/pure/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/pure/END + ) + (func $~lib/rt/pure/appendRoot (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/pure/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 4 + i32.add + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/decrement (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + call $~lib/rt/rtrace/ondecrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 115 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/rt/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 124 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 16 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/pure/__release (; 26 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + end + ) + (func $start:rc/global-init (; 27 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + call $rc/global-init/getRef + global.set $rc/global-init/a + call $rc/global-init/getRef + global.set $rc/global-init/b + block (result i32) + i32.const 0 + local.tee $0 + global.get $rc/global-init/a + local.tee $1 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 + end + global.set $rc/global-init/a + block (result i32) + i32.const 0 + local.tee $1 + global.get $rc/global-init/b + local.tee $0 + i32.ne + if + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + call $~lib/rt/pure/__release + end + local.get $1 + end + global.set $rc/global-init/b + ) + (func $start (; 28 ;) (type $FUNCSIG$v) + call $start:rc/global-init + ) + (func $~lib/rt/pure/markGray (; 29 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members + end + ) + (func $~lib/rt/pure/scanBlack (; 30 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 31 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (; 32 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + ) + (func $~lib/rt/pure/__visit (; 33 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/pure/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 75 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/pure/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 86 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/pure/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 97 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + end + ) + (func $~lib/rt/__visit_members (; 34 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block + end + block $switch$1$leave + block $switch$1$default + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$default + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + ) + (func $null (; 35 ;) (type $FUNCSIG$v) + ) +) diff --git a/tests/compiler/rc/local-init.json b/tests/compiler/rc/local-init.json new file mode 100644 index 0000000000..9f7878d475 --- /dev/null +++ b/tests/compiler/rc/local-init.json @@ -0,0 +1,6 @@ +{ + "asc_flags": [ + "--runtime half", + "--use ASC_RTRACE=1" + ] +} \ No newline at end of file diff --git a/tests/compiler/rc/local-init.optimized.wat b/tests/compiler/rc/local-init.optimized.wat new file mode 100644 index 0000000000..3d3415810d --- /dev/null +++ b/tests/compiler/rc/local-init.optimized.wat @@ -0,0 +1,1750 @@ +(module + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "onincrement" (func $~lib/rt/rtrace/onincrement (param i32))) + (import "rtrace" "ondecrement" (func $~lib/rt/rtrace/ondecrement (param i32))) + (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) + (import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32))) + (memory $0 1) + (data (i32.const 12) "\01\00\00\00\01") + (data (i32.const 24) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s") + (data (i32.const 72) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s") + (data (i32.const 120) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e") + (data (i32.const 176) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s") + (data (i32.const 216) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e") + (data (i32.const 272) "\04\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10") + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) + (export "memory" (memory $0)) + (start $start) + (func $~lib/rt/pure/increment (; 5 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const -268435456 + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne + if + i32.const 0 + i32.const 40 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/rtrace/onincrement + local.get $0 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 40 + i32.const 107 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/pure/__retain (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 308 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment + end + local.get $0 + ) + (func $~lib/rt/tlsf/removeBlock (; 7 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.tee $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 276 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const -4 + i32.and + local.tee $2 + i32.const 16 + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 278 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 256 + i32.lt_u + if (result i32) + local.get $2 + i32.const 4 + i32.shr_u + local.set $2 + i32.const 0 + else + local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $3 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $2 + local.get $3 + i32.const 7 + i32.sub + end + local.tee $3 + i32.const 23 + i32.lt_u + if (result i32) + local.get $2 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 291 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=20 + local.set $4 + local.get $1 + i32.load offset=16 + local.tee $5 + if + local.get $5 + local.get $4 + i32.store offset=20 + end + local.get $4 + if + local.get $4 + local.get $5 + i32.store offset=16 + end + local.get $3 + i32.const 4 + i32.shl + local.get $2 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + local.get $1 + i32.eq + if + local.get $3 + i32.const 4 + i32.shl + local.get $2 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $4 + i32.store offset=96 + local.get $4 + i32.eqz + if + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const 1 + local.get $2 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.store offset=4 + local.get $1 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $3 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 8 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 204 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.tee $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 206 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.tee $5 + i32.const 1 + i32.and + if + local.get $3 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const -4 + i32.and + i32.add + local.tee $2 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $3 + i32.const 3 + i32.and + local.get $2 + i32.or + local.tee $3 + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.set $5 + end + end + local.get $3 + i32.const 2 + i32.and + if + local.get $1 + i32.const 4 + i32.sub + i32.load + local.tee $2 + i32.load + local.tee $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 227 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $3 + i32.const -4 + i32.and + i32.add + local.tee $7 + i32.const 1073741808 + i32.lt_u + if (result i32) + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $2 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $3 + i32.store + local.get $2 + else + local.get $1 + end + local.set $1 + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $3 + i32.const -4 + i32.and + local.tee $2 + i32.const 16 + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + i32.ne + if + i32.const 0 + i32.const 88 + i32.const 243 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $2 + i32.const 256 + i32.lt_u + if (result i32) + local.get $2 + i32.const 4 + i32.shr_u + local.set $4 + i32.const 0 + else + local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $4 + local.get $2 + i32.const 7 + i32.sub + end + local.tee $3 + i32.const 23 + i32.lt_u + if (result i32) + local.get $4 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 259 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + local.set $2 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $2 + i32.store offset=20 + local.get $2 + if + local.get $2 + local.get $1 + i32.store offset=16 + end + local.get $3 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $1 + i32.store offset=96 + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $3 + i32.shl + i32.or + i32.store + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const 1 + local.get $4 + i32.shl + i32.or + i32.store offset=4 + ) + (func $~lib/rt/tlsf/freeBlock (; 9 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.tee $2 + i32.const 1 + i32.and + if + i32.const 0 + i32.const 88 + i32.const 531 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/rtrace/onfree + ) + (func $~lib/rt/__typeinfo (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 272 + i32.load + i32.gt_u + if + i32.const 136 + i32.const 192 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 3 + i32.shl + i32.const 276 + i32.add + i32.load + ) + (func $~lib/rt/tlsf/addMemory (; 11 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $1 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $1 + local.get $2 + i32.le_u + select + select + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 385 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=1568 + local.tee $3 + if + local.get $1 + local.get $3 + i32.const 16 + i32.add + i32.lt_u + if + i32.const 0 + i32.const 88 + i32.const 395 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $3 + i32.eq + if + local.get $3 + i32.load + local.set $4 + local.get $1 + i32.const 16 + i32.sub + local.set $1 + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.lt_u + if + i32.const 0 + i32.const 88 + i32.const 407 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.tee $2 + i32.const 48 + i32.lt_u + if + return + end + local.get $1 + local.get $4 + i32.const 2 + i32.and + local.get $2 + i32.const 32 + i32.sub + i32.const 1 + i32.or + i32.or + i32.store + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $2 + i32.add + i32.const 16 + i32.sub + local.tee $2 + i32.const 2 + i32.store + local.get $0 + local.get $2 + i32.store offset=1568 + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/tlsf/initializeRoot (; 12 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 1 + memory.size + local.tee $0 + i32.gt_s + if (result i32) + i32.const 1 + local.get $0 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + i32.const 320 + i32.const 0 + i32.store + i32.const 1888 + i32.const 0 + i32.store + i32.const 0 + local.set $0 + loop $repeat|0 + block $break|0 + local.get $0 + i32.const 23 + i32.ge_u + br_if $break|0 + local.get $0 + i32.const 2 + i32.shl + i32.const 320 + i32.add + i32.const 0 + i32.store offset=4 + i32.const 0 + local.set $1 + loop $repeat|1 + block $break|1 + local.get $1 + i32.const 16 + i32.ge_u + br_if $break|1 + local.get $0 + i32.const 4 + i32.shl + local.get $1 + i32.add + i32.const 2 + i32.shl + i32.const 320 + i32.add + i32.const 0 + i32.store offset=96 + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|1 + end + end + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + end + i32.const 320 + i32.const 1904 + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + i32.const 320 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 232 + i32.const 88 + i32.const 447 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const -16 + i32.and + local.tee $0 + i32.const 16 + local.get $0 + i32.const 16 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + i32.const 256 + i32.lt_u + if (result i32) + local.get $1 + i32.const 4 + i32.shr_u + local.set $1 + i32.const 0 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + local.get $1 + i32.add + i32.const 1 + i32.sub + local.set $1 + end + local.get $1 + i32.const 31 + local.get $1 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $1 + local.get $2 + i32.const 7 + i32.sub + end + local.tee $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $1 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 337 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const -1 + local.get $1 + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $1 + i32.ctz + local.get $2 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + else + local.get $0 + i32.load + i32.const -1 + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $1 + i32.ctz + local.tee $1 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 350 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.ctz + local.get $1 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + else + i32.const 0 + end + end + ) + (func $~lib/rt/tlsf/growMemory (; 15 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + memory.size + local.tee $2 + local.get $1 + i32.const 65535 + i32.add + i32.const -65536 + i32.and + i32.const 16 + i32.shr_u + local.tee $1 + local.get $2 + local.get $1 + i32.gt_s + select + memory.grow + i32.const 0 + i32.lt_s + if + local.get $1 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + local.get $0 + local.get $2 + i32.const 16 + i32.shl + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + ) + (func $~lib/rt/tlsf/prepareBlock (; 16 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + if + i32.const 0 + i32.const 88 + i32.const 364 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const -4 + i32.and + local.get $2 + i32.sub + local.tee $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $3 + i32.const 2 + i32.and + local.get $2 + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.tee $1 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const -2 + i32.and + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + i32.load + i32.const -3 + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 17 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.tee $3 + call $~lib/rt/tlsf/searchBlock + local.tee $2 + i32.eqz + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $3 + call $~lib/rt/tlsf/searchBlock + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 477 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + i32.load + i32.const -4 + i32.and + local.get $3 + i32.lt_u + if + i32.const 0 + i32.const 88 + i32.const 479 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 0 + i32.store offset=4 + local.get $2 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $2 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $2 + call $~lib/rt/rtrace/onalloc + local.get $2 + ) + (func $~lib/rt/tlsf/__alloc (; 18 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + global.get $~lib/rt/tlsf/ROOT + local.tee $2 + if (result i32) + local.get $2 + else + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + end + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.tee $0 + local.get $1 + i32.store offset=8 + local.get $0 + i32.const 16 + i32.add + ) + (func $~lib/memory/memory.copy (; 19 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $2 + local.set $3 + local.get $0 + local.get $1 + i32.eq + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $1 + i32.lt_u + if + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|0 + local.get $0 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + br $continue|0 + end + end + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $1 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + br $continue|1 + end + end + end + loop $continue|2 + local.get $3 + if + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + else + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|3 + local.get $0 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $3 + i32.const 8 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + loop $continue|5 + local.get $3 + if + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + ) + (func $~lib/rt/tlsf/__free (; 20 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 561 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $0 + select + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 562 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/growRoots (; 21 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/pure/CUR + global.get $~lib/rt/pure/ROOTS + local.tee $1 + i32.sub + local.tee $2 + i32.const 1 + i32.shl + local.tee $0 + i32.const 256 + local.get $0 + i32.const 256 + i32.gt_u + select + local.tee $3 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.tee $0 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onfree + local.get $0 + local.get $1 + local.get $2 + call $~lib/memory/memory.copy + local.get $1 + if + local.get $1 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onalloc + local.get $1 + call $~lib/rt/tlsf/__free + end + local.get $0 + global.set $~lib/rt/pure/ROOTS + local.get $0 + local.get $2 + i32.add + global.set $~lib/rt/pure/CUR + local.get $0 + local.get $3 + i32.add + global.set $~lib/rt/pure/END + ) + (func $~lib/rt/pure/appendRoot (; 22 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/pure/CUR + local.tee $1 + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 4 + i32.add + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/decrement (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.tee $2 + i32.const 268435455 + i32.and + local.set $1 + local.get $0 + call $~lib/rt/rtrace/ondecrement + local.get $0 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 40 + i32.const 115 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/rt/__visit_members + local.get $2 + i32.const -2147483648 + i32.and + if + local.get $0 + i32.const -2147483648 + i32.store offset=4 + else + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + else + local.get $1 + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 40 + i32.const 124 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 16 + i32.and + if + local.get $0 + local.get $1 + i32.const 1 + i32.sub + local.get $2 + i32.const -268435456 + i32.and + i32.or + i32.store offset=4 + else + local.get $0 + local.get $1 + i32.const 1 + i32.sub + i32.const -1342177280 + i32.or + i32.store offset=4 + local.get $2 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/appendRoot + end + end + end + ) + (func $~lib/rt/pure/__release (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + i32.const 308 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + end + ) + (func $start (; 25 ;) (type $FUNCSIG$v) + i32.const 24 + call $~lib/rt/pure/__retain + call $~lib/rt/pure/__release + i32.const 24 + call $~lib/rt/pure/__retain + call $~lib/rt/pure/__release + i32.const 0 + i32.const 3 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + call $~lib/rt/pure/__release + ) + (func $~lib/rt/pure/markGray (; 26 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members + end + ) + (func $~lib/rt/pure/scanBlack (; 27 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 28 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (; 29 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + ) + (func $~lib/rt/pure/__visit (; 30 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + local.get $0 + i32.const 308 + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $0 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + local.get $1 + i32.const 1 + i32.ne + if + local.get $1 + i32.const 2 + i32.eq + br_if $case1|0 + block $tablify|0 + local.get $1 + i32.const 3 + i32.sub + br_table $case2|0 $case3|0 $case4|0 $tablify|0 + end + br $case5|0 + end + local.get $0 + call $~lib/rt/pure/decrement + br $break|0 + end + local.get $0 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 40 + i32.const 75 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $0 + call $~lib/rt/pure/markGray + br $break|0 + end + local.get $0 + call $~lib/rt/pure/scan + br $break|0 + end + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const -268435456 + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne + if + i32.const 0 + i32.const 40 + i32.const 86 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $1 + i32.const 1879048192 + i32.and + if + local.get $0 + call $~lib/rt/pure/scanBlack + end + br $break|0 + end + local.get $0 + call $~lib/rt/pure/collectWhite + br $break|0 + end + i32.const 0 + i32.const 40 + i32.const 97 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/__visit_members (; 31 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + block $switch$1$default + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$case$2 $switch$1$default + end + return + end + local.get $0 + i32.load + local.tee $0 + if + local.get $0 + local.get $1 + call $~lib/rt/pure/__visit + end + return + end + unreachable + ) + (func $null (; 32 ;) (type $FUNCSIG$v) + nop + ) +) diff --git a/tests/compiler/rc/local-init.ts b/tests/compiler/rc/local-init.ts new file mode 100644 index 0000000000..d15be6586a --- /dev/null +++ b/tests/compiler/rc/local-init.ts @@ -0,0 +1,26 @@ +{ + // Normal assignment will retain and release. + + let a = /* __retain( */ "" /* ) */; + // __release(a) +} + +function getRef(): string { + return /* __retain( */ "" /* ) */; +} + +{ + // Assignment of a return value picks up its skipped autorelease + + let b = getRef(); + // __release(b); +} + +class Ref {} + +{ + // Assignment of an instantiation picks up its skipped autorelease + + let c = new Ref(); + // __release(c); +} diff --git a/tests/compiler/rc/local-init.untouched.wat b/tests/compiler/rc/local-init.untouched.wat new file mode 100644 index 0000000000..05e49cbe9b --- /dev/null +++ b/tests/compiler/rc/local-init.untouched.wat @@ -0,0 +1,3519 @@ +(module + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$i (func (result i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "onincrement" (func $~lib/rt/rtrace/onincrement (param i32))) + (import "rtrace" "ondecrement" (func $~lib/rt/rtrace/ondecrement (param i32))) + (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) + (import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32))) + (memory $0 1) + (data (i32.const 8) "\00\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00") + (data (i32.const 24) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s\00") + (data (i32.const 72) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 120) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 176) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s\00") + (data (i32.const 216) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 272) "\04\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) + (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/rt/__rtti_base i32 (i32.const 272)) + (global $~lib/heap/__heap_base i32 (i32.const 308)) + (export "memory" (memory $0)) + (start $start) + (func $~lib/rt/pure/increment (; 5 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/rtrace/onincrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 107 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/pure/__retain (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment + end + local.get $0 + ) + (func $~lib/rt/tlsf/removeBlock (; 7 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 276 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $3 + local.get $3 + i32.const 16 + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 278 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 + local.get $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) + local.get $5 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 291 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end + local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $9 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $0 + local.set $8 + local.get $4 + local.set $11 + local.get $9 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $9 + local.set $10 + local.get $8 + local.get $11 + i32.const 2 + i32.shl + i32.add + local.get $10 + i32.store offset=4 + end + local.get $9 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 8 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 204 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 206 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 + i32.const 1 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end + local.get $2 + i32.const 2 + i32.and + if + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 4 + i32.sub + i32.load + end + local.set $6 + local.get $6 + i32.load + local.set $3 + local.get $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 227 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $6 + call $~lib/rt/tlsf/removeBlock + local.get $6 + local.get $3 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $6 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $8 + i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 243 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $8 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 259 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $7 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $7 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $12 + local.get $9 + local.set $7 + local.get $10 + local.set $3 + local.get $1 + local.set $6 + local.get $12 + local.get $7 + i32.const 4 + i32.shl + local.get $3 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + end + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $13 + local.get $9 + local.set $12 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + end + ) + (func $~lib/rt/tlsf/freeBlock (; 9 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 531 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/rtrace/onfree + ) + (func $~lib/rt/__typeinfo (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/rt/__rtti_base + local.set $1 + local.get $0 + local.get $1 + i32.load + i32.gt_u + if + i32.const 136 + i32.const 192 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 4 + i32.add + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/rt/tlsf/addMemory (; 11 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + local.get $2 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 385 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 395 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 407 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 12 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + memory.size + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end + block $break|0 + i32.const 0 + local.set $5 + loop $repeat|0 + local.get $5 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $3 + local.set $7 + local.get $5 + local.set $6 + i32.const 0 + local.set $4 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $7 + loop $repeat|1 + local.get $7 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $3 + local.set $9 + local.get $5 + local.set $8 + local.get $7 + local.set $6 + i32.const 0 + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store offset=96 + end + local.get $7 + i32.const 1 + i32.add + local.set $7 + br $repeat|1 + unreachable + end + unreachable + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 232 + i32.const 88 + i32.const 447 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 337 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + i32.const 0 + local.set $7 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $5 + local.get $5 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $5 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $4 + local.get $8 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 350 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 15 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + memory.size + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + memory.grow + i32.const 0 + i32.lt_s + if + local.get $3 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + memory.size + local.set $7 + local.get $0 + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (; 16 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 364 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 17 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 477 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 479 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + call $~lib/rt/rtrace/onalloc + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 18 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/util/memory/memcpy (; 19 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + block $break|0 + loop $continue|0 + local.get $2 + if (result i32) + local.get $1 + i32.const 3 + i32.and + else + i32.const 0 + end + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $continue|0 + end + end + end + local.get $0 + i32.const 3 + i32.and + i32.const 0 + i32.eq + if + block $break|1 + loop $continue|1 + local.get $2 + i32.const 16 + i32.ge_u + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 8 + i32.add + i32.load + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 12 + i32.add + i32.load + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|1 + end + end + end + local.get $2 + i32.const 8 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + end + local.get $2 + i32.const 4 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.set $0 + local.get $1 + i32.const 4 + i32.add + local.set $1 + end + local.get $2 + i32.const 2 + i32.and + if + local.get $0 + local.get $1 + i32.load16_u + i32.store16 + local.get $0 + i32.const 2 + i32.add + local.set $0 + local.get $1 + i32.const 2 + i32.add + local.set $1 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + return + end + local.get $2 + i32.const 32 + i32.ge_u + if + block $break|2 + block $case2|2 + block $case1|2 + block $case0|2 + local.get $0 + i32.const 3 + i32.and + local.set $5 + local.get $5 + i32.const 1 + i32.eq + br_if $case0|2 + local.get $5 + i32.const 2 + i32.eq + br_if $case1|2 + local.get $5 + i32.const 3 + i32.eq + br_if $case2|2 + br $break|2 + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 3 + i32.sub + local.set $2 + block $break|3 + loop $continue|3 + local.get $2 + i32.const 17 + i32.ge_u + if + local.get $1 + i32.const 1 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 5 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 9 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 13 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|3 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + block $break|4 + loop $continue|4 + local.get $2 + i32.const 18 + i32.ge_u + if + local.get $1 + i32.const 2 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 6 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 10 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 14 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|4 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + block $break|5 + loop $continue|5 + local.get $2 + i32.const 19 + i32.ge_u + if + local.get $1 + i32.const 3 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 7 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 11 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 15 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|5 + end + end + end + br $break|2 + unreachable + end + unreachable + end + end + local.get $2 + i32.const 16 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 8 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 4 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 2 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + ) + (func $~lib/memory/memory.copy (; 20 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $4 + local.get $3 + i32.add + local.get $5 + i32.le_u + if (result i32) + i32.const 1 + else + local.get $5 + local.get $3 + i32.add + local.get $4 + i32.le_u + end + if + local.get $5 + local.get $4 + local.get $3 + call $~lib/util/memory/memcpy + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/rt/tlsf/__free (; 21 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 561 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 88 + i32.const 562 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/growRoots (; 22 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/pure/ROOTS + local.set $0 + global.get $~lib/rt/pure/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onfree + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $0 + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onalloc + local.get $0 + call $~lib/rt/tlsf/__free + end + local.get $5 + global.set $~lib/rt/pure/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/pure/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/pure/END + ) + (func $~lib/rt/pure/appendRoot (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/pure/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 4 + i32.add + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/decrement (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + call $~lib/rt/rtrace/ondecrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 115 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/rt/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 124 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 16 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/pure/__release (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + end + ) + (func $rc/local-init/getRef (; 26 ;) (type $FUNCSIG$i) (result i32) + i32.const 24 + call $~lib/rt/pure/__retain + ) + (func $rc/local-init/Ref#constructor (; 27 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 0 + i32.const 3 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $0 + end + local.get $0 + ) + (func $start:rc/local-init (; 28 ;) (type $FUNCSIG$v) + (local $0 i32) + block + i32.const 24 + call $~lib/rt/pure/__retain + local.set $0 + local.get $0 + call $~lib/rt/pure/__release + end + block + call $rc/local-init/getRef + local.set $0 + local.get $0 + call $~lib/rt/pure/__release + end + block + i32.const 0 + call $rc/local-init/Ref#constructor + local.set $0 + local.get $0 + call $~lib/rt/pure/__release + end + ) + (func $start (; 29 ;) (type $FUNCSIG$v) + call $start:rc/local-init + ) + (func $~lib/rt/pure/markGray (; 30 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members + end + ) + (func $~lib/rt/pure/scanBlack (; 31 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 32 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (; 33 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + ) + (func $~lib/rt/pure/__visit (; 34 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/pure/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 75 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/pure/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 86 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/pure/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 40 + i32.const 97 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + end + ) + (func $~lib/rt/__visit_members (; 35 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block + end + block $switch$1$leave + block $switch$1$default + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$case$2 $switch$1$default + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + ) + (func $null (; 36 ;) (type $FUNCSIG$v) + ) +) diff --git a/tests/compiler/rc/logical-and-mismatch.json b/tests/compiler/rc/logical-and-mismatch.json new file mode 100644 index 0000000000..9f7878d475 --- /dev/null +++ b/tests/compiler/rc/logical-and-mismatch.json @@ -0,0 +1,6 @@ +{ + "asc_flags": [ + "--runtime half", + "--use ASC_RTRACE=1" + ] +} \ No newline at end of file diff --git a/tests/compiler/rc/logical-and-mismatch.optimized.wat b/tests/compiler/rc/logical-and-mismatch.optimized.wat new file mode 100644 index 0000000000..9398dada43 --- /dev/null +++ b/tests/compiler/rc/logical-and-mismatch.optimized.wat @@ -0,0 +1,1793 @@ +(module + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$i (func (result i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32))) + (import "rtrace" "onincrement" (func $~lib/rt/rtrace/onincrement (param i32))) + (import "rtrace" "ondecrement" (func $~lib/rt/rtrace/ondecrement (param i32))) + (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) + (memory $0 1) + (data (i32.const 8) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s") + (data (i32.const 56) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e") + (data (i32.const 112) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s") + (data (i32.const 160) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e") + (data (i32.const 216) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s") + (data (i32.const 256) "\04\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10") + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $rc/logical-and-mismatch/gloRef (mut i32) (i32.const 0)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) + (export "memory" (memory $0)) + (start $start) + (func $~lib/rt/tlsf/removeBlock (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.tee $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 276 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const -4 + i32.and + local.tee $2 + i32.const 16 + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 278 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 256 + i32.lt_u + if (result i32) + local.get $2 + i32.const 4 + i32.shr_u + local.set $2 + i32.const 0 + else + local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $3 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $2 + local.get $3 + i32.const 7 + i32.sub + end + local.tee $3 + i32.const 23 + i32.lt_u + if (result i32) + local.get $2 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 291 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=20 + local.set $4 + local.get $1 + i32.load offset=16 + local.tee $5 + if + local.get $5 + local.get $4 + i32.store offset=20 + end + local.get $4 + if + local.get $4 + local.get $5 + i32.store offset=16 + end + local.get $3 + i32.const 4 + i32.shl + local.get $2 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + local.get $1 + i32.eq + if + local.get $3 + i32.const 4 + i32.shl + local.get $2 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $4 + i32.store offset=96 + local.get $4 + i32.eqz + if + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const 1 + local.get $2 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.store offset=4 + local.get $1 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $3 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 6 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 204 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.tee $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 206 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.tee $5 + i32.const 1 + i32.and + if + local.get $3 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const -4 + i32.and + i32.add + local.tee $2 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $3 + i32.const 3 + i32.and + local.get $2 + i32.or + local.tee $3 + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.set $5 + end + end + local.get $3 + i32.const 2 + i32.and + if + local.get $1 + i32.const 4 + i32.sub + i32.load + local.tee $2 + i32.load + local.tee $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 227 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $3 + i32.const -4 + i32.and + i32.add + local.tee $7 + i32.const 1073741808 + i32.lt_u + if (result i32) + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $2 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $3 + i32.store + local.get $2 + else + local.get $1 + end + local.set $1 + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $3 + i32.const -4 + i32.and + local.tee $2 + i32.const 16 + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 243 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $2 + i32.const 256 + i32.lt_u + if (result i32) + local.get $2 + i32.const 4 + i32.shr_u + local.set $4 + i32.const 0 + else + local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $4 + local.get $2 + i32.const 7 + i32.sub + end + local.tee $3 + i32.const 23 + i32.lt_u + if (result i32) + local.get $4 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 259 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + local.set $2 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $2 + i32.store offset=20 + local.get $2 + if + local.get $2 + local.get $1 + i32.store offset=16 + end + local.get $3 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $1 + i32.store offset=96 + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $3 + i32.shl + i32.or + i32.store + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const 1 + local.get $4 + i32.shl + i32.or + i32.store offset=4 + ) + (func $~lib/rt/tlsf/addMemory (; 7 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $1 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $1 + local.get $2 + i32.le_u + select + select + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 385 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=1568 + local.tee $3 + if + local.get $1 + local.get $3 + i32.const 16 + i32.add + i32.lt_u + if + i32.const 0 + i32.const 24 + i32.const 395 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $3 + i32.eq + if + local.get $3 + i32.load + local.set $4 + local.get $1 + i32.const 16 + i32.sub + local.set $1 + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.lt_u + if + i32.const 0 + i32.const 24 + i32.const 407 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.tee $2 + i32.const 48 + i32.lt_u + if + return + end + local.get $1 + local.get $4 + i32.const 2 + i32.and + local.get $2 + i32.const 32 + i32.sub + i32.const 1 + i32.or + i32.or + i32.store + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $2 + i32.add + i32.const 16 + i32.sub + local.tee $2 + i32.const 2 + i32.store + local.get $0 + local.get $2 + i32.store offset=1568 + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/tlsf/initializeRoot (; 8 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 1 + memory.size + local.tee $0 + i32.gt_s + if (result i32) + i32.const 1 + local.get $0 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + i32.const 304 + i32.const 0 + i32.store + i32.const 1872 + i32.const 0 + i32.store + i32.const 0 + local.set $0 + loop $repeat|0 + block $break|0 + local.get $0 + i32.const 23 + i32.ge_u + br_if $break|0 + local.get $0 + i32.const 2 + i32.shl + i32.const 304 + i32.add + i32.const 0 + i32.store offset=4 + i32.const 0 + local.set $1 + loop $repeat|1 + block $break|1 + local.get $1 + i32.const 16 + i32.ge_u + br_if $break|1 + local.get $0 + i32.const 4 + i32.shl + local.get $1 + i32.add + i32.const 2 + i32.shl + i32.const 304 + i32.add + i32.const 0 + i32.store offset=96 + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|1 + end + end + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + end + i32.const 304 + i32.const 1888 + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + i32.const 304 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 72 + i32.const 24 + i32.const 447 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const -16 + i32.and + local.tee $0 + i32.const 16 + local.get $0 + i32.const 16 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + i32.const 256 + i32.lt_u + if (result i32) + local.get $1 + i32.const 4 + i32.shr_u + local.set $1 + i32.const 0 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + local.get $1 + i32.add + i32.const 1 + i32.sub + local.set $1 + end + local.get $1 + i32.const 31 + local.get $1 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $1 + local.get $2 + i32.const 7 + i32.sub + end + local.tee $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $1 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 337 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const -1 + local.get $1 + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $1 + i32.ctz + local.get $2 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + else + local.get $0 + i32.load + i32.const -1 + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $1 + i32.ctz + local.tee $1 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 350 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.ctz + local.get $1 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + else + i32.const 0 + end + end + ) + (func $~lib/rt/tlsf/growMemory (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + memory.size + local.tee $2 + local.get $1 + i32.const 65535 + i32.add + i32.const -65536 + i32.and + i32.const 16 + i32.shr_u + local.tee $1 + local.get $2 + local.get $1 + i32.gt_s + select + memory.grow + i32.const 0 + i32.lt_s + if + local.get $1 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + local.get $0 + local.get $2 + i32.const 16 + i32.shl + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + ) + (func $~lib/rt/tlsf/prepareBlock (; 12 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + if + i32.const 0 + i32.const 24 + i32.const 364 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const -4 + i32.and + local.get $2 + i32.sub + local.tee $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $3 + i32.const 2 + i32.and + local.get $2 + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.tee $1 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const -2 + i32.and + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + i32.load + i32.const -3 + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.tee $3 + call $~lib/rt/tlsf/searchBlock + local.tee $2 + i32.eqz + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $3 + call $~lib/rt/tlsf/searchBlock + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 477 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + i32.load + i32.const -4 + i32.and + local.get $3 + i32.lt_u + if + i32.const 0 + i32.const 24 + i32.const 479 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 0 + i32.store offset=4 + local.get $2 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $2 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $2 + call $~lib/rt/rtrace/onalloc + local.get $2 + ) + (func $~lib/rt/tlsf/__alloc (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + global.get $~lib/rt/tlsf/ROOT + local.tee $2 + if (result i32) + local.get $2 + else + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + end + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.tee $0 + local.get $1 + i32.store offset=8 + local.get $0 + i32.const 16 + i32.add + ) + (func $~lib/rt/pure/increment (; 15 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const -268435456 + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne + if + i32.const 0 + i32.const 128 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/rtrace/onincrement + local.get $0 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 128 + i32.const 107 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/pure/__retain (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 292 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment + end + local.get $0 + ) + (func $rc/logical-and-mismatch/Ref#constructor (; 17 ;) (type $FUNCSIG$i) (result i32) + i32.const 0 + i32.const 3 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + ) + (func $~lib/rt/tlsf/freeBlock (; 18 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.tee $2 + i32.const 1 + i32.and + if + i32.const 0 + i32.const 24 + i32.const 531 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/rtrace/onfree + ) + (func $~lib/rt/__typeinfo (; 19 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 256 + i32.load + i32.gt_u + if + i32.const 176 + i32.const 232 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 3 + i32.shl + i32.const 260 + i32.add + i32.load + ) + (func $~lib/memory/memory.copy (; 20 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $2 + local.set $3 + local.get $0 + local.get $1 + i32.eq + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $1 + i32.lt_u + if + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|0 + local.get $0 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + br $continue|0 + end + end + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $1 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + br $continue|1 + end + end + end + loop $continue|2 + local.get $3 + if + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + else + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|3 + local.get $0 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $3 + i32.const 8 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + loop $continue|5 + local.get $3 + if + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + ) + (func $~lib/rt/tlsf/__free (; 21 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 561 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $0 + select + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 562 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/growRoots (; 22 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/pure/CUR + global.get $~lib/rt/pure/ROOTS + local.tee $1 + i32.sub + local.tee $2 + i32.const 1 + i32.shl + local.tee $0 + i32.const 256 + local.get $0 + i32.const 256 + i32.gt_u + select + local.tee $3 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.tee $0 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onfree + local.get $0 + local.get $1 + local.get $2 + call $~lib/memory/memory.copy + local.get $1 + if + local.get $1 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onalloc + local.get $1 + call $~lib/rt/tlsf/__free + end + local.get $0 + global.set $~lib/rt/pure/ROOTS + local.get $0 + local.get $2 + i32.add + global.set $~lib/rt/pure/CUR + local.get $0 + local.get $3 + i32.add + global.set $~lib/rt/pure/END + ) + (func $~lib/rt/pure/appendRoot (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/pure/CUR + local.tee $1 + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 4 + i32.add + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/decrement (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.tee $2 + i32.const 268435455 + i32.and + local.set $1 + local.get $0 + call $~lib/rt/rtrace/ondecrement + local.get $0 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 128 + i32.const 115 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/rt/__visit_members + local.get $2 + i32.const -2147483648 + i32.and + if + local.get $0 + i32.const -2147483648 + i32.store offset=4 + else + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + else + local.get $1 + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 128 + i32.const 124 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 16 + i32.and + if + local.get $0 + local.get $1 + i32.const 1 + i32.sub + local.get $2 + i32.const -268435456 + i32.and + i32.or + i32.store offset=4 + else + local.get $0 + local.get $1 + i32.const 1 + i32.sub + i32.const -1342177280 + i32.or + i32.store offset=4 + local.get $2 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/appendRoot + end + end + end + ) + (func $~lib/rt/pure/__release (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + i32.const 292 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + end + ) + (func $start:rc/logical-and-mismatch (; 26 ;) (type $FUNCSIG$v) + (local $0 i32) + call $rc/logical-and-mismatch/Ref#constructor + global.set $rc/logical-and-mismatch/gloRef + call $rc/logical-and-mismatch/Ref#constructor + local.tee $0 + if (result i32) + local.get $0 + call $~lib/rt/pure/__release + global.get $rc/logical-and-mismatch/gloRef + call $~lib/rt/pure/__retain + else + local.get $0 + end + call $~lib/rt/pure/__release + global.get $rc/logical-and-mismatch/gloRef + local.tee $0 + if (result i32) + call $rc/logical-and-mismatch/Ref#constructor + else + local.get $0 + call $~lib/rt/pure/__retain + end + call $~lib/rt/pure/__release + call $rc/logical-and-mismatch/Ref#constructor + local.tee $0 + if (result i32) + local.get $0 + call $~lib/rt/pure/__release + call $rc/logical-and-mismatch/Ref#constructor + else + local.get $0 + end + call $~lib/rt/pure/__release + global.get $rc/logical-and-mismatch/gloRef + local.tee $0 + if (result i32) + global.get $rc/logical-and-mismatch/gloRef + else + local.get $0 + end + call $~lib/rt/pure/__retain + call $~lib/rt/pure/__release + global.get $rc/logical-and-mismatch/gloRef + call $~lib/rt/pure/__release + ) + (func $start (; 27 ;) (type $FUNCSIG$v) + call $start:rc/logical-and-mismatch + ) + (func $~lib/rt/pure/markGray (; 28 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members + end + ) + (func $~lib/rt/pure/scanBlack (; 29 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 30 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (; 31 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + ) + (func $~lib/rt/pure/__visit (; 32 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + local.get $0 + i32.const 292 + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $0 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + local.get $1 + i32.const 1 + i32.ne + if + local.get $1 + i32.const 2 + i32.eq + br_if $case1|0 + block $tablify|0 + local.get $1 + i32.const 3 + i32.sub + br_table $case2|0 $case3|0 $case4|0 $tablify|0 + end + br $case5|0 + end + local.get $0 + call $~lib/rt/pure/decrement + br $break|0 + end + local.get $0 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 128 + i32.const 75 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $0 + call $~lib/rt/pure/markGray + br $break|0 + end + local.get $0 + call $~lib/rt/pure/scan + br $break|0 + end + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const -268435456 + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne + if + i32.const 0 + i32.const 128 + i32.const 86 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $1 + i32.const 1879048192 + i32.and + if + local.get $0 + call $~lib/rt/pure/scanBlack + end + br $break|0 + end + local.get $0 + call $~lib/rt/pure/collectWhite + br $break|0 + end + i32.const 0 + i32.const 128 + i32.const 97 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/__visit_members (; 33 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + block $switch$1$default + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$case$2 $switch$1$default + end + return + end + local.get $0 + i32.load + local.tee $0 + if + local.get $0 + local.get $1 + call $~lib/rt/pure/__visit + end + return + end + unreachable + ) + (func $null (; 34 ;) (type $FUNCSIG$v) + nop + ) +) diff --git a/tests/compiler/rc/logical-and-mismatch.ts b/tests/compiler/rc/logical-and-mismatch.ts new file mode 100644 index 0000000000..966c8b7cc9 --- /dev/null +++ b/tests/compiler/rc/logical-and-mismatch.ts @@ -0,0 +1,29 @@ +class Ref {} + +function getRef(): Ref { + return new Ref(); +} + +var gloRef = new Ref(); + +{ + // Left skips autorelease, right doesn't + let a = /* t = */ getRef() && /* __release(t), */ gloRef; + // __release(a) +} +{ + // Right skips autorelease, left doesn't + let b = gloRef && getRef(); +} +{ + // Both skip autorelease, for completeness + let c = getRef() && getRef(); +} +{ + // Both don't + let d = gloRef && gloRef; +} + +// Unleak + +__release(changetype(gloRef)); diff --git a/tests/compiler/rc/logical-and-mismatch.untouched.wat b/tests/compiler/rc/logical-and-mismatch.untouched.wat new file mode 100644 index 0000000000..c6114f86e4 --- /dev/null +++ b/tests/compiler/rc/logical-and-mismatch.untouched.wat @@ -0,0 +1,3559 @@ +(module + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$i (func (result i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32))) + (import "rtrace" "onincrement" (func $~lib/rt/rtrace/onincrement (param i32))) + (import "rtrace" "ondecrement" (func $~lib/rt/rtrace/ondecrement (param i32))) + (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) + (memory $0 1) + (data (i32.const 8) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 56) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 112) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s\00") + (data (i32.const 160) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 216) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s\00") + (data (i32.const 256) "\04\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $rc/logical-and-mismatch/gloRef (mut i32) (i32.const 0)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) + (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/rt/__rtti_base i32 (i32.const 256)) + (global $~lib/heap/__heap_base i32 (i32.const 292)) + (export "memory" (memory $0)) + (start $start) + (func $~lib/rt/tlsf/removeBlock (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 276 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $3 + local.get $3 + i32.const 16 + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 278 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 + local.get $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) + local.get $5 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 291 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end + local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $9 + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $8 + local.get $4 + local.set $11 + local.get $9 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $9 + local.set $10 + local.get $8 + local.get $11 + i32.const 2 + i32.shl + i32.add + local.get $10 + i32.store offset=4 + end + local.get $9 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 6 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 204 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 206 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 + i32.const 1 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end + local.get $2 + i32.const 2 + i32.and + if + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 4 + i32.sub + i32.load + end + local.set $6 + local.get $6 + i32.load + local.set $3 + local.get $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 227 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $6 + call $~lib/rt/tlsf/removeBlock + local.get $6 + local.get $3 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $6 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $8 + i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 243 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $8 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 259 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $7 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $7 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $0 + local.set $12 + local.get $9 + local.set $7 + local.get $10 + local.set $3 + local.get $1 + local.set $6 + local.get $12 + local.get $7 + i32.const 4 + i32.shl + local.get $3 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + end + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $0 + local.set $13 + local.get $9 + local.set $12 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + end + ) + (func $~lib/rt/tlsf/addMemory (; 7 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + local.get $2 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 385 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 395 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 407 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 8 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + memory.size + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end + block $break|0 + i32.const 0 + local.set $5 + loop $repeat|0 + local.get $5 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $3 + local.set $7 + local.get $5 + local.set $6 + i32.const 0 + local.set $4 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $7 + loop $repeat|1 + local.get $7 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $3 + local.set $9 + local.get $5 + local.set $8 + local.get $7 + local.set $6 + i32.const 0 + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store offset=96 + end + local.get $7 + i32.const 1 + i32.add + local.set $7 + br $repeat|1 + unreachable + end + unreachable + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 72 + i32.const 24 + i32.const 447 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 337 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + i32.const 0 + local.set $7 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $5 + local.get $5 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $5 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $4 + local.get $8 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 350 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + memory.size + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + memory.grow + i32.const 0 + i32.lt_s + if + local.get $3 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + memory.size + local.set $7 + local.get $0 + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (; 12 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 364 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 477 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 479 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + call $~lib/rt/rtrace/onalloc + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/rt/pure/increment (; 15 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/rtrace/onincrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 107 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/pure/__retain (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment + end + local.get $0 + ) + (func $rc/logical-and-mismatch/Ref#constructor (; 17 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 0 + i32.const 3 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $0 + end + local.get $0 + ) + (func $rc/logical-and-mismatch/getRef (; 18 ;) (type $FUNCSIG$i) (result i32) + i32.const 0 + call $rc/logical-and-mismatch/Ref#constructor + ) + (func $~lib/rt/tlsf/freeBlock (; 19 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 531 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/rtrace/onfree + ) + (func $~lib/rt/__typeinfo (; 20 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/rt/__rtti_base + local.set $1 + local.get $0 + local.get $1 + i32.load + i32.gt_u + if + i32.const 176 + i32.const 232 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 4 + i32.add + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/util/memory/memcpy (; 21 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + block $break|0 + loop $continue|0 + local.get $2 + if (result i32) + local.get $1 + i32.const 3 + i32.and + else + i32.const 0 + end + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $continue|0 + end + end + end + local.get $0 + i32.const 3 + i32.and + i32.const 0 + i32.eq + if + block $break|1 + loop $continue|1 + local.get $2 + i32.const 16 + i32.ge_u + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 8 + i32.add + i32.load + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 12 + i32.add + i32.load + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|1 + end + end + end + local.get $2 + i32.const 8 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + end + local.get $2 + i32.const 4 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.set $0 + local.get $1 + i32.const 4 + i32.add + local.set $1 + end + local.get $2 + i32.const 2 + i32.and + if + local.get $0 + local.get $1 + i32.load16_u + i32.store16 + local.get $0 + i32.const 2 + i32.add + local.set $0 + local.get $1 + i32.const 2 + i32.add + local.set $1 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + return + end + local.get $2 + i32.const 32 + i32.ge_u + if + block $break|2 + block $case2|2 + block $case1|2 + block $case0|2 + local.get $0 + i32.const 3 + i32.and + local.set $5 + local.get $5 + i32.const 1 + i32.eq + br_if $case0|2 + local.get $5 + i32.const 2 + i32.eq + br_if $case1|2 + local.get $5 + i32.const 3 + i32.eq + br_if $case2|2 + br $break|2 + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 3 + i32.sub + local.set $2 + block $break|3 + loop $continue|3 + local.get $2 + i32.const 17 + i32.ge_u + if + local.get $1 + i32.const 1 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 5 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 9 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 13 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|3 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + block $break|4 + loop $continue|4 + local.get $2 + i32.const 18 + i32.ge_u + if + local.get $1 + i32.const 2 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 6 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 10 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 14 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|4 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + block $break|5 + loop $continue|5 + local.get $2 + i32.const 19 + i32.ge_u + if + local.get $1 + i32.const 3 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 7 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 11 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 15 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|5 + end + end + end + br $break|2 + unreachable + end + unreachable + end + end + local.get $2 + i32.const 16 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 8 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 4 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 2 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + ) + (func $~lib/memory/memory.copy (; 22 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $4 + local.get $3 + i32.add + local.get $5 + i32.le_u + if (result i32) + i32.const 1 + else + local.get $5 + local.get $3 + i32.add + local.get $4 + i32.le_u + end + if + local.get $5 + local.get $4 + local.get $3 + call $~lib/util/memory/memcpy + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/rt/tlsf/__free (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 561 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 562 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/growRoots (; 24 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/pure/ROOTS + local.set $0 + global.get $~lib/rt/pure/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onfree + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $0 + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onalloc + local.get $0 + call $~lib/rt/tlsf/__free + end + local.get $5 + global.set $~lib/rt/pure/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/pure/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/pure/END + ) + (func $~lib/rt/pure/appendRoot (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/pure/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 4 + i32.add + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/decrement (; 26 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + call $~lib/rt/rtrace/ondecrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 115 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/rt/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 124 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 16 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/pure/__release (; 27 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + end + ) + (func $start:rc/logical-and-mismatch (; 28 ;) (type $FUNCSIG$v) + (local $0 i32) + i32.const 0 + call $rc/logical-and-mismatch/Ref#constructor + global.set $rc/logical-and-mismatch/gloRef + block + call $rc/logical-and-mismatch/getRef + local.tee $0 + if (result i32) + local.get $0 + call $~lib/rt/pure/__release + global.get $rc/logical-and-mismatch/gloRef + call $~lib/rt/pure/__retain + else + local.get $0 + end + local.set $0 + local.get $0 + call $~lib/rt/pure/__release + end + block + global.get $rc/logical-and-mismatch/gloRef + local.tee $0 + if (result i32) + call $rc/logical-and-mismatch/getRef + else + local.get $0 + call $~lib/rt/pure/__retain + end + local.set $0 + local.get $0 + call $~lib/rt/pure/__release + end + block + call $rc/logical-and-mismatch/getRef + local.tee $0 + if (result i32) + local.get $0 + call $~lib/rt/pure/__release + call $rc/logical-and-mismatch/getRef + else + local.get $0 + end + local.set $0 + local.get $0 + call $~lib/rt/pure/__release + end + block + global.get $rc/logical-and-mismatch/gloRef + local.tee $0 + if (result i32) + global.get $rc/logical-and-mismatch/gloRef + else + local.get $0 + end + call $~lib/rt/pure/__retain + local.set $0 + local.get $0 + call $~lib/rt/pure/__release + end + global.get $rc/logical-and-mismatch/gloRef + call $~lib/rt/pure/__release + ) + (func $start (; 29 ;) (type $FUNCSIG$v) + call $start:rc/logical-and-mismatch + ) + (func $~lib/rt/pure/markGray (; 30 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members + end + ) + (func $~lib/rt/pure/scanBlack (; 31 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 32 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (; 33 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + ) + (func $~lib/rt/pure/__visit (; 34 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/pure/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 75 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/pure/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 86 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/pure/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 97 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + end + ) + (func $~lib/rt/__visit_members (; 35 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block + end + block $switch$1$leave + block $switch$1$default + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$case$2 $switch$1$default + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + ) + (func $null (; 36 ;) (type $FUNCSIG$v) + ) +) diff --git a/tests/compiler/rc/logical-or-mismatch.json b/tests/compiler/rc/logical-or-mismatch.json new file mode 100644 index 0000000000..9f7878d475 --- /dev/null +++ b/tests/compiler/rc/logical-or-mismatch.json @@ -0,0 +1,6 @@ +{ + "asc_flags": [ + "--runtime half", + "--use ASC_RTRACE=1" + ] +} \ No newline at end of file diff --git a/tests/compiler/rc/logical-or-mismatch.optimized.wat b/tests/compiler/rc/logical-or-mismatch.optimized.wat new file mode 100644 index 0000000000..85512bb48e --- /dev/null +++ b/tests/compiler/rc/logical-or-mismatch.optimized.wat @@ -0,0 +1,1793 @@ +(module + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$i (func (result i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32))) + (import "rtrace" "onincrement" (func $~lib/rt/rtrace/onincrement (param i32))) + (import "rtrace" "ondecrement" (func $~lib/rt/rtrace/ondecrement (param i32))) + (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) + (memory $0 1) + (data (i32.const 8) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s") + (data (i32.const 56) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e") + (data (i32.const 112) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s") + (data (i32.const 160) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e") + (data (i32.const 216) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s") + (data (i32.const 256) "\04\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10") + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $rc/logical-or-mismatch/gloRef (mut i32) (i32.const 0)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) + (export "memory" (memory $0)) + (start $start) + (func $~lib/rt/tlsf/removeBlock (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.tee $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 276 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const -4 + i32.and + local.tee $2 + i32.const 16 + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 278 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 256 + i32.lt_u + if (result i32) + local.get $2 + i32.const 4 + i32.shr_u + local.set $2 + i32.const 0 + else + local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $3 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $2 + local.get $3 + i32.const 7 + i32.sub + end + local.tee $3 + i32.const 23 + i32.lt_u + if (result i32) + local.get $2 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 291 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=20 + local.set $4 + local.get $1 + i32.load offset=16 + local.tee $5 + if + local.get $5 + local.get $4 + i32.store offset=20 + end + local.get $4 + if + local.get $4 + local.get $5 + i32.store offset=16 + end + local.get $3 + i32.const 4 + i32.shl + local.get $2 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + local.get $1 + i32.eq + if + local.get $3 + i32.const 4 + i32.shl + local.get $2 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $4 + i32.store offset=96 + local.get $4 + i32.eqz + if + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const 1 + local.get $2 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.store offset=4 + local.get $1 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $3 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 6 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 204 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.tee $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 206 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.tee $5 + i32.const 1 + i32.and + if + local.get $3 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const -4 + i32.and + i32.add + local.tee $2 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $3 + i32.const 3 + i32.and + local.get $2 + i32.or + local.tee $3 + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.set $5 + end + end + local.get $3 + i32.const 2 + i32.and + if + local.get $1 + i32.const 4 + i32.sub + i32.load + local.tee $2 + i32.load + local.tee $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 227 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $3 + i32.const -4 + i32.and + i32.add + local.tee $7 + i32.const 1073741808 + i32.lt_u + if (result i32) + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $2 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $3 + i32.store + local.get $2 + else + local.get $1 + end + local.set $1 + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $3 + i32.const -4 + i32.and + local.tee $2 + i32.const 16 + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 243 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $2 + i32.const 256 + i32.lt_u + if (result i32) + local.get $2 + i32.const 4 + i32.shr_u + local.set $4 + i32.const 0 + else + local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $4 + local.get $2 + i32.const 7 + i32.sub + end + local.tee $3 + i32.const 23 + i32.lt_u + if (result i32) + local.get $4 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 259 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + local.set $2 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $2 + i32.store offset=20 + local.get $2 + if + local.get $2 + local.get $1 + i32.store offset=16 + end + local.get $3 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $1 + i32.store offset=96 + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $3 + i32.shl + i32.or + i32.store + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const 1 + local.get $4 + i32.shl + i32.or + i32.store offset=4 + ) + (func $~lib/rt/tlsf/addMemory (; 7 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $1 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $1 + local.get $2 + i32.le_u + select + select + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 385 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=1568 + local.tee $3 + if + local.get $1 + local.get $3 + i32.const 16 + i32.add + i32.lt_u + if + i32.const 0 + i32.const 24 + i32.const 395 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $3 + i32.eq + if + local.get $3 + i32.load + local.set $4 + local.get $1 + i32.const 16 + i32.sub + local.set $1 + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.lt_u + if + i32.const 0 + i32.const 24 + i32.const 407 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.tee $2 + i32.const 48 + i32.lt_u + if + return + end + local.get $1 + local.get $4 + i32.const 2 + i32.and + local.get $2 + i32.const 32 + i32.sub + i32.const 1 + i32.or + i32.or + i32.store + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $2 + i32.add + i32.const 16 + i32.sub + local.tee $2 + i32.const 2 + i32.store + local.get $0 + local.get $2 + i32.store offset=1568 + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/tlsf/initializeRoot (; 8 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 1 + memory.size + local.tee $0 + i32.gt_s + if (result i32) + i32.const 1 + local.get $0 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + i32.const 304 + i32.const 0 + i32.store + i32.const 1872 + i32.const 0 + i32.store + i32.const 0 + local.set $0 + loop $repeat|0 + block $break|0 + local.get $0 + i32.const 23 + i32.ge_u + br_if $break|0 + local.get $0 + i32.const 2 + i32.shl + i32.const 304 + i32.add + i32.const 0 + i32.store offset=4 + i32.const 0 + local.set $1 + loop $repeat|1 + block $break|1 + local.get $1 + i32.const 16 + i32.ge_u + br_if $break|1 + local.get $0 + i32.const 4 + i32.shl + local.get $1 + i32.add + i32.const 2 + i32.shl + i32.const 304 + i32.add + i32.const 0 + i32.store offset=96 + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|1 + end + end + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + end + i32.const 304 + i32.const 1888 + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + i32.const 304 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 72 + i32.const 24 + i32.const 447 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const -16 + i32.and + local.tee $0 + i32.const 16 + local.get $0 + i32.const 16 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + i32.const 256 + i32.lt_u + if (result i32) + local.get $1 + i32.const 4 + i32.shr_u + local.set $1 + i32.const 0 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + local.get $1 + i32.add + i32.const 1 + i32.sub + local.set $1 + end + local.get $1 + i32.const 31 + local.get $1 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $1 + local.get $2 + i32.const 7 + i32.sub + end + local.tee $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $1 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 337 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const -1 + local.get $1 + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $1 + i32.ctz + local.get $2 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + else + local.get $0 + i32.load + i32.const -1 + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $1 + i32.ctz + local.tee $1 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 350 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.ctz + local.get $1 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + else + i32.const 0 + end + end + ) + (func $~lib/rt/tlsf/growMemory (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + memory.size + local.tee $2 + local.get $1 + i32.const 65535 + i32.add + i32.const -65536 + i32.and + i32.const 16 + i32.shr_u + local.tee $1 + local.get $2 + local.get $1 + i32.gt_s + select + memory.grow + i32.const 0 + i32.lt_s + if + local.get $1 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + local.get $0 + local.get $2 + i32.const 16 + i32.shl + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + ) + (func $~lib/rt/tlsf/prepareBlock (; 12 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + if + i32.const 0 + i32.const 24 + i32.const 364 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const -4 + i32.and + local.get $2 + i32.sub + local.tee $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $3 + i32.const 2 + i32.and + local.get $2 + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.tee $1 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const -2 + i32.and + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + i32.load + i32.const -3 + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.tee $3 + call $~lib/rt/tlsf/searchBlock + local.tee $2 + i32.eqz + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $3 + call $~lib/rt/tlsf/searchBlock + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 477 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + i32.load + i32.const -4 + i32.and + local.get $3 + i32.lt_u + if + i32.const 0 + i32.const 24 + i32.const 479 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 0 + i32.store offset=4 + local.get $2 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $2 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $2 + call $~lib/rt/rtrace/onalloc + local.get $2 + ) + (func $~lib/rt/tlsf/__alloc (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + global.get $~lib/rt/tlsf/ROOT + local.tee $2 + if (result i32) + local.get $2 + else + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + end + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.tee $0 + local.get $1 + i32.store offset=8 + local.get $0 + i32.const 16 + i32.add + ) + (func $~lib/rt/pure/increment (; 15 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const -268435456 + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne + if + i32.const 0 + i32.const 128 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/rtrace/onincrement + local.get $0 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 128 + i32.const 107 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/pure/__retain (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 292 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment + end + local.get $0 + ) + (func $rc/logical-or-mismatch/Ref#constructor (; 17 ;) (type $FUNCSIG$i) (result i32) + i32.const 0 + i32.const 3 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + ) + (func $~lib/rt/tlsf/freeBlock (; 18 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.tee $2 + i32.const 1 + i32.and + if + i32.const 0 + i32.const 24 + i32.const 531 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/rtrace/onfree + ) + (func $~lib/rt/__typeinfo (; 19 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 256 + i32.load + i32.gt_u + if + i32.const 176 + i32.const 232 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 3 + i32.shl + i32.const 260 + i32.add + i32.load + ) + (func $~lib/memory/memory.copy (; 20 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $2 + local.set $3 + local.get $0 + local.get $1 + i32.eq + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $1 + i32.lt_u + if + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|0 + local.get $0 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + br $continue|0 + end + end + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $1 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + br $continue|1 + end + end + end + loop $continue|2 + local.get $3 + if + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + else + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|3 + local.get $0 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $3 + i32.const 8 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + loop $continue|5 + local.get $3 + if + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + ) + (func $~lib/rt/tlsf/__free (; 21 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 561 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $0 + select + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 562 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/growRoots (; 22 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/pure/CUR + global.get $~lib/rt/pure/ROOTS + local.tee $1 + i32.sub + local.tee $2 + i32.const 1 + i32.shl + local.tee $0 + i32.const 256 + local.get $0 + i32.const 256 + i32.gt_u + select + local.tee $3 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.tee $0 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onfree + local.get $0 + local.get $1 + local.get $2 + call $~lib/memory/memory.copy + local.get $1 + if + local.get $1 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onalloc + local.get $1 + call $~lib/rt/tlsf/__free + end + local.get $0 + global.set $~lib/rt/pure/ROOTS + local.get $0 + local.get $2 + i32.add + global.set $~lib/rt/pure/CUR + local.get $0 + local.get $3 + i32.add + global.set $~lib/rt/pure/END + ) + (func $~lib/rt/pure/appendRoot (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/pure/CUR + local.tee $1 + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 4 + i32.add + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/decrement (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.tee $2 + i32.const 268435455 + i32.and + local.set $1 + local.get $0 + call $~lib/rt/rtrace/ondecrement + local.get $0 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 128 + i32.const 115 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/rt/__visit_members + local.get $2 + i32.const -2147483648 + i32.and + if + local.get $0 + i32.const -2147483648 + i32.store offset=4 + else + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + else + local.get $1 + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 128 + i32.const 124 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 16 + i32.and + if + local.get $0 + local.get $1 + i32.const 1 + i32.sub + local.get $2 + i32.const -268435456 + i32.and + i32.or + i32.store offset=4 + else + local.get $0 + local.get $1 + i32.const 1 + i32.sub + i32.const -1342177280 + i32.or + i32.store offset=4 + local.get $2 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/appendRoot + end + end + end + ) + (func $~lib/rt/pure/__release (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + i32.const 292 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + end + ) + (func $start:rc/logical-or-mismatch (; 26 ;) (type $FUNCSIG$v) + (local $0 i32) + call $rc/logical-or-mismatch/Ref#constructor + global.set $rc/logical-or-mismatch/gloRef + call $rc/logical-or-mismatch/Ref#constructor + local.tee $0 + if (result i32) + local.get $0 + else + local.get $0 + call $~lib/rt/pure/__release + global.get $rc/logical-or-mismatch/gloRef + call $~lib/rt/pure/__retain + end + call $~lib/rt/pure/__release + global.get $rc/logical-or-mismatch/gloRef + local.tee $0 + if (result i32) + local.get $0 + call $~lib/rt/pure/__retain + else + call $rc/logical-or-mismatch/Ref#constructor + end + call $~lib/rt/pure/__release + call $rc/logical-or-mismatch/Ref#constructor + local.tee $0 + if (result i32) + local.get $0 + else + local.get $0 + call $~lib/rt/pure/__release + call $rc/logical-or-mismatch/Ref#constructor + end + call $~lib/rt/pure/__release + global.get $rc/logical-or-mismatch/gloRef + local.tee $0 + if (result i32) + local.get $0 + else + global.get $rc/logical-or-mismatch/gloRef + end + call $~lib/rt/pure/__retain + call $~lib/rt/pure/__release + global.get $rc/logical-or-mismatch/gloRef + call $~lib/rt/pure/__release + ) + (func $start (; 27 ;) (type $FUNCSIG$v) + call $start:rc/logical-or-mismatch + ) + (func $~lib/rt/pure/markGray (; 28 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members + end + ) + (func $~lib/rt/pure/scanBlack (; 29 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 30 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (; 31 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + ) + (func $~lib/rt/pure/__visit (; 32 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + local.get $0 + i32.const 292 + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $0 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + local.get $1 + i32.const 1 + i32.ne + if + local.get $1 + i32.const 2 + i32.eq + br_if $case1|0 + block $tablify|0 + local.get $1 + i32.const 3 + i32.sub + br_table $case2|0 $case3|0 $case4|0 $tablify|0 + end + br $case5|0 + end + local.get $0 + call $~lib/rt/pure/decrement + br $break|0 + end + local.get $0 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 128 + i32.const 75 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $0 + call $~lib/rt/pure/markGray + br $break|0 + end + local.get $0 + call $~lib/rt/pure/scan + br $break|0 + end + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const -268435456 + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne + if + i32.const 0 + i32.const 128 + i32.const 86 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $1 + i32.const 1879048192 + i32.and + if + local.get $0 + call $~lib/rt/pure/scanBlack + end + br $break|0 + end + local.get $0 + call $~lib/rt/pure/collectWhite + br $break|0 + end + i32.const 0 + i32.const 128 + i32.const 97 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/__visit_members (; 33 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + block $switch$1$default + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$case$2 $switch$1$default + end + return + end + local.get $0 + i32.load + local.tee $0 + if + local.get $0 + local.get $1 + call $~lib/rt/pure/__visit + end + return + end + unreachable + ) + (func $null (; 34 ;) (type $FUNCSIG$v) + nop + ) +) diff --git a/tests/compiler/rc/logical-or-mismatch.ts b/tests/compiler/rc/logical-or-mismatch.ts new file mode 100644 index 0000000000..ef5ae700f1 --- /dev/null +++ b/tests/compiler/rc/logical-or-mismatch.ts @@ -0,0 +1,29 @@ +class Ref {} + +function getRef(): Ref { + return new Ref(); +} + +var gloRef = new Ref(); + +{ + // Left skips autorelease, right doesn't + let a = /* t = */ getRef() || /* __release(t), */ gloRef; + // __release(a) +} +{ + // Right skips autorelease, left doesn't + let b = gloRef || getRef(); +} +{ + // Both skip autorelease, for completeness + let c = getRef() || getRef(); +} +{ + // Both don't + let d = gloRef || gloRef; +} + +// Unleak + +__release(changetype(gloRef)); diff --git a/tests/compiler/rc/logical-or-mismatch.untouched.wat b/tests/compiler/rc/logical-or-mismatch.untouched.wat new file mode 100644 index 0000000000..a5069543f4 --- /dev/null +++ b/tests/compiler/rc/logical-or-mismatch.untouched.wat @@ -0,0 +1,3559 @@ +(module + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$i (func (result i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32))) + (import "rtrace" "onincrement" (func $~lib/rt/rtrace/onincrement (param i32))) + (import "rtrace" "ondecrement" (func $~lib/rt/rtrace/ondecrement (param i32))) + (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) + (memory $0 1) + (data (i32.const 8) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 56) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 112) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s\00") + (data (i32.const 160) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 216) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s\00") + (data (i32.const 256) "\04\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $rc/logical-or-mismatch/gloRef (mut i32) (i32.const 0)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) + (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/rt/__rtti_base i32 (i32.const 256)) + (global $~lib/heap/__heap_base i32 (i32.const 292)) + (export "memory" (memory $0)) + (start $start) + (func $~lib/rt/tlsf/removeBlock (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 276 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $3 + local.get $3 + i32.const 16 + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 278 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 + local.get $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) + local.get $5 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 291 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end + local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $9 + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $8 + local.get $4 + local.set $11 + local.get $9 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $9 + local.set $10 + local.get $8 + local.get $11 + i32.const 2 + i32.shl + i32.add + local.get $10 + i32.store offset=4 + end + local.get $9 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 6 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 204 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 206 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 + i32.const 1 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end + local.get $2 + i32.const 2 + i32.and + if + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 4 + i32.sub + i32.load + end + local.set $6 + local.get $6 + i32.load + local.set $3 + local.get $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 227 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $6 + call $~lib/rt/tlsf/removeBlock + local.get $6 + local.get $3 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $6 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $8 + i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 243 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $8 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 259 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $7 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $7 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $0 + local.set $12 + local.get $9 + local.set $7 + local.get $10 + local.set $3 + local.get $1 + local.set $6 + local.get $12 + local.get $7 + i32.const 4 + i32.shl + local.get $3 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + end + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $0 + local.set $13 + local.get $9 + local.set $12 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + end + ) + (func $~lib/rt/tlsf/addMemory (; 7 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + local.get $2 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 385 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 395 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 407 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 8 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + memory.size + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end + block $break|0 + i32.const 0 + local.set $5 + loop $repeat|0 + local.get $5 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $3 + local.set $7 + local.get $5 + local.set $6 + i32.const 0 + local.set $4 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $7 + loop $repeat|1 + local.get $7 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $3 + local.set $9 + local.get $5 + local.set $8 + local.get $7 + local.set $6 + i32.const 0 + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store offset=96 + end + local.get $7 + i32.const 1 + i32.add + local.set $7 + br $repeat|1 + unreachable + end + unreachable + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 72 + i32.const 24 + i32.const 447 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 337 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + i32.const 0 + local.set $7 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $5 + local.get $5 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $5 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $4 + local.get $8 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 350 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + memory.size + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + memory.grow + i32.const 0 + i32.lt_s + if + local.get $3 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + memory.size + local.set $7 + local.get $0 + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (; 12 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 364 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 477 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 479 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + call $~lib/rt/rtrace/onalloc + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/rt/pure/increment (; 15 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/rtrace/onincrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 107 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/pure/__retain (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment + end + local.get $0 + ) + (func $rc/logical-or-mismatch/Ref#constructor (; 17 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 0 + i32.const 3 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $0 + end + local.get $0 + ) + (func $rc/logical-or-mismatch/getRef (; 18 ;) (type $FUNCSIG$i) (result i32) + i32.const 0 + call $rc/logical-or-mismatch/Ref#constructor + ) + (func $~lib/rt/tlsf/freeBlock (; 19 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 531 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/rtrace/onfree + ) + (func $~lib/rt/__typeinfo (; 20 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/rt/__rtti_base + local.set $1 + local.get $0 + local.get $1 + i32.load + i32.gt_u + if + i32.const 176 + i32.const 232 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 4 + i32.add + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/util/memory/memcpy (; 21 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + block $break|0 + loop $continue|0 + local.get $2 + if (result i32) + local.get $1 + i32.const 3 + i32.and + else + i32.const 0 + end + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $continue|0 + end + end + end + local.get $0 + i32.const 3 + i32.and + i32.const 0 + i32.eq + if + block $break|1 + loop $continue|1 + local.get $2 + i32.const 16 + i32.ge_u + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 8 + i32.add + i32.load + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 12 + i32.add + i32.load + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|1 + end + end + end + local.get $2 + i32.const 8 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + end + local.get $2 + i32.const 4 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.set $0 + local.get $1 + i32.const 4 + i32.add + local.set $1 + end + local.get $2 + i32.const 2 + i32.and + if + local.get $0 + local.get $1 + i32.load16_u + i32.store16 + local.get $0 + i32.const 2 + i32.add + local.set $0 + local.get $1 + i32.const 2 + i32.add + local.set $1 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + return + end + local.get $2 + i32.const 32 + i32.ge_u + if + block $break|2 + block $case2|2 + block $case1|2 + block $case0|2 + local.get $0 + i32.const 3 + i32.and + local.set $5 + local.get $5 + i32.const 1 + i32.eq + br_if $case0|2 + local.get $5 + i32.const 2 + i32.eq + br_if $case1|2 + local.get $5 + i32.const 3 + i32.eq + br_if $case2|2 + br $break|2 + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 3 + i32.sub + local.set $2 + block $break|3 + loop $continue|3 + local.get $2 + i32.const 17 + i32.ge_u + if + local.get $1 + i32.const 1 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 5 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 9 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 13 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|3 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + block $break|4 + loop $continue|4 + local.get $2 + i32.const 18 + i32.ge_u + if + local.get $1 + i32.const 2 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 6 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 10 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 14 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|4 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + block $break|5 + loop $continue|5 + local.get $2 + i32.const 19 + i32.ge_u + if + local.get $1 + i32.const 3 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 7 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 11 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 15 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|5 + end + end + end + br $break|2 + unreachable + end + unreachable + end + end + local.get $2 + i32.const 16 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 8 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 4 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 2 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + ) + (func $~lib/memory/memory.copy (; 22 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $4 + local.get $3 + i32.add + local.get $5 + i32.le_u + if (result i32) + i32.const 1 + else + local.get $5 + local.get $3 + i32.add + local.get $4 + i32.le_u + end + if + local.get $5 + local.get $4 + local.get $3 + call $~lib/util/memory/memcpy + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/rt/tlsf/__free (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 561 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 562 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/growRoots (; 24 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/pure/ROOTS + local.set $0 + global.get $~lib/rt/pure/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onfree + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $0 + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onalloc + local.get $0 + call $~lib/rt/tlsf/__free + end + local.get $5 + global.set $~lib/rt/pure/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/pure/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/pure/END + ) + (func $~lib/rt/pure/appendRoot (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/pure/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 4 + i32.add + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/decrement (; 26 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + call $~lib/rt/rtrace/ondecrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 115 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/rt/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 124 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 16 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/pure/__release (; 27 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + end + ) + (func $start:rc/logical-or-mismatch (; 28 ;) (type $FUNCSIG$v) + (local $0 i32) + i32.const 0 + call $rc/logical-or-mismatch/Ref#constructor + global.set $rc/logical-or-mismatch/gloRef + block + call $rc/logical-or-mismatch/getRef + local.tee $0 + if (result i32) + local.get $0 + else + local.get $0 + call $~lib/rt/pure/__release + global.get $rc/logical-or-mismatch/gloRef + call $~lib/rt/pure/__retain + end + local.set $0 + local.get $0 + call $~lib/rt/pure/__release + end + block + global.get $rc/logical-or-mismatch/gloRef + local.tee $0 + if (result i32) + local.get $0 + call $~lib/rt/pure/__retain + else + call $rc/logical-or-mismatch/getRef + end + local.set $0 + local.get $0 + call $~lib/rt/pure/__release + end + block + call $rc/logical-or-mismatch/getRef + local.tee $0 + if (result i32) + local.get $0 + else + local.get $0 + call $~lib/rt/pure/__release + call $rc/logical-or-mismatch/getRef + end + local.set $0 + local.get $0 + call $~lib/rt/pure/__release + end + block + global.get $rc/logical-or-mismatch/gloRef + local.tee $0 + if (result i32) + local.get $0 + else + global.get $rc/logical-or-mismatch/gloRef + end + call $~lib/rt/pure/__retain + local.set $0 + local.get $0 + call $~lib/rt/pure/__release + end + global.get $rc/logical-or-mismatch/gloRef + call $~lib/rt/pure/__release + ) + (func $start (; 29 ;) (type $FUNCSIG$v) + call $start:rc/logical-or-mismatch + ) + (func $~lib/rt/pure/markGray (; 30 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members + end + ) + (func $~lib/rt/pure/scanBlack (; 31 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 32 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (; 33 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + ) + (func $~lib/rt/pure/__visit (; 34 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/pure/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 75 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/pure/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 86 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/pure/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 97 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + end + ) + (func $~lib/rt/__visit_members (; 35 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block + end + block $switch$1$leave + block $switch$1$default + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$case$2 $switch$1$default + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + ) + (func $null (; 36 ;) (type $FUNCSIG$v) + ) +) diff --git a/tests/compiler/rc/rereturn.optimized.wat b/tests/compiler/rc/rereturn.optimized.wat new file mode 100644 index 0000000000..7ba85c807e --- /dev/null +++ b/tests/compiler/rc/rereturn.optimized.wat @@ -0,0 +1,1853 @@ +(module + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (memory $0 1) + (data (i32.const 8) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s") + (data (i32.const 56) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e") + (data (i32.const 112) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s") + (data (i32.const 160) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e") + (data (i32.const 216) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s") + (data (i32.const 256) "\04\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10") + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) + (global $~lib/rt/__rtti_base i32 (i32.const 256)) + (export "memory" (memory $0)) + (export "__alloc" (func $~lib/rt/tlsf/__alloc)) + (export "__retain" (func $~lib/rt/pure/__retain)) + (export "__release" (func $~lib/rt/pure/__release)) + (export "__collect" (func $~lib/rt/pure/__collect)) + (export "__rtti_base" (global $~lib/rt/__rtti_base)) + (start $start) + (func $~lib/rt/tlsf/removeBlock (; 1 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.tee $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 276 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const -4 + i32.and + local.tee $2 + i32.const 16 + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 278 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 256 + i32.lt_u + if (result i32) + local.get $2 + i32.const 4 + i32.shr_u + local.set $2 + i32.const 0 + else + local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $3 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $2 + local.get $3 + i32.const 7 + i32.sub + end + local.tee $3 + i32.const 23 + i32.lt_u + if (result i32) + local.get $2 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 291 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=20 + local.set $4 + local.get $1 + i32.load offset=16 + local.tee $5 + if + local.get $5 + local.get $4 + i32.store offset=20 + end + local.get $4 + if + local.get $4 + local.get $5 + i32.store offset=16 + end + local.get $3 + i32.const 4 + i32.shl + local.get $2 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + local.get $1 + i32.eq + if + local.get $3 + i32.const 4 + i32.shl + local.get $2 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $4 + i32.store offset=96 + local.get $4 + i32.eqz + if + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const 1 + local.get $2 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.store offset=4 + local.get $1 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $3 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 2 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 204 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.tee $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 206 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.tee $5 + i32.const 1 + i32.and + if + local.get $3 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const -4 + i32.and + i32.add + local.tee $2 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $3 + i32.const 3 + i32.and + local.get $2 + i32.or + local.tee $3 + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.set $5 + end + end + local.get $3 + i32.const 2 + i32.and + if + local.get $1 + i32.const 4 + i32.sub + i32.load + local.tee $2 + i32.load + local.tee $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 227 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $3 + i32.const -4 + i32.and + i32.add + local.tee $7 + i32.const 1073741808 + i32.lt_u + if (result i32) + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $2 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $3 + i32.store + local.get $2 + else + local.get $1 + end + local.set $1 + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $3 + i32.const -4 + i32.and + local.tee $2 + i32.const 16 + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 243 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $2 + i32.const 256 + i32.lt_u + if (result i32) + local.get $2 + i32.const 4 + i32.shr_u + local.set $4 + i32.const 0 + else + local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $4 + local.get $2 + i32.const 7 + i32.sub + end + local.tee $3 + i32.const 23 + i32.lt_u + if (result i32) + local.get $4 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 259 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + local.set $2 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $2 + i32.store offset=20 + local.get $2 + if + local.get $2 + local.get $1 + i32.store offset=16 + end + local.get $3 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $1 + i32.store offset=96 + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $3 + i32.shl + i32.or + i32.store + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const 1 + local.get $4 + i32.shl + i32.or + i32.store offset=4 + ) + (func $~lib/rt/tlsf/addMemory (; 3 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $1 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $1 + local.get $2 + i32.le_u + select + select + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 385 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=1568 + local.tee $3 + if + local.get $1 + local.get $3 + i32.const 16 + i32.add + i32.lt_u + if + i32.const 0 + i32.const 24 + i32.const 395 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $3 + i32.eq + if + local.get $3 + i32.load + local.set $4 + local.get $1 + i32.const 16 + i32.sub + local.set $1 + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.lt_u + if + i32.const 0 + i32.const 24 + i32.const 407 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.tee $2 + i32.const 48 + i32.lt_u + if + return + end + local.get $1 + local.get $4 + i32.const 2 + i32.and + local.get $2 + i32.const 32 + i32.sub + i32.const 1 + i32.or + i32.or + i32.store + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $2 + i32.add + i32.const 16 + i32.sub + local.tee $2 + i32.const 2 + i32.store + local.get $0 + local.get $2 + i32.store offset=1568 + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/tlsf/initializeRoot (; 4 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 1 + memory.size + local.tee $0 + i32.gt_s + if (result i32) + i32.const 1 + local.get $0 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + i32.const 304 + i32.const 0 + i32.store + i32.const 1872 + i32.const 0 + i32.store + i32.const 0 + local.set $0 + loop $repeat|0 + block $break|0 + local.get $0 + i32.const 23 + i32.ge_u + br_if $break|0 + local.get $0 + i32.const 2 + i32.shl + i32.const 304 + i32.add + i32.const 0 + i32.store offset=4 + i32.const 0 + local.set $1 + loop $repeat|1 + block $break|1 + local.get $1 + i32.const 16 + i32.ge_u + br_if $break|1 + local.get $0 + i32.const 4 + i32.shl + local.get $1 + i32.add + i32.const 2 + i32.shl + i32.const 304 + i32.add + i32.const 0 + i32.store offset=96 + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|1 + end + end + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + end + i32.const 304 + i32.const 1888 + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + i32.const 304 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 72 + i32.const 24 + i32.const 447 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const -16 + i32.and + local.tee $0 + i32.const 16 + local.get $0 + i32.const 16 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + i32.const 256 + i32.lt_u + if (result i32) + local.get $1 + i32.const 4 + i32.shr_u + local.set $1 + i32.const 0 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + local.get $1 + i32.add + i32.const 1 + i32.sub + local.set $1 + end + local.get $1 + i32.const 31 + local.get $1 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $1 + local.get $2 + i32.const 7 + i32.sub + end + local.tee $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $1 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 337 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const -1 + local.get $1 + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $1 + i32.ctz + local.get $2 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + else + local.get $0 + i32.load + i32.const -1 + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $1 + i32.ctz + local.tee $1 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 350 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.ctz + local.get $1 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + else + i32.const 0 + end + end + ) + (func $~lib/rt/tlsf/growMemory (; 7 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + memory.size + local.tee $2 + local.get $1 + i32.const 65535 + i32.add + i32.const -65536 + i32.and + i32.const 16 + i32.shr_u + local.tee $1 + local.get $2 + local.get $1 + i32.gt_s + select + memory.grow + i32.const 0 + i32.lt_s + if + local.get $1 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + local.get $0 + local.get $2 + i32.const 16 + i32.shl + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + ) + (func $~lib/rt/tlsf/prepareBlock (; 8 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + if + i32.const 0 + i32.const 24 + i32.const 364 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const -4 + i32.and + local.get $2 + i32.sub + local.tee $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $3 + i32.const 2 + i32.and + local.get $2 + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.tee $1 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const -2 + i32.and + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + i32.load + i32.const -3 + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.tee $3 + call $~lib/rt/tlsf/searchBlock + local.tee $2 + i32.eqz + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $3 + call $~lib/rt/tlsf/searchBlock + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 477 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + i32.load + i32.const -4 + i32.and + local.get $3 + i32.lt_u + if + i32.const 0 + i32.const 24 + i32.const 479 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 0 + i32.store offset=4 + local.get $2 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $2 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $2 + ) + (func $~lib/rt/tlsf/__alloc (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + global.get $~lib/rt/tlsf/ROOT + local.tee $2 + if (result i32) + local.get $2 + else + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + end + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.tee $0 + local.get $1 + i32.store offset=8 + local.get $0 + i32.const 16 + i32.add + ) + (func $~lib/rt/pure/increment (; 11 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const -268435456 + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne + if + i32.const 0 + i32.const 128 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 128 + i32.const 107 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/pure/__retain (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 292 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment + end + local.get $0 + ) + (func $~lib/rt/tlsf/freeBlock (; 13 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.tee $2 + i32.const 1 + i32.and + if + i32.const 0 + i32.const 24 + i32.const 531 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/__typeinfo (; 14 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 256 + i32.load + i32.gt_u + if + i32.const 176 + i32.const 232 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 3 + i32.shl + i32.const 260 + i32.add + i32.load + ) + (func $~lib/memory/memory.copy (; 15 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $2 + local.set $3 + local.get $0 + local.get $1 + i32.eq + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $1 + i32.lt_u + if + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|0 + local.get $0 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + br $continue|0 + end + end + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $1 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + br $continue|1 + end + end + end + loop $continue|2 + local.get $3 + if + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + else + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|3 + local.get $0 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $3 + i32.const 8 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + loop $continue|5 + local.get $3 + if + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + ) + (func $~lib/rt/tlsf/__free (; 16 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 561 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $0 + select + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 562 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/growRoots (; 17 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/pure/CUR + global.get $~lib/rt/pure/ROOTS + local.tee $1 + i32.sub + local.tee $2 + i32.const 1 + i32.shl + local.tee $0 + i32.const 256 + local.get $0 + i32.const 256 + i32.gt_u + select + local.tee $3 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.tee $0 + local.get $1 + local.get $2 + call $~lib/memory/memory.copy + local.get $1 + if + local.get $1 + call $~lib/rt/tlsf/__free + end + local.get $0 + global.set $~lib/rt/pure/ROOTS + local.get $0 + local.get $2 + i32.add + global.set $~lib/rt/pure/CUR + local.get $0 + local.get $3 + i32.add + global.set $~lib/rt/pure/END + ) + (func $~lib/rt/pure/appendRoot (; 18 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/pure/CUR + local.tee $1 + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 4 + i32.add + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/decrement (; 19 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.tee $2 + i32.const 268435455 + i32.and + local.set $1 + local.get $0 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 128 + i32.const 115 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/rt/__visit_members + local.get $2 + i32.const -2147483648 + i32.and + if + local.get $0 + i32.const -2147483648 + i32.store offset=4 + else + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + else + local.get $1 + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 128 + i32.const 124 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 16 + i32.and + if + local.get $0 + local.get $1 + i32.const 1 + i32.sub + local.get $2 + i32.const -268435456 + i32.and + i32.or + i32.store offset=4 + else + local.get $0 + local.get $1 + i32.const 1 + i32.sub + i32.const -1342177280 + i32.or + i32.store offset=4 + local.get $2 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/appendRoot + end + end + end + ) + (func $~lib/rt/pure/__release (; 20 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + i32.const 292 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + end + ) + (func $~lib/rt/pure/markGray (; 21 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members + end + ) + (func $~lib/rt/pure/scanBlack (; 22 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + ) + (func $~lib/rt/pure/__collect (; 25 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/pure/ROOTS + local.tee $5 + local.tee $2 + local.set $3 + global.get $~lib/rt/pure/CUR + local.set $0 + loop $repeat|0 + block $break|0 + local.get $3 + local.get $0 + i32.ge_u + br_if $break|0 + local.get $3 + i32.load + local.tee $4 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 805306368 + i32.eq + if (result i32) + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + else + i32.const 0 + end + if + local.get $4 + call $~lib/rt/pure/markGray + local.get $2 + local.get $4 + i32.store + local.get $2 + i32.const 4 + i32.add + local.set $2 + else + i32.const 0 + local.get $1 + i32.const 268435455 + i32.and + i32.eqz + local.get $1 + i32.const 1879048192 + i32.and + select + if + global.get $~lib/rt/tlsf/ROOT + local.get $4 + call $~lib/rt/tlsf/freeBlock + else + local.get $4 + local.get $1 + i32.const 2147483647 + i32.and + i32.store offset=4 + end + end + local.get $3 + i32.const 4 + i32.add + local.set $3 + br $repeat|0 + end + end + local.get $2 + global.set $~lib/rt/pure/CUR + local.get $5 + local.set $0 + loop $repeat|1 + block $break|1 + local.get $0 + local.get $2 + i32.ge_u + br_if $break|1 + local.get $0 + i32.load + call $~lib/rt/pure/scan + local.get $0 + i32.const 4 + i32.add + local.set $0 + br $repeat|1 + end + end + local.get $5 + local.set $0 + loop $repeat|2 + block $break|2 + local.get $0 + local.get $2 + i32.ge_u + br_if $break|2 + local.get $0 + i32.load + local.tee $1 + local.get $1 + i32.load offset=4 + i32.const 2147483647 + i32.and + i32.store offset=4 + local.get $1 + call $~lib/rt/pure/collectWhite + local.get $0 + i32.const 4 + i32.add + local.set $0 + br $repeat|2 + end + end + local.get $5 + global.set $~lib/rt/pure/CUR + ) + (func $start (; 26 ;) (type $FUNCSIG$v) + i32.const 0 + i32.const 3 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + call $~lib/rt/pure/__release + ) + (func $~lib/rt/pure/__visit (; 27 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + local.get $0 + i32.const 292 + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $0 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + local.get $1 + i32.const 1 + i32.ne + if + local.get $1 + i32.const 2 + i32.eq + br_if $case1|0 + block $tablify|0 + local.get $1 + i32.const 3 + i32.sub + br_table $case2|0 $case3|0 $case4|0 $tablify|0 + end + br $case5|0 + end + local.get $0 + call $~lib/rt/pure/decrement + br $break|0 + end + local.get $0 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 128 + i32.const 75 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $0 + call $~lib/rt/pure/markGray + br $break|0 + end + local.get $0 + call $~lib/rt/pure/scan + br $break|0 + end + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const -268435456 + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne + if + i32.const 0 + i32.const 128 + i32.const 86 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $1 + i32.const 1879048192 + i32.and + if + local.get $0 + call $~lib/rt/pure/scanBlack + end + br $break|0 + end + local.get $0 + call $~lib/rt/pure/collectWhite + br $break|0 + end + i32.const 0 + i32.const 128 + i32.const 97 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/__visit_members (; 28 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + block $switch$1$default + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$case$2 $switch$1$default + end + return + end + local.get $0 + i32.load + local.tee $0 + if + local.get $0 + local.get $1 + call $~lib/rt/pure/__visit + end + return + end + unreachable + ) + (func $null (; 29 ;) (type $FUNCSIG$v) + nop + ) +) diff --git a/tests/compiler/rc/rereturn.ts b/tests/compiler/rc/rereturn.ts new file mode 100644 index 0000000000..bbf060bbad --- /dev/null +++ b/tests/compiler/rc/rereturn.ts @@ -0,0 +1,13 @@ +// Validates that skipped autorelease state is preserved accross calls and returns. + +class Ref {} + +function getRef(): Ref { + return new Ref(); +} + +function rereturnRef(): Ref { + return getRef(); +} + +/* __release( */ rereturnRef() /* ) */; diff --git a/tests/compiler/rc/rereturn.untouched.wat b/tests/compiler/rc/rereturn.untouched.wat new file mode 100644 index 0000000000..4e97d97399 --- /dev/null +++ b/tests/compiler/rc/rereturn.untouched.wat @@ -0,0 +1,3635 @@ +(module + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$i (func (result i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (memory $0 1) + (data (i32.const 8) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 56) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 112) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s\00") + (data (i32.const 160) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 216) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s\00") + (data (i32.const 256) "\04\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) + (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/rt/__rtti_base i32 (i32.const 256)) + (global $~lib/heap/__heap_base i32 (i32.const 292)) + (export "memory" (memory $0)) + (export "__alloc" (func $~lib/rt/tlsf/__alloc)) + (export "__retain" (func $~lib/rt/pure/__retain)) + (export "__release" (func $~lib/rt/pure/__release)) + (export "__collect" (func $~lib/rt/pure/__collect)) + (export "__rtti_base" (global $~lib/rt/__rtti_base)) + (start $start) + (func $~lib/rt/tlsf/removeBlock (; 1 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 276 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $3 + local.get $3 + i32.const 16 + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 278 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 + local.get $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) + local.get $5 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 291 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end + local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $9 + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $8 + local.get $4 + local.set $11 + local.get $9 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $9 + local.set $10 + local.get $8 + local.get $11 + i32.const 2 + i32.shl + i32.add + local.get $10 + i32.store offset=4 + end + local.get $9 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 2 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 204 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 206 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 + i32.const 1 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end + local.get $2 + i32.const 2 + i32.and + if + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 4 + i32.sub + i32.load + end + local.set $6 + local.get $6 + i32.load + local.set $3 + local.get $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 227 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $6 + call $~lib/rt/tlsf/removeBlock + local.get $6 + local.get $3 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $6 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $8 + i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 243 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $8 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 259 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $7 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $7 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $0 + local.set $12 + local.get $9 + local.set $7 + local.get $10 + local.set $3 + local.get $1 + local.set $6 + local.get $12 + local.get $7 + i32.const 4 + i32.shl + local.get $3 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + end + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $0 + local.set $13 + local.get $9 + local.set $12 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + end + ) + (func $~lib/rt/tlsf/addMemory (; 3 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + local.get $2 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 385 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 395 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 407 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 4 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + memory.size + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end + block $break|0 + i32.const 0 + local.set $5 + loop $repeat|0 + local.get $5 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $3 + local.set $7 + local.get $5 + local.set $6 + i32.const 0 + local.set $4 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $7 + loop $repeat|1 + local.get $7 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $3 + local.set $9 + local.get $5 + local.set $8 + local.get $7 + local.set $6 + i32.const 0 + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store offset=96 + end + local.get $7 + i32.const 1 + i32.add + local.set $7 + br $repeat|1 + unreachable + end + unreachable + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 72 + i32.const 24 + i32.const 447 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 337 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + i32.const 0 + local.set $7 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $5 + local.get $5 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $5 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $4 + local.get $8 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 350 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 7 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + memory.size + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + memory.grow + i32.const 0 + i32.lt_s + if + local.get $3 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + memory.size + local.set $7 + local.get $0 + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (; 8 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 364 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 477 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 479 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/rt/pure/increment (; 11 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 107 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/pure/__retain (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment + end + local.get $0 + ) + (func $~lib/rt/tlsf/freeBlock (; 13 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 531 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/__typeinfo (; 14 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/rt/__rtti_base + local.set $1 + local.get $0 + local.get $1 + i32.load + i32.gt_u + if + i32.const 176 + i32.const 232 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 4 + i32.add + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/util/memory/memcpy (; 15 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + block $break|0 + loop $continue|0 + local.get $2 + if (result i32) + local.get $1 + i32.const 3 + i32.and + else + i32.const 0 + end + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $continue|0 + end + end + end + local.get $0 + i32.const 3 + i32.and + i32.const 0 + i32.eq + if + block $break|1 + loop $continue|1 + local.get $2 + i32.const 16 + i32.ge_u + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 8 + i32.add + i32.load + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 12 + i32.add + i32.load + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|1 + end + end + end + local.get $2 + i32.const 8 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + end + local.get $2 + i32.const 4 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.set $0 + local.get $1 + i32.const 4 + i32.add + local.set $1 + end + local.get $2 + i32.const 2 + i32.and + if + local.get $0 + local.get $1 + i32.load16_u + i32.store16 + local.get $0 + i32.const 2 + i32.add + local.set $0 + local.get $1 + i32.const 2 + i32.add + local.set $1 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + return + end + local.get $2 + i32.const 32 + i32.ge_u + if + block $break|2 + block $case2|2 + block $case1|2 + block $case0|2 + local.get $0 + i32.const 3 + i32.and + local.set $5 + local.get $5 + i32.const 1 + i32.eq + br_if $case0|2 + local.get $5 + i32.const 2 + i32.eq + br_if $case1|2 + local.get $5 + i32.const 3 + i32.eq + br_if $case2|2 + br $break|2 + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 3 + i32.sub + local.set $2 + block $break|3 + loop $continue|3 + local.get $2 + i32.const 17 + i32.ge_u + if + local.get $1 + i32.const 1 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 5 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 9 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 13 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|3 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + block $break|4 + loop $continue|4 + local.get $2 + i32.const 18 + i32.ge_u + if + local.get $1 + i32.const 2 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 6 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 10 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 14 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|4 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + block $break|5 + loop $continue|5 + local.get $2 + i32.const 19 + i32.ge_u + if + local.get $1 + i32.const 3 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 7 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 11 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 15 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|5 + end + end + end + br $break|2 + unreachable + end + unreachable + end + end + local.get $2 + i32.const 16 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 8 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 4 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 2 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + ) + (func $~lib/memory/memory.copy (; 16 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $4 + local.get $3 + i32.add + local.get $5 + i32.le_u + if (result i32) + i32.const 1 + else + local.get $5 + local.get $3 + i32.add + local.get $4 + i32.le_u + end + if + local.get $5 + local.get $4 + local.get $3 + call $~lib/util/memory/memcpy + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/rt/tlsf/__free (; 17 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 561 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 562 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/growRoots (; 18 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/pure/ROOTS + local.set $0 + global.get $~lib/rt/pure/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $0 + if + local.get $0 + call $~lib/rt/tlsf/__free + end + local.get $5 + global.set $~lib/rt/pure/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/pure/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/pure/END + ) + (func $~lib/rt/pure/appendRoot (; 19 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/pure/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 4 + i32.add + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/decrement (; 20 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 115 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/rt/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 124 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 16 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/pure/__release (; 21 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + end + ) + (func $~lib/rt/pure/markGray (; 22 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members + end + ) + (func $~lib/rt/pure/scanBlack (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + ) + (func $~lib/rt/pure/__collect (; 26 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/pure/ROOTS + local.set $0 + local.get $0 + local.set $1 + block $break|0 + block + local.get $1 + local.set $2 + global.get $~lib/rt/pure/CUR + local.set $3 + end + loop $repeat|0 + local.get $2 + local.get $3 + i32.lt_u + i32.eqz + br_if $break|0 + local.get $2 + i32.load + local.set $4 + local.get $4 + i32.load offset=4 + local.set $5 + local.get $5 + i32.const 1879048192 + i32.and + i32.const 805306368 + i32.eq + if (result i32) + local.get $5 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + else + i32.const 0 + end + if + local.get $4 + call $~lib/rt/pure/markGray + local.get $1 + local.get $4 + i32.store + local.get $1 + i32.const 4 + i32.add + local.set $1 + else + local.get $5 + i32.const 1879048192 + i32.and + i32.const 0 + i32.eq + if (result i32) + local.get $5 + i32.const 268435455 + i32.and + i32.eqz + else + i32.const 0 + end + if + global.get $~lib/rt/tlsf/ROOT + local.get $4 + call $~lib/rt/tlsf/freeBlock + else + local.get $4 + local.get $5 + i32.const -2147483648 + i32.const -1 + i32.xor + i32.and + i32.store offset=4 + end + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + global.set $~lib/rt/pure/CUR + block $break|1 + local.get $0 + local.set $5 + loop $repeat|1 + local.get $5 + local.get $1 + i32.lt_u + i32.eqz + br_if $break|1 + local.get $5 + i32.load + call $~lib/rt/pure/scan + local.get $5 + i32.const 4 + i32.add + local.set $5 + br $repeat|1 + unreachable + end + unreachable + end + block $break|2 + local.get $0 + local.set $5 + loop $repeat|2 + local.get $5 + local.get $1 + i32.lt_u + i32.eqz + br_if $break|2 + local.get $5 + i32.load + local.set $4 + local.get $4 + local.get $4 + i32.load offset=4 + i32.const -2147483648 + i32.const -1 + i32.xor + i32.and + i32.store offset=4 + local.get $4 + call $~lib/rt/pure/collectWhite + local.get $5 + i32.const 4 + i32.add + local.set $5 + br $repeat|2 + unreachable + end + unreachable + end + local.get $0 + global.set $~lib/rt/pure/CUR + ) + (func $rc/rereturn/Ref#constructor (; 27 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 0 + i32.const 3 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $0 + end + local.get $0 + ) + (func $rc/rereturn/getRef (; 28 ;) (type $FUNCSIG$i) (result i32) + i32.const 0 + call $rc/rereturn/Ref#constructor + ) + (func $rc/rereturn/rereturnRef (; 29 ;) (type $FUNCSIG$i) (result i32) + call $rc/rereturn/getRef + ) + (func $start:rc/rereturn (; 30 ;) (type $FUNCSIG$v) + call $rc/rereturn/rereturnRef + call $~lib/rt/pure/__release + ) + (func $start (; 31 ;) (type $FUNCSIG$v) + call $start:rc/rereturn + ) + (func $~lib/rt/pure/__visit (; 32 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/pure/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 75 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/pure/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 86 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/pure/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 97 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + end + ) + (func $~lib/rt/__visit_members (; 33 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block + end + block $switch$1$leave + block $switch$1$default + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$case$2 $switch$1$default + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + ) + (func $null (; 34 ;) (type $FUNCSIG$v) + ) +) diff --git a/tests/compiler/rc/ternary-mismatch.json b/tests/compiler/rc/ternary-mismatch.json new file mode 100644 index 0000000000..9f7878d475 --- /dev/null +++ b/tests/compiler/rc/ternary-mismatch.json @@ -0,0 +1,6 @@ +{ + "asc_flags": [ + "--runtime half", + "--use ASC_RTRACE=1" + ] +} \ No newline at end of file diff --git a/tests/compiler/rc/ternary-mismatch.optimized.wat b/tests/compiler/rc/ternary-mismatch.optimized.wat new file mode 100644 index 0000000000..9bf6e0e474 --- /dev/null +++ b/tests/compiler/rc/ternary-mismatch.optimized.wat @@ -0,0 +1,1785 @@ +(module + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$i (func (result i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32))) + (import "rtrace" "onincrement" (func $~lib/rt/rtrace/onincrement (param i32))) + (import "rtrace" "ondecrement" (func $~lib/rt/rtrace/ondecrement (param i32))) + (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) + (memory $0 1) + (data (i32.const 8) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s") + (data (i32.const 56) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e") + (data (i32.const 112) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s") + (data (i32.const 160) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e") + (data (i32.const 216) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s") + (data (i32.const 256) "\04\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10") + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $rc/ternary-mismatch/gloRef (mut i32) (i32.const 0)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) + (export "memory" (memory $0)) + (export "test1" (func $rc/ternary-mismatch/test1)) + (export "test2" (func $rc/ternary-mismatch/test2)) + (start $start) + (func $~lib/rt/tlsf/removeBlock (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.tee $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 276 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const -4 + i32.and + local.tee $2 + i32.const 16 + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 278 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 256 + i32.lt_u + if (result i32) + local.get $2 + i32.const 4 + i32.shr_u + local.set $2 + i32.const 0 + else + local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $3 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $2 + local.get $3 + i32.const 7 + i32.sub + end + local.tee $3 + i32.const 23 + i32.lt_u + if (result i32) + local.get $2 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 291 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=20 + local.set $4 + local.get $1 + i32.load offset=16 + local.tee $5 + if + local.get $5 + local.get $4 + i32.store offset=20 + end + local.get $4 + if + local.get $4 + local.get $5 + i32.store offset=16 + end + local.get $3 + i32.const 4 + i32.shl + local.get $2 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + local.get $1 + i32.eq + if + local.get $3 + i32.const 4 + i32.shl + local.get $2 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $4 + i32.store offset=96 + local.get $4 + i32.eqz + if + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const 1 + local.get $2 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.store offset=4 + local.get $1 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $3 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 6 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 204 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.tee $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 206 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.tee $5 + i32.const 1 + i32.and + if + local.get $3 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const -4 + i32.and + i32.add + local.tee $2 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $3 + i32.const 3 + i32.and + local.get $2 + i32.or + local.tee $3 + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.set $5 + end + end + local.get $3 + i32.const 2 + i32.and + if + local.get $1 + i32.const 4 + i32.sub + i32.load + local.tee $2 + i32.load + local.tee $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 227 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $3 + i32.const -4 + i32.and + i32.add + local.tee $7 + i32.const 1073741808 + i32.lt_u + if (result i32) + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $2 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $3 + i32.store + local.get $2 + else + local.get $1 + end + local.set $1 + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $3 + i32.const -4 + i32.and + local.tee $2 + i32.const 16 + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 243 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $2 + i32.const 256 + i32.lt_u + if (result i32) + local.get $2 + i32.const 4 + i32.shr_u + local.set $4 + i32.const 0 + else + local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $4 + local.get $2 + i32.const 7 + i32.sub + end + local.tee $3 + i32.const 23 + i32.lt_u + if (result i32) + local.get $4 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 259 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + local.set $2 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $2 + i32.store offset=20 + local.get $2 + if + local.get $2 + local.get $1 + i32.store offset=16 + end + local.get $3 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $1 + i32.store offset=96 + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $3 + i32.shl + i32.or + i32.store + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const 1 + local.get $4 + i32.shl + i32.or + i32.store offset=4 + ) + (func $~lib/rt/tlsf/addMemory (; 7 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $1 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $1 + local.get $2 + i32.le_u + select + select + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 385 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=1568 + local.tee $3 + if + local.get $1 + local.get $3 + i32.const 16 + i32.add + i32.lt_u + if + i32.const 0 + i32.const 24 + i32.const 395 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $3 + i32.eq + if + local.get $3 + i32.load + local.set $4 + local.get $1 + i32.const 16 + i32.sub + local.set $1 + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.lt_u + if + i32.const 0 + i32.const 24 + i32.const 407 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.tee $2 + i32.const 48 + i32.lt_u + if + return + end + local.get $1 + local.get $4 + i32.const 2 + i32.and + local.get $2 + i32.const 32 + i32.sub + i32.const 1 + i32.or + i32.or + i32.store + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $2 + i32.add + i32.const 16 + i32.sub + local.tee $2 + i32.const 2 + i32.store + local.get $0 + local.get $2 + i32.store offset=1568 + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/tlsf/initializeRoot (; 8 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 1 + memory.size + local.tee $0 + i32.gt_s + if (result i32) + i32.const 1 + local.get $0 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + i32.const 304 + i32.const 0 + i32.store + i32.const 1872 + i32.const 0 + i32.store + i32.const 0 + local.set $0 + loop $repeat|0 + block $break|0 + local.get $0 + i32.const 23 + i32.ge_u + br_if $break|0 + local.get $0 + i32.const 2 + i32.shl + i32.const 304 + i32.add + i32.const 0 + i32.store offset=4 + i32.const 0 + local.set $1 + loop $repeat|1 + block $break|1 + local.get $1 + i32.const 16 + i32.ge_u + br_if $break|1 + local.get $0 + i32.const 4 + i32.shl + local.get $1 + i32.add + i32.const 2 + i32.shl + i32.const 304 + i32.add + i32.const 0 + i32.store offset=96 + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|1 + end + end + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + end + i32.const 304 + i32.const 1888 + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + i32.const 304 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 72 + i32.const 24 + i32.const 447 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const -16 + i32.and + local.tee $0 + i32.const 16 + local.get $0 + i32.const 16 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + i32.const 256 + i32.lt_u + if (result i32) + local.get $1 + i32.const 4 + i32.shr_u + local.set $1 + i32.const 0 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + local.get $1 + i32.add + i32.const 1 + i32.sub + local.set $1 + end + local.get $1 + i32.const 31 + local.get $1 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $1 + local.get $2 + i32.const 7 + i32.sub + end + local.tee $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $1 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 337 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const -1 + local.get $1 + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $1 + i32.ctz + local.get $2 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + else + local.get $0 + i32.load + i32.const -1 + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $1 + i32.ctz + local.tee $1 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 350 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.ctz + local.get $1 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + else + i32.const 0 + end + end + ) + (func $~lib/rt/tlsf/growMemory (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + memory.size + local.tee $2 + local.get $1 + i32.const 65535 + i32.add + i32.const -65536 + i32.and + i32.const 16 + i32.shr_u + local.tee $1 + local.get $2 + local.get $1 + i32.gt_s + select + memory.grow + i32.const 0 + i32.lt_s + if + local.get $1 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + local.get $0 + local.get $2 + i32.const 16 + i32.shl + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + ) + (func $~lib/rt/tlsf/prepareBlock (; 12 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + if + i32.const 0 + i32.const 24 + i32.const 364 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const -4 + i32.and + local.get $2 + i32.sub + local.tee $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $3 + i32.const 2 + i32.and + local.get $2 + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.tee $1 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const -2 + i32.and + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + i32.load + i32.const -3 + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.tee $3 + call $~lib/rt/tlsf/searchBlock + local.tee $2 + i32.eqz + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $3 + call $~lib/rt/tlsf/searchBlock + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 477 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + i32.load + i32.const -4 + i32.and + local.get $3 + i32.lt_u + if + i32.const 0 + i32.const 24 + i32.const 479 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 0 + i32.store offset=4 + local.get $2 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $2 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $2 + call $~lib/rt/rtrace/onalloc + local.get $2 + ) + (func $~lib/rt/tlsf/__alloc (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + global.get $~lib/rt/tlsf/ROOT + local.tee $2 + if (result i32) + local.get $2 + else + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + end + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.tee $0 + local.get $1 + i32.store offset=8 + local.get $0 + i32.const 16 + i32.add + ) + (func $~lib/rt/pure/increment (; 15 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const -268435456 + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne + if + i32.const 0 + i32.const 128 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/rtrace/onincrement + local.get $0 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 128 + i32.const 107 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/pure/__retain (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 292 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment + end + local.get $0 + ) + (func $rc/ternary-mismatch/Ref#constructor (; 17 ;) (type $FUNCSIG$i) (result i32) + i32.const 0 + i32.const 3 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + ) + (func $rc/ternary-mismatch/test1 (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + if (result i32) + call $rc/ternary-mismatch/Ref#constructor + else + global.get $rc/ternary-mismatch/gloRef + call $~lib/rt/pure/__retain + end + ) + (func $~lib/rt/tlsf/freeBlock (; 19 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.tee $2 + i32.const 1 + i32.and + if + i32.const 0 + i32.const 24 + i32.const 531 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/rtrace/onfree + ) + (func $~lib/rt/__typeinfo (; 20 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 256 + i32.load + i32.gt_u + if + i32.const 176 + i32.const 232 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 3 + i32.shl + i32.const 260 + i32.add + i32.load + ) + (func $~lib/memory/memory.copy (; 21 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $2 + local.set $3 + local.get $0 + local.get $1 + i32.eq + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $1 + i32.lt_u + if + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|0 + local.get $0 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + br $continue|0 + end + end + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $1 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + br $continue|1 + end + end + end + loop $continue|2 + local.get $3 + if + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + else + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|3 + local.get $0 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $3 + i32.const 8 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + loop $continue|5 + local.get $3 + if + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + ) + (func $~lib/rt/tlsf/__free (; 22 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 561 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $0 + select + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 562 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/growRoots (; 23 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/pure/CUR + global.get $~lib/rt/pure/ROOTS + local.tee $1 + i32.sub + local.tee $2 + i32.const 1 + i32.shl + local.tee $0 + i32.const 256 + local.get $0 + i32.const 256 + i32.gt_u + select + local.tee $3 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.tee $0 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onfree + local.get $0 + local.get $1 + local.get $2 + call $~lib/memory/memory.copy + local.get $1 + if + local.get $1 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onalloc + local.get $1 + call $~lib/rt/tlsf/__free + end + local.get $0 + global.set $~lib/rt/pure/ROOTS + local.get $0 + local.get $2 + i32.add + global.set $~lib/rt/pure/CUR + local.get $0 + local.get $3 + i32.add + global.set $~lib/rt/pure/END + ) + (func $~lib/rt/pure/appendRoot (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/pure/CUR + local.tee $1 + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 4 + i32.add + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/decrement (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.tee $2 + i32.const 268435455 + i32.and + local.set $1 + local.get $0 + call $~lib/rt/rtrace/ondecrement + local.get $0 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 128 + i32.const 115 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/rt/__visit_members + local.get $2 + i32.const -2147483648 + i32.and + if + local.get $0 + i32.const -2147483648 + i32.store offset=4 + else + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + else + local.get $1 + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 128 + i32.const 124 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 16 + i32.and + if + local.get $0 + local.get $1 + i32.const 1 + i32.sub + local.get $2 + i32.const -268435456 + i32.and + i32.or + i32.store offset=4 + else + local.get $0 + local.get $1 + i32.const 1 + i32.sub + i32.const -1342177280 + i32.or + i32.store offset=4 + local.get $2 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/appendRoot + end + end + end + ) + (func $~lib/rt/pure/__release (; 26 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + i32.const 292 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + end + ) + (func $rc/ternary-mismatch/test2 (; 27 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + if (result i32) + global.get $rc/ternary-mismatch/gloRef + call $~lib/rt/pure/__retain + else + call $rc/ternary-mismatch/Ref#constructor + end + ) + (func $start:rc/ternary-mismatch (; 28 ;) (type $FUNCSIG$v) + call $rc/ternary-mismatch/Ref#constructor + global.set $rc/ternary-mismatch/gloRef + i32.const 1 + call $rc/ternary-mismatch/test1 + call $~lib/rt/pure/__release + i32.const 0 + call $rc/ternary-mismatch/test1 + call $~lib/rt/pure/__release + i32.const 1 + call $rc/ternary-mismatch/test2 + call $~lib/rt/pure/__release + i32.const 0 + call $rc/ternary-mismatch/test2 + call $~lib/rt/pure/__release + global.get $rc/ternary-mismatch/gloRef + call $~lib/rt/pure/__release + ) + (func $start (; 29 ;) (type $FUNCSIG$v) + call $start:rc/ternary-mismatch + ) + (func $~lib/rt/pure/markGray (; 30 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members + end + ) + (func $~lib/rt/pure/scanBlack (; 31 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 32 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (; 33 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + ) + (func $~lib/rt/pure/__visit (; 34 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + local.get $0 + i32.const 292 + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $0 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + local.get $1 + i32.const 1 + i32.ne + if + local.get $1 + i32.const 2 + i32.eq + br_if $case1|0 + block $tablify|0 + local.get $1 + i32.const 3 + i32.sub + br_table $case2|0 $case3|0 $case4|0 $tablify|0 + end + br $case5|0 + end + local.get $0 + call $~lib/rt/pure/decrement + br $break|0 + end + local.get $0 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 128 + i32.const 75 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $0 + call $~lib/rt/pure/markGray + br $break|0 + end + local.get $0 + call $~lib/rt/pure/scan + br $break|0 + end + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const -268435456 + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne + if + i32.const 0 + i32.const 128 + i32.const 86 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $1 + i32.const 1879048192 + i32.and + if + local.get $0 + call $~lib/rt/pure/scanBlack + end + br $break|0 + end + local.get $0 + call $~lib/rt/pure/collectWhite + br $break|0 + end + i32.const 0 + i32.const 128 + i32.const 97 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/__visit_members (; 35 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + block $switch$1$default + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$case$2 $switch$1$default + end + return + end + local.get $0 + i32.load + local.tee $0 + if + local.get $0 + local.get $1 + call $~lib/rt/pure/__visit + end + return + end + unreachable + ) + (func $null (; 36 ;) (type $FUNCSIG$v) + nop + ) +) diff --git a/tests/compiler/rc/ternary-mismatch.ts b/tests/compiler/rc/ternary-mismatch.ts new file mode 100644 index 0000000000..efc51fe182 --- /dev/null +++ b/tests/compiler/rc/ternary-mismatch.ts @@ -0,0 +1,30 @@ +// Validates that an autorelease mismatch in the arms of a ternary expression +// is correctly resolved by lifting the respective other. + +class Ref {} + +function getRef(): Ref { + return new Ref(); +} + +var gloRef = new Ref(); + +export function test1(b: bool): Ref | null { + // ifThen skips autorelease, ifElse doesn't + return b ? getRef() : /* __retain( */ gloRef /* ) */; +} + +/* __release( */ test1(true) /* ) */; +/* __release( */ test1(false) /* ) */; + +export function test2(b: bool): Ref | null { + // ifElse skips autorelease, ifThen doesn't + return b ? /* __retain( */ gloRef /* ) */ : getRef(); +} + +/* __release( */ test2(true) /* ) */; +/* __release( */ test2(false) /* ) */; + +// Unleak + +__release(changetype(gloRef)); diff --git a/tests/compiler/rc/ternary-mismatch.untouched.wat b/tests/compiler/rc/ternary-mismatch.untouched.wat new file mode 100644 index 0000000000..7c15cab12b --- /dev/null +++ b/tests/compiler/rc/ternary-mismatch.untouched.wat @@ -0,0 +1,3535 @@ +(module + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$i (func (result i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32))) + (import "rtrace" "onincrement" (func $~lib/rt/rtrace/onincrement (param i32))) + (import "rtrace" "ondecrement" (func $~lib/rt/rtrace/ondecrement (param i32))) + (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) + (memory $0 1) + (data (i32.const 8) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 56) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 112) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s\00") + (data (i32.const 160) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 216) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s\00") + (data (i32.const 256) "\04\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $rc/ternary-mismatch/gloRef (mut i32) (i32.const 0)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) + (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/rt/__rtti_base i32 (i32.const 256)) + (global $~lib/heap/__heap_base i32 (i32.const 292)) + (export "memory" (memory $0)) + (export "test1" (func $rc/ternary-mismatch/test1)) + (export "test2" (func $rc/ternary-mismatch/test2)) + (start $start) + (func $~lib/rt/tlsf/removeBlock (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 276 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $3 + local.get $3 + i32.const 16 + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 278 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 + local.get $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) + local.get $5 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 291 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end + local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $9 + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $8 + local.get $4 + local.set $11 + local.get $9 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $9 + local.set $10 + local.get $8 + local.get $11 + i32.const 2 + i32.shl + i32.add + local.get $10 + i32.store offset=4 + end + local.get $9 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 6 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 204 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 206 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 + i32.const 1 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end + local.get $2 + i32.const 2 + i32.and + if + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 4 + i32.sub + i32.load + end + local.set $6 + local.get $6 + i32.load + local.set $3 + local.get $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 227 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $6 + call $~lib/rt/tlsf/removeBlock + local.get $6 + local.get $3 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $6 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $8 + i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 243 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $8 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 259 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $7 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $7 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $0 + local.set $12 + local.get $9 + local.set $7 + local.get $10 + local.set $3 + local.get $1 + local.set $6 + local.get $12 + local.get $7 + i32.const 4 + i32.shl + local.get $3 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + end + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $0 + local.set $13 + local.get $9 + local.set $12 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + end + ) + (func $~lib/rt/tlsf/addMemory (; 7 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + local.get $2 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 385 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 395 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 407 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 8 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + memory.size + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end + block $break|0 + i32.const 0 + local.set $5 + loop $repeat|0 + local.get $5 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $3 + local.set $7 + local.get $5 + local.set $6 + i32.const 0 + local.set $4 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $7 + loop $repeat|1 + local.get $7 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $3 + local.set $9 + local.get $5 + local.set $8 + local.get $7 + local.set $6 + i32.const 0 + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store offset=96 + end + local.get $7 + i32.const 1 + i32.add + local.set $7 + br $repeat|1 + unreachable + end + unreachable + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 72 + i32.const 24 + i32.const 447 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 337 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + i32.const 0 + local.set $7 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $5 + local.get $5 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $5 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $4 + local.get $8 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 350 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + memory.size + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + memory.grow + i32.const 0 + i32.lt_s + if + local.get $3 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + memory.size + local.set $7 + local.get $0 + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (; 12 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 364 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 477 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 479 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + call $~lib/rt/rtrace/onalloc + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/rt/pure/increment (; 15 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/rtrace/onincrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 107 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/pure/__retain (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment + end + local.get $0 + ) + (func $rc/ternary-mismatch/Ref#constructor (; 17 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 0 + i32.const 3 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $0 + end + local.get $0 + ) + (func $rc/ternary-mismatch/getRef (; 18 ;) (type $FUNCSIG$i) (result i32) + i32.const 0 + call $rc/ternary-mismatch/Ref#constructor + ) + (func $rc/ternary-mismatch/test1 (; 19 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + if (result i32) + call $rc/ternary-mismatch/getRef + else + global.get $rc/ternary-mismatch/gloRef + call $~lib/rt/pure/__retain + end + ) + (func $~lib/rt/tlsf/freeBlock (; 20 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 531 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/rtrace/onfree + ) + (func $~lib/rt/__typeinfo (; 21 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/rt/__rtti_base + local.set $1 + local.get $0 + local.get $1 + i32.load + i32.gt_u + if + i32.const 176 + i32.const 232 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 4 + i32.add + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/util/memory/memcpy (; 22 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + block $break|0 + loop $continue|0 + local.get $2 + if (result i32) + local.get $1 + i32.const 3 + i32.and + else + i32.const 0 + end + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $continue|0 + end + end + end + local.get $0 + i32.const 3 + i32.and + i32.const 0 + i32.eq + if + block $break|1 + loop $continue|1 + local.get $2 + i32.const 16 + i32.ge_u + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 8 + i32.add + i32.load + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 12 + i32.add + i32.load + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|1 + end + end + end + local.get $2 + i32.const 8 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + end + local.get $2 + i32.const 4 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.set $0 + local.get $1 + i32.const 4 + i32.add + local.set $1 + end + local.get $2 + i32.const 2 + i32.and + if + local.get $0 + local.get $1 + i32.load16_u + i32.store16 + local.get $0 + i32.const 2 + i32.add + local.set $0 + local.get $1 + i32.const 2 + i32.add + local.set $1 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + return + end + local.get $2 + i32.const 32 + i32.ge_u + if + block $break|2 + block $case2|2 + block $case1|2 + block $case0|2 + local.get $0 + i32.const 3 + i32.and + local.set $5 + local.get $5 + i32.const 1 + i32.eq + br_if $case0|2 + local.get $5 + i32.const 2 + i32.eq + br_if $case1|2 + local.get $5 + i32.const 3 + i32.eq + br_if $case2|2 + br $break|2 + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 3 + i32.sub + local.set $2 + block $break|3 + loop $continue|3 + local.get $2 + i32.const 17 + i32.ge_u + if + local.get $1 + i32.const 1 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 5 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 9 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 13 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|3 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + block $break|4 + loop $continue|4 + local.get $2 + i32.const 18 + i32.ge_u + if + local.get $1 + i32.const 2 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 6 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 10 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 14 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|4 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + block $break|5 + loop $continue|5 + local.get $2 + i32.const 19 + i32.ge_u + if + local.get $1 + i32.const 3 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 7 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 11 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 15 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|5 + end + end + end + br $break|2 + unreachable + end + unreachable + end + end + local.get $2 + i32.const 16 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 8 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 4 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 2 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + ) + (func $~lib/memory/memory.copy (; 23 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $4 + local.get $3 + i32.add + local.get $5 + i32.le_u + if (result i32) + i32.const 1 + else + local.get $5 + local.get $3 + i32.add + local.get $4 + i32.le_u + end + if + local.get $5 + local.get $4 + local.get $3 + call $~lib/util/memory/memcpy + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/rt/tlsf/__free (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 561 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 562 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/growRoots (; 25 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/pure/ROOTS + local.set $0 + global.get $~lib/rt/pure/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onfree + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $0 + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onalloc + local.get $0 + call $~lib/rt/tlsf/__free + end + local.get $5 + global.set $~lib/rt/pure/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/pure/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/pure/END + ) + (func $~lib/rt/pure/appendRoot (; 26 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/pure/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 4 + i32.add + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/decrement (; 27 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + call $~lib/rt/rtrace/ondecrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 115 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/rt/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 124 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 16 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/pure/__release (; 28 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + end + ) + (func $rc/ternary-mismatch/test2 (; 29 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + if (result i32) + global.get $rc/ternary-mismatch/gloRef + call $~lib/rt/pure/__retain + else + call $rc/ternary-mismatch/getRef + end + ) + (func $start:rc/ternary-mismatch (; 30 ;) (type $FUNCSIG$v) + i32.const 0 + call $rc/ternary-mismatch/Ref#constructor + global.set $rc/ternary-mismatch/gloRef + i32.const 1 + call $rc/ternary-mismatch/test1 + call $~lib/rt/pure/__release + i32.const 0 + call $rc/ternary-mismatch/test1 + call $~lib/rt/pure/__release + i32.const 1 + call $rc/ternary-mismatch/test2 + call $~lib/rt/pure/__release + i32.const 0 + call $rc/ternary-mismatch/test2 + call $~lib/rt/pure/__release + global.get $rc/ternary-mismatch/gloRef + call $~lib/rt/pure/__release + ) + (func $start (; 31 ;) (type $FUNCSIG$v) + call $start:rc/ternary-mismatch + ) + (func $~lib/rt/pure/markGray (; 32 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members + end + ) + (func $~lib/rt/pure/scanBlack (; 33 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 34 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (; 35 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + ) + (func $~lib/rt/pure/__visit (; 36 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/pure/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 75 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/pure/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 86 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/pure/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 97 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + end + ) + (func $~lib/rt/__visit_members (; 37 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block + end + block $switch$1$leave + block $switch$1$default + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$case$2 $switch$1$default + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + ) + (func $null (; 38 ;) (type $FUNCSIG$v) + ) +) diff --git a/tests/compiler/recursive.json b/tests/compiler/recursive.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/recursive.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/recursive.optimized.wat b/tests/compiler/recursive.optimized.wat index 70374ac5e9..8be1699992 100644 --- a/tests/compiler/recursive.optimized.wat +++ b/tests/compiler/recursive.optimized.wat @@ -2,10 +2,7 @@ (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$v (func)) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $null) (export "memory" (memory $0)) - (export "table" (table $0)) (export "fib" (func $recursive/fib)) (func $recursive/fib (; 0 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 diff --git a/tests/compiler/recursive.untouched.wat b/tests/compiler/recursive.untouched.wat index 432e9ee8e4..daf56987dc 100644 --- a/tests/compiler/recursive.untouched.wat +++ b/tests/compiler/recursive.untouched.wat @@ -4,9 +4,7 @@ (memory $0 0) (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "fib" (func $recursive/fib)) (func $recursive/fib (; 0 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 diff --git a/tests/compiler/reexport.json b/tests/compiler/reexport.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/reexport.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/reexport.optimized.wat b/tests/compiler/reexport.optimized.wat index 5246631d08..b23b502d0a 100644 --- a/tests/compiler/reexport.optimized.wat +++ b/tests/compiler/reexport.optimized.wat @@ -2,13 +2,10 @@ (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$v (func)) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $export/ns.one) (global $export/a i32 (i32.const 1)) (global $export/b i32 (i32.const 2)) (global $export/c i32 (i32.const 3)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "add" (func $export/add)) (export "renamed_sub" (func $export/sub)) (export "renamed_mul" (func $export/mul)) @@ -20,6 +17,7 @@ (export "renamed_add" (func $export/add)) (export "rerenamed_sub" (func $export/mul)) (export "renamed_ns.two" (func $export/ns.one)) + (start $start) (func $export/add (; 0 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 @@ -38,4 +36,14 @@ (func $export/ns.one (; 3 ;) (type $FUNCSIG$v) nop ) + (func $start (; 4 ;) (type $FUNCSIG$v) + i32.const 1 + i32.const 2 + call $export/add + i32.const 3 + i32.const 4 + call $export/mul + i32.add + drop + ) ) diff --git a/tests/compiler/reexport.untouched.wat b/tests/compiler/reexport.untouched.wat index 057ad25d43..662fe579a4 100644 --- a/tests/compiler/reexport.untouched.wat +++ b/tests/compiler/reexport.untouched.wat @@ -7,9 +7,7 @@ (global $export/a i32 (i32.const 1)) (global $export/b i32 (i32.const 2)) (global $export/c i32 (i32.const 3)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "add" (func $export/add)) (export "renamed_sub" (func $export/sub)) (export "renamed_mul" (func $export/mul)) diff --git a/tests/compiler/rereexport.json b/tests/compiler/rereexport.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/rereexport.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/rereexport.optimized.wat b/tests/compiler/rereexport.optimized.wat index 1139e552a6..306f12dff1 100644 --- a/tests/compiler/rereexport.optimized.wat +++ b/tests/compiler/rereexport.optimized.wat @@ -1,12 +1,9 @@ (module (type $FUNCSIG$v (func)) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $start) (global $export/a i32 (i32.const 1)) (global $export/b i32 (i32.const 2)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "a" (global $export/a)) (export "renamed_a" (global $export/a)) (export "renamed_b" (global $export/b)) diff --git a/tests/compiler/rereexport.untouched.wat b/tests/compiler/rereexport.untouched.wat index a8dee375de..7f469d6e96 100644 --- a/tests/compiler/rereexport.untouched.wat +++ b/tests/compiler/rereexport.untouched.wat @@ -7,9 +7,7 @@ (global $export/a i32 (i32.const 1)) (global $export/b i32 (i32.const 2)) (global $export/c i32 (i32.const 3)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "a" (global $export/a)) (export "renamed_a" (global $export/a)) (export "renamed_b" (global $export/b)) diff --git a/tests/compiler/resolve-nested.json b/tests/compiler/resolve-nested.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/resolve-nested.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/resolve-nested.optimized.wat b/tests/compiler/resolve-nested.optimized.wat index ba434f7178..cf51f7ae97 100644 --- a/tests/compiler/resolve-nested.optimized.wat +++ b/tests/compiler/resolve-nested.optimized.wat @@ -4,10 +4,11 @@ (type $FUNCSIG$viii (func (param i32 i32 i32))) (type $FUNCSIG$v (func)) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $null) + (global $resolve-nested/Outer.InnerClass i32 (i32.const 4)) + (global $resolve-nested/Outer.Inner.EvenInnerClass i32 (i32.const 5)) (export "memory" (memory $0)) - (export "table" (table $0)) + (export "Outer.InnerClass" (global $resolve-nested/Outer.InnerClass)) + (export "Outer.Inner.EvenInnerClass" (global $resolve-nested/Outer.Inner.EvenInnerClass)) (export "Outer.Inner.evenInner" (func $resolve-nested/Outer.Inner.evenInner)) (export "Outer.inner" (func $resolve-nested/Outer.inner)) (export "outer" (func $resolve-nested/outer)) diff --git a/tests/compiler/resolve-nested.untouched.wat b/tests/compiler/resolve-nested.untouched.wat index 9b79543a8e..08e34bd69a 100644 --- a/tests/compiler/resolve-nested.untouched.wat +++ b/tests/compiler/resolve-nested.untouched.wat @@ -1,5 +1,7 @@ (module (type $FUNCSIG$viiiiii (func (param i32 i32 i32 i32 i32 i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$viiiii (func (param i32 i32 i32 i32 i32))) (type $FUNCSIG$viii (func (param i32 i32 i32))) (type $FUNCSIG$v (func)) @@ -20,21 +22,96 @@ (global $resolve-nested/a (mut i32) (i32.const 0)) (global $resolve-nested/b (mut i32) (i32.const 0)) (global $resolve-nested/c (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) + (global $resolve-nested/Outer.InnerClass i32 (i32.const 4)) + (global $resolve-nested/Outer.Inner.EvenInnerClass i32 (i32.const 5)) (export "memory" (memory $0)) - (export "table" (table $0)) + (export "Outer.InnerClass" (global $resolve-nested/Outer.InnerClass)) + (export "Outer.Inner.EvenInnerClass" (global $resolve-nested/Outer.Inner.EvenInnerClass)) (export "Outer.Inner.evenInner" (func $resolve-nested/Outer.Inner.evenInner)) (export "Outer.inner" (func $resolve-nested/Outer.inner)) (export "outer" (func $resolve-nested/outer)) - (func $resolve-nested/Outer.Inner.evenInner (; 0 ;) (type $FUNCSIG$viiiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (param $5 i32) - nop + (func $~lib/rt/stub/__retain (; 0 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 ) - (func $resolve-nested/Outer.inner (; 1 ;) (type $FUNCSIG$viiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) + (func $~lib/rt/stub/__release (; 1 ;) (type $FUNCSIG$vi) (param $0 i32) nop ) - (func $resolve-nested/outer (; 2 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - nop + (func $resolve-nested/Outer.Inner.evenInner (; 2 ;) (type $FUNCSIG$viiiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (param $5 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $1 + call $~lib/rt/stub/__retain + drop + local.get $2 + call $~lib/rt/stub/__retain + drop + local.get $3 + call $~lib/rt/stub/__retain + drop + local.get $4 + call $~lib/rt/stub/__retain + drop + local.get $5 + call $~lib/rt/stub/__retain + drop + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 + call $~lib/rt/stub/__release + local.get $3 + call $~lib/rt/stub/__release + local.get $4 + call $~lib/rt/stub/__release + local.get $5 + call $~lib/rt/stub/__release + ) + (func $resolve-nested/Outer.inner (; 3 ;) (type $FUNCSIG$viiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $1 + call $~lib/rt/stub/__retain + drop + local.get $2 + call $~lib/rt/stub/__retain + drop + local.get $3 + call $~lib/rt/stub/__retain + drop + local.get $4 + call $~lib/rt/stub/__retain + drop + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 + call $~lib/rt/stub/__release + local.get $3 + call $~lib/rt/stub/__release + local.get $4 + call $~lib/rt/stub/__release + ) + (func $resolve-nested/outer (; 4 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $1 + call $~lib/rt/stub/__retain + drop + local.get $2 + call $~lib/rt/stub/__retain + drop + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 + call $~lib/rt/stub/__release ) - (func $null (; 3 ;) (type $FUNCSIG$v) + (func $null (; 5 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/retain-i32.json b/tests/compiler/retain-i32.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/retain-i32.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/retain-i32.optimized.wat b/tests/compiler/retain-i32.optimized.wat index 2578279298..b85b2623b3 100644 --- a/tests/compiler/retain-i32.optimized.wat +++ b/tests/compiler/retain-i32.optimized.wat @@ -1,15 +1,12 @@ (module (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\0d\00\00\00r\00e\00t\00a\00i\00n\00-\00i\003\002\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $null) + (data (i32.const 8) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00r\00e\00t\00a\00i\00n\00-\00i\003\002\00.\00t\00s") (global $retain-i32/si (mut i32) (i32.const 0)) (global $retain-i32/ui (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $start:retain-i32 (; 1 ;) (type $FUNCSIG$v) (local $0 i32) @@ -34,10 +31,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 78 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const -1 @@ -47,10 +44,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 81 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const -2 @@ -60,10 +57,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 84 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const -128 @@ -73,10 +70,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 87 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const -128 @@ -86,10 +83,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 90 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const -127 @@ -99,10 +96,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 93 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const -128 @@ -112,10 +109,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 96 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -125,10 +122,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 99 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -138,10 +135,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 102 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -149,10 +146,10 @@ global.get $retain-i32/si if i32.const 0 - i32.const 8 + i32.const 24 i32.const 105 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -162,10 +159,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 108 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 255 @@ -175,10 +172,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 113 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 255 @@ -188,10 +185,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 116 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 254 @@ -201,10 +198,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 119 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -214,10 +211,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 122 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -227,10 +224,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 125 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -240,10 +237,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 128 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -251,10 +248,10 @@ global.get $retain-i32/ui if i32.const 0 - i32.const 8 + i32.const 24 i32.const 131 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/retain-i32.untouched.wat b/tests/compiler/retain-i32.untouched.wat index 3c8ff591f4..8dd06a470a 100644 --- a/tests/compiler/retain-i32.untouched.wat +++ b/tests/compiler/retain-i32.untouched.wat @@ -2,9 +2,9 @@ (type $FUNCSIG$vii (func (param i32 i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\0d\00\00\00r\00e\00t\00a\00i\00n\00-\00i\003\002\00.\00t\00s\00") + (data (i32.const 8) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00r\00e\00t\00a\00i\00n\00-\00i\003\002\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/builtins/i8.MAX_VALUE i32 (i32.const 127)) @@ -18,9 +18,7 @@ (global $~lib/builtins/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 $~lib/memory/HEAP_BASE i32 (i32.const 40)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $retain-i32/test (; 1 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) local.get $0 @@ -41,10 +39,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 4 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -65,10 +63,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 5 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -89,10 +87,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 6 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -113,10 +111,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 7 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -137,10 +135,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 8 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -161,10 +159,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 9 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -185,10 +183,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 10 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -205,10 +203,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 13 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -225,10 +223,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 14 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -245,10 +243,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 15 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -265,10 +263,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 16 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -285,10 +283,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 17 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -305,10 +303,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 18 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -325,10 +323,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 19 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) @@ -408,48 +406,46 @@ local.set $0 loop $repeat|0 local.get $0 - global.get $~lib/builtins/u8.MAX_VALUE + i32.const 255 i32.le_s i32.eqz br_if $break|0 - block - i32.const 0 - local.get $0 - call $retain-i32/test - i32.const 1 - local.get $0 - call $retain-i32/test - i32.const -1 - local.get $0 - call $retain-i32/test - global.get $~lib/builtins/i8.MIN_VALUE - local.get $0 - call $retain-i32/test - global.get $~lib/builtins/i8.MAX_VALUE - local.get $0 - call $retain-i32/test - global.get $~lib/builtins/u8.MAX_VALUE - local.get $0 - call $retain-i32/test - global.get $~lib/builtins/i16.MIN_VALUE - local.get $0 - call $retain-i32/test - global.get $~lib/builtins/i16.MAX_VALUE - local.get $0 - call $retain-i32/test - global.get $~lib/builtins/u16.MAX_VALUE - local.get $0 - call $retain-i32/test - global.get $~lib/builtins/i32.MAX_VALUE - local.get $0 - call $retain-i32/test - global.get $~lib/builtins/i32.MIN_VALUE - local.get $0 - call $retain-i32/test - global.get $~lib/builtins/u32.MAX_VALUE - local.get $0 - call $retain-i32/test - end + i32.const 0 + local.get $0 + call $retain-i32/test + i32.const 1 + local.get $0 + call $retain-i32/test + i32.const -1 + local.get $0 + call $retain-i32/test + global.get $~lib/builtins/i8.MIN_VALUE + local.get $0 + call $retain-i32/test + global.get $~lib/builtins/i8.MAX_VALUE + local.get $0 + call $retain-i32/test + global.get $~lib/builtins/u8.MAX_VALUE + local.get $0 + call $retain-i32/test + global.get $~lib/builtins/i16.MIN_VALUE + local.get $0 + call $retain-i32/test + global.get $~lib/builtins/i16.MAX_VALUE + local.get $0 + call $retain-i32/test + global.get $~lib/builtins/u16.MAX_VALUE + local.get $0 + call $retain-i32/test + global.get $~lib/builtins/i32.MAX_VALUE + local.get $0 + call $retain-i32/test + global.get $~lib/builtins/i32.MIN_VALUE + local.get $0 + call $retain-i32/test + global.get $~lib/builtins/u32.MAX_VALUE + local.get $0 + call $retain-i32/test local.get $0 i32.const 1 i32.add @@ -475,10 +471,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 78 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 127 @@ -497,10 +493,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 81 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 127 @@ -517,10 +513,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 84 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -537,10 +533,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 87 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const -128 @@ -557,10 +553,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 90 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 127 @@ -577,10 +573,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 93 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const -128 @@ -597,10 +593,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 96 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 127 @@ -613,10 +609,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 99 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -629,10 +625,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 102 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const -128 @@ -645,10 +641,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 105 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -661,10 +657,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 108 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 255 @@ -681,10 +677,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 113 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 255 @@ -701,10 +697,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 116 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 255 @@ -719,10 +715,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 119 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 255 @@ -737,10 +733,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 122 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 255 @@ -753,10 +749,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 125 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 255 @@ -769,10 +765,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 128 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 255 @@ -785,10 +781,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 131 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/retain-release-sanity.json b/tests/compiler/retain-release-sanity.json new file mode 100644 index 0000000000..9f7878d475 --- /dev/null +++ b/tests/compiler/retain-release-sanity.json @@ -0,0 +1,6 @@ +{ + "asc_flags": [ + "--runtime half", + "--use ASC_RTRACE=1" + ] +} \ No newline at end of file diff --git a/tests/compiler/retain-release-sanity.optimized.wat b/tests/compiler/retain-release-sanity.optimized.wat new file mode 100644 index 0000000000..734e6095ed --- /dev/null +++ b/tests/compiler/retain-release-sanity.optimized.wat @@ -0,0 +1,2787 @@ +(module + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32))) + (import "rtrace" "onincrement" (func $~lib/rt/rtrace/onincrement (param i32))) + (import "rtrace" "ondecrement" (func $~lib/rt/rtrace/ondecrement (param i32))) + (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) + (memory $0 1) + (data (i32.const 8) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h") + (data (i32.const 56) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") + (data (i32.const 112) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s") + (data (i32.const 160) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e") + (data (i32.const 216) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s") + (data (i32.const 264) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e") + (data (i32.const 320) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s") + (data (i32.const 360) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s") + (data (i32.const 408) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00A\00r\00r\00a\00y\00 \00i\00s\00 \00e\00m\00p\00t\00y") + (data (i32.const 456) "^\00\00\00\01\00\00\00\01\00\00\00^\00\00\00E\00l\00e\00m\00e\00n\00t\00 \00t\00y\00p\00e\00 \00m\00u\00s\00t\00 \00b\00e\00 \00n\00u\00l\00l\00a\00b\00l\00e\00 \00i\00f\00 \00a\00r\00r\00a\00y\00 \00i\00s\00 \00h\00o\00l\00e\00y") + (data (i32.const 572) "\01\00\00\00\01") + (data (i32.const 584) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00a") + (data (i32.const 608) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00b") + (data (i32.const 632) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00n\00u\00l\00l") + (data (i32.const 656) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00d") + (data (i32.const 680) "\08\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\93\04\00\00\02\00\00\00\93 \00\00\02\00\00\00\93 \00\00\02") + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) + (export "memory" (memory $0)) + (start $start) + (func $~lib/rt/tlsf/removeBlock (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.tee $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 276 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const -4 + i32.and + local.tee $2 + i32.const 16 + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 278 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 256 + i32.lt_u + if (result i32) + local.get $2 + i32.const 4 + i32.shr_u + local.set $2 + i32.const 0 + else + local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $3 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $2 + local.get $3 + i32.const 7 + i32.sub + end + local.tee $3 + i32.const 23 + i32.lt_u + if (result i32) + local.get $2 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 291 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=20 + local.set $4 + local.get $1 + i32.load offset=16 + local.tee $5 + if + local.get $5 + local.get $4 + i32.store offset=20 + end + local.get $4 + if + local.get $4 + local.get $5 + i32.store offset=16 + end + local.get $3 + i32.const 4 + i32.shl + local.get $2 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + local.get $1 + i32.eq + if + local.get $3 + i32.const 4 + i32.shl + local.get $2 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $4 + i32.store offset=96 + local.get $4 + i32.eqz + if + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const 1 + local.get $2 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.store offset=4 + local.get $1 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $3 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 6 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 204 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.tee $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 206 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.tee $5 + i32.const 1 + i32.and + if + local.get $3 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const -4 + i32.and + i32.add + local.tee $2 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $3 + i32.const 3 + i32.and + local.get $2 + i32.or + local.tee $3 + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.set $5 + end + end + local.get $3 + i32.const 2 + i32.and + if + local.get $1 + i32.const 4 + i32.sub + i32.load + local.tee $2 + i32.load + local.tee $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 227 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $3 + i32.const -4 + i32.and + i32.add + local.tee $7 + i32.const 1073741808 + i32.lt_u + if (result i32) + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $2 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $3 + i32.store + local.get $2 + else + local.get $1 + end + local.set $1 + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $3 + i32.const -4 + i32.and + local.tee $2 + i32.const 16 + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + i32.ne + if + i32.const 0 + i32.const 128 + i32.const 243 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $2 + i32.const 256 + i32.lt_u + if (result i32) + local.get $2 + i32.const 4 + i32.shr_u + local.set $4 + i32.const 0 + else + local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $4 + local.get $2 + i32.const 7 + i32.sub + end + local.tee $3 + i32.const 23 + i32.lt_u + if (result i32) + local.get $4 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 259 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + local.set $2 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $2 + i32.store offset=20 + local.get $2 + if + local.get $2 + local.get $1 + i32.store offset=16 + end + local.get $3 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $1 + i32.store offset=96 + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $3 + i32.shl + i32.or + i32.store + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const 1 + local.get $4 + i32.shl + i32.or + i32.store offset=4 + ) + (func $~lib/rt/tlsf/addMemory (; 7 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $1 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $1 + local.get $2 + i32.le_u + select + select + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 385 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=1568 + local.tee $3 + if + local.get $1 + local.get $3 + i32.const 16 + i32.add + i32.lt_u + if + i32.const 0 + i32.const 128 + i32.const 395 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $3 + i32.eq + if + local.get $3 + i32.load + local.set $4 + local.get $1 + i32.const 16 + i32.sub + local.set $1 + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.lt_u + if + i32.const 0 + i32.const 128 + i32.const 407 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.tee $2 + i32.const 48 + i32.lt_u + if + return + end + local.get $1 + local.get $4 + i32.const 2 + i32.and + local.get $2 + i32.const 32 + i32.sub + i32.const 1 + i32.or + i32.or + i32.store + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $2 + i32.add + i32.const 16 + i32.sub + local.tee $2 + i32.const 2 + i32.store + local.get $0 + local.get $2 + i32.store offset=1568 + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/tlsf/initializeRoot (; 8 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 1 + memory.size + local.tee $0 + i32.gt_s + if (result i32) + i32.const 1 + local.get $0 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + i32.const 752 + i32.const 0 + i32.store + i32.const 2320 + i32.const 0 + i32.store + i32.const 0 + local.set $0 + loop $repeat|0 + block $break|0 + local.get $0 + i32.const 23 + i32.ge_u + br_if $break|0 + local.get $0 + i32.const 2 + i32.shl + i32.const 752 + i32.add + i32.const 0 + i32.store offset=4 + i32.const 0 + local.set $1 + loop $repeat|1 + block $break|1 + local.get $1 + i32.const 16 + i32.ge_u + br_if $break|1 + local.get $0 + i32.const 4 + i32.shl + local.get $1 + i32.add + i32.const 2 + i32.shl + i32.const 752 + i32.add + i32.const 0 + i32.store offset=96 + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|1 + end + end + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + end + i32.const 752 + i32.const 2336 + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + i32.const 752 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 176 + i32.const 128 + i32.const 447 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const -16 + i32.and + local.tee $0 + i32.const 16 + local.get $0 + i32.const 16 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + i32.const 256 + i32.lt_u + if (result i32) + local.get $1 + i32.const 4 + i32.shr_u + local.set $1 + i32.const 0 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + local.get $1 + i32.add + i32.const 1 + i32.sub + local.set $1 + end + local.get $1 + i32.const 31 + local.get $1 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $1 + local.get $2 + i32.const 7 + i32.sub + end + local.tee $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $1 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 337 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const -1 + local.get $1 + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $1 + i32.ctz + local.get $2 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + else + local.get $0 + i32.load + i32.const -1 + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $1 + i32.ctz + local.tee $1 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 350 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.ctz + local.get $1 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + else + i32.const 0 + end + end + ) + (func $~lib/rt/tlsf/growMemory (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + memory.size + local.tee $2 + local.get $1 + i32.const 65535 + i32.add + i32.const -65536 + i32.and + i32.const 16 + i32.shr_u + local.tee $1 + local.get $2 + local.get $1 + i32.gt_s + select + memory.grow + i32.const 0 + i32.lt_s + if + local.get $1 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + local.get $0 + local.get $2 + i32.const 16 + i32.shl + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + ) + (func $~lib/rt/tlsf/prepareBlock (; 12 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + if + i32.const 0 + i32.const 128 + i32.const 364 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const -4 + i32.and + local.get $2 + i32.sub + local.tee $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $3 + i32.const 2 + i32.and + local.get $2 + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.tee $1 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const -2 + i32.and + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + i32.load + i32.const -3 + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.tee $3 + call $~lib/rt/tlsf/searchBlock + local.tee $2 + i32.eqz + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $3 + call $~lib/rt/tlsf/searchBlock + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 477 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + i32.load + i32.const -4 + i32.and + local.get $3 + i32.lt_u + if + i32.const 0 + i32.const 128 + i32.const 479 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 0 + i32.store offset=4 + local.get $2 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $2 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $2 + call $~lib/rt/rtrace/onalloc + local.get $2 + ) + (func $~lib/rt/tlsf/__alloc (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + global.get $~lib/rt/tlsf/ROOT + local.tee $2 + if (result i32) + local.get $2 + else + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + end + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.tee $0 + local.get $1 + i32.store offset=8 + local.get $0 + i32.const 16 + i32.add + ) + (func $~lib/rt/pure/increment (; 15 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const -268435456 + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne + if + i32.const 0 + i32.const 232 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/rtrace/onincrement + local.get $0 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 232 + i32.const 107 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/pure/__retain (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 748 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment + end + local.get $0 + ) + (func $~lib/rt/tlsf/freeBlock (; 17 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.tee $2 + i32.const 1 + i32.and + if + i32.const 0 + i32.const 128 + i32.const 531 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/rtrace/onfree + ) + (func $~lib/rt/__typeinfo (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 680 + i32.load + i32.gt_u + if + i32.const 280 + i32.const 336 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 3 + i32.shl + i32.const 684 + i32.add + i32.load + ) + (func $~lib/memory/memory.copy (; 19 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $2 + local.set $3 + local.get $0 + local.get $1 + i32.eq + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $1 + i32.lt_u + if + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|0 + local.get $0 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + br $continue|0 + end + end + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $1 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + br $continue|1 + end + end + end + loop $continue|2 + local.get $3 + if + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + else + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|3 + local.get $0 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $3 + i32.const 8 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + loop $continue|5 + local.get $3 + if + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + ) + (func $~lib/rt/tlsf/__free (; 20 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 561 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $0 + select + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 562 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/growRoots (; 21 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/pure/CUR + global.get $~lib/rt/pure/ROOTS + local.tee $1 + i32.sub + local.tee $2 + i32.const 1 + i32.shl + local.tee $0 + i32.const 256 + local.get $0 + i32.const 256 + i32.gt_u + select + local.tee $3 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.tee $0 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onfree + local.get $0 + local.get $1 + local.get $2 + call $~lib/memory/memory.copy + local.get $1 + if + local.get $1 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onalloc + local.get $1 + call $~lib/rt/tlsf/__free + end + local.get $0 + global.set $~lib/rt/pure/ROOTS + local.get $0 + local.get $2 + i32.add + global.set $~lib/rt/pure/CUR + local.get $0 + local.get $3 + i32.add + global.set $~lib/rt/pure/END + ) + (func $~lib/rt/pure/appendRoot (; 22 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/pure/CUR + local.tee $1 + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 4 + i32.add + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/decrement (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.tee $2 + i32.const 268435455 + i32.and + local.set $1 + local.get $0 + call $~lib/rt/rtrace/ondecrement + local.get $0 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 232 + i32.const 115 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/rt/__visit_members + local.get $2 + i32.const -2147483648 + i32.and + if + local.get $0 + i32.const -2147483648 + i32.store offset=4 + else + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + else + local.get $1 + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 232 + i32.const 124 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 16 + i32.and + if + local.get $0 + local.get $1 + i32.const 1 + i32.sub + local.get $2 + i32.const -268435456 + i32.and + i32.or + i32.store offset=4 + else + local.get $0 + local.get $1 + i32.const 1 + i32.sub + i32.const -1342177280 + i32.or + i32.store offset=4 + local.get $2 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/appendRoot + end + end + end + ) + (func $~lib/rt/pure/__release (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + i32.const 748 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + end + ) + (func $~lib/arraybuffer/ArrayBufferView#constructor (; 25 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + i32.const 268435452 + i32.gt_u + if + i32.const 24 + i32.const 72 + i32.const 14 + i32.const 56 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 2 + i32.shl + local.tee $2 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $1 + local.get $0 + i32.eqz + if + i32.const 12 + i32.const 2 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $1 + local.get $0 + i32.load + local.tee $3 + i32.ne + if + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $3 + call $~lib/rt/pure/__release + end + local.get $0 + local.get $1 + i32.store + local.get $0 + local.get $1 + i32.store offset=4 + local.get $0 + local.get $2 + i32.store offset=8 + local.get $0 + ) + (func $~lib/rt/tlsf/reallocateBlock (; 26 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $2 + call $~lib/rt/tlsf/prepareSize + local.set $3 + local.get $1 + i32.load + local.tee $4 + i32.const 1 + i32.and + if + i32.const 0 + i32.const 128 + i32.const 493 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + local.get $4 + i32.const -4 + i32.and + i32.le_u + if + local.get $0 + local.get $1 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $1 + local.get $2 + i32.store offset=12 + local.get $1 + return + end + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $6 + i32.load + local.tee $5 + i32.const 1 + i32.and + if + local.get $4 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const -4 + i32.and + i32.add + local.tee $5 + local.get $3 + i32.ge_u + if + local.get $0 + local.get $6 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $4 + i32.const 3 + i32.and + local.get $5 + i32.or + i32.store + local.get $1 + local.get $2 + i32.store offset=12 + local.get $0 + local.get $1 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $1 + return + end + end + local.get $0 + local.get $2 + call $~lib/rt/tlsf/allocateBlock + local.tee $3 + local.get $1 + i32.load offset=4 + i32.store offset=4 + local.get $3 + local.get $1 + i32.load offset=8 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + local.get $1 + i32.const 16 + i32.add + local.get $2 + call $~lib/memory/memory.copy + local.get $1 + local.get $4 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $3 + ) + (func $~lib/rt/tlsf/__realloc (; 27 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 553 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $0 + select + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 554 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + local.get $1 + call $~lib/rt/tlsf/reallocateBlock + i32.const 16 + i32.add + ) + (func $~lib/memory/memory.fill (; 28 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.eqz + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 0 + i32.store8 + local.get $0 + local.get $1 + i32.add + i32.const 1 + i32.sub + i32.const 0 + i32.store8 + local.get $1 + i32.const 2 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 1 + i32.add + i32.const 0 + i32.store8 + local.get $0 + i32.const 2 + i32.add + i32.const 0 + i32.store8 + local.get $0 + local.get $1 + i32.add + local.tee $2 + i32.const 2 + i32.sub + i32.const 0 + i32.store8 + local.get $2 + i32.const 3 + i32.sub + i32.const 0 + i32.store8 + local.get $1 + i32.const 6 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 3 + i32.add + i32.const 0 + i32.store8 + local.get $0 + local.get $1 + i32.add + i32.const 4 + i32.sub + i32.const 0 + i32.store8 + local.get $1 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + local.get $0 + i32.sub + i32.const 3 + i32.and + local.tee $1 + i32.sub + local.set $2 + local.get $0 + local.get $1 + i32.add + local.tee $0 + i32.const 0 + i32.store + local.get $2 + i32.const -4 + i32.and + local.tee $1 + local.get $0 + i32.add + i32.const 4 + i32.sub + i32.const 0 + i32.store + local.get $1 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 4 + i32.add + i32.const 0 + i32.store + local.get $0 + i32.const 8 + i32.add + i32.const 0 + i32.store + local.get $0 + local.get $1 + i32.add + local.tee $2 + i32.const 12 + i32.sub + i32.const 0 + i32.store + local.get $2 + i32.const 8 + i32.sub + i32.const 0 + i32.store + local.get $1 + i32.const 24 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 12 + i32.add + i32.const 0 + i32.store + local.get $0 + i32.const 16 + i32.add + i32.const 0 + i32.store + local.get $0 + i32.const 20 + i32.add + i32.const 0 + i32.store + local.get $0 + i32.const 24 + i32.add + i32.const 0 + i32.store + local.get $0 + local.get $1 + i32.add + local.tee $2 + i32.const 28 + i32.sub + i32.const 0 + i32.store + local.get $2 + i32.const 24 + i32.sub + i32.const 0 + i32.store + local.get $2 + i32.const 20 + i32.sub + i32.const 0 + i32.store + local.get $2 + i32.const 16 + i32.sub + i32.const 0 + i32.store + local.get $0 + i32.const 4 + i32.and + i32.const 24 + i32.add + local.tee $2 + local.get $0 + i32.add + local.set $0 + local.get $1 + local.get $2 + i32.sub + local.set $1 + loop $continue|0 + local.get $1 + i32.const 32 + i32.ge_u + if + local.get $0 + i64.const 0 + i64.store + local.get $0 + i32.const 8 + i32.add + i64.const 0 + i64.store + local.get $0 + i32.const 16 + i32.add + i64.const 0 + i64.store + local.get $0 + i32.const 24 + i32.add + i64.const 0 + i64.store + local.get $1 + i32.const 32 + i32.sub + local.set $1 + local.get $0 + i32.const 32 + i32.add + local.set $0 + br $continue|0 + end + end + end + ) + (func $~lib/array/ensureSize (; 29 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $1 + local.get $0 + i32.load offset=8 + local.tee $2 + i32.const 2 + i32.shr_u + i32.gt_u + if + local.get $1 + i32.const 268435452 + i32.gt_u + if + i32.const 24 + i32.const 376 + i32.const 14 + i32.const 47 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load + local.tee $4 + local.get $1 + i32.const 2 + i32.shl + local.tee $3 + call $~lib/rt/tlsf/__realloc + local.tee $1 + local.get $2 + i32.add + local.get $3 + local.get $2 + i32.sub + call $~lib/memory/memory.fill + local.get $1 + local.get $4 + i32.ne + if + local.get $0 + local.get $1 + call $~lib/rt/pure/__retain + i32.store + local.get $0 + local.get $1 + i32.store offset=4 + end + local.get $0 + local.get $3 + i32.store offset=8 + end + ) + (func $~lib/array/Array#push (; 30 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + local.get $0 + i32.load offset=12 + local.tee $1 + i32.const 1 + i32.add + local.tee $2 + call $~lib/array/ensureSize + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + i32.const 123 + i32.store + local.get $0 + local.get $2 + i32.store offset=12 + ) + (func $~lib/array/Array#pop (; 31 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=12 + local.tee $1 + i32.const 1 + i32.lt_s + if + i32.const 424 + i32.const 376 + i32.const 287 + i32.const 20 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 1 + i32.sub + local.tee $1 + i32.const 2 + i32.shl + i32.add + i32.load + drop + local.get $0 + local.get $1 + i32.store offset=12 + ) + (func $~lib/array/Array<~lib/string/String>#push (; 32 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + i32.const 584 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $0 + i32.load offset=12 + local.tee $1 + i32.const 1 + i32.add + local.tee $2 + call $~lib/array/ensureSize + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + i32.const 584 + call $~lib/rt/pure/__retain + i32.store + local.get $0 + local.get $2 + i32.store offset=12 + i32.const 584 + call $~lib/rt/pure/__release + ) + (func $~lib/string/String#get:length (; 33 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u + ) + (func $~lib/string/String#concat (; 34 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $1 + i32.eqz + if + local.get $1 + i32.const 648 + i32.ne + if + i32.const 648 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + i32.const 648 + local.set $1 + end + local.get $0 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.tee $3 + local.get $1 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.tee $4 + i32.add + local.tee $2 + i32.eqz + if + i32.const 584 + call $~lib/rt/pure/__retain + local.set $0 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + return + end + local.get $2 + i32.const 1 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $2 + local.get $0 + local.get $3 + call $~lib/memory/memory.copy + local.get $2 + local.get $3 + i32.add + local.get $1 + local.get $4 + call $~lib/memory/memory.copy + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + ) + (func $~lib/string/String.__concat (; 35 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.const 648 + local.get $0 + select + local.get $1 + call $~lib/string/String#concat + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + ) + (func $~lib/rt/pure/markGray (; 36 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members + end + ) + (func $~lib/rt/pure/scanBlack (; 37 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 38 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (; 39 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + ) + (func $~lib/rt/pure/__collect (; 40 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/pure/ROOTS + local.tee $5 + local.tee $2 + local.set $3 + global.get $~lib/rt/pure/CUR + local.set $0 + loop $repeat|0 + block $break|0 + local.get $3 + local.get $0 + i32.ge_u + br_if $break|0 + local.get $3 + i32.load + local.tee $4 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 805306368 + i32.eq + if (result i32) + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + else + i32.const 0 + end + if + local.get $4 + call $~lib/rt/pure/markGray + local.get $2 + local.get $4 + i32.store + local.get $2 + i32.const 4 + i32.add + local.set $2 + else + i32.const 0 + local.get $1 + i32.const 268435455 + i32.and + i32.eqz + local.get $1 + i32.const 1879048192 + i32.and + select + if + global.get $~lib/rt/tlsf/ROOT + local.get $4 + call $~lib/rt/tlsf/freeBlock + else + local.get $4 + local.get $1 + i32.const 2147483647 + i32.and + i32.store offset=4 + end + end + local.get $3 + i32.const 4 + i32.add + local.set $3 + br $repeat|0 + end + end + local.get $2 + global.set $~lib/rt/pure/CUR + local.get $5 + local.set $0 + loop $repeat|1 + block $break|1 + local.get $0 + local.get $2 + i32.ge_u + br_if $break|1 + local.get $0 + i32.load + call $~lib/rt/pure/scan + local.get $0 + i32.const 4 + i32.add + local.set $0 + br $repeat|1 + end + end + local.get $5 + local.set $0 + loop $repeat|2 + block $break|2 + local.get $0 + local.get $2 + i32.ge_u + br_if $break|2 + local.get $0 + i32.load + local.tee $1 + local.get $1 + i32.load offset=4 + i32.const 2147483647 + i32.and + i32.store offset=4 + local.get $1 + call $~lib/rt/pure/collectWhite + local.get $0 + i32.const 4 + i32.add + local.set $0 + br $repeat|2 + end + end + local.get $5 + global.set $~lib/rt/pure/CUR + ) + (func $start:retain-release-sanity (; 41 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + i32.const 16 + i32.const 3 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + i32.const 3 + call $~lib/arraybuffer/ArrayBufferView#constructor + local.tee $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 3 + i32.store offset=12 + local.get $0 + call $~lib/array/Array#push + local.get $0 + call $~lib/array/Array#push + local.get $0 + call $~lib/array/Array#pop + local.get $0 + call $~lib/rt/pure/__release + i32.const 16 + i32.const 5 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + i32.const 0 + call $~lib/arraybuffer/ArrayBufferView#constructor + local.tee $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + local.set $1 + loop $repeat|0 + local.get $3 + i32.const 10 + i32.lt_s + if + i32.const 16 + i32.const 4 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + i32.const 0 + call $~lib/arraybuffer/ArrayBufferView#constructor + local.tee $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=12 + i32.const 0 + local.set $2 + loop $repeat|1 + local.get $2 + i32.const 10 + i32.lt_s + if + local.get $0 + call $~lib/array/Array<~lib/string/String>#push + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $repeat|1 + end + end + local.get $0 + call $~lib/rt/pure/__release + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + end + end + local.get $1 + call $~lib/rt/pure/__release + i32.const 600 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 624 + call $~lib/string/String.__concat + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $2 + i32.const 672 + call $~lib/string/String.__concat + local.set $3 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + i32.const 4 + i32.const 6 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.store + local.get $0 + local.set $3 + i32.const 4 + i32.const 7 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $1 + i32.const 0 + i32.store + local.get $1 + local.set $2 + local.get $0 + i32.load + local.tee $4 + local.get $1 + i32.ne + if + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $4 + call $~lib/rt/pure/__release + end + local.get $3 + local.get $2 + i32.store + local.get $0 + i32.load + local.tee $2 + local.get $1 + i32.ne + if + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release + end + local.get $0 + local.get $1 + i32.store + local.get $1 + i32.load + local.tee $2 + local.get $0 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.load + local.tee $2 + local.get $0 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release + end + local.get $1 + local.get $0 + i32.store + local.get $0 + i32.load + local.tee $2 + local.get $1 + i32.ne + if + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release + end + local.get $0 + local.get $1 + i32.store + local.get $1 + i32.load + local.tee $2 + local.get $0 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release + end + local.get $1 + local.get $0 + i32.store + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + call $~lib/rt/pure/__collect + ) + (func $start (; 42 ;) (type $FUNCSIG$v) + call $start:retain-release-sanity + ) + (func $~lib/rt/pure/__visit (; 43 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + local.get $0 + i32.const 748 + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $0 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + local.get $1 + i32.const 1 + i32.ne + if + local.get $1 + i32.const 2 + i32.eq + br_if $case1|0 + block $tablify|0 + local.get $1 + i32.const 3 + i32.sub + br_table $case2|0 $case3|0 $case4|0 $tablify|0 + end + br $case5|0 + end + local.get $0 + call $~lib/rt/pure/decrement + br $break|0 + end + local.get $0 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 232 + i32.const 75 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $0 + call $~lib/rt/pure/markGray + br $break|0 + end + local.get $0 + call $~lib/rt/pure/scan + br $break|0 + end + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const -268435456 + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne + if + i32.const 0 + i32.const 232 + i32.const 86 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $1 + i32.const 1879048192 + i32.and + if + local.get $0 + call $~lib/rt/pure/scanBlack + end + br $break|0 + end + local.get $0 + call $~lib/rt/pure/collectWhite + br $break|0 + end + i32.const 0 + i32.const 232 + i32.const 97 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/array/Array<~lib/string/String>#__visit_impl (; 44 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + i32.load offset=4 + local.tee $2 + local.get $0 + i32.load offset=12 + i32.const 2 + i32.shl + i32.add + local.set $0 + loop $continue|0 + local.get $2 + local.get $0 + i32.lt_u + if + local.get $2 + i32.load + local.tee $3 + if + local.get $3 + local.get $1 + call $~lib/rt/pure/__visit + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 + end + end + ) + (func $~lib/rt/__visit_members (; 45 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + block $block$4$break + block $switch$1$default + block $switch$1$case$7 + block $switch$1$case$6 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $block$4$break $block$4$break $switch$1$case$6 $switch$1$case$7 $block$4$break $block$4$break $switch$1$default + end + return + end + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/string/String>#__visit_impl + br $block$4$break + end + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/string/String>#__visit_impl + br $block$4$break + end + unreachable + end + local.get $0 + i32.load + local.tee $0 + if + local.get $0 + local.get $1 + call $~lib/rt/pure/__visit + end + ) + (func $null (; 46 ;) (type $FUNCSIG$v) + nop + ) +) diff --git a/tests/compiler/retain-release-sanity.ts b/tests/compiler/retain-release-sanity.ts new file mode 100644 index 0000000000..b46f26d95b --- /dev/null +++ b/tests/compiler/retain-release-sanity.ts @@ -0,0 +1,41 @@ +{ + let arr: i32[] = new Array(3); + arr.push(123); + arr.push(123); + arr.pop(); +} +{ + let outer = new Array>(); + for (let i = 0; i < 10; ++i) { + let arr = new Array(); + for (let j = 0; j < 10; ++j) { + arr.push(""); + // outer.push(arr); + } + } +} +{ + let a = "a"; + let c = a + "b"; + c + "d"; +} + +class A { + b: B; +} +class B { + a: A; +} + +{ + let a = new A(); + let b = new B(); + a.b = b; + a.b = b; + b.a = a; + b.a = a; + a.b = b; + b.a = a; +} + +__collect(); diff --git a/tests/compiler/retain-release-sanity.untouched.wat b/tests/compiler/retain-release-sanity.untouched.wat new file mode 100644 index 0000000000..9a6e9bc75d --- /dev/null +++ b/tests/compiler/retain-release-sanity.untouched.wat @@ -0,0 +1,4891 @@ +(module + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32))) + (import "rtrace" "onincrement" (func $~lib/rt/rtrace/onincrement (param i32))) + (import "rtrace" "ondecrement" (func $~lib/rt/rtrace/ondecrement (param i32))) + (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) + (memory $0 1) + (data (i32.const 8) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h\00") + (data (i32.const 56) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") + (data (i32.const 112) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 160) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 216) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s\00") + (data (i32.const 264) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 320) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s\00") + (data (i32.const 360) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") + (data (i32.const 408) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00A\00r\00r\00a\00y\00 \00i\00s\00 \00e\00m\00p\00t\00y\00") + (data (i32.const 456) "^\00\00\00\01\00\00\00\01\00\00\00^\00\00\00E\00l\00e\00m\00e\00n\00t\00 \00t\00y\00p\00e\00 \00m\00u\00s\00t\00 \00b\00e\00 \00n\00u\00l\00l\00a\00b\00l\00e\00 \00i\00f\00 \00a\00r\00r\00a\00y\00 \00i\00s\00 \00h\00o\00l\00e\00y\00") + (data (i32.const 568) "\00\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00") + (data (i32.const 584) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00a\00") + (data (i32.const 608) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00b\00") + (data (i32.const 632) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00n\00u\00l\00l\00") + (data (i32.const 656) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00d\00") + (data (i32.const 680) "\08\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\93\04\00\00\02\00\00\00\93 \00\00\02\00\00\00\93 \00\00\02\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) + (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/rt/__rtti_base i32 (i32.const 680)) + (global $~lib/heap/__heap_base i32 (i32.const 748)) + (export "memory" (memory $0)) + (start $start) + (func $~lib/rt/tlsf/removeBlock (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 276 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $3 + local.get $3 + i32.const 16 + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 278 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 + local.get $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) + local.get $5 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 291 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end + local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $9 + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $8 + local.get $4 + local.set $11 + local.get $9 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $9 + local.set $10 + local.get $8 + local.get $11 + i32.const 2 + i32.shl + i32.add + local.get $10 + i32.store offset=4 + end + local.get $9 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 6 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 204 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 206 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 + i32.const 1 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end + local.get $2 + i32.const 2 + i32.and + if + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 4 + i32.sub + i32.load + end + local.set $6 + local.get $6 + i32.load + local.set $3 + local.get $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 227 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $6 + call $~lib/rt/tlsf/removeBlock + local.get $6 + local.get $3 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $6 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $8 + i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 243 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $8 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 259 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $7 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $7 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $0 + local.set $12 + local.get $9 + local.set $7 + local.get $10 + local.set $3 + local.get $1 + local.set $6 + local.get $12 + local.get $7 + i32.const 4 + i32.shl + local.get $3 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + end + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $0 + local.set $13 + local.get $9 + local.set $12 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + end + ) + (func $~lib/rt/tlsf/addMemory (; 7 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + local.get $2 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 385 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 395 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 407 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 8 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + memory.size + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end + block $break|0 + i32.const 0 + local.set $5 + loop $repeat|0 + local.get $5 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $3 + local.set $7 + local.get $5 + local.set $6 + i32.const 0 + local.set $4 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $7 + loop $repeat|1 + local.get $7 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $3 + local.set $9 + local.get $5 + local.set $8 + local.get $7 + local.set $6 + i32.const 0 + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store offset=96 + end + local.get $7 + i32.const 1 + i32.add + local.set $7 + br $repeat|1 + unreachable + end + unreachable + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 176 + i32.const 128 + i32.const 447 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 337 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + i32.const 0 + local.set $7 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $5 + local.get $5 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $5 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $4 + local.get $8 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 350 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + memory.size + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + memory.grow + i32.const 0 + i32.lt_s + if + local.get $3 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + memory.size + local.set $7 + local.get $0 + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (; 12 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 364 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 477 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 479 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + call $~lib/rt/rtrace/onalloc + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/rt/pure/increment (; 15 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/rtrace/onincrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 107 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/pure/__retain (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment + end + local.get $0 + ) + (func $~lib/rt/tlsf/freeBlock (; 17 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 531 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/rtrace/onfree + ) + (func $~lib/rt/__typeinfo (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/rt/__rtti_base + local.set $1 + local.get $0 + local.get $1 + i32.load + i32.gt_u + if + i32.const 280 + i32.const 336 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 4 + i32.add + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/util/memory/memcpy (; 19 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + block $break|0 + loop $continue|0 + local.get $2 + if (result i32) + local.get $1 + i32.const 3 + i32.and + else + i32.const 0 + end + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $continue|0 + end + end + end + local.get $0 + i32.const 3 + i32.and + i32.const 0 + i32.eq + if + block $break|1 + loop $continue|1 + local.get $2 + i32.const 16 + i32.ge_u + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 8 + i32.add + i32.load + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 12 + i32.add + i32.load + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|1 + end + end + end + local.get $2 + i32.const 8 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + end + local.get $2 + i32.const 4 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.set $0 + local.get $1 + i32.const 4 + i32.add + local.set $1 + end + local.get $2 + i32.const 2 + i32.and + if + local.get $0 + local.get $1 + i32.load16_u + i32.store16 + local.get $0 + i32.const 2 + i32.add + local.set $0 + local.get $1 + i32.const 2 + i32.add + local.set $1 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + return + end + local.get $2 + i32.const 32 + i32.ge_u + if + block $break|2 + block $case2|2 + block $case1|2 + block $case0|2 + local.get $0 + i32.const 3 + i32.and + local.set $5 + local.get $5 + i32.const 1 + i32.eq + br_if $case0|2 + local.get $5 + i32.const 2 + i32.eq + br_if $case1|2 + local.get $5 + i32.const 3 + i32.eq + br_if $case2|2 + br $break|2 + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 3 + i32.sub + local.set $2 + block $break|3 + loop $continue|3 + local.get $2 + i32.const 17 + i32.ge_u + if + local.get $1 + i32.const 1 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 5 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 9 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 13 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|3 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + block $break|4 + loop $continue|4 + local.get $2 + i32.const 18 + i32.ge_u + if + local.get $1 + i32.const 2 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 6 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 10 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 14 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|4 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + block $break|5 + loop $continue|5 + local.get $2 + i32.const 19 + i32.ge_u + if + local.get $1 + i32.const 3 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 7 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 11 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 15 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|5 + end + end + end + br $break|2 + unreachable + end + unreachable + end + end + local.get $2 + i32.const 16 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 8 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 4 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 2 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + ) + (func $~lib/memory/memory.copy (; 20 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $4 + local.get $3 + i32.add + local.get $5 + i32.le_u + if (result i32) + i32.const 1 + else + local.get $5 + local.get $3 + i32.add + local.get $4 + i32.le_u + end + if + local.get $5 + local.get $4 + local.get $3 + call $~lib/util/memory/memcpy + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/rt/tlsf/__free (; 21 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 561 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 562 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/growRoots (; 22 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/pure/ROOTS + local.set $0 + global.get $~lib/rt/pure/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onfree + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $0 + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onalloc + local.get $0 + call $~lib/rt/tlsf/__free + end + local.get $5 + global.set $~lib/rt/pure/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/pure/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/pure/END + ) + (func $~lib/rt/pure/appendRoot (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/pure/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 4 + i32.add + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/decrement (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + call $~lib/rt/rtrace/ondecrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 115 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/rt/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 124 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 16 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/pure/__release (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + end + ) + (func $~lib/arraybuffer/ArrayBufferView#constructor (; 26 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.const 1073741808 + local.get $2 + i32.shr_u + i32.gt_u + if + i32.const 24 + i32.const 72 + i32.const 14 + i32.const 56 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.shl + local.tee $1 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $3 + block (result i32) + local.get $0 + i32.eqz + if + i32.const 12 + i32.const 2 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + end + local.tee $4 + block (result i32) + local.get $3 + local.tee $5 + local.get $4 + i32.load + local.tee $4 + i32.ne + if + local.get $5 + call $~lib/rt/pure/__retain + drop + local.get $4 + call $~lib/rt/pure/__release + end + local.get $5 + end + i32.store + local.get $0 + local.get $3 + i32.store offset=4 + local.get $0 + local.get $1 + i32.store offset=8 + local.get $0 + ) + (func $~lib/array/Array#constructor (; 27 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + if (result i32) + local.get $0 + else + i32.const 16 + i32.const 3 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + end + local.get $1 + i32.const 2 + call $~lib/arraybuffer/ArrayBufferView#constructor + local.set $0 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + local.get $1 + i32.store offset=12 + local.get $0 + ) + (func $~lib/rt/tlsf/reallocateBlock (; 28 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + local.get $2 + call $~lib/rt/tlsf/prepareSize + local.set $3 + local.get $1 + i32.load + local.set $4 + local.get $4 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 493 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + local.get $4 + i32.const -4 + i32.and + i32.le_u + if + local.get $0 + local.get $1 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $1 + local.get $2 + i32.store offset=12 + local.get $1 + return + end + block $~lib/rt/tlsf/GETRIGHT|inlined.4 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $6 + local.get $6 + i32.load + local.set $7 + local.get $7 + i32.const 1 + i32.and + if + local.get $4 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $7 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $5 + local.get $5 + local.get $3 + i32.ge_u + if + local.get $0 + local.get $6 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $4 + i32.const 3 + i32.and + local.get $5 + i32.or + i32.store + local.get $1 + local.get $2 + i32.store offset=12 + local.get $0 + local.get $1 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $1 + return + end + end + local.get $0 + local.get $2 + call $~lib/rt/tlsf/allocateBlock + local.set $8 + local.get $8 + local.get $1 + i32.load offset=4 + i32.store offset=4 + local.get $8 + local.get $1 + i32.load offset=8 + i32.store offset=8 + local.get $8 + i32.const 16 + i32.add + local.get $1 + i32.const 16 + i32.add + local.get $2 + call $~lib/memory/memory.copy + local.get $1 + local.get $4 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $8 + ) + (func $~lib/rt/tlsf/__realloc (; 29 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 553 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 554 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + local.get $1 + call $~lib/rt/tlsf/reallocateBlock + i32.const 16 + i32.add + ) + (func $~lib/memory/memory.fill (; 30 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i64) + block $~lib/util/memory/memset|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $3 + i32.eqz + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 1 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 2 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 1 + i32.add + local.get $4 + i32.store8 + local.get $5 + i32.const 2 + i32.add + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 2 + i32.sub + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 3 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 6 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 3 + i32.add + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + i32.const 0 + local.get $5 + i32.sub + i32.const 3 + i32.and + local.set $6 + local.get $5 + local.get $6 + i32.add + local.set $5 + local.get $3 + local.get $6 + i32.sub + local.set $3 + local.get $3 + i32.const -4 + i32.and + local.set $3 + i32.const -1 + i32.const 255 + i32.div_u + local.get $4 + i32.const 255 + i32.and + i32.mul + local.set $7 + local.get $5 + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.get $7 + i32.store + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 4 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 8 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 12 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 8 + i32.sub + local.get $7 + i32.store + local.get $3 + i32.const 24 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 12 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 16 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 20 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 24 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 28 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 24 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 20 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 16 + i32.sub + local.get $7 + i32.store + i32.const 24 + local.get $5 + i32.const 4 + i32.and + i32.add + local.set $6 + local.get $5 + local.get $6 + i32.add + local.set $5 + local.get $3 + local.get $6 + i32.sub + local.set $3 + local.get $7 + i64.extend_i32_u + local.get $7 + i64.extend_i32_u + i64.const 32 + i64.shl + i64.or + local.set $8 + block $break|0 + loop $continue|0 + local.get $3 + i32.const 32 + i32.ge_u + if + local.get $5 + local.get $8 + i64.store + local.get $5 + i32.const 8 + i32.add + local.get $8 + i64.store + local.get $5 + i32.const 16 + i32.add + local.get $8 + i64.store + local.get $5 + i32.const 24 + i32.add + local.get $8 + i64.store + local.get $3 + i32.const 32 + i32.sub + local.set $3 + local.get $5 + i32.const 32 + i32.add + local.set $5 + br $continue|0 + end + end + end + end + ) + (func $~lib/array/ensureSize (; 31 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $0 + i32.load offset=8 + local.set $3 + local.get $1 + local.get $3 + local.get $2 + i32.shr_u + i32.gt_u + if + local.get $1 + i32.const 1073741808 + local.get $2 + i32.shr_u + i32.gt_u + if + i32.const 24 + i32.const 376 + i32.const 14 + i32.const 47 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load + local.set $4 + local.get $1 + local.get $2 + i32.shl + local.set $5 + local.get $4 + local.get $5 + call $~lib/rt/tlsf/__realloc + local.set $6 + local.get $6 + local.get $3 + i32.add + i32.const 0 + local.get $5 + local.get $3 + i32.sub + call $~lib/memory/memory.fill + local.get $6 + local.get $4 + i32.ne + if + local.get $0 + local.get $6 + call $~lib/rt/pure/__retain + i32.store + local.get $0 + local.get $6 + i32.store offset=4 + end + local.get $0 + local.get $5 + i32.store offset=8 + end + ) + (func $~lib/array/Array#push (; 32 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + i32.load offset=12 + local.set $2 + local.get $2 + i32.const 1 + i32.add + local.set $3 + local.get $0 + local.get $3 + i32.const 2 + call $~lib/array/ensureSize + local.get $0 + i32.load offset=4 + local.get $2 + i32.const 2 + i32.shl + i32.add + local.get $1 + i32.store + local.get $0 + local.get $3 + i32.store offset=12 + local.get $3 + ) + (func $~lib/array/Array#pop (; 33 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=12 + local.set $1 + local.get $1 + i32.const 1 + i32.lt_s + if + i32.const 424 + i32.const 376 + i32.const 287 + i32.const 20 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 1 + i32.sub + local.tee $1 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $2 + local.get $0 + local.get $1 + i32.store offset=12 + local.get $2 + ) + (func $~lib/array/Array<~lib/array/Array<~lib/string/String>>#constructor (; 34 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + if (result i32) + local.get $0 + else + i32.const 16 + i32.const 5 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + end + local.get $1 + i32.const 2 + call $~lib/arraybuffer/ArrayBufferView#constructor + local.set $0 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $1 + if + i32.const 472 + i32.const 376 + i32.const 56 + i32.const 20 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.store offset=12 + local.get $0 + ) + (func $~lib/array/Array<~lib/string/String>#constructor (; 35 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + if (result i32) + local.get $0 + else + i32.const 16 + i32.const 4 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + end + local.get $1 + i32.const 2 + call $~lib/arraybuffer/ArrayBufferView#constructor + local.set $0 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $1 + if + i32.const 472 + i32.const 376 + i32.const 56 + i32.const 20 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.store offset=12 + local.get $0 + ) + (func $~lib/array/Array<~lib/string/String>#push (; 36 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.load offset=12 + local.set $2 + local.get $2 + i32.const 1 + i32.add + local.set $3 + local.get $0 + local.get $3 + i32.const 2 + call $~lib/array/ensureSize + local.get $0 + i32.load offset=4 + local.get $2 + i32.const 2 + i32.shl + i32.add + local.get $1 + call $~lib/rt/pure/__retain + i32.store + local.get $0 + local.get $3 + i32.store offset=12 + local.get $3 + local.set $4 + local.get $1 + call $~lib/rt/pure/__release + local.get $4 + ) + (func $~lib/string/String#get:length (; 37 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u + ) + (func $~lib/string/String#concat (; 38 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $1 + i32.const 0 + i32.eq + if + block (result i32) + i32.const 648 + local.tee $2 + local.get $1 + local.tee $3 + i32.ne + if + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $3 + call $~lib/rt/pure/__release + end + local.get $2 + end + local.set $1 + end + local.get $0 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.set $4 + local.get $1 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.set $5 + local.get $4 + local.get $5 + i32.add + local.set $6 + local.get $6 + i32.const 0 + i32.eq + if + i32.const 584 + call $~lib/rt/pure/__retain + local.set $2 + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + return + end + local.get $6 + i32.const 1 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $7 + local.get $7 + local.get $0 + local.get $4 + call $~lib/memory/memory.copy + local.get $7 + local.get $4 + i32.add + local.get $1 + local.get $5 + call $~lib/memory/memory.copy + local.get $7 + local.set $2 + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + ) + (func $~lib/string/String.__concat (; 39 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.const 648 + local.get $0 + i32.const 0 + i32.ne + select + local.get $1 + call $~lib/string/String#concat + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + ) + (func $retain-release-sanity/A#constructor (; 40 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 4 + i32.const 6 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + ) + (func $retain-release-sanity/B#constructor (; 41 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 4 + i32.const 7 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + ) + (func $~lib/rt/pure/markGray (; 42 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members + end + ) + (func $~lib/rt/pure/scanBlack (; 43 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 44 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (; 45 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + ) + (func $~lib/rt/pure/__collect (; 46 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/pure/ROOTS + local.set $0 + local.get $0 + local.set $1 + block $break|0 + block + local.get $1 + local.set $2 + global.get $~lib/rt/pure/CUR + local.set $3 + end + loop $repeat|0 + local.get $2 + local.get $3 + i32.lt_u + i32.eqz + br_if $break|0 + local.get $2 + i32.load + local.set $4 + local.get $4 + i32.load offset=4 + local.set $5 + local.get $5 + i32.const 1879048192 + i32.and + i32.const 805306368 + i32.eq + if (result i32) + local.get $5 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + else + i32.const 0 + end + if + local.get $4 + call $~lib/rt/pure/markGray + local.get $1 + local.get $4 + i32.store + local.get $1 + i32.const 4 + i32.add + local.set $1 + else + local.get $5 + i32.const 1879048192 + i32.and + i32.const 0 + i32.eq + if (result i32) + local.get $5 + i32.const 268435455 + i32.and + i32.eqz + else + i32.const 0 + end + if + global.get $~lib/rt/tlsf/ROOT + local.get $4 + call $~lib/rt/tlsf/freeBlock + else + local.get $4 + local.get $5 + i32.const -2147483648 + i32.const -1 + i32.xor + i32.and + i32.store offset=4 + end + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + global.set $~lib/rt/pure/CUR + block $break|1 + local.get $0 + local.set $5 + loop $repeat|1 + local.get $5 + local.get $1 + i32.lt_u + i32.eqz + br_if $break|1 + local.get $5 + i32.load + call $~lib/rt/pure/scan + local.get $5 + i32.const 4 + i32.add + local.set $5 + br $repeat|1 + unreachable + end + unreachable + end + block $break|2 + local.get $0 + local.set $5 + loop $repeat|2 + local.get $5 + local.get $1 + i32.lt_u + i32.eqz + br_if $break|2 + local.get $5 + i32.load + local.set $4 + local.get $4 + local.get $4 + i32.load offset=4 + i32.const -2147483648 + i32.const -1 + i32.xor + i32.and + i32.store offset=4 + local.get $4 + call $~lib/rt/pure/collectWhite + local.get $5 + i32.const 4 + i32.add + local.set $5 + br $repeat|2 + unreachable + end + unreachable + end + local.get $0 + global.set $~lib/rt/pure/CUR + ) + (func $start:retain-release-sanity (; 47 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + block + i32.const 0 + i32.const 3 + call $~lib/array/Array#constructor + local.set $0 + local.get $0 + i32.const 123 + call $~lib/array/Array#push + drop + local.get $0 + i32.const 123 + call $~lib/array/Array#push + drop + local.get $0 + call $~lib/array/Array#pop + drop + local.get $0 + call $~lib/rt/pure/__release + end + block + i32.const 0 + i32.const 0 + call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#constructor + local.set $0 + block $break|0 + i32.const 0 + local.set $1 + loop $repeat|0 + local.get $1 + i32.const 10 + i32.lt_s + i32.eqz + br_if $break|0 + i32.const 0 + i32.const 0 + call $~lib/array/Array<~lib/string/String>#constructor + local.set $2 + block $break|1 + i32.const 0 + local.set $3 + loop $repeat|1 + local.get $3 + i32.const 10 + i32.lt_s + i32.eqz + br_if $break|1 + local.get $2 + i32.const 584 + call $~lib/array/Array<~lib/string/String>#push + drop + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|1 + unreachable + end + unreachable + end + local.get $2 + call $~lib/rt/pure/__release + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|0 + unreachable + end + unreachable + end + local.get $0 + call $~lib/rt/pure/__release + end + block + i32.const 600 + call $~lib/rt/pure/__retain + local.set $0 + local.get $0 + i32.const 624 + call $~lib/string/String.__concat + local.tee $2 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 + i32.const 672 + call $~lib/string/String.__concat + local.tee $3 + drop + local.get $0 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + end + block + i32.const 0 + call $retain-release-sanity/A#constructor + local.set $3 + i32.const 0 + call $retain-release-sanity/B#constructor + local.set $1 + local.get $3 + local.tee $2 + block (result i32) + local.get $1 + local.tee $0 + local.get $2 + i32.load + local.tee $2 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release + end + local.get $0 + end + i32.store + local.get $3 + local.tee $0 + block (result i32) + local.get $1 + local.tee $2 + local.get $0 + i32.load + local.tee $0 + i32.ne + if + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $0 + call $~lib/rt/pure/__release + end + local.get $2 + end + i32.store + local.get $1 + local.tee $2 + block (result i32) + local.get $3 + local.tee $0 + local.get $2 + i32.load + local.tee $2 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release + end + local.get $0 + end + i32.store + local.get $1 + local.tee $0 + block (result i32) + local.get $3 + local.tee $2 + local.get $0 + i32.load + local.tee $0 + i32.ne + if + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $0 + call $~lib/rt/pure/__release + end + local.get $2 + end + i32.store + local.get $3 + local.tee $2 + block (result i32) + local.get $1 + local.tee $0 + local.get $2 + i32.load + local.tee $2 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release + end + local.get $0 + end + i32.store + local.get $1 + local.tee $0 + block (result i32) + local.get $3 + local.tee $2 + local.get $0 + i32.load + local.tee $0 + i32.ne + if + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $0 + call $~lib/rt/pure/__release + end + local.get $2 + end + i32.store + local.get $3 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + end + call $~lib/rt/pure/__collect + ) + (func $start (; 48 ;) (type $FUNCSIG$v) + call $start:retain-release-sanity + ) + (func $~lib/array/Array#__visit_impl (; 49 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/rt/pure/__visit (; 50 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/pure/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 75 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/pure/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 86 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/pure/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 97 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + end + ) + (func $~lib/array/Array<~lib/string/String>#__visit_impl (; 51 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=4 + local.set $2 + local.get $2 + local.get $0 + i32.load offset=12 + i32.const 2 + i32.shl + i32.add + local.set $3 + block $break|0 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_u + if + local.get $2 + i32.load + local.set $4 + local.get $4 + if + local.get $4 + local.get $1 + call $~lib/rt/pure/__visit + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 + end + end + end + ) + (func $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__visit_impl (; 52 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=4 + local.set $2 + local.get $2 + local.get $0 + i32.load offset=12 + i32.const 2 + i32.shl + i32.add + local.set $3 + block $break|0 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_u + if + local.get $2 + i32.load + local.set $4 + local.get $4 + if + local.get $4 + local.get $1 + call $~lib/rt/pure/__visit + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 + end + end + end + ) + (func $~lib/rt/__visit_members (; 53 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block $block$4$break + block + end + block $switch$1$leave + block $switch$1$default + block $switch$1$case$7 + block $switch$1$case$6 + block $switch$1$case$5 + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$case$5 $switch$1$case$6 $switch$1$case$7 $switch$1$case$4 $switch$1$case$4 $switch$1$default + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + br $block$4$break + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$4$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/string/String>#__visit_impl + block + br $block$4$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__visit_impl + block + br $block$4$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + end + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + ) + (func $null (; 54 ;) (type $FUNCSIG$v) + ) +) diff --git a/tests/compiler/retain-release.json b/tests/compiler/retain-release.json new file mode 100644 index 0000000000..bf222c4d2d --- /dev/null +++ b/tests/compiler/retain-release.json @@ -0,0 +1,6 @@ +{ + "asc_flags": [ + "--runtime none", + "--explicitStart" + ] +} \ No newline at end of file diff --git a/tests/compiler/retain-release.optimized.wat b/tests/compiler/retain-release.optimized.wat new file mode 100644 index 0000000000..dec4930c32 --- /dev/null +++ b/tests/compiler/retain-release.optimized.wat @@ -0,0 +1,232 @@ +(module + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$i (func (result i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (memory $0 1) + (data (i32.const 8) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00e\00r\00r\00o\00r") + (data (i32.const 40) "\"\00\00\00\01\00\00\00\01\00\00\00\"\00\00\00r\00e\00t\00a\00i\00n\00-\00r\00e\00l\00e\00a\00s\00e\00.\00t\00s") + (table $0 1 funcref) + (elem (i32.const 0) $retain-release/receiveRef) + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) + (global $retain-release/REF (mut i32) (i32.const 0)) + (global $retain-release/glo (mut i32) (i32.const 0)) + (global $retain-release/TARGET (mut i32) (i32.const 0)) + (global $~lib/argc (mut i32) (i32.const 0)) + (global $~lib/started (mut i32) (i32.const 0)) + (export "__start" (func $start)) + (export "memory" (memory $0)) + (export "returnRef" (func $retain-release/returnRef)) + (export "receiveRef" (func $retain-release/receiveRef)) + (export "receiveRefDrop" (func $retain-release/receiveRef)) + (export "receiveRefRetain" (func $retain-release/receiveRef)) + (export "takeRef" (func $retain-release/takeRef)) + (export "provideRef" (func $retain-release/receiveRef)) + (export "takeReturnRef" (func $retain-release/takeReturnRef)) + (export "provideReceiveRef" (func $retain-release/receiveRef)) + (export "newRef" (func $retain-release/newRef)) + (export "assignGlobal" (func $retain-release/assignGlobal)) + (export "assignField" (func $retain-release/assignField)) + (export "scopeBlock" (func $retain-release/receiveRef)) + (export "scopeBlockToUninitialized" (func $retain-release/receiveRef)) + (export "scopeBlockToInitialized" (func $retain-release/receiveRef)) + (export "scopeBlockToConditional" (func $retain-release/scopeBlockToConditional)) + (export "scopeTopLevelUninitialized" (func $retain-release/receiveRef)) + (export "scopeTopLevelInitialized" (func $retain-release/receiveRef)) + (export "scopeTopLevelConditional" (func $retain-release/takeRef)) + (export "scopeIf" (func $retain-release/takeRef)) + (export "scopeIfElse" (func $retain-release/takeRef)) + (export "scopeWhile" (func $retain-release/takeRef)) + (export "scopeDo" (func $retain-release/takeRef)) + (export "scopeFor" (func $retain-release/takeRef)) + (export "scopeBreak" (func $retain-release/takeRef)) + (export "scopeContinue" (func $retain-release/takeRef)) + (export "scopeThrow" (func $retain-release/scopeThrow)) + (export "scopeUnreachable" (func $retain-release/scopeUnreachable)) + (export "callInline" (func $retain-release/receiveRef)) + (export "provideRefInline" (func $retain-release/receiveRef)) + (export "receiveRefInline" (func $retain-release/receiveRef)) + (export "receiveRefInlineDrop" (func $retain-release/receiveRef)) + (export "provideRefIndirect" (func $retain-release/provideRefIndirect)) + (export "receiveRefIndirect" (func $retain-release/receiveRefIndirect)) + (export "receiveRefIndirectDrop" (func $retain-release/receiveRefIndirect)) + (func $~lib/rt/stub/__alloc (; 1 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + i32.const 1073741808 + i32.gt_u + if + unreachable + end + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.tee $3 + local.get $0 + i32.const 1 + local.get $0 + i32.const 1 + i32.gt_u + select + i32.add + i32.const 15 + i32.add + i32.const -16 + i32.and + local.tee $2 + memory.size + local.tee $4 + i32.const 16 + i32.shl + i32.gt_u + if + local.get $4 + local.get $2 + local.get $3 + i32.sub + i32.const 65535 + i32.add + i32.const -65536 + i32.and + i32.const 16 + i32.shr_u + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + memory.grow + i32.const 0 + i32.lt_s + if + local.get $5 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + end + local.get $2 + global.set $~lib/rt/stub/offset + local.get $3 + i32.const 16 + i32.sub + local.tee $2 + local.get $1 + i32.store offset=8 + local.get $2 + local.get $0 + i32.store offset=12 + local.get $3 + ) + (func $retain-release/Ref#constructor (; 2 ;) (type $FUNCSIG$i) (result i32) + i32.const 0 + i32.const 3 + call $~lib/rt/stub/__alloc + ) + (func $retain-release/returnRef (; 3 ;) (type $FUNCSIG$i) (result i32) + global.get $retain-release/REF + ) + (func $retain-release/receiveRef (; 4 ;) (type $FUNCSIG$v) + nop + ) + (func $retain-release/takeRef (; 5 ;) (type $FUNCSIG$vi) (param $0 i32) + nop + ) + (func $retain-release/takeReturnRef (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + ) + (func $retain-release/newRef (; 7 ;) (type $FUNCSIG$v) + call $retain-release/Ref#constructor + drop + ) + (func $retain-release/assignGlobal (; 8 ;) (type $FUNCSIG$v) + (local $0 i32) + global.get $retain-release/REF + local.set $0 + local.get $0 + global.set $retain-release/glo + ) + (func $retain-release/assignField (; 9 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + global.get $retain-release/REF + local.tee $0 + global.get $retain-release/TARGET + local.tee $1 + i32.load + i32.ne + drop + local.get $1 + local.get $0 + i32.store + ) + (func $retain-release/scopeBlockToConditional (; 10 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + nop + ) + (func $retain-release/scopeThrow (; 11 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + if + i32.const 24 + i32.const 56 + i32.const 313 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + ) + (func $retain-release/scopeUnreachable (; 12 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + if + unreachable + end + ) + (func $retain-release/provideRefIndirect (; 13 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 1 + global.set $~lib/argc + global.get $retain-release/REF + local.get $0 + call_indirect (type $FUNCSIG$vi) + ) + (func $retain-release/receiveRefIndirect (; 14 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 0 + global.set $~lib/argc + local.get $0 + call_indirect (type $FUNCSIG$i) + drop + ) + (func $start (; 15 ;) (type $FUNCSIG$v) + (local $0 i32) + global.get $~lib/started + if + return + else + i32.const 1 + global.set $~lib/started + end + i32.const 96 + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset + call $retain-release/Ref#constructor + global.set $retain-release/REF + i32.const 4 + i32.const 4 + call $~lib/rt/stub/__alloc + local.tee $0 + i32.const 0 + i32.store + local.get $0 + global.set $retain-release/TARGET + ) +) diff --git a/tests/compiler/retain-release.ts b/tests/compiler/retain-release.ts new file mode 100644 index 0000000000..c5ad2e5bc2 --- /dev/null +++ b/tests/compiler/retain-release.ts @@ -0,0 +1,420 @@ +class Ref {} + +// FIXME: Comments are outdated due to various optimizations the compiler performs now. +// Instead, the tests that make sense should be moved to rc/XY + +var REF = new Ref(); + +export function returnRef(): Ref { + + // Returning a reference must retain it because it could otherwise drop to + // RC=0 before reaching the caller, for example if it was stored in a local + // with RC=1 when this local becomes released at the end of the function. See + // scope tests below. + + return /* __retain( */ REF /* ) */; +} + +export function receiveRef(): void { + + // Receiving a reference from a call must keep track of it in a temporary + // AUTORELEASE local because it has been pre-retained by the callee. This is + // required because the reference could be immediately dropped and the caller + // would otherwise not be able to release it properly. + + !/* (TEMP = */ returnRef() /* ) */; + // __release(TEMP) +} + +export function receiveRefDrop(): void { + + // A straight forward optimization here is to detect immediate drops and skip + // the temp local. + + /*__release( */ returnRef() /* ) */; +} + +export function receiveRefRetain(): void { + + // TODO: Another possible optimization is to detect that the target will + // retain on its own, skip the temp local and mark the target as AUTORELEASE, + // instead of doing: + + var a = /* __retain(TEMP = */ returnRef() /* ) */; + // __release(TEMP); + // __release(a); +} + +export function takeRef(ref: Ref): void { + + // Taking a reference as an argument must retain it while the body is + // executing because reassigning the argument could otherwise drop to RC=0, + // prematurely releasing the reference even though the caller still needs it. + // This is the same as if the caller would retain it pre-call and release it + // post-call, but from a code size perspective it makes more sense to make the + // callee handle this instead of embedding runtime calls into every single + // call. Downside is that the caller has more knowledge about the actual + // arguments, like if these must actually be retained, while the upside is + // that each function "just works" standalone. + + // __retain(ref) + // __release(ref) +} + +export function provideRef(): void { + + // Providing a reference therefore doesn't do any retains or releases but + // assumes that the callee will do this for us. The alternative of embedding + // runtime calls into the call is discussed above, and also a valid strategy + // for different reasons. It is likely that there are smart optimizations of + // this case. + + takeRef(REF); +} + +export function takeReturnRef(ref: Ref): Ref { + + // Returning a reference provided as an argument must do all of the above but + // can eliminate one set of retain/release by simply not releasing the + // reference at the end of the function and skipping the retain on return. + + // __retain(ref) + return ref; + + // What would otherwise be + // /* (T = __retain( */ ref /* )), __release(ref), T */; +} + +export function provideReceiveRef(): void { + + // Combined case of providing and receiving a reference, with no additional + // logic compared to the base cases above. + + !/* TEMP = */ takeReturnRef(REF); + // __release(TEMP) +} + +export function newRef(): void { + + // Allocating a reference must keep track of the allocation in a temporary + // AUTORELEASE local because the allocation could be dropped immediately. + // Similar to the receiveRef case, one possibile optimization here is to + // detect immediate drops. + + /* TEMP = */ new Ref(); + // __release(TEMP) +} + +var glo: Ref; + +export function assignGlobal(): void { + + // Assigning a reference to a global first retains it before releasing the + // previously stored reference. + + glo = /* __retainRelease( */ REF /* , glo) */; +} + +class Target { fld: Ref; } + +var TARGET = new Target(); + +export function assignField(): void { + + // Similar to the assignGlobal case, assigning a reference to a field first + // retains it before releasing the previously stored reference. + + TARGET.fld = /* __retainRelease( */ REF /* , fld) */; +} + +export function scopeBlock(): void { + + // A scoped local must retain ownership of its reference for the same reasons + // as in the takeRef case, because reassigning it could otherwise drop to RC=0 + // in a situation where the local holds a reference with RC=1, prematurely + // releasing it even if the original reference is still in use. + + { + let $0 = /* __retain( */ REF /* } */; + // __release($0) + } +} + +export function scopeBlockToUninitialized(): void { + + // Top-level variables that have not yet been initialized do not have to + // release `null` unless actually assigned a reference. Hence, such a var + // doesn't have the AUTORELEASE property initially, but immediately takes it + // as soon as it is assigned. + + var $0: Ref; // uninitialized, so no AUTORELEASE yet + { + let $1 = /* __retain( */ REF /* } */; + $0 = /* __retain( */ $1 /* ) */; + // __release($1) + } + // __release($0) +} + +export function scopeBlockToInitialized(): void { + + // Top-level variables that have been initialized must retain and release + // their reference normally like in the takeRef and scopeBlock cases, for the + // same reason of not prematurely dropping to RC=0 even though the original + // reference is still in use. + + var $0: Ref = /* __retain( */ REF /* ) */; + { + let $1 = /* __retain( */ REF /* } */; + $0 = /* __retainRelease( */ $1 /* , $0) */; + // __release($1) + } + // __release($0) +} + +export function scopeBlockToConditional(cond: bool): void { + + // Top-level variables that are uninitialized, but may become initialized + // conditionally, must even release `null` in the other case because the + // compiler doesn't know the outcome of the condition statically. + + var $0: Ref; + if (cond) { + $0 = /* __retain( */ REF /* ) */; // now AUTORELEASE + } + { + let $1 = /* __retain( */ REF /* } */; + $0 = /* __retainRelease( */ $1 /* , $0) */; + // __release($1) + } + // __release($0) +} + +export function scopeTopLevelUninitialized(): void { + + // Isolated case of an uninitialized top-level variable that is never + // initialized, and is thus never releasing `null`. + + var $0: Ref; +} + +export function scopeTopLevelInitialized(): void { + + // Isolated case of an initialized top-level variable that is never + // reassigned. One possible optimization here is to detect this case and + // eliminate the local with its retain/release altogether. Alternatively, a + // warning could be omitted to inform the user that this var is unnecessary, + // which I'd prefer because it hints the user at a portion of code that might + // contain other errors. + + var $0: Ref = /* __retain( */ REF /* ) */; + // __release($0) +} + +export function scopeTopLevelConditional(cond: bool): void { + + // Isolated case of an uninitialized top-level variable that is conditionally + // assigned to, so that even `null` must be released at the end of the + // function because the compiler doesn't know the outcome of the condition + // statically. + + var $0: Ref; + if (cond) { + $0 = /* __retain( */ REF /* ) */; // now AUTORELEASE + } + // __release($0) +} + +export function scopeIf(cond: bool): void { + + // Validates that `if` scopes behave like blocks. + + if (cond) { + let $0: Ref = /* __retain( */ REF /* ) */; + // __release($0) + } +} + +export function scopeIfElse(cond: bool): void { + + // Validates that `else` scopes behave like blocks. + + if (cond) { + let $0: Ref = /* __retain( */ REF /* ) */; + // __release($0) + } else { + let $0: Ref = /* __retain( */ REF /* ) */; + // __release($0) + } +} + +export function scopeWhile(cond: bool): void { + + // Validates that `while` scopes behave like blocks. + + while (cond) { + let $0: Ref = /* __retain( */ REF /* ) */; + // __release($0) + } +} + +export function scopeDo(cond: bool): void { + + // Validates that `do` scopes behave like blocks. + + do { + let $0: Ref = /* __retain( */ REF /* ) */; + // __release($0) + } while (cond); +} + +export function scopeFor(cond: bool): void { + + // Validates that `for` scopes behave like blocks. + + for (; cond; ) { + let $0: Ref = /* __retain( */ REF /* ) */; + // __release($0) + } +} + +export function scopeBreak(cond: bool): void { + + // Validates that `break` statements terminate flows so that no further + // releases are performed afterwards. + + while (cond) { + let $0: Ref = /* __retain( */ REF /* ) */; + // __release($0) + break; + } +} + +export function scopeContinue(cond: bool): void { + + // Validates that `continue` statements terminate flows so that no further + // releases are performed afterwards. + + while (cond) { + let $0: Ref = /* __retain( */ REF /* ) */; + // __release($0) + continue; + } +} + +export function scopeThrow(cond: bool): void { + + // Validates that `throw` statements terminate flows so that no further + // releases are performed afterwards. + + while (cond) { + let $0: Ref = /* __retain( */ REF /* ) */; + // __release($0) + throw new Error("error"); + } +} + +export function scopeUnreachable(cond: bool): void { + + // Unreachable instructions are different in the sense that these are unsafe + // compiler intrinsics that guarantee to have no unexpected side-effects, + // hence don't terminate flows and result in an unreachable release after the + // instruction (i.e. after the program has crashed). + + while (cond) { + let $0: Ref = /* __retain( */ REF /* ) */; + // __release($0) + unreachable(); + } +} + +// @ts-ignore: decorator +@inline +function scopeInline(): void { + + // Inlined function bodies should behave like normal scopes. + + var $0 = /* __retain( */ REF /* ) */; + // __release($0) +} + +export function callInline(): void { + + // Hosts scopeInline with no own logic. + + scopeInline(); +} + +// @ts-ignore: decorator +@inline +function takeRefInline(ref: Ref): void { + + // The takeRef case but inline. Should retain and release while alive. + + // __retain(ref) + // __release(reF) +} + +export function provideRefInline(): void { + + // The provideRef case but inline. Should do nothing to the arguments while + // hosting the inlined retain and release. + + takeRefInline(REF); +} + +// @ts-ignore: decorator +@inline +function returnRefInline(): Ref { + + // The returnRef case but inline. + + return /* __retain( */ REF /* ) */; +} + +export function receiveRefInline(): void { + + // The receiveRef case but inline. + + !/* TEMP = */ returnRefInline(); + // __release(TEMP) +} + +export function receiveRefInlineDrop(): void { + + // The receiveRefDrop case but inline. + + /* __release( */ returnRefInline() /* ) */; + + // TODO: Since we have access to both the block and the surrounding code here, + // if we can prove that the last statement of the block does a retain, we can + // eliminate it together with the receiver's release. Opt pass maybe? +} + +export function provideRefIndirect(fn: (ref: Ref) => void): void { + + // An indirect call should behave just like a direct call, that is not insert + // anything when providing a reference. + + fn(REF); +} + +export function receiveRefIndirect(fn: () => Ref): void { + + // An indirect call should behave just like a direct call, that is taking care + // of release when receiving a reference. + + !/* TEMP = */ fn(); + // __release(TEMP) +} + +export function receiveRefIndirectDrop(fn: () => Ref): void { + + // An indirect call should behave just like a direct call, that is taking care + // of release when receiving a reference. + + /* __release( */ fn() /* ) */; +} + +// TODO: Optimize more immediate drops on alloc/call, like overloads, getters +// and immediately assigning to a storage target. diff --git a/tests/compiler/retain-release.untouched.wat b/tests/compiler/retain-release.untouched.wat new file mode 100644 index 0000000000..d9f9fd3d65 --- /dev/null +++ b/tests/compiler/retain-release.untouched.wat @@ -0,0 +1,681 @@ +(module + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$i (func (result i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (memory $0 1) + (data (i32.const 8) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00e\00r\00r\00o\00r\00") + (data (i32.const 40) "\"\00\00\00\01\00\00\00\01\00\00\00\"\00\00\00r\00e\00t\00a\00i\00n\00-\00r\00e\00l\00e\00a\00s\00e\00.\00t\00s\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) + (global $retain-release/REF (mut i32) (i32.const 0)) + (global $retain-release/glo (mut i32) (i32.const 0)) + (global $retain-release/TARGET (mut i32) (i32.const 0)) + (global $~lib/argc (mut i32) (i32.const 0)) + (global $~lib/started (mut i32) (i32.const 0)) + (global $~lib/heap/__heap_base i32 (i32.const 92)) + (export "__start" (func $start)) + (export "memory" (memory $0)) + (export "returnRef" (func $retain-release/returnRef)) + (export "receiveRef" (func $retain-release/receiveRef)) + (export "receiveRefDrop" (func $retain-release/receiveRefDrop)) + (export "receiveRefRetain" (func $retain-release/receiveRefRetain)) + (export "takeRef" (func $retain-release/takeRef)) + (export "provideRef" (func $retain-release/provideRef)) + (export "takeReturnRef" (func $retain-release/takeReturnRef)) + (export "provideReceiveRef" (func $retain-release/provideReceiveRef)) + (export "newRef" (func $retain-release/newRef)) + (export "assignGlobal" (func $retain-release/assignGlobal)) + (export "assignField" (func $retain-release/assignField)) + (export "scopeBlock" (func $retain-release/scopeBlock)) + (export "scopeBlockToUninitialized" (func $retain-release/scopeBlockToUninitialized)) + (export "scopeBlockToInitialized" (func $retain-release/scopeBlockToInitialized)) + (export "scopeBlockToConditional" (func $retain-release/scopeBlockToConditional)) + (export "scopeTopLevelUninitialized" (func $retain-release/scopeTopLevelUninitialized)) + (export "scopeTopLevelInitialized" (func $retain-release/scopeTopLevelInitialized)) + (export "scopeTopLevelConditional" (func $retain-release/scopeTopLevelConditional)) + (export "scopeIf" (func $retain-release/scopeIf)) + (export "scopeIfElse" (func $retain-release/scopeIfElse)) + (export "scopeWhile" (func $retain-release/scopeWhile)) + (export "scopeDo" (func $retain-release/scopeDo)) + (export "scopeFor" (func $retain-release/scopeFor)) + (export "scopeBreak" (func $retain-release/scopeBreak)) + (export "scopeContinue" (func $retain-release/scopeContinue)) + (export "scopeThrow" (func $retain-release/scopeThrow)) + (export "scopeUnreachable" (func $retain-release/scopeUnreachable)) + (export "callInline" (func $retain-release/callInline)) + (export "provideRefInline" (func $retain-release/provideRefInline)) + (export "receiveRefInline" (func $retain-release/receiveRefInline)) + (export "receiveRefInlineDrop" (func $retain-release/receiveRefInlineDrop)) + (export "provideRefIndirect" (func $retain-release/provideRefIndirect)) + (export "receiveRefIndirect" (func $retain-release/receiveRefIndirect)) + (export "receiveRefIndirectDrop" (func $retain-release/receiveRefIndirectDrop)) + (func $~lib/rt/stub/__alloc (; 1 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + local.get $0 + i32.const 1073741808 + i32.gt_u + if + unreachable + end + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.set $2 + local.get $2 + local.get $0 + local.tee $3 + i32.const 1 + local.tee $4 + local.get $3 + local.get $4 + i32.gt_u + select + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $5 + memory.size + local.set $6 + local.get $5 + local.get $6 + i32.const 16 + i32.shl + i32.gt_u + if + local.get $5 + local.get $2 + i32.sub + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $6 + local.tee $4 + local.get $3 + local.tee $7 + local.get $4 + local.get $7 + i32.gt_s + select + local.set $4 + local.get $4 + memory.grow + i32.const 0 + i32.lt_s + if + local.get $3 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + end + local.get $5 + global.set $~lib/rt/stub/offset + local.get $2 + i32.const 16 + i32.sub + local.set $8 + local.get $8 + local.get $1 + i32.store offset=8 + local.get $8 + local.get $0 + i32.store offset=12 + local.get $2 + ) + (func $~lib/rt/stub/__retain (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + ) + (func $retain-release/Ref#constructor (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 0 + i32.const 3 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain + local.set $0 + end + local.get $0 + ) + (func $retain-release/Target#constructor (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 4 + i32.const 4 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + ) + (func $start:retain-release (; 5 ;) (type $FUNCSIG$v) + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset + i32.const 0 + call $retain-release/Ref#constructor + global.set $retain-release/REF + i32.const 0 + call $retain-release/Target#constructor + global.set $retain-release/TARGET + ) + (func $retain-release/returnRef (; 6 ;) (type $FUNCSIG$i) (result i32) + global.get $retain-release/REF + call $~lib/rt/stub/__retain + ) + (func $~lib/rt/stub/__release (; 7 ;) (type $FUNCSIG$vi) (param $0 i32) + nop + ) + (func $retain-release/receiveRef (; 8 ;) (type $FUNCSIG$v) + (local $0 i32) + call $retain-release/returnRef + local.tee $0 + i32.eqz + drop + local.get $0 + call $~lib/rt/stub/__release + ) + (func $retain-release/receiveRefDrop (; 9 ;) (type $FUNCSIG$v) + call $retain-release/returnRef + call $~lib/rt/stub/__release + ) + (func $retain-release/receiveRefRetain (; 10 ;) (type $FUNCSIG$v) + (local $0 i32) + call $retain-release/returnRef + local.set $0 + local.get $0 + call $~lib/rt/stub/__release + ) + (func $retain-release/takeRef (; 11 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $0 + call $~lib/rt/stub/__release + ) + (func $retain-release/provideRef (; 12 ;) (type $FUNCSIG$v) + global.get $retain-release/REF + call $retain-release/takeRef + ) + (func $retain-release/takeReturnRef (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $0 + ) + (func $retain-release/provideReceiveRef (; 14 ;) (type $FUNCSIG$v) + (local $0 i32) + global.get $retain-release/REF + call $retain-release/takeReturnRef + local.tee $0 + i32.eqz + drop + local.get $0 + call $~lib/rt/stub/__release + ) + (func $retain-release/newRef (; 15 ;) (type $FUNCSIG$v) + i32.const 0 + call $retain-release/Ref#constructor + call $~lib/rt/stub/__release + ) + (func $retain-release/assignGlobal (; 16 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + block (result i32) + global.get $retain-release/REF + local.tee $0 + global.get $retain-release/glo + local.tee $1 + i32.ne + if + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $1 + call $~lib/rt/stub/__release + end + local.get $0 + end + global.set $retain-release/glo + ) + (func $retain-release/assignField (; 17 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + global.get $retain-release/TARGET + local.tee $0 + block (result i32) + global.get $retain-release/REF + local.tee $1 + local.get $0 + i32.load + local.tee $0 + i32.ne + if + local.get $1 + call $~lib/rt/stub/__retain + drop + local.get $0 + call $~lib/rt/stub/__release + end + local.get $1 + end + i32.store + ) + (func $retain-release/scopeBlock (; 18 ;) (type $FUNCSIG$v) + (local $0 i32) + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $0 + local.get $0 + call $~lib/rt/stub/__release + ) + (func $retain-release/scopeBlockToUninitialized (; 19 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + i32.const 0 + local.set $0 + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + block (result i32) + local.get $1 + local.tee $2 + local.get $0 + local.tee $3 + i32.ne + if + local.get $2 + call $~lib/rt/stub/__retain + drop + local.get $3 + call $~lib/rt/stub/__release + end + local.get $2 + end + local.set $0 + local.get $1 + call $~lib/rt/stub/__release + local.get $0 + call $~lib/rt/stub/__release + ) + (func $retain-release/scopeBlockToInitialized (; 20 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $0 + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + block (result i32) + local.get $1 + local.tee $2 + local.get $0 + local.tee $3 + i32.ne + if + local.get $2 + call $~lib/rt/stub/__retain + drop + local.get $3 + call $~lib/rt/stub/__release + end + local.get $2 + end + local.set $0 + local.get $1 + call $~lib/rt/stub/__release + local.get $0 + call $~lib/rt/stub/__release + ) + (func $retain-release/scopeBlockToConditional (; 21 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + i32.const 0 + local.set $1 + local.get $0 + if + block (result i32) + global.get $retain-release/REF + local.tee $2 + local.get $1 + local.tee $3 + i32.ne + if + local.get $2 + call $~lib/rt/stub/__retain + drop + local.get $3 + call $~lib/rt/stub/__release + end + local.get $2 + end + local.set $1 + end + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $2 + block (result i32) + local.get $2 + local.tee $3 + local.get $1 + local.tee $4 + i32.ne + if + local.get $3 + call $~lib/rt/stub/__retain + drop + local.get $4 + call $~lib/rt/stub/__release + end + local.get $3 + end + local.set $1 + local.get $2 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + ) + (func $retain-release/scopeTopLevelUninitialized (; 22 ;) (type $FUNCSIG$v) + (local $0 i32) + i32.const 0 + local.set $0 + local.get $0 + call $~lib/rt/stub/__release + ) + (func $retain-release/scopeTopLevelInitialized (; 23 ;) (type $FUNCSIG$v) + (local $0 i32) + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $0 + local.get $0 + call $~lib/rt/stub/__release + ) + (func $retain-release/scopeTopLevelConditional (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + i32.const 0 + local.set $1 + local.get $0 + if + block (result i32) + global.get $retain-release/REF + local.tee $2 + local.get $1 + local.tee $3 + i32.ne + if + local.get $2 + call $~lib/rt/stub/__retain + drop + local.get $3 + call $~lib/rt/stub/__release + end + local.get $2 + end + local.set $1 + end + local.get $1 + call $~lib/rt/stub/__release + ) + (func $retain-release/scopeIf (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + if + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + call $~lib/rt/stub/__release + end + ) + (func $retain-release/scopeIfElse (; 26 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + if + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + call $~lib/rt/stub/__release + else + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + call $~lib/rt/stub/__release + end + ) + (func $retain-release/scopeWhile (; 27 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + loop $continue|0 + local.get $0 + if + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + call $~lib/rt/stub/__release + br $continue|0 + end + end + ) + (func $retain-release/scopeDo (; 28 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + loop $continue|0 + block + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + call $~lib/rt/stub/__release + end + local.get $0 + br_if $continue|0 + end + ) + (func $retain-release/scopeFor (; 29 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + block $break|0 + loop $repeat|0 + local.get $0 + i32.eqz + br_if $break|0 + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + call $~lib/rt/stub/__release + br $repeat|0 + unreachable + end + unreachable + end + ) + (func $retain-release/scopeBreak (; 30 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + block $break|0 + loop $continue|0 + local.get $0 + if + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + call $~lib/rt/stub/__release + br $break|0 + end + end + end + ) + (func $retain-release/scopeContinue (; 31 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + loop $continue|0 + local.get $0 + if + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + call $~lib/rt/stub/__release + br $continue|0 + end + end + ) + (func $retain-release/scopeThrow (; 32 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + loop $continue|0 + local.get $0 + if + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + call $~lib/rt/stub/__release + block + i32.const 24 + i32.const 56 + i32.const 313 + i32.const 4 + call $~lib/builtins/abort + unreachable + unreachable + end + unreachable + end + end + ) + (func $retain-release/scopeUnreachable (; 33 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + loop $continue|0 + local.get $0 + if + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $1 + unreachable + local.get $1 + call $~lib/rt/stub/__release + br $continue|0 + end + end + ) + (func $retain-release/callInline (; 34 ;) (type $FUNCSIG$v) + (local $0 i32) + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $0 + local.get $0 + call $~lib/rt/stub/__release + ) + (func $retain-release/provideRefInline (; 35 ;) (type $FUNCSIG$v) + (local $0 i32) + global.get $retain-release/REF + call $~lib/rt/stub/__retain + local.set $0 + local.get $0 + call $~lib/rt/stub/__release + ) + (func $retain-release/receiveRefInline (; 36 ;) (type $FUNCSIG$v) + (local $0 i32) + block $retain-release/returnRefInline|inlined.0 (result i32) + global.get $retain-release/REF + call $~lib/rt/stub/__retain + end + local.tee $0 + i32.eqz + drop + local.get $0 + call $~lib/rt/stub/__release + ) + (func $retain-release/receiveRefInlineDrop (; 37 ;) (type $FUNCSIG$v) + block $retain-release/returnRefInline|inlined.1 (result i32) + global.get $retain-release/REF + call $~lib/rt/stub/__retain + end + call $~lib/rt/stub/__release + ) + (func $retain-release/provideRefIndirect (; 38 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 1 + global.set $~lib/argc + global.get $retain-release/REF + local.get $0 + call_indirect (type $FUNCSIG$vi) + ) + (func $retain-release/receiveRefIndirect (; 39 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + block (result i32) + i32.const 0 + global.set $~lib/argc + local.get $0 + call_indirect (type $FUNCSIG$i) + local.tee $1 + end + i32.eqz + drop + local.get $1 + call $~lib/rt/stub/__release + ) + (func $retain-release/receiveRefIndirectDrop (; 40 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 0 + global.set $~lib/argc + local.get $0 + call_indirect (type $FUNCSIG$i) + call $~lib/rt/stub/__release + ) + (func $start (; 41 ;) (type $FUNCSIG$v) + global.get $~lib/started + if + return + else + i32.const 1 + global.set $~lib/started + end + call $start:retain-release + ) + (func $null (; 42 ;) (type $FUNCSIG$v) + ) +) diff --git a/tests/compiler/rt/flags.json b/tests/compiler/rt/flags.json new file mode 100644 index 0000000000..97694deda8 --- /dev/null +++ b/tests/compiler/rt/flags.json @@ -0,0 +1,8 @@ +{ + "features": [ + "simd" + ], + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/rt/flags.optimized.wat b/tests/compiler/rt/flags.optimized.wat new file mode 100644 index 0000000000..63b3e572e0 --- /dev/null +++ b/tests/compiler/rt/flags.optimized.wat @@ -0,0 +1,455 @@ +(module + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$v (func)) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (memory $0 1) + (data (i32.const 8) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e") + (data (i32.const 64) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s") + (data (i32.const 104) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00r\00t\00/\00f\00l\00a\00g\00s\00.\00t\00s") + (data (i32.const 144) "D\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\001\04\00\00\02\00\00\001\00\00\00\02\00\00\001\00\00\00\02\00\00\00Q\04\00\00\02\00\00\00Q\00\00\00\02\00\00\00\91\04\00\00\02\00\00\00\91\00\00\00\02\00\00\00\11\05\00\00\02\00\00\00\11\01\00\00\02\00\00\00\91\0c\00\00\02\00\00\00\11\0d\00\00\02\00\00\003\04\00\00\02\00\00\003\00\00\00\02\00\00\00S\04\00\00\02\00\00\00S\00\00\00\02\00\00\00\93\04\00\00\02\00\00\00\93\00\00\00\02\00\00\00\13\05\00\00\02\00\00\00\13\01\00\00\02\00\00\00\93\0c\00\00\02\00\00\00\13\0d\00\00\02\00\00\00\13\02\00\00\02\00\00\00\10\00\00\00\00\00\00\00\93 \00\00\02\00\00\00\930\00\00\02\00\00\004\04\00\00\00\00\00\004\00\00\00\00\00\00\00T\04\00\00\00\00\00\00T\00\00\00\00\00\00\00\94\04\00\00\00\00\00\00\94\00\00\00\00\00\00\00\14\05\00\00\00\00\00\00\14\01\00\00\00\00\00\00\94\0c\00\00\00\00\00\00\14\0d\00\00\00\00\00\00\14\02\00\00\00\00\00\00\94 \00\00\00\00\00\00\940\00\00\00\00\00\008\04\04\00\00\00\00\00X\04\n\00\00\00\00\00\98\04\t\00\00\00\00\00\18\85\08\00\00\00\00\00\18B\08\00\00\00\00\008\04A\00\00\00\00\008\04a\00\00\00\00\00\98`\08\00\00\00\00\00\98p\08\00\00\00\00\00\980a\00\00\00\00\00\98\04\19\00\00\00\00\00\10") + (data (i32.const 604) "\83 \00\00\02\00\00\00\10") + (data (i32.const 628) "\84 \00\00\00\00\00\00\10") + (data (i32.const 652) "\88\04A") + (data (i32.const 668) "\88 \t\00\00\00\00\00\10\00\00\00\00\00\00\00\10") + (export "memory" (memory $0)) + (start $start) + (func $~lib/rt/__typeinfo (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 144 + i32.load + i32.gt_u + if + i32.const 24 + i32.const 80 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 3 + i32.shl + i32.const 148 + i32.add + i32.load + ) + (func $start:rt/flags (; 2 ;) (type $FUNCSIG$v) + block $folding-inner0 + i32.const 3 + call $~lib/rt/__typeinfo + i32.const 1073 + i32.ne + if + br $folding-inner0 + end + i32.const 4 + call $~lib/rt/__typeinfo + i32.const 49 + i32.ne + if + br $folding-inner0 + end + i32.const 5 + call $~lib/rt/__typeinfo + i32.const 49 + i32.ne + if + br $folding-inner0 + end + i32.const 6 + call $~lib/rt/__typeinfo + i32.const 1105 + i32.ne + if + br $folding-inner0 + end + i32.const 7 + call $~lib/rt/__typeinfo + i32.const 81 + i32.ne + if + br $folding-inner0 + end + i32.const 8 + call $~lib/rt/__typeinfo + i32.const 1169 + i32.ne + if + br $folding-inner0 + end + i32.const 9 + call $~lib/rt/__typeinfo + i32.const 145 + i32.ne + if + br $folding-inner0 + end + i32.const 10 + call $~lib/rt/__typeinfo + i32.const 1297 + i32.ne + if + br $folding-inner0 + end + i32.const 11 + call $~lib/rt/__typeinfo + i32.const 273 + i32.ne + if + br $folding-inner0 + end + i32.const 12 + call $~lib/rt/__typeinfo + i32.const 3217 + i32.ne + if + br $folding-inner0 + end + i32.const 13 + call $~lib/rt/__typeinfo + i32.const 3345 + i32.ne + if + br $folding-inner0 + end + i32.const 14 + call $~lib/rt/__typeinfo + i32.const 1075 + i32.ne + if + br $folding-inner0 + end + i32.const 15 + call $~lib/rt/__typeinfo + i32.const 51 + i32.ne + if + br $folding-inner0 + end + i32.const 16 + call $~lib/rt/__typeinfo + i32.const 1107 + i32.ne + if + br $folding-inner0 + end + i32.const 17 + call $~lib/rt/__typeinfo + i32.const 83 + i32.ne + if + br $folding-inner0 + end + i32.const 18 + call $~lib/rt/__typeinfo + i32.const 1171 + i32.ne + if + br $folding-inner0 + end + i32.const 19 + call $~lib/rt/__typeinfo + i32.const 147 + i32.ne + if + br $folding-inner0 + end + i32.const 20 + call $~lib/rt/__typeinfo + i32.const 1299 + i32.ne + if + br $folding-inner0 + end + i32.const 21 + call $~lib/rt/__typeinfo + i32.const 275 + i32.ne + if + br $folding-inner0 + end + i32.const 22 + call $~lib/rt/__typeinfo + i32.const 3219 + i32.ne + if + br $folding-inner0 + end + i32.const 23 + call $~lib/rt/__typeinfo + i32.const 3347 + i32.ne + if + br $folding-inner0 + end + i32.const 24 + call $~lib/rt/__typeinfo + i32.const 531 + i32.ne + if + br $folding-inner0 + end + i32.const 26 + call $~lib/rt/__typeinfo + i32.const 8339 + i32.ne + if + br $folding-inner0 + end + i32.const 27 + call $~lib/rt/__typeinfo + i32.const 12435 + i32.ne + if + br $folding-inner0 + end + i32.const 28 + call $~lib/rt/__typeinfo + i32.const 1076 + i32.ne + if + br $folding-inner0 + end + i32.const 29 + call $~lib/rt/__typeinfo + i32.const 52 + i32.ne + if + br $folding-inner0 + end + i32.const 30 + call $~lib/rt/__typeinfo + i32.const 1108 + i32.ne + if + br $folding-inner0 + end + i32.const 31 + call $~lib/rt/__typeinfo + i32.const 84 + i32.ne + if + br $folding-inner0 + end + i32.const 32 + call $~lib/rt/__typeinfo + i32.const 1172 + i32.ne + if + br $folding-inner0 + end + i32.const 33 + call $~lib/rt/__typeinfo + i32.const 148 + i32.ne + if + br $folding-inner0 + end + i32.const 34 + call $~lib/rt/__typeinfo + i32.const 1300 + i32.ne + if + br $folding-inner0 + end + i32.const 35 + call $~lib/rt/__typeinfo + i32.const 276 + i32.ne + if + br $folding-inner0 + end + i32.const 36 + call $~lib/rt/__typeinfo + i32.const 3220 + i32.ne + if + br $folding-inner0 + end + i32.const 37 + call $~lib/rt/__typeinfo + i32.const 3348 + i32.ne + if + br $folding-inner0 + end + i32.const 38 + call $~lib/rt/__typeinfo + i32.const 532 + i32.ne + if + br $folding-inner0 + end + i32.const 39 + call $~lib/rt/__typeinfo + i32.const 8340 + i32.ne + if + br $folding-inner0 + end + i32.const 40 + call $~lib/rt/__typeinfo + i32.const 12436 + i32.ne + if + br $folding-inner0 + end + i32.const 41 + call $~lib/rt/__typeinfo + i32.const 263224 + i32.ne + if + br $folding-inner0 + end + i32.const 42 + call $~lib/rt/__typeinfo + i32.const 656472 + i32.ne + if + br $folding-inner0 + end + i32.const 43 + call $~lib/rt/__typeinfo + i32.const 591000 + i32.ne + if + br $folding-inner0 + end + i32.const 44 + call $~lib/rt/__typeinfo + i32.const 558360 + i32.ne + if + br $folding-inner0 + end + i32.const 45 + call $~lib/rt/__typeinfo + i32.const 541208 + i32.ne + if + br $folding-inner0 + end + i32.const 46 + call $~lib/rt/__typeinfo + i32.const 4260920 + i32.ne + if + br $folding-inner0 + end + i32.const 47 + call $~lib/rt/__typeinfo + i32.const 6358072 + i32.ne + if + br $folding-inner0 + end + i32.const 48 + call $~lib/rt/__typeinfo + i32.const 549016 + i32.ne + if + br $folding-inner0 + end + i32.const 49 + call $~lib/rt/__typeinfo + i32.const 553112 + i32.ne + if + br $folding-inner0 + end + i32.const 50 + call $~lib/rt/__typeinfo + i32.const 6369432 + i32.ne + if + br $folding-inner0 + end + i32.const 51 + call $~lib/rt/__typeinfo + i32.const 1639576 + i32.ne + if + br $folding-inner0 + end + i32.const 52 + call $~lib/rt/__typeinfo + i32.const 16 + i32.ne + if + br $folding-inner0 + end + i32.const 53 + call $~lib/rt/__typeinfo + if + br $folding-inner0 + end + i32.const 54 + call $~lib/rt/__typeinfo + if + br $folding-inner0 + end + i32.const 56 + call $~lib/rt/__typeinfo + if + br $folding-inner0 + end + i32.const 58 + call $~lib/rt/__typeinfo + i32.const 16 + i32.ne + if + br $folding-inner0 + end + i32.const 59 + call $~lib/rt/__typeinfo + if + br $folding-inner0 + end + i32.const 61 + call $~lib/rt/__typeinfo + i32.const 16 + i32.ne + if + br $folding-inner0 + end + i32.const 62 + call $~lib/rt/__typeinfo + if + br $folding-inner0 + end + i32.const 64 + call $~lib/rt/__typeinfo + if + br $folding-inner0 + end + i32.const 66 + call $~lib/rt/__typeinfo + i32.const 16 + i32.ne + if + br $folding-inner0 + end + i32.const 67 + call $~lib/rt/__typeinfo + i32.const 16 + i32.ne + if + br $folding-inner0 + end + return + end + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + ) + (func $start (; 3 ;) (type $FUNCSIG$v) + call $start:rt/flags + ) + (func $null (; 4 ;) (type $FUNCSIG$v) + nop + ) +) diff --git a/tests/compiler/rt/flags.ts b/tests/compiler/rt/flags.ts new file mode 100644 index 0000000000..8bb921b941 --- /dev/null +++ b/tests/compiler/rt/flags.ts @@ -0,0 +1,147 @@ +/// + +import { TypeinfoFlags } from "shared/typeinfo"; + +function test(flags: TypeinfoFlags): void { + assert( + __typeinfo(idof()) + == + flags + ); +} + +// structure flags + +test(TypeinfoFlags.ARRAYBUFFERVIEW | TypeinfoFlags.ACYCLIC | TypeinfoFlags.VALUE_ALIGN_0 | TypeinfoFlags.VALUE_SIGNED); +test(TypeinfoFlags.ARRAYBUFFERVIEW | TypeinfoFlags.ACYCLIC | TypeinfoFlags.VALUE_ALIGN_0); +test(TypeinfoFlags.ARRAYBUFFERVIEW | TypeinfoFlags.ACYCLIC | TypeinfoFlags.VALUE_ALIGN_0); +test(TypeinfoFlags.ARRAYBUFFERVIEW | TypeinfoFlags.ACYCLIC | TypeinfoFlags.VALUE_ALIGN_1 | TypeinfoFlags.VALUE_SIGNED); +test(TypeinfoFlags.ARRAYBUFFERVIEW | TypeinfoFlags.ACYCLIC | TypeinfoFlags.VALUE_ALIGN_1); +test(TypeinfoFlags.ARRAYBUFFERVIEW | TypeinfoFlags.ACYCLIC | TypeinfoFlags.VALUE_ALIGN_2 | TypeinfoFlags.VALUE_SIGNED); +test(TypeinfoFlags.ARRAYBUFFERVIEW | TypeinfoFlags.ACYCLIC | TypeinfoFlags.VALUE_ALIGN_2); +test(TypeinfoFlags.ARRAYBUFFERVIEW | TypeinfoFlags.ACYCLIC | TypeinfoFlags.VALUE_ALIGN_3 | TypeinfoFlags.VALUE_SIGNED); +test(TypeinfoFlags.ARRAYBUFFERVIEW | TypeinfoFlags.ACYCLIC | TypeinfoFlags.VALUE_ALIGN_3); +test(TypeinfoFlags.ARRAYBUFFERVIEW | TypeinfoFlags.ACYCLIC | TypeinfoFlags.VALUE_ALIGN_2 | TypeinfoFlags.VALUE_SIGNED | TypeinfoFlags.VALUE_FLOAT); +test(TypeinfoFlags.ARRAYBUFFERVIEW | TypeinfoFlags.ACYCLIC | TypeinfoFlags.VALUE_ALIGN_3 | TypeinfoFlags.VALUE_SIGNED | TypeinfoFlags.VALUE_FLOAT); + +class Ref {} + +const VALUE_ALIGN_REF = sizeof() == 4 ? TypeinfoFlags.VALUE_ALIGN_2 : TypeinfoFlags.VALUE_ALIGN_3; +const KEY_ALIGN_REF = sizeof() == 4 ? TypeinfoFlags.KEY_ALIGN_2 : TypeinfoFlags.KEY_ALIGN_3; + +test>(TypeinfoFlags.ARRAYBUFFERVIEW | TypeinfoFlags.ARRAY | TypeinfoFlags.ACYCLIC | TypeinfoFlags.VALUE_ALIGN_0 | TypeinfoFlags.VALUE_SIGNED); +test>(TypeinfoFlags.ARRAYBUFFERVIEW | TypeinfoFlags.ARRAY | TypeinfoFlags.ACYCLIC | TypeinfoFlags.VALUE_ALIGN_0); +test>(TypeinfoFlags.ARRAYBUFFERVIEW | TypeinfoFlags.ARRAY | TypeinfoFlags.ACYCLIC | TypeinfoFlags.VALUE_ALIGN_1 | TypeinfoFlags.VALUE_SIGNED); +test>(TypeinfoFlags.ARRAYBUFFERVIEW | TypeinfoFlags.ARRAY | TypeinfoFlags.ACYCLIC | TypeinfoFlags.VALUE_ALIGN_1); +test>(TypeinfoFlags.ARRAYBUFFERVIEW | TypeinfoFlags.ARRAY | TypeinfoFlags.ACYCLIC | TypeinfoFlags.VALUE_ALIGN_2 | TypeinfoFlags.VALUE_SIGNED); +test>(TypeinfoFlags.ARRAYBUFFERVIEW | TypeinfoFlags.ARRAY | TypeinfoFlags.ACYCLIC | TypeinfoFlags.VALUE_ALIGN_2); +test>(TypeinfoFlags.ARRAYBUFFERVIEW | TypeinfoFlags.ARRAY | TypeinfoFlags.ACYCLIC | TypeinfoFlags.VALUE_ALIGN_3 | TypeinfoFlags.VALUE_SIGNED); +test>(TypeinfoFlags.ARRAYBUFFERVIEW | TypeinfoFlags.ARRAY | TypeinfoFlags.ACYCLIC | TypeinfoFlags.VALUE_ALIGN_3); +test>(TypeinfoFlags.ARRAYBUFFERVIEW | TypeinfoFlags.ARRAY | TypeinfoFlags.ACYCLIC | TypeinfoFlags.VALUE_ALIGN_2 | TypeinfoFlags.VALUE_SIGNED | TypeinfoFlags.VALUE_FLOAT); +test>(TypeinfoFlags.ARRAYBUFFERVIEW | TypeinfoFlags.ARRAY | TypeinfoFlags.ACYCLIC | TypeinfoFlags.VALUE_ALIGN_3 | TypeinfoFlags.VALUE_SIGNED | TypeinfoFlags.VALUE_FLOAT); +test>(TypeinfoFlags.ARRAYBUFFERVIEW | TypeinfoFlags.ARRAY | TypeinfoFlags.ACYCLIC | TypeinfoFlags.VALUE_ALIGN_4); +test>(TypeinfoFlags.ARRAYBUFFERVIEW | TypeinfoFlags.ARRAY | TypeinfoFlags.ACYCLIC | VALUE_ALIGN_REF | TypeinfoFlags.VALUE_MANAGED); +test>(TypeinfoFlags.ARRAYBUFFERVIEW | TypeinfoFlags.ARRAY | TypeinfoFlags.ACYCLIC | VALUE_ALIGN_REF | TypeinfoFlags.VALUE_NULLABLE | TypeinfoFlags.VALUE_MANAGED); + +test>(TypeinfoFlags.SET | TypeinfoFlags.ACYCLIC | TypeinfoFlags.VALUE_ALIGN_0 | TypeinfoFlags.VALUE_SIGNED); +test>(TypeinfoFlags.SET | TypeinfoFlags.ACYCLIC | TypeinfoFlags.VALUE_ALIGN_0); +test>(TypeinfoFlags.SET | TypeinfoFlags.ACYCLIC | TypeinfoFlags.VALUE_ALIGN_1 | TypeinfoFlags.VALUE_SIGNED); +test>(TypeinfoFlags.SET | TypeinfoFlags.ACYCLIC | TypeinfoFlags.VALUE_ALIGN_1); +test>(TypeinfoFlags.SET | TypeinfoFlags.ACYCLIC | TypeinfoFlags.VALUE_ALIGN_2 | TypeinfoFlags.VALUE_SIGNED); +test>(TypeinfoFlags.SET | TypeinfoFlags.ACYCLIC | TypeinfoFlags.VALUE_ALIGN_2); +test>(TypeinfoFlags.SET | TypeinfoFlags.ACYCLIC | TypeinfoFlags.VALUE_ALIGN_3 | TypeinfoFlags.VALUE_SIGNED); +test>(TypeinfoFlags.SET | TypeinfoFlags.ACYCLIC | TypeinfoFlags.VALUE_ALIGN_3); +test>(TypeinfoFlags.SET | TypeinfoFlags.ACYCLIC | TypeinfoFlags.VALUE_ALIGN_2 | TypeinfoFlags.VALUE_SIGNED | TypeinfoFlags.VALUE_FLOAT); +test>(TypeinfoFlags.SET | TypeinfoFlags.ACYCLIC | TypeinfoFlags.VALUE_ALIGN_3 | TypeinfoFlags.VALUE_SIGNED | TypeinfoFlags.VALUE_FLOAT); +test>(TypeinfoFlags.SET | TypeinfoFlags.ACYCLIC | TypeinfoFlags.VALUE_ALIGN_4); +test>(TypeinfoFlags.SET | TypeinfoFlags.ACYCLIC | VALUE_ALIGN_REF | TypeinfoFlags.VALUE_MANAGED); +test>(TypeinfoFlags.SET | TypeinfoFlags.ACYCLIC | VALUE_ALIGN_REF | TypeinfoFlags.VALUE_NULLABLE | TypeinfoFlags.VALUE_MANAGED); + +test>(TypeinfoFlags.MAP | TypeinfoFlags.ACYCLIC | TypeinfoFlags.KEY_ALIGN_4 | TypeinfoFlags.VALUE_ALIGN_0 | TypeinfoFlags.VALUE_SIGNED); +test>(TypeinfoFlags.MAP | TypeinfoFlags.ACYCLIC | TypeinfoFlags.KEY_ALIGN_3 | TypeinfoFlags.KEY_SIGNED | TypeinfoFlags.VALUE_ALIGN_1 | TypeinfoFlags.VALUE_SIGNED); +test>(TypeinfoFlags.MAP | TypeinfoFlags.ACYCLIC | TypeinfoFlags.KEY_ALIGN_2 | TypeinfoFlags.KEY_SIGNED | TypeinfoFlags.VALUE_ALIGN_2 | TypeinfoFlags.VALUE_SIGNED); +test>(TypeinfoFlags.MAP | TypeinfoFlags.ACYCLIC | TypeinfoFlags.KEY_ALIGN_1 | TypeinfoFlags.KEY_SIGNED | TypeinfoFlags.VALUE_ALIGN_3 | TypeinfoFlags.VALUE_SIGNED); +test>(TypeinfoFlags.MAP | TypeinfoFlags.ACYCLIC | TypeinfoFlags.KEY_ALIGN_0 | TypeinfoFlags.KEY_SIGNED | TypeinfoFlags.VALUE_ALIGN_4); +test>(TypeinfoFlags.MAP | TypeinfoFlags.ACYCLIC | KEY_ALIGN_REF | TypeinfoFlags.KEY_MANAGED | TypeinfoFlags.VALUE_ALIGN_0 | TypeinfoFlags.VALUE_SIGNED); +test>(TypeinfoFlags.MAP | TypeinfoFlags.ACYCLIC |KEY_ALIGN_REF | TypeinfoFlags.KEY_NULLABLE | TypeinfoFlags.KEY_MANAGED | TypeinfoFlags.VALUE_ALIGN_0 | TypeinfoFlags.VALUE_SIGNED); +test>(TypeinfoFlags.MAP | TypeinfoFlags.ACYCLIC | TypeinfoFlags.KEY_ALIGN_0 | TypeinfoFlags.KEY_SIGNED | TypeinfoFlags.VALUE_MANAGED | VALUE_ALIGN_REF); +test>(TypeinfoFlags.MAP | TypeinfoFlags.ACYCLIC | TypeinfoFlags.KEY_ALIGN_0 | TypeinfoFlags.KEY_SIGNED | TypeinfoFlags.VALUE_NULLABLE | TypeinfoFlags.VALUE_MANAGED | VALUE_ALIGN_REF); +test>(TypeinfoFlags.MAP | TypeinfoFlags.ACYCLIC | TypeinfoFlags.KEY_NULLABLE | TypeinfoFlags.KEY_MANAGED | KEY_ALIGN_REF | TypeinfoFlags.VALUE_NULLABLE | TypeinfoFlags.VALUE_MANAGED | VALUE_ALIGN_REF); +test>(TypeinfoFlags.MAP | TypeinfoFlags.ACYCLIC | TypeinfoFlags.KEY_ALIGN_2 | TypeinfoFlags.KEY_SIGNED | TypeinfoFlags.KEY_FLOAT | TypeinfoFlags.VALUE_ALIGN_2 | TypeinfoFlags.VALUE_SIGNED); + +// cycle detection + +class NoCycle { + a: i32; +} + +test(TypeinfoFlags.ACYCLIC); + +class DirectCycle { + a: DirectCycle; +} + +test(TypeinfoFlags.NONE); + +class IndirectCycle { + a: IndirectCycleBack; +} +class IndirectCycleBack { + a: IndirectCycle; +} + +test(TypeinfoFlags.NONE); + +// array + +class IndirectCycleArray { + a: Array; +} + +test(TypeinfoFlags.NONE); + +class InnerCycleArray { + a: IndirectCycleArray; +} + +test(TypeinfoFlags.ACYCLIC); + +// set + +class IndirectCycleSet { + a: Set; +} + +test(TypeinfoFlags.NONE); + +class InnerCycleSet { + a: IndirectCycleSet; +} + +test(TypeinfoFlags.ACYCLIC); + +// map + +class IndirectCycleMapKey { + a: Map; +} + +test(TypeinfoFlags.NONE); + +class IndirectCycleMapValue { + a: Map; +} + +test(TypeinfoFlags.NONE); + +class InnerCycleMapKey { + a: IndirectCycleMapKey; +} + +test(TypeinfoFlags.ACYCLIC); + +class InnerCycleMapValue { + a: IndirectCycleMapValue; +} + +test(TypeinfoFlags.ACYCLIC); diff --git a/tests/compiler/rt/flags.untouched.wat b/tests/compiler/rt/flags.untouched.wat new file mode 100644 index 0000000000..54958f4238 --- /dev/null +++ b/tests/compiler/rt/flags.untouched.wat @@ -0,0 +1,1404 @@ +(module + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$v (func)) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (memory $0 1) + (data (i32.const 8) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 64) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s\00") + (data (i32.const 104) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00r\00t\00/\00f\00l\00a\00g\00s\00.\00t\00s\00") + (data (i32.const 144) "D\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\001\04\00\00\02\00\00\001\00\00\00\02\00\00\001\00\00\00\02\00\00\00Q\04\00\00\02\00\00\00Q\00\00\00\02\00\00\00\91\04\00\00\02\00\00\00\91\00\00\00\02\00\00\00\11\05\00\00\02\00\00\00\11\01\00\00\02\00\00\00\91\0c\00\00\02\00\00\00\11\0d\00\00\02\00\00\003\04\00\00\02\00\00\003\00\00\00\02\00\00\00S\04\00\00\02\00\00\00S\00\00\00\02\00\00\00\93\04\00\00\02\00\00\00\93\00\00\00\02\00\00\00\13\05\00\00\02\00\00\00\13\01\00\00\02\00\00\00\93\0c\00\00\02\00\00\00\13\0d\00\00\02\00\00\00\13\02\00\00\02\00\00\00\10\00\00\00\00\00\00\00\93 \00\00\02\00\00\00\930\00\00\02\00\00\004\04\00\00\00\00\00\004\00\00\00\00\00\00\00T\04\00\00\00\00\00\00T\00\00\00\00\00\00\00\94\04\00\00\00\00\00\00\94\00\00\00\00\00\00\00\14\05\00\00\00\00\00\00\14\01\00\00\00\00\00\00\94\0c\00\00\00\00\00\00\14\0d\00\00\00\00\00\00\14\02\00\00\00\00\00\00\94 \00\00\00\00\00\00\940\00\00\00\00\00\008\04\04\00\00\00\00\00X\04\n\00\00\00\00\00\98\04\t\00\00\00\00\00\18\85\08\00\00\00\00\00\18B\08\00\00\00\00\008\04A\00\00\00\00\008\04a\00\00\00\00\00\98`\08\00\00\00\00\00\98p\08\00\00\00\00\00\980a\00\00\00\00\00\98\04\19\00\00\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\83 \00\00\02\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\84 \00\00\00\00\00\00\10\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\88\04A\00\00\00\00\00\00\00\00\00\00\00\00\00\88 \t\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $rt/flags/VALUE_ALIGN_REF i32 (i32.const 128)) + (global $rt/flags/KEY_ALIGN_REF i32 (i32.const 65536)) + (global $~lib/rt/__rtti_base i32 (i32.const 144)) + (export "memory" (memory $0)) + (start $start) + (func $~lib/rt/__typeinfo (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/rt/__rtti_base + local.set $1 + local.get $0 + local.get $1 + i32.load + i32.gt_u + if + i32.const 24 + i32.const 80 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 4 + i32.add + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $rt/flags/test<~lib/typedarray/Int8Array> (; 2 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 3 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/typedarray/Uint8Array> (; 3 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 4 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/typedarray/Uint8ClampedArray> (; 4 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 5 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/typedarray/Int16Array> (; 5 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 6 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/typedarray/Uint16Array> (; 6 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 7 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/typedarray/Int32Array> (; 7 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 8 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/typedarray/Uint32Array> (; 8 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 9 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/typedarray/Int64Array> (; 9 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 10 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/typedarray/Uint64Array> (; 10 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 11 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/typedarray/Float32Array> (; 11 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 12 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/typedarray/Float64Array> (; 12 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 13 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/array/Array> (; 13 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 14 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/array/Array> (; 14 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 15 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/array/Array> (; 15 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 16 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/array/Array> (; 16 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 17 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/array/Array> (; 17 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 18 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/array/Array> (; 18 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 19 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/array/Array> (; 19 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 20 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/array/Array> (; 20 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 21 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/array/Array> (; 21 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 22 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/array/Array> (; 22 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 23 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/array/Array> (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 24 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/array/Array> (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 26 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/array/Array> (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 27 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/set/Set> (; 26 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 28 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/set/Set> (; 27 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 29 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/set/Set> (; 28 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 30 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/set/Set> (; 29 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 31 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/set/Set> (; 30 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 32 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/set/Set> (; 31 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 33 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/set/Set> (; 32 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 34 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/set/Set> (; 33 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 35 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/set/Set> (; 34 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 36 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/set/Set> (; 35 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 37 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/set/Set> (; 36 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 38 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/set/Set> (; 37 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 39 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/set/Set> (; 38 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 40 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/map/Map> (; 39 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 41 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/map/Map> (; 40 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 42 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/map/Map> (; 41 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 43 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/map/Map> (; 42 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 44 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/map/Map> (; 43 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 45 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/map/Map> (; 44 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 46 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/map/Map> (; 45 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 47 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/map/Map> (; 46 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 48 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/map/Map> (; 47 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 49 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/map/Map> (; 48 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 50 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test<~lib/map/Map> (; 49 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 51 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test (; 50 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 52 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test (; 51 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 53 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test (; 52 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 54 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test (; 53 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 56 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test (; 54 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 58 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test (; 55 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 59 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test (; 56 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 61 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test (; 57 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 62 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test (; 58 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 64 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test (; 59 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 66 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $rt/flags/test (; 60 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 67 + call $~lib/rt/__typeinfo + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 120 + i32.const 6 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $start:rt/flags (; 61 ;) (type $FUNCSIG$v) + i32.const 1 + i32.const 16 + i32.or + i32.const 32 + i32.or + i32.const 1024 + i32.or + call $rt/flags/test<~lib/typedarray/Int8Array> + i32.const 1 + i32.const 16 + i32.or + i32.const 32 + i32.or + call $rt/flags/test<~lib/typedarray/Uint8Array> + i32.const 1 + i32.const 16 + i32.or + i32.const 32 + i32.or + call $rt/flags/test<~lib/typedarray/Uint8ClampedArray> + i32.const 1 + i32.const 16 + i32.or + i32.const 64 + i32.or + i32.const 1024 + i32.or + call $rt/flags/test<~lib/typedarray/Int16Array> + i32.const 1 + i32.const 16 + i32.or + i32.const 64 + i32.or + call $rt/flags/test<~lib/typedarray/Uint16Array> + i32.const 1 + i32.const 16 + i32.or + i32.const 128 + i32.or + i32.const 1024 + i32.or + call $rt/flags/test<~lib/typedarray/Int32Array> + i32.const 1 + i32.const 16 + i32.or + i32.const 128 + i32.or + call $rt/flags/test<~lib/typedarray/Uint32Array> + i32.const 1 + i32.const 16 + i32.or + i32.const 256 + i32.or + i32.const 1024 + i32.or + call $rt/flags/test<~lib/typedarray/Int64Array> + i32.const 1 + i32.const 16 + i32.or + i32.const 256 + i32.or + call $rt/flags/test<~lib/typedarray/Uint64Array> + i32.const 1 + i32.const 16 + i32.or + i32.const 128 + i32.or + i32.const 1024 + i32.or + i32.const 2048 + i32.or + call $rt/flags/test<~lib/typedarray/Float32Array> + i32.const 1 + i32.const 16 + i32.or + i32.const 256 + i32.or + i32.const 1024 + i32.or + i32.const 2048 + i32.or + call $rt/flags/test<~lib/typedarray/Float64Array> + i32.const 1 + i32.const 2 + i32.or + i32.const 16 + i32.or + i32.const 32 + i32.or + i32.const 1024 + i32.or + call $rt/flags/test<~lib/array/Array> + i32.const 1 + i32.const 2 + i32.or + i32.const 16 + i32.or + i32.const 32 + i32.or + call $rt/flags/test<~lib/array/Array> + i32.const 1 + i32.const 2 + i32.or + i32.const 16 + i32.or + i32.const 64 + i32.or + i32.const 1024 + i32.or + call $rt/flags/test<~lib/array/Array> + i32.const 1 + i32.const 2 + i32.or + i32.const 16 + i32.or + i32.const 64 + i32.or + call $rt/flags/test<~lib/array/Array> + i32.const 1 + i32.const 2 + i32.or + i32.const 16 + i32.or + i32.const 128 + i32.or + i32.const 1024 + i32.or + call $rt/flags/test<~lib/array/Array> + i32.const 1 + i32.const 2 + i32.or + i32.const 16 + i32.or + i32.const 128 + i32.or + call $rt/flags/test<~lib/array/Array> + i32.const 1 + i32.const 2 + i32.or + i32.const 16 + i32.or + i32.const 256 + i32.or + i32.const 1024 + i32.or + call $rt/flags/test<~lib/array/Array> + i32.const 1 + i32.const 2 + i32.or + i32.const 16 + i32.or + i32.const 256 + i32.or + call $rt/flags/test<~lib/array/Array> + i32.const 1 + i32.const 2 + i32.or + i32.const 16 + i32.or + i32.const 128 + i32.or + i32.const 1024 + i32.or + i32.const 2048 + i32.or + call $rt/flags/test<~lib/array/Array> + i32.const 1 + i32.const 2 + i32.or + i32.const 16 + i32.or + i32.const 256 + i32.or + i32.const 1024 + i32.or + i32.const 2048 + i32.or + call $rt/flags/test<~lib/array/Array> + i32.const 1 + i32.const 2 + i32.or + i32.const 16 + i32.or + i32.const 512 + i32.or + call $rt/flags/test<~lib/array/Array> + i32.const 1 + i32.const 2 + i32.or + i32.const 16 + i32.or + global.get $rt/flags/VALUE_ALIGN_REF + i32.or + i32.const 8192 + i32.or + call $rt/flags/test<~lib/array/Array> + i32.const 1 + i32.const 2 + i32.or + i32.const 16 + i32.or + global.get $rt/flags/VALUE_ALIGN_REF + i32.or + i32.const 4096 + i32.or + i32.const 8192 + i32.or + call $rt/flags/test<~lib/array/Array> + i32.const 4 + i32.const 16 + i32.or + i32.const 32 + i32.or + i32.const 1024 + i32.or + call $rt/flags/test<~lib/set/Set> + i32.const 4 + i32.const 16 + i32.or + i32.const 32 + i32.or + call $rt/flags/test<~lib/set/Set> + i32.const 4 + i32.const 16 + i32.or + i32.const 64 + i32.or + i32.const 1024 + i32.or + call $rt/flags/test<~lib/set/Set> + i32.const 4 + i32.const 16 + i32.or + i32.const 64 + i32.or + call $rt/flags/test<~lib/set/Set> + i32.const 4 + i32.const 16 + i32.or + i32.const 128 + i32.or + i32.const 1024 + i32.or + call $rt/flags/test<~lib/set/Set> + i32.const 4 + i32.const 16 + i32.or + i32.const 128 + i32.or + call $rt/flags/test<~lib/set/Set> + i32.const 4 + i32.const 16 + i32.or + i32.const 256 + i32.or + i32.const 1024 + i32.or + call $rt/flags/test<~lib/set/Set> + i32.const 4 + i32.const 16 + i32.or + i32.const 256 + i32.or + call $rt/flags/test<~lib/set/Set> + i32.const 4 + i32.const 16 + i32.or + i32.const 128 + i32.or + i32.const 1024 + i32.or + i32.const 2048 + i32.or + call $rt/flags/test<~lib/set/Set> + i32.const 4 + i32.const 16 + i32.or + i32.const 256 + i32.or + i32.const 1024 + i32.or + i32.const 2048 + i32.or + call $rt/flags/test<~lib/set/Set> + i32.const 4 + i32.const 16 + i32.or + i32.const 512 + i32.or + call $rt/flags/test<~lib/set/Set> + i32.const 4 + i32.const 16 + i32.or + global.get $rt/flags/VALUE_ALIGN_REF + i32.or + i32.const 8192 + i32.or + call $rt/flags/test<~lib/set/Set> + i32.const 4 + i32.const 16 + i32.or + global.get $rt/flags/VALUE_ALIGN_REF + i32.or + i32.const 4096 + i32.or + i32.const 8192 + i32.or + call $rt/flags/test<~lib/set/Set> + i32.const 8 + i32.const 16 + i32.or + i32.const 262144 + i32.or + i32.const 32 + i32.or + i32.const 1024 + i32.or + call $rt/flags/test<~lib/map/Map> + i32.const 8 + i32.const 16 + i32.or + i32.const 131072 + i32.or + i32.const 524288 + i32.or + i32.const 64 + i32.or + i32.const 1024 + i32.or + call $rt/flags/test<~lib/map/Map> + i32.const 8 + i32.const 16 + i32.or + i32.const 65536 + i32.or + i32.const 524288 + i32.or + i32.const 128 + i32.or + i32.const 1024 + i32.or + call $rt/flags/test<~lib/map/Map> + i32.const 8 + i32.const 16 + i32.or + i32.const 32768 + i32.or + i32.const 524288 + i32.or + i32.const 256 + i32.or + i32.const 1024 + i32.or + call $rt/flags/test<~lib/map/Map> + i32.const 8 + i32.const 16 + i32.or + i32.const 16384 + i32.or + i32.const 524288 + i32.or + i32.const 512 + i32.or + call $rt/flags/test<~lib/map/Map> + i32.const 8 + i32.const 16 + i32.or + global.get $rt/flags/KEY_ALIGN_REF + i32.or + i32.const 4194304 + i32.or + i32.const 32 + i32.or + i32.const 1024 + i32.or + call $rt/flags/test<~lib/map/Map> + i32.const 8 + i32.const 16 + i32.or + global.get $rt/flags/KEY_ALIGN_REF + i32.or + i32.const 2097152 + i32.or + i32.const 4194304 + i32.or + i32.const 32 + i32.or + i32.const 1024 + i32.or + call $rt/flags/test<~lib/map/Map> + i32.const 8 + i32.const 16 + i32.or + i32.const 16384 + i32.or + i32.const 524288 + i32.or + i32.const 8192 + i32.or + global.get $rt/flags/VALUE_ALIGN_REF + i32.or + call $rt/flags/test<~lib/map/Map> + i32.const 8 + i32.const 16 + i32.or + i32.const 16384 + i32.or + i32.const 524288 + i32.or + i32.const 4096 + i32.or + i32.const 8192 + i32.or + global.get $rt/flags/VALUE_ALIGN_REF + i32.or + call $rt/flags/test<~lib/map/Map> + i32.const 8 + i32.const 16 + i32.or + i32.const 2097152 + i32.or + i32.const 4194304 + i32.or + global.get $rt/flags/KEY_ALIGN_REF + i32.or + i32.const 4096 + i32.or + i32.const 8192 + i32.or + global.get $rt/flags/VALUE_ALIGN_REF + i32.or + call $rt/flags/test<~lib/map/Map> + i32.const 8 + i32.const 16 + i32.or + i32.const 65536 + i32.or + i32.const 524288 + i32.or + i32.const 1048576 + i32.or + i32.const 128 + i32.or + i32.const 1024 + i32.or + call $rt/flags/test<~lib/map/Map> + i32.const 16 + call $rt/flags/test + i32.const 0 + call $rt/flags/test + i32.const 0 + call $rt/flags/test + i32.const 0 + call $rt/flags/test + i32.const 16 + call $rt/flags/test + i32.const 0 + call $rt/flags/test + i32.const 16 + call $rt/flags/test + i32.const 0 + call $rt/flags/test + i32.const 0 + call $rt/flags/test + i32.const 16 + call $rt/flags/test + i32.const 16 + call $rt/flags/test + ) + (func $start (; 62 ;) (type $FUNCSIG$v) + call $start:rt/flags + ) + (func $null (; 63 ;) (type $FUNCSIG$v) + ) +) diff --git a/tests/compiler/rt/ids.json b/tests/compiler/rt/ids.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/rt/ids.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/rt/ids.optimized.wat b/tests/compiler/rt/ids.optimized.wat new file mode 100644 index 0000000000..01c473892d --- /dev/null +++ b/tests/compiler/rt/ids.optimized.wat @@ -0,0 +1,9 @@ +(module + (type $FUNCSIG$v (func)) + (memory $0 1) + (data (i32.const 8) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\00r\00t\00/\00i\00d\00s\00.\00t\00s") + (export "memory" (memory $0)) + (func $start (; 0 ;) (type $FUNCSIG$v) + nop + ) +) diff --git a/tests/compiler/rt/ids.ts b/tests/compiler/rt/ids.ts new file mode 100644 index 0000000000..962bbb2dea --- /dev/null +++ b/tests/compiler/rt/ids.ts @@ -0,0 +1,5 @@ +import { ArrayBufferView } from "arraybuffer"; + +assert(idof() == 0); +assert(idof() == 1); +assert(idof() == 2); diff --git a/tests/compiler/rt/ids.untouched.wat b/tests/compiler/rt/ids.untouched.wat new file mode 100644 index 0000000000..aa86317bc6 --- /dev/null +++ b/tests/compiler/rt/ids.untouched.wat @@ -0,0 +1,54 @@ +(module + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$v (func)) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (memory $0 1) + (data (i32.const 8) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\00r\00t\00/\00i\00d\00s\00.\00t\00s\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (export "memory" (memory $0)) + (start $start) + (func $start:rt/ids (; 1 ;) (type $FUNCSIG$v) + i32.const 0 + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 3 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 4 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 2 + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 5 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + ) + (func $start (; 2 ;) (type $FUNCSIG$v) + call $start:rt/ids + ) + (func $null (; 3 ;) (type $FUNCSIG$v) + ) +) diff --git a/tests/compiler/rt/instanceof.json b/tests/compiler/rt/instanceof.json new file mode 100644 index 0000000000..bf222c4d2d --- /dev/null +++ b/tests/compiler/rt/instanceof.json @@ -0,0 +1,6 @@ +{ + "asc_flags": [ + "--runtime none", + "--explicitStart" + ] +} \ No newline at end of file diff --git a/tests/compiler/rt/instanceof.optimized.wat b/tests/compiler/rt/instanceof.optimized.wat new file mode 100644 index 0000000000..254d627c2f --- /dev/null +++ b/tests/compiler/rt/instanceof.optimized.wat @@ -0,0 +1,547 @@ +(module + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$i (func (result i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (memory $0 1) + (data (i32.const 8) " \00\00\00\01\00\00\00\01\00\00\00 \00\00\00r\00t\00/\00i\00n\00s\00t\00a\00n\00c\00e\00o\00f\00.\00t\00s") + (data (i32.const 56) "\06\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\03\00\00\00\10\00\00\00\04") + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) + (global $rt/instanceof/animal (mut i32) (i32.const 0)) + (global $rt/instanceof/cat (mut i32) (i32.const 0)) + (global $rt/instanceof/blackcat (mut i32) (i32.const 0)) + (global $rt/instanceof/nullableAnimal (mut i32) (i32.const 0)) + (global $rt/instanceof/nullableCat (mut i32) (i32.const 0)) + (global $rt/instanceof/nullableBlackcat (mut i32) (i32.const 0)) + (global $rt/instanceof/nullAnimal i32 (i32.const 0)) + (global $rt/instanceof/nullCat i32 (i32.const 0)) + (global $rt/instanceof/nullBlackcat i32 (i32.const 0)) + (global $~lib/started (mut i32) (i32.const 0)) + (export "__start" (func $start)) + (export "memory" (memory $0)) + (func $~lib/rt/stub/__alloc (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.tee $2 + i32.const 16 + i32.add + i32.const -16 + i32.and + local.tee $1 + memory.size + local.tee $3 + i32.const 16 + i32.shl + i32.gt_u + if + local.get $3 + local.get $1 + local.get $2 + i32.sub + i32.const 65535 + i32.add + i32.const -65536 + i32.and + i32.const 16 + i32.shr_u + local.tee $4 + local.get $3 + local.get $4 + i32.gt_s + select + memory.grow + i32.const 0 + i32.lt_s + if + local.get $4 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + end + local.get $1 + global.set $~lib/rt/stub/offset + local.get $2 + i32.const 16 + i32.sub + local.tee $1 + local.get $0 + i32.store offset=8 + local.get $1 + i32.const 0 + i32.store offset=12 + local.get $2 + ) + (func $rt/instanceof/Animal#constructor (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 3 + call $~lib/rt/stub/__alloc + local.set $0 + end + local.get $0 + ) + (func $rt/instanceof/Cat#constructor (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 4 + call $~lib/rt/stub/__alloc + local.set $0 + end + local.get $0 + call $rt/instanceof/Animal#constructor + ) + (func $rt/instanceof/BlackCat#constructor (; 4 ;) (type $FUNCSIG$i) (result i32) + i32.const 5 + call $~lib/rt/stub/__alloc + call $rt/instanceof/Cat#constructor + ) + (func $~lib/rt/__instanceof (; 5 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=8 + local.tee $0 + i32.const 56 + i32.load + i32.le_u + if + loop $continue|0 + local.get $0 + local.get $1 + i32.eq + if + i32.const 1 + return + end + local.get $0 + i32.const 3 + i32.shl + i32.const 60 + i32.add + i32.load offset=4 + local.tee $0 + br_if $continue|0 + end + end + i32.const 0 + ) + (func $start:rt/instanceof (; 6 ;) (type $FUNCSIG$v) + (local $0 i32) + i32.const 112 + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset + i32.const 0 + call $rt/instanceof/Animal#constructor + global.set $rt/instanceof/animal + i32.const 0 + call $rt/instanceof/Cat#constructor + global.set $rt/instanceof/cat + call $rt/instanceof/BlackCat#constructor + global.set $rt/instanceof/blackcat + global.get $rt/instanceof/animal + local.tee $0 + if (result i32) + local.get $0 + i32.const 4 + call $~lib/rt/__instanceof + else + i32.const 0 + end + if + i32.const 0 + i32.const 24 + i32.const 10 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/animal + local.tee $0 + if (result i32) + local.get $0 + i32.const 5 + call $~lib/rt/__instanceof + else + i32.const 0 + end + if + i32.const 0 + i32.const 24 + i32.const 11 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/cat + local.tee $0 + if (result i32) + local.get $0 + i32.const 4 + call $~lib/rt/__instanceof + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 14 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/cat + local.tee $0 + if (result i32) + local.get $0 + i32.const 5 + call $~lib/rt/__instanceof + else + i32.const 0 + end + if + i32.const 0 + i32.const 24 + i32.const 15 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/blackcat + local.tee $0 + if (result i32) + local.get $0 + i32.const 4 + call $~lib/rt/__instanceof + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 18 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/blackcat + local.tee $0 + if (result i32) + local.get $0 + i32.const 5 + call $~lib/rt/__instanceof + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 19 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + call $rt/instanceof/Animal#constructor + global.set $rt/instanceof/nullableAnimal + i32.const 0 + call $rt/instanceof/Cat#constructor + global.set $rt/instanceof/nullableCat + call $rt/instanceof/BlackCat#constructor + global.set $rt/instanceof/nullableBlackcat + global.get $rt/instanceof/nullableAnimal + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 25 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/nullableAnimal + local.tee $0 + if (result i32) + local.get $0 + i32.const 4 + call $~lib/rt/__instanceof + else + i32.const 0 + end + if + i32.const 0 + i32.const 24 + i32.const 26 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/nullableAnimal + local.tee $0 + if (result i32) + local.get $0 + i32.const 5 + call $~lib/rt/__instanceof + else + i32.const 0 + end + if + i32.const 0 + i32.const 24 + i32.const 27 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/nullableCat + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 29 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/nullableCat + local.tee $0 + if (result i32) + local.get $0 + i32.const 4 + call $~lib/rt/__instanceof + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 30 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/nullableCat + local.tee $0 + if (result i32) + local.get $0 + i32.const 5 + call $~lib/rt/__instanceof + else + i32.const 0 + end + if + i32.const 0 + i32.const 24 + i32.const 31 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/nullableBlackcat + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 33 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/nullableBlackcat + local.tee $0 + if (result i32) + local.get $0 + i32.const 4 + call $~lib/rt/__instanceof + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 34 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/nullableBlackcat + local.tee $0 + if (result i32) + local.get $0 + i32.const 5 + call $~lib/rt/__instanceof + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 35 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/nullAnimal + if + i32.const 0 + i32.const 24 + i32.const 41 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/nullAnimal + local.tee $0 + if (result i32) + local.get $0 + i32.const 4 + call $~lib/rt/__instanceof + else + i32.const 0 + end + if + i32.const 0 + i32.const 24 + i32.const 42 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/nullAnimal + local.tee $0 + if (result i32) + local.get $0 + i32.const 5 + call $~lib/rt/__instanceof + else + i32.const 0 + end + if + i32.const 0 + i32.const 24 + i32.const 43 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/nullCat + if + i32.const 0 + i32.const 24 + i32.const 45 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/nullCat + local.tee $0 + if (result i32) + local.get $0 + i32.const 4 + call $~lib/rt/__instanceof + else + i32.const 0 + end + if + i32.const 0 + i32.const 24 + i32.const 46 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/nullCat + local.tee $0 + if (result i32) + local.get $0 + i32.const 5 + call $~lib/rt/__instanceof + else + i32.const 0 + end + if + i32.const 0 + i32.const 24 + i32.const 47 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/nullBlackcat + if + i32.const 0 + i32.const 24 + i32.const 49 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/nullBlackcat + local.tee $0 + if (result i32) + local.get $0 + i32.const 4 + call $~lib/rt/__instanceof + else + i32.const 0 + end + if + i32.const 0 + i32.const 24 + i32.const 50 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/nullBlackcat + local.tee $0 + if (result i32) + local.get $0 + i32.const 5 + call $~lib/rt/__instanceof + else + i32.const 0 + end + if + i32.const 0 + i32.const 24 + i32.const 51 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + ) + (func $start (; 7 ;) (type $FUNCSIG$v) + global.get $~lib/started + if + return + else + i32.const 1 + global.set $~lib/started + end + call $start:rt/instanceof + ) + (func $null (; 8 ;) (type $FUNCSIG$v) + nop + ) +) diff --git a/tests/compiler/rt/instanceof.ts b/tests/compiler/rt/instanceof.ts new file mode 100644 index 0000000000..243bda7f48 --- /dev/null +++ b/tests/compiler/rt/instanceof.ts @@ -0,0 +1,51 @@ +class Animal {} +class Cat extends Animal {} +class BlackCat extends Cat {} + +var animal: Animal = new Animal(); +var cat: Animal = new Cat(); +var blackcat: Animal = new BlackCat(); + +assert(animal instanceof Animal); // static true +assert(!(animal instanceof Cat)); // dynamic false +assert(!(animal instanceof BlackCat)); // dynamic false + +assert(cat instanceof Animal); // static true +assert(cat instanceof Cat); // dynamic true +assert(!(cat instanceof BlackCat)); // dynamic false + +assert(blackcat instanceof Animal); // static true +assert(blackcat instanceof Cat); // dynamic true +assert(blackcat instanceof BlackCat); // dynamic true + +var nullableAnimal: Animal | null = new Animal(); +var nullableCat: Animal | null = new Cat(); +var nullableBlackcat: Animal | null = new BlackCat(); + +assert(nullableAnimal instanceof Animal); // static true +assert(!(nullableAnimal instanceof Cat)); // dynamic false +assert(!(nullableAnimal instanceof BlackCat)); // dynamic false + +assert(nullableCat instanceof Animal); // static true +assert(nullableCat instanceof Cat); // dynamic true +assert(!(nullableCat instanceof BlackCat)); // dynamic false + +assert(nullableBlackcat instanceof Animal); // static true +assert(nullableBlackcat instanceof Cat); // dynamic true +assert(nullableBlackcat instanceof BlackCat); // dynamic true + +var nullAnimal: Animal | null = null; +var nullCat: Animal | null = null; +var nullBlackcat: Animal | null = null; + +assert(!(nullAnimal instanceof Animal)); // static false +assert(!(nullAnimal instanceof Cat)); // dynamic false +assert(!(nullAnimal instanceof BlackCat)); // dynamic false + +assert(!(nullCat instanceof Animal)); // static false +assert(!(nullCat instanceof Cat)); // dynamic false +assert(!(nullCat instanceof BlackCat)); // dynamic false + +assert(!(nullBlackcat instanceof Animal)); // static false +assert(!(nullBlackcat instanceof Cat)); // dynamic false +assert(!(nullBlackcat instanceof BlackCat)); // dynamic false diff --git a/tests/compiler/rt/instanceof.untouched.wat b/tests/compiler/rt/instanceof.untouched.wat new file mode 100644 index 0000000000..7c088e22bc --- /dev/null +++ b/tests/compiler/rt/instanceof.untouched.wat @@ -0,0 +1,734 @@ +(module + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$v (func)) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (memory $0 1) + (data (i32.const 8) " \00\00\00\01\00\00\00\01\00\00\00 \00\00\00r\00t\00/\00i\00n\00s\00t\00a\00n\00c\00e\00o\00f\00.\00t\00s\00") + (data (i32.const 56) "\06\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\03\00\00\00\10\00\00\00\04\00\00\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) + (global $rt/instanceof/animal (mut i32) (i32.const 0)) + (global $rt/instanceof/cat (mut i32) (i32.const 0)) + (global $rt/instanceof/blackcat (mut i32) (i32.const 0)) + (global $rt/instanceof/nullableAnimal (mut i32) (i32.const 0)) + (global $rt/instanceof/nullableCat (mut i32) (i32.const 0)) + (global $rt/instanceof/nullableBlackcat (mut i32) (i32.const 0)) + (global $rt/instanceof/nullAnimal (mut i32) (i32.const 0)) + (global $rt/instanceof/nullCat (mut i32) (i32.const 0)) + (global $rt/instanceof/nullBlackcat (mut i32) (i32.const 0)) + (global $~lib/started (mut i32) (i32.const 0)) + (global $~lib/rt/__rtti_base i32 (i32.const 56)) + (global $~lib/heap/__heap_base i32 (i32.const 108)) + (export "__start" (func $start)) + (export "memory" (memory $0)) + (func $~lib/rt/stub/__alloc (; 1 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + local.get $0 + i32.const 1073741808 + i32.gt_u + if + unreachable + end + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.set $2 + local.get $2 + local.get $0 + local.tee $3 + i32.const 1 + local.tee $4 + local.get $3 + local.get $4 + i32.gt_u + select + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $5 + memory.size + local.set $6 + local.get $5 + local.get $6 + i32.const 16 + i32.shl + i32.gt_u + if + local.get $5 + local.get $2 + i32.sub + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $6 + local.tee $4 + local.get $3 + local.tee $7 + local.get $4 + local.get $7 + i32.gt_s + select + local.set $4 + local.get $4 + memory.grow + i32.const 0 + i32.lt_s + if + local.get $3 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + end + local.get $5 + global.set $~lib/rt/stub/offset + local.get $2 + i32.const 16 + i32.sub + local.set $8 + local.get $8 + local.get $1 + i32.store offset=8 + local.get $8 + local.get $0 + i32.store offset=12 + local.get $2 + ) + (func $~lib/rt/stub/__retain (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + ) + (func $rt/instanceof/Animal#constructor (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 0 + i32.const 3 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain + local.set $0 + end + local.get $0 + ) + (func $~lib/rt/stub/__release (; 4 ;) (type $FUNCSIG$vi) (param $0 i32) + nop + ) + (func $rt/instanceof/Cat#constructor (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.eqz + if + i32.const 0 + i32.const 4 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain + local.set $0 + end + local.get $0 + call $rt/instanceof/Animal#constructor + local.tee $1 + local.set $0 + local.get $0 + local.set $2 + local.get $1 + call $~lib/rt/stub/__release + local.get $2 + ) + (func $rt/instanceof/BlackCat#constructor (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.eqz + if + i32.const 0 + i32.const 5 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain + local.set $0 + end + local.get $0 + call $rt/instanceof/Cat#constructor + local.tee $1 + local.set $0 + local.get $0 + local.set $2 + local.get $1 + call $~lib/rt/stub/__release + local.get $2 + ) + (func $~lib/rt/__instanceof (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=8 + local.set $2 + global.get $~lib/rt/__rtti_base + local.set $3 + local.get $2 + local.get $3 + i32.load + i32.le_u + if + loop $continue|0 + local.get $2 + local.get $1 + i32.eq + if + i32.const 1 + return + end + local.get $3 + i32.const 4 + i32.add + local.get $2 + i32.const 8 + i32.mul + i32.add + i32.load offset=4 + local.tee $2 + br_if $continue|0 + end + end + i32.const 0 + ) + (func $start:rt/instanceof (; 8 ;) (type $FUNCSIG$v) + (local $0 i32) + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset + i32.const 0 + call $rt/instanceof/Animal#constructor + global.set $rt/instanceof/animal + i32.const 0 + call $rt/instanceof/Cat#constructor + global.set $rt/instanceof/cat + i32.const 0 + call $rt/instanceof/BlackCat#constructor + global.set $rt/instanceof/blackcat + block (result i32) + global.get $rt/instanceof/animal + drop + i32.const 1 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 9 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/animal + local.tee $0 + i32.eqz + if (result i32) + i32.const 0 + else + local.get $0 + i32.const 4 + call $~lib/rt/__instanceof + end + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 10 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/animal + local.tee $0 + i32.eqz + if (result i32) + i32.const 0 + else + local.get $0 + i32.const 5 + call $~lib/rt/__instanceof + end + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 11 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + block (result i32) + global.get $rt/instanceof/cat + drop + i32.const 1 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 13 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/cat + local.tee $0 + i32.eqz + if (result i32) + i32.const 0 + else + local.get $0 + i32.const 4 + call $~lib/rt/__instanceof + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 14 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/cat + local.tee $0 + i32.eqz + if (result i32) + i32.const 0 + else + local.get $0 + i32.const 5 + call $~lib/rt/__instanceof + end + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 15 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + block (result i32) + global.get $rt/instanceof/blackcat + drop + i32.const 1 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 17 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/blackcat + local.tee $0 + i32.eqz + if (result i32) + i32.const 0 + else + local.get $0 + i32.const 4 + call $~lib/rt/__instanceof + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 18 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/blackcat + local.tee $0 + i32.eqz + if (result i32) + i32.const 0 + else + local.get $0 + i32.const 5 + call $~lib/rt/__instanceof + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 19 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + call $rt/instanceof/Animal#constructor + global.set $rt/instanceof/nullableAnimal + i32.const 0 + call $rt/instanceof/Cat#constructor + global.set $rt/instanceof/nullableCat + i32.const 0 + call $rt/instanceof/BlackCat#constructor + global.set $rt/instanceof/nullableBlackcat + global.get $rt/instanceof/nullableAnimal + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 25 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/nullableAnimal + local.tee $0 + i32.eqz + if (result i32) + i32.const 0 + else + local.get $0 + i32.const 4 + call $~lib/rt/__instanceof + end + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 26 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/nullableAnimal + local.tee $0 + i32.eqz + if (result i32) + i32.const 0 + else + local.get $0 + i32.const 5 + call $~lib/rt/__instanceof + end + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 27 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/nullableCat + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 29 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/nullableCat + local.tee $0 + i32.eqz + if (result i32) + i32.const 0 + else + local.get $0 + i32.const 4 + call $~lib/rt/__instanceof + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 30 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/nullableCat + local.tee $0 + i32.eqz + if (result i32) + i32.const 0 + else + local.get $0 + i32.const 5 + call $~lib/rt/__instanceof + end + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 31 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/nullableBlackcat + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 33 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/nullableBlackcat + local.tee $0 + i32.eqz + if (result i32) + i32.const 0 + else + local.get $0 + i32.const 4 + call $~lib/rt/__instanceof + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 34 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/nullableBlackcat + local.tee $0 + i32.eqz + if (result i32) + i32.const 0 + else + local.get $0 + i32.const 5 + call $~lib/rt/__instanceof + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 35 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/nullAnimal + i32.const 0 + i32.ne + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 41 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/nullAnimal + local.tee $0 + i32.eqz + if (result i32) + i32.const 0 + else + local.get $0 + i32.const 4 + call $~lib/rt/__instanceof + end + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 42 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/nullAnimal + local.tee $0 + i32.eqz + if (result i32) + i32.const 0 + else + local.get $0 + i32.const 5 + call $~lib/rt/__instanceof + end + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 43 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/nullCat + i32.const 0 + i32.ne + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 45 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/nullCat + local.tee $0 + i32.eqz + if (result i32) + i32.const 0 + else + local.get $0 + i32.const 4 + call $~lib/rt/__instanceof + end + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 46 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/nullCat + local.tee $0 + i32.eqz + if (result i32) + i32.const 0 + else + local.get $0 + i32.const 5 + call $~lib/rt/__instanceof + end + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 47 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/nullBlackcat + i32.const 0 + i32.ne + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 49 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/nullBlackcat + local.tee $0 + i32.eqz + if (result i32) + i32.const 0 + else + local.get $0 + i32.const 4 + call $~lib/rt/__instanceof + end + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 50 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $rt/instanceof/nullBlackcat + local.tee $0 + i32.eqz + if (result i32) + i32.const 0 + else + local.get $0 + i32.const 5 + call $~lib/rt/__instanceof + end + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 51 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + ) + (func $start (; 9 ;) (type $FUNCSIG$v) + global.get $~lib/started + if + return + else + i32.const 1 + global.set $~lib/started + end + call $start:rt/instanceof + ) + (func $null (; 10 ;) (type $FUNCSIG$v) + ) +) diff --git a/tests/compiler/runtime-full.json b/tests/compiler/runtime-full.json new file mode 100644 index 0000000000..a499d3adfc --- /dev/null +++ b/tests/compiler/runtime-full.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime full" + ] +} diff --git a/tests/compiler/runtime-full.optimized.wat b/tests/compiler/runtime-full.optimized.wat new file mode 100644 index 0000000000..d76b491086 --- /dev/null +++ b/tests/compiler/runtime-full.optimized.wat @@ -0,0 +1,1845 @@ +(module + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (memory $0 1) + (data (i32.const 8) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s") + (data (i32.const 56) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e") + (data (i32.const 112) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s") + (data (i32.const 160) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e") + (data (i32.const 216) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s") + (data (i32.const 256) "\03\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10") + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) + (global $~lib/rt/__rtti_base i32 (i32.const 256)) + (export "memory" (memory $0)) + (export "__alloc" (func $~lib/rt/tlsf/__alloc)) + (export "__retain" (func $~lib/rt/pure/__retain)) + (export "__release" (func $~lib/rt/pure/__release)) + (export "__collect" (func $~lib/rt/pure/__collect)) + (export "__rtti_base" (global $~lib/rt/__rtti_base)) + (func $~lib/rt/tlsf/removeBlock (; 1 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.tee $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 276 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const -4 + i32.and + local.tee $2 + i32.const 16 + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 278 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 256 + i32.lt_u + if (result i32) + local.get $2 + i32.const 4 + i32.shr_u + local.set $2 + i32.const 0 + else + local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $3 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $2 + local.get $3 + i32.const 7 + i32.sub + end + local.tee $3 + i32.const 23 + i32.lt_u + if (result i32) + local.get $2 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 291 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=20 + local.set $4 + local.get $1 + i32.load offset=16 + local.tee $5 + if + local.get $5 + local.get $4 + i32.store offset=20 + end + local.get $4 + if + local.get $4 + local.get $5 + i32.store offset=16 + end + local.get $3 + i32.const 4 + i32.shl + local.get $2 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + local.get $1 + i32.eq + if + local.get $3 + i32.const 4 + i32.shl + local.get $2 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $4 + i32.store offset=96 + local.get $4 + i32.eqz + if + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const 1 + local.get $2 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.store offset=4 + local.get $1 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $3 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 2 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 204 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.tee $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 206 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.tee $5 + i32.const 1 + i32.and + if + local.get $3 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const -4 + i32.and + i32.add + local.tee $2 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $3 + i32.const 3 + i32.and + local.get $2 + i32.or + local.tee $3 + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.set $5 + end + end + local.get $3 + i32.const 2 + i32.and + if + local.get $1 + i32.const 4 + i32.sub + i32.load + local.tee $2 + i32.load + local.tee $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 227 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $3 + i32.const -4 + i32.and + i32.add + local.tee $7 + i32.const 1073741808 + i32.lt_u + if (result i32) + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $2 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $3 + i32.store + local.get $2 + else + local.get $1 + end + local.set $1 + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $3 + i32.const -4 + i32.and + local.tee $2 + i32.const 16 + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 243 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $2 + i32.const 256 + i32.lt_u + if (result i32) + local.get $2 + i32.const 4 + i32.shr_u + local.set $4 + i32.const 0 + else + local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $4 + local.get $2 + i32.const 7 + i32.sub + end + local.tee $3 + i32.const 23 + i32.lt_u + if (result i32) + local.get $4 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 259 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + local.set $2 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $2 + i32.store offset=20 + local.get $2 + if + local.get $2 + local.get $1 + i32.store offset=16 + end + local.get $3 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $1 + i32.store offset=96 + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $3 + i32.shl + i32.or + i32.store + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const 1 + local.get $4 + i32.shl + i32.or + i32.store offset=4 + ) + (func $~lib/rt/tlsf/addMemory (; 3 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $1 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $1 + local.get $2 + i32.le_u + select + select + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 385 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=1568 + local.tee $3 + if + local.get $1 + local.get $3 + i32.const 16 + i32.add + i32.lt_u + if + i32.const 0 + i32.const 24 + i32.const 395 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $3 + i32.eq + if + local.get $3 + i32.load + local.set $4 + local.get $1 + i32.const 16 + i32.sub + local.set $1 + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.lt_u + if + i32.const 0 + i32.const 24 + i32.const 407 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.tee $2 + i32.const 48 + i32.lt_u + if + return + end + local.get $1 + local.get $4 + i32.const 2 + i32.and + local.get $2 + i32.const 32 + i32.sub + i32.const 1 + i32.or + i32.or + i32.store + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $2 + i32.add + i32.const 16 + i32.sub + local.tee $2 + i32.const 2 + i32.store + local.get $0 + local.get $2 + i32.store offset=1568 + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/tlsf/initializeRoot (; 4 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 1 + memory.size + local.tee $0 + i32.gt_s + if (result i32) + i32.const 1 + local.get $0 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + i32.const 288 + i32.const 0 + i32.store + i32.const 1856 + i32.const 0 + i32.store + i32.const 0 + local.set $0 + loop $repeat|0 + block $break|0 + local.get $0 + i32.const 23 + i32.ge_u + br_if $break|0 + local.get $0 + i32.const 2 + i32.shl + i32.const 288 + i32.add + i32.const 0 + i32.store offset=4 + i32.const 0 + local.set $1 + loop $repeat|1 + block $break|1 + local.get $1 + i32.const 16 + i32.ge_u + br_if $break|1 + local.get $0 + i32.const 4 + i32.shl + local.get $1 + i32.add + i32.const 2 + i32.shl + i32.const 288 + i32.add + i32.const 0 + i32.store offset=96 + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|1 + end + end + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + end + i32.const 288 + i32.const 1872 + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + i32.const 288 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 72 + i32.const 24 + i32.const 447 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const -16 + i32.and + local.tee $0 + i32.const 16 + local.get $0 + i32.const 16 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + i32.const 256 + i32.lt_u + if (result i32) + local.get $1 + i32.const 4 + i32.shr_u + local.set $1 + i32.const 0 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + local.get $1 + i32.add + i32.const 1 + i32.sub + local.set $1 + end + local.get $1 + i32.const 31 + local.get $1 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $1 + local.get $2 + i32.const 7 + i32.sub + end + local.tee $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $1 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 337 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const -1 + local.get $1 + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $1 + i32.ctz + local.get $2 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + else + local.get $0 + i32.load + i32.const -1 + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $1 + i32.ctz + local.tee $1 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 350 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.ctz + local.get $1 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + else + i32.const 0 + end + end + ) + (func $~lib/rt/tlsf/growMemory (; 7 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + memory.size + local.tee $2 + local.get $1 + i32.const 65535 + i32.add + i32.const -65536 + i32.and + i32.const 16 + i32.shr_u + local.tee $1 + local.get $2 + local.get $1 + i32.gt_s + select + memory.grow + i32.const 0 + i32.lt_s + if + local.get $1 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + local.get $0 + local.get $2 + i32.const 16 + i32.shl + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + ) + (func $~lib/rt/tlsf/prepareBlock (; 8 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + if + i32.const 0 + i32.const 24 + i32.const 364 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const -4 + i32.and + local.get $2 + i32.sub + local.tee $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $3 + i32.const 2 + i32.and + local.get $2 + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.tee $1 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const -2 + i32.and + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + i32.load + i32.const -3 + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.tee $3 + call $~lib/rt/tlsf/searchBlock + local.tee $2 + i32.eqz + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $3 + call $~lib/rt/tlsf/searchBlock + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 477 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + i32.load + i32.const -4 + i32.and + local.get $3 + i32.lt_u + if + i32.const 0 + i32.const 24 + i32.const 479 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 0 + i32.store offset=4 + local.get $2 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $2 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $2 + ) + (func $~lib/rt/tlsf/__alloc (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + global.get $~lib/rt/tlsf/ROOT + local.tee $2 + if (result i32) + local.get $2 + else + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + end + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.tee $0 + local.get $1 + i32.store offset=8 + local.get $0 + i32.const 16 + i32.add + ) + (func $~lib/rt/pure/increment (; 11 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const -268435456 + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne + if + i32.const 0 + i32.const 128 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 128 + i32.const 107 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/pure/__retain (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 284 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment + end + local.get $0 + ) + (func $~lib/rt/tlsf/freeBlock (; 13 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.tee $2 + i32.const 1 + i32.and + if + i32.const 0 + i32.const 24 + i32.const 531 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/__typeinfo (; 14 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 256 + i32.load + i32.gt_u + if + i32.const 176 + i32.const 232 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 3 + i32.shl + i32.const 260 + i32.add + i32.load + ) + (func $~lib/memory/memory.copy (; 15 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $2 + local.set $3 + local.get $0 + local.get $1 + i32.eq + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $1 + i32.lt_u + if + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|0 + local.get $0 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + br $continue|0 + end + end + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $1 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + br $continue|1 + end + end + end + loop $continue|2 + local.get $3 + if + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + else + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|3 + local.get $0 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $3 + i32.const 8 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + loop $continue|5 + local.get $3 + if + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + ) + (func $~lib/rt/tlsf/__free (; 16 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 561 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $0 + select + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 562 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/growRoots (; 17 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/pure/CUR + global.get $~lib/rt/pure/ROOTS + local.tee $1 + i32.sub + local.tee $2 + i32.const 1 + i32.shl + local.tee $0 + i32.const 256 + local.get $0 + i32.const 256 + i32.gt_u + select + local.tee $3 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.tee $0 + local.get $1 + local.get $2 + call $~lib/memory/memory.copy + local.get $1 + if + local.get $1 + call $~lib/rt/tlsf/__free + end + local.get $0 + global.set $~lib/rt/pure/ROOTS + local.get $0 + local.get $2 + i32.add + global.set $~lib/rt/pure/CUR + local.get $0 + local.get $3 + i32.add + global.set $~lib/rt/pure/END + ) + (func $~lib/rt/pure/appendRoot (; 18 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/pure/CUR + local.tee $1 + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 4 + i32.add + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/decrement (; 19 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.tee $2 + i32.const 268435455 + i32.and + local.set $1 + local.get $0 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 128 + i32.const 115 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/rt/__visit_members + local.get $2 + i32.const -2147483648 + i32.and + if + local.get $0 + i32.const -2147483648 + i32.store offset=4 + else + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + else + local.get $1 + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 128 + i32.const 124 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 16 + i32.and + if + local.get $0 + local.get $1 + i32.const 1 + i32.sub + local.get $2 + i32.const -268435456 + i32.and + i32.or + i32.store offset=4 + else + local.get $0 + local.get $1 + i32.const 1 + i32.sub + i32.const -1342177280 + i32.or + i32.store offset=4 + local.get $2 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/appendRoot + end + end + end + ) + (func $~lib/rt/pure/__release (; 20 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + i32.const 284 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + end + ) + (func $~lib/rt/pure/markGray (; 21 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members + end + ) + (func $~lib/rt/pure/scanBlack (; 22 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + ) + (func $~lib/rt/pure/__collect (; 25 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/pure/ROOTS + local.tee $5 + local.tee $2 + local.set $3 + global.get $~lib/rt/pure/CUR + local.set $0 + loop $repeat|0 + block $break|0 + local.get $3 + local.get $0 + i32.ge_u + br_if $break|0 + local.get $3 + i32.load + local.tee $4 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 805306368 + i32.eq + if (result i32) + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + else + i32.const 0 + end + if + local.get $4 + call $~lib/rt/pure/markGray + local.get $2 + local.get $4 + i32.store + local.get $2 + i32.const 4 + i32.add + local.set $2 + else + i32.const 0 + local.get $1 + i32.const 268435455 + i32.and + i32.eqz + local.get $1 + i32.const 1879048192 + i32.and + select + if + global.get $~lib/rt/tlsf/ROOT + local.get $4 + call $~lib/rt/tlsf/freeBlock + else + local.get $4 + local.get $1 + i32.const 2147483647 + i32.and + i32.store offset=4 + end + end + local.get $3 + i32.const 4 + i32.add + local.set $3 + br $repeat|0 + end + end + local.get $2 + global.set $~lib/rt/pure/CUR + local.get $5 + local.set $0 + loop $repeat|1 + block $break|1 + local.get $0 + local.get $2 + i32.ge_u + br_if $break|1 + local.get $0 + i32.load + call $~lib/rt/pure/scan + local.get $0 + i32.const 4 + i32.add + local.set $0 + br $repeat|1 + end + end + local.get $5 + local.set $0 + loop $repeat|2 + block $break|2 + local.get $0 + local.get $2 + i32.ge_u + br_if $break|2 + local.get $0 + i32.load + local.tee $1 + local.get $1 + i32.load offset=4 + i32.const 2147483647 + i32.and + i32.store offset=4 + local.get $1 + call $~lib/rt/pure/collectWhite + local.get $0 + i32.const 4 + i32.add + local.set $0 + br $repeat|2 + end + end + local.get $5 + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/__visit (; 26 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + local.get $0 + i32.const 284 + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $0 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + local.get $1 + i32.const 1 + i32.ne + if + local.get $1 + i32.const 2 + i32.eq + br_if $case1|0 + block $tablify|0 + local.get $1 + i32.const 3 + i32.sub + br_table $case2|0 $case3|0 $case4|0 $tablify|0 + end + br $case5|0 + end + local.get $0 + call $~lib/rt/pure/decrement + br $break|0 + end + local.get $0 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 128 + i32.const 75 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $0 + call $~lib/rt/pure/markGray + br $break|0 + end + local.get $0 + call $~lib/rt/pure/scan + br $break|0 + end + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const -268435456 + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne + if + i32.const 0 + i32.const 128 + i32.const 86 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $1 + i32.const 1879048192 + i32.and + if + local.get $0 + call $~lib/rt/pure/scanBlack + end + br $break|0 + end + local.get $0 + call $~lib/rt/pure/collectWhite + br $break|0 + end + i32.const 0 + i32.const 128 + i32.const 97 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/__visit_members (; 27 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + block $switch$1$default + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$default + end + return + end + local.get $0 + i32.load + local.tee $0 + if + local.get $0 + local.get $1 + call $~lib/rt/pure/__visit + end + return + end + unreachable + ) + (func $null (; 28 ;) (type $FUNCSIG$v) + nop + ) +) diff --git a/tests/compiler/runtime-full.ts b/tests/compiler/runtime-full.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/compiler/runtime-full.untouched.wat b/tests/compiler/runtime-full.untouched.wat new file mode 100644 index 0000000000..c639a3dd4d --- /dev/null +++ b/tests/compiler/runtime-full.untouched.wat @@ -0,0 +1,3607 @@ +(module + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (memory $0 1) + (data (i32.const 8) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 56) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 112) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s\00") + (data (i32.const 160) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 216) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s\00") + (data (i32.const 256) "\03\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) + (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/rt/__rtti_base i32 (i32.const 256)) + (global $~lib/heap/__heap_base i32 (i32.const 284)) + (export "memory" (memory $0)) + (export "__alloc" (func $~lib/rt/tlsf/__alloc)) + (export "__retain" (func $~lib/rt/pure/__retain)) + (export "__release" (func $~lib/rt/pure/__release)) + (export "__collect" (func $~lib/rt/pure/__collect)) + (export "__rtti_base" (global $~lib/rt/__rtti_base)) + (func $~lib/rt/tlsf/removeBlock (; 1 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 276 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $3 + local.get $3 + i32.const 16 + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 278 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 + local.get $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) + local.get $5 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 291 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end + local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $9 + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $8 + local.get $4 + local.set $11 + local.get $9 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $9 + local.set $10 + local.get $8 + local.get $11 + i32.const 2 + i32.shl + i32.add + local.get $10 + i32.store offset=4 + end + local.get $9 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 2 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 204 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 206 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 + i32.const 1 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end + local.get $2 + i32.const 2 + i32.and + if + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 4 + i32.sub + i32.load + end + local.set $6 + local.get $6 + i32.load + local.set $3 + local.get $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 227 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $6 + call $~lib/rt/tlsf/removeBlock + local.get $6 + local.get $3 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $6 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $8 + i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 243 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $8 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 259 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $7 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $7 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $0 + local.set $12 + local.get $9 + local.set $7 + local.get $10 + local.set $3 + local.get $1 + local.set $6 + local.get $12 + local.get $7 + i32.const 4 + i32.shl + local.get $3 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + end + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $0 + local.set $13 + local.get $9 + local.set $12 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + end + ) + (func $~lib/rt/tlsf/addMemory (; 3 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + local.get $2 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 385 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 395 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 407 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 4 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + memory.size + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end + block $break|0 + i32.const 0 + local.set $5 + loop $repeat|0 + local.get $5 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $3 + local.set $7 + local.get $5 + local.set $6 + i32.const 0 + local.set $4 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $7 + loop $repeat|1 + local.get $7 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $3 + local.set $9 + local.get $5 + local.set $8 + local.get $7 + local.set $6 + i32.const 0 + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store offset=96 + end + local.get $7 + i32.const 1 + i32.add + local.set $7 + br $repeat|1 + unreachable + end + unreachable + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 72 + i32.const 24 + i32.const 447 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 337 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + i32.const 0 + local.set $7 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $5 + local.get $5 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $5 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $4 + local.get $8 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 350 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 7 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + memory.size + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + memory.grow + i32.const 0 + i32.lt_s + if + local.get $3 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + memory.size + local.set $7 + local.get $0 + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (; 8 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 364 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 477 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 479 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/rt/pure/increment (; 11 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 107 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/pure/__retain (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment + end + local.get $0 + ) + (func $~lib/rt/tlsf/freeBlock (; 13 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 531 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/__typeinfo (; 14 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/rt/__rtti_base + local.set $1 + local.get $0 + local.get $1 + i32.load + i32.gt_u + if + i32.const 176 + i32.const 232 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 4 + i32.add + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/util/memory/memcpy (; 15 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + block $break|0 + loop $continue|0 + local.get $2 + if (result i32) + local.get $1 + i32.const 3 + i32.and + else + i32.const 0 + end + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $continue|0 + end + end + end + local.get $0 + i32.const 3 + i32.and + i32.const 0 + i32.eq + if + block $break|1 + loop $continue|1 + local.get $2 + i32.const 16 + i32.ge_u + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 8 + i32.add + i32.load + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 12 + i32.add + i32.load + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|1 + end + end + end + local.get $2 + i32.const 8 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + end + local.get $2 + i32.const 4 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.set $0 + local.get $1 + i32.const 4 + i32.add + local.set $1 + end + local.get $2 + i32.const 2 + i32.and + if + local.get $0 + local.get $1 + i32.load16_u + i32.store16 + local.get $0 + i32.const 2 + i32.add + local.set $0 + local.get $1 + i32.const 2 + i32.add + local.set $1 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + return + end + local.get $2 + i32.const 32 + i32.ge_u + if + block $break|2 + block $case2|2 + block $case1|2 + block $case0|2 + local.get $0 + i32.const 3 + i32.and + local.set $5 + local.get $5 + i32.const 1 + i32.eq + br_if $case0|2 + local.get $5 + i32.const 2 + i32.eq + br_if $case1|2 + local.get $5 + i32.const 3 + i32.eq + br_if $case2|2 + br $break|2 + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 3 + i32.sub + local.set $2 + block $break|3 + loop $continue|3 + local.get $2 + i32.const 17 + i32.ge_u + if + local.get $1 + i32.const 1 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 5 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 9 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 13 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|3 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + block $break|4 + loop $continue|4 + local.get $2 + i32.const 18 + i32.ge_u + if + local.get $1 + i32.const 2 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 6 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 10 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 14 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|4 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + block $break|5 + loop $continue|5 + local.get $2 + i32.const 19 + i32.ge_u + if + local.get $1 + i32.const 3 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 7 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 11 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 15 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|5 + end + end + end + br $break|2 + unreachable + end + unreachable + end + end + local.get $2 + i32.const 16 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 8 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 4 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 2 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + ) + (func $~lib/memory/memory.copy (; 16 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $4 + local.get $3 + i32.add + local.get $5 + i32.le_u + if (result i32) + i32.const 1 + else + local.get $5 + local.get $3 + i32.add + local.get $4 + i32.le_u + end + if + local.get $5 + local.get $4 + local.get $3 + call $~lib/util/memory/memcpy + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/rt/tlsf/__free (; 17 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 561 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 562 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/growRoots (; 18 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/pure/ROOTS + local.set $0 + global.get $~lib/rt/pure/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $0 + if + local.get $0 + call $~lib/rt/tlsf/__free + end + local.get $5 + global.set $~lib/rt/pure/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/pure/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/pure/END + ) + (func $~lib/rt/pure/appendRoot (; 19 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/pure/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 4 + i32.add + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/decrement (; 20 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 115 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/rt/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 124 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 16 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/pure/__release (; 21 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + end + ) + (func $~lib/rt/pure/markGray (; 22 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members + end + ) + (func $~lib/rt/pure/scanBlack (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + ) + (func $~lib/rt/pure/__collect (; 26 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/pure/ROOTS + local.set $0 + local.get $0 + local.set $1 + block $break|0 + block + local.get $1 + local.set $2 + global.get $~lib/rt/pure/CUR + local.set $3 + end + loop $repeat|0 + local.get $2 + local.get $3 + i32.lt_u + i32.eqz + br_if $break|0 + local.get $2 + i32.load + local.set $4 + local.get $4 + i32.load offset=4 + local.set $5 + local.get $5 + i32.const 1879048192 + i32.and + i32.const 805306368 + i32.eq + if (result i32) + local.get $5 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + else + i32.const 0 + end + if + local.get $4 + call $~lib/rt/pure/markGray + local.get $1 + local.get $4 + i32.store + local.get $1 + i32.const 4 + i32.add + local.set $1 + else + local.get $5 + i32.const 1879048192 + i32.and + i32.const 0 + i32.eq + if (result i32) + local.get $5 + i32.const 268435455 + i32.and + i32.eqz + else + i32.const 0 + end + if + global.get $~lib/rt/tlsf/ROOT + local.get $4 + call $~lib/rt/tlsf/freeBlock + else + local.get $4 + local.get $5 + i32.const -2147483648 + i32.const -1 + i32.xor + i32.and + i32.store offset=4 + end + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + global.set $~lib/rt/pure/CUR + block $break|1 + local.get $0 + local.set $5 + loop $repeat|1 + local.get $5 + local.get $1 + i32.lt_u + i32.eqz + br_if $break|1 + local.get $5 + i32.load + call $~lib/rt/pure/scan + local.get $5 + i32.const 4 + i32.add + local.set $5 + br $repeat|1 + unreachable + end + unreachable + end + block $break|2 + local.get $0 + local.set $5 + loop $repeat|2 + local.get $5 + local.get $1 + i32.lt_u + i32.eqz + br_if $break|2 + local.get $5 + i32.load + local.set $4 + local.get $4 + local.get $4 + i32.load offset=4 + i32.const -2147483648 + i32.const -1 + i32.xor + i32.and + i32.store offset=4 + local.get $4 + call $~lib/rt/pure/collectWhite + local.get $5 + i32.const 4 + i32.add + local.set $5 + br $repeat|2 + unreachable + end + unreachable + end + local.get $0 + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/__visit (; 27 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/pure/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 75 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/pure/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 86 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/pure/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 97 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + end + ) + (func $~lib/rt/__visit_members (; 28 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block + end + block $switch$1$leave + block $switch$1$default + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$default + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + ) + (func $null (; 29 ;) (type $FUNCSIG$v) + ) +) diff --git a/tests/compiler/runtime-half.json b/tests/compiler/runtime-half.json new file mode 100644 index 0000000000..8e2a32c1e2 --- /dev/null +++ b/tests/compiler/runtime-half.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime half" + ] +} diff --git a/tests/compiler/runtime-half.optimized.wat b/tests/compiler/runtime-half.optimized.wat new file mode 100644 index 0000000000..bb456a1172 --- /dev/null +++ b/tests/compiler/runtime-half.optimized.wat @@ -0,0 +1,8 @@ +(module + (type $FUNCSIG$v (func)) + (memory $0 0) + (export "memory" (memory $0)) + (func $null (; 0 ;) (type $FUNCSIG$v) + nop + ) +) diff --git a/tests/compiler/runtime-half.ts b/tests/compiler/runtime-half.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/compiler/runtime-half.untouched.wat b/tests/compiler/runtime-half.untouched.wat new file mode 100644 index 0000000000..29ee81b836 --- /dev/null +++ b/tests/compiler/runtime-half.untouched.wat @@ -0,0 +1,9 @@ +(module + (type $FUNCSIG$v (func)) + (memory $0 0) + (table $0 1 funcref) + (elem (i32.const 0) $null) + (export "memory" (memory $0)) + (func $null (; 0 ;) (type $FUNCSIG$v) + ) +) diff --git a/tests/compiler/runtime-none.json b/tests/compiler/runtime-none.json new file mode 100644 index 0000000000..453cb07770 --- /dev/null +++ b/tests/compiler/runtime-none.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} diff --git a/tests/compiler/runtime-none.optimized.wat b/tests/compiler/runtime-none.optimized.wat new file mode 100644 index 0000000000..bb456a1172 --- /dev/null +++ b/tests/compiler/runtime-none.optimized.wat @@ -0,0 +1,8 @@ +(module + (type $FUNCSIG$v (func)) + (memory $0 0) + (export "memory" (memory $0)) + (func $null (; 0 ;) (type $FUNCSIG$v) + nop + ) +) diff --git a/tests/compiler/runtime-none.ts b/tests/compiler/runtime-none.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/compiler/runtime-none.untouched.wat b/tests/compiler/runtime-none.untouched.wat new file mode 100644 index 0000000000..29ee81b836 --- /dev/null +++ b/tests/compiler/runtime-none.untouched.wat @@ -0,0 +1,9 @@ +(module + (type $FUNCSIG$v (func)) + (memory $0 0) + (table $0 1 funcref) + (elem (i32.const 0) $null) + (export "memory" (memory $0)) + (func $null (; 0 ;) (type $FUNCSIG$v) + ) +) diff --git a/tests/compiler/runtime-stub.json b/tests/compiler/runtime-stub.json new file mode 100644 index 0000000000..c07784ffe0 --- /dev/null +++ b/tests/compiler/runtime-stub.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime stub" + ] +} diff --git a/tests/compiler/runtime-stub.optimized.wat b/tests/compiler/runtime-stub.optimized.wat new file mode 100644 index 0000000000..2de8c79523 --- /dev/null +++ b/tests/compiler/runtime-stub.optimized.wat @@ -0,0 +1,107 @@ +(module + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$v (func)) + (memory $0 1) + (data (i32.const 8) "\03\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10") + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) + (global $~lib/rt/__rtti_base i32 (i32.const 8)) + (export "memory" (memory $0)) + (export "__alloc" (func $~lib/rt/stub/__alloc)) + (export "__retain" (func $~lib/rt/stub/__retain)) + (export "__release" (func $~lib/rt/stub/__release)) + (export "__collect" (func $~lib/rt/stub/__collect)) + (export "__rtti_base" (global $~lib/rt/__rtti_base)) + (start $start) + (func $~lib/rt/stub/__alloc (; 0 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + i32.const 1073741808 + i32.gt_u + if + unreachable + end + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.tee $3 + local.get $0 + i32.const 1 + local.get $0 + i32.const 1 + i32.gt_u + select + i32.add + i32.const 15 + i32.add + i32.const -16 + i32.and + local.tee $2 + memory.size + local.tee $4 + i32.const 16 + i32.shl + i32.gt_u + if + local.get $4 + local.get $2 + local.get $3 + i32.sub + i32.const 65535 + i32.add + i32.const -65536 + i32.and + i32.const 16 + i32.shr_u + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + memory.grow + i32.const 0 + i32.lt_s + if + local.get $5 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + end + local.get $2 + global.set $~lib/rt/stub/offset + local.get $3 + i32.const 16 + i32.sub + local.tee $2 + local.get $1 + i32.store offset=8 + local.get $2 + local.get $0 + i32.store offset=12 + local.get $3 + ) + (func $~lib/rt/stub/__retain (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + ) + (func $~lib/rt/stub/__release (; 2 ;) (type $FUNCSIG$vi) (param $0 i32) + nop + ) + (func $~lib/rt/stub/__collect (; 3 ;) (type $FUNCSIG$v) + nop + ) + (func $start (; 4 ;) (type $FUNCSIG$v) + i32.const 48 + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset + ) +) diff --git a/tests/compiler/runtime-stub.ts b/tests/compiler/runtime-stub.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/compiler/runtime-stub.untouched.wat b/tests/compiler/runtime-stub.untouched.wat new file mode 100644 index 0000000000..6d48c47742 --- /dev/null +++ b/tests/compiler/runtime-stub.untouched.wat @@ -0,0 +1,136 @@ +(module + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$v (func)) + (memory $0 1) + (data (i32.const 8) "\03\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) + (global $~lib/rt/__rtti_base i32 (i32.const 8)) + (global $~lib/heap/__heap_base i32 (i32.const 36)) + (export "memory" (memory $0)) + (export "__alloc" (func $~lib/rt/stub/__alloc)) + (export "__retain" (func $~lib/rt/stub/__retain)) + (export "__release" (func $~lib/rt/stub/__release)) + (export "__collect" (func $~lib/rt/stub/__collect)) + (export "__rtti_base" (global $~lib/rt/__rtti_base)) + (start $start) + (func $~lib/rt/stub/__alloc (; 0 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + local.get $0 + i32.const 1073741808 + i32.gt_u + if + unreachable + end + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.set $2 + local.get $2 + local.get $0 + local.tee $3 + i32.const 1 + local.tee $4 + local.get $3 + local.get $4 + i32.gt_u + select + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $5 + memory.size + local.set $6 + local.get $5 + local.get $6 + i32.const 16 + i32.shl + i32.gt_u + if + local.get $5 + local.get $2 + i32.sub + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $6 + local.tee $4 + local.get $3 + local.tee $7 + local.get $4 + local.get $7 + i32.gt_s + select + local.set $4 + local.get $4 + memory.grow + i32.const 0 + i32.lt_s + if + local.get $3 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + end + local.get $5 + global.set $~lib/rt/stub/offset + local.get $2 + i32.const 16 + i32.sub + local.set $8 + local.get $8 + local.get $1 + i32.store offset=8 + local.get $8 + local.get $0 + i32.store offset=12 + local.get $2 + ) + (func $~lib/rt/stub/__retain (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + ) + (func $~lib/rt/stub/__release (; 2 ;) (type $FUNCSIG$vi) (param $0 i32) + nop + ) + (func $~lib/rt/stub/__collect (; 3 ;) (type $FUNCSIG$v) + nop + ) + (func $start (; 4 ;) (type $FUNCSIG$v) + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset + ) + (func $null (; 5 ;) (type $FUNCSIG$v) + ) +) diff --git a/tests/compiler/scoped.json b/tests/compiler/scoped.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/scoped.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/scoped.optimized.wat b/tests/compiler/scoped.optimized.wat index 393c758087..e340413096 100644 --- a/tests/compiler/scoped.optimized.wat +++ b/tests/compiler/scoped.optimized.wat @@ -1,10 +1,7 @@ (module (type $FUNCSIG$v (func)) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $null) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $start:scoped (; 0 ;) (type $FUNCSIG$v) (local $0 i32) diff --git a/tests/compiler/scoped.untouched.wat b/tests/compiler/scoped.untouched.wat index eb15d593b2..f6f37e3def 100644 --- a/tests/compiler/scoped.untouched.wat +++ b/tests/compiler/scoped.untouched.wat @@ -7,9 +7,7 @@ (global $scoped/aGlobal (mut i32) (i32.const 1)) (global $scoped/aConstant i32 (i32.const 3)) (global $scoped/aStartFunctionLocal (mut i32) (i32.const 2)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $scoped/fn (; 0 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) diff --git a/tests/compiler/simd.json b/tests/compiler/simd.json index 15ece5b46c..2344125c9b 100644 --- a/tests/compiler/simd.json +++ b/tests/compiler/simd.json @@ -1,5 +1,8 @@ { "features": [ "simd" + ], + "asc_flags": [ + "--runtime none" ] } diff --git a/tests/compiler/simd.optimized.wat b/tests/compiler/simd.optimized.wat index 2505ac86a0..e558488cb3 100644 --- a/tests/compiler/simd.optimized.wat +++ b/tests/compiler/simd.optimized.wat @@ -1,21 +1,9 @@ (module (type $FUNCSIG$v (func)) (memory $0 1) - (data (i32.const 8) "\07\00\00\00s\00i\00m\00d\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) + (data (i32.const 8) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\00s\00i\00m\00d\00.\00t\00s") (export "memory" (memory $0)) - (export "table" (table $0)) - (start $start) (func $start (; 0 ;) (type $FUNCSIG$v) - i32.const 32 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - ) - (func $null (; 1 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/simd.ts b/tests/compiler/simd.ts index 677f95852b..d3642682c3 100644 --- a/tests/compiler/simd.ts +++ b/tests/compiler/simd.ts @@ -1,7 +1,5 @@ // hint: asc tests/compiler/simd --enable simd --validate -import "allocator/arena"; - function test_v128(): void { // equality and inequality assert( diff --git a/tests/compiler/simd.untouched.wat b/tests/compiler/simd.untouched.wat index a4bfc46ad2..74e8c059ac 100644 --- a/tests/compiler/simd.untouched.wat +++ b/tests/compiler/simd.untouched.wat @@ -1,31 +1,15 @@ (module (type $FUNCSIG$v (func)) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\07\00\00\00s\00i\00m\00d\00.\00t\00s\00") + (data (i32.const 8) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\00s\00i\00m\00d\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) (global $~lib/ASC_FEATURE_SIMD i32 (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 28)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) - (func $start:~lib/allocator/arena (; 1 ;) (type $FUNCSIG$v) - global.get $~lib/memory/HEAP_BASE - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - ) - (func $simd/test_v128 (; 2 ;) (type $FUNCSIG$v) + (func $simd/test_v128 (; 1 ;) (type $FUNCSIG$v) v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d i8x16.eq @@ -35,10 +19,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 7 + i32.const 24 + i32.const 5 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d @@ -50,10 +34,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 12 + i32.const 24 + i32.const 10 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d @@ -67,10 +51,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 18 + i32.const 24 + i32.const 16 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d @@ -84,10 +68,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 25 + i32.const 24 + i32.const 23 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d @@ -101,10 +85,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 32 + i32.const 24 + i32.const 30 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d @@ -117,10 +101,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 39 + i32.const 24 + i32.const 37 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d @@ -135,14 +119,14 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 45 + i32.const 24 + i32.const 43 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) - (func $simd/test_i8x16 (; 3 ;) (type $FUNCSIG$v) + (func $simd/test_i8x16 (; 2 ;) (type $FUNCSIG$v) (local $0 v128) (local $1 v128) (local $2 v128) @@ -161,10 +145,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 62 + i32.const 24 + i32.const 60 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -179,10 +163,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 64 + i32.const 24 + i32.const 62 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -198,10 +182,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 66 + i32.const 24 + i32.const 64 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $2 @@ -215,10 +199,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 67 + i32.const 24 + i32.const 65 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $2 @@ -232,10 +216,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 68 + i32.const 24 + i32.const 66 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -248,10 +232,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 69 + i32.const 24 + i32.const 67 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $2 @@ -265,10 +249,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 74 + i32.const 24 + i32.const 72 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $2 @@ -282,10 +266,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 75 + i32.const 24 + i32.const 73 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $2 @@ -297,10 +281,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 76 + i32.const 24 + i32.const 74 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $2 @@ -314,10 +298,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 77 + i32.const 24 + i32.const 75 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -331,10 +315,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 82 + i32.const 24 + i32.const 80 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end v128.const i32x4 0x7f7f7f7e 0x7f7f7f7f 0x7f7f7f7f 0x7f7f7f7f @@ -350,10 +334,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 87 + i32.const 24 + i32.const 85 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end v128.const i32x4 0xfffffffe 0xffffffff 0xffffffff 0xffffffff @@ -369,10 +353,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 93 + i32.const 24 + i32.const 91 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end v128.const i32x4 0x80808081 0x80808080 0x80808080 0x80808080 @@ -388,10 +372,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 99 + i32.const 24 + i32.const 97 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end v128.const i32x4 0x00000001 0x00000000 0x00000000 0x00000000 @@ -407,10 +391,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 105 + i32.const 24 + i32.const 103 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -426,10 +410,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 111 + i32.const 24 + i32.const 109 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const -2 @@ -445,10 +429,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 112 + i32.const 24 + i32.const 110 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const -1 @@ -464,10 +448,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 113 + i32.const 24 + i32.const 111 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end v128.const i32x4 0x00000001 0x00000000 0x00000000 0x00000000 @@ -479,10 +463,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 114 + i32.const 24 + i32.const 112 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -495,10 +479,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 115 + i32.const 24 + i32.const 113 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -527,10 +511,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 120 + i32.const 24 + i32.const 118 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $4 @@ -544,10 +528,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 121 + i32.const 24 + i32.const 119 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $4 @@ -561,10 +545,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 122 + i32.const 24 + i32.const 120 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $3 @@ -578,10 +562,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 123 + i32.const 24 + i32.const 121 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $3 @@ -595,10 +579,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 124 + i32.const 24 + i32.const 122 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $4 @@ -612,10 +596,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 125 + i32.const 24 + i32.const 123 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $3 @@ -629,10 +613,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 126 + i32.const 24 + i32.const 124 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $4 @@ -646,10 +630,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 127 + i32.const 24 + i32.const 125 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $4 @@ -663,10 +647,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 128 + i32.const 24 + i32.const 126 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $3 @@ -680,14 +664,14 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 129 + i32.const 24 + i32.const 127 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) - (func $simd/test_i16x8 (; 4 ;) (type $FUNCSIG$v) + (func $simd/test_i16x8 (; 3 ;) (type $FUNCSIG$v) (local $0 v128) (local $1 v128) (local $2 v128) @@ -706,10 +690,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 134 + i32.const 24 + i32.const 132 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -724,10 +708,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 136 + i32.const 24 + i32.const 134 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -743,10 +727,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 138 + i32.const 24 + i32.const 136 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $2 @@ -760,10 +744,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 139 + i32.const 24 + i32.const 137 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $2 @@ -777,10 +761,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 140 + i32.const 24 + i32.const 138 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -793,10 +777,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 141 + i32.const 24 + i32.const 139 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $2 @@ -810,10 +794,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 146 + i32.const 24 + i32.const 144 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $2 @@ -827,10 +811,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 147 + i32.const 24 + i32.const 145 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $2 @@ -842,10 +826,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 148 + i32.const 24 + i32.const 146 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $2 @@ -859,10 +843,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 149 + i32.const 24 + i32.const 147 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -876,10 +860,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 154 + i32.const 24 + i32.const 152 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end v128.const i32x4 0x7fff7ffe 0x7fff7fff 0x7fff7fff 0x7fff7fff @@ -895,10 +879,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 159 + i32.const 24 + i32.const 157 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end v128.const i32x4 0xfffffffe 0xffffffff 0xffffffff 0xffffffff @@ -914,10 +898,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 165 + i32.const 24 + i32.const 163 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end v128.const i32x4 0x80008001 0x80008000 0x80008000 0x80008000 @@ -933,10 +917,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 171 + i32.const 24 + i32.const 169 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end v128.const i32x4 0x00000001 0x00000000 0x00000000 0x00000000 @@ -952,10 +936,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 177 + i32.const 24 + i32.const 175 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -971,10 +955,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 183 + i32.const 24 + i32.const 181 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const -2 @@ -990,10 +974,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 184 + i32.const 24 + i32.const 182 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const -1 @@ -1009,10 +993,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 185 + i32.const 24 + i32.const 183 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end v128.const i32x4 0x00000001 0x00000000 0x00000000 0x00000000 @@ -1024,10 +1008,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 186 + i32.const 24 + i32.const 184 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -1040,10 +1024,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 187 + i32.const 24 + i32.const 185 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -1072,10 +1056,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 192 + i32.const 24 + i32.const 190 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $4 @@ -1089,10 +1073,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 193 + i32.const 24 + i32.const 191 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $4 @@ -1106,10 +1090,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 194 + i32.const 24 + i32.const 192 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $3 @@ -1123,10 +1107,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 195 + i32.const 24 + i32.const 193 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $3 @@ -1140,10 +1124,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 196 + i32.const 24 + i32.const 194 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $4 @@ -1157,10 +1141,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 197 + i32.const 24 + i32.const 195 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $3 @@ -1174,10 +1158,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 198 + i32.const 24 + i32.const 196 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $4 @@ -1191,10 +1175,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 199 + i32.const 24 + i32.const 197 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $4 @@ -1208,10 +1192,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 200 + i32.const 24 + i32.const 198 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $3 @@ -1225,14 +1209,14 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 201 + i32.const 24 + i32.const 199 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) - (func $simd/test_i32x4 (; 5 ;) (type $FUNCSIG$v) + (func $simd/test_i32x4 (; 4 ;) (type $FUNCSIG$v) (local $0 v128) (local $1 v128) (local $2 v128) @@ -1251,10 +1235,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 206 + i32.const 24 + i32.const 204 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -1269,10 +1253,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 208 + i32.const 24 + i32.const 206 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -1288,10 +1272,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 210 + i32.const 24 + i32.const 208 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $2 @@ -1305,10 +1289,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 211 + i32.const 24 + i32.const 209 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $2 @@ -1322,10 +1306,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 212 + i32.const 24 + i32.const 210 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -1338,10 +1322,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 213 + i32.const 24 + i32.const 211 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $2 @@ -1351,10 +1335,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 218 + i32.const 24 + i32.const 216 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $2 @@ -1364,10 +1348,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 219 + i32.const 24 + i32.const 217 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $2 @@ -1381,10 +1365,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 220 + i32.const 24 + i32.const 218 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -1398,10 +1382,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 225 + i32.const 24 + i32.const 223 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -1417,10 +1401,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 230 + i32.const 24 + i32.const 228 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const -2 @@ -1436,10 +1420,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 231 + i32.const 24 + i32.const 229 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const -1 @@ -1455,10 +1439,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 232 + i32.const 24 + i32.const 230 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end v128.const i32x4 0x00000001 0x00000000 0x00000000 0x00000000 @@ -1470,10 +1454,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 233 + i32.const 24 + i32.const 231 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -1486,10 +1470,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 234 + i32.const 24 + i32.const 232 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -1518,10 +1502,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 239 + i32.const 24 + i32.const 237 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $4 @@ -1535,10 +1519,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 240 + i32.const 24 + i32.const 238 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $4 @@ -1552,10 +1536,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 241 + i32.const 24 + i32.const 239 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $3 @@ -1569,10 +1553,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 242 + i32.const 24 + i32.const 240 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $3 @@ -1586,10 +1570,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 243 + i32.const 24 + i32.const 241 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $4 @@ -1603,10 +1587,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 244 + i32.const 24 + i32.const 242 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $3 @@ -1620,10 +1604,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 245 + i32.const 24 + i32.const 243 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $4 @@ -1637,10 +1621,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 246 + i32.const 24 + i32.const 244 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $4 @@ -1654,10 +1638,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 247 + i32.const 24 + i32.const 245 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $3 @@ -1671,10 +1655,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 248 + i32.const 24 + i32.const 246 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.5 @@ -1689,10 +1673,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 249 + i32.const 24 + i32.const 247 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.5 @@ -1707,14 +1691,14 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 254 + i32.const 24 + i32.const 252 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) - (func $simd/test_i64x2 (; 6 ;) (type $FUNCSIG$v) + (func $simd/test_i64x2 (; 5 ;) (type $FUNCSIG$v) (local $0 v128) (local $1 v128) (local $2 v128) @@ -1729,10 +1713,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 263 + i32.const 24 + i32.const 261 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 1 @@ -1747,10 +1731,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 265 + i32.const 24 + i32.const 263 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -1766,10 +1750,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 267 + i32.const 24 + i32.const 265 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $2 @@ -1783,10 +1767,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 268 + i32.const 24 + i32.const 266 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -1799,10 +1783,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 269 + i32.const 24 + i32.const 267 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $2 @@ -1812,10 +1796,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 274 + i32.const 24 + i32.const 272 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $2 @@ -1825,10 +1809,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 275 + i32.const 24 + i32.const 273 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $2 @@ -1842,10 +1826,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 276 + i32.const 24 + i32.const 274 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -1859,10 +1843,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 281 + i32.const 24 + i32.const 279 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 1 @@ -1878,10 +1862,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 286 + i32.const 24 + i32.const 284 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -2 @@ -1897,10 +1881,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 287 + i32.const 24 + i32.const 285 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -1 @@ -1916,10 +1900,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 288 + i32.const 24 + i32.const 286 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end v128.const i32x4 0x00000001 0x00000000 0x00000000 0x00000000 @@ -1931,10 +1915,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 289 + i32.const 24 + i32.const 287 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 1 @@ -1947,10 +1931,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 290 + i32.const 24 + i32.const 288 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.5 @@ -1965,10 +1949,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 291 + i32.const 24 + i32.const 289 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.5 @@ -1983,14 +1967,14 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 296 + i32.const 24 + i32.const 294 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) - (func $simd/test_f32x4 (; 7 ;) (type $FUNCSIG$v) + (func $simd/test_f32x4 (; 6 ;) (type $FUNCSIG$v) (local $0 v128) (local $1 v128) (local $2 v128) @@ -2010,10 +1994,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 305 + i32.const 24 + i32.const 303 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -2028,10 +2012,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 307 + i32.const 24 + i32.const 305 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -2047,10 +2031,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 309 + i32.const 24 + i32.const 307 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $2 @@ -2064,10 +2048,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 310 + i32.const 24 + i32.const 308 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $2 @@ -2081,10 +2065,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 311 + i32.const 24 + i32.const 309 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -2102,10 +2086,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 313 + i32.const 24 + i32.const 311 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $3 @@ -2119,10 +2103,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 314 + i32.const 24 + i32.const 312 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -2135,10 +2119,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 315 + i32.const 24 + i32.const 313 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $2 @@ -2148,10 +2132,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 316 + i32.const 24 + i32.const 314 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $2 @@ -2161,10 +2145,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 317 + i32.const 24 + i32.const 315 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $2 @@ -2178,10 +2162,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 318 + i32.const 24 + i32.const 316 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -2195,10 +2179,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 323 + i32.const 24 + i32.const 321 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -2226,10 +2210,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 332 + i32.const 24 + i32.const 330 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $5 @@ -2243,10 +2227,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 333 + i32.const 24 + i32.const 331 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $5 @@ -2260,10 +2244,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 334 + i32.const 24 + i32.const 332 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $4 @@ -2277,10 +2261,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 335 + i32.const 24 + i32.const 333 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $4 @@ -2294,10 +2278,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 336 + i32.const 24 + i32.const 334 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $5 @@ -2311,10 +2295,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 337 + i32.const 24 + i32.const 335 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $5 @@ -2328,10 +2312,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 338 + i32.const 24 + i32.const 336 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $5 @@ -2345,10 +2329,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 339 + i32.const 24 + i32.const 337 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $5 @@ -2361,10 +2345,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 340 + i32.const 24 + i32.const 338 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end v128.const i32x4 0x40800000 0x41100000 0x41800000 0x41c80000 @@ -2377,10 +2361,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 341 + i32.const 24 + i32.const 339 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const -1 @@ -2395,10 +2379,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 342 + i32.const 24 + i32.const 340 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const -1 @@ -2413,14 +2397,14 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 347 + i32.const 24 + i32.const 345 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) - (func $simd/test_f64x2 (; 8 ;) (type $FUNCSIG$v) + (func $simd/test_f64x2 (; 7 ;) (type $FUNCSIG$v) (local $0 v128) (local $1 v128) (local $2 v128) @@ -2440,10 +2424,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 356 + i32.const 24 + i32.const 354 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -2458,10 +2442,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 358 + i32.const 24 + i32.const 356 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -2477,10 +2461,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 360 + i32.const 24 + i32.const 358 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $2 @@ -2494,10 +2478,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 361 + i32.const 24 + i32.const 359 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $2 @@ -2511,10 +2495,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 362 + i32.const 24 + i32.const 360 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -2532,10 +2516,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 364 + i32.const 24 + i32.const 362 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $3 @@ -2549,10 +2533,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 365 + i32.const 24 + i32.const 363 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -2565,10 +2549,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 366 + i32.const 24 + i32.const 364 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $2 @@ -2578,10 +2562,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 367 + i32.const 24 + i32.const 365 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $2 @@ -2591,10 +2575,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 368 + i32.const 24 + i32.const 366 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $2 @@ -2608,10 +2592,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 369 + i32.const 24 + i32.const 367 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -2625,10 +2609,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 374 + i32.const 24 + i32.const 372 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -2656,10 +2640,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 383 + i32.const 24 + i32.const 381 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $5 @@ -2673,10 +2657,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 384 + i32.const 24 + i32.const 382 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $5 @@ -2690,10 +2674,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 385 + i32.const 24 + i32.const 383 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $4 @@ -2707,10 +2691,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 386 + i32.const 24 + i32.const 384 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $4 @@ -2724,10 +2708,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 387 + i32.const 24 + i32.const 385 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $5 @@ -2741,10 +2725,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 388 + i32.const 24 + i32.const 386 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $5 @@ -2758,10 +2742,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 389 + i32.const 24 + i32.const 387 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $5 @@ -2775,10 +2759,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 390 + i32.const 24 + i32.const 388 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $5 @@ -2791,10 +2775,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 391 + i32.const 24 + i32.const 389 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end v128.const i32x4 0x00000000 0x40100000 0x00000000 0x40220000 @@ -2807,10 +2791,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 392 + i32.const 24 + i32.const 390 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -1 @@ -2825,10 +2809,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 393 + i32.const 24 + i32.const 391 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -1 @@ -2843,14 +2827,14 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 398 + i32.const 24 + i32.const 396 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) - (func $simd/test_v8x16 (; 9 ;) (type $FUNCSIG$v) + (func $simd/test_v8x16 (; 8 ;) (type $FUNCSIG$v) (local $0 v128) (local $1 v128) v128.const i32x4 0x03020100 0x07060504 0x0b0a0908 0x0f0e0d0c @@ -2868,29 +2852,26 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 408 + i32.const 24 + i32.const 406 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) - (func $start:simd (; 10 ;) (type $FUNCSIG$v) - call $start:~lib/allocator/arena - block - call $simd/test_v128 - call $simd/test_i8x16 - call $simd/test_i16x8 - call $simd/test_i32x4 - call $simd/test_i64x2 - call $simd/test_f32x4 - call $simd/test_f64x2 - call $simd/test_v8x16 - end + (func $start:simd (; 9 ;) (type $FUNCSIG$v) + call $simd/test_v128 + call $simd/test_i8x16 + call $simd/test_i16x8 + call $simd/test_i32x4 + call $simd/test_i64x2 + call $simd/test_f32x4 + call $simd/test_f64x2 + call $simd/test_v8x16 ) - (func $start (; 11 ;) (type $FUNCSIG$v) + (func $start (; 10 ;) (type $FUNCSIG$v) call $start:simd ) - (func $null (; 12 ;) (type $FUNCSIG$v) + (func $null (; 11 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/static-this.json b/tests/compiler/static-this.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/static-this.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/static-this.optimized.wat b/tests/compiler/static-this.optimized.wat index 77dcc8da54..8a8eb4f047 100644 --- a/tests/compiler/static-this.optimized.wat +++ b/tests/compiler/static-this.optimized.wat @@ -1,14 +1,11 @@ (module (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\0e\00\00\00s\00t\00a\00t\00i\00c\00-\00t\00h\00i\00s\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $static-this/Foo.bar (mut i32) (i32.const 42)) + (data (i32.const 8) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00s\00t\00a\00t\00i\00c\00-\00t\00h\00i\00s\00.\00t\00s") + (global $static-this/Foo.bar i32 (i32.const 42)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $start (; 1 ;) (type $FUNCSIG$v) global.get $static-this/Foo.bar @@ -16,10 +13,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 8 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/static-this.untouched.wat b/tests/compiler/static-this.untouched.wat index 8ec8c05601..f0ff1ce317 100644 --- a/tests/compiler/static-this.untouched.wat +++ b/tests/compiler/static-this.untouched.wat @@ -2,15 +2,13 @@ (type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\0e\00\00\00s\00t\00a\00t\00i\00c\00-\00t\00h\00i\00s\00.\00t\00s\00") + (data (i32.const 8) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00s\00t\00a\00t\00i\00c\00-\00t\00h\00i\00s\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) (global $static-this/Foo.bar (mut i32) (i32.const 42)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 40)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $static-this/Foo.getBar (; 1 ;) (type $FUNCSIG$i) (result i32) global.get $static-this/Foo.bar @@ -22,10 +20,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 8 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/std/allocator_arena.optimized.wat b/tests/compiler/std/allocator_arena.optimized.wat deleted file mode 100644 index 719ce56c7c..0000000000 --- a/tests/compiler/std/allocator_arena.optimized.wat +++ /dev/null @@ -1,1484 +0,0 @@ -(module - (type $FUNCSIG$v (func)) - (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) - (type $FUNCSIG$i (func (result i32))) - (type $FUNCSIG$vi (func (param i32))) - (type $FUNCSIG$vii (func (param i32 i32))) - (type $FUNCSIG$iii (func (param i32 i32) (result i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) - (memory $0 1) - (data (i32.const 8) "\16\00\00\00s\00t\00d\00/\00a\00l\00l\00o\00c\00a\00t\00o\00r\00_\00a\00r\00e\00n\00a\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) - (global $std/allocator_arena/ptr1 (mut i32) (i32.const 0)) - (global $std/allocator_arena/ptr2 (mut i32) (i32.const 0)) - (global $std/allocator_arena/i (mut i32) (i32.const 0)) - (export "memory" (memory $0)) - (export "table" (table $0)) - (start $start) - (func $~lib/allocator/arena/__memory_allocate (; 1 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - global.get $~lib/allocator/arena/offset - local.tee $0 - i32.const 49 - i32.add - i32.const -8 - i32.and - local.tee $1 - current_memory - local.tee $2 - i32.const 16 - i32.shl - i32.gt_u - if - local.get $2 - local.get $1 - local.get $0 - i32.sub - i32.const 65535 - i32.add - i32.const -65536 - i32.and - i32.const 16 - i32.shr_u - local.tee $3 - local.get $2 - local.get $3 - i32.gt_s - select - grow_memory - i32.const 0 - i32.lt_s - if - local.get $3 - grow_memory - i32.const 0 - i32.lt_s - if - unreachable - end - end - end - local.get $1 - global.set $~lib/allocator/arena/offset - local.get $0 - ) - (func $~lib/internal/memory/memset (; 2 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) - (local $2 i32) - local.get $0 - i32.const 18 - i32.store8 - local.get $0 - i32.const 42 - i32.add - local.tee $1 - i32.const 1 - i32.sub - i32.const 18 - i32.store8 - local.get $0 - i32.const 1 - i32.add - i32.const 18 - i32.store8 - local.get $0 - i32.const 2 - i32.add - i32.const 18 - i32.store8 - local.get $1 - i32.const 2 - i32.sub - i32.const 18 - i32.store8 - local.get $1 - i32.const 3 - i32.sub - i32.const 18 - i32.store8 - local.get $0 - i32.const 3 - i32.add - i32.const 18 - i32.store8 - local.get $1 - i32.const 4 - i32.sub - i32.const 18 - i32.store8 - i32.const 0 - local.get $0 - i32.sub - i32.const 3 - i32.and - local.tee $1 - local.get $0 - i32.add - local.tee $0 - i32.const 303174162 - i32.store - i32.const 42 - local.get $1 - i32.sub - i32.const -4 - i32.and - local.tee $1 - local.get $0 - i32.add - i32.const 4 - i32.sub - i32.const 303174162 - i32.store - local.get $1 - i32.const 8 - i32.le_u - if - return - end - local.get $0 - i32.const 4 - i32.add - i32.const 303174162 - i32.store - local.get $0 - i32.const 8 - i32.add - i32.const 303174162 - i32.store - local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 12 - i32.sub - i32.const 303174162 - i32.store - local.get $2 - i32.const 8 - i32.sub - i32.const 303174162 - i32.store - local.get $1 - i32.const 24 - i32.le_u - if - return - end - local.get $0 - i32.const 12 - i32.add - i32.const 303174162 - i32.store - local.get $0 - i32.const 16 - i32.add - i32.const 303174162 - i32.store - local.get $0 - i32.const 20 - i32.add - i32.const 303174162 - i32.store - local.get $0 - i32.const 24 - i32.add - i32.const 303174162 - i32.store - local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 28 - i32.sub - i32.const 303174162 - i32.store - local.get $2 - i32.const 24 - i32.sub - i32.const 303174162 - i32.store - local.get $2 - i32.const 20 - i32.sub - i32.const 303174162 - i32.store - local.get $2 - i32.const 16 - i32.sub - i32.const 303174162 - i32.store - local.get $0 - i32.const 4 - i32.and - i32.const 24 - i32.add - local.tee $2 - local.get $0 - i32.add - local.set $0 - local.get $1 - local.get $2 - i32.sub - local.set $1 - loop $continue|0 - local.get $1 - i32.const 32 - i32.ge_u - if - local.get $0 - i64.const 1302123111085380114 - i64.store - local.get $0 - i32.const 8 - i32.add - i64.const 1302123111085380114 - i64.store - local.get $0 - i32.const 16 - i32.add - i64.const 1302123111085380114 - i64.store - local.get $0 - i32.const 24 - i32.add - i64.const 1302123111085380114 - i64.store - local.get $1 - i32.const 32 - i32.sub - local.set $1 - local.get $0 - i32.const 32 - i32.add - local.set $0 - br $continue|0 - end - end - ) - (func $~lib/internal/memory/memcpy (; 3 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - i32.const 42 - local.set $3 - loop $continue|0 - local.get $1 - i32.const 3 - i32.and - local.get $3 - local.get $3 - select - if - local.get $0 - local.tee $2 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $2 - local.get $4 - i32.load8_u - i32.store8 - local.get $3 - i32.const 1 - i32.sub - local.set $3 - br $continue|0 - end - end - local.get $0 - i32.const 3 - i32.and - i32.eqz - if - loop $continue|1 - local.get $3 - i32.const 16 - i32.ge_u - if - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $1 - i32.const 4 - i32.add - i32.load - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $1 - i32.const 8 - i32.add - i32.load - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 12 - i32.add - i32.load - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $3 - i32.const 16 - i32.sub - local.set $3 - br $continue|1 - end - end - local.get $3 - i32.const 8 - i32.and - if - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $1 - i32.const 4 - i32.add - i32.load - i32.store - local.get $1 - i32.const 8 - i32.add - local.set $1 - local.get $0 - i32.const 8 - i32.add - local.set $0 - end - local.get $3 - i32.const 4 - i32.and - if - local.get $0 - local.get $1 - i32.load - i32.store - local.get $1 - i32.const 4 - i32.add - local.set $1 - local.get $0 - i32.const 4 - i32.add - local.set $0 - end - local.get $3 - i32.const 2 - i32.and - if - local.get $0 - local.get $1 - i32.load16_u - i32.store16 - local.get $1 - i32.const 2 - i32.add - local.set $1 - local.get $0 - i32.const 2 - i32.add - local.set $0 - end - local.get $3 - i32.const 1 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - end - return - end - local.get $3 - i32.const 32 - i32.ge_u - if - block $break|2 - block $case2|2 - block $case1|2 - local.get $0 - i32.const 3 - i32.and - local.tee $2 - i32.const 1 - i32.ne - if - local.get $2 - i32.const 2 - i32.eq - br_if $case1|2 - local.get $2 - i32.const 3 - i32.eq - br_if $case2|2 - br $break|2 - end - local.get $1 - i32.load - local.set $5 - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $2 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $2 - local.get $4 - i32.load8_u - i32.store8 - local.get $3 - i32.const 3 - i32.sub - local.set $3 - loop $continue|3 - local.get $3 - i32.const 17 - i32.ge_u - if - local.get $0 - local.get $1 - i32.const 1 - i32.add - i32.load - local.tee $2 - i32.const 8 - i32.shl - local.get $5 - i32.const 24 - i32.shr_u - i32.or - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $2 - i32.const 24 - i32.shr_u - local.get $1 - i32.const 5 - i32.add - i32.load - local.tee $2 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $2 - i32.const 24 - i32.shr_u - local.get $1 - i32.const 9 - i32.add - i32.load - local.tee $2 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 13 - i32.add - i32.load - local.tee $5 - i32.const 8 - i32.shl - local.get $2 - i32.const 24 - i32.shr_u - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $3 - i32.const 16 - i32.sub - local.set $3 - br $continue|3 - end - end - br $break|2 - end - local.get $1 - i32.load - local.set $5 - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $2 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $2 - local.get $4 - i32.load8_u - i32.store8 - local.get $3 - i32.const 2 - i32.sub - local.set $3 - loop $continue|4 - local.get $3 - i32.const 18 - i32.ge_u - if - local.get $0 - local.get $1 - i32.const 2 - i32.add - i32.load - local.tee $2 - i32.const 16 - i32.shl - local.get $5 - i32.const 16 - i32.shr_u - i32.or - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $2 - i32.const 16 - i32.shr_u - local.get $1 - i32.const 6 - i32.add - i32.load - local.tee $2 - i32.const 16 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $2 - i32.const 16 - i32.shr_u - local.get $1 - i32.const 10 - i32.add - i32.load - local.tee $2 - i32.const 16 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 14 - i32.add - i32.load - local.tee $5 - i32.const 16 - i32.shl - local.get $2 - i32.const 16 - i32.shr_u - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $3 - i32.const 16 - i32.sub - local.set $3 - br $continue|4 - end - end - br $break|2 - end - local.get $1 - i32.load - local.set $5 - local.get $0 - local.tee $2 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $2 - local.get $4 - i32.load8_u - i32.store8 - local.get $3 - i32.const 1 - i32.sub - local.set $3 - loop $continue|5 - local.get $3 - i32.const 19 - i32.ge_u - if - local.get $0 - local.get $1 - i32.const 3 - i32.add - i32.load - local.tee $2 - i32.const 24 - i32.shl - local.get $5 - i32.const 8 - i32.shr_u - i32.or - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $2 - i32.const 8 - i32.shr_u - local.get $1 - i32.const 7 - i32.add - i32.load - local.tee $2 - i32.const 24 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $2 - i32.const 8 - i32.shr_u - local.get $1 - i32.const 11 - i32.add - i32.load - local.tee $2 - i32.const 24 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 15 - i32.add - i32.load - local.tee $5 - i32.const 24 - i32.shl - local.get $2 - i32.const 8 - i32.shr_u - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $3 - i32.const 16 - i32.sub - local.set $3 - br $continue|5 - end - end - end - end - local.get $3 - i32.const 16 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $2 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $2 - local.get $4 - i32.load8_u - i32.store8 - end - local.get $3 - i32.const 8 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $2 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $2 - local.get $4 - i32.load8_u - i32.store8 - end - local.get $3 - i32.const 4 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $2 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $2 - local.get $4 - i32.load8_u - i32.store8 - end - local.get $3 - i32.const 2 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $2 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $2 - local.get $4 - i32.load8_u - i32.store8 - end - local.get $3 - i32.const 1 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - end - ) - (func $~lib/internal/memory/memmove (; 4 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - i32.const 42 - local.set $2 - local.get $0 - local.get $1 - i32.eq - if - return - end - local.get $1 - i32.const 42 - i32.add - local.get $0 - i32.le_u - local.tee $3 - if (result i32) - local.get $3 - else - local.get $0 - i32.const 42 - i32.add - local.get $1 - i32.le_u - end - if - local.get $0 - local.get $1 - call $~lib/internal/memory/memcpy - return - end - local.get $0 - local.get $1 - i32.lt_u - if - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and - i32.eq - if - loop $continue|0 - local.get $0 - i32.const 7 - i32.and - if - local.get $2 - i32.eqz - if - return - end - local.get $2 - i32.const 1 - i32.sub - local.set $2 - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - br $continue|0 - end - end - loop $continue|1 - local.get $2 - i32.const 8 - i32.ge_u - if - local.get $0 - local.get $1 - i64.load - i64.store - local.get $2 - i32.const 8 - i32.sub - local.set $2 - local.get $0 - i32.const 8 - i32.add - local.set $0 - local.get $1 - i32.const 8 - i32.add - local.set $1 - br $continue|1 - end - end - end - loop $continue|2 - local.get $2 - if - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - br $continue|2 - end - end - else - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and - i32.eq - if - loop $continue|3 - local.get $0 - local.get $2 - i32.add - i32.const 7 - i32.and - if - local.get $2 - i32.eqz - if - return - end - local.get $2 - i32.const 1 - i32.sub - local.tee $2 - local.get $0 - i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 - br $continue|3 - end - end - loop $continue|4 - local.get $2 - i32.const 8 - i32.ge_u - if - local.get $2 - i32.const 8 - i32.sub - local.tee $2 - local.get $0 - i32.add - local.get $1 - local.get $2 - i32.add - i64.load - i64.store - br $continue|4 - end - end - end - loop $continue|5 - local.get $2 - if - local.get $2 - i32.const 1 - i32.sub - local.tee $2 - local.get $0 - i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 - br $continue|5 - end - end - end - ) - (func $~lib/internal/memory/memcmp (; 5 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - i32.const 42 - local.set $2 - local.get $0 - local.get $1 - i32.eq - if - i32.const 0 - return - end - loop $continue|0 - local.get $2 - i32.const 0 - i32.ne - local.tee $3 - if (result i32) - local.get $0 - i32.load8_u - local.get $1 - i32.load8_u - i32.eq - else - local.get $3 - end - if - local.get $2 - i32.const 1 - i32.sub - local.set $2 - local.get $0 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.set $1 - br $continue|0 - end - end - local.get $2 - if (result i32) - local.get $0 - i32.load8_u - local.get $1 - i32.load8_u - i32.sub - else - i32.const 0 - end - ) - (func $start:std/allocator_arena (; 6 ;) (type $FUNCSIG$v) - i32.const 56 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - call $~lib/allocator/arena/__memory_allocate - global.set $std/allocator_arena/ptr1 - call $~lib/allocator/arena/__memory_allocate - global.set $std/allocator_arena/ptr2 - global.get $std/allocator_arena/ptr1 - global.get $std/allocator_arena/ptr2 - i32.eq - if - i32.const 0 - i32.const 8 - i32.const 7 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/allocator_arena/ptr1 - call $~lib/internal/memory/memset - i32.const 0 - global.set $std/allocator_arena/i - loop $repeat|0 - global.get $std/allocator_arena/i - i32.const 42 - i32.lt_u - if - global.get $std/allocator_arena/ptr1 - global.get $std/allocator_arena/i - i32.add - i32.load8_u - i32.const 18 - i32.ne - if - i32.const 0 - i32.const 8 - i32.const 12 - i32.const 27 - call $~lib/env/abort - unreachable - else - global.get $std/allocator_arena/i - i32.const 1 - i32.add - global.set $std/allocator_arena/i - br $repeat|0 - end - unreachable - end - end - global.get $std/allocator_arena/ptr2 - global.get $std/allocator_arena/ptr1 - call $~lib/internal/memory/memmove - i32.const 0 - global.set $std/allocator_arena/i - loop $repeat|1 - global.get $std/allocator_arena/i - i32.const 42 - i32.lt_u - if - global.get $std/allocator_arena/ptr2 - global.get $std/allocator_arena/i - i32.add - i32.load8_u - i32.const 18 - i32.ne - if - i32.const 0 - i32.const 8 - i32.const 16 - i32.const 27 - call $~lib/env/abort - unreachable - else - global.get $std/allocator_arena/i - i32.const 1 - i32.add - global.set $std/allocator_arena/i - br $repeat|1 - end - unreachable - end - end - global.get $std/allocator_arena/ptr1 - global.get $std/allocator_arena/ptr2 - call $~lib/internal/memory/memcmp - if - i32.const 0 - i32.const 8 - i32.const 18 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - call $~lib/allocator/arena/__memory_allocate - global.set $std/allocator_arena/ptr1 - global.get $std/allocator_arena/ptr1 - i32.const 56 - i32.ne - if - i32.const 0 - i32.const 8 - i32.const 25 - i32.const 0 - call $~lib/env/abort - unreachable - end - ) - (func $start (; 7 ;) (type $FUNCSIG$v) - call $start:std/allocator_arena - ) - (func $null (; 8 ;) (type $FUNCSIG$v) - nop - ) -) diff --git a/tests/compiler/std/allocator_arena.ts b/tests/compiler/std/allocator_arena.ts deleted file mode 100644 index a38971ea60..0000000000 --- a/tests/compiler/std/allocator_arena.ts +++ /dev/null @@ -1,25 +0,0 @@ -import "allocator/arena"; - -const size: usize = 42; -var ptr1: usize = memory.allocate(size); -var ptr2: usize = memory.allocate(size); - -assert(ptr1 != ptr2); - -memory.fill(ptr1, 0x12, size); - -var i: usize; -for (i = 0; i < size; ++i) assert(load(ptr1 + i) == 0x12); - -memory.copy(ptr2, ptr1, size); - -for (i = 0; i < size; ++i) assert(load(ptr2 + i) == 0x12); - -assert(memory.compare(ptr1, ptr2, size) == 0); - -memory.free(ptr1); -memory.free(ptr2); - -memory.reset(); -ptr1 = memory.allocate(size); -assert(ptr1 == ((HEAP_BASE + 7) & ~7)); diff --git a/tests/compiler/std/array-access.json b/tests/compiler/std/array-access.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/std/array-access.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/std/array-access.optimized.wat b/tests/compiler/std/array-access.optimized.wat index a9133fb21b..0effe66dae 100644 --- a/tests/compiler/std/array-access.optimized.wat +++ b/tests/compiler/std/array-access.optimized.wat @@ -1,73 +1,103 @@ (module (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 16) "\0e\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s") - (data (i32.const 48) "\04\00\00\00n\00u\00l\00l") - (table $0 1 funcref) - (elem (i32.const 0) $null) + (data (i32.const 8) "^\00\00\00\01\00\00\00\01\00\00\00^\00\00\00E\00l\00e\00m\00e\00n\00t\00 \00t\00y\00p\00e\00 \00m\00u\00s\00t\00 \00b\00e\00 \00n\00u\00l\00l\00a\00b\00l\00e\00 \00i\00f\00 \00a\00r\00r\00a\00y\00 \00i\00s\00 \00h\00o\00l\00e\00y") + (data (i32.const 120) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s") + (data (i32.const 168) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e") + (data (i32.const 228) "\01\00\00\00\01") + (data (i32.const 240) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s") + (data (i32.const 288) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00n\00u\00l\00l") (export "memory" (memory $0)) - (export "table" (table $0)) (export "i32ArrayArrayElementAccess" (func $std/array-access/i32ArrayArrayElementAccess)) (export "stringArrayPropertyAccess" (func $std/array-access/stringArrayPropertyAccess)) (export "stringArrayMethodCall" (func $std/array-access/stringArrayMethodCall)) (export "stringArrayArrayPropertyAccess" (func $std/array-access/stringArrayArrayPropertyAccess)) (export "stringArrayArrayMethodCall" (func $std/array-access/stringArrayArrayMethodCall)) - (func $std/array-access/i32ArrayArrayElementAccess (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 1 - i32.const 0 + (func $~lib/array/Array<~lib/array/Array>#__get (; 1 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 local.get $0 - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else + i32.load offset=12 + i32.ge_u + if + i32.const 24 + i32.const 136 + i32.const 106 + i32.const 45 + call $~lib/builtins/abort unreachable end - i32.load - local.tee $0 - i32.load + local.get $1 + local.get $0 + i32.load offset=8 i32.const 2 i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else + i32.ge_u + if + i32.const 184 + i32.const 136 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort unreachable end - ) - (func $std/array-access/stringArrayPropertyAccess (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 0 local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add i32.load - local.tee $0 - i32.load + ) + (func $~lib/array/Array#__get (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.const 1 + local.get $0 + i32.load offset=8 i32.const 2 i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else + i32.ge_u + if + i32.const 184 + i32.const 136 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort unreachable end + local.get $0 + i32.load offset=4 + i32.const 4 + i32.add i32.load ) - (func $~lib/internal/string/compareUnsafe (; 3 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/array-access/i32ArrayArrayElementAccess (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 0 + call $~lib/array/Array<~lib/array/Array>#__get + call $~lib/array/Array#__get + ) + (func $~lib/string/String#get:length (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u + ) + (func $std/array-access/stringArrayPropertyAccess (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 0 + call $~lib/array/Array<~lib/array/Array>#__get + call $~lib/string/String#get:length + ) + (func $~lib/util/string/compareImpl (; 6 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - i32.const 8 + i32.const 240 local.set $3 local.get $1 i32.const 1 @@ -79,14 +109,14 @@ local.get $2 if (result i32) local.get $1 - i32.load16_u offset=4 + i32.load16_u local.get $3 - i32.load16_u offset=4 + i32.load16_u i32.sub local.tee $4 i32.eqz else - local.get $2 + i32.const 0 end if local.get $2 @@ -106,7 +136,7 @@ end local.get $4 ) - (func $~lib/string/String#startsWith (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/string/String#startsWith (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -114,23 +144,23 @@ i32.eqz if i32.const 0 - i32.const 16 - i32.const 229 + i32.const 256 + i32.const 172 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 8 - i32.load - local.tee $2 i32.const 0 local.get $0 - i32.load + call $~lib/string/String#get:length local.tee $1 i32.const 0 local.get $1 i32.lt_s select + local.tee $2 + i32.const 240 + call $~lib/string/String#get:length local.tee $3 i32.add local.get $1 @@ -140,93 +170,34 @@ return end local.get $0 - local.get $3 local.get $2 - call $~lib/internal/string/compareUnsafe + local.get $3 + call $~lib/util/string/compareImpl i32.eqz ) - (func $std/array-access/stringArrayMethodCall (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 0 + (func $std/array-access/stringArrayMethodCall (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end + i32.const 0 + call $~lib/array/Array<~lib/array/Array>#__get call $~lib/string/String#startsWith ) - (func $std/array-access/stringArrayArrayPropertyAccess (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 1 - i32.const 0 + (func $std/array-access/stringArrayArrayPropertyAccess (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else - unreachable - end - i32.load - ) - (func $std/array-access/stringArrayArrayMethodCall (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 1 i32.const 0 + call $~lib/array/Array<~lib/array/Array>#__get + i32.const 1 + call $~lib/array/Array<~lib/array/Array>#__get + call $~lib/string/String#get:length + ) + (func $std/array-access/stringArrayArrayMethodCall (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else - unreachable - end + i32.const 0 + call $~lib/array/Array<~lib/array/Array>#__get + i32.const 1 + call $~lib/array/Array<~lib/array/Array>#__get call $~lib/string/String#startsWith ) - (func $null (; 8 ;) (type $FUNCSIG$v) + (func $null (; 11 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/array-access.untouched.wat b/tests/compiler/std/array-access.untouched.wat index fb344029cd..ee37d0f1c7 100644 --- a/tests/compiler/std/array-access.untouched.wat +++ b/tests/compiler/std/array-access.untouched.wat @@ -1,141 +1,199 @@ (module (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) - (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$iiiiii (func (param i32 i32 i32 i32 i32) (result i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\00\00\00\00") - (data (i32.const 16) "\0e\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s\00") - (data (i32.const 48) "\04\00\00\00n\00u\00l\00l\00") + (data (i32.const 8) "^\00\00\00\01\00\00\00\01\00\00\00^\00\00\00E\00l\00e\00m\00e\00n\00t\00 \00t\00y\00p\00e\00 \00m\00u\00s\00t\00 \00b\00e\00 \00n\00u\00l\00l\00a\00b\00l\00e\00 \00i\00f\00 \00a\00r\00r\00a\00y\00 \00i\00s\00 \00h\00o\00l\00e\00y\00") + (data (i32.const 120) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") + (data (i32.const 168) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 224) "\00\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00") + (data (i32.const 240) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s\00") + (data (i32.const 288) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00n\00u\00l\00l\00") (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/memory/HEAP_BASE i32 (i32.const 60)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "i32ArrayArrayElementAccess" (func $std/array-access/i32ArrayArrayElementAccess)) (export "stringArrayPropertyAccess" (func $std/array-access/stringArrayPropertyAccess)) (export "stringArrayMethodCall" (func $std/array-access/stringArrayMethodCall)) (export "stringArrayArrayPropertyAccess" (func $std/array-access/stringArrayArrayPropertyAccess)) (export "stringArrayArrayMethodCall" (func $std/array-access/stringArrayArrayMethodCall)) - (func $~lib/array/Array<~lib/array/Array>#__get (; 1 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) + (func $~lib/rt/stub/__retain (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - i32.load - local.set $2 + ) + (func $~lib/array/Array<~lib/array/Array>#__unchecked_get (; 2 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.load offset=4 local.get $1 - local.get $2 + i32.const 2 + i32.shl + i32.add i32.load + call $~lib/rt/stub/__retain + ) + (func $~lib/array/Array<~lib/array/Array>#__get (; 3 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 + local.get $0 + i32.load offset=12 + i32.ge_u + if + i32.const 24 + i32.const 136 + i32.const 106 + i32.const 45 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $0 + i32.load offset=8 i32.const 2 i32.shr_u - i32.lt_u - if (result i32) - local.get $2 - local.set $3 - local.get $1 - local.set $4 - i32.const 0 - local.set $5 - local.get $3 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $5 - i32.add - i32.load offset=8 - else + i32.ge_u + if + i32.const 184 + i32.const 136 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort unreachable end + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#__unchecked_get ) - (func $~lib/array/Array#__get (; 2 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) + (func $~lib/array/Array#__unchecked_get (; 4 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 - i32.load - local.set $2 + i32.load offset=4 local.get $1 - local.get $2 + i32.const 2 + i32.shl + i32.add i32.load + ) + (func $~lib/array/Array#__get (; 5 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 + local.get $0 + i32.load offset=8 i32.const 2 i32.shr_u - i32.lt_u - if (result i32) - local.get $2 - local.set $3 - local.get $1 - local.set $4 - i32.const 0 - local.set $5 - local.get $3 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $5 - i32.add - i32.load offset=8 - else + i32.ge_u + if + i32.const 184 + i32.const 136 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort unreachable end + local.get $0 + local.get $1 + call $~lib/array/Array#__unchecked_get + ) + (func $~lib/rt/stub/__release (; 6 ;) (type $FUNCSIG$vi) (param $0 i32) + nop ) - (func $std/array-access/i32ArrayArrayElementAccess (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $std/array-access/i32ArrayArrayElementAccess (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop local.get $0 i32.const 0 call $~lib/array/Array<~lib/array/Array>#__get + local.tee $1 i32.const 1 call $~lib/array/Array#__get - ) - (func $~lib/array/Array<~lib/string/String>#__get (; 4 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load local.set $2 local.get $1 + call $~lib/rt/stub/__release + local.get $0 + call $~lib/rt/stub/__release local.get $2 + ) + (func $~lib/array/Array<~lib/string/String>#__unchecked_get (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add i32.load + call $~lib/rt/stub/__retain + ) + (func $~lib/array/Array<~lib/string/String>#__get (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 + local.get $0 + i32.load offset=12 + i32.ge_u + if + i32.const 24 + i32.const 136 + i32.const 106 + i32.const 45 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $0 + i32.load offset=8 i32.const 2 i32.shr_u - i32.lt_u - if (result i32) - local.get $2 - local.set $3 - local.get $1 - local.set $4 - i32.const 0 - local.set $5 - local.get $3 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $5 - i32.add - i32.load offset=8 - else + i32.ge_u + if + i32.const 184 + i32.const 136 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort unreachable end + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/string/String>#__unchecked_get + ) + (func $~lib/string/String#get:length (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u ) - (func $std/array-access/stringArrayPropertyAccess (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $std/array-access/stringArrayPropertyAccess (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop local.get $0 i32.const 0 call $~lib/array/Array<~lib/string/String>#__get - i32.load + local.tee $1 + call $~lib/string/String#get:length + local.set $2 + local.get $1 + call $~lib/rt/stub/__release + local.get $0 + call $~lib/rt/stub/__release + local.get $2 ) - (func $~lib/internal/string/compareUnsafe (; 6 ;) (type $FUNCSIG$iiiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) + (func $~lib/util/string/compareImpl (; 12 ;) (type $FUNCSIG$iiiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) (local $5 i32) (local $6 i32) (local $7 i32) + (local $8 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $2 + call $~lib/rt/stub/__retain + drop i32.const 0 local.set $5 local.get $0 @@ -155,162 +213,240 @@ local.get $4 if (result i32) local.get $6 - i32.load16_u offset=4 + i32.load16_u local.get $7 - i32.load16_u offset=4 + i32.load16_u i32.sub local.tee $5 i32.eqz else - local.get $4 + i32.const 0 end if - block - local.get $4 - i32.const 1 - i32.sub - local.set $4 - local.get $6 - i32.const 2 - i32.add - local.set $6 - local.get $7 - i32.const 2 - i32.add - local.set $7 - end + local.get $4 + i32.const 1 + i32.sub + local.set $4 + local.get $6 + i32.const 2 + i32.add + local.set $6 + local.get $7 + i32.const 2 + i32.add + local.set $7 br $continue|0 end end end local.get $5 + local.set $8 + local.get $0 + call $~lib/rt/stub/__release + local.get $2 + call $~lib/rt/stub/__release + local.get $8 ) - (func $~lib/string/String#startsWith (; 7 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/string/String#startsWith (; 13 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) + local.get $1 + call $~lib/rt/stub/__retain + drop local.get $0 i32.const 0 i32.ne i32.eqz if i32.const 0 - i32.const 16 - i32.const 229 + i32.const 256 + i32.const 172 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 i32.const 0 i32.eq if - i32.const 48 + block (result i32) + i32.const 304 + local.tee $3 + local.get $1 + local.tee $4 + i32.ne + if + local.get $3 + call $~lib/rt/stub/__retain + drop + local.get $4 + call $~lib/rt/stub/__release + end + local.get $3 + end local.set $1 end - local.get $2 - local.set $3 local.get $0 - i32.load - local.set $4 - local.get $3 - local.tee $5 + call $~lib/string/String#get:length + local.set $5 + local.get $2 + local.tee $3 i32.const 0 - local.tee $6 - local.get $5 - local.get $6 + local.tee $4 + local.get $3 + local.get $4 i32.gt_s select - local.tee $5 - local.get $4 - local.tee $6 + local.tee $3 local.get $5 - local.get $6 + local.tee $4 + local.get $3 + local.get $4 i32.lt_s select - local.set $7 + local.set $6 local.get $1 - i32.load - local.set $8 - local.get $8 + call $~lib/string/String#get:length + local.set $7 local.get $7 + local.get $6 i32.add - local.get $4 + local.get $5 i32.gt_s if i32.const 0 + local.set $3 + local.get $1 + call $~lib/rt/stub/__release + local.get $3 return end local.get $0 - local.get $7 + local.get $6 local.get $1 i32.const 0 - local.get $8 - call $~lib/internal/string/compareUnsafe + local.get $7 + call $~lib/util/string/compareImpl i32.eqz + local.set $3 + local.get $1 + call $~lib/rt/stub/__release + local.get $3 ) - (func $std/array-access/stringArrayMethodCall (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $std/array-access/stringArrayMethodCall (; 14 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop local.get $0 i32.const 0 call $~lib/array/Array<~lib/string/String>#__get - i32.const 8 + local.tee $1 + i32.const 240 i32.const 0 call $~lib/string/String#startsWith - ) - (func $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__get (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load local.set $2 local.get $1 + call $~lib/rt/stub/__release + local.get $0 + call $~lib/rt/stub/__release local.get $2 + ) + (func $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__unchecked_get (; 15 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add i32.load + call $~lib/rt/stub/__retain + ) + (func $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__get (; 16 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 + local.get $0 + i32.load offset=12 + i32.ge_u + if + i32.const 24 + i32.const 136 + i32.const 106 + i32.const 45 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $0 + i32.load offset=8 i32.const 2 i32.shr_u - i32.lt_u - if (result i32) - local.get $2 - local.set $3 - local.get $1 - local.set $4 - i32.const 0 - local.set $5 - local.get $3 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $5 - i32.add - i32.load offset=8 - else + i32.ge_u + if + i32.const 184 + i32.const 136 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort unreachable end + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__unchecked_get ) - (func $std/array-access/stringArrayArrayPropertyAccess (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $std/array-access/stringArrayArrayPropertyAccess (; 17 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop local.get $0 i32.const 0 call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__get + local.tee $1 i32.const 1 call $~lib/array/Array<~lib/string/String>#__get - i32.load + local.tee $2 + call $~lib/string/String#get:length + local.set $3 + local.get $1 + call $~lib/rt/stub/__release + local.get $2 + call $~lib/rt/stub/__release + local.get $0 + call $~lib/rt/stub/__release + local.get $3 ) - (func $std/array-access/stringArrayArrayMethodCall (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $std/array-access/stringArrayArrayMethodCall (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop local.get $0 i32.const 0 call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__get + local.tee $1 i32.const 1 call $~lib/array/Array<~lib/string/String>#__get - i32.const 8 + local.tee $2 + i32.const 240 i32.const 0 call $~lib/string/String#startsWith + local.set $3 + local.get $1 + call $~lib/rt/stub/__release + local.get $2 + call $~lib/rt/stub/__release + local.get $0 + call $~lib/rt/stub/__release + local.get $3 ) - (func $null (; 12 ;) (type $FUNCSIG$v) + (func $null (; 19 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/std/array-literal.json b/tests/compiler/std/array-literal.json new file mode 100644 index 0000000000..9f7878d475 --- /dev/null +++ b/tests/compiler/std/array-literal.json @@ -0,0 +1,6 @@ +{ + "asc_flags": [ + "--runtime half", + "--use ASC_RTRACE=1" + ] +} \ No newline at end of file diff --git a/tests/compiler/std/array-literal.optimized.wat b/tests/compiler/std/array-literal.optimized.wat index dd76e7ad42..f18279722a 100644 --- a/tests/compiler/std/array-literal.optimized.wat +++ b/tests/compiler/std/array-literal.optimized.wat @@ -1,904 +1,2237 @@ (module - (type $FUNCSIG$v (func)) - (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$v (func)) (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$i (func (result i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32))) + (import "rtrace" "onincrement" (func $~lib/rt/rtrace/onincrement (param i32))) + (import "rtrace" "ondecrement" (func $~lib/rt/rtrace/ondecrement (param i32))) + (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) (memory $0 1) - (data (i32.const 8) "\03") - (data (i32.const 17) "\01\02") - (data (i32.const 24) "\08\00\00\00\03") - (data (i32.const 32) "\14\00\00\00s\00t\00d\00/\00a\00r\00r\00a\00y\00-\00l\00i\00t\00e\00r\00a\00l\00.\00t\00s") - (data (i32.const 80) "\0c") - (data (i32.const 92) "\01\00\00\00\02") - (data (i32.const 112) "P\00\00\00\03") - (data (i32.const 128) "x") - (data (i32.const 136) "\0d\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s") - (data (i32.const 168) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) - (global $std/array-literal/emptyArrayI32 (mut i32) (i32.const 128)) + (data (i32.const 8) "\03\00\00\00\01\00\00\00\00\00\00\00\03\00\00\00\00\01\02") + (data (i32.const 32) "\10\00\00\00\01\00\00\00\03\00\00\00\10\00\00\00\18\00\00\00\18\00\00\00\03\00\00\00\03") + (data (i32.const 64) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00s\00t\00d\00/\00a\00r\00r\00a\00y\00-\00l\00i\00t\00e\00r\00a\00l\00.\00t\00s") + (data (i32.const 120) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e") + (data (i32.const 176) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s") + (data (i32.const 224) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\00\00\00\00\01\00\00\00\02") + (data (i32.const 256) "\10\00\00\00\01\00\00\00\04\00\00\00\10\00\00\00\f0\00\00\00\f0\00\00\00\0c\00\00\00\03") + (data (i32.const 292) "\01") + (data (i32.const 304) "\10\00\00\00\01\00\00\00\04\00\00\00\10\00\00\000\01\00\000\01") + (data (i32.const 336) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s") + (data (i32.const 384) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e") + (data (i32.const 440) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s") + (data (i32.const 488) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s") + (data (i32.const 528) "\t\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\003\04\00\00\02\00\00\00\93\04\00\00\02\00\00\00\10\00\00\00\00\00\00\00\93 \00\00\02\00\00\00\10\00\00\00\00\00\00\00\93 \00\00\02") + (global $std/array-literal/emptyArrayI32 i32 (i32.const 320)) (global $std/array-literal/i (mut i32) (i32.const 0)) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $std/array-literal/dynamicArrayI8 (mut i32) (i32.const 0)) (global $std/array-literal/dynamicArrayI32 (mut i32) (i32.const 0)) (global $std/array-literal/dynamicArrayRef (mut i32) (i32.const 0)) (global $std/array-literal/dynamicArrayRefWithCtor (mut i32) (i32.const 0)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) - (func $~lib/allocator/arena/__memory_allocate (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) + (func $~lib/array/Array#__get (; 5 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 local.get $0 - i32.const 1073741824 - i32.gt_u + i32.load offset=8 + i32.ge_u if + i32.const 136 + i32.const 192 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort unreachable end - global.get $~lib/allocator/arena/offset - local.tee $1 - local.get $0 - i32.const 1 local.get $0 - i32.const 1 - i32.gt_u - select + i32.load offset=4 + local.get $1 i32.add - i32.const 7 + i32.load8_s + ) + (func $~lib/array/Array#__get (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ge_u + if + i32.const 136 + i32.const 192 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl i32.add - i32.const -8 + i32.load + ) + (func $~lib/rt/tlsf/removeBlock (; 7 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.tee $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 352 + i32.const 276 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const -4 i32.and - local.tee $0 - current_memory local.tee $2 i32.const 16 - i32.shl - i32.gt_u + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz if + i32.const 0 + i32.const 352 + i32.const 278 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 256 + i32.lt_u + if (result i32) local.get $2 - local.get $0 - local.get $1 - i32.sub - i32.const 65535 - i32.add - i32.const -65536 - i32.and - i32.const 16 + i32.const 4 i32.shr_u - local.tee $3 + local.set $2 + i32.const 0 + else local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $3 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $2 local.get $3 - i32.gt_s - select - grow_memory + i32.const 7 + i32.sub + end + local.tee $3 + i32.const 23 + i32.lt_u + if (result i32) + local.get $2 + i32.const 16 + i32.lt_u + else i32.const 0 - i32.lt_s - if - local.get $3 - grow_memory - i32.const 0 - i32.lt_s - if - unreachable - end - end end - local.get $0 - global.set $~lib/allocator/arena/offset - local.get $1 - ) - (func $~lib/internal/arraybuffer/allocateUnsafe (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - local.get $0 - i32.const 1073741816 - i32.gt_u + i32.eqz if i32.const 0 - i32.const 168 - i32.const 26 - i32.const 2 - call $~lib/env/abort + i32.const 352 + i32.const 291 + i32.const 13 + call $~lib/builtins/abort unreachable end - i32.const 1 - i32.const 32 - local.get $0 - i32.const 7 - i32.add - i32.clz - i32.sub - i32.shl - call $~lib/allocator/arena/__memory_allocate - local.tee $1 - local.get $0 - i32.store local.get $1 - ) - (func $~lib/internal/memory/memset (; 3 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - (local $2 i32) + i32.load offset=20 + local.set $4 local.get $1 - i32.eqz + i32.load offset=16 + local.tee $5 if - return + local.get $5 + local.get $4 + i32.store offset=20 end - local.get $0 - i32.const 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - i32.const 1 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 2 - i32.le_u + local.get $4 if - return + local.get $4 + local.get $5 + i32.store offset=16 end - local.get $0 - i32.const 1 + local.get $3 + i32.const 4 + i32.shl + local.get $2 i32.add - i32.const 0 - i32.store8 - local.get $0 i32.const 2 - i32.add - i32.const 0 - i32.store8 + i32.shl local.get $0 - local.get $1 i32.add - local.tee $2 - i32.const 2 - i32.sub - i32.const 0 - i32.store8 - local.get $2 - i32.const 3 - i32.sub - i32.const 0 - i32.store8 + i32.load offset=96 local.get $1 - i32.const 6 - i32.le_u + i32.eq if - return + local.get $3 + i32.const 4 + i32.shl + local.get $2 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $4 + i32.store offset=96 + local.get $4 + i32.eqz + if + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const 1 + local.get $2 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.store offset=4 + local.get $1 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $3 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end end - local.get $0 - i32.const 3 - i32.add - i32.const 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - i32.const 4 - i32.sub - i32.const 0 - i32.store8 + ) + (func $~lib/rt/tlsf/insertBlock (; 8 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) local.get $1 - i32.const 8 - i32.le_u + i32.eqz if - return + i32.const 0 + i32.const 352 + i32.const 204 + i32.const 13 + call $~lib/builtins/abort + unreachable end - i32.const 0 - local.get $0 - i32.sub - i32.const 3 + local.get $1 + i32.load + local.tee $3 + i32.const 1 i32.and - local.tee $2 - local.get $0 + i32.eqz + if + i32.const 0 + i32.const 352 + i32.const 206 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 i32.add - local.tee $0 - i32.const 0 - i32.store local.get $1 - local.get $2 - i32.sub + i32.load i32.const -4 i32.and - local.tee $1 - local.get $0 i32.add - i32.const 4 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 8 - i32.le_u + local.tee $4 + i32.load + local.tee $5 + i32.const 1 + i32.and if - return + local.get $3 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const -4 + i32.and + i32.add + local.tee $2 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $3 + i32.const 3 + i32.and + local.get $2 + i32.or + local.tee $3 + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.set $5 + end end - local.get $0 - i32.const 4 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 8 - i32.add - i32.const 0 + local.get $3 + i32.const 2 + i32.and + if + local.get $1 + i32.const 4 + i32.sub + i32.load + local.tee $2 + i32.load + local.tee $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 352 + i32.const 227 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $3 + i32.const -4 + i32.and + i32.add + local.tee $7 + i32.const 1073741808 + i32.lt_u + if (result i32) + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $2 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $3 + i32.store + local.get $2 + else + local.get $1 + end + local.set $1 + end + local.get $4 + local.get $5 + i32.const 2 + i32.or i32.store - local.get $0 + local.get $3 + i32.const -4 + i32.and + local.tee $2 + i32.const 16 + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 352 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 local.get $1 + i32.const 16 i32.add - local.tee $2 - i32.const 12 - i32.sub - i32.const 0 - i32.store local.get $2 - i32.const 8 + i32.add + i32.ne + if + i32.const 0 + i32.const 352 + i32.const 243 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 i32.sub - i32.const 0 - i32.store local.get $1 - i32.const 24 - i32.le_u + i32.store + local.get $2 + i32.const 256 + i32.lt_u + if (result i32) + local.get $2 + i32.const 4 + i32.shr_u + local.set $4 + i32.const 0 + else + local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $4 + local.get $2 + i32.const 7 + i32.sub + end + local.tee $3 + i32.const 23 + i32.lt_u + if (result i32) + local.get $4 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz if - return + i32.const 0 + i32.const 352 + i32.const 259 + i32.const 13 + call $~lib/builtins/abort + unreachable end + local.get $3 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl local.get $0 - i32.const 12 i32.add + i32.load offset=96 + local.set $2 + local.get $1 i32.const 0 - i32.store + i32.store offset=16 + local.get $1 + local.get $2 + i32.store offset=20 + local.get $2 + if + local.get $2 + local.get $1 + i32.store offset=16 + end + local.get $3 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl local.get $0 - i32.const 16 i32.add - i32.const 0 + local.get $1 + i32.store offset=96 + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $3 + i32.shl + i32.or i32.store + local.get $3 + i32.const 2 + i32.shl local.get $0 - i32.const 20 i32.add - i32.const 0 - i32.store + local.get $3 + i32.const 2 + i32.shl local.get $0 - i32.const 24 i32.add + i32.load offset=4 + i32.const 1 + local.get $4 + i32.shl + i32.or + i32.store offset=4 + ) + (func $~lib/rt/tlsf/addMemory (; 9 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz i32.const 0 - i32.store - local.get $0 local.get $1 - i32.add - local.tee $2 - i32.const 28 - i32.sub + i32.const 15 + i32.and + i32.eqz i32.const 0 - i32.store + local.get $1 + local.get $2 + i32.le_u + select + select + i32.eqz + if + i32.const 0 + i32.const 352 + i32.const 385 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=1568 + local.tee $3 + if + local.get $1 + local.get $3 + i32.const 16 + i32.add + i32.lt_u + if + i32.const 0 + i32.const 352 + i32.const 395 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $3 + i32.eq + if + local.get $3 + i32.load + local.set $4 + local.get $1 + i32.const 16 + i32.sub + local.set $1 + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.lt_u + if + i32.const 0 + i32.const 352 + i32.const 407 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end local.get $2 - i32.const 24 + local.get $1 i32.sub - i32.const 0 - i32.store + local.tee $2 + i32.const 48 + i32.lt_u + if + return + end + local.get $1 + local.get $4 + i32.const 2 + i32.and local.get $2 - i32.const 20 + i32.const 32 i32.sub - i32.const 0 + i32.const 1 + i32.or + i32.or i32.store + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.store offset=20 + local.get $1 local.get $2 + i32.add i32.const 16 i32.sub - i32.const 0 + local.tee $2 + i32.const 2 i32.store local.get $0 - i32.const 4 - i32.and - i32.const 24 - i32.add - local.tee $2 + local.get $2 + i32.store offset=1568 local.get $0 - i32.add - local.set $0 local.get $1 - local.get $2 - i32.sub - local.set $1 - loop $continue|0 - local.get $1 - i32.const 32 - i32.ge_u - if - local.get $0 - i64.const 0 - i64.store - local.get $0 - i32.const 8 - i32.add - i64.const 0 - i64.store + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/tlsf/initializeRoot (; 10 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 1 + memory.size + local.tee $0 + i32.gt_s + if (result i32) + i32.const 1 + local.get $0 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + i32.const 608 + i32.const 0 + i32.store + i32.const 2176 + i32.const 0 + i32.store + i32.const 0 + local.set $0 + loop $repeat|0 + block $break|0 local.get $0 - i32.const 16 - i32.add - i64.const 0 - i64.store + i32.const 23 + i32.ge_u + br_if $break|0 local.get $0 - i32.const 24 + i32.const 2 + i32.shl + i32.const 608 i32.add - i64.const 0 - i64.store - local.get $1 - i32.const 32 - i32.sub + i32.const 0 + i32.store offset=4 + i32.const 0 local.set $1 + loop $repeat|1 + block $break|1 + local.get $1 + i32.const 16 + i32.ge_u + br_if $break|1 + local.get $0 + i32.const 4 + i32.shl + local.get $1 + i32.add + i32.const 2 + i32.shl + i32.const 608 + i32.add + i32.const 0 + i32.store offset=96 + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|1 + end + end local.get $0 - i32.const 32 + i32.const 1 i32.add local.set $0 - br $continue|0 + br $repeat|0 end end + i32.const 608 + i32.const 2192 + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + i32.const 608 + global.set $~lib/rt/tlsf/ROOT ) - (func $~lib/array/Array#constructor (; 4 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) - (local $1 i32) - i32.const 3 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $1 - i32.const 8 - call $~lib/allocator/arena/__memory_allocate + (func $~lib/rt/tlsf/prepareSize (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 400 + i32.const 352 + i32.const 447 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const -16 + i32.and + local.tee $0 + i32.const 16 + local.get $0 + i32.const 16 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 12 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + i32.const 256 + i32.lt_u + if (result i32) + local.get $1 + i32.const 4 + i32.shr_u + local.set $1 + i32.const 0 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + local.get $1 + i32.add + i32.const 1 + i32.sub + local.set $1 + end + local.get $1 + i32.const 31 + local.get $1 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $1 + local.get $2 + i32.const 7 + i32.sub + end + local.tee $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $1 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 352 + i32.const 337 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const -1 + local.get $1 + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $1 + i32.ctz + local.get $2 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + else + local.get $0 + i32.load + i32.const -1 + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $1 + i32.ctz + local.tee $1 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 352 + i32.const 350 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.ctz + local.get $1 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + else + i32.const 0 + end + end + ) + (func $~lib/rt/tlsf/growMemory (; 13 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + memory.size + local.tee $2 + local.get $1 + i32.const 65535 + i32.add + i32.const -65536 + i32.and + i32.const 16 + i32.shr_u + local.tee $1 + local.get $2 + local.get $1 + i32.gt_s + select + memory.grow + i32.const 0 + i32.lt_s + if + local.get $1 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + local.get $0 + local.get $2 + i32.const 16 + i32.shl + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + ) + (func $~lib/rt/tlsf/prepareBlock (; 14 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + if + i32.const 0 + i32.const 352 + i32.const 364 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const -4 + i32.and + local.get $2 + i32.sub + local.tee $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $3 + i32.const 2 + i32.and + local.get $2 + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.tee $1 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const -2 + i32.and + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + i32.load + i32.const -3 + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 15 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.tee $3 + call $~lib/rt/tlsf/searchBlock + local.tee $2 + i32.eqz + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $3 + call $~lib/rt/tlsf/searchBlock + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 352 + i32.const 477 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + i32.load + i32.const -4 + i32.and + local.get $3 + i32.lt_u + if + i32.const 0 + i32.const 352 + i32.const 479 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 0 + i32.store offset=4 + local.get $2 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $2 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $2 + call $~lib/rt/rtrace/onalloc + local.get $2 + ) + (func $~lib/rt/tlsf/__alloc (; 16 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + global.get $~lib/rt/tlsf/ROOT + local.tee $2 + if (result i32) + local.get $2 + else + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + end + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.tee $0 + local.get $1 + i32.store offset=8 + local.get $0 + i32.const 16 + i32.add + ) + (func $~lib/rt/pure/increment (; 17 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const -268435456 + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne + if + i32.const 0 + i32.const 456 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/rtrace/onincrement + local.get $0 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 456 + i32.const 107 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/pure/__retain (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 604 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment + end + local.get $0 + ) + (func $~lib/memory/memory.copy (; 19 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $2 + local.set $3 + local.get $0 + local.get $1 + i32.eq + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $1 + i32.lt_u + if + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|0 + local.get $0 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + br $continue|0 + end + end + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $1 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + br $continue|1 + end + end + end + loop $continue|2 + local.get $3 + if + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + else + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|3 + local.get $0 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $3 + i32.const 8 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + loop $continue|5 + local.get $3 + if + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + ) + (func $~lib/rt/__allocArray (; 20 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + i32.const 16 + local.get $1 + call $~lib/rt/tlsf/__alloc + local.tee $1 + i32.const 3 + local.get $0 + i32.shl local.tee $0 i32.const 0 + call $~lib/rt/tlsf/__alloc + local.tee $2 + call $~lib/rt/pure/__retain i32.store + local.get $1 + local.get $2 + i32.store offset=4 + local.get $1 + local.get $0 + i32.store offset=8 + local.get $1 + i32.const 3 + i32.store offset=12 + local.get $1 + ) + (func $std/array-literal/Ref#constructor (; 21 ;) (type $FUNCSIG$i) (result i32) + i32.const 0 + i32.const 5 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + ) + (func $std/array-literal/RefWithCtor#constructor (; 22 ;) (type $FUNCSIG$i) (result i32) + i32.const 0 + i32.const 7 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + ) + (func $~lib/rt/tlsf/freeBlock (; 23 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.tee $2 + i32.const 1 + i32.and + if + i32.const 0 + i32.const 352 + i32.const 531 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/rtrace/onfree + ) + (func $~lib/rt/__typeinfo (; 24 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 528 + i32.load + i32.gt_u + if + i32.const 136 + i32.const 504 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 3 + i32.shl + i32.const 532 + i32.add + i32.load + ) + (func $~lib/rt/tlsf/__free (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 352 + i32.const 561 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $0 + select + i32.eqz + if + i32.const 0 + i32.const 352 + i32.const 562 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/growRoots (; 26 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/pure/CUR + global.get $~lib/rt/pure/ROOTS + local.tee $1 + i32.sub + local.tee $2 + i32.const 1 + i32.shl + local.tee $0 + i32.const 256 local.get $0 + i32.const 256 + i32.gt_u + select + local.tee $3 i32.const 0 - i32.store offset=4 + call $~lib/rt/tlsf/__alloc + local.tee $0 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onfree local.get $0 local.get $1 - i32.store - local.get $0 - i32.const 3 - i32.store offset=4 + local.get $2 + call $~lib/memory/memory.copy local.get $1 - i32.const 8 + if + local.get $1 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onalloc + local.get $1 + call $~lib/rt/tlsf/__free + end + local.get $0 + global.set $~lib/rt/pure/ROOTS + local.get $0 + local.get $2 i32.add - i32.const 3 - call $~lib/internal/memory/memset + global.set $~lib/rt/pure/CUR local.get $0 + local.get $3 + i32.add + global.set $~lib/rt/pure/END ) - (func $~lib/array/Array#constructor (; 5 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) + (func $~lib/rt/pure/appendRoot (; 27 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) - i32.const 12 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $1 - i32.const 8 - call $~lib/allocator/arena/__memory_allocate - local.tee $0 - i32.const 0 + global.get $~lib/rt/pure/CUR + local.tee $1 + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 + end + local.get $1 + local.get $0 i32.store + local.get $1 + i32.const 4 + i32.add + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/decrement (; 28 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) local.get $0 - i32.const 0 - i32.store offset=4 + i32.load offset=4 + local.tee $2 + i32.const 268435455 + i32.and + local.set $1 local.get $0 - local.get $1 - i32.store + call $~lib/rt/rtrace/ondecrement local.get $0 - i32.const 3 - i32.store offset=4 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 456 + i32.const 115 + i32.const 13 + call $~lib/builtins/abort + unreachable + end local.get $1 - i32.const 8 - i32.add - i32.const 12 - call $~lib/internal/memory/memset + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/rt/__visit_members + local.get $2 + i32.const -2147483648 + i32.and + if + local.get $0 + i32.const -2147483648 + i32.store offset=4 + else + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + else + local.get $1 + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 456 + i32.const 124 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 16 + i32.and + if + local.get $0 + local.get $1 + i32.const 1 + i32.sub + local.get $2 + i32.const -268435456 + i32.and + i32.or + i32.store offset=4 + else + local.get $0 + local.get $1 + i32.const 1 + i32.sub + i32.const -1342177280 + i32.or + i32.store offset=4 + local.get $2 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/appendRoot + end + end + end + ) + (func $~lib/rt/pure/__release (; 29 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 + i32.const 604 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + end ) - (func $start:std/array-literal (; 6 ;) (type $FUNCSIG$v) + (func $start:std/array-literal (; 30 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) - i32.const 232 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - i32.const 28 + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + i32.const 60 i32.load i32.const 3 i32.ne if i32.const 0 - i32.const 32 - i32.const 4 + i32.const 80 + i32.const 2 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + i32.const 48 i32.const 0 - i32.const 24 - i32.load - local.tee $0 - i32.load - i32.lt_u - if (result i32) - local.get $0 - i32.load8_s offset=8 - else - unreachable - end - i32.const 255 - i32.and + call $~lib/array/Array#__get if i32.const 0 - i32.const 32 - i32.const 5 + i32.const 80 + i32.const 3 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + i32.const 48 i32.const 1 - i32.const 24 - i32.load - local.tee $0 - i32.load - i32.lt_u - if (result i32) - local.get $0 - i32.const 1 - i32.add - i32.load8_s offset=8 - else - unreachable - end - i32.const 255 - i32.and + call $~lib/array/Array#__get i32.const 1 i32.ne if i32.const 0 - i32.const 32 - i32.const 6 + i32.const 80 + i32.const 4 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + i32.const 48 i32.const 2 - i32.const 24 - i32.load - local.tee $0 - i32.load - i32.lt_u - if (result i32) - local.get $0 - i32.const 2 - i32.add - i32.load8_s offset=8 - else - unreachable - end - i32.const 255 - i32.and + call $~lib/array/Array#__get i32.const 2 i32.ne if i32.const 0 - i32.const 32 - i32.const 7 + i32.const 80 + i32.const 5 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 116 + i32.const 284 i32.load i32.const 3 i32.ne if i32.const 0 - i32.const 32 - i32.const 10 + i32.const 80 + i32.const 8 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + i32.const 272 i32.const 0 - i32.const 112 - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end + call $~lib/array/Array#__get if i32.const 0 - i32.const 32 - i32.const 11 + i32.const 80 + i32.const 9 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + i32.const 272 i32.const 1 - i32.const 112 - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else - unreachable - end + call $~lib/array/Array#__get i32.const 1 i32.ne if i32.const 0 - i32.const 32 - i32.const 12 + i32.const 80 + i32.const 10 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + i32.const 272 i32.const 2 - i32.const 112 - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 8 - i32.add - i32.load offset=8 - else - unreachable - end + call $~lib/array/Array#__get i32.const 2 i32.ne if i32.const 0 - i32.const 32 - i32.const 13 + i32.const 80 + i32.const 11 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/array-literal/emptyArrayI32 - i32.load offset=4 + i32.load offset=12 if i32.const 0 - i32.const 32 - i32.const 16 + i32.const 80 + i32.const 14 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - call $~lib/array/Array#constructor + i32.const 0 + i32.const 3 + call $~lib/rt/__allocArray + local.tee $1 + i32.load offset=4 local.tee $0 - i32.load global.get $std/array-literal/i - local.tee $1 - i32.store8 offset=8 - local.get $1 + i32.store8 + global.get $std/array-literal/i i32.const 1 i32.add global.set $std/array-literal/i local.get $0 - i32.load - i32.const 1 - i32.add global.get $std/array-literal/i - local.tee $1 - i32.store8 offset=8 - local.get $1 + i32.store8 offset=1 + global.get $std/array-literal/i i32.const 1 i32.add global.set $std/array-literal/i local.get $0 - i32.load - i32.const 2 - i32.add global.get $std/array-literal/i - i32.store8 offset=8 - local.get $0 + i32.store8 offset=2 + local.get $1 + call $~lib/rt/pure/__retain global.set $std/array-literal/dynamicArrayI8 global.get $std/array-literal/dynamicArrayI8 - i32.load offset=4 + i32.load offset=12 i32.const 3 i32.ne if i32.const 0 - i32.const 32 - i32.const 21 + i32.const 80 + i32.const 19 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 0 global.get $std/array-literal/dynamicArrayI8 - i32.load - local.tee $0 - i32.load - i32.lt_u - if (result i32) - local.get $0 - i32.load8_s offset=8 - else - unreachable - end - i32.const 255 - i32.and + i32.const 0 + call $~lib/array/Array#__get if i32.const 0 - i32.const 32 - i32.const 22 + i32.const 80 + i32.const 20 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 global.get $std/array-literal/dynamicArrayI8 - i32.load - local.tee $0 - i32.load - i32.lt_u - if (result i32) - local.get $0 - i32.const 1 - i32.add - i32.load8_s offset=8 - else - unreachable - end - i32.const 255 - i32.and + i32.const 1 + call $~lib/array/Array#__get i32.const 1 i32.ne if i32.const 0 - i32.const 32 - i32.const 23 + i32.const 80 + i32.const 21 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 2 global.get $std/array-literal/dynamicArrayI8 - i32.load - local.tee $0 - i32.load - i32.lt_u - if (result i32) - local.get $0 - i32.const 2 - i32.add - i32.load8_s offset=8 - else - unreachable - end - i32.const 255 - i32.and + i32.const 2 + call $~lib/array/Array#__get i32.const 2 i32.ne if i32.const 0 - i32.const 32 - i32.const 24 + i32.const 80 + i32.const 22 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 global.set $std/array-literal/i - call $~lib/array/Array#constructor + i32.const 2 + i32.const 4 + call $~lib/rt/__allocArray + local.tee $1 + i32.load offset=4 local.tee $0 - i32.load global.get $std/array-literal/i - local.tee $1 - i32.store offset=8 - local.get $1 + i32.store + global.get $std/array-literal/i i32.const 1 i32.add global.set $std/array-literal/i local.get $0 - i32.load - i32.const 4 - i32.add global.get $std/array-literal/i - local.tee $1 - i32.store offset=8 - local.get $1 + i32.store offset=4 + global.get $std/array-literal/i i32.const 1 i32.add global.set $std/array-literal/i local.get $0 - i32.load - i32.const 8 - i32.add global.get $std/array-literal/i i32.store offset=8 - local.get $0 + local.get $1 + call $~lib/rt/pure/__retain global.set $std/array-literal/dynamicArrayI32 global.get $std/array-literal/dynamicArrayI32 - i32.load offset=4 + i32.load offset=12 i32.const 3 i32.ne if i32.const 0 - i32.const 32 - i32.const 29 + i32.const 80 + i32.const 27 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 0 global.get $std/array-literal/dynamicArrayI32 - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end + i32.const 0 + call $~lib/array/Array#__get if i32.const 0 - i32.const 32 - i32.const 30 + i32.const 80 + i32.const 28 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 global.get $std/array-literal/dynamicArrayI32 - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else - unreachable - end + i32.const 1 + call $~lib/array/Array#__get i32.const 1 i32.ne if i32.const 0 - i32.const 32 - i32.const 31 + i32.const 80 + i32.const 29 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 2 global.get $std/array-literal/dynamicArrayI32 - i32.load - local.tee $0 - i32.load i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 8 - i32.add - i32.load offset=8 - else - unreachable - end + call $~lib/array/Array#__get i32.const 2 i32.ne if i32.const 0 - i32.const 32 - i32.const 32 + i32.const 80 + i32.const 30 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - call $~lib/array/Array#constructor - local.set $0 - i32.const 0 - call $~lib/allocator/arena/__memory_allocate - local.set $1 + i32.const 2 + i32.const 6 + call $~lib/rt/__allocArray + local.tee $1 + i32.load offset=4 + local.tee $0 + call $std/array-literal/Ref#constructor + local.tee $2 + call $~lib/rt/pure/__retain + i32.store local.get $0 - i32.load - local.get $1 - i32.store offset=8 - i32.const 0 - call $~lib/allocator/arena/__memory_allocate - local.set $1 + call $std/array-literal/Ref#constructor + local.tee $3 + call $~lib/rt/pure/__retain + i32.store offset=4 local.get $0 - i32.load - i32.const 4 - i32.add - local.get $1 + call $std/array-literal/Ref#constructor + local.tee $4 + call $~lib/rt/pure/__retain i32.store offset=8 - i32.const 0 - call $~lib/allocator/arena/__memory_allocate - local.set $1 - local.get $0 - i32.load - i32.const 8 - i32.add local.get $1 - i32.store offset=8 - local.get $0 + call $~lib/rt/pure/__retain global.set $std/array-literal/dynamicArrayRef global.get $std/array-literal/dynamicArrayRef - i32.load offset=4 + i32.load offset=12 i32.const 3 i32.ne if i32.const 0 - i32.const 32 - i32.const 36 + i32.const 80 + i32.const 34 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - call $~lib/array/Array#constructor - local.set $0 - i32.const 0 - call $~lib/allocator/arena/__memory_allocate - local.set $1 + i32.const 2 + i32.const 8 + call $~lib/rt/__allocArray + local.tee $1 + i32.load offset=4 + local.tee $0 + call $std/array-literal/RefWithCtor#constructor + local.tee $5 + call $~lib/rt/pure/__retain + i32.store local.get $0 - i32.load - local.get $1 - i32.store offset=8 - i32.const 0 - call $~lib/allocator/arena/__memory_allocate - local.set $1 + call $std/array-literal/RefWithCtor#constructor + local.tee $6 + call $~lib/rt/pure/__retain + i32.store offset=4 local.get $0 - i32.load - i32.const 4 - i32.add - local.get $1 + call $std/array-literal/RefWithCtor#constructor + local.tee $0 + call $~lib/rt/pure/__retain i32.store offset=8 - i32.const 0 - call $~lib/allocator/arena/__memory_allocate - local.set $1 - local.get $0 - i32.load - i32.const 8 - i32.add local.get $1 - i32.store offset=8 - local.get $0 + call $~lib/rt/pure/__retain global.set $std/array-literal/dynamicArrayRefWithCtor global.get $std/array-literal/dynamicArrayRefWithCtor - i32.load offset=4 + i32.load offset=12 i32.const 3 i32.ne if i32.const 0 - i32.const 32 - i32.const 40 + i32.const 80 + i32.const 38 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + global.get $std/array-literal/emptyArrayI32 + call $~lib/rt/pure/__release + global.get $std/array-literal/dynamicArrayI8 + call $~lib/rt/pure/__release + global.get $std/array-literal/dynamicArrayI32 + call $~lib/rt/pure/__release + global.get $std/array-literal/dynamicArrayRef + call $~lib/rt/pure/__release + global.get $std/array-literal/dynamicArrayRefWithCtor + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $start (; 7 ;) (type $FUNCSIG$v) + (func $start (; 31 ;) (type $FUNCSIG$v) call $start:std/array-literal ) - (func $null (; 8 ;) (type $FUNCSIG$v) + (func $~lib/rt/pure/markGray (; 32 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members + end + ) + (func $~lib/rt/pure/scanBlack (; 33 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 34 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (; 35 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + ) + (func $~lib/rt/pure/__visit (; 36 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + local.get $0 + i32.const 604 + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $0 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + local.get $1 + i32.const 1 + i32.ne + if + local.get $1 + i32.const 2 + i32.eq + br_if $case1|0 + block $tablify|0 + local.get $1 + i32.const 3 + i32.sub + br_table $case2|0 $case3|0 $case4|0 $tablify|0 + end + br $case5|0 + end + local.get $0 + call $~lib/rt/pure/decrement + br $break|0 + end + local.get $0 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 456 + i32.const 75 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $0 + call $~lib/rt/pure/markGray + br $break|0 + end + local.get $0 + call $~lib/rt/pure/scan + br $break|0 + end + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const -268435456 + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne + if + i32.const 0 + i32.const 456 + i32.const 86 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $1 + i32.const 1879048192 + i32.and + if + local.get $0 + call $~lib/rt/pure/scanBlack + end + br $break|0 + end + local.get $0 + call $~lib/rt/pure/collectWhite + br $break|0 + end + i32.const 0 + i32.const 456 + i32.const 97 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/array/Array#__visit_impl (; 37 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + i32.load offset=4 + local.tee $2 + local.get $0 + i32.load offset=12 + i32.const 2 + i32.shl + i32.add + local.set $0 + loop $continue|0 + local.get $2 + local.get $0 + i32.lt_u + if + local.get $2 + i32.load + local.tee $3 + if + local.get $3 + local.get $1 + call $~lib/rt/pure/__visit + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 + end + end + ) + (func $~lib/rt/__visit_members (; 38 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + block $block$4$break + block $switch$1$default + block $switch$1$case$10 + block $switch$1$case$8 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $block$4$break $block$4$break $block$4$break $switch$1$case$2 $switch$1$case$8 $switch$1$case$2 $switch$1$case$10 $switch$1$default + end + return + end + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + br $block$4$break + end + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + br $block$4$break + end + unreachable + end + local.get $0 + i32.load + local.tee $0 + if + local.get $0 + local.get $1 + call $~lib/rt/pure/__visit + end + ) + (func $null (; 39 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/array-literal.ts b/tests/compiler/std/array-literal.ts index 1fdd31d51e..f7ddcb3bb7 100644 --- a/tests/compiler/std/array-literal.ts +++ b/tests/compiler/std/array-literal.ts @@ -1,5 +1,3 @@ -import "allocator/arena"; - const staticArrayI8: i8[] = [0, 1, 2]; assert(staticArrayI8.length == 3); assert(staticArrayI8[0] == 0); @@ -38,3 +36,10 @@ assert(dynamicArrayRef.length == 3); class RefWithCtor { constructor() {} } var dynamicArrayRefWithCtor: RefWithCtor[] = [new RefWithCtor(), new RefWithCtor(), new RefWithCtor()]; assert(dynamicArrayRefWithCtor.length == 3); + +// Unleak globals +__release(changetype(emptyArrayI32)); +__release(changetype(dynamicArrayI8)); +__release(changetype(dynamicArrayI32)); +__release(changetype(dynamicArrayRef)); +__release(changetype(dynamicArrayRefWithCtor)); diff --git a/tests/compiler/std/array-literal.untouched.wat b/tests/compiler/std/array-literal.untouched.wat index d1ccb10ff2..a5bdca6c7e 100644 --- a/tests/compiler/std/array-literal.untouched.wat +++ b/tests/compiler/std/array-literal.untouched.wat @@ -1,946 +1,3371 @@ (module - (type $FUNCSIG$v (func)) + (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) - (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$iiiii (func (param i32 i32 i32 i32) (result i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$vii (func (param i32 i32))) (type $FUNCSIG$viii (func (param i32 i32 i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32))) + (import "rtrace" "onincrement" (func $~lib/rt/rtrace/onincrement (param i32))) + (import "rtrace" "ondecrement" (func $~lib/rt/rtrace/ondecrement (param i32))) + (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) (memory $0 1) - (data (i32.const 8) "\03\00\00\00\00\00\00\00\00\01\02\00\00\00\00\00") - (data (i32.const 24) "\08\00\00\00\03\00\00\00") - (data (i32.const 32) "\14\00\00\00s\00t\00d\00/\00a\00r\00r\00a\00y\00-\00l\00i\00t\00e\00r\00a\00l\00.\00t\00s\00") - (data (i32.const 80) "\0c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 112) "P\00\00\00\03\00\00\00") - (data (i32.const 120) "\00\00\00\00\00\00\00\00") - (data (i32.const 128) "x\00\00\00\00\00\00\00") - (data (i32.const 136) "\0d\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") - (data (i32.const 168) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") + (data (i32.const 8) "\03\00\00\00\01\00\00\00\00\00\00\00\03\00\00\00\00\01\02") + (data (i32.const 32) "\10\00\00\00\01\00\00\00\03\00\00\00\10\00\00\00\18\00\00\00\18\00\00\00\03\00\00\00\03\00\00\00") + (data (i32.const 64) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00s\00t\00d\00/\00a\00r\00r\00a\00y\00-\00l\00i\00t\00e\00r\00a\00l\00.\00t\00s\00") + (data (i32.const 120) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 176) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") + (data (i32.const 224) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00") + (data (i32.const 256) "\10\00\00\00\01\00\00\00\04\00\00\00\10\00\00\00\f0\00\00\00\f0\00\00\00\0c\00\00\00\03\00\00\00") + (data (i32.const 288) "\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 304) "\10\00\00\00\01\00\00\00\04\00\00\00\10\00\00\000\01\00\000\01\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 336) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 384) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 440) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s\00") + (data (i32.const 488) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s\00") + (data (i32.const 528) "\t\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\003\04\00\00\02\00\00\00\93\04\00\00\02\00\00\00\10\00\00\00\00\00\00\00\93 \00\00\02\00\00\00\10\00\00\00\00\00\00\00\93 \00\00\02\00\00\00") (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) - (global $std/array-literal/staticArrayI8 i32 (i32.const 24)) - (global $std/array-literal/staticArrayI32 i32 (i32.const 112)) - (global $std/array-literal/emptyArrayI32 (mut i32) (i32.const 128)) + (global $std/array-literal/staticArrayI8 i32 (i32.const 48)) + (global $std/array-literal/staticArrayI32 i32 (i32.const 272)) + (global $std/array-literal/emptyArrayI32 (mut i32) (i32.const 320)) (global $std/array-literal/i (mut i32) (i32.const 0)) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) (global $std/array-literal/dynamicArrayI8 (mut i32) (i32.const 0)) (global $std/array-literal/dynamicArrayI32 (mut i32) (i32.const 0)) (global $std/array-literal/dynamicArrayRef (mut i32) (i32.const 0)) (global $std/array-literal/dynamicArrayRefWithCtor (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 228)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) + (global $~lib/rt/__rtti_base i32 (i32.const 528)) + (global $~lib/heap/__heap_base i32 (i32.const 604)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) - (func $start:~lib/allocator/arena (; 1 ;) (type $FUNCSIG$v) - global.get $~lib/memory/HEAP_BASE - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset + (func $~lib/array/Array#get:length (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=12 ) - (func $~lib/array/Array#__get (; 2 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) + (func $~lib/array/Array#__unchecked_get (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 - i32.load - local.set $2 + i32.load offset=4 local.get $1 - local.get $2 - i32.load + i32.const 0 + i32.shl + i32.add + i32.load8_s + ) + (func $~lib/array/Array#__get (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 + local.get $0 + i32.load offset=8 i32.const 0 i32.shr_u - i32.lt_u - if (result i32) - local.get $2 - local.set $3 - local.get $1 - local.set $4 - i32.const 0 - local.set $5 - local.get $3 - local.get $4 - i32.const 0 - i32.shl - i32.add - local.get $5 - i32.add - i32.load8_s offset=8 - else + i32.ge_u + if + i32.const 136 + i32.const 192 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort unreachable end + local.get $0 + local.get $1 + call $~lib/array/Array#__unchecked_get ) - (func $~lib/array/Array#__get (; 3 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) + (func $~lib/array/Array#get:length (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - i32.load - local.set $2 + i32.load offset=12 + ) + (func $~lib/array/Array#__unchecked_get (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.load offset=4 local.get $1 - local.get $2 + i32.const 2 + i32.shl + i32.add i32.load + ) + (func $~lib/array/Array#__get (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 + local.get $0 + i32.load offset=8 i32.const 2 i32.shr_u - i32.lt_u - if (result i32) - local.get $2 - local.set $3 - local.get $1 - local.set $4 - i32.const 0 - local.set $5 - local.get $3 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $5 - i32.add - i32.load offset=8 - else + i32.ge_u + if + i32.const 136 + i32.const 192 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort unreachable end - ) - (func $~lib/internal/arraybuffer/computeSize (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 1 - i32.const 32 local.get $0 - i32.const 8 - i32.add - i32.const 1 - i32.sub - i32.clz - i32.sub - i32.shl + local.get $1 + call $~lib/array/Array#__unchecked_get ) - (func $~lib/allocator/arena/__memory_allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/rt/tlsf/removeBlock (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - local.get $0 - i32.const 1073741824 - i32.gt_u + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz if + i32.const 0 + i32.const 352 + i32.const 276 + i32.const 13 + call $~lib/builtins/abort unreachable end - global.get $~lib/allocator/arena/offset - local.set $1 - local.get $1 - local.get $0 - local.tee $2 - i32.const 1 - local.tee $3 local.get $2 - local.get $3 - i32.gt_u - select - i32.add - i32.const 7 - i32.add - i32.const 7 + i32.const 3 i32.const -1 i32.xor i32.and - local.set $4 - current_memory - local.set $5 - local.get $4 - local.get $5 + local.set $3 + local.get $3 i32.const 16 - i32.shl - i32.gt_u + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 352 + i32.const 278 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 local.get $4 - local.get $1 + i32.const 4 i32.sub - i32.const 65535 - i32.add - i32.const 65535 - i32.const -1 - i32.xor - i32.and - i32.const 16 i32.shr_u - local.set $2 + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) local.get $5 - local.tee $3 - local.get $2 - local.tee $6 - local.get $3 - local.get $6 - i32.gt_s - select - local.set $3 - local.get $3 - grow_memory + i32.const 16 + i32.lt_u + else i32.const 0 - i32.lt_s - if - local.get $2 - grow_memory - i32.const 0 - i32.lt_s - if - unreachable - end - end end - local.get $4 - global.set $~lib/allocator/arena/offset - local.get $1 - ) - (func $~lib/internal/arraybuffer/allocateUnsafe (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - local.get $0 - i32.const 1073741816 - i32.le_u i32.eqz if i32.const 0 - i32.const 168 - i32.const 26 - i32.const 2 - call $~lib/env/abort + i32.const 352 + i32.const 291 + i32.const 13 + call $~lib/builtins/abort unreachable end - block $~lib/memory/memory.allocate|inlined.0 (result i32) - local.get $0 - call $~lib/internal/arraybuffer/computeSize - local.set $2 - local.get $2 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.0 - end - local.set $1 local.get $1 - local.get $0 - i32.store + i32.load offset=16 + local.set $6 local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end + local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $9 + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $8 + local.get $4 + local.set $11 + local.get $9 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $9 + local.set $10 + local.get $8 + local.get $11 + i32.const 2 + i32.shl + i32.add + local.get $10 + i32.store offset=4 + end + local.get $9 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end ) - (func $~lib/memory/memory.allocate (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - call $~lib/allocator/arena/__memory_allocate - return - ) - (func $~lib/internal/memory/memset (; 8 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/insertBlock (; 12 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i64) - local.get $2 + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 i32.eqz if - return + i32.const 0 + i32.const 352 + i32.const 204 + i32.const 13 + call $~lib/builtins/abort + unreachable end - local.get $0 local.get $1 - i32.store8 - local.get $0 + i32.load + local.set $2 local.get $2 - i32.add i32.const 1 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 2 - i32.le_u + i32.and + i32.eqz if - return + i32.const 0 + i32.const 352 + i32.const 206 + i32.const 13 + call $~lib/builtins/abort + unreachable end - local.get $0 + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 i32.const 1 - i32.add - local.get $1 - i32.store8 - local.get $0 - i32.const 2 - i32.add - local.get $1 - i32.store8 - local.get $0 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end local.get $2 - i32.add i32.const 2 - i32.sub - local.get $1 - i32.store8 - local.get $0 + i32.and + if + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 4 + i32.sub + i32.load + end + local.set $6 + local.get $6 + i32.load + local.set $3 + local.get $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 352 + i32.const 227 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $6 + call $~lib/rt/tlsf/removeBlock + local.get $6 + local.get $3 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $6 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store local.get $2 - i32.add i32.const 3 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 6 - i32.le_u + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz if - return + i32.const 0 + i32.const 352 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable end - local.get $0 - i32.const 3 - i32.add local.get $1 - i32.store8 - local.get $0 - local.get $2 + i32.const 16 + i32.add + local.get $8 i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 352 + i32.const 243 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 i32.const 4 i32.sub local.get $1 - i32.store8 - local.get $2 - i32.const 8 - i32.le_u + i32.store + local.get $8 + i32.const 256 + i32.lt_u if - return + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 352 + i32.const 259 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $7 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $7 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 end + local.set $11 + local.get $1 i32.const 0 - local.get $0 - i32.sub - i32.const 3 - i32.and - local.set $3 - local.get $0 - local.get $3 - i32.add - local.set $0 - local.get $2 - local.get $3 - i32.sub - local.set $2 - local.get $2 - i32.const -4 - i32.and - local.set $2 - i32.const -1 - i32.const 255 - i32.div_u + i32.store offset=16 local.get $1 - i32.const 255 - i32.and - i32.mul - local.set $4 - local.get $0 - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 4 - i32.sub - local.get $4 - i32.store - local.get $2 - i32.const 8 - i32.le_u + local.get $11 + i32.store offset=20 + local.get $11 if - return + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $0 + local.set $12 + local.get $9 + local.set $7 + local.get $10 + local.set $3 + local.get $1 + local.set $6 + local.get $12 + local.get $7 + i32.const 4 + i32.shl + local.get $3 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 end local.get $0 - i32.const 4 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 12 - i32.sub - local.get $4 - i32.store local.get $0 - local.get $2 - i32.add - i32.const 8 - i32.sub - local.get $4 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or i32.store + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $0 + local.set $13 + local.get $9 + local.set $12 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + end + ) + (func $~lib/rt/tlsf/addMemory (; 13 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 local.get $2 - i32.const 24 i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz if - return + i32.const 0 + i32.const 352 + i32.const 385 + i32.const 4 + call $~lib/builtins/abort + unreachable end - local.get $0 - i32.const 12 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 16 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 20 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 24 - i32.add - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 28 - i32.sub + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 local.get $4 - i32.store - local.get $0 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 352 + i32.const 395 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 352 + i32.const 407 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end local.get $2 - i32.add - i32.const 24 + local.get $1 i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 20 + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul i32.sub - local.get $4 + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or i32.store - local.get $0 - local.get $2 + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 i32.add i32.const 16 i32.sub + local.set $4 local.get $4 + i32.const 0 + i32.const 2 + i32.or i32.store - i32.const 24 + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end local.get $0 - i32.const 4 - i32.and + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 14 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/heap/__heap_base + i32.const 15 i32.add - local.set $3 + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + memory.size + local.set $1 local.get $0 - local.get $3 + i32.const 1572 i32.add - local.set $0 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $2 local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 local.get $3 - i32.sub - local.set $2 - local.get $4 - i64.extend_i32_u - local.get $4 - i64.extend_i32_u - i64.const 32 - i64.shl - i64.or - local.set $5 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end block $break|0 - loop $continue|0 - local.get $2 - i32.const 32 - i32.ge_u - if - block - local.get $0 - local.get $5 - i64.store - local.get $0 - i32.const 8 - i32.add - local.get $5 - i64.store - local.get $0 + i32.const 0 + local.set $5 + loop $repeat|0 + local.get $5 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $3 + local.set $7 + local.get $5 + local.set $6 + i32.const 0 + local.set $4 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $7 + loop $repeat|1 + local.get $7 i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $3 + local.set $9 + local.get $5 + local.set $8 + local.get $7 + local.set $6 + i32.const 0 + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store offset=96 + end + local.get $7 + i32.const 1 i32.add - local.get $5 - i64.store - local.get $0 - i32.const 24 - i32.add - local.get $5 - i64.store - local.get $2 - i32.const 32 - i32.sub - local.set $2 - local.get $0 - i32.const 32 - i32.add - local.set $0 + local.set $7 + br $repeat|1 + unreachable end - br $continue|0 + unreachable end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 15 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 400 + i32.const 352 + i32.const 447 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 16 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 352 + i32.const 337 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + i32.const 0 + local.set $7 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $5 + local.get $5 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $5 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $4 + local.get $8 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 352 + i32.const 350 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 17 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + memory.size + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + memory.grow + i32.const 0 + i32.lt_s + if + local.get $3 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + memory.size + local.set $7 + local.get $0 + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (; 18 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 352 + i32.const 364 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 19 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 352 + i32.const 477 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 352 + i32.const 479 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + call $~lib/rt/rtrace/onalloc + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 20 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/rt/pure/increment (; 21 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 456 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/rtrace/onincrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 456 + i32.const 107 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/pure/__retain (; 22 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment + end + local.get $0 + ) + (func $~lib/util/memory/memcpy (; 23 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + block $break|0 + loop $continue|0 + local.get $2 + if (result i32) + local.get $1 + i32.const 3 + i32.and + else + i32.const 0 + end + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $continue|0 + end + end + end + local.get $0 + i32.const 3 + i32.and + i32.const 0 + i32.eq + if + block $break|1 + loop $continue|1 + local.get $2 + i32.const 16 + i32.ge_u + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 8 + i32.add + i32.load + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 12 + i32.add + i32.load + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|1 + end + end + end + local.get $2 + i32.const 8 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + end + local.get $2 + i32.const 4 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.set $0 + local.get $1 + i32.const 4 + i32.add + local.set $1 + end + local.get $2 + i32.const 2 + i32.and + if + local.get $0 + local.get $1 + i32.load16_u + i32.store16 + local.get $0 + i32.const 2 + i32.add + local.set $0 + local.get $1 + i32.const 2 + i32.add + local.set $1 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + return + end + local.get $2 + i32.const 32 + i32.ge_u + if + block $break|2 + block $case2|2 + block $case1|2 + block $case0|2 + local.get $0 + i32.const 3 + i32.and + local.set $5 + local.get $5 + i32.const 1 + i32.eq + br_if $case0|2 + local.get $5 + i32.const 2 + i32.eq + br_if $case1|2 + local.get $5 + i32.const 3 + i32.eq + br_if $case2|2 + br $break|2 + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 3 + i32.sub + local.set $2 + block $break|3 + loop $continue|3 + local.get $2 + i32.const 17 + i32.ge_u + if + local.get $1 + i32.const 1 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 5 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 9 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 13 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|3 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + block $break|4 + loop $continue|4 + local.get $2 + i32.const 18 + i32.ge_u + if + local.get $1 + i32.const 2 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 6 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 10 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 14 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|4 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + block $break|5 + loop $continue|5 + local.get $2 + i32.const 19 + i32.ge_u + if + local.get $1 + i32.const 3 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 7 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 11 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 15 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|5 + end + end + end + br $break|2 + unreachable + end + unreachable + end + end + local.get $2 + i32.const 16 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 8 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 4 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 2 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 end ) - (func $~lib/array/Array#constructor (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) + (func $~lib/memory/memory.copy (; 24 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - local.get $1 - i32.const 1073741816 - i32.gt_u - if - i32.const 0 - i32.const 136 - i32.const 45 - i32.const 39 - call $~lib/env/abort - unreachable - end - local.get $1 - i32.const 0 - i32.shl - local.set $2 - local.get $2 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $3 - block (result i32) + block $~lib/util/memory/memmove|inlined.0 local.get $0 - i32.eqz + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq if - i32.const 8 - call $~lib/memory/memory.allocate - local.set $0 + br $~lib/util/memory/memmove|inlined.0 end - local.get $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - end - local.get $3 - i32.store - local.get $0 - local.get $1 - i32.store offset=4 - block $~lib/memory/memory.fill|inlined.0 + local.get $4 local.get $3 - i32.const 8 i32.add - local.set $4 - i32.const 0 - local.set $5 - local.get $2 - local.set $6 - local.get $4 local.get $5 - local.get $6 - call $~lib/internal/memory/memset + i32.le_u + if (result i32) + i32.const 1 + else + local.get $5 + local.get $3 + i32.add + local.get $4 + i32.le_u + end + if + local.get $5 + local.get $4 + local.get $3 + call $~lib/util/memory/memcpy + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end end - local.get $0 ) - (func $~lib/array/Array#__unchecked_set (; 10 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) + (func $~lib/rt/__allocArray (; 25 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) + i32.const 16 + local.get $2 + call $~lib/rt/tlsf/__alloc + local.set $4 local.get $0 - i32.load - local.set $3 local.get $1 - local.set $4 - local.get $2 + i32.shl local.set $5 + local.get $5 i32.const 0 + call $~lib/rt/tlsf/__alloc local.set $6 - local.get $3 local.get $4 - i32.const 0 - i32.shl - i32.add local.get $6 - i32.add + call $~lib/rt/pure/__retain + i32.store + local.get $4 + local.get $6 + i32.store offset=4 + local.get $4 local.get $5 - i32.store8 offset=8 - ) - (func $~lib/array/Array#constructor (; 11 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $1 - i32.const 268435454 - i32.gt_u + i32.store offset=8 + local.get $4 + local.get $0 + i32.store offset=12 + local.get $3 if - i32.const 0 - i32.const 136 - i32.const 45 - i32.const 39 - call $~lib/env/abort - unreachable - end - local.get $1 - i32.const 2 - i32.shl - local.set $2 - local.get $2 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $3 - block (result i32) - local.get $0 - i32.eqz - if - i32.const 8 - call $~lib/memory/memory.allocate - local.set $0 - end - local.get $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 + local.get $6 + local.get $3 + local.get $5 + call $~lib/memory/memory.copy end - local.get $3 - i32.store + local.get $4 + ) + (func $std/array-literal/Ref#constructor (; 26 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - local.get $1 - i32.store offset=4 - block $~lib/memory/memory.fill|inlined.1 - local.get $3 - i32.const 8 - i32.add - local.set $4 + i32.eqz + if i32.const 0 - local.set $5 - local.get $2 - local.set $6 - local.get $4 - local.get $5 - local.get $6 - call $~lib/internal/memory/memset + i32.const 5 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $0 end local.get $0 ) - (func $~lib/array/Array#__unchecked_set (; 12 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) + (func $~lib/array/Array#get:length (; 27 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - i32.load - local.set $3 - local.get $1 - local.set $4 - local.get $2 - local.set $5 - i32.const 0 - local.set $6 - local.get $3 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $6 - i32.add - local.get $5 - i32.store offset=8 + i32.load offset=12 ) - (func $std/array-literal/Ref#constructor (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $std/array-literal/RefWithCtor#constructor (; 28 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.eqz if i32.const 0 - call $~lib/memory/memory.allocate + i32.const 7 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.set $0 end local.get $0 ) - (func $~lib/array/Array#constructor (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#get:length (; 29 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=12 + ) + (func $~lib/rt/tlsf/freeBlock (; 30 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) local.get $1 - i32.const 268435454 - i32.gt_u + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 - i32.const 45 - i32.const 39 - call $~lib/env/abort + i32.const 352 + i32.const 531 + i32.const 2 + call $~lib/builtins/abort unreachable end local.get $1 - i32.const 2 - i32.shl - local.set $2 local.get $2 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $3 - block (result i32) - local.get $0 - i32.eqz - if - i32.const 8 - call $~lib/memory/memory.allocate - local.set $0 - end - local.get $0 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/rtrace/onfree + ) + (func $~lib/rt/__typeinfo (; 31 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/rt/__rtti_base + local.set $1 + local.get $0 + local.get $1 + i32.load + i32.gt_u + if + i32.const 136 + i32.const 504 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 4 + i32.add + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/rt/tlsf/__free (; 32 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if i32.const 0 - i32.store + i32.const 352 + i32.const 561 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + i32.ne + if (result i32) local.get $0 + i32.const 15 + i32.and + i32.eqz + else i32.const 0 - i32.store offset=4 - local.get $0 end - local.get $3 - i32.store - local.get $0 - local.get $1 - i32.store offset=4 - block $~lib/memory/memory.fill|inlined.2 - local.get $3 - i32.const 8 - i32.add - local.set $4 + i32.eqz + if i32.const 0 - local.set $5 - local.get $2 - local.set $6 - local.get $4 - local.get $5 - local.get $6 - call $~lib/internal/memory/memset + i32.const 352 + i32.const 562 + i32.const 2 + call $~lib/builtins/abort + unreachable end + global.get $~lib/rt/tlsf/ROOT local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock ) - (func $~lib/array/Array#__unchecked_set (; 15 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/pure/growRoots (; 33 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) + global.get $~lib/rt/pure/ROOTS + local.set $0 + global.get $~lib/rt/pure/CUR local.get $0 - i32.load - local.set $3 + i32.sub + local.set $1 local.get $1 - local.set $4 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 local.get $2 - local.set $5 - i32.const 0 - local.set $6 local.get $3 + i32.gt_u + select + local.set $4 local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $6 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onfree + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $0 + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onalloc + local.get $0 + call $~lib/rt/tlsf/__free + end + local.get $5 + global.set $~lib/rt/pure/ROOTS + local.get $5 + local.get $1 i32.add + global.set $~lib/rt/pure/CUR local.get $5 - i32.store offset=8 + local.get $4 + i32.add + global.set $~lib/rt/pure/END ) - (func $std/array-literal/RefWithCtor#constructor (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.eqz + (func $~lib/rt/pure/appendRoot (; 34 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/pure/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/pure/END + i32.ge_u if - i32.const 0 - call $~lib/memory/memory.allocate - local.set $0 + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 end + local.get $1 local.get $0 + i32.store + local.get $1 + i32.const 4 + i32.add + global.set $~lib/rt/pure/CUR ) - (func $~lib/array/Array#constructor (; 17 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/rt/pure/decrement (; 35 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) + local.get $0 + i32.load offset=4 + local.set $1 local.get $1 - i32.const 268435454 - i32.gt_u + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + call $~lib/rt/rtrace/ondecrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz if i32.const 0 - i32.const 136 - i32.const 45 - i32.const 39 - call $~lib/env/abort + i32.const 456 + i32.const 115 + i32.const 13 + call $~lib/builtins/abort unreachable end - local.get $1 - i32.const 2 - i32.shl - local.set $2 local.get $2 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $3 - block (result i32) + i32.const 1 + i32.eq + if local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/rt/__visit_members + local.get $1 + i32.const -2147483648 + i32.and i32.eqz if - i32.const 8 - call $~lib/memory/memory.allocate - local.set $0 + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 end - local.get $0 - i32.const 0 - i32.store - local.get $0 + else + local.get $2 i32.const 0 - i32.store offset=4 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 456 + i32.const 124 + i32.const 15 + call $~lib/builtins/abort + unreachable + end local.get $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 16 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end end - local.get $3 - i32.store - local.get $0 - local.get $1 - i32.store offset=4 - block $~lib/memory/memory.fill|inlined.3 - local.get $3 - i32.const 8 - i32.add - local.set $4 - i32.const 0 - local.set $5 - local.get $2 - local.set $6 - local.get $4 - local.get $5 - local.get $6 - call $~lib/internal/memory/memset - end - local.get $0 ) - (func $~lib/array/Array#__unchecked_set (; 18 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) + (func $~lib/rt/pure/__release (; 36 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 - i32.load - local.set $3 - local.get $1 - local.set $4 - local.get $2 - local.set $5 - i32.const 0 - local.set $6 - local.get $3 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $6 - i32.add - local.get $5 - i32.store offset=8 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + end ) - (func $start:std/array-literal (; 19 ;) (type $FUNCSIG$v) + (func $start:std/array-literal (; 37 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - call $start:~lib/allocator/arena - block $~lib/array/Array#get:length|inlined.0 (result i32) - global.get $std/array-literal/staticArrayI8 - local.set $0 - local.get $0 - i32.load offset=4 - end + (local $5 i32) + (local $6 i32) + (local $7 i32) + global.get $std/array-literal/staticArrayI8 + call $~lib/array/Array#get:length i32.const 3 i32.eq i32.eqz if i32.const 0 - i32.const 32 - i32.const 4 + i32.const 80 + i32.const 2 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/array-literal/staticArrayI8 i32.const 0 call $~lib/array/Array#__get - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s i32.const 0 i32.eq i32.eqz if i32.const 0 - i32.const 32 - i32.const 5 + i32.const 80 + i32.const 3 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/array-literal/staticArrayI8 i32.const 1 call $~lib/array/Array#__get - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s i32.const 1 i32.eq i32.eqz if i32.const 0 - i32.const 32 - i32.const 6 + i32.const 80 + i32.const 4 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/array-literal/staticArrayI8 i32.const 2 call $~lib/array/Array#__get - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s i32.const 2 i32.eq i32.eqz if i32.const 0 - i32.const 32 - i32.const 7 + i32.const 80 + i32.const 5 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/array/Array#get:length|inlined.0 (result i32) - global.get $std/array-literal/staticArrayI32 - local.set $0 - local.get $0 - i32.load offset=4 - end + global.get $std/array-literal/staticArrayI32 + call $~lib/array/Array#get:length i32.const 3 i32.eq i32.eqz if i32.const 0 - i32.const 32 - i32.const 10 + i32.const 80 + i32.const 8 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/array-literal/staticArrayI32 @@ -951,10 +3376,10 @@ i32.eqz if i32.const 0 - i32.const 32 - i32.const 11 + i32.const 80 + i32.const 9 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/array-literal/staticArrayI32 @@ -965,10 +3390,10 @@ i32.eqz if i32.const 0 - i32.const 32 - i32.const 12 + i32.const 80 + i32.const 10 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/array-literal/staticArrayI32 @@ -979,40 +3404,39 @@ i32.eqz if i32.const 0 - i32.const 32 - i32.const 13 + i32.const 80 + i32.const 11 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/array/Array#get:length|inlined.1 (result i32) - global.get $std/array-literal/emptyArrayI32 - local.set $0 - local.get $0 - i32.load offset=4 - end + global.get $std/array-literal/emptyArrayI32 + call $~lib/array/Array#get:length i32.const 0 i32.eq i32.eqz if i32.const 0 - i32.const 32 - i32.const 16 + i32.const 80 + i32.const 14 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block (result i32) + i32.const 3 i32.const 0 i32.const 3 - call $~lib/array/Array#constructor + i32.const 0 + call $~lib/rt/__allocArray local.set $1 local.get $1 - i32.const 0 + i32.load offset=4 + local.set $0 + local.get $0 global.get $std/array-literal/i - call $~lib/array/Array#__unchecked_set - local.get $1 - i32.const 1 + i32.store8 + local.get $0 block (result i32) global.get $std/array-literal/i i32.const 1 @@ -1020,9 +3444,8 @@ global.set $std/array-literal/i global.get $std/array-literal/i end - call $~lib/array/Array#__unchecked_set - local.get $1 - i32.const 2 + i32.store8 offset=1 + local.get $0 block (result i32) global.get $std/array-literal/i i32.const 1 @@ -1030,94 +3453,82 @@ global.set $std/array-literal/i global.get $std/array-literal/i end - call $~lib/array/Array#__unchecked_set + i32.store8 offset=2 local.get $1 end + call $~lib/rt/pure/__retain global.set $std/array-literal/dynamicArrayI8 - block $~lib/array/Array#get:length|inlined.1 (result i32) - global.get $std/array-literal/dynamicArrayI8 - local.set $1 - local.get $1 - i32.load offset=4 - end + global.get $std/array-literal/dynamicArrayI8 + call $~lib/array/Array#get:length i32.const 3 i32.eq i32.eqz if i32.const 0 - i32.const 32 - i32.const 21 + i32.const 80 + i32.const 19 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/array-literal/dynamicArrayI8 i32.const 0 call $~lib/array/Array#__get - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s i32.const 0 i32.eq i32.eqz if i32.const 0 - i32.const 32 - i32.const 22 + i32.const 80 + i32.const 20 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/array-literal/dynamicArrayI8 i32.const 1 call $~lib/array/Array#__get - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s i32.const 1 i32.eq i32.eqz if i32.const 0 - i32.const 32 - i32.const 23 + i32.const 80 + i32.const 21 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/array-literal/dynamicArrayI8 i32.const 2 call $~lib/array/Array#__get - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s i32.const 2 i32.eq i32.eqz if i32.const 0 - i32.const 32 - i32.const 24 + i32.const 80 + i32.const 22 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 global.set $std/array-literal/i block (result i32) - i32.const 0 i32.const 3 - call $~lib/array/Array#constructor - local.set $2 - local.get $2 + i32.const 2 + i32.const 4 i32.const 0 + call $~lib/rt/__allocArray + local.set $0 + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 global.get $std/array-literal/i - call $~lib/array/Array#__unchecked_set - local.get $2 - i32.const 1 + i32.store + local.get $1 block (result i32) global.get $std/array-literal/i i32.const 1 @@ -1125,9 +3536,8 @@ global.set $std/array-literal/i global.get $std/array-literal/i end - call $~lib/array/Array#__unchecked_set - local.get $2 - i32.const 2 + i32.store offset=4 + local.get $1 block (result i32) global.get $std/array-literal/i i32.const 1 @@ -1135,25 +3545,22 @@ global.set $std/array-literal/i global.get $std/array-literal/i end - call $~lib/array/Array#__unchecked_set - local.get $2 + i32.store offset=8 + local.get $0 end + call $~lib/rt/pure/__retain global.set $std/array-literal/dynamicArrayI32 - block $~lib/array/Array#get:length|inlined.2 (result i32) - global.get $std/array-literal/dynamicArrayI32 - local.set $2 - local.get $2 - i32.load offset=4 - end + global.get $std/array-literal/dynamicArrayI32 + call $~lib/array/Array#get:length i32.const 3 i32.eq i32.eqz if i32.const 0 - i32.const 32 - i32.const 29 + i32.const 80 + i32.const 27 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/array-literal/dynamicArrayI32 @@ -1164,10 +3571,10 @@ i32.eqz if i32.const 0 - i32.const 32 - i32.const 30 + i32.const 80 + i32.const 28 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/array-literal/dynamicArrayI32 @@ -1178,10 +3585,10 @@ i32.eqz if i32.const 0 - i32.const 32 - i32.const 31 + i32.const 80 + i32.const 29 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/array-literal/dynamicArrayI32 @@ -1192,96 +3599,615 @@ i32.eqz if i32.const 0 - i32.const 32 - i32.const 32 + i32.const 80 + i32.const 30 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block (result i32) - i32.const 0 i32.const 3 - call $~lib/array/Array#constructor - local.set $3 - local.get $3 + i32.const 2 + i32.const 6 i32.const 0 + call $~lib/rt/__allocArray + local.set $1 + local.get $1 + i32.load offset=4 + local.set $0 + local.get $0 i32.const 0 call $std/array-literal/Ref#constructor - call $~lib/array/Array#__unchecked_set - local.get $3 - i32.const 1 + local.tee $2 + call $~lib/rt/pure/__retain + i32.store + local.get $0 i32.const 0 call $std/array-literal/Ref#constructor - call $~lib/array/Array#__unchecked_set - local.get $3 - i32.const 2 + local.tee $3 + call $~lib/rt/pure/__retain + i32.store offset=4 + local.get $0 i32.const 0 call $std/array-literal/Ref#constructor - call $~lib/array/Array#__unchecked_set - local.get $3 + local.tee $4 + call $~lib/rt/pure/__retain + i32.store offset=8 + local.get $1 end + call $~lib/rt/pure/__retain global.set $std/array-literal/dynamicArrayRef - block $~lib/array/Array#get:length|inlined.0 (result i32) - global.get $std/array-literal/dynamicArrayRef - local.set $3 - local.get $3 - i32.load offset=4 - end + global.get $std/array-literal/dynamicArrayRef + call $~lib/array/Array#get:length i32.const 3 i32.eq i32.eqz if i32.const 0 - i32.const 32 - i32.const 36 + i32.const 80 + i32.const 34 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block (result i32) - i32.const 0 i32.const 3 - call $~lib/array/Array#constructor - local.set $4 - local.get $4 + i32.const 2 + i32.const 8 i32.const 0 + call $~lib/rt/__allocArray + local.set $0 + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 i32.const 0 call $std/array-literal/RefWithCtor#constructor - call $~lib/array/Array#__unchecked_set - local.get $4 - i32.const 1 + local.tee $5 + call $~lib/rt/pure/__retain + i32.store + local.get $1 i32.const 0 call $std/array-literal/RefWithCtor#constructor - call $~lib/array/Array#__unchecked_set - local.get $4 - i32.const 2 + local.tee $6 + call $~lib/rt/pure/__retain + i32.store offset=4 + local.get $1 i32.const 0 call $std/array-literal/RefWithCtor#constructor - call $~lib/array/Array#__unchecked_set - local.get $4 + local.tee $7 + call $~lib/rt/pure/__retain + i32.store offset=8 + local.get $0 end + call $~lib/rt/pure/__retain global.set $std/array-literal/dynamicArrayRefWithCtor - block $~lib/array/Array#get:length|inlined.0 (result i32) - global.get $std/array-literal/dynamicArrayRefWithCtor - local.set $4 - local.get $4 - i32.load offset=4 - end + global.get $std/array-literal/dynamicArrayRefWithCtor + call $~lib/array/Array#get:length i32.const 3 i32.eq i32.eqz if i32.const 0 - i32.const 32 - i32.const 40 + i32.const 80 + i32.const 38 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + global.get $std/array-literal/emptyArrayI32 + call $~lib/rt/pure/__release + global.get $std/array-literal/dynamicArrayI8 + call $~lib/rt/pure/__release + global.get $std/array-literal/dynamicArrayI32 + call $~lib/rt/pure/__release + global.get $std/array-literal/dynamicArrayRef + call $~lib/rt/pure/__release + global.get $std/array-literal/dynamicArrayRefWithCtor + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release ) - (func $start (; 20 ;) (type $FUNCSIG$v) + (func $start (; 38 ;) (type $FUNCSIG$v) call $start:std/array-literal ) - (func $null (; 21 ;) (type $FUNCSIG$v) + (func $~lib/array/Array#__visit_impl (; 39 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/array/Array#__visit_impl (; 40 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/rt/pure/markGray (; 41 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members + end + ) + (func $~lib/rt/pure/scanBlack (; 42 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 43 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (; 44 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + ) + (func $~lib/rt/pure/__visit (; 45 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/pure/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 456 + i32.const 75 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/pure/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 456 + i32.const 86 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/pure/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 456 + i32.const 97 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + end + ) + (func $~lib/array/Array#__visit_impl (; 46 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=4 + local.set $2 + local.get $2 + local.get $0 + i32.load offset=12 + i32.const 2 + i32.shl + i32.add + local.set $3 + block $break|0 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_u + if + local.get $2 + i32.load + local.set $4 + local.get $4 + if + local.get $4 + local.get $1 + call $~lib/rt/pure/__visit + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 + end + end + end + ) + (func $~lib/array/Array#__visit_impl (; 47 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=4 + local.set $2 + local.get $2 + local.get $0 + i32.load offset=12 + i32.const 2 + i32.shl + i32.add + local.set $3 + block $break|0 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_u + if + local.get $2 + i32.load + local.set $4 + local.get $4 + if + local.get $4 + local.get $1 + call $~lib/rt/pure/__visit + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 + end + end + end + ) + (func $~lib/rt/__visit_members (; 48 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block $block$4$break + block + end + block $switch$1$leave + block $switch$1$default + block $switch$1$case$10 + block $switch$1$case$8 + block $switch$1$case$6 + block $switch$1$case$5 + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$case$5 $switch$1$case$6 $switch$1$case$2 $switch$1$case$8 $switch$1$case$2 $switch$1$case$10 $switch$1$default + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + br $block$4$break + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$4$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$4$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$4$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$4$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + end + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + ) + (func $null (; 49 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/std/array.json b/tests/compiler/std/array.json new file mode 100644 index 0000000000..59c251c705 --- /dev/null +++ b/tests/compiler/std/array.json @@ -0,0 +1,7 @@ +{ + "asc_flags": [ + "--runtime half", + "--explicitStart", + "--use ASC_RTRACE=1" + ] +} \ No newline at end of file diff --git a/tests/compiler/std/array.optimized.wat b/tests/compiler/std/array.optimized.wat index abb65df0f0..9645a322d3 100644 --- a/tests/compiler/std/array.optimized.wat +++ b/tests/compiler/std/array.optimized.wat @@ -1,20 +1,23 @@ (module - (type $FUNCSIG$v (func)) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$vii (func (param i32 i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$viii (func (param i32 i32 i32))) - (type $FUNCSIG$iiiii (func (param i32 i32 i32 i32) (result i32))) - (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$vi (func (param i32))) - (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$iiiii (func (param i32 i32 i32 i32) (result i32))) (type $FUNCSIG$fiii (func (param i32 i32 i32) (result f32))) + (type $FUNCSIG$fii (func (param i32 i32) (result f32))) (type $FUNCSIG$d (func (result f64))) (type $FUNCSIG$vj (func (param i64))) + (type $FUNCSIG$jj (func (param i64) (result i64))) (type $FUNCSIG$iff (func (param f32 f32) (result i32))) + (type $FUNCSIG$if (func (param f32) (result i32))) (type $FUNCSIG$idd (func (param f64 f64) (result i32))) + (type $FUNCSIG$dii (func (param i32 i32) (result f64))) (type $FUNCSIG$id (func (param f64) (result i32))) - (type $FUNCSIG$viiiii (func (param i32 i32 i32 i32 i32))) (type $FUNCSIG$iid (func (param i32 f64) (result i32))) (type $FUNCSIG$iijijiji (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) (type $FUNCSIG$iiid (func (param i32 i32 f64) (result i32))) @@ -22,2422 +25,2191 @@ (type $FUNCSIG$viji (func (param i32 i64 i32))) (type $FUNCSIG$iiij (func (param i32 i32 i64) (result i32))) (type $FUNCSIG$i (func (result i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32))) + (import "rtrace" "onincrement" (func $~lib/rt/rtrace/onincrement (param i32))) + (import "rtrace" "ondecrement" (func $~lib/rt/rtrace/ondecrement (param i32))) + (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) (import "Math" "random" (func $~lib/bindings/Math/random (result f64))) (memory $0 1) - (data (i32.const 8) "\0d\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s") - (data (i32.const 40) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") - (data (i32.const 104) "\03\00\00\00a\00b\00c") - (data (i32.const 120) "\0c\00\00\00s\00t\00d\00/\00a\00r\00r\00a\00y\00.\00t\00s") - (data (i32.const 152) "\1b\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s") - (data (i32.const 216) "\05\00\00\00\00\00\00\00\01\02\03\04\05") - (data (i32.const 232) "\d8\00\00\00\05") - (data (i32.const 240) "\05\00\00\00\00\00\00\00\01\01\01\04\05") - (data (i32.const 256) "\f0\00\00\00\05") - (data (i32.const 264) "\05") - (data (i32.const 280) "\08\01\00\00\05") - (data (i32.const 288) "\05\00\00\00\00\00\00\00\01\01") - (data (i32.const 304) " \01\00\00\05") - (data (i32.const 312) "\05\00\00\00\00\00\00\00\01\01\00\02\02") - (data (i32.const 328) "8\01\00\00\05") - (data (i32.const 336) "\05\00\00\00\00\00\00\00\01\01\00\02\02") - (data (i32.const 352) "P\01\00\00\05") - (data (i32.const 360) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 392) "h\01\00\00\05") - (data (i32.const 400) "\14\00\00\00\00\00\00\00\01\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00\05") - (data (i32.const 432) "\90\01\00\00\05") - (data (i32.const 440) "\14") - (data (i32.const 472) "\b8\01\00\00\05") - (data (i32.const 480) "\14\00\00\00\00\00\00\00\01\00\00\00\01") - (data (i32.const 512) "\e0\01\00\00\05") - (data (i32.const 520) "\14\00\00\00\00\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\02") - (data (i32.const 552) "\08\02\00\00\05") - (data (i32.const 560) "\14\00\00\00\00\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\02") - (data (i32.const 592) "0\02\00\00\05") - (data (i32.const 608) "X\02") - (data (i32.const 624) "h\02") - (data (i32.const 632) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 664) "x\02\00\00\05") - (data (i32.const 672) "\14\00\00\00\00\00\00\00\04\00\00\00\05\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 704) "\a0\02\00\00\05") - (data (i32.const 712) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 744) "\c8\02\00\00\05") - (data (i32.const 752) "\14\00\00\00\00\00\00\00\01\00\00\00\04\00\00\00\05\00\00\00\04\00\00\00\05") - (data (i32.const 784) "\f0\02\00\00\05") - (data (i32.const 792) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 824) "\18\03\00\00\05") - (data (i32.const 832) "\14\00\00\00\00\00\00\00\01\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\05") - (data (i32.const 864) "@\03\00\00\05") - (data (i32.const 872) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 904) "h\03\00\00\05") - (data (i32.const 912) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 944) "\90\03\00\00\05") - (data (i32.const 952) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 984) "\b8\03\00\00\05") - (data (i32.const 992) "\14\00\00\00\00\00\00\00\04\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1024) "\e0\03\00\00\05") - (data (i32.const 1032) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1064) "\08\04\00\00\05") - (data (i32.const 1072) "\14\00\00\00\00\00\00\00\01\00\00\00\04\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1104) "0\04\00\00\05") - (data (i32.const 1112) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1144) "X\04\00\00\05") - (data (i32.const 1152) "\14\00\00\00\00\00\00\00\01\00\00\00\03\00\00\00\04\00\00\00\04\00\00\00\05") - (data (i32.const 1184) "\80\04\00\00\05") - (data (i32.const 1192) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1224) "\a8\04\00\00\05") - (data (i32.const 1232) "\14\00\00\00\00\00\00\00\04\00\00\00\05\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1264) "\d0\04\00\00\05") - (data (i32.const 1272) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1304) "\f8\04\00\00\05") - (data (i32.const 1312) "\14\00\00\00\00\00\00\00\04\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1344) " \05\00\00\05") - (data (i32.const 1352) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1384) "H\05\00\00\05") - (data (i32.const 1392) "\14\00\00\00\00\00\00\00\01\00\00\00\03\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1424) "p\05\00\00\05") - (data (i32.const 1432) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1464) "\98\05\00\00\05") - (data (i32.const 1472) "\14\00\00\00\00\00\00\00\01\00\00\00\03\00\00\00\04\00\00\00\04\00\00\00\05") - (data (i32.const 1504) "\c0\05\00\00\05") - (data (i32.const 1512) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1544) "\e8\05\00\00\05") - (data (i32.const 1552) "\14\00\00\00\00\00\00\00\01\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\05") - (data (i32.const 1584) "\10\06\00\00\05") - (data (i32.const 1592) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1624) "8\06\00\00\05") - (data (i32.const 1632) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1664) "`\06\00\00\05") - (data (i32.const 1680) "\88\06") - (data (i32.const 1688) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1720) "\98\06\00\00\05") - (data (i32.const 1728) "\0c\00\00\00\00\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1760) "\c0\06\00\00\03") - (data (i32.const 1768) "\08\00\00\00\00\00\00\00\01\00\00\00\02") - (data (i32.const 1784) "\e8\06\00\00\02") - (data (i32.const 1792) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1825) "\07\00\00\05") - (data (i32.const 1832) "\08\00\00\00\00\00\00\00\03\00\00\00\04") - (data (i32.const 1848) "(\07\00\00\02") - (data (i32.const 1856) "\0c\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\05") - (data (i32.const 1888) "@\07\00\00\03") - (data (i32.const 1896) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1928) "h\07\00\00\05") - (data (i32.const 1936) "\04\00\00\00\00\00\00\00\01") - (data (i32.const 1952) "\90\07\00\00\01") - (data (i32.const 1960) "\10\00\00\00\00\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 1992) "\a8\07\00\00\04") - (data (i32.const 2000) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 2032) "\d0\07\00\00\05") - (data (i32.const 2040) "\04\00\00\00\00\00\00\00\05") - (data (i32.const 2056) "\f8\07\00\00\01") - (data (i32.const 2064) "\10\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04") - (data (i32.const 2096) "\10\08\00\00\04") - (data (i32.const 2104) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 2136) "8\08\00\00\05") - (data (i32.const 2144) "\08\00\00\00\00\00\00\00\04\00\00\00\05") - (data (i32.const 2160) "`\08\00\00\02") - (data (i32.const 2168) "\0c\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03") - (data (i32.const 2200) "x\08\00\00\03") - (data (i32.const 2208) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 2240) "\a0\08\00\00\05") - (data (i32.const 2248) "\04\00\00\00\00\00\00\00\04") - (data (i32.const 2264) "\c8\08\00\00\01") - (data (i32.const 2272) "\10\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\05") - (data (i32.const 2304) "\e0\08\00\00\04") - (data (i32.const 2312) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 2344) "\08\t\00\00\05") - (data (i32.const 2352) "\04\00\00\00\00\00\00\00\01") - (data (i32.const 2368) "0\t\00\00\01") - (data (i32.const 2376) "\10\00\00\00\00\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 2408) "H\t\00\00\04") - (data (i32.const 2416) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 2448) "p\t\00\00\05") - (data (i32.const 2464) "\98\t") - (data (i32.const 2472) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 2504) "\a8\t\00\00\05") - (data (i32.const 2512) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 2544) "\d0\t\00\00\05") - (data (i32.const 2560) "\f8\t") - (data (i32.const 2568) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 2600) "\08\n\00\00\05") - (data (i32.const 2608) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 2640) "0\n\00\00\05") - (data (i32.const 2656) "X\n") - (data (i32.const 2664) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 2696) "h\n\00\00\05") - (data (i32.const 2704) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 2736) "\90\n\00\00\05") - (data (i32.const 2752) "\b8\n") - (data (i32.const 2760) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 2792) "\c8\n\00\00\05") - (data (i32.const 2800) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 2832) "\f0\n\00\00\05") - (data (i32.const 2848) "\18\0b") - (data (i32.const 2856) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") - (data (i32.const 2888) "(\0b\00\00\05") - (data (i32.const 2896) "\0c\00\00\00~\00l\00i\00b\00/\00m\00a\00t\00h\00.\00t\00s") - (data (i32.const 2928) "V\00\00\00A\00B\00C\00D\00E\00F\00G\00H\00I\00J\00K\00L\00M\00N\00O\00P\00Q\00R\00S\00T\00U\00V\00W\00X\00Y\00Z\00a\00b\00c\00d\00e\00f\00g\00h\00i\00j\00k\00l\00m\00n\00o\00p\00q\00r\00s\00t\00u\00v\00w\00x\00y\00z\000\001\002\003\004\005\006\007\008\009\00_\00-\00,\00.\00+\00/\00\\\00[\00]\00{\00}\00(\00)\00<\00>\00*\00&\00$\00%\00^\00@\00#\00!\00?") - (data (i32.const 3104) " ") - (data (i32.const 3114) "\80?\00\00\c0\7f\00\00\80\ff\00\00\80?\00\00\00\00\00\00\80\bf\00\00\00\c0\00\00\80\7f") - (data (i32.const 3168) " \0c\00\00\08") - (data (i32.const 3176) " ") - (data (i32.const 3186) "\80\ff\00\00\00\c0\00\00\80\bf\00\00\00\00\00\00\80?\00\00\80?\00\00\80\7f\00\00\c0\7f") - (data (i32.const 3240) "h\0c\00\00\08") - (data (i32.const 3248) "@") - (data (i32.const 3262) "\f0?\00\00\00\00\00\00\f8\7f\00\00\00\00\00\00\f0\ff\05\00\00\00\00\00\f0?") - (data (i32.const 3302) "\f0\bf\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f0\7f") - (data (i32.const 3376) "\b0\0c\00\00\08") - (data (i32.const 3384) "@") - (data (i32.const 3398) "\f0\ff\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f0\bf") - (data (i32.const 3430) "\f0?\05\00\00\00\00\00\f0?\00\00\00\00\00\00\f0\7f\00\00\00\00\00\00\f8\7f") - (data (i32.const 3512) "8\0d\00\00\08") - (data (i32.const 3520) "\14\00\00\00\00\00\00\00\01\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff\00\00\00\00\02") - (data (i32.const 3552) "\c0\0d\00\00\05") - (data (i32.const 3560) "\14\00\00\00\00\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff\00\00\00\00\01\00\00\00\02") - (data (i32.const 3592) "\e8\0d\00\00\05") - (data (i32.const 3600) "\14\00\00\00\00\00\00\00\01\00\00\00\ff\ff\ff\ff\fe\ff\ff\ff\00\00\00\00\02") - (data (i32.const 3632) "\10\0e\00\00\05") - (data (i32.const 3640) "\14") - (data (i32.const 3652) "\01\00\00\00\02\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff") - (data (i32.const 3672) "8\0e\00\00\05") - (data (i32.const 3688) "`\0e") - (data (i32.const 3696) "\04\00\00\00\00\00\00\00\01") - (data (i32.const 3712) "p\0e\00\00\01") - (data (i32.const 3720) "\08\00\00\00\00\00\00\00\02\00\00\00\01") - (data (i32.const 3736) "\88\0e\00\00\02") - (data (i32.const 3744) "\10\00\00\00\00\00\00\00\03\00\00\00\02\00\00\00\01") - (data (i32.const 3776) "\a0\0e\00\00\04") - (data (i32.const 3784) "\10") - (data (i32.const 3796) "\01\00\00\00\02\00\00\00\03") - (data (i32.const 3816) "\c8\0e\00\00\04") - (data (i32.const 3824) "\04\00\00\00\00\00\00\00\01") - (data (i32.const 3840) "\f0\0e\00\00\01") - (data (i32.const 3848) "\08\00\00\00\00\00\00\00\01\00\00\00\02") - (data (i32.const 3864) "\08\0f\00\00\02") - (data (i32.const 3872) "\01\00\00\00a") - (data (i32.const 3880) "\01\00\00\00b") - (data (i32.const 3888) "\02\00\00\00a\00b") - (data (i32.const 3896) "\02\00\00\00b\00a") - (data (i32.const 3912) "\1c\00\00\00\00\00\00\00 \0f\00\00(\0f\00\00 \0f\00\000\0f\00\008\0f\00\00@\0f") - (data (i32.const 3976) "H\0f\00\00\07") - (data (i32.const 3984) "\1c\00\00\00\00\00\00\00@\0f\00\00 \0f\00\00 \0f\00\000\0f\00\00(\0f\00\008\0f") - (data (i32.const 4048) "\90\0f\00\00\07") - (data (i32.const 4056) "\0e\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s") - (data (i32.const 4088) "\17\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s") - (data (i32.const 4144) "\04\00\00\00n\00u\00l\00l") - (data (i32.const 4160) "\02\00\00\00\00\00\00\00\01") - (data (i32.const 4176) "@\10\00\00\02") - (data (i32.const 4184) "\04\00\00\00t\00r\00u\00e") - (data (i32.const 4200) "\05\00\00\00f\00a\00l\00s\00e") - (data (i32.const 4216) "\01\00\00\00,") - (data (i32.const 4224) "\02\00\00\00\00\00\00\00\01") - (data (i32.const 4240) "\80\10\00\00\02") - (data (i32.const 4248) "\n\00\00\00t\00r\00u\00e\00,\00f\00a\00l\00s\00e") - (data (i32.const 4272) "\0c\00\00\00\00\00\00\00\01\00\00\00\fe\ff\ff\ff\fd\ff\ff\ff") - (data (i32.const 4304) "\b0\10\00\00\03") - (data (i32.const 4312) "\01\00\00\000") - (data (i32.const 4320) "\90\01\00\00\00\00\00\000\000\000\001\000\002\000\003\000\004\000\005\000\006\000\007\000\008\000\009\001\000\001\001\001\002\001\003\001\004\001\005\001\006\001\007\001\008\001\009\002\000\002\001\002\002\002\003\002\004\002\005\002\006\002\007\002\008\002\009\003\000\003\001\003\002\003\003\003\004\003\005\003\006\003\007\003\008\003\009\004\000\004\001\004\002\004\003\004\004\004\005\004\006\004\007\004\008\004\009\005\000\005\001\005\002\005\003\005\004\005\005\005\006\005\007\005\008\005\009\006\000\006\001\006\002\006\003\006\004\006\005\006\006\006\007\006\008\006\009\007\000\007\001\007\002\007\003\007\004\007\005\007\006\007\007\007\008\007\009\008\000\008\001\008\002\008\003\008\004\008\005\008\006\008\007\008\008\008\009\009\000\009\001\009\002\009\003\009\004\009\005\009\006\009\007\009\008\009\009") - (data (i32.const 4832) "\e0\10\00\00d") - (data (i32.const 4840) "\0c\00\00\00\00\00\00\00\01\00\00\00\fe\ff\ff\ff\fd\ff\ff\ff") - (data (i32.const 4872) "\e8\12\00\00\03") - (data (i32.const 4880) "\05\00\00\001\00-\002\00-\003") - (data (i32.const 4896) "\0c\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03") - (data (i32.const 4928) " \13\00\00\03") - (data (i32.const 4936) "\01\00\00\00-") - (data (i32.const 4944) "\0c\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03") - (data (i32.const 4976) "P\13\00\00\03") - (data (i32.const 4984) "\08") - (data (i32.const 4995) "\80\00\00\00\80") - (data (i32.const 5000) "x\13\00\00\02") - (data (i32.const 5008) "\02\00\00\00_\00_") - (data (i32.const 5016) "\08") - (data (i32.const 5027) "\80\00\00\00\80") - (data (i32.const 5032) "\98\13\00\00\02") - (data (i32.const 5040) "\18\00\00\00-\002\001\004\007\004\008\003\006\004\008\00_\00_\00-\002\001\004\007\004\008\003\006\004\008") - (data (i32.const 5096) "0") - (data (i32.const 5118) "\f0?\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f8\7f\00\00\00\00\00\00\f0\ff\00\00\00\00\00\00\f0\7f") - (data (i32.const 5160) "\e8\13\00\00\06") - (data (i32.const 5168) "\02\00\00\00,\00 ") - (data (i32.const 5176) "\03\00\00\000\00.\000") - (data (i32.const 5192) "\03\00\00\00N\00a\00N") - (data (i32.const 5208) "\t\00\00\00-\00I\00n\00f\00i\00n\00i\00t\00y") - (data (i32.const 5232) "\08\00\00\00I\00n\00f\00i\00n\00i\00t\00y") - (data (i32.const 5256) "\b8\02\00\00\00\00\00\00\88\02\1c\08\a0\d5\8f\fav\bf>\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8~anonymous|0 $~lib/internal/sort/COMPARATOR~anonymous|0 $~lib/internal/sort/COMPARATOR~anonymous|0 $~lib/internal/sort/COMPARATOR~anonymous|0 $~lib/internal/sort/COMPARATOR~anonymous|0 $~lib/internal/sort/COMPARATOR~anonymous|0 $start:std/array~anonymous|44 $~lib/internal/sort/COMPARATOR~anonymous|0 $start:std/array~anonymous|44 $start:std/array~anonymous|47 $start:std/array~anonymous|48 $~lib/internal/sort/COMPARATOR<~lib/string/String>~anonymous|0) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) + (data (i32.const 8) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h") + (data (i32.const 56) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") + (data (i32.const 112) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s") + (data (i32.const 160) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e") + (data (i32.const 216) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s") + (data (i32.const 264) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e") + (data (i32.const 320) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s") + (data (i32.const 360) "\18\00\00\00\01\00\00\00\01\00\00\00\18\00\00\00s\00t\00d\00/\00a\00r\00r\00a\00y\00.\00t\00s") + (data (i32.const 400) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00a\00b\00c") + (data (i32.const 424) "\05\00\00\00\01\00\00\00\00\00\00\00\05\00\00\00\01\02\03\04\05") + (data (i32.const 448) "\05\00\00\00\01\00\00\00\00\00\00\00\05\00\00\00\01\01\01\04\05") + (data (i32.const 472) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s") + (data (i32.const 520) "\05\00\00\00\01\00\00\00\00\00\00\00\05") + (data (i32.const 544) "\05\00\00\00\01\00\00\00\00\00\00\00\05\00\00\00\01\01") + (data (i32.const 568) "\05\00\00\00\01\00\00\00\00\00\00\00\05\00\00\00\01\01\00\02\02") + (data (i32.const 592) "\05\00\00\00\01\00\00\00\00\00\00\00\05\00\00\00\01\01\00\02\02") + (data (i32.const 616) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 656) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00\05") + (data (i32.const 696) "\14\00\00\00\01\00\00\00\00\00\00\00\14") + (data (i32.const 736) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\01") + (data (i32.const 776) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\02") + (data (i32.const 816) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\02") + (data (i32.const 856) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00A\00r\00r\00a\00y\00 \00i\00s\00 \00e\00m\00p\00t\00y") + (data (i32.const 908) "\01") + (data (i32.const 924) "\01") + (data (i32.const 936) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 976) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\04\00\00\00\05\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 1016) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 1056) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\04\00\00\00\05\00\00\00\04\00\00\00\05") + (data (i32.const 1096) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 1136) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\05") + (data (i32.const 1176) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 1216) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 1256) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 1296) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\04\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 1336) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 1376) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\04\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 1416) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 1456) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\03\00\00\00\04\00\00\00\04\00\00\00\05") + (data (i32.const 1496) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 1536) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\04\00\00\00\05\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 1576) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 1616) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\04\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 1656) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 1696) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\03\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 1736) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 1776) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\03\00\00\00\04\00\00\00\04\00\00\00\05") + (data (i32.const 1816) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 1856) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\05") + (data (i32.const 1896) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 1936) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 1980) "\01") + (data (i32.const 1992) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 2032) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 2064) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\01\00\00\00\02") + (data (i32.const 2088) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 2128) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\03\00\00\00\04") + (data (i32.const 2152) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\01\00\00\00\02\00\00\00\05") + (data (i32.const 2184) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 2224) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01") + (data (i32.const 2248) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 2280) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 2320) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\05") + (data (i32.const 2344) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04") + (data (i32.const 2376) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 2416) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\04\00\00\00\05") + (data (i32.const 2440) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\01\00\00\00\02\00\00\00\03") + (data (i32.const 2472) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 2512) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\04") + (data (i32.const 2536) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\05") + (data (i32.const 2568) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 2608) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01") + (data (i32.const 2632) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 2664) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 2708) "\01") + (data (i32.const 2720) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 2760) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 2804) "\01") + (data (i32.const 2816) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 2856) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 2900) "\01") + (data (i32.const 2912) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 2952) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 2996) "\01") + (data (i32.const 3008) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 3048) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 3092) "\01") + (data (i32.const 3104) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") + (data (i32.const 3144) "\18\00\00\00\01\00\00\00\01\00\00\00\18\00\00\00~\00l\00i\00b\00/\00m\00a\00t\00h\00.\00t\00s") + (data (i32.const 3184) "\ac\00\00\00\01\00\00\00\01\00\00\00\ac\00\00\00A\00B\00C\00D\00E\00F\00G\00H\00I\00J\00K\00L\00M\00N\00O\00P\00Q\00R\00S\00T\00U\00V\00W\00X\00Y\00Z\00a\00b\00c\00d\00e\00f\00g\00h\00i\00j\00k\00l\00m\00n\00o\00p\00q\00r\00s\00t\00u\00v\00w\00x\00y\00z\000\001\002\003\004\005\006\007\008\009\00_\00-\00,\00.\00+\00/\00\\\00[\00]\00{\00}\00(\00)\00<\00>\00*\00&\00$\00%\00^\00@\00#\00!\00?") + (data (i32.const 3376) " \00\00\00\01\00\00\00\00\00\00\00 \00\00\00\00\00\80?\00\00\c0\7f\00\00\80\ff\00\00\80?\00\00\00\00\00\00\80\bf\00\00\00\c0\00\00\80\7f") + (data (i32.const 3424) " \00\00\00\01\00\00\00\00\00\00\00 \00\00\00\00\00\80\ff\00\00\00\c0\00\00\80\bf\00\00\00\00\00\00\80?\00\00\80?\00\00\80\7f\00\00\c0\7f") + (data (i32.const 3472) "@\00\00\00\01\00\00\00\00\00\00\00@") + (data (i32.const 3494) "\f0?\00\00\00\00\00\00\f8\7f\00\00\00\00\00\00\f0\ff\05\00\00\00\00\00\f0?") + (data (i32.const 3534) "\f0\bf\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f0\7f") + (data (i32.const 3552) "@\00\00\00\01\00\00\00\00\00\00\00@") + (data (i32.const 3574) "\f0\ff\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f0\bf") + (data (i32.const 3606) "\f0?\05\00\00\00\00\00\f0?\00\00\00\00\00\00\f0\7f\00\00\00\00\00\00\f8\7f") + (data (i32.const 3632) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff\00\00\00\00\02") + (data (i32.const 3672) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff\00\00\00\00\01\00\00\00\02") + (data (i32.const 3712) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\ff\ff\ff\ff\fe\ff\ff\ff\00\00\00\00\02") + (data (i32.const 3752) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff") + (data (i32.const 3796) "\01") + (data (i32.const 3808) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01") + (data (i32.const 3832) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\02\00\00\00\01") + (data (i32.const 3856) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\03\00\00\00\02\00\00\00\01") + (data (i32.const 3888) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03") + (data (i32.const 3920) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00P\00R\00N\00G\00 \00m\00u\00s\00t\00 \00b\00e\00 \00s\00e\00e\00d\00e\00d\00.") + (data (i32.const 3976) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01") + (data (i32.const 4000) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\01\00\00\00\02") + (data (i32.const 4024) "^\00\00\00\01\00\00\00\01\00\00\00^\00\00\00E\00l\00e\00m\00e\00n\00t\00 \00t\00y\00p\00e\00 \00m\00u\00s\00t\00 \00b\00e\00 \00n\00u\00l\00l\00a\00b\00l\00e\00 \00i\00f\00 \00a\00r\00r\00a\00y\00 \00i\00s\00 \00h\00o\00l\00e\00y") + (data (i32.const 4136) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00a") + (data (i32.const 4160) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00b") + (data (i32.const 4184) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00a\00b") + (data (i32.const 4208) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00b\00a") + (data (i32.const 4236) "\01\00\00\00\01") + (data (i32.const 4248) "\1c\00\00\00\01\00\00\00\00\00\00\00\1c\00\00\008\10\00\00P\10\00\008\10\00\00h\10\00\00\80\10\00\00\98\10") + (data (i32.const 4296) "\1c\00\00\00\01\00\00\00\00\00\00\00\1c\00\00\00\98\10\00\008\10\00\008\10\00\00h\10\00\00P\10\00\00\80\10") + (data (i32.const 4344) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s") + (data (i32.const 4392) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00n\00u\00l\00l") + (data (i32.const 4416) "\02\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\01") + (data (i32.const 4440) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00t\00r\00u\00e") + (data (i32.const 4464) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00f\00a\00l\00s\00e") + (data (i32.const 4496) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00,") + (data (i32.const 4520) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00t\00r\00u\00e\00,\00f\00a\00l\00s\00e") + (data (i32.const 4560) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\01\00\00\00\fe\ff\ff\ff\fd\ff\ff\ff") + (data (i32.const 4592) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\000") + (data (i32.const 4616) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\001\00-\002\00-\003") + (data (i32.const 4648) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\01\00\00\00\02\00\00\00\03") + (data (i32.const 4680) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00-") + (data (i32.const 4704) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\00\00\00\80\00\00\00\80") + (data (i32.const 4728) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00_\00_") + (data (i32.const 4752) "0\00\00\00\01\00\00\00\01\00\00\000\00\00\00-\002\001\004\007\004\008\003\006\004\008\00_\00_\00-\002\001\004\007\004\008\003\006\004\008") + (data (i32.const 4816) "0\00\00\00\01\00\00\00\00\00\00\000") + (data (i32.const 4846) "\f0?\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f8\7f\00\00\00\00\00\00\f0\ff\00\00\00\00\00\00\f0\7f") + (data (i32.const 4880) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00,\00 ") + (data (i32.const 4904) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\000\00.\000") + (data (i32.const 4928) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00N\00a\00N") + (data (i32.const 4952) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\00-\00I\00n\00f\00i\00n\00i\00t\00y") + (data (i32.const 4992) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00I\00n\00f\00i\00n\00i\00t\00y") + (data (i32.const 5024) "\b8\02\00\00\01\00\00\00\00\00\00\00\b8\02\00\00\88\02\1c\08\a0\d5\8f\fav\bf>\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $start:std/array~anonymous|44 $~lib/util/sort/COMPARATOR~anonymous|0 $start:std/array~anonymous|44 $start:std/array~anonymous|47 $start:std/array~anonymous|48 $~lib/util/sort/COMPARATOR<~lib/string/String | null>~anonymous|0 $~lib/util/sort/COMPARATOR<~lib/string/String | null>~anonymous|0) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) (global $std/array/arr (mut i32) (i32.const 0)) - (global $std/array/Null (mut i32) (i32.const 0)) - (global $std/array/arr8 (mut i32) (i32.const 232)) - (global $~lib/argc (mut i32) (i32.const 0)) - (global $std/array/arr32 (mut i32) (i32.const 392)) (global $std/array/i (mut i32) (i32.const 0)) - (global $std/array/other (mut i32) (i32.const 0)) - (global $std/array/out (mut i32) (i32.const 0)) - (global $std/array/source (mut i32) (i32.const 624)) - (global $std/array/cwArr (mut i32) (i32.const 0)) - (global $std/array/includes (mut i32) (i32.const 0)) - (global $std/array/sarr (mut i32) (i32.const 1624)) - (global $std/array/every (mut i32) (i32.const 0)) - (global $std/array/some (mut i32) (i32.const 0)) - (global $std/array/newArr (mut i32) (i32.const 0)) - (global $std/array/filteredArr (mut i32) (i32.const 0)) - (global $std/array/boolVal (mut i32) (i32.const 0)) + (global $~lib/argc (mut i32) (i32.const 0)) (global $~lib/math/random_seeded (mut i32) (i32.const 0)) (global $~lib/math/random_state0_64 (mut i64) (i64.const 0)) (global $~lib/math/random_state1_64 (mut i64) (i64.const 0)) (global $~lib/math/random_state0_32 (mut i32) (i32.const 0)) (global $~lib/math/random_state1_32 (mut i32) (i32.const 0)) - (global $std/array/f32ArrayTyped (mut i32) (i32.const 3168)) - (global $std/array/f64ArrayTyped (mut i32) (i32.const 3376)) - (global $std/array/i32ArrayTyped (mut i32) (i32.const 3552)) - (global $std/array/u32ArrayTyped (mut i32) (i32.const 3632)) - (global $std/array/reversed0 (mut i32) (i32.const 3688)) - (global $std/array/reversed1 (mut i32) (i32.const 3712)) - (global $std/array/reversed2 (mut i32) (i32.const 3736)) - (global $std/array/reversed4 (mut i32) (i32.const 3776)) - (global $std/array/expected4 (mut i32) (i32.const 3816)) - (global $std/array/reversed64 (mut i32) (i32.const 0)) - (global $std/array/reversed128 (mut i32) (i32.const 0)) - (global $std/array/reversed1024 (mut i32) (i32.const 0)) - (global $std/array/reversed10000 (mut i32) (i32.const 0)) - (global $std/array/randomized512 (mut i32) (i32.const 0)) - (global $std/array/randomized64 (mut i32) (i32.const 0)) - (global $std/array/randomized257 (mut i32) (i32.const 0)) - (global $std/array/reversedNested512 (mut i32) (i32.const 0)) - (global $std/array/reversedElements512 (mut i32) (i32.const 0)) - (global $std/array/randomStringsActual (mut i32) (i32.const 3976)) - (global $std/array/randomStringsExpected (mut i32) (i32.const 4048)) - (global $std/array/randomStrings400 (mut i32) (i32.const 0)) - (global $~lib/internal/number/_frc_plus (mut i64) (i64.const 0)) - (global $~lib/internal/number/_frc_minus (mut i64) (i64.const 0)) - (global $~lib/internal/number/_exp (mut i32) (i32.const 0)) - (global $~lib/internal/number/_K (mut i32) (i32.const 0)) - (global $~lib/internal/number/_frc_pow (mut i64) (i64.const 0)) - (global $~lib/internal/number/_exp_pow (mut i32) (i32.const 0)) - (global $std/array/refArr (mut i32) (i32.const 0)) - (global $std/array/subarr32 (mut i32) (i32.const 7736)) - (global $std/array/subarr8 (mut i32) (i32.const 7832)) - (global $std/array/subarrU32 (mut i32) (i32.const 7904)) + (global $~lib/util/number/_frc_plus (mut i64) (i64.const 0)) + (global $~lib/util/number/_frc_minus (mut i64) (i64.const 0)) + (global $~lib/util/number/_exp (mut i32) (i32.const 0)) + (global $~lib/util/number/_K (mut i32) (i32.const 0)) + (global $~lib/util/number/_frc_pow (mut i64) (i64.const 0)) + (global $~lib/util/number/_exp_pow (mut i32) (i32.const 0)) + (global $~lib/started (mut i32) (i32.const 0)) + (export "__start" (func $start)) (export "memory" (memory $0)) - (export "table" (table $0)) - (start $start) - (func $~lib/allocator/arena/__memory_allocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/rt/tlsf/removeBlock (; 6 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) - local.get $0 - i32.const 1073741824 - i32.gt_u + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.tee $3 + i32.const 1 + i32.and + i32.eqz if + i32.const 0 + i32.const 128 + i32.const 276 + i32.const 13 + call $~lib/builtins/abort unreachable end - global.get $~lib/allocator/arena/offset - local.tee $1 - local.get $0 - i32.const 1 - local.get $0 - i32.const 1 - i32.gt_u - select - i32.add - i32.const 7 - i32.add - i32.const -8 + local.get $3 + i32.const -4 i32.and - local.tee $0 - current_memory local.tee $2 i32.const 16 - i32.shl - i32.gt_u + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz if + i32.const 0 + i32.const 128 + i32.const 278 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 256 + i32.lt_u + if (result i32) local.get $2 - local.get $0 - local.get $1 - i32.sub - i32.const 65535 - i32.add - i32.const -65536 - i32.and - i32.const 16 + i32.const 4 i32.shr_u - local.tee $3 + local.set $2 + i32.const 0 + else local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $3 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $2 local.get $3 - i32.gt_s - select - grow_memory + i32.const 7 + i32.sub + end + local.tee $3 + i32.const 23 + i32.lt_u + if (result i32) + local.get $2 + i32.const 16 + i32.lt_u + else i32.const 0 - i32.lt_s - if - local.get $3 - grow_memory - i32.const 0 - i32.lt_s - if - unreachable - end - end end - local.get $0 - global.set $~lib/allocator/arena/offset - local.get $1 - ) - (func $~lib/internal/arraybuffer/allocateUnsafe (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - local.get $0 - i32.const 1073741816 - i32.gt_u + i32.eqz if i32.const 0 - i32.const 40 - i32.const 26 - i32.const 2 - call $~lib/env/abort + i32.const 128 + i32.const 291 + i32.const 13 + call $~lib/builtins/abort unreachable end - i32.const 1 - i32.const 32 - local.get $0 - i32.const 7 + local.get $1 + i32.load offset=20 + local.set $4 + local.get $1 + i32.load offset=16 + local.tee $5 + if + local.get $5 + local.get $4 + i32.store offset=20 + end + local.get $4 + if + local.get $4 + local.get $5 + i32.store offset=16 + end + local.get $3 + i32.const 4 + i32.shl + local.get $2 i32.add - i32.clz - i32.sub + i32.const 2 i32.shl - call $~lib/allocator/arena/__memory_allocate - local.tee $1 local.get $0 - i32.store + i32.add + i32.load offset=96 local.get $1 + i32.eq + if + local.get $3 + i32.const 4 + i32.shl + local.get $2 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $4 + i32.store offset=96 + local.get $4 + i32.eqz + if + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const 1 + local.get $2 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.store offset=4 + local.get $1 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $3 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end ) - (func $~lib/internal/memory/memset (; 4 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/insertBlock (; 7 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) (local $3 i32) - (local $4 i64) - local.get $2 + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + local.get $1 i32.eqz if - return + i32.const 0 + i32.const 128 + i32.const 204 + i32.const 13 + call $~lib/builtins/abort + unreachable end - local.get $0 local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add + i32.load + local.tee $3 i32.const 1 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 2 - i32.le_u + i32.and + i32.eqz if - return + i32.const 0 + i32.const 128 + i32.const 206 + i32.const 13 + call $~lib/builtins/abort + unreachable end - local.get $0 - i32.const 1 - i32.add - local.get $1 - i32.store8 - local.get $0 - i32.const 2 - i32.add - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - local.tee $3 - i32.const 2 - i32.sub local.get $1 - i32.store8 - local.get $3 - i32.const 3 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 6 - i32.le_u - if - return - end - local.get $0 - i32.const 3 + i32.const 16 i32.add local.get $1 - i32.store8 - local.get $0 - local.get $2 + i32.load + i32.const -4 + i32.and i32.add - i32.const 4 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 8 - i32.le_u + local.tee $4 + i32.load + local.tee $5 + i32.const 1 + i32.and if - return - end - local.get $2 - i32.const 0 - local.get $0 - i32.sub - i32.const 3 - i32.and - local.tee $2 - i32.sub - local.set $3 - local.get $0 - local.get $2 - i32.add - local.tee $0 - local.get $1 - i32.const 255 + local.get $3 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const -4 + i32.and + i32.add + local.tee $2 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $3 + i32.const 3 + i32.and + local.get $2 + i32.or + local.tee $3 + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.set $5 + end + end + local.get $3 + i32.const 2 i32.and - i32.const 16843009 - i32.mul - local.tee $1 + if + local.get $1 + i32.const 4 + i32.sub + i32.load + local.tee $2 + i32.load + local.tee $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 227 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $3 + i32.const -4 + i32.and + i32.add + local.tee $7 + i32.const 1073741808 + i32.lt_u + if (result i32) + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $2 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $3 + i32.store + local.get $2 + else + local.get $1 + end + local.set $1 + end + local.get $4 + local.get $5 + i32.const 2 + i32.or i32.store local.get $3 i32.const -4 i32.and local.tee $2 - local.get $0 + i32.const 16 + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + local.get $1 + i32.const 16 i32.add + local.get $2 + i32.add + i32.ne + if + i32.const 0 + i32.const 128 + i32.const 243 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 i32.const 4 i32.sub local.get $1 i32.store local.get $2 - i32.const 8 - i32.le_u + i32.const 256 + i32.lt_u + if (result i32) + local.get $2 + i32.const 4 + i32.shr_u + local.set $4 + i32.const 0 + else + local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $4 + local.get $2 + i32.const 7 + i32.sub + end + local.tee $3 + i32.const 23 + i32.lt_u + if (result i32) + local.get $4 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz if - return + i32.const 0 + i32.const 128 + i32.const 259 + i32.const 13 + call $~lib/builtins/abort + unreachable end - local.get $0 + local.get $3 i32.const 4 + i32.shl + local.get $4 i32.add - local.get $1 - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $1 - i32.store + i32.const 2 + i32.shl local.get $0 - local.get $2 i32.add - local.tee $3 - i32.const 12 - i32.sub + i32.load offset=96 + local.set $2 local.get $1 - i32.store - local.get $3 - i32.const 8 - i32.sub + i32.const 0 + i32.store offset=16 local.get $1 - i32.store local.get $2 - i32.const 24 - i32.le_u + i32.store offset=20 + local.get $2 if - return + local.get $2 + local.get $1 + i32.store offset=16 end - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.store - local.get $0 - i32.const 16 + local.get $3 + i32.const 4 + i32.shl + local.get $4 i32.add - local.get $1 - i32.store + i32.const 2 + i32.shl local.get $0 - i32.const 20 i32.add local.get $1 - i32.store + i32.store offset=96 local.get $0 - i32.const 24 - i32.add - local.get $1 - i32.store local.get $0 - local.get $2 - i32.add - local.tee $3 - i32.const 28 - i32.sub - local.get $1 - i32.store - local.get $3 - i32.const 24 - i32.sub - local.get $1 - i32.store + i32.load + i32.const 1 local.get $3 - i32.const 20 - i32.sub - local.get $1 + i32.shl + i32.or i32.store local.get $3 - i32.const 16 - i32.sub - local.get $1 - i32.store + i32.const 2 + i32.shl local.get $0 - i32.const 4 - i32.and - i32.const 24 i32.add - local.tee $3 + local.get $3 + i32.const 2 + i32.shl local.get $0 i32.add - local.set $0 - local.get $2 - local.get $3 - i32.sub - local.set $2 - local.get $1 - i64.extend_i32_u - local.tee $4 + i32.load offset=4 + i32.const 1 local.get $4 - i64.const 32 - i64.shl - i64.or - local.set $4 - loop $continue|0 - local.get $2 - i32.const 32 - i32.ge_u - if - local.get $0 - local.get $4 - i64.store - local.get $0 - i32.const 8 - i32.add - local.get $4 - i64.store - local.get $0 - i32.const 16 - i32.add - local.get $4 - i64.store - local.get $0 - i32.const 24 - i32.add - local.get $4 - i64.store - local.get $2 - i32.const 32 - i32.sub - local.set $2 - local.get $0 - i32.const 32 - i32.add - local.set $0 - br $continue|0 - end - end + i32.shl + i32.or + i32.store offset=4 ) - (func $~lib/array/Array#constructor (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) + (func $~lib/rt/tlsf/addMemory (; 8 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - local.get $0 - i32.const 268435454 - i32.gt_u + (local $4 i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $1 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $1 + local.get $2 + i32.le_u + select + select + i32.eqz if i32.const 0 - i32.const 8 - i32.const 45 - i32.const 39 - call $~lib/env/abort + i32.const 128 + i32.const 385 + i32.const 4 + call $~lib/builtins/abort unreachable end local.get $0 - i32.const 2 - i32.shl + i32.load offset=1568 local.tee $3 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $2 - i32.const 8 - call $~lib/allocator/arena/__memory_allocate - local.tee $1 - i32.const 0 + if + local.get $1 + local.get $3 + i32.const 16 + i32.add + i32.lt_u + if + i32.const 0 + i32.const 128 + i32.const 395 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $3 + i32.eq + if + local.get $3 + i32.load + local.set $4 + local.get $1 + i32.const 16 + i32.sub + local.set $1 + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.lt_u + if + i32.const 0 + i32.const 128 + i32.const 407 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.tee $2 + i32.const 48 + i32.lt_u + if + return + end + local.get $1 + local.get $4 + i32.const 2 + i32.and + local.get $2 + i32.const 32 + i32.sub + i32.const 1 + i32.or + i32.or i32.store local.get $1 i32.const 0 - i32.store offset=4 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.store offset=20 local.get $1 local.get $2 + i32.add + i32.const 16 + i32.sub + local.tee $2 + i32.const 2 i32.store - local.get $1 local.get $0 - i32.store offset=4 local.get $2 - i32.const 8 - i32.add - i32.const 0 - local.get $3 - call $~lib/internal/memory/memset + i32.store offset=1568 + local.get $0 local.get $1 + call $~lib/rt/tlsf/insertBlock ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/rt/tlsf/initializeRoot (; 9 ;) (type $FUNCSIG$v) + (local $0 i32) (local $1 i32) i32.const 1 - call $~lib/internal/arraybuffer/allocateUnsafe - local.tee $1 - i32.const 8 - i32.add - i32.const 0 - i32.const 1 - call $~lib/internal/memory/memset - local.get $0 - i32.eqz + memory.size + local.tee $0 + i32.gt_s + if (result i32) + i32.const 1 + local.get $0 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end if - i32.const 12 - call $~lib/allocator/arena/__memory_allocate - local.set $0 + unreachable end - local.get $0 + i32.const 7472 i32.const 0 i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 + i32.const 9040 i32.const 0 - i32.store offset=8 - local.get $0 - local.get $1 i32.store - local.get $0 i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 1 - i32.store offset=8 - local.get $0 + local.set $0 + loop $repeat|0 + block $break|0 + local.get $0 + i32.const 23 + i32.ge_u + br_if $break|0 + local.get $0 + i32.const 2 + i32.shl + i32.const 7472 + i32.add + i32.const 0 + i32.store offset=4 + i32.const 0 + local.set $1 + loop $repeat|1 + block $break|1 + local.get $1 + i32.const 16 + i32.ge_u + br_if $break|1 + local.get $0 + i32.const 4 + i32.shl + local.get $1 + i32.add + i32.const 2 + i32.shl + i32.const 7472 + i32.add + i32.const 0 + i32.store offset=96 + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|1 + end + end + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + end + i32.const 7472 + i32.const 9056 + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + i32.const 7472 + global.set $~lib/rt/tlsf/ROOT ) - (func $~lib/array/Array#fill (; 7 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - (local $4 i32) - (local $5 i32) + (func $~lib/rt/tlsf/prepareSize (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - i32.load - local.set $5 + i32.const 1073741808 + i32.ge_u + if + i32.const 176 + i32.const 128 + i32.const 447 + i32.const 29 + call $~lib/builtins/abort + unreachable + end local.get $0 - i32.load offset=4 - local.set $4 - local.get $2 - i32.const 0 - i32.lt_s + i32.const 15 + i32.add + i32.const -16 + i32.and + local.tee $0 + i32.const 16 + local.get $0 + i32.const 16 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 11 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + i32.const 256 + i32.lt_u if (result i32) - local.get $2 - local.get $4 - i32.add - local.tee $0 - i32.const 0 - local.get $0 + local.get $1 + i32.const 4 + i32.shr_u + local.set $1 i32.const 0 - i32.gt_s - select else - local.get $2 - local.get $4 - local.get $2 - local.get $4 - i32.lt_s - select - end - local.tee $0 - local.get $3 - i32.const 0 - i32.lt_s - if (result i32) - local.get $3 - local.get $4 - i32.add + local.get $1 + i32.const 536870904 + i32.lt_u + if + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + local.get $1 + i32.add + i32.const 1 + i32.sub + local.set $1 + end + local.get $1 + i32.const 31 + local.get $1 + i32.clz + i32.sub local.tee $2 - i32.const 0 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $1 local.get $2 - i32.const 0 - i32.gt_s - select - else - local.get $3 - local.get $4 - local.get $3 - local.get $4 - i32.lt_s - select + i32.const 7 + i32.sub end local.tee $2 - i32.lt_s - if - local.get $0 - local.get $5 - i32.add - i32.const 8 - i32.add + i32.const 23 + i32.lt_u + if (result i32) local.get $1 - local.get $2 - local.get $0 - i32.sub - call $~lib/internal/memory/memset + i32.const 16 + i32.lt_u + else + i32.const 0 end - ) - (func $std/array/isArraysEqual (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - local.get $0 - i32.load offset=4 - local.tee $4 - local.get $1 - i32.load offset=4 - i32.ne + i32.eqz if i32.const 0 - return + i32.const 128 + i32.const 337 + i32.const 13 + call $~lib/builtins/abort + unreachable end + local.get $2 + i32.const 2 + i32.shl local.get $0 + i32.add + i32.load offset=4 + i32.const -1 local.get $1 - i32.eq - if - i32.const 1 - return - end - loop $repeat|0 + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $1 + i32.ctz local.get $2 - local.get $4 - i32.lt_s - if - local.get $2 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + else + local.get $0 + i32.load + i32.const -1 + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $1 + i32.ctz + local.tee $1 + i32.const 2 + i32.shl local.get $0 - i32.load - local.tee $3 - i32.load - i32.lt_u - if (result i32) - local.get $2 - local.get $3 - i32.add - i32.load8_u offset=8 - else + i32.add + i32.load offset=4 + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 350 + i32.const 17 + call $~lib/builtins/abort unreachable end - i32.const 255 - i32.and local.get $2 + i32.ctz local.get $1 - i32.load - local.tee $3 - i32.load - i32.lt_u - if (result i32) - local.get $2 - local.get $3 - i32.add - i32.load8_u offset=8 - else - unreachable - end - i32.const 255 - i32.and - i32.ne - if - i32.const 0 - return - else - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $repeat|0 - end - unreachable + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + else + i32.const 0 end end - i32.const 1 ) - (func $~lib/array/Array#fill|trampoline (; 9 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - block $2of2 - block $1of2 - block $0of2 - block $outOfRange - global.get $~lib/argc - i32.const 1 - i32.sub - br_table $0of2 $1of2 $2of2 $outOfRange - end - unreachable - end - i32.const 0 - local.set $2 + (func $~lib/rt/tlsf/growMemory (; 12 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + memory.size + local.tee $2 + local.get $1 + i32.const 65535 + i32.add + i32.const -65536 + i32.and + i32.const 16 + i32.shr_u + local.tee $1 + local.get $2 + local.get $1 + i32.gt_s + select + memory.grow + i32.const 0 + i32.lt_s + if + local.get $1 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable end - i32.const 2147483647 - local.set $3 end local.get $0 - local.get $1 local.get $2 - local.get $3 - call $~lib/array/Array#fill + i32.const 16 + i32.shl + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory ) - (func $~lib/array/Array#fill (; 10 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $~lib/rt/tlsf/prepareBlock (; 13 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) (local $4 i32) - local.get $0 + local.get $1 i32.load - local.set $4 - local.get $0 - i32.load offset=4 - local.set $0 + local.set $3 local.get $2 - i32.const 0 - i32.lt_s - if (result i32) - local.get $0 - local.get $2 - i32.add - local.tee $2 - i32.const 0 - local.get $2 + i32.const 15 + i32.and + if i32.const 0 - i32.gt_s - select - else - local.get $2 - local.get $0 - local.get $2 - local.get $0 - i32.lt_s - select + i32.const 128 + i32.const 364 + i32.const 13 + call $~lib/builtins/abort + unreachable end - local.set $2 local.get $3 - i32.const 0 - i32.lt_s - if (result i32) - local.get $0 + i32.const -4 + i32.and + local.get $2 + i32.sub + local.tee $4 + i32.const 32 + i32.ge_u + if + local.get $1 local.get $3 - i32.add - local.tee $0 - i32.const 0 - local.get $0 - i32.const 0 - i32.gt_s - select - else - local.get $3 - local.get $0 - local.get $3 - local.get $0 - i32.lt_s - select - end - local.set $0 - loop $repeat|0 + i32.const 2 + i32.and + local.get $2 + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add local.get $2 + i32.add + local.tee $1 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store local.get $0 - i32.lt_s - if - local.get $2 - i32.const 2 - i32.shl - local.get $4 - i32.add - local.get $1 - i32.store offset=8 - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $repeat|0 - end + local.get $1 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const -2 + i32.and + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + i32.load + i32.const -3 + i32.and + i32.store end ) - (func $std/array/isArraysEqual (; 11 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/rt/tlsf/allocateBlock (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) (local $3 i32) - (local $4 i32) - local.get $2 + local.get $0 + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.tee $3 + call $~lib/rt/tlsf/searchBlock + local.tee $2 i32.eqz if local.get $0 - i32.load offset=4 - local.tee $2 - local.get $1 - i32.load offset=4 - i32.ne - if - i32.const 0 - return - end + local.get $3 + call $~lib/rt/tlsf/growMemory local.get $0 - local.get $1 - i32.eq - if - i32.const 1 - return - end - end - loop $repeat|0 local.get $3 - local.get $2 - i32.lt_s + call $~lib/rt/tlsf/searchBlock + local.tee $2 + i32.eqz if - local.get $3 - local.get $0 - i32.load - local.tee $4 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $3 - i32.const 2 - i32.shl - local.get $4 - i32.add - i32.load offset=8 - else - unreachable - end - local.get $3 - local.get $1 - i32.load - local.tee $4 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $3 - i32.const 2 - i32.shl - local.get $4 - i32.add - i32.load offset=8 - else - unreachable - end - i32.ne - if - i32.const 0 - return - else - local.get $3 - i32.const 1 - i32.add - local.set $3 - br $repeat|0 - end + i32.const 0 + i32.const 128 + i32.const 477 + i32.const 15 + call $~lib/builtins/abort unreachable end end - i32.const 1 - ) - (func $~lib/array/Array#fill|trampoline (; 12 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - block $2of2 - block $1of2 - block $0of2 - block $outOfRange - global.get $~lib/argc - i32.const 1 - i32.sub - br_table $0of2 $1of2 $2of2 $outOfRange - end - unreachable - end - i32.const 0 - local.set $2 - end - i32.const 2147483647 - local.set $3 + local.get $2 + i32.load + i32.const -4 + i32.and + local.get $3 + i32.lt_u + if + i32.const 0 + i32.const 128 + i32.const 479 + i32.const 13 + call $~lib/builtins/abort + unreachable end - local.get $0 + local.get $2 + i32.const 0 + i32.store offset=4 + local.get $2 local.get $1 + i32.store offset=12 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $0 local.get $2 local.get $3 - call $~lib/array/Array#fill + call $~lib/rt/tlsf/prepareBlock + local.get $2 + call $~lib/rt/rtrace/onalloc + local.get $2 ) - (func $~lib/internal/memory/memcpy (; 13 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - loop $continue|0 - local.get $1 - i32.const 3 - i32.and - local.get $2 + (func $~lib/rt/tlsf/__alloc (; 15 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + global.get $~lib/rt/tlsf/ROOT + local.tee $2 + if (result i32) local.get $2 - select - if - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - br $continue|0 - end + else + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT end local.get $0 - i32.const 3 + call $~lib/rt/tlsf/allocateBlock + local.tee $0 + local.get $1 + i32.store offset=8 + local.get $0 + i32.const 16 + i32.add + ) + (func $~lib/rt/pure/increment (; 16 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const -268435456 i32.and - i32.eqz + local.get $1 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne if - loop $continue|1 - local.get $2 - i32.const 16 - i32.ge_u - if - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $1 - i32.const 4 - i32.add - i32.load - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $1 - i32.const 8 - i32.add - i32.load - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 12 - i32.add - i32.load - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - br $continue|1 - end - end - local.get $2 - i32.const 8 - i32.and - if - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $1 - i32.const 4 - i32.add - i32.load - i32.store - local.get $1 - i32.const 8 - i32.add - local.set $1 - local.get $0 - i32.const 8 - i32.add - local.set $0 - end - local.get $2 - i32.const 4 - i32.and - if - local.get $0 - local.get $1 - i32.load - i32.store - local.get $1 - i32.const 4 - i32.add - local.set $1 - local.get $0 - i32.const 4 - i32.add - local.set $0 - end - local.get $2 + i32.const 0 + i32.const 232 + i32.const 104 i32.const 2 - i32.and - if - local.get $0 - local.get $1 - i32.load16_u - i32.store16 - local.get $1 - i32.const 2 - i32.add - local.set $1 - local.get $0 - i32.const 2 - i32.add - local.set $0 - end - local.get $2 - i32.const 1 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - end - return + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/rtrace/onincrement + local.get $0 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 232 + i32.const 107 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/pure/__retain (; 17 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 7460 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment + end + local.get $0 + ) + (func $~lib/rt/tlsf/freeBlock (; 18 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.tee $2 + i32.const 1 + i32.and + if + i32.const 0 + i32.const 128 + i32.const 531 + i32.const 2 + call $~lib/builtins/abort + unreachable end + local.get $1 local.get $2 - i32.const 32 - i32.ge_u + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/rtrace/onfree + ) + (func $~lib/rt/__typeinfo (; 19 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 7248 + i32.load + i32.gt_u if - block $break|2 - block $case2|2 - block $case1|2 + i32.const 280 + i32.const 336 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 3 + i32.shl + i32.const 7252 + i32.add + i32.load + ) + (func $~lib/memory/memory.copy (; 20 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $2 + local.set $3 + local.get $0 + local.get $1 + i32.eq + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $1 + i32.lt_u + if + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|0 local.get $0 - i32.const 3 + i32.const 7 i32.and - local.tee $3 - i32.const 1 - i32.ne if local.get $3 - i32.const 2 - i32.eq - br_if $case1|2 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 local.get $3 - i32.const 3 - i32.eq - br_if $case2|2 - br $break|2 + i32.const 1 + i32.sub + local.set $3 + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + br $continue|0 end - local.get $1 - i32.load - local.set $5 - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 + end + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $1 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + br $continue|1 + end + end + end + loop $continue|2 + local.get $3 + if local.get $0 - i32.const 1 - i32.add - local.tee $3 + local.tee $2 i32.const 1 i32.add local.set $0 local.get $1 - i32.const 1 - i32.add local.tee $4 i32.const 1 i32.add local.set $1 - local.get $3 + local.get $2 local.get $4 i32.load8_u i32.store8 - local.get $2 - i32.const 3 + local.get $3 + i32.const 1 i32.sub - local.set $2 - loop $continue|3 - local.get $2 - i32.const 17 - i32.ge_u - if - local.get $0 - local.get $1 - i32.const 1 - i32.add - i32.load - local.tee $3 - i32.const 8 - i32.shl - local.get $5 - i32.const 24 - i32.shr_u - i32.or - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $3 - i32.const 24 - i32.shr_u - local.get $1 - i32.const 5 - i32.add - i32.load - local.tee $3 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $3 - i32.const 24 - i32.shr_u - local.get $1 - i32.const 9 - i32.add - i32.load - local.tee $3 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 13 - i32.add - i32.load - local.tee $5 - i32.const 8 - i32.shl - local.get $3 - i32.const 24 - i32.shr_u - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - br $continue|3 - end - end - br $break|2 + local.set $3 + br $continue|2 end - local.get $1 - i32.load - local.set $5 - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 2 - i32.sub - local.set $2 - loop $continue|4 - local.get $2 - i32.const 18 - i32.ge_u + end + else + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|3 + local.get $0 + local.get $3 + i32.add + i32.const 7 + i32.and if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 local.get $0 - local.get $1 - i32.const 2 - i32.add - i32.load + local.get $3 + i32.const 1 + i32.sub local.tee $3 - i32.const 16 - i32.shl - local.get $5 - i32.const 16 - i32.shr_u - i32.or - i32.store - local.get $0 - i32.const 4 i32.add - local.get $3 - i32.const 16 - i32.shr_u local.get $1 - i32.const 6 + local.get $3 i32.add - i32.load - local.tee $3 - i32.const 16 - i32.shl - i32.or - i32.store + i32.load8_u + i32.store8 + br $continue|3 + end + end + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if local.get $0 - i32.const 8 - i32.add local.get $3 - i32.const 16 - i32.shr_u - local.get $1 - i32.const 10 - i32.add - i32.load + i32.const 8 + i32.sub local.tee $3 - i32.const 16 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 12 i32.add local.get $1 - i32.const 14 - i32.add - i32.load - local.tee $5 - i32.const 16 - i32.shl local.get $3 - i32.const 16 - i32.shr_u - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 + i64.load + i64.store br $continue|4 end end - br $break|2 end - local.get $1 - i32.load - local.set $5 - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 loop $continue|5 - local.get $2 - i32.const 19 - i32.ge_u + local.get $3 if local.get $0 - local.get $1 - i32.const 3 - i32.add - i32.load - local.tee $3 - i32.const 24 - i32.shl - local.get $5 - i32.const 8 - i32.shr_u - i32.or - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $3 - i32.const 8 - i32.shr_u - local.get $1 - i32.const 7 - i32.add - i32.load - local.tee $3 - i32.const 24 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 8 - i32.add local.get $3 - i32.const 8 - i32.shr_u - local.get $1 - i32.const 11 - i32.add - i32.load + i32.const 1 + i32.sub local.tee $3 - i32.const 24 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 12 i32.add local.get $1 - i32.const 15 - i32.add - i32.load - local.tee $5 - i32.const 24 - i32.shl local.get $3 - i32.const 8 - i32.shr_u - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 + i32.load8_u + i32.store8 br $continue|5 end end end end - local.get $2 - i32.const 16 + ) + (func $~lib/rt/tlsf/__free (; 21 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 561 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 i32.and + i32.eqz + i32.const 0 + local.get $0 + select + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 562 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/growRoots (; 22 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/pure/CUR + global.get $~lib/rt/pure/ROOTS + local.tee $1 + i32.sub + local.tee $2 + i32.const 1 + i32.shl + local.tee $0 + i32.const 256 + local.get $0 + i32.const 256 + i32.gt_u + select + local.tee $3 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.tee $0 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onfree + local.get $0 + local.get $1 + local.get $2 + call $~lib/memory/memory.copy + local.get $1 if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onalloc local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 + call $~lib/rt/tlsf/__free + end + local.get $0 + global.set $~lib/rt/pure/ROOTS + local.get $0 + local.get $2 + i32.add + global.set $~lib/rt/pure/CUR + local.get $0 + local.get $3 + i32.add + global.set $~lib/rt/pure/END + ) + (func $~lib/rt/pure/appendRoot (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/pure/CUR + local.tee $1 + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 4 + i32.add + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/decrement (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.tee $2 + i32.const 268435455 + i32.and + local.set $1 + local.get $0 + call $~lib/rt/rtrace/ondecrement + local.get $0 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 232 + i32.const 115 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 1 + i32.eq + if local.get $0 - i32.const 1 + i32.const 16 i32.add - local.tee $0 - local.get $1 i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 + call $~lib/rt/__visit_members + local.get $2 + i32.const -2147483648 + i32.and + if + local.get $0 + i32.const -2147483648 + i32.store offset=4 + else + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + else + local.get $1 + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 232 + i32.const 124 + i32.const 15 + call $~lib/builtins/abort + unreachable + end local.get $0 - i32.const 1 - i32.add - local.tee $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 16 + i32.and + if + local.get $0 + local.get $1 + i32.const 1 + i32.sub + local.get $2 + i32.const -268435456 + i32.and + i32.or + i32.store offset=4 + else + local.get $0 + local.get $1 + i32.const 1 + i32.sub + i32.const -1342177280 + i32.or + i32.store offset=4 + local.get $2 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/appendRoot + end + end + end + ) + (func $~lib/rt/pure/__release (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + i32.const 7460 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + end + ) + (func $~lib/arraybuffer/ArrayBufferView#constructor (; 26 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $1 + i32.const 1073741808 + local.get $2 + i32.shr_u + i32.gt_u + if + i32.const 24 + i32.const 72 + i32.const 14 + i32.const 56 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.shl + local.tee $2 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $1 + local.get $0 + i32.eqz + if + i32.const 12 + i32.const 2 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.load + local.tee $3 + local.get $1 + i32.ne + if local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 + call $~lib/rt/pure/__retain + drop + local.get $3 + call $~lib/rt/pure/__release + end + local.get $0 + local.get $1 + i32.store + local.get $0 + local.get $1 + i32.store offset=4 + local.get $0 + local.get $2 + i32.store offset=8 + local.get $0 + ) + (func $~lib/array/Array#constructor (; 27 ;) (type $FUNCSIG$i) (result i32) + (local $0 i32) + i32.const 16 + i32.const 3 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + i32.const 0 + i32.const 2 + call $~lib/arraybuffer/ArrayBufferView#constructor + local.tee $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + ) + (func $~lib/array/Array.isArray<~lib/array/Array | null> (; 28 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $0 + call $~lib/rt/pure/__release + local.get $0 + i32.const 0 + i32.ne + ) + (func $~lib/array/Array.isArray (; 29 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $0 + call $~lib/rt/pure/__release + i32.const 0 + ) + (func $~lib/rt/__allocArray (; 30 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + i32.const 16 + local.get $2 + call $~lib/rt/tlsf/__alloc + local.tee $2 + local.get $0 + local.get $1 + i32.shl + local.tee $1 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.tee $4 + call $~lib/rt/pure/__retain + i32.store + local.get $2 + local.get $4 + i32.store offset=4 + local.get $2 + local.get $1 + i32.store offset=8 + local.get $2 + local.get $0 + i32.store offset=12 + local.get $3 + if + local.get $4 + local.get $3 + local.get $1 + call $~lib/memory/memory.copy + end + local.get $2 + ) + (func $~lib/memory/memory.fill (; 31 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i64) + block $~lib/util/memory/memset|inlined.0 + local.get $2 + i32.eqz + br_if $~lib/util/memory/memset|inlined.0 local.get $0 - i32.const 1 - i32.add - local.tee $0 local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u i32.store8 local.get $0 - i32.const 1 + local.get $2 i32.add - local.tee $0 - local.get $1 i32.const 1 - i32.add - local.tee $1 - i32.load8_u + i32.sub + local.get $1 i32.store8 + local.get $2 + i32.const 2 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 local.get $0 i32.const 1 i32.add - local.tee $0 local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u i32.store8 local.get $0 - i32.const 1 + i32.const 2 i32.add - local.tee $0 local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u i32.store8 local.get $0 - i32.const 1 + local.get $2 i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 + local.tee $3 + i32.const 2 + i32.sub local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 + local.get $3 + i32.const 3 + i32.sub local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u i32.store8 + local.get $2 + i32.const 6 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 local.get $0 - i32.const 1 + i32.const 3 i32.add - local.tee $0 local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u i32.store8 local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 + local.get $2 i32.add - local.set $0 + i32.const 4 + i32.sub local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u i32.store8 - end - local.get $2 - i32.const 8 - i32.and - if + local.get $2 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $2 + i32.const 0 local.get $0 - local.get $1 - i32.load8_u - i32.store8 + i32.sub + i32.const 3 + i32.and + local.tee $2 + i32.sub + local.set $3 local.get $0 - i32.const 1 + local.get $2 i32.add - local.tee $0 + local.tee $2 local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add + i32.const 255 + i32.and + i32.const 16843009 + i32.mul local.tee $0 - local.get $1 - i32.const 1 + i32.store + local.get $3 + i32.const -4 + i32.and + local.tee $3 + local.get $2 i32.add - local.tee $1 - i32.load8_u - i32.store8 + i32.const 4 + i32.sub local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 + i32.store + local.get $3 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $2 + i32.const 4 i32.add - local.tee $1 - i32.load8_u - i32.store8 local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 + i32.store + local.get $2 + i32.const 8 i32.add - local.tee $1 - i32.load8_u - i32.store8 local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 + i32.store + local.get $2 + local.get $3 i32.add local.tee $1 - i32.load8_u - i32.store8 + i32.const 12 + i32.sub local.get $0 - i32.const 1 - i32.add - local.tee $0 + i32.store local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 + i32.const 8 + i32.sub local.get $0 - i32.const 1 + i32.store + local.get $3 + i32.const 24 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $2 + i32.const 12 i32.add - local.tee $3 - i32.const 1 + local.get $0 + i32.store + local.get $2 + i32.const 16 i32.add - local.set $0 - local.get $1 - i32.const 1 + local.get $0 + i32.store + local.get $2 + i32.const 20 i32.add - local.tee $4 - i32.const 1 + local.get $0 + i32.store + local.get $2 + i32.const 24 i32.add - local.set $1 + local.get $0 + i32.store + local.get $2 local.get $3 - local.get $4 - i32.load8_u - i32.store8 - end - local.get $2 - i32.const 4 - i32.and - if + i32.add + local.tee $1 + i32.const 28 + i32.sub local.get $0 + i32.store local.get $1 - i32.load8_u - i32.store8 + i32.const 24 + i32.sub local.get $0 - i32.const 1 - i32.add - local.tee $0 + i32.store local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 + i32.const 20 + i32.sub local.get $0 - i32.const 1 - i32.add - local.tee $0 + i32.store local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 + i32.const 16 + i32.sub local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 + i32.store + local.get $2 + local.get $2 + i32.const 4 + i32.and + i32.const 24 i32.add - local.tee $4 - i32.const 1 + local.tee $2 i32.add local.set $1 local.get $3 - local.get $4 - i32.load8_u - i32.store8 - end - local.get $2 - i32.const 2 - i32.and - if + local.get $2 + i32.sub + local.set $2 local.get $0 - local.get $1 - i32.load8_u - i32.store8 + i64.extend_i32_u local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - end - local.get $2 - i32.const 1 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 + i64.extend_i32_u + i64.const 32 + i64.shl + i64.or + local.set $4 + loop $continue|0 + local.get $2 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $4 + i64.store + local.get $1 + i32.const 8 + i32.add + local.get $4 + i64.store + local.get $1 + i32.const 16 + i32.add + local.get $4 + i64.store + local.get $1 + i32.const 24 + i32.add + local.get $4 + i64.store + local.get $2 + i32.const 32 + i32.sub + local.set $2 + local.get $1 + i32.const 32 + i32.add + local.set $1 + br $continue|0 + end + end end ) - (func $~lib/internal/memory/memmove (; 14 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) + (func $~lib/array/Array#fill (; 32 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) + (local $5 i32) local.get $0 - local.get $1 - i32.eq - if - return - end - local.get $1 - local.get $2 - i32.add + i32.load offset=4 + local.set $5 local.get $0 - i32.le_u - local.tee $3 - i32.eqz - if - local.get $0 + i32.load offset=12 + local.set $4 + local.get $2 + i32.const 0 + i32.lt_s + if (result i32) local.get $2 + local.get $4 i32.add - local.get $1 - i32.le_u - local.set $3 + local.tee $2 + i32.const 0 + local.get $2 + i32.const 0 + i32.gt_s + select + else + local.get $2 + local.get $4 + local.get $2 + local.get $4 + i32.lt_s + select end + local.tee $2 local.get $3 + i32.const 0 + i32.lt_s + if (result i32) + local.get $3 + local.get $4 + i32.add + local.tee $3 + i32.const 0 + local.get $3 + i32.const 0 + i32.gt_s + select + else + local.get $3 + local.get $4 + local.get $3 + local.get $4 + i32.lt_s + select + end + local.tee $3 + i32.lt_s if - local.get $0 + local.get $2 + local.get $5 + i32.add local.get $1 + local.get $3 local.get $2 - call $~lib/internal/memory/memcpy - return + i32.sub + call $~lib/memory/memory.fill end local.get $0 + call $~lib/rt/pure/__retain + ) + (func $~lib/array/Array#__get (; 33 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 - i32.lt_u + local.get $0 + i32.load offset=8 + i32.ge_u if - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and - i32.eq - if - loop $continue|0 - local.get $0 - i32.const 7 - i32.and - if - local.get $2 - i32.eqz - if - return - end - local.get $2 - i32.const 1 - i32.sub - local.set $2 - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - br $continue|0 - end - end - loop $continue|1 + i32.const 280 + i32.const 488 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + local.get $1 + i32.add + i32.load8_u + ) + (func $std/array/isArraysEqual (; 34 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__retain + drop + block $folding-inner1 + block $folding-inner0 + local.get $0 + i32.load offset=12 + local.tee $3 + local.get $1 + i32.load offset=12 + i32.ne + br_if $folding-inner0 + local.get $0 + local.get $1 + i32.eq + br_if $folding-inner1 + loop $repeat|0 local.get $2 - i32.const 8 - i32.ge_u + local.get $3 + i32.lt_s if local.get $0 - local.get $1 - i64.load - i64.store local.get $2 - i32.const 8 - i32.sub - local.set $2 - local.get $0 - i32.const 8 - i32.add - local.set $0 + call $~lib/array/Array#__get local.get $1 - i32.const 8 - i32.add - local.set $1 - br $continue|1 - end - end - end - loop $continue|2 - local.get $2 - if - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - br $continue|2 - end - end - else - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and - i32.eq - if - loop $continue|3 - local.get $0 - local.get $2 - i32.add - i32.const 7 - i32.and - if local.get $2 - i32.eqz - if - return - end + call $~lib/array/Array#__get + i32.ne + br_if $folding-inner0 local.get $2 i32.const 1 - i32.sub - local.tee $2 - local.get $0 i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 - br $continue|3 + local.set $2 + br $repeat|0 end end - loop $continue|4 - local.get $2 - i32.const 8 - i32.ge_u - if - local.get $2 - i32.const 8 - i32.sub - local.tee $2 - local.get $0 - i32.add - local.get $1 - local.get $2 - i32.add - i64.load - i64.store - br $continue|4 - end - end - end - loop $continue|5 - local.get $2 - if - local.get $2 - i32.const 1 - i32.sub - local.tee $2 - local.get $0 - i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 - br $continue|5 - end - end - end - ) - (func $~lib/internal/arraybuffer/reallocateUnsafe (; 15 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - local.get $1 - local.get $0 - i32.load - local.tee $2 - i32.gt_s - if - local.get $1 - i32.const 1073741816 - i32.gt_s - if - i32.const 0 - i32.const 40 - i32.const 40 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $1 - i32.const 1 - i32.const 32 - local.get $2 - i32.const 7 - i32.add - i32.clz - i32.sub - i32.shl - i32.const 8 - i32.sub - i32.le_s - if - local.get $0 - local.get $1 - i32.store - else - local.get $1 - call $~lib/internal/arraybuffer/allocateUnsafe - local.tee $3 - i32.const 8 - i32.add - local.get $0 - i32.const 8 - i32.add - local.get $2 - call $~lib/internal/memory/memmove - local.get $3 - local.set $0 + br $folding-inner1 end local.get $0 - i32.const 8 - i32.add - local.get $2 - i32.add - i32.const 0 - local.get $1 - local.get $2 - i32.sub - call $~lib/internal/memory/memset - else + call $~lib/rt/pure/__release local.get $1 - local.get $2 - i32.lt_s - if - local.get $1 - i32.const 0 - i32.lt_s - if - i32.const 0 - i32.const 40 - i32.const 62 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.store - end - end - local.get $0 - ) - (func $~lib/array/Array#push (; 16 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - local.get $0 - i32.load offset=4 - local.tee $2 - i32.const 1 - i32.add - local.set $4 - local.get $2 - local.get $0 - i32.load - local.tee $3 - i32.load - i32.const 2 - i32.shr_u - i32.ge_u - if - local.get $2 - i32.const 268435454 - i32.ge_u - if - i32.const 0 - i32.const 8 - i32.const 182 - i32.const 42 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $3 - local.get $4 - i32.const 2 - i32.shl - call $~lib/internal/arraybuffer/reallocateUnsafe - local.tee $3 - i32.store - end - local.get $0 - local.get $4 - i32.store offset=4 - local.get $2 - i32.const 2 - i32.shl - local.get $3 - i32.add - local.get $1 - i32.store offset=8 - ) - (func $~lib/array/Array#pop (; 17 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - local.get $0 - i32.load offset=4 - local.tee $1 - i32.const 1 - i32.lt_s - if + call $~lib/rt/pure/__release i32.const 0 - i32.const 8 - i32.const 244 - i32.const 20 - call $~lib/env/abort - unreachable + return end local.get $0 - i32.load + call $~lib/rt/pure/__release local.get $1 + call $~lib/rt/pure/__release i32.const 1 - i32.sub - local.tee $1 - i32.const 2 - i32.shl - i32.add - i32.load offset=8 - local.set $2 - local.get $0 - local.get $1 - i32.store offset=4 - local.get $2 - ) - (func $~lib/array/Array#concat (; 18 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - local.get $0 - i32.load offset=4 - local.tee $2 - local.get $1 - i32.load offset=4 - i32.const 0 - local.get $1 - select - local.tee $4 - i32.add - call $~lib/array/Array#constructor - local.set $3 - local.get $2 - if - local.get $3 - i32.load - i32.const 8 - i32.add - local.get $0 - i32.load - i32.const 8 - i32.add - local.get $2 - i32.const 2 - i32.shl - call $~lib/internal/memory/memmove - end - local.get $4 - if - local.get $3 - i32.load - i32.const 8 - i32.add - local.get $2 - i32.const 2 - i32.shl - i32.add - local.get $1 - i32.load - i32.const 8 - i32.add - local.get $4 - i32.const 2 - i32.shl - call $~lib/internal/memory/memmove - end - local.get $3 ) - (func $~lib/array/Array#copyWithin (; 19 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/array/Array#fill (; 35 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) local.get $0 - i32.load + i32.load offset=4 local.set $5 - local.get $3 local.get $0 - i32.load offset=4 - local.tee $4 - local.get $3 - local.get $4 - i32.lt_s - select - local.set $3 - local.get $1 - i32.const 0 - i32.lt_s - if (result i32) - local.get $1 - local.get $4 - i32.add - local.tee $1 - i32.const 0 - local.get $1 - i32.const 0 - i32.gt_s - select - else - local.get $1 - local.get $4 - local.get $1 - local.get $4 - i32.lt_s - select - end - local.set $1 + i32.load offset=12 + local.set $4 local.get $2 i32.const 0 i32.lt_s @@ -2481,523 +2253,895 @@ i32.lt_s select end - local.get $2 - i32.sub - local.tee $3 - local.get $4 - local.get $1 - i32.sub - local.tee $4 - local.get $3 - local.get $4 - i32.lt_s - select - local.set $4 - local.get $2 - local.get $1 - i32.lt_s - local.tee $3 - if - local.get $1 + local.set $3 + loop $repeat|0 local.get $2 - local.get $4 - i32.add - i32.lt_s - local.set $3 + local.get $3 + i32.ge_s + i32.eqz + if + local.get $2 + i32.const 2 + i32.shl + local.get $5 + i32.add + local.get $1 + i32.store + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $repeat|0 + end end - local.get $3 + local.get $0 + call $~lib/rt/pure/__retain + ) + (func $~lib/array/Array#__get (; 36 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ge_u if - local.get $4 - i32.const 1 - i32.sub - local.tee $3 - local.get $2 - i32.add - local.set $2 - local.get $1 - local.get $3 - i32.add - local.set $1 - loop $continue|0 - local.get $4 + i32.const 280 + i32.const 488 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + i32.load + ) + (func $std/array/isArraysEqual (; 37 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__retain + drop + block $folding-inner1 + block $folding-inner0 + local.get $2 + i32.eqz if - local.get $5 + local.get $0 + i32.load offset=12 + local.tee $2 local.get $1 - i32.const 2 - i32.shl - i32.add - local.get $5 - local.get $2 - i32.const 2 - i32.shl - i32.add - i32.load offset=8 - i32.store offset=8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 + i32.load offset=12 + i32.ne + br_if $folding-inner0 + local.get $0 local.get $1 - i32.const 1 - i32.sub - local.set $1 - local.get $4 - i32.const 1 - i32.sub - local.set $4 - br $continue|0 + i32.eq + if + br $folding-inner1 + end + end + loop $repeat|0 + local.get $3 + local.get $2 + i32.lt_s + if + local.get $0 + local.get $3 + call $~lib/array/Array#__get + local.get $1 + local.get $3 + call $~lib/array/Array#__get + i32.ne + br_if $folding-inner0 + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + end end + br $folding-inner1 end - else - local.get $5 - i32.const 8 - i32.add - local.tee $3 + local.get $0 + call $~lib/rt/pure/__release local.get $1 - i32.const 2 - i32.shl - i32.add - local.get $2 - i32.const 2 - i32.shl - local.get $3 - i32.add - local.get $4 - i32.const 2 - i32.shl - call $~lib/internal/memory/memmove + call $~lib/rt/pure/__release + i32.const 0 + return end local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + i32.const 1 ) - (func $~lib/array/Array#copyWithin|trampoline (; 20 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - block $1of1 - block $0of1 - block $outOfRange - global.get $~lib/argc - i32.const 2 - i32.sub - br_table $0of1 $1of1 $outOfRange - end - unreachable - end - i32.const 2147483647 - local.set $3 - end + (func $std/array/internalCapacity (; 38 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.load + call $~lib/rt/pure/__retain + local.tee $1 + i32.const 16 + i32.sub + i32.load offset=12 + local.set $2 local.get $0 + call $~lib/rt/pure/__release local.get $1 + call $~lib/rt/pure/__release local.get $2 - local.get $3 - call $~lib/array/Array#copyWithin + i32.const 2 + i32.shr_s ) - (func $~lib/array/Array#unshift (; 21 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - (local $2 i32) + (func $~lib/rt/tlsf/reallocateBlock (; 39 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) - local.get $0 - i32.load offset=4 - local.tee $3 + (local $6 i32) + local.get $2 + call $~lib/rt/tlsf/prepareSize + local.set $3 + local.get $1 + i32.load + local.tee $4 i32.const 1 - i32.add - local.set $4 + i32.and + if + i32.const 0 + i32.const 128 + i32.const 493 + i32.const 13 + call $~lib/builtins/abort + unreachable + end local.get $3 - local.get $0 + local.get $4 + i32.const -4 + i32.and + i32.le_u + if + local.get $0 + local.get $1 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $1 + local.get $2 + i32.store offset=12 + local.get $1 + return + end + local.get $1 + i32.const 16 + i32.add + local.get $1 i32.load - local.tee $2 + i32.const -4 + i32.and + i32.add + local.tee $6 i32.load - i32.const 2 - i32.shr_u local.tee $5 - i32.ge_u + i32.const 1 + i32.and if + local.get $4 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const -4 + i32.and + i32.add + local.tee $5 local.get $3 - i32.const 268435454 i32.ge_u if - i32.const 0 - i32.const 8 - i32.const 327 - i32.const 42 - call $~lib/env/abort - unreachable + local.get $0 + local.get $6 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $4 + i32.const 3 + i32.and + local.get $5 + i32.or + i32.store + local.get $1 + local.get $2 + i32.store offset=12 + local.get $0 + local.get $1 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $1 + return end - local.get $2 - local.get $4 - i32.const 2 - i32.shl - call $~lib/internal/arraybuffer/reallocateUnsafe - local.tee $2 - i32.load - i32.const 2 - i32.shr_u - local.set $5 - local.get $0 - local.get $2 - i32.store end + local.get $0 local.get $2 - i32.const 8 - i32.add + call $~lib/rt/tlsf/allocateBlock local.tee $3 - i32.const 4 - i32.add + local.get $1 + i32.load offset=4 + i32.store offset=4 local.get $3 - local.get $5 - i32.const 1 - i32.sub - i32.const 2 - i32.shl - call $~lib/internal/memory/memmove - local.get $2 local.get $1 + i32.load offset=8 i32.store offset=8 - local.get $0 + local.get $3 + i32.const 16 + i32.add + local.get $1 + i32.const 16 + i32.add + local.get $2 + call $~lib/memory/memory.copy + local.get $1 local.get $4 - i32.store offset=4 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $3 ) - (func $~lib/array/Array#shift (; 22 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) + (func $~lib/rt/tlsf/__realloc (; 40 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 553 + i32.const 13 + call $~lib/builtins/abort + unreachable + end local.get $0 - i32.load offset=4 - local.tee $1 - i32.const 1 - i32.lt_s + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $0 + select + i32.eqz if i32.const 0 - i32.const 8 - i32.const 299 - i32.const 20 - call $~lib/env/abort + i32.const 128 + i32.const 554 + i32.const 2 + call $~lib/builtins/abort unreachable end + global.get $~lib/rt/tlsf/ROOT local.get $0 - i32.load - local.tee $2 - i32.load offset=8 - local.set $3 - local.get $2 - i32.const 8 - i32.add - local.tee $4 - i32.const 4 - i32.add - local.set $5 - local.get $4 - local.get $5 - local.get $1 - i32.const 1 + i32.const 16 i32.sub - local.tee $1 - i32.const 2 - i32.shl - call $~lib/internal/memory/memmove - local.get $2 local.get $1 - i32.const 2 - i32.shl + call $~lib/rt/tlsf/reallocateBlock + i32.const 16 i32.add - i32.const 0 - i32.store offset=8 - local.get $0 - local.get $1 - i32.store offset=4 - local.get $3 ) - (func $~lib/array/Array#reverse (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) + (func $~lib/array/ensureSize (; 41 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) + local.get $1 local.get $0 - i32.load - local.set $3 - local.get $0 - i32.load offset=4 - i32.const 1 - i32.sub - local.set $0 - loop $repeat|0 + i32.load offset=8 + local.tee $2 + i32.const 2 + i32.shr_u + i32.gt_u + if local.get $1 + i32.const 268435452 + i32.gt_u + if + i32.const 24 + i32.const 488 + i32.const 14 + i32.const 47 + call $~lib/builtins/abort + unreachable + end local.get $0 - i32.lt_s + i32.load + local.tee $4 + local.get $1 + i32.const 2 + i32.shl + local.tee $3 + call $~lib/rt/tlsf/__realloc + local.tee $1 + local.get $2 + i32.add + i32.const 0 + local.get $3 + local.get $2 + i32.sub + call $~lib/memory/memory.fill + local.get $1 + local.get $4 + i32.ne if - local.get $1 - i32.const 2 - i32.shl - local.get $3 - i32.add - local.tee $2 - i32.load offset=8 - local.set $4 - local.get $2 local.get $0 - i32.const 2 - i32.shl - local.get $3 - i32.add - local.tee $2 - i32.load offset=8 - i32.store offset=8 - local.get $2 - local.get $4 - i32.store offset=8 local.get $1 - i32.const 1 - i32.add - local.set $1 + call $~lib/rt/pure/__retain + i32.store local.get $0 - i32.const 1 - i32.sub - local.set $0 - br $repeat|0 + local.get $1 + i32.store offset=4 end + local.get $0 + local.get $3 + i32.store offset=8 end ) - (func $~lib/array/Array#indexOf (; 24 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#push (; 42 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) (local $3 i32) - (local $4 i32) local.get $0 - i32.load offset=4 + local.get $0 + i32.load offset=12 + local.tee $2 + i32.const 1 + i32.add local.tee $3 - i32.eqz - local.tee $4 - i32.eqz - if - local.get $2 - local.get $3 - i32.ge_s - local.set $4 - end - local.get $4 - if - i32.const -1 - return - end + call $~lib/array/ensureSize + local.get $0 + i32.load offset=4 local.get $2 - i32.const 0 + i32.const 2 + i32.shl + i32.add + local.get $1 + i32.store + local.get $0 + local.get $3 + i32.store offset=12 + ) + (func $~lib/array/Array#pop (; 43 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=12 + local.tee $1 + i32.const 1 i32.lt_s if - local.get $2 - local.get $3 - i32.add - local.tee $2 - i32.const 0 - local.get $2 - i32.const 0 - i32.gt_s - select - local.set $2 + i32.const 872 + i32.const 488 + i32.const 287 + i32.const 20 + call $~lib/builtins/abort + unreachable end local.get $0 + i32.load offset=4 + local.get $1 + i32.const 1 + i32.sub + local.tee $1 + i32.const 2 + i32.shl + i32.add i32.load - local.set $0 - loop $continue|0 - local.get $2 - local.get $3 - i32.lt_s - if - local.get $0 - local.get $2 - i32.const 2 - i32.shl - i32.add - i32.load offset=8 - local.get $1 - i32.eq - if - local.get $2 - return - end - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $continue|0 - end - end - i32.const -1 + local.set $2 + local.get $0 + local.get $1 + i32.store offset=12 + local.get $2 ) - (func $~lib/array/Array#splice (; 25 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#concat (; 44 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) - local.get $0 - i32.load - local.set $5 - local.get $2 + local.get $1 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.load offset=4 + i32.load offset=12 local.tee $3 local.get $1 + i32.load offset=12 i32.const 0 - i32.lt_s - if (result i32) - local.get $1 - local.get $3 - i32.add - local.tee $1 - i32.const 0 - local.get $1 - i32.const 0 - i32.gt_s - select - else - local.get $1 - local.get $3 + local.get $1 + select + local.tee $4 + i32.add + local.tee $2 + i32.const 268435452 + i32.gt_u + if local.get $1 - local.get $3 - i32.lt_s - select + call $~lib/rt/pure/__release + i32.const 24 + i32.const 488 + i32.const 217 + i32.const 59 + call $~lib/builtins/abort + unreachable end - local.tee $1 - i32.sub - local.tee $4 - local.get $2 - local.get $4 - i32.lt_s - select - local.tee $2 - i32.const 0 local.get $2 + i32.const 2 + i32.const 3 i32.const 0 - i32.gt_s - select + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain local.tee $2 - call $~lib/array/Array#constructor - local.tee $4 - i32.load - i32.const 8 - i32.add + i32.load offset=4 + local.tee $5 + local.get $0 + i32.load offset=4 + local.get $3 + i32.const 2 + i32.shl + local.tee $0 + call $~lib/memory/memory.copy + local.get $0 local.get $5 - i32.const 8 i32.add local.get $1 + i32.load offset=4 + local.get $4 i32.const 2 i32.shl - i32.add - local.tee $6 + call $~lib/memory/memory.copy + local.get $1 + call $~lib/rt/pure/__release local.get $2 + ) + (func $~lib/array/Array#copyWithin (; 45 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + (local $5 i32) + local.get $3 + local.get $0 + i32.load offset=12 + local.tee $4 + local.get $3 + local.get $4 + i32.lt_s + select + local.set $3 + local.get $0 + i32.load offset=4 + local.tee $5 + local.get $1 + i32.const 0 + i32.lt_s + if (result i32) + local.get $1 + local.get $4 + i32.add + local.tee $1 + i32.const 0 + local.get $1 + i32.const 0 + i32.gt_s + select + else + local.get $1 + local.get $4 + local.get $1 + local.get $4 + i32.lt_s + select + end + local.tee $1 i32.const 2 i32.shl - call $~lib/internal/memory/memmove - local.get $1 + i32.add local.get $2 + i32.const 0 + i32.lt_s + if (result i32) + local.get $2 + local.get $4 + i32.add + local.tee $2 + i32.const 0 + local.get $2 + i32.const 0 + i32.gt_s + select + else + local.get $2 + local.get $4 + local.get $2 + local.get $4 + i32.lt_s + select + end + local.tee $2 + i32.const 2 + i32.shl + local.get $5 i32.add - local.tee $1 local.get $3 - i32.ne - if - local.get $6 - local.get $5 - i32.const 8 - i32.add - local.get $1 - i32.const 2 - i32.shl + i32.const 0 + i32.lt_s + if (result i32) + local.get $3 + local.get $4 i32.add + local.tee $3 + i32.const 0 local.get $3 - local.get $1 - i32.sub - i32.const 2 - i32.shl - call $~lib/internal/memory/memmove + i32.const 0 + i32.gt_s + select + else + local.get $3 + local.get $4 + local.get $3 + local.get $4 + i32.lt_s + select end - local.get $0 - local.get $3 local.get $2 i32.sub - i32.store offset=4 + local.tee $2 local.get $4 + local.get $1 + i32.sub + local.tee $1 + local.get $2 + local.get $1 + i32.lt_s + select + i32.const 2 + i32.shl + call $~lib/memory/memory.copy + local.get $0 + call $~lib/rt/pure/__retain ) - (func $~lib/array/Array#splice|trampoline (; 26 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#unshift (; 46 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) - block $1of1 - block $0of1 - block $outOfRange - global.get $~lib/argc - i32.const 1 - i32.sub - br_table $0of1 $1of1 $outOfRange - end - unreachable - end - i32.const 2147483647 - local.set $2 - end + (local $3 i32) + local.get $0 + local.get $0 + i32.load offset=12 + i32.const 1 + i32.add + local.tee $2 + call $~lib/array/ensureSize local.get $0 + i32.load offset=4 + local.tee $3 + i32.const 4 + i32.add + local.get $3 + local.get $2 + i32.const 1 + i32.sub + i32.const 2 + i32.shl + call $~lib/memory/memory.copy + local.get $3 local.get $1 + i32.store + local.get $0 local.get $2 - call $~lib/array/Array#splice + i32.store offset=12 ) - (func $~lib/array/Array#__set (; 27 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array#shift (; 47 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) (local $3 i32) (local $4 i32) - local.get $1 local.get $0 - i32.load - local.tee $3 - i32.load - i32.const 2 - i32.shr_u - i32.ge_u + i32.load offset=12 + local.tee $1 + i32.const 1 + i32.lt_s if - local.get $1 - i32.const 268435454 - i32.ge_u - if - i32.const 0 - i32.const 8 - i32.const 107 - i32.const 41 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $3 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 2 - i32.shl - call $~lib/internal/arraybuffer/reallocateUnsafe - local.tee $3 - i32.store - local.get $0 - local.get $4 - i32.store offset=4 + i32.const 872 + i32.const 488 + i32.const 348 + i32.const 20 + call $~lib/builtins/abort + unreachable end - local.get $3 + local.get $0 + i32.load offset=4 + local.tee $2 + i32.load + local.set $3 + local.get $2 + local.get $2 + i32.const 4 + i32.add local.get $1 + i32.const 1 + i32.sub + local.tee $1 i32.const 2 i32.shl - i32.add + local.tee $4 + call $~lib/memory/memory.copy local.get $2 - i32.store offset=8 - ) - (func $start:std/array~anonymous|0 (; 28 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $4 + i32.add + i32.const 0 + i32.store local.get $0 - i32.eqz + local.get $1 + i32.store offset=12 + local.get $3 ) - (func $~lib/array/Array#findIndex (; 29 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#reverse (; 48 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) (local $2 i32) (local $3 i32) - (local $4 i32) local.get $0 - i32.load offset=4 - local.set $3 - loop $repeat|0 - block $break|0 + i32.load offset=12 + local.tee $1 + if + local.get $0 + i32.load offset=4 + local.set $2 + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 1 + i32.sub + i32.const 2 + i32.shl + i32.add + local.set $1 + loop $continue|0 + local.get $2 + local.get $1 + i32.lt_u + if + local.get $2 + i32.load + local.set $3 + local.get $2 + local.get $1 + i32.load + i32.store + local.get $1 + local.get $3 + i32.store + local.get $2 + i32.const 4 + i32.add + local.set $2 + local.get $1 + i32.const 4 + i32.sub + local.set $1 + br $continue|0 + end + end + end + local.get $0 + call $~lib/rt/pure/__retain + ) + (func $~lib/array/Array#indexOf (; 49 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $0 + i32.load offset=12 + local.tee $3 + if (result i32) + local.get $2 + local.get $3 + i32.ge_s + else + i32.const 1 + end + if + i32.const -1 + return + end + local.get $2 + i32.const 0 + i32.lt_s + if + local.get $2 + local.get $3 + i32.add + local.tee $2 + i32.const 0 + local.get $2 + i32.const 0 + i32.gt_s + select + local.set $2 + end + local.get $0 + i32.load offset=4 + local.set $0 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_s + if + local.get $2 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load + local.get $1 + i32.eq + if + local.get $2 + return + end + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $continue|0 + end + end + i32.const -1 + ) + (func $~lib/array/Array#includes (; 50 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $0 + local.get $1 + local.get $2 + call $~lib/array/Array#indexOf + i32.const 0 + i32.ge_s + ) + (func $~lib/array/Array#splice (; 51 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $2 + local.get $0 + i32.load offset=12 + local.tee $3 + local.get $1 + i32.const 0 + i32.lt_s + if (result i32) + local.get $1 + local.get $3 + i32.add + local.tee $1 + i32.const 0 + local.get $1 + i32.const 0 + i32.gt_s + select + else + local.get $1 + local.get $3 + local.get $1 + local.get $3 + i32.lt_s + select + end + local.tee $1 + i32.sub + local.tee $4 + local.get $2 + local.get $4 + i32.lt_s + select + local.tee $2 + i32.const 0 + local.get $2 + i32.const 0 + i32.gt_s + select + local.tee $2 + i32.const 2 + i32.const 3 + i32.const 0 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $4 + i32.load offset=4 + local.get $0 + i32.load offset=4 + local.tee $5 + local.get $1 + i32.const 2 + i32.shl + i32.add + local.tee $6 + local.get $2 + i32.const 2 + i32.shl + call $~lib/memory/memory.copy + local.get $1 + local.get $2 + i32.add + local.tee $1 + local.get $3 + i32.ne + if + local.get $6 + local.get $1 + i32.const 2 + i32.shl + local.get $5 + i32.add + local.get $3 + local.get $1 + i32.sub + i32.const 2 + i32.shl + call $~lib/memory/memory.copy + end + local.get $0 + local.get $3 + local.get $2 + i32.sub + i32.store offset=12 + local.get $4 + ) + (func $~lib/array/Array#__set (; 52 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + local.get $0 + i32.load offset=12 + local.set $3 + local.get $0 + local.get $1 + i32.const 1 + i32.add + call $~lib/array/ensureSize + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + local.get $2 + i32.store + local.get $1 + local.get $3 + i32.ge_s + if + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=12 + end + ) + (func $start:std/array~anonymous|0 (; 53 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + i32.eqz + ) + (func $~lib/array/Array#findIndex (; 54 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=12 + local.set $3 + loop $repeat|0 + block $break|0 local.get $2 local.get $3 local.get $0 - i32.load offset=4 + i32.load offset=12 local.tee $4 local.get $3 local.get $4 @@ -3008,12 +3152,12 @@ i32.const 3 global.set $~lib/argc local.get $0 - i32.load + i32.load offset=4 local.get $2 i32.const 2 i32.shl i32.add - i32.load offset=8 + i32.load local.get $2 local.get $0 local.get $1 @@ -3033,50 +3177,75 @@ end i32.const -1 ) - (func $start:std/array~anonymous|1 (; 30 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|1 (; 55 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 i32.const 1 i32.eq ) - (func $start:std/array~anonymous|2 (; 31 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|2 (; 56 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 i32.const 100 i32.eq ) - (func $start:std/array~anonymous|3 (; 32 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|3 (; 57 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $2 i32.const 100 call $~lib/array/Array#push + local.get $2 + call $~lib/rt/pure/__release local.get $0 i32.const 100 i32.eq ) - (func $start:std/array~anonymous|5 (; 33 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|5 (; 58 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $2 call $~lib/array/Array#pop drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 i32.const 100 i32.eq ) - (func $start:std/array~anonymous|6 (; 34 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|6 (; 59 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 i32.const 0 i32.ge_s ) - (func $~lib/array/Array#every (; 35 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#every (; 60 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) local.get $0 - i32.load offset=4 + i32.load offset=12 local.set $3 loop $repeat|0 block $break|0 local.get $2 local.get $3 local.get $0 - i32.load offset=4 + i32.load offset=12 local.tee $4 local.get $3 local.get $4 @@ -3087,12 +3256,12 @@ i32.const 3 global.set $~lib/argc local.get $0 - i32.load + i32.load offset=4 local.get $2 i32.const 2 i32.shl i32.add - i32.load offset=8 + i32.load local.get $2 local.get $0 local.get $1 @@ -3112,50 +3281,75 @@ end i32.const 1 ) - (func $start:std/array~anonymous|7 (; 36 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|7 (; 61 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 i32.const 0 i32.le_s ) - (func $start:std/array~anonymous|8 (; 37 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|8 (; 62 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $2 i32.const 100 call $~lib/array/Array#push + local.get $2 + call $~lib/rt/pure/__release local.get $0 i32.const 10 i32.lt_s ) - (func $start:std/array~anonymous|9 (; 38 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|9 (; 63 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 i32.const 10 i32.lt_s ) - (func $start:std/array~anonymous|10 (; 39 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|10 (; 64 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $2 call $~lib/array/Array#pop drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 i32.const 3 i32.lt_s ) - (func $start:std/array~anonymous|11 (; 40 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|11 (; 65 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 i32.const 3 i32.ge_s ) - (func $~lib/array/Array#some (; 41 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#some (; 66 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) local.get $0 - i32.load offset=4 + i32.load offset=12 local.set $3 loop $repeat|0 block $break|0 local.get $2 local.get $3 local.get $0 - i32.load offset=4 + i32.load offset=12 local.tee $4 local.get $3 local.get $4 @@ -3166,12 +3360,12 @@ i32.const 3 global.set $~lib/argc local.get $0 - i32.load + i32.load offset=4 local.get $2 i32.const 2 i32.shl i32.add - i32.load offset=8 + i32.load local.get $2 local.get $0 local.get $1 @@ -3191,51 +3385,76 @@ end i32.const 0 ) - (func $start:std/array~anonymous|12 (; 42 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|12 (; 67 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 i32.const -1 i32.le_s ) - (func $start:std/array~anonymous|13 (; 43 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|13 (; 68 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $2 i32.const 100 call $~lib/array/Array#push + local.get $2 + call $~lib/rt/pure/__release local.get $0 i32.const 10 i32.gt_s ) - (func $start:std/array~anonymous|14 (; 44 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|14 (; 69 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 i32.const 10 i32.gt_s ) - (func $start:std/array~anonymous|15 (; 45 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|15 (; 70 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $2 call $~lib/array/Array#pop drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 i32.const 3 i32.gt_s ) - (func $start:std/array~anonymous|16 (; 46 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start:std/array~anonymous|16 (; 71 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop global.get $std/array/i local.get $0 i32.add global.set $std/array/i + local.get $2 + call $~lib/rt/pure/__release ) - (func $~lib/array/Array#forEach (; 47 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/array/Array#forEach (; 72 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) block $break|0 local.get $0 - i32.load offset=4 + i32.load offset=12 local.set $3 loop $repeat|0 local.get $2 local.get $3 local.get $0 - i32.load offset=4 + i32.load offset=12 local.tee $4 local.get $3 local.get $4 @@ -3246,12 +3465,12 @@ i32.const 3 global.set $~lib/argc local.get $0 - i32.load + i32.load offset=4 local.get $2 i32.const 2 i32.shl i32.add - i32.load offset=8 + i32.load local.get $2 local.get $0 local.get $1 @@ -3266,7 +3485,10 @@ unreachable end ) - (func $start:std/array~anonymous|17 (; 48 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start:std/array~anonymous|17 (; 73 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $2 i32.const 100 call $~lib/array/Array#push @@ -3274,8 +3496,13 @@ local.get $0 i32.add global.set $std/array/i + local.get $2 + call $~lib/rt/pure/__release ) - (func $start:std/array~anonymous|19 (; 49 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start:std/array~anonymous|19 (; 74 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $2 call $~lib/array/Array#pop drop @@ -3283,9 +3510,14 @@ local.get $0 i32.add global.set $std/array/i + local.get $2 + call $~lib/rt/pure/__release ) - (func $start:std/array~anonymous|20 (; 50 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start:std/array~anonymous|20 (; 75 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $1 i32.eqz if @@ -3373,36 +3605,48 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 559 - i32.const 4 - call $~lib/env/abort + i32.const 376 + i32.const 568 + i32.const 6 + call $~lib/builtins/abort unreachable end end + local.get $2 + call $~lib/rt/pure/__release ) - (func $start:std/array~anonymous|21 (; 51 ;) (type $FUNCSIG$fiii) (param $0 i32) (param $1 i32) (param $2 i32) (result f32) + (func $start:std/array~anonymous|21 (; 76 ;) (type $FUNCSIG$fiii) (param $0 i32) (param $1 i32) (param $2 i32) (result f32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 f32.convert_i32_s ) - (func $~lib/array/Array#map (; 52 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#map (; 77 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + (local $6 f32) local.get $0 - i32.load offset=4 + i32.load offset=12 local.tee $3 - call $~lib/array/Array#constructor + i32.const 2 + i32.const 8 + i32.const 0 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain local.tee $4 - i32.load + i32.load offset=4 local.set $5 loop $repeat|0 local.get $1 local.get $3 local.get $0 - i32.load offset=4 + i32.load offset=12 local.tee $2 local.get $3 local.get $2 @@ -3416,18 +3660,19 @@ i32.const 2 i32.shl local.tee $2 - local.get $5 - i32.add local.get $0 - i32.load - local.get $2 + i32.load offset=4 i32.add - i32.load offset=8 + i32.load local.get $1 local.get $0 - i32.const 22 - call_indirect (type $FUNCSIG$fiii) - f32.store offset=8 + call $start:std/array~anonymous|21 + local.set $6 + local.get $2 + local.get $5 + i32.add + local.get $6 + f32.store local.get $1 i32.const 1 i32.add @@ -3437,7 +3682,33 @@ end local.get $4 ) - (func $start:std/array~anonymous|22 (; 53 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#__get (; 78 ;) (type $FUNCSIG$fii) (param $0 i32) (param $1 i32) (result f32) + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ge_u + if + i32.const 280 + i32.const 488 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + f32.load + ) + (func $start:std/array~anonymous|22 (; 79 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $2 i32.const 100 call $~lib/array/Array#push @@ -3445,49 +3716,61 @@ local.get $0 i32.add global.set $std/array/i + local.get $2 + call $~lib/rt/pure/__release local.get $0 ) - (func $~lib/array/Array#map (; 54 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/array/Array#map (; 80 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + (local $6 i32) + (local $7 i32) local.get $0 - i32.load offset=4 + i32.load offset=12 local.tee $4 - call $~lib/array/Array#constructor - i32.load - local.set $5 + i32.const 2 + i32.const 3 + i32.const 0 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $5 + i32.load offset=4 + local.set $6 loop $repeat|0 - local.get $2 - local.get $4 - local.get $0 - i32.load offset=4 - local.tee $3 - local.get $4 - local.get $3 - i32.lt_s - select - i32.lt_s - if + block $break|0 + local.get $2 + local.get $4 + local.get $0 + i32.load offset=12 + local.tee $3 + local.get $4 + local.get $3 + i32.lt_s + select + i32.ge_s + br_if $break|0 i32.const 3 global.set $~lib/argc local.get $2 i32.const 2 i32.shl local.tee $3 - local.get $5 - i32.add local.get $0 - i32.load - local.get $3 + i32.load offset=4 i32.add - i32.load offset=8 + i32.load local.get $2 local.get $0 local.get $1 call_indirect (type $FUNCSIG$iiii) - i32.store offset=8 + local.set $7 + local.get $3 + local.get $6 + i32.add + local.get $7 + i32.store local.get $2 i32.const 1 i32.add @@ -3495,15 +3778,24 @@ br $repeat|0 end end + local.get $5 ) - (func $start:std/array~anonymous|23 (; 55 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|23 (; 81 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop global.get $std/array/i local.get $0 i32.add global.set $std/array/i + local.get $2 + call $~lib/rt/pure/__release local.get $0 ) - (func $start:std/array~anonymous|24 (; 56 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|24 (; 82 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $2 call $~lib/array/Array#pop drop @@ -3511,30 +3803,41 @@ local.get $0 i32.add global.set $std/array/i + local.get $2 + call $~lib/rt/pure/__release local.get $0 ) - (func $start:std/array~anonymous|25 (; 57 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|25 (; 83 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 i32.const 2 i32.ge_s ) - (func $~lib/array/Array#filter (; 58 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#filter (; 84 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) i32.const 0 - call $~lib/array/Array#constructor + i32.const 2 + i32.const 3 + i32.const 0 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain local.set $4 local.get $0 - i32.load offset=4 + i32.load offset=12 local.set $5 loop $repeat|0 block $break|0 local.get $2 local.get $5 local.get $0 - i32.load offset=4 + i32.load offset=12 local.tee $3 local.get $5 local.get $3 @@ -3543,12 +3846,12 @@ i32.ge_s br_if $break|0 local.get $0 - i32.load + i32.load offset=4 local.get $2 i32.const 2 i32.shl i32.add - i32.load offset=8 + i32.load local.set $3 i32.const 3 global.set $~lib/argc @@ -3571,7 +3874,10 @@ end local.get $4 ) - (func $start:std/array~anonymous|26 (; 59 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|26 (; 85 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $2 i32.const 100 call $~lib/array/Array#push @@ -3579,20 +3885,30 @@ local.get $0 i32.add global.set $std/array/i + local.get $2 + call $~lib/rt/pure/__release local.get $0 i32.const 2 i32.ge_s ) - (func $start:std/array~anonymous|27 (; 60 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|27 (; 86 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop global.get $std/array/i local.get $0 i32.add global.set $std/array/i + local.get $2 + call $~lib/rt/pure/__release local.get $0 i32.const 2 i32.ge_s ) - (func $start:std/array~anonymous|28 (; 61 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start:std/array~anonymous|28 (; 87 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $2 call $~lib/array/Array#pop drop @@ -3600,28 +3916,35 @@ local.get $0 i32.add global.set $std/array/i + local.get $2 + call $~lib/rt/pure/__release local.get $0 i32.const 2 i32.ge_s ) - (func $start:std/array~anonymous|29 (; 62 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start:std/array~anonymous|29 (; 88 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $3 + call $~lib/rt/pure/__release local.get $0 local.get $1 i32.add ) - (func $~lib/array/Array#reduce (; 63 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#reduce (; 89 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) local.get $0 - i32.load offset=4 + i32.load offset=12 local.set $4 loop $repeat|0 block $break|0 local.get $3 local.get $4 local.get $0 - i32.load offset=4 + i32.load offset=12 local.tee $5 local.get $4 local.get $5 @@ -3633,12 +3956,12 @@ global.set $~lib/argc local.get $2 local.get $0 - i32.load + i32.load offset=4 local.get $3 i32.const 2 i32.shl i32.add - i32.load offset=8 + i32.load local.get $3 local.get $0 local.get $1 @@ -3653,48 +3976,62 @@ end local.get $2 ) - (func $start:std/array~anonymous|31 (; 64 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - local.get $0 - i32.eqz - if - local.get $1 - i32.const 2 - i32.gt_s - local.set $0 - end + (func $start:std/array~anonymous|31 (; 90 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $3 + call $~lib/rt/pure/__release + i32.const 1 + local.get $1 + i32.const 2 + i32.gt_s local.get $0 + select ) - (func $start:std/array~anonymous|32 (; 65 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - local.get $0 - i32.eqz - if - local.get $1 - i32.const 100 - i32.gt_s - local.set $0 - end + (func $start:std/array~anonymous|32 (; 91 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $3 + call $~lib/rt/pure/__release + i32.const 1 + local.get $1 + i32.const 100 + i32.gt_s local.get $0 + select ) - (func $start:std/array~anonymous|33 (; 66 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start:std/array~anonymous|33 (; 92 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + local.get $3 + call $~lib/rt/pure/__retain + drop local.get $3 i32.const 1 call $~lib/array/Array#push + local.get $3 + call $~lib/rt/pure/__release local.get $0 local.get $1 i32.add ) - (func $start:std/array~anonymous|35 (; 67 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start:std/array~anonymous|35 (; 93 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + local.get $3 + call $~lib/rt/pure/__retain + drop local.get $3 call $~lib/array/Array#pop drop + local.get $3 + call $~lib/rt/pure/__release local.get $0 local.get $1 i32.add ) - (func $~lib/array/Array#reduceRight (; 68 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#reduceRight (; 94 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $0 - i32.load offset=4 + i32.load offset=12 i32.const 1 i32.sub local.set $3 @@ -3708,12 +4045,12 @@ global.set $~lib/argc local.get $2 local.get $0 - i32.load + i32.load offset=4 local.get $3 i32.const 2 i32.shl i32.add - i32.load offset=8 + i32.load local.get $3 local.get $0 local.get $1 @@ -3728,7 +4065,28 @@ end local.get $2 ) - (func $~lib/math/splitMix32 (; 69 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/math/murmurHash3 (; 95 ;) (type $FUNCSIG$jj) (param $0 i64) (result i64) + local.get $0 + i64.const 33 + i64.shr_u + local.get $0 + i64.xor + i64.const -49064778989728563 + i64.mul + local.tee $0 + local.get $0 + i64.const 33 + i64.shr_u + i64.xor + i64.const -4265267296055464877 + i64.mul + local.tee $0 + local.get $0 + i64.const 33 + i64.shr_u + i64.xor + ) + (func $~lib/math/splitMix32 (; 96 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 1831565813 i32.add @@ -3760,62 +4118,26 @@ i32.shr_u i32.xor ) - (func $~lib/math/NativeMath.seedRandom (; 70 ;) (type $FUNCSIG$vj) (param $0 i64) - (local $1 i64) + (func $~lib/math/NativeMath.seedRandom (; 97 ;) (type $FUNCSIG$vj) (param $0 i64) local.get $0 i64.eqz if i32.const 0 - i32.const 2896 - i32.const 978 + i32.const 3160 + i32.const 1020 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 global.set $~lib/math/random_seeded local.get $0 - i64.const 33 - i64.shr_u - local.get $0 - i64.xor - i64.const -49064778989728563 - i64.mul - local.tee $1 - local.get $1 - i64.const 33 - i64.shr_u - i64.xor - i64.const -4265267296055464877 - i64.mul - local.tee $1 - local.get $1 - i64.const 33 - i64.shr_u - i64.xor + call $~lib/math/murmurHash3 global.set $~lib/math/random_state0_64 global.get $~lib/math/random_state0_64 i64.const -1 i64.xor - local.tee $1 - local.get $1 - i64.const 33 - i64.shr_u - i64.xor - i64.const -49064778989728563 - i64.mul - local.tee $1 - local.get $1 - i64.const 33 - i64.shr_u - i64.xor - i64.const -4265267296055464877 - i64.mul - local.tee $1 - local.get $1 - i64.const 33 - i64.shr_u - i64.xor + call $~lib/math/murmurHash3 global.set $~lib/math/random_state1_64 local.get $0 i32.wrap_i64 @@ -3825,41 +4147,41 @@ call $~lib/math/splitMix32 global.set $~lib/math/random_state1_32 ) - (func $~lib/internal/sort/insertionSort (; 71 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/insertionSort (; 98 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 f32) (local $6 f32) (local $7 i32) - loop $repeat|0 - local.get $4 - local.get $1 - i32.ge_s - i32.eqz - if - local.get $4 + block $break|0 + loop $repeat|0 + local.get $3 + local.get $1 + i32.ge_s + br_if $break|0 + local.get $3 i32.const 2 i32.shl local.get $0 i32.add - f32.load offset=8 + f32.load local.set $5 - local.get $4 + local.get $3 i32.const 1 i32.sub - local.set $3 + local.set $4 loop $continue|1 - local.get $3 + local.get $4 i32.const 0 i32.ge_s if block $break|1 - local.get $3 + local.get $4 i32.const 2 i32.shl local.get $0 i32.add - f32.load offset=8 + f32.load local.set $6 i32.const 2 global.set $~lib/argc @@ -3870,11 +4192,11 @@ i32.const 0 i32.ge_s br_if $break|1 - local.get $3 + local.get $4 local.tee $7 i32.const 1 i32.sub - local.set $3 + local.set $4 local.get $7 i32.const 1 i32.add @@ -3883,12 +4205,12 @@ local.get $0 i32.add local.get $6 - f32.store offset=8 + f32.store br $continue|1 end end end - local.get $3 + local.get $4 i32.const 1 i32.add i32.const 2 @@ -3896,21 +4218,23 @@ local.get $0 i32.add local.get $5 - f32.store offset=8 - local.get $4 + f32.store + local.get $3 i32.const 1 i32.add - local.set $4 + local.set $3 br $repeat|0 + unreachable end + unreachable end ) - (func $~lib/internal/sort/weakHeapSort (; 72 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/weakHeapSort (; 99 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 f32) - (local $6 f32) - (local $7 i32) + (local $6 i32) + (local $7 f32) (local $8 i32) local.get $1 i32.const 31 @@ -3920,20 +4244,22 @@ i32.const 2 i32.shl local.tee $3 - call $~lib/allocator/arena/__memory_allocate - local.tee $7 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.tee $6 i32.const 0 local.get $3 - call $~lib/internal/memory/memset + call $~lib/memory/memory.fill local.get $1 i32.const 1 i32.sub local.set $4 loop $repeat|0 - local.get $4 - i32.const 0 - i32.gt_s - if + block $break|0 + local.get $4 + i32.const 0 + i32.le_s + br_if $break|0 local.get $4 local.set $3 loop $continue|1 @@ -3945,7 +4271,7 @@ i32.shr_s i32.const 2 i32.shl - local.get $7 + local.get $6 i32.add i32.load local.get $3 @@ -3973,19 +4299,19 @@ i32.shl local.get $0 i32.add - f32.load offset=8 + f32.load local.set $5 local.get $4 i32.const 2 i32.shl local.get $0 i32.add - f32.load offset=8 - local.set $6 + f32.load + local.set $7 i32.const 2 global.set $~lib/argc local.get $5 - local.get $6 + local.get $7 local.get $2 call_indirect (type $FUNCSIG$iff) i32.const 0 @@ -3996,7 +4322,7 @@ i32.shr_s i32.const 2 i32.shl - local.get $7 + local.get $6 i32.add local.tee $8 local.get $8 @@ -4014,14 +4340,14 @@ local.get $0 i32.add local.get $5 - f32.store offset=8 + f32.store local.get $3 i32.const 2 i32.shl local.get $0 i32.add - local.get $6 - f32.store offset=8 + local.get $7 + f32.store end local.get $4 i32.const 1 @@ -4035,12 +4361,13 @@ i32.sub local.set $4 loop $repeat|2 - local.get $4 - i32.const 2 - i32.ge_s - if + block $break|2 + local.get $4 + i32.const 2 + i32.lt_s + br_if $break|2 local.get $0 - f32.load offset=8 + f32.load local.set $5 local.get $0 local.get $4 @@ -4049,97 +4376,97 @@ local.get $0 i32.add local.tee $1 - f32.load offset=8 - f32.store offset=8 + f32.load + f32.store local.get $1 local.get $5 - f32.store offset=8 + f32.store i32.const 1 - local.set $1 + local.set $3 loop $continue|3 - local.get $1 + local.get $3 i32.const 5 i32.shr_s i32.const 2 i32.shl - local.get $7 + local.get $6 i32.add i32.load - local.get $1 + local.get $3 i32.const 31 i32.and i32.shr_u i32.const 1 i32.and - local.get $1 + local.get $3 i32.const 1 i32.shl i32.add - local.tee $3 + local.tee $1 local.get $4 i32.lt_s if - local.get $3 - local.set $1 + local.get $1 + local.set $3 br $continue|3 end end loop $continue|4 - local.get $1 + local.get $3 i32.const 0 i32.gt_s if local.get $0 - f32.load offset=8 + f32.load local.set $5 - local.get $1 + local.get $3 i32.const 2 i32.shl local.get $0 i32.add - f32.load offset=8 - local.set $6 + f32.load + local.set $7 i32.const 2 global.set $~lib/argc local.get $5 - local.get $6 + local.get $7 local.get $2 call_indirect (type $FUNCSIG$iff) i32.const 0 i32.lt_s if - local.get $1 + local.get $3 i32.const 5 i32.shr_s i32.const 2 i32.shl - local.get $7 + local.get $6 i32.add - local.tee $3 - local.get $3 + local.tee $1 + local.get $1 i32.load i32.const 1 - local.get $1 + local.get $3 i32.const 31 i32.and i32.shl i32.xor i32.store - local.get $1 + local.get $3 i32.const 2 i32.shl local.get $0 i32.add local.get $5 - f32.store offset=8 + f32.store local.get $0 - local.get $6 - f32.store offset=8 + local.get $7 + f32.store end - local.get $1 + local.get $3 i32.const 1 i32.shr_s - local.set $1 + local.set $3 br $continue|4 end end @@ -4150,93 +4477,85 @@ br $repeat|2 end end + local.get $6 + call $~lib/rt/tlsf/__free local.get $0 - i32.const 4 - i32.add - local.tee $1 - f32.load offset=8 + f32.load offset=4 local.set $5 - local.get $1 local.get $0 - f32.load offset=8 - f32.store offset=8 + local.get $0 + f32.load + f32.store offset=4 local.get $0 local.get $5 - f32.store offset=8 + f32.store ) - (func $~lib/array/Array#sort (; 73 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/array/Array#sort (; 100 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 f32) + (local $3 i32) (local $4 f32) - local.get $1 - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 395 - i32.const 4 - call $~lib/env/abort - unreachable - end + (local $5 f32) local.get $0 - i32.load offset=4 - local.tee $2 + i32.load offset=12 + local.tee $3 i32.const 1 i32.le_s if + local.get $0 + call $~lib/rt/pure/__retain return end local.get $0 - i32.load - local.set $0 - local.get $2 + i32.load offset=4 + local.set $2 + local.get $3 i32.const 2 i32.eq if - local.get $0 - i32.const 4 - i32.add - f32.load offset=8 - local.set $3 - local.get $0 - f32.load offset=8 + local.get $2 + f32.load offset=4 local.set $4 + local.get $2 + f32.load + local.set $5 i32.const 2 global.set $~lib/argc - local.get $3 local.get $4 + local.get $5 local.get $1 call_indirect (type $FUNCSIG$iff) i32.const 0 i32.lt_s if - local.get $0 - i32.const 4 - i32.add + local.get $2 + local.get $5 + f32.store offset=4 + local.get $2 local.get $4 - f32.store offset=8 - local.get $0 - local.get $3 - f32.store offset=8 + f32.store end + local.get $0 + call $~lib/rt/pure/__retain return end - local.get $2 + local.get $3 i32.const 256 i32.lt_s if - local.get $0 local.get $2 + local.get $3 local.get $1 - call $~lib/internal/sort/insertionSort + call $~lib/util/sort/insertionSort else - local.get $0 local.get $2 + local.get $3 local.get $1 - call $~lib/internal/sort/weakHeapSort + call $~lib/util/sort/weakHeapSort end + local.get $0 + call $~lib/rt/pure/__retain ) - (func $~lib/internal/sort/COMPARATOR~anonymous|0 (; 74 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) + (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 101 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -4265,166 +4584,114 @@ i32.lt_s i32.sub ) - (func $std/array/isArraysEqual (; 75 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/builtins/isNaN (; 102 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) + local.get $0 + local.get $0 + f32.ne + ) + (func $std/array/isArraysEqual (; 103 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - (local $4 f32) - (local $5 i32) - local.get $0 - i32.load offset=4 - local.tee $5 - i32.const 3244 - i32.load - i32.ne - if - i32.const 0 - return - end local.get $0 - i32.const 3240 - i32.eq - if - i32.const 1 - return - end - loop $repeat|0 - local.get $1 - local.get $5 - i32.lt_s - if - local.get $1 - local.tee $2 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__retain + drop + block $folding-inner1 + block $folding-inner0 local.get $0 - i32.load + i32.load offset=12 local.tee $3 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result f32) - local.get $2 - i32.const 2 - i32.shl - local.get $3 - i32.add - f32.load offset=8 - else - unreachable - end - local.tee $4 - local.get $4 - f32.ne local.get $1 - i32.const 3240 - i32.load - local.tee $2 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result f32) - local.get $1 - i32.const 2 - i32.shl - local.get $2 - i32.add - f32.load offset=8 - else - unreachable - end - local.tee $4 - local.get $4 - f32.ne + i32.load offset=12 i32.ne - if - local.get $1 - local.tee $2 - local.get $0 - i32.load - local.tee $3 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result f32) + br_if $folding-inner0 + local.get $0 + local.get $1 + i32.eq + br_if $folding-inner1 + loop $repeat|0 + local.get $2 + local.get $3 + i32.lt_s + if + local.get $0 local.get $2 - i32.const 2 - i32.shl - local.get $3 - i32.add - f32.load offset=8 - else - unreachable - end - local.get $1 - i32.const 3240 - i32.load - local.tee $2 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result f32) + call $~lib/array/Array#__get + call $~lib/builtins/isNaN local.get $1 - i32.const 2 - i32.shl local.get $2 - i32.add - f32.load offset=8 - else - unreachable - end - f32.ne - if - i32.const 0 - return + call $~lib/array/Array#__get + call $~lib/builtins/isNaN + i32.ne + if + local.get $0 + local.get $2 + call $~lib/array/Array#__get + local.get $1 + local.get $2 + call $~lib/array/Array#__get + f32.ne + br_if $folding-inner0 + end + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $repeat|0 end end - local.get $1 - i32.const 1 - i32.add - local.set $1 - br $repeat|0 + br $folding-inner1 end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + i32.const 0 + return end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release i32.const 1 ) - (func $~lib/internal/sort/insertionSort (; 76 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/insertionSort (; 104 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 f64) (local $6 f64) (local $7 i32) - loop $repeat|0 - local.get $4 - local.get $1 - i32.ge_s - i32.eqz - if - local.get $4 + block $break|0 + loop $repeat|0 + local.get $3 + local.get $1 + i32.ge_s + br_if $break|0 + local.get $3 i32.const 3 i32.shl local.get $0 i32.add - f64.load offset=8 + f64.load local.set $5 - local.get $4 + local.get $3 i32.const 1 i32.sub - local.set $3 + local.set $4 loop $continue|1 - local.get $3 + local.get $4 i32.const 0 i32.ge_s if block $break|1 - local.get $3 + local.get $4 i32.const 3 i32.shl local.get $0 i32.add - f64.load offset=8 + f64.load local.set $6 i32.const 2 global.set $~lib/argc @@ -4435,11 +4702,11 @@ i32.const 0 i32.ge_s br_if $break|1 - local.get $3 + local.get $4 local.tee $7 i32.const 1 i32.sub - local.set $3 + local.set $4 local.get $7 i32.const 1 i32.add @@ -4448,12 +4715,12 @@ local.get $0 i32.add local.get $6 - f64.store offset=8 + f64.store br $continue|1 end end end - local.get $3 + local.get $4 i32.const 1 i32.add i32.const 3 @@ -4461,21 +4728,23 @@ local.get $0 i32.add local.get $5 - f64.store offset=8 - local.get $4 + f64.store + local.get $3 i32.const 1 i32.add - local.set $4 + local.set $3 br $repeat|0 + unreachable end + unreachable end ) - (func $~lib/internal/sort/weakHeapSort (; 77 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/weakHeapSort (; 105 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 f64) - (local $6 f64) - (local $7 i32) + (local $6 i32) + (local $7 f64) (local $8 i32) local.get $1 i32.const 31 @@ -4485,20 +4754,22 @@ i32.const 2 i32.shl local.tee $3 - call $~lib/allocator/arena/__memory_allocate - local.tee $7 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.tee $6 i32.const 0 local.get $3 - call $~lib/internal/memory/memset + call $~lib/memory/memory.fill local.get $1 i32.const 1 i32.sub local.set $4 loop $repeat|0 - local.get $4 - i32.const 0 - i32.gt_s - if + block $break|0 + local.get $4 + i32.const 0 + i32.le_s + br_if $break|0 local.get $4 local.set $3 loop $continue|1 @@ -4510,7 +4781,7 @@ i32.shr_s i32.const 2 i32.shl - local.get $7 + local.get $6 i32.add i32.load local.get $3 @@ -4538,19 +4809,19 @@ i32.shl local.get $0 i32.add - f64.load offset=8 + f64.load local.set $5 local.get $4 i32.const 3 i32.shl local.get $0 i32.add - f64.load offset=8 - local.set $6 + f64.load + local.set $7 i32.const 2 global.set $~lib/argc local.get $5 - local.get $6 + local.get $7 local.get $2 call_indirect (type $FUNCSIG$idd) i32.const 0 @@ -4561,7 +4832,7 @@ i32.shr_s i32.const 2 i32.shl - local.get $7 + local.get $6 i32.add local.tee $8 local.get $8 @@ -4579,14 +4850,14 @@ local.get $0 i32.add local.get $5 - f64.store offset=8 + f64.store local.get $3 i32.const 3 i32.shl local.get $0 i32.add - local.get $6 - f64.store offset=8 + local.get $7 + f64.store end local.get $4 i32.const 1 @@ -4600,12 +4871,13 @@ i32.sub local.set $4 loop $repeat|2 - local.get $4 - i32.const 2 - i32.ge_s - if + block $break|2 + local.get $4 + i32.const 2 + i32.lt_s + br_if $break|2 local.get $0 - f64.load offset=8 + f64.load local.set $5 local.get $0 local.get $4 @@ -4614,97 +4886,97 @@ local.get $0 i32.add local.tee $1 - f64.load offset=8 - f64.store offset=8 + f64.load + f64.store local.get $1 local.get $5 - f64.store offset=8 + f64.store i32.const 1 - local.set $1 + local.set $3 loop $continue|3 - local.get $1 + local.get $3 i32.const 5 i32.shr_s i32.const 2 i32.shl - local.get $7 + local.get $6 i32.add i32.load - local.get $1 + local.get $3 i32.const 31 i32.and i32.shr_u i32.const 1 i32.and - local.get $1 + local.get $3 i32.const 1 i32.shl i32.add - local.tee $3 + local.tee $1 local.get $4 i32.lt_s if - local.get $3 - local.set $1 + local.get $1 + local.set $3 br $continue|3 end end loop $continue|4 - local.get $1 + local.get $3 i32.const 0 i32.gt_s if local.get $0 - f64.load offset=8 + f64.load local.set $5 - local.get $1 + local.get $3 i32.const 3 i32.shl local.get $0 i32.add - f64.load offset=8 - local.set $6 + f64.load + local.set $7 i32.const 2 global.set $~lib/argc local.get $5 - local.get $6 + local.get $7 local.get $2 call_indirect (type $FUNCSIG$idd) i32.const 0 i32.lt_s if - local.get $1 + local.get $3 i32.const 5 i32.shr_s i32.const 2 i32.shl - local.get $7 + local.get $6 i32.add - local.tee $3 - local.get $3 + local.tee $1 + local.get $1 i32.load i32.const 1 - local.get $1 + local.get $3 i32.const 31 i32.and i32.shl i32.xor i32.store - local.get $1 + local.get $3 i32.const 3 i32.shl local.get $0 i32.add local.get $5 - f64.store offset=8 + f64.store local.get $0 - local.get $6 - f64.store offset=8 + local.get $7 + f64.store end - local.get $1 + local.get $3 i32.const 1 i32.shr_s - local.set $1 + local.set $3 br $continue|4 end end @@ -4715,93 +4987,85 @@ br $repeat|2 end end + local.get $6 + call $~lib/rt/tlsf/__free local.get $0 - i32.const 8 - i32.add - local.tee $1 f64.load offset=8 local.set $5 - local.get $1 local.get $0 - f64.load offset=8 + local.get $0 + f64.load f64.store offset=8 local.get $0 local.get $5 - f64.store offset=8 + f64.store ) - (func $~lib/array/Array#sort (; 78 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/array/Array#sort (; 106 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 f64) + (local $3 i32) (local $4 f64) - local.get $1 - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 395 - i32.const 4 - call $~lib/env/abort - unreachable - end + (local $5 f64) local.get $0 - i32.load offset=4 - local.tee $2 + i32.load offset=12 + local.tee $3 i32.const 1 i32.le_s if + local.get $0 + call $~lib/rt/pure/__retain return end local.get $0 - i32.load - local.set $0 - local.get $2 + i32.load offset=4 + local.set $2 + local.get $3 i32.const 2 i32.eq if - local.get $0 - i32.const 8 - i32.add - f64.load offset=8 - local.set $3 - local.get $0 + local.get $2 f64.load offset=8 local.set $4 + local.get $2 + f64.load + local.set $5 i32.const 2 global.set $~lib/argc - local.get $3 local.get $4 + local.get $5 local.get $1 call_indirect (type $FUNCSIG$idd) i32.const 0 i32.lt_s if - local.get $0 - i32.const 8 - i32.add - local.get $4 - f64.store offset=8 - local.get $0 - local.get $3 + local.get $2 + local.get $5 f64.store offset=8 + local.get $2 + local.get $4 + f64.store end + local.get $0 + call $~lib/rt/pure/__retain return end - local.get $2 + local.get $3 i32.const 256 i32.lt_s if - local.get $0 local.get $2 + local.get $3 local.get $1 - call $~lib/internal/sort/insertionSort + call $~lib/util/sort/insertionSort else - local.get $0 local.get $2 + local.get $3 local.get $1 - call $~lib/internal/sort/weakHeapSort + call $~lib/util/sort/weakHeapSort end + local.get $0 + call $~lib/rt/pure/__retain ) - (func $~lib/internal/sort/COMPARATOR~anonymous|0 (; 79 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) + (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 107 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) (local $2 i64) (local $3 i64) local.get $0 @@ -4830,166 +5094,137 @@ i64.lt_s i32.sub ) - (func $std/array/isArraysEqual (; 80 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 f64) - (local $5 i32) + (func $~lib/array/Array#__get (; 108 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) + local.get $1 local.get $0 - i32.load offset=4 - local.tee $5 - i32.const 3516 - i32.load - i32.ne + i32.load offset=8 + i32.const 3 + i32.shr_u + i32.ge_u if - i32.const 0 - return + i32.const 280 + i32.const 488 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort + unreachable end local.get $0 - i32.const 3512 - i32.eq - if - i32.const 1 - return - end - loop $repeat|0 - local.get $1 - local.get $5 - i32.lt_s - if - local.get $1 - local.tee $2 + i32.load offset=4 + local.get $1 + i32.const 3 + i32.shl + i32.add + f64.load + ) + (func $~lib/builtins/isNaN (; 109 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + local.get $0 + f64.ne + ) + (func $std/array/isArraysEqual (; 110 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__retain + drop + block $folding-inner1 + block $folding-inner0 local.get $0 - i32.load + i32.load offset=12 local.tee $3 - i32.load - i32.const 3 - i32.shr_u - i32.lt_u - if (result f64) + local.get $1 + i32.load offset=12 + i32.ne + br_if $folding-inner0 + local.get $0 + local.get $1 + i32.eq + br_if $folding-inner1 + loop $repeat|0 local.get $2 - i32.const 3 - i32.shl local.get $3 - i32.add - f64.load offset=8 - else - unreachable - end - local.tee $4 - local.get $4 - f64.ne - local.get $1 - i32.const 3512 - i32.load - local.tee $2 - i32.load - i32.const 3 - i32.shr_u - i32.lt_u - if (result f64) - local.get $1 - i32.const 3 - i32.shl - local.get $2 - i32.add - f64.load offset=8 - else - unreachable - end - local.tee $4 - local.get $4 - f64.ne - i32.ne - if - local.get $1 - local.tee $2 - local.get $0 - i32.load - local.tee $3 - i32.load - i32.const 3 - i32.shr_u - i32.lt_u - if (result f64) + i32.lt_s + if + local.get $0 local.get $2 - i32.const 3 - i32.shl - local.get $3 - i32.add - f64.load offset=8 - else - unreachable - end - local.get $1 - i32.const 3512 - i32.load - local.tee $2 - i32.load - i32.const 3 - i32.shr_u - i32.lt_u - if (result f64) + call $~lib/array/Array#__get + call $~lib/builtins/isNaN local.get $1 - i32.const 3 - i32.shl local.get $2 + call $~lib/array/Array#__get + call $~lib/builtins/isNaN + i32.ne + if + local.get $0 + local.get $2 + call $~lib/array/Array#__get + local.get $1 + local.get $2 + call $~lib/array/Array#__get + f64.ne + br_if $folding-inner0 + end + local.get $2 + i32.const 1 i32.add - f64.load offset=8 - else - unreachable - end - f64.ne - if - i32.const 0 - return + local.set $2 + br $repeat|0 end end - local.get $1 - i32.const 1 - i32.add - local.set $1 - br $repeat|0 + br $folding-inner1 end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + i32.const 0 + return end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release i32.const 1 ) - (func $~lib/internal/sort/insertionSort (; 81 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/insertionSort (; 111 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - loop $repeat|0 - local.get $4 - local.get $1 - i32.ge_s - i32.eqz - if - local.get $4 + block $break|0 + loop $repeat|0 + local.get $3 + local.get $1 + i32.ge_s + br_if $break|0 + local.get $3 i32.const 2 i32.shl local.get $0 i32.add - i32.load offset=8 + i32.load local.set $5 - local.get $4 + local.get $3 i32.const 1 i32.sub - local.set $3 + local.set $4 loop $continue|1 - local.get $3 + local.get $4 i32.const 0 i32.ge_s if block $break|1 - local.get $3 + local.get $4 i32.const 2 i32.shl local.get $0 i32.add - i32.load offset=8 + i32.load local.set $6 i32.const 2 global.set $~lib/argc @@ -5000,11 +5235,11 @@ i32.const 0 i32.ge_s br_if $break|1 - local.get $3 + local.get $4 local.tee $7 i32.const 1 i32.sub - local.set $3 + local.set $4 local.get $7 i32.const 1 i32.add @@ -5013,12 +5248,12 @@ local.get $0 i32.add local.get $6 - i32.store offset=8 + i32.store br $continue|1 end end end - local.get $3 + local.get $4 i32.const 1 i32.add i32.const 2 @@ -5026,16 +5261,18 @@ local.get $0 i32.add local.get $5 - i32.store offset=8 - local.get $4 + i32.store + local.get $3 i32.const 1 i32.add - local.set $4 + local.set $3 br $repeat|0 + unreachable end + unreachable end ) - (func $~lib/internal/sort/weakHeapSort (; 82 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/weakHeapSort (; 112 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -5050,35 +5287,37 @@ i32.const 2 i32.shl local.tee $3 - call $~lib/allocator/arena/__memory_allocate - local.tee $6 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.tee $5 i32.const 0 local.get $3 - call $~lib/internal/memory/memset + call $~lib/memory/memory.fill local.get $1 i32.const 1 i32.sub - local.set $4 + local.set $3 loop $repeat|0 - local.get $4 - i32.const 0 - i32.gt_s - if - local.get $4 - local.set $3 + block $break|0 + local.get $3 + i32.const 0 + i32.le_s + br_if $break|0 + local.get $3 + local.set $4 loop $continue|1 - local.get $3 + local.get $4 i32.const 1 i32.and - local.get $3 + local.get $4 i32.const 6 i32.shr_s i32.const 2 i32.shl - local.get $6 + local.get $5 i32.add i32.load - local.get $3 + local.get $4 i32.const 1 i32.shr_s i32.const 31 @@ -5088,14 +5327,14 @@ i32.and i32.eq if - local.get $3 + local.get $4 i32.const 1 i32.shr_s - local.set $3 + local.set $4 br $continue|1 end end - local.get $3 + local.get $4 i32.const 1 i32.shr_s local.tee $7 @@ -5103,60 +5342,60 @@ i32.shl local.get $0 i32.add - i32.load offset=8 - local.set $3 - local.get $4 + i32.load + local.set $4 + local.get $3 i32.const 2 i32.shl local.get $0 i32.add - i32.load offset=8 - local.set $5 + i32.load + local.set $6 i32.const 2 global.set $~lib/argc - local.get $3 - local.get $5 + local.get $4 + local.get $6 local.get $2 call_indirect (type $FUNCSIG$iii) i32.const 0 i32.lt_s if - local.get $4 + local.get $3 i32.const 5 i32.shr_s i32.const 2 i32.shl - local.get $6 + local.get $5 i32.add local.tee $8 local.get $8 i32.load i32.const 1 - local.get $4 + local.get $3 i32.const 31 i32.and i32.shl i32.xor i32.store - local.get $4 + local.get $3 i32.const 2 i32.shl local.get $0 i32.add - local.get $3 - i32.store offset=8 + local.get $4 + i32.store local.get $7 i32.const 2 i32.shl local.get $0 i32.add - local.get $5 - i32.store offset=8 + local.get $6 + i32.store end - local.get $4 + local.get $3 i32.const 1 i32.sub - local.set $4 + local.set $3 br $repeat|0 end end @@ -5165,12 +5404,13 @@ i32.sub local.set $4 loop $repeat|2 - local.get $4 - i32.const 2 - i32.ge_s - if + block $break|2 + local.get $4 + i32.const 2 + i32.lt_s + br_if $break|2 local.get $0 - i32.load offset=8 + i32.load local.set $1 local.get $0 local.get $4 @@ -5178,159 +5418,686 @@ i32.shl local.get $0 i32.add - local.tee $3 - i32.load offset=8 - i32.store offset=8 + local.tee $3 + i32.load + i32.store + local.get $3 + local.get $1 + i32.store + i32.const 1 + local.set $1 + loop $continue|3 + local.get $1 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + local.get $5 + i32.add + i32.load + local.get $1 + i32.const 31 + i32.and + i32.shr_u + i32.const 1 + i32.and + local.get $1 + i32.const 1 + i32.shl + i32.add + local.tee $3 + local.get $4 + i32.lt_s + if + local.get $3 + local.set $1 + br $continue|3 + end + end + loop $continue|4 + local.get $1 + i32.const 0 + i32.gt_s + if + local.get $0 + i32.load + local.set $3 + local.get $1 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load + local.set $6 + i32.const 2 + global.set $~lib/argc + local.get $3 + local.get $6 + local.get $2 + call_indirect (type $FUNCSIG$iii) + i32.const 0 + i32.lt_s + if + local.get $1 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + local.get $5 + i32.add + local.tee $7 + local.get $7 + i32.load + i32.const 1 + local.get $1 + i32.const 31 + i32.and + i32.shl + i32.xor + i32.store + local.get $1 + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $3 + i32.store + local.get $0 + local.get $6 + i32.store + end + local.get $1 + i32.const 1 + i32.shr_s + local.set $1 + br $continue|4 + end + end + local.get $4 + i32.const 1 + i32.sub + local.set $4 + br $repeat|2 + end + end + local.get $5 + call $~lib/rt/tlsf/__free + local.get $0 + i32.load offset=4 + local.set $1 + local.get $0 + local.get $0 + i32.load + i32.store offset=4 + local.get $0 + local.get $1 + i32.store + ) + (func $~lib/array/Array#sort (; 113 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=12 + local.tee $2 + i32.const 1 + i32.le_s + if + local.get $0 + call $~lib/rt/pure/__retain + return + end + local.get $0 + i32.load offset=4 + local.set $3 + local.get $2 + i32.const 2 + i32.eq + if + local.get $3 + i32.load offset=4 + local.set $2 + local.get $3 + i32.load + local.set $4 + i32.const 2 + global.set $~lib/argc + local.get $2 + local.get $4 + local.get $1 + call_indirect (type $FUNCSIG$iii) + i32.const 0 + i32.lt_s + if + local.get $3 + local.get $4 + i32.store offset=4 + local.get $3 + local.get $2 + i32.store + end + local.get $0 + call $~lib/rt/pure/__retain + return + end + local.get $2 + i32.const 256 + i32.lt_s + if + local.get $3 + local.get $2 + local.get $1 + call $~lib/util/sort/insertionSort + else + local.get $3 + local.get $2 + local.get $1 + call $~lib/util/sort/weakHeapSort + end + local.get $0 + call $~lib/rt/pure/__retain + ) + (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 114 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + local.get $1 + i32.sub + ) + (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 115 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + local.get $1 + i32.gt_u + local.get $0 + local.get $1 + i32.lt_u + i32.sub + ) + (func $~lib/array/Array.create (; 116 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 268435452 + i32.gt_u + if + i32.const 24 + i32.const 488 + i32.const 45 + i32.const 61 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 2 + i32.const 3 + i32.const 0 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.load offset=4 + i32.const 0 + local.get $0 + i32.load offset=8 + call $~lib/memory/memory.fill + local.get $0 + ) + (func $std/array/createReverseOrderedArray (; 117 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + call $~lib/array/Array.create + local.set $2 + loop $repeat|0 + block $break|0 + local.get $1 + local.get $0 + i32.ge_s + br_if $break|0 + local.get $2 + local.get $1 + local.get $0 + i32.const 1 + i32.sub + local.get $1 + i32.sub + call $~lib/array/Array#__set + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|0 + end + end + local.get $2 + ) + (func $~lib/math/NativeMath.random (; 118 ;) (type $FUNCSIG$d) (result f64) + (local $0 i64) + (local $1 i64) + global.get $~lib/math/random_seeded + i32.eqz + if + i32.const 3936 + i32.const 3160 + i32.const 1029 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/math/random_state0_64 + local.set $0 + global.get $~lib/math/random_state1_64 + local.tee $1 + global.set $~lib/math/random_state0_64 + local.get $0 + i64.const 23 + i64.shl + local.get $0 + i64.xor + local.tee $0 + local.get $0 + i64.const 17 + i64.shr_u + i64.xor + local.get $1 + i64.xor + local.get $1 + i64.const 26 + i64.shr_u + i64.xor + local.tee $0 + global.set $~lib/math/random_state1_64 + local.get $0 + local.get $1 + i64.add + i64.const 4503599627370495 + i64.and + i64.const 4607182418800017408 + i64.or + f64.reinterpret_i64 + f64.const 1 + f64.sub + ) + (func $std/array/createRandomOrderedArray (; 119 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + call $~lib/array/Array.create + local.set $2 + loop $repeat|0 + block $break|0 + local.get $1 + local.get $0 + i32.ge_s + br_if $break|0 + local.get $2 + local.get $1 + call $~lib/math/NativeMath.random + local.get $0 + f64.convert_i32_s + f64.mul + i32.trunc_f64_s + call $~lib/array/Array#__set + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|0 + end + end + local.get $2 + ) + (func $std/array/isSorted (; 120 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + i32.const 1 + local.set $2 + local.get $0 + i32.load offset=12 + local.set $3 + loop $repeat|0 + local.get $2 + local.get $3 + i32.lt_s + if + i32.const 2 + global.set $~lib/argc + local.get $0 + local.get $2 + i32.const 1 + i32.sub + call $~lib/array/Array#__get + local.get $0 + local.get $2 + call $~lib/array/Array#__get + local.get $1 + call_indirect (type $FUNCSIG$iii) + i32.const 0 + i32.gt_s + if + local.get $0 + call $~lib/rt/pure/__release + i32.const 0 + return + else + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $repeat|0 + end + unreachable + end + end + local.get $0 + call $~lib/rt/pure/__release + i32.const 1 + ) + (func $std/array/assertSorted (; 121 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array#sort + local.tee $2 + local.get $1 + call $std/array/isSorted + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 830 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + ) + (func $std/array/assertSortedDefault (; 122 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.const 48 + call $std/array/assertSorted + local.get $0 + call $~lib/rt/pure/__release + ) + (func $start:std/array~anonymous|44 (; 123 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 + local.get $0 + i32.sub + ) + (func $~lib/array/Array.create<~lib/array/Array> (; 124 ;) (type $FUNCSIG$i) (result i32) + (local $0 i32) + i32.const 2 + i32.const 2 + i32.const 10 + i32.const 0 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.load offset=4 + i32.const 0 + local.get $0 + i32.load offset=8 + call $~lib/memory/memory.fill + local.get $0 + ) + (func $~lib/array/Array<~lib/array/Array>#__unchecked_set (; 125 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + local.tee $0 + i32.load + local.tee $1 + local.get $2 + i32.ne + if + local.get $0 + local.get $2 + call $~lib/rt/pure/__retain + i32.store + local.get $1 + call $~lib/rt/pure/__release + end + local.get $2 + call $~lib/rt/pure/__release + ) + (func $~lib/array/Array<~lib/array/Array>#__set (; 126 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $1 + local.get $0 + i32.load offset=12 + local.tee $3 + i32.gt_u + if + local.get $2 + call $~lib/rt/pure/__release + i32.const 4040 + i32.const 488 + i32.const 121 + i32.const 38 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + call $~lib/array/ensureSize + local.get $0 + local.get $1 + local.get $2 + call $~lib/array/Array<~lib/array/Array>#__unchecked_set + local.get $1 + local.get $3 + i32.ge_s + if + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=12 + end + local.get $2 + call $~lib/rt/pure/__release + ) + (func $std/array/createReverseOrderedNestedArray (; 127 ;) (type $FUNCSIG$i) (result i32) + (local $0 i32) + (local $1 i32) + (local $2 i32) + call $~lib/array/Array.create<~lib/array/Array> + local.set $1 + loop $repeat|0 + local.get $0 + i32.const 2 + i32.lt_s + if + i32.const 1 + call $~lib/array/Array.create + local.tee $2 + i32.const 0 + i32.const 1 + local.get $0 + i32.sub + call $~lib/array/Array#__set + local.get $1 + local.get $0 + local.get $2 + call $~lib/array/Array<~lib/array/Array>#__set + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + end + local.get $1 + ) + (func $start:std/array~anonymous|47 (; 128 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.const 0 + call $~lib/array/Array#__get + local.get $1 + i32.const 0 + call $~lib/array/Array#__get + i32.sub + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + ) + (func $~lib/util/sort/insertionSort<~lib/array/Array> (; 129 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + block $break|0 + loop $repeat|0 + local.get $3 + local.get $1 + i32.ge_s + br_if $break|0 + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load + call $~lib/rt/pure/__retain + local.set $6 local.get $3 - local.get $1 - i32.store offset=8 i32.const 1 - local.set $3 - loop $continue|3 - local.get $3 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - local.get $6 - i32.add - i32.load - local.get $3 - i32.const 31 - i32.and - i32.shr_u - i32.const 1 - i32.and - local.get $3 - i32.const 1 - i32.shl - i32.add - local.tee $1 + i32.sub + local.set $4 + loop $continue|1 local.get $4 - i32.lt_s - if - local.get $1 - local.set $3 - br $continue|3 - end - end - loop $continue|4 - local.get $3 i32.const 0 - i32.gt_s + i32.ge_s if - local.get $0 - i32.load offset=8 - local.set $1 - local.get $3 - i32.const 2 - i32.shl - local.get $0 - i32.add - i32.load offset=8 - local.set $5 - i32.const 2 - global.set $~lib/argc - local.get $1 - local.get $5 - local.get $2 - call_indirect (type $FUNCSIG$iii) - i32.const 0 - i32.lt_s - if - local.get $3 - i32.const 5 - i32.shr_s + block $break|1 + local.get $4 i32.const 2 i32.shl - local.get $6 + local.get $0 i32.add - local.tee $7 - local.get $7 i32.load - i32.const 1 - local.get $3 - i32.const 31 - i32.and - i32.shl - i32.xor - i32.store - local.get $3 + call $~lib/rt/pure/__retain + local.set $5 i32.const 2 - i32.shl - local.get $0 - i32.add - local.get $1 - i32.store offset=8 - local.get $0 + global.set $~lib/argc + local.get $6 + local.get $5 + local.get $2 + call_indirect (type $FUNCSIG$iii) + i32.const 0 + i32.lt_s + if + local.get $4 + local.tee $7 + i32.const 1 + i32.sub + local.set $4 + local.get $7 + i32.const 1 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $5 + i32.store + else + local.get $5 + call $~lib/rt/pure/__release + br $break|1 + end local.get $5 - i32.store offset=8 + call $~lib/rt/pure/__release + br $continue|1 end - local.get $3 - i32.const 1 - i32.shr_s - local.set $3 - br $continue|4 end end local.get $4 i32.const 1 - i32.sub - local.set $4 - br $repeat|2 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $6 + i32.store + local.get $6 + call $~lib/rt/pure/__release + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable end + unreachable end - local.get $0 - i32.const 4 - i32.add - local.tee $1 - i32.load offset=8 - local.set $2 - local.get $1 - local.get $0 - i32.load offset=8 - i32.store offset=8 - local.get $0 - local.get $2 - i32.store offset=8 ) - (func $~lib/array/Array#sort (; 83 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#sort (; 130 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - local.get $1 - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 395 - i32.const 4 - call $~lib/env/abort - unreachable - end local.get $0 - i32.load offset=4 + i32.load offset=12 local.tee $2 i32.const 1 i32.le_s if local.get $0 + call $~lib/rt/pure/__retain return end local.get $0 - i32.load + i32.load offset=4 local.set $3 local.get $2 i32.const 2 i32.eq if local.get $3 - i32.const 4 - i32.add - i32.load offset=8 + i32.load offset=4 + call $~lib/rt/pure/__retain local.set $2 local.get $3 - i32.load offset=8 + i32.load + call $~lib/rt/pure/__retain local.set $4 i32.const 2 global.set $~lib/argc @@ -5342,220 +6109,118 @@ i32.lt_s if local.get $3 - i32.const 4 - i32.add local.get $4 - i32.store offset=8 + i32.store offset=4 local.get $3 local.get $2 - i32.store offset=8 + i32.store end local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $2 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $0 return end + local.get $3 local.get $2 - i32.const 256 - i32.lt_s - if - local.get $3 - local.get $2 - local.get $1 - call $~lib/internal/sort/insertionSort - else - local.get $3 - local.get $2 - local.get $1 - call $~lib/internal/sort/weakHeapSort - end - local.get $0 - ) - (func $~lib/internal/sort/COMPARATOR~anonymous|0 (; 84 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 - local.get $1 - i32.sub - ) - (func $~lib/internal/sort/COMPARATOR~anonymous|0 (; 85 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 - local.get $1 - i32.gt_u - local.get $0 - local.get $1 - i32.lt_u - i32.sub - ) - (func $std/array/createReverseOrderedArray (; 86 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - local.get $0 - call $~lib/array/Array#constructor - local.set $1 - i32.const 0 - local.set $0 - loop $repeat|0 - block $break|0 - local.get $0 - local.get $1 - i32.load offset=4 - i32.ge_s - br_if $break|0 - local.get $1 - local.get $0 - local.get $1 - i32.load offset=4 - i32.const 1 - i32.sub - local.get $0 - i32.sub - call $~lib/array/Array#__set - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 - end - end - local.get $1 - ) - (func $~lib/math/NativeMath.random (; 87 ;) (type $FUNCSIG$d) (result f64) - (local $0 i64) - (local $1 i64) - global.get $~lib/math/random_seeded - i32.eqz - if - i32.const 0 - i32.const 2896 - i32.const 987 - i32.const 24 - call $~lib/env/abort - unreachable - end - global.get $~lib/math/random_state0_64 - local.set $0 - global.get $~lib/math/random_state1_64 - local.tee $1 - global.set $~lib/math/random_state0_64 - local.get $0 - i64.const 23 - i64.shl - local.get $0 - i64.xor - local.tee $0 - local.get $0 - i64.const 17 - i64.shr_u - i64.xor - local.get $1 - i64.xor local.get $1 - i64.const 26 - i64.shr_u - i64.xor - local.tee $0 - global.set $~lib/math/random_state1_64 + call $~lib/util/sort/insertionSort<~lib/array/Array> local.get $0 + call $~lib/rt/pure/__retain + ) + (func $~lib/array/Array<~lib/array/Array>#__unchecked_get (; 131 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.load offset=4 local.get $1 - i64.add - i64.const 4503599627370495 - i64.and - i64.const 4607182418800017408 - i64.or - f64.reinterpret_i64 - f64.const 1 - f64.sub + i32.const 2 + i32.shl + i32.add + i32.load + call $~lib/rt/pure/__retain ) - (func $std/array/createRandomOrderedArray (; 88 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/array/Array<~lib/array/Array>#__get (; 132 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 local.get $0 - call $~lib/array/Array#constructor - local.set $0 - loop $repeat|0 - block $break|0 - local.get $1 - local.get $0 - i32.load offset=4 - i32.ge_s - br_if $break|0 - local.get $0 - local.get $1 - call $~lib/math/NativeMath.random - local.get $0 - i32.load offset=4 - f64.convert_i32_s - f64.mul - i32.trunc_f64_s - call $~lib/array/Array#__set - local.get $1 - i32.const 1 - i32.add - local.set $1 - br $repeat|0 - end + i32.load offset=12 + i32.ge_u + if + i32.const 4040 + i32.const 488 + i32.const 106 + i32.const 45 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ge_u + if + i32.const 280 + i32.const 488 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort + unreachable end local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#__unchecked_get ) - (func $std/array/isSorted (; 89 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/isSorted<~lib/array/Array> (; 133 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop i32.const 1 local.set $2 local.get $0 - i32.load offset=4 - local.set $4 + i32.load offset=12 + local.set $5 loop $repeat|0 local.get $2 - local.get $4 + local.get $5 i32.lt_s if i32.const 2 global.set $~lib/argc + local.get $0 local.get $2 i32.const 1 i32.sub + call $~lib/array/Array<~lib/array/Array>#__get local.tee $3 local.get $0 - i32.load - local.tee $5 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $3 - i32.const 2 - i32.shl - local.get $5 - i32.add - i32.load offset=8 - else - unreachable - end local.get $2 - local.get $0 - i32.load - local.tee $3 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $2 - i32.const 2 - i32.shl - local.get $3 - i32.add - i32.load offset=8 - else - unreachable - end + call $~lib/array/Array<~lib/array/Array>#__get + local.tee $4 local.get $1 call_indirect (type $FUNCSIG$iii) i32.const 0 i32.gt_s if + local.get $0 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release i32.const 0 return else + local.get $3 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release local.get $2 i32.const 1 i32.add @@ -5565,78 +6230,80 @@ unreachable end end + local.get $0 + call $~lib/rt/pure/__release i32.const 1 ) - (func $std/array/assertSorted (; 90 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $std/array/assertSorted<~lib/array/Array> (; 134 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop local.get $0 local.get $1 - call $~lib/array/Array#sort + call $~lib/array/Array<~lib/array/Array>#sort + local.tee $2 local.get $1 - call $std/array/isSorted + call $std/array/isSorted<~lib/array/Array> i32.eqz if i32.const 0 - i32.const 120 - i32.const 810 + i32.const 376 + i32.const 830 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - ) - (func $std/array/assertSortedDefault (; 91 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $2 + call $~lib/rt/pure/__release local.get $0 - i32.const 48 - call $std/array/assertSorted + call $~lib/rt/pure/__release ) - (func $start:std/array~anonymous|44 (; 92 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $1 + (func $~lib/array/Array.create> (; 135 ;) (type $FUNCSIG$i) (result i32) + (local $0 i32) + i32.const 512 + i32.const 2 + i32.const 12 + i32.const 0 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.load offset=4 + i32.const 0 + local.get $0 + i32.load offset=8 + call $~lib/memory/memory.fill local.get $0 - i32.sub ) - (func $std/array/createReverseOrderedNestedArray (; 93 ;) (type $FUNCSIG$i) (result i32) + (func $std/array/createReverseOrderedElementsArray (; 136 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) (local $1 i32) (local $2 i32) - i32.const 512 - call $~lib/array/Array#constructor + call $~lib/array/Array.create> local.set $1 loop $repeat|0 local.get $0 - local.get $1 - i32.load offset=4 + i32.const 512 i32.lt_s if - local.get $1 - local.get $0 - i32.const 1 - call $~lib/array/Array#constructor - call $~lib/array/Array#__set - local.get $0 - local.get $1 - i32.load + i32.const 4 + i32.const 11 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.tee $2 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 2 - i32.shl - local.get $2 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 0 - local.get $1 - i32.load offset=4 - i32.const 1 - i32.sub + i32.const 511 local.get $0 i32.sub - call $~lib/array/Array#__set + i32.store + local.get $1 + local.get $0 + local.get $2 + call $~lib/array/Array<~lib/array/Array>#__set + local.get $2 + call $~lib/rt/pure/__release local.get $0 i32.const 1 i32.add @@ -5646,332 +6313,366 @@ end local.get $1 ) - (func $start:std/array~anonymous|47 (; 94 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - i32.const 0 + (func $start:std/array~anonymous|48 (; 137 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) local.get $0 - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end - i32.const 0 + call $~lib/rt/pure/__retain + drop local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 i32.load - local.tee $1 + local.get $1 i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $1 - i32.load offset=8 - else - unreachable - end i32.sub - ) - (func $~lib/array/Array<~lib/array/Array>#sort (; 95 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - local.get $1 - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 395 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - i32.load offset=4 - local.tee $2 - i32.const 1 - i32.le_s - if - local.get $0 - return - end + local.set $2 local.get $0 - i32.load - local.set $3 - local.get $2 - i32.const 2 - i32.eq - if - local.get $3 - i32.const 4 - i32.add - i32.load offset=8 - local.set $2 - local.get $3 - i32.load offset=8 - local.set $4 - i32.const 2 - global.set $~lib/argc - local.get $2 - local.get $4 - local.get $1 - call_indirect (type $FUNCSIG$iii) - i32.const 0 - i32.lt_s - if - local.get $3 - i32.const 4 - i32.add - local.get $4 - i32.store offset=8 - local.get $3 - local.get $2 - i32.store offset=8 - end - local.get $0 - return - end - local.get $3 - local.get $2 + call $~lib/rt/pure/__release local.get $1 - call $~lib/internal/sort/insertionSort - local.get $0 + call $~lib/rt/pure/__release + local.get $2 ) - (func $std/array/assertSorted<~lib/array/Array> (; 96 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - local.get $0 + (func $~lib/array/Array<~lib/string/String | null>#__get (; 138 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 - call $~lib/array/Array<~lib/array/Array>#sort - local.get $1 - call $std/array/isSorted - i32.eqz + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ge_u if - i32.const 0 - i32.const 120 - i32.const 810 - i32.const 2 - call $~lib/env/abort + i32.const 280 + i32.const 488 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort unreachable end + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#__unchecked_get ) - (func $std/array/createReverseOrderedElementsArray (; 97 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) - (local $1 i32) + (func $std/array/isSorted<~lib/string/String | null> (; 139 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - i32.const 512 - call $~lib/array/Array#constructor - local.set $0 + (local $4 i32) + (local $5 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + i32.const 1 + local.set $2 + local.get $0 + i32.load offset=12 + local.set $5 loop $repeat|0 - local.get $1 - local.get $0 - i32.load offset=4 + local.get $2 + local.get $5 i32.lt_s if + i32.const 2 + global.set $~lib/argc local.get $0 - i32.load offset=4 + local.get $2 i32.const 1 i32.sub - local.get $1 - i32.sub - local.set $2 - i32.const 4 - call $~lib/allocator/arena/__memory_allocate + call $~lib/array/Array<~lib/string/String | null>#__get local.tee $3 - local.get $2 - i32.store local.get $0 + local.get $2 + call $~lib/array/Array<~lib/string/String | null>#__get + local.tee $4 local.get $1 - local.get $3 - call $~lib/array/Array#__set - local.get $1 - i32.const 1 - i32.add - local.set $1 - br $repeat|0 + call_indirect (type $FUNCSIG$iii) + i32.const 0 + i32.gt_s + if + local.get $0 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + i32.const 0 + return + else + local.get $3 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $repeat|0 + end + unreachable end end local.get $0 + call $~lib/rt/pure/__release + i32.const 1 ) - (func $start:std/array~anonymous|48 (; 98 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/assertSorted<~lib/string/String | null> (; 140 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.load local.get $1 - i32.load + call $~lib/array/Array<~lib/array/Array>#sort + local.tee $2 + local.get $1 + call $std/array/isSorted<~lib/string/String | null> + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 830 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + ) + (func $~lib/string/String#get:length (; 141 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 16 i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u ) - (func $~lib/internal/string/compareUnsafe (; 99 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/string/compareImpl (; 142 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.set $3 + local.get $1 + local.set $4 loop $continue|0 local.get $2 if (result i32) - local.get $0 - i32.load16_u offset=4 - local.get $1 - i32.load16_u offset=4 + local.get $3 + i32.load16_u + local.get $4 + i32.load16_u i32.sub - local.tee $3 + local.tee $5 i32.eqz else - local.get $2 + i32.const 0 end if local.get $2 i32.const 1 i32.sub local.set $2 - local.get $0 + local.get $3 i32.const 2 i32.add - local.set $0 - local.get $1 + local.set $3 + local.get $4 i32.const 2 i32.add - local.set $1 + local.set $4 br $continue|0 end end - local.get $3 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $5 ) - (func $~lib/internal/sort/COMPARATOR<~lib/string/String>~anonymous|0 (; 100 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/sort/COMPARATOR<~lib/string/String | null>~anonymous|0 (; 143 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - (local $4 i32) local.get $0 + call $~lib/rt/pure/__retain + drop local.get $1 - i32.eq - local.tee $2 - i32.eqz - if + call $~lib/rt/pure/__retain + drop + block $folding-inner0 + i32.const 1 + local.get $1 + i32.eqz + i32.const 1 local.get $0 i32.eqz - local.set $2 - end - local.get $2 - i32.eqz - if + local.get $0 local.get $1 - i32.eqz + i32.eq + select + select + if + br $folding-inner0 + end + local.get $0 + call $~lib/string/String#get:length local.set $2 - end - local.get $2 - if + local.get $1 + call $~lib/string/String#get:length + local.set $3 i32.const 0 - return - end - local.get $1 - i32.load - local.set $3 - local.get $0 - i32.load - local.tee $4 - i32.eqz - local.tee $2 - if local.get $3 i32.eqz + local.get $2 + select + if + br $folding-inner0 + end + local.get $2 + i32.eqz + if + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + i32.const -1 + return + end + local.get $3 + i32.eqz + if + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + i32.const 1 + return + end + local.get $0 + local.get $1 + local.get $2 + local.get $3 + local.get $2 + local.get $3 + i32.lt_s + select + call $~lib/util/string/compareImpl local.set $2 - end - local.get $2 - if - i32.const 0 - return - end - local.get $4 - i32.eqz - if - i32.const -1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 return end - local.get $3 - i32.eqz + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + i32.const 0 + ) + (func $~lib/string/String.__eq (; 144 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + i32.eq if + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release i32.const 1 return end - local.get $0 - local.get $1 - local.get $4 - local.get $3 - local.get $4 - local.get $3 - i32.lt_s - select - call $~lib/internal/string/compareUnsafe - ) - (func $std/array/assertSorted<~lib/string/String>|trampoline (; 101 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) - block $1of1 - block $0of1 - block $outOfRange - global.get $~lib/argc - i32.const 1 - i32.sub - br_table $0of1 $1of1 $outOfRange - end - unreachable + block $folding-inner0 + local.get $1 + i32.eqz + i32.const 1 + local.get $0 + select + if + br $folding-inner0 end - i32.const 55 - local.set $1 + local.get $0 + call $~lib/string/String#get:length + local.tee $2 + local.get $1 + call $~lib/string/String#get:length + i32.ne + if + br $folding-inner0 + end + local.get $0 + local.get $1 + local.get $2 + call $~lib/util/string/compareImpl + i32.eqz + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + return end local.get $0 + call $~lib/rt/pure/__release local.get $1 - call $std/array/assertSorted<~lib/array/Array> + call $~lib/rt/pure/__release + i32.const 0 ) - (func $~lib/string/String.__eq (; 102 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__ne (; 145 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 + call $~lib/rt/pure/__retain + drop local.get $1 - i32.eq - if - i32.const 1 - return - end - local.get $0 - i32.eqz - local.tee $2 - i32.eqz - if - local.get $1 - i32.eqz - local.set $2 - end - local.get $2 - if - i32.const 0 - return - end + call $~lib/rt/pure/__retain + drop local.get $0 - i32.load - local.tee $2 local.get $1 - i32.load - i32.ne - if - i32.const 0 - return - end + call $~lib/string/String.__eq + i32.eqz + local.set $2 local.get $0 + call $~lib/rt/pure/__release local.get $1 + call $~lib/rt/pure/__release local.get $2 - call $~lib/internal/string/compareUnsafe - i32.eqz ) - (func $std/array/isArraysEqual<~lib/string/String> (; 103 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/isArraysEqual<~lib/string/String | null> (; 146 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) + (local $5 i32) local.get $0 - i32.load offset=4 - local.tee $4 + call $~lib/rt/pure/__retain + drop local.get $1 - i32.load offset=4 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.load offset=12 + local.tee $5 + local.get $1 + i32.load offset=12 i32.ne if + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release i32.const 0 return end @@ -5979,200 +6680,194 @@ local.get $1 i32.eq if + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release i32.const 1 return end loop $repeat|0 local.get $2 - local.get $4 + local.get $5 i32.lt_s if - local.get $2 local.get $0 - i32.load - local.tee $3 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $2 - i32.const 2 - i32.shl - local.get $3 - i32.add - i32.load offset=8 - else - unreachable - end local.get $2 - local.get $1 - i32.load + call $~lib/array/Array<~lib/string/String | null>#__get local.tee $3 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $2 - i32.const 2 - i32.shl + local.get $1 + local.get $2 + call $~lib/array/Array<~lib/string/String | null>#__get + local.tee $4 + call $~lib/string/String.__ne + if + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release local.get $3 - i32.add - i32.load offset=8 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + i32.const 0 + return else - unreachable - end - call $~lib/string/String.__eq - if + local.get $3 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release local.get $2 i32.const 1 i32.add local.set $2 br $repeat|0 - else - i32.const 0 - return end unreachable end end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release i32.const 1 ) - (func $~lib/internal/string/allocateUnsafe (; 104 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/array/Array.create<~lib/string/String> (; 147 ;) (type $FUNCSIG$i) (result i32) + (local $0 i32) + i32.const 400 + i32.const 2 + i32.const 14 + i32.const 0 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.store offset=12 local.get $0 + i32.load offset=4 i32.const 0 - i32.gt_s - local.tee $1 - if - local.get $0 - i32.const 536870910 - i32.le_s - local.set $1 - end - local.get $1 - i32.eqz - if - i32.const 0 - i32.const 4088 - i32.const 14 - i32.const 2 - call $~lib/env/abort - unreachable - end local.get $0 - i32.const 1 - i32.shl - i32.const 4 - i32.add - call $~lib/allocator/arena/__memory_allocate - local.tee $1 + i32.load offset=8 + call $~lib/memory/memory.fill local.get $0 - i32.store - local.get $1 ) - (func $~lib/string/String#charAt (; 105 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/string/String#charAt (; 148 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - i32.const 2928 - i32.load + i32.const 3200 + call $~lib/string/String#get:length i32.ge_u if - i32.const 3904 + i32.const 4248 + call $~lib/rt/pure/__retain return end + i32.const 2 i32.const 1 - call $~lib/internal/string/allocateUnsafe + call $~lib/rt/tlsf/__alloc local.tee $1 local.get $0 i32.const 1 i32.shl - i32.const 2928 + i32.const 3200 i32.add - i32.load16_u offset=4 - i32.store16 offset=4 - local.get $1 - ) - (func $~lib/internal/string/copyUnsafe (; 106 ;) (type $FUNCSIG$viiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) + i32.load16_u + i32.store16 local.get $1 - i32.const 1 - i32.shl - local.get $0 - i32.add - i32.const 4 - i32.add - local.get $3 - i32.const 1 - i32.shl - local.get $2 - i32.add - i32.const 4 - i32.add - local.get $4 - i32.const 1 - i32.shl - call $~lib/internal/memory/memmove + call $~lib/rt/pure/__retain ) - (func $~lib/string/String#concat (; 107 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#concat (; 149 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - local.get $0 + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $1 i32.eqz if - i32.const 0 - i32.const 4056 - i32.const 110 - i32.const 4 - call $~lib/env/abort - unreachable + local.get $1 + i32.const 4408 + i32.ne + if + i32.const 4408 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + i32.const 4408 + local.set $1 end local.get $0 - i32.load + call $~lib/string/String#get:length + i32.const 1 + i32.shl local.tee $3 local.get $1 - i32.const 4144 - local.get $1 - select - local.tee $1 - i32.load + call $~lib/string/String#get:length + i32.const 1 + i32.shl local.tee $4 i32.add local.tee $2 i32.eqz if - i32.const 3904 + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $0 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 return end local.get $2 - call $~lib/internal/string/allocateUnsafe + i32.const 1 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.tee $2 - i32.const 0 local.get $0 - i32.const 0 local.get $3 - call $~lib/internal/string/copyUnsafe + call $~lib/memory/memory.copy local.get $2 local.get $3 + i32.add local.get $1 - i32.const 0 local.get $4 - call $~lib/internal/string/copyUnsafe + call $~lib/memory/memory.copy + local.get $1 + call $~lib/rt/pure/__release local.get $2 ) - (func $~lib/string/String.__concat (; 108 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__concat (; 150 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 4144 + i32.const 4408 local.get $0 select local.get $1 call $~lib/string/String#concat + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 ) - (func $std/array/createRandomString (; 109 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $std/array/createRandomString (; 151 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - i32.const 3904 + (local $3 i32) + (local $4 i32) + (local $5 i32) + i32.const 4248 + call $~lib/rt/pure/__retain local.set $1 loop $repeat|0 block $break|0 @@ -6181,16 +6876,32 @@ i32.ge_s br_if $break|0 local.get $1 + local.tee $3 + local.get $1 call $~lib/math/NativeMath.random - i32.const 2928 - i32.load + i32.const 3200 + call $~lib/string/String#get:length f64.convert_i32_s f64.mul f64.floor i32.trunc_f64_s call $~lib/string/String#charAt + local.tee $4 call $~lib/string/String.__concat - local.set $1 + local.tee $5 + local.tee $1 + i32.ne + if + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $3 + call $~lib/rt/pure/__release + end + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release local.get $2 i32.const 1 i32.add @@ -6200,16 +6911,15 @@ end local.get $1 ) - (func $std/array/createRandomStringArray (; 110 ;) (type $FUNCSIG$i) (result i32) + (func $std/array/createRandomStringArray (; 152 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) (local $1 i32) - i32.const 400 - call $~lib/array/Array#constructor + (local $2 i32) + call $~lib/array/Array.create<~lib/string/String> local.set $1 loop $repeat|0 local.get $0 - local.get $1 - i32.load offset=4 + i32.const 400 i32.lt_s if local.get $1 @@ -6219,7 +6929,10 @@ f64.mul i32.trunc_f64_s call $std/array/createRandomString - call $~lib/array/Array#__set + local.tee $2 + call $~lib/array/Array<~lib/array/Array>#__set + local.get $2 + call $~lib/rt/pure/__release local.get $0 i32.const 1 i32.add @@ -6229,29 +6942,28 @@ end local.get $1 ) - (func $~lib/string/String#substring (; 111 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#substring (; 153 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - (local $4 i32) local.get $0 i32.eqz if i32.const 0 - i32.const 4056 - i32.const 254 + i32.const 4360 + i32.const 196 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 local.get $0 - i32.load - local.tee $3 + call $~lib/string/String#get:length + local.tee $2 i32.const 0 - local.get $3 + local.get $2 i32.lt_s select - local.tee $2 + local.tee $3 local.get $1 i32.const 0 local.get $1 @@ -6259,58 +6971,65 @@ i32.gt_s select local.tee $1 - local.get $3 + local.get $2 local.get $1 - local.get $3 + local.get $2 i32.lt_s select - local.tee $1 + local.tee $2 + local.get $3 local.get $2 - local.get $1 i32.gt_s select - local.tee $4 + i32.const 1 + i32.shl + local.tee $1 + local.get $3 local.get $2 - local.get $1 + local.get $3 local.get $2 - local.get $1 i32.lt_s select - local.tee $1 - i32.sub + i32.const 1 + i32.shl local.tee $3 + i32.sub + local.tee $2 i32.eqz if - i32.const 3904 + i32.const 4248 + call $~lib/rt/pure/__retain return end - local.get $1 - i32.eqz - local.tee $2 + local.get $3 if (result i32) + i32.const 0 + else local.get $0 - i32.load - local.get $4 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.get $1 i32.eq - else - local.get $2 end if local.get $0 + call $~lib/rt/pure/__retain return end - local.get $3 - call $~lib/internal/string/allocateUnsafe - local.tee $2 - i32.const 0 + local.get $2 + i32.const 1 + call $~lib/rt/tlsf/__alloc + local.tee $1 local.get $0 - local.get $1 local.get $3 - call $~lib/internal/string/copyUnsafe + i32.add local.get $2 + call $~lib/memory/memory.copy + local.get $1 + call $~lib/rt/pure/__retain ) - (func $~lib/array/Array#join (; 112 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) + (func $~lib/array/Array#join_bool (; 154 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -6319,84 +7038,104 @@ (local $6 i32) (local $7 i32) (local $8 i32) - (local $9 i32) - i32.const 4244 - i32.load + i32.const 4512 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.load offset=12 i32.const 1 i32.sub local.tee $1 i32.const 0 i32.lt_s if - i32.const 3904 + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $0 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $0 return end - i32.const 4240 - i32.load - local.set $2 - i32.const 4216 - i32.load - local.tee $4 - i32.const 0 - i32.ne - local.set $7 + local.get $0 + i32.load offset=4 + local.set $3 local.get $1 i32.eqz if - i32.const 4184 - i32.const 4200 - local.get $2 - i32.load8_u offset=8 + i32.const 4456 + i32.const 4480 + local.get $3 + i32.load8_u select + call $~lib/rt/pure/__retain + local.set $0 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $0 return end - local.get $4 + i32.const 4512 + call $~lib/string/String#get:length + local.tee $4 i32.const 5 i32.add local.get $1 i32.mul i32.const 5 i32.add - local.tee $8 - call $~lib/internal/string/allocateUnsafe - local.set $3 + local.tee $7 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $2 + i32.const 0 + local.set $0 loop $repeat|0 local.get $5 local.get $1 i32.lt_s if - local.get $2 + local.get $3 local.get $5 i32.add - i32.load8_u offset=8 - i32.const 0 - i32.ne - local.tee $9 + i32.load8_u + local.tee $8 i32.eqz i32.const 4 i32.add local.set $6 - local.get $3 local.get $0 - i32.const 4184 - i32.const 4200 - local.get $9 + i32.const 1 + i32.shl + local.get $2 + i32.add + i32.const 4456 + i32.const 4480 + local.get $8 select - i32.const 0 local.get $6 - call $~lib/internal/string/copyUnsafe + i32.const 1 + i32.shl + call $~lib/memory/memory.copy local.get $0 local.get $6 i32.add local.set $0 - local.get $7 + local.get $4 if - local.get $3 local.get $0 - i32.const 4216 - i32.const 0 + i32.const 1 + i32.shl + local.get $2 + i32.add + i32.const 4512 local.get $4 - call $~lib/internal/string/copyUnsafe + i32.const 1 + i32.shl + call $~lib/memory/memory.copy local.get $0 local.get $4 i32.add @@ -6410,223 +7149,132 @@ end end local.get $1 - local.get $2 + local.get $3 i32.add - i32.load8_u offset=8 - i32.const 0 - i32.ne - local.tee $1 + i32.load8_u + local.tee $3 i32.eqz i32.const 4 i32.add - local.set $2 - local.get $3 + local.set $1 local.get $0 - i32.const 4184 - i32.const 4200 - local.get $1 - select - i32.const 0 + i32.const 1 + i32.shl local.get $2 - call $~lib/internal/string/copyUnsafe + i32.add + i32.const 4456 + i32.const 4480 local.get $3 - local.set $1 - local.get $8 + select + local.get $1 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $7 local.get $0 - local.get $2 + local.get $1 i32.add local.tee $0 i32.gt_s if - local.get $3 + local.get $2 local.get $0 call $~lib/string/String#substring - local.set $1 - local.get $3 - i32.eqz - if - i32.const 0 - i32.const 4088 - i32.const 28 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.set $0 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + return end - local.get $1 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $2 ) - (func $~lib/internal/number/decimalCount32 (; 113 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/decimalCount32 (; 155 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.const 1 + i32.const 2 local.get $0 - i32.const 100000 + i32.const 10 i32.lt_u - if (result i32) - local.get $0 - i32.const 100 - i32.lt_u - if (result i32) - i32.const 1 - i32.const 2 - local.get $0 - i32.const 10 - i32.lt_u - select - else - i32.const 3 - i32.const 4 - i32.const 5 - local.get $0 - i32.const 10000 - i32.lt_u - select - local.get $0 - i32.const 1000 - i32.lt_u - select - end - else - local.get $0 - i32.const 10000000 - i32.lt_u - if (result i32) - i32.const 6 - i32.const 7 - local.get $0 - i32.const 1000000 - i32.lt_u - select - else - i32.const 8 - i32.const 9 - i32.const 10 - local.get $0 - i32.const 1000000000 - i32.lt_u - select - local.get $0 - i32.const 100000000 - i32.lt_u - select - end - end - ) - (func $~lib/internal/number/utoa32_lut (; 114 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - i32.const 4832 - i32.load - local.set $3 - loop $continue|0 - local.get $1 - i32.const 10000 - i32.ge_u - if - local.get $1 - i32.const 10000 - i32.rem_u - local.set $4 - local.get $1 - i32.const 10000 - i32.div_u - local.set $1 - local.get $2 - i32.const 4 - i32.sub - local.tee $2 - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $3 - local.get $4 - i32.const 100 - i32.div_u - i32.const 2 - i32.shl - i32.add - i64.load32_u offset=8 - local.get $3 - local.get $4 - i32.const 100 - i32.rem_u - i32.const 2 - i32.shl - i32.add - i64.load32_u offset=8 - i64.const 32 - i64.shl - i64.or - i64.store offset=4 - br $continue|0 - end - end - local.get $1 + select + i32.const 3 + i32.const 4 + i32.const 5 + local.get $0 + i32.const 10000 + i32.lt_u + select + local.get $0 + i32.const 1000 + i32.lt_u + select + local.get $0 i32.const 100 - i32.ge_u - if - local.get $1 - i32.const 100 - i32.rem_u - local.set $4 - local.get $1 - i32.const 100 - i32.div_u - local.set $1 - local.get $2 - i32.const 2 - i32.sub - local.tee $2 - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $3 - local.get $4 - i32.const 2 - i32.shl - i32.add - i32.load offset=8 - i32.store offset=4 - end - local.get $1 + i32.lt_u + select + i32.const 6 + i32.const 7 + local.get $0 + i32.const 1000000 + i32.lt_u + select + i32.const 8 + i32.const 9 i32.const 10 - i32.ge_u - if - local.get $2 - i32.const 2 - i32.sub - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $3 + local.get $0 + i32.const 1000000000 + i32.lt_u + select + local.get $0 + i32.const 100000000 + i32.lt_u + select + local.get $0 + i32.const 10000000 + i32.lt_u + select + local.get $0 + i32.const 100000 + i32.lt_u + select + ) + (func $~lib/util/number/utoa_simple (; 156 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + loop $continue|0 local.get $1 - i32.const 2 - i32.shl - i32.add - i32.load offset=8 - i32.store offset=4 - else + i32.const 10 + i32.div_u + local.set $3 local.get $2 i32.const 1 i32.sub + local.tee $2 i32.const 1 i32.shl local.get $0 i32.add local.get $1 + i32.const 10 + i32.rem_u i32.const 48 i32.add - i32.store16 offset=4 + i32.store16 + local.get $3 + local.tee $1 + br_if $continue|0 end ) - (func $~lib/internal/number/itoa32 (; 115 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/itoa32 (; 157 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) local.get $0 i32.eqz if - i32.const 4312 + i32.const 4608 + call $~lib/rt/pure/__retain return end local.get $0 @@ -6640,24 +7288,28 @@ local.set $0 end local.get $0 - call $~lib/internal/number/decimalCount32 + call $~lib/util/number/decimalCount32 local.get $1 i32.add local.tee $3 - call $~lib/internal/string/allocateUnsafe + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc local.tee $2 local.get $0 local.get $3 - call $~lib/internal/number/utoa32_lut + call $~lib/util/number/utoa_simple local.get $1 if local.get $2 i32.const 45 - i32.store16 offset=4 + i32.store16 end local.get $2 + call $~lib/rt/pure/__retain ) - (func $~lib/internal/number/itoa_stream (; 116 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/itoa_stream (; 158 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $1 i32.const 1 i32.shl @@ -6669,7 +7321,7 @@ if local.get $0 i32.const 48 - i32.store16 offset=4 + i32.store16 i32.const 1 return end @@ -6688,94 +7340,115 @@ local.get $2 end local.get $2 - call $~lib/internal/number/decimalCount32 + call $~lib/util/number/decimalCount32 local.get $1 i32.add local.tee $2 - call $~lib/internal/number/utoa32_lut + call $~lib/util/number/utoa_simple local.get $1 if local.get $0 i32.const 45 - i32.store16 offset=4 + i32.store16 end local.get $2 ) - (func $~lib/array/Array#join (; 117 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join_int (; 159 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.load offset=4 + i32.load offset=12 i32.const 1 i32.sub local.tee $3 i32.const 0 i32.lt_s if - i32.const 3904 + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $0 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 return end local.get $0 - i32.load + i32.load offset=4 local.set $4 - local.get $1 - i32.load - local.tee $5 - i32.const 0 - i32.ne - local.set $7 local.get $3 i32.eqz if local.get $4 - i32.load offset=8 - call $~lib/internal/number/itoa32 + i32.load + call $~lib/util/number/itoa32 + local.tee $0 + call $~lib/rt/pure/__retain + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 return end - local.get $5 + local.get $1 + call $~lib/string/String#get:length + local.tee $5 i32.const 11 i32.add local.get $3 i32.mul i32.const 11 i32.add - local.tee $8 - call $~lib/internal/string/allocateUnsafe + local.tee $7 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $2 + i32.const 0 local.set $0 loop $repeat|0 local.get $6 local.get $3 i32.lt_s if - local.get $0 local.get $2 + local.get $0 local.get $6 i32.const 2 i32.shl local.get $4 i32.add - i32.load offset=8 - call $~lib/internal/number/itoa_stream - local.get $2 + i32.load + call $~lib/util/number/itoa_stream + local.get $0 i32.add - local.set $2 - local.get $7 + local.set $0 + local.get $5 if local.get $0 + i32.const 1 + i32.shl local.get $2 + i32.add local.get $1 - i32.const 0 local.get $5 - call $~lib/internal/string/copyUnsafe - local.get $2 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $0 local.get $5 i32.add - local.set $2 + local.set $0 end local.get $6 i32.const 1 @@ -6784,60 +7457,73 @@ br $repeat|0 end end - local.get $0 - local.set $1 - local.get $8 - local.get $0 + local.get $7 local.get $2 + local.get $0 local.get $3 i32.const 2 i32.shl local.get $4 i32.add - i32.load offset=8 - call $~lib/internal/number/itoa_stream - local.get $2 + i32.load + call $~lib/util/number/itoa_stream + local.get $0 i32.add - local.tee $2 + local.tee $0 i32.gt_s if - local.get $0 local.get $2 + local.get $0 call $~lib/string/String#substring - local.set $1 + local.set $0 + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release local.get $0 - i32.eqz - if - i32.const 0 - i32.const 4088 - i32.const 28 - i32.const 4 - call $~lib/env/abort - unreachable - end + return end local.get $1 + call $~lib/rt/pure/__release + local.get $2 + ) + (func $~lib/array/Array#join (; 160 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array#join_int + local.set $0 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 ) - (func $~lib/internal/number/utoa32 (; 118 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/utoa32 (; 161 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) local.get $0 i32.eqz if - i32.const 4312 + i32.const 4608 + call $~lib/rt/pure/__retain return end local.get $0 - call $~lib/internal/number/decimalCount32 + call $~lib/util/number/decimalCount32 local.tee $1 - call $~lib/internal/string/allocateUnsafe + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc local.tee $2 local.get $0 local.get $1 - call $~lib/internal/number/utoa32_lut + call $~lib/util/number/utoa_simple local.get $2 + call $~lib/rt/pure/__retain ) - (func $~lib/internal/number/itoa_stream (; 119 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/itoa_stream (; 162 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $1 i32.const 1 i32.shl @@ -6849,93 +7535,114 @@ if local.get $0 i32.const 48 - i32.store16 offset=4 + i32.store16 i32.const 1 return end local.get $0 local.get $2 local.get $2 - call $~lib/internal/number/decimalCount32 + call $~lib/util/number/decimalCount32 local.tee $0 - call $~lib/internal/number/utoa32_lut + call $~lib/util/number/utoa_simple local.get $0 ) - (func $~lib/array/Array#join (; 120 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join_int (; 163 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.load offset=4 + i32.load offset=12 i32.const 1 i32.sub local.tee $3 i32.const 0 i32.lt_s if - i32.const 3904 + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $0 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 return end local.get $0 - i32.load + i32.load offset=4 local.set $4 - local.get $1 - i32.load - local.tee $5 - i32.const 0 - i32.ne - local.set $7 local.get $3 i32.eqz if local.get $4 - i32.load offset=8 - call $~lib/internal/number/utoa32 + i32.load + call $~lib/util/number/utoa32 + local.tee $0 + call $~lib/rt/pure/__retain + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 return end - local.get $5 + local.get $1 + call $~lib/string/String#get:length + local.tee $5 i32.const 10 i32.add local.get $3 i32.mul i32.const 10 i32.add - local.tee $8 - call $~lib/internal/string/allocateUnsafe + local.tee $7 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $2 + i32.const 0 local.set $0 loop $repeat|0 local.get $6 local.get $3 i32.lt_s if - local.get $0 local.get $2 + local.get $0 local.get $6 i32.const 2 i32.shl local.get $4 i32.add - i32.load offset=8 - call $~lib/internal/number/itoa_stream - local.get $2 + i32.load + call $~lib/util/number/itoa_stream + local.get $0 i32.add - local.set $2 - local.get $7 + local.set $0 + local.get $5 if local.get $0 + i32.const 1 + i32.shl local.get $2 + i32.add local.get $1 - i32.const 0 local.get $5 - call $~lib/internal/string/copyUnsafe - local.get $2 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $0 local.get $5 i32.add - local.set $2 + local.set $0 end local.get $6 i32.const 1 @@ -6944,60 +7651,74 @@ br $repeat|0 end end - local.get $0 - local.set $1 - local.get $8 - local.get $0 + local.get $7 local.get $2 + local.get $0 local.get $3 i32.const 2 i32.shl local.get $4 i32.add - i32.load offset=8 - call $~lib/internal/number/itoa_stream - local.get $2 + i32.load + call $~lib/util/number/itoa_stream + local.get $0 i32.add - local.tee $2 + local.tee $0 i32.gt_s if - local.get $0 local.get $2 + local.get $0 call $~lib/string/String#substring - local.set $1 + local.set $0 + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release local.get $0 - i32.eqz - if - i32.const 0 - i32.const 4088 - i32.const 28 - i32.const 4 - call $~lib/env/abort - unreachable - end + return end local.get $1 + call $~lib/rt/pure/__release + local.get $2 + ) + (func $~lib/array/Array#join (; 164 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array#join_int + local.set $0 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + ) + (func $~lib/builtins/isFinite (; 165 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + local.get $0 + f64.sub + f64.const 0 + f64.eq ) - (func $~lib/internal/number/genDigits (; 121 ;) (type $FUNCSIG$iijijiji) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (param $6 i32) (result i32) + (func $~lib/util/number/genDigits (; 166 ;) (type $FUNCSIG$iijijiji) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (param $6 i32) (result i32) (local $7 i32) (local $8 i32) (local $9 i64) - (local $10 i64) + (local $10 i32) (local $11 i64) - (local $12 i32) + (local $12 i64) (local $13 i32) (local $14 i64) local.get $3 local.get $1 i64.sub - local.set $10 + local.set $9 i64.const 1 i32.const 0 local.get $4 i32.sub - local.tee $12 + local.tee $10 i64.extend_i32_s - local.tee $1 i64.shl local.tee $11 i64.const 1 @@ -7005,15 +7726,16 @@ local.tee $14 local.get $3 i64.and - local.set $9 + local.set $12 local.get $3 - local.get $1 + local.get $10 + i64.extend_i32_s i64.shr_u i32.wrap_i64 local.tee $7 - call $~lib/internal/number/decimalCount32 + call $~lib/util/number/decimalCount32 local.set $4 - i32.const 6616 + i32.const 6068 i32.load local.set $13 loop $continue|0 @@ -7166,7 +7888,7 @@ i32.and i32.const 48 i32.add - i32.store16 offset=4 + i32.store16 end local.get $4 i32.const 1 @@ -7174,26 +7896,26 @@ local.set $4 local.get $7 i64.extend_i32_u - local.get $12 + local.get $10 i64.extend_i32_s i64.shl - local.get $9 + local.get $12 i64.add local.tee $1 local.get $5 i64.le_u if - global.get $~lib/internal/number/_K + global.get $~lib/util/number/_K local.get $4 i32.add - global.set $~lib/internal/number/_K - local.get $13 + global.set $~lib/util/number/_K local.get $4 i32.const 2 i32.shl + local.get $13 i32.add - i64.load32_u offset=8 - local.get $12 + i64.load32_u + local.get $10 i64.extend_i32_s i64.shl local.set $3 @@ -7205,44 +7927,37 @@ local.get $0 i32.add local.tee $2 - i32.load16_u offset=4 + i32.load16_u local.set $4 loop $continue|2 + i32.const 1 + local.get $9 local.get $1 - local.get $10 - i64.lt_u - local.tee $0 - if - local.get $5 - local.get $1 - i64.sub - local.get $3 - i64.ge_u - local.set $0 - end - local.get $0 - if - local.get $1 - local.get $3 - i64.add - local.get $10 - i64.lt_u - local.tee $0 - i32.eqz - if - local.get $10 - local.get $1 - i64.sub - local.get $1 - local.get $3 - i64.add - local.get $10 - i64.sub - i64.gt_u - local.set $0 - end - end - local.get $0 + i64.sub + local.get $1 + local.get $3 + i64.add + local.get $9 + i64.sub + i64.gt_u + local.get $1 + local.get $3 + i64.add + local.get $9 + i64.lt_u + select + i32.const 0 + local.get $5 + local.get $1 + i64.sub + local.get $3 + i64.ge_u + i32.const 0 + local.get $1 + local.get $9 + i64.lt_u + select + select if local.get $4 i32.const 1 @@ -7257,7 +7972,7 @@ end local.get $2 local.get $4 - i32.store16 offset=4 + i32.store16 local.get $6 return end @@ -7269,11 +7984,11 @@ i64.const 10 i64.mul local.set $5 - local.get $9 + local.get $12 i64.const 10 i64.mul local.tee $3 - local.get $12 + local.get $10 i64.extend_i32_s i64.shr_u local.tee $1 @@ -7299,7 +8014,7 @@ i32.and i32.const 48 i32.add - i32.store16 offset=4 + i32.store16 end local.get $4 i32.const 1 @@ -7308,25 +8023,27 @@ local.get $3 local.get $14 i64.and - local.tee $9 + local.tee $12 local.get $5 i64.ge_u br_if $continue|3 - global.get $~lib/internal/number/_K + global.get $~lib/util/number/_K local.get $4 i32.add - global.set $~lib/internal/number/_K - local.get $13 + global.set $~lib/util/number/_K + local.get $12 + local.set $1 i32.const 0 local.get $4 i32.sub i32.const 2 i32.shl + local.get $13 i32.add - i64.load32_u offset=8 - local.get $10 + i64.load32_u + local.get $9 i64.mul - local.set $1 + local.set $3 local.get $6 i32.const 1 i32.sub @@ -7335,65 +8052,57 @@ local.get $0 i32.add local.tee $2 - i32.load16_u offset=4 + i32.load16_u local.set $4 loop $continue|4 - local.get $9 + i32.const 1 + local.get $3 + local.get $1 + i64.sub local.get $1 + local.get $11 + i64.add + local.get $3 + i64.sub + i64.gt_u + local.get $1 + local.get $11 + i64.add + local.get $3 i64.lt_u - local.tee $0 - if - local.get $5 - local.get $9 - i64.sub - local.get $11 - i64.ge_u - local.set $0 - end - local.get $0 - if - local.get $9 - local.get $11 - i64.add - local.get $1 - i64.lt_u - local.tee $0 - i32.eqz - if - local.get $1 - local.get $9 - i64.sub - local.get $9 - local.get $11 - i64.add - local.get $1 - i64.sub - i64.gt_u - local.set $0 - end - end - local.get $0 + select + i32.const 0 + local.get $5 + local.get $1 + i64.sub + local.get $11 + i64.ge_u + i32.const 0 + local.get $1 + local.get $3 + i64.lt_u + select + select if local.get $4 i32.const 1 i32.sub local.set $4 - local.get $9 + local.get $1 local.get $11 i64.add - local.set $9 + local.set $1 br $continue|4 end end local.get $2 local.get $4 - i32.store16 offset=4 + i32.store16 local.get $6 end ) - (func $~lib/internal/number/prettify (; 122 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/prettify (; 167 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - (local $4 i32) local.get $2 i32.eqz if @@ -7403,7 +8112,7 @@ local.get $0 i32.add i32.const 3145774 - i32.store offset=4 + i32.store local.get $1 i32.const 2 i32.add @@ -7415,14 +8124,13 @@ i32.add local.tee $3 i32.le_s - local.tee $4 - if + if (result i32) local.get $3 i32.const 21 i32.le_s - local.set $4 + else + i32.const 0 end - local.get $4 if (result i32) loop $repeat|0 block $break|0 @@ -7436,7 +8144,7 @@ local.get $0 i32.add i32.const 48 - i32.store16 offset=4 + i32.store16 local.get $1 i32.const 1 i32.add @@ -7450,88 +8158,73 @@ local.get $0 i32.add i32.const 3145774 - i32.store offset=4 + i32.store local.get $3 i32.const 2 i32.add else + local.get $3 + i32.const 21 + i32.le_s + i32.const 0 local.get $3 i32.const 0 i32.gt_s - local.tee $4 - if - local.get $3 - i32.const 21 - i32.le_s - local.set $4 - end - local.get $4 + select if (result i32) local.get $3 i32.const 1 i32.shl local.get $0 i32.add - i32.const 4 - i32.add - local.tee $4 + local.tee $0 i32.const 2 i32.add - local.get $4 + local.get $0 i32.const 0 local.get $2 i32.sub i32.const 1 i32.shl - call $~lib/internal/memory/memmove - local.get $3 - i32.const 1 - i32.shl + call $~lib/memory/memory.copy local.get $0 - i32.add i32.const 46 - i32.store16 offset=4 + i32.store16 local.get $1 i32.const 1 i32.add else + local.get $3 + i32.const 0 + i32.le_s + i32.const 0 i32.const -6 local.get $3 i32.lt_s - local.tee $2 - if - local.get $3 - i32.const 0 - i32.le_s - local.set $2 - end - local.get $2 + select if (result i32) - local.get $0 - i32.const 4 - i32.add - local.tee $2 i32.const 2 local.get $3 i32.sub - local.tee $4 + local.tee $3 i32.const 1 i32.shl + local.get $0 i32.add - local.get $2 + local.get $0 local.get $1 i32.const 1 i32.shl - call $~lib/internal/memory/memmove + call $~lib/memory/memory.copy local.get $0 i32.const 3014704 - i32.store offset=4 + i32.store i32.const 2 local.set $2 loop $repeat|1 block $break|1 local.get $2 - local.get $4 + local.get $3 i32.ge_s br_if $break|1 local.get $2 @@ -7540,7 +8233,7 @@ local.get $0 i32.add i32.const 48 - i32.store16 offset=4 + i32.store16 local.get $2 i32.const 1 i32.add @@ -7549,7 +8242,7 @@ end end local.get $1 - local.get $4 + local.get $3 i32.add else local.get $1 @@ -7558,7 +8251,7 @@ if (result i32) local.get $0 i32.const 101 - i32.store16 offset=6 + i32.store16 offset=2 local.get $0 i32.const 4 i32.add @@ -7580,17 +8273,17 @@ local.get $2 end local.get $2 - call $~lib/internal/number/decimalCount32 + call $~lib/util/number/decimalCount32 i32.const 1 i32.add local.tee $2 - call $~lib/internal/number/utoa32_lut + call $~lib/util/number/utoa_simple local.get $0 i32.const 45 i32.const 43 local.get $1 select - i32.store16 offset=4 + i32.store16 local.get $2 i32.const 2 i32.add @@ -7598,10 +8291,7 @@ local.get $0 i32.const 4 i32.add - local.tee $2 - i32.const 4 - i32.add - local.get $2 + local.get $0 i32.const 2 i32.add local.get $1 @@ -7610,50 +8300,50 @@ local.tee $2 i32.const 2 i32.sub - call $~lib/internal/memory/memmove + call $~lib/memory/memory.copy local.get $0 i32.const 46 - i32.store16 offset=6 + i32.store16 offset=2 local.get $0 local.get $2 i32.add local.tee $0 i32.const 101 - i32.store16 offset=6 + i32.store16 offset=2 local.get $0 i32.const 4 i32.add - local.tee $0 + local.tee $2 block (result i32) local.get $3 i32.const 1 i32.sub - local.tee $2 + local.tee $0 i32.const 0 i32.lt_s - local.tee $4 + local.tee $3 if i32.const 0 - local.get $2 + local.get $0 i32.sub - local.set $2 + local.set $0 end - local.get $2 + local.get $0 end - local.get $2 - call $~lib/internal/number/decimalCount32 + local.get $0 + call $~lib/util/number/decimalCount32 i32.const 1 i32.add - local.tee $2 - call $~lib/internal/number/utoa32_lut - local.get $0 + local.tee $0 + call $~lib/util/number/utoa_simple + local.get $2 i32.const 45 i32.const 43 - local.get $4 + local.get $3 select - i32.store16 offset=4 + i32.store16 + local.get $0 local.get $1 - local.get $2 i32.add i32.const 2 i32.add @@ -7662,38 +8352,30 @@ end end ) - (func $~lib/internal/number/dtoa_core (; 123 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/util/number/dtoa_core (; 168 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) (local $2 i64) (local $3 i32) (local $4 i64) - (local $5 i32) - (local $6 i32) - (local $7 i64) + (local $5 i64) + (local $6 i64) + (local $7 i32) (local $8 i64) (local $9 i64) (local $10 i32) - (local $11 i64) - (local $12 i64) - (local $13 i32) - (local $14 i64) - (local $15 i64) - (local $16 i64) - (local $17 i64) - (local $18 i64) - (local $19 i64) + (local $11 i32) local.get $1 f64.const 0 f64.lt local.tee $10 - if (result f64) + if local.get $0 i32.const 45 - i32.store16 offset=4 + i32.store16 local.get $1 f64.neg - else - local.get $1 + local.set $1 end + local.get $1 i64.reinterpret_f64 local.tee $2 i64.const 9218868437227405312 @@ -7701,68 +8383,68 @@ i64.const 52 i64.shr_u i32.wrap_i64 - local.set $5 + local.tee $11 + i32.const 0 + i32.ne + local.set $7 local.get $2 i64.const 4503599627370495 i64.and - local.get $5 - i32.const 0 - i32.ne - local.tee $6 + local.get $7 i64.extend_i32_u i64.const 52 i64.shl i64.add - local.tee $2 + local.tee $5 i64.const 1 i64.shl i64.const 1 i64.add - local.tee $7 + local.tee $2 i64.clz i32.wrap_i64 local.set $3 - local.get $7 + local.get $2 local.get $3 i64.extend_i32_s i64.shl - global.set $~lib/internal/number/_frc_plus - local.get $5 + global.set $~lib/util/number/_frc_plus + local.get $11 i32.const 1 - local.get $6 + local.get $7 select i32.const 1075 i32.sub - local.tee $5 + local.tee $7 i32.const 1 i32.sub local.get $3 i32.sub local.set $3 - local.get $2 - local.get $2 + local.get $5 + local.get $5 i64.const 4503599627370496 i64.eq i32.const 1 i32.add - local.tee $6 + local.tee $11 i64.extend_i32_s i64.shl i64.const 1 i64.sub - local.get $5 - local.get $6 + local.get $7 + local.get $11 i32.sub local.get $3 i32.sub i64.extend_i32_s i64.shl - global.set $~lib/internal/number/_frc_minus + global.set $~lib/util/number/_frc_minus local.get $3 - global.set $~lib/internal/number/_exp + global.set $~lib/util/number/_exp i32.const 348 i32.const -61 - global.get $~lib/internal/number/_exp + global.get $~lib/util/number/_exp i32.sub f64.convert_i32_s f64.const 0.30102999566398114 @@ -7784,82 +8466,52 @@ local.tee $3 i32.const 3 i32.shl - local.tee $6 i32.sub - global.set $~lib/internal/number/_K - i32.const 6544 + global.set $~lib/util/number/_K + i32.const 5756 i32.load - local.set $13 - i32.const 6280 - i32.load - local.get $6 + local.get $3 + i32.const 3 + i32.shl i32.add - i64.load offset=8 - global.set $~lib/internal/number/_frc_pow - local.get $13 + i64.load + global.set $~lib/util/number/_frc_pow + i32.const 5980 + i32.load local.get $3 i32.const 1 i32.shl i32.add - i32.load16_s offset=8 - global.set $~lib/internal/number/_exp_pow - local.get $2 - local.get $2 - i64.clz - i32.wrap_i64 - local.tee $3 - i64.extend_i32_s - i64.shl - local.tee $7 - i64.const 4294967295 - i64.and - local.tee $11 - global.get $~lib/internal/number/_frc_pow - local.tee $2 - i64.const 4294967295 - i64.and - local.tee $14 - i64.mul - local.set $15 - global.get $~lib/internal/number/_frc_plus - local.tee $8 - i64.const 4294967295 - i64.and - local.tee $4 - local.get $2 - i64.const 4294967295 - i64.and - local.tee $9 - i64.mul - local.set $12 - global.get $~lib/internal/number/_frc_minus - local.tee $16 + i32.load16_s + global.set $~lib/util/number/_exp_pow + global.get $~lib/util/number/_frc_pow + local.tee $6 i64.const 4294967295 i64.and - local.tee $17 - local.get $2 + local.set $2 + global.get $~lib/util/number/_frc_plus + local.tee $8 i64.const 4294967295 i64.and - local.tee $18 - i64.mul - local.set $19 - local.get $4 - local.get $2 + local.tee $4 + local.get $6 i64.const 32 i64.shr_u - local.tee $4 + local.tee $6 i64.mul local.get $8 i64.const 32 i64.shr_u local.tee $8 - local.get $9 + local.get $2 + i64.mul + local.get $2 + local.get $4 i64.mul - local.get $12 i64.const 32 i64.shr_u i64.add - local.tee $9 + local.tee $4 i64.const 4294967295 i64.and i64.add @@ -7867,10 +8519,10 @@ i64.add i64.const 32 i64.shr_u - local.get $4 + local.get $6 local.get $8 i64.mul - local.get $9 + local.get $4 i64.const 32 i64.shr_u i64.add @@ -7878,23 +8530,26 @@ i64.const 1 i64.sub local.tee $8 - local.get $2 - i64.const 32 - i64.shr_u + local.get $6 + global.get $~lib/util/number/_frc_minus local.tee $4 - local.get $17 + i64.const 4294967295 + i64.and + local.tee $9 i64.mul - local.get $16 + local.get $4 i64.const 32 i64.shr_u - local.tee $9 - local.get $18 + local.tee $4 + local.get $2 + i64.mul + local.get $2 + local.get $9 i64.mul - local.get $19 i64.const 32 i64.shr_u i64.add - local.tee $12 + local.tee $9 i64.const 4294967295 i64.and i64.add @@ -7903,9 +8558,9 @@ i64.const 32 i64.shr_u local.get $4 - local.get $9 + local.get $6 i64.mul - local.get $12 + local.get $9 i64.const 32 i64.shr_u i64.add @@ -7920,23 +8575,32 @@ local.get $0 i32.add local.get $0 - local.get $2 - i64.const 32 - i64.shr_u - local.tee $2 - local.get $11 + local.get $6 + local.get $5 + local.get $5 + i64.clz + i32.wrap_i64 + local.tee $0 + i64.extend_i32_s + i64.shl + local.tee $5 + i64.const 4294967295 + i64.and + local.tee $9 i64.mul - local.get $7 + local.get $5 i64.const 32 i64.shr_u - local.tee $7 - local.get $14 + local.tee $5 + local.get $2 + i64.mul + local.get $2 + local.get $9 i64.mul - local.get $15 i64.const 32 i64.shr_u i64.add - local.tee $11 + local.tee $2 i64.const 4294967295 i64.and i64.add @@ -7944,92 +8608,92 @@ i64.add i64.const 32 i64.shr_u - local.get $2 - local.get $7 + local.get $5 + local.get $6 i64.mul - local.get $11 + local.get $2 i64.const 32 i64.shr_u i64.add i64.add - global.get $~lib/internal/number/_exp_pow - local.tee $0 - local.get $5 - local.get $3 + global.get $~lib/util/number/_exp_pow + local.tee $3 + local.get $7 + local.get $0 i32.sub i32.add i32.const -64 i32.sub local.get $8 - global.get $~lib/internal/number/_exp - local.get $0 + global.get $~lib/util/number/_exp + local.get $3 i32.add i32.const -64 i32.sub local.get $4 local.get $10 - call $~lib/internal/number/genDigits + call $~lib/util/number/genDigits local.get $10 i32.sub - global.get $~lib/internal/number/_K - call $~lib/internal/number/prettify + global.get $~lib/util/number/_K + call $~lib/util/number/prettify local.get $10 i32.add ) - (func $~lib/internal/number/dtoa (; 124 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + (func $~lib/util/number/dtoa (; 169 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) (local $1 i32) (local $2 i32) local.get $0 f64.const 0 f64.eq if - i32.const 5176 + i32.const 4920 + call $~lib/rt/pure/__retain return end local.get $0 - local.get $0 - f64.sub - f64.const 0 - f64.ne + call $~lib/builtins/isFinite + i32.eqz if local.get $0 - local.get $0 - f64.ne + call $~lib/builtins/isNaN if - i32.const 5192 + i32.const 4944 + call $~lib/rt/pure/__retain return end - i32.const 5208 - i32.const 5232 + i32.const 4968 + i32.const 5008 local.get $0 f64.const 0 f64.lt select + call $~lib/rt/pure/__retain return end - i32.const 28 - call $~lib/internal/string/allocateUnsafe - local.tee $2 + i32.const 56 + i32.const 1 + call $~lib/rt/tlsf/__alloc + local.tee $1 local.get $0 - call $~lib/internal/number/dtoa_core - local.set $1 - local.get $2 - local.get $1 - call $~lib/string/String#substring - local.set $1 - local.get $2 - i32.eqz + call $~lib/util/number/dtoa_core + local.tee $2 + i32.const 28 + i32.eq if - i32.const 0 - i32.const 4088 - i32.const 28 - i32.const 4 - call $~lib/env/abort - unreachable + local.get $1 + call $~lib/rt/pure/__retain + return end local.get $1 + local.get $2 + call $~lib/string/String#substring + local.set $2 + local.get $1 + call $~lib/rt/tlsf/__free + local.get $2 ) - (func $~lib/internal/number/dtoa_stream (; 125 ;) (type $FUNCSIG$iiid) (param $0 i32) (param $1 i32) (param $2 f64) (result i32) + (func $~lib/util/number/dtoa_stream (; 170 ;) (type $FUNCSIG$iiid) (param $0 i32) (param $1 i32) (param $2 f64) (result i32) (local $3 i32) local.get $1 i32.const 1 @@ -8043,35 +8707,32 @@ if local.get $0 i32.const 48 - i32.store16 offset=4 + i32.store16 local.get $0 i32.const 46 - i32.store16 offset=6 + i32.store16 offset=2 local.get $0 i32.const 48 - i32.store16 offset=8 + i32.store16 offset=4 i32.const 3 return end local.get $2 - local.get $2 - f64.sub - f64.const 0 - f64.ne + call $~lib/builtins/isFinite + i32.eqz if local.get $2 - local.get $2 - f64.ne + call $~lib/builtins/isNaN if local.get $0 i32.const 78 - i32.store16 offset=4 + i32.store16 local.get $0 i32.const 97 - i32.store16 offset=6 + i32.store16 offset=2 local.get $0 i32.const 78 - i32.store16 offset=8 + i32.store16 offset=4 i32.const 3 return else @@ -8083,18 +8744,14 @@ i32.add local.set $1 local.get $0 - i32.const 4 - i32.add - i32.const 5208 - i32.const 5232 + i32.const 4968 + i32.const 5008 local.get $3 select - i32.const 4 - i32.add local.get $1 i32.const 1 i32.shl - call $~lib/internal/memory/memmove + call $~lib/memory/memory.copy local.get $1 return end @@ -8102,82 +8759,102 @@ end local.get $0 local.get $2 - call $~lib/internal/number/dtoa_core + call $~lib/util/number/dtoa_core ) - (func $~lib/array/Array#join (; 126 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) + (func $~lib/array/Array#join_flt (; 171 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - i32.const 6692 - i32.load + i32.const 4896 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.load offset=12 i32.const 1 i32.sub - local.tee $3 + local.tee $2 i32.const 0 i32.lt_s if - i32.const 3904 + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $0 + i32.const 4896 + call $~lib/rt/pure/__release + local.get $0 return end - i32.const 6688 - i32.load - local.set $4 - i32.const 5168 - i32.load - local.tee $1 - i32.const 0 - i32.ne - local.set $6 - local.get $3 + local.get $0 + i32.load offset=4 + local.set $3 + local.get $2 i32.eqz if - local.get $4 - f64.load offset=8 - call $~lib/internal/number/dtoa + local.get $3 + f64.load + call $~lib/util/number/dtoa + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + i32.const 4896 + call $~lib/rt/pure/__release + local.get $1 return end - local.get $1 + i32.const 4896 + call $~lib/string/String#get:length + local.tee $4 i32.const 28 i32.add - local.get $3 + local.get $2 i32.mul i32.const 28 i32.add - local.tee $7 - call $~lib/internal/string/allocateUnsafe - local.set $2 + local.tee $6 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $1 + i32.const 0 + local.set $0 loop $repeat|0 local.get $5 - local.get $3 + local.get $2 i32.lt_s if - local.get $2 + local.get $1 local.get $0 local.get $5 i32.const 3 i32.shl - local.get $4 + local.get $3 i32.add - f64.load offset=8 - call $~lib/internal/number/dtoa_stream + f64.load + call $~lib/util/number/dtoa_stream local.get $0 i32.add local.set $0 - local.get $6 + local.get $4 if - local.get $2 local.get $0 - i32.const 5168 - i32.const 0 + i32.const 1 + i32.shl local.get $1 - call $~lib/internal/string/copyUnsafe + i32.add + i32.const 4896 + local.get $4 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy local.get $0 - local.get $1 + local.get $4 i32.add local.set $0 end @@ -8188,41 +8865,37 @@ br $repeat|0 end end - local.get $2 - local.set $1 - local.get $7 - local.get $2 + local.get $6 + local.get $1 local.get $0 - local.get $3 + local.get $2 i32.const 3 i32.shl - local.get $4 + local.get $3 i32.add - f64.load offset=8 - call $~lib/internal/number/dtoa_stream + f64.load + call $~lib/util/number/dtoa_stream local.get $0 i32.add local.tee $0 i32.gt_s if - local.get $2 + local.get $1 local.get $0 call $~lib/string/String#substring - local.set $1 - local.get $2 - i32.eqz - if - i32.const 0 - i32.const 4088 - i32.const 28 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.set $0 + i32.const 4896 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + return end + i32.const 4896 + call $~lib/rt/pure/__release local.get $1 ) - (func $~lib/array/Array<~lib/string/String>#join (; 127 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/string/String>#join_str (; 172 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -8230,139 +8903,224 @@ (local $6 i32) (local $7 i32) (local $8 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.load offset=4 + i32.load offset=12 i32.const 1 i32.sub - local.tee $4 + local.tee $6 i32.const 0 i32.lt_s if - i32.const 3904 + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $0 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 return end local.get $0 - i32.load - local.set $5 - local.get $1 - i32.load - local.tee $7 - i32.const 0 - i32.ne - local.set $8 - local.get $4 + i32.load offset=4 + local.set $7 + local.get $6 i32.eqz if - local.get $5 - i32.load offset=8 + local.get $7 + i32.load + call $~lib/rt/pure/__retain + local.set $0 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 return end + local.get $1 + call $~lib/string/String#get:length + local.set $8 i32.const 0 local.set $0 - local.get $4 + local.get $6 i32.const 1 i32.add - local.set $3 + local.set $5 loop $repeat|0 block $break|0 - local.get $0 - local.get $3 + local.get $2 + local.get $5 i32.ge_s br_if $break|0 - local.get $5 local.get $0 + local.tee $4 + local.get $2 i32.const 2 i32.shl + local.get $7 i32.add - i32.load offset=8 i32.load - local.get $2 - i32.add - local.set $2 + local.tee $0 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $4 + call $~lib/rt/pure/__release + end local.get $0 + if + local.get $0 + call $~lib/string/String#get:length + local.get $3 + i32.add + local.set $3 + end + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $repeat|0 end end i32.const 0 - local.set $0 - local.get $4 - local.get $7 + local.set $2 + local.get $6 + local.get $8 i32.mul - local.get $2 + local.get $3 i32.add - call $~lib/internal/string/allocateUnsafe - local.set $2 - i32.const 0 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.set $3 + i32.const 0 + local.set $5 loop $repeat|1 block $break|1 - local.get $3 - local.get $4 + local.get $5 + local.get $6 i32.ge_s br_if $break|1 + local.get $0 + local.tee $4 local.get $5 - local.get $3 i32.const 2 i32.shl + local.get $7 i32.add - i32.load offset=8 - local.tee $6 + i32.load + local.tee $0 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $4 + call $~lib/rt/pure/__release + end + local.get $0 if local.get $2 + i32.const 1 + i32.shl + local.get $3 + i32.add local.get $0 - local.get $6 - i32.const 0 - local.get $6 - i32.load - local.tee $6 - call $~lib/internal/string/copyUnsafe local.get $0 - local.get $6 + call $~lib/string/String#get:length + local.tee $4 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $2 + local.get $4 i32.add - local.set $0 + local.set $2 end local.get $8 if local.get $2 - local.get $0 + i32.const 1 + i32.shl + local.get $3 + i32.add local.get $1 - i32.const 0 - local.get $7 - call $~lib/internal/string/copyUnsafe - local.get $0 - local.get $7 + local.get $8 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $2 + local.get $8 i32.add - local.set $0 + local.set $2 end - local.get $3 + local.get $5 i32.const 1 i32.add - local.set $3 + local.set $5 br $repeat|1 end end - local.get $5 - local.get $4 + local.get $0 + local.tee $4 + local.get $6 i32.const 2 i32.shl + local.get $7 i32.add - i32.load offset=8 - local.tee $1 + i32.load + local.tee $0 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $4 + call $~lib/rt/pure/__release + end + local.get $0 if local.get $2 + i32.const 1 + i32.shl + local.get $3 + i32.add local.get $0 - local.get $1 - i32.const 0 - local.get $1 - i32.load - call $~lib/internal/string/copyUnsafe + local.get $0 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + call $~lib/memory/memory.copy end - local.get $2 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/array/Array#join (; 128 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array<~lib/string/String>#join (; 173 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/string/String>#join_str + local.set $0 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + ) + (func $std/array/Ref#constructor (; 174 ;) (type $FUNCSIG$i) (result i32) + i32.const 0 + i32.const 18 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + ) + (func $~lib/array/Array#join_ref (; 175 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -8370,129 +9128,171 @@ (local $5 i32) (local $6 i32) (local $7 i32) + (local $8 i32) + i32.const 4512 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.load offset=4 + i32.load offset=12 i32.const 1 i32.sub local.tee $3 i32.const 0 i32.lt_s if - i32.const 3904 + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $0 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $0 return end local.get $0 - i32.load - local.set $5 - i32.const 4216 - i32.load - local.tee $4 - i32.const 0 - i32.ne - local.set $6 + i32.load offset=4 + local.set $7 local.get $3 i32.eqz if - i32.const 6872 + i32.const 6248 + call $~lib/rt/pure/__retain + local.set $0 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $0 return end - local.get $4 + i32.const 4512 + call $~lib/string/String#get:length + local.tee $5 i32.const 15 i32.add local.get $3 i32.mul i32.const 15 i32.add - local.tee $7 - call $~lib/internal/string/allocateUnsafe + local.tee $8 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $2 + i32.const 0 local.set $0 loop $repeat|0 - local.get $2 + local.get $6 local.get $3 i32.lt_s if - local.get $2 + local.get $0 + local.set $4 + local.get $4 + local.get $6 i32.const 2 i32.shl - local.get $5 + local.get $7 i32.add - i32.load offset=8 + i32.load + local.tee $0 + i32.ne if local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $4 + call $~lib/rt/pure/__release + end + local.get $0 + if local.get $1 - i32.const 6872 - i32.const 0 - i32.const 15 - call $~lib/internal/string/copyUnsafe + i32.const 1 + i32.shl + local.get $2 + i32.add + i32.const 6248 + i32.const 30 + call $~lib/memory/memory.copy local.get $1 i32.const 15 i32.add local.set $1 end - local.get $6 + local.get $5 if - local.get $0 local.get $1 - i32.const 4216 - i32.const 0 - local.get $4 - call $~lib/internal/string/copyUnsafe + i32.const 1 + i32.shl + local.get $2 + i32.add + i32.const 4512 + local.get $5 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy local.get $1 - local.get $4 + local.get $5 i32.add local.set $1 end - local.get $2 + local.get $6 i32.const 1 i32.add - local.set $2 + local.set $6 br $repeat|0 end end - local.get $0 - local.set $2 block (result i32) local.get $3 i32.const 2 i32.shl - local.get $5 + local.get $7 i32.add - i32.load offset=8 + i32.load if - local.get $0 local.get $1 - i32.const 6872 - i32.const 0 - i32.const 15 - call $~lib/internal/string/copyUnsafe + i32.const 1 + i32.shl + local.get $2 + i32.add + i32.const 6248 + i32.const 30 + call $~lib/memory/memory.copy local.get $1 i32.const 15 i32.add local.set $1 end - local.get $7 + local.get $8 local.get $1 i32.gt_s end if - local.get $0 + local.get $2 local.get $1 call $~lib/string/String#substring - local.set $2 + local.set $4 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release local.get $0 - i32.eqz - if - i32.const 0 - i32.const 4088 - i32.const 28 - i32.const 4 - call $~lib/env/abort - unreachable - end + call $~lib/rt/pure/__release + local.get $4 + return end + i32.const 4512 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release local.get $2 ) - (func $~lib/internal/number/itoa_stream (; 129 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#toString (; 176 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 4512 + call $~lib/array/Array#join + ) + (func $~lib/util/number/itoa_stream (; 177 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $1 i32.const 1 @@ -8507,7 +9307,7 @@ if local.get $0 i32.const 48 - i32.store16 offset=4 + i32.store16 i32.const 1 return end @@ -8531,94 +9331,114 @@ i32.const 24 i32.shr_s local.tee $3 - call $~lib/internal/number/decimalCount32 + call $~lib/util/number/decimalCount32 local.get $1 i32.add local.set $2 local.get $0 local.get $3 local.get $2 - call $~lib/internal/number/utoa32_lut + call $~lib/util/number/utoa_simple local.get $1 if local.get $0 i32.const 45 - i32.store16 offset=4 + i32.store16 end local.get $2 ) - (func $~lib/array/Array#join (; 130 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) + (func $~lib/array/Array#join_int (; 178 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - i32.const 7068 - i32.load + i32.const 4512 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.load offset=12 i32.const 1 i32.sub - local.tee $3 + local.tee $2 i32.const 0 i32.lt_s - if - i32.const 3904 - return - end - i32.const 7064 - i32.load - local.set $4 - i32.const 4216 - i32.load - local.tee $1 - i32.const 0 - i32.ne - local.set $6 - local.get $3 + if + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $0 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $0 + return + end + local.get $0 + i32.load offset=4 + local.set $3 + local.get $2 i32.eqz if - local.get $4 - i32.load8_s offset=8 - call $~lib/internal/number/itoa32 + local.get $3 + i32.load8_s + call $~lib/util/number/itoa32 + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + i32.const 4512 + call $~lib/rt/pure/__release + local.get $1 return end - local.get $1 + i32.const 4512 + call $~lib/string/String#get:length + local.tee $4 i32.const 11 i32.add - local.get $3 + local.get $2 i32.mul i32.const 11 i32.add - local.tee $7 - call $~lib/internal/string/allocateUnsafe - local.set $2 + local.tee $6 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $1 + i32.const 0 + local.set $0 loop $repeat|0 local.get $5 - local.get $3 + local.get $2 i32.lt_s if - local.get $2 + local.get $1 local.get $0 - local.get $4 + local.get $3 local.get $5 i32.add - i32.load8_s offset=8 - call $~lib/internal/number/itoa_stream + i32.load8_s + call $~lib/util/number/itoa_stream local.get $0 i32.add local.set $0 - local.get $6 + local.get $4 if - local.get $2 local.get $0 - i32.const 4216 - i32.const 0 + i32.const 1 + i32.shl local.get $1 - call $~lib/internal/string/copyUnsafe + i32.add + i32.const 4512 + local.get $4 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy local.get $0 - local.get $1 + local.get $4 i32.add local.set $0 end @@ -8629,39 +9449,35 @@ br $repeat|0 end end - local.get $2 - local.set $1 - local.get $7 - local.get $2 + local.get $6 + local.get $1 local.get $0 + local.get $2 local.get $3 - local.get $4 i32.add - i32.load8_s offset=8 - call $~lib/internal/number/itoa_stream + i32.load8_s + call $~lib/util/number/itoa_stream local.get $0 i32.add local.tee $0 i32.gt_s if - local.get $2 + local.get $1 local.get $0 call $~lib/string/String#substring - local.set $1 - local.get $2 - i32.eqz - if - i32.const 0 - i32.const 4088 - i32.const 28 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.set $0 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + return end + i32.const 4512 + call $~lib/rt/pure/__release local.get $1 ) - (func $~lib/internal/number/itoa_stream (; 131 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/itoa_stream (; 179 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $1 i32.const 1 i32.shl @@ -8675,7 +9491,7 @@ if local.get $0 i32.const 48 - i32.store16 offset=4 + i32.store16 i32.const 1 return end @@ -8683,88 +9499,108 @@ i32.const 65535 i32.and local.tee $2 - call $~lib/internal/number/decimalCount32 + call $~lib/util/number/decimalCount32 local.set $1 local.get $0 local.get $2 local.get $1 - call $~lib/internal/number/utoa32_lut + call $~lib/util/number/utoa_simple local.get $1 ) - (func $~lib/array/Array#join (; 132 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) + (func $~lib/array/Array#join_int (; 180 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - i32.const 7132 - i32.load + i32.const 4512 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.load offset=12 i32.const 1 i32.sub - local.tee $3 + local.tee $2 i32.const 0 i32.lt_s if - i32.const 3904 + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $0 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $0 return end - i32.const 7128 - i32.load - local.set $4 - i32.const 4216 - i32.load - local.tee $1 - i32.const 0 - i32.ne - local.set $6 - local.get $3 + local.get $0 + i32.load offset=4 + local.set $3 + local.get $2 i32.eqz if - local.get $4 - i32.load16_u offset=8 - call $~lib/internal/number/utoa32 + local.get $3 + i32.load16_u + call $~lib/util/number/utoa32 + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + i32.const 4512 + call $~lib/rt/pure/__release + local.get $1 return end - local.get $1 + i32.const 4512 + call $~lib/string/String#get:length + local.tee $4 i32.const 10 i32.add - local.get $3 + local.get $2 i32.mul i32.const 10 i32.add - local.tee $7 - call $~lib/internal/string/allocateUnsafe - local.set $2 + local.tee $6 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $1 + i32.const 0 + local.set $0 loop $repeat|0 local.get $5 - local.get $3 + local.get $2 i32.lt_s if - local.get $2 + local.get $1 local.get $0 local.get $5 i32.const 1 i32.shl - local.get $4 + local.get $3 i32.add - i32.load16_u offset=8 - call $~lib/internal/number/itoa_stream + i32.load16_u + call $~lib/util/number/itoa_stream local.get $0 i32.add local.set $0 - local.get $6 + local.get $4 if - local.get $2 local.get $0 - i32.const 4216 - i32.const 0 + i32.const 1 + i32.shl local.get $1 - call $~lib/internal/string/copyUnsafe + i32.add + i32.const 4512 + local.get $4 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy local.get $0 - local.get $1 + local.get $4 i32.add local.set $0 end @@ -8775,199 +9611,122 @@ br $repeat|0 end end - local.get $2 - local.set $1 - local.get $7 - local.get $2 + local.get $6 + local.get $1 local.get $0 - local.get $3 + local.get $2 i32.const 1 i32.shl - local.get $4 + local.get $3 i32.add - i32.load16_u offset=8 - call $~lib/internal/number/itoa_stream + i32.load16_u + call $~lib/util/number/itoa_stream local.get $0 i32.add local.tee $0 i32.gt_s if - local.get $2 + local.get $1 local.get $0 call $~lib/string/String#substring - local.set $1 - local.get $2 - i32.eqz - if - i32.const 0 - i32.const 4088 - i32.const 28 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.set $0 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + return end + i32.const 4512 + call $~lib/rt/pure/__release local.get $1 ) - (func $~lib/internal/number/decimalCount64 (; 133 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/number/decimalCount64 (; 181 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + i32.const 11 + i32.const 12 local.get $0 - i64.const 1000000000000000 + i64.const 100000000000 i64.lt_u - if (result i32) - local.get $0 - i64.const 1000000000000 - i64.lt_u - if (result i32) - i32.const 11 - i32.const 12 - local.get $0 - i64.const 100000000000 - i64.lt_u - select - else - i32.const 13 - i32.const 14 - i32.const 15 - local.get $0 - i64.const 100000000000000 - i64.lt_u - select - local.get $0 - i64.const 10000000000000 - i64.lt_u - select - end - else - local.get $0 - i64.const 100000000000000000 - i64.lt_u - if (result i32) - i32.const 16 - i32.const 17 - local.get $0 - i64.const 10000000000000000 - i64.lt_u - select - else - i32.const 18 - i32.const 19 - i32.const 20 - local.get $0 - i64.const -8446744073709551616 - i64.lt_u - select - local.get $0 - i64.const 1000000000000000000 - i64.lt_u - select - end - end - ) - (func $~lib/internal/number/utoa64_lut (; 134 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - i32.const 4832 - i32.load - local.set $3 - loop $continue|0 - local.get $1 - i64.const 100000000 - i64.ge_u - if - local.get $1 - local.get $1 - i64.const 100000000 - i64.div_u - local.tee $1 - i64.const 100000000 - i64.mul - i64.sub - i32.wrap_i64 - local.tee $4 - i32.const 10000 - i32.div_u - local.tee $5 - i32.const 100 - i32.div_u - local.set $6 - local.get $5 - i32.const 100 - i32.rem_u - local.set $5 - local.get $2 - i32.const 4 - i32.sub - local.tee $2 - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $3 - local.get $4 - i32.const 10000 - i32.rem_u - local.tee $4 - i32.const 100 - i32.div_u - i32.const 2 - i32.shl - i32.add - i64.load32_u offset=8 - local.get $3 - local.get $4 - i32.const 100 - i32.rem_u - i32.const 2 - i32.shl - i32.add - i64.load32_u offset=8 - i64.const 32 - i64.shl - i64.or - i64.store offset=4 - local.get $2 - i32.const 4 - i32.sub - local.tee $2 - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $3 - local.get $6 - i32.const 2 - i32.shl - i32.add - i64.load32_u offset=8 - local.get $3 - local.get $5 - i32.const 2 - i32.shl - i32.add - i64.load32_u offset=8 - i64.const 32 - i64.shl - i64.or - i64.store offset=4 - br $continue|0 - end - end + select + i32.const 13 + i32.const 14 + i32.const 15 local.get $0 - local.get $1 - i32.wrap_i64 - local.get $2 - call $~lib/internal/number/utoa32_lut + i64.const 100000000000000 + i64.lt_u + select + local.get $0 + i64.const 10000000000000 + i64.lt_u + select + local.get $0 + i64.const 1000000000000 + i64.lt_u + select + i32.const 16 + i32.const 17 + local.get $0 + i64.const 10000000000000000 + i64.lt_u + select + i32.const 18 + i32.const 19 + i32.const 20 + local.get $0 + i64.const -8446744073709551616 + i64.lt_u + select + local.get $0 + i64.const 1000000000000000000 + i64.lt_u + select + local.get $0 + i64.const 100000000000000000 + i64.lt_u + select + local.get $0 + i64.const 1000000000000000 + i64.lt_u + select ) - (func $~lib/internal/number/utoa64 (; 135 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/number/utoa_simple (; 182 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) + (local $3 i64) + loop $continue|0 + local.get $1 + i64.const 10 + i64.div_u + local.set $3 + local.get $2 + i32.const 1 + i32.sub + local.tee $2 + i32.const 1 + i32.shl + local.get $0 + i32.add + local.get $1 + i64.const 10 + i64.rem_u + i32.wrap_i64 + i32.const 48 + i32.add + i32.store16 + local.get $3 + local.tee $1 + i64.const 0 + i64.ne + br_if $continue|0 + end + ) + (func $~lib/util/number/utoa64 (; 183 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) local.get $0 i64.eqz if - i32.const 4312 + i32.const 4608 + call $~lib/rt/pure/__retain return end local.get $0 @@ -8977,26 +9736,33 @@ local.get $0 i32.wrap_i64 local.tee $1 - call $~lib/internal/number/decimalCount32 + call $~lib/util/number/decimalCount32 local.tee $3 - call $~lib/internal/string/allocateUnsafe + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc local.tee $2 local.get $1 local.get $3 - call $~lib/internal/number/utoa32_lut + call $~lib/util/number/utoa_simple else local.get $0 - call $~lib/internal/number/decimalCount64 + call $~lib/util/number/decimalCount64 local.tee $1 - call $~lib/internal/string/allocateUnsafe + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc local.tee $2 local.get $0 local.get $1 - call $~lib/internal/number/utoa64_lut + call $~lib/util/number/utoa_simple end local.get $2 + call $~lib/rt/pure/__retain ) - (func $~lib/internal/number/itoa_stream (; 136 ;) (type $FUNCSIG$iiij) (param $0 i32) (param $1 i32) (param $2 i64) (result i32) + (func $~lib/util/number/itoa_stream (; 184 ;) (type $FUNCSIG$iiij) (param $0 i32) (param $1 i32) (param $2 i64) (result i32) (local $3 i32) local.get $1 i32.const 1 @@ -9009,7 +9775,7 @@ if local.get $0 i32.const 48 - i32.store16 offset=4 + i32.store16 i32.const 1 return end @@ -9020,96 +9786,116 @@ local.get $2 i32.wrap_i64 local.tee $3 - call $~lib/internal/number/decimalCount32 + call $~lib/util/number/decimalCount32 local.set $1 local.get $0 local.get $3 local.get $1 - call $~lib/internal/number/utoa32_lut + call $~lib/util/number/utoa_simple else local.get $0 local.get $2 local.get $2 - call $~lib/internal/number/decimalCount64 + call $~lib/util/number/decimalCount64 local.tee $1 - call $~lib/internal/number/utoa64_lut + call $~lib/util/number/utoa_simple end local.get $1 ) - (func $~lib/array/Array#join (; 137 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) + (func $~lib/array/Array#join_int (; 185 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - i32.const 7236 - i32.load + i32.const 4512 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.load offset=12 i32.const 1 i32.sub - local.tee $3 + local.tee $2 i32.const 0 i32.lt_s if - i32.const 3904 + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $0 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $0 return end - i32.const 7232 - i32.load - local.set $4 - i32.const 4216 - i32.load - local.tee $1 - i32.const 0 - i32.ne - local.set $6 - local.get $3 + local.get $0 + i32.load offset=4 + local.set $3 + local.get $2 i32.eqz if - local.get $4 - i64.load offset=8 - call $~lib/internal/number/utoa64 + local.get $3 + i64.load + call $~lib/util/number/utoa64 + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + i32.const 4512 + call $~lib/rt/pure/__release + local.get $1 return end - local.get $1 + i32.const 4512 + call $~lib/string/String#get:length + local.tee $4 i32.const 20 i32.add - local.get $3 + local.get $2 i32.mul i32.const 20 i32.add - local.tee $7 - call $~lib/internal/string/allocateUnsafe - local.set $2 + local.tee $6 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $1 + i32.const 0 + local.set $0 loop $repeat|0 local.get $5 - local.get $3 + local.get $2 i32.lt_s if - local.get $2 + local.get $1 local.get $0 local.get $5 i32.const 3 i32.shl - local.get $4 + local.get $3 i32.add - i64.load offset=8 - call $~lib/internal/number/itoa_stream + i64.load + call $~lib/util/number/itoa_stream local.get $0 i32.add local.set $0 - local.get $6 + local.get $4 if - local.get $2 local.get $0 - i32.const 4216 - i32.const 0 + i32.const 1 + i32.shl local.get $1 - call $~lib/internal/string/copyUnsafe + i32.add + i32.const 4512 + local.get $4 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy local.get $0 - local.get $1 + local.get $4 i32.add local.set $0 end @@ -9120,41 +9906,37 @@ br $repeat|0 end end - local.get $2 - local.set $1 - local.get $7 - local.get $2 + local.get $6 + local.get $1 local.get $0 - local.get $3 + local.get $2 i32.const 3 i32.shl - local.get $4 + local.get $3 i32.add - i64.load offset=8 - call $~lib/internal/number/itoa_stream + i64.load + call $~lib/util/number/itoa_stream local.get $0 i32.add local.tee $0 i32.gt_s if - local.get $2 + local.get $1 local.get $0 call $~lib/string/String#substring - local.set $1 - local.get $2 - i32.eqz - if - i32.const 0 - i32.const 4088 - i32.const 28 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.set $0 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + return end + i32.const 4512 + call $~lib/rt/pure/__release local.get $1 ) - (func $~lib/internal/number/itoa64 (; 138 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/number/itoa64 (; 186 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -9162,7 +9944,8 @@ local.get $0 i64.eqz if - i32.const 4312 + i32.const 4608 + call $~lib/rt/pure/__retain return end block (result i32) @@ -9184,36 +9967,43 @@ local.get $0 i32.wrap_i64 local.tee $2 - call $~lib/internal/number/decimalCount32 + call $~lib/util/number/decimalCount32 local.get $1 i32.add local.tee $4 - call $~lib/internal/string/allocateUnsafe + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc local.tee $3 local.get $2 local.get $4 - call $~lib/internal/number/utoa32_lut + call $~lib/util/number/utoa_simple else local.get $0 - call $~lib/internal/number/decimalCount64 + call $~lib/util/number/decimalCount64 local.get $1 i32.add local.tee $2 - call $~lib/internal/string/allocateUnsafe + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc local.tee $3 local.get $0 local.get $2 - call $~lib/internal/number/utoa64_lut + call $~lib/util/number/utoa_simple end local.get $1 if local.get $3 i32.const 45 - i32.store16 offset=4 + i32.store16 end local.get $3 + call $~lib/rt/pure/__retain ) - (func $~lib/internal/number/itoa_stream (; 139 ;) (type $FUNCSIG$iiij) (param $0 i32) (param $1 i32) (param $2 i64) (result i32) + (func $~lib/util/number/itoa_stream (; 187 ;) (type $FUNCSIG$iiij) (param $0 i32) (param $1 i32) (param $2 i64) (result i32) (local $3 i32) (local $4 i32) local.get $1 @@ -9227,7 +10017,7 @@ if local.get $0 i32.const 48 - i32.store16 offset=4 + i32.store16 i32.const 1 return end @@ -9250,106 +10040,126 @@ local.get $2 i32.wrap_i64 local.tee $4 - call $~lib/internal/number/decimalCount32 + call $~lib/util/number/decimalCount32 local.get $1 i32.add local.set $3 local.get $0 local.get $4 local.get $3 - call $~lib/internal/number/utoa32_lut + call $~lib/util/number/utoa_simple else local.get $0 local.get $2 local.get $2 - call $~lib/internal/number/decimalCount64 + call $~lib/util/number/decimalCount64 local.get $1 i32.add local.tee $3 - call $~lib/internal/number/utoa64_lut + call $~lib/util/number/utoa_simple end local.get $1 if local.get $0 i32.const 45 - i32.store16 offset=4 + i32.store16 end local.get $3 ) - (func $~lib/array/Array#join (; 140 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) + (func $~lib/array/Array#join_int (; 188 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - i32.const 7436 - i32.load + i32.const 4512 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.load offset=12 i32.const 1 i32.sub - local.tee $3 + local.tee $2 i32.const 0 i32.lt_s if - i32.const 3904 + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $0 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $0 return end - i32.const 7432 - i32.load - local.set $4 - i32.const 4216 - i32.load - local.tee $1 - i32.const 0 - i32.ne - local.set $6 - local.get $3 + local.get $0 + i32.load offset=4 + local.set $3 + local.get $2 i32.eqz if - local.get $4 - i64.load offset=8 - call $~lib/internal/number/itoa64 + local.get $3 + i64.load + call $~lib/util/number/itoa64 + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + i32.const 4512 + call $~lib/rt/pure/__release + local.get $1 return end - local.get $1 + i32.const 4512 + call $~lib/string/String#get:length + local.tee $4 i32.const 21 i32.add - local.get $3 + local.get $2 i32.mul i32.const 21 i32.add - local.tee $7 - call $~lib/internal/string/allocateUnsafe - local.set $2 + local.tee $6 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $1 + i32.const 0 + local.set $0 loop $repeat|0 local.get $5 - local.get $3 + local.get $2 i32.lt_s if - local.get $2 + local.get $1 local.get $0 local.get $5 i32.const 3 i32.shl - local.get $4 + local.get $3 i32.add - i64.load offset=8 - call $~lib/internal/number/itoa_stream + i64.load + call $~lib/util/number/itoa_stream local.get $0 i32.add local.set $0 - local.get $6 + local.get $4 if - local.get $2 local.get $0 - i32.const 4216 - i32.const 0 + i32.const 1 + i32.shl local.get $1 - call $~lib/internal/string/copyUnsafe + i32.add + i32.const 4512 + local.get $4 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy local.get $0 - local.get $1 + local.get $4 i32.add local.set $0 end @@ -9360,136 +10170,235 @@ br $repeat|0 end end - local.get $2 - local.set $1 - local.get $7 - local.get $2 + local.get $6 + local.get $1 local.get $0 - local.get $3 + local.get $2 i32.const 3 i32.shl - local.get $4 + local.get $3 i32.add - i64.load offset=8 - call $~lib/internal/number/itoa_stream + i64.load + call $~lib/util/number/itoa_stream local.get $0 i32.add local.tee $0 i32.gt_s if - local.get $2 + local.get $1 local.get $0 call $~lib/string/String#substring - local.set $1 - local.get $2 - i32.eqz - if - i32.const 0 - i32.const 4088 - i32.const 28 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.set $0 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + return end + i32.const 4512 + call $~lib/rt/pure/__release local.get $1 ) - (func $~lib/array/Array<~lib/array/Array>#join (; 141 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array<~lib/string/String | null>#toString (; 189 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 4512 + call $~lib/array/Array<~lib/string/String>#join + ) + (func $~lib/array/Array<~lib/array/Array>#join_arr (; 190 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + i32.const 4512 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.load offset=4 + i32.load offset=12 i32.const 1 i32.sub - local.tee $2 + local.tee $3 i32.const 0 i32.lt_s if - i32.const 3904 + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $0 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $0 return end - i32.const 3904 - local.set $1 - local.get $0 - i32.load - local.set $3 - i32.const 4216 - i32.load - i32.const 0 - i32.ne + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $2 + i32.const 4512 + call $~lib/string/String#get:length + local.set $7 + local.get $0 + i32.load offset=4 local.set $4 - local.get $2 + i32.const 0 + local.set $0 + local.get $3 i32.eqz if - local.get $3 - i32.load offset=8 + local.get $4 + i32.load local.tee $0 + if + local.get $0 + call $~lib/rt/pure/__retain + drop + i32.const 0 + call $~lib/rt/pure/__release + end + local.get $0 if (result i32) local.get $0 - i32.const 4216 + i32.const 4512 call $~lib/array/Array#join else - i32.const 3904 + i32.const 4248 + call $~lib/rt/pure/__retain end + local.set $1 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 return end - i32.const 0 - local.set $0 loop $repeat|0 - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.lt_s if local.get $0 + local.set $1 + local.get $1 + local.get $5 i32.const 2 i32.shl - local.get $3 + local.get $4 i32.add - i32.load offset=8 - local.tee $5 + i32.load + local.tee $0 + i32.ne if + local.get $0 + call $~lib/rt/pure/__retain + drop local.get $1 - local.get $5 - i32.const 4216 + call $~lib/rt/pure/__release + end + local.get $0 + if + local.get $2 + local.tee $1 + local.get $0 + i32.const 4512 call $~lib/array/Array#join + local.tee $6 call $~lib/string/String.__concat - local.set $1 + local.tee $8 + local.tee $2 + local.get $1 + i32.ne + if + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $6 + call $~lib/rt/pure/__release + local.get $8 + call $~lib/rt/pure/__release end - local.get $4 + local.get $7 if - local.get $1 - i32.const 4216 + local.get $2 + local.tee $1 + i32.const 4512 call $~lib/string/String.__concat - local.set $1 + local.tee $6 + local.tee $2 + local.get $1 + i32.ne + if + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $6 + call $~lib/rt/pure/__release end - local.get $0 + local.get $5 i32.const 1 i32.add - local.set $0 + local.set $5 br $repeat|0 end end - local.get $2 + local.get $3 i32.const 2 i32.shl - local.get $3 + local.get $4 i32.add - i32.load offset=8 - local.tee $0 + i32.load + local.tee $1 + local.get $0 + i32.ne if local.get $1 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 4216 + call $~lib/rt/pure/__release + end + local.get $1 + if + local.get $2 + local.tee $0 + local.get $1 + i32.const 4512 call $~lib/array/Array#join + local.tee $3 call $~lib/string/String.__concat - local.set $1 + local.tee $4 + local.tee $2 + local.get $0 + i32.ne + if + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $0 + call $~lib/rt/pure/__release + end + local.get $3 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release end + i32.const 4512 + call $~lib/rt/pure/__release local.get $1 + call $~lib/rt/pure/__release + local.get $2 ) - (func $~lib/internal/number/itoa_stream (; 142 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/itoa_stream (; 191 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $1 i32.const 1 i32.shl @@ -9503,7 +10412,7 @@ if local.get $0 i32.const 48 - i32.store16 offset=4 + i32.store16 i32.const 1 return end @@ -9511,87 +10420,108 @@ i32.const 255 i32.and local.tee $2 - call $~lib/internal/number/decimalCount32 + call $~lib/util/number/decimalCount32 local.set $1 local.get $0 local.get $2 local.get $1 - call $~lib/internal/number/utoa32_lut + call $~lib/util/number/utoa_simple local.get $1 ) - (func $~lib/array/Array#join (; 143 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#join_int (; 192 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) + i32.const 4512 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.load offset=4 + i32.load offset=12 i32.const 1 i32.sub - local.tee $3 + local.tee $2 i32.const 0 i32.lt_s if - i32.const 3904 + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $0 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $0 return end local.get $0 - i32.load - local.set $4 - i32.const 4216 - i32.load - local.tee $2 - i32.const 0 - i32.ne - local.set $6 - local.get $3 + i32.load offset=4 + local.set $3 + local.get $2 i32.eqz if - local.get $4 - i32.load8_u offset=8 - call $~lib/internal/number/utoa32 + local.get $3 + i32.load8_u + call $~lib/util/number/utoa32 + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + i32.const 4512 + call $~lib/rt/pure/__release + local.get $1 return end - local.get $2 + i32.const 4512 + call $~lib/string/String#get:length + local.tee $4 i32.const 10 i32.add - local.get $3 + local.get $2 i32.mul i32.const 10 i32.add - local.tee $7 - call $~lib/internal/string/allocateUnsafe + local.tee $6 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $1 + i32.const 0 local.set $0 loop $repeat|0 local.get $5 - local.get $3 + local.get $2 i32.lt_s if - local.get $0 local.get $1 - local.get $4 + local.get $0 + local.get $3 local.get $5 i32.add - i32.load8_u offset=8 - call $~lib/internal/number/itoa_stream - local.get $1 + i32.load8_u + call $~lib/util/number/itoa_stream + local.get $0 i32.add - local.set $1 - local.get $6 + local.set $0 + local.get $4 if local.get $0 + i32.const 1 + i32.shl local.get $1 - i32.const 4216 - i32.const 0 - local.get $2 - call $~lib/internal/string/copyUnsafe - local.get $1 - local.get $2 i32.add - local.set $1 + i32.const 4512 + local.get $4 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $0 + local.get $4 + i32.add + local.set $0 end local.get $5 i32.const 1 @@ -9600,1824 +10530,2358 @@ br $repeat|0 end end - local.get $0 - local.set $2 - local.get $7 - local.get $0 + local.get $6 local.get $1 + local.get $0 + local.get $2 local.get $3 - local.get $4 i32.add - i32.load8_u offset=8 - call $~lib/internal/number/itoa_stream - local.get $1 + i32.load8_u + call $~lib/util/number/itoa_stream + local.get $0 i32.add - local.tee $1 + local.tee $0 i32.gt_s if - local.get $0 local.get $1 + local.get $0 call $~lib/string/String#substring - local.set $2 + local.set $0 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release local.get $0 - i32.eqz - if - i32.const 0 - i32.const 4088 - i32.const 28 - i32.const 4 - call $~lib/env/abort - unreachable - end + return end - local.get $2 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $1 + ) + (func $~lib/array/Array#join (; 193 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.const 4512 + call $~lib/rt/pure/__retain + drop + local.get $0 + call $~lib/array/Array#join_int + local.set $0 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $0 ) - (func $~lib/array/Array<~lib/array/Array>#join (; 144 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#join_arr (; 194 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + i32.const 4512 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.load offset=4 + i32.load offset=12 i32.const 1 i32.sub - local.tee $2 + local.tee $3 i32.const 0 i32.lt_s if - i32.const 3904 + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $0 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $0 return end - i32.const 3904 - local.set $1 + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $2 + i32.const 4512 + call $~lib/string/String#get:length + local.set $7 local.get $0 - i32.load - local.set $3 - i32.const 4216 - i32.load - i32.const 0 - i32.ne + i32.load offset=4 local.set $4 - local.get $2 + i32.const 0 + local.set $0 + local.get $3 i32.eqz if - local.get $3 - i32.load offset=8 + local.get $4 + i32.load local.tee $0 + if + local.get $0 + call $~lib/rt/pure/__retain + drop + i32.const 0 + call $~lib/rt/pure/__release + end + local.get $0 if (result i32) local.get $0 call $~lib/array/Array#join else - i32.const 3904 + i32.const 4248 + call $~lib/rt/pure/__retain end + local.set $1 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 return end - i32.const 0 - local.set $0 loop $repeat|0 - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.lt_s if local.get $0 + local.set $1 + local.get $1 + local.get $5 i32.const 2 i32.shl - local.get $3 + local.get $4 i32.add - i32.load offset=8 - local.tee $5 + i32.load + local.tee $0 + i32.ne if + local.get $0 + call $~lib/rt/pure/__retain + drop local.get $1 - local.get $5 + call $~lib/rt/pure/__release + end + local.get $0 + if + local.get $2 + local.tee $1 + local.get $0 call $~lib/array/Array#join + local.tee $6 call $~lib/string/String.__concat - local.set $1 + local.tee $8 + local.tee $2 + local.get $1 + i32.ne + if + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $6 + call $~lib/rt/pure/__release + local.get $8 + call $~lib/rt/pure/__release end - local.get $4 + local.get $7 if - local.get $1 - i32.const 4216 + local.get $2 + local.tee $1 + i32.const 4512 call $~lib/string/String.__concat - local.set $1 + local.tee $6 + local.tee $2 + local.get $1 + i32.ne + if + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $6 + call $~lib/rt/pure/__release end - local.get $0 + local.get $5 i32.const 1 i32.add - local.set $0 + local.set $5 br $repeat|0 end end - local.get $2 + local.get $3 i32.const 2 i32.shl - local.get $3 + local.get $4 i32.add - i32.load offset=8 - local.tee $0 + i32.load + local.tee $1 + local.get $0 + i32.ne if local.get $1 + call $~lib/rt/pure/__retain + drop local.get $0 + call $~lib/rt/pure/__release + end + local.get $1 + if + local.get $2 + local.tee $0 + local.get $1 call $~lib/array/Array#join + local.tee $3 call $~lib/string/String.__concat - local.set $1 + local.tee $4 + local.tee $2 + local.get $0 + i32.ne + if + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $0 + call $~lib/rt/pure/__release + end + local.get $3 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release end + i32.const 4512 + call $~lib/rt/pure/__release local.get $1 + call $~lib/rt/pure/__release + local.get $2 ) - (func $~lib/array/Array<~lib/array/Array>#join (; 145 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#join_arr (; 195 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + i32.const 4512 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.load offset=4 + i32.load offset=12 i32.const 1 i32.sub - local.tee $2 + local.tee $3 i32.const 0 i32.lt_s if - i32.const 3904 + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $0 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $0 return end - i32.const 3904 - local.set $1 + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $2 + i32.const 4512 + call $~lib/string/String#get:length + local.set $7 local.get $0 - i32.load - local.set $3 - i32.const 4216 - i32.load - i32.const 0 - i32.ne + i32.load offset=4 local.set $4 - local.get $2 + i32.const 0 + local.set $0 + local.get $3 i32.eqz if - local.get $3 - i32.load offset=8 + local.get $4 + i32.load local.tee $0 + if + local.get $0 + call $~lib/rt/pure/__retain + drop + i32.const 0 + call $~lib/rt/pure/__release + end + local.get $0 if (result i32) local.get $0 - i32.const 4216 + i32.const 4512 call $~lib/array/Array#join else - i32.const 3904 + i32.const 4248 + call $~lib/rt/pure/__retain end + local.set $1 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 return end - i32.const 0 - local.set $0 loop $repeat|0 - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.lt_s if local.get $0 + local.set $1 + local.get $1 + local.get $5 i32.const 2 i32.shl - local.get $3 + local.get $4 i32.add - i32.load offset=8 - local.tee $5 + i32.load + local.tee $0 + i32.ne if + local.get $0 + call $~lib/rt/pure/__retain + drop local.get $1 - local.get $5 - i32.const 4216 + call $~lib/rt/pure/__release + end + local.get $0 + if + local.get $2 + local.tee $1 + local.get $0 + i32.const 4512 call $~lib/array/Array#join + local.tee $6 call $~lib/string/String.__concat - local.set $1 + local.tee $8 + local.tee $2 + local.get $1 + i32.ne + if + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $6 + call $~lib/rt/pure/__release + local.get $8 + call $~lib/rt/pure/__release end - local.get $4 + local.get $7 if - local.get $1 - i32.const 4216 + local.get $2 + local.tee $1 + i32.const 4512 call $~lib/string/String.__concat - local.set $1 + local.tee $6 + local.tee $2 + local.get $1 + i32.ne + if + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $6 + call $~lib/rt/pure/__release end - local.get $0 + local.get $5 i32.const 1 i32.add - local.set $0 + local.set $5 br $repeat|0 end end - local.get $2 + local.get $3 i32.const 2 i32.shl - local.get $3 + local.get $4 i32.add - i32.load offset=8 - local.tee $0 + i32.load + local.tee $1 + local.get $0 + i32.ne if local.get $1 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 4216 + call $~lib/rt/pure/__release + end + local.get $1 + if + local.get $2 + local.tee $0 + local.get $1 + i32.const 4512 call $~lib/array/Array#join + local.tee $3 call $~lib/string/String.__concat - local.set $1 + local.tee $4 + local.tee $2 + local.get $0 + i32.ne + if + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $0 + call $~lib/rt/pure/__release + end + local.get $3 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release end + i32.const 4512 + call $~lib/rt/pure/__release local.get $1 + call $~lib/rt/pure/__release + local.get $2 + ) + (func $~lib/array/Array<~lib/array/Array>#join (; 196 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.const 4512 + call $~lib/rt/pure/__retain + drop + local.get $0 + call $~lib/array/Array<~lib/array/Array>#join_arr + local.set $0 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $0 ) - (func $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#join (; 146 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#join_arr (; 197 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + i32.const 4512 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.load offset=4 + i32.load offset=12 i32.const 1 i32.sub - local.tee $2 + local.tee $3 i32.const 0 i32.lt_s if - i32.const 3904 + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $0 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $0 return end - i32.const 3904 - local.set $1 + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $2 + i32.const 4512 + call $~lib/string/String#get:length + local.set $7 local.get $0 - i32.load - local.set $3 - i32.const 4216 - i32.load - i32.const 0 - i32.ne + i32.load offset=4 local.set $4 - local.get $2 + i32.const 0 + local.set $0 + local.get $3 i32.eqz if - local.get $3 - i32.load offset=8 + local.get $4 + i32.load local.tee $0 + if + local.get $0 + call $~lib/rt/pure/__retain + drop + i32.const 0 + call $~lib/rt/pure/__release + end + local.get $0 if (result i32) local.get $0 call $~lib/array/Array<~lib/array/Array>#join else - i32.const 3904 + i32.const 4248 + call $~lib/rt/pure/__retain end + local.set $1 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 return end - i32.const 0 - local.set $0 loop $repeat|0 - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.lt_s if local.get $0 + local.set $1 + local.get $1 + local.get $5 i32.const 2 i32.shl - local.get $3 + local.get $4 i32.add - i32.load offset=8 - local.tee $5 + i32.load + local.tee $0 + i32.ne if + local.get $0 + call $~lib/rt/pure/__retain + drop local.get $1 - local.get $5 + call $~lib/rt/pure/__release + end + local.get $0 + if + local.get $2 + local.tee $1 + local.get $0 call $~lib/array/Array<~lib/array/Array>#join + local.tee $6 call $~lib/string/String.__concat - local.set $1 + local.tee $8 + local.tee $2 + local.get $1 + i32.ne + if + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $6 + call $~lib/rt/pure/__release + local.get $8 + call $~lib/rt/pure/__release end - local.get $4 + local.get $7 if - local.get $1 - i32.const 4216 + local.get $2 + local.tee $1 + i32.const 4512 call $~lib/string/String.__concat - local.set $1 + local.tee $6 + local.tee $2 + local.get $1 + i32.ne + if + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $6 + call $~lib/rt/pure/__release end - local.get $0 + local.get $5 i32.const 1 i32.add - local.set $0 + local.set $5 br $repeat|0 end end - local.get $2 + local.get $3 i32.const 2 i32.shl - local.get $3 + local.get $4 i32.add - i32.load offset=8 - local.tee $0 + i32.load + local.tee $1 + local.get $0 + i32.ne if local.get $1 + call $~lib/rt/pure/__retain + drop local.get $0 + call $~lib/rt/pure/__release + end + local.get $1 + if + local.get $2 + local.tee $0 + local.get $1 call $~lib/array/Array<~lib/array/Array>#join + local.tee $3 call $~lib/string/String.__concat - local.set $1 + local.tee $4 + local.tee $2 + local.get $0 + i32.ne + if + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $0 + call $~lib/rt/pure/__release + end + local.get $3 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release end + i32.const 4512 + call $~lib/rt/pure/__release local.get $1 + call $~lib/rt/pure/__release + local.get $2 ) - (func $start:std/array (; 147 ;) (type $FUNCSIG$v) + (func $start:std/array (; 198 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) - i32.const 7912 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - i32.const 0 + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + (local $14 i32) + (local $15 i32) + (local $16 i32) + (local $17 i32) + (local $18 i32) + (local $19 i32) + (local $20 i32) + (local $21 i32) + (local $22 i32) + (local $23 i32) + (local $24 i32) + (local $25 i32) + (local $26 i32) + (local $27 i32) + (local $28 i32) + (local $29 i32) + (local $30 i32) + (local $31 i32) + (local $32 i32) + (local $33 i32) + (local $34 i32) + (local $35 i32) + (local $36 i32) + (local $37 i32) + (local $38 i32) + (local $39 i32) + (local $40 i32) + (local $41 i32) + (local $42 i32) + (local $43 i32) + (local $44 i32) + (local $45 i32) + (local $46 i32) + (local $47 i32) + (local $48 i32) + (local $49 i32) + (local $50 i32) + (local $51 i32) + (local $52 i32) call $~lib/array/Array#constructor global.set $std/array/arr - global.get $std/array/Null + i32.const 0 + call $~lib/array/Array.isArray<~lib/array/Array | null> if i32.const 0 - i32.const 120 - i32.const 37 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 35 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr - i32.const 0 - i32.ne + call $~lib/array/Array.isArray<~lib/array/Array | null> i32.const 1 i32.ne if i32.const 0 - i32.const 120 + i32.const 376 + i32.const 36 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 4 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $1 + local.set $2 + local.get $1 + call $~lib/array/Array.isArray + if + i32.const 0 + i32.const 376 + i32.const 37 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 12 + i32.const 5 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + i32.const 1 + i32.const 0 + call $~lib/arraybuffer/ArrayBufferView#constructor + local.tee $0 + local.set $1 + local.get $0 + call $~lib/array/Array.isArray + if + i32.const 0 + i32.const 376 i32.const 38 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 416 + call $~lib/array/Array.isArray + if i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 40 + i32.const 2 + call $~lib/builtins/abort unreachable end + local.get $2 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + i32.const 5 i32.const 0 - call $~lib/allocator/arena/__memory_allocate - drop - i32.const 12 - call $~lib/allocator/arena/__memory_allocate - call $~lib/internal/typedarray/TypedArray#constructor - drop - global.get $std/array/arr8 + i32.const 6 + i32.const 440 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $4 + call $~lib/rt/pure/__retain + local.tee $3 i32.const 1 i32.const 1 i32.const 3 call $~lib/array/Array#fill - global.get $std/array/arr8 - i32.const 256 + call $~lib/rt/pure/__release + local.get $3 + i32.const 5 + i32.const 0 + i32.const 6 + i32.const 464 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $5 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 - i32.const 49 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 48 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 1 - global.set $~lib/argc - global.get $std/array/arr8 + local.get $3 + i32.const 0 i32.const 0 + i32.const 2147483647 + call $~lib/array/Array#fill + call $~lib/rt/pure/__release + local.get $3 + i32.const 5 i32.const 0 - call $~lib/array/Array#fill|trampoline - global.get $std/array/arr8 - i32.const 280 + i32.const 6 + i32.const 536 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $6 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 - i32.const 52 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 51 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/arr8 + local.get $3 i32.const 1 i32.const 0 i32.const -3 call $~lib/array/Array#fill - global.get $std/array/arr8 - i32.const 304 + call $~lib/rt/pure/__release + local.get $3 + i32.const 5 + i32.const 0 + i32.const 6 + i32.const 560 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $2 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 - i32.const 55 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 54 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 2 - global.set $~lib/argc - global.get $std/array/arr8 + local.get $3 i32.const 2 i32.const -2 - call $~lib/array/Array#fill|trampoline - global.get $std/array/arr8 - i32.const 328 + i32.const 2147483647 + call $~lib/array/Array#fill + call $~lib/rt/pure/__release + local.get $3 + i32.const 5 + i32.const 0 + i32.const 6 + i32.const 584 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 - i32.const 58 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 57 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/arr8 + local.get $3 i32.const 0 i32.const 1 i32.const 0 call $~lib/array/Array#fill - global.get $std/array/arr8 - i32.const 352 + call $~lib/rt/pure/__release + local.get $3 + i32.const 5 + i32.const 0 + i32.const 6 + i32.const 608 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $1 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 - i32.const 61 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 60 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/arr32 + local.get $4 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + i32.const 5 + i32.const 2 + i32.const 7 + i32.const 632 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $4 + call $~lib/rt/pure/__retain + local.tee $3 i32.const 1 i32.const 1 i32.const 3 call $~lib/array/Array#fill - global.get $std/array/arr32 - i32.const 432 + call $~lib/rt/pure/__release + local.get $3 + i32.const 5 + i32.const 2 + i32.const 7 + i32.const 672 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $5 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 - i32.const 66 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 67 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 1 - global.set $~lib/argc - global.get $std/array/arr32 + local.get $3 i32.const 0 i32.const 0 - call $~lib/array/Array#fill|trampoline - global.get $std/array/arr32 - i32.const 472 + i32.const 2147483647 + call $~lib/array/Array#fill + call $~lib/rt/pure/__release + local.get $3 + i32.const 5 + i32.const 2 + i32.const 7 + i32.const 712 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $6 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 - i32.const 69 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 70 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/arr32 + local.get $3 i32.const 1 i32.const 0 i32.const -3 call $~lib/array/Array#fill - global.get $std/array/arr32 - i32.const 512 + call $~lib/rt/pure/__release + local.get $3 + i32.const 5 + i32.const 2 + i32.const 7 + i32.const 752 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $2 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 - i32.const 72 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 73 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 2 - global.set $~lib/argc - global.get $std/array/arr32 + local.get $3 i32.const 2 i32.const -2 - call $~lib/array/Array#fill|trampoline - global.get $std/array/arr32 - i32.const 552 + i32.const 2147483647 + call $~lib/array/Array#fill + call $~lib/rt/pure/__release + local.get $3 + i32.const 5 + i32.const 2 + i32.const 7 + i32.const 792 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $0 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 - i32.const 75 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 76 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/arr32 + local.get $3 i32.const 0 i32.const 1 i32.const 0 call $~lib/array/Array#fill - global.get $std/array/arr32 - i32.const 592 + call $~lib/rt/pure/__release + local.get $3 + i32.const 5 + i32.const 2 + i32.const 7 + i32.const 832 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $1 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 - i32.const 78 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - i32.load offset=4 - if - i32.const 0 - i32.const 120 - i32.const 82 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 79 + i32.const 2 + call $~lib/builtins/abort unreachable end + local.get $4 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release global.get $std/array/arr - i32.load - i32.load - i32.const 2 - i32.shr_s + i32.load offset=12 if i32.const 0 - i32.const 120 - i32.const 83 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 85 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr - i32.const 42 - call $~lib/array/Array#push - i32.const 0 - global.get $std/array/arr - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else + call $std/array/internalCapacity + if + i32.const 0 + i32.const 376 + i32.const 86 + i32.const 2 + call $~lib/builtins/abort unreachable end + global.get $std/array/arr + i32.const 42 + call $~lib/array/Array#push + global.get $std/array/arr + i32.const 0 + call $~lib/array/Array#__get i32.const 42 i32.ne if i32.const 0 - i32.const 120 - i32.const 87 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 90 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr - i32.load offset=4 + i32.load offset=12 i32.const 1 i32.ne if i32.const 0 - i32.const 120 - i32.const 88 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 91 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr - i32.load - i32.load - i32.const 2 - i32.shr_s + call $std/array/internalCapacity i32.const 1 i32.ne if i32.const 0 - i32.const 120 - i32.const 89 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 92 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr call $~lib/array/Array#pop - global.set $std/array/i - global.get $std/array/i i32.const 42 i32.ne if i32.const 0 - i32.const 120 - i32.const 93 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 96 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr - i32.load offset=4 + i32.load offset=12 if i32.const 0 - i32.const 120 - i32.const 94 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 97 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr - i32.load - i32.load - i32.const 2 - i32.shr_s + call $std/array/internalCapacity i32.const 1 i32.ne if i32.const 0 - i32.const 120 - i32.const 95 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 98 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr i32.const 43 call $~lib/array/Array#push global.get $std/array/arr - i32.load offset=4 + i32.load offset=12 i32.const 1 i32.ne if i32.const 0 - i32.const 120 - i32.const 99 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 102 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr - i32.load - i32.load - i32.const 2 - i32.shr_s + call $std/array/internalCapacity i32.const 1 i32.ne if i32.const 0 - i32.const 120 - i32.const 100 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 103 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 0 global.get $std/array/arr - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end + i32.const 0 + call $~lib/array/Array#__get i32.const 43 i32.ne if i32.const 0 - i32.const 120 - i32.const 101 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr i32.const 44 call $~lib/array/Array#push global.get $std/array/arr - i32.load offset=4 + i32.load offset=12 i32.const 2 i32.ne if i32.const 0 - i32.const 120 - i32.const 105 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 108 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr - i32.load - i32.load - i32.const 2 - i32.shr_s + call $std/array/internalCapacity i32.const 2 i32.ne if i32.const 0 - i32.const 120 - i32.const 106 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 109 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 0 global.get $std/array/arr - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end + i32.const 0 + call $~lib/array/Array#__get i32.const 43 i32.ne if i32.const 0 - i32.const 120 - i32.const 107 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 110 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 1 global.get $std/array/arr - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else - unreachable - end + i32.const 1 + call $~lib/array/Array#__get i32.const 44 i32.ne if i32.const 0 - i32.const 120 - i32.const 108 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 111 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr i32.const 45 call $~lib/array/Array#push global.get $std/array/arr - i32.load offset=4 + i32.load offset=12 i32.const 3 i32.ne if i32.const 0 - i32.const 120 - i32.const 112 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 115 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr - i32.load - i32.load - i32.const 2 - i32.shr_s + call $std/array/internalCapacity i32.const 3 i32.ne if i32.const 0 - i32.const 120 - i32.const 113 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 116 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 0 global.get $std/array/arr - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end + i32.const 0 + call $~lib/array/Array#__get i32.const 43 i32.ne if i32.const 0 - i32.const 120 - i32.const 114 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 117 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 1 global.get $std/array/arr - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else - unreachable - end + i32.const 1 + call $~lib/array/Array#__get i32.const 44 i32.ne if i32.const 0 - i32.const 120 - i32.const 115 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 118 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 2 global.get $std/array/arr - i32.load - local.tee $0 - i32.load i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 8 - i32.add - i32.load offset=8 - else - unreachable - end + call $~lib/array/Array#__get i32.const 45 i32.ne if i32.const 0 - i32.const 120 - i32.const 116 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 119 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 0 call $~lib/array/Array#constructor - global.set $std/array/other + local.set $4 global.get $std/array/arr - global.get $std/array/other + local.get $4 call $~lib/array/Array#concat - global.set $std/array/out + local.set $1 global.get $std/array/arr - i32.load - i32.load - i32.const 2 - i32.shr_s + call $std/array/internalCapacity i32.const 3 i32.ne if i32.const 0 - i32.const 120 - i32.const 123 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 128 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr - i32.load offset=4 + i32.load offset=12 i32.const 3 i32.ne if i32.const 0 - i32.const 120 - i32.const 124 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 129 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/out - i32.load offset=4 + local.get $1 + i32.load offset=12 i32.const 3 i32.ne if i32.const 0 - i32.const 120 - i32.const 125 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 130 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/out - i32.const 608 + local.get $1 + i32.const 0 + i32.const 2 + i32.const 3 + i32.const 920 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $0 call $~lib/array/Array#concat - drop + call $~lib/rt/pure/__release global.get $std/array/arr - i32.load - i32.load - i32.const 2 - i32.shr_s + call $std/array/internalCapacity i32.const 3 i32.ne if i32.const 0 - i32.const 120 - i32.const 128 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 133 + i32.const 2 + call $~lib/builtins/abort unreachable end + local.get $1 i32.const 0 - global.get $std/array/out - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end + call $~lib/array/Array#__get i32.const 43 i32.ne - if - i32.const 0 - i32.const 120 - i32.const 130 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 1 - global.get $std/array/out - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 44 - i32.ne - if - i32.const 0 - i32.const 120 - i32.const 131 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 2 - global.get $std/array/out - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 8 - i32.add - i32.load offset=8 - else + if + i32.const 0 + i32.const 376 + i32.const 135 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 45 + local.get $1 + i32.const 1 + call $~lib/array/Array#__get + i32.const 44 i32.ne if i32.const 0 - i32.const 120 - i32.const 132 + i32.const 376 + i32.const 136 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 2 + call $~lib/array/Array#__get + i32.const 45 + i32.ne + if i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 137 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/other + local.get $4 i32.const 46 call $~lib/array/Array#push - global.get $std/array/other + local.get $4 i32.const 47 call $~lib/array/Array#push global.get $std/array/arr - global.get $std/array/other + local.get $4 call $~lib/array/Array#concat - global.set $std/array/out + local.set $2 + local.get $1 + call $~lib/rt/pure/__release global.get $std/array/arr - i32.load - i32.load - i32.const 2 - i32.shr_s + call $std/array/internalCapacity i32.const 3 i32.ne if i32.const 0 - i32.const 120 - i32.const 139 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 144 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/other - i32.load offset=4 + local.get $4 + i32.load offset=12 i32.const 2 i32.ne if i32.const 0 - i32.const 120 - i32.const 140 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 145 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/out - i32.load offset=4 + local.get $2 + i32.load offset=12 i32.const 5 i32.ne if i32.const 0 - i32.const 120 - i32.const 141 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 146 + i32.const 2 + call $~lib/builtins/abort unreachable end + local.get $2 i32.const 0 - global.get $std/array/out - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end + call $~lib/array/Array#__get i32.const 43 i32.ne if i32.const 0 - i32.const 120 - i32.const 142 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 147 + i32.const 2 + call $~lib/builtins/abort unreachable end + local.get $2 i32.const 1 - global.get $std/array/out - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else - unreachable - end + call $~lib/array/Array#__get i32.const 44 i32.ne if i32.const 0 - i32.const 120 - i32.const 143 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 148 + i32.const 2 + call $~lib/builtins/abort unreachable end + local.get $2 i32.const 2 - global.get $std/array/out - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 8 - i32.add - i32.load offset=8 - else - unreachable - end + call $~lib/array/Array#__get i32.const 45 i32.ne if i32.const 0 - i32.const 120 - i32.const 144 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 149 + i32.const 2 + call $~lib/builtins/abort unreachable end + local.get $2 i32.const 3 - global.get $std/array/out - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 12 - i32.add - i32.load offset=8 - else - unreachable - end + call $~lib/array/Array#__get i32.const 46 i32.ne if i32.const 0 - i32.const 120 - i32.const 145 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 150 + i32.const 2 + call $~lib/builtins/abort unreachable end + local.get $2 i32.const 4 - global.get $std/array/out - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 16 - i32.add - i32.load offset=8 - else - unreachable - end + call $~lib/array/Array#__get i32.const 47 i32.ne if i32.const 0 - i32.const 120 - i32.const 146 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 151 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/out + local.get $2 call $~lib/array/Array#pop drop - global.get $std/array/out - i32.load offset=4 + local.get $2 + i32.load offset=12 i32.const 4 i32.ne if i32.const 0 - i32.const 120 - i32.const 149 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 154 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr i32.const 0 call $~lib/array/Array#concat - global.set $std/array/out - global.get $std/array/out - i32.load offset=4 + local.set $5 + local.get $2 + call $~lib/rt/pure/__release + local.get $5 + i32.load offset=12 i32.const 3 i32.ne if i32.const 0 - i32.const 120 - i32.const 152 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 157 + i32.const 2 + call $~lib/builtins/abort unreachable end + local.get $5 i32.const 2 - global.get $std/array/out - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 8 - i32.add - i32.load offset=8 - else - unreachable - end + call $~lib/array/Array#__get i32.const 45 i32.ne if i32.const 0 - i32.const 120 - i32.const 153 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 158 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/source - i32.load offset=4 + i32.const 0 + i32.const 2 + i32.const 3 + i32.const 936 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $6 + i32.load offset=12 if i32.const 0 - i32.const 120 - i32.const 156 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 161 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/source + local.get $6 global.get $std/array/arr call $~lib/array/Array#concat - global.set $std/array/out - global.get $std/array/out - i32.load offset=4 + local.set $2 + local.get $5 + call $~lib/rt/pure/__release + local.get $2 + i32.load offset=12 i32.const 3 i32.ne if i32.const 0 - i32.const 120 - i32.const 158 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 163 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/source - i32.load offset=4 + local.get $6 + i32.load offset=12 if i32.const 0 - i32.const 120 - i32.const 159 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 164 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 664 - global.set $std/array/cwArr + local.get $4 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + i32.const 5 i32.const 2 - global.set $~lib/argc - global.get $std/array/cwArr + i32.const 3 + i32.const 952 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $30 + local.tee $0 + if + local.get $0 + call $~lib/rt/pure/__retain + drop + i32.const 0 + call $~lib/rt/pure/__release + end + local.get $0 i32.const 0 i32.const 3 - call $~lib/array/Array#copyWithin|trampoline - i32.const 704 + i32.const 2147483647 + call $~lib/array/Array#copyWithin + local.tee $31 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 992 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $32 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 - i32.const 165 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 172 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 744 - global.set $std/array/cwArr + i32.const 5 i32.const 2 - global.set $~lib/argc - global.get $std/array/cwArr + i32.const 3 + i32.const 1032 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $33 + local.tee $1 + local.get $0 + i32.ne + if + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + call $~lib/rt/pure/__release + end + local.get $1 i32.const 1 i32.const 3 - call $~lib/array/Array#copyWithin|trampoline - i32.const 784 + i32.const 2147483647 + call $~lib/array/Array#copyWithin + local.tee $34 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1072 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $35 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 - i32.const 167 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 174 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 824 - global.set $std/array/cwArr + i32.const 5 i32.const 2 - global.set $~lib/argc - global.get $std/array/cwArr + i32.const 3 + i32.const 1112 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $36 + local.tee $0 + local.get $1 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 i32.const 1 i32.const 2 - call $~lib/array/Array#copyWithin|trampoline - i32.const 864 + i32.const 2147483647 + call $~lib/array/Array#copyWithin + local.tee $7 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1152 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $10 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 - i32.const 169 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 176 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 904 - global.set $std/array/cwArr + local.get $0 + local.tee $1 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1192 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $15 + local.tee $0 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 i32.const 2 - global.set $~lib/argc - global.get $std/array/cwArr i32.const 2 + i32.const 2147483647 + call $~lib/array/Array#copyWithin + local.tee $16 + i32.const 5 i32.const 2 - call $~lib/array/Array#copyWithin|trampoline - i32.const 944 + i32.const 3 + i32.const 1232 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $17 i32.const 0 call $std/array/isArraysEqual i32.eqz if - i32.const 0 - i32.const 120 - i32.const 171 - i32.const 0 - call $~lib/env/abort - unreachable + i32.const 0 + i32.const 376 + i32.const 178 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.tee $1 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1272 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $18 + local.tee $0 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release end - i32.const 984 - global.set $std/array/cwArr - global.get $std/array/cwArr + local.get $0 i32.const 0 i32.const 3 i32.const 4 call $~lib/array/Array#copyWithin - i32.const 1024 + local.tee $19 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1312 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $20 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 - i32.const 173 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 180 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 1064 - global.set $std/array/cwArr - global.get $std/array/cwArr + local.get $0 + local.tee $1 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1352 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $21 + local.tee $0 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 i32.const 1 i32.const 3 i32.const 4 call $~lib/array/Array#copyWithin - i32.const 1104 + local.tee $22 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1392 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $23 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 - i32.const 175 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 182 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 1144 - global.set $std/array/cwArr - global.get $std/array/cwArr + local.get $0 + local.tee $1 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1432 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $24 + local.tee $0 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 i32.const 1 i32.const 2 i32.const 4 call $~lib/array/Array#copyWithin - i32.const 1184 + local.tee $28 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1472 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $9 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 - i32.const 177 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 184 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 1224 - global.set $std/array/cwArr + local.get $0 + local.tee $1 + i32.const 5 i32.const 2 - global.set $~lib/argc - global.get $std/array/cwArr + i32.const 3 + i32.const 1512 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $11 + local.tee $0 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 i32.const 0 i32.const -2 - call $~lib/array/Array#copyWithin|trampoline - i32.const 1264 + i32.const 2147483647 + call $~lib/array/Array#copyWithin + local.tee $12 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1552 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $13 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 - i32.const 179 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 186 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 1304 - global.set $std/array/cwArr - global.get $std/array/cwArr + local.get $0 + local.tee $1 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1592 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $14 + local.tee $0 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 i32.const 0 i32.const -2 i32.const -1 call $~lib/array/Array#copyWithin - i32.const 1344 + local.tee $25 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1632 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $26 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 - i32.const 181 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 188 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 1384 - global.set $std/array/cwArr - global.get $std/array/cwArr + local.get $0 + local.tee $1 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1672 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $8 + local.tee $0 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 i32.const -4 i32.const -3 i32.const -2 call $~lib/array/Array#copyWithin - i32.const 1424 + local.tee $27 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1712 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $3 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 - i32.const 183 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 190 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 1464 - global.set $std/array/cwArr - global.get $std/array/cwArr + local.get $0 + local.tee $1 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1752 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $4 + local.tee $0 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 i32.const -4 i32.const -3 i32.const -1 call $~lib/array/Array#copyWithin - i32.const 1504 + local.tee $5 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1792 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $6 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 - i32.const 185 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 192 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 1544 - global.set $std/array/cwArr + local.get $0 + local.tee $1 + i32.const 5 i32.const 2 - global.set $~lib/argc - global.get $std/array/cwArr + i32.const 3 + i32.const 1832 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $2 + local.tee $29 + i32.ne + if + local.get $29 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $29 i32.const -4 i32.const -3 - call $~lib/array/Array#copyWithin|trampoline - i32.const 1584 + i32.const 2147483647 + call $~lib/array/Array#copyWithin + local.tee $0 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1872 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $1 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 - i32.const 187 - i32.const 0 - call $~lib/env/abort - unreachable - end + i32.const 376 + i32.const 194 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $29 + call $~lib/rt/pure/__release + local.get $30 + call $~lib/rt/pure/__release + local.get $31 + call $~lib/rt/pure/__release + local.get $32 + call $~lib/rt/pure/__release + local.get $33 + call $~lib/rt/pure/__release + local.get $34 + call $~lib/rt/pure/__release + local.get $35 + call $~lib/rt/pure/__release + local.get $36 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release + local.get $10 + call $~lib/rt/pure/__release + local.get $15 + call $~lib/rt/pure/__release + local.get $16 + call $~lib/rt/pure/__release + local.get $17 + call $~lib/rt/pure/__release + local.get $18 + call $~lib/rt/pure/__release + local.get $19 + call $~lib/rt/pure/__release + local.get $20 + call $~lib/rt/pure/__release + local.get $21 + call $~lib/rt/pure/__release + local.get $22 + call $~lib/rt/pure/__release + local.get $23 + call $~lib/rt/pure/__release + local.get $24 + call $~lib/rt/pure/__release + local.get $28 + call $~lib/rt/pure/__release + local.get $9 + call $~lib/rt/pure/__release + local.get $11 + call $~lib/rt/pure/__release + local.get $12 + call $~lib/rt/pure/__release + local.get $13 + call $~lib/rt/pure/__release + local.get $14 + call $~lib/rt/pure/__release + local.get $25 + call $~lib/rt/pure/__release + local.get $26 + call $~lib/rt/pure/__release + local.get $8 + call $~lib/rt/pure/__release + local.get $27 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release global.get $std/array/arr i32.const 42 call $~lib/array/Array#unshift global.get $std/array/arr - i32.load offset=4 + i32.load offset=12 i32.const 4 i32.ne if i32.const 0 - i32.const 120 - i32.const 193 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 202 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr - i32.load - i32.load - i32.const 2 - i32.shr_s + call $std/array/internalCapacity i32.const 4 i32.ne if i32.const 0 - i32.const 120 - i32.const 194 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 203 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 0 global.get $std/array/arr - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end + i32.const 0 + call $~lib/array/Array#__get i32.const 42 i32.ne if i32.const 0 - i32.const 120 - i32.const 195 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 204 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 1 global.get $std/array/arr - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else - unreachable - end + i32.const 1 + call $~lib/array/Array#__get i32.const 43 i32.ne if i32.const 0 - i32.const 120 - i32.const 196 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 2 - global.get $std/array/arr - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 8 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 44 - i32.ne - if - i32.const 0 - i32.const 120 - i32.const 197 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 205 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 3 global.get $std/array/arr - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 12 - i32.add - i32.load offset=8 - else + i32.const 2 + call $~lib/array/Array#__get + i32.const 44 + i32.ne + if + i32.const 0 + i32.const 376 + i32.const 206 + i32.const 2 + call $~lib/builtins/abort unreachable end + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#__get i32.const 45 i32.ne if i32.const 0 - i32.const 120 - i32.const 198 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 207 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr i32.const 41 call $~lib/array/Array#unshift global.get $std/array/arr - i32.load offset=4 + i32.load offset=12 i32.const 5 i32.ne if i32.const 0 - i32.const 120 - i32.const 202 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 211 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr - i32.load - i32.load - i32.const 2 - i32.shr_s + call $std/array/internalCapacity i32.const 5 i32.ne if i32.const 0 - i32.const 120 - i32.const 203 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 212 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 0 global.get $std/array/arr - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end + i32.const 0 + call $~lib/array/Array#__get i32.const 41 i32.ne if i32.const 0 - i32.const 120 - i32.const 204 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 213 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 1 global.get $std/array/arr - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else - unreachable - end + i32.const 1 + call $~lib/array/Array#__get i32.const 42 i32.ne if i32.const 0 - i32.const 120 - i32.const 205 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 214 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 2 global.get $std/array/arr - i32.load - local.tee $0 - i32.load i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 8 - i32.add - i32.load offset=8 - else - unreachable - end + call $~lib/array/Array#__get i32.const 43 i32.ne if i32.const 0 - i32.const 120 - i32.const 206 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 215 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 3 global.get $std/array/arr - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 12 - i32.add - i32.load offset=8 - else - unreachable - end + i32.const 3 + call $~lib/array/Array#__get i32.const 44 i32.ne if i32.const 0 - i32.const 120 - i32.const 207 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 216 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 4 global.get $std/array/arr - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 16 - i32.add - i32.load offset=8 - else - unreachable - end + i32.const 4 + call $~lib/array/Array#__get i32.const 45 i32.ne if i32.const 0 - i32.const 120 - i32.const 208 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 217 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -11428,139 +12892,86 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 214 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 226 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr - i32.load offset=4 + i32.load offset=12 i32.const 4 i32.ne if i32.const 0 - i32.const 120 - i32.const 215 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 227 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr - i32.load - i32.load - i32.const 2 - i32.shr_s + call $std/array/internalCapacity i32.const 5 i32.ne if i32.const 0 - i32.const 120 - i32.const 216 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 228 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 0 global.get $std/array/arr - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end + i32.const 0 + call $~lib/array/Array#__get i32.const 42 i32.ne if i32.const 0 - i32.const 120 - i32.const 217 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 229 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 1 global.get $std/array/arr - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else - unreachable - end + i32.const 1 + call $~lib/array/Array#__get i32.const 43 i32.ne if i32.const 0 - i32.const 120 - i32.const 218 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 230 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 2 global.get $std/array/arr - i32.load - local.tee $0 - i32.load i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 8 - i32.add - i32.load offset=8 - else - unreachable - end + call $~lib/array/Array#__get i32.const 44 i32.ne if i32.const 0 - i32.const 120 - i32.const 219 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 231 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 3 global.get $std/array/arr - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 12 - i32.add - i32.load offset=8 - else - unreachable - end + i32.const 3 + call $~lib/array/Array#__get i32.const 45 i32.ne if i32.const 0 - i32.const 120 - i32.const 220 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 232 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -11571,218 +12982,139 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 224 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 236 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr - i32.load offset=4 + i32.load offset=12 i32.const 3 i32.ne if i32.const 0 - i32.const 120 - i32.const 225 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 237 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr - i32.load - i32.load - i32.const 2 - i32.shr_s + call $std/array/internalCapacity i32.const 5 i32.ne if i32.const 0 - i32.const 120 - i32.const 226 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 0 - global.get $std/array/arr - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end - i32.const 42 - i32.ne - if - i32.const 0 - i32.const 120 - i32.const 227 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 1 - global.get $std/array/arr - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else + i32.const 376 + i32.const 238 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 43 + global.get $std/array/arr + i32.const 0 + call $~lib/array/Array#__get + i32.const 42 i32.ne if i32.const 0 - i32.const 120 - i32.const 228 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 239 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 2 global.get $std/array/arr - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 8 - i32.add - i32.load offset=8 - else + i32.const 1 + call $~lib/array/Array#__get + i32.const 43 + i32.ne + if + i32.const 0 + i32.const 376 + i32.const 240 + i32.const 2 + call $~lib/builtins/abort unreachable end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#__get i32.const 44 i32.ne if i32.const 0 - i32.const 120 - i32.const 229 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 241 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr call $~lib/array/Array#reverse + call $~lib/rt/pure/__release global.get $std/array/arr - i32.load offset=4 + i32.load offset=12 i32.const 3 i32.ne if i32.const 0 - i32.const 120 - i32.const 235 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 249 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr - i32.load - i32.load - i32.const 2 - i32.shr_s + call $std/array/internalCapacity i32.const 5 i32.ne if i32.const 0 - i32.const 120 - i32.const 236 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 250 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 0 global.get $std/array/arr - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end + i32.const 0 + call $~lib/array/Array#__get i32.const 44 i32.ne if i32.const 0 - i32.const 120 - i32.const 237 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 251 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 1 global.get $std/array/arr - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else - unreachable - end + i32.const 1 + call $~lib/array/Array#__get i32.const 43 i32.ne if i32.const 0 - i32.const 120 - i32.const 238 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 252 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 2 global.get $std/array/arr - i32.load - local.tee $0 - i32.load i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 8 - i32.add - i32.load offset=8 - else - unreachable - end + call $~lib/array/Array#__get i32.const 42 i32.ne if i32.const 0 - i32.const 120 - i32.const 239 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 253 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -11799,10 +13131,10 @@ global.get $std/array/i if i32.const 0 - i32.const 120 - i32.const 248 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 263 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -11815,10 +13147,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 252 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 266 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -11831,10 +13163,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 256 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 269 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -11847,10 +13179,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 260 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 272 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -11863,10 +13195,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 264 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 275 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -11879,10 +13211,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 268 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 278 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -11895,10 +13227,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 272 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 281 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -11911,10 +13243,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 276 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 284 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -11927,10 +13259,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 280 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 287 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -11943,695 +13275,1078 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 284 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 290 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr i32.const 44 i32.const 0 - call $~lib/array/Array#indexOf - i32.const 0 - i32.ge_s - i32.const 0 - i32.ne - global.set $std/array/includes - global.get $std/array/includes + call $~lib/array/Array#includes i32.const 1 i32.ne if i32.const 0 - i32.const 120 - i32.const 290 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 297 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr i32.const 42 i32.const 0 - call $~lib/array/Array#indexOf - i32.const 0 - i32.ge_s - i32.const 0 - i32.ne - global.set $std/array/includes - global.get $std/array/includes + call $~lib/array/Array#includes i32.const 1 i32.ne if i32.const 0 - i32.const 120 - i32.const 294 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 300 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr i32.const 45 i32.const 0 - call $~lib/array/Array#indexOf - i32.const 0 - i32.ge_s - i32.const 0 - i32.ne - global.set $std/array/includes - global.get $std/array/includes + call $~lib/array/Array#includes if i32.const 0 - i32.const 120 - i32.const 298 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 303 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr i32.const 43 i32.const 100 - call $~lib/array/Array#indexOf - i32.const 0 - i32.ge_s - i32.const 0 - i32.ne - global.set $std/array/includes - global.get $std/array/includes + call $~lib/array/Array#includes if i32.const 0 - i32.const 120 - i32.const 302 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 306 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr i32.const 43 i32.const -100 - call $~lib/array/Array#indexOf - i32.const 0 - i32.ge_s - i32.const 0 - i32.ne - global.set $std/array/includes - global.get $std/array/includes + call $~lib/array/Array#includes i32.const 1 i32.ne if i32.const 0 - i32.const 120 - i32.const 306 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 309 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr i32.const 43 i32.const -2 - call $~lib/array/Array#indexOf - i32.const 0 - i32.ge_s - i32.const 0 - i32.ne - global.set $std/array/includes - global.get $std/array/includes + call $~lib/array/Array#includes i32.const 1 i32.ne if i32.const 0 - i32.const 120 - i32.const 310 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 312 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr i32.const 43 i32.const -4 - call $~lib/array/Array#indexOf - i32.const 0 - i32.ge_s - i32.const 0 - i32.ne - global.set $std/array/includes - global.get $std/array/includes + call $~lib/array/Array#includes i32.const 1 i32.ne if i32.const 0 - i32.const 120 - i32.const 314 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 315 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr i32.const 43 i32.const 0 - call $~lib/array/Array#indexOf - i32.const 0 - i32.ge_s - i32.const 0 - i32.ne - global.set $std/array/includes - global.get $std/array/includes + call $~lib/array/Array#includes i32.const 1 i32.ne if i32.const 0 - i32.const 120 + i32.const 376 i32.const 318 - i32.const 0 - call $~lib/env/abort + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr i32.const 43 i32.const 1 - call $~lib/array/Array#indexOf - i32.const 0 - i32.ge_s - i32.const 0 - i32.ne - global.set $std/array/includes - global.get $std/array/includes + call $~lib/array/Array#includes i32.const 1 i32.ne if i32.const 0 - i32.const 120 - i32.const 322 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 321 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr i32.const 43 i32.const 2 - call $~lib/array/Array#indexOf - i32.const 0 - i32.ge_s - i32.const 0 - i32.ne - global.set $std/array/includes - global.get $std/array/includes + call $~lib/array/Array#includes i32.const 1 i32.ne if i32.const 0 - i32.const 120 - i32.const 326 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 324 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr i32.const 1 i32.const 1 call $~lib/array/Array#splice - drop + call $~lib/rt/pure/__release global.get $std/array/arr - i32.load offset=4 + i32.load offset=12 i32.const 4 i32.ne if i32.const 0 - i32.const 120 - i32.const 330 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 328 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr - i32.load - i32.load - i32.const 2 - i32.shr_s + call $std/array/internalCapacity i32.const 5 i32.ne if i32.const 0 - i32.const 120 - i32.const 331 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 329 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 0 global.get $std/array/arr - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end + i32.const 0 + call $~lib/array/Array#__get i32.const 44 i32.ne if i32.const 0 - i32.const 120 - i32.const 332 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 330 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 1 global.get $std/array/arr - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else - unreachable - end + i32.const 1 + call $~lib/array/Array#__get i32.const 42 i32.ne if i32.const 0 - i32.const 120 - i32.const 333 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 331 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 1 - global.set $~lib/argc - global.get $std/array/sarr + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1912 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $38 + call $~lib/rt/pure/__retain + local.tee $0 i32.const 0 - call $~lib/array/Array#splice|trampoline - i32.const 1664 + i32.const 2147483647 + call $~lib/array/Array#splice + local.tee $39 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1952 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $40 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 + i32.const 376 i32.const 338 - i32.const 0 - call $~lib/env/abort + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/sarr - i32.const 1680 + local.get $0 + i32.const 0 + i32.const 2 + i32.const 3 + i32.const 1992 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $41 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 + i32.const 376 i32.const 339 - i32.const 0 - call $~lib/env/abort + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 1720 - global.set $std/array/sarr - i32.const 1 - global.set $~lib/argc - global.get $std/array/sarr + local.get $0 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 2008 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $42 + local.tee $1 + i32.ne + if + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + call $~lib/rt/pure/__release + end + local.get $1 + i32.const 2 + i32.const 2147483647 + call $~lib/array/Array#splice + local.tee $43 + i32.const 3 i32.const 2 - call $~lib/array/Array#splice|trampoline - i32.const 1760 + i32.const 3 + i32.const 2048 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $44 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 + i32.const 376 i32.const 342 - i32.const 0 - call $~lib/env/abort + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/sarr - i32.const 1784 + local.get $1 + i32.const 2 + i32.const 2 + i32.const 3 + i32.const 2080 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $45 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 + i32.const 376 i32.const 343 - i32.const 0 - call $~lib/env/abort + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 1824 - global.set $std/array/sarr - global.get $std/array/sarr + local.get $1 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 2104 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $46 + local.tee $0 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 i32.const 2 i32.const 2 call $~lib/array/Array#splice - i32.const 1848 + local.tee $47 + i32.const 2 + i32.const 2 + i32.const 3 + i32.const 2144 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $48 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 + i32.const 376 i32.const 346 - i32.const 0 - call $~lib/env/abort + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/sarr - i32.const 1888 + local.get $0 + i32.const 3 + i32.const 2 + i32.const 3 + i32.const 2168 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $49 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 + i32.const 376 i32.const 347 - i32.const 0 - call $~lib/env/abort + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 1928 - global.set $std/array/sarr - global.get $std/array/sarr + local.get $0 + local.set $1 + local.get $1 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 2200 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $50 + local.tee $0 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 i32.const 0 i32.const 1 call $~lib/array/Array#splice - i32.const 1952 + local.tee $51 + i32.const 1 + i32.const 2 + i32.const 3 + i32.const 2240 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $52 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 + i32.const 376 i32.const 350 - i32.const 0 - call $~lib/env/abort + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/sarr - i32.const 1992 + local.get $0 + i32.const 4 + i32.const 2 + i32.const 3 + i32.const 2264 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $29 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 + i32.const 376 i32.const 351 - i32.const 0 - call $~lib/env/abort + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 2032 - global.set $std/array/sarr - i32.const 1 - global.set $~lib/argc - global.get $std/array/sarr + local.get $0 + local.tee $1 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 2296 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $30 + local.tee $0 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 i32.const -1 - call $~lib/array/Array#splice|trampoline - i32.const 2056 + i32.const 2147483647 + call $~lib/array/Array#splice + local.tee $31 + i32.const 1 + i32.const 2 + i32.const 3 + i32.const 2336 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $32 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 + i32.const 376 i32.const 354 - i32.const 0 - call $~lib/env/abort + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/sarr - i32.const 2096 + local.get $0 + i32.const 4 + i32.const 2 + i32.const 3 + i32.const 2360 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $33 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 + i32.const 376 i32.const 355 - i32.const 0 - call $~lib/env/abort + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 2136 - global.set $std/array/sarr - i32.const 1 - global.set $~lib/argc - global.get $std/array/sarr + local.get $0 + local.tee $1 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 2392 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $34 + local.tee $0 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 i32.const -2 - call $~lib/array/Array#splice|trampoline - i32.const 2160 + i32.const 2147483647 + call $~lib/array/Array#splice + local.tee $35 + i32.const 2 + i32.const 2 + i32.const 3 + i32.const 2432 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $36 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 + i32.const 376 i32.const 358 - i32.const 0 - call $~lib/env/abort + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/sarr - i32.const 2200 + local.get $0 + i32.const 3 + i32.const 2 + i32.const 3 + i32.const 2456 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $7 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 + i32.const 376 i32.const 359 - i32.const 0 - call $~lib/env/abort + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 2240 - global.set $std/array/sarr - global.get $std/array/sarr + local.get $0 + local.tee $1 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 2488 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $10 + local.tee $0 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 i32.const -2 i32.const 1 call $~lib/array/Array#splice - i32.const 2264 + local.tee $15 + i32.const 1 + i32.const 2 + i32.const 3 + i32.const 2528 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $16 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 + i32.const 376 i32.const 362 - i32.const 0 - call $~lib/env/abort + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/sarr - i32.const 2304 + local.get $0 + i32.const 4 + i32.const 2 + i32.const 3 + i32.const 2552 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $17 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 + i32.const 376 i32.const 363 - i32.const 0 - call $~lib/env/abort + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 2344 - global.set $std/array/sarr - global.get $std/array/sarr + local.get $0 + local.tee $1 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 2584 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $18 + local.tee $0 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 i32.const -7 i32.const 1 call $~lib/array/Array#splice - i32.const 2368 + local.tee $19 + i32.const 1 + i32.const 2 + i32.const 3 + i32.const 2624 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $20 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 + i32.const 376 i32.const 366 - i32.const 0 - call $~lib/env/abort + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/sarr - i32.const 2408 + local.get $0 + i32.const 4 + i32.const 2 + i32.const 3 + i32.const 2648 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $21 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 + i32.const 376 i32.const 367 - i32.const 0 - call $~lib/env/abort + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 2448 - global.set $std/array/sarr - global.get $std/array/sarr + local.get $0 + local.tee $1 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 2680 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $22 + local.tee $0 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 i32.const -2 i32.const -1 call $~lib/array/Array#splice - i32.const 2464 + local.tee $23 + i32.const 0 + i32.const 2 + i32.const 3 + i32.const 2720 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $24 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 + i32.const 376 i32.const 370 - i32.const 0 - call $~lib/env/abort + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/sarr - i32.const 2504 + local.get $0 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 2736 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $28 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 + i32.const 376 i32.const 371 - i32.const 0 - call $~lib/env/abort + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 2544 - global.set $std/array/sarr - global.get $std/array/sarr + local.get $0 + local.tee $1 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 2776 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $9 + local.tee $0 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 i32.const 1 i32.const -2 call $~lib/array/Array#splice - i32.const 2560 + local.tee $11 + i32.const 0 + i32.const 2 + i32.const 3 + i32.const 2816 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $12 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 + i32.const 376 i32.const 374 - i32.const 0 - call $~lib/env/abort + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/sarr - i32.const 2600 + local.get $0 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 2832 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $13 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 + i32.const 376 i32.const 375 - i32.const 0 - call $~lib/env/abort + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 2640 - global.set $std/array/sarr - global.get $std/array/sarr + local.get $0 + local.tee $1 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 2872 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $14 + local.tee $0 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 i32.const 4 i32.const 0 call $~lib/array/Array#splice - i32.const 2656 + local.tee $25 + i32.const 0 + i32.const 2 + i32.const 3 + i32.const 2912 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $26 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 + i32.const 376 i32.const 378 - i32.const 0 - call $~lib/env/abort + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/sarr - i32.const 2696 + local.get $0 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 2928 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $8 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 + i32.const 376 i32.const 379 - i32.const 0 - call $~lib/env/abort + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 2736 - global.set $std/array/sarr - global.get $std/array/sarr + local.get $0 + local.tee $1 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 2968 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $27 + local.tee $0 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 i32.const 7 i32.const 0 call $~lib/array/Array#splice - i32.const 2752 + local.tee $3 + i32.const 0 + i32.const 2 + i32.const 3 + i32.const 3008 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $4 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 + i32.const 376 i32.const 382 - i32.const 0 - call $~lib/env/abort + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/sarr - i32.const 2792 + local.get $0 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 3024 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $5 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 + i32.const 376 i32.const 383 - i32.const 0 - call $~lib/env/abort + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 2832 - global.set $std/array/sarr - global.get $std/array/sarr + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 3064 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $6 + local.tee $37 + local.get $0 + local.tee $1 + i32.ne + if + local.get $37 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $37 i32.const 7 i32.const 5 call $~lib/array/Array#splice - i32.const 2848 + local.tee $2 + i32.const 0 + i32.const 2 + i32.const 3 + i32.const 3104 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $0 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 + i32.const 376 i32.const 386 - i32.const 0 - call $~lib/env/abort + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/sarr - i32.const 2888 + local.get $37 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 3120 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $1 i32.const 0 call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 + i32.const 376 i32.const 387 - i32.const 0 - call $~lib/env/abort - unreachable - end + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $38 + call $~lib/rt/pure/__release + local.get $37 + call $~lib/rt/pure/__release + local.get $39 + call $~lib/rt/pure/__release + local.get $40 + call $~lib/rt/pure/__release + local.get $41 + call $~lib/rt/pure/__release + local.get $42 + call $~lib/rt/pure/__release + local.get $43 + call $~lib/rt/pure/__release + local.get $44 + call $~lib/rt/pure/__release + local.get $45 + call $~lib/rt/pure/__release + local.get $46 + call $~lib/rt/pure/__release + local.get $47 + call $~lib/rt/pure/__release + local.get $48 + call $~lib/rt/pure/__release + local.get $49 + call $~lib/rt/pure/__release + local.get $50 + call $~lib/rt/pure/__release + local.get $51 + call $~lib/rt/pure/__release + local.get $52 + call $~lib/rt/pure/__release + local.get $29 + call $~lib/rt/pure/__release + local.get $30 + call $~lib/rt/pure/__release + local.get $31 + call $~lib/rt/pure/__release + local.get $32 + call $~lib/rt/pure/__release + local.get $33 + call $~lib/rt/pure/__release + local.get $34 + call $~lib/rt/pure/__release + local.get $35 + call $~lib/rt/pure/__release + local.get $36 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release + local.get $10 + call $~lib/rt/pure/__release + local.get $15 + call $~lib/rt/pure/__release + local.get $16 + call $~lib/rt/pure/__release + local.get $17 + call $~lib/rt/pure/__release + local.get $18 + call $~lib/rt/pure/__release + local.get $19 + call $~lib/rt/pure/__release + local.get $20 + call $~lib/rt/pure/__release + local.get $21 + call $~lib/rt/pure/__release + local.get $22 + call $~lib/rt/pure/__release + local.get $23 + call $~lib/rt/pure/__release + local.get $24 + call $~lib/rt/pure/__release + local.get $28 + call $~lib/rt/pure/__release + local.get $9 + call $~lib/rt/pure/__release + local.get $11 + call $~lib/rt/pure/__release + local.get $12 + call $~lib/rt/pure/__release + local.get $13 + call $~lib/rt/pure/__release + local.get $14 + call $~lib/rt/pure/__release + local.get $25 + call $~lib/rt/pure/__release + local.get $26 + call $~lib/rt/pure/__release + local.get $8 + call $~lib/rt/pure/__release + local.get $27 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release global.get $std/array/arr i32.const 0 i32.const 0 @@ -12655,10 +14370,10 @@ global.get $std/array/i if i32.const 0 - i32.const 120 - i32.const 397 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 400 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -12670,10 +14385,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 400 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 403 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -12685,10 +14400,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 403 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 406 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -12700,22 +14415,22 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 411 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 414 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr - i32.load offset=4 + i32.load offset=12 i32.const 8 i32.ne if i32.const 0 - i32.const 120 - i32.const 412 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 415 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -12727,10 +14442,10 @@ i32.eq if i32.const 0 - i32.const 120 - i32.const 414 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 417 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -12754,22 +14469,22 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 427 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 430 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr - i32.load offset=4 + i32.load offset=12 i32.const 2 i32.ne if i32.const 0 - i32.const 120 - i32.const 428 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 431 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -12781,69 +14496,61 @@ global.get $std/array/arr i32.const 7 call $~lib/array/Array#every - global.set $std/array/every - global.get $std/array/every i32.const 1 i32.ne if i32.const 0 - i32.const 120 - i32.const 436 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 441 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr i32.const 8 call $~lib/array/Array#every - global.set $std/array/every - global.get $std/array/every if i32.const 0 - i32.const 120 - i32.const 439 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 444 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr i32.const 9 call $~lib/array/Array#every - global.set $std/array/every - global.get $std/array/every i32.const 1 i32.ne if i32.const 0 - i32.const 120 - i32.const 447 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 452 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr - i32.load offset=4 + i32.load offset=12 i32.const 8 i32.ne if i32.const 0 - i32.const 120 - i32.const 448 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 453 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr i32.const 10 call $~lib/array/Array#every - global.set $std/array/every - global.get $std/array/every if i32.const 0 - i32.const 120 - i32.const 450 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 455 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -12861,28 +14568,26 @@ global.get $std/array/arr i32.const 11 call $~lib/array/Array#every - global.set $std/array/every - global.get $std/array/every i32.const 1 i32.ne if i32.const 0 - i32.const 120 - i32.const 463 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 468 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr - i32.load offset=4 + i32.load offset=12 i32.const 2 i32.ne if i32.const 0 - i32.const 120 - i32.const 464 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 469 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -12894,69 +14599,61 @@ global.get $std/array/arr i32.const 12 call $~lib/array/Array#some - global.set $std/array/some - global.get $std/array/some i32.const 1 i32.ne if i32.const 0 - i32.const 120 - i32.const 472 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 479 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr i32.const 13 call $~lib/array/Array#some - global.set $std/array/some - global.get $std/array/some if i32.const 0 - i32.const 120 - i32.const 475 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 482 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr i32.const 14 call $~lib/array/Array#some - global.set $std/array/some - global.get $std/array/some if i32.const 0 - i32.const 120 - i32.const 483 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 490 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr - i32.load offset=4 + i32.load offset=12 i32.const 8 i32.ne if i32.const 0 - i32.const 120 - i32.const 484 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 491 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr i32.const 15 call $~lib/array/Array#some - global.set $std/array/some - global.get $std/array/some i32.const 1 i32.ne if i32.const 0 - i32.const 120 - i32.const 486 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 493 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -12974,26 +14671,24 @@ global.get $std/array/arr i32.const 16 call $~lib/array/Array#some - global.set $std/array/some - global.get $std/array/some if i32.const 0 - i32.const 120 - i32.const 499 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 506 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr - i32.load offset=4 + i32.load offset=12 i32.const 2 i32.ne if i32.const 0 - i32.const 120 - i32.const 500 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 507 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -13012,10 +14707,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 509 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 518 + i32.const 2 + call $~lib/builtins/abort unreachable end i32.const 0 @@ -13028,22 +14723,22 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 518 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 527 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr - i32.load offset=4 + i32.load offset=12 i32.const 8 i32.ne if i32.const 0 - i32.const 120 - i32.const 519 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 528 + i32.const 2 + call $~lib/builtins/abort unreachable end i32.const 0 @@ -13056,10 +14751,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 522 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 531 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -13084,22 +14779,22 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 536 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 545 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr - i32.load offset=4 + i32.load offset=12 i32.const 2 i32.ne if i32.const 0 - i32.const 120 - i32.const 537 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 546 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -13112,29 +14807,31 @@ i32.const 21 call $~lib/array/Array#forEach global.get $std/array/arr - i32.load offset=4 + i32.load offset=12 i32.const 100 i32.ne if i32.const 0 - i32.const 120 - i32.const 562 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 571 + i32.const 2 + call $~lib/builtins/abort unreachable end + i32.const 0 + local.set $2 loop $repeat|0 - local.get $1 + local.get $2 i32.const 100 i32.lt_s if global.get $std/array/arr call $~lib/array/Array#pop drop - local.get $1 + local.get $2 i32.const 1 i32.add - local.set $1 + local.set $2 br $repeat|0 end end @@ -13152,55 +14849,32 @@ call $~lib/array/Array#push global.get $std/array/arr call $~lib/array/Array#map - global.set $std/array/newArr - global.get $std/array/newArr - i32.load offset=4 + local.tee $1 + i32.load offset=12 i32.const 4 i32.ne if i32.const 0 - i32.const 120 - i32.const 573 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 0 - global.get $std/array/newArr - i32.load - local.tee $1 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result f32) - local.get $1 - f32.load offset=8 - else + i32.const 376 + i32.const 585 + i32.const 2 + call $~lib/builtins/abort unreachable end + local.get $1 i32.const 0 + call $~lib/array/Array#__get global.get $std/array/arr - i32.load - local.tee $1 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $1 - i32.load offset=8 - else - unreachable - end + i32.const 0 + call $~lib/array/Array#__get f32.convert_i32_s f32.ne if i32.const 0 - i32.const 120 - i32.const 574 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 586 + i32.const 2 + call $~lib/builtins/abort unreachable end i32.const 0 @@ -13208,27 +14882,28 @@ global.get $std/array/arr i32.const 23 call $~lib/array/Array#map + call $~lib/rt/pure/__release global.get $std/array/i i32.const 6 i32.ne if i32.const 0 - i32.const 120 - i32.const 583 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 595 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr - i32.load offset=4 + i32.load offset=12 i32.const 8 i32.ne if i32.const 0 - i32.const 120 - i32.const 584 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 596 + i32.const 2 + call $~lib/builtins/abort unreachable end i32.const 0 @@ -13236,15 +14911,16 @@ global.get $std/array/arr i32.const 24 call $~lib/array/Array#map + call $~lib/rt/pure/__release global.get $std/array/i i32.const 406 i32.ne if i32.const 0 - i32.const 120 - i32.const 591 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 603 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -13264,27 +14940,28 @@ global.get $std/array/arr i32.const 25 call $~lib/array/Array#map + call $~lib/rt/pure/__release global.get $std/array/i i32.const 1 i32.ne if i32.const 0 - i32.const 120 - i32.const 606 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 618 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr - i32.load offset=4 + i32.load offset=12 i32.const 2 i32.ne if i32.const 0 - i32.const 120 - i32.const 607 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 619 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -13293,20 +14970,21 @@ global.get $std/array/arr i32.const 3 call $~lib/array/Array#push + local.get $1 + call $~lib/rt/pure/__release global.get $std/array/arr i32.const 26 call $~lib/array/Array#filter - global.set $std/array/filteredArr - global.get $std/array/filteredArr - i32.load offset=4 + local.tee $1 + i32.load offset=12 i32.const 2 i32.ne if i32.const 0 - i32.const 120 - i32.const 615 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 629 + i32.const 2 + call $~lib/builtins/abort unreachable end i32.const 0 @@ -13314,28 +14992,28 @@ global.get $std/array/arr i32.const 27 call $~lib/array/Array#filter - drop + call $~lib/rt/pure/__release global.get $std/array/i i32.const 6 i32.ne if i32.const 0 - i32.const 120 - i32.const 624 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 638 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr - i32.load offset=4 + i32.load offset=12 i32.const 8 i32.ne if i32.const 0 - i32.const 120 - i32.const 625 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 639 + i32.const 2 + call $~lib/builtins/abort unreachable end i32.const 0 @@ -13343,16 +15021,16 @@ global.get $std/array/arr i32.const 28 call $~lib/array/Array#filter - drop + call $~lib/rt/pure/__release global.get $std/array/i i32.const 406 i32.ne if i32.const 0 - i32.const 120 - i32.const 632 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 646 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -13372,28 +15050,28 @@ global.get $std/array/arr i32.const 29 call $~lib/array/Array#filter - drop + call $~lib/rt/pure/__release global.get $std/array/i i32.const 1 i32.ne if i32.const 0 - i32.const 120 - i32.const 647 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 661 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr - i32.load offset=4 + i32.load offset=12 i32.const 2 i32.ne if i32.const 0 - i32.const 120 - i32.const 648 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 662 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -13402,6 +15080,8 @@ global.get $std/array/arr i32.const 3 call $~lib/array/Array#push + local.get $1 + call $~lib/rt/pure/__release global.get $std/array/arr i32.const 30 i32.const 0 @@ -13412,10 +15092,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 656 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 672 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -13428,10 +15108,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 660 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 676 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -13440,32 +15120,26 @@ call $~lib/array/Array#reduce i32.const 0 i32.ne - global.set $std/array/boolVal - global.get $std/array/boolVal i32.const 1 i32.ne if i32.const 0 - i32.const 120 - i32.const 663 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 679 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr i32.const 33 i32.const 0 call $~lib/array/Array#reduce - i32.const 0 - i32.ne - global.set $std/array/boolVal - global.get $std/array/boolVal if i32.const 0 - i32.const 120 - i32.const 666 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 682 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -13478,22 +15152,22 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 674 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 690 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr - i32.load offset=4 + i32.load offset=12 i32.const 8 i32.ne if i32.const 0 - i32.const 120 - i32.const 675 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 691 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -13506,10 +15180,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 677 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 693 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -13534,22 +15208,22 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 690 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 706 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr - i32.load offset=4 + i32.load offset=12 i32.const 2 i32.ne if i32.const 0 - i32.const 120 - i32.const 691 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 707 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -13568,10 +15242,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 699 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 717 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -13584,10 +15258,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 703 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 721 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -13596,32 +15270,26 @@ call $~lib/array/Array#reduceRight i32.const 0 i32.ne - global.set $std/array/boolVal - global.get $std/array/boolVal i32.const 1 i32.ne if i32.const 0 - i32.const 120 - i32.const 706 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 724 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr i32.const 40 i32.const 0 call $~lib/array/Array#reduceRight - i32.const 0 - i32.ne - global.set $std/array/boolVal - global.get $std/array/boolVal if i32.const 0 - i32.const 120 - i32.const 709 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 727 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -13634,22 +15302,22 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 717 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 735 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr - i32.load offset=4 + i32.load offset=12 i32.const 8 i32.ne if i32.const 0 - i32.const 120 - i32.const 718 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 736 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -13662,10 +15330,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 720 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 738 + i32.const 2 + call $~lib/builtins/abort unreachable end global.get $std/array/arr @@ -13690,637 +15358,1589 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 733 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 751 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.load offset=12 + if + i32.const 0 + i32.const 376 + i32.const 752 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 0 + call $~lib/array/Array#push + global.get $std/array/arr + i32.const 1 + call $~lib/array/Array#push + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#push + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#push + call $~lib/bindings/Math/random + i64.reinterpret_f64 + call $~lib/math/NativeMath.seedRandom + i32.const 8 + i32.const 2 + i32.const 8 + i32.const 3392 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $11 + call $~lib/rt/pure/__retain + local.set $10 + i32.const 0 + global.set $~lib/argc + i32.const 0 + local.set $2 + block $1of1 + block $0of1 + block $outOfRange + global.get $~lib/argc + br_table $0of1 $1of1 $outOfRange + end + unreachable + end + i32.const 44 + local.set $2 + end + local.get $10 + local.get $2 + call $~lib/array/Array#sort + call $~lib/rt/pure/__release + local.get $10 + i32.const 8 + i32.const 2 + i32.const 8 + i32.const 3440 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $12 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 841 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 8 + i32.const 3 + i32.const 9 + i32.const 3488 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $13 + call $~lib/rt/pure/__retain + local.set $15 + i32.const 0 + global.set $~lib/argc + i32.const 0 + local.set $2 + block $1of139 + block $0of140 + block $outOfRange41 + global.get $~lib/argc + br_table $0of140 $1of139 $outOfRange41 + end + unreachable + end + i32.const 45 + local.set $2 + end + local.get $15 + local.get $2 + call $~lib/array/Array#sort + call $~lib/rt/pure/__release + local.get $15 + i32.const 8 + i32.const 3 + i32.const 9 + i32.const 3568 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $14 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 845 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 3648 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $25 + call $~lib/rt/pure/__retain + local.set $16 + i32.const 0 + global.set $~lib/argc + i32.const 0 + local.set $2 + block $1of142 + block $0of143 + block $outOfRange44 + global.get $~lib/argc + br_table $0of143 $1of142 $outOfRange44 + end + unreachable + end + i32.const 46 + local.set $2 + end + local.get $16 + local.get $2 + call $~lib/array/Array#sort + call $~lib/rt/pure/__release + local.get $16 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 3688 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $26 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 849 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 7 + i32.const 3728 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $8 + call $~lib/rt/pure/__retain + local.set $17 + i32.const 0 + global.set $~lib/argc + i32.const 0 + local.set $4 + block $1of145 + block $0of146 + block $outOfRange47 + global.get $~lib/argc + br_table $0of146 $1of145 $outOfRange47 + end + unreachable + end + i32.const 47 + local.set $4 + end + local.get $17 + local.get $4 + call $~lib/array/Array#sort + call $~lib/rt/pure/__release + local.get $17 + i32.const 5 + i32.const 2 + i32.const 7 + i32.const 3768 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $27 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 853 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 2 + i32.const 3 + i32.const 3808 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $3 + call $~lib/rt/pure/__retain + local.set $28 + i32.const 1 + i32.const 2 + i32.const 3 + i32.const 3824 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $4 + call $~lib/rt/pure/__retain + local.set $18 + i32.const 2 + i32.const 2 + i32.const 3 + i32.const 3848 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $5 + call $~lib/rt/pure/__retain + local.set $19 + i32.const 4 + i32.const 2 + i32.const 3 + i32.const 3872 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $6 + call $~lib/rt/pure/__retain + local.set $20 + i32.const 4 + i32.const 2 + i32.const 3 + i32.const 3904 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $2 + call $~lib/rt/pure/__retain + local.set $7 + i32.const 64 + call $std/array/createReverseOrderedArray + local.set $21 + i32.const 128 + call $std/array/createReverseOrderedArray + local.set $22 + i32.const 1024 + call $std/array/createReverseOrderedArray + local.set $23 + i32.const 10000 + call $std/array/createReverseOrderedArray + local.set $24 + i32.const 512 + call $std/array/createRandomOrderedArray + local.set $9 + local.get $28 + call $std/array/assertSortedDefault + local.get $18 + call $std/array/assertSortedDefault + local.get $18 + i32.const 1 + i32.const 2 + i32.const 3 + i32.const 3992 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 873 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $19 + call $std/array/assertSortedDefault + local.get $19 + i32.const 2 + i32.const 2 + i32.const 3 + i32.const 4016 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $1 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 876 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $20 + call $std/array/assertSortedDefault + local.get $20 + local.get $7 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 879 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $21 + call $std/array/assertSortedDefault + local.get $21 + local.get $7 + i32.const 4 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 882 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/arr - i32.load offset=4 + local.get $22 + call $std/array/assertSortedDefault + local.get $22 + local.get $7 + i32.const 4 + call $std/array/isArraysEqual + i32.eqz if i32.const 0 - i32.const 120 - i32.const 734 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 885 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#push - global.get $std/array/arr - i32.const 1 - call $~lib/array/Array#push - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#push - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#push - call $~lib/bindings/Math/random - i64.reinterpret_f64 - call $~lib/math/NativeMath.seedRandom - i32.const 0 - global.set $~lib/argc - global.get $std/array/f32ArrayTyped - local.set $0 - i32.const 0 - local.set $1 - block $1of1 - block $0of1 - block $outOfRange - global.get $~lib/argc - br_table $0of1 $1of1 $outOfRange - end - unreachable - end - i32.const 44 - local.set $1 - end - local.get $0 - local.get $1 - call $~lib/array/Array#sort - global.get $std/array/f32ArrayTyped - call $std/array/isArraysEqual + local.get $23 + call $std/array/assertSortedDefault + local.get $23 + local.get $7 + i32.const 4 + call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 - i32.const 821 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 888 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 0 - global.set $~lib/argc - global.get $std/array/f64ArrayTyped - local.set $0 - i32.const 0 - local.set $1 - block $1of155 - block $0of156 - block $outOfRange57 - global.get $~lib/argc - br_table $0of156 $1of155 $outOfRange57 - end - unreachable - end - i32.const 45 - local.set $1 - end - local.get $0 - local.get $1 - call $~lib/array/Array#sort - global.get $std/array/f64ArrayTyped - call $std/array/isArraysEqual + local.get $24 + call $std/array/assertSortedDefault + local.get $24 + local.get $7 + i32.const 4 + call $std/array/isArraysEqual i32.eqz if i32.const 0 - i32.const 120 - i32.const 825 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 891 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 0 - global.set $~lib/argc - global.get $std/array/i32ArrayTyped + local.get $9 + call $std/array/assertSortedDefault + local.get $11 + call $~lib/rt/pure/__release + local.get $10 + call $~lib/rt/pure/__release + local.get $12 + call $~lib/rt/pure/__release + local.get $13 + call $~lib/rt/pure/__release + local.get $15 + call $~lib/rt/pure/__release + local.get $14 + call $~lib/rt/pure/__release + local.get $25 + call $~lib/rt/pure/__release + local.get $16 + call $~lib/rt/pure/__release + local.get $26 + call $~lib/rt/pure/__release + local.get $8 + call $~lib/rt/pure/__release + local.get $17 + call $~lib/rt/pure/__release + local.get $27 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $28 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $18 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $19 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $20 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release + local.get $21 + call $~lib/rt/pure/__release + local.get $22 + call $~lib/rt/pure/__release + local.get $23 + call $~lib/rt/pure/__release + local.get $24 + call $~lib/rt/pure/__release + local.get $9 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + i32.const 64 + call $std/array/createRandomOrderedArray local.set $0 - i32.const 0 + i32.const 257 + call $std/array/createRandomOrderedArray local.set $1 - block $1of158 - block $0of159 - block $outOfRange60 + local.get $0 + i32.const 49 + call $std/array/assertSorted + local.get $0 + i32.const 50 + call $std/array/assertSorted + local.get $1 + i32.const 51 + call $std/array/assertSorted + local.get $1 + i32.const 52 + call $std/array/assertSorted + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + call $std/array/createReverseOrderedNestedArray + local.tee $1 + i32.const 53 + call $std/array/assertSorted<~lib/array/Array> + local.get $1 + call $~lib/rt/pure/__release + call $std/array/createReverseOrderedElementsArray + local.tee $1 + i32.const 54 + call $std/array/assertSorted<~lib/array/Array> + local.get $1 + call $~lib/rt/pure/__release + i32.const 7 + i32.const 2 + i32.const 13 + i32.const 4264 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $0 + call $~lib/rt/pure/__retain + local.set $5 + i32.const 7 + i32.const 2 + i32.const 13 + i32.const 4312 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $1 + call $~lib/rt/pure/__retain + local.set $6 + i32.const 1 + global.set $~lib/argc + i32.const 0 + local.set $2 + block $1of148 + block $0of149 + block $outOfRange50 global.get $~lib/argc - br_table $0of159 $1of158 $outOfRange60 + i32.const 1 + i32.sub + br_table $0of149 $1of148 $outOfRange50 end unreachable end - i32.const 46 - local.set $1 + i32.const 55 + local.set $2 end - local.get $0 - local.get $1 - call $~lib/array/Array#sort - drop - global.get $std/array/i32ArrayTyped - i32.const 3592 - i32.const 0 - call $std/array/isArraysEqual + local.get $5 + local.get $2 + call $std/array/assertSorted<~lib/string/String | null> + local.get $5 + local.get $6 + call $std/array/isArraysEqual<~lib/string/String | null> i32.eqz if i32.const 0 - i32.const 120 - i32.const 829 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 928 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 0 + call $std/array/createRandomStringArray + local.set $2 + i32.const 1 global.set $~lib/argc - global.get $std/array/u32ArrayTyped - local.set $0 i32.const 0 - local.set $1 - block $1of161 - block $0of162 - block $outOfRange63 + local.set $4 + block $1of151 + block $0of152 + block $outOfRange53 global.get $~lib/argc - br_table $0of162 $1of161 $outOfRange63 + i32.const 1 + i32.sub + br_table $0of152 $1of151 $outOfRange53 end unreachable end - i32.const 47 - local.set $1 + i32.const 56 + local.set $4 end + local.get $2 + local.get $4 + call $std/array/assertSorted<~lib/array/Array> local.get $0 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release local.get $1 - call $~lib/array/Array#sort - drop - global.get $std/array/u32ArrayTyped - i32.const 3672 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + i32.const 2 i32.const 0 - call $std/array/isArraysEqual + i32.const 15 + i32.const 4432 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.set $9 + i32.const 4512 + call $~lib/rt/pure/__retain + drop + local.get $9 + call $~lib/array/Array#join_bool + local.set $11 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $11 + i32.const 4536 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 120 - i32.const 833 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 939 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 64 - call $std/array/createReverseOrderedArray - global.set $std/array/reversed64 - i32.const 128 - call $std/array/createReverseOrderedArray - global.set $std/array/reversed128 - i32.const 1024 - call $std/array/createReverseOrderedArray - global.set $std/array/reversed1024 - i32.const 10000 - call $std/array/createReverseOrderedArray - global.set $std/array/reversed10000 - i32.const 512 - call $std/array/createRandomOrderedArray - global.set $std/array/randomized512 - global.get $std/array/reversed0 - call $std/array/assertSortedDefault - global.get $std/array/reversed1 - call $std/array/assertSortedDefault - global.get $std/array/reversed1 - i32.const 3840 - i32.const 0 - call $std/array/isArraysEqual + i32.const 3 + i32.const 2 + i32.const 3 + i32.const 4576 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $25 + i32.const 4248 + call $~lib/array/Array#join + local.tee $26 + i32.const 4632 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 120 - i32.const 853 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 940 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/reversed2 - call $std/array/assertSortedDefault - global.get $std/array/reversed2 - i32.const 3864 - i32.const 0 - call $std/array/isArraysEqual + i32.const 3 + i32.const 2 + i32.const 7 + i32.const 4664 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $8 + i32.const 4696 + call $~lib/array/Array#join + local.tee $27 + i32.const 4632 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 120 - i32.const 856 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 941 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/reversed4 - call $std/array/assertSortedDefault - global.get $std/array/reversed4 - global.get $std/array/expected4 - i32.const 0 - call $std/array/isArraysEqual + i32.const 2 + i32.const 2 + i32.const 3 + i32.const 4720 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $3 + i32.const 4744 + call $~lib/array/Array#join + local.tee $4 + i32.const 4768 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 120 - i32.const 859 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 942 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/reversed64 - call $std/array/assertSortedDefault - global.get $std/array/reversed64 - global.get $std/array/expected4 - i32.const 4 - call $std/array/isArraysEqual + i32.const 6 + i32.const 3 + i32.const 9 + i32.const 4832 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.set $12 + i32.const 4896 + call $~lib/rt/pure/__retain + drop + local.get $12 + call $~lib/array/Array#join_flt + local.set $13 + i32.const 4896 + call $~lib/rt/pure/__release + local.get $13 + i32.const 6096 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 120 - i32.const 862 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 943 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/reversed128 - call $std/array/assertSortedDefault - global.get $std/array/reversed128 - global.get $std/array/expected4 - i32.const 4 - call $std/array/isArraysEqual + i32.const 3 + i32.const 2 + i32.const 14 + i32.const 6216 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $5 + i32.const 4248 + call $~lib/array/Array<~lib/string/String>#join + local.tee $6 + i32.const 6192 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 120 - i32.const 865 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 944 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/reversed1024 - call $std/array/assertSortedDefault - global.get $std/array/reversed1024 - global.get $std/array/expected4 - i32.const 4 - call $std/array/isArraysEqual + i32.const 3 + i32.const 2 + i32.const 19 + i32.const 0 + call $~lib/rt/__allocArray + local.tee $2 + i32.load offset=4 + local.tee $1 + call $std/array/Ref#constructor + local.tee $0 + call $~lib/rt/pure/__retain + i32.store + local.get $1 + i32.const 0 + call $~lib/rt/pure/__retain + i32.store offset=4 + local.get $1 + call $std/array/Ref#constructor + local.tee $1 + call $~lib/rt/pure/__retain + i32.store offset=8 + local.get $2 + call $~lib/rt/pure/__retain + local.set $14 + i32.const 4512 + call $~lib/rt/pure/__retain + drop + local.get $14 + call $~lib/array/Array#join_ref + local.set $2 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $2 + i32.const 6296 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 120 - i32.const 868 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 946 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/reversed10000 - call $std/array/assertSortedDefault - global.get $std/array/reversed10000 - global.get $std/array/expected4 + local.get $9 + call $~lib/rt/pure/__release + local.get $11 + call $~lib/rt/pure/__release + local.get $25 + call $~lib/rt/pure/__release + local.get $26 + call $~lib/rt/pure/__release + local.get $8 + call $~lib/rt/pure/__release + local.get $27 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $12 + call $~lib/rt/pure/__release + local.get $13 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $14 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + i32.const 0 + i32.const 2 + i32.const 3 + i32.const 6376 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $15 + call $~lib/rt/pure/__retain + local.set $29 + i32.const 1 + i32.const 2 + i32.const 3 + i32.const 6392 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $16 + call $~lib/rt/pure/__retain + local.set $30 + i32.const 2 + i32.const 2 + i32.const 3 + i32.const 6416 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $17 + call $~lib/rt/pure/__retain + local.set $31 i32.const 4 - call $std/array/isArraysEqual + i32.const 2 + i32.const 3 + i32.const 6440 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $18 + call $~lib/rt/pure/__retain + local.set $32 + local.get $29 + call $~lib/array/Array#toString + local.tee $19 + i32.const 4248 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 120 - i32.const 871 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 956 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/randomized512 - call $std/array/assertSortedDefault - i32.const 64 - call $std/array/createRandomOrderedArray - global.set $std/array/randomized64 - i32.const 257 - call $std/array/createRandomOrderedArray - global.set $std/array/randomized257 - global.get $std/array/randomized64 - i32.const 49 - call $std/array/assertSorted - global.get $std/array/randomized64 - i32.const 50 - call $std/array/assertSorted - global.get $std/array/randomized257 - i32.const 51 - call $std/array/assertSorted - global.get $std/array/randomized257 - i32.const 52 - call $std/array/assertSorted - call $std/array/createReverseOrderedNestedArray - global.set $std/array/reversedNested512 - global.get $std/array/reversedNested512 - i32.const 53 - call $std/array/assertSorted<~lib/array/Array> - call $std/array/createReverseOrderedElementsArray - global.set $std/array/reversedElements512 - global.get $std/array/reversedElements512 - i32.const 54 - call $std/array/assertSorted<~lib/array/Array> - i32.const 1 - global.set $~lib/argc - global.get $std/array/randomStringsActual - call $std/array/assertSorted<~lib/string/String>|trampoline - global.get $std/array/randomStringsActual - global.get $std/array/randomStringsExpected - call $std/array/isArraysEqual<~lib/string/String> + local.get $30 + call $~lib/array/Array#toString + local.tee $20 + i32.const 6192 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 120 - i32.const 901 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 957 + i32.const 2 + call $~lib/builtins/abort unreachable end - call $std/array/createRandomStringArray - global.set $std/array/randomStrings400 - i32.const 1 - global.set $~lib/argc - global.get $std/array/randomStrings400 - call $std/array/assertSorted<~lib/string/String>|trampoline - call $~lib/array/Array#join - i32.const 4248 + local.get $31 + call $~lib/array/Array#toString + local.tee $21 + i32.const 6472 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 120 - i32.const 910 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 958 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 4872 - i32.const 3904 - call $~lib/array/Array#join - i32.const 4880 + local.get $32 + call $~lib/array/Array#toString + local.tee $22 + i32.const 6496 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 120 - i32.const 911 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 959 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 4976 - i32.const 4936 - call $~lib/array/Array#join - i32.const 4880 + i32.const 3 + i32.const 0 + i32.const 20 + i32.const 6528 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.set $33 + i32.const 4512 + call $~lib/rt/pure/__retain + drop + local.get $33 + call $~lib/array/Array#join_int + local.set $3 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $3 + i32.const 6552 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 120 - i32.const 912 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 961 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 5032 - i32.const 5008 - call $~lib/array/Array#join - i32.const 5040 + i32.const 3 + i32.const 1 + i32.const 21 + i32.const 6584 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.set $34 + i32.const 4512 + call $~lib/rt/pure/__retain + drop + local.get $34 + call $~lib/array/Array#join_int + local.set $4 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $4 + i32.const 6608 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 120 - i32.const 913 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 962 + i32.const 2 + call $~lib/builtins/abort unreachable end - call $~lib/array/Array#join - i32.const 6696 + i32.const 3 + i32.const 3 + i32.const 16 + i32.const 6648 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.set $35 + i32.const 4512 + call $~lib/rt/pure/__retain + drop + local.get $35 + call $~lib/array/Array#join_int + local.set $5 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $5 + i32.const 6688 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 120 - i32.const 914 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 963 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 6864 - i32.const 3904 - call $~lib/array/Array<~lib/string/String>#join - i32.const 6784 + i32.const 4 + i32.const 3 + i32.const 22 + i32.const 6752 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.set $36 + i32.const 4512 + call $~lib/rt/pure/__retain + drop + local.get $36 + call $~lib/array/Array#join_int + local.set $6 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $6 + i32.const 6800 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 120 - i32.const 915 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 964 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 3 - call $~lib/array/Array#constructor - local.set $1 - i32.const 0 - call $~lib/allocator/arena/__memory_allocate - local.set $0 - local.get $1 - i32.load - local.get $0 - i32.store offset=8 - local.get $1 - i32.load - i32.const 4 - i32.add - i32.const 0 - i32.store offset=8 - i32.const 0 - call $~lib/allocator/arena/__memory_allocate - local.set $0 - local.get $1 - i32.load - i32.const 8 - i32.add - local.get $0 - i32.store offset=8 - local.get $1 - global.set $std/array/refArr - global.get $std/array/refArr - call $~lib/array/Array#join - i32.const 6912 + i32.const 7 + i32.const 2 + i32.const 13 + i32.const 6904 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $23 + call $~lib/rt/pure/__retain + local.tee $24 + call $~lib/array/Array<~lib/string/String | null>#toString + local.tee $28 + i32.const 6952 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 120 - i32.const 917 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 968 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/reversed0 - i32.const 4216 - call $~lib/array/Array#join - i32.const 3904 + i32.const 4 + i32.const 2 + i32.const 14 + i32.const 7048 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $9 + call $~lib/array/Array<~lib/string/String | null>#toString + local.tee $11 + i32.const 7080 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 120 - i32.const 921 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 969 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/reversed1 - i32.const 4216 - call $~lib/array/Array#join - i32.const 6784 + i32.const 2 + i32.const 2 + i32.const 10 + i32.const 0 + call $~lib/rt/__allocArray + local.tee $0 + i32.load offset=4 + local.tee $1 + i32.const 2 + i32.const 2 + i32.const 3 + i32.const 7112 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $12 + call $~lib/rt/pure/__retain + i32.store + local.get $1 + i32.const 2 + i32.const 2 + i32.const 3 + i32.const 7136 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $13 + call $~lib/rt/pure/__retain + i32.store offset=4 + local.get $0 + call $~lib/rt/pure/__retain + local.set $7 + i32.const 4512 + call $~lib/rt/pure/__retain + drop + local.get $7 + call $~lib/array/Array<~lib/array/Array>#join_arr + local.set $2 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $2 + i32.const 7160 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 120 - i32.const 922 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 972 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/reversed2 - i32.const 4216 - call $~lib/array/Array#join - i32.const 6984 + i32.const 2 + i32.const 2 + i32.const 23 + i32.const 0 + call $~lib/rt/__allocArray + local.tee $0 + i32.load offset=4 + local.tee $1 + i32.const 2 + i32.const 0 + i32.const 6 + i32.const 7192 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $14 + call $~lib/rt/pure/__retain + i32.store + local.get $1 + i32.const 2 + i32.const 0 + i32.const 6 + i32.const 7216 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $25 + call $~lib/rt/pure/__retain + i32.store offset=4 + local.get $0 + call $~lib/rt/pure/__retain + local.set $10 + i32.const 4512 + call $~lib/rt/pure/__retain + drop + local.get $10 + call $~lib/array/Array<~lib/array/Array>#join_arr + local.set $0 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $0 + i32.const 7160 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 120 - i32.const 923 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 975 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/array/reversed4 - i32.const 4216 - call $~lib/array/Array#join - i32.const 7000 + i32.const 1 + i32.const 2 + i32.const 25 + i32.const 0 + call $~lib/rt/__allocArray + local.tee $26 + i32.load offset=4 + local.set $8 + i32.const 1 + i32.const 2 + i32.const 24 + i32.const 0 + call $~lib/rt/__allocArray + local.tee $1 + i32.load offset=4 + i32.const 1 + i32.const 2 + i32.const 7 + i32.const 7240 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $27 + call $~lib/rt/pure/__retain + i32.store + local.get $8 + local.get $1 + call $~lib/rt/pure/__retain + i32.store + local.get $26 + call $~lib/rt/pure/__retain + local.set $8 + i32.const 4512 + call $~lib/rt/pure/__retain + drop + local.get $8 + call $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#join_arr + local.set $1 + i32.const 4512 + call $~lib/rt/pure/__release + local.get $1 + i32.const 6192 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 120 - i32.const 924 - i32.const 0 - call $~lib/env/abort + i32.const 376 + i32.const 978 + i32.const 2 + call $~lib/builtins/abort unreachable end - call $~lib/array/Array#join - i32.const 7072 - call $~lib/string/String.__eq - i32.eqz + local.get $15 + call $~lib/rt/pure/__release + local.get $29 + call $~lib/rt/pure/__release + local.get $16 + call $~lib/rt/pure/__release + local.get $30 + call $~lib/rt/pure/__release + local.get $17 + call $~lib/rt/pure/__release + local.get $31 + call $~lib/rt/pure/__release + local.get $18 + call $~lib/rt/pure/__release + local.get $32 + call $~lib/rt/pure/__release + local.get $19 + call $~lib/rt/pure/__release + local.get $20 + call $~lib/rt/pure/__release + local.get $21 + call $~lib/rt/pure/__release + local.get $22 + call $~lib/rt/pure/__release + local.get $33 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $34 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $35 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $36 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $23 + call $~lib/rt/pure/__release + local.get $24 + call $~lib/rt/pure/__release + local.get $28 + call $~lib/rt/pure/__release + local.get $9 + call $~lib/rt/pure/__release + local.get $11 + call $~lib/rt/pure/__release + local.get $12 + call $~lib/rt/pure/__release + local.get $13 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $14 + call $~lib/rt/pure/__release + local.get $25 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $27 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + global.get $std/array/arr + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release + local.get $10 + call $~lib/rt/pure/__release + local.get $8 + call $~lib/rt/pure/__release + ) + (func $start (; 199 ;) (type $FUNCSIG$v) + global.get $~lib/started if - i32.const 0 - i32.const 120 - i32.const 926 - i32.const 0 - call $~lib/env/abort - unreachable + return + else + i32.const 1 + global.set $~lib/started end - call $~lib/array/Array#join - i32.const 7136 - call $~lib/string/String.__eq - i32.eqz + call $start:std/array + ) + (func $~lib/rt/pure/markGray (; 200 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne if - i32.const 0 - i32.const 120 - i32.const 927 - i32.const 0 - call $~lib/env/abort - unreachable + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members end - call $~lib/array/Array#join - i32.const 7240 - call $~lib/string/String.__eq - i32.eqz + ) + (func $~lib/rt/pure/scanBlack (; 201 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 202 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq if + local.get $1 + i32.const 268435455 + i32.and i32.const 0 - i32.const 120 - i32.const 928 - i32.const 0 - call $~lib/env/abort - unreachable + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end end - call $~lib/array/Array#join - i32.const 7440 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 929 + ) + (func $~lib/rt/pure/collectWhite (; 203 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else i32.const 0 - call $~lib/env/abort - unreachable end - global.get $std/array/randomStringsExpected - i32.const 4216 - call $~lib/array/Array<~lib/string/String>#join - i32.const 7528 - call $~lib/string/String.__eq - i32.eqz if - i32.const 0 - i32.const 120 - i32.const 930 - i32.const 0 - call $~lib/env/abort - unreachable + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock end - i32.const 7648 - i32.const 4216 - call $~lib/array/Array<~lib/string/String>#join - i32.const 7656 - call $~lib/string/String.__eq - i32.eqz + ) + (func $~lib/rt/pure/__visit (; 204 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + local.get $0 + i32.const 7460 + i32.lt_u if - i32.const 0 - i32.const 120 - i32.const 931 - i32.const 0 - call $~lib/env/abort - unreachable + return end - global.get $std/array/subarr32 - call $~lib/array/Array<~lib/array/Array>#join - i32.const 7744 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 934 + local.get $0 + i32.const 16 + i32.sub + local.set $0 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + local.get $1 + i32.const 1 + i32.ne + if + local.get $1 + i32.const 2 + i32.eq + br_if $case1|0 + block $tablify|0 + local.get $1 + i32.const 3 + i32.sub + br_table $case2|0 $case3|0 $case4|0 $tablify|0 + end + br $case5|0 + end + local.get $0 + call $~lib/rt/pure/decrement + br $break|0 + end + local.get $0 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 232 + i32.const 75 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $0 + call $~lib/rt/pure/markGray + br $break|0 + end + local.get $0 + call $~lib/rt/pure/scan + br $break|0 + end + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const -268435456 + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne + if + i32.const 0 + i32.const 232 + i32.const 86 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $1 + i32.const 1879048192 + i32.and + if + local.get $0 + call $~lib/rt/pure/scanBlack + end + br $break|0 + end + local.get $0 + call $~lib/rt/pure/collectWhite + br $break|0 + end i32.const 0 - call $~lib/env/abort + i32.const 232 + i32.const 97 + i32.const 24 + call $~lib/builtins/abort unreachable end - global.get $std/array/subarr8 - call $~lib/array/Array<~lib/array/Array>#join - i32.const 7744 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 937 - i32.const 0 - call $~lib/env/abort + ) + (func $~lib/array/Array<~lib/array/Array>#__visit_impl (; 205 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + i32.load offset=4 + local.tee $2 + local.get $0 + i32.load offset=12 + i32.const 2 + i32.shl + i32.add + local.set $0 + loop $continue|0 + local.get $2 + local.get $0 + i32.lt_u + if + local.get $2 + i32.load + local.tee $3 + if + local.get $3 + local.get $1 + call $~lib/rt/pure/__visit + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 + end + end + ) + (func $~lib/rt/__visit_members (; 206 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + block $block$4$break + block $switch$1$default + block $switch$1$case$27 + block $switch$1$case$26 + block $switch$1$case$25 + block $switch$1$case$21 + block $switch$1$case$16 + block $switch$1$case$15 + block $switch$1$case$14 + block $switch$1$case$12 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $block$4$break $block$4$break $switch$1$case$2 $block$4$break $block$4$break $block$4$break $block$4$break $block$4$break $switch$1$case$12 $switch$1$case$2 $switch$1$case$14 $switch$1$case$15 $switch$1$case$16 $block$4$break $block$4$break $block$4$break $switch$1$case$2 $switch$1$case$21 $block$4$break $block$4$break $block$4$break $switch$1$case$25 $switch$1$case$26 $switch$1$case$27 $switch$1$default + end + return + end + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#__visit_impl + br $block$4$break + end + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#__visit_impl + br $block$4$break + end + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#__visit_impl + br $block$4$break + end + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#__visit_impl + br $block$4$break + end + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#__visit_impl + br $block$4$break + end + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#__visit_impl + br $block$4$break + end + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#__visit_impl + br $block$4$break + end + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#__visit_impl + br $block$4$break + end unreachable end - global.get $std/array/subarrU32 - call $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#join - i32.const 6784 - call $~lib/string/String.__eq - i32.eqz + local.get $0 + i32.load + local.tee $0 if - i32.const 0 - i32.const 120 - i32.const 940 - i32.const 0 - call $~lib/env/abort - unreachable + local.get $0 + local.get $1 + call $~lib/rt/pure/__visit end ) - (func $start (; 148 ;) (type $FUNCSIG$v) - call $start:std/array - ) - (func $null (; 149 ;) (type $FUNCSIG$v) + (func $null (; 207 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/array.ts b/tests/compiler/std/array.ts index 777d62a416..e92b4b2e00 100644 --- a/tests/compiler/std/array.ts +++ b/tests/compiler/std/array.ts @@ -1,12 +1,11 @@ -import "allocator/arena"; import { Array } from "array"; -import { COMPARATOR } from "internal/sort"; +import { COMPARATOR } from "util/sort"; // Obtains the internal capacity of an array from its backing buffer. function internalCapacity(array: Array): i32 { // the memory region used by the backing buffer might still be larger in that the ArrayBuffer // pre-allocates a power of 2 sized buffer itself and reuses it as long as it isn't exceeded. - var buffer: ArrayBuffer = array.buffer_; + var buffer: ArrayBuffer = array.data; return buffer.byteLength >> alignof(); } @@ -31,712 +30,732 @@ var arr = new Array(); // Array.isArray /////////////////////////////////////////////////////////////////////////////////// class P {} -var num = 1; -var Null: i32[] | null = null; -var str = "abc"; -assert(Array.isArray(Null) == false); -assert(Array.isArray(arr) == true); -assert(Array.isArray(new P()) == false); -assert(Array.isArray(new Uint8Array(1)) == false); -assert(Array.isArray(num) == false); -assert(Array.isArray(str) == false); -// Array#fill ////////////////////////////////////////////////////////////////////////////////////// +{ + assert(Array.isArray(null) == false); + assert(Array.isArray(arr) == true); + assert(Array.isArray(new P()) == false); + assert(Array.isArray(new Uint8Array(1)) == false); + assert(Array.isArray(1) == false); + assert(Array.isArray("abc") == false); +} -var arr8: u8[] = [1, 2, 3, 4, 5]; +// Array#fill ////////////////////////////////////////////////////////////////////////////////////// +{ + let arr8: u8[] = [1, 2, 3, 4, 5]; -arr8.fill(1, 1, 3); -assert(isArraysEqual(arr8, [1, 1, 1, 4, 5])); + arr8.fill(1, 1, 3); + assert(isArraysEqual(arr8, [1, 1, 1, 4, 5])); -arr8.fill(0); -assert(isArraysEqual(arr8, [0, 0, 0, 0, 0])); + arr8.fill(0); + assert(isArraysEqual(arr8, [0, 0, 0, 0, 0])); -arr8.fill(1, 0, -3); -assert(isArraysEqual(arr8, [1, 1, 0, 0, 0])); + arr8.fill(1, 0, -3); + assert(isArraysEqual(arr8, [1, 1, 0, 0, 0])); -arr8.fill(2, -2); -assert(isArraysEqual(arr8, [1, 1, 0, 2, 2])); + arr8.fill(2, -2); + assert(isArraysEqual(arr8, [1, 1, 0, 2, 2])); -arr8.fill(0, 1, 0); -assert(isArraysEqual(arr8, [1, 1, 0, 2, 2])); + arr8.fill(0, 1, 0); + assert(isArraysEqual(arr8, [1, 1, 0, 2, 2])); +} -var arr32: u32[] = [1, 2, 3, 4, 5]; +{ + let arr32: u32[] = [1, 2, 3, 4, 5]; -arr32.fill(1, 1, 3); -assert(isArraysEqual(arr32, [1, 1, 1, 4, 5])); + arr32.fill(1, 1, 3); + assert(isArraysEqual(arr32, [1, 1, 1, 4, 5])); -arr32.fill(0); -assert(isArraysEqual(arr32, [0, 0, 0, 0, 0])); + arr32.fill(0); + assert(isArraysEqual(arr32, [0, 0, 0, 0, 0])); -arr32.fill(1, 0, -3); -assert(isArraysEqual(arr32, [1, 1, 0, 0, 0])); + arr32.fill(1, 0, -3); + assert(isArraysEqual(arr32, [1, 1, 0, 0, 0])); -arr32.fill(2, -2); -assert(isArraysEqual(arr32, [1, 1, 0, 2, 2])); + arr32.fill(2, -2); + assert(isArraysEqual(arr32, [1, 1, 0, 2, 2])); -arr32.fill(0, 1, 0); -assert(isArraysEqual(arr32, [1, 1, 0, 2, 2])); + arr32.fill(0, 1, 0); + assert(isArraysEqual(arr32, [1, 1, 0, 2, 2])); +} // Array#push/pop ////////////////////////////////////////////////////////////////////////////////// -assert(arr.length == 0); -assert(internalCapacity(arr) == 0); +{ + assert(arr.length == 0); + assert(internalCapacity(arr) == 0); -arr.push(42); + arr.push(42); -assert(arr[0] == 42); -assert(arr.length == 1); -assert(internalCapacity(arr) == 1); + assert(arr[0] == 42); + assert(arr.length == 1); + assert(internalCapacity(arr) == 1); -var i = arr.pop(); + let i = arr.pop(); -assert(i == 42); -assert(arr.length == 0); -assert(internalCapacity(arr) == 1); + assert(i == 42); + assert(arr.length == 0); + assert(internalCapacity(arr) == 1); -arr.push(43); + arr.push(43); -assert(arr.length == 1); -assert(internalCapacity(arr) == 1); -assert(arr[0] == 43); + assert(arr.length == 1); + assert(internalCapacity(arr) == 1); + assert(arr[0] == 43); -arr.push(44); + arr.push(44); -assert(arr.length == 2); -assert(internalCapacity(arr) == 2); -assert(arr[0] == 43); -assert(arr[1] == 44); + assert(arr.length == 2); + assert(internalCapacity(arr) == 2); + assert(arr[0] == 43); + assert(arr[1] == 44); -arr.push(45); + arr.push(45); -assert(arr.length == 3); -assert(internalCapacity(arr) == 3); -assert(arr[0] == 43); -assert(arr[1] == 44); -assert(arr[2] == 45); + assert(arr.length == 3); + assert(internalCapacity(arr) == 3); + assert(arr[0] == 43); + assert(arr[1] == 44); + assert(arr[2] == 45); +} // Array#concat /////////////////////////////////////////////////////////////////////////////////// -var other = new Array(); +{ + let other = new Array(); -var out = arr.concat(other); -assert(internalCapacity(arr) == 3); -assert(arr.length == 3); -assert(out.length == 3); + let out = arr.concat(other); + assert(internalCapacity(arr) == 3); + assert(arr.length == 3); + assert(out.length == 3); -out.concat([]); -assert(internalCapacity(arr) == 3); + out.concat([]); + assert(internalCapacity(arr) == 3); -assert(out[0] == 43); -assert(out[1] == 44); -assert(out[2] == 45); + assert(out[0] == 43); + assert(out[1] == 44); + assert(out[2] == 45); -other.push(46); -other.push(47); + other.push(46); + other.push(47); -out = arr.concat(other); + out = arr.concat(other); -assert(internalCapacity(arr) == 3); -assert(other.length == 2); -assert(out.length == 5); -assert(out[0] == 43); -assert(out[1] == 44); -assert(out[2] == 45); -assert(out[3] == 46); -assert(out[4] == 47); + assert(internalCapacity(arr) == 3); + assert(other.length == 2); + assert(out.length == 5); + assert(out[0] == 43); + assert(out[1] == 44); + assert(out[2] == 45); + assert(out[3] == 46); + assert(out[4] == 47); -out.pop(); -assert(out.length == 4); + out.pop(); + assert(out.length == 4); -out = arr.concat(null); -assert(out.length == 3); -assert(out[2] == 45); + out = arr.concat(null); + assert(out.length == 3); + assert(out[2] == 45); -var source: i32[] = []; -assert(source.length == 0); -out = source.concat(arr); -assert(out.length == 3); -assert(source.length == 0); + let source: i32[] = []; + assert(source.length == 0); + out = source.concat(arr); + assert(out.length == 3); + assert(source.length == 0); +} // Array#copyWithin //////////////////////////////////////////////////////////////////////////////// -var cwArr: i32[]; -cwArr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(cwArr.copyWithin(0, 3), [4, 5, 3, 4, 5])); -cwArr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(cwArr.copyWithin(1, 3), [1, 4, 5, 4, 5])); -cwArr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(cwArr.copyWithin(1, 2), [1, 3, 4, 5, 5])); -cwArr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(cwArr.copyWithin(2, 2), [1, 2, 3, 4, 5])); -cwArr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(cwArr.copyWithin(0, 3, 4), [4, 2, 3, 4, 5])); -cwArr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(cwArr.copyWithin(1, 3, 4), [1, 4, 3, 4, 5])); -cwArr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(cwArr.copyWithin(1, 2, 4), [1, 3, 4, 4, 5])); -cwArr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(cwArr.copyWithin(0, -2), [4, 5, 3, 4, 5])); -cwArr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(cwArr.copyWithin(0, -2, -1), [4, 2, 3, 4, 5])); -cwArr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(cwArr.copyWithin(-4, -3, -2), [1, 3, 3, 4, 5])); -cwArr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(cwArr.copyWithin(-4, -3, -1), [1, 3, 4, 4, 5])); -cwArr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(cwArr.copyWithin(-4, -3), [1, 3, 4, 5, 5])); +{ + let cwArr: i32[]; + cwArr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(cwArr.copyWithin(0, 3), [4, 5, 3, 4, 5])); + cwArr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(cwArr.copyWithin(1, 3), [1, 4, 5, 4, 5])); + cwArr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(cwArr.copyWithin(1, 2), [1, 3, 4, 5, 5])); + cwArr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(cwArr.copyWithin(2, 2), [1, 2, 3, 4, 5])); + cwArr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(cwArr.copyWithin(0, 3, 4), [4, 2, 3, 4, 5])); + cwArr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(cwArr.copyWithin(1, 3, 4), [1, 4, 3, 4, 5])); + cwArr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(cwArr.copyWithin(1, 2, 4), [1, 3, 4, 4, 5])); + cwArr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(cwArr.copyWithin(0, -2), [4, 5, 3, 4, 5])); + cwArr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(cwArr.copyWithin(0, -2, -1), [4, 2, 3, 4, 5])); + cwArr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(cwArr.copyWithin(-4, -3, -2), [1, 3, 3, 4, 5])); + cwArr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(cwArr.copyWithin(-4, -3, -1), [1, 3, 4, 4, 5])); + cwArr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(cwArr.copyWithin(-4, -3), [1, 3, 4, 5, 5])); +} // Array#unshift /////////////////////////////////////////////////////////////////////////////////// -arr.unshift(42); - -assert(arr.length == 4); -assert(internalCapacity(arr) == 4); -assert(arr[0] == 42); -assert(arr[1] == 43); -assert(arr[2] == 44); -assert(arr[3] == 45); - -arr.unshift(41); - -assert(arr.length == 5); -assert(internalCapacity(arr) == 5); -assert(arr[0] == 41); -assert(arr[1] == 42); -assert(arr[2] == 43); -assert(arr[3] == 44); -assert(arr[4] == 45); +{ + arr.unshift(42); + + assert(arr.length == 4); + assert(internalCapacity(arr) == 4); + assert(arr[0] == 42); + assert(arr[1] == 43); + assert(arr[2] == 44); + assert(arr[3] == 45); + + arr.unshift(41); + + assert(arr.length == 5); + assert(internalCapacity(arr) == 5); + assert(arr[0] == 41); + assert(arr[1] == 42); + assert(arr[2] == 43); + assert(arr[3] == 44); + assert(arr[4] == 45); +} // Array#shift ///////////////////////////////////////////////////////////////////////////////////// -i = arr.shift(); - -assert(i == 41); -assert(arr.length == 4); -assert(internalCapacity(arr) == 5); -assert(arr[0] == 42); -assert(arr[1] == 43); -assert(arr[2] == 44); -assert(arr[3] == 45); - -i = arr.pop(); - -assert(i == 45); -assert(arr.length == 3); -assert(internalCapacity(arr) == 5); -assert(arr[0] == 42); -assert(arr[1] == 43); -assert(arr[2] == 44); +var i: i32; +{ + i = arr.shift(); + + assert(i == 41); + assert(arr.length == 4); + assert(internalCapacity(arr) == 5); + assert(arr[0] == 42); + assert(arr[1] == 43); + assert(arr[2] == 44); + assert(arr[3] == 45); + + i = arr.pop(); + + assert(i == 45); + assert(arr.length == 3); + assert(internalCapacity(arr) == 5); + assert(arr[0] == 42); + assert(arr[1] == 43); + assert(arr[2] == 44); +} // Array#reverse /////////////////////////////////////////////////////////////////////////////////// -arr.reverse(); +{ + arr.reverse(); -assert(arr.length == 3); -assert(internalCapacity(arr) == 5); -assert(arr[0] == 44); -assert(arr[1] == 43); -assert(arr[2] == 42); + assert(arr.length == 3); + assert(internalCapacity(arr) == 5); + assert(arr[0] == 44); + assert(arr[1] == 43); + assert(arr[2] == 42); -arr.push(43); -arr.push(44); + arr.push(43); + arr.push(44); +} // Array#indexOf /////////////////////////////////////////////////////////////////////////////////// -i = arr.indexOf(44); - -assert(i == 0); +{ + i = arr.indexOf(44); + assert(i == 0); -i = arr.indexOf(42); + i = arr.indexOf(42); + assert(i == 2); -assert(i == 2); + i = arr.indexOf(45); + assert(i == - 1); -i = arr.indexOf(45); + i = arr.indexOf(43, 100); + assert(i == - 1); -assert(i == - 1); + i = arr.indexOf(43, -100); + assert(i == 1); -i = arr.indexOf(43, 100); + i = arr.indexOf(43, -2); + assert(i == 3); -assert(i == - 1); + i = arr.indexOf(43, -4); + assert(i == 1); -i = arr.indexOf(43, -100); + i = arr.indexOf(43, 0); + assert(i == 1); -assert(i == 1); + i = arr.indexOf(43, 1); + assert(i == 1); -i = arr.indexOf(43, -2); - -assert(i == 3); - -i = arr.indexOf(43, -4); + i = arr.indexOf(43, 2); + assert(i == 3); +} -assert(i == 1); +// Array#includes ////////////////////////////////////////////////////////////////////////////////// -i = arr.indexOf(43, 0); +{ + let includes = arr.includes(44); + assert(includes == true); -assert(i == 1); + includes = arr.includes(42); + assert(includes == true); -i = arr.indexOf(43, 1); + includes = arr.includes(45); + assert(includes == false); -assert(i == 1); + includes = arr.includes(43, 100); + assert(includes == false); -i = arr.indexOf(43, 2); + includes = arr.includes(43, -100); + assert(includes == true); -assert(i == 3); + includes = arr.includes(43, -2); + assert(includes == true); -// Array#includes ////////////////////////////////////////////////////////////////////////////////// + includes = arr.includes(43, -4); + assert(includes == true); -var includes = arr.includes(44); + includes = arr.includes(43, 0); + assert(includes == true); -assert(includes == true); + includes = arr.includes(43, 1); + assert(includes == true); -includes = arr.includes(42); + includes = arr.includes(43, 2); + assert(includes == true); -assert(includes == true); + arr.splice(1, 1); -includes = arr.includes(45); + assert(arr.length == 4); + assert(internalCapacity(arr) == 5); + assert(arr[0] == 44); + assert(arr[1] == 42); +} -assert(includes == false); +// Array#splice //////////////////////////////////////////////////////////////////////////////////// -includes = arr.includes(43, 100); +{ + let sarr: i32[] = [1, 2, 3, 4, 5]; + assert(isArraysEqual(sarr.splice(0), [1, 2, 3, 4, 5])); + assert(isArraysEqual(sarr, [])); -assert(includes == false); + sarr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(sarr.splice(2), [3, 4, 5])); + assert(isArraysEqual(sarr, [1, 2])); -includes = arr.includes(43, -100); + sarr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(sarr.splice(2, 2), [3, 4])); + assert(isArraysEqual(sarr, [1, 2, 5])); -assert(includes == true); + sarr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(sarr.splice(0, 1), [1])); + assert(isArraysEqual(sarr, [2, 3, 4, 5])); -includes = arr.includes(43, -2); + sarr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(sarr.splice(-1), [5])); + assert(isArraysEqual(sarr, [1, 2, 3, 4])); -assert(includes == true); + sarr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(sarr.splice(-2), [4, 5])); + assert(isArraysEqual(sarr, [1, 2, 3])); -includes = arr.includes(43, -4); + sarr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(sarr.splice(-2, 1), [4])); + assert(isArraysEqual(sarr, [1, 2, 3, 5])); -assert(includes == true); + sarr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(sarr.splice(-7, 1), [1])); + assert(isArraysEqual(sarr, [2, 3, 4, 5])); -includes = arr.includes(43, 0); + sarr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(sarr.splice(-2, -1), [])); + assert(isArraysEqual(sarr, [1, 2, 3, 4, 5])); -assert(includes == true); + sarr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(sarr.splice(1, -2), [])); + assert(isArraysEqual(sarr, [1, 2, 3, 4, 5])); -includes = arr.includes(43, 1); + sarr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(sarr.splice(4, 0), [])); + assert(isArraysEqual(sarr, [1, 2, 3, 4, 5])); -assert(includes == true); + sarr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(sarr.splice(7, 0), [])); + assert(isArraysEqual(sarr, [1, 2, 3, 4, 5])); -includes = arr.includes(43, 2); + sarr = [1, 2, 3, 4, 5]; + assert(isArraysEqual(sarr.splice(7, 5), [])); + assert(isArraysEqual(sarr, [1, 2, 3, 4, 5])); +} -assert(includes == true); +// Array#findIndex ///////////////////////////////////////////////////////////////////////////////// -arr.splice(1, 1); +{ + arr[0] = 0; + arr[1] = 1; + arr[2] = 2; + arr[3] = 3; -assert(arr.length == 4); -assert(internalCapacity(arr) == 5); -assert(arr[0] == 44); -assert(arr[1] == 42); + i = arr.findIndex((value: i32, index: i32, array: Array): bool => value == 0); -// Array#splice //////////////////////////////////////////////////////////////////////////////////// + assert(i == 0); -var sarr: i32[] = [1, 2, 3, 4, 5]; -assert(isArraysEqual(sarr.splice(0), [1, 2, 3, 4, 5])); -assert(isArraysEqual(sarr, [])); + i = arr.findIndex((value: i32, index: i32, array: Array): bool => value == 1); + assert(i == 1); -sarr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(sarr.splice(2), [3, 4, 5])); -assert(isArraysEqual(sarr, [1, 2])); + i = arr.findIndex((value: i32, index: i32, array: Array): bool => value == 100); + assert(i == -1); -sarr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(sarr.splice(2, 2), [3, 4])); -assert(isArraysEqual(sarr, [1, 2, 5])); + // Test side effect push + i = arr.findIndex((value: i32, index: i32, array: Array): bool => { + array.push(100); // push side effect should not affect this method by spec + return value == 100; + }); + // array should be changed, but this method result should be calculated for old array length + assert(i == -1); + assert(arr.length == 8); + i = arr.findIndex((value: i32, index: i32, array: Array): bool => value == 100); + assert(i != -1); -sarr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(sarr.splice(0, 1), [1])); -assert(isArraysEqual(sarr, [2, 3, 4, 5])); + arr.pop(); + arr.pop(); + arr.pop(); + arr.pop(); -sarr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(sarr.splice(-1), [5])); -assert(isArraysEqual(sarr, [1, 2, 3, 4])); + // Test side effect pop + i = arr.findIndex((value: i32, index: i32, array: Array): bool => { + array.pop(); // popped items shouldn't be looked up, and we shouldn't go out of bounds + return value == 100; + }); + // only 2 first items was looked up, since last 2 was removed by .pop() + assert(i == -1); + assert(arr.length == 2); + + arr.push(2); + arr.push(3); +} -sarr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(sarr.splice(-2), [4, 5])); -assert(isArraysEqual(sarr, [1, 2, 3])); +// Array#every ///////////////////////////////////////////////////////////////////////////////////// -sarr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(sarr.splice(-2, 1), [4])); -assert(isArraysEqual(sarr, [1, 2, 3, 5])); +{ + let every = arr.every((value: i32, index: i32, array: Array): bool => value >= 0); + assert(every == true); -sarr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(sarr.splice(-7, 1), [1])); -assert(isArraysEqual(sarr, [2, 3, 4, 5])); + every = arr.every((value: i32, index: i32, array: Array): bool => value <= 0); + assert(every == false); -sarr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(sarr.splice(-2, -1), [])); -assert(isArraysEqual(sarr, [1, 2, 3, 4, 5])); + // Test side effect push + every = arr.every((value: i32, index: i32, array: Array): bool => { + array.push(100); // push side effect should not affect this method by spec + return value < 10; + }); + // array should be changed, but this method result should be calculated for old array length + assert(every == true); + assert(arr.length == 8); + every = arr.every((value: i32, index: i32, array: Array): bool => value < 10); + assert(every == false); -sarr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(sarr.splice(1, -2), [])); -assert(isArraysEqual(sarr, [1, 2, 3, 4, 5])); + arr.pop(); + arr.pop(); + arr.pop(); + arr.pop(); -sarr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(sarr.splice(4, 0), [])); -assert(isArraysEqual(sarr, [1, 2, 3, 4, 5])); + // Test side effect pop + every = arr.every((value: i32, index: i32, array: Array): bool => { + array.pop(); //poped items shouldn't be looked up, and we shouldn't go out of bounds + return value < 3; + }); + // only 2 first items was looked up, since last 2 was removed by .pop() + assert(every == true); + assert(arr.length == 2); + + arr.push(2); + arr.push(3); +} -sarr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(sarr.splice(7, 0), [])); -assert(isArraysEqual(sarr, [1, 2, 3, 4, 5])); +// Array#some ////////////////////////////////////////////////////////////////////////////////////// -sarr = [1, 2, 3, 4, 5]; -assert(isArraysEqual(sarr.splice(7, 5), [])); -assert(isArraysEqual(sarr, [1, 2, 3, 4, 5])); +{ + let some = arr.some((value: i32, index: i32, array: Array): bool => value >= 3); + assert(some == true); -// Array#findIndex ///////////////////////////////////////////////////////////////////////////////// + some = arr.some((value: i32, index: i32, array: Array): bool => value <= -1); + assert(some == false); -arr[0] = 0; -arr[1] = 1; -arr[2] = 2; -arr[3] = 3; - -i = arr.findIndex((value: i32, index: i32, array: Array): bool => value == 0); -assert(i == 0); - -i = arr.findIndex((value: i32, index: i32, array: Array): bool => value == 1); -assert(i == 1); - -i = arr.findIndex((value: i32, index: i32, array: Array): bool => value == 100); -assert(i == -1); - -// Test side effect push -i = arr.findIndex((value: i32, index: i32, array: Array): bool => { - array.push(100); // push side effect should not affect this method by spec - return value == 100; -}); -// array should be changed, but this method result should be calculated for old array length -assert(i == -1); -assert(arr.length == 8); -i = arr.findIndex((value: i32, index: i32, array: Array): bool => value == 100); -assert(i != -1); - -arr.pop(); -arr.pop(); -arr.pop(); -arr.pop(); - -// Test side effect pop -i = arr.findIndex((value: i32, index: i32, array: Array): bool => { - array.pop(); // poped items shouldn't be looked up, and we shouldn't go out of bounds - return value == 100; -}); -// only 2 first items was looked up, since last 2 was removed by .pop() -assert(i == -1); -assert(arr.length == 2); - -arr.push(2); -arr.push(3); + // Test side effect push + some = arr.some((value: i32, index: i32, array: Array): bool => { + array.push(100); // push side effect should not affect this method by spec + return value > 10; + }); + // array should be changed, but this method result should be calculated for old array length + assert(some == false); + assert(arr.length == 8); + some = arr.some((value: i32, index: i32, array: Array): bool => value > 10); + assert(some == true); -// Array#every ///////////////////////////////////////////////////////////////////////////////////// + arr.pop(); + arr.pop(); + arr.pop(); + arr.pop(); -var every = arr.every((value: i32, index: i32, array: Array): bool => value >= 0); -assert(every == true); - -every = arr.every((value: i32, index: i32, array: Array): bool => value <= 0); -assert(every == false); - -// Test side effect push -every = arr.every((value: i32, index: i32, array: Array): bool => { - array.push(100); // push side effect should not affect this method by spec - return value < 10; -}); -// array should be changed, but this method result should be calculated for old array length -assert(every == true); -assert(arr.length == 8); -every = arr.every((value: i32, index: i32, array: Array): bool => value < 10); -assert(every == false); - -arr.pop(); -arr.pop(); -arr.pop(); -arr.pop(); - -// Test side effect pop -every = arr.every((value: i32, index: i32, array: Array): bool => { - array.pop(); //poped items shouldn't be looked up, and we shouldn't go out of bounds - return value < 3; -}); -// only 2 first items was looked up, since last 2 was removed by .pop() -assert(every == true); -assert(arr.length == 2); - -arr.push(2); -arr.push(3); + // Test side effect pop + some = arr.some((value: i32, index: i32, array: Array): bool => { + array.pop(); // poped items shouldn't be looked up, and we shouldn't go out of bounds + return value > 3; + }); + // only 2 first items was looked up, since last 2 was removed by .pop() + assert(some == false); + assert(arr.length == 2); + + arr.push(2); + arr.push(3); +} -// Array#some ////////////////////////////////////////////////////////////////////////////////////// +// Array#forEach /////////////////////////////////////////////////////////////////////////////////// -var some = arr.some((value: i32, index: i32, array: Array): bool => value >= 3); -assert(some == true); - -some = arr.some((value: i32, index: i32, array: Array): bool => value <= -1); -assert(some == false); - -// Test side effect push -some = arr.some((value: i32, index: i32, array: Array): bool => { - array.push(100); // push side effect should not affect this method by spec - return value > 10; -}); -// array should be changed, but this method result should be calculated for old array length -assert(some == false); -assert(arr.length == 8); -some = arr.some((value: i32, index: i32, array: Array): bool => value > 10); -assert(some == true); - -arr.pop(); -arr.pop(); -arr.pop(); -arr.pop(); - -// Test side effect pop -some = arr.some((value: i32, index: i32, array: Array): bool => { - array.pop(); // poped items shouldn't be looked up, and we shouldn't go out of bounds - return value > 3; -}); -// only 2 first items was looked up, since last 2 was removed by .pop() -assert(some == false); -assert(arr.length == 2); - -arr.push(2); -arr.push(3); +{ + i = 0; + arr.forEach((value: i32, index: i32, array: Array): void => { i += value; }); + assert(i == 6); + + // Test side effect push + i = 0; + arr.forEach((value: i32, index: i32, array: Array): void => { + array.push(100); //push side effect should not affect this method by spec + i += value; + }); + // array should be changed, but this method result should be calculated for old array length + assert(i == 6); + assert(arr.length == 8); + i = 0; + arr.forEach((value: i32, index: i32, array: Array): void => { i += value; }); + assert(i == 406); -// Array#forEach /////////////////////////////////////////////////////////////////////////////////// + arr.pop(); + arr.pop(); + arr.pop(); + arr.pop(); -i = 0; -arr.forEach((value: i32, index: i32, array: Array): void => { i += value; }); -assert(i == 6); - -// Test side effect push -i = 0; -arr.forEach((value: i32, index: i32, array: Array): void => { - array.push(100); //push side effect should not affect this method by spec - i += value; -}); -// array should be changed, but this method result should be calculated for old array length -assert(i == 6); -assert(arr.length == 8); -i = 0; -arr.forEach((value: i32, index: i32, array: Array): void => { i += value; }); -assert(i == 406); - -arr.pop(); -arr.pop(); -arr.pop(); -arr.pop(); - -// Test side effect pop -i = 0; -arr.forEach((value: i32, index: i32, array: Array): void => { - array.pop(); //poped items shouldn't be looked up, and we shouldn't go out of bounds - i += value; -}); -// only 2 first items was looked up, since last 2 was removed by .pop() -assert(i == 1); -assert(arr.length == 2); - -arr.push(2); -arr.push(3); - -// Test rehash action effec -arr.forEach((value: i32, index: i32, array: Array): void => { - if (index == 0) { - for (let i = 0; i < 4; i++) { - array.pop(); - } - for (let i = 0; i < 100; i++) { - array.push(100 + i); + // Test side effect pop + i = 0; + arr.forEach((value: i32, index: i32, array: Array): void => { + array.pop(); //poped items shouldn't be looked up, and we shouldn't go out of bounds + i += value; + }); + // only 2 first items was looked up, since last 2 was removed by .pop() + assert(i == 1); + assert(arr.length == 2); + + arr.push(2); + arr.push(3); + + // Test rehash action effec + arr.forEach((value: i32, index: i32, array: Array): void => { + if (index == 0) { + for (let i = 0; i < 4; i++) { + array.pop(); + } + for (let i = 0; i < 100; i++) { + array.push(100 + i); + } + for (let i = 0; i < 100; i++) { + array.pop(); + } + for (let i = 0; i < 100; i++) { + array.push(i + 200); + } } - for (let i = 0; i < 100; i++) { - array.pop(); + if (index == 2) { + assert(value == 202); } - for (let i = 0; i < 100; i++) { - array.push(i + 200); - } - } - if (index == 2) { - assert(value == 202); + }); + assert(arr.length == 100); + for (let i = 0; i < 100; i++) { + arr.pop(); } -}); -assert(arr.length == 100) -for (let i = 0; i < 100; i++) { - arr.pop(); + arr.push(0); + arr.push(1); + arr.push(2); + arr.push(3); } -arr.push(0); -arr.push(1); -arr.push(2); -arr.push(3); + // Array#map /////////////////////////////////////////////////////////////////////////////////////// -var newArr: f32[] = arr.map((value: i32, index: i32, array: Array): f32 => value); -assert(newArr.length == 4); -assert(newArr[0] == arr[0]); - -// Test side effect push -i = 0; -arr.map((value: i32, index: i32, array: Array): i32 => { - array.push(100); //push side effect should not affect this method by spec - i += value; - return value; -}); -assert(i == 6); -assert(arr.length == 8); - -i = 0; -arr.map((value: i32, index: i32, array: Array): i32 => { - i += value; - return value; -}); -assert(i == 406); - -arr.pop(); -arr.pop(); -arr.pop(); -arr.pop(); - -// Test side effect pop -i = 0; -arr.map((value: i32, index: i32, array: Array): i32 => { - array.pop(); //poped items shouldn't be looked up, and we shouldn't go out of bounds - i += value; - return value; -}); -// only 2 first items was looked up, since last 2 was removed by .pop() -assert(i == 1); -assert(arr.length == 2); - -arr.push(2); -arr.push(3); +{ + let newArr: f32[] = arr.map((value: i32, index: i32, array: Array): f32 => value); + assert(newArr.length == 4); + assert(newArr[0] == arr[0]); + + // Test side effect push + i = 0; + arr.map((value: i32, index: i32, array: Array): i32 => { + array.push(100); //push side effect should not affect this method by spec + i += value; + return value; + }); + assert(i == 6); + assert(arr.length == 8); + + i = 0; + arr.map((value: i32, index: i32, array: Array): i32 => { + i += value; + return value; + }); + assert(i == 406); + + arr.pop(); + arr.pop(); + arr.pop(); + arr.pop(); + + // Test side effect pop + i = 0; + arr.map((value: i32, index: i32, array: Array): i32 => { + array.pop(); //poped items shouldn't be looked up, and we shouldn't go out of bounds + i += value; + return value; + }); + // only 2 first items was looked up, since last 2 was removed by .pop() + assert(i == 1); + assert(arr.length == 2); + + arr.push(2); + arr.push(3); +} // Array#filter //////////////////////////////////////////////////////////////////////////////////// -var filteredArr: i32[] = arr.filter((value: i32, index: i32, array: Array): bool => value >= 2); -assert(filteredArr.length == 2); - -// Test side effect push -i = 0; -arr.filter((value: i32, index: i32, array: Array): bool => { - array.push(100); //push side effect should not affect this method by spec - i += value; - return value >= 2; -}); -assert(i == 6); -assert(arr.length == 8); - -i = 0; -arr.filter((value: i32, index: i32, array: Array): bool => { - i += value; - return value >= 2; -}); -assert(i == 406); - -arr.pop(); -arr.pop(); -arr.pop(); -arr.pop(); - -// Test side effect pop -i = 0; -arr.filter((value: i32, index: i32, array: Array): bool => { - array.pop(); //poped items shouldn't be looked up, and we shouldn't go out of bounds - i += value; - return value >= 2; -}); -// only 2 first items was looked up, since last 2 was removed by .pop() -assert(i == 1); -assert(arr.length == 2); - -arr.push(2); -arr.push(3); +{ + let filteredArr: i32[] = arr.filter((value: i32, index: i32, array: Array): bool => value >= 2); + assert(filteredArr.length == 2); + + // Test side effect push + i = 0; + arr.filter((value: i32, index: i32, array: Array): bool => { + array.push(100); //push side effect should not affect this method by spec + i += value; + return value >= 2; + }); + assert(i == 6); + assert(arr.length == 8); + + i = 0; + arr.filter((value: i32, index: i32, array: Array): bool => { + i += value; + return value >= 2; + }); + assert(i == 406); + + arr.pop(); + arr.pop(); + arr.pop(); + arr.pop(); + + // Test side effect pop + i = 0; + arr.filter((value: i32, index: i32, array: Array): bool => { + array.pop(); //poped items shouldn't be looked up, and we shouldn't go out of bounds + i += value; + return value >= 2; + }); + // only 2 first items was looked up, since last 2 was removed by .pop() + assert(i == 1); + assert(arr.length == 2); + + arr.push(2); + arr.push(3); +} // Array#reduce //////////////////////////////////////////////////////////////////////////////////// -i = arr.reduce(((prev: i32, current: i32, index: i32, array: Array): i32 => prev + current), 0); -assert(i == 6); - -// init value -i = arr.reduce(((prev: i32, current: i32, index: i32, array: Array): i32 => prev + current), 4); -assert(i == 10); - -var boolVal = arr.reduce(((prev: bool, current: i32, index: i32, array: Array): bool => prev || current > 2), false); -assert(boolVal == true); - -boolVal = arr.reduce(((prev: bool, current: i32, index: i32, array: Array): bool => prev || current > 100), false); -assert(boolVal == false); - -// Test side effect push -i = arr.reduce(((prev: i32, current: i32, index: i32, array: Array): i32 => { - array.push(1); // push side effect should not affect this method by spec - return prev + current; -}), 0); -// array should be changed, but this method result should be calculated for old array length -assert(i == 6); -assert(arr.length == 8); -i = arr.reduce(((prev: i32, current: i32, index: i32, array: Array): i32 => prev + current), 0); -assert(i == 10); - -arr.pop(); -arr.pop(); -arr.pop(); -arr.pop(); - -// Test side effect pop -i = arr.reduce(((prev: i32, current: i32, index: i32, array: Array): i32 => { - array.pop(); //poped items shouldn't be reduced, and we shouldn't go out of bounds - return prev + current; -}), 0); -// only 2 first items was reduced, since last 2 was removed by .pop() -assert(i == 1); -assert(arr.length == 2); - -arr.push(2); -arr.push(3); +{ + i = arr.reduce(((prev: i32, current: i32, index: i32, array: Array): i32 => prev + current), 0); + assert(i == 6); + + // init value + i = arr.reduce(((prev: i32, current: i32, index: i32, array: Array): i32 => prev + current), 4); + assert(i == 10); + + let boolVal = arr.reduce(((prev: bool, current: i32, index: i32, array: Array): bool => prev || current > 2), false); + assert(boolVal == true); + + boolVal = arr.reduce(((prev: bool, current: i32, index: i32, array: Array): bool => prev || current > 100), false); + assert(boolVal == false); + + // Test side effect push + i = arr.reduce(((prev: i32, current: i32, index: i32, array: Array): i32 => { + array.push(1); // push side effect should not affect this method by spec + return prev + current; + }), 0); + // array should be changed, but this method result should be calculated for old array length + assert(i == 6); + assert(arr.length == 8); + i = arr.reduce(((prev: i32, current: i32, index: i32, array: Array): i32 => prev + current), 0); + assert(i == 10); + + arr.pop(); + arr.pop(); + arr.pop(); + arr.pop(); + + // Test side effect pop + i = arr.reduce(((prev: i32, current: i32, index: i32, array: Array): i32 => { + array.pop(); //poped items shouldn't be reduced, and we shouldn't go out of bounds + return prev + current; + }), 0); + // only 2 first items was reduced, since last 2 was removed by .pop() + assert(i == 1); + assert(arr.length == 2); + + arr.push(2); + arr.push(3); +} // Array#reduceRight /////////////////////////////////////////////////////////////////////////////// -i = arr.reduceRight(((prev: i32, current: i32, index: i32, array: Array): i32 => prev + current), 0); -assert(i == 6); - -// init value -i = arr.reduceRight(((prev: i32, current: i32, index: i32, array: Array): i32 => prev + current), 4); -assert(i == 10); - -boolVal = arr.reduceRight(((prev: bool, current: i32, index: i32, array: Array): bool => prev || current > 2), false); -assert(boolVal == true); - -boolVal = arr.reduceRight(((prev: bool, current: i32, index: i32, array: Array): bool => prev || current > 100), false); -assert(boolVal == false); - -// Test side effect push -i = arr.reduceRight(((prev: i32, current: i32, index: i32, array: Array): i32 => { - array.push(1); // push side effect should not affect this method by spec - return prev + current; -}), 0); -// array should be changed, but this method result should be calculated for old array length -assert(i == 6); -assert(arr.length == 8); -i = arr.reduceRight(((prev: i32, current: i32, index: i32, array: Array): i32 => prev + current), 0); -assert(i == 10); - -arr.pop(); -arr.pop(); -arr.pop(); -arr.pop(); - -// Test side effect pop -i = arr.reduceRight(((prev: i32, current: i32, index: i32, array: Array): i32 => { - array.pop(); // poped items should be reduced - return prev + current; -}), 0); - -assert(i == 6); -assert(arr.length == 0); - -arr.push(0); -arr.push(1); -arr.push(2); -arr.push(3); +{ + i = arr.reduceRight(((prev: i32, current: i32, index: i32, array: Array): i32 => prev + current), 0); + assert(i == 6); + + // init value + i = arr.reduceRight(((prev: i32, current: i32, index: i32, array: Array): i32 => prev + current), 4); + assert(i == 10); + + let boolVal = arr.reduceRight(((prev: bool, current: i32, index: i32, array: Array): bool => prev || current > 2), false); + assert(boolVal == true); + + boolVal = arr.reduceRight(((prev: bool, current: i32, index: i32, array: Array): bool => prev || current > 100), false); + assert(boolVal == false); + + // Test side effect push + i = arr.reduceRight(((prev: i32, current: i32, index: i32, array: Array): i32 => { + array.push(1); // push side effect should not affect this method by spec + return prev + current; + }), 0); + // array should be changed, but this method result should be calculated for old array length + assert(i == 6); + assert(arr.length == 8); + i = arr.reduceRight(((prev: i32, current: i32, index: i32, array: Array): i32 => prev + current), 0); + assert(i == 10); + + arr.pop(); + arr.pop(); + arr.pop(); + arr.pop(); + + // Test side effect pop + i = arr.reduceRight(((prev: i32, current: i32, index: i32, array: Array): i32 => { + array.pop(); // poped items should be reduced + return prev + current; + }), 0); + + assert(i == 6); + assert(arr.length == 0); + + arr.push(0); + arr.push(1); + arr.push(2); + arr.push(3); +} // Array#sort ////////////////////////////////////////////////////////////////////////////////////// @@ -749,9 +768,9 @@ function isSorted(data: Array, comparator: (a: T, b: T) => i32 = COMPARATO } function createReverseOrderedArray(size: i32): Array { - var arr = new Array(size); - for (let i = 0; i < arr.length; i++) { - arr[i] = arr.length - 1 - i; + var arr = Array.create(size); + for (let i = 0; i < size; i++) { + arr[i] = size - 1 - i; } return arr; } @@ -759,18 +778,19 @@ function createReverseOrderedArray(size: i32): Array { NativeMath.seedRandom(reinterpret(JSMath.random())); function createRandomOrderedArray(size: i32): Array { - var arr = new Array(size); - for (let i = 0; i < arr.length; i++) { - arr[i] = (NativeMath.random() * arr.length); + var arr = Array.create(size); + for (let i = 0; i < size; i++) { + arr[i] = (NativeMath.random() * size); } return arr; } function createReverseOrderedNestedArray(size: i32): Array> { - var arr = new Array>(size); - for (let i: i32 = 0; i < arr.length; i++) { - arr[i] = new Array(1); - arr[i][0] = arr.length - 1 - i; + var arr = Array.create>(size); + for (let i: i32 = 0; i < size; i++) { + let inner = Array.create(1); + inner[0] = size - 1 - i; + arr[i] = inner; } return arr; } @@ -780,9 +800,9 @@ class Proxy { } function createReverseOrderedElementsArray(size: i32): Proxy[] { - var arr = new Array>(size); - for (let i: i32 = 0; i < arr.length; i++) { - arr[i] = new Proxy(arr.length - 1 - i); + var arr = Array.create>(size); + for (let i: i32 = 0; i < size; i++) { + arr[i] = new Proxy(size - 1 - i); } return arr; } @@ -799,8 +819,8 @@ function createRandomString(len: i32): string { } function createRandomStringArray(size: i32): string[] { - var arr = new Array(size); - for (let i: i32 = 0; i < arr.length; i++) { + var arr = Array.create(size); + for (let i: i32 = 0; i < size; i++) { arr[i] = createRandomString((NativeMath.random() * 32)); } return arr; @@ -815,126 +835,148 @@ function assertSortedDefault(arr: Array): void { } // Tests for default comparator +{ + let f32ArrayTyped: f32[] = [1.0, NaN, -Infinity, 1.00000001, 0.0, -1.0, -2.0, +Infinity]; + f32ArrayTyped.sort(); + assert(isArraysEqual(f32ArrayTyped, [-Infinity, -2.0, -1.0, 0.0, 1.0, 1.00000001, Infinity, NaN])); -var f32ArrayTyped: f32[] = [1.0, NaN, -Infinity, 1.00000001, 0.0, -1.0, -2.0, +Infinity]; -f32ArrayTyped.sort(); -assert(isArraysEqual(f32ArrayTyped, [-Infinity, -2.0, -1.0, 0.0, 1.0, 1.00000001, Infinity, NaN])); - -var f64ArrayTyped: f64[] = [1.0, NaN, -Infinity, 1.000000000000001, 0.0, -1.0, -2.0, +Infinity]; -f64ArrayTyped.sort(); -assert(isArraysEqual(f64ArrayTyped, [-Infinity, -2.0, -1.0, 0.0, 1.0, 1.000000000000001, Infinity, NaN])); + let f64ArrayTyped: f64[] = [1.0, NaN, -Infinity, 1.000000000000001, 0.0, -1.0, -2.0, +Infinity]; + f64ArrayTyped.sort(); + assert(isArraysEqual(f64ArrayTyped, [-Infinity, -2.0, -1.0, 0.0, 1.0, 1.000000000000001, Infinity, NaN])); -var i32ArrayTyped: i32[] = [1, -2, -1, 0, 2]; -i32ArrayTyped.sort(); -assert(isArraysEqual(i32ArrayTyped, [-2, -1, 0, 1, 2])); + let i32ArrayTyped: i32[] = [1, -2, -1, 0, 2]; + i32ArrayTyped.sort(); + assert(isArraysEqual(i32ArrayTyped, [-2, -1, 0, 1, 2])); -var u32ArrayTyped: u32[] = [1, 4294967295, 4294967294, 0, 2]; -u32ArrayTyped.sort(); -assert(isArraysEqual(u32ArrayTyped, [0, 1, 2, 4294967294, 4294967295])); + let u32ArrayTyped: u32[] = [1, 4294967295, 4294967294, 0, 2]; + u32ArrayTyped.sort(); + assert(isArraysEqual(u32ArrayTyped, [0, 1, 2, 4294967294, 4294967295])); -var reversed0: i32[] = []; -var reversed1: i32[] = [1]; -var reversed2: i32[] = [2, 1]; -var reversed4: i32[] = [3, 2, 1, 0]; -var expected4: i32[] = [0, 1, 2, 3]; + let reversed0: i32[] = []; + let reversed1: i32[] = [1]; + let reversed2: i32[] = [2, 1]; + let reversed4: i32[] = [3, 2, 1, 0]; + let expected4: i32[] = [0, 1, 2, 3]; -var reversed64 = createReverseOrderedArray(64); -var reversed128 = createReverseOrderedArray(128); -var reversed1024 = createReverseOrderedArray(1024); -var reversed10000 = createReverseOrderedArray(10000); + let reversed64 = createReverseOrderedArray(64); + let reversed128 = createReverseOrderedArray(128); + let reversed1024 = createReverseOrderedArray(1024); + let reversed10000 = createReverseOrderedArray(10000); -var randomized512 = createRandomOrderedArray(512); + let randomized512 = createRandomOrderedArray(512); -// Test sorting with with default comparator + // Test sorting with with default comparator -assertSortedDefault(reversed0); + assertSortedDefault(reversed0); -assertSortedDefault(reversed1); -assert(isArraysEqual(reversed1, [1])); + assertSortedDefault(reversed1); + assert(isArraysEqual(reversed1, [1])); -assertSortedDefault(reversed2); -assert(isArraysEqual(reversed2, [1, 2])); + assertSortedDefault(reversed2); + assert(isArraysEqual(reversed2, [1, 2])); -assertSortedDefault(reversed4); -assert(isArraysEqual(reversed4, expected4)); + assertSortedDefault(reversed4); + assert(isArraysEqual(reversed4, expected4)); -assertSortedDefault(reversed64); -assert(isArraysEqual(reversed64, expected4, 4)); + assertSortedDefault(reversed64); + assert(isArraysEqual(reversed64, expected4, 4)); -assertSortedDefault(reversed128); -assert(isArraysEqual(reversed128, expected4, 4)); + assertSortedDefault(reversed128); + assert(isArraysEqual(reversed128, expected4, 4)); -assertSortedDefault(reversed1024); -assert(isArraysEqual(reversed1024, expected4, 4)); + assertSortedDefault(reversed1024); + assert(isArraysEqual(reversed1024, expected4, 4)); -assertSortedDefault(reversed10000); -assert(isArraysEqual(reversed10000, expected4, 4)); + assertSortedDefault(reversed10000); + assert(isArraysEqual(reversed10000, expected4, 4)); -assertSortedDefault(randomized512); + assertSortedDefault(randomized512); +} // Test sorting with custom comparator -var randomized64 = createRandomOrderedArray(64); -var randomized257 = createRandomOrderedArray(257); +{ + let randomized64 = createRandomOrderedArray(64); + let randomized257 = createRandomOrderedArray(257); -assertSorted(randomized64, (a: i32, b: i32): i32 => a - b); -assertSorted(randomized64, (a: i32, b: i32): i32 => b - a); + assertSorted(randomized64, (a: i32, b: i32): i32 => a - b); + assertSorted(randomized64, (a: i32, b: i32): i32 => b - a); -assertSorted(randomized257, (a: i32, b: i32): i32 => a - b); -assertSorted(randomized257, (a: i32, b: i32): i32 => b - a); + assertSorted(randomized257, (a: i32, b: i32): i32 => a - b); + assertSorted(randomized257, (a: i32, b: i32): i32 => b - a); +} // Test sorting complex objects - -var reversedNested512 = createReverseOrderedNestedArray(512); -assertSorted(reversedNested512, (a: i32[], b: i32[]): i32 => a[0] - b[0]); +{ + let reversedNested512 = createReverseOrderedNestedArray(2); + assertSorted(reversedNested512, (a: i32[], b: i32[]): i32 => a[0] - b[0]); +} // Test sorting reference elements -var reversedElements512 = createReverseOrderedElementsArray(512); -assertSorted>(reversedElements512, (a: Proxy, b: Proxy): i32 => a.x - b.x); +{ + let reversedElements512 = createReverseOrderedElementsArray(512); + assertSorted>(reversedElements512, (a: Proxy, b: Proxy): i32 => a.x - b.x); +} // Test sorting strings -var randomStringsActual: string[] = ["a", "b", "a", "ab", "ba", "", null]; -var randomStringsExpected: string[] = ["", "a", "a", "ab", "b", "ba", null]; +{ + let randomStringsActual: (string | null)[] = ["a", "b", "a", "ab", "ba", "", null]; + let randomStringsExpected: (string | null)[] = ["", "a", "a", "ab", "b", "ba", null]; -assertSorted(randomStringsActual); -assert(isArraysEqual(randomStringsActual, randomStringsExpected)); + assertSorted(randomStringsActual); + assert(isArraysEqual(randomStringsActual, randomStringsExpected)); -var randomStrings400 = createRandomStringArray(400); -assertSorted(randomStrings400); + let randomStrings400 = createRandomStringArray(400); + assertSorted(randomStrings400); +} // Array#join ////////////////////////////////////////////////////////////////////////////////////// class Ref { constructor() {} } -assert(([true, false]).join() == "true,false"); -assert(([1,-2,-3]).join("") == "1-2-3"); -assert(([1, 2, 3]).join("-") == "1-2-3"); -assert(([i32.MIN_VALUE, i32.MIN_VALUE]).join("__") == "-2147483648__-2147483648"); -assert(([0.0, 1.0, -2.0, NaN, -Infinity, Infinity]).join(", ") == "0.0, 1.0, -2.0, NaN, -Infinity, Infinity"); -assert((["", "1", null]).join("") == "1"); -var refArr: Ref[] = [new Ref(), null, new Ref()]; -assert(refArr.join() == "[object Object],,[object Object]"); +{ + assert(([true, false]).join() == "true,false"); + assert(([1,-2,-3]).join("") == "1-2-3"); + assert(([1, 2, 3]).join("-") == "1-2-3"); + assert(([i32.MIN_VALUE, i32.MIN_VALUE]).join("__") == "-2147483648__-2147483648"); + assert(([0.0, 1.0, -2.0, NaN, -Infinity, Infinity]).join(", ") == "0.0, 1.0, -2.0, NaN, -Infinity, Infinity"); + assert((["", "1", null]).join("") == "1"); + let refArr: (Ref | null)[] = [new Ref(), null, new Ref()]; + assert(refArr.join() == "[object Object],,[object Object]"); +} // Array#toString ////////////////////////////////////////////////////////////////////////////////// +{ + let arr0: i32[] = []; + let arr1: i32[] = [1]; + let arr2: i32[] = [1,2]; + let arr3: i32[] = [0,1,2,3]; + + assert(arr0.toString() == ""); + assert(arr1.toString() == "1"); + assert(arr2.toString() == "1,2"); + assert(arr3.toString() == "0,1,2,3"); -assert(reversed0.toString() == ""); -assert(reversed1.toString() == "1"); -assert(reversed2.toString() == "1,2"); -assert(reversed4.toString() == "0,1,2,3"); + assert(([1, -1, 0]).toString() == "1,-1,0"); + assert(([1, 0xFFFF, 0]).toString() == "1,65535,0"); + assert(([1, 0xFFFFFFFFFFFFFFFF, 0]).toString() == "1,18446744073709551615,0"); + assert(([-1, -1234567890123456, 0, i64.MAX_VALUE]).toString() == "-1,-1234567890123456,0,9223372036854775807"); -assert(([1, -1, 0]).toString() == "1,-1,0"); -assert(([1, 0xFFFF, 0]).toString() == "1,65535,0"); -assert(([1, 0xFFFFFFFFFFFFFFFF, 0]).toString() == "1,18446744073709551615,0"); -assert(([-1, -1234567890123456, 0, i64.MAX_VALUE]).toString() == "-1,-1234567890123456,0,9223372036854775807"); -assert(randomStringsExpected.toString() == ",a,a,ab,b,ba,"); -assert((["1", "2", null, "4"]).toString() == "1,2,,4"); + let arrStr: (string | null)[] = ["", "a", "a", "ab", "b", "ba", null] -var subarr32: i32[][] = [[1,2], [3,4]]; -assert(subarr32.toString() == "1,2,3,4"); + assert(arrStr.toString() == ",a,a,ab,b,ba,"); + assert((["1", "2", null, "4"]).toString() == "1,2,,4"); -var subarr8: u8[][] = [[1,2], [3,4]]; -assert(subarr8.toString() == "1,2,3,4"); + var subarr32: i32[][] = [[1,2], [3,4]]; + assert(subarr32.toString() == "1,2,3,4"); + + var subarr8: u8[][] = [[1,2], [3,4]]; + assert(subarr8.toString() == "1,2,3,4"); + + var subarrU32: u32[][][] = [[[1]]]; + assert(subarrU32.toString() == "1"); +} -var subarrU32: u32[][][] = [[[1]]]; -assert(subarrU32.toString() == "1"); +// Unleak globals +__release(changetype(arr)); diff --git a/tests/compiler/std/array.untouched.wat b/tests/compiler/std/array.untouched.wat index 5d7c3e9b8a..05e8f317fc 100644 --- a/tests/compiler/std/array.untouched.wat +++ b/tests/compiler/std/array.untouched.wat @@ -1,13 +1,13 @@ (module - (type $FUNCSIG$v (func)) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$vii (func (param i32 i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$viii (func (param i32 i32 i32))) - (type $FUNCSIG$iiiii (func (param i32 i32 i32 i32) (result i32))) - (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$vi (func (param i32))) - (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$iiiii (func (param i32 i32 i32 i32) (result i32))) (type $FUNCSIG$fiii (func (param i32 i32 i32) (result f32))) (type $FUNCSIG$fii (func (param i32 i32) (result f32))) (type $FUNCSIG$d (func (result f64))) @@ -19,8451 +19,4691 @@ (type $FUNCSIG$dii (func (param i32 i32) (result f64))) (type $FUNCSIG$id (func (param f64) (result i32))) (type $FUNCSIG$iiiiii (func (param i32 i32 i32 i32 i32) (result i32))) - (type $FUNCSIG$viiiii (func (param i32 i32 i32 i32 i32))) (type $FUNCSIG$iid (func (param i32 f64) (result i32))) + (type $FUNCSIG$jii (func (param i32 i32) (result i64))) (type $FUNCSIG$iijijiji (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) (type $FUNCSIG$iiid (func (param i32 i32 f64) (result i32))) (type $FUNCSIG$ij (func (param i64) (result i32))) (type $FUNCSIG$viji (func (param i32 i64 i32))) (type $FUNCSIG$iiij (func (param i32 i32 i64) (result i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32))) + (import "rtrace" "onincrement" (func $~lib/rt/rtrace/onincrement (param i32))) + (import "rtrace" "ondecrement" (func $~lib/rt/rtrace/ondecrement (param i32))) + (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) (import "Math" "random" (func $~lib/bindings/Math/random (result f64))) (memory $0 1) - (data (i32.const 8) "\0d\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") - (data (i32.const 40) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") - (data (i32.const 104) "\03\00\00\00a\00b\00c\00") - (data (i32.const 120) "\0c\00\00\00s\00t\00d\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") - (data (i32.const 152) "\1b\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s\00") - (data (i32.const 216) "\05\00\00\00\00\00\00\00\01\02\03\04\05\00\00\00") - (data (i32.const 232) "\d8\00\00\00\05\00\00\00") - (data (i32.const 240) "\05\00\00\00\00\00\00\00\01\01\01\04\05\00\00\00") - (data (i32.const 256) "\f0\00\00\00\05\00\00\00") - (data (i32.const 264) "\05\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 280) "\08\01\00\00\05\00\00\00") - (data (i32.const 288) "\05\00\00\00\00\00\00\00\01\01\00\00\00\00\00\00") - (data (i32.const 304) " \01\00\00\05\00\00\00") - (data (i32.const 312) "\05\00\00\00\00\00\00\00\01\01\00\02\02\00\00\00") - (data (i32.const 328) "8\01\00\00\05\00\00\00") - (data (i32.const 336) "\05\00\00\00\00\00\00\00\01\01\00\02\02\00\00\00") - (data (i32.const 352) "P\01\00\00\05\00\00\00") - (data (i32.const 360) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 392) "h\01\00\00\05\00\00\00") - (data (i32.const 400) "\14\00\00\00\00\00\00\00\01\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 432) "\90\01\00\00\05\00\00\00") - (data (i32.const 440) "\14\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 472) "\b8\01\00\00\05\00\00\00") - (data (i32.const 480) "\14\00\00\00\00\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 512) "\e0\01\00\00\05\00\00\00") - (data (i32.const 520) "\14\00\00\00\00\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\02\00\00\00\00\00\00\00") - (data (i32.const 552) "\08\02\00\00\05\00\00\00") - (data (i32.const 560) "\14\00\00\00\00\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\02\00\00\00\00\00\00\00") - (data (i32.const 592) "0\02\00\00\05\00\00\00") - (data (i32.const 600) "\00\00\00\00\00\00\00\00") - (data (i32.const 608) "X\02\00\00\00\00\00\00") - (data (i32.const 616) "\00\00\00\00\00\00\00\00") - (data (i32.const 624) "h\02\00\00\00\00\00\00") - (data (i32.const 632) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 664) "x\02\00\00\05\00\00\00") - (data (i32.const 672) "\14\00\00\00\00\00\00\00\04\00\00\00\05\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 704) "\a0\02\00\00\05\00\00\00") - (data (i32.const 712) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 744) "\c8\02\00\00\05\00\00\00") - (data (i32.const 752) "\14\00\00\00\00\00\00\00\01\00\00\00\04\00\00\00\05\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 784) "\f0\02\00\00\05\00\00\00") - (data (i32.const 792) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 824) "\18\03\00\00\05\00\00\00") - (data (i32.const 832) "\14\00\00\00\00\00\00\00\01\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 864) "@\03\00\00\05\00\00\00") - (data (i32.const 872) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 904) "h\03\00\00\05\00\00\00") - (data (i32.const 912) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 944) "\90\03\00\00\05\00\00\00") - (data (i32.const 952) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 984) "\b8\03\00\00\05\00\00\00") - (data (i32.const 992) "\14\00\00\00\00\00\00\00\04\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 1024) "\e0\03\00\00\05\00\00\00") - (data (i32.const 1032) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 1064) "\08\04\00\00\05\00\00\00") - (data (i32.const 1072) "\14\00\00\00\00\00\00\00\01\00\00\00\04\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 1104) "0\04\00\00\05\00\00\00") - (data (i32.const 1112) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 1144) "X\04\00\00\05\00\00\00") - (data (i32.const 1152) "\14\00\00\00\00\00\00\00\01\00\00\00\03\00\00\00\04\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 1184) "\80\04\00\00\05\00\00\00") - (data (i32.const 1192) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 1224) "\a8\04\00\00\05\00\00\00") - (data (i32.const 1232) "\14\00\00\00\00\00\00\00\04\00\00\00\05\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 1264) "\d0\04\00\00\05\00\00\00") - (data (i32.const 1272) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 1304) "\f8\04\00\00\05\00\00\00") - (data (i32.const 1312) "\14\00\00\00\00\00\00\00\04\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 1344) " \05\00\00\05\00\00\00") - (data (i32.const 1352) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 1384) "H\05\00\00\05\00\00\00") - (data (i32.const 1392) "\14\00\00\00\00\00\00\00\01\00\00\00\03\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 1424) "p\05\00\00\05\00\00\00") - (data (i32.const 1432) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 1464) "\98\05\00\00\05\00\00\00") - (data (i32.const 1472) "\14\00\00\00\00\00\00\00\01\00\00\00\03\00\00\00\04\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 1504) "\c0\05\00\00\05\00\00\00") - (data (i32.const 1512) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 1544) "\e8\05\00\00\05\00\00\00") - (data (i32.const 1552) "\14\00\00\00\00\00\00\00\01\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 1584) "\10\06\00\00\05\00\00\00") - (data (i32.const 1592) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 1624) "8\06\00\00\05\00\00\00") - (data (i32.const 1632) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 1664) "`\06\00\00\05\00\00\00") - (data (i32.const 1672) "\00\00\00\00\00\00\00\00") - (data (i32.const 1680) "\88\06\00\00\00\00\00\00") - (data (i32.const 1688) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 1720) "\98\06\00\00\05\00\00\00") - (data (i32.const 1728) "\0c\00\00\00\00\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 1760) "\c0\06\00\00\03\00\00\00") - (data (i32.const 1768) "\08\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00") - (data (i32.const 1784) "\e8\06\00\00\02\00\00\00") - (data (i32.const 1792) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 1824) "\00\07\00\00\05\00\00\00") - (data (i32.const 1832) "\08\00\00\00\00\00\00\00\03\00\00\00\04\00\00\00") - (data (i32.const 1848) "(\07\00\00\02\00\00\00") - (data (i32.const 1856) "\0c\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\05\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 1888) "@\07\00\00\03\00\00\00") - (data (i32.const 1896) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 1928) "h\07\00\00\05\00\00\00") - (data (i32.const 1936) "\04\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00") - (data (i32.const 1952) "\90\07\00\00\01\00\00\00") - (data (i32.const 1960) "\10\00\00\00\00\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 1992) "\a8\07\00\00\04\00\00\00") - (data (i32.const 2000) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 2032) "\d0\07\00\00\05\00\00\00") - (data (i32.const 2040) "\04\00\00\00\00\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 2056) "\f8\07\00\00\01\00\00\00") - (data (i32.const 2064) "\10\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 2096) "\10\08\00\00\04\00\00\00") - (data (i32.const 2104) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 2136) "8\08\00\00\05\00\00\00") - (data (i32.const 2144) "\08\00\00\00\00\00\00\00\04\00\00\00\05\00\00\00") - (data (i32.const 2160) "`\08\00\00\02\00\00\00") - (data (i32.const 2168) "\0c\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 2200) "x\08\00\00\03\00\00\00") - (data (i32.const 2208) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 2240) "\a0\08\00\00\05\00\00\00") - (data (i32.const 2248) "\04\00\00\00\00\00\00\00\04\00\00\00\00\00\00\00") - (data (i32.const 2264) "\c8\08\00\00\01\00\00\00") - (data (i32.const 2272) "\10\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\05\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 2304) "\e0\08\00\00\04\00\00\00") - (data (i32.const 2312) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 2344) "\08\t\00\00\05\00\00\00") - (data (i32.const 2352) "\04\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00") - (data (i32.const 2368) "0\t\00\00\01\00\00\00") - (data (i32.const 2376) "\10\00\00\00\00\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 2408) "H\t\00\00\04\00\00\00") - (data (i32.const 2416) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 2448) "p\t\00\00\05\00\00\00") - (data (i32.const 2456) "\00\00\00\00\00\00\00\00") - (data (i32.const 2464) "\98\t\00\00\00\00\00\00") - (data (i32.const 2472) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 2504) "\a8\t\00\00\05\00\00\00") - (data (i32.const 2512) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 2544) "\d0\t\00\00\05\00\00\00") - (data (i32.const 2552) "\00\00\00\00\00\00\00\00") - (data (i32.const 2560) "\f8\t\00\00\00\00\00\00") - (data (i32.const 2568) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 2600) "\08\n\00\00\05\00\00\00") - (data (i32.const 2608) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 2640) "0\n\00\00\05\00\00\00") - (data (i32.const 2648) "\00\00\00\00\00\00\00\00") - (data (i32.const 2656) "X\n\00\00\00\00\00\00") - (data (i32.const 2664) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 2696) "h\n\00\00\05\00\00\00") - (data (i32.const 2704) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 2736) "\90\n\00\00\05\00\00\00") - (data (i32.const 2744) "\00\00\00\00\00\00\00\00") - (data (i32.const 2752) "\b8\n\00\00\00\00\00\00") - (data (i32.const 2760) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 2792) "\c8\n\00\00\05\00\00\00") - (data (i32.const 2800) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 2832) "\f0\n\00\00\05\00\00\00") - (data (i32.const 2840) "\00\00\00\00\00\00\00\00") - (data (i32.const 2848) "\18\0b\00\00\00\00\00\00") - (data (i32.const 2856) "\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 2888) "(\0b\00\00\05\00\00\00") - (data (i32.const 2896) "\0c\00\00\00~\00l\00i\00b\00/\00m\00a\00t\00h\00.\00t\00s\00") - (data (i32.const 2928) "V\00\00\00A\00B\00C\00D\00E\00F\00G\00H\00I\00J\00K\00L\00M\00N\00O\00P\00Q\00R\00S\00T\00U\00V\00W\00X\00Y\00Z\00a\00b\00c\00d\00e\00f\00g\00h\00i\00j\00k\00l\00m\00n\00o\00p\00q\00r\00s\00t\00u\00v\00w\00x\00y\00z\000\001\002\003\004\005\006\007\008\009\00_\00-\00,\00.\00+\00/\00\\\00[\00]\00{\00}\00(\00)\00<\00>\00*\00&\00$\00%\00^\00@\00#\00!\00?\00") - (data (i32.const 3104) " \00\00\00\00\00\00\00\00\00\80?\00\00\c0\7f\00\00\80\ff\00\00\80?\00\00\00\00\00\00\80\bf\00\00\00\c0\00\00\80\7f\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 3168) " \0c\00\00\08\00\00\00") - (data (i32.const 3176) " \00\00\00\00\00\00\00\00\00\80\ff\00\00\00\c0\00\00\80\bf\00\00\00\00\00\00\80?\00\00\80?\00\00\80\7f\00\00\c0\7f\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 3240) "h\0c\00\00\08\00\00\00") - (data (i32.const 3248) "@\00\00\00\00\00\00\00\00\00\00\00\00\00\f0?\00\00\00\00\00\00\f8\7f\00\00\00\00\00\00\f0\ff\05\00\00\00\00\00\f0?\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f0\bf\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f0\7f\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 3376) "\b0\0c\00\00\08\00\00\00") - (data (i32.const 3384) "@\00\00\00\00\00\00\00\00\00\00\00\00\00\f0\ff\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f0\bf\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f0?\05\00\00\00\00\00\f0?\00\00\00\00\00\00\f0\7f\00\00\00\00\00\00\f8\7f\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 3512) "8\0d\00\00\08\00\00\00") - (data (i32.const 3520) "\14\00\00\00\00\00\00\00\01\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff\00\00\00\00\02\00\00\00\00\00\00\00") - (data (i32.const 3552) "\c0\0d\00\00\05\00\00\00") - (data (i32.const 3560) "\14\00\00\00\00\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff\00\00\00\00\01\00\00\00\02\00\00\00\00\00\00\00") - (data (i32.const 3592) "\e8\0d\00\00\05\00\00\00") - (data (i32.const 3600) "\14\00\00\00\00\00\00\00\01\00\00\00\ff\ff\ff\ff\fe\ff\ff\ff\00\00\00\00\02\00\00\00\00\00\00\00") - (data (i32.const 3632) "\10\0e\00\00\05\00\00\00") - (data (i32.const 3640) "\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff\00\00\00\00") - (data (i32.const 3672) "8\0e\00\00\05\00\00\00") - (data (i32.const 3680) "\00\00\00\00\00\00\00\00") - (data (i32.const 3688) "`\0e\00\00\00\00\00\00") - (data (i32.const 3696) "\04\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00") - (data (i32.const 3712) "p\0e\00\00\01\00\00\00") - (data (i32.const 3720) "\08\00\00\00\00\00\00\00\02\00\00\00\01\00\00\00") - (data (i32.const 3736) "\88\0e\00\00\02\00\00\00") - (data (i32.const 3744) "\10\00\00\00\00\00\00\00\03\00\00\00\02\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 3776) "\a0\0e\00\00\04\00\00\00") - (data (i32.const 3784) "\10\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 3816) "\c8\0e\00\00\04\00\00\00") - (data (i32.const 3824) "\04\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00") - (data (i32.const 3840) "\f0\0e\00\00\01\00\00\00") - (data (i32.const 3848) "\08\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00") - (data (i32.const 3864) "\08\0f\00\00\02\00\00\00") - (data (i32.const 3872) "\01\00\00\00a\00") - (data (i32.const 3880) "\01\00\00\00b\00") - (data (i32.const 3888) "\02\00\00\00a\00b\00") - (data (i32.const 3896) "\02\00\00\00b\00a\00") - (data (i32.const 3904) "\00\00\00\00") - (data (i32.const 3912) "\1c\00\00\00\00\00\00\00 \0f\00\00(\0f\00\00 \0f\00\000\0f\00\008\0f\00\00@\0f\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 3976) "H\0f\00\00\07\00\00\00") - (data (i32.const 3984) "\1c\00\00\00\00\00\00\00@\0f\00\00 \0f\00\00 \0f\00\000\0f\00\00(\0f\00\008\0f\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 4048) "\90\0f\00\00\07\00\00\00") - (data (i32.const 4056) "\0e\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s\00") - (data (i32.const 4088) "\17\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s\00") - (data (i32.const 4144) "\04\00\00\00n\00u\00l\00l\00") - (data (i32.const 4160) "\02\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00") - (data (i32.const 4176) "@\10\00\00\02\00\00\00") - (data (i32.const 4184) "\04\00\00\00t\00r\00u\00e\00") - (data (i32.const 4200) "\05\00\00\00f\00a\00l\00s\00e\00") - (data (i32.const 4216) "\01\00\00\00,\00") - (data (i32.const 4224) "\02\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00") - (data (i32.const 4240) "\80\10\00\00\02\00\00\00") - (data (i32.const 4248) "\n\00\00\00t\00r\00u\00e\00,\00f\00a\00l\00s\00e\00") - (data (i32.const 4272) "\0c\00\00\00\00\00\00\00\01\00\00\00\fe\ff\ff\ff\fd\ff\ff\ff\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 4304) "\b0\10\00\00\03\00\00\00") - (data (i32.const 4312) "\01\00\00\000\00") - (data (i32.const 4320) "\90\01\00\00\00\00\00\000\000\000\001\000\002\000\003\000\004\000\005\000\006\000\007\000\008\000\009\001\000\001\001\001\002\001\003\001\004\001\005\001\006\001\007\001\008\001\009\002\000\002\001\002\002\002\003\002\004\002\005\002\006\002\007\002\008\002\009\003\000\003\001\003\002\003\003\003\004\003\005\003\006\003\007\003\008\003\009\004\000\004\001\004\002\004\003\004\004\004\005\004\006\004\007\004\008\004\009\005\000\005\001\005\002\005\003\005\004\005\005\005\006\005\007\005\008\005\009\006\000\006\001\006\002\006\003\006\004\006\005\006\006\006\007\006\008\006\009\007\000\007\001\007\002\007\003\007\004\007\005\007\006\007\007\007\008\007\009\008\000\008\001\008\002\008\003\008\004\008\005\008\006\008\007\008\008\008\009\009\000\009\001\009\002\009\003\009\004\009\005\009\006\009\007\009\008\009\009\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 4832) "\e0\10\00\00d\00\00\00") - (data (i32.const 4840) "\0c\00\00\00\00\00\00\00\01\00\00\00\fe\ff\ff\ff\fd\ff\ff\ff\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 4872) "\e8\12\00\00\03\00\00\00") - (data (i32.const 4880) "\05\00\00\001\00-\002\00-\003\00") - (data (i32.const 4896) "\0c\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 4928) " \13\00\00\03\00\00\00") - (data (i32.const 4936) "\01\00\00\00-\00") - (data (i32.const 4944) "\0c\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 4976) "P\13\00\00\03\00\00\00") - (data (i32.const 4984) "\08\00\00\00\00\00\00\00\00\00\00\80\00\00\00\80") - (data (i32.const 5000) "x\13\00\00\02\00\00\00") - (data (i32.const 5008) "\02\00\00\00_\00_\00") - (data (i32.const 5016) "\08\00\00\00\00\00\00\00\00\00\00\80\00\00\00\80") - (data (i32.const 5032) "\98\13\00\00\02\00\00\00") - (data (i32.const 5040) "\18\00\00\00-\002\001\004\007\004\008\003\006\004\008\00_\00_\00-\002\001\004\007\004\008\003\006\004\008\00") - (data (i32.const 5096) "0\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f0?\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f8\7f\00\00\00\00\00\00\f0\ff\00\00\00\00\00\00\f0\7f\00\00\00\00\00\00\00\00") - (data (i32.const 5160) "\e8\13\00\00\06\00\00\00") - (data (i32.const 5168) "\02\00\00\00,\00 \00") - (data (i32.const 5176) "\03\00\00\000\00.\000\00") - (data (i32.const 5192) "\03\00\00\00N\00a\00N\00") - (data (i32.const 5208) "\t\00\00\00-\00I\00n\00f\00i\00n\00i\00t\00y\00") - (data (i32.const 5232) "\08\00\00\00I\00n\00f\00i\00n\00i\00t\00y\00") - (data (i32.const 5256) "\b8\02\00\00\00\00\00\00\88\02\1c\08\a0\d5\8f\fav\bf>\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8~anonymous|0 $~lib/internal/sort/COMPARATOR~anonymous|0 $~lib/internal/sort/COMPARATOR~anonymous|0 $~lib/internal/sort/COMPARATOR~anonymous|0 $~lib/internal/sort/COMPARATOR~anonymous|1 $start:std/array~anonymous|43 $start:std/array~anonymous|44 $start:std/array~anonymous|45 $start:std/array~anonymous|46 $start:std/array~anonymous|47 $start:std/array~anonymous|48 $~lib/internal/sort/COMPARATOR<~lib/string/String>~anonymous|0) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) + (data (i32.const 8) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h\00") + (data (i32.const 56) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") + (data (i32.const 112) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 160) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 216) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s\00") + (data (i32.const 264) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 320) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s\00") + (data (i32.const 360) "\18\00\00\00\01\00\00\00\01\00\00\00\18\00\00\00s\00t\00d\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") + (data (i32.const 400) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00a\00b\00c\00") + (data (i32.const 424) "\05\00\00\00\01\00\00\00\00\00\00\00\05\00\00\00\01\02\03\04\05") + (data (i32.const 448) "\05\00\00\00\01\00\00\00\00\00\00\00\05\00\00\00\01\01\01\04\05") + (data (i32.const 472) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") + (data (i32.const 520) "\05\00\00\00\01\00\00\00\00\00\00\00\05\00\00\00\00\00\00\00\00") + (data (i32.const 544) "\05\00\00\00\01\00\00\00\00\00\00\00\05\00\00\00\01\01\00\00\00") + (data (i32.const 568) "\05\00\00\00\01\00\00\00\00\00\00\00\05\00\00\00\01\01\00\02\02") + (data (i32.const 592) "\05\00\00\00\01\00\00\00\00\00\00\00\05\00\00\00\01\01\00\02\02") + (data (i32.const 616) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 656) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 696) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 736) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 776) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\02\00\00\00") + (data (i32.const 816) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\02\00\00\00") + (data (i32.const 856) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00A\00r\00r\00a\00y\00 \00i\00s\00 \00e\00m\00p\00t\00y\00") + (data (i32.const 904) "\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 920) "\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 936) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 976) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\04\00\00\00\05\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 1016) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 1056) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\04\00\00\00\05\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 1096) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 1136) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\05\00\00\00") + (data (i32.const 1176) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 1216) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 1256) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 1296) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\04\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 1336) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 1376) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\04\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 1416) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 1456) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\03\00\00\00\04\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 1496) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 1536) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\04\00\00\00\05\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 1576) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 1616) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\04\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 1656) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 1696) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\03\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 1736) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 1776) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\03\00\00\00\04\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 1816) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 1856) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\05\00\00\00") + (data (i32.const 1896) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 1936) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 1976) "\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 1992) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 2032) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 2064) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\01\00\00\00\02\00\00\00") + (data (i32.const 2088) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 2128) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\03\00\00\00\04\00\00\00") + (data (i32.const 2152) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\01\00\00\00\02\00\00\00\05\00\00\00") + (data (i32.const 2184) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 2224) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01\00\00\00") + (data (i32.const 2248) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 2280) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 2320) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 2344) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00") + (data (i32.const 2376) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 2416) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 2440) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00") + (data (i32.const 2472) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 2512) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\04\00\00\00") + (data (i32.const 2536) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\05\00\00\00") + (data (i32.const 2568) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 2608) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01\00\00\00") + (data (i32.const 2632) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 2664) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 2704) "\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 2720) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 2760) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 2800) "\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 2816) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 2856) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 2896) "\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 2912) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 2952) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 2992) "\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 3008) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 3048) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 3088) "\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 3104) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 3144) "\18\00\00\00\01\00\00\00\01\00\00\00\18\00\00\00~\00l\00i\00b\00/\00m\00a\00t\00h\00.\00t\00s\00") + (data (i32.const 3184) "\ac\00\00\00\01\00\00\00\01\00\00\00\ac\00\00\00A\00B\00C\00D\00E\00F\00G\00H\00I\00J\00K\00L\00M\00N\00O\00P\00Q\00R\00S\00T\00U\00V\00W\00X\00Y\00Z\00a\00b\00c\00d\00e\00f\00g\00h\00i\00j\00k\00l\00m\00n\00o\00p\00q\00r\00s\00t\00u\00v\00w\00x\00y\00z\000\001\002\003\004\005\006\007\008\009\00_\00-\00,\00.\00+\00/\00\\\00[\00]\00{\00}\00(\00)\00<\00>\00*\00&\00$\00%\00^\00@\00#\00!\00?\00") + (data (i32.const 3376) " \00\00\00\01\00\00\00\00\00\00\00 \00\00\00\00\00\80?\00\00\c0\7f\00\00\80\ff\00\00\80?\00\00\00\00\00\00\80\bf\00\00\00\c0\00\00\80\7f") + (data (i32.const 3424) " \00\00\00\01\00\00\00\00\00\00\00 \00\00\00\00\00\80\ff\00\00\00\c0\00\00\80\bf\00\00\00\00\00\00\80?\00\00\80?\00\00\80\7f\00\00\c0\7f") + (data (i32.const 3472) "@\00\00\00\01\00\00\00\00\00\00\00@\00\00\00\00\00\00\00\00\00\f0?\00\00\00\00\00\00\f8\7f\00\00\00\00\00\00\f0\ff\05\00\00\00\00\00\f0?\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f0\bf\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f0\7f") + (data (i32.const 3552) "@\00\00\00\01\00\00\00\00\00\00\00@\00\00\00\00\00\00\00\00\00\f0\ff\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f0\bf\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f0?\05\00\00\00\00\00\f0?\00\00\00\00\00\00\f0\7f\00\00\00\00\00\00\f8\7f") + (data (i32.const 3632) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff\00\00\00\00\02\00\00\00") + (data (i32.const 3672) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff\00\00\00\00\01\00\00\00\02\00\00\00") + (data (i32.const 3712) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\ff\ff\ff\ff\fe\ff\ff\ff\00\00\00\00\02\00\00\00") + (data (i32.const 3752) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff") + (data (i32.const 3792) "\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 3808) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01\00\00\00") + (data (i32.const 3832) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\02\00\00\00\01\00\00\00") + (data (i32.const 3856) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\03\00\00\00\02\00\00\00\01\00\00\00\00\00\00\00") + (data (i32.const 3888) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00") + (data (i32.const 3920) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00P\00R\00N\00G\00 \00m\00u\00s\00t\00 \00b\00e\00 \00s\00e\00e\00d\00e\00d\00.\00") + (data (i32.const 3976) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01\00\00\00") + (data (i32.const 4000) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\01\00\00\00\02\00\00\00") + (data (i32.const 4024) "^\00\00\00\01\00\00\00\01\00\00\00^\00\00\00E\00l\00e\00m\00e\00n\00t\00 \00t\00y\00p\00e\00 \00m\00u\00s\00t\00 \00b\00e\00 \00n\00u\00l\00l\00a\00b\00l\00e\00 \00i\00f\00 \00a\00r\00r\00a\00y\00 \00i\00s\00 \00h\00o\00l\00e\00y\00") + (data (i32.const 4136) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00a\00") + (data (i32.const 4160) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00b\00") + (data (i32.const 4184) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00a\00b\00") + (data (i32.const 4208) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00b\00a\00") + (data (i32.const 4232) "\00\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00") + (data (i32.const 4248) "\1c\00\00\00\01\00\00\00\00\00\00\00\1c\00\00\008\10\00\00P\10\00\008\10\00\00h\10\00\00\80\10\00\00\98\10\00\00\00\00\00\00") + (data (i32.const 4296) "\1c\00\00\00\01\00\00\00\00\00\00\00\1c\00\00\00\98\10\00\008\10\00\008\10\00\00h\10\00\00P\10\00\00\80\10\00\00\00\00\00\00") + (data (i32.const 4344) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s\00") + (data (i32.const 4392) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00n\00u\00l\00l\00") + (data (i32.const 4416) "\02\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\01\00") + (data (i32.const 4440) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00t\00r\00u\00e\00") + (data (i32.const 4464) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00f\00a\00l\00s\00e\00") + (data (i32.const 4496) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00,\00") + (data (i32.const 4520) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00t\00r\00u\00e\00,\00f\00a\00l\00s\00e\00") + (data (i32.const 4560) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\01\00\00\00\fe\ff\ff\ff\fd\ff\ff\ff") + (data (i32.const 4592) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\000\00") + (data (i32.const 4616) "\90\01\00\00\01\00\00\00\00\00\00\00\90\01\00\000\000\000\001\000\002\000\003\000\004\000\005\000\006\000\007\000\008\000\009\001\000\001\001\001\002\001\003\001\004\001\005\001\006\001\007\001\008\001\009\002\000\002\001\002\002\002\003\002\004\002\005\002\006\002\007\002\008\002\009\003\000\003\001\003\002\003\003\003\004\003\005\003\006\003\007\003\008\003\009\004\000\004\001\004\002\004\003\004\004\004\005\004\006\004\007\004\008\004\009\005\000\005\001\005\002\005\003\005\004\005\005\005\006\005\007\005\008\005\009\006\000\006\001\006\002\006\003\006\004\006\005\006\006\006\007\006\008\006\009\007\000\007\001\007\002\007\003\007\004\007\005\007\006\007\007\007\008\007\009\008\000\008\001\008\002\008\003\008\004\008\005\008\006\008\007\008\008\008\009\009\000\009\001\009\002\009\003\009\004\009\005\009\006\009\007\009\008\009\009\00") + (data (i32.const 5032) "\10\00\00\00\01\00\00\00\07\00\00\00\10\00\00\00\18\12\00\00\18\12\00\00\90\01\00\00d\00\00\00") + (data (i32.const 5064) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\001\00-\002\00-\003\00") + (data (i32.const 5096) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00") + (data (i32.const 5128) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00-\00") + (data (i32.const 5152) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\00\00\00\80\00\00\00\80") + (data (i32.const 5176) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00_\00_\00") + (data (i32.const 5200) "0\00\00\00\01\00\00\00\01\00\00\000\00\00\00-\002\001\004\007\004\008\003\006\004\008\00_\00_\00-\002\001\004\007\004\008\003\006\004\008\00") + (data (i32.const 5264) "0\00\00\00\01\00\00\00\00\00\00\000\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f0?\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f8\7f\00\00\00\00\00\00\f0\ff\00\00\00\00\00\00\f0\7f") + (data (i32.const 5328) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00,\00 \00") + (data (i32.const 5352) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\000\00.\000\00") + (data (i32.const 5376) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00N\00a\00N\00") + (data (i32.const 5400) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\00-\00I\00n\00f\00i\00n\00i\00t\00y\00") + (data (i32.const 5440) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00I\00n\00f\00i\00n\00i\00t\00y\00") + (data (i32.const 5472) "\b8\02\00\00\01\00\00\00\00\00\00\00\b8\02\00\00\88\02\1c\08\a0\d5\8f\fav\bf>\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|1 $start:std/array~anonymous|43 $start:std/array~anonymous|44 $start:std/array~anonymous|45 $start:std/array~anonymous|46 $start:std/array~anonymous|47 $start:std/array~anonymous|48 $~lib/util/sort/COMPARATOR<~lib/string/String | null>~anonymous|0 $~lib/util/sort/COMPARATOR<~lib/string/String>~anonymous|0) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) + (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) (global $std/array/arr (mut i32) (i32.const 0)) - (global $std/array/num (mut i32) (i32.const 1)) - (global $std/array/Null (mut i32) (i32.const 0)) - (global $std/array/str (mut i32) (i32.const 104)) - (global $std/array/arr8 (mut i32) (i32.const 232)) (global $~lib/builtins/i32.MAX_VALUE i32 (i32.const 2147483647)) - (global $~lib/argc (mut i32) (i32.const 0)) - (global $std/array/arr32 (mut i32) (i32.const 392)) (global $std/array/i (mut i32) (i32.const 0)) - (global $std/array/other (mut i32) (i32.const 0)) - (global $std/array/out (mut i32) (i32.const 0)) - (global $std/array/source (mut i32) (i32.const 624)) - (global $std/array/cwArr (mut i32) (i32.const 0)) - (global $std/array/includes (mut i32) (i32.const 0)) - (global $std/array/sarr (mut i32) (i32.const 1624)) - (global $std/array/every (mut i32) (i32.const 0)) - (global $std/array/some (mut i32) (i32.const 0)) - (global $std/array/newArr (mut i32) (i32.const 0)) - (global $std/array/filteredArr (mut i32) (i32.const 0)) - (global $std/array/boolVal (mut i32) (i32.const 0)) + (global $~lib/argc (mut i32) (i32.const 0)) (global $~lib/math/random_seeded (mut i32) (i32.const 0)) (global $~lib/math/random_state0_64 (mut i64) (i64.const 0)) (global $~lib/math/random_state1_64 (mut i64) (i64.const 0)) (global $~lib/math/random_state0_32 (mut i32) (i32.const 0)) (global $~lib/math/random_state1_32 (mut i32) (i32.const 0)) - (global $std/array/charset i32 (i32.const 2928)) - (global $std/array/f32ArrayTyped (mut i32) (i32.const 3168)) - (global $std/array/f64ArrayTyped (mut i32) (i32.const 3376)) - (global $std/array/i32ArrayTyped (mut i32) (i32.const 3552)) - (global $std/array/u32ArrayTyped (mut i32) (i32.const 3632)) - (global $std/array/reversed0 (mut i32) (i32.const 3688)) - (global $std/array/reversed1 (mut i32) (i32.const 3712)) - (global $std/array/reversed2 (mut i32) (i32.const 3736)) - (global $std/array/reversed4 (mut i32) (i32.const 3776)) - (global $std/array/expected4 (mut i32) (i32.const 3816)) - (global $std/array/reversed64 (mut i32) (i32.const 0)) - (global $std/array/reversed128 (mut i32) (i32.const 0)) - (global $std/array/reversed1024 (mut i32) (i32.const 0)) - (global $std/array/reversed10000 (mut i32) (i32.const 0)) - (global $std/array/randomized512 (mut i32) (i32.const 0)) - (global $std/array/randomized64 (mut i32) (i32.const 0)) - (global $std/array/randomized257 (mut i32) (i32.const 0)) - (global $std/array/reversedNested512 (mut i32) (i32.const 0)) - (global $std/array/reversedElements512 (mut i32) (i32.const 0)) - (global $std/array/randomStringsActual (mut i32) (i32.const 3976)) - (global $std/array/randomStringsExpected (mut i32) (i32.const 4048)) - (global $std/array/randomStrings400 (mut i32) (i32.const 0)) - (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $std/array/charset i32 (i32.const 3200)) (global $~lib/builtins/i32.MIN_VALUE i32 (i32.const -2147483648)) - (global $~lib/internal/number/_frc_plus (mut i64) (i64.const 0)) - (global $~lib/internal/number/_frc_minus (mut i64) (i64.const 0)) - (global $~lib/internal/number/_exp (mut i32) (i32.const 0)) - (global $~lib/internal/number/_K (mut i32) (i32.const 0)) - (global $~lib/internal/number/_frc_pow (mut i64) (i64.const 0)) - (global $~lib/internal/number/_exp_pow (mut i32) (i32.const 0)) - (global $std/array/refArr (mut i32) (i32.const 0)) + (global $~lib/util/number/_frc_plus (mut i64) (i64.const 0)) + (global $~lib/util/number/_frc_minus (mut i64) (i64.const 0)) + (global $~lib/util/number/_exp (mut i32) (i32.const 0)) + (global $~lib/util/number/_K (mut i32) (i32.const 0)) + (global $~lib/util/number/_frc_pow (mut i64) (i64.const 0)) + (global $~lib/util/number/_exp_pow (mut i32) (i32.const 0)) (global $~lib/builtins/u32.MAX_VALUE i32 (i32.const -1)) (global $~lib/builtins/i64.MAX_VALUE i64 (i64.const 9223372036854775807)) - (global $std/array/subarr32 (mut i32) (i32.const 7736)) - (global $std/array/subarr8 (mut i32) (i32.const 7832)) - (global $std/array/subarrU32 (mut i32) (i32.const 7904)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 7912)) + (global $~lib/started (mut i32) (i32.const 0)) + (global $~lib/rt/__rtti_base i32 (i32.const 7696)) + (global $~lib/heap/__heap_base i32 (i32.const 7908)) + (export "__start" (func $start)) (export "memory" (memory $0)) - (export "table" (table $0)) - (start $start) - (func $start:~lib/allocator/arena (; 2 ;) (type $FUNCSIG$v) - global.get $~lib/memory/HEAP_BASE - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - ) - (func $~lib/internal/arraybuffer/computeSize (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 1 - i32.const 32 - local.get $0 - i32.const 8 - i32.add - i32.const 1 - i32.sub - i32.clz - i32.sub - i32.shl - ) - (func $~lib/allocator/arena/__memory_allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/rt/tlsf/removeBlock (; 6 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - local.get $0 - i32.const 1073741824 - i32.gt_u + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz if + i32.const 0 + i32.const 128 + i32.const 276 + i32.const 13 + call $~lib/builtins/abort unreachable end - global.get $~lib/allocator/arena/offset - local.set $1 - local.get $1 - local.get $0 - local.tee $2 - i32.const 1 - local.tee $3 local.get $2 - local.get $3 - i32.gt_u - select - i32.add - i32.const 7 - i32.add - i32.const 7 + i32.const 3 i32.const -1 i32.xor i32.and - local.set $4 - current_memory - local.set $5 - local.get $4 - local.get $5 + local.set $3 + local.get $3 i32.const 16 - i32.shl - i32.gt_u + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 278 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 local.get $4 - local.get $1 + i32.const 4 i32.sub - i32.const 65535 - i32.add - i32.const 65535 - i32.const -1 - i32.xor - i32.and - i32.const 16 i32.shr_u - local.set $2 + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) local.get $5 - local.tee $3 - local.get $2 - local.tee $6 - local.get $3 - local.get $6 - i32.gt_s - select - local.set $3 - local.get $3 - grow_memory + i32.const 16 + i32.lt_u + else i32.const 0 - i32.lt_s - if - local.get $2 - grow_memory - i32.const 0 - i32.lt_s - if - unreachable - end - end end - local.get $4 - global.set $~lib/allocator/arena/offset - local.get $1 - ) - (func $~lib/internal/arraybuffer/allocateUnsafe (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - local.get $0 - i32.const 1073741816 - i32.le_u i32.eqz if i32.const 0 - i32.const 40 - i32.const 26 - i32.const 2 - call $~lib/env/abort + i32.const 128 + i32.const 291 + i32.const 13 + call $~lib/builtins/abort unreachable end - block $~lib/memory/memory.allocate|inlined.0 (result i32) - local.get $0 - call $~lib/internal/arraybuffer/computeSize - local.set $2 - local.get $2 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.0 - end - local.set $1 local.get $1 - local.get $0 - i32.store + i32.load offset=16 + local.set $6 local.get $1 - ) - (func $~lib/memory/memory.allocate (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - call $~lib/allocator/arena/__memory_allocate - return - ) - (func $~lib/internal/memory/memset (; 7 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i64) - local.get $2 - i32.eqz + i32.load offset=20 + local.set $7 + local.get $6 if - return + local.get $6 + local.get $7 + i32.store offset=20 end - local.get $0 - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 1 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 2 - i32.le_u + local.get $7 if - return + local.get $7 + local.get $6 + i32.store offset=16 end - local.get $0 - i32.const 1 - i32.add - local.get $1 - i32.store8 - local.get $0 - i32.const 2 - i32.add - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 2 - i32.sub - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 3 - i32.sub local.get $1 - i32.store8 - local.get $2 - i32.const 6 - i32.le_u - if - return + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 end - local.get $0 - i32.const 3 - i32.add - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 4 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 8 - i32.le_u + i32.eq if - return - end - i32.const 0 - local.get $0 - i32.sub - i32.const 3 - i32.and - local.set $3 - local.get $0 - local.get $3 - i32.add - local.set $0 - local.get $2 - local.get $3 - i32.sub - local.set $2 - local.get $2 - i32.const -4 - i32.and - local.set $2 - i32.const -1 - i32.const 255 - i32.div_u - local.get $1 - i32.const 255 - i32.and - i32.mul - local.set $4 - local.get $0 - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 4 - i32.sub - local.get $4 - i32.store - local.get $2 - i32.const 8 - i32.le_u - if - return - end - local.get $0 - i32.const 4 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 12 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 8 - i32.sub - local.get $4 - i32.store - local.get $2 - i32.const 24 - i32.le_u - if - return - end - local.get $0 - i32.const 12 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 16 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 20 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 24 - i32.add - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 28 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 24 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 20 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 16 - i32.sub - local.get $4 - i32.store - i32.const 24 - local.get $0 - i32.const 4 - i32.and - i32.add - local.set $3 - local.get $0 - local.get $3 - i32.add - local.set $0 - local.get $2 - local.get $3 - i32.sub - local.set $2 - local.get $4 - i64.extend_i32_u - local.get $4 - i64.extend_i32_u - i64.const 32 - i64.shl - i64.or - local.set $5 - block $break|0 - loop $continue|0 - local.get $2 - i32.const 32 - i32.ge_u + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $9 + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $8 + local.get $4 + local.set $11 + local.get $9 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $9 + local.set $10 + local.get $8 + local.get $11 + i32.const 2 + i32.shl + i32.add + local.get $10 + i32.store offset=4 + end + local.get $9 + i32.eqz if - block - local.get $0 - local.get $5 - i64.store - local.get $0 - i32.const 8 - i32.add - local.get $5 - i64.store - local.get $0 - i32.const 16 - i32.add - local.get $5 - i64.store - local.get $0 - i32.const 24 - i32.add - local.get $5 - i64.store - local.get $2 - i32.const 32 - i32.sub - local.set $2 - local.get $0 - i32.const 32 - i32.add - local.set $0 - end - br $continue|0 + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store end end end ) - (func $~lib/array/Array#constructor (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/rt/tlsf/insertBlock (; 7 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) local.get $1 - i32.const 268435454 - i32.gt_u + i32.eqz if i32.const 0 - i32.const 8 - i32.const 45 - i32.const 39 - call $~lib/env/abort + i32.const 128 + i32.const 204 + i32.const 13 + call $~lib/builtins/abort unreachable end local.get $1 - i32.const 2 - i32.shl + i32.load local.set $2 local.get $2 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $3 - block (result i32) - local.get $0 - i32.eqz - if - i32.const 8 - call $~lib/memory/memory.allocate - local.set $0 - end - local.get $0 - i32.const 0 - i32.store - local.get $0 + i32.const 1 + i32.and + i32.eqz + if i32.const 0 - i32.store offset=4 - local.get $0 - end - local.get $3 - i32.store - local.get $0 - local.get $1 - i32.store offset=4 - block $~lib/memory/memory.fill|inlined.0 + i32.const 128 + i32.const 206 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 local.get $3 - i32.const 8 + i32.const 16 i32.add - local.set $4 - i32.const 0 - local.set $5 + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 + i32.const 1 + i32.and + if local.get $2 - local.set $6 - local.get $4 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end + local.get $2 + i32.const 2 + i32.and + if + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 4 + i32.sub + i32.load + end + local.set $6 local.get $6 - call $~lib/internal/memory/memset + i32.load + local.set $3 + local.get $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 227 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $6 + call $~lib/rt/tlsf/removeBlock + local.get $6 + local.get $3 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $6 + local.set $1 + end end - local.get $0 - ) - (func $~lib/array/Array.isArray<~lib/array/Array | null> (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 1 + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u if (result i32) - local.get $0 - i32.const 0 - i32.ne + local.get $8 + i32.const 1073741808 + i32.lt_u else - i32.const 1 + i32.const 0 end - ) - (func $~lib/array/Array.isArray<~lib/array/Array> (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 1 - if (result i32) - local.get $0 + i32.eqz + if i32.const 0 - i32.ne - else - i32.const 1 + i32.const 128 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable end - ) - (func $std/array/P#constructor (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 + local.get $1 + i32.const 16 + i32.add + local.get $8 + i32.add + local.get $4 + i32.eq i32.eqz if i32.const 0 - call $~lib/memory/memory.allocate - local.set $0 + i32.const 128 + i32.const 243 + i32.const 13 + call $~lib/builtins/abort + unreachable end - local.get $0 - ) - (func $~lib/array/Array.isArray (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 0 - if (result i32) - local.get $0 + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $8 + i32.const 256 + i32.lt_u + if i32.const 0 - i32.ne + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u else i32.const 0 end - ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $1 - i32.const 1073741816 - i32.gt_u + i32.eqz if i32.const 0 - i32.const 152 - i32.const 23 - i32.const 34 - call $~lib/env/abort + i32.const 128 + i32.const 259 + i32.const 13 + call $~lib/builtins/abort unreachable end - local.get $1 - i32.const 0 - i32.shl - local.set $2 - local.get $2 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $3 - block $~lib/memory/memory.fill|inlined.1 - local.get $3 - i32.const 8 - i32.add - local.set $4 - i32.const 0 - local.set $5 - local.get $2 + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $7 + local.get $9 + local.set $3 + local.get $10 local.set $6 - local.get $4 - local.get $5 + local.get $7 + local.get $3 + i32.const 4 + i32.shl local.get $6 - call $~lib/internal/memory/memset - end - block (result i32) - local.get $0 - i32.eqz - if - i32.const 12 - call $~lib/memory/memory.allocate - local.set $0 - end - local.get $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 0 - i32.store offset=8 - local.get $0 - end - local.get $3 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - local.get $2 - i32.store offset=8 - local.get $0 - ) - (func $~lib/typedarray/Uint8Array#constructor (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 - i32.eqz - if - i32.const 12 - call $~lib/memory/memory.allocate - local.set $0 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 end - local.get $0 + local.set $11 local.get $1 - call $~lib/internal/typedarray/TypedArray#constructor - local.set $0 - local.get $0 - ) - (func $~lib/array/Array.isArray<~lib/typedarray/Uint8Array> (; 15 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 0 - if (result i32) - local.get $0 - i32.const 0 - i32.ne - else - i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 end - ) - (func $~lib/array/Array.isArray (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 0 - if (result i32) + block $~lib/rt/tlsf/SETHEAD|inlined.2 local.get $0 - i32.const 0 - i32.ne - else - i32.const 0 + local.set $12 + local.get $9 + local.set $7 + local.get $10 + local.set $3 + local.get $1 + local.set $6 + local.get $12 + local.get $7 + i32.const 4 + i32.shl + local.get $3 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 end - ) - (func $~lib/array/Array.isArray<~lib/string/String> (; 17 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 0 - if (result i32) + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + block $~lib/rt/tlsf/SETSL|inlined.2 local.get $0 - i32.const 0 - i32.ne - else - i32.const 0 + local.set $13 + local.get $9 + local.set $12 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 end ) - (func $~lib/array/Array#fill (; 18 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/rt/tlsf/addMemory (; 8 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) (local $8 i32) - local.get $0 - i32.load - local.set $4 - local.get $0 - i32.load offset=4 - local.set $5 + (local $9 i32) + local.get $1 local.get $2 - i32.const 0 - i32.lt_s + i32.le_u if (result i32) - local.get $5 - local.get $2 - i32.add - local.tee $6 - i32.const 0 - local.tee $7 - local.get $6 - local.get $7 - i32.gt_s - select + local.get $1 + i32.const 15 + i32.and + i32.eqz else - local.get $2 - local.tee $6 - local.get $5 - local.tee $7 - local.get $6 - local.get $7 - i32.lt_s - select + i32.const 0 end - local.set $2 - local.get $3 - i32.const 0 - i32.lt_s if (result i32) - local.get $5 - local.get $3 - i32.add - local.tee $6 - i32.const 0 - local.tee $7 - local.get $6 - local.get $7 - i32.gt_s - select + local.get $2 + i32.const 15 + i32.and + i32.eqz else - local.get $3 - local.tee $6 - local.get $5 - local.tee $7 - local.get $6 - local.get $7 - i32.lt_s - select + i32.const 0 end - local.set $3 - local.get $2 - local.get $3 - i32.lt_s + i32.eqz if - local.get $4 - local.get $2 - i32.add - i32.const 8 - i32.add - local.set $6 - local.get $1 - local.set $7 + i32.const 0 + i32.const 128 + i32.const 385 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 local.get $3 - local.get $2 - i32.sub - local.set $8 - local.get $6 - local.get $7 - local.get $8 - call $~lib/internal/memory/memset + i32.load offset=1568 end - local.get $0 - ) - (func $~lib/array/Array#__get (; 19 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load - local.set $2 - local.get $1 - local.get $2 - i32.load + local.set $4 i32.const 0 - i32.shr_u - i32.lt_u - if (result i32) - local.get $2 - local.set $3 + local.set $5 + local.get $4 + if local.get $1 - local.set $4 - i32.const 0 - local.set $5 - local.get $3 local.get $4 - i32.const 0 - i32.shl - i32.add - local.get $5 + i32.const 16 i32.add - i32.load8_u offset=8 - else - unreachable - end - ) - (func $std/array/isArraysEqual (; 20 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - local.get $2 - i32.eqz - if - block $~lib/array/Array#get:length|inlined.0 (result i32) - local.get $0 - local.set $3 - local.get $3 - i32.load offset=4 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 395 + i32.const 15 + call $~lib/builtins/abort + unreachable end - local.set $2 - local.get $2 - block $~lib/array/Array#get:length|inlined.2 (result i32) - local.get $1 - local.set $3 - local.get $3 - i32.load offset=4 - end - i32.ne + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq if - i32.const 0 - return + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop end - local.get $0 + else local.get $1 - i32.eq + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz if - i32.const 1 - return + i32.const 0 + i32.const 128 + i32.const 407 + i32.const 4 + call $~lib/builtins/abort + unreachable end end - block $break|0 + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if i32.const 0 - local.set $3 - loop $repeat|0 - local.get $3 - local.get $2 - i32.lt_s - i32.eqz - br_if $break|0 - local.get $0 - local.get $3 - call $~lib/array/Array#__get - i32.const 255 - i32.and - local.get $1 - local.get $3 - call $~lib/array/Array#__get - i32.const 255 - i32.and - i32.ne - if - i32.const 0 - return - end - local.get $3 - i32.const 1 - i32.add - local.set $3 - br $repeat|0 - unreachable - end - unreachable + return end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 i32.const 1 - ) - (func $~lib/array/Array#fill|trampoline (; 21 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - block $2of2 - block $1of2 - block $0of2 - block $outOfRange - global.get $~lib/argc - i32.const 1 - i32.sub - br_table $0of2 $1of2 $2of2 $outOfRange - end - unreachable - end - i32.const 0 - local.set $2 - end - global.get $~lib/builtins/i32.MAX_VALUE + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 end local.get $0 - local.get $1 - local.get $2 - local.get $3 - call $~lib/array/Array#fill + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 ) - (func $~lib/array/Array#fill (; 22 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/rt/tlsf/initializeRoot (; 9 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) (local $8 i32) (local $9 i32) + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + memory.size + local.set $1 local.get $0 - i32.load - local.set $4 - local.get $0 - i32.load offset=4 - local.set $5 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $2 local.get $2 - i32.const 0 - i32.lt_s + local.get $1 + i32.gt_s if (result i32) - local.get $5 local.get $2 - i32.add - local.tee $6 + local.get $1 + i32.sub + memory.grow i32.const 0 - local.tee $7 - local.get $6 - local.get $7 - i32.gt_s - select - else - local.get $2 - local.tee $6 - local.get $5 - local.tee $7 - local.get $6 - local.get $7 i32.lt_s - select + else + i32.const 0 end - local.set $2 + if + unreachable + end + local.get $0 + local.set $3 local.get $3 i32.const 0 - i32.lt_s - if (result i32) - local.get $5 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 local.get $3 - i32.add - local.tee $6 + local.set $5 i32.const 0 - local.tee $7 - local.get $6 - local.get $7 - i32.gt_s - select - else - local.get $3 - local.tee $6 + local.set $4 local.get $5 - local.tee $7 - local.get $6 - local.get $7 - i32.lt_s - select + local.get $4 + i32.store offset=1568 end - local.set $3 block $break|0 + i32.const 0 + local.set $5 loop $repeat|0 - local.get $2 - local.get $3 - i32.lt_s + local.get $5 + i32.const 23 + i32.lt_u i32.eqz br_if $break|0 - block $~lib/internal/arraybuffer/STORE|inlined.0 - local.get $4 - local.set $6 - local.get $2 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $3 local.set $7 - local.get $1 - local.set $8 + local.get $5 + local.set $6 i32.const 0 - local.set $9 - local.get $6 + local.set $4 local.get $7 + local.get $6 i32.const 2 i32.shl i32.add - local.get $9 - i32.add - local.get $8 - i32.store offset=8 + local.get $4 + i32.store offset=4 end - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $repeat|0 - unreachable - end - unreachable - end - local.get $0 - ) - (func $~lib/array/Array#__get (; 23 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load - local.set $2 - local.get $1 - local.get $2 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $2 - local.set $3 - local.get $1 - local.set $4 - i32.const 0 - local.set $5 - local.get $3 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $5 - i32.add - i32.load offset=8 - else - unreachable - end - ) - (func $std/array/isArraysEqual (; 24 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - local.get $2 - i32.eqz - if - block $~lib/array/Array#get:length|inlined.0 (result i32) - local.get $0 - local.set $3 - local.get $3 - i32.load offset=4 - end - local.set $2 - local.get $2 - block $~lib/array/Array#get:length|inlined.2 (result i32) - local.get $1 - local.set $3 - local.get $3 - i32.load offset=4 - end - i32.ne - if - i32.const 0 - return - end - local.get $0 - local.get $1 - i32.eq - if - i32.const 1 - return - end - end - block $break|0 - i32.const 0 - local.set $3 - loop $repeat|0 - local.get $3 - local.get $2 - i32.lt_s - i32.eqz - br_if $break|0 - local.get $0 - local.get $3 - call $~lib/array/Array#__get - local.get $1 - local.get $3 - call $~lib/array/Array#__get - i32.ne - if + block $break|1 i32.const 0 - return + local.set $7 + loop $repeat|1 + local.get $7 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $3 + local.set $9 + local.get $5 + local.set $8 + local.get $7 + local.set $6 + i32.const 0 + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store offset=96 + end + local.get $7 + i32.const 1 + i32.add + local.set $7 + br $repeat|1 + unreachable + end + unreachable end - local.get $3 + local.get $5 i32.const 1 i32.add - local.set $3 + local.set $5 br $repeat|0 unreachable end unreachable end - i32.const 1 - ) - (func $~lib/array/Array#fill|trampoline (; 25 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - block $2of2 - block $1of2 - block $0of2 - block $outOfRange - global.get $~lib/argc - i32.const 1 - i32.sub - br_table $0of2 $1of2 $2of2 $outOfRange - end - unreachable - end - i32.const 0 - local.set $2 - end - global.get $~lib/builtins/i32.MAX_VALUE - local.set $3 - end + local.get $3 local.get $0 - local.get $1 - local.get $2 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop local.get $3 - call $~lib/array/Array#fill + global.set $~lib/rt/tlsf/ROOT ) - (func $std/array/internalCapacity (; 26 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/rt/tlsf/prepareSize (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) + (local $2 i32) local.get $0 - i32.load - local.set $1 + i32.const 1073741808 + i32.ge_u + if + i32.const 176 + i32.const 128 + i32.const 447 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 local.get $1 - i32.load - i32.const 2 - i32.shr_s + local.get $2 + i32.gt_u + select ) - (func $~lib/internal/memory/memcpy (; 27 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/searchBlock (; 11 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - block $break|0 - loop $continue|0 - local.get $2 - if (result i32) - local.get $1 - i32.const 3 - i32.and - else - local.get $2 - end - if - block - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - end - br $continue|0 - end + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 end - local.get $0 - i32.const 3 - i32.and - i32.const 0 - i32.eq + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz if - block $break|1 - loop $continue|1 - local.get $2 - i32.const 16 - i32.ge_u - if - block - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $1 - i32.const 4 - i32.add - i32.load - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $1 - i32.const 8 - i32.add - i32.load - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 12 - i32.add - i32.load - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - end - br $continue|1 - end - end - end - local.get $2 - i32.const 8 - i32.and - if - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $1 - i32.const 4 - i32.add - i32.load - i32.store - local.get $0 - i32.const 8 - i32.add - local.set $0 - local.get $1 - i32.const 8 - i32.add - local.set $1 - end - local.get $2 - i32.const 4 - i32.and - if - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.set $0 - local.get $1 - i32.const 4 - i32.add - local.set $1 - end + i32.const 0 + i32.const 128 + i32.const 337 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 local.get $2 + local.set $4 + local.get $5 + local.get $4 i32.const 2 - i32.and - if - local.get $0 - local.get $1 - i32.load16_u - i32.store16 - local.get $0 - i32.const 2 - i32.add - local.set $0 - local.get $1 - i32.const 2 - i32.add - local.set $1 - end + i32.shl + i32.add + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + i32.const 0 + local.set $7 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor local.get $2 i32.const 1 + i32.add + i32.shl i32.and + local.set $5 + local.get $5 + i32.eqz if - block (result i32) + i32.const 0 + local.set $7 + else + local.get $5 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) local.get $0 - local.tee $5 - i32.const 1 + local.set $8 + local.get $2 + local.set $4 + local.get $8 + local.get $4 + i32.const 2 + i32.shl i32.add - local.set $0 - local.get $5 + i32.load offset=4 end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 350 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 i32.add - local.set $1 - local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load offset=96 end - i32.load8_u - i32.store8 + local.set $7 end - return + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 12 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + memory.size + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 local.get $2 - i32.const 32 - i32.ge_u + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + memory.grow + i32.const 0 + i32.lt_s if - block $break|2 - block $case2|2 - block $case1|2 - block $case0|2 - local.get $0 - i32.const 3 - i32.and - local.set $5 - local.get $5 - i32.const 1 - i32.eq - br_if $case0|2 - local.get $5 - i32.const 2 - i32.eq - br_if $case1|2 - local.get $5 - i32.const 3 - i32.eq - br_if $case2|2 - br $break|2 - end - block - local.get $1 - i32.load - local.set $3 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - local.get $2 - i32.const 3 - i32.sub - local.set $2 - block $break|3 - loop $continue|3 - local.get $2 - i32.const 17 - i32.ge_u - if - block - local.get $1 - i32.const 1 - i32.add - i32.load - local.set $4 - local.get $0 - local.get $3 - i32.const 24 - i32.shr_u - local.get $4 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 5 - i32.add - i32.load - local.set $3 - local.get $0 - i32.const 4 - i32.add - local.get $4 - i32.const 24 - i32.shr_u - local.get $3 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 9 - i32.add - i32.load - local.set $4 - local.get $0 - i32.const 8 - i32.add - local.get $3 - i32.const 24 - i32.shr_u - local.get $4 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 13 - i32.add - i32.load - local.set $3 - local.get $0 - i32.const 12 - i32.add - local.get $4 - i32.const 24 - i32.shr_u - local.get $3 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - end - br $continue|3 - end - end - end - br $break|2 - unreachable - end - unreachable - end - block - local.get $1 - i32.load - local.set $3 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - local.get $2 - i32.const 2 - i32.sub - local.set $2 - block $break|4 - loop $continue|4 - local.get $2 - i32.const 18 - i32.ge_u - if - block - local.get $1 - i32.const 2 - i32.add - i32.load - local.set $4 - local.get $0 - local.get $3 - i32.const 16 - i32.shr_u - local.get $4 - i32.const 16 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 6 - i32.add - i32.load - local.set $3 - local.get $0 - i32.const 4 - i32.add - local.get $4 - i32.const 16 - i32.shr_u - local.get $3 - i32.const 16 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 10 - i32.add - i32.load - local.set $4 - local.get $0 - i32.const 8 - i32.add - local.get $3 - i32.const 16 - i32.shr_u - local.get $4 - i32.const 16 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 14 - i32.add - i32.load - local.set $3 - local.get $0 - i32.const 12 - i32.add - local.get $4 - i32.const 16 - i32.shr_u - local.get $3 - i32.const 16 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - end - br $continue|4 - end - end - end - br $break|2 - unreachable - end - unreachable - end - block - local.get $1 - i32.load - local.set $3 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - block $break|5 - loop $continue|5 - local.get $2 - i32.const 19 - i32.ge_u - if - block - local.get $1 - i32.const 3 - i32.add - i32.load - local.set $4 - local.get $0 - local.get $3 - i32.const 8 - i32.shr_u - local.get $4 - i32.const 24 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 7 - i32.add - i32.load - local.set $3 - local.get $0 - i32.const 4 - i32.add - local.get $4 - i32.const 8 - i32.shr_u - local.get $3 - i32.const 24 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 11 - i32.add - i32.load - local.set $4 - local.get $0 - i32.const 8 - i32.add - local.get $3 - i32.const 8 - i32.shr_u - local.get $4 - i32.const 24 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 15 - i32.add - i32.load - local.set $3 - local.get $0 - i32.const 12 - i32.add - local.get $4 - i32.const 8 - i32.shr_u - local.get $3 - i32.const 24 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - end - br $continue|5 - end - end - end - br $break|2 - unreachable - end - unreachable - end - end - local.get $2 - i32.const 16 - i32.and - if - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - end - local.get $2 - i32.const 8 - i32.and - if - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - end - local.get $2 - i32.const 4 - i32.and - if - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - end - local.get $2 - i32.const 2 - i32.and - if - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - end - local.get $2 - i32.const 1 - i32.and - if - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - end - ) - (func $~lib/internal/memory/memmove (; 28 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - local.get $0 - local.get $1 - i32.eq - if - return - end - local.get $1 - local.get $2 - i32.add - local.get $0 - i32.le_u - local.tee $3 - if (result i32) - local.get $3 - else - local.get $0 - local.get $2 - i32.add - local.get $1 - i32.le_u - end - if - local.get $0 - local.get $1 - local.get $2 - call $~lib/internal/memory/memcpy - return - end - local.get $0 - local.get $1 - i32.lt_u - if - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and - i32.eq - if - block $break|0 - loop $continue|0 - local.get $0 - i32.const 7 - i32.and - if - block - local.get $2 - i32.eqz - if - return - end - local.get $2 - i32.const 1 - i32.sub - local.set $2 - block (result i32) - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $3 - end - block (result i32) - local.get $1 - local.tee $3 - i32.const 1 - i32.add - local.set $1 - local.get $3 - end - i32.load8_u - i32.store8 - end - br $continue|0 - end - end - end - block $break|1 - loop $continue|1 - local.get $2 - i32.const 8 - i32.ge_u - if - block - local.get $0 - local.get $1 - i64.load - i64.store - local.get $2 - i32.const 8 - i32.sub - local.set $2 - local.get $0 - i32.const 8 - i32.add - local.set $0 - local.get $1 - i32.const 8 - i32.add - local.set $1 - end - br $continue|1 - end - end - end - end - block $break|2 - loop $continue|2 - local.get $2 - if - block - block (result i32) - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $3 - end - block (result i32) - local.get $1 - local.tee $3 - i32.const 1 - i32.add - local.set $1 - local.get $3 - end - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - end - br $continue|2 - end - end - end - else - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and - i32.eq - if - block $break|3 - loop $continue|3 - local.get $0 - local.get $2 - i32.add - i32.const 7 - i32.and - if - block - local.get $2 - i32.eqz - if - return - end - local.get $0 - local.get $2 - i32.const 1 - i32.sub - local.tee $2 - i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 - end - br $continue|3 - end - end - end - block $break|4 - loop $continue|4 - local.get $2 - i32.const 8 - i32.ge_u - if - block - local.get $2 - i32.const 8 - i32.sub - local.set $2 - local.get $0 - local.get $2 - i32.add - local.get $1 - local.get $2 - i32.add - i64.load - i64.store - end - br $continue|4 - end - end - end - end - block $break|5 - loop $continue|5 - local.get $2 - if - local.get $0 - local.get $2 - i32.const 1 - i32.sub - local.tee $2 - i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 - br $continue|5 - end - end - end - end - ) - (func $~lib/allocator/arena/__memory_free (; 29 ;) (type $FUNCSIG$vi) (param $0 i32) - nop - ) - (func $~lib/internal/arraybuffer/reallocateUnsafe (; 30 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $0 - i32.load - local.set $2 - local.get $1 - local.get $2 - i32.gt_s - if - local.get $1 - i32.const 1073741816 - i32.le_s - i32.eqz - if - i32.const 0 - i32.const 40 - i32.const 40 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $1 - local.get $2 - call $~lib/internal/arraybuffer/computeSize - i32.const 8 - i32.sub - i32.le_s - if - local.get $0 - local.get $1 - i32.store - else - local.get $1 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $3 - block $~lib/memory/memory.copy|inlined.0 - local.get $3 - i32.const 8 - i32.add - local.set $4 - local.get $0 - i32.const 8 - i32.add - local.set $5 - local.get $2 - local.set $6 - local.get $4 - local.get $5 - local.get $6 - call $~lib/internal/memory/memmove - end - block $~lib/memory/memory.free|inlined.0 - local.get $0 - local.set $6 - local.get $6 - call $~lib/allocator/arena/__memory_free - br $~lib/memory/memory.free|inlined.0 - end - local.get $3 - local.set $0 - end - block $~lib/memory/memory.fill|inlined.3 - local.get $0 - i32.const 8 - i32.add - local.get $2 - i32.add - local.set $3 - i32.const 0 - local.set $6 - local.get $1 - local.get $2 - i32.sub - local.set $5 - local.get $3 - local.get $6 - local.get $5 - call $~lib/internal/memory/memset - end - else - local.get $1 - local.get $2 - i32.lt_s - if - local.get $1 - i32.const 0 - i32.ge_s - i32.eqz - if - i32.const 0 - i32.const 40 - i32.const 62 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.store - end - end - local.get $0 - ) - (func $~lib/array/Array#push (; 31 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - local.get $0 - i32.load offset=4 - local.set $2 - local.get $0 - i32.load - local.set $3 - local.get $3 - i32.load - i32.const 2 - i32.shr_u - local.set $4 - local.get $2 - i32.const 1 - i32.add - local.set $5 - local.get $2 - local.get $4 - i32.ge_u - if - local.get $2 - i32.const 268435454 - i32.ge_u - if - i32.const 0 - i32.const 8 - i32.const 182 - i32.const 42 - call $~lib/env/abort - unreachable - end - local.get $3 - local.get $5 - i32.const 2 - i32.shl - call $~lib/internal/arraybuffer/reallocateUnsafe - local.set $3 - local.get $0 - local.get $3 - i32.store - end - local.get $0 - local.get $5 - i32.store offset=4 - block $~lib/internal/arraybuffer/STORE|inlined.0 - local.get $3 - local.set $6 - local.get $2 - local.set $7 - local.get $1 - local.set $8 - i32.const 0 - local.set $9 - local.get $6 - local.get $7 - i32.const 2 - i32.shl - i32.add - local.get $9 - i32.add - local.get $8 - i32.store offset=8 - end - local.get $5 - ) - (func $~lib/array/Array#__get (; 32 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load - local.set $2 - local.get $1 - local.get $2 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $2 - local.set $3 - local.get $1 - local.set $4 - i32.const 0 - local.set $5 - local.get $3 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $5 - i32.add - i32.load offset=8 - else - unreachable - end - ) - (func $~lib/array/Array#pop (; 33 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load offset=4 - local.set $1 - local.get $1 - i32.const 1 - i32.lt_s - if - i32.const 0 - i32.const 8 - i32.const 244 - i32.const 20 - call $~lib/env/abort - unreachable - end - block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i32) - local.get $0 - i32.load - local.set $2 - local.get $1 - i32.const 1 - i32.sub - local.tee $1 - local.set $3 - i32.const 0 - local.set $4 - local.get $2 - local.get $3 - i32.const 2 - i32.shl - i32.add - local.get $4 - i32.add - i32.load offset=8 - end - local.set $5 - local.get $0 - local.get $1 - i32.store offset=4 - local.get $5 - ) - (func $~lib/array/Array#concat (; 34 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - local.get $0 - i32.load offset=4 - local.set $2 - i32.const 0 - local.get $1 - i32.load offset=4 - local.get $1 - i32.const 0 - i32.eq - select - local.set $3 - local.get $2 - local.get $3 - i32.add - local.set $4 - i32.const 0 - local.get $4 - call $~lib/array/Array#constructor - local.set $5 - local.get $2 - if - local.get $5 - i32.load - i32.const 8 - i32.add - local.set $6 - local.get $0 - i32.load - i32.const 8 - i32.add - local.set $7 - local.get $2 - i32.const 2 - i32.shl - local.set $8 - local.get $6 - local.get $7 - local.get $8 - call $~lib/internal/memory/memmove - end - local.get $3 - if - local.get $5 - i32.load - i32.const 8 - i32.add - local.get $2 - i32.const 2 - i32.shl - i32.add - local.set $8 - local.get $1 - i32.load - i32.const 8 - i32.add - local.set $7 - local.get $3 - i32.const 2 - i32.shl - local.set $6 - local.get $8 - local.get $7 - local.get $6 - call $~lib/internal/memory/memmove - end - local.get $5 - ) - (func $~lib/array/Array#copyWithin (; 35 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - local.get $0 - i32.load - local.set $4 - local.get $0 - i32.load offset=4 - local.set $5 - local.get $3 - local.tee $6 - local.get $5 - local.tee $7 - local.get $6 - local.get $7 - i32.lt_s - select - local.set $3 - local.get $1 - i32.const 0 - i32.lt_s - if (result i32) - local.get $5 - local.get $1 - i32.add - local.tee $6 - i32.const 0 - local.tee $7 - local.get $6 - local.get $7 - i32.gt_s - select - else - local.get $1 - local.tee $6 - local.get $5 - local.tee $7 - local.get $6 - local.get $7 - i32.lt_s - select - end - local.set $8 - local.get $2 - i32.const 0 - i32.lt_s - if (result i32) - local.get $5 - local.get $2 - i32.add - local.tee $6 - i32.const 0 - local.tee $7 - local.get $6 - local.get $7 - i32.gt_s - select - else - local.get $2 - local.tee $6 - local.get $5 - local.tee $7 - local.get $6 - local.get $7 - i32.lt_s - select - end - local.set $9 - local.get $3 - i32.const 0 - i32.lt_s - if (result i32) - local.get $5 - local.get $3 - i32.add - local.tee $6 - i32.const 0 - local.tee $7 - local.get $6 - local.get $7 - i32.gt_s - select - else - local.get $3 - local.tee $6 - local.get $5 - local.tee $7 - local.get $6 - local.get $7 - i32.lt_s - select - end - local.set $10 - local.get $10 - local.get $9 - i32.sub - local.tee $6 - local.get $5 - local.get $8 - i32.sub - local.tee $7 - local.get $6 - local.get $7 - i32.lt_s - select - local.set $11 - local.get $9 - local.get $8 - i32.lt_s - local.tee $6 - if (result i32) - local.get $8 - local.get $9 - local.get $11 - i32.add - i32.lt_s - else - local.get $6 - end - if - local.get $9 - local.get $11 - i32.const 1 - i32.sub - i32.add - local.set $9 - local.get $8 - local.get $11 - i32.const 1 - i32.sub - i32.add - local.set $8 - block $break|0 - loop $continue|0 - local.get $11 - if - block - block $~lib/internal/arraybuffer/STORE|inlined.1 - local.get $4 - local.set $6 - local.get $8 - local.set $7 - block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i32) - local.get $4 - local.set $12 - local.get $9 - local.set $13 - i32.const 0 - local.set $14 - local.get $12 - local.get $13 - i32.const 2 - i32.shl - i32.add - local.get $14 - i32.add - i32.load offset=8 - end - local.set $14 - i32.const 0 - local.set $13 - local.get $6 - local.get $7 - i32.const 2 - i32.shl - i32.add - local.get $13 - i32.add - local.get $14 - i32.store offset=8 - end - local.get $9 - i32.const 1 - i32.sub - local.set $9 - local.get $8 - i32.const 1 - i32.sub - local.set $8 - local.get $11 - i32.const 1 - i32.sub - local.set $11 - end - br $continue|0 - end - end - end - else - local.get $4 - i32.const 8 - i32.add - local.get $8 - i32.const 2 - i32.shl - i32.add - local.set $13 - local.get $4 - i32.const 8 - i32.add - local.get $9 - i32.const 2 - i32.shl - i32.add - local.set $14 - local.get $11 - i32.const 2 - i32.shl - local.set $7 - local.get $13 - local.get $14 - local.get $7 - call $~lib/internal/memory/memmove - end - local.get $0 - ) - (func $~lib/array/Array#copyWithin|trampoline (; 36 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - block $1of1 - block $0of1 - block $outOfRange - global.get $~lib/argc - i32.const 2 - i32.sub - br_table $0of1 $1of1 $outOfRange - end - unreachable - end - global.get $~lib/builtins/i32.MAX_VALUE - local.set $3 - end - local.get $0 - local.get $1 - local.get $2 - local.get $3 - call $~lib/array/Array#copyWithin - ) - (func $std/array/isArraysEqual (; 37 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - local.get $2 - i32.eqz - if - block $~lib/array/Array#get:length|inlined.15 (result i32) - local.get $0 - local.set $3 - local.get $3 - i32.load offset=4 - end - local.set $2 - local.get $2 - block $~lib/array/Array#get:length|inlined.17 (result i32) - local.get $1 - local.set $3 - local.get $3 - i32.load offset=4 - end - i32.ne - if - i32.const 0 - return - end - local.get $0 - local.get $1 - i32.eq - if - i32.const 1 - return - end - end - block $break|0 - i32.const 0 - local.set $3 - loop $repeat|0 - local.get $3 - local.get $2 - i32.lt_s - i32.eqz - br_if $break|0 - local.get $0 - local.get $3 - call $~lib/array/Array#__get - local.get $1 - local.get $3 - call $~lib/array/Array#__get - i32.ne - if - i32.const 0 - return - end - local.get $3 - i32.const 1 - i32.add - local.set $3 - br $repeat|0 - unreachable - end - unreachable - end - i32.const 1 - ) - (func $~lib/array/Array#unshift (; 38 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - local.get $0 - i32.load - local.set $2 - local.get $2 - i32.load - i32.const 2 - i32.shr_u - local.set $3 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $4 - i32.const 1 - i32.add - local.set $5 - local.get $4 - local.get $3 - i32.ge_u - if - local.get $4 - i32.const 268435454 - i32.ge_u - if - i32.const 0 - i32.const 8 - i32.const 327 - i32.const 42 - call $~lib/env/abort - unreachable - end - local.get $2 - local.get $5 - i32.const 2 - i32.shl - call $~lib/internal/arraybuffer/reallocateUnsafe - local.set $2 - local.get $2 - i32.load - i32.const 2 - i32.shr_u - local.set $3 - local.get $0 - local.get $2 - i32.store - end - block $~lib/memory/memory.copy|inlined.4 - local.get $2 - i32.const 8 - i32.add - i32.const 4 - i32.add - local.set $6 - local.get $2 - i32.const 8 - i32.add - local.set $7 - local.get $3 - i32.const 1 - i32.sub - i32.const 2 - i32.shl - local.set $8 - local.get $6 - local.get $7 - local.get $8 - call $~lib/internal/memory/memmove - end - block $~lib/internal/arraybuffer/STORE|inlined.2 - local.get $2 - local.set $8 - i32.const 0 - local.set $7 - local.get $1 - local.set $6 - i32.const 0 - local.set $9 - local.get $8 - local.get $7 - i32.const 2 - i32.shl - i32.add - local.get $9 - i32.add - local.get $6 - i32.store offset=8 - end - local.get $0 - local.get $5 - i32.store offset=4 - local.get $5 - ) - (func $~lib/array/Array#shift (; 39 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - local.get $0 - i32.load offset=4 - local.set $1 - local.get $1 - i32.const 1 - i32.lt_s - if - i32.const 0 - i32.const 8 - i32.const 299 - i32.const 20 - call $~lib/env/abort - unreachable - end - local.get $0 - i32.load - local.set $2 - block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i32) - local.get $2 - local.set $3 - i32.const 0 - local.set $4 - i32.const 0 - local.set $5 - local.get $3 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $5 - i32.add - i32.load offset=8 - end - local.set $6 - local.get $1 - i32.const 1 - i32.sub - local.set $7 - block $~lib/memory/memory.copy|inlined.5 - local.get $2 - i32.const 8 - i32.add - local.set $5 - local.get $2 - i32.const 8 - i32.add - i32.const 4 - i32.add - local.set $4 - local.get $7 - i32.const 2 - i32.shl - local.set $3 - local.get $5 - local.get $4 - local.get $3 - call $~lib/internal/memory/memmove - end - block $~lib/internal/arraybuffer/STORE|inlined.3 - local.get $2 - local.set $3 - local.get $7 - local.set $4 - i32.const 0 - local.set $5 - i32.const 0 - local.set $8 - local.get $3 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.add - local.get $5 - i32.store offset=8 - end - local.get $0 - local.get $7 - i32.store offset=4 - local.get $6 - ) - (func $~lib/array/Array#reverse (; 40 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - local.get $0 - i32.load - local.set $1 - block $break|0 - block - i32.const 0 - local.set $2 - local.get $0 - i32.load offset=4 - i32.const 1 - i32.sub - local.set $3 - end - loop $repeat|0 - local.get $2 - local.get $3 - i32.lt_s - i32.eqz - br_if $break|0 - block - block $~lib/internal/arraybuffer/LOAD|inlined.4 (result i32) - local.get $1 - local.set $4 - local.get $2 - local.set $5 - i32.const 0 - local.set $6 - local.get $4 - local.get $5 - i32.const 2 - i32.shl - i32.add - local.get $6 - i32.add - i32.load offset=8 - end - local.set $6 - block $~lib/internal/arraybuffer/STORE|inlined.4 - local.get $1 - local.set $5 - local.get $2 - local.set $4 - block $~lib/internal/arraybuffer/LOAD|inlined.5 (result i32) - local.get $1 - local.set $7 - local.get $3 - local.set $8 - i32.const 0 - local.set $9 - local.get $7 - local.get $8 - i32.const 2 - i32.shl - i32.add - local.get $9 - i32.add - i32.load offset=8 - end - local.set $9 - i32.const 0 - local.set $8 - local.get $5 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.add - local.get $9 - i32.store offset=8 - end - block $~lib/internal/arraybuffer/STORE|inlined.5 - local.get $1 - local.set $8 - local.get $3 - local.set $9 - local.get $6 - local.set $4 - i32.const 0 - local.set $5 - local.get $8 - local.get $9 - i32.const 2 - i32.shl - i32.add - local.get $5 - i32.add - local.get $4 - i32.store offset=8 - end - end - block - local.get $2 - i32.const 1 - i32.add - local.set $2 - local.get $3 - i32.const 1 - i32.sub - local.set $3 - end - br $repeat|0 - unreachable - end - unreachable - end - local.get $0 - ) - (func $~lib/array/Array#indexOf (; 41 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - local.get $0 - i32.load offset=4 - local.set $3 - local.get $3 - i32.const 0 - i32.eq - local.tee $4 - if (result i32) - local.get $4 - else - local.get $2 - local.get $3 - i32.ge_s - end - if - i32.const -1 - return - end - local.get $2 - i32.const 0 - i32.lt_s - if - local.get $3 - local.get $2 - i32.add - local.tee $4 - i32.const 0 - local.tee $5 - local.get $4 - local.get $5 - i32.gt_s - select - local.set $2 - end - local.get $0 - i32.load - local.set $6 - block $break|0 - loop $continue|0 - local.get $2 - local.get $3 - i32.lt_s - if - block - block $~lib/internal/arraybuffer/LOAD|inlined.7 (result i32) - local.get $6 - local.set $7 - local.get $2 - local.set $5 - i32.const 0 - local.set $4 - local.get $7 - local.get $5 - i32.const 2 - i32.shl - i32.add - local.get $4 - i32.add - i32.load offset=8 - end - local.get $1 - i32.eq - if - local.get $2 - return - end - local.get $2 - i32.const 1 - i32.add - local.set $2 - end - br $continue|0 - end - end - end - i32.const -1 - ) - (func $~lib/array/Array#splice (; 42 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - local.get $0 - i32.load offset=4 - local.set $3 - local.get $1 - i32.const 0 - i32.lt_s - if (result i32) - local.get $3 - local.get $1 - i32.add - local.tee $4 - i32.const 0 - local.tee $5 - local.get $4 - local.get $5 - i32.gt_s - select - else - local.get $1 - local.tee $4 - local.get $3 - local.tee $5 - local.get $4 - local.get $5 - i32.lt_s - select - end - local.set $1 - local.get $2 - local.tee $4 - local.get $3 - local.get $1 - i32.sub - local.tee $5 - local.get $4 - local.get $5 - i32.lt_s - select - local.tee $4 - i32.const 0 - local.tee $5 - local.get $4 - local.get $5 - i32.gt_s - select - local.set $2 - local.get $0 - i32.load - local.set $6 - i32.const 0 - local.get $2 - call $~lib/array/Array#constructor - local.set $7 - local.get $6 - i32.const 8 - i32.add - local.get $1 - i32.const 2 - i32.shl - i32.add - local.set $8 - block $~lib/memory/memory.copy|inlined.6 - local.get $7 - i32.load - i32.const 8 - i32.add - local.set $4 - local.get $8 - local.set $5 - local.get $2 - i32.const 2 - i32.shl - local.set $9 - local.get $4 - local.get $5 - local.get $9 - call $~lib/internal/memory/memmove - end - local.get $1 - local.get $2 - i32.add - local.set $10 - local.get $3 - local.get $10 - i32.ne - if - local.get $8 - local.set $9 - local.get $6 - i32.const 8 - i32.add - local.get $10 - i32.const 2 - i32.shl - i32.add - local.set $5 - local.get $3 - local.get $10 - i32.sub - i32.const 2 - i32.shl - local.set $4 - local.get $9 - local.get $5 - local.get $4 - call $~lib/internal/memory/memmove - end - local.get $0 - local.get $3 - local.get $2 - i32.sub - i32.store offset=4 - local.get $7 - ) - (func $~lib/array/Array#splice|trampoline (; 43 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - block $1of1 - block $0of1 - block $outOfRange - global.get $~lib/argc - i32.const 1 - i32.sub - br_table $0of1 $1of1 $outOfRange - end - unreachable - end - global.get $~lib/builtins/i32.MAX_VALUE - local.set $2 - end - local.get $0 - local.get $1 - local.get $2 - call $~lib/array/Array#splice - ) - (func $~lib/array/Array#__set (; 44 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - local.get $0 - i32.load - local.set $3 - local.get $3 - i32.load - i32.const 2 - i32.shr_u - local.set $4 - local.get $1 - local.get $4 - i32.ge_u - if - local.get $1 - i32.const 268435454 - i32.ge_u - if - i32.const 0 - i32.const 8 - i32.const 107 - i32.const 41 - call $~lib/env/abort - unreachable - end - local.get $3 - local.get $1 - i32.const 1 - i32.add - i32.const 2 - i32.shl - call $~lib/internal/arraybuffer/reallocateUnsafe - local.set $3 - local.get $0 - local.get $3 - i32.store - local.get $0 - local.get $1 - i32.const 1 - i32.add - i32.store offset=4 - end - block $~lib/internal/arraybuffer/STORE|inlined.6 - local.get $3 - local.set $5 - local.get $1 - local.set $6 - local.get $2 - local.set $7 - i32.const 0 - local.set $8 - local.get $5 - local.get $6 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.add - local.get $7 - i32.store offset=8 - end - ) - (func $start:std/array~anonymous|0 (; 45 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $0 - i32.const 0 - i32.eq - ) - (func $~lib/array/Array#findIndex (; 46 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - block $break|0 - block - i32.const 0 - local.set $2 - local.get $0 - i32.load offset=4 - local.set $3 - end - loop $repeat|0 - local.get $2 - local.get $3 - local.tee $4 - local.get $0 - i32.load offset=4 - local.tee $5 - local.get $4 - local.get $5 - i32.lt_s - select - i32.lt_s - i32.eqz - br_if $break|0 - block (result i32) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.9 (result i32) - local.get $0 - i32.load - local.set $6 - local.get $2 - local.set $5 - i32.const 0 - local.set $4 - local.get $6 - local.get $5 - i32.const 2 - i32.shl - i32.add - local.get $4 - i32.add - i32.load offset=8 - end - local.get $2 - local.get $0 - local.get $1 - call_indirect (type $FUNCSIG$iiii) - end - i32.const 0 - i32.ne - if - local.get $2 - return - end - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $repeat|0 - unreachable - end - unreachable - end - i32.const -1 - ) - (func $start:std/array~anonymous|1 (; 47 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $0 - i32.const 1 - i32.eq - ) - (func $start:std/array~anonymous|2 (; 48 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $0 - i32.const 100 - i32.eq - ) - (func $start:std/array~anonymous|3 (; 49 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $2 - i32.const 100 - call $~lib/array/Array#push - drop - local.get $0 - i32.const 100 - i32.eq - ) - (func $start:std/array~anonymous|4 (; 50 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $0 - i32.const 100 - i32.eq - ) - (func $start:std/array~anonymous|5 (; 51 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $2 - call $~lib/array/Array#pop - drop - local.get $0 - i32.const 100 - i32.eq - ) - (func $start:std/array~anonymous|6 (; 52 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $0 - i32.const 0 - i32.ge_s - ) - (func $~lib/array/Array#every (; 53 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - block $break|0 - block - i32.const 0 - local.set $2 - local.get $0 - i32.load offset=4 - local.set $3 - end - loop $repeat|0 - local.get $2 - local.get $3 - local.tee $4 - local.get $0 - i32.load offset=4 - local.tee $5 - local.get $4 - local.get $5 - i32.lt_s - select - i32.lt_s - i32.eqz - br_if $break|0 - block (result i32) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.11 (result i32) - local.get $0 - i32.load - local.set $6 - local.get $2 - local.set $5 - i32.const 0 - local.set $4 - local.get $6 - local.get $5 - i32.const 2 - i32.shl - i32.add - local.get $4 - i32.add - i32.load offset=8 - end - local.get $2 - local.get $0 - local.get $1 - call_indirect (type $FUNCSIG$iiii) - end - i32.const 0 - i32.ne - i32.eqz - if - i32.const 0 - return - end - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $repeat|0 - unreachable - end - unreachable - end - i32.const 1 - ) - (func $start:std/array~anonymous|7 (; 54 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $0 - i32.const 0 - i32.le_s - ) - (func $start:std/array~anonymous|8 (; 55 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $2 - i32.const 100 - call $~lib/array/Array#push - drop - local.get $0 - i32.const 10 - i32.lt_s - ) - (func $start:std/array~anonymous|9 (; 56 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $0 - i32.const 10 - i32.lt_s - ) - (func $start:std/array~anonymous|10 (; 57 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $2 - call $~lib/array/Array#pop - drop - local.get $0 - i32.const 3 - i32.lt_s - ) - (func $start:std/array~anonymous|11 (; 58 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $0 - i32.const 3 - i32.ge_s - ) - (func $~lib/array/Array#some (; 59 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - block $break|0 - block - i32.const 0 - local.set $2 - local.get $0 - i32.load offset=4 - local.set $3 - end - loop $repeat|0 - local.get $2 - local.get $3 - local.tee $4 - local.get $0 - i32.load offset=4 - local.tee $5 - local.get $4 - local.get $5 - i32.lt_s - select - i32.lt_s - i32.eqz - br_if $break|0 - block (result i32) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.13 (result i32) - local.get $0 - i32.load - local.set $6 - local.get $2 - local.set $5 - i32.const 0 - local.set $4 - local.get $6 - local.get $5 - i32.const 2 - i32.shl - i32.add - local.get $4 - i32.add - i32.load offset=8 - end - local.get $2 - local.get $0 - local.get $1 - call_indirect (type $FUNCSIG$iiii) - end - i32.const 0 - i32.ne - if - i32.const 1 - return - end - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $repeat|0 - unreachable - end - unreachable - end - i32.const 0 - ) - (func $start:std/array~anonymous|12 (; 60 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $0 - i32.const -1 - i32.le_s - ) - (func $start:std/array~anonymous|13 (; 61 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $2 - i32.const 100 - call $~lib/array/Array#push - drop - local.get $0 - i32.const 10 - i32.gt_s - ) - (func $start:std/array~anonymous|14 (; 62 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $0 - i32.const 10 - i32.gt_s - ) - (func $start:std/array~anonymous|15 (; 63 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $2 - call $~lib/array/Array#pop - drop - local.get $0 - i32.const 3 - i32.gt_s - ) - (func $start:std/array~anonymous|16 (; 64 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - global.get $std/array/i - local.get $0 - i32.add - global.set $std/array/i - ) - (func $~lib/array/Array#forEach (; 65 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - block $break|0 - block - i32.const 0 - local.set $2 - local.get $0 - i32.load offset=4 - local.set $3 - end - loop $repeat|0 - local.get $2 - local.get $3 - local.tee $4 - local.get $0 - i32.load offset=4 - local.tee $5 - local.get $4 - local.get $5 - i32.lt_s - select - i32.lt_s - i32.eqz - br_if $break|0 - block - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.14 (result i32) - local.get $0 - i32.load - local.set $4 - local.get $2 - local.set $5 - i32.const 0 - local.set $6 - local.get $4 - local.get $5 - i32.const 2 - i32.shl - i32.add - local.get $6 - i32.add - i32.load offset=8 - end - local.get $2 - local.get $0 - local.get $1 - call_indirect (type $FUNCSIG$viii) - end - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $repeat|0 - unreachable - end - unreachable - end - ) - (func $start:std/array~anonymous|17 (; 66 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - local.get $2 - i32.const 100 - call $~lib/array/Array#push - drop - global.get $std/array/i - local.get $0 - i32.add - global.set $std/array/i - ) - (func $start:std/array~anonymous|18 (; 67 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - global.get $std/array/i - local.get $0 - i32.add - global.set $std/array/i - ) - (func $start:std/array~anonymous|19 (; 68 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - local.get $2 - call $~lib/array/Array#pop - drop - global.get $std/array/i - local.get $0 - i32.add - global.set $std/array/i - ) - (func $start:std/array~anonymous|20 (; 69 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - local.get $1 - i32.const 0 - i32.eq - if - block $break|0 - i32.const 0 - local.set $3 - loop $repeat|0 - local.get $3 - i32.const 4 - i32.lt_s - i32.eqz - br_if $break|0 - local.get $2 - call $~lib/array/Array#pop - drop - local.get $3 - i32.const 1 - i32.add - local.set $3 - br $repeat|0 - unreachable - end - unreachable - end - block $break|1 - i32.const 0 - local.set $3 - loop $repeat|1 - local.get $3 - i32.const 100 - i32.lt_s - i32.eqz - br_if $break|1 - local.get $2 - i32.const 100 - local.get $3 - i32.add - call $~lib/array/Array#push - drop - local.get $3 - i32.const 1 - i32.add - local.set $3 - br $repeat|1 - unreachable - end - unreachable - end - block $break|2 - i32.const 0 - local.set $3 - loop $repeat|2 - local.get $3 - i32.const 100 - i32.lt_s - i32.eqz - br_if $break|2 - local.get $2 - call $~lib/array/Array#pop - drop - local.get $3 - i32.const 1 - i32.add - local.set $3 - br $repeat|2 - unreachable - end - unreachable - end - block $break|3 - i32.const 0 - local.set $3 - loop $repeat|3 - local.get $3 - i32.const 100 - i32.lt_s - i32.eqz - br_if $break|3 - local.get $2 - local.get $3 - i32.const 200 - i32.add - call $~lib/array/Array#push - drop - local.get $3 - i32.const 1 - i32.add - local.set $3 - br $repeat|3 - unreachable - end - unreachable - end - end - local.get $1 - i32.const 2 - i32.eq - if - local.get $0 - i32.const 202 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 559 - i32.const 4 - call $~lib/env/abort - unreachable - end - end - ) - (func $start:std/array~anonymous|21 (; 70 ;) (type $FUNCSIG$fiii) (param $0 i32) (param $1 i32) (param $2 i32) (result f32) - local.get $0 - f32.convert_i32_s - ) - (func $~lib/array/Array#constructor (; 71 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $1 - i32.const 268435454 - i32.gt_u - if - i32.const 0 - i32.const 8 - i32.const 45 - i32.const 39 - call $~lib/env/abort - unreachable - end - local.get $1 - i32.const 2 - i32.shl - local.set $2 - local.get $2 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $3 - block (result i32) - local.get $0 - i32.eqz - if - i32.const 8 - call $~lib/memory/memory.allocate - local.set $0 - end - local.get $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - end - local.get $3 - i32.store - local.get $0 - local.get $1 - i32.store offset=4 - block $~lib/memory/memory.fill|inlined.4 - local.get $3 - i32.const 8 - i32.add - local.set $4 - i32.const 0 - local.set $5 - local.get $2 - local.set $6 - local.get $4 - local.get $5 - local.get $6 - call $~lib/internal/memory/memset - end - local.get $0 - ) - (func $~lib/array/Array#map (; 72 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 f32) - local.get $0 - i32.load offset=4 - local.set $2 - i32.const 0 - local.get $2 - call $~lib/array/Array#constructor - local.set $3 - local.get $3 - i32.load - local.set $4 - block $break|0 - i32.const 0 - local.set $5 - loop $repeat|0 - local.get $5 - local.get $2 - local.tee $6 - local.get $0 - i32.load offset=4 - local.tee $7 - local.get $6 - local.get $7 - i32.lt_s - select - i32.lt_s - i32.eqz - br_if $break|0 - block $~lib/internal/arraybuffer/STORE|inlined.0 - local.get $4 - local.set $6 - local.get $5 - local.set $7 - block (result f32) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.15 (result i32) - local.get $0 - i32.load - local.set $8 - local.get $5 - local.set $9 - i32.const 0 - local.set $10 - local.get $8 - local.get $9 - i32.const 2 - i32.shl - i32.add - local.get $10 - i32.add - i32.load offset=8 - end - local.get $5 - local.get $0 - local.get $1 - call_indirect (type $FUNCSIG$fiii) - end - local.set $11 - i32.const 0 - local.set $10 - local.get $6 - local.get $7 - i32.const 2 - i32.shl - i32.add - local.get $10 - i32.add - local.get $11 - f32.store offset=8 - end - local.get $5 - i32.const 1 - i32.add - local.set $5 - br $repeat|0 - unreachable - end - unreachable - end - local.get $3 - ) - (func $~lib/array/Array#__get (; 73 ;) (type $FUNCSIG$fii) (param $0 i32) (param $1 i32) (result f32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load - local.set $2 - local.get $1 - local.get $2 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result f32) - local.get $2 - local.set $3 - local.get $1 - local.set $4 - i32.const 0 - local.set $5 - local.get $3 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $5 - i32.add - f32.load offset=8 - else - unreachable - end - ) - (func $start:std/array~anonymous|22 (; 74 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $2 - i32.const 100 - call $~lib/array/Array#push - drop - global.get $std/array/i - local.get $0 - i32.add - global.set $std/array/i - local.get $0 - ) - (func $~lib/array/Array#map (; 75 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - local.get $0 - i32.load offset=4 - local.set $2 - i32.const 0 - local.get $2 - call $~lib/array/Array#constructor - local.set $3 - local.get $3 - i32.load - local.set $4 - block $break|0 - i32.const 0 - local.set $5 - loop $repeat|0 - local.get $5 - local.get $2 - local.tee $6 - local.get $0 - i32.load offset=4 - local.tee $7 - local.get $6 - local.get $7 - i32.lt_s - select - i32.lt_s - i32.eqz - br_if $break|0 - block $~lib/internal/arraybuffer/STORE|inlined.7 - local.get $4 - local.set $6 - local.get $5 - local.set $7 - block (result i32) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.16 (result i32) - local.get $0 - i32.load - local.set $8 - local.get $5 - local.set $9 - i32.const 0 - local.set $10 - local.get $8 - local.get $9 - i32.const 2 - i32.shl - i32.add - local.get $10 - i32.add - i32.load offset=8 - end - local.get $5 - local.get $0 - local.get $1 - call_indirect (type $FUNCSIG$iiii) - end - local.set $10 - i32.const 0 - local.set $9 - local.get $6 - local.get $7 - i32.const 2 - i32.shl - i32.add - local.get $9 - i32.add - local.get $10 - i32.store offset=8 - end - local.get $5 - i32.const 1 - i32.add - local.set $5 - br $repeat|0 - unreachable - end - unreachable - end - local.get $3 - ) - (func $start:std/array~anonymous|23 (; 76 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - global.get $std/array/i - local.get $0 - i32.add - global.set $std/array/i - local.get $0 - ) - (func $start:std/array~anonymous|24 (; 77 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $2 - call $~lib/array/Array#pop - drop - global.get $std/array/i - local.get $0 - i32.add - global.set $std/array/i - local.get $0 - ) - (func $start:std/array~anonymous|25 (; 78 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $0 - i32.const 2 - i32.ge_s - ) - (func $~lib/array/Array#filter (; 79 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - i32.const 0 - i32.const 0 - call $~lib/array/Array#constructor - local.set $2 - block $break|0 - block - i32.const 0 - local.set $3 - local.get $0 - i32.load offset=4 - local.set $4 - end - loop $repeat|0 - local.get $3 - local.get $4 - local.tee $5 - local.get $0 - i32.load offset=4 - local.tee $6 - local.get $5 - local.get $6 - i32.lt_s - select - i32.lt_s - i32.eqz - br_if $break|0 - block - block $~lib/internal/arraybuffer/LOAD|inlined.17 (result i32) - local.get $0 - i32.load - local.set $5 - local.get $3 - local.set $6 - i32.const 0 - local.set $7 - local.get $5 - local.get $6 - i32.const 2 - i32.shl - i32.add - local.get $7 - i32.add - i32.load offset=8 - end - local.set $7 - block (result i32) - i32.const 3 - global.set $~lib/argc - local.get $7 - local.get $3 - local.get $0 - local.get $1 - call_indirect (type $FUNCSIG$iiii) - end - i32.const 0 - i32.ne - if - local.get $2 - local.get $7 - call $~lib/array/Array#push - drop - end - end - local.get $3 - i32.const 1 - i32.add - local.set $3 - br $repeat|0 - unreachable - end - unreachable - end - local.get $2 - ) - (func $start:std/array~anonymous|26 (; 80 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $2 - i32.const 100 - call $~lib/array/Array#push - drop - global.get $std/array/i - local.get $0 - i32.add - global.set $std/array/i - local.get $0 - i32.const 2 - i32.ge_s - ) - (func $start:std/array~anonymous|27 (; 81 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - global.get $std/array/i - local.get $0 - i32.add - global.set $std/array/i - local.get $0 - i32.const 2 - i32.ge_s - ) - (func $start:std/array~anonymous|28 (; 82 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $2 - call $~lib/array/Array#pop - drop - global.get $std/array/i - local.get $0 - i32.add - global.set $std/array/i - local.get $0 - i32.const 2 - i32.ge_s - ) - (func $start:std/array~anonymous|29 (; 83 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - local.get $0 - local.get $1 - i32.add - ) - (func $~lib/array/Array#reduce (; 84 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - local.get $2 - local.set $3 - block $break|0 - block - i32.const 0 - local.set $4 - local.get $0 - i32.load offset=4 - local.set $5 - end - loop $repeat|0 - local.get $4 - local.get $5 - local.tee $6 - local.get $0 - i32.load offset=4 - local.tee $7 - local.get $6 - local.get $7 - i32.lt_s - select - i32.lt_s - i32.eqz - br_if $break|0 - block (result i32) - i32.const 4 - global.set $~lib/argc - local.get $3 - block $~lib/internal/arraybuffer/LOAD|inlined.18 (result i32) - local.get $0 - i32.load - local.set $6 - local.get $4 - local.set $7 - i32.const 0 - local.set $8 - local.get $6 - local.get $7 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.add - i32.load offset=8 - end - local.get $4 - local.get $0 - local.get $1 - call_indirect (type $FUNCSIG$iiiii) - end - local.set $3 - local.get $4 - i32.const 1 - i32.add - local.set $4 - br $repeat|0 + local.get $3 + memory.grow + i32.const 0 + i32.lt_s + if unreachable end - unreachable end - local.get $3 - ) - (func $start:std/array~anonymous|30 (; 85 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - local.get $0 - local.get $1 - i32.add - ) - (func $start:std/array~anonymous|31 (; 86 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + memory.size + local.set $7 local.get $0 - i32.const 0 - i32.ne - if (result i32) - local.get $0 - else - local.get $1 - i32.const 2 - i32.gt_s - end - ) - (func $~lib/array/Array#reduce (; 87 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) local.get $2 - local.set $3 - block $break|0 - block - i32.const 0 - local.set $4 - local.get $0 - i32.load offset=4 - local.set $5 - end - loop $repeat|0 - local.get $4 - local.get $5 - local.tee $6 - local.get $0 - i32.load offset=4 - local.tee $7 - local.get $6 - local.get $7 - i32.lt_s - select - i32.lt_s - i32.eqz - br_if $break|0 - block (result i32) - i32.const 4 - global.set $~lib/argc - local.get $3 - block $~lib/internal/arraybuffer/LOAD|inlined.19 (result i32) - local.get $0 - i32.load - local.set $6 - local.get $4 - local.set $7 - i32.const 0 - local.set $8 - local.get $6 - local.get $7 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.add - i32.load offset=8 - end - local.get $4 - local.get $0 - local.get $1 - call_indirect (type $FUNCSIG$iiiii) - end - local.set $3 - local.get $4 - i32.const 1 - i32.add - local.set $4 - br $repeat|0 - unreachable - end - unreachable - end - local.get $3 - ) - (func $start:std/array~anonymous|32 (; 88 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - local.get $0 - i32.const 0 - i32.ne - if (result i32) - local.get $0 - else - local.get $1 - i32.const 100 - i32.gt_s - end - ) - (func $start:std/array~anonymous|33 (; 89 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - local.get $3 - i32.const 1 - call $~lib/array/Array#push - drop - local.get $0 - local.get $1 - i32.add - ) - (func $start:std/array~anonymous|34 (; 90 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - local.get $0 - local.get $1 - i32.add - ) - (func $start:std/array~anonymous|35 (; 91 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - local.get $3 - call $~lib/array/Array#pop + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory drop - local.get $0 - local.get $1 - i32.add - ) - (func $start:std/array~anonymous|36 (; 92 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - local.get $0 - local.get $1 - i32.add ) - (func $~lib/array/Array#reduceRight (; 93 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/rt/tlsf/prepareBlock (; 13 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) - (local $7 i32) - local.get $2 + local.get $1 + i32.load local.set $3 - block $break|0 - local.get $0 - i32.load offset=4 - i32.const 1 - i32.sub - local.set $4 - loop $repeat|0 - local.get $4 - i32.const 0 - i32.ge_s - i32.eqz - br_if $break|0 - block (result i32) - i32.const 4 - global.set $~lib/argc - local.get $3 - block $~lib/internal/arraybuffer/LOAD|inlined.20 (result i32) - local.get $0 - i32.load - local.set $5 - local.get $4 - local.set $6 - i32.const 0 - local.set $7 - local.get $5 - local.get $6 - i32.const 2 - i32.shl - i32.add - local.get $7 - i32.add - i32.load offset=8 - end - local.get $4 - local.get $0 - local.get $1 - call_indirect (type $FUNCSIG$iiiii) - end - local.set $3 - local.get $4 - i32.const 1 - i32.sub - local.set $4 - br $repeat|0 - unreachable - end + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 364 + i32.const 13 + call $~lib/builtins/abort unreachable end local.get $3 - ) - (func $start:std/array~anonymous|37 (; 94 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - local.get $0 - local.get $1 - i32.add - ) - (func $start:std/array~anonymous|38 (; 95 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - local.get $0 - i32.const 0 - i32.ne - if (result i32) + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock else local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load i32.const 2 - i32.gt_s + i32.const -1 + i32.xor + i32.and + i32.store end ) - (func $~lib/array/Array#reduceRight (; 96 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/rt/tlsf/allocateBlock (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 local.get $2 + call $~lib/rt/tlsf/searchBlock local.set $3 - block $break|0 + local.get $3 + i32.eqz + if local.get $0 - i32.load offset=4 - i32.const 1 - i32.sub - local.set $4 - loop $repeat|0 - local.get $4 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if i32.const 0 - i32.ge_s - i32.eqz - br_if $break|0 - block (result i32) - i32.const 4 - global.set $~lib/argc - local.get $3 - block $~lib/internal/arraybuffer/LOAD|inlined.21 (result i32) - local.get $0 - i32.load - local.set $5 - local.get $4 - local.set $6 - i32.const 0 - local.set $7 - local.get $5 - local.get $6 - i32.const 2 - i32.shl - i32.add - local.get $7 - i32.add - i32.load offset=8 - end - local.get $4 - local.get $0 - local.get $1 - call_indirect (type $FUNCSIG$iiiii) - end - local.set $3 - local.get $4 - i32.const 1 - i32.sub - local.set $4 - br $repeat|0 + i32.const 128 + i32.const 477 + i32.const 15 + call $~lib/builtins/abort unreachable end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 479 + i32.const 13 + call $~lib/builtins/abort unreachable end local.get $3 - ) - (func $start:std/array~anonymous|39 (; 97 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - local.get $0 i32.const 0 - i32.ne - if (result i32) - local.get $0 - else - local.get $1 - i32.const 100 - i32.gt_s - end - ) - (func $start:std/array~anonymous|40 (; 98 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + i32.store offset=4 local.get $3 - i32.const 1 - call $~lib/array/Array#push - drop - local.get $0 local.get $1 - i32.add - ) - (func $start:std/array~anonymous|41 (; 99 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + i32.store offset=12 local.get $0 - local.get $1 - i32.add - ) - (func $start:std/array~anonymous|42 (; 100 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) local.get $3 - call $~lib/array/Array#pop - drop - local.get $0 - local.get $1 - i32.add - ) - (func $~lib/math/murmurHash3 (; 101 ;) (type $FUNCSIG$jj) (param $0 i64) (result i64) - local.get $0 - local.get $0 - i64.const 33 - i64.shr_u - i64.xor - local.set $0 - local.get $0 - i64.const -49064778989728563 - i64.mul - local.set $0 - local.get $0 - local.get $0 - i64.const 33 - i64.shr_u - i64.xor - local.set $0 - local.get $0 - i64.const -4265267296055464877 - i64.mul - local.set $0 - local.get $0 - local.get $0 - i64.const 33 - i64.shr_u - i64.xor - local.set $0 + call $~lib/rt/tlsf/removeBlock local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + call $~lib/rt/rtrace/onalloc + local.get $3 ) - (func $~lib/math/splitMix32 (; 102 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/rt/tlsf/__alloc (; 15 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 local.get $0 - i32.const 1831565813 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 i32.add - local.set $0 - local.get $0 + ) + (func $~lib/rt/pure/increment (; 16 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) local.get $0 - i32.const 15 - i32.shr_u + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 i32.xor - local.get $0 + i32.and + local.get $1 i32.const 1 - i32.or - i32.mul - local.set $0 - local.get $0 - local.get $0 - local.get $0 - local.get $0 - i32.const 7 - i32.shr_u + i32.add + i32.const 268435455 + i32.const -1 i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort + unreachable + end local.get $0 - i32.const 61 - i32.or - i32.mul + local.get $1 + i32.const 1 i32.add - i32.xor - local.set $0 + i32.store offset=4 local.get $0 + call $~lib/rt/rtrace/onincrement local.get $0 - i32.const 14 - i32.shr_u - i32.xor + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 107 + i32.const 13 + call $~lib/builtins/abort + unreachable + end ) - (func $~lib/math/NativeMath.seedRandom (; 103 ;) (type $FUNCSIG$vj) (param $0 i64) + (func $~lib/rt/pure/__retain (; 17 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - i64.eqz + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment + end + local.get $0 + ) + (func $~lib/rt/tlsf/freeBlock (; 18 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz if i32.const 0 - i32.const 2896 - i32.const 978 - i32.const 4 - call $~lib/env/abort + i32.const 128 + i32.const 531 + i32.const 2 + call $~lib/builtins/abort unreachable end + local.get $1 + local.get $2 i32.const 1 - global.set $~lib/math/random_seeded + i32.or + i32.store local.get $0 - call $~lib/math/murmurHash3 - global.set $~lib/math/random_state0_64 - global.get $~lib/math/random_state0_64 - i64.const -1 - i64.xor - call $~lib/math/murmurHash3 - global.set $~lib/math/random_state1_64 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/rtrace/onfree + ) + (func $~lib/rt/__typeinfo (; 19 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/rt/__rtti_base + local.set $1 local.get $0 - i32.wrap_i64 - call $~lib/math/splitMix32 - global.set $~lib/math/random_state0_32 - global.get $~lib/math/random_state0_32 - call $~lib/math/splitMix32 - global.set $~lib/math/random_state1_32 + local.get $1 + i32.load + i32.gt_u + if + i32.const 280 + i32.const 336 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 4 + i32.add + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load ) - (func $~lib/internal/sort/insertionSort (; 104 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $~lib/util/memory/memcpy (; 20 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 f32) - (local $9 i32) - (local $10 f32) - (local $11 f32) block $break|0 - i32.const 0 - local.set $4 - loop $repeat|0 - local.get $4 + loop $continue|0 local.get $2 - i32.lt_s - i32.eqz - br_if $break|0 - block - block $~lib/internal/arraybuffer/LOAD|inlined.3 (result f32) + if (result i32) + local.get $1 + i32.const 3 + i32.and + else + i32.const 0 + end + if + block (result i32) local.get $0 - local.set $5 - local.get $4 - local.set $6 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) local.get $1 - local.set $7 + local.tee $5 + i32.const 1 + i32.add + local.set $1 local.get $5 - local.get $6 - i32.const 2 - i32.shl + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $continue|0 + end + end + end + local.get $0 + i32.const 3 + i32.and + i32.const 0 + i32.eq + if + block $break|1 + loop $continue|1 + local.get $2 + i32.const 16 + i32.ge_u + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 i32.add - local.get $7 + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 8 + i32.add + i32.load + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 12 + i32.add + i32.load + i32.store + local.get $1 + i32.const 16 i32.add - f32.load offset=8 + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|1 end - local.set $8 - local.get $4 + end + end + local.get $2 + i32.const 8 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + end + local.get $2 + i32.const 4 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.set $0 + local.get $1 + i32.const 4 + i32.add + local.set $1 + end + local.get $2 + i32.const 2 + i32.and + if + local.get $0 + local.get $1 + i32.load16_u + i32.store16 + local.get $0 + i32.const 2 + i32.add + local.set $0 + local.get $1 + i32.const 2 + i32.add + local.set $1 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 i32.const 1 - i32.sub - local.set $7 - block $break|1 - loop $continue|1 - local.get $7 - i32.const 0 - i32.ge_s - if - block - block $~lib/internal/arraybuffer/LOAD|inlined.4 (result f32) - local.get $0 - local.set $6 - local.get $7 - local.set $5 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + return + end + local.get $2 + i32.const 32 + i32.ge_u + if + block $break|2 + block $case2|2 + block $case1|2 + block $case0|2 + local.get $0 + i32.const 3 + i32.and + local.set $5 + local.get $5 + i32.const 1 + i32.eq + br_if $case0|2 + local.get $5 + i32.const 2 + i32.eq + br_if $case1|2 + local.get $5 + i32.const 3 + i32.eq + br_if $case2|2 + br $break|2 + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 3 + i32.sub + local.set $2 + block $break|3 + loop $continue|3 + local.get $2 + i32.const 17 + i32.ge_u + if local.get $1 - local.set $9 - local.get $6 - local.get $5 - i32.const 2 + i32.const 1 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 i32.shl + i32.or + i32.store + local.get $1 + i32.const 5 i32.add - local.get $9 + i32.load + local.set $3 + local.get $0 + i32.const 4 i32.add - f32.load offset=8 - end - local.set $10 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $8 - local.get $10 + local.get $4 + i32.const 24 + i32.shr_u local.get $3 - call_indirect (type $FUNCSIG$iff) - end - i32.const 0 - i32.lt_s - if + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 9 + i32.add + i32.load + local.set $4 local.get $0 - local.set $9 - block (result i32) - local.get $7 - local.tee $5 - i32.const 1 - i32.sub - local.set $7 - local.get $5 - end - i32.const 1 + i32.const 8 i32.add - local.set $5 - local.get $10 - local.set $11 - local.get $1 - local.set $6 - local.get $9 - local.get $5 - i32.const 2 + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 i32.shl + i32.or + i32.store + local.get $1 + i32.const 13 i32.add - local.get $6 + i32.load + local.set $3 + local.get $0 + i32.const 12 i32.add - local.get $11 - f32.store offset=8 - else - br $break|1 - end - end - br $continue|1 - end - end - end - block $~lib/internal/arraybuffer/STORE|inlined.4 - local.get $0 - local.set $6 - local.get $7 - i32.const 1 - i32.add - local.set $5 - local.get $8 - local.set $10 - local.get $1 - local.set $9 - local.get $6 - local.get $5 - i32.const 2 - i32.shl - i32.add - local.get $9 - i32.add - local.get $10 - f32.store offset=8 - end - end - local.get $4 - i32.const 1 - i32.add - local.set $4 - br $repeat|0 - unreachable - end - unreachable - end - ) - (func $~lib/internal/sort/weakHeapSort (; 105 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 f32) - (local $13 f32) - (local $14 f32) - (local $15 f32) - local.get $2 - i32.const 31 - i32.add - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - local.set $4 - block $~lib/memory/memory.allocate|inlined.1 (result i32) - local.get $4 - local.set $5 - local.get $5 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.1 - end - local.set $6 - block $~lib/memory/memory.fill|inlined.5 - local.get $6 - local.set $5 - i32.const 0 - local.set $7 - local.get $4 - local.set $8 - local.get $5 - local.get $7 - local.get $8 - call $~lib/internal/memory/memset - end - block $break|0 - local.get $2 - i32.const 1 - i32.sub - local.set $8 - loop $repeat|0 - local.get $8 - i32.const 0 - i32.gt_s - i32.eqz - br_if $break|0 - block - local.get $8 - local.set $7 - block $break|1 - loop $continue|1 - local.get $7 - i32.const 1 - i32.and - local.get $6 - local.get $7 - i32.const 6 - i32.shr_s - i32.const 2 - i32.shl - i32.add - i32.load - local.get $7 - i32.const 1 - i32.shr_s - i32.const 31 - i32.and - i32.shr_u - i32.const 1 - i32.and - i32.eq - if - local.get $7 - i32.const 1 - i32.shr_s - local.set $7 - br $continue|1 + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|3 + end + end end + br $break|2 + unreachable end + unreachable end - local.get $7 - i32.const 1 - i32.shr_s - local.set $5 - block $~lib/internal/arraybuffer/LOAD|inlined.5 (result f32) - local.get $0 - local.set $9 - local.get $5 - local.set $10 - local.get $1 - local.set $11 - local.get $9 - local.get $10 - i32.const 2 - i32.shl - i32.add - local.get $11 - i32.add - f32.load offset=8 - end - local.set $12 - block $~lib/internal/arraybuffer/LOAD|inlined.6 (result f32) - local.get $0 - local.set $11 - local.get $8 - local.set $10 + block local.get $1 - local.set $9 - local.get $11 - local.get $10 - i32.const 2 - i32.shl - i32.add - local.get $9 - i32.add - f32.load offset=8 - end - local.set $13 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $12 - local.get $13 - local.get $3 - call_indirect (type $FUNCSIG$iff) - end - i32.const 0 - i32.lt_s - if - local.get $6 - local.get $8 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - local.get $6 - local.get $8 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add i32.load - i32.const 1 - local.get $8 - i32.const 31 - i32.and - i32.shl - i32.xor - i32.store - block $~lib/internal/arraybuffer/STORE|inlined.5 + local.set $3 + block (result i32) local.get $0 - local.set $9 - local.get $8 - local.set $10 - local.get $12 - local.set $14 - local.get $1 - local.set $11 - local.get $9 - local.get $10 - i32.const 2 - i32.shl - i32.add - local.get $11 + local.tee $5 + i32.const 1 i32.add - local.get $14 - f32.store offset=8 - end - block $~lib/internal/arraybuffer/STORE|inlined.6 - local.get $0 - local.set $11 + local.set $0 local.get $5 - local.set $10 - local.get $13 - local.set $14 + end + block (result i32) local.get $1 - local.set $9 - local.get $11 - local.get $10 - i32.const 2 - i32.shl - i32.add - local.get $9 + local.tee $5 + i32.const 1 i32.add - local.get $14 - f32.store offset=8 + local.set $1 + local.get $5 end - end - end - local.get $8 - i32.const 1 - i32.sub - local.set $8 - br $repeat|0 - unreachable - end - unreachable - end - block $break|2 - local.get $2 - i32.const 1 - i32.sub - local.set $8 - loop $repeat|2 - local.get $8 - i32.const 2 - i32.ge_s - i32.eqz - br_if $break|2 - block - block $~lib/internal/arraybuffer/LOAD|inlined.7 (result f32) - local.get $0 - local.set $5 - i32.const 0 - local.set $7 - local.get $1 - local.set $9 - local.get $5 - local.get $7 - i32.const 2 - i32.shl - i32.add - local.get $9 - i32.add - f32.load offset=8 - end - local.set $13 - block $~lib/internal/arraybuffer/STORE|inlined.7 - local.get $0 - local.set $9 - i32.const 0 - local.set $7 - block $~lib/internal/arraybuffer/LOAD|inlined.8 (result f32) + i32.load8_u + i32.store8 + block (result i32) local.get $0 - local.set $5 - local.get $8 - local.set $10 - local.get $1 - local.set $11 - local.get $5 - local.get $10 - i32.const 2 - i32.shl + local.tee $5 + i32.const 1 i32.add - local.get $11 + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 i32.add - f32.load offset=8 + local.set $1 + local.get $5 end - local.set $12 - local.get $1 - local.set $11 - local.get $9 - local.get $7 + i32.load8_u + i32.store8 + local.get $2 i32.const 2 - i32.shl - i32.add - local.get $11 - i32.add - local.get $12 - f32.store offset=8 + i32.sub + local.set $2 + block $break|4 + loop $continue|4 + local.get $2 + i32.const 18 + i32.ge_u + if + local.get $1 + i32.const 2 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 6 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 10 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 14 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|4 + end + end + end + br $break|2 + unreachable end - block $~lib/internal/arraybuffer/STORE|inlined.8 + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) local.get $0 - local.set $11 - local.get $8 - local.set $7 - local.get $13 - local.set $12 - local.get $1 - local.set $9 - local.get $11 - local.get $7 - i32.const 2 - i32.shl + local.tee $5 + i32.const 1 i32.add - local.get $9 + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 i32.add - local.get $12 - f32.store offset=8 + local.set $1 + local.get $5 end + i32.load8_u + i32.store8 + local.get $2 i32.const 1 - local.set $9 - block $break|3 - loop $continue|3 - local.get $9 - i32.const 1 - i32.shl - local.get $6 - local.get $9 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - i32.load - local.get $9 - i32.const 31 - i32.and - i32.shr_u - i32.const 1 - i32.and - i32.add - local.tee $7 - local.get $8 - i32.lt_s - if - local.get $7 - local.set $9 - br $continue|3 - end - end - end - block $break|4 - loop $continue|4 - local.get $9 - i32.const 0 - i32.gt_s + i32.sub + local.set $2 + block $break|5 + loop $continue|5 + local.get $2 + i32.const 19 + i32.ge_u if - block - block $~lib/internal/arraybuffer/LOAD|inlined.9 (result f32) - local.get $0 - local.set $11 - i32.const 0 - local.set $10 - local.get $1 - local.set $5 - local.get $11 - local.get $10 - i32.const 2 - i32.shl - i32.add - local.get $5 - i32.add - f32.load offset=8 - end - local.set $13 - block $~lib/internal/arraybuffer/LOAD|inlined.10 (result f32) - local.get $0 - local.set $5 - local.get $9 - local.set $10 - local.get $1 - local.set $11 - local.get $5 - local.get $10 - i32.const 2 - i32.shl - i32.add - local.get $11 - i32.add - f32.load offset=8 - end - local.set $12 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $13 - local.get $12 - local.get $3 - call_indirect (type $FUNCSIG$iff) - end - i32.const 0 - i32.lt_s - if - local.get $6 - local.get $9 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - local.get $6 - local.get $9 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - i32.load - i32.const 1 - local.get $9 - i32.const 31 - i32.and - i32.shl - i32.xor - i32.store - block $~lib/internal/arraybuffer/STORE|inlined.9 - local.get $0 - local.set $11 - local.get $9 - local.set $10 - local.get $13 - local.set $14 - local.get $1 - local.set $5 - local.get $11 - local.get $10 - i32.const 2 - i32.shl - i32.add - local.get $5 - i32.add - local.get $14 - f32.store offset=8 - end - block $~lib/internal/arraybuffer/STORE|inlined.10 - local.get $0 - local.set $5 - i32.const 0 - local.set $10 - local.get $12 - local.set $14 - local.get $1 - local.set $11 - local.get $5 - local.get $10 - i32.const 2 - i32.shl - i32.add - local.get $11 - i32.add - local.get $14 - f32.store offset=8 - end - end - local.get $9 - i32.const 1 - i32.shr_s - local.set $9 - end - br $continue|4 + local.get $1 + i32.const 3 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 7 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 11 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 15 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|5 end end end + br $break|2 + unreachable end - local.get $8 + unreachable + end + end + local.get $2 + i32.const 16 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 i32.const 1 - i32.sub - local.set $8 - br $repeat|2 - unreachable + i32.add + local.set $0 + local.get $5 end - unreachable - end - block $~lib/memory/memory.free|inlined.1 - local.get $6 - local.set $8 - local.get $8 - call $~lib/allocator/arena/__memory_free - br $~lib/memory/memory.free|inlined.1 - end - block $~lib/internal/arraybuffer/LOAD|inlined.11 (result f32) - local.get $0 - local.set $8 - i32.const 1 - local.set $7 - local.get $1 - local.set $9 - local.get $8 - local.get $7 - i32.const 2 - i32.shl - i32.add - local.get $9 - i32.add - f32.load offset=8 - end - local.set $15 - block $~lib/internal/arraybuffer/STORE|inlined.11 - local.get $0 - local.set $9 - i32.const 1 - local.set $7 - block $~lib/internal/arraybuffer/LOAD|inlined.12 (result f32) + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) local.get $0 - local.set $8 - i32.const 0 - local.set $11 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) local.get $1 - local.set $10 - local.get $8 - local.get $11 - i32.const 2 - i32.shl + local.tee $5 + i32.const 1 i32.add - local.get $10 + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 i32.add - f32.load offset=8 + local.set $0 + local.get $5 end - local.set $13 - local.get $1 - local.set $10 - local.get $9 - local.get $7 - i32.const 2 - i32.shl - i32.add - local.get $10 - i32.add - local.get $13 - f32.store offset=8 - end - block $~lib/internal/arraybuffer/STORE|inlined.12 - local.get $0 - local.set $10 - i32.const 0 - local.set $7 - local.get $15 - local.set $13 - local.get $1 - local.set $9 - local.get $10 - local.get $7 - i32.const 2 - i32.shl - i32.add - local.get $9 - i32.add - local.get $13 - f32.store offset=8 - end - ) - (func $~lib/array/Array#sort (; 106 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 f32) - (local $8 f32) - (local $9 f32) - (local $10 i32) - local.get $1 - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 395 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - i32.load offset=4 - local.set $2 - local.get $2 - i32.const 1 - i32.le_s - if - local.get $0 - return + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 end - local.get $0 - i32.load - local.set $3 local.get $2 - i32.const 2 - i32.eq + i32.const 8 + i32.and if - block $~lib/internal/arraybuffer/LOAD|inlined.1 (result f32) - local.get $3 - local.set $4 + block (result i32) + local.get $0 + local.tee $5 i32.const 1 - local.set $5 - i32.const 0 - local.set $6 - local.get $4 + i32.add + local.set $0 local.get $5 - i32.const 2 - i32.shl + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 i32.add - local.get $6 + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 i32.add - f32.load offset=8 + local.set $0 + local.get $5 end - local.set $7 - block $~lib/internal/arraybuffer/LOAD|inlined.2 (result f32) - local.get $3 - local.set $6 - i32.const 0 - local.set $5 - i32.const 0 - local.set $4 - local.get $6 + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 local.get $5 - i32.const 2 - i32.shl + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 i32.add - local.get $4 + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 i32.add - f32.load offset=8 + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 end - local.set $8 block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $7 - local.get $8 local.get $1 - call_indirect (type $FUNCSIG$iff) + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 end - i32.const 0 - i32.lt_s - if - block $~lib/internal/arraybuffer/STORE|inlined.1 - local.get $3 - local.set $4 - i32.const 1 - local.set $5 - local.get $8 - local.set $9 - i32.const 0 - local.set $6 - local.get $4 - local.get $5 - i32.const 2 - i32.shl - i32.add - local.get $6 - i32.add - local.get $9 - f32.store offset=8 - end - block $~lib/internal/arraybuffer/STORE|inlined.2 - local.get $3 - local.set $6 - i32.const 0 - local.set $5 - local.get $7 - local.set $9 - i32.const 0 - local.set $4 - local.get $6 - local.get $5 - i32.const 2 - i32.shl - i32.add - local.get $4 - i32.add - local.get $9 - f32.store offset=8 - end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 end - local.get $0 - return - end - block $~lib/internal/sort/SORT|inlined.0 - local.get $3 - local.set $4 - i32.const 0 - local.set $5 - local.get $2 - local.set $6 - local.get $1 - local.set $10 - local.get $6 - i32.const 256 - i32.lt_s - if - local.get $4 + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 local.get $5 - local.get $6 - local.get $10 - call $~lib/internal/sort/insertionSort - else - local.get $4 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 local.get $5 - local.get $6 - local.get $10 - call $~lib/internal/sort/weakHeapSort end - end - local.get $0 - ) - (func $~lib/internal/sort/COMPARATOR~anonymous|0 (; 107 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) - (local $2 i32) - (local $3 i32) - local.get $0 - i32.reinterpret_f32 - local.set $2 - local.get $1 - i32.reinterpret_f32 - local.set $3 - local.get $2 - local.get $2 - i32.const 31 - i32.shr_s - i32.const 1 - i32.shr_u - i32.xor - local.set $2 - local.get $3 - local.get $3 - i32.const 31 - i32.shr_s - i32.const 1 - i32.shr_u - i32.xor - local.set $3 - local.get $2 - local.get $3 - i32.gt_s - local.get $2 - local.get $3 - i32.lt_s - i32.sub - ) - (func $~lib/array/Array#sort|trampoline (; 108 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - block $1of1 - block $0of1 - block $outOfRange - global.get $~lib/argc - br_table $0of1 $1of1 $outOfRange - end - unreachable + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 end - block $~lib/internal/sort/COMPARATOR|inlined.0 (result i32) - i32.const 44 - br $~lib/internal/sort/COMPARATOR|inlined.0 + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 end - local.set $1 + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 end - local.get $0 - local.get $1 - call $~lib/array/Array#sort - ) - (func $~lib/builtins/isNaN (; 109 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) - local.get $0 - local.get $0 - f32.ne - ) - (func $std/array/isArraysEqual (; 110 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) local.get $2 - i32.eqz + i32.const 4 + i32.and if - block $~lib/array/Array#get:length|inlined.1 (result i32) + block (result i32) local.get $0 - local.set $3 - local.get $3 - i32.load offset=4 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 end - local.set $2 - local.get $2 - block $~lib/array/Array#get:length|inlined.3 (result i32) + block (result i32) local.get $1 - local.set $3 - local.get $3 - i32.load offset=4 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 end - i32.ne - if - i32.const 0 - return + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 end - local.get $0 - local.get $1 - i32.eq - if + block (result i32) + local.get $1 + local.tee $5 i32.const 1 - return + i32.add + local.set $1 + local.get $5 end - end - block $break|0 - i32.const 0 - local.set $3 - loop $repeat|0 - block $continue|0 - local.get $3 - local.get $2 - i32.lt_s - i32.eqz - br_if $break|0 - block - local.get $0 - local.get $3 - call $~lib/array/Array#__get - call $~lib/builtins/isNaN - local.get $1 - local.get $3 - call $~lib/array/Array#__get - call $~lib/builtins/isNaN - i32.eq - if - br $continue|0 - end - local.get $0 - local.get $3 - call $~lib/array/Array#__get - local.get $1 - local.get $3 - call $~lib/array/Array#__get - f32.ne - if - i32.const 0 - return - end - end - end - local.get $3 + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 i32.const 1 i32.add - local.set $3 - br $repeat|0 - unreachable + local.set $0 + local.get $5 end - unreachable + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 end - i32.const 1 - ) - (func $~lib/internal/sort/insertionSort (; 111 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 f64) - (local $9 i32) - (local $10 f64) - (local $11 f64) - block $break|0 - i32.const 0 - local.set $4 - loop $repeat|0 - local.get $4 - local.get $2 - i32.lt_s - i32.eqz - br_if $break|0 - block - block $~lib/internal/arraybuffer/LOAD|inlined.2 (result f64) - local.get $0 - local.set $5 - local.get $4 - local.set $6 - local.get $1 - local.set $7 - local.get $5 - local.get $6 - i32.const 3 - i32.shl - i32.add - local.get $7 - i32.add - f64.load offset=8 - end - local.set $8 - local.get $4 - i32.const 1 - i32.sub - local.set $7 - block $break|1 - loop $continue|1 - local.get $7 - i32.const 0 - i32.ge_s - if - block - block $~lib/internal/arraybuffer/LOAD|inlined.3 (result f64) - local.get $0 - local.set $6 - local.get $7 - local.set $5 - local.get $1 - local.set $9 - local.get $6 - local.get $5 - i32.const 3 - i32.shl - i32.add - local.get $9 - i32.add - f64.load offset=8 - end - local.set $10 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $8 - local.get $10 - local.get $3 - call_indirect (type $FUNCSIG$idd) - end - i32.const 0 - i32.lt_s - if - local.get $0 - local.set $9 - block (result i32) - local.get $7 - local.tee $5 - i32.const 1 - i32.sub - local.set $7 - local.get $5 - end - i32.const 1 - i32.add - local.set $5 - local.get $10 - local.set $11 - local.get $1 - local.set $6 - local.get $9 - local.get $5 - i32.const 3 - i32.shl - i32.add - local.get $6 - i32.add - local.get $11 - f64.store offset=8 - else - br $break|1 - end - end - br $continue|1 - end - end - end - block $~lib/internal/arraybuffer/STORE|inlined.3 - local.get $0 - local.set $6 - local.get $7 - i32.const 1 - i32.add - local.set $5 - local.get $8 - local.set $10 - local.get $1 - local.set $9 - local.get $6 - local.get $5 - i32.const 3 - i32.shl - i32.add - local.get $9 - i32.add - local.get $10 - f64.store offset=8 - end - end - local.get $4 + local.get $2 + i32.const 2 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 i32.const 1 i32.add - local.set $4 - br $repeat|0 - unreachable + local.set $1 + local.get $5 end - unreachable + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 end ) - (func $~lib/internal/sort/weakHeapSort (; 112 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $~lib/memory/memory.copy (; 21 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 f64) - (local $13 f64) - (local $14 f64) - (local $15 f64) - local.get $2 - i32.const 31 - i32.add - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - local.set $4 - block $~lib/memory/memory.allocate|inlined.2 (result i32) - local.get $4 + block $~lib/util/memory/memmove|inlined.0 + local.get $0 local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 local.get $5 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.2 - end - local.set $6 - block $~lib/memory/memory.fill|inlined.6 - local.get $6 - local.set $5 - i32.const 0 - local.set $7 local.get $4 - local.set $8 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $4 + local.get $3 + i32.add local.get $5 - local.get $7 - local.get $8 - call $~lib/internal/memory/memset - end - block $break|0 - local.get $2 - i32.const 1 - i32.sub - local.set $8 - loop $repeat|0 - local.get $8 - i32.const 0 - i32.gt_s - i32.eqz - br_if $break|0 - block - local.get $8 - local.set $7 - block $break|1 - loop $continue|1 - local.get $7 - i32.const 1 - i32.and - local.get $6 - local.get $7 - i32.const 6 - i32.shr_s - i32.const 2 - i32.shl - i32.add - i32.load - local.get $7 - i32.const 1 - i32.shr_s - i32.const 31 - i32.and - i32.shr_u - i32.const 1 + i32.le_u + if (result i32) + i32.const 1 + else + local.get $5 + local.get $3 + i32.add + local.get $4 + i32.le_u + end + if + local.get $5 + local.get $4 + local.get $3 + call $~lib/util/memory/memcpy + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 i32.and - i32.eq if - local.get $7 + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 i32.const 1 - i32.shr_s - local.set $7 - br $continue|1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 end end end - local.get $7 - i32.const 1 - i32.shr_s - local.set $5 - block $~lib/internal/arraybuffer/LOAD|inlined.4 (result f64) - local.get $0 - local.set $9 - local.get $5 - local.set $10 - local.get $1 - local.set $11 - local.get $9 - local.get $10 - i32.const 3 - i32.shl - i32.add - local.get $11 - i32.add - f64.load offset=8 - end - local.set $12 - block $~lib/internal/arraybuffer/LOAD|inlined.5 (result f64) - local.get $0 - local.set $11 - local.get $8 - local.set $10 - local.get $1 - local.set $9 - local.get $11 - local.get $10 - i32.const 3 - i32.shl - i32.add - local.get $9 - i32.add - f64.load offset=8 - end - local.set $13 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $12 - local.get $13 - local.get $3 - call_indirect (type $FUNCSIG$idd) - end - i32.const 0 - i32.lt_s - if - local.get $6 - local.get $8 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - local.get $6 - local.get $8 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - i32.load - i32.const 1 - local.get $8 - i32.const 31 - i32.and - i32.shl - i32.xor - i32.store - block $~lib/internal/arraybuffer/STORE|inlined.4 - local.get $0 - local.set $9 - local.get $8 - local.set $10 - local.get $12 - local.set $14 - local.get $1 - local.set $11 - local.get $9 - local.get $10 - i32.const 3 - i32.shl - i32.add - local.get $11 - i32.add - local.get $14 - f64.store offset=8 - end - block $~lib/internal/arraybuffer/STORE|inlined.5 - local.get $0 - local.set $11 - local.get $5 - local.set $10 - local.get $13 - local.set $14 - local.get $1 - local.set $9 - local.get $11 - local.get $10 - i32.const 3 - i32.shl - i32.add - local.get $9 - i32.add - local.get $14 - f64.store offset=8 + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end end end end - local.get $8 - i32.const 1 - i32.sub - local.set $8 - br $repeat|0 - unreachable - end - unreachable - end - block $break|2 - local.get $2 - i32.const 1 - i32.sub - local.set $8 - loop $repeat|2 - local.get $8 - i32.const 2 - i32.ge_s - i32.eqz - br_if $break|2 - block - block $~lib/internal/arraybuffer/LOAD|inlined.6 (result f64) - local.get $0 - local.set $5 - i32.const 0 - local.set $7 - local.get $1 - local.set $9 - local.get $5 - local.get $7 - i32.const 3 - i32.shl - i32.add - local.get $9 - i32.add - f64.load offset=8 - end - local.set $13 - block $~lib/internal/arraybuffer/STORE|inlined.6 - local.get $0 - local.set $9 - i32.const 0 - local.set $7 - block $~lib/internal/arraybuffer/LOAD|inlined.7 (result f64) - local.get $0 - local.set $5 - local.get $8 - local.set $10 - local.get $1 - local.set $11 - local.get $5 - local.get $10 - i32.const 3 - i32.shl - i32.add - local.get $11 - i32.add - f64.load offset=8 + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 end - local.set $12 - local.get $1 - local.set $11 - local.get $9 - local.get $7 - i32.const 3 - i32.shl - i32.add - local.get $11 - i32.add - local.get $12 - f64.store offset=8 - end - block $~lib/internal/arraybuffer/STORE|inlined.7 - local.get $0 - local.set $11 - local.get $8 - local.set $7 - local.get $13 - local.set $12 - local.get $1 - local.set $9 - local.get $11 - local.get $7 - i32.const 3 - i32.shl - i32.add - local.get $9 - i32.add - local.get $12 - f64.store offset=8 end - i32.const 1 - local.set $9 + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if block $break|3 loop $continue|3 - local.get $9 - i32.const 1 - i32.shl - local.get $6 - local.get $9 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl + local.get $5 + local.get $3 i32.add - i32.load - local.get $9 - i32.const 31 + i32.const 7 i32.and - i32.shr_u - i32.const 1 - i32.and - i32.add - local.tee $7 - local.get $8 - i32.lt_s if - local.get $7 - local.set $9 + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 br $continue|3 end end end block $break|4 loop $continue|4 - local.get $9 - i32.const 0 - i32.gt_s + local.get $3 + i32.const 8 + i32.ge_u if - block - block $~lib/internal/arraybuffer/LOAD|inlined.8 (result f64) - local.get $0 - local.set $11 - i32.const 0 - local.set $10 - local.get $1 - local.set $5 - local.get $11 - local.get $10 - i32.const 3 - i32.shl - i32.add - local.get $5 - i32.add - f64.load offset=8 - end - local.set $13 - block $~lib/internal/arraybuffer/LOAD|inlined.9 (result f64) - local.get $0 - local.set $5 - local.get $9 - local.set $10 - local.get $1 - local.set $11 - local.get $5 - local.get $10 - i32.const 3 - i32.shl - i32.add - local.get $11 - i32.add - f64.load offset=8 - end - local.set $12 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $13 - local.get $12 - local.get $3 - call_indirect (type $FUNCSIG$idd) - end - i32.const 0 - i32.lt_s - if - local.get $6 - local.get $9 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - local.get $6 - local.get $9 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - i32.load - i32.const 1 - local.get $9 - i32.const 31 - i32.and - i32.shl - i32.xor - i32.store - block $~lib/internal/arraybuffer/STORE|inlined.8 - local.get $0 - local.set $11 - local.get $9 - local.set $10 - local.get $13 - local.set $14 - local.get $1 - local.set $5 - local.get $11 - local.get $10 - i32.const 3 - i32.shl - i32.add - local.get $5 - i32.add - local.get $14 - f64.store offset=8 - end - block $~lib/internal/arraybuffer/STORE|inlined.9 - local.get $0 - local.set $5 - i32.const 0 - local.set $10 - local.get $12 - local.set $14 - local.get $1 - local.set $11 - local.get $5 - local.get $10 - i32.const 3 - i32.shl - i32.add - local.get $11 - i32.add - local.get $14 - f64.store offset=8 - end - end - local.get $9 - i32.const 1 - i32.shr_s - local.set $9 - end + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store br $continue|4 end end end end - local.get $8 - i32.const 1 - i32.sub - local.set $8 - br $repeat|2 - unreachable - end - unreachable - end - block $~lib/memory/memory.free|inlined.2 - local.get $6 - local.set $8 - local.get $8 - call $~lib/allocator/arena/__memory_free - br $~lib/memory/memory.free|inlined.2 - end - block $~lib/internal/arraybuffer/LOAD|inlined.10 (result f64) - local.get $0 - local.set $8 - i32.const 1 - local.set $7 - local.get $1 - local.set $9 - local.get $8 - local.get $7 - i32.const 3 - i32.shl - i32.add - local.get $9 - i32.add - f64.load offset=8 - end - local.set $15 - block $~lib/internal/arraybuffer/STORE|inlined.10 - local.get $0 - local.set $9 - i32.const 1 - local.set $7 - block $~lib/internal/arraybuffer/LOAD|inlined.11 (result f64) - local.get $0 - local.set $8 - i32.const 0 - local.set $11 - local.get $1 - local.set $10 - local.get $8 - local.get $11 - i32.const 3 - i32.shl - i32.add - local.get $10 - i32.add - f64.load offset=8 + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end end - local.set $13 - local.get $1 - local.set $10 - local.get $9 - local.get $7 - i32.const 3 - i32.shl - i32.add - local.get $10 - i32.add - local.get $13 - f64.store offset=8 end - block $~lib/internal/arraybuffer/STORE|inlined.11 + ) + (func $~lib/rt/tlsf/__free (; 22 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 561 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + i32.ne + if (result i32) local.get $0 - local.set $10 + i32.const 15 + i32.and + i32.eqz + else i32.const 0 - local.set $7 - local.get $15 - local.set $13 - local.get $1 - local.set $9 - local.get $10 - local.get $7 - i32.const 3 - i32.shl - i32.add - local.get $9 - i32.add - local.get $13 - f64.store offset=8 end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 562 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock ) - (func $~lib/array/Array#sort (; 113 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/rt/pure/growRoots (; 23 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) - (local $7 f64) - (local $8 f64) - (local $9 f64) - (local $10 i32) + global.get $~lib/rt/pure/ROOTS + local.set $0 + global.get $~lib/rt/pure/CUR + local.get $0 + i32.sub + local.set $1 local.get $1 - i32.eqz + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onfree + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $0 if - i32.const 0 - i32.const 8 - i32.const 395 - i32.const 4 - call $~lib/env/abort - unreachable + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onalloc + local.get $0 + call $~lib/rt/tlsf/__free + end + local.get $5 + global.set $~lib/rt/pure/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/pure/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/pure/END + ) + (func $~lib/rt/pure/appendRoot (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/pure/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 4 + i32.add + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/decrement (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) local.get $0 i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and local.set $2 - local.get $2 + local.get $0 + call $~lib/rt/rtrace/ondecrement + local.get $0 + i32.load i32.const 1 - i32.le_s + i32.and + i32.eqz + i32.eqz if - local.get $0 - return + i32.const 0 + i32.const 232 + i32.const 115 + i32.const 13 + call $~lib/builtins/abort + unreachable end - local.get $0 - i32.load - local.set $3 local.get $2 - i32.const 2 + i32.const 1 i32.eq if - block $~lib/internal/arraybuffer/LOAD|inlined.0 (result f64) - local.get $3 - local.set $4 - i32.const 1 - local.set $5 + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/rt/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 i32.const 0 - local.set $6 - local.get $4 - local.get $5 - i32.const 3 - i32.shl - i32.add - local.get $6 - i32.add - f64.load offset=8 - end - local.set $7 - block $~lib/internal/arraybuffer/LOAD|inlined.1 (result f64) - local.get $3 - local.set $6 + i32.or i32.const 0 - local.set $5 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if i32.const 0 - local.set $4 - local.get $6 - local.get $5 - i32.const 3 - i32.shl - i32.add - local.get $4 - i32.add - f64.load offset=8 + i32.const 232 + i32.const 124 + i32.const 15 + call $~lib/builtins/abort + unreachable end - local.set $8 - block (result i32) + local.get $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 16 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/pure/__release (; 26 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + end + ) + (func $~lib/arraybuffer/ArrayBufferView#constructor (; 27 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.const 1073741808 + local.get $2 + i32.shr_u + i32.gt_u + if + i32.const 24 + i32.const 72 + i32.const 14 + i32.const 56 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.shl + local.tee $1 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $3 + block (result i32) + local.get $0 + i32.eqz + if + i32.const 12 i32.const 2 - global.set $~lib/argc - local.get $7 - local.get $8 - local.get $1 - call_indirect (type $FUNCSIG$idd) + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $0 end + local.get $0 i32.const 0 - i32.lt_s - if - block $~lib/internal/arraybuffer/STORE|inlined.0 - local.get $3 - local.set $4 - i32.const 1 - local.set $5 - local.get $8 - local.set $9 - i32.const 0 - local.set $6 - local.get $4 - local.get $5 - i32.const 3 - i32.shl - i32.add - local.get $6 - i32.add - local.get $9 - f64.store offset=8 - end - block $~lib/internal/arraybuffer/STORE|inlined.1 - local.get $3 - local.set $6 - i32.const 0 - local.set $5 - local.get $7 - local.set $9 - i32.const 0 - local.set $4 - local.get $6 - local.get $5 - i32.const 3 - i32.shl - i32.add - local.get $4 - i32.add - local.get $9 - f64.store offset=8 - end - end + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 local.get $0 - return end - block $~lib/internal/sort/SORT|inlined.0 + local.tee $4 + block (result i32) local.get $3 - local.set $4 - i32.const 0 - local.set $5 - local.get $2 - local.set $6 - local.get $1 - local.set $10 - local.get $6 - i32.const 256 - i32.lt_s + local.tee $5 + local.get $4 + i32.load + local.tee $4 + i32.ne if - local.get $4 local.get $5 - local.get $6 - local.get $10 - call $~lib/internal/sort/insertionSort - else + call $~lib/rt/pure/__retain + drop local.get $4 - local.get $5 - local.get $6 - local.get $10 - call $~lib/internal/sort/weakHeapSort + call $~lib/rt/pure/__release end + local.get $5 end + i32.store local.get $0 - ) - (func $~lib/internal/sort/COMPARATOR~anonymous|0 (; 114 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) - (local $2 i64) - (local $3 i64) + local.get $3 + i32.store offset=4 local.get $0 - i64.reinterpret_f64 - local.set $2 local.get $1 - i64.reinterpret_f64 - local.set $3 - local.get $2 - local.get $2 - i64.const 63 - i64.shr_s - i64.const 1 - i64.shr_u - i64.xor - local.set $2 - local.get $3 - local.get $3 - i64.const 63 - i64.shr_s - i64.const 1 - i64.shr_u - i64.xor - local.set $3 - local.get $2 - local.get $3 - i64.gt_s - local.get $2 - local.get $3 - i64.lt_s - i32.sub + i32.store offset=8 + local.get $0 ) - (func $~lib/array/Array#sort|trampoline (; 115 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - block $1of1 - block $0of1 - block $outOfRange - global.get $~lib/argc - br_table $0of1 $1of1 $outOfRange - end - unreachable - end - block $~lib/internal/sort/COMPARATOR|inlined.0 (result i32) - i32.const 45 - br $~lib/internal/sort/COMPARATOR|inlined.0 - end - local.set $1 + (func $~lib/array/Array#constructor (; 28 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + if (result i32) + local.get $0 + else + i32.const 16 + i32.const 3 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain end + local.get $1 + i32.const 2 + call $~lib/arraybuffer/ArrayBufferView#constructor + local.set $0 + local.get $0 + i32.const 0 + i32.store offset=12 local.get $0 local.get $1 - call $~lib/array/Array#sort + i32.store offset=12 + local.get $0 ) - (func $~lib/array/Array#__get (; 116 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) + (func $~lib/array/Array.isArray<~lib/array/Array | null> (; 29 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) local.get $0 - i32.load - local.set $2 - local.get $1 - local.get $2 - i32.load - i32.const 3 - i32.shr_u - i32.lt_u - if (result f64) - local.get $2 - local.set $3 - local.get $1 - local.set $4 + call $~lib/rt/pure/__retain + drop + i32.const 1 + if (result i32) + local.get $0 i32.const 0 - local.set $5 - local.get $3 - local.get $4 - i32.const 3 - i32.shl - i32.add - local.get $5 - i32.add - f64.load offset=8 + i32.ne else - unreachable + i32.const 0 end + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 ) - (func $~lib/builtins/isNaN (; 117 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + (func $~lib/array/Array.isArray<~lib/array/Array> (; 30 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) local.get $0 + call $~lib/rt/pure/__retain + drop + i32.const 1 + if (result i32) + local.get $0 + i32.const 0 + i32.ne + else + i32.const 0 + end + local.set $1 local.get $0 - f64.ne + call $~lib/rt/pure/__release + local.get $1 ) - (func $std/array/isArraysEqual (; 118 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - local.get $2 + (func $std/array/P#constructor (; 31 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 i32.eqz if - block $~lib/array/Array#get:length|inlined.0 (result i32) - local.get $0 - local.set $3 - local.get $3 - i32.load offset=4 - end - local.set $2 - local.get $2 - block $~lib/array/Array#get:length|inlined.2 (result i32) - local.get $1 - local.set $3 - local.get $3 - i32.load offset=4 - end + i32.const 0 + i32.const 4 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $0 + end + local.get $0 + ) + (func $~lib/array/Array.isArray (; 32 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + i32.const 0 + if (result i32) + local.get $0 + i32.const 0 i32.ne - if - i32.const 0 - return - end + else + i32.const 0 + end + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + ) + (func $~lib/typedarray/Uint8Array#constructor (; 33 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + if (result i32) local.get $0 - local.get $1 - i32.eq - if - i32.const 1 - return - end + else + i32.const 12 + i32.const 5 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + end + local.get $1 + i32.const 0 + call $~lib/arraybuffer/ArrayBufferView#constructor + local.set $0 + local.get $0 + ) + (func $~lib/array/Array.isArray<~lib/typedarray/Uint8Array> (; 34 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + i32.const 0 + if (result i32) + local.get $0 + i32.const 0 + i32.ne + else + i32.const 0 + end + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + ) + (func $~lib/array/Array.isArray (; 35 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.const 0 + if (result i32) + local.get $0 + i32.const 0 + i32.ne + else + i32.const 0 end - block $break|0 + ) + (func $~lib/array/Array.isArray<~lib/string/String> (; 36 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + i32.const 0 + if (result i32) + local.get $0 + i32.const 0 + i32.ne + else i32.const 0 - local.set $3 - loop $repeat|0 - block $continue|0 - local.get $3 - local.get $2 - i32.lt_s - i32.eqz - br_if $break|0 - block - local.get $0 - local.get $3 - call $~lib/array/Array#__get - call $~lib/builtins/isNaN - local.get $1 - local.get $3 - call $~lib/array/Array#__get - call $~lib/builtins/isNaN - i32.eq - if - br $continue|0 - end - local.get $0 - local.get $3 - call $~lib/array/Array#__get - local.get $1 - local.get $3 - call $~lib/array/Array#__get - f64.ne - if - i32.const 0 - return - end - end - end - local.get $3 - i32.const 1 - i32.add - local.set $3 - br $repeat|0 - unreachable - end - unreachable end - i32.const 1 + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 ) - (func $~lib/internal/sort/insertionSort (; 119 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $~lib/rt/__allocArray (; 37 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - block $break|0 - i32.const 0 - local.set $4 - loop $repeat|0 - local.get $4 - local.get $2 - i32.lt_s - i32.eqz - br_if $break|0 - block - block $~lib/internal/arraybuffer/LOAD|inlined.24 (result i32) - local.get $0 - local.set $5 - local.get $4 - local.set $6 - local.get $1 - local.set $7 - local.get $5 - local.get $6 - i32.const 2 - i32.shl - i32.add - local.get $7 - i32.add - i32.load offset=8 - end - local.set $7 - local.get $4 - i32.const 1 - i32.sub - local.set $6 - block $break|1 - loop $continue|1 - local.get $6 - i32.const 0 - i32.ge_s - if - block - block $~lib/internal/arraybuffer/LOAD|inlined.25 (result i32) - local.get $0 - local.set $5 - local.get $6 - local.set $8 - local.get $1 - local.set $9 - local.get $5 - local.get $8 - i32.const 2 - i32.shl - i32.add - local.get $9 - i32.add - i32.load offset=8 - end - local.set $9 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $7 - local.get $9 - local.get $3 - call_indirect (type $FUNCSIG$iii) - end - i32.const 0 - i32.lt_s - if - local.get $0 - local.set $8 - block (result i32) - local.get $6 - local.tee $5 - i32.const 1 - i32.sub - local.set $6 - local.get $5 - end - i32.const 1 - i32.add - local.set $5 - local.get $9 - local.set $10 - local.get $1 - local.set $11 - local.get $8 - local.get $5 - i32.const 2 - i32.shl - i32.add - local.get $11 - i32.add - local.get $10 - i32.store offset=8 - else - br $break|1 - end - end - br $continue|1 - end - end - end - block $~lib/internal/arraybuffer/STORE|inlined.11 - local.get $0 - local.set $9 - local.get $6 - i32.const 1 - i32.add - local.set $11 - local.get $7 - local.set $10 - local.get $1 - local.set $5 - local.get $9 - local.get $11 - i32.const 2 - i32.shl - i32.add - local.get $5 - i32.add - local.get $10 - i32.store offset=8 - end - end - local.get $4 - i32.const 1 - i32.add - local.set $4 - br $repeat|0 - unreachable - end - unreachable + i32.const 16 + local.get $2 + call $~lib/rt/tlsf/__alloc + local.set $4 + local.get $0 + local.get $1 + i32.shl + local.set $5 + local.get $5 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $6 + local.get $4 + local.get $6 + call $~lib/rt/pure/__retain + i32.store + local.get $4 + local.get $6 + i32.store offset=4 + local.get $4 + local.get $5 + i32.store offset=8 + local.get $4 + local.get $0 + i32.store offset=12 + local.get $3 + if + local.get $6 + local.get $3 + local.get $5 + call $~lib/memory/memory.copy end + local.get $4 ) - (func $~lib/internal/sort/weakHeapSort (; 120 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $~lib/memory/memory.fill (; 38 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 i32) - local.get $2 - i32.const 31 - i32.add - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - local.set $4 - block $~lib/memory/memory.allocate|inlined.3 (result i32) - local.get $4 + (local $8 i64) + block $~lib/util/memory/memset|inlined.0 + local.get $0 local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $3 + i32.eqz + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 1 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 2 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 1 + i32.add + local.get $4 + i32.store8 + local.get $5 + i32.const 2 + i32.add + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 2 + i32.sub + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 3 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 6 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 3 + i32.add + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + i32.const 0 + local.get $5 + i32.sub + i32.const 3 + i32.and + local.set $6 local.get $5 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.3 - end - local.set $6 - block $~lib/memory/memory.fill|inlined.7 local.get $6 + i32.add local.set $5 - i32.const 0 - local.set $7 + local.get $3 + local.get $6 + i32.sub + local.set $3 + local.get $3 + i32.const -4 + i32.and + local.set $3 + i32.const -1 + i32.const 255 + i32.div_u local.get $4 - local.set $8 + i32.const 255 + i32.and + i32.mul + local.set $7 local.get $5 local.get $7 - local.get $8 - call $~lib/internal/memory/memset - end - block $break|0 - local.get $2 - i32.const 1 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 4 i32.sub - local.set $8 - loop $repeat|0 - local.get $8 - i32.const 0 - i32.gt_s - i32.eqz - br_if $break|0 - block - local.get $8 - local.set $7 - block $break|1 - loop $continue|1 - local.get $7 - i32.const 1 - i32.and - local.get $6 - local.get $7 - i32.const 6 - i32.shr_s - i32.const 2 - i32.shl - i32.add - i32.load - local.get $7 - i32.const 1 - i32.shr_s - i32.const 31 - i32.and - i32.shr_u - i32.const 1 - i32.and - i32.eq - if - local.get $7 - i32.const 1 - i32.shr_s - local.set $7 - br $continue|1 - end - end - end - local.get $7 - i32.const 1 - i32.shr_s - local.set $5 - block $~lib/internal/arraybuffer/LOAD|inlined.26 (result i32) - local.get $0 - local.set $9 - local.get $5 - local.set $10 - local.get $1 - local.set $11 - local.get $9 - local.get $10 - i32.const 2 - i32.shl - i32.add - local.get $11 - i32.add - i32.load offset=8 - end - local.set $11 - block $~lib/internal/arraybuffer/LOAD|inlined.27 (result i32) - local.get $0 - local.set $10 - local.get $8 - local.set $9 - local.get $1 - local.set $12 - local.get $10 - local.get $9 - i32.const 2 - i32.shl - i32.add - local.get $12 - i32.add - i32.load offset=8 - end - local.set $12 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $11 - local.get $12 - local.get $3 - call_indirect (type $FUNCSIG$iii) - end - i32.const 0 - i32.lt_s - if - local.get $6 - local.get $8 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - local.get $6 - local.get $8 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - i32.load - i32.const 1 - local.get $8 - i32.const 31 - i32.and - i32.shl - i32.xor - i32.store - block $~lib/internal/arraybuffer/STORE|inlined.12 - local.get $0 - local.set $9 - local.get $8 - local.set $10 - local.get $11 - local.set $13 - local.get $1 - local.set $14 - local.get $9 - local.get $10 - i32.const 2 - i32.shl - i32.add - local.get $14 - i32.add - local.get $13 - i32.store offset=8 - end - block $~lib/internal/arraybuffer/STORE|inlined.13 - local.get $0 - local.set $14 - local.get $5 - local.set $13 - local.get $12 - local.set $10 - local.get $1 - local.set $9 - local.get $14 - local.get $13 - i32.const 2 - i32.shl - i32.add - local.get $9 - i32.add - local.get $10 - i32.store offset=8 - end - end - end - local.get $8 - i32.const 1 - i32.sub - local.set $8 - br $repeat|0 - unreachable + local.get $7 + i32.store + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 end - unreachable - end - block $break|2 - local.get $2 - i32.const 1 + local.get $5 + i32.const 4 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 8 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 12 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 8 + i32.sub + local.get $7 + i32.store + local.get $3 + i32.const 24 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 12 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 16 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 20 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 24 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 28 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 24 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 20 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 16 + i32.sub + local.get $7 + i32.store + i32.const 24 + local.get $5 + i32.const 4 + i32.and + i32.add + local.set $6 + local.get $5 + local.get $6 + i32.add + local.set $5 + local.get $3 + local.get $6 i32.sub + local.set $3 + local.get $7 + i64.extend_i32_u + local.get $7 + i64.extend_i32_u + i64.const 32 + i64.shl + i64.or local.set $8 - loop $repeat|2 - local.get $8 - i32.const 2 - i32.ge_s - i32.eqz - br_if $break|2 - block - block $~lib/internal/arraybuffer/LOAD|inlined.28 (result i32) - local.get $0 - local.set $12 - i32.const 0 - local.set $11 - local.get $1 - local.set $5 - local.get $12 - local.get $11 - i32.const 2 - i32.shl - i32.add + block $break|0 + loop $continue|0 + local.get $3 + i32.const 32 + i32.ge_u + if local.get $5 + local.get $8 + i64.store + local.get $5 + i32.const 8 i32.add - i32.load offset=8 - end - local.set $5 - block $~lib/internal/arraybuffer/STORE|inlined.14 - local.get $0 - local.set $11 - i32.const 0 - local.set $12 - block $~lib/internal/arraybuffer/LOAD|inlined.29 (result i32) - local.get $0 - local.set $7 - local.get $8 - local.set $9 - local.get $1 - local.set $10 - local.get $7 - local.get $9 - i32.const 2 - i32.shl - i32.add - local.get $10 - i32.add - i32.load offset=8 - end - local.set $10 - local.get $1 - local.set $9 - local.get $11 - local.get $12 - i32.const 2 - i32.shl - i32.add - local.get $9 + local.get $8 + i64.store + local.get $5 + i32.const 16 i32.add - local.get $10 - i32.store offset=8 - end - block $~lib/internal/arraybuffer/STORE|inlined.15 - local.get $0 - local.set $9 local.get $8 - local.set $10 + i64.store local.get $5 - local.set $12 - local.get $1 - local.set $11 - local.get $9 - local.get $10 - i32.const 2 - i32.shl + i32.const 24 i32.add - local.get $11 + local.get $8 + i64.store + local.get $3 + i32.const 32 + i32.sub + local.set $3 + local.get $5 + i32.const 32 i32.add - local.get $12 - i32.store offset=8 - end - i32.const 1 - local.set $11 - block $break|3 - loop $continue|3 - local.get $11 - i32.const 1 - i32.shl - local.get $6 - local.get $11 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - i32.load - local.get $11 - i32.const 31 - i32.and - i32.shr_u - i32.const 1 - i32.and - i32.add - local.tee $12 - local.get $8 - i32.lt_s - if - local.get $12 - local.set $11 - br $continue|3 - end - end - end - block $break|4 - loop $continue|4 - local.get $11 - i32.const 0 - i32.gt_s - if - block - block $~lib/internal/arraybuffer/LOAD|inlined.30 (result i32) - local.get $0 - local.set $10 - i32.const 0 - local.set $9 - local.get $1 - local.set $7 - local.get $10 - local.get $9 - i32.const 2 - i32.shl - i32.add - local.get $7 - i32.add - i32.load offset=8 - end - local.set $5 - block $~lib/internal/arraybuffer/LOAD|inlined.31 (result i32) - local.get $0 - local.set $7 - local.get $11 - local.set $9 - local.get $1 - local.set $10 - local.get $7 - local.get $9 - i32.const 2 - i32.shl - i32.add - local.get $10 - i32.add - i32.load offset=8 - end - local.set $10 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $5 - local.get $10 - local.get $3 - call_indirect (type $FUNCSIG$iii) - end - i32.const 0 - i32.lt_s - if - local.get $6 - local.get $11 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - local.get $6 - local.get $11 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - i32.load - i32.const 1 - local.get $11 - i32.const 31 - i32.and - i32.shl - i32.xor - i32.store - block $~lib/internal/arraybuffer/STORE|inlined.16 - local.get $0 - local.set $9 - local.get $11 - local.set $7 - local.get $5 - local.set $13 - local.get $1 - local.set $14 - local.get $9 - local.get $7 - i32.const 2 - i32.shl - i32.add - local.get $14 - i32.add - local.get $13 - i32.store offset=8 - end - block $~lib/internal/arraybuffer/STORE|inlined.17 - local.get $0 - local.set $14 - i32.const 0 - local.set $13 - local.get $10 - local.set $7 - local.get $1 - local.set $9 - local.get $14 - local.get $13 - i32.const 2 - i32.shl - i32.add - local.get $9 - i32.add - local.get $7 - i32.store offset=8 - end - end - local.get $11 - i32.const 1 - i32.shr_s - local.set $11 - end - br $continue|4 - end - end + local.set $5 + br $continue|0 end end - local.get $8 + end + end + ) + (func $~lib/array/Array#fill (; 39 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=12 + local.set $5 + local.get $2 + i32.const 0 + i32.lt_s + if (result i32) + local.get $5 + local.get $2 + i32.add + local.tee $6 + i32.const 0 + local.tee $7 + local.get $6 + local.get $7 + i32.gt_s + select + else + local.get $2 + local.tee $6 + local.get $5 + local.tee $7 + local.get $6 + local.get $7 + i32.lt_s + select + end + local.set $2 + local.get $3 + i32.const 0 + i32.lt_s + if (result i32) + local.get $5 + local.get $3 + i32.add + local.tee $6 + i32.const 0 + local.tee $7 + local.get $6 + local.get $7 + i32.gt_s + select + else + local.get $3 + local.tee $6 + local.get $5 + local.tee $7 + local.get $6 + local.get $7 + i32.lt_s + select + end + local.set $3 + local.get $2 + local.get $3 + i32.lt_s + if + local.get $4 + local.get $2 + i32.add + local.get $1 + local.get $3 + local.get $2 + i32.sub + call $~lib/memory/memory.fill + end + local.get $0 + call $~lib/rt/pure/__retain + ) + (func $~lib/array/Array#get:length (; 40 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=12 + ) + (func $~lib/array/Array#__unchecked_get (; 41 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 0 + i32.shl + i32.add + i32.load8_u + ) + (func $~lib/array/Array#__get (; 42 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 0 + i32.shr_u + i32.ge_u + if + i32.const 280 + i32.const 488 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/array/Array#__unchecked_get + ) + (func $std/array/isArraysEqual (; 43 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $2 + i32.eqz + if + local.get $0 + call $~lib/array/Array#get:length + local.set $2 + local.get $2 + local.get $1 + call $~lib/array/Array#get:length + i32.ne + if + i32.const 0 + local.set $3 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + return + end + local.get $0 + local.get $1 + i32.eq + if + i32.const 1 + local.set $3 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + return + end + end + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 + local.get $2 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $0 + local.get $3 + call $~lib/array/Array#__get + local.get $1 + local.get $3 + call $~lib/array/Array#__get + i32.ne + if + i32.const 0 + local.set $4 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $4 + return + end + local.get $3 i32.const 1 - i32.sub - local.set $8 - br $repeat|2 + i32.add + local.set $3 + br $repeat|0 unreachable end unreachable end - block $~lib/memory/memory.free|inlined.3 + i32.const 1 + local.set $3 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $~lib/array/Array#fill (; 44 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=12 + local.set $5 + local.get $2 + i32.const 0 + i32.lt_s + if (result i32) + local.get $5 + local.get $2 + i32.add + local.tee $6 + i32.const 0 + local.tee $7 local.get $6 - local.set $8 - local.get $8 - call $~lib/allocator/arena/__memory_free - br $~lib/memory/memory.free|inlined.3 + local.get $7 + i32.gt_s + select + else + local.get $2 + local.tee $6 + local.get $5 + local.tee $7 + local.get $6 + local.get $7 + i32.lt_s + select end - block $~lib/internal/arraybuffer/LOAD|inlined.32 (result i32) - local.get $0 - local.set $8 - i32.const 1 - local.set $12 - local.get $1 - local.set $11 - local.get $8 - local.get $12 - i32.const 2 - i32.shl - i32.add - local.get $11 + local.set $2 + local.get $3 + i32.const 0 + i32.lt_s + if (result i32) + local.get $5 + local.get $3 i32.add - i32.load offset=8 + local.tee $6 + i32.const 0 + local.tee $7 + local.get $6 + local.get $7 + i32.gt_s + select + else + local.get $3 + local.tee $6 + local.get $5 + local.tee $7 + local.get $6 + local.get $7 + i32.lt_s + select end - local.set $15 - block $~lib/internal/arraybuffer/STORE|inlined.18 - local.get $0 - local.set $11 - i32.const 1 - local.set $12 - block $~lib/internal/arraybuffer/LOAD|inlined.33 (result i32) - local.get $0 - local.set $8 - i32.const 0 - local.set $5 - local.get $1 - local.set $10 - local.get $8 - local.get $5 + local.set $3 + block $break|0 + loop $repeat|0 + local.get $2 + local.get $3 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $4 + local.get $2 i32.const 2 i32.shl i32.add - local.get $10 + local.get $1 + i32.store + local.get $2 + i32.const 1 i32.add - i32.load offset=8 + local.set $2 + br $repeat|0 + unreachable end - local.set $10 + unreachable + end + local.get $0 + call $~lib/rt/pure/__retain + ) + (func $~lib/array/Array#get:length (; 45 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=12 + ) + (func $~lib/array/Array#__unchecked_get (; 46 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + i32.load + ) + (func $~lib/array/Array#__get (; 47 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ge_u + if + i32.const 280 + i32.const 488 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/array/Array#__unchecked_get + ) + (func $std/array/isArraysEqual (; 48 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $2 + i32.eqz + if + local.get $0 + call $~lib/array/Array#get:length + local.set $2 + local.get $2 local.get $1 - local.set $5 - local.get $11 - local.get $12 - i32.const 2 - i32.shl - i32.add - local.get $5 - i32.add - local.get $10 - i32.store offset=8 + call $~lib/array/Array#get:length + i32.ne + if + i32.const 0 + local.set $3 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + return + end + local.get $0 + local.get $1 + i32.eq + if + i32.const 1 + local.set $3 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + return + end end - block $~lib/internal/arraybuffer/STORE|inlined.19 - local.get $0 - local.set $5 + block $break|0 i32.const 0 - local.set $10 - local.get $15 - local.set $12 - local.get $1 - local.set $11 - local.get $5 - local.get $10 - i32.const 2 - i32.shl - i32.add - local.get $11 - i32.add - local.get $12 - i32.store offset=8 + local.set $3 + loop $repeat|0 + local.get $3 + local.get $2 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $0 + local.get $3 + call $~lib/array/Array#__get + local.get $1 + local.get $3 + call $~lib/array/Array#__get + i32.ne + if + i32.const 0 + local.set $4 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $4 + return + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end + unreachable end + i32.const 1 + local.set $3 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $~lib/array/Array#get:length (; 49 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=12 + ) + (func $~lib/arraybuffer/ArrayBuffer#get:byteLength (; 50 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 ) - (func $~lib/array/Array#sort (; 121 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/internalCapacity (; 51 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) (local $2 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.load + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength + i32.const 2 + i32.shr_s + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + ) + (func $~lib/rt/tlsf/reallocateBlock (; 52 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) (local $8 i32) - (local $9 i32) + local.get $2 + call $~lib/rt/tlsf/prepareSize + local.set $3 local.get $1 + i32.load + local.set $4 + local.get $4 + i32.const 1 + i32.and + i32.eqz i32.eqz if i32.const 0 - i32.const 8 - i32.const 395 - i32.const 4 - call $~lib/env/abort + i32.const 128 + i32.const 493 + i32.const 13 + call $~lib/builtins/abort unreachable end - local.get $0 - i32.load offset=4 - local.set $2 - local.get $2 - i32.const 1 - i32.le_s + local.get $3 + local.get $4 + i32.const -4 + i32.and + i32.le_u if local.get $0 + local.get $1 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $1 + local.get $2 + i32.store offset=12 + local.get $1 return end - local.get $0 + block $~lib/rt/tlsf/GETRIGHT|inlined.4 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $6 + local.get $6 i32.load - local.set $3 - local.get $2 - i32.const 2 - i32.eq + local.set $7 + local.get $7 + i32.const 1 + i32.and if - block $~lib/internal/arraybuffer/LOAD|inlined.22 (result i32) - local.get $3 - local.set $4 - i32.const 1 - local.set $5 - i32.const 0 - local.set $6 + local.get $4 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $7 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $5 + local.get $5 + local.get $3 + i32.ge_u + if + local.get $0 + local.get $6 + call $~lib/rt/tlsf/removeBlock + local.get $1 local.get $4 + i32.const 3 + i32.and local.get $5 - i32.const 2 - i32.shl - i32.add - local.get $6 - i32.add - i32.load offset=8 - end - local.set $6 - block $~lib/internal/arraybuffer/LOAD|inlined.23 (result i32) + i32.or + i32.store + local.get $1 + local.get $2 + i32.store offset=12 + local.get $0 + local.get $1 local.get $3 - local.set $5 - i32.const 0 - local.set $4 - i32.const 0 - local.set $7 - local.get $5 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $7 - i32.add - i32.load offset=8 - end - local.set $7 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $6 - local.get $7 + call $~lib/rt/tlsf/prepareBlock local.get $1 - call_indirect (type $FUNCSIG$iii) + return end + end + local.get $0 + local.get $2 + call $~lib/rt/tlsf/allocateBlock + local.set $8 + local.get $8 + local.get $1 + i32.load offset=4 + i32.store offset=4 + local.get $8 + local.get $1 + i32.load offset=8 + i32.store offset=8 + local.get $8 + i32.const 16 + i32.add + local.get $1 + i32.const 16 + i32.add + local.get $2 + call $~lib/memory/memory.copy + local.get $1 + local.get $4 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $8 + ) + (func $~lib/rt/tlsf/__realloc (; 53 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if i32.const 0 - i32.lt_s - if - block $~lib/internal/arraybuffer/STORE|inlined.8 - local.get $3 - local.set $4 - i32.const 1 - local.set $5 - local.get $7 - local.set $8 - i32.const 0 - local.set $9 - local.get $4 - local.get $5 - i32.const 2 - i32.shl - i32.add - local.get $9 - i32.add - local.get $8 - i32.store offset=8 - end - block $~lib/internal/arraybuffer/STORE|inlined.9 - local.get $3 - local.set $9 - i32.const 0 - local.set $8 - local.get $6 - local.set $5 - i32.const 0 - local.set $4 - local.get $9 - local.get $8 - i32.const 2 - i32.shl - i32.add - local.get $4 - i32.add - local.get $5 - i32.store offset=8 - end - end + i32.const 128 + i32.const 553 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + i32.ne + if (result i32) local.get $0 - return + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 end - block $~lib/internal/sort/SORT|inlined.0 - local.get $3 - local.set $7 + i32.eqz + if i32.const 0 - local.set $6 + i32.const 128 + i32.const 554 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + local.get $1 + call $~lib/rt/tlsf/reallocateBlock + i32.const 16 + i32.add + ) + (func $~lib/array/ensureSize (; 54 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $0 + i32.load offset=8 + local.set $3 + local.get $1 + local.get $3 + local.get $2 + i32.shr_u + i32.gt_u + if + local.get $1 + i32.const 1073741808 local.get $2 + i32.shr_u + i32.gt_u + if + i32.const 24 + i32.const 488 + i32.const 14 + i32.const 47 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load local.set $4 local.get $1 + local.get $2 + i32.shl local.set $5 local.get $4 - i32.const 256 - i32.lt_s + local.get $5 + call $~lib/rt/tlsf/__realloc + local.set $6 + local.get $6 + local.get $3 + i32.add + i32.const 0 + local.get $5 + local.get $3 + i32.sub + call $~lib/memory/memory.fill + local.get $6 + local.get $4 + i32.ne if - local.get $7 + local.get $0 local.get $6 - local.get $4 - local.get $5 - call $~lib/internal/sort/insertionSort - else - local.get $7 + call $~lib/rt/pure/__retain + i32.store + local.get $0 local.get $6 - local.get $4 - local.get $5 - call $~lib/internal/sort/weakHeapSort + i32.store offset=4 end + local.get $0 + local.get $5 + i32.store offset=8 end + ) + (func $~lib/array/Array#push (; 55 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + i32.load offset=12 + local.set $2 + local.get $2 + i32.const 1 + i32.add + local.set $3 + local.get $0 + local.get $3 + i32.const 2 + call $~lib/array/ensureSize + local.get $0 + i32.load offset=4 + local.get $2 + i32.const 2 + i32.shl + i32.add + local.get $1 + i32.store local.get $0 + local.get $3 + i32.store offset=12 + local.get $3 ) - (func $~lib/internal/sort/COMPARATOR~anonymous|0 (; 122 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__unchecked_get (; 56 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 + i32.load offset=4 local.get $1 - i32.sub + i32.const 2 + i32.shl + i32.add + i32.load ) - (func $~lib/array/Array#sort|trampoline (; 123 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - block $1of1 - block $0of1 - block $outOfRange - global.get $~lib/argc - br_table $0of1 $1of1 $outOfRange - end - unreachable - end - block $~lib/internal/sort/COMPARATOR|inlined.0 (result i32) - i32.const 46 - br $~lib/internal/sort/COMPARATOR|inlined.0 - end - local.set $1 + (func $~lib/array/Array#__get (; 57 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ge_u + if + i32.const 280 + i32.const 488 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort + unreachable end local.get $0 local.get $1 - call $~lib/array/Array#sort + call $~lib/array/Array#__unchecked_get + ) + (func $~lib/array/Array#pop (; 58 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=12 + local.set $1 + local.get $1 + i32.const 1 + i32.lt_s + if + i32.const 872 + i32.const 488 + i32.const 287 + i32.const 20 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 1 + i32.sub + local.tee $1 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $2 + local.get $0 + local.get $1 + i32.store offset=12 + local.get $2 ) - (func $~lib/internal/sort/insertionSort (; 124 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $~lib/array/Array#concat (; 59 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - block $break|0 - i32.const 0 - local.set $4 - loop $repeat|0 - local.get $4 - local.get $2 - i32.lt_s - i32.eqz - br_if $break|0 - block - block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i32) - local.get $0 - local.set $5 - local.get $4 - local.set $6 - local.get $1 - local.set $7 - local.get $5 - local.get $6 - i32.const 2 - i32.shl - i32.add - local.get $7 - i32.add - i32.load offset=8 - end - local.set $7 - local.get $4 - i32.const 1 - i32.sub - local.set $6 - block $break|1 - loop $continue|1 - local.get $6 - i32.const 0 - i32.ge_s - if - block - block $~lib/internal/arraybuffer/LOAD|inlined.4 (result i32) - local.get $0 - local.set $5 - local.get $6 - local.set $8 - local.get $1 - local.set $9 - local.get $5 - local.get $8 - i32.const 2 - i32.shl - i32.add - local.get $9 - i32.add - i32.load offset=8 - end - local.set $9 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $7 - local.get $9 - local.get $3 - call_indirect (type $FUNCSIG$iii) - end - i32.const 0 - i32.lt_s - if - local.get $0 - local.set $8 - block (result i32) - local.get $6 - local.tee $5 - i32.const 1 - i32.sub - local.set $6 - local.get $5 - end - i32.const 1 - i32.add - local.set $5 - local.get $9 - local.set $10 - local.get $1 - local.set $11 - local.get $8 - local.get $5 - i32.const 2 - i32.shl - i32.add - local.get $11 - i32.add - local.get $10 - i32.store offset=8 - else - br $break|1 - end - end - br $continue|1 - end - end - end - block $~lib/internal/arraybuffer/STORE|inlined.4 - local.get $0 - local.set $9 - local.get $6 - i32.const 1 - i32.add - local.set $11 - local.get $7 - local.set $10 - local.get $1 - local.set $5 - local.get $9 - local.get $11 - i32.const 2 - i32.shl - i32.add - local.get $5 - i32.add - local.get $10 - i32.store offset=8 - end - end - local.get $4 - i32.const 1 - i32.add - local.set $4 - br $repeat|0 + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.load offset=12 + local.set $2 + i32.const 0 + local.get $1 + i32.load offset=12 + local.get $1 + i32.const 0 + i32.eq + select + local.set $3 + local.get $2 + local.get $3 + i32.add + local.set $4 + local.get $4 + i32.const 268435452 + i32.gt_u + if + local.get $1 + call $~lib/rt/pure/__release + block + i32.const 24 + i32.const 488 + i32.const 217 + i32.const 59 + call $~lib/builtins/abort + unreachable unreachable end unreachable end + local.get $4 + i32.const 2 + i32.const 3 + i32.const 0 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.set $5 + local.get $5 + i32.load offset=4 + local.set $6 + local.get $2 + i32.const 2 + i32.shl + local.set $7 + local.get $6 + local.get $0 + i32.load offset=4 + local.get $7 + call $~lib/memory/memory.copy + local.get $6 + local.get $7 + i32.add + local.get $1 + i32.load offset=4 + local.get $3 + i32.const 2 + i32.shl + call $~lib/memory/memory.copy + local.get $5 + local.set $8 + local.get $1 + call $~lib/rt/pure/__release + local.get $8 ) - (func $~lib/internal/sort/weakHeapSort (; 125 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $~lib/array/Array#copyWithin (; 60 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) @@ -8472,741 +4712,902 @@ (local $9 i32) (local $10 i32) (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 i32) - local.get $2 - i32.const 31 - i32.add - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl + local.get $0 + i32.load offset=4 local.set $4 - block $~lib/memory/memory.allocate|inlined.4 (result i32) - local.get $4 - local.set $5 + local.get $0 + i32.load offset=12 + local.set $5 + local.get $3 + local.tee $6 + local.get $5 + local.tee $7 + local.get $6 + local.get $7 + i32.lt_s + select + local.set $3 + local.get $1 + i32.const 0 + i32.lt_s + if (result i32) + local.get $5 + local.get $1 + i32.add + local.tee $6 + i32.const 0 + local.tee $7 + local.get $6 + local.get $7 + i32.gt_s + select + else + local.get $1 + local.tee $6 local.get $5 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.4 + local.tee $7 + local.get $6 + local.get $7 + i32.lt_s + select end - local.set $6 - block $~lib/memory/memory.fill|inlined.8 + local.set $8 + local.get $2 + i32.const 0 + i32.lt_s + if (result i32) + local.get $5 + local.get $2 + i32.add + local.tee $6 + i32.const 0 + local.tee $7 local.get $6 - local.set $5 + local.get $7 + i32.gt_s + select + else + local.get $2 + local.tee $6 + local.get $5 + local.tee $7 + local.get $6 + local.get $7 + i32.lt_s + select + end + local.set $9 + local.get $3 + i32.const 0 + i32.lt_s + if (result i32) + local.get $5 + local.get $3 + i32.add + local.tee $6 i32.const 0 - local.set $7 - local.get $4 - local.set $8 + local.tee $7 + local.get $6 + local.get $7 + i32.gt_s + select + else + local.get $3 + local.tee $6 local.get $5 + local.tee $7 + local.get $6 local.get $7 - local.get $8 - call $~lib/internal/memory/memset + i32.lt_s + select end - block $break|0 + local.set $10 + local.get $10 + local.get $9 + i32.sub + local.tee $6 + local.get $5 + local.get $8 + i32.sub + local.tee $7 + local.get $6 + local.get $7 + i32.lt_s + select + local.set $11 + local.get $4 + local.get $8 + i32.const 2 + i32.shl + i32.add + local.get $4 + local.get $9 + i32.const 2 + i32.shl + i32.add + local.get $11 + i32.const 2 + i32.shl + call $~lib/memory/memory.copy + local.get $0 + call $~lib/rt/pure/__retain + ) + (func $std/array/isArraysEqual (; 61 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $2 + i32.eqz + if + local.get $0 + call $~lib/array/Array#get:length + local.set $2 local.get $2 - i32.const 1 - i32.sub - local.set $8 - loop $repeat|0 - local.get $8 + local.get $1 + call $~lib/array/Array#get:length + i32.ne + if i32.const 0 - i32.gt_s - i32.eqz - br_if $break|0 - block - local.get $8 - local.set $7 - block $break|1 - loop $continue|1 - local.get $7 - i32.const 1 - i32.and - local.get $6 - local.get $7 - i32.const 6 - i32.shr_s - i32.const 2 - i32.shl - i32.add - i32.load - local.get $7 - i32.const 1 - i32.shr_s - i32.const 31 - i32.and - i32.shr_u - i32.const 1 - i32.and - i32.eq - if - local.get $7 - i32.const 1 - i32.shr_s - local.set $7 - br $continue|1 - end - end - end - local.get $7 - i32.const 1 - i32.shr_s - local.set $5 - block $~lib/internal/arraybuffer/LOAD|inlined.5 (result i32) - local.get $0 - local.set $9 - local.get $5 - local.set $10 - local.get $1 - local.set $11 - local.get $9 - local.get $10 - i32.const 2 - i32.shl - i32.add - local.get $11 - i32.add - i32.load offset=8 - end - local.set $11 - block $~lib/internal/arraybuffer/LOAD|inlined.6 (result i32) - local.get $0 - local.set $10 - local.get $8 - local.set $9 - local.get $1 - local.set $12 - local.get $10 - local.get $9 - i32.const 2 - i32.shl - i32.add - local.get $12 - i32.add - i32.load offset=8 - end - local.set $12 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $11 - local.get $12 - local.get $3 - call_indirect (type $FUNCSIG$iii) - end + local.set $3 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + return + end + local.get $0 + local.get $1 + i32.eq + if + i32.const 1 + local.set $3 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + return + end + end + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 + local.get $2 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $0 + local.get $3 + call $~lib/array/Array#__get + local.get $1 + local.get $3 + call $~lib/array/Array#__get + i32.ne + if i32.const 0 - i32.lt_s - if - local.get $6 - local.get $8 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - local.get $6 - local.get $8 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - i32.load - i32.const 1 - local.get $8 - i32.const 31 - i32.and - i32.shl - i32.xor - i32.store - block $~lib/internal/arraybuffer/STORE|inlined.5 - local.get $0 - local.set $9 - local.get $8 - local.set $10 - local.get $11 - local.set $13 - local.get $1 - local.set $14 - local.get $9 - local.get $10 - i32.const 2 - i32.shl - i32.add - local.get $14 - i32.add - local.get $13 - i32.store offset=8 - end - block $~lib/internal/arraybuffer/STORE|inlined.6 - local.get $0 - local.set $14 - local.get $5 - local.set $13 - local.get $12 - local.set $10 - local.get $1 - local.set $9 - local.get $14 - local.get $13 - i32.const 2 - i32.shl - i32.add - local.get $9 - i32.add - local.get $10 - i32.store offset=8 - end - end + local.set $4 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $4 + return end - local.get $8 + local.get $3 i32.const 1 - i32.sub - local.set $8 + i32.add + local.set $3 br $repeat|0 unreachable end unreachable end - block $break|2 - local.get $2 + i32.const 1 + local.set $3 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $~lib/array/Array#unshift (; 62 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + i32.load offset=12 + i32.const 1 + i32.add + local.set $2 + local.get $0 + local.get $2 + i32.const 2 + call $~lib/array/ensureSize + local.get $0 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 4 + i32.add + local.get $3 + local.get $2 + i32.const 1 + i32.sub + i32.const 2 + i32.shl + call $~lib/memory/memory.copy + local.get $3 + local.get $1 + i32.store + local.get $0 + local.get $2 + i32.store offset=12 + local.get $2 + ) + (func $~lib/array/Array#shift (; 63 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=12 + local.set $1 + local.get $1 + i32.const 1 + i32.lt_s + if + i32.const 872 + i32.const 488 + i32.const 348 + i32.const 20 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + local.set $2 + local.get $2 + i32.load + local.set $3 + local.get $1 + i32.const 1 + i32.sub + local.set $4 + local.get $2 + local.get $2 + i32.const 4 + i32.add + local.get $4 + i32.const 2 + i32.shl + call $~lib/memory/memory.copy + local.get $2 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.const 0 + i32.store + local.get $0 + local.get $4 + i32.store offset=12 + local.get $3 + ) + (func $~lib/array/Array#reverse (; 64 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=12 + local.set $1 + local.get $1 + if + local.get $0 + i32.load offset=4 + local.set $2 + local.get $0 + i32.load offset=4 + local.get $1 i32.const 1 i32.sub - local.set $8 - loop $repeat|2 - local.get $8 - i32.const 2 - i32.ge_s - i32.eqz - br_if $break|2 - block - block $~lib/internal/arraybuffer/LOAD|inlined.7 (result i32) - local.get $0 - local.set $12 - i32.const 0 - local.set $11 - local.get $1 - local.set $5 - local.get $12 - local.get $11 - i32.const 2 - i32.shl - i32.add - local.get $5 - i32.add - i32.load offset=8 - end - local.set $5 - block $~lib/internal/arraybuffer/STORE|inlined.7 - local.get $0 - local.set $11 - i32.const 0 - local.set $12 - block $~lib/internal/arraybuffer/LOAD|inlined.8 (result i32) - local.get $0 - local.set $7 - local.get $8 - local.set $9 - local.get $1 - local.set $10 - local.get $7 - local.get $9 - i32.const 2 - i32.shl - i32.add - local.get $10 - i32.add - i32.load offset=8 - end - local.set $10 - local.get $1 - local.set $9 - local.get $11 - local.get $12 - i32.const 2 - i32.shl - i32.add - local.get $9 - i32.add - local.get $10 - i32.store offset=8 - end - block $~lib/internal/arraybuffer/STORE|inlined.8 - local.get $0 - local.set $9 - local.get $8 - local.set $10 - local.get $5 - local.set $12 - local.get $1 - local.set $11 - local.get $9 - local.get $10 - i32.const 2 - i32.shl - i32.add - local.get $11 + i32.const 2 + i32.shl + i32.add + local.set $3 + block $break|0 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_u + if + local.get $2 + i32.load + local.set $4 + local.get $2 + local.get $3 + i32.load + i32.store + local.get $3 + local.get $4 + i32.store + local.get $2 + i32.const 4 i32.add - local.get $12 - i32.store offset=8 - end - i32.const 1 - local.set $11 - block $break|3 - loop $continue|3 - local.get $11 - i32.const 1 - i32.shl - local.get $6 - local.get $11 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - i32.load - local.get $11 - i32.const 31 - i32.and - i32.shr_u - i32.const 1 - i32.and - i32.add - local.tee $12 - local.get $8 - i32.lt_s - if - local.get $12 - local.set $11 - br $continue|3 - end - end - end - block $break|4 - loop $continue|4 - local.get $11 - i32.const 0 - i32.gt_s - if - block - block $~lib/internal/arraybuffer/LOAD|inlined.9 (result i32) - local.get $0 - local.set $10 - i32.const 0 - local.set $9 - local.get $1 - local.set $7 - local.get $10 - local.get $9 - i32.const 2 - i32.shl - i32.add - local.get $7 - i32.add - i32.load offset=8 - end - local.set $5 - block $~lib/internal/arraybuffer/LOAD|inlined.10 (result i32) - local.get $0 - local.set $7 - local.get $11 - local.set $9 - local.get $1 - local.set $10 - local.get $7 - local.get $9 - i32.const 2 - i32.shl - i32.add - local.get $10 - i32.add - i32.load offset=8 - end - local.set $10 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $5 - local.get $10 - local.get $3 - call_indirect (type $FUNCSIG$iii) - end - i32.const 0 - i32.lt_s - if - local.get $6 - local.get $11 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - local.get $6 - local.get $11 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - i32.load - i32.const 1 - local.get $11 - i32.const 31 - i32.and - i32.shl - i32.xor - i32.store - block $~lib/internal/arraybuffer/STORE|inlined.9 - local.get $0 - local.set $9 - local.get $11 - local.set $7 - local.get $5 - local.set $13 - local.get $1 - local.set $14 - local.get $9 - local.get $7 - i32.const 2 - i32.shl - i32.add - local.get $14 - i32.add - local.get $13 - i32.store offset=8 - end - block $~lib/internal/arraybuffer/STORE|inlined.10 - local.get $0 - local.set $14 - i32.const 0 - local.set $13 - local.get $10 - local.set $7 - local.get $1 - local.set $9 - local.get $14 - local.get $13 - i32.const 2 - i32.shl - i32.add - local.get $9 - i32.add - local.get $7 - i32.store offset=8 - end - end - local.get $11 - i32.const 1 - i32.shr_s - local.set $11 - end - br $continue|4 - end - end + local.set $2 + local.get $3 + i32.const 4 + i32.sub + local.set $3 + br $continue|0 end end - local.get $8 - i32.const 1 - i32.sub - local.set $8 - br $repeat|2 - unreachable end - unreachable - end - block $~lib/memory/memory.free|inlined.4 - local.get $6 - local.set $8 - local.get $8 - call $~lib/allocator/arena/__memory_free - br $~lib/memory/memory.free|inlined.4 end - block $~lib/internal/arraybuffer/LOAD|inlined.11 (result i32) - local.get $0 - local.set $8 + local.get $0 + call $~lib/rt/pure/__retain + ) + (func $~lib/array/Array#indexOf (; 65 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $0 + i32.load offset=12 + local.set $3 + local.get $3 + i32.const 0 + i32.eq + if (result i32) i32.const 1 - local.set $12 + else + local.get $2 + local.get $3 + i32.ge_s + end + if + i32.const -1 + return + end + local.get $2 + i32.const 0 + i32.lt_s + if + local.get $3 + local.get $2 + i32.add + local.tee $4 + i32.const 0 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $2 + end + local.get $0 + i32.load offset=4 + local.set $6 + block $break|0 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_s + if + local.get $6 + local.get $2 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $1 + i32.eq + if + local.get $2 + return + end + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $continue|0 + end + end + end + i32.const -1 + ) + (func $~lib/array/Array#includes (; 66 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $0 + local.get $1 + local.get $2 + call $~lib/array/Array#indexOf + i32.const 0 + i32.ge_s + ) + (func $~lib/array/Array#splice (; 67 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + local.get $0 + i32.load offset=12 + local.set $3 + local.get $1 + i32.const 0 + i32.lt_s + if (result i32) + local.get $3 local.get $1 - local.set $11 + i32.add + local.tee $4 + i32.const 0 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + else + local.get $1 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.lt_s + select + end + local.set $1 + local.get $2 + local.tee $4 + local.get $3 + local.get $1 + i32.sub + local.tee $5 + local.get $4 + local.get $5 + i32.lt_s + select + local.tee $4 + i32.const 0 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $2 + local.get $2 + i32.const 2 + i32.const 3 + i32.const 0 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.set $6 + local.get $6 + i32.load offset=4 + local.set $7 + local.get $0 + i32.load offset=4 + local.set $8 + local.get $8 + local.get $1 + i32.const 2 + i32.shl + i32.add + local.set $9 + local.get $7 + local.get $9 + local.get $2 + i32.const 2 + i32.shl + call $~lib/memory/memory.copy + local.get $1 + local.get $2 + i32.add + local.set $10 + local.get $3 + local.get $10 + i32.ne + if + local.get $9 local.get $8 - local.get $12 - i32.const 2 - i32.shl - i32.add - local.get $11 - i32.add - i32.load offset=8 - end - local.set $15 - block $~lib/internal/arraybuffer/STORE|inlined.11 - local.get $0 - local.set $11 - i32.const 1 - local.set $12 - block $~lib/internal/arraybuffer/LOAD|inlined.12 (result i32) - local.get $0 - local.set $8 - i32.const 0 - local.set $5 - local.get $1 - local.set $10 - local.get $8 - local.get $5 - i32.const 2 - i32.shl - i32.add - local.get $10 - i32.add - i32.load offset=8 - end - local.set $10 - local.get $1 - local.set $5 - local.get $11 - local.get $12 + local.get $10 i32.const 2 i32.shl i32.add - local.get $5 - i32.add - local.get $10 - i32.store offset=8 - end - block $~lib/internal/arraybuffer/STORE|inlined.12 - local.get $0 - local.set $5 - i32.const 0 - local.set $10 - local.get $15 - local.set $12 - local.get $1 - local.set $11 - local.get $5 + local.get $3 local.get $10 + i32.sub i32.const 2 i32.shl - i32.add - local.get $11 - i32.add - local.get $12 - i32.store offset=8 + call $~lib/memory/memory.copy end + local.get $0 + local.get $3 + local.get $2 + i32.sub + i32.store offset=12 + local.get $6 ) - (func $~lib/array/Array#sort (; 126 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - local.get $1 - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 395 - i32.const 4 - call $~lib/env/abort - unreachable - end + (func $~lib/array/Array#__unchecked_set (; 68 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) local.get $0 i32.load offset=4 - local.set $2 + local.get $1 + i32.const 2 + i32.shl + i32.add local.get $2 + i32.store + ) + (func $~lib/array/Array#__set (; 69 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + local.get $0 + i32.load offset=12 + local.set $3 + local.get $0 + local.get $1 i32.const 1 - i32.le_s + i32.add + i32.const 2 + call $~lib/array/ensureSize + local.get $0 + local.get $1 + local.get $2 + call $~lib/array/Array#__unchecked_set + local.get $1 + local.get $3 + i32.ge_s if local.get $0 - return + local.get $1 + i32.const 1 + i32.add + i32.store offset=12 end + ) + (func $start:std/array~anonymous|0 (; 70 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.load + i32.const 0 + i32.eq local.set $3 local.get $2 - i32.const 2 - i32.eq - if - block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i32) - local.get $3 - local.set $4 - i32.const 1 - local.set $5 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $~lib/array/Array#findIndex (; 71 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + block $break|0 + block i32.const 0 - local.set $6 - local.get $4 - local.get $5 - i32.const 2 - i32.shl - i32.add - local.get $6 - i32.add - i32.load offset=8 + local.set $2 + local.get $0 + i32.load offset=12 + local.set $3 end - local.set $6 - block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i32) + loop $repeat|0 + local.get $2 local.get $3 - local.set $5 - i32.const 0 - local.set $4 - i32.const 0 - local.set $7 - local.get $5 + local.tee $4 + local.get $0 + i32.load offset=12 + local.tee $5 local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $7 + local.get $5 + i32.lt_s + select + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + i32.const 3 + global.set $~lib/argc + local.get $0 + i32.load offset=4 + local.get $2 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $2 + local.get $0 + local.get $1 + call_indirect (type $FUNCSIG$iiii) + end + if + local.get $2 + return + end + local.get $2 + i32.const 1 i32.add - i32.load offset=8 + local.set $2 + br $repeat|0 + unreachable end - local.set $7 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $6 - local.get $7 - local.get $1 - call_indirect (type $FUNCSIG$iii) + unreachable + end + i32.const -1 + ) + (func $start:std/array~anonymous|1 (; 72 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.const 1 + i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $start:std/array~anonymous|2 (; 73 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.const 100 + i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $start:std/array~anonymous|3 (; 74 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + i32.const 100 + call $~lib/array/Array#push + drop + local.get $0 + i32.const 100 + i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $start:std/array~anonymous|4 (; 75 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.const 100 + i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $start:std/array~anonymous|5 (; 76 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/array/Array#pop + drop + local.get $0 + i32.const 100 + i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $start:std/array~anonymous|6 (; 77 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.const 0 + i32.ge_s + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $~lib/array/Array#every (; 78 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + block $break|0 + block + i32.const 0 + local.set $2 + local.get $0 + i32.load offset=12 + local.set $3 end - i32.const 0 - i32.lt_s - if - block $~lib/internal/arraybuffer/STORE|inlined.1 - local.get $3 - local.set $4 - i32.const 1 - local.set $5 - local.get $7 - local.set $8 - i32.const 0 - local.set $9 - local.get $4 - local.get $5 + loop $repeat|0 + local.get $2 + local.get $3 + local.tee $4 + local.get $0 + i32.load offset=12 + local.tee $5 + local.get $4 + local.get $5 + i32.lt_s + select + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + i32.const 3 + global.set $~lib/argc + local.get $0 + i32.load offset=4 + local.get $2 i32.const 2 i32.shl i32.add - local.get $9 - i32.add - local.get $8 - i32.store offset=8 + i32.load + local.get $2 + local.get $0 + local.get $1 + call_indirect (type $FUNCSIG$iiii) end - block $~lib/internal/arraybuffer/STORE|inlined.2 - local.get $3 - local.set $9 - i32.const 0 - local.set $8 - local.get $6 - local.set $5 + i32.const 0 + i32.ne + i32.eqz + if i32.const 0 - local.set $4 - local.get $9 - local.get $8 - i32.const 2 - i32.shl - i32.add - local.get $4 - i32.add - local.get $5 - i32.store offset=8 + return end + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $repeat|0 + unreachable end - local.get $0 - return - end - block $~lib/internal/sort/SORT|inlined.0 - local.get $3 - local.set $7 - i32.const 0 - local.set $6 - local.get $2 - local.set $4 - local.get $1 - local.set $5 - local.get $4 - i32.const 256 - i32.lt_s - if - local.get $7 - local.get $6 - local.get $4 - local.get $5 - call $~lib/internal/sort/insertionSort - else - local.get $7 - local.get $6 - local.get $4 - local.get $5 - call $~lib/internal/sort/weakHeapSort - end + unreachable end + i32.const 1 + ) + (func $start:std/array~anonymous|7 (; 79 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 + i32.const 0 + i32.le_s + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/internal/sort/COMPARATOR~anonymous|0 (; 127 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $start:std/array~anonymous|8 (; 80 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + i32.const 100 + call $~lib/array/Array#push + drop local.get $0 - local.get $1 - i32.gt_u + i32.const 10 + i32.lt_s + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $start:std/array~anonymous|9 (; 81 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - local.get $1 - i32.lt_u - i32.sub + i32.const 10 + i32.lt_s + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/array/Array#sort|trampoline (; 128 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - block $1of1 - block $0of1 - block $outOfRange - global.get $~lib/argc - br_table $0of1 $1of1 $outOfRange - end - unreachable - end - block $~lib/internal/sort/COMPARATOR|inlined.0 (result i32) - i32.const 47 - br $~lib/internal/sort/COMPARATOR|inlined.0 - end - local.set $1 - end + (func $start:std/array~anonymous|10 (; 82 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/array/Array#pop + drop local.get $0 - local.get $1 - call $~lib/array/Array#sort + i32.const 3 + i32.lt_s + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $std/array/createReverseOrderedArray (; 129 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) + (func $start:std/array~anonymous|11 (; 83 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - i32.const 0 + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - call $~lib/array/Array#constructor - local.set $1 + i32.const 3 + i32.ge_s + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $~lib/array/Array#some (; 84 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) block $break|0 - i32.const 0 - local.set $2 + block + i32.const 0 + local.set $2 + local.get $0 + i32.load offset=12 + local.set $3 + end loop $repeat|0 local.get $2 - block $~lib/array/Array#get:length|inlined.43 (result i32) - local.get $1 - local.set $3 - local.get $3 - i32.load offset=4 - end + local.get $3 + local.tee $4 + local.get $0 + i32.load offset=12 + local.tee $5 + local.get $4 + local.get $5 + i32.lt_s + select i32.lt_s i32.eqz br_if $break|0 - local.get $1 - local.get $2 - block $~lib/array/Array#get:length|inlined.44 (result i32) - local.get $1 - local.set $3 - local.get $3 + block (result i32) + i32.const 3 + global.set $~lib/argc + local.get $0 i32.load offset=4 + local.get $2 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $2 + local.get $0 + local.get $1 + call_indirect (type $FUNCSIG$iiii) + end + if + i32.const 1 + return end - i32.const 1 - i32.sub - local.get $2 - i32.sub - call $~lib/array/Array#__set local.get $2 i32.const 1 i32.add @@ -9216,100 +5617,118 @@ end unreachable end - local.get $1 + i32.const 0 ) - (func $~lib/math/NativeMath.random (; 130 ;) (type $FUNCSIG$d) (result f64) - (local $0 i64) - (local $1 i64) - (local $2 i64) - global.get $~lib/math/random_seeded - i32.eqz - if - i32.const 0 - i32.const 2896 - i32.const 987 - i32.const 24 - call $~lib/env/abort - unreachable - end - global.get $~lib/math/random_state0_64 - local.set $0 - global.get $~lib/math/random_state1_64 - local.set $1 - local.get $1 - global.set $~lib/math/random_state0_64 - local.get $0 - local.get $0 - i64.const 23 - i64.shl - i64.xor - local.set $0 - local.get $0 + (func $start:std/array~anonymous|12 (; 85 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i64.const 17 - i64.shr_u - i64.xor - local.set $0 + i32.const -1 + i32.le_s + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $start:std/array~anonymous|13 (; 86 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + i32.const 100 + call $~lib/array/Array#push + drop local.get $0 - local.get $1 - i64.xor - local.set $0 + i32.const 10 + i32.gt_s + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $start:std/array~anonymous|14 (; 87 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - local.get $1 - i64.const 26 - i64.shr_u - i64.xor - local.set $0 + i32.const 10 + i32.gt_s + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $start:std/array~anonymous|15 (; 88 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/array/Array#pop + drop local.get $0 - global.set $~lib/math/random_state1_64 - local.get $1 + i32.const 3 + i32.gt_s + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $start:std/array~anonymous|16 (; 89 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + global.get $std/array/i local.get $0 - i64.add - i64.const 4503599627370495 - i64.and - i64.const 4607182418800017408 - i64.or - local.set $2 + i32.add + global.set $std/array/i local.get $2 - f64.reinterpret_i64 - f64.const 1 - f64.sub + call $~lib/rt/pure/__release ) - (func $std/array/createRandomOrderedArray (; 131 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/array/Array#forEach (; 90 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) - i32.const 0 - local.get $0 - call $~lib/array/Array#constructor - local.set $1 + (local $4 i32) + (local $5 i32) block $break|0 - i32.const 0 - local.set $2 + block + i32.const 0 + local.set $2 + local.get $0 + i32.load offset=12 + local.set $3 + end loop $repeat|0 local.get $2 - block $~lib/array/Array#get:length|inlined.46 (result i32) - local.get $1 - local.set $3 - local.get $3 - i32.load offset=4 - end + local.get $3 + local.tee $4 + local.get $0 + i32.load offset=12 + local.tee $5 + local.get $4 + local.get $5 + i32.lt_s + select i32.lt_s i32.eqz br_if $break|0 - local.get $1 + i32.const 3 + global.set $~lib/argc + local.get $0 + i32.load offset=4 local.get $2 - call $~lib/math/NativeMath.random - block $~lib/array/Array#get:length|inlined.47 (result i32) - local.get $1 - local.set $3 - local.get $3 - i32.load offset=4 - end - f64.convert_i32_s - f64.mul - i32.trunc_f64_s - call $~lib/array/Array#__set + i32.const 2 + i32.shl + i32.add + i32.load + local.get $2 + local.get $0 + local.get $1 + call_indirect (type $FUNCSIG$viii) local.get $2 i32.const 1 i32.add @@ -9319,1863 +5738,1611 @@ end unreachable end - local.get $1 ) - (func $~lib/internal/sort/COMPARATOR~anonymous|1 (; 132 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $start:std/array~anonymous|17 (; 91 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + i32.const 100 + call $~lib/array/Array#push + drop + global.get $std/array/i + local.get $0 + i32.add + global.set $std/array/i + local.get $2 + call $~lib/rt/pure/__release + ) + (func $start:std/array~anonymous|18 (; 92 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + global.get $std/array/i local.get $0 - local.get $1 - i32.sub + i32.add + global.set $std/array/i + local.get $2 + call $~lib/rt/pure/__release ) - (func $std/array/isSorted (; 133 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) + (func $start:std/array~anonymous|19 (; 93 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/array/Array#pop + drop + global.get $std/array/i + local.get $0 + i32.add + global.set $std/array/i + local.get $2 + call $~lib/rt/pure/__release + ) + (func $start:std/array~anonymous|20 (; 94 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - block $break|0 - block - i32.const 1 - local.set $2 - block $~lib/array/Array#get:length|inlined.48 (result i32) - local.get $0 - local.set $3 + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $1 + i32.const 0 + i32.eq + if + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 local.get $3 - i32.load offset=4 + i32.const 4 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $2 + call $~lib/array/Array#pop + drop + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable end - local.set $3 + unreachable end - loop $repeat|0 - local.get $2 - local.get $3 - i32.lt_s - i32.eqz - br_if $break|0 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $0 + block $break|1 + i32.const 0 + local.set $3 + loop $repeat|1 + local.get $3 + i32.const 100 + i32.lt_s + i32.eqz + br_if $break|1 local.get $2 + i32.const 100 + local.get $3 + i32.add + call $~lib/array/Array#push + drop + local.get $3 i32.const 1 - i32.sub - call $~lib/array/Array#__get - local.get $0 + i32.add + local.set $3 + br $repeat|1 + unreachable + end + unreachable + end + block $break|2 + i32.const 0 + local.set $3 + loop $repeat|2 + local.get $3 + i32.const 100 + i32.lt_s + i32.eqz + br_if $break|2 local.get $2 - call $~lib/array/Array#__get - local.get $1 - call_indirect (type $FUNCSIG$iii) + call $~lib/array/Array#pop + drop + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|2 + unreachable end + unreachable + end + block $break|3 i32.const 0 - i32.gt_s - if - i32.const 0 - return + local.set $3 + loop $repeat|3 + local.get $3 + i32.const 100 + i32.lt_s + i32.eqz + br_if $break|3 + local.get $2 + local.get $3 + i32.const 200 + i32.add + call $~lib/array/Array#push + drop + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|3 + unreachable end - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $repeat|0 unreachable end - unreachable - end - i32.const 1 - ) - (func $std/array/assertSorted (; 134 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - call $~lib/array/Array#sort - local.get $1 - call $std/array/isSorted - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 810 - i32.const 2 - call $~lib/env/abort - unreachable - end - ) - (func $std/array/assertSortedDefault (; 135 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 - block $~lib/internal/sort/COMPARATOR|inlined.1 (result i32) - i32.const 48 - br $~lib/internal/sort/COMPARATOR|inlined.1 - end - call $std/array/assertSorted - ) - (func $start:std/array~anonymous|43 (; 136 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 - local.get $1 - i32.sub - ) - (func $start:std/array~anonymous|44 (; 137 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $1 - local.get $0 - i32.sub - ) - (func $start:std/array~anonymous|45 (; 138 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 - local.get $1 - i32.sub - ) - (func $start:std/array~anonymous|46 (; 139 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $1 - local.get $0 - i32.sub - ) - (func $~lib/array/Array<~lib/array/Array>#constructor (; 140 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $1 - i32.const 268435454 - i32.gt_u - if - i32.const 0 - i32.const 8 - i32.const 45 - i32.const 39 - call $~lib/env/abort - unreachable end local.get $1 i32.const 2 - i32.shl - local.set $2 - local.get $2 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $3 - block (result i32) + i32.eq + if local.get $0 + i32.const 202 + i32.eq i32.eqz if - i32.const 8 - call $~lib/memory/memory.allocate - local.set $0 + i32.const 0 + i32.const 376 + i32.const 568 + i32.const 6 + call $~lib/builtins/abort + unreachable end - local.get $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - end - local.get $3 - i32.store - local.get $0 - local.get $1 - i32.store offset=4 - block $~lib/memory/memory.fill|inlined.9 - local.get $3 - i32.const 8 - i32.add - local.set $4 - i32.const 0 - local.set $5 - local.get $2 - local.set $6 - local.get $4 - local.get $5 - local.get $6 - call $~lib/internal/memory/memset end - local.get $0 + local.get $2 + call $~lib/rt/pure/__release ) - (func $~lib/array/Array<~lib/array/Array>#__set (; 141 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) + (func $start:std/array~anonymous|21 (; 95 ;) (type $FUNCSIG$fiii) (param $0 i32) (param $1 i32) (param $2 i32) (result f32) + (local $3 f32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.load + f32.convert_i32_s local.set $3 + local.get $2 + call $~lib/rt/pure/__release local.get $3 - i32.load - i32.const 2 - i32.shr_u - local.set $4 - local.get $1 - local.get $4 - i32.ge_u - if - local.get $1 - i32.const 268435454 - i32.ge_u - if - i32.const 0 - i32.const 8 - i32.const 107 - i32.const 41 - call $~lib/env/abort - unreachable - end - local.get $3 - local.get $1 - i32.const 1 - i32.add - i32.const 2 - i32.shl - call $~lib/internal/arraybuffer/reallocateUnsafe - local.set $3 - local.get $0 - local.get $3 - i32.store - local.get $0 - local.get $1 - i32.const 1 - i32.add - i32.store offset=4 - end - block $~lib/internal/arraybuffer/STORE<~lib/array/Array,~lib/array/Array>|inlined.0 - local.get $3 - local.set $5 - local.get $1 - local.set $6 - local.get $2 - local.set $7 - i32.const 0 - local.set $8 - local.get $5 - local.get $6 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.add - local.get $7 - i32.store offset=8 - end ) - (func $~lib/array/Array<~lib/array/Array>#__get (; 142 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#map (; 96 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 f32) local.get $0 - i32.load + i32.load offset=12 local.set $2 - local.get $1 local.get $2 - i32.load i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $2 - local.set $3 - local.get $1 - local.set $4 - i32.const 0 - local.set $5 - local.get $3 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $5 - i32.add - i32.load offset=8 - else - unreachable - end - ) - (func $std/array/createReverseOrderedNestedArray (; 143 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) + i32.const 8 i32.const 0 - local.get $0 - call $~lib/array/Array<~lib/array/Array>#constructor - local.set $1 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.set $3 + local.get $3 + i32.load offset=4 + local.set $4 block $break|0 i32.const 0 - local.set $2 + local.set $5 loop $repeat|0 + local.get $5 local.get $2 - block $~lib/array/Array<~lib/array/Array>#get:length|inlined.1 (result i32) - local.get $1 - local.set $3 - local.get $3 - i32.load offset=4 - end + local.tee $6 + local.get $0 + i32.load offset=12 + local.tee $7 + local.get $6 + local.get $7 + i32.lt_s + select i32.lt_s i32.eqz br_if $break|0 - block - local.get $1 - local.get $2 - i32.const 0 - i32.const 1 - call $~lib/array/Array#constructor - call $~lib/array/Array<~lib/array/Array>#__set + block (result f32) + i32.const 3 + global.set $~lib/argc + local.get $0 + i32.load offset=4 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $5 + local.get $0 local.get $1 - local.get $2 - call $~lib/array/Array<~lib/array/Array>#__get - i32.const 0 - block $~lib/array/Array<~lib/array/Array>#get:length|inlined.2 (result i32) - local.get $1 - local.set $3 - local.get $3 - i32.load offset=4 - end - i32.const 1 - i32.sub - local.get $2 - i32.sub - call $~lib/array/Array#__set + call_indirect (type $FUNCSIG$fiii) end - local.get $2 + local.set $8 + local.get $4 + local.get $5 + i32.const 2 + i32.shl + i32.add + local.get $8 + f32.store + local.get $5 i32.const 1 i32.add - local.set $2 + local.set $5 br $repeat|0 unreachable end unreachable end + local.get $3 + ) + (func $~lib/array/Array#get:length (; 97 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=12 + ) + (func $~lib/array/Array#__unchecked_get (; 98 ;) (type $FUNCSIG$fii) (param $0 i32) (param $1 i32) (result f32) + local.get $0 + i32.load offset=4 local.get $1 + i32.const 2 + i32.shl + i32.add + f32.load ) - (func $start:std/array~anonymous|47 (; 144 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__get (; 99 ;) (type $FUNCSIG$fii) (param $0 i32) (param $1 i32) (result f32) + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ge_u + if + i32.const 280 + i32.const 488 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort + unreachable + end local.get $0 - i32.const 0 - call $~lib/array/Array#__get local.get $1 - i32.const 0 - call $~lib/array/Array#__get - i32.sub + call $~lib/array/Array#__unchecked_get + ) + (func $start:std/array~anonymous|22 (; 100 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + i32.const 100 + call $~lib/array/Array#push + drop + global.get $std/array/i + local.get $0 + i32.add + global.set $std/array/i + local.get $0 + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/internal/sort/insertionSort<~lib/array/Array> (; 145 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $~lib/array/Array#map (; 101 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) + local.get $0 + i32.load offset=12 + local.set $2 + local.get $2 + i32.const 2 + i32.const 3 + i32.const 0 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.set $3 + local.get $3 + i32.load offset=4 + local.set $4 block $break|0 i32.const 0 - local.set $4 + local.set $5 loop $repeat|0 - local.get $4 + local.get $5 local.get $2 + local.tee $6 + local.get $0 + i32.load offset=12 + local.tee $7 + local.get $6 + local.get $7 + i32.lt_s + select i32.lt_s i32.eqz br_if $break|0 - block - block $~lib/internal/arraybuffer/LOAD<~lib/array/Array,~lib/array/Array>|inlined.3 (result i32) - local.get $0 - local.set $5 - local.get $4 - local.set $6 - local.get $1 - local.set $7 - local.get $5 - local.get $6 - i32.const 2 - i32.shl - i32.add - local.get $7 - i32.add - i32.load offset=8 - end - local.set $7 - local.get $4 - i32.const 1 - i32.sub - local.set $6 - block $break|1 - loop $continue|1 - local.get $6 - i32.const 0 - i32.ge_s - if - block - block $~lib/internal/arraybuffer/LOAD<~lib/array/Array,~lib/array/Array>|inlined.4 (result i32) - local.get $0 - local.set $5 - local.get $6 - local.set $8 - local.get $1 - local.set $9 - local.get $5 - local.get $8 - i32.const 2 - i32.shl - i32.add - local.get $9 - i32.add - i32.load offset=8 - end - local.set $9 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $7 - local.get $9 - local.get $3 - call_indirect (type $FUNCSIG$iii) - end - i32.const 0 - i32.lt_s - if - local.get $0 - local.set $8 - block (result i32) - local.get $6 - local.tee $5 - i32.const 1 - i32.sub - local.set $6 - local.get $5 - end - i32.const 1 - i32.add - local.set $5 - local.get $9 - local.set $10 - local.get $1 - local.set $11 - local.get $8 - local.get $5 - i32.const 2 - i32.shl - i32.add - local.get $11 - i32.add - local.get $10 - i32.store offset=8 - else - br $break|1 - end - end - br $continue|1 - end - end - end - block $~lib/internal/arraybuffer/STORE<~lib/array/Array,~lib/array/Array>|inlined.4 - local.get $0 - local.set $9 - local.get $6 - i32.const 1 - i32.add - local.set $11 - local.get $7 - local.set $10 - local.get $1 - local.set $5 - local.get $9 - local.get $11 - i32.const 2 - i32.shl - i32.add - local.get $5 - i32.add - local.get $10 - i32.store offset=8 - end + block (result i32) + i32.const 3 + global.set $~lib/argc + local.get $0 + i32.load offset=4 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $5 + local.get $0 + local.get $1 + call_indirect (type $FUNCSIG$iiii) end + local.set $6 local.get $4 + local.get $5 + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store + local.get $5 i32.const 1 i32.add - local.set $4 + local.set $5 br $repeat|0 unreachable end unreachable end + local.get $3 + ) + (func $start:std/array~anonymous|23 (; 102 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + global.get $std/array/i + local.get $0 + i32.add + global.set $std/array/i + local.get $0 + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $start:std/array~anonymous|24 (; 103 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/array/Array#pop + drop + global.get $std/array/i + local.get $0 + i32.add + global.set $std/array/i + local.get $0 + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $start:std/array~anonymous|25 (; 104 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.const 2 + i32.ge_s + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/array/Array<~lib/array/Array>#sort (; 146 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#filter (; 105 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - local.get $1 - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 395 - i32.const 4 - call $~lib/env/abort + i32.const 0 + i32.const 2 + i32.const 3 + i32.const 0 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.set $2 + block $break|0 + block + i32.const 0 + local.set $3 + local.get $0 + i32.load offset=12 + local.set $4 + end + loop $repeat|0 + local.get $3 + local.get $4 + local.tee $5 + local.get $0 + i32.load offset=12 + local.tee $6 + local.get $5 + local.get $6 + i32.lt_s + select + i32.lt_s + i32.eqz + br_if $break|0 + local.get $0 + i32.load offset=4 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $5 + block (result i32) + i32.const 3 + global.set $~lib/argc + local.get $5 + local.get $3 + local.get $0 + local.get $1 + call_indirect (type $FUNCSIG$iiii) + end + if + local.get $2 + local.get $5 + call $~lib/array/Array#push + drop + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end unreachable end + local.get $2 + ) + (func $start:std/array~anonymous|26 (; 106 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + i32.const 100 + call $~lib/array/Array#push + drop + global.get $std/array/i local.get $0 - i32.load offset=4 - local.set $2 + i32.add + global.set $std/array/i + local.get $0 + i32.const 2 + i32.ge_s + local.set $3 local.get $2 - i32.const 1 - i32.le_s - if - local.get $0 - return - end + call $~lib/rt/pure/__release + local.get $3 + ) + (func $start:std/array~anonymous|27 (; 107 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + global.get $std/array/i local.get $0 - i32.load + i32.add + global.set $std/array/i + local.get $0 + i32.const 2 + i32.ge_s local.set $3 local.get $2 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $start:std/array~anonymous|28 (; 108 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/array/Array#pop + drop + global.get $std/array/i + local.get $0 + i32.add + global.set $std/array/i + local.get $0 i32.const 2 - i32.eq - if - block $~lib/internal/arraybuffer/LOAD<~lib/array/Array,~lib/array/Array>|inlined.1 (result i32) - local.get $3 + i32.ge_s + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $start:std/array~anonymous|29 (; 109 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + i32.add + local.set $4 + local.get $3 + call $~lib/rt/pure/__release + local.get $4 + ) + (func $~lib/array/Array#reduce (; 110 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + local.get $2 + local.set $3 + block $break|0 + block + i32.const 0 local.set $4 - i32.const 1 + local.get $0 + i32.load offset=12 local.set $5 - i32.const 0 - local.set $6 - local.get $4 - local.get $5 - i32.const 2 - i32.shl - i32.add - local.get $6 - i32.add - i32.load offset=8 end - local.set $6 - block $~lib/internal/arraybuffer/LOAD<~lib/array/Array,~lib/array/Array>|inlined.2 (result i32) - local.get $3 - local.set $5 - i32.const 0 - local.set $4 - i32.const 0 - local.set $7 - local.get $5 + loop $repeat|0 local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $7 - i32.add - i32.load offset=8 - end - local.set $7 - block (result i32) - i32.const 2 - global.set $~lib/argc + local.get $5 + local.tee $6 + local.get $0 + i32.load offset=12 + local.tee $7 local.get $6 local.get $7 - local.get $1 - call_indirect (type $FUNCSIG$iii) - end - i32.const 0 - i32.lt_s - if - block $~lib/internal/arraybuffer/STORE<~lib/array/Array,~lib/array/Array>|inlined.1 + i32.lt_s + select + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + i32.const 4 + global.set $~lib/argc local.get $3 - local.set $4 - i32.const 1 - local.set $5 - local.get $7 - local.set $8 - i32.const 0 - local.set $9 + local.get $0 + i32.load offset=4 local.get $4 - local.get $5 - i32.const 2 - i32.shl - i32.add - local.get $9 - i32.add - local.get $8 - i32.store offset=8 - end - block $~lib/internal/arraybuffer/STORE<~lib/array/Array,~lib/array/Array>|inlined.2 - local.get $3 - local.set $9 - i32.const 0 - local.set $8 - local.get $6 - local.set $5 - i32.const 0 - local.set $4 - local.get $9 - local.get $8 i32.const 2 i32.shl i32.add + i32.load local.get $4 - i32.add - local.get $5 - i32.store offset=8 + local.get $0 + local.get $1 + call_indirect (type $FUNCSIG$iiiii) end + local.set $3 + local.get $4 + i32.const 1 + i32.add + local.set $4 + br $repeat|0 + unreachable end - local.get $0 - return + unreachable end - block $~lib/internal/sort/SORT<~lib/array/Array>|inlined.0 - local.get $3 - local.set $7 - i32.const 0 - local.set $6 - local.get $2 - local.set $4 + local.get $3 + ) + (func $start:std/array~anonymous|30 (; 111 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + i32.add + local.set $4 + local.get $3 + call $~lib/rt/pure/__release + local.get $4 + ) + (func $start:std/array~anonymous|31 (; 112 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $0 + if (result i32) + i32.const 1 + else local.get $1 - local.set $5 - local.get $7 - local.get $6 - local.get $4 - local.get $5 - call $~lib/internal/sort/insertionSort<~lib/array/Array> + i32.const 2 + i32.gt_s end - local.get $0 + local.set $4 + local.get $3 + call $~lib/rt/pure/__release + local.get $4 ) - (func $std/array/isSorted<~lib/array/Array> (; 147 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) + (func $~lib/array/Array#reduce (; 113 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + local.get $2 + local.set $3 block $break|0 block - i32.const 1 - local.set $2 - block $~lib/array/Array<~lib/array/Array>#get:length|inlined.3 (result i32) - local.get $0 - local.set $3 - local.get $3 - i32.load offset=4 - end - local.set $3 + i32.const 0 + local.set $4 + local.get $0 + i32.load offset=12 + local.set $5 end loop $repeat|0 - local.get $2 - local.get $3 + local.get $4 + local.get $5 + local.tee $6 + local.get $0 + i32.load offset=12 + local.tee $7 + local.get $6 + local.get $7 + i32.lt_s + select i32.lt_s i32.eqz br_if $break|0 block (result i32) - i32.const 2 + i32.const 4 global.set $~lib/argc + local.get $3 local.get $0 - local.get $2 - i32.const 1 - i32.sub - call $~lib/array/Array<~lib/array/Array>#__get + i32.load offset=4 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $4 local.get $0 - local.get $2 - call $~lib/array/Array<~lib/array/Array>#__get local.get $1 - call_indirect (type $FUNCSIG$iii) - end - i32.const 0 - i32.gt_s - if - i32.const 0 - return + call_indirect (type $FUNCSIG$iiiii) end - local.get $2 + local.set $3 + local.get $4 i32.const 1 i32.add - local.set $2 + local.set $4 br $repeat|0 unreachable end unreachable end - i32.const 1 + local.get $3 ) - (func $std/array/assertSorted<~lib/array/Array> (; 148 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $start:std/array~anonymous|32 (; 114 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/pure/__retain + drop local.get $0 - local.get $1 - call $~lib/array/Array<~lib/array/Array>#sort - local.get $1 - call $std/array/isSorted<~lib/array/Array> - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 810 - i32.const 2 - call $~lib/env/abort - unreachable + if (result i32) + i32.const 1 + else + local.get $1 + i32.const 100 + i32.gt_s end + local.set $4 + local.get $3 + call $~lib/rt/pure/__release + local.get $4 ) - (func $~lib/array/Array>#constructor (; 149 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) + (func $start:std/array~anonymous|33 (; 115 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $1 - i32.const 268435454 - i32.gt_u - if - i32.const 0 - i32.const 8 - i32.const 45 - i32.const 39 - call $~lib/env/abort - unreachable - end - local.get $1 - i32.const 2 - i32.shl - local.set $2 - local.get $2 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $3 - block (result i32) - local.get $0 - i32.eqz - if - i32.const 8 - call $~lib/memory/memory.allocate - local.set $0 - end - local.get $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - end local.get $3 - i32.store + call $~lib/rt/pure/__retain + drop + local.get $3 + i32.const 1 + call $~lib/array/Array#push + drop local.get $0 local.get $1 - i32.store offset=4 - block $~lib/memory/memory.fill|inlined.10 - local.get $3 - i32.const 8 - i32.add - local.set $4 - i32.const 0 - local.set $5 - local.get $2 - local.set $6 - local.get $4 - local.get $5 - local.get $6 - call $~lib/internal/memory/memset - end - local.get $0 + i32.add + local.set $4 + local.get $3 + call $~lib/rt/pure/__release + local.get $4 ) - (func $std/array/Proxy#constructor (; 150 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 - i32.eqz - if - i32.const 4 - call $~lib/memory/memory.allocate - local.set $0 - end + (func $start:std/array~anonymous|34 (; 116 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/pure/__retain + drop local.get $0 local.get $1 - i32.store - local.get $0 + i32.add + local.set $4 + local.get $3 + call $~lib/rt/pure/__release + local.get $4 ) - (func $~lib/array/Array>#__set (; 151 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) + (func $start:std/array~anonymous|35 (; 117 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - local.get $0 - i32.load - local.set $3 local.get $3 - i32.load - i32.const 2 - i32.shr_u + call $~lib/rt/pure/__retain + drop + local.get $3 + call $~lib/array/Array#pop + drop + local.get $0 + local.get $1 + i32.add local.set $4 + local.get $3 + call $~lib/rt/pure/__release + local.get $4 + ) + (func $start:std/array~anonymous|36 (; 118 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $0 local.get $1 + i32.add + local.set $4 + local.get $3 + call $~lib/rt/pure/__release local.get $4 - i32.ge_u - if - local.get $1 - i32.const 268435454 - i32.ge_u - if - i32.const 0 - i32.const 8 - i32.const 107 - i32.const 41 - call $~lib/env/abort - unreachable - end - local.get $3 - local.get $1 - i32.const 1 - i32.add - i32.const 2 - i32.shl - call $~lib/internal/arraybuffer/reallocateUnsafe - local.set $3 - local.get $0 - local.get $3 - i32.store - local.get $0 - local.get $1 - i32.const 1 - i32.add - i32.store offset=4 - end - block $~lib/internal/arraybuffer/STORE,std/array/Proxy>|inlined.0 - local.get $3 - local.set $5 - local.get $1 - local.set $6 - local.get $2 - local.set $7 - i32.const 0 - local.set $8 - local.get $5 - local.get $6 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.add - local.get $7 - i32.store offset=8 - end ) - (func $std/array/createReverseOrderedElementsArray (; 152 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) + (func $~lib/array/Array#reduceRight (; 119 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - i32.const 0 - local.get $0 - call $~lib/array/Array>#constructor - local.set $1 + (local $4 i32) + local.get $2 + local.set $3 block $break|0 - i32.const 0 - local.set $2 + local.get $0 + i32.load offset=12 + i32.const 1 + i32.sub + local.set $4 loop $repeat|0 - local.get $2 - block $~lib/array/Array>#get:length|inlined.1 (result i32) - local.get $1 - local.set $3 - local.get $3 - i32.load offset=4 - end - i32.lt_s + local.get $4 + i32.const 0 + i32.ge_s i32.eqz br_if $break|0 - local.get $1 - local.get $2 - i32.const 0 - block $~lib/array/Array>#get:length|inlined.2 (result i32) - local.get $1 - local.set $3 + block (result i32) + i32.const 4 + global.set $~lib/argc local.get $3 + local.get $0 i32.load offset=4 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $4 + local.get $0 + local.get $1 + call_indirect (type $FUNCSIG$iiiii) end + local.set $3 + local.get $4 i32.const 1 i32.sub - local.get $2 - i32.sub - call $std/array/Proxy#constructor - call $~lib/array/Array>#__set - local.get $2 - i32.const 1 - i32.add - local.set $2 + local.set $4 br $repeat|0 unreachable end unreachable end - local.get $1 - ) - (func $start:std/array~anonymous|48 (; 153 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 - i32.load - local.get $1 - i32.load - i32.sub + local.get $3 + ) + (func $start:std/array~anonymous|37 (; 120 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + i32.add + local.set $4 + local.get $3 + call $~lib/rt/pure/__release + local.get $4 + ) + (func $start:std/array~anonymous|38 (; 121 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $0 + if (result i32) + i32.const 1 + else + local.get $1 + i32.const 2 + i32.gt_s + end + local.set $4 + local.get $3 + call $~lib/rt/pure/__release + local.get $4 ) - (func $~lib/internal/sort/insertionSort> (; 154 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $~lib/array/Array#reduceRight (; 122 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) + local.get $2 + local.set $3 block $break|0 - i32.const 0 + local.get $0 + i32.load offset=12 + i32.const 1 + i32.sub local.set $4 loop $repeat|0 local.get $4 - local.get $2 - i32.lt_s + i32.const 0 + i32.ge_s i32.eqz br_if $break|0 - block - block $~lib/internal/arraybuffer/LOAD,std/array/Proxy>|inlined.2 (result i32) - local.get $0 - local.set $5 - local.get $4 - local.set $6 - local.get $1 - local.set $7 - local.get $5 - local.get $6 - i32.const 2 - i32.shl - i32.add - local.get $7 - i32.add - i32.load offset=8 - end - local.set $7 + block (result i32) + i32.const 4 + global.set $~lib/argc + local.get $3 + local.get $0 + i32.load offset=4 local.get $4 - i32.const 1 - i32.sub - local.set $6 - block $break|1 - loop $continue|1 - local.get $6 - i32.const 0 - i32.ge_s - if - block - block $~lib/internal/arraybuffer/LOAD,std/array/Proxy>|inlined.3 (result i32) - local.get $0 - local.set $5 - local.get $6 - local.set $8 - local.get $1 - local.set $9 - local.get $5 - local.get $8 - i32.const 2 - i32.shl - i32.add - local.get $9 - i32.add - i32.load offset=8 - end - local.set $9 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $7 - local.get $9 - local.get $3 - call_indirect (type $FUNCSIG$iii) - end - i32.const 0 - i32.lt_s - if - local.get $0 - local.set $8 - block (result i32) - local.get $6 - local.tee $5 - i32.const 1 - i32.sub - local.set $6 - local.get $5 - end - i32.const 1 - i32.add - local.set $5 - local.get $9 - local.set $10 - local.get $1 - local.set $11 - local.get $8 - local.get $5 - i32.const 2 - i32.shl - i32.add - local.get $11 - i32.add - local.get $10 - i32.store offset=8 - else - br $break|1 - end - end - br $continue|1 - end - end - end - block $~lib/internal/arraybuffer/STORE,std/array/Proxy>|inlined.4 - local.get $0 - local.set $9 - local.get $6 - i32.const 1 - i32.add - local.set $11 - local.get $7 - local.set $10 - local.get $1 - local.set $5 - local.get $9 - local.get $11 - i32.const 2 - i32.shl - i32.add - local.get $5 - i32.add - local.get $10 - i32.store offset=8 - end + i32.const 2 + i32.shl + i32.add + i32.load + local.get $4 + local.get $0 + local.get $1 + call_indirect (type $FUNCSIG$iiiii) end + local.set $3 local.get $4 i32.const 1 - i32.add + i32.sub local.set $4 br $repeat|0 unreachable end unreachable end + local.get $3 ) - (func $~lib/array/Array>#sort (; 155 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) + (func $start:std/array~anonymous|39 (; 123 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $0 + if (result i32) + i32.const 1 + else + local.get $1 + i32.const 100 + i32.gt_s + end + local.set $4 + local.get $3 + call $~lib/rt/pure/__release + local.get $4 + ) + (func $start:std/array~anonymous|40 (; 124 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $3 + i32.const 1 + call $~lib/array/Array#push + drop + local.get $0 + local.get $1 + i32.add + local.set $4 + local.get $3 + call $~lib/rt/pure/__release + local.get $4 + ) + (func $start:std/array~anonymous|41 (; 125 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + i32.add + local.set $4 + local.get $3 + call $~lib/rt/pure/__release + local.get $4 + ) + (func $start:std/array~anonymous|42 (; 126 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $3 + call $~lib/array/Array#pop + drop + local.get $0 + local.get $1 + i32.add + local.set $4 + local.get $3 + call $~lib/rt/pure/__release + local.get $4 + ) + (func $~lib/math/murmurHash3 (; 127 ;) (type $FUNCSIG$jj) (param $0 i64) (result i64) + local.get $0 + local.get $0 + i64.const 33 + i64.shr_u + i64.xor + local.set $0 + local.get $0 + i64.const -49064778989728563 + i64.mul + local.set $0 + local.get $0 + local.get $0 + i64.const 33 + i64.shr_u + i64.xor + local.set $0 + local.get $0 + i64.const -4265267296055464877 + i64.mul + local.set $0 + local.get $0 + local.get $0 + i64.const 33 + i64.shr_u + i64.xor + local.set $0 + local.get $0 + ) + (func $~lib/math/splitMix32 (; 128 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 1831565813 + i32.add + local.set $0 + local.get $0 + local.get $0 + i32.const 15 + i32.shr_u + i32.xor + local.get $0 + i32.const 1 + i32.or + i32.mul + local.set $0 + local.get $0 + local.get $0 + local.get $0 + local.get $0 + i32.const 7 + i32.shr_u + i32.xor + local.get $0 + i32.const 61 + i32.or + i32.mul + i32.add + i32.xor + local.set $0 + local.get $0 + local.get $0 + i32.const 14 + i32.shr_u + i32.xor + ) + (func $~lib/math/NativeMath.seedRandom (; 129 ;) (type $FUNCSIG$vj) (param $0 i64) + local.get $0 + i64.eqz + if + i32.const 0 + i32.const 3160 + i32.const 1020 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + i32.const 1 + global.set $~lib/math/random_seeded + local.get $0 + call $~lib/math/murmurHash3 + global.set $~lib/math/random_state0_64 + global.get $~lib/math/random_state0_64 + i64.const -1 + i64.xor + call $~lib/math/murmurHash3 + global.set $~lib/math/random_state1_64 + local.get $0 + i32.wrap_i64 + call $~lib/math/splitMix32 + global.set $~lib/math/random_state0_32 + global.get $~lib/math/random_state0_32 + call $~lib/math/splitMix32 + global.set $~lib/math/random_state1_32 + ) + (func $~lib/util/sort/insertionSort (; 130 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 f32) (local $5 i32) - (local $6 i32) + (local $6 f32) (local $7 i32) - (local $8 i32) - (local $9 i32) - local.get $1 - i32.eqz - if + block $break|0 i32.const 0 - i32.const 8 - i32.const 395 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - i32.load offset=4 - local.set $2 - local.get $2 - i32.const 1 - i32.le_s - if - local.get $0 - return - end - local.get $0 - i32.load - local.set $3 - local.get $2 - i32.const 2 - i32.eq - if - block $~lib/internal/arraybuffer/LOAD,std/array/Proxy>|inlined.0 (result i32) + local.set $3 + loop $repeat|0 + local.get $3 + local.get $1 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $0 local.get $3 - local.set $4 - i32.const 1 - local.set $5 - i32.const 0 - local.set $6 - local.get $4 - local.get $5 i32.const 2 i32.shl i32.add - local.get $6 - i32.add - i32.load offset=8 - end - local.set $6 - block $~lib/internal/arraybuffer/LOAD,std/array/Proxy>|inlined.1 (result i32) + f32.load + local.set $4 local.get $3 + i32.const 1 + i32.sub local.set $5 - i32.const 0 - local.set $4 - i32.const 0 - local.set $7 + block $break|1 + loop $continue|1 + local.get $5 + i32.const 0 + i32.ge_s + if + local.get $0 + local.get $5 + i32.const 2 + i32.shl + i32.add + f32.load + local.set $6 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $6 + local.get $2 + call_indirect (type $FUNCSIG$iff) + end + i32.const 0 + i32.lt_s + if + local.get $0 + block (result i32) + local.get $5 + local.tee $7 + i32.const 1 + i32.sub + local.set $5 + local.get $7 + end + i32.const 1 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + f32.store + else + br $break|1 + end + br $continue|1 + end + end + end + local.get $0 local.get $5 - local.get $4 + i32.const 1 + i32.add i32.const 2 i32.shl i32.add - local.get $7 + local.get $4 + f32.store + local.get $3 + i32.const 1 i32.add - i32.load offset=8 - end - local.set $7 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $6 - local.get $7 - local.get $1 - call_indirect (type $FUNCSIG$iii) - end - i32.const 0 - i32.lt_s - if - block $~lib/internal/arraybuffer/STORE,std/array/Proxy>|inlined.1 - local.get $3 - local.set $4 - i32.const 1 - local.set $5 - local.get $7 - local.set $8 - i32.const 0 - local.set $9 - local.get $4 - local.get $5 - i32.const 2 - i32.shl - i32.add - local.get $9 - i32.add - local.get $8 - i32.store offset=8 - end - block $~lib/internal/arraybuffer/STORE,std/array/Proxy>|inlined.2 - local.get $3 - local.set $9 - i32.const 0 - local.set $8 - local.get $6 - local.set $5 - i32.const 0 - local.set $4 - local.get $9 - local.get $8 - i32.const 2 - i32.shl - i32.add - local.get $4 - i32.add - local.get $5 - i32.store offset=8 - end + local.set $3 + br $repeat|0 + unreachable end - local.get $0 - return - end - block $~lib/internal/sort/SORT>|inlined.0 - local.get $3 - local.set $7 - i32.const 0 - local.set $6 - local.get $2 - local.set $4 - local.get $1 - local.set $5 - local.get $7 - local.get $6 - local.get $4 - local.get $5 - call $~lib/internal/sort/insertionSort> + unreachable end - local.get $0 ) - (func $~lib/array/Array>#__get (; 156 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) + (func $~lib/util/sort/weakHeapSort (; 131 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - local.get $0 - i32.load - local.set $2 + (local $6 i32) + (local $7 i32) + (local $8 f32) + (local $9 f32) + (local $10 f32) local.get $1 - local.get $2 - i32.load + i32.const 31 + i32.add + i32.const 5 + i32.shr_s i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $2 - local.set $3 + i32.shl + local.set $3 + local.get $3 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $4 + local.get $4 + i32.const 0 + local.get $3 + call $~lib/memory/memory.fill + block $break|0 local.get $1 - local.set $4 - i32.const 0 + i32.const 1 + i32.sub local.set $5 - local.get $3 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $5 - i32.add - i32.load offset=8 - else - unreachable - end - ) - (func $std/array/isSorted> (; 157 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - block $break|0 - block - i32.const 1 - local.set $2 - block $~lib/array/Array>#get:length|inlined.3 (result i32) - local.get $0 - local.set $3 - local.get $3 - i32.load offset=4 - end - local.set $3 - end loop $repeat|0 - local.get $2 - local.get $3 - i32.lt_s + local.get $5 + i32.const 0 + i32.gt_s i32.eqz br_if $break|0 + local.get $5 + local.set $6 + block $break|1 + loop $continue|1 + local.get $6 + i32.const 1 + i32.and + local.get $4 + local.get $6 + i32.const 6 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + local.get $6 + i32.const 1 + i32.shr_s + i32.const 31 + i32.and + i32.shr_u + i32.const 1 + i32.and + i32.eq + if + local.get $6 + i32.const 1 + i32.shr_s + local.set $6 + br $continue|1 + end + end + end + local.get $6 + i32.const 1 + i32.shr_s + local.set $7 + local.get $0 + local.get $7 + i32.const 2 + i32.shl + i32.add + f32.load + local.set $8 + local.get $0 + local.get $5 + i32.const 2 + i32.shl + i32.add + f32.load + local.set $9 block (result i32) i32.const 2 global.set $~lib/argc - local.get $0 - local.get $2 - i32.const 1 - i32.sub - call $~lib/array/Array>#__get - local.get $0 + local.get $8 + local.get $9 local.get $2 - call $~lib/array/Array>#__get - local.get $1 - call_indirect (type $FUNCSIG$iii) + call_indirect (type $FUNCSIG$iff) end i32.const 0 - i32.gt_s + i32.lt_s if - i32.const 0 - return + local.get $4 + local.get $5 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + local.get $4 + local.get $5 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + i32.const 1 + local.get $5 + i32.const 31 + i32.and + i32.shl + i32.xor + i32.store + local.get $0 + local.get $5 + i32.const 2 + i32.shl + i32.add + local.get $8 + f32.store + local.get $0 + local.get $7 + i32.const 2 + i32.shl + i32.add + local.get $9 + f32.store end - local.get $2 + local.get $5 i32.const 1 - i32.add - local.set $2 + i32.sub + local.set $5 br $repeat|0 unreachable end unreachable end - i32.const 1 - ) - (func $std/array/assertSorted> (; 158 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - call $~lib/array/Array>#sort - local.get $1 - call $std/array/isSorted> - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 810 - i32.const 2 - call $~lib/env/abort - unreachable - end - ) - (func $~lib/internal/sort/insertionSort<~lib/string/String> (; 159 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - block $break|0 - i32.const 0 - local.set $4 - loop $repeat|0 - local.get $4 - local.get $2 - i32.lt_s + block $break|2 + local.get $1 + i32.const 1 + i32.sub + local.set $7 + loop $repeat|2 + local.get $7 + i32.const 2 + i32.ge_s i32.eqz - br_if $break|0 - block - block $~lib/internal/arraybuffer/LOAD<~lib/string/String,~lib/string/String>|inlined.2 (result i32) - local.get $0 - local.set $5 + br_if $break|2 + local.get $0 + f32.load + local.set $9 + local.get $0 + local.get $0 + local.get $7 + i32.const 2 + i32.shl + i32.add + f32.load + f32.store + local.get $0 + local.get $7 + i32.const 2 + i32.shl + i32.add + local.get $9 + f32.store + i32.const 1 + local.set $6 + block $break|3 + loop $continue|3 + local.get $6 + i32.const 1 + i32.shl local.get $4 - local.set $6 - local.get $1 - local.set $7 - local.get $5 local.get $6 + i32.const 5 + i32.shr_s i32.const 2 i32.shl i32.add - local.get $7 + i32.load + local.get $6 + i32.const 31 + i32.and + i32.shr_u + i32.const 1 + i32.and i32.add - i32.load offset=8 + local.tee $5 + local.get $7 + i32.lt_s + if + local.get $5 + local.set $6 + br $continue|3 + end end - local.set $7 - local.get $4 - i32.const 1 - i32.sub - local.set $6 - block $break|1 - loop $continue|1 + end + block $break|4 + loop $continue|4 + local.get $6 + i32.const 0 + i32.gt_s + if + local.get $0 + f32.load + local.set $9 + local.get $0 local.get $6 + i32.const 2 + i32.shl + i32.add + f32.load + local.set $8 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $9 + local.get $8 + local.get $2 + call_indirect (type $FUNCSIG$iff) + end i32.const 0 - i32.ge_s + i32.lt_s if - block - block $~lib/internal/arraybuffer/LOAD<~lib/string/String,~lib/string/String>|inlined.3 (result i32) - local.get $0 - local.set $5 - local.get $6 - local.set $8 - local.get $1 - local.set $9 - local.get $5 - local.get $8 - i32.const 2 - i32.shl - i32.add - local.get $9 - i32.add - i32.load offset=8 - end - local.set $9 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $7 - local.get $9 - local.get $3 - call_indirect (type $FUNCSIG$iii) - end - i32.const 0 - i32.lt_s - if - local.get $0 - local.set $8 - block (result i32) - local.get $6 - local.tee $5 - i32.const 1 - i32.sub - local.set $6 - local.get $5 - end - i32.const 1 - i32.add - local.set $5 - local.get $9 - local.set $10 - local.get $1 - local.set $11 - local.get $8 - local.get $5 - i32.const 2 - i32.shl - i32.add - local.get $11 - i32.add - local.get $10 - i32.store offset=8 - else - br $break|1 - end - end - br $continue|1 + local.get $4 + local.get $6 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + local.get $4 + local.get $6 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + i32.const 1 + local.get $6 + i32.const 31 + i32.and + i32.shl + i32.xor + i32.store + local.get $0 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $9 + f32.store + local.get $0 + local.get $8 + f32.store end + local.get $6 + i32.const 1 + i32.shr_s + local.set $6 + br $continue|4 end end - block $~lib/internal/arraybuffer/STORE<~lib/string/String,~lib/string/String>|inlined.3 - local.get $0 - local.set $9 - local.get $6 - i32.const 1 - i32.add - local.set $11 - local.get $7 - local.set $10 - local.get $1 - local.set $5 - local.get $9 - local.get $11 - i32.const 2 - i32.shl - i32.add - local.get $5 - i32.add - local.get $10 - i32.store offset=8 - end end - local.get $4 + local.get $7 i32.const 1 - i32.add - local.set $4 - br $repeat|0 + i32.sub + local.set $7 + br $repeat|2 unreachable end unreachable end + local.get $4 + call $~lib/rt/tlsf/__free + local.get $0 + f32.load offset=4 + local.set $10 + local.get $0 + local.get $0 + f32.load + f32.store offset=4 + local.get $0 + local.get $10 + f32.store ) - (func $~lib/array/Array<~lib/string/String>#sort (; 160 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#sort (; 132 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - (local $4 i32) - (local $5 i32) + (local $4 f32) + (local $5 f32) (local $6 i32) (local $7 i32) (local $8 i32) - (local $9 i32) - local.get $1 - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 395 - i32.const 4 - call $~lib/env/abort - unreachable - end local.get $0 - i32.load offset=4 + i32.load offset=12 local.set $2 local.get $2 i32.const 1 i32.le_s if local.get $0 + call $~lib/rt/pure/__retain return end local.get $0 - i32.load + i32.load offset=4 local.set $3 local.get $2 i32.const 2 i32.eq if - block $~lib/internal/arraybuffer/LOAD<~lib/string/String,~lib/string/String>|inlined.0 (result i32) - local.get $3 - local.set $4 - i32.const 1 - local.set $5 - i32.const 0 - local.set $6 - local.get $4 - local.get $5 - i32.const 2 - i32.shl - i32.add - local.get $6 - i32.add - i32.load offset=8 - end - local.set $6 - block $~lib/internal/arraybuffer/LOAD<~lib/string/String,~lib/string/String>|inlined.1 (result i32) - local.get $3 - local.set $5 - i32.const 0 - local.set $4 - i32.const 0 - local.set $7 - local.get $5 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $7 - i32.add - i32.load offset=8 - end - local.set $7 + local.get $3 + f32.load offset=4 + local.set $4 + local.get $3 + f32.load + local.set $5 block (result i32) i32.const 2 global.set $~lib/argc - local.get $6 - local.get $7 + local.get $4 + local.get $5 local.get $1 - call_indirect (type $FUNCSIG$iii) + call_indirect (type $FUNCSIG$iff) end i32.const 0 i32.lt_s if - block $~lib/internal/arraybuffer/STORE<~lib/string/String,~lib/string/String>|inlined.0 - local.get $3 - local.set $4 - i32.const 1 - local.set $5 - local.get $7 - local.set $8 - i32.const 0 - local.set $9 - local.get $4 - local.get $5 - i32.const 2 - i32.shl - i32.add - local.get $9 - i32.add - local.get $8 - i32.store offset=8 - end - block $~lib/internal/arraybuffer/STORE<~lib/string/String,~lib/string/String>|inlined.1 - local.get $3 - local.set $9 - i32.const 0 - local.set $8 - local.get $6 - local.set $5 - i32.const 0 - local.set $4 - local.get $9 - local.get $8 - i32.const 2 - i32.shl - i32.add - local.get $4 - i32.add - local.get $5 - i32.store offset=8 - end + local.get $3 + local.get $5 + f32.store offset=4 + local.get $3 + local.get $4 + f32.store end local.get $0 + call $~lib/rt/pure/__retain return end - block $~lib/internal/sort/SORT<~lib/string/String>|inlined.0 - local.get $3 - local.set $7 - i32.const 0 - local.set $6 - local.get $2 - local.set $4 - local.get $1 - local.set $5 - local.get $7 - local.get $6 - local.get $4 - local.get $5 - call $~lib/internal/sort/insertionSort<~lib/string/String> - end - local.get $0 - ) - (func $~lib/array/Array<~lib/string/String>#__get (; 161 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load - local.set $2 - local.get $1 - local.get $2 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $2 - local.set $3 - local.get $1 - local.set $4 - i32.const 0 - local.set $5 - local.get $3 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $5 - i32.add - i32.load offset=8 - else - unreachable - end - ) - (func $std/array/isSorted<~lib/string/String> (; 162 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - block $break|0 - block - i32.const 1 - local.set $2 - block $~lib/array/Array<~lib/string/String>#get:length|inlined.0 (result i32) - local.get $0 - local.set $3 - local.get $3 - i32.load offset=4 - end - local.set $3 - end - loop $repeat|0 - local.get $2 - local.get $3 - i32.lt_s - i32.eqz - br_if $break|0 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $0 - local.get $2 - i32.const 1 - i32.sub - call $~lib/array/Array<~lib/string/String>#__get - local.get $0 - local.get $2 - call $~lib/array/Array<~lib/string/String>#__get - local.get $1 - call_indirect (type $FUNCSIG$iii) - end - i32.const 0 - i32.gt_s - if - i32.const 0 - return - end - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $repeat|0 - unreachable - end - unreachable - end - i32.const 1 - ) - (func $std/array/assertSorted<~lib/string/String> (; 163 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - call $~lib/array/Array<~lib/string/String>#sort - local.get $1 - call $std/array/isSorted<~lib/string/String> - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 810 - i32.const 2 - call $~lib/env/abort - unreachable - end - ) - (func $~lib/internal/string/compareUnsafe (; 164 ;) (type $FUNCSIG$iiiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - i32.const 0 - local.set $5 - local.get $0 - local.get $1 - i32.const 1 - i32.shl - i32.add - local.set $6 - local.get $2 - local.get $3 - i32.const 1 - i32.shl - i32.add - local.set $7 - block $break|0 - loop $continue|0 - local.get $4 - if (result i32) - local.get $6 - i32.load16_u offset=4 - local.get $7 - i32.load16_u offset=4 - i32.sub - local.tee $5 - i32.eqz - else - local.get $4 - end - if - block - local.get $4 - i32.const 1 - i32.sub - local.set $4 - local.get $6 - i32.const 2 - i32.add - local.set $6 - local.get $7 - i32.const 2 - i32.add - local.set $7 - end - br $continue|0 - end + block $~lib/util/sort/SORT|inlined.0 + local.get $3 + local.set $8 + local.get $2 + local.set $7 + local.get $1 + local.set $6 + local.get $7 + i32.const 256 + i32.lt_s + if + local.get $8 + local.get $7 + local.get $6 + call $~lib/util/sort/insertionSort + else + local.get $8 + local.get $7 + local.get $6 + call $~lib/util/sort/weakHeapSort end end - local.get $5 + local.get $0 + call $~lib/rt/pure/__retain ) - (func $~lib/internal/sort/COMPARATOR<~lib/string/String>~anonymous|0 (; 165 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 133 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) (local $2 i32) (local $3 i32) - (local $4 i32) - (local $5 i32) local.get $0 + i32.reinterpret_f32 + local.set $2 local.get $1 - i32.eq - local.tee $2 - if (result i32) - local.get $2 - else - local.get $0 - i32.const 0 - i32.eq - end - local.tee $2 - if (result i32) - local.get $2 - else - local.get $1 - i32.const 0 - i32.eq - end - if - i32.const 0 - return - end - local.get $0 - i32.load + i32.reinterpret_f32 local.set $3 - local.get $1 - i32.load - local.set $4 + local.get $2 + local.get $2 + i32.const 31 + i32.shr_s + i32.const 1 + i32.shr_u + i32.xor + local.set $2 local.get $3 - i32.eqz - local.tee $2 - if (result i32) - local.get $4 - i32.eqz - else - local.get $2 - end - if - i32.const 0 - return - end local.get $3 - i32.eqz - if - i32.const -1 - return - end - local.get $4 - i32.eqz - if - i32.const 1 - return - end - local.get $0 - i32.const 0 - local.get $1 - i32.const 0 + i32.const 31 + i32.shr_s + i32.const 1 + i32.shr_u + i32.xor + local.set $3 + local.get $2 local.get $3 - local.tee $2 - local.get $4 - local.tee $5 + i32.gt_s local.get $2 - local.get $5 + local.get $3 i32.lt_s - select - call $~lib/internal/string/compareUnsafe + i32.sub ) - (func $std/array/assertSorted<~lib/string/String>|trampoline (; 166 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/array/Array#sort|trampoline (; 134 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) block $1of1 block $0of1 block $outOfRange global.get $~lib/argc - i32.const 1 - i32.sub br_table $0of1 $1of1 $outOfRange end unreachable end - block $~lib/internal/sort/COMPARATOR<~lib/string/String>|inlined.0 (result i32) - i32.const 55 - br $~lib/internal/sort/COMPARATOR<~lib/string/String>|inlined.0 + block $~lib/util/sort/COMPARATOR|inlined.0 (result i32) + i32.const 44 + br $~lib/util/sort/COMPARATOR|inlined.0 end local.set $1 end local.get $0 local.get $1 - call $std/array/assertSorted<~lib/string/String> + call $~lib/array/Array#sort ) - (func $~lib/string/String.__eq (; 167 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - local.get $0 - local.get $1 - i32.eq - if - i32.const 1 - return - end - local.get $0 - i32.const 0 - i32.eq - local.tee $2 - if (result i32) - local.get $2 - else - local.get $1 - i32.const 0 - i32.eq - end - if - i32.const 0 - return - end + (func $~lib/builtins/isNaN (; 135 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) local.get $0 - i32.load - local.set $3 - local.get $3 - local.get $1 - i32.load - i32.ne - if - i32.const 0 - return - end local.get $0 - i32.const 0 - local.get $1 - i32.const 0 - local.get $3 - call $~lib/internal/string/compareUnsafe - i32.eqz + f32.ne ) - (func $~lib/string/String.__ne (; 168 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/isArraysEqual (; 136 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) local.get $0 + call $~lib/rt/pure/__retain + drop local.get $1 - call $~lib/string/String.__eq - i32.eqz - ) - (func $std/array/isArraysEqual<~lib/string/String> (; 169 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) + call $~lib/rt/pure/__retain + drop local.get $2 i32.eqz if - block $~lib/array/Array<~lib/string/String>#get:length|inlined.1 (result i32) - local.get $0 - local.set $3 - local.get $3 - i32.load offset=4 - end + local.get $0 + call $~lib/array/Array#get:length local.set $2 local.get $2 - block $~lib/array/Array<~lib/string/String>#get:length|inlined.3 (result i32) - local.get $1 - local.set $3 - local.get $3 - i32.load offset=4 - end + local.get $1 + call $~lib/array/Array#get:length i32.ne if i32.const 0 + local.set $3 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $3 return end local.get $0 @@ -11183,29 +7350,154 @@ i32.eq if i32.const 1 + local.set $3 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $3 return end end + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + block $continue|0 + local.get $3 + local.get $2 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $0 + local.get $3 + call $~lib/array/Array#__get + call $~lib/builtins/isNaN + local.get $1 + local.get $3 + call $~lib/array/Array#__get + call $~lib/builtins/isNaN + i32.eq + if + br $continue|0 + end + local.get $0 + local.get $3 + call $~lib/array/Array#__get + local.get $1 + local.get $3 + call $~lib/array/Array#__get + f32.ne + if + i32.const 0 + local.set $4 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $4 + return + end + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end + unreachable + end + i32.const 1 + local.set $3 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $~lib/util/sort/insertionSort (; 137 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 f64) + (local $5 i32) + (local $6 f64) + (local $7 i32) block $break|0 i32.const 0 local.set $3 loop $repeat|0 local.get $3 - local.get $2 + local.get $1 i32.lt_s i32.eqz br_if $break|0 local.get $0 local.get $3 - call $~lib/array/Array<~lib/string/String>#__get - local.get $1 + i32.const 3 + i32.shl + i32.add + f64.load + local.set $4 local.get $3 - call $~lib/array/Array<~lib/string/String>#__get - call $~lib/string/String.__ne - if - i32.const 0 - return + i32.const 1 + i32.sub + local.set $5 + block $break|1 + loop $continue|1 + local.get $5 + i32.const 0 + i32.ge_s + if + local.get $0 + local.get $5 + i32.const 3 + i32.shl + i32.add + f64.load + local.set $6 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $6 + local.get $2 + call_indirect (type $FUNCSIG$idd) + end + i32.const 0 + i32.lt_s + if + local.get $0 + block (result i32) + local.get $5 + local.tee $7 + i32.const 1 + i32.sub + local.set $5 + local.get $7 + end + i32.const 1 + i32.add + i32.const 3 + i32.shl + i32.add + local.get $6 + f64.store + else + br $break|1 + end + br $continue|1 + end + end end + local.get $0 + local.get $5 + i32.const 1 + i32.add + i32.const 3 + i32.shl + i32.add + local.get $4 + f64.store local.get $3 i32.const 1 i32.add @@ -11215,5008 +7507,4909 @@ end unreachable end - i32.const 1 ) - (func $~lib/array/Array<~lib/string/String>#constructor (; 170 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) + (func $~lib/util/sort/weakHeapSort (; 138 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $1 - i32.const 268435454 - i32.gt_u - if - i32.const 0 - i32.const 8 - i32.const 45 - i32.const 39 - call $~lib/env/abort - unreachable - end - local.get $1 - i32.const 2 - i32.shl - local.set $2 - local.get $2 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $3 - block (result i32) - local.get $0 - i32.eqz - if - i32.const 8 - call $~lib/memory/memory.allocate - local.set $0 - end - local.get $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - end - local.get $3 - i32.store - local.get $0 - local.get $1 - i32.store offset=4 - block $~lib/memory/memory.fill|inlined.11 - local.get $3 - i32.const 8 - i32.add - local.set $4 - i32.const 0 - local.set $5 - local.get $2 - local.set $6 - local.get $4 - local.get $5 - local.get $6 - call $~lib/internal/memory/memset - end - local.get $0 - ) - (func $~lib/internal/string/allocateUnsafe (; 171 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - local.get $0 - i32.const 0 - i32.gt_s - local.tee $1 - if (result i32) - local.get $0 - i32.const 536870910 - i32.le_s - else - local.get $1 - end - i32.eqz - if - i32.const 0 - i32.const 4088 - i32.const 14 - i32.const 2 - call $~lib/env/abort - unreachable - end - block $~lib/memory/memory.allocate|inlined.5 (result i32) - i32.const 4 - local.get $0 - i32.const 1 - i32.shl - i32.add - local.set $1 - local.get $1 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.5 - end - local.set $2 - local.get $2 - local.get $0 - i32.store - local.get $2 - ) - (func $~lib/string/String#charAt (; 172 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - local.get $0 - i32.const 0 - i32.ne - i32.eqz - if - i32.const 0 - i32.const 4056 - i32.const 58 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $1 - local.get $0 - i32.load - i32.ge_u - if - i32.const 3904 - return - end - i32.const 1 - call $~lib/internal/string/allocateUnsafe - local.set $2 - local.get $2 - local.get $0 - local.get $1 - i32.const 1 - i32.shl - i32.add - i32.load16_u offset=4 - i32.store16 offset=4 - local.get $2 - ) - (func $~lib/internal/string/copyUnsafe (; 173 ;) (type $FUNCSIG$viiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - local.get $0 + (local $8 f64) + (local $9 f64) + (local $10 f64) local.get $1 - i32.const 1 - i32.shl - i32.add - i32.const 4 - i32.add - local.set $5 - local.get $2 - local.get $3 - i32.const 1 - i32.shl - i32.add - i32.const 4 + i32.const 31 i32.add - local.set $6 - local.get $4 - i32.const 1 + i32.const 5 + i32.shr_s + i32.const 2 i32.shl - local.set $7 - local.get $5 - local.get $6 - local.get $7 - call $~lib/internal/memory/memmove - ) - (func $~lib/string/String#concat (; 174 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.const 0 - i32.ne - i32.eqz - if - i32.const 0 - i32.const 4056 - i32.const 110 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $1 - i32.const 0 - i32.eq - if - i32.const 4144 - local.set $1 - end - local.get $0 - i32.load - local.set $2 - local.get $1 - i32.load local.set $3 - local.get $2 local.get $3 - i32.add - local.set $4 - local.get $4 i32.const 0 - i32.eq - if - i32.const 3904 - return - end + call $~lib/rt/tlsf/__alloc + local.set $4 local.get $4 - call $~lib/internal/string/allocateUnsafe - local.set $5 - local.get $5 - i32.const 0 - local.get $0 - i32.const 0 - local.get $2 - call $~lib/internal/string/copyUnsafe - local.get $5 - local.get $2 - local.get $1 i32.const 0 local.get $3 - call $~lib/internal/string/copyUnsafe - local.get $5 - ) - (func $~lib/string/String.__concat (; 175 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 - i32.eqz - if - i32.const 4144 - local.set $0 - end - local.get $0 - local.get $1 - call $~lib/string/String#concat - ) - (func $std/array/createRandomString (; 176 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 f64) - i32.const 3904 - local.set $1 + call $~lib/memory/memory.fill block $break|0 - i32.const 0 - local.set $2 + local.get $1 + i32.const 1 + i32.sub + local.set $5 loop $repeat|0 - local.get $2 + local.get $5 + i32.const 0 + i32.gt_s + i32.eqz + br_if $break|0 + local.get $5 + local.set $6 + block $break|1 + loop $continue|1 + local.get $6 + i32.const 1 + i32.and + local.get $4 + local.get $6 + i32.const 6 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + local.get $6 + i32.const 1 + i32.shr_s + i32.const 31 + i32.and + i32.shr_u + i32.const 1 + i32.and + i32.eq + if + local.get $6 + i32.const 1 + i32.shr_s + local.set $6 + br $continue|1 + end + end + end + local.get $6 + i32.const 1 + i32.shr_s + local.set $7 + local.get $0 + local.get $7 + i32.const 3 + i32.shl + i32.add + f64.load + local.set $8 local.get $0 + local.get $5 + i32.const 3 + i32.shl + i32.add + f64.load + local.set $9 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $8 + local.get $9 + local.get $2 + call_indirect (type $FUNCSIG$idd) + end + i32.const 0 i32.lt_s - i32.eqz - br_if $break|0 - local.get $1 - global.get $std/array/charset - block $~lib/math/NativeMath.floor|inlined.0 (result f64) - call $~lib/math/NativeMath.random - global.get $std/array/charset + if + local.get $4 + local.get $5 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + local.get $4 + local.get $5 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add i32.load - f64.convert_i32_s - f64.mul - local.set $3 - local.get $3 - f64.floor + i32.const 1 + local.get $5 + i32.const 31 + i32.and + i32.shl + i32.xor + i32.store + local.get $0 + local.get $5 + i32.const 3 + i32.shl + i32.add + local.get $8 + f64.store + local.get $0 + local.get $7 + i32.const 3 + i32.shl + i32.add + local.get $9 + f64.store end - i32.trunc_f64_s - call $~lib/string/String#charAt - call $~lib/string/String.__concat - local.set $1 - local.get $2 + local.get $5 i32.const 1 - i32.add - local.set $2 + i32.sub + local.set $5 br $repeat|0 unreachable end unreachable end - local.get $1 - ) - (func $~lib/array/Array<~lib/string/String>#__set (; 177 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - local.get $0 - i32.load - local.set $3 - local.get $3 - i32.load - i32.const 2 - i32.shr_u - local.set $4 - local.get $1 - local.get $4 - i32.ge_u - if - local.get $1 - i32.const 268435454 - i32.ge_u - if - i32.const 0 - i32.const 8 - i32.const 107 - i32.const 41 - call $~lib/env/abort - unreachable - end - local.get $3 - local.get $1 - i32.const 1 - i32.add - i32.const 2 - i32.shl - call $~lib/internal/arraybuffer/reallocateUnsafe - local.set $3 - local.get $0 - local.get $3 - i32.store - local.get $0 + block $break|2 local.get $1 i32.const 1 - i32.add - i32.store offset=4 - end - block $~lib/internal/arraybuffer/STORE<~lib/string/String,~lib/string/String>|inlined.4 - local.get $3 - local.set $5 - local.get $1 - local.set $6 - local.get $2 + i32.sub local.set $7 - i32.const 0 - local.set $8 - local.get $5 - local.get $6 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.add - local.get $7 - i32.store offset=8 - end - ) - (func $std/array/createRandomStringArray (; 178 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - i32.const 0 - local.get $0 - call $~lib/array/Array<~lib/string/String>#constructor - local.set $1 - block $break|0 - i32.const 0 - local.set $2 - loop $repeat|0 - local.get $2 - block $~lib/array/Array<~lib/string/String>#get:length|inlined.5 (result i32) - local.get $1 - local.set $3 - local.get $3 - i32.load offset=4 + loop $repeat|2 + local.get $7 + i32.const 2 + i32.ge_s + i32.eqz + br_if $break|2 + local.get $0 + f64.load + local.set $9 + local.get $0 + local.get $0 + local.get $7 + i32.const 3 + i32.shl + i32.add + f64.load + f64.store + local.get $0 + local.get $7 + i32.const 3 + i32.shl + i32.add + local.get $9 + f64.store + i32.const 1 + local.set $6 + block $break|3 + loop $continue|3 + local.get $6 + i32.const 1 + i32.shl + local.get $4 + local.get $6 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + local.get $6 + i32.const 31 + i32.and + i32.shr_u + i32.const 1 + i32.and + i32.add + local.tee $5 + local.get $7 + i32.lt_s + if + local.get $5 + local.set $6 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $6 + i32.const 0 + i32.gt_s + if + local.get $0 + f64.load + local.set $9 + local.get $0 + local.get $6 + i32.const 3 + i32.shl + i32.add + f64.load + local.set $8 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $9 + local.get $8 + local.get $2 + call_indirect (type $FUNCSIG$idd) + end + i32.const 0 + i32.lt_s + if + local.get $4 + local.get $6 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + local.get $4 + local.get $6 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + i32.const 1 + local.get $6 + i32.const 31 + i32.and + i32.shl + i32.xor + i32.store + local.get $0 + local.get $6 + i32.const 3 + i32.shl + i32.add + local.get $9 + f64.store + local.get $0 + local.get $8 + f64.store + end + local.get $6 + i32.const 1 + i32.shr_s + local.set $6 + br $continue|4 + end + end end - i32.lt_s - i32.eqz - br_if $break|0 - local.get $1 - local.get $2 - call $~lib/math/NativeMath.random - f64.const 32 - f64.mul - i32.trunc_f64_s - call $std/array/createRandomString - call $~lib/array/Array<~lib/string/String>#__set - local.get $2 + local.get $7 i32.const 1 - i32.add - local.set $2 - br $repeat|0 + i32.sub + local.set $7 + br $repeat|2 unreachable end unreachable end - local.get $1 - ) - (func $~lib/string/String#substring (; 179 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - local.get $0 - i32.const 0 - i32.ne - i32.eqz - if - i32.const 0 - i32.const 4056 - i32.const 254 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - i32.load - local.set $3 - local.get $1 - local.tee $4 - i32.const 0 - local.tee $5 - local.get $4 - local.get $5 - i32.gt_s - select - local.tee $4 - local.get $3 - local.tee $5 - local.get $4 - local.get $5 - i32.lt_s - select - local.set $6 - local.get $2 - local.tee $4 - i32.const 0 - local.tee $5 - local.get $4 - local.get $5 - i32.gt_s - select - local.tee $4 - local.get $3 - local.tee $5 - local.get $4 - local.get $5 - i32.lt_s - select - local.set $7 - local.get $6 - local.tee $4 - local.get $7 - local.tee $5 - local.get $4 - local.get $5 - i32.lt_s - select - local.set $8 - local.get $6 - local.tee $4 - local.get $7 - local.tee $5 local.get $4 - local.get $5 - i32.gt_s - select - local.set $9 - local.get $9 - local.get $8 - i32.sub - local.set $3 - local.get $3 - i32.eqz - if - i32.const 3904 - return - end - local.get $8 - i32.eqz - local.tee $4 - if (result i32) - local.get $9 - local.get $0 - i32.load - i32.eq - else - local.get $4 - end - if - local.get $0 - return - end - local.get $3 - call $~lib/internal/string/allocateUnsafe + call $~lib/rt/tlsf/__free + local.get $0 + f64.load offset=8 local.set $10 - local.get $10 - i32.const 0 local.get $0 - local.get $8 - local.get $3 - call $~lib/internal/string/copyUnsafe + local.get $0 + f64.load + f64.store offset=8 + local.get $0 local.get $10 + f64.store ) - (func $~lib/array/Array#join (; 180 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#sort (; 139 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - (local $4 i32) - (local $5 i32) + (local $4 f64) + (local $5 f64) (local $6 i32) (local $7 i32) (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 i32) local.get $0 - i32.load offset=4 - i32.const 1 - i32.sub + i32.load offset=12 local.set $2 local.get $2 - i32.const 0 - i32.lt_s + i32.const 1 + i32.le_s if - i32.const 3904 + local.get $0 + call $~lib/rt/pure/__retain return end - i32.const 3904 - local.set $3 local.get $0 - i32.load - local.set $5 - local.get $1 - i32.load - local.set $6 - local.get $6 - i32.const 0 - i32.ne - local.set $7 + i32.load offset=4 + local.set $3 local.get $2 - i32.eqz + i32.const 2 + i32.eq if - i32.const 4184 - i32.const 4200 - block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) + local.get $3 + f64.load offset=8 + local.set $4 + local.get $3 + f64.load + local.set $5 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 local.get $5 - local.set $8 - i32.const 0 - local.set $9 - i32.const 0 - local.set $10 - local.get $8 - local.get $9 - i32.const 0 - i32.shl - i32.add - local.get $10 - i32.add - i32.load8_u offset=8 + local.get $1 + call_indirect (type $FUNCSIG$idd) end i32.const 0 - i32.ne - select - return - end - i32.const 5 - local.set $10 - local.get $10 - local.get $6 - i32.add - local.get $2 - i32.mul - local.get $10 - i32.add - local.set $9 - local.get $9 - call $~lib/internal/string/allocateUnsafe - local.set $8 - i32.const 0 - local.set $11 - block $break|0 - i32.const 0 - local.set $12 - loop $repeat|0 - local.get $12 - local.get $2 - i32.lt_s - i32.eqz - br_if $break|0 - block - block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i32) - local.get $5 - local.set $13 - local.get $12 - local.set $14 - i32.const 0 - local.set $15 - local.get $13 - local.get $14 - i32.const 0 - i32.shl - i32.add - local.get $15 - i32.add - i32.load8_u offset=8 - end - local.set $4 - i32.const 4 - local.get $4 - i32.const 0 - i32.ne - i32.eqz - i32.add - local.set $10 - local.get $8 - local.get $11 - i32.const 4184 - i32.const 4200 - local.get $4 - i32.const 0 - i32.ne - select - i32.const 0 - local.get $10 - call $~lib/internal/string/copyUnsafe - local.get $11 - local.get $10 - i32.add - local.set $11 - local.get $7 - if - local.get $8 - local.get $11 - local.get $1 - i32.const 0 - local.get $6 - call $~lib/internal/string/copyUnsafe - local.get $11 - local.get $6 - i32.add - local.set $11 - end - end - local.get $12 - i32.const 1 - i32.add - local.set $12 - br $repeat|0 - unreachable + i32.lt_s + if + local.get $3 + local.get $5 + f64.store offset=8 + local.get $3 + local.get $4 + f64.store end - unreachable + local.get $0 + call $~lib/rt/pure/__retain + return end - block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i32) - local.get $5 - local.set $12 + block $~lib/util/sort/SORT|inlined.0 + local.get $3 + local.set $8 local.get $2 - local.set $15 - i32.const 0 - local.set $14 - local.get $12 - local.get $15 - i32.const 0 - i32.shl - i32.add - local.get $14 - i32.add - i32.load8_u offset=8 - end - local.set $4 - i32.const 4 - local.get $4 - i32.const 0 - i32.ne - i32.eqz - i32.add - local.set $10 - local.get $8 - local.get $11 - i32.const 4184 - i32.const 4200 - local.get $4 - i32.const 0 - i32.ne - select - i32.const 0 - local.get $10 - call $~lib/internal/string/copyUnsafe - local.get $11 - local.get $10 - i32.add - local.set $11 - local.get $8 - local.set $14 - local.get $9 - local.get $11 - i32.gt_s - if - local.get $8 - i32.const 0 - local.get $11 - call $~lib/string/String#substring - local.set $14 - block $~lib/internal/string/freeUnsafe|inlined.0 + local.set $7 + local.get $1 + local.set $6 + local.get $7 + i32.const 256 + i32.lt_s + if local.get $8 - local.set $15 - local.get $15 - i32.eqz - if - i32.const 0 - i32.const 4088 - i32.const 28 - i32.const 4 - call $~lib/env/abort - unreachable - end - block $~lib/memory/memory.free|inlined.5 - local.get $15 - local.set $12 - local.get $12 - call $~lib/allocator/arena/__memory_free - br $~lib/memory/memory.free|inlined.5 + local.get $7 + local.get $6 + call $~lib/util/sort/insertionSort + else + local.get $8 + local.get $7 + local.get $6 + call $~lib/util/sort/weakHeapSort + end + end + local.get $0 + call $~lib/rt/pure/__retain + ) + (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 140 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) + (local $2 i64) + (local $3 i64) + local.get $0 + i64.reinterpret_f64 + local.set $2 + local.get $1 + i64.reinterpret_f64 + local.set $3 + local.get $2 + local.get $2 + i64.const 63 + i64.shr_s + i64.const 1 + i64.shr_u + i64.xor + local.set $2 + local.get $3 + local.get $3 + i64.const 63 + i64.shr_s + i64.const 1 + i64.shr_u + i64.xor + local.set $3 + local.get $2 + local.get $3 + i64.gt_s + local.get $2 + local.get $3 + i64.lt_s + i32.sub + ) + (func $~lib/array/Array#sort|trampoline (; 141 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + block $1of1 + block $0of1 + block $outOfRange + global.get $~lib/argc + br_table $0of1 $1of1 $outOfRange end + unreachable + end + block $~lib/util/sort/COMPARATOR|inlined.0 (result i32) + i32.const 45 + br $~lib/util/sort/COMPARATOR|inlined.0 end + local.set $1 end - local.get $14 - return + local.get $0 + local.get $1 + call $~lib/array/Array#sort ) - (func $~lib/internal/number/decimalCount32 (; 181 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/array/Array#get:length (; 142 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - i32.const 100000 - i32.lt_u + i32.load offset=12 + ) + (func $~lib/array/Array#__unchecked_get (; 143 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 3 + i32.shl + i32.add + f64.load + ) + (func $~lib/array/Array#__get (; 144 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 3 + i32.shr_u + i32.ge_u + if + i32.const 280 + i32.const 488 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/array/Array#__unchecked_get + ) + (func $~lib/builtins/isNaN (; 145 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + local.get $0 + f64.ne + ) + (func $std/array/isArraysEqual (; 146 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $2 + i32.eqz if local.get $0 - i32.const 100 - i32.lt_u + call $~lib/array/Array#get:length + local.set $2 + local.get $2 + local.get $1 + call $~lib/array/Array#get:length + i32.ne if - i32.const 1 - i32.const 2 - local.get $0 - i32.const 10 - i32.lt_u - select - return - else - i32.const 4 - i32.const 5 + i32.const 0 + local.set $3 local.get $0 - i32.const 10000 - i32.lt_u - select - local.set $1 - i32.const 3 + call $~lib/rt/pure/__release local.get $1 - local.get $0 - i32.const 1000 - i32.lt_u - select + call $~lib/rt/pure/__release + local.get $3 return end - unreachable - unreachable - else local.get $0 - i32.const 10000000 - i32.lt_u + local.get $1 + i32.eq if - i32.const 6 - i32.const 7 - local.get $0 - i32.const 1000000 - i32.lt_u - select - return - else - i32.const 9 - i32.const 10 + i32.const 1 + local.set $3 local.get $0 - i32.const 1000000000 - i32.lt_u - select - local.set $1 - i32.const 8 + call $~lib/rt/pure/__release local.get $1 - local.get $0 - i32.const 100000000 - i32.lt_u - select + call $~lib/rt/pure/__release + local.get $3 return end + end + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + block $continue|0 + local.get $3 + local.get $2 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $0 + local.get $3 + call $~lib/array/Array#__get + call $~lib/builtins/isNaN + local.get $1 + local.get $3 + call $~lib/array/Array#__get + call $~lib/builtins/isNaN + i32.eq + if + br $continue|0 + end + local.get $0 + local.get $3 + call $~lib/array/Array#__get + local.get $1 + local.get $3 + call $~lib/array/Array#__get + f64.ne + if + i32.const 0 + local.set $4 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $4 + return + end + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end unreachable - unreachable end - unreachable - unreachable + i32.const 1 + local.set $3 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/internal/number/utoa32_lut (; 182 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/insertionSort (; 147 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i64) - (local $12 i64) - i32.const 4832 - i32.load - local.set $3 block $break|0 - loop $continue|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 local.get $1 - i32.const 10000 - i32.ge_u - if - block - local.get $1 - i32.const 10000 - i32.div_u - local.set $4 - local.get $1 - i32.const 10000 - i32.rem_u - local.set $5 - local.get $4 - local.set $1 - local.get $5 - i32.const 100 - i32.div_u - local.set $6 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $0 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $4 + local.get $3 + i32.const 1 + i32.sub + local.set $5 + block $break|1 + loop $continue|1 local.get $5 - i32.const 100 - i32.rem_u - local.set $7 - block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i64) - local.get $3 - local.set $8 - local.get $6 - local.set $9 - i32.const 0 - local.set $10 - local.get $8 - local.get $9 + i32.const 0 + i32.ge_s + if + local.get $0 + local.get $5 i32.const 2 i32.shl i32.add - local.get $10 - i32.add - i64.load32_u offset=8 - end - local.set $11 - block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i64) - local.get $3 - local.set $10 - local.get $7 - local.set $9 + i32.load + local.set $6 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $6 + local.get $2 + call_indirect (type $FUNCSIG$iii) + end i32.const 0 - local.set $8 - local.get $10 - local.get $9 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.add - i64.load32_u offset=8 + i32.lt_s + if + local.get $0 + block (result i32) + local.get $5 + local.tee $7 + i32.const 1 + i32.sub + local.set $5 + local.get $7 + end + i32.const 1 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store + else + br $break|1 + end + br $continue|1 end - local.set $12 - local.get $2 - i32.const 4 - i32.sub - local.set $2 - local.get $0 - local.get $2 - i32.const 1 - i32.shl - i32.add - local.get $11 - local.get $12 - i64.const 32 - i64.shl - i64.or - i64.store offset=4 end - br $continue|0 end - end - end - local.get $1 - i32.const 100 - i32.ge_u - if - local.get $1 - i32.const 100 - i32.div_u - local.set $7 - local.get $1 - i32.const 100 - i32.rem_u - local.set $6 - local.get $7 - local.set $1 - local.get $2 - i32.const 2 - i32.sub - local.set $2 - block $~lib/internal/arraybuffer/LOAD|inlined.13 (result i32) - local.get $3 - local.set $5 - local.get $6 - local.set $4 - i32.const 0 - local.set $8 + local.get $0 local.get $5 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $8 + i32.const 1 i32.add - i32.load offset=8 - end - local.set $8 - local.get $0 - local.get $2 - i32.const 1 - i32.shl - i32.add - local.get $8 - i32.store offset=4 - end - local.get $1 - i32.const 10 - i32.ge_u - if - local.get $2 - i32.const 2 - i32.sub - local.set $2 - block $~lib/internal/arraybuffer/LOAD|inlined.14 (result i32) - local.get $3 - local.set $8 - local.get $1 - local.set $6 - i32.const 0 - local.set $7 - local.get $8 - local.get $6 i32.const 2 i32.shl i32.add - local.get $7 + local.get $4 + i32.store + local.get $3 + i32.const 1 i32.add - i32.load offset=8 + local.set $3 + br $repeat|0 + unreachable end - local.set $7 - local.get $0 - local.get $2 - i32.const 1 - i32.shl - i32.add - local.get $7 - i32.store offset=4 - else - local.get $2 - i32.const 1 - i32.sub - local.set $2 - i32.const 48 - local.get $1 - i32.add - local.set $7 - local.get $0 - local.get $2 - i32.const 1 - i32.shl - i32.add - local.get $7 - i32.store16 offset=4 - end - ) - (func $~lib/internal/number/itoa32 (; 183 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $0 - i32.eqz - if - i32.const 4312 - return - end - local.get $0 - i32.const 0 - i32.lt_s - local.set $1 - local.get $1 - if - i32.const 0 - local.get $0 - i32.sub - local.set $0 - end - local.get $0 - call $~lib/internal/number/decimalCount32 - local.get $1 - i32.add - local.set $2 - local.get $2 - call $~lib/internal/string/allocateUnsafe - local.set $3 - block $~lib/internal/number/utoa32_core|inlined.0 - local.get $3 - local.set $4 - local.get $0 - local.set $5 - local.get $2 - local.set $6 - local.get $4 - local.get $5 - local.get $6 - call $~lib/internal/number/utoa32_lut - end - local.get $1 - if - local.get $3 - i32.const 45 - i32.store16 offset=4 - end - local.get $3 - ) - (func $~lib/internal/number/itoa (; 184 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - call $~lib/internal/number/itoa32 - return + unreachable + end ) - (func $~lib/internal/number/itoa_stream (; 185 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/sort/weakHeapSort (; 148 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - local.get $0 + (local $8 i32) + (local $9 i32) + (local $10 i32) local.get $1 - i32.const 1 - i32.shl + i32.const 31 i32.add - local.set $0 - local.get $2 - i32.eqz - if - local.get $0 - i32.const 48 - i32.store16 offset=4 - i32.const 1 - return - end - i32.const 0 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl local.set $3 - local.get $2 + local.get $3 i32.const 0 - i32.lt_s + call $~lib/rt/tlsf/__alloc local.set $4 local.get $4 - if - i32.const 0 - local.get $2 + i32.const 0 + local.get $3 + call $~lib/memory/memory.fill + block $break|0 + local.get $1 + i32.const 1 i32.sub - local.set $2 - end - local.get $2 - call $~lib/internal/number/decimalCount32 - local.get $4 - i32.add - local.set $3 - block $~lib/internal/number/utoa32_core|inlined.1 - local.get $0 local.set $5 - local.get $2 - local.set $6 - local.get $3 - local.set $7 - local.get $5 - local.get $6 - local.get $7 - call $~lib/internal/number/utoa32_lut - end - local.get $4 - if - local.get $0 - i32.const 45 - i32.store16 offset=4 - end - local.get $3 - ) - (func $~lib/array/Array#join (; 186 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - local.get $0 - i32.load offset=4 - i32.const 1 - i32.sub - local.set $2 - local.get $2 - i32.const 0 - i32.lt_s - if - i32.const 3904 - return - end - i32.const 3904 - local.set $3 - local.get $0 - i32.load - local.set $5 - local.get $1 - i32.load - local.set $6 - local.get $6 - i32.const 0 - i32.ne - local.set $7 - local.get $2 - i32.eqz - if - block $~lib/internal/arraybuffer/LOAD|inlined.34 (result i32) + loop $repeat|0 local.get $5 - local.set $8 - i32.const 0 - local.set $9 i32.const 0 - local.set $10 - local.get $8 - local.get $9 + i32.gt_s + i32.eqz + br_if $break|0 + local.get $5 + local.set $6 + block $break|1 + loop $continue|1 + local.get $6 + i32.const 1 + i32.and + local.get $4 + local.get $6 + i32.const 6 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + local.get $6 + i32.const 1 + i32.shr_s + i32.const 31 + i32.and + i32.shr_u + i32.const 1 + i32.and + i32.eq + if + local.get $6 + i32.const 1 + i32.shr_s + local.set $6 + br $continue|1 + end + end + end + local.get $6 + i32.const 1 + i32.shr_s + local.set $7 + local.get $0 + local.get $7 i32.const 2 i32.shl i32.add - local.get $10 + i32.load + local.set $8 + local.get $0 + local.get $5 + i32.const 2 + i32.shl i32.add - i32.load offset=8 + i32.load + local.set $9 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $8 + local.get $9 + local.get $2 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 + i32.lt_s + if + local.get $4 + local.get $5 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + local.get $4 + local.get $5 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + i32.const 1 + local.get $5 + i32.const 31 + i32.and + i32.shl + i32.xor + i32.store + local.get $0 + local.get $5 + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store + local.get $0 + local.get $7 + i32.const 2 + i32.shl + i32.add + local.get $9 + i32.store + end + local.get $5 + i32.const 1 + i32.sub + local.set $5 + br $repeat|0 + unreachable end - call $~lib/internal/number/itoa - return + unreachable end - i32.const 11 - local.get $6 - i32.add - local.get $2 - i32.mul - i32.const 11 - i32.add - local.set $10 - local.get $10 - call $~lib/internal/string/allocateUnsafe - local.set $9 - i32.const 0 - local.set $8 - block $break|0 - i32.const 0 - local.set $11 - loop $repeat|0 - local.get $11 - local.get $2 - i32.lt_s + block $break|2 + local.get $1 + i32.const 1 + i32.sub + local.set $9 + loop $repeat|2 + local.get $9 + i32.const 2 + i32.ge_s i32.eqz - br_if $break|0 - block - block $~lib/internal/arraybuffer/LOAD|inlined.35 (result i32) - local.get $5 - local.set $12 - local.get $11 - local.set $13 - i32.const 0 - local.set $14 - local.get $12 - local.get $13 + br_if $break|2 + local.get $0 + i32.load + local.set $8 + local.get $0 + local.get $0 + local.get $9 + i32.const 2 + i32.shl + i32.add + i32.load + i32.store + local.get $0 + local.get $9 + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store + i32.const 1 + local.set $7 + block $break|3 + loop $continue|3 + local.get $7 + i32.const 1 + i32.shl + local.get $4 + local.get $7 + i32.const 5 + i32.shr_s i32.const 2 i32.shl i32.add - local.get $14 + i32.load + local.get $7 + i32.const 31 + i32.and + i32.shr_u + i32.const 1 + i32.and i32.add - i32.load offset=8 - end - local.set $4 - local.get $8 - local.get $9 - local.get $8 - local.get $4 - call $~lib/internal/number/itoa_stream - i32.add - local.set $8 - local.get $7 - if + local.tee $6 local.get $9 - local.get $8 - local.get $1 + i32.lt_s + if + local.get $6 + local.set $7 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $7 i32.const 0 - local.get $6 - call $~lib/internal/string/copyUnsafe - local.get $8 - local.get $6 - i32.add - local.set $8 + i32.gt_s + if + local.get $0 + i32.load + local.set $8 + local.get $0 + local.get $7 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $5 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $8 + local.get $5 + local.get $2 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 + i32.lt_s + if + local.get $4 + local.get $7 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + local.get $4 + local.get $7 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + i32.const 1 + local.get $7 + i32.const 31 + i32.and + i32.shl + i32.xor + i32.store + local.get $0 + local.get $7 + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store + local.get $0 + local.get $5 + i32.store + end + local.get $7 + i32.const 1 + i32.shr_s + local.set $7 + br $continue|4 + end end end - local.get $11 + local.get $9 i32.const 1 - i32.add - local.set $11 - br $repeat|0 + i32.sub + local.set $9 + br $repeat|2 unreachable end unreachable end - block $~lib/internal/arraybuffer/LOAD|inlined.36 (result i32) - local.get $5 - local.set $11 - local.get $2 - local.set $14 - i32.const 0 - local.set $13 - local.get $11 - local.get $14 - i32.const 2 - i32.shl - i32.add - local.get $13 - i32.add - i32.load offset=8 - end - local.set $4 - local.get $8 - local.get $9 - local.get $8 local.get $4 - call $~lib/internal/number/itoa_stream - i32.add - local.set $8 - local.get $9 - local.set $13 - local.get $10 - local.get $8 - i32.gt_s - if - local.get $9 - i32.const 0 - local.get $8 - call $~lib/string/String#substring - local.set $13 - block $~lib/internal/string/freeUnsafe|inlined.1 - local.get $9 - local.set $14 - local.get $14 - i32.eqz - if - i32.const 0 - i32.const 4088 - i32.const 28 - i32.const 4 - call $~lib/env/abort - unreachable - end - block $~lib/memory/memory.free|inlined.6 - local.get $14 - local.set $11 - local.get $11 - call $~lib/allocator/arena/__memory_free - br $~lib/memory/memory.free|inlined.6 - end - end - end - local.get $13 - return - ) - (func $~lib/internal/number/utoa32 (; 187 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) + call $~lib/rt/tlsf/__free local.get $0 - i32.eqz - if - i32.const 4312 - return - end + i32.load offset=4 + local.set $10 local.get $0 - call $~lib/internal/number/decimalCount32 - local.set $1 - local.get $1 - call $~lib/internal/string/allocateUnsafe - local.set $2 - block $~lib/internal/number/utoa32_core|inlined.2 - local.get $2 - local.set $3 - local.get $0 - local.set $4 - local.get $1 - local.set $5 - local.get $3 - local.get $4 - local.get $5 - call $~lib/internal/number/utoa32_lut - end - local.get $2 - ) - (func $~lib/internal/number/itoa (; 188 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - call $~lib/internal/number/utoa32 - return + i32.load + i32.store offset=4 + local.get $0 + local.get $10 + i32.store ) - (func $~lib/internal/number/itoa_stream (; 189 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#sort (; 149 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) local.get $0 - local.get $1 - i32.const 1 - i32.shl - i32.add - local.set $0 + i32.load offset=12 + local.set $2 local.get $2 - i32.eqz + i32.const 1 + i32.le_s if local.get $0 - i32.const 48 - i32.store16 offset=4 - i32.const 1 + call $~lib/rt/pure/__retain return end - i32.const 0 + local.get $0 + i32.load offset=4 local.set $3 local.get $2 - call $~lib/internal/number/decimalCount32 - local.set $3 - block $~lib/internal/number/utoa32_core|inlined.3 - local.get $0 + i32.const 2 + i32.eq + if + local.get $3 + i32.load offset=4 local.set $4 - local.get $2 + local.get $3 + i32.load local.set $5 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $5 + local.get $1 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 + i32.lt_s + if + local.get $3 + local.get $5 + i32.store offset=4 + local.get $3 + local.get $4 + i32.store + end + local.get $0 + call $~lib/rt/pure/__retain + return + end + block $~lib/util/sort/SORT|inlined.0 local.get $3 local.set $6 - local.get $4 + local.get $2 + local.set $5 + local.get $1 + local.set $4 local.get $5 - local.get $6 - call $~lib/internal/number/utoa32_lut + i32.const 256 + i32.lt_s + if + local.get $6 + local.get $5 + local.get $4 + call $~lib/util/sort/insertionSort + else + local.get $6 + local.get $5 + local.get $4 + call $~lib/util/sort/weakHeapSort + end + end + local.get $0 + call $~lib/rt/pure/__retain + ) + (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 150 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + local.get $1 + i32.sub + ) + (func $~lib/array/Array#sort|trampoline (; 151 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + block $1of1 + block $0of1 + block $outOfRange + global.get $~lib/argc + br_table $0of1 $1of1 $outOfRange + end + unreachable + end + block $~lib/util/sort/COMPARATOR|inlined.0 (result i32) + i32.const 46 + br $~lib/util/sort/COMPARATOR|inlined.0 + end + local.set $1 end - local.get $3 + local.get $0 + local.get $1 + call $~lib/array/Array#sort ) - (func $~lib/array/Array#join (; 190 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) + (func $~lib/util/sort/insertionSort (; 152 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - local.get $0 - i32.load offset=4 - i32.const 1 - i32.sub - local.set $2 - local.get $2 - i32.const 0 - i32.lt_s - if - i32.const 3904 - return - end - i32.const 3904 - local.set $3 - local.get $0 - i32.load - local.set $5 - local.get $1 - i32.load - local.set $6 - local.get $6 - i32.const 0 - i32.ne - local.set $7 - local.get $2 - i32.eqz - if - block $~lib/internal/arraybuffer/LOAD|inlined.15 (result i32) - local.get $5 - local.set $8 - i32.const 0 - local.set $9 - i32.const 0 - local.set $10 - local.get $8 - local.get $9 - i32.const 2 - i32.shl - i32.add - local.get $10 - i32.add - i32.load offset=8 - end - call $~lib/internal/number/itoa - return - end - i32.const 10 - local.get $6 - i32.add - local.get $2 - i32.mul - i32.const 10 - i32.add - local.set $10 - local.get $10 - call $~lib/internal/string/allocateUnsafe - local.set $9 - i32.const 0 - local.set $8 block $break|0 i32.const 0 - local.set $11 + local.set $3 loop $repeat|0 - local.get $11 - local.get $2 + local.get $3 + local.get $1 i32.lt_s i32.eqz br_if $break|0 - block - block $~lib/internal/arraybuffer/LOAD|inlined.16 (result i32) + local.get $0 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $4 + local.get $3 + i32.const 1 + i32.sub + local.set $5 + block $break|1 + loop $continue|1 local.get $5 - local.set $12 - local.get $11 - local.set $13 - i32.const 0 - local.set $14 - local.get $12 - local.get $13 - i32.const 2 - i32.shl - i32.add - local.get $14 - i32.add - i32.load offset=8 - end - local.set $4 - local.get $8 - local.get $9 - local.get $8 - local.get $4 - call $~lib/internal/number/itoa_stream - i32.add - local.set $8 - local.get $7 - if - local.get $9 - local.get $8 - local.get $1 i32.const 0 - local.get $6 - call $~lib/internal/string/copyUnsafe - local.get $8 - local.get $6 - i32.add - local.set $8 + i32.ge_s + if + local.get $0 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $6 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $6 + local.get $2 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 + i32.lt_s + if + local.get $0 + block (result i32) + local.get $5 + local.tee $7 + i32.const 1 + i32.sub + local.set $5 + local.get $7 + end + i32.const 1 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store + else + br $break|1 + end + br $continue|1 + end end end - local.get $11 + local.get $0 + local.get $5 i32.const 1 i32.add - local.set $11 - br $repeat|0 - unreachable - end - unreachable - end - block $~lib/internal/arraybuffer/LOAD|inlined.17 (result i32) - local.get $5 - local.set $11 - local.get $2 - local.set $14 - i32.const 0 - local.set $13 - local.get $11 - local.get $14 - i32.const 2 - i32.shl - i32.add - local.get $13 - i32.add - i32.load offset=8 - end - local.set $4 - local.get $8 - local.get $9 - local.get $8 - local.get $4 - call $~lib/internal/number/itoa_stream - i32.add - local.set $8 - local.get $9 - local.set $13 - local.get $10 - local.get $8 - i32.gt_s - if - local.get $9 - i32.const 0 - local.get $8 - call $~lib/string/String#substring - local.set $13 - block $~lib/internal/string/freeUnsafe|inlined.2 - local.get $9 - local.set $14 - local.get $14 - i32.eqz - if - i32.const 0 - i32.const 4088 - i32.const 28 - i32.const 4 - call $~lib/env/abort - unreachable - end - block $~lib/memory/memory.free|inlined.7 - local.get $14 - local.set $11 - local.get $11 - call $~lib/allocator/arena/__memory_free - br $~lib/memory/memory.free|inlined.7 - end - end - end - local.get $13 - return - ) - (func $~lib/builtins/isFinite (; 191 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) - local.get $0 - local.get $0 - f64.sub - f64.const 0 - f64.eq - ) - (func $~lib/internal/number/genDigits (; 192 ;) (type $FUNCSIG$iijijiji) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (param $6 i32) (result i32) - (local $7 i32) - (local $8 i64) - (local $9 i64) - (local $10 i64) - (local $11 i32) - (local $12 i32) - (local $13 i64) - (local $14 i32) - (local $15 i32) - (local $16 i32) - (local $17 i32) - (local $18 i32) - (local $19 i64) - (local $20 i32) - (local $21 i64) - (local $22 i64) - (local $23 i32) - (local $24 i32) - (local $25 i32) - (local $26 i64) - (local $27 i64) - i32.const 0 - local.get $4 - i32.sub - local.set $7 - i64.const 1 - local.get $7 - i64.extend_i32_s - i64.shl - local.set $8 - local.get $8 - i64.const 1 - i64.sub - local.set $9 - local.get $3 + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end + unreachable + end + ) + (func $~lib/util/sort/weakHeapSort (; 153 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) local.get $1 - i64.sub - local.set $10 - local.get $4 - local.set $11 + i32.const 31 + i32.add + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + local.set $3 local.get $3 - local.get $7 - i64.extend_i32_s - i64.shr_u - i32.wrap_i64 - local.set $12 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $4 + local.get $4 + i32.const 0 local.get $3 - local.get $9 - i64.and - local.set $13 - local.get $12 - call $~lib/internal/number/decimalCount32 - local.set $14 - local.get $6 - local.set $15 - i32.const 6616 - i32.load - local.set $16 + call $~lib/memory/memory.fill block $break|0 - loop $continue|0 - local.get $14 + local.get $1 + i32.const 1 + i32.sub + local.set $5 + loop $repeat|0 + local.get $5 i32.const 0 i32.gt_s - if - block - block $break|1 - block $case10|1 - block $case9|1 - block $case8|1 - block $case7|1 - block $case6|1 - block $case5|1 - block $case4|1 - block $case3|1 - block $case2|1 - block $case1|1 - block $case0|1 - local.get $14 - local.set $18 - local.get $18 - i32.const 10 - i32.eq - br_if $case0|1 - local.get $18 - i32.const 9 - i32.eq - br_if $case1|1 - local.get $18 - i32.const 8 - i32.eq - br_if $case2|1 - local.get $18 - i32.const 7 - i32.eq - br_if $case3|1 - local.get $18 - i32.const 6 - i32.eq - br_if $case4|1 - local.get $18 - i32.const 5 - i32.eq - br_if $case5|1 - local.get $18 - i32.const 4 - i32.eq - br_if $case6|1 - local.get $18 - i32.const 3 - i32.eq - br_if $case7|1 - local.get $18 - i32.const 2 - i32.eq - br_if $case8|1 - local.get $18 - i32.const 1 - i32.eq - br_if $case9|1 - br $case10|1 - end - block - local.get $12 - i32.const 1000000000 - i32.div_u - local.set $17 - local.get $12 - i32.const 1000000000 - i32.rem_u - local.set $12 - br $break|1 - unreachable - end - unreachable - end - block - local.get $12 - i32.const 100000000 - i32.div_u - local.set $17 - local.get $12 - i32.const 100000000 - i32.rem_u - local.set $12 - br $break|1 - unreachable - end - unreachable - end - block - local.get $12 - i32.const 10000000 - i32.div_u - local.set $17 - local.get $12 - i32.const 10000000 - i32.rem_u - local.set $12 - br $break|1 - unreachable - end - unreachable - end - block - local.get $12 - i32.const 1000000 - i32.div_u - local.set $17 - local.get $12 - i32.const 1000000 - i32.rem_u - local.set $12 - br $break|1 - unreachable - end - unreachable - end - block - local.get $12 - i32.const 100000 - i32.div_u - local.set $17 - local.get $12 - i32.const 100000 - i32.rem_u - local.set $12 - br $break|1 - unreachable - end - unreachable - end - block - local.get $12 - i32.const 10000 - i32.div_u - local.set $17 - local.get $12 - i32.const 10000 - i32.rem_u - local.set $12 - br $break|1 - unreachable - end - unreachable - end - block - local.get $12 - i32.const 1000 - i32.div_u - local.set $17 - local.get $12 - i32.const 1000 - i32.rem_u - local.set $12 - br $break|1 - unreachable - end - unreachable - end - block - local.get $12 - i32.const 100 - i32.div_u - local.set $17 - local.get $12 - i32.const 100 - i32.rem_u - local.set $12 - br $break|1 - unreachable - end - unreachable - end - block - local.get $12 - i32.const 10 - i32.div_u - local.set $17 - local.get $12 - i32.const 10 - i32.rem_u - local.set $12 - br $break|1 - unreachable - end - unreachable - end - block - local.get $12 - local.set $17 - i32.const 0 - local.set $12 - br $break|1 - unreachable - end - unreachable - end - block - i32.const 0 - local.set $17 - br $break|1 - unreachable - end - unreachable + i32.eqz + br_if $break|0 + local.get $5 + local.set $6 + block $break|1 + loop $continue|1 + local.get $6 + i32.const 1 + i32.and + local.get $4 + local.get $6 + i32.const 6 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + local.get $6 + i32.const 1 + i32.shr_s + i32.const 31 + i32.and + i32.shr_u + i32.const 1 + i32.and + i32.eq + if + local.get $6 + i32.const 1 + i32.shr_s + local.set $6 + br $continue|1 end - local.get $17 - local.get $15 - i32.or + end + end + local.get $6 + i32.const 1 + i32.shr_s + local.set $7 + local.get $0 + local.get $7 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $8 + local.get $0 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $9 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $8 + local.get $9 + local.get $2 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 + i32.lt_s + if + local.get $4 + local.get $5 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + local.get $4 + local.get $5 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + i32.const 1 + local.get $5 + i32.const 31 + i32.and + i32.shl + i32.xor + i32.store + local.get $0 + local.get $5 + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store + local.get $0 + local.get $7 + i32.const 2 + i32.shl + i32.add + local.get $9 + i32.store + end + local.get $5 + i32.const 1 + i32.sub + local.set $5 + br $repeat|0 + unreachable + end + unreachable + end + block $break|2 + local.get $1 + i32.const 1 + i32.sub + local.set $9 + loop $repeat|2 + local.get $9 + i32.const 2 + i32.ge_s + i32.eqz + br_if $break|2 + local.get $0 + i32.load + local.set $8 + local.get $0 + local.get $0 + local.get $9 + i32.const 2 + i32.shl + i32.add + i32.load + i32.store + local.get $0 + local.get $9 + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store + i32.const 1 + local.set $7 + block $break|3 + loop $continue|3 + local.get $7 + i32.const 1 + i32.shl + local.get $4 + local.get $7 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + local.get $7 + i32.const 31 + i32.and + i32.shr_u + i32.const 1 + i32.and + i32.add + local.tee $6 + local.get $9 + i32.lt_s if - local.get $0 - block (result i32) - local.get $15 - local.tee $18 - i32.const 1 - i32.add - local.set $15 - local.get $18 - end - i32.const 1 - i32.shl - i32.add - i32.const 48 - local.get $17 - i32.const 65535 - i32.and - i32.add - i32.store16 offset=4 + local.get $6 + local.set $7 + br $continue|3 end - local.get $14 - i32.const 1 - i32.sub - local.set $14 - local.get $12 - i64.extend_i32_u + end + end + block $break|4 + loop $continue|4 local.get $7 - i64.extend_i32_s - i64.shl - local.get $13 - i64.add - local.set $19 - local.get $19 - local.get $5 - i64.le_u + i32.const 0 + i32.gt_s if - global.get $~lib/internal/number/_K - local.get $14 + local.get $0 + i32.load + local.set $8 + local.get $0 + local.get $7 + i32.const 2 + i32.shl i32.add - global.set $~lib/internal/number/_K - block $~lib/internal/number/grisuRound|inlined.0 - local.get $0 - local.set $18 - local.get $15 - local.set $20 + i32.load + local.set $5 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $8 local.get $5 - local.set $21 - local.get $19 - local.set $22 - block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i64) - local.get $16 - local.set $23 - local.get $14 - local.set $24 - i32.const 0 - local.set $25 - local.get $23 - local.get $24 - i32.const 2 - i32.shl - i32.add - local.get $25 - i32.add - i64.load32_u offset=8 - end + local.get $2 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 + i32.lt_s + if + local.get $4 local.get $7 - i64.extend_i32_s - i64.shl - local.set $26 - local.get $10 - local.set $27 - local.get $18 - local.get $20 - i32.const 1 - i32.sub + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + local.get $4 + local.get $7 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load i32.const 1 + local.get $7 + i32.const 31 + i32.and + i32.shl + i32.xor + i32.store + local.get $0 + local.get $7 + i32.const 2 i32.shl i32.add - local.set $25 - local.get $25 - i32.load16_u offset=4 - local.set $24 - block $break|2 - loop $continue|2 - local.get $22 - local.get $27 - i64.lt_u - local.tee $23 - if (result i32) - local.get $21 - local.get $22 - i64.sub - local.get $26 - i64.ge_u - else - local.get $23 - end - local.tee $23 - if (result i32) - local.get $22 - local.get $26 - i64.add - local.get $27 - i64.lt_u - local.tee $23 - if (result i32) - local.get $23 - else - local.get $27 - local.get $22 - i64.sub - local.get $22 - local.get $26 - i64.add - local.get $27 - i64.sub - i64.gt_u - end - else - local.get $23 - end - if - block - local.get $24 - i32.const 1 - i32.sub - local.set $24 - local.get $22 - local.get $26 - i64.add - local.set $22 - end - br $continue|2 - end - end - end - local.get $25 - local.get $24 - i32.store16 offset=4 + local.get $8 + i32.store + local.get $0 + local.get $5 + i32.store end - local.get $15 - return + local.get $7 + i32.const 1 + i32.shr_s + local.set $7 + br $continue|4 end end - br $continue|0 end + local.get $9 + i32.const 1 + i32.sub + local.set $9 + br $repeat|2 + unreachable + end + unreachable + end + local.get $4 + call $~lib/rt/tlsf/__free + local.get $0 + i32.load offset=4 + local.set $10 + local.get $0 + local.get $0 + i32.load + i32.store offset=4 + local.get $0 + local.get $10 + i32.store + ) + (func $~lib/array/Array#sort (; 154 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $0 + i32.load offset=12 + local.set $2 + local.get $2 + i32.const 1 + i32.le_s + if + local.get $0 + call $~lib/rt/pure/__retain + return + end + local.get $0 + i32.load offset=4 + local.set $3 + local.get $2 + i32.const 2 + i32.eq + if + local.get $3 + i32.load offset=4 + local.set $4 + local.get $3 + i32.load + local.set $5 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $5 + local.get $1 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 + i32.lt_s + if + local.get $3 + local.get $5 + i32.store offset=4 + local.get $3 + local.get $4 + i32.store + end + local.get $0 + call $~lib/rt/pure/__retain + return + end + block $~lib/util/sort/SORT|inlined.0 + local.get $3 + local.set $6 + local.get $2 + local.set $5 + local.get $1 + local.set $4 + local.get $5 + i32.const 256 + i32.lt_s + if + local.get $6 + local.get $5 + local.get $4 + call $~lib/util/sort/insertionSort + else + local.get $6 + local.get $5 + local.get $4 + call $~lib/util/sort/weakHeapSort + end + end + local.get $0 + call $~lib/rt/pure/__retain + ) + (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 155 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + local.get $1 + i32.gt_u + local.get $0 + local.get $1 + i32.lt_u + i32.sub + ) + (func $~lib/array/Array#sort|trampoline (; 156 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + block $1of1 + block $0of1 + block $outOfRange + global.get $~lib/argc + br_table $0of1 $1of1 $outOfRange + end + unreachable end + block $~lib/util/sort/COMPARATOR|inlined.0 (result i32) + i32.const 47 + br $~lib/util/sort/COMPARATOR|inlined.0 + end + local.set $1 end - block $break|3 - loop $continue|3 + local.get $0 + local.get $1 + call $~lib/array/Array#sort + ) + (func $~lib/array/Array.create (; 157 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + i32.const 268435452 + i32.gt_u + if + i32.const 24 + i32.const 488 + i32.const 45 + i32.const 61 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 2 + i32.const 3 + i32.const 0 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 + i32.const 0 + i32.store offset=12 + local.get $1 + i32.load offset=4 + i32.const 0 + local.get $1 + i32.load offset=8 + call $~lib/memory/memory.fill + local.get $1 + ) + (func $std/array/createReverseOrderedArray (; 158 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + call $~lib/array/Array.create + local.set $1 + block $break|0 + i32.const 0 + local.set $2 + loop $repeat|0 + local.get $2 + local.get $0 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $1 + local.get $2 + local.get $0 i32.const 1 - if - block - local.get $13 - i64.const 10 - i64.mul - local.set $13 - local.get $5 - i64.const 10 - i64.mul - local.set $5 - local.get $13 - local.get $7 - i64.extend_i32_s - i64.shr_u - local.set $19 - local.get $19 - local.get $15 - i64.extend_i32_s - i64.or - i64.const 0 - i64.ne - if - local.get $0 - block (result i32) - local.get $15 - local.tee $17 - i32.const 1 - i32.add - local.set $15 - local.get $17 - end - i32.const 1 - i32.shl - i32.add - i32.const 48 - local.get $19 - i32.wrap_i64 - i32.const 65535 - i32.and - i32.add - i32.store16 offset=4 - end - local.get $13 - local.get $9 - i64.and - local.set $13 - local.get $14 - i32.const 1 - i32.sub - local.set $14 - local.get $13 - local.get $5 - i64.lt_u - if - global.get $~lib/internal/number/_K - local.get $14 - i32.add - global.set $~lib/internal/number/_K - local.get $10 - block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i64) - local.get $16 - local.set $17 - i32.const 0 - local.get $14 - i32.sub - local.set $24 - i32.const 0 - local.set $25 - local.get $17 - local.get $24 - i32.const 2 - i32.shl - i32.add - local.get $25 - i32.add - i64.load32_u offset=8 - end - i64.mul - local.set $10 - block $~lib/internal/number/grisuRound|inlined.1 - local.get $0 - local.set $25 - local.get $15 - local.set $24 - local.get $5 - local.set $27 - local.get $13 - local.set $26 - local.get $8 - local.set $22 - local.get $10 - local.set $21 - local.get $25 - local.get $24 - i32.const 1 - i32.sub - i32.const 1 - i32.shl - i32.add - local.set $17 - local.get $17 - i32.load16_u offset=4 - local.set $20 - block $break|4 - loop $continue|4 - local.get $26 - local.get $21 - i64.lt_u - local.tee $18 - if (result i32) - local.get $27 - local.get $26 - i64.sub - local.get $22 - i64.ge_u - else - local.get $18 - end - local.tee $18 - if (result i32) - local.get $26 - local.get $22 - i64.add - local.get $21 - i64.lt_u - local.tee $18 - if (result i32) - local.get $18 - else - local.get $21 - local.get $26 - i64.sub - local.get $26 - local.get $22 - i64.add - local.get $21 - i64.sub - i64.gt_u - end - else - local.get $18 - end - if - block - local.get $20 - i32.const 1 - i32.sub - local.set $20 - local.get $26 - local.get $22 - i64.add - local.set $26 - end - br $continue|4 - end - end - end - local.get $17 - local.get $20 - i32.store16 offset=4 - end - local.get $15 - return - end - end - br $continue|3 + i32.sub + local.get $2 + i32.sub + call $~lib/array/Array#__set + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + ) + (func $~lib/math/NativeMath.random (; 159 ;) (type $FUNCSIG$d) (result f64) + (local $0 i64) + (local $1 i64) + (local $2 i64) + global.get $~lib/math/random_seeded + i32.eqz + if + i32.const 3936 + i32.const 3160 + i32.const 1029 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/math/random_state0_64 + local.set $0 + global.get $~lib/math/random_state1_64 + local.set $1 + local.get $1 + global.set $~lib/math/random_state0_64 + local.get $0 + local.get $0 + i64.const 23 + i64.shl + i64.xor + local.set $0 + local.get $0 + local.get $0 + i64.const 17 + i64.shr_u + i64.xor + local.set $0 + local.get $0 + local.get $1 + i64.xor + local.set $0 + local.get $0 + local.get $1 + i64.const 26 + i64.shr_u + i64.xor + local.set $0 + local.get $0 + global.set $~lib/math/random_state1_64 + local.get $1 + local.get $0 + i64.add + i64.const 4503599627370495 + i64.and + i64.const 4607182418800017408 + i64.or + local.set $2 + local.get $2 + f64.reinterpret_i64 + f64.const 1 + f64.sub + ) + (func $std/array/createRandomOrderedArray (; 160 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + call $~lib/array/Array.create + local.set $1 + block $break|0 + i32.const 0 + local.set $2 + loop $repeat|0 + local.get $2 + local.get $0 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $1 + local.get $2 + call $~lib/math/NativeMath.random + local.get $0 + f64.convert_i32_s + f64.mul + i32.trunc_f64_s + call $~lib/array/Array#__set + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + ) + (func $~lib/util/sort/COMPARATOR~anonymous|1 (; 161 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + local.get $1 + i32.sub + ) + (func $std/array/isSorted (; 162 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + block $break|0 + block + i32.const 1 + local.set $2 + local.get $0 + call $~lib/array/Array#get:length + local.set $3 + end + loop $repeat|0 + local.get $2 + local.get $3 + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $0 + local.get $2 + i32.const 1 + i32.sub + call $~lib/array/Array#__get + local.get $0 + local.get $2 + call $~lib/array/Array#__get + local.get $1 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 + i32.gt_s + if + i32.const 0 + local.set $4 + local.get $0 + call $~lib/rt/pure/__release + local.get $4 + return end + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $repeat|0 + unreachable end + unreachable end - local.get $15 + i32.const 1 + local.set $3 + local.get $0 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/internal/number/prettify (; 193 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - local.get $2 + (func $std/array/assertSorted (; 163 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array#sort + local.tee $2 + local.get $1 + call $std/array/isSorted i32.eqz if - local.get $0 - local.get $1 - i32.const 1 - i32.shl - i32.add - i32.const 46 - i32.const 48 - i32.const 16 - i32.shl - i32.or - i32.store offset=4 - local.get $1 + i32.const 0 + i32.const 376 + i32.const 830 i32.const 2 - i32.add - return + call $~lib/builtins/abort + unreachable + end + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + ) + (func $std/array/assertSortedDefault (; 164 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $0 + block $~lib/util/sort/COMPARATOR|inlined.1 (result i32) + i32.const 48 + br $~lib/util/sort/COMPARATOR|inlined.1 + end + call $std/array/assertSorted + local.get $0 + call $~lib/rt/pure/__release + ) + (func $start:std/array~anonymous|43 (; 165 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + local.get $1 + i32.sub + ) + (func $start:std/array~anonymous|44 (; 166 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 + local.get $0 + i32.sub + ) + (func $start:std/array~anonymous|45 (; 167 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + local.get $1 + i32.sub + ) + (func $start:std/array~anonymous|46 (; 168 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 + local.get $0 + i32.sub + ) + (func $~lib/array/Array.create<~lib/array/Array> (; 169 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + i32.const 268435452 + i32.gt_u + if + i32.const 24 + i32.const 488 + i32.const 45 + i32.const 61 + call $~lib/builtins/abort + unreachable end + local.get $0 + i32.const 2 + i32.const 10 + i32.const 0 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 + i32.const 0 + i32.store offset=12 + local.get $1 + i32.load offset=4 + i32.const 0 + local.get $1 + i32.load offset=8 + call $~lib/memory/memory.fill local.get $1 + ) + (func $~lib/array/Array<~lib/array/Array>#__unchecked_set (; 170 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl i32.add local.set $3 - local.get $1 local.get $3 - i32.le_s - local.tee $4 - if (result i32) + i32.load + local.set $4 + local.get $2 + local.get $4 + i32.ne + if local.get $3 - i32.const 21 - i32.le_s - else + local.get $2 + call $~lib/rt/pure/__retain + i32.store local.get $4 + call $~lib/rt/pure/__release end + local.get $2 + call $~lib/rt/pure/__release + ) + (func $~lib/array/Array<~lib/array/Array>#__set (; 171 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.load offset=12 + local.set $3 + local.get $1 + local.get $3 + i32.gt_u if - block $break|0 - local.get $1 - local.set $4 - loop $repeat|0 - local.get $4 - local.get $3 - i32.lt_s - i32.eqz - br_if $break|0 - local.get $0 - local.get $4 - i32.const 1 - i32.shl - i32.add - i32.const 48 - i32.store16 offset=4 - local.get $4 - i32.const 1 - i32.add - local.set $4 - br $repeat|0 - unreachable - end + local.get $2 + call $~lib/rt/pure/__release + block + i32.const 4040 + i32.const 488 + i32.const 121 + i32.const 38 + call $~lib/builtins/abort + unreachable unreachable end + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.const 2 + call $~lib/array/ensureSize + local.get $0 + local.get $1 + local.get $2 + call $~lib/array/Array<~lib/array/Array>#__unchecked_set + local.get $1 + local.get $3 + i32.ge_s + if local.get $0 - local.get $3 + local.get $1 i32.const 1 - i32.shl - i32.add - i32.const 46 - i32.const 48 - i32.const 16 - i32.shl - i32.or - i32.store offset=4 - local.get $3 - i32.const 2 i32.add - return - else - local.get $3 + i32.store offset=12 + end + local.get $2 + call $~lib/rt/pure/__release + ) + (func $std/array/createReverseOrderedNestedArray (; 172 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + call $~lib/array/Array.create<~lib/array/Array> + local.set $1 + block $break|0 + i32.const 0 + local.set $2 + loop $repeat|0 + local.get $2 + local.get $0 + i32.lt_s + i32.eqz + br_if $break|0 + i32.const 1 + call $~lib/array/Array.create + local.set $3 + local.get $3 + i32.const 0 + local.get $0 + i32.const 1 + i32.sub + local.get $2 + i32.sub + call $~lib/array/Array#__set + local.get $1 + local.get $2 + local.get $3 + call $~lib/array/Array<~lib/array/Array>#__set + local.get $3 + call $~lib/rt/pure/__release + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + ) + (func $start:std/array~anonymous|47 (; 173 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.const 0 + call $~lib/array/Array#__get + local.get $1 + i32.const 0 + call $~lib/array/Array#__get + i32.sub + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + ) + (func $~lib/util/sort/insertionSort<~lib/array/Array> (; 174 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + block $break|0 i32.const 0 - i32.gt_s - local.tee $4 - if (result i32) + local.set $3 + loop $repeat|0 local.get $3 - i32.const 21 - i32.le_s - else - local.get $4 - end - if + local.get $1 + i32.lt_s + i32.eqz + br_if $break|0 local.get $0 local.get $3 - i32.const 1 + i32.const 2 i32.shl i32.add + i32.load + call $~lib/rt/pure/__retain local.set $4 - block $~lib/memory/memory.copy|inlined.9 - local.get $4 - i32.const 4 - i32.add - i32.const 2 - i32.add - local.set $5 - local.get $4 - i32.const 4 - i32.add - local.set $6 - i32.const 0 - local.get $2 - i32.sub - i32.const 1 - i32.shl - local.set $7 - local.get $5 - local.get $6 - local.get $7 - call $~lib/internal/memory/memmove - end - local.get $0 local.get $3 i32.const 1 - i32.shl - i32.add - i32.const 46 - i32.store16 offset=4 - local.get $1 - i32.const 1 - i32.add - return - else - i32.const -6 - local.get $3 - i32.lt_s - local.tee $4 - if (result i32) - local.get $3 - i32.const 0 - i32.le_s - else - local.get $4 - end - if - i32.const 2 - local.get $3 - i32.sub - local.set $4 - block $~lib/memory/memory.copy|inlined.10 - local.get $0 - i32.const 4 - i32.add - local.get $4 - i32.const 1 - i32.shl - i32.add - local.set $7 - local.get $0 - i32.const 4 - i32.add - local.set $6 - local.get $1 - i32.const 1 - i32.shl - local.set $5 - local.get $7 - local.get $6 + i32.sub + local.set $5 + block $break|1 + loop $continue|1 local.get $5 - call $~lib/internal/memory/memmove - end - local.get $0 - i32.const 48 - i32.const 46 - i32.const 16 - i32.shl - i32.or - i32.store offset=4 - block $break|1 - i32.const 2 - local.set $5 - loop $repeat|1 - local.get $5 - local.get $4 - i32.lt_s - i32.eqz - br_if $break|1 + i32.const 0 + i32.ge_s + if local.get $0 local.get $5 - i32.const 1 + i32.const 2 i32.shl i32.add - i32.const 48 - i32.store16 offset=4 - local.get $5 - i32.const 1 - i32.add - local.set $5 - br $repeat|1 - unreachable - end - unreachable - end - local.get $1 - local.get $4 - i32.add - return - else - local.get $1 - i32.const 1 - i32.eq - if - local.get $0 - i32.const 101 - i32.store16 offset=6 - block $~lib/internal/number/genExponent|inlined.0 (result i32) - local.get $0 - i32.const 4 - i32.add - local.set $4 - local.get $3 - i32.const 1 - i32.sub - local.set $5 - local.get $5 - i32.const 0 - i32.lt_s + i32.load + call $~lib/rt/pure/__retain local.set $6 - local.get $6 - if - i32.const 0 - local.get $5 - i32.sub - local.set $5 - end - local.get $5 - call $~lib/internal/number/decimalCount32 - i32.const 1 - i32.add - local.set $7 - block $~lib/internal/number/utoa32_core|inlined.4 + block (result i32) + i32.const 2 + global.set $~lib/argc local.get $4 - local.set $8 - local.get $5 - local.set $9 - local.get $7 - local.set $10 - local.get $8 - local.get $9 - local.get $10 - call $~lib/internal/number/utoa32_lut - end - local.get $4 - i32.const 45 - i32.const 43 - local.get $6 - select - i32.store16 offset=4 - local.get $7 - end - local.set $1 - local.get $1 - i32.const 2 - i32.add - return - else - local.get $1 - i32.const 1 - i32.shl - local.set $7 - block $~lib/memory/memory.copy|inlined.11 - local.get $0 - i32.const 4 - i32.add - i32.const 4 - i32.add - local.set $6 - local.get $0 - i32.const 4 - i32.add - i32.const 2 - i32.add - local.set $5 - local.get $7 - i32.const 2 - i32.sub - local.set $4 - local.get $6 - local.get $5 - local.get $4 - call $~lib/internal/memory/memmove - end - local.get $0 - i32.const 46 - i32.store16 offset=6 - local.get $0 - local.get $7 - i32.add - i32.const 101 - i32.store16 offset=6 - local.get $1 - block $~lib/internal/number/genExponent|inlined.1 (result i32) - local.get $0 - local.get $7 - i32.add - i32.const 4 - i32.add - local.set $4 - local.get $3 - i32.const 1 - i32.sub - local.set $5 - local.get $5 - i32.const 0 - i32.lt_s - local.set $6 - local.get $6 - if - i32.const 0 - local.get $5 - i32.sub - local.set $5 + local.get $6 + local.get $2 + call_indirect (type $FUNCSIG$iii) end - local.get $5 - call $~lib/internal/number/decimalCount32 - i32.const 1 - i32.add - local.set $10 - block $~lib/internal/number/utoa32_core|inlined.5 - local.get $4 - local.set $9 - local.get $5 - local.set $8 - local.get $10 - local.set $11 - local.get $9 - local.get $8 - local.get $11 - call $~lib/internal/number/utoa32_lut + i32.const 0 + i32.lt_s + if + local.get $0 + block (result i32) + local.get $5 + local.tee $7 + i32.const 1 + i32.sub + local.set $5 + local.get $7 + end + i32.const 1 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store + else + local.get $6 + call $~lib/rt/pure/__release + br $break|1 end - local.get $4 - i32.const 45 - i32.const 43 local.get $6 - select - i32.store16 offset=4 - local.get $10 + call $~lib/rt/pure/__release + br $continue|1 end - i32.add - local.set $1 - local.get $1 - i32.const 2 - i32.add - return end - unreachable end + local.get $0 + local.get $5 + i32.const 1 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store + local.get $4 + call $~lib/rt/pure/__release + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end + unreachable + end + ) + (func $~lib/array/Array<~lib/array/Array>#sort (; 175 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $0 + i32.load offset=12 + local.set $2 + local.get $2 + i32.const 1 + i32.le_s + if + local.get $0 + call $~lib/rt/pure/__retain + return + end + local.get $0 + i32.load offset=4 + local.set $3 + local.get $2 + i32.const 2 + i32.eq + if + local.get $3 + i32.load offset=4 + call $~lib/rt/pure/__retain + local.set $4 + local.get $3 + i32.load + call $~lib/rt/pure/__retain + local.set $5 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $5 + local.get $1 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 + i32.lt_s + if + local.get $3 + local.get $5 + i32.store offset=4 + local.get $3 + local.get $4 + i32.store + end + local.get $0 + call $~lib/rt/pure/__retain + local.set $6 + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + return + end + block $~lib/util/sort/SORT<~lib/array/Array>|inlined.0 + local.get $3 + local.set $5 + local.get $2 + local.set $4 + local.get $1 + local.set $6 + local.get $5 + local.get $4 + local.get $6 + call $~lib/util/sort/insertionSort<~lib/array/Array> + end + local.get $0 + call $~lib/rt/pure/__retain + ) + (func $~lib/array/Array<~lib/array/Array>#get:length (; 176 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=12 + ) + (func $~lib/array/Array<~lib/array/Array>#__unchecked_get (; 177 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + i32.load + call $~lib/rt/pure/__retain + ) + (func $~lib/array/Array<~lib/array/Array>#__get (; 178 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 + local.get $0 + i32.load offset=12 + i32.ge_u + if + i32.const 4040 + i32.const 488 + i32.const 106 + i32.const 45 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ge_u + if + i32.const 280 + i32.const 488 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#__unchecked_get + ) + (func $std/array/isSorted<~lib/array/Array> (; 179 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + block $break|0 + block + i32.const 1 + local.set $2 + local.get $0 + call $~lib/array/Array<~lib/array/Array>#get:length + local.set $3 + end + loop $repeat|0 + local.get $2 + local.get $3 + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $0 + local.get $2 + i32.const 1 + i32.sub + call $~lib/array/Array<~lib/array/Array>#__get + local.tee $4 + local.get $0 + local.get $2 + call $~lib/array/Array<~lib/array/Array>#__get + local.tee $5 + local.get $1 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 + i32.gt_s + if + i32.const 0 + local.set $6 + local.get $0 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + return + end + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $repeat|0 + unreachable + end + unreachable + end + i32.const 1 + local.set $5 + local.get $0 + call $~lib/rt/pure/__release + local.get $5 + ) + (func $std/array/assertSorted<~lib/array/Array> (; 180 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#sort + local.tee $2 + local.get $1 + call $std/array/isSorted<~lib/array/Array> + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 830 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + ) + (func $~lib/array/Array.create> (; 181 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + i32.const 268435452 + i32.gt_u + if + i32.const 24 + i32.const 488 + i32.const 45 + i32.const 61 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 2 + i32.const 12 + i32.const 0 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 + i32.const 0 + i32.store offset=12 + local.get $1 + i32.load offset=4 + i32.const 0 + local.get $1 + i32.load offset=8 + call $~lib/memory/memory.fill + local.get $1 + ) + (func $std/array/Proxy#constructor (; 182 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 4 + i32.const 11 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $0 + end + local.get $0 + local.get $1 + i32.store + local.get $0 + ) + (func $~lib/array/Array>#__unchecked_set (; 183 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + local.set $3 + local.get $3 + i32.load + local.set $4 + local.get $2 + local.get $4 + i32.ne + if + local.get $3 + local.get $2 + call $~lib/rt/pure/__retain + i32.store + local.get $4 + call $~lib/rt/pure/__release + end + local.get $2 + call $~lib/rt/pure/__release + ) + (func $~lib/array/Array>#__set (; 184 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.load offset=12 + local.set $3 + local.get $1 + local.get $3 + i32.gt_u + if + local.get $2 + call $~lib/rt/pure/__release + block + i32.const 4040 + i32.const 488 + i32.const 121 + i32.const 38 + call $~lib/builtins/abort + unreachable unreachable end unreachable end - unreachable - unreachable - ) - (func $~lib/internal/number/dtoa_core (; 194 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) - (local $2 i32) - (local $3 f64) - (local $4 i32) - (local $5 i32) - (local $6 i64) - (local $7 i32) - (local $8 i64) - (local $9 i64) - (local $10 i64) - (local $11 i32) - (local $12 i64) - (local $13 i32) - (local $14 i32) - (local $15 i32) - (local $16 f64) - (local $17 i32) - (local $18 i32) - (local $19 i32) - (local $20 i32) - (local $21 i64) - (local $22 i64) - (local $23 i64) - (local $24 i64) - (local $25 i64) - (local $26 i64) - (local $27 i64) - (local $28 i64) - (local $29 i64) - (local $30 i64) - (local $31 i32) + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.const 2 + call $~lib/array/ensureSize + local.get $0 local.get $1 - f64.const 0 - f64.lt - local.set $2 local.get $2 + call $~lib/array/Array>#__unchecked_set + local.get $1 + local.get $3 + i32.ge_s if - local.get $1 - f64.neg - local.set $1 local.get $0 - i32.const 45 - i32.store16 offset=4 - end - block $~lib/internal/number/grisu2|inlined.0 (result i32) local.get $1 - local.set $3 - local.get $0 - local.set $4 - local.get $2 - local.set $5 - local.get $3 - i64.reinterpret_f64 - local.set $6 - local.get $6 - i64.const 9218868437227405312 - i64.and - i64.const 52 - i64.shr_u - i32.wrap_i64 - local.set $7 - local.get $6 - i64.const 4503599627370495 - i64.and - local.set $8 - local.get $7 - i32.const 0 - i32.ne - i64.extend_i32_u - i64.const 52 - i64.shl - local.get $8 - i64.add - local.set $9 - local.get $7 i32.const 1 - local.get $7 - i32.const 0 - i32.ne - select - i32.const 1023 - i32.const 52 i32.add - i32.sub - local.set $7 - block $~lib/internal/number/normalizedBoundaries|inlined.0 - local.get $9 - local.set $10 - local.get $7 - local.set $11 - local.get $10 - i64.const 1 - i64.shl - i64.const 1 - i64.add - local.set $12 - local.get $11 + i32.store offset=12 + end + local.get $2 + call $~lib/rt/pure/__release + ) + (func $std/array/createReverseOrderedElementsArray (; 185 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + call $~lib/array/Array.create> + local.set $1 + block $break|0 + i32.const 0 + local.set $2 + loop $repeat|0 + local.get $2 + local.get $0 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $1 + local.get $2 + i32.const 0 + local.get $0 i32.const 1 i32.sub - local.set $13 - local.get $12 - i64.clz - i32.wrap_i64 - local.set $14 - local.get $12 - local.get $14 - i64.extend_i32_s - i64.shl - local.set $12 - local.get $13 - local.get $14 + local.get $2 i32.sub - local.set $13 + call $std/array/Proxy#constructor + local.tee $3 + call $~lib/array/Array>#__set + local.get $3 + call $~lib/rt/pure/__release + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + ) + (func $start:std/array~anonymous|48 (; 186 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.load + local.get $1 + i32.load + i32.sub + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + ) + (func $~lib/util/sort/insertionSort> (; 187 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 + local.get $1 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $0 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load + call $~lib/rt/pure/__retain + local.set $4 + local.get $3 + i32.const 1 + i32.sub + local.set $5 + block $break|1 + loop $continue|1 + local.get $5 + i32.const 0 + i32.ge_s + if + local.get $0 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load + call $~lib/rt/pure/__retain + local.set $6 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $6 + local.get $2 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 + i32.lt_s + if + local.get $0 + block (result i32) + local.get $5 + local.tee $7 + i32.const 1 + i32.sub + local.set $5 + local.get $7 + end + i32.const 1 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store + else + local.get $6 + call $~lib/rt/pure/__release + br $break|1 + end + local.get $6 + call $~lib/rt/pure/__release + br $continue|1 + end + end + end + local.get $0 + local.get $5 i32.const 1 - local.get $10 - i64.const 4503599627370496 - i64.eq i32.add - local.set $15 - local.get $12 - global.set $~lib/internal/number/_frc_plus - local.get $10 - local.get $15 - i64.extend_i32_s - i64.shl - i64.const 1 - i64.sub - local.get $11 - local.get $15 - i32.sub - local.get $13 - i32.sub - i64.extend_i32_s - i64.shl - global.set $~lib/internal/number/_frc_minus - local.get $13 - global.set $~lib/internal/number/_exp - end - block $~lib/internal/number/getCachedPower|inlined.0 - global.get $~lib/internal/number/_exp - local.set $15 - i32.const -61 - local.get $15 - i32.sub - f64.convert_i32_s - f64.const 0.30102999566398114 - f64.mul - f64.const 347 - f64.add - local.set $16 - local.get $16 - i32.trunc_f64_s - local.set $14 - local.get $14 - local.get $14 - f64.convert_i32_s - local.get $16 - f64.ne + i32.const 2 + i32.shl i32.add - local.set $14 - local.get $14 - i32.const 3 - i32.shr_s + local.get $4 + i32.store + local.get $4 + call $~lib/rt/pure/__release + local.get $3 i32.const 1 i32.add - local.set $13 - i32.const 348 - local.get $13 - i32.const 3 - i32.shl - i32.sub - global.set $~lib/internal/number/_K - i32.const 6280 - i32.load - local.set $11 - i32.const 6544 - i32.load - local.set $17 - block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i64) - local.get $11 - local.set $18 - local.get $13 - local.set $19 - i32.const 0 - local.set $20 - local.get $18 - local.get $19 - i32.const 3 - i32.shl - i32.add - local.get $20 - i32.add - i64.load offset=8 - end - global.set $~lib/internal/number/_frc_pow - block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) - local.get $17 - local.set $20 - local.get $13 - local.set $19 - i32.const 0 - local.set $18 - local.get $20 - local.get $19 - i32.const 1 - i32.shl - i32.add - local.get $18 - i32.add - i32.load16_s offset=8 - end - global.set $~lib/internal/number/_exp_pow + local.set $3 + br $repeat|0 + unreachable end - local.get $9 - i64.clz - i32.wrap_i64 - local.set $17 - local.get $9 - local.get $17 - i64.extend_i32_s - i64.shl - local.set $9 - local.get $7 - local.get $17 - i32.sub - local.set $7 - global.get $~lib/internal/number/_frc_pow - local.set $12 - global.get $~lib/internal/number/_exp_pow - local.set $11 - block $~lib/internal/number/umul64f|inlined.0 (result i64) - local.get $9 - local.set $10 - local.get $12 - local.set $21 - local.get $10 - i64.const 4294967295 - i64.and - local.set $22 - local.get $21 - i64.const 4294967295 - i64.and - local.set $23 - local.get $10 - i64.const 32 - i64.shr_u - local.set $24 - local.get $21 - i64.const 32 - i64.shr_u - local.set $25 - local.get $22 - local.get $23 - i64.mul - local.set $26 - local.get $24 - local.get $23 - i64.mul - local.get $26 - i64.const 32 - i64.shr_u - i64.add - local.set $27 - local.get $22 - local.get $25 - i64.mul - local.get $27 - i64.const 4294967295 - i64.and - i64.add - local.set $28 - local.get $28 - i64.const 2147483647 - i64.add - local.set $28 - local.get $27 - i64.const 32 - i64.shr_u - local.set $27 - local.get $28 - i64.const 32 - i64.shr_u - local.set $28 - local.get $24 - local.get $25 - i64.mul - local.get $27 - i64.add - local.get $28 - i64.add + unreachable + end + ) + (func $~lib/array/Array>#sort (; 188 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $0 + i32.load offset=12 + local.set $2 + local.get $2 + i32.const 1 + i32.le_s + if + local.get $0 + call $~lib/rt/pure/__retain + return + end + local.get $0 + i32.load offset=4 + local.set $3 + local.get $2 + i32.const 2 + i32.eq + if + local.get $3 + i32.load offset=4 + call $~lib/rt/pure/__retain + local.set $4 + local.get $3 + i32.load + call $~lib/rt/pure/__retain + local.set $5 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $5 + local.get $1 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 + i32.lt_s + if + local.get $3 + local.get $5 + i32.store offset=4 + local.get $3 + local.get $4 + i32.store + end + local.get $0 + call $~lib/rt/pure/__retain + local.set $6 + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + return + end + block $~lib/util/sort/SORT>|inlined.0 + local.get $3 + local.set $5 + local.get $2 + local.set $4 + local.get $1 + local.set $6 + local.get $5 + local.get $4 + local.get $6 + call $~lib/util/sort/insertionSort> + end + local.get $0 + call $~lib/rt/pure/__retain + ) + (func $~lib/array/Array>#get:length (; 189 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=12 + ) + (func $~lib/array/Array>#__unchecked_get (; 190 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + i32.load + call $~lib/rt/pure/__retain + ) + (func $~lib/array/Array>#__get (; 191 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 + local.get $0 + i32.load offset=12 + i32.ge_u + if + i32.const 4040 + i32.const 488 + i32.const 106 + i32.const 45 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ge_u + if + i32.const 280 + i32.const 488 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/array/Array>#__unchecked_get + ) + (func $std/array/isSorted> (; 192 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + block $break|0 + block + i32.const 1 + local.set $2 + local.get $0 + call $~lib/array/Array>#get:length + local.set $3 end - local.set $28 - block $~lib/internal/number/umul64e|inlined.0 (result i32) - local.get $7 - local.set $13 - local.get $11 - local.set $14 - local.get $13 - local.get $14 - i32.add - i32.const 64 + loop $repeat|0 + local.get $2 + local.get $3 + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $0 + local.get $2 + i32.const 1 + i32.sub + call $~lib/array/Array>#__get + local.tee $4 + local.get $0 + local.get $2 + call $~lib/array/Array>#__get + local.tee $5 + local.get $1 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 + i32.gt_s + if + i32.const 0 + local.set $6 + local.get $0 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + return + end + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $2 + i32.const 1 i32.add + local.set $2 + br $repeat|0 + unreachable end - local.set $14 - block $~lib/internal/number/umul64f|inlined.1 (result i64) - global.get $~lib/internal/number/_frc_plus - local.set $27 - local.get $12 - local.set $26 - local.get $27 - i64.const 4294967295 - i64.and - local.set $25 - local.get $26 - i64.const 4294967295 - i64.and - local.set $24 - local.get $27 - i64.const 32 - i64.shr_u - local.set $23 - local.get $26 - i64.const 32 - i64.shr_u - local.set $22 - local.get $25 - local.get $24 - i64.mul - local.set $21 - local.get $23 - local.get $24 - i64.mul - local.get $21 - i64.const 32 - i64.shr_u - i64.add - local.set $10 - local.get $25 - local.get $22 - i64.mul - local.get $10 - i64.const 4294967295 - i64.and - i64.add - local.set $29 - local.get $29 - i64.const 2147483647 - i64.add - local.set $29 - local.get $10 - i64.const 32 - i64.shr_u - local.set $10 - local.get $29 - i64.const 32 - i64.shr_u - local.set $29 - local.get $23 - local.get $22 - i64.mul - local.get $10 - i64.add - local.get $29 - i64.add - end - i64.const 1 - i64.sub - local.set $29 - block $~lib/internal/number/umul64e|inlined.1 (result i32) - global.get $~lib/internal/number/_exp - local.set $13 - local.get $11 - local.set $15 - local.get $13 - local.get $15 - i32.add - i32.const 64 + unreachable + end + i32.const 1 + local.set $5 + local.get $0 + call $~lib/rt/pure/__release + local.get $5 + ) + (func $std/array/assertSorted> (; 193 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array>#sort + local.tee $2 + local.get $1 + call $std/array/isSorted> + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 830 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + ) + (func $~lib/util/sort/insertionSort<~lib/string/String | null> (; 194 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 + local.get $1 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $0 + local.get $3 + i32.const 2 + i32.shl i32.add + i32.load + call $~lib/rt/pure/__retain + local.set $4 + local.get $3 + i32.const 1 + i32.sub + local.set $5 + block $break|1 + loop $continue|1 + local.get $5 + i32.const 0 + i32.ge_s + if + local.get $0 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load + call $~lib/rt/pure/__retain + local.set $6 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $6 + local.get $2 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 + i32.lt_s + if + local.get $0 + block (result i32) + local.get $5 + local.tee $7 + i32.const 1 + i32.sub + local.set $5 + local.get $7 + end + i32.const 1 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store + else + local.get $6 + call $~lib/rt/pure/__release + br $break|1 + end + local.get $6 + call $~lib/rt/pure/__release + br $continue|1 + end + end + end + local.get $0 + local.get $5 + i32.const 1 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store + local.get $4 + call $~lib/rt/pure/__release + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable end - local.set $15 - block $~lib/internal/number/umul64f|inlined.2 (result i64) - global.get $~lib/internal/number/_frc_minus - local.set $10 - local.get $12 - local.set $21 - local.get $10 - i64.const 4294967295 - i64.and - local.set $22 - local.get $21 - i64.const 4294967295 - i64.and - local.set $23 - local.get $10 - i64.const 32 - i64.shr_u - local.set $24 - local.get $21 - i64.const 32 - i64.shr_u - local.set $25 - local.get $22 - local.get $23 - i64.mul - local.set $26 - local.get $24 - local.get $23 - i64.mul - local.get $26 - i64.const 32 - i64.shr_u - i64.add - local.set $27 - local.get $22 - local.get $25 - i64.mul - local.get $27 - i64.const 4294967295 - i64.and - i64.add - local.set $30 - local.get $30 - i64.const 2147483647 - i64.add - local.set $30 - local.get $27 - i64.const 32 - i64.shr_u - local.set $27 - local.get $30 - i64.const 32 - i64.shr_u - local.set $30 - local.get $24 - local.get $25 - i64.mul - local.get $27 - i64.add - local.get $30 - i64.add - end - i64.const 1 - i64.add - local.set $30 - local.get $29 - local.get $30 - i64.sub - local.set $27 - local.get $4 - local.get $28 - local.get $14 - local.get $29 - local.get $15 - local.get $27 - local.get $5 - call $~lib/internal/number/genDigits + unreachable end - local.set $31 - local.get $0 - local.get $2 - i32.const 1 - i32.shl - i32.add - local.get $31 - local.get $2 - i32.sub - global.get $~lib/internal/number/_K - call $~lib/internal/number/prettify - local.set $31 - local.get $31 - local.get $2 - i32.add ) - (func $~lib/internal/number/dtoa (; 195 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) - (local $1 i32) + (func $~lib/array/Array<~lib/string/String | null>#sort (; 195 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + (local $6 i32) local.get $0 - f64.const 0 - f64.eq + i32.load offset=12 + local.set $2 + local.get $2 + i32.const 1 + i32.le_s if - i32.const 5176 + local.get $0 + call $~lib/rt/pure/__retain return end local.get $0 - call $~lib/builtins/isFinite - i32.eqz + i32.load offset=4 + local.set $3 + local.get $2 + i32.const 2 + i32.eq if - local.get $0 - call $~lib/builtins/isNaN + local.get $3 + i32.load offset=4 + call $~lib/rt/pure/__retain + local.set $4 + local.get $3 + i32.load + call $~lib/rt/pure/__retain + local.set $5 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $5 + local.get $1 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 + i32.lt_s if - i32.const 5192 - return + local.get $3 + local.get $5 + i32.store offset=4 + local.get $3 + local.get $4 + i32.store end - i32.const 5208 - i32.const 5232 local.get $0 - f64.const 0 - f64.lt - select + call $~lib/rt/pure/__retain + local.set $6 + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 return end - i32.const 28 - call $~lib/internal/string/allocateUnsafe - local.set $1 - local.get $1 - local.get $0 - call $~lib/internal/number/dtoa_core - local.set $2 - local.get $1 - i32.const 0 - local.get $2 - call $~lib/string/String#substring - local.set $3 - block $~lib/internal/string/freeUnsafe|inlined.3 - local.get $1 + block $~lib/util/sort/SORT<~lib/string/String | null>|inlined.0 + local.get $3 + local.set $5 + local.get $2 local.set $4 + local.get $1 + local.set $6 + local.get $5 local.get $4 - i32.eqz - if - i32.const 0 - i32.const 4088 - i32.const 28 - i32.const 4 - call $~lib/env/abort - unreachable - end - block $~lib/memory/memory.free|inlined.8 - local.get $4 - local.set $5 - local.get $5 - call $~lib/allocator/arena/__memory_free - br $~lib/memory/memory.free|inlined.8 - end + local.get $6 + call $~lib/util/sort/insertionSort<~lib/string/String | null> end - local.get $3 + local.get $0 + call $~lib/rt/pure/__retain ) - (func $~lib/internal/number/dtoa_stream (; 196 ;) (type $FUNCSIG$iiid) (param $0 i32) (param $1 i32) (param $2 f64) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) + (func $~lib/array/Array<~lib/string/String | null>#get:length (; 196 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=12 + ) + (func $~lib/array/Array<~lib/string/String | null>#__unchecked_get (; 197 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 + i32.load offset=4 local.get $1 - i32.const 1 + i32.const 2 i32.shl i32.add - local.set $0 - local.get $2 - f64.const 0 - f64.eq + i32.load + call $~lib/rt/pure/__retain + ) + (func $~lib/array/Array<~lib/string/String | null>#__get (; 198 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ge_u if - local.get $0 - i32.const 48 - i32.store16 offset=4 - local.get $0 - i32.const 46 - i32.store16 offset=6 - local.get $0 - i32.const 48 - i32.store16 offset=8 - i32.const 3 - return + i32.const 280 + i32.const 488 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort + unreachable end - local.get $2 - call $~lib/builtins/isFinite - i32.eqz - if - local.get $2 - call $~lib/builtins/isNaN - if - local.get $0 - i32.const 78 - i32.store16 offset=4 - local.get $0 - i32.const 97 - i32.store16 offset=6 + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/string/String | null>#__unchecked_get + ) + (func $std/array/isSorted<~lib/string/String | null> (; 199 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + block $break|0 + block + i32.const 1 + local.set $2 local.get $0 - i32.const 78 - i32.store16 offset=8 - i32.const 3 - return - else - local.get $2 - f64.const 0 - f64.lt + call $~lib/array/Array<~lib/string/String | null>#get:length local.set $3 - i32.const 8 - local.get $3 - i32.add - local.set $4 - i32.const 5208 - i32.const 5232 + end + loop $repeat|0 + local.get $2 local.get $3 - select - local.set $5 - block $~lib/memory/memory.copy|inlined.12 + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + i32.const 2 + global.set $~lib/argc local.get $0 - i32.const 4 - i32.add + local.get $2 + i32.const 1 + i32.sub + call $~lib/array/Array<~lib/string/String | null>#__get + local.tee $4 + local.get $0 + local.get $2 + call $~lib/array/Array<~lib/string/String | null>#__get + local.tee $5 + local.get $1 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 + i32.gt_s + if + i32.const 0 local.set $6 - local.get $5 - i32.const 4 - i32.add - local.set $7 + local.get $0 + call $~lib/rt/pure/__release local.get $4 - i32.const 1 - i32.shl - local.set $8 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release local.get $6 - local.get $7 - local.get $8 - call $~lib/internal/memory/memmove + return end local.get $4 - return + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $repeat|0 + unreachable end unreachable + end + i32.const 1 + local.set $5 + local.get $0 + call $~lib/rt/pure/__release + local.get $5 + ) + (func $std/array/assertSorted<~lib/string/String | null> (; 200 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/string/String | null>#sort + local.tee $2 + local.get $1 + call $std/array/isSorted<~lib/string/String | null> + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 830 + i32.const 2 + call $~lib/builtins/abort unreachable end - local.get $0 local.get $2 - call $~lib/internal/number/dtoa_core + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/array/Array#join (; 197 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 f64) + (func $~lib/string/String#get:length (; 201 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u + ) + (func $~lib/util/string/compareImpl (; 202 ;) (type $FUNCSIG$iiiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) (local $5 i32) (local $6 i32) (local $7 i32) (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) local.get $0 - i32.load offset=4 - i32.const 1 - i32.sub - local.set $2 + call $~lib/rt/pure/__retain + drop local.get $2 + call $~lib/rt/pure/__retain + drop i32.const 0 - i32.lt_s - if - i32.const 3904 - return - end - i32.const 3904 - local.set $3 - local.get $0 - i32.load local.set $5 + local.get $0 local.get $1 - i32.load - local.set $6 - local.get $6 - i32.const 0 - i32.ne - local.set $7 - local.get $2 - i32.eqz - if - block $~lib/internal/arraybuffer/LOAD|inlined.13 (result f64) - local.get $5 - local.set $8 - i32.const 0 - local.set $9 - i32.const 0 - local.set $10 - local.get $8 - local.get $9 - i32.const 3 - i32.shl - i32.add - local.get $10 - i32.add - f64.load offset=8 - end - call $~lib/internal/number/dtoa - return - end - i32.const 28 - local.get $6 + i32.const 1 + i32.shl i32.add + local.set $6 local.get $2 - i32.mul - i32.const 28 + local.get $3 + i32.const 1 + i32.shl i32.add - local.set $10 - local.get $10 - call $~lib/internal/string/allocateUnsafe - local.set $9 - i32.const 0 - local.set $8 + local.set $7 block $break|0 - i32.const 0 - local.set $11 - loop $repeat|0 - local.get $11 - local.get $2 - i32.lt_s - i32.eqz - br_if $break|0 - block - block $~lib/internal/arraybuffer/LOAD|inlined.14 (result f64) - local.get $5 - local.set $12 - local.get $11 - local.set $13 - i32.const 0 - local.set $14 - local.get $12 - local.get $13 - i32.const 3 - i32.shl - i32.add - local.get $14 - i32.add - f64.load offset=8 - end - local.set $4 - local.get $8 - local.get $9 - local.get $8 + loop $continue|0 + local.get $4 + if (result i32) + local.get $6 + i32.load16_u + local.get $7 + i32.load16_u + i32.sub + local.tee $5 + i32.eqz + else + i32.const 0 + end + if local.get $4 - call $~lib/internal/number/dtoa_stream + i32.const 1 + i32.sub + local.set $4 + local.get $6 + i32.const 2 i32.add - local.set $8 + local.set $6 local.get $7 - if - local.get $9 - local.get $8 - local.get $1 - i32.const 0 - local.get $6 - call $~lib/internal/string/copyUnsafe - local.get $8 - local.get $6 - i32.add - local.set $8 - end + i32.const 2 + i32.add + local.set $7 + br $continue|0 end - local.get $11 - i32.const 1 - i32.add - local.set $11 - br $repeat|0 - unreachable end - unreachable end - block $~lib/internal/arraybuffer/LOAD|inlined.15 (result f64) - local.get $5 - local.set $11 - local.get $2 - local.set $14 + local.get $5 + local.set $8 + local.get $0 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $8 + ) + (func $~lib/util/sort/COMPARATOR<~lib/string/String | null>~anonymous|0 (; 203 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + i32.eq + if (result i32) + i32.const 1 + else + local.get $0 i32.const 0 - local.set $13 - local.get $11 - local.get $14 - i32.const 3 - i32.shl - i32.add - local.get $13 - i32.add - f64.load offset=8 + i32.eq + end + if (result i32) + i32.const 1 + else + local.get $1 + i32.const 0 + i32.eq + end + if + i32.const 0 + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + return end + local.get $0 + call $~lib/string/String#get:length + local.set $3 + local.get $1 + call $~lib/string/String#get:length local.set $4 - local.get $8 - local.get $9 - local.get $8 - local.get $4 - call $~lib/internal/number/dtoa_stream - i32.add - local.set $8 - local.get $9 - local.set $13 - local.get $10 - local.get $8 - i32.gt_s + local.get $3 + i32.eqz + if (result i32) + local.get $4 + i32.eqz + else + i32.const 0 + end if - local.get $9 i32.const 0 - local.get $8 - call $~lib/string/String#substring - local.set $13 - block $~lib/internal/string/freeUnsafe|inlined.4 - local.get $9 - local.set $14 - local.get $14 - i32.eqz - if - i32.const 0 - i32.const 4088 - i32.const 28 - i32.const 4 - call $~lib/env/abort - unreachable - end - block $~lib/memory/memory.free|inlined.9 - local.get $14 - local.set $11 - local.get $11 - call $~lib/allocator/arena/__memory_free - br $~lib/memory/memory.free|inlined.9 + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + return + end + local.get $3 + i32.eqz + if + i32.const -1 + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + return + end + local.get $4 + i32.eqz + if + i32.const 1 + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + return + end + local.get $0 + i32.const 0 + local.get $1 + i32.const 0 + local.get $3 + local.tee $2 + local.get $4 + local.tee $5 + local.get $2 + local.get $5 + i32.lt_s + select + call $~lib/util/string/compareImpl + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + ) + (func $std/array/assertSorted<~lib/string/String | null>|trampoline (; 204 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + block $1of1 + block $0of1 + block $outOfRange + global.get $~lib/argc + i32.const 1 + i32.sub + br_table $0of1 $1of1 $outOfRange end + unreachable end + block $~lib/util/sort/COMPARATOR<~lib/string/String | null>|inlined.0 (result i32) + i32.const 55 + br $~lib/util/sort/COMPARATOR<~lib/string/String | null>|inlined.0 + end + local.set $1 end - local.get $13 - return + local.get $0 + local.get $1 + call $std/array/assertSorted<~lib/string/String | null> ) - (func $~lib/array/Array<~lib/string/String>#join (; 198 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__eq (; 205 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) local.get $0 - i32.load offset=4 - i32.const 1 - i32.sub - local.set $2 - local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + i32.eq + if + i32.const 1 + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + return + end + local.get $0 i32.const 0 - i32.lt_s + i32.eq + if (result i32) + i32.const 1 + else + local.get $1 + i32.const 0 + i32.eq + end if - i32.const 3904 + i32.const 0 + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 return end - i32.const 3904 - local.set $3 local.get $0 - i32.load - local.set $5 + call $~lib/string/String#get:length + local.set $3 + local.get $3 local.get $1 - i32.load - local.set $6 - local.get $6 - i32.const 0 + call $~lib/string/String#get:length i32.ne - local.set $7 - local.get $2 - i32.eqz if - block $~lib/internal/arraybuffer/LOAD<~lib/string/String,~lib/string/String>|inlined.5 (result i32) - local.get $5 - local.set $8 - i32.const 0 - local.set $9 - i32.const 0 - local.set $10 - local.get $8 - local.get $9 - i32.const 2 - i32.shl - i32.add - local.get $10 - i32.add - i32.load offset=8 - end + i32.const 0 + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 return end + local.get $0 i32.const 0 - local.set $10 - block $break|0 - block + local.get $1 + i32.const 0 + local.get $3 + call $~lib/util/string/compareImpl + i32.eqz + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + ) + (func $~lib/string/String.__ne (; 206 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + call $~lib/string/String.__eq + i32.eqz + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + ) + (func $std/array/isArraysEqual<~lib/string/String | null> (; 207 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $2 + i32.eqz + if + local.get $0 + call $~lib/array/Array<~lib/string/String | null>#get:length + local.set $2 + local.get $2 + local.get $1 + call $~lib/array/Array<~lib/string/String | null>#get:length + i32.ne + if i32.const 0 - local.set $9 - local.get $2 - i32.const 1 - i32.add - local.set $8 + local.set $3 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + return end - loop $repeat|0 - local.get $9 - local.get $8 - i32.lt_s - i32.eqz - br_if $break|0 - local.get $10 - block $~lib/internal/arraybuffer/LOAD<~lib/string/String,~lib/string/String>|inlined.6 (result i32) - local.get $5 - local.set $11 - local.get $9 - local.set $12 - i32.const 0 - local.set $13 - local.get $11 - local.get $12 - i32.const 2 - i32.shl - i32.add - local.get $13 - i32.add - i32.load offset=8 - end - i32.load - i32.add - local.set $10 - local.get $9 + local.get $0 + local.get $1 + i32.eq + if i32.const 1 - i32.add - local.set $9 - br $repeat|0 - unreachable + local.set $3 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + return end - unreachable end - i32.const 0 - local.set $8 - local.get $10 - local.get $6 - local.get $2 - i32.mul - i32.add - call $~lib/internal/string/allocateUnsafe - local.set $9 - block $break|1 + block $break|0 i32.const 0 - local.set $13 - loop $repeat|1 - local.get $13 + local.set $3 + loop $repeat|0 + local.get $3 local.get $2 i32.lt_s i32.eqz - br_if $break|1 - block - block $~lib/internal/arraybuffer/LOAD<~lib/string/String,~lib/string/String>|inlined.7 (result i32) - local.get $5 - local.set $12 - local.get $13 - local.set $11 - i32.const 0 - local.set $14 - local.get $12 - local.get $11 - i32.const 2 - i32.shl - i32.add - local.get $14 - i32.add - i32.load offset=8 - end - local.set $4 - local.get $4 - if - local.get $4 - i32.load - local.set $14 - local.get $9 - local.get $8 - local.get $4 - i32.const 0 - local.get $14 - call $~lib/internal/string/copyUnsafe - local.get $8 - local.get $14 - i32.add - local.set $8 - end - local.get $7 - if - local.get $9 - local.get $8 - local.get $1 - i32.const 0 - local.get $6 - call $~lib/internal/string/copyUnsafe - local.get $8 - local.get $6 - i32.add - local.set $8 - end + br_if $break|0 + local.get $0 + local.get $3 + call $~lib/array/Array<~lib/string/String | null>#__get + local.tee $4 + local.get $1 + local.get $3 + call $~lib/array/Array<~lib/string/String | null>#__get + local.tee $5 + call $~lib/string/String.__ne + if + i32.const 0 + local.set $6 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + return end - local.get $13 + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $3 i32.const 1 i32.add - local.set $13 - br $repeat|1 + local.set $3 + br $repeat|0 unreachable end unreachable end - block $~lib/internal/arraybuffer/LOAD<~lib/string/String,~lib/string/String>|inlined.8 (result i32) - local.get $5 - local.set $13 - local.get $2 - local.set $14 - i32.const 0 - local.set $11 - local.get $13 - local.get $14 - i32.const 2 - i32.shl - i32.add - local.get $11 - i32.add - i32.load offset=8 - end - local.set $4 - local.get $4 - if - local.get $4 - i32.load - local.set $11 - local.get $9 - local.get $8 - local.get $4 - i32.const 0 - local.get $11 - call $~lib/internal/string/copyUnsafe - end - local.get $9 - return + i32.const 1 + local.set $5 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $5 ) - (func $std/array/Ref#constructor (; 199 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array.create<~lib/string/String> (; 208 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) local.get $0 - i32.eqz + i32.const 268435452 + i32.gt_u if - i32.const 0 - call $~lib/memory/memory.allocate - local.set $0 + i32.const 24 + i32.const 488 + i32.const 45 + i32.const 61 + call $~lib/builtins/abort + unreachable end local.get $0 + i32.const 2 + i32.const 14 + i32.const 0 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 + i32.const 0 + i32.store offset=12 + local.get $1 + i32.load offset=4 + i32.const 0 + local.get $1 + i32.load offset=8 + call $~lib/memory/memory.fill + local.get $1 ) - (func $~lib/array/Array#constructor (; 200 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#charAt (; 209 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $1 - i32.const 268435454 - i32.gt_u + local.get $0 + i32.const 0 + i32.ne + i32.eqz if i32.const 0 - i32.const 8 - i32.const 45 - i32.const 39 - call $~lib/env/abort + i32.const 4360 + i32.const 46 + i32.const 4 + call $~lib/builtins/abort unreachable end local.get $1 + local.get $0 + call $~lib/string/String#get:length + i32.ge_u + if + i32.const 4248 + call $~lib/rt/pure/__retain + return + end i32.const 2 - i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc local.set $2 local.get $2 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $3 - block (result i32) - local.get $0 - i32.eqz - if - i32.const 8 - call $~lib/memory/memory.allocate - local.set $0 - end - local.get $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - end - local.get $3 - i32.store - local.get $0 - local.get $1 - i32.store offset=4 - block $~lib/memory/memory.fill|inlined.12 - local.get $3 - i32.const 8 - i32.add - local.set $4 - i32.const 0 - local.set $5 - local.get $2 - local.set $6 - local.get $4 - local.get $5 - local.get $6 - call $~lib/internal/memory/memset - end - local.get $0 - ) - (func $~lib/array/Array#__unchecked_set (; 201 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) local.get $0 - i32.load - local.set $3 local.get $1 - local.set $4 - local.get $2 - local.set $5 - i32.const 0 - local.set $6 - local.get $3 - local.get $4 - i32.const 2 + i32.const 1 i32.shl i32.add - local.get $6 - i32.add - local.get $5 - i32.store offset=8 + i32.load16_u + i32.store16 + local.get $2 + call $~lib/rt/pure/__retain ) - (func $~lib/array/Array#join (; 202 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#concat (; 210 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - local.get $0 - i32.load offset=4 - i32.const 1 - i32.sub - local.set $2 - local.get $2 + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $1 i32.const 0 - i32.lt_s + i32.eq if - i32.const 3904 - return + block (result i32) + i32.const 4408 + local.tee $2 + local.get $1 + local.tee $3 + i32.ne + if + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $3 + call $~lib/rt/pure/__release + end + local.get $2 + end + local.set $1 end - i32.const 3904 - local.set $3 local.get $0 - i32.load - local.set $5 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.set $4 local.get $1 - i32.load + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.set $5 + local.get $4 + local.get $5 + i32.add local.set $6 local.get $6 i32.const 0 - i32.ne - local.set $7 - local.get $2 - i32.eqz + i32.eq if - i32.const 6872 + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $2 + local.get $1 + call $~lib/rt/pure/__release + local.get $2 return end - i32.const 15 local.get $6 + i32.const 1 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $7 + local.get $7 + local.get $0 + local.get $4 + call $~lib/memory/memory.copy + local.get $7 + local.get $4 i32.add + local.get $1 + local.get $5 + call $~lib/memory/memory.copy + local.get $7 + local.set $2 + local.get $1 + call $~lib/rt/pure/__release local.get $2 - i32.mul - i32.const 15 - i32.add - local.set $8 - local.get $8 - call $~lib/internal/string/allocateUnsafe - local.set $9 + ) + (func $~lib/string/String.__concat (; 211 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.const 4408 + local.get $0 i32.const 0 - local.set $10 + i32.ne + select + local.get $1 + call $~lib/string/String#concat + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + ) + (func $std/array/createRandomString (; 212 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 f64) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $1 block $break|0 i32.const 0 - local.set $11 + local.set $2 loop $repeat|0 - local.get $11 local.get $2 + local.get $0 i32.lt_s i32.eqz br_if $break|0 - block - block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) - local.get $5 - local.set $12 - local.get $11 - local.set $13 - i32.const 0 - local.set $14 - local.get $12 - local.get $13 - i32.const 2 - i32.shl - i32.add - local.get $14 - i32.add - i32.load offset=8 - end - local.set $4 - local.get $4 - if - local.get $9 - local.get $10 - i32.const 6872 - i32.const 0 - i32.const 15 - call $~lib/internal/string/copyUnsafe - local.get $10 - i32.const 15 - i32.add - local.set $10 + block (result i32) + local.get $1 + global.get $std/array/charset + block $~lib/math/NativeMath.floor|inlined.0 (result f64) + call $~lib/math/NativeMath.random + global.get $std/array/charset + call $~lib/string/String#get:length + f64.convert_i32_s + f64.mul + local.set $3 + local.get $3 + f64.floor end - local.get $7 + i32.trunc_f64_s + call $~lib/string/String#charAt + local.tee $4 + call $~lib/string/String.__concat + local.tee $5 + local.tee $6 + local.get $1 + local.tee $7 + i32.ne if - local.get $9 - local.get $10 - local.get $1 - i32.const 0 - local.get $6 - call $~lib/internal/string/copyUnsafe - local.get $10 local.get $6 - i32.add - local.set $10 + call $~lib/rt/pure/__retain + drop + local.get $7 + call $~lib/rt/pure/__release end + local.get $6 end - local.get $11 + local.set $1 + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $2 i32.const 1 i32.add - local.set $11 + local.set $2 br $repeat|0 unreachable end unreachable end - block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i32) - local.get $5 - local.set $13 - local.get $2 - local.set $14 - i32.const 0 - local.set $11 - local.get $13 - local.get $14 - i32.const 2 - i32.shl - i32.add - local.get $11 - i32.add - i32.load offset=8 - end - if - local.get $9 - local.get $10 - i32.const 6872 - i32.const 0 - i32.const 15 - call $~lib/internal/string/copyUnsafe - local.get $10 - i32.const 15 - i32.add - local.set $10 - end - local.get $9 - local.set $11 - local.get $8 - local.get $10 - i32.gt_s - if - local.get $9 - i32.const 0 - local.get $10 - call $~lib/string/String#substring - local.set $11 - block $~lib/internal/string/freeUnsafe|inlined.5 - local.get $9 - local.set $14 - local.get $14 - i32.eqz - if - i32.const 0 - i32.const 4088 - i32.const 28 - i32.const 4 - call $~lib/env/abort - unreachable - end - block $~lib/memory/memory.free|inlined.10 - local.get $14 - local.set $13 - local.get $13 - call $~lib/allocator/arena/__memory_free - br $~lib/memory/memory.free|inlined.10 - end - end - end - local.get $11 - return - ) - (func $~lib/internal/number/itoa (; 203 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/internal/number/itoa32 - return + local.get $1 ) - (func $~lib/internal/number/itoa_stream (; 204 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array<~lib/string/String>#__unchecked_set (; 213 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 + i32.load offset=4 local.get $1 - i32.const 1 + i32.const 2 i32.shl i32.add - local.set $0 - local.get $2 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.eqz - if - local.get $0 - i32.const 48 - i32.store16 offset=4 - i32.const 1 - return - end - i32.const 0 local.set $3 - local.get $2 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.const 0 - i32.lt_s + local.get $3 + i32.load local.set $4 + local.get $2 local.get $4 + i32.ne if - i32.const 0 + local.get $3 local.get $2 - i32.sub - local.set $2 + call $~lib/rt/pure/__retain + i32.store + local.get $4 + call $~lib/rt/pure/__release end local.get $2 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/internal/number/decimalCount32 - local.get $4 - i32.add + call $~lib/rt/pure/__release + ) + (func $~lib/array/Array<~lib/string/String>#__set (; 214 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.load offset=12 local.set $3 - block $~lib/internal/number/utoa32_core|inlined.6 - local.get $0 - local.set $5 + local.get $1 + local.get $3 + i32.gt_u + if local.get $2 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - local.set $6 - local.get $3 - local.set $7 - local.get $5 - local.get $6 - local.get $7 - call $~lib/internal/number/utoa32_lut + call $~lib/rt/pure/__release + block + i32.const 4040 + i32.const 488 + i32.const 121 + i32.const 38 + call $~lib/builtins/abort + unreachable + unreachable + end + unreachable end - local.get $4 + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.const 2 + call $~lib/array/ensureSize + local.get $0 + local.get $1 + local.get $2 + call $~lib/array/Array<~lib/string/String>#__unchecked_set + local.get $1 + local.get $3 + i32.ge_s if local.get $0 - i32.const 45 - i32.store16 offset=4 + local.get $1 + i32.const 1 + i32.add + i32.store offset=12 end - local.get $3 + local.get $2 + call $~lib/rt/pure/__release ) - (func $~lib/array/Array#join (; 205 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/createRandomStringArray (; 215 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) (local $2 i32) (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - local.get $0 - i32.load offset=4 - i32.const 1 - i32.sub - local.set $2 - local.get $2 - i32.const 0 - i32.lt_s - if - i32.const 3904 - return - end - i32.const 3904 - local.set $3 local.get $0 - i32.load - local.set $5 - local.get $1 - i32.load - local.set $6 - local.get $6 - i32.const 0 - i32.ne - local.set $7 - local.get $2 - i32.eqz - if - block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) - local.get $5 - local.set $8 - i32.const 0 - local.set $9 - i32.const 0 - local.set $10 - local.get $8 - local.get $9 - i32.const 0 - i32.shl - i32.add - local.get $10 + call $~lib/array/Array.create<~lib/string/String> + local.set $1 + block $break|0 + i32.const 0 + local.set $2 + loop $repeat|0 + local.get $2 + local.get $0 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $1 + local.get $2 + call $~lib/math/NativeMath.random + f64.const 32 + f64.mul + i32.trunc_f64_s + call $std/array/createRandomString + local.tee $3 + call $~lib/array/Array<~lib/string/String>#__set + local.get $3 + call $~lib/rt/pure/__release + local.get $2 + i32.const 1 i32.add - i32.load8_s offset=8 + local.set $2 + br $repeat|0 + unreachable end - call $~lib/internal/number/itoa - return + unreachable end - i32.const 11 - local.get $6 - i32.add - local.get $2 - i32.mul - i32.const 11 - i32.add - local.set $10 - local.get $10 - call $~lib/internal/string/allocateUnsafe - local.set $9 - i32.const 0 - local.set $8 + local.get $1 + ) + (func $~lib/util/sort/insertionSort<~lib/string/String> (; 216 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) block $break|0 i32.const 0 - local.set $11 + local.set $3 loop $repeat|0 - local.get $11 - local.get $2 + local.get $3 + local.get $1 i32.lt_s i32.eqz br_if $break|0 - block - block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i32) + local.get $0 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load + call $~lib/rt/pure/__retain + local.set $4 + local.get $3 + i32.const 1 + i32.sub + local.set $5 + block $break|1 + loop $continue|1 local.get $5 - local.set $12 - local.get $11 - local.set $13 - i32.const 0 - local.set $14 - local.get $12 - local.get $13 - i32.const 0 - i32.shl - i32.add - local.get $14 - i32.add - i32.load8_s offset=8 - end - local.set $4 - local.get $8 - local.get $9 - local.get $8 - local.get $4 - call $~lib/internal/number/itoa_stream - i32.add - local.set $8 - local.get $7 - if - local.get $9 - local.get $8 - local.get $1 i32.const 0 - local.get $6 - call $~lib/internal/string/copyUnsafe - local.get $8 - local.get $6 - i32.add - local.set $8 + i32.ge_s + if + local.get $0 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load + call $~lib/rt/pure/__retain + local.set $6 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $6 + local.get $2 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 + i32.lt_s + if + local.get $0 + block (result i32) + local.get $5 + local.tee $7 + i32.const 1 + i32.sub + local.set $5 + local.get $7 + end + i32.const 1 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store + else + local.get $6 + call $~lib/rt/pure/__release + br $break|1 + end + local.get $6 + call $~lib/rt/pure/__release + br $continue|1 + end end end - local.get $11 + local.get $0 + local.get $5 i32.const 1 i32.add - local.set $11 + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store + local.get $4 + call $~lib/rt/pure/__release + local.get $3 + i32.const 1 + i32.add + local.set $3 br $repeat|0 unreachable end unreachable end - block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i32) - local.get $5 - local.set $11 - local.get $2 - local.set $14 - i32.const 0 - local.set $13 - local.get $11 - local.get $14 - i32.const 0 - i32.shl - i32.add - local.get $13 - i32.add - i32.load8_s offset=8 - end - local.set $4 - local.get $8 - local.get $9 - local.get $8 - local.get $4 - call $~lib/internal/number/itoa_stream - i32.add - local.set $8 - local.get $9 - local.set $13 - local.get $10 - local.get $8 - i32.gt_s - if - local.get $9 - i32.const 0 - local.get $8 - call $~lib/string/String#substring - local.set $13 - block $~lib/internal/string/freeUnsafe|inlined.6 - local.get $9 - local.set $14 - local.get $14 - i32.eqz - if - i32.const 0 - i32.const 4088 - i32.const 28 - i32.const 4 - call $~lib/env/abort - unreachable - end - block $~lib/memory/memory.free|inlined.11 - local.get $14 - local.set $11 - local.get $11 - call $~lib/allocator/arena/__memory_free - br $~lib/memory/memory.free|inlined.11 - end - end - end - local.get $13 - return - ) - (func $~lib/internal/number/itoa (; 206 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.const 65535 - i32.and - call $~lib/internal/number/utoa32 - return ) - (func $~lib/internal/number/itoa_stream (; 207 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array<~lib/string/String>#sort (; 217 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) local.get $0 - local.get $1 - i32.const 1 - i32.shl - i32.add - local.set $0 + i32.load offset=12 + local.set $2 local.get $2 - i32.const 65535 - i32.and - i32.eqz + i32.const 1 + i32.le_s if local.get $0 - i32.const 48 - i32.store16 offset=4 - i32.const 1 + call $~lib/rt/pure/__retain return end - i32.const 0 + local.get $0 + i32.load offset=4 local.set $3 local.get $2 - i32.const 65535 - i32.and - call $~lib/internal/number/decimalCount32 - local.set $3 - block $~lib/internal/number/utoa32_core|inlined.7 - local.get $0 + i32.const 2 + i32.eq + if + local.get $3 + i32.load offset=4 + call $~lib/rt/pure/__retain local.set $4 - local.get $2 - i32.const 65535 - i32.and - local.set $5 local.get $3 + i32.load + call $~lib/rt/pure/__retain + local.set $5 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $5 + local.get $1 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 + i32.lt_s + if + local.get $3 + local.get $5 + i32.store offset=4 + local.get $3 + local.get $4 + i32.store + end + local.get $0 + call $~lib/rt/pure/__retain local.set $6 local.get $4 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + return + end + block $~lib/util/sort/SORT<~lib/string/String>|inlined.0 + local.get $3 + local.set $5 + local.get $2 + local.set $4 + local.get $1 + local.set $6 local.get $5 + local.get $4 local.get $6 - call $~lib/internal/number/utoa32_lut + call $~lib/util/sort/insertionSort<~lib/string/String> + end + local.get $0 + call $~lib/rt/pure/__retain + ) + (func $~lib/array/Array<~lib/string/String>#get:length (; 218 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=12 + ) + (func $~lib/array/Array<~lib/string/String>#__unchecked_get (; 219 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + i32.load + call $~lib/rt/pure/__retain + ) + (func $~lib/array/Array<~lib/string/String>#__get (; 220 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 + local.get $0 + i32.load offset=12 + i32.ge_u + if + i32.const 4040 + i32.const 488 + i32.const 106 + i32.const 45 + call $~lib/builtins/abort + unreachable end - local.get $3 + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ge_u + if + i32.const 280 + i32.const 488 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/string/String>#__unchecked_get ) - (func $~lib/array/Array#join (; 208 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/isSorted<~lib/string/String> (; 221 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - local.get $0 - i32.load offset=4 - i32.const 1 - i32.sub - local.set $2 - local.get $2 - i32.const 0 - i32.lt_s - if - i32.const 3904 - return - end - i32.const 3904 - local.set $3 local.get $0 - i32.load - local.set $5 - local.get $1 - i32.load - local.set $6 - local.get $6 - i32.const 0 - i32.ne - local.set $7 - local.get $2 - i32.eqz - if - block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) - local.get $5 - local.set $8 - i32.const 0 - local.set $9 - i32.const 0 - local.set $10 - local.get $8 - local.get $9 + call $~lib/rt/pure/__retain + drop + block $break|0 + block i32.const 1 - i32.shl - i32.add - local.get $10 - i32.add - i32.load16_u offset=8 + local.set $2 + local.get $0 + call $~lib/array/Array<~lib/string/String>#get:length + local.set $3 end - call $~lib/internal/number/itoa - return - end - i32.const 10 - local.get $6 - i32.add - local.get $2 - i32.mul - i32.const 10 - i32.add - local.set $10 - local.get $10 - call $~lib/internal/string/allocateUnsafe - local.set $9 - i32.const 0 - local.set $8 - block $break|0 - i32.const 0 - local.set $11 loop $repeat|0 - local.get $11 local.get $2 + local.get $3 i32.lt_s i32.eqz br_if $break|0 - block - block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i32) - local.get $5 - local.set $12 - local.get $11 - local.set $13 - i32.const 0 - local.set $14 - local.get $12 - local.get $13 - i32.const 1 - i32.shl - i32.add - local.get $14 - i32.add - i32.load16_u offset=8 - end - local.set $4 - local.get $8 - local.get $9 - local.get $8 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $0 + local.get $2 + i32.const 1 + i32.sub + call $~lib/array/Array<~lib/string/String>#__get + local.tee $4 + local.get $0 + local.get $2 + call $~lib/array/Array<~lib/string/String>#__get + local.tee $5 + local.get $1 + call_indirect (type $FUNCSIG$iii) + end + i32.const 0 + i32.gt_s + if + i32.const 0 + local.set $6 + local.get $0 + call $~lib/rt/pure/__release local.get $4 - call $~lib/internal/number/itoa_stream - i32.add - local.set $8 - local.get $7 - if - local.get $9 - local.get $8 - local.get $1 - i32.const 0 - local.get $6 - call $~lib/internal/string/copyUnsafe - local.get $8 - local.get $6 - i32.add - local.set $8 - end + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + return end - local.get $11 + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $2 i32.const 1 i32.add - local.set $11 + local.set $2 br $repeat|0 unreachable end unreachable end - block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i32) - local.get $5 - local.set $11 - local.get $2 - local.set $14 + i32.const 1 + local.set $5 + local.get $0 + call $~lib/rt/pure/__release + local.get $5 + ) + (func $std/array/assertSorted<~lib/string/String> (; 222 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/string/String>#sort + local.tee $2 + local.get $1 + call $std/array/isSorted<~lib/string/String> + i32.eqz + if i32.const 0 - local.set $13 - local.get $11 - local.get $14 + i32.const 376 + i32.const 830 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + ) + (func $~lib/util/sort/COMPARATOR<~lib/string/String>~anonymous|0 (; 223 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + i32.eq + if (result i32) i32.const 1 - i32.shl - i32.add - local.get $13 - i32.add - i32.load16_u offset=8 + else + local.get $0 + i32.const 0 + i32.eq + end + if (result i32) + i32.const 1 + else + local.get $1 + i32.const 0 + i32.eq + end + if + i32.const 0 + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + return end + local.get $0 + call $~lib/string/String#get:length + local.set $3 + local.get $1 + call $~lib/string/String#get:length local.set $4 - local.get $8 - local.get $9 - local.get $8 - local.get $4 - call $~lib/internal/number/itoa_stream - i32.add - local.set $8 - local.get $9 - local.set $13 - local.get $10 - local.get $8 - i32.gt_s + local.get $3 + i32.eqz + if (result i32) + local.get $4 + i32.eqz + else + i32.const 0 + end if - local.get $9 i32.const 0 - local.get $8 - call $~lib/string/String#substring - local.set $13 - block $~lib/internal/string/freeUnsafe|inlined.7 - local.get $9 - local.set $14 - local.get $14 - i32.eqz - if - i32.const 0 - i32.const 4088 - i32.const 28 - i32.const 4 - call $~lib/env/abort - unreachable - end - block $~lib/memory/memory.free|inlined.12 - local.get $14 - local.set $11 - local.get $11 - call $~lib/allocator/arena/__memory_free - br $~lib/memory/memory.free|inlined.12 - end - end + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + return end - local.get $13 - return - ) - (func $~lib/internal/number/decimalCount64 (; 209 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) - (local $1 i32) - local.get $0 - i64.const 1000000000000000 - i64.lt_u + local.get $3 + i32.eqz if + i32.const -1 + local.set $2 local.get $0 - i64.const 1000000000000 - i64.lt_u - if - i32.const 11 - i32.const 12 - local.get $0 - i64.const 100000000000 - i64.lt_u - select - return - else - i32.const 14 - i32.const 15 - local.get $0 - i64.const 100000000000000 - i64.lt_u - select - local.set $1 - i32.const 13 - local.get $1 - local.get $0 - i64.const 10000000000000 - i64.lt_u - select - return - end - unreachable - unreachable - else + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + return + end + local.get $4 + i32.eqz + if + i32.const 1 + local.set $2 local.get $0 - i64.const 100000000000000000 - i64.lt_u - if - i32.const 16 - i32.const 17 - local.get $0 - i64.const 10000000000000000 - i64.lt_u - select - return - else - i32.const 19 - i32.const 20 - local.get $0 - i64.const -8446744073709551616 - i64.lt_u - select - local.set $1 - i32.const 18 - local.get $1 - local.get $0 - i64.const 1000000000000000000 - i64.lt_u - select - return + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + return + end + local.get $0 + i32.const 0 + local.get $1 + i32.const 0 + local.get $3 + local.tee $2 + local.get $4 + local.tee $5 + local.get $2 + local.get $5 + i32.lt_s + select + call $~lib/util/string/compareImpl + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + ) + (func $std/array/assertSorted<~lib/string/String>|trampoline (; 224 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + block $1of1 + block $0of1 + block $outOfRange + global.get $~lib/argc + i32.const 1 + i32.sub + br_table $0of1 $1of1 $outOfRange + end + unreachable end - unreachable - unreachable + block $~lib/util/sort/COMPARATOR<~lib/string/String>|inlined.0 (result i32) + i32.const 56 + br $~lib/util/sort/COMPARATOR<~lib/string/String>|inlined.0 + end + local.set $1 end - unreachable - unreachable + local.get $0 + local.get $1 + call $std/array/assertSorted<~lib/string/String> ) - (func $~lib/internal/number/utoa64_lut (; 210 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) + (func $~lib/string/String#substring (; 225 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - (local $4 i64) + (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) (local $8 i32) (local $9 i32) (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 i64) - (local $16 i64) - i32.const 4832 - i32.load + local.get $0 + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 4360 + i32.const 196 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/string/String#get:length local.set $3 - block $break|0 - loop $continue|0 - local.get $1 - i64.const 100000000 - i64.ge_u - if - block - local.get $1 - i64.const 100000000 - i64.div_u - local.set $4 - local.get $1 - local.get $4 - i64.const 100000000 - i64.mul - i64.sub - i32.wrap_i64 - local.set $5 - local.get $4 - local.set $1 - local.get $5 - i32.const 10000 - i32.div_u - local.set $6 - local.get $5 - i32.const 10000 - i32.rem_u - local.set $7 - local.get $6 - i32.const 100 - i32.div_u - local.set $8 - local.get $6 - i32.const 100 - i32.rem_u - local.set $9 - local.get $7 - i32.const 100 - i32.div_u - local.set $10 - local.get $7 - i32.const 100 - i32.rem_u - local.set $11 - block $~lib/internal/arraybuffer/LOAD|inlined.4 (result i64) - local.get $3 - local.set $12 - local.get $10 - local.set $13 - i32.const 0 - local.set $14 - local.get $12 - local.get $13 - i32.const 2 - i32.shl - i32.add - local.get $14 - i32.add - i64.load32_u offset=8 - end - local.set $15 - block $~lib/internal/arraybuffer/LOAD|inlined.5 (result i64) - local.get $3 - local.set $14 - local.get $11 - local.set $13 - i32.const 0 - local.set $12 - local.get $14 - local.get $13 - i32.const 2 - i32.shl - i32.add - local.get $12 - i32.add - i64.load32_u offset=8 - end - local.set $16 - local.get $2 - i32.const 4 - i32.sub - local.set $2 - local.get $0 - local.get $2 - i32.const 1 - i32.shl - i32.add - local.get $15 - local.get $16 - i64.const 32 - i64.shl - i64.or - i64.store offset=4 - block $~lib/internal/arraybuffer/LOAD|inlined.6 (result i64) - local.get $3 - local.set $12 - local.get $8 - local.set $13 - i32.const 0 - local.set $14 - local.get $12 - local.get $13 - i32.const 2 - i32.shl - i32.add - local.get $14 - i32.add - i64.load32_u offset=8 - end - local.set $15 - block $~lib/internal/arraybuffer/LOAD|inlined.7 (result i64) - local.get $3 - local.set $14 - local.get $9 - local.set $13 - i32.const 0 - local.set $12 - local.get $14 - local.get $13 - i32.const 2 - i32.shl - i32.add - local.get $12 - i32.add - i64.load32_u offset=8 - end - local.set $16 - local.get $2 - i32.const 4 - i32.sub - local.set $2 - local.get $0 - local.get $2 - i32.const 1 - i32.shl - i32.add - local.get $15 - local.get $16 - i64.const 32 - i64.shl - i64.or - i64.store offset=4 - end - br $continue|0 - end - end + local.get $1 + local.tee $4 + i32.const 0 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.lt_s + select + local.set $6 + local.get $2 + local.tee $4 + i32.const 0 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.lt_s + select + local.set $7 + local.get $6 + local.tee $4 + local.get $7 + local.tee $5 + local.get $4 + local.get $5 + i32.lt_s + select + i32.const 1 + i32.shl + local.set $8 + local.get $6 + local.tee $4 + local.get $7 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + i32.const 1 + i32.shl + local.set $9 + local.get $9 + local.get $8 + i32.sub + local.set $3 + local.get $3 + i32.eqz + if + i32.const 4248 + call $~lib/rt/pure/__retain + return + end + local.get $8 + i32.eqz + if (result i32) + local.get $9 + local.get $0 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + i32.eq + else + i32.const 0 end + if + local.get $0 + call $~lib/rt/pure/__retain + return + end + local.get $3 + i32.const 1 + call $~lib/rt/tlsf/__alloc + local.set $10 + local.get $10 local.get $0 - local.get $1 - i32.wrap_i64 - local.get $2 - call $~lib/internal/number/utoa32_lut + local.get $8 + i32.add + local.get $3 + call $~lib/memory/memory.copy + local.get $10 + call $~lib/rt/pure/__retain ) - (func $~lib/internal/number/utoa64 (; 211 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) - (local $1 i32) + (func $~lib/array/Array#join_bool (; 226 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i64) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop local.get $0 - i64.eqz + i32.load offset=12 + i32.const 1 + i32.sub + local.set $2 + local.get $2 + i32.const 0 + i32.lt_s if - i32.const 4312 + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $3 return end local.get $0 - global.get $~lib/builtins/u32.MAX_VALUE - i64.extend_i32_u - i64.le_u + i32.load offset=4 + local.set $4 + local.get $2 + i32.eqz if - local.get $0 - i32.wrap_i64 - local.set $2 - local.get $2 - call $~lib/internal/number/decimalCount32 + i32.const 4456 + i32.const 4480 + local.get $4 + i32.load8_u + select + call $~lib/rt/pure/__retain local.set $3 + local.get $1 + call $~lib/rt/pure/__release local.get $3 - call $~lib/internal/string/allocateUnsafe - local.set $1 - block $~lib/internal/number/utoa32_core|inlined.8 - local.get $1 - local.set $4 - local.get $2 - local.set $5 + return + end + local.get $1 + call $~lib/string/String#get:length + local.set $5 + i32.const 5 + local.set $6 + local.get $6 + local.get $5 + i32.add + local.get $2 + i32.mul + local.get $6 + i32.add + local.set $7 + local.get $7 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $8 + i32.const 0 + local.set $9 + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 local.get $3 - local.set $6 + local.get $2 + i32.lt_s + i32.eqz + br_if $break|0 local.get $4 - local.get $5 - local.get $6 - call $~lib/internal/number/utoa32_lut - end - else - local.get $0 - call $~lib/internal/number/decimalCount64 - local.set $3 - local.get $3 - call $~lib/internal/string/allocateUnsafe - local.set $1 - block $~lib/internal/number/utoa64_core|inlined.0 - local.get $1 - local.set $2 - local.get $0 - local.set $7 local.get $3 + i32.add + i32.load8_u + local.set $10 + i32.const 4 + local.get $10 + i32.const 0 + i32.ne + i32.eqz + i32.add local.set $6 - local.get $2 - local.get $7 + local.get $8 + local.get $9 + i32.const 1 + i32.shl + i32.add + i32.const 4456 + i32.const 4480 + local.get $10 + select local.get $6 - call $~lib/internal/number/utoa64_lut + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $6 + i32.add + local.set $9 + local.get $5 + if + local.get $8 + local.get $9 + i32.const 1 + i32.shl + i32.add + local.get $1 + local.get $5 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $5 + i32.add + local.set $9 + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable end + unreachable end - local.get $1 - ) - (func $~lib/internal/number/itoa (; 212 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) - local.get $0 - call $~lib/internal/number/utoa64 - return - ) - (func $~lib/internal/number/itoa_stream (; 213 ;) (type $FUNCSIG$iiij) (param $0 i32) (param $1 i32) (param $2 i64) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i64) - local.get $0 - local.get $1 + local.get $4 + local.get $2 + i32.add + i32.load8_u + local.set $10 + i32.const 4 + local.get $10 + i32.const 0 + i32.ne + i32.eqz + i32.add + local.set $6 + local.get $8 + local.get $9 i32.const 1 i32.shl i32.add - local.set $0 - local.get $2 - i64.eqz + i32.const 4456 + i32.const 4480 + local.get $10 + select + local.get $6 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $6 + i32.add + local.set $9 + local.get $7 + local.get $9 + i32.gt_s if - local.get $0 - i32.const 48 - i32.store16 offset=4 - i32.const 1 + local.get $8 + i32.const 0 + local.get $9 + call $~lib/string/String#substring + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $8 + call $~lib/rt/pure/__release + local.get $3 return end - i32.const 0 + local.get $8 local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $~lib/array/Array#join (; 227 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array#join_bool + local.set $2 + local.get $1 + call $~lib/rt/pure/__release local.get $2 - global.get $~lib/builtins/u32.MAX_VALUE - i64.extend_i32_u - i64.le_u - if - local.get $2 - i32.wrap_i64 - local.set $4 - local.get $4 - call $~lib/internal/number/decimalCount32 - local.set $3 - block $~lib/internal/number/utoa32_core|inlined.9 + return + ) + (func $~lib/util/number/decimalCount32 (; 228 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + i32.const 100000 + i32.lt_u + if + local.get $0 + i32.const 100 + i32.lt_u + if + i32.const 1 + i32.const 2 local.get $0 - local.set $5 - local.get $4 - local.set $6 - local.get $3 - local.set $7 - local.get $5 - local.get $6 - local.get $7 - call $~lib/internal/number/utoa32_lut + i32.const 10 + i32.lt_u + select + return + else + i32.const 4 + i32.const 5 + local.get $0 + i32.const 10000 + i32.lt_u + select + local.set $1 + i32.const 3 + local.get $1 + local.get $0 + i32.const 1000 + i32.lt_u + select + return end + unreachable + unreachable else - local.get $2 - call $~lib/internal/number/decimalCount64 - local.set $3 - block $~lib/internal/number/utoa64_core|inlined.1 + local.get $0 + i32.const 10000000 + i32.lt_u + if + i32.const 6 + i32.const 7 local.get $0 - local.set $4 - local.get $2 - local.set $8 - local.get $3 - local.set $7 - local.get $4 - local.get $8 - local.get $7 - call $~lib/internal/number/utoa64_lut + i32.const 1000000 + i32.lt_u + select + return + else + i32.const 9 + i32.const 10 + local.get $0 + i32.const 1000000000 + i32.lt_u + select + local.set $1 + i32.const 8 + local.get $1 + local.get $0 + i32.const 100000000 + i32.lt_u + select + return end + unreachable + unreachable end - local.get $3 + unreachable + unreachable ) - (func $~lib/array/Array#join (; 214 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) + (func $~lib/util/number/utoa32_lut (; 229 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - (local $4 i64) + (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - local.get $0 + (local $8 i64) + (local $9 i64) + i32.const 5048 i32.load offset=4 - i32.const 1 - i32.sub - local.set $2 - local.get $2 - i32.const 0 - i32.lt_s - if - i32.const 3904 - return - end - i32.const 3904 local.set $3 - local.get $0 - i32.load - local.set $5 - local.get $1 - i32.load - local.set $6 - local.get $6 - i32.const 0 - i32.ne - local.set $7 - local.get $2 - i32.eqz - if - block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i64) - local.get $5 - local.set $8 - i32.const 0 - local.set $9 - i32.const 0 - local.set $10 - local.get $8 - local.get $9 - i32.const 3 - i32.shl - i32.add - local.get $10 - i32.add - i64.load offset=8 - end - call $~lib/internal/number/itoa - return - end - i32.const 20 - local.get $6 - i32.add - local.get $2 - i32.mul - i32.const 20 - i32.add - local.set $10 - local.get $10 - call $~lib/internal/string/allocateUnsafe - local.set $9 - i32.const 0 - local.set $8 block $break|0 - i32.const 0 - local.set $11 - loop $repeat|0 - local.get $11 - local.get $2 - i32.lt_s - i32.eqz - br_if $break|0 - block - block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i64) - local.get $5 - local.set $12 - local.get $11 - local.set $13 - i32.const 0 - local.set $14 - local.get $12 - local.get $13 - i32.const 3 - i32.shl - i32.add - local.get $14 - i32.add - i64.load offset=8 - end + loop $continue|0 + local.get $1 + i32.const 10000 + i32.ge_u + if + local.get $1 + i32.const 10000 + i32.div_u local.set $4 - local.get $8 - local.get $9 - local.get $8 + local.get $1 + i32.const 10000 + i32.rem_u + local.set $5 local.get $4 - call $~lib/internal/number/itoa_stream + local.set $1 + local.get $5 + i32.const 100 + i32.div_u + local.set $6 + local.get $5 + i32.const 100 + i32.rem_u + local.set $7 + local.get $3 + local.get $6 + i32.const 2 + i32.shl i32.add + i64.load32_u local.set $8 + local.get $3 local.get $7 - if - local.get $9 - local.get $8 - local.get $1 - i32.const 0 - local.get $6 - call $~lib/internal/string/copyUnsafe - local.get $8 - local.get $6 - i32.add - local.set $8 - end + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $9 + local.get $2 + i32.const 4 + i32.sub + local.set $2 + local.get $0 + local.get $2 + i32.const 1 + i32.shl + i32.add + local.get $8 + local.get $9 + i64.const 32 + i64.shl + i64.or + i64.store + br $continue|0 end - local.get $11 - i32.const 1 - i32.add - local.set $11 - br $repeat|0 - unreachable end - unreachable end - block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i64) + local.get $1 + i32.const 100 + i32.ge_u + if + local.get $1 + i32.const 100 + i32.div_u + local.set $7 + local.get $1 + i32.const 100 + i32.rem_u + local.set $6 + local.get $7 + local.set $1 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $5 + local.get $0 + local.get $2 + i32.const 1 + i32.shl + i32.add local.get $5 - local.set $11 + i32.store + end + local.get $1 + i32.const 10 + i32.ge_u + if + local.get $2 + i32.const 2 + i32.sub + local.set $2 + local.get $3 + local.get $1 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $5 + local.get $0 local.get $2 - local.set $14 - i32.const 0 - local.set $13 - local.get $11 - local.get $14 - i32.const 3 + i32.const 1 i32.shl i32.add - local.get $13 + local.get $5 + i32.store + else + local.get $2 + i32.const 1 + i32.sub + local.set $2 + i32.const 48 + local.get $1 i32.add - i64.load offset=8 - end - local.set $4 - local.get $8 - local.get $9 - local.get $8 - local.get $4 - call $~lib/internal/number/itoa_stream - i32.add - local.set $8 - local.get $9 - local.set $13 - local.get $10 - local.get $8 - i32.gt_s - if - local.get $9 - i32.const 0 - local.get $8 - call $~lib/string/String#substring - local.set $13 - block $~lib/internal/string/freeUnsafe|inlined.8 - local.get $9 - local.set $14 - local.get $14 - i32.eqz - if - i32.const 0 - i32.const 4088 - i32.const 28 - i32.const 4 - call $~lib/env/abort - unreachable - end - block $~lib/memory/memory.free|inlined.13 - local.get $14 - local.set $11 - local.get $11 - call $~lib/allocator/arena/__memory_free - br $~lib/memory/memory.free|inlined.13 - end - end + local.set $5 + local.get $0 + local.get $2 + i32.const 1 + i32.shl + i32.add + local.get $5 + i32.store16 end - local.get $13 - return ) - (func $~lib/internal/number/itoa64 (; 215 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/number/itoa32 (; 230 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - (local $8 i64) local.get $0 - i64.eqz + i32.eqz if - i32.const 4312 + i32.const 4608 + call $~lib/rt/pure/__retain return end local.get $0 - i64.const 0 - i64.lt_s + i32.const 0 + i32.lt_s local.set $1 local.get $1 if - i64.const 0 + i32.const 0 local.get $0 - i64.sub + i32.sub local.set $0 end local.get $0 - global.get $~lib/builtins/u32.MAX_VALUE - i64.extend_i32_u - i64.le_u - if - local.get $0 - i32.wrap_i64 - local.set $3 + call $~lib/util/number/decimalCount32 + local.get $1 + i32.add + local.set $2 + local.get $2 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + local.set $3 + block $~lib/util/number/utoa32_core|inlined.0 local.get $3 - call $~lib/internal/number/decimalCount32 - local.get $1 - i32.add - local.set $4 - local.get $4 - call $~lib/internal/string/allocateUnsafe - local.set $2 - block $~lib/internal/number/utoa32_core|inlined.10 - local.get $2 - local.set $5 - local.get $3 - local.set $6 - local.get $4 - local.set $7 - local.get $5 - local.get $6 - local.get $7 - call $~lib/internal/number/utoa32_lut - end - else + local.set $6 local.get $0 - call $~lib/internal/number/decimalCount64 - local.get $1 - i32.add + local.set $5 + local.get $2 local.set $4 + local.get $6 + local.get $5 local.get $4 - call $~lib/internal/string/allocateUnsafe - local.set $2 - block $~lib/internal/number/utoa64_core|inlined.2 - local.get $2 - local.set $3 - local.get $0 - local.set $8 - local.get $4 - local.set $7 - local.get $3 - local.get $8 - local.get $7 - call $~lib/internal/number/utoa64_lut - end + call $~lib/util/number/utoa32_lut end local.get $1 if - local.get $2 + local.get $3 i32.const 45 - i32.store16 offset=4 + i32.store16 end - local.get $2 + local.get $3 + call $~lib/rt/pure/__retain ) - (func $~lib/internal/number/itoa (; 216 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/number/itoa (; 231 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - call $~lib/internal/number/itoa64 + call $~lib/util/number/itoa32 return ) - (func $~lib/internal/number/itoa_stream (; 217 ;) (type $FUNCSIG$iiij) (param $0 i32) (param $1 i32) (param $2 i64) (result i32) + (func $~lib/util/number/itoa_stream (; 232 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i64) local.get $0 local.get $1 i32.const 1 @@ -16224,270 +12417,53 @@ i32.add local.set $0 local.get $2 - i64.eqz + i32.eqz if local.get $0 i32.const 48 - i32.store16 offset=4 + i32.store16 i32.const 1 return end i32.const 0 local.set $3 local.get $2 - i64.const 0 - i64.lt_s - local.set $4 - local.get $4 - if - i64.const 0 - local.get $2 - i64.sub - local.set $2 - end - local.get $2 - global.get $~lib/builtins/u32.MAX_VALUE - i64.extend_i32_u - i64.le_u - if - local.get $2 - i32.wrap_i64 - local.set $5 - local.get $5 - call $~lib/internal/number/decimalCount32 - local.get $4 - i32.add - local.set $3 - block $~lib/internal/number/utoa32_core|inlined.11 - local.get $0 - local.set $6 - local.get $5 - local.set $7 - local.get $3 - local.set $8 - local.get $6 - local.get $7 - local.get $8 - call $~lib/internal/number/utoa32_lut - end - else - local.get $2 - call $~lib/internal/number/decimalCount64 - local.get $4 - i32.add - local.set $3 - block $~lib/internal/number/utoa64_core|inlined.3 - local.get $0 - local.set $5 - local.get $2 - local.set $9 - local.get $3 - local.set $8 - local.get $5 - local.get $9 - local.get $8 - call $~lib/internal/number/utoa64_lut - end - end - local.get $4 - if - local.get $0 - i32.const 45 - i32.store16 offset=4 - end - local.get $3 - ) - (func $~lib/array/Array#join (; 218 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i64) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - local.get $0 - i32.load offset=4 - i32.const 1 - i32.sub - local.set $2 - local.get $2 - i32.const 0 - i32.lt_s - if - i32.const 3904 - return - end - i32.const 3904 - local.set $3 - local.get $0 - i32.load - local.set $5 - local.get $1 - i32.load - local.set $6 - local.get $6 - i32.const 0 - i32.ne - local.set $7 - local.get $2 - i32.eqz - if - block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i64) - local.get $5 - local.set $8 - i32.const 0 - local.set $9 - i32.const 0 - local.set $10 - local.get $8 - local.get $9 - i32.const 3 - i32.shl - i32.add - local.get $10 - i32.add - i64.load offset=8 - end - call $~lib/internal/number/itoa - return - end - i32.const 21 - local.get $6 - i32.add - local.get $2 - i32.mul - i32.const 21 - i32.add - local.set $10 - local.get $10 - call $~lib/internal/string/allocateUnsafe - local.set $9 i32.const 0 - local.set $8 - block $break|0 + i32.lt_s + local.set $4 + local.get $4 + if i32.const 0 - local.set $11 - loop $repeat|0 - local.get $11 - local.get $2 - i32.lt_s - i32.eqz - br_if $break|0 - block - block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i64) - local.get $5 - local.set $12 - local.get $11 - local.set $13 - i32.const 0 - local.set $14 - local.get $12 - local.get $13 - i32.const 3 - i32.shl - i32.add - local.get $14 - i32.add - i64.load offset=8 - end - local.set $4 - local.get $8 - local.get $9 - local.get $8 - local.get $4 - call $~lib/internal/number/itoa_stream - i32.add - local.set $8 - local.get $7 - if - local.get $9 - local.get $8 - local.get $1 - i32.const 0 - local.get $6 - call $~lib/internal/string/copyUnsafe - local.get $8 - local.get $6 - i32.add - local.set $8 - end - end - local.get $11 - i32.const 1 - i32.add - local.set $11 - br $repeat|0 - unreachable - end - unreachable - end - block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i64) - local.get $5 - local.set $11 local.get $2 - local.set $14 - i32.const 0 - local.set $13 - local.get $11 - local.get $14 - i32.const 3 - i32.shl - i32.add - local.get $13 - i32.add - i64.load offset=8 + i32.sub + local.set $2 end - local.set $4 - local.get $8 - local.get $9 - local.get $8 + local.get $2 + call $~lib/util/number/decimalCount32 local.get $4 - call $~lib/internal/number/itoa_stream i32.add - local.set $8 - local.get $9 - local.set $13 - local.get $10 - local.get $8 - i32.gt_s + local.set $3 + block $~lib/util/number/utoa32_core|inlined.1 + local.get $0 + local.set $7 + local.get $2 + local.set $6 + local.get $3 + local.set $5 + local.get $7 + local.get $6 + local.get $5 + call $~lib/util/number/utoa32_lut + end + local.get $4 if - local.get $9 - i32.const 0 - local.get $8 - call $~lib/string/String#substring - local.set $13 - block $~lib/internal/string/freeUnsafe|inlined.9 - local.get $9 - local.set $14 - local.get $14 - i32.eqz - if - i32.const 0 - i32.const 4088 - i32.const 28 - i32.const 4 - call $~lib/env/abort - unreachable - end - block $~lib/memory/memory.free|inlined.14 - local.get $14 - local.set $11 - local.get $11 - call $~lib/allocator/arena/__memory_free - br $~lib/memory/memory.free|inlined.14 - end - end + local.get $0 + i32.const 45 + i32.store16 end - local.get $13 - return + local.get $3 ) - (func $~lib/array/Array<~lib/array/Array>#join (; 219 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join_int (; 233 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -16497,9 +12473,11 @@ (local $8 i32) (local $9 i32) (local $10 i32) - (local $11 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.load offset=4 + i32.load offset=12 i32.const 1 i32.sub local.set $2 @@ -16507,141 +12485,195 @@ i32.const 0 i32.lt_s if - i32.const 3904 + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $3 return end - i32.const 3904 - local.set $3 local.get $0 - i32.load - local.set $5 - local.get $1 - i32.load - local.set $6 - local.get $6 - i32.const 0 - i32.ne - local.set $7 + i32.load offset=4 + local.set $4 local.get $2 i32.eqz if - block $~lib/internal/arraybuffer/LOAD<~lib/array/Array,~lib/array/Array>|inlined.5 (result i32) - local.get $5 - local.set $8 - i32.const 0 - local.set $9 - i32.const 0 - local.set $10 - local.get $8 - local.get $9 - i32.const 2 - i32.shl - i32.add - local.get $10 - i32.add - i32.load offset=8 - end - local.set $4 local.get $4 - if (result i32) - local.get $4 - local.get $1 - call $~lib/array/Array#join - else - i32.const 3904 - end + i32.load + call $~lib/util/number/itoa + local.tee $3 + call $~lib/rt/pure/__retain + local.set $5 + local.get $3 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $5 return end + local.get $1 + call $~lib/string/String#get:length + local.set $6 + i32.const 11 + local.get $6 + i32.add + local.get $2 + i32.mul + i32.const 11 + i32.add + local.set $7 + local.get $7 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $8 + i32.const 0 + local.set $9 block $break|0 i32.const 0 - local.set $10 + local.set $3 loop $repeat|0 - local.get $10 + local.get $3 local.get $2 i32.lt_s i32.eqz br_if $break|0 - block - block $~lib/internal/arraybuffer/LOAD<~lib/array/Array,~lib/array/Array>|inlined.6 (result i32) - local.get $5 - local.set $9 - local.get $10 - local.set $8 - i32.const 0 - local.set $11 - local.get $9 - local.get $8 - i32.const 2 - i32.shl - i32.add - local.get $11 - i32.add - i32.load offset=8 - end - local.set $4 - local.get $4 - if - local.get $3 - local.get $4 - local.get $1 - call $~lib/array/Array#join - call $~lib/string/String.__concat - local.set $3 - end - local.get $7 - if - local.get $3 - local.get $1 - call $~lib/string/String.__concat - local.set $3 - end - end + local.get $4 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $10 + local.get $9 + local.get $8 + local.get $9 local.get $10 + call $~lib/util/number/itoa_stream + i32.add + local.set $9 + local.get $6 + if + local.get $8 + local.get $9 + i32.const 1 + i32.shl + i32.add + local.get $1 + local.get $6 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $6 + i32.add + local.set $9 + end + local.get $3 i32.const 1 i32.add - local.set $10 + local.set $3 br $repeat|0 unreachable - end - unreachable - end - block $~lib/internal/arraybuffer/LOAD<~lib/array/Array,~lib/array/Array>|inlined.7 (result i32) - local.get $5 - local.set $10 - local.get $2 - local.set $11 - i32.const 0 - local.set $8 - local.get $10 - local.get $11 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.add - i32.load offset=8 + end + unreachable end - local.set $4 local.get $4 + local.get $2 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $10 + local.get $9 + local.get $8 + local.get $9 + local.get $10 + call $~lib/util/number/itoa_stream + i32.add + local.set $9 + local.get $7 + local.get $9 + i32.gt_s if - local.get $3 - local.get $4 - local.get $1 - call $~lib/array/Array#join - call $~lib/string/String.__concat + local.get $8 + i32.const 0 + local.get $9 + call $~lib/string/String#substring local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $8 + call $~lib/rt/pure/__release + local.get $3 + return end + local.get $8 + local.set $3 + local.get $1 + call $~lib/rt/pure/__release local.get $3 + ) + (func $~lib/array/Array#join (; 234 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array#join_int + local.set $2 + local.get $1 + call $~lib/rt/pure/__release + local.get $2 return ) - (func $~lib/internal/number/itoa (; 220 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/utoa32 (; 235 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) local.get $0 - i32.const 255 - i32.and - call $~lib/internal/number/utoa32 + i32.eqz + if + i32.const 4608 + call $~lib/rt/pure/__retain + return + end + local.get $0 + call $~lib/util/number/decimalCount32 + local.set $1 + local.get $1 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + local.set $2 + block $~lib/util/number/utoa32_core|inlined.2 + local.get $2 + local.set $5 + local.get $0 + local.set $4 + local.get $1 + local.set $3 + local.get $5 + local.get $4 + local.get $3 + call $~lib/util/number/utoa32_lut + end + local.get $2 + call $~lib/rt/pure/__retain + ) + (func $~lib/util/number/itoa (; 236 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + call $~lib/util/number/utoa32 return ) - (func $~lib/internal/number/itoa_stream (; 221 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/itoa_stream (; 237 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -16653,40 +12685,34 @@ i32.add local.set $0 local.get $2 - i32.const 255 - i32.and i32.eqz if local.get $0 i32.const 48 - i32.store16 offset=4 + i32.store16 i32.const 1 return end i32.const 0 local.set $3 local.get $2 - i32.const 255 - i32.and - call $~lib/internal/number/decimalCount32 + call $~lib/util/number/decimalCount32 local.set $3 - block $~lib/internal/number/utoa32_core|inlined.12 + block $~lib/util/number/utoa32_core|inlined.3 local.get $0 - local.set $4 + local.set $6 local.get $2 - i32.const 255 - i32.and local.set $5 local.get $3 - local.set $6 - local.get $4 - local.get $5 + local.set $4 local.get $6 - call $~lib/internal/number/utoa32_lut + local.get $5 + local.get $4 + call $~lib/util/number/utoa32_lut end local.get $3 ) - (func $~lib/array/Array#join (; 222 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join_int (; 238 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -16696,12 +12722,11 @@ (local $8 i32) (local $9 i32) (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.load offset=4 + i32.load offset=12 i32.const 1 i32.sub local.set $2 @@ -16709,43 +12734,36 @@ i32.const 0 i32.lt_s if - i32.const 3904 + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $3 return end - i32.const 3904 - local.set $3 local.get $0 - i32.load - local.set $5 - local.get $1 - i32.load - local.set $6 - local.get $6 - i32.const 0 - i32.ne - local.set $7 + i32.load offset=4 + local.set $4 local.get $2 i32.eqz if - block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i32) - local.get $5 - local.set $8 - i32.const 0 - local.set $9 - i32.const 0 - local.set $10 - local.get $8 - local.get $9 - i32.const 0 - i32.shl - i32.add - local.get $10 - i32.add - i32.load8_u offset=8 - end - call $~lib/internal/number/itoa + local.get $4 + i32.load + call $~lib/util/number/itoa + local.tee $3 + call $~lib/rt/pure/__retain + local.set $5 + local.get $3 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $5 return end + local.get $1 + call $~lib/string/String#get:length + local.set $6 i32.const 10 local.get $6 i32.add @@ -16753,5065 +12771,11922 @@ i32.mul i32.const 10 i32.add - local.set $10 - local.get $10 - call $~lib/internal/string/allocateUnsafe - local.set $9 - i32.const 0 + local.set $7 + local.get $7 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.set $8 + i32.const 0 + local.set $9 block $break|0 i32.const 0 - local.set $11 + local.set $3 loop $repeat|0 - local.get $11 + local.get $3 local.get $2 i32.lt_s i32.eqz br_if $break|0 - block - block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i32) - local.get $5 - local.set $12 - local.get $11 - local.set $13 - i32.const 0 - local.set $14 - local.get $12 - local.get $13 - i32.const 0 - i32.shl - i32.add - local.get $14 - i32.add - i32.load8_u offset=8 - end - local.set $4 + local.get $4 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $10 + local.get $9 + local.get $8 + local.get $9 + local.get $10 + call $~lib/util/number/itoa_stream + i32.add + local.set $9 + local.get $6 + if local.get $8 local.get $9 - local.get $8 - local.get $4 - call $~lib/internal/number/itoa_stream + i32.const 1 + i32.shl i32.add - local.set $8 - local.get $7 - if - local.get $9 - local.get $8 - local.get $1 - i32.const 0 - local.get $6 - call $~lib/internal/string/copyUnsafe - local.get $8 - local.get $6 - i32.add - local.set $8 - end + local.get $1 + local.get $6 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $6 + i32.add + local.set $9 end - local.get $11 + local.get $3 i32.const 1 i32.add - local.set $11 + local.set $3 br $repeat|0 unreachable end unreachable end - block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i32) - local.get $5 - local.set $11 - local.get $2 - local.set $14 - i32.const 0 - local.set $13 - local.get $11 - local.get $14 - i32.const 0 - i32.shl - i32.add - local.get $13 - i32.add - i32.load8_u offset=8 - end - local.set $4 - local.get $8 - local.get $9 - local.get $8 local.get $4 - call $~lib/internal/number/itoa_stream + local.get $2 + i32.const 2 + i32.shl i32.add - local.set $8 + i32.load + local.set $10 local.get $9 - local.set $13 - local.get $10 local.get $8 - i32.gt_s - if - local.get $9 - i32.const 0 - local.get $8 - call $~lib/string/String#substring - local.set $13 - block $~lib/internal/string/freeUnsafe|inlined.10 - local.get $9 - local.set $14 - local.get $14 - i32.eqz - if - i32.const 0 - i32.const 4088 - i32.const 28 - i32.const 4 - call $~lib/env/abort - unreachable - end - block $~lib/memory/memory.free|inlined.15 - local.get $14 - local.set $11 - local.get $11 - call $~lib/allocator/arena/__memory_free - br $~lib/memory/memory.free|inlined.15 - end - end + local.get $9 + local.get $10 + call $~lib/util/number/itoa_stream + i32.add + local.set $9 + local.get $7 + local.get $9 + i32.gt_s + if + local.get $8 + i32.const 0 + local.get $9 + call $~lib/string/String#substring + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $8 + call $~lib/rt/pure/__release + local.get $3 + return end - local.get $13 - return + local.get $8 + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/array/Array<~lib/array/Array>#join (; 223 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join (; 239 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.load offset=4 - i32.const 1 - i32.sub + local.get $1 + call $~lib/array/Array#join_int local.set $2 + local.get $1 + call $~lib/rt/pure/__release local.get $2 - i32.const 0 - i32.lt_s - if - i32.const 3904 - return - end - i32.const 3904 - local.set $3 + return + ) + (func $~lib/builtins/isFinite (; 240 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) local.get $0 - i32.load - local.set $5 + local.get $0 + f64.sub + f64.const 0 + f64.eq + ) + (func $~lib/array/Array#__unchecked_get (; 241 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) + local.get $0 + i32.load offset=4 local.get $1 - i32.load - local.set $6 - local.get $6 + i32.const 3 + i32.shl + i32.add + i64.load + ) + (func $~lib/array/Array#__unchecked_get (; 242 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 1 + i32.shl + i32.add + i32.load16_s + ) + (func $~lib/util/number/genDigits (; 243 ;) (type $FUNCSIG$iijijiji) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (param $6 i32) (result i32) + (local $7 i32) + (local $8 i64) + (local $9 i64) + (local $10 i64) + (local $11 i32) + (local $12 i32) + (local $13 i64) + (local $14 i32) + (local $15 i32) + (local $16 i32) + (local $17 i32) + (local $18 i32) + (local $19 i64) + (local $20 i64) + (local $21 i64) + (local $22 i64) + (local $23 i64) + (local $24 i32) + (local $25 i32) + (local $26 i32) i32.const 0 - i32.ne + local.get $4 + i32.sub local.set $7 - local.get $2 - i32.eqz - if - block $~lib/internal/arraybuffer/LOAD<~lib/array/Array,~lib/array/Array>|inlined.0 (result i32) - local.get $5 - local.set $8 - i32.const 0 - local.set $9 - i32.const 0 - local.set $10 - local.get $8 - local.get $9 - i32.const 2 - i32.shl - i32.add - local.get $10 - i32.add - i32.load offset=8 - end - local.set $4 - local.get $4 - if (result i32) - local.get $4 - local.get $1 - call $~lib/array/Array#join - else - i32.const 3904 - end - return - end + i64.const 1 + local.get $7 + i64.extend_i32_s + i64.shl + local.set $8 + local.get $8 + i64.const 1 + i64.sub + local.set $9 + local.get $3 + local.get $1 + i64.sub + local.set $10 + local.get $4 + local.set $11 + local.get $3 + local.get $7 + i64.extend_i32_s + i64.shr_u + i32.wrap_i64 + local.set $12 + local.get $3 + local.get $9 + i64.and + local.set $13 + local.get $12 + call $~lib/util/number/decimalCount32 + local.set $14 + local.get $6 + local.set $15 + i32.const 6512 + i32.load offset=4 + local.set $16 block $break|0 - i32.const 0 - local.set $10 - loop $repeat|0 - local.get $10 - local.get $2 - i32.lt_s - i32.eqz - br_if $break|0 - block - block $~lib/internal/arraybuffer/LOAD<~lib/array/Array,~lib/array/Array>|inlined.1 (result i32) - local.get $5 - local.set $9 - local.get $10 - local.set $8 - i32.const 0 - local.set $11 - local.get $9 - local.get $8 - i32.const 2 + loop $continue|0 + local.get $14 + i32.const 0 + i32.gt_s + if + block $break|1 + block $case10|1 + block $case9|1 + block $case8|1 + block $case7|1 + block $case6|1 + block $case5|1 + block $case4|1 + block $case3|1 + block $case2|1 + block $case1|1 + block $case0|1 + local.get $14 + local.set $18 + local.get $18 + i32.const 10 + i32.eq + br_if $case0|1 + local.get $18 + i32.const 9 + i32.eq + br_if $case1|1 + local.get $18 + i32.const 8 + i32.eq + br_if $case2|1 + local.get $18 + i32.const 7 + i32.eq + br_if $case3|1 + local.get $18 + i32.const 6 + i32.eq + br_if $case4|1 + local.get $18 + i32.const 5 + i32.eq + br_if $case5|1 + local.get $18 + i32.const 4 + i32.eq + br_if $case6|1 + local.get $18 + i32.const 3 + i32.eq + br_if $case7|1 + local.get $18 + i32.const 2 + i32.eq + br_if $case8|1 + local.get $18 + i32.const 1 + i32.eq + br_if $case9|1 + br $case10|1 + end + block + local.get $12 + i32.const 1000000000 + i32.div_u + local.set $17 + local.get $12 + i32.const 1000000000 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable + end + block + local.get $12 + i32.const 100000000 + i32.div_u + local.set $17 + local.get $12 + i32.const 100000000 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable + end + block + local.get $12 + i32.const 10000000 + i32.div_u + local.set $17 + local.get $12 + i32.const 10000000 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable + end + block + local.get $12 + i32.const 1000000 + i32.div_u + local.set $17 + local.get $12 + i32.const 1000000 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable + end + block + local.get $12 + i32.const 100000 + i32.div_u + local.set $17 + local.get $12 + i32.const 100000 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable + end + block + local.get $12 + i32.const 10000 + i32.div_u + local.set $17 + local.get $12 + i32.const 10000 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable + end + block + local.get $12 + i32.const 1000 + i32.div_u + local.set $17 + local.get $12 + i32.const 1000 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable + end + block + local.get $12 + i32.const 100 + i32.div_u + local.set $17 + local.get $12 + i32.const 100 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable + end + block + local.get $12 + i32.const 10 + i32.div_u + local.set $17 + local.get $12 + i32.const 10 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable + end + block + local.get $12 + local.set $17 + i32.const 0 + local.set $12 + br $break|1 + unreachable + end + unreachable + end + block + i32.const 0 + local.set $17 + br $break|1 + unreachable + end + unreachable + end + local.get $17 + local.get $15 + i32.or + if + local.get $0 + block (result i32) + local.get $15 + local.tee $18 + i32.const 1 + i32.add + local.set $15 + local.get $18 + end + i32.const 1 i32.shl i32.add - local.get $11 + i32.const 48 + local.get $17 + i32.const 65535 + i32.and i32.add - i32.load offset=8 + i32.store16 end - local.set $4 - local.get $4 + local.get $14 + i32.const 1 + i32.sub + local.set $14 + local.get $12 + i64.extend_i32_u + local.get $7 + i64.extend_i32_s + i64.shl + local.get $13 + i64.add + local.set $19 + local.get $19 + local.get $5 + i64.le_u if - local.get $3 - local.get $4 - local.get $1 - call $~lib/array/Array#join - call $~lib/string/String.__concat - local.set $3 + global.get $~lib/util/number/_K + local.get $14 + i32.add + global.set $~lib/util/number/_K + block $~lib/util/number/grisuRound|inlined.0 + local.get $0 + local.set $24 + local.get $15 + local.set $18 + local.get $5 + local.set $23 + local.get $19 + local.set $22 + local.get $16 + local.get $14 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.get $7 + i64.extend_i32_s + i64.shl + local.set $21 + local.get $10 + local.set $20 + local.get $24 + local.get $18 + i32.const 1 + i32.sub + i32.const 1 + i32.shl + i32.add + local.set $25 + local.get $25 + i32.load16_u + local.set $26 + block $break|2 + loop $continue|2 + local.get $22 + local.get $20 + i64.lt_u + if (result i32) + local.get $23 + local.get $22 + i64.sub + local.get $21 + i64.ge_u + else + i32.const 0 + end + if (result i32) + local.get $22 + local.get $21 + i64.add + local.get $20 + i64.lt_u + if (result i32) + i32.const 1 + else + local.get $20 + local.get $22 + i64.sub + local.get $22 + local.get $21 + i64.add + local.get $20 + i64.sub + i64.gt_u + end + else + i32.const 0 + end + if + local.get $26 + i32.const 1 + i32.sub + local.set $26 + local.get $22 + local.get $21 + i64.add + local.set $22 + br $continue|2 + end + end + end + local.get $25 + local.get $26 + i32.store16 + end + local.get $15 + return end + br $continue|0 + end + end + end + block $break|3 + loop $continue|3 + i32.const 1 + if + local.get $13 + i64.const 10 + i64.mul + local.set $13 + local.get $5 + i64.const 10 + i64.mul + local.set $5 + local.get $13 local.get $7 + i64.extend_i32_s + i64.shr_u + local.set $19 + local.get $19 + local.get $15 + i64.extend_i32_s + i64.or + i64.const 0 + i64.ne if - local.get $3 - local.get $1 - call $~lib/string/String.__concat - local.set $3 + local.get $0 + block (result i32) + local.get $15 + local.tee $17 + i32.const 1 + i32.add + local.set $15 + local.get $17 + end + i32.const 1 + i32.shl + i32.add + i32.const 48 + local.get $19 + i32.wrap_i64 + i32.const 65535 + i32.and + i32.add + i32.store16 + end + local.get $13 + local.get $9 + i64.and + local.set $13 + local.get $14 + i32.const 1 + i32.sub + local.set $14 + local.get $13 + local.get $5 + i64.lt_u + if + global.get $~lib/util/number/_K + local.get $14 + i32.add + global.set $~lib/util/number/_K + local.get $10 + local.get $16 + i32.const 0 + local.get $14 + i32.sub + i32.const 2 + i32.shl + i32.add + i64.load32_u + i64.mul + local.set $10 + block $~lib/util/number/grisuRound|inlined.1 + local.get $0 + local.set $24 + local.get $15 + local.set $18 + local.get $5 + local.set $23 + local.get $13 + local.set $22 + local.get $8 + local.set $21 + local.get $10 + local.set $20 + local.get $24 + local.get $18 + i32.const 1 + i32.sub + i32.const 1 + i32.shl + i32.add + local.set $17 + local.get $17 + i32.load16_u + local.set $26 + block $break|4 + loop $continue|4 + local.get $22 + local.get $20 + i64.lt_u + if (result i32) + local.get $23 + local.get $22 + i64.sub + local.get $21 + i64.ge_u + else + i32.const 0 + end + if (result i32) + local.get $22 + local.get $21 + i64.add + local.get $20 + i64.lt_u + if (result i32) + i32.const 1 + else + local.get $20 + local.get $22 + i64.sub + local.get $22 + local.get $21 + i64.add + local.get $20 + i64.sub + i64.gt_u + end + else + i32.const 0 + end + if + local.get $26 + i32.const 1 + i32.sub + local.set $26 + local.get $22 + local.get $21 + i64.add + local.set $22 + br $continue|4 + end + end + end + local.get $17 + local.get $26 + i32.store16 + end + local.get $15 + return end + br $continue|3 end - local.get $10 - i32.const 1 - i32.add - local.set $10 - br $repeat|0 - unreachable end - unreachable - end - block $~lib/internal/arraybuffer/LOAD<~lib/array/Array,~lib/array/Array>|inlined.2 (result i32) - local.get $5 - local.set $10 - local.get $2 - local.set $11 - i32.const 0 - local.set $8 - local.get $10 - local.get $11 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.add - i32.load offset=8 - end - local.set $4 - local.get $4 - if - local.get $3 - local.get $4 - local.get $1 - call $~lib/array/Array#join - call $~lib/string/String.__concat - local.set $3 end - local.get $3 - return + local.get $15 ) - (func $~lib/array/Array<~lib/array/Array>#join (; 224 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) + (func $~lib/util/number/prettify (; 244 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - local.get $0 - i32.load offset=4 - i32.const 1 - i32.sub - local.set $2 + (local $9 i32) + (local $10 i32) + (local $11 i32) local.get $2 - i32.const 0 - i32.lt_s + i32.eqz if - i32.const 3904 + local.get $0 + local.get $1 + i32.const 1 + i32.shl + i32.add + i32.const 46 + i32.const 48 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 2 + i32.add return end - i32.const 3904 - local.set $3 - local.get $0 - i32.load - local.set $5 local.get $1 - i32.load - local.set $6 - local.get $6 - i32.const 0 - i32.ne - local.set $7 local.get $2 - i32.eqz + i32.add + local.set $3 + local.get $1 + local.get $3 + i32.le_s + if (result i32) + local.get $3 + i32.const 21 + i32.le_s + else + i32.const 0 + end if - block $~lib/internal/arraybuffer/LOAD<~lib/array/Array,~lib/array/Array>|inlined.0 (result i32) - local.get $5 - local.set $8 - i32.const 0 - local.set $9 + block $break|0 + local.get $1 + local.set $4 + loop $repeat|0 + local.get $4 + local.get $3 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $0 + local.get $4 + i32.const 1 + i32.shl + i32.add + i32.const 48 + i32.store16 + local.get $4 + i32.const 1 + i32.add + local.set $4 + br $repeat|0 + unreachable + end + unreachable + end + local.get $0 + local.get $3 + i32.const 1 + i32.shl + i32.add + i32.const 46 + i32.const 48 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $3 + i32.const 2 + i32.add + return + else + local.get $3 + i32.const 0 + i32.gt_s + if (result i32) + local.get $3 + i32.const 21 + i32.le_s + else i32.const 0 - local.set $10 - local.get $8 - local.get $9 - i32.const 2 + end + if + local.get $0 + local.get $3 + i32.const 1 i32.shl i32.add - local.get $10 + local.set $4 + local.get $4 + i32.const 2 i32.add - i32.load offset=8 - end - local.set $4 - local.get $4 - if (result i32) local.get $4 + i32.const 0 + local.get $2 + i32.sub + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $0 + local.get $3 + i32.const 1 + i32.shl + i32.add + i32.const 46 + i32.store16 local.get $1 - call $~lib/array/Array#join + i32.const 1 + i32.add + return else - i32.const 3904 - end - return - end - block $break|0 - i32.const 0 - local.set $10 - loop $repeat|0 - local.get $10 - local.get $2 + i32.const -6 + local.get $3 i32.lt_s - i32.eqz - br_if $break|0 - block - block $~lib/internal/arraybuffer/LOAD<~lib/array/Array,~lib/array/Array>|inlined.1 (result i32) - local.get $5 - local.set $9 - local.get $10 - local.set $8 - i32.const 0 - local.set $11 - local.get $9 - local.get $8 + if (result i32) + local.get $3 + i32.const 0 + i32.le_s + else + i32.const 0 + end + if + i32.const 2 + local.get $3 + i32.sub + local.set $4 + local.get $0 + local.get $4 + i32.const 1 + i32.shl + i32.add + local.get $0 + local.get $1 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $0 + i32.const 48 + i32.const 46 + i32.const 16 + i32.shl + i32.or + i32.store + block $break|1 + i32.const 2 + local.set $5 + loop $repeat|1 + local.get $5 + local.get $4 + i32.lt_s + i32.eqz + br_if $break|1 + local.get $0 + local.get $5 + i32.const 1 + i32.shl + i32.add + i32.const 48 + i32.store16 + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|1 + unreachable + end + unreachable + end + local.get $1 + local.get $4 + i32.add + return + else + local.get $1 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 101 + i32.store16 offset=2 + block $~lib/util/number/genExponent|inlined.0 (result i32) + local.get $0 + i32.const 4 + i32.add + local.set $4 + local.get $3 + i32.const 1 + i32.sub + local.set $5 + local.get $5 + i32.const 0 + i32.lt_s + local.set $6 + local.get $6 + if + i32.const 0 + local.get $5 + i32.sub + local.set $5 + end + local.get $5 + call $~lib/util/number/decimalCount32 + i32.const 1 + i32.add + local.set $7 + block $~lib/util/number/utoa32_core|inlined.4 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $10 + local.get $9 + local.get $8 + call $~lib/util/number/utoa32_lut + end + local.get $4 + i32.const 45 + i32.const 43 + local.get $6 + select + i32.store16 + local.get $7 + end + local.set $1 + local.get $1 i32.const 2 + i32.add + return + else + local.get $1 + i32.const 1 i32.shl + local.set $7 + local.get $0 + i32.const 4 i32.add - local.get $11 + local.get $0 + i32.const 2 i32.add - i32.load offset=8 - end - local.set $4 - local.get $4 - if - local.get $3 - local.get $4 + local.get $7 + i32.const 2 + i32.sub + call $~lib/memory/memory.copy + local.get $0 + i32.const 46 + i32.store16 offset=2 + local.get $0 + local.get $7 + i32.add + i32.const 101 + i32.store16 offset=2 local.get $1 - call $~lib/array/Array#join - call $~lib/string/String.__concat - local.set $3 - end - local.get $7 - if - local.get $3 + block $~lib/util/number/genExponent|inlined.1 (result i32) + local.get $0 + local.get $7 + i32.add + i32.const 4 + i32.add + local.set $9 + local.get $3 + i32.const 1 + i32.sub + local.set $8 + local.get $8 + i32.const 0 + i32.lt_s + local.set $6 + local.get $6 + if + i32.const 0 + local.get $8 + i32.sub + local.set $8 + end + local.get $8 + call $~lib/util/number/decimalCount32 + i32.const 1 + i32.add + local.set $4 + block $~lib/util/number/utoa32_core|inlined.5 + local.get $9 + local.set $11 + local.get $8 + local.set $5 + local.get $4 + local.set $10 + local.get $11 + local.get $5 + local.get $10 + call $~lib/util/number/utoa32_lut + end + local.get $9 + i32.const 45 + i32.const 43 + local.get $6 + select + i32.store16 + local.get $4 + end + i32.add + local.set $1 local.get $1 - call $~lib/string/String.__concat - local.set $3 + i32.const 2 + i32.add + return end + unreachable end - local.get $10 - i32.const 1 - i32.add - local.set $10 - br $repeat|0 unreachable end unreachable end - block $~lib/internal/arraybuffer/LOAD<~lib/array/Array,~lib/array/Array>|inlined.2 (result i32) - local.get $5 - local.set $10 - local.get $2 - local.set $11 - i32.const 0 - local.set $8 - local.get $10 - local.get $11 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.add - i32.load offset=8 - end - local.set $4 - local.get $4 - if - local.get $3 - local.get $4 - local.get $1 - call $~lib/array/Array#join - call $~lib/string/String.__concat - local.set $3 - end - local.get $3 - return + unreachable + unreachable ) - (func $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#join (; 225 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/number/dtoa_core (; 245 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - (local $6 i32) + (local $5 f64) + (local $6 i64) (local $7 i32) - (local $8 i32) - (local $9 i32) + (local $8 i64) + (local $9 i64) (local $10 i32) - (local $11 i32) - local.get $0 - i32.load offset=4 - i32.const 1 - i32.sub + (local $11 i64) + (local $12 i64) + (local $13 i32) + (local $14 i32) + (local $15 i32) + (local $16 f64) + (local $17 i64) + (local $18 i64) + (local $19 i64) + (local $20 i64) + (local $21 i64) + (local $22 i64) + (local $23 i64) + (local $24 i64) + (local $25 i64) + (local $26 i32) + (local $27 i64) + (local $28 i32) + local.get $1 + f64.const 0 + f64.lt local.set $2 local.get $2 - i32.const 0 - i32.lt_s if - i32.const 3904 - return + local.get $1 + f64.neg + local.set $1 + local.get $0 + i32.const 45 + i32.store16 end - i32.const 3904 - local.set $3 - local.get $0 - i32.load - local.set $5 - local.get $1 - i32.load - local.set $6 - local.get $6 - i32.const 0 - i32.ne - local.set $7 - local.get $2 - i32.eqz - if - block $~lib/internal/arraybuffer/LOAD<~lib/array/Array<~lib/array/Array>,~lib/array/Array<~lib/array/Array>>|inlined.0 (result i32) - local.get $5 - local.set $8 - i32.const 0 - local.set $9 - i32.const 0 + block $~lib/util/number/grisu2|inlined.0 (result i32) + local.get $1 + local.set $5 + local.get $0 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + i64.reinterpret_f64 + local.set $6 + local.get $6 + i64.const 9218868437227405312 + i64.and + i64.const 52 + i64.shr_u + i32.wrap_i64 + local.set $7 + local.get $6 + i64.const 4503599627370495 + i64.and + local.set $8 + local.get $7 + i32.const 0 + i32.ne + i64.extend_i32_u + i64.const 52 + i64.shl + local.get $8 + i64.add + local.set $9 + local.get $7 + i32.const 1 + local.get $7 + i32.const 0 + i32.ne + select + i32.const 1023 + i32.const 52 + i32.add + i32.sub + local.set $7 + block $~lib/util/number/normalizedBoundaries|inlined.0 + local.get $9 + local.set $11 + local.get $7 + local.set $10 + local.get $11 + i64.const 1 + i64.shl + i64.const 1 + i64.add + local.set $12 + local.get $10 + i32.const 1 + i32.sub + local.set $13 + local.get $12 + i64.clz + i32.wrap_i64 + local.set $14 + local.get $12 + local.get $14 + i64.extend_i32_s + i64.shl + local.set $12 + local.get $13 + local.get $14 + i32.sub + local.set $13 + i32.const 1 + local.get $11 + i64.const 4503599627370496 + i64.eq + i32.add + local.set $15 + local.get $12 + global.set $~lib/util/number/_frc_plus + local.get $11 + local.get $15 + i64.extend_i32_s + i64.shl + i64.const 1 + i64.sub + local.get $10 + local.get $15 + i32.sub + local.get $13 + i32.sub + i64.extend_i32_s + i64.shl + global.set $~lib/util/number/_frc_minus + local.get $13 + global.set $~lib/util/number/_exp + end + block $~lib/util/number/getCachedPower|inlined.0 + global.get $~lib/util/number/_exp local.set $10 - local.get $8 - local.get $9 - i32.const 2 - i32.shl - i32.add + i32.const -61 local.get $10 + i32.sub + f64.convert_i32_s + f64.const 0.30102999566398114 + f64.mul + f64.const 347 + f64.add + local.set $16 + local.get $16 + i32.trunc_f64_s + local.set $15 + local.get $15 + local.get $15 + f64.convert_i32_s + local.get $16 + f64.ne + i32.add + local.set $15 + local.get $15 + i32.const 3 + i32.shr_s + i32.const 1 i32.add - i32.load offset=8 + local.set $14 + i32.const 348 + local.get $14 + i32.const 3 + i32.shl + i32.sub + global.set $~lib/util/number/_K + i32.const 6200 + local.get $14 + call $~lib/array/Array#__unchecked_get + global.set $~lib/util/number/_frc_pow + i32.const 6424 + local.get $14 + call $~lib/array/Array#__unchecked_get + global.set $~lib/util/number/_exp_pow end - local.set $4 - local.get $4 - if (result i32) - local.get $4 - local.get $1 - call $~lib/array/Array<~lib/array/Array>#join - else - i32.const 3904 + local.get $9 + i64.clz + i32.wrap_i64 + local.set $14 + local.get $9 + local.get $14 + i64.extend_i32_s + i64.shl + local.set $9 + local.get $7 + local.get $14 + i32.sub + local.set $7 + global.get $~lib/util/number/_frc_pow + local.set $12 + global.get $~lib/util/number/_exp_pow + local.set $15 + block $~lib/util/number/umul64f|inlined.0 (result i64) + local.get $9 + local.set $17 + local.get $12 + local.set $11 + local.get $17 + i64.const 4294967295 + i64.and + local.set $18 + local.get $11 + i64.const 4294967295 + i64.and + local.set $19 + local.get $17 + i64.const 32 + i64.shr_u + local.set $20 + local.get $11 + i64.const 32 + i64.shr_u + local.set $21 + local.get $18 + local.get $19 + i64.mul + local.set $22 + local.get $20 + local.get $19 + i64.mul + local.get $22 + i64.const 32 + i64.shr_u + i64.add + local.set $23 + local.get $18 + local.get $21 + i64.mul + local.get $23 + i64.const 4294967295 + i64.and + i64.add + local.set $24 + local.get $24 + i64.const 2147483647 + i64.add + local.set $24 + local.get $23 + i64.const 32 + i64.shr_u + local.set $23 + local.get $24 + i64.const 32 + i64.shr_u + local.set $24 + local.get $20 + local.get $21 + i64.mul + local.get $23 + i64.add + local.get $24 + i64.add end - return - end - block $break|0 - i32.const 0 - local.set $10 - loop $repeat|0 - local.get $10 - local.get $2 - i32.lt_s - i32.eqz - br_if $break|0 - block - block $~lib/internal/arraybuffer/LOAD<~lib/array/Array<~lib/array/Array>,~lib/array/Array<~lib/array/Array>>|inlined.1 (result i32) - local.get $5 - local.set $9 - local.get $10 - local.set $8 - i32.const 0 - local.set $11 - local.get $9 - local.get $8 - i32.const 2 - i32.shl - i32.add - local.get $11 - i32.add - i32.load offset=8 - end - local.set $4 - local.get $4 - if - local.get $3 - local.get $4 - local.get $1 - call $~lib/array/Array<~lib/array/Array>#join - call $~lib/string/String.__concat - local.set $3 - end - local.get $7 - if - local.get $3 - local.get $1 - call $~lib/string/String.__concat - local.set $3 - end - end + local.set $24 + block $~lib/util/number/umul64e|inlined.0 (result i32) + local.get $7 + local.set $10 + local.get $15 + local.set $13 local.get $10 - i32.const 1 + local.get $13 i32.add - local.set $10 - br $repeat|0 - unreachable + i32.const 64 + i32.add + end + local.set $10 + block $~lib/util/number/umul64f|inlined.1 (result i64) + global.get $~lib/util/number/_frc_plus + local.set $17 + local.get $12 + local.set $11 + local.get $17 + i64.const 4294967295 + i64.and + local.set $23 + local.get $11 + i64.const 4294967295 + i64.and + local.set $22 + local.get $17 + i64.const 32 + i64.shr_u + local.set $21 + local.get $11 + i64.const 32 + i64.shr_u + local.set $20 + local.get $23 + local.get $22 + i64.mul + local.set $19 + local.get $21 + local.get $22 + i64.mul + local.get $19 + i64.const 32 + i64.shr_u + i64.add + local.set $18 + local.get $23 + local.get $20 + i64.mul + local.get $18 + i64.const 4294967295 + i64.and + i64.add + local.set $25 + local.get $25 + i64.const 2147483647 + i64.add + local.set $25 + local.get $18 + i64.const 32 + i64.shr_u + local.set $18 + local.get $25 + i64.const 32 + i64.shr_u + local.set $25 + local.get $21 + local.get $20 + i64.mul + local.get $18 + i64.add + local.get $25 + i64.add + end + i64.const 1 + i64.sub + local.set $25 + block $~lib/util/number/umul64e|inlined.1 (result i32) + global.get $~lib/util/number/_exp + local.set $26 + local.get $15 + local.set $13 + local.get $26 + local.get $13 + i32.add + i32.const 64 + i32.add + end + local.set $26 + block $~lib/util/number/umul64f|inlined.2 (result i64) + global.get $~lib/util/number/_frc_minus + local.set $17 + local.get $12 + local.set $11 + local.get $17 + i64.const 4294967295 + i64.and + local.set $18 + local.get $11 + i64.const 4294967295 + i64.and + local.set $19 + local.get $17 + i64.const 32 + i64.shr_u + local.set $20 + local.get $11 + i64.const 32 + i64.shr_u + local.set $21 + local.get $18 + local.get $19 + i64.mul + local.set $22 + local.get $20 + local.get $19 + i64.mul + local.get $22 + i64.const 32 + i64.shr_u + i64.add + local.set $23 + local.get $18 + local.get $21 + i64.mul + local.get $23 + i64.const 4294967295 + i64.and + i64.add + local.set $27 + local.get $27 + i64.const 2147483647 + i64.add + local.set $27 + local.get $23 + i64.const 32 + i64.shr_u + local.set $23 + local.get $27 + i64.const 32 + i64.shr_u + local.set $27 + local.get $20 + local.get $21 + i64.mul + local.get $23 + i64.add + local.get $27 + i64.add end - unreachable - end - block $~lib/internal/arraybuffer/LOAD<~lib/array/Array<~lib/array/Array>,~lib/array/Array<~lib/array/Array>>|inlined.2 (result i32) - local.get $5 - local.set $10 - local.get $2 - local.set $11 - i32.const 0 - local.set $8 + i64.const 1 + i64.add + local.set $27 + local.get $25 + local.get $27 + i64.sub + local.set $23 + local.get $4 + local.get $24 local.get $10 - local.get $11 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.add - i32.load offset=8 - end - local.set $4 - local.get $4 - if + local.get $25 + local.get $26 + local.get $23 local.get $3 - local.get $4 - local.get $1 - call $~lib/array/Array<~lib/array/Array>#join - call $~lib/string/String.__concat - local.set $3 - end - local.get $3 - return - ) - (func $start:std/array (; 226 ;) (type $FUNCSIG$v) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - call $start:~lib/allocator/arena - i32.const 0 - i32.const 0 - call $~lib/array/Array#constructor - global.set $std/array/arr - global.get $std/array/Null - call $~lib/array/Array.isArray<~lib/array/Array | null> - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 37 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array.isArray<~lib/array/Array> - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 38 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 0 - call $std/array/P#constructor - call $~lib/array/Array.isArray - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 39 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 0 - i32.const 1 - call $~lib/typedarray/Uint8Array#constructor - call $~lib/array/Array.isArray<~lib/typedarray/Uint8Array> - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 40 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/num - call $~lib/array/Array.isArray - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 41 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/str - call $~lib/array/Array.isArray<~lib/string/String> - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 42 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr8 - i32.const 1 - i32.const 1 - i32.const 3 - call $~lib/array/Array#fill - drop - global.get $std/array/arr8 - i32.const 256 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 49 - i32.const 0 - call $~lib/env/abort - unreachable - end - block (result i32) - i32.const 1 - global.set $~lib/argc - global.get $std/array/arr8 - i32.const 0 - i32.const 0 - i32.const 0 - call $~lib/array/Array#fill|trampoline - end - drop - global.get $std/array/arr8 - i32.const 280 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 52 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr8 - i32.const 1 - i32.const 0 - i32.const -3 - call $~lib/array/Array#fill - drop - global.get $std/array/arr8 - i32.const 304 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 55 - i32.const 0 - call $~lib/env/abort - unreachable - end - block (result i32) - i32.const 2 - global.set $~lib/argc - global.get $std/array/arr8 - i32.const 2 - i32.const -2 - i32.const 0 - call $~lib/array/Array#fill|trampoline - end - drop - global.get $std/array/arr8 - i32.const 328 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 58 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr8 - i32.const 0 - i32.const 1 - i32.const 0 - call $~lib/array/Array#fill - drop - global.get $std/array/arr8 - i32.const 352 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 61 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr32 - i32.const 1 - i32.const 1 - i32.const 3 - call $~lib/array/Array#fill - drop - global.get $std/array/arr32 - i32.const 432 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 66 - i32.const 0 - call $~lib/env/abort - unreachable - end - block (result i32) - i32.const 1 - global.set $~lib/argc - global.get $std/array/arr32 - i32.const 0 - i32.const 0 - i32.const 0 - call $~lib/array/Array#fill|trampoline - end - drop - global.get $std/array/arr32 - i32.const 472 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 69 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr32 - i32.const 1 - i32.const 0 - i32.const -3 - call $~lib/array/Array#fill - drop - global.get $std/array/arr32 - i32.const 512 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 72 - i32.const 0 - call $~lib/env/abort - unreachable - end - block (result i32) - i32.const 2 - global.set $~lib/argc - global.get $std/array/arr32 - i32.const 2 - i32.const -2 - i32.const 0 - call $~lib/array/Array#fill|trampoline - end - drop - global.get $std/array/arr32 - i32.const 552 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 75 - i32.const 0 - call $~lib/env/abort - unreachable + call $~lib/util/number/genDigits end - global.get $std/array/arr32 - i32.const 0 + local.set $28 + local.get $0 + local.get $2 i32.const 1 - i32.const 0 - call $~lib/array/Array#fill - drop - global.get $std/array/arr32 - i32.const 592 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 78 - i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#get:length|inlined.0 (result i32) - global.get $std/array/arr - local.set $0 - local.get $0 - i32.load offset=4 - end - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 82 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - call $std/array/internalCapacity - i32.const 0 - i32.eq - i32.eqz + i32.shl + i32.add + local.get $28 + local.get $2 + i32.sub + global.get $~lib/util/number/_K + call $~lib/util/number/prettify + local.set $28 + local.get $28 + local.get $2 + i32.add + ) + (func $~lib/util/number/dtoa (; 246 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + f64.const 0 + f64.eq if - i32.const 0 - i32.const 120 - i32.const 83 - i32.const 0 - call $~lib/env/abort - unreachable + i32.const 5368 + call $~lib/rt/pure/__retain + return end - global.get $std/array/arr - i32.const 42 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#__get - i32.const 42 - i32.eq + local.get $0 + call $~lib/builtins/isFinite i32.eqz if - i32.const 0 - i32.const 120 - i32.const 87 - i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#get:length|inlined.1 (result i32) - global.get $std/array/arr - local.set $0 local.get $0 - i32.load offset=4 + call $~lib/builtins/isNaN + if + i32.const 5392 + call $~lib/rt/pure/__retain + return + end + i32.const 5416 + i32.const 5456 + local.get $0 + f64.const 0 + f64.lt + select + call $~lib/rt/pure/__retain + return end + i32.const 28 i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 88 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - call $std/array/internalCapacity + i32.shl i32.const 1 + call $~lib/rt/tlsf/__alloc + local.set $1 + local.get $1 + local.get $0 + call $~lib/util/number/dtoa_core + local.set $2 + local.get $2 + i32.const 28 i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 89 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#pop - global.set $std/array/i - global.get $std/array/i - i32.const 42 - i32.eq - i32.eqz if - i32.const 0 - i32.const 120 - i32.const 93 - i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#get:length|inlined.2 (result i32) - global.get $std/array/arr - local.set $0 - local.get $0 - i32.load offset=4 + local.get $1 + call $~lib/rt/pure/__retain + return end + local.get $1 i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 94 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - call $std/array/internalCapacity + local.get $2 + call $~lib/string/String#substring + local.set $3 + local.get $1 + call $~lib/rt/tlsf/__free + local.get $3 + ) + (func $~lib/util/number/dtoa_stream (; 247 ;) (type $FUNCSIG$iiid) (param $0 i32) (param $1 i32) (param $2 f64) (result i32) + (local $3 i32) + (local $4 i32) + local.get $0 + local.get $1 i32.const 1 - i32.eq - i32.eqz + i32.shl + i32.add + local.set $0 + local.get $2 + f64.const 0 + f64.eq if - i32.const 0 - i32.const 120 - i32.const 95 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - i32.const 43 - call $~lib/array/Array#push - drop - block $~lib/array/Array#get:length|inlined.3 (result i32) - global.get $std/array/arr - local.set $0 local.get $0 - i32.load offset=4 - end - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 99 - i32.const 0 - call $~lib/env/abort - unreachable + i32.const 48 + i32.store16 + local.get $0 + i32.const 46 + i32.store16 offset=2 + local.get $0 + i32.const 48 + i32.store16 offset=4 + i32.const 3 + return end - global.get $std/array/arr - call $std/array/internalCapacity - i32.const 1 - i32.eq + local.get $2 + call $~lib/builtins/isFinite i32.eqz if - i32.const 0 - i32.const 120 - i32.const 100 - i32.const 0 - call $~lib/env/abort + local.get $2 + call $~lib/builtins/isNaN + if + local.get $0 + i32.const 78 + i32.store16 + local.get $0 + i32.const 97 + i32.store16 offset=2 + local.get $0 + i32.const 78 + i32.store16 offset=4 + i32.const 3 + return + else + local.get $2 + f64.const 0 + f64.lt + local.set $3 + i32.const 8 + local.get $3 + i32.add + local.set $4 + local.get $0 + i32.const 5416 + i32.const 5456 + local.get $3 + select + local.get $4 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $4 + return + end unreachable - end - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#__get - i32.const 43 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 101 - i32.const 0 - call $~lib/env/abort unreachable end - global.get $std/array/arr - i32.const 44 - call $~lib/array/Array#push + local.get $0 + local.get $2 + call $~lib/util/number/dtoa_core + ) + (func $~lib/array/Array#join_flt (; 248 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 f64) + local.get $1 + call $~lib/rt/pure/__retain drop - block $~lib/array/Array#get:length|inlined.4 (result i32) - global.get $std/array/arr - local.set $0 - local.get $0 - i32.load offset=4 - end - i32.const 2 - i32.eq - i32.eqz + local.get $0 + i32.load offset=12 + i32.const 1 + i32.sub + local.set $2 + local.get $2 + i32.const 0 + i32.lt_s if - i32.const 0 - i32.const 120 - i32.const 105 - i32.const 0 - call $~lib/env/abort - unreachable + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + return end - global.get $std/array/arr - call $std/array/internalCapacity - i32.const 2 - i32.eq + local.get $0 + i32.load offset=4 + local.set $4 + local.get $2 i32.eqz if - i32.const 0 - i32.const 120 - i32.const 106 - i32.const 0 - call $~lib/env/abort - unreachable + local.get $4 + f64.load + call $~lib/util/number/dtoa + local.tee $3 + call $~lib/rt/pure/__retain + local.set $5 + local.get $3 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $5 + return end - global.get $std/array/arr + local.get $1 + call $~lib/string/String#get:length + local.set $6 + i32.const 28 + local.get $6 + i32.add + local.get $2 + i32.mul + i32.const 28 + i32.add + local.set $7 + local.get $7 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $8 i32.const 0 - call $~lib/array/Array#__get - i32.const 43 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 107 + local.set $9 + block $break|0 i32.const 0 - call $~lib/env/abort + local.set $3 + loop $repeat|0 + local.get $3 + local.get $2 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $4 + local.get $3 + i32.const 3 + i32.shl + i32.add + f64.load + local.set $10 + local.get $9 + local.get $8 + local.get $9 + local.get $10 + call $~lib/util/number/dtoa_stream + i32.add + local.set $9 + local.get $6 + if + local.get $8 + local.get $9 + i32.const 1 + i32.shl + i32.add + local.get $1 + local.get $6 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $6 + i32.add + local.set $9 + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end unreachable end - global.get $std/array/arr - i32.const 1 - call $~lib/array/Array#__get - i32.const 44 - i32.eq - i32.eqz + local.get $4 + local.get $2 + i32.const 3 + i32.shl + i32.add + f64.load + local.set $10 + local.get $9 + local.get $8 + local.get $9 + local.get $10 + call $~lib/util/number/dtoa_stream + i32.add + local.set $9 + local.get $7 + local.get $9 + i32.gt_s if + local.get $8 i32.const 0 - i32.const 120 - i32.const 108 - i32.const 0 - call $~lib/env/abort - unreachable + local.get $9 + call $~lib/string/String#substring + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $8 + call $~lib/rt/pure/__release + local.get $3 + return end - global.get $std/array/arr - i32.const 45 - call $~lib/array/Array#push + local.get $8 + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $~lib/array/Array#join (; 249 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/pure/__retain drop - block $~lib/array/Array#get:length|inlined.5 (result i32) - global.get $std/array/arr - local.set $0 - local.get $0 - i32.load offset=4 - end - i32.const 3 - i32.eq - i32.eqz + local.get $0 + local.get $1 + call $~lib/array/Array#join_flt + local.set $2 + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + return + ) + (func $~lib/array/Array<~lib/string/String>#join_str (; 250 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.load offset=12 + i32.const 1 + i32.sub + local.set $2 + local.get $2 + i32.const 0 + i32.lt_s if - i32.const 0 - i32.const 120 - i32.const 112 - i32.const 0 - call $~lib/env/abort - unreachable + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + return end - global.get $std/array/arr - call $std/array/internalCapacity - i32.const 3 - i32.eq + local.get $0 + i32.load offset=4 + local.set $4 + local.get $2 i32.eqz if - i32.const 0 - i32.const 120 - i32.const 113 - i32.const 0 - call $~lib/env/abort - unreachable + local.get $4 + i32.load + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + return end - global.get $std/array/arr + local.get $1 + call $~lib/string/String#get:length + local.set $5 i32.const 0 - call $~lib/array/Array#__get - i32.const 43 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 114 - i32.const 0 - call $~lib/env/abort + local.set $6 + i32.const 0 + local.set $7 + block $break|0 + block + i32.const 0 + local.set $3 + local.get $2 + i32.const 1 + i32.add + local.set $8 + end + loop $repeat|0 + local.get $3 + local.get $8 + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + local.get $4 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load + local.tee $9 + local.get $7 + local.tee $10 + i32.ne + if + local.get $9 + call $~lib/rt/pure/__retain + drop + local.get $10 + call $~lib/rt/pure/__release + end + local.get $9 + end + local.set $7 + local.get $7 + i32.const 0 + i32.ne + if + local.get $6 + local.get $7 + call $~lib/string/String#get:length + i32.add + local.set $6 + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end unreachable end - global.get $std/array/arr + i32.const 0 + local.set $11 + local.get $6 + local.get $5 + local.get $2 + i32.mul + i32.add i32.const 1 - call $~lib/array/Array#__get - i32.const 44 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 115 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $12 + block $break|1 i32.const 0 - call $~lib/env/abort + local.set $8 + loop $repeat|1 + local.get $8 + local.get $2 + i32.lt_s + i32.eqz + br_if $break|1 + block (result i32) + local.get $4 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load + local.tee $10 + local.get $7 + local.tee $3 + i32.ne + if + local.get $10 + call $~lib/rt/pure/__retain + drop + local.get $3 + call $~lib/rt/pure/__release + end + local.get $10 + end + local.set $7 + local.get $7 + i32.const 0 + i32.ne + if + local.get $7 + call $~lib/string/String#get:length + local.set $10 + local.get $12 + local.get $11 + i32.const 1 + i32.shl + i32.add + local.get $7 + local.get $10 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $11 + local.get $10 + i32.add + local.set $11 + end + local.get $5 + if + local.get $12 + local.get $11 + i32.const 1 + i32.shl + i32.add + local.get $1 + local.get $5 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $11 + local.get $5 + i32.add + local.set $11 + end + local.get $8 + i32.const 1 + i32.add + local.set $8 + br $repeat|1 + unreachable + end unreachable end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#__get - i32.const 45 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 116 - i32.const 0 - call $~lib/env/abort - unreachable + block (result i32) + local.get $4 + local.get $2 + i32.const 2 + i32.shl + i32.add + i32.load + local.tee $9 + local.get $7 + local.tee $8 + i32.ne + if + local.get $9 + call $~lib/rt/pure/__retain + drop + local.get $8 + call $~lib/rt/pure/__release + end + local.get $9 end + local.set $7 + local.get $7 i32.const 0 - i32.const 0 - call $~lib/array/Array#constructor - global.set $std/array/other - global.get $std/array/arr - global.get $std/array/other - call $~lib/array/Array#concat - global.set $std/array/out - global.get $std/array/arr - call $std/array/internalCapacity - i32.const 3 - i32.eq - i32.eqz + i32.ne if - i32.const 0 - i32.const 120 - i32.const 123 - i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#get:length|inlined.6 (result i32) - global.get $std/array/arr - local.set $0 - local.get $0 - i32.load offset=4 + local.get $12 + local.get $11 + i32.const 1 + i32.shl + i32.add + local.get $7 + local.get $7 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + call $~lib/memory/memory.copy end - i32.const 3 - i32.eq + local.get $12 + local.set $9 + local.get $1 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release + local.get $9 + ) + (func $~lib/array/Array<~lib/string/String>#join (; 251 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/string/String>#join_str + local.set $2 + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + return + ) + (func $std/array/Ref#constructor (; 252 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 i32.eqz if i32.const 0 - i32.const 120 - i32.const 124 - i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#get:length|inlined.7 (result i32) - global.get $std/array/out + i32.const 18 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.set $0 - local.get $0 - i32.load offset=4 - end - i32.const 3 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 125 - i32.const 0 - call $~lib/env/abort - unreachable end - global.get $std/array/out - i32.const 608 - call $~lib/array/Array#concat + local.get $0 + ) + (func $~lib/array/Array#join_ref (; 253 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + call $~lib/rt/pure/__retain drop - global.get $std/array/arr - call $std/array/internalCapacity - i32.const 3 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 128 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/out - i32.const 0 - call $~lib/array/Array#__get - i32.const 43 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 130 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/out + local.get $0 + i32.load offset=12 i32.const 1 - call $~lib/array/Array#__get - i32.const 44 - i32.eq - i32.eqz + i32.sub + local.set $2 + local.get $2 + i32.const 0 + i32.lt_s if - i32.const 0 - i32.const 120 - i32.const 131 - i32.const 0 - call $~lib/env/abort - unreachable + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + return end - global.get $std/array/out - i32.const 2 - call $~lib/array/Array#__get - i32.const 45 - i32.eq + local.get $0 + i32.load offset=4 + local.set $4 + local.get $2 i32.eqz if - i32.const 0 - i32.const 120 - i32.const 132 - i32.const 0 - call $~lib/env/abort - unreachable + i32.const 6696 + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + return end - global.get $std/array/other - i32.const 46 - call $~lib/array/Array#push - drop - global.get $std/array/other - i32.const 47 - call $~lib/array/Array#push - drop - global.get $std/array/arr - global.get $std/array/other - call $~lib/array/Array#concat - global.set $std/array/out - global.get $std/array/arr - call $std/array/internalCapacity - i32.const 3 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 139 + local.get $1 + call $~lib/string/String#get:length + local.set $5 + i32.const 15 + local.get $5 + i32.add + local.get $2 + i32.mul + i32.const 15 + i32.add + local.set $6 + local.get $6 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $7 + i32.const 0 + local.set $8 + i32.const 0 + local.set $9 + block $break|0 i32.const 0 - call $~lib/env/abort + local.set $3 + loop $repeat|0 + local.get $3 + local.get $2 + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + local.get $4 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load + local.tee $10 + local.get $9 + local.tee $11 + i32.ne + if + local.get $10 + call $~lib/rt/pure/__retain + drop + local.get $11 + call $~lib/rt/pure/__release + end + local.get $10 + end + local.set $9 + local.get $9 + if + local.get $7 + local.get $8 + i32.const 1 + i32.shl + i32.add + i32.const 6696 + i32.const 15 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $8 + i32.const 15 + i32.add + local.set $8 + end + local.get $5 + if + local.get $7 + local.get $8 + i32.const 1 + i32.shl + i32.add + local.get $1 + local.get $5 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $8 + local.get $5 + i32.add + local.set $8 + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end unreachable end - block $~lib/array/Array#get:length|inlined.8 (result i32) - global.get $std/array/other - local.set $0 - local.get $0 - i32.load offset=4 - end + local.get $4 + local.get $2 i32.const 2 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 140 - i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#get:length|inlined.9 (result i32) - global.get $std/array/out - local.set $0 - local.get $0 - i32.load offset=4 - end - i32.const 5 - i32.eq - i32.eqz + i32.shl + i32.add + i32.load if - i32.const 0 - i32.const 120 - i32.const 141 - i32.const 0 - call $~lib/env/abort - unreachable + local.get $7 + local.get $8 + i32.const 1 + i32.shl + i32.add + i32.const 6696 + i32.const 15 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $8 + i32.const 15 + i32.add + local.set $8 end - global.get $std/array/out - i32.const 0 - call $~lib/array/Array#__get - i32.const 43 - i32.eq - i32.eqz + local.get $6 + local.get $8 + i32.gt_s if + local.get $7 i32.const 0 - i32.const 120 - i32.const 142 - i32.const 0 - call $~lib/env/abort - unreachable + local.get $8 + call $~lib/string/String#substring + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release + local.get $9 + call $~lib/rt/pure/__release + local.get $3 + return end - global.get $std/array/out + local.get $7 + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $9 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $~lib/array/Array#join (; 254 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array#join_ref + local.set $2 + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + return + ) + (func $~lib/array/Array#toString (; 255 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 4512 + call $~lib/array/Array#join + ) + (func $~lib/util/number/itoa (; 256 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + call $~lib/util/number/itoa32 + return + ) + (func $~lib/util/number/itoa_stream (; 257 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + local.get $0 + local.get $1 i32.const 1 - call $~lib/array/Array#__get - i32.const 44 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 143 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/out - i32.const 2 - call $~lib/array/Array#__get - i32.const 45 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 144 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/out - i32.const 3 - call $~lib/array/Array#__get - i32.const 46 - i32.eq + i32.shl + i32.add + local.set $0 + local.get $2 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s i32.eqz if - i32.const 0 - i32.const 120 - i32.const 145 - i32.const 0 - call $~lib/env/abort - unreachable + local.get $0 + i32.const 48 + i32.store16 + i32.const 1 + return end - global.get $std/array/out - i32.const 4 - call $~lib/array/Array#__get - i32.const 47 - i32.eq - i32.eqz + i32.const 0 + local.set $3 + local.get $2 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.const 0 + i32.lt_s + local.set $4 + local.get $4 if i32.const 0 - i32.const 120 - i32.const 146 - i32.const 0 - call $~lib/env/abort - unreachable + local.get $2 + i32.sub + local.set $2 end - global.get $std/array/out - call $~lib/array/Array#pop - drop - block $~lib/array/Array#get:length|inlined.10 (result i32) - global.get $std/array/out - local.set $0 + local.get $2 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + call $~lib/util/number/decimalCount32 + local.get $4 + i32.add + local.set $3 + block $~lib/util/number/utoa32_core|inlined.6 local.get $0 - i32.load offset=4 + local.set $7 + local.get $2 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + local.set $6 + local.get $3 + local.set $5 + local.get $7 + local.get $6 + local.get $5 + call $~lib/util/number/utoa32_lut end - i32.const 4 - i32.eq - i32.eqz + local.get $4 if - i32.const 0 - i32.const 120 - i32.const 149 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#concat - global.set $std/array/out - block $~lib/array/Array#get:length|inlined.11 (result i32) - global.get $std/array/out - local.set $0 local.get $0 - i32.load offset=4 + i32.const 45 + i32.store16 end - i32.const 3 - i32.eq - i32.eqz + local.get $3 + ) + (func $~lib/array/Array#join_int (; 258 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.load offset=12 + i32.const 1 + i32.sub + local.set $2 + local.get $2 + i32.const 0 + i32.lt_s if - i32.const 0 - i32.const 120 - i32.const 152 - i32.const 0 - call $~lib/env/abort - unreachable + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + return end - global.get $std/array/out - i32.const 2 - call $~lib/array/Array#__get - i32.const 45 - i32.eq + local.get $0 + i32.load offset=4 + local.set $4 + local.get $2 i32.eqz if - i32.const 0 - i32.const 120 - i32.const 153 - i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#get:length|inlined.12 (result i32) - global.get $std/array/source - local.set $0 - local.get $0 - i32.load offset=4 + local.get $4 + i32.load8_s + call $~lib/util/number/itoa + local.tee $3 + call $~lib/rt/pure/__retain + local.set $5 + local.get $3 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $5 + return end + local.get $1 + call $~lib/string/String#get:length + local.set $6 + i32.const 11 + local.get $6 + i32.add + local.get $2 + i32.mul + i32.const 11 + i32.add + local.set $7 + local.get $7 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $8 i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 156 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/source - global.get $std/array/arr - call $~lib/array/Array#concat - global.set $std/array/out - block $~lib/array/Array#get:length|inlined.13 (result i32) - global.get $std/array/out - local.set $0 - local.get $0 - i32.load offset=4 - end - i32.const 3 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 158 + local.set $9 + block $break|0 i32.const 0 - call $~lib/env/abort + local.set $3 + loop $repeat|0 + local.get $3 + local.get $2 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $4 + local.get $3 + i32.const 0 + i32.shl + i32.add + i32.load8_s + local.set $10 + local.get $9 + local.get $8 + local.get $9 + local.get $10 + call $~lib/util/number/itoa_stream + i32.add + local.set $9 + local.get $6 + if + local.get $8 + local.get $9 + i32.const 1 + i32.shl + i32.add + local.get $1 + local.get $6 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $6 + i32.add + local.set $9 + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end unreachable end - block $~lib/array/Array#get:length|inlined.14 (result i32) - global.get $std/array/source - local.set $0 - local.get $0 - i32.load offset=4 - end + local.get $4 + local.get $2 i32.const 0 - i32.eq - i32.eqz + i32.shl + i32.add + i32.load8_s + local.set $10 + local.get $9 + local.get $8 + local.get $9 + local.get $10 + call $~lib/util/number/itoa_stream + i32.add + local.set $9 + local.get $7 + local.get $9 + i32.gt_s if + local.get $8 i32.const 0 - i32.const 120 - i32.const 159 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 664 - global.set $std/array/cwArr - block (result i32) - i32.const 2 - global.set $~lib/argc - global.get $std/array/cwArr - i32.const 0 - i32.const 3 - i32.const 0 - call $~lib/array/Array#copyWithin|trampoline + local.get $9 + call $~lib/string/String#substring + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $8 + call $~lib/rt/pure/__release + local.get $3 + return end - i32.const 704 - i32.const 0 - call $std/array/isArraysEqual + local.get $8 + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $~lib/array/Array#join (; 259 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array#join_int + local.set $2 + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + return + ) + (func $~lib/array/Array#toString (; 260 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 4512 + call $~lib/array/Array#join + ) + (func $~lib/util/number/itoa (; 261 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 65535 + i32.and + call $~lib/util/number/utoa32 + return + ) + (func $~lib/util/number/itoa_stream (; 262 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $0 + local.get $1 + i32.const 1 + i32.shl + i32.add + local.set $0 + local.get $2 + i32.const 65535 + i32.and i32.eqz if - i32.const 0 - i32.const 120 - i32.const 165 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 744 - global.set $std/array/cwArr - block (result i32) - i32.const 2 - global.set $~lib/argc - global.get $std/array/cwArr + local.get $0 + i32.const 48 + i32.store16 i32.const 1 - i32.const 3 - i32.const 0 - call $~lib/array/Array#copyWithin|trampoline + return end - i32.const 784 i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 167 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 824 - global.set $std/array/cwArr - block (result i32) - i32.const 2 - global.set $~lib/argc - global.get $std/array/cwArr - i32.const 1 - i32.const 2 - i32.const 0 - call $~lib/array/Array#copyWithin|trampoline + local.set $3 + local.get $2 + i32.const 65535 + i32.and + call $~lib/util/number/decimalCount32 + local.set $3 + block $~lib/util/number/utoa32_core|inlined.7 + local.get $0 + local.set $6 + local.get $2 + i32.const 65535 + i32.and + local.set $5 + local.get $3 + local.set $4 + local.get $6 + local.get $5 + local.get $4 + call $~lib/util/number/utoa32_lut end - i32.const 864 + local.get $3 + ) + (func $~lib/array/Array#join_int (; 263 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.load offset=12 + i32.const 1 + i32.sub + local.set $2 + local.get $2 i32.const 0 - call $std/array/isArraysEqual - i32.eqz + i32.lt_s if - i32.const 0 - i32.const 120 - i32.const 169 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 904 - global.set $std/array/cwArr - block (result i32) - i32.const 2 - global.set $~lib/argc - global.get $std/array/cwArr - i32.const 2 - i32.const 2 - i32.const 0 - call $~lib/array/Array#copyWithin|trampoline + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + return end - i32.const 944 - i32.const 0 - call $std/array/isArraysEqual + local.get $0 + i32.load offset=4 + local.set $4 + local.get $2 i32.eqz if - i32.const 0 - i32.const 120 - i32.const 171 - i32.const 0 - call $~lib/env/abort - unreachable + local.get $4 + i32.load16_u + call $~lib/util/number/itoa + local.tee $3 + call $~lib/rt/pure/__retain + local.set $5 + local.get $3 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $5 + return end - i32.const 984 - global.set $std/array/cwArr - global.get $std/array/cwArr - i32.const 0 - i32.const 3 - i32.const 4 - call $~lib/array/Array#copyWithin - i32.const 1024 + local.get $1 + call $~lib/string/String#get:length + local.set $6 + i32.const 10 + local.get $6 + i32.add + local.get $2 + i32.mul + i32.const 10 + i32.add + local.set $7 + local.get $7 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $8 i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 173 + local.set $9 + block $break|0 i32.const 0 - call $~lib/env/abort + local.set $3 + loop $repeat|0 + local.get $3 + local.get $2 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $4 + local.get $3 + i32.const 1 + i32.shl + i32.add + i32.load16_u + local.set $10 + local.get $9 + local.get $8 + local.get $9 + local.get $10 + call $~lib/util/number/itoa_stream + i32.add + local.set $9 + local.get $6 + if + local.get $8 + local.get $9 + i32.const 1 + i32.shl + i32.add + local.get $1 + local.get $6 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $6 + i32.add + local.set $9 + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end unreachable end - i32.const 1064 - global.set $std/array/cwArr - global.get $std/array/cwArr + local.get $4 + local.get $2 i32.const 1 - i32.const 3 - i32.const 4 - call $~lib/array/Array#copyWithin - i32.const 1104 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz + i32.shl + i32.add + i32.load16_u + local.set $10 + local.get $9 + local.get $8 + local.get $9 + local.get $10 + call $~lib/util/number/itoa_stream + i32.add + local.set $9 + local.get $7 + local.get $9 + i32.gt_s if + local.get $8 i32.const 0 - i32.const 120 - i32.const 175 - i32.const 0 - call $~lib/env/abort - unreachable + local.get $9 + call $~lib/string/String#substring + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $8 + call $~lib/rt/pure/__release + local.get $3 + return end - i32.const 1144 - global.set $std/array/cwArr - global.get $std/array/cwArr - i32.const 1 - i32.const 2 - i32.const 4 - call $~lib/array/Array#copyWithin - i32.const 1184 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz + local.get $8 + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $~lib/array/Array#join (; 264 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array#join_int + local.set $2 + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + return + ) + (func $~lib/array/Array#toString (; 265 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 4512 + call $~lib/array/Array#join + ) + (func $~lib/util/number/decimalCount64 (; 266 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (local $1 i32) + local.get $0 + i64.const 1000000000000000 + i64.lt_u if - i32.const 0 - i32.const 120 - i32.const 177 - i32.const 0 - call $~lib/env/abort + local.get $0 + i64.const 1000000000000 + i64.lt_u + if + i32.const 11 + i32.const 12 + local.get $0 + i64.const 100000000000 + i64.lt_u + select + return + else + i32.const 14 + i32.const 15 + local.get $0 + i64.const 100000000000000 + i64.lt_u + select + local.set $1 + i32.const 13 + local.get $1 + local.get $0 + i64.const 10000000000000 + i64.lt_u + select + return + end unreachable - end - i32.const 1224 - global.set $std/array/cwArr - block (result i32) - i32.const 2 - global.set $~lib/argc - global.get $std/array/cwArr - i32.const 0 - i32.const -2 - i32.const 0 - call $~lib/array/Array#copyWithin|trampoline - end - i32.const 1264 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 179 - i32.const 0 - call $~lib/env/abort unreachable - end - i32.const 1304 - global.set $std/array/cwArr - global.get $std/array/cwArr - i32.const 0 - i32.const -2 - i32.const -1 - call $~lib/array/Array#copyWithin - i32.const 1344 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 181 - i32.const 0 - call $~lib/env/abort + else + local.get $0 + i64.const 100000000000000000 + i64.lt_u + if + i32.const 16 + i32.const 17 + local.get $0 + i64.const 10000000000000000 + i64.lt_u + select + return + else + i32.const 19 + i32.const 20 + local.get $0 + i64.const -8446744073709551616 + i64.lt_u + select + local.set $1 + i32.const 18 + local.get $1 + local.get $0 + i64.const 1000000000000000000 + i64.lt_u + select + return + end unreachable - end - i32.const 1384 - global.set $std/array/cwArr - global.get $std/array/cwArr - i32.const -4 - i32.const -3 - i32.const -2 - call $~lib/array/Array#copyWithin - i32.const 1424 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 183 - i32.const 0 - call $~lib/env/abort unreachable end - i32.const 1464 - global.set $std/array/cwArr - global.get $std/array/cwArr - i32.const -4 - i32.const -3 - i32.const -1 - call $~lib/array/Array#copyWithin - i32.const 1504 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz + unreachable + unreachable + ) + (func $~lib/util/number/utoa64_lut (; 267 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) + (local $3 i32) + (local $4 i64) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i64) + (local $13 i64) + i32.const 5048 + i32.load offset=4 + local.set $3 + block $break|0 + loop $continue|0 + local.get $1 + i64.const 100000000 + i64.ge_u + if + local.get $1 + i64.const 100000000 + i64.div_u + local.set $4 + local.get $1 + local.get $4 + i64.const 100000000 + i64.mul + i64.sub + i32.wrap_i64 + local.set $5 + local.get $4 + local.set $1 + local.get $5 + i32.const 10000 + i32.div_u + local.set $6 + local.get $5 + i32.const 10000 + i32.rem_u + local.set $7 + local.get $6 + i32.const 100 + i32.div_u + local.set $8 + local.get $6 + i32.const 100 + i32.rem_u + local.set $9 + local.get $7 + i32.const 100 + i32.div_u + local.set $10 + local.get $7 + i32.const 100 + i32.rem_u + local.set $11 + local.get $3 + local.get $10 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $12 + local.get $3 + local.get $11 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $13 + local.get $2 + i32.const 4 + i32.sub + local.set $2 + local.get $0 + local.get $2 + i32.const 1 + i32.shl + i32.add + local.get $12 + local.get $13 + i64.const 32 + i64.shl + i64.or + i64.store + local.get $3 + local.get $8 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $12 + local.get $3 + local.get $9 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $13 + local.get $2 + i32.const 4 + i32.sub + local.set $2 + local.get $0 + local.get $2 + i32.const 1 + i32.shl + i32.add + local.get $12 + local.get $13 + i64.const 32 + i64.shl + i64.or + i64.store + br $continue|0 + end + end + end + local.get $0 + local.get $1 + i32.wrap_i64 + local.get $2 + call $~lib/util/number/utoa32_lut + ) + (func $~lib/util/number/utoa64 (; 268 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i64) + local.get $0 + i64.eqz if - i32.const 0 - i32.const 120 - i32.const 185 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 1544 - global.set $std/array/cwArr - block (result i32) - i32.const 2 - global.set $~lib/argc - global.get $std/array/cwArr - i32.const -4 - i32.const -3 - i32.const 0 - call $~lib/array/Array#copyWithin|trampoline + i32.const 4608 + call $~lib/rt/pure/__retain + return end - i32.const 1584 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz + local.get $0 + i64.const 4294967295 + i64.le_u if - i32.const 0 - i32.const 120 - i32.const 187 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - i32.const 42 - call $~lib/array/Array#unshift - drop - block $~lib/array/Array#get:length|inlined.18 (result i32) - global.get $std/array/arr - local.set $0 local.get $0 - i32.load offset=4 - end - i32.const 4 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 193 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - call $std/array/internalCapacity - i32.const 4 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 194 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#__get - i32.const 42 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 195 - i32.const 0 - call $~lib/env/abort - unreachable + i32.wrap_i64 + local.set $2 + local.get $2 + call $~lib/util/number/decimalCount32 + local.set $3 + local.get $3 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + local.set $1 + block $~lib/util/number/utoa32_core|inlined.8 + local.get $1 + local.set $6 + local.get $2 + local.set $5 + local.get $3 + local.set $4 + local.get $6 + local.get $5 + local.get $4 + call $~lib/util/number/utoa32_lut + end + else + local.get $0 + call $~lib/util/number/decimalCount64 + local.set $3 + local.get $3 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + local.set $1 + block $~lib/util/number/utoa64_core|inlined.0 + local.get $1 + local.set $5 + local.get $0 + local.set $7 + local.get $3 + local.set $4 + local.get $5 + local.get $7 + local.get $4 + call $~lib/util/number/utoa64_lut + end end - global.get $std/array/arr + local.get $1 + call $~lib/rt/pure/__retain + ) + (func $~lib/util/number/itoa (; 269 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + local.get $0 + call $~lib/util/number/utoa64 + return + ) + (func $~lib/util/number/itoa_stream (; 270 ;) (type $FUNCSIG$iiij) (param $0 i32) (param $1 i32) (param $2 i64) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i64) + local.get $0 + local.get $1 i32.const 1 - call $~lib/array/Array#__get - i32.const 43 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 196 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#__get - i32.const 44 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 197 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#__get - i32.const 45 - i32.eq - i32.eqz + i32.shl + i32.add + local.set $0 + local.get $2 + i64.eqz if - i32.const 0 - i32.const 120 - i32.const 198 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - i32.const 41 - call $~lib/array/Array#unshift - drop - block $~lib/array/Array#get:length|inlined.19 (result i32) - global.get $std/array/arr - local.set $0 local.get $0 - i32.load offset=4 - end - i32.const 5 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 202 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - call $std/array/internalCapacity - i32.const 5 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 203 - i32.const 0 - call $~lib/env/abort - unreachable + i32.const 48 + i32.store16 + i32.const 1 + return end - global.get $std/array/arr i32.const 0 - call $~lib/array/Array#__get - i32.const 41 - i32.eq - i32.eqz + local.set $3 + local.get $2 + i64.const 4294967295 + i64.le_u if - i32.const 0 - i32.const 120 - i32.const 204 - i32.const 0 - call $~lib/env/abort - unreachable + local.get $2 + i32.wrap_i64 + local.set $4 + local.get $4 + call $~lib/util/number/decimalCount32 + local.set $3 + block $~lib/util/number/utoa32_core|inlined.9 + local.get $0 + local.set $7 + local.get $4 + local.set $6 + local.get $3 + local.set $5 + local.get $7 + local.get $6 + local.get $5 + call $~lib/util/number/utoa32_lut + end + else + local.get $2 + call $~lib/util/number/decimalCount64 + local.set $3 + block $~lib/util/number/utoa64_core|inlined.1 + local.get $0 + local.set $6 + local.get $2 + local.set $8 + local.get $3 + local.set $5 + local.get $6 + local.get $8 + local.get $5 + call $~lib/util/number/utoa64_lut + end end - global.get $std/array/arr + local.get $3 + ) + (func $~lib/array/Array#join_int (; 271 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i64) + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.load offset=12 i32.const 1 - call $~lib/array/Array#__get - i32.const 42 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 205 - i32.const 0 - call $~lib/env/abort - unreachable + i32.sub + local.set $2 + local.get $2 + i32.const 0 + i32.lt_s + if + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + return end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#__get - i32.const 43 - i32.eq + local.get $0 + i32.load offset=4 + local.set $4 + local.get $2 i32.eqz if + local.get $4 + i64.load + call $~lib/util/number/itoa + local.tee $3 + call $~lib/rt/pure/__retain + local.set $5 + local.get $3 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $5 + return + end + local.get $1 + call $~lib/string/String#get:length + local.set $6 + i32.const 20 + local.get $6 + i32.add + local.get $2 + i32.mul + i32.const 20 + i32.add + local.set $7 + local.get $7 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $8 + i32.const 0 + local.set $9 + block $break|0 i32.const 0 - i32.const 120 - i32.const 206 - i32.const 0 - call $~lib/env/abort + local.set $3 + loop $repeat|0 + local.get $3 + local.get $2 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $4 + local.get $3 + i32.const 3 + i32.shl + i32.add + i64.load + local.set $10 + local.get $9 + local.get $8 + local.get $9 + local.get $10 + call $~lib/util/number/itoa_stream + i32.add + local.set $9 + local.get $6 + if + local.get $8 + local.get $9 + i32.const 1 + i32.shl + i32.add + local.get $1 + local.get $6 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $6 + i32.add + local.set $9 + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end unreachable end - global.get $std/array/arr + local.get $4 + local.get $2 i32.const 3 - call $~lib/array/Array#__get - i32.const 44 - i32.eq - i32.eqz + i32.shl + i32.add + i64.load + local.set $10 + local.get $9 + local.get $8 + local.get $9 + local.get $10 + call $~lib/util/number/itoa_stream + i32.add + local.set $9 + local.get $7 + local.get $9 + i32.gt_s if + local.get $8 i32.const 0 - i32.const 120 - i32.const 207 - i32.const 0 - call $~lib/env/abort - unreachable + local.get $9 + call $~lib/string/String#substring + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $8 + call $~lib/rt/pure/__release + local.get $3 + return end - global.get $std/array/arr - i32.const 4 - call $~lib/array/Array#__get - i32.const 45 - i32.eq - i32.eqz + local.get $8 + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $~lib/array/Array#join (; 272 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array#join_int + local.set $2 + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + return + ) + (func $~lib/array/Array#toString (; 273 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 4512 + call $~lib/array/Array#join + ) + (func $~lib/util/number/itoa64 (; 274 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i64) + local.get $0 + i64.eqz if - i32.const 0 - i32.const 120 - i32.const 208 - i32.const 0 - call $~lib/env/abort - unreachable + i32.const 4608 + call $~lib/rt/pure/__retain + return end - global.get $std/array/arr - call $~lib/array/Array#shift - global.set $std/array/i - global.get $std/array/i - i32.const 41 - i32.eq - i32.eqz + local.get $0 + i64.const 0 + i64.lt_s + local.set $1 + local.get $1 if - i32.const 0 - i32.const 120 - i32.const 214 - i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#get:length|inlined.20 (result i32) - global.get $std/array/arr - local.set $0 + i64.const 0 local.get $0 - i32.load offset=4 - end - i32.const 4 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 215 - i32.const 0 - call $~lib/env/abort - unreachable + i64.sub + local.set $0 end - global.get $std/array/arr - call $std/array/internalCapacity - i32.const 5 - i32.eq - i32.eqz + local.get $0 + i64.const 4294967295 + i64.le_u if - i32.const 0 - i32.const 120 - i32.const 216 - i32.const 0 - call $~lib/env/abort - unreachable + local.get $0 + i32.wrap_i64 + local.set $3 + local.get $3 + call $~lib/util/number/decimalCount32 + local.get $1 + i32.add + local.set $4 + local.get $4 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + local.set $2 + block $~lib/util/number/utoa32_core|inlined.10 + local.get $2 + local.set $7 + local.get $3 + local.set $6 + local.get $4 + local.set $5 + local.get $7 + local.get $6 + local.get $5 + call $~lib/util/number/utoa32_lut + end + else + local.get $0 + call $~lib/util/number/decimalCount64 + local.get $1 + i32.add + local.set $4 + local.get $4 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + local.set $2 + block $~lib/util/number/utoa64_core|inlined.2 + local.get $2 + local.set $6 + local.get $0 + local.set $8 + local.get $4 + local.set $5 + local.get $6 + local.get $8 + local.get $5 + call $~lib/util/number/utoa64_lut + end end - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#__get - i32.const 42 - i32.eq - i32.eqz + local.get $1 if - i32.const 0 - i32.const 120 - i32.const 217 - i32.const 0 - call $~lib/env/abort - unreachable + local.get $2 + i32.const 45 + i32.store16 end - global.get $std/array/arr - i32.const 1 - call $~lib/array/Array#__get - i32.const 43 - i32.eq - i32.eqz + local.get $2 + call $~lib/rt/pure/__retain + ) + (func $~lib/util/number/itoa (; 275 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + local.get $0 + call $~lib/util/number/itoa64 + return + ) + (func $~lib/util/number/itoa_stream (; 276 ;) (type $FUNCSIG$iiij) (param $0 i32) (param $1 i32) (param $2 i64) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i64) + local.get $0 + local.get $1 + i32.const 1 + i32.shl + i32.add + local.set $0 + local.get $2 + i64.eqz if - i32.const 0 - i32.const 120 - i32.const 218 - i32.const 0 - call $~lib/env/abort - unreachable + local.get $0 + i32.const 48 + i32.store16 + i32.const 1 + return end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#__get - i32.const 44 - i32.eq - i32.eqz + i32.const 0 + local.set $3 + local.get $2 + i64.const 0 + i64.lt_s + local.set $4 + local.get $4 if - i32.const 0 - i32.const 120 - i32.const 219 - i32.const 0 - call $~lib/env/abort - unreachable + i64.const 0 + local.get $2 + i64.sub + local.set $2 end - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#__get - i32.const 45 - i32.eq - i32.eqz + local.get $2 + i64.const 4294967295 + i64.le_u if - i32.const 0 - i32.const 120 - i32.const 220 - i32.const 0 - call $~lib/env/abort - unreachable + local.get $2 + i32.wrap_i64 + local.set $5 + local.get $5 + call $~lib/util/number/decimalCount32 + local.get $4 + i32.add + local.set $3 + block $~lib/util/number/utoa32_core|inlined.11 + local.get $0 + local.set $8 + local.get $5 + local.set $7 + local.get $3 + local.set $6 + local.get $8 + local.get $7 + local.get $6 + call $~lib/util/number/utoa32_lut + end + else + local.get $2 + call $~lib/util/number/decimalCount64 + local.get $4 + i32.add + local.set $3 + block $~lib/util/number/utoa64_core|inlined.3 + local.get $0 + local.set $7 + local.get $2 + local.set $9 + local.get $3 + local.set $6 + local.get $7 + local.get $9 + local.get $6 + call $~lib/util/number/utoa64_lut + end end - global.get $std/array/arr - call $~lib/array/Array#pop - global.set $std/array/i - global.get $std/array/i - i32.const 45 - i32.eq - i32.eqz + local.get $4 if - i32.const 0 - i32.const 120 - i32.const 224 - i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#get:length|inlined.21 (result i32) - global.get $std/array/arr - local.set $0 local.get $0 - i32.load offset=4 - end - i32.const 3 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 225 - i32.const 0 - call $~lib/env/abort - unreachable + i32.const 45 + i32.store16 end - global.get $std/array/arr - call $std/array/internalCapacity - i32.const 5 - i32.eq - i32.eqz + local.get $3 + ) + (func $~lib/array/Array#join_int (; 277 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i64) + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.load offset=12 + i32.const 1 + i32.sub + local.set $2 + local.get $2 + i32.const 0 + i32.lt_s if - i32.const 0 - i32.const 120 - i32.const 226 - i32.const 0 - call $~lib/env/abort - unreachable + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + return end - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#__get - i32.const 42 - i32.eq + local.get $0 + i32.load offset=4 + local.set $4 + local.get $2 i32.eqz if - i32.const 0 - i32.const 120 - i32.const 227 - i32.const 0 - call $~lib/env/abort - unreachable + local.get $4 + i64.load + call $~lib/util/number/itoa + local.tee $3 + call $~lib/rt/pure/__retain + local.set $5 + local.get $3 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $5 + return end - global.get $std/array/arr + local.get $1 + call $~lib/string/String#get:length + local.set $6 + i32.const 21 + local.get $6 + i32.add + local.get $2 + i32.mul + i32.const 21 + i32.add + local.set $7 + local.get $7 i32.const 1 - call $~lib/array/Array#__get - i32.const 43 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 228 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $8 + i32.const 0 + local.set $9 + block $break|0 i32.const 0 - call $~lib/env/abort + local.set $3 + loop $repeat|0 + local.get $3 + local.get $2 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $4 + local.get $3 + i32.const 3 + i32.shl + i32.add + i64.load + local.set $10 + local.get $9 + local.get $8 + local.get $9 + local.get $10 + call $~lib/util/number/itoa_stream + i32.add + local.set $9 + local.get $6 + if + local.get $8 + local.get $9 + i32.const 1 + i32.shl + i32.add + local.get $1 + local.get $6 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $6 + i32.add + local.set $9 + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end unreachable end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#__get - i32.const 44 - i32.eq - i32.eqz + local.get $4 + local.get $2 + i32.const 3 + i32.shl + i32.add + i64.load + local.set $10 + local.get $9 + local.get $8 + local.get $9 + local.get $10 + call $~lib/util/number/itoa_stream + i32.add + local.set $9 + local.get $7 + local.get $9 + i32.gt_s if + local.get $8 i32.const 0 - i32.const 120 - i32.const 229 - i32.const 0 - call $~lib/env/abort - unreachable + local.get $9 + call $~lib/string/String#substring + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $8 + call $~lib/rt/pure/__release + local.get $3 + return end - global.get $std/array/arr - call $~lib/array/Array#reverse + local.get $8 + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $~lib/array/Array#join (; 278 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array#join_int + local.set $2 + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + return + ) + (func $~lib/array/Array#toString (; 279 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 4512 + call $~lib/array/Array#join + ) + (func $~lib/array/Array<~lib/string/String | null>#join_str (; 280 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + local.get $1 + call $~lib/rt/pure/__retain drop - block $~lib/array/Array#get:length|inlined.22 (result i32) - global.get $std/array/arr - local.set $0 - local.get $0 - i32.load offset=4 - end - i32.const 3 - i32.eq - i32.eqz + local.get $0 + i32.load offset=12 + i32.const 1 + i32.sub + local.set $2 + local.get $2 + i32.const 0 + i32.lt_s if - i32.const 0 - i32.const 120 - i32.const 235 - i32.const 0 - call $~lib/env/abort - unreachable + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + return end - global.get $std/array/arr - call $std/array/internalCapacity - i32.const 5 - i32.eq + local.get $0 + i32.load offset=4 + local.set $4 + local.get $2 i32.eqz if - i32.const 0 - i32.const 120 - i32.const 236 - i32.const 0 - call $~lib/env/abort - unreachable + local.get $4 + i32.load + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + return end - global.get $std/array/arr + local.get $1 + call $~lib/string/String#get:length + local.set $5 i32.const 0 - call $~lib/array/Array#__get - i32.const 44 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 237 - i32.const 0 - call $~lib/env/abort + local.set $6 + i32.const 0 + local.set $7 + block $break|0 + block + i32.const 0 + local.set $3 + local.get $2 + i32.const 1 + i32.add + local.set $8 + end + loop $repeat|0 + local.get $3 + local.get $8 + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + local.get $4 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load + local.tee $9 + local.get $7 + local.tee $10 + i32.ne + if + local.get $9 + call $~lib/rt/pure/__retain + drop + local.get $10 + call $~lib/rt/pure/__release + end + local.get $9 + end + local.set $7 + local.get $7 + i32.const 0 + i32.ne + if + local.get $6 + local.get $7 + call $~lib/string/String#get:length + i32.add + local.set $6 + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end unreachable end - global.get $std/array/arr + i32.const 0 + local.set $11 + local.get $6 + local.get $5 + local.get $2 + i32.mul + i32.add i32.const 1 - call $~lib/array/Array#__get - i32.const 43 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 238 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $12 + block $break|1 i32.const 0 - call $~lib/env/abort + local.set $8 + loop $repeat|1 + local.get $8 + local.get $2 + i32.lt_s + i32.eqz + br_if $break|1 + block (result i32) + local.get $4 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load + local.tee $10 + local.get $7 + local.tee $3 + i32.ne + if + local.get $10 + call $~lib/rt/pure/__retain + drop + local.get $3 + call $~lib/rt/pure/__release + end + local.get $10 + end + local.set $7 + local.get $7 + i32.const 0 + i32.ne + if + local.get $7 + call $~lib/string/String#get:length + local.set $10 + local.get $12 + local.get $11 + i32.const 1 + i32.shl + i32.add + local.get $7 + local.get $10 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $11 + local.get $10 + i32.add + local.set $11 + end + local.get $5 + if + local.get $12 + local.get $11 + i32.const 1 + i32.shl + i32.add + local.get $1 + local.get $5 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $11 + local.get $5 + i32.add + local.set $11 + end + local.get $8 + i32.const 1 + i32.add + local.set $8 + br $repeat|1 + unreachable + end unreachable end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#__get - i32.const 42 - i32.eq - i32.eqz + block (result i32) + local.get $4 + local.get $2 + i32.const 2 + i32.shl + i32.add + i32.load + local.tee $9 + local.get $7 + local.tee $8 + i32.ne + if + local.get $9 + call $~lib/rt/pure/__retain + drop + local.get $8 + call $~lib/rt/pure/__release + end + local.get $9 + end + local.set $7 + local.get $7 + i32.const 0 + i32.ne if - i32.const 0 - i32.const 120 - i32.const 239 - i32.const 0 - call $~lib/env/abort - unreachable + local.get $12 + local.get $11 + i32.const 1 + i32.shl + i32.add + local.get $7 + local.get $7 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + call $~lib/memory/memory.copy end - global.get $std/array/arr - i32.const 43 - call $~lib/array/Array#push + local.get $12 + local.set $9 + local.get $1 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release + local.get $9 + ) + (func $~lib/array/Array<~lib/string/String | null>#join (; 281 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/pure/__retain drop - global.get $std/array/arr - i32.const 44 - call $~lib/array/Array#push + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/string/String | null>#join_str + local.set $2 + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + return + ) + (func $~lib/array/Array<~lib/string/String | null>#toString (; 282 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 4512 + call $~lib/array/Array<~lib/string/String | null>#join + ) + (func $~lib/array/Array<~lib/string/String>#toString (; 283 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 4512 + call $~lib/array/Array<~lib/string/String>#join + ) + (func $~lib/array/Array<~lib/array/Array>#join_arr (; 284 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + call $~lib/rt/pure/__retain drop - global.get $std/array/arr - i32.const 44 - i32.const 0 - call $~lib/array/Array#indexOf - global.set $std/array/i - global.get $std/array/i - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 248 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - i32.const 42 + local.get $0 + i32.load offset=12 + i32.const 1 + i32.sub + local.set $2 + local.get $2 i32.const 0 - call $~lib/array/Array#indexOf - global.set $std/array/i - global.get $std/array/i - i32.const 2 - i32.eq - i32.eqz + i32.lt_s if - i32.const 0 - i32.const 120 - i32.const 252 - i32.const 0 - call $~lib/env/abort - unreachable + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + return end - global.get $std/array/arr - i32.const 45 + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $4 + local.get $1 + call $~lib/string/String#get:length + local.set $5 + local.get $0 + i32.load offset=4 + local.set $6 i32.const 0 - call $~lib/array/Array#indexOf - global.set $std/array/i - global.get $std/array/i - i32.const -1 - i32.eq + local.set $7 + local.get $2 i32.eqz if - i32.const 0 - i32.const 120 - i32.const 256 - i32.const 0 - call $~lib/env/abort - unreachable + block (result i32) + local.get $6 + i32.load + local.tee $3 + local.get $7 + local.tee $8 + i32.ne + if + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $8 + call $~lib/rt/pure/__release + end + local.get $3 + end + local.set $7 + local.get $7 + if (result i32) + local.get $7 + local.get $1 + call $~lib/array/Array#join + else + i32.const 4248 + call $~lib/rt/pure/__retain + end + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release + local.get $3 + return end - global.get $std/array/arr - i32.const 43 - i32.const 100 - call $~lib/array/Array#indexOf - global.set $std/array/i - global.get $std/array/i - i32.const -1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 260 + block $break|0 i32.const 0 - call $~lib/env/abort + local.set $3 + loop $repeat|0 + local.get $3 + local.get $2 + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + local.get $6 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load + local.tee $8 + local.get $7 + local.tee $9 + i32.ne + if + local.get $8 + call $~lib/rt/pure/__retain + drop + local.get $9 + call $~lib/rt/pure/__release + end + local.get $8 + end + local.set $7 + local.get $7 + if + block (result i32) + local.get $4 + local.get $7 + local.get $1 + call $~lib/array/Array#join + local.tee $8 + call $~lib/string/String.__concat + local.tee $9 + local.tee $10 + local.get $4 + local.tee $11 + i32.ne + if + local.get $10 + call $~lib/rt/pure/__retain + drop + local.get $11 + call $~lib/rt/pure/__release + end + local.get $10 + end + local.set $4 + local.get $8 + call $~lib/rt/pure/__release + local.get $9 + call $~lib/rt/pure/__release + end + local.get $5 + if + block (result i32) + local.get $4 + local.get $1 + call $~lib/string/String.__concat + local.tee $9 + local.tee $11 + local.get $4 + local.tee $8 + i32.ne + if + local.get $11 + call $~lib/rt/pure/__retain + drop + local.get $8 + call $~lib/rt/pure/__release + end + local.get $11 + end + local.set $4 + local.get $9 + call $~lib/rt/pure/__release + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end unreachable end - global.get $std/array/arr - i32.const 43 - i32.const -100 - call $~lib/array/Array#indexOf - global.set $std/array/i - global.get $std/array/i - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 264 - i32.const 0 - call $~lib/env/abort - unreachable + block (result i32) + local.get $6 + local.get $2 + i32.const 2 + i32.shl + i32.add + i32.load + local.tee $10 + local.get $7 + local.tee $3 + i32.ne + if + local.get $10 + call $~lib/rt/pure/__retain + drop + local.get $3 + call $~lib/rt/pure/__release + end + local.get $10 end - global.get $std/array/arr - i32.const 43 - i32.const -2 - call $~lib/array/Array#indexOf - global.set $std/array/i - global.get $std/array/i - i32.const 3 - i32.eq - i32.eqz + local.set $7 + local.get $7 if - i32.const 0 - i32.const 120 - i32.const 268 - i32.const 0 - call $~lib/env/abort - unreachable + block (result i32) + local.get $4 + local.get $7 + local.get $1 + call $~lib/array/Array#join + local.tee $10 + call $~lib/string/String.__concat + local.tee $3 + local.tee $8 + local.get $4 + local.tee $9 + i32.ne + if + local.get $8 + call $~lib/rt/pure/__retain + drop + local.get $9 + call $~lib/rt/pure/__release + end + local.get $8 + end + local.set $4 + local.get $10 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release end - global.get $std/array/arr - i32.const 43 - i32.const -4 - call $~lib/array/Array#indexOf - global.set $std/array/i - global.get $std/array/i + local.get $4 + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $~lib/array/Array<~lib/array/Array>#join (; 285 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#join_arr + local.set $2 + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + return + ) + (func $~lib/array/Array<~lib/array/Array>#toString (; 286 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 4512 + call $~lib/array/Array<~lib/array/Array>#join + ) + (func $~lib/util/number/itoa (; 287 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 255 + i32.and + call $~lib/util/number/utoa32 + return + ) + (func $~lib/util/number/itoa_stream (; 288 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $0 + local.get $1 i32.const 1 - i32.eq + i32.shl + i32.add + local.set $0 + local.get $2 + i32.const 255 + i32.and i32.eqz if - i32.const 0 - i32.const 120 - i32.const 272 - i32.const 0 - call $~lib/env/abort - unreachable + local.get $0 + i32.const 48 + i32.store16 + i32.const 1 + return end - global.get $std/array/arr - i32.const 43 i32.const 0 - call $~lib/array/Array#indexOf - global.set $std/array/i - global.get $std/array/i - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 276 - i32.const 0 - call $~lib/env/abort - unreachable + local.set $3 + local.get $2 + i32.const 255 + i32.and + call $~lib/util/number/decimalCount32 + local.set $3 + block $~lib/util/number/utoa32_core|inlined.12 + local.get $0 + local.set $6 + local.get $2 + i32.const 255 + i32.and + local.set $5 + local.get $3 + local.set $4 + local.get $6 + local.get $5 + local.get $4 + call $~lib/util/number/utoa32_lut end - global.get $std/array/arr - i32.const 43 - i32.const 1 - call $~lib/array/Array#indexOf - global.set $std/array/i - global.get $std/array/i + local.get $3 + ) + (func $~lib/array/Array#join_int (; 289 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.load offset=12 i32.const 1 - i32.eq - i32.eqz + i32.sub + local.set $2 + local.get $2 + i32.const 0 + i32.lt_s if - i32.const 0 - i32.const 120 - i32.const 280 - i32.const 0 - call $~lib/env/abort - unreachable + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + return end - global.get $std/array/arr - i32.const 43 - i32.const 2 - call $~lib/array/Array#indexOf - global.set $std/array/i - global.get $std/array/i - i32.const 3 - i32.eq + local.get $0 + i32.load offset=4 + local.set $4 + local.get $2 i32.eqz if - i32.const 0 - i32.const 120 - i32.const 284 - i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#includes|inlined.0 (result i32) - global.get $std/array/arr - local.set $0 - i32.const 44 - local.set $1 - i32.const 0 - local.set $2 - local.get $0 + local.get $4 + i32.load8_u + call $~lib/util/number/itoa + local.tee $3 + call $~lib/rt/pure/__retain + local.set $5 + local.get $3 + call $~lib/rt/pure/__release local.get $1 - local.get $2 - call $~lib/array/Array#indexOf - i32.const 0 - i32.ge_s + call $~lib/rt/pure/__release + local.get $5 + return end - i32.const 0 - i32.ne - global.set $std/array/includes - global.get $std/array/includes + local.get $1 + call $~lib/string/String#get:length + local.set $6 + i32.const 10 + local.get $6 + i32.add + local.get $2 + i32.mul + i32.const 10 + i32.add + local.set $7 + local.get $7 i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 290 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $8 + i32.const 0 + local.set $9 + block $break|0 i32.const 0 - call $~lib/env/abort + local.set $3 + loop $repeat|0 + local.get $3 + local.get $2 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $4 + local.get $3 + i32.const 0 + i32.shl + i32.add + i32.load8_u + local.set $10 + local.get $9 + local.get $8 + local.get $9 + local.get $10 + call $~lib/util/number/itoa_stream + i32.add + local.set $9 + local.get $6 + if + local.get $8 + local.get $9 + i32.const 1 + i32.shl + i32.add + local.get $1 + local.get $6 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $6 + i32.add + local.set $9 + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end unreachable end - block $~lib/array/Array#includes|inlined.1 (result i32) - global.get $std/array/arr - local.set $2 - i32.const 42 - local.set $1 - i32.const 0 - local.set $0 - local.get $2 - local.get $1 - local.get $0 - call $~lib/array/Array#indexOf - i32.const 0 - i32.ge_s - end + local.get $4 + local.get $2 i32.const 0 - i32.ne - global.set $std/array/includes - global.get $std/array/includes - i32.const 1 - i32.eq - i32.eqz + i32.shl + i32.add + i32.load8_u + local.set $10 + local.get $9 + local.get $8 + local.get $9 + local.get $10 + call $~lib/util/number/itoa_stream + i32.add + local.set $9 + local.get $7 + local.get $9 + i32.gt_s if + local.get $8 i32.const 0 - i32.const 120 - i32.const 294 - i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#includes|inlined.2 (result i32) - global.get $std/array/arr - local.set $0 - i32.const 45 - local.set $1 - i32.const 0 - local.set $2 - local.get $0 + local.get $9 + call $~lib/string/String#substring + local.set $3 local.get $1 - local.get $2 - call $~lib/array/Array#indexOf - i32.const 0 - i32.ge_s + call $~lib/rt/pure/__release + local.get $8 + call $~lib/rt/pure/__release + local.get $3 + return end + local.get $8 + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $~lib/array/Array#join (; 290 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array#join_int + local.set $2 + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + return + ) + (func $~lib/array/Array<~lib/array/Array>#join_arr (; 291 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.load offset=12 + i32.const 1 + i32.sub + local.set $2 + local.get $2 i32.const 0 - i32.ne - global.set $std/array/includes - global.get $std/array/includes - i32.const 0 - i32.eq - i32.eqz + i32.lt_s if - i32.const 0 - i32.const 120 - i32.const 298 - i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#includes|inlined.3 (result i32) - global.get $std/array/arr - local.set $2 - i32.const 43 - local.set $1 - i32.const 100 - local.set $0 - local.get $2 + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $3 local.get $1 - local.get $0 - call $~lib/array/Array#indexOf - i32.const 0 - i32.ge_s + call $~lib/rt/pure/__release + local.get $3 + return end + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $4 + local.get $1 + call $~lib/string/String#get:length + local.set $5 + local.get $0 + i32.load offset=4 + local.set $6 i32.const 0 - i32.ne - global.set $std/array/includes - global.get $std/array/includes - i32.const 0 - i32.eq + local.set $7 + local.get $2 i32.eqz if - i32.const 0 - i32.const 120 - i32.const 302 - i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#includes|inlined.4 (result i32) - global.get $std/array/arr - local.set $0 - i32.const 43 - local.set $1 - i32.const -100 - local.set $2 - local.get $0 + block (result i32) + local.get $6 + i32.load + local.tee $3 + local.get $7 + local.tee $8 + i32.ne + if + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $8 + call $~lib/rt/pure/__release + end + local.get $3 + end + local.set $7 + local.get $7 + if (result i32) + local.get $7 + local.get $1 + call $~lib/array/Array#join + else + i32.const 4248 + call $~lib/rt/pure/__retain + end + local.set $3 local.get $1 - local.get $2 - call $~lib/array/Array#indexOf - i32.const 0 - i32.ge_s + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release + local.get $3 + return end - i32.const 0 - i32.ne - global.set $std/array/includes - global.get $std/array/includes - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 306 + block $break|0 i32.const 0 - call $~lib/env/abort + local.set $3 + loop $repeat|0 + local.get $3 + local.get $2 + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + local.get $6 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load + local.tee $8 + local.get $7 + local.tee $9 + i32.ne + if + local.get $8 + call $~lib/rt/pure/__retain + drop + local.get $9 + call $~lib/rt/pure/__release + end + local.get $8 + end + local.set $7 + local.get $7 + if + block (result i32) + local.get $4 + local.get $7 + local.get $1 + call $~lib/array/Array#join + local.tee $8 + call $~lib/string/String.__concat + local.tee $9 + local.tee $10 + local.get $4 + local.tee $11 + i32.ne + if + local.get $10 + call $~lib/rt/pure/__retain + drop + local.get $11 + call $~lib/rt/pure/__release + end + local.get $10 + end + local.set $4 + local.get $8 + call $~lib/rt/pure/__release + local.get $9 + call $~lib/rt/pure/__release + end + local.get $5 + if + block (result i32) + local.get $4 + local.get $1 + call $~lib/string/String.__concat + local.tee $9 + local.tee $11 + local.get $4 + local.tee $8 + i32.ne + if + local.get $11 + call $~lib/rt/pure/__retain + drop + local.get $8 + call $~lib/rt/pure/__release + end + local.get $11 + end + local.set $4 + local.get $9 + call $~lib/rt/pure/__release + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end unreachable end - block $~lib/array/Array#includes|inlined.5 (result i32) - global.get $std/array/arr - local.set $2 - i32.const 43 - local.set $1 - i32.const -2 - local.set $0 + block (result i32) + local.get $6 local.get $2 - local.get $1 - local.get $0 - call $~lib/array/Array#indexOf - i32.const 0 - i32.ge_s + i32.const 2 + i32.shl + i32.add + i32.load + local.tee $10 + local.get $7 + local.tee $3 + i32.ne + if + local.get $10 + call $~lib/rt/pure/__retain + drop + local.get $3 + call $~lib/rt/pure/__release + end + local.get $10 end - i32.const 0 - i32.ne - global.set $std/array/includes - global.get $std/array/includes - i32.const 1 - i32.eq - i32.eqz + local.set $7 + local.get $7 if - i32.const 0 - i32.const 120 - i32.const 310 - i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#includes|inlined.6 (result i32) - global.get $std/array/arr - local.set $0 - i32.const 43 - local.set $1 - i32.const -4 - local.set $2 - local.get $0 - local.get $1 - local.get $2 - call $~lib/array/Array#indexOf - i32.const 0 - i32.ge_s + block (result i32) + local.get $4 + local.get $7 + local.get $1 + call $~lib/array/Array#join + local.tee $10 + call $~lib/string/String.__concat + local.tee $3 + local.tee $8 + local.get $4 + local.tee $9 + i32.ne + if + local.get $8 + call $~lib/rt/pure/__retain + drop + local.get $9 + call $~lib/rt/pure/__release + end + local.get $8 + end + local.set $4 + local.get $10 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release end + local.get $4 + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $~lib/array/Array<~lib/array/Array>#join (; 292 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#join_arr + local.set $2 + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + return + ) + (func $~lib/array/Array<~lib/array/Array>#toString (; 293 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 4512 + call $~lib/array/Array<~lib/array/Array>#join + ) + (func $~lib/array/Array<~lib/array/Array>#join_arr (; 294 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.load offset=12 + i32.const 1 + i32.sub + local.set $2 + local.get $2 i32.const 0 - i32.ne - global.set $std/array/includes - global.get $std/array/includes - i32.const 1 - i32.eq - i32.eqz + i32.lt_s if - i32.const 0 - i32.const 120 - i32.const 314 - i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#includes|inlined.7 (result i32) - global.get $std/array/arr - local.set $2 - i32.const 43 - local.set $1 - i32.const 0 - local.set $0 - local.get $2 + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $3 local.get $1 - local.get $0 - call $~lib/array/Array#indexOf - i32.const 0 - i32.ge_s + call $~lib/rt/pure/__release + local.get $3 + return end + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $4 + local.get $1 + call $~lib/string/String#get:length + local.set $5 + local.get $0 + i32.load offset=4 + local.set $6 i32.const 0 - i32.ne - global.set $std/array/includes - global.get $std/array/includes - i32.const 1 - i32.eq + local.set $7 + local.get $2 i32.eqz if - i32.const 0 - i32.const 120 - i32.const 318 - i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#includes|inlined.8 (result i32) - global.get $std/array/arr - local.set $0 - i32.const 43 - local.set $1 - i32.const 1 - local.set $2 - local.get $0 + block (result i32) + local.get $6 + i32.load + local.tee $3 + local.get $7 + local.tee $8 + i32.ne + if + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $8 + call $~lib/rt/pure/__release + end + local.get $3 + end + local.set $7 + local.get $7 + if (result i32) + local.get $7 + local.get $1 + call $~lib/array/Array#join + else + i32.const 4248 + call $~lib/rt/pure/__retain + end + local.set $3 local.get $1 - local.get $2 - call $~lib/array/Array#indexOf - i32.const 0 - i32.ge_s + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release + local.get $3 + return end - i32.const 0 - i32.ne - global.set $std/array/includes - global.get $std/array/includes - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 322 + block $break|0 i32.const 0 - call $~lib/env/abort + local.set $3 + loop $repeat|0 + local.get $3 + local.get $2 + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + local.get $6 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load + local.tee $8 + local.get $7 + local.tee $9 + i32.ne + if + local.get $8 + call $~lib/rt/pure/__retain + drop + local.get $9 + call $~lib/rt/pure/__release + end + local.get $8 + end + local.set $7 + local.get $7 + if + block (result i32) + local.get $4 + local.get $7 + local.get $1 + call $~lib/array/Array#join + local.tee $8 + call $~lib/string/String.__concat + local.tee $9 + local.tee $10 + local.get $4 + local.tee $11 + i32.ne + if + local.get $10 + call $~lib/rt/pure/__retain + drop + local.get $11 + call $~lib/rt/pure/__release + end + local.get $10 + end + local.set $4 + local.get $8 + call $~lib/rt/pure/__release + local.get $9 + call $~lib/rt/pure/__release + end + local.get $5 + if + block (result i32) + local.get $4 + local.get $1 + call $~lib/string/String.__concat + local.tee $9 + local.tee $11 + local.get $4 + local.tee $8 + i32.ne + if + local.get $11 + call $~lib/rt/pure/__retain + drop + local.get $8 + call $~lib/rt/pure/__release + end + local.get $11 + end + local.set $4 + local.get $9 + call $~lib/rt/pure/__release + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end unreachable end - block $~lib/array/Array#includes|inlined.9 (result i32) - global.get $std/array/arr - local.set $2 - i32.const 43 - local.set $1 - i32.const 2 - local.set $0 + block (result i32) + local.get $6 local.get $2 - local.get $1 - local.get $0 - call $~lib/array/Array#indexOf - i32.const 0 - i32.ge_s + i32.const 2 + i32.shl + i32.add + i32.load + local.tee $10 + local.get $7 + local.tee $3 + i32.ne + if + local.get $10 + call $~lib/rt/pure/__retain + drop + local.get $3 + call $~lib/rt/pure/__release + end + local.get $10 end - i32.const 0 - i32.ne - global.set $std/array/includes - global.get $std/array/includes - i32.const 1 - i32.eq - i32.eqz + local.set $7 + local.get $7 if - i32.const 0 - i32.const 120 - i32.const 326 - i32.const 0 - call $~lib/env/abort - unreachable + block (result i32) + local.get $4 + local.get $7 + local.get $1 + call $~lib/array/Array#join + local.tee $10 + call $~lib/string/String.__concat + local.tee $3 + local.tee $8 + local.get $4 + local.tee $9 + i32.ne + if + local.get $8 + call $~lib/rt/pure/__retain + drop + local.get $9 + call $~lib/rt/pure/__release + end + local.get $8 + end + local.set $4 + local.get $10 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release end - global.get $std/array/arr - i32.const 1 - i32.const 1 - call $~lib/array/Array#splice + local.get $4 + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $~lib/array/Array<~lib/array/Array>#join (; 295 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/pure/__retain drop - block $~lib/array/Array#get:length|inlined.23 (result i32) - global.get $std/array/arr - local.set $0 - local.get $0 - i32.load offset=4 - end - i32.const 4 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 330 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - call $std/array/internalCapacity - i32.const 5 - i32.eq - i32.eqz + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#join_arr + local.set $2 + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + return + ) + (func $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#join_arr (; 296 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.load offset=12 + i32.const 1 + i32.sub + local.set $2 + local.get $2 + i32.const 0 + i32.lt_s if - i32.const 0 - i32.const 120 - i32.const 331 - i32.const 0 - call $~lib/env/abort - unreachable + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + return end - global.get $std/array/arr + i32.const 4248 + call $~lib/rt/pure/__retain + local.set $4 + local.get $1 + call $~lib/string/String#get:length + local.set $5 + local.get $0 + i32.load offset=4 + local.set $6 i32.const 0 - call $~lib/array/Array#__get - i32.const 44 - i32.eq + local.set $7 + local.get $2 i32.eqz if - i32.const 0 - i32.const 120 - i32.const 332 - i32.const 0 - call $~lib/env/abort - unreachable + block (result i32) + local.get $6 + i32.load + local.tee $3 + local.get $7 + local.tee $8 + i32.ne + if + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $8 + call $~lib/rt/pure/__release + end + local.get $3 + end + local.set $7 + local.get $7 + if (result i32) + local.get $7 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#join + else + i32.const 4248 + call $~lib/rt/pure/__retain + end + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release + local.get $3 + return end - global.get $std/array/arr - i32.const 1 - call $~lib/array/Array#__get - i32.const 42 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 333 + block $break|0 i32.const 0 - call $~lib/env/abort + local.set $3 + loop $repeat|0 + local.get $3 + local.get $2 + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + local.get $6 + local.get $3 + i32.const 2 + i32.shl + i32.add + i32.load + local.tee $8 + local.get $7 + local.tee $9 + i32.ne + if + local.get $8 + call $~lib/rt/pure/__retain + drop + local.get $9 + call $~lib/rt/pure/__release + end + local.get $8 + end + local.set $7 + local.get $7 + if + block (result i32) + local.get $4 + local.get $7 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#join + local.tee $8 + call $~lib/string/String.__concat + local.tee $9 + local.tee $10 + local.get $4 + local.tee $11 + i32.ne + if + local.get $10 + call $~lib/rt/pure/__retain + drop + local.get $11 + call $~lib/rt/pure/__release + end + local.get $10 + end + local.set $4 + local.get $8 + call $~lib/rt/pure/__release + local.get $9 + call $~lib/rt/pure/__release + end + local.get $5 + if + block (result i32) + local.get $4 + local.get $1 + call $~lib/string/String.__concat + local.tee $9 + local.tee $11 + local.get $4 + local.tee $8 + i32.ne + if + local.get $11 + call $~lib/rt/pure/__retain + drop + local.get $8 + call $~lib/rt/pure/__release + end + local.get $11 + end + local.set $4 + local.get $9 + call $~lib/rt/pure/__release + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end unreachable end block (result i32) - i32.const 1 - global.set $~lib/argc - global.get $std/array/sarr - i32.const 0 - i32.const 0 - call $~lib/array/Array#splice|trampoline + local.get $6 + local.get $2 + i32.const 2 + i32.shl + i32.add + i32.load + local.tee $10 + local.get $7 + local.tee $3 + i32.ne + if + local.get $10 + call $~lib/rt/pure/__retain + drop + local.get $3 + call $~lib/rt/pure/__release + end + local.get $10 end - i32.const 1664 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz + local.set $7 + local.get $7 if - i32.const 0 - i32.const 120 - i32.const 338 - i32.const 0 - call $~lib/env/abort - unreachable + block (result i32) + local.get $4 + local.get $7 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#join + local.tee $10 + call $~lib/string/String.__concat + local.tee $3 + local.tee $8 + local.get $4 + local.tee $9 + i32.ne + if + local.get $8 + call $~lib/rt/pure/__retain + drop + local.get $9 + call $~lib/rt/pure/__release + end + local.get $8 + end + local.set $4 + local.get $10 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release end - global.get $std/array/sarr - i32.const 1680 + local.get $4 + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#join (; 297 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#join_arr + local.set $2 + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + return + ) + (func $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#toString (; 298 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 4512 + call $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#join + ) + (func $start:std/array (; 299 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + (local $14 i32) + (local $15 i32) + (local $16 i32) + (local $17 i32) + (local $18 i32) + (local $19 i32) + (local $20 i32) + (local $21 i32) + (local $22 i32) + (local $23 i32) + (local $24 i32) + (local $25 i32) + (local $26 i32) + (local $27 i32) + (local $28 i32) + (local $29 i32) + (local $30 i32) + (local $31 i32) + (local $32 i32) + (local $33 i32) + (local $34 i32) + (local $35 i32) + (local $36 i32) + (local $37 i32) + (local $38 i32) + (local $39 i32) + (local $40 i32) + (local $41 i32) + (local $42 i32) + (local $43 i32) + (local $44 i32) + (local $45 i32) + (local $46 i32) + (local $47 i32) + (local $48 i32) + (local $49 i32) + (local $50 i32) + (local $51 i32) + (local $52 i32) + (local $53 i32) + (local $54 i32) + (local $55 i32) + (local $56 i32) i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if + i32.const 0 + call $~lib/array/Array#constructor + global.set $std/array/arr + block i32.const 0 - i32.const 120 - i32.const 339 + call $~lib/array/Array.isArray<~lib/array/Array | null> i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 1720 - global.set $std/array/sarr - block (result i32) + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 35 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array.isArray<~lib/array/Array> i32.const 1 - global.set $~lib/argc - global.get $std/array/sarr - i32.const 2 - i32.const 0 - call $~lib/array/Array#splice|trampoline - end - i32.const 1760 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 36 + i32.const 2 + call $~lib/builtins/abort + unreachable + end i32.const 0 - i32.const 120 - i32.const 342 + call $std/array/P#constructor + local.tee $0 + call $~lib/array/Array.isArray i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/sarr - i32.const 1784 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 37 + i32.const 2 + call $~lib/builtins/abort + unreachable + end i32.const 0 - i32.const 120 - i32.const 343 + i32.const 1 + call $~lib/typedarray/Uint8Array#constructor + local.tee $1 + call $~lib/array/Array.isArray<~lib/typedarray/Uint8Array> i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 1824 - global.set $std/array/sarr - global.get $std/array/sarr - i32.const 2 - i32.const 2 - call $~lib/array/Array#splice - i32.const 1848 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 38 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 1 + call $~lib/array/Array.isArray i32.const 0 - i32.const 120 - i32.const 346 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 39 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 416 + call $~lib/array/Array.isArray<~lib/string/String> i32.const 0 - call $~lib/env/abort - unreachable + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 40 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release end - global.get $std/array/sarr - i32.const 1888 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if + block + i32.const 5 + i32.const 0 + i32.const 6 + i32.const 440 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 + i32.const 1 + i32.const 1 + i32.const 3 + call $~lib/array/Array#fill + call $~lib/rt/pure/__release + local.get $1 + i32.const 5 i32.const 0 - i32.const 120 - i32.const 347 + i32.const 6 + i32.const 464 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $3 i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 1928 - global.set $std/array/sarr - global.get $std/array/sarr - i32.const 0 - i32.const 1 - call $~lib/array/Array#splice - i32.const 1952 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 48 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 i32.const 0 - i32.const 120 - i32.const 350 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/sarr - i32.const 1992 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#fill + call $~lib/rt/pure/__release + local.get $1 + i32.const 5 i32.const 0 - i32.const 120 - i32.const 351 + i32.const 6 + i32.const 536 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $4 i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 2032 - global.set $std/array/sarr - block (result i32) + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 51 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 i32.const 1 - global.set $~lib/argc - global.get $std/array/sarr - i32.const -1 i32.const 0 - call $~lib/array/Array#splice|trampoline - end - i32.const 2056 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if + i32.const -3 + call $~lib/array/Array#fill + call $~lib/rt/pure/__release + local.get $1 + i32.const 5 i32.const 0 - i32.const 120 - i32.const 354 + i32.const 6 + i32.const 560 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $5 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/sarr - i32.const 2096 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 54 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 2 + i32.const -2 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#fill + call $~lib/rt/pure/__release + local.get $1 + i32.const 5 i32.const 0 - i32.const 120 - i32.const 355 + i32.const 6 + i32.const 584 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $6 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 57 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 2136 - global.set $std/array/sarr - block (result i32) i32.const 1 - global.set $~lib/argc - global.get $std/array/sarr - i32.const -2 i32.const 0 - call $~lib/array/Array#splice|trampoline - end - i32.const 2160 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if + call $~lib/array/Array#fill + call $~lib/rt/pure/__release + local.get $1 + i32.const 5 i32.const 0 - i32.const 120 - i32.const 358 + i32.const 6 + i32.const 608 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $7 i32.const 0 - call $~lib/env/abort - unreachable + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 60 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release end - global.get $std/array/sarr - i32.const 2200 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if + block + i32.const 5 + i32.const 2 + i32.const 7 + i32.const 632 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $6 + call $~lib/rt/pure/__retain + local.set $7 + local.get $7 + i32.const 1 + i32.const 1 + i32.const 3 + call $~lib/array/Array#fill + call $~lib/rt/pure/__release + local.get $7 + i32.const 5 + i32.const 2 + i32.const 7 + i32.const 672 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $4 i32.const 0 - i32.const 120 - i32.const 359 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 67 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $7 i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 2240 - global.set $std/array/sarr - global.get $std/array/sarr - i32.const -2 - i32.const 1 - call $~lib/array/Array#splice - i32.const 2264 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if i32.const 0 - i32.const 120 - i32.const 362 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#fill + call $~lib/rt/pure/__release + local.get $7 + i32.const 5 + i32.const 2 + i32.const 7 + i32.const 712 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $3 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/sarr - i32.const 2304 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 70 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $7 + i32.const 1 i32.const 0 - i32.const 120 - i32.const 363 + i32.const -3 + call $~lib/array/Array#fill + call $~lib/rt/pure/__release + local.get $7 + i32.const 5 + i32.const 2 + i32.const 7 + i32.const 752 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $1 i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 2344 - global.set $std/array/sarr - global.get $std/array/sarr - i32.const -7 - i32.const 1 - call $~lib/array/Array#splice - i32.const 2368 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 73 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $7 + i32.const 2 + i32.const -2 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#fill + call $~lib/rt/pure/__release + local.get $7 + i32.const 5 + i32.const 2 + i32.const 7 + i32.const 792 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $0 i32.const 0 - i32.const 120 - i32.const 366 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 76 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $7 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/sarr - i32.const 2408 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if + i32.const 1 i32.const 0 - i32.const 120 - i32.const 367 + call $~lib/array/Array#fill + call $~lib/rt/pure/__release + local.get $7 + i32.const 5 + i32.const 2 + i32.const 7 + i32.const 832 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $2 i32.const 0 - call $~lib/env/abort - unreachable + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 79 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $6 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release end - i32.const 2448 - global.set $std/array/sarr - global.get $std/array/sarr - i32.const -2 - i32.const -1 - call $~lib/array/Array#splice - i32.const 2464 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if + block + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 85 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity i32.const 0 - i32.const 120 - i32.const 370 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 86 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 42 + call $~lib/array/Array#push + drop + global.get $std/array/arr i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/sarr - i32.const 2504 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if + call $~lib/array/Array#__get + i32.const 42 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 90 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 91 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 92 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#pop + local.set $2 + local.get $2 + i32.const 42 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 96 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length i32.const 0 - i32.const 120 - i32.const 371 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 97 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 98 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + call $~lib/array/Array#push + drop + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 102 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 103 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 2544 - global.set $std/array/sarr - global.get $std/array/sarr - i32.const 1 - i32.const -2 - call $~lib/array/Array#splice - i32.const 2560 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if + call $~lib/array/Array#__get + i32.const 43 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 44 + call $~lib/array/Array#push + drop + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 108 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 109 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr i32.const 0 - i32.const 120 - i32.const 374 + call $~lib/array/Array#__get + i32.const 43 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 110 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 1 + call $~lib/array/Array#__get + i32.const 44 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 111 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 45 + call $~lib/array/Array#push + drop + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 115 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 116 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr i32.const 0 - call $~lib/env/abort - unreachable + call $~lib/array/Array#__get + i32.const 43 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 117 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 1 + call $~lib/array/Array#__get + i32.const 44 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 118 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#__get + i32.const 45 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 119 + i32.const 2 + call $~lib/builtins/abort + unreachable + end end - global.get $std/array/sarr - i32.const 2600 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if + block i32.const 0 - i32.const 120 - i32.const 375 i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 2640 - global.set $std/array/sarr - global.get $std/array/sarr - i32.const 4 - i32.const 0 - call $~lib/array/Array#splice - i32.const 2656 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if + call $~lib/array/Array#constructor + local.set $2 + global.get $std/array/arr + local.get $2 + call $~lib/array/Array#concat + local.set $0 + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 128 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 129 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/array/Array#get:length + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 130 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 i32.const 0 - i32.const 120 - i32.const 378 + i32.const 2 + i32.const 3 + i32.const 920 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $3 + call $~lib/array/Array#concat + call $~lib/rt/pure/__release + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 133 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/sarr - i32.const 2696 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if + call $~lib/array/Array#__get + i32.const 43 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 135 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 1 + call $~lib/array/Array#__get + i32.const 44 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 136 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 2 + call $~lib/array/Array#__get + i32.const 45 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 137 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 46 + call $~lib/array/Array#push + drop + local.get $2 + i32.const 47 + call $~lib/array/Array#push + drop + block (result i32) + global.get $std/array/arr + local.get $2 + call $~lib/array/Array#concat + local.set $5 + local.get $0 + call $~lib/rt/pure/__release + local.get $5 + end + local.set $0 + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 144 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $2 + call $~lib/array/Array#get:length + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 145 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/array/Array#get:length + i32.const 5 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 146 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 i32.const 0 - i32.const 120 - i32.const 379 + call $~lib/array/Array#__get + i32.const 43 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 147 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 1 + call $~lib/array/Array#__get + i32.const 44 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 148 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 2 + call $~lib/array/Array#__get + i32.const 45 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 149 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 3 + call $~lib/array/Array#__get + i32.const 46 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 150 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 4 + call $~lib/array/Array#__get + i32.const 47 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 151 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/array/Array#pop + drop + local.get $0 + call $~lib/array/Array#get:length + i32.const 4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 154 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + global.get $std/array/arr + i32.const 0 + call $~lib/array/Array#concat + local.set $6 + local.get $0 + call $~lib/rt/pure/__release + local.get $6 + end + local.set $0 + local.get $0 + call $~lib/array/Array#get:length + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 157 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 2 + call $~lib/array/Array#__get + i32.const 45 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 158 + i32.const 2 + call $~lib/builtins/abort + unreachable + end i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 2736 - global.set $std/array/sarr - global.get $std/array/sarr - i32.const 7 - i32.const 0 - call $~lib/array/Array#splice - i32.const 2752 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if + i32.const 2 + i32.const 3 + i32.const 936 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $5 + call $~lib/rt/pure/__retain + local.set $6 + local.get $6 + call $~lib/array/Array#get:length i32.const 0 - i32.const 120 - i32.const 382 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 161 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + local.get $6 + global.get $std/array/arr + call $~lib/array/Array#concat + local.set $7 + local.get $0 + call $~lib/rt/pure/__release + local.get $7 + end + local.set $0 + local.get $0 + call $~lib/array/Array#get:length + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 163 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $6 + call $~lib/array/Array#get:length i32.const 0 - call $~lib/env/abort - unreachable + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 164 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release end - global.get $std/array/sarr - i32.const 2792 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 383 + block i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 2832 - global.set $std/array/sarr - global.get $std/array/sarr - i32.const 7 - i32.const 5 - call $~lib/array/Array#splice - i32.const 2848 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if + local.set $6 + block (result i32) + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 952 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $3 + local.tee $4 + local.get $6 + local.tee $5 + i32.ne + if + local.get $4 + call $~lib/rt/pure/__retain + drop + local.get $5 + call $~lib/rt/pure/__release + end + local.get $4 + end + local.set $6 + local.get $6 i32.const 0 - i32.const 120 - i32.const 386 + i32.const 3 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#copyWithin + local.tee $4 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 992 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $0 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/sarr - i32.const 2888 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 172 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1032 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $2 + local.tee $1 + local.get $6 + local.tee $5 + i32.ne + if + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $5 + call $~lib/rt/pure/__release + end + local.get $1 + end + local.set $6 + local.get $6 + i32.const 1 + i32.const 3 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#copyWithin + local.tee $1 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1072 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $7 i32.const 0 - i32.const 120 - i32.const 387 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 174 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1112 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $8 + local.tee $5 + local.get $6 + local.tee $9 + i32.ne + if + local.get $5 + call $~lib/rt/pure/__retain + drop + local.get $9 + call $~lib/rt/pure/__release + end + local.get $5 + end + local.set $6 + local.get $6 + i32.const 1 + i32.const 2 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#copyWithin + local.tee $5 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1152 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $10 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - i32.const 0 - i32.const 0 - call $~lib/array/Array#__set - global.get $std/array/arr - i32.const 1 - i32.const 1 - call $~lib/array/Array#__set - global.get $std/array/arr - i32.const 2 - i32.const 2 - call $~lib/array/Array#__set - global.get $std/array/arr - i32.const 3 - i32.const 3 - call $~lib/array/Array#__set - global.get $std/array/arr - i32.const 1 - call $~lib/array/Array#findIndex - global.set $std/array/i - global.get $std/array/i - i32.const 0 - i32.eq - i32.eqz - if + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 176 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1192 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $11 + local.tee $9 + local.get $6 + local.tee $12 + i32.ne + if + local.get $9 + call $~lib/rt/pure/__retain + drop + local.get $12 + call $~lib/rt/pure/__release + end + local.get $9 + end + local.set $6 + local.get $6 + i32.const 2 + i32.const 2 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#copyWithin + local.tee $9 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1232 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $13 i32.const 0 - i32.const 120 - i32.const 397 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 178 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1272 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $14 + local.tee $12 + local.get $6 + local.tee $15 + i32.ne + if + local.get $12 + call $~lib/rt/pure/__retain + drop + local.get $15 + call $~lib/rt/pure/__release + end + local.get $12 + end + local.set $6 + local.get $6 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#findIndex - global.set $std/array/i - global.get $std/array/i - i32.const 1 - i32.eq - i32.eqz - if + i32.const 3 + i32.const 4 + call $~lib/array/Array#copyWithin + local.tee $12 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1312 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $16 i32.const 0 - i32.const 120 - i32.const 400 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 180 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1352 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $17 + local.tee $15 + local.get $6 + local.tee $18 + i32.ne + if + local.get $15 + call $~lib/rt/pure/__retain + drop + local.get $18 + call $~lib/rt/pure/__release + end + local.get $15 + end + local.set $6 + local.get $6 + i32.const 1 + i32.const 3 + i32.const 4 + call $~lib/array/Array#copyWithin + local.tee $15 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1392 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $19 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#findIndex - global.set $std/array/i - global.get $std/array/i - i32.const -1 - i32.eq - i32.eqz - if + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 182 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1432 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $20 + local.tee $18 + local.get $6 + local.tee $21 + i32.ne + if + local.get $18 + call $~lib/rt/pure/__retain + drop + local.get $21 + call $~lib/rt/pure/__release + end + local.get $18 + end + local.set $6 + local.get $6 + i32.const 1 + i32.const 2 + i32.const 4 + call $~lib/array/Array#copyWithin + local.tee $18 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1472 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $22 i32.const 0 - i32.const 120 - i32.const 403 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 184 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1512 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $23 + local.tee $21 + local.get $6 + local.tee $24 + i32.ne + if + local.get $21 + call $~lib/rt/pure/__retain + drop + local.get $24 + call $~lib/rt/pure/__release + end + local.get $21 + end + local.set $6 + local.get $6 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - i32.const 4 - call $~lib/array/Array#findIndex - global.set $std/array/i - global.get $std/array/i - i32.const -1 - i32.eq - i32.eqz - if + i32.const -2 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#copyWithin + local.tee $21 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1552 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $25 i32.const 0 - i32.const 120 - i32.const 411 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 186 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1592 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $26 + local.tee $24 + local.get $6 + local.tee $27 + i32.ne + if + local.get $24 + call $~lib/rt/pure/__retain + drop + local.get $27 + call $~lib/rt/pure/__release + end + local.get $24 + end + local.set $6 + local.get $6 i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#get:length|inlined.24 (result i32) - global.get $std/array/arr - local.set $0 - local.get $0 - i32.load offset=4 - end - i32.const 8 - i32.eq - i32.eqz - if + i32.const -2 + i32.const -1 + call $~lib/array/Array#copyWithin + local.tee $24 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1632 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $28 i32.const 0 - i32.const 120 - i32.const 412 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 188 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1672 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $29 + local.tee $27 + local.get $6 + local.tee $30 + i32.ne + if + local.get $27 + call $~lib/rt/pure/__retain + drop + local.get $30 + call $~lib/rt/pure/__release + end + local.get $27 + end + local.set $6 + local.get $6 + i32.const -4 + i32.const -3 + i32.const -2 + call $~lib/array/Array#copyWithin + local.tee $27 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1712 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $31 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - i32.const 5 - call $~lib/array/Array#findIndex - global.set $std/array/i - global.get $std/array/i - i32.const -1 - i32.ne - i32.eqz - if + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 190 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1752 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $32 + local.tee $30 + local.get $6 + local.tee $33 + i32.ne + if + local.get $30 + call $~lib/rt/pure/__retain + drop + local.get $33 + call $~lib/rt/pure/__release + end + local.get $30 + end + local.set $6 + local.get $6 + i32.const -4 + i32.const -3 + i32.const -1 + call $~lib/array/Array#copyWithin + local.tee $30 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1792 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $34 i32.const 0 - i32.const 120 - i32.const 414 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 192 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1832 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $35 + local.tee $33 + local.get $6 + local.tee $36 + i32.ne + if + local.get $33 + call $~lib/rt/pure/__retain + drop + local.get $36 + call $~lib/rt/pure/__release + end + local.get $33 + end + local.set $6 + local.get $6 + i32.const -4 + i32.const -3 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#copyWithin + local.tee $33 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1872 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $37 i32.const 0 - call $~lib/env/abort - unreachable + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 194 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $6 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release + local.get $8 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $10 + call $~lib/rt/pure/__release + local.get $11 + call $~lib/rt/pure/__release + local.get $9 + call $~lib/rt/pure/__release + local.get $13 + call $~lib/rt/pure/__release + local.get $14 + call $~lib/rt/pure/__release + local.get $12 + call $~lib/rt/pure/__release + local.get $16 + call $~lib/rt/pure/__release + local.get $17 + call $~lib/rt/pure/__release + local.get $15 + call $~lib/rt/pure/__release + local.get $19 + call $~lib/rt/pure/__release + local.get $20 + call $~lib/rt/pure/__release + local.get $18 + call $~lib/rt/pure/__release + local.get $22 + call $~lib/rt/pure/__release + local.get $23 + call $~lib/rt/pure/__release + local.get $21 + call $~lib/rt/pure/__release + local.get $25 + call $~lib/rt/pure/__release + local.get $26 + call $~lib/rt/pure/__release + local.get $24 + call $~lib/rt/pure/__release + local.get $28 + call $~lib/rt/pure/__release + local.get $29 + call $~lib/rt/pure/__release + local.get $27 + call $~lib/rt/pure/__release + local.get $31 + call $~lib/rt/pure/__release + local.get $32 + call $~lib/rt/pure/__release + local.get $30 + call $~lib/rt/pure/__release + local.get $34 + call $~lib/rt/pure/__release + local.get $35 + call $~lib/rt/pure/__release + local.get $33 + call $~lib/rt/pure/__release + local.get $37 + call $~lib/rt/pure/__release end - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - i32.const 6 - call $~lib/array/Array#findIndex - global.set $std/array/i - global.get $std/array/i - i32.const -1 - i32.eq - i32.eqz - if + block + global.get $std/array/arr + i32.const 42 + call $~lib/array/Array#unshift + drop + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 202 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 203 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr i32.const 0 - i32.const 120 - i32.const 427 + call $~lib/array/Array#__get + i32.const 42 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 204 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 1 + call $~lib/array/Array#__get + i32.const 43 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 205 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#__get + i32.const 44 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 206 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#__get + i32.const 45 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 207 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 41 + call $~lib/array/Array#unshift + drop + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 5 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 211 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 5 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 212 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr i32.const 0 - call $~lib/env/abort - unreachable + call $~lib/array/Array#__get + i32.const 41 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 213 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 1 + call $~lib/array/Array#__get + i32.const 42 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 214 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#__get + i32.const 43 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 215 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#__get + i32.const 44 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 216 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 4 + call $~lib/array/Array#__get + i32.const 45 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 217 + i32.const 2 + call $~lib/builtins/abort + unreachable + end end - block $~lib/array/Array#get:length|inlined.25 (result i32) + block + global.get $std/array/arr + call $~lib/array/Array#shift + global.set $std/array/i + global.get $std/array/i + i32.const 41 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 226 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 227 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 5 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 228 + i32.const 2 + call $~lib/builtins/abort + unreachable + end global.get $std/array/arr - local.set $0 - local.get $0 - i32.load offset=4 - end - i32.const 2 - i32.eq - i32.eqz - if i32.const 0 - i32.const 120 - i32.const 428 + call $~lib/array/Array#__get + i32.const 42 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 229 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 1 + call $~lib/array/Array#__get + i32.const 43 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 230 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#__get + i32.const 44 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 231 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#__get + i32.const 45 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 232 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#pop + global.set $std/array/i + global.get $std/array/i + i32.const 45 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 236 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 237 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 5 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 238 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr i32.const 0 - call $~lib/env/abort - unreachable + call $~lib/array/Array#__get + i32.const 42 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 239 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 1 + call $~lib/array/Array#__get + i32.const 43 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 240 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#__get + i32.const 44 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 241 + i32.const 2 + call $~lib/builtins/abort + unreachable + end end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 7 - call $~lib/array/Array#every - global.set $std/array/every - global.get $std/array/every - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 436 + block + global.get $std/array/arr + call $~lib/array/Array#reverse + call $~lib/rt/pure/__release + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 249 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 5 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 250 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr i32.const 0 - call $~lib/env/abort - unreachable + call $~lib/array/Array#__get + i32.const 44 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 251 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 1 + call $~lib/array/Array#__get + i32.const 43 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 252 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#__get + i32.const 42 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 253 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 44 + call $~lib/array/Array#push + drop end - global.get $std/array/arr - i32.const 8 - call $~lib/array/Array#every - global.set $std/array/every - global.get $std/array/every - i32.const 0 - i32.eq - i32.eqz - if + block + global.get $std/array/arr + i32.const 44 i32.const 0 - i32.const 120 - i32.const 439 + call $~lib/array/Array#indexOf + global.set $std/array/i + global.get $std/array/i i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - i32.const 9 - call $~lib/array/Array#every - global.set $std/array/every - global.get $std/array/every - i32.const 1 - i32.eq - i32.eqz - if + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 263 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 42 i32.const 0 - i32.const 120 - i32.const 447 + call $~lib/array/Array#indexOf + global.set $std/array/i + global.get $std/array/i + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 266 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 45 i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#get:length|inlined.26 (result i32) + call $~lib/array/Array#indexOf + global.set $std/array/i + global.get $std/array/i + i32.const -1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 269 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const 100 + call $~lib/array/Array#indexOf + global.set $std/array/i + global.get $std/array/i + i32.const -1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 272 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const -100 + call $~lib/array/Array#indexOf + global.set $std/array/i + global.get $std/array/i + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 275 + i32.const 2 + call $~lib/builtins/abort + unreachable + end global.get $std/array/arr - local.set $0 - local.get $0 - i32.load offset=4 - end - i32.const 8 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 448 + i32.const 43 + i32.const -2 + call $~lib/array/Array#indexOf + global.set $std/array/i + global.get $std/array/i + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 278 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const -4 + call $~lib/array/Array#indexOf + global.set $std/array/i + global.get $std/array/i + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 281 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 i32.const 0 - call $~lib/env/abort - unreachable + call $~lib/array/Array#indexOf + global.set $std/array/i + global.get $std/array/i + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 284 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const 1 + call $~lib/array/Array#indexOf + global.set $std/array/i + global.get $std/array/i + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 287 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const 2 + call $~lib/array/Array#indexOf + global.set $std/array/i + global.get $std/array/i + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 290 + i32.const 2 + call $~lib/builtins/abort + unreachable + end end - global.get $std/array/arr - i32.const 10 - call $~lib/array/Array#every - global.set $std/array/every - global.get $std/array/every - i32.const 0 - i32.eq - i32.eqz - if + block + global.get $std/array/arr + i32.const 44 i32.const 0 - i32.const 120 - i32.const 450 + call $~lib/array/Array#includes + local.set $37 + local.get $37 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 297 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 42 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - i32.const 11 - call $~lib/array/Array#every - global.set $std/array/every - global.get $std/array/every - i32.const 1 - i32.eq - i32.eqz - if + call $~lib/array/Array#includes + local.set $37 + local.get $37 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 300 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 45 i32.const 0 - i32.const 120 - i32.const 463 + call $~lib/array/Array#includes + local.set $37 + local.get $37 i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#get:length|inlined.27 (result i32) + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 303 + i32.const 2 + call $~lib/builtins/abort + unreachable + end global.get $std/array/arr - local.set $0 - local.get $0 - i32.load offset=4 - end - i32.const 2 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 464 + i32.const 43 + i32.const 100 + call $~lib/array/Array#includes + local.set $37 + local.get $37 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 12 - call $~lib/array/Array#some - global.set $std/array/some - global.get $std/array/some - i32.const 1 - i32.eq - i32.eqz - if + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 306 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const -100 + call $~lib/array/Array#includes + local.set $37 + local.get $37 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 309 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const -2 + call $~lib/array/Array#includes + local.set $37 + local.get $37 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 312 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const -4 + call $~lib/array/Array#includes + local.set $37 + local.get $37 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 315 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 i32.const 0 - i32.const 120 - i32.const 472 + call $~lib/array/Array#includes + local.set $37 + local.get $37 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 318 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const 1 + call $~lib/array/Array#includes + local.set $37 + local.get $37 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 321 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 43 + i32.const 2 + call $~lib/array/Array#includes + local.set $37 + local.get $37 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 324 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 1 + i32.const 1 + call $~lib/array/Array#splice + call $~lib/rt/pure/__release + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 328 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $std/array/internalCapacity + i32.const 5 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 329 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr i32.const 0 - call $~lib/env/abort - unreachable + call $~lib/array/Array#__get + i32.const 44 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 330 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 1 + call $~lib/array/Array#__get + i32.const 42 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 331 + i32.const 2 + call $~lib/builtins/abort + unreachable + end end - global.get $std/array/arr - i32.const 13 - call $~lib/array/Array#some - global.set $std/array/some - global.get $std/array/some - i32.const 0 - i32.eq - i32.eqz - if + block + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1912 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $33 + call $~lib/rt/pure/__retain + local.set $37 + local.get $37 i32.const 0 - i32.const 120 - i32.const 475 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#splice + local.tee $35 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 1952 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $30 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - i32.const 14 - call $~lib/array/Array#some - global.set $std/array/some - global.get $std/array/some - i32.const 0 - i32.eq - i32.eqz - if + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 338 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 i32.const 0 - i32.const 120 - i32.const 483 + i32.const 2 + i32.const 3 + i32.const 1992 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $32 i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#get:length|inlined.28 (result i32) - global.get $std/array/arr - local.set $0 - local.get $0 - i32.load offset=4 - end - i32.const 8 - i32.eq - i32.eqz - if + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 339 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 2008 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $31 + local.tee $36 + local.get $37 + local.tee $34 + i32.ne + if + local.get $36 + call $~lib/rt/pure/__retain + drop + local.get $34 + call $~lib/rt/pure/__release + end + local.get $36 + end + local.set $37 + local.get $37 + i32.const 2 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#splice + local.tee $36 + i32.const 3 + i32.const 2 + i32.const 3 + i32.const 2048 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $27 i32.const 0 - i32.const 120 - i32.const 484 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 342 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 2 + i32.const 2 + i32.const 3 + i32.const 2080 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $29 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - i32.const 15 - call $~lib/array/Array#some - global.set $std/array/some - global.get $std/array/some - i32.const 1 - i32.eq - i32.eqz - if + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 343 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 2104 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $28 + local.tee $6 + local.get $37 + local.tee $34 + i32.ne + if + local.get $6 + call $~lib/rt/pure/__retain + drop + local.get $34 + call $~lib/rt/pure/__release + end + local.get $6 + end + local.set $37 + local.get $37 + i32.const 2 + i32.const 2 + call $~lib/array/Array#splice + local.tee $6 + i32.const 2 + i32.const 2 + i32.const 3 + i32.const 2144 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $24 i32.const 0 - i32.const 120 - i32.const 486 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 346 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 3 + i32.const 2 + i32.const 3 + i32.const 2168 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $26 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - i32.const 16 - call $~lib/array/Array#some - global.set $std/array/some - global.get $std/array/some - i32.const 0 - i32.eq - i32.eqz - if + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 347 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 2200 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $25 + local.tee $3 + local.get $37 + local.tee $34 + i32.ne + if + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $34 + call $~lib/rt/pure/__release + end + local.get $3 + end + local.set $37 + local.get $37 i32.const 0 - i32.const 120 - i32.const 499 + i32.const 1 + call $~lib/array/Array#splice + local.tee $3 + i32.const 1 + i32.const 2 + i32.const 3 + i32.const 2240 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $21 i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#get:length|inlined.29 (result i32) - global.get $std/array/arr - local.set $0 - local.get $0 - i32.load offset=4 - end - i32.const 2 - i32.eq - i32.eqz - if + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 350 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 4 + i32.const 2 + i32.const 3 + i32.const 2264 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $23 + i32.const 0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 351 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 2296 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $22 + local.tee $4 + local.get $37 + local.tee $34 + i32.ne + if + local.get $4 + call $~lib/rt/pure/__retain + drop + local.get $34 + call $~lib/rt/pure/__release + end + local.get $4 + end + local.set $37 + local.get $37 + i32.const -1 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#splice + local.tee $4 + i32.const 1 + i32.const 2 + i32.const 3 + i32.const 2336 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $18 i32.const 0 - i32.const 120 - i32.const 500 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 354 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 4 + i32.const 2 + i32.const 3 + i32.const 2360 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $20 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#push - drop - i32.const 0 - global.set $std/array/i - global.get $std/array/arr - i32.const 17 - call $~lib/array/Array#forEach - global.get $std/array/i - i32.const 6 - i32.eq - i32.eqz - if + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 355 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 2392 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $19 + local.tee $0 + local.get $37 + local.tee $34 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $34 + call $~lib/rt/pure/__release + end + local.get $0 + end + local.set $37 + local.get $37 + i32.const -2 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/array/Array#splice + local.tee $0 + i32.const 2 + i32.const 2 + i32.const 3 + i32.const 2432 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $15 i32.const 0 - i32.const 120 - i32.const 509 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 358 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 3 + i32.const 2 + i32.const 3 + i32.const 2456 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $17 i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 0 - global.set $std/array/i - global.get $std/array/arr - i32.const 18 - call $~lib/array/Array#forEach - global.get $std/array/i - i32.const 6 - i32.eq - i32.eqz - if + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 359 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 2488 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $16 + local.tee $2 + local.get $37 + local.tee $34 + i32.ne + if + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $34 + call $~lib/rt/pure/__release + end + local.get $2 + end + local.set $37 + local.get $37 + i32.const -2 + i32.const 1 + call $~lib/array/Array#splice + local.tee $2 + i32.const 1 + i32.const 2 + i32.const 3 + i32.const 2528 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $12 i32.const 0 - i32.const 120 - i32.const 518 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 362 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 4 + i32.const 2 + i32.const 3 + i32.const 2552 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $14 i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#get:length|inlined.30 (result i32) - global.get $std/array/arr - local.set $0 - local.get $0 - i32.load offset=4 - end - i32.const 8 - i32.eq - i32.eqz - if + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 363 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 2584 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $13 + local.tee $1 + local.get $37 + local.tee $34 + i32.ne + if + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $34 + call $~lib/rt/pure/__release + end + local.get $1 + end + local.set $37 + local.get $37 + i32.const -7 + i32.const 1 + call $~lib/array/Array#splice + local.tee $1 + i32.const 1 + i32.const 2 + i32.const 3 + i32.const 2624 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $9 i32.const 0 - i32.const 120 - i32.const 519 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 366 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 4 + i32.const 2 + i32.const 3 + i32.const 2648 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $11 i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 0 - global.set $std/array/i - global.get $std/array/arr - i32.const 19 - call $~lib/array/Array#forEach - global.get $std/array/i - i32.const 406 - i32.eq - i32.eqz - if + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 367 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 2680 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $10 + local.tee $7 + local.get $37 + local.tee $34 + i32.ne + if + local.get $7 + call $~lib/rt/pure/__retain + drop + local.get $34 + call $~lib/rt/pure/__release + end + local.get $7 + end + local.set $37 + local.get $37 + i32.const -2 + i32.const -1 + call $~lib/array/Array#splice + local.tee $7 i32.const 0 - i32.const 120 - i32.const 522 + i32.const 2 + i32.const 3 + i32.const 2720 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $5 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - i32.const 0 - global.set $std/array/i - global.get $std/array/arr - i32.const 20 - call $~lib/array/Array#forEach - global.get $std/array/i - i32.const 1 - i32.eq - i32.eqz - if + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 370 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 2736 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $8 i32.const 0 - i32.const 120 - i32.const 536 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 371 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 2776 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $38 + local.tee $34 + local.get $37 + local.tee $39 + i32.ne + if + local.get $34 + call $~lib/rt/pure/__retain + drop + local.get $39 + call $~lib/rt/pure/__release + end + local.get $34 + end + local.set $37 + local.get $37 + i32.const 1 + i32.const -2 + call $~lib/array/Array#splice + local.tee $34 i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#get:length|inlined.31 (result i32) - global.get $std/array/arr - local.set $0 - local.get $0 - i32.load offset=4 - end - i32.const 2 - i32.eq - i32.eqz - if + i32.const 2 + i32.const 3 + i32.const 2816 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $40 i32.const 0 - i32.const 120 - i32.const 537 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 374 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 2832 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $41 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 21 - call $~lib/array/Array#forEach - block $~lib/array/Array#get:length|inlined.32 (result i32) - global.get $std/array/arr - local.set $0 - local.get $0 - i32.load offset=4 - end - i32.const 100 - i32.eq - i32.eqz - if + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 375 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 2872 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $42 + local.tee $39 + local.get $37 + local.tee $43 + i32.ne + if + local.get $39 + call $~lib/rt/pure/__retain + drop + local.get $43 + call $~lib/rt/pure/__release + end + local.get $39 + end + local.set $37 + local.get $37 + i32.const 4 i32.const 0 - i32.const 120 - i32.const 562 + call $~lib/array/Array#splice + local.tee $39 i32.const 0 - call $~lib/env/abort - unreachable - end - block $break|0 + i32.const 2 + i32.const 3 + i32.const 2912 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $44 i32.const 0 - local.set $0 - loop $repeat|0 - local.get $0 - i32.const 100 - i32.lt_s - i32.eqz - br_if $break|0 - global.get $std/array/arr - call $~lib/array/Array#pop - drop - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 378 + i32.const 2 + call $~lib/builtins/abort unreachable end - unreachable - end - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 1 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 22 - call $~lib/array/Array#map - global.set $std/array/newArr - block $~lib/array/Array#get:length|inlined.0 (result i32) - global.get $std/array/newArr - local.set $0 - local.get $0 - i32.load offset=4 - end - i32.const 4 - i32.eq - i32.eqz - if + local.get $37 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 2928 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $45 i32.const 0 - i32.const 120 - i32.const 573 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 379 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 2968 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $46 + local.tee $43 + local.get $37 + local.tee $47 + i32.ne + if + local.get $43 + call $~lib/rt/pure/__retain + drop + local.get $47 + call $~lib/rt/pure/__release + end + local.get $43 + end + local.set $37 + local.get $37 + i32.const 7 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/newArr - i32.const 0 - call $~lib/array/Array#__get - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#__get - f32.convert_i32_s - f32.eq - i32.eqz - if + call $~lib/array/Array#splice + local.tee $43 i32.const 0 - i32.const 120 - i32.const 574 + i32.const 2 + i32.const 3 + i32.const 3008 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $48 i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 0 - global.set $std/array/i - global.get $std/array/arr - i32.const 23 - call $~lib/array/Array#map - drop - global.get $std/array/i - i32.const 6 - i32.eq - i32.eqz - if + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 382 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 3024 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $49 i32.const 0 - i32.const 120 - i32.const 583 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 383 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 3064 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $50 + local.tee $47 + local.get $37 + local.tee $51 + i32.ne + if + local.get $47 + call $~lib/rt/pure/__retain + drop + local.get $51 + call $~lib/rt/pure/__release + end + local.get $47 + end + local.set $37 + local.get $37 + i32.const 7 + i32.const 5 + call $~lib/array/Array#splice + local.tee $47 i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#get:length|inlined.33 (result i32) - global.get $std/array/arr - local.set $0 - local.get $0 - i32.load offset=4 - end - i32.const 8 - i32.eq - i32.eqz - if + i32.const 2 + i32.const 3 + i32.const 3104 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $52 i32.const 0 - i32.const 120 - i32.const 584 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 386 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $37 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 3120 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $53 i32.const 0 - call $~lib/env/abort - unreachable + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 387 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $33 + call $~lib/rt/pure/__release + local.get $37 + call $~lib/rt/pure/__release + local.get $35 + call $~lib/rt/pure/__release + local.get $30 + call $~lib/rt/pure/__release + local.get $32 + call $~lib/rt/pure/__release + local.get $31 + call $~lib/rt/pure/__release + local.get $36 + call $~lib/rt/pure/__release + local.get $27 + call $~lib/rt/pure/__release + local.get $29 + call $~lib/rt/pure/__release + local.get $28 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $24 + call $~lib/rt/pure/__release + local.get $26 + call $~lib/rt/pure/__release + local.get $25 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $21 + call $~lib/rt/pure/__release + local.get $23 + call $~lib/rt/pure/__release + local.get $22 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $18 + call $~lib/rt/pure/__release + local.get $20 + call $~lib/rt/pure/__release + local.get $19 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $15 + call $~lib/rt/pure/__release + local.get $17 + call $~lib/rt/pure/__release + local.get $16 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $12 + call $~lib/rt/pure/__release + local.get $14 + call $~lib/rt/pure/__release + local.get $13 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $9 + call $~lib/rt/pure/__release + local.get $11 + call $~lib/rt/pure/__release + local.get $10 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $8 + call $~lib/rt/pure/__release + local.get $38 + call $~lib/rt/pure/__release + local.get $34 + call $~lib/rt/pure/__release + local.get $40 + call $~lib/rt/pure/__release + local.get $41 + call $~lib/rt/pure/__release + local.get $42 + call $~lib/rt/pure/__release + local.get $39 + call $~lib/rt/pure/__release + local.get $44 + call $~lib/rt/pure/__release + local.get $45 + call $~lib/rt/pure/__release + local.get $46 + call $~lib/rt/pure/__release + local.get $43 + call $~lib/rt/pure/__release + local.get $48 + call $~lib/rt/pure/__release + local.get $49 + call $~lib/rt/pure/__release + local.get $50 + call $~lib/rt/pure/__release + local.get $47 + call $~lib/rt/pure/__release + local.get $52 + call $~lib/rt/pure/__release + local.get $53 + call $~lib/rt/pure/__release end - i32.const 0 - global.set $std/array/i - global.get $std/array/arr - i32.const 24 - call $~lib/array/Array#map - drop - global.get $std/array/i - i32.const 406 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 591 + block + global.get $std/array/arr i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - i32.const 0 - global.set $std/array/i - global.get $std/array/arr - i32.const 25 - call $~lib/array/Array#map - drop - global.get $std/array/i - i32.const 1 - i32.eq - i32.eqz - if i32.const 0 - i32.const 120 - i32.const 606 + call $~lib/array/Array#__set + global.get $std/array/arr + i32.const 1 + i32.const 1 + call $~lib/array/Array#__set + global.get $std/array/arr + i32.const 2 + i32.const 2 + call $~lib/array/Array#__set + global.get $std/array/arr + i32.const 3 + i32.const 3 + call $~lib/array/Array#__set + global.get $std/array/arr + i32.const 1 + call $~lib/array/Array#findIndex + global.set $std/array/i + global.get $std/array/i i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#get:length|inlined.34 (result i32) + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 400 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#findIndex + global.set $std/array/i + global.get $std/array/i + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 403 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#findIndex + global.set $std/array/i + global.get $std/array/i + i32.const -1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 406 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 4 + call $~lib/array/Array#findIndex + global.set $std/array/i + global.get $std/array/i + i32.const -1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 414 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 415 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 5 + call $~lib/array/Array#findIndex + global.set $std/array/i + global.get $std/array/i + i32.const -1 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 417 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + i32.const 6 + call $~lib/array/Array#findIndex + global.set $std/array/i + global.get $std/array/i + i32.const -1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 430 + i32.const 2 + call $~lib/builtins/abort + unreachable + end global.get $std/array/arr - local.set $0 - local.get $0 - i32.load offset=4 - end - i32.const 2 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 607 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 26 - call $~lib/array/Array#filter - global.set $std/array/filteredArr - block $~lib/array/Array#get:length|inlined.35 (result i32) - global.get $std/array/filteredArr - local.set $0 - local.get $0 - i32.load offset=4 - end - i32.const 2 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 615 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 0 - global.set $std/array/i - global.get $std/array/arr - i32.const 27 - call $~lib/array/Array#filter - drop - global.get $std/array/i - i32.const 6 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 624 - i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#get:length|inlined.36 (result i32) + call $~lib/array/Array#get:length + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 431 + i32.const 2 + call $~lib/builtins/abort + unreachable + end global.get $std/array/arr - local.set $0 - local.get $0 - i32.load offset=4 - end - i32.const 8 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 625 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 0 - global.set $std/array/i - global.get $std/array/arr - i32.const 28 - call $~lib/array/Array#filter - drop - global.get $std/array/i - i32.const 406 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 632 - i32.const 0 - call $~lib/env/abort - unreachable + i32.const 2 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#push + drop end - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - i32.const 0 - global.set $std/array/i - global.get $std/array/arr - i32.const 29 - call $~lib/array/Array#filter - drop - global.get $std/array/i - i32.const 1 - i32.eq - i32.eqz - if + block + global.get $std/array/arr + i32.const 7 + call $~lib/array/Array#every + local.set $53 + local.get $53 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 441 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 8 + call $~lib/array/Array#every + local.set $53 + local.get $53 i32.const 0 - i32.const 120 - i32.const 647 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 444 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 9 + call $~lib/array/Array#every + local.set $53 + local.get $53 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 452 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 453 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 10 + call $~lib/array/Array#every + local.set $53 + local.get $53 i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#get:length|inlined.37 (result i32) + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 455 + i32.const 2 + call $~lib/builtins/abort + unreachable + end global.get $std/array/arr - local.set $0 - local.get $0 - i32.load offset=4 + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + i32.const 11 + call $~lib/array/Array#every + local.set $53 + local.get $53 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 468 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 469 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#push + drop end - i32.const 2 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 648 + block + global.get $std/array/arr + i32.const 12 + call $~lib/array/Array#some + local.set $53 + local.get $53 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 479 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 13 + call $~lib/array/Array#some + local.set $53 + local.get $53 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 30 - i32.const 0 - call $~lib/array/Array#reduce - global.set $std/array/i - global.get $std/array/i - i32.const 6 - i32.eq - i32.eqz - if + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 482 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 14 + call $~lib/array/Array#some + local.set $53 + local.get $53 i32.const 0 - i32.const 120 - i32.const 656 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 490 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 491 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 15 + call $~lib/array/Array#some + local.set $53 + local.get $53 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 493 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + i32.const 16 + call $~lib/array/Array#some + local.set $53 + local.get $53 i32.const 0 - call $~lib/env/abort - unreachable + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 506 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 507 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#push + drop end - global.get $std/array/arr - i32.const 31 - i32.const 4 - call $~lib/array/Array#reduce - global.set $std/array/i - global.get $std/array/i - i32.const 10 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 660 + block i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - i32.const 32 - i32.const 0 - call $~lib/array/Array#reduce - i32.const 0 - i32.ne - global.set $std/array/boolVal - global.get $std/array/boolVal - i32.const 1 - i32.eq - i32.eqz - if + global.set $std/array/i + global.get $std/array/arr + i32.const 17 + call $~lib/array/Array#forEach + global.get $std/array/i + i32.const 6 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 518 + i32.const 2 + call $~lib/builtins/abort + unreachable + end i32.const 0 - i32.const 120 - i32.const 663 + global.set $std/array/i + global.get $std/array/arr + i32.const 18 + call $~lib/array/Array#forEach + global.get $std/array/i + i32.const 6 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 527 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 528 + i32.const 2 + call $~lib/builtins/abort + unreachable + end i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - i32.const 33 - i32.const 0 - call $~lib/array/Array#reduce - i32.const 0 - i32.ne - global.set $std/array/boolVal - global.get $std/array/boolVal - i32.const 0 - i32.eq - i32.eqz - if + global.set $std/array/i + global.get $std/array/arr + i32.const 19 + call $~lib/array/Array#forEach + global.get $std/array/i + i32.const 406 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 531 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop i32.const 0 - i32.const 120 - i32.const 666 + global.set $std/array/i + global.get $std/array/arr + i32.const 20 + call $~lib/array/Array#forEach + global.get $std/array/i + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 545 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 546 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 21 + call $~lib/array/Array#forEach + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 100 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 571 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block $break|0 + i32.const 0 + local.set $53 + loop $repeat|0 + local.get $53 + i32.const 100 + i32.lt_s + i32.eqz + br_if $break|0 + global.get $std/array/arr + call $~lib/array/Array#pop + drop + local.get $53 + i32.const 1 + i32.add + local.set $53 + br $repeat|0 + unreachable + end + unreachable + end + global.get $std/array/arr i32.const 0 - call $~lib/env/abort - unreachable + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 1 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#push + drop end - global.get $std/array/arr - i32.const 34 - i32.const 0 - call $~lib/array/Array#reduce - global.set $std/array/i - global.get $std/array/i - i32.const 6 - i32.eq - i32.eqz - if + block + global.get $std/array/arr + i32.const 22 + call $~lib/array/Array#map + local.set $53 + local.get $53 + call $~lib/array/Array#get:length + i32.const 4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 585 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $53 i32.const 0 - i32.const 120 - i32.const 674 + call $~lib/array/Array#__get + global.get $std/array/arr i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#get:length|inlined.38 (result i32) + call $~lib/array/Array#__get + f32.convert_i32_s + f32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 586 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + global.set $std/array/i global.get $std/array/arr - local.set $0 - local.get $0 - i32.load offset=4 - end - i32.const 8 - i32.eq - i32.eqz - if + i32.const 23 + call $~lib/array/Array#map + call $~lib/rt/pure/__release + global.get $std/array/i + i32.const 6 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 595 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 596 + i32.const 2 + call $~lib/builtins/abort + unreachable + end i32.const 0 - i32.const 120 - i32.const 675 + global.set $std/array/i + global.get $std/array/arr + i32.const 24 + call $~lib/array/Array#map + call $~lib/rt/pure/__release + global.get $std/array/i + i32.const 406 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 603 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop i32.const 0 - call $~lib/env/abort - unreachable + global.set $std/array/i + global.get $std/array/arr + i32.const 25 + call $~lib/array/Array#map + call $~lib/rt/pure/__release + global.get $std/array/i + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 618 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 619 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#push + drop + local.get $53 + call $~lib/rt/pure/__release end - global.get $std/array/arr - i32.const 35 - i32.const 0 - call $~lib/array/Array#reduce - global.set $std/array/i - global.get $std/array/i - i32.const 10 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 677 + block + global.get $std/array/arr + i32.const 26 + call $~lib/array/Array#filter + local.set $53 + local.get $53 + call $~lib/array/Array#get:length + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 629 + i32.const 2 + call $~lib/builtins/abort + unreachable + end i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - i32.const 36 - i32.const 0 - call $~lib/array/Array#reduce - global.set $std/array/i - global.get $std/array/i - i32.const 1 - i32.eq - i32.eqz - if + global.set $std/array/i + global.get $std/array/arr + i32.const 27 + call $~lib/array/Array#filter + call $~lib/rt/pure/__release + global.get $std/array/i + i32.const 6 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 638 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 639 + i32.const 2 + call $~lib/builtins/abort + unreachable + end i32.const 0 - i32.const 120 - i32.const 690 + global.set $std/array/i + global.get $std/array/arr + i32.const 28 + call $~lib/array/Array#filter + call $~lib/rt/pure/__release + global.get $std/array/i + i32.const 406 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 646 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#get:length|inlined.39 (result i32) + global.set $std/array/i global.get $std/array/arr - local.set $0 - local.get $0 - i32.load offset=4 + i32.const 29 + call $~lib/array/Array#filter + call $~lib/rt/pure/__release + global.get $std/array/i + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 661 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 662 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#push + drop + local.get $53 + call $~lib/rt/pure/__release end - i32.const 2 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 691 + block + global.get $std/array/arr + i32.const 30 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 37 - i32.const 0 - call $~lib/array/Array#reduceRight - global.set $std/array/i - global.get $std/array/i - i32.const 6 - i32.eq - i32.eqz - if + call $~lib/array/Array#reduce + global.set $std/array/i + global.get $std/array/i + i32.const 6 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 672 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 31 + i32.const 4 + call $~lib/array/Array#reduce + global.set $std/array/i + global.get $std/array/i + i32.const 10 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 676 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 32 i32.const 0 - i32.const 120 - i32.const 699 + call $~lib/array/Array#reduce + local.set $53 + local.get $53 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - i32.const 38 - i32.const 4 - call $~lib/array/Array#reduceRight - global.set $std/array/i - global.get $std/array/i - i32.const 10 - i32.eq - i32.eqz - if + i32.ne + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 679 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 33 i32.const 0 - i32.const 120 - i32.const 703 + call $~lib/array/Array#reduce + local.set $53 + local.get $53 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - i32.const 39 - i32.const 0 - call $~lib/array/Array#reduceRight - i32.const 0 - i32.ne - global.set $std/array/boolVal - global.get $std/array/boolVal - i32.const 1 - i32.eq - i32.eqz - if + i32.ne i32.const 0 - i32.const 120 - i32.const 706 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 682 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 34 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - i32.const 40 - i32.const 0 - call $~lib/array/Array#reduceRight - i32.const 0 - i32.ne - global.set $std/array/boolVal - global.get $std/array/boolVal - i32.const 0 - i32.eq - i32.eqz - if + call $~lib/array/Array#reduce + global.set $std/array/i + global.get $std/array/i + i32.const 6 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 690 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 691 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 35 i32.const 0 - i32.const 120 - i32.const 709 + call $~lib/array/Array#reduce + global.set $std/array/i + global.get $std/array/i + i32.const 10 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 693 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + i32.const 36 i32.const 0 - call $~lib/env/abort - unreachable + call $~lib/array/Array#reduce + global.set $std/array/i + global.get $std/array/i + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 706 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 707 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#push + drop end - global.get $std/array/arr - i32.const 41 - i32.const 0 - call $~lib/array/Array#reduceRight - global.set $std/array/i - global.get $std/array/i - i32.const 6 - i32.eq - i32.eqz - if + block + global.get $std/array/arr + i32.const 37 + i32.const 0 + call $~lib/array/Array#reduceRight + global.set $std/array/i + global.get $std/array/i + i32.const 6 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 717 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 38 + i32.const 4 + call $~lib/array/Array#reduceRight + global.set $std/array/i + global.get $std/array/i + i32.const 10 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 721 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 39 i32.const 0 - i32.const 120 - i32.const 717 + call $~lib/array/Array#reduceRight + local.set $53 + local.get $53 i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#get:length|inlined.40 (result i32) + i32.ne + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 724 + i32.const 2 + call $~lib/builtins/abort + unreachable + end global.get $std/array/arr - local.set $0 - local.get $0 - i32.load offset=4 - end - i32.const 8 - i32.eq - i32.eqz - if + i32.const 40 i32.const 0 - i32.const 120 - i32.const 718 + call $~lib/array/Array#reduceRight + local.set $53 + local.get $53 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - i32.const 42 - i32.const 0 - call $~lib/array/Array#reduceRight - global.set $std/array/i - global.get $std/array/i - i32.const 10 - i32.eq - i32.eqz - if + i32.ne i32.const 0 - i32.const 120 - i32.const 720 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 727 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 41 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - call $~lib/array/Array#pop - drop - global.get $std/array/arr - i32.const 43 - i32.const 0 - call $~lib/array/Array#reduceRight - global.set $std/array/i - global.get $std/array/i - i32.const 6 - i32.eq - i32.eqz - if + call $~lib/array/Array#reduceRight + global.set $std/array/i + global.get $std/array/i + i32.const 6 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 735 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#get:length + i32.const 8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 736 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + i32.const 42 i32.const 0 - i32.const 120 - i32.const 733 + call $~lib/array/Array#reduceRight + global.set $std/array/i + global.get $std/array/i + i32.const 10 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 738 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + call $~lib/array/Array#pop + drop + global.get $std/array/arr + i32.const 43 i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#get:length|inlined.41 (result i32) + call $~lib/array/Array#reduceRight + global.set $std/array/i + global.get $std/array/i + i32.const 6 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 751 + i32.const 2 + call $~lib/builtins/abort + unreachable + end global.get $std/array/arr - local.set $0 - local.get $0 - i32.load offset=4 - end - i32.const 0 - i32.eq - i32.eqz - if + call $~lib/array/Array#get:length i32.const 0 - i32.const 120 - i32.const 734 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 752 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $std/array/arr i32.const 0 - call $~lib/env/abort - unreachable + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 1 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 2 + call $~lib/array/Array#push + drop + global.get $std/array/arr + i32.const 3 + call $~lib/array/Array#push + drop end - global.get $std/array/arr - i32.const 0 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 1 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 2 - call $~lib/array/Array#push - drop - global.get $std/array/arr - i32.const 3 - call $~lib/array/Array#push - drop call $~lib/bindings/Math/random i64.reinterpret_f64 call $~lib/math/NativeMath.seedRandom - block (result i32) + block + i32.const 8 + i32.const 2 + i32.const 8 + i32.const 3392 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $52 + call $~lib/rt/pure/__retain + local.set $53 i32.const 0 global.set $~lib/argc - global.get $std/array/f32ArrayTyped + local.get $53 i32.const 0 call $~lib/array/Array#sort|trampoline - end - drop - global.get $std/array/f32ArrayTyped - i32.const 3240 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 821 + call $~lib/rt/pure/__release + local.get $53 + i32.const 8 + i32.const 2 + i32.const 8 + i32.const 3440 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $50 i32.const 0 - call $~lib/env/abort - unreachable - end - block (result i32) + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 841 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 8 + i32.const 3 + i32.const 9 + i32.const 3488 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $49 + call $~lib/rt/pure/__retain + local.set $47 i32.const 0 global.set $~lib/argc - global.get $std/array/f64ArrayTyped + local.get $47 i32.const 0 call $~lib/array/Array#sort|trampoline - end - drop - global.get $std/array/f64ArrayTyped - i32.const 3512 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 825 + call $~lib/rt/pure/__release + local.get $47 + i32.const 8 + i32.const 3 + i32.const 9 + i32.const 3568 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $43 i32.const 0 - call $~lib/env/abort - unreachable - end - block (result i32) + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 845 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 3648 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $46 + call $~lib/rt/pure/__retain + local.set $48 i32.const 0 global.set $~lib/argc - global.get $std/array/i32ArrayTyped + local.get $48 i32.const 0 call $~lib/array/Array#sort|trampoline - end - drop - global.get $std/array/i32ArrayTyped - i32.const 3592 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 829 + call $~lib/rt/pure/__release + local.get $48 + i32.const 5 + i32.const 2 + i32.const 3 + i32.const 3688 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $44 i32.const 0 - call $~lib/env/abort - unreachable - end - block (result i32) + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 849 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 5 + i32.const 2 + i32.const 7 + i32.const 3728 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $39 + call $~lib/rt/pure/__retain + local.set $45 i32.const 0 global.set $~lib/argc - global.get $std/array/u32ArrayTyped + local.get $45 i32.const 0 call $~lib/array/Array#sort|trampoline - end - drop - global.get $std/array/u32ArrayTyped - i32.const 3672 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 833 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 64 - call $std/array/createReverseOrderedArray - global.set $std/array/reversed64 - i32.const 128 - call $std/array/createReverseOrderedArray - global.set $std/array/reversed128 - i32.const 1024 - call $std/array/createReverseOrderedArray - global.set $std/array/reversed1024 - i32.const 10000 - call $std/array/createReverseOrderedArray - global.set $std/array/reversed10000 - i32.const 512 - call $std/array/createRandomOrderedArray - global.set $std/array/randomized512 - global.get $std/array/reversed0 - call $std/array/assertSortedDefault - global.get $std/array/reversed1 - call $std/array/assertSortedDefault - global.get $std/array/reversed1 - i32.const 3840 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 853 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/reversed2 - call $std/array/assertSortedDefault - global.get $std/array/reversed2 - i32.const 3864 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 856 + call $~lib/rt/pure/__release + local.get $45 + i32.const 5 + i32.const 2 + i32.const 7 + i32.const 3768 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $41 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/reversed4 - call $std/array/assertSortedDefault - global.get $std/array/reversed4 - global.get $std/array/expected4 - i32.const 0 - call $std/array/isArraysEqual - i32.eqz - if + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 853 + i32.const 2 + call $~lib/builtins/abort + unreachable + end i32.const 0 - i32.const 120 - i32.const 859 + i32.const 2 + i32.const 3 + i32.const 3808 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $40 + call $~lib/rt/pure/__retain + local.set $42 + i32.const 1 + i32.const 2 + i32.const 3 + i32.const 3824 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $38 + call $~lib/rt/pure/__retain + local.set $34 + i32.const 2 + i32.const 2 + i32.const 3 + i32.const 3848 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $5 + call $~lib/rt/pure/__retain + local.set $8 + i32.const 4 + i32.const 2 + i32.const 3 + i32.const 3872 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $10 + call $~lib/rt/pure/__retain + local.set $7 + i32.const 4 + i32.const 2 + i32.const 3 + i32.const 3904 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $9 + call $~lib/rt/pure/__retain + local.set $11 + i32.const 64 + call $std/array/createReverseOrderedArray + local.set $1 + i32.const 128 + call $std/array/createReverseOrderedArray + local.set $13 + i32.const 1024 + call $std/array/createReverseOrderedArray + local.set $14 + i32.const 10000 + call $std/array/createReverseOrderedArray + local.set $12 + i32.const 512 + call $std/array/createRandomOrderedArray + local.set $2 + local.get $42 + call $std/array/assertSortedDefault + local.get $34 + call $std/array/assertSortedDefault + local.get $34 + i32.const 1 + i32.const 2 + i32.const 3 + i32.const 3992 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $17 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array/reversed64 - call $std/array/assertSortedDefault - global.get $std/array/reversed64 - global.get $std/array/expected4 - i32.const 4 - call $std/array/isArraysEqual - i32.eqz - if + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 873 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $8 + call $std/array/assertSortedDefault + local.get $8 + i32.const 2 + i32.const 2 + i32.const 3 + i32.const 4016 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $15 i32.const 0 - i32.const 120 - i32.const 862 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 876 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $7 + call $std/array/assertSortedDefault + local.get $7 + local.get $11 i32.const 0 - call $~lib/env/abort - unreachable + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 879 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + call $std/array/assertSortedDefault + local.get $1 + local.get $11 + i32.const 4 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 882 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $13 + call $std/array/assertSortedDefault + local.get $13 + local.get $11 + i32.const 4 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 885 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $14 + call $std/array/assertSortedDefault + local.get $14 + local.get $11 + i32.const 4 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 888 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $12 + call $std/array/assertSortedDefault + local.get $12 + local.get $11 + i32.const 4 + call $std/array/isArraysEqual + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 891 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $2 + call $std/array/assertSortedDefault + local.get $52 + call $~lib/rt/pure/__release + local.get $53 + call $~lib/rt/pure/__release + local.get $50 + call $~lib/rt/pure/__release + local.get $49 + call $~lib/rt/pure/__release + local.get $47 + call $~lib/rt/pure/__release + local.get $43 + call $~lib/rt/pure/__release + local.get $46 + call $~lib/rt/pure/__release + local.get $48 + call $~lib/rt/pure/__release + local.get $44 + call $~lib/rt/pure/__release + local.get $39 + call $~lib/rt/pure/__release + local.get $45 + call $~lib/rt/pure/__release + local.get $41 + call $~lib/rt/pure/__release + local.get $40 + call $~lib/rt/pure/__release + local.get $42 + call $~lib/rt/pure/__release + local.get $38 + call $~lib/rt/pure/__release + local.get $34 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $8 + call $~lib/rt/pure/__release + local.get $10 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release + local.get $9 + call $~lib/rt/pure/__release + local.get $11 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $13 + call $~lib/rt/pure/__release + local.get $14 + call $~lib/rt/pure/__release + local.get $12 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $17 + call $~lib/rt/pure/__release + local.get $15 + call $~lib/rt/pure/__release end - global.get $std/array/reversed128 - call $std/array/assertSortedDefault - global.get $std/array/reversed128 - global.get $std/array/expected4 - i32.const 4 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 865 - i32.const 0 - call $~lib/env/abort - unreachable + block + i32.const 64 + call $std/array/createRandomOrderedArray + local.set $15 + i32.const 257 + call $std/array/createRandomOrderedArray + local.set $17 + local.get $15 + i32.const 49 + call $std/array/assertSorted + local.get $15 + i32.const 50 + call $std/array/assertSorted + local.get $17 + i32.const 51 + call $std/array/assertSorted + local.get $17 + i32.const 52 + call $std/array/assertSorted + local.get $15 + call $~lib/rt/pure/__release + local.get $17 + call $~lib/rt/pure/__release end - global.get $std/array/reversed1024 - call $std/array/assertSortedDefault - global.get $std/array/reversed1024 - global.get $std/array/expected4 - i32.const 4 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 868 - i32.const 0 - call $~lib/env/abort - unreachable + block + i32.const 2 + call $std/array/createReverseOrderedNestedArray + local.set $17 + local.get $17 + i32.const 53 + call $std/array/assertSorted<~lib/array/Array> + local.get $17 + call $~lib/rt/pure/__release end - global.get $std/array/reversed10000 - call $std/array/assertSortedDefault - global.get $std/array/reversed10000 - global.get $std/array/expected4 - i32.const 4 - call $std/array/isArraysEqual - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 871 - i32.const 0 - call $~lib/env/abort - unreachable + block + i32.const 512 + call $std/array/createReverseOrderedElementsArray + local.set $17 + local.get $17 + i32.const 54 + call $std/array/assertSorted> + local.get $17 + call $~lib/rt/pure/__release end - global.get $std/array/randomized512 - call $std/array/assertSortedDefault - i32.const 64 - call $std/array/createRandomOrderedArray - global.set $std/array/randomized64 - i32.const 257 - call $std/array/createRandomOrderedArray - global.set $std/array/randomized257 - global.get $std/array/randomized64 - i32.const 49 - call $std/array/assertSorted - global.get $std/array/randomized64 - i32.const 50 - call $std/array/assertSorted - global.get $std/array/randomized257 - i32.const 51 - call $std/array/assertSorted - global.get $std/array/randomized257 - i32.const 52 - call $std/array/assertSorted - i32.const 512 - call $std/array/createReverseOrderedNestedArray - global.set $std/array/reversedNested512 - global.get $std/array/reversedNested512 - i32.const 53 - call $std/array/assertSorted<~lib/array/Array> - i32.const 512 - call $std/array/createReverseOrderedElementsArray - global.set $std/array/reversedElements512 - global.get $std/array/reversedElements512 - i32.const 54 - call $std/array/assertSorted> block + i32.const 7 + i32.const 2 + i32.const 13 + i32.const 4264 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $15 + call $~lib/rt/pure/__retain + local.set $17 + i32.const 7 + i32.const 2 + i32.const 13 + i32.const 4312 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $12 + call $~lib/rt/pure/__retain + local.set $2 + i32.const 1 + global.set $~lib/argc + local.get $17 + i32.const 0 + call $std/array/assertSorted<~lib/string/String | null>|trampoline + local.get $17 + local.get $2 + i32.const 0 + call $std/array/isArraysEqual<~lib/string/String | null> + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 928 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 400 + call $std/array/createRandomStringArray + local.set $14 i32.const 1 global.set $~lib/argc - global.get $std/array/randomStringsActual + local.get $14 i32.const 0 call $std/array/assertSorted<~lib/string/String>|trampoline + local.get $15 + call $~lib/rt/pure/__release + local.get $17 + call $~lib/rt/pure/__release + local.get $12 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $14 + call $~lib/rt/pure/__release end - global.get $std/array/randomStringsActual - global.get $std/array/randomStringsExpected - i32.const 0 - call $std/array/isArraysEqual<~lib/string/String> - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 901 + block + i32.const 2 i32.const 0 - call $~lib/env/abort - unreachable + i32.const 15 + i32.const 4432 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $2 + i32.const 4512 + call $~lib/array/Array#join + local.tee $14 + i32.const 4536 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 939 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 3 + i32.const 2 + i32.const 3 + i32.const 4576 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $17 + i32.const 4248 + call $~lib/array/Array#join + local.tee $12 + i32.const 5080 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 940 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 3 + i32.const 2 + i32.const 7 + i32.const 5112 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $13 + i32.const 5144 + call $~lib/array/Array#join + local.tee $15 + i32.const 5080 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 941 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 2 + i32.const 2 + i32.const 3 + i32.const 5168 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $11 + i32.const 5192 + call $~lib/array/Array#join + local.tee $1 + i32.const 5216 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 942 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 6 + i32.const 3 + i32.const 9 + i32.const 5280 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $7 + i32.const 5344 + call $~lib/array/Array#join + local.tee $9 + i32.const 6544 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 943 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 3 + i32.const 2 + i32.const 14 + i32.const 6664 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $8 + i32.const 4248 + call $~lib/array/Array<~lib/string/String>#join + local.tee $10 + i32.const 6640 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 944 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 3 + i32.const 2 + i32.const 19 + i32.const 0 + call $~lib/rt/__allocArray + local.set $5 + local.get $5 + i32.load offset=4 + local.set $34 + local.get $34 + i32.const 0 + call $std/array/Ref#constructor + local.tee $38 + call $~lib/rt/pure/__retain + i32.store + local.get $34 + i32.const 0 + call $~lib/rt/pure/__retain + i32.store offset=4 + local.get $34 + i32.const 0 + call $std/array/Ref#constructor + local.tee $42 + call $~lib/rt/pure/__retain + i32.store offset=8 + local.get $5 + end + call $~lib/rt/pure/__retain + local.set $34 + local.get $34 + i32.const 4512 + call $~lib/array/Array#join + local.tee $5 + i32.const 6744 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 946 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $2 + call $~lib/rt/pure/__release + local.get $14 + call $~lib/rt/pure/__release + local.get $17 + call $~lib/rt/pure/__release + local.get $12 + call $~lib/rt/pure/__release + local.get $13 + call $~lib/rt/pure/__release + local.get $15 + call $~lib/rt/pure/__release + local.get $11 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release + local.get $9 + call $~lib/rt/pure/__release + local.get $8 + call $~lib/rt/pure/__release + local.get $10 + call $~lib/rt/pure/__release + local.get $38 + call $~lib/rt/pure/__release + local.get $42 + call $~lib/rt/pure/__release + local.get $34 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release end - i32.const 400 - call $std/array/createRandomStringArray - global.set $std/array/randomStrings400 block - i32.const 1 - global.set $~lib/argc - global.get $std/array/randomStrings400 - i32.const 0 - call $std/array/assertSorted<~lib/string/String>|trampoline - end - i32.const 4240 - i32.const 4216 - call $~lib/array/Array#join - i32.const 4248 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 910 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 4872 - i32.const 3904 - call $~lib/array/Array#join - i32.const 4880 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 911 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 4976 - i32.const 4936 - call $~lib/array/Array#join - i32.const 4880 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 912 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 5032 - i32.const 5008 - call $~lib/array/Array#join - i32.const 5040 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 913 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 6688 - i32.const 5168 - call $~lib/array/Array#join - i32.const 6696 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 914 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 6864 - i32.const 3904 - call $~lib/array/Array<~lib/string/String>#join - i32.const 6784 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 915 - i32.const 0 - call $~lib/env/abort - unreachable - end - block (result i32) i32.const 0 + i32.const 2 i32.const 3 - call $~lib/array/Array#constructor - local.set $3 - local.get $3 - i32.const 0 - i32.const 0 - call $std/array/Ref#constructor - call $~lib/array/Array#__unchecked_set - local.get $3 + i32.const 6824 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $34 + call $~lib/rt/pure/__retain + local.set $5 i32.const 1 - i32.const 0 - call $~lib/array/Array#__unchecked_set - local.get $3 i32.const 2 + i32.const 3 + i32.const 6840 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $38 + call $~lib/rt/pure/__retain + local.set $42 + i32.const 2 + i32.const 2 + i32.const 3 + i32.const 6864 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $8 + call $~lib/rt/pure/__retain + local.set $10 + i32.const 4 + i32.const 2 + i32.const 3 + i32.const 6888 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $7 + call $~lib/rt/pure/__retain + local.set $9 + local.get $5 + call $~lib/array/Array#toString + local.tee $1 + i32.const 4248 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 956 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $42 + call $~lib/array/Array#toString + local.tee $11 + i32.const 6640 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 957 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $10 + call $~lib/array/Array#toString + local.tee $15 + i32.const 6920 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 958 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $9 + call $~lib/array/Array#toString + local.tee $13 + i32.const 6944 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 959 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 3 i32.const 0 - call $std/array/Ref#constructor - call $~lib/array/Array#__unchecked_set - local.get $3 - end - global.set $std/array/refArr - global.get $std/array/refArr - i32.const 4216 - call $~lib/array/Array#join - i32.const 6912 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 917 - i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#toString|inlined.1 (result i32) - global.get $std/array/reversed0 - local.set $3 - local.get $3 - i32.const 4216 - call $~lib/array/Array#join - end - i32.const 3904 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 921 - i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#toString|inlined.3 (result i32) - global.get $std/array/reversed1 - local.set $3 - local.get $3 - i32.const 4216 - call $~lib/array/Array#join - end - i32.const 6784 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 922 - i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#toString|inlined.5 (result i32) - global.get $std/array/reversed2 - local.set $3 - local.get $3 - i32.const 4216 - call $~lib/array/Array#join + i32.const 20 + i32.const 6976 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $17 + call $~lib/array/Array#toString + local.tee $12 + i32.const 7000 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 961 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 3 + i32.const 1 + i32.const 21 + i32.const 7032 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $2 + call $~lib/array/Array#toString + local.tee $14 + i32.const 7056 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 962 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 3 + i32.const 3 + i32.const 16 + i32.const 7096 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $41 + call $~lib/array/Array#toString + local.tee $40 + i32.const 7136 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 963 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 4 + i32.const 3 + i32.const 22 + i32.const 7200 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $39 + call $~lib/array/Array#toString + local.tee $45 + i32.const 7248 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 964 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 7 + i32.const 2 + i32.const 13 + i32.const 7352 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $48 + call $~lib/rt/pure/__retain + local.set $44 + local.get $44 + call $~lib/array/Array<~lib/string/String | null>#toString + local.tee $46 + i32.const 7400 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 968 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 4 + i32.const 2 + i32.const 14 + i32.const 7496 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $47 + call $~lib/array/Array<~lib/string/String>#toString + local.tee $43 + i32.const 7528 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 969 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 2 + i32.const 2 + i32.const 10 + i32.const 0 + call $~lib/rt/__allocArray + local.set $49 + local.get $49 + i32.load offset=4 + local.set $50 + local.get $50 + i32.const 2 + i32.const 2 + i32.const 3 + i32.const 7560 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $52 + call $~lib/rt/pure/__retain + i32.store + local.get $50 + i32.const 2 + i32.const 2 + i32.const 3 + i32.const 7584 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $16 + call $~lib/rt/pure/__retain + i32.store offset=4 + local.get $49 + end + call $~lib/rt/pure/__retain + local.set $54 + local.get $54 + call $~lib/array/Array<~lib/array/Array>#toString + local.tee $50 + i32.const 7608 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 972 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 2 + i32.const 2 + i32.const 23 + i32.const 0 + call $~lib/rt/__allocArray + local.set $49 + local.get $49 + i32.load offset=4 + local.set $53 + local.get $53 + i32.const 2 + i32.const 0 + i32.const 6 + i32.const 7640 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $19 + call $~lib/rt/pure/__retain + i32.store + local.get $53 + i32.const 2 + i32.const 0 + i32.const 6 + i32.const 7664 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $20 + call $~lib/rt/pure/__retain + i32.store offset=4 + local.get $49 + end + call $~lib/rt/pure/__retain + local.set $55 + local.get $55 + call $~lib/array/Array<~lib/array/Array>#toString + local.tee $53 + i32.const 7608 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 975 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 1 + i32.const 2 + i32.const 25 + i32.const 0 + call $~lib/rt/__allocArray + local.set $49 + local.get $49 + i32.load offset=4 + local.set $0 + local.get $0 + block (result i32) + i32.const 1 + i32.const 2 + i32.const 24 + i32.const 0 + call $~lib/rt/__allocArray + local.set $18 + local.get $18 + i32.load offset=4 + local.set $4 + local.get $4 + i32.const 1 + i32.const 2 + i32.const 7 + i32.const 7688 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $23 + call $~lib/rt/pure/__retain + i32.store + local.get $18 + end + call $~lib/rt/pure/__retain + i32.store + local.get $49 + end + call $~lib/rt/pure/__retain + local.set $56 + local.get $56 + call $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#toString + local.tee $0 + i32.const 6640 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 978 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $34 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $38 + call $~lib/rt/pure/__release + local.get $42 + call $~lib/rt/pure/__release + local.get $8 + call $~lib/rt/pure/__release + local.get $10 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release + local.get $9 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $11 + call $~lib/rt/pure/__release + local.get $15 + call $~lib/rt/pure/__release + local.get $13 + call $~lib/rt/pure/__release + local.get $17 + call $~lib/rt/pure/__release + local.get $12 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $14 + call $~lib/rt/pure/__release + local.get $41 + call $~lib/rt/pure/__release + local.get $40 + call $~lib/rt/pure/__release + local.get $39 + call $~lib/rt/pure/__release + local.get $45 + call $~lib/rt/pure/__release + local.get $48 + call $~lib/rt/pure/__release + local.get $44 + call $~lib/rt/pure/__release + local.get $46 + call $~lib/rt/pure/__release + local.get $47 + call $~lib/rt/pure/__release + local.get $43 + call $~lib/rt/pure/__release + local.get $52 + call $~lib/rt/pure/__release + local.get $16 + call $~lib/rt/pure/__release + local.get $50 + call $~lib/rt/pure/__release + local.get $19 + call $~lib/rt/pure/__release + local.get $20 + call $~lib/rt/pure/__release + local.get $53 + call $~lib/rt/pure/__release + local.get $23 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release end - i32.const 6984 - call $~lib/string/String.__eq - i32.eqz + global.get $std/array/arr + call $~lib/rt/pure/__release + local.get $54 + call $~lib/rt/pure/__release + local.get $55 + call $~lib/rt/pure/__release + local.get $56 + call $~lib/rt/pure/__release + ) + (func $start (; 300 ;) (type $FUNCSIG$v) + global.get $~lib/started if - i32.const 0 - i32.const 120 - i32.const 923 - i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#toString|inlined.7 (result i32) - global.get $std/array/reversed4 - local.set $3 - local.get $3 - i32.const 4216 - call $~lib/array/Array#join + return + else + i32.const 1 + global.set $~lib/started end - i32.const 7000 - call $~lib/string/String.__eq - i32.eqz + call $start:std/array + ) + (func $~lib/array/Array#__visit_impl (; 301 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/array/Array#__visit_impl (; 302 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/array/Array#__visit_impl (; 303 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/array/Array#__visit_impl (; 304 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/array/Array#__visit_impl (; 305 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/rt/pure/markGray (; 306 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne if - i32.const 0 - i32.const 120 - i32.const 924 - i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#toString|inlined.1 (result i32) - i32.const 7064 - local.set $3 - local.get $3 - i32.const 4216 - call $~lib/array/Array#join + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members end - i32.const 7072 - call $~lib/string/String.__eq - i32.eqz + ) + (func $~lib/rt/pure/scanBlack (; 307 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 308 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq if + local.get $1 + i32.const 268435455 + i32.and i32.const 0 - i32.const 120 - i32.const 926 - i32.const 0 - call $~lib/env/abort - unreachable + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end end - block $~lib/array/Array#toString|inlined.1 (result i32) - i32.const 7128 - local.set $3 - local.get $3 - i32.const 4216 - call $~lib/array/Array#join + ) + (func $~lib/rt/pure/collectWhite (; 309 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 end - i32.const 7136 - call $~lib/string/String.__eq - i32.eqz if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and i32.const 0 - i32.const 120 - i32.const 927 - i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#toString|inlined.1 (result i32) - i32.const 7232 - local.set $3 - local.get $3 - i32.const 4216 - call $~lib/array/Array#join + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock end - i32.const 7240 - call $~lib/string/String.__eq - i32.eqz + ) + (func $~lib/rt/pure/__visit (; 310 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.lt_u if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/pure/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 75 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/pure/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 86 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/pure/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/collectWhite + br $break|0 + unreachable + end + unreachable + end i32.const 0 - i32.const 120 - i32.const 928 - i32.const 0 - call $~lib/env/abort - unreachable + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 97 + i32.const 24 + call $~lib/builtins/abort + unreachable + end end - block $~lib/array/Array#toString|inlined.1 (result i32) - i32.const 7432 - local.set $3 - local.get $3 - i32.const 4216 - call $~lib/array/Array#join + ) + (func $~lib/array/Array<~lib/array/Array>#__visit_impl (; 311 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=4 + local.set $2 + local.get $2 + local.get $0 + i32.load offset=12 + i32.const 2 + i32.shl + i32.add + local.set $3 + block $break|0 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_u + if + local.get $2 + i32.load + local.set $4 + local.get $4 + if + local.get $4 + local.get $1 + call $~lib/rt/pure/__visit + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 + end + end end - i32.const 7440 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 929 - i32.const 0 - call $~lib/env/abort - unreachable + ) + (func $~lib/array/Array>#__visit_impl (; 312 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=4 + local.set $2 + local.get $2 + local.get $0 + i32.load offset=12 + i32.const 2 + i32.shl + i32.add + local.set $3 + block $break|0 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_u + if + local.get $2 + i32.load + local.set $4 + local.get $4 + if + local.get $4 + local.get $1 + call $~lib/rt/pure/__visit + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 + end + end end - block $~lib/array/Array<~lib/string/String>#toString|inlined.1 (result i32) - global.get $std/array/randomStringsExpected - local.set $3 - local.get $3 - i32.const 4216 - call $~lib/array/Array<~lib/string/String>#join + ) + (func $~lib/array/Array<~lib/string/String | null>#__visit_impl (; 313 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=4 + local.set $2 + local.get $2 + local.get $0 + i32.load offset=12 + i32.const 2 + i32.shl + i32.add + local.set $3 + block $break|0 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_u + if + local.get $2 + i32.load + local.set $4 + local.get $4 + if + local.get $4 + local.get $1 + call $~lib/rt/pure/__visit + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 + end + end end - i32.const 7528 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 930 - i32.const 0 - call $~lib/env/abort - unreachable + ) + (func $~lib/array/Array<~lib/string/String>#__visit_impl (; 314 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=4 + local.set $2 + local.get $2 + local.get $0 + i32.load offset=12 + i32.const 2 + i32.shl + i32.add + local.set $3 + block $break|0 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_u + if + local.get $2 + i32.load + local.set $4 + local.get $4 + if + local.get $4 + local.get $1 + call $~lib/rt/pure/__visit + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 + end + end end - block $~lib/array/Array<~lib/string/String>#toString|inlined.3 (result i32) - i32.const 7648 - local.set $3 - local.get $3 - i32.const 4216 - call $~lib/array/Array<~lib/string/String>#join + ) + (func $~lib/array/Array#__visit_impl (; 315 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/array/Array#__visit_impl (; 316 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/array/Array#__visit_impl (; 317 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/array/Array#__visit_impl (; 318 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=4 + local.set $2 + local.get $2 + local.get $0 + i32.load offset=12 + i32.const 2 + i32.shl + i32.add + local.set $3 + block $break|0 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_u + if + local.get $2 + i32.load + local.set $4 + local.get $4 + if + local.get $4 + local.get $1 + call $~lib/rt/pure/__visit + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 + end + end end - i32.const 7656 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 931 - i32.const 0 - call $~lib/env/abort - unreachable + ) + (func $~lib/array/Array#__visit_impl (; 319 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/array/Array#__visit_impl (; 320 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/array/Array#__visit_impl (; 321 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/array/Array<~lib/array/Array>#__visit_impl (; 322 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=4 + local.set $2 + local.get $2 + local.get $0 + i32.load offset=12 + i32.const 2 + i32.shl + i32.add + local.set $3 + block $break|0 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_u + if + local.get $2 + i32.load + local.set $4 + local.get $4 + if + local.get $4 + local.get $1 + call $~lib/rt/pure/__visit + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 + end + end end - block $~lib/array/Array<~lib/array/Array>#toString|inlined.1 (result i32) - global.get $std/array/subarr32 - local.set $3 - local.get $3 - i32.const 4216 - call $~lib/array/Array<~lib/array/Array>#join + ) + (func $~lib/array/Array<~lib/array/Array>#__visit_impl (; 323 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=4 + local.set $2 + local.get $2 + local.get $0 + i32.load offset=12 + i32.const 2 + i32.shl + i32.add + local.set $3 + block $break|0 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_u + if + local.get $2 + i32.load + local.set $4 + local.get $4 + if + local.get $4 + local.get $1 + call $~lib/rt/pure/__visit + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 + end + end end - i32.const 7744 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 934 - i32.const 0 - call $~lib/env/abort - unreachable + ) + (func $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#__visit_impl (; 324 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=4 + local.set $2 + local.get $2 + local.get $0 + i32.load offset=12 + i32.const 2 + i32.shl + i32.add + local.set $3 + block $break|0 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_u + if + local.get $2 + i32.load + local.set $4 + local.get $4 + if + local.get $4 + local.get $1 + call $~lib/rt/pure/__visit + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 + end + end end - block $~lib/array/Array<~lib/array/Array>#toString|inlined.1 (result i32) - global.get $std/array/subarr8 - local.set $3 - local.get $3 - i32.const 4216 - call $~lib/array/Array<~lib/array/Array>#join + ) + (func $~lib/rt/__visit_members (; 325 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block $block$4$break + block + end + block $switch$1$leave + block $switch$1$default + block $switch$1$case$27 + block $switch$1$case$26 + block $switch$1$case$25 + block $switch$1$case$24 + block $switch$1$case$23 + block $switch$1$case$22 + block $switch$1$case$21 + block $switch$1$case$19 + block $switch$1$case$18 + block $switch$1$case$17 + block $switch$1$case$16 + block $switch$1$case$15 + block $switch$1$case$14 + block $switch$1$case$12 + block $switch$1$case$11 + block $switch$1$case$10 + block $switch$1$case$9 + block $switch$1$case$8 + block $switch$1$case$5 + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$case$5 $switch$1$case$2 $switch$1$case$4 $switch$1$case$8 $switch$1$case$9 $switch$1$case$10 $switch$1$case$11 $switch$1$case$12 $switch$1$case$2 $switch$1$case$14 $switch$1$case$15 $switch$1$case$16 $switch$1$case$17 $switch$1$case$18 $switch$1$case$19 $switch$1$case$2 $switch$1$case$21 $switch$1$case$22 $switch$1$case$23 $switch$1$case$24 $switch$1$case$25 $switch$1$case$26 $switch$1$case$27 $switch$1$default + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + br $block$4$break + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$4$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$4$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$4$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$4$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$4$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#__visit_impl + block + br $block$4$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array>#__visit_impl + block + br $block$4$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/string/String | null>#__visit_impl + block + br $block$4$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/string/String>#__visit_impl + block + br $block$4$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$4$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$4$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$4$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$4$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$4$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$4$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$4$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#__visit_impl + block + br $block$4$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array>#__visit_impl + block + br $block$4$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#__visit_impl + block + br $block$4$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end end - i32.const 7744 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 937 - i32.const 0 - call $~lib/env/abort + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + end + return + unreachable + end unreachable - end - block $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#toString|inlined.1 (result i32) - global.get $std/array/subarrU32 - local.set $3 - local.get $3 - i32.const 4216 - call $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#join - end - i32.const 6784 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 940 - i32.const 0 - call $~lib/env/abort unreachable end + unreachable ) - (func $start (; 227 ;) (type $FUNCSIG$v) - call $start:std/array - ) - (func $null (; 228 ;) (type $FUNCSIG$v) + (func $null (; 326 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/std/arraybuffer.json b/tests/compiler/std/arraybuffer.json new file mode 100644 index 0000000000..9f7878d475 --- /dev/null +++ b/tests/compiler/std/arraybuffer.json @@ -0,0 +1,6 @@ +{ + "asc_flags": [ + "--runtime half", + "--use ASC_RTRACE=1" + ] +} \ No newline at end of file diff --git a/tests/compiler/std/arraybuffer.optimized.wat b/tests/compiler/std/arraybuffer.optimized.wat index b0ec760789..fee6f9541c 100644 --- a/tests/compiler/std/arraybuffer.optimized.wat +++ b/tests/compiler/std/arraybuffer.optimized.wat @@ -1,1490 +1,1676 @@ (module + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) - (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$vii (func (param i32 i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$viii (func (param i32 i32 i32))) - (type $FUNCSIG$vii (func (param i32 i32))) - (type $FUNCSIG$iii (func (param i32 i32) (result i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$i (func (result i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32))) + (import "rtrace" "onincrement" (func $~lib/rt/rtrace/onincrement (param i32))) + (import "rtrace" "ondecrement" (func $~lib/rt/rtrace/ondecrement (param i32))) + (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) (memory $0 1) - (data (i32.const 8) "\13\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") - (data (i32.const 56) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") - (data (i32.const 120) "\12\00\00\00s\00t\00d\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") - (data (i32.const 160) "\1b\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s") - (data (i32.const 224) "\08\00\00\00\00\00\00\00\01\00\00\00\02") - (data (i32.const 240) "\e0\00\00\00\02") - (data (i32.const 248) "\10\00\00\00~\00l\00i\00b\00/\00d\00a\00t\00a\00v\00i\00e\00w\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) - (global $std/arraybuffer/buffer (mut i32) (i32.const 0)) + (data (i32.const 8) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h") + (data (i32.const 56) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") + (data (i32.const 112) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s") + (data (i32.const 160) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e") + (data (i32.const 216) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s") + (data (i32.const 264) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00s\00t\00d\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") + (data (i32.const 320) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e") + (data (i32.const 376) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s") + (data (i32.const 416) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\01\00\00\00\02") + (data (i32.const 440) " \00\00\00\01\00\00\00\01\00\00\00 \00\00\00~\00l\00i\00b\00/\00d\00a\00t\00a\00v\00i\00e\00w\00.\00t\00s") + (data (i32.const 488) "\10\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\93\04\00\00\02\00\00\001\04\00\00\02\00\00\001\00\00\00\02\00\00\001\00\00\00\02\00\00\00Q\04\00\00\02\00\00\00Q\00\00\00\02\00\00\00\91\04\00\00\02\00\00\00\91\00\00\00\02\00\00\00\11\05\00\00\02\00\00\00\11\01\00\00\02\00\00\00\91\0c\00\00\02\00\00\00\11\0d\00\00\02\00\00\00\10") + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) (global $~lib/argc (mut i32) (i32.const 0)) - (global $std/arraybuffer/sliced (mut i32) (i32.const 0)) - (global $std/arraybuffer/arr8 (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) - (func $~lib/allocator/arena/__memory_allocate (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/rt/tlsf/removeBlock (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) - local.get $0 - i32.const 1073741824 - i32.gt_u + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.tee $3 + i32.const 1 + i32.and + i32.eqz if + i32.const 0 + i32.const 128 + i32.const 276 + i32.const 13 + call $~lib/builtins/abort unreachable end - global.get $~lib/allocator/arena/offset - local.tee $1 - local.get $0 - i32.const 1 - local.get $0 - i32.const 1 - i32.gt_u - select - i32.add - i32.const 7 - i32.add - i32.const -8 + local.get $3 + i32.const -4 i32.and - local.tee $0 - current_memory local.tee $2 i32.const 16 - i32.shl - i32.gt_u + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz if + i32.const 0 + i32.const 128 + i32.const 278 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 256 + i32.lt_u + if (result i32) local.get $2 - local.get $0 - local.get $1 - i32.sub - i32.const 65535 - i32.add - i32.const -65536 - i32.and - i32.const 16 + i32.const 4 i32.shr_u - local.tee $3 + local.set $2 + i32.const 0 + else + local.get $2 + i32.const 31 local.get $2 + i32.clz + i32.sub + local.tee $3 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $2 local.get $3 - i32.gt_s - select - grow_memory + i32.const 7 + i32.sub + end + local.tee $3 + i32.const 23 + i32.lt_u + if (result i32) + local.get $2 + i32.const 16 + i32.lt_u + else i32.const 0 - i32.lt_s - if - local.get $3 - grow_memory - i32.const 0 - i32.lt_s - if - unreachable - end - end end - local.get $0 - global.set $~lib/allocator/arena/offset - local.get $1 - ) - (func $~lib/internal/arraybuffer/allocateUnsafe (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - local.get $0 - i32.const 1073741816 - i32.gt_u + i32.eqz if i32.const 0 - i32.const 56 - i32.const 26 - i32.const 2 - call $~lib/env/abort + i32.const 128 + i32.const 291 + i32.const 13 + call $~lib/builtins/abort unreachable end - i32.const 1 - i32.const 32 - local.get $0 - i32.const 7 - i32.add - i32.clz - i32.sub - i32.shl - call $~lib/allocator/arena/__memory_allocate - local.tee $1 - local.get $0 - i32.store local.get $1 - ) - (func $~lib/internal/memory/memset (; 3 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - (local $2 i32) + i32.load offset=20 + local.set $4 local.get $1 - i32.eqz + i32.load offset=16 + local.tee $5 if - return + local.get $5 + local.get $4 + i32.store offset=20 end - local.get $0 - i32.const 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - i32.const 1 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 2 - i32.le_u + local.get $4 if - return + local.get $4 + local.get $5 + i32.store offset=16 end - local.get $0 - i32.const 1 + local.get $3 + i32.const 4 + i32.shl + local.get $2 i32.add - i32.const 0 - i32.store8 - local.get $0 i32.const 2 - i32.add - i32.const 0 - i32.store8 + i32.shl local.get $0 - local.get $1 i32.add - local.tee $2 - i32.const 2 - i32.sub - i32.const 0 - i32.store8 - local.get $2 - i32.const 3 - i32.sub - i32.const 0 - i32.store8 + i32.load offset=96 local.get $1 - i32.const 6 - i32.le_u + i32.eq if - return + local.get $3 + i32.const 4 + i32.shl + local.get $2 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $4 + i32.store offset=96 + local.get $4 + i32.eqz + if + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const 1 + local.get $2 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.store offset=4 + local.get $1 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $3 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end end - local.get $0 - i32.const 3 - i32.add - i32.const 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - i32.const 4 - i32.sub - i32.const 0 - i32.store8 + ) + (func $~lib/rt/tlsf/insertBlock (; 6 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) local.get $1 - i32.const 8 - i32.le_u + i32.eqz if - return + i32.const 0 + i32.const 128 + i32.const 204 + i32.const 13 + call $~lib/builtins/abort + unreachable end - i32.const 0 - local.get $0 - i32.sub - i32.const 3 - i32.and - local.tee $2 - local.get $0 - i32.add - local.tee $0 - i32.const 0 - i32.store local.get $1 - local.get $2 - i32.sub - i32.const -4 + i32.load + local.tee $3 + i32.const 1 i32.and - local.tee $1 - local.get $0 - i32.add - i32.const 4 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 8 - i32.le_u + i32.eqz if - return + i32.const 0 + i32.const 128 + i32.const 206 + i32.const 13 + call $~lib/builtins/abort + unreachable end - local.get $0 - i32.const 4 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 8 + local.get $1 + i32.const 16 i32.add - i32.const 0 - i32.store - local.get $0 local.get $1 + i32.load + i32.const -4 + i32.and i32.add - local.tee $2 - i32.const 12 - i32.sub - i32.const 0 + local.tee $4 + i32.load + local.tee $5 + i32.const 1 + i32.and + if + local.get $3 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const -4 + i32.and + i32.add + local.tee $2 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $3 + i32.const 3 + i32.and + local.get $2 + i32.or + local.tee $3 + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.set $5 + end + end + local.get $3 + i32.const 2 + i32.and + if + local.get $1 + i32.const 4 + i32.sub + i32.load + local.tee $2 + i32.load + local.tee $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 227 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $3 + i32.const -4 + i32.and + i32.add + local.tee $7 + i32.const 1073741808 + i32.lt_u + if (result i32) + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $2 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $3 + i32.store + local.get $2 + else + local.get $1 + end + local.set $1 + end + local.get $4 + local.get $5 + i32.const 2 + i32.or i32.store + local.get $3 + i32.const -4 + i32.and + local.tee $2 + i32.const 16 + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + local.get $1 + i32.const 16 + i32.add local.get $2 - i32.const 8 + i32.add + i32.ne + if + i32.const 0 + i32.const 128 + i32.const 243 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 i32.sub - i32.const 0 - i32.store local.get $1 - i32.const 24 - i32.le_u + i32.store + local.get $2 + i32.const 256 + i32.lt_u + if (result i32) + local.get $2 + i32.const 4 + i32.shr_u + local.set $4 + i32.const 0 + else + local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $4 + local.get $2 + i32.const 7 + i32.sub + end + local.tee $3 + i32.const 23 + i32.lt_u + if (result i32) + local.get $4 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz if - return + i32.const 0 + i32.const 128 + i32.const 259 + i32.const 13 + call $~lib/builtins/abort + unreachable end - local.get $0 - i32.const 12 + local.get $3 + i32.const 4 + i32.shl + local.get $4 i32.add - i32.const 0 - i32.store + i32.const 2 + i32.shl local.get $0 - i32.const 16 i32.add + i32.load offset=96 + local.set $2 + local.get $1 i32.const 0 - i32.store + i32.store offset=16 + local.get $1 + local.get $2 + i32.store offset=20 + local.get $2 + if + local.get $2 + local.get $1 + i32.store offset=16 + end + local.get $3 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl local.get $0 - i32.const 20 i32.add - i32.const 0 + local.get $1 + i32.store offset=96 + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $3 + i32.shl + i32.or i32.store + local.get $3 + i32.const 2 + i32.shl local.get $0 - i32.const 24 i32.add - i32.const 0 - i32.store + local.get $3 + i32.const 2 + i32.shl local.get $0 - local.get $1 i32.add - local.tee $2 - i32.const 28 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 24 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 20 - i32.sub - i32.const 0 - i32.store + i32.load offset=4 + i32.const 1 + local.get $4 + i32.shl + i32.or + i32.store offset=4 + ) + (func $~lib/rt/tlsf/addMemory (; 7 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) local.get $2 - i32.const 16 - i32.sub + i32.const 15 + i32.and + i32.eqz i32.const 0 - i32.store - local.get $0 - i32.const 4 + local.get $1 + i32.const 15 i32.and - i32.const 24 - i32.add - local.tee $2 - local.get $0 - i32.add - local.set $0 + i32.eqz + i32.const 0 local.get $1 local.get $2 - i32.sub - local.set $1 - loop $continue|0 + i32.le_u + select + select + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 385 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=1568 + local.tee $3 + if local.get $1 - i32.const 32 - i32.ge_u + local.get $3 + i32.const 16 + i32.add + i32.lt_u if - local.get $0 - i64.const 0 - i64.store - local.get $0 - i32.const 8 - i32.add - i64.const 0 - i64.store - local.get $0 - i32.const 16 - i32.add - i64.const 0 - i64.store - local.get $0 - i32.const 24 - i32.add - i64.const 0 - i64.store + i32.const 0 + i32.const 128 + i32.const 395 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $3 + i32.eq + if + local.get $3 + i32.load + local.set $4 local.get $1 - i32.const 32 + i32.const 16 i32.sub local.set $1 - local.get $0 - i32.const 32 - i32.add - local.set $0 - br $continue|0 end - end - ) - (func $~lib/internal/memory/memcpy (; 4 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - loop $continue|0 + else local.get $1 - i32.const 3 - i32.and - local.get $2 - local.get $2 - select + local.get $0 + i32.const 1572 + i32.add + i32.lt_u if - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - br $continue|0 + i32.const 0 + i32.const 128 + i32.const 407 + i32.const 4 + call $~lib/builtins/abort + unreachable end end - local.get $0 - i32.const 3 + local.get $2 + local.get $1 + i32.sub + local.tee $2 + i32.const 48 + i32.lt_u + if + return + end + local.get $1 + local.get $4 + i32.const 2 i32.and - i32.eqz + local.get $2 + i32.const 32 + i32.sub + i32.const 1 + i32.or + i32.or + i32.store + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $2 + i32.add + i32.const 16 + i32.sub + local.tee $2 + i32.const 2 + i32.store + local.get $0 + local.get $2 + i32.store offset=1568 + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/tlsf/initializeRoot (; 8 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 1 + memory.size + local.tee $0 + i32.gt_s + if (result i32) + i32.const 1 + local.get $0 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end if - loop $continue|1 - local.get $2 - i32.const 16 - i32.ge_u - if - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $1 - i32.const 4 - i32.add - i32.load - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $1 - i32.const 8 - i32.add - i32.load - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 12 - i32.add - i32.load - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - br $continue|1 - end - end - local.get $2 - i32.const 8 - i32.and - if + unreachable + end + i32.const 624 + i32.const 0 + i32.store + i32.const 2192 + i32.const 0 + i32.store + i32.const 0 + local.set $0 + loop $repeat|0 + block $break|0 local.get $0 - local.get $1 - i32.load - i32.store + i32.const 23 + i32.ge_u + br_if $break|0 local.get $0 - i32.const 4 - i32.add - local.get $1 - i32.const 4 - i32.add - i32.load - i32.store - local.get $1 - i32.const 8 + i32.const 2 + i32.shl + i32.const 624 i32.add + i32.const 0 + i32.store offset=4 + i32.const 0 local.set $1 + loop $repeat|1 + block $break|1 + local.get $1 + i32.const 16 + i32.ge_u + br_if $break|1 + local.get $0 + i32.const 4 + i32.shl + local.get $1 + i32.add + i32.const 2 + i32.shl + i32.const 624 + i32.add + i32.const 0 + i32.store offset=96 + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|1 + end + end local.get $0 - i32.const 8 + i32.const 1 i32.add local.set $0 + br $repeat|0 end - local.get $2 + end + i32.const 624 + i32.const 2208 + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + i32.const 624 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 176 + i32.const 128 + i32.const 447 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const -16 + i32.and + local.tee $0 + i32.const 16 + local.get $0 + i32.const 16 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + i32.const 256 + i32.lt_u + if (result i32) + local.get $1 i32.const 4 - i32.and + i32.shr_u + local.set $1 + i32.const 0 + else + local.get $1 + i32.const 536870904 + i32.lt_u if - local.get $0 + i32.const 1 + i32.const 27 local.get $1 - i32.load - i32.store + i32.clz + i32.sub + i32.shl local.get $1 - i32.const 4 i32.add + i32.const 1 + i32.sub local.set $1 - local.get $0 - i32.const 4 - i32.add - local.set $0 end + local.get $1 + i32.const 31 + local.get $1 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $1 + local.get $2 + i32.const 7 + i32.sub + end + local.tee $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $1 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 337 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const -1 + local.get $1 + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $1 + i32.ctz local.get $2 + i32.const 4 + i32.shl + i32.add i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + else + local.get $0 + i32.load + i32.const -1 + local.get $2 + i32.const 1 + i32.add + i32.shl i32.and - if - local.get $0 - local.get $1 - i32.load16_u - i32.store16 + local.tee $1 + if (result i32) local.get $1 + i32.ctz + local.tee $1 i32.const 2 - i32.add - local.set $1 + i32.shl local.get $0 + i32.add + i32.load offset=4 + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 350 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.ctz + local.get $1 + i32.const 4 + i32.shl + i32.add i32.const 2 + i32.shl + local.get $0 i32.add - local.set $0 + i32.load offset=96 + else + i32.const 0 end - local.get $2 - i32.const 1 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - end - return end + ) + (func $~lib/rt/tlsf/growMemory (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + memory.size + local.tee $2 + local.get $1 + i32.const 65535 + i32.add + i32.const -65536 + i32.and + i32.const 16 + i32.shr_u + local.tee $1 local.get $2 - i32.const 32 - i32.ge_u + local.get $1 + i32.gt_s + select + memory.grow + i32.const 0 + i32.lt_s if - block $break|2 - block $case2|2 - block $case1|2 - local.get $0 - i32.const 3 - i32.and - local.tee $3 - i32.const 1 - i32.ne - if - local.get $3 - i32.const 2 - i32.eq - br_if $case1|2 - local.get $3 - i32.const 3 - i32.eq - br_if $case2|2 - br $break|2 - end - local.get $1 - i32.load - local.set $5 - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 3 - i32.sub - local.set $2 - loop $continue|3 - local.get $2 - i32.const 17 - i32.ge_u - if - local.get $0 - local.get $1 - i32.const 1 - i32.add - i32.load - local.tee $3 - i32.const 8 - i32.shl - local.get $5 - i32.const 24 - i32.shr_u - i32.or - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $3 - i32.const 24 - i32.shr_u - local.get $1 - i32.const 5 - i32.add - i32.load - local.tee $3 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $3 - i32.const 24 - i32.shr_u - local.get $1 - i32.const 9 - i32.add - i32.load - local.tee $3 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 13 - i32.add - i32.load - local.tee $5 - i32.const 8 - i32.shl - local.get $3 - i32.const 24 - i32.shr_u - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - br $continue|3 - end - end - br $break|2 - end - local.get $1 - i32.load - local.set $5 - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 2 - i32.sub - local.set $2 - loop $continue|4 - local.get $2 - i32.const 18 - i32.ge_u - if - local.get $0 - local.get $1 - i32.const 2 - i32.add - i32.load - local.tee $3 - i32.const 16 - i32.shl - local.get $5 - i32.const 16 - i32.shr_u - i32.or - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $3 - i32.const 16 - i32.shr_u - local.get $1 - i32.const 6 - i32.add - i32.load - local.tee $3 - i32.const 16 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $3 - i32.const 16 - i32.shr_u - local.get $1 - i32.const 10 - i32.add - i32.load - local.tee $3 - i32.const 16 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 14 - i32.add - i32.load - local.tee $5 - i32.const 16 - i32.shl - local.get $3 - i32.const 16 - i32.shr_u - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - br $continue|4 - end - end - br $break|2 - end - local.get $1 - i32.load - local.set $5 - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - loop $continue|5 - local.get $2 - i32.const 19 - i32.ge_u - if - local.get $0 - local.get $1 - i32.const 3 - i32.add - i32.load - local.tee $3 - i32.const 24 - i32.shl - local.get $5 - i32.const 8 - i32.shr_u - i32.or - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $3 - i32.const 8 - i32.shr_u - local.get $1 - i32.const 7 - i32.add - i32.load - local.tee $3 - i32.const 24 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $3 - i32.const 8 - i32.shr_u - local.get $1 - i32.const 11 - i32.add - i32.load - local.tee $3 - i32.const 24 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 15 - i32.add - i32.load - local.tee $5 - i32.const 24 - i32.shl - local.get $3 - i32.const 8 - i32.shr_u - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - br $continue|5 - end - end + local.get $1 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable end end + local.get $0 local.get $2 i32.const 16 + i32.shl + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + ) + (func $~lib/rt/tlsf/prepareBlock (; 12 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 i32.and if - local.get $0 + i32.const 0 + i32.const 128 + i32.const 364 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const -4 + i32.and + local.get $2 + i32.sub + local.tee $4 + i32.const 32 + i32.ge_u + if local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 + local.get $3 + i32.const 2 + i32.and + local.get $2 + i32.or + i32.store local.get $1 - i32.const 1 + i32.const 16 + i32.add + local.get $2 i32.add local.tee $1 - i32.load8_u - i32.store8 - local.get $0 + local.get $4 + i32.const 16 + i32.sub i32.const 1 - i32.add - local.tee $0 + i32.or + i32.store + local.get $0 local.get $1 - i32.const 1 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const -2 + i32.and + i32.store + local.get $1 + i32.const 16 i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 + local.get $1 + i32.load + i32.const -4 + i32.and i32.add - local.tee $0 local.get $1 - i32.const 1 + i32.const 16 i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 local.get $1 - i32.const 1 + i32.load + i32.const -4 + i32.and i32.add - local.tee $1 - i32.load8_u - i32.store8 + i32.load + i32.const -3 + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.tee $3 + call $~lib/rt/tlsf/searchBlock + local.tee $2 + i32.eqz + if local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 + local.get $3 + call $~lib/rt/tlsf/growMemory local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 local.get $3 - local.get $4 - i32.load8_u - i32.store8 + call $~lib/rt/tlsf/searchBlock + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 477 + i32.const 15 + call $~lib/builtins/abort + unreachable + end end local.get $2 + i32.load + i32.const -4 + i32.and + local.get $3 + i32.lt_u + if + i32.const 0 + i32.const 128 + i32.const 479 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 0 + i32.store offset=4 + local.get $2 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $2 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $2 + call $~lib/rt/rtrace/onalloc + local.get $2 + ) + (func $~lib/rt/tlsf/__alloc (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + global.get $~lib/rt/tlsf/ROOT + local.tee $2 + if (result i32) + local.get $2 + else + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + end + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.tee $0 + local.get $1 + i32.store offset=8 + local.get $0 + i32.const 16 + i32.add + ) + (func $~lib/memory/memory.fill (; 15 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.const 0 + i32.store8 + local.get $0 i32.const 8 + i32.add + local.tee $1 + i32.const 1 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 1 + i32.add + i32.const 0 + i32.store8 + local.get $0 + i32.const 2 + i32.add + i32.const 0 + i32.store8 + local.get $1 + i32.const 2 + i32.sub + i32.const 0 + i32.store8 + local.get $1 + i32.const 3 + i32.sub + i32.const 0 + i32.store8 + local.get $0 + i32.const 3 + i32.add + i32.const 0 + i32.store8 + local.get $1 + i32.const 4 + i32.sub + i32.const 0 + i32.store8 + ) + (func $~lib/rt/pure/increment (; 16 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const -268435456 i32.and + local.get $1 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne + if + i32.const 0 + i32.const 232 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/rtrace/onincrement + local.get $0 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 232 + i32.const 107 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/pure/__retain (; 17 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 620 + i32.gt_u if local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment + end + local.get $0 + ) + (func $~lib/arraybuffer/ArrayBuffer#get:byteLength (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + ) + (func $~lib/memory/memory.copy (; 19 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $2 + local.set $3 local.get $0 - i32.const 1 - i32.add - local.tee $0 local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 + i32.eq + br_if $~lib/util/memory/memmove|inlined.0 local.get $0 - i32.const 1 - i32.add - local.tee $0 local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 + i32.lt_u + if + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|0 + local.get $0 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + br $continue|0 + end + end + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $1 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + br $continue|1 + end + end + end + loop $continue|2 + local.get $3 + if + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + else + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|3 + local.get $0 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $3 + i32.const 8 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + loop $continue|5 + local.get $3 + if + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + ) + (func $~lib/arraybuffer/ArrayBuffer#slice (; 20 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $0 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength + local.set $3 + local.get $1 + i32.const 0 + i32.lt_s + if (result i32) local.get $1 - i32.const 1 + local.get $3 i32.add local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 + i32.const 0 local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 + i32.const 0 + i32.gt_s + select + else local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 + local.get $3 local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 local.get $3 - local.get $4 - i32.load8_u - i32.store8 + i32.lt_s + select end + local.set $1 local.get $2 - i32.const 4 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 + i32.const 0 + i32.lt_s + if (result i32) + local.get $2 + local.get $3 i32.add - local.set $1 + local.tee $2 + i32.const 0 + local.get $2 + i32.const 0 + i32.gt_s + select + else + local.get $2 local.get $3 - local.get $4 - i32.load8_u - i32.store8 + local.get $2 + local.get $3 + i32.lt_s + select end + local.get $1 + i32.sub + local.tee $2 + i32.const 0 local.get $2 - i32.const 2 + i32.const 0 + i32.gt_s + select + local.tee $2 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.tee $3 + local.get $0 + local.get $1 + i32.add + local.get $2 + call $~lib/memory/memory.copy + local.get $3 + call $~lib/rt/pure/__retain + ) + (func $~lib/rt/tlsf/freeBlock (; 21 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.tee $2 + i32.const 1 i32.and if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 + i32.const 0 + i32.const 128 + i32.const 531 + i32.const 2 + call $~lib/builtins/abort + unreachable end + local.get $1 local.get $2 i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/rtrace/onfree + ) + (func $~lib/rt/__typeinfo (; 22 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 488 + i32.load + i32.gt_u + if + i32.const 336 + i32.const 392 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 3 + i32.shl + i32.const 492 + i32.add + i32.load + ) + (func $~lib/rt/tlsf/__free (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 561 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 i32.and + i32.eqz + i32.const 0 + local.get $0 + select + i32.eqz if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 + i32.const 0 + i32.const 128 + i32.const 562 + i32.const 2 + call $~lib/builtins/abort + unreachable end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock ) - (func $~lib/internal/memory/memmove (; 5 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/pure/growRoots (; 24 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) (local $3 i32) - (local $4 i32) + global.get $~lib/rt/pure/CUR + global.get $~lib/rt/pure/ROOTS + local.tee $1 + i32.sub + local.tee $2 + i32.const 1 + i32.shl + local.tee $0 + i32.const 256 + local.get $0 + i32.const 256 + i32.gt_u + select + local.tee $3 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.tee $0 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onfree local.get $0 local.get $1 - i32.eq + local.get $2 + call $~lib/memory/memory.copy + local.get $1 if - return + local.get $1 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onalloc + local.get $1 + call $~lib/rt/tlsf/__free end - local.get $1 + local.get $0 + global.set $~lib/rt/pure/ROOTS + local.get $0 local.get $2 i32.add + global.set $~lib/rt/pure/CUR local.get $0 - i32.le_u - local.tee $3 - i32.eqz - if - local.get $0 - local.get $2 - i32.add - local.get $1 - i32.le_u - local.set $3 - end local.get $3 + i32.add + global.set $~lib/rt/pure/END + ) + (func $~lib/rt/pure/appendRoot (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/pure/CUR + local.tee $1 + global.get $~lib/rt/pure/END + i32.ge_u if - local.get $0 - local.get $1 - local.get $2 - call $~lib/internal/memory/memcpy - return + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 end + local.get $1 local.get $0 + i32.store local.get $1 - i32.lt_u + i32.const 4 + i32.add + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/decrement (; 26 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.tee $2 + i32.const 268435455 + i32.and + local.set $1 + local.get $0 + call $~lib/rt/rtrace/ondecrement + local.get $0 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 232 + i32.const 115 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 1 + i32.eq if - local.get $1 - i32.const 7 - i32.and local.get $0 - i32.const 7 + i32.const 16 + i32.add + i32.const 1 + call $~lib/rt/__visit_members + local.get $2 + i32.const -2147483648 i32.and - i32.eq if - loop $continue|0 - local.get $0 - i32.const 7 - i32.and - if - local.get $2 - i32.eqz - if - return - end - local.get $2 - i32.const 1 - i32.sub - local.set $2 - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - br $continue|0 - end - end - loop $continue|1 - local.get $2 - i32.const 8 - i32.ge_u - if - local.get $0 - local.get $1 - i64.load - i64.store - local.get $2 - i32.const 8 - i32.sub - local.set $2 - local.get $0 - i32.const 8 - i32.add - local.set $0 - local.get $1 - i32.const 8 - i32.add - local.set $1 - br $continue|1 - end - end - end - loop $continue|2 - local.get $2 - if - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - br $continue|2 - end + local.get $0 + i32.const -2147483648 + i32.store offset=4 + else + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock end else local.get $1 - i32.const 7 - i32.and + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 232 + i32.const 124 + i32.const 15 + call $~lib/builtins/abort + unreachable + end local.get $0 - i32.const 7 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 16 i32.and - i32.eq if - loop $continue|3 - local.get $0 - local.get $2 - i32.add - i32.const 7 - i32.and - if - local.get $2 - i32.eqz - if - return - end - local.get $2 - i32.const 1 - i32.sub - local.tee $2 - local.get $0 - i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 - br $continue|3 - end - end - loop $continue|4 - local.get $2 - i32.const 8 - i32.ge_u - if - local.get $2 - i32.const 8 - i32.sub - local.tee $2 - local.get $0 - i32.add - local.get $1 - local.get $2 - i32.add - i64.load - i64.store - br $continue|4 - end - end - end - loop $continue|5 + local.get $0 + local.get $1 + i32.const 1 + i32.sub + local.get $2 + i32.const -268435456 + i32.and + i32.or + i32.store offset=4 + else + local.get $0 + local.get $1 + i32.const 1 + i32.sub + i32.const -1342177280 + i32.or + i32.store offset=4 local.get $2 + i32.const -2147483648 + i32.and + i32.eqz if - local.get $2 - i32.const 1 - i32.sub - local.tee $2 local.get $0 - i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 - br $continue|5 + call $~lib/rt/pure/appendRoot end end end ) - (func $~lib/arraybuffer/ArrayBuffer#slice (; 6 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) + (func $~lib/rt/pure/__release (; 27 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 - i32.load - local.set $3 - local.get $1 - i32.const 0 - i32.lt_s - if (result i32) - local.get $1 - local.get $3 - i32.add - local.tee $1 - i32.const 0 - local.get $1 - i32.const 0 - i32.gt_s - select - else - local.get $1 - local.get $3 - local.get $1 - local.get $3 - i32.lt_s - select - end - local.set $1 - local.get $2 - i32.const 0 - i32.lt_s - if (result i32) - local.get $2 - local.get $3 - i32.add - local.tee $2 - i32.const 0 - local.get $2 - i32.const 0 - i32.gt_s - select - else - local.get $2 - local.get $3 - local.get $2 - local.get $3 - i32.lt_s - select + i32.const 620 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement end - local.get $1 - i32.sub - local.tee $2 - i32.const 0 - local.get $2 - i32.const 0 - i32.gt_s - select - local.tee $2 - call $~lib/internal/arraybuffer/allocateUnsafe - local.tee $3 - i32.const 8 - i32.add + ) + (func $~lib/arraybuffer/ArrayBuffer.isView<~lib/array/Array> (; 28 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - i32.const 8 - i32.add - local.get $1 - i32.add - local.get $2 - call $~lib/internal/memory/memmove - local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $0 + call $~lib/rt/pure/__release + i32.const 0 ) - (func $~lib/arraybuffer/ArrayBuffer#slice|trampoline (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - block $2of2 - block $1of2 - block $0of2 - block $outOfRange - global.get $~lib/argc - br_table $0of2 $1of2 $2of2 $outOfRange - end - unreachable - end - i32.const 0 - local.set $1 - end - i32.const 1073741816 - local.set $2 + (func $~lib/arraybuffer/ArrayBuffer.isView<~lib/typedarray/Uint8Array> (; 29 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $0 + if + local.get $0 + call $~lib/rt/pure/__release + i32.const 1 + return end local.get $0 - local.get $1 - local.get $2 - call $~lib/arraybuffer/ArrayBuffer#slice + call $~lib/rt/pure/__release + i32.const 0 ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/arraybuffer/ArrayBufferView#constructor (; 30 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) i32.const 1 - call $~lib/internal/arraybuffer/allocateUnsafe - local.tee $1 - i32.const 8 - i32.add + i32.const 1073741808 + local.get $1 + i32.shr_u + i32.gt_u + if + i32.const 24 + i32.const 72 + i32.const 14 + i32.const 56 + call $~lib/builtins/abort + unreachable + end i32.const 1 - call $~lib/internal/memory/memset + local.get $1 + i32.shl + local.tee $2 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $1 local.get $0 i32.eqz if i32.const 12 - call $~lib/allocator/arena/__memory_allocate + i32.const 2 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.set $0 end local.get $0 @@ -1496,379 +1682,700 @@ local.get $0 i32.const 0 i32.store offset=8 + local.get $1 + local.get $0 + i32.load + local.tee $3 + i32.ne + if + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $3 + call $~lib/rt/pure/__release + end local.get $0 local.get $1 i32.store local.get $0 - i32.const 0 + local.get $1 i32.store offset=4 local.get $0 - i32.const 1 + local.get $2 i32.store offset=8 local.get $0 ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/rt/__allocArray (; 31 ;) (type $FUNCSIG$i) (result i32) + (local $0 i32) (local $1 i32) - i32.const 4 - call $~lib/internal/arraybuffer/allocateUnsafe - local.tee $1 + i32.const 16 + i32.const 3 + call $~lib/rt/tlsf/__alloc + local.tee $0 i32.const 8 - i32.add - i32.const 4 - call $~lib/internal/memory/memset - local.get $0 - i32.eqz - if - i32.const 12 - call $~lib/allocator/arena/__memory_allocate - local.set $0 - end - local.get $0 i32.const 0 + call $~lib/rt/tlsf/__alloc + local.tee $1 + call $~lib/rt/pure/__retain i32.store local.get $0 - i32.const 0 + local.get $1 i32.store offset=4 local.get $0 - i32.const 0 + i32.const 8 i32.store offset=8 local.get $0 + i32.const 2 + i32.store offset=12 local.get $1 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 4 - i32.store offset=8 + i32.const 432 + i32.const 8 + call $~lib/memory/memory.copy local.get $0 ) - (func $~lib/dataview/DataView#constructor (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/dataview/DataView#constructor (; 32 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - block (result i32) - local.get $1 - i32.const -2147483648 - i32.eq - if - local.get $0 - i32.load - local.set $1 - end - local.get $1 - i32.const 1073741816 - i32.gt_u - end - if - i32.const 0 - i32.const 248 - i32.const 15 - i32.const 44 - call $~lib/env/abort - unreachable - end + (local $3 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + i32.const 1073741808 + i32.gt_u local.get $1 local.get $0 - i32.load - i32.gt_s + call $~lib/arraybuffer/ArrayBuffer#get:byteLength + i32.gt_u + i32.or if - i32.const 0 - i32.const 248 - i32.const 16 - i32.const 53 - call $~lib/env/abort + local.get $0 + call $~lib/rt/pure/__release + i32.const 24 + i32.const 456 + i32.const 21 + i32.const 6 + call $~lib/builtins/abort unreachable end i32.const 12 - call $~lib/allocator/arena/__memory_allocate + i32.const 15 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.tee $2 - local.get $0 + i32.const 0 i32.store local.get $2 i32.const 0 i32.store offset=4 local.get $2 + i32.const 0 + i32.store offset=8 + local.get $2 + i32.load + local.tee $3 + local.get $0 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $3 + call $~lib/rt/pure/__release + end + local.get $2 + local.get $0 + i32.store + local.get $2 + local.get $0 + i32.store offset=4 + local.get $2 local.get $1 i32.store offset=8 + local.get $0 + call $~lib/rt/pure/__release local.get $2 ) - (func $start:std/arraybuffer (; 11 ;) (type $FUNCSIG$v) + (func $start:std/arraybuffer (; 33 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) - i32.const 288 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) i32.const 8 - call $~lib/internal/arraybuffer/allocateUnsafe + i32.const 0 + call $~lib/rt/tlsf/__alloc local.tee $0 - i32.const 8 - i32.add - i32.const 8 - call $~lib/internal/memory/memset + call $~lib/memory/memory.fill local.get $0 - global.set $std/arraybuffer/buffer - global.get $std/arraybuffer/buffer - i32.load + call $~lib/rt/pure/__retain + local.tee $2 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength i32.const 8 i32.ne if i32.const 0 - i32.const 120 - i32.const 5 - i32.const 0 - call $~lib/env/abort + i32.const 280 + i32.const 4 + i32.const 2 + call $~lib/builtins/abort unreachable end + local.get $2 i32.const 0 - global.set $~lib/argc - global.get $std/arraybuffer/buffer - i32.const 0 - call $~lib/arraybuffer/ArrayBuffer#slice|trampoline - global.set $std/arraybuffer/sliced - global.get $std/arraybuffer/sliced - i32.load + i32.const 1073741808 + call $~lib/arraybuffer/ArrayBuffer#slice + local.tee $0 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength i32.const 8 i32.ne if i32.const 0 - i32.const 120 - i32.const 9 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/arraybuffer/sliced - global.get $std/arraybuffer/buffer - i32.eq - if - i32.const 0 - i32.const 120 - i32.const 10 - i32.const 0 - call $~lib/env/abort + i32.const 280 + i32.const 8 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/arraybuffer/sliced - global.get $std/arraybuffer/buffer + local.get $0 + local.get $2 i32.eq if i32.const 0 - i32.const 120 - i32.const 11 - i32.const 0 - call $~lib/env/abort + i32.const 280 + i32.const 9 + i32.const 2 + call $~lib/builtins/abort unreachable end + local.get $2 i32.const 1 - global.set $~lib/argc - global.get $std/arraybuffer/buffer - i32.const 1 - call $~lib/arraybuffer/ArrayBuffer#slice|trampoline - global.set $std/arraybuffer/sliced - global.get $std/arraybuffer/sliced - i32.load + i32.const 1073741808 + call $~lib/arraybuffer/ArrayBuffer#slice + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength i32.const 7 i32.ne if i32.const 0 - i32.const 120 - i32.const 15 - i32.const 0 - call $~lib/env/abort + i32.const 280 + i32.const 13 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 1 - global.set $~lib/argc - global.get $std/arraybuffer/buffer + local.get $2 i32.const -1 - call $~lib/arraybuffer/ArrayBuffer#slice|trampoline - global.set $std/arraybuffer/sliced - global.get $std/arraybuffer/sliced - i32.load + i32.const 1073741808 + call $~lib/arraybuffer/ArrayBuffer#slice + local.set $0 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + local.tee $1 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength i32.const 1 i32.ne if i32.const 0 - i32.const 120 - i32.const 19 - i32.const 0 - call $~lib/env/abort + i32.const 280 + i32.const 17 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/arraybuffer/buffer + local.get $2 i32.const 1 i32.const 3 call $~lib/arraybuffer/ArrayBuffer#slice - global.set $std/arraybuffer/sliced - global.get $std/arraybuffer/sliced - i32.load + local.set $0 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + local.tee $1 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength i32.const 2 i32.ne if i32.const 0 - i32.const 120 - i32.const 23 - i32.const 0 - call $~lib/env/abort + i32.const 280 + i32.const 21 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/arraybuffer/buffer + local.get $2 i32.const 1 i32.const -1 call $~lib/arraybuffer/ArrayBuffer#slice - global.set $std/arraybuffer/sliced - global.get $std/arraybuffer/sliced - i32.load + local.set $0 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + local.tee $1 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength i32.const 6 i32.ne if i32.const 0 - i32.const 120 - i32.const 27 - i32.const 0 - call $~lib/env/abort + i32.const 280 + i32.const 25 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/arraybuffer/buffer + local.get $2 i32.const -3 i32.const -1 call $~lib/arraybuffer/ArrayBuffer#slice - global.set $std/arraybuffer/sliced - global.get $std/arraybuffer/sliced - i32.load + local.set $0 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength i32.const 2 i32.ne if i32.const 0 - i32.const 120 - i32.const 31 - i32.const 0 - call $~lib/env/abort + i32.const 280 + i32.const 29 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/arraybuffer/buffer + local.get $2 i32.const -4 i32.const 42 call $~lib/arraybuffer/ArrayBuffer#slice - global.set $std/arraybuffer/sliced - global.get $std/arraybuffer/sliced - i32.load + local.set $3 + local.get $0 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength i32.const 4 i32.ne if i32.const 0 - i32.const 120 - i32.const 35 - i32.const 0 - call $~lib/env/abort + i32.const 280 + i32.const 33 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 1 - global.set $~lib/argc - global.get $std/arraybuffer/buffer + local.get $2 i32.const 42 - call $~lib/arraybuffer/ArrayBuffer#slice|trampoline - global.set $std/arraybuffer/sliced - global.get $std/arraybuffer/sliced - i32.load + i32.const 1073741808 + call $~lib/arraybuffer/ArrayBuffer#slice + local.set $1 + local.get $3 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength if i32.const 0 - i32.const 120 - i32.const 39 - i32.const 0 - call $~lib/env/abort + i32.const 280 + i32.const 37 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/arraybuffer/sliced + local.get $1 i32.eqz if i32.const 0 - i32.const 120 + i32.const 280 + i32.const 38 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + call $~lib/arraybuffer/ArrayBuffer.isView<~lib/array/Array> + if + i32.const 0 + i32.const 280 i32.const 40 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + call $~lib/arraybuffer/ArrayBuffer.isView<~lib/typedarray/Uint8Array> + if i32.const 0 - call $~lib/env/abort + i32.const 280 + i32.const 42 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 12 - call $~lib/allocator/arena/__memory_allocate - call $~lib/internal/typedarray/TypedArray#constructor - global.set $std/arraybuffer/arr8 - i32.const 1 i32.const 0 - global.get $std/arraybuffer/arr8 - select - i32.eqz + call $~lib/arraybuffer/ArrayBuffer.isView<~lib/typedarray/Uint8Array> if i32.const 0 - i32.const 120 - i32.const 50 + i32.const 280 + i32.const 43 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + call $~lib/arraybuffer/ArrayBuffer.isView<~lib/typedarray/Uint8Array> + if i32.const 0 - call $~lib/env/abort + i32.const 280 + i32.const 44 + i32.const 2 + call $~lib/builtins/abort unreachable end - block $__inlined_func$~lib/arraybuffer/ArrayBuffer.isView<~lib/typedarray/Uint8Array>5 (result i32) + i32.const 12 + i32.const 5 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + i32.const 0 + call $~lib/arraybuffer/ArrayBufferView#constructor + local.set $3 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $5 + call $~lib/arraybuffer/ArrayBuffer.isView<~lib/array/Array> + if i32.const 0 - i32.const 12 - call $~lib/allocator/arena/__memory_allocate - call $~lib/internal/typedarray/TypedArray#constructor - i32.eqz - br_if $__inlined_func$~lib/arraybuffer/ArrayBuffer.isView<~lib/typedarray/Uint8Array>5 - drop - i32.const 1 + i32.const 280 + i32.const 47 + i32.const 2 + call $~lib/builtins/abort + unreachable end + local.get $3 + call $~lib/arraybuffer/ArrayBuffer.isView<~lib/typedarray/Uint8Array> i32.eqz if i32.const 0 - i32.const 120 - i32.const 51 + i32.const 280 + i32.const 48 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 12 + i32.const 9 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + i32.const 2 + call $~lib/arraybuffer/ArrayBufferView#constructor + local.tee $0 + local.set $6 + local.get $0 + call $~lib/arraybuffer/ArrayBuffer.isView<~lib/typedarray/Uint8Array> + i32.eqz + if i32.const 0 - call $~lib/env/abort + i32.const 280 + i32.const 49 + i32.const 2 + call $~lib/builtins/abort unreachable end i32.const 1 global.set $~lib/argc - block $__inlined_func$~lib/arraybuffer/ArrayBuffer.isView<~lib/typedarray/Uint8Array>6 (result i32) - global.get $std/arraybuffer/arr8 - i32.load - local.set $1 - i32.const 0 - local.set $0 - block $2of2 - block $1of2 - block $outOfRange - global.get $~lib/argc - i32.const 1 - i32.sub - br_table $1of2 $1of2 $2of2 $outOfRange - end - unreachable + local.get $3 + i32.load + call $~lib/rt/pure/__retain + local.tee $0 + local.set $7 + block $2of2 + block $1of2 + block $outOfRange + global.get $~lib/argc + i32.const 1 + i32.sub + br_table $1of2 $1of2 $2of2 $outOfRange end - i32.const -2147483648 - local.set $0 + unreachable end + local.get $0 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength + local.set $4 + end + local.get $0 + local.get $4 + call $~lib/dataview/DataView#constructor + local.tee $0 + local.set $4 + local.get $0 + call $~lib/arraybuffer/ArrayBuffer.isView<~lib/typedarray/Uint8Array> + i32.eqz + if i32.const 0 + i32.const 280 + i32.const 50 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $2 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + ) + (func $start (; 34 ;) (type $FUNCSIG$v) + call $start:std/arraybuffer + ) + (func $~lib/rt/pure/markGray (; 35 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 local.get $1 + i32.const -1879048193 + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 local.get $0 - call $~lib/dataview/DataView#constructor - i32.eqz - br_if $__inlined_func$~lib/arraybuffer/ArrayBuffer.isView<~lib/typedarray/Uint8Array>6 - drop - i32.const 1 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members end - i32.eqz + ) + (func $~lib/rt/pure/scanBlack (; 36 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 37 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (; 38 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else i32.const 0 - i32.const 120 - i32.const 52 + end + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + ) + (func $~lib/rt/pure/__visit (; 39 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + local.get $0 + i32.const 620 + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $0 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + local.get $1 + i32.const 1 + i32.ne + if + local.get $1 + i32.const 2 + i32.eq + br_if $case1|0 + block $tablify|0 + local.get $1 + i32.const 3 + i32.sub + br_table $case2|0 $case3|0 $case4|0 $tablify|0 + end + br $case5|0 + end + local.get $0 + call $~lib/rt/pure/decrement + br $break|0 + end + local.get $0 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 232 + i32.const 75 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $0 + call $~lib/rt/pure/markGray + br $break|0 + end + local.get $0 + call $~lib/rt/pure/scan + br $break|0 + end + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const -268435456 + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne + if + i32.const 0 + i32.const 232 + i32.const 86 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $1 + i32.const 1879048192 + i32.and + if + local.get $0 + call $~lib/rt/pure/scanBlack + end + br $break|0 + end + local.get $0 + call $~lib/rt/pure/collectWhite + br $break|0 + end i32.const 0 - call $~lib/env/abort + i32.const 232 + i32.const 97 + i32.const 24 + call $~lib/builtins/abort unreachable end ) - (func $start (; 12 ;) (type $FUNCSIG$v) - call $start:std/arraybuffer + (func $~lib/rt/__visit_members (; 40 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + block $block$4$break + block $switch$1$default + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $block$4$break $block$4$break $block$4$break $block$4$break $block$4$break $block$4$break $block$4$break $block$4$break $block$4$break $block$4$break $block$4$break $block$4$break $block$4$break $block$4$break $switch$1$default + end + return + end + unreachable + end + local.get $0 + i32.load + local.tee $0 + if + local.get $0 + local.get $1 + call $~lib/rt/pure/__visit + end ) - (func $null (; 13 ;) (type $FUNCSIG$v) + (func $null (; 41 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/arraybuffer.ts b/tests/compiler/std/arraybuffer.ts index db69fe138e..9382e2776b 100644 --- a/tests/compiler/std/arraybuffer.ts +++ b/tests/compiler/std/arraybuffer.ts @@ -1,52 +1,51 @@ -import "allocator/arena"; +{ + let buffer = new ArrayBuffer(8); -var buffer = new ArrayBuffer(8); + assert(buffer.byteLength == 8); -assert(buffer.byteLength == 8); + let sliced = buffer.slice(); -var sliced = buffer.slice(); + assert(sliced.byteLength == 8); + assert(sliced !== buffer); -assert(sliced.byteLength == 8); -assert(sliced.data != buffer.data); -assert(sliced !== buffer); + sliced = buffer.slice(1); -sliced = buffer.slice(1); + assert(sliced.byteLength == 7); -assert(sliced.byteLength == 7); + sliced = buffer.slice(-1); -sliced = buffer.slice(-1); + assert(sliced.byteLength == 1); -assert(sliced.byteLength == 1); + sliced = buffer.slice(1, 3); -sliced = buffer.slice(1, 3); + assert(sliced.byteLength == 2); -assert(sliced.byteLength == 2); + sliced = buffer.slice(1, -1); -sliced = buffer.slice(1, -1); + assert(sliced.byteLength == 6); -assert(sliced.byteLength == 6); + sliced = buffer.slice(-3, -1); -sliced = buffer.slice(-3, -1); + assert(sliced.byteLength == 2); -assert(sliced.byteLength == 2); + sliced = buffer.slice(-4, 42); -sliced = buffer.slice(-4, 42); + assert(sliced.byteLength == 4); -assert(sliced.byteLength == 4); + sliced = buffer.slice(42); -sliced = buffer.slice(42); + assert(sliced.byteLength == 0); + assert(sliced != null); -assert(sliced.byteLength == 0); -assert(sliced != null); + assert(!ArrayBuffer.isView(changetype(null))); + assert(!ArrayBuffer.isView(changetype(null))); + assert(!ArrayBuffer.isView(changetype(null))); + assert(!ArrayBuffer.isView(changetype(null))); + assert(!ArrayBuffer.isView(changetype(null))); -assert(!ArrayBuffer.isView(changetype(null))); -assert(!ArrayBuffer.isView(changetype(null))); -assert(!ArrayBuffer.isView(changetype(null))); -assert(!ArrayBuffer.isView(changetype(null))); -assert(!ArrayBuffer.isView(changetype(null))); - -var arr8 = new Uint8Array(1); -assert(!ArrayBuffer.isView([1, 2])); -assert(ArrayBuffer.isView(arr8)); -assert(ArrayBuffer.isView(new Int32Array(1))); -assert(ArrayBuffer.isView(new DataView(arr8.buffer))); + let arr8 = new Uint8Array(1); + assert(!ArrayBuffer.isView([1, 2])); + assert(ArrayBuffer.isView(arr8)); + assert(ArrayBuffer.isView(new Int32Array(1))); + assert(ArrayBuffer.isView(new DataView(arr8.buffer))); +} diff --git a/tests/compiler/std/arraybuffer.untouched.wat b/tests/compiler/std/arraybuffer.untouched.wat index f15cf68451..12c672b13c 100644 --- a/tests/compiler/std/arraybuffer.untouched.wat +++ b/tests/compiler/std/arraybuffer.untouched.wat @@ -1,905 +1,2050 @@ (module + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) - (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$vii (func (param i32 i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$viii (func (param i32 i32 i32))) - (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$iiiii (func (param i32 i32 i32 i32) (result i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32))) + (import "rtrace" "onincrement" (func $~lib/rt/rtrace/onincrement (param i32))) + (import "rtrace" "ondecrement" (func $~lib/rt/rtrace/ondecrement (param i32))) + (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) (memory $0 1) - (data (i32.const 8) "\13\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") - (data (i32.const 56) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") - (data (i32.const 120) "\12\00\00\00s\00t\00d\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") - (data (i32.const 160) "\1b\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s\00") - (data (i32.const 224) "\08\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00") - (data (i32.const 240) "\e0\00\00\00\02\00\00\00") - (data (i32.const 248) "\10\00\00\00~\00l\00i\00b\00/\00d\00a\00t\00a\00v\00i\00e\00w\00.\00t\00s\00") + (data (i32.const 8) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h\00") + (data (i32.const 56) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") + (data (i32.const 112) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 160) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 216) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s\00") + (data (i32.const 264) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00s\00t\00d\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") + (data (i32.const 320) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 376) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s\00") + (data (i32.const 416) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\01\00\00\00\02\00\00\00") + (data (i32.const 440) " \00\00\00\01\00\00\00\01\00\00\00 \00\00\00~\00l\00i\00b\00/\00d\00a\00t\00a\00v\00i\00e\00w\00.\00t\00s\00") + (data (i32.const 488) "\10\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\93\04\00\00\02\00\00\001\04\00\00\02\00\00\001\00\00\00\02\00\00\001\00\00\00\02\00\00\00Q\04\00\00\02\00\00\00Q\00\00\00\02\00\00\00\91\04\00\00\02\00\00\00\91\00\00\00\02\00\00\00\11\05\00\00\02\00\00\00\11\01\00\00\02\00\00\00\91\0c\00\00\02\00\00\00\11\0d\00\00\02\00\00\00\10\00\00\00\00\00\00\00") (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) - (global $std/arraybuffer/buffer (mut i32) (i32.const 0)) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) (global $~lib/argc (mut i32) (i32.const 0)) - (global $std/arraybuffer/sliced (mut i32) (i32.const 0)) - (global $std/arraybuffer/arr8 (mut i32) (i32.const 0)) - (global $~lib/builtins/i32.MIN_VALUE i32 (i32.const -2147483648)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 284)) + (global $~lib/rt/__rtti_base i32 (i32.const 488)) + (global $~lib/heap/__heap_base i32 (i32.const 620)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) - (func $start:~lib/allocator/arena (; 1 ;) (type $FUNCSIG$v) - global.get $~lib/memory/HEAP_BASE - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - ) - (func $~lib/internal/arraybuffer/computeSize (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 1 - i32.const 32 - local.get $0 - i32.const 8 - i32.add - i32.const 1 - i32.sub - i32.clz - i32.sub - i32.shl - ) - (func $~lib/allocator/arena/__memory_allocate (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/rt/tlsf/removeBlock (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - local.get $0 - i32.const 1073741824 - i32.gt_u + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz if + i32.const 0 + i32.const 128 + i32.const 276 + i32.const 13 + call $~lib/builtins/abort unreachable end - global.get $~lib/allocator/arena/offset - local.set $1 - local.get $1 - local.get $0 - local.tee $2 - i32.const 1 - local.tee $3 local.get $2 - local.get $3 - i32.gt_u - select - i32.add - i32.const 7 - i32.add - i32.const 7 + i32.const 3 i32.const -1 i32.xor i32.and - local.set $4 - current_memory - local.set $5 - local.get $4 - local.get $5 + local.set $3 + local.get $3 i32.const 16 - i32.shl - i32.gt_u + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 278 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 local.get $4 - local.get $1 + i32.const 4 i32.sub - i32.const 65535 - i32.add - i32.const 65535 - i32.const -1 - i32.xor - i32.and - i32.const 16 i32.shr_u - local.set $2 + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) local.get $5 - local.tee $3 - local.get $2 - local.tee $6 - local.get $3 - local.get $6 - i32.gt_s - select - local.set $3 - local.get $3 - grow_memory + i32.const 16 + i32.lt_u + else i32.const 0 - i32.lt_s - if - local.get $2 - grow_memory - i32.const 0 - i32.lt_s - if - unreachable - end - end end - local.get $4 - global.set $~lib/allocator/arena/offset - local.get $1 - ) - (func $~lib/internal/arraybuffer/allocateUnsafe (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - local.get $0 - i32.const 1073741816 - i32.le_u i32.eqz if i32.const 0 - i32.const 56 - i32.const 26 - i32.const 2 - call $~lib/env/abort + i32.const 128 + i32.const 291 + i32.const 13 + call $~lib/builtins/abort unreachable end - block $~lib/memory/memory.allocate|inlined.0 (result i32) - local.get $0 - call $~lib/internal/arraybuffer/computeSize - local.set $2 - local.get $2 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.0 - end - local.set $1 local.get $1 - local.get $0 - i32.store + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $9 + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $8 + local.get $4 + local.set $11 + local.get $9 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $9 + local.set $10 + local.get $8 + local.get $11 + i32.const 2 + i32.shl + i32.add + local.get $10 + i32.store offset=4 + end + local.get $9 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end ) - (func $~lib/internal/memory/memset (; 5 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/insertBlock (; 6 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i64) - local.get $2 + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 i32.eqz if - return + i32.const 0 + i32.const 128 + i32.const 204 + i32.const 13 + call $~lib/builtins/abort + unreachable end - local.get $0 local.get $1 - i32.store8 - local.get $0 + i32.load + local.set $2 local.get $2 - i32.add i32.const 1 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 2 - i32.le_u + i32.and + i32.eqz if - return + i32.const 0 + i32.const 128 + i32.const 206 + i32.const 13 + call $~lib/builtins/abort + unreachable end - local.get $0 + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 i32.const 1 - i32.add - local.get $1 - i32.store8 - local.get $0 - i32.const 2 - i32.add - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 2 - i32.sub - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 3 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 6 - i32.le_u + i32.and if - return - end - local.get $0 - i32.const 3 - i32.add - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 4 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 8 - i32.le_u - if - return + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end end - i32.const 0 - local.get $0 - i32.sub - i32.const 3 - i32.and - local.set $3 - local.get $0 - local.get $3 - i32.add - local.set $0 local.get $2 - local.get $3 - i32.sub - local.set $2 - local.get $2 - i32.const -4 - i32.and - local.set $2 - i32.const -1 - i32.const 255 - i32.div_u - local.get $1 - i32.const 255 + i32.const 2 i32.and - i32.mul - local.set $4 - local.get $0 - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 4 - i32.sub - local.get $4 - i32.store - local.get $2 - i32.const 8 - i32.le_u if - return + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 4 + i32.sub + i32.load + end + local.set $6 + local.get $6 + i32.load + local.set $3 + local.get $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 227 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $6 + call $~lib/rt/tlsf/removeBlock + local.get $6 + local.get $3 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $6 + local.set $1 + end end - local.get $0 - i32.const 4 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 12 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 8 - i32.sub local.get $4 + local.get $5 + i32.const 2 + i32.or i32.store local.get $2 - i32.const 24 - i32.le_u + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz if - return + i32.const 0 + i32.const 128 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable end - local.get $0 - i32.const 12 - i32.add - local.get $4 - i32.store - local.get $0 + local.get $1 i32.const 16 i32.add - local.get $4 - i32.store - local.get $0 - i32.const 20 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 24 - i32.add - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 28 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 24 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 + local.get $8 i32.add - i32.const 20 - i32.sub local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 16 - i32.sub + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 243 + i32.const 13 + call $~lib/builtins/abort + unreachable + end local.get $4 - i32.store - i32.const 24 - local.get $0 i32.const 4 - i32.and - i32.add - local.set $3 - local.get $0 - local.get $3 - i32.add - local.set $0 - local.get $2 - local.get $3 i32.sub - local.set $2 - local.get $4 - i64.extend_i32_u - local.get $4 - i64.extend_i32_u - i64.const 32 - i64.shl - i64.or - local.set $5 - block $break|0 - loop $continue|0 - local.get $2 - i32.const 32 - i32.ge_u - if - block - local.get $0 - local.get $5 - i64.store - local.get $0 - i32.const 8 - i32.add - local.get $5 - i64.store - local.get $0 - i32.const 16 - i32.add - local.get $5 - i64.store - local.get $0 - i32.const 24 - i32.add - local.get $5 - i64.store - local.get $2 - i32.const 32 - i32.sub - local.set $2 - local.get $0 - i32.const 32 - i32.add - local.set $0 - end - br $continue|0 - end - end - end - ) - (func $~lib/arraybuffer/ArrayBuffer#constructor (; 6 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) local.get $1 - i32.const 1073741816 - i32.gt_u + i32.store + local.get $8 + i32.const 256 + i32.lt_u if i32.const 0 - i32.const 8 - i32.const 47 - i32.const 40 - call $~lib/env/abort - unreachable - end - local.get $1 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $3 - local.get $2 - i32.const 0 - i32.ne + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end i32.eqz if + i32.const 0 + i32.const 128 + i32.const 259 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $7 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $7 local.get $3 - i32.const 8 + i32.const 4 + i32.shl + local.get $6 i32.add - local.set $4 - i32.const 0 - local.set $5 + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $0 + local.set $12 + local.get $9 + local.set $7 + local.get $10 + local.set $3 local.get $1 local.set $6 - local.get $4 - local.get $5 + local.get $12 + local.get $7 + i32.const 4 + i32.shl + local.get $3 + i32.add + i32.const 2 + i32.shl + i32.add local.get $6 - call $~lib/internal/memory/memset + i32.store offset=96 + end + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $0 + local.set $13 + local.get $9 + local.set $12 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 end - local.get $3 ) - (func $~lib/internal/memory/memcpy (; 7 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/addMemory (; 7 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) - block $break|0 - loop $continue|0 - local.get $2 - if (result i32) - local.get $1 - i32.const 3 - i32.and - else - local.get $2 - end - if - block - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - end - br $continue|0 - end - end + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + local.get $2 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 end - local.get $0 - i32.const 3 - i32.and + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 385 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 i32.const 0 - i32.eq + local.set $5 + local.get $4 if - block $break|1 - loop $continue|1 - local.get $2 - i32.const 16 - i32.ge_u - if - block - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $1 - i32.const 4 - i32.add - i32.load - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $1 - i32.const 8 - i32.add - i32.load - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 12 - i32.add - i32.load - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - end - br $continue|1 - end - end + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 395 + i32.const 15 + call $~lib/builtins/abort + unreachable end - local.get $2 - i32.const 8 - i32.and + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq if - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $1 - i32.const 4 - i32.add - i32.load - i32.store - local.get $0 - i32.const 8 - i32.add - local.set $0 local.get $1 - i32.const 8 - i32.add + i32.const 16 + i32.sub local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop end - local.get $2 - i32.const 4 - i32.and + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz if - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.set $0 - local.get $1 + i32.const 0 + i32.const 128 + i32.const 407 i32.const 4 - i32.add - local.set $1 + call $~lib/builtins/abort + unreachable end - local.get $2 - i32.const 2 - i32.and - if - local.get $0 - local.get $1 - i32.load16_u - i32.store16 - local.get $0 - i32.const 2 + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 8 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + memory.size + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end + block $break|0 + i32.const 0 + local.set $5 + loop $repeat|0 + local.get $5 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $3 + local.set $7 + local.get $5 + local.set $6 + i32.const 0 + local.set $4 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $7 + loop $repeat|1 + local.get $7 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $3 + local.set $9 + local.get $5 + local.set $8 + local.get $7 + local.set $6 + i32.const 0 + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store offset=96 + end + local.get $7 + i32.const 1 + i32.add + local.set $7 + br $repeat|1 + unreachable + end + unreachable + end + local.get $5 + i32.const 1 i32.add - local.set $0 + local.set $5 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 176 + i32.const 128 + i32.const 447 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) local.get $1 - i32.const 2 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl i32.add - local.set $1 + i32.const 1 + i32.sub + else + local.get $1 end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 337 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + i32.const 0 + local.set $7 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor local.get $2 i32.const 1 + i32.add + i32.shl i32.and + local.set $5 + local.get $5 + i32.eqz if - block (result i32) + i32.const 0 + local.set $7 + else + local.get $5 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) local.get $0 - local.tee $5 - i32.const 1 + local.set $8 + local.get $2 + local.set $4 + local.get $8 + local.get $4 + i32.const 2 + i32.shl i32.add - local.set $0 - local.get $5 + i32.load offset=4 end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 350 + i32.const 17 + call $~lib/builtins/abort + unreachable end - i32.load8_u - i32.store8 + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 end - return + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + memory.size + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + memory.grow + i32.const 0 + i32.lt_s + if + local.get $3 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + memory.size + local.set $7 + local.get $0 + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (; 12 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 364 + i32.const 13 + call $~lib/builtins/abort + unreachable end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and local.get $2 + i32.sub + local.set $4 + local.get $4 i32.const 32 i32.ge_u if - block $break|2 - block $case2|2 - block $case1|2 - block $case0|2 - local.get $0 - i32.const 3 - i32.and - local.set $5 - local.get $5 - i32.const 1 - i32.eq - br_if $case0|2 - local.get $5 - i32.const 2 - i32.eq - br_if $case1|2 - local.get $5 - i32.const 3 - i32.eq - br_if $case2|2 - br $break|2 - end - block - local.get $1 - i32.load - local.set $3 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - local.get $2 - i32.const 3 - i32.sub - local.set $2 - block $break|3 - loop $continue|3 - local.get $2 - i32.const 17 - i32.ge_u - if - block - local.get $1 - i32.const 1 - i32.add - i32.load - local.set $4 - local.get $0 - local.get $3 - i32.const 24 - i32.shr_u - local.get $4 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 5 - i32.add - i32.load - local.set $3 - local.get $0 - i32.const 4 - i32.add - local.get $4 - i32.const 24 - i32.shr_u - local.get $3 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 9 - i32.add - i32.load - local.set $4 - local.get $0 - i32.const 8 - i32.add - local.get $3 - i32.const 24 - i32.shr_u - local.get $4 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 13 - i32.add - i32.load - local.set $3 - local.get $0 - i32.const 12 - i32.add - local.get $4 - i32.const 24 - i32.shr_u - local.get $3 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - end - br $continue|3 - end - end - end - br $break|2 - unreachable - end - unreachable - end - block - local.get $1 - i32.load - local.set $3 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - local.get $2 - i32.const 2 - i32.sub - local.set $2 - block $break|4 - loop $continue|4 - local.get $2 - i32.const 18 - i32.ge_u - if - block - local.get $1 - i32.const 2 - i32.add - i32.load - local.set $4 - local.get $0 - local.get $3 - i32.const 16 - i32.shr_u - local.get $4 - i32.const 16 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 6 - i32.add - i32.load - local.set $3 - local.get $0 - i32.const 4 - i32.add - local.get $4 - i32.const 16 - i32.shr_u - local.get $3 - i32.const 16 - i32.shl + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 477 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 479 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + call $~lib/rt/rtrace/onalloc + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/memory/memory.fill (; 15 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i64) + block $~lib/util/memory/memset|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $3 + i32.eqz + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 1 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 2 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 1 + i32.add + local.get $4 + i32.store8 + local.get $5 + i32.const 2 + i32.add + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 2 + i32.sub + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 3 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 6 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 3 + i32.add + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + i32.const 0 + local.get $5 + i32.sub + i32.const 3 + i32.and + local.set $6 + local.get $5 + local.get $6 + i32.add + local.set $5 + local.get $3 + local.get $6 + i32.sub + local.set $3 + local.get $3 + i32.const -4 + i32.and + local.set $3 + i32.const -1 + i32.const 255 + i32.div_u + local.get $4 + i32.const 255 + i32.and + i32.mul + local.set $7 + local.get $5 + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.get $7 + i32.store + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 4 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 8 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 12 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 8 + i32.sub + local.get $7 + i32.store + local.get $3 + i32.const 24 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 12 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 16 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 20 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 24 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 28 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 24 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 20 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 16 + i32.sub + local.get $7 + i32.store + i32.const 24 + local.get $5 + i32.const 4 + i32.and + i32.add + local.set $6 + local.get $5 + local.get $6 + i32.add + local.set $5 + local.get $3 + local.get $6 + i32.sub + local.set $3 + local.get $7 + i64.extend_i32_u + local.get $7 + i64.extend_i32_u + i64.const 32 + i64.shl + i64.or + local.set $8 + block $break|0 + loop $continue|0 + local.get $3 + i32.const 32 + i32.ge_u + if + local.get $5 + local.get $8 + i64.store + local.get $5 + i32.const 8 + i32.add + local.get $8 + i64.store + local.get $5 + i32.const 16 + i32.add + local.get $8 + i64.store + local.get $5 + i32.const 24 + i32.add + local.get $8 + i64.store + local.get $3 + i32.const 32 + i32.sub + local.set $3 + local.get $5 + i32.const 32 + i32.add + local.set $5 + br $continue|0 + end + end + end + end + ) + (func $~lib/rt/pure/increment (; 16 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/rtrace/onincrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 107 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/pure/__retain (; 17 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment + end + local.get $0 + ) + (func $~lib/arraybuffer/ArrayBuffer#constructor (; 18 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + i32.const 1073741808 + i32.gt_u + if + i32.const 24 + i32.const 72 + i32.const 56 + i32.const 42 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $2 + local.get $2 + i32.const 0 + local.get $1 + call $~lib/memory/memory.fill + local.get $2 + call $~lib/rt/pure/__retain + ) + (func $~lib/arraybuffer/ArrayBuffer#get:byteLength (; 19 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + ) + (func $~lib/util/memory/memcpy (; 20 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + block $break|0 + loop $continue|0 + local.get $2 + if (result i32) + local.get $1 + i32.const 3 + i32.and + else + i32.const 0 + end + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $continue|0 + end + end + end + local.get $0 + i32.const 3 + i32.and + i32.const 0 + i32.eq + if + block $break|1 + loop $continue|1 + local.get $2 + i32.const 16 + i32.ge_u + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 8 + i32.add + i32.load + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 12 + i32.add + i32.load + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|1 + end + end + end + local.get $2 + i32.const 8 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + end + local.get $2 + i32.const 4 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.set $0 + local.get $1 + i32.const 4 + i32.add + local.set $1 + end + local.get $2 + i32.const 2 + i32.and + if + local.get $0 + local.get $1 + i32.load16_u + i32.store16 + local.get $0 + i32.const 2 + i32.add + local.set $0 + local.get $1 + i32.const 2 + i32.add + local.set $1 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + return + end + local.get $2 + i32.const 32 + i32.ge_u + if + block $break|2 + block $case2|2 + block $case1|2 + block $case0|2 + local.get $0 + i32.const 3 + i32.and + local.set $5 + local.get $5 + i32.const 1 + i32.eq + br_if $case0|2 + local.get $5 + i32.const 2 + i32.eq + br_if $case1|2 + local.get $5 + i32.const 3 + i32.eq + br_if $case2|2 + br $break|2 + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 3 + i32.sub + local.set $2 + block $break|3 + loop $continue|3 + local.get $2 + i32.const 17 + i32.ge_u + if + local.get $1 + i32.const 1 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 5 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl i32.or i32.store local.get $1 - i32.const 10 + i32.const 9 i32.add i32.load local.set $4 @@ -907,15 +2052,15 @@ i32.const 8 i32.add local.get $3 - i32.const 16 + i32.const 24 i32.shr_u local.get $4 - i32.const 16 + i32.const 8 i32.shl i32.or i32.store local.get $1 - i32.const 14 + i32.const 13 i32.add i32.load local.set $3 @@ -923,10 +2068,10 @@ i32.const 12 i32.add local.get $4 - i32.const 16 + i32.const 24 i32.shr_u local.get $3 - i32.const 16 + i32.const 8 i32.shl i32.or i32.store @@ -942,1161 +2087,2268 @@ i32.const 16 i32.sub local.set $2 + br $continue|3 end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + block $break|4 + loop $continue|4 + local.get $2 + i32.const 18 + i32.ge_u + if + local.get $1 + i32.const 2 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 6 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 10 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 14 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 br $continue|4 end end end - br $break|2 - unreachable + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + block $break|5 + loop $continue|5 + local.get $2 + i32.const 19 + i32.ge_u + if + local.get $1 + i32.const 3 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 7 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 11 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 15 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|5 + end + end + end + br $break|2 + unreachable + end + unreachable + end + end + local.get $2 + i32.const 16 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 8 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 4 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 2 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + ) + (func $~lib/memory/memory.copy (; 21 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $4 + local.get $3 + i32.add + local.get $5 + i32.le_u + if (result i32) + i32.const 1 + else + local.get $5 + local.get $3 + i32.add + local.get $4 + i32.le_u + end + if + local.get $5 + local.get $4 + local.get $3 + call $~lib/util/memory/memcpy + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end end - unreachable end - block - local.get $1 - i32.load - local.set $3 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end end - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - block $break|5 - loop $continue|5 - local.get $2 - i32.const 19 + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 i32.ge_u if - block - local.get $1 - i32.const 3 - i32.add - i32.load - local.set $4 - local.get $0 - local.get $3 - i32.const 8 - i32.shr_u - local.get $4 - i32.const 24 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 7 - i32.add - i32.load - local.set $3 - local.get $0 - i32.const 4 - i32.add - local.get $4 - i32.const 8 - i32.shr_u - local.get $3 - i32.const 24 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 11 - i32.add - i32.load - local.set $4 - local.get $0 - i32.const 8 - i32.add - local.get $3 - i32.const 8 - i32.shr_u - local.get $4 - i32.const 24 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 15 - i32.add - i32.load - local.set $3 - local.get $0 - i32.const 12 - i32.add - local.get $4 - i32.const 8 - i32.shr_u - local.get $3 - i32.const 24 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - end - br $continue|5 + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 end end end - br $break|2 - unreachable end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/arraybuffer/ArrayBuffer#slice (; 22 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + local.get $0 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength + local.set $3 + local.get $1 + i32.const 0 + i32.lt_s + if (result i32) + local.get $3 + local.get $1 + i32.add + local.tee $4 + i32.const 0 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + else + local.get $1 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.lt_s + select + end + local.set $1 + local.get $2 + i32.const 0 + i32.lt_s + if (result i32) + local.get $3 + local.get $2 + i32.add + local.tee $4 + i32.const 0 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + else + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.lt_s + select + end + local.set $2 + local.get $2 + local.get $1 + i32.sub + local.tee $4 + i32.const 0 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $7 + local.get $7 + local.get $0 + local.get $1 + i32.add + local.get $6 + call $~lib/memory/memory.copy + local.get $7 + call $~lib/rt/pure/__retain + ) + (func $~lib/rt/tlsf/freeBlock (; 23 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 531 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/rtrace/onfree + ) + (func $~lib/rt/__typeinfo (; 24 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/rt/__rtti_base + local.set $1 + local.get $0 + local.get $1 + i32.load + i32.gt_u + if + i32.const 336 + i32.const 392 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 4 + i32.add + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/rt/tlsf/__free (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 561 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 562 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/growRoots (; 26 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/pure/ROOTS + local.set $0 + global.get $~lib/rt/pure/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onfree + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $0 + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onalloc + local.get $0 + call $~lib/rt/tlsf/__free + end + local.get $5 + global.set $~lib/rt/pure/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/pure/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/pure/END + ) + (func $~lib/rt/pure/appendRoot (; 27 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/pure/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 4 + i32.add + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/decrement (; 28 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + call $~lib/rt/rtrace/ondecrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 115 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/rt/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 124 + i32.const 15 + call $~lib/builtins/abort unreachable end - end - local.get $2 - i32.const 16 - i32.and - if - block (result i32) + local.get $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 16 + i32.and + i32.eqz + if local.get $0 - local.tee $5 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) + i32.sub + i32.or + i32.store offset=4 local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/appendRoot + end + else local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) local.get $1 - local.tee $5 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 i32.const 1 - i32.add - local.set $1 - local.get $5 + i32.sub + i32.or + i32.store offset=4 end - i32.load8_u - i32.store8 + end + ) + (func $~lib/rt/pure/__release (; 29 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + end + ) + (func $~lib/arraybuffer/ArrayBuffer.isView<~lib/array/Array> (; 30 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $0 + if block (result i32) local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 + drop + i32.const 0 end - block (result i32) - local.get $1 - local.tee $5 + if i32.const 1 - i32.add local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) + call $~lib/rt/pure/__release local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 + return end - i32.load8_u - i32.store8 block (result i32) local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 + drop + i32.const 0 end - block (result i32) - local.get $1 - local.tee $5 + if i32.const 1 - i32.add local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) + call $~lib/rt/pure/__release local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 + return end - i32.load8_u - i32.store8 block (result i32) local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 + drop + i32.const 0 end - block (result i32) - local.get $1 - local.tee $5 + if i32.const 1 - i32.add local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) + call $~lib/rt/pure/__release local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 + return end - i32.load8_u - i32.store8 block (result i32) local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 + drop + i32.const 0 end - block (result i32) - local.get $1 - local.tee $5 + if i32.const 1 - i32.add local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) + call $~lib/rt/pure/__release local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 + return end - i32.load8_u - i32.store8 block (result i32) local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 + drop + i32.const 0 end - block (result i32) - local.get $1 - local.tee $5 + if i32.const 1 - i32.add local.set $1 - local.get $5 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return end - i32.load8_u - i32.store8 block (result i32) local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 + drop + i32.const 0 end - block (result i32) - local.get $1 - local.tee $5 + if i32.const 1 - i32.add local.set $1 - local.get $5 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return end - i32.load8_u - i32.store8 block (result i32) local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 + drop + i32.const 0 end - block (result i32) - local.get $1 - local.tee $5 + if i32.const 1 - i32.add local.set $1 - local.get $5 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return end - i32.load8_u - i32.store8 block (result i32) local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 + drop + i32.const 0 end - block (result i32) - local.get $1 - local.tee $5 + if i32.const 1 - i32.add local.set $1 - local.get $5 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return end - i32.load8_u - i32.store8 block (result i32) local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 + drop + i32.const 0 end - block (result i32) - local.get $1 - local.tee $5 + if i32.const 1 - i32.add local.set $1 - local.get $5 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return end - i32.load8_u - i32.store8 block (result i32) local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 + drop + i32.const 0 end - block (result i32) - local.get $1 - local.tee $5 + if i32.const 1 - i32.add local.set $1 - local.get $5 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return end - i32.load8_u - i32.store8 - end - local.get $2 - i32.const 8 - i32.and - if block (result i32) local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 + drop + i32.const 0 end - block (result i32) - local.get $1 - local.tee $5 + if i32.const 1 - i32.add local.set $1 - local.get $5 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return end - i32.load8_u - i32.store8 block (result i32) local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 + drop + i32.const 0 end - block (result i32) - local.get $1 - local.tee $5 + if i32.const 1 - i32.add local.set $1 - local.get $5 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return end - i32.load8_u - i32.store8 + end + i32.const 0 + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + ) + (func $~lib/arraybuffer/ArrayBuffer.isView (; 31 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + if block (result i32) local.get $0 - local.tee $5 + drop + i32.const 0 + end + if i32.const 1 - i32.add - local.set $0 - local.get $5 + return end block (result i32) - local.get $1 - local.tee $5 + local.get $0 + drop + i32.const 0 + end + if i32.const 1 - i32.add - local.set $1 - local.get $5 + return end - i32.load8_u - i32.store8 block (result i32) local.get $0 - local.tee $5 + drop + i32.const 0 + end + if i32.const 1 - i32.add - local.set $0 - local.get $5 + return end block (result i32) - local.get $1 - local.tee $5 + local.get $0 + drop + i32.const 0 + end + if i32.const 1 - i32.add - local.set $1 - local.get $5 + return end - i32.load8_u - i32.store8 block (result i32) local.get $0 - local.tee $5 + drop + i32.const 0 + end + if i32.const 1 - i32.add - local.set $0 - local.get $5 + return end block (result i32) - local.get $1 - local.tee $5 + local.get $0 + drop + i32.const 0 + end + if i32.const 1 - i32.add - local.set $1 - local.get $5 + return end - i32.load8_u - i32.store8 block (result i32) local.get $0 - local.tee $5 + drop + i32.const 0 + end + if i32.const 1 - i32.add - local.set $0 - local.get $5 + return end block (result i32) - local.get $1 - local.tee $5 + local.get $0 + drop + i32.const 0 + end + if i32.const 1 - i32.add - local.set $1 - local.get $5 + return end - i32.load8_u - i32.store8 block (result i32) local.get $0 - local.tee $5 + drop + i32.const 0 + end + if i32.const 1 - i32.add - local.set $0 - local.get $5 + return end block (result i32) - local.get $1 - local.tee $5 + local.get $0 + drop + i32.const 0 + end + if i32.const 1 - i32.add - local.set $1 - local.get $5 + return end - i32.load8_u - i32.store8 block (result i32) local.get $0 - local.tee $5 + drop + i32.const 0 + end + if i32.const 1 - i32.add - local.set $0 - local.get $5 + return end block (result i32) - local.get $1 - local.tee $5 + local.get $0 + drop + i32.const 0 + end + if i32.const 1 - i32.add - local.set $1 - local.get $5 + return end - i32.load8_u - i32.store8 end - local.get $2 - i32.const 4 - i32.and + i32.const 0 + ) + (func $~lib/arraybuffer/ArrayBuffer.isView<~lib/typedarray/Uint8Array> (; 32 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $0 if block (result i32) local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 + drop + i32.const 0 end - block (result i32) - local.get $1 - local.tee $5 + if i32.const 1 - i32.add local.set $1 - local.get $5 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return end - i32.load8_u - i32.store8 block (result i32) local.get $0 - local.tee $5 + drop i32.const 1 - i32.add - local.set $0 - local.get $5 end - block (result i32) - local.get $1 - local.tee $5 + if i32.const 1 - i32.add local.set $1 - local.get $5 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return end - i32.load8_u - i32.store8 block (result i32) local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 + drop + i32.const 0 end - block (result i32) - local.get $1 - local.tee $5 + if i32.const 1 - i32.add local.set $1 - local.get $5 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return end - i32.load8_u - i32.store8 block (result i32) local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 + drop + i32.const 0 end - block (result i32) - local.get $1 - local.tee $5 + if i32.const 1 - i32.add local.set $1 - local.get $5 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return end - i32.load8_u - i32.store8 - end - local.get $2 - i32.const 2 - i32.and - if block (result i32) local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 + drop + i32.const 0 end - block (result i32) - local.get $1 - local.tee $5 + if i32.const 1 - i32.add local.set $1 - local.get $5 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return end - i32.load8_u - i32.store8 block (result i32) local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 + drop + i32.const 0 end - block (result i32) - local.get $1 - local.tee $5 + if i32.const 1 - i32.add local.set $1 - local.get $5 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return end - i32.load8_u - i32.store8 - end - local.get $2 - i32.const 1 - i32.and - if block (result i32) local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 + drop + i32.const 0 end - block (result i32) - local.get $1 - local.tee $5 + if i32.const 1 - i32.add local.set $1 - local.get $5 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return + end + block (result i32) + local.get $0 + drop + i32.const 0 end - i32.load8_u - i32.store8 - end - ) - (func $~lib/internal/memory/memmove (; 8 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - local.get $0 - local.get $1 - i32.eq - if - return - end - local.get $1 - local.get $2 - i32.add - local.get $0 - i32.le_u - local.tee $3 - if (result i32) - local.get $3 - else - local.get $0 - local.get $2 - i32.add - local.get $1 - i32.le_u - end - if - local.get $0 - local.get $1 - local.get $2 - call $~lib/internal/memory/memcpy - return - end - local.get $0 - local.get $1 - i32.lt_u - if - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and - i32.eq if - block $break|0 - loop $continue|0 - local.get $0 - i32.const 7 - i32.and - if - block - local.get $2 - i32.eqz - if - return - end - local.get $2 - i32.const 1 - i32.sub - local.set $2 - block (result i32) - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $3 - end - block (result i32) - local.get $1 - local.tee $3 - i32.const 1 - i32.add - local.set $1 - local.get $3 - end - i32.load8_u - i32.store8 - end - br $continue|0 - end - end - end - block $break|1 - loop $continue|1 - local.get $2 - i32.const 8 - i32.ge_u - if - block - local.get $0 - local.get $1 - i64.load - i64.store - local.get $2 - i32.const 8 - i32.sub - local.set $2 - local.get $0 - i32.const 8 - i32.add - local.set $0 - local.get $1 - i32.const 8 - i32.add - local.set $1 - end - br $continue|1 - end - end - end + i32.const 1 + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return end - block $break|2 - loop $continue|2 - local.get $2 - if - block - block (result i32) - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $3 - end - block (result i32) - local.get $1 - local.tee $3 - i32.const 1 - i32.add - local.set $1 - local.get $3 - end - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - end - br $continue|2 - end - end + block (result i32) + local.get $0 + drop + i32.const 0 end - else - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and - i32.eq if - block $break|3 - loop $continue|3 - local.get $0 - local.get $2 - i32.add - i32.const 7 - i32.and - if - block - local.get $2 - i32.eqz - if - return - end - local.get $0 - local.get $2 - i32.const 1 - i32.sub - local.tee $2 - i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 - end - br $continue|3 - end - end - end - block $break|4 - loop $continue|4 - local.get $2 - i32.const 8 - i32.ge_u - if - block - local.get $2 - i32.const 8 - i32.sub - local.set $2 - local.get $0 - local.get $2 - i32.add - local.get $1 - local.get $2 - i32.add - i64.load - i64.store - end - br $continue|4 - end - end - end + i32.const 1 + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return end - block $break|5 - loop $continue|5 - local.get $2 - if - local.get $0 - local.get $2 - i32.const 1 - i32.sub - local.tee $2 - i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 - br $continue|5 - end - end + block (result i32) + local.get $0 + drop + i32.const 0 end - end - ) - (func $~lib/arraybuffer/ArrayBuffer#slice (; 9 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - local.get $0 - i32.load - local.set $3 - local.get $1 - i32.const 0 - i32.lt_s - if (result i32) - local.get $3 - local.get $1 - i32.add - local.tee $4 - i32.const 0 - local.tee $5 - local.get $4 - local.get $5 - i32.gt_s - select - else - local.get $1 - local.tee $4 - local.get $3 - local.tee $5 - local.get $4 - local.get $5 - i32.lt_s - select - end - local.set $1 - local.get $2 - i32.const 0 - i32.lt_s - if (result i32) - local.get $3 - local.get $2 - i32.add - local.tee $4 - i32.const 0 - local.tee $5 - local.get $4 - local.get $5 - i32.gt_s - select - else - local.get $2 - local.tee $4 - local.get $3 - local.tee $5 - local.get $4 - local.get $5 - i32.lt_s - select - end - local.set $2 - local.get $2 - local.get $1 - i32.sub - local.tee $4 - i32.const 0 - local.tee $5 - local.get $4 - local.get $5 - i32.gt_s - select - local.set $3 - local.get $3 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $6 - block $~lib/memory/memory.copy|inlined.0 - local.get $6 - i32.const 8 - i32.add - local.set $4 - local.get $0 - i32.const 8 - i32.add - local.get $1 - i32.add - local.set $5 - local.get $3 - local.set $7 - local.get $4 - local.get $5 - local.get $7 - call $~lib/internal/memory/memmove - end - local.get $6 - ) - (func $~lib/arraybuffer/ArrayBuffer#slice|trampoline (; 10 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - block $2of2 - block $1of2 - block $0of2 - block $outOfRange - global.get $~lib/argc - br_table $0of2 $1of2 $2of2 $outOfRange - end - unreachable - end + if + i32.const 1 + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return + end + block (result i32) + local.get $0 + drop + i32.const 0 + end + if + i32.const 1 + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return + end + block (result i32) + local.get $0 + drop i32.const 0 + end + if + i32.const 1 local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return end - i32.const 1073741816 - local.set $2 end + i32.const 0 + local.set $1 local.get $0 + call $~lib/rt/pure/__release local.get $1 - local.get $2 - call $~lib/arraybuffer/ArrayBuffer#slice ) - (func $~lib/arraybuffer/ArrayBuffer.isView<~lib/array/Array> (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/arraybuffer/ArrayBuffer.isView<~lib/typedarray/Int32Array> (; 33 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) local.get $0 - i32.const 0 - i32.eq - if - i32.const 0 - return - end - i32.const 0 - ) - (func $~lib/arraybuffer/ArrayBuffer.isView (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 0 - i32.eq if - i32.const 0 - return + block (result i32) + local.get $0 + drop + i32.const 0 + end + if + i32.const 1 + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return + end + block (result i32) + local.get $0 + drop + i32.const 0 + end + if + i32.const 1 + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return + end + block (result i32) + local.get $0 + drop + i32.const 0 + end + if + i32.const 1 + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return + end + block (result i32) + local.get $0 + drop + i32.const 0 + end + if + i32.const 1 + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return + end + block (result i32) + local.get $0 + drop + i32.const 0 + end + if + i32.const 1 + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return + end + block (result i32) + local.get $0 + drop + i32.const 1 + end + if + i32.const 1 + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return + end + block (result i32) + local.get $0 + drop + i32.const 0 + end + if + i32.const 1 + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return + end + block (result i32) + local.get $0 + drop + i32.const 0 + end + if + i32.const 1 + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return + end + block (result i32) + local.get $0 + drop + i32.const 0 + end + if + i32.const 1 + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return + end + block (result i32) + local.get $0 + drop + i32.const 0 + end + if + i32.const 1 + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return + end + block (result i32) + local.get $0 + drop + i32.const 0 + end + if + i32.const 1 + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return + end + block (result i32) + local.get $0 + drop + i32.const 0 + end + if + i32.const 1 + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return + end end i32.const 0 - ) - (func $~lib/arraybuffer/ArrayBuffer.isView<~lib/typedarray/Uint8Array> (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.set $1 local.get $0 - i32.const 0 - i32.eq - if - i32.const 0 - return - end - i32.const 1 - return + call $~lib/rt/pure/__release + local.get $1 ) - (func $~lib/arraybuffer/ArrayBuffer.isView<~lib/typedarray/Int32Array> (; 14 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/arraybuffer/ArrayBuffer.isView<~lib/dataview/DataView> (; 34 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) local.get $0 - i32.const 0 - i32.eq - if - i32.const 0 - return - end - i32.const 1 - return - ) - (func $~lib/arraybuffer/ArrayBuffer.isView<~lib/dataview/DataView> (; 15 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 0 - i32.eq if - i32.const 0 - return + block (result i32) + local.get $0 + drop + i32.const 0 + end + if + i32.const 1 + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return + end + block (result i32) + local.get $0 + drop + i32.const 0 + end + if + i32.const 1 + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return + end + block (result i32) + local.get $0 + drop + i32.const 0 + end + if + i32.const 1 + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return + end + block (result i32) + local.get $0 + drop + i32.const 0 + end + if + i32.const 1 + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return + end + block (result i32) + local.get $0 + drop + i32.const 0 + end + if + i32.const 1 + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return + end + block (result i32) + local.get $0 + drop + i32.const 0 + end + if + i32.const 1 + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return + end + block (result i32) + local.get $0 + drop + i32.const 0 + end + if + i32.const 1 + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return + end + block (result i32) + local.get $0 + drop + i32.const 0 + end + if + i32.const 1 + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return + end + block (result i32) + local.get $0 + drop + i32.const 0 + end + if + i32.const 1 + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return + end + block (result i32) + local.get $0 + drop + i32.const 0 + end + if + i32.const 1 + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return + end + block (result i32) + local.get $0 + drop + i32.const 0 + end + if + i32.const 1 + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return + end + block (result i32) + local.get $0 + drop + i32.const 1 + end + if + i32.const 1 + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + return + end end - i32.const 1 - return - ) - (func $~lib/memory/memory.allocate (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.const 0 + local.set $1 local.get $0 - call $~lib/allocator/arena/__memory_allocate - return + call $~lib/rt/pure/__release + local.get $1 ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 17 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) + (func $~lib/arraybuffer/ArrayBufferView#constructor (; 35 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) local.get $1 - i32.const 1073741816 + i32.const 1073741808 + local.get $2 + i32.shr_u i32.gt_u if - i32.const 0 - i32.const 160 - i32.const 23 - i32.const 34 - call $~lib/env/abort + i32.const 24 + i32.const 72 + i32.const 14 + i32.const 56 + call $~lib/builtins/abort unreachable end local.get $1 - i32.const 0 - i32.shl - local.set $2 local.get $2 - call $~lib/internal/arraybuffer/allocateUnsafe + i32.shl + local.tee $1 + i32.const 0 + call $~lib/rt/tlsf/__alloc local.set $3 - block $~lib/memory/memory.fill|inlined.1 - local.get $3 - i32.const 8 - i32.add - local.set $4 - i32.const 0 - local.set $5 - local.get $2 - local.set $6 - local.get $4 - local.get $5 - local.get $6 - call $~lib/internal/memory/memset - end block (result i32) local.get $0 i32.eqz if i32.const 12 - call $~lib/memory/memory.allocate + i32.const 2 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.set $0 end local.get $0 @@ -2110,74 +4362,141 @@ i32.store offset=8 local.get $0 end - local.get $3 + local.tee $4 + block (result i32) + local.get $3 + local.tee $5 + local.get $4 + i32.load + local.tee $4 + i32.ne + if + local.get $5 + call $~lib/rt/pure/__retain + drop + local.get $4 + call $~lib/rt/pure/__release + end + local.get $5 + end i32.store local.get $0 - i32.const 0 + local.get $3 i32.store offset=4 local.get $0 - local.get $2 + local.get $1 i32.store offset=8 local.get $0 ) - (func $~lib/typedarray/Uint8Array#constructor (; 18 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint8Array#constructor (; 36 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 - i32.eqz - if + if (result i32) + local.get $0 + else i32.const 12 - call $~lib/memory/memory.allocate - local.set $0 + i32.const 5 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + end + local.get $1 + i32.const 0 + call $~lib/arraybuffer/ArrayBufferView#constructor + local.set $0 + local.get $0 + ) + (func $~lib/rt/__allocArray (; 37 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + i32.const 16 + local.get $2 + call $~lib/rt/tlsf/__alloc + local.set $4 + local.get $0 + local.get $1 + i32.shl + local.set $5 + local.get $5 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $6 + local.get $4 + local.get $6 + call $~lib/rt/pure/__retain + i32.store + local.get $4 + local.get $6 + i32.store offset=4 + local.get $4 + local.get $5 + i32.store offset=8 + local.get $4 + local.get $0 + i32.store offset=12 + local.get $3 + if + local.get $6 + local.get $3 + local.get $5 + call $~lib/memory/memory.copy end + local.get $4 + ) + (func $~lib/typedarray/Int32Array#constructor (; 38 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 + if (result i32) + local.get $0 + else + i32.const 12 + i32.const 9 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + end local.get $1 - call $~lib/internal/typedarray/TypedArray#constructor + i32.const 2 + call $~lib/arraybuffer/ArrayBufferView#constructor local.set $0 local.get $0 ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 19 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) + (func $~lib/dataview/DataView#constructor (; 39 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) local.get $1 - i32.const 268435454 + call $~lib/rt/pure/__retain + drop + local.get $3 + i32.const 1073741808 + i32.gt_u + local.get $2 + local.get $3 + i32.add + local.get $1 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength i32.gt_u + i32.or if - i32.const 0 - i32.const 160 - i32.const 23 - i32.const 34 - call $~lib/env/abort + local.get $1 + call $~lib/rt/pure/__release + block + i32.const 24 + i32.const 456 + i32.const 21 + i32.const 6 + call $~lib/builtins/abort + unreachable + unreachable + end unreachable end - local.get $1 - i32.const 2 - i32.shl - local.set $2 - local.get $2 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $3 - block $~lib/memory/memory.fill|inlined.2 - local.get $3 - i32.const 8 - i32.add - local.set $4 - i32.const 0 - local.set $5 - local.get $2 - local.set $6 - local.get $4 - local.get $5 - local.get $6 - call $~lib/internal/memory/memset - end block (result i32) local.get $0 i32.eqz if i32.const 12 - call $~lib/memory/memory.allocate + i32.const 15 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.set $0 end local.get $0 @@ -2191,96 +4510,44 @@ i32.store offset=8 local.get $0 end - local.get $3 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - local.get $2 - i32.store offset=8 - local.get $0 - ) - (func $~lib/typedarray/Int32Array#constructor (; 20 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 - i32.eqz - if - i32.const 12 - call $~lib/memory/memory.allocate - local.set $0 - end - local.get $0 - local.get $1 - call $~lib/internal/typedarray/TypedArray#constructor - local.set $0 - local.get $0 - ) - (func $~lib/dataview/DataView#constructor (; 21 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - local.get $3 - global.get $~lib/builtins/i32.MIN_VALUE - i32.eq - if + local.tee $4 + block (result i32) local.get $1 + local.tee $5 + local.get $4 i32.load - local.get $2 - i32.sub - local.set $3 - end - local.get $2 - i32.const 1073741816 - i32.gt_u - if - i32.const 0 - i32.const 248 - i32.const 14 - i32.const 44 - call $~lib/env/abort - unreachable - end - local.get $3 - i32.const 1073741816 - i32.gt_u - if - i32.const 0 - i32.const 248 - i32.const 15 - i32.const 44 - call $~lib/env/abort - unreachable + local.tee $4 + i32.ne + if + local.get $5 + call $~lib/rt/pure/__retain + drop + local.get $4 + call $~lib/rt/pure/__release + end + local.get $5 end + i32.store + local.get $1 local.get $2 - local.get $3 i32.add - local.get $1 - i32.load - i32.gt_s - if - i32.const 0 - i32.const 248 - i32.const 16 - i32.const 53 - call $~lib/env/abort - unreachable - end - local.get $0 - i32.eqz - if - i32.const 12 - call $~lib/memory/memory.allocate - local.set $0 - end - local.get $0 - local.get $1 - i32.store + local.set $6 local.get $0 - local.get $2 + local.get $6 i32.store offset=4 local.get $0 local.get $3 i32.store offset=8 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + ) + (func $~lib/typedarray/Uint8Array#get:buffer (; 40 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 + i32.load + call $~lib/rt/pure/__retain ) - (func $~lib/dataview/DataView#constructor|trampoline (; 22 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/dataview/DataView#constructor|trampoline (; 41 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) block $2of2 block $1of2 block $0of2 @@ -2295,7 +4562,8 @@ i32.const 0 local.set $2 end - global.get $~lib/builtins/i32.MIN_VALUE + local.get $1 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength local.set $3 end local.get $0 @@ -2304,233 +4572,239 @@ local.get $3 call $~lib/dataview/DataView#constructor ) - (func $start:std/arraybuffer (; 23 ;) (type $FUNCSIG$v) + (func $start:std/arraybuffer (; 42 ;) (type $FUNCSIG$v) (local $0 i32) - call $start:~lib/allocator/arena + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) i32.const 0 i32.const 8 - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - global.set $std/arraybuffer/buffer - global.get $std/arraybuffer/buffer - i32.load + local.set $0 + local.get $0 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength i32.const 8 i32.eq i32.eqz if i32.const 0 - i32.const 120 - i32.const 5 - i32.const 0 - call $~lib/env/abort + i32.const 280 + i32.const 4 + i32.const 2 + call $~lib/builtins/abort unreachable end - block (result i32) - i32.const 0 - global.set $~lib/argc - global.get $std/arraybuffer/buffer - i32.const 0 - i32.const 0 - call $~lib/arraybuffer/ArrayBuffer#slice|trampoline - end - global.set $std/arraybuffer/sliced - global.get $std/arraybuffer/sliced - i32.load + local.get $0 + i32.const 0 + i32.const 1073741808 + call $~lib/arraybuffer/ArrayBuffer#slice + local.set $1 + local.get $1 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength i32.const 8 i32.eq i32.eqz if i32.const 0 - i32.const 120 - i32.const 9 - i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/arraybuffer/ArrayBuffer#get:data|inlined.0 (result i32) - global.get $std/arraybuffer/sliced - local.set $0 - local.get $0 + i32.const 280 i32.const 8 - i32.add - end - block $~lib/arraybuffer/ArrayBuffer#get:data|inlined.1 (result i32) - global.get $std/arraybuffer/buffer - local.set $0 - local.get $0 - i32.const 8 - i32.add - end - i32.ne - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 10 - i32.const 0 - call $~lib/env/abort + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/arraybuffer/sliced - global.get $std/arraybuffer/buffer + local.get $1 + local.get $0 i32.ne i32.eqz if i32.const 0 - i32.const 120 - i32.const 11 - i32.const 0 - call $~lib/env/abort + i32.const 280 + i32.const 9 + i32.const 2 + call $~lib/builtins/abort unreachable end block (result i32) + local.get $0 i32.const 1 - global.set $~lib/argc - global.get $std/arraybuffer/buffer - i32.const 1 - i32.const 0 - call $~lib/arraybuffer/ArrayBuffer#slice|trampoline + i32.const 1073741808 + call $~lib/arraybuffer/ArrayBuffer#slice + local.set $2 + local.get $1 + call $~lib/rt/pure/__release + local.get $2 end - global.set $std/arraybuffer/sliced - global.get $std/arraybuffer/sliced - i32.load + local.set $1 + local.get $1 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength i32.const 7 i32.eq i32.eqz if i32.const 0 - i32.const 120 - i32.const 15 - i32.const 0 - call $~lib/env/abort + i32.const 280 + i32.const 13 + i32.const 2 + call $~lib/builtins/abort unreachable end block (result i32) - i32.const 1 - global.set $~lib/argc - global.get $std/arraybuffer/buffer + local.get $0 i32.const -1 - i32.const 0 - call $~lib/arraybuffer/ArrayBuffer#slice|trampoline + i32.const 1073741808 + call $~lib/arraybuffer/ArrayBuffer#slice + local.set $2 + local.get $1 + call $~lib/rt/pure/__release + local.get $2 end - global.set $std/arraybuffer/sliced - global.get $std/arraybuffer/sliced - i32.load + local.set $1 + local.get $1 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength i32.const 1 i32.eq i32.eqz if i32.const 0 - i32.const 120 - i32.const 19 - i32.const 0 - call $~lib/env/abort + i32.const 280 + i32.const 17 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/arraybuffer/buffer - i32.const 1 - i32.const 3 - call $~lib/arraybuffer/ArrayBuffer#slice - global.set $std/arraybuffer/sliced - global.get $std/arraybuffer/sliced - i32.load + block (result i32) + local.get $0 + i32.const 1 + i32.const 3 + call $~lib/arraybuffer/ArrayBuffer#slice + local.set $2 + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + end + local.set $1 + local.get $1 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength i32.const 2 i32.eq i32.eqz if i32.const 0 - i32.const 120 - i32.const 23 - i32.const 0 - call $~lib/env/abort + i32.const 280 + i32.const 21 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/arraybuffer/buffer - i32.const 1 - i32.const -1 - call $~lib/arraybuffer/ArrayBuffer#slice - global.set $std/arraybuffer/sliced - global.get $std/arraybuffer/sliced - i32.load + block (result i32) + local.get $0 + i32.const 1 + i32.const -1 + call $~lib/arraybuffer/ArrayBuffer#slice + local.set $2 + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + end + local.set $1 + local.get $1 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength i32.const 6 i32.eq i32.eqz if i32.const 0 - i32.const 120 - i32.const 27 - i32.const 0 - call $~lib/env/abort + i32.const 280 + i32.const 25 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/arraybuffer/buffer - i32.const -3 - i32.const -1 - call $~lib/arraybuffer/ArrayBuffer#slice - global.set $std/arraybuffer/sliced - global.get $std/arraybuffer/sliced - i32.load + block (result i32) + local.get $0 + i32.const -3 + i32.const -1 + call $~lib/arraybuffer/ArrayBuffer#slice + local.set $2 + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + end + local.set $1 + local.get $1 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength i32.const 2 i32.eq i32.eqz if i32.const 0 - i32.const 120 - i32.const 31 - i32.const 0 - call $~lib/env/abort + i32.const 280 + i32.const 29 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/arraybuffer/buffer - i32.const -4 - i32.const 42 - call $~lib/arraybuffer/ArrayBuffer#slice - global.set $std/arraybuffer/sliced - global.get $std/arraybuffer/sliced - i32.load + block (result i32) + local.get $0 + i32.const -4 + i32.const 42 + call $~lib/arraybuffer/ArrayBuffer#slice + local.set $2 + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + end + local.set $1 + local.get $1 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength i32.const 4 i32.eq i32.eqz if i32.const 0 - i32.const 120 - i32.const 35 - i32.const 0 - call $~lib/env/abort + i32.const 280 + i32.const 33 + i32.const 2 + call $~lib/builtins/abort unreachable end block (result i32) - i32.const 1 - global.set $~lib/argc - global.get $std/arraybuffer/buffer + local.get $0 i32.const 42 - i32.const 0 - call $~lib/arraybuffer/ArrayBuffer#slice|trampoline + i32.const 1073741808 + call $~lib/arraybuffer/ArrayBuffer#slice + local.set $2 + local.get $1 + call $~lib/rt/pure/__release + local.get $2 end - global.set $std/arraybuffer/sliced - global.get $std/arraybuffer/sliced - i32.load + local.set $1 + local.get $1 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength i32.const 0 i32.eq i32.eqz if i32.const 0 - i32.const 120 - i32.const 39 - i32.const 0 - call $~lib/env/abort + i32.const 280 + i32.const 37 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/arraybuffer/sliced + local.get $1 i32.const 0 i32.ne i32.eqz if i32.const 0 - i32.const 120 - i32.const 40 - i32.const 0 - call $~lib/env/abort + i32.const 280 + i32.const 38 + i32.const 2 + call $~lib/builtins/abort unreachable end i32.const 0 @@ -2539,10 +4813,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 42 - i32.const 0 - call $~lib/env/abort + i32.const 280 + i32.const 40 + i32.const 2 + call $~lib/builtins/abort unreachable end i32.const 0 @@ -2551,22 +4825,22 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 43 - i32.const 0 - call $~lib/env/abort + i32.const 280 + i32.const 41 + i32.const 2 + call $~lib/builtins/abort unreachable end i32.const 0 call $~lib/arraybuffer/ArrayBuffer.isView<~lib/typedarray/Uint8Array> i32.eqz i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 44 + if i32.const 0 - call $~lib/env/abort + i32.const 280 + i32.const 42 + i32.const 2 + call $~lib/builtins/abort unreachable end i32.const 0 @@ -2575,10 +4849,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 45 - i32.const 0 - call $~lib/env/abort + i32.const 280 + i32.const 43 + i32.const 2 + call $~lib/builtins/abort unreachable end i32.const 0 @@ -2587,76 +4861,453 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 46 - i32.const 0 - call $~lib/env/abort + i32.const 280 + i32.const 44 + i32.const 2 + call $~lib/builtins/abort unreachable end i32.const 0 i32.const 1 call $~lib/typedarray/Uint8Array#constructor - global.set $std/arraybuffer/arr8 - i32.const 240 + local.set $2 + i32.const 2 + i32.const 2 + i32.const 3 + i32.const 432 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $4 call $~lib/arraybuffer/ArrayBuffer.isView<~lib/array/Array> i32.eqz i32.eqz if i32.const 0 - i32.const 120 - i32.const 49 - i32.const 0 - call $~lib/env/abort + i32.const 280 + i32.const 47 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/arraybuffer/arr8 + local.get $2 call $~lib/arraybuffer/ArrayBuffer.isView<~lib/typedarray/Uint8Array> i32.eqz if i32.const 0 - i32.const 120 - i32.const 50 - i32.const 0 - call $~lib/env/abort + i32.const 280 + i32.const 48 + i32.const 2 + call $~lib/builtins/abort unreachable end i32.const 0 i32.const 1 call $~lib/typedarray/Int32Array#constructor + local.tee $3 call $~lib/arraybuffer/ArrayBuffer.isView<~lib/typedarray/Int32Array> i32.eqz if i32.const 0 - i32.const 120 - i32.const 51 - i32.const 0 - call $~lib/env/abort + i32.const 280 + i32.const 49 + i32.const 2 + call $~lib/builtins/abort unreachable end block (result i32) i32.const 1 global.set $~lib/argc i32.const 0 - global.get $std/arraybuffer/arr8 - i32.load + local.get $2 + call $~lib/typedarray/Uint8Array#get:buffer + local.tee $5 i32.const 0 i32.const 0 call $~lib/dataview/DataView#constructor|trampoline + local.tee $6 end call $~lib/arraybuffer/ArrayBuffer.isView<~lib/dataview/DataView> i32.eqz if i32.const 0 - i32.const 120 - i32.const 52 - i32.const 0 - call $~lib/env/abort + i32.const 280 + i32.const 50 + i32.const 2 + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release ) - (func $start (; 24 ;) (type $FUNCSIG$v) + (func $start (; 43 ;) (type $FUNCSIG$v) call $start:std/arraybuffer ) - (func $null (; 25 ;) (type $FUNCSIG$v) + (func $~lib/array/Array#__visit_impl (; 44 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/rt/pure/markGray (; 45 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members + end + ) + (func $~lib/rt/pure/scanBlack (; 46 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 47 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (; 48 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + ) + (func $~lib/rt/pure/__visit (; 49 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/pure/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 75 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/pure/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 86 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/pure/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 97 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + end + ) + (func $~lib/rt/__visit_members (; 50 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block $block$4$break + block + end + block $switch$1$leave + block $switch$1$default + block $switch$1$case$5 + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$case$5 $switch$1$case$4 $switch$1$case$4 $switch$1$case$4 $switch$1$case$4 $switch$1$case$4 $switch$1$case$4 $switch$1$case$4 $switch$1$case$4 $switch$1$case$4 $switch$1$case$4 $switch$1$case$4 $switch$1$case$4 $switch$1$default + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + br $block$4$break + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$4$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + end + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + ) + (func $null (; 51 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/std/dataview.json b/tests/compiler/std/dataview.json new file mode 100644 index 0000000000..9f7878d475 --- /dev/null +++ b/tests/compiler/std/dataview.json @@ -0,0 +1,6 @@ +{ + "asc_flags": [ + "--runtime half", + "--use ASC_RTRACE=1" + ] +} \ No newline at end of file diff --git a/tests/compiler/std/dataview.optimized.wat b/tests/compiler/std/dataview.optimized.wat index 9727ff2dde..e98883b1e3 100644 --- a/tests/compiler/std/dataview.optimized.wat +++ b/tests/compiler/std/dataview.optimized.wat @@ -1,156 +1,1525 @@ (module - (type $FUNCSIG$v (func)) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$vii (func (param i32 i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$fiii (func (param i32 i32 i32) (result f32))) (type $FUNCSIG$jj (func (param i64) (result i64))) - (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) - (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$dii (func (param i32 i32) (result f64))) (type $FUNCSIG$jii (func (param i32 i32) (result i64))) (type $FUNCSIG$vifi (func (param i32 f32 i32))) (type $FUNCSIG$vidi (func (param i32 f64 i32))) - (type $FUNCSIG$vii (func (param i32 i32))) (type $FUNCSIG$viji (func (param i32 i64 i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32))) + (import "rtrace" "onincrement" (func $~lib/rt/rtrace/onincrement (param i32))) + (import "rtrace" "ondecrement" (func $~lib/rt/rtrace/ondecrement (param i32))) + (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) (memory $0 1) - (data (i32.const 8) "\1b\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s") - (data (i32.const 72) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") - (data (i32.const 136) "\10\00\00\00~\00l\00i\00b\00/\00d\00a\00t\00a\00v\00i\00e\00w\00.\00t\00s") - (data (i32.const 176) "\0f\00\00\00s\00t\00d\00/\00d\00a\00t\00a\00v\00i\00e\00w\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) - (global $std/dataview/array (mut i32) (i32.const 0)) - (global $std/dataview/view (mut i32) (i32.const 0)) + (data (i32.const 8) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h") + (data (i32.const 56) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") + (data (i32.const 112) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s") + (data (i32.const 160) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e") + (data (i32.const 216) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s") + (data (i32.const 264) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e") + (data (i32.const 320) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s") + (data (i32.const 360) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00~\00l\00i\00b\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s") + (data (i32.const 416) " \00\00\00\01\00\00\00\01\00\00\00 \00\00\00~\00l\00i\00b\00/\00d\00a\00t\00a\00v\00i\00e\00w\00.\00t\00s") + (data (i32.const 464) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00s\00t\00d\00/\00d\00a\00t\00a\00v\00i\00e\00w\00.\00t\00s") + (data (i32.const 512) "\05\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\001\00\00\00\02\00\00\00\10") + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) + (global $~lib/argc (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) - (func $~lib/allocator/arena/__memory_allocate (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/rt/tlsf/removeBlock (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) - local.get $0 - i32.const 1073741824 - i32.gt_u + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.tee $3 + i32.const 1 + i32.and + i32.eqz if + i32.const 0 + i32.const 128 + i32.const 276 + i32.const 13 + call $~lib/builtins/abort unreachable end - global.get $~lib/allocator/arena/offset - local.tee $1 - local.get $0 - i32.const 1 - local.get $0 - i32.const 1 - i32.gt_u - select - i32.add - i32.const 7 - i32.add - i32.const -8 + local.get $3 + i32.const -4 i32.and - local.tee $0 - current_memory local.tee $2 i32.const 16 - i32.shl - i32.gt_u + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz if + i32.const 0 + i32.const 128 + i32.const 278 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 256 + i32.lt_u + if (result i32) local.get $2 - local.get $0 - local.get $1 - i32.sub - i32.const 65535 - i32.add - i32.const -65536 - i32.and - i32.const 16 + i32.const 4 i32.shr_u - local.tee $3 + local.set $2 + i32.const 0 + else local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $3 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $2 local.get $3 - i32.gt_s - select - grow_memory + i32.const 7 + i32.sub + end + local.tee $3 + i32.const 23 + i32.lt_u + if (result i32) + local.get $2 + i32.const 16 + i32.lt_u + else i32.const 0 - i32.lt_s + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 291 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=20 + local.set $4 + local.get $1 + i32.load offset=16 + local.tee $5 + if + local.get $5 + local.get $4 + i32.store offset=20 + end + local.get $4 + if + local.get $4 + local.get $5 + i32.store offset=16 + end + local.get $3 + i32.const 4 + i32.shl + local.get $2 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + local.get $1 + i32.eq + if + local.get $3 + i32.const 4 + i32.shl + local.get $2 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $4 + i32.store offset=96 + local.get $4 + i32.eqz if local.get $3 - grow_memory - i32.const 0 - i32.lt_s + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const 1 + local.get $2 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.store offset=4 + local.get $1 + i32.eqz if - unreachable + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $3 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store end end end - local.get $0 - global.set $~lib/allocator/arena/offset - local.get $1 ) - (func $~lib/internal/memory/memset (; 2 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) - local.get $0 - i32.const 0 - i32.store8 - local.get $0 - i32.const 8 - i32.add - local.tee $1 - i32.const 1 - i32.sub - i32.const 0 - i32.store8 - local.get $0 + (func $~lib/rt/tlsf/insertBlock (; 6 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 204 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.tee $3 i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 206 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 i32.add - i32.const 0 - i32.store8 - local.get $0 - i32.const 2 - i32.add - i32.const 0 - i32.store8 local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.tee $5 + i32.const 1 + i32.and + if + local.get $3 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const -4 + i32.and + i32.add + local.tee $2 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $3 + i32.const 3 + i32.and + local.get $2 + i32.or + local.tee $3 + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.set $5 + end + end + local.get $3 i32.const 2 - i32.sub - i32.const 0 - i32.store8 + i32.and + if + local.get $1 + i32.const 4 + i32.sub + i32.load + local.tee $2 + i32.load + local.tee $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 227 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $3 + i32.const -4 + i32.and + i32.add + local.tee $7 + i32.const 1073741808 + i32.lt_u + if (result i32) + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $2 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $3 + i32.store + local.get $2 + else + local.get $1 + end + local.set $1 + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $3 + i32.const -4 + i32.and + local.tee $2 + i32.const 16 + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 local.get $1 - i32.const 3 + i32.const 16 + i32.add + local.get $2 + i32.add + i32.ne + if + i32.const 0 + i32.const 128 + i32.const 243 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 i32.sub - i32.const 0 - i32.store8 + local.get $1 + i32.store + local.get $2 + i32.const 256 + i32.lt_u + if (result i32) + local.get $2 + i32.const 4 + i32.shr_u + local.set $4 + i32.const 0 + else + local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $4 + local.get $2 + i32.const 7 + i32.sub + end + local.tee $3 + i32.const 23 + i32.lt_u + if (result i32) + local.get $4 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 259 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + local.set $2 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $2 + i32.store offset=20 + local.get $2 + if + local.get $2 + local.get $1 + i32.store offset=16 + end + local.get $3 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $1 + i32.store offset=96 + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $3 + i32.shl + i32.or + i32.store + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const 1 + local.get $4 + i32.shl + i32.or + i32.store offset=4 + ) + (func $~lib/rt/tlsf/addMemory (; 7 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $1 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $1 + local.get $2 + i32.le_u + select + select + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 385 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=1568 + local.tee $3 + if + local.get $1 + local.get $3 + i32.const 16 + i32.add + i32.lt_u + if + i32.const 0 + i32.const 128 + i32.const 395 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $3 + i32.eq + if + local.get $3 + i32.load + local.set $4 + local.get $1 + i32.const 16 + i32.sub + local.set $1 + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.lt_u + if + i32.const 0 + i32.const 128 + i32.const 407 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.tee $2 + i32.const 48 + i32.lt_u + if + return + end + local.get $1 + local.get $4 + i32.const 2 + i32.and + local.get $2 + i32.const 32 + i32.sub + i32.const 1 + i32.or + i32.or + i32.store + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $2 + i32.add + i32.const 16 + i32.sub + local.tee $2 + i32.const 2 + i32.store + local.get $0 + local.get $2 + i32.store offset=1568 + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/tlsf/initializeRoot (; 8 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 1 + memory.size + local.tee $0 + i32.gt_s + if (result i32) + i32.const 1 + local.get $0 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + i32.const 560 + i32.const 0 + i32.store + i32.const 2128 + i32.const 0 + i32.store + i32.const 0 + local.set $0 + loop $repeat|0 + block $break|0 + local.get $0 + i32.const 23 + i32.ge_u + br_if $break|0 + local.get $0 + i32.const 2 + i32.shl + i32.const 560 + i32.add + i32.const 0 + i32.store offset=4 + i32.const 0 + local.set $1 + loop $repeat|1 + block $break|1 + local.get $1 + i32.const 16 + i32.ge_u + br_if $break|1 + local.get $0 + i32.const 4 + i32.shl + local.get $1 + i32.add + i32.const 2 + i32.shl + i32.const 560 + i32.add + i32.const 0 + i32.store offset=96 + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|1 + end + end + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + end + i32.const 560 + i32.const 2144 + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + i32.const 560 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 176 + i32.const 128 + i32.const 447 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const -16 + i32.and + local.tee $0 + i32.const 16 + local.get $0 + i32.const 16 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + i32.const 256 + i32.lt_u + if (result i32) + local.get $1 + i32.const 4 + i32.shr_u + local.set $1 + i32.const 0 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + local.get $1 + i32.add + i32.const 1 + i32.sub + local.set $1 + end + local.get $1 + i32.const 31 + local.get $1 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $1 + local.get $2 + i32.const 7 + i32.sub + end + local.tee $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $1 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 337 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const -1 + local.get $1 + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $1 + i32.ctz + local.get $2 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + else + local.get $0 + i32.load + i32.const -1 + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $1 + i32.ctz + local.tee $1 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 350 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.ctz + local.get $1 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + else + i32.const 0 + end + end + ) + (func $~lib/rt/tlsf/growMemory (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + memory.size + local.tee $2 + local.get $1 + i32.const 65535 + i32.add + i32.const -65536 + i32.and + i32.const 16 + i32.shr_u + local.tee $1 + local.get $2 + local.get $1 + i32.gt_s + select + memory.grow + i32.const 0 + i32.lt_s + if + local.get $1 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + local.get $0 + local.get $2 + i32.const 16 + i32.shl + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + ) + (func $~lib/rt/tlsf/prepareBlock (; 12 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + if + i32.const 0 + i32.const 128 + i32.const 364 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const -4 + i32.and + local.get $2 + i32.sub + local.tee $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $3 + i32.const 2 + i32.and + local.get $2 + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.tee $1 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const -2 + i32.and + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + i32.load + i32.const -3 + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.tee $3 + call $~lib/rt/tlsf/searchBlock + local.tee $2 + i32.eqz + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $3 + call $~lib/rt/tlsf/searchBlock + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 477 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + i32.load + i32.const -4 + i32.and + local.get $3 + i32.lt_u + if + i32.const 0 + i32.const 128 + i32.const 479 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 0 + i32.store offset=4 + local.get $2 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $2 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $2 + call $~lib/rt/rtrace/onalloc + local.get $2 + ) + (func $~lib/rt/tlsf/__alloc (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + global.get $~lib/rt/tlsf/ROOT + local.tee $2 + if (result i32) + local.get $2 + else + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + end + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.tee $0 + local.get $1 + i32.store offset=8 + local.get $0 + i32.const 16 + i32.add + ) + (func $~lib/rt/pure/increment (; 15 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const -268435456 + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne + if + i32.const 0 + i32.const 232 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/rtrace/onincrement + local.get $0 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 232 + i32.const 107 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/pure/__retain (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 556 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment + end + local.get $0 + ) + (func $~lib/rt/tlsf/freeBlock (; 17 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.tee $2 + i32.const 1 + i32.and + if + i32.const 0 + i32.const 128 + i32.const 531 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/rtrace/onfree + ) + (func $~lib/rt/__typeinfo (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 512 + i32.load + i32.gt_u + if + i32.const 280 + i32.const 336 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 3 + i32.shl + i32.const 516 + i32.add + i32.load + ) + (func $~lib/memory/memory.copy (; 19 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $2 + local.set $3 + local.get $0 + local.get $1 + i32.eq + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $1 + i32.lt_u + if + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|0 + local.get $0 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + br $continue|0 + end + end + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $1 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + br $continue|1 + end + end + end + loop $continue|2 + local.get $3 + if + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + else + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|3 + local.get $0 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $3 + i32.const 8 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + loop $continue|5 + local.get $3 + if + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + ) + (func $~lib/rt/tlsf/__free (; 20 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 561 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $0 + select + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 562 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/growRoots (; 21 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/pure/CUR + global.get $~lib/rt/pure/ROOTS + local.tee $1 + i32.sub + local.tee $2 + i32.const 1 + i32.shl + local.tee $0 + i32.const 256 + local.get $0 + i32.const 256 + i32.gt_u + select + local.tee $3 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.tee $0 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onfree + local.get $0 + local.get $1 + local.get $2 + call $~lib/memory/memory.copy + local.get $1 + if + local.get $1 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onalloc + local.get $1 + call $~lib/rt/tlsf/__free + end + local.get $0 + global.set $~lib/rt/pure/ROOTS + local.get $0 + local.get $2 + i32.add + global.set $~lib/rt/pure/CUR + local.get $0 + local.get $3 + i32.add + global.set $~lib/rt/pure/END + ) + (func $~lib/rt/pure/appendRoot (; 22 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/pure/CUR + local.tee $1 + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 4 + i32.add + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/decrement (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.tee $2 + i32.const 268435455 + i32.and + local.set $1 + local.get $0 + call $~lib/rt/rtrace/ondecrement + local.get $0 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 232 + i32.const 115 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/rt/__visit_members + local.get $2 + i32.const -2147483648 + i32.and + if + local.get $0 + i32.const -2147483648 + i32.store offset=4 + else + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + else + local.get $1 + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 232 + i32.const 124 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 16 + i32.and + if + local.get $0 + local.get $1 + i32.const 1 + i32.sub + local.get $2 + i32.const -268435456 + i32.and + i32.or + i32.store offset=4 + else + local.get $0 + local.get $1 + i32.const 1 + i32.sub + i32.const -1342177280 + i32.or + i32.store offset=4 + local.get $2 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/appendRoot + end + end + end + ) + (func $~lib/rt/pure/__release (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 - i32.const 3 - i32.add - i32.const 0 - i32.store8 - local.get $1 - i32.const 4 - i32.sub - i32.const 0 - i32.store8 + i32.const 556 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + end ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/arraybuffer/ArrayBufferView#constructor (; 25 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) - i32.const 16 - call $~lib/allocator/arena/__memory_allocate - local.tee $1 - i32.const 8 - i32.store - local.get $1 + (local $2 i32) i32.const 8 - i32.add - call $~lib/internal/memory/memset + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $1 local.get $0 i32.eqz if i32.const 12 - call $~lib/allocator/arena/__memory_allocate + i32.const 2 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.set $0 end local.get $0 @@ -163,162 +1532,182 @@ i32.const 0 i32.store offset=8 local.get $0 + i32.load + local.tee $2 + local.get $1 + i32.ne + if + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release + end + local.get $0 local.get $1 i32.store local.get $0 - i32.const 0 + local.get $1 i32.store offset=4 local.get $0 i32.const 8 i32.store offset=8 local.get $0 ) - (func $~lib/internal/typedarray/TypedArray#__set (; 4 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/typedarray/Uint8Array#__set (; 26 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) local.get $1 local.get $0 i32.load offset=8 i32.ge_u if - i32.const 0 - i32.const 8 - i32.const 50 - i32.const 63 - call $~lib/env/abort + i32.const 280 + i32.const 376 + i32.const 115 + i32.const 44 + call $~lib/builtins/abort unreachable end local.get $0 i32.load offset=4 local.get $1 - local.get $0 - i32.load - i32.add i32.add local.get $2 - i32.store8 offset=8 + i32.store8 + ) + (func $~lib/arraybuffer/ArrayBuffer#get:byteLength (; 27 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 ) - (func $~lib/dataview/DataView#constructor (; 5 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/dataview/DataView#constructor (; 28 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) + (local $4 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop local.get $2 - i32.const -2147483648 - i32.eq - if - local.get $0 - i32.load - local.get $1 - i32.sub - local.set $2 - end - local.get $1 - i32.const 1073741816 - i32.gt_u - if - i32.const 0 - i32.const 136 - i32.const 14 - i32.const 44 - call $~lib/env/abort - unreachable - end - local.get $2 - i32.const 1073741816 + i32.const 1073741808 i32.gt_u - if - i32.const 0 - i32.const 136 - i32.const 15 - i32.const 44 - call $~lib/env/abort - unreachable - end local.get $1 local.get $2 i32.add local.get $0 - i32.load - i32.gt_s + call $~lib/arraybuffer/ArrayBuffer#get:byteLength + i32.gt_u + i32.or if - i32.const 0 - i32.const 136 - i32.const 16 - i32.const 53 - call $~lib/env/abort + local.get $0 + call $~lib/rt/pure/__release + i32.const 24 + i32.const 432 + i32.const 21 + i32.const 6 + call $~lib/builtins/abort unreachable end i32.const 12 - call $~lib/allocator/arena/__memory_allocate + i32.const 4 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.tee $3 + i32.const 0 + i32.store + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + i32.const 0 + i32.store offset=8 + local.get $3 + i32.load + local.tee $4 + local.get $0 + i32.ne + if + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $4 + call $~lib/rt/pure/__release + end + local.get $3 local.get $0 i32.store local.get $3 + local.get $0 local.get $1 + i32.add i32.store offset=4 local.get $3 local.get $2 i32.store offset=8 + local.get $0 + call $~lib/rt/pure/__release local.get $3 ) - (func $~lib/dataview/DataView#getFloat32 (; 6 ;) (type $FUNCSIG$fiii) (param $0 i32) (param $1 i32) (param $2 i32) (result f32) - (local $3 i32) - (local $4 i32) + (func $~lib/typedarray/Uint8Array#get:buffer (; 29 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - i32.load offset=8 - local.set $4 + i32.load + call $~lib/rt/pure/__retain + ) + (func $~lib/arraybuffer/ArrayBufferView#get:byteOffset (; 30 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=4 + local.get $0 + i32.load + i32.sub + ) + (func $~lib/polyfills/bswap (; 31 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const -16711936 + i32.and + i32.const 8 + i32.rotl + local.get $0 + i32.const 16711935 + i32.and + i32.const 8 + i32.rotr + i32.or + ) + (func $~lib/dataview/DataView#getFloat32 (; 32 ;) (type $FUNCSIG$fiii) (param $0 i32) (param $1 i32) (param $2 i32) (result f32) local.get $1 - local.tee $3 - i32.const 1073741816 - i32.gt_u - local.tee $1 - if (result i32) - local.get $1 - else - local.get $3 - i32.const 4 - i32.add - local.get $4 - i32.gt_s - end + i32.const 0 + i32.lt_s + local.get $1 + i32.const 4 + i32.add + local.get $0 + i32.load offset=8 + i32.gt_s + i32.or if - i32.const 0 - i32.const 136 - i32.const 188 - i32.const 73 - call $~lib/env/abort + i32.const 280 + i32.const 432 + i32.const 44 + i32.const 6 + call $~lib/builtins/abort unreachable end local.get $2 if (result f32) - local.get $0 - i32.load local.get $0 i32.load offset=4 + local.get $1 i32.add - local.get $3 - i32.add - f32.load offset=8 + f32.load else - local.get $0 - i32.load local.get $0 i32.load offset=4 + local.get $1 i32.add - local.get $3 - i32.add - i32.load offset=8 - local.tee $0 - i32.const -16711936 - i32.and - i32.const 8 - i32.rotl - local.get $0 - i32.const 16711935 - i32.and - i32.const 8 - i32.rotr - i32.or + i32.load + call $~lib/polyfills/bswap f32.reinterpret_i32 end ) - (func $~lib/polyfills/bswap (; 7 ;) (type $FUNCSIG$jj) (param $0 i64) (result i64) + (func $~lib/polyfills/bswap (; 33 ;) (type $FUNCSIG$jj) (param $0 i64) (result i64) local.get $0 i64.const 8 i64.shr_u @@ -344,204 +1733,149 @@ i64.const 32 i64.rotr ) - (func $~lib/dataview/DataView#getFloat64 (; 8 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) + (func $~lib/dataview/DataView#getFloat64 (; 34 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) i32.const 8 local.get $0 i32.load offset=8 i32.gt_s if - i32.const 0 - i32.const 136 - i32.const 188 - i32.const 73 - call $~lib/env/abort + i32.const 280 + i32.const 432 + i32.const 58 + i32.const 7 + call $~lib/builtins/abort unreachable end local.get $1 if (result f64) - local.get $0 - i32.load local.get $0 i32.load offset=4 - i32.add - f64.load offset=8 + f64.load else - local.get $0 - i32.load local.get $0 i32.load offset=4 - i32.add - i64.load offset=8 + i64.load call $~lib/polyfills/bswap f64.reinterpret_i64 end ) - (func $~lib/dataview/DataView#getInt8 (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) + (func $~lib/dataview/DataView#getInt8 (; 35 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 local.get $0 i32.load offset=8 - local.set $3 - local.get $1 - local.tee $2 - i32.const 1073741816 - i32.gt_u - local.tee $1 - i32.eqz - if - local.get $2 - i32.const 1 - i32.add - local.get $3 - i32.gt_s - local.set $1 - end - local.get $1 + i32.ge_u if - i32.const 0 - i32.const 136 - i32.const 188 - i32.const 73 - call $~lib/env/abort + i32.const 280 + i32.const 432 + i32.const 69 + i32.const 49 + call $~lib/builtins/abort unreachable end local.get $0 - i32.load - local.get $0 i32.load offset=4 + local.get $1 i32.add - local.get $2 - i32.add - i32.load8_s offset=8 + i32.load8_s ) - (func $~lib/dataview/DataView#getInt16 (; 10 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) + (func $~lib/polyfills/bswap (; 36 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - i32.load offset=8 - local.set $4 + i32.const 16 + i32.shl + i32.const 24 + i32.shr_s + i32.const 255 + i32.and + local.get $0 + i32.const 8 + i32.shl + i32.or + ) + (func $~lib/dataview/DataView#getInt16 (; 37 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $1 - local.tee $3 - i32.const 1073741816 - i32.gt_u - local.tee $1 - if (result i32) - local.get $1 - else - local.get $3 - i32.const 2 - i32.add - local.get $4 - i32.gt_s - end + i32.const 0 + i32.lt_s + local.get $1 + i32.const 2 + i32.add + local.get $0 + i32.load offset=8 + i32.gt_s + i32.or if - i32.const 0 - i32.const 136 - i32.const 188 - i32.const 73 - call $~lib/env/abort + i32.const 280 + i32.const 432 + i32.const 77 + i32.const 7 + call $~lib/builtins/abort unreachable end local.get $0 - i32.load - local.get $0 i32.load offset=4 + local.get $1 i32.add - local.get $3 - i32.add - i32.load16_s offset=8 + i32.load16_s local.set $0 local.get $2 - if (result i32) - local.get $0 - else - local.get $0 - i32.const 16 - i32.shl - i32.const 24 - i32.shr_s - i32.const 255 - i32.and + i32.eqz + if local.get $0 - i32.const 8 - i32.shl - i32.or + call $~lib/polyfills/bswap + local.set $0 end + local.get $0 ) - (func $~lib/dataview/DataView#getInt32 (; 11 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) + (func $~lib/dataview/DataView#getInt32 (; 38 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $1 + i32.const 0 + i32.lt_s + local.get $1 + i32.const 4 + i32.add local.get $0 i32.load offset=8 - local.set $4 - local.get $1 - local.tee $3 - i32.const 1073741816 - i32.gt_u - local.tee $1 - if (result i32) - local.get $1 - else - local.get $3 - i32.const 4 - i32.add - local.get $4 - i32.gt_s - end + i32.gt_s + i32.or if - i32.const 0 - i32.const 136 - i32.const 188 - i32.const 73 - call $~lib/env/abort + i32.const 280 + i32.const 432 + i32.const 86 + i32.const 7 + call $~lib/builtins/abort unreachable end local.get $0 - i32.load - local.get $0 i32.load offset=4 + local.get $1 i32.add - local.get $3 - i32.add - i32.load offset=8 + i32.load local.set $0 local.get $2 - if (result i32) - local.get $0 - else - local.get $0 - i32.const -16711936 - i32.and - i32.const 8 - i32.rotl + i32.eqz + if local.get $0 - i32.const 16711935 - i32.and - i32.const 8 - i32.rotr - i32.or + call $~lib/polyfills/bswap + local.set $0 end + local.get $0 ) - (func $~lib/dataview/DataView#getInt64 (; 12 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) + (func $~lib/dataview/DataView#getInt64 (; 39 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) (local $2 i64) i32.const 8 local.get $0 i32.load offset=8 i32.gt_s if - i32.const 0 - i32.const 136 - i32.const 188 - i32.const 73 - call $~lib/env/abort + i32.const 280 + i32.const 432 + i32.const 180 + i32.const 6 + call $~lib/builtins/abort unreachable end local.get $0 - i32.load - local.get $0 i32.load offset=4 - i32.add - i64.load offset=8 + i64.load local.set $2 local.get $1 if (result i64) @@ -551,389 +1885,439 @@ call $~lib/polyfills/bswap end ) - (func $~lib/dataview/DataView#getUint8 (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) + (func $~lib/dataview/DataView#getUint8 (; 40 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 local.get $0 i32.load offset=8 - local.set $3 - local.get $1 - local.tee $2 - i32.const 1073741816 - i32.gt_u - local.tee $1 - i32.eqz + i32.ge_u if - local.get $2 - i32.const 1 - i32.add - local.get $3 - i32.gt_s - local.set $1 + i32.const 280 + i32.const 432 + i32.const 92 + i32.const 49 + call $~lib/builtins/abort + unreachable end + local.get $0 + i32.load offset=4 + local.get $1 + i32.add + i32.load8_u + ) + (func $~lib/polyfills/bswap (; 41 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 8 + i32.shl + local.get $0 + i32.const 65535 + i32.and + i32.const 8 + i32.shr_u + i32.or + ) + (func $~lib/dataview/DataView#getUint16 (; 42 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $1 + i32.const 0 + i32.lt_s + local.get $1 + i32.const 2 + i32.add + local.get $0 + i32.load offset=8 + i32.gt_s + i32.or if - i32.const 0 - i32.const 136 - i32.const 188 - i32.const 73 - call $~lib/env/abort + i32.const 280 + i32.const 432 + i32.const 100 + i32.const 6 + call $~lib/builtins/abort unreachable end local.get $0 - i32.load - local.get $0 i32.load offset=4 + local.get $1 i32.add + i32.load16_u + local.set $0 local.get $2 - i32.add - i32.load8_u offset=8 + i32.eqz + if + local.get $0 + call $~lib/polyfills/bswap + local.set $0 + end + local.get $0 ) - (func $~lib/dataview/DataView#getUint16 (; 14 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) + (func $~lib/dataview/DataView#getUint32 (; 43 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $1 + i32.const 0 + i32.lt_s + local.get $1 + i32.const 4 + i32.add local.get $0 i32.load offset=8 - local.set $4 - local.get $1 - local.tee $3 - i32.const 1073741816 - i32.gt_u - local.tee $1 - if (result i32) - local.get $1 - else - local.get $3 - i32.const 2 - i32.add - local.get $4 - i32.gt_s - end + i32.gt_s + i32.or if - i32.const 0 - i32.const 136 - i32.const 188 - i32.const 73 - call $~lib/env/abort + i32.const 280 + i32.const 432 + i32.const 109 + i32.const 6 + call $~lib/builtins/abort unreachable end local.get $0 - i32.load - local.get $0 i32.load offset=4 + local.get $1 i32.add - local.get $3 - i32.add - i32.load16_u offset=8 + i32.load local.set $0 local.get $2 - if (result i32) + i32.eqz + if local.get $0 + call $~lib/polyfills/bswap + local.set $0 + end + local.get $0 + ) + (func $~lib/dataview/DataView#getUint64 (; 44 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) + (local $2 i64) + i32.const 8 + local.get $0 + i32.load offset=8 + i32.gt_s + if + i32.const 280 + i32.const 432 + i32.const 189 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + i64.load + local.set $2 + local.get $1 + if (result i64) + local.get $2 else - local.get $0 - i32.const 8 - i32.shl - local.get $0 - i32.const 65535 - i32.and - i32.const 8 - i32.shr_u - i32.or + local.get $2 + call $~lib/polyfills/bswap end ) - (func $~lib/dataview/DataView#setFloat32 (; 15 ;) (type $FUNCSIG$vifi) (param $0 i32) (param $1 f32) (param $2 i32) + (func $~lib/dataview/DataView#setFloat32 (; 45 ;) (type $FUNCSIG$vifi) (param $0 i32) (param $1 f32) (param $2 i32) i32.const 4 local.get $0 i32.load offset=8 i32.gt_s if - i32.const 0 - i32.const 136 - i32.const 188 - i32.const 73 - call $~lib/env/abort + i32.const 280 + i32.const 432 + i32.const 118 + i32.const 6 + call $~lib/builtins/abort unreachable end local.get $2 if - local.get $0 - i32.load local.get $0 i32.load offset=4 - i32.add local.get $1 - f32.store offset=8 + f32.store else - local.get $0 - i32.load local.get $0 i32.load offset=4 - i32.add local.get $1 i32.reinterpret_f32 - local.tee $0 - i32.const -16711936 - i32.and - i32.const 8 - i32.rotl - local.get $0 - i32.const 16711935 - i32.and - i32.const 8 - i32.rotr - i32.or - i32.store offset=8 + call $~lib/polyfills/bswap + i32.store end ) - (func $~lib/dataview/DataView#setFloat64 (; 16 ;) (type $FUNCSIG$vidi) (param $0 i32) (param $1 f64) (param $2 i32) + (func $~lib/dataview/DataView#setFloat64 (; 46 ;) (type $FUNCSIG$vidi) (param $0 i32) (param $1 f64) (param $2 i32) i32.const 8 local.get $0 i32.load offset=8 i32.gt_s if - i32.const 0 - i32.const 136 - i32.const 188 - i32.const 73 - call $~lib/env/abort + i32.const 280 + i32.const 432 + i32.const 127 + i32.const 6 + call $~lib/builtins/abort unreachable end local.get $2 if - local.get $0 - i32.load local.get $0 i32.load offset=4 - i32.add local.get $1 - f64.store offset=8 + f64.store else - local.get $0 - i32.load local.get $0 i32.load offset=4 - i32.add local.get $1 i64.reinterpret_f64 call $~lib/polyfills/bswap - i64.store offset=8 + i64.store end ) - (func $~lib/dataview/DataView#setInt8 (; 17 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - i32.const 1 + (func $~lib/dataview/DataView#setInt8 (; 47 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 0 local.get $0 i32.load offset=8 - i32.gt_s + i32.ge_u if - i32.const 0 - i32.const 136 - i32.const 188 - i32.const 73 - call $~lib/env/abort + i32.const 280 + i32.const 432 + i32.const 133 + i32.const 49 + call $~lib/builtins/abort unreachable end local.get $0 - i32.load - local.get $0 i32.load offset=4 - i32.add - local.get $1 - i32.store8 offset=8 + i32.const 108 + i32.store8 ) - (func $~lib/dataview/DataView#setInt16 (; 18 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/dataview/DataView#setInt16 (; 48 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) i32.const 2 local.get $0 i32.load offset=8 i32.gt_s if - i32.const 0 - i32.const 136 - i32.const 188 - i32.const 73 - call $~lib/env/abort + i32.const 280 + i32.const 432 + i32.const 141 + i32.const 6 + call $~lib/builtins/abort unreachable end local.get $0 - i32.load + i32.load offset=4 + local.get $2 + if (result i32) + local.get $1 + else + local.get $1 + call $~lib/polyfills/bswap + end + i32.store16 + ) + (func $~lib/dataview/DataView#setInt32 (; 49 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + i32.const 4 + local.get $0 + i32.load offset=8 + i32.gt_s + if + i32.const 280 + i32.const 432 + i32.const 149 + i32.const 6 + call $~lib/builtins/abort + unreachable + end local.get $0 i32.load offset=4 - i32.add - local.set $0 local.get $2 - i32.eqz + if (result i32) + local.get $1 + else + local.get $1 + call $~lib/polyfills/bswap + end + i32.store + ) + (func $~lib/dataview/DataView#setInt64 (; 50 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) + i32.const 8 + local.get $0 + i32.load offset=8 + i32.gt_s if + i32.const 280 + i32.const 432 + i32.const 198 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + local.get $2 + if (result i64) local.get $1 - i32.const 16 - i32.shl - i32.const 24 - i32.shr_s - i32.const 255 - i32.and + else local.get $1 - i32.const 8 - i32.shl - i32.or - local.set $1 + call $~lib/polyfills/bswap end + i64.store + ) + (func $~lib/dataview/DataView#setUint8 (; 51 ;) (type $FUNCSIG$vi) (param $0 i32) + i32.const 0 local.get $0 - local.get $1 - i32.store16 offset=8 + i32.load offset=8 + i32.ge_u + if + i32.const 280 + i32.const 432 + i32.const 154 + i32.const 49 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + i32.const 238 + i32.store8 ) - (func $~lib/dataview/DataView#setInt32 (; 19 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - i32.const 4 + (func $~lib/dataview/DataView#setUint16 (; 52 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + i32.const 2 local.get $0 i32.load offset=8 i32.gt_s if - i32.const 0 - i32.const 136 - i32.const 188 - i32.const 73 - call $~lib/env/abort + i32.const 280 + i32.const 432 + i32.const 162 + i32.const 6 + call $~lib/builtins/abort unreachable end local.get $0 - i32.load - local.get $0 i32.load offset=4 - i32.add - local.set $0 local.get $2 - i32.eqz - if + if (result i32) local.get $1 - i32.const -16711936 - i32.and - i32.const 8 - i32.rotl + else local.get $1 - i32.const 16711935 - i32.and - i32.const 8 - i32.rotr - i32.or - local.set $1 + call $~lib/polyfills/bswap end - local.get $0 - local.get $1 - i32.store offset=8 + i32.store16 ) - (func $~lib/dataview/DataView#setInt64 (; 20 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) - i32.const 8 + (func $~lib/dataview/DataView#setUint32 (; 53 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + i32.const 4 local.get $0 i32.load offset=8 i32.gt_s if - i32.const 0 - i32.const 136 - i32.const 188 - i32.const 73 - call $~lib/env/abort + i32.const 280 + i32.const 432 + i32.const 170 + i32.const 6 + call $~lib/builtins/abort unreachable end local.get $0 - i32.load - local.get $0 i32.load offset=4 - i32.add local.get $2 - if (result i64) + if (result i32) local.get $1 else local.get $1 - call $~lib/polyfills/bswap + call $~lib/polyfills/bswap end - i64.store offset=8 + i32.store ) - (func $~lib/dataview/DataView#setUint16 (; 21 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - i32.const 2 + (func $~lib/dataview/DataView#setUint64 (; 54 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) + i32.const 8 local.get $0 i32.load offset=8 i32.gt_s if - i32.const 0 - i32.const 136 - i32.const 188 - i32.const 73 - call $~lib/env/abort + i32.const 280 + i32.const 432 + i32.const 206 + i32.const 6 + call $~lib/builtins/abort unreachable end local.get $0 - i32.load - local.get $0 i32.load offset=4 - i32.add - local.set $0 local.get $2 - i32.eqz - if + if (result i64) local.get $1 - i32.const 8 - i32.shl + else local.get $1 - i32.const 65535 - i32.and - i32.const 8 - i32.shr_u - i32.or + call $~lib/polyfills/bswap + end + i64.store + ) + (func $~lib/dataview/DataView#constructor|trampoline (; 55 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + block $2of2 + block $1of2 + block $outOfRange + global.get $~lib/argc + i32.const 1 + i32.sub + br_table $1of2 $1of2 $2of2 $outOfRange + end + unreachable + end + local.get $0 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength local.set $1 end local.get $0 + i32.const 0 local.get $1 - i32.store16 offset=8 + call $~lib/dataview/DataView#constructor ) - (func $start:std/dataview (; 22 ;) (type $FUNCSIG$v) + (func $start:std/dataview (; 56 ;) (type $FUNCSIG$v) (local $0 i32) - i32.const 216 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) i32.const 12 - call $~lib/allocator/arena/__memory_allocate - call $~lib/internal/typedarray/TypedArray#constructor - global.set $std/dataview/array - global.get $std/dataview/array + i32.const 3 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + call $~lib/arraybuffer/ArrayBufferView#constructor + local.tee $1 i32.const 0 i32.const 246 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/dataview/array + call $~lib/typedarray/Uint8Array#__set + local.get $1 i32.const 1 i32.const 224 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/dataview/array + call $~lib/typedarray/Uint8Array#__set + local.get $1 i32.const 2 i32.const 88 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/dataview/array + call $~lib/typedarray/Uint8Array#__set + local.get $1 i32.const 3 i32.const 159 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/dataview/array + call $~lib/typedarray/Uint8Array#__set + local.get $1 i32.const 4 i32.const 130 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/dataview/array + call $~lib/typedarray/Uint8Array#__set + local.get $1 i32.const 5 i32.const 101 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/dataview/array + call $~lib/typedarray/Uint8Array#__set + local.get $1 i32.const 6 i32.const 67 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/dataview/array + call $~lib/typedarray/Uint8Array#__set + local.get $1 i32.const 7 i32.const 95 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/dataview/array - local.tee $0 - i32.load - local.get $0 - i32.load offset=4 - local.get $0 + call $~lib/typedarray/Uint8Array#__set + local.get $1 + call $~lib/typedarray/Uint8Array#get:buffer + local.tee $3 + local.get $1 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset + local.get $1 i32.load offset=8 call $~lib/dataview/DataView#constructor - global.set $std/dataview/view - global.get $std/dataview/view + local.tee $0 i32.const 0 i32.const 1 call $~lib/dataview/DataView#getFloat32 @@ -941,13 +2325,13 @@ f32.ne if i32.const 0 - i32.const 176 - i32.const 16 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 15 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 1 i32.const 1 call $~lib/dataview/DataView#getFloat32 @@ -955,13 +2339,13 @@ f32.ne if i32.const 0 - i32.const 176 - i32.const 17 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 16 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 2 i32.const 1 call $~lib/dataview/DataView#getFloat32 @@ -969,13 +2353,13 @@ f32.ne if i32.const 0 - i32.const 176 - i32.const 18 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 17 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 3 i32.const 1 call $~lib/dataview/DataView#getFloat32 @@ -983,13 +2367,13 @@ f32.ne if i32.const 0 - i32.const 176 - i32.const 19 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 18 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 4 i32.const 1 call $~lib/dataview/DataView#getFloat32 @@ -997,13 +2381,13 @@ f32.ne if i32.const 0 - i32.const 176 - i32.const 20 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 19 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 0 i32.const 0 call $~lib/dataview/DataView#getFloat32 @@ -1011,13 +2395,13 @@ f32.ne if i32.const 0 - i32.const 176 - i32.const 22 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 21 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 1 i32.const 0 call $~lib/dataview/DataView#getFloat32 @@ -1025,13 +2409,13 @@ f32.ne if i32.const 0 - i32.const 176 - i32.const 23 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 22 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 2 i32.const 0 call $~lib/dataview/DataView#getFloat32 @@ -1039,13 +2423,13 @@ f32.ne if i32.const 0 - i32.const 176 - i32.const 24 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 23 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 3 i32.const 0 call $~lib/dataview/DataView#getFloat32 @@ -1053,13 +2437,13 @@ f32.ne if i32.const 0 - i32.const 176 - i32.const 25 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 24 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 4 i32.const 0 call $~lib/dataview/DataView#getFloat32 @@ -1067,143 +2451,143 @@ f32.ne if i32.const 0 - i32.const 176 - i32.const 26 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 25 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 1 call $~lib/dataview/DataView#getFloat64 f64.const 7936550095674706383278551e126 f64.ne if i32.const 0 - i32.const 176 - i32.const 28 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 27 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 0 call $~lib/dataview/DataView#getFloat64 f64.const -411777475818852546741639e241 f64.ne if i32.const 0 - i32.const 176 - i32.const 29 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 28 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 0 call $~lib/dataview/DataView#getInt8 i32.const -10 i32.ne if i32.const 0 - i32.const 176 - i32.const 31 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 30 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 1 call $~lib/dataview/DataView#getInt8 i32.const -32 i32.ne if i32.const 0 - i32.const 176 - i32.const 32 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 31 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 2 call $~lib/dataview/DataView#getInt8 i32.const 88 i32.ne if i32.const 0 - i32.const 176 - i32.const 33 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 32 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 3 call $~lib/dataview/DataView#getInt8 i32.const -97 i32.ne if i32.const 0 - i32.const 176 - i32.const 34 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 33 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 4 call $~lib/dataview/DataView#getInt8 i32.const -126 i32.ne if i32.const 0 - i32.const 176 - i32.const 35 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 34 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 5 call $~lib/dataview/DataView#getInt8 i32.const 101 i32.ne if i32.const 0 - i32.const 176 - i32.const 36 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 35 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 6 call $~lib/dataview/DataView#getInt8 i32.const 67 i32.ne if i32.const 0 - i32.const 176 - i32.const 37 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 36 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 7 call $~lib/dataview/DataView#getInt8 i32.const 95 i32.ne if i32.const 0 - i32.const 176 - i32.const 38 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 37 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 0 i32.const 1 call $~lib/dataview/DataView#getInt16 @@ -1213,13 +2597,13 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 40 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 39 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 1 i32.const 1 call $~lib/dataview/DataView#getInt16 @@ -1229,13 +2613,13 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 41 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 40 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 2 i32.const 1 call $~lib/dataview/DataView#getInt16 @@ -1245,13 +2629,13 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 42 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 41 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 3 i32.const 1 call $~lib/dataview/DataView#getInt16 @@ -1261,13 +2645,13 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 43 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 42 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 4 i32.const 1 call $~lib/dataview/DataView#getInt16 @@ -1277,13 +2661,13 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 44 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 43 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 5 i32.const 1 call $~lib/dataview/DataView#getInt16 @@ -1293,13 +2677,13 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 45 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 44 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 6 i32.const 1 call $~lib/dataview/DataView#getInt16 @@ -1309,13 +2693,13 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 46 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 45 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 0 i32.const 0 call $~lib/dataview/DataView#getInt16 @@ -1325,13 +2709,13 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 48 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 47 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 1 i32.const 0 call $~lib/dataview/DataView#getInt16 @@ -1341,13 +2725,13 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 49 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 48 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 2 i32.const 0 call $~lib/dataview/DataView#getInt16 @@ -1357,29 +2741,29 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 50 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 49 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 3 i32.const 0 call $~lib/dataview/DataView#getInt16 i32.const 65535 i32.and i32.const 40834 - i32.ne - if - i32.const 0 - i32.const 176 - i32.const 51 + i32.ne + if i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 50 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 4 i32.const 0 call $~lib/dataview/DataView#getInt16 @@ -1389,13 +2773,13 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 52 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 51 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 5 i32.const 0 call $~lib/dataview/DataView#getInt16 @@ -1405,13 +2789,13 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 53 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 52 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 6 i32.const 0 call $~lib/dataview/DataView#getInt16 @@ -1421,13 +2805,13 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 54 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 53 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 0 i32.const 1 call $~lib/dataview/DataView#getInt32 @@ -1435,13 +2819,13 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 56 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 55 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 1 i32.const 1 call $~lib/dataview/DataView#getInt32 @@ -1449,13 +2833,13 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 57 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 56 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 2 i32.const 1 call $~lib/dataview/DataView#getInt32 @@ -1463,13 +2847,13 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 58 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 57 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 3 i32.const 1 call $~lib/dataview/DataView#getInt32 @@ -1477,13 +2861,13 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 59 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 58 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 4 i32.const 1 call $~lib/dataview/DataView#getInt32 @@ -1491,13 +2875,13 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 60 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 59 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 0 i32.const 0 call $~lib/dataview/DataView#getInt32 @@ -1505,13 +2889,13 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 62 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 61 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 1 i32.const 0 call $~lib/dataview/DataView#getInt32 @@ -1519,13 +2903,13 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 63 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 62 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 2 i32.const 0 call $~lib/dataview/DataView#getInt32 @@ -1533,13 +2917,13 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 64 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 63 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 3 i32.const 0 call $~lib/dataview/DataView#getInt32 @@ -1547,13 +2931,13 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 65 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 64 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 4 i32.const 0 call $~lib/dataview/DataView#getInt32 @@ -1561,143 +2945,143 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 66 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 65 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 1 call $~lib/dataview/DataView#getInt64 i64.const 6864441868736323830 i64.ne if i32.const 0 - i32.const 176 - i32.const 68 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 67 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 0 call $~lib/dataview/DataView#getInt64 i64.const -657428103485373601 i64.ne if i32.const 0 - i32.const 176 - i32.const 69 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 68 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 0 call $~lib/dataview/DataView#getUint8 i32.const 246 i32.ne if i32.const 0 - i32.const 176 - i32.const 71 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 70 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 1 call $~lib/dataview/DataView#getUint8 i32.const 224 i32.ne if i32.const 0 - i32.const 176 - i32.const 72 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 71 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 2 call $~lib/dataview/DataView#getUint8 i32.const 88 i32.ne if i32.const 0 - i32.const 176 - i32.const 73 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 72 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 3 call $~lib/dataview/DataView#getUint8 i32.const 159 i32.ne if i32.const 0 - i32.const 176 - i32.const 74 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 73 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 4 call $~lib/dataview/DataView#getUint8 i32.const 130 i32.ne if i32.const 0 - i32.const 176 - i32.const 75 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 74 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 5 call $~lib/dataview/DataView#getUint8 i32.const 101 i32.ne if i32.const 0 - i32.const 176 - i32.const 76 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 75 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 6 call $~lib/dataview/DataView#getUint8 i32.const 67 i32.ne if i32.const 0 - i32.const 176 - i32.const 77 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 76 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 7 call $~lib/dataview/DataView#getUint8 i32.const 95 i32.ne if i32.const 0 - i32.const 176 - i32.const 78 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 77 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 0 i32.const 1 call $~lib/dataview/DataView#getUint16 @@ -1707,13 +3091,13 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 80 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 79 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 1 i32.const 1 call $~lib/dataview/DataView#getUint16 @@ -1723,13 +3107,13 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 81 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 80 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 2 i32.const 1 call $~lib/dataview/DataView#getUint16 @@ -1739,13 +3123,13 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 82 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 81 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 3 i32.const 1 call $~lib/dataview/DataView#getUint16 @@ -1755,13 +3139,13 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 83 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 82 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 4 i32.const 1 call $~lib/dataview/DataView#getUint16 @@ -1771,13 +3155,13 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 84 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 83 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 5 i32.const 1 call $~lib/dataview/DataView#getUint16 @@ -1787,13 +3171,13 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 85 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 84 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 6 i32.const 1 call $~lib/dataview/DataView#getUint16 @@ -1803,13 +3187,13 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 86 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 85 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 0 i32.const 0 call $~lib/dataview/DataView#getUint16 @@ -1819,13 +3203,13 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 88 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 87 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 1 i32.const 0 call $~lib/dataview/DataView#getUint16 @@ -1835,13 +3219,13 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 89 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 88 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 2 i32.const 0 call $~lib/dataview/DataView#getUint16 @@ -1851,13 +3235,13 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 90 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 89 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 3 i32.const 0 call $~lib/dataview/DataView#getUint16 @@ -1867,13 +3251,13 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 91 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 90 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 4 i32.const 0 call $~lib/dataview/DataView#getUint16 @@ -1883,13 +3267,13 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 92 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 91 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 5 i32.const 0 call $~lib/dataview/DataView#getUint16 @@ -1899,13 +3283,13 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 93 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 92 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 6 i32.const 0 call $~lib/dataview/DataView#getUint16 @@ -1915,183 +3299,183 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 94 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 93 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 0 i32.const 1 - call $~lib/dataview/DataView#getInt32 + call $~lib/dataview/DataView#getUint32 i32.const -1621565194 i32.ne if i32.const 0 - i32.const 176 - i32.const 96 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 95 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 1 i32.const 1 - call $~lib/dataview/DataView#getInt32 + call $~lib/dataview/DataView#getUint32 i32.const -2103486240 i32.ne if i32.const 0 - i32.const 176 - i32.const 97 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 96 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 2 i32.const 1 - call $~lib/dataview/DataView#getInt32 + call $~lib/dataview/DataView#getUint32 i32.const 1703059288 i32.ne if i32.const 0 - i32.const 176 - i32.const 98 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 97 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 3 i32.const 1 - call $~lib/dataview/DataView#getInt32 + call $~lib/dataview/DataView#getUint32 i32.const 1130726047 i32.ne if i32.const 0 - i32.const 176 - i32.const 99 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 98 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 4 i32.const 1 - call $~lib/dataview/DataView#getInt32 + call $~lib/dataview/DataView#getUint32 i32.const 1598252418 i32.ne if i32.const 0 - i32.const 176 - i32.const 100 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 99 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 0 i32.const 0 - call $~lib/dataview/DataView#getInt32 + call $~lib/dataview/DataView#getUint32 i32.const -153069409 - i32.ne - if - i32.const 0 - i32.const 176 - i32.const 102 + i32.ne + if i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 101 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 1 i32.const 0 - call $~lib/dataview/DataView#getInt32 + call $~lib/dataview/DataView#getUint32 i32.const -531062910 i32.ne if i32.const 0 - i32.const 176 - i32.const 103 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 102 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 2 i32.const 0 - call $~lib/dataview/DataView#getInt32 + call $~lib/dataview/DataView#getUint32 i32.const 1486848613 i32.ne if i32.const 0 - i32.const 176 - i32.const 104 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 103 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 3 i32.const 0 - call $~lib/dataview/DataView#getInt32 + call $~lib/dataview/DataView#getUint32 i32.const -1618844349 i32.ne if i32.const 0 - i32.const 176 - i32.const 105 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 4 i32.const 0 - call $~lib/dataview/DataView#getInt32 + call $~lib/dataview/DataView#getUint32 i32.const -2107292833 i32.ne if i32.const 0 - i32.const 176 - i32.const 106 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 105 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 1 - call $~lib/dataview/DataView#getInt64 + call $~lib/dataview/DataView#getUint64 i64.const 6864441868736323830 i64.ne if i32.const 0 - i32.const 176 - i32.const 108 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 107 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 0 - call $~lib/dataview/DataView#getInt64 + call $~lib/dataview/DataView#getUint64 i64.const -657428103485373601 i64.ne if i32.const 0 - i32.const 176 - i32.const 109 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 108 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 f32.const 1.5976661625240943e-18 i32.const 1 call $~lib/dataview/DataView#setFloat32 - global.get $std/dataview/view + local.get $0 i32.const 0 i32.const 1 call $~lib/dataview/DataView#getFloat32 @@ -2099,17 +3483,17 @@ f32.ne if i32.const 0 - i32.const 176 - i32.const 112 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 111 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 f32.const 1976281973381696323584 i32.const 0 call $~lib/dataview/DataView#setFloat32 - global.get $std/dataview/view + local.get $0 i32.const 0 i32.const 0 call $~lib/dataview/DataView#getFloat32 @@ -2117,67 +3501,66 @@ f32.ne if i32.const 0 - i32.const 176 - i32.const 115 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 114 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 f64.const -1094252199637739024055454e124 i32.const 1 call $~lib/dataview/DataView#setFloat64 - global.get $std/dataview/view + local.get $0 i32.const 1 call $~lib/dataview/DataView#getFloat64 f64.const -1094252199637739024055454e124 f64.ne if i32.const 0 - i32.const 176 - i32.const 118 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 117 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 f64.const 6.022586634778589e-103 i32.const 0 call $~lib/dataview/DataView#setFloat64 - global.get $std/dataview/view + local.get $0 i32.const 0 call $~lib/dataview/DataView#getFloat64 f64.const 6.022586634778589e-103 f64.ne if i32.const 0 - i32.const 176 - i32.const 121 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 120 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view - i32.const 108 + local.get $0 call $~lib/dataview/DataView#setInt8 - global.get $std/dataview/view + local.get $0 i32.const 0 call $~lib/dataview/DataView#getInt8 i32.const 108 i32.ne if i32.const 0 - i32.const 176 - i32.const 124 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 123 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const -13360 i32.const 1 call $~lib/dataview/DataView#setInt16 - global.get $std/dataview/view + local.get $0 i32.const 0 i32.const 1 call $~lib/dataview/DataView#getInt16 @@ -2187,17 +3570,17 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 127 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 126 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 14689 i32.const 0 call $~lib/dataview/DataView#setInt16 - global.get $std/dataview/view + local.get $0 i32.const 0 i32.const 0 call $~lib/dataview/DataView#getInt16 @@ -2207,17 +3590,17 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 130 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 129 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 1204680201 i32.const 1 call $~lib/dataview/DataView#setInt32 - global.get $std/dataview/view + local.get $0 i32.const 0 i32.const 1 call $~lib/dataview/DataView#getInt32 @@ -2225,17 +3608,17 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 133 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 132 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 660673230 i32.const 0 call $~lib/dataview/DataView#setInt32 - global.get $std/dataview/view + local.get $0 i32.const 0 i32.const 0 call $~lib/dataview/DataView#getInt32 @@ -2243,67 +3626,66 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 136 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 135 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i64.const -3290739641816099749 i32.const 1 call $~lib/dataview/DataView#setInt64 - global.get $std/dataview/view + local.get $0 i32.const 1 call $~lib/dataview/DataView#getInt64 i64.const -3290739641816099749 i64.ne if i32.const 0 - i32.const 176 - i32.const 139 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 138 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i64.const 8178932412950708047 i32.const 0 call $~lib/dataview/DataView#setInt64 - global.get $std/dataview/view + local.get $0 i32.const 0 call $~lib/dataview/DataView#getInt64 i64.const 8178932412950708047 i64.ne if i32.const 0 - i32.const 176 - i32.const 142 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 141 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view - i32.const 238 - call $~lib/dataview/DataView#setInt8 - global.get $std/dataview/view + local.get $0 + call $~lib/dataview/DataView#setUint8 + local.get $0 i32.const 0 call $~lib/dataview/DataView#getUint8 i32.const 238 i32.ne if i32.const 0 - i32.const 176 - i32.const 145 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 144 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 58856 i32.const 1 call $~lib/dataview/DataView#setUint16 - global.get $std/dataview/view + local.get $0 i32.const 0 i32.const 1 call $~lib/dataview/DataView#getUint16 @@ -2313,17 +3695,17 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 148 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 147 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const 60400 i32.const 0 call $~lib/dataview/DataView#setUint16 - global.get $std/dataview/view + local.get $0 i32.const 0 i32.const 0 call $~lib/dataview/DataView#getUint16 @@ -2333,87 +3715,364 @@ i32.ne if i32.const 0 - i32.const 176 - i32.const 151 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 150 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const -846805744 i32.const 1 - call $~lib/dataview/DataView#setInt32 - global.get $std/dataview/view + call $~lib/dataview/DataView#setUint32 + local.get $0 i32.const 0 i32.const 1 - call $~lib/dataview/DataView#getInt32 + call $~lib/dataview/DataView#getUint32 i32.const -846805744 i32.ne if i32.const 0 - i32.const 176 - i32.const 154 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 153 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i32.const -1510791631 i32.const 0 - call $~lib/dataview/DataView#setInt32 - global.get $std/dataview/view + call $~lib/dataview/DataView#setUint32 + local.get $0 i32.const 0 i32.const 0 - call $~lib/dataview/DataView#getInt32 + call $~lib/dataview/DataView#getUint32 i32.const -1510791631 i32.ne if i32.const 0 - i32.const 176 - i32.const 157 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 156 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i64.const 2334704782995986958 i32.const 1 - call $~lib/dataview/DataView#setInt64 - global.get $std/dataview/view + call $~lib/dataview/DataView#setUint64 + local.get $0 i32.const 1 - call $~lib/dataview/DataView#getInt64 + call $~lib/dataview/DataView#getUint64 i64.const 2334704782995986958 i64.ne if i32.const 0 - i32.const 176 - i32.const 160 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 159 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $0 i64.const -7123186897289856329 i32.const 0 - call $~lib/dataview/DataView#setInt64 - global.get $std/dataview/view + call $~lib/dataview/DataView#setUint64 + local.get $0 i32.const 0 - call $~lib/dataview/DataView#getInt64 + call $~lib/dataview/DataView#getUint64 i64.const -7123186897289856329 i64.ne if i32.const 0 - i32.const 176 - i32.const 163 + i32.const 480 + i32.const 162 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 1 + global.set $~lib/argc + local.get $1 + call $~lib/typedarray/Uint8Array#get:buffer + local.tee $4 + call $~lib/dataview/DataView#constructor|trampoline + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset + if + i32.const 0 + i32.const 480 + i32.const 165 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.load offset=8 + i32.const 8 + i32.ne + if i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 166 + i32.const 2 + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release ) - (func $start (; 23 ;) (type $FUNCSIG$v) + (func $start (; 57 ;) (type $FUNCSIG$v) call $start:std/dataview ) - (func $null (; 24 ;) (type $FUNCSIG$v) + (func $~lib/rt/pure/markGray (; 58 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members + end + ) + (func $~lib/rt/pure/scanBlack (; 59 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 60 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (; 61 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + ) + (func $~lib/rt/pure/__visit (; 62 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + local.get $0 + i32.const 556 + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $0 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + local.get $1 + i32.const 1 + i32.ne + if + local.get $1 + i32.const 2 + i32.eq + br_if $case1|0 + block $tablify|0 + local.get $1 + i32.const 3 + i32.sub + br_table $case2|0 $case3|0 $case4|0 $tablify|0 + end + br $case5|0 + end + local.get $0 + call $~lib/rt/pure/decrement + br $break|0 + end + local.get $0 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 232 + i32.const 75 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $0 + call $~lib/rt/pure/markGray + br $break|0 + end + local.get $0 + call $~lib/rt/pure/scan + br $break|0 + end + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const -268435456 + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne + if + i32.const 0 + i32.const 232 + i32.const 86 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $1 + i32.const 1879048192 + i32.and + if + local.get $0 + call $~lib/rt/pure/scanBlack + end + br $break|0 + end + local.get $0 + call $~lib/rt/pure/collectWhite + br $break|0 + end + i32.const 0 + i32.const 232 + i32.const 97 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/__visit_members (; 63 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + block $switch$1$default + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$case$4 $switch$1$case$4 $switch$1$default + end + return + end + local.get $0 + i32.load + local.tee $0 + if + local.get $0 + local.get $1 + call $~lib/rt/pure/__visit + end + return + end + unreachable + ) + (func $null (; 64 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/dataview.ts b/tests/compiler/std/dataview.ts index 68e12f34a6..309ab77d17 100644 --- a/tests/compiler/std/dataview.ts +++ b/tests/compiler/std/dataview.ts @@ -1,163 +1,167 @@ -import "allocator/arena"; - -var array = new Uint8Array(8); - -array[0] = 246; -array[1] = 224; -array[2] = 88; -array[3] = 159; -array[4] = 130; -array[5] = 101; -array[6] = 67; -array[7] = 95; - -var view = new DataView(array.buffer, array.byteOffset, array.byteLength); - -assert(view.getFloat32(0, true) === -4.592586247781397e-20); -assert(view.getFloat32(1, true) === -2.3413961970849473e-37); -assert(view.getFloat32(2, true) === 7.710587701863113e+22); -assert(view.getFloat32(3, true) === 229.51023864746094); -assert(view.getFloat32(4, true) === 14079802746555335000.0); - -assert(view.getFloat32(0, false) === -2.2751405188178955e+33); -assert(view.getFloat32(1, false) === -62437351080004160000.0); -assert(view.getFloat32(2, false) === 1403059112509440.0); -assert(view.getFloat32(3, false) === -5.522466503261712e-20); -assert(view.getFloat32(4, false) === -1.6843597451835358e-37); - -assert(view.getFloat64(0, true) === 7.936550095674706e+150); -assert(view.getFloat64(0, false) === -4.1177747581885255e+264); - -assert(view.getInt8(0) === -10); -assert(view.getInt8(1) === -32); -assert(view.getInt8(2) === 88); -assert(view.getInt8(3) === -97); -assert(view.getInt8(4) === -126); -assert(view.getInt8(5) === 101); -assert(view.getInt8(6) === 67); -assert(view.getInt8(7) === 95); - -assert(view.getInt16(0, true) === -7946); -assert(view.getInt16(1, true) === 22752); -assert(view.getInt16(2, true) === -24744); -assert(view.getInt16(3, true) === -32097); -assert(view.getInt16(4, true) === 25986); -assert(view.getInt16(5, true) === 17253); -assert(view.getInt16(6, true) === 24387); - -assert(view.getInt16(0, false) === -2336); -assert(view.getInt16(1, false) === -8104); -assert(view.getInt16(2, false) === 22687); -assert(view.getInt16(3, false) === -24702); -assert(view.getInt16(4, false) === -32155); -assert(view.getInt16(5, false) === 25923); -assert(view.getInt16(6, false) === 17247); - -assert(view.getInt32(0, true) === -1621565194); -assert(view.getInt32(1, true) === -2103486240); -assert(view.getInt32(2, true) === 1703059288); -assert(view.getInt32(3, true) === 1130726047); -assert(view.getInt32(4, true) === 1598252418); - -assert(view.getInt32(0, false) === -153069409); -assert(view.getInt32(1, false) === -531062910); -assert(view.getInt32(2, false) === 1486848613); -assert(view.getInt32(3, false) === -1618844349); -assert(view.getInt32(4, false) === -2107292833); - -assert(view.getInt64(0, true) === 6864441868736323830); -assert(view.getInt64(0, false) === -657428103485373601); - -assert(view.getUint8(0) === 246); -assert(view.getUint8(1) === 224); -assert(view.getUint8(2) === 88); -assert(view.getUint8(3) === 159); -assert(view.getUint8(4) === 130); -assert(view.getUint8(5) === 101); -assert(view.getUint8(6) === 67); -assert(view.getUint8(7) === 95); - -assert(view.getUint16(0, true) === 57590); -assert(view.getUint16(1, true) === 22752); -assert(view.getUint16(2, true) === 40792); -assert(view.getUint16(3, true) === 33439); -assert(view.getUint16(4, true) === 25986); -assert(view.getUint16(5, true) === 17253); -assert(view.getUint16(6, true) === 24387); - -assert(view.getUint16(0, false) === 63200); -assert(view.getUint16(1, false) === 57432); -assert(view.getUint16(2, false) === 22687); -assert(view.getUint16(3, false) === 40834); -assert(view.getUint16(4, false) === 33381); -assert(view.getUint16(5, false) === 25923); -assert(view.getUint16(6, false) === 17247); - -assert(view.getUint32(0, true) === 2673402102); -assert(view.getUint32(1, true) === 2191481056); -assert(view.getUint32(2, true) === 1703059288); -assert(view.getUint32(3, true) === 1130726047); -assert(view.getUint32(4, true) === 1598252418); - -assert(view.getUint32(0, false) === 4141897887); -assert(view.getUint32(1, false) === 3763904386); -assert(view.getUint32(2, false) === 1486848613); -assert(view.getUint32(3, false) === 2676122947); -assert(view.getUint32(4, false) === 2187674463); - -assert(view.getUint64(0, true) === 6864441868736323830); -assert(view.getUint64(0, false) === 17789315970224178015); - -view.setFloat32(0, 1.5976661625240943e-18, true); -assert(view.getFloat32(0, true) === 1.5976661625240943e-18); - -view.setFloat32(0, 1.9762819733816963e+21, false); -assert(view.getFloat32(0, false) === 1.9762819733816963e+21); - -view.setFloat64(0, -1.094252199637739e+148, true); -assert(view.getFloat64(0, true) === -1.094252199637739e+148); - -view.setFloat64(0, 6.022586634778589e-103, false); -assert(view.getFloat64(0, false) === 6.022586634778589e-103); - -view.setInt8(0, 108); -assert(view.getInt8(0) === 108); - -view.setInt16(0, -13360, true); -assert(view.getInt16(0, true) === -13360); - -view.setInt16(0, 14689, false); -assert(view.getInt16(0, false) === 14689); - -view.setInt32(0, 1204680201, true); -assert(view.getInt32(0, true) === 1204680201); - -view.setInt32(0, 660673230, false); -assert(view.getInt32(0, false) === 660673230); - -view.setInt64(0, -3290739641816099749, true); -assert(view.getInt64(0, true) === -3290739641816099749); - -view.setInt64(0, 8178932412950708047, false); -assert(view.getInt64(0, false) === 8178932412950708047); - -view.setUint8(0, 238); -assert(view.getUint8(0) === 238); - -view.setUint16(0, 58856, true); -assert(view.getUint16(0, true) === 58856); - -view.setUint16(0, 60400, false); -assert(view.getUint16(0, false) === 60400); - -view.setUint32(0, 3448161552, true); -assert(view.getUint32(0, true) === 3448161552); +{ + let array = new Uint8Array(8); + + array[0] = 246; + array[1] = 224; + array[2] = 88; + array[3] = 159; + array[4] = 130; + array[5] = 101; + array[6] = 67; + array[7] = 95; + + let view = new DataView(array.buffer, array.byteOffset, array.byteLength); + + assert(view.getFloat32(0, true) === -4.592586247781397e-20); + assert(view.getFloat32(1, true) === -2.3413961970849473e-37); + assert(view.getFloat32(2, true) === 7.710587701863113e+22); + assert(view.getFloat32(3, true) === 229.51023864746094); + assert(view.getFloat32(4, true) === 14079802746555335000.0); + + assert(view.getFloat32(0, false) === -2.2751405188178955e+33); + assert(view.getFloat32(1, false) === -62437351080004160000.0); + assert(view.getFloat32(2, false) === 1403059112509440.0); + assert(view.getFloat32(3, false) === -5.522466503261712e-20); + assert(view.getFloat32(4, false) === -1.6843597451835358e-37); + + assert(view.getFloat64(0, true) === 7.936550095674706e+150); + assert(view.getFloat64(0, false) === -4.1177747581885255e+264); + + assert(view.getInt8(0) === -10); + assert(view.getInt8(1) === -32); + assert(view.getInt8(2) === 88); + assert(view.getInt8(3) === -97); + assert(view.getInt8(4) === -126); + assert(view.getInt8(5) === 101); + assert(view.getInt8(6) === 67); + assert(view.getInt8(7) === 95); + + assert(view.getInt16(0, true) === -7946); + assert(view.getInt16(1, true) === 22752); + assert(view.getInt16(2, true) === -24744); + assert(view.getInt16(3, true) === -32097); + assert(view.getInt16(4, true) === 25986); + assert(view.getInt16(5, true) === 17253); + assert(view.getInt16(6, true) === 24387); + + assert(view.getInt16(0, false) === -2336); + assert(view.getInt16(1, false) === -8104); + assert(view.getInt16(2, false) === 22687); + assert(view.getInt16(3, false) === -24702); + assert(view.getInt16(4, false) === -32155); + assert(view.getInt16(5, false) === 25923); + assert(view.getInt16(6, false) === 17247); + + assert(view.getInt32(0, true) === -1621565194); + assert(view.getInt32(1, true) === -2103486240); + assert(view.getInt32(2, true) === 1703059288); + assert(view.getInt32(3, true) === 1130726047); + assert(view.getInt32(4, true) === 1598252418); + + assert(view.getInt32(0, false) === -153069409); + assert(view.getInt32(1, false) === -531062910); + assert(view.getInt32(2, false) === 1486848613); + assert(view.getInt32(3, false) === -1618844349); + assert(view.getInt32(4, false) === -2107292833); + + assert(view.getInt64(0, true) === 6864441868736323830); + assert(view.getInt64(0, false) === -657428103485373601); + + assert(view.getUint8(0) === 246); + assert(view.getUint8(1) === 224); + assert(view.getUint8(2) === 88); + assert(view.getUint8(3) === 159); + assert(view.getUint8(4) === 130); + assert(view.getUint8(5) === 101); + assert(view.getUint8(6) === 67); + assert(view.getUint8(7) === 95); + + assert(view.getUint16(0, true) === 57590); + assert(view.getUint16(1, true) === 22752); + assert(view.getUint16(2, true) === 40792); + assert(view.getUint16(3, true) === 33439); + assert(view.getUint16(4, true) === 25986); + assert(view.getUint16(5, true) === 17253); + assert(view.getUint16(6, true) === 24387); + + assert(view.getUint16(0, false) === 63200); + assert(view.getUint16(1, false) === 57432); + assert(view.getUint16(2, false) === 22687); + assert(view.getUint16(3, false) === 40834); + assert(view.getUint16(4, false) === 33381); + assert(view.getUint16(5, false) === 25923); + assert(view.getUint16(6, false) === 17247); + + assert(view.getUint32(0, true) === 2673402102); + assert(view.getUint32(1, true) === 2191481056); + assert(view.getUint32(2, true) === 1703059288); + assert(view.getUint32(3, true) === 1130726047); + assert(view.getUint32(4, true) === 1598252418); + + assert(view.getUint32(0, false) === 4141897887); + assert(view.getUint32(1, false) === 3763904386); + assert(view.getUint32(2, false) === 1486848613); + assert(view.getUint32(3, false) === 2676122947); + assert(view.getUint32(4, false) === 2187674463); + + assert(view.getUint64(0, true) === 6864441868736323830); + assert(view.getUint64(0, false) === 17789315970224178015); + + view.setFloat32(0, 1.5976661625240943e-18, true); + assert(view.getFloat32(0, true) === 1.5976661625240943e-18); + + view.setFloat32(0, 1.9762819733816963e+21, false); + assert(view.getFloat32(0, false) === 1.9762819733816963e+21); + + view.setFloat64(0, -1.094252199637739e+148, true); + assert(view.getFloat64(0, true) === -1.094252199637739e+148); + + view.setFloat64(0, 6.022586634778589e-103, false); + assert(view.getFloat64(0, false) === 6.022586634778589e-103); + + view.setInt8(0, 108); + assert(view.getInt8(0) === 108); + + view.setInt16(0, -13360, true); + assert(view.getInt16(0, true) === -13360); + + view.setInt16(0, 14689, false); + assert(view.getInt16(0, false) === 14689); + + view.setInt32(0, 1204680201, true); + assert(view.getInt32(0, true) === 1204680201); + + view.setInt32(0, 660673230, false); + assert(view.getInt32(0, false) === 660673230); + + view.setInt64(0, -3290739641816099749, true); + assert(view.getInt64(0, true) === -3290739641816099749); + + view.setInt64(0, 8178932412950708047, false); + assert(view.getInt64(0, false) === 8178932412950708047); + + view.setUint8(0, 238); + assert(view.getUint8(0) === 238); + + view.setUint16(0, 58856, true); + assert(view.getUint16(0, true) === 58856); + + view.setUint16(0, 60400, false); + assert(view.getUint16(0, false) === 60400); + + view.setUint32(0, 3448161552, true); + assert(view.getUint32(0, true) === 3448161552); -view.setUint32(0, 2784175665, false); -assert(view.getUint32(0, false) === 2784175665); + view.setUint32(0, 2784175665, false); + assert(view.getUint32(0, false) === 2784175665); -view.setUint64(0, 2334704782995986958, true); -assert(view.getUint64(0, true) === 2334704782995986958); + view.setUint64(0, 2334704782995986958, true); + assert(view.getUint64(0, true) === 2334704782995986958); -view.setUint64(0, 11323557176419695287, false); -assert(view.getUint64(0, false) === 11323557176419695287); + view.setUint64(0, 11323557176419695287, false); + assert(view.getUint64(0, false) === 11323557176419695287); + + view = new DataView(array.buffer); + assert(view.byteOffset == 0); + assert(view.byteLength == 8); +} diff --git a/tests/compiler/std/dataview.untouched.wat b/tests/compiler/std/dataview.untouched.wat index 4d7b3a3266..841a366421 100644 --- a/tests/compiler/std/dataview.untouched.wat +++ b/tests/compiler/std/dataview.untouched.wat @@ -1,470 +1,3311 @@ (module - (type $FUNCSIG$v (func)) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$vii (func (param i32 i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$iiiii (func (param i32 i32 i32 i32) (result i32))) (type $FUNCSIG$fiii (func (param i32 i32 i32) (result f32))) (type $FUNCSIG$diii (func (param i32 i32 i32) (result f64))) (type $FUNCSIG$jj (func (param i64) (result i64))) - (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$jiii (func (param i32 i32 i32) (result i64))) (type $FUNCSIG$viifi (func (param i32 i32 f32 i32))) (type $FUNCSIG$viidi (func (param i32 i32 f64 i32))) (type $FUNCSIG$viiji (func (param i32 i32 i64 i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32))) + (import "rtrace" "onincrement" (func $~lib/rt/rtrace/onincrement (param i32))) + (import "rtrace" "ondecrement" (func $~lib/rt/rtrace/ondecrement (param i32))) + (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) (memory $0 1) - (data (i32.const 8) "\1b\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s\00") - (data (i32.const 72) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") - (data (i32.const 136) "\10\00\00\00~\00l\00i\00b\00/\00d\00a\00t\00a\00v\00i\00e\00w\00.\00t\00s\00") - (data (i32.const 176) "\0f\00\00\00s\00t\00d\00/\00d\00a\00t\00a\00v\00i\00e\00w\00.\00t\00s\00") + (data (i32.const 8) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h\00") + (data (i32.const 56) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") + (data (i32.const 112) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 160) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 216) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s\00") + (data (i32.const 264) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 320) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s\00") + (data (i32.const 360) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00~\00l\00i\00b\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s\00") + (data (i32.const 416) " \00\00\00\01\00\00\00\01\00\00\00 \00\00\00~\00l\00i\00b\00/\00d\00a\00t\00a\00v\00i\00e\00w\00.\00t\00s\00") + (data (i32.const 464) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00s\00t\00d\00/\00d\00a\00t\00a\00v\00i\00e\00w\00.\00t\00s\00") + (data (i32.const 512) "\05\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\001\00\00\00\02\00\00\00\10\00\00\00\00\00\00\00") (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) - (global $std/dataview/array (mut i32) (i32.const 0)) - (global $~lib/builtins/i32.MIN_VALUE i32 (i32.const -2147483648)) - (global $std/dataview/view (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 212)) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) + (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/argc (mut i32) (i32.const 0)) + (global $~lib/rt/__rtti_base i32 (i32.const 512)) + (global $~lib/heap/__heap_base i32 (i32.const 556)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) - (func $start:~lib/allocator/arena (; 1 ;) (type $FUNCSIG$v) - global.get $~lib/memory/HEAP_BASE - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - ) - (func $~lib/internal/arraybuffer/computeSize (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 1 - i32.const 32 - local.get $0 - i32.const 8 - i32.add - i32.const 1 - i32.sub - i32.clz - i32.sub - i32.shl - ) - (func $~lib/allocator/arena/__memory_allocate (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/rt/tlsf/removeBlock (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - local.get $0 - i32.const 1073741824 - i32.gt_u + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz if + i32.const 0 + i32.const 128 + i32.const 276 + i32.const 13 + call $~lib/builtins/abort unreachable end - global.get $~lib/allocator/arena/offset - local.set $1 - local.get $1 - local.get $0 - local.tee $2 - i32.const 1 - local.tee $3 local.get $2 - local.get $3 - i32.gt_u - select - i32.add - i32.const 7 - i32.add - i32.const 7 + i32.const 3 i32.const -1 i32.xor i32.and - local.set $4 - current_memory - local.set $5 - local.get $4 - local.get $5 + local.set $3 + local.get $3 i32.const 16 - i32.shl - i32.gt_u + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 278 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 local.get $4 - local.get $1 + i32.const 4 i32.sub - i32.const 65535 - i32.add - i32.const 65535 - i32.const -1 - i32.xor - i32.and - i32.const 16 i32.shr_u - local.set $2 + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) local.get $5 - local.tee $3 - local.get $2 - local.tee $6 - local.get $3 - local.get $6 - i32.gt_s - select - local.set $3 - local.get $3 - grow_memory + i32.const 16 + i32.lt_u + else i32.const 0 - i32.lt_s - if - local.get $2 - grow_memory - i32.const 0 - i32.lt_s - if - unreachable - end - end end - local.get $4 - global.set $~lib/allocator/arena/offset - local.get $1 - ) - (func $~lib/internal/arraybuffer/allocateUnsafe (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - local.get $0 - i32.const 1073741816 - i32.le_u i32.eqz if i32.const 0 - i32.const 72 - i32.const 26 - i32.const 2 - call $~lib/env/abort + i32.const 128 + i32.const 291 + i32.const 13 + call $~lib/builtins/abort unreachable end - block $~lib/memory/memory.allocate|inlined.0 (result i32) - local.get $0 - call $~lib/internal/arraybuffer/computeSize - local.set $2 - local.get $2 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.0 - end - local.set $1 local.get $1 - local.get $0 - i32.store + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $9 + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $8 + local.get $4 + local.set $11 + local.get $9 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $9 + local.set $10 + local.get $8 + local.get $11 + i32.const 2 + i32.shl + i32.add + local.get $10 + i32.store offset=4 + end + local.get $9 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end ) - (func $~lib/internal/memory/memset (; 5 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/insertBlock (; 6 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i64) - local.get $2 + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 i32.eqz if - return + i32.const 0 + i32.const 128 + i32.const 204 + i32.const 13 + call $~lib/builtins/abort + unreachable end - local.get $0 local.get $1 - i32.store8 - local.get $0 + i32.load + local.set $2 local.get $2 - i32.add i32.const 1 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 2 - i32.le_u + i32.and + i32.eqz if - return + i32.const 0 + i32.const 128 + i32.const 206 + i32.const 13 + call $~lib/builtins/abort + unreachable end - local.get $0 + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 i32.const 1 - i32.add - local.get $1 - i32.store8 - local.get $0 - i32.const 2 - i32.add - local.get $1 - i32.store8 - local.get $0 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end local.get $2 - i32.add i32.const 2 - i32.sub - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 3 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 6 - i32.le_u + i32.and if - return + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 4 + i32.sub + i32.load + end + local.set $6 + local.get $6 + i32.load + local.set $3 + local.get $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 227 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $6 + call $~lib/rt/tlsf/removeBlock + local.get $6 + local.get $3 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $6 + local.set $1 + end end - local.get $0 + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $2 i32.const 3 - i32.add + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end local.get $1 - i32.store8 - local.get $0 - local.get $2 + i32.const 16 i32.add + local.get $8 + i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 243 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 i32.const 4 i32.sub local.get $1 - i32.store8 - local.get $2 - i32.const 8 - i32.le_u + i32.store + local.get $8 + i32.const 256 + i32.lt_u if - return + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 259 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $7 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $7 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 + local.get $1 i32.const 0 - local.get $0 - i32.sub - i32.const 3 - i32.and - local.set $3 - local.get $0 - local.get $3 - i32.add - local.set $0 - local.get $2 - local.get $3 - i32.sub - local.set $2 - local.get $2 - i32.const -4 - i32.and - local.set $2 - i32.const -1 - i32.const 255 - i32.div_u + i32.store offset=16 local.get $1 - i32.const 255 - i32.and - i32.mul - local.set $4 - local.get $0 - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 4 - i32.sub - local.get $4 - i32.store - local.get $2 - i32.const 8 - i32.le_u + local.get $11 + i32.store offset=20 + local.get $11 if - return + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $0 + local.set $12 + local.get $9 + local.set $7 + local.get $10 + local.set $3 + local.get $1 + local.set $6 + local.get $12 + local.get $7 + i32.const 4 + i32.shl + local.get $3 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 end local.get $0 - i32.const 4 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 12 - i32.sub - local.get $4 - i32.store local.get $0 - local.get $2 - i32.add - i32.const 8 - i32.sub - local.get $4 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or i32.store + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $0 + local.set $13 + local.get $9 + local.set $12 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + end + ) + (func $~lib/rt/tlsf/addMemory (; 7 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 local.get $2 - i32.const 24 i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz if - return + i32.const 0 + i32.const 128 + i32.const 385 + i32.const 4 + call $~lib/builtins/abort + unreachable end - local.get $0 - i32.const 12 - i32.add + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 395 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 407 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 8 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + memory.size + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end + block $break|0 + i32.const 0 + local.set $5 + loop $repeat|0 + local.get $5 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $3 + local.set $7 + local.get $5 + local.set $6 + i32.const 0 + local.set $4 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $7 + loop $repeat|1 + local.get $7 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $3 + local.set $9 + local.get $5 + local.set $8 + local.get $7 + local.set $6 + i32.const 0 + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store offset=96 + end + local.get $7 + i32.const 1 + i32.add + local.set $7 + br $repeat|1 + unreachable + end + unreachable + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 176 + i32.const 128 + i32.const 447 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 337 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + i32.const 0 + local.set $7 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $5 + local.get $5 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $5 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $4 + local.get $8 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 350 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + memory.size + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + memory.grow + i32.const 0 + i32.lt_s + if + local.get $3 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + memory.size + local.set $7 + local.get $0 + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (; 12 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 364 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 477 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 479 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + call $~lib/rt/rtrace/onalloc + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/rt/pure/increment (; 15 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/rtrace/onincrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 107 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/pure/__retain (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment + end + local.get $0 + ) + (func $~lib/rt/tlsf/freeBlock (; 17 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 531 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/rtrace/onfree + ) + (func $~lib/rt/__typeinfo (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/rt/__rtti_base + local.set $1 + local.get $0 + local.get $1 + i32.load + i32.gt_u + if + i32.const 280 + i32.const 336 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 4 + i32.add + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/util/memory/memcpy (; 19 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + block $break|0 + loop $continue|0 + local.get $2 + if (result i32) + local.get $1 + i32.const 3 + i32.and + else + i32.const 0 + end + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $continue|0 + end + end + end + local.get $0 + i32.const 3 + i32.and + i32.const 0 + i32.eq + if + block $break|1 + loop $continue|1 + local.get $2 + i32.const 16 + i32.ge_u + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 8 + i32.add + i32.load + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 12 + i32.add + i32.load + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|1 + end + end + end + local.get $2 + i32.const 8 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + end + local.get $2 + i32.const 4 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.set $0 + local.get $1 + i32.const 4 + i32.add + local.set $1 + end + local.get $2 + i32.const 2 + i32.and + if + local.get $0 + local.get $1 + i32.load16_u + i32.store16 + local.get $0 + i32.const 2 + i32.add + local.set $0 + local.get $1 + i32.const 2 + i32.add + local.set $1 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + return + end + local.get $2 + i32.const 32 + i32.ge_u + if + block $break|2 + block $case2|2 + block $case1|2 + block $case0|2 + local.get $0 + i32.const 3 + i32.and + local.set $5 + local.get $5 + i32.const 1 + i32.eq + br_if $case0|2 + local.get $5 + i32.const 2 + i32.eq + br_if $case1|2 + local.get $5 + i32.const 3 + i32.eq + br_if $case2|2 + br $break|2 + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 3 + i32.sub + local.set $2 + block $break|3 + loop $continue|3 + local.get $2 + i32.const 17 + i32.ge_u + if + local.get $1 + i32.const 1 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 5 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 9 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 13 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|3 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + block $break|4 + loop $continue|4 + local.get $2 + i32.const 18 + i32.ge_u + if + local.get $1 + i32.const 2 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 6 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 10 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 14 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|4 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + block $break|5 + loop $continue|5 + local.get $2 + i32.const 19 + i32.ge_u + if + local.get $1 + i32.const 3 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 7 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 11 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 15 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|5 + end + end + end + br $break|2 + unreachable + end + unreachable + end + end + local.get $2 + i32.const 16 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 8 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 4 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 2 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + ) + (func $~lib/memory/memory.copy (; 20 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $4 + local.get $3 + i32.add + local.get $5 + i32.le_u + if (result i32) + i32.const 1 + else + local.get $5 + local.get $3 + i32.add + local.get $4 + i32.le_u + end + if + local.get $5 + local.get $4 + local.get $3 + call $~lib/util/memory/memcpy + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/rt/tlsf/__free (; 21 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 561 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 562 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/growRoots (; 22 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/pure/ROOTS + local.set $0 + global.get $~lib/rt/pure/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 local.get $4 - i32.store - local.get $0 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 i32.const 16 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 20 - i32.add - local.get $4 - i32.store + i32.sub + call $~lib/rt/rtrace/onfree + local.get $5 local.get $0 - i32.const 24 - i32.add - local.get $4 - i32.store + local.get $1 + call $~lib/memory/memory.copy local.get $0 - local.get $2 + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onalloc + local.get $0 + call $~lib/rt/tlsf/__free + end + local.get $5 + global.set $~lib/rt/pure/ROOTS + local.get $5 + local.get $1 i32.add - i32.const 28 - i32.sub + global.set $~lib/rt/pure/CUR + local.get $5 local.get $4 - i32.store - local.get $0 - local.get $2 i32.add - i32.const 24 - i32.sub - local.get $4 - i32.store + global.set $~lib/rt/pure/END + ) + (func $~lib/rt/pure/appendRoot (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/pure/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 + end + local.get $1 local.get $0 - local.get $2 - i32.add - i32.const 20 - i32.sub - local.get $4 i32.store - local.get $0 - local.get $2 + local.get $1 + i32.const 4 i32.add - i32.const 16 - i32.sub - local.get $4 - i32.store - i32.const 24 + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/decrement (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) local.get $0 - i32.const 4 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 i32.and - i32.add - local.set $3 + local.set $2 local.get $0 - local.get $3 - i32.add - local.set $0 + call $~lib/rt/rtrace/ondecrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 115 + i32.const 13 + call $~lib/builtins/abort + unreachable + end local.get $2 - local.get $3 - i32.sub - local.set $2 - local.get $4 - i64.extend_i32_u - local.get $4 - i64.extend_i32_u - i64.const 32 - i64.shl - i64.or - local.set $5 - block $break|0 - loop $continue|0 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/rt/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 124 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 16 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or local.get $2 - i32.const 32 - i32.ge_u + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz if - block - local.get $0 - local.get $5 - i64.store - local.get $0 - i32.const 8 - i32.add - local.get $5 - i64.store - local.get $0 - i32.const 16 - i32.add - local.get $5 - i64.store - local.get $0 - i32.const 24 - i32.add - local.get $5 - i64.store - local.get $2 - i32.const 32 - i32.sub - local.set $2 - local.get $0 - i32.const 32 - i32.add - local.set $0 - end - br $continue|0 + local.get $0 + call $~lib/rt/pure/appendRoot end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 end end ) - (func $~lib/memory/memory.allocate (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/rt/pure/__release (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 - call $~lib/allocator/arena/__memory_allocate - return + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + end ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) + (func $~lib/arraybuffer/ArrayBufferView#constructor (; 26 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) local.get $1 - i32.const 1073741816 + i32.const 1073741808 + local.get $2 + i32.shr_u i32.gt_u if - i32.const 0 - i32.const 8 - i32.const 23 - i32.const 34 - call $~lib/env/abort + i32.const 24 + i32.const 72 + i32.const 14 + i32.const 56 + call $~lib/builtins/abort unreachable end local.get $1 - i32.const 0 - i32.shl - local.set $2 local.get $2 - call $~lib/internal/arraybuffer/allocateUnsafe + i32.shl + local.tee $1 + i32.const 0 + call $~lib/rt/tlsf/__alloc local.set $3 - block $~lib/memory/memory.fill|inlined.0 - local.get $3 - i32.const 8 - i32.add - local.set $4 + block (result i32) + local.get $0 + i32.eqz + if + i32.const 12 + i32.const 2 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $0 + end + local.get $0 i32.const 0 - local.set $5 - local.get $2 - local.set $6 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + end + local.tee $4 + block (result i32) + local.get $3 + local.tee $5 local.get $4 + i32.load + local.tee $4 + i32.ne + if + local.get $5 + call $~lib/rt/pure/__retain + drop + local.get $4 + call $~lib/rt/pure/__release + end local.get $5 - local.get $6 - call $~lib/internal/memory/memset + end + i32.store + local.get $0 + local.get $3 + i32.store offset=4 + local.get $0 + local.get $1 + i32.store offset=8 + local.get $0 + ) + (func $~lib/typedarray/Uint8Array#constructor (; 27 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + if (result i32) + local.get $0 + else + i32.const 12 + i32.const 3 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + end + local.get $1 + i32.const 0 + call $~lib/arraybuffer/ArrayBufferView#constructor + local.set $0 + local.get $0 + ) + (func $~lib/typedarray/Uint8Array#__set (; 28 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $1 + local.get $0 + i32.load offset=8 + i32.ge_u + if + i32.const 280 + i32.const 376 + i32.const 115 + i32.const 44 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + local.get $1 + i32.add + local.get $2 + i32.store8 + ) + (func $~lib/arraybuffer/ArrayBuffer#get:byteLength (; 29 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + ) + (func $~lib/dataview/DataView#constructor (; 30 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $3 + i32.const 1073741808 + i32.gt_u + local.get $2 + local.get $3 + i32.add + local.get $1 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength + i32.gt_u + i32.or + if + local.get $1 + call $~lib/rt/pure/__release + block + i32.const 24 + i32.const 432 + i32.const 21 + i32.const 6 + call $~lib/builtins/abort + unreachable + unreachable + end + unreachable end block (result i32) local.get $0 i32.eqz if i32.const 12 - call $~lib/memory/memory.allocate + i32.const 4 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.set $0 end local.get $0 @@ -478,137 +3319,55 @@ i32.store offset=8 local.get $0 end - local.get $3 + local.tee $4 + block (result i32) + local.get $1 + local.tee $5 + local.get $4 + i32.load + local.tee $4 + i32.ne + if + local.get $5 + call $~lib/rt/pure/__retain + drop + local.get $4 + call $~lib/rt/pure/__release + end + local.get $5 + end i32.store + local.get $1 + local.get $2 + i32.add + local.set $6 local.get $0 - i32.const 0 + local.get $6 i32.store offset=4 local.get $0 - local.get $2 + local.get $3 i32.store offset=8 - local.get $0 - ) - (func $~lib/typedarray/Uint8Array#constructor (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 - i32.eqz - if - i32.const 12 - call $~lib/memory/memory.allocate - local.set $0 - end - local.get $0 local.get $1 - call $~lib/internal/typedarray/TypedArray#constructor - local.set $0 + call $~lib/rt/pure/__release local.get $0 ) - (func $~lib/internal/typedarray/TypedArray#__set (; 9 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $1 + (func $~lib/typedarray/Uint8Array#get:buffer (; 31 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - i32.load offset=8 - i32.const 0 - i32.shr_u - i32.ge_u - if - i32.const 0 - i32.const 8 - i32.const 50 - i32.const 63 - call $~lib/env/abort - unreachable - end - block $~lib/internal/arraybuffer/STORE|inlined.0 - local.get $0 - i32.load - local.set $3 - local.get $1 - local.set $4 - local.get $2 - local.set $5 - local.get $0 - i32.load offset=4 - local.set $6 - local.get $3 - local.get $4 - i32.const 0 - i32.shl - i32.add - local.get $6 - i32.add - local.get $5 - i32.store8 offset=8 - end - ) - (func $~lib/dataview/DataView#constructor (; 10 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - local.get $3 - global.get $~lib/builtins/i32.MIN_VALUE - i32.eq - if - local.get $1 - i32.load - local.get $2 - i32.sub - local.set $3 - end - local.get $2 - i32.const 1073741816 - i32.gt_u - if - i32.const 0 - i32.const 136 - i32.const 14 - i32.const 44 - call $~lib/env/abort - unreachable - end - local.get $3 - i32.const 1073741816 - i32.gt_u - if - i32.const 0 - i32.const 136 - i32.const 15 - i32.const 44 - call $~lib/env/abort - unreachable - end - local.get $2 - local.get $3 - i32.add - local.get $1 i32.load - i32.gt_s - if - i32.const 0 - i32.const 136 - i32.const 16 - i32.const 53 - call $~lib/env/abort - unreachable - end - local.get $0 - i32.eqz - if - i32.const 12 - call $~lib/memory/memory.allocate - local.set $0 - end - local.get $0 - local.get $1 - i32.store + call $~lib/rt/pure/__retain + ) + (func $~lib/arraybuffer/ArrayBufferView#get:byteOffset (; 32 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - local.get $2 - i32.store offset=4 + i32.load offset=4 local.get $0 - local.get $3 - i32.store offset=8 + i32.load + i32.sub + ) + (func $~lib/arraybuffer/ArrayBufferView#get:byteLength (; 33 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 + i32.load offset=8 ) - (func $~lib/polyfills/bswap (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/polyfills/bswap (; 34 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const -16711936 i32.and @@ -622,67 +3381,43 @@ i32.or return ) - (func $~lib/dataview/DataView#getFloat32 (; 12 ;) (type $FUNCSIG$fiii) (param $0 i32) (param $1 i32) (param $2 i32) (result f32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - block $~lib/dataview/checkOffset|inlined.0 - local.get $1 - local.set $3 - i32.const 4 - local.set $4 - local.get $0 - i32.load offset=8 - local.set $5 - local.get $3 - i32.const 1073741816 - i32.gt_u - local.tee $6 - if (result i32) - local.get $6 - else - local.get $3 - local.get $4 - i32.add - local.get $5 - i32.gt_s - end - if - i32.const 0 - i32.const 136 - i32.const 188 - i32.const 73 - call $~lib/env/abort - unreachable - end + (func $~lib/dataview/DataView#getFloat32 (; 35 ;) (type $FUNCSIG$fiii) (param $0 i32) (param $1 i32) (param $2 i32) (result f32) + local.get $1 + i32.const 0 + i32.lt_s + local.get $1 + i32.const 4 + i32.add + local.get $0 + i32.load offset=8 + i32.gt_s + i32.or + if + i32.const 280 + i32.const 432 + i32.const 44 + i32.const 6 + call $~lib/builtins/abort + unreachable end local.get $2 - i32.const 0 - i32.ne if (result f32) - local.get $0 - i32.load local.get $0 i32.load offset=4 - i32.add local.get $1 i32.add - f32.load offset=8 + f32.load else - local.get $0 - i32.load local.get $0 i32.load offset=4 - i32.add local.get $1 i32.add - i32.load offset=8 + i32.load call $~lib/polyfills/bswap f32.reinterpret_i32 end ) - (func $~lib/polyfills/bswap (; 13 ;) (type $FUNCSIG$jj) (param $0 i64) (result i64) + (func $~lib/polyfills/bswap (; 36 ;) (type $FUNCSIG$jj) (param $0 i64) (result i64) (local $1 i64) (local $2 i64) (local $3 i64) @@ -721,111 +3456,62 @@ i64.rotr return ) - (func $~lib/dataview/DataView#getFloat64 (; 14 ;) (type $FUNCSIG$diii) (param $0 i32) (param $1 i32) (param $2 i32) (result f64) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - block $~lib/dataview/checkOffset|inlined.1 - local.get $1 - local.set $3 - i32.const 8 - local.set $4 - local.get $0 - i32.load offset=8 - local.set $5 - local.get $3 - i32.const 1073741816 - i32.gt_u - local.tee $6 - if (result i32) - local.get $6 - else - local.get $3 - local.get $4 - i32.add - local.get $5 - i32.gt_s - end - if - i32.const 0 - i32.const 136 - i32.const 188 - i32.const 73 - call $~lib/env/abort - unreachable - end + (func $~lib/dataview/DataView#getFloat64 (; 37 ;) (type $FUNCSIG$diii) (param $0 i32) (param $1 i32) (param $2 i32) (result f64) + local.get $1 + i32.const 0 + i32.lt_s + local.get $1 + i32.const 8 + i32.add + local.get $0 + i32.load offset=8 + i32.gt_s + i32.or + if + i32.const 280 + i32.const 432 + i32.const 58 + i32.const 7 + call $~lib/builtins/abort + unreachable end local.get $2 - i32.const 0 - i32.ne if (result f64) - local.get $0 - i32.load local.get $0 i32.load offset=4 - i32.add local.get $1 i32.add - f64.load offset=8 + f64.load else - local.get $0 - i32.load local.get $0 i32.load offset=4 - i32.add local.get $1 i32.add - i64.load offset=8 + i64.load call $~lib/polyfills/bswap f64.reinterpret_i64 end ) - (func $~lib/dataview/DataView#getInt8 (; 15 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - block $~lib/dataview/checkOffset|inlined.2 - local.get $1 - local.set $2 - i32.const 1 - local.set $3 - local.get $0 - i32.load offset=8 - local.set $4 - local.get $2 - i32.const 1073741816 - i32.gt_u - local.tee $5 - if (result i32) - local.get $5 - else - local.get $2 - local.get $3 - i32.add - local.get $4 - i32.gt_s - end - if - i32.const 0 - i32.const 136 - i32.const 188 - i32.const 73 - call $~lib/env/abort - unreachable - end - end + (func $~lib/dataview/DataView#getInt8 (; 38 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 local.get $0 - i32.load + i32.load offset=8 + i32.ge_u + if + i32.const 280 + i32.const 432 + i32.const 69 + i32.const 49 + call $~lib/builtins/abort + unreachable + end local.get $0 i32.load offset=4 - i32.add local.get $1 i32.add - i32.load8_s offset=8 + i32.load8_s ) - (func $~lib/polyfills/bswap (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/polyfills/bswap (; 39 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 8 i32.shl @@ -841,62 +3527,41 @@ i32.or return ) - (func $~lib/dataview/DataView#getInt16 (; 17 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/dataview/DataView#getInt16 (; 40 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - block $~lib/dataview/checkOffset|inlined.3 - local.get $1 - local.set $3 - i32.const 2 - local.set $4 - local.get $0 - i32.load offset=8 - local.set $5 - local.get $3 - i32.const 1073741816 - i32.gt_u - local.tee $6 - if (result i32) - local.get $6 - else - local.get $3 - local.get $4 - i32.add - local.get $5 - i32.gt_s - end - if - i32.const 0 - i32.const 136 - i32.const 188 - i32.const 73 - call $~lib/env/abort - unreachable - end - end + local.get $1 + i32.const 0 + i32.lt_s + local.get $1 + i32.const 2 + i32.add local.get $0 - i32.load + i32.load offset=8 + i32.gt_s + i32.or + if + i32.const 280 + i32.const 432 + i32.const 77 + i32.const 7 + call $~lib/builtins/abort + unreachable + end local.get $0 i32.load offset=4 - i32.add local.get $1 i32.add - i32.load16_s offset=8 - local.set $7 + i32.load16_s + local.set $3 local.get $2 - i32.const 0 - i32.ne if (result i32) - local.get $7 + local.get $3 else - local.get $7 + local.get $3 call $~lib/polyfills/bswap end ) - (func $~lib/polyfills/bswap (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/polyfills/bswap (; 41 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const -16711936 i32.and @@ -910,62 +3575,41 @@ i32.or return ) - (func $~lib/dataview/DataView#getInt32 (; 19 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/dataview/DataView#getInt32 (; 42 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - block $~lib/dataview/checkOffset|inlined.4 - local.get $1 - local.set $3 - i32.const 4 - local.set $4 - local.get $0 - i32.load offset=8 - local.set $5 - local.get $3 - i32.const 1073741816 - i32.gt_u - local.tee $6 - if (result i32) - local.get $6 - else - local.get $3 - local.get $4 - i32.add - local.get $5 - i32.gt_s - end - if - i32.const 0 - i32.const 136 - i32.const 188 - i32.const 73 - call $~lib/env/abort - unreachable - end - end + local.get $1 + i32.const 0 + i32.lt_s + local.get $1 + i32.const 4 + i32.add local.get $0 - i32.load + i32.load offset=8 + i32.gt_s + i32.or + if + i32.const 280 + i32.const 432 + i32.const 86 + i32.const 7 + call $~lib/builtins/abort + unreachable + end local.get $0 i32.load offset=4 - i32.add local.get $1 i32.add - i32.load offset=8 - local.set $7 + i32.load + local.set $3 local.get $2 - i32.const 0 - i32.ne if (result i32) - local.get $7 + local.get $3 else - local.get $7 + local.get $3 call $~lib/polyfills/bswap end ) - (func $~lib/polyfills/bswap (; 20 ;) (type $FUNCSIG$jj) (param $0 i64) (result i64) + (func $~lib/polyfills/bswap (; 43 ;) (type $FUNCSIG$jj) (param $0 i64) (result i64) (local $1 i64) (local $2 i64) (local $3 i64) @@ -1004,106 +3648,60 @@ i64.rotr return ) - (func $~lib/dataview/DataView#getInt64 (; 21 ;) (type $FUNCSIG$jiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i64) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i64) - block $~lib/dataview/checkOffset|inlined.5 - local.get $1 - local.set $3 - i32.const 8 - local.set $4 - local.get $0 - i32.load offset=8 - local.set $5 - local.get $3 - i32.const 1073741816 - i32.gt_u - local.tee $6 - if (result i32) - local.get $6 - else - local.get $3 - local.get $4 - i32.add - local.get $5 - i32.gt_s - end - if - i32.const 0 - i32.const 136 - i32.const 188 - i32.const 73 - call $~lib/env/abort - unreachable - end - end + (func $~lib/dataview/DataView#getInt64 (; 44 ;) (type $FUNCSIG$jiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i64) + (local $3 i64) + local.get $1 + i32.const 0 + i32.lt_s + local.get $1 + i32.const 8 + i32.add local.get $0 - i32.load + i32.load offset=8 + i32.gt_s + i32.or + if + i32.const 280 + i32.const 432 + i32.const 180 + i32.const 6 + call $~lib/builtins/abort + unreachable + end local.get $0 i32.load offset=4 - i32.add local.get $1 i32.add - i64.load offset=8 - local.set $7 + i64.load + local.set $3 local.get $2 - i32.const 0 - i32.ne if (result i64) - local.get $7 + local.get $3 else - local.get $7 + local.get $3 call $~lib/polyfills/bswap end ) - (func $~lib/dataview/DataView#getUint8 (; 22 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - block $~lib/dataview/checkOffset|inlined.6 - local.get $1 - local.set $2 - i32.const 1 - local.set $3 - local.get $0 - i32.load offset=8 - local.set $4 - local.get $2 - i32.const 1073741816 - i32.gt_u - local.tee $5 - if (result i32) - local.get $5 - else - local.get $2 - local.get $3 - i32.add - local.get $4 - i32.gt_s - end - if - i32.const 0 - i32.const 136 - i32.const 188 - i32.const 73 - call $~lib/env/abort - unreachable - end - end + (func $~lib/dataview/DataView#getUint8 (; 45 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 local.get $0 - i32.load + i32.load offset=8 + i32.ge_u + if + i32.const 280 + i32.const 432 + i32.const 92 + i32.const 49 + call $~lib/builtins/abort + unreachable + end local.get $0 i32.load offset=4 - i32.add local.get $1 i32.add - i32.load8_u offset=8 + i32.load8_u ) - (func $~lib/polyfills/bswap (; 23 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/polyfills/bswap (; 46 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 8 i32.shl @@ -1117,751 +3715,505 @@ i32.or return ) - (func $~lib/dataview/DataView#getUint16 (; 24 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - block $~lib/dataview/checkOffset|inlined.7 - local.get $1 - local.set $3 - i32.const 2 - local.set $4 - local.get $0 - i32.load offset=8 - local.set $5 - local.get $3 - i32.const 1073741816 - i32.gt_u - local.tee $6 - if (result i32) - local.get $6 - else - local.get $3 - local.get $4 - i32.add - local.get $5 - i32.gt_s - end - if - i32.const 0 - i32.const 136 - i32.const 188 - i32.const 73 - call $~lib/env/abort - unreachable - end - end - local.get $0 - i32.load - local.get $0 - i32.load offset=4 - i32.add - local.get $1 - i32.add - i32.load16_u offset=8 - local.set $7 - local.get $2 - i32.const 0 - i32.ne - if (result i32) - local.get $7 - else - local.get $7 - call $~lib/polyfills/bswap - end - ) - (func $~lib/dataview/DataView#getUint32 (; 25 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/dataview/DataView#getUint16 (; 47 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - block $~lib/dataview/checkOffset|inlined.8 - local.get $1 - local.set $3 - i32.const 4 - local.set $4 - local.get $0 - i32.load offset=8 - local.set $5 - local.get $3 - i32.const 1073741816 - i32.gt_u - local.tee $6 - if (result i32) - local.get $6 - else - local.get $3 - local.get $4 - i32.add - local.get $5 - i32.gt_s - end - if - i32.const 0 - i32.const 136 - i32.const 188 - i32.const 73 - call $~lib/env/abort - unreachable - end - end + local.get $1 + i32.const 0 + i32.lt_s + local.get $1 + i32.const 2 + i32.add local.get $0 - i32.load + i32.load offset=8 + i32.gt_s + i32.or + if + i32.const 280 + i32.const 432 + i32.const 100 + i32.const 6 + call $~lib/builtins/abort + unreachable + end local.get $0 i32.load offset=4 - i32.add local.get $1 i32.add - i32.load offset=8 - local.set $7 + i32.load16_u + local.set $3 local.get $2 - i32.const 0 - i32.ne if (result i32) - local.get $7 + local.get $3 else - local.get $7 - call $~lib/polyfills/bswap + local.get $3 + call $~lib/polyfills/bswap end ) - (func $~lib/dataview/DataView#getUint64 (; 26 ;) (type $FUNCSIG$jiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i64) + (func $~lib/dataview/DataView#getUint32 (; 48 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i64) - block $~lib/dataview/checkOffset|inlined.9 - local.get $1 - local.set $3 - i32.const 8 - local.set $4 - local.get $0 - i32.load offset=8 - local.set $5 - local.get $3 - i32.const 1073741816 - i32.gt_u - local.tee $6 - if (result i32) - local.get $6 - else - local.get $3 - local.get $4 - i32.add - local.get $5 - i32.gt_s - end - if - i32.const 0 - i32.const 136 - i32.const 188 - i32.const 73 - call $~lib/env/abort - unreachable - end + local.get $1 + i32.const 0 + i32.lt_s + local.get $1 + i32.const 4 + i32.add + local.get $0 + i32.load offset=8 + i32.gt_s + i32.or + if + i32.const 280 + i32.const 432 + i32.const 109 + i32.const 6 + call $~lib/builtins/abort + unreachable end local.get $0 + i32.load offset=4 + local.get $1 + i32.add i32.load + local.set $3 + local.get $2 + if (result i32) + local.get $3 + else + local.get $3 + call $~lib/polyfills/bswap + end + ) + (func $~lib/dataview/DataView#getUint64 (; 49 ;) (type $FUNCSIG$jiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i64) + (local $3 i64) + local.get $1 + i32.const 0 + i32.lt_s + local.get $1 + i32.const 8 + i32.add + local.get $0 + i32.load offset=8 + i32.gt_s + i32.or + if + i32.const 280 + i32.const 432 + i32.const 189 + i32.const 6 + call $~lib/builtins/abort + unreachable + end local.get $0 i32.load offset=4 - i32.add local.get $1 i32.add - i64.load offset=8 - local.set $7 + i64.load + local.set $3 local.get $2 - i32.const 0 - i32.ne if (result i64) - local.get $7 + local.get $3 else - local.get $7 + local.get $3 call $~lib/polyfills/bswap end ) - (func $~lib/dataview/DataView#setFloat32 (; 27 ;) (type $FUNCSIG$viifi) (param $0 i32) (param $1 i32) (param $2 f32) (param $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - block $~lib/dataview/checkOffset|inlined.10 - local.get $1 - local.set $4 - i32.const 4 - local.set $5 - local.get $0 - i32.load offset=8 - local.set $6 - local.get $4 - i32.const 1073741816 - i32.gt_u - local.tee $7 - if (result i32) - local.get $7 - else - local.get $4 - local.get $5 - i32.add - local.get $6 - i32.gt_s - end - if - i32.const 0 - i32.const 136 - i32.const 188 - i32.const 73 - call $~lib/env/abort - unreachable - end + (func $~lib/dataview/DataView#setFloat32 (; 50 ;) (type $FUNCSIG$viifi) (param $0 i32) (param $1 i32) (param $2 f32) (param $3 i32) + local.get $1 + i32.const 0 + i32.lt_s + local.get $1 + i32.const 4 + i32.add + local.get $0 + i32.load offset=8 + i32.gt_s + i32.or + if + i32.const 280 + i32.const 432 + i32.const 118 + i32.const 6 + call $~lib/builtins/abort + unreachable end local.get $3 - i32.const 0 - i32.ne if - local.get $0 - i32.load local.get $0 i32.load offset=4 - i32.add local.get $1 i32.add local.get $2 - f32.store offset=8 + f32.store else - local.get $0 - i32.load local.get $0 i32.load offset=4 - i32.add local.get $1 i32.add local.get $2 i32.reinterpret_f32 call $~lib/polyfills/bswap - i32.store offset=8 + i32.store end ) - (func $~lib/dataview/DataView#setFloat64 (; 28 ;) (type $FUNCSIG$viidi) (param $0 i32) (param $1 i32) (param $2 f64) (param $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - block $~lib/dataview/checkOffset|inlined.11 - local.get $1 - local.set $4 - i32.const 8 - local.set $5 - local.get $0 - i32.load offset=8 - local.set $6 - local.get $4 - i32.const 1073741816 - i32.gt_u - local.tee $7 - if (result i32) - local.get $7 - else - local.get $4 - local.get $5 - i32.add - local.get $6 - i32.gt_s - end - if - i32.const 0 - i32.const 136 - i32.const 188 - i32.const 73 - call $~lib/env/abort - unreachable - end + (func $~lib/dataview/DataView#setFloat64 (; 51 ;) (type $FUNCSIG$viidi) (param $0 i32) (param $1 i32) (param $2 f64) (param $3 i32) + local.get $1 + i32.const 0 + i32.lt_s + local.get $1 + i32.const 8 + i32.add + local.get $0 + i32.load offset=8 + i32.gt_s + i32.or + if + i32.const 280 + i32.const 432 + i32.const 127 + i32.const 6 + call $~lib/builtins/abort + unreachable end local.get $3 - i32.const 0 - i32.ne if - local.get $0 - i32.load local.get $0 i32.load offset=4 - i32.add local.get $1 i32.add local.get $2 - f64.store offset=8 + f64.store else - local.get $0 - i32.load local.get $0 i32.load offset=4 - i32.add local.get $1 i32.add local.get $2 i64.reinterpret_f64 call $~lib/polyfills/bswap - i64.store offset=8 + i64.store end ) - (func $~lib/dataview/DataView#setInt8 (; 29 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - block $~lib/dataview/checkOffset|inlined.12 - local.get $1 - local.set $3 - i32.const 1 - local.set $4 - local.get $0 - i32.load offset=8 - local.set $5 - local.get $3 - i32.const 1073741816 - i32.gt_u - local.tee $6 - if (result i32) - local.get $6 - else - local.get $3 - local.get $4 - i32.add - local.get $5 - i32.gt_s - end - if - i32.const 0 - i32.const 136 - i32.const 188 - i32.const 73 - call $~lib/env/abort - unreachable - end - end + (func $~lib/dataview/DataView#setInt8 (; 52 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $1 local.get $0 - i32.load + i32.load offset=8 + i32.ge_u + if + i32.const 280 + i32.const 432 + i32.const 133 + i32.const 49 + call $~lib/builtins/abort + unreachable + end local.get $0 i32.load offset=4 - i32.add local.get $1 i32.add local.get $2 - i32.store8 offset=8 + i32.store8 ) - (func $~lib/dataview/DataView#setInt16 (; 30 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - block $~lib/dataview/checkOffset|inlined.13 - local.get $1 - local.set $4 - i32.const 2 - local.set $5 - local.get $0 - i32.load offset=8 - local.set $6 - local.get $4 - i32.const 1073741816 - i32.gt_u - local.tee $7 - if (result i32) - local.get $7 - else - local.get $4 - local.get $5 - i32.add - local.get $6 - i32.gt_s - end - if - i32.const 0 - i32.const 136 - i32.const 188 - i32.const 73 - call $~lib/env/abort - unreachable - end + (func $~lib/dataview/DataView#setInt16 (; 53 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + local.get $1 + i32.const 0 + i32.lt_s + local.get $1 + i32.const 2 + i32.add + local.get $0 + i32.load offset=8 + i32.gt_s + i32.or + if + i32.const 280 + i32.const 432 + i32.const 141 + i32.const 6 + call $~lib/builtins/abort + unreachable end local.get $0 - i32.load - local.get $0 i32.load offset=4 - i32.add local.get $1 i32.add local.get $3 - i32.const 0 - i32.ne if (result i32) local.get $2 else local.get $2 call $~lib/polyfills/bswap end - i32.store16 offset=8 + i32.store16 ) - (func $~lib/dataview/DataView#setInt32 (; 31 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - block $~lib/dataview/checkOffset|inlined.14 - local.get $1 - local.set $4 - i32.const 4 - local.set $5 - local.get $0 - i32.load offset=8 - local.set $6 - local.get $4 - i32.const 1073741816 - i32.gt_u - local.tee $7 - if (result i32) - local.get $7 - else - local.get $4 - local.get $5 - i32.add - local.get $6 - i32.gt_s - end - if - i32.const 0 - i32.const 136 - i32.const 188 - i32.const 73 - call $~lib/env/abort - unreachable - end - end + (func $~lib/dataview/DataView#setInt32 (; 54 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + local.get $1 + i32.const 0 + i32.lt_s + local.get $1 + i32.const 4 + i32.add local.get $0 - i32.load + i32.load offset=8 + i32.gt_s + i32.or + if + i32.const 280 + i32.const 432 + i32.const 149 + i32.const 6 + call $~lib/builtins/abort + unreachable + end local.get $0 i32.load offset=4 - i32.add local.get $1 i32.add local.get $3 - i32.const 0 - i32.ne if (result i32) local.get $2 else local.get $2 call $~lib/polyfills/bswap end - i32.store offset=8 + i32.store ) - (func $~lib/dataview/DataView#setInt64 (; 32 ;) (type $FUNCSIG$viiji) (param $0 i32) (param $1 i32) (param $2 i64) (param $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - block $~lib/dataview/checkOffset|inlined.15 - local.get $1 - local.set $4 - i32.const 8 - local.set $5 - local.get $0 - i32.load offset=8 - local.set $6 - local.get $4 - i32.const 1073741816 - i32.gt_u - local.tee $7 - if (result i32) - local.get $7 - else - local.get $4 - local.get $5 - i32.add - local.get $6 - i32.gt_s - end - if - i32.const 0 - i32.const 136 - i32.const 188 - i32.const 73 - call $~lib/env/abort - unreachable - end - end + (func $~lib/dataview/DataView#setInt64 (; 55 ;) (type $FUNCSIG$viiji) (param $0 i32) (param $1 i32) (param $2 i64) (param $3 i32) + local.get $1 + i32.const 0 + i32.lt_s + local.get $1 + i32.const 8 + i32.add local.get $0 - i32.load + i32.load offset=8 + i32.gt_s + i32.or + if + i32.const 280 + i32.const 432 + i32.const 198 + i32.const 6 + call $~lib/builtins/abort + unreachable + end local.get $0 i32.load offset=4 - i32.add local.get $1 i32.add local.get $3 - i32.const 0 - i32.ne if (result i64) local.get $2 else local.get $2 call $~lib/polyfills/bswap end - i64.store offset=8 + i64.store ) - (func $~lib/dataview/DataView#setUint8 (; 33 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - block $~lib/dataview/checkOffset|inlined.16 - local.get $1 - local.set $3 - i32.const 1 - local.set $4 - local.get $0 - i32.load offset=8 - local.set $5 - local.get $3 - i32.const 1073741816 - i32.gt_u - local.tee $6 - if (result i32) - local.get $6 - else - local.get $3 - local.get $4 - i32.add - local.get $5 - i32.gt_s - end - if - i32.const 0 - i32.const 136 - i32.const 188 - i32.const 73 - call $~lib/env/abort - unreachable - end - end + (func $~lib/dataview/DataView#setUint8 (; 56 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $1 local.get $0 - i32.load + i32.load offset=8 + i32.ge_u + if + i32.const 280 + i32.const 432 + i32.const 154 + i32.const 49 + call $~lib/builtins/abort + unreachable + end local.get $0 i32.load offset=4 - i32.add local.get $1 i32.add local.get $2 - i32.store8 offset=8 + i32.store8 ) - (func $~lib/dataview/DataView#setUint16 (; 34 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - block $~lib/dataview/checkOffset|inlined.17 - local.get $1 - local.set $4 - i32.const 2 - local.set $5 - local.get $0 - i32.load offset=8 - local.set $6 - local.get $4 - i32.const 1073741816 - i32.gt_u - local.tee $7 - if (result i32) - local.get $7 - else - local.get $4 - local.get $5 - i32.add - local.get $6 - i32.gt_s - end - if - i32.const 0 - i32.const 136 - i32.const 188 - i32.const 73 - call $~lib/env/abort - unreachable - end - end + (func $~lib/dataview/DataView#setUint16 (; 57 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + local.get $1 + i32.const 0 + i32.lt_s + local.get $1 + i32.const 2 + i32.add local.get $0 - i32.load + i32.load offset=8 + i32.gt_s + i32.or + if + i32.const 280 + i32.const 432 + i32.const 162 + i32.const 6 + call $~lib/builtins/abort + unreachable + end local.get $0 i32.load offset=4 - i32.add local.get $1 i32.add local.get $3 - i32.const 0 - i32.ne if (result i32) local.get $2 else local.get $2 call $~lib/polyfills/bswap end - i32.store16 offset=8 + i32.store16 ) - (func $~lib/dataview/DataView#setUint32 (; 35 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - block $~lib/dataview/checkOffset|inlined.18 - local.get $1 - local.set $4 - i32.const 4 - local.set $5 - local.get $0 - i32.load offset=8 - local.set $6 - local.get $4 - i32.const 1073741816 - i32.gt_u - local.tee $7 - if (result i32) - local.get $7 - else - local.get $4 - local.get $5 - i32.add - local.get $6 - i32.gt_s - end - if - i32.const 0 - i32.const 136 - i32.const 188 - i32.const 73 - call $~lib/env/abort - unreachable - end - end + (func $~lib/dataview/DataView#setUint32 (; 58 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + local.get $1 + i32.const 0 + i32.lt_s + local.get $1 + i32.const 4 + i32.add local.get $0 - i32.load + i32.load offset=8 + i32.gt_s + i32.or + if + i32.const 280 + i32.const 432 + i32.const 170 + i32.const 6 + call $~lib/builtins/abort + unreachable + end local.get $0 i32.load offset=4 - i32.add local.get $1 i32.add local.get $3 - i32.const 0 - i32.ne if (result i32) local.get $2 else local.get $2 call $~lib/polyfills/bswap end - i32.store offset=8 + i32.store ) - (func $~lib/dataview/DataView#setUint64 (; 36 ;) (type $FUNCSIG$viiji) (param $0 i32) (param $1 i32) (param $2 i64) (param $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - block $~lib/dataview/checkOffset|inlined.19 - local.get $1 - local.set $4 - i32.const 8 - local.set $5 - local.get $0 - i32.load offset=8 - local.set $6 - local.get $4 - i32.const 1073741816 - i32.gt_u - local.tee $7 - if (result i32) - local.get $7 - else - local.get $4 - local.get $5 - i32.add - local.get $6 - i32.gt_s - end - if - i32.const 0 - i32.const 136 - i32.const 188 - i32.const 73 - call $~lib/env/abort - unreachable - end - end + (func $~lib/dataview/DataView#setUint64 (; 59 ;) (type $FUNCSIG$viiji) (param $0 i32) (param $1 i32) (param $2 i64) (param $3 i32) + local.get $1 + i32.const 0 + i32.lt_s + local.get $1 + i32.const 8 + i32.add local.get $0 - i32.load + i32.load offset=8 + i32.gt_s + i32.or + if + i32.const 280 + i32.const 432 + i32.const 206 + i32.const 6 + call $~lib/builtins/abort + unreachable + end local.get $0 i32.load offset=4 - i32.add local.get $1 i32.add - local.get $3 - i32.const 0 - i32.ne + local.get $3 if (result i64) local.get $2 else local.get $2 call $~lib/polyfills/bswap end - i64.store offset=8 + i64.store + ) + (func $~lib/dataview/DataView#constructor|trampoline (; 60 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + block $2of2 + block $1of2 + block $0of2 + block $outOfRange + global.get $~lib/argc + i32.const 1 + i32.sub + br_table $0of2 $1of2 $2of2 $outOfRange + end + unreachable + end + i32.const 0 + local.set $2 + end + local.get $1 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength + local.set $3 + end + local.get $0 + local.get $1 + local.get $2 + local.get $3 + call $~lib/dataview/DataView#constructor ) - (func $start:std/dataview (; 37 ;) (type $FUNCSIG$v) - call $start:~lib/allocator/arena + (func $~lib/dataview/DataView#get:byteOffset (; 61 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=4 + local.get $0 + i32.load + i32.sub + ) + (func $~lib/dataview/DataView#get:byteLength (; 62 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=8 + ) + (func $start:std/dataview (; 63 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) i32.const 0 i32.const 8 call $~lib/typedarray/Uint8Array#constructor - global.set $std/dataview/array - global.get $std/dataview/array + local.set $0 + local.get $0 i32.const 0 i32.const 246 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/dataview/array + call $~lib/typedarray/Uint8Array#__set + local.get $0 i32.const 1 i32.const 224 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/dataview/array + call $~lib/typedarray/Uint8Array#__set + local.get $0 i32.const 2 i32.const 88 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/dataview/array + call $~lib/typedarray/Uint8Array#__set + local.get $0 i32.const 3 i32.const 159 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/dataview/array + call $~lib/typedarray/Uint8Array#__set + local.get $0 i32.const 4 i32.const 130 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/dataview/array + call $~lib/typedarray/Uint8Array#__set + local.get $0 i32.const 5 i32.const 101 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/dataview/array + call $~lib/typedarray/Uint8Array#__set + local.get $0 i32.const 6 i32.const 67 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/dataview/array + call $~lib/typedarray/Uint8Array#__set + local.get $0 i32.const 7 i32.const 95 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint8Array#__set i32.const 0 - global.get $std/dataview/array - i32.load - global.get $std/dataview/array - i32.load offset=4 - global.get $std/dataview/array - i32.load offset=8 + local.get $0 + call $~lib/typedarray/Uint8Array#get:buffer + local.tee $1 + local.get $0 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset + local.get $0 + call $~lib/arraybuffer/ArrayBufferView#get:byteLength call $~lib/dataview/DataView#constructor - global.set $std/dataview/view - global.get $std/dataview/view + local.set $2 + local.get $2 i32.const 0 i32.const 1 call $~lib/dataview/DataView#getFloat32 @@ -1870,13 +4222,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 16 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 15 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 1 i32.const 1 call $~lib/dataview/DataView#getFloat32 @@ -1885,13 +4237,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 17 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 16 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 2 i32.const 1 call $~lib/dataview/DataView#getFloat32 @@ -1900,13 +4252,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 18 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 17 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 3 i32.const 1 call $~lib/dataview/DataView#getFloat32 @@ -1915,13 +4267,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 19 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 18 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 4 i32.const 1 call $~lib/dataview/DataView#getFloat32 @@ -1930,13 +4282,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 20 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 19 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 0 call $~lib/dataview/DataView#getFloat32 @@ -1945,13 +4297,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 22 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 21 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 1 i32.const 0 call $~lib/dataview/DataView#getFloat32 @@ -1960,13 +4312,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 23 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 22 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 2 i32.const 0 call $~lib/dataview/DataView#getFloat32 @@ -1975,13 +4327,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 24 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 23 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 3 i32.const 0 call $~lib/dataview/DataView#getFloat32 @@ -1990,13 +4342,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 25 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 24 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 4 i32.const 0 call $~lib/dataview/DataView#getFloat32 @@ -2005,13 +4357,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 26 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 25 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 1 call $~lib/dataview/DataView#getFloat64 @@ -2020,13 +4372,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 28 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 27 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 0 call $~lib/dataview/DataView#getFloat64 @@ -2035,13 +4387,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 29 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 28 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 0 call $~lib/dataview/DataView#getInt8 i32.const -10 @@ -2049,13 +4401,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 31 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 30 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 1 call $~lib/dataview/DataView#getInt8 i32.const -32 @@ -2063,13 +4415,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 32 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 31 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 2 call $~lib/dataview/DataView#getInt8 i32.const 88 @@ -2077,13 +4429,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 33 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 32 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 3 call $~lib/dataview/DataView#getInt8 i32.const -97 @@ -2091,13 +4443,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 34 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 33 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 4 call $~lib/dataview/DataView#getInt8 i32.const -126 @@ -2105,13 +4457,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 35 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 34 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 5 call $~lib/dataview/DataView#getInt8 i32.const 101 @@ -2119,13 +4471,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 36 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 35 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 6 call $~lib/dataview/DataView#getInt8 i32.const 67 @@ -2133,13 +4485,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 37 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 36 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 7 call $~lib/dataview/DataView#getInt8 i32.const 95 @@ -2147,13 +4499,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 38 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 37 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 1 call $~lib/dataview/DataView#getInt16 @@ -2166,13 +4518,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 40 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 39 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 1 i32.const 1 call $~lib/dataview/DataView#getInt16 @@ -2185,13 +4537,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 41 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 40 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 2 i32.const 1 call $~lib/dataview/DataView#getInt16 @@ -2204,13 +4556,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 42 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 41 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 3 i32.const 1 call $~lib/dataview/DataView#getInt16 @@ -2223,13 +4575,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 43 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 42 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 4 i32.const 1 call $~lib/dataview/DataView#getInt16 @@ -2242,13 +4594,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 44 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 43 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 5 i32.const 1 call $~lib/dataview/DataView#getInt16 @@ -2261,13 +4613,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 45 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 44 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 6 i32.const 1 call $~lib/dataview/DataView#getInt16 @@ -2280,13 +4632,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 46 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 45 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 0 call $~lib/dataview/DataView#getInt16 @@ -2299,13 +4651,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 48 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 47 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 1 i32.const 0 call $~lib/dataview/DataView#getInt16 @@ -2318,13 +4670,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 49 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 48 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 2 i32.const 0 call $~lib/dataview/DataView#getInt16 @@ -2337,13 +4689,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 50 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 49 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 3 i32.const 0 call $~lib/dataview/DataView#getInt16 @@ -2356,13 +4708,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 51 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 50 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 4 i32.const 0 call $~lib/dataview/DataView#getInt16 @@ -2375,13 +4727,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 52 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 51 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 5 i32.const 0 call $~lib/dataview/DataView#getInt16 @@ -2394,13 +4746,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 53 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 52 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 6 i32.const 0 call $~lib/dataview/DataView#getInt16 @@ -2413,13 +4765,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 54 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 53 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 1 call $~lib/dataview/DataView#getInt32 @@ -2428,13 +4780,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 56 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 55 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 1 i32.const 1 call $~lib/dataview/DataView#getInt32 @@ -2443,28 +4795,28 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 57 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 56 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 2 i32.const 1 call $~lib/dataview/DataView#getInt32 i32.const 1703059288 i32.eq - i32.eqz - if - i32.const 0 - i32.const 176 - i32.const 58 + i32.eqz + if i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 57 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 3 i32.const 1 call $~lib/dataview/DataView#getInt32 @@ -2473,13 +4825,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 59 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 58 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 4 i32.const 1 call $~lib/dataview/DataView#getInt32 @@ -2488,13 +4840,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 60 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 59 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 0 call $~lib/dataview/DataView#getInt32 @@ -2503,13 +4855,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 62 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 61 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 1 i32.const 0 call $~lib/dataview/DataView#getInt32 @@ -2518,13 +4870,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 63 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 62 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 2 i32.const 0 call $~lib/dataview/DataView#getInt32 @@ -2533,13 +4885,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 64 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 63 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 3 i32.const 0 call $~lib/dataview/DataView#getInt32 @@ -2548,13 +4900,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 65 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 64 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 4 i32.const 0 call $~lib/dataview/DataView#getInt32 @@ -2563,13 +4915,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 66 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 65 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 1 call $~lib/dataview/DataView#getInt64 @@ -2578,13 +4930,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 68 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 67 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 0 call $~lib/dataview/DataView#getInt64 @@ -2593,13 +4945,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 69 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 68 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 0 call $~lib/dataview/DataView#getUint8 i32.const 246 @@ -2607,13 +4959,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 71 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 70 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 1 call $~lib/dataview/DataView#getUint8 i32.const 224 @@ -2621,13 +4973,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 72 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 71 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 2 call $~lib/dataview/DataView#getUint8 i32.const 88 @@ -2635,13 +4987,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 73 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 72 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 3 call $~lib/dataview/DataView#getUint8 i32.const 159 @@ -2649,13 +5001,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 74 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 73 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 4 call $~lib/dataview/DataView#getUint8 i32.const 130 @@ -2663,13 +5015,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 75 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 74 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 5 call $~lib/dataview/DataView#getUint8 i32.const 101 @@ -2677,13 +5029,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 76 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 75 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 6 call $~lib/dataview/DataView#getUint8 i32.const 67 @@ -2691,13 +5043,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 77 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 76 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 7 call $~lib/dataview/DataView#getUint8 i32.const 95 @@ -2705,13 +5057,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 78 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 77 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 1 call $~lib/dataview/DataView#getUint16 @@ -2722,13 +5074,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 80 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 79 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 1 i32.const 1 call $~lib/dataview/DataView#getUint16 @@ -2739,13 +5091,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 81 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 80 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 2 i32.const 1 call $~lib/dataview/DataView#getUint16 @@ -2756,13 +5108,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 82 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 81 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 3 i32.const 1 call $~lib/dataview/DataView#getUint16 @@ -2773,13 +5125,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 83 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 82 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 4 i32.const 1 call $~lib/dataview/DataView#getUint16 @@ -2790,13 +5142,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 84 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 83 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 5 i32.const 1 call $~lib/dataview/DataView#getUint16 @@ -2807,13 +5159,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 85 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 84 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 6 i32.const 1 call $~lib/dataview/DataView#getUint16 @@ -2824,13 +5176,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 86 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 85 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 0 call $~lib/dataview/DataView#getUint16 @@ -2841,13 +5193,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 88 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 87 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 1 i32.const 0 call $~lib/dataview/DataView#getUint16 @@ -2858,13 +5210,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 89 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 88 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 2 i32.const 0 call $~lib/dataview/DataView#getUint16 @@ -2875,13 +5227,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 90 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 89 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 3 i32.const 0 call $~lib/dataview/DataView#getUint16 @@ -2892,13 +5244,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 91 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 90 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 4 i32.const 0 call $~lib/dataview/DataView#getUint16 @@ -2909,13 +5261,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 92 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 91 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 5 i32.const 0 call $~lib/dataview/DataView#getUint16 @@ -2926,13 +5278,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 93 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 92 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 6 i32.const 0 call $~lib/dataview/DataView#getUint16 @@ -2943,13 +5295,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 94 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 93 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 1 call $~lib/dataview/DataView#getUint32 @@ -2958,13 +5310,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 96 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 95 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 1 i32.const 1 call $~lib/dataview/DataView#getUint32 @@ -2973,13 +5325,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 97 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 96 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 2 i32.const 1 call $~lib/dataview/DataView#getUint32 @@ -2988,13 +5340,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 98 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 97 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 3 i32.const 1 call $~lib/dataview/DataView#getUint32 @@ -3003,13 +5355,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 99 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 98 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 4 i32.const 1 call $~lib/dataview/DataView#getUint32 @@ -3018,13 +5370,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 100 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 99 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 0 call $~lib/dataview/DataView#getUint32 @@ -3033,13 +5385,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 102 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 101 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 1 i32.const 0 call $~lib/dataview/DataView#getUint32 @@ -3048,13 +5400,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 103 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 102 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 2 i32.const 0 call $~lib/dataview/DataView#getUint32 @@ -3063,13 +5415,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 104 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 103 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 3 i32.const 0 call $~lib/dataview/DataView#getUint32 @@ -3078,13 +5430,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 105 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 4 i32.const 0 call $~lib/dataview/DataView#getUint32 @@ -3093,13 +5445,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 106 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 105 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 1 call $~lib/dataview/DataView#getUint64 @@ -3108,13 +5460,13 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 108 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 107 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 0 call $~lib/dataview/DataView#getUint64 @@ -3123,18 +5475,18 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 109 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 108 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 0 f32.const 1.5976661625240943e-18 i32.const 1 call $~lib/dataview/DataView#setFloat32 - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 1 call $~lib/dataview/DataView#getFloat32 @@ -3143,18 +5495,18 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 112 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 111 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 0 f32.const 1976281973381696323584 i32.const 0 call $~lib/dataview/DataView#setFloat32 - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 0 call $~lib/dataview/DataView#getFloat32 @@ -3163,18 +5515,18 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 115 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 114 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 0 f64.const -1094252199637739024055454e124 i32.const 1 call $~lib/dataview/DataView#setFloat64 - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 1 call $~lib/dataview/DataView#getFloat64 @@ -3183,18 +5535,18 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 118 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 117 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 0 f64.const 6.022586634778589e-103 i32.const 0 call $~lib/dataview/DataView#setFloat64 - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 0 call $~lib/dataview/DataView#getFloat64 @@ -3203,17 +5555,17 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 121 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 120 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 108 call $~lib/dataview/DataView#setInt8 - global.get $std/dataview/view + local.get $2 i32.const 0 call $~lib/dataview/DataView#getInt8 i32.const 108 @@ -3221,18 +5573,18 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 124 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 123 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const -13360 i32.const 1 call $~lib/dataview/DataView#setInt16 - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 1 call $~lib/dataview/DataView#getInt16 @@ -3245,18 +5597,18 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 127 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 126 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 14689 i32.const 0 call $~lib/dataview/DataView#setInt16 - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 0 call $~lib/dataview/DataView#getInt16 @@ -3269,18 +5621,18 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 130 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 129 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 1204680201 i32.const 1 call $~lib/dataview/DataView#setInt32 - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 1 call $~lib/dataview/DataView#getInt32 @@ -3289,18 +5641,18 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 133 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 132 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 660673230 i32.const 0 call $~lib/dataview/DataView#setInt32 - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 0 call $~lib/dataview/DataView#getInt32 @@ -3309,18 +5661,18 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 136 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 135 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 0 i64.const -3290739641816099749 i32.const 1 call $~lib/dataview/DataView#setInt64 - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 1 call $~lib/dataview/DataView#getInt64 @@ -3329,18 +5681,18 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 139 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 138 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 0 i64.const 8178932412950708047 i32.const 0 call $~lib/dataview/DataView#setInt64 - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 0 call $~lib/dataview/DataView#getInt64 @@ -3349,17 +5701,17 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 142 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 141 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 238 call $~lib/dataview/DataView#setUint8 - global.get $std/dataview/view + local.get $2 i32.const 0 call $~lib/dataview/DataView#getUint8 i32.const 238 @@ -3367,18 +5719,18 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 145 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 144 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 58856 i32.const 1 call $~lib/dataview/DataView#setUint16 - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 1 call $~lib/dataview/DataView#getUint16 @@ -3389,18 +5741,18 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 148 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 147 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 60400 i32.const 0 call $~lib/dataview/DataView#setUint16 - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 0 call $~lib/dataview/DataView#getUint16 @@ -3411,18 +5763,18 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 151 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 150 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const -846805744 i32.const 1 call $~lib/dataview/DataView#setUint32 - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 1 call $~lib/dataview/DataView#getUint32 @@ -3431,18 +5783,18 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 154 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 153 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const -1510791631 i32.const 0 call $~lib/dataview/DataView#setUint32 - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 0 call $~lib/dataview/DataView#getUint32 @@ -3451,18 +5803,18 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 157 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 156 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 0 i64.const 2334704782995986958 i32.const 1 call $~lib/dataview/DataView#setUint64 - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 1 call $~lib/dataview/DataView#getUint64 @@ -3471,18 +5823,18 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 160 - i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 159 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/dataview/view + local.get $2 i32.const 0 i64.const -7123186897289856329 i32.const 0 call $~lib/dataview/DataView#setUint64 - global.get $std/dataview/view + local.get $2 i32.const 0 i32.const 0 call $~lib/dataview/DataView#getUint64 @@ -3491,16 +5843,398 @@ i32.eqz if i32.const 0 - i32.const 176 - i32.const 163 + i32.const 480 + i32.const 162 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + block (result i32) + i32.const 1 + global.set $~lib/argc + i32.const 0 + local.get $0 + call $~lib/typedarray/Uint8Array#get:buffer + local.tee $3 + i32.const 0 + i32.const 0 + call $~lib/dataview/DataView#constructor|trampoline + end + local.set $4 + local.get $2 + call $~lib/rt/pure/__release + local.get $4 + end + local.set $2 + local.get $2 + call $~lib/dataview/DataView#get:byteOffset + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 480 + i32.const 165 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $2 + call $~lib/dataview/DataView#get:byteLength + i32.const 8 + i32.eq + i32.eqz + if i32.const 0 - call $~lib/env/abort + i32.const 480 + i32.const 166 + i32.const 2 + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release ) - (func $start (; 38 ;) (type $FUNCSIG$v) + (func $start (; 64 ;) (type $FUNCSIG$v) call $start:std/dataview ) - (func $null (; 39 ;) (type $FUNCSIG$v) + (func $~lib/rt/pure/markGray (; 65 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members + end + ) + (func $~lib/rt/pure/scanBlack (; 66 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 67 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (; 68 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + ) + (func $~lib/rt/pure/__visit (; 69 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/pure/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 75 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/pure/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 86 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/pure/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 232 + i32.const 97 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + end + ) + (func $~lib/rt/__visit_members (; 70 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block + end + block $switch$1$leave + block $switch$1$default + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$case$4 $switch$1$case$4 $switch$1$default + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + ) + (func $null (; 71 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/std/date.json b/tests/compiler/std/date.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/std/date.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/std/date.optimized.wat b/tests/compiler/std/date.optimized.wat index 1d2777c37e..509f9bf2a6 100644 --- a/tests/compiler/std/date.optimized.wat +++ b/tests/compiler/std/date.optimized.wat @@ -1,44 +1,43 @@ (module - (type $FUNCSIG$v (func)) (type $FUNCSIG$diiiiiid (func (param i32 i32 i32 i32 i32 i32 f64) (result f64))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$d (func (result f64))) + (type $FUNCSIG$v (func)) (type $FUNCSIG$i (func (result i32))) (import "Date" "UTC" (func $~lib/bindings/Date/UTC (param i32 i32 i32 i32 i32 i32 f64) (result f64))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (import "Date" "now" (func $~lib/bindings/Date/now (result f64))) (memory $0 1) - (data (i32.const 8) "\0b\00\00\00s\00t\00d\00/\00d\00a\00t\00e\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) + (data (i32.const 8) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00s\00t\00d\00/\00d\00a\00t\00e\00.\00t\00s") (global $std/date/creationTime (mut i64) (i64.const 0)) + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) (global $std/date/date (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) - (func $~lib/allocator/arena/__memory_allocate (; 3 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/rt/stub/__alloc (; 3 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) - global.get $~lib/allocator/arena/offset - local.tee $0 - i32.const 15 + global.get $~lib/rt/stub/offset + i32.const 16 i32.add - i32.const -8 - i32.and local.tee $1 - current_memory + i32.const 23 + i32.add + i32.const -16 + i32.and + local.tee $0 + memory.size local.tee $2 i32.const 16 i32.shl i32.gt_u if local.get $2 - local.get $1 local.get $0 + local.get $1 i32.sub i32.const 65535 i32.add @@ -51,12 +50,12 @@ local.get $3 i32.gt_s select - grow_memory + memory.grow i32.const 0 i32.lt_s if local.get $3 - grow_memory + memory.grow i32.const 0 i32.lt_s if @@ -64,17 +63,22 @@ end end end + local.get $0 + global.set $~lib/rt/stub/offset local.get $1 - global.set $~lib/allocator/arena/offset + i32.const 16 + i32.sub + local.tee $0 + i32.const 3 + i32.store offset=8 local.get $0 + i32.const 8 + i32.store offset=12 + local.get $1 ) (func $start:std/date (; 4 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i64) - i32.const 40 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset i32.const 1970 i32.const 0 i32.const 1 @@ -88,10 +92,10 @@ i64.ne if i32.const 0 - i32.const 8 - i32.const 3 + i32.const 24 + i32.const 1 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1970 @@ -107,10 +111,10 @@ i64.ne if i32.const 0 - i32.const 8 - i32.const 4 + i32.const 24 + i32.const 2 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2018 @@ -128,10 +132,10 @@ i64.ne if i32.const 0 - i32.const 8 - i32.const 7 + i32.const 24 + i32.const 5 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end call $~lib/bindings/Date/now @@ -140,15 +144,19 @@ i64.le_s if i32.const 0 - i32.const 8 - i32.const 9 + i32.const 24 + i32.const 7 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + i32.const 48 + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset global.get $std/date/creationTime local.set $1 - call $~lib/allocator/arena/__memory_allocate + call $~lib/rt/stub/__alloc local.tee $0 i64.const 0 i64.store @@ -163,29 +171,29 @@ i64.ne if i32.const 0 - i32.const 8 - i32.const 12 + i32.const 24 + i32.const 10 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/date/date - local.tee $0 global.get $std/date/creationTime i64.const 1 i64.add - local.tee $1 i64.store - local.get $0 + global.get $std/date/date i64.load - local.get $1 + global.get $std/date/creationTime + i64.const 1 + i64.add i64.ne if i32.const 0 - i32.const 8 - i32.const 14 + i32.const 24 + i32.const 12 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/std/date.ts b/tests/compiler/std/date.ts index c118d4d40b..87ba3a474d 100644 --- a/tests/compiler/std/date.ts +++ b/tests/compiler/std/date.ts @@ -1,5 +1,3 @@ -import "allocator/arena"; - assert(Date.UTC(1970, 0, 1) == 0); assert(Date.UTC(1970, 0, 1, 0, 0, 0, 0) == 0); diff --git a/tests/compiler/std/date.untouched.wat b/tests/compiler/std/date.untouched.wat index 01a72ad928..ad6e7da3ee 100644 --- a/tests/compiler/std/date.untouched.wat +++ b/tests/compiler/std/date.untouched.wat @@ -1,81 +1,72 @@ (module - (type $FUNCSIG$v (func)) (type $FUNCSIG$diiiiiid (func (param i32 i32 i32 i32 i32 i32 f64) (result f64))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$d (func (result f64))) (type $FUNCSIG$iij (func (param i32 i64) (result i32))) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$ji (func (param i32) (result i64))) (type $FUNCSIG$jij (func (param i32 i64) (result i64))) + (type $FUNCSIG$v (func)) (import "Date" "UTC" (func $~lib/bindings/Date/UTC (param i32 i32 i32 i32 i32 i32 f64) (result f64))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (import "Date" "now" (func $~lib/bindings/Date/now (result f64))) (memory $0 1) - (data (i32.const 8) "\0b\00\00\00s\00t\00d\00/\00d\00a\00t\00e\00.\00t\00s\00") + (data (i32.const 8) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00s\00t\00d\00/\00d\00a\00t\00e\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) (global $std/date/creationTime (mut i64) (i64.const 0)) + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) (global $std/date/date (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 36)) + (global $~lib/heap/__heap_base i32 (i32.const 48)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) - (func $start:~lib/allocator/arena (; 3 ;) (type $FUNCSIG$v) - global.get $~lib/memory/HEAP_BASE - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - ) - (func $~lib/allocator/arena/__memory_allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/rt/stub/__alloc (; 3 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) + (local $8 i32) local.get $0 - i32.const 1073741824 + i32.const 1073741808 i32.gt_u if unreachable end - global.get $~lib/allocator/arena/offset - local.set $1 - local.get $1 + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.set $2 + local.get $2 local.get $0 - local.tee $2 - i32.const 1 local.tee $3 - local.get $2 + i32.const 1 + local.tee $4 local.get $3 + local.get $4 i32.gt_u select i32.add - i32.const 7 + i32.const 15 i32.add - i32.const 7 + i32.const 15 i32.const -1 i32.xor i32.and - local.set $4 - current_memory local.set $5 - local.get $4 + memory.size + local.set $6 local.get $5 + local.get $6 i32.const 16 i32.shl i32.gt_u if - local.get $4 - local.get $1 + local.get $5 + local.get $2 i32.sub i32.const 65535 i32.add @@ -85,23 +76,23 @@ i32.and i32.const 16 i32.shr_u - local.set $2 - local.get $5 - local.tee $3 - local.get $2 - local.tee $6 - local.get $3 + local.set $3 local.get $6 + local.tee $4 + local.get $3 + local.tee $7 + local.get $4 + local.get $7 i32.gt_s select - local.set $3 - local.get $3 - grow_memory + local.set $4 + local.get $4 + memory.grow i32.const 0 i32.lt_s if - local.get $2 - grow_memory + local.get $3 + memory.grow i32.const 0 i32.lt_s if @@ -109,22 +100,32 @@ end end end - local.get $4 - global.set $~lib/allocator/arena/offset + local.get $5 + global.set $~lib/rt/stub/offset + local.get $2 + i32.const 16 + i32.sub + local.set $8 + local.get $8 local.get $1 + i32.store offset=8 + local.get $8 + local.get $0 + i32.store offset=12 + local.get $2 ) - (func $~lib/memory/memory.allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/rt/stub/__retain (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - call $~lib/allocator/arena/__memory_allocate - return ) - (func $~lib/date/Date#constructor (; 6 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/date/Date#constructor (; 5 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 8 - call $~lib/memory/memory.allocate + i32.const 3 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain local.set $0 end local.get $0 @@ -136,17 +137,17 @@ i64.store local.get $0 ) - (func $~lib/date/Date#getTime (; 7 ;) (type $FUNCSIG$ji) (param $0 i32) (result i64) + (func $~lib/date/Date#getTime (; 6 ;) (type $FUNCSIG$ji) (param $0 i32) (result i64) local.get $0 i64.load ) - (func $~lib/date/Date#setTime (; 8 ;) (type $FUNCSIG$jij) (param $0 i32) (param $1 i64) (result i64) + (func $~lib/date/Date#setTime (; 7 ;) (type $FUNCSIG$jij) (param $0 i32) (param $1 i64) (result i64) local.get $0 local.get $1 i64.store local.get $1 ) - (func $start:std/date (; 9 ;) (type $FUNCSIG$v) + (func $start:std/date (; 8 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) @@ -154,14 +155,13 @@ (local $4 i32) (local $5 i32) (local $6 i64) - call $start:~lib/allocator/arena block $~lib/date/Date.UTC|inlined.0 (result i64) i32.const 1970 - local.set $0 + local.set $2 i32.const 0 local.set $1 i32.const 1 - local.set $2 + local.set $0 i32.const 0 local.set $3 i32.const 0 @@ -170,9 +170,9 @@ local.set $5 i64.const 0 local.set $6 - local.get $0 - local.get $1 local.get $2 + local.get $1 + local.get $0 local.get $3 local.get $4 local.get $5 @@ -186,10 +186,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 3 + i32.const 24 + i32.const 1 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $~lib/date/Date.UTC|inlined.1 (result i64) @@ -223,33 +223,33 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 4 + i32.const 24 + i32.const 2 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $~lib/date/Date.UTC|inlined.2 (result i64) i32.const 2018 - local.set $0 + local.set $5 i32.const 10 - local.set $1 + local.set $4 i32.const 10 - local.set $2 - i32.const 11 local.set $3 + i32.const 11 + local.set $2 i32.const 0 - local.set $4 + local.set $1 i32.const 0 - local.set $5 + local.set $0 i64.const 1 local.set $6 - local.get $0 - local.get $1 - local.get $2 - local.get $3 - local.get $4 local.get $5 + local.get $4 + local.get $3 + local.get $2 + local.get $1 + local.get $0 local.get $6 f64.convert_i64_s call $~lib/bindings/Date/UTC @@ -262,10 +262,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 7 + i32.const 24 + i32.const 5 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $~lib/date/Date.now|inlined.0 (result i64) @@ -277,12 +277,22 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 9 + i32.const 24 + i32.const 7 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset i32.const 0 global.get $std/date/creationTime call $~lib/date/Date#constructor @@ -294,10 +304,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 12 + i32.const 24 + i32.const 10 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/date/date @@ -315,16 +325,16 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 14 + i32.const 24 + i32.const 12 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) - (func $start (; 10 ;) (type $FUNCSIG$v) + (func $start (; 9 ;) (type $FUNCSIG$v) call $start:std/date ) - (func $null (; 11 ;) (type $FUNCSIG$v) + (func $null (; 10 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/std/gc-array.optimized.wat b/tests/compiler/std/gc-array.optimized.wat deleted file mode 100644 index 1bc556e60f..0000000000 --- a/tests/compiler/std/gc-array.optimized.wat +++ /dev/null @@ -1,1904 +0,0 @@ -(module - (type $FUNCSIG$v (func)) - (type $FUNCSIG$vi (func (param i32))) - (type $FUNCSIG$ii (func (param i32) (result i32))) - (type $FUNCSIG$vii (func (param i32 i32))) - (type $FUNCSIG$iii (func (param i32 i32) (result i32))) - (type $FUNCSIG$viii (func (param i32 i32 i32))) - (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) - (type $FUNCSIG$i (func (result i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) - (memory $0 1) - (data (i32.const 16) "\01") - (data (i32.const 40) "\02\00\00\00\00\00\00\00\18") - (data (i32.const 64) "\05\00\00\00\00\00\00\00\0d\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s") - (data (i32.const 112) "\05\00\00\00\00\00\00\00\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") - (table $0 7 funcref) - (elem (i32.const 0) $null $~lib/arraybuffer/ArrayBuffer~gc $~lib/array/Array~gc $~lib/collector/itcm/__gc_mark $~lib/arraybuffer/ArrayBuffer~gc $~lib/arraybuffer/ArrayBuffer~gc $~lib/allocator/arena/__memory_free) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) - (global $~lib/collector/itcm/state (mut i32) (i32.const 0)) - (global $~lib/collector/itcm/white (mut i32) (i32.const 0)) - (global $~lib/collector/itcm/fromSpace (mut i32) (i32.const 0)) - (global $~lib/collector/itcm/toSpace (mut i32) (i32.const 0)) - (global $~lib/collector/itcm/iter (mut i32) (i32.const 0)) - (global $std/gc-array/arr (mut i32) (i32.const 48)) - (global $~lib/argc (mut i32) (i32.const 0)) - (global $~lib/started (mut i32) (i32.const 0)) - (export "memory" (memory $0)) - (export "table" (table $0)) - (export "main" (func $std/gc-array/main)) - (func $~lib/arraybuffer/ArrayBuffer~gc (; 1 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 - i32.eqz - if - return - end - local.get $0 - call $~lib/collector/itcm/__gc_mark - ) - (func $~lib/collector/itcm/ManagedObjectList#push (; 2 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - (local $2 i32) - local.get $0 - i32.load offset=4 - local.set $2 - local.get $1 - local.get $1 - i32.load - i32.const 3 - i32.and - local.get $0 - i32.or - i32.store - local.get $1 - local.get $2 - i32.store offset=4 - local.get $2 - local.get $2 - i32.load - i32.const 3 - i32.and - local.get $1 - i32.or - i32.store - local.get $0 - local.get $1 - i32.store offset=4 - ) - (func $~lib/collector/itcm/ManagedObject#makeGray (; 3 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) - (local $2 i32) - global.get $~lib/collector/itcm/iter - local.get $0 - i32.eq - if - local.get $0 - i32.load offset=4 - global.set $~lib/collector/itcm/iter - end - local.get $0 - i32.load - i32.const -4 - i32.and - local.tee $2 - local.get $0 - i32.load offset=4 - local.tee $1 - i32.store offset=4 - local.get $1 - local.get $1 - i32.load - i32.const 3 - i32.and - local.get $2 - i32.or - i32.store - global.get $~lib/collector/itcm/toSpace - local.get $0 - call $~lib/collector/itcm/ManagedObjectList#push - local.get $0 - local.get $0 - i32.load - i32.const -4 - i32.and - i32.const 2 - i32.or - i32.store - ) - (func $~lib/collector/itcm/__gc_mark (; 4 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 - if - global.get $~lib/collector/itcm/white - local.get $0 - i32.const 16 - i32.sub - local.tee $0 - i32.load - i32.const 3 - i32.and - i32.eq - if - local.get $0 - call $~lib/collector/itcm/ManagedObject#makeGray - end - end - ) - (func $~lib/array/Array~gc (; 5 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) - (local $2 i32) - local.get $0 - i32.load - local.tee $2 - call $~lib/collector/itcm/__gc_mark - local.get $0 - i32.load offset=4 - i32.const 2 - i32.shl - local.set $0 - loop $continue|0 - local.get $1 - local.get $0 - i32.lt_u - if - local.get $1 - local.get $2 - i32.add - i32.load offset=8 - call $~lib/collector/itcm/__gc_mark - local.get $1 - i32.const 4 - i32.add - local.set $1 - br $continue|0 - end - end - ) - (func $~lib/allocator/arena/__memory_allocate (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - local.get $0 - i32.const 1073741824 - i32.gt_u - if - unreachable - end - global.get $~lib/allocator/arena/offset - local.tee $1 - local.get $0 - i32.const 1 - local.get $0 - i32.const 1 - i32.gt_u - select - i32.add - i32.const 7 - i32.add - i32.const -8 - i32.and - local.tee $0 - current_memory - local.tee $2 - i32.const 16 - i32.shl - i32.gt_u - if - local.get $2 - local.get $0 - local.get $1 - i32.sub - i32.const 65535 - i32.add - i32.const -65536 - i32.and - i32.const 16 - i32.shr_u - local.tee $3 - local.get $2 - local.get $3 - i32.gt_s - select - grow_memory - i32.const 0 - i32.lt_s - if - local.get $3 - grow_memory - i32.const 0 - i32.lt_s - if - unreachable - end - end - end - local.get $0 - global.set $~lib/allocator/arena/offset - local.get $1 - ) - (func $~lib/allocator/arena/__memory_free (; 7 ;) (type $FUNCSIG$vi) (param $0 i32) - nop - ) - (func $~lib/collector/itcm/step (; 8 ;) (type $FUNCSIG$v) - (local $0 i32) - block $break|0 - block $case3|0 - block $case2|0 - block $case1|0 - global.get $~lib/collector/itcm/state - local.tee $0 - if - local.get $0 - i32.const 1 - i32.sub - br_table $case1|0 $case2|0 $case3|0 $break|0 - end - i32.const 16 - call $~lib/allocator/arena/__memory_allocate - global.set $~lib/collector/itcm/fromSpace - global.get $~lib/collector/itcm/fromSpace - local.tee $0 - i32.const -1 - i32.store offset=8 - local.get $0 - local.get $0 - i32.store - local.get $0 - local.get $0 - i32.store offset=4 - i32.const 16 - call $~lib/allocator/arena/__memory_allocate - global.set $~lib/collector/itcm/toSpace - global.get $~lib/collector/itcm/toSpace - local.tee $0 - i32.const -1 - i32.store offset=8 - local.get $0 - local.get $0 - i32.store - local.get $0 - local.get $0 - i32.store offset=4 - global.get $~lib/collector/itcm/toSpace - global.set $~lib/collector/itcm/iter - i32.const 1 - global.set $~lib/collector/itcm/state - end - global.get $std/gc-array/arr - i32.const 3 - call_indirect (type $FUNCSIG$vi) - i32.const 2 - global.set $~lib/collector/itcm/state - br $break|0 - end - global.get $~lib/collector/itcm/iter - i32.load - i32.const -4 - i32.and - local.tee $0 - global.get $~lib/collector/itcm/toSpace - i32.ne - if - local.get $0 - global.set $~lib/collector/itcm/iter - local.get $0 - global.get $~lib/collector/itcm/white - i32.eqz - local.get $0 - i32.load - i32.const -4 - i32.and - i32.or - i32.store - i32.const 1 - global.set $~lib/argc - local.get $0 - i32.const 16 - i32.add - local.get $0 - i32.load offset=8 - call_indirect (type $FUNCSIG$vi) - else - global.get $std/gc-array/arr - i32.const 3 - call_indirect (type $FUNCSIG$vi) - global.get $~lib/collector/itcm/toSpace - global.get $~lib/collector/itcm/iter - i32.load - i32.const -4 - i32.and - i32.eq - if - global.get $~lib/collector/itcm/fromSpace - local.set $0 - global.get $~lib/collector/itcm/toSpace - global.set $~lib/collector/itcm/fromSpace - local.get $0 - global.set $~lib/collector/itcm/toSpace - global.get $~lib/collector/itcm/white - i32.eqz - global.set $~lib/collector/itcm/white - local.get $0 - i32.load - i32.const -4 - i32.and - global.set $~lib/collector/itcm/iter - i32.const 3 - global.set $~lib/collector/itcm/state - end - end - br $break|0 - end - global.get $~lib/collector/itcm/iter - local.tee $0 - global.get $~lib/collector/itcm/toSpace - i32.ne - if - local.get $0 - i32.load - i32.const -4 - i32.and - global.set $~lib/collector/itcm/iter - else - global.get $~lib/collector/itcm/toSpace - local.tee $0 - local.get $0 - i32.store - local.get $0 - local.get $0 - i32.store offset=4 - i32.const 1 - global.set $~lib/collector/itcm/state - end - end - ) - (func $~lib/collector/itcm/__gc_collect (; 9 ;) (type $FUNCSIG$v) - (local $0 i32) - block $break|0 - block $case1|0 - global.get $~lib/collector/itcm/state - local.tee $0 - i32.eqz - br_if $case1|0 - local.get $0 - i32.const 1 - i32.eq - br_if $case1|0 - br $break|0 - end - call $~lib/collector/itcm/step - end - loop $continue|1 - global.get $~lib/collector/itcm/state - i32.const 1 - i32.ne - if - call $~lib/collector/itcm/step - br $continue|1 - end - end - ) - (func $~lib/collector/itcm/__gc_allocate (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 - i32.const 1073741808 - i32.gt_u - if - unreachable - end - call $~lib/collector/itcm/step - local.get $0 - i32.const 16 - i32.add - call $~lib/allocator/arena/__memory_allocate - local.tee $0 - local.get $1 - i32.store offset=8 - local.get $0 - global.get $~lib/collector/itcm/white - local.get $0 - i32.load - i32.const -4 - i32.and - i32.or - i32.store - global.get $~lib/collector/itcm/fromSpace - local.get $0 - call $~lib/collector/itcm/ManagedObjectList#push - local.get $0 - i32.const 16 - i32.add - ) - (func $~lib/internal/arraybuffer/allocateUnsafe (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - local.get $0 - i32.const 1073741816 - i32.gt_u - if - i32.const 0 - i32.const 120 - i32.const 26 - i32.const 2 - call $~lib/env/abort - unreachable - end - i32.const 1 - i32.const 32 - local.get $0 - i32.const 7 - i32.add - i32.clz - i32.sub - i32.shl - i32.const 6 - call $~lib/collector/itcm/__gc_allocate - local.tee $1 - local.get $0 - i32.store - local.get $1 - ) - (func $~lib/internal/memory/memcpy (; 12 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - loop $continue|0 - local.get $1 - i32.const 3 - i32.and - local.get $2 - local.get $2 - select - if - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - br $continue|0 - end - end - local.get $0 - i32.const 3 - i32.and - i32.eqz - if - loop $continue|1 - local.get $2 - i32.const 16 - i32.ge_u - if - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $1 - i32.const 4 - i32.add - i32.load - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $1 - i32.const 8 - i32.add - i32.load - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 12 - i32.add - i32.load - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - br $continue|1 - end - end - local.get $2 - i32.const 8 - i32.and - if - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $1 - i32.const 4 - i32.add - i32.load - i32.store - local.get $1 - i32.const 8 - i32.add - local.set $1 - local.get $0 - i32.const 8 - i32.add - local.set $0 - end - local.get $2 - i32.const 4 - i32.and - if - local.get $0 - local.get $1 - i32.load - i32.store - local.get $1 - i32.const 4 - i32.add - local.set $1 - local.get $0 - i32.const 4 - i32.add - local.set $0 - end - local.get $2 - i32.const 2 - i32.and - if - local.get $0 - local.get $1 - i32.load16_u - i32.store16 - local.get $1 - i32.const 2 - i32.add - local.set $1 - local.get $0 - i32.const 2 - i32.add - local.set $0 - end - local.get $2 - i32.const 1 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - end - return - end - local.get $2 - i32.const 32 - i32.ge_u - if - block $break|2 - block $case2|2 - block $case1|2 - local.get $0 - i32.const 3 - i32.and - local.tee $3 - i32.const 1 - i32.ne - if - local.get $3 - i32.const 2 - i32.eq - br_if $case1|2 - local.get $3 - i32.const 3 - i32.eq - br_if $case2|2 - br $break|2 - end - local.get $1 - i32.load - local.set $5 - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 3 - i32.sub - local.set $2 - loop $continue|3 - local.get $2 - i32.const 17 - i32.ge_u - if - local.get $0 - local.get $1 - i32.const 1 - i32.add - i32.load - local.tee $3 - i32.const 8 - i32.shl - local.get $5 - i32.const 24 - i32.shr_u - i32.or - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $3 - i32.const 24 - i32.shr_u - local.get $1 - i32.const 5 - i32.add - i32.load - local.tee $3 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $3 - i32.const 24 - i32.shr_u - local.get $1 - i32.const 9 - i32.add - i32.load - local.tee $3 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 13 - i32.add - i32.load - local.tee $5 - i32.const 8 - i32.shl - local.get $3 - i32.const 24 - i32.shr_u - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - br $continue|3 - end - end - br $break|2 - end - local.get $1 - i32.load - local.set $5 - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 2 - i32.sub - local.set $2 - loop $continue|4 - local.get $2 - i32.const 18 - i32.ge_u - if - local.get $0 - local.get $1 - i32.const 2 - i32.add - i32.load - local.tee $3 - i32.const 16 - i32.shl - local.get $5 - i32.const 16 - i32.shr_u - i32.or - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $3 - i32.const 16 - i32.shr_u - local.get $1 - i32.const 6 - i32.add - i32.load - local.tee $3 - i32.const 16 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $3 - i32.const 16 - i32.shr_u - local.get $1 - i32.const 10 - i32.add - i32.load - local.tee $3 - i32.const 16 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 14 - i32.add - i32.load - local.tee $5 - i32.const 16 - i32.shl - local.get $3 - i32.const 16 - i32.shr_u - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - br $continue|4 - end - end - br $break|2 - end - local.get $1 - i32.load - local.set $5 - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - loop $continue|5 - local.get $2 - i32.const 19 - i32.ge_u - if - local.get $0 - local.get $1 - i32.const 3 - i32.add - i32.load - local.tee $3 - i32.const 24 - i32.shl - local.get $5 - i32.const 8 - i32.shr_u - i32.or - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $3 - i32.const 8 - i32.shr_u - local.get $1 - i32.const 7 - i32.add - i32.load - local.tee $3 - i32.const 24 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $3 - i32.const 8 - i32.shr_u - local.get $1 - i32.const 11 - i32.add - i32.load - local.tee $3 - i32.const 24 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 15 - i32.add - i32.load - local.tee $5 - i32.const 24 - i32.shl - local.get $3 - i32.const 8 - i32.shr_u - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - br $continue|5 - end - end - end - end - local.get $2 - i32.const 16 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - end - local.get $2 - i32.const 8 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - end - local.get $2 - i32.const 4 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - end - local.get $2 - i32.const 2 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - end - local.get $2 - i32.const 1 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - end - ) - (func $~lib/internal/memory/memmove (; 13 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - local.get $0 - local.get $1 - i32.eq - if - return - end - local.get $1 - local.get $2 - i32.add - local.get $0 - i32.le_u - local.tee $3 - i32.eqz - if - local.get $0 - local.get $2 - i32.add - local.get $1 - i32.le_u - local.set $3 - end - local.get $3 - if - local.get $0 - local.get $1 - local.get $2 - call $~lib/internal/memory/memcpy - return - end - local.get $0 - local.get $1 - i32.lt_u - if - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and - i32.eq - if - loop $continue|0 - local.get $0 - i32.const 7 - i32.and - if - local.get $2 - i32.eqz - if - return - end - local.get $2 - i32.const 1 - i32.sub - local.set $2 - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - br $continue|0 - end - end - loop $continue|1 - local.get $2 - i32.const 8 - i32.ge_u - if - local.get $0 - local.get $1 - i64.load - i64.store - local.get $2 - i32.const 8 - i32.sub - local.set $2 - local.get $0 - i32.const 8 - i32.add - local.set $0 - local.get $1 - i32.const 8 - i32.add - local.set $1 - br $continue|1 - end - end - end - loop $continue|2 - local.get $2 - if - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - br $continue|2 - end - end - else - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and - i32.eq - if - loop $continue|3 - local.get $0 - local.get $2 - i32.add - i32.const 7 - i32.and - if - local.get $2 - i32.eqz - if - return - end - local.get $2 - i32.const 1 - i32.sub - local.tee $2 - local.get $0 - i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 - br $continue|3 - end - end - loop $continue|4 - local.get $2 - i32.const 8 - i32.ge_u - if - local.get $2 - i32.const 8 - i32.sub - local.tee $2 - local.get $0 - i32.add - local.get $1 - local.get $2 - i32.add - i64.load - i64.store - br $continue|4 - end - end - end - loop $continue|5 - local.get $2 - if - local.get $2 - i32.const 1 - i32.sub - local.tee $2 - local.get $0 - i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 - br $continue|5 - end - end - end - ) - (func $~lib/internal/memory/memset (; 14 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - (local $2 i32) - local.get $1 - i32.eqz - if - return - end - local.get $0 - i32.const 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - i32.const 1 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 2 - i32.le_u - if - return - end - local.get $0 - i32.const 1 - i32.add - i32.const 0 - i32.store8 - local.get $0 - i32.const 2 - i32.add - i32.const 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 2 - i32.sub - i32.const 0 - i32.store8 - local.get $2 - i32.const 3 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 6 - i32.le_u - if - return - end - local.get $0 - i32.const 3 - i32.add - i32.const 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - i32.const 4 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 8 - i32.le_u - if - return - end - i32.const 0 - local.get $0 - i32.sub - i32.const 3 - i32.and - local.tee $2 - local.get $0 - i32.add - local.tee $0 - i32.const 0 - i32.store - local.get $1 - local.get $2 - i32.sub - i32.const -4 - i32.and - local.tee $1 - local.get $0 - i32.add - i32.const 4 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 8 - i32.le_u - if - return - end - local.get $0 - i32.const 4 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 8 - i32.add - i32.const 0 - i32.store - local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 12 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 8 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 24 - i32.le_u - if - return - end - local.get $0 - i32.const 12 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 16 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 20 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 24 - i32.add - i32.const 0 - i32.store - local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 28 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 24 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 20 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 16 - i32.sub - i32.const 0 - i32.store - local.get $0 - i32.const 4 - i32.and - i32.const 24 - i32.add - local.tee $2 - local.get $0 - i32.add - local.set $0 - local.get $1 - local.get $2 - i32.sub - local.set $1 - loop $continue|0 - local.get $1 - i32.const 32 - i32.ge_u - if - local.get $0 - i64.const 0 - i64.store - local.get $0 - i32.const 8 - i32.add - i64.const 0 - i64.store - local.get $0 - i32.const 16 - i32.add - i64.const 0 - i64.store - local.get $0 - i32.const 24 - i32.add - i64.const 0 - i64.store - local.get $1 - i32.const 32 - i32.sub - local.set $1 - local.get $0 - i32.const 32 - i32.add - local.set $0 - br $continue|0 - end - end - ) - (func $~lib/internal/arraybuffer/reallocateUnsafe (; 15 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - local.get $1 - local.get $0 - i32.load - local.tee $2 - i32.gt_s - if - local.get $1 - i32.const 1073741816 - i32.gt_s - if - i32.const 0 - i32.const 120 - i32.const 40 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $1 - i32.const 1 - i32.const 32 - local.get $2 - i32.const 7 - i32.add - i32.clz - i32.sub - i32.shl - i32.const 8 - i32.sub - i32.le_s - if - local.get $0 - local.get $1 - i32.store - else - local.get $1 - call $~lib/internal/arraybuffer/allocateUnsafe - local.tee $3 - i32.const 8 - i32.add - local.get $0 - i32.const 8 - i32.add - local.get $2 - call $~lib/internal/memory/memmove - local.get $3 - local.set $0 - end - local.get $0 - i32.const 8 - i32.add - local.get $2 - i32.add - local.get $1 - local.get $2 - i32.sub - call $~lib/internal/memory/memset - else - local.get $1 - local.get $2 - i32.lt_s - if - local.get $1 - i32.const 0 - i32.lt_s - if - i32.const 0 - i32.const 120 - i32.const 62 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.store - end - end - local.get $0 - ) - (func $~lib/collector/itcm/__gc_link (; 16 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - (local $2 i32) - global.get $~lib/collector/itcm/white - i32.eqz - local.get $0 - i32.const 16 - i32.sub - local.tee $2 - i32.load - i32.const 3 - i32.and - i32.eq - local.tee $0 - if (result i32) - global.get $~lib/collector/itcm/white - local.get $1 - i32.const 16 - i32.sub - i32.load - i32.const 3 - i32.and - i32.eq - else - local.get $0 - end - if - local.get $2 - call $~lib/collector/itcm/ManagedObject#makeGray - end - ) - (func $~lib/array/Array#__set (; 17 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - local.get $1 - local.get $0 - i32.load - local.tee $3 - i32.load - i32.const 2 - i32.shr_u - i32.ge_u - if - local.get $1 - i32.const 268435454 - i32.ge_u - if - i32.const 0 - i32.const 72 - i32.const 107 - i32.const 41 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $3 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 2 - i32.shl - call $~lib/internal/arraybuffer/reallocateUnsafe - local.tee $3 - i32.store - local.get $0 - local.get $4 - i32.store offset=4 - end - local.get $3 - local.get $1 - i32.const 2 - i32.shl - i32.add - local.get $2 - i32.store offset=8 - local.get $0 - local.get $2 - call $~lib/collector/itcm/__gc_link - ) - (func $start:std/gc-array (; 18 ;) (type $FUNCSIG$v) - i32.const 184 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - call $~lib/collector/itcm/__gc_collect - global.get $std/gc-array/arr - i32.const 0 - i32.const 0 - i32.const 4 - call $~lib/collector/itcm/__gc_allocate - call $~lib/array/Array#__set - call $~lib/collector/itcm/__gc_collect - global.get $std/gc-array/arr - i32.const 1 - i32.const 0 - i32.const 4 - call $~lib/collector/itcm/__gc_allocate - call $~lib/array/Array#__set - call $~lib/collector/itcm/__gc_collect - global.get $std/gc-array/arr - i32.const 0 - i32.const 0 - i32.const 4 - call $~lib/collector/itcm/__gc_allocate - call $~lib/array/Array#__set - call $~lib/collector/itcm/__gc_collect - ) - (func $std/gc-array/main (; 19 ;) (type $FUNCSIG$i) (result i32) - global.get $~lib/started - i32.eqz - if - call $start:std/gc-array - i32.const 1 - global.set $~lib/started - end - i32.const 0 - ) - (func $null (; 20 ;) (type $FUNCSIG$v) - nop - ) -) diff --git a/tests/compiler/std/gc-array.ts b/tests/compiler/std/gc-array.ts deleted file mode 100644 index f42c59d20c..0000000000 --- a/tests/compiler/std/gc-array.ts +++ /dev/null @@ -1,24 +0,0 @@ -import "allocator/arena"; -import "collector/itcm"; - -class Foo { -} - -var arr: Foo[] = []; - -gc.collect(); // should do nothing - -arr[0] = {}; - -gc.collect(); // should do nothing - -arr[1] = {}; - -gc.collect(); // should do nothing - -arr[0] = {}; - -gc.collect(); // should collect the old one - -@start -export function main(): i32 { return 0; } diff --git a/tests/compiler/std/gc-array.untouched.wat b/tests/compiler/std/gc-array.untouched.wat deleted file mode 100644 index ecf4d806e6..0000000000 --- a/tests/compiler/std/gc-array.untouched.wat +++ /dev/null @@ -1,2540 +0,0 @@ -(module - (type $FUNCSIG$v (func)) - (type $FUNCSIG$vi (func (param i32))) - (type $FUNCSIG$ii (func (param i32) (result i32))) - (type $FUNCSIG$vii (func (param i32 i32))) - (type $FUNCSIG$iii (func (param i32 i32) (result i32))) - (type $FUNCSIG$viii (func (param i32 i32 i32))) - (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) - (type $FUNCSIG$i (func (result i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) - (memory $0 1) - (data (i32.const 8) "\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 32) "\00\00\00\00\00\00\00\00\02\00\00\00\00\00\00\00\18\00\00\00\00\00\00\00") - (data (i32.const 56) "\00\00\00\00\00\00\00\00\05\00\00\00\00\00\00\00\0d\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") - (data (i32.const 104) "\00\00\00\00\00\00\00\00\05\00\00\00\00\00\00\00\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") - (table $0 7 funcref) - (elem (i32.const 0) $null $~lib/arraybuffer/ArrayBuffer~gc $~lib/array/Array~gc $~lib/collector/itcm/__gc_mark $std/gc-array/Foo~gc $~lib/string/String~gc $~lib/internal/arraybuffer/__gc) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) - (global $~lib/collector/itcm/state (mut i32) (i32.const 0)) - (global $~lib/collector/itcm/white (mut i32) (i32.const 0)) - (global $~lib/collector/itcm/fromSpace (mut i32) (i32.const 0)) - (global $~lib/collector/itcm/toSpace (mut i32) (i32.const 0)) - (global $~lib/collector/itcm/iter (mut i32) (i32.const 0)) - (global $std/gc-array/arr (mut i32) (i32.const 48)) - (global $~lib/argc (mut i32) (i32.const 0)) - (global $~lib/started (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 180)) - (export "memory" (memory $0)) - (export "table" (table $0)) - (export "main" (func $std/gc-array/main)) - (func $start:~lib/allocator/arena (; 1 ;) (type $FUNCSIG$v) - global.get $~lib/memory/HEAP_BASE - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - ) - (func $~lib/arraybuffer/ArrayBuffer~gc (; 2 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 - i32.eqz - if - return - end - local.get $0 - call $~lib/collector/itcm/__gc_mark - ) - (func $~lib/collector/itcm/ManagedObject#get:color (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.load - i32.const 3 - i32.and - ) - (func $~lib/collector/itcm/ManagedObject#get:next (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - ) - (func $~lib/collector/itcm/ManagedObject#set:next (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - local.get $0 - i32.load - i32.const 3 - i32.and - i32.or - i32.store - ) - (func $~lib/collector/itcm/ManagedObject#unlink (; 6 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) - (local $2 i32) - local.get $0 - call $~lib/collector/itcm/ManagedObject#get:next - local.set $1 - local.get $0 - i32.load offset=4 - local.set $2 - local.get $1 - local.get $2 - i32.store offset=4 - local.get $2 - local.get $1 - call $~lib/collector/itcm/ManagedObject#set:next - ) - (func $~lib/collector/itcm/ManagedObjectList#push (; 7 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - (local $2 i32) - local.get $0 - i32.load offset=4 - local.set $2 - local.get $1 - local.get $0 - call $~lib/collector/itcm/ManagedObject#set:next - local.get $1 - local.get $2 - i32.store offset=4 - local.get $2 - local.get $1 - call $~lib/collector/itcm/ManagedObject#set:next - local.get $0 - local.get $1 - i32.store offset=4 - ) - (func $~lib/collector/itcm/ManagedObject#makeGray (; 8 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 - global.get $~lib/collector/itcm/iter - i32.eq - if - local.get $0 - i32.load offset=4 - global.set $~lib/collector/itcm/iter - end - local.get $0 - call $~lib/collector/itcm/ManagedObject#unlink - global.get $~lib/collector/itcm/toSpace - local.get $0 - call $~lib/collector/itcm/ManagedObjectList#push - local.get $0 - local.get $0 - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.const 2 - i32.or - i32.store - ) - (func $~lib/collector/itcm/__gc_mark (; 9 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) - local.get $0 - if - block $~lib/collector/itcm/refToObj|inlined.0 (result i32) - local.get $0 - local.set $1 - local.get $1 - i32.const 16 - i32.sub - end - local.set $1 - local.get $1 - call $~lib/collector/itcm/ManagedObject#get:color - global.get $~lib/collector/itcm/white - i32.eq - if - local.get $1 - call $~lib/collector/itcm/ManagedObject#makeGray - end - end - ) - (func $~lib/array/Array~gc (; 10 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - local.get $0 - i32.load - local.set $1 - local.get $1 - call $~lib/collector/itcm/__gc_mark - i32.const 0 - local.set $2 - local.get $0 - i32.load offset=4 - i32.const 2 - i32.shl - local.set $3 - block $break|0 - loop $continue|0 - local.get $2 - local.get $3 - i32.lt_u - if - block - local.get $1 - local.get $2 - i32.add - i32.load offset=8 - call $~lib/collector/itcm/__gc_mark - local.get $2 - i32.const 4 - i32.add - local.set $2 - end - br $continue|0 - end - end - end - ) - (func $~lib/allocator/arena/__memory_allocate (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $0 - i32.const 1073741824 - i32.gt_u - if - unreachable - end - global.get $~lib/allocator/arena/offset - local.set $1 - local.get $1 - local.get $0 - local.tee $2 - i32.const 1 - local.tee $3 - local.get $2 - local.get $3 - i32.gt_u - select - i32.add - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - local.set $4 - current_memory - local.set $5 - local.get $4 - local.get $5 - i32.const 16 - i32.shl - i32.gt_u - if - local.get $4 - local.get $1 - i32.sub - i32.const 65535 - i32.add - i32.const 65535 - i32.const -1 - i32.xor - i32.and - i32.const 16 - i32.shr_u - local.set $2 - local.get $5 - local.tee $3 - local.get $2 - local.tee $6 - local.get $3 - local.get $6 - i32.gt_s - select - local.set $3 - local.get $3 - grow_memory - i32.const 0 - i32.lt_s - if - local.get $2 - grow_memory - i32.const 0 - i32.lt_s - if - unreachable - end - end - end - local.get $4 - global.set $~lib/allocator/arena/offset - local.get $1 - ) - (func $~lib/collector/itcm/ManagedObjectList#clear (; 12 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 - local.get $0 - i32.store - local.get $0 - local.get $0 - i32.store offset=4 - ) - (func $~lib/collector/itcm/ManagedObject#set:color (; 13 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - local.get $0 - local.get $0 - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - local.get $1 - i32.or - i32.store - ) - (func $~lib/allocator/arena/__memory_free (; 14 ;) (type $FUNCSIG$vi) (param $0 i32) - nop - ) - (func $~lib/collector/itcm/step (; 15 ;) (type $FUNCSIG$v) - (local $0 i32) - (local $1 i32) - block $break|0 - block $case3|0 - block $case2|0 - block $case1|0 - block $case0|0 - global.get $~lib/collector/itcm/state - local.set $1 - local.get $1 - i32.const 0 - i32.eq - br_if $case0|0 - local.get $1 - i32.const 1 - i32.eq - br_if $case1|0 - local.get $1 - i32.const 2 - i32.eq - br_if $case2|0 - local.get $1 - i32.const 3 - i32.eq - br_if $case3|0 - br $break|0 - end - block - block $~lib/memory/memory.allocate|inlined.0 (result i32) - i32.const 16 - local.set $1 - local.get $1 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.0 - end - global.set $~lib/collector/itcm/fromSpace - global.get $~lib/collector/itcm/fromSpace - i32.const -1 - i32.store offset=8 - global.get $~lib/collector/itcm/fromSpace - call $~lib/collector/itcm/ManagedObjectList#clear - block $~lib/memory/memory.allocate|inlined.1 (result i32) - i32.const 16 - local.set $1 - local.get $1 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.1 - end - global.set $~lib/collector/itcm/toSpace - global.get $~lib/collector/itcm/toSpace - i32.const -1 - i32.store offset=8 - global.get $~lib/collector/itcm/toSpace - call $~lib/collector/itcm/ManagedObjectList#clear - global.get $~lib/collector/itcm/toSpace - global.set $~lib/collector/itcm/iter - i32.const 1 - global.set $~lib/collector/itcm/state - end - end - block - i32.const 3 - call $~iterateRoots - i32.const 2 - global.set $~lib/collector/itcm/state - br $break|0 - unreachable - end - unreachable - end - block - global.get $~lib/collector/itcm/iter - call $~lib/collector/itcm/ManagedObject#get:next - local.set $0 - local.get $0 - global.get $~lib/collector/itcm/toSpace - i32.ne - if - local.get $0 - global.set $~lib/collector/itcm/iter - local.get $0 - global.get $~lib/collector/itcm/white - i32.eqz - call $~lib/collector/itcm/ManagedObject#set:color - i32.const 1 - global.set $~lib/argc - block $~lib/collector/itcm/objToRef|inlined.0 (result i32) - local.get $0 - local.set $1 - local.get $1 - i32.const 16 - i32.add - end - local.get $0 - i32.load offset=8 - call_indirect (type $FUNCSIG$vi) - else - i32.const 3 - call $~iterateRoots - global.get $~lib/collector/itcm/iter - call $~lib/collector/itcm/ManagedObject#get:next - local.set $0 - local.get $0 - global.get $~lib/collector/itcm/toSpace - i32.eq - if - global.get $~lib/collector/itcm/fromSpace - local.set $1 - global.get $~lib/collector/itcm/toSpace - global.set $~lib/collector/itcm/fromSpace - local.get $1 - global.set $~lib/collector/itcm/toSpace - global.get $~lib/collector/itcm/white - i32.eqz - global.set $~lib/collector/itcm/white - local.get $1 - call $~lib/collector/itcm/ManagedObject#get:next - global.set $~lib/collector/itcm/iter - i32.const 3 - global.set $~lib/collector/itcm/state - end - end - br $break|0 - unreachable - end - unreachable - end - block - global.get $~lib/collector/itcm/iter - local.set $0 - local.get $0 - global.get $~lib/collector/itcm/toSpace - i32.ne - if - local.get $0 - call $~lib/collector/itcm/ManagedObject#get:next - global.set $~lib/collector/itcm/iter - local.get $0 - global.get $~lib/memory/HEAP_BASE - i32.ge_u - if - block $~lib/memory/memory.free|inlined.0 - local.get $0 - local.set $1 - local.get $1 - call $~lib/allocator/arena/__memory_free - br $~lib/memory/memory.free|inlined.0 - end - end - else - global.get $~lib/collector/itcm/toSpace - call $~lib/collector/itcm/ManagedObjectList#clear - i32.const 1 - global.set $~lib/collector/itcm/state - end - br $break|0 - unreachable - end - unreachable - end - ) - (func $~lib/collector/itcm/__gc_collect (; 16 ;) (type $FUNCSIG$v) - (local $0 i32) - block $break|0 - block $case1|0 - block $case0|0 - global.get $~lib/collector/itcm/state - local.set $0 - local.get $0 - i32.const 0 - i32.eq - br_if $case0|0 - local.get $0 - i32.const 1 - i32.eq - br_if $case1|0 - br $break|0 - end - end - call $~lib/collector/itcm/step - end - block $break|1 - loop $continue|1 - global.get $~lib/collector/itcm/state - i32.const 1 - i32.ne - if - call $~lib/collector/itcm/step - br $continue|1 - end - end - end - ) - (func $~lib/gc/gc.collect (; 17 ;) (type $FUNCSIG$v) - call $~lib/collector/itcm/__gc_collect - return - ) - (func $~lib/collector/itcm/__gc_allocate (; 18 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - local.get $0 - i32.const 1073741824 - i32.const 16 - i32.sub - i32.gt_u - if - unreachable - end - call $~lib/collector/itcm/step - block $~lib/memory/memory.allocate|inlined.2 (result i32) - i32.const 16 - local.get $0 - i32.add - local.set $2 - local.get $2 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.2 - end - local.set $3 - local.get $3 - local.get $1 - i32.store offset=8 - local.get $3 - global.get $~lib/collector/itcm/white - call $~lib/collector/itcm/ManagedObject#set:color - global.get $~lib/collector/itcm/fromSpace - local.get $3 - call $~lib/collector/itcm/ManagedObjectList#push - block $~lib/collector/itcm/objToRef|inlined.1 (result i32) - local.get $3 - local.set $2 - local.get $2 - i32.const 16 - i32.add - end - ) - (func $std/gc-array/Foo~gc (; 19 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 - i32.eqz - if - return - end - local.get $0 - call $~lib/collector/itcm/__gc_mark - ) - (func $~lib/string/String~gc (; 20 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 - i32.eqz - if - return - end - local.get $0 - call $~lib/collector/itcm/__gc_mark - ) - (func $~lib/internal/arraybuffer/computeSize (; 21 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 1 - i32.const 32 - local.get $0 - i32.const 8 - i32.add - i32.const 1 - i32.sub - i32.clz - i32.sub - i32.shl - ) - (func $~lib/internal/arraybuffer/__gc (; 22 ;) (type $FUNCSIG$vi) (param $0 i32) - nop - ) - (func $~lib/internal/arraybuffer/allocateUnsafe (; 23 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - local.get $0 - i32.const 1073741816 - i32.le_u - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 26 - i32.const 2 - call $~lib/env/abort - unreachable - end - local.get $0 - call $~lib/internal/arraybuffer/computeSize - i32.const 6 - call $~lib/collector/itcm/__gc_allocate - local.set $1 - local.get $1 - local.get $0 - i32.store - local.get $1 - ) - (func $~lib/internal/memory/memcpy (; 24 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - block $break|0 - loop $continue|0 - local.get $2 - if (result i32) - local.get $1 - i32.const 3 - i32.and - else - local.get $2 - end - if - block - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - end - br $continue|0 - end - end - end - local.get $0 - i32.const 3 - i32.and - i32.const 0 - i32.eq - if - block $break|1 - loop $continue|1 - local.get $2 - i32.const 16 - i32.ge_u - if - block - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $1 - i32.const 4 - i32.add - i32.load - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $1 - i32.const 8 - i32.add - i32.load - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 12 - i32.add - i32.load - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - end - br $continue|1 - end - end - end - local.get $2 - i32.const 8 - i32.and - if - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $1 - i32.const 4 - i32.add - i32.load - i32.store - local.get $0 - i32.const 8 - i32.add - local.set $0 - local.get $1 - i32.const 8 - i32.add - local.set $1 - end - local.get $2 - i32.const 4 - i32.and - if - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.set $0 - local.get $1 - i32.const 4 - i32.add - local.set $1 - end - local.get $2 - i32.const 2 - i32.and - if - local.get $0 - local.get $1 - i32.load16_u - i32.store16 - local.get $0 - i32.const 2 - i32.add - local.set $0 - local.get $1 - i32.const 2 - i32.add - local.set $1 - end - local.get $2 - i32.const 1 - i32.and - if - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - end - return - end - local.get $2 - i32.const 32 - i32.ge_u - if - block $break|2 - block $case2|2 - block $case1|2 - block $case0|2 - local.get $0 - i32.const 3 - i32.and - local.set $5 - local.get $5 - i32.const 1 - i32.eq - br_if $case0|2 - local.get $5 - i32.const 2 - i32.eq - br_if $case1|2 - local.get $5 - i32.const 3 - i32.eq - br_if $case2|2 - br $break|2 - end - block - local.get $1 - i32.load - local.set $3 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - local.get $2 - i32.const 3 - i32.sub - local.set $2 - block $break|3 - loop $continue|3 - local.get $2 - i32.const 17 - i32.ge_u - if - block - local.get $1 - i32.const 1 - i32.add - i32.load - local.set $4 - local.get $0 - local.get $3 - i32.const 24 - i32.shr_u - local.get $4 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 5 - i32.add - i32.load - local.set $3 - local.get $0 - i32.const 4 - i32.add - local.get $4 - i32.const 24 - i32.shr_u - local.get $3 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 9 - i32.add - i32.load - local.set $4 - local.get $0 - i32.const 8 - i32.add - local.get $3 - i32.const 24 - i32.shr_u - local.get $4 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 13 - i32.add - i32.load - local.set $3 - local.get $0 - i32.const 12 - i32.add - local.get $4 - i32.const 24 - i32.shr_u - local.get $3 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - end - br $continue|3 - end - end - end - br $break|2 - unreachable - end - unreachable - end - block - local.get $1 - i32.load - local.set $3 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - local.get $2 - i32.const 2 - i32.sub - local.set $2 - block $break|4 - loop $continue|4 - local.get $2 - i32.const 18 - i32.ge_u - if - block - local.get $1 - i32.const 2 - i32.add - i32.load - local.set $4 - local.get $0 - local.get $3 - i32.const 16 - i32.shr_u - local.get $4 - i32.const 16 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 6 - i32.add - i32.load - local.set $3 - local.get $0 - i32.const 4 - i32.add - local.get $4 - i32.const 16 - i32.shr_u - local.get $3 - i32.const 16 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 10 - i32.add - i32.load - local.set $4 - local.get $0 - i32.const 8 - i32.add - local.get $3 - i32.const 16 - i32.shr_u - local.get $4 - i32.const 16 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 14 - i32.add - i32.load - local.set $3 - local.get $0 - i32.const 12 - i32.add - local.get $4 - i32.const 16 - i32.shr_u - local.get $3 - i32.const 16 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - end - br $continue|4 - end - end - end - br $break|2 - unreachable - end - unreachable - end - block - local.get $1 - i32.load - local.set $3 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - block $break|5 - loop $continue|5 - local.get $2 - i32.const 19 - i32.ge_u - if - block - local.get $1 - i32.const 3 - i32.add - i32.load - local.set $4 - local.get $0 - local.get $3 - i32.const 8 - i32.shr_u - local.get $4 - i32.const 24 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 7 - i32.add - i32.load - local.set $3 - local.get $0 - i32.const 4 - i32.add - local.get $4 - i32.const 8 - i32.shr_u - local.get $3 - i32.const 24 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 11 - i32.add - i32.load - local.set $4 - local.get $0 - i32.const 8 - i32.add - local.get $3 - i32.const 8 - i32.shr_u - local.get $4 - i32.const 24 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 15 - i32.add - i32.load - local.set $3 - local.get $0 - i32.const 12 - i32.add - local.get $4 - i32.const 8 - i32.shr_u - local.get $3 - i32.const 24 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - end - br $continue|5 - end - end - end - br $break|2 - unreachable - end - unreachable - end - end - local.get $2 - i32.const 16 - i32.and - if - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - end - local.get $2 - i32.const 8 - i32.and - if - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - end - local.get $2 - i32.const 4 - i32.and - if - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - end - local.get $2 - i32.const 2 - i32.and - if - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - end - local.get $2 - i32.const 1 - i32.and - if - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - end - ) - (func $~lib/internal/memory/memmove (; 25 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - local.get $0 - local.get $1 - i32.eq - if - return - end - local.get $1 - local.get $2 - i32.add - local.get $0 - i32.le_u - local.tee $3 - if (result i32) - local.get $3 - else - local.get $0 - local.get $2 - i32.add - local.get $1 - i32.le_u - end - if - local.get $0 - local.get $1 - local.get $2 - call $~lib/internal/memory/memcpy - return - end - local.get $0 - local.get $1 - i32.lt_u - if - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and - i32.eq - if - block $break|0 - loop $continue|0 - local.get $0 - i32.const 7 - i32.and - if - block - local.get $2 - i32.eqz - if - return - end - local.get $2 - i32.const 1 - i32.sub - local.set $2 - block (result i32) - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $3 - end - block (result i32) - local.get $1 - local.tee $3 - i32.const 1 - i32.add - local.set $1 - local.get $3 - end - i32.load8_u - i32.store8 - end - br $continue|0 - end - end - end - block $break|1 - loop $continue|1 - local.get $2 - i32.const 8 - i32.ge_u - if - block - local.get $0 - local.get $1 - i64.load - i64.store - local.get $2 - i32.const 8 - i32.sub - local.set $2 - local.get $0 - i32.const 8 - i32.add - local.set $0 - local.get $1 - i32.const 8 - i32.add - local.set $1 - end - br $continue|1 - end - end - end - end - block $break|2 - loop $continue|2 - local.get $2 - if - block - block (result i32) - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $3 - end - block (result i32) - local.get $1 - local.tee $3 - i32.const 1 - i32.add - local.set $1 - local.get $3 - end - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - end - br $continue|2 - end - end - end - else - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and - i32.eq - if - block $break|3 - loop $continue|3 - local.get $0 - local.get $2 - i32.add - i32.const 7 - i32.and - if - block - local.get $2 - i32.eqz - if - return - end - local.get $0 - local.get $2 - i32.const 1 - i32.sub - local.tee $2 - i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 - end - br $continue|3 - end - end - end - block $break|4 - loop $continue|4 - local.get $2 - i32.const 8 - i32.ge_u - if - block - local.get $2 - i32.const 8 - i32.sub - local.set $2 - local.get $0 - local.get $2 - i32.add - local.get $1 - local.get $2 - i32.add - i64.load - i64.store - end - br $continue|4 - end - end - end - end - block $break|5 - loop $continue|5 - local.get $2 - if - local.get $0 - local.get $2 - i32.const 1 - i32.sub - local.tee $2 - i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 - br $continue|5 - end - end - end - end - ) - (func $~lib/internal/memory/memset (; 26 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i64) - local.get $2 - i32.eqz - if - return - end - local.get $0 - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 1 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 2 - i32.le_u - if - return - end - local.get $0 - i32.const 1 - i32.add - local.get $1 - i32.store8 - local.get $0 - i32.const 2 - i32.add - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 2 - i32.sub - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 3 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 6 - i32.le_u - if - return - end - local.get $0 - i32.const 3 - i32.add - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 4 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 8 - i32.le_u - if - return - end - i32.const 0 - local.get $0 - i32.sub - i32.const 3 - i32.and - local.set $3 - local.get $0 - local.get $3 - i32.add - local.set $0 - local.get $2 - local.get $3 - i32.sub - local.set $2 - local.get $2 - i32.const -4 - i32.and - local.set $2 - i32.const -1 - i32.const 255 - i32.div_u - local.get $1 - i32.const 255 - i32.and - i32.mul - local.set $4 - local.get $0 - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 4 - i32.sub - local.get $4 - i32.store - local.get $2 - i32.const 8 - i32.le_u - if - return - end - local.get $0 - i32.const 4 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 12 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 8 - i32.sub - local.get $4 - i32.store - local.get $2 - i32.const 24 - i32.le_u - if - return - end - local.get $0 - i32.const 12 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 16 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 20 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 24 - i32.add - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 28 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 24 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 20 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 16 - i32.sub - local.get $4 - i32.store - i32.const 24 - local.get $0 - i32.const 4 - i32.and - i32.add - local.set $3 - local.get $0 - local.get $3 - i32.add - local.set $0 - local.get $2 - local.get $3 - i32.sub - local.set $2 - local.get $4 - i64.extend_i32_u - local.get $4 - i64.extend_i32_u - i64.const 32 - i64.shl - i64.or - local.set $5 - block $break|0 - loop $continue|0 - local.get $2 - i32.const 32 - i32.ge_u - if - block - local.get $0 - local.get $5 - i64.store - local.get $0 - i32.const 8 - i32.add - local.get $5 - i64.store - local.get $0 - i32.const 16 - i32.add - local.get $5 - i64.store - local.get $0 - i32.const 24 - i32.add - local.get $5 - i64.store - local.get $2 - i32.const 32 - i32.sub - local.set $2 - local.get $0 - i32.const 32 - i32.add - local.set $0 - end - br $continue|0 - end - end - end - ) - (func $~lib/internal/arraybuffer/reallocateUnsafe (; 27 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $0 - i32.load - local.set $2 - local.get $1 - local.get $2 - i32.gt_s - if - local.get $1 - i32.const 1073741816 - i32.le_s - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 40 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $1 - local.get $2 - call $~lib/internal/arraybuffer/computeSize - i32.const 8 - i32.sub - i32.le_s - if - local.get $0 - local.get $1 - i32.store - else - local.get $1 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $3 - block $~lib/memory/memory.copy|inlined.0 - local.get $3 - i32.const 8 - i32.add - local.set $4 - local.get $0 - i32.const 8 - i32.add - local.set $5 - local.get $2 - local.set $6 - local.get $4 - local.get $5 - local.get $6 - call $~lib/internal/memory/memmove - end - local.get $3 - local.set $0 - end - block $~lib/memory/memory.fill|inlined.0 - local.get $0 - i32.const 8 - i32.add - local.get $2 - i32.add - local.set $3 - i32.const 0 - local.set $6 - local.get $1 - local.get $2 - i32.sub - local.set $5 - local.get $3 - local.get $6 - local.get $5 - call $~lib/internal/memory/memset - end - else - local.get $1 - local.get $2 - i32.lt_s - if - local.get $1 - i32.const 0 - i32.ge_s - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 62 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.store - end - end - local.get $0 - ) - (func $~lib/collector/itcm/__gc_link (; 28 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - block $~lib/collector/itcm/refToObj|inlined.1 (result i32) - local.get $0 - local.set $2 - local.get $2 - i32.const 16 - i32.sub - end - local.set $3 - local.get $3 - call $~lib/collector/itcm/ManagedObject#get:color - global.get $~lib/collector/itcm/white - i32.eqz - i32.eq - local.tee $2 - if (result i32) - block $~lib/collector/itcm/refToObj|inlined.3 (result i32) - local.get $1 - local.set $2 - local.get $2 - i32.const 16 - i32.sub - end - call $~lib/collector/itcm/ManagedObject#get:color - global.get $~lib/collector/itcm/white - i32.eq - else - local.get $2 - end - if - local.get $3 - call $~lib/collector/itcm/ManagedObject#makeGray - end - ) - (func $~lib/array/Array#__set (; 29 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - local.get $0 - i32.load - local.set $3 - local.get $3 - i32.load - i32.const 2 - i32.shr_u - local.set $4 - local.get $1 - local.get $4 - i32.ge_u - if - local.get $1 - i32.const 268435454 - i32.ge_u - if - i32.const 0 - i32.const 72 - i32.const 107 - i32.const 41 - call $~lib/env/abort - unreachable - end - local.get $3 - local.get $1 - i32.const 1 - i32.add - i32.const 2 - i32.shl - call $~lib/internal/arraybuffer/reallocateUnsafe - local.set $3 - local.get $0 - local.get $3 - i32.store - local.get $0 - local.get $1 - i32.const 1 - i32.add - i32.store offset=4 - end - block $~lib/internal/arraybuffer/STORE|inlined.0 - local.get $3 - local.set $5 - local.get $1 - local.set $6 - local.get $2 - local.set $7 - i32.const 0 - local.set $8 - local.get $5 - local.get $6 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.add - local.get $7 - i32.store offset=8 - end - local.get $0 - local.get $2 - call $~lib/collector/itcm/__gc_link - ) - (func $start:std/gc-array (; 30 ;) (type $FUNCSIG$v) - (local $0 i32) - (local $1 i32) - (local $2 i32) - call $start:~lib/allocator/arena - call $~lib/gc/gc.collect - global.get $std/gc-array/arr - i32.const 0 - block (result i32) - i32.const 0 - i32.const 4 - call $~lib/collector/itcm/__gc_allocate - local.set $0 - local.get $0 - end - call $~lib/array/Array#__set - call $~lib/gc/gc.collect - global.get $std/gc-array/arr - i32.const 1 - block (result i32) - i32.const 0 - i32.const 4 - call $~lib/collector/itcm/__gc_allocate - local.set $1 - local.get $1 - end - call $~lib/array/Array#__set - call $~lib/gc/gc.collect - global.get $std/gc-array/arr - i32.const 0 - block (result i32) - i32.const 0 - i32.const 4 - call $~lib/collector/itcm/__gc_allocate - local.set $2 - local.get $2 - end - call $~lib/array/Array#__set - call $~lib/gc/gc.collect - ) - (func $std/gc-array/main (; 31 ;) (type $FUNCSIG$i) (result i32) - global.get $~lib/started - i32.eqz - if - call $start - i32.const 1 - global.set $~lib/started - end - i32.const 0 - ) - (func $start (; 32 ;) (type $FUNCSIG$v) - call $start:std/gc-array - ) - (func $null (; 33 ;) (type $FUNCSIG$v) - ) - (func $~iterateRoots (; 34 ;) (type $FUNCSIG$vi) (param $0 i32) - global.get $std/gc-array/arr - local.get $0 - call_indirect (type $FUNCSIG$vi) - ) -) diff --git a/tests/compiler/std/gc-basics.optimized.wat b/tests/compiler/std/gc-basics.optimized.wat deleted file mode 100644 index 15b106955e..0000000000 --- a/tests/compiler/std/gc-basics.optimized.wat +++ /dev/null @@ -1,481 +0,0 @@ -(module - (type $FUNCSIG$v (func)) - (type $FUNCSIG$vi (func (param i32))) - (type $FUNCSIG$ii (func (param i32) (result i32))) - (type $FUNCSIG$vii (func (param i32 i32))) - (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) - (type $FUNCSIG$i (func (result i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) - (memory $0 1) - (data (i32.const 16) "\03\00\00\00\00\00\00\00\10\00\00\00s\00t\00d\00/\00g\00c\00-\00b\00a\00s\00i\00c\00s\00.\00t\00s") - (table $0 4 funcref) - (elem (i32.const 0) $null $std/gc-basics/MyObject_visit $~lib/collector/itcm/__gc_mark $~lib/string/String~gc) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) - (global $~lib/collector/itcm/state (mut i32) (i32.const 0)) - (global $~lib/collector/itcm/white (mut i32) (i32.const 0)) - (global $~lib/collector/itcm/fromSpace (mut i32) (i32.const 0)) - (global $~lib/collector/itcm/toSpace (mut i32) (i32.const 0)) - (global $~lib/collector/itcm/iter (mut i32) (i32.const 0)) - (global $~lib/argc (mut i32) (i32.const 0)) - (global $std/gc-basics/obj (mut i32) (i32.const 0)) - (global $std/gc-basics/obj2 (mut i32) (i32.const 0)) - (global $~lib/started (mut i32) (i32.const 0)) - (export "memory" (memory $0)) - (export "table" (table $0)) - (export "main" (func $std/gc-basics/main)) - (func $std/gc-basics/MyObject_visit (; 1 ;) (type $FUNCSIG$vi) (param $0 i32) - nop - ) - (func $~lib/allocator/arena/__memory_allocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - local.get $0 - i32.const 1073741824 - i32.gt_u - if - unreachable - end - global.get $~lib/allocator/arena/offset - local.tee $1 - local.get $0 - i32.const 1 - local.get $0 - i32.const 1 - i32.gt_u - select - i32.add - i32.const 7 - i32.add - i32.const -8 - i32.and - local.tee $0 - current_memory - local.tee $2 - i32.const 16 - i32.shl - i32.gt_u - if - local.get $2 - local.get $0 - local.get $1 - i32.sub - i32.const 65535 - i32.add - i32.const -65536 - i32.and - i32.const 16 - i32.shr_u - local.tee $3 - local.get $2 - local.get $3 - i32.gt_s - select - grow_memory - i32.const 0 - i32.lt_s - if - local.get $3 - grow_memory - i32.const 0 - i32.lt_s - if - unreachable - end - end - end - local.get $0 - global.set $~lib/allocator/arena/offset - local.get $1 - ) - (func $~lib/collector/itcm/ManagedObjectList#push (; 3 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - (local $2 i32) - local.get $0 - i32.load offset=4 - local.set $2 - local.get $1 - local.get $1 - i32.load - i32.const 3 - i32.and - local.get $0 - i32.or - i32.store - local.get $1 - local.get $2 - i32.store offset=4 - local.get $2 - local.get $2 - i32.load - i32.const 3 - i32.and - local.get $1 - i32.or - i32.store - local.get $0 - local.get $1 - i32.store offset=4 - ) - (func $~lib/collector/itcm/ManagedObject#makeGray (; 4 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) - (local $2 i32) - global.get $~lib/collector/itcm/iter - local.get $0 - i32.eq - if - local.get $0 - i32.load offset=4 - global.set $~lib/collector/itcm/iter - end - local.get $0 - i32.load - i32.const -4 - i32.and - local.tee $2 - local.get $0 - i32.load offset=4 - local.tee $1 - i32.store offset=4 - local.get $1 - local.get $1 - i32.load - i32.const 3 - i32.and - local.get $2 - i32.or - i32.store - global.get $~lib/collector/itcm/toSpace - local.get $0 - call $~lib/collector/itcm/ManagedObjectList#push - local.get $0 - local.get $0 - i32.load - i32.const -4 - i32.and - i32.const 2 - i32.or - i32.store - ) - (func $~lib/collector/itcm/__gc_mark (; 5 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 - if - global.get $~lib/collector/itcm/white - local.get $0 - i32.const 16 - i32.sub - local.tee $0 - i32.load - i32.const 3 - i32.and - i32.eq - if - local.get $0 - call $~lib/collector/itcm/ManagedObject#makeGray - end - end - ) - (func $~lib/collector/itcm/step (; 6 ;) (type $FUNCSIG$v) - (local $0 i32) - block $break|0 - block $case3|0 - block $case2|0 - block $case1|0 - global.get $~lib/collector/itcm/state - local.tee $0 - if - local.get $0 - i32.const 1 - i32.sub - br_table $case1|0 $case2|0 $case3|0 $break|0 - end - i32.const 16 - call $~lib/allocator/arena/__memory_allocate - global.set $~lib/collector/itcm/fromSpace - global.get $~lib/collector/itcm/fromSpace - local.tee $0 - i32.const -1 - i32.store offset=8 - local.get $0 - local.get $0 - i32.store - local.get $0 - local.get $0 - i32.store offset=4 - i32.const 16 - call $~lib/allocator/arena/__memory_allocate - global.set $~lib/collector/itcm/toSpace - global.get $~lib/collector/itcm/toSpace - local.tee $0 - i32.const -1 - i32.store offset=8 - local.get $0 - local.get $0 - i32.store - local.get $0 - local.get $0 - i32.store offset=4 - global.get $~lib/collector/itcm/toSpace - global.set $~lib/collector/itcm/iter - i32.const 1 - global.set $~lib/collector/itcm/state - end - global.get $std/gc-basics/obj - i32.const 2 - call_indirect (type $FUNCSIG$vi) - global.get $std/gc-basics/obj2 - i32.const 2 - call_indirect (type $FUNCSIG$vi) - i32.const 2 - global.set $~lib/collector/itcm/state - br $break|0 - end - global.get $~lib/collector/itcm/iter - i32.load - i32.const -4 - i32.and - local.tee $0 - global.get $~lib/collector/itcm/toSpace - i32.ne - if - local.get $0 - global.set $~lib/collector/itcm/iter - local.get $0 - global.get $~lib/collector/itcm/white - i32.eqz - local.get $0 - i32.load - i32.const -4 - i32.and - i32.or - i32.store - i32.const 1 - global.set $~lib/argc - local.get $0 - i32.const 16 - i32.add - local.get $0 - i32.load offset=8 - call_indirect (type $FUNCSIG$vi) - else - global.get $std/gc-basics/obj - i32.const 2 - call_indirect (type $FUNCSIG$vi) - global.get $std/gc-basics/obj2 - i32.const 2 - call_indirect (type $FUNCSIG$vi) - global.get $~lib/collector/itcm/toSpace - global.get $~lib/collector/itcm/iter - i32.load - i32.const -4 - i32.and - i32.eq - if - global.get $~lib/collector/itcm/fromSpace - local.set $0 - global.get $~lib/collector/itcm/toSpace - global.set $~lib/collector/itcm/fromSpace - local.get $0 - global.set $~lib/collector/itcm/toSpace - global.get $~lib/collector/itcm/white - i32.eqz - global.set $~lib/collector/itcm/white - local.get $0 - i32.load - i32.const -4 - i32.and - global.set $~lib/collector/itcm/iter - i32.const 3 - global.set $~lib/collector/itcm/state - end - end - br $break|0 - end - global.get $~lib/collector/itcm/iter - local.tee $0 - global.get $~lib/collector/itcm/toSpace - i32.ne - if - local.get $0 - i32.load - i32.const -4 - i32.and - global.set $~lib/collector/itcm/iter - else - global.get $~lib/collector/itcm/toSpace - local.tee $0 - local.get $0 - i32.store - local.get $0 - local.get $0 - i32.store offset=4 - i32.const 1 - global.set $~lib/collector/itcm/state - end - end - ) - (func $~lib/collector/itcm/__gc_allocate (; 7 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) - call $~lib/collector/itcm/step - i32.const 20 - call $~lib/allocator/arena/__memory_allocate - local.tee $0 - i32.const 1 - i32.store offset=8 - local.get $0 - global.get $~lib/collector/itcm/white - local.get $0 - i32.load - i32.const -4 - i32.and - i32.or - i32.store - global.get $~lib/collector/itcm/fromSpace - local.get $0 - call $~lib/collector/itcm/ManagedObjectList#push - local.get $0 - i32.const 16 - i32.add - ) - (func $~lib/string/String~gc (; 8 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 - i32.eqz - if - return - end - local.get $0 - call $~lib/collector/itcm/__gc_mark - ) - (func $~lib/collector/itcm/__gc_collect (; 9 ;) (type $FUNCSIG$v) - (local $0 i32) - block $break|0 - block $case1|0 - global.get $~lib/collector/itcm/state - local.tee $0 - i32.eqz - br_if $case1|0 - local.get $0 - i32.const 1 - i32.eq - br_if $case1|0 - br $break|0 - end - call $~lib/collector/itcm/step - end - loop $continue|1 - global.get $~lib/collector/itcm/state - i32.const 1 - i32.ne - if - call $~lib/collector/itcm/step - br $continue|1 - end - end - ) - (func $start:std/gc-basics (; 10 ;) (type $FUNCSIG$v) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - i32.const 64 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - call $~lib/collector/itcm/__gc_allocate - global.set $std/gc-basics/obj - global.get $std/gc-basics/obj - local.tee $0 - i32.const 123 - i32.store - local.get $0 - i32.const 16 - i32.sub - local.tee $0 - i32.load offset=4 - local.set $2 - block (result i32) - local.get $0 - i32.load - i32.const -4 - i32.and - local.tee $3 - i32.const 0 - i32.ne - local.tee $1 - if - local.get $2 - i32.const 0 - i32.ne - local.set $1 - end - local.get $1 - end - if (result i32) - local.get $2 - local.get $3 - i32.eq - else - local.get $1 - end - i32.eqz - if - i32.const 0 - i32.const 24 - i32.const 19 - i32.const 2 - call $~lib/env/abort - unreachable - end - local.get $0 - i32.load offset=8 - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 24 - i32.const 21 - i32.const 2 - call $~lib/env/abort - unreachable - end - local.get $0 - i32.load offset=12 - if - i32.const 0 - i32.const 24 - i32.const 23 - i32.const 2 - call $~lib/env/abort - unreachable - end - local.get $0 - i32.load offset=16 - i32.const 123 - i32.ne - if - i32.const 0 - i32.const 24 - i32.const 25 - i32.const 2 - call $~lib/env/abort - unreachable - end - call $~lib/collector/itcm/__gc_collect - i32.const 0 - global.set $std/gc-basics/obj - call $~lib/collector/itcm/__gc_collect - ) - (func $std/gc-basics/main (; 11 ;) (type $FUNCSIG$i) (result i32) - global.get $~lib/started - i32.eqz - if - call $start:std/gc-basics - i32.const 1 - global.set $~lib/started - end - i32.const 0 - ) - (func $null (; 12 ;) (type $FUNCSIG$v) - nop - ) -) diff --git a/tests/compiler/std/gc-basics.ts b/tests/compiler/std/gc-basics.ts deleted file mode 100644 index fc79941f51..0000000000 --- a/tests/compiler/std/gc-basics.ts +++ /dev/null @@ -1,35 +0,0 @@ -import "allocator/arena"; -import "collector/itcm"; - -// a class to test with -class MyObject { - a: u32; -} -function MyObject_visit(ref: usize): void {} // function table index == classId ? - -// allocate a managed instance -var obj: MyObject | null = changetype(__gc_allocate(offsetof(), MyObject_visit)); -obj.a = 123; - -// check header -{ - let head = changetype(obj) - 16; - let next = load(head, 0) & ~3; - let prev = load(head, 4); - assert(next != 0 && prev != 0 && next == prev); - let visitFn = load(head, 8); - assert(visitFn == changetype(MyObject_visit)); - let unused = load(head, 12); - assert(unused == 0); - let a = load(head, 16); - assert(a == 123); -} - -gc.collect(); // should keep 'obj' because it's a referenced root (see trace output) -obj = null; -gc.collect(); // should free 'obj' because it isn't referenced anymore (see trace output) - -var obj2: MyObject; // should also iterate globals defined late - -@start -export function main(): i32 { return 0; } diff --git a/tests/compiler/std/gc-basics.untouched.wat b/tests/compiler/std/gc-basics.untouched.wat deleted file mode 100644 index e24be9c925..0000000000 --- a/tests/compiler/std/gc-basics.untouched.wat +++ /dev/null @@ -1,629 +0,0 @@ -(module - (type $FUNCSIG$v (func)) - (type $FUNCSIG$vi (func (param i32))) - (type $FUNCSIG$iii (func (param i32 i32) (result i32))) - (type $FUNCSIG$ii (func (param i32) (result i32))) - (type $FUNCSIG$vii (func (param i32 i32))) - (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) - (type $FUNCSIG$i (func (result i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) - (memory $0 1) - (data (i32.const 8) "\00\00\00\00\00\00\00\00\03\00\00\00\00\00\00\00\10\00\00\00s\00t\00d\00/\00g\00c\00-\00b\00a\00s\00i\00c\00s\00.\00t\00s\00") - (table $0 4 funcref) - (elem (i32.const 0) $null $std/gc-basics/MyObject_visit $~lib/collector/itcm/__gc_mark $~lib/string/String~gc) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) - (global $~lib/collector/itcm/state (mut i32) (i32.const 0)) - (global $~lib/collector/itcm/white (mut i32) (i32.const 0)) - (global $~lib/collector/itcm/fromSpace (mut i32) (i32.const 0)) - (global $~lib/collector/itcm/toSpace (mut i32) (i32.const 0)) - (global $~lib/collector/itcm/iter (mut i32) (i32.const 0)) - (global $~lib/argc (mut i32) (i32.const 0)) - (global $std/gc-basics/obj (mut i32) (i32.const 0)) - (global $std/gc-basics/obj2 (mut i32) (i32.const 0)) - (global $~lib/started (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 60)) - (export "memory" (memory $0)) - (export "table" (table $0)) - (export "main" (func $std/gc-basics/main)) - (func $start:~lib/allocator/arena (; 1 ;) (type $FUNCSIG$v) - global.get $~lib/memory/HEAP_BASE - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - ) - (func $std/gc-basics/MyObject_visit (; 2 ;) (type $FUNCSIG$vi) (param $0 i32) - nop - ) - (func $~lib/allocator/arena/__memory_allocate (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $0 - i32.const 1073741824 - i32.gt_u - if - unreachable - end - global.get $~lib/allocator/arena/offset - local.set $1 - local.get $1 - local.get $0 - local.tee $2 - i32.const 1 - local.tee $3 - local.get $2 - local.get $3 - i32.gt_u - select - i32.add - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - local.set $4 - current_memory - local.set $5 - local.get $4 - local.get $5 - i32.const 16 - i32.shl - i32.gt_u - if - local.get $4 - local.get $1 - i32.sub - i32.const 65535 - i32.add - i32.const 65535 - i32.const -1 - i32.xor - i32.and - i32.const 16 - i32.shr_u - local.set $2 - local.get $5 - local.tee $3 - local.get $2 - local.tee $6 - local.get $3 - local.get $6 - i32.gt_s - select - local.set $3 - local.get $3 - grow_memory - i32.const 0 - i32.lt_s - if - local.get $2 - grow_memory - i32.const 0 - i32.lt_s - if - unreachable - end - end - end - local.get $4 - global.set $~lib/allocator/arena/offset - local.get $1 - ) - (func $~lib/collector/itcm/ManagedObjectList#clear (; 4 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 - local.get $0 - i32.store - local.get $0 - local.get $0 - i32.store offset=4 - ) - (func $~lib/collector/itcm/ManagedObject#get:color (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.load - i32.const 3 - i32.and - ) - (func $~lib/collector/itcm/ManagedObject#get:next (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - ) - (func $~lib/collector/itcm/ManagedObject#set:next (; 7 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - local.get $0 - i32.load - i32.const 3 - i32.and - i32.or - i32.store - ) - (func $~lib/collector/itcm/ManagedObject#unlink (; 8 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) - (local $2 i32) - local.get $0 - call $~lib/collector/itcm/ManagedObject#get:next - local.set $1 - local.get $0 - i32.load offset=4 - local.set $2 - local.get $1 - local.get $2 - i32.store offset=4 - local.get $2 - local.get $1 - call $~lib/collector/itcm/ManagedObject#set:next - ) - (func $~lib/collector/itcm/ManagedObjectList#push (; 9 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - (local $2 i32) - local.get $0 - i32.load offset=4 - local.set $2 - local.get $1 - local.get $0 - call $~lib/collector/itcm/ManagedObject#set:next - local.get $1 - local.get $2 - i32.store offset=4 - local.get $2 - local.get $1 - call $~lib/collector/itcm/ManagedObject#set:next - local.get $0 - local.get $1 - i32.store offset=4 - ) - (func $~lib/collector/itcm/ManagedObject#makeGray (; 10 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 - global.get $~lib/collector/itcm/iter - i32.eq - if - local.get $0 - i32.load offset=4 - global.set $~lib/collector/itcm/iter - end - local.get $0 - call $~lib/collector/itcm/ManagedObject#unlink - global.get $~lib/collector/itcm/toSpace - local.get $0 - call $~lib/collector/itcm/ManagedObjectList#push - local.get $0 - local.get $0 - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.const 2 - i32.or - i32.store - ) - (func $~lib/collector/itcm/__gc_mark (; 11 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) - local.get $0 - if - block $~lib/collector/itcm/refToObj|inlined.0 (result i32) - local.get $0 - local.set $1 - local.get $1 - i32.const 16 - i32.sub - end - local.set $1 - local.get $1 - call $~lib/collector/itcm/ManagedObject#get:color - global.get $~lib/collector/itcm/white - i32.eq - if - local.get $1 - call $~lib/collector/itcm/ManagedObject#makeGray - end - end - ) - (func $~lib/collector/itcm/ManagedObject#set:color (; 12 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - local.get $0 - local.get $0 - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - local.get $1 - i32.or - i32.store - ) - (func $~lib/allocator/arena/__memory_free (; 13 ;) (type $FUNCSIG$vi) (param $0 i32) - nop - ) - (func $~lib/collector/itcm/step (; 14 ;) (type $FUNCSIG$v) - (local $0 i32) - (local $1 i32) - block $break|0 - block $case3|0 - block $case2|0 - block $case1|0 - block $case0|0 - global.get $~lib/collector/itcm/state - local.set $1 - local.get $1 - i32.const 0 - i32.eq - br_if $case0|0 - local.get $1 - i32.const 1 - i32.eq - br_if $case1|0 - local.get $1 - i32.const 2 - i32.eq - br_if $case2|0 - local.get $1 - i32.const 3 - i32.eq - br_if $case3|0 - br $break|0 - end - block - block $~lib/memory/memory.allocate|inlined.0 (result i32) - i32.const 16 - local.set $1 - local.get $1 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.0 - end - global.set $~lib/collector/itcm/fromSpace - global.get $~lib/collector/itcm/fromSpace - i32.const -1 - i32.store offset=8 - global.get $~lib/collector/itcm/fromSpace - call $~lib/collector/itcm/ManagedObjectList#clear - block $~lib/memory/memory.allocate|inlined.1 (result i32) - i32.const 16 - local.set $1 - local.get $1 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.1 - end - global.set $~lib/collector/itcm/toSpace - global.get $~lib/collector/itcm/toSpace - i32.const -1 - i32.store offset=8 - global.get $~lib/collector/itcm/toSpace - call $~lib/collector/itcm/ManagedObjectList#clear - global.get $~lib/collector/itcm/toSpace - global.set $~lib/collector/itcm/iter - i32.const 1 - global.set $~lib/collector/itcm/state - end - end - block - i32.const 2 - call $~iterateRoots - i32.const 2 - global.set $~lib/collector/itcm/state - br $break|0 - unreachable - end - unreachable - end - block - global.get $~lib/collector/itcm/iter - call $~lib/collector/itcm/ManagedObject#get:next - local.set $0 - local.get $0 - global.get $~lib/collector/itcm/toSpace - i32.ne - if - local.get $0 - global.set $~lib/collector/itcm/iter - local.get $0 - global.get $~lib/collector/itcm/white - i32.eqz - call $~lib/collector/itcm/ManagedObject#set:color - i32.const 1 - global.set $~lib/argc - block $~lib/collector/itcm/objToRef|inlined.0 (result i32) - local.get $0 - local.set $1 - local.get $1 - i32.const 16 - i32.add - end - local.get $0 - i32.load offset=8 - call_indirect (type $FUNCSIG$vi) - else - i32.const 2 - call $~iterateRoots - global.get $~lib/collector/itcm/iter - call $~lib/collector/itcm/ManagedObject#get:next - local.set $0 - local.get $0 - global.get $~lib/collector/itcm/toSpace - i32.eq - if - global.get $~lib/collector/itcm/fromSpace - local.set $1 - global.get $~lib/collector/itcm/toSpace - global.set $~lib/collector/itcm/fromSpace - local.get $1 - global.set $~lib/collector/itcm/toSpace - global.get $~lib/collector/itcm/white - i32.eqz - global.set $~lib/collector/itcm/white - local.get $1 - call $~lib/collector/itcm/ManagedObject#get:next - global.set $~lib/collector/itcm/iter - i32.const 3 - global.set $~lib/collector/itcm/state - end - end - br $break|0 - unreachable - end - unreachable - end - block - global.get $~lib/collector/itcm/iter - local.set $0 - local.get $0 - global.get $~lib/collector/itcm/toSpace - i32.ne - if - local.get $0 - call $~lib/collector/itcm/ManagedObject#get:next - global.set $~lib/collector/itcm/iter - local.get $0 - global.get $~lib/memory/HEAP_BASE - i32.ge_u - if - block $~lib/memory/memory.free|inlined.0 - local.get $0 - local.set $1 - local.get $1 - call $~lib/allocator/arena/__memory_free - br $~lib/memory/memory.free|inlined.0 - end - end - else - global.get $~lib/collector/itcm/toSpace - call $~lib/collector/itcm/ManagedObjectList#clear - i32.const 1 - global.set $~lib/collector/itcm/state - end - br $break|0 - unreachable - end - unreachable - end - ) - (func $~lib/collector/itcm/__gc_allocate (; 15 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - local.get $0 - i32.const 1073741824 - i32.const 16 - i32.sub - i32.gt_u - if - unreachable - end - call $~lib/collector/itcm/step - block $~lib/memory/memory.allocate|inlined.2 (result i32) - i32.const 16 - local.get $0 - i32.add - local.set $2 - local.get $2 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.2 - end - local.set $3 - local.get $3 - local.get $1 - i32.store offset=8 - local.get $3 - global.get $~lib/collector/itcm/white - call $~lib/collector/itcm/ManagedObject#set:color - global.get $~lib/collector/itcm/fromSpace - local.get $3 - call $~lib/collector/itcm/ManagedObjectList#push - block $~lib/collector/itcm/objToRef|inlined.1 (result i32) - local.get $3 - local.set $2 - local.get $2 - i32.const 16 - i32.add - end - ) - (func $~lib/string/String~gc (; 16 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 - i32.eqz - if - return - end - local.get $0 - call $~lib/collector/itcm/__gc_mark - ) - (func $~lib/collector/itcm/__gc_collect (; 17 ;) (type $FUNCSIG$v) - (local $0 i32) - block $break|0 - block $case1|0 - block $case0|0 - global.get $~lib/collector/itcm/state - local.set $0 - local.get $0 - i32.const 0 - i32.eq - br_if $case0|0 - local.get $0 - i32.const 1 - i32.eq - br_if $case1|0 - br $break|0 - end - end - call $~lib/collector/itcm/step - end - block $break|1 - loop $continue|1 - global.get $~lib/collector/itcm/state - i32.const 1 - i32.ne - if - call $~lib/collector/itcm/step - br $continue|1 - end - end - end - ) - (func $~lib/gc/gc.collect (; 18 ;) (type $FUNCSIG$v) - call $~lib/collector/itcm/__gc_collect - return - ) - (func $start:std/gc-basics (; 19 ;) (type $FUNCSIG$v) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - call $start:~lib/allocator/arena - i32.const 4 - i32.const 1 - call $~lib/collector/itcm/__gc_allocate - global.set $std/gc-basics/obj - global.get $std/gc-basics/obj - i32.const 123 - i32.store - block - global.get $std/gc-basics/obj - i32.const 16 - i32.sub - local.set $0 - local.get $0 - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - local.set $1 - local.get $0 - i32.load offset=4 - local.set $2 - local.get $1 - i32.const 0 - i32.ne - local.tee $3 - if (result i32) - local.get $2 - i32.const 0 - i32.ne - else - local.get $3 - end - local.tee $3 - if (result i32) - local.get $1 - local.get $2 - i32.eq - else - local.get $3 - end - i32.eqz - if - i32.const 0 - i32.const 24 - i32.const 19 - i32.const 2 - call $~lib/env/abort - unreachable - end - local.get $0 - i32.load offset=8 - local.set $3 - local.get $3 - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 24 - i32.const 21 - i32.const 2 - call $~lib/env/abort - unreachable - end - local.get $0 - i32.load offset=12 - local.set $4 - local.get $4 - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 24 - i32.const 23 - i32.const 2 - call $~lib/env/abort - unreachable - end - local.get $0 - i32.load offset=16 - local.set $5 - local.get $5 - i32.const 123 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 24 - i32.const 25 - i32.const 2 - call $~lib/env/abort - unreachable - end - end - call $~lib/gc/gc.collect - i32.const 0 - global.set $std/gc-basics/obj - call $~lib/gc/gc.collect - ) - (func $std/gc-basics/main (; 20 ;) (type $FUNCSIG$i) (result i32) - global.get $~lib/started - i32.eqz - if - call $start - i32.const 1 - global.set $~lib/started - end - i32.const 0 - ) - (func $start (; 21 ;) (type $FUNCSIG$v) - call $start:std/gc-basics - ) - (func $null (; 22 ;) (type $FUNCSIG$v) - ) - (func $~iterateRoots (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) - global.get $std/gc-basics/obj - local.get $0 - call_indirect (type $FUNCSIG$vi) - global.get $std/gc-basics/obj2 - local.get $0 - call_indirect (type $FUNCSIG$vi) - ) -) diff --git a/tests/compiler/std/gc-integration.optimized.wat b/tests/compiler/std/gc-integration.optimized.wat deleted file mode 100644 index c26e47ddde..0000000000 --- a/tests/compiler/std/gc-integration.optimized.wat +++ /dev/null @@ -1,67 +0,0 @@ -(module - (type $FUNCSIG$vi (func (param i32))) - (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) - (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) - (memory $0 1) - (data (i32.const 8) "\15\00\00\00s\00t\00d\00/\00g\00c\00-\00i\00n\00t\00e\00g\00r\00a\00t\00i\00o\00n\00.\00t\00s") - (table $0 2 funcref) - (elem (i32.const 0) $null $start:std/gc-integration~anonymous|0) - (global $std/gc-integration/B.d (mut i32) (i32.const 16)) - (global $std/gc-integration/a_ref (mut i32) (i32.const 24)) - (global $std/gc-integration/b_ref (mut i32) (i32.const 32)) - (global $std/gc-integration/i (mut i32) (i32.const 0)) - (export "memory" (memory $0)) - (export "table" (table $0)) - (start $start) - (func $start:std/gc-integration~anonymous|0 (; 1 ;) (type $FUNCSIG$vi) (param $0 i32) - global.get $std/gc-integration/i - i32.const 1 - i32.add - global.set $std/gc-integration/i - local.get $0 - global.get $std/gc-integration/i - i32.const 3 - i32.shl - i32.ne - if - i32.const 0 - i32.const 8 - i32.const 18 - i32.const 37 - call $~lib/env/abort - unreachable - end - ) - (func $start:std/gc-integration (; 2 ;) (type $FUNCSIG$v) - i32.const 8 - i32.const 1 - call_indirect (type $FUNCSIG$vi) - global.get $std/gc-integration/B.d - i32.const 1 - call_indirect (type $FUNCSIG$vi) - global.get $std/gc-integration/a_ref - i32.const 1 - call_indirect (type $FUNCSIG$vi) - global.get $std/gc-integration/b_ref - i32.const 1 - call_indirect (type $FUNCSIG$vi) - global.get $std/gc-integration/i - i32.const 4 - i32.ne - if - i32.const 0 - i32.const 8 - i32.const 19 - i32.const 0 - call $~lib/env/abort - unreachable - end - ) - (func $start (; 3 ;) (type $FUNCSIG$v) - call $start:std/gc-integration - ) - (func $null (; 4 ;) (type $FUNCSIG$v) - nop - ) -) diff --git a/tests/compiler/std/gc-integration.ts b/tests/compiler/std/gc-integration.ts deleted file mode 100644 index bbb92c7076..0000000000 --- a/tests/compiler/std/gc-integration.ts +++ /dev/null @@ -1,19 +0,0 @@ -// declare classes to test with -class A {} -class B { - static readonly c: B = changetype(8); // static root, readonly - static d: A = changetype(16); // static root, writable -} - -// make sure static properties are compiled -B.c; -B.d; - -// declare roots -var no_ref: usize = 64; // NOT a root, basic value -var a_ref: A | null = changetype(24); // global root, nullable -var b_ref: B = changetype(32); // global root, non-nullable - -var i: i32 = 0; -iterateRoots((ref: usize): void => { assert(ref == ++i << 3); }); -assert(i == 4); diff --git a/tests/compiler/std/gc-integration.untouched.wat b/tests/compiler/std/gc-integration.untouched.wat deleted file mode 100644 index af4c2a2503..0000000000 --- a/tests/compiler/std/gc-integration.untouched.wat +++ /dev/null @@ -1,81 +0,0 @@ -(module - (type $FUNCSIG$vi (func (param i32))) - (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) - (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) - (memory $0 1) - (data (i32.const 8) "\15\00\00\00s\00t\00d\00/\00g\00c\00-\00i\00n\00t\00e\00g\00r\00a\00t\00i\00o\00n\00.\00t\00s\00") - (table $0 2 funcref) - (elem (i32.const 0) $null $start:std/gc-integration~anonymous|0) - (global $std/gc-integration/B.c i32 (i32.const 8)) - (global $std/gc-integration/B.d (mut i32) (i32.const 16)) - (global $std/gc-integration/no_ref (mut i32) (i32.const 64)) - (global $std/gc-integration/a_ref (mut i32) (i32.const 24)) - (global $std/gc-integration/b_ref (mut i32) (i32.const 32)) - (global $std/gc-integration/i (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 56)) - (export "memory" (memory $0)) - (export "table" (table $0)) - (start $start) - (func $start:std/gc-integration~anonymous|0 (; 1 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 - block (result i32) - global.get $std/gc-integration/i - i32.const 1 - i32.add - global.set $std/gc-integration/i - global.get $std/gc-integration/i - end - i32.const 3 - i32.shl - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 18 - i32.const 37 - call $~lib/env/abort - unreachable - end - ) - (func $start:std/gc-integration (; 2 ;) (type $FUNCSIG$v) - global.get $std/gc-integration/B.c - drop - global.get $std/gc-integration/B.d - drop - i32.const 1 - call $~iterateRoots - global.get $std/gc-integration/i - i32.const 4 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 19 - i32.const 0 - call $~lib/env/abort - unreachable - end - ) - (func $start (; 3 ;) (type $FUNCSIG$v) - call $start:std/gc-integration - ) - (func $null (; 4 ;) (type $FUNCSIG$v) - ) - (func $~iterateRoots (; 5 ;) (type $FUNCSIG$vi) (param $0 i32) - global.get $std/gc-integration/B.c - local.get $0 - call_indirect (type $FUNCSIG$vi) - global.get $std/gc-integration/B.d - local.get $0 - call_indirect (type $FUNCSIG$vi) - global.get $std/gc-integration/a_ref - local.get $0 - call_indirect (type $FUNCSIG$vi) - global.get $std/gc-integration/b_ref - local.get $0 - call_indirect (type $FUNCSIG$vi) - ) -) diff --git a/tests/compiler/std/gc-object.optimized.wat b/tests/compiler/std/gc-object.optimized.wat deleted file mode 100644 index dff104f0fb..0000000000 --- a/tests/compiler/std/gc-object.optimized.wat +++ /dev/null @@ -1,437 +0,0 @@ -(module - (type $FUNCSIG$v (func)) - (type $FUNCSIG$iii (func (param i32 i32) (result i32))) - (type $FUNCSIG$ii (func (param i32) (result i32))) - (type $FUNCSIG$vi (func (param i32))) - (type $FUNCSIG$vii (func (param i32 i32))) - (type $FUNCSIG$i (func (result i32))) - (memory $0 0) - (table $0 4 funcref) - (elem (i32.const 0) $null $~lib/collector/itcm/__gc_mark $std/gc-object/Base~gc $std/gc-object/Custom~gc) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) - (global $~lib/collector/itcm/state (mut i32) (i32.const 0)) - (global $~lib/collector/itcm/white (mut i32) (i32.const 0)) - (global $~lib/collector/itcm/fromSpace (mut i32) (i32.const 0)) - (global $~lib/collector/itcm/toSpace (mut i32) (i32.const 0)) - (global $~lib/collector/itcm/iter (mut i32) (i32.const 0)) - (global $~lib/argc (mut i32) (i32.const 0)) - (global $std/gc-object/obj (mut i32) (i32.const 0)) - (global $~lib/started (mut i32) (i32.const 0)) - (export "memory" (memory $0)) - (export "table" (table $0)) - (export "main" (func $std/gc-object/main)) - (func $~lib/allocator/arena/__memory_allocate (; 0 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - local.get $0 - i32.const 1073741824 - i32.gt_u - if - unreachable - end - global.get $~lib/allocator/arena/offset - local.tee $1 - local.get $0 - i32.const 1 - local.get $0 - i32.const 1 - i32.gt_u - select - i32.add - i32.const 7 - i32.add - i32.const -8 - i32.and - local.tee $0 - current_memory - local.tee $2 - i32.const 16 - i32.shl - i32.gt_u - if - local.get $2 - local.get $0 - local.get $1 - i32.sub - i32.const 65535 - i32.add - i32.const -65536 - i32.and - i32.const 16 - i32.shr_u - local.tee $3 - local.get $2 - local.get $3 - i32.gt_s - select - grow_memory - i32.const 0 - i32.lt_s - if - local.get $3 - grow_memory - i32.const 0 - i32.lt_s - if - unreachable - end - end - end - local.get $0 - global.set $~lib/allocator/arena/offset - local.get $1 - ) - (func $~lib/collector/itcm/ManagedObjectList#push (; 1 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - (local $2 i32) - local.get $0 - i32.load offset=4 - local.set $2 - local.get $1 - local.get $1 - i32.load - i32.const 3 - i32.and - local.get $0 - i32.or - i32.store - local.get $1 - local.get $2 - i32.store offset=4 - local.get $2 - local.get $2 - i32.load - i32.const 3 - i32.and - local.get $1 - i32.or - i32.store - local.get $0 - local.get $1 - i32.store offset=4 - ) - (func $~lib/collector/itcm/ManagedObject#makeGray (; 2 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) - (local $2 i32) - global.get $~lib/collector/itcm/iter - local.get $0 - i32.eq - if - local.get $0 - i32.load offset=4 - global.set $~lib/collector/itcm/iter - end - local.get $0 - i32.load - i32.const -4 - i32.and - local.tee $2 - local.get $0 - i32.load offset=4 - local.tee $1 - i32.store offset=4 - local.get $1 - local.get $1 - i32.load - i32.const 3 - i32.and - local.get $2 - i32.or - i32.store - global.get $~lib/collector/itcm/toSpace - local.get $0 - call $~lib/collector/itcm/ManagedObjectList#push - local.get $0 - local.get $0 - i32.load - i32.const -4 - i32.and - i32.const 2 - i32.or - i32.store - ) - (func $~lib/collector/itcm/__gc_mark (; 3 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 - if - global.get $~lib/collector/itcm/white - local.get $0 - i32.const 16 - i32.sub - local.tee $0 - i32.load - i32.const 3 - i32.and - i32.eq - if - local.get $0 - call $~lib/collector/itcm/ManagedObject#makeGray - end - end - ) - (func $~lib/collector/itcm/step (; 4 ;) (type $FUNCSIG$v) - (local $0 i32) - block $break|0 - block $case3|0 - block $case2|0 - block $case1|0 - global.get $~lib/collector/itcm/state - local.tee $0 - if - local.get $0 - i32.const 1 - i32.sub - br_table $case1|0 $case2|0 $case3|0 $break|0 - end - i32.const 16 - call $~lib/allocator/arena/__memory_allocate - global.set $~lib/collector/itcm/fromSpace - global.get $~lib/collector/itcm/fromSpace - local.tee $0 - i32.const -1 - i32.store offset=8 - local.get $0 - local.get $0 - i32.store - local.get $0 - local.get $0 - i32.store offset=4 - i32.const 16 - call $~lib/allocator/arena/__memory_allocate - global.set $~lib/collector/itcm/toSpace - global.get $~lib/collector/itcm/toSpace - local.tee $0 - i32.const -1 - i32.store offset=8 - local.get $0 - local.get $0 - i32.store - local.get $0 - local.get $0 - i32.store offset=4 - global.get $~lib/collector/itcm/toSpace - global.set $~lib/collector/itcm/iter - i32.const 1 - global.set $~lib/collector/itcm/state - end - global.get $std/gc-object/obj - i32.const 1 - call_indirect (type $FUNCSIG$vi) - i32.const 2 - global.set $~lib/collector/itcm/state - br $break|0 - end - global.get $~lib/collector/itcm/iter - i32.load - i32.const -4 - i32.and - local.tee $0 - global.get $~lib/collector/itcm/toSpace - i32.ne - if - local.get $0 - global.set $~lib/collector/itcm/iter - local.get $0 - global.get $~lib/collector/itcm/white - i32.eqz - local.get $0 - i32.load - i32.const -4 - i32.and - i32.or - i32.store - i32.const 1 - global.set $~lib/argc - local.get $0 - i32.const 16 - i32.add - local.get $0 - i32.load offset=8 - call_indirect (type $FUNCSIG$vi) - else - global.get $std/gc-object/obj - i32.const 1 - call_indirect (type $FUNCSIG$vi) - global.get $~lib/collector/itcm/toSpace - global.get $~lib/collector/itcm/iter - i32.load - i32.const -4 - i32.and - i32.eq - if - global.get $~lib/collector/itcm/fromSpace - local.set $0 - global.get $~lib/collector/itcm/toSpace - global.set $~lib/collector/itcm/fromSpace - local.get $0 - global.set $~lib/collector/itcm/toSpace - global.get $~lib/collector/itcm/white - i32.eqz - global.set $~lib/collector/itcm/white - local.get $0 - i32.load - i32.const -4 - i32.and - global.set $~lib/collector/itcm/iter - i32.const 3 - global.set $~lib/collector/itcm/state - end - end - br $break|0 - end - global.get $~lib/collector/itcm/iter - local.tee $0 - global.get $~lib/collector/itcm/toSpace - i32.ne - if - local.get $0 - i32.load - i32.const -4 - i32.and - global.set $~lib/collector/itcm/iter - else - global.get $~lib/collector/itcm/toSpace - local.tee $0 - local.get $0 - i32.store - local.get $0 - local.get $0 - i32.store offset=4 - i32.const 1 - global.set $~lib/collector/itcm/state - end - end - ) - (func $~lib/collector/itcm/__gc_allocate (; 5 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 - i32.const 1073741808 - i32.gt_u - if - unreachable - end - call $~lib/collector/itcm/step - local.get $0 - i32.const 16 - i32.add - call $~lib/allocator/arena/__memory_allocate - local.tee $0 - local.get $1 - i32.store offset=8 - local.get $0 - global.get $~lib/collector/itcm/white - local.get $0 - i32.load - i32.const -4 - i32.and - i32.or - i32.store - global.get $~lib/collector/itcm/fromSpace - local.get $0 - call $~lib/collector/itcm/ManagedObjectList#push - local.get $0 - i32.const 16 - i32.add - ) - (func $std/gc-object/Base~gc (; 6 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 - i32.eqz - if - return - end - local.get $0 - call $~lib/collector/itcm/__gc_mark - ) - (func $std/gc-object/Custom~gc (; 7 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 - i32.eqz - if - return - end - local.get $0 - i32.const 2 - call_indirect (type $FUNCSIG$vi) - local.get $0 - i32.load - call $~lib/collector/itcm/__gc_mark - local.get $0 - i32.load offset=4 - call $~lib/collector/itcm/__gc_mark - ) - (func $std/gc-object/Custom#constructor (; 8 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) - i32.const 8 - i32.const 3 - call $~lib/collector/itcm/__gc_allocate - local.tee $0 - i32.eqz - if - i32.const 0 - i32.const 2 - call $~lib/collector/itcm/__gc_allocate - local.set $0 - end - local.get $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - ) - (func $~lib/collector/itcm/__gc_collect (; 9 ;) (type $FUNCSIG$v) - (local $0 i32) - block $break|0 - block $case1|0 - global.get $~lib/collector/itcm/state - local.tee $0 - i32.eqz - br_if $case1|0 - local.get $0 - i32.const 1 - i32.eq - br_if $case1|0 - br $break|0 - end - call $~lib/collector/itcm/step - end - loop $continue|1 - global.get $~lib/collector/itcm/state - i32.const 1 - i32.ne - if - call $~lib/collector/itcm/step - br $continue|1 - end - end - ) - (func $start:std/gc-object (; 10 ;) (type $FUNCSIG$v) - (local $0 i32) - i32.const 8 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - call $std/gc-object/Custom#constructor - global.set $std/gc-object/obj - call $~lib/collector/itcm/__gc_collect - global.get $std/gc-object/obj - local.tee $0 - local.get $0 - i32.store - call $~lib/collector/itcm/__gc_collect - i32.const 0 - global.set $std/gc-object/obj - call $~lib/collector/itcm/__gc_collect - ) - (func $std/gc-object/main (; 11 ;) (type $FUNCSIG$v) - global.get $~lib/started - i32.eqz - if - call $start:std/gc-object - i32.const 1 - global.set $~lib/started - end - ) - (func $null (; 12 ;) (type $FUNCSIG$v) - nop - ) -) diff --git a/tests/compiler/std/gc-object.ts b/tests/compiler/std/gc-object.ts deleted file mode 100644 index 9a96a6a1c7..0000000000 --- a/tests/compiler/std/gc-object.ts +++ /dev/null @@ -1,25 +0,0 @@ -import "allocator/arena"; -import "collector/itcm"; - -class Base { -} - -class Custom extends Base { - a: Custom; - b: Base; -} - -var obj: Custom | null = new Custom(); - -gc.collect(); - -obj.a = obj; - -gc.collect(); - -obj = null; - -gc.collect(); - -@start -export function main(): void {} diff --git a/tests/compiler/std/gc-object.untouched.wat b/tests/compiler/std/gc-object.untouched.wat deleted file mode 100644 index afb65dc886..0000000000 --- a/tests/compiler/std/gc-object.untouched.wat +++ /dev/null @@ -1,569 +0,0 @@ -(module - (type $FUNCSIG$v (func)) - (type $FUNCSIG$iii (func (param i32 i32) (result i32))) - (type $FUNCSIG$ii (func (param i32) (result i32))) - (type $FUNCSIG$vi (func (param i32))) - (type $FUNCSIG$vii (func (param i32 i32))) - (memory $0 0) - (table $0 4 funcref) - (elem (i32.const 0) $null $~lib/collector/itcm/__gc_mark $std/gc-object/Base~gc $std/gc-object/Custom~gc) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) - (global $~lib/collector/itcm/state (mut i32) (i32.const 0)) - (global $~lib/collector/itcm/white (mut i32) (i32.const 0)) - (global $~lib/collector/itcm/fromSpace (mut i32) (i32.const 0)) - (global $~lib/collector/itcm/toSpace (mut i32) (i32.const 0)) - (global $~lib/collector/itcm/iter (mut i32) (i32.const 0)) - (global $~lib/argc (mut i32) (i32.const 0)) - (global $std/gc-object/obj (mut i32) (i32.const 0)) - (global $~lib/started (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) - (export "memory" (memory $0)) - (export "table" (table $0)) - (export "main" (func $std/gc-object/main)) - (func $start:~lib/allocator/arena (; 0 ;) (type $FUNCSIG$v) - global.get $~lib/memory/HEAP_BASE - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - ) - (func $~lib/allocator/arena/__memory_allocate (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $0 - i32.const 1073741824 - i32.gt_u - if - unreachable - end - global.get $~lib/allocator/arena/offset - local.set $1 - local.get $1 - local.get $0 - local.tee $2 - i32.const 1 - local.tee $3 - local.get $2 - local.get $3 - i32.gt_u - select - i32.add - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - local.set $4 - current_memory - local.set $5 - local.get $4 - local.get $5 - i32.const 16 - i32.shl - i32.gt_u - if - local.get $4 - local.get $1 - i32.sub - i32.const 65535 - i32.add - i32.const 65535 - i32.const -1 - i32.xor - i32.and - i32.const 16 - i32.shr_u - local.set $2 - local.get $5 - local.tee $3 - local.get $2 - local.tee $6 - local.get $3 - local.get $6 - i32.gt_s - select - local.set $3 - local.get $3 - grow_memory - i32.const 0 - i32.lt_s - if - local.get $2 - grow_memory - i32.const 0 - i32.lt_s - if - unreachable - end - end - end - local.get $4 - global.set $~lib/allocator/arena/offset - local.get $1 - ) - (func $~lib/collector/itcm/ManagedObjectList#clear (; 2 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 - local.get $0 - i32.store - local.get $0 - local.get $0 - i32.store offset=4 - ) - (func $~lib/collector/itcm/ManagedObject#get:color (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.load - i32.const 3 - i32.and - ) - (func $~lib/collector/itcm/ManagedObject#get:next (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - ) - (func $~lib/collector/itcm/ManagedObject#set:next (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - local.get $0 - i32.load - i32.const 3 - i32.and - i32.or - i32.store - ) - (func $~lib/collector/itcm/ManagedObject#unlink (; 6 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) - (local $2 i32) - local.get $0 - call $~lib/collector/itcm/ManagedObject#get:next - local.set $1 - local.get $0 - i32.load offset=4 - local.set $2 - local.get $1 - local.get $2 - i32.store offset=4 - local.get $2 - local.get $1 - call $~lib/collector/itcm/ManagedObject#set:next - ) - (func $~lib/collector/itcm/ManagedObjectList#push (; 7 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - (local $2 i32) - local.get $0 - i32.load offset=4 - local.set $2 - local.get $1 - local.get $0 - call $~lib/collector/itcm/ManagedObject#set:next - local.get $1 - local.get $2 - i32.store offset=4 - local.get $2 - local.get $1 - call $~lib/collector/itcm/ManagedObject#set:next - local.get $0 - local.get $1 - i32.store offset=4 - ) - (func $~lib/collector/itcm/ManagedObject#makeGray (; 8 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 - global.get $~lib/collector/itcm/iter - i32.eq - if - local.get $0 - i32.load offset=4 - global.set $~lib/collector/itcm/iter - end - local.get $0 - call $~lib/collector/itcm/ManagedObject#unlink - global.get $~lib/collector/itcm/toSpace - local.get $0 - call $~lib/collector/itcm/ManagedObjectList#push - local.get $0 - local.get $0 - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.const 2 - i32.or - i32.store - ) - (func $~lib/collector/itcm/__gc_mark (; 9 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) - local.get $0 - if - block $~lib/collector/itcm/refToObj|inlined.0 (result i32) - local.get $0 - local.set $1 - local.get $1 - i32.const 16 - i32.sub - end - local.set $1 - local.get $1 - call $~lib/collector/itcm/ManagedObject#get:color - global.get $~lib/collector/itcm/white - i32.eq - if - local.get $1 - call $~lib/collector/itcm/ManagedObject#makeGray - end - end - ) - (func $~lib/collector/itcm/ManagedObject#set:color (; 10 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - local.get $0 - local.get $0 - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - local.get $1 - i32.or - i32.store - ) - (func $~lib/allocator/arena/__memory_free (; 11 ;) (type $FUNCSIG$vi) (param $0 i32) - nop - ) - (func $~lib/collector/itcm/step (; 12 ;) (type $FUNCSIG$v) - (local $0 i32) - (local $1 i32) - block $break|0 - block $case3|0 - block $case2|0 - block $case1|0 - block $case0|0 - global.get $~lib/collector/itcm/state - local.set $1 - local.get $1 - i32.const 0 - i32.eq - br_if $case0|0 - local.get $1 - i32.const 1 - i32.eq - br_if $case1|0 - local.get $1 - i32.const 2 - i32.eq - br_if $case2|0 - local.get $1 - i32.const 3 - i32.eq - br_if $case3|0 - br $break|0 - end - block - block $~lib/memory/memory.allocate|inlined.0 (result i32) - i32.const 16 - local.set $1 - local.get $1 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.0 - end - global.set $~lib/collector/itcm/fromSpace - global.get $~lib/collector/itcm/fromSpace - i32.const -1 - i32.store offset=8 - global.get $~lib/collector/itcm/fromSpace - call $~lib/collector/itcm/ManagedObjectList#clear - block $~lib/memory/memory.allocate|inlined.1 (result i32) - i32.const 16 - local.set $1 - local.get $1 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.1 - end - global.set $~lib/collector/itcm/toSpace - global.get $~lib/collector/itcm/toSpace - i32.const -1 - i32.store offset=8 - global.get $~lib/collector/itcm/toSpace - call $~lib/collector/itcm/ManagedObjectList#clear - global.get $~lib/collector/itcm/toSpace - global.set $~lib/collector/itcm/iter - i32.const 1 - global.set $~lib/collector/itcm/state - end - end - block - i32.const 1 - call $~iterateRoots - i32.const 2 - global.set $~lib/collector/itcm/state - br $break|0 - unreachable - end - unreachable - end - block - global.get $~lib/collector/itcm/iter - call $~lib/collector/itcm/ManagedObject#get:next - local.set $0 - local.get $0 - global.get $~lib/collector/itcm/toSpace - i32.ne - if - local.get $0 - global.set $~lib/collector/itcm/iter - local.get $0 - global.get $~lib/collector/itcm/white - i32.eqz - call $~lib/collector/itcm/ManagedObject#set:color - i32.const 1 - global.set $~lib/argc - block $~lib/collector/itcm/objToRef|inlined.0 (result i32) - local.get $0 - local.set $1 - local.get $1 - i32.const 16 - i32.add - end - local.get $0 - i32.load offset=8 - call_indirect (type $FUNCSIG$vi) - else - i32.const 1 - call $~iterateRoots - global.get $~lib/collector/itcm/iter - call $~lib/collector/itcm/ManagedObject#get:next - local.set $0 - local.get $0 - global.get $~lib/collector/itcm/toSpace - i32.eq - if - global.get $~lib/collector/itcm/fromSpace - local.set $1 - global.get $~lib/collector/itcm/toSpace - global.set $~lib/collector/itcm/fromSpace - local.get $1 - global.set $~lib/collector/itcm/toSpace - global.get $~lib/collector/itcm/white - i32.eqz - global.set $~lib/collector/itcm/white - local.get $1 - call $~lib/collector/itcm/ManagedObject#get:next - global.set $~lib/collector/itcm/iter - i32.const 3 - global.set $~lib/collector/itcm/state - end - end - br $break|0 - unreachable - end - unreachable - end - block - global.get $~lib/collector/itcm/iter - local.set $0 - local.get $0 - global.get $~lib/collector/itcm/toSpace - i32.ne - if - local.get $0 - call $~lib/collector/itcm/ManagedObject#get:next - global.set $~lib/collector/itcm/iter - local.get $0 - global.get $~lib/memory/HEAP_BASE - i32.ge_u - if - block $~lib/memory/memory.free|inlined.0 - local.get $0 - local.set $1 - local.get $1 - call $~lib/allocator/arena/__memory_free - br $~lib/memory/memory.free|inlined.0 - end - end - else - global.get $~lib/collector/itcm/toSpace - call $~lib/collector/itcm/ManagedObjectList#clear - i32.const 1 - global.set $~lib/collector/itcm/state - end - br $break|0 - unreachable - end - unreachable - end - ) - (func $~lib/collector/itcm/__gc_allocate (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - local.get $0 - i32.const 1073741824 - i32.const 16 - i32.sub - i32.gt_u - if - unreachable - end - call $~lib/collector/itcm/step - block $~lib/memory/memory.allocate|inlined.2 (result i32) - i32.const 16 - local.get $0 - i32.add - local.set $2 - local.get $2 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.2 - end - local.set $3 - local.get $3 - local.get $1 - i32.store offset=8 - local.get $3 - global.get $~lib/collector/itcm/white - call $~lib/collector/itcm/ManagedObject#set:color - global.get $~lib/collector/itcm/fromSpace - local.get $3 - call $~lib/collector/itcm/ManagedObjectList#push - block $~lib/collector/itcm/objToRef|inlined.1 (result i32) - local.get $3 - local.set $2 - local.get $2 - i32.const 16 - i32.add - end - ) - (func $std/gc-object/Base~gc (; 14 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 - i32.eqz - if - return - end - local.get $0 - call $~lib/collector/itcm/__gc_mark - ) - (func $std/gc-object/Base#constructor (; 15 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.eqz - if - i32.const 0 - i32.const 2 - call $~lib/collector/itcm/__gc_allocate - local.set $0 - end - local.get $0 - ) - (func $std/gc-object/Custom~gc (; 16 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 - i32.eqz - if - return - end - local.get $0 - i32.const 2 - call_indirect (type $FUNCSIG$vi) - local.get $0 - i32.load - call $~lib/collector/itcm/__gc_mark - local.get $0 - i32.load offset=4 - call $~lib/collector/itcm/__gc_mark - ) - (func $std/gc-object/Custom#constructor (; 17 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.eqz - if - i32.const 8 - i32.const 3 - call $~lib/collector/itcm/__gc_allocate - local.set $0 - end - local.get $0 - call $std/gc-object/Base#constructor - local.set $0 - local.get $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - ) - (func $~lib/collector/itcm/__gc_collect (; 18 ;) (type $FUNCSIG$v) - (local $0 i32) - block $break|0 - block $case1|0 - block $case0|0 - global.get $~lib/collector/itcm/state - local.set $0 - local.get $0 - i32.const 0 - i32.eq - br_if $case0|0 - local.get $0 - i32.const 1 - i32.eq - br_if $case1|0 - br $break|0 - end - end - call $~lib/collector/itcm/step - end - block $break|1 - loop $continue|1 - global.get $~lib/collector/itcm/state - i32.const 1 - i32.ne - if - call $~lib/collector/itcm/step - br $continue|1 - end - end - end - ) - (func $~lib/gc/gc.collect (; 19 ;) (type $FUNCSIG$v) - call $~lib/collector/itcm/__gc_collect - return - ) - (func $start:std/gc-object (; 20 ;) (type $FUNCSIG$v) - call $start:~lib/allocator/arena - i32.const 0 - call $std/gc-object/Custom#constructor - global.set $std/gc-object/obj - call $~lib/gc/gc.collect - global.get $std/gc-object/obj - global.get $std/gc-object/obj - i32.store - call $~lib/gc/gc.collect - i32.const 0 - global.set $std/gc-object/obj - call $~lib/gc/gc.collect - ) - (func $std/gc-object/main (; 21 ;) (type $FUNCSIG$v) - global.get $~lib/started - i32.eqz - if - call $start - i32.const 1 - global.set $~lib/started - end - ) - (func $start (; 22 ;) (type $FUNCSIG$v) - call $start:std/gc-object - ) - (func $null (; 23 ;) (type $FUNCSIG$v) - ) - (func $~iterateRoots (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) - global.get $std/gc-object/obj - local.get $0 - call_indirect (type $FUNCSIG$vi) - ) -) diff --git a/tests/compiler/std/hash.json b/tests/compiler/std/hash.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/std/hash.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/std/hash.optimized.wat b/tests/compiler/std/hash.optimized.wat index 9e769d4232..61c4825bc7 100644 --- a/tests/compiler/std/hash.optimized.wat +++ b/tests/compiler/std/hash.optimized.wat @@ -3,50 +3,57 @@ (type $FUNCSIG$ij (func (param i64) (result i32))) (type $FUNCSIG$v (func)) (memory $0 1) - (data (i32.const 16) "\01\00\00\00a") - (data (i32.const 24) "\02\00\00\00a\00b") - (data (i32.const 32) "\03\00\00\00a\00b\00c") - (table $0 1 funcref) - (elem (i32.const 0) $null) + (data (i32.const 12) "\01\00\00\00\01") + (data (i32.const 24) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00a") + (data (i32.const 48) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00a\00b") + (data (i32.const 72) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00a\00b\00c") (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) - (func $~lib/internal/hash/hashStr (; 0 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/hashStr (; 0 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) i32.const -2128831035 - local.set $2 + local.set $1 local.get $0 - i32.load - i32.const 1 - i32.shl - local.set $3 - loop $repeat|0 + if block $break|0 - local.get $1 - local.get $3 - i32.ge_u - br_if $break|0 local.get $0 - local.get $1 - i32.add - i32.load8_u offset=4 - local.get $2 - i32.xor - i32.const 16777619 - i32.mul - local.set $2 - local.get $1 + i32.const 16 + i32.sub + i32.load offset=12 i32.const 1 - i32.add - local.set $1 - br $repeat|0 + i32.shr_u + i32.const 1 + i32.shl + local.set $3 + loop $repeat|0 + local.get $2 + local.get $3 + i32.ge_u + br_if $break|0 + local.get $0 + local.get $2 + i32.add + i32.load8_u + local.get $1 + i32.xor + i32.const 16777619 + i32.mul + local.set $1 + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $repeat|0 + unreachable + end + unreachable end end - local.get $2 + local.get $1 ) - (func $~lib/internal/hash/hash32 (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/hash32 (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 255 i32.and @@ -77,7 +84,7 @@ i32.const 16777619 i32.mul ) - (func $~lib/internal/hash/hash64 (; 2 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/hash/hash64 (; 2 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) local.get $0 i32.wrap_i64 @@ -145,55 +152,55 @@ ) (func $start:std/hash (; 3 ;) (type $FUNCSIG$v) i32.const 0 - call $~lib/internal/hash/hashStr + call $~lib/util/hash/hashStr drop - i32.const 8 - call $~lib/internal/hash/hashStr + i32.const 24 + call $~lib/util/hash/hashStr drop - i32.const 16 - call $~lib/internal/hash/hashStr + i32.const 40 + call $~lib/util/hash/hashStr drop - i32.const 24 - call $~lib/internal/hash/hashStr + i32.const 64 + call $~lib/util/hash/hashStr drop - i32.const 32 - call $~lib/internal/hash/hashStr + i32.const 88 + call $~lib/util/hash/hashStr drop i32.const 0 - call $~lib/internal/hash/hash32 + call $~lib/util/hash/hash32 drop i32.const 1065353216 - call $~lib/internal/hash/hash32 + call $~lib/util/hash/hash32 drop i32.const 1066192077 - call $~lib/internal/hash/hash32 + call $~lib/util/hash/hash32 drop i32.const 0 - call $~lib/internal/hash/hash32 + call $~lib/util/hash/hash32 drop i32.const 2139095040 - call $~lib/internal/hash/hash32 + call $~lib/util/hash/hash32 drop i32.const 2143289344 - call $~lib/internal/hash/hash32 + call $~lib/util/hash/hash32 drop i64.const 0 - call $~lib/internal/hash/hash64 + call $~lib/util/hash/hash64 drop i64.const 4607182418800017408 - call $~lib/internal/hash/hash64 + call $~lib/util/hash/hash64 drop i64.const 4607632778762754458 - call $~lib/internal/hash/hash64 + call $~lib/util/hash/hash64 drop i64.const 0 - call $~lib/internal/hash/hash64 + call $~lib/util/hash/hash64 drop i64.const 9218868437227405312 - call $~lib/internal/hash/hash64 + call $~lib/util/hash/hash64 drop i64.const 9221120237041090560 - call $~lib/internal/hash/hash64 + call $~lib/util/hash/hash64 drop ) (func $start (; 4 ;) (type $FUNCSIG$v) diff --git a/tests/compiler/std/hash.ts b/tests/compiler/std/hash.ts index 731ab6d4c0..d700db6de8 100644 --- a/tests/compiler/std/hash.ts +++ b/tests/compiler/std/hash.ts @@ -1,4 +1,4 @@ -import { HASH } from "internal/hash"; +import { HASH } from "util/hash"; function check(hash: u32): bool { return true; diff --git a/tests/compiler/std/hash.untouched.wat b/tests/compiler/std/hash.untouched.wat index 777e8f631a..19f8e80786 100644 --- a/tests/compiler/std/hash.untouched.wat +++ b/tests/compiler/std/hash.untouched.wat @@ -1,64 +1,89 @@ (module (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$ij (func (param i64) (result i32))) (type $FUNCSIG$v (func)) (memory $0 1) - (data (i32.const 8) "\00\00\00\00") - (data (i32.const 16) "\01\00\00\00a\00") - (data (i32.const 24) "\02\00\00\00a\00b\00") - (data (i32.const 32) "\03\00\00\00a\00b\00c\00") + (data (i32.const 8) "\00\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00") + (data (i32.const 24) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00a\00") + (data (i32.const 48) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00a\00b\00") + (data (i32.const 72) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00a\00b\00c\00") (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/memory/HEAP_BASE i32 (i32.const 44)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) - (func $~lib/internal/hash/hashStr (; 0 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/rt/stub/__retain (; 0 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + ) + (func $~lib/string/String#get:length (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u + ) + (func $~lib/rt/stub/__release (; 2 ;) (type $FUNCSIG$vi) (param $0 i32) + nop + ) + (func $~lib/util/hash/hashStr (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop i32.const -2128831035 local.set $1 - block $break|0 - block - i32.const 0 - local.set $2 - local.get $0 - i32.load - i32.const 1 - i32.shl - local.set $3 - end - loop $repeat|0 - local.get $2 - local.get $3 - i32.lt_u - i32.eqz - br_if $break|0 - local.get $1 - local.get $0 - local.get $2 - i32.add - i32.load8_u offset=4 - i32.xor - i32.const 16777619 - i32.mul - local.set $1 - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $repeat|0 + local.get $0 + i32.const 0 + i32.ne + if + block $break|0 + block + i32.const 0 + local.set $2 + local.get $0 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.set $3 + end + loop $repeat|0 + local.get $2 + local.get $3 + i32.lt_u + i32.eqz + br_if $break|0 + local.get $1 + local.get $0 + local.get $2 + i32.add + i32.load8_u + i32.xor + i32.const 16777619 + i32.mul + local.set $1 + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $repeat|0 + unreachable + end unreachable end - unreachable end local.get $1 + local.set $3 + local.get $0 + call $~lib/rt/stub/__release + local.get $3 ) - (func $std/hash/check (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $std/hash/check (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 ) - (func $~lib/internal/hash/hash32 (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/hash32 (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const -2128831035 local.set $1 @@ -100,7 +125,7 @@ local.set $1 local.get $1 ) - (func $~lib/internal/hash/hash64 (; 3 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/hash/hash64 (; 6 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -188,179 +213,205 @@ local.set $3 local.get $3 ) - (func $start:std/hash (; 4 ;) (type $FUNCSIG$v) + (func $start:std/hash (; 7 ;) (type $FUNCSIG$v) (local $0 i32) - (local $1 f32) - (local $2 f64) - block $~lib/internal/hash/HASH<~lib/string/String>|inlined.0 (result i32) + (local $1 i32) + (local $2 f32) + (local $3 f64) + block $~lib/util/hash/HASH<~lib/string/String>|inlined.0 (result i32) i32.const 0 + call $~lib/rt/stub/__retain local.set $0 local.get $0 - call $~lib/internal/hash/hashStr - br $~lib/internal/hash/HASH<~lib/string/String>|inlined.0 + call $~lib/util/hash/hashStr + local.set $1 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + br $~lib/util/hash/HASH<~lib/string/String>|inlined.0 end call $std/hash/check drop - block $~lib/internal/hash/HASH<~lib/string/String>|inlined.1 (result i32) - i32.const 8 + block $~lib/util/hash/HASH<~lib/string/String>|inlined.1 (result i32) + i32.const 24 + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + call $~lib/util/hash/hashStr local.set $0 + local.get $1 + call $~lib/rt/stub/__release local.get $0 - call $~lib/internal/hash/hashStr - br $~lib/internal/hash/HASH<~lib/string/String>|inlined.1 + br $~lib/util/hash/HASH<~lib/string/String>|inlined.1 end call $std/hash/check drop - block $~lib/internal/hash/HASH<~lib/string/String>|inlined.2 (result i32) - i32.const 16 + block $~lib/util/hash/HASH<~lib/string/String>|inlined.2 (result i32) + i32.const 40 + call $~lib/rt/stub/__retain local.set $0 local.get $0 - call $~lib/internal/hash/hashStr - br $~lib/internal/hash/HASH<~lib/string/String>|inlined.2 + call $~lib/util/hash/hashStr + local.set $1 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + br $~lib/util/hash/HASH<~lib/string/String>|inlined.2 end call $std/hash/check drop - block $~lib/internal/hash/HASH<~lib/string/String>|inlined.3 (result i32) - i32.const 24 + block $~lib/util/hash/HASH<~lib/string/String>|inlined.3 (result i32) + i32.const 64 + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + call $~lib/util/hash/hashStr local.set $0 + local.get $1 + call $~lib/rt/stub/__release local.get $0 - call $~lib/internal/hash/hashStr - br $~lib/internal/hash/HASH<~lib/string/String>|inlined.3 + br $~lib/util/hash/HASH<~lib/string/String>|inlined.3 end call $std/hash/check drop - block $~lib/internal/hash/HASH<~lib/string/String>|inlined.4 (result i32) - i32.const 32 + block $~lib/util/hash/HASH<~lib/string/String>|inlined.4 (result i32) + i32.const 88 + call $~lib/rt/stub/__retain local.set $0 local.get $0 - call $~lib/internal/hash/hashStr - br $~lib/internal/hash/HASH<~lib/string/String>|inlined.4 + call $~lib/util/hash/hashStr + local.set $1 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + br $~lib/util/hash/HASH<~lib/string/String>|inlined.4 end call $std/hash/check drop - block $~lib/internal/hash/HASH|inlined.0 (result i32) + block $~lib/util/hash/HASH|inlined.0 (result i32) f32.const 0 - local.set $1 - local.get $1 + local.set $2 + local.get $2 i32.reinterpret_f32 - call $~lib/internal/hash/hash32 - br $~lib/internal/hash/HASH|inlined.0 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.0 end call $std/hash/check drop - block $~lib/internal/hash/HASH|inlined.1 (result i32) + block $~lib/util/hash/HASH|inlined.1 (result i32) f32.const 1 - local.set $1 - local.get $1 + local.set $2 + local.get $2 i32.reinterpret_f32 - call $~lib/internal/hash/hash32 - br $~lib/internal/hash/HASH|inlined.1 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.1 end call $std/hash/check drop - block $~lib/internal/hash/HASH|inlined.2 (result i32) + block $~lib/util/hash/HASH|inlined.2 (result i32) f32.const 1.100000023841858 - local.set $1 - local.get $1 + local.set $2 + local.get $2 i32.reinterpret_f32 - call $~lib/internal/hash/hash32 - br $~lib/internal/hash/HASH|inlined.2 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.2 end call $std/hash/check drop - block $~lib/internal/hash/HASH|inlined.3 (result i32) + block $~lib/util/hash/HASH|inlined.3 (result i32) f32.const 0 - local.set $1 - local.get $1 + local.set $2 + local.get $2 i32.reinterpret_f32 - call $~lib/internal/hash/hash32 - br $~lib/internal/hash/HASH|inlined.3 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.3 end call $std/hash/check drop - block $~lib/internal/hash/HASH|inlined.4 (result i32) + block $~lib/util/hash/HASH|inlined.4 (result i32) f32.const inf - local.set $1 - local.get $1 + local.set $2 + local.get $2 i32.reinterpret_f32 - call $~lib/internal/hash/hash32 - br $~lib/internal/hash/HASH|inlined.4 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.4 end call $std/hash/check drop - block $~lib/internal/hash/HASH|inlined.5 (result i32) + block $~lib/util/hash/HASH|inlined.5 (result i32) f32.const nan:0x400000 - local.set $1 - local.get $1 + local.set $2 + local.get $2 i32.reinterpret_f32 - call $~lib/internal/hash/hash32 - br $~lib/internal/hash/HASH|inlined.5 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.5 end call $std/hash/check drop - block $~lib/internal/hash/HASH|inlined.0 (result i32) + block $~lib/util/hash/HASH|inlined.0 (result i32) f64.const 0 - local.set $2 - local.get $2 + local.set $3 + local.get $3 i64.reinterpret_f64 - call $~lib/internal/hash/hash64 - br $~lib/internal/hash/HASH|inlined.0 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.0 end call $std/hash/check drop - block $~lib/internal/hash/HASH|inlined.1 (result i32) + block $~lib/util/hash/HASH|inlined.1 (result i32) f64.const 1 - local.set $2 - local.get $2 + local.set $3 + local.get $3 i64.reinterpret_f64 - call $~lib/internal/hash/hash64 - br $~lib/internal/hash/HASH|inlined.1 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.1 end call $std/hash/check drop - block $~lib/internal/hash/HASH|inlined.2 (result i32) + block $~lib/util/hash/HASH|inlined.2 (result i32) f64.const 1.1 - local.set $2 - local.get $2 + local.set $3 + local.get $3 i64.reinterpret_f64 - call $~lib/internal/hash/hash64 - br $~lib/internal/hash/HASH|inlined.2 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.2 end call $std/hash/check drop - block $~lib/internal/hash/HASH|inlined.3 (result i32) + block $~lib/util/hash/HASH|inlined.3 (result i32) f64.const 0 - local.set $2 - local.get $2 + local.set $3 + local.get $3 i64.reinterpret_f64 - call $~lib/internal/hash/hash64 - br $~lib/internal/hash/HASH|inlined.3 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.3 end call $std/hash/check drop - block $~lib/internal/hash/HASH|inlined.4 (result i32) + block $~lib/util/hash/HASH|inlined.4 (result i32) f64.const inf - local.set $2 - local.get $2 + local.set $3 + local.get $3 i64.reinterpret_f64 - call $~lib/internal/hash/hash64 - br $~lib/internal/hash/HASH|inlined.4 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.4 end call $std/hash/check drop - block $~lib/internal/hash/HASH|inlined.5 (result i32) + block $~lib/util/hash/HASH|inlined.5 (result i32) f64.const nan:0x8000000000000 - local.set $2 - local.get $2 + local.set $3 + local.get $3 i64.reinterpret_f64 - call $~lib/internal/hash/hash64 - br $~lib/internal/hash/HASH|inlined.5 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.5 end call $std/hash/check drop ) - (func $start (; 5 ;) (type $FUNCSIG$v) + (func $start (; 8 ;) (type $FUNCSIG$v) call $start:std/hash ) - (func $null (; 6 ;) (type $FUNCSIG$v) + (func $null (; 9 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/std/libm.json b/tests/compiler/std/libm.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/std/libm.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/std/libm.optimized.wat b/tests/compiler/std/libm.optimized.wat index f9c83f5c55..70ca683d08 100644 --- a/tests/compiler/std/libm.optimized.wat +++ b/tests/compiler/std/libm.optimized.wat @@ -1,69 +1,127 @@ (module (type $FUNCSIG$dd (func (param f64) (result f64))) + (type $FUNCSIG$id (func (param f64) (result i32))) (type $FUNCSIG$ddd (func (param f64 f64) (result f64))) (type $FUNCSIG$ddi (func (param f64 i32) (result f64))) - (type $FUNCSIG$fd (func (param f64) (result f32))) + (type $FUNCSIG$ff (func (param f32) (result f32))) + (type $FUNCSIG$if (func (param f32) (result i32))) + (type $FUNCSIG$fff (func (param f32 f32) (result f32))) + (type $FUNCSIG$ffi (func (param f32 i32) (result f32))) (type $FUNCSIG$v (func)) - (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $std/libm/E f64 (f64.const 2.718281828459045)) - (global $std/libm/LN10 f64 (f64.const 2.302585092994046)) - (global $std/libm/LN2 f64 (f64.const 0.6931471805599453)) - (global $std/libm/LOG10E f64 (f64.const 0.4342944819032518)) - (global $std/libm/LOG2E f64 (f64.const 1.4426950408889634)) - (global $std/libm/PI f64 (f64.const 3.141592653589793)) - (global $std/libm/SQRT1_2 f64 (f64.const 0.7071067811865476)) - (global $std/libm/SQRT2 f64 (f64.const 1.4142135623730951)) + (type $FUNCSIG$ji (func (param i32) (result i64))) + (import "Math" "cos" (func $~lib/bindings/Math/cos (param f64) (result f64))) + (import "Math" "sin" (func $~lib/bindings/Math/sin (param f64) (result f64))) + (import "Math" "tan" (func $~lib/bindings/Math/tan (param f64) (result f64))) + (memory $0 1) + (data (i32.const 8) " \00\00\00\01\00\00\00\00\00\00\00 \00\00\00)\15DNn\83\f9\a2\c0\dd4\f5\d1W\'\fcA\90C<\99\95b\dba\c5\bb\de\abcQ\fe") + (data (i32.const 56) "\10\00\00\00\01\00\00\00\03\00\00\00\10\00\00\00\18\00\00\00\18\00\00\00 \00\00\00\04") + (global $../../lib/libm/assembly/libm/E f64 (f64.const 2.718281828459045)) + (global $../../lib/libm/assembly/libm/LN10 f64 (f64.const 2.302585092994046)) + (global $../../lib/libm/assembly/libm/LN2 f64 (f64.const 0.6931471805599453)) + (global $../../lib/libm/assembly/libm/LOG10E f64 (f64.const 0.4342944819032518)) + (global $../../lib/libm/assembly/libm/LOG2E f64 (f64.const 1.4426950408889634)) + (global $../../lib/libm/assembly/libm/PI f64 (f64.const 3.141592653589793)) + (global $../../lib/libm/assembly/libm/SQRT1_2 f64 (f64.const 0.7071067811865476)) + (global $../../lib/libm/assembly/libm/SQRT2 f64 (f64.const 1.4142135623730951)) + (global $../../lib/libm/assembly/libmf/E f32 (f32.const 2.7182817459106445)) + (global $../../lib/libm/assembly/libmf/LN10 f32 (f32.const 2.3025851249694824)) + (global $../../lib/libm/assembly/libmf/LN2 f32 (f32.const 0.6931471824645996)) + (global $../../lib/libm/assembly/libmf/LOG10E f32 (f32.const 0.4342944920063019)) + (global $../../lib/libm/assembly/libmf/LOG2E f32 (f32.const 1.4426950216293335)) + (global $../../lib/libm/assembly/libmf/PI f32 (f32.const 3.1415927410125732)) + (global $../../lib/libm/assembly/libmf/SQRT1_2 f32 (f32.const 0.7071067690849304)) + (global $../../lib/libm/assembly/libmf/SQRT2 f32 (f32.const 1.4142135381698608)) + (global $~lib/math/rempio2f_y (mut f64) (f64.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) - (export "E" (global $std/libm/E)) - (export "LN10" (global $std/libm/LN10)) - (export "LN2" (global $std/libm/LN2)) - (export "LOG10E" (global $std/libm/LOG10E)) - (export "LOG2E" (global $std/libm/LOG2E)) - (export "PI" (global $std/libm/PI)) - (export "SQRT1_2" (global $std/libm/SQRT1_2)) - (export "SQRT2" (global $std/libm/SQRT2)) - (export "abs" (func $std/libm/abs)) - (export "acos" (func $std/libm/acos)) - (export "acosh" (func $std/libm/acosh)) - (export "asin" (func $std/libm/asin)) - (export "asinh" (func $std/libm/asinh)) - (export "atan" (func $std/libm/atan)) - (export "atanh" (func $std/libm/atanh)) - (export "atan2" (func $std/libm/atan2)) - (export "cbrt" (func $std/libm/cbrt)) - (export "ceil" (func $std/libm/ceil)) - (export "clz32" (func $std/libm/clz32)) - (export "cos" (func $std/libm/cos)) - (export "cosh" (func $std/libm/cosh)) - (export "exp" (func $std/libm/exp)) - (export "expm1" (func $std/libm/expm1)) - (export "floor" (func $std/libm/floor)) - (export "fround" (func $std/libm/fround)) - (export "hypot" (func $std/libm/hypot)) - (export "imul" (func $std/libm/imul)) - (export "log" (func $std/libm/log)) - (export "log10" (func $std/libm/log10)) - (export "log1p" (func $std/libm/log1p)) - (export "log2" (func $std/libm/log2)) - (export "max" (func $std/libm/max)) - (export "min" (func $std/libm/min)) - (export "pow" (func $std/libm/pow)) - (export "round" (func $std/libm/round)) - (export "sign" (func $std/libm/sign)) - (export "sin" (func $std/libm/cos)) - (export "sinh" (func $std/libm/sinh)) - (export "sqrt" (func $std/libm/sqrt)) - (export "tan" (func $std/libm/cos)) - (export "tanh" (func $std/libm/tanh)) - (export "trunc" (func $std/libm/trunc)) - (func $std/libm/abs (; 0 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (export "libm.E" (global $../../lib/libm/assembly/libm/E)) + (export "libm.LN10" (global $../../lib/libm/assembly/libm/LN10)) + (export "libm.LN2" (global $../../lib/libm/assembly/libm/LN2)) + (export "libm.LOG10E" (global $../../lib/libm/assembly/libm/LOG10E)) + (export "libm.LOG2E" (global $../../lib/libm/assembly/libm/LOG2E)) + (export "libm.PI" (global $../../lib/libm/assembly/libm/PI)) + (export "libm.SQRT1_2" (global $../../lib/libm/assembly/libm/SQRT1_2)) + (export "libm.SQRT2" (global $../../lib/libm/assembly/libm/SQRT2)) + (export "libm.abs" (func $../../lib/libm/assembly/libm/abs)) + (export "libm.acos" (func $../../lib/libm/assembly/libm/acos)) + (export "libm.acosh" (func $../../lib/libm/assembly/libm/acosh)) + (export "libm.asin" (func $../../lib/libm/assembly/libm/asin)) + (export "libm.asinh" (func $../../lib/libm/assembly/libm/asinh)) + (export "libm.atan" (func $../../lib/libm/assembly/libm/atan)) + (export "libm.atanh" (func $../../lib/libm/assembly/libm/atanh)) + (export "libm.atan2" (func $../../lib/libm/assembly/libm/atan2)) + (export "libm.cbrt" (func $../../lib/libm/assembly/libm/cbrt)) + (export "libm.ceil" (func $../../lib/libm/assembly/libm/ceil)) + (export "libm.clz32" (func $../../lib/libm/assembly/libm/clz32)) + (export "libm.cos" (func $../../lib/libm/assembly/libm/cos)) + (export "libm.cosh" (func $../../lib/libm/assembly/libm/cosh)) + (export "libm.exp" (func $../../lib/libm/assembly/libm/exp)) + (export "libm.expm1" (func $../../lib/libm/assembly/libm/expm1)) + (export "libm.floor" (func $../../lib/libm/assembly/libm/floor)) + (export "libm.fround" (func $../../lib/libm/assembly/libm/fround)) + (export "libm.hypot" (func $../../lib/libm/assembly/libm/hypot)) + (export "libm.imul" (func $../../lib/libm/assembly/libm/imul)) + (export "libm.log" (func $../../lib/libm/assembly/libm/log)) + (export "libm.log10" (func $../../lib/libm/assembly/libm/log10)) + (export "libm.log1p" (func $../../lib/libm/assembly/libm/log1p)) + (export "libm.log2" (func $../../lib/libm/assembly/libm/log2)) + (export "libm.max" (func $../../lib/libm/assembly/libm/max)) + (export "libm.min" (func $../../lib/libm/assembly/libm/min)) + (export "libm.pow" (func $../../lib/libm/assembly/libm/pow)) + (export "libm.round" (func $../../lib/libm/assembly/libm/round)) + (export "libm.sign" (func $../../lib/libm/assembly/libm/sign)) + (export "libm.sin" (func $../../lib/libm/assembly/libm/sin)) + (export "libm.sinh" (func $../../lib/libm/assembly/libm/sinh)) + (export "libm.sqrt" (func $../../lib/libm/assembly/libm/sqrt)) + (export "libm.tan" (func $../../lib/libm/assembly/libm/tan)) + (export "libm.tanh" (func $../../lib/libm/assembly/libm/tanh)) + (export "libm.trunc" (func $../../lib/libm/assembly/libm/trunc)) + (export "libmf.E" (global $../../lib/libm/assembly/libmf/E)) + (export "libmf.LN10" (global $../../lib/libm/assembly/libmf/LN10)) + (export "libmf.LN2" (global $../../lib/libm/assembly/libmf/LN2)) + (export "libmf.LOG10E" (global $../../lib/libm/assembly/libmf/LOG10E)) + (export "libmf.LOG2E" (global $../../lib/libm/assembly/libmf/LOG2E)) + (export "libmf.PI" (global $../../lib/libm/assembly/libmf/PI)) + (export "libmf.SQRT1_2" (global $../../lib/libm/assembly/libmf/SQRT1_2)) + (export "libmf.SQRT2" (global $../../lib/libm/assembly/libmf/SQRT2)) + (export "libmf.abs" (func $../../lib/libm/assembly/libmf/abs)) + (export "libmf.acos" (func $../../lib/libm/assembly/libmf/acos)) + (export "libmf.acosh" (func $../../lib/libm/assembly/libmf/acosh)) + (export "libmf.asin" (func $../../lib/libm/assembly/libmf/asin)) + (export "libmf.asinh" (func $../../lib/libm/assembly/libmf/asinh)) + (export "libmf.atan" (func $../../lib/libm/assembly/libmf/atan)) + (export "libmf.atanh" (func $../../lib/libm/assembly/libmf/atanh)) + (export "libmf.atan2" (func $../../lib/libm/assembly/libmf/atan2)) + (export "libmf.cbrt" (func $../../lib/libm/assembly/libmf/cbrt)) + (export "libmf.ceil" (func $../../lib/libm/assembly/libmf/ceil)) + (export "libmf.clz32" (func $../../lib/libm/assembly/libmf/clz32)) + (export "libmf.cos" (func $../../lib/libm/assembly/libmf/cos)) + (export "libmf.cosh" (func $../../lib/libm/assembly/libmf/cosh)) + (export "libmf.exp" (func $../../lib/libm/assembly/libmf/exp)) + (export "libmf.expm1" (func $../../lib/libm/assembly/libmf/expm1)) + (export "libmf.floor" (func $../../lib/libm/assembly/libmf/floor)) + (export "libmf.fround" (func $../../lib/libm/assembly/libmf/fround)) + (export "libmf.hypot" (func $../../lib/libm/assembly/libmf/hypot)) + (export "libmf.imul" (func $../../lib/libm/assembly/libmf/imul)) + (export "libmf.log" (func $../../lib/libm/assembly/libmf/log)) + (export "libmf.log10" (func $../../lib/libm/assembly/libmf/log10)) + (export "libmf.log1p" (func $../../lib/libm/assembly/libmf/log1p)) + (export "libmf.log2" (func $../../lib/libm/assembly/libmf/log2)) + (export "libmf.max" (func $../../lib/libm/assembly/libmf/max)) + (export "libmf.min" (func $../../lib/libm/assembly/libmf/min)) + (export "libmf.pow" (func $../../lib/libm/assembly/libmf/pow)) + (export "libmf.round" (func $../../lib/libm/assembly/libmf/round)) + (export "libmf.sign" (func $../../lib/libm/assembly/libmf/sign)) + (export "libmf.sin" (func $../../lib/libm/assembly/libmf/sin)) + (export "libmf.sinh" (func $../../lib/libm/assembly/libmf/sinh)) + (export "libmf.sqrt" (func $../../lib/libm/assembly/libmf/sqrt)) + (export "libmf.tan" (func $../../lib/libm/assembly/libmf/tan)) + (export "libmf.tanh" (func $../../lib/libm/assembly/libmf/tanh)) + (export "libmf.trunc" (func $../../lib/libm/assembly/libmf/trunc)) + (func $../../lib/libm/assembly/libm/abs (; 3 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 f64.abs ) - (func $~lib/math/R (; 1 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/R (; 4 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 f64.const 0.16666666666666666 local.get $0 @@ -106,7 +164,7 @@ f64.add f64.div ) - (func $~lib/math/NativeMath.acos (; 2 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.acos (; 5 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) (local $3 i32) @@ -230,40 +288,37 @@ f64.add f64.mul ) - (func $std/libm/acos (; 3 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/acos (; 6 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.acos ) - (func $~lib/math/NativeMath.log1p (; 4 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.log1p (; 7 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) (local $3 i32) - (local $4 i32) + (local $4 f64) (local $5 f64) - (local $6 f64) - (local $7 i64) - (local $8 f64) + (local $6 i64) + (local $7 f64) i32.const 1 - local.set $2 + local.set $3 local.get $0 i64.reinterpret_f64 i64.const 32 i64.shr_u i32.wrap_i64 - local.tee $3 + local.tee $2 i32.const 1071284858 i32.lt_u - local.tee $4 - i32.eqz - if - local.get $3 + if (result i32) + i32.const 1 + else + local.get $2 i32.const 31 i32.shr_u - local.set $4 end - local.get $4 if - local.get $3 + local.get $2 i32.const -1074790400 i32.ge_u if @@ -283,7 +338,7 @@ f64.div return end - local.get $3 + local.get $2 i32.const 1 i32.shl i32.const 2034237440 @@ -292,17 +347,17 @@ local.get $0 return end - local.get $3 + local.get $2 i32.const -1076707644 i32.le_u if i32.const 0 - local.set $2 + local.set $3 local.get $0 local.set $1 end else - local.get $3 + local.get $2 i32.const 2146435072 i32.ge_u if @@ -310,28 +365,28 @@ return end end - local.get $2 + local.get $3 if f64.const 1 local.get $0 f64.add i64.reinterpret_f64 - local.tee $7 + local.tee $6 i64.const 32 i64.shr_u i32.wrap_i64 i32.const 614242 i32.add - local.tee $4 + local.tee $2 i32.const 20 i32.shr_u i32.const 1023 i32.sub - local.tee $2 + local.tee $3 i32.const 54 i32.lt_s if (result f64) - local.get $7 + local.get $6 f64.reinterpret_i64 local.set $1 f64.const 1 @@ -344,7 +399,7 @@ f64.const 1 f64.sub f64.sub - local.get $2 + local.get $3 i32.const 2 i32.ge_s select @@ -353,11 +408,11 @@ else f64.const 0 end - local.set $6 - local.get $7 + local.set $5 + local.get $6 i64.const 4294967295 i64.and - local.get $4 + local.get $2 i32.const 1048575 i32.and i32.const 1072079006 @@ -376,21 +431,21 @@ local.get $1 f64.add f64.div - local.tee $5 - local.get $5 + local.tee $4 + local.get $4 f64.mul - local.tee $8 - local.get $8 + local.tee $7 + local.get $7 f64.mul local.set $0 - local.get $5 + local.get $4 f64.const 0.5 local.get $1 f64.mul local.get $1 f64.mul - local.tee $5 - local.get $8 + local.tee $4 + local.get $7 f64.const 0.6666666666666735 local.get $0 f64.const 0.2857142874366239 @@ -419,15 +474,15 @@ f64.add f64.add f64.mul - local.get $2 + local.get $3 f64.convert_i32_s local.tee $0 f64.const 1.9082149292705877e-10 f64.mul - local.get $6 + local.get $5 f64.add f64.add - local.get $5 + local.get $4 f64.sub local.get $1 f64.add @@ -436,34 +491,31 @@ f64.mul f64.add ) - (func $~lib/math/NativeMath.log (; 5 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.log (; 8 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i32) - (local $2 i32) - (local $3 i64) + (local $2 i64) + (local $3 f64) (local $4 f64) - (local $5 f64) - (local $6 i32) - (local $7 f64) + (local $5 i32) + (local $6 f64) local.get $0 i64.reinterpret_f64 - local.tee $3 + local.tee $2 i64.const 32 i64.shr_u i32.wrap_i64 - local.tee $2 + local.tee $1 i32.const 1048576 i32.lt_u - local.tee $1 - i32.eqz - if - local.get $2 + if (result i32) + i32.const 1 + else + local.get $1 i32.const 31 i32.shr_u - local.set $1 end - local.get $1 if - local.get $3 + local.get $2 i64.const 1 i64.shl i64.const 0 @@ -476,7 +528,7 @@ f64.div return end - local.get $2 + local.get $1 i32.const 31 i32.shr_u if @@ -488,18 +540,18 @@ return end i32.const -54 - local.set $6 + local.set $5 local.get $0 f64.const 18014398509481984 f64.mul i64.reinterpret_f64 - local.tee $3 + local.tee $2 i64.const 32 i64.shr_u i32.wrap_i64 - local.set $2 + local.set $1 else - local.get $2 + local.get $1 i32.const 2146435072 i32.ge_u if @@ -507,28 +559,25 @@ return else local.get $2 + i64.const 32 + i64.shl + i64.const 0 + i64.eq + i32.const 0 + local.get $1 i32.const 1072693248 i32.eq - local.tee $1 - if - local.get $3 - i64.const 32 - i64.shl - i64.const 0 - i64.eq - local.set $1 - end - local.get $1 + select if f64.const 0 return end end end - local.get $3 + local.get $2 i64.const 4294967295 i64.and - local.get $2 + local.get $1 i32.const 614242 i32.add local.tee $1 @@ -543,26 +592,26 @@ f64.reinterpret_i64 f64.const 1 f64.sub - local.tee $4 + local.tee $3 f64.const 2 - local.get $4 + local.get $3 f64.add f64.div - local.tee $5 - local.get $5 + local.tee $4 + local.get $4 f64.mul - local.tee $7 - local.get $7 + local.tee $6 + local.get $6 f64.mul local.set $0 - local.get $5 - f64.const 0.5 local.get $4 + f64.const 0.5 + local.get $3 f64.mul - local.get $4 + local.get $3 f64.mul - local.tee $5 - local.get $7 + local.tee $4 + local.get $6 f64.const 0.6666666666666735 local.get $0 f64.const 0.2857142874366239 @@ -596,23 +645,24 @@ i32.shr_s i32.const 1023 i32.sub - local.get $6 + local.get $5 i32.add + local.tee $1 f64.convert_i32_s - local.tee $0 f64.const 1.9082149292705877e-10 f64.mul f64.add - local.get $5 - f64.sub local.get $4 + f64.sub + local.get $3 f64.add - local.get $0 + local.get $1 + f64.convert_i32_s f64.const 0.6931471803691238 f64.mul f64.add ) - (func $~lib/math/NativeMath.acosh (; 6 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.acosh (; 9 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i64) local.get $0 i64.reinterpret_f64 @@ -666,21 +716,21 @@ f64.const 0.6931471805599453 f64.add ) - (func $std/libm/acosh (; 7 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/acosh (; 10 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.acosh ) - (func $~lib/math/NativeMath.asin (; 8 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.asin (; 11 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) - (local $3 i32) - (local $4 f64) + (local $3 f64) + (local $4 i32) local.get $0 i64.reinterpret_f64 i64.const 32 i64.shr_u i32.wrap_i64 - local.tee $3 + local.tee $4 i32.const 2147483647 i32.and local.tee $2 @@ -714,17 +764,14 @@ i32.const 1071644672 i32.lt_u if + local.get $2 + i32.const 1048576 + i32.ge_u + i32.const 0 local.get $2 i32.const 1045430272 i32.lt_u - local.tee $3 - if - local.get $2 - i32.const 1048576 - i32.ge_u - local.set $3 - end - local.get $3 + select if local.get $0 return @@ -750,7 +797,7 @@ local.set $0 local.get $1 call $~lib/math/R - local.set $4 + local.set $3 local.get $2 i32.const 1072640819 i32.ge_u @@ -759,7 +806,7 @@ f64.const 2 local.get $0 local.get $0 - local.get $4 + local.get $3 f64.mul f64.add f64.mul @@ -771,7 +818,7 @@ f64.const 2 local.get $0 f64.mul - local.get $4 + local.get $3 f64.mul f64.const 6.123233995736766e-17 f64.const 2 @@ -801,7 +848,7 @@ f64.sub end local.set $0 - local.get $3 + local.get $4 i32.const 31 i32.shr_u if @@ -811,11 +858,11 @@ end local.get $0 ) - (func $std/libm/asin (; 9 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/asin (; 12 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.asin ) - (func $~lib/math/NativeMath.asinh (; 10 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.asinh (; 13 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i64) local.get $0 @@ -885,11 +932,16 @@ local.get $0 f64.copysign ) - (func $std/libm/asinh (; 11 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/asinh (; 14 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.asinh ) - (func $~lib/math/NativeMath.atan (; 12 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/builtins/isNaN (; 15 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + local.get $0 + f64.ne + ) + (func $~lib/math/NativeMath.atan (; 16 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) (local $3 f64) @@ -908,8 +960,7 @@ i32.ge_u if local.get $0 - local.get $0 - f64.ne + call $~lib/builtins/isNaN if local.get $0 return @@ -1061,10 +1112,13 @@ block $case1|0 local.get $2 if - local.get $2 - i32.const 1 - i32.sub - br_table $case1|0 $case2|0 $case3|0 $case4|0 + block $tablify|0 + local.get $2 + i32.const 1 + i32.sub + br_table $case1|0 $case2|0 $case3|0 $tablify|0 + end + br $case4|0 end f64.const 0.4636476090008061 local.get $1 @@ -1112,11 +1166,11 @@ local.get $3 f64.copysign ) - (func $std/libm/atan (; 13 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/atan (; 17 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.atan ) - (func $~lib/math/NativeMath.atanh (; 14 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.atanh (; 18 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i64) (local $3 f64) @@ -1173,28 +1227,25 @@ local.get $0 f64.copysign ) - (func $std/libm/atanh (; 15 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/atanh (; 19 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.atanh ) - (func $~lib/math/NativeMath.atan2 (; 16 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $~lib/math/NativeMath.atan2 (; 20 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - (local $6 i64) + (local $5 i64) + (local $6 i32) (local $7 i32) local.get $1 - local.get $1 - f64.ne - local.tee $3 - local.set $2 - local.get $2 - local.get $0 - local.get $0 - f64.ne - local.get $3 - select + call $~lib/builtins/isNaN + if (result i32) + i32.const 1 + else + local.get $0 + call $~lib/builtins/isNaN + end if local.get $1 local.get $0 @@ -1203,24 +1254,25 @@ end local.get $0 i64.reinterpret_f64 - local.tee $6 + local.tee $5 i64.const 32 i64.shr_u i32.wrap_i64 - local.set $3 - local.get $6 + local.set $4 + local.get $5 i32.wrap_i64 - local.set $5 + local.set $6 local.get $1 i64.reinterpret_f64 - local.tee $6 - i32.wrap_i64 - local.tee $7 - local.get $6 + local.tee $5 i64.const 32 i64.shr_u i32.wrap_i64 - local.tee $4 + local.set $3 + local.get $5 + i32.wrap_i64 + local.tee $7 + local.get $3 i32.const 1072693248 i32.sub i32.or @@ -1230,41 +1282,47 @@ call $~lib/math/NativeMath.atan return end - local.get $4 + local.get $3 i32.const 30 i32.shr_u i32.const 2 i32.and - local.get $3 + local.get $4 i32.const 31 i32.shr_u i32.or local.set $2 - local.get $4 + local.get $3 i32.const 2147483647 i32.and - local.set $4 - local.get $5 - local.get $3 + local.set $3 + local.get $4 i32.const 2147483647 i32.and - local.tee $5 + local.tee $4 + local.get $6 i32.or i32.eqz if block $break|0 block $case3|0 block $case2|0 - block $case1|0 + local.get $2 + i32.eqz + local.get $2 + i32.const 1 + i32.eq + i32.or + i32.eqz + if local.get $2 - i32.eqz - br_if $case1|0 - block $tablify|0 - local.get $2 - i32.const 1 - i32.sub - br_table $case1|0 $case2|0 $case3|0 $tablify|0 - end + i32.const 2 + i32.eq + br_if $case2|0 + local.get $2 + i32.const 3 + i32.eq + br_if $case3|0 br $break|0 end local.get $0 @@ -1278,16 +1336,16 @@ end end block $folding-inner0 - local.get $4 + local.get $3 local.get $7 i32.or i32.eqz br_if $folding-inner0 - local.get $4 + local.get $3 i32.const 2146435072 i32.eq if - local.get $5 + local.get $4 i32.const 2146435072 i32.eq if @@ -1297,10 +1355,13 @@ block $case1|1 local.get $2 if - local.get $2 - i32.const 1 - i32.sub - br_table $case1|1 $case2|1 $case3|1 $break|1 + block $tablify|0 + local.get $2 + i32.const 1 + i32.sub + br_table $case1|1 $case2|1 $case3|1 $tablify|0 + end + br $break|1 end f64.const 0.7853981633974483 return @@ -1321,10 +1382,13 @@ block $case1|2 local.get $2 if - local.get $2 - i32.const 1 - i32.sub - br_table $case1|2 $case2|2 $case3|2 $break|2 + block $tablify|00 + local.get $2 + i32.const 1 + i32.sub + br_table $case1|2 $case2|2 $case3|2 $tablify|00 + end + br $break|2 end f64.const 0 return @@ -1340,33 +1404,27 @@ end end end + i32.const 1 local.get $4 + i32.const 2146435072 + i32.eq + local.get $3 i32.const 67108864 i32.add - local.get $5 + local.get $4 i32.lt_u - local.tee $3 - if (result i32) - local.get $3 - else - local.get $5 - i32.const 2146435072 - i32.eq - end + select br_if $folding-inner0 + local.get $4 + i32.const 67108864 + i32.add + local.get $3 + i32.lt_u + i32.const 0 local.get $2 i32.const 2 i32.and - local.tee $3 - if (result i32) - local.get $5 - i32.const 67108864 - i32.add - local.get $4 - i32.lt_u - else - local.get $3 - end + select if (result f64) f64.const 0 else @@ -1383,10 +1441,13 @@ block $case1|3 local.get $2 if - local.get $2 - i32.const 1 - i32.sub - br_table $case1|3 $case2|3 $case3|3 $break|3 + block $tablify|01 + local.get $2 + i32.const 1 + i32.sub + br_table $case1|3 $case2|3 $case3|3 $tablify|01 + end + br $break|3 end local.get $0 return @@ -1418,12 +1479,12 @@ i32.and select ) - (func $std/libm/atan2 (; 17 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $../../lib/libm/assembly/libm/atan2 (; 21 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) local.get $0 local.get $1 call $~lib/math/NativeMath.atan2 ) - (func $~lib/math/NativeMath.cbrt (; 18 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.cbrt (; 22 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) (local $3 f64) @@ -1545,20 +1606,25 @@ f64.mul f64.add ) - (func $std/libm/cbrt (; 19 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/cbrt (; 23 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.cbrt ) - (func $std/libm/ceil (; 20 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/ceil (; 24 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 f64.ceil ) - (func $~lib/math/NativeMath.clz32 (; 21 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/builtins/isFinite (; 25 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) local.get $0 local.get $0 f64.sub f64.const 0 - f64.ne + f64.eq + ) + (func $~lib/math/NativeMath.clz32 (; 26 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + call $~lib/builtins/isFinite + i32.eqz if f64.const 32 return @@ -1576,21 +1642,22 @@ i32.clz f64.convert_i32_s ) - (func $std/libm/clz32 (; 22 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/clz32 (; 27 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.clz32 ) - (func $std/libm/cos (; 23 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) - unreachable + (func $../../lib/libm/assembly/libm/cos (; 28 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + call $~lib/bindings/Math/cos ) - (func $~lib/math/NativeMath.expm1 (; 24 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.expm1 (; 29 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) - (local $2 f64) - (local $3 i32) + (local $2 i32) + (local $3 f64) (local $4 f64) - (local $5 i32) + (local $5 f64) (local $6 i32) - (local $7 f64) + (local $7 i32) (local $8 i64) local.get $0 i64.reinterpret_f64 @@ -1598,7 +1665,7 @@ i64.const 63 i64.shr_u i32.wrap_i64 - local.set $5 + local.set $7 local.get $8 i64.const 32 i64.shr_u @@ -1610,13 +1677,12 @@ i32.ge_u if local.get $0 - local.get $0 - f64.ne + call $~lib/builtins/isNaN if local.get $0 return end - local.get $5 + local.get $7 if f64.const -1 return @@ -1637,7 +1703,7 @@ if local.get $0 i32.const 1 - local.get $5 + local.get $7 i32.const 1 i32.shl i32.sub @@ -1653,7 +1719,7 @@ i32.const 1072734898 i32.lt_u select - local.tee $3 + local.tee $2 f64.convert_i32_s local.tee $1 f64.const 0.6931471803691238 @@ -1670,7 +1736,7 @@ f64.sub local.get $1 f64.sub - local.set $7 + local.set $3 else local.get $6 i32.const 1016070144 @@ -1684,27 +1750,27 @@ f64.const 0.5 local.get $0 f64.mul - local.tee $2 - f64.mul local.tee $4 - local.get $4 + f64.mul + local.tee $5 + local.get $5 f64.mul local.set $1 f64.const 3 f64.const 1 - local.get $4 + local.get $5 f64.const -0.03333333333333313 f64.mul f64.add local.get $1 f64.const 1.5873015872548146e-03 - local.get $4 + local.get $5 f64.const -7.93650757867488e-05 f64.mul f64.add local.get $1 f64.const 4.008217827329362e-06 - local.get $4 + local.get $5 f64.const -2.0109921818362437e-07 f64.mul f64.add @@ -1713,58 +1779,58 @@ f64.mul f64.add local.tee $1 - local.get $2 + local.get $4 f64.mul f64.sub - local.set $2 - local.get $4 + local.set $4 + local.get $5 local.get $1 - local.get $2 + local.get $4 f64.sub f64.const 6 local.get $0 - local.get $2 + local.get $4 f64.mul f64.sub f64.div f64.mul local.set $1 - local.get $3 + local.get $2 i32.eqz if local.get $0 local.get $0 local.get $1 f64.mul - local.get $4 + local.get $5 f64.sub f64.sub return end local.get $0 local.get $1 - local.get $7 + local.get $3 f64.sub f64.mul - local.get $7 + local.get $3 f64.sub - local.get $4 + local.get $5 f64.sub - local.set $2 - local.get $3 + local.set $3 + local.get $2 i32.const -1 i32.eq if f64.const 0.5 local.get $0 - local.get $2 + local.get $3 f64.sub f64.mul f64.const 0.5 f64.sub return end - local.get $3 + local.get $2 i32.const 1 i32.eq if @@ -1773,7 +1839,7 @@ f64.lt if f64.const -2 - local.get $2 + local.get $3 local.get $0 f64.const 0.5 f64.add @@ -1784,83 +1850,79 @@ f64.const 1 f64.const 2 local.get $0 - local.get $2 + local.get $3 f64.sub f64.mul f64.add return end - local.get $3 + local.get $2 i64.extend_i32_s i64.const 1023 i64.add i64.const 52 i64.shl f64.reinterpret_i64 - local.set $1 - local.get $3 + local.set $4 + i32.const 1 + local.get $2 + i32.const 56 + i32.gt_s + local.get $2 i32.const 0 i32.lt_s - local.tee $5 - if (result i32) - local.get $5 - else - local.get $3 - i32.const 56 - i32.gt_s - end + select if local.get $0 - local.get $2 + local.get $3 f64.sub f64.const 1 f64.add local.set $0 - local.get $3 + local.get $0 + f64.const 2 + f64.mul + f64.const 8988465674311579538646525e283 + f64.mul + local.get $0 + local.get $4 + f64.mul + local.get $2 i32.const 1024 i32.eq - if (result f64) - local.get $0 - f64.const 2 - f64.mul - f64.const 8988465674311579538646525e283 - f64.mul - else - local.get $0 - local.get $1 - f64.mul - end + select f64.const 1 f64.sub return end - local.get $0 - f64.const 1 i64.const 1023 - local.get $3 + local.get $2 i64.extend_i32_s i64.sub i64.const 52 i64.shl f64.reinterpret_i64 - local.tee $0 + local.set $1 + local.get $0 + f64.const 1 + local.get $1 f64.sub - local.get $2 + local.get $3 f64.sub f64.const 1 - local.get $2 - local.get $0 + local.get $3 + local.get $1 f64.add f64.sub - local.get $3 + local.get $2 i32.const 20 i32.lt_s select f64.add - local.get $1 + local.get $4 f64.mul ) - (func $~lib/math/NativeMath.scalbn (; 25 ;) (type $FUNCSIG$ddi) (param $0 f64) (param $1 i32) (result f64) + (func $~lib/math/NativeMath.scalbn (; 30 ;) (type $FUNCSIG$ddi) (param $0 f64) (param $1 i32) (result f64) local.get $1 i32.const 1023 i32.gt_s @@ -1937,14 +1999,14 @@ f64.reinterpret_i64 f64.mul ) - (func $~lib/math/NativeMath.exp (; 26 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.exp (; 31 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i32) (local $2 f64) (local $3 i32) (local $4 f64) (local $5 f64) - (local $6 i32) - (local $7 f64) + (local $6 f64) + (local $7 i32) local.get $0 i64.reinterpret_f64 i64.const 32 @@ -1953,7 +2015,7 @@ local.tee $1 i32.const 31 i32.shr_u - local.set $6 + local.set $7 local.get $1 i32.const 2147483647 i32.and @@ -1962,8 +2024,7 @@ i32.ge_u if local.get $0 - local.get $0 - f64.ne + call $~lib/builtins/isNaN if local.get $0 return @@ -2006,36 +2067,37 @@ i32.trunc_f64_s else i32.const 1 - local.get $6 + local.get $7 i32.const 1 i32.shl i32.sub end local.tee $1 f64.convert_i32_s - local.tee $0 f64.const 0.6931471803691238 f64.mul f64.sub - local.tee $4 - local.get $0 + local.tee $5 + local.get $1 + f64.convert_i32_s f64.const 1.9082149292705877e-10 f64.mul - local.tee $7 + local.tee $4 f64.sub local.set $0 else local.get $3 i32.const 1043333120 - i32.le_u - if + i32.gt_u + if (result f64) + local.get $0 + else f64.const 1 local.get $0 f64.add return end - local.get $0 - local.set $4 + local.set $5 end local.get $0 local.get $0 @@ -2043,20 +2105,20 @@ local.tee $2 local.get $2 f64.mul - local.set $5 + local.set $6 f64.const 1 local.get $0 local.get $0 local.get $2 f64.const 0.16666666666666602 f64.mul - local.get $5 + local.get $6 f64.const -2.7777777777015593e-03 local.get $2 f64.const 6.613756321437934e-05 f64.mul f64.add - local.get $5 + local.get $6 f64.const -1.6533902205465252e-06 local.get $2 f64.const 4.1381367970572385e-08 @@ -2073,9 +2135,9 @@ local.get $0 f64.sub f64.div - local.get $7 - f64.sub local.get $4 + f64.sub + local.get $5 f64.add f64.add local.set $0 @@ -2089,7 +2151,7 @@ local.get $1 call $~lib/math/NativeMath.scalbn ) - (func $~lib/math/NativeMath.cosh (; 27 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.cosh (; 32 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i32) (local $2 i64) local.get $0 @@ -2153,27 +2215,28 @@ f64.const 2247116418577894884661631e283 f64.mul ) - (func $std/libm/cosh (; 28 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/cosh (; 33 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.cosh ) - (func $std/libm/exp (; 29 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/exp (; 34 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.exp ) - (func $std/libm/expm1 (; 30 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/expm1 (; 35 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.expm1 ) - (func $std/libm/floor (; 31 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/floor (; 36 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 f64.floor ) - (func $std/libm/fround (; 32 ;) (type $FUNCSIG$fd) (param $0 f64) (result f32) + (func $../../lib/libm/assembly/libm/fround (; 37 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 f32.demote_f64 + f64.promote_f32 ) - (func $~lib/math/NativeMath.hypot (; 33 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $~lib/math/NativeMath.hypot (; 38 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) (local $2 i64) (local $3 f64) (local $4 i64) @@ -2182,9 +2245,8 @@ (local $7 f64) (local $8 f64) (local $9 i32) - (local $10 i32) - (local $11 f64) - (local $12 i64) + (local $10 f64) + (local $11 i64) local.get $0 i64.reinterpret_f64 i64.const 9223372036854775807 @@ -2198,10 +2260,10 @@ i64.lt_u if local.get $4 - local.set $12 + local.set $11 local.get $2 local.set $4 - local.get $12 + local.get $11 local.set $2 end local.get $4 @@ -2226,18 +2288,14 @@ local.get $4 f64.reinterpret_i64 local.set $0 + i32.const 1 + local.get $2 + i64.const 0 + i64.eq local.get $5 i32.const 2047 i32.eq - local.tee $10 - i32.eqz - if - local.get $2 - i64.const 0 - i64.eq - local.set $10 - end - local.get $10 + select if local.get $0 return @@ -2297,7 +2355,7 @@ f64.add local.tee $7 f64.sub - local.set $11 + local.set $10 local.get $1 local.get $1 local.get $1 @@ -2338,9 +2396,9 @@ f64.const 2 local.get $7 f64.mul - local.get $11 + local.get $10 f64.add - local.get $11 + local.get $10 f64.mul f64.add f64.add @@ -2351,21 +2409,17 @@ f64.sqrt f64.mul ) - (func $std/libm/hypot (; 34 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $../../lib/libm/assembly/libm/hypot (; 39 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) local.get $0 local.get $1 call $~lib/math/NativeMath.hypot ) - (func $~lib/math/NativeMath.imul (; 35 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) - (local $2 f64) + (func $~lib/math/NativeMath.imul (; 40 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) local.get $0 local.get $1 f64.add - local.tee $2 - local.get $2 - f64.sub - f64.const 0 - f64.ne + call $~lib/builtins/isFinite + i32.eqz if f64.const 0 return @@ -2393,45 +2447,42 @@ i32.mul f64.convert_i32_s ) - (func $std/libm/imul (; 36 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $../../lib/libm/assembly/libm/imul (; 41 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) local.get $0 local.get $1 call $~lib/math/NativeMath.imul ) - (func $std/libm/log (; 37 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/log (; 42 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.log ) - (func $~lib/math/NativeMath.log10 (; 38 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.log10 (; 43 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) - (local $3 i32) - (local $4 i64) - (local $5 f64) - (local $6 i32) + (local $3 i64) + (local $4 f64) + (local $5 i32) + (local $6 f64) (local $7 f64) (local $8 f64) - (local $9 f64) local.get $0 i64.reinterpret_f64 - local.tee $4 + local.tee $3 i64.const 32 i64.shr_u i32.wrap_i64 - local.tee $3 + local.tee $2 i32.const 1048576 i32.lt_u - local.tee $2 - i32.eqz - if - local.get $3 + if (result i32) + i32.const 1 + else + local.get $2 i32.const 31 i32.shr_u - local.set $2 end - local.get $2 if - local.get $4 + local.get $3 i64.const 1 i64.shl i64.const 0 @@ -2444,7 +2495,7 @@ f64.div return end - local.get $3 + local.get $2 i32.const 31 i32.shr_u if @@ -2456,18 +2507,18 @@ return end i32.const -54 - local.set $6 + local.set $5 local.get $0 f64.const 18014398509481984 f64.mul i64.reinterpret_f64 - local.tee $4 + local.tee $3 i64.const 32 i64.shr_u i32.wrap_i64 - local.set $3 + local.set $2 else - local.get $3 + local.get $2 i32.const 2146435072 i32.ge_u if @@ -2475,28 +2526,25 @@ return else local.get $3 + i64.const 32 + i64.shl + i64.const 0 + i64.eq + i32.const 0 + local.get $2 i32.const 1072693248 i32.eq - local.tee $2 - if - local.get $4 - i64.const 32 - i64.shl - i64.const 0 - i64.eq - local.set $2 - end - local.get $2 + select if f64.const 0 return end end end - local.get $4 + local.get $3 i64.const 4294967295 i64.and - local.get $3 + local.get $2 i32.const 614242 i32.add local.tee $2 @@ -2516,26 +2564,26 @@ local.get $1 f64.add f64.div + local.tee $6 + local.get $6 + f64.mul local.tee $7 local.get $7 f64.mul - local.tee $8 - local.get $8 - f64.mul local.set $0 local.get $2 i32.const 20 i32.shr_u i32.const 1023 i32.sub - local.get $6 + local.get $5 i32.add f64.convert_i32_s - local.tee $5 + local.tee $4 f64.const 0.30102999566361177 f64.mul - local.set $9 - local.get $5 + local.set $8 + local.get $4 f64.const 3.694239077158931e-13 f64.mul local.get $1 @@ -2551,13 +2599,13 @@ i64.const -4294967296 i64.and f64.reinterpret_i64 - local.tee $5 + local.tee $4 f64.sub local.get $1 f64.sub - local.get $7 + local.get $6 local.get $1 - local.get $8 + local.get $7 f64.const 0.6666666666666735 local.get $0 f64.const 0.2857142874366239 @@ -2588,7 +2636,7 @@ f64.mul f64.add local.tee $0 - local.get $5 + local.get $4 f64.add f64.const 2.5082946711645275e-11 f64.mul @@ -2597,9 +2645,9 @@ f64.const 0.4342944818781689 f64.mul f64.add - local.get $9 - local.get $9 - local.get $5 + local.get $8 + local.get $8 + local.get $4 f64.const 0.4342944818781689 f64.mul local.tee $0 @@ -2612,43 +2660,40 @@ local.get $1 f64.add ) - (func $std/libm/log10 (; 39 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/log10 (; 44 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.log10 ) - (func $std/libm/log1p (; 40 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/log1p (; 45 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.log1p ) - (func $~lib/math/NativeMath.log2 (; 41 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.log2 (; 46 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) - (local $3 i32) - (local $4 i64) + (local $3 i64) + (local $4 f64) (local $5 f64) - (local $6 f64) - (local $7 i32) - (local $8 f64) + (local $6 i32) + (local $7 f64) local.get $0 i64.reinterpret_f64 - local.tee $4 + local.tee $3 i64.const 32 i64.shr_u i32.wrap_i64 - local.tee $3 + local.tee $2 i32.const 1048576 i32.lt_u - local.tee $2 - i32.eqz - if - local.get $3 + if (result i32) + i32.const 1 + else + local.get $2 i32.const 31 i32.shr_u - local.set $2 end - local.get $2 if - local.get $4 + local.get $3 i64.const 1 i64.shl i64.const 0 @@ -2661,7 +2706,7 @@ f64.div return end - local.get $3 + local.get $2 i32.const 31 i32.shr_u if @@ -2673,18 +2718,18 @@ return end i32.const -54 - local.set $7 + local.set $6 local.get $0 f64.const 18014398509481984 f64.mul i64.reinterpret_f64 - local.tee $4 + local.tee $3 i64.const 32 i64.shr_u i32.wrap_i64 - local.set $3 + local.set $2 else - local.get $3 + local.get $2 i32.const 2146435072 i32.ge_u if @@ -2692,28 +2737,25 @@ return else local.get $3 + i64.const 32 + i64.shl + i64.const 0 + i64.eq + i32.const 0 + local.get $2 i32.const 1072693248 i32.eq - local.tee $2 - if - local.get $4 - i64.const 32 - i64.shl - i64.const 0 - i64.eq - local.set $2 - end - local.get $2 + select if f64.const 0 return end end end - local.get $4 + local.get $3 i64.const 4294967295 i64.and - local.get $3 + local.get $2 i32.const 614242 i32.add local.tee $2 @@ -2733,12 +2775,12 @@ local.get $1 f64.add f64.div + local.tee $4 + local.get $4 + f64.mul local.tee $5 local.get $5 f64.mul - local.tee $6 - local.get $6 - f64.mul local.set $0 local.get $1 local.get $1 @@ -2753,13 +2795,13 @@ i64.const -4294967296 i64.and f64.reinterpret_i64 - local.tee $8 + local.tee $7 f64.sub local.get $1 f64.sub - local.get $5 + local.get $4 local.get $1 - local.get $6 + local.get $5 f64.const 0.6666666666666735 local.get $0 f64.const 0.2857142874366239 @@ -2795,18 +2837,18 @@ i32.shr_u i32.const 1023 i32.sub - local.get $7 + local.get $6 i32.add f64.convert_i32_s - local.tee $5 - local.get $8 + local.tee $4 + local.get $7 f64.const 1.4426950407214463 f64.mul - local.tee $6 + local.tee $5 f64.add local.set $1 local.get $0 - local.get $8 + local.get $7 f64.add f64.const 1.6751713164886512e-10 f64.mul @@ -2814,33 +2856,33 @@ f64.const 1.4426950407214463 f64.mul f64.add - local.get $5 + local.get $4 local.get $1 f64.sub - local.get $6 + local.get $5 f64.add f64.add local.get $1 f64.add ) - (func $std/libm/log2 (; 42 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/log2 (; 47 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.log2 ) - (func $std/libm/max (; 43 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $../../lib/libm/assembly/libm/max (; 48 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) local.get $0 local.get $1 f64.max ) - (func $std/libm/min (; 44 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $../../lib/libm/assembly/libm/min (; 49 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) local.get $0 local.get $1 f64.min ) - (func $~lib/math/NativeMath.pow (; 45 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) - (local $2 i32) + (func $~lib/math/NativeMath.pow (; 50 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (local $2 f64) (local $3 f64) - (local $4 f64) + (local $4 i32) (local $5 i32) (local $6 i32) (local $7 f64) @@ -2869,7 +2911,7 @@ local.tee $17 i32.const 2147483647 i32.and - local.set $5 + local.set $4 local.get $1 i64.reinterpret_f64 local.tee $16 @@ -2890,46 +2932,34 @@ f64.const 1 return end - local.get $5 + i32.const 1 + local.get $6 + i32.const 0 + i32.ne + i32.const 0 + local.get $8 + i32.const 2146435072 + i32.eq + select + i32.const 1 + local.get $8 i32.const 2146435072 i32.gt_s - local.tee $2 - i32.eqz - if - local.get $5 - i32.const 2146435072 - i32.eq - local.tee $2 - if - local.get $19 - i32.const 0 - i32.ne - local.set $2 - end - end - local.get $2 - i32.eqz - if - local.get $8 - i32.const 2146435072 - i32.gt_s - local.set $2 - end - local.get $2 - i32.eqz - if - local.get $8 - i32.const 2146435072 - i32.eq - local.tee $2 - if - local.get $6 - i32.const 0 - i32.ne - local.set $2 - end - end - local.get $2 + i32.const 1 + local.get $19 + i32.const 0 + i32.ne + i32.const 0 + local.get $4 + i32.const 2146435072 + i32.eq + select + local.get $4 + i32.const 2146435072 + i32.gt_s + select + select + select if local.get $0 local.get $1 @@ -2962,8 +2992,8 @@ i32.gt_s local.tee $13 select - local.tee $2 - local.get $2 + local.tee $5 + local.get $5 i32.const 52 i32.const 20 local.get $13 @@ -2972,13 +3002,13 @@ i32.sub local.tee $13 i32.shr_s - local.tee $2 + local.tee $5 local.get $13 i32.shl i32.eq if (result i32) i32.const 2 - local.get $2 + local.get $5 i32.const 1 i32.and i32.sub @@ -2998,13 +3028,13 @@ i32.const 2146435072 i32.eq if - local.get $5 + local.get $4 i32.const 1072693248 i32.sub local.get $19 i32.or if - local.get $5 + local.get $4 i32.const 1072693248 i32.ge_s if @@ -3075,66 +3105,58 @@ end local.get $0 f64.abs - local.set $4 + local.set $3 local.get $19 i32.eqz if - local.get $5 - i32.eqz - local.tee $2 - i32.eqz - if - local.get $5 - i32.const 2146435072 - i32.eq - local.set $2 - end - local.get $2 - i32.eqz - if - local.get $5 - i32.const 1072693248 - i32.eq - local.set $2 - end - local.get $2 + i32.const 1 + local.get $4 + i32.const 1072693248 + i32.eq + local.get $4 + i32.const 2146435072 + i32.eq + i32.const 1 + local.get $4 + select + select if f64.const 1 - local.get $4 + local.get $3 f64.div - local.get $4 + local.get $3 local.get $9 i32.const 0 i32.lt_s select - local.set $4 + local.set $3 local.get $17 i32.const 0 i32.lt_s if (result f64) - local.get $5 + local.get $4 i32.const 1072693248 i32.sub local.get $11 i32.or if (result f64) - local.get $4 + local.get $3 f64.neg - local.get $4 + local.get $3 local.get $11 i32.const 1 i32.eq select else - local.get $4 - local.get $4 + local.get $3 + local.get $3 f64.sub local.tee $0 local.get $0 f64.div end else - local.get $4 + local.get $3 end return end @@ -3172,7 +3194,7 @@ i32.const 1139802112 i32.gt_s if - local.get $5 + local.get $4 i32.const 1072693247 i32.le_s if @@ -3184,7 +3206,7 @@ select return end - local.get $5 + local.get $4 i32.const 1072693248 i32.ge_s if @@ -3197,60 +3219,56 @@ return end end - local.get $5 + local.get $4 i32.const 1072693247 i32.lt_s if + local.get $7 + f64.const 1.e+300 + f64.mul + f64.const 1.e+300 + f64.mul + local.get $7 + f64.const 1e-300 + f64.mul + f64.const 1e-300 + f64.mul local.get $9 i32.const 0 i32.lt_s - if (result f64) - local.get $7 - f64.const 1.e+300 - f64.mul - f64.const 1.e+300 - f64.mul - else - local.get $7 - f64.const 1e-300 - f64.mul - f64.const 1e-300 - f64.mul - end + select return end - local.get $5 + local.get $4 i32.const 1072693248 i32.gt_s if - local.get $9 - i32.const 0 + local.get $7 + f64.const 1.e+300 + f64.mul + f64.const 1.e+300 + f64.mul + local.get $7 + f64.const 1e-300 + f64.mul + f64.const 1e-300 + f64.mul + local.get $9 + i32.const 0 i32.gt_s - if (result f64) - local.get $7 - f64.const 1.e+300 - f64.mul - f64.const 1.e+300 - f64.mul - else - local.get $7 - f64.const 1e-300 - f64.mul - f64.const 1e-300 - f64.mul - end + select return end - local.get $4 + local.get $3 f64.const 1 f64.sub - local.tee $3 - local.get $3 + local.tee $2 + local.get $2 f64.mul f64.const 0.5 - local.get $3 + local.get $2 f64.const 0.3333333333333333 - local.get $3 + local.get $2 f64.const 0.25 f64.mul f64.sub @@ -3259,10 +3277,10 @@ f64.mul local.set $0 f64.const 1.4426950216293335 - local.get $3 + local.get $2 f64.mul - local.tee $4 - local.get $3 + local.tee $3 + local.get $2 f64.const 1.9259629911266175e-08 f64.mul local.get $0 @@ -3278,50 +3296,50 @@ local.set $10 local.get $0 local.get $10 - local.get $4 + local.get $3 f64.sub f64.sub else i32.const 0 local.set $6 - local.get $5 + local.get $4 i32.const 1048576 i32.lt_s if (result i32) - local.get $4 + local.get $3 f64.const 9007199254740992 f64.mul - local.tee $4 + local.tee $3 i64.reinterpret_f64 i64.const 32 i64.shr_u i32.wrap_i64 - local.set $5 + local.set $4 i32.const -53 else i32.const 0 end - local.get $5 + local.get $4 i32.const 20 i32.shr_s i32.const 1023 i32.sub i32.add local.set $6 - local.get $5 + local.get $4 i32.const 1048575 i32.and - local.tee $2 + local.tee $5 i32.const 1072693248 i32.or - local.set $5 - local.get $2 + local.set $4 + local.get $5 i32.const 235662 i32.le_s if (result i32) i32.const 0 else - local.get $2 + local.get $5 i32.const 767610 i32.lt_s if (result i32) @@ -3331,38 +3349,38 @@ i32.const 1 i32.add local.set $6 - local.get $5 + local.get $4 i32.const -1048576 i32.add - local.set $5 + local.set $4 i32.const 0 end end - local.set $2 - local.get $4 + local.set $5 + local.get $3 i64.reinterpret_f64 i64.const 4294967295 i64.and - local.get $5 + local.get $4 i64.extend_i32_s i64.const 32 i64.shl i64.or f64.reinterpret_i64 - local.tee $4 + local.tee $3 f64.const 1.5 f64.const 1 - local.get $2 + local.get $5 select local.tee $0 f64.sub local.tee $10 f64.const 1 - local.get $4 + local.get $3 local.get $0 f64.add f64.div - local.tee $3 + local.tee $2 f64.mul local.tee $18 i64.reinterpret_f64 @@ -3370,15 +3388,15 @@ i64.and f64.reinterpret_i64 local.set $14 + local.get $3 local.get $4 - local.get $5 i32.const 1 i32.shr_s i32.const 536870912 i32.or i32.const 524288 i32.add - local.get $2 + local.get $5 i32.const 18 i32.shl i32.add @@ -3386,7 +3404,7 @@ i64.const 32 i64.shl f64.reinterpret_i64 - local.tee $4 + local.tee $3 local.get $0 f64.sub f64.sub @@ -3427,10 +3445,10 @@ f64.mul f64.add f64.mul - local.get $3 + local.get $2 local.get $10 local.get $14 - local.get $4 + local.get $3 f64.mul f64.sub local.get $14 @@ -3438,7 +3456,7 @@ f64.mul f64.sub f64.mul - local.tee $3 + local.tee $2 local.get $14 local.get $18 f64.add @@ -3452,8 +3470,8 @@ f64.reinterpret_i64 local.tee $10 f64.mul - local.tee $4 - local.get $3 + local.tee $3 + local.get $2 local.get $10 f64.mul local.get $0 @@ -3472,15 +3490,15 @@ i64.const -4294967296 i64.and f64.reinterpret_i64 - local.tee $3 + local.tee $2 f64.mul local.tee $20 f64.const -7.028461650952758e-09 - local.get $3 + local.get $2 f64.mul local.get $0 + local.get $2 local.get $3 - local.get $4 f64.sub f64.sub f64.const 0.9617966939259756 @@ -3488,16 +3506,16 @@ f64.add f64.const 1.350039202129749e-08 f64.const 0 - local.get $2 + local.get $5 select f64.add - local.tee $3 + local.tee $2 f64.add f64.const 0.5849624872207642 f64.const 0 - local.get $2 + local.get $5 select - local.tee $4 + local.tee $3 f64.add local.get $6 f64.convert_i32_s @@ -3508,17 +3526,17 @@ i64.and f64.reinterpret_i64 local.set $10 - local.get $3 + local.get $2 local.get $10 local.get $0 f64.sub - local.get $4 + local.get $3 f64.sub local.get $20 f64.sub f64.sub end - local.set $4 + local.set $3 local.get $1 local.get $1 i64.reinterpret_f64 @@ -3530,20 +3548,20 @@ local.get $10 f64.mul local.get $1 - local.get $4 + local.get $3 f64.mul f64.add local.tee $1 local.get $0 local.get $10 f64.mul - local.tee $3 + local.tee $2 f64.add local.tee $0 i64.reinterpret_f64 local.tee $16 i32.wrap_i64 - local.set $2 + local.set $5 block $folding-inner1 block $folding-inner0 local.get $16 @@ -3557,16 +3575,16 @@ local.get $12 i32.const 1083179008 i32.sub - local.get $2 + local.get $5 i32.or - br_if $folding-inner0 local.get $1 f64.const 8.008566259537294e-17 f64.add local.get $0 - local.get $3 + local.get $2 f64.sub f64.gt + i32.or br_if $folding-inner0 else local.get $12 @@ -3578,14 +3596,14 @@ local.get $12 i32.const -1064252416 i32.sub - local.get $2 + local.get $5 i32.or - br_if $folding-inner1 local.get $1 local.get $0 - local.get $3 + local.get $2 f64.sub f64.le + i32.or br_if $folding-inner1 end end @@ -3597,7 +3615,7 @@ i32.shr_s i32.const 1023 i32.sub - local.set $2 + local.set $5 i32.const 0 local.set $6 local.get $13 @@ -3605,7 +3623,7 @@ i32.gt_s if i32.const 1048576 - local.get $2 + local.get $5 i32.const 1 i32.add i32.shr_s @@ -3618,9 +3636,9 @@ i32.shr_s i32.const 1023 i32.sub - local.set $2 + local.set $5 i32.const 1048575 - local.get $2 + local.get $5 i32.shr_s i32.const -1 i32.xor @@ -3637,7 +3655,7 @@ i32.const 1048576 i32.or i32.const 20 - local.get $2 + local.get $5 i32.sub i32.shr_s local.set $6 @@ -3650,13 +3668,13 @@ i32.lt_s select local.set $6 - local.get $3 + local.get $2 local.get $0 f64.sub - local.set $3 + local.set $2 end local.get $1 - local.get $3 + local.get $2 f64.add i64.reinterpret_f64 i64.const -4294967296 @@ -3665,10 +3683,10 @@ local.tee $0 f64.const 0.6931471824645996 f64.mul - local.tee $4 + local.tee $3 local.get $1 local.get $0 - local.get $3 + local.get $2 f64.sub f64.sub f64.const 0.6931471805599453 @@ -3679,14 +3697,14 @@ f64.add local.tee $1 f64.add - local.tee $3 - local.get $3 + local.tee $2 + local.get $2 f64.mul local.set $0 local.get $7 f64.const 1 - local.get $3 - local.get $3 + local.get $2 + local.get $2 local.get $0 f64.const 0.16666666666666602 local.get $0 @@ -3714,17 +3732,17 @@ f64.sub f64.div local.get $1 + local.get $2 local.get $3 - local.get $4 f64.sub f64.sub local.tee $0 - local.get $3 + local.get $2 local.get $0 f64.mul f64.add f64.sub - local.get $3 + local.get $2 f64.sub f64.sub local.tee $0 @@ -3736,7 +3754,7 @@ i32.const 20 i32.shl i32.add - local.tee $2 + local.tee $5 i32.const 20 i32.shr_s i32.const 0 @@ -3750,7 +3768,7 @@ i64.reinterpret_f64 i64.const 4294967295 i64.and - local.get $2 + local.get $5 i64.extend_i32_s i64.const 32 i64.shl @@ -3773,12 +3791,12 @@ f64.const 1e-300 f64.mul ) - (func $std/libm/pow (; 46 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $../../lib/libm/assembly/libm/pow (; 51 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) local.get $0 local.get $1 call $~lib/math/NativeMath.pow ) - (func $std/libm/round (; 47 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/round (; 52 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 f64.const 0.5 f64.add @@ -3786,25 +3804,24 @@ local.get $0 f64.copysign ) - (func $std/libm/sign (; 48 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/sign (; 53 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 + f64.abs f64.const 0 f64.gt if f64.const 1 - local.set $0 - else local.get $0 - f64.const 0 - f64.lt - if - f64.const -1 - local.set $0 - end + f64.copysign + local.set $0 end local.get $0 ) - (func $~lib/math/NativeMath.sinh (; 49 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/sin (; 54 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + call $~lib/bindings/Math/sin + ) + (func $~lib/math/NativeMath.sinh (; 55 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 f64) (local $3 i32) @@ -3881,15 +3898,19 @@ f64.mul f64.mul ) - (func $std/libm/sinh (; 50 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/sinh (; 56 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.sinh ) - (func $std/libm/sqrt (; 51 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/sqrt (; 57 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 f64.sqrt ) - (func $~lib/math/NativeMath.tanh (; 52 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/tan (; 58 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + call $~lib/bindings/Math/tan + ) + (func $~lib/math/NativeMath.tanh (; 59 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) (local $3 i64) @@ -3968,15 +3989,4115 @@ local.get $0 f64.copysign ) - (func $std/libm/tanh (; 53 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/tanh (; 60 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.tanh ) - (func $std/libm/trunc (; 54 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/trunc (; 61 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 f64.trunc ) - (func $null (; 55 ;) (type $FUNCSIG$v) + (func $../../lib/libm/assembly/libmf/abs (; 62 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + f32.abs + ) + (func $~lib/math/Rf (; 63 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + f32.const 0.16666586697101593 + local.get $0 + f32.const -0.04274342209100723 + local.get $0 + f32.const -0.008656363002955914 + f32.mul + f32.add + f32.mul + f32.add + f32.mul + f32.const 1 + local.get $0 + f32.const -0.7066296339035034 + f32.mul + f32.add + f32.div + ) + (func $~lib/math/NativeMathf.acos (; 64 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 f32) + (local $2 i32) + (local $3 i32) + (local $4 f32) + local.get $0 + i32.reinterpret_f32 + local.tee $3 + i32.const 2147483647 + i32.and + local.tee $2 + i32.const 1065353216 + i32.ge_u + if + local.get $2 + i32.const 1065353216 + i32.eq + if + local.get $3 + i32.const 31 + i32.shr_u + if + f32.const 3.141592502593994 + return + end + f32.const 0 + return + end + f32.const 0 + local.get $0 + local.get $0 + f32.sub + f32.div + return + end + local.get $2 + i32.const 1056964608 + i32.lt_u + if + local.get $2 + i32.const 847249408 + i32.le_u + if + f32.const 1.570796251296997 + return + end + f32.const 1.570796251296997 + local.get $0 + f32.const 7.549789415861596e-08 + local.get $0 + local.get $0 + local.get $0 + f32.mul + call $~lib/math/Rf + f32.mul + f32.sub + f32.sub + f32.sub + return + end + local.get $3 + i32.const 31 + i32.shr_u + if + f32.const 2 + f32.const 1.570796251296997 + f32.const 0.5 + local.get $0 + f32.const 0.5 + f32.mul + f32.add + local.tee $0 + f32.sqrt + local.tee $1 + local.get $0 + call $~lib/math/Rf + local.get $1 + f32.mul + f32.const 7.549789415861596e-08 + f32.sub + f32.add + f32.sub + f32.mul + return + end + f32.const 2 + f32.const 0.5 + local.get $0 + f32.const 0.5 + f32.mul + f32.sub + local.tee $1 + f32.sqrt + local.tee $4 + i32.reinterpret_f32 + i32.const -4096 + i32.and + f32.reinterpret_i32 + local.tee $0 + local.get $1 + call $~lib/math/Rf + local.get $4 + f32.mul + local.get $1 + local.get $0 + local.get $0 + f32.mul + f32.sub + local.get $4 + local.get $0 + f32.add + f32.div + f32.add + f32.add + f32.mul + ) + (func $../../lib/libm/assembly/libmf/acos (; 65 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.acos + ) + (func $~lib/math/NativeMathf.log1p (; 66 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 f32) + (local $2 i32) + (local $3 i32) + (local $4 f32) + (local $5 f32) + (local $6 f32) + i32.const 1 + local.set $3 + local.get $0 + i32.reinterpret_f32 + local.tee $2 + i32.const 1054086096 + i32.lt_u + if (result i32) + i32.const 1 + else + local.get $2 + i32.const 31 + i32.shr_u + end + if + local.get $2 + i32.const -1082130432 + i32.ge_u + if + local.get $0 + f32.const -1 + f32.eq + if + local.get $0 + f32.const 0 + f32.div + return + end + local.get $0 + local.get $0 + f32.sub + f32.const 0 + f32.div + return + end + local.get $2 + i32.const 1 + i32.shl + i32.const 1728053248 + i32.lt_u + if + local.get $0 + return + end + local.get $2 + i32.const -1097468391 + i32.le_u + if + i32.const 0 + local.set $3 + local.get $0 + local.set $1 + end + else + local.get $2 + i32.const 2139095040 + i32.ge_u + if + local.get $0 + return + end + end + local.get $3 + if + f32.const 1 + local.get $0 + f32.add + local.tee $1 + i32.reinterpret_f32 + i32.const 4913933 + i32.add + local.tee $2 + i32.const 23 + i32.shr_u + i32.const 127 + i32.sub + local.tee $3 + i32.const 25 + i32.lt_s + if (result f32) + f32.const 1 + local.get $1 + local.get $0 + f32.sub + f32.sub + local.get $0 + local.get $1 + f32.const 1 + f32.sub + f32.sub + local.get $3 + i32.const 2 + i32.ge_s + select + local.get $1 + f32.div + else + f32.const 0 + end + local.set $5 + local.get $2 + i32.const 8388607 + i32.and + i32.const 1060439283 + i32.add + f32.reinterpret_i32 + f32.const 1 + f32.sub + local.set $1 + end + local.get $1 + f32.const 2 + local.get $1 + f32.add + f32.div + local.tee $4 + local.get $4 + f32.mul + local.tee $6 + local.get $6 + f32.mul + local.set $0 + local.get $4 + f32.const 0.5 + local.get $1 + f32.mul + local.get $1 + f32.mul + local.tee $4 + local.get $6 + f32.const 0.6666666269302368 + local.get $0 + f32.const 0.2849878668785095 + f32.mul + f32.add + f32.mul + local.get $0 + f32.const 0.40000972151756287 + local.get $0 + f32.const 0.24279078841209412 + f32.mul + f32.add + f32.mul + f32.add + f32.add + f32.mul + local.get $3 + f32.convert_i32_s + local.tee $0 + f32.const 9.05800061445916e-06 + f32.mul + local.get $5 + f32.add + f32.add + local.get $4 + f32.sub + local.get $1 + f32.add + local.get $0 + f32.const 0.6931381225585938 + f32.mul + f32.add + ) + (func $~lib/math/NativeMathf.log (; 67 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + (local $2 f32) + (local $3 f32) + (local $4 i32) + (local $5 f32) + local.get $0 + i32.reinterpret_f32 + local.tee $1 + i32.const 8388608 + i32.lt_u + if (result i32) + i32.const 1 + else + local.get $1 + i32.const 31 + i32.shr_u + end + if + local.get $1 + i32.const 1 + i32.shl + i32.eqz + if + f32.const -1 + local.get $0 + local.get $0 + f32.mul + f32.div + return + end + local.get $1 + i32.const 31 + i32.shr_u + if + local.get $0 + local.get $0 + f32.sub + f32.const 0 + f32.div + return + end + i32.const -25 + local.set $4 + local.get $0 + f32.const 33554432 + f32.mul + i32.reinterpret_f32 + local.set $1 + else + local.get $1 + i32.const 2139095040 + i32.ge_u + if + local.get $0 + return + else + local.get $1 + i32.const 1065353216 + i32.eq + if + f32.const 0 + return + end + end + end + local.get $1 + i32.const 4913933 + i32.add + local.tee $1 + i32.const 8388607 + i32.and + i32.const 1060439283 + i32.add + f32.reinterpret_i32 + f32.const 1 + f32.sub + local.tee $0 + f32.const 2 + local.get $0 + f32.add + f32.div + local.tee $3 + local.get $3 + f32.mul + local.tee $5 + local.get $5 + f32.mul + local.set $2 + local.get $3 + f32.const 0.5 + local.get $0 + f32.mul + local.get $0 + f32.mul + local.tee $3 + local.get $5 + f32.const 0.6666666269302368 + local.get $2 + f32.const 0.2849878668785095 + f32.mul + f32.add + f32.mul + local.get $2 + f32.const 0.40000972151756287 + local.get $2 + f32.const 0.24279078841209412 + f32.mul + f32.add + f32.mul + f32.add + f32.add + f32.mul + local.get $1 + i32.const 23 + i32.shr_s + i32.const 127 + i32.sub + local.get $4 + i32.add + f32.convert_i32_s + local.tee $2 + f32.const 9.05800061445916e-06 + f32.mul + f32.add + local.get $3 + f32.sub + local.get $0 + f32.add + local.get $2 + f32.const 0.6931381225585938 + f32.mul + f32.add + ) + (func $~lib/math/NativeMathf.acosh (; 68 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + local.get $0 + i32.reinterpret_f32 + i32.const 2147483647 + i32.and + local.tee $1 + i32.const 1073741824 + i32.lt_u + if + local.get $0 + f32.const 1 + f32.sub + local.tee $0 + local.get $0 + local.get $0 + f32.const 2 + f32.add + f32.mul + f32.sqrt + f32.add + call $~lib/math/NativeMathf.log1p + return + end + local.get $1 + i32.const 1166016512 + i32.lt_u + if + f32.const 2 + local.get $0 + f32.mul + f32.const 1 + local.get $0 + local.get $0 + local.get $0 + f32.mul + f32.const 1 + f32.sub + f32.sqrt + f32.add + f32.div + f32.sub + call $~lib/math/NativeMathf.log + return + end + local.get $0 + call $~lib/math/NativeMathf.log + f32.const 0.6931471824645996 + f32.add + ) + (func $../../lib/libm/assembly/libmf/acosh (; 69 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.acosh + ) + (func $~lib/math/NativeMathf.asin (; 70 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + (local $2 f32) + (local $3 f64) + local.get $0 + i32.reinterpret_f32 + i32.const 2147483647 + i32.and + local.tee $1 + i32.const 1065353216 + i32.ge_u + if + local.get $1 + i32.const 1065353216 + i32.eq + if + local.get $0 + f32.const 1.5707963705062866 + f32.mul + f32.const 7.52316384526264e-37 + f32.add + return + end + f32.const 0 + local.get $0 + local.get $0 + f32.sub + f32.div + return + end + local.get $1 + i32.const 1056964608 + i32.lt_u + if + local.get $1 + i32.const 8388608 + i32.ge_u + i32.const 0 + local.get $1 + i32.const 964689920 + i32.lt_u + select + if + local.get $0 + return + end + local.get $0 + local.get $0 + local.get $0 + local.get $0 + f32.mul + call $~lib/math/Rf + f32.mul + f32.add + return + end + f64.const 1.5707963705062866 + f64.const 2 + f32.const 0.5 + local.get $0 + f32.abs + f32.const 0.5 + f32.mul + f32.sub + local.tee $2 + f64.promote_f32 + f64.sqrt + local.tee $3 + local.get $3 + local.get $2 + call $~lib/math/Rf + f64.promote_f32 + f64.mul + f64.add + f64.mul + f64.sub + f32.demote_f64 + local.get $0 + f32.copysign + ) + (func $../../lib/libm/assembly/libmf/asin (; 71 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.asin + ) + (func $~lib/math/NativeMathf.asinh (; 72 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 f32) + (local $2 i32) + local.get $0 + i32.reinterpret_f32 + i32.const 2147483647 + i32.and + local.tee $2 + f32.reinterpret_i32 + local.set $1 + local.get $2 + i32.const 1166016512 + i32.ge_u + if (result f32) + local.get $1 + call $~lib/math/NativeMathf.log + f32.const 0.6931471824645996 + f32.add + else + local.get $2 + i32.const 1073741824 + i32.ge_u + if (result f32) + f32.const 2 + local.get $1 + f32.mul + f32.const 1 + local.get $1 + local.get $1 + f32.mul + f32.const 1 + f32.add + f32.sqrt + local.get $1 + f32.add + f32.div + f32.add + call $~lib/math/NativeMathf.log + else + local.get $2 + i32.const 964689920 + i32.ge_u + if (result f32) + local.get $1 + local.get $1 + local.get $1 + f32.mul + local.tee $1 + local.get $1 + f32.const 1 + f32.add + f32.sqrt + f32.const 1 + f32.add + f32.div + f32.add + call $~lib/math/NativeMathf.log1p + else + local.get $1 + end + end + end + local.get $0 + f32.copysign + ) + (func $../../lib/libm/assembly/libmf/asinh (; 73 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.asinh + ) + (func $~lib/builtins/isNaN (; 74 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) + local.get $0 + local.get $0 + f32.ne + ) + (func $~lib/math/NativeMathf.atan (; 75 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + (local $2 f32) + (local $3 f32) + (local $4 f32) + local.get $0 + local.set $4 + local.get $0 + i32.reinterpret_f32 + i32.const 2147483647 + i32.and + local.tee $1 + i32.const 1283457024 + i32.ge_u + if + local.get $0 + call $~lib/builtins/isNaN + if + local.get $0 + return + end + f32.const 1.570796251296997 + local.get $4 + f32.copysign + return + end + local.get $1 + i32.const 1054867456 + i32.lt_u + if + local.get $1 + i32.const 964689920 + i32.lt_u + if + local.get $0 + return + end + i32.const -1 + local.set $1 + else + local.get $0 + f32.abs + local.set $0 + local.get $1 + i32.const 1066926080 + i32.lt_u + if (result f32) + local.get $1 + i32.const 1060110336 + i32.lt_u + if (result f32) + i32.const 0 + local.set $1 + f32.const 2 + local.get $0 + f32.mul + f32.const 1 + f32.sub + f32.const 2 + local.get $0 + f32.add + f32.div + else + i32.const 1 + local.set $1 + local.get $0 + f32.const 1 + f32.sub + local.get $0 + f32.const 1 + f32.add + f32.div + end + else + local.get $1 + i32.const 1075576832 + i32.lt_u + if (result f32) + i32.const 2 + local.set $1 + local.get $0 + f32.const 1.5 + f32.sub + f32.const 1 + f32.const 1.5 + local.get $0 + f32.mul + f32.add + f32.div + else + i32.const 3 + local.set $1 + f32.const -1 + local.get $0 + f32.div + end + end + local.set $0 + end + local.get $0 + local.get $0 + f32.mul + local.tee $2 + local.get $2 + f32.mul + local.set $3 + local.get $0 + local.get $2 + f32.const 0.333333283662796 + local.get $3 + f32.const 0.14253635704517365 + local.get $3 + f32.const 0.06168760731816292 + f32.mul + f32.add + f32.mul + f32.add + f32.mul + local.get $3 + f32.const -0.19999158382415771 + local.get $3 + f32.const -0.106480173766613 + f32.mul + f32.add + f32.mul + f32.add + f32.mul + local.set $2 + local.get $1 + i32.const 0 + i32.lt_s + if + local.get $0 + local.get $2 + f32.sub + return + end + block $break|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + local.get $1 + if + block $tablify|0 + local.get $1 + i32.const 1 + i32.sub + br_table $case1|0 $case2|0 $case3|0 $tablify|0 + end + br $case4|0 + end + f32.const 0.46364760398864746 + local.get $2 + f32.const 5.01215824399992e-09 + f32.sub + local.get $0 + f32.sub + f32.sub + local.set $0 + br $break|0 + end + f32.const 0.7853981256484985 + local.get $2 + f32.const 3.774894707930798e-08 + f32.sub + local.get $0 + f32.sub + f32.sub + local.set $0 + br $break|0 + end + f32.const 0.9827936887741089 + local.get $2 + f32.const 3.447321716976148e-08 + f32.sub + local.get $0 + f32.sub + f32.sub + local.set $0 + br $break|0 + end + f32.const 1.570796251296997 + local.get $2 + f32.const 7.549789415861596e-08 + f32.sub + local.get $0 + f32.sub + f32.sub + local.set $0 + br $break|0 + end + unreachable + end + local.get $0 + local.get $4 + f32.copysign + ) + (func $../../lib/libm/assembly/libmf/atan (; 76 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.atan + ) + (func $~lib/math/NativeMathf.atanh (; 77 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 f32) + (local $2 i32) + local.get $0 + i32.reinterpret_f32 + i32.const 2147483647 + i32.and + local.tee $2 + f32.reinterpret_i32 + local.set $1 + local.get $2 + i32.const 1056964608 + i32.lt_u + if (result f32) + local.get $2 + i32.const 796917760 + i32.ge_u + if (result f32) + f32.const 0.5 + f32.const 2 + local.get $1 + f32.mul + f32.const 1 + local.get $1 + f32.const 1 + local.get $1 + f32.sub + f32.div + f32.add + f32.mul + call $~lib/math/NativeMathf.log1p + f32.mul + else + local.get $1 + end + else + f32.const 0.5 + f32.const 2 + local.get $1 + f32.const 1 + local.get $1 + f32.sub + f32.div + f32.mul + call $~lib/math/NativeMathf.log1p + f32.mul + end + local.get $0 + f32.copysign + ) + (func $../../lib/libm/assembly/libmf/atanh (; 78 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.atanh + ) + (func $~lib/math/NativeMathf.atan2 (; 79 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $1 + call $~lib/builtins/isNaN + if (result i32) + i32.const 1 + else + local.get $0 + call $~lib/builtins/isNaN + end + if + local.get $1 + local.get $0 + f32.add + return + end + local.get $0 + i32.reinterpret_f32 + local.set $3 + local.get $1 + i32.reinterpret_f32 + local.tee $4 + i32.const 1065353216 + i32.eq + if + local.get $0 + call $~lib/math/NativeMathf.atan + return + end + local.get $4 + i32.const 30 + i32.shr_u + i32.const 2 + i32.and + local.get $3 + i32.const 31 + i32.shr_u + i32.or + local.set $2 + local.get $4 + i32.const 2147483647 + i32.and + local.set $4 + local.get $3 + i32.const 2147483647 + i32.and + local.tee $3 + i32.eqz + if + block $break|0 + block $case3|0 + block $case2|0 + local.get $2 + i32.eqz + local.get $2 + i32.const 1 + i32.eq + i32.or + i32.eqz + if + local.get $2 + i32.const 2 + i32.eq + br_if $case2|0 + local.get $2 + i32.const 3 + i32.eq + br_if $case3|0 + br $break|0 + end + local.get $0 + return + end + f32.const 3.1415927410125732 + return + end + f32.const -3.1415927410125732 + return + end + end + block $folding-inner0 + local.get $4 + i32.eqz + br_if $folding-inner0 + local.get $4 + i32.const 2139095040 + i32.eq + if + local.get $3 + i32.const 2139095040 + i32.eq + if + block $break|1 + block $case3|1 + block $case2|1 + block $case1|1 + local.get $2 + if + block $tablify|0 + local.get $2 + i32.const 1 + i32.sub + br_table $case1|1 $case2|1 $case3|1 $tablify|0 + end + br $break|1 + end + f32.const 0.7853981852531433 + return + end + f32.const -0.7853981852531433 + return + end + f32.const 2.356194496154785 + return + end + f32.const -2.356194496154785 + return + end + else + block $break|2 + block $case3|2 + block $case2|2 + block $case1|2 + local.get $2 + if + block $tablify|00 + local.get $2 + i32.const 1 + i32.sub + br_table $case1|2 $case2|2 $case3|2 $tablify|00 + end + br $break|2 + end + f32.const 0 + return + end + f32.const 0 + return + end + f32.const 3.1415927410125732 + return + end + f32.const -3.1415927410125732 + return + end + end + end + i32.const 1 + local.get $3 + i32.const 2139095040 + i32.eq + local.get $4 + i32.const 218103808 + i32.add + local.get $3 + i32.lt_u + select + br_if $folding-inner0 + local.get $3 + i32.const 218103808 + i32.add + local.get $4 + i32.lt_u + i32.const 0 + local.get $2 + i32.const 2 + i32.and + select + if (result f32) + f32.const 0 + else + local.get $0 + local.get $1 + f32.div + f32.abs + call $~lib/math/NativeMathf.atan + end + local.set $0 + block $break|3 + block $case3|3 + block $case2|3 + block $case1|3 + local.get $2 + if + block $tablify|01 + local.get $2 + i32.const 1 + i32.sub + br_table $case1|3 $case2|3 $case3|3 $tablify|01 + end + br $break|3 + end + local.get $0 + return + end + local.get $0 + f32.neg + return + end + f32.const 3.1415927410125732 + local.get $0 + f32.const -8.742277657347586e-08 + f32.sub + f32.sub + return + end + local.get $0 + f32.const -8.742277657347586e-08 + f32.sub + f32.const 3.1415927410125732 + f32.sub + return + end + unreachable + end + f32.const -1.5707963705062866 + f32.const 1.5707963705062866 + local.get $2 + i32.const 1 + i32.and + select + ) + (func $../../lib/libm/assembly/libmf/atan2 (; 80 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + local.get $0 + local.get $1 + call $~lib/math/NativeMathf.atan2 + ) + (func $~lib/math/NativeMathf.cbrt (; 81 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 f64) + (local $2 f64) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.reinterpret_f32 + local.tee $4 + i32.const 2147483647 + i32.and + local.tee $3 + i32.const 2139095040 + i32.ge_u + if + local.get $0 + local.get $0 + f32.add + return + end + local.get $3 + i32.const 8388608 + i32.lt_u + if (result i32) + local.get $3 + i32.eqz + if + local.get $0 + return + end + local.get $0 + f32.const 16777216 + f32.mul + i32.reinterpret_f32 + local.tee $4 + i32.const 2147483647 + i32.and + i32.const 3 + i32.div_u + i32.const 642849266 + i32.add + else + local.get $3 + i32.const 3 + i32.div_u + i32.const 709958130 + i32.add + end + local.get $4 + i32.const -2147483648 + i32.and + i32.or + f32.reinterpret_i32 + f64.promote_f32 + local.tee $1 + local.get $1 + f64.mul + local.get $1 + f64.mul + local.set $2 + local.get $1 + local.get $0 + f64.promote_f32 + local.get $0 + f64.promote_f32 + f64.add + local.get $2 + f64.add + f64.mul + local.get $0 + f64.promote_f32 + local.get $2 + f64.add + local.get $2 + f64.add + f64.div + local.tee $1 + local.get $1 + f64.mul + local.get $1 + f64.mul + local.set $2 + local.get $1 + local.get $0 + f64.promote_f32 + local.get $0 + f64.promote_f32 + f64.add + local.get $2 + f64.add + f64.mul + local.get $0 + f64.promote_f32 + local.get $2 + f64.add + local.get $2 + f64.add + f64.div + f32.demote_f64 + ) + (func $../../lib/libm/assembly/libmf/cbrt (; 82 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.cbrt + ) + (func $../../lib/libm/assembly/libmf/ceil (; 83 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + f32.ceil + ) + (func $~lib/builtins/isFinite (; 84 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) + local.get $0 + local.get $0 + f32.sub + f32.const 0 + f32.eq + ) + (func $~lib/math/NativeMathf.clz32 (; 85 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/builtins/isFinite + i32.eqz + if + f32.const 32 + return + end + local.get $0 + f32.const 4294967296 + local.get $0 + f32.const 2.3283064365386963e-10 + f32.mul + f32.floor + f32.mul + f32.sub + i64.trunc_f32_s + i32.wrap_i64 + i32.clz + f32.convert_i32_s + ) + (func $../../lib/libm/assembly/libmf/clz32 (; 86 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.clz32 + ) + (func $~lib/array/Array#__unchecked_get (; 87 ;) (type $FUNCSIG$ji) (param $0 i32) (result i64) + i32.const 76 + i32.load + local.get $0 + i32.const 3 + i32.shl + i32.add + i64.load + ) + (func $~lib/math/NativeMathf.cos (; 88 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 f64) + (local $2 i32) + (local $3 f64) + (local $4 i32) + (local $5 i64) + (local $6 i64) + (local $7 i32) + (local $8 i32) + (local $9 i64) + (local $10 i64) + local.get $0 + i32.reinterpret_f32 + local.tee $2 + i32.const 31 + i32.shr_u + local.set $8 + local.get $2 + i32.const 2147483647 + i32.and + local.tee $2 + i32.const 1061752794 + i32.le_u + if + local.get $2 + i32.const 964689920 + i32.lt_u + if + f32.const 1 + return + end + local.get $0 + f64.promote_f32 + local.tee $1 + local.get $1 + f64.mul + local.tee $1 + local.get $1 + f64.mul + local.set $3 + f64.const 1 + local.get $1 + f64.const -0.499999997251031 + f64.mul + f64.add + local.get $3 + f64.const 0.04166662332373906 + f64.mul + f64.add + local.get $3 + local.get $1 + f64.mul + f64.const -0.001388676377460993 + local.get $1 + f64.const 2.439044879627741e-05 + f64.mul + f64.add + f64.mul + f64.add + f32.demote_f64 + return + end + local.get $2 + i32.const 2139095040 + i32.ge_u + if + local.get $0 + local.get $0 + f32.sub + return + end + block $~lib/math/rempio2f|inlined.0 (result i32) + local.get $2 + i32.const 1305022427 + i32.lt_u + if + local.get $0 + f64.promote_f32 + local.get $0 + f64.promote_f32 + f64.const 0.6366197723675814 + f64.mul + f64.nearest + local.tee $1 + f64.const 1.5707963109016418 + f64.mul + f64.sub + local.get $1 + f64.const 1.5893254773528196e-08 + f64.mul + f64.sub + global.set $~lib/math/rempio2f_y + local.get $1 + i32.trunc_f64_s + br $~lib/math/rempio2f|inlined.0 + end + local.get $2 + i32.const 23 + i32.shr_s + i32.const 152 + i32.sub + local.tee $4 + i32.const 6 + i32.shr_s + local.tee $7 + call $~lib/array/Array#__unchecked_get + local.set $9 + local.get $7 + i32.const 1 + i32.add + call $~lib/array/Array#__unchecked_get + local.set $5 + local.get $4 + i32.const 63 + i32.and + local.tee $4 + i32.const 32 + i32.gt_s + if (result i64) + local.get $5 + local.get $4 + i32.const 32 + i32.sub + i64.extend_i32_s + i64.shl + local.get $7 + i32.const 2 + i32.add + call $~lib/array/Array#__unchecked_get + i64.const 96 + local.get $4 + i64.extend_i32_s + i64.sub + i64.shr_u + i64.or + else + local.get $5 + i64.const 32 + local.get $4 + i64.extend_i32_s + i64.sub + i64.shr_u + end + local.set $6 + f64.const 8.515303950216386e-20 + local.get $0 + f64.promote_f32 + f64.copysign + local.get $2 + i32.const 8388607 + i32.and + i32.const 8388608 + i32.or + i64.extend_i32_s + local.tee $10 + local.get $9 + local.get $4 + i64.extend_i32_s + i64.shl + local.get $5 + i64.const 64 + local.get $4 + i64.extend_i32_s + i64.sub + i64.shr_u + i64.or + i64.mul + local.get $6 + local.get $10 + i64.mul + i64.const 32 + i64.shr_u + i64.add + local.tee $5 + i64.const 2 + i64.shl + local.tee $6 + f64.convert_i64_s + f64.mul + global.set $~lib/math/rempio2f_y + i32.const 0 + local.get $5 + i64.const 62 + i64.shr_u + local.get $6 + i64.const 63 + i64.shr_u + i64.add + i32.wrap_i64 + local.tee $2 + i32.sub + local.get $2 + local.get $8 + select + end + local.set $2 + global.get $~lib/math/rempio2f_y + local.set $1 + local.get $2 + i32.const 1 + i32.and + if (result f32) + local.get $1 + local.get $1 + local.get $1 + f64.mul + local.tee $3 + local.get $1 + f64.mul + local.tee $1 + f64.const -0.16666666641626524 + local.get $3 + f64.const 0.008333329385889463 + f64.mul + f64.add + f64.mul + f64.add + local.get $1 + local.get $3 + local.get $3 + f64.mul + f64.mul + f64.const -1.9839334836096632e-04 + local.get $3 + f64.const 2.718311493989822e-06 + f64.mul + f64.add + f64.mul + f64.add + f32.demote_f64 + else + local.get $1 + local.get $1 + f64.mul + local.tee $1 + local.get $1 + f64.mul + local.set $3 + f64.const 1 + local.get $1 + f64.const -0.499999997251031 + f64.mul + f64.add + local.get $3 + f64.const 0.04166662332373906 + f64.mul + f64.add + local.get $3 + local.get $1 + f64.mul + f64.const -0.001388676377460993 + local.get $1 + f64.const 2.439044879627741e-05 + f64.mul + f64.add + f64.mul + f64.add + f32.demote_f64 + end + local.set $0 + local.get $2 + i32.const 1 + i32.add + i32.const 2 + i32.and + if + local.get $0 + f32.neg + local.set $0 + end + local.get $0 + ) + (func $../../lib/libm/assembly/libmf/cos (; 89 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.cos + ) + (func $~lib/math/NativeMathf.expm1 (; 90 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + (local $2 f32) + (local $3 f32) + (local $4 f32) + (local $5 i32) + (local $6 f32) + local.get $0 + i32.reinterpret_f32 + local.tee $1 + i32.const 31 + i32.shr_u + local.set $5 + local.get $1 + i32.const 2147483647 + i32.and + local.tee $1 + i32.const 1100331076 + i32.ge_u + if + local.get $1 + i32.const 2139095040 + i32.gt_u + if + local.get $0 + return + end + local.get $5 + if + f32.const -1 + return + end + local.get $0 + f32.const 88.7216796875 + f32.gt + if + local.get $0 + f32.const 1701411834604692317316873e14 + f32.mul + return + end + end + local.get $1 + i32.const 1051816472 + i32.gt_u + if + local.get $0 + i32.const 1 + local.get $5 + i32.const 1 + i32.shl + i32.sub + f32.const 1.4426950216293335 + local.get $0 + f32.mul + f32.const 0.5 + local.get $0 + f32.copysign + f32.add + i32.trunc_f32_s + local.get $1 + i32.const 1065686418 + i32.lt_u + select + local.tee $1 + f32.convert_i32_s + local.tee $0 + f32.const 0.6931381225585938 + f32.mul + f32.sub + local.tee $2 + local.get $2 + local.get $0 + f32.const 9.05800061445916e-06 + f32.mul + local.tee $2 + f32.sub + local.tee $0 + f32.sub + local.get $2 + f32.sub + local.set $4 + else + local.get $1 + i32.const 855638016 + i32.lt_u + if (result i32) + local.get $0 + return + else + i32.const 0 + end + local.set $1 + end + f32.const 3 + f32.const 1 + local.get $0 + f32.const 0.5 + local.get $0 + f32.mul + local.tee $3 + f32.mul + local.tee $2 + f32.const -0.03333321213722229 + local.get $2 + f32.const 1.5807170420885086e-03 + f32.mul + f32.add + f32.mul + f32.add + local.tee $6 + local.get $3 + f32.mul + f32.sub + local.set $3 + local.get $2 + local.get $6 + local.get $3 + f32.sub + f32.const 6 + local.get $0 + local.get $3 + f32.mul + f32.sub + f32.div + f32.mul + local.set $3 + local.get $1 + i32.eqz + if + local.get $0 + local.get $0 + local.get $3 + f32.mul + local.get $2 + f32.sub + f32.sub + return + end + local.get $0 + local.get $3 + local.get $4 + f32.sub + f32.mul + local.get $4 + f32.sub + local.get $2 + f32.sub + local.set $2 + local.get $1 + i32.const -1 + i32.eq + if + f32.const 0.5 + local.get $0 + local.get $2 + f32.sub + f32.mul + f32.const 0.5 + f32.sub + return + end + local.get $1 + i32.const 1 + i32.eq + if + local.get $0 + f32.const -0.25 + f32.lt + if + f32.const -2 + local.get $2 + local.get $0 + f32.const 0.5 + f32.add + f32.sub + f32.mul + return + end + f32.const 1 + f32.const 2 + local.get $0 + local.get $2 + f32.sub + f32.mul + f32.add + return + end + local.get $1 + i32.const 127 + i32.add + i32.const 23 + i32.shl + f32.reinterpret_i32 + local.set $4 + i32.const 1 + local.get $1 + i32.const 56 + i32.gt_s + local.get $1 + i32.const 0 + i32.lt_s + select + if + local.get $0 + local.get $2 + f32.sub + f32.const 1 + f32.add + local.set $0 + local.get $0 + f32.const 2 + f32.mul + f32.const 1701411834604692317316873e14 + f32.mul + local.get $0 + local.get $4 + f32.mul + local.get $1 + i32.const 128 + i32.eq + select + f32.const 1 + f32.sub + return + end + i32.const 127 + local.get $1 + i32.sub + i32.const 23 + i32.shl + f32.reinterpret_i32 + local.set $3 + local.get $0 + f32.const 1 + local.get $3 + f32.sub + local.get $2 + f32.sub + f32.const 1 + local.get $2 + local.get $3 + f32.add + f32.sub + local.get $1 + i32.const 20 + i32.lt_s + select + f32.add + local.get $4 + f32.mul + ) + (func $~lib/math/NativeMathf.scalbn (; 91 ;) (type $FUNCSIG$ffi) (param $0 f32) (param $1 i32) (result f32) + local.get $1 + i32.const 127 + i32.gt_s + if (result f32) + local.get $0 + f32.const 1701411834604692317316873e14 + f32.mul + local.set $0 + local.get $1 + i32.const 127 + i32.sub + local.tee $1 + i32.const 127 + i32.gt_s + if (result f32) + local.get $1 + i32.const 127 + i32.sub + local.tee $1 + i32.const 127 + local.get $1 + i32.const 127 + i32.lt_s + select + local.set $1 + local.get $0 + f32.const 1701411834604692317316873e14 + f32.mul + else + local.get $0 + end + else + local.get $1 + i32.const -126 + i32.lt_s + if (result f32) + local.get $0 + f32.const 1.9721522630525295e-31 + f32.mul + local.set $0 + local.get $1 + i32.const 102 + i32.add + local.tee $1 + i32.const -126 + i32.lt_s + if (result f32) + local.get $1 + i32.const 102 + i32.add + local.tee $1 + i32.const -126 + local.get $1 + i32.const -126 + i32.gt_s + select + local.set $1 + local.get $0 + f32.const 1.9721522630525295e-31 + f32.mul + else + local.get $0 + end + else + local.get $0 + end + end + local.get $1 + i32.const 127 + i32.add + i32.const 23 + i32.shl + f32.reinterpret_i32 + f32.mul + ) + (func $~lib/math/NativeMathf.exp (; 92 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + (local $2 i32) + (local $3 f32) + (local $4 f32) + local.get $0 + i32.reinterpret_f32 + local.tee $1 + i32.const 31 + i32.shr_u + local.set $2 + local.get $1 + i32.const 2147483647 + i32.and + local.tee $1 + i32.const 1118743632 + i32.ge_u + if + local.get $1 + i32.const 1118925336 + i32.ge_u + if + local.get $2 + if + local.get $1 + i32.const 1120924085 + i32.ge_u + if + f32.const 0 + return + end + else + local.get $0 + f32.const 1701411834604692317316873e14 + f32.mul + return + end + end + end + local.get $1 + i32.const 1051816472 + i32.gt_u + if + local.get $0 + local.get $1 + i32.const 1065686418 + i32.gt_u + if (result i32) + f32.const 1.4426950216293335 + local.get $0 + f32.mul + f32.const 0.5 + local.get $0 + f32.copysign + f32.add + i32.trunc_f32_s + else + i32.const 1 + local.get $2 + i32.const 1 + i32.shl + i32.sub + end + local.tee $1 + f32.convert_i32_s + f32.const 0.693145751953125 + f32.mul + f32.sub + local.tee $3 + local.get $1 + f32.convert_i32_s + f32.const 1.428606765330187e-06 + f32.mul + local.tee $4 + f32.sub + local.set $0 + else + local.get $1 + i32.const 956301312 + i32.gt_u + if (result f32) + i32.const 0 + local.set $1 + local.get $0 + else + f32.const 1 + local.get $0 + f32.add + return + end + local.set $3 + end + f32.const 1 + local.get $0 + local.get $0 + local.get $0 + local.get $0 + f32.mul + local.tee $0 + f32.const 0.16666625440120697 + local.get $0 + f32.const -2.7667332906275988e-03 + f32.mul + f32.add + f32.mul + f32.sub + local.tee $0 + f32.mul + f32.const 2 + local.get $0 + f32.sub + f32.div + local.get $4 + f32.sub + local.get $3 + f32.add + f32.add + local.set $0 + local.get $1 + i32.eqz + if + local.get $0 + return + end + local.get $0 + local.get $1 + call $~lib/math/NativeMathf.scalbn + ) + (func $~lib/math/NativeMathf.cosh (; 93 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + local.get $0 + i32.reinterpret_f32 + i32.const 2147483647 + i32.and + local.tee $1 + f32.reinterpret_i32 + local.set $0 + local.get $1 + i32.const 1060205079 + i32.lt_u + if + local.get $1 + i32.const 964689920 + i32.lt_u + if + f32.const 1 + return + end + f32.const 1 + local.get $0 + call $~lib/math/NativeMathf.expm1 + local.tee $0 + local.get $0 + f32.mul + f32.const 2 + f32.const 2 + local.get $0 + f32.mul + f32.add + f32.div + f32.add + return + end + local.get $1 + i32.const 1118925335 + i32.lt_u + if + f32.const 0.5 + local.get $0 + call $~lib/math/NativeMathf.exp + local.tee $0 + f32.mul + f32.const 0.5 + local.get $0 + f32.div + f32.add + return + end + local.get $0 + f32.const 162.88958740234375 + f32.sub + call $~lib/math/NativeMathf.exp + f32.const 1661534994731144841129758e11 + f32.mul + f32.const 1661534994731144841129758e11 + f32.mul + ) + (func $../../lib/libm/assembly/libmf/cosh (; 94 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.cosh + ) + (func $../../lib/libm/assembly/libmf/exp (; 95 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.exp + ) + (func $../../lib/libm/assembly/libmf/expm1 (; 96 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.expm1 + ) + (func $../../lib/libm/assembly/libmf/floor (; 97 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + f32.floor + ) + (func $../../lib/libm/assembly/libmf/fround (; 98 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + ) + (func $~lib/math/NativeMathf.hypot (; 99 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + (local $2 i32) + (local $3 i32) + (local $4 f32) + (local $5 i32) + local.get $0 + i32.reinterpret_f32 + i32.const 2147483647 + i32.and + local.tee $3 + local.get $1 + i32.reinterpret_f32 + i32.const 2147483647 + i32.and + local.tee $2 + i32.lt_u + if + local.get $3 + local.set $5 + local.get $2 + local.set $3 + local.get $5 + local.set $2 + end + local.get $3 + f32.reinterpret_i32 + local.set $0 + local.get $2 + f32.reinterpret_i32 + local.set $1 + local.get $2 + i32.const 2139095040 + i32.eq + if + local.get $1 + return + end + i32.const 1 + local.get $3 + local.get $2 + i32.sub + i32.const 209715200 + i32.ge_u + i32.const 1 + local.get $2 + i32.eqz + local.get $3 + i32.const 2139095040 + i32.ge_u + select + select + if + local.get $0 + local.get $1 + f32.add + return + end + f32.const 1 + local.set $4 + local.get $3 + i32.const 1568669696 + i32.ge_u + if (result f32) + f32.const 1237940039285380274899124e3 + local.set $4 + local.get $1 + f32.const 8.077935669463161e-28 + f32.mul + local.set $1 + local.get $0 + f32.const 8.077935669463161e-28 + f32.mul + else + local.get $2 + i32.const 562036736 + i32.lt_u + if (result f32) + f32.const 8.077935669463161e-28 + local.set $4 + local.get $1 + f32.const 1237940039285380274899124e3 + f32.mul + local.set $1 + local.get $0 + f32.const 1237940039285380274899124e3 + f32.mul + else + local.get $0 + end + end + local.set $0 + local.get $4 + local.get $0 + f64.promote_f32 + local.get $0 + f64.promote_f32 + f64.mul + local.get $1 + f64.promote_f32 + local.get $1 + f64.promote_f32 + f64.mul + f64.add + f32.demote_f64 + f32.sqrt + f32.mul + ) + (func $../../lib/libm/assembly/libmf/hypot (; 100 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + local.get $0 + local.get $1 + call $~lib/math/NativeMathf.hypot + ) + (func $../../lib/libm/assembly/libmf/imul (; 101 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + block $~lib/math/NativeMathf.imul|inlined.0 (result f32) + f32.const 0 + local.get $0 + local.get $1 + f32.add + call $~lib/builtins/isFinite + i32.eqz + br_if $~lib/math/NativeMathf.imul|inlined.0 + drop + local.get $0 + f64.promote_f32 + f64.const 4294967296 + local.get $0 + f64.promote_f32 + f64.const 2.3283064365386963e-10 + f64.mul + f64.floor + f64.mul + f64.sub + i64.trunc_f64_s + i32.wrap_i64 + local.get $1 + f64.promote_f32 + f64.const 4294967296 + local.get $1 + f64.promote_f32 + f64.const 2.3283064365386963e-10 + f64.mul + f64.floor + f64.mul + f64.sub + i64.trunc_f64_s + i32.wrap_i64 + i32.mul + f32.convert_i32_s + end + ) + (func $../../lib/libm/assembly/libmf/log (; 102 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.log + ) + (func $~lib/math/NativeMathf.log10 (; 103 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + (local $2 f32) + (local $3 i32) + (local $4 f32) + (local $5 f32) + (local $6 f32) + (local $7 f32) + local.get $0 + i32.reinterpret_f32 + local.tee $1 + i32.const 8388608 + i32.lt_u + if (result i32) + i32.const 1 + else + local.get $1 + i32.const 31 + i32.shr_u + end + if + local.get $1 + i32.const 1 + i32.shl + i32.eqz + if + f32.const -1 + local.get $0 + local.get $0 + f32.mul + f32.div + return + end + local.get $1 + i32.const 31 + i32.shr_u + if + local.get $0 + local.get $0 + f32.sub + f32.const 0 + f32.div + return + end + i32.const -25 + local.set $3 + local.get $0 + f32.const 33554432 + f32.mul + i32.reinterpret_f32 + local.set $1 + else + local.get $1 + i32.const 2139095040 + i32.ge_u + if + local.get $0 + return + else + local.get $1 + i32.const 1065353216 + i32.eq + if + f32.const 0 + return + end + end + end + local.get $1 + i32.const 4913933 + i32.add + local.tee $1 + i32.const 8388607 + i32.and + i32.const 1060439283 + i32.add + f32.reinterpret_i32 + f32.const 1 + f32.sub + local.tee $0 + f32.const 2 + local.get $0 + f32.add + f32.div + local.tee $4 + local.get $4 + f32.mul + local.tee $5 + local.get $5 + f32.mul + local.set $2 + local.get $1 + i32.const 23 + i32.shr_u + i32.const 127 + i32.sub + local.get $3 + i32.add + f32.convert_i32_s + local.tee $7 + f32.const 7.903415166765626e-07 + f32.mul + local.get $0 + local.get $0 + f32.const 0.5 + local.get $0 + f32.mul + local.get $0 + f32.mul + local.tee $0 + f32.sub + i32.reinterpret_f32 + i32.const -4096 + i32.and + f32.reinterpret_i32 + local.tee $6 + f32.sub + local.get $0 + f32.sub + local.get $4 + local.get $0 + local.get $5 + f32.const 0.6666666269302368 + local.get $2 + f32.const 0.2849878668785095 + f32.mul + f32.add + f32.mul + local.get $2 + f32.const 0.40000972151756287 + local.get $2 + f32.const 0.24279078841209412 + f32.mul + f32.add + f32.mul + f32.add + f32.add + f32.mul + f32.add + local.tee $0 + local.get $6 + f32.add + f32.const -3.168997136526741e-05 + f32.mul + f32.add + local.get $0 + f32.const 0.434326171875 + f32.mul + f32.add + local.get $6 + f32.const 0.434326171875 + f32.mul + f32.add + local.get $7 + f32.const 0.3010292053222656 + f32.mul + f32.add + ) + (func $../../lib/libm/assembly/libmf/log10 (; 104 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.log10 + ) + (func $../../lib/libm/assembly/libmf/log1p (; 105 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.log1p + ) + (func $~lib/math/NativeMathf.log2 (; 106 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + (local $2 f32) + (local $3 i32) + (local $4 f32) + (local $5 f32) + (local $6 f32) + local.get $0 + i32.reinterpret_f32 + local.tee $1 + i32.const 8388608 + i32.lt_u + if (result i32) + i32.const 1 + else + local.get $1 + i32.const 31 + i32.shr_u + end + if + local.get $1 + i32.const 1 + i32.shl + i32.eqz + if + f32.const -1 + local.get $0 + local.get $0 + f32.mul + f32.div + return + end + local.get $1 + i32.const 31 + i32.shr_u + if + local.get $0 + local.get $0 + f32.sub + f32.const 0 + f32.div + return + end + i32.const -25 + local.set $3 + local.get $0 + f32.const 33554432 + f32.mul + i32.reinterpret_f32 + local.set $1 + else + local.get $1 + i32.const 2139095040 + i32.ge_u + if + local.get $0 + return + else + local.get $1 + i32.const 1065353216 + i32.eq + if + f32.const 0 + return + end + end + end + local.get $1 + i32.const 4913933 + i32.add + local.tee $1 + i32.const 8388607 + i32.and + i32.const 1060439283 + i32.add + f32.reinterpret_i32 + f32.const 1 + f32.sub + local.tee $0 + f32.const 2 + local.get $0 + f32.add + f32.div + local.tee $4 + local.get $4 + f32.mul + local.tee $5 + local.get $5 + f32.mul + local.set $2 + local.get $0 + local.get $0 + f32.const 0.5 + local.get $0 + f32.mul + local.get $0 + f32.mul + local.tee $0 + f32.sub + i32.reinterpret_f32 + i32.const -4096 + i32.and + f32.reinterpret_i32 + local.tee $6 + f32.sub + local.get $0 + f32.sub + local.get $4 + local.get $0 + local.get $5 + f32.const 0.6666666269302368 + local.get $2 + f32.const 0.2849878668785095 + f32.mul + f32.add + f32.mul + local.get $2 + f32.const 0.40000972151756287 + local.get $2 + f32.const 0.24279078841209412 + f32.mul + f32.add + f32.mul + f32.add + f32.add + f32.mul + f32.add + local.tee $0 + local.get $6 + f32.add + f32.const -1.7605285393074155e-04 + f32.mul + local.get $0 + f32.const 1.44287109375 + f32.mul + f32.add + local.get $6 + f32.const 1.44287109375 + f32.mul + f32.add + local.get $1 + i32.const 23 + i32.shr_u + i32.const 127 + i32.sub + local.get $3 + i32.add + f32.convert_i32_s + f32.add + ) + (func $../../lib/libm/assembly/libmf/log2 (; 107 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.log2 + ) + (func $../../lib/libm/assembly/libmf/max (; 108 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + local.get $0 + local.get $1 + f32.max + ) + (func $../../lib/libm/assembly/libmf/min (; 109 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + local.get $0 + local.get $1 + f32.min + ) + (func $~lib/math/NativeMathf.pow (; 110 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + (local $2 f32) + (local $3 f32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 f32) + (local $8 i32) + (local $9 f32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 f32) + (local $14 f32) + (local $15 f32) + (local $16 f32) + local.get $0 + i32.reinterpret_f32 + local.tee $8 + i32.const 2147483647 + i32.and + local.set $5 + local.get $1 + i32.reinterpret_f32 + local.tee $11 + i32.const 2147483647 + i32.and + local.tee $10 + i32.eqz + if + f32.const 1 + return + end + i32.const 1 + local.get $10 + i32.const 2139095040 + i32.gt_s + local.get $5 + i32.const 2139095040 + i32.gt_s + select + if + local.get $0 + local.get $1 + f32.add + return + end + local.get $8 + i32.const 0 + i32.lt_s + if + local.get $10 + i32.const 1266679808 + i32.ge_s + if (result i32) + i32.const 2 + else + local.get $10 + i32.const 1065353216 + i32.ge_s + if (result i32) + local.get $10 + i32.const 150 + local.get $10 + i32.const 23 + i32.shr_s + i32.sub + local.tee $12 + i32.shr_s + local.tee $6 + local.get $12 + i32.shl + local.get $10 + i32.eq + if (result i32) + i32.const 2 + local.get $6 + i32.const 1 + i32.and + i32.sub + else + i32.const 0 + end + else + i32.const 0 + end + end + local.set $4 + end + local.get $10 + i32.const 2139095040 + i32.eq + if + local.get $5 + i32.const 1065353216 + i32.eq + if + f32.const nan:0x400000 + return + else + local.get $5 + i32.const 1065353216 + i32.gt_s + if + local.get $11 + i32.const 0 + i32.lt_s + if + f32.const 0 + local.set $1 + end + local.get $1 + return + else + f32.const 0 + local.get $1 + f32.neg + local.get $11 + i32.const 0 + i32.ge_s + select + return + end + unreachable + end + unreachable + end + local.get $10 + i32.const 1065353216 + i32.eq + if + local.get $11 + i32.const 0 + i32.lt_s + if + f32.const 1 + local.get $0 + f32.div + local.set $0 + end + local.get $0 + return + end + local.get $11 + i32.const 1073741824 + i32.eq + if + local.get $0 + local.get $0 + f32.mul + return + end + local.get $11 + i32.const 1056964608 + i32.eq + if + local.get $8 + i32.const 0 + i32.ge_s + if + local.get $0 + f32.sqrt + return + end + end + local.get $0 + f32.abs + local.set $3 + i32.const 1 + local.get $5 + i32.const 1065353216 + i32.eq + i32.const 1 + local.get $5 + i32.eqz + local.get $5 + i32.const 2139095040 + i32.eq + select + select + if + f32.const 1 + local.get $3 + f32.div + local.get $3 + local.get $11 + i32.const 0 + i32.lt_s + select + local.set $3 + local.get $8 + i32.const 0 + i32.lt_s + if (result f32) + local.get $5 + i32.const 1065353216 + i32.sub + local.get $4 + i32.or + if (result f32) + local.get $3 + f32.neg + local.get $3 + local.get $4 + i32.const 1 + i32.eq + select + else + local.get $3 + local.get $3 + f32.sub + local.tee $0 + local.get $0 + f32.div + end + else + local.get $3 + end + return + end + f32.const 1 + local.set $7 + local.get $8 + i32.const 0 + i32.lt_s + if + local.get $4 + i32.eqz + if + local.get $0 + local.get $0 + f32.sub + local.tee $0 + local.get $0 + f32.div + return + end + f32.const -1 + f32.const 1 + local.get $4 + i32.const 1 + i32.eq + select + local.set $7 + end + local.get $10 + i32.const 1291845632 + i32.gt_s + if (result f32) + local.get $5 + i32.const 1065353208 + i32.lt_s + if + local.get $7 + f32.const 1000000015047466219876688e6 + f32.mul + f32.const 1000000015047466219876688e6 + f32.mul + local.get $7 + f32.const 1.0000000031710769e-30 + f32.mul + f32.const 1.0000000031710769e-30 + f32.mul + local.get $11 + i32.const 0 + i32.lt_s + select + return + end + local.get $5 + i32.const 1065353223 + i32.gt_s + if + local.get $7 + f32.const 1000000015047466219876688e6 + f32.mul + f32.const 1000000015047466219876688e6 + f32.mul + local.get $7 + f32.const 1.0000000031710769e-30 + f32.mul + f32.const 1.0000000031710769e-30 + f32.mul + local.get $11 + i32.const 0 + i32.gt_s + select + return + end + local.get $3 + f32.const 1 + f32.sub + local.tee $2 + local.get $2 + f32.mul + f32.const 0.5 + local.get $2 + f32.const 0.3333333432674408 + local.get $2 + f32.const 0.25 + f32.mul + f32.sub + f32.mul + f32.sub + f32.mul + local.set $0 + f32.const 1.44268798828125 + local.get $2 + f32.mul + local.tee $3 + local.get $2 + f32.const 7.052607543300837e-06 + f32.mul + local.get $0 + f32.const 1.4426950216293335 + f32.mul + f32.sub + local.tee $0 + f32.add + i32.reinterpret_f32 + i32.const -4096 + i32.and + f32.reinterpret_i32 + local.set $9 + local.get $0 + local.get $9 + local.get $3 + f32.sub + f32.sub + else + i32.const 0 + local.set $4 + local.get $5 + i32.const 8388608 + i32.lt_s + if (result i32) + local.get $3 + f32.const 16777216 + f32.mul + i32.reinterpret_f32 + local.set $5 + i32.const -24 + else + i32.const 0 + end + local.get $5 + i32.const 23 + i32.shr_s + i32.const 127 + i32.sub + i32.add + local.set $4 + local.get $5 + i32.const 8388607 + i32.and + local.tee $6 + i32.const 1065353216 + i32.or + local.set $5 + local.get $6 + i32.const 1885297 + i32.le_s + if (result i32) + i32.const 0 + else + local.get $6 + i32.const 6140887 + i32.lt_s + if (result i32) + i32.const 1 + else + local.get $4 + i32.const 1 + i32.add + local.set $4 + local.get $5 + i32.const 8388608 + i32.sub + local.set $5 + i32.const 0 + end + end + local.set $6 + local.get $5 + f32.reinterpret_i32 + local.tee $3 + f32.const 1.5 + f32.const 1 + local.get $6 + select + local.tee $0 + f32.sub + local.tee $9 + f32.const 1 + local.get $3 + local.get $0 + f32.add + f32.div + local.tee $2 + f32.mul + local.tee $15 + i32.reinterpret_f32 + i32.const -4096 + i32.and + f32.reinterpret_i32 + local.set $13 + local.get $3 + local.get $5 + i32.const 1 + i32.shr_s + i32.const -4096 + i32.and + i32.const 536870912 + i32.or + i32.const 4194304 + i32.add + local.get $6 + i32.const 21 + i32.shl + i32.add + f32.reinterpret_i32 + local.tee $3 + local.get $0 + f32.sub + f32.sub + local.set $0 + f32.const 0.9619140625 + local.get $13 + f32.const 3 + local.get $13 + local.get $13 + f32.mul + local.tee $16 + f32.add + local.get $15 + local.get $15 + f32.mul + local.tee $14 + local.get $14 + f32.mul + f32.const 0.6000000238418579 + local.get $14 + f32.const 0.4285714328289032 + local.get $14 + f32.const 0.3333333432674408 + local.get $14 + f32.const 0.2727281153202057 + local.get $14 + f32.const 0.23066075146198273 + local.get $14 + f32.const 0.20697501301765442 + f32.mul + f32.add + f32.mul + f32.add + f32.mul + f32.add + f32.mul + f32.add + f32.mul + f32.add + f32.mul + local.get $2 + local.get $9 + local.get $13 + local.get $3 + f32.mul + f32.sub + local.get $13 + local.get $0 + f32.mul + f32.sub + f32.mul + local.tee $2 + local.get $13 + local.get $15 + f32.add + f32.mul + f32.add + local.tee $0 + f32.add + i32.reinterpret_f32 + i32.const -4096 + i32.and + f32.reinterpret_i32 + local.tee $9 + f32.mul + local.tee $3 + local.get $2 + local.get $9 + f32.mul + local.get $0 + local.get $9 + f32.const 3 + f32.sub + local.get $16 + f32.sub + f32.sub + local.get $15 + f32.mul + f32.add + local.tee $0 + f32.add + i32.reinterpret_f32 + i32.const -4096 + i32.and + f32.reinterpret_i32 + local.tee $2 + f32.mul + local.tee $16 + f32.const -1.1736857413779944e-04 + local.get $2 + f32.mul + local.get $0 + local.get $2 + local.get $3 + f32.sub + f32.sub + f32.const 0.9617967009544373 + f32.mul + f32.add + f32.const 1.5632208487659227e-06 + f32.const 0 + local.get $6 + select + f32.add + local.tee $2 + f32.add + f32.const 0.5849609375 + f32.const 0 + local.get $6 + select + local.tee $3 + f32.add + local.get $4 + f32.convert_i32_s + local.tee $0 + f32.add + i32.reinterpret_f32 + i32.const -4096 + i32.and + f32.reinterpret_i32 + local.set $9 + local.get $2 + local.get $9 + local.get $0 + f32.sub + local.get $3 + f32.sub + local.get $16 + f32.sub + f32.sub + end + local.set $3 + block $folding-inner1 + block $folding-inner0 + local.get $1 + local.get $1 + i32.reinterpret_f32 + i32.const -4096 + i32.and + f32.reinterpret_i32 + local.tee $0 + f32.sub + local.get $9 + f32.mul + local.get $1 + local.get $3 + f32.mul + f32.add + local.tee $1 + local.get $0 + local.get $9 + f32.mul + local.tee $2 + f32.add + local.tee $0 + i32.reinterpret_f32 + local.tee $8 + i32.const 1124073472 + i32.gt_s + br_if $folding-inner0 + local.get $8 + i32.const 1124073472 + i32.eq + if + local.get $1 + f32.const 4.299566569443414e-08 + f32.add + local.get $0 + local.get $2 + f32.sub + f32.gt + br_if $folding-inner0 + else + local.get $8 + i32.const 2147483647 + i32.and + i32.const 1125515264 + i32.gt_s + if + br $folding-inner1 + else + local.get $8 + i32.const -1021968384 + i32.eq + if + local.get $1 + local.get $0 + local.get $2 + f32.sub + f32.le + br_if $folding-inner1 + end + end + end + local.get $8 + i32.const 2147483647 + i32.and + local.tee $12 + i32.const 23 + i32.shr_s + i32.const 127 + i32.sub + local.set $6 + i32.const 0 + local.set $4 + local.get $12 + i32.const 1056964608 + i32.gt_s + if + i32.const 8388608 + local.get $6 + i32.const 1 + i32.add + i32.shr_s + local.get $8 + i32.add + local.tee $12 + i32.const 2147483647 + i32.and + i32.const 23 + i32.shr_s + i32.const 127 + i32.sub + local.set $6 + i32.const 8388607 + local.get $6 + i32.shr_s + i32.const -1 + i32.xor + local.get $12 + i32.and + f32.reinterpret_i32 + local.set $0 + local.get $12 + i32.const 8388607 + i32.and + i32.const 8388608 + i32.or + i32.const 23 + local.get $6 + i32.sub + i32.shr_s + local.set $4 + i32.const 0 + local.get $4 + i32.sub + local.get $4 + local.get $8 + i32.const 0 + i32.lt_s + select + local.set $4 + local.get $2 + local.get $0 + f32.sub + local.set $2 + end + local.get $1 + local.get $2 + f32.add + i32.reinterpret_f32 + i32.const -32768 + i32.and + f32.reinterpret_i32 + local.tee $0 + f32.const 0.693145751953125 + f32.mul + local.tee $3 + local.get $1 + local.get $0 + local.get $2 + f32.sub + f32.sub + f32.const 0.6931471824645996 + f32.mul + local.get $0 + f32.const 1.4286065379565116e-06 + f32.mul + f32.add + local.tee $1 + f32.add + local.tee $2 + local.get $2 + f32.mul + local.set $0 + local.get $7 + f32.const 1 + local.get $2 + local.get $2 + local.get $0 + f32.const 0.1666666716337204 + local.get $0 + f32.const -2.7777778450399637e-03 + local.get $0 + f32.const 6.61375597701408e-05 + local.get $0 + f32.const -1.6533901998627698e-06 + local.get $0 + f32.const 4.138136944220605e-08 + f32.mul + f32.add + f32.mul + f32.add + f32.mul + f32.add + f32.mul + f32.add + f32.mul + f32.sub + local.tee $0 + f32.mul + local.get $0 + f32.const 2 + f32.sub + f32.div + local.get $1 + local.get $2 + local.get $3 + f32.sub + f32.sub + local.tee $0 + local.get $2 + local.get $0 + f32.mul + f32.add + f32.sub + local.get $2 + f32.sub + f32.sub + local.tee $0 + i32.reinterpret_f32 + local.get $4 + i32.const 23 + i32.shl + i32.add + local.tee $6 + i32.const 23 + i32.shr_s + i32.const 0 + i32.le_s + if (result f32) + local.get $0 + local.get $4 + call $~lib/math/NativeMathf.scalbn + else + local.get $6 + f32.reinterpret_i32 + end + f32.mul + return + end + local.get $7 + f32.const 1000000015047466219876688e6 + f32.mul + f32.const 1000000015047466219876688e6 + f32.mul + return + end + local.get $7 + f32.const 1.0000000031710769e-30 + f32.mul + f32.const 1.0000000031710769e-30 + f32.mul + ) + (func $../../lib/libm/assembly/libmf/pow (; 111 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + local.get $0 + local.get $1 + call $~lib/math/NativeMathf.pow + ) + (func $../../lib/libm/assembly/libmf/round (; 112 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + f32.const 0.5 + f32.add + f32.floor + local.get $0 + f32.copysign + ) + (func $../../lib/libm/assembly/libmf/sign (; 113 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + f32.abs + f32.const 0 + f32.gt + if + f32.const 1 + local.get $0 + f32.copysign + local.set $0 + end + local.get $0 + ) + (func $~lib/math/NativeMathf.sin (; 114 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 f64) + (local $2 i32) + (local $3 f64) + (local $4 i32) + (local $5 i64) + (local $6 i64) + (local $7 f64) + (local $8 i32) + (local $9 i32) + (local $10 i64) + (local $11 i64) + local.get $0 + i32.reinterpret_f32 + local.tee $2 + i32.const 31 + i32.shr_u + local.set $9 + local.get $2 + i32.const 2147483647 + i32.and + local.tee $2 + i32.const 1061752794 + i32.le_u + if + local.get $2 + i32.const 964689920 + i32.lt_u + if + local.get $0 + return + end + local.get $0 + f64.promote_f32 + local.tee $3 + local.get $3 + f64.mul + local.tee $1 + local.get $3 + f64.mul + local.set $7 + local.get $3 + local.get $7 + f64.const -0.16666666641626524 + local.get $1 + f64.const 0.008333329385889463 + f64.mul + f64.add + f64.mul + f64.add + local.get $7 + local.get $1 + local.get $1 + f64.mul + f64.mul + f64.const -1.9839334836096632e-04 + local.get $1 + f64.const 2.718311493989822e-06 + f64.mul + f64.add + f64.mul + f64.add + f32.demote_f64 + return + end + local.get $2 + i32.const 2139095040 + i32.ge_u + if + local.get $0 + local.get $0 + f32.sub + return + end + block $~lib/math/rempio2f|inlined.1 (result i32) + local.get $2 + i32.const 1305022427 + i32.lt_u + if + local.get $0 + f64.promote_f32 + local.get $0 + f64.promote_f32 + f64.const 0.6366197723675814 + f64.mul + f64.nearest + local.tee $1 + f64.const 1.5707963109016418 + f64.mul + f64.sub + local.get $1 + f64.const 1.5893254773528196e-08 + f64.mul + f64.sub + global.set $~lib/math/rempio2f_y + local.get $1 + i32.trunc_f64_s + br $~lib/math/rempio2f|inlined.1 + end + local.get $2 + i32.const 23 + i32.shr_s + i32.const 152 + i32.sub + local.tee $4 + i32.const 6 + i32.shr_s + local.tee $8 + call $~lib/array/Array#__unchecked_get + local.set $10 + local.get $8 + i32.const 1 + i32.add + call $~lib/array/Array#__unchecked_get + local.set $5 + local.get $4 + i32.const 63 + i32.and + local.tee $4 + i32.const 32 + i32.gt_s + if (result i64) + local.get $5 + local.get $4 + i32.const 32 + i32.sub + i64.extend_i32_s + i64.shl + local.get $8 + i32.const 2 + i32.add + call $~lib/array/Array#__unchecked_get + i64.const 96 + local.get $4 + i64.extend_i32_s + i64.sub + i64.shr_u + i64.or + else + local.get $5 + i64.const 32 + local.get $4 + i64.extend_i32_s + i64.sub + i64.shr_u + end + local.set $6 + f64.const 8.515303950216386e-20 + local.get $0 + f64.promote_f32 + f64.copysign + local.get $2 + i32.const 8388607 + i32.and + i32.const 8388608 + i32.or + i64.extend_i32_s + local.tee $11 + local.get $10 + local.get $4 + i64.extend_i32_s + i64.shl + local.get $5 + i64.const 64 + local.get $4 + i64.extend_i32_s + i64.sub + i64.shr_u + i64.or + i64.mul + local.get $6 + local.get $11 + i64.mul + i64.const 32 + i64.shr_u + i64.add + local.tee $5 + i64.const 2 + i64.shl + local.tee $6 + f64.convert_i64_s + f64.mul + global.set $~lib/math/rempio2f_y + i32.const 0 + local.get $5 + i64.const 62 + i64.shr_u + local.get $6 + i64.const 63 + i64.shr_u + i64.add + i32.wrap_i64 + local.tee $2 + i32.sub + local.get $2 + local.get $9 + select + end + local.set $2 + global.get $~lib/math/rempio2f_y + local.set $1 + local.get $2 + i32.const 1 + i32.and + if (result f32) + local.get $1 + local.get $1 + f64.mul + local.tee $1 + local.get $1 + f64.mul + local.set $3 + f64.const 1 + local.get $1 + f64.const -0.499999997251031 + f64.mul + f64.add + local.get $3 + f64.const 0.04166662332373906 + f64.mul + f64.add + local.get $3 + local.get $1 + f64.mul + f64.const -0.001388676377460993 + local.get $1 + f64.const 2.439044879627741e-05 + f64.mul + f64.add + f64.mul + f64.add + f32.demote_f64 + else + local.get $1 + local.get $1 + local.get $1 + f64.mul + local.tee $3 + local.get $1 + f64.mul + local.tee $1 + f64.const -0.16666666641626524 + local.get $3 + f64.const 0.008333329385889463 + f64.mul + f64.add + f64.mul + f64.add + local.get $1 + local.get $3 + local.get $3 + f64.mul + f64.mul + f64.const -1.9839334836096632e-04 + local.get $3 + f64.const 2.718311493989822e-06 + f64.mul + f64.add + f64.mul + f64.add + f32.demote_f64 + end + local.set $0 + local.get $2 + i32.const 2 + i32.and + if + local.get $0 + f32.neg + local.set $0 + end + local.get $0 + ) + (func $../../lib/libm/assembly/libmf/sin (; 115 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.sin + ) + (func $~lib/math/NativeMathf.sinh (; 116 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 f32) + (local $2 i32) + (local $3 f32) + local.get $0 + i32.reinterpret_f32 + i32.const 2147483647 + i32.and + local.tee $2 + f32.reinterpret_i32 + local.set $1 + f32.const 0.5 + local.get $0 + f32.copysign + local.set $3 + local.get $2 + i32.const 1118925335 + i32.lt_u + if + local.get $1 + call $~lib/math/NativeMathf.expm1 + local.set $1 + local.get $2 + i32.const 1065353216 + i32.lt_u + if + local.get $2 + i32.const 964689920 + i32.lt_u + if + local.get $0 + return + end + local.get $3 + f32.const 2 + local.get $1 + f32.mul + local.get $1 + local.get $1 + f32.mul + local.get $1 + f32.const 1 + f32.add + f32.div + f32.sub + f32.mul + return + end + local.get $3 + local.get $1 + local.get $1 + local.get $1 + f32.const 1 + f32.add + f32.div + f32.add + f32.mul + return + end + f32.const 2 + local.get $3 + f32.mul + local.get $1 + f32.const 162.88958740234375 + f32.sub + call $~lib/math/NativeMathf.exp + f32.const 1661534994731144841129758e11 + f32.mul + f32.const 1661534994731144841129758e11 + f32.mul + f32.mul + ) + (func $../../lib/libm/assembly/libmf/sinh (; 117 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.sinh + ) + (func $../../lib/libm/assembly/libmf/sqrt (; 118 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + f32.sqrt + ) + (func $~lib/math/NativeMathf.tan (; 119 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 f64) + (local $2 i32) + (local $3 f64) + (local $4 i32) + (local $5 f64) + (local $6 i64) + (local $7 i64) + (local $8 i32) + (local $9 i32) + (local $10 i64) + (local $11 i64) + local.get $0 + i32.reinterpret_f32 + local.tee $2 + i32.const 31 + i32.shr_u + local.set $9 + local.get $2 + i32.const 2147483647 + i32.and + local.tee $2 + i32.const 1061752794 + i32.le_u + if + local.get $2 + i32.const 964689920 + i32.lt_u + if + local.get $0 + return + end + local.get $0 + f64.promote_f32 + local.tee $3 + local.get $3 + f64.mul + local.tee $1 + local.get $3 + f64.mul + local.set $5 + local.get $3 + local.get $5 + f64.const 0.3333313950307914 + local.get $1 + f64.const 0.13339200271297674 + f64.mul + f64.add + f64.mul + f64.add + local.get $5 + local.get $1 + local.get $1 + f64.mul + local.tee $3 + f64.mul + f64.const 0.05338123784456704 + local.get $1 + f64.const 0.024528318116654728 + f64.mul + f64.add + local.get $3 + f64.const 0.002974357433599673 + local.get $1 + f64.const 0.009465647849436732 + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f32.demote_f64 + return + end + local.get $2 + i32.const 2139095040 + i32.ge_u + if + local.get $0 + local.get $0 + f32.sub + return + end + block $~lib/math/rempio2f|inlined.2 (result i32) + local.get $2 + i32.const 1305022427 + i32.lt_u + if + local.get $0 + f64.promote_f32 + local.get $0 + f64.promote_f32 + f64.const 0.6366197723675814 + f64.mul + f64.nearest + local.tee $1 + f64.const 1.5707963109016418 + f64.mul + f64.sub + local.get $1 + f64.const 1.5893254773528196e-08 + f64.mul + f64.sub + global.set $~lib/math/rempio2f_y + local.get $1 + i32.trunc_f64_s + br $~lib/math/rempio2f|inlined.2 + end + local.get $2 + i32.const 23 + i32.shr_s + i32.const 152 + i32.sub + local.tee $4 + i32.const 6 + i32.shr_s + local.tee $8 + call $~lib/array/Array#__unchecked_get + local.set $10 + local.get $8 + i32.const 1 + i32.add + call $~lib/array/Array#__unchecked_get + local.set $6 + local.get $4 + i32.const 63 + i32.and + local.tee $4 + i32.const 32 + i32.gt_s + if (result i64) + local.get $6 + local.get $4 + i32.const 32 + i32.sub + i64.extend_i32_s + i64.shl + local.get $8 + i32.const 2 + i32.add + call $~lib/array/Array#__unchecked_get + i64.const 96 + local.get $4 + i64.extend_i32_s + i64.sub + i64.shr_u + i64.or + else + local.get $6 + i64.const 32 + local.get $4 + i64.extend_i32_s + i64.sub + i64.shr_u + end + local.set $7 + f64.const 8.515303950216386e-20 + local.get $0 + f64.promote_f32 + f64.copysign + local.get $2 + i32.const 8388607 + i32.and + i32.const 8388608 + i32.or + i64.extend_i32_s + local.tee $11 + local.get $10 + local.get $4 + i64.extend_i32_s + i64.shl + local.get $6 + i64.const 64 + local.get $4 + i64.extend_i32_s + i64.sub + i64.shr_u + i64.or + i64.mul + local.get $7 + local.get $11 + i64.mul + i64.const 32 + i64.shr_u + i64.add + local.tee $6 + i64.const 2 + i64.shl + local.tee $7 + f64.convert_i64_s + f64.mul + global.set $~lib/math/rempio2f_y + i32.const 0 + local.get $6 + i64.const 62 + i64.shr_u + local.get $7 + i64.const 63 + i64.shr_u + i64.add + i32.wrap_i64 + local.tee $2 + i32.sub + local.get $2 + local.get $9 + select + end + local.set $2 + global.get $~lib/math/rempio2f_y + local.tee $3 + local.get $3 + f64.mul + local.tee $1 + local.get $3 + f64.mul + local.set $5 + local.get $3 + local.get $5 + f64.const 0.3333313950307914 + local.get $1 + f64.const 0.13339200271297674 + f64.mul + f64.add + f64.mul + f64.add + local.get $5 + local.get $1 + local.get $1 + f64.mul + local.tee $3 + f64.mul + f64.const 0.05338123784456704 + local.get $1 + f64.const 0.024528318116654728 + f64.mul + f64.add + local.get $3 + f64.const 0.002974357433599673 + local.get $1 + f64.const 0.009465647849436732 + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + local.set $1 + local.get $2 + i32.const 1 + i32.and + if + f64.const -1 + local.get $1 + f64.div + local.set $1 + end + local.get $1 + f32.demote_f64 + ) + (func $../../lib/libm/assembly/libmf/tan (; 120 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.tan + ) + (func $~lib/math/NativeMathf.tanh (; 121 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 f32) + (local $2 i32) + local.get $0 + i32.reinterpret_f32 + i32.const 2147483647 + i32.and + local.tee $2 + f32.reinterpret_i32 + local.set $1 + local.get $2 + i32.const 1057791828 + i32.gt_u + if + local.get $2 + i32.const 1092616192 + i32.gt_u + if (result f32) + f32.const 1 + f32.const 0 + local.get $1 + f32.div + f32.add + else + f32.const 1 + f32.const 2 + f32.const 2 + local.get $1 + f32.mul + call $~lib/math/NativeMathf.expm1 + f32.const 2 + f32.add + f32.div + f32.sub + end + local.set $1 + else + local.get $2 + i32.const 1048757624 + i32.gt_u + if + f32.const 2 + local.get $1 + f32.mul + call $~lib/math/NativeMathf.expm1 + local.tee $1 + local.get $1 + f32.const 2 + f32.add + f32.div + local.set $1 + else + local.get $2 + i32.const 8388608 + i32.ge_u + if + f32.const -2 + local.get $1 + f32.mul + call $~lib/math/NativeMathf.expm1 + local.tee $1 + f32.neg + local.get $1 + f32.const 2 + f32.add + f32.div + local.set $1 + end + end + end + local.get $1 + local.get $0 + f32.copysign + ) + (func $../../lib/libm/assembly/libmf/tanh (; 122 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.tanh + ) + (func $../../lib/libm/assembly/libmf/trunc (; 123 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + f32.trunc + ) + (func $null (; 124 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/libm.ts b/tests/compiler/std/libm.ts index 6b1c62b656..4f3e58bf53 100644 --- a/tests/compiler/std/libm.ts +++ b/tests/compiler/std/libm.ts @@ -1,144 +1,3 @@ -export const E = Math.E; -export const LN10 = Math.LN10; -export const LN2 = Math.LN2; -export const LOG10E = Math.LOG10E; -export const LOG2E = Math.LOG2E; -export const PI = Math.PI; -export const SQRT1_2 = Math.SQRT1_2; -export const SQRT2 = Math.SQRT2; - -export function abs(x: f64): f64 { - return Math.abs(x); -} - -export function acos(x: f64): f64 { - return Math.acos(x); -} - -export function acosh(x: f64): f64 { - return Math.acosh(x); -} - -export function asin(x: f64): f64 { - return Math.asin(x); -} - -export function asinh(x: f64): f64 { - return Math.asinh(x); -} - -export function atan(x: f64): f64 { - return Math.atan(x); -} - -export function atanh(x: f64): f64 { - return Math.atanh(x); -} - -export function atan2(y: f64, x: f64): f64 { - return Math.atan2(y, x); -} - -export function cbrt(x: f64): f64 { - return Math.cbrt(x); -} - -export function ceil(x: f64): f64 { - return Math.ceil(x); -} - -export function clz32(x: f64): f64 { - return Math.clz32(x); -} - -export function cos(x: f64): f64 { - return Math.cos(x); -} - -export function cosh(x: f64): f64 { - return Math.cosh(x); -} - -export function exp(x: f64): f64 { - return Math.exp(x); -} - -export function expm1(x: f64): f64 { - return Math.expm1(x); -} - -export function floor(x: f64): f64 { - return Math.floor(x); -} - -export function fround(x: f64): f32 { - return Math.fround(x); -} - -export function hypot(a: f64, b: f64): f64 { - return Math.hypot(a, b); -} - -export function imul(a: f64, b: f64): f64 { - return Math.imul(a, b); -} - -export function log(x: f64): f64 { - return Math.log(x); -} - -export function log10(x: f64): f64 { - return Math.log10(x); -} - -export function log1p(x: f64): f64 { - return Math.log1p(x); -} - -export function log2(x: f64): f64 { - return Math.log2(x); -} - -export function max(a: f64, b: f64): f64 { - return Math.max(a, b); -} - -export function min(a: f64, b: f64): f64 { - return Math.min(a, b); -} - -export function pow(x: f64, y: f64): f64 { - return Math.pow(x, y); -} - -export function round(x: f64): f64 { - return Math.round(x); -} - -export function sign(x: f64): f64 { - return Math.sign(x); -} - -export function sin(x: f64): f64 { - return Math.sin(x); -} - -export function sinh(x: f64): f64 { - return Math.sinh(x); -} - -export function sqrt(x: f64): f64 { - return Math.sqrt(x); -} - -export function tan(x: f64): f64 { - return Math.tan(x); -} - -export function tanh(x: f64): f64 { - return Math.tanh(x); -} - -export function trunc(x: f64): f64 { - return Math.trunc(x); -} +import * as libm from "../../../lib/libm/assembly/libm"; +import * as libmf from "../../../lib/libm/assembly/libmf"; +export { libm, libmf }; diff --git a/tests/compiler/std/libm.untouched.wat b/tests/compiler/std/libm.untouched.wat index 1c951af01a..506fb349f5 100644 --- a/tests/compiler/std/libm.untouched.wat +++ b/tests/compiler/std/libm.untouched.wat @@ -3,81 +3,148 @@ (type $FUNCSIG$id (func (param f64) (result i32))) (type $FUNCSIG$ddd (func (param f64 f64) (result f64))) (type $FUNCSIG$ddi (func (param f64 i32) (result f64))) - (type $FUNCSIG$fd (func (param f64) (result f32))) + (type $FUNCSIG$ff (func (param f32) (result f32))) + (type $FUNCSIG$if (func (param f32) (result i32))) + (type $FUNCSIG$fff (func (param f32 f32) (result f32))) + (type $FUNCSIG$jii (func (param i32 i32) (result i64))) + (type $FUNCSIG$ffi (func (param f32 i32) (result f32))) (type $FUNCSIG$v (func)) - (memory $0 0) + (import "Math" "cos" (func $~lib/bindings/Math/cos (param f64) (result f64))) + (import "Math" "sin" (func $~lib/bindings/Math/sin (param f64) (result f64))) + (import "Math" "tan" (func $~lib/bindings/Math/tan (param f64) (result f64))) + (memory $0 1) + (data (i32.const 8) " \00\00\00\01\00\00\00\00\00\00\00 \00\00\00)\15DNn\83\f9\a2\c0\dd4\f5\d1W\'\fcA\90C<\99\95b\dba\c5\bb\de\abcQ\fe") + (data (i32.const 56) "\10\00\00\00\01\00\00\00\03\00\00\00\10\00\00\00\18\00\00\00\18\00\00\00 \00\00\00\04\00\00\00") (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/math/NativeMath.E f64 (f64.const 2.718281828459045)) - (global $std/libm/E f64 (f64.const 2.718281828459045)) + (global $../../lib/libm/assembly/libm/E f64 (f64.const 2.718281828459045)) (global $~lib/math/NativeMath.LN10 f64 (f64.const 2.302585092994046)) - (global $std/libm/LN10 f64 (f64.const 2.302585092994046)) + (global $../../lib/libm/assembly/libm/LN10 f64 (f64.const 2.302585092994046)) (global $~lib/math/NativeMath.LN2 f64 (f64.const 0.6931471805599453)) - (global $std/libm/LN2 f64 (f64.const 0.6931471805599453)) + (global $../../lib/libm/assembly/libm/LN2 f64 (f64.const 0.6931471805599453)) (global $~lib/math/NativeMath.LOG10E f64 (f64.const 0.4342944819032518)) - (global $std/libm/LOG10E f64 (f64.const 0.4342944819032518)) + (global $../../lib/libm/assembly/libm/LOG10E f64 (f64.const 0.4342944819032518)) (global $~lib/math/NativeMath.LOG2E f64 (f64.const 1.4426950408889634)) - (global $std/libm/LOG2E f64 (f64.const 1.4426950408889634)) + (global $../../lib/libm/assembly/libm/LOG2E f64 (f64.const 1.4426950408889634)) (global $~lib/math/NativeMath.PI f64 (f64.const 3.141592653589793)) - (global $std/libm/PI f64 (f64.const 3.141592653589793)) + (global $../../lib/libm/assembly/libm/PI f64 (f64.const 3.141592653589793)) (global $~lib/math/NativeMath.SQRT1_2 f64 (f64.const 0.7071067811865476)) - (global $std/libm/SQRT1_2 f64 (f64.const 0.7071067811865476)) + (global $../../lib/libm/assembly/libm/SQRT1_2 f64 (f64.const 0.7071067811865476)) (global $~lib/math/NativeMath.SQRT2 f64 (f64.const 1.4142135623730951)) - (global $std/libm/SQRT2 f64 (f64.const 1.4142135623730951)) + (global $../../lib/libm/assembly/libm/SQRT2 f64 (f64.const 1.4142135623730951)) + (global $~lib/math/NativeMathf.E f32 (f32.const 2.7182817459106445)) + (global $../../lib/libm/assembly/libmf/E f32 (f32.const 2.7182817459106445)) + (global $~lib/math/NativeMathf.LN10 f32 (f32.const 2.3025851249694824)) + (global $../../lib/libm/assembly/libmf/LN10 f32 (f32.const 2.3025851249694824)) + (global $~lib/math/NativeMathf.LN2 f32 (f32.const 0.6931471824645996)) + (global $../../lib/libm/assembly/libmf/LN2 f32 (f32.const 0.6931471824645996)) + (global $~lib/math/NativeMathf.LOG10E f32 (f32.const 0.4342944920063019)) + (global $../../lib/libm/assembly/libmf/LOG10E f32 (f32.const 0.4342944920063019)) + (global $~lib/math/NativeMathf.LOG2E f32 (f32.const 1.4426950216293335)) + (global $../../lib/libm/assembly/libmf/LOG2E f32 (f32.const 1.4426950216293335)) + (global $~lib/math/NativeMathf.PI f32 (f32.const 3.1415927410125732)) + (global $../../lib/libm/assembly/libmf/PI f32 (f32.const 3.1415927410125732)) + (global $~lib/math/NativeMathf.SQRT1_2 f32 (f32.const 0.7071067690849304)) + (global $../../lib/libm/assembly/libmf/SQRT1_2 f32 (f32.const 0.7071067690849304)) + (global $~lib/math/NativeMathf.SQRT2 f32 (f32.const 1.4142135381698608)) + (global $../../lib/libm/assembly/libmf/SQRT2 f32 (f32.const 1.4142135381698608)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) + (global $~lib/math/rempio2f_y (mut f64) (f64.const 0)) + (global $~lib/math/PIO2_TABLE i32 (i32.const 72)) (export "memory" (memory $0)) - (export "table" (table $0)) - (export "E" (global $std/libm/E)) - (export "LN10" (global $std/libm/LN10)) - (export "LN2" (global $std/libm/LN2)) - (export "LOG10E" (global $std/libm/LOG10E)) - (export "LOG2E" (global $std/libm/LOG2E)) - (export "PI" (global $std/libm/PI)) - (export "SQRT1_2" (global $std/libm/SQRT1_2)) - (export "SQRT2" (global $std/libm/SQRT2)) - (export "abs" (func $std/libm/abs)) - (export "acos" (func $std/libm/acos)) - (export "acosh" (func $std/libm/acosh)) - (export "asin" (func $std/libm/asin)) - (export "asinh" (func $std/libm/asinh)) - (export "atan" (func $std/libm/atan)) - (export "atanh" (func $std/libm/atanh)) - (export "atan2" (func $std/libm/atan2)) - (export "cbrt" (func $std/libm/cbrt)) - (export "ceil" (func $std/libm/ceil)) - (export "clz32" (func $std/libm/clz32)) - (export "cos" (func $std/libm/cos)) - (export "cosh" (func $std/libm/cosh)) - (export "exp" (func $std/libm/exp)) - (export "expm1" (func $std/libm/expm1)) - (export "floor" (func $std/libm/floor)) - (export "fround" (func $std/libm/fround)) - (export "hypot" (func $std/libm/hypot)) - (export "imul" (func $std/libm/imul)) - (export "log" (func $std/libm/log)) - (export "log10" (func $std/libm/log10)) - (export "log1p" (func $std/libm/log1p)) - (export "log2" (func $std/libm/log2)) - (export "max" (func $std/libm/max)) - (export "min" (func $std/libm/min)) - (export "pow" (func $std/libm/pow)) - (export "round" (func $std/libm/round)) - (export "sign" (func $std/libm/sign)) - (export "sin" (func $std/libm/sin)) - (export "sinh" (func $std/libm/sinh)) - (export "sqrt" (func $std/libm/sqrt)) - (export "tan" (func $std/libm/tan)) - (export "tanh" (func $std/libm/tanh)) - (export "trunc" (func $std/libm/trunc)) - (func $std/libm/abs (; 0 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (export "libm.E" (global $../../lib/libm/assembly/libm/E)) + (export "libm.LN10" (global $../../lib/libm/assembly/libm/LN10)) + (export "libm.LN2" (global $../../lib/libm/assembly/libm/LN2)) + (export "libm.LOG10E" (global $../../lib/libm/assembly/libm/LOG10E)) + (export "libm.LOG2E" (global $../../lib/libm/assembly/libm/LOG2E)) + (export "libm.PI" (global $../../lib/libm/assembly/libm/PI)) + (export "libm.SQRT1_2" (global $../../lib/libm/assembly/libm/SQRT1_2)) + (export "libm.SQRT2" (global $../../lib/libm/assembly/libm/SQRT2)) + (export "libm.abs" (func $../../lib/libm/assembly/libm/abs)) + (export "libm.acos" (func $../../lib/libm/assembly/libm/acos)) + (export "libm.acosh" (func $../../lib/libm/assembly/libm/acosh)) + (export "libm.asin" (func $../../lib/libm/assembly/libm/asin)) + (export "libm.asinh" (func $../../lib/libm/assembly/libm/asinh)) + (export "libm.atan" (func $../../lib/libm/assembly/libm/atan)) + (export "libm.atanh" (func $../../lib/libm/assembly/libm/atanh)) + (export "libm.atan2" (func $../../lib/libm/assembly/libm/atan2)) + (export "libm.cbrt" (func $../../lib/libm/assembly/libm/cbrt)) + (export "libm.ceil" (func $../../lib/libm/assembly/libm/ceil)) + (export "libm.clz32" (func $../../lib/libm/assembly/libm/clz32)) + (export "libm.cos" (func $../../lib/libm/assembly/libm/cos)) + (export "libm.cosh" (func $../../lib/libm/assembly/libm/cosh)) + (export "libm.exp" (func $../../lib/libm/assembly/libm/exp)) + (export "libm.expm1" (func $../../lib/libm/assembly/libm/expm1)) + (export "libm.floor" (func $../../lib/libm/assembly/libm/floor)) + (export "libm.fround" (func $../../lib/libm/assembly/libm/fround)) + (export "libm.hypot" (func $../../lib/libm/assembly/libm/hypot)) + (export "libm.imul" (func $../../lib/libm/assembly/libm/imul)) + (export "libm.log" (func $../../lib/libm/assembly/libm/log)) + (export "libm.log10" (func $../../lib/libm/assembly/libm/log10)) + (export "libm.log1p" (func $../../lib/libm/assembly/libm/log1p)) + (export "libm.log2" (func $../../lib/libm/assembly/libm/log2)) + (export "libm.max" (func $../../lib/libm/assembly/libm/max)) + (export "libm.min" (func $../../lib/libm/assembly/libm/min)) + (export "libm.pow" (func $../../lib/libm/assembly/libm/pow)) + (export "libm.round" (func $../../lib/libm/assembly/libm/round)) + (export "libm.sign" (func $../../lib/libm/assembly/libm/sign)) + (export "libm.sin" (func $../../lib/libm/assembly/libm/sin)) + (export "libm.sinh" (func $../../lib/libm/assembly/libm/sinh)) + (export "libm.sqrt" (func $../../lib/libm/assembly/libm/sqrt)) + (export "libm.tan" (func $../../lib/libm/assembly/libm/tan)) + (export "libm.tanh" (func $../../lib/libm/assembly/libm/tanh)) + (export "libm.trunc" (func $../../lib/libm/assembly/libm/trunc)) + (export "libmf.E" (global $../../lib/libm/assembly/libmf/E)) + (export "libmf.LN10" (global $../../lib/libm/assembly/libmf/LN10)) + (export "libmf.LN2" (global $../../lib/libm/assembly/libmf/LN2)) + (export "libmf.LOG10E" (global $../../lib/libm/assembly/libmf/LOG10E)) + (export "libmf.LOG2E" (global $../../lib/libm/assembly/libmf/LOG2E)) + (export "libmf.PI" (global $../../lib/libm/assembly/libmf/PI)) + (export "libmf.SQRT1_2" (global $../../lib/libm/assembly/libmf/SQRT1_2)) + (export "libmf.SQRT2" (global $../../lib/libm/assembly/libmf/SQRT2)) + (export "libmf.abs" (func $../../lib/libm/assembly/libmf/abs)) + (export "libmf.acos" (func $../../lib/libm/assembly/libmf/acos)) + (export "libmf.acosh" (func $../../lib/libm/assembly/libmf/acosh)) + (export "libmf.asin" (func $../../lib/libm/assembly/libmf/asin)) + (export "libmf.asinh" (func $../../lib/libm/assembly/libmf/asinh)) + (export "libmf.atan" (func $../../lib/libm/assembly/libmf/atan)) + (export "libmf.atanh" (func $../../lib/libm/assembly/libmf/atanh)) + (export "libmf.atan2" (func $../../lib/libm/assembly/libmf/atan2)) + (export "libmf.cbrt" (func $../../lib/libm/assembly/libmf/cbrt)) + (export "libmf.ceil" (func $../../lib/libm/assembly/libmf/ceil)) + (export "libmf.clz32" (func $../../lib/libm/assembly/libmf/clz32)) + (export "libmf.cos" (func $../../lib/libm/assembly/libmf/cos)) + (export "libmf.cosh" (func $../../lib/libm/assembly/libmf/cosh)) + (export "libmf.exp" (func $../../lib/libm/assembly/libmf/exp)) + (export "libmf.expm1" (func $../../lib/libm/assembly/libmf/expm1)) + (export "libmf.floor" (func $../../lib/libm/assembly/libmf/floor)) + (export "libmf.fround" (func $../../lib/libm/assembly/libmf/fround)) + (export "libmf.hypot" (func $../../lib/libm/assembly/libmf/hypot)) + (export "libmf.imul" (func $../../lib/libm/assembly/libmf/imul)) + (export "libmf.log" (func $../../lib/libm/assembly/libmf/log)) + (export "libmf.log10" (func $../../lib/libm/assembly/libmf/log10)) + (export "libmf.log1p" (func $../../lib/libm/assembly/libmf/log1p)) + (export "libmf.log2" (func $../../lib/libm/assembly/libmf/log2)) + (export "libmf.max" (func $../../lib/libm/assembly/libmf/max)) + (export "libmf.min" (func $../../lib/libm/assembly/libmf/min)) + (export "libmf.pow" (func $../../lib/libm/assembly/libmf/pow)) + (export "libmf.round" (func $../../lib/libm/assembly/libmf/round)) + (export "libmf.sign" (func $../../lib/libm/assembly/libmf/sign)) + (export "libmf.sin" (func $../../lib/libm/assembly/libmf/sin)) + (export "libmf.sinh" (func $../../lib/libm/assembly/libmf/sinh)) + (export "libmf.sqrt" (func $../../lib/libm/assembly/libmf/sqrt)) + (export "libmf.tan" (func $../../lib/libm/assembly/libmf/tan)) + (export "libmf.tanh" (func $../../lib/libm/assembly/libmf/tanh)) + (export "libmf.trunc" (func $../../lib/libm/assembly/libmf/trunc)) + (func $../../lib/libm/assembly/libm/abs (; 3 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) local.get $0 local.set $1 local.get $1 f64.abs ) - (func $~lib/math/R (; 1 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/R (; 4 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 f64) local.get $0 @@ -126,7 +193,7 @@ local.get $2 f64.div ) - (func $~lib/math/NativeMath.acos (; 2 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.acos (; 5 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i32) (local $2 i32) (local $3 i32) @@ -278,11 +345,11 @@ f64.add f64.mul ) - (func $std/libm/acos (; 3 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/acos (; 6 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.acos ) - (func $~lib/math/NativeMath.log1p (; 4 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.log1p (; 7 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i64) (local $2 i32) (local $3 i32) @@ -315,9 +382,8 @@ local.get $2 i32.const 1071284858 i32.lt_u - local.tee $6 if (result i32) - local.get $6 + i32.const 1 else local.get $2 i32.const 31 @@ -347,9 +413,7 @@ local.get $2 i32.const 1 i32.shl - i32.const 1017118720 - i32.const 1 - i32.shl + i32.const 2034237440 i32.lt_u if local.get $0 @@ -527,11 +591,11 @@ f64.mul f64.add ) - (func $~lib/math/NativeMath.log (; 5 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.log (; 8 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i64) (local $2 i32) (local $3 i32) - (local $4 i32) + (local $4 f64) (local $5 f64) (local $6 f64) (local $7 f64) @@ -539,8 +603,7 @@ (local $9 f64) (local $10 f64) (local $11 f64) - (local $12 f64) - (local $13 i32) + (local $12 i32) local.get $0 i64.reinterpret_f64 local.set $1 @@ -554,9 +617,8 @@ local.get $2 i32.const 1048576 i32.lt_u - local.tee $4 if (result i32) - local.get $4 + i32.const 1 else local.get $2 i32.const 31 @@ -614,7 +676,6 @@ local.get $2 i32.const 1072693248 i32.eq - local.tee $4 if (result i32) local.get $1 i64.const 32 @@ -622,7 +683,7 @@ i64.const 0 i64.eq else - local.get $4 + i32.const 0 end if f64.const 0 @@ -665,46 +726,46 @@ local.get $0 f64.const 1 f64.sub - local.set $5 + local.set $4 f64.const 0.5 - local.get $5 + local.get $4 f64.mul - local.get $5 + local.get $4 f64.mul - local.set $6 - local.get $5 + local.set $5 + local.get $4 f64.const 2 - local.get $5 + local.get $4 f64.add f64.div + local.set $6 + local.get $6 + local.get $6 + f64.mul local.set $7 local.get $7 local.get $7 f64.mul local.set $8 local.get $8 - local.get $8 - f64.mul - local.set $9 - local.get $9 f64.const 0.3999999999940942 - local.get $9 + local.get $8 f64.const 0.22222198432149784 - local.get $9 + local.get $8 f64.const 0.15313837699209373 f64.mul f64.add f64.mul f64.add f64.mul - local.set $10 - local.get $8 + local.set $9 + local.get $7 f64.const 0.6666666666666735 - local.get $9 + local.get $8 f64.const 0.2857142874366239 - local.get $9 + local.get $8 f64.const 0.1818357216161805 - local.get $9 + local.get $8 f64.const 0.14798198605116586 f64.mul f64.add @@ -713,34 +774,34 @@ f64.mul f64.add f64.mul - local.set $11 - local.get $11 + local.set $10 local.get $10 + local.get $9 f64.add - local.set $12 + local.set $11 local.get $3 - local.set $13 - local.get $7 + local.set $12 local.get $6 - local.get $12 + local.get $5 + local.get $11 f64.add f64.mul - local.get $13 + local.get $12 f64.convert_i32_s f64.const 1.9082149292705877e-10 f64.mul f64.add - local.get $6 - f64.sub local.get $5 + f64.sub + local.get $4 f64.add - local.get $13 + local.get $12 f64.convert_i32_s f64.const 0.6931471803691238 f64.mul f64.add ) - (func $~lib/math/NativeMath.acosh (; 6 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.acosh (; 9 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i64) local.get $0 i64.reinterpret_f64 @@ -750,9 +811,7 @@ i64.and local.set $1 local.get $1 - i64.const 1023 - i64.const 1 - i64.add + i64.const 1024 i64.lt_u if local.get $0 @@ -777,9 +836,7 @@ return end local.get $1 - i64.const 1023 - i64.const 26 - i64.add + i64.const 1049 i64.lt_u if f64.const 2 @@ -804,11 +861,11 @@ f64.const 0.6931471805599453 f64.add ) - (func $std/libm/acosh (; 7 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/acosh (; 10 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.acosh ) - (func $~lib/math/NativeMath.asin (; 8 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.asin (; 11 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i32) (local $2 i32) (local $3 i32) @@ -865,13 +922,12 @@ local.get $2 i32.const 1045430272 i32.lt_u - local.tee $3 if (result i32) local.get $2 i32.const 1048576 i32.ge_u else - local.get $3 + i32.const 0 end if local.get $0 @@ -968,11 +1024,11 @@ end local.get $0 ) - (func $std/libm/asin (; 9 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/asin (; 12 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.asin ) - (func $~lib/math/NativeMath.asinh (; 10 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.asinh (; 13 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i64) (local $2 i64) (local $3 f64) @@ -991,9 +1047,7 @@ f64.reinterpret_i64 local.set $3 local.get $2 - i64.const 1023 - i64.const 26 - i64.add + i64.const 1049 i64.ge_u if local.get $3 @@ -1003,9 +1057,7 @@ local.set $3 else local.get $2 - i64.const 1023 - i64.const 1 - i64.add + i64.const 1024 i64.ge_u if f64.const 2 @@ -1026,9 +1078,7 @@ local.set $3 else local.get $2 - i64.const 1023 - i64.const 26 - i64.sub + i64.const 997 i64.ge_u if local.get $3 @@ -1054,16 +1104,16 @@ local.get $0 f64.copysign ) - (func $std/libm/asinh (; 11 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/asinh (; 14 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.asinh ) - (func $~lib/builtins/isNaN (; 12 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + (func $~lib/builtins/isNaN (; 15 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) local.get $0 local.get $0 f64.ne ) - (func $~lib/math/NativeMath.atan (; 13 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.atan (; 16 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i32) (local $2 f64) (local $3 f64) @@ -1336,11 +1386,11 @@ local.get $2 f64.copysign ) - (func $std/libm/atan (; 14 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/atan (; 17 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.atan ) - (func $~lib/math/NativeMath.atanh (; 15 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.atanh (; 18 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i64) (local $2 i64) (local $3 i64) @@ -1366,15 +1416,11 @@ f64.reinterpret_i64 local.set $4 local.get $2 - i64.const 1023 - i64.const 1 - i64.sub + i64.const 1022 i64.lt_u if local.get $2 - i64.const 1023 - i64.const 32 - i64.sub + i64.const 991 i64.ge_u if f64.const 0.5 @@ -1412,13 +1458,13 @@ local.get $0 f64.copysign ) - (func $std/libm/atanh (; 16 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/atanh (; 19 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.atanh ) - (func $~lib/math/NativeMath.atan2 (; 17 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) - (local $2 i32) - (local $3 i64) + (func $~lib/math/NativeMath.atan2 (; 20 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (local $2 i64) + (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) @@ -1427,9 +1473,8 @@ (local $9 f64) local.get $1 call $~lib/builtins/isNaN - local.tee $2 if (result i32) - local.get $2 + i32.const 1 else local.get $0 call $~lib/builtins/isNaN @@ -1442,30 +1487,30 @@ end local.get $1 i64.reinterpret_f64 - local.set $3 - local.get $3 + local.set $2 + local.get $2 i64.const 32 i64.shr_u i32.wrap_i64 - local.set $4 - local.get $3 + local.set $3 + local.get $2 i32.wrap_i64 - local.set $5 + local.set $4 local.get $0 i64.reinterpret_f64 - local.set $3 - local.get $3 + local.set $2 + local.get $2 i64.const 32 i64.shr_u i32.wrap_i64 + local.set $5 + local.get $2 + i32.wrap_i64 local.set $6 local.get $3 - i32.wrap_i64 - local.set $7 - local.get $4 i32.const 1072693248 i32.sub - local.get $5 + local.get $4 i32.or i32.const 0 i32.eq @@ -1474,28 +1519,28 @@ call $~lib/math/NativeMath.atan return end - local.get $6 + local.get $5 i32.const 31 i32.shr_u i32.const 1 i32.and - local.get $4 + local.get $3 i32.const 30 i32.shr_u i32.const 2 i32.and i32.or - local.set $8 - local.get $4 + local.set $7 + local.get $3 i32.const 2147483647 i32.and - local.set $4 - local.get $6 + local.set $3 + local.get $5 i32.const 2147483647 i32.and - local.set $6 + local.set $5 + local.get $5 local.get $6 - local.get $7 i32.or i32.const 0 i32.eq @@ -1505,21 +1550,21 @@ block $case2|0 block $case1|0 block $case0|0 + local.get $7 + local.set $8 local.get $8 - local.set $2 - local.get $2 i32.const 0 i32.eq br_if $case0|0 - local.get $2 + local.get $8 i32.const 1 i32.eq br_if $case1|0 - local.get $2 + local.get $8 i32.const 2 i32.eq br_if $case2|0 - local.get $2 + local.get $8 i32.const 3 i32.eq br_if $case3|0 @@ -1537,13 +1582,13 @@ return end end + local.get $3 local.get $4 - local.get $5 i32.or i32.const 0 i32.eq if - local.get $8 + local.get $7 i32.const 1 i32.and if (result f64) @@ -1558,11 +1603,11 @@ end return end - local.get $4 + local.get $3 i32.const 2146435072 i32.eq if - local.get $6 + local.get $5 i32.const 2146435072 i32.eq if @@ -1571,21 +1616,21 @@ block $case2|1 block $case1|1 block $case0|1 + local.get $7 + local.set $8 local.get $8 - local.set $2 - local.get $2 i32.const 0 i32.eq br_if $case0|1 - local.get $2 + local.get $8 i32.const 1 i32.eq br_if $case1|1 - local.get $2 + local.get $8 i32.const 2 i32.eq br_if $case2|1 - local.get $2 + local.get $8 i32.const 3 i32.eq br_if $case3|1 @@ -1622,21 +1667,21 @@ block $case2|2 block $case1|2 block $case0|2 + local.get $7 + local.set $8 local.get $8 - local.set $2 - local.get $2 i32.const 0 i32.eq br_if $case0|2 - local.get $2 + local.get $8 i32.const 1 i32.eq br_if $case1|2 - local.get $2 + local.get $8 i32.const 2 i32.eq br_if $case2|2 - local.get $2 + local.get $8 i32.const 3 i32.eq br_if $case3|2 @@ -1657,23 +1702,20 @@ end end end - local.get $4 - i32.const 64 - i32.const 20 - i32.shl + local.get $3 + i32.const 67108864 i32.add - local.get $6 + local.get $5 i32.lt_u - local.tee $2 if (result i32) - local.get $2 + i32.const 1 else - local.get $6 + local.get $5 i32.const 2146435072 i32.eq end if - local.get $8 + local.get $7 i32.const 1 i32.and if (result f64) @@ -1688,20 +1730,17 @@ end return end - local.get $8 + local.get $7 i32.const 2 i32.and - local.tee $2 if (result i32) - local.get $6 - i32.const 64 - i32.const 20 - i32.shl + local.get $5 + i32.const 67108864 i32.add - local.get $4 + local.get $3 i32.lt_u else - local.get $2 + i32.const 0 end if f64.const 0 @@ -1719,21 +1758,21 @@ block $case2|3 block $case1|3 block $case0|3 + local.get $7 + local.set $8 local.get $8 - local.set $2 - local.get $2 i32.const 0 i32.eq br_if $case0|3 - local.get $2 + local.get $8 i32.const 1 i32.eq br_if $case1|3 - local.get $2 + local.get $8 i32.const 2 i32.eq br_if $case2|3 - local.get $2 + local.get $8 i32.const 3 i32.eq br_if $case3|3 @@ -1763,12 +1802,12 @@ unreachable f64.const 0 ) - (func $std/libm/atan2 (; 18 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $../../lib/libm/assembly/libm/atan2 (; 21 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) local.get $0 local.get $1 call $~lib/math/NativeMath.atan2 ) - (func $~lib/math/NativeMath.cbrt (; 19 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.cbrt (; 22 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i64) (local $2 i32) (local $3 f64) @@ -1912,25 +1951,25 @@ local.set $3 local.get $3 ) - (func $std/libm/cbrt (; 20 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/cbrt (; 23 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.cbrt ) - (func $std/libm/ceil (; 21 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/ceil (; 24 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) local.get $0 local.set $1 local.get $1 f64.ceil ) - (func $~lib/builtins/isFinite (; 22 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + (func $~lib/builtins/isFinite (; 25 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) local.get $0 local.get $0 f64.sub f64.const 0 f64.eq ) - (func $~lib/math/NativeMath.clz32 (; 23 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.clz32 (; 26 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/builtins/isFinite i32.eqz @@ -1953,19 +1992,19 @@ i32.clz f64.convert_i32_s ) - (func $std/libm/clz32 (; 24 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/clz32 (; 27 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.clz32 ) - (func $~lib/math/NativeMath.cos (; 25 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) - unreachable - f64.const 0 + (func $~lib/math/NativeMath.cos (; 28 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + call $~lib/bindings/Math/cos ) - (func $std/libm/cos (; 26 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/cos (; 29 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.cos ) - (func $~lib/math/NativeMath.expm1 (; 27 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.expm1 (; 30 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i64) (local $2 i32) (local $3 i32) @@ -1981,7 +2020,6 @@ (local $13 f64) (local $14 f64) (local $15 f64) - (local $16 i32) local.get $0 i64.reinterpret_f64 local.set $1 @@ -2209,9 +2247,8 @@ local.get $3 i32.const 0 i32.lt_s - local.tee $16 if (result i32) - local.get $16 + i32.const 1 else local.get $3 i32.const 56 @@ -2279,7 +2316,7 @@ local.get $14 f64.mul ) - (func $~lib/math/NativeMath.scalbn (; 28 ;) (type $FUNCSIG$ddi) (param $0 f64) (param $1 i32) (result f64) + (func $~lib/math/NativeMath.scalbn (; 31 ;) (type $FUNCSIG$ddi) (param $0 f64) (param $1 i32) (result f64) (local $2 f64) (local $3 i32) (local $4 i32) @@ -2370,7 +2407,7 @@ f64.reinterpret_i64 f64.mul ) - (func $~lib/math/NativeMath.exp (; 29 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.exp (; 32 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i32) (local $2 i32) (local $3 f64) @@ -2535,7 +2572,7 @@ local.get $5 call $~lib/math/NativeMath.scalbn ) - (func $~lib/math/NativeMath.cosh (; 30 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.cosh (; 33 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i64) (local $2 i32) (local $3 f64) @@ -2561,11 +2598,7 @@ i32.lt_u if local.get $2 - i32.const 1072693248 - i32.const 26 - i32.const 20 - i32.shl - i32.sub + i32.const 1045430272 i32.lt_u if f64.const 1 @@ -2630,39 +2663,40 @@ local.set $3 local.get $3 ) - (func $std/libm/cosh (; 31 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/cosh (; 34 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.cosh ) - (func $std/libm/exp (; 32 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/exp (; 35 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.exp ) - (func $std/libm/expm1 (; 33 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/expm1 (; 36 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.expm1 ) - (func $std/libm/floor (; 34 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/floor (; 37 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) local.get $0 local.set $1 local.get $1 f64.floor ) - (func $std/libm/fround (; 35 ;) (type $FUNCSIG$fd) (param $0 f64) (result f32) + (func $../../lib/libm/assembly/libm/fround (; 38 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) local.get $0 local.set $1 local.get $1 f32.demote_f64 + f64.promote_f32 ) - (func $~lib/math/NativeMath.hypot (; 36 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $~lib/math/NativeMath.hypot (; 39 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) (local $2 i64) (local $3 i64) (local $4 i64) (local $5 i32) (local $6 i32) - (local $7 i32) + (local $7 f64) (local $8 f64) (local $9 f64) (local $10 f64) @@ -2670,7 +2704,6 @@ (local $12 f64) (local $13 f64) (local $14 f64) - (local $15 f64) local.get $0 i64.reinterpret_f64 local.set $2 @@ -2722,9 +2755,8 @@ local.get $5 i32.const 2047 i32.eq - local.tee $7 if (result i32) - local.get $7 + i32.const 1 else local.get $3 i64.const 0 @@ -2746,15 +2778,13 @@ return end f64.const 1 - local.set $8 + local.set $7 local.get $5 - i32.const 1023 - i32.const 510 - i32.add + i32.const 1533 i32.gt_s if f64.const 5260135901548373507240989e186 - local.set $8 + local.set $7 local.get $0 f64.const 1.90109156629516e-211 f64.mul @@ -2765,13 +2795,11 @@ local.set $1 else local.get $6 - i32.const 1023 - i32.const 450 - i32.sub + i32.const 573 i32.lt_s if f64.const 1.90109156629516e-211 - local.set $8 + local.set $7 local.get $0 f64.const 5260135901548373507240989e186 f64.mul @@ -2785,84 +2813,84 @@ local.get $0 f64.const 134217729 f64.mul - local.set $9 + local.set $8 local.get $0 - local.get $9 + local.get $8 f64.sub - local.get $9 + local.get $8 f64.add - local.set $10 + local.set $9 local.get $0 - local.get $10 + local.get $9 f64.sub - local.set $11 + local.set $10 local.get $0 local.get $0 f64.mul - local.set $12 - local.get $10 - local.get $10 + local.set $11 + local.get $9 + local.get $9 f64.mul - local.get $12 + local.get $11 f64.sub f64.const 2 - local.get $10 + local.get $9 f64.mul - local.get $11 + local.get $10 f64.add - local.get $11 + local.get $10 f64.mul f64.add - local.set $13 + local.set $12 local.get $1 f64.const 134217729 f64.mul - local.set $9 + local.set $8 local.get $1 - local.get $9 + local.get $8 f64.sub - local.get $9 + local.get $8 f64.add - local.set $10 + local.set $9 local.get $1 - local.get $10 + local.get $9 f64.sub - local.set $11 + local.set $10 local.get $1 local.get $1 f64.mul - local.set $14 - local.get $10 - local.get $10 + local.set $13 + local.get $9 + local.get $9 f64.mul - local.get $14 + local.get $13 f64.sub f64.const 2 - local.get $10 + local.get $9 f64.mul - local.get $11 + local.get $10 f64.add - local.get $11 + local.get $10 f64.mul f64.add - local.set $15 - local.get $8 - local.get $15 - local.get $13 - f64.add - local.get $14 - f64.add + local.set $14 + local.get $7 + local.get $14 local.get $12 f64.add + local.get $13 + f64.add + local.get $11 + f64.add f64.sqrt f64.mul ) - (func $std/libm/hypot (; 37 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $../../lib/libm/assembly/libm/hypot (; 40 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) local.get $0 local.get $1 call $~lib/math/NativeMath.hypot ) - (func $~lib/math/NativeMath.imul (; 38 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $~lib/math/NativeMath.imul (; 41 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) local.get $0 local.get $1 f64.add @@ -2895,20 +2923,20 @@ i32.mul f64.convert_i32_s ) - (func $std/libm/imul (; 39 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $../../lib/libm/assembly/libm/imul (; 42 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) local.get $0 local.get $1 call $~lib/math/NativeMath.imul ) - (func $std/libm/log (; 40 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/log (; 43 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.log ) - (func $~lib/math/NativeMath.log10 (; 41 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.log10 (; 44 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i64) (local $2 i32) (local $3 i32) - (local $4 i32) + (local $4 f64) (local $5 f64) (local $6 f64) (local $7 f64) @@ -2922,7 +2950,6 @@ (local $15 f64) (local $16 f64) (local $17 f64) - (local $18 f64) local.get $0 i64.reinterpret_f64 local.set $1 @@ -2936,9 +2963,8 @@ local.get $2 i32.const 1048576 i32.lt_u - local.tee $4 if (result i32) - local.get $4 + i32.const 1 else local.get $2 i32.const 31 @@ -2996,7 +3022,6 @@ local.get $2 i32.const 1072693248 i32.eq - local.tee $4 if (result i32) local.get $1 i64.const 32 @@ -3004,7 +3029,7 @@ i64.const 0 i64.eq else - local.get $4 + i32.const 0 end if f64.const 0 @@ -3047,46 +3072,46 @@ local.get $0 f64.const 1 f64.sub - local.set $5 + local.set $4 f64.const 0.5 - local.get $5 + local.get $4 f64.mul - local.get $5 + local.get $4 f64.mul - local.set $6 - local.get $5 + local.set $5 + local.get $4 f64.const 2 - local.get $5 + local.get $4 f64.add f64.div + local.set $6 + local.get $6 + local.get $6 + f64.mul local.set $7 local.get $7 local.get $7 f64.mul local.set $8 local.get $8 - local.get $8 - f64.mul - local.set $9 - local.get $9 f64.const 0.3999999999940942 - local.get $9 + local.get $8 f64.const 0.22222198432149784 - local.get $9 + local.get $8 f64.const 0.15313837699209373 f64.mul f64.add f64.mul f64.add f64.mul - local.set $10 - local.get $8 + local.set $9 + local.get $7 f64.const 0.6666666666666735 - local.get $9 + local.get $8 f64.const 0.2857142874366239 - local.get $9 + local.get $8 f64.const 0.1818357216161805 - local.get $9 + local.get $8 f64.const 0.14798198605116586 f64.mul f64.add @@ -3095,16 +3120,16 @@ f64.mul f64.add f64.mul - local.set $11 - local.get $11 + local.set $10 local.get $10 + local.get $9 f64.add - local.set $12 + local.set $11 + local.get $4 local.get $5 - local.get $6 f64.sub - local.set $13 - local.get $13 + local.set $12 + local.get $12 i64.reinterpret_f64 local.set $1 local.get $1 @@ -3113,73 +3138,73 @@ local.set $1 local.get $1 f64.reinterpret_i64 - local.set $13 - local.get $5 - local.get $13 + local.set $12 + local.get $4 + local.get $12 f64.sub - local.get $6 + local.get $5 f64.sub - local.get $7 local.get $6 - local.get $12 + local.get $5 + local.get $11 f64.add f64.mul f64.add - local.set $14 - local.get $13 + local.set $13 + local.get $12 f64.const 0.4342944818781689 f64.mul - local.set $15 + local.set $14 local.get $3 f64.convert_i32_s - local.set $16 - local.get $16 + local.set $15 + local.get $15 f64.const 0.30102999566361177 f64.mul - local.set $17 - local.get $16 + local.set $16 + local.get $15 f64.const 3.694239077158931e-13 f64.mul - local.get $14 local.get $13 + local.get $12 f64.add f64.const 2.5082946711645275e-11 f64.mul f64.add - local.get $14 + local.get $13 f64.const 0.4342944818781689 f64.mul f64.add - local.set $18 - local.get $17 - local.get $15 + local.set $17 + local.get $16 + local.get $14 f64.add - local.set $9 - local.get $18 + local.set $8 local.get $17 - local.get $9 + local.get $16 + local.get $8 f64.sub - local.get $15 + local.get $14 f64.add f64.add - local.set $18 - local.get $18 - local.get $9 + local.set $17 + local.get $17 + local.get $8 f64.add ) - (func $std/libm/log10 (; 42 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/log10 (; 45 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.log10 ) - (func $std/libm/log1p (; 43 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/log1p (; 46 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.log1p ) - (func $~lib/math/NativeMath.log2 (; 44 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.log2 (; 47 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i64) (local $2 i32) (local $3 i32) - (local $4 i32) + (local $4 f64) (local $5 f64) (local $6 f64) (local $7 f64) @@ -3192,7 +3217,6 @@ (local $14 f64) (local $15 f64) (local $16 f64) - (local $17 f64) local.get $0 i64.reinterpret_f64 local.set $1 @@ -3206,9 +3230,8 @@ local.get $2 i32.const 1048576 i32.lt_u - local.tee $4 if (result i32) - local.get $4 + i32.const 1 else local.get $2 i32.const 31 @@ -3266,7 +3289,6 @@ local.get $2 i32.const 1072693248 i32.eq - local.tee $4 if (result i32) local.get $1 i64.const 32 @@ -3274,7 +3296,7 @@ i64.const 0 i64.eq else - local.get $4 + i32.const 0 end if f64.const 0 @@ -3317,46 +3339,46 @@ local.get $0 f64.const 1 f64.sub - local.set $5 + local.set $4 f64.const 0.5 - local.get $5 + local.get $4 f64.mul - local.get $5 + local.get $4 f64.mul - local.set $6 - local.get $5 + local.set $5 + local.get $4 f64.const 2 - local.get $5 + local.get $4 f64.add f64.div + local.set $6 + local.get $6 + local.get $6 + f64.mul local.set $7 local.get $7 local.get $7 f64.mul local.set $8 local.get $8 - local.get $8 - f64.mul - local.set $9 - local.get $9 f64.const 0.3999999999940942 - local.get $9 + local.get $8 f64.const 0.22222198432149784 - local.get $9 + local.get $8 f64.const 0.15313837699209373 f64.mul f64.add f64.mul f64.add f64.mul - local.set $10 - local.get $8 + local.set $9 + local.get $7 f64.const 0.6666666666666735 - local.get $9 + local.get $8 f64.const 0.2857142874366239 - local.get $9 + local.get $8 f64.const 0.1818357216161805 - local.get $9 + local.get $8 f64.const 0.14798198605116586 f64.mul f64.add @@ -3365,16 +3387,16 @@ f64.mul f64.add f64.mul - local.set $11 - local.get $11 + local.set $10 local.get $10 + local.get $9 f64.add - local.set $12 + local.set $11 + local.get $4 local.get $5 - local.get $6 f64.sub - local.set $13 - local.get $13 + local.set $12 + local.get $12 i64.reinterpret_f64 local.set $1 local.get $1 @@ -3383,81 +3405,81 @@ local.set $1 local.get $1 f64.reinterpret_i64 - local.set $13 - local.get $5 - local.get $13 + local.set $12 + local.get $4 + local.get $12 f64.sub - local.get $6 + local.get $5 f64.sub - local.get $7 local.get $6 - local.get $12 + local.get $5 + local.get $11 f64.add f64.mul f64.add - local.set $14 - local.get $13 + local.set $13 + local.get $12 f64.const 1.4426950407214463 f64.mul - local.set $15 - local.get $14 + local.set $14 local.get $13 + local.get $12 f64.add f64.const 1.6751713164886512e-10 f64.mul - local.get $14 + local.get $13 f64.const 1.4426950407214463 f64.mul f64.add - local.set $16 + local.set $15 local.get $3 f64.convert_i32_s - local.set $17 - local.get $17 - local.get $15 + local.set $16 + local.get $16 + local.get $14 f64.add - local.set $9 + local.set $8 + local.get $15 local.get $16 - local.get $17 - local.get $9 + local.get $8 f64.sub - local.get $15 + local.get $14 f64.add f64.add - local.set $16 - local.get $9 local.set $15 - local.get $16 + local.get $8 + local.set $14 local.get $15 + local.get $14 f64.add ) - (func $std/libm/log2 (; 45 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/log2 (; 48 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.log2 ) - (func $std/libm/max (; 46 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $../../lib/libm/assembly/libm/max (; 49 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) (local $2 f64) (local $3 f64) local.get $0 - local.set $2 - local.get $1 local.set $3 - local.get $2 + local.get $1 + local.set $2 local.get $3 + local.get $2 f64.max ) - (func $std/libm/min (; 47 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $../../lib/libm/assembly/libm/min (; 50 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) (local $2 f64) (local $3 f64) local.get $0 - local.set $2 - local.get $1 local.set $3 - local.get $2 + local.get $1 + local.set $2 local.get $3 + local.get $2 f64.min ) - (func $~lib/math/NativeMath.pow (; 48 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $~lib/math/NativeMath.pow (; 51 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) (local $2 i64) (local $3 i32) (local $4 i32) @@ -3540,44 +3562,39 @@ local.get $7 i32.const 2146435072 i32.gt_s - local.tee $9 if (result i32) - local.get $9 + i32.const 1 else local.get $7 i32.const 2146435072 i32.eq - local.tee $9 if (result i32) local.get $4 i32.const 0 i32.ne else - local.get $9 + i32.const 0 end end - local.tee $9 if (result i32) - local.get $9 + i32.const 1 else local.get $8 i32.const 2146435072 i32.gt_s end - local.tee $9 if (result i32) - local.get $9 + i32.const 1 else local.get $8 i32.const 2146435072 i32.eq - local.tee $9 if (result i32) local.get $6 i32.const 0 i32.ne else - local.get $9 + i32.const 0 end end if @@ -3587,7 +3604,7 @@ return end i32.const 0 - local.set $10 + local.set $9 local.get $3 i32.const 0 i32.lt_s @@ -3597,7 +3614,7 @@ i32.ge_s if i32.const 2 - local.set $10 + local.set $9 else local.get $8 i32.const 1072693248 @@ -3608,21 +3625,21 @@ i32.shr_s i32.const 1023 i32.sub - local.set $11 - local.get $11 + local.set $10 + local.get $10 i32.const 20 i32.gt_s - local.set $9 + local.set $11 i32.const 52 i32.const 20 - local.get $9 - select local.get $11 + select + local.get $10 i32.sub local.set $12 local.get $6 local.get $8 - local.get $9 + local.get $11 select local.set $13 local.get $13 @@ -3640,7 +3657,7 @@ i32.const 1 i32.and i32.sub - local.set $10 + local.set $9 end end end @@ -3743,17 +3760,15 @@ local.get $7 i32.const 0 i32.eq - local.tee $14 if (result i32) - local.get $14 + i32.const 1 else local.get $7 i32.const 2146435072 i32.eq end - local.tee $14 if (result i32) - local.get $14 + i32.const 1 else local.get $7 i32.const 1072693248 @@ -3778,7 +3793,7 @@ local.get $7 i32.const 1072693248 i32.sub - local.get $10 + local.get $9 i32.or i32.const 0 i32.eq @@ -3792,7 +3807,7 @@ f64.div local.set $16 else - local.get $10 + local.get $9 i32.const 1 i32.eq if @@ -3812,7 +3827,7 @@ i32.const 0 i32.lt_s if - local.get $10 + local.get $9 i32.const 0 i32.eq if @@ -3825,7 +3840,7 @@ f64.div return end - local.get $10 + local.get $9 i32.const 1 i32.eq if @@ -4011,17 +4026,17 @@ i32.le_s if i32.const 0 - local.set $11 + local.set $10 else local.get $28 i32.const 767610 i32.lt_s if i32.const 1 - local.set $11 + local.set $10 else i32.const 0 - local.set $11 + local.set $10 local.get $29 i32.const 1 i32.add @@ -4045,7 +4060,7 @@ local.set $15 f64.const 1.5 f64.const 1 - local.get $11 + local.get $10 select local.set $35 local.get $15 @@ -4077,7 +4092,7 @@ i32.or i32.const 524288 i32.add - local.get $11 + local.get $10 i32.const 18 i32.shl i32.add @@ -4200,7 +4215,7 @@ local.set $36 f64.const 1.350039202129749e-08 f64.const 0 - local.get $11 + local.get $10 select local.set $37 f64.const -7.028461650952758e-09 @@ -4218,7 +4233,7 @@ local.set $24 f64.const 0.5849624872207642 f64.const 0 - local.get $11 + local.get $10 select local.set $39 local.get $36 @@ -4363,7 +4378,7 @@ i32.shr_s i32.const 1023 i32.sub - local.set $11 + local.set $10 i32.const 0 local.set $29 local.get $41 @@ -4372,7 +4387,7 @@ if local.get $28 i32.const 1048576 - local.get $11 + local.get $10 i32.const 1 i32.add i32.shr_s @@ -4385,12 +4400,12 @@ i32.shr_s i32.const 1023 i32.sub - local.set $11 + local.set $10 f64.const 0 local.set $24 local.get $29 i32.const 1048575 - local.get $11 + local.get $10 i32.shr_s i32.const -1 i32.xor @@ -4406,7 +4421,7 @@ i32.const 1048576 i32.or i32.const 20 - local.get $11 + local.get $10 i32.sub i32.shr_s local.set $29 @@ -4545,12 +4560,12 @@ local.get $16 f64.mul ) - (func $std/libm/pow (; 49 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $../../lib/libm/assembly/libm/pow (; 52 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) local.get $0 local.get $1 call $~lib/math/NativeMath.pow ) - (func $std/libm/round (; 50 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/round (; 53 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) local.get $0 local.set $1 @@ -4561,7 +4576,7 @@ local.get $1 f64.copysign ) - (func $std/libm/sign (; 51 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/sign (; 54 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) block $~lib/math/NativeMath.sign|inlined.0 (result f64) local.get $0 @@ -4584,15 +4599,15 @@ br $~lib/math/NativeMath.sign|inlined.0 end ) - (func $~lib/math/NativeMath.sin (; 52 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) - unreachable - f64.const 0 + (func $~lib/math/NativeMath.sin (; 55 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + call $~lib/bindings/Math/sin ) - (func $std/libm/sin (; 53 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/sin (; 56 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.sin ) - (func $~lib/math/NativeMath.sinh (; 54 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.sinh (; 57 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i64) (local $2 f64) (local $3 i32) @@ -4629,11 +4644,7 @@ i32.lt_u if local.get $3 - i32.const 1072693248 - i32.const 26 - i32.const 20 - i32.shl - i32.sub + i32.const 1045430272 i32.lt_u if local.get $0 @@ -4696,26 +4707,26 @@ local.set $4 local.get $4 ) - (func $std/libm/sinh (; 55 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/sinh (; 58 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.sinh ) - (func $std/libm/sqrt (; 56 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/sqrt (; 59 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) local.get $0 local.set $1 local.get $1 f64.sqrt ) - (func $~lib/math/NativeMath.tan (; 57 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) - unreachable - f64.const 0 + (func $~lib/math/NativeMath.tan (; 60 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + call $~lib/bindings/Math/tan ) - (func $std/libm/tan (; 58 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/tan (; 61 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.tan ) - (func $~lib/math/NativeMath.tanh (; 59 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.tanh (; 62 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i64) (local $2 f64) (local $3 i32) @@ -4807,17 +4818,5949 @@ local.get $0 f64.copysign ) - (func $std/libm/tanh (; 60 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/tanh (; 63 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.tanh ) - (func $std/libm/trunc (; 61 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $../../lib/libm/assembly/libm/trunc (; 64 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) local.get $0 local.set $1 local.get $1 f64.trunc ) - (func $null (; 62 ;) (type $FUNCSIG$v) + (func $../../lib/libm/assembly/libmf/abs (; 65 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 f32) + local.get $0 + local.set $1 + local.get $1 + f32.abs + ) + (func $~lib/math/Rf (; 66 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 f32) + (local $2 f32) + local.get $0 + f32.const 0.16666586697101593 + local.get $0 + f32.const -0.04274342209100723 + local.get $0 + f32.const -0.008656363002955914 + f32.mul + f32.add + f32.mul + f32.add + f32.mul + local.set $1 + f32.const 1 + local.get $0 + f32.const -0.7066296339035034 + f32.mul + f32.add + local.set $2 + local.get $1 + local.get $2 + f32.div + ) + (func $~lib/math/NativeMathf.acos (; 67 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + (local $2 i32) + (local $3 f32) + (local $4 f32) + (local $5 f32) + (local $6 f32) + (local $7 f32) + local.get $0 + i32.reinterpret_f32 + local.set $1 + local.get $1 + i32.const 2147483647 + i32.and + local.set $2 + local.get $2 + i32.const 1065353216 + i32.ge_u + if + local.get $2 + i32.const 1065353216 + i32.eq + if + local.get $1 + i32.const 31 + i32.shr_u + if + f32.const 2 + f32.const 1.570796251296997 + f32.mul + f32.const 7.52316384526264e-37 + f32.add + return + end + f32.const 0 + return + end + f32.const 0 + local.get $0 + local.get $0 + f32.sub + f32.div + return + end + local.get $2 + i32.const 1056964608 + i32.lt_u + if + local.get $2 + i32.const 847249408 + i32.le_u + if + f32.const 1.570796251296997 + f32.const 7.52316384526264e-37 + f32.add + return + end + f32.const 1.570796251296997 + local.get $0 + f32.const 7.549789415861596e-08 + local.get $0 + local.get $0 + local.get $0 + f32.mul + call $~lib/math/Rf + f32.mul + f32.sub + f32.sub + f32.sub + return + end + local.get $1 + i32.const 31 + i32.shr_u + if + f32.const 0.5 + local.get $0 + f32.const 0.5 + f32.mul + f32.add + local.set $3 + local.get $3 + f32.sqrt + local.set $5 + local.get $3 + call $~lib/math/Rf + local.get $5 + f32.mul + f32.const 7.549789415861596e-08 + f32.sub + local.set $4 + f32.const 2 + f32.const 1.570796251296997 + local.get $5 + local.get $4 + f32.add + f32.sub + f32.mul + return + end + f32.const 0.5 + local.get $0 + f32.const 0.5 + f32.mul + f32.sub + local.set $3 + local.get $3 + f32.sqrt + local.set $5 + local.get $5 + i32.reinterpret_f32 + local.set $1 + local.get $1 + i32.const -4096 + i32.and + f32.reinterpret_i32 + local.set $6 + local.get $3 + local.get $6 + local.get $6 + f32.mul + f32.sub + local.get $5 + local.get $6 + f32.add + f32.div + local.set $7 + local.get $3 + call $~lib/math/Rf + local.get $5 + f32.mul + local.get $7 + f32.add + local.set $4 + f32.const 2 + local.get $6 + local.get $4 + f32.add + f32.mul + ) + (func $../../lib/libm/assembly/libmf/acos (; 68 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.acos + ) + (func $~lib/math/NativeMathf.log1p (; 69 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + (local $2 f32) + (local $3 f32) + (local $4 i32) + (local $5 f32) + (local $6 i32) + (local $7 f32) + (local $8 f32) + (local $9 f32) + (local $10 f32) + (local $11 f32) + (local $12 f32) + (local $13 f32) + (local $14 f32) + local.get $0 + i32.reinterpret_f32 + local.set $1 + f32.const 0 + local.set $2 + f32.const 0 + local.set $3 + i32.const 1 + local.set $4 + local.get $1 + i32.const 1054086096 + i32.lt_u + if (result i32) + i32.const 1 + else + local.get $1 + i32.const 31 + i32.shr_u + end + if + local.get $1 + i32.const -1082130432 + i32.ge_u + if + local.get $0 + f32.const -1 + f32.eq + if + local.get $0 + f32.const 0 + f32.div + return + end + local.get $0 + local.get $0 + f32.sub + f32.const 0 + f32.div + return + end + local.get $1 + i32.const 1 + i32.shl + i32.const 1728053248 + i32.lt_u + if + local.get $0 + return + end + local.get $1 + i32.const -1097468391 + i32.le_u + if + i32.const 0 + local.set $4 + f32.const 0 + local.set $2 + local.get $0 + local.set $3 + end + else + local.get $1 + i32.const 2139095040 + i32.ge_u + if + local.get $0 + return + end + end + local.get $4 + if + f32.const 1 + local.get $0 + f32.add + local.set $5 + local.get $5 + i32.reinterpret_f32 + local.set $6 + local.get $6 + i32.const 1065353216 + i32.const 1060439283 + i32.sub + i32.add + local.set $6 + local.get $6 + i32.const 23 + i32.shr_u + i32.const 127 + i32.sub + local.set $4 + local.get $4 + i32.const 25 + i32.lt_s + if + local.get $4 + i32.const 2 + i32.ge_s + if (result f32) + f32.const 1 + local.get $5 + local.get $0 + f32.sub + f32.sub + else + local.get $0 + local.get $5 + f32.const 1 + f32.sub + f32.sub + end + local.set $2 + local.get $2 + local.get $5 + f32.div + local.set $2 + else + f32.const 0 + local.set $2 + end + local.get $6 + i32.const 8388607 + i32.and + i32.const 1060439283 + i32.add + local.set $6 + local.get $6 + f32.reinterpret_i32 + f32.const 1 + f32.sub + local.set $3 + end + local.get $3 + f32.const 2 + local.get $3 + f32.add + f32.div + local.set $7 + local.get $7 + local.get $7 + f32.mul + local.set $8 + local.get $8 + local.get $8 + f32.mul + local.set $9 + local.get $9 + f32.const 0.40000972151756287 + local.get $9 + f32.const 0.24279078841209412 + f32.mul + f32.add + f32.mul + local.set $10 + local.get $8 + f32.const 0.6666666269302368 + local.get $9 + f32.const 0.2849878668785095 + f32.mul + f32.add + f32.mul + local.set $11 + local.get $11 + local.get $10 + f32.add + local.set $12 + f32.const 0.5 + local.get $3 + f32.mul + local.get $3 + f32.mul + local.set $13 + local.get $4 + f32.convert_i32_s + local.set $14 + local.get $7 + local.get $13 + local.get $12 + f32.add + f32.mul + local.get $14 + f32.const 9.05800061445916e-06 + f32.mul + local.get $2 + f32.add + f32.add + local.get $13 + f32.sub + local.get $3 + f32.add + local.get $14 + f32.const 0.6931381225585938 + f32.mul + f32.add + ) + (func $~lib/math/NativeMathf.log (; 70 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + (local $2 i32) + (local $3 f32) + (local $4 f32) + (local $5 f32) + (local $6 f32) + (local $7 f32) + (local $8 f32) + (local $9 f32) + (local $10 f32) + (local $11 f32) + local.get $0 + i32.reinterpret_f32 + local.set $1 + i32.const 0 + local.set $2 + local.get $1 + i32.const 8388608 + i32.lt_u + if (result i32) + i32.const 1 + else + local.get $1 + i32.const 31 + i32.shr_u + end + if + local.get $1 + i32.const 1 + i32.shl + i32.const 0 + i32.eq + if + f32.const -1 + local.get $0 + local.get $0 + f32.mul + f32.div + return + end + local.get $1 + i32.const 31 + i32.shr_u + if + local.get $0 + local.get $0 + f32.sub + f32.const 0 + f32.div + return + end + local.get $2 + i32.const 25 + i32.sub + local.set $2 + local.get $0 + f32.const 33554432 + f32.mul + local.set $0 + local.get $0 + i32.reinterpret_f32 + local.set $1 + else + local.get $1 + i32.const 2139095040 + i32.ge_u + if + local.get $0 + return + else + local.get $1 + i32.const 1065353216 + i32.eq + if + f32.const 0 + return + end + end + end + local.get $1 + i32.const 1065353216 + i32.const 1060439283 + i32.sub + i32.add + local.set $1 + local.get $2 + local.get $1 + i32.const 23 + i32.shr_s + i32.const 127 + i32.sub + i32.add + local.set $2 + local.get $1 + i32.const 8388607 + i32.and + i32.const 1060439283 + i32.add + local.set $1 + local.get $1 + f32.reinterpret_i32 + local.set $0 + local.get $0 + f32.const 1 + f32.sub + local.set $3 + local.get $3 + f32.const 2 + local.get $3 + f32.add + f32.div + local.set $4 + local.get $4 + local.get $4 + f32.mul + local.set $5 + local.get $5 + local.get $5 + f32.mul + local.set $6 + local.get $6 + f32.const 0.40000972151756287 + local.get $6 + f32.const 0.24279078841209412 + f32.mul + f32.add + f32.mul + local.set $7 + local.get $5 + f32.const 0.6666666269302368 + local.get $6 + f32.const 0.2849878668785095 + f32.mul + f32.add + f32.mul + local.set $8 + local.get $8 + local.get $7 + f32.add + local.set $9 + f32.const 0.5 + local.get $3 + f32.mul + local.get $3 + f32.mul + local.set $10 + local.get $2 + f32.convert_i32_s + local.set $11 + local.get $4 + local.get $10 + local.get $9 + f32.add + f32.mul + local.get $11 + f32.const 9.05800061445916e-06 + f32.mul + f32.add + local.get $10 + f32.sub + local.get $3 + f32.add + local.get $11 + f32.const 0.6931381225585938 + f32.mul + f32.add + ) + (func $~lib/math/NativeMathf.acosh (; 71 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + (local $2 i32) + (local $3 f32) + local.get $0 + i32.reinterpret_f32 + local.set $1 + local.get $1 + i32.const 2147483647 + i32.and + local.set $2 + local.get $2 + i32.const 1073741824 + i32.lt_u + if + local.get $0 + f32.const 1 + f32.sub + local.set $3 + local.get $3 + local.get $3 + local.get $3 + f32.const 2 + f32.add + f32.mul + f32.sqrt + f32.add + call $~lib/math/NativeMathf.log1p + return + end + local.get $2 + i32.const 1166016512 + i32.lt_u + if + f32.const 2 + local.get $0 + f32.mul + f32.const 1 + local.get $0 + local.get $0 + local.get $0 + f32.mul + f32.const 1 + f32.sub + f32.sqrt + f32.add + f32.div + f32.sub + call $~lib/math/NativeMathf.log + return + end + local.get $0 + call $~lib/math/NativeMathf.log + f32.const 0.6931471824645996 + f32.add + ) + (func $../../lib/libm/assembly/libmf/acosh (; 72 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.acosh + ) + (func $~lib/math/NativeMathf.asin (; 73 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 f32) + (local $2 i32) + (local $3 f32) + (local $4 f64) + local.get $0 + local.set $1 + local.get $0 + i32.reinterpret_f32 + i32.const 2147483647 + i32.and + local.set $2 + local.get $2 + i32.const 1065353216 + i32.ge_u + if + local.get $2 + i32.const 1065353216 + i32.eq + if + local.get $0 + f32.const 1.5707963705062866 + f32.mul + f32.const 7.52316384526264e-37 + f32.add + return + end + f32.const 0 + local.get $0 + local.get $0 + f32.sub + f32.div + return + end + local.get $2 + i32.const 1056964608 + i32.lt_u + if + local.get $2 + i32.const 964689920 + i32.lt_u + if (result i32) + local.get $2 + i32.const 8388608 + i32.ge_u + else + i32.const 0 + end + if + local.get $0 + return + end + local.get $0 + local.get $0 + local.get $0 + local.get $0 + f32.mul + call $~lib/math/Rf + f32.mul + f32.add + return + end + f32.const 0.5 + local.get $0 + f32.abs + f32.const 0.5 + f32.mul + f32.sub + local.set $3 + local.get $3 + f64.promote_f32 + f64.sqrt + local.set $4 + f32.const 1.5707963705062866 + f64.promote_f32 + f32.const 2 + f64.promote_f32 + local.get $4 + local.get $4 + local.get $3 + call $~lib/math/Rf + f64.promote_f32 + f64.mul + f64.add + f64.mul + f64.sub + f32.demote_f64 + local.set $0 + local.get $0 + local.get $1 + f32.copysign + ) + (func $../../lib/libm/assembly/libmf/asin (; 74 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.asin + ) + (func $~lib/math/NativeMathf.asinh (; 75 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + (local $2 f32) + local.get $0 + i32.reinterpret_f32 + i32.const 2147483647 + i32.and + local.set $1 + local.get $1 + f32.reinterpret_i32 + local.set $2 + local.get $1 + i32.const 1166016512 + i32.ge_u + if + local.get $2 + call $~lib/math/NativeMathf.log + f32.const 0.6931471824645996 + f32.add + local.set $2 + else + local.get $1 + i32.const 1073741824 + i32.ge_u + if + f32.const 2 + local.get $2 + f32.mul + f32.const 1 + local.get $2 + local.get $2 + f32.mul + f32.const 1 + f32.add + f32.sqrt + local.get $2 + f32.add + f32.div + f32.add + call $~lib/math/NativeMathf.log + local.set $2 + else + local.get $1 + i32.const 964689920 + i32.ge_u + if + local.get $2 + local.get $2 + local.get $2 + f32.mul + local.get $2 + local.get $2 + f32.mul + f32.const 1 + f32.add + f32.sqrt + f32.const 1 + f32.add + f32.div + f32.add + call $~lib/math/NativeMathf.log1p + local.set $2 + end + end + end + local.get $2 + local.get $0 + f32.copysign + ) + (func $../../lib/libm/assembly/libmf/asinh (; 76 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.asinh + ) + (func $~lib/builtins/isNaN (; 77 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) + local.get $0 + local.get $0 + f32.ne + ) + (func $~lib/math/NativeMathf.atan (; 78 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + (local $2 f32) + (local $3 f32) + (local $4 i32) + (local $5 f32) + (local $6 f32) + (local $7 f32) + (local $8 f32) + (local $9 i32) + local.get $0 + i32.reinterpret_f32 + local.set $1 + local.get $0 + local.set $2 + local.get $1 + i32.const 2147483647 + i32.and + local.set $1 + local.get $1 + i32.const 1283457024 + i32.ge_u + if + local.get $0 + call $~lib/builtins/isNaN + if + local.get $0 + return + end + f32.const 1.570796251296997 + f32.const 7.52316384526264e-37 + f32.add + local.set $3 + local.get $3 + local.get $2 + f32.copysign + return + end + local.get $1 + i32.const 1054867456 + i32.lt_u + if + local.get $1 + i32.const 964689920 + i32.lt_u + if + local.get $0 + return + end + i32.const -1 + local.set $4 + else + local.get $0 + f32.abs + local.set $0 + local.get $1 + i32.const 1066926080 + i32.lt_u + if + local.get $1 + i32.const 1060110336 + i32.lt_u + if + i32.const 0 + local.set $4 + f32.const 2 + local.get $0 + f32.mul + f32.const 1 + f32.sub + f32.const 2 + local.get $0 + f32.add + f32.div + local.set $0 + else + i32.const 1 + local.set $4 + local.get $0 + f32.const 1 + f32.sub + local.get $0 + f32.const 1 + f32.add + f32.div + local.set $0 + end + else + local.get $1 + i32.const 1075576832 + i32.lt_u + if + i32.const 2 + local.set $4 + local.get $0 + f32.const 1.5 + f32.sub + f32.const 1 + f32.const 1.5 + local.get $0 + f32.mul + f32.add + f32.div + local.set $0 + else + i32.const 3 + local.set $4 + f32.const -1 + local.get $0 + f32.div + local.set $0 + end + end + end + local.get $0 + local.get $0 + f32.mul + local.set $3 + local.get $3 + local.get $3 + f32.mul + local.set $5 + local.get $3 + f32.const 0.333333283662796 + local.get $5 + f32.const 0.14253635704517365 + local.get $5 + f32.const 0.06168760731816292 + f32.mul + f32.add + f32.mul + f32.add + f32.mul + local.set $6 + local.get $5 + f32.const -0.19999158382415771 + local.get $5 + f32.const -0.106480173766613 + f32.mul + f32.add + f32.mul + local.set $7 + local.get $0 + local.get $6 + local.get $7 + f32.add + f32.mul + local.set $8 + local.get $4 + i32.const 0 + i32.lt_s + if + local.get $0 + local.get $8 + f32.sub + return + end + block $break|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $4 + local.set $9 + local.get $9 + i32.const 0 + i32.eq + br_if $case0|0 + local.get $9 + i32.const 1 + i32.eq + br_if $case1|0 + local.get $9 + i32.const 2 + i32.eq + br_if $case2|0 + local.get $9 + i32.const 3 + i32.eq + br_if $case3|0 + br $case4|0 + end + block + f32.const 0.46364760398864746 + local.get $8 + f32.const 5.01215824399992e-09 + f32.sub + local.get $0 + f32.sub + f32.sub + local.set $3 + br $break|0 + unreachable + end + unreachable + end + block + f32.const 0.7853981256484985 + local.get $8 + f32.const 3.774894707930798e-08 + f32.sub + local.get $0 + f32.sub + f32.sub + local.set $3 + br $break|0 + unreachable + end + unreachable + end + block + f32.const 0.9827936887741089 + local.get $8 + f32.const 3.447321716976148e-08 + f32.sub + local.get $0 + f32.sub + f32.sub + local.set $3 + br $break|0 + unreachable + end + unreachable + end + block + f32.const 1.570796251296997 + local.get $8 + f32.const 7.549789415861596e-08 + f32.sub + local.get $0 + f32.sub + f32.sub + local.set $3 + br $break|0 + unreachable + end + unreachable + end + unreachable + end + local.get $3 + local.get $2 + f32.copysign + ) + (func $../../lib/libm/assembly/libmf/atan (; 79 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.atan + ) + (func $~lib/math/NativeMathf.atanh (; 80 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + (local $2 f32) + local.get $0 + i32.reinterpret_f32 + local.set $1 + local.get $1 + i32.const 2147483647 + i32.and + local.set $1 + local.get $1 + f32.reinterpret_i32 + local.set $2 + local.get $1 + i32.const 1056964608 + i32.lt_u + if + local.get $1 + i32.const 796917760 + i32.ge_u + if + f32.const 0.5 + f32.const 2 + local.get $2 + f32.mul + f32.const 1 + local.get $2 + f32.const 1 + local.get $2 + f32.sub + f32.div + f32.add + f32.mul + call $~lib/math/NativeMathf.log1p + f32.mul + local.set $2 + end + else + f32.const 0.5 + f32.const 2 + local.get $2 + f32.const 1 + local.get $2 + f32.sub + f32.div + f32.mul + call $~lib/math/NativeMathf.log1p + f32.mul + local.set $2 + end + local.get $2 + local.get $0 + f32.copysign + ) + (func $../../lib/libm/assembly/libmf/atanh (; 81 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.atanh + ) + (func $~lib/math/NativeMathf.atan2 (; 82 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 f32) + local.get $1 + call $~lib/builtins/isNaN + if (result i32) + i32.const 1 + else + local.get $0 + call $~lib/builtins/isNaN + end + if + local.get $1 + local.get $0 + f32.add + return + end + local.get $1 + i32.reinterpret_f32 + local.set $2 + local.get $0 + i32.reinterpret_f32 + local.set $3 + local.get $2 + i32.const 1065353216 + i32.eq + if + local.get $0 + call $~lib/math/NativeMathf.atan + return + end + local.get $3 + i32.const 31 + i32.shr_u + i32.const 1 + i32.and + local.get $2 + i32.const 30 + i32.shr_u + i32.const 2 + i32.and + i32.or + local.set $4 + local.get $2 + i32.const 2147483647 + i32.and + local.set $2 + local.get $3 + i32.const 2147483647 + i32.and + local.set $3 + local.get $3 + i32.const 0 + i32.eq + if + block $break|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $4 + local.set $5 + local.get $5 + i32.const 0 + i32.eq + br_if $case0|0 + local.get $5 + i32.const 1 + i32.eq + br_if $case1|0 + local.get $5 + i32.const 2 + i32.eq + br_if $case2|0 + local.get $5 + i32.const 3 + i32.eq + br_if $case3|0 + br $break|0 + end + end + local.get $0 + return + end + f32.const 3.1415927410125732 + return + end + f32.const 3.1415927410125732 + f32.neg + return + end + end + local.get $2 + i32.const 0 + i32.eq + if + local.get $4 + i32.const 1 + i32.and + if (result f32) + f32.const 3.1415927410125732 + f32.neg + f32.const 2 + f32.div + else + f32.const 3.1415927410125732 + f32.const 2 + f32.div + end + return + end + local.get $2 + i32.const 2139095040 + i32.eq + if + local.get $3 + i32.const 2139095040 + i32.eq + if + block $break|1 + block $case3|1 + block $case2|1 + block $case1|1 + block $case0|1 + local.get $4 + local.set $5 + local.get $5 + i32.const 0 + i32.eq + br_if $case0|1 + local.get $5 + i32.const 1 + i32.eq + br_if $case1|1 + local.get $5 + i32.const 2 + i32.eq + br_if $case2|1 + local.get $5 + i32.const 3 + i32.eq + br_if $case3|1 + br $break|1 + end + f32.const 3.1415927410125732 + f32.const 4 + f32.div + return + end + f32.const 3.1415927410125732 + f32.neg + f32.const 4 + f32.div + return + end + f32.const 3 + f32.const 3.1415927410125732 + f32.mul + f32.const 4 + f32.div + return + end + f32.const -3 + f32.const 3.1415927410125732 + f32.mul + f32.const 4 + f32.div + return + end + else + block $break|2 + block $case3|2 + block $case2|2 + block $case1|2 + block $case0|2 + local.get $4 + local.set $5 + local.get $5 + i32.const 0 + i32.eq + br_if $case0|2 + local.get $5 + i32.const 1 + i32.eq + br_if $case1|2 + local.get $5 + i32.const 2 + i32.eq + br_if $case2|2 + local.get $5 + i32.const 3 + i32.eq + br_if $case3|2 + br $break|2 + end + f32.const 0 + return + end + f32.const 0 + return + end + f32.const 3.1415927410125732 + return + end + f32.const 3.1415927410125732 + f32.neg + return + end + end + end + local.get $2 + i32.const 218103808 + i32.add + local.get $3 + i32.lt_u + if (result i32) + i32.const 1 + else + local.get $3 + i32.const 2139095040 + i32.eq + end + if + local.get $4 + i32.const 1 + i32.and + if (result f32) + f32.const 3.1415927410125732 + f32.neg + f32.const 2 + f32.div + else + f32.const 3.1415927410125732 + f32.const 2 + f32.div + end + return + end + local.get $4 + i32.const 2 + i32.and + if (result i32) + local.get $3 + i32.const 218103808 + i32.add + local.get $2 + i32.lt_u + else + i32.const 0 + end + if + f32.const 0 + local.set $6 + else + local.get $0 + local.get $1 + f32.div + f32.abs + call $~lib/math/NativeMathf.atan + local.set $6 + end + block $break|3 + block $case3|3 + block $case2|3 + block $case1|3 + block $case0|3 + local.get $4 + local.set $5 + local.get $5 + i32.const 0 + i32.eq + br_if $case0|3 + local.get $5 + i32.const 1 + i32.eq + br_if $case1|3 + local.get $5 + i32.const 2 + i32.eq + br_if $case2|3 + local.get $5 + i32.const 3 + i32.eq + br_if $case3|3 + br $break|3 + end + local.get $6 + return + end + local.get $6 + f32.neg + return + end + f32.const 3.1415927410125732 + local.get $6 + f32.const -8.742277657347586e-08 + f32.sub + f32.sub + return + end + local.get $6 + f32.const -8.742277657347586e-08 + f32.sub + f32.const 3.1415927410125732 + f32.sub + return + end + unreachable + f32.const 0 + ) + (func $../../lib/libm/assembly/libmf/atan2 (; 83 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + local.get $0 + local.get $1 + call $~lib/math/NativeMathf.atan2 + ) + (func $~lib/math/NativeMathf.cbrt (; 84 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + (local $2 i32) + (local $3 f64) + (local $4 f64) + local.get $0 + i32.reinterpret_f32 + local.set $1 + local.get $1 + i32.const 2147483647 + i32.and + local.set $2 + local.get $2 + i32.const 2139095040 + i32.ge_u + if + local.get $0 + local.get $0 + f32.add + return + end + local.get $2 + i32.const 8388608 + i32.lt_u + if + local.get $2 + i32.const 0 + i32.eq + if + local.get $0 + return + end + local.get $0 + f32.const 16777216 + f32.mul + i32.reinterpret_f32 + local.set $1 + local.get $1 + i32.const 2147483647 + i32.and + local.set $2 + local.get $2 + i32.const 3 + i32.div_u + i32.const 642849266 + i32.add + local.set $2 + else + local.get $2 + i32.const 3 + i32.div_u + i32.const 709958130 + i32.add + local.set $2 + end + local.get $1 + i32.const -2147483648 + i32.and + local.set $1 + local.get $1 + local.get $2 + i32.or + local.set $1 + local.get $1 + f32.reinterpret_i32 + f64.promote_f32 + local.set $3 + local.get $3 + local.get $3 + f64.mul + local.get $3 + f64.mul + local.set $4 + local.get $3 + local.get $0 + f64.promote_f32 + local.get $0 + f64.promote_f32 + f64.add + local.get $4 + f64.add + f64.mul + local.get $0 + f64.promote_f32 + local.get $4 + f64.add + local.get $4 + f64.add + f64.div + local.set $3 + local.get $3 + local.get $3 + f64.mul + local.get $3 + f64.mul + local.set $4 + local.get $3 + local.get $0 + f64.promote_f32 + local.get $0 + f64.promote_f32 + f64.add + local.get $4 + f64.add + f64.mul + local.get $0 + f64.promote_f32 + local.get $4 + f64.add + local.get $4 + f64.add + f64.div + local.set $3 + local.get $3 + f32.demote_f64 + ) + (func $../../lib/libm/assembly/libmf/cbrt (; 85 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.cbrt + ) + (func $../../lib/libm/assembly/libmf/ceil (; 86 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 f32) + local.get $0 + local.set $1 + local.get $1 + f32.ceil + ) + (func $~lib/builtins/isFinite (; 87 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) + local.get $0 + local.get $0 + f32.sub + f32.const 0 + f32.eq + ) + (func $~lib/math/NativeMathf.clz32 (; 88 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/builtins/isFinite + i32.eqz + if + f32.const 32 + return + end + local.get $0 + f32.const 4294967296 + local.get $0 + f32.const 1 + f32.const 4294967296 + f32.div + f32.mul + f32.floor + f32.mul + f32.sub + i64.trunc_f32_s + i32.wrap_i64 + i32.clz + f32.convert_i32_s + ) + (func $../../lib/libm/assembly/libmf/clz32 (; 89 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.clz32 + ) + (func $~lib/array/Array#__unchecked_get (; 90 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 3 + i32.shl + i32.add + i64.load + ) + (func $~lib/math/NativeMathf.cos (; 91 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + (local $2 i32) + (local $3 f64) + (local $4 f64) + (local $5 f64) + (local $6 f64) + (local $7 f64) + (local $8 i32) + (local $9 i32) + (local $10 f32) + (local $11 i32) + (local $12 f32) + (local $13 i32) + (local $14 i32) + (local $15 i32) + (local $16 i64) + (local $17 i64) + (local $18 i64) + (local $19 i64) + (local $20 i64) + (local $21 i64) + (local $22 i64) + (local $23 i32) + (local $24 i32) + (local $25 f64) + (local $26 f32) + local.get $0 + i32.reinterpret_f32 + local.set $1 + local.get $1 + i32.const 31 + i32.shr_u + local.set $2 + local.get $1 + i32.const 2147483647 + i32.and + local.set $1 + local.get $1 + i32.const 1061752794 + i32.le_u + if + local.get $1 + i32.const 964689920 + i32.lt_u + if + f32.const 1 + return + end + block $~lib/math/cos_kernf|inlined.0 (result f32) + local.get $0 + f64.promote_f32 + local.set $3 + local.get $3 + local.get $3 + f64.mul + local.set $4 + local.get $4 + local.get $4 + f64.mul + local.set $5 + f64.const -0.001388676377460993 + local.get $4 + f64.const 2.439044879627741e-05 + f64.mul + f64.add + local.set $6 + f32.const 1 + f64.promote_f32 + local.get $4 + f64.const -0.499999997251031 + f64.mul + f64.add + local.get $5 + f64.const 0.04166662332373906 + f64.mul + f64.add + local.get $5 + local.get $4 + f64.mul + local.get $6 + f64.mul + f64.add + f32.demote_f64 + end + return + end + local.get $1 + i32.const 1081824209 + i32.le_u + if + local.get $1 + i32.const 1075235811 + i32.gt_u + if + block $~lib/math/cos_kernf|inlined.1 (result f32) + local.get $2 + if (result f64) + local.get $0 + f64.promote_f32 + f64.const 3.141592653589793 + f64.add + else + local.get $0 + f64.promote_f32 + f64.const 3.141592653589793 + f64.sub + end + local.set $3 + local.get $3 + local.get $3 + f64.mul + local.set $6 + local.get $6 + local.get $6 + f64.mul + local.set $5 + f64.const -0.001388676377460993 + local.get $6 + f64.const 2.439044879627741e-05 + f64.mul + f64.add + local.set $4 + f32.const 1 + f64.promote_f32 + local.get $6 + f64.const -0.499999997251031 + f64.mul + f64.add + local.get $5 + f64.const 0.04166662332373906 + f64.mul + f64.add + local.get $5 + local.get $6 + f64.mul + local.get $4 + f64.mul + f64.add + f32.demote_f64 + end + f32.neg + return + else + local.get $2 + if (result f32) + local.get $0 + f64.promote_f32 + f64.const 1.5707963267948966 + f64.add + local.set $3 + local.get $3 + local.get $3 + f64.mul + local.set $4 + local.get $4 + local.get $4 + f64.mul + local.set $5 + f64.const -1.9839334836096632e-04 + local.get $4 + f64.const 2.718311493989822e-06 + f64.mul + f64.add + local.set $6 + local.get $4 + local.get $3 + f64.mul + local.set $7 + local.get $3 + local.get $7 + f64.const -0.16666666641626524 + local.get $4 + f64.const 0.008333329385889463 + f64.mul + f64.add + f64.mul + f64.add + local.get $7 + local.get $5 + f64.mul + local.get $6 + f64.mul + f64.add + f32.demote_f64 + else + f64.const 1.5707963267948966 + local.get $0 + f64.promote_f32 + f64.sub + local.set $3 + local.get $3 + local.get $3 + f64.mul + local.set $7 + local.get $7 + local.get $7 + f64.mul + local.set $6 + f64.const -1.9839334836096632e-04 + local.get $7 + f64.const 2.718311493989822e-06 + f64.mul + f64.add + local.set $5 + local.get $7 + local.get $3 + f64.mul + local.set $4 + local.get $3 + local.get $4 + f64.const -0.16666666641626524 + local.get $7 + f64.const 0.008333329385889463 + f64.mul + f64.add + f64.mul + f64.add + local.get $4 + local.get $6 + f64.mul + local.get $5 + f64.mul + f64.add + f32.demote_f64 + end + return + end + unreachable + unreachable + end + local.get $1 + i32.const 1088565717 + i32.le_u + if + local.get $1 + i32.const 1085271519 + i32.gt_u + if + block $~lib/math/cos_kernf|inlined.2 (result f32) + local.get $2 + if (result f64) + local.get $0 + f64.promote_f32 + f64.const 6.283185307179586 + f64.add + else + local.get $0 + f64.promote_f32 + f64.const 6.283185307179586 + f64.sub + end + local.set $3 + local.get $3 + local.get $3 + f64.mul + local.set $4 + local.get $4 + local.get $4 + f64.mul + local.set $5 + f64.const -0.001388676377460993 + local.get $4 + f64.const 2.439044879627741e-05 + f64.mul + f64.add + local.set $6 + f32.const 1 + f64.promote_f32 + local.get $4 + f64.const -0.499999997251031 + f64.mul + f64.add + local.get $5 + f64.const 0.04166662332373906 + f64.mul + f64.add + local.get $5 + local.get $4 + f64.mul + local.get $6 + f64.mul + f64.add + f32.demote_f64 + end + return + else + local.get $2 + if (result f32) + local.get $0 + f32.neg + f64.promote_f32 + f64.const 4.71238898038469 + f64.sub + local.set $7 + local.get $7 + local.get $7 + f64.mul + local.set $6 + local.get $6 + local.get $6 + f64.mul + local.set $5 + f64.const -1.9839334836096632e-04 + local.get $6 + f64.const 2.718311493989822e-06 + f64.mul + f64.add + local.set $4 + local.get $6 + local.get $7 + f64.mul + local.set $3 + local.get $7 + local.get $3 + f64.const -0.16666666641626524 + local.get $6 + f64.const 0.008333329385889463 + f64.mul + f64.add + f64.mul + f64.add + local.get $3 + local.get $5 + f64.mul + local.get $4 + f64.mul + f64.add + f32.demote_f64 + else + local.get $0 + f64.promote_f32 + f64.const 4.71238898038469 + f64.sub + local.set $7 + local.get $7 + local.get $7 + f64.mul + local.set $3 + local.get $3 + local.get $3 + f64.mul + local.set $4 + f64.const -1.9839334836096632e-04 + local.get $3 + f64.const 2.718311493989822e-06 + f64.mul + f64.add + local.set $5 + local.get $3 + local.get $7 + f64.mul + local.set $6 + local.get $7 + local.get $6 + f64.const -0.16666666641626524 + local.get $3 + f64.const 0.008333329385889463 + f64.mul + f64.add + f64.mul + f64.add + local.get $6 + local.get $4 + f64.mul + local.get $5 + f64.mul + f64.add + f32.demote_f64 + end + return + end + unreachable + unreachable + end + local.get $1 + i32.const 2139095040 + i32.ge_u + if + local.get $0 + local.get $0 + f32.sub + return + end + block $~lib/math/rempio2f|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $1 + local.set $9 + local.get $2 + local.set $8 + local.get $9 + i32.const 1305022427 + i32.lt_u + if + local.get $10 + f64.promote_f32 + f64.const 0.6366197723675814 + f64.mul + f64.nearest + local.set $6 + local.get $10 + f64.promote_f32 + local.get $6 + f64.const 1.5707963109016418 + f64.mul + f64.sub + local.get $6 + f64.const 1.5893254773528196e-08 + f64.mul + f64.sub + global.set $~lib/math/rempio2f_y + local.get $6 + i32.trunc_f64_s + br $~lib/math/rempio2f|inlined.0 + end + block $~lib/math/pio2_large_quot|inlined.0 (result i32) + local.get $10 + local.set $12 + local.get $9 + local.set $11 + local.get $11 + i32.const 23 + i32.shr_s + i32.const 152 + i32.sub + local.set $13 + local.get $13 + i32.const 6 + i32.shr_s + local.set $14 + local.get $13 + i32.const 63 + i32.and + local.set $15 + i32.const 72 + local.get $14 + i32.const 0 + i32.add + call $~lib/array/Array#__unchecked_get + local.set $16 + i32.const 72 + local.get $14 + i32.const 1 + i32.add + call $~lib/array/Array#__unchecked_get + local.set $17 + local.get $15 + i32.const 32 + i32.gt_s + if + i32.const 72 + local.get $14 + i32.const 2 + i32.add + call $~lib/array/Array#__unchecked_get + local.set $19 + local.get $19 + i64.const 96 + local.get $15 + i64.extend_i32_s + i64.sub + i64.shr_u + local.set $18 + local.get $18 + local.get $17 + local.get $15 + i32.const 32 + i32.sub + i64.extend_i32_s + i64.shl + i64.or + local.set $18 + else + local.get $17 + i64.const 32 + local.get $15 + i64.extend_i32_s + i64.sub + i64.shr_u + local.set $18 + end + local.get $17 + i64.const 64 + local.get $15 + i64.extend_i32_s + i64.sub + i64.shr_u + local.get $16 + local.get $15 + i64.extend_i32_s + i64.shl + i64.or + local.set $19 + local.get $11 + i32.const 8388607 + i32.and + i32.const 8388608 + i32.or + i64.extend_i32_s + local.set $20 + local.get $20 + local.get $19 + i64.mul + local.get $20 + local.get $18 + i64.mul + i64.const 32 + i64.shr_u + i64.add + local.set $21 + local.get $21 + i64.const 2 + i64.shl + local.set $22 + local.get $21 + i64.const 62 + i64.shr_u + local.get $22 + i64.const 63 + i64.shr_u + i64.add + i32.wrap_i64 + local.set $23 + f64.const 8.515303950216386e-20 + local.get $12 + f64.promote_f32 + f64.copysign + local.get $22 + f64.convert_i64_s + f64.mul + global.set $~lib/math/rempio2f_y + local.get $23 + end + local.set $23 + i32.const 0 + local.get $23 + i32.sub + local.get $23 + local.get $8 + select + end + local.set $24 + global.get $~lib/math/rempio2f_y + local.set $25 + local.get $24 + i32.const 1 + i32.and + if (result f32) + local.get $25 + local.set $7 + local.get $7 + local.get $7 + f64.mul + local.set $6 + local.get $6 + local.get $6 + f64.mul + local.set $5 + f64.const -1.9839334836096632e-04 + local.get $6 + f64.const 2.718311493989822e-06 + f64.mul + f64.add + local.set $4 + local.get $6 + local.get $7 + f64.mul + local.set $3 + local.get $7 + local.get $3 + f64.const -0.16666666641626524 + local.get $6 + f64.const 0.008333329385889463 + f64.mul + f64.add + f64.mul + f64.add + local.get $3 + local.get $5 + f64.mul + local.get $4 + f64.mul + f64.add + f32.demote_f64 + else + local.get $25 + local.set $7 + local.get $7 + local.get $7 + f64.mul + local.set $3 + local.get $3 + local.get $3 + f64.mul + local.set $4 + f64.const -0.001388676377460993 + local.get $3 + f64.const 2.439044879627741e-05 + f64.mul + f64.add + local.set $5 + f32.const 1 + f64.promote_f32 + local.get $3 + f64.const -0.499999997251031 + f64.mul + f64.add + local.get $4 + f64.const 0.04166662332373906 + f64.mul + f64.add + local.get $4 + local.get $3 + f64.mul + local.get $5 + f64.mul + f64.add + f32.demote_f64 + end + local.set $26 + local.get $24 + i32.const 1 + i32.add + i32.const 2 + i32.and + if (result f32) + local.get $26 + f32.neg + else + local.get $26 + end + ) + (func $../../lib/libm/assembly/libmf/cos (; 92 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.cos + ) + (func $~lib/math/NativeMathf.expm1 (; 93 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 f32) + (local $5 f32) + (local $6 i32) + (local $7 f32) + (local $8 f32) + (local $9 f32) + (local $10 f32) + (local $11 f32) + (local $12 f32) + (local $13 f32) + (local $14 f32) + local.get $0 + i32.reinterpret_f32 + local.set $1 + local.get $1 + i32.const 2147483647 + i32.and + local.set $2 + local.get $1 + i32.const 31 + i32.shr_u + local.set $3 + local.get $2 + i32.const 1100331076 + i32.ge_u + if + local.get $2 + i32.const 2139095040 + i32.gt_u + if + local.get $0 + return + end + local.get $3 + if + f32.const -1 + return + end + local.get $0 + f32.const 88.7216796875 + f32.gt + if + local.get $0 + f32.const 1701411834604692317316873e14 + f32.mul + local.set $0 + local.get $0 + return + end + end + f32.const 0 + local.set $4 + local.get $2 + i32.const 1051816472 + i32.gt_u + if + i32.const 1 + local.get $3 + i32.const 1 + i32.shl + i32.sub + f32.const 1.4426950216293335 + local.get $0 + f32.mul + f32.const 0.5 + local.get $0 + f32.copysign + f32.add + i32.trunc_f32_s + local.get $2 + i32.const 1065686418 + i32.lt_u + select + local.set $6 + local.get $6 + f32.convert_i32_s + local.set $5 + local.get $0 + local.get $5 + f32.const 0.6931381225585938 + f32.mul + f32.sub + local.set $7 + local.get $5 + f32.const 9.05800061445916e-06 + f32.mul + local.set $8 + local.get $7 + local.get $8 + f32.sub + local.set $0 + local.get $7 + local.get $0 + f32.sub + local.get $8 + f32.sub + local.set $4 + else + local.get $2 + i32.const 855638016 + i32.lt_u + if + local.get $0 + return + else + i32.const 0 + local.set $6 + end + end + f32.const 0.5 + local.get $0 + f32.mul + local.set $9 + local.get $0 + local.get $9 + f32.mul + local.set $10 + f32.const 1 + local.get $10 + f32.const -0.03333321213722229 + local.get $10 + f32.const 1.5807170420885086e-03 + f32.mul + f32.add + f32.mul + f32.add + local.set $11 + f32.const 3 + local.get $11 + local.get $9 + f32.mul + f32.sub + local.set $5 + local.get $10 + local.get $11 + local.get $5 + f32.sub + f32.const 6 + local.get $0 + local.get $5 + f32.mul + f32.sub + f32.div + f32.mul + local.set $12 + local.get $6 + i32.const 0 + i32.eq + if + local.get $0 + local.get $0 + local.get $12 + f32.mul + local.get $10 + f32.sub + f32.sub + return + end + local.get $0 + local.get $12 + local.get $4 + f32.sub + f32.mul + local.get $4 + f32.sub + local.set $12 + local.get $12 + local.get $10 + f32.sub + local.set $12 + local.get $6 + i32.const -1 + i32.eq + if + f32.const 0.5 + local.get $0 + local.get $12 + f32.sub + f32.mul + f32.const 0.5 + f32.sub + return + end + local.get $6 + i32.const 1 + i32.eq + if + local.get $0 + f32.const -0.25 + f32.lt + if + f32.const -2 + local.get $12 + local.get $0 + f32.const 0.5 + f32.add + f32.sub + f32.mul + return + end + f32.const 1 + f32.const 2 + local.get $0 + local.get $12 + f32.sub + f32.mul + f32.add + return + end + i32.const 127 + local.get $6 + i32.add + i32.const 23 + i32.shl + local.set $1 + local.get $1 + f32.reinterpret_i32 + local.set $13 + local.get $6 + i32.const 0 + i32.lt_s + if (result i32) + i32.const 1 + else + local.get $6 + i32.const 56 + i32.gt_s + end + if + local.get $0 + local.get $12 + f32.sub + f32.const 1 + f32.add + local.set $14 + local.get $6 + i32.const 128 + i32.eq + if + local.get $14 + f32.const 2 + f32.mul + f32.const 1701411834604692317316873e14 + f32.mul + local.set $14 + else + local.get $14 + local.get $13 + f32.mul + local.set $14 + end + local.get $14 + f32.const 1 + f32.sub + return + end + i32.const 127 + local.get $6 + i32.sub + i32.const 23 + i32.shl + local.set $1 + local.get $1 + f32.reinterpret_i32 + local.set $14 + local.get $6 + i32.const 20 + i32.lt_s + if + f32.const 1 + local.get $14 + f32.sub + local.get $12 + f32.sub + local.set $14 + else + f32.const 1 + local.get $12 + local.get $14 + f32.add + f32.sub + local.set $14 + end + local.get $0 + local.get $14 + f32.add + local.get $13 + f32.mul + ) + (func $~lib/math/NativeMathf.scalbn (; 94 ;) (type $FUNCSIG$ffi) (param $0 f32) (param $1 i32) (result f32) + (local $2 f32) + (local $3 i32) + (local $4 i32) + local.get $0 + local.set $2 + local.get $1 + i32.const 127 + i32.gt_s + if + local.get $2 + f32.const 1701411834604692317316873e14 + f32.mul + local.set $2 + local.get $1 + i32.const 127 + i32.sub + local.set $1 + local.get $1 + i32.const 127 + i32.gt_s + if + local.get $2 + f32.const 1701411834604692317316873e14 + f32.mul + local.set $2 + local.get $1 + i32.const 127 + i32.sub + local.tee $3 + i32.const 127 + local.tee $4 + local.get $3 + local.get $4 + i32.lt_s + select + local.set $1 + end + else + local.get $1 + i32.const -126 + i32.lt_s + if + local.get $2 + f32.const 1.1754943508222875e-38 + f32.const 16777216 + f32.mul + f32.mul + local.set $2 + local.get $1 + i32.const 126 + i32.const 24 + i32.sub + i32.add + local.set $1 + local.get $1 + i32.const -126 + i32.lt_s + if + local.get $2 + f32.const 1.1754943508222875e-38 + f32.const 16777216 + f32.mul + f32.mul + local.set $2 + local.get $1 + i32.const 126 + i32.add + i32.const 24 + i32.sub + local.tee $3 + i32.const -126 + local.tee $4 + local.get $3 + local.get $4 + i32.gt_s + select + local.set $1 + end + end + end + local.get $2 + i32.const 127 + local.get $1 + i32.add + i32.const 23 + i32.shl + f32.reinterpret_i32 + f32.mul + ) + (func $~lib/math/NativeMathf.exp (; 95 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + (local $2 i32) + (local $3 f32) + (local $4 f32) + (local $5 i32) + (local $6 f32) + (local $7 f32) + (local $8 f32) + local.get $0 + i32.reinterpret_f32 + local.set $1 + local.get $1 + i32.const 31 + i32.shr_u + local.set $2 + local.get $1 + i32.const 2147483647 + i32.and + local.set $1 + local.get $1 + i32.const 1118743632 + i32.ge_u + if + local.get $1 + i32.const 1118925336 + i32.ge_u + if + local.get $2 + i32.eqz + if + local.get $0 + f32.const 1701411834604692317316873e14 + f32.mul + return + else + local.get $1 + i32.const 1120924085 + i32.ge_u + if + f32.const 0 + return + end + end + end + end + local.get $1 + i32.const 1051816472 + i32.gt_u + if + local.get $1 + i32.const 1065686418 + i32.gt_u + if + f32.const 1.4426950216293335 + local.get $0 + f32.mul + f32.const 0.5 + local.get $0 + f32.copysign + f32.add + i32.trunc_f32_s + local.set $5 + else + i32.const 1 + local.get $2 + i32.const 1 + i32.shl + i32.sub + local.set $5 + end + local.get $0 + local.get $5 + f32.convert_i32_s + f32.const 0.693145751953125 + f32.mul + f32.sub + local.set $3 + local.get $5 + f32.convert_i32_s + f32.const 1.428606765330187e-06 + f32.mul + local.set $4 + local.get $3 + local.get $4 + f32.sub + local.set $0 + else + local.get $1 + i32.const 956301312 + i32.gt_u + if + i32.const 0 + local.set $5 + local.get $0 + local.set $3 + f32.const 0 + local.set $4 + else + f32.const 1 + local.get $0 + f32.add + return + end + end + local.get $0 + local.get $0 + f32.mul + local.set $6 + local.get $0 + local.get $6 + f32.const 0.16666625440120697 + local.get $6 + f32.const -2.7667332906275988e-03 + f32.mul + f32.add + f32.mul + f32.sub + local.set $7 + f32.const 1 + local.get $0 + local.get $7 + f32.mul + f32.const 2 + local.get $7 + f32.sub + f32.div + local.get $4 + f32.sub + local.get $3 + f32.add + f32.add + local.set $8 + local.get $5 + i32.const 0 + i32.eq + if + local.get $8 + return + end + local.get $8 + local.get $5 + call $~lib/math/NativeMathf.scalbn + ) + (func $~lib/math/NativeMathf.cosh (; 96 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + (local $2 f32) + (local $3 f32) + local.get $0 + i32.reinterpret_f32 + local.set $1 + local.get $1 + i32.const 2147483647 + i32.and + local.set $1 + local.get $1 + f32.reinterpret_i32 + local.set $0 + local.get $1 + i32.const 1060205079 + i32.lt_u + if + local.get $1 + i32.const 964689920 + i32.lt_u + if + f32.const 1 + return + end + local.get $0 + call $~lib/math/NativeMathf.expm1 + local.set $2 + f32.const 1 + local.get $2 + local.get $2 + f32.mul + f32.const 2 + f32.const 2 + local.get $2 + f32.mul + f32.add + f32.div + f32.add + return + end + local.get $1 + i32.const 1118925335 + i32.lt_u + if + local.get $0 + call $~lib/math/NativeMathf.exp + local.set $2 + f32.const 0.5 + local.get $2 + f32.mul + f32.const 0.5 + local.get $2 + f32.div + f32.add + return + end + block $~lib/math/expo2f|inlined.0 (result f32) + local.get $0 + local.set $2 + i32.const 127 + i32.const 235 + i32.const 1 + i32.shr_u + i32.add + i32.const 23 + i32.shl + f32.reinterpret_i32 + local.set $3 + local.get $2 + f32.const 162.88958740234375 + f32.sub + call $~lib/math/NativeMathf.exp + local.get $3 + f32.mul + local.get $3 + f32.mul + end + ) + (func $../../lib/libm/assembly/libmf/cosh (; 97 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.cosh + ) + (func $../../lib/libm/assembly/libmf/exp (; 98 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.exp + ) + (func $../../lib/libm/assembly/libmf/expm1 (; 99 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.expm1 + ) + (func $../../lib/libm/assembly/libmf/floor (; 100 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 f32) + local.get $0 + local.set $1 + local.get $1 + f32.floor + ) + (func $../../lib/libm/assembly/libmf/fround (; 101 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 f32) + local.get $0 + local.set $1 + local.get $1 + ) + (func $~lib/math/NativeMathf.hypot (; 102 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 f32) + local.get $0 + i32.reinterpret_f32 + local.set $2 + local.get $1 + i32.reinterpret_f32 + local.set $3 + local.get $2 + i32.const 2147483647 + i32.and + local.set $2 + local.get $3 + i32.const 2147483647 + i32.and + local.set $3 + local.get $2 + local.get $3 + i32.lt_u + if + local.get $2 + local.set $4 + local.get $3 + local.set $2 + local.get $4 + local.set $3 + end + local.get $2 + f32.reinterpret_i32 + local.set $0 + local.get $3 + f32.reinterpret_i32 + local.set $1 + local.get $3 + i32.const 2139095040 + i32.eq + if + local.get $1 + return + end + local.get $2 + i32.const 2139095040 + i32.ge_u + if (result i32) + i32.const 1 + else + local.get $3 + i32.const 0 + i32.eq + end + if (result i32) + i32.const 1 + else + local.get $2 + local.get $3 + i32.sub + i32.const 209715200 + i32.ge_u + end + if + local.get $0 + local.get $1 + f32.add + return + end + f32.const 1 + local.set $5 + local.get $2 + i32.const 1568669696 + i32.ge_u + if + f32.const 1237940039285380274899124e3 + local.set $5 + local.get $0 + f32.const 8.077935669463161e-28 + f32.mul + local.set $0 + local.get $1 + f32.const 8.077935669463161e-28 + f32.mul + local.set $1 + else + local.get $3 + i32.const 562036736 + i32.lt_u + if + f32.const 8.077935669463161e-28 + local.set $5 + local.get $0 + f32.const 1237940039285380274899124e3 + f32.mul + local.set $0 + local.get $1 + f32.const 1237940039285380274899124e3 + f32.mul + local.set $1 + end + end + local.get $5 + local.get $0 + f64.promote_f32 + local.get $0 + f64.promote_f32 + f64.mul + local.get $1 + f64.promote_f32 + local.get $1 + f64.promote_f32 + f64.mul + f64.add + f32.demote_f64 + f32.sqrt + f32.mul + ) + (func $../../lib/libm/assembly/libmf/hypot (; 103 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + local.get $0 + local.get $1 + call $~lib/math/NativeMathf.hypot + ) + (func $../../lib/libm/assembly/libmf/imul (; 104 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + (local $2 f32) + (local $3 f32) + block $~lib/math/NativeMathf.imul|inlined.0 (result f32) + local.get $0 + local.set $3 + local.get $1 + local.set $2 + local.get $3 + local.get $2 + f32.add + call $~lib/builtins/isFinite + i32.eqz + if + f32.const 0 + br $~lib/math/NativeMathf.imul|inlined.0 + end + local.get $3 + f64.promote_f32 + f32.const 4294967296 + f64.promote_f32 + local.get $3 + f64.promote_f32 + f64.const 2.3283064365386963e-10 + f64.mul + f64.floor + f64.mul + f64.sub + i64.trunc_f64_s + i32.wrap_i64 + local.get $2 + f64.promote_f32 + f32.const 4294967296 + f64.promote_f32 + local.get $2 + f64.promote_f32 + f64.const 2.3283064365386963e-10 + f64.mul + f64.floor + f64.mul + f64.sub + i64.trunc_f64_s + i32.wrap_i64 + i32.mul + f32.convert_i32_s + end + ) + (func $../../lib/libm/assembly/libmf/log (; 105 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.log + ) + (func $~lib/math/NativeMathf.log10 (; 106 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + (local $2 i32) + (local $3 f32) + (local $4 f32) + (local $5 f32) + (local $6 f32) + (local $7 f32) + (local $8 f32) + (local $9 f32) + (local $10 f32) + (local $11 f32) + (local $12 f32) + (local $13 f32) + local.get $0 + i32.reinterpret_f32 + local.set $1 + i32.const 0 + local.set $2 + local.get $1 + i32.const 8388608 + i32.lt_u + if (result i32) + i32.const 1 + else + local.get $1 + i32.const 31 + i32.shr_u + end + if + local.get $1 + i32.const 1 + i32.shl + i32.const 0 + i32.eq + if + f32.const -1 + local.get $0 + local.get $0 + f32.mul + f32.div + return + end + local.get $1 + i32.const 31 + i32.shr_u + if + local.get $0 + local.get $0 + f32.sub + f32.const 0 + f32.div + return + end + local.get $2 + i32.const 25 + i32.sub + local.set $2 + local.get $0 + f32.const 33554432 + f32.mul + local.set $0 + local.get $0 + i32.reinterpret_f32 + local.set $1 + else + local.get $1 + i32.const 2139095040 + i32.ge_u + if + local.get $0 + return + else + local.get $1 + i32.const 1065353216 + i32.eq + if + f32.const 0 + return + end + end + end + local.get $1 + i32.const 1065353216 + i32.const 1060439283 + i32.sub + i32.add + local.set $1 + local.get $2 + local.get $1 + i32.const 23 + i32.shr_u + i32.const 127 + i32.sub + i32.add + local.set $2 + local.get $1 + i32.const 8388607 + i32.and + i32.const 1060439283 + i32.add + local.set $1 + local.get $1 + f32.reinterpret_i32 + local.set $0 + local.get $0 + f32.const 1 + f32.sub + local.set $3 + local.get $3 + f32.const 2 + local.get $3 + f32.add + f32.div + local.set $4 + local.get $4 + local.get $4 + f32.mul + local.set $5 + local.get $5 + local.get $5 + f32.mul + local.set $6 + local.get $6 + f32.const 0.40000972151756287 + local.get $6 + f32.const 0.24279078841209412 + f32.mul + f32.add + f32.mul + local.set $7 + local.get $5 + f32.const 0.6666666269302368 + local.get $6 + f32.const 0.2849878668785095 + f32.mul + f32.add + f32.mul + local.set $8 + local.get $8 + local.get $7 + f32.add + local.set $9 + f32.const 0.5 + local.get $3 + f32.mul + local.get $3 + f32.mul + local.set $10 + local.get $3 + local.get $10 + f32.sub + local.set $11 + local.get $11 + i32.reinterpret_f32 + local.set $1 + local.get $1 + i32.const -4096 + i32.and + local.set $1 + local.get $1 + f32.reinterpret_i32 + local.set $11 + local.get $3 + local.get $11 + f32.sub + local.get $10 + f32.sub + local.get $4 + local.get $10 + local.get $9 + f32.add + f32.mul + f32.add + local.set $12 + local.get $2 + f32.convert_i32_s + local.set $13 + local.get $13 + f32.const 7.903415166765626e-07 + f32.mul + local.get $12 + local.get $11 + f32.add + f32.const -3.168997136526741e-05 + f32.mul + f32.add + local.get $12 + f32.const 0.434326171875 + f32.mul + f32.add + local.get $11 + f32.const 0.434326171875 + f32.mul + f32.add + local.get $13 + f32.const 0.3010292053222656 + f32.mul + f32.add + ) + (func $../../lib/libm/assembly/libmf/log10 (; 107 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.log10 + ) + (func $../../lib/libm/assembly/libmf/log1p (; 108 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.log1p + ) + (func $~lib/math/NativeMathf.log2 (; 109 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + (local $2 i32) + (local $3 f32) + (local $4 f32) + (local $5 f32) + (local $6 f32) + (local $7 f32) + (local $8 f32) + (local $9 f32) + (local $10 f32) + (local $11 f32) + (local $12 i32) + (local $13 f32) + (local $14 f32) + local.get $0 + i32.reinterpret_f32 + local.set $1 + i32.const 0 + local.set $2 + local.get $1 + i32.const 8388608 + i32.lt_u + if (result i32) + i32.const 1 + else + local.get $1 + i32.const 31 + i32.shr_u + end + if + local.get $1 + i32.const 1 + i32.shl + i32.const 0 + i32.eq + if + f32.const -1 + local.get $0 + local.get $0 + f32.mul + f32.div + return + end + local.get $1 + i32.const 31 + i32.shr_u + if + local.get $0 + local.get $0 + f32.sub + f32.const 0 + f32.div + return + end + local.get $2 + i32.const 25 + i32.sub + local.set $2 + local.get $0 + f32.const 33554432 + f32.mul + local.set $0 + local.get $0 + i32.reinterpret_f32 + local.set $1 + else + local.get $1 + i32.const 2139095040 + i32.ge_u + if + local.get $0 + return + else + local.get $1 + i32.const 1065353216 + i32.eq + if + f32.const 0 + return + end + end + end + local.get $1 + i32.const 1065353216 + i32.const 1060439283 + i32.sub + i32.add + local.set $1 + local.get $2 + local.get $1 + i32.const 23 + i32.shr_u + i32.const 127 + i32.sub + i32.add + local.set $2 + local.get $1 + i32.const 8388607 + i32.and + i32.const 1060439283 + i32.add + local.set $1 + local.get $1 + f32.reinterpret_i32 + local.set $0 + local.get $0 + f32.const 1 + f32.sub + local.set $3 + local.get $3 + f32.const 2 + local.get $3 + f32.add + f32.div + local.set $4 + local.get $4 + local.get $4 + f32.mul + local.set $5 + local.get $5 + local.get $5 + f32.mul + local.set $6 + local.get $6 + f32.const 0.40000972151756287 + local.get $6 + f32.const 0.24279078841209412 + f32.mul + f32.add + f32.mul + local.set $7 + local.get $5 + f32.const 0.6666666269302368 + local.get $6 + f32.const 0.2849878668785095 + f32.mul + f32.add + f32.mul + local.set $8 + local.get $8 + local.get $7 + f32.add + local.set $9 + f32.const 0.5 + local.get $3 + f32.mul + local.get $3 + f32.mul + local.set $10 + local.get $3 + local.get $10 + f32.sub + local.set $11 + local.get $11 + i32.reinterpret_f32 + local.set $12 + local.get $12 + i32.const -4096 + i32.and + local.set $12 + local.get $12 + f32.reinterpret_i32 + local.set $11 + local.get $3 + local.get $11 + f32.sub + local.get $10 + f32.sub + local.get $4 + local.get $10 + local.get $9 + f32.add + f32.mul + f32.add + local.set $13 + local.get $2 + f32.convert_i32_s + local.set $14 + local.get $13 + local.get $11 + f32.add + f32.const -1.7605285393074155e-04 + f32.mul + local.get $13 + f32.const 1.44287109375 + f32.mul + f32.add + local.get $11 + f32.const 1.44287109375 + f32.mul + f32.add + local.get $14 + f32.add + ) + (func $../../lib/libm/assembly/libmf/log2 (; 110 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.log2 + ) + (func $../../lib/libm/assembly/libmf/max (; 111 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + (local $2 f32) + (local $3 f32) + local.get $0 + local.set $3 + local.get $1 + local.set $2 + local.get $3 + local.get $2 + f32.max + ) + (func $../../lib/libm/assembly/libmf/min (; 112 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + (local $2 f32) + (local $3 f32) + local.get $0 + local.set $3 + local.get $1 + local.set $2 + local.get $3 + local.get $2 + f32.min + ) + (func $~lib/math/NativeMathf.pow (; 113 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 f32) + (local $11 f32) + (local $12 f32) + (local $13 f32) + (local $14 f32) + (local $15 f32) + (local $16 f32) + (local $17 f32) + (local $18 f32) + (local $19 f32) + (local $20 f32) + (local $21 f32) + (local $22 f32) + (local $23 f32) + (local $24 i32) + (local $25 i32) + (local $26 f32) + (local $27 f32) + (local $28 f32) + (local $29 f32) + (local $30 f32) + (local $31 f32) + (local $32 f32) + (local $33 f32) + (local $34 f32) + (local $35 f32) + (local $36 i32) + local.get $0 + i32.reinterpret_f32 + local.set $2 + local.get $1 + i32.reinterpret_f32 + local.set $3 + local.get $2 + i32.const 2147483647 + i32.and + local.set $4 + local.get $3 + i32.const 2147483647 + i32.and + local.set $5 + local.get $5 + i32.const 0 + i32.eq + if + f32.const 1 + return + end + local.get $4 + i32.const 2139095040 + i32.gt_s + if (result i32) + i32.const 1 + else + local.get $5 + i32.const 2139095040 + i32.gt_s + end + if + local.get $0 + local.get $1 + f32.add + return + end + i32.const 0 + local.set $6 + local.get $2 + i32.const 0 + i32.lt_s + if + local.get $5 + i32.const 1266679808 + i32.ge_s + if + i32.const 2 + local.set $6 + else + local.get $5 + i32.const 1065353216 + i32.ge_s + if + local.get $5 + i32.const 23 + i32.shr_s + i32.const 127 + i32.sub + local.set $8 + i32.const 23 + local.get $8 + i32.sub + local.set $9 + local.get $5 + local.get $9 + i32.shr_s + local.set $7 + local.get $7 + local.get $9 + i32.shl + local.get $5 + i32.eq + if + i32.const 2 + local.get $7 + i32.const 1 + i32.and + i32.sub + local.set $6 + end + end + end + end + local.get $5 + i32.const 2139095040 + i32.eq + if + local.get $4 + i32.const 1065353216 + i32.eq + if + f32.const nan:0x400000 + return + else + local.get $4 + i32.const 1065353216 + i32.gt_s + if + local.get $3 + i32.const 0 + i32.ge_s + if (result f32) + local.get $1 + else + f32.const 0 + end + return + else + local.get $3 + i32.const 0 + i32.ge_s + if (result f32) + f32.const 0 + else + local.get $1 + f32.neg + end + return + end + unreachable + end + unreachable + unreachable + end + local.get $5 + i32.const 1065353216 + i32.eq + if + local.get $3 + i32.const 0 + i32.ge_s + if (result f32) + local.get $0 + else + f32.const 1 + local.get $0 + f32.div + end + return + end + local.get $3 + i32.const 1073741824 + i32.eq + if + local.get $0 + local.get $0 + f32.mul + return + end + local.get $3 + i32.const 1056964608 + i32.eq + if + local.get $2 + i32.const 0 + i32.ge_s + if + local.get $0 + f32.sqrt + return + end + end + local.get $0 + f32.abs + local.set $10 + local.get $4 + i32.const 2139095040 + i32.eq + if (result i32) + i32.const 1 + else + local.get $4 + i32.const 0 + i32.eq + end + if (result i32) + i32.const 1 + else + local.get $4 + i32.const 1065353216 + i32.eq + end + if + local.get $10 + local.set $11 + local.get $3 + i32.const 0 + i32.lt_s + if + f32.const 1 + local.get $11 + f32.div + local.set $11 + end + local.get $2 + i32.const 0 + i32.lt_s + if + local.get $4 + i32.const 1065353216 + i32.sub + local.get $6 + i32.or + i32.const 0 + i32.eq + if + local.get $11 + local.get $11 + f32.sub + local.set $12 + local.get $12 + local.get $12 + f32.div + local.set $11 + else + local.get $6 + i32.const 1 + i32.eq + if + local.get $11 + f32.neg + local.set $11 + end + end + end + local.get $11 + return + end + f32.const 1 + local.set $13 + local.get $2 + i32.const 0 + i32.lt_s + if + local.get $6 + i32.const 0 + i32.eq + if + local.get $0 + local.get $0 + f32.sub + local.set $12 + local.get $12 + local.get $12 + f32.div + return + end + local.get $6 + i32.const 1 + i32.eq + if + f32.const -1 + local.set $13 + end + end + local.get $5 + i32.const 1291845632 + i32.gt_s + if + local.get $4 + i32.const 1065353208 + i32.lt_s + if + local.get $3 + i32.const 0 + i32.lt_s + if (result f32) + local.get $13 + f32.const 1000000015047466219876688e6 + f32.mul + f32.const 1000000015047466219876688e6 + f32.mul + else + local.get $13 + f32.const 1.0000000031710769e-30 + f32.mul + f32.const 1.0000000031710769e-30 + f32.mul + end + return + end + local.get $4 + i32.const 1065353223 + i32.gt_s + if + local.get $3 + i32.const 0 + i32.gt_s + if (result f32) + local.get $13 + f32.const 1000000015047466219876688e6 + f32.mul + f32.const 1000000015047466219876688e6 + f32.mul + else + local.get $13 + f32.const 1.0000000031710769e-30 + f32.mul + f32.const 1.0000000031710769e-30 + f32.mul + end + return + end + local.get $10 + f32.const 1 + f32.sub + local.set $18 + local.get $18 + local.get $18 + f32.mul + f32.const 0.5 + local.get $18 + f32.const 0.3333333432674408 + local.get $18 + f32.const 0.25 + f32.mul + f32.sub + f32.mul + f32.sub + f32.mul + local.set $21 + f32.const 1.44268798828125 + local.get $18 + f32.mul + local.set $19 + local.get $18 + f32.const 7.052607543300837e-06 + f32.mul + local.get $21 + f32.const 1.4426950216293335 + f32.mul + f32.sub + local.set $20 + local.get $19 + local.get $20 + f32.add + local.set $14 + local.get $14 + i32.reinterpret_f32 + local.set $25 + local.get $25 + i32.const -4096 + i32.and + f32.reinterpret_i32 + local.set $14 + local.get $20 + local.get $14 + local.get $19 + f32.sub + f32.sub + local.set $15 + else + i32.const 0 + local.set $24 + local.get $4 + i32.const 8388608 + i32.lt_s + if + local.get $10 + f32.const 16777216 + f32.mul + local.set $10 + local.get $24 + i32.const 24 + i32.sub + local.set $24 + local.get $10 + i32.reinterpret_f32 + local.set $4 + end + local.get $24 + local.get $4 + i32.const 23 + i32.shr_s + i32.const 127 + i32.sub + i32.add + local.set $24 + local.get $4 + i32.const 8388607 + i32.and + local.set $7 + local.get $7 + i32.const 1065353216 + i32.or + local.set $4 + local.get $7 + i32.const 1885297 + i32.le_s + if + i32.const 0 + local.set $8 + else + local.get $7 + i32.const 6140887 + i32.lt_s + if + i32.const 1 + local.set $8 + else + i32.const 0 + local.set $8 + local.get $24 + i32.const 1 + i32.add + local.set $24 + local.get $4 + i32.const 8388608 + i32.sub + local.set $4 + end + end + local.get $4 + f32.reinterpret_i32 + local.set $10 + f32.const 1.5 + f32.const 1 + local.get $8 + select + local.set $30 + local.get $10 + local.get $30 + f32.sub + local.set $19 + f32.const 1 + local.get $10 + local.get $30 + f32.add + f32.div + local.set $20 + local.get $19 + local.get $20 + f32.mul + local.set $17 + local.get $17 + local.set $26 + local.get $26 + i32.reinterpret_f32 + local.set $25 + local.get $25 + i32.const -4096 + i32.and + f32.reinterpret_i32 + local.set $26 + local.get $4 + i32.const 1 + i32.shr_s + i32.const -4096 + i32.and + i32.const 536870912 + i32.or + local.set $25 + local.get $25 + i32.const 4194304 + i32.add + local.get $8 + i32.const 21 + i32.shl + i32.add + f32.reinterpret_i32 + local.set $28 + local.get $10 + local.get $28 + local.get $30 + f32.sub + f32.sub + local.set $29 + local.get $20 + local.get $19 + local.get $26 + local.get $28 + f32.mul + f32.sub + local.get $26 + local.get $29 + f32.mul + f32.sub + f32.mul + local.set $27 + local.get $17 + local.get $17 + f32.mul + local.set $12 + local.get $12 + local.get $12 + f32.mul + f32.const 0.6000000238418579 + local.get $12 + f32.const 0.4285714328289032 + local.get $12 + f32.const 0.3333333432674408 + local.get $12 + f32.const 0.2727281153202057 + local.get $12 + f32.const 0.23066075146198273 + local.get $12 + f32.const 0.20697501301765442 + f32.mul + f32.add + f32.mul + f32.add + f32.mul + f32.add + f32.mul + f32.add + f32.mul + f32.add + f32.mul + local.set $16 + local.get $16 + local.get $27 + local.get $26 + local.get $17 + f32.add + f32.mul + f32.add + local.set $16 + local.get $26 + local.get $26 + f32.mul + local.set $12 + f32.const 3 + local.get $12 + f32.add + local.get $16 + f32.add + local.set $28 + local.get $28 + i32.reinterpret_f32 + local.set $25 + local.get $25 + i32.const -4096 + i32.and + f32.reinterpret_i32 + local.set $28 + local.get $16 + local.get $28 + f32.const 3 + f32.sub + local.get $12 + f32.sub + f32.sub + local.set $29 + local.get $26 + local.get $28 + f32.mul + local.set $19 + local.get $27 + local.get $28 + f32.mul + local.get $29 + local.get $17 + f32.mul + f32.add + local.set $20 + local.get $19 + local.get $20 + f32.add + local.set $22 + local.get $22 + i32.reinterpret_f32 + local.set $25 + local.get $25 + i32.const -4096 + i32.and + f32.reinterpret_i32 + local.set $22 + local.get $20 + local.get $22 + local.get $19 + f32.sub + f32.sub + local.set $23 + f32.const 0.9619140625 + local.get $22 + f32.mul + local.set $31 + f32.const 1.5632208487659227e-06 + f32.const 0 + local.get $8 + select + local.set $32 + f32.const -1.1736857413779944e-04 + local.get $22 + f32.mul + local.get $23 + f32.const 0.9617967009544373 + f32.mul + f32.add + local.get $32 + f32.add + local.set $33 + local.get $24 + f32.convert_i32_s + local.set $18 + f32.const 0.5849609375 + f32.const 0 + local.get $8 + select + local.set $34 + local.get $31 + local.get $33 + f32.add + local.get $34 + f32.add + local.get $18 + f32.add + local.set $14 + local.get $14 + i32.reinterpret_f32 + local.set $25 + local.get $25 + i32.const -4096 + i32.and + f32.reinterpret_i32 + local.set $14 + local.get $33 + local.get $14 + local.get $18 + f32.sub + local.get $34 + f32.sub + local.get $31 + f32.sub + f32.sub + local.set $15 + end + local.get $1 + i32.reinterpret_f32 + local.set $25 + local.get $25 + i32.const -4096 + i32.and + f32.reinterpret_i32 + local.set $35 + local.get $1 + local.get $35 + f32.sub + local.get $14 + f32.mul + local.get $1 + local.get $15 + f32.mul + f32.add + local.set $23 + local.get $35 + local.get $14 + f32.mul + local.set $22 + local.get $23 + local.get $22 + f32.add + local.set $11 + local.get $11 + i32.reinterpret_f32 + local.set $7 + local.get $7 + i32.const 1124073472 + i32.gt_s + if + local.get $13 + f32.const 1000000015047466219876688e6 + f32.mul + f32.const 1000000015047466219876688e6 + f32.mul + return + else + local.get $7 + i32.const 1124073472 + i32.eq + if + local.get $23 + f32.const 4.299566569443414e-08 + f32.add + local.get $11 + local.get $22 + f32.sub + f32.gt + if + local.get $13 + f32.const 1000000015047466219876688e6 + f32.mul + f32.const 1000000015047466219876688e6 + f32.mul + return + end + else + local.get $7 + i32.const 2147483647 + i32.and + i32.const 1125515264 + i32.gt_s + if + local.get $13 + f32.const 1.0000000031710769e-30 + f32.mul + f32.const 1.0000000031710769e-30 + f32.mul + return + else + local.get $7 + i32.const -1021968384 + i32.eq + if + local.get $23 + local.get $11 + local.get $22 + f32.sub + f32.le + if + local.get $13 + f32.const 1.0000000031710769e-30 + f32.mul + f32.const 1.0000000031710769e-30 + f32.mul + return + end + end + end + end + end + local.get $7 + i32.const 2147483647 + i32.and + local.set $36 + local.get $36 + i32.const 23 + i32.shr_s + i32.const 127 + i32.sub + local.set $8 + i32.const 0 + local.set $24 + local.get $36 + i32.const 1056964608 + i32.gt_s + if + local.get $7 + i32.const 8388608 + local.get $8 + i32.const 1 + i32.add + i32.shr_s + i32.add + local.set $24 + local.get $24 + i32.const 2147483647 + i32.and + i32.const 23 + i32.shr_s + i32.const 127 + i32.sub + local.set $8 + local.get $24 + i32.const 8388607 + local.get $8 + i32.shr_s + i32.const -1 + i32.xor + i32.and + f32.reinterpret_i32 + local.set $18 + local.get $24 + i32.const 8388607 + i32.and + i32.const 8388608 + i32.or + i32.const 23 + local.get $8 + i32.sub + i32.shr_s + local.set $24 + local.get $7 + i32.const 0 + i32.lt_s + if + i32.const 0 + local.get $24 + i32.sub + local.set $24 + end + local.get $22 + local.get $18 + f32.sub + local.set $22 + end + local.get $23 + local.get $22 + f32.add + local.set $18 + local.get $18 + i32.reinterpret_f32 + local.set $25 + local.get $25 + i32.const -32768 + i32.and + f32.reinterpret_i32 + local.set $18 + local.get $18 + f32.const 0.693145751953125 + f32.mul + local.set $19 + local.get $23 + local.get $18 + local.get $22 + f32.sub + f32.sub + f32.const 0.6931471824645996 + f32.mul + local.get $18 + f32.const 1.4286065379565116e-06 + f32.mul + f32.add + local.set $20 + local.get $19 + local.get $20 + f32.add + local.set $11 + local.get $20 + local.get $11 + local.get $19 + f32.sub + f32.sub + local.set $21 + local.get $11 + local.get $11 + f32.mul + local.set $18 + local.get $11 + local.get $18 + f32.const 0.1666666716337204 + local.get $18 + f32.const -2.7777778450399637e-03 + local.get $18 + f32.const 6.61375597701408e-05 + local.get $18 + f32.const -1.6533901998627698e-06 + local.get $18 + f32.const 4.138136944220605e-08 + f32.mul + f32.add + f32.mul + f32.add + f32.mul + f32.add + f32.mul + f32.add + f32.mul + f32.sub + local.set $14 + local.get $11 + local.get $14 + f32.mul + local.get $14 + f32.const 2 + f32.sub + f32.div + local.get $21 + local.get $11 + local.get $21 + f32.mul + f32.add + f32.sub + local.set $16 + f32.const 1 + local.get $16 + local.get $11 + f32.sub + f32.sub + local.set $11 + local.get $11 + i32.reinterpret_f32 + local.set $7 + local.get $7 + local.get $24 + i32.const 23 + i32.shl + i32.add + local.set $7 + local.get $7 + i32.const 23 + i32.shr_s + i32.const 0 + i32.le_s + if + local.get $11 + local.get $24 + call $~lib/math/NativeMathf.scalbn + local.set $11 + else + local.get $7 + f32.reinterpret_i32 + local.set $11 + end + local.get $13 + local.get $11 + f32.mul + ) + (func $../../lib/libm/assembly/libmf/pow (; 114 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + local.get $0 + local.get $1 + call $~lib/math/NativeMathf.pow + ) + (func $../../lib/libm/assembly/libmf/round (; 115 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 f32) + local.get $0 + local.set $1 + local.get $1 + f32.const 0.5 + f32.add + f32.floor + local.get $1 + f32.copysign + ) + (func $../../lib/libm/assembly/libmf/sign (; 116 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 f32) + block $~lib/math/NativeMathf.sign|inlined.0 (result f32) + local.get $0 + local.set $1 + local.get $1 + f32.const 0 + f32.gt + if (result f32) + f32.const 1 + else + local.get $1 + f32.const 0 + f32.lt + if (result f32) + f32.const -1 + else + local.get $1 + end + end + br $~lib/math/NativeMathf.sign|inlined.0 + end + ) + (func $~lib/math/NativeMathf.sin (; 117 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + (local $2 i32) + (local $3 f64) + (local $4 f64) + (local $5 f64) + (local $6 f64) + (local $7 f64) + (local $8 i32) + (local $9 i32) + (local $10 f32) + (local $11 i32) + (local $12 f32) + (local $13 i32) + (local $14 i32) + (local $15 i32) + (local $16 i64) + (local $17 i64) + (local $18 i64) + (local $19 i64) + (local $20 i64) + (local $21 i64) + (local $22 i64) + (local $23 i32) + (local $24 i32) + (local $25 f64) + (local $26 f32) + local.get $0 + i32.reinterpret_f32 + local.set $1 + local.get $1 + i32.const 31 + i32.shr_u + local.set $2 + local.get $1 + i32.const 2147483647 + i32.and + local.set $1 + local.get $1 + i32.const 1061752794 + i32.le_u + if + local.get $1 + i32.const 964689920 + i32.lt_u + if + local.get $0 + return + end + block $~lib/math/sin_kernf|inlined.5 (result f32) + local.get $0 + f64.promote_f32 + local.set $3 + local.get $3 + local.get $3 + f64.mul + local.set $4 + local.get $4 + local.get $4 + f64.mul + local.set $5 + f64.const -1.9839334836096632e-04 + local.get $4 + f64.const 2.718311493989822e-06 + f64.mul + f64.add + local.set $6 + local.get $4 + local.get $3 + f64.mul + local.set $7 + local.get $3 + local.get $7 + f64.const -0.16666666641626524 + local.get $4 + f64.const 0.008333329385889463 + f64.mul + f64.add + f64.mul + f64.add + local.get $7 + local.get $5 + f64.mul + local.get $6 + f64.mul + f64.add + f32.demote_f64 + end + return + end + local.get $1 + i32.const 1081824209 + i32.le_u + if + local.get $1 + i32.const 1075235811 + i32.le_u + if + local.get $2 + if (result f32) + block $~lib/math/cos_kernf|inlined.4 (result f32) + local.get $0 + f64.promote_f32 + f64.const 1.5707963267948966 + f64.add + local.set $3 + local.get $3 + local.get $3 + f64.mul + local.set $7 + local.get $7 + local.get $7 + f64.mul + local.set $6 + f64.const -0.001388676377460993 + local.get $7 + f64.const 2.439044879627741e-05 + f64.mul + f64.add + local.set $5 + f32.const 1 + f64.promote_f32 + local.get $7 + f64.const -0.499999997251031 + f64.mul + f64.add + local.get $6 + f64.const 0.04166662332373906 + f64.mul + f64.add + local.get $6 + local.get $7 + f64.mul + local.get $5 + f64.mul + f64.add + f32.demote_f64 + end + f32.neg + else + local.get $0 + f64.promote_f32 + f64.const 1.5707963267948966 + f64.sub + local.set $4 + local.get $4 + local.get $4 + f64.mul + local.set $5 + local.get $5 + local.get $5 + f64.mul + local.set $6 + f64.const -0.001388676377460993 + local.get $5 + f64.const 2.439044879627741e-05 + f64.mul + f64.add + local.set $7 + f32.const 1 + f64.promote_f32 + local.get $5 + f64.const -0.499999997251031 + f64.mul + f64.add + local.get $6 + f64.const 0.04166662332373906 + f64.mul + f64.add + local.get $6 + local.get $5 + f64.mul + local.get $7 + f64.mul + f64.add + f32.demote_f64 + end + return + end + block $~lib/math/sin_kernf|inlined.6 (result f32) + local.get $2 + if (result f64) + local.get $0 + f64.promote_f32 + f64.const 3.141592653589793 + f64.add + else + local.get $0 + f64.promote_f32 + f64.const 3.141592653589793 + f64.sub + end + f64.neg + local.set $3 + local.get $3 + local.get $3 + f64.mul + local.set $7 + local.get $7 + local.get $7 + f64.mul + local.set $6 + f64.const -1.9839334836096632e-04 + local.get $7 + f64.const 2.718311493989822e-06 + f64.mul + f64.add + local.set $5 + local.get $7 + local.get $3 + f64.mul + local.set $4 + local.get $3 + local.get $4 + f64.const -0.16666666641626524 + local.get $7 + f64.const 0.008333329385889463 + f64.mul + f64.add + f64.mul + f64.add + local.get $4 + local.get $6 + f64.mul + local.get $5 + f64.mul + f64.add + f32.demote_f64 + end + return + end + local.get $1 + i32.const 1088565717 + i32.le_u + if + local.get $1 + i32.const 1085271519 + i32.le_u + if + local.get $2 + if (result f32) + local.get $0 + f64.promote_f32 + f64.const 4.71238898038469 + f64.add + local.set $3 + local.get $3 + local.get $3 + f64.mul + local.set $4 + local.get $4 + local.get $4 + f64.mul + local.set $5 + f64.const -0.001388676377460993 + local.get $4 + f64.const 2.439044879627741e-05 + f64.mul + f64.add + local.set $6 + f32.const 1 + f64.promote_f32 + local.get $4 + f64.const -0.499999997251031 + f64.mul + f64.add + local.get $5 + f64.const 0.04166662332373906 + f64.mul + f64.add + local.get $5 + local.get $4 + f64.mul + local.get $6 + f64.mul + f64.add + f32.demote_f64 + else + block $~lib/math/cos_kernf|inlined.7 (result f32) + local.get $0 + f64.promote_f32 + f64.const 4.71238898038469 + f64.sub + local.set $7 + local.get $7 + local.get $7 + f64.mul + local.set $6 + local.get $6 + local.get $6 + f64.mul + local.set $5 + f64.const -0.001388676377460993 + local.get $6 + f64.const 2.439044879627741e-05 + f64.mul + f64.add + local.set $4 + f32.const 1 + f64.promote_f32 + local.get $6 + f64.const -0.499999997251031 + f64.mul + f64.add + local.get $5 + f64.const 0.04166662332373906 + f64.mul + f64.add + local.get $5 + local.get $6 + f64.mul + local.get $4 + f64.mul + f64.add + f32.demote_f64 + end + f32.neg + end + return + end + block $~lib/math/sin_kernf|inlined.7 (result f32) + local.get $2 + if (result f64) + local.get $0 + f64.promote_f32 + f64.const 6.283185307179586 + f64.add + else + local.get $0 + f64.promote_f32 + f64.const 6.283185307179586 + f64.sub + end + local.set $3 + local.get $3 + local.get $3 + f64.mul + local.set $4 + local.get $4 + local.get $4 + f64.mul + local.set $5 + f64.const -1.9839334836096632e-04 + local.get $4 + f64.const 2.718311493989822e-06 + f64.mul + f64.add + local.set $6 + local.get $4 + local.get $3 + f64.mul + local.set $7 + local.get $3 + local.get $7 + f64.const -0.16666666641626524 + local.get $4 + f64.const 0.008333329385889463 + f64.mul + f64.add + f64.mul + f64.add + local.get $7 + local.get $5 + f64.mul + local.get $6 + f64.mul + f64.add + f32.demote_f64 + end + return + end + local.get $1 + i32.const 2139095040 + i32.ge_u + if + local.get $0 + local.get $0 + f32.sub + return + end + block $~lib/math/rempio2f|inlined.1 (result i32) + local.get $0 + local.set $10 + local.get $1 + local.set $9 + local.get $2 + local.set $8 + local.get $9 + i32.const 1305022427 + i32.lt_u + if + local.get $10 + f64.promote_f32 + f64.const 0.6366197723675814 + f64.mul + f64.nearest + local.set $7 + local.get $10 + f64.promote_f32 + local.get $7 + f64.const 1.5707963109016418 + f64.mul + f64.sub + local.get $7 + f64.const 1.5893254773528196e-08 + f64.mul + f64.sub + global.set $~lib/math/rempio2f_y + local.get $7 + i32.trunc_f64_s + br $~lib/math/rempio2f|inlined.1 + end + block $~lib/math/pio2_large_quot|inlined.1 (result i32) + local.get $10 + local.set $12 + local.get $9 + local.set $11 + local.get $11 + i32.const 23 + i32.shr_s + i32.const 152 + i32.sub + local.set $13 + local.get $13 + i32.const 6 + i32.shr_s + local.set $14 + local.get $13 + i32.const 63 + i32.and + local.set $15 + i32.const 72 + local.get $14 + i32.const 0 + i32.add + call $~lib/array/Array#__unchecked_get + local.set $16 + i32.const 72 + local.get $14 + i32.const 1 + i32.add + call $~lib/array/Array#__unchecked_get + local.set $17 + local.get $15 + i32.const 32 + i32.gt_s + if + i32.const 72 + local.get $14 + i32.const 2 + i32.add + call $~lib/array/Array#__unchecked_get + local.set $19 + local.get $19 + i64.const 96 + local.get $15 + i64.extend_i32_s + i64.sub + i64.shr_u + local.set $18 + local.get $18 + local.get $17 + local.get $15 + i32.const 32 + i32.sub + i64.extend_i32_s + i64.shl + i64.or + local.set $18 + else + local.get $17 + i64.const 32 + local.get $15 + i64.extend_i32_s + i64.sub + i64.shr_u + local.set $18 + end + local.get $17 + i64.const 64 + local.get $15 + i64.extend_i32_s + i64.sub + i64.shr_u + local.get $16 + local.get $15 + i64.extend_i32_s + i64.shl + i64.or + local.set $19 + local.get $11 + i32.const 8388607 + i32.and + i32.const 8388608 + i32.or + i64.extend_i32_s + local.set $20 + local.get $20 + local.get $19 + i64.mul + local.get $20 + local.get $18 + i64.mul + i64.const 32 + i64.shr_u + i64.add + local.set $21 + local.get $21 + i64.const 2 + i64.shl + local.set $22 + local.get $21 + i64.const 62 + i64.shr_u + local.get $22 + i64.const 63 + i64.shr_u + i64.add + i32.wrap_i64 + local.set $23 + f64.const 8.515303950216386e-20 + local.get $12 + f64.promote_f32 + f64.copysign + local.get $22 + f64.convert_i64_s + f64.mul + global.set $~lib/math/rempio2f_y + local.get $23 + end + local.set $23 + i32.const 0 + local.get $23 + i32.sub + local.get $23 + local.get $8 + select + end + local.set $24 + global.get $~lib/math/rempio2f_y + local.set $25 + local.get $24 + i32.const 1 + i32.and + if (result f32) + local.get $25 + local.set $3 + local.get $3 + local.get $3 + f64.mul + local.set $7 + local.get $7 + local.get $7 + f64.mul + local.set $6 + f64.const -0.001388676377460993 + local.get $7 + f64.const 2.439044879627741e-05 + f64.mul + f64.add + local.set $5 + f32.const 1 + f64.promote_f32 + local.get $7 + f64.const -0.499999997251031 + f64.mul + f64.add + local.get $6 + f64.const 0.04166662332373906 + f64.mul + f64.add + local.get $6 + local.get $7 + f64.mul + local.get $5 + f64.mul + f64.add + f32.demote_f64 + else + local.get $25 + local.set $4 + local.get $4 + local.get $4 + f64.mul + local.set $5 + local.get $5 + local.get $5 + f64.mul + local.set $6 + f64.const -1.9839334836096632e-04 + local.get $5 + f64.const 2.718311493989822e-06 + f64.mul + f64.add + local.set $7 + local.get $5 + local.get $4 + f64.mul + local.set $3 + local.get $4 + local.get $3 + f64.const -0.16666666641626524 + local.get $5 + f64.const 0.008333329385889463 + f64.mul + f64.add + f64.mul + f64.add + local.get $3 + local.get $6 + f64.mul + local.get $7 + f64.mul + f64.add + f32.demote_f64 + end + local.set $26 + local.get $24 + i32.const 2 + i32.and + if (result f32) + local.get $26 + f32.neg + else + local.get $26 + end + ) + (func $../../lib/libm/assembly/libmf/sin (; 118 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.sin + ) + (func $~lib/math/NativeMathf.sinh (; 119 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + (local $2 f32) + (local $3 f32) + (local $4 f32) + (local $5 f32) + (local $6 f32) + local.get $0 + i32.reinterpret_f32 + i32.const 2147483647 + i32.and + local.set $1 + local.get $1 + f32.reinterpret_i32 + local.set $2 + f32.const 0.5 + local.get $0 + f32.copysign + local.set $4 + local.get $1 + i32.const 1118925335 + i32.lt_u + if + local.get $2 + call $~lib/math/NativeMathf.expm1 + local.set $3 + local.get $1 + i32.const 1065353216 + i32.lt_u + if + local.get $1 + i32.const 964689920 + i32.lt_u + if + local.get $0 + return + end + local.get $4 + f32.const 2 + local.get $3 + f32.mul + local.get $3 + local.get $3 + f32.mul + local.get $3 + f32.const 1 + f32.add + f32.div + f32.sub + f32.mul + return + end + local.get $4 + local.get $3 + local.get $3 + local.get $3 + f32.const 1 + f32.add + f32.div + f32.add + f32.mul + return + end + f32.const 2 + local.get $4 + f32.mul + block $~lib/math/expo2f|inlined.1 (result f32) + local.get $2 + local.set $5 + i32.const 127 + i32.const 235 + i32.const 1 + i32.shr_u + i32.add + i32.const 23 + i32.shl + f32.reinterpret_i32 + local.set $6 + local.get $5 + f32.const 162.88958740234375 + f32.sub + call $~lib/math/NativeMathf.exp + local.get $6 + f32.mul + local.get $6 + f32.mul + end + f32.mul + local.set $3 + local.get $3 + ) + (func $../../lib/libm/assembly/libmf/sinh (; 120 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.sinh + ) + (func $../../lib/libm/assembly/libmf/sqrt (; 121 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 f32) + local.get $0 + local.set $1 + local.get $1 + f32.sqrt + ) + (func $~lib/math/NativeMathf.tan (; 122 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 f64) + (local $5 f64) + (local $6 f64) + (local $7 f64) + (local $8 f64) + (local $9 f64) + (local $10 f64) + (local $11 i32) + (local $12 f32) + (local $13 i32) + (local $14 f32) + (local $15 i32) + (local $16 i32) + (local $17 i32) + (local $18 i64) + (local $19 i64) + (local $20 i64) + (local $21 i64) + (local $22 i64) + (local $23 i64) + (local $24 i64) + (local $25 i32) + (local $26 i32) + (local $27 f64) + local.get $0 + i32.reinterpret_f32 + local.set $1 + local.get $1 + i32.const 31 + i32.shr_u + local.set $2 + local.get $1 + i32.const 2147483647 + i32.and + local.set $1 + local.get $1 + i32.const 1061752794 + i32.le_u + if + local.get $1 + i32.const 964689920 + i32.lt_u + if + local.get $0 + return + end + block $~lib/math/tan_kernf|inlined.0 (result f32) + local.get $0 + f64.promote_f32 + local.set $4 + i32.const 0 + local.set $3 + local.get $4 + local.get $4 + f64.mul + local.set $5 + f64.const 0.002974357433599673 + local.get $5 + f64.const 0.009465647849436732 + f64.mul + f64.add + local.set $6 + f64.const 0.05338123784456704 + local.get $5 + f64.const 0.024528318116654728 + f64.mul + f64.add + local.set $7 + local.get $5 + local.get $5 + f64.mul + local.set $8 + local.get $5 + local.get $4 + f64.mul + local.set $9 + f64.const 0.3333313950307914 + local.get $5 + f64.const 0.13339200271297674 + f64.mul + f64.add + local.set $10 + local.get $4 + local.get $9 + local.get $10 + f64.mul + f64.add + local.get $9 + local.get $8 + f64.mul + local.get $7 + local.get $8 + local.get $6 + f64.mul + f64.add + f64.mul + f64.add + local.set $6 + local.get $3 + if (result f64) + f32.const -1 + f64.promote_f32 + local.get $6 + f64.div + else + local.get $6 + end + f32.demote_f64 + end + return + end + local.get $1 + i32.const 1081824209 + i32.le_u + if + local.get $1 + i32.const 1075235811 + i32.le_u + if + block $~lib/math/tan_kernf|inlined.1 (result f32) + local.get $2 + if (result f64) + local.get $0 + f64.promote_f32 + f64.const 1.5707963267948966 + f64.add + else + local.get $0 + f64.promote_f32 + f64.const 1.5707963267948966 + f64.sub + end + local.set $4 + i32.const 1 + local.set $3 + local.get $4 + local.get $4 + f64.mul + local.set $10 + f64.const 0.002974357433599673 + local.get $10 + f64.const 0.009465647849436732 + f64.mul + f64.add + local.set $9 + f64.const 0.05338123784456704 + local.get $10 + f64.const 0.024528318116654728 + f64.mul + f64.add + local.set $8 + local.get $10 + local.get $10 + f64.mul + local.set $7 + local.get $10 + local.get $4 + f64.mul + local.set $6 + f64.const 0.3333313950307914 + local.get $10 + f64.const 0.13339200271297674 + f64.mul + f64.add + local.set $5 + local.get $4 + local.get $6 + local.get $5 + f64.mul + f64.add + local.get $6 + local.get $7 + f64.mul + local.get $8 + local.get $7 + local.get $9 + f64.mul + f64.add + f64.mul + f64.add + local.set $9 + local.get $3 + if (result f64) + f32.const -1 + f64.promote_f32 + local.get $9 + f64.div + else + local.get $9 + end + f32.demote_f64 + end + return + else + block $~lib/math/tan_kernf|inlined.2 (result f32) + local.get $2 + if (result f64) + local.get $0 + f64.promote_f32 + f64.const 3.141592653589793 + f64.add + else + local.get $0 + f64.promote_f32 + f64.const 3.141592653589793 + f64.sub + end + local.set $4 + i32.const 0 + local.set $3 + local.get $4 + local.get $4 + f64.mul + local.set $5 + f64.const 0.002974357433599673 + local.get $5 + f64.const 0.009465647849436732 + f64.mul + f64.add + local.set $6 + f64.const 0.05338123784456704 + local.get $5 + f64.const 0.024528318116654728 + f64.mul + f64.add + local.set $7 + local.get $5 + local.get $5 + f64.mul + local.set $8 + local.get $5 + local.get $4 + f64.mul + local.set $9 + f64.const 0.3333313950307914 + local.get $5 + f64.const 0.13339200271297674 + f64.mul + f64.add + local.set $10 + local.get $4 + local.get $9 + local.get $10 + f64.mul + f64.add + local.get $9 + local.get $8 + f64.mul + local.get $7 + local.get $8 + local.get $6 + f64.mul + f64.add + f64.mul + f64.add + local.set $6 + local.get $3 + if (result f64) + f32.const -1 + f64.promote_f32 + local.get $6 + f64.div + else + local.get $6 + end + f32.demote_f64 + end + return + end + unreachable + unreachable + end + local.get $1 + i32.const 1088565717 + i32.le_u + if + local.get $1 + i32.const 1085271519 + i32.le_u + if + block $~lib/math/tan_kernf|inlined.3 (result f32) + local.get $2 + if (result f64) + local.get $0 + f64.promote_f32 + f64.const 4.71238898038469 + f64.add + else + local.get $0 + f64.promote_f32 + f64.const 4.71238898038469 + f64.sub + end + local.set $4 + i32.const 1 + local.set $3 + local.get $4 + local.get $4 + f64.mul + local.set $10 + f64.const 0.002974357433599673 + local.get $10 + f64.const 0.009465647849436732 + f64.mul + f64.add + local.set $9 + f64.const 0.05338123784456704 + local.get $10 + f64.const 0.024528318116654728 + f64.mul + f64.add + local.set $8 + local.get $10 + local.get $10 + f64.mul + local.set $7 + local.get $10 + local.get $4 + f64.mul + local.set $6 + f64.const 0.3333313950307914 + local.get $10 + f64.const 0.13339200271297674 + f64.mul + f64.add + local.set $5 + local.get $4 + local.get $6 + local.get $5 + f64.mul + f64.add + local.get $6 + local.get $7 + f64.mul + local.get $8 + local.get $7 + local.get $9 + f64.mul + f64.add + f64.mul + f64.add + local.set $9 + local.get $3 + if (result f64) + f32.const -1 + f64.promote_f32 + local.get $9 + f64.div + else + local.get $9 + end + f32.demote_f64 + end + return + else + block $~lib/math/tan_kernf|inlined.4 (result f32) + local.get $2 + if (result f64) + local.get $0 + f64.promote_f32 + f64.const 6.283185307179586 + f64.add + else + local.get $0 + f64.promote_f32 + f64.const 6.283185307179586 + f64.sub + end + local.set $4 + i32.const 0 + local.set $3 + local.get $4 + local.get $4 + f64.mul + local.set $5 + f64.const 0.002974357433599673 + local.get $5 + f64.const 0.009465647849436732 + f64.mul + f64.add + local.set $6 + f64.const 0.05338123784456704 + local.get $5 + f64.const 0.024528318116654728 + f64.mul + f64.add + local.set $7 + local.get $5 + local.get $5 + f64.mul + local.set $8 + local.get $5 + local.get $4 + f64.mul + local.set $9 + f64.const 0.3333313950307914 + local.get $5 + f64.const 0.13339200271297674 + f64.mul + f64.add + local.set $10 + local.get $4 + local.get $9 + local.get $10 + f64.mul + f64.add + local.get $9 + local.get $8 + f64.mul + local.get $7 + local.get $8 + local.get $6 + f64.mul + f64.add + f64.mul + f64.add + local.set $6 + local.get $3 + if (result f64) + f32.const -1 + f64.promote_f32 + local.get $6 + f64.div + else + local.get $6 + end + f32.demote_f64 + end + return + end + unreachable + unreachable + end + local.get $1 + i32.const 2139095040 + i32.ge_u + if + local.get $0 + local.get $0 + f32.sub + return + end + block $~lib/math/rempio2f|inlined.2 (result i32) + local.get $0 + local.set $12 + local.get $1 + local.set $11 + local.get $2 + local.set $3 + local.get $11 + i32.const 1305022427 + i32.lt_u + if + local.get $12 + f64.promote_f32 + f64.const 0.6366197723675814 + f64.mul + f64.nearest + local.set $10 + local.get $12 + f64.promote_f32 + local.get $10 + f64.const 1.5707963109016418 + f64.mul + f64.sub + local.get $10 + f64.const 1.5893254773528196e-08 + f64.mul + f64.sub + global.set $~lib/math/rempio2f_y + local.get $10 + i32.trunc_f64_s + br $~lib/math/rempio2f|inlined.2 + end + block $~lib/math/pio2_large_quot|inlined.2 (result i32) + local.get $12 + local.set $14 + local.get $11 + local.set $13 + local.get $13 + i32.const 23 + i32.shr_s + i32.const 152 + i32.sub + local.set $15 + local.get $15 + i32.const 6 + i32.shr_s + local.set $16 + local.get $15 + i32.const 63 + i32.and + local.set $17 + i32.const 72 + local.get $16 + i32.const 0 + i32.add + call $~lib/array/Array#__unchecked_get + local.set $18 + i32.const 72 + local.get $16 + i32.const 1 + i32.add + call $~lib/array/Array#__unchecked_get + local.set $19 + local.get $17 + i32.const 32 + i32.gt_s + if + i32.const 72 + local.get $16 + i32.const 2 + i32.add + call $~lib/array/Array#__unchecked_get + local.set $21 + local.get $21 + i64.const 96 + local.get $17 + i64.extend_i32_s + i64.sub + i64.shr_u + local.set $20 + local.get $20 + local.get $19 + local.get $17 + i32.const 32 + i32.sub + i64.extend_i32_s + i64.shl + i64.or + local.set $20 + else + local.get $19 + i64.const 32 + local.get $17 + i64.extend_i32_s + i64.sub + i64.shr_u + local.set $20 + end + local.get $19 + i64.const 64 + local.get $17 + i64.extend_i32_s + i64.sub + i64.shr_u + local.get $18 + local.get $17 + i64.extend_i32_s + i64.shl + i64.or + local.set $21 + local.get $13 + i32.const 8388607 + i32.and + i32.const 8388608 + i32.or + i64.extend_i32_s + local.set $22 + local.get $22 + local.get $21 + i64.mul + local.get $22 + local.get $20 + i64.mul + i64.const 32 + i64.shr_u + i64.add + local.set $23 + local.get $23 + i64.const 2 + i64.shl + local.set $24 + local.get $23 + i64.const 62 + i64.shr_u + local.get $24 + i64.const 63 + i64.shr_u + i64.add + i32.wrap_i64 + local.set $25 + f64.const 8.515303950216386e-20 + local.get $14 + f64.promote_f32 + f64.copysign + local.get $24 + f64.convert_i64_s + f64.mul + global.set $~lib/math/rempio2f_y + local.get $25 + end + local.set $25 + i32.const 0 + local.get $25 + i32.sub + local.get $25 + local.get $3 + select + end + local.set $26 + global.get $~lib/math/rempio2f_y + local.set $27 + block $~lib/math/tan_kernf|inlined.5 (result f32) + local.get $27 + local.set $4 + local.get $26 + i32.const 1 + i32.and + local.set $13 + local.get $4 + local.get $4 + f64.mul + local.set $10 + f64.const 0.002974357433599673 + local.get $10 + f64.const 0.009465647849436732 + f64.mul + f64.add + local.set $9 + f64.const 0.05338123784456704 + local.get $10 + f64.const 0.024528318116654728 + f64.mul + f64.add + local.set $8 + local.get $10 + local.get $10 + f64.mul + local.set $7 + local.get $10 + local.get $4 + f64.mul + local.set $6 + f64.const 0.3333313950307914 + local.get $10 + f64.const 0.13339200271297674 + f64.mul + f64.add + local.set $5 + local.get $4 + local.get $6 + local.get $5 + f64.mul + f64.add + local.get $6 + local.get $7 + f64.mul + local.get $8 + local.get $7 + local.get $9 + f64.mul + f64.add + f64.mul + f64.add + local.set $9 + local.get $13 + if (result f64) + f32.const -1 + f64.promote_f32 + local.get $9 + f64.div + else + local.get $9 + end + f32.demote_f64 + end + ) + (func $../../lib/libm/assembly/libmf/tan (; 123 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.tan + ) + (func $~lib/math/NativeMathf.tanh (; 124 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + (local $2 f32) + (local $3 f32) + local.get $0 + i32.reinterpret_f32 + local.set $1 + local.get $1 + i32.const 2147483647 + i32.and + local.set $1 + local.get $1 + f32.reinterpret_i32 + local.set $2 + local.get $1 + i32.const 1057791828 + i32.gt_u + if + local.get $1 + i32.const 1092616192 + i32.gt_u + if + f32.const 1 + f32.const 0 + local.get $2 + f32.div + f32.add + local.set $3 + else + f32.const 2 + local.get $2 + f32.mul + call $~lib/math/NativeMathf.expm1 + local.set $3 + f32.const 1 + f32.const 2 + local.get $3 + f32.const 2 + f32.add + f32.div + f32.sub + local.set $3 + end + else + local.get $1 + i32.const 1048757624 + i32.gt_u + if + f32.const 2 + local.get $2 + f32.mul + call $~lib/math/NativeMathf.expm1 + local.set $3 + local.get $3 + local.get $3 + f32.const 2 + f32.add + f32.div + local.set $3 + else + local.get $1 + i32.const 8388608 + i32.ge_u + if + f32.const -2 + local.get $2 + f32.mul + call $~lib/math/NativeMathf.expm1 + local.set $3 + local.get $3 + f32.neg + local.get $3 + f32.const 2 + f32.add + f32.div + local.set $3 + else + local.get $2 + local.set $3 + end + end + end + local.get $3 + local.get $0 + f32.copysign + ) + (func $../../lib/libm/assembly/libmf/tanh (; 125 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + call $~lib/math/NativeMathf.tanh + ) + (func $../../lib/libm/assembly/libmf/trunc (; 126 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 f32) + local.get $0 + local.set $1 + local.get $1 + f32.trunc + ) + (func $null (; 127 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/std/map.json b/tests/compiler/std/map.json new file mode 100644 index 0000000000..9f7878d475 --- /dev/null +++ b/tests/compiler/std/map.json @@ -0,0 +1,6 @@ +{ + "asc_flags": [ + "--runtime half", + "--use ASC_RTRACE=1" + ] +} \ No newline at end of file diff --git a/tests/compiler/std/map.optimized.wat b/tests/compiler/std/map.optimized.wat index 1f151e8e2b..1cf649d83d 100644 --- a/tests/compiler/std/map.optimized.wat +++ b/tests/compiler/std/map.optimized.wat @@ -1,12 +1,12 @@ (module (type $FUNCSIG$v (func)) (type $FUNCSIG$ii (func (param i32) (result i32))) - (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) - (type $FUNCSIG$viii (func (param i32 i32 i32))) - (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$iij (func (param i32 i64) (result i32))) (type $FUNCSIG$ij (func (param i64) (result i32))) (type $FUNCSIG$iiji (func (param i32 i64 i32) (result i32))) @@ -21,366 +21,1750 @@ (type $FUNCSIG$vij (func (param i32 i64))) (type $FUNCSIG$vif (func (param i32 f32))) (type $FUNCSIG$vid (func (param i32 f64))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32))) + (import "rtrace" "onincrement" (func $~lib/rt/rtrace/onincrement (param i32))) + (import "rtrace" "ondecrement" (func $~lib/rt/rtrace/ondecrement (param i32))) + (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) (memory $0 1) - (data (i32.const 8) "\13\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") - (data (i32.const 56) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") - (data (i32.const 120) "\n\00\00\00s\00t\00d\00/\00m\00a\00p\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) + (data (i32.const 8) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s") + (data (i32.const 56) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e") + (data (i32.const 112) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s") + (data (i32.const 160) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h") + (data (i32.const 208) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") + (data (i32.const 264) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e") + (data (i32.const 320) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s") + (data (i32.const 360) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00s\00t\00d\00/\00m\00a\00p\00.\00t\00s") + (data (i32.const 400) "\0d\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\98D\08\00\00\00\00\00\98D\00\00\00\00\00\00\98\84\08\00\00\00\00\00\98\84\00\00\00\00\00\00\98\04\t\00\00\00\00\00\98\04\01\00\00\00\00\00\98\04\n\00\00\00\00\00\98\04\02\00\00\00\00\00\98\04\19\00\00\00\00\00\98\04\1a") + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) - (func $~lib/allocator/arena/__memory_allocate (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/rt/tlsf/removeBlock (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) - local.get $0 - i32.const 1073741824 - i32.gt_u + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.tee $3 + i32.const 1 + i32.and + i32.eqz if + i32.const 0 + i32.const 24 + i32.const 276 + i32.const 13 + call $~lib/builtins/abort unreachable end - global.get $~lib/allocator/arena/offset - local.tee $1 - local.get $0 - i32.const 1 - local.get $0 - i32.const 1 - i32.gt_u - select - i32.add - i32.const 7 - i32.add - i32.const -8 + local.get $3 + i32.const -4 i32.and - local.tee $0 - current_memory local.tee $2 i32.const 16 - i32.shl - i32.gt_u + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz if + i32.const 0 + i32.const 24 + i32.const 278 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 256 + i32.lt_u + if (result i32) local.get $2 - local.get $0 - local.get $1 - i32.sub - i32.const 65535 - i32.add - i32.const -65536 - i32.and - i32.const 16 + i32.const 4 i32.shr_u - local.tee $3 + local.set $2 + i32.const 0 + else local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $3 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $2 local.get $3 - i32.gt_s - select - grow_memory + i32.const 7 + i32.sub + end + local.tee $3 + i32.const 23 + i32.lt_u + if (result i32) + local.get $2 + i32.const 16 + i32.lt_u + else i32.const 0 - i32.lt_s - if - local.get $3 - grow_memory - i32.const 0 - i32.lt_s - if - unreachable - end - end end - local.get $0 - global.set $~lib/allocator/arena/offset - local.get $1 - ) - (func $~lib/internal/arraybuffer/allocateUnsafe (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - local.get $0 - i32.const 1073741816 - i32.gt_u + i32.eqz if i32.const 0 - i32.const 56 - i32.const 26 - i32.const 2 - call $~lib/env/abort + i32.const 24 + i32.const 291 + i32.const 13 + call $~lib/builtins/abort unreachable end - i32.const 1 - i32.const 32 - local.get $0 - i32.const 7 - i32.add - i32.clz - i32.sub - i32.shl - call $~lib/allocator/arena/__memory_allocate - local.tee $1 - local.get $0 - i32.store local.get $1 - ) - (func $~lib/internal/memory/memset (; 3 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - (local $2 i32) + i32.load offset=20 + local.set $4 local.get $1 - i32.eqz + i32.load offset=16 + local.tee $5 if - return + local.get $5 + local.get $4 + i32.store offset=20 end - local.get $0 - i32.const 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - i32.const 1 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 2 - i32.le_u + local.get $4 if - return + local.get $4 + local.get $5 + i32.store offset=16 end - local.get $0 - i32.const 1 + local.get $3 + i32.const 4 + i32.shl + local.get $2 i32.add - i32.const 0 - i32.store8 - local.get $0 i32.const 2 - i32.add - i32.const 0 - i32.store8 + i32.shl local.get $0 - local.get $1 i32.add - local.tee $2 - i32.const 2 - i32.sub - i32.const 0 - i32.store8 - local.get $2 - i32.const 3 - i32.sub - i32.const 0 - i32.store8 + i32.load offset=96 local.get $1 - i32.const 6 - i32.le_u + i32.eq if - return + local.get $3 + i32.const 4 + i32.shl + local.get $2 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $4 + i32.store offset=96 + local.get $4 + i32.eqz + if + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const 1 + local.get $2 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.store offset=4 + local.get $1 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $3 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end end - local.get $0 - i32.const 3 - i32.add - i32.const 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - i32.const 4 - i32.sub - i32.const 0 - i32.store8 + ) + (func $~lib/rt/tlsf/insertBlock (; 6 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) local.get $1 - i32.const 8 - i32.le_u + i32.eqz if - return + i32.const 0 + i32.const 24 + i32.const 204 + i32.const 13 + call $~lib/builtins/abort + unreachable end - i32.const 0 - local.get $0 - i32.sub - i32.const 3 + local.get $1 + i32.load + local.tee $3 + i32.const 1 i32.and - local.tee $2 - local.get $0 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 206 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 i32.add - local.tee $0 - i32.const 0 - i32.store local.get $1 - local.get $2 - i32.sub + i32.load i32.const -4 i32.and - local.tee $1 - local.get $0 i32.add - i32.const 4 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 8 - i32.le_u + local.tee $4 + i32.load + local.tee $5 + i32.const 1 + i32.and if - return - end - local.get $0 - i32.const 4 - i32.add - i32.const 0 + local.get $3 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const -4 + i32.and + i32.add + local.tee $2 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $3 + i32.const 3 + i32.and + local.get $2 + i32.or + local.tee $3 + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.set $5 + end + end + local.get $3 + i32.const 2 + i32.and + if + local.get $1 + i32.const 4 + i32.sub + i32.load + local.tee $2 + i32.load + local.tee $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 227 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $3 + i32.const -4 + i32.and + i32.add + local.tee $7 + i32.const 1073741808 + i32.lt_u + if (result i32) + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $2 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $3 + i32.store + local.get $2 + else + local.get $1 + end + local.set $1 + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $3 + i32.const -4 + i32.and + local.tee $2 + i32.const 16 + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 243 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $2 + i32.const 256 + i32.lt_u + if (result i32) + local.get $2 + i32.const 4 + i32.shr_u + local.set $4 + i32.const 0 + else + local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $4 + local.get $2 + i32.const 7 + i32.sub + end + local.tee $3 + i32.const 23 + i32.lt_u + if (result i32) + local.get $4 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 259 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + local.set $2 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $2 + i32.store offset=20 + local.get $2 + if + local.get $2 + local.get $1 + i32.store offset=16 + end + local.get $3 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $1 + i32.store offset=96 + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $3 + i32.shl + i32.or i32.store + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const 1 + local.get $4 + i32.shl + i32.or + i32.store offset=4 + ) + (func $~lib/rt/tlsf/addMemory (; 7 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $1 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $1 + local.get $2 + i32.le_u + select + select + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 385 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=1568 + local.tee $3 + if + local.get $1 + local.get $3 + i32.const 16 + i32.add + i32.lt_u + if + i32.const 0 + i32.const 24 + i32.const 395 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $3 + i32.eq + if + local.get $3 + i32.load + local.set $4 + local.get $1 + i32.const 16 + i32.sub + local.set $1 + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.lt_u + if + i32.const 0 + i32.const 24 + i32.const 407 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.tee $2 + i32.const 48 + i32.lt_u + if + return + end + local.get $1 + local.get $4 + i32.const 2 + i32.and + local.get $2 + i32.const 32 + i32.sub + i32.const 1 + i32.or + i32.or + i32.store + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $2 + i32.add + i32.const 16 + i32.sub + local.tee $2 + i32.const 2 + i32.store + local.get $0 + local.get $2 + i32.store offset=1568 + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/tlsf/initializeRoot (; 8 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 1 + memory.size + local.tee $0 + i32.gt_s + if (result i32) + i32.const 1 + local.get $0 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + i32.const 512 + i32.const 0 + i32.store + i32.const 2080 + i32.const 0 + i32.store + i32.const 0 + local.set $0 + loop $repeat|0 + block $break|0 + local.get $0 + i32.const 23 + i32.ge_u + br_if $break|0 + local.get $0 + i32.const 2 + i32.shl + i32.const 512 + i32.add + i32.const 0 + i32.store offset=4 + i32.const 0 + local.set $1 + loop $repeat|1 + block $break|1 + local.get $1 + i32.const 16 + i32.ge_u + br_if $break|1 + local.get $0 + i32.const 4 + i32.shl + local.get $1 + i32.add + i32.const 2 + i32.shl + i32.const 512 + i32.add + i32.const 0 + i32.store offset=96 + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|1 + end + end + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + end + i32.const 512 + i32.const 2096 + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + i32.const 512 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 72 + i32.const 24 + i32.const 447 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const -16 + i32.and + local.tee $0 + i32.const 16 + local.get $0 + i32.const 16 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + i32.const 256 + i32.lt_u + if (result i32) + local.get $1 + i32.const 4 + i32.shr_u + local.set $1 + i32.const 0 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + local.get $1 + i32.add + i32.const 1 + i32.sub + local.set $1 + end + local.get $1 + i32.const 31 + local.get $1 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $1 + local.get $2 + i32.const 7 + i32.sub + end + local.tee $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $1 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 337 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const -1 + local.get $1 + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $1 + i32.ctz + local.get $2 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + else + local.get $0 + i32.load + i32.const -1 + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $1 + i32.ctz + local.tee $1 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 350 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.ctz + local.get $1 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + else + i32.const 0 + end + end + ) + (func $~lib/rt/tlsf/growMemory (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + memory.size + local.tee $2 + local.get $1 + i32.const 65535 + i32.add + i32.const -65536 + i32.and + i32.const 16 + i32.shr_u + local.tee $1 + local.get $2 + local.get $1 + i32.gt_s + select + memory.grow + i32.const 0 + i32.lt_s + if + local.get $1 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + local.get $0 + local.get $2 + i32.const 16 + i32.shl + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + ) + (func $~lib/rt/tlsf/prepareBlock (; 12 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + if + i32.const 0 + i32.const 24 + i32.const 364 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const -4 + i32.and + local.get $2 + i32.sub + local.tee $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $3 + i32.const 2 + i32.and + local.get $2 + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.tee $1 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const -2 + i32.and + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + i32.load + i32.const -3 + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.tee $3 + call $~lib/rt/tlsf/searchBlock + local.tee $2 + i32.eqz + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $3 + call $~lib/rt/tlsf/searchBlock + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 477 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + i32.load + i32.const -4 + i32.and + local.get $3 + i32.lt_u + if + i32.const 0 + i32.const 24 + i32.const 479 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 0 + i32.store offset=4 + local.get $2 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $2 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $2 + call $~lib/rt/rtrace/onalloc + local.get $2 + ) + (func $~lib/rt/tlsf/__alloc (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + global.get $~lib/rt/tlsf/ROOT + local.tee $2 + if (result i32) + local.get $2 + else + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + end + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.tee $0 + local.get $1 + i32.store offset=8 + local.get $0 + i32.const 16 + i32.add + ) + (func $~lib/rt/pure/increment (; 15 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const -268435456 + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne + if + i32.const 0 + i32.const 128 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/rtrace/onincrement + local.get $0 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 128 + i32.const 107 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/pure/__retain (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 508 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment + end + local.get $0 + ) + (func $~lib/memory/memory.fill (; 17 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.eqz + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 0 + i32.store8 + local.get $0 + local.get $1 + i32.add + i32.const 1 + i32.sub + i32.const 0 + i32.store8 + local.get $1 + i32.const 2 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 1 + i32.add + i32.const 0 + i32.store8 + local.get $0 + i32.const 2 + i32.add + i32.const 0 + i32.store8 + local.get $0 + local.get $1 + i32.add + local.tee $2 + i32.const 2 + i32.sub + i32.const 0 + i32.store8 + local.get $2 + i32.const 3 + i32.sub + i32.const 0 + i32.store8 + local.get $1 + i32.const 6 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 3 + i32.add + i32.const 0 + i32.store8 + local.get $0 + local.get $1 + i32.add + i32.const 4 + i32.sub + i32.const 0 + i32.store8 + local.get $1 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + local.get $0 + i32.sub + i32.const 3 + i32.and + local.tee $1 + i32.sub + local.set $2 + local.get $0 + local.get $1 + i32.add + local.tee $0 + i32.const 0 + i32.store + local.get $2 + i32.const -4 + i32.and + local.tee $1 + local.get $0 + i32.add + i32.const 4 + i32.sub + i32.const 0 + i32.store + local.get $1 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 4 + i32.add + i32.const 0 + i32.store + local.get $0 + i32.const 8 + i32.add + i32.const 0 + i32.store + local.get $0 + local.get $1 + i32.add + local.tee $2 + i32.const 12 + i32.sub + i32.const 0 + i32.store + local.get $2 + i32.const 8 + i32.sub + i32.const 0 + i32.store + local.get $1 + i32.const 24 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 12 + i32.add + i32.const 0 + i32.store + local.get $0 + i32.const 16 + i32.add + i32.const 0 + i32.store + local.get $0 + i32.const 20 + i32.add + i32.const 0 + i32.store + local.get $0 + i32.const 24 + i32.add + i32.const 0 + i32.store + local.get $0 + local.get $1 + i32.add + local.tee $2 + i32.const 28 + i32.sub + i32.const 0 + i32.store + local.get $2 + i32.const 24 + i32.sub + i32.const 0 + i32.store + local.get $2 + i32.const 20 + i32.sub + i32.const 0 + i32.store + local.get $2 + i32.const 16 + i32.sub + i32.const 0 + i32.store + local.get $0 + i32.const 4 + i32.and + i32.const 24 + i32.add + local.tee $2 + local.get $0 + i32.add + local.set $0 + local.get $1 + local.get $2 + i32.sub + local.set $1 + loop $continue|0 + local.get $1 + i32.const 32 + i32.ge_u + if + local.get $0 + i64.const 0 + i64.store + local.get $0 + i32.const 8 + i32.add + i64.const 0 + i64.store + local.get $0 + i32.const 16 + i32.add + i64.const 0 + i64.store + local.get $0 + i32.const 24 + i32.add + i64.const 0 + i64.store + local.get $1 + i32.const 32 + i32.sub + local.set $1 + local.get $0 + i32.const 32 + i32.add + local.set $0 + br $continue|0 + end + end + end + ) + (func $~lib/arraybuffer/ArrayBuffer#constructor (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + i32.const 1073741808 + i32.gt_u + if + i32.const 176 + i32.const 224 + i32.const 56 + i32.const 42 + call $~lib/builtins/abort + unreachable + end local.get $0 - i32.const 8 - i32.add i32.const 0 - i32.store + call $~lib/rt/tlsf/__alloc + local.tee $1 local.get $0 + call $~lib/memory/memory.fill local.get $1 - i32.add + call $~lib/rt/pure/__retain + ) + (func $~lib/rt/tlsf/freeBlock (; 19 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load local.tee $2 - i32.const 12 - i32.sub - i32.const 0 - i32.store + i32.const 1 + i32.and + if + i32.const 0 + i32.const 24 + i32.const 531 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 local.get $2 - i32.const 8 - i32.sub - i32.const 0 + i32.const 1 + i32.or i32.store + local.get $0 local.get $1 - i32.const 24 - i32.le_u + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/rtrace/onfree + ) + (func $~lib/rt/__typeinfo (; 20 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 400 + i32.load + i32.gt_u if - return + i32.const 280 + i32.const 336 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort + unreachable end local.get $0 - i32.const 12 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 16 + i32.const 3 + i32.shl + i32.const 404 i32.add - i32.const 0 - i32.store + i32.load + ) + (func $~lib/memory/memory.copy (; 21 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $2 + local.set $3 + local.get $0 + local.get $1 + i32.eq + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $1 + i32.lt_u + if + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|0 + local.get $0 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + br $continue|0 + end + end + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $1 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + br $continue|1 + end + end + end + loop $continue|2 + local.get $3 + if + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + else + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|3 + local.get $0 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $3 + i32.const 8 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + loop $continue|5 + local.get $3 + if + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + ) + (func $~lib/rt/tlsf/__free (; 22 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 561 + i32.const 13 + call $~lib/builtins/abort + unreachable + end local.get $0 - i32.const 20 - i32.add + i32.const 15 + i32.and + i32.eqz i32.const 0 - i32.store local.get $0 - i32.const 24 - i32.add - i32.const 0 - i32.store + select + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 562 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 28 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 24 + i32.const 16 i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 20 + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/growRoots (; 23 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/pure/CUR + global.get $~lib/rt/pure/ROOTS + local.tee $1 i32.sub + local.tee $2 + i32.const 1 + i32.shl + local.tee $0 + i32.const 256 + local.get $0 + i32.const 256 + i32.gt_u + select + local.tee $3 i32.const 0 - i32.store - local.get $2 + call $~lib/rt/tlsf/__alloc + local.tee $0 i32.const 16 i32.sub - i32.const 0 - i32.store + call $~lib/rt/rtrace/onfree local.get $0 - i32.const 4 - i32.and - i32.const 24 + local.get $1 + local.get $2 + call $~lib/memory/memory.copy + local.get $1 + if + local.get $1 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onalloc + local.get $1 + call $~lib/rt/tlsf/__free + end + local.get $0 + global.set $~lib/rt/pure/ROOTS + local.get $0 + local.get $2 i32.add - local.tee $2 + global.set $~lib/rt/pure/CUR local.get $0 + local.get $3 i32.add - local.set $0 + global.set $~lib/rt/pure/END + ) + (func $~lib/rt/pure/appendRoot (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/pure/CUR + local.tee $1 + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 + end local.get $1 - local.get $2 - i32.sub + local.get $0 + i32.store + local.get $1 + i32.const 4 + i32.add + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/decrement (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.tee $2 + i32.const 268435455 + i32.and local.set $1 - loop $continue|0 - local.get $1 - i32.const 32 - i32.ge_u + local.get $0 + call $~lib/rt/rtrace/ondecrement + local.get $0 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 128 + i32.const 115 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/rt/__visit_members + local.get $2 + i32.const -2147483648 + i32.and if local.get $0 - i64.const 0 - i64.store + i32.const -2147483648 + i32.store offset=4 + else + global.get $~lib/rt/tlsf/ROOT local.get $0 - i32.const 8 - i32.add - i64.const 0 - i64.store - local.get $0 - i32.const 16 - i32.add - i64.const 0 - i64.store + call $~lib/rt/tlsf/freeBlock + end + else + local.get $1 + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 128 + i32.const 124 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 16 + i32.and + if local.get $0 - i32.const 24 - i32.add - i64.const 0 - i64.store local.get $1 - i32.const 32 + i32.const 1 i32.sub - local.set $1 + local.get $2 + i32.const -268435456 + i32.and + i32.or + i32.store offset=4 + else local.get $0 - i32.const 32 - i32.add - local.set $0 - br $continue|0 + local.get $1 + i32.const 1 + i32.sub + i32.const -1342177280 + i32.or + i32.store offset=4 + local.get $2 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/appendRoot + end end end ) - (func $~lib/arraybuffer/ArrayBuffer#constructor (; 4 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) + (func $~lib/rt/pure/__release (; 26 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 - i32.const 1073741816 + i32.const 508 i32.gt_u if - i32.const 0 - i32.const 8 - i32.const 47 - i32.const 40 - call $~lib/env/abort - unreachable - end - local.get $0 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $2 - local.get $1 - i32.eqz - if - local.get $2 - i32.const 8 - i32.add local.get $0 - call $~lib/internal/memory/memset + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement end - local.get $2 ) - (func $~lib/map/Map#clear (; 5 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 + (func $~lib/map/Map#clear (; 27 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) i32.const 16 - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 + local.get $0 + i32.load + call $~lib/rt/pure/__release + local.get $0 + local.get $1 i32.store local.get $0 i32.const 3 i32.store offset=4 - local.get $0 i32.const 48 - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 + local.get $0 + i32.load offset=8 + call $~lib/rt/pure/__release + local.get $0 + local.get $1 i32.store offset=8 local.get $0 i32.const 4 @@ -392,10 +1776,12 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 6 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/map/Map#constructor (; 28 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 - call $~lib/allocator/arena/__memory_allocate + i32.const 3 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.store @@ -418,7 +1804,14 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/map/Map#find (; 7 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/hash/hash8 (; 29 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const -2128831035 + i32.xor + i32.const 16777619 + i32.mul + ) + (func $~lib/map/Map#find (; 30 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.load local.get $0 @@ -428,42 +1821,40 @@ i32.const 2 i32.shl i32.add - i32.load offset=8 - local.set $2 + i32.load + local.set $0 loop $continue|0 - local.get $2 + local.get $0 if - local.get $2 + local.get $0 i32.load offset=8 i32.const 1 i32.and - i32.eqz - local.tee $0 - if - local.get $2 + if (result i32) + i32.const 0 + else + local.get $0 i32.load8_u local.get $1 i32.const 255 i32.and i32.eq - local.set $0 end - local.get $0 if - local.get $2 + local.get $0 return end - local.get $2 + local.get $0 i32.load offset=8 i32.const -2 i32.and - local.set $2 + local.set $0 br $continue|0 end end i32.const 0 ) - (func $~lib/map/Map#has (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#has (; 31 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 @@ -471,15 +1862,12 @@ i32.shl i32.const 24 i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash8 call $~lib/map/Map#find i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 9 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 32 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -490,13 +1878,12 @@ local.get $1 i32.const 1 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.shl - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 - local.get $2 + local.set $5 + local.get $3 f64.convert_i32_s f64.const 2.6666666666666665 f64.mul @@ -504,82 +1891,98 @@ local.tee $6 i32.const 12 i32.mul - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 + local.set $3 local.get $0 i32.load offset=8 - i32.const 8 - i32.add - local.tee $2 + local.tee $4 local.get $0 i32.load offset=16 i32.const 12 i32.mul i32.add local.set $7 - local.get $5 - i32.const 8 - i32.add - local.set $3 + local.get $3 + local.set $2 loop $continue|0 - local.get $2 + local.get $4 local.get $7 i32.ne if - local.get $2 + local.get $4 i32.load offset=8 i32.const 1 i32.and i32.eqz if - local.get $3 local.get $2 + local.get $4 i32.load8_s i32.store8 - local.get $3 local.get $2 + local.get $4 i32.load offset=4 i32.store offset=4 - local.get $3 local.get $2 + local.get $4 i32.load8_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash8 local.get $1 i32.and i32.const 2 i32.shl - local.get $4 + local.get $5 i32.add local.tee $8 - i32.load offset=8 + i32.load i32.store offset=8 local.get $8 - local.get $3 - i32.store offset=8 - local.get $3 + local.get $2 + i32.store + local.get $2 i32.const 12 i32.add - local.set $3 + local.set $2 end - local.get $2 + local.get $4 i32.const 12 i32.add - local.set $2 + local.set $4 br $continue|0 end end local.get $0 - local.get $4 + i32.load + local.tee $2 + local.get $5 + i32.ne + if + local.get $5 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release + end + local.get $0 + local.get $5 i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $5 + i32.load offset=8 + local.tee $1 + local.get $3 + i32.ne + if + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 + local.get $3 i32.store offset=8 local.get $0 local.get $6 @@ -588,25 +1991,24 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $5 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release ) - (func $~lib/map/Map#set (; 10 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#set (; 33 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + local.get $0 + local.get $1 local.get $1 i32.const 24 i32.shl i32.const 24 i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.tee $3 - local.set $4 - local.get $0 - local.get $1 - local.get $3 + call $~lib/util/hash/hash8 + local.tee $5 call $~lib/map/Map#find local.tee $3 if @@ -645,20 +2047,19 @@ end local.get $0 i32.load offset=8 - local.set $3 + call $~lib/rt/pure/__retain + local.set $4 local.get $0 local.get $0 i32.load offset=16 - local.tee $5 + local.tee $3 i32.const 1 i32.add i32.store offset=16 local.get $3 - i32.const 8 - i32.add - local.get $5 i32.const 12 i32.mul + local.get $4 i32.add local.tee $3 local.get $1 @@ -677,20 +2078,22 @@ i32.load local.get $0 i32.load offset=4 - local.get $4 + local.get $5 i32.and i32.const 2 i32.shl i32.add local.tee $0 - i32.load offset=8 + i32.load i32.store offset=8 local.get $0 local.get $3 - i32.store offset=8 + i32.store + local.get $4 + call $~lib/rt/pure/__release end ) - (func $~lib/map/Map#get (; 11 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#get (; 34 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 @@ -698,10 +2101,7 @@ i32.shl i32.const 24 i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash8 call $~lib/map/Map#find local.tee $0 if (result i32) @@ -711,7 +2111,7 @@ unreachable end ) - (func $~lib/map/Map#delete (; 12 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#delete (; 35 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 local.get $1 @@ -720,10 +2120,7 @@ i32.shl i32.const 24 i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash8 call $~lib/map/Map#find local.tee $1 i32.eqz @@ -758,8 +2155,7 @@ i32.gt_u select i32.ge_u - local.tee $1 - if + if (result i32) local.get $0 i32.load offset=20 local.get $0 @@ -769,16 +2165,16 @@ f64.mul i32.trunc_f64_s i32.lt_s - local.set $1 + else + i32.const 0 end - local.get $1 if local.get $0 local.get $2 call $~lib/map/Map#rehash end ) - (func $std/map/test (; 13 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 36 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) call $~lib/map/Map#constructor @@ -793,10 +2189,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 8 + i32.const 376 + i32.const 6 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -815,10 +2211,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 10 + i32.const 376 + i32.const 8 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -834,10 +2230,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 11 + i32.const 376 + i32.const 9 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -855,10 +2251,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 13 + i32.const 376 + i32.const 11 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -874,10 +2270,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 17 + i32.const 376 + i32.const 15 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -893,10 +2289,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 18 + i32.const 376 + i32.const 16 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -915,10 +2311,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 20 + i32.const 376 + i32.const 18 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -934,10 +2330,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 21 + i32.const 376 + i32.const 19 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -955,10 +2351,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 23 + i32.const 376 + i32.const 21 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -974,10 +2370,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 27 + i32.const 376 + i32.const 25 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -993,10 +2389,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 28 + i32.const 376 + i32.const 26 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -1007,10 +2403,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 30 + i32.const 376 + i32.const 28 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -1028,10 +2424,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 32 + i32.const 376 + i32.const 30 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -1046,10 +2442,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 36 + i32.const 376 + i32.const 34 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -1068,10 +2464,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 38 + i32.const 376 + i32.const 36 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -1082,10 +2478,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 40 + i32.const 376 + i32.const 38 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -1103,10 +2499,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -1115,28 +2511,55 @@ i32.load offset=20 if i32.const 0 - i32.const 120 - i32.const 46 + i32.const 376 + i32.const 44 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + ) + (func $~lib/map/Map#constructor (; 37 ;) (type $FUNCSIG$i) (result i32) + (local $0 i32) + i32.const 24 + i32.const 4 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 + call $~lib/map/Map#clear + local.get $0 ) - (func $~lib/map/Map#has (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#has (; 38 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 i32.const 255 i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash8 call $~lib/map/Map#find i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 15 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 39 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1147,13 +2570,12 @@ local.get $1 i32.const 1 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.shl - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 - local.get $2 + local.set $5 + local.get $3 f64.convert_i32_s f64.const 2.6666666666666665 f64.mul @@ -1161,82 +2583,98 @@ local.tee $6 i32.const 12 i32.mul - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 + local.set $3 local.get $0 i32.load offset=8 - i32.const 8 - i32.add - local.tee $2 + local.tee $4 local.get $0 i32.load offset=16 i32.const 12 i32.mul i32.add local.set $7 - local.get $5 - i32.const 8 - i32.add - local.set $3 + local.get $3 + local.set $2 loop $continue|0 - local.get $2 + local.get $4 local.get $7 i32.ne if - local.get $2 + local.get $4 i32.load offset=8 i32.const 1 i32.and i32.eqz if - local.get $3 local.get $2 + local.get $4 i32.load8_u i32.store8 - local.get $3 local.get $2 + local.get $4 i32.load offset=4 i32.store offset=4 - local.get $3 local.get $2 + local.get $4 i32.load8_u - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash8 local.get $1 i32.and i32.const 2 i32.shl - local.get $4 + local.get $5 i32.add local.tee $8 - i32.load offset=8 + i32.load i32.store offset=8 local.get $8 - local.get $3 - i32.store offset=8 - local.get $3 + local.get $2 + i32.store + local.get $2 i32.const 12 i32.add - local.set $3 + local.set $2 end - local.get $2 + local.get $4 i32.const 12 i32.add - local.set $2 + local.set $4 br $continue|0 end end local.get $0 - local.get $4 + i32.load + local.tee $2 + local.get $5 + i32.ne + if + local.get $5 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release + end + local.get $0 + local.get $5 i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $5 + i32.load offset=8 + local.tee $1 + local.get $3 + i32.ne + if + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 + local.get $3 i32.store offset=8 local.get $0 local.get $6 @@ -1245,23 +2683,22 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $5 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release ) - (func $~lib/map/Map#set (; 16 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#set (; 40 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + local.get $0 + local.get $1 local.get $1 i32.const 255 i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.tee $3 - local.set $4 - local.get $0 - local.get $1 - local.get $3 + call $~lib/util/hash/hash8 + local.tee $5 call $~lib/map/Map#find local.tee $3 if @@ -1300,20 +2737,19 @@ end local.get $0 i32.load offset=8 - local.set $3 + call $~lib/rt/pure/__retain + local.set $4 local.get $0 local.get $0 i32.load offset=16 - local.tee $5 + local.tee $3 i32.const 1 i32.add i32.store offset=16 local.get $3 - i32.const 8 - i32.add - local.get $5 i32.const 12 i32.mul + local.get $4 i32.add local.tee $3 local.get $1 @@ -1332,29 +2768,28 @@ i32.load local.get $0 i32.load offset=4 - local.get $4 + local.get $5 i32.and i32.const 2 i32.shl i32.add local.tee $0 - i32.load offset=8 + i32.load i32.store offset=8 local.get $0 local.get $3 - i32.store offset=8 + i32.store + local.get $4 + call $~lib/rt/pure/__release end ) - (func $~lib/map/Map#get (; 17 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#get (; 41 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 i32.const 255 i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash8 call $~lib/map/Map#find local.tee $0 if (result i32) @@ -1364,17 +2799,14 @@ unreachable end ) - (func $~lib/map/Map#delete (; 18 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#delete (; 42 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 local.get $1 local.get $1 i32.const 255 i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash8 call $~lib/map/Map#find local.tee $1 i32.eqz @@ -1409,8 +2841,7 @@ i32.gt_u select i32.ge_u - local.tee $1 - if + if (result i32) local.get $0 i32.load offset=20 local.get $0 @@ -1420,19 +2851,19 @@ f64.mul i32.trunc_f64_s i32.lt_s - local.set $1 + else + i32.const 0 end - local.get $1 if local.get $0 local.get $2 call $~lib/map/Map#rehash end ) - (func $std/map/test (; 19 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 43 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) - call $~lib/map/Map#constructor + call $~lib/map/Map#constructor local.set $1 loop $repeat|0 local.get $0 @@ -1444,10 +2875,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 8 + i32.const 376 + i32.const 6 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -1464,10 +2895,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 10 + i32.const 376 + i32.const 8 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -1481,10 +2912,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 11 + i32.const 376 + i32.const 9 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -1502,10 +2933,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 13 + i32.const 376 + i32.const 11 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -1521,10 +2952,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 17 + i32.const 376 + i32.const 15 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -1538,10 +2969,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 18 + i32.const 376 + i32.const 16 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -1558,10 +2989,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 20 + i32.const 376 + i32.const 18 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -1575,10 +3006,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 21 + i32.const 376 + i32.const 19 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -1596,10 +3027,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 23 + i32.const 376 + i32.const 21 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -1615,10 +3046,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 27 + i32.const 376 + i32.const 25 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -1632,10 +3063,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 28 + i32.const 376 + i32.const 26 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -1646,10 +3077,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 30 + i32.const 376 + i32.const 28 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -1667,10 +3098,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 32 + i32.const 376 + i32.const 30 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -1685,10 +3116,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 36 + i32.const 376 + i32.const 34 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -1705,10 +3136,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 38 + i32.const 376 + i32.const 36 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -1719,10 +3150,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 40 + i32.const 376 + i32.const 38 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -1740,10 +3171,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -1752,14 +3183,59 @@ i32.load offset=20 if i32.const 0 - i32.const 120 - i32.const 46 + i32.const 376 + i32.const 44 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + ) + (func $~lib/map/Map#constructor (; 44 ;) (type $FUNCSIG$i) (result i32) + (local $0 i32) + i32.const 24 + i32.const 5 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 + call $~lib/map/Map#clear + local.get $0 + ) + (func $~lib/util/hash/hash16 (; 45 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 255 + i32.and + i32.const -2128831035 + i32.xor + i32.const 16777619 + i32.mul + local.get $0 + i32.const 8 + i32.shr_u + i32.xor + i32.const 16777619 + i32.mul ) - (func $~lib/map/Map#find (; 20 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 46 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.load local.get $0 @@ -1769,42 +3245,40 @@ i32.const 2 i32.shl i32.add - i32.load offset=8 - local.set $2 + i32.load + local.set $0 loop $continue|0 - local.get $2 + local.get $0 if - local.get $2 + local.get $0 i32.load offset=8 i32.const 1 i32.and - i32.eqz - local.tee $0 - if - local.get $2 + if (result i32) + i32.const 0 + else + local.get $0 i32.load16_u local.get $1 i32.const 65535 i32.and i32.eq - local.set $0 end - local.get $0 if - local.get $2 + local.get $0 return end - local.get $2 + local.get $0 i32.load offset=8 i32.const -2 i32.and - local.set $2 + local.set $0 br $continue|0 end end i32.const 0 ) - (func $~lib/map/Map#has (; 21 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#has (; 47 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 @@ -1812,24 +3286,12 @@ i32.shl i32.const 16 i32.shr_s - local.tee $0 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $0 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash16 call $~lib/map/Map#find i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 22 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 48 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1840,141 +3302,137 @@ local.get $1 i32.const 1 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.shl - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $5 - local.get $2 + local.get $3 f64.convert_i32_s f64.const 2.6666666666666665 f64.mul i32.trunc_f64_s - local.tee $7 + local.tee $6 i32.const 12 i32.mul - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $6 + local.set $3 local.get $0 i32.load offset=8 - i32.const 8 - i32.add - local.tee $2 + local.tee $4 local.get $0 i32.load offset=16 i32.const 12 i32.mul i32.add - local.set $8 - local.get $6 - i32.const 8 - i32.add - local.set $3 + local.set $7 + local.get $3 + local.set $2 loop $continue|0 - local.get $2 - local.get $8 + local.get $4 + local.get $7 i32.ne if - local.get $2 + local.get $4 i32.load offset=8 i32.const 1 i32.and i32.eqz if - local.get $3 local.get $2 + local.get $4 i32.load16_s i32.store16 - local.get $3 local.get $2 + local.get $4 i32.load offset=4 i32.store offset=4 - local.get $3 local.get $2 - i32.load16_s - local.tee $4 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul local.get $4 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul + i32.load16_s + call $~lib/util/hash/hash16 local.get $1 i32.and i32.const 2 i32.shl local.get $5 i32.add - local.tee $4 - i32.load offset=8 - i32.store offset=8 - local.get $4 - local.get $3 + local.tee $8 + i32.load i32.store offset=8 - local.get $3 + local.get $8 + local.get $2 + i32.store + local.get $2 i32.const 12 i32.add - local.set $3 + local.set $2 end - local.get $2 + local.get $4 i32.const 12 i32.add - local.set $2 + local.set $4 br $continue|0 end end local.get $0 + i32.load + local.tee $2 + local.get $5 + i32.ne + if + local.get $5 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release + end + local.get $0 local.get $5 i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $6 + i32.load offset=8 + local.tee $1 + local.get $3 + i32.ne + if + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 + local.get $3 i32.store offset=8 local.get $0 - local.get $7 + local.get $6 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 + local.get $5 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release ) - (func $~lib/map/Map#set (; 23 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#set (; 49 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + local.get $0 + local.get $1 local.get $1 i32.const 16 i32.shl i32.const 16 i32.shr_s - local.tee $3 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $3 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - local.tee $3 - local.set $4 - local.get $0 - local.get $1 - local.get $3 + call $~lib/util/hash/hash16 + local.tee $5 call $~lib/map/Map#find local.tee $3 if @@ -2013,20 +3471,19 @@ end local.get $0 i32.load offset=8 - local.set $3 + call $~lib/rt/pure/__retain + local.set $4 local.get $0 local.get $0 i32.load offset=16 - local.tee $5 + local.tee $3 i32.const 1 i32.add i32.store offset=16 local.get $3 - i32.const 8 - i32.add - local.get $5 i32.const 12 i32.mul + local.get $4 i32.add local.tee $3 local.get $1 @@ -2045,40 +3502,30 @@ i32.load local.get $0 i32.load offset=4 - local.get $4 + local.get $5 i32.and i32.const 2 i32.shl i32.add local.tee $0 - i32.load offset=8 + i32.load i32.store offset=8 local.get $0 local.get $3 - i32.store offset=8 + i32.store + local.get $4 + call $~lib/rt/pure/__release end ) - (func $~lib/map/Map#get (; 24 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 - local.get $1 - local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - local.tee $0 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + (func $~lib/map/Map#get (; 50 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul + local.get $1 + local.get $1 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + call $~lib/util/hash/hash16 call $~lib/map/Map#find local.tee $0 if (result i32) @@ -2088,7 +3535,7 @@ unreachable end ) - (func $~lib/map/Map#delete (; 25 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#delete (; 51 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 local.get $1 @@ -2097,19 +3544,7 @@ i32.shl i32.const 16 i32.shr_s - local.tee $1 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $1 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash16 call $~lib/map/Map#find local.tee $1 i32.eqz @@ -2144,8 +3579,7 @@ i32.gt_u select i32.ge_u - local.tee $1 - if + if (result i32) local.get $0 i32.load offset=20 local.get $0 @@ -2155,19 +3589,19 @@ f64.mul i32.trunc_f64_s i32.lt_s - local.set $1 + else + i32.const 0 end - local.get $1 if local.get $0 local.get $2 call $~lib/map/Map#rehash end ) - (func $std/map/test (; 26 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 52 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) - call $~lib/map/Map#constructor + call $~lib/map/Map#constructor local.set $1 loop $repeat|0 local.get $0 @@ -2179,10 +3613,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 8 + i32.const 376 + i32.const 6 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -2201,10 +3635,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 10 + i32.const 376 + i32.const 8 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -2220,10 +3654,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 11 + i32.const 376 + i32.const 9 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -2241,10 +3675,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 13 + i32.const 376 + i32.const 11 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -2260,10 +3694,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 17 + i32.const 376 + i32.const 15 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -2279,10 +3713,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 18 + i32.const 376 + i32.const 16 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -2301,10 +3735,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 20 + i32.const 376 + i32.const 18 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -2320,10 +3754,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 21 + i32.const 376 + i32.const 19 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -2341,10 +3775,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 23 + i32.const 376 + i32.const 21 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -2360,10 +3794,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 27 + i32.const 376 + i32.const 25 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -2379,10 +3813,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 28 + i32.const 376 + i32.const 26 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -2393,10 +3827,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 30 + i32.const 376 + i32.const 28 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -2414,10 +3848,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 32 + i32.const 376 + i32.const 30 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -2432,10 +3866,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 36 + i32.const 376 + i32.const 34 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -2454,10 +3888,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 38 + i32.const 376 + i32.const 36 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -2468,10 +3902,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 40 + i32.const 376 + i32.const 38 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -2489,10 +3923,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -2501,37 +3935,55 @@ i32.load offset=20 if i32.const 0 - i32.const 120 - i32.const 46 + i32.const 376 + i32.const 44 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + ) + (func $~lib/map/Map#constructor (; 53 ;) (type $FUNCSIG$i) (result i32) + (local $0 i32) + i32.const 24 + i32.const 6 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 + call $~lib/map/Map#clear + local.get $0 ) - (func $~lib/map/Map#has (; 27 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#has (; 54 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 i32.const 65535 i32.and - local.tee $0 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $0 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash16 call $~lib/map/Map#find i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 28 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 55 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2542,139 +3994,135 @@ local.get $1 i32.const 1 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.shl - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $5 - local.get $2 + local.get $3 f64.convert_i32_s f64.const 2.6666666666666665 f64.mul i32.trunc_f64_s - local.tee $7 + local.tee $6 i32.const 12 i32.mul - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $6 + local.set $3 local.get $0 i32.load offset=8 - i32.const 8 - i32.add - local.tee $2 + local.tee $4 local.get $0 i32.load offset=16 i32.const 12 i32.mul i32.add - local.set $8 - local.get $6 - i32.const 8 - i32.add - local.set $3 + local.set $7 + local.get $3 + local.set $2 loop $continue|0 - local.get $2 - local.get $8 + local.get $4 + local.get $7 i32.ne if - local.get $2 + local.get $4 i32.load offset=8 i32.const 1 i32.and i32.eqz if - local.get $3 local.get $2 + local.get $4 i32.load16_u i32.store16 - local.get $3 local.get $2 + local.get $4 i32.load offset=4 i32.store offset=4 - local.get $3 local.get $2 - i32.load16_u - local.tee $4 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul local.get $4 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul + i32.load16_u + call $~lib/util/hash/hash16 local.get $1 i32.and i32.const 2 i32.shl local.get $5 i32.add - local.tee $4 - i32.load offset=8 - i32.store offset=8 - local.get $4 - local.get $3 + local.tee $8 + i32.load i32.store offset=8 - local.get $3 + local.get $8 + local.get $2 + i32.store + local.get $2 i32.const 12 i32.add - local.set $3 + local.set $2 end - local.get $2 + local.get $4 i32.const 12 i32.add - local.set $2 + local.set $4 br $continue|0 end end local.get $0 + i32.load + local.tee $2 + local.get $5 + i32.ne + if + local.get $5 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release + end + local.get $0 local.get $5 i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $6 + i32.load offset=8 + local.tee $1 + local.get $3 + i32.ne + if + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 + local.get $3 i32.store offset=8 local.get $0 - local.get $7 + local.get $6 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 + local.get $5 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release ) - (func $~lib/map/Map#set (; 29 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#set (; 56 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + local.get $0 + local.get $1 local.get $1 i32.const 65535 i32.and - local.tee $3 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $3 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - local.tee $3 - local.set $4 - local.get $0 - local.get $1 - local.get $3 + call $~lib/util/hash/hash16 + local.tee $5 call $~lib/map/Map#find local.tee $3 if @@ -2713,20 +4161,19 @@ end local.get $0 i32.load offset=8 - local.set $3 + call $~lib/rt/pure/__retain + local.set $4 local.get $0 local.get $0 i32.load offset=16 - local.tee $5 + local.tee $3 i32.const 1 i32.add i32.store offset=16 local.get $3 - i32.const 8 - i32.add - local.get $5 i32.const 12 i32.mul + local.get $4 i32.add local.tee $3 local.get $1 @@ -2745,38 +4192,28 @@ i32.load local.get $0 i32.load offset=4 - local.get $4 + local.get $5 i32.and i32.const 2 i32.shl i32.add local.tee $0 - i32.load offset=8 + i32.load i32.store offset=8 local.get $0 local.get $3 - i32.store offset=8 + i32.store + local.get $4 + call $~lib/rt/pure/__release end ) - (func $~lib/map/Map#get (; 30 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#get (; 57 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 i32.const 65535 i32.and - local.tee $0 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $0 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash16 call $~lib/map/Map#find local.tee $0 if (result i32) @@ -2786,26 +4223,14 @@ unreachable end ) - (func $~lib/map/Map#delete (; 31 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#delete (; 58 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 local.get $1 local.get $1 i32.const 65535 i32.and - local.tee $1 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $1 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash16 call $~lib/map/Map#find local.tee $1 i32.eqz @@ -2840,8 +4265,7 @@ i32.gt_u select i32.ge_u - local.tee $1 - if + if (result i32) local.get $0 i32.load offset=20 local.get $0 @@ -2851,19 +4275,19 @@ f64.mul i32.trunc_f64_s i32.lt_s - local.set $1 + else + i32.const 0 end - local.get $1 if local.get $0 local.get $2 call $~lib/map/Map#rehash end ) - (func $std/map/test (; 32 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 59 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) - call $~lib/map/Map#constructor + call $~lib/map/Map#constructor local.set $1 loop $repeat|0 local.get $0 @@ -2875,10 +4299,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 8 + i32.const 376 + i32.const 6 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -2895,10 +4319,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 10 + i32.const 376 + i32.const 8 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -2912,10 +4336,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 11 + i32.const 376 + i32.const 9 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -2933,10 +4357,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 13 + i32.const 376 + i32.const 11 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -2952,10 +4376,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 17 + i32.const 376 + i32.const 15 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -2969,10 +4393,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 18 + i32.const 376 + i32.const 16 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -2989,10 +4413,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 20 + i32.const 376 + i32.const 18 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -3006,10 +4430,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 21 + i32.const 376 + i32.const 19 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -3027,10 +4451,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 23 + i32.const 376 + i32.const 21 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -3046,10 +4470,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 27 + i32.const 376 + i32.const 25 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -3063,10 +4487,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 28 + i32.const 376 + i32.const 26 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -3077,10 +4501,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 30 + i32.const 376 + i32.const 28 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -3098,10 +4522,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 32 + i32.const 376 + i32.const 30 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -3116,10 +4540,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 36 + i32.const 376 + i32.const 34 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -3136,10 +4560,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 38 + i32.const 376 + i32.const 36 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -3150,10 +4574,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 40 + i32.const 376 + i32.const 38 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -3171,26 +4595,56 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + call $~lib/map/Map#clear + local.get $1 + i32.load offset=20 + if + i32.const 0 + i32.const 376 + i32.const 44 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 + call $~lib/rt/pure/__release + ) + (func $~lib/map/Map#constructor (; 60 ;) (type $FUNCSIG$i) (result i32) + (local $0 i32) + i32.const 24 + i32.const 7 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 call $~lib/map/Map#clear - local.get $1 - i32.load offset=20 - if - i32.const 0 - i32.const 120 - i32.const 46 - i32.const 2 - call $~lib/env/abort - unreachable - end + local.get $0 ) - (func $~lib/internal/hash/hash32 (; 33 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/hash32 (; 61 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 255 i32.and @@ -3221,7 +4675,7 @@ i32.const 16777619 i32.mul ) - (func $~lib/map/Map#find (; 34 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 62 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.load local.get $0 @@ -3231,49 +4685,47 @@ i32.const 2 i32.shl i32.add - i32.load offset=8 - local.set $2 + i32.load + local.set $0 loop $continue|0 - local.get $2 + local.get $0 if - local.get $2 + local.get $0 i32.load offset=8 i32.const 1 i32.and - i32.eqz - local.tee $0 - if - local.get $2 + if (result i32) + i32.const 0 + else + local.get $0 i32.load local.get $1 i32.eq - local.set $0 end - local.get $0 if - local.get $2 + local.get $0 return end - local.get $2 + local.get $0 i32.load offset=8 i32.const -2 i32.and - local.set $2 + local.set $0 br $continue|0 end end i32.const 0 ) - (func $~lib/map/Map#has (; 35 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#has (; 63 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 - call $~lib/internal/hash/hash32 + call $~lib/util/hash/hash32 call $~lib/map/Map#find i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 36 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 64 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3284,13 +4736,12 @@ local.get $1 i32.const 1 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.shl - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 - local.get $2 + local.set $5 + local.get $3 f64.convert_i32_s f64.const 2.6666666666666665 f64.mul @@ -3298,79 +4749,98 @@ local.tee $6 i32.const 12 i32.mul - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 + local.set $3 local.get $0 i32.load offset=8 - i32.const 8 - i32.add - local.tee $2 + local.tee $4 local.get $0 i32.load offset=16 i32.const 12 i32.mul i32.add local.set $7 - local.get $5 - i32.const 8 - i32.add - local.set $3 + local.get $3 + local.set $2 loop $continue|0 - local.get $2 + local.get $4 local.get $7 i32.ne if - local.get $2 + local.get $4 i32.load offset=8 i32.const 1 i32.and i32.eqz if - local.get $3 local.get $2 + local.get $4 i32.load i32.store - local.get $3 local.get $2 + local.get $4 i32.load offset=4 i32.store offset=4 - local.get $3 local.get $2 + local.get $4 i32.load - call $~lib/internal/hash/hash32 + call $~lib/util/hash/hash32 local.get $1 i32.and i32.const 2 i32.shl - local.get $4 + local.get $5 i32.add local.tee $8 - i32.load offset=8 + i32.load i32.store offset=8 local.get $8 - local.get $3 - i32.store offset=8 - local.get $3 + local.get $2 + i32.store + local.get $2 i32.const 12 i32.add - local.set $3 + local.set $2 end - local.get $2 + local.get $4 i32.const 12 i32.add - local.set $2 + local.set $4 br $continue|0 end end local.get $0 - local.get $4 + i32.load + local.tee $2 + local.get $5 + i32.ne + if + local.get $5 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release + end + local.get $0 + local.get $5 i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $5 + i32.load offset=8 + local.tee $1 + local.get $3 + i32.ne + if + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 + local.get $3 i32.store offset=8 local.get $0 local.get $6 @@ -3379,16 +4849,20 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $5 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release ) - (func $~lib/map/Map#set (; 37 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#set (; 65 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) local.get $0 local.get $1 local.get $1 - call $~lib/internal/hash/hash32 - local.tee $4 + call $~lib/util/hash/hash32 + local.tee $5 call $~lib/map/Map#find local.tee $3 if @@ -3427,20 +4901,19 @@ end local.get $0 i32.load offset=8 - local.set $3 + call $~lib/rt/pure/__retain + local.set $4 local.get $0 local.get $0 i32.load offset=16 - local.tee $5 + local.tee $3 i32.const 1 i32.add i32.store offset=16 local.get $3 - i32.const 8 - i32.add - local.get $5 i32.const 12 i32.mul + local.get $4 i32.add local.tee $3 local.get $1 @@ -3459,24 +4932,26 @@ i32.load local.get $0 i32.load offset=4 - local.get $4 + local.get $5 i32.and i32.const 2 i32.shl i32.add local.tee $0 - i32.load offset=8 + i32.load i32.store offset=8 local.get $0 local.get $3 - i32.store offset=8 + i32.store + local.get $4 + call $~lib/rt/pure/__release end ) - (func $~lib/map/Map#get (; 38 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#get (; 66 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 - call $~lib/internal/hash/hash32 + call $~lib/util/hash/hash32 call $~lib/map/Map#find local.tee $0 if (result i32) @@ -3486,12 +4961,12 @@ unreachable end ) - (func $~lib/map/Map#delete (; 39 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#delete (; 67 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 local.get $1 local.get $1 - call $~lib/internal/hash/hash32 + call $~lib/util/hash/hash32 call $~lib/map/Map#find local.tee $1 i32.eqz @@ -3526,7 +5001,6 @@ i32.gt_u select i32.ge_u - local.tee $1 if (result i32) local.get $0 i32.load offset=20 @@ -3538,7 +5012,7 @@ i32.trunc_f64_s i32.lt_s else - local.get $1 + i32.const 0 end if local.get $0 @@ -3546,10 +5020,10 @@ call $~lib/map/Map#rehash end ) - (func $std/map/test (; 40 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 68 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) - call $~lib/map/Map#constructor + call $~lib/map/Map#constructor local.set $1 loop $repeat|0 local.get $0 @@ -3561,10 +5035,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 8 + i32.const 376 + i32.const 6 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -3579,10 +5053,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 10 + i32.const 376 + i32.const 8 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -3594,10 +5068,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 11 + i32.const 376 + i32.const 9 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -3615,10 +5089,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 13 + i32.const 376 + i32.const 11 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -3634,10 +5108,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 17 + i32.const 376 + i32.const 15 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -3649,10 +5123,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 18 + i32.const 376 + i32.const 16 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -3667,10 +5141,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 20 + i32.const 376 + i32.const 18 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -3682,10 +5156,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 21 + i32.const 376 + i32.const 19 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -3703,10 +5177,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 23 + i32.const 376 + i32.const 21 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -3722,10 +5196,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 27 + i32.const 376 + i32.const 25 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -3737,10 +5211,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 28 + i32.const 376 + i32.const 26 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -3751,10 +5225,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 30 + i32.const 376 + i32.const 28 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -3772,10 +5246,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 32 + i32.const 376 + i32.const 30 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -3790,10 +5264,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 36 + i32.const 376 + i32.const 34 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -3808,10 +5282,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 38 + i32.const 376 + i32.const 36 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -3822,10 +5296,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 40 + i32.const 376 + i32.const 38 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -3843,10 +5317,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -3855,17 +5329,47 @@ i32.load offset=20 if i32.const 0 - i32.const 120 - i32.const 46 + i32.const 376 + i32.const 44 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + ) + (func $~lib/map/Map#constructor (; 69 ;) (type $FUNCSIG$i) (result i32) + (local $0 i32) + i32.const 24 + i32.const 8 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 + call $~lib/map/Map#clear + local.get $0 ) - (func $std/map/test (; 41 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 70 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) - call $~lib/map/Map#constructor + call $~lib/map/Map#constructor local.set $1 loop $repeat|0 local.get $0 @@ -3877,10 +5381,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 8 + i32.const 376 + i32.const 6 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -3895,10 +5399,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 10 + i32.const 376 + i32.const 8 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -3910,10 +5414,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 11 + i32.const 376 + i32.const 9 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -3931,10 +5435,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 13 + i32.const 376 + i32.const 11 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -3950,10 +5454,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 17 + i32.const 376 + i32.const 15 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -3965,10 +5469,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 18 + i32.const 376 + i32.const 16 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -3983,10 +5487,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 20 + i32.const 376 + i32.const 18 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -3998,10 +5502,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 21 + i32.const 376 + i32.const 19 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -4019,10 +5523,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 23 + i32.const 376 + i32.const 21 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -4038,10 +5542,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 27 + i32.const 376 + i32.const 25 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -4053,10 +5557,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 28 + i32.const 376 + i32.const 26 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -4067,10 +5571,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 30 + i32.const 376 + i32.const 28 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -4088,10 +5592,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 32 + i32.const 376 + i32.const 30 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -4106,10 +5610,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 36 + i32.const 376 + i32.const 34 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -4124,10 +5628,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 38 + i32.const 376 + i32.const 36 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -4138,10 +5642,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 40 + i32.const 376 + i32.const 38 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -4159,10 +5663,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -4171,26 +5675,37 @@ i32.load offset=20 if i32.const 0 - i32.const 120 - i32.const 46 + i32.const 376 + i32.const 44 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release ) - (func $~lib/map/Map#clear (; 42 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 + (func $~lib/map/Map#clear (; 71 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) i32.const 16 - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 + local.get $0 + i32.load + call $~lib/rt/pure/__release + local.get $0 + local.get $1 i32.store local.get $0 i32.const 3 i32.store offset=4 - local.get $0 i32.const 64 - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 + local.get $0 + i32.load offset=8 + call $~lib/rt/pure/__release + local.get $0 + local.get $1 i32.store offset=8 local.get $0 i32.const 4 @@ -4202,10 +5717,12 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 43 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/map/Map#constructor (; 72 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 - call $~lib/allocator/arena/__memory_allocate + i32.const 9 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.store @@ -4228,7 +5745,7 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/internal/hash/hash64 (; 44 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/hash/hash64 (; 73 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) local.get $0 i32.wrap_i64 @@ -4294,7 +5811,7 @@ i32.const 16777619 i32.mul ) - (func $~lib/map/Map#find (; 45 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 74 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) local.get $0 i32.load local.get $0 @@ -4304,49 +5821,47 @@ i32.const 2 i32.shl i32.add - i32.load offset=8 - local.set $2 + i32.load + local.set $0 loop $continue|0 - local.get $2 + local.get $0 if - local.get $2 + local.get $0 i32.load offset=12 i32.const 1 i32.and - i32.eqz - local.tee $0 - if - local.get $2 + if (result i32) + i32.const 0 + else + local.get $0 i64.load local.get $1 i64.eq - local.set $0 end - local.get $0 if - local.get $2 + local.get $0 return end - local.get $2 + local.get $0 i32.load offset=12 i32.const -2 i32.and - local.set $2 + local.set $0 br $continue|0 end end i32.const 0 ) - (func $~lib/map/Map#has (; 46 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/map/Map#has (; 75 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) local.get $0 local.get $1 local.get $1 - call $~lib/internal/hash/hash64 + call $~lib/util/hash/hash64 call $~lib/map/Map#find i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 47 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 76 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -4357,13 +5872,12 @@ local.get $1 i32.const 1 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.shl - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 - local.get $2 + local.set $5 + local.get $3 f64.convert_i32_s f64.const 2.6666666666666665 f64.mul @@ -4371,79 +5885,98 @@ local.tee $6 i32.const 4 i32.shl - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 + local.set $3 local.get $0 i32.load offset=8 - i32.const 8 - i32.add - local.tee $2 + local.tee $4 local.get $0 i32.load offset=16 i32.const 4 i32.shl i32.add local.set $7 - local.get $5 - i32.const 8 - i32.add - local.set $3 + local.get $3 + local.set $2 loop $continue|0 - local.get $2 + local.get $4 local.get $7 i32.ne if - local.get $2 + local.get $4 i32.load offset=12 i32.const 1 i32.and i32.eqz if - local.get $3 local.get $2 + local.get $4 i64.load i64.store - local.get $3 local.get $2 + local.get $4 i32.load offset=8 i32.store offset=8 - local.get $3 local.get $2 + local.get $4 i64.load - call $~lib/internal/hash/hash64 + call $~lib/util/hash/hash64 local.get $1 i32.and i32.const 2 i32.shl - local.get $4 + local.get $5 i32.add local.tee $8 - i32.load offset=8 + i32.load i32.store offset=12 local.get $8 - local.get $3 - i32.store offset=8 - local.get $3 + local.get $2 + i32.store + local.get $2 i32.const 16 i32.add - local.set $3 + local.set $2 end - local.get $2 + local.get $4 i32.const 16 i32.add - local.set $2 + local.set $4 br $continue|0 end end local.get $0 - local.get $4 + i32.load + local.tee $2 + local.get $5 + i32.ne + if + local.get $5 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release + end + local.get $0 + local.get $5 i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $5 + i32.load offset=8 + local.tee $1 + local.get $3 + i32.ne + if + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 + local.get $3 i32.store offset=8 local.get $0 local.get $6 @@ -4452,16 +5985,20 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $5 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release ) - (func $~lib/map/Map#set (; 48 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) + (func $~lib/map/Map#set (; 77 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) local.get $0 local.get $1 local.get $1 - call $~lib/internal/hash/hash64 - local.tee $4 + call $~lib/util/hash/hash64 + local.tee $5 call $~lib/map/Map#find local.tee $3 if @@ -4500,20 +6037,19 @@ end local.get $0 i32.load offset=8 - local.set $3 + call $~lib/rt/pure/__retain + local.set $4 local.get $0 local.get $0 i32.load offset=16 - local.tee $5 + local.tee $3 i32.const 1 i32.add i32.store offset=16 local.get $3 - i32.const 8 - i32.add - local.get $5 i32.const 4 i32.shl + local.get $4 i32.add local.tee $3 local.get $1 @@ -4532,24 +6068,26 @@ i32.load local.get $0 i32.load offset=4 - local.get $4 + local.get $5 i32.and i32.const 2 i32.shl i32.add local.tee $0 - i32.load offset=8 + i32.load i32.store offset=12 local.get $0 local.get $3 - i32.store offset=8 + i32.store + local.get $4 + call $~lib/rt/pure/__release end ) - (func $~lib/map/Map#get (; 49 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/map/Map#get (; 78 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) local.get $0 local.get $1 local.get $1 - call $~lib/internal/hash/hash64 + call $~lib/util/hash/hash64 call $~lib/map/Map#find local.tee $0 if (result i32) @@ -4559,13 +6097,13 @@ unreachable end ) - (func $~lib/map/Map#delete (; 50 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64) + (func $~lib/map/Map#delete (; 79 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64) (local $2 i32) (local $3 i32) local.get $0 local.get $1 local.get $1 - call $~lib/internal/hash/hash64 + call $~lib/util/hash/hash64 call $~lib/map/Map#find local.tee $2 i32.eqz @@ -4600,7 +6138,6 @@ i32.gt_u select i32.ge_u - local.tee $2 if (result i32) local.get $0 i32.load offset=20 @@ -4612,7 +6149,7 @@ i32.trunc_f64_s i32.lt_s else - local.get $2 + i32.const 0 end if local.get $0 @@ -4620,7 +6157,7 @@ call $~lib/map/Map#rehash end ) - (func $std/map/test (; 51 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 80 ;) (type $FUNCSIG$v) (local $0 i64) (local $1 i32) call $~lib/map/Map#constructor @@ -4635,10 +6172,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 8 + i32.const 376 + i32.const 6 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -4654,10 +6191,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 10 + i32.const 376 + i32.const 8 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -4670,10 +6207,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 11 + i32.const 376 + i32.const 9 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -4691,10 +6228,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 13 + i32.const 376 + i32.const 11 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 0 @@ -4710,10 +6247,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 17 + i32.const 376 + i32.const 15 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -4726,10 +6263,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 18 + i32.const 376 + i32.const 16 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -4745,10 +6282,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 20 + i32.const 376 + i32.const 18 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -4761,10 +6298,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 21 + i32.const 376 + i32.const 19 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -4782,10 +6319,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 23 + i32.const 376 + i32.const 21 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 0 @@ -4801,10 +6338,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 27 + i32.const 376 + i32.const 25 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -4817,10 +6354,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 28 + i32.const 376 + i32.const 26 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -4831,10 +6368,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 30 + i32.const 376 + i32.const 28 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -4852,10 +6389,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 32 + i32.const 376 + i32.const 30 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 0 @@ -4870,10 +6407,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 36 + i32.const 376 + i32.const 34 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -4889,10 +6426,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 38 + i32.const 376 + i32.const 36 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -4903,10 +6440,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 40 + i32.const 376 + i32.const 38 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -4924,10 +6461,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -4936,17 +6473,47 @@ i32.load offset=20 if i32.const 0 - i32.const 120 - i32.const 46 + i32.const 376 + i32.const 44 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/map/test (; 52 ;) (type $FUNCSIG$v) + (func $~lib/map/Map#constructor (; 81 ;) (type $FUNCSIG$i) (result i32) + (local $0 i32) + i32.const 24 + i32.const 10 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 + call $~lib/map/Map#clear + local.get $0 + ) + (func $std/map/testNumeric (; 82 ;) (type $FUNCSIG$v) (local $0 i64) (local $1 i32) - call $~lib/map/Map#constructor + call $~lib/map/Map#constructor local.set $1 loop $repeat|0 local.get $0 @@ -4958,10 +6525,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 8 + i32.const 376 + i32.const 6 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -4977,10 +6544,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 10 + i32.const 376 + i32.const 8 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -4993,10 +6560,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 11 + i32.const 376 + i32.const 9 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -5014,10 +6581,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 13 + i32.const 376 + i32.const 11 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 0 @@ -5033,10 +6600,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 17 + i32.const 376 + i32.const 15 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -5049,10 +6616,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 18 + i32.const 376 + i32.const 16 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -5068,10 +6635,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 20 + i32.const 376 + i32.const 18 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -5084,10 +6651,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 21 + i32.const 376 + i32.const 19 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -5105,10 +6672,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 23 + i32.const 376 + i32.const 21 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 0 @@ -5124,10 +6691,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 27 + i32.const 376 + i32.const 25 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -5140,10 +6707,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 28 + i32.const 376 + i32.const 26 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -5154,10 +6721,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 30 + i32.const 376 + i32.const 28 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -5175,10 +6742,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 32 + i32.const 376 + i32.const 30 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 0 @@ -5193,10 +6760,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 36 + i32.const 376 + i32.const 34 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -5212,10 +6779,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 38 + i32.const 376 + i32.const 36 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -5226,10 +6793,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 40 + i32.const 376 + i32.const 38 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -5247,10 +6814,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -5259,14 +6826,44 @@ i32.load offset=20 if i32.const 0 - i32.const 120 - i32.const 46 + i32.const 376 + i32.const 44 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + ) + (func $~lib/map/Map#constructor (; 83 ;) (type $FUNCSIG$i) (result i32) + (local $0 i32) + i32.const 24 + i32.const 11 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 + call $~lib/map/Map#clear + local.get $0 ) - (func $~lib/map/Map#find (; 53 ;) (type $FUNCSIG$iifi) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 84 ;) (type $FUNCSIG$iifi) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) local.get $0 i32.load local.get $0 @@ -5276,50 +6873,48 @@ i32.const 2 i32.shl i32.add - i32.load offset=8 - local.set $2 + i32.load + local.set $0 loop $continue|0 - local.get $2 + local.get $0 if - local.get $2 + local.get $0 i32.load offset=8 i32.const 1 i32.and - i32.eqz - local.tee $0 - if - local.get $2 + if (result i32) + i32.const 0 + else + local.get $0 f32.load local.get $1 f32.eq - local.set $0 end - local.get $0 if - local.get $2 + local.get $0 return end - local.get $2 + local.get $0 i32.load offset=8 i32.const -2 i32.and - local.set $2 + local.set $0 br $continue|0 end end i32.const 0 ) - (func $~lib/map/Map#has (; 54 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) + (func $~lib/map/Map#has (; 85 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) local.get $0 local.get $1 local.get $1 i32.reinterpret_f32 - call $~lib/internal/hash/hash32 + call $~lib/util/hash/hash32 call $~lib/map/Map#find i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 55 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 86 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -5330,13 +6925,12 @@ local.get $1 i32.const 1 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.shl - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 - local.get $2 + local.set $5 + local.get $3 f64.convert_i32_s f64.const 2.6666666666666665 f64.mul @@ -5344,80 +6938,99 @@ local.tee $6 i32.const 12 i32.mul - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 + local.set $3 local.get $0 i32.load offset=8 - i32.const 8 - i32.add - local.tee $2 + local.tee $4 local.get $0 i32.load offset=16 i32.const 12 i32.mul i32.add local.set $7 - local.get $5 - i32.const 8 - i32.add - local.set $3 + local.get $3 + local.set $2 loop $continue|0 - local.get $2 + local.get $4 local.get $7 i32.ne if - local.get $2 + local.get $4 i32.load offset=8 i32.const 1 i32.and i32.eqz if - local.get $3 local.get $2 + local.get $4 f32.load f32.store - local.get $3 local.get $2 + local.get $4 i32.load offset=4 i32.store offset=4 - local.get $3 local.get $2 + local.get $4 f32.load i32.reinterpret_f32 - call $~lib/internal/hash/hash32 + call $~lib/util/hash/hash32 local.get $1 i32.and i32.const 2 i32.shl - local.get $4 + local.get $5 i32.add local.tee $8 - i32.load offset=8 + i32.load i32.store offset=8 local.get $8 - local.get $3 - i32.store offset=8 - local.get $3 + local.get $2 + i32.store + local.get $2 i32.const 12 i32.add - local.set $3 + local.set $2 end - local.get $2 + local.get $4 i32.const 12 i32.add - local.set $2 + local.set $4 br $continue|0 end end local.get $0 - local.get $4 + i32.load + local.tee $2 + local.get $5 + i32.ne + if + local.get $5 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release + end + local.get $0 + local.get $5 i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $5 + i32.load offset=8 + local.tee $1 + local.get $3 + i32.ne + if + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 + local.get $3 i32.store offset=8 local.get $0 local.get $6 @@ -5426,8 +7039,12 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $5 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release ) - (func $~lib/map/Map#set (; 56 ;) (type $FUNCSIG$vifi) (param $0 i32) (param $1 f32) (param $2 i32) + (func $~lib/map/Map#set (; 87 ;) (type $FUNCSIG$vifi) (param $0 i32) (param $1 f32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -5435,8 +7052,8 @@ local.get $1 local.get $1 i32.reinterpret_f32 - call $~lib/internal/hash/hash32 - local.tee $4 + call $~lib/util/hash/hash32 + local.tee $5 call $~lib/map/Map#find local.tee $3 if @@ -5475,20 +7092,19 @@ end local.get $0 i32.load offset=8 - local.set $3 + call $~lib/rt/pure/__retain + local.set $4 local.get $0 local.get $0 i32.load offset=16 - local.tee $5 + local.tee $3 i32.const 1 i32.add i32.store offset=16 local.get $3 - i32.const 8 - i32.add - local.get $5 i32.const 12 i32.mul + local.get $4 i32.add local.tee $3 local.get $1 @@ -5507,25 +7123,27 @@ i32.load local.get $0 i32.load offset=4 - local.get $4 + local.get $5 i32.and i32.const 2 i32.shl i32.add local.tee $0 - i32.load offset=8 + i32.load i32.store offset=8 local.get $0 local.get $3 - i32.store offset=8 + i32.store + local.get $4 + call $~lib/rt/pure/__release end ) - (func $~lib/map/Map#get (; 57 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) + (func $~lib/map/Map#get (; 88 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) local.get $0 local.get $1 local.get $1 i32.reinterpret_f32 - call $~lib/internal/hash/hash32 + call $~lib/util/hash/hash32 call $~lib/map/Map#find local.tee $0 if (result i32) @@ -5535,14 +7153,14 @@ unreachable end ) - (func $~lib/map/Map#delete (; 58 ;) (type $FUNCSIG$vif) (param $0 i32) (param $1 f32) + (func $~lib/map/Map#delete (; 89 ;) (type $FUNCSIG$vif) (param $0 i32) (param $1 f32) (local $2 i32) (local $3 i32) local.get $0 local.get $1 local.get $1 i32.reinterpret_f32 - call $~lib/internal/hash/hash32 + call $~lib/util/hash/hash32 call $~lib/map/Map#find local.tee $2 i32.eqz @@ -5577,7 +7195,6 @@ i32.gt_u select i32.ge_u - local.tee $2 if (result i32) local.get $0 i32.load offset=20 @@ -5589,7 +7206,7 @@ i32.trunc_f64_s i32.lt_s else - local.get $2 + i32.const 0 end if local.get $0 @@ -5597,10 +7214,10 @@ call $~lib/map/Map#rehash end ) - (func $std/map/test (; 59 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 90 ;) (type $FUNCSIG$v) (local $0 f32) (local $1 i32) - call $~lib/map/Map#constructor + call $~lib/map/Map#constructor local.set $1 loop $repeat|0 local.get $0 @@ -5612,10 +7229,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 8 + i32.const 376 + i32.const 6 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -5631,10 +7248,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 10 + i32.const 376 + i32.const 8 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -5647,10 +7264,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 11 + i32.const 376 + i32.const 9 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -5668,10 +7285,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 13 + i32.const 376 + i32.const 11 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -5687,10 +7304,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 17 + i32.const 376 + i32.const 15 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -5703,10 +7320,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 18 + i32.const 376 + i32.const 16 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -5722,10 +7339,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 20 + i32.const 376 + i32.const 18 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -5738,10 +7355,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 21 + i32.const 376 + i32.const 19 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -5759,10 +7376,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 23 + i32.const 376 + i32.const 21 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -5778,10 +7395,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 27 + i32.const 376 + i32.const 25 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -5794,10 +7411,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 28 + i32.const 376 + i32.const 26 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -5808,10 +7425,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 30 + i32.const 376 + i32.const 28 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -5829,10 +7446,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 32 + i32.const 376 + i32.const 30 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -5847,10 +7464,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 36 + i32.const 376 + i32.const 34 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -5866,10 +7483,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 38 + i32.const 376 + i32.const 36 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -5880,10 +7497,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 40 + i32.const 376 + i32.const 38 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -5901,10 +7518,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -5913,14 +7530,44 @@ i32.load offset=20 if i32.const 0 - i32.const 120 - i32.const 46 + i32.const 376 + i32.const 44 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + ) + (func $~lib/map/Map#constructor (; 91 ;) (type $FUNCSIG$i) (result i32) + (local $0 i32) + i32.const 24 + i32.const 12 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 + call $~lib/map/Map#clear + local.get $0 ) - (func $~lib/map/Map#find (; 60 ;) (type $FUNCSIG$iidi) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 92 ;) (type $FUNCSIG$iidi) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) local.get $0 i32.load local.get $0 @@ -5930,50 +7577,48 @@ i32.const 2 i32.shl i32.add - i32.load offset=8 - local.set $2 + i32.load + local.set $0 loop $continue|0 - local.get $2 + local.get $0 if - local.get $2 + local.get $0 i32.load offset=12 i32.const 1 i32.and - i32.eqz - local.tee $0 - if - local.get $2 + if (result i32) + i32.const 0 + else + local.get $0 f64.load local.get $1 f64.eq - local.set $0 end - local.get $0 if - local.get $2 + local.get $0 return end - local.get $2 + local.get $0 i32.load offset=12 i32.const -2 i32.and - local.set $2 + local.set $0 br $continue|0 end end i32.const 0 ) - (func $~lib/map/Map#has (; 61 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/map/Map#has (; 93 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) local.get $0 local.get $1 local.get $1 i64.reinterpret_f64 - call $~lib/internal/hash/hash64 + call $~lib/util/hash/hash64 call $~lib/map/Map#find i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 62 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 94 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -5984,13 +7629,12 @@ local.get $1 i32.const 1 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.shl - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 - local.get $2 + local.set $5 + local.get $3 f64.convert_i32_s f64.const 2.6666666666666665 f64.mul @@ -5998,80 +7642,99 @@ local.tee $6 i32.const 4 i32.shl - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 + local.set $3 local.get $0 i32.load offset=8 - i32.const 8 - i32.add - local.tee $2 + local.tee $4 local.get $0 i32.load offset=16 i32.const 4 i32.shl i32.add local.set $7 - local.get $5 - i32.const 8 - i32.add - local.set $3 + local.get $3 + local.set $2 loop $continue|0 - local.get $2 + local.get $4 local.get $7 i32.ne if - local.get $2 + local.get $4 i32.load offset=12 i32.const 1 i32.and i32.eqz if - local.get $3 local.get $2 + local.get $4 f64.load f64.store - local.get $3 local.get $2 + local.get $4 i32.load offset=8 i32.store offset=8 - local.get $3 local.get $2 + local.get $4 f64.load i64.reinterpret_f64 - call $~lib/internal/hash/hash64 + call $~lib/util/hash/hash64 local.get $1 i32.and i32.const 2 i32.shl - local.get $4 + local.get $5 i32.add local.tee $8 - i32.load offset=8 + i32.load i32.store offset=12 local.get $8 - local.get $3 - i32.store offset=8 - local.get $3 + local.get $2 + i32.store + local.get $2 i32.const 16 i32.add - local.set $3 + local.set $2 end - local.get $2 + local.get $4 i32.const 16 i32.add - local.set $2 + local.set $4 br $continue|0 end end local.get $0 - local.get $4 + i32.load + local.tee $2 + local.get $5 + i32.ne + if + local.get $5 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release + end + local.get $0 + local.get $5 i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $5 + i32.load offset=8 + local.tee $1 + local.get $3 + i32.ne + if + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 + local.get $3 i32.store offset=8 local.get $0 local.get $6 @@ -6080,8 +7743,12 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $5 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release ) - (func $~lib/map/Map#set (; 63 ;) (type $FUNCSIG$vidi) (param $0 i32) (param $1 f64) (param $2 i32) + (func $~lib/map/Map#set (; 95 ;) (type $FUNCSIG$vidi) (param $0 i32) (param $1 f64) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -6089,8 +7756,8 @@ local.get $1 local.get $1 i64.reinterpret_f64 - call $~lib/internal/hash/hash64 - local.tee $4 + call $~lib/util/hash/hash64 + local.tee $5 call $~lib/map/Map#find local.tee $3 if @@ -6129,20 +7796,19 @@ end local.get $0 i32.load offset=8 - local.set $3 + call $~lib/rt/pure/__retain + local.set $4 local.get $0 local.get $0 i32.load offset=16 - local.tee $5 + local.tee $3 i32.const 1 i32.add i32.store offset=16 local.get $3 - i32.const 8 - i32.add - local.get $5 i32.const 4 i32.shl + local.get $4 i32.add local.tee $3 local.get $1 @@ -6161,25 +7827,27 @@ i32.load local.get $0 i32.load offset=4 - local.get $4 + local.get $5 i32.and i32.const 2 i32.shl i32.add local.tee $0 - i32.load offset=8 + i32.load i32.store offset=12 local.get $0 local.get $3 - i32.store offset=8 + i32.store + local.get $4 + call $~lib/rt/pure/__release end ) - (func $~lib/map/Map#get (; 64 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/map/Map#get (; 96 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) local.get $0 local.get $1 local.get $1 i64.reinterpret_f64 - call $~lib/internal/hash/hash64 + call $~lib/util/hash/hash64 call $~lib/map/Map#find local.tee $0 if (result i32) @@ -6189,14 +7857,14 @@ unreachable end ) - (func $~lib/map/Map#delete (; 65 ;) (type $FUNCSIG$vid) (param $0 i32) (param $1 f64) + (func $~lib/map/Map#delete (; 97 ;) (type $FUNCSIG$vid) (param $0 i32) (param $1 f64) (local $2 i32) (local $3 i32) local.get $0 local.get $1 local.get $1 i64.reinterpret_f64 - call $~lib/internal/hash/hash64 + call $~lib/util/hash/hash64 call $~lib/map/Map#find local.tee $2 i32.eqz @@ -6231,7 +7899,6 @@ i32.gt_u select i32.ge_u - local.tee $2 if (result i32) local.get $0 i32.load offset=20 @@ -6243,7 +7910,7 @@ i32.trunc_f64_s i32.lt_s else - local.get $2 + i32.const 0 end if local.get $0 @@ -6251,10 +7918,10 @@ call $~lib/map/Map#rehash end ) - (func $std/map/test (; 66 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 98 ;) (type $FUNCSIG$v) (local $0 f64) (local $1 i32) - call $~lib/map/Map#constructor + call $~lib/map/Map#constructor local.set $1 loop $repeat|0 local.get $0 @@ -6266,10 +7933,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 8 + i32.const 376 + i32.const 6 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -6285,10 +7952,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 10 + i32.const 376 + i32.const 8 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -6301,10 +7968,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 11 + i32.const 376 + i32.const 9 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -6322,10 +7989,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 13 + i32.const 376 + i32.const 11 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -6341,10 +8008,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 17 + i32.const 376 + i32.const 15 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -6357,10 +8024,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 18 + i32.const 376 + i32.const 16 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -6376,10 +8043,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 20 + i32.const 376 + i32.const 18 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -6392,10 +8059,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 21 + i32.const 376 + i32.const 19 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -6413,10 +8080,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 23 + i32.const 376 + i32.const 21 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -6432,10 +8099,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 27 + i32.const 376 + i32.const 25 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -6448,10 +8115,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 28 + i32.const 376 + i32.const 26 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -6462,10 +8129,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 30 + i32.const 376 + i32.const 28 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -6483,10 +8150,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 32 + i32.const 376 + i32.const 30 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -6501,10 +8168,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 36 + i32.const 376 + i32.const 34 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -6520,10 +8187,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 38 + i32.const 376 + i32.const 36 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -6534,10 +8201,10 @@ call $~lib/map/Map#has if i32.const 0 - i32.const 120 - i32.const 40 + i32.const 376 + i32.const 38 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -6555,10 +8222,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -6567,30 +8234,276 @@ i32.load offset=20 if i32.const 0 - i32.const 120 - i32.const 46 + i32.const 376 + i32.const 44 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + call $~lib/rt/pure/__release + ) + (func $start (; 99 ;) (type $FUNCSIG$v) + call $std/map/testNumeric + call $std/map/testNumeric + call $std/map/testNumeric + call $std/map/testNumeric + call $std/map/testNumeric + call $std/map/testNumeric + call $std/map/testNumeric + call $std/map/testNumeric + call $std/map/testNumeric + call $std/map/testNumeric + ) + (func $~lib/rt/pure/markGray (; 100 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add i32.const 2 - call $~lib/env/abort + call $~lib/rt/__visit_members + end + ) + (func $~lib/rt/pure/scanBlack (; 101 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 102 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (; 103 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + ) + (func $~lib/rt/pure/__visit (; 104 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + local.get $0 + i32.const 508 + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $0 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + local.get $1 + i32.const 1 + i32.ne + if + local.get $1 + i32.const 2 + i32.eq + br_if $case1|0 + block $tablify|0 + local.get $1 + i32.const 3 + i32.sub + br_table $case2|0 $case3|0 $case4|0 $tablify|0 + end + br $case5|0 + end + local.get $0 + call $~lib/rt/pure/decrement + br $break|0 + end + local.get $0 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 128 + i32.const 75 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $0 + call $~lib/rt/pure/markGray + br $break|0 + end + local.get $0 + call $~lib/rt/pure/scan + br $break|0 + end + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const -268435456 + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne + if + i32.const 0 + i32.const 128 + i32.const 86 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $1 + i32.const 1879048192 + i32.and + if + local.get $0 + call $~lib/rt/pure/scanBlack + end + br $break|0 + end + local.get $0 + call $~lib/rt/pure/collectWhite + br $break|0 + end + i32.const 0 + i32.const 128 + i32.const 97 + i32.const 24 + call $~lib/builtins/abort unreachable end ) - (func $start (; 67 ;) (type $FUNCSIG$v) - i32.const 144 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - call $std/map/test - call $std/map/test - call $std/map/test - call $std/map/test - call $std/map/test - call $std/map/test - call $std/map/test - call $std/map/test - call $std/map/test - call $std/map/test + (func $~lib/rt/__visit_members (; 105 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + block $folding-inner0 + block $switch$1$default + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $folding-inner0 $folding-inner0 $folding-inner0 $folding-inner0 $folding-inner0 $folding-inner0 $folding-inner0 $folding-inner0 $folding-inner0 $folding-inner0 $switch$1$default + end + return + end + local.get $0 + i32.load + local.tee $0 + if + local.get $0 + local.get $1 + call $~lib/rt/pure/__visit + end + return + end + unreachable + end + local.get $0 + i32.load + local.get $1 + call $~lib/rt/pure/__visit + local.get $0 + i32.load offset=8 + local.get $1 + call $~lib/rt/pure/__visit ) - (func $null (; 68 ;) (type $FUNCSIG$v) + (func $null (; 106 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/map.ts b/tests/compiler/std/map.ts index 4fc1487360..e52698755e 100644 --- a/tests/compiler/std/map.ts +++ b/tests/compiler/std/map.ts @@ -1,6 +1,4 @@ -import "allocator/arena"; - -function test(): void { +function testNumeric(): void { var map = new Map(); // insert new @@ -46,13 +44,13 @@ function test(): void { assert(map.size == 0); } -test(); -test(); -test(); -test(); -test(); -test(); -test(); -test(); -test(); -test(); +testNumeric(); +testNumeric(); +testNumeric(); +testNumeric(); +testNumeric(); +testNumeric(); +testNumeric(); +testNumeric(); +testNumeric(); +testNumeric(); diff --git a/tests/compiler/std/map.untouched.wat b/tests/compiler/std/map.untouched.wat index b9cf6436ec..aa051bb855 100644 --- a/tests/compiler/std/map.untouched.wat +++ b/tests/compiler/std/map.untouched.wat @@ -1,12 +1,12 @@ (module (type $FUNCSIG$v (func)) (type $FUNCSIG$ii (func (param i32) (result i32))) - (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) - (type $FUNCSIG$viii (func (param i32 i32 i32))) - (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$iij (func (param i32 i64) (result i32))) (type $FUNCSIG$ij (func (param i64) (result i32))) (type $FUNCSIG$iiji (func (param i32 i64 i32) (result i32))) @@ -17,455 +17,3444 @@ (type $FUNCSIG$iid (func (param i32 f64) (result i32))) (type $FUNCSIG$iidi (func (param i32 f64 i32) (result i32))) (type $FUNCSIG$vidi (func (param i32 f64 i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32))) + (import "rtrace" "onincrement" (func $~lib/rt/rtrace/onincrement (param i32))) + (import "rtrace" "ondecrement" (func $~lib/rt/rtrace/ondecrement (param i32))) + (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) (memory $0 1) - (data (i32.const 8) "\13\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") - (data (i32.const 56) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") - (data (i32.const 120) "\n\00\00\00s\00t\00d\00/\00m\00a\00p\00.\00t\00s\00") + (data (i32.const 8) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 56) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 112) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s\00") + (data (i32.const 160) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h\00") + (data (i32.const 208) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") + (data (i32.const 264) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 320) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s\00") + (data (i32.const 360) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00s\00t\00d\00/\00m\00a\00p\00.\00t\00s\00") + (data (i32.const 400) "\0d\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\98D\08\00\00\00\00\00\98D\00\00\00\00\00\00\98\84\08\00\00\00\00\00\98\84\00\00\00\00\00\00\98\04\t\00\00\00\00\00\98\04\01\00\00\00\00\00\98\04\n\00\00\00\00\00\98\04\02\00\00\00\00\00\98\04\19\00\00\00\00\00\98\04\1a\00\00\00\00\00") (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 144)) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) + (global $~lib/rt/__rtti_base i32 (i32.const 400)) + (global $~lib/heap/__heap_base i32 (i32.const 508)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) - (func $start:~lib/allocator/arena (; 1 ;) (type $FUNCSIG$v) - global.get $~lib/memory/HEAP_BASE - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - ) - (func $~lib/allocator/arena/__memory_allocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/rt/tlsf/removeBlock (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - local.get $0 - i32.const 1073741824 - i32.gt_u + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz if + i32.const 0 + i32.const 24 + i32.const 276 + i32.const 13 + call $~lib/builtins/abort unreachable end - global.get $~lib/allocator/arena/offset - local.set $1 - local.get $1 - local.get $0 - local.tee $2 - i32.const 1 - local.tee $3 local.get $2 - local.get $3 - i32.gt_u - select - i32.add - i32.const 7 - i32.add - i32.const 7 + i32.const 3 i32.const -1 i32.xor i32.and - local.set $4 - current_memory - local.set $5 - local.get $4 - local.get $5 + local.set $3 + local.get $3 i32.const 16 - i32.shl - i32.gt_u + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz if + i32.const 0 + i32.const 24 + i32.const 278 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 local.get $4 - local.get $1 + i32.const 4 i32.sub - i32.const 65535 - i32.add - i32.const 65535 - i32.const -1 - i32.xor - i32.and - i32.const 16 i32.shr_u - local.set $2 + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) local.get $5 - local.tee $3 - local.get $2 - local.tee $6 - local.get $3 - local.get $6 - i32.gt_s - select - local.set $3 - local.get $3 - grow_memory + i32.const 16 + i32.lt_u + else i32.const 0 - i32.lt_s - if - local.get $2 - grow_memory - i32.const 0 - i32.lt_s - if - unreachable - end - end end - local.get $4 - global.set $~lib/allocator/arena/offset - local.get $1 - ) - (func $~lib/memory/memory.allocate (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - call $~lib/allocator/arena/__memory_allocate - return - ) - (func $~lib/internal/arraybuffer/computeSize (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 1 - i32.const 32 - local.get $0 - i32.const 8 - i32.add - i32.const 1 - i32.sub - i32.clz - i32.sub - i32.shl - ) - (func $~lib/internal/arraybuffer/allocateUnsafe (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - local.get $0 - i32.const 1073741816 - i32.le_u i32.eqz if i32.const 0 - i32.const 56 - i32.const 26 - i32.const 2 - call $~lib/env/abort + i32.const 24 + i32.const 291 + i32.const 13 + call $~lib/builtins/abort unreachable end - block $~lib/memory/memory.allocate|inlined.0 (result i32) - local.get $0 - call $~lib/internal/arraybuffer/computeSize - local.set $2 - local.get $2 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.0 - end - local.set $1 local.get $1 - local.get $0 - i32.store + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $9 + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $8 + local.get $4 + local.set $11 + local.get $9 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $9 + local.set $10 + local.get $8 + local.get $11 + i32.const 2 + i32.shl + i32.add + local.get $10 + i32.store offset=4 + end + local.get $9 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end ) - (func $~lib/internal/memory/memset (; 6 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/insertBlock (; 6 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i64) - local.get $2 + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 i32.eqz if - return + i32.const 0 + i32.const 24 + i32.const 204 + i32.const 13 + call $~lib/builtins/abort + unreachable end - local.get $0 local.get $1 - i32.store8 - local.get $0 + i32.load + local.set $2 local.get $2 - i32.add i32.const 1 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 2 - i32.le_u + i32.and + i32.eqz if - return + i32.const 0 + i32.const 24 + i32.const 206 + i32.const 13 + call $~lib/builtins/abort + unreachable end - local.get $0 + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 i32.const 1 - i32.add - local.get $1 - i32.store8 - local.get $0 - i32.const 2 - i32.add - local.get $1 - i32.store8 - local.get $0 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end local.get $2 - i32.add i32.const 2 - i32.sub - local.get $1 - i32.store8 - local.get $0 + i32.and + if + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 4 + i32.sub + i32.load + end + local.set $6 + local.get $6 + i32.load + local.set $3 + local.get $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 227 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $6 + call $~lib/rt/tlsf/removeBlock + local.get $6 + local.get $3 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $6 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store local.get $2 - i32.add i32.const 3 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 6 - i32.le_u + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz if - return + i32.const 0 + i32.const 24 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable end - local.get $0 - i32.const 3 - i32.add local.get $1 - i32.store8 - local.get $0 - local.get $2 + i32.const 16 + i32.add + local.get $8 i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 243 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 i32.const 4 i32.sub local.get $1 - i32.store8 - local.get $2 - i32.const 8 - i32.le_u + i32.store + local.get $8 + i32.const 256 + i32.lt_u if - return + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 259 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $7 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $7 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 end + local.set $11 + local.get $1 i32.const 0 - local.get $0 - i32.sub - i32.const 3 - i32.and - local.set $3 - local.get $0 - local.get $3 - i32.add - local.set $0 - local.get $2 - local.get $3 - i32.sub - local.set $2 - local.get $2 - i32.const -4 - i32.and - local.set $2 - i32.const -1 - i32.const 255 - i32.div_u + i32.store offset=16 local.get $1 - i32.const 255 - i32.and - i32.mul - local.set $4 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $0 + local.set $12 + local.get $9 + local.set $7 + local.get $10 + local.set $3 + local.get $1 + local.set $6 + local.get $12 + local.get $7 + i32.const 4 + i32.shl + local.get $3 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + end local.get $0 - local.get $4 - i32.store local.get $0 - local.get $2 - i32.add - i32.const 4 - i32.sub - local.get $4 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or i32.store + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $0 + local.set $13 + local.get $9 + local.set $12 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + end + ) + (func $~lib/rt/tlsf/addMemory (; 7 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 local.get $2 - i32.const 8 i32.le_u - if - return + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 end - local.get $0 - i32.const 4 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 12 - i32.sub + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 385 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 local.get $4 - i32.store - local.get $0 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 395 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 407 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end local.get $2 - i32.add - i32.const 8 + local.get $1 i32.sub - local.get $4 - i32.store - local.get $2 - i32.const 24 - i32.le_u + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u if + i32.const 0 return end - local.get $0 - i32.const 12 - i32.add - local.get $4 - i32.store - local.get $0 + local.get $6 + i32.const 2 i32.const 16 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 20 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 24 - i32.add - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 28 + i32.mul i32.sub - local.get $4 + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or i32.store - local.get $0 - local.get $2 + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 i32.add - i32.const 24 + i32.const 16 i32.sub + local.set $4 local.get $4 + i32.const 0 + i32.const 2 + i32.or i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end local.get $0 - local.get $2 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 8 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/heap/__heap_base + i32.const 15 i32.add - i32.const 20 - i32.sub - local.get $4 - i32.store + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + memory.size + local.set $1 local.get $0 - local.get $2 + i32.const 1572 i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and i32.const 16 - i32.sub - local.get $4 - i32.store - i32.const 24 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end local.get $0 - i32.const 4 - i32.and - i32.add local.set $3 - local.get $0 - local.get $3 - i32.add - local.set $0 - local.get $2 local.get $3 - i32.sub - local.set $2 - local.get $4 - i64.extend_i32_u - local.get $4 - i64.extend_i32_u - i64.const 32 - i64.shl - i64.or - local.set $5 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end block $break|0 - loop $continue|0 - local.get $2 - i32.const 32 - i32.ge_u - if - block - local.get $0 - local.get $5 - i64.store - local.get $0 - i32.const 8 - i32.add - local.get $5 - i64.store - local.get $0 + i32.const 0 + local.set $5 + loop $repeat|0 + local.get $5 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $3 + local.set $7 + local.get $5 + local.set $6 + i32.const 0 + local.set $4 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $7 + loop $repeat|1 + local.get $7 i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $3 + local.set $9 + local.get $5 + local.set $8 + local.get $7 + local.set $6 + i32.const 0 + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store offset=96 + end + local.get $7 + i32.const 1 i32.add - local.get $5 - i64.store - local.get $0 - i32.const 24 - i32.add - local.get $5 - i64.store - local.get $2 - i32.const 32 - i32.sub - local.set $2 - local.get $0 - i32.const 32 - i32.add - local.set $0 + local.set $7 + br $repeat|1 + unreachable end - br $continue|0 + unreachable end - end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 72 + i32.const 24 + i32.const 447 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 337 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + i32.const 0 + local.set $7 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $5 + local.get $5 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $5 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $4 + local.get $8 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 350 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + memory.size + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + memory.grow + i32.const 0 + i32.lt_s + if + local.get $3 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + memory.size + local.set $7 + local.get $0 + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (; 12 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 364 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 477 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 479 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + call $~lib/rt/rtrace/onalloc + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/rt/pure/increment (; 15 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/rtrace/onincrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 107 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/pure/__retain (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment + end + local.get $0 + ) + (func $~lib/memory/memory.fill (; 17 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i64) + block $~lib/util/memory/memset|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $3 + i32.eqz + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 1 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 2 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 1 + i32.add + local.get $4 + i32.store8 + local.get $5 + i32.const 2 + i32.add + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 2 + i32.sub + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 3 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 6 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 3 + i32.add + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + i32.const 0 + local.get $5 + i32.sub + i32.const 3 + i32.and + local.set $6 + local.get $5 + local.get $6 + i32.add + local.set $5 + local.get $3 + local.get $6 + i32.sub + local.set $3 + local.get $3 + i32.const -4 + i32.and + local.set $3 + i32.const -1 + i32.const 255 + i32.div_u + local.get $4 + i32.const 255 + i32.and + i32.mul + local.set $7 + local.get $5 + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.get $7 + i32.store + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 4 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 8 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 12 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 8 + i32.sub + local.get $7 + i32.store + local.get $3 + i32.const 24 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 12 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 16 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 20 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 24 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 28 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 24 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 20 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 16 + i32.sub + local.get $7 + i32.store + i32.const 24 + local.get $5 + i32.const 4 + i32.and + i32.add + local.set $6 + local.get $5 + local.get $6 + i32.add + local.set $5 + local.get $3 + local.get $6 + i32.sub + local.set $3 + local.get $7 + i64.extend_i32_u + local.get $7 + i64.extend_i32_u + i64.const 32 + i64.shl + i64.or + local.set $8 + block $break|0 + loop $continue|0 + local.get $3 + i32.const 32 + i32.ge_u + if + local.get $5 + local.get $8 + i64.store + local.get $5 + i32.const 8 + i32.add + local.get $8 + i64.store + local.get $5 + i32.const 16 + i32.add + local.get $8 + i64.store + local.get $5 + i32.const 24 + i32.add + local.get $8 + i64.store + local.get $3 + i32.const 32 + i32.sub + local.set $3 + local.get $5 + i32.const 32 + i32.add + local.set $5 + br $continue|0 + end + end + end + end + ) + (func $~lib/arraybuffer/ArrayBuffer#constructor (; 18 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + i32.const 1073741808 + i32.gt_u + if + i32.const 176 + i32.const 224 + i32.const 56 + i32.const 42 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $2 + local.get $2 + i32.const 0 + local.get $1 + call $~lib/memory/memory.fill + local.get $2 + call $~lib/rt/pure/__retain + ) + (func $~lib/rt/tlsf/freeBlock (; 19 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 531 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/rtrace/onfree + ) + (func $~lib/rt/__typeinfo (; 20 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/rt/__rtti_base + local.set $1 + local.get $0 + local.get $1 + i32.load + i32.gt_u + if + i32.const 280 + i32.const 336 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 4 + i32.add + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/util/memory/memcpy (; 21 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + block $break|0 + loop $continue|0 + local.get $2 + if (result i32) + local.get $1 + i32.const 3 + i32.and + else + i32.const 0 + end + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $continue|0 + end + end + end + local.get $0 + i32.const 3 + i32.and + i32.const 0 + i32.eq + if + block $break|1 + loop $continue|1 + local.get $2 + i32.const 16 + i32.ge_u + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 8 + i32.add + i32.load + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 12 + i32.add + i32.load + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|1 + end + end + end + local.get $2 + i32.const 8 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + end + local.get $2 + i32.const 4 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.set $0 + local.get $1 + i32.const 4 + i32.add + local.set $1 + end + local.get $2 + i32.const 2 + i32.and + if + local.get $0 + local.get $1 + i32.load16_u + i32.store16 + local.get $0 + i32.const 2 + i32.add + local.set $0 + local.get $1 + i32.const 2 + i32.add + local.set $1 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + return + end + local.get $2 + i32.const 32 + i32.ge_u + if + block $break|2 + block $case2|2 + block $case1|2 + block $case0|2 + local.get $0 + i32.const 3 + i32.and + local.set $5 + local.get $5 + i32.const 1 + i32.eq + br_if $case0|2 + local.get $5 + i32.const 2 + i32.eq + br_if $case1|2 + local.get $5 + i32.const 3 + i32.eq + br_if $case2|2 + br $break|2 + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 3 + i32.sub + local.set $2 + block $break|3 + loop $continue|3 + local.get $2 + i32.const 17 + i32.ge_u + if + local.get $1 + i32.const 1 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 5 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 9 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 13 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|3 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + block $break|4 + loop $continue|4 + local.get $2 + i32.const 18 + i32.ge_u + if + local.get $1 + i32.const 2 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 6 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 10 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 14 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|4 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + block $break|5 + loop $continue|5 + local.get $2 + i32.const 19 + i32.ge_u + if + local.get $1 + i32.const 3 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 7 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 11 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 15 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|5 + end + end + end + br $break|2 + unreachable + end + unreachable + end + end + local.get $2 + i32.const 16 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 8 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 4 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 2 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + ) + (func $~lib/memory/memory.copy (; 22 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $4 + local.get $3 + i32.add + local.get $5 + i32.le_u + if (result i32) + i32.const 1 + else + local.get $5 + local.get $3 + i32.add + local.get $4 + i32.le_u + end + if + local.get $5 + local.get $4 + local.get $3 + call $~lib/util/memory/memcpy + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/rt/tlsf/__free (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 561 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 562 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/growRoots (; 24 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/pure/ROOTS + local.set $0 + global.get $~lib/rt/pure/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onfree + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $0 + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onalloc + local.get $0 + call $~lib/rt/tlsf/__free end + local.get $5 + global.set $~lib/rt/pure/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/pure/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/pure/END ) - (func $~lib/arraybuffer/ArrayBuffer#constructor (; 7 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) + (func $~lib/rt/pure/appendRoot (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/pure/CUR + local.set $1 local.get $1 - i32.const 1073741816 - i32.gt_u + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 4 + i32.add + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/decrement (; 26 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + call $~lib/rt/rtrace/ondecrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz if i32.const 0 - i32.const 8 - i32.const 47 - i32.const 40 - call $~lib/env/abort + i32.const 128 + i32.const 115 + i32.const 13 + call $~lib/builtins/abort unreachable end - local.get $1 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $3 local.get $2 - i32.const 0 - i32.ne - i32.eqz + i32.const 1 + i32.eq if - local.get $3 - i32.const 8 + local.get $0 + i32.const 16 i32.add - local.set $4 - i32.const 0 - local.set $5 + i32.const 1 + call $~lib/rt/__visit_members local.get $1 - local.set $6 - local.get $4 - local.get $5 - local.get $6 - call $~lib/internal/memory/memset + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 124 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 16 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end end - local.get $3 ) - (func $~lib/map/Map#clear (; 8 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/pure/__release (; 27 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 - i32.const 0 - i32.const 16 - i32.const 0 - call $~lib/arraybuffer/ArrayBuffer#constructor + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + end + ) + (func $~lib/map/Map#clear (; 28 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + local.tee $1 + block (result i32) + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $2 + local.get $1 + i32.load + call $~lib/rt/pure/__release + local.get $2 + end i32.store local.get $0 i32.const 4 @@ -473,10 +3462,17 @@ i32.sub i32.store offset=4 local.get $0 - i32.const 0 - i32.const 48 - i32.const 1 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $2 + block (result i32) + i32.const 0 + i32.const 48 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 + local.get $2 + i32.load offset=8 + call $~lib/rt/pure/__release + local.get $1 + end i32.store offset=8 local.get $0 i32.const 4 @@ -488,13 +3484,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#constructor (; 29 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/memory/memory.allocate + i32.const 3 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.set $0 end local.get $0 @@ -520,16 +3518,15 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/internal/hash/hash8 (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/hash8 (; 30 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const -2128831035 local.get $0 i32.xor i32.const 16777619 i32.mul ) - (func $~lib/map/Map#find (; 11 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 31 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - (local $4 i32) local.get $0 i32.load local.get $2 @@ -539,54 +3536,51 @@ i32.const 4 i32.mul i32.add - i32.load offset=8 + i32.load local.set $3 block $break|0 loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - local.tee $4 - if (result i32) - local.get $3 - i32.load8_s - local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.eq - else - local.get $4 - end - if - local.get $3 - return - end + i32.load8_s + local.get $1 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.eq + else + i32.const 0 + end + if local.get $3 - i32.load offset=8 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + return end + local.get $3 + i32.load offset=8 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/map/Map#has (; 12 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#has (; 32 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.0 (result i32) + block $~lib/util/hash/HASH|inlined.0 (result i32) local.get $1 local.set $2 local.get $2 @@ -594,14 +3588,14 @@ i32.shl i32.const 24 i32.shr_s - call $~lib/internal/hash/hash8 - br $~lib/internal/hash/HASH|inlined.0 + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.0 end call $~lib/map/Map#find i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 13 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 33 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -621,7 +3615,6 @@ local.get $2 i32.const 4 i32.mul - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $2 @@ -636,13 +3629,10 @@ i32.const 12 end i32.mul - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $5 local.get $0 i32.load offset=8 - i32.const 8 - i32.add local.set $6 local.get $6 local.get $0 @@ -654,8 +3644,6 @@ i32.add local.set $7 local.get $5 - i32.const 8 - i32.add local.set $8 block $break|0 loop $continue|0 @@ -663,75 +3651,105 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + i32.load8_s + i32.store8 + local.get $10 + local.get $9 + i32.load offset=4 + i32.store offset=4 + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 i32.load8_s - i32.store8 - local.get $10 - local.get $9 - i32.load offset=4 - i32.store offset=4 - block $~lib/internal/hash/HASH|inlined.2 (result i32) - local.get $9 - i32.load8_s - local.set $11 - local.get $11 - call $~lib/internal/hash/hash8 - br $~lib/internal/hash/HASH|inlined.2 - end - local.get $1 - i32.and local.set $11 - local.get $3 local.get $11 - i32.const 4 - i32.mul - i32.add - local.set $12 - local.get $10 - local.get $12 - i32.load offset=8 - i32.store offset=8 - local.get $12 - local.get $8 - i32.store offset=8 - local.get $8 - block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) - i32.const 12 - end - i32.add - local.set $8 + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=8 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) i32.const 12 end i32.add - local.set $6 + local.set $8 end + local.get $6 + block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + i32.const 12 + end + i32.add + local.set $6 br $continue|0 end end end local.get $0 - local.get $3 + local.tee $9 + block (result i32) + local.get $3 + local.tee $10 + local.get $9 + i32.load + local.tee $9 + i32.ne + if + local.get $10 + call $~lib/rt/pure/__retain + drop + local.get $9 + call $~lib/rt/pure/__release + end + local.get $10 + end i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $5 + local.tee $10 + block (result i32) + local.get $5 + local.tee $11 + local.get $10 + i32.load offset=8 + local.tee $10 + i32.ne + if + local.get $11 + call $~lib/rt/pure/__retain + drop + local.get $10 + call $~lib/rt/pure/__release + end + local.get $11 + end i32.store offset=8 local.get $0 local.get $4 @@ -740,13 +3758,17 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release ) - (func $~lib/map/Map#set (; 14 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#set (; 34 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - block $~lib/internal/hash/HASH|inlined.1 (result i32) + block $~lib/util/hash/HASH|inlined.1 (result i32) local.get $1 local.set $3 local.get $3 @@ -754,8 +3776,8 @@ i32.shl i32.const 24 i32.shr_s - call $~lib/internal/hash/hash8 - br $~lib/internal/hash/HASH|inlined.1 + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.1 end local.set $4 local.get $0 @@ -800,10 +3822,9 @@ end local.get $0 i32.load offset=8 + call $~lib/rt/pure/__retain local.set $3 local.get $3 - i32.const 8 - i32.add block (result i32) local.get $0 local.get $0 @@ -844,19 +3865,21 @@ local.set $6 local.get $5 local.get $6 - i32.load offset=8 + i32.load i32.store offset=8 local.get $6 local.get $5 - i32.store offset=8 + i32.store + local.get $3 + call $~lib/rt/pure/__release end ) - (func $~lib/map/Map#get (; 15 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#get (; 35 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.3 (result i32) + block $~lib/util/hash/HASH|inlined.3 (result i32) local.get $1 local.set $2 local.get $2 @@ -864,8 +3887,8 @@ i32.shl i32.const 24 i32.shr_s - call $~lib/internal/hash/hash8 - br $~lib/internal/hash/HASH|inlined.3 + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.3 end call $~lib/map/Map#find local.set $3 @@ -877,18 +3900,18 @@ unreachable end ) - (func $~lib/map/Map#get:size (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#get:size (; 36 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/map/Map#delete (; 17 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#delete (; 37 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.4 (result i32) + block $~lib/util/hash/HASH|inlined.4 (result i32) local.get $1 local.set $2 local.get $2 @@ -896,8 +3919,8 @@ i32.shl i32.const 24 i32.shr_s - call $~lib/internal/hash/hash8 - br $~lib/internal/hash/HASH|inlined.4 + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.4 end call $~lib/map/Map#find local.set $3 @@ -937,7 +3960,6 @@ i32.gt_u select i32.ge_u - local.tee $2 if (result i32) local.get $0 i32.load offset=20 @@ -949,7 +3971,7 @@ i32.trunc_f64_s i32.lt_s else - local.get $2 + i32.const 0 end if local.get $0 @@ -958,7 +3980,7 @@ end i32.const 1 ) - (func $std/map/test (; 18 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 38 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -969,66 +3991,64 @@ local.set $1 loop $repeat|0 local.get $1 - i32.const 100 - i32.lt_s + i32.const 100 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has i32.eqz - br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 8 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 10 - local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 10 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 11 - i32.const 4 - call $~lib/env/abort - unreachable - end + if + i32.const 0 + i32.const 376 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 9 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -1046,10 +4066,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 13 + i32.const 376 + i32.const 11 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|1 @@ -1061,81 +4081,79 @@ i32.lt_s i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 17 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 18 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 20 - local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 20 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 21 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 15 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 16 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 20 + local.get $1 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 18 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 19 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -1153,10 +4171,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 23 + i32.const 376 + i32.const 21 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|2 @@ -1168,56 +4186,54 @@ i32.lt_s i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 27 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 28 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 30 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 25 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 26 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 28 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -1235,10 +4251,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 32 + i32.const 376 + i32.const 30 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|3 @@ -1250,59 +4266,57 @@ i32.lt_s i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 36 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 10 - local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 38 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 40 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 34 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 36 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 38 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -1320,10 +4334,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -1335,19 +4349,30 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 46 + i32.const 376 + i32.const 44 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/map/Map#clear (; 19 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/map/Map#clear (; 39 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) local.get $0 - i32.const 0 - i32.const 16 - i32.const 0 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $1 + block (result i32) + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $2 + local.get $1 + i32.load + call $~lib/rt/pure/__release + local.get $2 + end i32.store local.get $0 i32.const 4 @@ -1355,10 +4380,17 @@ i32.sub i32.store offset=4 local.get $0 - i32.const 0 - i32.const 48 - i32.const 1 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $2 + block (result i32) + i32.const 0 + i32.const 48 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 + local.get $2 + i32.load offset=8 + call $~lib/rt/pure/__release + local.get $1 + end i32.store offset=8 local.get $0 i32.const 4 @@ -1370,13 +4402,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 20 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#constructor (; 40 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/memory/memory.allocate + i32.const 4 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.set $0 end local.get $0 @@ -1402,9 +4436,8 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/map/Map#find (; 21 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 41 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - (local $4 i32) local.get $0 i32.load local.get $2 @@ -1414,65 +4447,62 @@ i32.const 4 i32.mul i32.add - i32.load offset=8 + i32.load local.set $3 block $break|0 loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=8 - i32.const 1 + i32.load8_u + local.get $1 + i32.const 255 i32.and - i32.eqz - local.tee $4 - if (result i32) - local.get $3 - i32.load8_u - local.get $1 - i32.const 255 - i32.and - i32.eq - else - local.get $4 - end - if - local.get $3 - return - end + i32.eq + else + i32.const 0 + end + if local.get $3 - i32.load offset=8 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + return end + local.get $3 + i32.load offset=8 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/map/Map#has (; 22 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#has (; 42 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.0 (result i32) + block $~lib/util/hash/HASH|inlined.0 (result i32) local.get $1 local.set $2 local.get $2 i32.const 255 i32.and - call $~lib/internal/hash/hash8 - br $~lib/internal/hash/HASH|inlined.0 + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.0 end call $~lib/map/Map#find i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 23 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 43 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1492,7 +4522,6 @@ local.get $2 i32.const 4 i32.mul - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $2 @@ -1507,13 +4536,10 @@ i32.const 12 end i32.mul - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $5 local.get $0 i32.load offset=8 - i32.const 8 - i32.add local.set $6 local.get $6 local.get $0 @@ -1525,8 +4551,6 @@ i32.add local.set $7 local.get $5 - i32.const 8 - i32.add local.set $8 block $break|0 loop $continue|0 @@ -1534,75 +4558,105 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + i32.load8_u + i32.store8 + local.get $10 + local.get $9 + i32.load offset=4 + i32.store offset=4 + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 i32.load8_u - i32.store8 - local.get $10 - local.get $9 - i32.load offset=4 - i32.store offset=4 - block $~lib/internal/hash/HASH|inlined.2 (result i32) - local.get $9 - i32.load8_u - local.set $11 - local.get $11 - call $~lib/internal/hash/hash8 - br $~lib/internal/hash/HASH|inlined.2 - end - local.get $1 - i32.and local.set $11 - local.get $3 local.get $11 - i32.const 4 - i32.mul - i32.add - local.set $12 - local.get $10 - local.get $12 - i32.load offset=8 - i32.store offset=8 - local.get $12 - local.get $8 - i32.store offset=8 - local.get $8 - block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) - i32.const 12 - end - i32.add - local.set $8 + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=8 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) i32.const 12 end i32.add - local.set $6 + local.set $8 end + local.get $6 + block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + i32.const 12 + end + i32.add + local.set $6 br $continue|0 end end end local.get $0 - local.get $3 + local.tee $9 + block (result i32) + local.get $3 + local.tee $10 + local.get $9 + i32.load + local.tee $9 + i32.ne + if + local.get $10 + call $~lib/rt/pure/__retain + drop + local.get $9 + call $~lib/rt/pure/__release + end + local.get $10 + end i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $5 + local.tee $10 + block (result i32) + local.get $5 + local.tee $11 + local.get $10 + i32.load offset=8 + local.tee $10 + i32.ne + if + local.get $11 + call $~lib/rt/pure/__retain + drop + local.get $10 + call $~lib/rt/pure/__release + end + local.get $11 + end i32.store offset=8 local.get $0 local.get $4 @@ -1611,20 +4665,24 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release ) - (func $~lib/map/Map#set (; 24 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#set (; 44 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - block $~lib/internal/hash/HASH|inlined.1 (result i32) + block $~lib/util/hash/HASH|inlined.1 (result i32) local.get $1 local.set $3 local.get $3 i32.const 255 i32.and - call $~lib/internal/hash/hash8 - br $~lib/internal/hash/HASH|inlined.1 + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.1 end local.set $4 local.get $0 @@ -1669,10 +4727,9 @@ end local.get $0 i32.load offset=8 + call $~lib/rt/pure/__retain local.set $3 local.get $3 - i32.const 8 - i32.add block (result i32) local.get $0 local.get $0 @@ -1713,26 +4770,28 @@ local.set $6 local.get $5 local.get $6 - i32.load offset=8 + i32.load i32.store offset=8 local.get $6 local.get $5 - i32.store offset=8 + i32.store + local.get $3 + call $~lib/rt/pure/__release end ) - (func $~lib/map/Map#get (; 25 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#get (; 45 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.3 (result i32) + block $~lib/util/hash/HASH|inlined.3 (result i32) local.get $1 local.set $2 local.get $2 i32.const 255 i32.and - call $~lib/internal/hash/hash8 - br $~lib/internal/hash/HASH|inlined.3 + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.3 end call $~lib/map/Map#find local.set $3 @@ -1744,25 +4803,25 @@ unreachable end ) - (func $~lib/map/Map#get:size (; 26 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#get:size (; 46 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/map/Map#delete (; 27 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#delete (; 47 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.4 (result i32) + block $~lib/util/hash/HASH|inlined.4 (result i32) local.get $1 local.set $2 local.get $2 i32.const 255 i32.and - call $~lib/internal/hash/hash8 - br $~lib/internal/hash/HASH|inlined.4 + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.4 end call $~lib/map/Map#find local.set $3 @@ -1802,7 +4861,6 @@ i32.gt_u select i32.ge_u - local.tee $2 if (result i32) local.get $0 i32.load offset=20 @@ -1814,7 +4872,7 @@ i32.trunc_f64_s i32.lt_s else - local.get $2 + i32.const 0 end if local.get $0 @@ -1823,7 +4881,7 @@ end i32.const 1 ) - (func $std/map/test (; 28 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 48 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -1838,58 +4896,56 @@ i32.lt_u i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 8 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 10 - local.get $1 - i32.const 255 - i32.and - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 10 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.const 255 - i32.and - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 11 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.const 255 + i32.and + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.const 255 + i32.and + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 9 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -1907,10 +4963,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 13 + i32.const 376 + i32.const 11 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|1 @@ -1922,75 +4978,73 @@ i32.lt_u i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 17 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.const 255 - i32.and - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 18 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 20 - local.get $1 - i32.const 255 - i32.and - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 20 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.const 255 - i32.and - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 21 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 15 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.const 255 + i32.and + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 16 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 20 + local.get $1 + i32.const 255 + i32.and + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 18 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.const 255 + i32.and + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 19 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -2008,10 +5062,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 23 + i32.const 376 + i32.const 21 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|2 @@ -2023,54 +5077,52 @@ i32.lt_u i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 27 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.const 255 - i32.and - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 28 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 30 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 25 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.const 255 + i32.and + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 26 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 28 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -2088,10 +5140,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 32 + i32.const 376 + i32.const 30 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|3 @@ -2103,57 +5155,55 @@ i32.lt_u i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 36 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 10 - local.get $1 - i32.const 255 - i32.and - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 38 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 40 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 34 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.const 255 + i32.and + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 36 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 38 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -2171,10 +5221,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -2186,19 +5236,30 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 46 + i32.const 376 + i32.const 44 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/map/Map#clear (; 29 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/map/Map#clear (; 49 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) local.get $0 - i32.const 0 - i32.const 16 - i32.const 0 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $1 + block (result i32) + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $2 + local.get $1 + i32.load + call $~lib/rt/pure/__release + local.get $2 + end i32.store local.get $0 i32.const 4 @@ -2206,10 +5267,17 @@ i32.sub i32.store offset=4 local.get $0 - i32.const 0 - i32.const 48 - i32.const 1 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $2 + block (result i32) + i32.const 0 + i32.const 48 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 + local.get $2 + i32.load offset=8 + call $~lib/rt/pure/__release + local.get $1 + end i32.store offset=8 local.get $0 i32.const 4 @@ -2221,13 +5289,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 30 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#constructor (; 50 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/memory/memory.allocate + i32.const 5 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.set $0 end local.get $0 @@ -2253,7 +5323,7 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/internal/hash/hash16 (; 31 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/hash16 (; 51 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const -2128831035 local.set $1 @@ -2275,9 +5345,8 @@ local.set $1 local.get $1 ) - (func $~lib/map/Map#find (; 32 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 52 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - (local $4 i32) local.get $0 i32.load local.get $2 @@ -2287,54 +5356,51 @@ i32.const 4 i32.mul i32.add - i32.load offset=8 + i32.load local.set $3 block $break|0 loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - local.tee $4 - if (result i32) - local.get $3 - i32.load16_s - local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - i32.eq - else - local.get $4 - end - if - local.get $3 - return - end + i32.load16_s + local.get $1 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + i32.eq + else + i32.const 0 + end + if local.get $3 - i32.load offset=8 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + return end + local.get $3 + i32.load offset=8 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/map/Map#has (; 33 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#has (; 53 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.0 (result i32) + block $~lib/util/hash/HASH|inlined.0 (result i32) local.get $1 local.set $2 local.get $2 @@ -2342,14 +5408,14 @@ i32.shl i32.const 16 i32.shr_s - call $~lib/internal/hash/hash16 - br $~lib/internal/hash/HASH|inlined.0 + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.0 end call $~lib/map/Map#find i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 34 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 54 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2369,7 +5435,6 @@ local.get $2 i32.const 4 i32.mul - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $2 @@ -2384,13 +5449,10 @@ i32.const 12 end i32.mul - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $5 local.get $0 i32.load offset=8 - i32.const 8 - i32.add local.set $6 local.get $6 local.get $0 @@ -2402,8 +5464,6 @@ i32.add local.set $7 local.get $5 - i32.const 8 - i32.add local.set $8 block $break|0 loop $continue|0 @@ -2411,75 +5471,105 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + i32.load16_s + i32.store16 + local.get $10 + local.get $9 + i32.load offset=4 + i32.store offset=4 + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 i32.load16_s - i32.store16 - local.get $10 - local.get $9 - i32.load offset=4 - i32.store offset=4 - block $~lib/internal/hash/HASH|inlined.2 (result i32) - local.get $9 - i32.load16_s - local.set $11 - local.get $11 - call $~lib/internal/hash/hash16 - br $~lib/internal/hash/HASH|inlined.2 - end - local.get $1 - i32.and local.set $11 - local.get $3 local.get $11 - i32.const 4 - i32.mul - i32.add - local.set $12 - local.get $10 - local.get $12 - i32.load offset=8 - i32.store offset=8 - local.get $12 - local.get $8 - i32.store offset=8 - local.get $8 - block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) - i32.const 12 - end - i32.add - local.set $8 + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=8 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) i32.const 12 end i32.add - local.set $6 + local.set $8 + end + local.get $6 + block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + i32.const 12 end + i32.add + local.set $6 br $continue|0 end end end local.get $0 - local.get $3 + local.tee $9 + block (result i32) + local.get $3 + local.tee $10 + local.get $9 + i32.load + local.tee $9 + i32.ne + if + local.get $10 + call $~lib/rt/pure/__retain + drop + local.get $9 + call $~lib/rt/pure/__release + end + local.get $10 + end i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $5 + local.tee $10 + block (result i32) + local.get $5 + local.tee $11 + local.get $10 + i32.load offset=8 + local.tee $10 + i32.ne + if + local.get $11 + call $~lib/rt/pure/__retain + drop + local.get $10 + call $~lib/rt/pure/__release + end + local.get $11 + end i32.store offset=8 local.get $0 local.get $4 @@ -2488,13 +5578,17 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release ) - (func $~lib/map/Map#set (; 35 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#set (; 55 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - block $~lib/internal/hash/HASH|inlined.1 (result i32) + block $~lib/util/hash/HASH|inlined.1 (result i32) local.get $1 local.set $3 local.get $3 @@ -2502,8 +5596,8 @@ i32.shl i32.const 16 i32.shr_s - call $~lib/internal/hash/hash16 - br $~lib/internal/hash/HASH|inlined.1 + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.1 end local.set $4 local.get $0 @@ -2548,10 +5642,9 @@ end local.get $0 i32.load offset=8 + call $~lib/rt/pure/__retain local.set $3 local.get $3 - i32.const 8 - i32.add block (result i32) local.get $0 local.get $0 @@ -2592,19 +5685,21 @@ local.set $6 local.get $5 local.get $6 - i32.load offset=8 + i32.load i32.store offset=8 local.get $6 local.get $5 - i32.store offset=8 + i32.store + local.get $3 + call $~lib/rt/pure/__release end ) - (func $~lib/map/Map#get (; 36 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#get (; 56 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.3 (result i32) + block $~lib/util/hash/HASH|inlined.3 (result i32) local.get $1 local.set $2 local.get $2 @@ -2612,8 +5707,8 @@ i32.shl i32.const 16 i32.shr_s - call $~lib/internal/hash/hash16 - br $~lib/internal/hash/HASH|inlined.3 + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.3 end call $~lib/map/Map#find local.set $3 @@ -2625,18 +5720,18 @@ unreachable end ) - (func $~lib/map/Map#get:size (; 37 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#get:size (; 57 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/map/Map#delete (; 38 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#delete (; 58 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.4 (result i32) + block $~lib/util/hash/HASH|inlined.4 (result i32) local.get $1 local.set $2 local.get $2 @@ -2644,8 +5739,8 @@ i32.shl i32.const 16 i32.shr_s - call $~lib/internal/hash/hash16 - br $~lib/internal/hash/HASH|inlined.4 + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.4 end call $~lib/map/Map#find local.set $3 @@ -2685,7 +5780,6 @@ i32.gt_u select i32.ge_u - local.tee $2 if (result i32) local.get $0 i32.load offset=20 @@ -2697,7 +5791,7 @@ i32.trunc_f64_s i32.lt_s else - local.get $2 + i32.const 0 end if local.get $0 @@ -2706,7 +5800,7 @@ end i32.const 1 ) - (func $std/map/test (; 39 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 59 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -2721,62 +5815,60 @@ i32.lt_s i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 8 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 10 - local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 10 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 11 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 9 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -2794,10 +5886,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 13 + i32.const 376 + i32.const 11 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|1 @@ -2809,81 +5901,79 @@ i32.lt_s i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 17 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 18 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 20 - local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 20 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.const 16 - i32.shl + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 15 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 i32.const 16 - i32.shr_s - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 21 - i32.const 4 - call $~lib/env/abort - unreachable - end + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 20 + local.get $1 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 18 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 19 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -2901,10 +5991,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 23 + i32.const 376 + i32.const 21 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|2 @@ -2916,56 +6006,54 @@ i32.lt_s i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 27 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 28 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 30 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 25 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 26 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 28 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -2983,10 +6071,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 32 + i32.const 376 + i32.const 30 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|3 @@ -2998,59 +6086,57 @@ i32.lt_s i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 36 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 10 - local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 38 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 40 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 34 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 36 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 38 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -3068,10 +6154,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -3083,19 +6169,30 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 46 + i32.const 376 + i32.const 44 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/map/Map#clear (; 40 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/map/Map#clear (; 60 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) local.get $0 - i32.const 0 - i32.const 16 - i32.const 0 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $1 + block (result i32) + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $2 + local.get $1 + i32.load + call $~lib/rt/pure/__release + local.get $2 + end i32.store local.get $0 i32.const 4 @@ -3103,10 +6200,17 @@ i32.sub i32.store offset=4 local.get $0 - i32.const 0 - i32.const 48 - i32.const 1 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $2 + block (result i32) + i32.const 0 + i32.const 48 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 + local.get $2 + i32.load offset=8 + call $~lib/rt/pure/__release + local.get $1 + end i32.store offset=8 local.get $0 i32.const 4 @@ -3118,13 +6222,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 41 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#constructor (; 61 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/memory/memory.allocate + i32.const 6 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.set $0 end local.get $0 @@ -3150,9 +6256,8 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/map/Map#find (; 42 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 62 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - (local $4 i32) local.get $0 i32.load local.get $2 @@ -3162,65 +6267,62 @@ i32.const 4 i32.mul i32.add - i32.load offset=8 + i32.load local.set $3 block $break|0 loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=8 - i32.const 1 + i32.load16_u + local.get $1 + i32.const 65535 i32.and - i32.eqz - local.tee $4 - if (result i32) - local.get $3 - i32.load16_u - local.get $1 - i32.const 65535 - i32.and - i32.eq - else - local.get $4 - end - if - local.get $3 - return - end + i32.eq + else + i32.const 0 + end + if local.get $3 - i32.load offset=8 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + return end + local.get $3 + i32.load offset=8 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/map/Map#has (; 43 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#has (; 63 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.0 (result i32) + block $~lib/util/hash/HASH|inlined.0 (result i32) local.get $1 local.set $2 local.get $2 i32.const 65535 i32.and - call $~lib/internal/hash/hash16 - br $~lib/internal/hash/HASH|inlined.0 + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.0 end call $~lib/map/Map#find i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 44 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 64 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3240,7 +6342,6 @@ local.get $2 i32.const 4 i32.mul - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $2 @@ -3255,13 +6356,10 @@ i32.const 12 end i32.mul - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $5 local.get $0 i32.load offset=8 - i32.const 8 - i32.add local.set $6 local.get $6 local.get $0 @@ -3273,8 +6371,6 @@ i32.add local.set $7 local.get $5 - i32.const 8 - i32.add local.set $8 block $break|0 loop $continue|0 @@ -3282,75 +6378,105 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + i32.load16_u + i32.store16 + local.get $10 + local.get $9 + i32.load offset=4 + i32.store offset=4 + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 i32.load16_u - i32.store16 - local.get $10 - local.get $9 - i32.load offset=4 - i32.store offset=4 - block $~lib/internal/hash/HASH|inlined.2 (result i32) - local.get $9 - i32.load16_u - local.set $11 - local.get $11 - call $~lib/internal/hash/hash16 - br $~lib/internal/hash/HASH|inlined.2 - end - local.get $1 - i32.and local.set $11 - local.get $3 local.get $11 - i32.const 4 - i32.mul - i32.add - local.set $12 - local.get $10 - local.get $12 - i32.load offset=8 - i32.store offset=8 - local.get $12 - local.get $8 - i32.store offset=8 - local.get $8 - block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) - i32.const 12 - end - i32.add - local.set $8 + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=8 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) i32.const 12 end i32.add - local.set $6 + local.set $8 + end + local.get $6 + block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + i32.const 12 end + i32.add + local.set $6 br $continue|0 end end end local.get $0 - local.get $3 + local.tee $9 + block (result i32) + local.get $3 + local.tee $10 + local.get $9 + i32.load + local.tee $9 + i32.ne + if + local.get $10 + call $~lib/rt/pure/__retain + drop + local.get $9 + call $~lib/rt/pure/__release + end + local.get $10 + end i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $5 + local.tee $10 + block (result i32) + local.get $5 + local.tee $11 + local.get $10 + i32.load offset=8 + local.tee $10 + i32.ne + if + local.get $11 + call $~lib/rt/pure/__retain + drop + local.get $10 + call $~lib/rt/pure/__release + end + local.get $11 + end i32.store offset=8 local.get $0 local.get $4 @@ -3359,20 +6485,24 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release ) - (func $~lib/map/Map#set (; 45 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#set (; 65 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - block $~lib/internal/hash/HASH|inlined.1 (result i32) + block $~lib/util/hash/HASH|inlined.1 (result i32) local.get $1 local.set $3 local.get $3 i32.const 65535 i32.and - call $~lib/internal/hash/hash16 - br $~lib/internal/hash/HASH|inlined.1 + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.1 end local.set $4 local.get $0 @@ -3417,10 +6547,9 @@ end local.get $0 i32.load offset=8 + call $~lib/rt/pure/__retain local.set $3 local.get $3 - i32.const 8 - i32.add block (result i32) local.get $0 local.get $0 @@ -3461,26 +6590,28 @@ local.set $6 local.get $5 local.get $6 - i32.load offset=8 + i32.load i32.store offset=8 local.get $6 local.get $5 - i32.store offset=8 + i32.store + local.get $3 + call $~lib/rt/pure/__release end ) - (func $~lib/map/Map#get (; 46 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#get (; 66 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.3 (result i32) + block $~lib/util/hash/HASH|inlined.3 (result i32) local.get $1 local.set $2 local.get $2 i32.const 65535 i32.and - call $~lib/internal/hash/hash16 - br $~lib/internal/hash/HASH|inlined.3 + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.3 end call $~lib/map/Map#find local.set $3 @@ -3492,25 +6623,25 @@ unreachable end ) - (func $~lib/map/Map#get:size (; 47 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#get:size (; 67 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/map/Map#delete (; 48 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#delete (; 68 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.4 (result i32) + block $~lib/util/hash/HASH|inlined.4 (result i32) local.get $1 local.set $2 local.get $2 i32.const 65535 i32.and - call $~lib/internal/hash/hash16 - br $~lib/internal/hash/HASH|inlined.4 + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.4 end call $~lib/map/Map#find local.set $3 @@ -3550,7 +6681,6 @@ i32.gt_u select i32.ge_u - local.tee $2 if (result i32) local.get $0 i32.load offset=20 @@ -3562,7 +6692,7 @@ i32.trunc_f64_s i32.lt_s else - local.get $2 + i32.const 0 end if local.get $0 @@ -3571,7 +6701,7 @@ end i32.const 1 ) - (func $std/map/test (; 49 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 69 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -3586,159 +6716,155 @@ i32.lt_u i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 8 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 10 - local.get $1 - i32.const 65535 - i32.and - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 10 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.const 65535 - i32.and - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 11 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.const 65535 + i32.and + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.const 65535 + i32.and + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 9 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|0 + unreachable + end + unreachable + end + local.get $0 + call $~lib/map/Map#get:size + i32.const 100 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 11 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block $break|1 + i32.const 0 + local.set $1 + loop $repeat|1 + local.get $1 + i32.const 100 + i32.lt_u + i32.eqz + br_if $break|1 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 15 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.const 65535 + i32.and + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 16 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 20 + local.get $1 + i32.const 65535 + i32.and + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 18 + i32.const 4 + call $~lib/builtins/abort + unreachable end + local.get $0 local.get $1 - i32.const 1 - i32.add - local.set $1 - br $repeat|0 - unreachable - end - unreachable - end - local.get $0 - call $~lib/map/Map#get:size - i32.const 100 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 13 - i32.const 2 - call $~lib/env/abort - unreachable - end - block $break|1 - i32.const 0 - local.set $1 - loop $repeat|1 + call $~lib/map/Map#get + i32.const 20 local.get $1 - i32.const 100 - i32.lt_u + i32.const 65535 + i32.and + i32.add + i32.eq i32.eqz - br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 17 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.const 65535 - i32.and - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 18 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 20 - local.get $1 - i32.const 65535 - i32.and - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 20 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.const 65535 - i32.and - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 21 - i32.const 4 - call $~lib/env/abort - unreachable - end + if + i32.const 0 + i32.const 376 + i32.const 19 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -3756,10 +6882,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 23 + i32.const 376 + i32.const 21 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|2 @@ -3771,54 +6897,52 @@ i32.lt_u i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 27 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.const 65535 - i32.and - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 28 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 30 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 25 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.const 65535 + i32.and + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 26 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 28 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -3836,10 +6960,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 32 + i32.const 376 + i32.const 30 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|3 @@ -3851,57 +6975,55 @@ i32.lt_u i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 36 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 10 - local.get $1 - i32.const 65535 - i32.and - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 38 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 40 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 34 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.const 65535 + i32.and + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 36 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 38 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -3919,10 +7041,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -3934,19 +7056,30 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 46 + i32.const 376 + i32.const 44 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/map/Map#clear (; 50 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/map/Map#clear (; 70 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) local.get $0 - i32.const 0 - i32.const 16 - i32.const 0 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $1 + block (result i32) + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $2 + local.get $1 + i32.load + call $~lib/rt/pure/__release + local.get $2 + end i32.store local.get $0 i32.const 4 @@ -3954,10 +7087,17 @@ i32.sub i32.store offset=4 local.get $0 - i32.const 0 - i32.const 48 - i32.const 1 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $2 + block (result i32) + i32.const 0 + i32.const 48 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 + local.get $2 + i32.load offset=8 + call $~lib/rt/pure/__release + local.get $1 + end i32.store offset=8 local.get $0 i32.const 4 @@ -3969,13 +7109,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 51 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#constructor (; 71 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/memory/memory.allocate + i32.const 7 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.set $0 end local.get $0 @@ -4001,7 +7143,7 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/internal/hash/hash32 (; 52 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/hash32 (; 72 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const -2128831035 local.set $1 @@ -4043,9 +7185,8 @@ local.set $1 local.get $1 ) - (func $~lib/map/Map#find (; 53 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 73 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - (local $4 i32) local.get $0 i32.load local.get $2 @@ -4055,61 +7196,58 @@ i32.const 4 i32.mul i32.add - i32.load offset=8 + i32.load local.set $3 block $break|0 loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - local.tee $4 - if (result i32) - local.get $3 - i32.load - local.get $1 - i32.eq - else - local.get $4 - end - if - local.get $3 - return - end + i32.load + local.get $1 + i32.eq + else + i32.const 0 + end + if local.get $3 - i32.load offset=8 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + return end + local.get $3 + i32.load offset=8 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/map/Map#has (; 54 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#has (; 74 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.0 (result i32) + block $~lib/util/hash/HASH|inlined.0 (result i32) local.get $1 local.set $2 local.get $2 - call $~lib/internal/hash/hash32 - br $~lib/internal/hash/HASH|inlined.0 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.0 end call $~lib/map/Map#find i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 55 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 75 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -4129,7 +7267,6 @@ local.get $2 i32.const 4 i32.mul - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $2 @@ -4144,13 +7281,10 @@ i32.const 12 end i32.mul - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $5 local.get $0 i32.load offset=8 - i32.const 8 - i32.add local.set $6 local.get $6 local.get $0 @@ -4162,8 +7296,6 @@ i32.add local.set $7 local.get $5 - i32.const 8 - i32.add local.set $8 block $break|0 loop $continue|0 @@ -4171,75 +7303,105 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + i32.load + i32.store + local.get $10 + local.get $9 + i32.load offset=4 + i32.store offset=4 + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 i32.load - i32.store - local.get $10 - local.get $9 - i32.load offset=4 - i32.store offset=4 - block $~lib/internal/hash/HASH|inlined.2 (result i32) - local.get $9 - i32.load - local.set $11 - local.get $11 - call $~lib/internal/hash/hash32 - br $~lib/internal/hash/HASH|inlined.2 - end - local.get $1 - i32.and local.set $11 - local.get $3 local.get $11 - i32.const 4 - i32.mul - i32.add - local.set $12 - local.get $10 - local.get $12 - i32.load offset=8 - i32.store offset=8 - local.get $12 - local.get $8 - i32.store offset=8 - local.get $8 - block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) - i32.const 12 - end - i32.add - local.set $8 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=8 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) i32.const 12 end i32.add - local.set $6 + local.set $8 end + local.get $6 + block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + i32.const 12 + end + i32.add + local.set $6 br $continue|0 end end end local.get $0 - local.get $3 + local.tee $9 + block (result i32) + local.get $3 + local.tee $10 + local.get $9 + i32.load + local.tee $9 + i32.ne + if + local.get $10 + call $~lib/rt/pure/__retain + drop + local.get $9 + call $~lib/rt/pure/__release + end + local.get $10 + end i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $5 + local.tee $10 + block (result i32) + local.get $5 + local.tee $11 + local.get $10 + i32.load offset=8 + local.tee $10 + i32.ne + if + local.get $11 + call $~lib/rt/pure/__retain + drop + local.get $10 + call $~lib/rt/pure/__release + end + local.get $11 + end i32.store offset=8 local.get $0 local.get $4 @@ -4248,18 +7410,22 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release ) - (func $~lib/map/Map#set (; 56 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#set (; 76 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - block $~lib/internal/hash/HASH|inlined.1 (result i32) + block $~lib/util/hash/HASH|inlined.1 (result i32) local.get $1 local.set $3 local.get $3 - call $~lib/internal/hash/hash32 - br $~lib/internal/hash/HASH|inlined.1 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.1 end local.set $4 local.get $0 @@ -4304,10 +7470,9 @@ end local.get $0 i32.load offset=8 + call $~lib/rt/pure/__retain local.set $3 local.get $3 - i32.const 8 - i32.add block (result i32) local.get $0 local.get $0 @@ -4348,24 +7513,26 @@ local.set $6 local.get $5 local.get $6 - i32.load offset=8 + i32.load i32.store offset=8 local.get $6 local.get $5 - i32.store offset=8 + i32.store + local.get $3 + call $~lib/rt/pure/__release end ) - (func $~lib/map/Map#get (; 57 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#get (; 77 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.3 (result i32) + block $~lib/util/hash/HASH|inlined.3 (result i32) local.get $1 local.set $2 local.get $2 - call $~lib/internal/hash/hash32 - br $~lib/internal/hash/HASH|inlined.3 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.3 end call $~lib/map/Map#find local.set $3 @@ -4377,23 +7544,23 @@ unreachable end ) - (func $~lib/map/Map#get:size (; 58 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#get:size (; 78 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/map/Map#delete (; 59 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#delete (; 79 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.4 (result i32) + block $~lib/util/hash/HASH|inlined.4 (result i32) local.get $1 local.set $2 local.get $2 - call $~lib/internal/hash/hash32 - br $~lib/internal/hash/HASH|inlined.4 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.4 end call $~lib/map/Map#find local.set $3 @@ -4433,7 +7600,6 @@ i32.gt_u select i32.ge_u - local.tee $2 if (result i32) local.get $0 i32.load offset=20 @@ -4445,7 +7611,7 @@ i32.trunc_f64_s i32.lt_s else - local.get $2 + i32.const 0 end if local.get $0 @@ -4454,7 +7620,7 @@ end i32.const 1 ) - (func $std/map/test (; 60 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 80 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -4469,54 +7635,52 @@ i32.lt_s i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 8 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 10 - local.get $1 - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 10 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 11 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 9 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -4534,10 +7698,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 13 + i32.const 376 + i32.const 11 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|1 @@ -4549,69 +7713,67 @@ i32.lt_s i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 17 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 18 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 20 - local.get $1 - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 20 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 21 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 15 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 16 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 20 + local.get $1 + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 18 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 19 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -4629,10 +7791,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 23 + i32.const 376 + i32.const 21 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|2 @@ -4644,52 +7806,50 @@ i32.lt_s i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 27 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 28 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 30 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 25 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 26 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 28 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -4707,10 +7867,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 32 + i32.const 376 + i32.const 30 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|3 @@ -4718,59 +7878,57 @@ local.set $1 loop $repeat|3 local.get $1 - i32.const 50 - i32.lt_s + i32.const 50 + i32.lt_s + i32.eqz + br_if $break|3 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 34 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has i32.eqz - br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 36 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 10 - local.get $1 - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 38 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 40 - i32.const 4 - call $~lib/env/abort - unreachable - end + if + i32.const 0 + i32.const 376 + i32.const 36 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 38 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -4788,10 +7946,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -4803,19 +7961,30 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 46 + i32.const 376 + i32.const 44 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/map/Map#clear (; 61 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/map/Map#clear (; 81 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) local.get $0 - i32.const 0 - i32.const 16 - i32.const 0 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $1 + block (result i32) + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $2 + local.get $1 + i32.load + call $~lib/rt/pure/__release + local.get $2 + end i32.store local.get $0 i32.const 4 @@ -4823,10 +7992,17 @@ i32.sub i32.store offset=4 local.get $0 - i32.const 0 - i32.const 48 - i32.const 1 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $2 + block (result i32) + i32.const 0 + i32.const 48 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 + local.get $2 + i32.load offset=8 + call $~lib/rt/pure/__release + local.get $1 + end i32.store offset=8 local.get $0 i32.const 4 @@ -4838,13 +8014,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 62 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#constructor (; 82 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/memory/memory.allocate + i32.const 8 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.set $0 end local.get $0 @@ -4870,9 +8048,8 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/map/Map#find (; 63 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 83 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - (local $4 i32) local.get $0 i32.load local.get $2 @@ -4882,61 +8059,58 @@ i32.const 4 i32.mul i32.add - i32.load offset=8 + i32.load local.set $3 block $break|0 loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - local.tee $4 - if (result i32) - local.get $3 - i32.load - local.get $1 - i32.eq - else - local.get $4 - end - if - local.get $3 - return - end + i32.load + local.get $1 + i32.eq + else + i32.const 0 + end + if local.get $3 - i32.load offset=8 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + return end + local.get $3 + i32.load offset=8 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/map/Map#has (; 64 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#has (; 84 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.0 (result i32) + block $~lib/util/hash/HASH|inlined.0 (result i32) local.get $1 local.set $2 local.get $2 - call $~lib/internal/hash/hash32 - br $~lib/internal/hash/HASH|inlined.0 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.0 end call $~lib/map/Map#find i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 65 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 85 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -4956,7 +8130,6 @@ local.get $2 i32.const 4 i32.mul - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $2 @@ -4971,13 +8144,10 @@ i32.const 12 end i32.mul - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $5 local.get $0 i32.load offset=8 - i32.const 8 - i32.add local.set $6 local.get $6 local.get $0 @@ -4989,8 +8159,6 @@ i32.add local.set $7 local.get $5 - i32.const 8 - i32.add local.set $8 block $break|0 loop $continue|0 @@ -4998,75 +8166,105 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + i32.load + i32.store + local.get $10 + local.get $9 + i32.load offset=4 + i32.store offset=4 + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 i32.load - i32.store - local.get $10 - local.get $9 - i32.load offset=4 - i32.store offset=4 - block $~lib/internal/hash/HASH|inlined.2 (result i32) - local.get $9 - i32.load - local.set $11 - local.get $11 - call $~lib/internal/hash/hash32 - br $~lib/internal/hash/HASH|inlined.2 - end - local.get $1 - i32.and local.set $11 - local.get $3 local.get $11 - i32.const 4 - i32.mul - i32.add - local.set $12 - local.get $10 - local.get $12 - i32.load offset=8 - i32.store offset=8 - local.get $12 - local.get $8 - i32.store offset=8 - local.get $8 - block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) - i32.const 12 - end - i32.add - local.set $8 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=8 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) i32.const 12 end i32.add - local.set $6 + local.set $8 end + local.get $6 + block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + i32.const 12 + end + i32.add + local.set $6 br $continue|0 end end end local.get $0 - local.get $3 + local.tee $9 + block (result i32) + local.get $3 + local.tee $10 + local.get $9 + i32.load + local.tee $9 + i32.ne + if + local.get $10 + call $~lib/rt/pure/__retain + drop + local.get $9 + call $~lib/rt/pure/__release + end + local.get $10 + end i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $5 + local.tee $10 + block (result i32) + local.get $5 + local.tee $11 + local.get $10 + i32.load offset=8 + local.tee $10 + i32.ne + if + local.get $11 + call $~lib/rt/pure/__retain + drop + local.get $10 + call $~lib/rt/pure/__release + end + local.get $11 + end i32.store offset=8 local.get $0 local.get $4 @@ -5075,18 +8273,22 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release ) - (func $~lib/map/Map#set (; 66 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#set (; 86 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - block $~lib/internal/hash/HASH|inlined.1 (result i32) + block $~lib/util/hash/HASH|inlined.1 (result i32) local.get $1 local.set $3 local.get $3 - call $~lib/internal/hash/hash32 - br $~lib/internal/hash/HASH|inlined.1 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.1 end local.set $4 local.get $0 @@ -5131,10 +8333,9 @@ end local.get $0 i32.load offset=8 + call $~lib/rt/pure/__retain local.set $3 local.get $3 - i32.const 8 - i32.add block (result i32) local.get $0 local.get $0 @@ -5175,24 +8376,26 @@ local.set $6 local.get $5 local.get $6 - i32.load offset=8 + i32.load i32.store offset=8 local.get $6 local.get $5 - i32.store offset=8 + i32.store + local.get $3 + call $~lib/rt/pure/__release end ) - (func $~lib/map/Map#get (; 67 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#get (; 87 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.3 (result i32) + block $~lib/util/hash/HASH|inlined.3 (result i32) local.get $1 local.set $2 local.get $2 - call $~lib/internal/hash/hash32 - br $~lib/internal/hash/HASH|inlined.3 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.3 end call $~lib/map/Map#find local.set $3 @@ -5204,23 +8407,23 @@ unreachable end ) - (func $~lib/map/Map#get:size (; 68 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#get:size (; 88 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/map/Map#delete (; 69 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#delete (; 89 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.4 (result i32) + block $~lib/util/hash/HASH|inlined.4 (result i32) local.get $1 local.set $2 local.get $2 - call $~lib/internal/hash/hash32 - br $~lib/internal/hash/HASH|inlined.4 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.4 end call $~lib/map/Map#find local.set $3 @@ -5260,7 +8463,6 @@ i32.gt_u select i32.ge_u - local.tee $2 if (result i32) local.get $0 i32.load offset=20 @@ -5272,7 +8474,7 @@ i32.trunc_f64_s i32.lt_s else - local.get $2 + i32.const 0 end if local.get $0 @@ -5281,7 +8483,7 @@ end i32.const 1 ) - (func $std/map/test (; 70 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 90 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -5296,54 +8498,52 @@ i32.lt_u i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 8 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 10 - local.get $1 - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 10 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 11 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 9 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -5361,10 +8561,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 13 + i32.const 376 + i32.const 11 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|1 @@ -5372,73 +8572,71 @@ local.set $1 loop $repeat|1 local.get $1 - i32.const 100 - i32.lt_u + i32.const 100 + i32.lt_u + i32.eqz + br_if $break|1 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 15 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 16 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 20 + local.get $1 + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 18 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.add + i32.eq i32.eqz - br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 17 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 18 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 20 - local.get $1 - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 20 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 21 - i32.const 4 - call $~lib/env/abort - unreachable - end + if + i32.const 0 + i32.const 376 + i32.const 19 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -5456,10 +8654,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 23 + i32.const 376 + i32.const 21 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|2 @@ -5471,52 +8669,50 @@ i32.lt_u i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 27 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 28 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 30 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 25 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 26 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 28 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -5534,10 +8730,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 32 + i32.const 376 + i32.const 30 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|3 @@ -5549,55 +8745,53 @@ i32.lt_u i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 36 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 10 - local.get $1 - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 38 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 40 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 34 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 36 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 38 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -5615,10 +8809,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -5630,19 +8824,30 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 46 + i32.const 376 + i32.const 44 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/map/Map#clear (; 71 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/map/Map#clear (; 91 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) local.get $0 - i32.const 0 - i32.const 16 - i32.const 0 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $1 + block (result i32) + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $2 + local.get $1 + i32.load + call $~lib/rt/pure/__release + local.get $2 + end i32.store local.get $0 i32.const 4 @@ -5650,10 +8855,17 @@ i32.sub i32.store offset=4 local.get $0 - i32.const 0 - i32.const 64 - i32.const 1 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $2 + block (result i32) + i32.const 0 + i32.const 64 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 + local.get $2 + i32.load offset=8 + call $~lib/rt/pure/__release + local.get $1 + end i32.store offset=8 local.get $0 i32.const 4 @@ -5665,13 +8877,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 72 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#constructor (; 92 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/memory/memory.allocate + i32.const 9 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.set $0 end local.get $0 @@ -5697,7 +8911,7 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/internal/hash/hash64 (; 73 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/hash/hash64 (; 93 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -5785,9 +8999,8 @@ local.set $3 local.get $3 ) - (func $~lib/map/Map#find (; 74 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 94 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) (local $3 i32) - (local $4 i32) local.get $0 i32.load local.get $2 @@ -5797,61 +9010,58 @@ i32.const 4 i32.mul i32.add - i32.load offset=8 + i32.load local.set $3 block $break|0 loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=12 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=12 - i32.const 1 - i32.and - i32.eqz - local.tee $4 - if (result i32) - local.get $3 - i64.load - local.get $1 - i64.eq - else - local.get $4 - end - if - local.get $3 - return - end + i64.load + local.get $1 + i64.eq + else + i32.const 0 + end + if local.get $3 - i32.load offset=12 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + return end + local.get $3 + i32.load offset=12 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/map/Map#has (; 75 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/map/Map#has (; 95 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) (local $2 i64) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.0 (result i32) + block $~lib/util/hash/HASH|inlined.0 (result i32) local.get $1 local.set $2 local.get $2 - call $~lib/internal/hash/hash64 - br $~lib/internal/hash/HASH|inlined.0 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.0 end call $~lib/map/Map#find i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 76 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 96 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -5872,7 +9082,6 @@ local.get $2 i32.const 4 i32.mul - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $2 @@ -5887,13 +9096,10 @@ i32.const 16 end i32.mul - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $5 local.get $0 i32.load offset=8 - i32.const 8 - i32.add local.set $6 local.get $6 local.get $0 @@ -5905,8 +9111,6 @@ i32.add local.set $7 local.get $5 - i32.const 8 - i32.add local.set $8 block $break|0 loop $continue|0 @@ -5914,75 +9118,105 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=12 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=12 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 - local.get $9 - i64.load - i64.store - local.get $10 - local.get $9 - i32.load offset=8 - i32.store offset=8 - block $~lib/internal/hash/HASH|inlined.2 (result i32) - local.get $9 - i64.load - local.set $11 - local.get $11 - call $~lib/internal/hash/hash64 - br $~lib/internal/hash/HASH|inlined.2 - end - local.get $1 - i32.and - local.set $12 - local.get $3 - local.get $12 - i32.const 4 - i32.mul - i32.add - local.set $13 - local.get $10 - local.get $13 - i32.load offset=8 - i32.store offset=12 - local.get $13 - local.get $8 - i32.store offset=8 - local.get $8 - block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) - i32.const 16 - end - i32.add - local.set $8 + i64.load + i64.store + local.get $10 + local.get $9 + i32.load offset=8 + i32.store offset=8 + block $~lib/util/hash/HASH|inlined.2 (result i32) + local.get $9 + i64.load + local.set $11 + local.get $11 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $12 + local.get $3 + local.get $12 + i32.const 4 + i32.mul + i32.add + local.set $13 + local.get $10 + local.get $13 + i32.load + i32.store offset=12 + local.get $13 + local.get $8 + i32.store + local.get $8 + block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) i32.const 16 end i32.add - local.set $6 + local.set $8 end + local.get $6 + block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + i32.const 16 + end + i32.add + local.set $6 br $continue|0 end end end local.get $0 - local.get $3 + local.tee $9 + block (result i32) + local.get $3 + local.tee $10 + local.get $9 + i32.load + local.tee $9 + i32.ne + if + local.get $10 + call $~lib/rt/pure/__retain + drop + local.get $9 + call $~lib/rt/pure/__release + end + local.get $10 + end i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $5 + local.tee $10 + block (result i32) + local.get $5 + local.tee $12 + local.get $10 + i32.load offset=8 + local.tee $10 + i32.ne + if + local.get $12 + call $~lib/rt/pure/__retain + drop + local.get $10 + call $~lib/rt/pure/__release + end + local.get $12 + end i32.store offset=8 local.get $0 local.get $4 @@ -5991,19 +9225,23 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release ) - (func $~lib/map/Map#set (; 77 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) + (func $~lib/map/Map#set (; 97 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) (local $3 i64) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - block $~lib/internal/hash/HASH|inlined.1 (result i32) + block $~lib/util/hash/HASH|inlined.1 (result i32) local.get $1 local.set $3 local.get $3 - call $~lib/internal/hash/hash64 - br $~lib/internal/hash/HASH|inlined.1 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.1 end local.set $4 local.get $0 @@ -6048,10 +9286,9 @@ end local.get $0 i32.load offset=8 + call $~lib/rt/pure/__retain local.set $6 local.get $6 - i32.const 8 - i32.add block (result i32) local.get $0 local.get $0 @@ -6092,24 +9329,26 @@ local.set $7 local.get $5 local.get $7 - i32.load offset=8 + i32.load i32.store offset=12 local.get $7 local.get $5 - i32.store offset=8 + i32.store + local.get $6 + call $~lib/rt/pure/__release end ) - (func $~lib/map/Map#get (; 78 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/map/Map#get (; 98 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) (local $2 i64) (local $3 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.3 (result i32) + block $~lib/util/hash/HASH|inlined.3 (result i32) local.get $1 local.set $2 local.get $2 - call $~lib/internal/hash/hash64 - br $~lib/internal/hash/HASH|inlined.3 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.3 end call $~lib/map/Map#find local.set $3 @@ -6121,11 +9360,11 @@ unreachable end ) - (func $~lib/map/Map#get:size (; 79 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#get:size (; 99 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/map/Map#delete (; 80 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/map/Map#delete (; 100 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) (local $2 i64) (local $3 i32) (local $4 i32) @@ -6133,12 +9372,12 @@ (local $6 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.4 (result i32) + block $~lib/util/hash/HASH|inlined.4 (result i32) local.get $1 local.set $2 local.get $2 - call $~lib/internal/hash/hash64 - br $~lib/internal/hash/HASH|inlined.4 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.4 end call $~lib/map/Map#find local.set $3 @@ -6178,7 +9417,6 @@ i32.gt_u select i32.ge_u - local.tee $5 if (result i32) local.get $0 i32.load offset=20 @@ -6190,7 +9428,7 @@ i32.trunc_f64_s i32.lt_s else - local.get $5 + i32.const 0 end if local.get $0 @@ -6199,7 +9437,7 @@ end i32.const 1 ) - (func $std/map/test (; 81 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 101 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i64) i32.const 0 @@ -6214,56 +9452,54 @@ i64.lt_s i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 8 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 10 - local.get $1 - i32.wrap_i64 - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 10 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.wrap_i64 - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 11 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.wrap_i64 + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.wrap_i64 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 9 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i64.const 1 @@ -6281,10 +9517,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 13 + i32.const 376 + i32.const 11 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|1 @@ -6296,72 +9532,70 @@ i64.lt_s i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 17 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.wrap_i64 - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 18 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 20 - local.get $1 - i32.wrap_i64 - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 20 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.wrap_i64 - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 21 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 15 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.wrap_i64 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 16 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 20 + local.get $1 + i32.wrap_i64 + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 18 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.wrap_i64 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 19 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i64.const 1 @@ -6379,10 +9613,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 23 + i32.const 376 + i32.const 21 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|2 @@ -6394,53 +9628,51 @@ i64.lt_s i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 27 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.wrap_i64 - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 28 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 30 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 25 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.wrap_i64 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 26 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 28 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i64.const 1 @@ -6458,10 +9690,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 32 + i32.const 376 + i32.const 30 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|3 @@ -6473,56 +9705,54 @@ i64.lt_s i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 36 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 10 - local.get $1 - i32.wrap_i64 - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 38 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 40 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 34 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.wrap_i64 + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 36 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 38 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i64.const 1 @@ -6540,10 +9770,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -6555,19 +9785,30 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 46 + i32.const 376 + i32.const 44 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/map/Map#clear (; 82 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/map/Map#clear (; 102 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) local.get $0 - i32.const 0 - i32.const 16 - i32.const 0 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $1 + block (result i32) + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $2 + local.get $1 + i32.load + call $~lib/rt/pure/__release + local.get $2 + end i32.store local.get $0 i32.const 4 @@ -6575,10 +9816,17 @@ i32.sub i32.store offset=4 local.get $0 - i32.const 0 - i32.const 64 - i32.const 1 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $2 + block (result i32) + i32.const 0 + i32.const 64 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 + local.get $2 + i32.load offset=8 + call $~lib/rt/pure/__release + local.get $1 + end i32.store offset=8 local.get $0 i32.const 4 @@ -6590,13 +9838,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 83 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#constructor (; 103 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/memory/memory.allocate + i32.const 10 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.set $0 end local.get $0 @@ -6622,9 +9872,8 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/map/Map#find (; 84 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 104 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) (local $3 i32) - (local $4 i32) local.get $0 i32.load local.get $2 @@ -6634,61 +9883,58 @@ i32.const 4 i32.mul i32.add - i32.load offset=8 + i32.load local.set $3 block $break|0 loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=12 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=12 - i32.const 1 - i32.and - i32.eqz - local.tee $4 - if (result i32) - local.get $3 - i64.load - local.get $1 - i64.eq - else - local.get $4 - end - if - local.get $3 - return - end + i64.load + local.get $1 + i64.eq + else + i32.const 0 + end + if local.get $3 - i32.load offset=12 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + return end + local.get $3 + i32.load offset=12 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/map/Map#has (; 85 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/map/Map#has (; 105 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) (local $2 i64) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.0 (result i32) + block $~lib/util/hash/HASH|inlined.0 (result i32) local.get $1 local.set $2 local.get $2 - call $~lib/internal/hash/hash64 - br $~lib/internal/hash/HASH|inlined.0 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.0 end call $~lib/map/Map#find i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 86 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 106 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -6709,7 +9955,6 @@ local.get $2 i32.const 4 i32.mul - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $2 @@ -6724,13 +9969,10 @@ i32.const 16 end i32.mul - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $5 local.get $0 i32.load offset=8 - i32.const 8 - i32.add local.set $6 local.get $6 local.get $0 @@ -6742,8 +9984,6 @@ i32.add local.set $7 local.get $5 - i32.const 8 - i32.add local.set $8 block $break|0 loop $continue|0 @@ -6751,75 +9991,105 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=12 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=12 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + i64.load + i64.store + local.get $10 + local.get $9 + i32.load offset=8 + i32.store offset=8 + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 i64.load - i64.store - local.get $10 - local.get $9 - i32.load offset=8 - i32.store offset=8 - block $~lib/internal/hash/HASH|inlined.2 (result i32) - local.get $9 - i64.load - local.set $11 - local.get $11 - call $~lib/internal/hash/hash64 - br $~lib/internal/hash/HASH|inlined.2 - end - local.get $1 - i32.and - local.set $12 - local.get $3 - local.get $12 - i32.const 4 - i32.mul - i32.add - local.set $13 - local.get $10 - local.get $13 - i32.load offset=8 - i32.store offset=12 - local.get $13 - local.get $8 - i32.store offset=8 - local.get $8 - block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) - i32.const 16 - end - i32.add - local.set $8 + local.set $11 + local.get $11 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $12 + local.get $3 + local.get $12 + i32.const 4 + i32.mul + i32.add + local.set $13 + local.get $10 + local.get $13 + i32.load + i32.store offset=12 + local.get $13 + local.get $8 + i32.store + local.get $8 + block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) i32.const 16 end i32.add - local.set $6 + local.set $8 + end + local.get $6 + block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + i32.const 16 end + i32.add + local.set $6 br $continue|0 end end end local.get $0 - local.get $3 + local.tee $9 + block (result i32) + local.get $3 + local.tee $10 + local.get $9 + i32.load + local.tee $9 + i32.ne + if + local.get $10 + call $~lib/rt/pure/__retain + drop + local.get $9 + call $~lib/rt/pure/__release + end + local.get $10 + end i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $5 + local.tee $10 + block (result i32) + local.get $5 + local.tee $12 + local.get $10 + i32.load offset=8 + local.tee $10 + i32.ne + if + local.get $12 + call $~lib/rt/pure/__retain + drop + local.get $10 + call $~lib/rt/pure/__release + end + local.get $12 + end i32.store offset=8 local.get $0 local.get $4 @@ -6828,19 +10098,23 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release ) - (func $~lib/map/Map#set (; 87 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) + (func $~lib/map/Map#set (; 107 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) (local $3 i64) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - block $~lib/internal/hash/HASH|inlined.1 (result i32) + block $~lib/util/hash/HASH|inlined.1 (result i32) local.get $1 local.set $3 local.get $3 - call $~lib/internal/hash/hash64 - br $~lib/internal/hash/HASH|inlined.1 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.1 end local.set $4 local.get $0 @@ -6885,10 +10159,9 @@ end local.get $0 i32.load offset=8 + call $~lib/rt/pure/__retain local.set $6 local.get $6 - i32.const 8 - i32.add block (result i32) local.get $0 local.get $0 @@ -6929,24 +10202,26 @@ local.set $7 local.get $5 local.get $7 - i32.load offset=8 + i32.load i32.store offset=12 local.get $7 local.get $5 - i32.store offset=8 + i32.store + local.get $6 + call $~lib/rt/pure/__release end ) - (func $~lib/map/Map#get (; 88 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/map/Map#get (; 108 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) (local $2 i64) (local $3 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.3 (result i32) + block $~lib/util/hash/HASH|inlined.3 (result i32) local.get $1 local.set $2 local.get $2 - call $~lib/internal/hash/hash64 - br $~lib/internal/hash/HASH|inlined.3 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.3 end call $~lib/map/Map#find local.set $3 @@ -6958,11 +10233,11 @@ unreachable end ) - (func $~lib/map/Map#get:size (; 89 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#get:size (; 109 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/map/Map#delete (; 90 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/map/Map#delete (; 110 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) (local $2 i64) (local $3 i32) (local $4 i32) @@ -6970,12 +10245,12 @@ (local $6 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.4 (result i32) + block $~lib/util/hash/HASH|inlined.4 (result i32) local.get $1 local.set $2 local.get $2 - call $~lib/internal/hash/hash64 - br $~lib/internal/hash/HASH|inlined.4 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.4 end call $~lib/map/Map#find local.set $3 @@ -7015,7 +10290,6 @@ i32.gt_u select i32.ge_u - local.tee $5 if (result i32) local.get $0 i32.load offset=20 @@ -7027,7 +10301,7 @@ i32.trunc_f64_s i32.lt_s else - local.get $5 + i32.const 0 end if local.get $0 @@ -7036,7 +10310,7 @@ end i32.const 1 ) - (func $std/map/test (; 91 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 111 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i64) i32.const 0 @@ -7051,56 +10325,54 @@ i64.lt_u i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 8 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 10 - local.get $1 - i32.wrap_i64 - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 10 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.wrap_i64 - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 11 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.wrap_i64 + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.wrap_i64 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 9 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i64.const 1 @@ -7118,10 +10390,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 13 + i32.const 376 + i32.const 11 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|1 @@ -7133,72 +10405,70 @@ i64.lt_u i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 17 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.wrap_i64 - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 18 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 20 - local.get $1 - i32.wrap_i64 - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 20 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.wrap_i64 - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 21 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 15 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.wrap_i64 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 16 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 20 + local.get $1 + i32.wrap_i64 + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 18 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.wrap_i64 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 19 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i64.const 1 @@ -7216,10 +10486,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 23 + i32.const 376 + i32.const 21 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|2 @@ -7231,53 +10501,51 @@ i64.lt_u i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 27 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.wrap_i64 - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 28 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 30 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 25 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.wrap_i64 + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 26 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 28 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i64.const 1 @@ -7295,10 +10563,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 32 + i32.const 376 + i32.const 30 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|3 @@ -7310,56 +10578,54 @@ i64.lt_u i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 36 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 10 - local.get $1 - i32.wrap_i64 - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 38 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 40 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 34 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.wrap_i64 + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 36 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 38 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i64.const 1 @@ -7377,10 +10643,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -7392,19 +10658,30 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 46 + i32.const 376 + i32.const 44 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/map/Map#clear (; 92 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/map/Map#clear (; 112 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) local.get $0 - i32.const 0 - i32.const 16 - i32.const 0 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $1 + block (result i32) + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $2 + local.get $1 + i32.load + call $~lib/rt/pure/__release + local.get $2 + end i32.store local.get $0 i32.const 4 @@ -7412,10 +10689,17 @@ i32.sub i32.store offset=4 local.get $0 - i32.const 0 - i32.const 48 - i32.const 1 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $2 + block (result i32) + i32.const 0 + i32.const 48 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 + local.get $2 + i32.load offset=8 + call $~lib/rt/pure/__release + local.get $1 + end i32.store offset=8 local.get $0 i32.const 4 @@ -7427,13 +10711,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 93 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#constructor (; 113 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/memory/memory.allocate + i32.const 11 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.set $0 end local.get $0 @@ -7459,9 +10745,8 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/map/Map#find (; 94 ;) (type $FUNCSIG$iifi) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 114 ;) (type $FUNCSIG$iifi) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) (local $3 i32) - (local $4 i32) local.get $0 i32.load local.get $2 @@ -7471,62 +10756,59 @@ i32.const 4 i32.mul i32.add - i32.load offset=8 + i32.load local.set $3 block $break|0 loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - local.tee $4 - if (result i32) - local.get $3 - f32.load - local.get $1 - f32.eq - else - local.get $4 - end - if - local.get $3 - return - end + f32.load + local.get $1 + f32.eq + else + i32.const 0 + end + if local.get $3 - i32.load offset=8 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + return end + local.get $3 + i32.load offset=8 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/map/Map#has (; 95 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) + (func $~lib/map/Map#has (; 115 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) (local $2 f32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.0 (result i32) + block $~lib/util/hash/HASH|inlined.0 (result i32) local.get $1 local.set $2 local.get $2 i32.reinterpret_f32 - call $~lib/internal/hash/hash32 - br $~lib/internal/hash/HASH|inlined.0 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.0 end call $~lib/map/Map#find i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 96 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 116 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -7547,7 +10829,6 @@ local.get $2 i32.const 4 i32.mul - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $2 @@ -7562,13 +10843,10 @@ i32.const 12 end i32.mul - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $5 local.get $0 i32.load offset=8 - i32.const 8 - i32.add local.set $6 local.get $6 local.get $0 @@ -7580,8 +10858,6 @@ i32.add local.set $7 local.get $5 - i32.const 8 - i32.add local.set $8 block $break|0 loop $continue|0 @@ -7589,76 +10865,106 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + f32.load + f32.store + local.get $10 + local.get $9 + i32.load offset=4 + i32.store offset=4 + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 f32.load - f32.store - local.get $10 - local.get $9 - i32.load offset=4 - i32.store offset=4 - block $~lib/internal/hash/HASH|inlined.2 (result i32) - local.get $9 - f32.load - local.set $11 - local.get $11 - i32.reinterpret_f32 - call $~lib/internal/hash/hash32 - br $~lib/internal/hash/HASH|inlined.2 - end - local.get $1 - i32.and - local.set $12 - local.get $3 - local.get $12 - i32.const 4 - i32.mul - i32.add - local.set $13 - local.get $10 - local.get $13 - i32.load offset=8 - i32.store offset=8 - local.get $13 - local.get $8 - i32.store offset=8 - local.get $8 - block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) - i32.const 12 - end - i32.add - local.set $8 + local.set $11 + local.get $11 + i32.reinterpret_f32 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $12 + local.get $3 + local.get $12 + i32.const 4 + i32.mul + i32.add + local.set $13 + local.get $10 + local.get $13 + i32.load + i32.store offset=8 + local.get $13 + local.get $8 + i32.store + local.get $8 + block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) i32.const 12 end i32.add - local.set $6 + local.set $8 end + local.get $6 + block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + i32.const 12 + end + i32.add + local.set $6 br $continue|0 end end end local.get $0 - local.get $3 + local.tee $9 + block (result i32) + local.get $3 + local.tee $10 + local.get $9 + i32.load + local.tee $9 + i32.ne + if + local.get $10 + call $~lib/rt/pure/__retain + drop + local.get $9 + call $~lib/rt/pure/__release + end + local.get $10 + end i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $5 + local.tee $10 + block (result i32) + local.get $5 + local.tee $12 + local.get $10 + i32.load offset=8 + local.tee $10 + i32.ne + if + local.get $12 + call $~lib/rt/pure/__retain + drop + local.get $10 + call $~lib/rt/pure/__release + end + local.get $12 + end i32.store offset=8 local.get $0 local.get $4 @@ -7667,20 +10973,24 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release ) - (func $~lib/map/Map#set (; 97 ;) (type $FUNCSIG$vifi) (param $0 i32) (param $1 f32) (param $2 i32) + (func $~lib/map/Map#set (; 117 ;) (type $FUNCSIG$vifi) (param $0 i32) (param $1 f32) (param $2 i32) (local $3 f32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - block $~lib/internal/hash/HASH|inlined.1 (result i32) + block $~lib/util/hash/HASH|inlined.1 (result i32) local.get $1 local.set $3 local.get $3 i32.reinterpret_f32 - call $~lib/internal/hash/hash32 - br $~lib/internal/hash/HASH|inlined.1 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.1 end local.set $4 local.get $0 @@ -7725,10 +11035,9 @@ end local.get $0 i32.load offset=8 + call $~lib/rt/pure/__retain local.set $6 local.get $6 - i32.const 8 - i32.add block (result i32) local.get $0 local.get $0 @@ -7769,25 +11078,27 @@ local.set $7 local.get $5 local.get $7 - i32.load offset=8 + i32.load i32.store offset=8 local.get $7 local.get $5 - i32.store offset=8 + i32.store + local.get $6 + call $~lib/rt/pure/__release end ) - (func $~lib/map/Map#get (; 98 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) + (func $~lib/map/Map#get (; 118 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) (local $2 f32) (local $3 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.3 (result i32) + block $~lib/util/hash/HASH|inlined.3 (result i32) local.get $1 local.set $2 local.get $2 i32.reinterpret_f32 - call $~lib/internal/hash/hash32 - br $~lib/internal/hash/HASH|inlined.3 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.3 end call $~lib/map/Map#find local.set $3 @@ -7799,11 +11110,11 @@ unreachable end ) - (func $~lib/map/Map#get:size (; 99 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#get:size (; 119 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/map/Map#delete (; 100 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) + (func $~lib/map/Map#delete (; 120 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) (local $2 f32) (local $3 i32) (local $4 i32) @@ -7811,13 +11122,13 @@ (local $6 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.4 (result i32) + block $~lib/util/hash/HASH|inlined.4 (result i32) local.get $1 local.set $2 local.get $2 i32.reinterpret_f32 - call $~lib/internal/hash/hash32 - br $~lib/internal/hash/HASH|inlined.4 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.4 end call $~lib/map/Map#find local.set $3 @@ -7857,7 +11168,6 @@ i32.gt_u select i32.ge_u - local.tee $5 if (result i32) local.get $0 i32.load offset=20 @@ -7869,7 +11179,7 @@ i32.trunc_f64_s i32.lt_s else - local.get $5 + i32.const 0 end if local.get $0 @@ -7878,7 +11188,7 @@ end i32.const 1 ) - (func $std/map/test (; 101 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 121 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 f32) i32.const 0 @@ -7893,56 +11203,54 @@ f32.lt i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 8 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 10 - local.get $1 - i32.trunc_f32_s - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 10 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.trunc_f32_s - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 11 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.trunc_f32_s + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.trunc_f32_s + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 9 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 f32.const 1 @@ -7960,10 +11268,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 13 + i32.const 376 + i32.const 11 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|1 @@ -7975,72 +11283,70 @@ f32.lt i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 17 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.trunc_f32_s - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 18 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 20 - local.get $1 - i32.trunc_f32_s - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 20 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.trunc_f32_s - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 21 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 15 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.trunc_f32_s + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 16 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 20 + local.get $1 + i32.trunc_f32_s + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 18 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.trunc_f32_s + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 19 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 f32.const 1 @@ -8058,10 +11364,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 23 + i32.const 376 + i32.const 21 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|2 @@ -8073,53 +11379,51 @@ f32.lt i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 27 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.trunc_f32_s - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 28 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 30 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 25 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.trunc_f32_s + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 26 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 28 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 f32.const 1 @@ -8137,10 +11441,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 32 + i32.const 376 + i32.const 30 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|3 @@ -8152,56 +11456,54 @@ f32.lt i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 36 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 10 - local.get $1 - i32.trunc_f32_s - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 38 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 40 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 34 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.trunc_f32_s + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 36 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 38 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 f32.const 1 @@ -8219,10 +11521,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -8234,19 +11536,30 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 46 + i32.const 376 + i32.const 44 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - ) - (func $~lib/map/Map#clear (; 102 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 - i32.const 0 - i32.const 16 - i32.const 0 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.get $0 + call $~lib/rt/pure/__release + ) + (func $~lib/map/Map#clear (; 122 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + local.tee $1 + block (result i32) + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $2 + local.get $1 + i32.load + call $~lib/rt/pure/__release + local.get $2 + end i32.store local.get $0 i32.const 4 @@ -8254,10 +11567,17 @@ i32.sub i32.store offset=4 local.get $0 - i32.const 0 - i32.const 64 - i32.const 1 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $2 + block (result i32) + i32.const 0 + i32.const 64 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 + local.get $2 + i32.load offset=8 + call $~lib/rt/pure/__release + local.get $1 + end i32.store offset=8 local.get $0 i32.const 4 @@ -8269,13 +11589,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 103 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#constructor (; 123 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/memory/memory.allocate + i32.const 12 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.set $0 end local.get $0 @@ -8301,9 +11623,8 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/map/Map#find (; 104 ;) (type $FUNCSIG$iidi) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 124 ;) (type $FUNCSIG$iidi) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) (local $3 i32) - (local $4 i32) local.get $0 i32.load local.get $2 @@ -8313,62 +11634,59 @@ i32.const 4 i32.mul i32.add - i32.load offset=8 + i32.load local.set $3 block $break|0 loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=12 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=12 - i32.const 1 - i32.and - i32.eqz - local.tee $4 - if (result i32) - local.get $3 - f64.load - local.get $1 - f64.eq - else - local.get $4 - end - if - local.get $3 - return - end + f64.load + local.get $1 + f64.eq + else + i32.const 0 + end + if local.get $3 - i32.load offset=12 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + return end + local.get $3 + i32.load offset=12 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/map/Map#has (; 105 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/map/Map#has (; 125 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) (local $2 f64) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.0 (result i32) + block $~lib/util/hash/HASH|inlined.0 (result i32) local.get $1 local.set $2 local.get $2 i64.reinterpret_f64 - call $~lib/internal/hash/hash64 - br $~lib/internal/hash/HASH|inlined.0 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.0 end call $~lib/map/Map#find i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 106 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 126 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -8389,7 +11707,6 @@ local.get $2 i32.const 4 i32.mul - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $2 @@ -8404,13 +11721,10 @@ i32.const 16 end i32.mul - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $5 local.get $0 i32.load offset=8 - i32.const 8 - i32.add local.set $6 local.get $6 local.get $0 @@ -8422,8 +11736,6 @@ i32.add local.set $7 local.get $5 - i32.const 8 - i32.add local.set $8 block $break|0 loop $continue|0 @@ -8431,76 +11743,106 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=12 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=12 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + f64.load + f64.store + local.get $10 + local.get $9 + i32.load offset=8 + i32.store offset=8 + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 f64.load - f64.store - local.get $10 - local.get $9 - i32.load offset=8 - i32.store offset=8 - block $~lib/internal/hash/HASH|inlined.2 (result i32) - local.get $9 - f64.load - local.set $11 - local.get $11 - i64.reinterpret_f64 - call $~lib/internal/hash/hash64 - br $~lib/internal/hash/HASH|inlined.2 - end - local.get $1 - i32.and - local.set $12 - local.get $3 - local.get $12 - i32.const 4 - i32.mul - i32.add - local.set $13 - local.get $10 - local.get $13 - i32.load offset=8 - i32.store offset=12 - local.get $13 - local.get $8 - i32.store offset=8 - local.get $8 - block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) - i32.const 16 - end - i32.add - local.set $8 + local.set $11 + local.get $11 + i64.reinterpret_f64 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $12 + local.get $3 + local.get $12 + i32.const 4 + i32.mul + i32.add + local.set $13 + local.get $10 + local.get $13 + i32.load + i32.store offset=12 + local.get $13 + local.get $8 + i32.store + local.get $8 + block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) i32.const 16 end i32.add - local.set $6 + local.set $8 + end + local.get $6 + block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + i32.const 16 end + i32.add + local.set $6 br $continue|0 end end end local.get $0 - local.get $3 + local.tee $9 + block (result i32) + local.get $3 + local.tee $10 + local.get $9 + i32.load + local.tee $9 + i32.ne + if + local.get $10 + call $~lib/rt/pure/__retain + drop + local.get $9 + call $~lib/rt/pure/__release + end + local.get $10 + end i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $5 + local.tee $10 + block (result i32) + local.get $5 + local.tee $12 + local.get $10 + i32.load offset=8 + local.tee $10 + i32.ne + if + local.get $12 + call $~lib/rt/pure/__retain + drop + local.get $10 + call $~lib/rt/pure/__release + end + local.get $12 + end i32.store offset=8 local.get $0 local.get $4 @@ -8509,20 +11851,24 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release ) - (func $~lib/map/Map#set (; 107 ;) (type $FUNCSIG$vidi) (param $0 i32) (param $1 f64) (param $2 i32) + (func $~lib/map/Map#set (; 127 ;) (type $FUNCSIG$vidi) (param $0 i32) (param $1 f64) (param $2 i32) (local $3 f64) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - block $~lib/internal/hash/HASH|inlined.1 (result i32) + block $~lib/util/hash/HASH|inlined.1 (result i32) local.get $1 local.set $3 local.get $3 i64.reinterpret_f64 - call $~lib/internal/hash/hash64 - br $~lib/internal/hash/HASH|inlined.1 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.1 end local.set $4 local.get $0 @@ -8567,10 +11913,9 @@ end local.get $0 i32.load offset=8 + call $~lib/rt/pure/__retain local.set $6 local.get $6 - i32.const 8 - i32.add block (result i32) local.get $0 local.get $0 @@ -8611,25 +11956,27 @@ local.set $7 local.get $5 local.get $7 - i32.load offset=8 + i32.load i32.store offset=12 local.get $7 local.get $5 - i32.store offset=8 + i32.store + local.get $6 + call $~lib/rt/pure/__release end ) - (func $~lib/map/Map#get (; 108 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/map/Map#get (; 128 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) (local $2 f64) (local $3 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.3 (result i32) + block $~lib/util/hash/HASH|inlined.3 (result i32) local.get $1 local.set $2 local.get $2 i64.reinterpret_f64 - call $~lib/internal/hash/hash64 - br $~lib/internal/hash/HASH|inlined.3 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.3 end call $~lib/map/Map#find local.set $3 @@ -8641,11 +11988,11 @@ unreachable end ) - (func $~lib/map/Map#get:size (; 109 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#get:size (; 129 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/map/Map#delete (; 110 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/map/Map#delete (; 130 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) (local $2 f64) (local $3 i32) (local $4 i32) @@ -8653,13 +12000,13 @@ (local $6 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.4 (result i32) + block $~lib/util/hash/HASH|inlined.4 (result i32) local.get $1 local.set $2 local.get $2 i64.reinterpret_f64 - call $~lib/internal/hash/hash64 - br $~lib/internal/hash/HASH|inlined.4 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.4 end call $~lib/map/Map#find local.set $3 @@ -8699,7 +12046,6 @@ i32.gt_u select i32.ge_u - local.tee $5 if (result i32) local.get $0 i32.load offset=20 @@ -8711,7 +12057,7 @@ i32.trunc_f64_s i32.lt_s else - local.get $5 + i32.const 0 end if local.get $0 @@ -8720,7 +12066,7 @@ end i32.const 1 ) - (func $std/map/test (; 111 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 131 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 f64) i32.const 0 @@ -8734,371 +12080,1004 @@ f64.const 100 f64.lt i32.eqz - br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 8 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 10 - local.get $1 - i32.trunc_f64_s - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 10 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.trunc_f64_s - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 11 - i32.const 4 - call $~lib/env/abort - unreachable - end + br_if $break|0 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.trunc_f64_s + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.trunc_f64_s + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 9 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $1 + f64.const 1 + f64.add + local.set $1 + br $repeat|0 + unreachable + end + unreachable + end + local.get $0 + call $~lib/map/Map#get:size + i32.const 100 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 11 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block $break|1 + f64.const 0 + local.set $1 + loop $repeat|1 + local.get $1 + f64.const 100 + f64.lt + i32.eqz + br_if $break|1 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 15 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.trunc_f64_s + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 16 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 20 + local.get $1 + i32.trunc_f64_s + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 18 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.trunc_f64_s + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 19 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $1 + f64.const 1 + f64.add + local.set $1 + br $repeat|1 + unreachable + end + unreachable + end + local.get $0 + call $~lib/map/Map#get:size + i32.const 100 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 21 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block $break|2 + f64.const 0 + local.set $1 + loop $repeat|2 + local.get $1 + f64.const 50 + f64.lt + i32.eqz + br_if $break|2 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 25 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#get + i32.const 20 + local.get $1 + i32.trunc_f64_s + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 26 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 28 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 f64.const 1 f64.add local.set $1 - br $repeat|0 + br $repeat|2 unreachable end unreachable end local.get $0 call $~lib/map/Map#get:size - i32.const 100 + i32.const 50 i32.eq i32.eqz if i32.const 0 - i32.const 120 - i32.const 13 + i32.const 376 + i32.const 30 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $break|1 + block $break|3 f64.const 0 local.set $1 - loop $repeat|1 + loop $repeat|3 local.get $1 - f64.const 100 + f64.const 50 f64.lt i32.eqz - br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 17 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.trunc_f64_s - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 18 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 20 - local.get $1 - i32.trunc_f64_s - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 20 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.trunc_f64_s - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 21 - i32.const 4 - call $~lib/env/abort - unreachable - end + br_if $break|3 + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 34 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 10 + local.get $1 + i32.trunc_f64_s + i32.add + call $~lib/map/Map#set + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 36 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/map/Map#delete + drop + local.get $0 + local.get $1 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 38 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 f64.const 1 f64.add local.set $1 - br $repeat|1 + br $repeat|3 unreachable end unreachable end local.get $0 call $~lib/map/Map#get:size - i32.const 100 + i32.const 50 i32.eq i32.eqz if i32.const 0 - i32.const 120 - i32.const 23 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $break|2 - f64.const 0 - local.set $1 - loop $repeat|2 + local.get $0 + call $~lib/map/Map#clear + local.get $0 + call $~lib/map/Map#get:size + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 44 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/pure/__release + ) + (func $start:std/map (; 132 ;) (type $FUNCSIG$v) + call $std/map/testNumeric + call $std/map/testNumeric + call $std/map/testNumeric + call $std/map/testNumeric + call $std/map/testNumeric + call $std/map/testNumeric + call $std/map/testNumeric + call $std/map/testNumeric + call $std/map/testNumeric + call $std/map/testNumeric + ) + (func $start (; 133 ;) (type $FUNCSIG$v) + call $start:std/map + ) + (func $~lib/rt/pure/markGray (; 134 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members + end + ) + (func $~lib/rt/pure/scanBlack (; 135 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 136 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 local.get $1 - f64.const 50 - f64.lt - i32.eqz - br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 27 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 20 - local.get $1 - i32.trunc_f64_s - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 28 - i32.const 4 - call $~lib/env/abort + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (; 137 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + ) + (func $~lib/rt/pure/__visit (; 138 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/pure/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 75 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/pure/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/scan + br $break|0 + unreachable + end unreachable end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 86 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and i32.const 0 - i32.const 120 - i32.const 30 - i32.const 4 - call $~lib/env/abort + i32.ne + if + local.get $2 + call $~lib/rt/pure/scanBlack + end + br $break|0 unreachable end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/collectWhite + br $break|0 + unreachable end - local.get $1 - f64.const 1 - f64.add - local.set $1 - br $repeat|2 unreachable end - unreachable - end - local.get $0 - call $~lib/map/Map#get:size - i32.const 50 - i32.eq - i32.eqz - if i32.const 0 - i32.const 120 - i32.const 32 - i32.const 2 - call $~lib/env/abort - unreachable + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 97 + i32.const 24 + call $~lib/builtins/abort + unreachable + end end - block $break|3 - f64.const 0 - local.set $1 - loop $repeat|3 - local.get $1 - f64.const 50 - f64.lt - i32.eqz - br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 36 - i32.const 4 - call $~lib/env/abort + ) + (func $~lib/map/Map#__visit_impl (; 139 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/pure/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + ) + (func $~lib/map/Map#__visit_impl (; 140 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/pure/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + ) + (func $~lib/map/Map#__visit_impl (; 141 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/pure/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + ) + (func $~lib/map/Map#__visit_impl (; 142 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/pure/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + ) + (func $~lib/map/Map#__visit_impl (; 143 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/pure/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + ) + (func $~lib/map/Map#__visit_impl (; 144 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/pure/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + ) + (func $~lib/map/Map#__visit_impl (; 145 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/pure/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + ) + (func $~lib/map/Map#__visit_impl (; 146 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/pure/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + ) + (func $~lib/map/Map#__visit_impl (; 147 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/pure/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + ) + (func $~lib/map/Map#__visit_impl (; 148 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/pure/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + ) + (func $~lib/rt/__visit_members (; 149 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block + end + block $switch$1$leave + block $switch$1$default + block $switch$1$case$14 + block $switch$1$case$13 + block $switch$1$case$12 + block $switch$1$case$11 + block $switch$1$case$10 + block $switch$1$case$9 + block $switch$1$case$8 + block $switch$1$case$7 + block $switch$1$case$6 + block $switch$1$case$5 + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$case$5 $switch$1$case$6 $switch$1$case$7 $switch$1$case$8 $switch$1$case$9 $switch$1$case$10 $switch$1$case$11 $switch$1$case$12 $switch$1$case$13 $switch$1$case$14 $switch$1$default + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/map/Map#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/map/Map#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/map/Map#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/map/Map#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/map/Map#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/map/Map#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/map/Map#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/map/Map#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end unreachable end - local.get $0 - local.get $1 - i32.const 10 - local.get $1 - i32.trunc_f64_s - i32.add - call $~lib/map/Map#set - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 38 - i32.const 4 - call $~lib/env/abort + block + block + block + local.get $0 + local.get $1 + call $~lib/map/Map#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable unreachable end - local.get $0 - local.get $1 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 40 - i32.const 4 - call $~lib/env/abort + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/map/Map#__visit_impl + return + unreachable + end + unreachable unreachable end + unreachable + unreachable end - local.get $1 - f64.const 1 - f64.add - local.set $1 - br $repeat|3 + unreachable + end + block + block + unreachable + unreachable + end + unreachable unreachable end unreachable end - local.get $0 - call $~lib/map/Map#get:size - i32.const 50 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 42 - i32.const 2 - call $~lib/env/abort - unreachable - end - local.get $0 - call $~lib/map/Map#clear - local.get $0 - call $~lib/map/Map#get:size - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 46 - i32.const 2 - call $~lib/env/abort - unreachable - end - ) - (func $start:std/map (; 112 ;) (type $FUNCSIG$v) - call $start:~lib/allocator/arena - call $std/map/test - call $std/map/test - call $std/map/test - call $std/map/test - call $std/map/test - call $std/map/test - call $std/map/test - call $std/map/test - call $std/map/test - call $std/map/test - ) - (func $start (; 113 ;) (type $FUNCSIG$v) - call $start:std/map ) - (func $null (; 114 ;) (type $FUNCSIG$v) + (func $null (; 150 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/std/math.json b/tests/compiler/std/math.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/std/math.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/std/math.optimized.wat b/tests/compiler/std/math.optimized.wat index 737bcdcc77..8905543d11 100644 --- a/tests/compiler/std/math.optimized.wat +++ b/tests/compiler/std/math.optimized.wat @@ -1,7 +1,9 @@ (module (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$id (func (param f64) (result i32))) (type $FUNCSIG$dddd (func (param f64 f64 f64) (result f64))) (type $FUNCSIG$ddi (func (param f64 i32) (result f64))) + (type $FUNCSIG$if (func (param f32) (result i32))) (type $FUNCSIG$ffff (func (param f32 f32 f32) (result f32))) (type $FUNCSIG$ffi (func (param f32 i32) (result f32))) (type $FUNCSIG$dd (func (param f64) (result f64))) @@ -10,6 +12,7 @@ (type $FUNCSIG$fff (func (param f32 f32) (result f32))) (type $FUNCSIG$d (func (result f64))) (type $FUNCSIG$vj (func (param i64))) + (type $FUNCSIG$jj (func (param i64) (result i64))) (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$f (func (result f32))) (type $FUNCSIG$jji (func (param i64 i32) (result i64))) @@ -22,6 +25,7 @@ (type $FUNCSIG$iff (func (param f32 f32) (result i32))) (type $FUNCSIG$idddd (func (param f64 f64 f64 f64) (result i32))) (type $FUNCSIG$iffff (func (param f32 f32 f32 f32) (result i32))) + (type $FUNCSIG$ji (func (param i32) (result i64))) (import "Math" "E" (global $~lib/bindings/Math/E f64)) (import "Math" "LN2" (global $~lib/bindings/Math/LN2 f64)) (import "Math" "LN10" (global $~lib/bindings/Math/LN10 f64)) @@ -29,7 +33,7 @@ (import "Math" "PI" (global $~lib/bindings/Math/PI f64)) (import "Math" "SQRT1_2" (global $~lib/bindings/Math/SQRT1_2 f64)) (import "Math" "SQRT2" (global $~lib/bindings/Math/SQRT2 f64)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (import "Math" "abs" (func $~lib/bindings/Math/abs (param f64) (result f64))) (import "Math" "acos" (func $~lib/bindings/Math/acos (param f64) (result f64))) (import "Math" "acosh" (func $~lib/bindings/Math/acosh (param f64) (result f64))) @@ -60,12 +64,11 @@ (import "Math" "tanh" (func $~lib/bindings/Math/tanh (param f64) (result f64))) (import "Math" "trunc" (func $~lib/bindings/Math/trunc (param f64) (result f64))) (memory $0 1) - (data (i32.const 8) "\0b\00\00\00s\00t\00d\00/\00m\00a\00t\00h\00.\00t\00s") - (data (i32.const 40) " \00\00\00\00\00\00\00)\15DNn\83\f9\a2\c0\dd4\f5\d1W\'\fcA\90C<\99\95b\dba\c5\bb\de\abcQ\fe") - (data (i32.const 104) "(\00\00\00\04") - (data (i32.const 112) "\0c\00\00\00~\00l\00i\00b\00/\00m\00a\00t\00h\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $null) + (data (i32.const 8) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00s\00t\00d\00/\00m\00a\00t\00h\00.\00t\00s") + (data (i32.const 48) " \00\00\00\01\00\00\00\00\00\00\00 \00\00\00)\15DNn\83\f9\a2\c0\dd4\f5\d1W\'\fcA\90C<\99\95b\dba\c5\bb\de\abcQ\fe") + (data (i32.const 96) "\10\00\00\00\01\00\00\00\03\00\00\00\10\00\00\00@\00\00\00@\00\00\00 \00\00\00\04") + (data (i32.const 128) "\18\00\00\00\01\00\00\00\01\00\00\00\18\00\00\00~\00l\00i\00b\00/\00m\00a\00t\00h\00.\00t\00s") + (data (i32.const 168) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00P\00R\00N\00G\00 \00m\00u\00s\00t\00 \00b\00e\00 \00s\00e\00e\00d\00e\00d\00.") (global $~lib/math/rempio2f_y (mut f64) (f64.const 0)) (global $~lib/math/random_seeded (mut i32) (i32.const 0)) (global $~lib/math/random_state0_64 (mut i64) (i64.const 0)) @@ -73,9 +76,20 @@ (global $~lib/math/random_state0_32 (mut i32) (i32.const 0)) (global $~lib/math/random_state1_32 (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) - (func $~lib/math/NativeMath.scalbn (; 30 ;) (type $FUNCSIG$ddi) (param $0 f64) (param $1 i32) (result f64) + (func $~lib/builtins/isNaN (; 30 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + local.get $0 + f64.ne + ) + (func $~lib/builtins/isFinite (; 31 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + local.get $0 + f64.sub + f64.const 0 + f64.eq + ) + (func $~lib/math/NativeMath.scalbn (; 32 ;) (type $FUNCSIG$ddi) (param $0 f64) (param $1 i32) (result f64) local.get $1 i32.const 1023 i32.gt_s @@ -152,20 +166,16 @@ f64.reinterpret_i64 f64.mul ) - (func $std/math/ulperr (; 31 ;) (type $FUNCSIG$dddd) (param $0 f64) (param $1 f64) (param $2 f64) (result f64) + (func $std/math/ulperr (; 33 ;) (type $FUNCSIG$dddd) (param $0 f64) (param $1 f64) (param $2 f64) (result f64) (local $3 i32) - (local $4 i32) - local.get $0 local.get $0 - f64.ne - local.tee $4 - local.set $3 - local.get $1 - local.get $1 - f64.ne - local.get $3 - local.get $4 - select + call $~lib/builtins/isNaN + if (result i32) + local.get $1 + call $~lib/builtins/isNaN + else + i32.const 0 + end if f64.const 0 return @@ -205,10 +215,8 @@ return end local.get $0 - local.get $0 - f64.sub - f64.const 0 - f64.ne + call $~lib/builtins/isFinite + i32.eqz if local.get $1 f64.const 0.5 @@ -248,7 +256,7 @@ local.get $2 f64.add ) - (func $std/math/check (; 32 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/check (; 34 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 local.get $1 f64.eq @@ -257,12 +265,10 @@ return end local.get $1 - local.get $1 - f64.ne + call $~lib/builtins/isNaN if local.get $0 - local.get $0 - f64.ne + call $~lib/builtins/isNaN return end local.get $0 @@ -278,7 +284,12 @@ end i32.const 1 ) - (func $~lib/math/NativeMathf.scalbn (; 33 ;) (type $FUNCSIG$ffi) (param $0 f32) (param $1 i32) (result f32) + (func $~lib/builtins/isNaN (; 35 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) + local.get $0 + local.get $0 + f32.ne + ) + (func $~lib/math/NativeMathf.scalbn (; 36 ;) (type $FUNCSIG$ffi) (param $0 f32) (param $1 i32) (result f32) local.get $1 i32.const 127 i32.gt_s @@ -354,20 +365,16 @@ f32.reinterpret_i32 f32.mul ) - (func $std/math/ulperrf (; 34 ;) (type $FUNCSIG$ffff) (param $0 f32) (param $1 f32) (param $2 f32) (result f32) + (func $std/math/ulperrf (; 37 ;) (type $FUNCSIG$ffff) (param $0 f32) (param $1 f32) (param $2 f32) (result f32) (local $3 i32) - (local $4 i32) - local.get $0 local.get $0 - f32.ne - local.tee $4 - local.set $3 - local.get $1 - local.get $1 - f32.ne - local.get $3 - local.get $4 - select + call $~lib/builtins/isNaN + if (result i32) + local.get $1 + call $~lib/builtins/isNaN + else + i32.const 0 + end if f32.const 0 return @@ -447,7 +454,7 @@ local.get $2 f32.add ) - (func $std/math/check (; 35 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/check (; 38 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 local.get $1 f32.eq @@ -456,12 +463,10 @@ return end local.get $1 - local.get $1 - f32.ne + call $~lib/builtins/isNaN if local.get $0 - local.get $0 - f32.ne + call $~lib/builtins/isNaN return end local.get $0 @@ -477,7 +482,7 @@ end i32.const 1 ) - (func $std/math/test_scalbn (; 36 ;) (type $FUNCSIG$idid) (param $0 f64) (param $1 i32) (param $2 f64) (result i32) + (func $std/math/test_scalbn (; 39 ;) (type $FUNCSIG$idid) (param $0 f64) (param $1 i32) (param $2 f64) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMath.scalbn @@ -485,7 +490,7 @@ f64.const 0 call $std/math/check ) - (func $std/math/test_scalbnf (; 37 ;) (type $FUNCSIG$ifif) (param $0 f32) (param $1 i32) (param $2 f32) (result i32) + (func $std/math/test_scalbnf (; 40 ;) (type $FUNCSIG$ifif) (param $0 f32) (param $1 i32) (param $2 f32) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMathf.scalbn @@ -493,32 +498,30 @@ f32.const 0 call $std/math/check ) - (func $std/math/test_abs (; 38 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) - (local $2 i32) + (func $std/math/test_abs (; 41 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) local.get $0 f64.abs local.get $1 f64.const 0 call $std/math/check - local.tee $2 - if + if (result i32) local.get $0 call $~lib/bindings/Math/abs local.get $1 f64.const 0 call $std/math/check - local.set $2 + else + i32.const 0 end - local.get $2 ) - (func $std/math/test_absf (; 39 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) + (func $std/math/test_absf (; 42 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) local.get $0 f32.abs local.get $1 f32.const 0 call $std/math/check ) - (func $~lib/math/R (; 40 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/R (; 43 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 f64.const 0.16666666666666666 local.get $0 @@ -561,7 +564,7 @@ f64.add f64.div ) - (func $~lib/math/NativeMath.acos (; 41 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.acos (; 44 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) (local $3 i32) @@ -685,25 +688,42 @@ f64.add f64.mul ) - (func $std/math/test_acos (; 42 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) - (local $3 i32) + (func $std/math/test_acos (; 45 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.acos local.get $1 local.get $2 call $std/math/check - local.tee $3 - if + if (result i32) local.get $0 call $~lib/bindings/Math/acos local.get $1 local.get $2 call $std/math/check - local.set $3 + else + i32.const 0 end - local.get $3 ) - (func $~lib/math/NativeMathf.acos (; 43 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/Rf (; 46 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + f32.const 0.16666586697101593 + local.get $0 + f32.const -0.04274342209100723 + local.get $0 + f32.const -0.008656363002955914 + f32.mul + f32.add + f32.mul + f32.add + f32.mul + f32.const 1 + local.get $0 + f32.const -0.7066296339035034 + f32.mul + f32.add + f32.div + ) + (func $~lib/math/NativeMathf.acos (; 47 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 f32) (local $2 i32) (local $3 i32) @@ -756,23 +776,7 @@ local.get $0 local.get $0 f32.mul - local.tee $0 - f32.const 0.16666586697101593 - local.get $0 - f32.const -0.04274342209100723 - local.get $0 - f32.const -0.008656363002955914 - f32.mul - f32.add - f32.mul - f32.add - f32.mul - f32.const 1 - local.get $0 - f32.const -0.7066296339035034 - f32.mul - f32.add - f32.div + call $~lib/math/Rf f32.mul f32.sub f32.sub @@ -783,36 +787,19 @@ i32.const 31 i32.shr_u if + f32.const 2 + f32.const 1.570796251296997 f32.const 0.5 local.get $0 f32.const 0.5 f32.mul f32.add local.tee $0 - f32.const 0.16666586697101593 - local.get $0 - f32.const -0.04274342209100723 - local.get $0 - f32.const -0.008656363002955914 - f32.mul - f32.add - f32.mul - f32.add - f32.mul - f32.const 1 - local.get $0 - f32.const -0.7066296339035034 - f32.mul - f32.add - f32.div - local.set $1 - f32.const 2 - f32.const 1.570796251296997 - local.get $0 f32.sqrt - local.tee $0 - local.get $1 + local.tee $1 local.get $0 + call $~lib/math/Rf + local.get $1 f32.mul f32.const 7.549789415861596e-08 f32.sub @@ -827,83 +814,65 @@ f32.const 0.5 f32.mul f32.sub - local.tee $0 + local.tee $1 f32.sqrt local.tee $4 i32.reinterpret_f32 i32.const -4096 i32.and f32.reinterpret_i32 - local.tee $1 - local.get $0 - f32.const 0.16666586697101593 - local.get $0 - f32.const -0.04274342209100723 - local.get $0 - f32.const -0.008656363002955914 - f32.mul - f32.add - f32.mul - f32.add - f32.mul - f32.const 1 - local.get $0 - f32.const -0.7066296339035034 - f32.mul - f32.add - f32.div + local.tee $0 + local.get $1 + call $~lib/math/Rf local.get $4 f32.mul - local.get $0 - local.get $1 local.get $1 + local.get $0 + local.get $0 f32.mul f32.sub local.get $4 - local.get $1 + local.get $0 f32.add f32.div f32.add f32.add f32.mul ) - (func $std/math/test_acosf (; 44 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_acosf (; 48 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.acos local.get $1 local.get $2 call $std/math/check ) - (func $~lib/math/NativeMath.log1p (; 45 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.log1p (; 49 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) (local $3 i32) - (local $4 i32) + (local $4 f64) (local $5 f64) - (local $6 f64) - (local $7 i64) - (local $8 f64) + (local $6 i64) + (local $7 f64) i32.const 1 - local.set $2 + local.set $3 local.get $0 i64.reinterpret_f64 i64.const 32 i64.shr_u i32.wrap_i64 - local.tee $3 + local.tee $2 i32.const 1071284858 i32.lt_u - local.tee $4 - i32.eqz - if - local.get $3 + if (result i32) + i32.const 1 + else + local.get $2 i32.const 31 i32.shr_u - local.set $4 end - local.get $4 if - local.get $3 + local.get $2 i32.const -1074790400 i32.ge_u if @@ -923,7 +892,7 @@ f64.div return end - local.get $3 + local.get $2 i32.const 1 i32.shl i32.const 2034237440 @@ -932,17 +901,17 @@ local.get $0 return end - local.get $3 + local.get $2 i32.const -1076707644 i32.le_u if i32.const 0 - local.set $2 + local.set $3 local.get $0 local.set $1 end else - local.get $3 + local.get $2 i32.const 2146435072 i32.ge_u if @@ -950,28 +919,28 @@ return end end - local.get $2 + local.get $3 if f64.const 1 local.get $0 f64.add i64.reinterpret_f64 - local.tee $7 + local.tee $6 i64.const 32 i64.shr_u i32.wrap_i64 i32.const 614242 i32.add - local.tee $4 + local.tee $2 i32.const 20 i32.shr_u i32.const 1023 i32.sub - local.tee $2 + local.tee $3 i32.const 54 i32.lt_s if (result f64) - local.get $7 + local.get $6 f64.reinterpret_i64 local.set $1 f64.const 1 @@ -984,7 +953,7 @@ f64.const 1 f64.sub f64.sub - local.get $2 + local.get $3 i32.const 2 i32.ge_s select @@ -993,11 +962,11 @@ else f64.const 0 end - local.set $6 - local.get $7 + local.set $5 + local.get $6 i64.const 4294967295 i64.and - local.get $4 + local.get $2 i32.const 1048575 i32.and i32.const 1072079006 @@ -1016,21 +985,21 @@ local.get $1 f64.add f64.div - local.tee $5 - local.get $5 + local.tee $4 + local.get $4 f64.mul - local.tee $8 - local.get $8 + local.tee $7 + local.get $7 f64.mul local.set $0 - local.get $5 + local.get $4 f64.const 0.5 local.get $1 f64.mul local.get $1 f64.mul - local.tee $5 - local.get $8 + local.tee $4 + local.get $7 f64.const 0.6666666666666735 local.get $0 f64.const 0.2857142874366239 @@ -1059,15 +1028,15 @@ f64.add f64.add f64.mul - local.get $2 + local.get $3 f64.convert_i32_s local.tee $0 f64.const 1.9082149292705877e-10 f64.mul - local.get $6 + local.get $5 f64.add f64.add - local.get $5 + local.get $4 f64.sub local.get $1 f64.add @@ -1076,34 +1045,31 @@ f64.mul f64.add ) - (func $~lib/math/NativeMath.log (; 46 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.log (; 50 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i32) - (local $2 i32) - (local $3 i64) + (local $2 i64) + (local $3 f64) (local $4 f64) - (local $5 f64) - (local $6 i32) - (local $7 f64) + (local $5 i32) + (local $6 f64) local.get $0 i64.reinterpret_f64 - local.tee $3 + local.tee $2 i64.const 32 i64.shr_u i32.wrap_i64 - local.tee $2 + local.tee $1 i32.const 1048576 i32.lt_u - local.tee $1 - i32.eqz - if - local.get $2 + if (result i32) + i32.const 1 + else + local.get $1 i32.const 31 i32.shr_u - local.set $1 end - local.get $1 if - local.get $3 + local.get $2 i64.const 1 i64.shl i64.const 0 @@ -1116,7 +1082,7 @@ f64.div return end - local.get $2 + local.get $1 i32.const 31 i32.shr_u if @@ -1128,18 +1094,18 @@ return end i32.const -54 - local.set $6 + local.set $5 local.get $0 f64.const 18014398509481984 f64.mul i64.reinterpret_f64 - local.tee $3 + local.tee $2 i64.const 32 i64.shr_u i32.wrap_i64 - local.set $2 + local.set $1 else - local.get $2 + local.get $1 i32.const 2146435072 i32.ge_u if @@ -1147,28 +1113,25 @@ return else local.get $2 + i64.const 32 + i64.shl + i64.const 0 + i64.eq + i32.const 0 + local.get $1 i32.const 1072693248 i32.eq - local.tee $1 - if - local.get $3 - i64.const 32 - i64.shl - i64.const 0 - i64.eq - local.set $1 - end - local.get $1 + select if f64.const 0 return end end end - local.get $3 + local.get $2 i64.const 4294967295 i64.and - local.get $2 + local.get $1 i32.const 614242 i32.add local.tee $1 @@ -1183,26 +1146,26 @@ f64.reinterpret_i64 f64.const 1 f64.sub - local.tee $4 + local.tee $3 f64.const 2 - local.get $4 + local.get $3 f64.add f64.div - local.tee $5 - local.get $5 + local.tee $4 + local.get $4 f64.mul - local.tee $7 - local.get $7 + local.tee $6 + local.get $6 f64.mul local.set $0 - local.get $5 - f64.const 0.5 local.get $4 + f64.const 0.5 + local.get $3 f64.mul - local.get $4 + local.get $3 f64.mul - local.tee $5 - local.get $7 + local.tee $4 + local.get $6 f64.const 0.6666666666666735 local.get $0 f64.const 0.2857142874366239 @@ -1236,23 +1199,24 @@ i32.shr_s i32.const 1023 i32.sub - local.get $6 + local.get $5 i32.add + local.tee $1 f64.convert_i32_s - local.tee $0 f64.const 1.9082149292705877e-10 f64.mul f64.add - local.get $5 - f64.sub local.get $4 + f64.sub + local.get $3 f64.add - local.get $0 + local.get $1 + f64.convert_i32_s f64.const 0.6931471803691238 f64.mul f64.add ) - (func $~lib/math/NativeMath.acosh (; 47 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.acosh (; 51 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i64) local.get $0 i64.reinterpret_f64 @@ -1306,50 +1270,45 @@ f64.const 0.6931471805599453 f64.add ) - (func $std/math/test_acosh (; 48 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) - (local $3 i32) + (func $std/math/test_acosh (; 52 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.acosh local.get $1 local.get $2 call $std/math/check - local.tee $3 - if + if (result i32) local.get $0 call $~lib/bindings/Math/acosh local.get $1 local.get $2 call $std/math/check - local.set $3 + else + i32.const 0 end - local.get $3 ) - (func $~lib/math/NativeMathf.log1p (; 49 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.log1p (; 53 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 f32) (local $2 i32) (local $3 i32) - (local $4 i32) + (local $4 f32) (local $5 f32) (local $6 f32) - (local $7 f32) i32.const 1 - local.set $2 + local.set $3 local.get $0 i32.reinterpret_f32 - local.tee $3 + local.tee $2 i32.const 1054086096 i32.lt_u - local.tee $4 - i32.eqz - if - local.get $3 + if (result i32) + i32.const 1 + else + local.get $2 i32.const 31 i32.shr_u - local.set $4 end - local.get $4 if - local.get $3 + local.get $2 i32.const -1082130432 i32.ge_u if @@ -1369,7 +1328,7 @@ f32.div return end - local.get $3 + local.get $2 i32.const 1 i32.shl i32.const 1728053248 @@ -1378,17 +1337,17 @@ local.get $0 return end - local.get $3 + local.get $2 i32.const -1097468391 i32.le_u if i32.const 0 - local.set $2 + local.set $3 local.get $0 local.set $1 end else - local.get $3 + local.get $2 i32.const 2139095040 i32.ge_u if @@ -1396,7 +1355,7 @@ return end end - local.get $2 + local.get $3 if f32.const 1 local.get $0 @@ -1405,12 +1364,12 @@ i32.reinterpret_f32 i32.const 4913933 i32.add - local.tee $4 + local.tee $2 i32.const 23 i32.shr_u i32.const 127 i32.sub - local.tee $2 + local.tee $3 i32.const 25 i32.lt_s if (result f32) @@ -1424,7 +1383,7 @@ f32.const 1 f32.sub f32.sub - local.get $2 + local.get $3 i32.const 2 i32.ge_s select @@ -1433,8 +1392,8 @@ else f32.const 0 end - local.set $6 - local.get $4 + local.set $5 + local.get $2 i32.const 8388607 i32.and i32.const 1060439283 @@ -1449,21 +1408,21 @@ local.get $1 f32.add f32.div - local.tee $5 - local.get $5 + local.tee $4 + local.get $4 f32.mul - local.tee $7 - local.get $7 + local.tee $6 + local.get $6 f32.mul local.set $0 - local.get $5 + local.get $4 f32.const 0.5 local.get $1 f32.mul local.get $1 f32.mul - local.tee $5 - local.get $7 + local.tee $4 + local.get $6 f32.const 0.6666666269302368 local.get $0 f32.const 0.2849878668785095 @@ -1480,15 +1439,15 @@ f32.add f32.add f32.mul - local.get $2 + local.get $3 f32.convert_i32_s local.tee $0 f32.const 9.05800061445916e-06 f32.mul - local.get $6 + local.get $5 f32.add f32.add - local.get $5 + local.get $4 f32.sub local.get $1 f32.add @@ -1497,27 +1456,24 @@ f32.mul f32.add ) - (func $~lib/math/NativeMathf.log (; 50 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.log (; 54 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 i32) (local $2 f32) - (local $3 i32) - (local $4 f32) - (local $5 i32) - (local $6 f32) + (local $3 f32) + (local $4 i32) + (local $5 f32) local.get $0 i32.reinterpret_f32 local.tee $1 i32.const 8388608 i32.lt_u - local.tee $3 - i32.eqz - if + if (result i32) + i32.const 1 + else local.get $1 i32.const 31 i32.shr_u - local.set $3 end - local.get $3 if local.get $1 i32.const 1 @@ -1543,7 +1499,7 @@ return end i32.const -25 - local.set $5 + local.set $4 local.get $0 f32.const 33554432 f32.mul @@ -1569,7 +1525,7 @@ local.get $1 i32.const 4913933 i32.add - local.tee $3 + local.tee $1 i32.const 8388607 i32.and i32.const 1060439283 @@ -1582,21 +1538,21 @@ local.get $0 f32.add f32.div - local.tee $4 - local.get $4 + local.tee $3 + local.get $3 f32.mul - local.tee $6 - local.get $6 + local.tee $5 + local.get $5 f32.mul local.set $2 - local.get $4 + local.get $3 f32.const 0.5 local.get $0 f32.mul local.get $0 f32.mul - local.tee $4 - local.get $6 + local.tee $3 + local.get $5 f32.const 0.6666666269302368 local.get $2 f32.const 0.2849878668785095 @@ -1613,19 +1569,19 @@ f32.add f32.add f32.mul - local.get $3 + local.get $1 i32.const 23 i32.shr_s i32.const 127 i32.sub - local.get $5 + local.get $4 i32.add f32.convert_i32_s local.tee $2 f32.const 9.05800061445916e-06 f32.mul f32.add - local.get $4 + local.get $3 f32.sub local.get $0 f32.add @@ -1634,7 +1590,7 @@ f32.mul f32.add ) - (func $~lib/math/NativeMathf.acosh (; 51 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.acosh (; 55 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 i32) local.get $0 i32.reinterpret_f32 @@ -1684,24 +1640,24 @@ f32.const 0.6931471824645996 f32.add ) - (func $std/math/test_acoshf (; 52 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_acoshf (; 56 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.acosh local.get $1 local.get $2 call $std/math/check ) - (func $~lib/math/NativeMath.asin (; 53 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.asin (; 57 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) - (local $3 i32) - (local $4 f64) + (local $3 f64) + (local $4 i32) local.get $0 i64.reinterpret_f64 i64.const 32 i64.shr_u i32.wrap_i64 - local.tee $3 + local.tee $4 i32.const 2147483647 i32.and local.tee $2 @@ -1735,17 +1691,14 @@ i32.const 1071644672 i32.lt_u if + local.get $2 + i32.const 1048576 + i32.ge_u + i32.const 0 local.get $2 i32.const 1045430272 i32.lt_u - local.tee $3 - if - local.get $2 - i32.const 1048576 - i32.ge_u - local.set $3 - end - local.get $3 + select if local.get $0 return @@ -1771,7 +1724,7 @@ local.set $0 local.get $1 call $~lib/math/R - local.set $4 + local.set $3 local.get $2 i32.const 1072640819 i32.ge_u @@ -1780,7 +1733,7 @@ f64.const 2 local.get $0 local.get $0 - local.get $4 + local.get $3 f64.mul f64.add f64.mul @@ -1792,7 +1745,7 @@ f64.const 2 local.get $0 f64.mul - local.get $4 + local.get $3 f64.mul f64.const 6.123233995736766e-17 f64.const 2 @@ -1822,7 +1775,7 @@ f64.sub end local.set $0 - local.get $3 + local.get $4 i32.const 31 i32.shr_u if @@ -1832,30 +1785,26 @@ end local.get $0 ) - (func $std/math/test_asin (; 54 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) - (local $3 i32) + (func $std/math/test_asin (; 58 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.asin local.get $1 local.get $2 call $std/math/check - local.tee $3 - if + if (result i32) local.get $0 call $~lib/bindings/Math/asin local.get $1 local.get $2 call $std/math/check - local.set $3 + else + i32.const 0 end - local.get $3 ) - (func $~lib/math/NativeMathf.asin (; 55 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.asin (; 59 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 i32) (local $2 f32) - (local $3 i32) - (local $4 f32) - (local $5 f64) + (local $3 f64) local.get $0 i32.reinterpret_f32 i32.const 2147483647 @@ -1886,17 +1835,14 @@ i32.const 1056964608 i32.lt_u if + local.get $1 + i32.const 8388608 + i32.ge_u + i32.const 0 local.get $1 i32.const 964689920 i32.lt_u - local.tee $3 - if (result i32) - local.get $1 - i32.const 8388608 - i32.ge_u - else - local.get $3 - end + select if local.get $0 return @@ -1906,27 +1852,13 @@ local.get $0 local.get $0 f32.mul - local.tee $0 - f32.const 0.16666586697101593 - local.get $0 - f32.const -0.04274342209100723 - local.get $0 - f32.const -0.008656363002955914 - f32.mul - f32.add - f32.mul - f32.add - f32.mul - f32.const 1 - local.get $0 - f32.const -0.7066296339035034 - f32.mul - f32.add - f32.div + call $~lib/math/Rf f32.mul f32.add return end + f64.const 1.5707963705062866 + f64.const 2 f32.const 0.5 local.get $0 f32.abs @@ -1934,31 +1866,12 @@ f32.mul f32.sub local.tee $2 - f32.const 0.16666586697101593 - local.get $2 - f32.const -0.04274342209100723 - local.get $2 - f32.const -0.008656363002955914 - f32.mul - f32.add - f32.mul - f32.add - f32.mul - f32.const 1 - local.get $2 - f32.const -0.7066296339035034 - f32.mul - f32.add - f32.div - local.set $4 - f64.const 1.5707963705062866 - f64.const 2 - local.get $2 f64.promote_f32 f64.sqrt - local.tee $5 - local.get $5 - local.get $4 + local.tee $3 + local.get $3 + local.get $2 + call $~lib/math/Rf f64.promote_f32 f64.mul f64.add @@ -1968,14 +1881,14 @@ local.get $0 f32.copysign ) - (func $std/math/test_asinf (; 56 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_asinf (; 60 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.asin local.get $1 local.get $2 call $std/math/check ) - (func $~lib/math/NativeMath.asinh (; 57 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.asinh (; 61 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i64) local.get $0 @@ -2045,25 +1958,23 @@ local.get $0 f64.copysign ) - (func $std/math/test_asinh (; 58 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) - (local $3 i32) + (func $std/math/test_asinh (; 62 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.asinh local.get $1 local.get $2 call $std/math/check - local.tee $3 - if + if (result i32) local.get $0 call $~lib/bindings/Math/asinh local.get $1 local.get $2 call $std/math/check - local.set $3 + else + i32.const 0 end - local.get $3 ) - (func $~lib/math/NativeMathf.asinh (; 59 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.asinh (; 63 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 f32) (local $2 i32) local.get $0 @@ -2128,14 +2039,14 @@ local.get $0 f32.copysign ) - (func $std/math/test_asinhf (; 60 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_asinhf (; 64 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.asinh local.get $1 local.get $2 call $std/math/check ) - (func $~lib/math/NativeMath.atan (; 61 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.atan (; 65 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) (local $3 f64) @@ -2154,8 +2065,7 @@ i32.ge_u if local.get $0 - local.get $0 - f64.ne + call $~lib/builtins/isNaN if local.get $0 return @@ -2307,10 +2217,13 @@ block $case1|0 local.get $2 if - local.get $2 - i32.const 1 - i32.sub - br_table $case1|0 $case2|0 $case3|0 $case4|0 + block $tablify|0 + local.get $2 + i32.const 1 + i32.sub + br_table $case1|0 $case2|0 $case3|0 $tablify|0 + end + br $case4|0 end f64.const 0.4636476090008061 local.get $1 @@ -2358,31 +2271,29 @@ local.get $3 f64.copysign ) - (func $std/math/test_atan (; 62 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) - (local $3 i32) + (func $std/math/test_atan (; 66 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.atan local.get $1 local.get $2 call $std/math/check - local.tee $3 - if + if (result i32) local.get $0 call $~lib/bindings/Math/atan local.get $1 local.get $2 call $std/math/check - local.set $3 + else + i32.const 0 end - local.get $3 ) - (func $~lib/math/NativeMathf.atan (; 63 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.atan (; 67 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 i32) (local $2 f32) (local $3 f32) (local $4 f32) local.get $0 - local.set $3 + local.set $4 local.get $0 i32.reinterpret_f32 i32.const 2147483647 @@ -2392,14 +2303,13 @@ i32.ge_u if local.get $0 - local.get $0 - f32.ne + call $~lib/builtins/isNaN if local.get $0 return end f32.const 1.570796251296997 - local.get $3 + local.get $4 f32.copysign return end @@ -2479,25 +2389,25 @@ local.get $0 local.get $0 f32.mul - local.tee $4 - local.get $4 + local.tee $2 + local.get $2 f32.mul - local.set $2 + local.set $3 local.get $0 - local.get $4 - f32.const 0.333333283662796 local.get $2 + f32.const 0.333333283662796 + local.get $3 f32.const 0.14253635704517365 - local.get $2 + local.get $3 f32.const 0.06168760731816292 f32.mul f32.add f32.mul f32.add f32.mul - local.get $2 + local.get $3 f32.const -0.19999158382415771 - local.get $2 + local.get $3 f32.const -0.106480173766613 f32.mul f32.add @@ -2521,10 +2431,13 @@ block $case1|0 local.get $1 if - local.get $1 - i32.const 1 - i32.sub - br_table $case1|0 $case2|0 $case3|0 $case4|0 + block $tablify|0 + local.get $1 + i32.const 1 + i32.sub + br_table $case1|0 $case2|0 $case3|0 $tablify|0 + end + br $case4|0 end f32.const 0.46364760398864746 local.get $2 @@ -2569,17 +2482,17 @@ unreachable end local.get $0 - local.get $3 + local.get $4 f32.copysign ) - (func $std/math/test_atanf (; 64 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_atanf (; 68 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.atan local.get $1 local.get $2 call $std/math/check ) - (func $~lib/math/NativeMath.atanh (; 65 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.atanh (; 69 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i64) (local $3 f64) @@ -2636,25 +2549,23 @@ local.get $0 f64.copysign ) - (func $std/math/test_atanh (; 66 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) - (local $3 i32) + (func $std/math/test_atanh (; 70 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.atanh local.get $1 local.get $2 call $std/math/check - local.tee $3 - if + if (result i32) local.get $0 call $~lib/bindings/Math/atanh local.get $1 local.get $2 call $std/math/check - local.set $3 + else + i32.const 0 end - local.get $3 ) - (func $~lib/math/NativeMathf.atanh (; 67 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.atanh (; 71 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 f32) (local $2 i32) local.get $0 @@ -2704,31 +2615,28 @@ local.get $0 f32.copysign ) - (func $std/math/test_atanhf (; 68 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_atanhf (; 72 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.atanh local.get $1 local.get $2 call $std/math/check ) - (func $~lib/math/NativeMath.atan2 (; 69 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $~lib/math/NativeMath.atan2 (; 73 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - (local $6 i64) + (local $5 i64) + (local $6 i32) (local $7 i32) local.get $1 - local.get $1 - f64.ne - local.tee $3 - local.set $2 - local.get $2 - local.get $0 - local.get $0 - f64.ne - local.get $3 - select + call $~lib/builtins/isNaN + if (result i32) + i32.const 1 + else + local.get $0 + call $~lib/builtins/isNaN + end if local.get $1 local.get $0 @@ -2737,24 +2645,25 @@ end local.get $0 i64.reinterpret_f64 - local.tee $6 + local.tee $5 i64.const 32 i64.shr_u i32.wrap_i64 - local.set $3 - local.get $6 + local.set $4 + local.get $5 i32.wrap_i64 - local.set $5 + local.set $6 local.get $1 i64.reinterpret_f64 - local.tee $6 - i32.wrap_i64 - local.tee $7 - local.get $6 + local.tee $5 i64.const 32 i64.shr_u i32.wrap_i64 - local.tee $4 + local.set $3 + local.get $5 + i32.wrap_i64 + local.tee $7 + local.get $3 i32.const 1072693248 i32.sub i32.or @@ -2764,41 +2673,47 @@ call $~lib/math/NativeMath.atan return end - local.get $4 + local.get $3 i32.const 30 i32.shr_u i32.const 2 i32.and - local.get $3 + local.get $4 i32.const 31 i32.shr_u i32.or local.set $2 - local.get $4 + local.get $3 i32.const 2147483647 i32.and - local.set $4 - local.get $5 - local.get $3 + local.set $3 + local.get $4 i32.const 2147483647 i32.and - local.tee $5 + local.tee $4 + local.get $6 i32.or i32.eqz if block $break|0 block $case3|0 block $case2|0 - block $case1|0 + local.get $2 + i32.eqz + local.get $2 + i32.const 1 + i32.eq + i32.or + i32.eqz + if local.get $2 - i32.eqz - br_if $case1|0 - block $tablify|0 - local.get $2 - i32.const 1 - i32.sub - br_table $case1|0 $case2|0 $case3|0 $tablify|0 - end + i32.const 2 + i32.eq + br_if $case2|0 + local.get $2 + i32.const 3 + i32.eq + br_if $case3|0 br $break|0 end local.get $0 @@ -2812,16 +2727,16 @@ end end block $folding-inner0 - local.get $4 + local.get $3 local.get $7 i32.or i32.eqz br_if $folding-inner0 - local.get $4 + local.get $3 i32.const 2146435072 i32.eq if - local.get $5 + local.get $4 i32.const 2146435072 i32.eq if @@ -2831,10 +2746,13 @@ block $case1|1 local.get $2 if - local.get $2 - i32.const 1 - i32.sub - br_table $case1|1 $case2|1 $case3|1 $break|1 + block $tablify|0 + local.get $2 + i32.const 1 + i32.sub + br_table $case1|1 $case2|1 $case3|1 $tablify|0 + end + br $break|1 end f64.const 0.7853981633974483 return @@ -2855,10 +2773,13 @@ block $case1|2 local.get $2 if - local.get $2 - i32.const 1 - i32.sub - br_table $case1|2 $case2|2 $case3|2 $break|2 + block $tablify|00 + local.get $2 + i32.const 1 + i32.sub + br_table $case1|2 $case2|2 $case3|2 $tablify|00 + end + br $break|2 end f64.const 0 return @@ -2874,33 +2795,27 @@ end end end + i32.const 1 local.get $4 + i32.const 2146435072 + i32.eq + local.get $3 i32.const 67108864 i32.add - local.get $5 + local.get $4 i32.lt_u - local.tee $3 - if (result i32) - local.get $3 - else - local.get $5 - i32.const 2146435072 - i32.eq - end + select br_if $folding-inner0 + local.get $4 + i32.const 67108864 + i32.add + local.get $3 + i32.lt_u + i32.const 0 local.get $2 i32.const 2 i32.and - local.tee $3 - if (result i32) - local.get $5 - i32.const 67108864 - i32.add - local.get $4 - i32.lt_u - else - local.get $3 - end + select if (result f64) f64.const 0 else @@ -2917,10 +2832,13 @@ block $case1|3 local.get $2 if - local.get $2 - i32.const 1 - i32.sub - br_table $case1|3 $case2|3 $case3|3 $break|3 + block $tablify|01 + local.get $2 + i32.const 1 + i32.sub + br_table $case1|3 $case2|3 $case3|3 $tablify|01 + end + br $break|3 end local.get $0 return @@ -2952,42 +2870,36 @@ i32.and select ) - (func $std/math/test_atan2 (; 70 ;) (type $FUNCSIG$idddd) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (result i32) - (local $4 i32) + (func $std/math/test_atan2 (; 74 ;) (type $FUNCSIG$idddd) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMath.atan2 local.get $2 local.get $3 call $std/math/check - local.tee $4 - if + if (result i32) local.get $0 local.get $1 call $~lib/bindings/Math/atan2 local.get $2 local.get $3 call $std/math/check - local.set $4 + else + i32.const 0 end - local.get $4 ) - (func $~lib/math/NativeMathf.atan2 (; 71 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + (func $~lib/math/NativeMathf.atan2 (; 75 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) local.get $1 - local.get $1 - f32.ne - local.tee $3 - local.set $2 - local.get $2 - local.get $0 - local.get $0 - f32.ne - local.get $3 - select + call $~lib/builtins/isNaN + if (result i32) + i32.const 1 + else + local.get $0 + call $~lib/builtins/isNaN + end if local.get $1 local.get $0 @@ -3024,22 +2936,28 @@ local.get $3 i32.const 2147483647 i32.and - local.tee $5 + local.tee $3 i32.eqz if block $break|0 block $case3|0 block $case2|0 - block $case1|0 + local.get $2 + i32.eqz + local.get $2 + i32.const 1 + i32.eq + i32.or + i32.eqz + if local.get $2 - i32.eqz - br_if $case1|0 - block $tablify|0 - local.get $2 - i32.const 1 - i32.sub - br_table $case1|0 $case2|0 $case3|0 $tablify|0 - end + i32.const 2 + i32.eq + br_if $case2|0 + local.get $2 + i32.const 3 + i32.eq + br_if $case3|0 br $break|0 end local.get $0 @@ -3060,7 +2978,7 @@ i32.const 2139095040 i32.eq if - local.get $5 + local.get $3 i32.const 2139095040 i32.eq if @@ -3070,10 +2988,13 @@ block $case1|1 local.get $2 if - local.get $2 - i32.const 1 - i32.sub - br_table $case1|1 $case2|1 $case3|1 $break|1 + block $tablify|0 + local.get $2 + i32.const 1 + i32.sub + br_table $case1|1 $case2|1 $case3|1 $tablify|0 + end + br $break|1 end f32.const 0.7853981852531433 return @@ -3094,10 +3015,13 @@ block $case1|2 local.get $2 if - local.get $2 - i32.const 1 - i32.sub - br_table $case1|2 $case2|2 $case3|2 $break|2 + block $tablify|00 + local.get $2 + i32.const 1 + i32.sub + br_table $case1|2 $case2|2 $case3|2 $tablify|00 + end + br $break|2 end f32.const 0 return @@ -3113,33 +3037,27 @@ end end end + i32.const 1 + local.get $3 + i32.const 2139095040 + i32.eq local.get $4 i32.const 218103808 i32.add - local.get $5 + local.get $3 i32.lt_u - local.tee $3 - if (result i32) - local.get $3 - else - local.get $5 - i32.const 2139095040 - i32.eq - end + select br_if $folding-inner0 + local.get $3 + i32.const 218103808 + i32.add + local.get $4 + i32.lt_u + i32.const 0 local.get $2 i32.const 2 i32.and - local.tee $3 - if (result i32) - local.get $5 - i32.const 218103808 - i32.add - local.get $4 - i32.lt_u - else - local.get $3 - end + select if (result f32) f32.const 0 else @@ -3156,10 +3074,13 @@ block $case1|3 local.get $2 if - local.get $2 - i32.const 1 - i32.sub - br_table $case1|3 $case2|3 $case3|3 $break|3 + block $tablify|01 + local.get $2 + i32.const 1 + i32.sub + br_table $case1|3 $case2|3 $case3|3 $tablify|01 + end + br $break|3 end local.get $0 return @@ -3191,7 +3112,7 @@ i32.and select ) - (func $std/math/test_atan2f (; 72 ;) (type $FUNCSIG$iffff) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (result i32) + (func $std/math/test_atan2f (; 76 ;) (type $FUNCSIG$iffff) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMathf.atan2 @@ -3199,7 +3120,7 @@ local.get $3 call $std/math/check ) - (func $~lib/math/NativeMath.cbrt (; 73 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.cbrt (; 77 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) (local $3 f64) @@ -3321,34 +3242,30 @@ f64.mul f64.add ) - (func $std/math/test_cbrt (; 74 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) - (local $3 i32) + (func $std/math/test_cbrt (; 78 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.cbrt local.get $1 local.get $2 call $std/math/check - local.tee $3 - if + if (result i32) local.get $0 call $~lib/bindings/Math/cbrt local.get $1 local.get $2 call $std/math/check - local.set $3 + else + i32.const 0 end - local.get $3 ) - (func $~lib/math/NativeMathf.cbrt (; 75 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.cbrt (; 79 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 f64) (local $2 f64) (local $3 i32) - (local $4 f64) - (local $5 i32) - (local $6 f64) + (local $4 i32) local.get $0 i32.reinterpret_f32 - local.tee $5 + local.tee $4 i32.const 2147483647 i32.and local.tee $3 @@ -3374,7 +3291,7 @@ f32.const 16777216 f32.mul i32.reinterpret_f32 - local.tee $5 + local.tee $4 i32.const 2147483647 i32.and i32.const 3 @@ -3388,7 +3305,7 @@ i32.const 709958130 i32.add end - local.get $5 + local.get $4 i32.const -2147483648 i32.and i32.or @@ -3403,53 +3320,56 @@ local.get $1 local.get $0 f64.promote_f32 - local.tee $1 - local.get $1 + local.get $0 + f64.promote_f32 f64.add - local.tee $6 local.get $2 f64.add f64.mul - local.get $1 + local.get $0 + f64.promote_f32 local.get $2 f64.add local.get $2 f64.add f64.div - local.tee $2 - local.get $2 + local.tee $1 + local.get $1 f64.mul - local.get $2 + local.get $1 f64.mul - local.set $4 + local.set $2 + local.get $1 + local.get $0 + f64.promote_f32 + local.get $0 + f64.promote_f32 + f64.add local.get $2 - local.get $6 - local.get $4 f64.add f64.mul - local.get $1 - local.get $4 + local.get $0 + f64.promote_f32 + local.get $2 f64.add - local.get $4 + local.get $2 f64.add f64.div f32.demote_f64 ) - (func $std/math/test_cbrtf (; 76 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_cbrtf (; 80 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.cbrt local.get $1 local.get $2 call $std/math/check ) - (func $std/math/test_ceil (; 77 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) - (local $2 i32) + (func $std/math/test_ceil (; 81 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) local.get $0 f64.ceil local.get $1 f64.const 0 call $std/math/check - local.tee $2 if (result i32) local.get $0 call $~lib/bindings/Math/ceil @@ -3457,430 +3377,75 @@ f64.const 0 call $std/math/check else - local.get $2 + i32.const 0 end ) - (func $std/math/test_ceilf (; 78 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) + (func $std/math/test_ceilf (; 82 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) local.get $0 f32.ceil local.get $1 f32.const 0 call $std/math/check ) - (func $~lib/math/NativeMathf.cos (; 79 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/array/Array#__unchecked_get (; 83 ;) (type $FUNCSIG$ji) (param $0 i32) (result i64) + i32.const 116 + i32.load + local.get $0 + i32.const 3 + i32.shl + i32.add + i64.load + ) + (func $~lib/math/NativeMathf.cos (; 84 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 f64) - (local $2 f64) - (local $3 i32) - (local $4 i64) - (local $5 i32) - (local $6 i32) - (local $7 f64) - (local $8 i64) - (local $9 i32) + (local $2 i32) + (local $3 f64) + (local $4 i32) + (local $5 i64) + (local $6 i64) + (local $7 i32) + (local $8 i32) + (local $9 i64) (local $10 i64) - (local $11 i64) local.get $0 i32.reinterpret_f32 - local.tee $3 + local.tee $2 i32.const 31 i32.shr_u - local.set $6 - block $folding-inner1 - block $folding-inner0 - local.get $3 - i32.const 2147483647 - i32.and - local.tee $3 - i32.const 1061752794 - i32.le_u - if - local.get $3 - i32.const 964689920 - i32.lt_u - if - f32.const 1 - return - end - local.get $0 - f64.promote_f32 - local.tee $1 - local.get $1 - f64.mul - local.tee $1 - local.get $1 - f64.mul - local.set $2 - br $folding-inner0 - end - local.get $3 - i32.const 1081824209 - i32.le_u - if - local.get $3 - i32.const 1075235811 - i32.gt_u - if - local.get $0 - f64.promote_f32 - local.tee $1 - f64.const 3.141592653589793 - f64.add - local.get $1 - f64.const 3.141592653589793 - f64.sub - local.get $6 - select - local.tee $1 - local.get $1 - f64.mul - local.tee $1 - local.get $1 - f64.mul - local.set $2 - f64.const 1 - local.get $1 - f64.const -0.499999997251031 - f64.mul - f64.add - local.get $2 - f64.const 0.04166662332373906 - f64.mul - f64.add - local.get $2 - local.get $1 - f64.mul - f64.const -0.001388676377460993 - local.get $1 - f64.const 2.439044879627741e-05 - f64.mul - f64.add - f64.mul - f64.add - f32.demote_f64 - f32.neg - return - else - local.get $6 - if (result f64) - local.get $0 - f64.promote_f32 - f64.const 1.5707963267948966 - f64.add - local.tee $2 - local.get $2 - f64.mul - local.tee $1 - local.get $2 - f64.mul - else - f64.const 1.5707963267948966 - local.get $0 - f64.promote_f32 - f64.sub - local.tee $2 - local.get $2 - f64.mul - local.tee $1 - local.get $2 - f64.mul - end - local.set $7 - br $folding-inner1 - end - unreachable - end - local.get $3 - i32.const 1088565717 - i32.le_u - if - local.get $3 - i32.const 1085271519 - i32.gt_u - if - local.get $0 - f64.promote_f32 - local.tee $1 - f64.const 6.283185307179586 - f64.add - local.get $1 - f64.const 6.283185307179586 - f64.sub - local.get $6 - select - local.tee $1 - local.get $1 - f64.mul - local.tee $1 - local.get $1 - f64.mul - local.set $2 - br $folding-inner0 - else - local.get $6 - if (result f64) - local.get $0 - f32.neg - f64.promote_f32 - f64.const 4.71238898038469 - f64.sub - local.tee $2 - local.get $2 - f64.mul - local.tee $1 - local.get $2 - f64.mul - else - local.get $0 - f64.promote_f32 - f64.const 4.71238898038469 - f64.sub - local.tee $2 - local.get $2 - f64.mul - local.tee $1 - local.get $2 - f64.mul - end - local.set $7 - br $folding-inner1 - end - unreachable - end - local.get $3 - i32.const 2139095040 - i32.ge_u - if - local.get $0 - local.get $0 - f32.sub - return - end - block $~lib/math/rempio2f|inlined.0 (result i32) - local.get $3 - i32.const 1305022427 - i32.lt_u - if - local.get $0 - f64.promote_f32 - local.tee $2 - f64.const 0.6366197723675814 - f64.mul - f64.nearest - local.set $1 - local.get $2 - local.get $1 - f64.const 1.5707963109016418 - f64.mul - f64.sub - local.get $1 - f64.const 1.5893254773528196e-08 - f64.mul - f64.sub - global.set $~lib/math/rempio2f_y - local.get $1 - i32.trunc_f64_s - br $~lib/math/rempio2f|inlined.0 - end - i32.const 104 - i32.load - local.get $3 - i32.const 23 - i32.shr_s - i32.const 152 - i32.sub - local.tee $5 - i32.const 6 - i32.shr_s - local.tee $9 - i32.const 3 - i32.shl - i32.add - i64.load offset=8 - local.set $10 - i32.const 104 - i32.load - local.get $9 - i32.const 1 - i32.add - i32.const 3 - i32.shl - i32.add - i64.load offset=8 - local.set $4 - local.get $5 - i32.const 63 - i32.and - local.tee $5 - i32.const 32 - i32.gt_s - if (result i64) - local.get $4 - local.get $5 - i32.const 32 - i32.sub - i64.extend_i32_s - i64.shl - i32.const 104 - i32.load - local.get $9 - i32.const 2 - i32.add - i32.const 3 - i32.shl - i32.add - i64.load offset=8 - i64.const 96 - local.get $5 - i64.extend_i32_s - i64.sub - i64.shr_u - i64.or - else - local.get $4 - i64.const 32 - local.get $5 - i64.extend_i32_s - i64.sub - i64.shr_u - end - local.set $8 - f64.const 8.515303950216386e-20 - local.get $0 - f64.promote_f32 - f64.copysign - local.get $3 - i32.const 8388607 - i32.and - i32.const 8388608 - i32.or - i64.extend_i32_s - local.tee $11 - local.get $4 - i64.const 64 - local.get $5 - i64.extend_i32_s - local.tee $4 - i64.sub - i64.shr_u - local.get $10 - local.get $4 - i64.shl - i64.or - i64.mul - local.get $8 - local.get $11 - i64.mul - i64.const 32 - i64.shr_u - i64.add - local.tee $4 - i64.const 2 - i64.shl - local.tee $8 - f64.convert_i64_s - f64.mul - global.set $~lib/math/rempio2f_y - i32.const 0 - local.get $4 - i64.const 62 - i64.shr_u - local.get $8 - i64.const 63 - i64.shr_u - i64.add - i32.wrap_i64 - local.tee $3 - i32.sub - local.get $3 - local.get $6 - select - end - local.set $3 - global.get $~lib/math/rempio2f_y - local.set $1 - local.get $3 - i32.const 1 - i32.and - if (result f32) - local.get $1 - local.get $1 - local.get $1 - f64.mul - local.tee $2 - local.get $1 - f64.mul - local.tee $1 - f64.const -0.16666666641626524 - local.get $2 - f64.const 0.008333329385889463 - f64.mul - f64.add - f64.mul - f64.add - local.get $1 - local.get $2 - local.get $2 - f64.mul - f64.mul - f64.const -1.9839334836096632e-04 - local.get $2 - f64.const 2.718311493989822e-06 - f64.mul - f64.add - f64.mul - f64.add - f32.demote_f64 - else - local.get $1 - local.get $1 - f64.mul - local.tee $1 - local.get $1 - f64.mul - local.set $2 - f64.const 1 - local.get $1 - f64.const -0.499999997251031 - f64.mul - f64.add - local.get $2 - f64.const 0.04166662332373906 - f64.mul - f64.add - local.get $2 - local.get $1 - f64.mul - f64.const -0.001388676377460993 - local.get $1 - f64.const 2.439044879627741e-05 - f64.mul - f64.add - f64.mul - f64.add - f32.demote_f64 - end - local.set $0 - local.get $0 - f32.neg - local.get $0 - local.get $3 - i32.const 1 - i32.add - i32.const 2 - i32.and - select + local.set $8 + local.get $2 + i32.const 2147483647 + i32.and + local.tee $2 + i32.const 1061752794 + i32.le_u + if + local.get $2 + i32.const 964689920 + i32.lt_u + if + f32.const 1 return end + local.get $0 + f64.promote_f32 + local.tee $1 + local.get $1 + f64.mul + local.tee $1 + local.get $1 + f64.mul + local.set $3 f64.const 1 local.get $1 f64.const -0.499999997251031 f64.mul f64.add - local.get $2 + local.get $3 f64.const 0.04166662332373906 f64.mul f64.add - local.get $2 + local.get $3 local.get $1 f64.mul f64.const -0.001388676377460993 @@ -3894,43 +3459,230 @@ return end local.get $2 - local.get $7 - f64.const -0.16666666641626524 - local.get $1 - f64.const 0.008333329385889463 - f64.mul - f64.add - f64.mul - f64.add - local.get $7 - local.get $1 - local.get $1 - f64.mul - f64.mul - f64.const -1.9839334836096632e-04 - local.get $1 - f64.const 2.718311493989822e-06 - f64.mul - f64.add - f64.mul - f64.add - f32.demote_f64 + i32.const 2139095040 + i32.ge_u + if + local.get $0 + local.get $0 + f32.sub + return + end + block $~lib/math/rempio2f|inlined.0 (result i32) + local.get $2 + i32.const 1305022427 + i32.lt_u + if + local.get $0 + f64.promote_f32 + local.get $0 + f64.promote_f32 + f64.const 0.6366197723675814 + f64.mul + f64.nearest + local.tee $1 + f64.const 1.5707963109016418 + f64.mul + f64.sub + local.get $1 + f64.const 1.5893254773528196e-08 + f64.mul + f64.sub + global.set $~lib/math/rempio2f_y + local.get $1 + i32.trunc_f64_s + br $~lib/math/rempio2f|inlined.0 + end + local.get $2 + i32.const 23 + i32.shr_s + i32.const 152 + i32.sub + local.tee $4 + i32.const 6 + i32.shr_s + local.tee $7 + call $~lib/array/Array#__unchecked_get + local.set $9 + local.get $7 + i32.const 1 + i32.add + call $~lib/array/Array#__unchecked_get + local.set $5 + local.get $4 + i32.const 63 + i32.and + local.tee $4 + i32.const 32 + i32.gt_s + if (result i64) + local.get $5 + local.get $4 + i32.const 32 + i32.sub + i64.extend_i32_s + i64.shl + local.get $7 + i32.const 2 + i32.add + call $~lib/array/Array#__unchecked_get + i64.const 96 + local.get $4 + i64.extend_i32_s + i64.sub + i64.shr_u + i64.or + else + local.get $5 + i64.const 32 + local.get $4 + i64.extend_i32_s + i64.sub + i64.shr_u + end + local.set $6 + f64.const 8.515303950216386e-20 + local.get $0 + f64.promote_f32 + f64.copysign + local.get $2 + i32.const 8388607 + i32.and + i32.const 8388608 + i32.or + i64.extend_i32_s + local.tee $10 + local.get $9 + local.get $4 + i64.extend_i32_s + i64.shl + local.get $5 + i64.const 64 + local.get $4 + i64.extend_i32_s + i64.sub + i64.shr_u + i64.or + i64.mul + local.get $6 + local.get $10 + i64.mul + i64.const 32 + i64.shr_u + i64.add + local.tee $5 + i64.const 2 + i64.shl + local.tee $6 + f64.convert_i64_s + f64.mul + global.set $~lib/math/rempio2f_y + i32.const 0 + local.get $5 + i64.const 62 + i64.shr_u + local.get $6 + i64.const 63 + i64.shr_u + i64.add + i32.wrap_i64 + local.tee $2 + i32.sub + local.get $2 + local.get $8 + select + end + local.set $2 + global.get $~lib/math/rempio2f_y + local.set $1 + local.get $2 + i32.const 1 + i32.and + if (result f32) + local.get $1 + local.get $1 + local.get $1 + f64.mul + local.tee $3 + local.get $1 + f64.mul + local.tee $1 + f64.const -0.16666666641626524 + local.get $3 + f64.const 0.008333329385889463 + f64.mul + f64.add + f64.mul + f64.add + local.get $1 + local.get $3 + local.get $3 + f64.mul + f64.mul + f64.const -1.9839334836096632e-04 + local.get $3 + f64.const 2.718311493989822e-06 + f64.mul + f64.add + f64.mul + f64.add + f32.demote_f64 + else + local.get $1 + local.get $1 + f64.mul + local.tee $1 + local.get $1 + f64.mul + local.set $3 + f64.const 1 + local.get $1 + f64.const -0.499999997251031 + f64.mul + f64.add + local.get $3 + f64.const 0.04166662332373906 + f64.mul + f64.add + local.get $3 + local.get $1 + f64.mul + f64.const -0.001388676377460993 + local.get $1 + f64.const 2.439044879627741e-05 + f64.mul + f64.add + f64.mul + f64.add + f32.demote_f64 + end + local.set $0 + local.get $2 + i32.const 1 + i32.add + i32.const 2 + i32.and + if + local.get $0 + f32.neg + local.set $0 + end + local.get $0 ) - (func $std/math/test_cosf (; 80 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_cosf (; 85 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.cos local.get $1 local.get $2 call $std/math/check ) - (func $~lib/math/NativeMath.expm1 (; 81 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.expm1 (; 86 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) - (local $2 f64) - (local $3 i32) + (local $2 i32) + (local $3 f64) (local $4 f64) - (local $5 i32) + (local $5 f64) (local $6 i32) - (local $7 f64) + (local $7 i32) (local $8 i64) local.get $0 i64.reinterpret_f64 @@ -3938,7 +3690,7 @@ i64.const 63 i64.shr_u i32.wrap_i64 - local.set $5 + local.set $7 local.get $8 i64.const 32 i64.shr_u @@ -3950,13 +3702,12 @@ i32.ge_u if local.get $0 - local.get $0 - f64.ne + call $~lib/builtins/isNaN if local.get $0 return end - local.get $5 + local.get $7 if f64.const -1 return @@ -3977,7 +3728,7 @@ if local.get $0 i32.const 1 - local.get $5 + local.get $7 i32.const 1 i32.shl i32.sub @@ -3993,7 +3744,7 @@ i32.const 1072734898 i32.lt_u select - local.tee $3 + local.tee $2 f64.convert_i32_s local.tee $1 f64.const 0.6931471803691238 @@ -4010,7 +3761,7 @@ f64.sub local.get $1 f64.sub - local.set $7 + local.set $3 else local.get $6 i32.const 1016070144 @@ -4024,27 +3775,27 @@ f64.const 0.5 local.get $0 f64.mul - local.tee $2 - f64.mul local.tee $4 - local.get $4 + f64.mul + local.tee $5 + local.get $5 f64.mul local.set $1 f64.const 3 f64.const 1 - local.get $4 + local.get $5 f64.const -0.03333333333333313 f64.mul f64.add local.get $1 f64.const 1.5873015872548146e-03 - local.get $4 + local.get $5 f64.const -7.93650757867488e-05 f64.mul f64.add local.get $1 f64.const 4.008217827329362e-06 - local.get $4 + local.get $5 f64.const -2.0109921818362437e-07 f64.mul f64.add @@ -4053,58 +3804,58 @@ f64.mul f64.add local.tee $1 - local.get $2 + local.get $4 f64.mul f64.sub - local.set $2 - local.get $4 + local.set $4 + local.get $5 local.get $1 - local.get $2 + local.get $4 f64.sub f64.const 6 local.get $0 - local.get $2 + local.get $4 f64.mul f64.sub f64.div f64.mul local.set $1 - local.get $3 + local.get $2 i32.eqz if local.get $0 local.get $0 local.get $1 f64.mul - local.get $4 + local.get $5 f64.sub f64.sub return end local.get $0 local.get $1 - local.get $7 + local.get $3 f64.sub f64.mul - local.get $7 + local.get $3 f64.sub - local.get $4 + local.get $5 f64.sub - local.set $2 - local.get $3 + local.set $3 + local.get $2 i32.const -1 i32.eq if f64.const 0.5 local.get $0 - local.get $2 + local.get $3 f64.sub f64.mul f64.const 0.5 f64.sub return end - local.get $3 + local.get $2 i32.const 1 i32.eq if @@ -4113,7 +3864,7 @@ f64.lt if f64.const -2 - local.get $2 + local.get $3 local.get $0 f64.const 0.5 f64.add @@ -4124,90 +3875,86 @@ f64.const 1 f64.const 2 local.get $0 - local.get $2 + local.get $3 f64.sub f64.mul f64.add return end - local.get $3 + local.get $2 i64.extend_i32_s i64.const 1023 i64.add i64.const 52 i64.shl f64.reinterpret_i64 - local.set $1 - local.get $3 + local.set $4 + i32.const 1 + local.get $2 + i32.const 56 + i32.gt_s + local.get $2 i32.const 0 i32.lt_s - local.tee $5 - if (result i32) - local.get $5 - else - local.get $3 - i32.const 56 - i32.gt_s - end + select if local.get $0 - local.get $2 + local.get $3 f64.sub f64.const 1 f64.add local.set $0 - local.get $3 + local.get $0 + f64.const 2 + f64.mul + f64.const 8988465674311579538646525e283 + f64.mul + local.get $0 + local.get $4 + f64.mul + local.get $2 i32.const 1024 i32.eq - if (result f64) - local.get $0 - f64.const 2 - f64.mul - f64.const 8988465674311579538646525e283 - f64.mul - else - local.get $0 - local.get $1 - f64.mul - end + select f64.const 1 f64.sub return end - local.get $0 - f64.const 1 i64.const 1023 - local.get $3 + local.get $2 i64.extend_i32_s i64.sub i64.const 52 i64.shl f64.reinterpret_i64 - local.tee $0 + local.set $1 + local.get $0 + f64.const 1 + local.get $1 f64.sub - local.get $2 + local.get $3 f64.sub f64.const 1 - local.get $2 - local.get $0 + local.get $3 + local.get $1 f64.add f64.sub - local.get $3 + local.get $2 i32.const 20 i32.lt_s select f64.add - local.get $1 + local.get $4 f64.mul ) - (func $~lib/math/NativeMath.exp (; 82 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.exp (; 87 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i32) (local $2 f64) (local $3 i32) (local $4 f64) (local $5 f64) - (local $6 i32) - (local $7 f64) + (local $6 f64) + (local $7 i32) local.get $0 i64.reinterpret_f64 i64.const 32 @@ -4216,7 +3963,7 @@ local.tee $1 i32.const 31 i32.shr_u - local.set $6 + local.set $7 local.get $1 i32.const 2147483647 i32.and @@ -4225,8 +3972,7 @@ i32.ge_u if local.get $0 - local.get $0 - f64.ne + call $~lib/builtins/isNaN if local.get $0 return @@ -4269,36 +4015,37 @@ i32.trunc_f64_s else i32.const 1 - local.get $6 + local.get $7 i32.const 1 i32.shl i32.sub end local.tee $1 f64.convert_i32_s - local.tee $0 f64.const 0.6931471803691238 f64.mul f64.sub - local.tee $4 - local.get $0 + local.tee $5 + local.get $1 + f64.convert_i32_s f64.const 1.9082149292705877e-10 f64.mul - local.tee $7 + local.tee $4 f64.sub local.set $0 else local.get $3 i32.const 1043333120 - i32.le_u - if + i32.gt_u + if (result f64) + local.get $0 + else f64.const 1 local.get $0 f64.add return end - local.get $0 - local.set $4 + local.set $5 end local.get $0 local.get $0 @@ -4306,20 +4053,20 @@ local.tee $2 local.get $2 f64.mul - local.set $5 + local.set $6 f64.const 1 local.get $0 local.get $0 local.get $2 f64.const 0.16666666666666602 f64.mul - local.get $5 + local.get $6 f64.const -2.7777777777015593e-03 local.get $2 f64.const 6.613756321437934e-05 f64.mul f64.add - local.get $5 + local.get $6 f64.const -1.6533902205465252e-06 local.get $2 f64.const 4.1381367970572385e-08 @@ -4336,9 +4083,9 @@ local.get $0 f64.sub f64.div - local.get $7 - f64.sub local.get $4 + f64.sub + local.get $5 f64.add f64.add local.set $0 @@ -4352,7 +4099,7 @@ local.get $1 call $~lib/math/NativeMath.scalbn ) - (func $~lib/math/NativeMath.cosh (; 83 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.cosh (; 88 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i32) (local $2 i64) local.get $0 @@ -4416,52 +4163,50 @@ f64.const 2247116418577894884661631e283 f64.mul ) - (func $std/math/test_cosh (; 84 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) - (local $3 i32) + (func $std/math/test_cosh (; 89 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.cosh local.get $1 local.get $2 call $std/math/check - local.tee $3 - if + if (result i32) local.get $0 call $~lib/bindings/Math/cosh local.get $1 local.get $2 call $std/math/check - local.set $3 + else + i32.const 0 end - local.get $3 ) - (func $~lib/math/NativeMathf.expm1 (; 85 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) - (local $1 f32) - (local $2 i32) + (func $~lib/math/NativeMathf.expm1 (; 90 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + (local $2 f32) (local $3 f32) - (local $4 i32) - (local $5 f32) + (local $4 f32) + (local $5 i32) (local $6 f32) local.get $0 i32.reinterpret_f32 - local.tee $4 + local.tee $1 i32.const 31 i32.shr_u - local.set $2 - local.get $4 + local.set $5 + local.get $1 i32.const 2147483647 i32.and - local.tee $4 + local.tee $1 i32.const 1100331076 i32.ge_u if - local.get $4 + local.get $1 i32.const 2139095040 i32.gt_u if local.get $0 return end - local.get $2 + local.get $5 if f32.const -1 return @@ -4476,13 +4221,13 @@ return end end - local.get $4 + local.get $1 i32.const 1051816472 i32.gt_u if local.get $0 i32.const 1 - local.get $2 + local.get $5 i32.const 1 i32.shl i32.sub @@ -4494,30 +4239,30 @@ f32.copysign f32.add i32.trunc_f32_s - local.get $4 + local.get $1 i32.const 1065686418 i32.lt_u select - local.tee $2 + local.tee $1 f32.convert_i32_s local.tee $0 f32.const 0.6931381225585938 f32.mul f32.sub - local.tee $1 - local.get $1 + local.tee $2 + local.get $2 local.get $0 f32.const 9.05800061445916e-06 f32.mul - local.tee $1 + local.tee $2 f32.sub local.tee $0 f32.sub - local.get $1 + local.get $2 f32.sub - local.set $5 + local.set $4 else - local.get $4 + local.get $1 i32.const 855638016 i32.lt_u if (result i32) @@ -4526,7 +4271,7 @@ else i32.const 0 end - local.set $2 + local.set $1 end f32.const 3 f32.const 1 @@ -4536,9 +4281,9 @@ f32.mul local.tee $3 f32.mul - local.tee $1 + local.tee $2 f32.const -0.03333321213722229 - local.get $1 + local.get $2 f32.const 1.5807170420885086e-03 f32.mul f32.add @@ -4549,7 +4294,7 @@ f32.mul f32.sub local.set $3 - local.get $1 + local.get $2 local.get $6 local.get $3 f32.sub @@ -4561,42 +4306,42 @@ f32.div f32.mul local.set $3 - local.get $2 + local.get $1 i32.eqz if local.get $0 local.get $0 local.get $3 f32.mul - local.get $1 + local.get $2 f32.sub f32.sub return end local.get $0 local.get $3 - local.get $5 + local.get $4 f32.sub f32.mul - local.get $5 - f32.sub - local.get $1 + local.get $4 f32.sub - local.set $1 local.get $2 + f32.sub + local.set $2 + local.get $1 i32.const -1 i32.eq if f32.const 0.5 local.get $0 - local.get $1 + local.get $2 f32.sub f32.mul f32.const 0.5 f32.sub return end - local.get $2 + local.get $1 i32.const 1 i32.eq if @@ -4605,7 +4350,7 @@ f32.lt if f32.const -2 - local.get $1 + local.get $2 local.get $0 f32.const 0.5 f32.add @@ -4616,58 +4361,52 @@ f32.const 1 f32.const 2 local.get $0 - local.get $1 + local.get $2 f32.sub f32.mul f32.add return end - local.get $2 + local.get $1 i32.const 127 i32.add i32.const 23 i32.shl f32.reinterpret_i32 - local.set $5 - local.get $2 + local.set $4 + i32.const 1 + local.get $1 + i32.const 56 + i32.gt_s + local.get $1 i32.const 0 i32.lt_s - local.tee $4 - i32.eqz - if - local.get $2 - i32.const 56 - i32.gt_s - local.set $4 - end - local.get $4 + select if local.get $0 - local.get $1 + local.get $2 f32.sub f32.const 1 f32.add local.set $0 - local.get $2 + local.get $0 + f32.const 2 + f32.mul + f32.const 1701411834604692317316873e14 + f32.mul + local.get $0 + local.get $4 + f32.mul + local.get $1 i32.const 128 i32.eq - if (result f32) - local.get $0 - f32.const 2 - f32.mul - f32.const 1701411834604692317316873e14 - f32.mul - else - local.get $0 - local.get $5 - f32.mul - end + select f32.const 1 f32.sub return end i32.const 127 - local.get $2 + local.get $1 i32.sub i32.const 23 i32.shl @@ -4677,22 +4416,22 @@ f32.const 1 local.get $3 f32.sub - local.get $1 + local.get $2 f32.sub f32.const 1 - local.get $1 + local.get $2 local.get $3 f32.add f32.sub - local.get $2 + local.get $1 i32.const 20 i32.lt_s select f32.add - local.get $5 + local.get $4 f32.mul ) - (func $~lib/math/NativeMathf.exp (; 86 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.exp (; 91 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 i32) (local $2 i32) (local $3 f32) @@ -4757,12 +4496,12 @@ end local.tee $1 f32.convert_i32_s - local.tee $0 f32.const 0.693145751953125 f32.mul f32.sub local.tee $3 - local.get $0 + local.get $1 + f32.convert_i32_s f32.const 1.428606765330187e-06 f32.mul local.tee $4 @@ -4820,7 +4559,7 @@ local.get $1 call $~lib/math/NativeMathf.scalbn ) - (func $~lib/math/NativeMathf.cosh (; 87 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.cosh (; 92 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 i32) local.get $0 i32.reinterpret_f32 @@ -4879,71 +4618,65 @@ f32.const 1661534994731144841129758e11 f32.mul ) - (func $std/math/test_coshf (; 88 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_coshf (; 93 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.cosh local.get $1 local.get $2 call $std/math/check ) - (func $std/math/test_exp (; 89 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) - (local $3 i32) + (func $std/math/test_exp (; 94 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.exp local.get $1 local.get $2 call $std/math/check - local.tee $3 - if + if (result i32) local.get $0 call $~lib/bindings/Math/exp local.get $1 local.get $2 call $std/math/check - local.set $3 + else + i32.const 0 end - local.get $3 ) - (func $std/math/test_expf (; 90 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_expf (; 95 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.exp local.get $1 local.get $2 call $std/math/check ) - (func $std/math/test_expm1 (; 91 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) - (local $3 i32) + (func $std/math/test_expm1 (; 96 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.expm1 local.get $1 local.get $2 call $std/math/check - local.tee $3 - if + if (result i32) local.get $0 call $~lib/bindings/Math/expm1 local.get $1 local.get $2 call $std/math/check - local.set $3 + else + i32.const 0 end - local.get $3 ) - (func $std/math/test_expm1f (; 92 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_expm1f (; 97 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.expm1 local.get $1 local.get $2 call $std/math/check ) - (func $std/math/test_floor (; 93 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) - (local $2 i32) + (func $std/math/test_floor (; 98 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) local.get $0 f64.floor local.get $1 f64.const 0 call $std/math/check - local.tee $2 if (result i32) local.get $0 call $~lib/bindings/Math/floor @@ -4951,17 +4684,17 @@ f64.const 0 call $std/math/check else - local.get $2 + i32.const 0 end ) - (func $std/math/test_floorf (; 94 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) + (func $std/math/test_floorf (; 99 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) local.get $0 f32.floor local.get $1 f32.const 0 call $std/math/check ) - (func $~lib/math/NativeMath.hypot (; 95 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $~lib/math/NativeMath.hypot (; 100 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) (local $2 i64) (local $3 f64) (local $4 i64) @@ -4970,9 +4703,8 @@ (local $7 f64) (local $8 f64) (local $9 i32) - (local $10 i32) - (local $11 f64) - (local $12 i64) + (local $10 f64) + (local $11 i64) local.get $0 i64.reinterpret_f64 i64.const 9223372036854775807 @@ -4986,10 +4718,10 @@ i64.lt_u if local.get $4 - local.set $12 + local.set $11 local.get $2 local.set $4 - local.get $12 + local.get $11 local.set $2 end local.get $4 @@ -5014,18 +4746,14 @@ local.get $4 f64.reinterpret_i64 local.set $0 + i32.const 1 + local.get $2 + i64.const 0 + i64.eq local.get $5 i32.const 2047 i32.eq - local.tee $10 - i32.eqz - if - local.get $2 - i64.const 0 - i64.eq - local.set $10 - end - local.get $10 + select if local.get $0 return @@ -5085,7 +4813,7 @@ f64.add local.tee $7 f64.sub - local.set $11 + local.set $10 local.get $1 local.get $1 local.get $1 @@ -5126,9 +4854,9 @@ f64.const 2 local.get $7 f64.mul - local.get $11 + local.get $10 f64.add - local.get $11 + local.get $10 f64.mul f64.add f64.add @@ -5139,32 +4867,29 @@ f64.sqrt f64.mul ) - (func $std/math/test_hypot (; 96 ;) (type $FUNCSIG$idddd) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (result i32) - (local $4 i32) + (func $std/math/test_hypot (; 101 ;) (type $FUNCSIG$idddd) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMath.hypot local.get $2 local.get $3 call $std/math/check - local.tee $4 - if + if (result i32) local.get $0 local.get $1 call $~lib/bindings/Math/hypot local.get $2 local.get $3 call $std/math/check - local.set $4 + else + i32.const 0 end - local.get $4 ) - (func $~lib/math/NativeMathf.hypot (; 97 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + (func $~lib/math/NativeMathf.hypot (; 102 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) (local $2 i32) (local $3 i32) - (local $4 i32) - (local $5 f32) - (local $6 f64) + (local $4 f32) + (local $5 i32) local.get $0 i32.reinterpret_f32 i32.const 2147483647 @@ -5178,10 +4903,10 @@ i32.lt_u if local.get $3 - local.set $4 + local.set $5 local.get $2 local.set $3 - local.get $4 + local.get $5 local.set $2 end local.get $3 @@ -5197,27 +4922,20 @@ local.get $1 return end + i32.const 1 local.get $3 - i32.const 2139095040 + local.get $2 + i32.sub + i32.const 209715200 i32.ge_u - local.tee $4 - i32.eqz - if - local.get $2 - i32.eqz - local.set $4 - end - local.get $4 + i32.const 1 + local.get $2 i32.eqz - if - local.get $3 - local.get $2 - i32.sub - i32.const 209715200 - i32.ge_u - local.set $4 - end - local.get $4 + local.get $3 + i32.const 2139095040 + i32.ge_u + select + select if local.get $0 local.get $1 @@ -5225,13 +4943,13 @@ return end f32.const 1 - local.set $5 + local.set $4 local.get $3 i32.const 1568669696 i32.ge_u if (result f32) f32.const 1237940039285380274899124e3 - local.set $5 + local.set $4 local.get $1 f32.const 8.077935669463161e-28 f32.mul @@ -5245,7 +4963,7 @@ i32.lt_u if (result f32) f32.const 8.077935669463161e-28 - local.set $5 + local.set $4 local.get $1 f32.const 1237940039285380274899124e3 f32.mul @@ -5258,23 +4976,23 @@ end end local.set $0 - local.get $5 + local.get $4 + local.get $0 + f64.promote_f32 local.get $0 f64.promote_f32 - local.tee $6 - local.get $6 f64.mul local.get $1 f64.promote_f32 - local.tee $6 - local.get $6 + local.get $1 + f64.promote_f32 f64.mul f64.add f32.demote_f64 f32.sqrt f32.mul ) - (func $std/math/test_hypotf (; 98 ;) (type $FUNCSIG$iffff) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (result i32) + (func $std/math/test_hypotf (; 103 ;) (type $FUNCSIG$iffff) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMathf.hypot @@ -5282,61 +5000,56 @@ local.get $3 call $std/math/check ) - (func $std/math/test_log (; 99 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) - (local $3 i32) + (func $std/math/test_log (; 104 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.log local.get $1 local.get $2 call $std/math/check - local.tee $3 - if + if (result i32) local.get $0 call $~lib/bindings/Math/log local.get $1 local.get $2 call $std/math/check - local.set $3 + else + i32.const 0 end - local.get $3 ) - (func $std/math/test_logf (; 100 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) + (func $std/math/test_logf (; 105 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.log local.get $1 f32.const 0 call $std/math/check ) - (func $~lib/math/NativeMath.log10 (; 101 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.log10 (; 106 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) - (local $3 i32) - (local $4 i64) - (local $5 f64) - (local $6 i32) + (local $3 i64) + (local $4 f64) + (local $5 i32) + (local $6 f64) (local $7 f64) (local $8 f64) - (local $9 f64) local.get $0 i64.reinterpret_f64 - local.tee $4 + local.tee $3 i64.const 32 i64.shr_u i32.wrap_i64 - local.tee $3 + local.tee $2 i32.const 1048576 i32.lt_u - local.tee $2 - i32.eqz - if - local.get $3 + if (result i32) + i32.const 1 + else + local.get $2 i32.const 31 i32.shr_u - local.set $2 end - local.get $2 if - local.get $4 + local.get $3 i64.const 1 i64.shl i64.const 0 @@ -5349,7 +5062,7 @@ f64.div return end - local.get $3 + local.get $2 i32.const 31 i32.shr_u if @@ -5361,18 +5074,18 @@ return end i32.const -54 - local.set $6 + local.set $5 local.get $0 f64.const 18014398509481984 f64.mul i64.reinterpret_f64 - local.tee $4 + local.tee $3 i64.const 32 i64.shr_u i32.wrap_i64 - local.set $3 + local.set $2 else - local.get $3 + local.get $2 i32.const 2146435072 i32.ge_u if @@ -5380,28 +5093,25 @@ return else local.get $3 + i64.const 32 + i64.shl + i64.const 0 + i64.eq + i32.const 0 + local.get $2 i32.const 1072693248 i32.eq - local.tee $2 - if - local.get $4 - i64.const 32 - i64.shl - i64.const 0 - i64.eq - local.set $2 - end - local.get $2 + select if f64.const 0 return end end end - local.get $4 + local.get $3 i64.const 4294967295 i64.and - local.get $3 + local.get $2 i32.const 614242 i32.add local.tee $2 @@ -5421,26 +5131,26 @@ local.get $1 f64.add f64.div + local.tee $6 + local.get $6 + f64.mul local.tee $7 local.get $7 f64.mul - local.tee $8 - local.get $8 - f64.mul local.set $0 local.get $2 i32.const 20 i32.shr_u i32.const 1023 i32.sub - local.get $6 + local.get $5 i32.add f64.convert_i32_s - local.tee $5 + local.tee $4 f64.const 0.30102999566361177 f64.mul - local.set $9 - local.get $5 + local.set $8 + local.get $4 f64.const 3.694239077158931e-13 f64.mul local.get $1 @@ -5456,13 +5166,13 @@ i64.const -4294967296 i64.and f64.reinterpret_i64 - local.tee $5 + local.tee $4 f64.sub local.get $1 f64.sub - local.get $7 + local.get $6 local.get $1 - local.get $8 + local.get $7 f64.const 0.6666666666666735 local.get $0 f64.const 0.2857142874366239 @@ -5493,7 +5203,7 @@ f64.mul f64.add local.tee $0 - local.get $5 + local.get $4 f64.add f64.const 2.5082946711645275e-11 f64.mul @@ -5502,9 +5212,9 @@ f64.const 0.4342944818781689 f64.mul f64.add - local.get $9 - local.get $9 - local.get $5 + local.get $8 + local.get $8 + local.get $4 f64.const 0.4342944818781689 f64.mul local.tee $0 @@ -5517,47 +5227,42 @@ local.get $1 f64.add ) - (func $std/math/test_log10 (; 102 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) - (local $3 i32) + (func $std/math/test_log10 (; 107 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.log10 local.get $1 local.get $2 call $std/math/check - local.tee $3 - if + if (result i32) local.get $0 call $~lib/bindings/Math/log10 local.get $1 local.get $2 call $std/math/check - local.set $3 + else + i32.const 0 end - local.get $3 ) - (func $~lib/math/NativeMathf.log10 (; 103 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.log10 (; 108 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 i32) - (local $2 i32) - (local $3 f32) - (local $4 i32) + (local $2 f32) + (local $3 i32) + (local $4 f32) (local $5 f32) (local $6 f32) (local $7 f32) - (local $8 f32) local.get $0 i32.reinterpret_f32 local.tee $1 i32.const 8388608 i32.lt_u - local.tee $2 - i32.eqz - if + if (result i32) + i32.const 1 + else local.get $1 i32.const 31 i32.shr_u - local.set $2 end - local.get $2 if local.get $1 i32.const 1 @@ -5583,7 +5288,7 @@ return end i32.const -25 - local.set $4 + local.set $3 local.get $0 f32.const 33554432 f32.mul @@ -5609,7 +5314,7 @@ local.get $1 i32.const 4913933 i32.add - local.tee $2 + local.tee $1 i32.const 8388607 i32.and i32.const 1060439283 @@ -5622,22 +5327,22 @@ local.get $0 f32.add f32.div + local.tee $4 + local.get $4 + f32.mul local.tee $5 local.get $5 f32.mul - local.tee $6 - local.get $6 - f32.mul - local.set $3 - local.get $2 + local.set $2 + local.get $1 i32.const 23 i32.shr_u i32.const 127 i32.sub - local.get $4 + local.get $3 i32.add f32.convert_i32_s - local.tee $8 + local.tee $7 f32.const 7.903415166765626e-07 f32.mul local.get $0 @@ -5653,22 +5358,22 @@ i32.const -4096 i32.and f32.reinterpret_i32 - local.tee $7 + local.tee $6 f32.sub local.get $0 f32.sub - local.get $5 + local.get $4 local.get $0 - local.get $6 + local.get $5 f32.const 0.6666666269302368 - local.get $3 + local.get $2 f32.const 0.2849878668785095 f32.mul f32.add f32.mul - local.get $3 + local.get $2 f32.const 0.40000972151756287 - local.get $3 + local.get $2 f32.const 0.24279078841209412 f32.mul f32.add @@ -5678,7 +5383,7 @@ f32.mul f32.add local.tee $0 - local.get $7 + local.get $6 f32.add f32.const -3.168997136526741e-05 f32.mul @@ -5687,76 +5392,71 @@ f32.const 0.434326171875 f32.mul f32.add - local.get $7 + local.get $6 f32.const 0.434326171875 f32.mul f32.add - local.get $8 + local.get $7 f32.const 0.3010292053222656 f32.mul f32.add ) - (func $std/math/test_log10f (; 104 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_log10f (; 109 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.log10 local.get $1 local.get $2 call $std/math/check ) - (func $std/math/test_log1p (; 105 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) - (local $3 i32) + (func $std/math/test_log1p (; 110 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.log1p local.get $1 local.get $2 call $std/math/check - local.tee $3 - if + if (result i32) local.get $0 call $~lib/bindings/Math/log1p local.get $1 local.get $2 call $std/math/check - local.set $3 + else + i32.const 0 end - local.get $3 ) - (func $std/math/test_log1pf (; 106 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_log1pf (; 111 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.log1p local.get $1 local.get $2 call $std/math/check ) - (func $~lib/math/NativeMath.log2 (; 107 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.log2 (; 112 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) - (local $3 i32) - (local $4 i64) + (local $3 i64) + (local $4 f64) (local $5 f64) - (local $6 f64) - (local $7 i32) - (local $8 f64) + (local $6 i32) + (local $7 f64) local.get $0 i64.reinterpret_f64 - local.tee $4 + local.tee $3 i64.const 32 i64.shr_u i32.wrap_i64 - local.tee $3 + local.tee $2 i32.const 1048576 i32.lt_u - local.tee $2 - i32.eqz - if - local.get $3 + if (result i32) + i32.const 1 + else + local.get $2 i32.const 31 i32.shr_u - local.set $2 end - local.get $2 if - local.get $4 + local.get $3 i64.const 1 i64.shl i64.const 0 @@ -5769,7 +5469,7 @@ f64.div return end - local.get $3 + local.get $2 i32.const 31 i32.shr_u if @@ -5781,18 +5481,18 @@ return end i32.const -54 - local.set $7 + local.set $6 local.get $0 f64.const 18014398509481984 f64.mul i64.reinterpret_f64 - local.tee $4 + local.tee $3 i64.const 32 i64.shr_u i32.wrap_i64 - local.set $3 + local.set $2 else - local.get $3 + local.get $2 i32.const 2146435072 i32.ge_u if @@ -5800,28 +5500,25 @@ return else local.get $3 + i64.const 32 + i64.shl + i64.const 0 + i64.eq + i32.const 0 + local.get $2 i32.const 1072693248 i32.eq - local.tee $2 - if - local.get $4 - i64.const 32 - i64.shl - i64.const 0 - i64.eq - local.set $2 - end - local.get $2 + select if f64.const 0 return end end end - local.get $4 + local.get $3 i64.const 4294967295 i64.and - local.get $3 + local.get $2 i32.const 614242 i32.add local.tee $2 @@ -5841,12 +5538,12 @@ local.get $1 f64.add f64.div + local.tee $4 + local.get $4 + f64.mul local.tee $5 local.get $5 f64.mul - local.tee $6 - local.get $6 - f64.mul local.set $0 local.get $1 local.get $1 @@ -5861,13 +5558,13 @@ i64.const -4294967296 i64.and f64.reinterpret_i64 - local.tee $8 + local.tee $7 f64.sub local.get $1 f64.sub - local.get $5 + local.get $4 local.get $1 - local.get $6 + local.get $5 f64.const 0.6666666666666735 local.get $0 f64.const 0.2857142874366239 @@ -5903,18 +5600,18 @@ i32.shr_u i32.const 1023 i32.sub - local.get $7 + local.get $6 i32.add f64.convert_i32_s - local.tee $5 - local.get $8 + local.tee $4 + local.get $7 f64.const 1.4426950407214463 f64.mul - local.tee $6 + local.tee $5 f64.add local.set $1 local.get $0 - local.get $8 + local.get $7 f64.add f64.const 1.6751713164886512e-10 f64.mul @@ -5922,55 +5619,50 @@ f64.const 1.4426950407214463 f64.mul f64.add - local.get $5 + local.get $4 local.get $1 f64.sub - local.get $6 + local.get $5 f64.add f64.add local.get $1 f64.add ) - (func $std/math/test_log2 (; 108 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) - (local $3 i32) + (func $std/math/test_log2 (; 113 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.log2 local.get $1 local.get $2 call $std/math/check - local.tee $3 - if + if (result i32) local.get $0 call $~lib/bindings/Math/log2 local.get $1 local.get $2 call $std/math/check - local.set $3 + else + i32.const 0 end - local.get $3 ) - (func $~lib/math/NativeMathf.log2 (; 109 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.log2 (; 114 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 i32) - (local $2 i32) - (local $3 f32) - (local $4 i32) + (local $2 f32) + (local $3 i32) + (local $4 f32) (local $5 f32) (local $6 f32) - (local $7 f32) local.get $0 i32.reinterpret_f32 local.tee $1 i32.const 8388608 i32.lt_u - local.tee $2 - i32.eqz - if + if (result i32) + i32.const 1 + else local.get $1 i32.const 31 i32.shr_u - local.set $2 end - local.get $2 if local.get $1 i32.const 1 @@ -5996,7 +5688,7 @@ return end i32.const -25 - local.set $4 + local.set $3 local.get $0 f32.const 33554432 f32.mul @@ -6022,7 +5714,7 @@ local.get $1 i32.const 4913933 i32.add - local.tee $2 + local.tee $1 i32.const 8388607 i32.and i32.const 1060439283 @@ -6035,13 +5727,13 @@ local.get $0 f32.add f32.div + local.tee $4 + local.get $4 + f32.mul local.tee $5 local.get $5 f32.mul - local.tee $6 - local.get $6 - f32.mul - local.set $3 + local.set $2 local.get $0 local.get $0 f32.const 0.5 @@ -6055,22 +5747,22 @@ i32.const -4096 i32.and f32.reinterpret_i32 - local.tee $7 + local.tee $6 f32.sub local.get $0 f32.sub - local.get $5 + local.get $4 local.get $0 - local.get $6 + local.get $5 f32.const 0.6666666269302368 - local.get $3 + local.get $2 f32.const 0.2849878668785095 f32.mul f32.add f32.mul - local.get $3 + local.get $2 f32.const 0.40000972151756287 - local.get $3 + local.get $2 f32.const 0.24279078841209412 f32.mul f32.add @@ -6080,7 +5772,7 @@ f32.mul f32.add local.tee $0 - local.get $7 + local.get $6 f32.add f32.const -1.7605285393074155e-04 f32.mul @@ -6088,48 +5780,46 @@ f32.const 1.44287109375 f32.mul f32.add - local.get $7 + local.get $6 f32.const 1.44287109375 f32.mul f32.add - local.get $2 + local.get $1 i32.const 23 i32.shr_u i32.const 127 i32.sub - local.get $4 + local.get $3 i32.add f32.convert_i32_s f32.add ) - (func $std/math/test_log2f (; 110 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_log2f (; 115 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.log2 local.get $1 local.get $2 call $std/math/check ) - (func $std/math/test_max (; 111 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) - (local $3 i32) + (func $std/math/test_max (; 116 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 local.get $1 f64.max local.get $2 f64.const 0 call $std/math/check - local.tee $3 - if + if (result i32) local.get $0 local.get $1 call $~lib/bindings/Math/max local.get $2 f64.const 0 call $std/math/check - local.set $3 + else + i32.const 0 end - local.get $3 ) - (func $std/math/test_maxf (; 112 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_maxf (; 117 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 local.get $1 f32.max @@ -6137,27 +5827,25 @@ f32.const 0 call $std/math/check ) - (func $std/math/test_min (; 113 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) - (local $3 i32) + (func $std/math/test_min (; 118 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 local.get $1 f64.min local.get $2 f64.const 0 call $std/math/check - local.tee $3 - if + if (result i32) local.get $0 local.get $1 call $~lib/bindings/Math/min local.get $2 f64.const 0 call $std/math/check - local.set $3 + else + i32.const 0 end - local.get $3 ) - (func $std/math/test_minf (; 114 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_minf (; 119 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 local.get $1 f32.min @@ -6165,15 +5853,14 @@ f32.const 0 call $std/math/check ) - (func $~lib/math/NativeMath.mod (; 115 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $~lib/math/NativeMath.mod (; 120 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) (local $2 i64) (local $3 i64) (local $4 i64) (local $5 i64) - (local $6 i32) + (local $6 i64) (local $7 i64) (local $8 i64) - (local $9 i64) local.get $0 i64.reinterpret_f64 local.tee $2 @@ -6193,30 +5880,26 @@ local.get $2 i64.const 63 i64.shr_u - local.set $8 + local.set $7 local.get $3 i64.const 1 i64.shl - local.tee $7 + local.tee $6 i64.const 0 i64.eq - local.tee $6 - i32.eqz - if + if (result i32) + i32.const 1 + else local.get $4 i64.const 2047 i64.eq - local.set $6 end - local.get $6 - i32.eqz - if - local.get $1 + if (result i32) + i32.const 1 + else local.get $1 - f64.ne - local.set $6 + call $~lib/builtins/isNaN end - local.get $6 if local.get $0 local.get $1 @@ -6230,12 +5913,12 @@ local.get $2 i64.const 1 i64.shl - local.tee $9 - local.get $7 + local.tee $8 + local.get $6 i64.le_u if - local.get $7 - local.get $9 + local.get $6 + local.get $8 i64.eq br_if $folding-inner0 local.get $0 @@ -6362,7 +6045,7 @@ i64.add i64.shr_u end - local.get $8 + local.get $7 i64.const 63 i64.shl i64.or @@ -6373,15 +6056,13 @@ local.get $0 f64.mul ) - (func $std/math/test_mod (; 116 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) - (local $3 i32) + (func $std/math/test_mod (; 121 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMath.mod local.get $2 f64.const 0 call $std/math/check - local.tee $3 if (result i32) local.get $0 local.get $1 @@ -6390,10 +6071,10 @@ f64.const 0 call $std/math/check else - local.get $3 + i32.const 0 end ) - (func $~lib/math/NativeMathf.mod (; 117 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + (func $~lib/math/NativeMathf.mod (; 122 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -6403,7 +6084,7 @@ (local $8 i32) local.get $0 i32.reinterpret_f32 - local.tee $3 + local.tee $2 i32.const 23 i32.shr_u i32.const 255 @@ -6411,38 +6092,33 @@ local.set $4 local.get $1 i32.reinterpret_f32 - local.tee $5 + local.tee $3 i32.const 23 i32.shr_u i32.const 255 i32.and - local.set $6 - local.get $3 + local.set $5 + local.get $2 i32.const -2147483648 i32.and - local.set $8 - local.get $5 + local.set $7 + local.get $3 i32.const 1 i32.shl - local.tee $7 - i32.eqz - local.tee $2 - i32.eqz - if + local.tee $6 + if (result i32) local.get $4 i32.const 255 i32.eq - local.set $2 + else + i32.const 1 end - local.get $2 - i32.eqz - if - local.get $1 + if (result i32) + i32.const 1 + else local.get $1 - f32.ne - local.set $2 + call $~lib/builtins/isNaN end - local.get $2 if local.get $0 local.get $1 @@ -6453,15 +6129,15 @@ return end block $folding-inner0 - local.get $3 + local.get $2 i32.const 1 i32.shl - local.tee $2 - local.get $7 + local.tee $8 + local.get $6 i32.le_u if - local.get $2 - local.get $7 + local.get $6 + local.get $8 i32.eq br_if $folding-inner0 local.get $0 @@ -6469,16 +6145,16 @@ end local.get $4 if (result i32) - local.get $3 + local.get $2 i32.const 8388607 i32.and i32.const 8388608 i32.or else - local.get $3 + local.get $2 i32.const 1 local.get $4 - local.get $3 + local.get $2 i32.const 9 i32.shl i32.clz @@ -6488,30 +6164,30 @@ i32.shl end local.set $2 - local.get $6 + local.get $5 if (result i32) - local.get $5 + local.get $3 i32.const 8388607 i32.and i32.const 8388608 i32.or else - local.get $5 + local.get $3 i32.const 1 - local.get $6 local.get $5 + local.get $3 i32.const 9 i32.shl i32.clz i32.sub - local.tee $6 + local.tee $5 i32.sub i32.shl end local.set $3 loop $continue|0 local.get $4 - local.get $6 + local.get $5 i32.gt_s if local.get $2 @@ -6580,7 +6256,7 @@ i32.sub i32.shr_u end - local.get $8 + local.get $7 i32.or f32.reinterpret_i32 return @@ -6589,7 +6265,7 @@ local.get $0 f32.mul ) - (func $std/math/test_modf (; 118 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_modf (; 123 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMathf.mod @@ -6597,10 +6273,10 @@ f32.const 0 call $std/math/check ) - (func $~lib/math/NativeMath.pow (; 119 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) - (local $2 i32) + (func $~lib/math/NativeMath.pow (; 124 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (local $2 f64) (local $3 f64) - (local $4 f64) + (local $4 i32) (local $5 i32) (local $6 i32) (local $7 f64) @@ -6629,7 +6305,7 @@ local.tee $17 i32.const 2147483647 i32.and - local.set $5 + local.set $4 local.get $1 i64.reinterpret_f64 local.tee $16 @@ -6650,46 +6326,34 @@ f64.const 1 return end - local.get $5 + i32.const 1 + local.get $6 + i32.const 0 + i32.ne + i32.const 0 + local.get $8 + i32.const 2146435072 + i32.eq + select + i32.const 1 + local.get $8 i32.const 2146435072 i32.gt_s - local.tee $2 - i32.eqz - if - local.get $5 - i32.const 2146435072 - i32.eq - local.tee $2 - if - local.get $19 - i32.const 0 - i32.ne - local.set $2 - end - end - local.get $2 - i32.eqz - if - local.get $8 - i32.const 2146435072 - i32.gt_s - local.set $2 - end - local.get $2 - i32.eqz - if - local.get $8 - i32.const 2146435072 - i32.eq - local.tee $2 - if - local.get $6 - i32.const 0 - i32.ne - local.set $2 - end - end - local.get $2 + i32.const 1 + local.get $19 + i32.const 0 + i32.ne + i32.const 0 + local.get $4 + i32.const 2146435072 + i32.eq + select + local.get $4 + i32.const 2146435072 + i32.gt_s + select + select + select if local.get $0 local.get $1 @@ -6722,8 +6386,8 @@ i32.gt_s local.tee $13 select - local.tee $2 - local.get $2 + local.tee $5 + local.get $5 i32.const 52 i32.const 20 local.get $13 @@ -6732,13 +6396,13 @@ i32.sub local.tee $13 i32.shr_s - local.tee $2 + local.tee $5 local.get $13 i32.shl i32.eq if (result i32) i32.const 2 - local.get $2 + local.get $5 i32.const 1 i32.and i32.sub @@ -6758,13 +6422,13 @@ i32.const 2146435072 i32.eq if - local.get $5 + local.get $4 i32.const 1072693248 i32.sub local.get $19 i32.or if - local.get $5 + local.get $4 i32.const 1072693248 i32.ge_s if @@ -6835,66 +6499,58 @@ end local.get $0 f64.abs - local.set $4 + local.set $3 local.get $19 i32.eqz if - local.get $5 - i32.eqz - local.tee $2 - i32.eqz - if - local.get $5 - i32.const 2146435072 - i32.eq - local.set $2 - end - local.get $2 - i32.eqz - if - local.get $5 - i32.const 1072693248 - i32.eq - local.set $2 - end - local.get $2 + i32.const 1 + local.get $4 + i32.const 1072693248 + i32.eq + local.get $4 + i32.const 2146435072 + i32.eq + i32.const 1 + local.get $4 + select + select if f64.const 1 - local.get $4 + local.get $3 f64.div - local.get $4 + local.get $3 local.get $9 i32.const 0 i32.lt_s select - local.set $4 + local.set $3 local.get $17 i32.const 0 i32.lt_s if (result f64) - local.get $5 + local.get $4 i32.const 1072693248 i32.sub local.get $11 i32.or if (result f64) - local.get $4 + local.get $3 f64.neg - local.get $4 + local.get $3 local.get $11 i32.const 1 i32.eq select else - local.get $4 - local.get $4 + local.get $3 + local.get $3 f64.sub local.tee $0 local.get $0 f64.div end else - local.get $4 + local.get $3 end return end @@ -6932,7 +6588,7 @@ i32.const 1139802112 i32.gt_s if - local.get $5 + local.get $4 i32.const 1072693247 i32.le_s if @@ -6944,7 +6600,7 @@ select return end - local.get $5 + local.get $4 i32.const 1072693248 i32.ge_s if @@ -6957,60 +6613,56 @@ return end end - local.get $5 + local.get $4 i32.const 1072693247 i32.lt_s if + local.get $7 + f64.const 1.e+300 + f64.mul + f64.const 1.e+300 + f64.mul + local.get $7 + f64.const 1e-300 + f64.mul + f64.const 1e-300 + f64.mul local.get $9 i32.const 0 i32.lt_s - if (result f64) - local.get $7 - f64.const 1.e+300 - f64.mul - f64.const 1.e+300 - f64.mul - else - local.get $7 - f64.const 1e-300 - f64.mul - f64.const 1e-300 - f64.mul - end + select return end - local.get $5 + local.get $4 i32.const 1072693248 i32.gt_s if + local.get $7 + f64.const 1.e+300 + f64.mul + f64.const 1.e+300 + f64.mul + local.get $7 + f64.const 1e-300 + f64.mul + f64.const 1e-300 + f64.mul local.get $9 i32.const 0 i32.gt_s - if (result f64) - local.get $7 - f64.const 1.e+300 - f64.mul - f64.const 1.e+300 - f64.mul - else - local.get $7 - f64.const 1e-300 - f64.mul - f64.const 1e-300 - f64.mul - end + select return end - local.get $4 + local.get $3 f64.const 1 f64.sub - local.tee $3 - local.get $3 + local.tee $2 + local.get $2 f64.mul f64.const 0.5 - local.get $3 + local.get $2 f64.const 0.3333333333333333 - local.get $3 + local.get $2 f64.const 0.25 f64.mul f64.sub @@ -7019,10 +6671,10 @@ f64.mul local.set $0 f64.const 1.4426950216293335 - local.get $3 + local.get $2 f64.mul - local.tee $4 - local.get $3 + local.tee $3 + local.get $2 f64.const 1.9259629911266175e-08 f64.mul local.get $0 @@ -7038,50 +6690,50 @@ local.set $10 local.get $0 local.get $10 - local.get $4 + local.get $3 f64.sub f64.sub else i32.const 0 local.set $6 - local.get $5 + local.get $4 i32.const 1048576 i32.lt_s if (result i32) - local.get $4 + local.get $3 f64.const 9007199254740992 f64.mul - local.tee $4 + local.tee $3 i64.reinterpret_f64 i64.const 32 i64.shr_u i32.wrap_i64 - local.set $5 + local.set $4 i32.const -53 else i32.const 0 end - local.get $5 + local.get $4 i32.const 20 i32.shr_s i32.const 1023 i32.sub i32.add local.set $6 - local.get $5 + local.get $4 i32.const 1048575 i32.and - local.tee $2 + local.tee $5 i32.const 1072693248 i32.or - local.set $5 - local.get $2 + local.set $4 + local.get $5 i32.const 235662 i32.le_s if (result i32) i32.const 0 else - local.get $2 + local.get $5 i32.const 767610 i32.lt_s if (result i32) @@ -7091,38 +6743,38 @@ i32.const 1 i32.add local.set $6 - local.get $5 + local.get $4 i32.const -1048576 i32.add - local.set $5 + local.set $4 i32.const 0 end end - local.set $2 - local.get $4 + local.set $5 + local.get $3 i64.reinterpret_f64 i64.const 4294967295 i64.and - local.get $5 + local.get $4 i64.extend_i32_s i64.const 32 i64.shl i64.or f64.reinterpret_i64 - local.tee $4 + local.tee $3 f64.const 1.5 f64.const 1 - local.get $2 + local.get $5 select local.tee $0 f64.sub local.tee $10 f64.const 1 - local.get $4 + local.get $3 local.get $0 f64.add f64.div - local.tee $3 + local.tee $2 f64.mul local.tee $18 i64.reinterpret_f64 @@ -7130,15 +6782,15 @@ i64.and f64.reinterpret_i64 local.set $14 + local.get $3 local.get $4 - local.get $5 i32.const 1 i32.shr_s i32.const 536870912 i32.or i32.const 524288 i32.add - local.get $2 + local.get $5 i32.const 18 i32.shl i32.add @@ -7146,7 +6798,7 @@ i64.const 32 i64.shl f64.reinterpret_i64 - local.tee $4 + local.tee $3 local.get $0 f64.sub f64.sub @@ -7187,10 +6839,10 @@ f64.mul f64.add f64.mul - local.get $3 + local.get $2 local.get $10 local.get $14 - local.get $4 + local.get $3 f64.mul f64.sub local.get $14 @@ -7198,7 +6850,7 @@ f64.mul f64.sub f64.mul - local.tee $3 + local.tee $2 local.get $14 local.get $18 f64.add @@ -7212,8 +6864,8 @@ f64.reinterpret_i64 local.tee $10 f64.mul - local.tee $4 - local.get $3 + local.tee $3 + local.get $2 local.get $10 f64.mul local.get $0 @@ -7232,15 +6884,15 @@ i64.const -4294967296 i64.and f64.reinterpret_i64 - local.tee $3 + local.tee $2 f64.mul local.tee $20 f64.const -7.028461650952758e-09 - local.get $3 + local.get $2 f64.mul local.get $0 + local.get $2 local.get $3 - local.get $4 f64.sub f64.sub f64.const 0.9617966939259756 @@ -7248,16 +6900,16 @@ f64.add f64.const 1.350039202129749e-08 f64.const 0 - local.get $2 + local.get $5 select f64.add - local.tee $3 + local.tee $2 f64.add f64.const 0.5849624872207642 f64.const 0 - local.get $2 + local.get $5 select - local.tee $4 + local.tee $3 f64.add local.get $6 f64.convert_i32_s @@ -7268,17 +6920,17 @@ i64.and f64.reinterpret_i64 local.set $10 - local.get $3 + local.get $2 local.get $10 local.get $0 f64.sub - local.get $4 + local.get $3 f64.sub local.get $20 f64.sub f64.sub end - local.set $4 + local.set $3 local.get $1 local.get $1 i64.reinterpret_f64 @@ -7290,20 +6942,20 @@ local.get $10 f64.mul local.get $1 - local.get $4 + local.get $3 f64.mul f64.add local.tee $1 local.get $0 local.get $10 f64.mul - local.tee $3 + local.tee $2 f64.add local.tee $0 i64.reinterpret_f64 local.tee $16 i32.wrap_i64 - local.set $2 + local.set $5 block $folding-inner1 block $folding-inner0 local.get $16 @@ -7317,16 +6969,16 @@ local.get $12 i32.const 1083179008 i32.sub - local.get $2 + local.get $5 i32.or - br_if $folding-inner0 local.get $1 f64.const 8.008566259537294e-17 f64.add local.get $0 - local.get $3 + local.get $2 f64.sub f64.gt + i32.or br_if $folding-inner0 else local.get $12 @@ -7338,14 +6990,14 @@ local.get $12 i32.const -1064252416 i32.sub - local.get $2 + local.get $5 i32.or - br_if $folding-inner1 local.get $1 local.get $0 - local.get $3 + local.get $2 f64.sub f64.le + i32.or br_if $folding-inner1 end end @@ -7357,7 +7009,7 @@ i32.shr_s i32.const 1023 i32.sub - local.set $2 + local.set $5 i32.const 0 local.set $6 local.get $13 @@ -7365,7 +7017,7 @@ i32.gt_s if i32.const 1048576 - local.get $2 + local.get $5 i32.const 1 i32.add i32.shr_s @@ -7378,9 +7030,9 @@ i32.shr_s i32.const 1023 i32.sub - local.set $2 + local.set $5 i32.const 1048575 - local.get $2 + local.get $5 i32.shr_s i32.const -1 i32.xor @@ -7397,7 +7049,7 @@ i32.const 1048576 i32.or i32.const 20 - local.get $2 + local.get $5 i32.sub i32.shr_s local.set $6 @@ -7410,13 +7062,13 @@ i32.lt_s select local.set $6 - local.get $3 + local.get $2 local.get $0 f64.sub - local.set $3 + local.set $2 end local.get $1 - local.get $3 + local.get $2 f64.add i64.reinterpret_f64 i64.const -4294967296 @@ -7425,10 +7077,10 @@ local.tee $0 f64.const 0.6931471824645996 f64.mul - local.tee $4 + local.tee $3 local.get $1 local.get $0 - local.get $3 + local.get $2 f64.sub f64.sub f64.const 0.6931471805599453 @@ -7439,14 +7091,14 @@ f64.add local.tee $1 f64.add - local.tee $3 - local.get $3 + local.tee $2 + local.get $2 f64.mul local.set $0 local.get $7 f64.const 1 - local.get $3 - local.get $3 + local.get $2 + local.get $2 local.get $0 f64.const 0.16666666666666602 local.get $0 @@ -7474,17 +7126,17 @@ f64.sub f64.div local.get $1 + local.get $2 local.get $3 - local.get $4 f64.sub f64.sub local.tee $0 - local.get $3 + local.get $2 local.get $0 f64.mul f64.add f64.sub - local.get $3 + local.get $2 f64.sub f64.sub local.tee $0 @@ -7496,7 +7148,7 @@ i32.const 20 i32.shl i32.add - local.tee $2 + local.tee $5 i32.const 20 i32.shr_s i32.const 0 @@ -7510,7 +7162,7 @@ i64.reinterpret_f64 i64.const 4294967295 i64.and - local.get $2 + local.get $5 i64.extend_i32_s i64.const 32 i64.shl @@ -7533,27 +7185,25 @@ f64.const 1e-300 f64.mul ) - (func $std/math/test_pow (; 120 ;) (type $FUNCSIG$idddd) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (result i32) - (local $4 i32) + (func $std/math/test_pow (; 125 ;) (type $FUNCSIG$idddd) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMath.pow local.get $2 local.get $3 call $std/math/check - local.tee $4 - if + if (result i32) local.get $0 local.get $1 call $~lib/bindings/Math/pow local.get $2 local.get $3 call $std/math/check - local.set $4 + else + i32.const 0 end - local.get $4 ) - (func $~lib/math/NativeMathf.pow (; 121 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + (func $~lib/math/NativeMathf.pow (; 126 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) (local $2 f32) (local $3 f32) (local $4 i32) @@ -7574,7 +7224,7 @@ local.tee $8 i32.const 2147483647 i32.and - local.set $6 + local.set $5 local.get $1 i32.reinterpret_f32 local.tee $11 @@ -7586,18 +7236,14 @@ f32.const 1 return end - local.get $6 + i32.const 1 + local.get $10 i32.const 2139095040 i32.gt_s - local.tee $4 - i32.eqz - if - local.get $10 - i32.const 2139095040 - i32.gt_s - local.set $4 - end - local.get $4 + local.get $5 + i32.const 2139095040 + i32.gt_s + select if local.get $0 local.get $1 @@ -7626,14 +7272,14 @@ i32.sub local.tee $12 i32.shr_s - local.tee $4 + local.tee $6 local.get $12 i32.shl local.get $10 i32.eq if (result i32) i32.const 2 - local.get $4 + local.get $6 i32.const 1 i32.and i32.sub @@ -7644,20 +7290,20 @@ i32.const 0 end end - local.set $5 + local.set $4 end local.get $10 i32.const 2139095040 i32.eq if - local.get $6 + local.get $5 i32.const 1065353216 i32.eq if f32.const nan:0x400000 return else - local.get $6 + local.get $5 i32.const 1065353216 i32.gt_s if @@ -7725,25 +7371,18 @@ local.get $0 f32.abs local.set $3 - local.get $6 - i32.const 2139095040 + i32.const 1 + local.get $5 + i32.const 1065353216 i32.eq - local.tee $4 - i32.eqz - if - local.get $6 - i32.eqz - local.set $4 - end - local.get $4 + i32.const 1 + local.get $5 i32.eqz - if - local.get $6 - i32.const 1065353216 - i32.eq - local.set $4 - end - local.get $4 + local.get $5 + i32.const 2139095040 + i32.eq + select + select if f32.const 1 local.get $3 @@ -7758,16 +7397,16 @@ i32.const 0 i32.lt_s if (result f32) - local.get $6 + local.get $5 i32.const 1065353216 i32.sub - local.get $5 + local.get $4 i32.or if (result f32) local.get $3 f32.neg local.get $3 - local.get $5 + local.get $4 i32.const 1 i32.eq select @@ -7790,7 +7429,7 @@ i32.const 0 i32.lt_s if - local.get $5 + local.get $4 i32.eqz if local.get $0 @@ -7803,7 +7442,7 @@ end f32.const -1 f32.const 1 - local.get $5 + local.get $4 i32.const 1 i32.eq select @@ -7813,48 +7452,44 @@ i32.const 1291845632 i32.gt_s if (result f32) - local.get $6 + local.get $5 i32.const 1065353208 i32.lt_s if + local.get $7 + f32.const 1000000015047466219876688e6 + f32.mul + f32.const 1000000015047466219876688e6 + f32.mul + local.get $7 + f32.const 1.0000000031710769e-30 + f32.mul + f32.const 1.0000000031710769e-30 + f32.mul local.get $11 i32.const 0 i32.lt_s - if (result f32) - local.get $7 - f32.const 1000000015047466219876688e6 - f32.mul - f32.const 1000000015047466219876688e6 - f32.mul - else - local.get $7 - f32.const 1.0000000031710769e-30 - f32.mul - f32.const 1.0000000031710769e-30 - f32.mul - end + select return end - local.get $6 + local.get $5 i32.const 1065353223 i32.gt_s if + local.get $7 + f32.const 1000000015047466219876688e6 + f32.mul + f32.const 1000000015047466219876688e6 + f32.mul + local.get $7 + f32.const 1.0000000031710769e-30 + f32.mul + f32.const 1.0000000031710769e-30 + f32.mul local.get $11 i32.const 0 i32.gt_s - if (result f32) - local.get $7 - f32.const 1000000015047466219876688e6 - f32.mul - f32.const 1000000015047466219876688e6 - f32.mul - else - local.get $7 - f32.const 1.0000000031710769e-30 - f32.mul - f32.const 1.0000000031710769e-30 - f32.mul - end + select return end local.get $3 @@ -7899,8 +7534,8 @@ f32.sub else i32.const 0 - local.set $5 - local.get $6 + local.set $4 + local.get $5 i32.const 8388608 i32.lt_s if (result i32) @@ -7908,55 +7543,55 @@ f32.const 16777216 f32.mul i32.reinterpret_f32 - local.set $6 + local.set $5 i32.const -24 else i32.const 0 end - local.get $6 + local.get $5 i32.const 23 i32.shr_s i32.const 127 i32.sub i32.add - local.set $5 - local.get $6 + local.set $4 + local.get $5 i32.const 8388607 i32.and - local.tee $4 + local.tee $6 i32.const 1065353216 i32.or - local.set $6 - local.get $4 + local.set $5 + local.get $6 i32.const 1885297 i32.le_s if (result i32) i32.const 0 else - local.get $4 + local.get $6 i32.const 6140887 i32.lt_s if (result i32) i32.const 1 else - local.get $5 + local.get $4 i32.const 1 i32.add - local.set $5 - local.get $6 + local.set $4 + local.get $5 i32.const 8388608 i32.sub - local.set $6 + local.set $5 i32.const 0 end end - local.set $4 - local.get $6 + local.set $6 + local.get $5 f32.reinterpret_i32 local.tee $3 f32.const 1.5 f32.const 1 - local.get $4 + local.get $6 select local.tee $0 f32.sub @@ -7975,7 +7610,7 @@ f32.reinterpret_i32 local.set $13 local.get $3 - local.get $6 + local.get $5 i32.const 1 i32.shr_s i32.const -4096 @@ -7984,7 +7619,7 @@ i32.or i32.const 4194304 i32.add - local.get $4 + local.get $6 i32.const 21 i32.shl i32.add @@ -8091,18 +7726,18 @@ f32.add f32.const 1.5632208487659227e-06 f32.const 0 - local.get $4 + local.get $6 select f32.add local.tee $2 f32.add f32.const 0.5849609375 f32.const 0 - local.get $4 + local.get $6 select local.tee $3 f32.add - local.get $5 + local.get $4 f32.convert_i32_s local.tee $0 f32.add @@ -8192,15 +7827,15 @@ i32.shr_s i32.const 127 i32.sub - local.set $4 + local.set $6 i32.const 0 - local.set $5 + local.set $4 local.get $12 i32.const 1056964608 i32.gt_s if i32.const 8388608 - local.get $4 + local.get $6 i32.const 1 i32.add i32.shr_s @@ -8213,9 +7848,9 @@ i32.shr_s i32.const 127 i32.sub - local.set $4 + local.set $6 i32.const 8388607 - local.get $4 + local.get $6 i32.shr_s i32.const -1 i32.xor @@ -8229,19 +7864,19 @@ i32.const 8388608 i32.or i32.const 23 - local.get $4 + local.get $6 i32.sub i32.shr_s - local.set $5 + local.set $4 i32.const 0 - local.get $5 + local.get $4 i32.sub - local.get $5 + local.get $4 local.get $8 i32.const 0 i32.lt_s select - local.set $5 + local.set $4 local.get $2 local.get $0 f32.sub @@ -8321,21 +7956,21 @@ f32.sub local.tee $0 i32.reinterpret_f32 - local.get $5 + local.get $4 i32.const 23 i32.shl i32.add - local.tee $4 + local.tee $6 i32.const 23 i32.shr_s i32.const 0 i32.le_s if (result f32) local.get $0 - local.get $5 + local.get $4 call $~lib/math/NativeMathf.scalbn else - local.get $4 + local.get $6 f32.reinterpret_i32 end f32.mul @@ -8354,7 +7989,7 @@ f32.const 1.0000000031710769e-30 f32.mul ) - (func $std/math/test_powf (; 122 ;) (type $FUNCSIG$iffff) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (result i32) + (func $std/math/test_powf (; 127 ;) (type $FUNCSIG$iffff) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMathf.pow @@ -8362,7 +7997,28 @@ local.get $3 call $std/math/check ) - (func $~lib/math/splitMix32 (; 123 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/math/murmurHash3 (; 128 ;) (type $FUNCSIG$jj) (param $0 i64) (result i64) + local.get $0 + i64.const 33 + i64.shr_u + local.get $0 + i64.xor + i64.const -49064778989728563 + i64.mul + local.tee $0 + local.get $0 + i64.const 33 + i64.shr_u + i64.xor + i64.const -4265267296055464877 + i64.mul + local.tee $0 + local.get $0 + i64.const 33 + i64.shr_u + i64.xor + ) + (func $~lib/math/splitMix32 (; 129 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 1831565813 i32.add @@ -8394,62 +8050,26 @@ i32.shr_u i32.xor ) - (func $~lib/math/NativeMath.seedRandom (; 124 ;) (type $FUNCSIG$vj) (param $0 i64) - (local $1 i64) + (func $~lib/math/NativeMath.seedRandom (; 130 ;) (type $FUNCSIG$vj) (param $0 i64) local.get $0 i64.eqz if i32.const 0 - i32.const 112 - i32.const 978 + i32.const 144 + i32.const 1020 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 global.set $~lib/math/random_seeded local.get $0 - i64.const 33 - i64.shr_u - local.get $0 - i64.xor - i64.const -49064778989728563 - i64.mul - local.tee $1 - local.get $1 - i64.const 33 - i64.shr_u - i64.xor - i64.const -4265267296055464877 - i64.mul - local.tee $1 - local.get $1 - i64.const 33 - i64.shr_u - i64.xor + call $~lib/math/murmurHash3 global.set $~lib/math/random_state0_64 global.get $~lib/math/random_state0_64 i64.const -1 i64.xor - local.tee $1 - local.get $1 - i64.const 33 - i64.shr_u - i64.xor - i64.const -49064778989728563 - i64.mul - local.tee $1 - local.get $1 - i64.const 33 - i64.shr_u - i64.xor - i64.const -4265267296055464877 - i64.mul - local.tee $1 - local.get $1 - i64.const 33 - i64.shr_u - i64.xor + call $~lib/math/murmurHash3 global.set $~lib/math/random_state1_64 local.get $0 i32.wrap_i64 @@ -8459,17 +8079,17 @@ call $~lib/math/splitMix32 global.set $~lib/math/random_state1_32 ) - (func $~lib/math/NativeMath.random (; 125 ;) (type $FUNCSIG$d) (result f64) + (func $~lib/math/NativeMath.random (; 131 ;) (type $FUNCSIG$d) (result f64) (local $0 i64) (local $1 i64) global.get $~lib/math/random_seeded i32.eqz if - i32.const 0 - i32.const 112 - i32.const 987 + i32.const 184 + i32.const 144 + i32.const 1029 i32.const 24 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/math/random_state0_64 @@ -8506,17 +8126,17 @@ f64.const 1 f64.sub ) - (func $~lib/math/NativeMathf.random (; 126 ;) (type $FUNCSIG$f) (result f32) + (func $~lib/math/NativeMathf.random (; 132 ;) (type $FUNCSIG$f) (result f32) (local $0 i32) (local $1 i32) global.get $~lib/math/random_seeded i32.eqz if - i32.const 0 - i32.const 112 - i32.const 2219 + i32.const 184 + i32.const 144 + i32.const 2309 i32.const 24 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/math/random_state0_32 @@ -8552,7 +8172,7 @@ f32.const 1 f32.sub ) - (func $std/math/test_round (; 127 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) + (func $std/math/test_round (; 133 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) local.get $0 f64.const 0.5 f64.add @@ -8563,7 +8183,7 @@ f64.const 0 call $std/math/check ) - (func $std/math/test_roundf (; 128 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) + (func $std/math/test_roundf (; 134 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) local.get $0 f32.const 0.5 f32.add @@ -8574,45 +8194,39 @@ f32.const 0 call $std/math/check ) - (func $std/math/test_sign (; 129 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) + (func $std/math/test_sign (; 135 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) (local $2 f64) - (local $3 i32) local.get $0 local.set $2 f64.const 1 - f64.const -1 local.get $2 + f64.copysign local.get $2 - f64.const 0 - f64.lt - select local.get $0 + f64.abs f64.const 0 f64.gt select local.get $1 f64.const 0 call $std/math/check - local.tee $3 - if + if (result i32) local.get $0 call $~lib/bindings/Math/sign local.get $1 f64.const 0 call $std/math/check - local.set $3 + else + i32.const 0 end - local.get $3 ) - (func $std/math/test_signf (; 130 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) + (func $std/math/test_signf (; 136 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) f32.const 1 - f32.const -1 local.get $0 + f32.copysign local.get $0 - f32.const 0 - f32.lt - select local.get $0 + f32.abs f32.const 0 f32.gt select @@ -8620,15 +8234,14 @@ f32.const 0 call $std/math/check ) - (func $~lib/math/NativeMath.rem (; 131 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $~lib/math/NativeMath.rem (; 137 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) (local $2 i64) (local $3 i64) (local $4 i64) (local $5 i32) (local $6 i64) - (local $7 i32) - (local $8 f64) - (local $9 i32) + (local $7 f64) + (local $8 i32) local.get $0 i64.reinterpret_f64 local.tee $2 @@ -8649,30 +8262,22 @@ i64.const 63 i64.shr_u i32.wrap_i64 - local.set $9 - block (result i32) - local.get $4 - i64.const 1 - i64.shl - i64.const 0 - i64.eq - local.tee $5 - i32.eqz - if - local.get $3 - i64.const 2047 - i64.eq - local.set $5 - end - local.get $5 - i32.eqz - end + local.set $8 + i32.const 1 + local.get $3 + i64.const 2047 + i64.eq + local.get $4 + i64.const 1 + i64.shl + i64.const 0 + i64.eq + select if (result i32) - local.get $1 - local.get $1 - f64.ne + i32.const 1 else - local.get $5 + local.get $1 + call $~lib/builtins/isNaN end if local.get $0 @@ -8763,23 +8368,23 @@ local.get $4 i64.ge_u if - local.get $7 - i32.const 1 - i32.add - local.set $7 local.get $2 local.get $4 i64.sub local.set $2 + local.get $5 + i32.const 1 + i32.add + local.set $5 end local.get $2 i64.const 1 i64.shl local.set $2 - local.get $7 + local.get $5 i32.const 1 i32.shl - local.set $7 + local.set $5 local.get $3 i64.const 1 i64.sub @@ -8787,24 +8392,22 @@ br $continue|1 end end - block (result i32) + local.get $2 + local.get $4 + i64.ge_u + if local.get $2 local.get $4 - i64.ge_u - if - local.get $7 - i32.const 1 - i32.add - local.set $7 - local.get $2 - local.get $4 - i64.sub - local.set $2 - end - local.get $2 - i64.const 0 - i64.eq + i64.sub + local.set $2 + local.get $5 + i32.const 1 + i32.add + local.set $5 end + local.get $2 + i64.const 0 + i64.eq if i64.const -60 local.set $3 @@ -8825,82 +8428,70 @@ end local.get $1 f64.abs - local.set $0 + local.set $1 + local.get $2 + i64.const 4503599627370496 + i64.sub + local.get $3 + i64.const 52 + i64.shl + i64.or + local.get $2 + i64.const 0 + local.get $3 + i64.sub + i64.const 1 + i64.add + i64.shr_u local.get $3 i64.const 0 i64.gt_s - if (result i64) - local.get $2 - i64.const 4503599627370496 - i64.sub - local.get $3 - i64.const 52 - i64.shl - i64.or - else - local.get $2 - i64.const 0 - local.get $3 - i64.sub - i64.const 1 - i64.add - i64.shr_u - end + select f64.reinterpret_i64 - local.tee $1 - local.get $1 + local.tee $0 + local.get $0 f64.add - local.set $8 - local.get $1 + local.set $7 local.get $0 + local.get $1 f64.sub + local.get $0 + i32.const 1 + i32.const 1 + local.get $5 + i32.const 1 + i32.and + i32.const 0 + local.get $7 + local.get $1 + f64.eq + select + local.get $7 local.get $1 + f64.gt + select + i32.const 0 + local.get $3 + i64.const 1 + i64.add + local.get $6 + i64.eq + select local.get $3 local.get $6 i64.eq - local.tee $5 - if (result i32) - local.get $5 - else - local.get $3 - i64.const 1 - i64.add - local.get $6 - i64.eq - local.tee $5 - if (result i32) - local.get $8 - local.get $0 - f64.gt - local.tee $5 - if (result i32) - local.get $5 - else - local.get $8 - local.get $0 - f64.eq - local.tee $5 - if (result i32) - local.get $7 - i32.const 1 - i32.and - else - local.get $5 - end - end - else - local.get $5 - end - end + select select local.set $0 + local.get $8 + if + local.get $0 + f64.neg + local.set $0 + end local.get $0 - f64.neg - local.get $0 - local.get $9 - select ) - (func $std/math/test_rem (; 132 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_rem (; 138 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMath.rem @@ -8908,7 +8499,7 @@ f64.const 0 call $std/math/check ) - (func $~lib/math/NativeMathf.rem (; 133 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + (func $~lib/math/NativeMathf.rem (; 139 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -8918,7 +8509,7 @@ (local $8 i32) local.get $0 i32.reinterpret_f32 - local.tee $4 + local.tee $2 i32.const 23 i32.shr_u i32.const 255 @@ -8926,38 +8517,29 @@ local.set $3 local.get $1 i32.reinterpret_f32 - local.tee $5 + local.tee $4 i32.const 23 i32.shr_u i32.const 255 i32.and - local.set $6 - local.get $4 + local.set $5 + local.get $2 i32.const 31 i32.shr_u local.set $8 - block (result i32) - local.get $5 - i32.const 1 - i32.shl - i32.eqz - local.tee $2 - i32.eqz - if - local.get $3 - i32.const 255 - i32.eq - local.set $2 - end - local.get $2 - i32.eqz - end + local.get $3 + i32.const 255 + i32.eq + i32.const 1 + local.get $4 + i32.const 1 + i32.shl + select if (result i32) - local.get $1 - local.get $1 - f32.ne + i32.const 1 else - local.get $2 + local.get $1 + call $~lib/builtins/isNaN end if local.get $0 @@ -8968,7 +8550,7 @@ f32.div return end - local.get $4 + local.get $2 i32.const 1 i32.shl i32.eqz @@ -8978,16 +8560,16 @@ end local.get $3 if (result i32) - local.get $4 + local.get $2 i32.const 8388607 i32.and i32.const 8388608 i32.or else - local.get $4 + local.get $2 i32.const 1 local.get $3 - local.get $4 + local.get $2 i32.const 9 i32.shl i32.clz @@ -8997,38 +8579,38 @@ i32.shl end local.set $2 - local.get $6 + local.get $5 if (result i32) - local.get $5 + local.get $4 i32.const 8388607 i32.and i32.const 8388608 i32.or else - local.get $5 + local.get $4 i32.const 1 - local.get $6 local.get $5 + local.get $4 i32.const 9 i32.shl i32.clz i32.sub - local.tee $6 + local.tee $5 i32.sub i32.shl end - local.set $4 + local.set $6 i32.const 0 - local.set $5 + local.set $4 block $break|0 local.get $3 - local.get $6 + local.get $5 i32.lt_s if local.get $3 i32.const 1 i32.add - local.get $6 + local.get $5 i32.eq br_if $break|0 local.get $0 @@ -9036,19 +8618,19 @@ end loop $continue|1 local.get $3 - local.get $6 + local.get $5 i32.gt_s if local.get $2 - local.get $4 + local.get $6 i32.ge_u if (result i32) - local.get $5 + local.get $4 i32.const 1 i32.add - local.set $5 + local.set $4 local.get $2 - local.get $4 + local.get $6 i32.sub else local.get $2 @@ -9056,10 +8638,10 @@ i32.const 1 i32.shl local.set $2 - local.get $5 + local.get $4 i32.const 1 i32.shl - local.set $5 + local.set $4 local.get $3 i32.const 1 i32.sub @@ -9069,114 +8651,103 @@ end block (result i32) local.get $2 - local.get $4 + local.get $6 i32.ge_u if - local.get $5 + local.get $4 i32.const 1 i32.add - local.set $5 + local.set $4 local.get $2 - local.get $4 + local.get $6 i32.sub local.set $2 end local.get $2 + i32.eqz end if + i32.const -30 + local.set $3 + else local.get $3 local.get $2 i32.const 8 i32.shl i32.clz - local.tee $4 + local.tee $6 i32.sub local.set $3 local.get $2 - local.get $4 + local.get $6 i32.shl local.set $2 - else - i32.const -30 - local.set $3 end end local.get $1 f32.abs - local.set $0 + local.set $1 + local.get $2 + i32.const 8388608 + i32.sub + local.get $3 + i32.const 23 + i32.shl + i32.or + local.get $2 + i32.const 1 + local.get $3 + i32.sub + i32.shr_u local.get $3 i32.const 0 i32.gt_s - if (result i32) - local.get $2 - i32.const 8388608 - i32.sub - local.get $3 - i32.const 23 - i32.shl - i32.or - else - local.get $2 - i32.const 1 - local.get $3 - i32.sub - i32.shr_u - end + select f32.reinterpret_i32 - local.tee $1 - local.get $1 + local.tee $0 + local.get $0 f32.add local.set $7 - local.get $1 local.get $0 + local.get $1 f32.sub + local.get $0 + i32.const 1 + i32.const 1 + local.get $4 + i32.const 1 + i32.and + i32.const 0 + local.get $7 local.get $1 + f32.eq + select + local.get $7 + local.get $1 + f32.gt + select + i32.const 0 local.get $3 - local.get $6 + i32.const 1 + i32.add + local.get $5 i32.eq - local.tee $2 - if (result i32) - local.get $2 - else - local.get $3 - i32.const 1 - i32.add - local.get $6 - i32.eq - local.tee $2 - if (result i32) - local.get $7 - local.get $0 - f32.gt - local.tee $2 - if (result i32) - local.get $2 - else - local.get $7 - local.get $0 - f32.eq - local.tee $2 - if (result i32) - local.get $5 - i32.const 1 - i32.and - else - local.get $2 - end - end - else - local.get $2 - end - end + select + local.get $3 + local.get $5 + i32.eq + select select local.set $0 - local.get $0 - f32.neg - local.get $0 local.get $8 - select + if + local.get $0 + f32.neg + local.set $0 + end + local.get $0 ) - (func $std/math/test_remf (; 134 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_remf (; 140 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMathf.rem @@ -9184,519 +8755,287 @@ f32.const 0 call $std/math/check ) - (func $~lib/math/NativeMathf.sin (; 135 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.sin (; 141 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 f64) - (local $2 f64) - (local $3 i32) - (local $4 i64) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i64) + (local $2 i32) + (local $3 f64) + (local $4 i32) + (local $5 i64) + (local $6 i64) + (local $7 f64) + (local $8 i32) (local $9 i32) (local $10 i64) (local $11 i64) local.get $0 i32.reinterpret_f32 - local.tee $3 + local.tee $2 i32.const 31 i32.shr_u - local.set $7 - block $folding-inner0 - local.get $3 - i32.const 2147483647 - i32.and - local.tee $3 - i32.const 1061752794 - i32.le_u + local.set $9 + local.get $2 + i32.const 2147483647 + i32.and + local.tee $2 + i32.const 1061752794 + i32.le_u + if + local.get $2 + i32.const 964689920 + i32.lt_u if - local.get $3 - i32.const 964689920 - i32.lt_u - if - local.get $0 - return - end local.get $0 - f64.promote_f32 - local.tee $1 - local.get $1 - f64.mul - local.tee $2 - local.get $1 - f64.mul - local.set $5 - br $folding-inner0 + return end + local.get $0 + f64.promote_f32 + local.tee $3 local.get $3 - i32.const 1081824209 - i32.le_u + f64.mul + local.tee $1 + local.get $3 + f64.mul + local.set $7 + local.get $3 + local.get $7 + f64.const -0.16666666641626524 + local.get $1 + f64.const 0.008333329385889463 + f64.mul + f64.add + f64.mul + f64.add + local.get $7 + local.get $1 + local.get $1 + f64.mul + f64.mul + f64.const -1.9839334836096632e-04 + local.get $1 + f64.const 2.718311493989822e-06 + f64.mul + f64.add + f64.mul + f64.add + f32.demote_f64 + return + end + local.get $2 + i32.const 2139095040 + i32.ge_u + if + local.get $0 + local.get $0 + f32.sub + return + end + block $~lib/math/rempio2f|inlined.1 (result i32) + local.get $2 + i32.const 1305022427 + i32.lt_u if - local.get $3 - i32.const 1075235811 - i32.le_u - if - local.get $7 - if (result f32) - local.get $0 - f64.promote_f32 - f64.const 1.5707963267948966 - f64.add - local.tee $1 - local.get $1 - f64.mul - local.tee $1 - local.get $1 - f64.mul - local.set $2 - f64.const 1 - local.get $1 - f64.const -0.499999997251031 - f64.mul - f64.add - local.get $2 - f64.const 0.04166662332373906 - f64.mul - f64.add - local.get $2 - local.get $1 - f64.mul - f64.const -0.001388676377460993 - local.get $1 - f64.const 2.439044879627741e-05 - f64.mul - f64.add - f64.mul - f64.add - f32.demote_f64 - f32.neg - else - local.get $0 - f64.promote_f32 - f64.const 1.5707963267948966 - f64.sub - local.tee $1 - local.get $1 - f64.mul - local.tee $1 - local.get $1 - f64.mul - local.set $2 - f64.const 1 - local.get $1 - f64.const -0.499999997251031 - f64.mul - f64.add - local.get $2 - f64.const 0.04166662332373906 - f64.mul - f64.add - local.get $2 - local.get $1 - f64.mul - f64.const -0.001388676377460993 - local.get $1 - f64.const 2.439044879627741e-05 - f64.mul - f64.add - f64.mul - f64.add - f32.demote_f64 - end - return - end local.get $0 f64.promote_f32 - local.tee $1 - f64.const 3.141592653589793 - f64.add - local.get $1 - f64.const 3.141592653589793 - f64.sub - local.get $7 - select - f64.neg - local.tee $1 - local.get $1 - f64.mul - local.tee $2 - local.get $1 - f64.mul - local.set $5 - br $folding-inner0 - end - local.get $3 - i32.const 1088565717 - i32.le_u - if - local.get $3 - i32.const 1085271519 - i32.le_u - if - local.get $7 - if (result f32) - local.get $0 - f64.promote_f32 - f64.const 4.71238898038469 - f64.add - local.tee $1 - local.get $1 - f64.mul - local.tee $1 - local.get $1 - f64.mul - local.set $2 - f64.const 1 - local.get $1 - f64.const -0.499999997251031 - f64.mul - f64.add - local.get $2 - f64.const 0.04166662332373906 - f64.mul - f64.add - local.get $2 - local.get $1 - f64.mul - f64.const -0.001388676377460993 - local.get $1 - f64.const 2.439044879627741e-05 - f64.mul - f64.add - f64.mul - f64.add - f32.demote_f64 - else - local.get $0 - f64.promote_f32 - f64.const 4.71238898038469 - f64.sub - local.tee $1 - local.get $1 - f64.mul - local.tee $1 - local.get $1 - f64.mul - local.set $2 - f64.const 1 - local.get $1 - f64.const -0.499999997251031 - f64.mul - f64.add - local.get $2 - f64.const 0.04166662332373906 - f64.mul - f64.add - local.get $2 - local.get $1 - f64.mul - f64.const -0.001388676377460993 - local.get $1 - f64.const 2.439044879627741e-05 - f64.mul - f64.add - f64.mul - f64.add - f32.demote_f64 - f32.neg - end - return - end local.get $0 f64.promote_f32 - local.tee $1 - f64.const 6.283185307179586 - f64.add - local.get $1 - f64.const 6.283185307179586 - f64.sub - local.get $7 - select - local.tee $2 - local.get $2 + f64.const 0.6366197723675814 f64.mul + f64.nearest local.tee $1 - local.get $2 - f64.mul - local.set $5 - local.get $2 - local.get $5 - f64.const -0.16666666641626524 - local.get $1 - f64.const 0.008333329385889463 - f64.mul - f64.add + f64.const 1.5707963109016418 f64.mul - f64.add - local.get $5 - local.get $1 + f64.sub local.get $1 + f64.const 1.5893254773528196e-08 f64.mul - f64.mul - f64.const -1.9839334836096632e-04 + f64.sub + global.set $~lib/math/rempio2f_y local.get $1 - f64.const 2.718311493989822e-06 - f64.mul - f64.add - f64.mul - f64.add - f32.demote_f64 - return - end - local.get $3 - i32.const 2139095040 - i32.ge_u - if - local.get $0 - local.get $0 - f32.sub - return + i32.trunc_f64_s + br $~lib/math/rempio2f|inlined.1 end - block $~lib/math/rempio2f|inlined.1 (result i32) - local.get $3 - i32.const 1305022427 - i32.lt_u - if - local.get $0 - f64.promote_f32 - local.tee $2 - f64.const 0.6366197723675814 - f64.mul - f64.nearest - local.set $1 - local.get $2 - local.get $1 - f64.const 1.5707963109016418 - f64.mul - f64.sub - local.get $1 - f64.const 1.5893254773528196e-08 - f64.mul - f64.sub - global.set $~lib/math/rempio2f_y - local.get $1 - i32.trunc_f64_s - br $~lib/math/rempio2f|inlined.1 - end - i32.const 104 - i32.load - local.get $3 - i32.const 23 - i32.shr_s - i32.const 152 - i32.sub - local.tee $6 - i32.const 6 - i32.shr_s - local.tee $9 - i32.const 3 - i32.shl - i32.add - i64.load offset=8 - local.set $10 - i32.const 104 - i32.load - local.get $9 - i32.const 1 - i32.add - i32.const 3 - i32.shl - i32.add - i64.load offset=8 - local.set $4 - local.get $6 - i32.const 63 - i32.and - local.tee $6 + local.get $2 + i32.const 23 + i32.shr_s + i32.const 152 + i32.sub + local.tee $4 + i32.const 6 + i32.shr_s + local.tee $8 + call $~lib/array/Array#__unchecked_get + local.set $10 + local.get $8 + i32.const 1 + i32.add + call $~lib/array/Array#__unchecked_get + local.set $5 + local.get $4 + i32.const 63 + i32.and + local.tee $4 + i32.const 32 + i32.gt_s + if (result i64) + local.get $5 + local.get $4 i32.const 32 - i32.gt_s - if (result i64) - local.get $4 - local.get $6 - i32.const 32 - i32.sub - i64.extend_i32_s - i64.shl - i32.const 104 - i32.load - local.get $9 - i32.const 2 - i32.add - i32.const 3 - i32.shl - i32.add - i64.load offset=8 - i64.const 96 - local.get $6 - i64.extend_i32_s - i64.sub - i64.shr_u - i64.or - else - local.get $4 - i64.const 32 - local.get $6 - i64.extend_i32_s - i64.sub - i64.shr_u - end - local.set $8 - f64.const 8.515303950216386e-20 - local.get $0 - f64.promote_f32 - f64.copysign - local.get $3 - i32.const 8388607 - i32.and - i32.const 8388608 - i32.or + i32.sub i64.extend_i32_s - local.tee $11 + i64.shl + local.get $8 + i32.const 2 + i32.add + call $~lib/array/Array#__unchecked_get + i64.const 96 local.get $4 - i64.const 64 - local.get $6 i64.extend_i32_s - local.tee $4 i64.sub i64.shr_u - local.get $10 - local.get $4 - i64.shl i64.or - i64.mul - local.get $8 - local.get $11 - i64.mul + else + local.get $5 i64.const 32 - i64.shr_u - i64.add - local.tee $4 - i64.const 2 - i64.shl - local.tee $8 - f64.convert_i64_s - f64.mul - global.set $~lib/math/rempio2f_y - i32.const 0 local.get $4 - i64.const 62 - i64.shr_u - local.get $8 - i64.const 63 + i64.extend_i32_s + i64.sub i64.shr_u - i64.add - i32.wrap_i64 - local.tee $3 - i32.sub - local.get $3 - local.get $7 - select - end - local.set $3 - global.get $~lib/math/rempio2f_y - local.set $1 - local.get $3 - i32.const 1 - i32.and - if (result f32) - local.get $1 - local.get $1 - f64.mul - local.tee $1 - local.get $1 - f64.mul - local.set $2 - f64.const 1 - local.get $1 - f64.const -0.499999997251031 - f64.mul - f64.add - local.get $2 - f64.const 0.04166662332373906 - f64.mul - f64.add - local.get $2 - local.get $1 - f64.mul - f64.const -0.001388676377460993 - local.get $1 - f64.const 2.439044879627741e-05 - f64.mul - f64.add - f64.mul - f64.add - f32.demote_f64 - else - local.get $1 - local.get $1 - local.get $1 - f64.mul - local.tee $2 - local.get $1 - f64.mul - local.tee $1 - f64.const -0.16666666641626524 - local.get $2 - f64.const 0.008333329385889463 - f64.mul - f64.add - f64.mul - f64.add - local.get $1 - local.get $2 - local.get $2 - f64.mul - f64.mul - f64.const -1.9839334836096632e-04 - local.get $2 - f64.const 2.718311493989822e-06 - f64.mul - f64.add - f64.mul - f64.add - f32.demote_f64 end - local.set $0 - local.get $0 - f32.neg + local.set $6 + f64.const 8.515303950216386e-20 local.get $0 - local.get $3 - i32.const 2 + f64.promote_f32 + f64.copysign + local.get $2 + i32.const 8388607 i32.and + i32.const 8388608 + i32.or + i64.extend_i32_s + local.tee $11 + local.get $10 + local.get $4 + i64.extend_i32_s + i64.shl + local.get $5 + i64.const 64 + local.get $4 + i64.extend_i32_s + i64.sub + i64.shr_u + i64.or + i64.mul + local.get $6 + local.get $11 + i64.mul + i64.const 32 + i64.shr_u + i64.add + local.tee $5 + i64.const 2 + i64.shl + local.tee $6 + f64.convert_i64_s + f64.mul + global.set $~lib/math/rempio2f_y + i32.const 0 + local.get $5 + i64.const 62 + i64.shr_u + local.get $6 + i64.const 63 + i64.shr_u + i64.add + i32.wrap_i64 + local.tee $2 + i32.sub + local.get $2 + local.get $9 select - return end - local.get $1 - local.get $5 - f64.const -0.16666666641626524 - local.get $2 - f64.const 0.008333329385889463 - f64.mul - f64.add - f64.mul - f64.add - local.get $5 - local.get $2 + local.set $2 + global.get $~lib/math/rempio2f_y + local.set $1 local.get $2 - f64.mul - f64.mul - f64.const -1.9839334836096632e-04 + i32.const 1 + i32.and + if (result f32) + local.get $1 + local.get $1 + f64.mul + local.tee $1 + local.get $1 + f64.mul + local.set $3 + f64.const 1 + local.get $1 + f64.const -0.499999997251031 + f64.mul + f64.add + local.get $3 + f64.const 0.04166662332373906 + f64.mul + f64.add + local.get $3 + local.get $1 + f64.mul + f64.const -0.001388676377460993 + local.get $1 + f64.const 2.439044879627741e-05 + f64.mul + f64.add + f64.mul + f64.add + f32.demote_f64 + else + local.get $1 + local.get $1 + local.get $1 + f64.mul + local.tee $3 + local.get $1 + f64.mul + local.tee $1 + f64.const -0.16666666641626524 + local.get $3 + f64.const 0.008333329385889463 + f64.mul + f64.add + f64.mul + f64.add + local.get $1 + local.get $3 + local.get $3 + f64.mul + f64.mul + f64.const -1.9839334836096632e-04 + local.get $3 + f64.const 2.718311493989822e-06 + f64.mul + f64.add + f64.mul + f64.add + f32.demote_f64 + end + local.set $0 local.get $2 - f64.const 2.718311493989822e-06 - f64.mul - f64.add - f64.mul - f64.add - f32.demote_f64 + i32.const 2 + i32.and + if + local.get $0 + f32.neg + local.set $0 + end + local.get $0 ) - (func $std/math/test_sinf (; 136 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_sinf (; 142 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.sin local.get $1 local.get $2 call $std/math/check ) - (func $~lib/math/NativeMath.sinh (; 137 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.sinh (; 143 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 f64) (local $3 i32) @@ -9773,25 +9112,23 @@ f64.mul f64.mul ) - (func $std/math/test_sinh (; 138 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) - (local $3 i32) + (func $std/math/test_sinh (; 144 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.sinh local.get $1 local.get $2 call $std/math/check - local.tee $3 - if + if (result i32) local.get $0 call $~lib/bindings/Math/sinh local.get $1 local.get $2 call $std/math/check - local.set $3 + else + i32.const 0 end - local.get $3 ) - (func $~lib/math/NativeMathf.sinh (; 139 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.sinh (; 145 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 f32) (local $2 i32) (local $3 f32) @@ -9805,439 +9142,137 @@ f32.const 0.5 local.get $0 f32.copysign - local.set $3 - local.get $2 - i32.const 1118925335 - i32.lt_u - if - local.get $1 - call $~lib/math/NativeMathf.expm1 - local.set $1 - local.get $2 - i32.const 1065353216 - i32.lt_u - if - local.get $2 - i32.const 964689920 - i32.lt_u - if - local.get $0 - return - end - local.get $3 - f32.const 2 - local.get $1 - f32.mul - local.get $1 - local.get $1 - f32.mul - local.get $1 - f32.const 1 - f32.add - f32.div - f32.sub - f32.mul - return - end - local.get $3 - local.get $1 - local.get $1 - local.get $1 - f32.const 1 - f32.add - f32.div - f32.add - f32.mul - return - end - f32.const 2 - local.get $3 - f32.mul - local.get $1 - f32.const 162.88958740234375 - f32.sub - call $~lib/math/NativeMathf.exp - f32.const 1661534994731144841129758e11 - f32.mul - f32.const 1661534994731144841129758e11 - f32.mul - f32.mul - ) - (func $std/math/test_sinhf (; 140 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) - local.get $0 - call $~lib/math/NativeMathf.sinh - local.get $1 - local.get $2 - call $std/math/check - ) - (func $std/math/test_sqrt (; 141 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) - (local $3 i32) - local.get $0 - f64.sqrt - local.get $1 - local.get $2 - call $std/math/check - local.tee $3 - if - local.get $0 - call $~lib/bindings/Math/sqrt - local.get $1 - local.get $2 - call $std/math/check - local.set $3 - end - local.get $3 - ) - (func $std/math/test_sqrtf (; 142 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) - local.get $0 - f32.sqrt - local.get $1 - local.get $2 - call $std/math/check - ) - (func $~lib/math/NativeMathf.tan (; 143 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) - (local $1 f64) - (local $2 f64) - (local $3 f64) - (local $4 i32) - (local $5 i64) - (local $6 i32) - (local $7 i32) - (local $8 i64) - (local $9 i32) - (local $10 i64) - (local $11 i64) - local.get $0 - i32.reinterpret_f32 - local.tee $4 - i32.const 31 - i32.shr_u - local.set $7 - block $folding-inner1 - block $folding-inner0 - local.get $4 - i32.const 2147483647 - i32.and - local.tee $4 - i32.const 1061752794 - i32.le_u - if - local.get $4 - i32.const 964689920 - i32.lt_u - if - local.get $0 - return - end - local.get $0 - f64.promote_f32 - local.tee $2 - local.get $2 - f64.mul - local.tee $1 - local.get $2 - f64.mul - local.set $3 - br $folding-inner0 - end - local.get $4 - i32.const 1081824209 - i32.le_u - if - local.get $4 - i32.const 1075235811 - i32.le_u - if - local.get $0 - f64.promote_f32 - local.tee $1 - f64.const 1.5707963267948966 - f64.add - local.get $1 - f64.const 1.5707963267948966 - f64.sub - local.get $7 - select - local.tee $2 - local.get $2 - f64.mul - local.tee $1 - local.get $2 - f64.mul - local.set $3 - br $folding-inner1 - else - local.get $0 - f64.promote_f32 - local.tee $1 - f64.const 3.141592653589793 - f64.add - local.get $1 - f64.const 3.141592653589793 - f64.sub - local.get $7 - select - local.tee $2 - local.get $2 - f64.mul - local.tee $1 - local.get $2 - f64.mul - local.set $3 - br $folding-inner0 - end - unreachable - end - local.get $4 - i32.const 1088565717 - i32.le_u - if - local.get $4 - i32.const 1085271519 - i32.le_u - if - local.get $0 - f64.promote_f32 - local.tee $1 - f64.const 4.71238898038469 - f64.add - local.get $1 - f64.const 4.71238898038469 - f64.sub - local.get $7 - select - local.tee $2 - local.get $2 - f64.mul - local.tee $1 - local.get $2 - f64.mul - local.set $3 - br $folding-inner1 - else - local.get $0 - f64.promote_f32 - local.tee $1 - f64.const 6.283185307179586 - f64.add - local.get $1 - f64.const 6.283185307179586 - f64.sub - local.get $7 - select - local.tee $2 - local.get $2 - f64.mul - local.tee $1 - local.get $2 - f64.mul - local.set $3 - br $folding-inner0 - end - unreachable - end - local.get $4 - i32.const 2139095040 - i32.ge_u - if - local.get $0 - local.get $0 - f32.sub - return - end - block $~lib/math/rempio2f|inlined.2 (result i32) - local.get $4 - i32.const 1305022427 - i32.lt_u - if - local.get $0 - f64.promote_f32 - local.tee $2 - f64.const 0.6366197723675814 - f64.mul - f64.nearest - local.set $1 - local.get $2 - local.get $1 - f64.const 1.5707963109016418 - f64.mul - f64.sub - local.get $1 - f64.const 1.5893254773528196e-08 - f64.mul - f64.sub - global.set $~lib/math/rempio2f_y - local.get $1 - i32.trunc_f64_s - br $~lib/math/rempio2f|inlined.2 - end - i32.const 104 - i32.load - local.get $4 - i32.const 23 - i32.shr_s - i32.const 152 - i32.sub - local.tee $6 - i32.const 6 - i32.shr_s - local.tee $9 - i32.const 3 - i32.shl - i32.add - i64.load offset=8 - local.set $10 - i32.const 104 - i32.load - local.get $9 - i32.const 1 - i32.add - i32.const 3 - i32.shl - i32.add - i64.load offset=8 - local.set $5 - local.get $6 - i32.const 63 - i32.and - local.tee $6 - i32.const 32 - i32.gt_s - if (result i64) - local.get $5 - local.get $6 - i32.const 32 - i32.sub - i64.extend_i32_s - i64.shl - i32.const 104 - i32.load - local.get $9 - i32.const 2 - i32.add - i32.const 3 - i32.shl - i32.add - i64.load offset=8 - i64.const 96 - local.get $6 - i64.extend_i32_s - i64.sub - i64.shr_u - i64.or - else - local.get $5 - i64.const 32 - local.get $6 - i64.extend_i32_s - i64.sub - i64.shr_u - end - local.set $8 - f64.const 8.515303950216386e-20 + local.set $3 + local.get $2 + i32.const 1118925335 + i32.lt_u + if + local.get $1 + call $~lib/math/NativeMathf.expm1 + local.set $1 + local.get $2 + i32.const 1065353216 + i32.lt_u + if + local.get $2 + i32.const 964689920 + i32.lt_u + if local.get $0 - f64.promote_f32 - f64.copysign - local.get $4 - i32.const 8388607 - i32.and - i32.const 8388608 - i32.or - i64.extend_i32_s - local.tee $11 - local.get $5 - i64.const 64 - local.get $6 - i64.extend_i32_s - local.tee $5 - i64.sub - i64.shr_u - local.get $10 - local.get $5 - i64.shl - i64.or - i64.mul - local.get $8 - local.get $11 - i64.mul - i64.const 32 - i64.shr_u - i64.add - local.tee $5 - i64.const 2 - i64.shl - local.tee $8 - f64.convert_i64_s - f64.mul - global.set $~lib/math/rempio2f_y - i32.const 0 - local.get $5 - i64.const 62 - i64.shr_u - local.get $8 - i64.const 63 - i64.shr_u - i64.add - i32.wrap_i64 - local.tee $4 - i32.sub - local.get $4 - local.get $7 - select + return end - local.set $4 - global.get $~lib/math/rempio2f_y - local.tee $2 - local.get $2 - f64.mul - local.tee $1 - local.get $2 - f64.mul - local.set $3 - local.get $2 - local.get $3 - f64.const 0.3333313950307914 - local.get $1 - f64.const 0.13339200271297674 - f64.mul - f64.add - f64.mul - f64.add local.get $3 + f32.const 2 local.get $1 + f32.mul local.get $1 - f64.mul - local.tee $2 - f64.mul - f64.const 0.05338123784456704 - local.get $1 - f64.const 0.024528318116654728 - f64.mul - f64.add - local.get $2 - f64.const 0.002974357433599673 - local.get $1 - f64.const 0.009465647849436732 - f64.mul - f64.add - f64.mul - f64.add - f64.mul - f64.add - local.set $1 - f64.const -1 local.get $1 - f64.div + f32.mul local.get $1 - local.get $4 - i32.const 1 - i32.and - select - f32.demote_f64 + f32.const 1 + f32.add + f32.div + f32.sub + f32.mul return end + local.get $3 + local.get $1 + local.get $1 + local.get $1 + f32.const 1 + f32.add + f32.div + f32.add + f32.mul + return + end + f32.const 2 + local.get $3 + f32.mul + local.get $1 + f32.const 162.88958740234375 + f32.sub + call $~lib/math/NativeMathf.exp + f32.const 1661534994731144841129758e11 + f32.mul + f32.const 1661534994731144841129758e11 + f32.mul + f32.mul + ) + (func $std/math/test_sinhf (; 146 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + local.get $0 + call $~lib/math/NativeMathf.sinh + local.get $1 + local.get $2 + call $std/math/check + ) + (func $std/math/test_sqrt (; 147 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + local.get $0 + f64.sqrt + local.get $1 + local.get $2 + call $std/math/check + if (result i32) + local.get $0 + call $~lib/bindings/Math/sqrt + local.get $1 + local.get $2 + call $std/math/check + else + i32.const 0 + end + ) + (func $std/math/test_sqrtf (; 148 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + local.get $0 + f32.sqrt + local.get $1 + local.get $2 + call $std/math/check + ) + (func $~lib/math/NativeMathf.tan (; 149 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 f64) + (local $2 i32) + (local $3 f64) + (local $4 i32) + (local $5 f64) + (local $6 i64) + (local $7 i64) + (local $8 i32) + (local $9 i32) + (local $10 i64) + (local $11 i64) + local.get $0 + i32.reinterpret_f32 + local.tee $2 + i32.const 31 + i32.shr_u + local.set $9 + local.get $2 + i32.const 2147483647 + i32.and + local.tee $2 + i32.const 1061752794 + i32.le_u + if local.get $2 + i32.const 964689920 + i32.lt_u + if + local.get $0 + return + end + local.get $0 + f64.promote_f32 + local.tee $3 + local.get $3 + f64.mul + local.tee $1 local.get $3 + f64.mul + local.set $5 + local.get $3 + local.get $5 f64.const 0.3333313950307914 local.get $1 f64.const 0.13339200271297674 @@ -10245,18 +9280,18 @@ f64.add f64.mul f64.add - local.get $3 + local.get $5 local.get $1 local.get $1 f64.mul - local.tee $2 + local.tee $3 f64.mul f64.const 0.05338123784456704 local.get $1 f64.const 0.024528318116654728 f64.mul f64.add - local.get $2 + local.get $3 f64.const 0.002974357433599673 local.get $1 f64.const 0.009465647849436732 @@ -10269,9 +9304,150 @@ f32.demote_f64 return end - f64.const -1 local.get $2 + i32.const 2139095040 + i32.ge_u + if + local.get $0 + local.get $0 + f32.sub + return + end + block $~lib/math/rempio2f|inlined.2 (result i32) + local.get $2 + i32.const 1305022427 + i32.lt_u + if + local.get $0 + f64.promote_f32 + local.get $0 + f64.promote_f32 + f64.const 0.6366197723675814 + f64.mul + f64.nearest + local.tee $1 + f64.const 1.5707963109016418 + f64.mul + f64.sub + local.get $1 + f64.const 1.5893254773528196e-08 + f64.mul + f64.sub + global.set $~lib/math/rempio2f_y + local.get $1 + i32.trunc_f64_s + br $~lib/math/rempio2f|inlined.2 + end + local.get $2 + i32.const 23 + i32.shr_s + i32.const 152 + i32.sub + local.tee $4 + i32.const 6 + i32.shr_s + local.tee $8 + call $~lib/array/Array#__unchecked_get + local.set $10 + local.get $8 + i32.const 1 + i32.add + call $~lib/array/Array#__unchecked_get + local.set $6 + local.get $4 + i32.const 63 + i32.and + local.tee $4 + i32.const 32 + i32.gt_s + if (result i64) + local.get $6 + local.get $4 + i32.const 32 + i32.sub + i64.extend_i32_s + i64.shl + local.get $8 + i32.const 2 + i32.add + call $~lib/array/Array#__unchecked_get + i64.const 96 + local.get $4 + i64.extend_i32_s + i64.sub + i64.shr_u + i64.or + else + local.get $6 + i64.const 32 + local.get $4 + i64.extend_i32_s + i64.sub + i64.shr_u + end + local.set $7 + f64.const 8.515303950216386e-20 + local.get $0 + f64.promote_f32 + f64.copysign + local.get $2 + i32.const 8388607 + i32.and + i32.const 8388608 + i32.or + i64.extend_i32_s + local.tee $11 + local.get $10 + local.get $4 + i64.extend_i32_s + i64.shl + local.get $6 + i64.const 64 + local.get $4 + i64.extend_i32_s + i64.sub + i64.shr_u + i64.or + i64.mul + local.get $7 + local.get $11 + i64.mul + i64.const 32 + i64.shr_u + i64.add + local.tee $6 + i64.const 2 + i64.shl + local.tee $7 + f64.convert_i64_s + f64.mul + global.set $~lib/math/rempio2f_y + i32.const 0 + local.get $6 + i64.const 62 + i64.shr_u + local.get $7 + i64.const 63 + i64.shr_u + i64.add + i32.wrap_i64 + local.tee $2 + i32.sub + local.get $2 + local.get $9 + select + end + local.set $2 + global.get $~lib/math/rempio2f_y + local.tee $3 + local.get $3 + f64.mul + local.tee $1 + local.get $3 + f64.mul + local.set $5 local.get $3 + local.get $5 f64.const 0.3333313950307914 local.get $1 f64.const 0.13339200271297674 @@ -10279,18 +9455,18 @@ f64.add f64.mul f64.add - local.get $3 + local.get $5 local.get $1 local.get $1 f64.mul - local.tee $2 + local.tee $3 f64.mul f64.const 0.05338123784456704 local.get $1 f64.const 0.024528318116654728 f64.mul f64.add - local.get $2 + local.get $3 f64.const 0.002974357433599673 local.get $1 f64.const 0.009465647849436732 @@ -10300,17 +9476,27 @@ f64.add f64.mul f64.add - f64.div + local.set $1 + local.get $2 + i32.const 1 + i32.and + if + f64.const -1 + local.get $1 + f64.div + local.set $1 + end + local.get $1 f32.demote_f64 ) - (func $std/math/test_tanf (; 144 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_tanf (; 150 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.tan local.get $1 local.get $2 call $std/math/check ) - (func $~lib/math/NativeMath.tanh (; 145 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.tanh (; 151 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) (local $3 i64) @@ -10389,25 +9575,23 @@ local.get $0 f64.copysign ) - (func $std/math/test_tanh (; 146 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) - (local $3 i32) + (func $std/math/test_tanh (; 152 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.tanh local.get $1 local.get $2 call $std/math/check - local.tee $3 - if + if (result i32) local.get $0 call $~lib/bindings/Math/tanh local.get $1 local.get $2 call $std/math/check - local.set $3 + else + i32.const 0 end - local.get $3 ) - (func $~lib/math/NativeMathf.tanh (; 147 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.tanh (; 153 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 f32) (local $2 i32) local.get $0 @@ -10481,21 +9665,19 @@ local.get $0 f32.copysign ) - (func $std/math/test_tanhf (; 148 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_tanhf (; 154 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.tanh local.get $1 local.get $2 call $std/math/check ) - (func $std/math/test_trunc (; 149 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) - (local $2 i32) + (func $std/math/test_trunc (; 155 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) local.get $0 f64.trunc local.get $1 f64.const 0 call $std/math/check - local.tee $2 if (result i32) local.get $0 call $~lib/bindings/Math/trunc @@ -10503,26 +9685,22 @@ f64.const 0 call $std/math/check else - local.get $2 + i32.const 0 end ) - (func $std/math/test_truncf (; 150 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) + (func $std/math/test_truncf (; 156 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) local.get $0 f32.trunc local.get $1 f32.const 0 call $std/math/check ) - (func $~lib/math/NativeMath.imul (; 151 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) - (local $2 f64) + (func $~lib/math/NativeMath.imul (; 157 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) local.get $0 local.get $1 f64.add - local.tee $2 - local.get $2 - f64.sub - f64.const 0 - f64.ne + call $~lib/builtins/isFinite + i32.eqz if f64.const 0 return @@ -10550,12 +9728,10 @@ i32.mul f64.convert_i32_s ) - (func $~lib/math/NativeMath.clz32 (; 152 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.clz32 (; 158 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 - local.get $0 - f64.sub - f64.const 0 - f64.ne + call $~lib/builtins/isFinite + i32.eqz if f64.const 32 return @@ -10573,169 +9749,11 @@ i32.clz f64.convert_i32_s ) - (func $~lib/math/ipow64 (; 153 ;) (type $FUNCSIG$jji) (param $0 i64) (param $1 i32) (result i64) + (func $~lib/math/ipow64 (; 159 ;) (type $FUNCSIG$jji) (param $0 i64) (param $1 i32) (result i64) (local $2 i64) - (local $3 i32) i64.const 1 local.set $2 - local.get $1 - i32.const 0 - i32.lt_s - if - i64.const 0 - return - end - block $break|0 - block $case2|0 - block $case1|0 - local.get $1 - if - local.get $1 - i32.const 1 - i32.eq - br_if $case1|0 - local.get $1 - i32.const 2 - i32.eq - br_if $case2|0 - br $break|0 - end - i64.const 1 - return - end - local.get $0 - return - end - local.get $0 - local.get $0 - i64.mul - return - end - i32.const 32 - local.get $1 - i32.clz - i32.sub - local.tee $3 - i32.const 6 - i32.le_s - if - block $break|1 - block $case5|1 - block $case4|1 - block $case3|1 - block $case2|1 - block $case1|1 - local.get $3 - i32.const 6 - i32.ne - if - local.get $3 - i32.const 1 - i32.sub - br_table $case5|1 $case4|1 $case3|1 $case2|1 $case1|1 $break|1 - end - local.get $0 - i64.const 1 - local.get $1 - i32.const 1 - i32.and - select - local.set $2 - local.get $1 - i32.const 1 - i32.shr_s - local.set $1 - local.get $0 - local.get $0 - i64.mul - local.set $0 - end - local.get $0 - local.get $2 - i64.mul - local.get $2 - local.get $1 - i32.const 1 - i32.and - select - local.set $2 - local.get $1 - i32.const 1 - i32.shr_s - local.set $1 - local.get $0 - local.get $0 - i64.mul - local.set $0 - end - local.get $0 - local.get $2 - i64.mul - local.get $2 - local.get $1 - i32.const 1 - i32.and - select - local.set $2 - local.get $1 - i32.const 1 - i32.shr_s - local.set $1 - local.get $0 - local.get $0 - i64.mul - local.set $0 - end - local.get $0 - local.get $2 - i64.mul - local.get $2 - local.get $1 - i32.const 1 - i32.and - select - local.set $2 - local.get $1 - i32.const 1 - i32.shr_s - local.set $1 - local.get $0 - local.get $0 - i64.mul - local.set $0 - end - local.get $0 - local.get $2 - i64.mul - local.get $2 - local.get $1 - i32.const 1 - i32.and - select - local.set $2 - local.get $1 - i32.const 1 - i32.shr_s - local.set $1 - local.get $0 - local.get $0 - i64.mul - local.set $0 - end - local.get $0 - local.get $2 - i64.mul - local.get $2 - local.get $1 - i32.const 1 - i32.and - select - local.set $2 - end - local.get $2 - return - end - loop $continue|2 + loop $continue|0 local.get $1 i32.const 0 i32.gt_s @@ -10757,12 +9775,12 @@ local.get $0 i64.mul local.set $0 - br $continue|2 + br $continue|0 end end local.get $2 ) - (func $~lib/math/ipow32f (; 154 ;) (type $FUNCSIG$ffi) (param $0 f32) (param $1 i32) (result f32) + (func $~lib/math/ipow32f (; 160 ;) (type $FUNCSIG$ffi) (param $0 f32) (param $1 i32) (result f32) (local $2 f32) (local $3 i32) local.get $1 @@ -10808,7 +9826,7 @@ end local.get $2 ) - (func $~lib/math/ipow64f (; 155 ;) (type $FUNCSIG$ddi) (param $0 f64) (param $1 i32) (result f64) + (func $~lib/math/ipow64f (; 161 ;) (type $FUNCSIG$ddi) (param $0 f64) (param $1 i32) (result f64) (local $2 f64) (local $3 i32) local.get $1 @@ -10854,11 +9872,10 @@ end local.get $2 ) - (func $start:std/math (; 156 ;) (type $FUNCSIG$v) - (local $0 f64) - (local $1 f32) - (local $2 i32) - (local $3 i32) + (func $start:std/math (; 162 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 f64) + (local $2 f32) f64.const 2.718281828459045 global.get $~lib/bindings/Math/E f64.const 0 @@ -10866,10 +9883,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 108 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6931471805599453 @@ -10879,10 +9896,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 109 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.302585092994046 @@ -10892,10 +9909,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 110 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.4426950408889634 @@ -10905,10 +9922,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 111 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 3.141592653589793 @@ -10918,10 +9935,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 112 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7071067811865476 @@ -10931,10 +9948,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 113 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.4142135623730951 @@ -10944,10 +9961,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 114 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.7182817459106445 @@ -10958,10 +9975,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 116 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6931471824645996 @@ -10972,10 +9989,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 117 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.3025851249694824 @@ -10986,10 +10003,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 118 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.4426950216293335 @@ -11000,10 +10017,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 119 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 3.1415927410125732 @@ -11014,10 +10031,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 120 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7071067690849304 @@ -11028,10 +10045,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 121 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.4142135381698608 @@ -11042,10 +10059,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 122 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -11055,10 +10072,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 133 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -11068,10 +10085,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 134 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -11081,10 +10098,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 135 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -11094,10 +10111,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 136 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -11107,10 +10124,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 137 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -11120,10 +10137,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 138 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -11133,10 +10150,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 139 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -11146,10 +10163,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 140 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -11159,10 +10176,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 141 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -11172,10 +10189,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 142 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -11185,10 +10202,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 145 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -11198,10 +10215,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 146 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -11211,10 +10228,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 147 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -11224,10 +10241,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 148 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -11237,10 +10254,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 149 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -11250,10 +10267,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 150 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -11263,10 +10280,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 151 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -11276,10 +10293,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 152 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -11289,10 +10306,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 153 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -11302,10 +10319,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 154 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -11315,10 +10332,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 155 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -11328,10 +10345,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 156 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -11341,10 +10358,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 157 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -11354,10 +10371,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 158 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 8988465674311579538646525e283 @@ -11367,10 +10384,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 159 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 5e-324 @@ -11380,10 +10397,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 160 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.000244140625 @@ -11393,10 +10410,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 161 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7499999999999999 @@ -11406,10 +10423,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 162 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5000000000000012 @@ -11419,10 +10436,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 163 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -11432,10 +10449,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 172 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -11445,10 +10462,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 173 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -11458,10 +10475,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 174 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -11471,10 +10488,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 175 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -11484,10 +10501,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 176 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -11497,10 +10514,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 177 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -11510,10 +10527,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 178 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -11523,10 +10540,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 179 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -11536,10 +10553,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 180 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -11549,10 +10566,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 181 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -11562,10 +10579,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 184 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -11575,10 +10592,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 185 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -11588,10 +10605,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 186 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -11601,10 +10618,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 187 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -11614,10 +10631,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 188 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -11627,10 +10644,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 189 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -11640,10 +10657,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 190 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -11653,10 +10670,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 191 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -11666,10 +10683,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 192 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -11679,10 +10696,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 193 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -11692,10 +10709,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 194 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -11705,10 +10722,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 195 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -11718,10 +10735,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 196 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -11731,10 +10748,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 197 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1701411834604692317316873e14 @@ -11744,10 +10761,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 198 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.401298464324817e-45 @@ -11757,10 +10774,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 199 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.000244140625 @@ -11770,10 +10787,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 200 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7499999403953552 @@ -11783,10 +10800,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 201 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5000006556510925 @@ -11796,10 +10813,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 202 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -11808,10 +10825,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 214 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -11820,10 +10837,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 215 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -11832,10 +10849,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 216 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -11844,10 +10861,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 217 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -11856,10 +10873,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 218 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -11868,10 +10885,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 219 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -11880,10 +10897,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 220 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -11892,10 +10909,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 221 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -11904,10 +10921,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 222 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -11916,10 +10933,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 223 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -11928,10 +10945,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 226 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -11940,10 +10957,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 227 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -11952,10 +10969,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 228 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -11964,10 +10981,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 229 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -11976,10 +10993,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 230 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -11988,10 +11005,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 231 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -12000,10 +11017,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 232 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -12012,10 +11029,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 241 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -12024,10 +11041,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 242 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -12036,10 +11053,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 243 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -12048,10 +11065,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 244 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -12060,10 +11077,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 245 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -12072,10 +11089,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 246 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -12084,10 +11101,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 247 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -12096,10 +11113,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 248 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -12108,10 +11125,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 249 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -12120,10 +11137,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 250 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -12132,10 +11149,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 253 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -12144,10 +11161,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 254 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -12156,10 +11173,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 255 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -12168,10 +11185,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 256 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -12180,10 +11197,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 257 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -12192,10 +11209,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 258 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -12204,10 +11221,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 259 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -12217,10 +11234,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 271 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -12230,10 +11247,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 272 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -12243,10 +11260,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 273 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -12256,10 +11273,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 274 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -12269,10 +11286,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 275 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -12282,10 +11299,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 276 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -12295,10 +11312,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 277 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -12308,10 +11325,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 278 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -12321,10 +11338,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 279 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -12334,10 +11351,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 280 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -12347,10 +11364,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 283 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -12360,10 +11377,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 284 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -12373,10 +11390,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 285 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.0000000000000002 @@ -12386,10 +11403,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 286 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.0000000000000002 @@ -12399,10 +11416,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 287 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -12412,10 +11429,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 288 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -12425,10 +11442,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 289 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -12438,10 +11455,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 290 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5309227209592985 @@ -12451,10 +11468,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 291 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.4939556746399746 @@ -12464,10 +11481,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 292 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -12477,10 +11494,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 301 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -12490,10 +11507,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 302 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -12503,10 +11520,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 303 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -12516,10 +11533,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 304 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -12529,10 +11546,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 305 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -12542,10 +11559,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 306 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -12555,10 +11572,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 307 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -12568,10 +11585,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 308 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -12581,10 +11598,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 309 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -12594,10 +11611,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 310 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -12607,10 +11624,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 313 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -12620,10 +11637,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 314 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -12633,10 +11650,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 315 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.0000001192092896 @@ -12646,10 +11663,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 316 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.0000001192092896 @@ -12659,10 +11676,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 317 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -12672,10 +11689,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 318 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -12685,10 +11702,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 319 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -12698,10 +11715,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 320 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.49965065717697144 @@ -12711,10 +11728,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 321 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5051405429840088 @@ -12724,10 +11741,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 322 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5189794898033142 @@ -12737,10 +11754,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 323 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -12750,10 +11767,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 335 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -12763,10 +11780,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 336 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -12776,10 +11793,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 337 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -12789,10 +11806,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 338 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -12802,10 +11819,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 339 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -12815,10 +11832,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 340 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -12828,10 +11845,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 341 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -12841,10 +11858,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 342 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -12854,10 +11871,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 343 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -12867,10 +11884,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 344 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -12880,10 +11897,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 347 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -12893,10 +11910,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 348 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -12906,10 +11923,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 349 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.9999923706054688 @@ -12919,10 +11936,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 350 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -12932,10 +11949,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 351 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -12945,10 +11962,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 352 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -12958,10 +11975,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 353 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.1060831199926429 @@ -12971,10 +11988,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 369 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.1089809557628658 @@ -12984,10 +12001,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 371 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.1169429159875521 @@ -12997,10 +12014,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 372 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -13010,10 +12027,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 381 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -13023,10 +12040,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 382 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -13036,10 +12053,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 383 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -13049,10 +12066,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 384 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -13062,10 +12079,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 385 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -13075,10 +12092,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 386 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -13088,10 +12105,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 387 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -13101,10 +12118,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 388 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -13114,10 +12131,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 389 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -13127,10 +12144,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 390 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -13140,10 +12157,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 393 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -13153,10 +12170,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 394 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -13166,10 +12183,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 395 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.9999923706054688 @@ -13179,10 +12196,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 396 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -13192,10 +12209,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 397 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -13205,10 +12222,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 398 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -13218,10 +12235,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 399 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1125899906842624 @@ -13231,10 +12248,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 400 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -13244,10 +12261,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 412 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -13257,10 +12274,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 413 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -13270,10 +12287,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 414 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -13283,10 +12300,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 415 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -13296,10 +12313,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 416 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -13309,10 +12326,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 417 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -13322,10 +12339,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 418 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -13335,10 +12352,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 419 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -13348,10 +12365,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 420 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -13361,10 +12378,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 421 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -13374,10 +12391,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 424 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -13387,10 +12404,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 425 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -13400,10 +12417,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 426 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -13413,10 +12430,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 427 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.0000000000000002 @@ -13426,10 +12443,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 428 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.0000000000000002 @@ -13439,10 +12456,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 429 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -13452,10 +12469,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 430 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -13465,10 +12482,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 431 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -13478,10 +12495,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 432 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5073043929119148 @@ -13491,10 +12508,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 433 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -13504,10 +12521,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 442 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -13517,10 +12534,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 443 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -13530,10 +12547,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 444 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -13543,10 +12560,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 445 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -13556,10 +12573,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 446 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -13569,10 +12586,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 447 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -13582,10 +12599,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 448 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -13595,10 +12612,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 449 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -13608,10 +12625,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 450 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -13621,10 +12638,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 451 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -13634,10 +12651,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 454 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -13647,10 +12664,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 455 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -13660,10 +12677,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 456 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -13673,10 +12690,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 457 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.0000001192092896 @@ -13686,10 +12703,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 458 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.0000001192092896 @@ -13699,10 +12716,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 459 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -13712,10 +12729,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 460 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -13725,10 +12742,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 461 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -13738,10 +12755,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 462 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5004770159721375 @@ -13751,10 +12768,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 463 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -13764,10 +12781,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 475 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -13777,10 +12794,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 476 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -13790,10 +12807,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 477 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -13803,10 +12820,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 478 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -13816,10 +12833,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 479 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -13829,10 +12846,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 480 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -13842,10 +12859,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 481 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -13855,10 +12872,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 482 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -13868,10 +12885,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 483 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -13881,10 +12898,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 484 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -13894,10 +12911,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 487 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -13907,10 +12924,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 488 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -13920,10 +12937,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 489 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -13933,10 +12950,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 490 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -13946,10 +12963,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 491 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -13959,10 +12976,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 520 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -13972,10 +12989,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 521 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -13985,10 +13002,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 522 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -13998,10 +13015,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 523 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -14011,10 +13028,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 524 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -14024,10 +13041,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 525 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -14037,10 +13054,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 526 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -14050,10 +13067,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 527 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -14063,10 +13080,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 528 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -14076,10 +13093,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 529 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -14089,10 +13106,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 532 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -14102,10 +13119,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 533 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -14115,10 +13132,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 534 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -14128,10 +13145,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 535 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -14141,10 +13158,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 536 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -14154,10 +13171,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 548 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -14167,10 +13184,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 549 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -14180,10 +13197,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 550 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -14193,10 +13210,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 551 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -14206,10 +13223,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 552 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -14219,10 +13236,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 553 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -14232,10 +13249,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 554 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -14245,10 +13262,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 555 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -14258,10 +13275,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 556 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -14271,10 +13288,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 557 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -14284,10 +13301,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 560 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -14297,10 +13314,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 561 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -14310,10 +13327,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 562 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -14323,10 +13340,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 563 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -14336,10 +13353,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 564 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -14349,10 +13366,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 565 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -14362,10 +13379,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 566 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6929821535674624 @@ -14375,10 +13392,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 567 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -14388,10 +13405,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 576 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -14401,10 +13418,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 577 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -14414,10 +13431,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 578 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -14427,10 +13444,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 579 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -14440,10 +13457,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 580 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -14453,10 +13470,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 581 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -14466,10 +13483,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 582 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -14479,10 +13496,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 583 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -14492,10 +13509,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 584 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -14505,10 +13522,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 585 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -14518,10 +13535,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 588 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -14531,10 +13548,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 589 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -14544,10 +13561,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 590 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -14557,10 +13574,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 591 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -14570,10 +13587,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 592 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -14583,10 +13600,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 593 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -14596,10 +13613,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 594 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -14609,10 +13626,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 606 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -14622,10 +13639,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 607 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -14635,10 +13652,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 608 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -14648,10 +13665,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 609 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -14661,10 +13678,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 610 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -14674,10 +13691,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 611 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -14687,10 +13704,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 612 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -14700,10 +13717,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 613 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -14713,10 +13730,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 614 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -14726,10 +13743,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 615 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -14739,10 +13756,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 618 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -14752,10 +13769,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 619 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -14765,10 +13782,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 620 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -14778,10 +13795,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 621 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -14791,10 +13808,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 622 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -14804,10 +13821,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 623 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -14817,10 +13834,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 624 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.0000152587890625 @@ -14830,10 +13847,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 625 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.0000152587890625 @@ -14843,10 +13860,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 626 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.3552527156068805e-20 @@ -14856,10 +13873,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 627 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.332636185032189e-302 @@ -14869,10 +13886,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 628 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 5.562684646268003e-309 @@ -14882,10 +13899,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 629 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -5.562684646268003e-309 @@ -14895,10 +13912,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 630 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 8988465674311579538646525e283 @@ -14908,10 +13925,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 631 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -14921,10 +13938,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 640 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -14934,10 +13951,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 641 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -14947,10 +13964,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 642 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -14960,10 +13977,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 643 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -14973,10 +13990,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 644 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -14986,10 +14003,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 645 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -14999,10 +14016,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 646 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -15012,10 +14029,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 647 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -15025,10 +14042,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 648 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -15038,10 +14055,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 649 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -15051,10 +14068,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 652 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -15064,10 +14081,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 653 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -15077,10 +14094,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 654 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -15090,10 +14107,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 655 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -15103,10 +14120,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 656 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -15116,10 +14133,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 657 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -15129,10 +14146,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 658 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.0000152587890625 @@ -15142,10 +14159,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 659 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.0000152587890625 @@ -15155,10 +14172,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 660 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.3552527156068805e-20 @@ -15168,10 +14185,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 661 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 7.888609052210118e-31 @@ -15181,10 +14198,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 662 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.938735877055719e-39 @@ -15194,10 +14211,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 663 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2.938735877055719e-39 @@ -15207,10 +14224,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 664 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1701411834604692317316873e14 @@ -15220,10 +14237,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 665 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -15234,10 +14251,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 677 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -15248,10 +14265,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 678 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -15262,10 +14279,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 679 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -15276,10 +14293,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 680 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -15290,10 +14307,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 681 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.450045556060236 @@ -15304,10 +14321,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 682 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 7.858890253041697 @@ -15318,10 +14335,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 683 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.792054511984896 @@ -15332,10 +14349,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 684 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.615702673197924 @@ -15346,10 +14363,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 685 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5587586823609152 @@ -15360,10 +14377,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 686 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -15374,10 +14391,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 689 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -15388,10 +14405,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 690 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -15402,10 +14419,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 691 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -15416,10 +14433,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 692 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -15430,10 +14447,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 693 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -15444,10 +14461,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 694 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -15458,10 +14475,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 695 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -15472,10 +14489,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 696 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -15486,10 +14503,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 697 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -15500,10 +14517,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 698 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -15514,10 +14531,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 699 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -15528,10 +14545,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 700 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -15542,10 +14559,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 701 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -15556,10 +14573,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 702 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -15570,10 +14587,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 703 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -15584,10 +14601,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 704 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -15598,10 +14615,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 705 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -15612,10 +14629,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 706 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -15626,10 +14643,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 707 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -15640,10 +14657,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 708 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -15654,10 +14671,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 709 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -15668,10 +14685,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 710 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -15682,10 +14699,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 711 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -15696,10 +14713,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 712 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -15710,10 +14727,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 713 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -15724,10 +14741,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 714 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.1125369292536007e-308 @@ -15738,10 +14755,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 715 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -15752,10 +14769,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 716 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.5 @@ -15766,10 +14783,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 717 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.5 @@ -15780,10 +14797,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 718 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -15794,10 +14811,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 727 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -15808,10 +14825,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 728 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -15822,10 +14839,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 729 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -15836,10 +14853,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 730 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -15850,10 +14867,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 731 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.450045585632324 @@ -15864,10 +14881,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 732 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 7.858890056610107 @@ -15878,10 +14895,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 733 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.7920545339584351 @@ -15892,10 +14909,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 734 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6157026886940002 @@ -15906,10 +14923,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 735 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5587586760520935 @@ -15920,10 +14937,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 736 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -15934,10 +14951,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 739 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -15948,10 +14965,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 740 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -15962,10 +14979,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 741 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -15976,10 +14993,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 742 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -15990,10 +15007,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 743 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -16004,10 +15021,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 744 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -16018,10 +15035,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 745 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -16032,10 +15049,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 746 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -16046,10 +15063,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 747 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -16060,10 +15077,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 748 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -16074,10 +15091,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 749 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -16088,10 +15105,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 750 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -16102,10 +15119,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 751 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -16116,10 +15133,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 752 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -16130,10 +15147,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 753 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -16144,10 +15161,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 754 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -16158,10 +15175,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 755 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -16172,10 +15189,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 756 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -16186,10 +15203,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 757 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -16200,10 +15217,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 758 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -16214,10 +15231,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 759 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -16228,10 +15245,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 760 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -16242,10 +15259,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 761 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -16256,10 +15273,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 762 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -16270,10 +15287,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 763 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -16284,10 +15301,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 764 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 5.877471754111438e-39 @@ -16298,10 +15315,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 765 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -16312,10 +15329,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 766 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -16325,10 +15342,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 778 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -16338,10 +15355,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 779 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -16351,10 +15368,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 780 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -16364,10 +15381,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 781 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -16377,10 +15394,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 782 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -16390,10 +15407,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 783 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -16403,10 +15420,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 784 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -16416,10 +15433,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 785 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -16429,10 +15446,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 786 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -16442,10 +15459,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 787 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -16455,10 +15472,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 790 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -16468,10 +15485,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 791 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -16481,10 +15498,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 792 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -16494,10 +15511,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 793 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -16507,10 +15524,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 794 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.313225746154785e-10 @@ -16520,10 +15537,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 795 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -9.313225746154785e-10 @@ -16533,10 +15550,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 796 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -16546,10 +15563,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 797 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -16559,10 +15576,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 798 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 8 @@ -16572,10 +15589,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 799 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -16585,10 +15602,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 808 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -16598,10 +15615,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 809 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -16611,10 +15628,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 810 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -16624,10 +15641,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 811 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -16637,10 +15654,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 812 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -16650,10 +15667,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 813 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -16663,10 +15680,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 814 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -16676,10 +15693,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 815 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -16689,10 +15706,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 816 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -16702,10 +15719,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 817 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -16715,10 +15732,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 820 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -16728,10 +15745,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 821 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -16741,10 +15758,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 822 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -16754,10 +15771,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 823 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -16767,10 +15784,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 824 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.313225746154785e-10 @@ -16780,10 +15797,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 825 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -9.313225746154785e-10 @@ -16793,10 +15810,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 826 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -16806,10 +15823,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 827 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -16819,10 +15836,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 828 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 8 @@ -16832,10 +15849,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 829 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -16844,10 +15861,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 841 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -16856,10 +15873,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 842 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -16868,10 +15885,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 843 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -16880,10 +15897,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 844 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -16892,10 +15909,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 845 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -16904,10 +15921,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 846 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -16916,10 +15933,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 847 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -16928,10 +15945,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 848 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -16940,10 +15957,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 849 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -16952,10 +15969,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 850 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -16964,10 +15981,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 853 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -16976,10 +15993,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 854 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -16988,10 +16005,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 855 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -17000,10 +16017,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 856 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -17012,10 +16029,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 857 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -17024,10 +16041,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 858 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -17036,10 +16053,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 859 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -17048,10 +16065,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 860 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -17060,10 +16077,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 861 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.0000152587890625 @@ -17072,10 +16089,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 862 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.0000152587890625 @@ -17084,10 +16101,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 863 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.9999923706054688 @@ -17096,10 +16113,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 864 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.9999923706054688 @@ -17108,10 +16125,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 865 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 7.888609052210118e-31 @@ -17120,10 +16137,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 866 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -7.888609052210118e-31 @@ -17132,10 +16149,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 867 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -17144,10 +16161,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 868 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -17156,10 +16173,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 869 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -17168,10 +16185,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 870 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -17180,10 +16197,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 871 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -17192,10 +16209,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 872 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -17204,10 +16221,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 873 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -17216,10 +16233,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 874 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -17228,10 +16245,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 875 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -17240,10 +16257,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 876 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.0000152587890625 @@ -17252,10 +16269,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 877 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.0000152587890625 @@ -17264,10 +16281,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 878 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.9999923706054688 @@ -17276,10 +16293,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 879 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.9999923706054688 @@ -17288,10 +16305,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 880 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 7.888609052210118e-31 @@ -17300,10 +16317,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 881 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -7.888609052210118e-31 @@ -17312,10 +16329,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 882 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -17324,10 +16341,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 883 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -17336,10 +16353,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 884 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -17348,10 +16365,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 885 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -17360,10 +16377,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 886 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -17372,10 +16389,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 887 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -17384,10 +16401,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 888 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -17396,10 +16413,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 889 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -17408,10 +16425,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 890 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -17420,10 +16437,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 891 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.0000152587890625 @@ -17432,10 +16449,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 892 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.0000152587890625 @@ -17444,10 +16461,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 893 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.9999923706054688 @@ -17456,10 +16473,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 894 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.9999923706054688 @@ -17468,10 +16485,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 895 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 7.888609052210118e-31 @@ -17480,10 +16497,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 896 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -7.888609052210118e-31 @@ -17492,10 +16509,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 897 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -17504,10 +16521,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 906 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -17516,10 +16533,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 907 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -17528,10 +16545,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 908 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -17540,10 +16557,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 909 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -17552,10 +16569,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 910 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -17564,10 +16581,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 911 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -17576,10 +16593,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 912 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -17588,10 +16605,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 913 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -17600,10 +16617,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 914 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -17612,10 +16629,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 915 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -17624,10 +16641,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 918 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -17636,10 +16653,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 919 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -17648,10 +16665,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 920 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -17660,10 +16677,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 921 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -17672,10 +16689,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 922 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -17684,10 +16701,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 923 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -17696,10 +16713,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 924 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -17708,10 +16725,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 925 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -17720,10 +16737,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 926 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.0000152587890625 @@ -17732,10 +16749,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 927 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.0000152587890625 @@ -17744,10 +16761,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 928 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.9999923706054688 @@ -17756,10 +16773,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 929 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.9999923706054688 @@ -17768,10 +16785,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 930 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 7.888609052210118e-31 @@ -17780,10 +16797,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 931 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -7.888609052210118e-31 @@ -17792,10 +16809,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 932 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -17804,10 +16821,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 933 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -17816,10 +16833,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 934 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -17828,10 +16845,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 935 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -17840,10 +16857,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 936 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -17852,10 +16869,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 937 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -17864,10 +16881,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 938 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -17876,10 +16893,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 939 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -17888,10 +16905,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 940 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -17900,10 +16917,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 941 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.0000152587890625 @@ -17912,10 +16929,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 942 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.0000152587890625 @@ -17924,10 +16941,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 943 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.9999923706054688 @@ -17936,10 +16953,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 944 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.9999923706054688 @@ -17948,10 +16965,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 945 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 7.888609052210118e-31 @@ -17960,10 +16977,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 946 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -7.888609052210118e-31 @@ -17972,10 +16989,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 947 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -17984,10 +17001,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 948 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -17996,10 +17013,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 949 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -18008,10 +17025,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 950 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -18020,10 +17037,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 951 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -18032,10 +17049,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 952 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -18044,10 +17061,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 953 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -18056,10 +17073,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 954 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -18068,10 +17085,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 955 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -18080,10 +17097,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 956 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.0000152587890625 @@ -18092,10 +17109,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 957 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.0000152587890625 @@ -18104,10 +17121,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 958 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.9999923706054688 @@ -18116,10 +17133,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 959 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.9999923706054688 @@ -18128,10 +17145,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 960 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 7.888609052210118e-31 @@ -18140,10 +17157,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 961 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -7.888609052210118e-31 @@ -18152,10 +17169,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 962 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -18165,10 +17182,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1073 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -18178,10 +17195,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1074 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -18191,10 +17208,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1075 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -18204,10 +17221,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1076 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -18217,10 +17234,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1077 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -18230,10 +17247,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1078 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -18243,10 +17260,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1079 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -18256,10 +17273,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1080 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -18269,10 +17286,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1081 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -18282,10 +17299,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1082 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -18295,10 +17312,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1085 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -18308,10 +17325,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1086 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -18321,10 +17338,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1087 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -18334,10 +17351,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1088 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -18347,10 +17364,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1089 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.862645149230957e-09 @@ -18360,10 +17377,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1092 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.862645149230957e-09 @@ -18373,10 +17390,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1093 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.1754943508222875e-38 @@ -18386,10 +17403,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1094 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.1754943508222875e-38 @@ -18399,10 +17416,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1095 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.401298464324817e-45 @@ -18412,10 +17429,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1096 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.401298464324817e-45 @@ -18425,10 +17442,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1097 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.802596928649634e-45 @@ -18438,10 +17455,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1098 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.2611686178923354e-44 @@ -18451,10 +17468,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1099 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.938735877055719e-39 @@ -18464,10 +17481,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1100 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 5.877471754111438e-39 @@ -18477,10 +17494,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1101 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.1754940705625946e-38 @@ -18490,10 +17507,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1102 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.1754942106924411e-38 @@ -18503,10 +17520,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1103 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.175494490952134e-38 @@ -18516,10 +17533,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1104 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.1754946310819804e-38 @@ -18529,10 +17546,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1105 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.3509880009953429e-38 @@ -18542,10 +17559,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1106 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.350988701644575e-38 @@ -18555,10 +17572,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1107 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.3509895424236536e-38 @@ -18568,10 +17585,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1108 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.70197740328915e-38 @@ -18581,10 +17598,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1109 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 7.450580596923828e-09 @@ -18594,10 +17611,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1110 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.000244140625 @@ -18607,10 +17624,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1111 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.00048828125 @@ -18620,10 +17637,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1112 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.0009765625 @@ -18633,10 +17650,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1113 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2.802596928649634e-45 @@ -18646,10 +17663,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1114 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.2611686178923354e-44 @@ -18659,10 +17676,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1115 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2.938735877055719e-39 @@ -18672,10 +17689,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1116 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -5.877471754111438e-39 @@ -18685,10 +17702,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1117 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.1754940705625946e-38 @@ -18698,10 +17715,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1118 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.1754942106924411e-38 @@ -18711,10 +17728,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1119 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.175494490952134e-38 @@ -18724,10 +17741,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1120 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.1754946310819804e-38 @@ -18737,10 +17754,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1121 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2.3509880009953429e-38 @@ -18750,10 +17767,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1122 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2.350988701644575e-38 @@ -18763,10 +17780,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1123 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2.3509895424236536e-38 @@ -18776,10 +17793,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1124 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -4.70197740328915e-38 @@ -18789,10 +17806,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1125 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -7.450580596923828e-09 @@ -18802,10 +17819,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1126 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.000244140625 @@ -18815,10 +17832,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1127 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.00048828125 @@ -18828,10 +17845,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1128 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.0009765625 @@ -18841,10 +17858,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1129 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 255.99993896484375 @@ -18854,10 +17871,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1132 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 5033165 @@ -18867,10 +17884,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1133 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 421657440 @@ -18880,10 +17897,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1134 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2147483392 @@ -18893,10 +17910,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1135 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 68719476736 @@ -18906,10 +17923,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1136 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 549755813888 @@ -18919,10 +17936,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1137 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 3402823466385288598117041e14 @@ -18932,10 +17949,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1138 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -255.99993896484375 @@ -18945,10 +17962,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1139 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -5033165 @@ -18958,10 +17975,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1140 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -421657440 @@ -18971,10 +17988,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1141 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2147483392 @@ -18984,10 +18001,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1142 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -68719476736 @@ -18997,10 +18014,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1143 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -549755813888 @@ -19010,10 +18027,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1144 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -3402823466385288598117041e14 @@ -19023,10 +18040,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1145 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -19036,10 +18053,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1156 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -19049,10 +18066,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1157 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -19062,10 +18079,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1158 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -19075,10 +18092,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1159 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -19088,10 +18105,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1160 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -19101,10 +18118,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1161 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -19114,10 +18131,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1162 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -19127,10 +18144,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1163 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -19140,10 +18157,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1164 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -19153,10 +18170,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1165 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -19166,10 +18183,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1168 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -19179,10 +18196,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1169 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -19192,10 +18209,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1170 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -19205,10 +18222,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1171 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -19218,10 +18235,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1172 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -19231,10 +18248,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1181 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -19244,10 +18261,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1182 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -19257,10 +18274,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1183 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -19270,10 +18287,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1184 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -19283,10 +18300,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1185 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -19296,10 +18313,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1186 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -19309,10 +18326,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1187 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -19322,10 +18339,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1188 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -19335,10 +18352,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1189 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -19348,10 +18365,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1190 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -19361,10 +18378,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1193 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -19374,10 +18391,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1194 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -19387,10 +18404,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1195 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -19400,10 +18417,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1196 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -19413,10 +18430,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1197 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -19426,10 +18443,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1209 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -19439,10 +18456,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1210 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -19452,10 +18469,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1211 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -19465,10 +18482,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1212 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -19478,10 +18495,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1213 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -19491,10 +18508,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1214 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -19504,10 +18521,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1215 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -19517,10 +18534,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1216 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -19530,10 +18547,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1217 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -19543,10 +18560,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1218 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -19556,10 +18573,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1221 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -19569,10 +18586,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1222 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -19582,10 +18599,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1223 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -19595,10 +18612,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1224 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -19608,10 +18625,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1225 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -19621,10 +18638,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1226 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -19634,10 +18651,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1227 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.0397214889526365 @@ -19647,10 +18664,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1228 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.0397214889526365 @@ -19660,10 +18677,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1229 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.0397210121154785 @@ -19673,10 +18690,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1230 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.0397214889526367 @@ -19686,10 +18703,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1231 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 5e-324 @@ -19699,10 +18716,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1234 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -5e-324 @@ -19712,10 +18729,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1235 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 709.782712893384 @@ -19725,10 +18742,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1237 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 709.7827128933841 @@ -19738,10 +18755,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1244 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -745.1332191019411 @@ -19751,10 +18768,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1245 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -745.1332191019412 @@ -19764,10 +18781,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1252 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -708.3964185322641 @@ -19777,10 +18794,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1259 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -708.3964185322642 @@ -19790,10 +18807,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1266 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5006933289508785 @@ -19803,10 +18820,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1273 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.628493326460252 @@ -19816,10 +18833,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1280 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.837522455340574 @@ -19829,10 +18846,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1287 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.8504909932810999 @@ -19842,10 +18859,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1293 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.6270060846924657 @@ -19855,10 +18872,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1299 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.6744336219614115 @@ -19868,10 +18885,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1305 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 6.657914718791208 @@ -19881,10 +18898,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1312 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 11.022872793631722 @@ -19894,10 +18911,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1319 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 11.411195701885317 @@ -19907,10 +18924,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1326 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 11.794490387560606 @@ -19920,10 +18937,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1333 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 412.83872756953286 @@ -19933,10 +18950,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1340 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 510.87569028483415 @@ -19946,10 +18963,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1347 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -2.6589841439772853e-14 @@ -19959,10 +18976,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1354 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -2.7144952952085447e-14 @@ -19972,10 +18989,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1361 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -19985,10 +19002,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1375 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -19998,10 +19015,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1376 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -20011,10 +19028,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1377 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -20024,10 +19041,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1378 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -20037,10 +19054,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1379 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -20050,10 +19067,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1380 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -20063,10 +19080,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1381 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -20076,10 +19093,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1382 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -20089,10 +19106,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1383 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -20102,10 +19119,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1384 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -20115,10 +19132,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1387 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -20128,10 +19145,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1388 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -20141,10 +19158,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1389 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -20154,10 +19171,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1390 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -20167,10 +19184,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1391 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -20180,10 +19197,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1392 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -20193,10 +19210,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1393 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 88.72283172607422 @@ -20206,10 +19223,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1394 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 88.72283935546875 @@ -20219,10 +19236,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1395 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -103.97207641601562 @@ -20232,10 +19249,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1396 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -103.97208404541016 @@ -20245,10 +19262,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1397 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.3465735614299774 @@ -20258,10 +19275,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1398 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.3465735912322998 @@ -20271,10 +19288,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1399 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.3465736210346222 @@ -20284,10 +19301,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1400 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -20297,10 +19314,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1412 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -20310,10 +19327,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1413 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -20323,10 +19340,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1414 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -20336,10 +19353,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1415 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -20349,10 +19366,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1416 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -20362,10 +19379,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1417 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -20375,10 +19392,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1418 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -20388,10 +19405,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1419 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -20401,10 +19418,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1420 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -20414,10 +19431,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1421 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -20427,10 +19444,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1424 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -20440,10 +19457,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1425 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -20453,10 +19470,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1426 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -20466,10 +19483,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1427 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -20479,10 +19496,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1428 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -20492,10 +19509,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1429 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -20505,10 +19522,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1430 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.225073858507201e-308 @@ -20518,10 +19535,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1431 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -2.225073858507201e-308 @@ -20531,10 +19548,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1432 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -20544,10 +19561,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1441 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -20557,10 +19574,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1442 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -20570,10 +19587,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1443 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -20583,10 +19600,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1444 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -20596,10 +19613,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1445 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -20609,10 +19626,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1446 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -20622,10 +19639,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1447 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -20635,10 +19652,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1448 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -20648,10 +19665,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1449 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -20661,10 +19678,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1450 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -20674,10 +19691,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1453 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -20687,10 +19704,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1454 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -20700,10 +19717,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1455 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -20713,10 +19730,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1456 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -20726,10 +19743,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1457 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -20739,10 +19756,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1458 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -20752,10 +19769,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1459 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -20764,10 +19781,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1471 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -20776,10 +19793,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1472 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -20788,10 +19805,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1473 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -20800,10 +19817,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1474 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -20812,10 +19829,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1475 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -20824,10 +19841,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1476 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -20836,10 +19853,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1477 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -20848,10 +19865,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1478 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -20860,10 +19877,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1479 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -20872,10 +19889,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1480 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -20884,10 +19901,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1483 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -20896,10 +19913,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1484 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -20908,10 +19925,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1485 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -20920,10 +19937,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1486 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -20932,10 +19949,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1487 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -20944,10 +19961,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1488 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -20956,10 +19973,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1489 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -20968,10 +19985,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1490 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -20980,10 +19997,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1491 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.0000152587890625 @@ -20992,10 +20009,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1492 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.0000152587890625 @@ -21004,10 +20021,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1493 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.9999923706054688 @@ -21016,10 +20033,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1494 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.9999923706054688 @@ -21028,10 +20045,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1495 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 7.888609052210118e-31 @@ -21040,10 +20057,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1496 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -7.888609052210118e-31 @@ -21052,10 +20069,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1497 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -21064,10 +20081,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1506 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -21076,10 +20093,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1507 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -21088,10 +20105,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1508 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -21100,10 +20117,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1509 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -21112,10 +20129,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1510 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -21124,10 +20141,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1511 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -21136,10 +20153,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1512 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -21148,10 +20165,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1513 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -21160,10 +20177,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1514 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -21172,10 +20189,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1515 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -21184,10 +20201,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1518 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -21196,10 +20213,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1519 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -21208,10 +20225,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1520 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -21220,10 +20237,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1521 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -21232,10 +20249,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1522 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -21244,10 +20261,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1523 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -21256,10 +20273,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1524 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -21268,10 +20285,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1525 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -21280,10 +20297,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1526 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.0000152587890625 @@ -21292,10 +20309,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1527 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.0000152587890625 @@ -21304,10 +20321,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1528 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.9999923706054688 @@ -21316,10 +20333,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1529 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.9999923706054688 @@ -21328,10 +20345,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1530 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 7.888609052210118e-31 @@ -21340,10 +20357,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1531 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -7.888609052210118e-31 @@ -21352,10 +20369,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1532 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -21366,10 +20383,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1544 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -21380,10 +20397,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1545 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -21394,10 +20411,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1546 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -21408,10 +20425,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1547 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -21422,10 +20439,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1548 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.450045556060236 @@ -21436,10 +20453,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1549 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 7.858890253041697 @@ -21450,10 +20467,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1550 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.792054511984896 @@ -21464,10 +20481,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1551 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.615702673197924 @@ -21478,10 +20495,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1552 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5587586823609152 @@ -21492,10 +20509,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1553 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 3 @@ -21506,10 +20523,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1556 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -3 @@ -21520,10 +20537,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1557 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4 @@ -21534,10 +20551,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1558 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4 @@ -21548,10 +20565,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1559 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -3 @@ -21562,10 +20579,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1560 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1797693134862315708145274e284 @@ -21576,10 +20593,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1561 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1797693134862315708145274e284 @@ -21590,10 +20607,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1562 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 5e-324 @@ -21604,10 +20621,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1563 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 5e-324 @@ -21618,10 +20635,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1564 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -21632,10 +20649,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1565 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -21646,10 +20663,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1566 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -21660,10 +20677,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1567 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -21674,10 +20691,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1568 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -21688,10 +20705,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1569 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -21702,10 +20719,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1570 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -21716,10 +20733,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1571 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -21730,10 +20747,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1572 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -21744,10 +20761,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1573 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -21758,10 +20775,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1574 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -21772,10 +20789,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1583 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -21786,10 +20803,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1584 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -21800,10 +20817,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1585 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -21814,10 +20831,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1586 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -21828,10 +20845,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1587 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.450045585632324 @@ -21842,10 +20859,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1588 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 7.858890056610107 @@ -21856,10 +20873,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1589 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.7920545339584351 @@ -21870,10 +20887,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1590 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6157026886940002 @@ -21884,10 +20901,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1591 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5587586760520935 @@ -21898,10 +20915,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1592 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 3 @@ -21912,10 +20929,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1595 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -3 @@ -21926,10 +20943,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1596 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4 @@ -21940,10 +20957,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1597 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4 @@ -21954,10 +20971,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1598 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -3 @@ -21968,10 +20985,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1599 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 3402823466385288598117041e14 @@ -21982,10 +20999,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1600 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 3402823466385288598117041e14 @@ -21996,10 +21013,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1601 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.401298464324817e-45 @@ -22010,10 +21027,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1602 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.401298464324817e-45 @@ -22024,10 +21041,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1603 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -22038,10 +21055,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1604 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -22052,10 +21069,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1605 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -22066,10 +21083,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1606 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -22080,10 +21097,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1607 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -22094,10 +21111,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1608 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -22108,10 +21125,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1609 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -22122,10 +21139,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1610 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -22136,10 +21153,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1611 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -22150,10 +21167,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1612 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -22164,10 +21181,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1613 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -22177,10 +21194,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1625 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -22190,10 +21207,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1626 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -22203,10 +21220,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1627 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -22216,10 +21233,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1628 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -22229,10 +21246,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1629 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -22242,10 +21259,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1630 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -22255,10 +21272,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1631 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -22268,10 +21285,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1632 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -22281,10 +21298,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1633 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -22294,10 +21311,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1634 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -22307,10 +21324,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1637 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -22320,10 +21337,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1638 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -7.888609052210118e-31 @@ -22333,10 +21350,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1639 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -22346,10 +21363,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1640 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -22359,10 +21376,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1641 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -22372,10 +21389,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1642 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -22385,10 +21402,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1643 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -22398,10 +21415,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1644 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -22410,10 +21427,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1653 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -22422,10 +21439,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1654 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -7.888609052210118e-31 @@ -22434,10 +21451,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1655 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -22446,10 +21463,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1656 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -22458,10 +21475,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1657 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -22470,10 +21487,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1658 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -22482,10 +21499,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1659 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -22494,10 +21511,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1660 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -22506,10 +21523,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1663 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -22518,10 +21535,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1664 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -7.888609052210118e-31 @@ -22530,10 +21547,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1665 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -22542,10 +21559,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1666 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -22554,10 +21571,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1667 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -22566,10 +21583,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1668 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -22578,10 +21595,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1669 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -22590,10 +21607,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1670 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -22603,10 +21620,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1682 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -22616,10 +21633,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1683 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -22629,10 +21646,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1684 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -22642,10 +21659,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1685 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -22655,10 +21672,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1686 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -22668,10 +21685,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1687 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -22681,10 +21698,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1688 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -22694,10 +21711,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1689 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -22707,10 +21724,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1690 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -22720,10 +21737,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1691 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -22733,10 +21750,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1694 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -22746,10 +21763,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1695 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -7.888609052210118e-31 @@ -22759,10 +21776,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1696 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -22772,10 +21789,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1697 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -22785,10 +21802,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1698 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -22798,10 +21815,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1699 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -22811,10 +21828,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1700 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -22824,10 +21841,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1701 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -22837,10 +21854,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1710 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -22850,10 +21867,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1711 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -22863,10 +21880,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1712 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -22876,10 +21893,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1713 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -22889,10 +21906,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1714 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -22902,10 +21919,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1715 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -22915,10 +21932,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1716 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -22928,10 +21945,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1717 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -22941,10 +21958,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1718 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -22954,10 +21971,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1719 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -22967,10 +21984,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1722 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -22980,10 +21997,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1723 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -7.888609052210118e-31 @@ -22993,10 +22010,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1724 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -23006,10 +22023,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1725 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -23019,10 +22036,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1726 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -23032,10 +22049,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1727 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -23045,10 +22062,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1728 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -23058,10 +22075,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1729 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -23071,10 +22088,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1741 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -23084,10 +22101,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1742 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -23097,10 +22114,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1743 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -23110,10 +22127,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1744 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -23123,10 +22140,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1745 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -23136,10 +22153,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1746 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -23149,10 +22166,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1747 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -23162,10 +22179,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1748 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -23175,10 +22192,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1749 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -23188,10 +22205,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1750 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -23201,10 +22218,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1753 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -23214,10 +22231,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1754 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -7.888609052210118e-31 @@ -23227,10 +22244,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1755 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -23240,10 +22257,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1756 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -23253,10 +22270,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1757 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -23266,10 +22283,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1758 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -23279,10 +22296,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1759 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -23292,10 +22309,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1760 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -23305,10 +22322,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1769 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -23318,10 +22335,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1770 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -23331,10 +22348,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1771 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -23344,10 +22361,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1772 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -23357,10 +22374,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1773 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -23370,10 +22387,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1774 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -23383,10 +22400,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1775 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -23396,10 +22413,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1776 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -23409,10 +22426,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1777 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -23422,10 +22439,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1778 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -23435,10 +22452,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1781 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -23448,10 +22465,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1782 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -7.888609052210118e-31 @@ -23461,10 +22478,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1783 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -23474,10 +22491,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1784 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -23487,10 +22504,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1785 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -23500,10 +22517,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1786 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -23513,10 +22530,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1787 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -23526,10 +22543,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1788 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.1754942106924411e-38 @@ -23539,10 +22556,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1789 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -23552,10 +22569,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1801 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -23565,10 +22582,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1802 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -23578,10 +22595,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1803 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -23591,10 +22608,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1804 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -23604,10 +22621,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1805 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -23617,10 +22634,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1806 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -23630,10 +22647,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1807 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -23643,10 +22660,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1808 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -23656,10 +22673,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1809 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -23669,10 +22686,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1810 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -23682,10 +22699,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1813 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -23695,10 +22712,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1814 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -7.888609052210118e-31 @@ -23708,10 +22725,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1815 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -23721,10 +22738,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1816 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -23734,10 +22751,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1817 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -23747,10 +22764,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1818 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -23760,10 +22777,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1819 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -23773,10 +22790,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1820 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -23786,10 +22803,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1829 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -23799,10 +22816,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1830 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -23812,10 +22829,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1831 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -23825,10 +22842,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1832 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -23838,10 +22855,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1833 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -23851,10 +22868,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1834 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -23864,10 +22881,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1835 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -23877,10 +22894,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1836 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -23890,10 +22907,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1837 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -23903,10 +22920,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1838 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -23916,10 +22933,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1841 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -23929,10 +22946,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1842 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -7.888609052210118e-31 @@ -23942,10 +22959,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1843 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -23955,10 +22972,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1844 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -23968,10 +22985,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1845 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -23981,10 +22998,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1846 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -23994,10 +23011,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1847 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -24007,10 +23024,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1848 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -24020,10 +23037,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1860 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -24033,10 +23050,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1861 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -24046,10 +23063,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1862 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -24059,10 +23076,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1863 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -24072,10 +23089,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1864 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.450045556060236 @@ -24085,10 +23102,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1865 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 7.858890253041697 @@ -24098,10 +23115,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1866 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.792054511984896 @@ -24111,10 +23128,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1867 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.615702673197924 @@ -24124,10 +23141,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1868 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5587586823609152 @@ -24137,10 +23154,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1869 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -24150,10 +23167,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1872 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -24163,10 +23180,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1873 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -24176,10 +23193,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1874 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -24189,10 +23206,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1875 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -24202,10 +23219,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1876 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -24215,10 +23232,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1877 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -24228,10 +23245,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1878 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -24241,10 +23258,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1879 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -24254,10 +23271,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1880 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -24267,10 +23284,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1881 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -24280,10 +23297,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1882 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -24293,10 +23310,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1883 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -24306,10 +23323,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1884 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -24319,10 +23336,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1885 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -24332,10 +23349,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1886 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -24345,10 +23362,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1887 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -24358,10 +23375,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1888 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -24371,10 +23388,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1889 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -24384,10 +23401,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1890 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -24397,10 +23414,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1891 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -24410,10 +23427,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1892 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -24423,10 +23440,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1893 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -24436,10 +23453,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1894 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -24449,10 +23466,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1895 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -24462,10 +23479,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1896 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -24475,10 +23492,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1897 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -24488,10 +23505,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1898 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -24501,10 +23518,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1899 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -24514,10 +23531,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1900 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -24527,10 +23544,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1901 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -24540,10 +23557,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1902 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -24553,10 +23570,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1903 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -24566,10 +23583,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1904 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -24579,10 +23596,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1905 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -24592,10 +23609,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1906 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -24605,10 +23622,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1907 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -24618,10 +23635,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1908 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -24631,10 +23648,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1909 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -24644,10 +23661,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1910 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -24657,10 +23674,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1911 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -24670,10 +23687,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1912 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -24683,10 +23700,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1913 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -24696,10 +23713,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1914 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -24709,10 +23726,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1915 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -24722,10 +23739,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1916 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -24735,10 +23752,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1917 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -24748,10 +23765,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1918 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -24761,10 +23778,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1919 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -24774,10 +23791,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1920 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -24787,10 +23804,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1921 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -24800,10 +23817,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1922 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -24813,10 +23830,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1923 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -24826,10 +23843,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1924 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -24839,10 +23856,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1925 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.75 @@ -24852,10 +23869,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1926 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.75 @@ -24865,10 +23882,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1927 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.75 @@ -24878,10 +23895,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1928 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.75 @@ -24891,10 +23908,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1929 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -24904,10 +23921,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1938 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -24917,10 +23934,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1939 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -24930,10 +23947,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1940 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -24943,10 +23960,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1941 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -24956,10 +23973,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1942 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.450045585632324 @@ -24969,10 +23986,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1943 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 7.858890056610107 @@ -24982,10 +23999,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1944 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.7920545339584351 @@ -24995,10 +24012,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1945 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6157026886940002 @@ -25008,10 +24025,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1946 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5587586760520935 @@ -25021,10 +24038,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1947 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -25034,10 +24051,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1950 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -25047,10 +24064,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1951 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -25060,10 +24077,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1952 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -25073,10 +24090,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1953 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -25086,10 +24103,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1954 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -25099,10 +24116,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1955 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -25112,10 +24129,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1956 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -25125,10 +24142,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1957 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -25138,10 +24155,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1958 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -25151,10 +24168,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1959 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -25164,10 +24181,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1960 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -25177,10 +24194,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1961 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -25190,10 +24207,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1962 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -25203,10 +24220,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1963 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -25216,10 +24233,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1964 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -25229,10 +24246,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1965 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -25242,10 +24259,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1966 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -25255,10 +24272,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1967 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -25268,10 +24285,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1968 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -25281,10 +24298,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1969 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -25294,10 +24311,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1970 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -25307,10 +24324,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1971 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -25320,10 +24337,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1972 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -25333,10 +24350,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1973 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -25346,10 +24363,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1974 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -25359,10 +24376,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1975 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -25372,10 +24389,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1976 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -25385,10 +24402,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1977 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -25398,10 +24415,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1978 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -25411,10 +24428,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1979 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -25424,10 +24441,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1980 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -25437,10 +24454,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1981 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -25450,10 +24467,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1982 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -25463,10 +24480,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1983 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -25476,10 +24493,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1984 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -25489,10 +24506,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1985 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -25502,10 +24519,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1986 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -25515,10 +24532,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1987 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -25528,10 +24545,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1988 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -25541,10 +24558,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1989 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -25554,10 +24571,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1990 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -25567,10 +24584,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1991 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -25580,10 +24597,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1992 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -25593,10 +24610,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1993 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -25606,10 +24623,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1994 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -25619,10 +24636,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1995 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -25632,10 +24649,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1996 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -25645,10 +24662,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1997 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -25658,10 +24675,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1998 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -25671,10 +24688,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1999 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -25684,10 +24701,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2000 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -25697,10 +24714,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2001 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -25710,10 +24727,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2002 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -25723,10 +24740,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2003 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.75 @@ -25736,10 +24753,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2004 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.75 @@ -25749,10 +24766,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2005 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.75 @@ -25762,10 +24779,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2006 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.75 @@ -25775,10 +24792,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2007 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -25788,10 +24805,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2019 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -25801,10 +24818,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2020 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -25814,10 +24831,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2021 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -25827,10 +24844,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2022 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -25840,10 +24857,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2023 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.450045556060236 @@ -25853,10 +24870,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2024 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 7.858890253041697 @@ -25866,10 +24883,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2025 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.792054511984896 @@ -25879,10 +24896,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2026 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.615702673197924 @@ -25892,10 +24909,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2027 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5587586823609152 @@ -25905,10 +24922,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2028 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -25918,10 +24935,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2031 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -25931,10 +24948,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2032 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -25944,10 +24961,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2033 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -25957,10 +24974,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2034 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -25970,10 +24987,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2035 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -25983,10 +25000,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2036 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -25996,10 +25013,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2037 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -26009,10 +25026,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2038 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -26022,10 +25039,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2039 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -26035,10 +25052,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2040 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -26048,10 +25065,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2041 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -26061,10 +25078,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2042 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -26074,10 +25091,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2043 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -26087,10 +25104,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2044 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -26100,10 +25117,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2045 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -26113,10 +25130,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2046 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -26126,10 +25143,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2047 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -26139,10 +25156,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2048 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -26152,10 +25169,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2049 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -26165,10 +25182,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2050 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -26178,10 +25195,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2051 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -26191,10 +25208,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2052 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -26204,10 +25221,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2053 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -26217,10 +25234,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2054 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -26230,10 +25247,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2055 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -26243,10 +25260,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2056 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -26256,10 +25273,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2057 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -26269,10 +25286,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2058 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -26282,10 +25299,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2059 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -26295,10 +25312,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2060 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -26308,10 +25325,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2061 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -26321,10 +25338,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2062 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -26334,10 +25351,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2063 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -26347,10 +25364,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2064 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -26360,10 +25377,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2065 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -26373,10 +25390,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2066 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -26386,10 +25403,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2067 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -26399,10 +25416,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2068 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -26412,10 +25429,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2069 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -26425,10 +25442,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2070 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -26438,10 +25455,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2071 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -26451,10 +25468,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2072 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -26464,10 +25481,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2073 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -26477,10 +25494,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2074 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -26490,10 +25507,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2075 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -26503,10 +25520,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2076 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -26516,10 +25533,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2077 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -26529,10 +25546,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2078 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -26542,10 +25559,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2079 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -26555,10 +25572,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2080 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -26568,10 +25585,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2081 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -26581,10 +25598,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2082 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -26594,10 +25611,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2083 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -26607,10 +25624,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2084 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.75 @@ -26620,10 +25637,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2085 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.75 @@ -26633,10 +25650,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2086 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.75 @@ -26646,10 +25663,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2087 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.75 @@ -26659,10 +25676,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2088 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -26672,10 +25689,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2097 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -26685,10 +25702,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2098 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -26698,10 +25715,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2099 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -26711,10 +25728,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2100 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -26724,10 +25741,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2101 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.450045585632324 @@ -26737,10 +25754,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2102 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 7.858890056610107 @@ -26750,10 +25767,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2103 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.7920545339584351 @@ -26763,10 +25780,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2104 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6157026886940002 @@ -26776,10 +25793,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2105 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5587586760520935 @@ -26789,10 +25806,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2106 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -26802,10 +25819,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2109 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -26815,10 +25832,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2110 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -26828,10 +25845,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2111 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -26841,10 +25858,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2112 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -26854,10 +25871,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2113 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -26867,10 +25884,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2114 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -26880,10 +25897,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2115 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -26893,10 +25910,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2116 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -26906,10 +25923,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2117 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -26919,10 +25936,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2118 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -26932,10 +25949,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2119 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -26945,10 +25962,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2120 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -26958,10 +25975,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2121 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -26971,10 +25988,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2122 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -26984,10 +26001,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2123 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -26997,10 +26014,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2124 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -27010,10 +26027,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2125 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -27023,10 +26040,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2126 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -27036,10 +26053,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2127 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -27049,10 +26066,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2128 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -27062,10 +26079,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2129 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -27075,10 +26092,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2130 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -27088,10 +26105,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2131 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -27101,10 +26118,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2132 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -27114,10 +26131,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2133 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -27127,10 +26144,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2134 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -27140,10 +26157,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2135 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -27153,10 +26170,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2136 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -27166,10 +26183,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2137 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -27179,10 +26196,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2138 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -27192,10 +26209,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2139 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -27205,10 +26222,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2140 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -27218,10 +26235,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2141 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -27231,10 +26248,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2142 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -27244,10 +26261,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2143 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -27257,10 +26274,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2144 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -27270,10 +26287,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2145 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -27283,10 +26300,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2146 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -27296,10 +26313,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2147 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -27309,10 +26326,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2148 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -27322,10 +26339,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2149 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -27335,10 +26352,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2150 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -27348,10 +26365,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2151 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -27361,10 +26378,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2152 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -27374,10 +26391,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2153 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -27387,10 +26404,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2154 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -27400,10 +26417,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2155 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -27413,10 +26430,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2156 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -27426,10 +26443,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2157 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -27439,10 +26456,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2158 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -27452,10 +26469,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2159 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -27465,10 +26482,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2160 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -27478,10 +26495,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2161 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -27491,10 +26508,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2162 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.75 @@ -27504,10 +26521,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2163 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.75 @@ -27517,10 +26534,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2164 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.75 @@ -27530,10 +26547,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2165 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.75 @@ -27543,10 +26560,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2166 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -27556,10 +26573,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2180 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -27569,10 +26586,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2181 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -27582,10 +26599,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2182 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -27595,10 +26612,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2183 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -27608,10 +26625,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2184 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.450045556060236 @@ -27621,10 +26638,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2185 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 7.858890253041697 @@ -27634,10 +26651,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2186 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.792054511984896 @@ -27647,10 +26664,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2187 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.615702673197924 @@ -27660,10 +26677,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2188 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5587586823609152 @@ -27673,10 +26690,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2189 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -27686,10 +26703,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2192 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -27699,10 +26716,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2193 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -27712,10 +26729,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2194 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -27725,10 +26742,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2195 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -27738,10 +26755,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2196 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -27751,10 +26768,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2197 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.5 @@ -27764,10 +26781,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2198 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.5 @@ -27777,10 +26794,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2199 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2 @@ -27790,10 +26807,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2200 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -2 @@ -27803,10 +26820,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2201 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -27816,10 +26833,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2202 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -27829,10 +26846,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2203 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -27842,10 +26859,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2204 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -27855,10 +26872,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2205 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -27868,10 +26885,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2206 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -27881,10 +26898,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2207 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -27894,10 +26911,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2208 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -27907,10 +26924,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2209 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -27920,10 +26937,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2210 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.5 @@ -27933,10 +26950,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2211 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.5 @@ -27946,10 +26963,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2212 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2 @@ -27959,10 +26976,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2213 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -2 @@ -27972,10 +26989,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2214 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -27985,10 +27002,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2215 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -27998,10 +27015,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2216 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -28011,10 +27028,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2217 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -28024,10 +27041,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2218 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -28037,10 +27054,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2219 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -28050,10 +27067,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2220 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -28063,10 +27080,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2221 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -28076,10 +27093,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2222 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -28089,10 +27106,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2223 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -28102,10 +27119,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2224 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -28115,10 +27132,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2225 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -28128,10 +27145,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2226 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -28141,10 +27158,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2227 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -28154,10 +27171,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2228 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -28167,10 +27184,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2229 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -28180,10 +27197,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2230 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -28193,10 +27210,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2231 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -28206,10 +27223,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2232 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -28219,10 +27236,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2233 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -28232,10 +27249,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2234 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -28245,10 +27262,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2235 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -28258,10 +27275,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2236 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -28271,10 +27288,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2237 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -28284,10 +27301,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2238 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -28297,10 +27314,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2239 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -28310,10 +27327,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2240 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -28323,10 +27340,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2241 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -28336,10 +27353,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2242 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -28349,10 +27366,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2243 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -28362,10 +27379,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2244 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -28375,10 +27392,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2245 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -28388,10 +27405,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2246 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -28401,10 +27418,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2247 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -28414,10 +27431,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2248 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -28427,10 +27444,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2249 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -28440,10 +27457,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2250 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -28453,10 +27470,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2251 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -28466,10 +27483,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2252 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -28479,10 +27496,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2253 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.75 @@ -28492,10 +27509,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2254 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.75 @@ -28505,10 +27522,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2255 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.75 @@ -28518,10 +27535,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2256 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.75 @@ -28531,10 +27548,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2257 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -28544,10 +27561,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2266 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -28557,10 +27574,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2267 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -28570,10 +27587,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2268 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -28583,10 +27600,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2269 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -28596,10 +27613,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2270 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.450045585632324 @@ -28609,10 +27626,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2271 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 7.858890056610107 @@ -28622,10 +27639,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2272 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.7920545339584351 @@ -28635,10 +27652,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2273 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6157026886940002 @@ -28648,10 +27665,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2274 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5587586760520935 @@ -28661,10 +27678,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2275 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -28674,10 +27691,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2278 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -28687,10 +27704,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2279 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -28700,10 +27717,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2280 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -28713,10 +27730,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2281 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -28726,10 +27743,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2282 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -28739,10 +27756,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2283 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.5 @@ -28752,10 +27769,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2284 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.5 @@ -28765,10 +27782,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2285 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2 @@ -28778,10 +27795,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2286 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2 @@ -28791,10 +27808,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2287 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -28804,10 +27821,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2288 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -28817,10 +27834,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2289 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -28830,10 +27847,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2290 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -28843,10 +27860,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2291 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -28856,10 +27873,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2292 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -28869,10 +27886,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2293 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -28882,10 +27899,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2294 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -28895,10 +27912,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2295 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -28908,10 +27925,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2296 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.5 @@ -28921,10 +27938,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2297 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.5 @@ -28934,10 +27951,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2298 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2 @@ -28947,10 +27964,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2299 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2 @@ -28960,10 +27977,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2300 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -28973,10 +27990,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2301 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -28986,10 +28003,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2302 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -28999,10 +28016,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2303 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -29012,10 +28029,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2304 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -29025,10 +28042,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2305 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -29038,10 +28055,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2306 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -29051,10 +28068,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2307 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -29064,10 +28081,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2308 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -29077,10 +28094,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2309 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -29090,10 +28107,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2310 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -29103,10 +28120,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2311 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -29116,10 +28133,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2312 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -29129,10 +28146,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2313 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -29142,10 +28159,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2314 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -29155,10 +28172,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2315 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -29168,10 +28185,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2316 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -29181,10 +28198,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2317 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -29194,10 +28211,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2318 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -29207,10 +28224,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2319 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -29220,10 +28237,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2320 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -29233,10 +28250,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2321 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -29246,10 +28263,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2322 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -29259,10 +28276,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2323 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -29272,10 +28289,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2324 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -29285,10 +28302,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2325 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -29298,10 +28315,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2326 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -29311,10 +28328,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2327 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -29324,10 +28341,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2328 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -29337,10 +28354,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2329 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -29350,10 +28367,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2330 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -29363,10 +28380,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2331 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -29376,10 +28393,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2332 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -29389,10 +28406,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2333 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -29402,10 +28419,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2334 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -29415,10 +28432,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2335 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -29428,10 +28445,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2336 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -29441,10 +28458,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2337 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -29454,10 +28471,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2338 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -29467,10 +28484,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2339 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.75 @@ -29480,10 +28497,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2340 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.75 @@ -29493,10 +28510,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2341 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.75 @@ -29506,10 +28523,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2342 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.75 @@ -29519,10 +28536,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2343 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -29533,10 +28550,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2355 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -29547,10 +28564,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2356 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -29561,10 +28578,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2357 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -29575,10 +28592,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2358 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -29589,10 +28606,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2359 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.450045556060236 @@ -29603,10 +28620,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2360 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 7.858890253041697 @@ -29617,10 +28634,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2361 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.792054511984896 @@ -29631,10 +28648,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2362 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.615702673197924 @@ -29645,10 +28662,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2363 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5587586823609152 @@ -29659,10 +28676,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2364 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -29673,10 +28690,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2367 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -29687,10 +28704,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2368 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -29701,10 +28718,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2369 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -29715,10 +28732,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2370 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -29729,10 +28746,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2371 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -29743,10 +28760,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2372 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -29757,10 +28774,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2373 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -29771,10 +28788,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2374 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -29785,10 +28802,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2375 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -29799,10 +28816,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2376 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -29813,10 +28830,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2377 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -29827,10 +28844,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2378 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -29841,10 +28858,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2379 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -29855,10 +28872,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2380 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -29869,10 +28886,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2381 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -29883,10 +28900,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2382 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -29897,10 +28914,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2383 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -29911,10 +28928,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2384 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -29925,10 +28942,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2385 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -29939,10 +28956,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2386 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -29953,10 +28970,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2387 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -29967,10 +28984,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2388 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -29981,10 +28998,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2389 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -29995,10 +29012,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2390 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -30009,10 +29026,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2391 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -30023,10 +29040,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2392 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -30037,10 +29054,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2393 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -30051,10 +29068,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2394 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -30065,10 +29082,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2395 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -30079,10 +29096,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2396 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -30093,10 +29110,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2397 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -30107,10 +29124,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2398 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -30121,10 +29138,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2399 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -30135,10 +29152,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2400 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -30149,10 +29166,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2401 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -30163,10 +29180,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2402 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -30177,10 +29194,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2403 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -30191,10 +29208,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2404 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -30205,10 +29222,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2405 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -30219,10 +29236,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2406 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -30233,10 +29250,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2407 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -30247,10 +29264,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2408 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -30261,10 +29278,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2409 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -30275,10 +29292,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2410 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -30289,10 +29306,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2411 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -30303,10 +29320,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2412 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -30317,10 +29334,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2413 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -30331,10 +29348,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2414 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -30345,10 +29362,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2415 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -30359,10 +29376,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2416 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -30373,10 +29390,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2417 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -30387,10 +29404,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2418 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -30401,10 +29418,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2419 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -30415,10 +29432,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2420 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -30429,10 +29446,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2421 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -30443,10 +29460,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2422 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -30457,10 +29474,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2423 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -30471,10 +29488,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2424 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -30485,10 +29502,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2425 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -30499,10 +29516,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2426 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -30513,10 +29530,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2427 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -30527,10 +29544,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2428 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -30541,10 +29558,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2429 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -30555,10 +29572,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2430 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -30569,10 +29586,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2431 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.5 @@ -30583,10 +29600,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2432 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.5 @@ -30597,10 +29614,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2433 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.5 @@ -30611,10 +29628,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2434 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -30625,10 +29642,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2435 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -30639,10 +29656,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2436 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -30653,10 +29670,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2437 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -30667,10 +29684,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2438 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -30681,10 +29698,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2439 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -30695,10 +29712,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2440 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -30709,10 +29726,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2441 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -30723,10 +29740,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2442 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -30737,10 +29754,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2443 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -30751,10 +29768,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2444 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -30765,10 +29782,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2445 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -30779,10 +29796,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2446 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -30793,10 +29810,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2447 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -30807,10 +29824,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2448 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -30821,10 +29838,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2449 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -30835,10 +29852,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2450 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -30849,10 +29866,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2451 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -30863,10 +29880,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2452 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -30877,10 +29894,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2453 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -30891,10 +29908,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2454 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -30905,10 +29922,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2455 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -30919,10 +29936,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2456 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -2 @@ -30933,10 +29950,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2457 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -2 @@ -30947,10 +29964,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2458 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -30961,10 +29978,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2467 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -30975,10 +29992,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2468 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -30989,10 +30006,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2469 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -31003,10 +30020,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2470 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -31017,10 +30034,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2471 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.450045585632324 @@ -31031,10 +30048,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2472 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 7.858890056610107 @@ -31045,10 +30062,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2473 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.7920545339584351 @@ -31059,10 +30076,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2474 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6157026886940002 @@ -31073,10 +30090,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2475 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5587586760520935 @@ -31087,10 +30104,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2476 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -31101,10 +30118,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2479 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -31115,10 +30132,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2480 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -31129,10 +30146,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2481 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -31143,10 +30160,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2482 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -31157,10 +30174,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2483 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -31171,10 +30188,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2484 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -31185,10 +30202,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2485 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -31199,10 +30216,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2486 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -31213,10 +30230,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2487 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -31227,10 +30244,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2488 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -31241,10 +30258,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2489 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -31255,10 +30272,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2490 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -31269,10 +30286,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2491 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -31283,10 +30300,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2492 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -31297,10 +30314,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2493 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -31311,10 +30328,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2494 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -31325,10 +30342,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2495 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -31339,10 +30356,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2496 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -31353,10 +30370,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2497 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -31367,10 +30384,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2498 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -31381,10 +30398,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2499 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -31395,10 +30412,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2500 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -31409,10 +30426,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2501 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -31423,10 +30440,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2502 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -31437,10 +30454,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2503 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -31451,10 +30468,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2504 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -31465,10 +30482,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2505 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -31479,10 +30496,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2506 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -31493,10 +30510,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2507 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -31507,10 +30524,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2508 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -31521,10 +30538,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2509 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -31535,10 +30552,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2510 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -31549,10 +30566,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2511 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -31563,10 +30580,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2512 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -31577,10 +30594,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2513 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -31591,10 +30608,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2514 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -31605,10 +30622,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2515 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -31619,10 +30636,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2516 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -31633,10 +30650,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2517 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -31647,10 +30664,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2518 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -31661,10 +30678,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2519 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -31675,10 +30692,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2520 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -31689,10 +30706,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2521 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -31703,10 +30720,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2522 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -31717,10 +30734,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2523 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -31731,10 +30748,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2524 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -31745,10 +30762,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2525 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -31759,10 +30776,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2526 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -31773,10 +30790,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2527 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -31787,10 +30804,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2528 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -31801,10 +30818,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2529 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -31815,10 +30832,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2530 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -31829,10 +30846,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2531 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -31843,10 +30860,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2532 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -31857,10 +30874,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2533 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -31871,10 +30888,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2534 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -31885,10 +30902,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2535 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -31899,10 +30916,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2536 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -31913,10 +30930,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2537 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -31927,10 +30944,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2538 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -31941,10 +30958,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2539 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -31955,10 +30972,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2540 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -31969,10 +30986,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2541 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -31983,10 +31000,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2542 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -31997,10 +31014,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2543 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.5 @@ -32011,10 +31028,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2544 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.5 @@ -32025,10 +31042,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2545 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.5 @@ -32039,10 +31056,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2546 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -32053,10 +31070,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2547 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -32067,10 +31084,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2548 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -32081,10 +31098,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2549 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -32095,10 +31112,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2550 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -32109,10 +31126,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2551 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -32123,10 +31140,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2552 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -32137,10 +31154,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2553 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -32151,10 +31168,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2554 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -32165,10 +31182,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2555 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -32179,10 +31196,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2556 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -32193,10 +31210,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2557 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -32207,10 +31224,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2558 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -32221,10 +31238,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2559 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -32235,10 +31252,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2560 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -32249,10 +31266,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2561 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -32263,10 +31280,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2562 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -32277,10 +31294,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2563 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -32291,10 +31308,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2564 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -32305,10 +31322,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2565 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -32319,10 +31336,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2566 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -32333,10 +31350,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2567 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -32347,10 +31364,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2568 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2 @@ -32361,10 +31378,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2569 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2 @@ -32375,45 +31392,46 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2570 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end call $~lib/bindings/Math/random i64.reinterpret_f64 call $~lib/math/NativeMath.seedRandom loop $repeat|0 - local.get $2 - f64.convert_i32_s - f64.const 1e6 - f64.lt - if + block $break|0 + local.get $0 + f64.convert_i32_s + f64.const 1e6 + f64.lt + i32.eqz + br_if $break|0 call $~lib/math/NativeMath.random - local.tee $0 + local.tee $1 f64.const 0 f64.ge - local.tee $3 if (result i32) - local.get $0 + local.get $1 f64.const 1 f64.lt else - local.get $3 + i32.const 0 end if - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $repeat|0 else i32.const 0 - i32.const 8 + i32.const 24 i32.const 2579 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end unreachable @@ -32423,37 +31441,38 @@ i64.reinterpret_f64 call $~lib/math/NativeMath.seedRandom i32.const 0 - local.set $2 + local.set $0 loop $repeat|1 - local.get $2 - f64.convert_i32_s - f64.const 1e6 - f64.lt - if + block $break|1 + local.get $0 + f64.convert_i32_s + f64.const 1e6 + f64.lt + i32.eqz + br_if $break|1 call $~lib/math/NativeMathf.random - local.tee $1 + local.tee $2 f32.const 0 f32.ge - local.tee $3 if (result i32) - local.get $1 + local.get $2 f32.const 1 f32.lt else - local.get $3 + i32.const 0 end if - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $repeat|1 else i32.const 0 - i32.const 8 + i32.const 24 i32.const 2587 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end unreachable @@ -32465,10 +31484,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2601 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -32477,10 +31496,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2602 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -32489,10 +31508,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2603 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -32501,10 +31520,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2604 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -32513,10 +31532,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2605 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -32525,10 +31544,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2606 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -32537,10 +31556,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2607 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -32549,10 +31568,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2608 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -32561,10 +31580,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2609 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -32573,10 +31592,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2610 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -32585,10 +31604,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2613 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -32597,10 +31616,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2614 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -32609,10 +31628,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2615 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -32621,10 +31640,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2616 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -32633,10 +31652,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2617 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -32645,10 +31664,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2618 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -32657,10 +31676,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2619 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -32669,10 +31688,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2620 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -32681,10 +31700,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2621 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.5 @@ -32693,10 +31712,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2622 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.5 @@ -32705,10 +31724,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2623 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.0000152587890625 @@ -32717,10 +31736,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2624 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.0000152587890625 @@ -32729,10 +31748,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2625 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.9999923706054688 @@ -32741,10 +31760,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2626 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.9999923706054688 @@ -32753,10 +31772,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2627 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 7.888609052210118e-31 @@ -32765,10 +31784,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2628 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -7.888609052210118e-31 @@ -32777,10 +31796,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2629 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -32789,10 +31808,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2638 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -32801,10 +31820,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2639 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -32813,10 +31832,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2640 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -32825,10 +31844,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2641 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -32837,10 +31856,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2642 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -32849,10 +31868,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2643 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -32861,10 +31880,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2644 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -32873,10 +31892,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2645 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -32885,10 +31904,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2646 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -32897,10 +31916,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2647 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -32909,10 +31928,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2650 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -32921,10 +31940,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2651 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -32933,10 +31952,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2652 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -32945,10 +31964,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2653 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -32957,10 +31976,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2654 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -32969,10 +31988,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2655 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -32981,10 +32000,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2656 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -32993,10 +32012,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2657 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -33005,10 +32024,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2658 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.5 @@ -33017,10 +32036,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2659 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.5 @@ -33029,10 +32048,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2660 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.0000152587890625 @@ -33041,10 +32060,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2661 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.0000152587890625 @@ -33053,10 +32072,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2662 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.9999923706054688 @@ -33065,10 +32084,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2663 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.9999923706054688 @@ -33077,10 +32096,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2664 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 7.888609052210118e-31 @@ -33089,10 +32108,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2665 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -7.888609052210118e-31 @@ -33101,10 +32120,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2666 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -33113,10 +32132,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2677 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -33125,10 +32144,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2678 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -33137,10 +32156,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2679 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2 @@ -33149,10 +32168,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2680 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -33161,10 +32180,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2681 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -2 @@ -33173,10 +32192,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2682 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -33185,10 +32204,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2683 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -33197,10 +32216,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2684 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -33209,10 +32228,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2685 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -33221,10 +32240,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2693 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -33233,10 +32252,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2694 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -33245,10 +32264,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2695 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2 @@ -33257,10 +32276,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2696 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -33269,10 +32288,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2697 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2 @@ -33281,10 +32300,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2698 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -33293,10 +32312,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2699 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -33305,10 +32324,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2700 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -33317,10 +32336,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2701 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -33330,10 +32349,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2738 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -33343,10 +32362,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2739 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -33356,10 +32375,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2740 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -33369,10 +32388,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2741 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -33382,10 +32401,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2742 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.450045556060236 @@ -33395,10 +32414,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2743 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 7.858890253041697 @@ -33408,10 +32427,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2744 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.792054511984896 @@ -33421,10 +32440,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2745 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.615702673197924 @@ -33434,10 +32453,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2746 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5587586823609152 @@ -33447,10 +32466,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2747 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -33460,10 +32479,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2750 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -33473,10 +32492,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2751 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -33486,10 +32505,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2752 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -33499,10 +32518,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2753 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -33512,10 +32531,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2754 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -33525,10 +32544,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2755 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.5 @@ -33538,10 +32557,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2756 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.5 @@ -33551,10 +32570,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2757 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2 @@ -33564,10 +32583,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2758 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -2 @@ -33577,10 +32596,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2759 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -33590,10 +32609,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2760 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -33603,10 +32622,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2761 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -33616,10 +32635,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2762 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -33629,10 +32648,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2763 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -33642,10 +32661,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2764 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -33655,10 +32674,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2765 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -33668,10 +32687,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2766 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -33681,10 +32700,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2767 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -33694,10 +32713,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2768 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.5 @@ -33707,10 +32726,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2769 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.5 @@ -33720,10 +32739,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2770 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2 @@ -33733,10 +32752,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2771 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -2 @@ -33746,10 +32765,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2772 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -33759,10 +32778,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2773 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -33772,10 +32791,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2774 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -33785,10 +32804,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2775 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -33798,10 +32817,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2776 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -33811,10 +32830,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2777 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -33824,10 +32843,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2778 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -33837,10 +32856,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2779 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -33850,10 +32869,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2780 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -33863,10 +32882,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2781 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -33876,10 +32895,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2782 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -33889,10 +32908,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2783 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -33902,10 +32921,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2784 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -33915,10 +32934,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2785 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -33928,10 +32947,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2786 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -33941,10 +32960,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2787 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -33954,10 +32973,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2788 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -33967,10 +32986,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2789 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -33980,10 +32999,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2790 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -33993,10 +33012,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2791 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -34006,10 +33025,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2792 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -34019,10 +33038,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2793 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -34032,10 +33051,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2794 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -34045,10 +33064,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2795 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -34058,10 +33077,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2796 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -34071,10 +33090,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2797 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -34084,10 +33103,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2798 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -34097,10 +33116,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2799 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -34110,10 +33129,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2800 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -34123,10 +33142,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2801 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -34136,10 +33155,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2802 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -34149,10 +33168,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2803 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -34162,10 +33181,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2804 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -34175,10 +33194,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2805 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -34188,10 +33207,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2806 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -34201,10 +33220,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2807 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -34214,10 +33233,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2808 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -34227,10 +33246,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2809 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -34240,10 +33259,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2810 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -34253,10 +33272,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2811 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.75 @@ -34266,10 +33285,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2812 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.75 @@ -34279,10 +33298,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2813 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.75 @@ -34292,10 +33311,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2814 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.75 @@ -34305,10 +33324,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2815 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 8e-323 @@ -34318,10 +33337,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2816 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -34331,10 +33350,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2825 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -34344,10 +33363,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2826 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -34357,10 +33376,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2827 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -34370,10 +33389,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2828 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -34383,10 +33402,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2829 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.450045585632324 @@ -34396,10 +33415,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2830 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 7.858890056610107 @@ -34409,10 +33428,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2831 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.7920545339584351 @@ -34422,10 +33441,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2832 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6157026886940002 @@ -34435,10 +33454,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2833 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5587586760520935 @@ -34448,10 +33467,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2834 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -34461,10 +33480,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2837 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -34474,10 +33493,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2838 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -34487,10 +33506,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2839 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -34500,10 +33519,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2840 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -34513,10 +33532,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2841 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -34526,10 +33545,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2842 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.5 @@ -34539,10 +33558,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2843 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.5 @@ -34552,10 +33571,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2844 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2 @@ -34565,10 +33584,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2845 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2 @@ -34578,10 +33597,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2846 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -34591,10 +33610,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2847 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -34604,10 +33623,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2848 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -34617,10 +33636,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2849 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -34630,10 +33649,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2850 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -34643,10 +33662,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2851 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -34656,10 +33675,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2852 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -34669,10 +33688,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2853 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -34682,10 +33701,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2854 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -34695,10 +33714,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2855 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.5 @@ -34708,10 +33727,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2856 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.5 @@ -34721,10 +33740,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2857 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2 @@ -34734,10 +33753,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2858 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2 @@ -34747,10 +33766,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2859 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -34760,10 +33779,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2860 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -34773,10 +33792,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2861 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -34786,10 +33805,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2862 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -34799,10 +33818,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2863 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -34812,10 +33831,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2864 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -34825,10 +33844,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2865 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -34838,10 +33857,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2866 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -34851,10 +33870,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2867 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -34864,10 +33883,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2868 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -34877,10 +33896,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2869 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -34890,10 +33909,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2870 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -34903,10 +33922,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2871 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -34916,10 +33935,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2872 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -34929,10 +33948,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2873 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -34942,10 +33961,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2874 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -34955,10 +33974,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2875 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -34968,10 +33987,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2876 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -34981,10 +34000,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2877 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -34994,10 +34013,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2878 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -35007,10 +34026,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2879 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -35020,10 +34039,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2880 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -35033,10 +34052,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2881 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -35046,10 +34065,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2882 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -35059,10 +34078,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2883 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -35072,10 +34091,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2884 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -35085,10 +34104,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2885 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -35098,10 +34117,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2886 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -35111,10 +34130,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2887 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -35124,10 +34143,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2888 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -35137,10 +34156,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2889 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -35150,10 +34169,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2890 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -35163,10 +34182,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2891 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -35176,10 +34195,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2892 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -35189,10 +34208,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2893 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -35202,10 +34221,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2894 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -35215,10 +34234,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2895 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -35228,10 +34247,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2896 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -35241,10 +34260,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2897 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -35254,10 +34273,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2898 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.75 @@ -35267,10 +34286,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2899 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.75 @@ -35280,10 +34299,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2900 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.75 @@ -35293,10 +34312,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2901 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.75 @@ -35306,10 +34325,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2902 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 5.877471754111438e-39 @@ -35319,10 +34338,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2903 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -35332,10 +34351,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2941 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -35345,10 +34364,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2942 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -35358,10 +34377,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2943 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -35371,10 +34390,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2944 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -35384,10 +34403,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2945 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -35397,10 +34416,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2946 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -35410,10 +34429,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2947 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -35423,10 +34442,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2948 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -35436,10 +34455,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2949 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -35449,10 +34468,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2950 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -35462,10 +34481,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2953 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -35475,10 +34494,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2954 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -35488,10 +34507,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2955 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -35501,10 +34520,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2956 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -35514,10 +34533,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2957 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.862645149230957e-09 @@ -35527,10 +34546,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2960 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.862645149230957e-09 @@ -35540,10 +34559,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2961 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.1754943508222875e-38 @@ -35553,10 +34572,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2962 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.1754943508222875e-38 @@ -35566,10 +34585,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2963 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.401298464324817e-45 @@ -35579,10 +34598,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2964 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.401298464324817e-45 @@ -35592,10 +34611,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2965 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.175494490952134e-38 @@ -35605,10 +34624,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2966 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.1754946310819804e-38 @@ -35618,10 +34637,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2967 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.3509880009953429e-38 @@ -35631,10 +34650,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2968 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.350988701644575e-38 @@ -35644,10 +34663,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2969 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.3509895424236536e-38 @@ -35657,10 +34676,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2970 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.70197740328915e-38 @@ -35670,10 +34689,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2971 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.1175870895385742e-08 @@ -35683,10 +34702,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2972 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.4901161193847656e-08 @@ -35696,10 +34715,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2973 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.000244140625 @@ -35709,10 +34728,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2974 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.0003662109375 @@ -35722,10 +34741,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2975 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.175494490952134e-38 @@ -35735,10 +34754,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2976 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.1754946310819804e-38 @@ -35748,10 +34767,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2977 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2.3509880009953429e-38 @@ -35761,10 +34780,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2978 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2.350988701644575e-38 @@ -35774,10 +34793,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2979 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2.3509895424236536e-38 @@ -35787,10 +34806,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2980 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -4.70197740328915e-38 @@ -35800,10 +34819,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2981 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.1175870895385742e-08 @@ -35813,10 +34832,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2982 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.4901161193847656e-08 @@ -35826,10 +34845,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2983 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.000244140625 @@ -35839,10 +34858,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2984 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.0003662109375 @@ -35852,10 +34871,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2985 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.802596928649634e-45 @@ -35865,10 +34884,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2986 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.2611686178923354e-44 @@ -35878,10 +34897,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2987 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.938735877055719e-39 @@ -35891,10 +34910,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2988 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 5.877471754111438e-39 @@ -35904,10 +34923,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2989 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.1754940705625946e-38 @@ -35917,10 +34936,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2990 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.1754942106924411e-38 @@ -35930,10 +34949,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2991 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2.802596928649634e-45 @@ -35943,10 +34962,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2992 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.2611686178923354e-44 @@ -35956,10 +34975,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2993 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2.938735877055719e-39 @@ -35969,10 +34988,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2994 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -5.877471754111438e-39 @@ -35982,10 +35001,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2995 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.1754940705625946e-38 @@ -35995,10 +35014,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2996 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.1754942106924411e-38 @@ -36008,10 +35027,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2997 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 255.99993896484375 @@ -36021,10 +35040,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3000 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 5033165 @@ -36034,10 +35053,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3001 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 421657440 @@ -36047,10 +35066,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3002 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2147483392 @@ -36060,10 +35079,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3003 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 68719476736 @@ -36073,10 +35092,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3004 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 549755813888 @@ -36086,10 +35105,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3005 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 3402823466385288598117041e14 @@ -36099,10 +35118,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3006 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -255.99993896484375 @@ -36112,10 +35131,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3007 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -5033165 @@ -36125,10 +35144,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3008 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -421657440 @@ -36138,10 +35157,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3009 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2147483392 @@ -36151,10 +35170,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3010 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -68719476736 @@ -36164,10 +35183,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3011 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -549755813888 @@ -36177,10 +35196,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3012 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -3402823466385288598117041e14 @@ -36190,10 +35209,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3013 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -36203,10 +35222,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3025 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -36216,10 +35235,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3026 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -36229,10 +35248,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3027 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -36242,10 +35261,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3028 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -36255,10 +35274,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3029 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -36268,10 +35287,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3030 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -36281,10 +35300,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3031 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -36294,10 +35313,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3032 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -36307,10 +35326,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3033 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -36320,10 +35339,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3034 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -36333,10 +35352,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3037 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -36346,10 +35365,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3038 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -36359,10 +35378,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3039 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -36372,10 +35391,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3040 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -36385,10 +35404,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3041 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -36398,10 +35417,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3050 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -36411,10 +35430,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3051 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -36424,10 +35443,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3052 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -36437,10 +35456,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3053 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -36450,10 +35469,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3054 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -36463,10 +35482,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3055 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -36476,10 +35495,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3056 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -36489,10 +35508,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3057 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -36502,10 +35521,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3058 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -36515,10 +35534,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3059 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -36528,10 +35547,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3062 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -36541,10 +35560,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3063 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -36554,10 +35573,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3064 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -36567,10 +35586,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3065 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -36580,10 +35599,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3066 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -36593,10 +35612,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3078 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -36606,10 +35625,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3079 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -36619,10 +35638,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3080 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -36632,10 +35651,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3081 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -36645,10 +35664,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3082 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -36658,10 +35677,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3083 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -36671,10 +35690,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3084 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -36684,10 +35703,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3085 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -36697,10 +35716,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3086 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -36710,10 +35729,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3087 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -36723,10 +35742,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3090 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -36736,10 +35755,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3091 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -36749,10 +35768,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3092 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -36762,10 +35781,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3093 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -36775,10 +35794,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3094 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -36788,10 +35807,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3095 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -36801,10 +35820,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3096 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4 @@ -36814,10 +35833,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3097 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1e-323 @@ -36827,10 +35846,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3098 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.5e-323 @@ -36840,10 +35859,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3099 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 5e-324 @@ -36853,10 +35872,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3100 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -5e-324 @@ -36866,10 +35885,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3101 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.9999999999999999 @@ -36879,10 +35898,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3102 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.9999999999999998 @@ -36892,10 +35911,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3103 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.0000000000000002 @@ -36905,10 +35924,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3104 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.0000000000000004 @@ -36918,10 +35937,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3105 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.0000000000000002 @@ -36931,10 +35950,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3106 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.9999999999999999 @@ -36944,10 +35963,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3107 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1797693134862315708145274e284 @@ -36957,10 +35976,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3108 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1797693134862315708145274e284 @@ -36970,10 +35989,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3109 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 179769313486231490980915e285 @@ -36983,10 +36002,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3110 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1797693134862314111473026e284 @@ -36996,10 +36015,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3111 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1797693134862313313136902e284 @@ -37009,10 +36028,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3112 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1797693134862312514800778e284 @@ -37022,10 +36041,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3113 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1797693134862311716464655e284 @@ -37035,10 +36054,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3114 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1797693134862310918128531e284 @@ -37048,10 +36067,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3115 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1797693134862310119792407e284 @@ -37061,10 +36080,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3116 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1797693134862309321456283e284 @@ -37074,10 +36093,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3117 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1797693134862308523120159e284 @@ -37087,10 +36106,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3118 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1797693134862307724784036e284 @@ -37100,10 +36119,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3119 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.225073858507203e-308 @@ -37113,10 +36132,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3120 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.225073858507205e-308 @@ -37126,10 +36145,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3121 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.225073858507207e-308 @@ -37139,10 +36158,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3122 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.225073858507209e-308 @@ -37152,10 +36171,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3123 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.225073858507211e-308 @@ -37165,10 +36184,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3124 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.2250738585072127e-308 @@ -37178,10 +36197,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3125 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.2250738585072147e-308 @@ -37191,10 +36210,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3126 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.2250738585072167e-308 @@ -37204,10 +36223,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3127 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.2250738585072187e-308 @@ -37217,10 +36236,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3128 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.2250738585072207e-308 @@ -37230,10 +36249,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3129 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.2250738585072226e-308 @@ -37243,10 +36262,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3130 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.2250738585072246e-308 @@ -37256,10 +36275,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3131 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.2250738585072266e-308 @@ -37269,10 +36288,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3132 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.2250738585072286e-308 @@ -37282,10 +36301,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3133 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 92.35130391890645 @@ -37295,10 +36314,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3134 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 93.3599596388916 @@ -37308,10 +36327,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3135 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 95.42049628886124 @@ -37321,10 +36340,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3136 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 95.87916941885449 @@ -37334,10 +36353,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3137 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 96.84804174884022 @@ -37347,10 +36366,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3138 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 97.43639050883155 @@ -37360,10 +36379,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3139 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 97.50957979883047 @@ -37373,10 +36392,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3140 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 97.80496893882612 @@ -37386,10 +36405,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3141 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 98.2751822888192 @@ -37399,10 +36418,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3142 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 99.47293564880155 @@ -37412,10 +36431,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3143 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 100.57047130878539 @@ -37425,10 +36444,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3144 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 100.60954608878481 @@ -37438,10 +36457,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3145 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 100.67909109878379 @@ -37451,10 +36470,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3146 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 101.12268095877725 @@ -37464,10 +36483,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3147 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 101.3027691287746 @@ -37477,10 +36496,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3148 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.45932313565507e-307 @@ -37490,10 +36509,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3149 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 5.610957305180409e-307 @@ -37503,10 +36522,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3150 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 5.8073887977408524e-307 @@ -37516,10 +36535,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3151 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 7.026137080471427e-307 @@ -37529,10 +36548,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3152 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 8.438697769194972e-307 @@ -37542,10 +36561,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3153 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.1607792515836795e-306 @@ -37555,10 +36574,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3154 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.2827413827423193e-306 @@ -37568,10 +36587,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3155 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.7116604596087457e-306 @@ -37581,10 +36600,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3156 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.038173251686994e-306 @@ -37594,10 +36613,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3157 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.171572060856931e-306 @@ -37607,10 +36626,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3158 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.4681399631804094e-306 @@ -37620,10 +36639,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3159 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.5175533964200588e-306 @@ -37633,10 +36652,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3160 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.6461505468829625e-306 @@ -37646,10 +36665,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3161 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 3.8167076367720413e-306 @@ -37659,10 +36678,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3162 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.5743220778562766e-306 @@ -37672,10 +36691,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3163 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -37685,10 +36704,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3172 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -37698,10 +36717,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3173 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -37711,10 +36730,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3174 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -37724,10 +36743,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3175 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -37737,10 +36756,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3176 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -37750,10 +36769,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3177 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -37763,10 +36782,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3178 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -37776,10 +36795,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3179 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -37789,10 +36808,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3180 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -37802,10 +36821,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3181 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -37815,10 +36834,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3184 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -37828,10 +36847,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3185 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -37841,10 +36860,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3186 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -37854,10 +36873,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3187 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -37867,10 +36886,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3188 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -37880,10 +36899,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3189 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -37893,10 +36912,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3190 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4 @@ -37906,10 +36925,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3191 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.802596928649634e-45 @@ -37919,10 +36938,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3192 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.203895392974451e-45 @@ -37932,10 +36951,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3193 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.401298464324817e-45 @@ -37945,10 +36964,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3194 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.401298464324817e-45 @@ -37958,10 +36977,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3195 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 3402823466385288598117041e14 @@ -37971,10 +36990,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3196 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -3402823466385288598117041e14 @@ -37984,10 +37003,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3197 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.9999998807907104 @@ -37997,10 +37016,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3198 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.9999999403953552 @@ -38010,10 +37029,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3199 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.999999761581421 @@ -38023,10 +37042,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3200 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.9999998807907104 @@ -38036,10 +37055,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3201 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.0000001192092896 @@ -38049,10 +37068,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3202 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.000000238418579 @@ -38062,10 +37081,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3203 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.000000238418579 @@ -38075,10 +37094,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3204 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.000000476837158 @@ -38088,10 +37107,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3205 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -38101,10 +37120,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3243 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -38114,10 +37133,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3244 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -38127,10 +37146,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3245 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -38140,10 +37159,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3246 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -38153,10 +37172,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3247 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -38166,10 +37185,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3248 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -38179,10 +37198,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3249 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -38192,10 +37211,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3250 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -38205,10 +37224,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3251 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -38218,10 +37237,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3252 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -38231,10 +37250,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3255 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -38244,10 +37263,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3256 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -38257,10 +37276,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3257 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -38270,10 +37289,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3258 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -38283,10 +37302,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3259 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.862645149230957e-09 @@ -38296,10 +37315,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3262 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.862645149230957e-09 @@ -38309,10 +37328,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3263 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.1754943508222875e-38 @@ -38322,10 +37341,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3264 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.1754943508222875e-38 @@ -38335,10 +37354,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3265 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.401298464324817e-45 @@ -38348,10 +37367,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3266 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.401298464324817e-45 @@ -38361,10 +37380,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3267 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.175494490952134e-38 @@ -38374,10 +37393,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3268 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.1754946310819804e-38 @@ -38387,10 +37406,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3269 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.3509880009953429e-38 @@ -38400,10 +37419,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3270 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.350988701644575e-38 @@ -38413,10 +37432,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3271 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.3509895424236536e-38 @@ -38426,10 +37445,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3272 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.70197740328915e-38 @@ -38439,10 +37458,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3273 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.1175870895385742e-08 @@ -38452,10 +37471,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3274 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.4901161193847656e-08 @@ -38465,10 +37484,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3275 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.000244140625 @@ -38478,10 +37497,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3276 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.175494490952134e-38 @@ -38491,10 +37510,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3277 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.1754946310819804e-38 @@ -38504,10 +37523,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3278 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2.3509880009953429e-38 @@ -38517,10 +37536,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3279 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.350988701644575e-38 @@ -38530,10 +37549,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3280 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2.3509895424236536e-38 @@ -38543,10 +37562,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3281 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -4.70197740328915e-38 @@ -38556,10 +37575,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3282 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.1175870895385742e-08 @@ -38569,10 +37588,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3283 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.4901161193847656e-08 @@ -38582,10 +37601,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3284 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.000244140625 @@ -38595,10 +37614,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3285 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.802596928649634e-45 @@ -38608,10 +37627,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3286 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.2611686178923354e-44 @@ -38621,10 +37640,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3287 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.938735877055719e-39 @@ -38634,10 +37653,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3288 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 5.877471754111438e-39 @@ -38647,10 +37666,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3289 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.1754940705625946e-38 @@ -38660,10 +37679,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3290 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.1754942106924411e-38 @@ -38673,10 +37692,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3291 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2.802596928649634e-45 @@ -38686,10 +37705,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3292 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.2611686178923354e-44 @@ -38699,10 +37718,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3293 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2.938735877055719e-39 @@ -38712,10 +37731,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3294 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -5.877471754111438e-39 @@ -38725,10 +37744,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3295 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.1754940705625946e-38 @@ -38738,10 +37757,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3296 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.1754942106924411e-38 @@ -38751,10 +37770,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3297 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -38764,10 +37783,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3309 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -38777,10 +37796,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3310 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -38790,10 +37809,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3311 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -38803,10 +37822,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3312 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -38816,10 +37835,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3313 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -38829,10 +37848,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3314 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -38842,10 +37861,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3315 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -38855,10 +37874,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3316 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -38868,10 +37887,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3317 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -38881,10 +37900,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3318 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -38894,10 +37913,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3321 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -38907,10 +37926,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3322 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -38920,10 +37939,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3323 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -38933,10 +37952,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3324 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -38946,10 +37965,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3325 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -38959,10 +37978,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3334 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -38972,10 +37991,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3335 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -38985,10 +38004,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3336 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -38998,10 +38017,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3337 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -39011,10 +38030,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3338 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -39024,10 +38043,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3339 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -39037,10 +38056,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3340 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -39050,10 +38069,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3341 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -39063,10 +38082,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3342 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -39076,10 +38095,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3343 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -39089,10 +38108,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3346 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -39102,10 +38121,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3347 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -39115,10 +38134,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3348 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -39128,10 +38147,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3349 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -39141,10 +38160,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3350 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -39153,10 +38172,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3362 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -39165,10 +38184,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3363 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -39177,10 +38196,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3364 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -39189,10 +38208,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3365 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -39201,10 +38220,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3366 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -39213,10 +38232,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3367 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -39225,10 +38244,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3368 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -39237,10 +38256,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3369 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -39249,10 +38268,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3370 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -39261,10 +38280,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3371 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -39273,10 +38292,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3374 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -39285,10 +38304,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3375 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -39297,10 +38316,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3376 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -39309,10 +38328,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3377 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -39321,10 +38340,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3378 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -39333,10 +38352,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3379 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -39345,10 +38364,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3380 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -39357,10 +38376,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3381 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -39369,10 +38388,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3382 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.0000152587890625 @@ -39381,10 +38400,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3383 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.0000152587890625 @@ -39393,10 +38412,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3384 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.9999923706054688 @@ -39405,10 +38424,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3385 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.9999923706054688 @@ -39417,10 +38436,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3386 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 7.888609052210118e-31 @@ -39429,10 +38448,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3387 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -7.888609052210118e-31 @@ -39441,10 +38460,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3388 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -39453,10 +38472,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3397 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -39465,10 +38484,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3398 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -39477,10 +38496,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3399 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -39489,10 +38508,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3400 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -39501,10 +38520,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3401 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -39513,10 +38532,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3402 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -39525,10 +38544,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3403 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -39537,10 +38556,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3404 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -39549,10 +38568,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3405 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -39561,10 +38580,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3406 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -39573,10 +38592,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3409 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -39585,10 +38604,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3410 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -39597,10 +38616,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3411 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -39609,10 +38628,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3412 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -39621,10 +38640,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3413 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -39633,10 +38652,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3414 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -39645,10 +38664,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3415 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -39657,10 +38676,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3416 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -39669,10 +38688,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3417 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.0000152587890625 @@ -39681,10 +38700,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3418 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.0000152587890625 @@ -39693,10 +38712,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3419 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.9999923706054688 @@ -39705,10 +38724,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3420 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.9999923706054688 @@ -39717,10 +38736,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3421 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 7.888609052210118e-31 @@ -39729,10 +38748,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3422 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -7.888609052210118e-31 @@ -39741,10 +38760,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3423 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2 @@ -39754,10 +38773,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3427 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -39767,10 +38786,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3428 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -2 @@ -39780,10 +38799,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3429 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4294967295 @@ -39793,10 +38812,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3430 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4294967294 @@ -39806,10 +38825,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3431 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.e+60 @@ -39819,10 +38838,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3432 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.e+60 @@ -39832,10 +38851,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3433 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.e+60 @@ -39845,10 +38864,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3434 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.e+24 @@ -39858,10 +38877,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3435 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -39871,10 +38890,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3436 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -39884,10 +38903,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3437 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1797693134862315708145274e284 @@ -39897,10 +38916,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3438 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -39909,10 +38928,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3442 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -39921,10 +38940,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3443 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -39933,10 +38952,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3444 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -128 @@ -39945,10 +38964,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3445 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4294967295 @@ -39957,10 +38976,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3446 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4294967295.5 @@ -39969,10 +38988,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3447 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4294967296 @@ -39981,10 +39000,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3448 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4294967297 @@ -39993,10 +39012,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3449 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -40005,10 +39024,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3450 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -40017,10 +39036,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3451 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9007199254740991 @@ -40029,10 +39048,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3452 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -9007199254740991 @@ -40041,10 +39060,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3453 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1797693134862315708145274e284 @@ -40053,10 +39072,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3454 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 5e-324 @@ -40065,10 +39084,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3455 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1797693134862315708145274e284 @@ -40077,10 +39096,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3456 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.220446049250313e-16 @@ -40089,10 +39108,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3457 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 0 @@ -40102,10 +39121,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3461 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 0 @@ -40115,10 +39134,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3462 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 0 @@ -40128,10 +39147,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3463 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 0 @@ -40141,10 +39160,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3464 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 1 @@ -40154,10 +39173,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3466 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 1 @@ -40167,10 +39186,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3467 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 1 @@ -40180,10 +39199,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3468 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 1 @@ -40193,10 +39212,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3469 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 2 @@ -40206,10 +39225,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3471 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 2 @@ -40219,10 +39238,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3472 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 2 @@ -40232,10 +39251,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3473 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 2 @@ -40245,10 +39264,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3474 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -1 @@ -40258,10 +39277,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3476 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -1 @@ -40271,10 +39290,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3477 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -1 @@ -40284,10 +39303,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3478 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -1 @@ -40297,10 +39316,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3479 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -2 @@ -40310,10 +39329,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3481 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -2 @@ -40323,10 +39342,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3482 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -2 @@ -40336,10 +39355,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3483 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -2 @@ -40349,10 +39368,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3484 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 3 @@ -40362,10 +39381,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3486 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 3 @@ -40375,10 +39394,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3487 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 3 @@ -40388,10 +39407,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3488 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 3 @@ -40401,10 +39420,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3489 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 3 @@ -40414,10 +39433,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3490 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 3 @@ -40427,10 +39446,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3491 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 3 @@ -40440,10 +39459,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3492 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 57055 @@ -40457,10 +39476,10 @@ i64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3494 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -40470,10 +39489,10 @@ f32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3498 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -40483,52 +39502,49 @@ f32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3499 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 i32.const 1 call $~lib/math/ipow32f - local.tee $1 - local.get $1 - f32.eq + call $~lib/builtins/isNaN + i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3500 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 i32.const -1 call $~lib/math/ipow32f - local.tee $1 - local.get $1 - f32.eq + call $~lib/builtins/isNaN + i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3501 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 i32.const 2 call $~lib/math/ipow32f - local.tee $1 - local.get $1 - f32.eq + call $~lib/builtins/isNaN + i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3502 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -40538,10 +39554,10 @@ f32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3503 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -40551,10 +39567,10 @@ f32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3504 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -40564,10 +39580,10 @@ f32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3505 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -40577,10 +39593,10 @@ f32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3506 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -40590,10 +39606,10 @@ f32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3507 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -40603,10 +39619,10 @@ f32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3508 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 3402823466385288598117041e14 @@ -40616,10 +39632,10 @@ f32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3509 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.401298464324817e-45 @@ -40629,10 +39645,10 @@ f32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3510 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 3402823466385288598117041e14 @@ -40642,10 +39658,10 @@ f32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3511 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 10 @@ -40655,10 +39671,10 @@ f32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3512 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 10 @@ -40668,10 +39684,10 @@ f32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3513 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -40681,10 +39697,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3517 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -40694,52 +39710,49 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3518 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 i32.const 1 call $~lib/math/ipow64f - local.tee $0 - local.get $0 - f64.eq + call $~lib/builtins/isNaN + i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3519 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 i32.const -1 call $~lib/math/ipow64f - local.tee $0 - local.get $0 - f64.eq + call $~lib/builtins/isNaN + i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3520 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 i32.const 2 call $~lib/math/ipow64f - local.tee $0 - local.get $0 - f64.eq + call $~lib/builtins/isNaN + i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3521 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -40749,10 +39762,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3522 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -40762,10 +39775,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3523 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -40775,10 +39788,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3524 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -40788,10 +39801,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3525 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -40801,10 +39814,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3526 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -40814,10 +39827,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3527 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1797693134862315708145274e284 @@ -40827,10 +39840,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3528 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 5e-324 @@ -40840,10 +39853,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3529 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1797693134862315708145274e284 @@ -40853,10 +39866,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3530 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 10 @@ -40866,10 +39879,10 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3531 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 10 @@ -40879,17 +39892,17 @@ f64.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3532 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) - (func $start (; 157 ;) (type $FUNCSIG$v) + (func $start (; 163 ;) (type $FUNCSIG$v) call $start:std/math ) - (func $null (; 158 ;) (type $FUNCSIG$v) + (func $null (; 164 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/math.untouched.wat b/tests/compiler/std/math.untouched.wat index e56de62614..b866048e4a 100644 --- a/tests/compiler/std/math.untouched.wat +++ b/tests/compiler/std/math.untouched.wat @@ -31,7 +31,7 @@ (import "Math" "PI" (global $~lib/bindings/Math/PI f64)) (import "Math" "SQRT1_2" (global $~lib/bindings/Math/SQRT1_2 f64)) (import "Math" "SQRT2" (global $~lib/bindings/Math/SQRT2 f64)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (import "Math" "abs" (func $~lib/bindings/Math/abs (param f64) (result f64))) (import "Math" "acos" (func $~lib/bindings/Math/acos (param f64) (result f64))) (import "Math" "acosh" (func $~lib/bindings/Math/acosh (param f64) (result f64))) @@ -62,10 +62,11 @@ (import "Math" "tanh" (func $~lib/bindings/Math/tanh (param f64) (result f64))) (import "Math" "trunc" (func $~lib/bindings/Math/trunc (param f64) (result f64))) (memory $0 1) - (data (i32.const 8) "\0b\00\00\00s\00t\00d\00/\00m\00a\00t\00h\00.\00t\00s\00") - (data (i32.const 40) " \00\00\00\00\00\00\00)\15DNn\83\f9\a2\c0\dd4\f5\d1W\'\fcA\90C<\99\95b\dba\c5\bb\de\abcQ\fe\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 104) "(\00\00\00\04\00\00\00") - (data (i32.const 112) "\0c\00\00\00~\00l\00i\00b\00/\00m\00a\00t\00h\00.\00t\00s\00") + (data (i32.const 8) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00s\00t\00d\00/\00m\00a\00t\00h\00.\00t\00s\00") + (data (i32.const 48) " \00\00\00\01\00\00\00\00\00\00\00 \00\00\00)\15DNn\83\f9\a2\c0\dd4\f5\d1W\'\fcA\90C<\99\95b\dba\c5\bb\de\abcQ\fe") + (data (i32.const 96) "\10\00\00\00\01\00\00\00\03\00\00\00\10\00\00\00@\00\00\00@\00\00\00 \00\00\00\04\00\00\00") + (data (i32.const 128) "\18\00\00\00\01\00\00\00\01\00\00\00\18\00\00\00~\00l\00i\00b\00/\00m\00a\00t\00h\00.\00t\00s\00") + (data (i32.const 168) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00P\00R\00N\00G\00 \00m\00u\00s\00t\00 \00b\00e\00 \00s\00e\00e\00d\00e\00d\00.\00") (table $0 1 funcref) (elem (i32.const 0) $null) (global $std/math/js i32 (i32.const 1)) @@ -90,7 +91,7 @@ (global $~lib/math/NativeMathf.SQRT2 f32 (f32.const 1.4142135381698608)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) (global $~lib/math/rempio2f_y (mut f64) (f64.const 0)) - (global $~lib/math/PIO2_TABLE i32 (i32.const 104)) + (global $~lib/math/PIO2_TABLE i32 (i32.const 112)) (global $~lib/builtins/f32.MAX_VALUE f32 (f32.const 3402823466385288598117041e14)) (global $~lib/builtins/f64.MIN_VALUE f64 (f64.const 5e-324)) (global $~lib/math/random_seeded (mut i32) (i32.const 0)) @@ -102,9 +103,7 @@ (global $~lib/builtins/f64.MAX_SAFE_INTEGER f64 (f64.const 9007199254740991)) (global $~lib/builtins/f64.EPSILON f64 (f64.const 2.220446049250313e-16)) (global $~lib/builtins/f32.MIN_VALUE f32 (f32.const 1.401298464324817e-45)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 140)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $~lib/builtins/isNaN (; 30 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) local.get $0 @@ -237,16 +236,14 @@ f64.mul ) (func $std/math/ulperr (; 34 ;) (type $FUNCSIG$dddd) (param $0 f64) (param $1 f64) (param $2 f64) (result f64) - (local $3 i32) - (local $4 f64) + (local $3 f64) local.get $0 call $~lib/builtins/isNaN - local.tee $3 if (result i32) local.get $1 call $~lib/builtins/isNaN else - local.get $3 + i32.const 0 end if f64.const 0 @@ -256,31 +253,31 @@ local.get $1 f64.eq if - block $~lib/math/NativeMath.signbit|inlined.2 (result i32) + block $~lib/math/NativeMath.signbit|inlined.0 (result i32) local.get $0 - local.set $4 - local.get $4 + local.set $3 + local.get $3 i64.reinterpret_f64 i64.const 63 i64.shr_u i32.wrap_i64 - local.get $4 - local.get $4 + local.get $3 + local.get $3 f64.eq i32.and end i32.const 0 i32.ne - block $~lib/math/NativeMath.signbit|inlined.3 (result i32) + block $~lib/math/NativeMath.signbit|inlined.1 (result i32) local.get $1 - local.set $4 - local.get $4 + local.set $3 + local.get $3 i64.reinterpret_f64 i64.const 63 i64.shr_u i32.wrap_i64 - local.get $4 - local.get $4 + local.get $3 + local.get $3 f64.eq i32.and end @@ -478,16 +475,14 @@ f32.mul ) (func $std/math/ulperrf (; 40 ;) (type $FUNCSIG$ffff) (param $0 f32) (param $1 f32) (param $2 f32) (result f32) - (local $3 i32) - (local $4 f32) + (local $3 f32) local.get $0 call $~lib/builtins/isNaN - local.tee $3 if (result i32) local.get $1 call $~lib/builtins/isNaN else - local.get $3 + i32.const 0 end if f32.const 0 @@ -497,29 +492,29 @@ local.get $1 f32.eq if - block $~lib/math/NativeMathf.signbit|inlined.2 (result i32) + block $~lib/math/NativeMathf.signbit|inlined.0 (result i32) local.get $0 - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.reinterpret_f32 i32.const 31 i32.shr_u - local.get $4 - local.get $4 + local.get $3 + local.get $3 f32.eq i32.and end i32.const 0 i32.ne - block $~lib/math/NativeMathf.signbit|inlined.3 (result i32) + block $~lib/math/NativeMathf.signbit|inlined.1 (result i32) local.get $1 - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.reinterpret_f32 i32.const 31 i32.shr_u - local.get $4 - local.get $4 + local.get $3 + local.get $3 f32.eq i32.and end @@ -608,7 +603,6 @@ ) (func $std/math/test_abs (; 44 ;) (type $FUNCSIG$idddi) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 f64) - (local $5 i32) block $~lib/math/NativeMath.abs|inlined.0 (result f64) local.get $0 local.set $4 @@ -619,13 +613,11 @@ local.get $2 local.get $3 call $std/math/check - local.tee $5 if (result i32) global.get $std/math/js i32.eqz - local.tee $5 if (result i32) - local.get $5 + i32.const 1 else local.get $0 call $~lib/bindings/Math/abs @@ -635,7 +627,7 @@ call $std/math/check end else - local.get $5 + i32.const 0 end ) (func $std/math/test_absf (; 45 ;) (type $FUNCSIG$ifffi) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) @@ -853,20 +845,17 @@ f64.mul ) (func $std/math/test_acos (; 48 ;) (type $FUNCSIG$idddi) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) - (local $4 i32) local.get $0 call $~lib/math/NativeMath.acos local.get $1 local.get $2 local.get $3 call $std/math/check - local.tee $4 if (result i32) global.get $std/math/js i32.eqz - local.tee $4 if (result i32) - local.get $4 + i32.const 1 else local.get $0 call $~lib/bindings/Math/acos @@ -876,7 +865,7 @@ call $std/math/check end else - local.get $4 + i32.const 0 end ) (func $~lib/math/Rf (; 49 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) @@ -1085,9 +1074,8 @@ local.get $2 i32.const 1071284858 i32.lt_u - local.tee $6 if (result i32) - local.get $6 + i32.const 1 else local.get $2 i32.const 31 @@ -1117,9 +1105,7 @@ local.get $2 i32.const 1 i32.shl - i32.const 1017118720 - i32.const 1 - i32.shl + i32.const 2034237440 i32.lt_u if local.get $0 @@ -1301,7 +1287,7 @@ (local $1 i64) (local $2 i32) (local $3 i32) - (local $4 i32) + (local $4 f64) (local $5 f64) (local $6 f64) (local $7 f64) @@ -1309,8 +1295,7 @@ (local $9 f64) (local $10 f64) (local $11 f64) - (local $12 f64) - (local $13 i32) + (local $12 i32) local.get $0 i64.reinterpret_f64 local.set $1 @@ -1324,9 +1309,8 @@ local.get $2 i32.const 1048576 i32.lt_u - local.tee $4 if (result i32) - local.get $4 + i32.const 1 else local.get $2 i32.const 31 @@ -1384,7 +1368,6 @@ local.get $2 i32.const 1072693248 i32.eq - local.tee $4 if (result i32) local.get $1 i64.const 32 @@ -1392,7 +1375,7 @@ i64.const 0 i64.eq else - local.get $4 + i32.const 0 end if f64.const 0 @@ -1435,46 +1418,46 @@ local.get $0 f64.const 1 f64.sub - local.set $5 + local.set $4 f64.const 0.5 - local.get $5 + local.get $4 f64.mul - local.get $5 + local.get $4 f64.mul - local.set $6 - local.get $5 + local.set $5 + local.get $4 f64.const 2 - local.get $5 + local.get $4 f64.add f64.div + local.set $6 + local.get $6 + local.get $6 + f64.mul local.set $7 local.get $7 local.get $7 f64.mul local.set $8 local.get $8 - local.get $8 - f64.mul - local.set $9 - local.get $9 f64.const 0.3999999999940942 - local.get $9 + local.get $8 f64.const 0.22222198432149784 - local.get $9 + local.get $8 f64.const 0.15313837699209373 f64.mul f64.add f64.mul f64.add f64.mul - local.set $10 - local.get $8 + local.set $9 + local.get $7 f64.const 0.6666666666666735 - local.get $9 + local.get $8 f64.const 0.2857142874366239 - local.get $9 + local.get $8 f64.const 0.1818357216161805 - local.get $9 + local.get $8 f64.const 0.14798198605116586 f64.mul f64.add @@ -1483,28 +1466,28 @@ f64.mul f64.add f64.mul - local.set $11 - local.get $11 + local.set $10 local.get $10 + local.get $9 f64.add - local.set $12 + local.set $11 local.get $3 - local.set $13 - local.get $7 + local.set $12 local.get $6 - local.get $12 + local.get $5 + local.get $11 f64.add f64.mul - local.get $13 + local.get $12 f64.convert_i32_s f64.const 1.9082149292705877e-10 f64.mul f64.add - local.get $6 - f64.sub local.get $5 + f64.sub + local.get $4 f64.add - local.get $13 + local.get $12 f64.convert_i32_s f64.const 0.6931471803691238 f64.mul @@ -1520,9 +1503,7 @@ i64.and local.set $1 local.get $1 - i64.const 1023 - i64.const 1 - i64.add + i64.const 1024 i64.lt_u if local.get $0 @@ -1547,9 +1528,7 @@ return end local.get $1 - i64.const 1023 - i64.const 26 - i64.add + i64.const 1049 i64.lt_u if f64.const 2 @@ -1575,20 +1554,17 @@ f64.add ) (func $std/math/test_acosh (; 55 ;) (type $FUNCSIG$idddi) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) - (local $4 i32) local.get $0 call $~lib/math/NativeMath.acosh local.get $1 local.get $2 local.get $3 call $std/math/check - local.tee $4 if (result i32) global.get $std/math/js i32.eqz - local.tee $4 if (result i32) - local.get $4 + i32.const 1 else local.get $0 call $~lib/bindings/Math/acosh @@ -1598,7 +1574,7 @@ call $std/math/check end else - local.get $4 + i32.const 0 end ) (func $~lib/math/NativeMathf.log1p (; 56 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) @@ -1606,8 +1582,8 @@ (local $2 f32) (local $3 f32) (local $4 i32) - (local $5 i32) - (local $6 f32) + (local $5 f32) + (local $6 i32) (local $7 f32) (local $8 f32) (local $9 f32) @@ -1628,9 +1604,8 @@ local.get $1 i32.const 1054086096 i32.lt_u - local.tee $5 if (result i32) - local.get $5 + i32.const 1 else local.get $1 i32.const 31 @@ -1660,9 +1635,7 @@ local.get $1 i32.const 1 i32.shl - i32.const 864026624 - i32.const 1 - i32.shl + i32.const 1728053248 i32.lt_u if local.get $0 @@ -1693,17 +1666,17 @@ f32.const 1 local.get $0 f32.add - local.set $6 - local.get $6 - i32.reinterpret_f32 local.set $5 local.get $5 + i32.reinterpret_f32 + local.set $6 + local.get $6 i32.const 1065353216 i32.const 1060439283 i32.sub i32.add - local.set $5 - local.get $5 + local.set $6 + local.get $6 i32.const 23 i32.shr_u i32.const 127 @@ -1718,33 +1691,33 @@ i32.ge_s if (result f32) f32.const 1 - local.get $6 + local.get $5 local.get $0 f32.sub f32.sub else local.get $0 - local.get $6 + local.get $5 f32.const 1 f32.sub f32.sub end local.set $2 local.get $2 - local.get $6 + local.get $5 f32.div local.set $2 else f32.const 0 local.set $2 end - local.get $5 + local.get $6 i32.const 8388607 i32.and i32.const 1060439283 i32.add - local.set $5 - local.get $5 + local.set $6 + local.get $6 f32.reinterpret_i32 f32.const 1 f32.sub @@ -1816,7 +1789,7 @@ (func $~lib/math/NativeMathf.log (; 57 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 i32) (local $2 i32) - (local $3 i32) + (local $3 f32) (local $4 f32) (local $5 f32) (local $6 f32) @@ -1825,7 +1798,6 @@ (local $9 f32) (local $10 f32) (local $11 f32) - (local $12 f32) local.get $0 i32.reinterpret_f32 local.set $1 @@ -1834,9 +1806,8 @@ local.get $1 i32.const 8388608 i32.lt_u - local.tee $3 if (result i32) - local.get $3 + i32.const 1 else local.get $1 i32.const 31 @@ -1921,64 +1892,64 @@ local.get $0 f32.const 1 f32.sub - local.set $4 - local.get $4 + local.set $3 + local.get $3 f32.const 2 - local.get $4 + local.get $3 f32.add f32.div + local.set $4 + local.get $4 + local.get $4 + f32.mul local.set $5 local.get $5 local.get $5 f32.mul local.set $6 local.get $6 - local.get $6 - f32.mul - local.set $7 - local.get $7 f32.const 0.40000972151756287 - local.get $7 + local.get $6 f32.const 0.24279078841209412 f32.mul f32.add f32.mul - local.set $8 - local.get $6 + local.set $7 + local.get $5 f32.const 0.6666666269302368 - local.get $7 + local.get $6 f32.const 0.2849878668785095 f32.mul f32.add f32.mul - local.set $9 - local.get $9 + local.set $8 local.get $8 + local.get $7 f32.add - local.set $10 + local.set $9 f32.const 0.5 - local.get $4 + local.get $3 f32.mul - local.get $4 + local.get $3 f32.mul - local.set $11 + local.set $10 local.get $2 f32.convert_i32_s - local.set $12 - local.get $5 - local.get $11 + local.set $11 + local.get $4 local.get $10 + local.get $9 f32.add f32.mul - local.get $12 + local.get $11 f32.const 9.05800061445916e-06 f32.mul f32.add - local.get $11 + local.get $10 f32.sub - local.get $4 + local.get $3 f32.add - local.get $12 + local.get $11 f32.const 0.6931381225585938 f32.mul f32.add @@ -1995,11 +1966,7 @@ i32.and local.set $2 local.get $2 - i32.const 1065353216 - i32.const 1 - i32.const 23 - i32.shl - i32.add + i32.const 1073741824 i32.lt_u if local.get $0 @@ -2018,11 +1985,7 @@ return end local.get $2 - i32.const 1065353216 - i32.const 12 - i32.const 23 - i32.shl - i32.add + i32.const 1166016512 i32.lt_u if f32.const 2 @@ -2112,13 +2075,12 @@ local.get $2 i32.const 1045430272 i32.lt_u - local.tee $3 if (result i32) local.get $2 i32.const 1048576 i32.ge_u else - local.get $3 + i32.const 0 end if local.get $0 @@ -2216,20 +2178,17 @@ local.get $0 ) (func $std/math/test_asin (; 61 ;) (type $FUNCSIG$idddi) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) - (local $4 i32) local.get $0 call $~lib/math/NativeMath.asin local.get $1 local.get $2 local.get $3 call $std/math/check - local.tee $4 if (result i32) global.get $std/math/js i32.eqz - local.tee $4 if (result i32) - local.get $4 + i32.const 1 else local.get $0 call $~lib/bindings/Math/asin @@ -2239,15 +2198,14 @@ call $std/math/check end else - local.get $4 + i32.const 0 end ) (func $~lib/math/NativeMathf.asin (; 62 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 f32) (local $2 i32) - (local $3 i32) - (local $4 f32) - (local $5 f64) + (local $3 f32) + (local $4 f64) local.get $0 local.set $1 local.get $0 @@ -2284,13 +2242,12 @@ local.get $2 i32.const 964689920 i32.lt_u - local.tee $3 if (result i32) local.get $2 i32.const 8388608 i32.ge_u else - local.get $3 + i32.const 0 end if local.get $0 @@ -2312,18 +2269,18 @@ f32.const 0.5 f32.mul f32.sub - local.set $4 - local.get $4 + local.set $3 + local.get $3 f64.promote_f32 f64.sqrt - local.set $5 + local.set $4 f32.const 1.5707963705062866 f64.promote_f32 f32.const 2 f64.promote_f32 - local.get $5 - local.get $5 local.get $4 + local.get $4 + local.get $3 call $~lib/math/Rf f64.promote_f32 f64.mul @@ -2363,9 +2320,7 @@ f64.reinterpret_i64 local.set $3 local.get $2 - i64.const 1023 - i64.const 26 - i64.add + i64.const 1049 i64.ge_u if local.get $3 @@ -2375,9 +2330,7 @@ local.set $3 else local.get $2 - i64.const 1023 - i64.const 1 - i64.add + i64.const 1024 i64.ge_u if f64.const 2 @@ -2398,9 +2351,7 @@ local.set $3 else local.get $2 - i64.const 1023 - i64.const 26 - i64.sub + i64.const 997 i64.ge_u if local.get $3 @@ -2427,20 +2378,17 @@ f64.copysign ) (func $std/math/test_asinh (; 65 ;) (type $FUNCSIG$idddi) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) - (local $4 i32) local.get $0 call $~lib/math/NativeMath.asinh local.get $1 local.get $2 local.get $3 call $std/math/check - local.tee $4 if (result i32) global.get $std/math/js i32.eqz - local.tee $4 if (result i32) - local.get $4 + i32.const 1 else local.get $0 call $~lib/bindings/Math/asinh @@ -2450,7 +2398,7 @@ call $std/math/check end else - local.get $4 + i32.const 0 end ) (func $~lib/math/NativeMathf.asinh (; 66 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) @@ -2465,11 +2413,7 @@ f32.reinterpret_i32 local.set $2 local.get $1 - i32.const 1065353216 - i32.const 12 - i32.const 23 - i32.shl - i32.add + i32.const 1166016512 i32.ge_u if local.get $2 @@ -2479,11 +2423,7 @@ local.set $2 else local.get $1 - i32.const 1065353216 - i32.const 1 - i32.const 23 - i32.shl - i32.add + i32.const 1073741824 i32.ge_u if f32.const 2 @@ -2504,11 +2444,7 @@ local.set $2 else local.get $1 - i32.const 1065353216 - i32.const 12 - i32.const 23 - i32.shl - i32.sub + i32.const 964689920 i32.ge_u if local.get $2 @@ -2816,20 +2752,17 @@ f64.copysign ) (func $std/math/test_atan (; 69 ;) (type $FUNCSIG$idddi) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) - (local $4 i32) local.get $0 call $~lib/math/NativeMath.atan local.get $1 local.get $2 local.get $3 call $std/math/check - local.tee $4 if (result i32) global.get $std/math/js i32.eqz - local.tee $4 if (result i32) - local.get $4 + i32.const 1 else local.get $0 call $~lib/bindings/Math/atan @@ -2839,7 +2772,7 @@ call $std/math/check end else - local.get $4 + i32.const 0 end ) (func $~lib/math/NativeMathf.atan (; 70 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) @@ -3121,15 +3054,11 @@ f64.reinterpret_i64 local.set $4 local.get $2 - i64.const 1023 - i64.const 1 - i64.sub + i64.const 1022 i64.lt_u if local.get $2 - i64.const 1023 - i64.const 32 - i64.sub + i64.const 991 i64.ge_u if f64.const 0.5 @@ -3168,20 +3097,17 @@ f64.copysign ) (func $std/math/test_atanh (; 73 ;) (type $FUNCSIG$idddi) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) - (local $4 i32) local.get $0 call $~lib/math/NativeMath.atanh local.get $1 local.get $2 local.get $3 call $std/math/check - local.tee $4 if (result i32) global.get $std/math/js i32.eqz - local.tee $4 if (result i32) - local.get $4 + i32.const 1 else local.get $0 call $~lib/bindings/Math/atanh @@ -3191,7 +3117,7 @@ call $std/math/check end else - local.get $4 + i32.const 0 end ) (func $~lib/math/NativeMathf.atanh (; 74 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) @@ -3208,19 +3134,11 @@ f32.reinterpret_i32 local.set $2 local.get $1 - i32.const 1065353216 - i32.const 1 - i32.const 23 - i32.shl - i32.sub + i32.const 1056964608 i32.lt_u if local.get $1 - i32.const 1065353216 - i32.const 32 - i32.const 23 - i32.shl - i32.sub + i32.const 796917760 i32.ge_u if f32.const 0.5 @@ -3265,8 +3183,8 @@ call $std/math/check ) (func $~lib/math/NativeMath.atan2 (; 76 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) - (local $2 i32) - (local $3 i64) + (local $2 i64) + (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) @@ -3275,9 +3193,8 @@ (local $9 f64) local.get $1 call $~lib/builtins/isNaN - local.tee $2 if (result i32) - local.get $2 + i32.const 1 else local.get $0 call $~lib/builtins/isNaN @@ -3290,30 +3207,30 @@ end local.get $1 i64.reinterpret_f64 - local.set $3 - local.get $3 + local.set $2 + local.get $2 i64.const 32 i64.shr_u i32.wrap_i64 - local.set $4 - local.get $3 + local.set $3 + local.get $2 i32.wrap_i64 - local.set $5 + local.set $4 local.get $0 i64.reinterpret_f64 - local.set $3 - local.get $3 + local.set $2 + local.get $2 i64.const 32 i64.shr_u i32.wrap_i64 + local.set $5 + local.get $2 + i32.wrap_i64 local.set $6 local.get $3 - i32.wrap_i64 - local.set $7 - local.get $4 i32.const 1072693248 i32.sub - local.get $5 + local.get $4 i32.or i32.const 0 i32.eq @@ -3322,28 +3239,28 @@ call $~lib/math/NativeMath.atan return end - local.get $6 + local.get $5 i32.const 31 i32.shr_u i32.const 1 i32.and - local.get $4 + local.get $3 i32.const 30 i32.shr_u i32.const 2 i32.and i32.or - local.set $8 - local.get $4 + local.set $7 + local.get $3 i32.const 2147483647 i32.and - local.set $4 - local.get $6 + local.set $3 + local.get $5 i32.const 2147483647 i32.and - local.set $6 + local.set $5 + local.get $5 local.get $6 - local.get $7 i32.or i32.const 0 i32.eq @@ -3353,21 +3270,21 @@ block $case2|0 block $case1|0 block $case0|0 + local.get $7 + local.set $8 local.get $8 - local.set $2 - local.get $2 i32.const 0 i32.eq br_if $case0|0 - local.get $2 + local.get $8 i32.const 1 i32.eq br_if $case1|0 - local.get $2 + local.get $8 i32.const 2 i32.eq br_if $case2|0 - local.get $2 + local.get $8 i32.const 3 i32.eq br_if $case3|0 @@ -3385,13 +3302,13 @@ return end end + local.get $3 local.get $4 - local.get $5 i32.or i32.const 0 i32.eq if - local.get $8 + local.get $7 i32.const 1 i32.and if (result f64) @@ -3406,11 +3323,11 @@ end return end - local.get $4 + local.get $3 i32.const 2146435072 i32.eq if - local.get $6 + local.get $5 i32.const 2146435072 i32.eq if @@ -3419,21 +3336,21 @@ block $case2|1 block $case1|1 block $case0|1 + local.get $7 + local.set $8 local.get $8 - local.set $2 - local.get $2 i32.const 0 i32.eq br_if $case0|1 - local.get $2 + local.get $8 i32.const 1 i32.eq br_if $case1|1 - local.get $2 + local.get $8 i32.const 2 i32.eq br_if $case2|1 - local.get $2 + local.get $8 i32.const 3 i32.eq br_if $case3|1 @@ -3470,21 +3387,21 @@ block $case2|2 block $case1|2 block $case0|2 + local.get $7 + local.set $8 local.get $8 - local.set $2 - local.get $2 i32.const 0 i32.eq br_if $case0|2 - local.get $2 + local.get $8 i32.const 1 i32.eq br_if $case1|2 - local.get $2 + local.get $8 i32.const 2 i32.eq br_if $case2|2 - local.get $2 + local.get $8 i32.const 3 i32.eq br_if $case3|2 @@ -3505,23 +3422,20 @@ end end end - local.get $4 - i32.const 64 - i32.const 20 - i32.shl + local.get $3 + i32.const 67108864 i32.add - local.get $6 + local.get $5 i32.lt_u - local.tee $2 if (result i32) - local.get $2 + i32.const 1 else - local.get $6 + local.get $5 i32.const 2146435072 i32.eq end if - local.get $8 + local.get $7 i32.const 1 i32.and if (result f64) @@ -3536,20 +3450,17 @@ end return end - local.get $8 + local.get $7 i32.const 2 i32.and - local.tee $2 if (result i32) - local.get $6 - i32.const 64 - i32.const 20 - i32.shl + local.get $5 + i32.const 67108864 i32.add - local.get $4 + local.get $3 i32.lt_u else - local.get $2 + i32.const 0 end if f64.const 0 @@ -3567,21 +3478,21 @@ block $case2|3 block $case1|3 block $case0|3 + local.get $7 + local.set $8 local.get $8 - local.set $2 - local.get $2 i32.const 0 i32.eq br_if $case0|3 - local.get $2 + local.get $8 i32.const 1 i32.eq br_if $case1|3 - local.get $2 + local.get $8 i32.const 2 i32.eq br_if $case2|3 - local.get $2 + local.get $8 i32.const 3 i32.eq br_if $case3|3 @@ -3612,7 +3523,6 @@ f64.const 0 ) (func $std/math/test_atan2 (; 77 ;) (type $FUNCSIG$iddddi) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 i32) (result i32) - (local $5 i32) local.get $0 local.get $1 call $~lib/math/NativeMath.atan2 @@ -3620,13 +3530,11 @@ local.get $3 local.get $4 call $std/math/check - local.tee $5 if (result i32) global.get $std/math/js i32.eqz - local.tee $5 if (result i32) - local.get $5 + i32.const 1 else local.get $0 local.get $1 @@ -3637,7 +3545,7 @@ call $std/math/check end else - local.get $5 + i32.const 0 end ) (func $~lib/math/NativeMathf.atan2 (; 78 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) @@ -3648,9 +3556,8 @@ (local $6 f32) local.get $1 call $~lib/builtins/isNaN - local.tee $2 if (result i32) - local.get $2 + i32.const 1 else local.get $0 call $~lib/builtins/isNaN @@ -3663,11 +3570,11 @@ end local.get $1 i32.reinterpret_f32 - local.set $3 + local.set $2 local.get $0 i32.reinterpret_f32 - local.set $4 - local.get $3 + local.set $3 + local.get $2 i32.const 1065353216 i32.eq if @@ -3675,27 +3582,27 @@ call $~lib/math/NativeMathf.atan return end - local.get $4 + local.get $3 i32.const 31 i32.shr_u i32.const 1 i32.and - local.get $3 + local.get $2 i32.const 30 i32.shr_u i32.const 2 i32.and i32.or - local.set $5 - local.get $3 + local.set $4 + local.get $2 i32.const 2147483647 i32.and - local.set $3 - local.get $4 + local.set $2 + local.get $3 i32.const 2147483647 i32.and - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.const 0 i32.eq if @@ -3704,21 +3611,21 @@ block $case2|0 block $case1|0 block $case0|0 + local.get $4 + local.set $5 local.get $5 - local.set $2 - local.get $2 i32.const 0 i32.eq br_if $case0|0 - local.get $2 + local.get $5 i32.const 1 i32.eq br_if $case1|0 - local.get $2 + local.get $5 i32.const 2 i32.eq br_if $case2|0 - local.get $2 + local.get $5 i32.const 3 i32.eq br_if $case3|0 @@ -3736,11 +3643,11 @@ return end end - local.get $3 + local.get $2 i32.const 0 i32.eq if - local.get $5 + local.get $4 i32.const 1 i32.and if (result f32) @@ -3755,11 +3662,11 @@ end return end - local.get $3 + local.get $2 i32.const 2139095040 i32.eq if - local.get $4 + local.get $3 i32.const 2139095040 i32.eq if @@ -3768,21 +3675,21 @@ block $case2|1 block $case1|1 block $case0|1 + local.get $4 + local.set $5 local.get $5 - local.set $2 - local.get $2 i32.const 0 i32.eq br_if $case0|1 - local.get $2 + local.get $5 i32.const 1 i32.eq br_if $case1|1 - local.get $2 + local.get $5 i32.const 2 i32.eq br_if $case2|1 - local.get $2 + local.get $5 i32.const 3 i32.eq br_if $case3|1 @@ -3819,21 +3726,21 @@ block $case2|2 block $case1|2 block $case0|2 + local.get $4 + local.set $5 local.get $5 - local.set $2 - local.get $2 i32.const 0 i32.eq br_if $case0|2 - local.get $2 + local.get $5 i32.const 1 i32.eq br_if $case1|2 - local.get $2 + local.get $5 i32.const 2 i32.eq br_if $case2|2 - local.get $2 + local.get $5 i32.const 3 i32.eq br_if $case3|2 @@ -3854,23 +3761,20 @@ end end end - local.get $3 - i32.const 26 - i32.const 23 - i32.shl + local.get $2 + i32.const 218103808 i32.add - local.get $4 + local.get $3 i32.lt_u - local.tee $2 if (result i32) - local.get $2 + i32.const 1 else - local.get $4 + local.get $3 i32.const 2139095040 i32.eq end if - local.get $5 + local.get $4 i32.const 1 i32.and if (result f32) @@ -3885,20 +3789,17 @@ end return end - local.get $5 + local.get $4 i32.const 2 i32.and - local.tee $2 if (result i32) - local.get $4 - i32.const 26 - i32.const 23 - i32.shl - i32.add local.get $3 + i32.const 218103808 + i32.add + local.get $2 i32.lt_u else - local.get $2 + i32.const 0 end if f32.const 0 @@ -3916,21 +3817,21 @@ block $case2|3 block $case1|3 block $case0|3 + local.get $4 + local.set $5 local.get $5 - local.set $2 - local.get $2 i32.const 0 i32.eq br_if $case0|3 - local.get $2 + local.get $5 i32.const 1 i32.eq br_if $case1|3 - local.get $2 + local.get $5 i32.const 2 i32.eq br_if $case2|3 - local.get $2 + local.get $5 i32.const 3 i32.eq br_if $case3|3 @@ -4114,20 +4015,17 @@ local.get $3 ) (func $std/math/test_cbrt (; 81 ;) (type $FUNCSIG$idddi) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) - (local $4 i32) local.get $0 call $~lib/math/NativeMath.cbrt local.get $1 local.get $2 local.get $3 call $std/math/check - local.tee $4 if (result i32) global.get $std/math/js i32.eqz - local.tee $4 if (result i32) - local.get $4 + i32.const 1 else local.get $0 call $~lib/bindings/Math/cbrt @@ -4137,7 +4035,7 @@ call $std/math/check end else - local.get $4 + i32.const 0 end ) (func $~lib/math/NativeMathf.cbrt (; 82 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) @@ -4266,7 +4164,6 @@ ) (func $std/math/test_ceil (; 84 ;) (type $FUNCSIG$idddi) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 f64) - (local $5 i32) block $~lib/math/NativeMath.ceil|inlined.0 (result f64) local.get $0 local.set $4 @@ -4277,13 +4174,11 @@ local.get $2 local.get $3 call $std/math/check - local.tee $5 if (result i32) global.get $std/math/js i32.eqz - local.tee $5 if (result i32) - local.get $5 + i32.const 1 else local.get $0 call $~lib/bindings/Math/ceil @@ -4293,7 +4188,7 @@ call $std/math/check end else - local.get $5 + i32.const 0 end ) (func $std/math/test_ceilf (; 85 ;) (type $FUNCSIG$ifffi) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) @@ -4310,24 +4205,13 @@ call $std/math/check ) (func $~lib/array/Array#__unchecked_get (; 86 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) - (local $2 i32) - (local $3 i32) - (local $4 i32) local.get $0 - i32.load - local.set $2 + i32.load offset=4 local.get $1 - local.set $3 - i32.const 0 - local.set $4 - local.get $2 - local.get $3 i32.const 3 i32.shl i32.add - local.get $4 - i32.add - i64.load offset=8 + i64.load ) (func $~lib/math/NativeMathf.cos (; 87 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 i32) @@ -4337,11 +4221,11 @@ (local $5 f64) (local $6 f64) (local $7 f64) - (local $8 f32) + (local $8 i32) (local $9 i32) - (local $10 i32) - (local $11 f32) - (local $12 i32) + (local $10 f32) + (local $11 i32) + (local $12 f32) (local $13 i32) (local $14 i32) (local $15 i32) @@ -4437,35 +4321,35 @@ f64.const 3.141592653589793 f64.sub end + local.set $3 + local.get $3 + local.get $3 + f64.mul local.set $6 local.get $6 local.get $6 f64.mul local.set $5 - local.get $5 - local.get $5 - f64.mul - local.set $4 f64.const -0.001388676377460993 - local.get $5 + local.get $6 f64.const 2.439044879627741e-05 f64.mul f64.add - local.set $3 + local.set $4 f32.const 1 f64.promote_f32 - local.get $5 + local.get $6 f64.const -0.499999997251031 f64.mul f64.add - local.get $4 + local.get $5 f64.const 0.04166662332373906 f64.mul f64.add - local.get $4 local.get $5 + local.get $6 f64.mul - local.get $3 + local.get $4 f64.mul f64.add f32.demote_f64 @@ -4519,38 +4403,38 @@ local.get $0 f64.promote_f32 f64.sub + local.set $3 + local.get $3 + local.get $3 + f64.mul local.set $7 local.get $7 local.get $7 f64.mul local.set $6 - local.get $6 - local.get $6 - f64.mul - local.set $5 f64.const -1.9839334836096632e-04 - local.get $6 + local.get $7 f64.const 2.718311493989822e-06 f64.mul f64.add - local.set $4 - local.get $6 + local.set $5 local.get $7 + local.get $3 f64.mul - local.set $3 - local.get $7 + local.set $4 local.get $3 + local.get $4 f64.const -0.16666666641626524 - local.get $6 + local.get $7 f64.const 0.008333329385889463 f64.mul f64.add f64.mul f64.add - local.get $3 - local.get $5 - f64.mul local.get $4 + local.get $6 + f64.mul + local.get $5 f64.mul f64.add f32.demote_f64 @@ -4623,38 +4507,38 @@ f64.promote_f32 f64.const 4.71238898038469 f64.sub + local.set $7 + local.get $7 + local.get $7 + f64.mul local.set $6 local.get $6 local.get $6 f64.mul local.set $5 - local.get $5 - local.get $5 - f64.mul - local.set $4 f64.const -1.9839334836096632e-04 - local.get $5 + local.get $6 f64.const 2.718311493989822e-06 f64.mul f64.add - local.set $3 - local.get $5 + local.set $4 local.get $6 + local.get $7 f64.mul - local.set $7 - local.get $6 + local.set $3 local.get $7 + local.get $3 f64.const -0.16666666641626524 - local.get $5 + local.get $6 f64.const 0.008333329385889463 f64.mul f64.add f64.mul f64.add - local.get $7 - local.get $4 - f64.mul local.get $3 + local.get $5 + f64.mul + local.get $4 f64.mul f64.add f32.demote_f64 @@ -4715,22 +4599,22 @@ end block $~lib/math/rempio2f|inlined.0 (result i32) local.get $0 - local.set $8 + local.set $10 local.get $1 local.set $9 local.get $2 - local.set $10 + local.set $8 local.get $9 i32.const 1305022427 i32.lt_u if - local.get $8 + local.get $10 f64.promote_f32 f64.const 0.6366197723675814 f64.mul f64.nearest local.set $6 - local.get $8 + local.get $10 f64.promote_f32 local.get $6 f64.const 1.5707963109016418 @@ -4746,11 +4630,11 @@ br $~lib/math/rempio2f|inlined.0 end block $~lib/math/pio2_large_quot|inlined.0 (result i32) - local.get $8 - local.set $11 - local.get $9 + local.get $10 local.set $12 - local.get $12 + local.get $9 + local.set $11 + local.get $11 i32.const 23 i32.shr_s i32.const 152 @@ -4764,13 +4648,13 @@ i32.const 63 i32.and local.set $15 - i32.const 104 + i32.const 112 local.get $14 i32.const 0 i32.add call $~lib/array/Array#__unchecked_get local.set $16 - i32.const 104 + i32.const 112 local.get $14 i32.const 1 i32.add @@ -4780,7 +4664,7 @@ i32.const 32 i32.gt_s if - i32.const 104 + i32.const 112 local.get $14 i32.const 2 i32.add @@ -4823,7 +4707,7 @@ i64.shl i64.or local.set $19 - local.get $12 + local.get $11 i32.const 8388607 i32.and i32.const 8388608 @@ -4854,7 +4738,7 @@ i32.wrap_i64 local.set $23 f64.const 8.515303950216386e-20 - local.get $11 + local.get $12 f64.promote_f32 f64.copysign local.get $22 @@ -4868,7 +4752,7 @@ local.get $23 i32.sub local.get $23 - local.get $10 + local.get $8 select end local.set $24 @@ -4879,38 +4763,38 @@ i32.and if (result f32) local.get $25 + local.set $7 + local.get $7 + local.get $7 + f64.mul local.set $6 local.get $6 local.get $6 f64.mul local.set $5 - local.get $5 - local.get $5 - f64.mul - local.set $4 f64.const -1.9839334836096632e-04 - local.get $5 + local.get $6 f64.const 2.718311493989822e-06 f64.mul f64.add - local.set $3 - local.get $5 + local.set $4 local.get $6 + local.get $7 f64.mul - local.set $7 - local.get $6 + local.set $3 local.get $7 + local.get $3 f64.const -0.16666666641626524 - local.get $5 + local.get $6 f64.const 0.008333329385889463 f64.mul f64.add f64.mul f64.add - local.get $7 - local.get $4 - f64.mul local.get $3 + local.get $5 + f64.mul + local.get $4 f64.mul f64.add f32.demote_f64 @@ -4986,7 +4870,6 @@ (local $13 f64) (local $14 f64) (local $15 f64) - (local $16 i32) local.get $0 i64.reinterpret_f64 local.set $1 @@ -5214,9 +5097,8 @@ local.get $3 i32.const 0 i32.lt_s - local.tee $16 if (result i32) - local.get $16 + i32.const 1 else local.get $3 i32.const 56 @@ -5475,11 +5357,7 @@ i32.lt_u if local.get $2 - i32.const 1072693248 - i32.const 26 - i32.const 20 - i32.shl - i32.sub + i32.const 1045430272 i32.lt_u if f64.const 1 @@ -5545,20 +5423,17 @@ local.get $3 ) (func $std/math/test_cosh (; 92 ;) (type $FUNCSIG$idddi) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) - (local $4 i32) local.get $0 call $~lib/math/NativeMath.cosh local.get $1 local.get $2 local.get $3 call $std/math/check - local.tee $4 if (result i32) global.get $std/math/js i32.eqz - local.tee $4 if (result i32) - local.get $4 + i32.const 1 else local.get $0 call $~lib/bindings/Math/cosh @@ -5568,7 +5443,7 @@ call $std/math/check end else - local.get $4 + i32.const 0 end ) (func $~lib/math/NativeMathf.expm1 (; 93 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) @@ -5586,7 +5461,6 @@ (local $12 f32) (local $13 f32) (local $14 f32) - (local $15 i32) local.get $0 i32.reinterpret_f32 local.set $1 @@ -5797,9 +5671,8 @@ local.get $6 i32.const 0 i32.lt_s - local.tee $15 if (result i32) - local.get $15 + i32.const 1 else local.get $6 i32.const 56 @@ -6029,11 +5902,7 @@ i32.lt_u if local.get $1 - i32.const 1065353216 - i32.const 12 - i32.const 23 - i32.shl - i32.sub + i32.const 964689920 i32.lt_u if f32.const 1 @@ -6102,20 +5971,17 @@ call $std/math/check ) (func $std/math/test_exp (; 97 ;) (type $FUNCSIG$idddi) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) - (local $4 i32) local.get $0 call $~lib/math/NativeMath.exp local.get $1 local.get $2 local.get $3 call $std/math/check - local.tee $4 if (result i32) global.get $std/math/js i32.eqz - local.tee $4 if (result i32) - local.get $4 + i32.const 1 else local.get $0 call $~lib/bindings/Math/exp @@ -6125,7 +5991,7 @@ call $std/math/check end else - local.get $4 + i32.const 0 end ) (func $std/math/test_expf (; 98 ;) (type $FUNCSIG$ifffi) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) @@ -6137,20 +6003,17 @@ call $std/math/check ) (func $std/math/test_expm1 (; 99 ;) (type $FUNCSIG$idddi) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) - (local $4 i32) local.get $0 call $~lib/math/NativeMath.expm1 local.get $1 local.get $2 local.get $3 call $std/math/check - local.tee $4 if (result i32) global.get $std/math/js i32.eqz - local.tee $4 if (result i32) - local.get $4 + i32.const 1 else local.get $0 call $~lib/bindings/Math/expm1 @@ -6160,7 +6023,7 @@ call $std/math/check end else - local.get $4 + i32.const 0 end ) (func $std/math/test_expm1f (; 100 ;) (type $FUNCSIG$ifffi) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) @@ -6173,7 +6036,6 @@ ) (func $std/math/test_floor (; 101 ;) (type $FUNCSIG$idddi) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 f64) - (local $5 i32) block $~lib/math/NativeMath.floor|inlined.0 (result f64) local.get $0 local.set $4 @@ -6184,13 +6046,11 @@ local.get $2 local.get $3 call $std/math/check - local.tee $5 if (result i32) global.get $std/math/js i32.eqz - local.tee $5 if (result i32) - local.get $5 + i32.const 1 else local.get $0 call $~lib/bindings/Math/floor @@ -6200,7 +6060,7 @@ call $std/math/check end else - local.get $5 + i32.const 0 end ) (func $std/math/test_floorf (; 102 ;) (type $FUNCSIG$ifffi) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) @@ -6222,7 +6082,7 @@ (local $4 i64) (local $5 i32) (local $6 i32) - (local $7 i32) + (local $7 f64) (local $8 f64) (local $9 f64) (local $10 f64) @@ -6230,7 +6090,6 @@ (local $12 f64) (local $13 f64) (local $14 f64) - (local $15 f64) local.get $0 i64.reinterpret_f64 local.set $2 @@ -6282,9 +6141,8 @@ local.get $5 i32.const 2047 i32.eq - local.tee $7 if (result i32) - local.get $7 + i32.const 1 else local.get $3 i64.const 0 @@ -6306,15 +6164,13 @@ return end f64.const 1 - local.set $8 + local.set $7 local.get $5 - i32.const 1023 - i32.const 510 - i32.add + i32.const 1533 i32.gt_s if f64.const 5260135901548373507240989e186 - local.set $8 + local.set $7 local.get $0 f64.const 1.90109156629516e-211 f64.mul @@ -6325,13 +6181,11 @@ local.set $1 else local.get $6 - i32.const 1023 - i32.const 450 - i32.sub + i32.const 573 i32.lt_s if f64.const 1.90109156629516e-211 - local.set $8 + local.set $7 local.get $0 f64.const 5260135901548373507240989e186 f64.mul @@ -6345,80 +6199,79 @@ local.get $0 f64.const 134217729 f64.mul - local.set $9 + local.set $8 local.get $0 - local.get $9 + local.get $8 f64.sub - local.get $9 + local.get $8 f64.add - local.set $10 + local.set $9 local.get $0 - local.get $10 + local.get $9 f64.sub - local.set $11 + local.set $10 local.get $0 local.get $0 f64.mul - local.set $12 - local.get $10 - local.get $10 + local.set $11 + local.get $9 + local.get $9 f64.mul - local.get $12 + local.get $11 f64.sub f64.const 2 - local.get $10 + local.get $9 f64.mul - local.get $11 + local.get $10 f64.add - local.get $11 + local.get $10 f64.mul f64.add - local.set $13 + local.set $12 local.get $1 f64.const 134217729 f64.mul - local.set $9 + local.set $8 local.get $1 - local.get $9 + local.get $8 f64.sub - local.get $9 + local.get $8 f64.add - local.set $10 + local.set $9 local.get $1 - local.get $10 + local.get $9 f64.sub - local.set $11 + local.set $10 local.get $1 local.get $1 f64.mul - local.set $14 - local.get $10 - local.get $10 + local.set $13 + local.get $9 + local.get $9 f64.mul - local.get $14 + local.get $13 f64.sub f64.const 2 - local.get $10 + local.get $9 f64.mul - local.get $11 + local.get $10 f64.add - local.get $11 + local.get $10 f64.mul f64.add - local.set $15 - local.get $8 - local.get $15 - local.get $13 - f64.add + local.set $14 + local.get $7 local.get $14 - f64.add local.get $12 f64.add + local.get $13 + f64.add + local.get $11 + f64.add f64.sqrt f64.mul ) (func $std/math/test_hypot (; 104 ;) (type $FUNCSIG$iddddi) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 i32) (result i32) - (local $5 i32) local.get $0 local.get $1 call $~lib/math/NativeMath.hypot @@ -6426,13 +6279,11 @@ local.get $3 local.get $4 call $std/math/check - local.tee $5 if (result i32) global.get $std/math/js i32.eqz - local.tee $5 if (result i32) - local.get $5 + i32.const 1 else local.get $0 local.get $1 @@ -6443,7 +6294,7 @@ call $std/math/check end else - local.get $5 + i32.const 0 end ) (func $~lib/math/NativeMathf.hypot (; 105 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) @@ -6483,37 +6334,29 @@ f32.reinterpret_i32 local.set $1 local.get $3 - i32.const 255 - i32.const 23 - i32.shl + i32.const 2139095040 i32.eq if local.get $1 return end local.get $2 - i32.const 255 - i32.const 23 - i32.shl + i32.const 2139095040 i32.ge_u - local.tee $4 if (result i32) - local.get $4 + i32.const 1 else local.get $3 i32.const 0 i32.eq end - local.tee $4 if (result i32) - local.get $4 + i32.const 1 else local.get $2 local.get $3 i32.sub - i32.const 25 - i32.const 23 - i32.shl + i32.const 209715200 i32.ge_u end if @@ -6525,11 +6368,7 @@ f32.const 1 local.set $5 local.get $2 - i32.const 127 - i32.const 60 - i32.add - i32.const 23 - i32.shl + i32.const 1568669696 i32.ge_u if f32.const 1237940039285380274899124e3 @@ -6544,11 +6383,7 @@ local.set $1 else local.get $3 - i32.const 127 - i32.const 60 - i32.sub - i32.const 23 - i32.shl + i32.const 562036736 i32.lt_u if f32.const 8.077935669463161e-28 @@ -6589,20 +6424,17 @@ call $std/math/check ) (func $std/math/test_log (; 107 ;) (type $FUNCSIG$idddi) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) - (local $4 i32) local.get $0 call $~lib/math/NativeMath.log local.get $1 local.get $2 local.get $3 call $std/math/check - local.tee $4 if (result i32) global.get $std/math/js i32.eqz - local.tee $4 if (result i32) - local.get $4 + i32.const 1 else local.get $0 call $~lib/bindings/Math/log @@ -6612,7 +6444,7 @@ call $std/math/check end else - local.get $4 + i32.const 0 end ) (func $std/math/test_logf (; 108 ;) (type $FUNCSIG$ifffi) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) @@ -6627,7 +6459,7 @@ (local $1 i64) (local $2 i32) (local $3 i32) - (local $4 i32) + (local $4 f64) (local $5 f64) (local $6 f64) (local $7 f64) @@ -6641,7 +6473,6 @@ (local $15 f64) (local $16 f64) (local $17 f64) - (local $18 f64) local.get $0 i64.reinterpret_f64 local.set $1 @@ -6655,9 +6486,8 @@ local.get $2 i32.const 1048576 i32.lt_u - local.tee $4 if (result i32) - local.get $4 + i32.const 1 else local.get $2 i32.const 31 @@ -6715,7 +6545,6 @@ local.get $2 i32.const 1072693248 i32.eq - local.tee $4 if (result i32) local.get $1 i64.const 32 @@ -6723,7 +6552,7 @@ i64.const 0 i64.eq else - local.get $4 + i32.const 0 end if f64.const 0 @@ -6766,46 +6595,46 @@ local.get $0 f64.const 1 f64.sub - local.set $5 + local.set $4 f64.const 0.5 - local.get $5 + local.get $4 f64.mul - local.get $5 + local.get $4 f64.mul - local.set $6 - local.get $5 + local.set $5 + local.get $4 f64.const 2 - local.get $5 + local.get $4 f64.add f64.div + local.set $6 + local.get $6 + local.get $6 + f64.mul local.set $7 local.get $7 local.get $7 f64.mul local.set $8 local.get $8 - local.get $8 - f64.mul - local.set $9 - local.get $9 f64.const 0.3999999999940942 - local.get $9 + local.get $8 f64.const 0.22222198432149784 - local.get $9 + local.get $8 f64.const 0.15313837699209373 f64.mul f64.add f64.mul f64.add f64.mul - local.set $10 - local.get $8 + local.set $9 + local.get $7 f64.const 0.6666666666666735 - local.get $9 + local.get $8 f64.const 0.2857142874366239 - local.get $9 + local.get $8 f64.const 0.1818357216161805 - local.get $9 + local.get $8 f64.const 0.14798198605116586 f64.mul f64.add @@ -6814,16 +6643,16 @@ f64.mul f64.add f64.mul - local.set $11 - local.get $11 + local.set $10 local.get $10 + local.get $9 f64.add - local.set $12 + local.set $11 + local.get $4 local.get $5 - local.get $6 f64.sub - local.set $13 - local.get $13 + local.set $12 + local.get $12 i64.reinterpret_f64 local.set $1 local.get $1 @@ -6832,75 +6661,72 @@ local.set $1 local.get $1 f64.reinterpret_i64 - local.set $13 + local.set $12 + local.get $4 + local.get $12 + f64.sub local.get $5 - local.get $13 f64.sub local.get $6 - f64.sub - local.get $7 - local.get $6 - local.get $12 + local.get $5 + local.get $11 f64.add f64.mul f64.add - local.set $14 - local.get $13 + local.set $13 + local.get $12 f64.const 0.4342944818781689 f64.mul - local.set $15 + local.set $14 local.get $3 f64.convert_i32_s - local.set $16 - local.get $16 + local.set $15 + local.get $15 f64.const 0.30102999566361177 f64.mul - local.set $17 - local.get $16 + local.set $16 + local.get $15 f64.const 3.694239077158931e-13 f64.mul - local.get $14 local.get $13 + local.get $12 f64.add f64.const 2.5082946711645275e-11 f64.mul f64.add - local.get $14 + local.get $13 f64.const 0.4342944818781689 f64.mul f64.add - local.set $18 - local.get $17 - local.get $15 + local.set $17 + local.get $16 + local.get $14 f64.add - local.set $9 - local.get $18 + local.set $8 local.get $17 - local.get $9 + local.get $16 + local.get $8 f64.sub - local.get $15 + local.get $14 f64.add f64.add - local.set $18 - local.get $18 - local.get $9 + local.set $17 + local.get $17 + local.get $8 f64.add ) (func $std/math/test_log10 (; 110 ;) (type $FUNCSIG$idddi) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) - (local $4 i32) local.get $0 call $~lib/math/NativeMath.log10 local.get $1 local.get $2 local.get $3 call $std/math/check - local.tee $4 if (result i32) global.get $std/math/js i32.eqz - local.tee $4 if (result i32) - local.get $4 + i32.const 1 else local.get $0 call $~lib/bindings/Math/log10 @@ -6910,13 +6736,13 @@ call $std/math/check end else - local.get $4 + i32.const 0 end ) (func $~lib/math/NativeMathf.log10 (; 111 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 i32) (local $2 i32) - (local $3 i32) + (local $3 f32) (local $4 f32) (local $5 f32) (local $6 f32) @@ -6927,7 +6753,6 @@ (local $11 f32) (local $12 f32) (local $13 f32) - (local $14 f32) local.get $0 i32.reinterpret_f32 local.set $1 @@ -6936,9 +6761,8 @@ local.get $1 i32.const 8388608 i32.lt_u - local.tee $3 if (result i32) - local.get $3 + i32.const 1 else local.get $1 i32.const 31 @@ -7023,52 +6847,52 @@ local.get $0 f32.const 1 f32.sub - local.set $4 - local.get $4 + local.set $3 + local.get $3 f32.const 2 - local.get $4 + local.get $3 f32.add f32.div + local.set $4 + local.get $4 + local.get $4 + f32.mul local.set $5 local.get $5 local.get $5 f32.mul local.set $6 local.get $6 - local.get $6 - f32.mul - local.set $7 - local.get $7 f32.const 0.40000972151756287 - local.get $7 + local.get $6 f32.const 0.24279078841209412 f32.mul f32.add f32.mul - local.set $8 - local.get $6 + local.set $7 + local.get $5 f32.const 0.6666666269302368 - local.get $7 + local.get $6 f32.const 0.2849878668785095 f32.mul f32.add f32.mul - local.set $9 - local.get $9 + local.set $8 local.get $8 + local.get $7 f32.add - local.set $10 + local.set $9 f32.const 0.5 - local.get $4 + local.get $3 f32.mul - local.get $4 + local.get $3 f32.mul + local.set $10 + local.get $3 + local.get $10 + f32.sub local.set $11 - local.get $4 local.get $11 - f32.sub - local.set $12 - local.get $12 i32.reinterpret_f32 local.set $1 local.get $1 @@ -7077,40 +6901,40 @@ local.set $1 local.get $1 f32.reinterpret_i32 - local.set $12 - local.get $4 - local.get $12 - f32.sub + local.set $11 + local.get $3 local.get $11 f32.sub - local.get $5 - local.get $11 local.get $10 + f32.sub + local.get $4 + local.get $10 + local.get $9 f32.add f32.mul f32.add - local.set $13 + local.set $12 local.get $2 f32.convert_i32_s - local.set $14 - local.get $14 + local.set $13 + local.get $13 f32.const 7.903415166765626e-07 f32.mul - local.get $13 local.get $12 + local.get $11 f32.add f32.const -3.168997136526741e-05 f32.mul f32.add - local.get $13 + local.get $12 f32.const 0.434326171875 f32.mul f32.add - local.get $12 + local.get $11 f32.const 0.434326171875 f32.mul f32.add - local.get $14 + local.get $13 f32.const 0.3010292053222656 f32.mul f32.add @@ -7124,20 +6948,17 @@ call $std/math/check ) (func $std/math/test_log1p (; 113 ;) (type $FUNCSIG$idddi) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) - (local $4 i32) local.get $0 call $~lib/math/NativeMath.log1p local.get $1 local.get $2 local.get $3 call $std/math/check - local.tee $4 if (result i32) global.get $std/math/js i32.eqz - local.tee $4 if (result i32) - local.get $4 + i32.const 1 else local.get $0 call $~lib/bindings/Math/log1p @@ -7147,7 +6968,7 @@ call $std/math/check end else - local.get $4 + i32.const 0 end ) (func $std/math/test_log1pf (; 114 ;) (type $FUNCSIG$ifffi) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) @@ -7162,7 +6983,7 @@ (local $1 i64) (local $2 i32) (local $3 i32) - (local $4 i32) + (local $4 f64) (local $5 f64) (local $6 f64) (local $7 f64) @@ -7175,7 +6996,6 @@ (local $14 f64) (local $15 f64) (local $16 f64) - (local $17 f64) local.get $0 i64.reinterpret_f64 local.set $1 @@ -7189,9 +7009,8 @@ local.get $2 i32.const 1048576 i32.lt_u - local.tee $4 if (result i32) - local.get $4 + i32.const 1 else local.get $2 i32.const 31 @@ -7249,7 +7068,6 @@ local.get $2 i32.const 1072693248 i32.eq - local.tee $4 if (result i32) local.get $1 i64.const 32 @@ -7257,7 +7075,7 @@ i64.const 0 i64.eq else - local.get $4 + i32.const 0 end if f64.const 0 @@ -7300,46 +7118,46 @@ local.get $0 f64.const 1 f64.sub - local.set $5 + local.set $4 f64.const 0.5 - local.get $5 + local.get $4 f64.mul - local.get $5 + local.get $4 f64.mul - local.set $6 - local.get $5 + local.set $5 + local.get $4 f64.const 2 - local.get $5 + local.get $4 f64.add f64.div + local.set $6 + local.get $6 + local.get $6 + f64.mul local.set $7 local.get $7 local.get $7 f64.mul local.set $8 local.get $8 - local.get $8 - f64.mul - local.set $9 - local.get $9 f64.const 0.3999999999940942 - local.get $9 + local.get $8 f64.const 0.22222198432149784 - local.get $9 + local.get $8 f64.const 0.15313837699209373 f64.mul f64.add f64.mul f64.add f64.mul - local.set $10 - local.get $8 + local.set $9 + local.get $7 f64.const 0.6666666666666735 - local.get $9 + local.get $8 f64.const 0.2857142874366239 - local.get $9 + local.get $8 f64.const 0.1818357216161805 - local.get $9 + local.get $8 f64.const 0.14798198605116586 f64.mul f64.add @@ -7348,16 +7166,16 @@ f64.mul f64.add f64.mul - local.set $11 - local.get $11 + local.set $10 local.get $10 + local.get $9 f64.add - local.set $12 + local.set $11 + local.get $4 local.get $5 - local.get $6 f64.sub - local.set $13 - local.get $13 + local.set $12 + local.get $12 i64.reinterpret_f64 local.set $1 local.get $1 @@ -7366,69 +7184,66 @@ local.set $1 local.get $1 f64.reinterpret_i64 - local.set $13 - local.get $5 - local.get $13 + local.set $12 + local.get $4 + local.get $12 f64.sub - local.get $6 + local.get $5 f64.sub - local.get $7 local.get $6 - local.get $12 + local.get $5 + local.get $11 f64.add f64.mul f64.add - local.set $14 - local.get $13 + local.set $13 + local.get $12 f64.const 1.4426950407214463 f64.mul - local.set $15 - local.get $14 + local.set $14 local.get $13 + local.get $12 f64.add f64.const 1.6751713164886512e-10 f64.mul - local.get $14 + local.get $13 f64.const 1.4426950407214463 f64.mul f64.add - local.set $16 + local.set $15 local.get $3 f64.convert_i32_s - local.set $17 - local.get $17 - local.get $15 + local.set $16 + local.get $16 + local.get $14 f64.add - local.set $9 + local.set $8 + local.get $15 local.get $16 - local.get $17 - local.get $9 + local.get $8 f64.sub - local.get $15 + local.get $14 f64.add f64.add - local.set $16 - local.get $9 local.set $15 - local.get $16 + local.get $8 + local.set $14 local.get $15 + local.get $14 f64.add ) (func $std/math/test_log2 (; 116 ;) (type $FUNCSIG$idddi) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) - (local $4 i32) local.get $0 call $~lib/math/NativeMath.log2 local.get $1 local.get $2 local.get $3 call $std/math/check - local.tee $4 if (result i32) global.get $std/math/js i32.eqz - local.tee $4 if (result i32) - local.get $4 + i32.const 1 else local.get $0 call $~lib/bindings/Math/log2 @@ -7438,13 +7253,13 @@ call $std/math/check end else - local.get $4 + i32.const 0 end ) (func $~lib/math/NativeMathf.log2 (; 117 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 i32) (local $2 i32) - (local $3 i32) + (local $3 f32) (local $4 f32) (local $5 f32) (local $6 f32) @@ -7453,10 +7268,9 @@ (local $9 f32) (local $10 f32) (local $11 f32) - (local $12 f32) - (local $13 i32) + (local $12 i32) + (local $13 f32) (local $14 f32) - (local $15 f32) local.get $0 i32.reinterpret_f32 local.set $1 @@ -7465,9 +7279,8 @@ local.get $1 i32.const 8388608 i32.lt_u - local.tee $3 if (result i32) - local.get $3 + i32.const 1 else local.get $1 i32.const 31 @@ -7552,90 +7365,90 @@ local.get $0 f32.const 1 f32.sub - local.set $4 - local.get $4 + local.set $3 + local.get $3 f32.const 2 - local.get $4 + local.get $3 f32.add f32.div + local.set $4 + local.get $4 + local.get $4 + f32.mul local.set $5 local.get $5 local.get $5 f32.mul local.set $6 local.get $6 - local.get $6 - f32.mul - local.set $7 - local.get $7 f32.const 0.40000972151756287 - local.get $7 + local.get $6 f32.const 0.24279078841209412 f32.mul f32.add f32.mul - local.set $8 - local.get $6 + local.set $7 + local.get $5 f32.const 0.6666666269302368 - local.get $7 + local.get $6 f32.const 0.2849878668785095 f32.mul f32.add f32.mul - local.set $9 - local.get $9 + local.set $8 local.get $8 + local.get $7 f32.add - local.set $10 + local.set $9 f32.const 0.5 - local.get $4 + local.get $3 f32.mul - local.get $4 + local.get $3 f32.mul + local.set $10 + local.get $3 + local.get $10 + f32.sub local.set $11 - local.get $4 local.get $11 - f32.sub + i32.reinterpret_f32 local.set $12 local.get $12 - i32.reinterpret_f32 - local.set $13 - local.get $13 i32.const -4096 i32.and - local.set $13 - local.get $13 - f32.reinterpret_i32 local.set $12 - local.get $4 local.get $12 - f32.sub + f32.reinterpret_i32 + local.set $11 + local.get $3 local.get $11 f32.sub - local.get $5 - local.get $11 local.get $10 + f32.sub + local.get $4 + local.get $10 + local.get $9 f32.add f32.mul f32.add - local.set $14 + local.set $13 local.get $2 f32.convert_i32_s - local.set $15 - local.get $14 - local.get $12 + local.set $14 + local.get $13 + local.get $11 f32.add f32.const -1.7605285393074155e-04 f32.mul - local.get $14 + local.get $13 f32.const 1.44287109375 f32.mul f32.add - local.get $12 + local.get $11 f32.const 1.44287109375 f32.mul f32.add - local.get $15 + local.get $14 f32.add ) (func $std/math/test_log2f (; 118 ;) (type $FUNCSIG$ifffi) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) @@ -7649,27 +7462,24 @@ (func $std/math/test_max (; 119 ;) (type $FUNCSIG$iddddi) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 i32) (result i32) (local $5 f64) (local $6 f64) - (local $7 i32) block $~lib/math/NativeMath.max|inlined.0 (result f64) local.get $0 - local.set $5 - local.get $1 local.set $6 - local.get $5 + local.get $1 + local.set $5 local.get $6 + local.get $5 f64.max end local.get $2 local.get $3 local.get $4 call $std/math/check - local.tee $7 if (result i32) global.get $std/math/js i32.eqz - local.tee $7 if (result i32) - local.get $7 + i32.const 1 else local.get $0 local.get $1 @@ -7680,7 +7490,7 @@ call $std/math/check end else - local.get $7 + i32.const 0 end ) (func $std/math/test_maxf (; 120 ;) (type $FUNCSIG$iffffi) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (param $4 i32) (result i32) @@ -7688,11 +7498,11 @@ (local $6 f32) block $~lib/math/NativeMathf.max|inlined.0 (result f32) local.get $0 - local.set $5 - local.get $1 local.set $6 - local.get $5 + local.get $1 + local.set $5 local.get $6 + local.get $5 f32.max end local.get $2 @@ -7703,27 +7513,24 @@ (func $std/math/test_min (; 121 ;) (type $FUNCSIG$iddddi) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 i32) (result i32) (local $5 f64) (local $6 f64) - (local $7 i32) block $~lib/math/NativeMath.min|inlined.0 (result f64) local.get $0 - local.set $5 - local.get $1 local.set $6 - local.get $5 + local.get $1 + local.set $5 local.get $6 + local.get $5 f64.min end local.get $2 local.get $3 local.get $4 call $std/math/check - local.tee $7 if (result i32) global.get $std/math/js i32.eqz - local.tee $7 if (result i32) - local.get $7 + i32.const 1 else local.get $0 local.get $1 @@ -7734,7 +7541,7 @@ call $std/math/check end else - local.get $7 + i32.const 0 end ) (func $std/math/test_minf (; 122 ;) (type $FUNCSIG$iffffi) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (param $4 i32) (result i32) @@ -7742,11 +7549,11 @@ (local $6 f32) block $~lib/math/NativeMathf.min|inlined.0 (result f32) local.get $0 - local.set $5 - local.get $1 local.set $6 - local.get $5 + local.get $1 + local.set $5 local.get $6 + local.get $5 f32.min end local.get $2 @@ -7761,10 +7568,9 @@ (local $5 i64) (local $6 i64) (local $7 i64) - (local $8 i32) - (local $9 f64) + (local $8 f64) + (local $9 i64) (local $10 i64) - (local $11 i64) local.get $0 i64.reinterpret_f64 local.set $2 @@ -7794,45 +7600,38 @@ local.get $7 i64.const 0 i64.eq - local.tee $8 if (result i32) - local.get $8 + i32.const 1 else local.get $4 i64.const 2047 i64.eq end - local.tee $8 if (result i32) - local.get $8 + i32.const 1 else local.get $1 - local.set $9 - local.get $9 - local.get $9 - f64.ne + call $~lib/builtins/isNaN end - i32.const 0 - i32.ne if local.get $0 local.get $1 f64.mul - local.set $9 - local.get $9 - local.get $9 + local.set $8 + local.get $8 + local.get $8 f64.div return end local.get $2 i64.const 1 i64.shl - local.set $10 - local.get $10 + local.set $9 + local.get $9 local.get $7 i64.le_u if - local.get $10 + local.get $9 local.get $7 i64.eq if @@ -7914,34 +7713,32 @@ local.get $5 i64.gt_s if - block + local.get $2 + local.get $3 + i64.ge_u + if local.get $2 local.get $3 - i64.ge_u + i64.eq if - local.get $2 - local.get $3 - i64.eq - if - f64.const 0 - local.get $0 - f64.mul - return - end - local.get $2 - local.get $3 - i64.sub - local.set $2 + f64.const 0 + local.get $0 + f64.mul + return end local.get $2 - i64.const 1 - i64.shl - local.set $2 - local.get $4 - i64.const 1 + local.get $3 i64.sub - local.set $4 + local.set $2 end + local.get $2 + i64.const 1 + i64.shl + local.set $2 + local.get $4 + i64.const 1 + i64.sub + local.set $4 br $continue|0 end end @@ -7968,13 +7765,13 @@ i64.const 11 i64.shl i64.clz - local.set $11 + local.set $10 local.get $4 - local.get $11 + local.get $10 i64.sub local.set $4 local.get $2 - local.get $11 + local.get $10 i64.shl local.set $2 local.get $4 @@ -8013,7 +7810,6 @@ f64.reinterpret_i64 ) (func $std/math/test_mod (; 124 ;) (type $FUNCSIG$iddddi) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 i32) (result i32) - (local $5 i32) local.get $0 local.get $1 call $~lib/math/NativeMath.mod @@ -8021,13 +7817,11 @@ local.get $3 local.get $4 call $std/math/check - local.tee $5 if (result i32) global.get $std/math/js i32.eqz - local.tee $5 if (result i32) - local.get $5 + i32.const 1 else local.get $0 local.get $1 @@ -8038,7 +7832,7 @@ call $std/math/check end else - local.get $5 + i32.const 0 end ) (func $~lib/math/NativeMathf.mod (; 125 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) @@ -8048,10 +7842,9 @@ (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 f32) + (local $8 f32) + (local $9 i32) (local $10 i32) - (local $11 i32) local.get $0 i32.reinterpret_f32 local.set $2 @@ -8081,45 +7874,38 @@ local.get $7 i32.const 0 i32.eq - local.tee $8 if (result i32) - local.get $8 + i32.const 1 else local.get $4 i32.const 255 i32.eq end - local.tee $8 if (result i32) - local.get $8 + i32.const 1 else local.get $1 - local.set $9 - local.get $9 - local.get $9 - f32.ne + call $~lib/builtins/isNaN end - i32.const 0 - i32.ne if local.get $0 local.get $1 f32.mul - local.set $9 - local.get $9 - local.get $9 + local.set $8 + local.get $8 + local.get $8 f32.div return end local.get $2 i32.const 1 i32.shl - local.set $10 - local.get $10 + local.set $9 + local.get $9 local.get $7 i32.le_u if - local.get $10 + local.get $9 local.get $7 i32.eq if @@ -8201,34 +7987,32 @@ local.get $5 i32.gt_s if - block + local.get $2 + local.get $3 + i32.ge_u + if local.get $2 local.get $3 - i32.ge_u + i32.eq if - local.get $2 - local.get $3 - i32.eq - if - f32.const 0 - local.get $0 - f32.mul - return - end - local.get $2 - local.get $3 - i32.sub - local.set $2 + f32.const 0 + local.get $0 + f32.mul + return end local.get $2 - i32.const 1 - i32.shl - local.set $2 - local.get $4 - i32.const 1 + local.get $3 i32.sub - local.set $4 + local.set $2 end + local.get $2 + i32.const 1 + i32.shl + local.set $2 + local.get $4 + i32.const 1 + i32.sub + local.set $4 br $continue|0 end end @@ -8255,13 +8039,13 @@ i32.const 8 i32.shl i32.clz - local.set $11 + local.set $10 local.get $4 - local.get $11 + local.get $10 i32.sub local.set $4 local.get $2 - local.get $11 + local.get $10 i32.shl local.set $2 local.get $4 @@ -8389,44 +8173,39 @@ local.get $7 i32.const 2146435072 i32.gt_s - local.tee $9 if (result i32) - local.get $9 + i32.const 1 else local.get $7 i32.const 2146435072 i32.eq - local.tee $9 if (result i32) local.get $4 i32.const 0 i32.ne else - local.get $9 + i32.const 0 end end - local.tee $9 if (result i32) - local.get $9 + i32.const 1 else local.get $8 i32.const 2146435072 i32.gt_s end - local.tee $9 if (result i32) - local.get $9 + i32.const 1 else local.get $8 i32.const 2146435072 i32.eq - local.tee $9 if (result i32) local.get $6 i32.const 0 i32.ne else - local.get $9 + i32.const 0 end end if @@ -8436,7 +8215,7 @@ return end i32.const 0 - local.set $10 + local.set $9 local.get $3 i32.const 0 i32.lt_s @@ -8446,7 +8225,7 @@ i32.ge_s if i32.const 2 - local.set $10 + local.set $9 else local.get $8 i32.const 1072693248 @@ -8457,21 +8236,21 @@ i32.shr_s i32.const 1023 i32.sub - local.set $11 - local.get $11 + local.set $10 + local.get $10 i32.const 20 i32.gt_s - local.set $9 + local.set $11 i32.const 52 i32.const 20 - local.get $9 - select local.get $11 + select + local.get $10 i32.sub local.set $12 local.get $6 local.get $8 - local.get $9 + local.get $11 select local.set $13 local.get $13 @@ -8489,7 +8268,7 @@ i32.const 1 i32.and i32.sub - local.set $10 + local.set $9 end end end @@ -8592,17 +8371,15 @@ local.get $7 i32.const 0 i32.eq - local.tee $14 if (result i32) - local.get $14 + i32.const 1 else local.get $7 i32.const 2146435072 i32.eq end - local.tee $14 if (result i32) - local.get $14 + i32.const 1 else local.get $7 i32.const 1072693248 @@ -8627,7 +8404,7 @@ local.get $7 i32.const 1072693248 i32.sub - local.get $10 + local.get $9 i32.or i32.const 0 i32.eq @@ -8641,7 +8418,7 @@ f64.div local.set $16 else - local.get $10 + local.get $9 i32.const 1 i32.eq if @@ -8661,7 +8438,7 @@ i32.const 0 i32.lt_s if - local.get $10 + local.get $9 i32.const 0 i32.eq if @@ -8674,7 +8451,7 @@ f64.div return end - local.get $10 + local.get $9 i32.const 1 i32.eq if @@ -8860,17 +8637,17 @@ i32.le_s if i32.const 0 - local.set $11 + local.set $10 else local.get $28 i32.const 767610 i32.lt_s if i32.const 1 - local.set $11 + local.set $10 else i32.const 0 - local.set $11 + local.set $10 local.get $29 i32.const 1 i32.add @@ -8894,7 +8671,7 @@ local.set $15 f64.const 1.5 f64.const 1 - local.get $11 + local.get $10 select local.set $35 local.get $15 @@ -8926,7 +8703,7 @@ i32.or i32.const 524288 i32.add - local.get $11 + local.get $10 i32.const 18 i32.shl i32.add @@ -9049,7 +8826,7 @@ local.set $36 f64.const 1.350039202129749e-08 f64.const 0 - local.get $11 + local.get $10 select local.set $37 f64.const -7.028461650952758e-09 @@ -9067,7 +8844,7 @@ local.set $24 f64.const 0.5849624872207642 f64.const 0 - local.get $11 + local.get $10 select local.set $39 local.get $36 @@ -9212,7 +8989,7 @@ i32.shr_s i32.const 1023 i32.sub - local.set $11 + local.set $10 i32.const 0 local.set $29 local.get $41 @@ -9221,7 +8998,7 @@ if local.get $28 i32.const 1048576 - local.get $11 + local.get $10 i32.const 1 i32.add i32.shr_s @@ -9234,12 +9011,12 @@ i32.shr_s i32.const 1023 i32.sub - local.set $11 + local.set $10 f64.const 0 local.set $24 local.get $29 i32.const 1048575 - local.get $11 + local.get $10 i32.shr_s i32.const -1 i32.xor @@ -9255,7 +9032,7 @@ i32.const 1048576 i32.or i32.const 20 - local.get $11 + local.get $10 i32.sub i32.shr_s local.set $29 @@ -9395,7 +9172,6 @@ f64.mul ) (func $std/math/test_pow (; 128 ;) (type $FUNCSIG$iddddi) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 i32) (result i32) - (local $5 i32) local.get $0 local.get $1 call $~lib/math/NativeMath.pow @@ -9403,13 +9179,11 @@ local.get $3 local.get $4 call $std/math/check - local.tee $5 if (result i32) global.get $std/math/js i32.eqz - local.tee $5 if (result i32) - local.get $5 + i32.const 1 else local.get $0 local.get $1 @@ -9420,7 +9194,7 @@ call $std/math/check end else - local.get $5 + i32.const 0 end ) (func $~lib/math/NativeMathf.pow (; 129 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) @@ -9483,9 +9257,8 @@ local.get $4 i32.const 2139095040 i32.gt_s - local.tee $6 if (result i32) - local.get $6 + i32.const 1 else local.get $5 i32.const 2139095040 @@ -9498,7 +9271,7 @@ return end i32.const 0 - local.set $7 + local.set $6 local.get $2 i32.const 0 i32.lt_s @@ -9508,7 +9281,7 @@ i32.ge_s if i32.const 2 - local.set $7 + local.set $6 else local.get $5 i32.const 1065353216 @@ -9519,27 +9292,27 @@ i32.shr_s i32.const 127 i32.sub - local.set $9 + local.set $8 i32.const 23 - local.get $9 + local.get $8 i32.sub - local.set $6 + local.set $9 local.get $5 - local.get $6 + local.get $9 i32.shr_s - local.set $8 - local.get $8 - local.get $6 + local.set $7 + local.get $7 + local.get $9 i32.shl local.get $5 i32.eq if i32.const 2 - local.get $8 + local.get $7 i32.const 1 i32.and i32.sub - local.set $7 + local.set $6 end end end @@ -9629,17 +9402,15 @@ local.get $4 i32.const 2139095040 i32.eq - local.tee $6 if (result i32) - local.get $6 + i32.const 1 else local.get $4 i32.const 0 i32.eq end - local.tee $6 if (result i32) - local.get $6 + i32.const 1 else local.get $4 i32.const 1065353216 @@ -9664,7 +9435,7 @@ local.get $4 i32.const 1065353216 i32.sub - local.get $7 + local.get $6 i32.or i32.const 0 i32.eq @@ -9678,7 +9449,7 @@ f32.div local.set $11 else - local.get $7 + local.get $6 i32.const 1 i32.eq if @@ -9697,7 +9468,7 @@ i32.const 0 i32.lt_s if - local.get $7 + local.get $6 i32.const 0 i32.eq if @@ -9710,7 +9481,7 @@ f32.div return end - local.get $7 + local.get $6 i32.const 1 i32.eq if @@ -9844,27 +9615,27 @@ local.get $4 i32.const 8388607 i32.and - local.set $8 - local.get $8 + local.set $7 + local.get $7 i32.const 1065353216 i32.or local.set $4 - local.get $8 + local.get $7 i32.const 1885297 i32.le_s if i32.const 0 - local.set $9 + local.set $8 else - local.get $8 + local.get $7 i32.const 6140887 i32.lt_s if i32.const 1 - local.set $9 + local.set $8 else i32.const 0 - local.set $9 + local.set $8 local.get $24 i32.const 1 i32.add @@ -9880,7 +9651,7 @@ local.set $10 f32.const 1.5 f32.const 1 - local.get $9 + local.get $8 select local.set $30 local.get $10 @@ -9918,7 +9689,7 @@ local.get $25 i32.const 4194304 i32.add - local.get $9 + local.get $8 i32.const 21 i32.shl i32.add @@ -10042,7 +9813,7 @@ local.set $31 f32.const 1.5632208487659227e-06 f32.const 0 - local.get $9 + local.get $8 select local.set $32 f32.const -1.1736857413779944e-04 @@ -10060,7 +9831,7 @@ local.set $18 f32.const 0.5849609375 f32.const 0 - local.get $9 + local.get $8 select local.set $34 local.get $31 @@ -10118,8 +9889,8 @@ local.set $11 local.get $11 i32.reinterpret_f32 - local.set $8 - local.get $8 + local.set $7 + local.get $7 i32.const 1124073472 i32.gt_s if @@ -10130,7 +9901,7 @@ f32.mul return else - local.get $8 + local.get $7 i32.const 1124073472 i32.eq if @@ -10150,7 +9921,7 @@ return end else - local.get $8 + local.get $7 i32.const 2147483647 i32.and i32.const 1125515264 @@ -10163,7 +9934,7 @@ f32.mul return else - local.get $8 + local.get $7 i32.const -1021968384 i32.eq if @@ -10184,7 +9955,7 @@ end end end - local.get $8 + local.get $7 i32.const 2147483647 i32.and local.set $36 @@ -10193,16 +9964,16 @@ i32.shr_s i32.const 127 i32.sub - local.set $9 + local.set $8 i32.const 0 local.set $24 local.get $36 i32.const 1056964608 i32.gt_s if - local.get $8 + local.get $7 i32.const 8388608 - local.get $9 + local.get $8 i32.const 1 i32.add i32.shr_s @@ -10215,10 +9986,10 @@ i32.shr_s i32.const 127 i32.sub - local.set $9 + local.set $8 local.get $24 i32.const 8388607 - local.get $9 + local.get $8 i32.shr_s i32.const -1 i32.xor @@ -10231,11 +10002,11 @@ i32.const 8388608 i32.or i32.const 23 - local.get $9 + local.get $8 i32.sub i32.shr_s local.set $24 - local.get $8 + local.get $7 i32.const 0 i32.lt_s if @@ -10335,14 +10106,14 @@ local.set $11 local.get $11 i32.reinterpret_f32 - local.set $8 - local.get $8 + local.set $7 + local.get $7 local.get $24 i32.const 23 i32.shl i32.add - local.set $8 - local.get $8 + local.set $7 + local.get $7 i32.const 23 i32.shr_s i32.const 0 @@ -10353,7 +10124,7 @@ call $~lib/math/NativeMathf.scalbn local.set $11 else - local.get $8 + local.get $7 f32.reinterpret_i32 local.set $11 end @@ -10439,10 +10210,10 @@ i64.eqz if i32.const 0 - i32.const 112 - i32.const 978 + i32.const 144 + i32.const 1020 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -10470,11 +10241,11 @@ global.get $~lib/math/random_seeded i32.eqz if - i32.const 0 - i32.const 112 - i32.const 987 + i32.const 184 + i32.const 144 + i32.const 1029 i32.const 24 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/math/random_state0_64 @@ -10527,11 +10298,11 @@ global.get $~lib/math/random_seeded i32.eqz if - i32.const 0 - i32.const 112 - i32.const 2219 + i32.const 184 + i32.const 144 + i32.const 2309 i32.const 24 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/math/random_state0_32 @@ -10611,7 +10382,6 @@ ) (func $std/math/test_sign (; 138 ;) (type $FUNCSIG$idddi) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 f64) - (local $5 i32) block $~lib/math/NativeMath.sign|inlined.0 (result f64) local.get $0 local.set $4 @@ -10636,13 +10406,11 @@ local.get $2 local.get $3 call $std/math/check - local.tee $5 if (result i32) global.get $std/math/js i32.eqz - local.tee $5 if (result i32) - local.get $5 + i32.const 1 else local.get $0 call $~lib/bindings/Math/sign @@ -10652,7 +10420,7 @@ call $std/math/check end else - local.get $5 + i32.const 0 end ) (func $std/math/test_signf (; 139 ;) (type $FUNCSIG$ifffi) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) @@ -10688,12 +10456,11 @@ (local $4 i64) (local $5 i64) (local $6 i32) - (local $7 i32) - (local $8 f64) - (local $9 i64) - (local $10 i32) - (local $11 i64) - (local $12 f64) + (local $7 f64) + (local $8 i64) + (local $9 i32) + (local $10 i64) + (local $11 f64) local.get $0 i64.reinterpret_f64 local.set $2 @@ -10722,17 +10489,15 @@ i64.shl i64.const 0 i64.eq - local.tee $7 if (result i32) - local.get $7 + i32.const 1 else local.get $4 i64.const 2047 i64.eq end - local.tee $7 if (result i32) - local.get $7 + i32.const 1 else local.get $1 call $~lib/builtins/isNaN @@ -10741,9 +10506,9 @@ local.get $0 local.get $1 f64.mul - local.set $8 - local.get $8 - local.get $8 + local.set $7 + local.get $7 + local.get $7 f64.div return end @@ -10757,38 +10522,38 @@ return end local.get $2 - local.set $9 + local.set $8 local.get $4 i64.eqz if local.get $4 - local.get $9 + local.get $8 i64.const 12 i64.shl i64.clz i64.sub local.set $4 - local.get $9 + local.get $8 i64.const 0 local.get $4 i64.sub i64.const 1 i64.add i64.shl - local.set $9 + local.set $8 else - local.get $9 + local.get $8 i64.const -1 i64.const 12 i64.shr_u i64.and - local.set $9 - local.get $9 + local.set $8 + local.get $8 i64.const 1 i64.const 52 i64.shl i64.or - local.set $9 + local.set $8 end local.get $5 i64.eqz @@ -10823,7 +10588,7 @@ local.set $3 end i32.const 0 - local.set $10 + local.set $9 block $break|0 loop $continue|0 local.get $4 @@ -10847,70 +10612,68 @@ local.get $5 i64.gt_s if - block - local.get $9 + local.get $8 + local.get $3 + i64.ge_u + if + local.get $8 local.get $3 - i64.ge_u - if - local.get $9 - local.get $3 - i64.sub - local.set $9 - local.get $10 - i32.const 1 - i32.add - local.set $10 - end + i64.sub + local.set $8 local.get $9 - i64.const 1 - i64.shl - local.set $9 - local.get $10 i32.const 1 - i32.shl - local.set $10 - local.get $4 - i64.const 1 - i64.sub - local.set $4 + i32.add + local.set $9 end + local.get $8 + i64.const 1 + i64.shl + local.set $8 + local.get $9 + i32.const 1 + i32.shl + local.set $9 + local.get $4 + i64.const 1 + i64.sub + local.set $4 br $continue|1 end end end - local.get $9 + local.get $8 local.get $3 i64.ge_u if - local.get $9 + local.get $8 local.get $3 i64.sub - local.set $9 - local.get $10 + local.set $8 + local.get $9 i32.const 1 i32.add - local.set $10 + local.set $9 end - local.get $9 + local.get $8 i64.const 0 i64.eq if i64.const -60 local.set $4 else - local.get $9 + local.get $8 i64.const 11 i64.shl i64.clz - local.set $11 + local.set $10 local.get $4 - local.get $11 + local.get $10 i64.sub local.set $4 - local.get $9 - local.get $11 + local.get $8 + local.get $10 i64.shl - local.set $9 + local.set $8 end br $break|0 unreachable @@ -10922,29 +10685,29 @@ i64.const 0 i64.gt_s if - local.get $9 + local.get $8 i64.const 1 i64.const 52 i64.shl i64.sub - local.set $9 - local.get $9 + local.set $8 + local.get $8 local.get $4 i64.const 52 i64.shl i64.or - local.set $9 + local.set $8 else - local.get $9 + local.get $8 i64.const 0 local.get $4 i64.sub i64.const 1 i64.add i64.shr_u - local.set $9 + local.set $8 end - local.get $9 + local.get $8 f64.reinterpret_i64 local.set $0 local.get $1 @@ -10953,42 +10716,38 @@ local.get $0 local.get $0 f64.add - local.set $12 + local.set $11 local.get $4 local.get $5 i64.eq - local.tee $7 if (result i32) - local.get $7 + i32.const 1 else local.get $4 i64.const 1 i64.add local.get $5 i64.eq - local.tee $7 if (result i32) - local.get $12 + local.get $11 local.get $1 f64.gt - local.tee $7 if (result i32) - local.get $7 + i32.const 1 else - local.get $12 + local.get $11 local.get $1 f64.eq - local.tee $7 if (result i32) - local.get $10 + local.get $9 i32.const 1 i32.and else - local.get $7 + i32.const 0 end end else - local.get $7 + i32.const 0 end end if @@ -11053,17 +10812,15 @@ i32.shl i32.const 0 i32.eq - local.tee $8 if (result i32) - local.get $8 + i32.const 1 else local.get $4 i32.const 255 i32.eq end - local.tee $8 if (result i32) - local.get $8 + i32.const 1 else local.get $1 call $~lib/builtins/isNaN @@ -11152,7 +10909,7 @@ local.set $3 end i32.const 0 - local.set $9 + local.set $8 block $break|0 loop $continue|0 local.get $4 @@ -11176,33 +10933,31 @@ local.get $5 i32.gt_s if - block + local.get $7 + local.get $3 + i32.ge_u + if local.get $7 local.get $3 - i32.ge_u - if - local.get $7 - local.get $3 - i32.sub - local.set $7 - local.get $9 - i32.const 1 - i32.add - local.set $9 - end - local.get $7 - i32.const 1 - i32.shl + i32.sub local.set $7 - local.get $9 - i32.const 1 - i32.shl - local.set $9 - local.get $4 + local.get $8 i32.const 1 - i32.sub - local.set $4 + i32.add + local.set $8 end + local.get $7 + i32.const 1 + i32.shl + local.set $7 + local.get $8 + i32.const 1 + i32.shl + local.set $8 + local.get $4 + i32.const 1 + i32.sub + local.set $4 br $continue|1 end end @@ -11215,10 +10970,10 @@ local.get $3 i32.sub local.set $7 - local.get $9 + local.get $8 i32.const 1 i32.add - local.set $9 + local.set $8 end local.get $7 i32.const 0 @@ -11231,13 +10986,13 @@ i32.const 8 i32.shl i32.clz - local.set $8 + local.set $9 local.get $4 - local.get $8 + local.get $9 i32.sub local.set $4 local.get $7 - local.get $8 + local.get $9 i32.shl local.set $7 end @@ -11286,38 +11041,34 @@ local.get $4 local.get $5 i32.eq - local.tee $8 if (result i32) - local.get $8 + i32.const 1 else local.get $4 i32.const 1 i32.add local.get $5 i32.eq - local.tee $8 if (result i32) local.get $10 local.get $1 f32.gt - local.tee $8 if (result i32) - local.get $8 + i32.const 1 else local.get $10 local.get $1 f32.eq - local.tee $8 if (result i32) - local.get $9 + local.get $8 i32.const 1 i32.and else - local.get $8 + i32.const 0 end end else - local.get $8 + i32.const 0 end end if @@ -11351,11 +11102,11 @@ (local $5 f64) (local $6 f64) (local $7 f64) - (local $8 f32) + (local $8 i32) (local $9 i32) - (local $10 i32) - (local $11 f32) - (local $12 i32) + (local $10 f32) + (local $11 i32) + (local $12 f32) (local $13 i32) (local $14 i32) (local $15 i32) @@ -11448,35 +11199,35 @@ f64.promote_f32 f64.const 1.5707963267948966 f64.add + local.set $3 + local.get $3 + local.get $3 + f64.mul local.set $7 local.get $7 local.get $7 f64.mul local.set $6 - local.get $6 - local.get $6 - f64.mul - local.set $5 f64.const -0.001388676377460993 - local.get $6 + local.get $7 f64.const 2.439044879627741e-05 f64.mul f64.add - local.set $4 + local.set $5 f32.const 1 f64.promote_f32 - local.get $6 + local.get $7 f64.const -0.499999997251031 f64.mul f64.add - local.get $5 + local.get $6 f64.const 0.04166662332373906 f64.mul f64.add - local.get $5 local.get $6 + local.get $7 f64.mul - local.get $4 + local.get $5 f64.mul f64.add f32.demote_f64 @@ -11536,38 +11287,38 @@ f64.sub end f64.neg + local.set $3 + local.get $3 + local.get $3 + f64.mul local.set $7 local.get $7 local.get $7 f64.mul local.set $6 - local.get $6 - local.get $6 - f64.mul - local.set $5 f64.const -1.9839334836096632e-04 - local.get $6 + local.get $7 f64.const 2.718311493989822e-06 f64.mul f64.add - local.set $4 - local.get $6 + local.set $5 local.get $7 + local.get $3 f64.mul - local.set $3 - local.get $7 + local.set $4 local.get $3 + local.get $4 f64.const -0.16666666641626524 - local.get $6 + local.get $7 f64.const 0.008333329385889463 f64.mul f64.add f64.mul f64.add - local.get $3 - local.get $5 - f64.mul local.get $4 + local.get $6 + f64.mul + local.get $5 f64.mul f64.add f32.demote_f64 @@ -11626,35 +11377,35 @@ f64.promote_f32 f64.const 4.71238898038469 f64.sub + local.set $7 + local.get $7 + local.get $7 + f64.mul local.set $6 local.get $6 local.get $6 f64.mul local.set $5 - local.get $5 - local.get $5 - f64.mul - local.set $4 f64.const -0.001388676377460993 - local.get $5 + local.get $6 f64.const 2.439044879627741e-05 f64.mul f64.add - local.set $3 + local.set $4 f32.const 1 f64.promote_f32 - local.get $5 + local.get $6 f64.const -0.499999997251031 f64.mul f64.add - local.get $4 + local.get $5 f64.const 0.04166662332373906 f64.mul f64.add - local.get $4 local.get $5 + local.get $6 f64.mul - local.get $3 + local.get $4 f64.mul f64.add f32.demote_f64 @@ -11725,22 +11476,22 @@ end block $~lib/math/rempio2f|inlined.1 (result i32) local.get $0 - local.set $8 + local.set $10 local.get $1 local.set $9 local.get $2 - local.set $10 + local.set $8 local.get $9 i32.const 1305022427 i32.lt_u if - local.get $8 + local.get $10 f64.promote_f32 f64.const 0.6366197723675814 f64.mul f64.nearest local.set $7 - local.get $8 + local.get $10 f64.promote_f32 local.get $7 f64.const 1.5707963109016418 @@ -11756,11 +11507,11 @@ br $~lib/math/rempio2f|inlined.1 end block $~lib/math/pio2_large_quot|inlined.1 (result i32) - local.get $8 - local.set $11 - local.get $9 + local.get $10 local.set $12 - local.get $12 + local.get $9 + local.set $11 + local.get $11 i32.const 23 i32.shr_s i32.const 152 @@ -11774,13 +11525,13 @@ i32.const 63 i32.and local.set $15 - i32.const 104 + i32.const 112 local.get $14 i32.const 0 i32.add call $~lib/array/Array#__unchecked_get local.set $16 - i32.const 104 + i32.const 112 local.get $14 i32.const 1 i32.add @@ -11790,7 +11541,7 @@ i32.const 32 i32.gt_s if - i32.const 104 + i32.const 112 local.get $14 i32.const 2 i32.add @@ -11833,7 +11584,7 @@ i64.shl i64.or local.set $19 - local.get $12 + local.get $11 i32.const 8388607 i32.and i32.const 8388608 @@ -11864,7 +11615,7 @@ i32.wrap_i64 local.set $23 f64.const 8.515303950216386e-20 - local.get $11 + local.get $12 f64.promote_f32 f64.copysign local.get $22 @@ -11878,7 +11629,7 @@ local.get $23 i32.sub local.get $23 - local.get $10 + local.get $8 select end local.set $24 @@ -11889,35 +11640,35 @@ i32.and if (result f32) local.get $25 + local.set $3 + local.get $3 + local.get $3 + f64.mul local.set $7 local.get $7 local.get $7 f64.mul local.set $6 - local.get $6 - local.get $6 - f64.mul - local.set $5 f64.const -0.001388676377460993 - local.get $6 + local.get $7 f64.const 2.439044879627741e-05 f64.mul f64.add - local.set $4 + local.set $5 f32.const 1 f64.promote_f32 - local.get $6 + local.get $7 f64.const -0.499999997251031 f64.mul f64.add - local.get $5 + local.get $6 f64.const 0.04166662332373906 f64.mul f64.add - local.get $5 local.get $6 + local.get $7 f64.mul - local.get $4 + local.get $5 f64.mul f64.add f32.demote_f64 @@ -12015,11 +11766,7 @@ i32.lt_u if local.get $3 - i32.const 1072693248 - i32.const 26 - i32.const 20 - i32.shl - i32.sub + i32.const 1045430272 i32.lt_u if local.get $0 @@ -12083,20 +11830,17 @@ local.get $4 ) (func $std/math/test_sinh (; 147 ;) (type $FUNCSIG$idddi) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) - (local $4 i32) local.get $0 call $~lib/math/NativeMath.sinh local.get $1 local.get $2 local.get $3 call $std/math/check - local.tee $4 if (result i32) global.get $std/math/js i32.eqz - local.tee $4 if (result i32) - local.get $4 + i32.const 1 else local.get $0 call $~lib/bindings/Math/sinh @@ -12106,7 +11850,7 @@ call $std/math/check end else - local.get $4 + i32.const 0 end ) (func $~lib/math/NativeMathf.sinh (; 148 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) @@ -12140,11 +11884,7 @@ i32.lt_u if local.get $1 - i32.const 1065353216 - i32.const 12 - i32.const 23 - i32.shl - i32.sub + i32.const 964689920 i32.lt_u if local.get $0 @@ -12214,7 +11954,6 @@ ) (func $std/math/test_sqrt (; 150 ;) (type $FUNCSIG$idddi) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 f64) - (local $5 i32) block $~lib/math/NativeMath.sqrt|inlined.0 (result f64) local.get $0 local.set $4 @@ -12225,13 +11964,11 @@ local.get $2 local.get $3 call $std/math/check - local.tee $5 if (result i32) global.get $std/math/js i32.eqz - local.tee $5 if (result i32) - local.get $5 + i32.const 1 else local.get $0 call $~lib/bindings/Math/sqrt @@ -12241,7 +11978,7 @@ call $std/math/check end else - local.get $5 + i32.const 0 end ) (func $std/math/test_sqrtf (; 151 ;) (type $FUNCSIG$ifffi) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) @@ -12260,18 +11997,18 @@ (func $~lib/math/NativeMathf.tan (; 152 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 i32) (local $2 i32) - (local $3 f64) - (local $4 i32) + (local $3 i32) + (local $4 f64) (local $5 f64) (local $6 f64) (local $7 f64) (local $8 f64) (local $9 f64) (local $10 f64) - (local $11 f32) - (local $12 i32) - (local $13 f32) - (local $14 i32) + (local $11 i32) + (local $12 f32) + (local $13 i32) + (local $14 f32) (local $15 i32) (local $16 i32) (local $17 i32) @@ -12310,11 +12047,11 @@ block $~lib/math/tan_kernf|inlined.0 (result f32) local.get $0 f64.promote_f32 - local.set $3 - i32.const 0 local.set $4 - local.get $3 - local.get $3 + i32.const 0 + local.set $3 + local.get $4 + local.get $4 f64.mul local.set $5 f64.const 0.002974357433599673 @@ -12334,7 +12071,7 @@ f64.mul local.set $8 local.get $5 - local.get $3 + local.get $4 f64.mul local.set $9 f64.const 0.3333313950307914 @@ -12343,7 +12080,7 @@ f64.mul f64.add local.set $10 - local.get $3 + local.get $4 local.get $9 local.get $10 f64.mul @@ -12359,7 +12096,7 @@ f64.mul f64.add local.set $6 - local.get $4 + local.get $3 if (result f64) f32.const -1 f64.promote_f32 @@ -12393,63 +12130,63 @@ f64.const 1.5707963267948966 f64.sub end - local.set $10 - i32.const 1 local.set $4 - local.get $10 - local.get $10 + i32.const 1 + local.set $3 + local.get $4 + local.get $4 f64.mul - local.set $9 + local.set $10 f64.const 0.002974357433599673 - local.get $9 + local.get $10 f64.const 0.009465647849436732 f64.mul f64.add - local.set $8 + local.set $9 f64.const 0.05338123784456704 - local.get $9 + local.get $10 f64.const 0.024528318116654728 f64.mul f64.add - local.set $7 - local.get $9 - local.get $9 + local.set $8 + local.get $10 + local.get $10 f64.mul - local.set $6 - local.get $9 + local.set $7 local.get $10 + local.get $4 f64.mul - local.set $5 + local.set $6 f64.const 0.3333313950307914 - local.get $9 + local.get $10 f64.const 0.13339200271297674 f64.mul f64.add - local.set $3 - local.get $10 + local.set $5 + local.get $4 + local.get $6 local.get $5 - local.get $3 f64.mul f64.add - local.get $5 local.get $6 - f64.mul local.get $7 - local.get $6 + f64.mul local.get $8 + local.get $7 + local.get $9 f64.mul f64.add f64.mul f64.add - local.set $8 - local.get $4 + local.set $9 + local.get $3 if (result f64) f32.const -1 f64.promote_f32 - local.get $8 + local.get $9 f64.div else - local.get $8 + local.get $9 end f32.demote_f64 end @@ -12468,11 +12205,11 @@ f64.const 3.141592653589793 f64.sub end - local.set $3 - i32.const 0 local.set $4 - local.get $3 - local.get $3 + i32.const 0 + local.set $3 + local.get $4 + local.get $4 f64.mul local.set $5 f64.const 0.002974357433599673 @@ -12492,7 +12229,7 @@ f64.mul local.set $8 local.get $5 - local.get $3 + local.get $4 f64.mul local.set $9 f64.const 0.3333313950307914 @@ -12501,7 +12238,7 @@ f64.mul f64.add local.set $10 - local.get $3 + local.get $4 local.get $9 local.get $10 f64.mul @@ -12517,7 +12254,7 @@ f64.mul f64.add local.set $6 - local.get $4 + local.get $3 if (result f64) f32.const -1 f64.promote_f32 @@ -12554,63 +12291,63 @@ f64.const 4.71238898038469 f64.sub end - local.set $10 - i32.const 1 local.set $4 - local.get $10 - local.get $10 + i32.const 1 + local.set $3 + local.get $4 + local.get $4 f64.mul - local.set $9 + local.set $10 f64.const 0.002974357433599673 - local.get $9 + local.get $10 f64.const 0.009465647849436732 f64.mul f64.add - local.set $8 + local.set $9 f64.const 0.05338123784456704 - local.get $9 + local.get $10 f64.const 0.024528318116654728 f64.mul f64.add - local.set $7 - local.get $9 - local.get $9 + local.set $8 + local.get $10 + local.get $10 f64.mul - local.set $6 - local.get $9 + local.set $7 local.get $10 + local.get $4 f64.mul - local.set $5 + local.set $6 f64.const 0.3333313950307914 - local.get $9 + local.get $10 f64.const 0.13339200271297674 f64.mul f64.add - local.set $3 - local.get $10 + local.set $5 + local.get $4 + local.get $6 local.get $5 - local.get $3 f64.mul f64.add - local.get $5 local.get $6 - f64.mul local.get $7 - local.get $6 + f64.mul local.get $8 + local.get $7 + local.get $9 f64.mul f64.add f64.mul f64.add - local.set $8 - local.get $4 + local.set $9 + local.get $3 if (result f64) f32.const -1 f64.promote_f32 - local.get $8 + local.get $9 f64.div else - local.get $8 + local.get $9 end f32.demote_f64 end @@ -12629,11 +12366,11 @@ f64.const 6.283185307179586 f64.sub end - local.set $3 - i32.const 0 local.set $4 - local.get $3 - local.get $3 + i32.const 0 + local.set $3 + local.get $4 + local.get $4 f64.mul local.set $5 f64.const 0.002974357433599673 @@ -12653,7 +12390,7 @@ f64.mul local.set $8 local.get $5 - local.get $3 + local.get $4 f64.mul local.set $9 f64.const 0.3333313950307914 @@ -12662,7 +12399,7 @@ f64.mul f64.add local.set $10 - local.get $3 + local.get $4 local.get $9 local.get $10 f64.mul @@ -12678,7 +12415,7 @@ f64.mul f64.add local.set $6 - local.get $4 + local.get $3 if (result f64) f32.const -1 f64.promote_f32 @@ -12705,22 +12442,22 @@ end block $~lib/math/rempio2f|inlined.2 (result i32) local.get $0 - local.set $11 + local.set $12 local.get $1 - local.set $4 + local.set $11 local.get $2 - local.set $12 - local.get $4 + local.set $3 + local.get $11 i32.const 1305022427 i32.lt_u if - local.get $11 + local.get $12 f64.promote_f32 f64.const 0.6366197723675814 f64.mul f64.nearest local.set $10 - local.get $11 + local.get $12 f64.promote_f32 local.get $10 f64.const 1.5707963109016418 @@ -12736,11 +12473,11 @@ br $~lib/math/rempio2f|inlined.2 end block $~lib/math/pio2_large_quot|inlined.2 (result i32) + local.get $12 + local.set $14 local.get $11 local.set $13 - local.get $4 - local.set $14 - local.get $14 + local.get $13 i32.const 23 i32.shr_s i32.const 152 @@ -12754,13 +12491,13 @@ i32.const 63 i32.and local.set $17 - i32.const 104 + i32.const 112 local.get $16 i32.const 0 i32.add call $~lib/array/Array#__unchecked_get local.set $18 - i32.const 104 + i32.const 112 local.get $16 i32.const 1 i32.add @@ -12770,7 +12507,7 @@ i32.const 32 i32.gt_s if - i32.const 104 + i32.const 112 local.get $16 i32.const 2 i32.add @@ -12813,7 +12550,7 @@ i64.shl i64.or local.set $21 - local.get $14 + local.get $13 i32.const 8388607 i32.and i32.const 8388608 @@ -12844,7 +12581,7 @@ i32.wrap_i64 local.set $25 f64.const 8.515303950216386e-20 - local.get $13 + local.get $14 f64.promote_f32 f64.copysign local.get $24 @@ -12858,7 +12595,7 @@ local.get $25 i32.sub local.get $25 - local.get $12 + local.get $3 select end local.set $26 @@ -12866,65 +12603,65 @@ local.set $27 block $~lib/math/tan_kernf|inlined.5 (result f32) local.get $27 - local.set $10 + local.set $4 local.get $26 i32.const 1 i32.and - local.set $25 - local.get $10 - local.get $10 + local.set $13 + local.get $4 + local.get $4 f64.mul - local.set $9 + local.set $10 f64.const 0.002974357433599673 - local.get $9 + local.get $10 f64.const 0.009465647849436732 f64.mul f64.add - local.set $8 + local.set $9 f64.const 0.05338123784456704 - local.get $9 + local.get $10 f64.const 0.024528318116654728 f64.mul f64.add - local.set $7 - local.get $9 - local.get $9 + local.set $8 + local.get $10 + local.get $10 f64.mul - local.set $6 - local.get $9 + local.set $7 local.get $10 + local.get $4 f64.mul - local.set $5 + local.set $6 f64.const 0.3333313950307914 - local.get $9 + local.get $10 f64.const 0.13339200271297674 f64.mul f64.add - local.set $3 - local.get $10 + local.set $5 + local.get $4 + local.get $6 local.get $5 - local.get $3 f64.mul f64.add - local.get $5 local.get $6 - f64.mul local.get $7 - local.get $6 + f64.mul local.get $8 + local.get $7 + local.get $9 f64.mul f64.add f64.mul f64.add - local.set $8 - local.get $25 + local.set $9 + local.get $13 if (result f64) f32.const -1 f64.promote_f32 - local.get $8 + local.get $9 f64.div else - local.get $8 + local.get $9 end f32.demote_f64 end @@ -13030,20 +12767,17 @@ f64.copysign ) (func $std/math/test_tanh (; 155 ;) (type $FUNCSIG$idddi) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) - (local $4 i32) local.get $0 call $~lib/math/NativeMath.tanh local.get $1 local.get $2 local.get $3 call $std/math/check - local.tee $4 if (result i32) global.get $std/math/js i32.eqz - local.tee $4 if (result i32) - local.get $4 + i32.const 1 else local.get $0 call $~lib/bindings/Math/tanh @@ -13053,7 +12787,7 @@ call $std/math/check end else - local.get $4 + i32.const 0 end ) (func $~lib/math/NativeMathf.tanh (; 156 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) @@ -13152,7 +12886,6 @@ ) (func $std/math/test_trunc (; 158 ;) (type $FUNCSIG$idddi) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32) (local $4 f64) - (local $5 i32) block $~lib/math/NativeMath.trunc|inlined.0 (result f64) local.get $0 local.set $4 @@ -13163,13 +12896,11 @@ local.get $2 local.get $3 call $std/math/check - local.tee $5 if (result i32) global.get $std/math/js i32.eqz - local.tee $5 if (result i32) - local.get $5 + i32.const 1 else local.get $0 call $~lib/bindings/Math/trunc @@ -13179,7 +12910,7 @@ call $std/math/check end else - local.get $5 + i32.const 0 end ) (func $std/math/test_truncf (; 159 ;) (type $FUNCSIG$ifffi) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32) @@ -13458,25 +13189,23 @@ i32.const 0 i32.gt_s if - block - local.get $1 - i32.const 1 - i32.and - if - local.get $2 - local.get $0 - i64.mul - local.set $2 - end - local.get $1 - i32.const 1 - i32.shr_s - local.set $1 - local.get $0 + local.get $1 + i32.const 1 + i32.and + if + local.get $2 local.get $0 i64.mul - local.set $0 + local.set $2 end + local.get $1 + i32.const 1 + i32.shr_s + local.set $1 + local.get $0 + local.get $0 + i64.mul + local.set $0 br $continue|2 end end @@ -13502,25 +13231,23 @@ loop $continue|0 local.get $1 if - block - local.get $3 - local.get $0 - f32.const 1 - local.get $1 - i32.const 1 - i32.and - select - f32.mul - local.set $3 - local.get $1 - i32.const 1 - i32.shr_s - local.set $1 - local.get $0 - local.get $0 - f32.mul - local.set $0 - end + local.get $3 + local.get $0 + f32.const 1 + local.get $1 + i32.const 1 + i32.and + select + f32.mul + local.set $3 + local.get $1 + i32.const 1 + i32.shr_s + local.set $1 + local.get $0 + local.get $0 + f32.mul + local.set $0 br $continue|0 end end @@ -13553,25 +13280,23 @@ loop $continue|0 local.get $1 if - block - local.get $3 - local.get $0 - f64.const 1 - local.get $1 - i32.const 1 - i32.and - select - f64.mul - local.set $3 - local.get $1 - i32.const 1 - i32.shr_s - local.set $1 - local.get $0 - local.get $0 - f64.mul - local.set $0 - end + local.get $3 + local.get $0 + f64.const 1 + local.get $1 + i32.const 1 + i32.and + select + f64.mul + local.set $3 + local.get $1 + i32.const 1 + i32.shr_s + local.set $1 + local.get $0 + local.get $0 + f64.mul + local.set $0 br $continue|0 end end @@ -13588,19 +13313,18 @@ (func $start:std/math (; 165 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 f64) - (local $2 i32) - (local $3 i64) - (local $4 f32) + (local $2 i64) + (local $3 f32) global.get $~lib/math/NativeMath.E global.get $~lib/math/NativeMath.E f64.eq i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 101 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/math/NativeMathf.E @@ -13609,10 +13333,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 102 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/math/NativeMath.E @@ -13623,10 +13347,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 108 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/math/NativeMath.LN2 @@ -13637,10 +13361,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 109 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/math/NativeMath.LN10 @@ -13651,10 +13375,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 110 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/math/NativeMath.LOG2E @@ -13665,10 +13389,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 111 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/math/NativeMath.PI @@ -13679,10 +13403,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 112 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/math/NativeMath.SQRT1_2 @@ -13693,10 +13417,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 113 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/math/NativeMath.SQRT2 @@ -13707,10 +13431,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 114 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/math/NativeMathf.E @@ -13722,10 +13446,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 116 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/math/NativeMathf.LN2 @@ -13737,10 +13461,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 117 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/math/NativeMathf.LN10 @@ -13752,10 +13476,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 118 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/math/NativeMathf.LOG2E @@ -13767,10 +13491,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 119 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/math/NativeMathf.PI @@ -13782,10 +13506,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 120 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/math/NativeMathf.SQRT1_2 @@ -13797,10 +13521,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 121 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/math/NativeMathf.SQRT2 @@ -13812,10 +13536,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 122 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -13827,10 +13551,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 133 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -13842,10 +13566,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 134 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -13857,10 +13581,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 135 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -13872,10 +13596,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 136 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -13887,10 +13611,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 137 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -13902,10 +13626,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 138 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -13917,10 +13641,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 139 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -13932,10 +13656,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 140 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -13947,10 +13671,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 141 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -13962,10 +13686,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 142 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -13977,10 +13701,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 145 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -13992,10 +13716,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 146 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -14007,10 +13731,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 147 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -14022,10 +13746,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 148 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -14037,10 +13761,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 149 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -14054,10 +13778,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 150 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -14069,10 +13793,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 151 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -14084,10 +13808,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 152 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -14099,10 +13823,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 153 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -14116,10 +13840,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 154 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -14131,10 +13855,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 155 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -14146,10 +13870,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 156 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -14161,10 +13885,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 157 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -14178,10 +13902,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 158 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 8988465674311579538646525e283 @@ -14193,10 +13917,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 159 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 5e-324 @@ -14208,10 +13932,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 160 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.000244140625 @@ -14225,10 +13949,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 161 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7499999999999999 @@ -14242,10 +13966,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 162 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5000000000000012 @@ -14259,10 +13983,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 163 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -14274,10 +13998,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 172 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -14289,10 +14013,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 173 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -14304,10 +14028,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 174 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -14319,10 +14043,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 175 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -14334,10 +14058,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 176 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -14349,10 +14073,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 177 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -14364,10 +14088,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 178 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -14379,10 +14103,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 179 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -14394,10 +14118,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 180 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -14409,10 +14133,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 181 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -14424,10 +14148,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 184 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -14439,10 +14163,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 185 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -14454,10 +14178,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 186 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -14469,10 +14193,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 187 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -14484,10 +14208,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 188 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -14501,10 +14225,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 189 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -14516,10 +14240,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 190 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -14531,10 +14255,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 191 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -14546,10 +14270,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 192 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -14563,10 +14287,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 193 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -14578,10 +14302,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 194 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -14593,10 +14317,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 195 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -14608,10 +14332,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 196 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -14625,10 +14349,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 197 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1701411834604692317316873e14 @@ -14640,10 +14364,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 198 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.401298464324817e-45 @@ -14655,10 +14379,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 199 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.000244140625 @@ -14672,10 +14396,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 200 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7499999403953552 @@ -14689,10 +14413,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 201 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5000006556510925 @@ -14706,10 +14430,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 202 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -14720,10 +14444,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 214 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -14734,10 +14458,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 215 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -14748,10 +14472,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 216 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -14762,10 +14486,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 217 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -14776,10 +14500,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 218 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -14790,10 +14514,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 219 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -14804,10 +14528,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 220 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -14818,10 +14542,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 221 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -14832,10 +14556,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 222 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -14846,10 +14570,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 223 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -14860,10 +14584,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 226 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -14874,10 +14598,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 227 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -14888,10 +14612,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 228 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -14902,10 +14626,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 229 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -14916,10 +14640,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 230 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -14931,10 +14655,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 231 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -14945,10 +14669,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 232 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -14959,10 +14683,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 241 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -14973,10 +14697,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 242 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -14987,10 +14711,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 243 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -15001,10 +14725,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 244 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -15015,10 +14739,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 245 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -15029,10 +14753,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 246 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -15043,10 +14767,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 247 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -15057,10 +14781,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 248 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -15071,10 +14795,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 249 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -15085,10 +14809,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 250 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -15099,10 +14823,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 253 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -15113,10 +14837,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 254 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -15127,10 +14851,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 255 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -15141,10 +14865,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 256 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -15155,10 +14879,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 257 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -15170,10 +14894,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 258 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -15184,10 +14908,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 259 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -15198,10 +14922,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 271 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -15212,10 +14936,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 272 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -15226,10 +14950,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 273 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -15240,10 +14964,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 274 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -15254,10 +14978,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 275 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -15268,10 +14992,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 276 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -15282,10 +15006,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 277 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -15296,10 +15020,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 278 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -15310,10 +15034,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 279 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -15324,10 +15048,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 280 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -15338,10 +15062,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 283 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -15352,10 +15076,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 284 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -15366,10 +15090,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 285 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.0000000000000002 @@ -15380,10 +15104,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 286 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.0000000000000002 @@ -15394,10 +15118,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 287 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -15408,10 +15132,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 288 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -15423,10 +15147,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 289 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -15437,10 +15161,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 290 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5309227209592985 @@ -15451,10 +15175,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 291 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.4939556746399746 @@ -15465,10 +15189,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 292 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -15479,10 +15203,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 301 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -15493,10 +15217,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 302 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -15507,10 +15231,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 303 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -15521,10 +15245,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 304 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -15535,10 +15259,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 305 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -15549,10 +15273,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 306 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -15563,10 +15287,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 307 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -15577,10 +15301,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 308 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -15591,10 +15315,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 309 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -15605,10 +15329,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 310 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -15619,10 +15343,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 313 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -15633,10 +15357,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 314 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -15647,10 +15371,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 315 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.0000001192092896 @@ -15661,10 +15385,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 316 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.0000001192092896 @@ -15675,10 +15399,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 317 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -15689,10 +15413,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 318 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -15704,10 +15428,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 319 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -15718,10 +15442,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 320 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.49965065717697144 @@ -15732,10 +15456,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 321 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5051405429840088 @@ -15746,10 +15470,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 322 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5189794898033142 @@ -15760,10 +15484,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 323 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -15774,10 +15498,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 335 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -15788,10 +15512,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 336 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -15802,10 +15526,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 337 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -15816,10 +15540,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 338 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -15830,10 +15554,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 339 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -15844,10 +15568,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 340 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -15858,10 +15582,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 341 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -15872,10 +15596,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 342 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -15886,10 +15610,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 343 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -15900,10 +15624,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 344 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -15914,10 +15638,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 347 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -15928,10 +15652,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 348 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -15942,10 +15666,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 349 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.9999923706054688 @@ -15956,10 +15680,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 350 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -15970,10 +15694,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 351 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -15984,10 +15708,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 352 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -15999,10 +15723,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 353 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.1060831199926429 @@ -16013,10 +15737,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 369 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.1089809557628658 @@ -16027,10 +15751,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 371 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.1169429159875521 @@ -16041,10 +15765,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 372 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -16055,10 +15779,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 381 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -16069,10 +15793,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 382 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -16083,10 +15807,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 383 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -16097,10 +15821,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 384 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -16111,10 +15835,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 385 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -16125,10 +15849,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 386 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -16139,10 +15863,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 387 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -16153,10 +15877,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 388 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -16167,10 +15891,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 389 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -16181,10 +15905,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 390 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -16195,10 +15919,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 393 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -16209,10 +15933,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 394 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -16223,10 +15947,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 395 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.9999923706054688 @@ -16237,10 +15961,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 396 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -16251,10 +15975,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 397 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -16265,10 +15989,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 398 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -16280,10 +16004,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 399 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1125899906842624 @@ -16294,10 +16018,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 400 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -16308,10 +16032,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 412 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -16322,10 +16046,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 413 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -16336,10 +16060,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 414 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -16350,10 +16074,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 415 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -16364,10 +16088,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 416 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -16378,10 +16102,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 417 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -16392,10 +16116,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 418 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -16406,10 +16130,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 419 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -16420,10 +16144,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 420 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -16434,10 +16158,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 421 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -16448,10 +16172,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 424 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -16462,10 +16186,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 425 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -16476,10 +16200,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 426 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -16490,10 +16214,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 427 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.0000000000000002 @@ -16504,10 +16228,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 428 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.0000000000000002 @@ -16518,10 +16242,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 429 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -16532,10 +16256,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 430 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -16547,10 +16271,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 431 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -16561,10 +16285,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 432 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5073043929119148 @@ -16575,10 +16299,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 433 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -16589,10 +16313,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 442 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -16603,10 +16327,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 443 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -16617,10 +16341,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 444 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -16631,10 +16355,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 445 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -16645,10 +16369,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 446 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -16659,10 +16383,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 447 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -16673,10 +16397,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 448 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -16687,10 +16411,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 449 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -16701,10 +16425,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 450 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -16715,10 +16439,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 451 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -16729,10 +16453,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 454 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -16743,10 +16467,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 455 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -16757,10 +16481,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 456 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -16771,10 +16495,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 457 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.0000001192092896 @@ -16785,10 +16509,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 458 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.0000001192092896 @@ -16799,10 +16523,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 459 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -16813,10 +16537,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 460 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -16828,10 +16552,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 461 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -16842,10 +16566,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 462 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5004770159721375 @@ -16856,10 +16580,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 463 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -16870,10 +16594,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 475 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -16884,10 +16608,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 476 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -16898,10 +16622,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 477 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -16912,10 +16636,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 478 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -16926,10 +16650,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 479 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -16940,10 +16664,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 480 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -16954,10 +16678,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 481 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -16968,10 +16692,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 482 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -16982,10 +16706,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 483 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -16996,10 +16720,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 484 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -17010,10 +16734,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 487 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -17024,10 +16748,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 488 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -17040,10 +16764,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 489 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -17054,10 +16778,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 490 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -17068,10 +16792,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 491 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -17082,10 +16806,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 520 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -17096,10 +16820,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 521 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -17110,10 +16834,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 522 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -17124,10 +16848,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 523 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -17138,10 +16862,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 524 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -17152,10 +16876,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 525 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -17166,10 +16890,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 526 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -17180,10 +16904,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 527 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -17194,10 +16918,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 528 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -17208,10 +16932,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 529 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -17222,10 +16946,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 532 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -17236,10 +16960,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 533 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -17252,10 +16976,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 534 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -17266,10 +16990,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 535 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -17280,10 +17004,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 536 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -17294,10 +17018,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 548 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -17308,10 +17032,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 549 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -17322,10 +17046,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 550 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -17336,10 +17060,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 551 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -17350,10 +17074,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 552 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -17364,10 +17088,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 553 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -17378,10 +17102,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 554 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -17392,10 +17116,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 555 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -17406,10 +17130,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 556 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -17420,10 +17144,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 557 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -17434,10 +17158,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 560 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -17448,10 +17172,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 561 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -17462,10 +17186,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 562 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -17476,10 +17200,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 563 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -17490,10 +17214,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 564 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -17505,10 +17229,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 565 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -17519,10 +17243,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 566 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6929821535674624 @@ -17533,10 +17257,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 567 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -17547,10 +17271,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 576 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -17561,10 +17285,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 577 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -17575,10 +17299,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 578 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -17589,10 +17313,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 579 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -17603,10 +17327,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 580 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -17617,10 +17341,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 581 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -17631,10 +17355,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 582 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -17645,10 +17369,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 583 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -17659,10 +17383,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 584 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -17673,10 +17397,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 585 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -17687,10 +17411,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 588 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -17701,10 +17425,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 589 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -17715,10 +17439,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 590 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -17729,10 +17453,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 591 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -17743,10 +17467,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 592 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -17758,10 +17482,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 593 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -17772,10 +17496,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 594 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -17786,10 +17510,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 606 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -17800,10 +17524,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 607 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -17814,10 +17538,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 608 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -17828,10 +17552,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 609 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -17842,10 +17566,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 610 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -17856,10 +17580,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 611 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -17870,10 +17594,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 612 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -17884,10 +17608,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 613 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -17898,10 +17622,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 614 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -17912,10 +17636,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 615 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -17926,10 +17650,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 618 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -17940,10 +17664,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 619 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -17955,10 +17679,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 620 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -17969,10 +17693,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 621 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -17983,10 +17707,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 622 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -17997,10 +17721,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 623 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -18012,10 +17736,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 624 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.0000152587890625 @@ -18026,10 +17750,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 625 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.0000152587890625 @@ -18040,10 +17764,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 626 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.3552527156068805e-20 @@ -18054,10 +17778,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 627 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.332636185032189e-302 @@ -18068,10 +17792,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 628 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 5.562684646268003e-309 @@ -18084,10 +17808,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 629 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -5.562684646268003e-309 @@ -18100,10 +17824,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 630 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 8988465674311579538646525e283 @@ -18114,10 +17838,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 631 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -18128,10 +17852,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 640 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -18142,10 +17866,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 641 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -18156,10 +17880,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 642 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -18170,10 +17894,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 643 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -18184,10 +17908,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 644 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -18198,10 +17922,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 645 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -18212,10 +17936,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 646 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -18226,10 +17950,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 647 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -18240,10 +17964,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 648 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -18254,10 +17978,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 649 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -18268,10 +17992,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 652 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -18282,10 +18006,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 653 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -18297,10 +18021,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 654 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -18311,10 +18035,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 655 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -18325,10 +18049,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 656 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -18339,10 +18063,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 657 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -18354,10 +18078,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 658 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.0000152587890625 @@ -18368,10 +18092,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 659 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.0000152587890625 @@ -18382,10 +18106,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 660 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.3552527156068805e-20 @@ -18396,10 +18120,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 661 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 7.888609052210118e-31 @@ -18410,10 +18134,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 662 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.938735877055719e-39 @@ -18426,10 +18150,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 663 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2.938735877055719e-39 @@ -18442,10 +18166,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 664 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1701411834604692317316873e14 @@ -18456,10 +18180,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 665 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -18471,10 +18195,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 677 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -18486,10 +18210,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 678 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -18501,10 +18225,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 679 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -18516,10 +18240,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 680 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -18531,10 +18255,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 681 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.450045556060236 @@ -18546,10 +18270,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 682 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 7.858890253041697 @@ -18561,10 +18285,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 683 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.792054511984896 @@ -18576,10 +18300,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 684 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.615702673197924 @@ -18591,10 +18315,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 685 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5587586823609152 @@ -18606,10 +18330,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 686 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -18621,10 +18345,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 689 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -18636,10 +18360,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 690 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -18651,10 +18375,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 691 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -18667,10 +18391,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 692 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -18682,10 +18406,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 693 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -18697,10 +18421,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 694 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -18712,10 +18436,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 695 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -18727,10 +18451,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 696 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -18742,10 +18466,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 697 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -18758,10 +18482,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 698 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -18773,10 +18497,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 699 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -18788,10 +18512,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 700 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -18803,10 +18527,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 701 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -18818,10 +18542,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 702 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -18833,10 +18557,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 703 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -18848,10 +18572,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 704 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -18863,10 +18587,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 705 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -18878,10 +18602,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 706 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -18894,10 +18618,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 707 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -18910,10 +18634,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 708 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -18925,10 +18649,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 709 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -18941,10 +18665,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 710 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -18956,10 +18680,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 711 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -18972,10 +18696,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 712 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -18988,10 +18712,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 713 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -19005,10 +18729,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 714 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.1125369292536007e-308 @@ -19022,10 +18746,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 715 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -19039,10 +18763,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 716 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.5 @@ -19056,10 +18780,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 717 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.5 @@ -19071,10 +18795,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 718 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -19086,10 +18810,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 727 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -19101,10 +18825,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 728 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -19116,10 +18840,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 729 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -19131,10 +18855,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 730 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -19146,10 +18870,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 731 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.450045585632324 @@ -19161,10 +18885,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 732 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 7.858890056610107 @@ -19176,10 +18900,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 733 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.7920545339584351 @@ -19191,10 +18915,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 734 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6157026886940002 @@ -19206,10 +18930,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 735 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5587586760520935 @@ -19221,10 +18945,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 736 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -19236,10 +18960,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 739 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -19251,10 +18975,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 740 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -19266,10 +18990,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 741 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -19282,10 +19006,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 742 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -19297,10 +19021,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 743 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -19312,10 +19036,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 744 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -19327,10 +19051,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 745 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -19342,10 +19066,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 746 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -19357,10 +19081,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 747 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -19373,10 +19097,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 748 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -19388,10 +19112,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 749 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -19403,10 +19127,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 750 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -19418,10 +19142,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 751 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -19433,10 +19157,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 752 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -19448,10 +19172,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 753 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -19463,10 +19187,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 754 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -19478,10 +19202,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 755 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -19493,10 +19217,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 756 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -19509,10 +19233,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 757 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -19525,10 +19249,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 758 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -19540,10 +19264,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 759 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -19556,10 +19280,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 760 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -19571,10 +19295,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 761 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -19587,10 +19311,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 762 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -19603,10 +19327,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 763 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -19620,10 +19344,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 764 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 5.877471754111438e-39 @@ -19637,10 +19361,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 765 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -19654,10 +19378,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 766 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -19668,10 +19392,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 778 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -19682,10 +19406,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 779 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -19696,10 +19420,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 780 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -19710,10 +19434,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 781 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -19724,10 +19448,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 782 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -19738,10 +19462,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 783 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -19752,10 +19476,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 784 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -19766,10 +19490,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 785 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -19780,10 +19504,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 786 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -19794,10 +19518,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 787 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -19808,10 +19532,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 790 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -19822,10 +19546,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 791 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -19838,10 +19562,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 792 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -19852,10 +19576,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 793 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -19866,10 +19590,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 794 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.313225746154785e-10 @@ -19880,10 +19604,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 795 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -9.313225746154785e-10 @@ -19894,10 +19618,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 796 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -19908,10 +19632,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 797 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -19922,10 +19646,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 798 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 8 @@ -19936,10 +19660,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 799 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -19950,10 +19674,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 808 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -19964,10 +19688,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 809 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -19978,10 +19702,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 810 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -19992,10 +19716,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 811 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -20006,10 +19730,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 812 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -20020,10 +19744,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 813 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -20034,10 +19758,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 814 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -20048,10 +19772,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 815 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -20062,10 +19786,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 816 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -20076,10 +19800,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 817 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -20090,10 +19814,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 820 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -20104,10 +19828,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 821 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -20120,10 +19844,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 822 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -20134,10 +19858,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 823 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -20148,10 +19872,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 824 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.313225746154785e-10 @@ -20162,10 +19886,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 825 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -9.313225746154785e-10 @@ -20176,10 +19900,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 826 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -20190,10 +19914,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 827 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -20204,10 +19928,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 828 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 8 @@ -20218,10 +19942,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 829 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -20232,10 +19956,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 841 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -20246,10 +19970,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 842 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -20260,10 +19984,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 843 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -20274,10 +19998,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 844 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -20288,10 +20012,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 845 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -20302,10 +20026,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 846 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -20316,10 +20040,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 847 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -20330,10 +20054,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 848 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -20344,10 +20068,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 849 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -20358,10 +20082,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 850 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -20372,10 +20096,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 853 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -20386,10 +20110,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 854 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -20402,10 +20126,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 855 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -20416,10 +20140,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 856 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -20430,10 +20154,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 857 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -20444,10 +20168,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 858 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -20458,10 +20182,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 859 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -20472,10 +20196,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 860 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -20486,10 +20210,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 861 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.0000152587890625 @@ -20500,10 +20224,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 862 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.0000152587890625 @@ -20514,10 +20238,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 863 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.9999923706054688 @@ -20528,10 +20252,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 864 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.9999923706054688 @@ -20542,10 +20266,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 865 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 7.888609052210118e-31 @@ -20556,10 +20280,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 866 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -7.888609052210118e-31 @@ -20570,10 +20294,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 867 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -20584,10 +20308,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 868 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -20598,10 +20322,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 869 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -20614,10 +20338,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 870 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -20628,10 +20352,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 871 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -20642,10 +20366,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 872 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -20656,10 +20380,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 873 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -20670,10 +20394,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 874 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -20684,10 +20408,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 875 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -20698,10 +20422,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 876 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.0000152587890625 @@ -20712,10 +20436,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 877 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.0000152587890625 @@ -20726,10 +20450,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 878 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.9999923706054688 @@ -20740,10 +20464,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 879 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.9999923706054688 @@ -20754,10 +20478,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 880 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 7.888609052210118e-31 @@ -20768,10 +20492,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 881 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -7.888609052210118e-31 @@ -20782,10 +20506,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 882 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -20796,10 +20520,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 883 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -20810,10 +20534,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 884 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -20826,10 +20550,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 885 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -20840,10 +20564,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 886 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -20854,10 +20578,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 887 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -20868,10 +20592,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 888 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -20882,10 +20606,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 889 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -20896,10 +20620,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 890 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -20910,10 +20634,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 891 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.0000152587890625 @@ -20924,10 +20648,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 892 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.0000152587890625 @@ -20938,10 +20662,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 893 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.9999923706054688 @@ -20952,10 +20676,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 894 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.9999923706054688 @@ -20966,10 +20690,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 895 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 7.888609052210118e-31 @@ -20980,10 +20704,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 896 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -7.888609052210118e-31 @@ -20994,10 +20718,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 897 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -21008,10 +20732,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 906 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -21022,10 +20746,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 907 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -21036,10 +20760,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 908 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -21050,10 +20774,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 909 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -21064,10 +20788,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 910 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -21078,10 +20802,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 911 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -21092,10 +20816,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 912 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -21106,10 +20830,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 913 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -21120,10 +20844,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 914 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -21134,10 +20858,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 915 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -21148,10 +20872,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 918 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -21162,10 +20886,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 919 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -21178,10 +20902,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 920 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -21192,10 +20916,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 921 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -21206,10 +20930,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 922 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -21220,10 +20944,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 923 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -21234,10 +20958,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 924 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -21248,10 +20972,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 925 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -21262,10 +20986,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 926 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.0000152587890625 @@ -21276,10 +21000,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 927 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.0000152587890625 @@ -21290,10 +21014,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 928 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.9999923706054688 @@ -21304,10 +21028,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 929 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.9999923706054688 @@ -21318,10 +21042,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 930 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 7.888609052210118e-31 @@ -21332,10 +21056,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 931 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -7.888609052210118e-31 @@ -21346,10 +21070,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 932 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -21360,10 +21084,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 933 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -21374,10 +21098,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 934 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -21390,10 +21114,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 935 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -21404,10 +21128,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 936 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -21418,10 +21142,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 937 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -21432,10 +21156,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 938 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -21446,10 +21170,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 939 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -21460,10 +21184,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 940 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -21474,10 +21198,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 941 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.0000152587890625 @@ -21488,10 +21212,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 942 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.0000152587890625 @@ -21502,10 +21226,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 943 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.9999923706054688 @@ -21516,10 +21240,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 944 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.9999923706054688 @@ -21530,10 +21254,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 945 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 7.888609052210118e-31 @@ -21544,10 +21268,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 946 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -7.888609052210118e-31 @@ -21558,10 +21282,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 947 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -21572,10 +21296,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 948 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -21586,10 +21310,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 949 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -21602,10 +21326,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 950 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -21616,10 +21340,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 951 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -21630,10 +21354,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 952 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -21644,10 +21368,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 953 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -21658,10 +21382,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 954 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -21672,10 +21396,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 955 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -21686,10 +21410,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 956 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.0000152587890625 @@ -21700,10 +21424,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 957 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.0000152587890625 @@ -21714,10 +21438,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 958 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.9999923706054688 @@ -21728,10 +21452,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 959 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.9999923706054688 @@ -21742,10 +21466,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 960 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 7.888609052210118e-31 @@ -21756,10 +21480,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 961 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -7.888609052210118e-31 @@ -21770,10 +21494,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 962 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -21784,10 +21508,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1073 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -21798,10 +21522,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1074 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -21812,10 +21536,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1075 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -21826,10 +21550,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1076 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -21840,10 +21564,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1077 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -21854,10 +21578,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1078 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -21868,10 +21592,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1079 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -21882,10 +21606,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1080 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -21896,10 +21620,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1081 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -21910,10 +21634,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1082 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -21924,10 +21648,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1085 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -21938,10 +21662,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1086 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -21952,10 +21676,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1087 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -21967,10 +21691,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1088 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -21981,10 +21705,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1089 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.862645149230957e-09 @@ -21995,10 +21719,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1092 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.862645149230957e-09 @@ -22009,10 +21733,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1093 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.1754943508222875e-38 @@ -22023,10 +21747,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1094 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.1754943508222875e-38 @@ -22037,10 +21761,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1095 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.401298464324817e-45 @@ -22051,10 +21775,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1096 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.401298464324817e-45 @@ -22065,10 +21789,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1097 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.802596928649634e-45 @@ -22079,10 +21803,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1098 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.2611686178923354e-44 @@ -22093,10 +21817,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1099 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.938735877055719e-39 @@ -22107,10 +21831,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1100 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 5.877471754111438e-39 @@ -22121,10 +21845,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1101 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.1754940705625946e-38 @@ -22135,10 +21859,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1102 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.1754942106924411e-38 @@ -22149,10 +21873,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1103 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.175494490952134e-38 @@ -22163,10 +21887,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1104 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.1754946310819804e-38 @@ -22177,10 +21901,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1105 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.3509880009953429e-38 @@ -22191,10 +21915,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1106 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.350988701644575e-38 @@ -22205,10 +21929,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1107 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.3509895424236536e-38 @@ -22219,10 +21943,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1108 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.70197740328915e-38 @@ -22233,10 +21957,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1109 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 7.450580596923828e-09 @@ -22247,10 +21971,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1110 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.000244140625 @@ -22261,10 +21985,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1111 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.00048828125 @@ -22275,10 +21999,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1112 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.0009765625 @@ -22289,10 +22013,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1113 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2.802596928649634e-45 @@ -22303,10 +22027,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1114 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.2611686178923354e-44 @@ -22317,10 +22041,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1115 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2.938735877055719e-39 @@ -22331,10 +22055,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1116 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -5.877471754111438e-39 @@ -22345,10 +22069,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1117 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.1754940705625946e-38 @@ -22359,10 +22083,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1118 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.1754942106924411e-38 @@ -22373,10 +22097,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1119 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.175494490952134e-38 @@ -22387,10 +22111,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1120 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.1754946310819804e-38 @@ -22401,10 +22125,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1121 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2.3509880009953429e-38 @@ -22415,10 +22139,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1122 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2.350988701644575e-38 @@ -22429,10 +22153,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1123 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2.3509895424236536e-38 @@ -22443,10 +22167,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1124 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -4.70197740328915e-38 @@ -22457,10 +22181,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1125 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -7.450580596923828e-09 @@ -22471,10 +22195,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1126 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.000244140625 @@ -22485,10 +22209,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1127 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.00048828125 @@ -22499,10 +22223,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1128 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.0009765625 @@ -22513,10 +22237,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1129 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 255.99993896484375 @@ -22527,10 +22251,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1132 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 5033165 @@ -22541,10 +22265,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1133 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 421657440 @@ -22555,10 +22279,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1134 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2147483392 @@ -22569,10 +22293,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1135 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 68719476736 @@ -22583,10 +22307,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1136 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 549755813888 @@ -22597,10 +22321,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1137 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f32.MAX_VALUE @@ -22611,10 +22335,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1138 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -255.99993896484375 @@ -22625,10 +22349,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1139 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -5033165 @@ -22639,10 +22363,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1140 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -421657440 @@ -22653,10 +22377,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1141 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2147483392 @@ -22667,10 +22391,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1142 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -68719476736 @@ -22681,10 +22405,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1143 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -549755813888 @@ -22695,10 +22419,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1144 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f32.MAX_VALUE @@ -22710,10 +22434,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1145 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -22724,10 +22448,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1156 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -22738,10 +22462,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1157 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -22752,10 +22476,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1158 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -22766,10 +22490,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1159 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -22780,10 +22504,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1160 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -22794,10 +22518,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1161 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -22808,10 +22532,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1162 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -22822,10 +22546,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1163 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -22836,10 +22560,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1164 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -22850,10 +22574,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1165 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -22864,10 +22588,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1168 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -22878,10 +22602,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1169 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -22892,10 +22616,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1170 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -22907,10 +22631,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1171 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -22921,10 +22645,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1172 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -22935,10 +22659,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1181 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -22949,10 +22673,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1182 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -22963,10 +22687,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1183 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -22977,10 +22701,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1184 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -22991,10 +22715,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1185 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -23005,10 +22729,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1186 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -23019,10 +22743,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1187 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -23033,10 +22757,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1188 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -23047,10 +22771,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1189 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -23061,10 +22785,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1190 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -23075,10 +22799,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1193 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -23089,10 +22813,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1194 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -23103,10 +22827,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1195 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -23118,10 +22842,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1196 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -23132,10 +22856,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1197 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -23146,10 +22870,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1209 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -23160,10 +22884,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1210 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -23174,10 +22898,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1211 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -23188,10 +22912,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1212 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -23202,10 +22926,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1213 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -23216,10 +22940,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1214 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -23230,10 +22954,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1215 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -23244,10 +22968,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1216 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -23258,10 +22982,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1217 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -23272,10 +22996,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1218 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -23286,10 +23010,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1221 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -23300,10 +23024,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1222 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -23314,10 +23038,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1223 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -23328,10 +23052,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1224 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -23342,10 +23066,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1225 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -23357,10 +23081,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1226 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -23371,10 +23095,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1227 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.0397214889526365 @@ -23385,10 +23109,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1228 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.0397214889526365 @@ -23399,10 +23123,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1229 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.0397210121154785 @@ -23413,10 +23137,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1230 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.0397214889526367 @@ -23427,10 +23151,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1231 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f64.MIN_VALUE @@ -23441,10 +23165,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1234 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f64.MIN_VALUE @@ -23456,10 +23180,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1235 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 4649454530587146735 @@ -23473,10 +23197,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1237 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 4649454530587146736 @@ -23490,10 +23214,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1244 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -4573606559926636463 @@ -23508,10 +23232,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1245 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -4573606559926636462 @@ -23526,10 +23250,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1252 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -4573929700241785646 @@ -23543,10 +23267,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1259 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -4573929700241785645 @@ -23562,10 +23286,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1266 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 4602685064124656555 @@ -23579,10 +23303,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1273 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 4603836184166978885 @@ -23596,10 +23320,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1280 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 4605718951180848880 @@ -23613,10 +23337,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1287 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 4605835761386121865 @@ -23630,10 +23354,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1293 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 4610006203169397430 @@ -23647,10 +23371,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1299 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 4610219797808568955 @@ -23664,10 +23388,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1305 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 4619182163989041060 @@ -23681,10 +23405,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1312 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 4622394943780502425 @@ -23698,10 +23422,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1319 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 4622613550143616215 @@ -23715,10 +23439,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1326 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 4622829325869063755 @@ -23732,10 +23456,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1333 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 4645970351893354075 @@ -23749,10 +23473,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1340 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 4647695036380671130 @@ -23766,10 +23490,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1347 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -4819432143425896336 @@ -23783,10 +23507,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1354 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -4819256221565452171 @@ -23800,10 +23524,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1361 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -23814,10 +23538,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1375 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -23828,10 +23552,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1376 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -23842,10 +23566,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1377 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -23856,10 +23580,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1378 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -23870,10 +23594,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1379 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -23884,10 +23608,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1380 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -23898,10 +23622,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1381 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -23912,10 +23636,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1382 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -23926,10 +23650,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1383 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -23940,10 +23664,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1384 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -23954,10 +23678,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1387 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -23968,10 +23692,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1388 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -23982,10 +23706,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1389 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -23996,10 +23720,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1390 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -24010,10 +23734,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1391 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -24025,10 +23749,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1392 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -24039,10 +23763,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1393 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 88.72283172607422 @@ -24053,10 +23777,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1394 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 88.72283935546875 @@ -24069,10 +23793,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1395 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -103.97207641601562 @@ -24085,10 +23809,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1396 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -103.97208404541016 @@ -24101,10 +23825,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1397 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.3465735614299774 @@ -24115,10 +23839,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1398 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.3465735912322998 @@ -24129,10 +23853,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1399 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.3465736210346222 @@ -24143,10 +23867,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1400 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -24157,10 +23881,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1412 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -24171,10 +23895,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1413 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -24185,10 +23909,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1414 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -24199,10 +23923,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1415 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -24213,10 +23937,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1416 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -24227,10 +23951,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1417 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -24241,10 +23965,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1418 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -24255,10 +23979,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1419 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -24269,10 +23993,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1420 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -24283,10 +24007,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1421 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -24297,10 +24021,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1424 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -24311,10 +24035,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1425 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -24325,10 +24049,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1426 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -24339,10 +24063,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1427 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -24353,10 +24077,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1428 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -24368,10 +24092,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1429 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -24382,10 +24106,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1430 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.225073858507201e-308 @@ -24398,10 +24122,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1431 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -2.225073858507201e-308 @@ -24414,10 +24138,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1432 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -24428,10 +24152,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1441 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -24442,10 +24166,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1442 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -24456,10 +24180,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1443 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -24470,10 +24194,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1444 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -24484,10 +24208,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1445 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -24498,10 +24222,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1446 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -24512,10 +24236,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1447 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -24526,10 +24250,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1448 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -24540,10 +24264,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1449 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -24554,10 +24278,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1450 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -24568,10 +24292,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1453 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -24582,10 +24306,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1454 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -24596,10 +24320,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1455 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -24610,10 +24334,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1456 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -24624,10 +24348,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1457 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -24639,10 +24363,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1458 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -24653,10 +24377,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1459 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -24667,10 +24391,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1471 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -24681,10 +24405,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1472 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -24695,10 +24419,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1473 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -24709,10 +24433,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1474 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -24723,10 +24447,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1475 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -24737,10 +24461,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1476 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -24751,10 +24475,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1477 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -24765,10 +24489,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1478 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -24779,10 +24503,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1479 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -24793,10 +24517,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1480 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -24807,10 +24531,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1483 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -24821,10 +24545,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1484 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -24837,10 +24561,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1485 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -24851,10 +24575,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1486 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -24865,10 +24589,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1487 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -24879,10 +24603,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1488 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -24893,10 +24617,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1489 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -24907,10 +24631,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1490 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -24921,10 +24645,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1491 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.0000152587890625 @@ -24935,10 +24659,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1492 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.0000152587890625 @@ -24949,10 +24673,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1493 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.9999923706054688 @@ -24963,10 +24687,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1494 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.9999923706054688 @@ -24977,10 +24701,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1495 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 7.888609052210118e-31 @@ -24991,10 +24715,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1496 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -7.888609052210118e-31 @@ -25005,10 +24729,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1497 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -25019,10 +24743,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1506 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -25033,10 +24757,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1507 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -25047,10 +24771,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1508 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -25061,10 +24785,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1509 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -25075,10 +24799,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1510 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -25089,10 +24813,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1511 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -25103,10 +24827,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1512 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -25117,10 +24841,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1513 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -25131,10 +24855,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1514 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -25145,10 +24869,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1515 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -25159,10 +24883,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1518 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -25173,10 +24897,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1519 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -25189,10 +24913,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1520 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -25203,10 +24927,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1521 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -25217,10 +24941,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1522 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -25231,10 +24955,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1523 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -25245,10 +24969,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1524 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -25259,10 +24983,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1525 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -25273,10 +24997,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1526 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.0000152587890625 @@ -25287,10 +25011,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1527 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.0000152587890625 @@ -25301,10 +25025,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1528 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.9999923706054688 @@ -25315,10 +25039,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1529 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.9999923706054688 @@ -25329,10 +25053,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1530 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 7.888609052210118e-31 @@ -25343,10 +25067,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1531 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -7.888609052210118e-31 @@ -25357,10 +25081,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1532 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -25372,10 +25096,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1544 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -25387,10 +25111,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1545 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -25402,10 +25126,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1546 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -25417,10 +25141,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1547 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -25432,10 +25156,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1548 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.450045556060236 @@ -25447,10 +25171,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1549 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 7.858890253041697 @@ -25462,10 +25186,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1550 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.792054511984896 @@ -25477,10 +25201,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1551 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.615702673197924 @@ -25492,10 +25216,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1552 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5587586823609152 @@ -25507,10 +25231,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1553 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 3 @@ -25522,10 +25246,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1556 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -3 @@ -25537,10 +25261,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1557 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4 @@ -25552,10 +25276,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1558 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4 @@ -25567,10 +25291,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1559 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -3 @@ -25582,10 +25306,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1560 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1797693134862315708145274e284 @@ -25597,10 +25321,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1561 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1797693134862315708145274e284 @@ -25612,10 +25336,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1562 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 5e-324 @@ -25627,10 +25351,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1563 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 5e-324 @@ -25642,10 +25366,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1564 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -25657,10 +25381,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1565 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -25672,10 +25396,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1566 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -25687,10 +25411,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1567 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -25702,10 +25426,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1568 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -25718,10 +25442,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1569 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -25734,10 +25458,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1570 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -25750,10 +25474,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1571 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -25766,10 +25490,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1572 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -25781,10 +25505,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1573 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -25796,10 +25520,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1574 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -25811,10 +25535,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1583 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -25826,10 +25550,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1584 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -25841,10 +25565,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1585 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -25856,10 +25580,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1586 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -25871,10 +25595,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1587 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.450045585632324 @@ -25886,10 +25610,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1588 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 7.858890056610107 @@ -25901,10 +25625,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1589 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.7920545339584351 @@ -25916,10 +25640,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1590 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6157026886940002 @@ -25931,10 +25655,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1591 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5587586760520935 @@ -25946,10 +25670,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1592 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 3 @@ -25961,10 +25685,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1595 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -3 @@ -25976,10 +25700,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1596 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4 @@ -25991,10 +25715,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1597 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4 @@ -26006,10 +25730,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1598 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -3 @@ -26021,10 +25745,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1599 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 3402823466385288598117041e14 @@ -26036,10 +25760,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1600 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 3402823466385288598117041e14 @@ -26051,10 +25775,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1601 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.401298464324817e-45 @@ -26066,10 +25790,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1602 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.401298464324817e-45 @@ -26081,10 +25805,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1603 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -26096,10 +25820,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1604 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -26111,10 +25835,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1605 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -26126,10 +25850,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1606 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -26141,10 +25865,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1607 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -26157,10 +25881,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1608 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -26173,10 +25897,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1609 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -26189,10 +25913,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1610 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -26205,10 +25929,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1611 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -26220,10 +25944,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1612 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -26235,10 +25959,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1613 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -26249,10 +25973,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1625 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -26263,10 +25987,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1626 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -26277,10 +26001,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1627 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -26291,10 +26015,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1628 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -26305,10 +26029,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1629 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -26319,10 +26043,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1630 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -26333,10 +26057,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1631 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -26347,10 +26071,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1632 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -26361,10 +26085,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1633 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -26375,10 +26099,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1634 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -26390,10 +26114,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1637 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -26405,10 +26129,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1638 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -7.888609052210118e-31 @@ -26419,10 +26143,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1639 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -26433,10 +26157,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1640 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -26447,10 +26171,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1641 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -26461,10 +26185,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1642 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -26476,10 +26200,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1643 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -26490,10 +26214,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1644 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -26505,10 +26229,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1653 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -26520,10 +26244,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1654 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -7.888609052210118e-31 @@ -26534,10 +26258,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1655 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -26548,10 +26272,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1656 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -26562,10 +26286,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1657 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -26576,10 +26300,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1658 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -26591,10 +26315,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1659 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -26605,10 +26329,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1660 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -26620,10 +26344,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1663 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -26635,10 +26359,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1664 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -7.888609052210118e-31 @@ -26649,10 +26373,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1665 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -26663,10 +26387,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1666 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -26677,10 +26401,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1667 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -26691,10 +26415,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1668 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -26706,10 +26430,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1669 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -26720,10 +26444,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1670 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -26734,10 +26458,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1682 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -26748,10 +26472,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1683 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -26762,10 +26486,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1684 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -26776,10 +26500,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1685 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -26790,10 +26514,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1686 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -26804,10 +26528,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1687 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -26818,10 +26542,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1688 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -26832,10 +26556,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1689 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -26846,10 +26570,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1690 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -26860,10 +26584,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1691 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -26875,10 +26599,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1694 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -26890,10 +26614,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1695 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -7.888609052210118e-31 @@ -26904,10 +26628,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1696 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -26918,10 +26642,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1697 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -26932,10 +26656,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1698 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -26946,10 +26670,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1699 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -26961,10 +26685,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1700 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -26975,10 +26699,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1701 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -26989,10 +26713,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1710 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -27003,10 +26727,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1711 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -27017,10 +26741,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1712 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -27031,10 +26755,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1713 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -27045,10 +26769,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1714 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -27059,10 +26783,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1715 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -27073,10 +26797,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1716 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -27087,10 +26811,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1717 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -27101,10 +26825,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1718 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -27115,10 +26839,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1719 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -27130,10 +26854,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1722 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -27145,10 +26869,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1723 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -7.888609052210118e-31 @@ -27159,10 +26883,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1724 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -27173,10 +26897,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1725 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -27187,10 +26911,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1726 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -27201,10 +26925,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1727 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -27216,10 +26940,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1728 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -27230,10 +26954,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1729 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -27244,10 +26968,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1741 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -27258,10 +26982,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1742 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -27272,10 +26996,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1743 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -27286,10 +27010,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1744 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -27300,10 +27024,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1745 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -27314,10 +27038,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1746 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -27328,10 +27052,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1747 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -27342,10 +27066,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1748 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -27356,10 +27080,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1749 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -27370,10 +27094,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1750 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -27384,10 +27108,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1753 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -27398,10 +27122,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1754 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -7.888609052210118e-31 @@ -27412,10 +27136,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1755 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -27426,10 +27150,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1756 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -27441,10 +27165,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1757 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -27455,10 +27179,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1758 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -27470,10 +27194,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1759 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -27484,10 +27208,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1760 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -27498,10 +27222,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1769 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -27512,10 +27236,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1770 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -27526,10 +27250,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1771 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -27540,10 +27264,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1772 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -27554,10 +27278,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1773 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -27568,10 +27292,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1774 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -27582,10 +27306,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1775 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -27596,10 +27320,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1776 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -27610,10 +27334,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1777 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -27624,10 +27348,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1778 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -27638,10 +27362,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1781 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -27652,10 +27376,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1782 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -7.888609052210118e-31 @@ -27666,10 +27390,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1783 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -27680,10 +27404,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1784 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -27695,10 +27419,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1785 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -27709,10 +27433,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1786 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -27724,10 +27448,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1787 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -27738,10 +27462,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1788 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.1754942106924411e-38 @@ -27754,10 +27478,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1789 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -27768,10 +27492,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1801 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -27782,10 +27506,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1802 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -27796,10 +27520,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1803 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -27810,10 +27534,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1804 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -27824,10 +27548,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1805 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -27838,10 +27562,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1806 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -27852,10 +27576,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1807 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -27866,10 +27590,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1808 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -27880,10 +27604,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1809 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -27894,10 +27618,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1810 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -27909,10 +27633,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1813 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -27924,10 +27648,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1814 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -7.888609052210118e-31 @@ -27938,10 +27662,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1815 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -27952,10 +27676,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1816 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -27966,10 +27690,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1817 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -27980,10 +27704,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1818 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -27995,10 +27719,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1819 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -28009,10 +27733,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1820 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -28023,10 +27747,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1829 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -28037,10 +27761,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1830 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -28051,10 +27775,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1831 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -28065,10 +27789,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1832 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -28079,10 +27803,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1833 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -28093,10 +27817,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1834 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -28107,10 +27831,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1835 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -28121,10 +27845,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1836 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -28135,10 +27859,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1837 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -28149,10 +27873,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1838 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -28164,10 +27888,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1841 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -28179,10 +27903,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1842 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -7.888609052210118e-31 @@ -28193,10 +27917,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1843 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -28207,10 +27931,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1844 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -28221,10 +27945,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1845 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -28235,10 +27959,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1846 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -28250,10 +27974,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1847 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -28264,10 +27988,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1848 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -28279,10 +28003,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1860 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -28294,10 +28018,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1861 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -28309,10 +28033,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1862 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -28324,10 +28048,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1863 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -28339,10 +28063,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1864 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.450045556060236 @@ -28354,10 +28078,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1865 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 7.858890253041697 @@ -28369,10 +28093,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1866 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.792054511984896 @@ -28384,10 +28108,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1867 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.615702673197924 @@ -28399,10 +28123,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1868 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5587586823609152 @@ -28414,10 +28138,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1869 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -28429,10 +28153,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1872 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -28444,10 +28168,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1873 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -28459,10 +28183,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1874 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -28474,10 +28198,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1875 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -28489,10 +28213,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1876 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -28504,10 +28228,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1877 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -28519,10 +28243,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1878 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -28535,10 +28259,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1879 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -28550,10 +28274,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1880 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -28565,10 +28289,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1881 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -28580,10 +28304,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1882 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -28595,10 +28319,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1883 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -28610,10 +28334,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1884 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -28625,10 +28349,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1885 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -28640,10 +28364,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1886 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -28655,10 +28379,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1887 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -28671,10 +28395,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1888 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -28686,10 +28410,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1889 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -28701,10 +28425,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1890 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -28716,10 +28440,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1891 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -28731,10 +28455,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1892 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -28747,10 +28471,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1893 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -28762,10 +28486,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1894 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -28777,10 +28501,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1895 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -28792,10 +28516,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1896 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -28807,10 +28531,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1897 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -28823,10 +28547,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1898 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -28838,10 +28562,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1899 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -28853,10 +28577,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1900 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -28868,10 +28592,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1901 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -28883,10 +28607,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1902 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -28899,10 +28623,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1903 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -28914,10 +28638,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1904 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -28929,10 +28653,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1905 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -28944,10 +28668,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1906 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -28960,10 +28684,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1907 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -28975,10 +28699,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1908 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -28990,10 +28714,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1909 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -29005,10 +28729,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1910 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -29020,10 +28744,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1911 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -29036,10 +28760,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1912 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -29052,10 +28776,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1913 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -29068,10 +28792,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1914 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -29083,10 +28807,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1915 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -29098,10 +28822,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1916 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -29113,10 +28837,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1917 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -29128,10 +28852,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1918 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -29143,10 +28867,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1919 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -29158,10 +28882,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1920 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -29174,10 +28898,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1921 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -29190,10 +28914,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1922 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -29206,10 +28930,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1923 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -29222,10 +28946,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1924 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -29240,10 +28964,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1925 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.75 @@ -29255,10 +28979,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1926 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.75 @@ -29270,10 +28994,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1927 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.75 @@ -29285,10 +29009,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1928 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.75 @@ -29300,10 +29024,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1929 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -29315,10 +29039,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1938 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -29330,10 +29054,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1939 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -29345,10 +29069,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1940 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -29360,10 +29084,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1941 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -29375,10 +29099,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1942 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.450045585632324 @@ -29390,10 +29114,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1943 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 7.858890056610107 @@ -29405,10 +29129,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1944 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.7920545339584351 @@ -29420,10 +29144,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1945 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6157026886940002 @@ -29435,10 +29159,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1946 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5587586760520935 @@ -29450,10 +29174,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1947 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -29465,10 +29189,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1950 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -29480,10 +29204,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1951 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -29495,10 +29219,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1952 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -29510,10 +29234,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1953 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -29525,10 +29249,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1954 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -29540,10 +29264,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1955 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -29555,10 +29279,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1956 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -29571,10 +29295,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1957 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -29586,10 +29310,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1958 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -29601,10 +29325,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1959 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -29616,10 +29340,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1960 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -29631,10 +29355,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1961 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -29646,10 +29370,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1962 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -29661,10 +29385,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1963 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -29676,10 +29400,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1964 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -29691,10 +29415,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1965 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -29707,10 +29431,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1966 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -29722,10 +29446,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1967 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -29737,10 +29461,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1968 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -29752,10 +29476,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1969 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -29767,10 +29491,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1970 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -29783,10 +29507,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1971 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -29798,10 +29522,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1972 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -29813,10 +29537,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1973 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -29828,10 +29552,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1974 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -29843,10 +29567,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1975 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -29859,10 +29583,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1976 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -29874,10 +29598,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1977 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -29889,10 +29613,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1978 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -29904,10 +29628,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1979 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -29919,10 +29643,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1980 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -29935,10 +29659,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1981 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -29950,10 +29674,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1982 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -29965,10 +29689,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1983 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -29980,10 +29704,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1984 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -29996,10 +29720,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1985 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -30011,10 +29735,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1986 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -30026,10 +29750,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1987 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -30041,10 +29765,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1988 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -30056,10 +29780,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1989 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -30072,10 +29796,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1990 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -30088,10 +29812,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1991 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -30104,10 +29828,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1992 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -30119,10 +29843,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1993 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -30134,10 +29858,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1994 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -30149,10 +29873,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1995 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -30164,10 +29888,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1996 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -30179,10 +29903,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1997 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -30194,10 +29918,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1998 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -30210,10 +29934,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 1999 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -30226,10 +29950,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2000 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -30242,10 +29966,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2001 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -30258,10 +29982,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2002 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -30276,10 +30000,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2003 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.75 @@ -30291,10 +30015,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2004 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.75 @@ -30306,10 +30030,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2005 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.75 @@ -30321,10 +30045,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2006 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.75 @@ -30336,10 +30060,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2007 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -30351,10 +30075,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2019 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -30366,10 +30090,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2020 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -30381,10 +30105,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2021 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -30396,10 +30120,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2022 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -30411,10 +30135,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2023 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.450045556060236 @@ -30426,10 +30150,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2024 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 7.858890253041697 @@ -30441,10 +30165,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2025 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.792054511984896 @@ -30456,10 +30180,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2026 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.615702673197924 @@ -30471,10 +30195,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2027 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5587586823609152 @@ -30486,10 +30210,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2028 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -30501,10 +30225,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2031 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -30516,10 +30240,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2032 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -30531,10 +30255,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2033 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -30546,10 +30270,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2034 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -30561,10 +30285,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2035 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -30576,10 +30300,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2036 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -30591,10 +30315,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2037 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -30608,10 +30332,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2038 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -30623,10 +30347,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2039 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -30638,10 +30362,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2040 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -30653,10 +30377,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2041 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -30668,10 +30392,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2042 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -30683,10 +30407,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2043 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -30698,10 +30422,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2044 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -30713,10 +30437,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2045 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -30728,10 +30452,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2046 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -30745,10 +30469,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2047 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -30760,10 +30484,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2048 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -30775,10 +30499,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2049 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -30790,10 +30514,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2050 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -30805,10 +30529,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2051 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -30822,10 +30546,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2052 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -30837,10 +30561,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2053 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -30852,10 +30576,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2054 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -30867,10 +30591,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2055 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -30882,10 +30606,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2056 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -30899,10 +30623,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2057 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -30914,10 +30638,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2058 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -30929,10 +30653,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2059 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -30944,10 +30668,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2060 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -30959,10 +30683,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2061 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -30976,10 +30700,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2062 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -30991,10 +30715,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2063 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -31006,10 +30730,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2064 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -31021,10 +30745,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2065 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -31038,10 +30762,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2066 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -31053,10 +30777,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2067 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -31068,10 +30792,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2068 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -31083,10 +30807,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2069 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -31098,10 +30822,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2070 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -31115,10 +30839,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2071 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -31132,10 +30856,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2072 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -31148,10 +30872,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2073 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -31163,10 +30887,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2074 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -31178,10 +30902,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2075 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -31193,10 +30917,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2076 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -31208,10 +30932,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2077 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -31223,10 +30947,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2078 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -31238,10 +30962,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2079 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -31255,10 +30979,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2080 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -31272,10 +30996,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2081 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -31289,10 +31013,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2082 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -31306,10 +31030,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2083 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -31324,10 +31048,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2084 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.75 @@ -31339,10 +31063,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2085 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.75 @@ -31354,10 +31078,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2086 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.75 @@ -31369,10 +31093,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2087 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.75 @@ -31384,10 +31108,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2088 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -31399,10 +31123,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2097 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -31414,10 +31138,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2098 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -31429,10 +31153,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2099 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -31444,10 +31168,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2100 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -31459,10 +31183,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2101 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.450045585632324 @@ -31474,10 +31198,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2102 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 7.858890056610107 @@ -31489,10 +31213,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2103 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.7920545339584351 @@ -31504,10 +31228,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2104 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6157026886940002 @@ -31519,10 +31243,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2105 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5587586760520935 @@ -31534,10 +31258,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2106 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -31549,10 +31273,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2109 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -31564,10 +31288,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2110 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -31579,10 +31303,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2111 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -31594,10 +31318,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2112 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -31609,10 +31333,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2113 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -31624,10 +31348,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2114 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -31639,10 +31363,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2115 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -31656,10 +31380,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2116 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -31671,10 +31395,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2117 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -31686,10 +31410,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2118 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -31701,10 +31425,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2119 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -31716,10 +31440,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2120 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -31731,10 +31455,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2121 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -31746,10 +31470,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2122 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -31761,10 +31485,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2123 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -31776,10 +31500,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2124 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -31793,10 +31517,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2125 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -31808,10 +31532,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2126 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -31823,10 +31547,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2127 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -31838,10 +31562,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2128 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -31853,10 +31577,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2129 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -31870,10 +31594,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2130 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -31885,10 +31609,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2131 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -31900,10 +31624,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2132 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -31915,10 +31639,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2133 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -31930,10 +31654,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2134 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -31947,10 +31671,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2135 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -31962,10 +31686,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2136 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -31977,10 +31701,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2137 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -31992,10 +31716,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2138 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -32007,10 +31731,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2139 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -32024,10 +31748,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2140 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -32039,10 +31763,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2141 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -32054,10 +31778,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2142 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -32069,10 +31793,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2143 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -32086,10 +31810,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2144 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -32101,10 +31825,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2145 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -32116,10 +31840,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2146 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -32131,10 +31855,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2147 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -32146,10 +31870,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2148 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -32163,10 +31887,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2149 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -32180,10 +31904,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2150 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -32196,10 +31920,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2151 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -32211,10 +31935,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2152 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -32226,10 +31950,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2153 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -32241,10 +31965,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2154 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -32256,10 +31980,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2155 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -32271,10 +31995,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2156 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -32286,10 +32010,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2157 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -32303,10 +32027,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2158 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -32320,10 +32044,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2159 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -32337,10 +32061,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2160 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -32354,10 +32078,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2161 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -32372,10 +32096,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2162 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.75 @@ -32387,10 +32111,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2163 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.75 @@ -32402,10 +32126,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2164 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.75 @@ -32417,10 +32141,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2165 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.75 @@ -32432,10 +32156,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2166 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -32447,10 +32171,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2180 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -32462,10 +32186,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2181 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -32477,10 +32201,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2182 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -32492,10 +32216,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2183 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -32507,10 +32231,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2184 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.450045556060236 @@ -32522,10 +32246,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2185 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 7.858890253041697 @@ -32537,10 +32261,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2186 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.792054511984896 @@ -32552,10 +32276,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2187 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.615702673197924 @@ -32567,10 +32291,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2188 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5587586823609152 @@ -32582,10 +32306,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2189 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -32597,10 +32321,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2192 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -32612,10 +32336,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2193 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -32627,10 +32351,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2194 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -32642,10 +32366,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2195 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -32657,10 +32381,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2196 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -32672,10 +32396,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2197 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.5 @@ -32687,10 +32411,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2198 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.5 @@ -32702,10 +32426,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2199 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2 @@ -32717,10 +32441,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2200 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -2 @@ -32732,10 +32456,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2201 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -32747,10 +32471,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2202 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -32763,10 +32487,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2203 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -32778,10 +32502,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2204 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -32793,10 +32517,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2205 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -32808,10 +32532,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2206 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -32823,10 +32547,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2207 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -32838,10 +32562,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2208 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -32853,10 +32577,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2209 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -32868,10 +32592,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2210 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.5 @@ -32883,10 +32607,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2211 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.5 @@ -32898,10 +32622,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2212 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2 @@ -32913,10 +32637,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2213 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -2 @@ -32928,10 +32652,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2214 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -32943,10 +32667,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2215 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -32959,10 +32683,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2216 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -32974,10 +32698,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2217 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -32989,10 +32713,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2218 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -33004,10 +32728,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2219 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -33019,10 +32743,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2220 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -33035,10 +32759,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2221 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -33050,10 +32774,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2222 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -33065,10 +32789,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2223 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -33080,10 +32804,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2224 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -33095,10 +32819,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2225 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -33111,10 +32835,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2226 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -33126,10 +32850,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2227 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -33141,10 +32865,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2228 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -33156,10 +32880,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2229 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -33171,10 +32895,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2230 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -33187,10 +32911,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2231 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -33202,10 +32926,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2232 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -33217,10 +32941,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2233 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -33232,10 +32956,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2234 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -33248,10 +32972,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2235 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -33263,10 +32987,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2236 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -33278,10 +33002,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2237 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -33293,10 +33017,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2238 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -33308,10 +33032,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2239 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -33324,10 +33048,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2240 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -33340,10 +33064,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2241 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -33356,10 +33080,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2242 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -33371,10 +33095,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2243 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -33386,10 +33110,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2244 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -33401,10 +33125,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2245 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -33416,10 +33140,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2246 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -33431,10 +33155,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2247 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -33446,10 +33170,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2248 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -33462,10 +33186,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2249 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -33478,10 +33202,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2250 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -33494,10 +33218,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2251 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -33510,10 +33234,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2252 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -33527,10 +33251,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2253 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.75 @@ -33542,10 +33266,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2254 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.75 @@ -33557,10 +33281,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2255 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.75 @@ -33572,10 +33296,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2256 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.75 @@ -33587,10 +33311,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2257 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -33602,10 +33326,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2266 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -33617,10 +33341,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2267 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -33632,10 +33356,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2268 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -33647,10 +33371,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2269 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -33662,10 +33386,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2270 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.450045585632324 @@ -33677,10 +33401,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2271 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 7.858890056610107 @@ -33692,10 +33416,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2272 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.7920545339584351 @@ -33707,10 +33431,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2273 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6157026886940002 @@ -33722,10 +33446,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2274 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5587586760520935 @@ -33737,10 +33461,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2275 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -33752,10 +33476,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2278 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -33767,10 +33491,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2279 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -33782,10 +33506,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2280 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -33797,10 +33521,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2281 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -33812,10 +33536,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2282 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -33827,10 +33551,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2283 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.5 @@ -33842,10 +33566,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2284 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.5 @@ -33857,10 +33581,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2285 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2 @@ -33872,10 +33596,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2286 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2 @@ -33887,10 +33611,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2287 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -33902,10 +33626,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2288 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -33918,10 +33642,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2289 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -33933,10 +33657,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2290 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -33948,10 +33672,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2291 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -33963,10 +33687,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2292 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -33978,10 +33702,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2293 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -33993,10 +33717,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2294 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -34008,10 +33732,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2295 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -34023,10 +33747,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2296 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.5 @@ -34038,10 +33762,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2297 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.5 @@ -34053,10 +33777,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2298 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2 @@ -34068,10 +33792,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2299 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2 @@ -34083,10 +33807,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2300 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -34098,10 +33822,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2301 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -34114,10 +33838,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2302 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -34129,10 +33853,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2303 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -34144,10 +33868,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2304 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -34159,10 +33883,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2305 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -34174,10 +33898,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2306 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -34190,10 +33914,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2307 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -34205,10 +33929,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2308 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -34220,10 +33944,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2309 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -34235,10 +33959,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2310 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -34250,10 +33974,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2311 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -34266,10 +33990,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2312 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -34281,10 +34005,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2313 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -34296,10 +34020,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2314 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -34311,10 +34035,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2315 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -34326,10 +34050,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2316 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -34342,10 +34066,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2317 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -34357,10 +34081,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2318 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -34372,10 +34096,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2319 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -34387,10 +34111,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2320 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -34403,10 +34127,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2321 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -34418,10 +34142,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2322 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -34433,10 +34157,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2323 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -34448,10 +34172,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2324 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -34463,10 +34187,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2325 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -34479,10 +34203,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2326 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -34495,10 +34219,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2327 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -34511,10 +34235,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2328 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -34526,10 +34250,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2329 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -34541,10 +34265,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2330 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -34556,10 +34280,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2331 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -34571,10 +34295,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2332 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -34586,10 +34310,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2333 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -34601,10 +34325,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2334 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -34617,10 +34341,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2335 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -34633,10 +34357,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2336 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -34649,10 +34373,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2337 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -34665,10 +34389,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2338 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -34682,10 +34406,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2339 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.75 @@ -34697,10 +34421,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2340 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.75 @@ -34712,10 +34436,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2341 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.75 @@ -34727,10 +34451,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2342 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.75 @@ -34742,10 +34466,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2343 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -34757,10 +34481,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2355 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -34772,10 +34496,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2356 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -34787,10 +34511,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2357 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -34802,10 +34526,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2358 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -34817,10 +34541,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2359 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.450045556060236 @@ -34832,10 +34556,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2360 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 7.858890253041697 @@ -34847,10 +34571,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2361 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.792054511984896 @@ -34862,10 +34586,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2362 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.615702673197924 @@ -34877,10 +34601,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2363 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5587586823609152 @@ -34892,10 +34616,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2364 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -34907,10 +34631,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2367 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -34922,10 +34646,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2368 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -34937,10 +34661,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2369 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -34952,10 +34676,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2370 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -34967,10 +34691,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2371 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -34982,10 +34706,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2372 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -34997,10 +34721,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2373 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -35012,10 +34736,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2374 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -35027,10 +34751,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2375 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -35042,10 +34766,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2376 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -35057,10 +34781,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2377 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -35072,10 +34796,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2378 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -35087,10 +34811,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2379 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -35103,10 +34827,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2380 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -35118,10 +34842,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2381 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -35133,10 +34857,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2382 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -35148,10 +34872,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2383 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -35163,10 +34887,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2384 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -35178,10 +34902,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2385 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -35193,10 +34917,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2386 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -35208,10 +34932,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2387 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -35223,10 +34947,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2388 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -35238,10 +34962,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2389 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -35254,10 +34978,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2390 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -35269,10 +34993,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2391 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -35285,10 +35009,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2392 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -35300,10 +35024,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2393 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -35316,10 +35040,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2394 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -35331,10 +35055,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2395 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -35346,10 +35070,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2396 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -35362,10 +35086,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2397 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -35377,10 +35101,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2398 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -35392,10 +35116,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2399 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -35407,10 +35131,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2400 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -35422,10 +35146,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2401 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -35437,10 +35161,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2402 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -35453,10 +35177,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2403 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -35468,10 +35192,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2404 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -35483,10 +35207,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2405 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -35498,10 +35222,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2406 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -35513,10 +35237,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2407 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -35528,10 +35252,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2408 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -35544,10 +35268,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2409 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -35559,10 +35283,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2410 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -35574,10 +35298,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2411 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -35589,10 +35313,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2412 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -35604,10 +35328,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2413 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -35619,10 +35343,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2414 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -35634,10 +35358,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2415 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -35649,10 +35373,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2416 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -35665,10 +35389,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2417 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -35680,10 +35404,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2418 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -35695,10 +35419,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2419 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -35710,10 +35434,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2420 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -35725,10 +35449,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2421 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -35740,10 +35464,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2422 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -35755,10 +35479,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2423 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -35770,10 +35494,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2424 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -35785,10 +35509,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2425 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -35800,10 +35524,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2426 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -35816,10 +35540,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2427 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -35831,10 +35555,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2428 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -35846,10 +35570,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2429 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -35862,10 +35586,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2430 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -35877,10 +35601,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2431 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.5 @@ -35892,10 +35616,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2432 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.5 @@ -35908,10 +35632,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2433 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.5 @@ -35923,10 +35647,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2434 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -35938,10 +35662,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2435 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -35953,10 +35677,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2436 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -35969,10 +35693,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2437 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -35984,10 +35708,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2438 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -35999,10 +35723,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2439 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -36014,10 +35738,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2440 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -36029,10 +35753,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2441 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -36044,10 +35768,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2442 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -36059,10 +35783,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2443 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -36074,10 +35798,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2444 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -36090,10 +35814,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2445 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -36106,10 +35830,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2446 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -36123,10 +35847,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2447 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -36140,10 +35864,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2448 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -36156,10 +35880,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2449 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -36173,10 +35897,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2450 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -36189,10 +35913,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2451 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -36205,10 +35929,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2452 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -36221,10 +35945,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2453 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -36237,10 +35961,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2454 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -36252,10 +35976,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2455 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -36267,10 +35991,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2456 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -2 @@ -36282,10 +36006,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2457 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -2 @@ -36297,10 +36021,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2458 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -36312,10 +36036,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2467 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -36327,10 +36051,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2468 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -36342,10 +36066,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2469 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -36357,10 +36081,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2470 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -36372,10 +36096,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2471 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.450045585632324 @@ -36387,10 +36111,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2472 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 7.858890056610107 @@ -36402,10 +36126,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2473 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.7920545339584351 @@ -36417,10 +36141,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2474 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6157026886940002 @@ -36432,10 +36156,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2475 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5587586760520935 @@ -36447,10 +36171,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2476 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -36462,10 +36186,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2479 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -36477,10 +36201,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2480 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -36492,10 +36216,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2481 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -36507,10 +36231,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2482 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -36522,10 +36246,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2483 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -36537,10 +36261,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2484 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -36552,10 +36276,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2485 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -36567,10 +36291,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2486 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -36582,10 +36306,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2487 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -36597,10 +36321,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2488 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -36612,10 +36336,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2489 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -36627,10 +36351,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2490 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -36642,10 +36366,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2491 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -36658,10 +36382,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2492 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -36673,10 +36397,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2493 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -36688,10 +36412,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2494 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -36703,10 +36427,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2495 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -36718,10 +36442,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2496 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -36733,10 +36457,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2497 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -36748,10 +36472,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2498 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -36763,10 +36487,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2499 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -36778,10 +36502,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2500 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -36793,10 +36517,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2501 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -36809,10 +36533,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2502 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -36824,10 +36548,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2503 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -36840,10 +36564,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2504 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -36855,10 +36579,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2505 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -36871,10 +36595,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2506 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -36886,10 +36610,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2507 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -36901,10 +36625,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2508 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -36917,10 +36641,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2509 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -36932,10 +36656,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2510 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -36947,10 +36671,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2511 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -36962,10 +36686,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2512 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -36977,10 +36701,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2513 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -36992,10 +36716,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2514 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -37008,10 +36732,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2515 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -37023,10 +36747,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2516 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -37038,10 +36762,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2517 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -37053,10 +36777,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2518 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -37068,10 +36792,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2519 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -37083,10 +36807,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2520 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -37099,10 +36823,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2521 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -37114,10 +36838,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2522 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -37129,10 +36853,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2523 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -37144,10 +36868,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2524 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -37159,10 +36883,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2525 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -37174,10 +36898,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2526 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -37189,10 +36913,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2527 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -37204,10 +36928,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2528 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -37220,10 +36944,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2529 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -37235,10 +36959,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2530 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -37250,10 +36974,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2531 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -37265,10 +36989,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2532 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -37280,10 +37004,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2533 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -37295,10 +37019,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2534 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -37310,10 +37034,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2535 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -37325,10 +37049,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2536 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -37340,10 +37064,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2537 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -37355,10 +37079,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2538 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -37371,10 +37095,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2539 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -37386,10 +37110,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2540 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -37401,10 +37125,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2541 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -37417,10 +37141,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2542 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -37432,10 +37156,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2543 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.5 @@ -37447,10 +37171,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2544 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.5 @@ -37463,10 +37187,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2545 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.5 @@ -37478,10 +37202,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2546 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -37493,10 +37217,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2547 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -37508,10 +37232,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2548 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -37524,10 +37248,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2549 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -37539,10 +37263,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2550 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -37554,10 +37278,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2551 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -37569,10 +37293,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2552 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -37584,10 +37308,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2553 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -37599,10 +37323,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2554 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -37614,10 +37338,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2555 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -37629,10 +37353,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2556 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -37645,10 +37369,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2557 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -37661,10 +37385,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2558 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -37678,10 +37402,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2559 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -37695,10 +37419,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2560 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -37711,10 +37435,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2561 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -37728,10 +37452,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2562 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -37744,10 +37468,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2563 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -37760,10 +37484,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2564 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -37776,10 +37500,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2565 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -37792,10 +37516,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2566 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -37807,10 +37531,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2567 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -37822,10 +37546,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2568 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2 @@ -37837,10 +37561,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2569 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2 @@ -37852,10 +37576,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2570 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end call $~lib/bindings/Math/random @@ -37871,29 +37595,26 @@ f64.lt i32.eqz br_if $break|0 - block - call $~lib/math/NativeMath.random - local.set $1 + call $~lib/math/NativeMath.random + local.set $1 + local.get $1 + f64.const 0 + f64.ge + if (result i32) local.get $1 - f64.const 0 - f64.ge - local.tee $2 - if (result i32) - local.get $1 - f64.const 1 - f64.lt - else - local.get $2 - end - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 2579 - i32.const 2 - call $~lib/env/abort - unreachable - end + f64.const 1 + f64.lt + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 2579 + i32.const 2 + call $~lib/builtins/abort + unreachable end local.get $0 i32.const 1 @@ -37907,8 +37628,8 @@ block $~lib/math/NativeMathf.seedRandom|inlined.0 call $~lib/bindings/Math/random i64.reinterpret_f64 - local.set $3 - local.get $3 + local.set $2 + local.get $2 call $~lib/math/NativeMath.seedRandom end block $break|1 @@ -37921,29 +37642,26 @@ f64.lt i32.eqz br_if $break|1 - block - call $~lib/math/NativeMathf.random - local.set $4 - local.get $4 - f32.const 0 - f32.ge - local.tee $2 - if (result i32) - local.get $4 - f32.const 1 - f32.lt - else - local.get $2 - end - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 2587 - i32.const 2 - call $~lib/env/abort - unreachable - end + call $~lib/math/NativeMathf.random + local.set $3 + local.get $3 + f32.const 0 + f32.ge + if (result i32) + local.get $3 + f32.const 1 + f32.lt + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 2587 + i32.const 2 + call $~lib/builtins/abort + unreachable end local.get $0 i32.const 1 @@ -37962,10 +37680,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2601 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -37976,10 +37694,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2602 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -37990,10 +37708,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2603 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -38004,10 +37722,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2604 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -38018,10 +37736,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2605 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -38032,10 +37750,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2606 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -38046,10 +37764,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2607 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -38060,10 +37778,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2608 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -38074,10 +37792,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2609 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -38088,10 +37806,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2610 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -38102,10 +37820,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2613 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -38116,10 +37834,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2614 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -38132,10 +37850,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2615 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -38146,10 +37864,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2616 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -38160,10 +37878,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2617 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -38174,10 +37892,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2618 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -38188,10 +37906,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2619 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -38202,10 +37920,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2620 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -38216,10 +37934,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2621 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.5 @@ -38230,10 +37948,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2622 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.5 @@ -38244,10 +37962,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2623 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.0000152587890625 @@ -38258,10 +37976,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2624 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.0000152587890625 @@ -38272,10 +37990,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2625 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.9999923706054688 @@ -38286,10 +38004,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2626 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.9999923706054688 @@ -38300,10 +38018,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2627 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 7.888609052210118e-31 @@ -38314,10 +38032,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2628 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -7.888609052210118e-31 @@ -38328,10 +38046,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2629 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -38342,10 +38060,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2638 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -38356,10 +38074,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2639 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -38370,10 +38088,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2640 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -38384,10 +38102,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2641 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -38398,10 +38116,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2642 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -38412,10 +38130,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2643 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -38426,10 +38144,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2644 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -38440,10 +38158,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2645 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -38454,10 +38172,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2646 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -38468,10 +38186,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2647 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -38482,10 +38200,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2650 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -38496,10 +38214,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2651 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -38512,10 +38230,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2652 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -38526,10 +38244,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2653 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -38540,10 +38258,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2654 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -38554,10 +38272,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2655 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -38568,10 +38286,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2656 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -38582,10 +38300,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2657 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -38596,10 +38314,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2658 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.5 @@ -38610,10 +38328,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2659 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.5 @@ -38624,10 +38342,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2660 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.0000152587890625 @@ -38638,10 +38356,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2661 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.0000152587890625 @@ -38652,10 +38370,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2662 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.9999923706054688 @@ -38666,10 +38384,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2663 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.9999923706054688 @@ -38680,10 +38398,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2664 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 7.888609052210118e-31 @@ -38694,10 +38412,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2665 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -7.888609052210118e-31 @@ -38708,10 +38426,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2666 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -38722,10 +38440,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2677 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -38736,10 +38454,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2678 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -38750,10 +38468,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2679 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2 @@ -38764,10 +38482,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2680 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -38778,10 +38496,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2681 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -2 @@ -38792,10 +38510,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2682 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -38806,10 +38524,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2683 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -38821,10 +38539,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2684 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -38835,10 +38553,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2685 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -38849,10 +38567,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2693 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -38863,10 +38581,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2694 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -38877,10 +38595,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2695 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2 @@ -38891,10 +38609,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2696 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -38905,10 +38623,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2697 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2 @@ -38919,10 +38637,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2698 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -38933,10 +38651,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2699 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -38948,10 +38666,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2700 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -38962,13 +38680,13 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2701 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/math/NativeMath.signbit|inlined.4 (result i32) + block $~lib/math/NativeMath.signbit|inlined.2 (result i32) f64.const 0 local.set $1 local.get $1 @@ -38988,13 +38706,13 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2707 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/math/NativeMath.signbit|inlined.5 (result i32) + block $~lib/math/NativeMath.signbit|inlined.3 (result i32) f64.const -0 local.set $1 local.get $1 @@ -39014,13 +38732,13 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2708 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/math/NativeMath.signbit|inlined.6 (result i32) + block $~lib/math/NativeMath.signbit|inlined.4 (result i32) f64.const 1 local.set $1 local.get $1 @@ -39040,13 +38758,13 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2709 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/math/NativeMath.signbit|inlined.7 (result i32) + block $~lib/math/NativeMath.signbit|inlined.5 (result i32) f64.const -1 local.set $1 local.get $1 @@ -39066,13 +38784,13 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2710 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/math/NativeMath.signbit|inlined.8 (result i32) + block $~lib/math/NativeMath.signbit|inlined.6 (result i32) f64.const nan:0x8000000000000 local.set $1 local.get $1 @@ -39092,13 +38810,13 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2711 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/math/NativeMath.signbit|inlined.9 (result i32) + block $~lib/math/NativeMath.signbit|inlined.7 (result i32) f64.const nan:0x8000000000000 f64.neg local.set $1 @@ -39119,13 +38837,13 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2712 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/math/NativeMath.signbit|inlined.10 (result i32) + block $~lib/math/NativeMath.signbit|inlined.8 (result i32) f64.const inf local.set $1 local.get $1 @@ -39145,13 +38863,13 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2713 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/math/NativeMath.signbit|inlined.11 (result i32) + block $~lib/math/NativeMath.signbit|inlined.9 (result i32) f64.const inf f64.neg local.set $1 @@ -39172,21 +38890,21 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2714 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/math/NativeMathf.signbit|inlined.4 (result i32) + block $~lib/math/NativeMathf.signbit|inlined.2 (result i32) f32.const 0 - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.reinterpret_f32 i32.const 31 i32.shr_u - local.get $4 - local.get $4 + local.get $3 + local.get $3 f32.eq i32.and end @@ -39197,21 +38915,21 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2720 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/math/NativeMathf.signbit|inlined.5 (result i32) + block $~lib/math/NativeMathf.signbit|inlined.3 (result i32) f32.const -0 - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.reinterpret_f32 i32.const 31 i32.shr_u - local.get $4 - local.get $4 + local.get $3 + local.get $3 f32.eq i32.and end @@ -39222,21 +38940,21 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2721 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/math/NativeMathf.signbit|inlined.6 (result i32) + block $~lib/math/NativeMathf.signbit|inlined.4 (result i32) f32.const 1 - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.reinterpret_f32 i32.const 31 i32.shr_u - local.get $4 - local.get $4 + local.get $3 + local.get $3 f32.eq i32.and end @@ -39247,21 +38965,21 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2722 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/math/NativeMathf.signbit|inlined.7 (result i32) + block $~lib/math/NativeMathf.signbit|inlined.5 (result i32) f32.const -1 - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.reinterpret_f32 i32.const 31 i32.shr_u - local.get $4 - local.get $4 + local.get $3 + local.get $3 f32.eq i32.and end @@ -39272,21 +38990,21 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2723 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/math/NativeMathf.signbit|inlined.8 (result i32) + block $~lib/math/NativeMathf.signbit|inlined.6 (result i32) f32.const nan:0x400000 - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.reinterpret_f32 i32.const 31 i32.shr_u - local.get $4 - local.get $4 + local.get $3 + local.get $3 f32.eq i32.and end @@ -39297,22 +39015,22 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2724 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/math/NativeMathf.signbit|inlined.9 (result i32) + block $~lib/math/NativeMathf.signbit|inlined.7 (result i32) f32.const nan:0x400000 f32.neg - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.reinterpret_f32 i32.const 31 i32.shr_u - local.get $4 - local.get $4 + local.get $3 + local.get $3 f32.eq i32.and end @@ -39323,21 +39041,21 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2725 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/math/NativeMathf.signbit|inlined.10 (result i32) + block $~lib/math/NativeMathf.signbit|inlined.8 (result i32) f32.const inf - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.reinterpret_f32 i32.const 31 i32.shr_u - local.get $4 - local.get $4 + local.get $3 + local.get $3 f32.eq i32.and end @@ -39348,22 +39066,22 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2726 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/math/NativeMathf.signbit|inlined.11 (result i32) + block $~lib/math/NativeMathf.signbit|inlined.9 (result i32) f32.const inf f32.neg - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.reinterpret_f32 i32.const 31 i32.shr_u - local.get $4 - local.get $4 + local.get $3 + local.get $3 f32.eq i32.and end @@ -39374,10 +39092,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2727 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -39389,10 +39107,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2738 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -39404,10 +39122,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2739 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -39419,10 +39137,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2740 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -39434,10 +39152,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2741 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -39449,10 +39167,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2742 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.450045556060236 @@ -39464,10 +39182,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2743 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 7.858890253041697 @@ -39479,10 +39197,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2744 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.792054511984896 @@ -39494,10 +39212,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2745 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.615702673197924 @@ -39509,10 +39227,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2746 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5587586823609152 @@ -39524,10 +39242,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2747 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -39539,10 +39257,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2750 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -39554,10 +39272,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2751 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -39569,10 +39287,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2752 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -39584,10 +39302,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2753 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -39599,10 +39317,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2754 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -39614,10 +39332,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2755 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.5 @@ -39629,10 +39347,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2756 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.5 @@ -39644,10 +39362,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2757 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2 @@ -39659,10 +39377,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2758 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -2 @@ -39674,10 +39392,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2759 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -39689,10 +39407,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2760 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -39705,10 +39423,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2761 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -39720,10 +39438,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2762 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -39735,10 +39453,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2763 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -39750,10 +39468,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2764 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -39765,10 +39483,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2765 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -39780,10 +39498,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2766 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -39795,10 +39513,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2767 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -39810,10 +39528,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2768 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.5 @@ -39825,10 +39543,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2769 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.5 @@ -39840,10 +39558,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2770 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2 @@ -39855,10 +39573,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2771 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -2 @@ -39870,10 +39588,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2772 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -39885,10 +39603,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2773 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -39901,10 +39619,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2774 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -39916,10 +39634,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2775 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -39931,10 +39649,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2776 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -39946,10 +39664,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2777 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -39961,10 +39679,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2778 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -39977,10 +39695,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2779 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -39992,10 +39710,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2780 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -40007,10 +39725,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2781 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -40022,10 +39740,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2782 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -40037,10 +39755,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2783 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -40053,10 +39771,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2784 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -40068,10 +39786,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2785 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -40083,10 +39801,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2786 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -40098,10 +39816,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2787 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -40113,10 +39831,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2788 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -40129,10 +39847,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2789 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -40144,10 +39862,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2790 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -40159,10 +39877,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2791 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -40174,10 +39892,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2792 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -40190,10 +39908,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2793 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -40205,10 +39923,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2794 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -40220,10 +39938,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2795 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -40235,10 +39953,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2796 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -40250,10 +39968,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2797 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -40266,10 +39984,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2798 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -40282,10 +40000,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2799 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -40298,10 +40016,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2800 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -40313,10 +40031,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2801 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -40328,10 +40046,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2802 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -40343,10 +40061,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2803 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -40358,10 +40076,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2804 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -40373,10 +40091,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2805 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -40388,10 +40106,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2806 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -40404,10 +40122,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2807 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -40420,10 +40138,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2808 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -40436,10 +40154,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2809 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -40452,10 +40170,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2810 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -40469,10 +40187,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2811 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.75 @@ -40484,10 +40202,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2812 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.75 @@ -40499,10 +40217,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2813 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.75 @@ -40514,10 +40232,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2814 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.75 @@ -40529,10 +40247,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2815 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 8e-323 @@ -40544,10 +40262,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2816 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -40559,10 +40277,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2825 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -40574,10 +40292,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2826 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -40589,10 +40307,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2827 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -40604,10 +40322,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2828 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -40619,10 +40337,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2829 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.450045585632324 @@ -40634,10 +40352,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2830 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 7.858890056610107 @@ -40649,10 +40367,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2831 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.7920545339584351 @@ -40664,10 +40382,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2832 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6157026886940002 @@ -40679,10 +40397,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2833 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5587586760520935 @@ -40694,10 +40412,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2834 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -40709,10 +40427,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2837 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -40724,10 +40442,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2838 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -40739,10 +40457,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2839 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -40754,10 +40472,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2840 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -40769,10 +40487,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2841 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -40784,10 +40502,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2842 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.5 @@ -40799,10 +40517,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2843 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.5 @@ -40814,10 +40532,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2844 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2 @@ -40829,10 +40547,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2845 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2 @@ -40844,10 +40562,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2846 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -40859,10 +40577,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2847 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -40875,10 +40593,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2848 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -40890,10 +40608,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2849 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -40905,10 +40623,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2850 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -40920,10 +40638,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2851 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -40935,10 +40653,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2852 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -40950,10 +40668,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2853 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -40965,10 +40683,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2854 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -40980,10 +40698,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2855 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.5 @@ -40995,10 +40713,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2856 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.5 @@ -41010,10 +40728,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2857 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2 @@ -41025,10 +40743,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2858 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2 @@ -41040,10 +40758,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2859 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -41055,10 +40773,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2860 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -41071,10 +40789,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2861 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -41086,10 +40804,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2862 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -41101,10 +40819,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2863 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -41116,10 +40834,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2864 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -41131,10 +40849,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2865 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -41147,10 +40865,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2866 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -41162,10 +40880,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2867 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -41177,10 +40895,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2868 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -41192,10 +40910,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2869 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -41207,10 +40925,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2870 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -41223,10 +40941,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2871 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -41238,10 +40956,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2872 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -41253,10 +40971,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2873 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -41268,10 +40986,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2874 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -41283,10 +41001,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2875 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -41299,10 +41017,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2876 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -41314,10 +41032,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2877 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -41329,10 +41047,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2878 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -41344,10 +41062,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2879 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -41360,10 +41078,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2880 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -41375,10 +41093,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2881 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -41390,10 +41108,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2882 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -41405,10 +41123,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2883 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -41420,10 +41138,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2884 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -41436,10 +41154,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2885 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -41452,10 +41170,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2886 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -41468,10 +41186,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2887 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -41483,10 +41201,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2888 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -41498,10 +41216,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2889 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -41513,10 +41231,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2890 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -41528,10 +41246,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2891 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -41543,10 +41261,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2892 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -41558,10 +41276,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2893 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -41574,10 +41292,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2894 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -41590,10 +41308,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2895 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -41606,10 +41324,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2896 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -41622,10 +41340,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2897 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -41639,10 +41357,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2898 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.75 @@ -41654,10 +41372,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2899 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.75 @@ -41669,10 +41387,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2900 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.75 @@ -41684,10 +41402,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2901 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.75 @@ -41699,10 +41417,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2902 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 5.877471754111438e-39 @@ -41714,10 +41432,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2903 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -41728,10 +41446,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2941 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -41742,10 +41460,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2942 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -41756,10 +41474,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2943 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -41770,10 +41488,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2944 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -41784,10 +41502,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2945 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -41798,10 +41516,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2946 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -41812,10 +41530,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2947 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -41826,10 +41544,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2948 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -41840,10 +41558,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2949 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -41854,10 +41572,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2950 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -41868,10 +41586,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2953 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -41882,10 +41600,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2954 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -41896,10 +41614,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2955 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -41911,10 +41629,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2956 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -41925,10 +41643,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2957 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.862645149230957e-09 @@ -41939,10 +41657,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2960 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.862645149230957e-09 @@ -41953,10 +41671,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2961 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.1754943508222875e-38 @@ -41967,10 +41685,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2962 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.1754943508222875e-38 @@ -41981,10 +41699,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2963 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.401298464324817e-45 @@ -41997,10 +41715,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2964 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.401298464324817e-45 @@ -42013,10 +41731,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2965 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.175494490952134e-38 @@ -42027,10 +41745,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2966 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.1754946310819804e-38 @@ -42041,10 +41759,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2967 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.3509880009953429e-38 @@ -42055,10 +41773,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2968 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.350988701644575e-38 @@ -42069,10 +41787,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2969 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.3509895424236536e-38 @@ -42083,10 +41801,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2970 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.70197740328915e-38 @@ -42097,10 +41815,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2971 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.1175870895385742e-08 @@ -42111,10 +41829,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2972 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.4901161193847656e-08 @@ -42125,10 +41843,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2973 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.000244140625 @@ -42139,10 +41857,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2974 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.0003662109375 @@ -42153,10 +41871,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2975 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.175494490952134e-38 @@ -42167,10 +41885,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2976 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.1754946310819804e-38 @@ -42181,10 +41899,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2977 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2.3509880009953429e-38 @@ -42195,10 +41913,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2978 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2.350988701644575e-38 @@ -42209,10 +41927,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2979 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2.3509895424236536e-38 @@ -42223,10 +41941,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2980 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -4.70197740328915e-38 @@ -42237,10 +41955,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2981 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.1175870895385742e-08 @@ -42251,10 +41969,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2982 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.4901161193847656e-08 @@ -42265,10 +41983,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2983 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.000244140625 @@ -42279,10 +41997,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2984 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.0003662109375 @@ -42293,10 +42011,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2985 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.802596928649634e-45 @@ -42309,10 +42027,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2986 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.2611686178923354e-44 @@ -42325,10 +42043,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2987 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.938735877055719e-39 @@ -42341,10 +42059,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2988 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 5.877471754111438e-39 @@ -42357,10 +42075,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2989 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.1754940705625946e-38 @@ -42373,10 +42091,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2990 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.1754942106924411e-38 @@ -42389,10 +42107,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2991 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2.802596928649634e-45 @@ -42405,10 +42123,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2992 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.2611686178923354e-44 @@ -42421,10 +42139,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2993 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2.938735877055719e-39 @@ -42437,10 +42155,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2994 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -5.877471754111438e-39 @@ -42453,10 +42171,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2995 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.1754940705625946e-38 @@ -42469,10 +42187,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2996 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.1754942106924411e-38 @@ -42485,10 +42203,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 2997 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 255.99993896484375 @@ -42499,10 +42217,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3000 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 5033165 @@ -42513,10 +42231,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3001 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 421657440 @@ -42527,10 +42245,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3002 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2147483392 @@ -42541,10 +42259,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3003 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 68719476736 @@ -42555,10 +42273,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3004 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 549755813888 @@ -42569,10 +42287,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3005 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f32.MAX_VALUE @@ -42583,10 +42301,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3006 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -255.99993896484375 @@ -42597,10 +42315,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3007 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -5033165 @@ -42611,10 +42329,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3008 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -421657440 @@ -42625,10 +42343,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3009 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2147483392 @@ -42639,10 +42357,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3010 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -68719476736 @@ -42653,10 +42371,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3011 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -549755813888 @@ -42667,10 +42385,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3012 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f32.MAX_VALUE @@ -42682,10 +42400,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3013 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -42696,10 +42414,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3025 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -42710,10 +42428,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3026 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -42724,10 +42442,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3027 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -42738,10 +42456,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3028 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -42752,10 +42470,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3029 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -42766,10 +42484,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3030 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -42780,10 +42498,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3031 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -42794,10 +42512,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3032 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -42808,10 +42526,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3033 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -42822,10 +42540,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3034 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -42836,10 +42554,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3037 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -42850,10 +42568,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3038 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -42864,10 +42582,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3039 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -42880,10 +42598,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3040 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -42894,10 +42612,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3041 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -42908,10 +42626,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3050 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -42922,10 +42640,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3051 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -42936,10 +42654,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3052 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -42950,10 +42668,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3053 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -42964,10 +42682,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3054 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -42978,10 +42696,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3055 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -42992,10 +42710,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3056 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -43006,10 +42724,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3057 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -43020,10 +42738,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3058 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -43034,10 +42752,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3059 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -43048,10 +42766,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3062 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -43062,10 +42780,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3063 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -43076,10 +42794,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3064 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -43092,10 +42810,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3065 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -43106,10 +42824,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3066 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -43120,10 +42838,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3078 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -43134,10 +42852,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3079 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -43148,10 +42866,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3080 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -43162,10 +42880,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3081 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -43176,10 +42894,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3082 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -43190,10 +42908,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3083 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -43204,10 +42922,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3084 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -43218,10 +42936,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3085 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -43232,10 +42950,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3086 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -43246,10 +42964,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3087 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -43260,10 +42978,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3090 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -43274,10 +42992,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3091 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -43289,10 +43007,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3092 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -43303,10 +43021,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3093 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -43317,10 +43035,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3094 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -43331,10 +43049,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3095 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -43345,10 +43063,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3096 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4 @@ -43359,10 +43077,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3097 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1e-323 @@ -43373,10 +43091,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3098 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.5e-323 @@ -43387,10 +43105,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3099 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 5e-324 @@ -43401,10 +43119,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3100 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -5e-324 @@ -43415,10 +43133,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3101 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.9999999999999999 @@ -43429,10 +43147,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3102 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.9999999999999998 @@ -43443,10 +43161,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3103 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.0000000000000002 @@ -43457,10 +43175,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3104 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.0000000000000004 @@ -43471,10 +43189,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3105 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.0000000000000002 @@ -43485,10 +43203,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3106 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.9999999999999999 @@ -43499,10 +43217,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3107 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1797693134862315708145274e284 @@ -43513,10 +43231,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3108 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1797693134862315708145274e284 @@ -43527,10 +43245,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3109 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 179769313486231490980915e285 @@ -43541,10 +43259,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3110 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1797693134862314111473026e284 @@ -43555,10 +43273,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3111 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1797693134862313313136902e284 @@ -43569,10 +43287,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3112 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1797693134862312514800778e284 @@ -43583,10 +43301,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3113 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1797693134862311716464655e284 @@ -43597,10 +43315,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3114 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1797693134862310918128531e284 @@ -43611,10 +43329,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3115 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1797693134862310119792407e284 @@ -43625,10 +43343,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3116 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1797693134862309321456283e284 @@ -43639,10 +43357,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3117 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1797693134862308523120159e284 @@ -43653,10 +43371,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3118 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1797693134862307724784036e284 @@ -43667,10 +43385,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3119 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.225073858507203e-308 @@ -43681,10 +43399,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3120 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.225073858507205e-308 @@ -43695,10 +43413,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3121 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.225073858507207e-308 @@ -43709,10 +43427,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3122 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.225073858507209e-308 @@ -43723,10 +43441,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3123 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.225073858507211e-308 @@ -43737,10 +43455,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3124 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.2250738585072127e-308 @@ -43751,10 +43469,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3125 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.2250738585072147e-308 @@ -43765,10 +43483,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3126 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.2250738585072167e-308 @@ -43779,10 +43497,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3127 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.2250738585072187e-308 @@ -43793,10 +43511,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3128 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.2250738585072207e-308 @@ -43807,10 +43525,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3129 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.2250738585072226e-308 @@ -43821,10 +43539,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3130 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.2250738585072246e-308 @@ -43835,10 +43553,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3131 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.2250738585072266e-308 @@ -43849,10 +43567,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3132 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.2250738585072286e-308 @@ -43863,10 +43581,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3133 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 92.35130391890645 @@ -43877,10 +43595,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3134 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 93.3599596388916 @@ -43891,10 +43609,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3135 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 95.42049628886124 @@ -43905,10 +43623,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3136 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 95.87916941885449 @@ -43919,10 +43637,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3137 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 96.84804174884022 @@ -43933,10 +43651,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3138 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 97.43639050883155 @@ -43947,10 +43665,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3139 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 97.50957979883047 @@ -43961,10 +43679,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3140 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 97.80496893882612 @@ -43975,10 +43693,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3141 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 98.2751822888192 @@ -43989,10 +43707,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3142 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 99.47293564880155 @@ -44003,10 +43721,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3143 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 100.57047130878539 @@ -44017,10 +43735,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3144 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 100.60954608878481 @@ -44031,10 +43749,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3145 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 100.67909109878379 @@ -44045,10 +43763,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3146 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 101.12268095877725 @@ -44059,10 +43777,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3147 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 101.3027691287746 @@ -44073,10 +43791,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3148 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.45932313565507e-307 @@ -44087,10 +43805,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3149 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 5.610957305180409e-307 @@ -44101,10 +43819,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3150 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 5.8073887977408524e-307 @@ -44115,10 +43833,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3151 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 7.026137080471427e-307 @@ -44129,10 +43847,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3152 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 8.438697769194972e-307 @@ -44143,10 +43861,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3153 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.1607792515836795e-306 @@ -44157,10 +43875,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3154 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.2827413827423193e-306 @@ -44171,10 +43889,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3155 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.7116604596087457e-306 @@ -44185,10 +43903,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3156 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.038173251686994e-306 @@ -44199,10 +43917,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3157 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.171572060856931e-306 @@ -44213,10 +43931,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3158 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.4681399631804094e-306 @@ -44227,10 +43945,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3159 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.5175533964200588e-306 @@ -44241,10 +43959,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3160 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.6461505468829625e-306 @@ -44255,10 +43973,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3161 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 3.8167076367720413e-306 @@ -44269,10 +43987,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3162 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.5743220778562766e-306 @@ -44283,10 +44001,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3163 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -44297,10 +44015,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3172 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -44311,10 +44029,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3173 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -44325,10 +44043,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3174 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -44339,10 +44057,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3175 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -44353,10 +44071,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3176 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -44367,10 +44085,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3177 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -44381,10 +44099,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3178 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -44395,10 +44113,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3179 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -44409,10 +44127,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3180 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -44423,10 +44141,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3181 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -44437,10 +44155,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3184 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -44451,10 +44169,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3185 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -44466,10 +44184,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3186 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -44480,10 +44198,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3187 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -44494,10 +44212,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3188 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -44508,10 +44226,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3189 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -44522,10 +44240,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3190 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4 @@ -44536,10 +44254,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3191 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.802596928649634e-45 @@ -44550,10 +44268,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3192 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.203895392974451e-45 @@ -44564,10 +44282,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3193 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.401298464324817e-45 @@ -44578,10 +44296,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3194 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.401298464324817e-45 @@ -44592,10 +44310,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3195 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 3402823466385288598117041e14 @@ -44606,10 +44324,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3196 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -3402823466385288598117041e14 @@ -44620,10 +44338,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3197 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.9999998807907104 @@ -44634,10 +44352,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3198 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.9999999403953552 @@ -44648,10 +44366,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3199 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.999999761581421 @@ -44662,10 +44380,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3200 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.9999998807907104 @@ -44676,10 +44394,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3201 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.0000001192092896 @@ -44690,10 +44408,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3202 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.000000238418579 @@ -44704,10 +44422,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3203 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.000000238418579 @@ -44718,10 +44436,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3204 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.000000476837158 @@ -44732,10 +44450,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3205 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -44746,10 +44464,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3243 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -44760,10 +44478,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3244 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -44774,10 +44492,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3245 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -44788,10 +44506,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3246 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -44802,10 +44520,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3247 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -44816,10 +44534,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3248 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -44830,10 +44548,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3249 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -44844,10 +44562,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3250 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -44858,10 +44576,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3251 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -44872,10 +44590,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3252 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -44886,10 +44604,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3255 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -44900,10 +44618,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3256 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -44914,10 +44632,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3257 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -44929,10 +44647,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3258 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -44943,10 +44661,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3259 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.862645149230957e-09 @@ -44957,10 +44675,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3262 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.862645149230957e-09 @@ -44971,10 +44689,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3263 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.1754943508222875e-38 @@ -44985,10 +44703,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3264 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.1754943508222875e-38 @@ -44999,10 +44717,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3265 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.401298464324817e-45 @@ -45015,10 +44733,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3266 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.401298464324817e-45 @@ -45031,10 +44749,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3267 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.175494490952134e-38 @@ -45045,10 +44763,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3268 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.1754946310819804e-38 @@ -45059,10 +44777,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3269 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.3509880009953429e-38 @@ -45073,10 +44791,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3270 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.350988701644575e-38 @@ -45087,10 +44805,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3271 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.3509895424236536e-38 @@ -45101,10 +44819,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3272 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.70197740328915e-38 @@ -45115,10 +44833,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3273 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.1175870895385742e-08 @@ -45129,10 +44847,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3274 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.4901161193847656e-08 @@ -45143,10 +44861,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3275 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.000244140625 @@ -45157,10 +44875,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3276 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.175494490952134e-38 @@ -45171,10 +44889,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3277 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.1754946310819804e-38 @@ -45185,10 +44903,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3278 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2.3509880009953429e-38 @@ -45199,10 +44917,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3279 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.350988701644575e-38 @@ -45213,10 +44931,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3280 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2.3509895424236536e-38 @@ -45227,10 +44945,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3281 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -4.70197740328915e-38 @@ -45241,10 +44959,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3282 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.1175870895385742e-08 @@ -45255,10 +44973,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3283 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.4901161193847656e-08 @@ -45269,10 +44987,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3284 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.000244140625 @@ -45283,10 +45001,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3285 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.802596928649634e-45 @@ -45299,10 +45017,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3286 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.2611686178923354e-44 @@ -45315,10 +45033,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3287 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 2.938735877055719e-39 @@ -45331,10 +45049,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3288 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 5.877471754111438e-39 @@ -45347,10 +45065,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3289 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.1754940705625946e-38 @@ -45363,10 +45081,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3290 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.1754942106924411e-38 @@ -45379,10 +45097,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3291 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2.802596928649634e-45 @@ -45395,10 +45113,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3292 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.2611686178923354e-44 @@ -45411,10 +45129,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3293 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -2.938735877055719e-39 @@ -45427,10 +45145,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3294 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -5.877471754111438e-39 @@ -45443,10 +45161,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3295 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.1754940705625946e-38 @@ -45459,10 +45177,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3296 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.1754942106924411e-38 @@ -45475,10 +45193,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3297 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -45489,10 +45207,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3309 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -45503,10 +45221,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3310 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -45517,10 +45235,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3311 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -45531,10 +45249,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3312 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -45545,10 +45263,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3313 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -45559,10 +45277,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3314 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -45573,10 +45291,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3315 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -45587,10 +45305,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3316 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -45601,10 +45319,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3317 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -45615,10 +45333,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3318 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -45629,10 +45347,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3321 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -45643,10 +45361,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3322 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -45657,10 +45375,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3323 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -45672,10 +45390,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3324 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -45686,10 +45404,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3325 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -45700,10 +45418,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3334 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -45714,10 +45432,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3335 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -45728,10 +45446,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3336 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -45742,10 +45460,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3337 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -45756,10 +45474,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3338 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -45770,10 +45488,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3339 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -45784,10 +45502,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3340 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -45798,10 +45516,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3341 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -45812,10 +45530,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3342 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -45826,10 +45544,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3343 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -45840,10 +45558,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3346 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -45854,10 +45572,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3347 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -45868,10 +45586,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3348 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -45883,10 +45601,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3349 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -45897,10 +45615,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3350 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.06684839057968 @@ -45911,10 +45629,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3362 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.345239849338305 @@ -45925,10 +45643,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3363 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -8.38143342755525 @@ -45939,10 +45657,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3364 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -6.531673581913484 @@ -45953,10 +45671,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3365 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9.267056966972586 @@ -45967,10 +45685,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3366 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.6619858980995045 @@ -45981,10 +45699,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3367 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.4066039223853553 @@ -45995,10 +45713,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3368 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5617597462207241 @@ -46009,10 +45727,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3369 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.7741522965913037 @@ -46023,10 +45741,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3370 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.6787637026394024 @@ -46037,10 +45755,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3371 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -46051,10 +45769,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3374 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -46065,10 +45783,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3375 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -46081,10 +45799,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3376 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -46095,10 +45813,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3377 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -46109,10 +45827,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3378 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -46123,10 +45841,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3379 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -46137,10 +45855,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3380 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -46151,10 +45869,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3381 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -46165,10 +45883,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3382 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.0000152587890625 @@ -46179,10 +45897,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3383 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.0000152587890625 @@ -46193,10 +45911,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3384 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.9999923706054688 @@ -46207,10 +45925,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3385 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.9999923706054688 @@ -46221,10 +45939,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3386 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 7.888609052210118e-31 @@ -46235,10 +45953,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3387 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -7.888609052210118e-31 @@ -46249,10 +45967,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3388 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.066848754882812 @@ -46263,10 +45981,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3397 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 4.345239639282227 @@ -46277,10 +45995,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3398 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -8.381433486938477 @@ -46291,10 +46009,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3399 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -6.531673431396484 @@ -46305,10 +46023,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3400 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 9.267057418823242 @@ -46319,10 +46037,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3401 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.6619858741760254 @@ -46333,10 +46051,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3402 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.40660393238067627 @@ -46347,10 +46065,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3403 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5617597699165344 @@ -46361,10 +46079,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3404 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.7741522789001465 @@ -46375,10 +46093,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3405 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.6787636876106262 @@ -46389,10 +46107,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3406 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -46403,10 +46121,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3409 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -46417,10 +46135,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3410 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -46433,10 +46151,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3411 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -46447,10 +46165,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3412 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -46461,10 +46179,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3413 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -46475,10 +46193,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3414 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -46489,10 +46207,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3415 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -46503,10 +46221,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3416 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -46517,10 +46235,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3417 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.0000152587890625 @@ -46531,10 +46249,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3418 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.0000152587890625 @@ -46545,10 +46263,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3419 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.9999923706054688 @@ -46559,10 +46277,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3420 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.9999923706054688 @@ -46573,10 +46291,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3421 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 7.888609052210118e-31 @@ -46587,10 +46305,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3422 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -7.888609052210118e-31 @@ -46601,10 +46319,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3423 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2 @@ -46615,10 +46333,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3427 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -46629,10 +46347,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3428 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -2 @@ -46643,10 +46361,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3429 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4294967295 @@ -46657,10 +46375,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3430 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4294967294 @@ -46671,10 +46389,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3431 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.e+60 @@ -46685,10 +46403,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3432 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.e+60 @@ -46699,10 +46417,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3433 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.e+60 @@ -46713,10 +46431,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3434 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.e+24 @@ -46727,10 +46445,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3435 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -46741,10 +46459,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3436 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -46755,10 +46473,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3437 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f64.MAX_VALUE @@ -46769,10 +46487,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3438 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -46782,10 +46500,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3442 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -46795,10 +46513,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3443 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -46808,10 +46526,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3444 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -128 @@ -46821,10 +46539,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3445 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4294967295 @@ -46834,10 +46552,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3446 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4294967295.5 @@ -46847,10 +46565,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3447 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4294967296 @@ -46860,10 +46578,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3448 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4294967297 @@ -46873,10 +46591,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3449 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -46886,10 +46604,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3450 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -46899,10 +46617,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3451 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f64.MAX_SAFE_INTEGER @@ -46912,10 +46630,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3452 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f64.MAX_SAFE_INTEGER @@ -46926,10 +46644,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3453 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f64.MAX_VALUE @@ -46939,10 +46657,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3454 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f64.MIN_VALUE @@ -46952,10 +46670,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3455 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f64.MAX_VALUE @@ -46966,10 +46684,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3456 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f64.EPSILON @@ -46979,10 +46697,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3457 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 0 @@ -46993,10 +46711,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3461 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 0 @@ -47007,10 +46725,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3462 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 0 @@ -47021,10 +46739,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3463 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 0 @@ -47035,10 +46753,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3464 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 1 @@ -47049,10 +46767,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3466 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 1 @@ -47063,10 +46781,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3467 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 1 @@ -47077,10 +46795,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3468 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 1 @@ -47091,10 +46809,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3469 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 2 @@ -47105,10 +46823,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3471 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 2 @@ -47119,10 +46837,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3472 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 2 @@ -47133,10 +46851,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3473 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 2 @@ -47147,10 +46865,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3474 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -1 @@ -47161,10 +46879,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3476 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -1 @@ -47175,10 +46893,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3477 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -1 @@ -47189,10 +46907,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3478 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -1 @@ -47203,10 +46921,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3479 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -2 @@ -47217,10 +46935,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3481 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -2 @@ -47231,10 +46949,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3482 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -2 @@ -47245,10 +46963,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3483 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -2 @@ -47259,10 +46977,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3484 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 3 @@ -47273,10 +46991,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3486 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 3 @@ -47287,10 +47005,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3487 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 3 @@ -47301,10 +47019,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3488 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 3 @@ -47315,10 +47033,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3489 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 3 @@ -47329,10 +47047,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3490 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 3 @@ -47343,10 +47061,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3491 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 3 @@ -47357,10 +47075,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3492 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 57055 @@ -47375,10 +47093,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3494 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -47389,10 +47107,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3498 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -47403,70 +47121,49 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3499 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/builtins/isNaN|inlined.2 (result i32) - f32.const nan:0x400000 - i32.const 1 - call $~lib/math/ipow32f - local.set $4 - local.get $4 - local.get $4 - f32.ne - end - i32.const 0 - i32.ne + f32.const nan:0x400000 + i32.const 1 + call $~lib/math/ipow32f + call $~lib/builtins/isNaN i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3500 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/builtins/isNaN|inlined.3 (result i32) - f32.const nan:0x400000 - i32.const -1 - call $~lib/math/ipow32f - local.set $4 - local.get $4 - local.get $4 - f32.ne - end - i32.const 0 - i32.ne + f32.const nan:0x400000 + i32.const -1 + call $~lib/math/ipow32f + call $~lib/builtins/isNaN i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3501 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/builtins/isNaN|inlined.4 (result i32) - f32.const nan:0x400000 - i32.const 2 - call $~lib/math/ipow32f - local.set $4 - local.get $4 - local.get $4 - f32.ne - end - i32.const 0 - i32.ne + f32.const nan:0x400000 + i32.const 2 + call $~lib/math/ipow32f + call $~lib/builtins/isNaN i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3502 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -47477,10 +47174,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3503 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -47491,10 +47188,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3504 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -47506,10 +47203,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3505 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -47522,10 +47219,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3506 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -47537,10 +47234,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3507 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -47551,10 +47248,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3508 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f32.MAX_VALUE @@ -47565,10 +47262,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3509 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f32.MIN_VALUE @@ -47579,10 +47276,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3510 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f32.MAX_VALUE @@ -47593,10 +47290,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3511 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 10 @@ -47607,10 +47304,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3512 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 10 @@ -47621,10 +47318,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3513 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -47635,10 +47332,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3517 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -47649,10 +47346,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3518 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -47662,10 +47359,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3519 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -47675,10 +47372,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3520 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -47688,10 +47385,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3521 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -47702,10 +47399,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3522 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -47716,10 +47413,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3523 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -47731,10 +47428,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3524 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -47747,10 +47444,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3525 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -47762,10 +47459,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3526 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -47776,10 +47473,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3527 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f64.MAX_VALUE @@ -47790,10 +47487,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3528 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f64.MIN_VALUE @@ -47804,10 +47501,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3529 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f64.MAX_VALUE @@ -47818,10 +47515,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3530 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 10 @@ -47832,10 +47529,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3531 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 10 @@ -47846,10 +47543,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 3532 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/std/mod.json b/tests/compiler/std/mod.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/std/mod.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/std/mod.optimized.wat b/tests/compiler/std/mod.optimized.wat index 57dbad1e71..231cbc08e8 100644 --- a/tests/compiler/std/mod.optimized.wat +++ b/tests/compiler/std/mod.optimized.wat @@ -1,31 +1,34 @@ (module (type $FUNCSIG$iddd (func (param f64 f64 f64) (result i32))) (type $FUNCSIG$ddd (func (param f64 f64) (result f64))) + (type $FUNCSIG$id (func (param f64) (result i32))) (type $FUNCSIG$idd (func (param f64 f64) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$ifff (func (param f32 f32 f32) (result i32))) (type $FUNCSIG$fff (func (param f32 f32) (result f32))) + (type $FUNCSIG$if (func (param f32) (result i32))) (type $FUNCSIG$iff (func (param f32 f32) (result i32))) (type $FUNCSIG$v (func)) (import "math" "mod" (func $std/mod/mod (param f64 f64) (result f64))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\n\00\00\00s\00t\00d\00/\00m\00o\00d\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $null) + (data (i32.const 8) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00s\00t\00d\00/\00m\00o\00d\00.\00t\00s") (export "memory" (memory $0)) - (export "table" (table $0)) (export "mod" (func $std/mod/mod)) (start $start) - (func $~lib/math/NativeMath.mod (; 2 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $~lib/builtins/isNaN (; 2 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + local.get $0 + f64.ne + ) + (func $~lib/math/NativeMath.mod (; 3 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) (local $2 i64) (local $3 i64) (local $4 i64) (local $5 i64) - (local $6 i32) + (local $6 i64) (local $7 i64) (local $8 i64) - (local $9 i64) local.get $0 i64.reinterpret_f64 local.tee $2 @@ -45,30 +48,26 @@ local.get $2 i64.const 63 i64.shr_u - local.set $8 + local.set $7 local.get $3 i64.const 1 i64.shl - local.tee $7 + local.tee $6 i64.const 0 i64.eq - local.tee $6 - i32.eqz - if + if (result i32) + i32.const 1 + else local.get $4 i64.const 2047 i64.eq - local.set $6 end - local.get $6 - i32.eqz - if - local.get $1 + if (result i32) + i32.const 1 + else local.get $1 - f64.ne - local.set $6 + call $~lib/builtins/isNaN end - local.get $6 if local.get $0 local.get $1 @@ -82,12 +81,12 @@ local.get $2 i64.const 1 i64.shl - local.tee $9 - local.get $7 + local.tee $8 + local.get $6 i64.le_u if - local.get $7 - local.get $9 + local.get $6 + local.get $8 i64.eq br_if $folding-inner0 local.get $0 @@ -214,7 +213,7 @@ i64.add i64.shr_u end - local.get $8 + local.get $7 i64.const 63 i64.shl i64.or @@ -225,14 +224,12 @@ local.get $0 f64.mul ) - (func $std/mod/check (; 3 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) - local.get $1 + (func $std/mod/check (; 4 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) local.get $1 - f64.ne + call $~lib/builtins/isNaN if local.get $0 - local.get $0 - f64.ne + call $~lib/builtins/isNaN return end local.get $1 @@ -252,25 +249,28 @@ local.get $1 f64.eq ) - (func $std/mod/test_fmod (; 4 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) - (local $3 i32) + (func $std/mod/test_fmod (; 5 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMath.mod local.get $2 call $std/mod/check - local.tee $3 - if + if (result i32) local.get $0 local.get $1 call $std/mod/mod local.get $2 call $std/mod/check - local.set $3 + else + i32.const 0 end - local.get $3 ) - (func $~lib/math/NativeMathf.mod (; 5 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + (func $~lib/builtins/isNaN (; 6 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) + local.get $0 + local.get $0 + f32.ne + ) + (func $~lib/math/NativeMathf.mod (; 7 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -280,7 +280,7 @@ (local $8 i32) local.get $0 i32.reinterpret_f32 - local.tee $3 + local.tee $2 i32.const 23 i32.shr_u i32.const 255 @@ -288,38 +288,33 @@ local.set $4 local.get $1 i32.reinterpret_f32 - local.tee $5 + local.tee $3 i32.const 23 i32.shr_u i32.const 255 i32.and - local.set $6 - local.get $3 + local.set $5 + local.get $2 i32.const -2147483648 i32.and - local.set $8 - local.get $5 + local.set $7 + local.get $3 i32.const 1 i32.shl - local.tee $7 - i32.eqz - local.tee $2 - i32.eqz - if + local.tee $6 + if (result i32) local.get $4 i32.const 255 i32.eq - local.set $2 + else + i32.const 1 end - local.get $2 - i32.eqz - if - local.get $1 + if (result i32) + i32.const 1 + else local.get $1 - f32.ne - local.set $2 + call $~lib/builtins/isNaN end - local.get $2 if local.get $0 local.get $1 @@ -330,15 +325,15 @@ return end block $folding-inner0 - local.get $3 + local.get $2 i32.const 1 i32.shl - local.tee $2 - local.get $7 + local.tee $8 + local.get $6 i32.le_u if - local.get $2 - local.get $7 + local.get $6 + local.get $8 i32.eq br_if $folding-inner0 local.get $0 @@ -346,16 +341,16 @@ end local.get $4 if (result i32) - local.get $3 + local.get $2 i32.const 8388607 i32.and i32.const 8388608 i32.or else - local.get $3 + local.get $2 i32.const 1 local.get $4 - local.get $3 + local.get $2 i32.const 9 i32.shl i32.clz @@ -365,30 +360,30 @@ i32.shl end local.set $2 - local.get $6 + local.get $5 if (result i32) - local.get $5 + local.get $3 i32.const 8388607 i32.and i32.const 8388608 i32.or else - local.get $5 + local.get $3 i32.const 1 - local.get $6 local.get $5 + local.get $3 i32.const 9 i32.shl i32.clz i32.sub - local.tee $6 + local.tee $5 i32.sub i32.shl end local.set $3 loop $continue|0 local.get $4 - local.get $6 + local.get $5 i32.gt_s if local.get $2 @@ -457,7 +452,7 @@ i32.sub i32.shr_u end - local.get $8 + local.get $7 i32.or f32.reinterpret_i32 return @@ -466,14 +461,12 @@ local.get $0 f32.mul ) - (func $std/mod/check (; 6 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) - local.get $1 + (func $std/mod/check (; 8 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) local.get $1 - f32.ne + call $~lib/builtins/isNaN if local.get $0 - local.get $0 - f32.ne + call $~lib/builtins/isNaN return end local.get $1 @@ -493,14 +486,14 @@ local.get $1 f32.eq ) - (func $std/mod/test_fmodf (; 7 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/mod/test_fmodf (; 9 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMathf.mod local.get $2 call $std/mod/check ) - (func $start:std/mod (; 8 ;) (type $FUNCSIG$v) + (func $start:std/mod (; 10 ;) (type $FUNCSIG$v) f64.const 3 f64.const 2 f64.const 1 @@ -508,10 +501,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 20 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 3 @@ -521,10 +514,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 21 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -3 @@ -534,10 +527,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 22 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -3 @@ -547,10 +540,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 23 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 3.5 @@ -560,10 +553,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 24 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 3.5 @@ -573,10 +566,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 25 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -3.5 @@ -586,10 +579,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 26 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -3.5 @@ -599,10 +592,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 27 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 3 @@ -612,10 +605,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 28 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 3 @@ -625,10 +618,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 29 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -3 @@ -638,10 +631,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 30 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -3 @@ -651,10 +644,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 31 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -664,10 +657,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 32 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -677,10 +670,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 33 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -690,10 +683,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 34 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -703,10 +696,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 35 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.5 @@ -716,10 +709,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 36 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.5 @@ -729,10 +722,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 37 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.5 @@ -742,10 +735,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 38 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.5 @@ -755,10 +748,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 39 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.25 @@ -768,10 +761,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 40 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.25 @@ -781,10 +774,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 41 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.25 @@ -794,10 +787,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 42 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.25 @@ -807,10 +800,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 43 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -820,10 +813,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 44 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -833,10 +826,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 45 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -846,10 +839,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 46 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -859,10 +852,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 47 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -13 @@ -872,10 +865,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 48 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -885,10 +878,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 51 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -898,10 +891,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 52 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -911,10 +904,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 53 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -924,10 +917,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 54 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -937,10 +930,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 55 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -950,10 +943,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 56 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -963,10 +956,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 57 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -976,10 +969,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 58 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -989,10 +982,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 59 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -1002,10 +995,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 60 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -1015,10 +1008,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 61 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -1028,10 +1021,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 62 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -1041,10 +1034,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 63 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -1054,10 +1047,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 64 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -1067,10 +1060,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 65 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -1080,10 +1073,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 66 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -1093,10 +1086,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 67 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -1106,10 +1099,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 68 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -1119,10 +1112,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 69 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -1132,10 +1125,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 70 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -1145,10 +1138,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 71 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -1158,10 +1151,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 72 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -1171,10 +1164,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 73 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -1184,10 +1177,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 74 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -1197,10 +1190,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 75 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -1210,10 +1203,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 76 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -1223,10 +1216,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 77 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -1236,10 +1229,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 78 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -1249,10 +1242,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 79 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -1262,10 +1255,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 80 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -1275,10 +1268,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 81 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -1288,10 +1281,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 82 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -1301,10 +1294,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 83 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -1314,10 +1307,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 84 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -1327,10 +1320,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 85 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -1340,10 +1333,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 86 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -1353,10 +1346,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 87 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -1366,10 +1359,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 88 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -1379,10 +1372,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 89 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -1392,10 +1385,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 90 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -1405,10 +1398,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 91 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -1418,10 +1411,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 92 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf @@ -1431,10 +1424,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 93 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -1444,10 +1437,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 94 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -1457,10 +1450,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 95 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 3 @@ -1470,10 +1463,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 104 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 3 @@ -1483,10 +1476,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 105 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -3 @@ -1496,10 +1489,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 106 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -3 @@ -1509,10 +1502,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 107 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 3.5 @@ -1522,10 +1515,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 108 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 3.5 @@ -1535,10 +1528,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 109 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -3.5 @@ -1548,10 +1541,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 110 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -3.5 @@ -1561,10 +1554,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 111 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 3 @@ -1574,10 +1567,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 112 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 3 @@ -1587,10 +1580,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 113 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -3 @@ -1600,10 +1593,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 114 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -3 @@ -1613,10 +1606,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 115 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -1626,10 +1619,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 116 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -1639,10 +1632,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 117 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -1652,10 +1645,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 118 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -1665,10 +1658,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 119 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.5 @@ -1678,10 +1671,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 120 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.5 @@ -1691,10 +1684,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 121 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.5 @@ -1704,10 +1697,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 122 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.5 @@ -1717,10 +1710,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 123 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -1730,10 +1723,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 126 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -1743,10 +1736,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 127 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -1756,10 +1749,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 128 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -1769,10 +1762,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 129 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -1782,10 +1775,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 130 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -1795,10 +1788,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 131 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -1808,10 +1801,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 132 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -1821,10 +1814,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 133 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -1834,10 +1827,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 134 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -1847,10 +1840,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 135 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -1860,10 +1853,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 136 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -1873,10 +1866,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 137 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -1886,10 +1879,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 138 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -1899,10 +1892,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 139 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -1912,10 +1905,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 140 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -1925,10 +1918,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 141 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -1938,10 +1931,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 142 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -1951,10 +1944,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 143 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -1964,10 +1957,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 144 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -1977,10 +1970,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 145 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -1990,10 +1983,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 146 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -2003,10 +1996,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 147 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -2016,10 +2009,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 148 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -2029,10 +2022,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 149 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -2042,10 +2035,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 150 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -2055,10 +2048,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 151 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -2068,10 +2061,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 152 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -2081,10 +2074,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 153 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -2094,10 +2087,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 154 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -2107,10 +2100,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 155 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -2120,10 +2113,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 156 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -2133,10 +2126,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 157 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -2146,10 +2139,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 158 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -2159,10 +2152,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 159 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -2172,10 +2165,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 160 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -2185,10 +2178,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 161 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -2198,10 +2191,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 162 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -2211,10 +2204,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 163 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -inf @@ -2224,10 +2217,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 164 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -2237,10 +2230,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 165 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -2250,17 +2243,17 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 166 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) - (func $start (; 9 ;) (type $FUNCSIG$v) + (func $start (; 11 ;) (type $FUNCSIG$v) call $start:std/mod ) - (func $null (; 10 ;) (type $FUNCSIG$v) + (func $null (; 12 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/mod.untouched.wat b/tests/compiler/std/mod.untouched.wat index c5a358bdf2..87efdde6d8 100644 --- a/tests/compiler/std/mod.untouched.wat +++ b/tests/compiler/std/mod.untouched.wat @@ -1,37 +1,39 @@ (module (type $FUNCSIG$iddd (func (param f64 f64 f64) (result i32))) (type $FUNCSIG$ddd (func (param f64 f64) (result f64))) - (type $FUNCSIG$idd (func (param f64 f64) (result i32))) (type $FUNCSIG$id (func (param f64) (result i32))) + (type $FUNCSIG$idd (func (param f64 f64) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$ifff (func (param f32 f32 f32) (result i32))) (type $FUNCSIG$fff (func (param f32 f32) (result f32))) - (type $FUNCSIG$iff (func (param f32 f32) (result i32))) (type $FUNCSIG$if (func (param f32) (result i32))) + (type $FUNCSIG$iff (func (param f32 f32) (result i32))) (type $FUNCSIG$v (func)) (import "math" "mod" (func $std/mod/mod (param f64 f64) (result f64))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\n\00\00\00s\00t\00d\00/\00m\00o\00d\00.\00t\00s\00") + (data (i32.const 8) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00s\00t\00d\00/\00m\00o\00d\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) (global $std/mod/js i32 (i32.const 1)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 32)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "mod" (func $std/mod/mod)) (start $start) - (func $~lib/math/NativeMath.mod (; 2 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $~lib/builtins/isNaN (; 2 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + local.get $0 + f64.ne + ) + (func $~lib/math/NativeMath.mod (; 3 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) (local $2 i64) (local $3 i64) (local $4 i64) (local $5 i64) (local $6 i64) (local $7 i64) - (local $8 i32) - (local $9 f64) + (local $8 f64) + (local $9 i64) (local $10 i64) - (local $11 i64) local.get $0 i64.reinterpret_f64 local.set $2 @@ -61,45 +63,38 @@ local.get $7 i64.const 0 i64.eq - local.tee $8 if (result i32) - local.get $8 + i32.const 1 else local.get $4 i64.const 2047 i64.eq end - local.tee $8 if (result i32) - local.get $8 + i32.const 1 else local.get $1 - local.set $9 - local.get $9 - local.get $9 - f64.ne + call $~lib/builtins/isNaN end - i32.const 0 - i32.ne if local.get $0 local.get $1 f64.mul - local.set $9 - local.get $9 - local.get $9 + local.set $8 + local.get $8 + local.get $8 f64.div return end local.get $2 i64.const 1 i64.shl - local.set $10 - local.get $10 + local.set $9 + local.get $9 local.get $7 i64.le_u if - local.get $10 + local.get $9 local.get $7 i64.eq if @@ -181,34 +176,32 @@ local.get $5 i64.gt_s if - block + local.get $2 + local.get $3 + i64.ge_u + if local.get $2 local.get $3 - i64.ge_u + i64.eq if - local.get $2 - local.get $3 - i64.eq - if - f64.const 0 - local.get $0 - f64.mul - return - end - local.get $2 - local.get $3 - i64.sub - local.set $2 + f64.const 0 + local.get $0 + f64.mul + return end local.get $2 - i64.const 1 - i64.shl - local.set $2 - local.get $4 - i64.const 1 + local.get $3 i64.sub - local.set $4 + local.set $2 end + local.get $2 + i64.const 1 + i64.shl + local.set $2 + local.get $4 + i64.const 1 + i64.sub + local.set $4 br $continue|0 end end @@ -235,13 +228,13 @@ i64.const 11 i64.shl i64.clz - local.set $11 + local.set $10 local.get $4 - local.get $11 + local.get $10 i64.sub local.set $4 local.get $2 - local.get $11 + local.get $10 i64.shl local.set $2 local.get $4 @@ -279,11 +272,6 @@ local.get $2 f64.reinterpret_i64 ) - (func $~lib/builtins/isNaN (; 3 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) - local.get $0 - local.get $0 - f64.ne - ) (func $std/mod/check (; 4 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) local.get $1 call $~lib/builtins/isNaN @@ -311,19 +299,16 @@ f64.eq ) (func $std/mod/test_fmod (; 5 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) - (local $3 i32) local.get $0 local.get $1 call $~lib/math/NativeMath.mod local.get $2 call $std/mod/check - local.tee $3 if (result i32) global.get $std/mod/js i32.eqz - local.tee $3 if (result i32) - local.get $3 + i32.const 1 else local.get $0 local.get $1 @@ -332,20 +317,24 @@ call $std/mod/check end else - local.get $3 + i32.const 0 end ) - (func $~lib/math/NativeMathf.mod (; 6 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + (func $~lib/builtins/isNaN (; 6 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) + local.get $0 + local.get $0 + f32.ne + ) + (func $~lib/math/NativeMathf.mod (; 7 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 f32) + (local $8 f32) + (local $9 i32) (local $10 i32) - (local $11 i32) local.get $0 i32.reinterpret_f32 local.set $2 @@ -375,45 +364,38 @@ local.get $7 i32.const 0 i32.eq - local.tee $8 if (result i32) - local.get $8 + i32.const 1 else local.get $4 i32.const 255 i32.eq end - local.tee $8 if (result i32) - local.get $8 + i32.const 1 else local.get $1 - local.set $9 - local.get $9 - local.get $9 - f32.ne + call $~lib/builtins/isNaN end - i32.const 0 - i32.ne if local.get $0 local.get $1 f32.mul - local.set $9 - local.get $9 - local.get $9 + local.set $8 + local.get $8 + local.get $8 f32.div return end local.get $2 i32.const 1 i32.shl - local.set $10 - local.get $10 + local.set $9 + local.get $9 local.get $7 i32.le_u if - local.get $10 + local.get $9 local.get $7 i32.eq if @@ -495,34 +477,32 @@ local.get $5 i32.gt_s if - block + local.get $2 + local.get $3 + i32.ge_u + if local.get $2 local.get $3 - i32.ge_u + i32.eq if - local.get $2 - local.get $3 - i32.eq - if - f32.const 0 - local.get $0 - f32.mul - return - end - local.get $2 - local.get $3 - i32.sub - local.set $2 + f32.const 0 + local.get $0 + f32.mul + return end local.get $2 - i32.const 1 - i32.shl - local.set $2 - local.get $4 - i32.const 1 + local.get $3 i32.sub - local.set $4 + local.set $2 end + local.get $2 + i32.const 1 + i32.shl + local.set $2 + local.get $4 + i32.const 1 + i32.sub + local.set $4 br $continue|0 end end @@ -549,13 +529,13 @@ i32.const 8 i32.shl i32.clz - local.set $11 + local.set $10 local.get $4 - local.get $11 + local.get $10 i32.sub local.set $4 local.get $2 - local.get $11 + local.get $10 i32.shl local.set $2 local.get $4 @@ -591,11 +571,6 @@ local.get $2 f32.reinterpret_i32 ) - (func $~lib/builtins/isNaN (; 7 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) - local.get $0 - local.get $0 - f32.ne - ) (func $std/mod/check (; 8 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) local.get $1 call $~lib/builtins/isNaN @@ -637,10 +612,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 20 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 3 @@ -650,10 +625,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 21 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -3 @@ -663,10 +638,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 22 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -3 @@ -676,10 +651,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 23 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 3.5 @@ -689,10 +664,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 24 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 3.5 @@ -702,10 +677,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 25 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -3.5 @@ -715,10 +690,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 26 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -3.5 @@ -728,10 +703,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 27 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 3 @@ -741,10 +716,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 28 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 3 @@ -754,10 +729,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 29 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -3 @@ -767,10 +742,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 30 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -3 @@ -780,10 +755,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 31 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -793,10 +768,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 32 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.5 @@ -806,10 +781,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 33 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -819,10 +794,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 34 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.5 @@ -832,10 +807,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 35 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.5 @@ -845,10 +820,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 36 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.5 @@ -858,10 +833,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 37 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.5 @@ -871,10 +846,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 38 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.5 @@ -884,10 +859,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 39 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.25 @@ -897,10 +872,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 40 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.25 @@ -910,10 +885,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 41 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.25 @@ -923,10 +898,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 42 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.25 @@ -936,10 +911,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 43 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -949,10 +924,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 44 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -962,10 +937,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 45 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -975,10 +950,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 46 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -988,10 +963,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 47 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -13 @@ -1001,10 +976,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 48 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -1014,10 +989,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 51 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -1027,10 +1002,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 52 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -1040,10 +1015,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 53 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -1053,10 +1028,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 54 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -1066,10 +1041,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 55 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -1079,10 +1054,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 56 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -1092,10 +1067,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 57 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -1105,10 +1080,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 58 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -1118,10 +1093,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 59 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -1131,10 +1106,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 60 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -1144,10 +1119,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 61 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -1157,10 +1132,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 62 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -1170,10 +1145,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 63 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -1183,10 +1158,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 64 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -1196,10 +1171,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 65 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -1209,10 +1184,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 66 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -1222,10 +1197,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 67 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -1235,10 +1210,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 68 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -1248,10 +1223,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 69 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -1261,10 +1236,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 70 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -1274,10 +1249,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 71 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -1287,10 +1262,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 72 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -1300,10 +1275,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 73 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -1314,10 +1289,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 74 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 @@ -1328,10 +1303,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 75 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -1341,10 +1316,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 76 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -1354,10 +1329,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 77 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 @@ -1368,10 +1343,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 78 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 @@ -1382,10 +1357,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 79 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -1395,10 +1370,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 80 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -1408,10 +1383,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 81 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -1422,10 +1397,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 82 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -1436,10 +1411,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 83 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -1449,10 +1424,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 84 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -1462,10 +1437,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 85 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -1476,10 +1451,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 86 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -1490,10 +1465,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 87 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -1503,10 +1478,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 88 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -1517,10 +1492,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 89 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -1531,10 +1506,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 90 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -1546,10 +1521,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 91 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -1559,10 +1534,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 92 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf @@ -1573,10 +1548,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 93 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -1586,10 +1561,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 94 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 @@ -1600,10 +1575,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 95 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 3 @@ -1613,10 +1588,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 104 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 3 @@ -1626,10 +1601,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 105 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -3 @@ -1639,10 +1614,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 106 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -3 @@ -1652,10 +1627,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 107 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 3.5 @@ -1665,10 +1640,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 108 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 3.5 @@ -1678,10 +1653,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 109 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -3.5 @@ -1691,10 +1666,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 110 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -3.5 @@ -1704,10 +1679,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 111 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 3 @@ -1717,10 +1692,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 112 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 3 @@ -1730,10 +1705,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 113 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -3 @@ -1743,10 +1718,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 114 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -3 @@ -1756,10 +1731,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 115 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -1769,10 +1744,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 116 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0.5 @@ -1782,10 +1757,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 117 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -1795,10 +1770,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 118 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0.5 @@ -1808,10 +1783,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 119 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.5 @@ -1821,10 +1796,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 120 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1.5 @@ -1834,10 +1809,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 121 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.5 @@ -1847,10 +1822,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 122 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1.5 @@ -1860,10 +1835,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 123 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -1873,10 +1848,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 126 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -1886,10 +1861,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 127 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -1899,10 +1874,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 128 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -1912,10 +1887,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 129 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -1925,10 +1900,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 130 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -1938,10 +1913,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 131 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -1951,10 +1926,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 132 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -1964,10 +1939,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 133 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -1977,10 +1952,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 134 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -1990,10 +1965,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 135 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -2003,10 +1978,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 136 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -2016,10 +1991,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 137 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -2029,10 +2004,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 138 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -2042,10 +2017,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 139 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -2055,10 +2030,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 140 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -2068,10 +2043,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 141 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -2081,10 +2056,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 142 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -2094,10 +2069,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 143 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -2107,10 +2082,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 144 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -2121,10 +2096,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 145 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -0 @@ -2135,10 +2110,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 146 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -2148,10 +2123,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 147 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -2161,10 +2136,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 148 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 1 @@ -2175,10 +2150,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 149 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const -1 @@ -2189,10 +2164,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 150 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -2202,10 +2177,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 151 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -2215,10 +2190,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 152 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -2229,10 +2204,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 153 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -2243,10 +2218,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 154 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -2256,10 +2231,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 155 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -2269,10 +2244,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 156 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -2283,10 +2258,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 157 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -2297,10 +2272,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 158 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -2310,10 +2285,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 159 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -2324,10 +2299,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 160 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -2338,10 +2313,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 161 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -2353,10 +2328,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 162 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -2366,10 +2341,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 163 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const inf @@ -2380,10 +2355,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 164 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -2393,10 +2368,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 165 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const nan:0x400000 @@ -2407,10 +2382,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 166 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/std/new.json b/tests/compiler/std/new.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/std/new.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/std/new.optimized.wat b/tests/compiler/std/new.optimized.wat index b4c9d97f79..53fd28a777 100644 --- a/tests/compiler/std/new.optimized.wat +++ b/tests/compiler/std/new.optimized.wat @@ -2,35 +2,34 @@ (type $FUNCSIG$v (func)) (type $FUNCSIG$i (func (result i32))) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) (global $std/new/aClass (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) - (func $~lib/allocator/arena/__memory_allocate (; 0 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/rt/stub/__alloc (; 0 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) - global.get $~lib/allocator/arena/offset - local.tee $0 - i32.const 15 + global.get $~lib/rt/stub/offset + i32.const 16 i32.add - i32.const -8 - i32.and local.tee $1 - current_memory + i32.const 23 + i32.add + i32.const -16 + i32.and + local.tee $0 + memory.size local.tee $2 i32.const 16 i32.shl i32.gt_u if local.get $2 - local.get $1 local.get $0 + local.get $1 i32.sub i32.const 65535 i32.add @@ -43,12 +42,12 @@ local.get $3 i32.gt_s select - grow_memory + memory.grow i32.const 0 i32.lt_s if local.get $3 - grow_memory + memory.grow i32.const 0 i32.lt_s if @@ -56,13 +55,22 @@ end end end + local.get $0 + global.set $~lib/rt/stub/offset local.get $1 - global.set $~lib/allocator/arena/offset + i32.const 16 + i32.sub + local.tee $0 + i32.const 3 + i32.store offset=8 local.get $0 + i32.const 8 + i32.store offset=12 + local.get $1 ) (func $std/new/AClass#constructor (; 1 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) - call $~lib/allocator/arena/__memory_allocate + call $~lib/rt/stub/__alloc local.tee $0 i32.const 1 i32.store @@ -81,10 +89,10 @@ local.get $0 ) (func $start (; 2 ;) (type $FUNCSIG$v) - i32.const 8 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset + i32.const 16 + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset call $std/new/AClass#constructor global.set $std/new/aClass ) diff --git a/tests/compiler/std/new.ts b/tests/compiler/std/new.ts index 92f356eb46..2eecae5e88 100644 --- a/tests/compiler/std/new.ts +++ b/tests/compiler/std/new.ts @@ -1,5 +1,3 @@ -import "allocator/arena"; - class AClass { static aStaticField: i32 = 0; aField: i32 = 1; diff --git a/tests/compiler/std/new.untouched.wat b/tests/compiler/std/new.untouched.wat index 49c3dd7520..d3182e92cf 100644 --- a/tests/compiler/std/new.untouched.wat +++ b/tests/compiler/std/new.untouched.wat @@ -1,72 +1,63 @@ (module - (type $FUNCSIG$v (func)) (type $FUNCSIG$iif (func (param i32 f32) (result i32))) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$v (func)) (memory $0 0) (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) (global $std/new/AClass.aStaticField (mut i32) (i32.const 0)) + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) (global $std/new/aClass (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) + (global $~lib/heap/__heap_base i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) - (func $start:~lib/allocator/arena (; 0 ;) (type $FUNCSIG$v) - global.get $~lib/memory/HEAP_BASE - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - ) - (func $~lib/allocator/arena/__memory_allocate (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/rt/stub/__alloc (; 0 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) + (local $8 i32) local.get $0 - i32.const 1073741824 + i32.const 1073741808 i32.gt_u if unreachable end - global.get $~lib/allocator/arena/offset - local.set $1 - local.get $1 + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.set $2 + local.get $2 local.get $0 - local.tee $2 - i32.const 1 local.tee $3 - local.get $2 + i32.const 1 + local.tee $4 local.get $3 + local.get $4 i32.gt_u select i32.add - i32.const 7 + i32.const 15 i32.add - i32.const 7 + i32.const 15 i32.const -1 i32.xor i32.and - local.set $4 - current_memory local.set $5 - local.get $4 + memory.size + local.set $6 local.get $5 + local.get $6 i32.const 16 i32.shl i32.gt_u if - local.get $4 - local.get $1 + local.get $5 + local.get $2 i32.sub i32.const 65535 i32.add @@ -76,23 +67,23 @@ i32.and i32.const 16 i32.shr_u - local.set $2 - local.get $5 - local.tee $3 - local.get $2 - local.tee $6 - local.get $3 + local.set $3 local.get $6 + local.tee $4 + local.get $3 + local.tee $7 + local.get $4 + local.get $7 i32.gt_s select - local.set $3 - local.get $3 - grow_memory + local.set $4 + local.get $4 + memory.grow i32.const 0 i32.lt_s if - local.get $2 - grow_memory + local.get $3 + memory.grow i32.const 0 i32.lt_s if @@ -100,23 +91,33 @@ end end end - local.get $4 - global.set $~lib/allocator/arena/offset + local.get $5 + global.set $~lib/rt/stub/offset + local.get $2 + i32.const 16 + i32.sub + local.set $8 + local.get $8 local.get $1 + i32.store offset=8 + local.get $8 + local.get $0 + i32.store offset=12 + local.get $2 ) - (func $~lib/memory/memory.allocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/rt/stub/__retain (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - call $~lib/allocator/arena/__memory_allocate - return ) - (func $std/new/AClass#constructor (; 3 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) + (func $std/new/AClass#constructor (; 2 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) local.get $0 block (result i32) local.get $0 i32.eqz if i32.const 8 - call $~lib/memory/memory.allocate + i32.const 3 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain local.set $0 end local.get $0 @@ -136,16 +137,25 @@ f32.store offset=4 local.get $0 ) - (func $start:std/new (; 4 ;) (type $FUNCSIG$v) - call $start:~lib/allocator/arena + (func $start:std/new (; 3 ;) (type $FUNCSIG$v) + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset i32.const 0 f32.const 3 call $std/new/AClass#constructor global.set $std/new/aClass ) - (func $start (; 5 ;) (type $FUNCSIG$v) + (func $start (; 4 ;) (type $FUNCSIG$v) call $start:std/new ) - (func $null (; 6 ;) (type $FUNCSIG$v) + (func $null (; 5 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/std/object-literal.json b/tests/compiler/std/object-literal.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/std/object-literal.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/std/object-literal.optimized.wat b/tests/compiler/std/object-literal.optimized.wat new file mode 100644 index 0000000000..dece1220f0 --- /dev/null +++ b/tests/compiler/std/object-literal.optimized.wat @@ -0,0 +1,249 @@ +(module + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$v (func)) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (memory $0 1) + (data (i32.const 8) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00h\00e\00l\00l\00o\00 \00w\00o\00r\00l\00d") + (data (i32.const 48) "*\00\00\00\01\00\00\00\01\00\00\00*\00\00\00s\00t\00d\00/\00o\00b\00j\00e\00c\00t\00-\00l\00i\00t\00e\00r\00a\00l\00.\00t\00s") + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) + (export "memory" (memory $0)) + (start $start) + (func $~lib/rt/stub/__alloc (; 1 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + i32.const 1073741808 + i32.gt_u + if + unreachable + end + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.tee $3 + local.get $0 + i32.const 1 + local.get $0 + i32.const 1 + i32.gt_u + select + i32.add + i32.const 15 + i32.add + i32.const -16 + i32.and + local.tee $2 + memory.size + local.tee $4 + i32.const 16 + i32.shl + i32.gt_u + if + local.get $4 + local.get $2 + local.get $3 + i32.sub + i32.const 65535 + i32.add + i32.const -65536 + i32.and + i32.const 16 + i32.shr_u + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + memory.grow + i32.const 0 + i32.lt_s + if + local.get $5 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + end + local.get $2 + global.set $~lib/rt/stub/offset + local.get $3 + i32.const 16 + i32.sub + local.tee $2 + local.get $1 + i32.store offset=8 + local.get $2 + local.get $0 + i32.store offset=12 + local.get $3 + ) + (func $~lib/string/String#get:length (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u + ) + (func $~lib/util/string/compareImpl (; 3 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + i32.const 24 + local.set $2 + loop $continue|0 + local.get $1 + if (result i32) + local.get $0 + i32.load16_u + local.get $2 + i32.load16_u + i32.sub + local.tee $3 + i32.eqz + else + i32.const 0 + end + if + local.get $1 + i32.const 1 + i32.sub + local.set $1 + local.get $0 + i32.const 2 + i32.add + local.set $0 + local.get $2 + i32.const 2 + i32.add + local.set $2 + br $continue|0 + end + end + local.get $3 + ) + (func $~lib/string/String.__eq (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + i32.const 24 + i32.eq + if + i32.const 1 + return + end + block $folding-inner0 + i32.const 0 + i32.const 1 + local.get $0 + select + br_if $folding-inner0 + local.get $0 + call $~lib/string/String#get:length + local.tee $1 + i32.const 24 + call $~lib/string/String#get:length + i32.ne + br_if $folding-inner0 + local.get $0 + local.get $1 + call $~lib/util/string/compareImpl + i32.eqz + return + end + i32.const 0 + ) + (func $std/object-literal/bar (; 5 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + i32.load + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 64 + i32.const 7 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 64 + i32.const 8 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + ) + (func $start:std/object-literal (; 6 ;) (type $FUNCSIG$v) + (local $0 i32) + i32.const 112 + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset + i32.const 8 + i32.const 3 + call $~lib/rt/stub/__alloc + local.tee $0 + i32.const 1 + i32.store + local.get $0 + i32.const 24 + i32.store offset=4 + local.get $0 + call $std/object-literal/bar + i32.const 4 + i32.const 4 + call $~lib/rt/stub/__alloc + local.tee $0 + i32.const 2 + i32.store + local.get $0 + i32.load + i32.const 2 + i32.ne + if + i32.const 0 + i32.const 64 + i32.const 24 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 4 + i32.const 4 + call $~lib/rt/stub/__alloc + local.tee $0 + i32.const 3 + i32.store + local.get $0 + i32.load + i32.const 3 + i32.ne + if + i32.const 0 + i32.const 64 + i32.const 19 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + ) + (func $start (; 7 ;) (type $FUNCSIG$v) + call $start:std/object-literal + ) + (func $null (; 8 ;) (type $FUNCSIG$v) + nop + ) +) diff --git a/tests/compiler/object-literal.ts b/tests/compiler/std/object-literal.ts similarity index 93% rename from tests/compiler/object-literal.ts rename to tests/compiler/std/object-literal.ts index e9682c107c..d5625db01c 100644 --- a/tests/compiler/object-literal.ts +++ b/tests/compiler/std/object-literal.ts @@ -1,5 +1,3 @@ -import "allocator/arena"; - class Foo { bar: i32; baz: string; diff --git a/tests/compiler/std/object-literal.untouched.wat b/tests/compiler/std/object-literal.untouched.wat new file mode 100644 index 0000000000..507c5536a6 --- /dev/null +++ b/tests/compiler/std/object-literal.untouched.wat @@ -0,0 +1,395 @@ +(module + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$iiiiii (func (param i32 i32 i32 i32 i32) (result i32))) + (type $FUNCSIG$v (func)) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (memory $0 1) + (data (i32.const 8) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00h\00e\00l\00l\00o\00 \00w\00o\00r\00l\00d\00") + (data (i32.const 48) "*\00\00\00\01\00\00\00\01\00\00\00*\00\00\00s\00t\00d\00/\00o\00b\00j\00e\00c\00t\00-\00l\00i\00t\00e\00r\00a\00l\00.\00t\00s\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) + (global $~lib/heap/__heap_base i32 (i32.const 108)) + (export "memory" (memory $0)) + (start $start) + (func $~lib/rt/stub/__alloc (; 1 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + local.get $0 + i32.const 1073741808 + i32.gt_u + if + unreachable + end + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.set $2 + local.get $2 + local.get $0 + local.tee $3 + i32.const 1 + local.tee $4 + local.get $3 + local.get $4 + i32.gt_u + select + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $5 + memory.size + local.set $6 + local.get $5 + local.get $6 + i32.const 16 + i32.shl + i32.gt_u + if + local.get $5 + local.get $2 + i32.sub + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $6 + local.tee $4 + local.get $3 + local.tee $7 + local.get $4 + local.get $7 + i32.gt_s + select + local.set $4 + local.get $4 + memory.grow + i32.const 0 + i32.lt_s + if + local.get $3 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + end + local.get $5 + global.set $~lib/rt/stub/offset + local.get $2 + i32.const 16 + i32.sub + local.set $8 + local.get $8 + local.get $1 + i32.store offset=8 + local.get $8 + local.get $0 + i32.store offset=12 + local.get $2 + ) + (func $~lib/rt/stub/__retain (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + ) + (func $~lib/rt/stub/__release (; 3 ;) (type $FUNCSIG$vi) (param $0 i32) + nop + ) + (func $~lib/string/String#get:length (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u + ) + (func $~lib/util/string/compareImpl (; 5 ;) (type $FUNCSIG$iiiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $2 + call $~lib/rt/stub/__retain + drop + i32.const 0 + local.set $5 + local.get $0 + local.get $1 + i32.const 1 + i32.shl + i32.add + local.set $6 + local.get $2 + local.get $3 + i32.const 1 + i32.shl + i32.add + local.set $7 + block $break|0 + loop $continue|0 + local.get $4 + if (result i32) + local.get $6 + i32.load16_u + local.get $7 + i32.load16_u + i32.sub + local.tee $5 + i32.eqz + else + i32.const 0 + end + if + local.get $4 + i32.const 1 + i32.sub + local.set $4 + local.get $6 + i32.const 2 + i32.add + local.set $6 + local.get $7 + i32.const 2 + i32.add + local.set $7 + br $continue|0 + end + end + end + local.get $5 + local.set $8 + local.get $0 + call $~lib/rt/stub/__release + local.get $2 + call $~lib/rt/stub/__release + local.get $8 + ) + (func $~lib/string/String.__eq (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $1 + call $~lib/rt/stub/__retain + drop + local.get $0 + local.get $1 + i32.eq + if + i32.const 1 + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 + return + end + local.get $0 + i32.const 0 + i32.eq + if (result i32) + i32.const 1 + else + local.get $1 + i32.const 0 + i32.eq + end + if + i32.const 0 + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 + return + end + local.get $0 + call $~lib/string/String#get:length + local.set $3 + local.get $3 + local.get $1 + call $~lib/string/String#get:length + i32.ne + if + i32.const 0 + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 + return + end + local.get $0 + i32.const 0 + local.get $1 + i32.const 0 + local.get $3 + call $~lib/util/string/compareImpl + i32.eqz + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 + ) + (func $std/object-literal/bar (; 7 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $0 + i32.load + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 64 + i32.const 7 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + i32.const 24 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 64 + i32.const 8 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/stub/__release + ) + (func $std/object-literal/bar2 (; 8 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $0 + i32.load + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 64 + i32.const 24 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/stub/__release + ) + (func $std/object-literal/Foo2#test (; 9 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + i32.load + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 64 + i32.const 19 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + ) + (func $start:std/object-literal (; 10 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset + block (result i32) + i32.const 8 + i32.const 3 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain + local.set $0 + local.get $0 + i32.const 1 + i32.store + local.get $0 + i32.const 24 + i32.store offset=4 + local.get $0 + end + call $std/object-literal/bar + block (result i32) + i32.const 4 + i32.const 4 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + i32.const 2 + i32.store + local.get $1 + end + call $std/object-literal/bar2 + block (result i32) + i32.const 4 + i32.const 4 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain + local.set $2 + local.get $2 + i32.const 3 + i32.store + local.get $2 + end + call $std/object-literal/Foo2#test + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 + call $~lib/rt/stub/__release + ) + (func $start (; 11 ;) (type $FUNCSIG$v) + call $start:std/object-literal + ) + (func $null (; 12 ;) (type $FUNCSIG$v) + ) +) diff --git a/tests/compiler/std/operator-overloading.json b/tests/compiler/std/operator-overloading.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/std/operator-overloading.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/std/operator-overloading.optimized.wat b/tests/compiler/std/operator-overloading.optimized.wat index 180394a8c7..1fd696f1be 100644 --- a/tests/compiler/std/operator-overloading.optimized.wat +++ b/tests/compiler/std/operator-overloading.optimized.wat @@ -1,17 +1,15 @@ (module - (type $FUNCSIG$v (func)) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$ddd (func (param f64 f64) (result f64))) (type $FUNCSIG$ddi (func (param f64 i32) (result f64))) - (type $FUNCSIG$i (func (result i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\1b\00\00\00s\00t\00d\00/\00o\00p\00e\00r\00a\00t\00o\00r\00-\00o\00v\00e\00r\00l\00o\00a\00d\00i\00n\00g\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) + (data (i32.const 8) "6\00\00\00\01\00\00\00\01\00\00\006\00\00\00s\00t\00d\00/\00o\00p\00e\00r\00a\00t\00o\00r\00-\00o\00v\00e\00r\00l\00o\00a\00d\00i\00n\00g\00.\00t\00s") + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) (global $std/operator-overloading/a1 (mut i32) (i32.const 0)) (global $std/operator-overloading/a2 (mut i32) (i32.const 0)) (global $std/operator-overloading/a (mut i32) (i32.const 0)) @@ -79,29 +77,30 @@ (global $std/operator-overloading/aii2 (mut i32) (i32.const 0)) (global $std/operator-overloading/aii (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) - (func $~lib/allocator/arena/__memory_allocate (; 1 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) + (func $~lib/rt/stub/__alloc (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) - global.get $~lib/allocator/arena/offset - local.tee $0 - i32.const 15 + (local $4 i32) + global.get $~lib/rt/stub/offset + i32.const 16 i32.add - i32.const -8 + local.tee $2 + i32.const 23 + i32.add + i32.const -16 i32.and local.tee $1 - current_memory - local.tee $2 + memory.size + local.tee $3 i32.const 16 i32.shl i32.gt_u if - local.get $2 + local.get $3 local.get $1 - local.get $0 + local.get $2 i32.sub i32.const 65535 i32.add @@ -109,17 +108,17 @@ i32.and i32.const 16 i32.shr_u - local.tee $3 - local.get $2 + local.tee $4 local.get $3 + local.get $4 i32.gt_s select - grow_memory + memory.grow i32.const 0 i32.lt_s if - local.get $3 - grow_memory + local.get $4 + memory.grow i32.const 0 i32.lt_s if @@ -128,12 +127,22 @@ end end local.get $1 - global.set $~lib/allocator/arena/offset + global.set $~lib/rt/stub/offset + local.get $2 + i32.const 16 + i32.sub + local.tee $1 local.get $0 + i32.store offset=8 + local.get $1 + i32.const 8 + i32.store offset=12 + local.get $2 ) (func $std/operator-overloading/Tester#constructor (; 2 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - call $~lib/allocator/arena/__memory_allocate + i32.const 3 + call $~lib/rt/stub/__alloc local.tee $2 local.get $0 i32.store @@ -220,9 +229,9 @@ f64.mul ) (func $~lib/math/NativeMath.pow (; 4 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) - (local $2 i32) + (local $2 f64) (local $3 f64) - (local $4 f64) + (local $4 i32) (local $5 i32) (local $6 i32) (local $7 f64) @@ -251,7 +260,7 @@ local.tee $17 i32.const 2147483647 i32.and - local.set $5 + local.set $4 local.get $1 i64.reinterpret_f64 local.tee $16 @@ -272,46 +281,34 @@ f64.const 1 return end - local.get $5 + i32.const 1 + local.get $6 + i32.const 0 + i32.ne + i32.const 0 + local.get $8 + i32.const 2146435072 + i32.eq + select + i32.const 1 + local.get $8 i32.const 2146435072 i32.gt_s - local.tee $2 - i32.eqz - if - local.get $5 - i32.const 2146435072 - i32.eq - local.tee $2 - if - local.get $19 - i32.const 0 - i32.ne - local.set $2 - end - end - local.get $2 - i32.eqz - if - local.get $8 - i32.const 2146435072 - i32.gt_s - local.set $2 - end - local.get $2 - i32.eqz - if - local.get $8 - i32.const 2146435072 - i32.eq - local.tee $2 - if - local.get $6 - i32.const 0 - i32.ne - local.set $2 - end - end - local.get $2 + i32.const 1 + local.get $19 + i32.const 0 + i32.ne + i32.const 0 + local.get $4 + i32.const 2146435072 + i32.eq + select + local.get $4 + i32.const 2146435072 + i32.gt_s + select + select + select if local.get $0 local.get $1 @@ -344,8 +341,8 @@ i32.gt_s local.tee $13 select - local.tee $2 - local.get $2 + local.tee $5 + local.get $5 i32.const 52 i32.const 20 local.get $13 @@ -354,13 +351,13 @@ i32.sub local.tee $13 i32.shr_s - local.tee $2 + local.tee $5 local.get $13 i32.shl i32.eq if (result i32) i32.const 2 - local.get $2 + local.get $5 i32.const 1 i32.and i32.sub @@ -380,13 +377,13 @@ i32.const 2146435072 i32.eq if - local.get $5 + local.get $4 i32.const 1072693248 i32.sub local.get $19 i32.or if - local.get $5 + local.get $4 i32.const 1072693248 i32.ge_s if @@ -457,66 +454,58 @@ end local.get $0 f64.abs - local.set $4 + local.set $3 local.get $19 i32.eqz if - local.get $5 - i32.eqz - local.tee $2 - i32.eqz - if - local.get $5 - i32.const 2146435072 - i32.eq - local.set $2 - end - local.get $2 - i32.eqz - if - local.get $5 - i32.const 1072693248 - i32.eq - local.set $2 - end - local.get $2 + i32.const 1 + local.get $4 + i32.const 1072693248 + i32.eq + local.get $4 + i32.const 2146435072 + i32.eq + i32.const 1 + local.get $4 + select + select if f64.const 1 - local.get $4 + local.get $3 f64.div - local.get $4 + local.get $3 local.get $9 i32.const 0 i32.lt_s select - local.set $4 + local.set $3 local.get $17 i32.const 0 i32.lt_s if (result f64) - local.get $5 + local.get $4 i32.const 1072693248 i32.sub local.get $11 i32.or if (result f64) - local.get $4 + local.get $3 f64.neg - local.get $4 + local.get $3 local.get $11 i32.const 1 i32.eq select else - local.get $4 - local.get $4 + local.get $3 + local.get $3 f64.sub local.tee $0 local.get $0 f64.div end else - local.get $4 + local.get $3 end return end @@ -554,7 +543,7 @@ i32.const 1139802112 i32.gt_s if - local.get $5 + local.get $4 i32.const 1072693247 i32.le_s if @@ -566,7 +555,7 @@ select return end - local.get $5 + local.get $4 i32.const 1072693248 i32.ge_s if @@ -579,60 +568,56 @@ return end end - local.get $5 + local.get $4 i32.const 1072693247 i32.lt_s if + local.get $7 + f64.const 1.e+300 + f64.mul + f64.const 1.e+300 + f64.mul + local.get $7 + f64.const 1e-300 + f64.mul + f64.const 1e-300 + f64.mul local.get $9 i32.const 0 i32.lt_s - if (result f64) - local.get $7 - f64.const 1.e+300 - f64.mul - f64.const 1.e+300 - f64.mul - else - local.get $7 - f64.const 1e-300 - f64.mul - f64.const 1e-300 - f64.mul - end + select return end - local.get $5 + local.get $4 i32.const 1072693248 i32.gt_s if + local.get $7 + f64.const 1.e+300 + f64.mul + f64.const 1.e+300 + f64.mul + local.get $7 + f64.const 1e-300 + f64.mul + f64.const 1e-300 + f64.mul local.get $9 i32.const 0 i32.gt_s - if (result f64) - local.get $7 - f64.const 1.e+300 - f64.mul - f64.const 1.e+300 - f64.mul - else - local.get $7 - f64.const 1e-300 - f64.mul - f64.const 1e-300 - f64.mul - end + select return end - local.get $4 + local.get $3 f64.const 1 f64.sub - local.tee $3 - local.get $3 + local.tee $2 + local.get $2 f64.mul f64.const 0.5 - local.get $3 + local.get $2 f64.const 0.3333333333333333 - local.get $3 + local.get $2 f64.const 0.25 f64.mul f64.sub @@ -641,10 +626,10 @@ f64.mul local.set $0 f64.const 1.4426950216293335 - local.get $3 + local.get $2 f64.mul - local.tee $4 - local.get $3 + local.tee $3 + local.get $2 f64.const 1.9259629911266175e-08 f64.mul local.get $0 @@ -660,50 +645,50 @@ local.set $10 local.get $0 local.get $10 - local.get $4 + local.get $3 f64.sub f64.sub else i32.const 0 local.set $6 - local.get $5 + local.get $4 i32.const 1048576 i32.lt_s if (result i32) - local.get $4 + local.get $3 f64.const 9007199254740992 f64.mul - local.tee $4 + local.tee $3 i64.reinterpret_f64 i64.const 32 i64.shr_u i32.wrap_i64 - local.set $5 + local.set $4 i32.const -53 else i32.const 0 end - local.get $5 + local.get $4 i32.const 20 i32.shr_s i32.const 1023 i32.sub i32.add local.set $6 - local.get $5 + local.get $4 i32.const 1048575 i32.and - local.tee $2 + local.tee $5 i32.const 1072693248 i32.or - local.set $5 - local.get $2 + local.set $4 + local.get $5 i32.const 235662 i32.le_s if (result i32) i32.const 0 else - local.get $2 + local.get $5 i32.const 767610 i32.lt_s if (result i32) @@ -713,38 +698,38 @@ i32.const 1 i32.add local.set $6 - local.get $5 + local.get $4 i32.const -1048576 i32.add - local.set $5 + local.set $4 i32.const 0 end end - local.set $2 - local.get $4 + local.set $5 + local.get $3 i64.reinterpret_f64 i64.const 4294967295 i64.and - local.get $5 + local.get $4 i64.extend_i32_s i64.const 32 i64.shl i64.or f64.reinterpret_i64 - local.tee $4 + local.tee $3 f64.const 1.5 f64.const 1 - local.get $2 + local.get $5 select local.tee $0 f64.sub local.tee $10 f64.const 1 - local.get $4 + local.get $3 local.get $0 f64.add f64.div - local.tee $3 + local.tee $2 f64.mul local.tee $18 i64.reinterpret_f64 @@ -752,15 +737,15 @@ i64.and f64.reinterpret_i64 local.set $14 + local.get $3 local.get $4 - local.get $5 i32.const 1 i32.shr_s i32.const 536870912 i32.or i32.const 524288 i32.add - local.get $2 + local.get $5 i32.const 18 i32.shl i32.add @@ -768,7 +753,7 @@ i64.const 32 i64.shl f64.reinterpret_i64 - local.tee $4 + local.tee $3 local.get $0 f64.sub f64.sub @@ -809,10 +794,10 @@ f64.mul f64.add f64.mul - local.get $3 + local.get $2 local.get $10 local.get $14 - local.get $4 + local.get $3 f64.mul f64.sub local.get $14 @@ -820,7 +805,7 @@ f64.mul f64.sub f64.mul - local.tee $3 + local.tee $2 local.get $14 local.get $18 f64.add @@ -834,8 +819,8 @@ f64.reinterpret_i64 local.tee $10 f64.mul - local.tee $4 - local.get $3 + local.tee $3 + local.get $2 local.get $10 f64.mul local.get $0 @@ -854,15 +839,15 @@ i64.const -4294967296 i64.and f64.reinterpret_i64 - local.tee $3 + local.tee $2 f64.mul local.tee $20 f64.const -7.028461650952758e-09 - local.get $3 + local.get $2 f64.mul local.get $0 + local.get $2 local.get $3 - local.get $4 f64.sub f64.sub f64.const 0.9617966939259756 @@ -870,16 +855,16 @@ f64.add f64.const 1.350039202129749e-08 f64.const 0 - local.get $2 + local.get $5 select f64.add - local.tee $3 + local.tee $2 f64.add f64.const 0.5849624872207642 f64.const 0 - local.get $2 + local.get $5 select - local.tee $4 + local.tee $3 f64.add local.get $6 f64.convert_i32_s @@ -890,17 +875,17 @@ i64.and f64.reinterpret_i64 local.set $10 - local.get $3 + local.get $2 local.get $10 local.get $0 f64.sub - local.get $4 + local.get $3 f64.sub local.get $20 f64.sub f64.sub end - local.set $4 + local.set $3 local.get $1 local.get $1 i64.reinterpret_f64 @@ -912,20 +897,20 @@ local.get $10 f64.mul local.get $1 - local.get $4 + local.get $3 f64.mul f64.add local.tee $1 local.get $0 local.get $10 f64.mul - local.tee $3 + local.tee $2 f64.add local.tee $0 i64.reinterpret_f64 local.tee $16 i32.wrap_i64 - local.set $2 + local.set $5 block $folding-inner1 block $folding-inner0 local.get $16 @@ -939,16 +924,16 @@ local.get $12 i32.const 1083179008 i32.sub - local.get $2 + local.get $5 i32.or - br_if $folding-inner0 local.get $1 f64.const 8.008566259537294e-17 f64.add local.get $0 - local.get $3 + local.get $2 f64.sub f64.gt + i32.or br_if $folding-inner0 else local.get $12 @@ -960,14 +945,14 @@ local.get $12 i32.const -1064252416 i32.sub - local.get $2 + local.get $5 i32.or - br_if $folding-inner1 local.get $1 local.get $0 - local.get $3 + local.get $2 f64.sub f64.le + i32.or br_if $folding-inner1 end end @@ -979,7 +964,7 @@ i32.shr_s i32.const 1023 i32.sub - local.set $2 + local.set $5 i32.const 0 local.set $6 local.get $13 @@ -987,7 +972,7 @@ i32.gt_s if i32.const 1048576 - local.get $2 + local.get $5 i32.const 1 i32.add i32.shr_s @@ -1000,9 +985,9 @@ i32.shr_s i32.const 1023 i32.sub - local.set $2 + local.set $5 i32.const 1048575 - local.get $2 + local.get $5 i32.shr_s i32.const -1 i32.xor @@ -1019,7 +1004,7 @@ i32.const 1048576 i32.or i32.const 20 - local.get $2 + local.get $5 i32.sub i32.shr_s local.set $6 @@ -1032,13 +1017,13 @@ i32.lt_s select local.set $6 - local.get $3 + local.get $2 local.get $0 f64.sub - local.set $3 + local.set $2 end local.get $1 - local.get $3 + local.get $2 f64.add i64.reinterpret_f64 i64.const -4294967296 @@ -1047,10 +1032,10 @@ local.tee $0 f64.const 0.6931471824645996 f64.mul - local.tee $4 + local.tee $3 local.get $1 local.get $0 - local.get $3 + local.get $2 f64.sub f64.sub f64.const 0.6931471805599453 @@ -1061,14 +1046,14 @@ f64.add local.tee $1 f64.add - local.tee $3 - local.get $3 + local.tee $2 + local.get $2 f64.mul local.set $0 local.get $7 f64.const 1 - local.get $3 - local.get $3 + local.get $2 + local.get $2 local.get $0 f64.const 0.16666666666666602 local.get $0 @@ -1096,17 +1081,17 @@ f64.sub f64.div local.get $1 + local.get $2 local.get $3 - local.get $4 f64.sub f64.sub local.tee $0 - local.get $3 + local.get $2 local.get $0 f64.mul f64.add f64.sub - local.get $3 + local.get $2 f64.sub f64.sub local.tee $0 @@ -1118,7 +1103,7 @@ i32.const 20 i32.shl i32.add - local.tee $2 + local.tee $5 i32.const 20 i32.shr_s i32.const 0 @@ -1132,7 +1117,7 @@ i64.reinterpret_f64 i64.const 4294967295 i64.and - local.get $2 + local.get $5 i64.extend_i32_s i64.const 32 i64.shl @@ -1155,33 +1140,88 @@ f64.const 1e-300 f64.mul ) - (func $std/operator-overloading/Tester.pow (; 5 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $std/operator-overloading/Tester.pow (; 5 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.load + f64.convert_i32_s + local.get $1 + i32.load + f64.convert_i32_s + call $~lib/math/NativeMath.pow + i32.trunc_f64_s + local.get $0 + i32.load offset=4 + f64.convert_i32_s + local.get $1 + i32.load offset=4 + f64.convert_i32_s + call $~lib/math/NativeMath.pow + i32.trunc_f64_s + call $std/operator-overloading/Tester#constructor + ) + (func $std/operator-overloading/Tester.equals (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.load + local.get $1 + i32.load + i32.eq + if (result i32) + local.get $0 + i32.load offset=4 + local.get $1 + i32.load offset=4 + i32.eq + else + i32.const 0 + end + ) + (func $std/operator-overloading/Tester.notEquals (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.load - f64.convert_i32_s local.get $1 i32.load - f64.convert_i32_s - call $~lib/math/NativeMath.pow - i32.trunc_f64_s + i32.ne + if (result i32) + local.get $0 + i32.load offset=4 + local.get $1 + i32.load offset=4 + i32.ne + else + i32.const 0 + end + ) + (func $std/operator-overloading/TesterInlineStatic#constructor (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + i32.const 4 + call $~lib/rt/stub/__alloc + local.tee $2 local.get $0 - i32.load offset=4 - f64.convert_i32_s + i32.store + local.get $2 local.get $1 - i32.load offset=4 - f64.convert_i32_s - call $~lib/math/NativeMath.pow - i32.trunc_f64_s - call $std/operator-overloading/Tester#constructor + i32.store offset=4 + local.get $2 + ) + (func $std/operator-overloading/TesterInlineInstance#constructor (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + i32.const 5 + call $~lib/rt/stub/__alloc + local.tee $2 + local.get $0 + i32.store + local.get $2 + local.get $1 + i32.store offset=4 + local.get $2 ) - (func $start:std/operator-overloading (; 6 ;) (type $FUNCSIG$v) + (func $start:std/operator-overloading (; 10 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) - (local $2 i32) - i32.const 72 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset + i32.const 80 + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset i32.const 1 i32.const 2 call $std/operator-overloading/Tester#constructor @@ -1208,22 +1248,21 @@ i32.load i32.const 3 i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/a i32.load offset=4 i32.const 5 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 147 + i32.const 24 + i32.const 145 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2 @@ -1250,23 +1289,21 @@ global.set $std/operator-overloading/s global.get $std/operator-overloading/s i32.load - i32.eqz - local.tee $0 if (result i32) + i32.const 0 + else global.get $std/operator-overloading/s i32.load offset=4 i32.const 6 i32.eq - else - local.get $0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 153 + i32.const 24 + i32.const 151 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2 @@ -1295,22 +1332,21 @@ i32.load i32.const 6 i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/m i32.load offset=4 i32.const 10 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 159 + i32.const 24 + i32.const 157 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 6 @@ -1339,22 +1375,21 @@ i32.load i32.const 2 i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/d i32.load offset=4 i32.const 5 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 165 + i32.const 24 + i32.const 163 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 10 @@ -1383,21 +1418,20 @@ i32.load i32.const 4 i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/f i32.load offset=4 i32.eqz else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 171 + i32.const 24 + i32.const 169 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2 @@ -1416,22 +1450,21 @@ i32.load i32.const 16 i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/p i32.load offset=4 i32.const 243 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 177 + i32.const 24 + i32.const 175 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 255 @@ -1460,22 +1493,21 @@ i32.load i32.const 15 i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/n i32.load offset=4 i32.const 15 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 183 + i32.const 24 + i32.const 181 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 3855 @@ -1504,22 +1536,21 @@ i32.load i32.const 65535 i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/o i32.load offset=4 i32.const 255 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 189 + i32.const 24 + i32.const 187 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 255 @@ -1548,22 +1579,21 @@ i32.load i32.const 65535 i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/x i32.load offset=4 i32.const 255 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 195 + i32.const 24 + i32.const 193 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -1575,32 +1605,18 @@ call $std/operator-overloading/Tester#constructor global.set $std/operator-overloading/eq2 global.get $std/operator-overloading/eq1 - local.tee $1 - i32.load global.get $std/operator-overloading/eq2 - local.tee $2 - i32.load - i32.eq - local.tee $0 - if (result i32) - local.get $1 - i32.load offset=4 - local.get $2 - i32.load offset=4 - i32.eq - else - local.get $0 - end + call $std/operator-overloading/Tester.equals global.set $std/operator-overloading/eq global.get $std/operator-overloading/eq i32.const 1 i32.ne if i32.const 0 - i32.const 8 - i32.const 201 + i32.const 24 + i32.const 199 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -1612,86 +1628,44 @@ call $std/operator-overloading/Tester#constructor global.set $std/operator-overloading/eq4 global.get $std/operator-overloading/eq3 - local.tee $1 - i32.load global.get $std/operator-overloading/eq4 - local.tee $2 - i32.load - i32.eq - local.tee $0 - if (result i32) - local.get $1 - i32.load offset=4 - local.get $2 - i32.load offset=4 - i32.eq - else - local.get $0 - end + call $std/operator-overloading/Tester.equals global.set $std/operator-overloading/eqf global.get $std/operator-overloading/eqf if i32.const 0 - i32.const 8 - i32.const 207 + i32.const 24 + i32.const 205 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/operator-overloading/eq1 - local.tee $1 - i32.load global.get $std/operator-overloading/eq2 - local.tee $2 - i32.load - i32.ne - local.tee $0 - if (result i32) - local.get $1 - i32.load offset=4 - local.get $2 - i32.load offset=4 - i32.ne - else - local.get $0 - end + call $std/operator-overloading/Tester.notEquals global.set $std/operator-overloading/eq global.get $std/operator-overloading/eq if i32.const 0 - i32.const 8 - i32.const 211 + i32.const 24 + i32.const 209 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/operator-overloading/eq3 - local.tee $1 - i32.load global.get $std/operator-overloading/eq4 - local.tee $2 - i32.load - i32.ne - local.tee $0 - if (result i32) - local.get $1 - i32.load offset=4 - local.get $2 - i32.load offset=4 - i32.ne - else - local.get $0 - end + call $std/operator-overloading/Tester.notEquals global.set $std/operator-overloading/eqf global.get $std/operator-overloading/eqf i32.const 1 i32.ne if i32.const 0 - i32.const 8 - i32.const 215 + i32.const 24 + i32.const 213 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2 @@ -1703,21 +1677,20 @@ call $std/operator-overloading/Tester#constructor global.set $std/operator-overloading/gt2 global.get $std/operator-overloading/gt1 - local.tee $1 + local.tee $0 i32.load global.get $std/operator-overloading/gt2 - local.tee $2 + local.tee $1 i32.load i32.gt_s - local.tee $0 if (result i32) - local.get $1 + local.get $0 i32.load offset=4 - local.get $2 + local.get $1 i32.load offset=4 i32.gt_s else - local.get $0 + i32.const 0 end global.set $std/operator-overloading/gt global.get $std/operator-overloading/gt @@ -1725,10 +1698,10 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 221 + i32.const 24 + i32.const 219 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2 @@ -1740,21 +1713,20 @@ call $std/operator-overloading/Tester#constructor global.set $std/operator-overloading/gte2 global.get $std/operator-overloading/gte1 - local.tee $1 + local.tee $0 i32.load global.get $std/operator-overloading/gte2 - local.tee $2 + local.tee $1 i32.load i32.ge_s - local.tee $0 if (result i32) - local.get $1 + local.get $0 i32.load offset=4 - local.get $2 + local.get $1 i32.load offset=4 i32.ge_s else - local.get $0 + i32.const 0 end global.set $std/operator-overloading/gte global.get $std/operator-overloading/gte @@ -1762,10 +1734,10 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 227 + i32.const 24 + i32.const 225 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 5 @@ -1777,21 +1749,20 @@ call $std/operator-overloading/Tester#constructor global.set $std/operator-overloading/le2 global.get $std/operator-overloading/le1 - local.tee $1 + local.tee $0 i32.load global.get $std/operator-overloading/le2 - local.tee $2 + local.tee $1 i32.load i32.lt_s - local.tee $0 if (result i32) - local.get $1 + local.get $0 i32.load offset=4 - local.get $2 + local.get $1 i32.load offset=4 i32.lt_s else - local.get $0 + i32.const 0 end global.set $std/operator-overloading/le global.get $std/operator-overloading/le @@ -1799,10 +1770,10 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 233 + i32.const 24 + i32.const 231 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 4 @@ -1814,21 +1785,20 @@ call $std/operator-overloading/Tester#constructor global.set $std/operator-overloading/leq2 global.get $std/operator-overloading/leq1 - local.tee $1 + local.tee $0 i32.load global.get $std/operator-overloading/leq2 - local.tee $2 + local.tee $1 i32.load i32.le_s - local.tee $0 if (result i32) - local.get $1 + local.get $0 i32.load offset=4 - local.get $2 + local.get $1 i32.load offset=4 i32.le_s else - local.get $0 + i32.const 0 end global.set $std/operator-overloading/leq global.get $std/operator-overloading/leq @@ -1836,10 +1806,10 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 239 + i32.const 24 + i32.const 237 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 8 @@ -1861,22 +1831,21 @@ i32.load i32.const 1 i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/sres i32.load offset=4 i32.const 2 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 244 + i32.const 24 + i32.const 242 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const -8 @@ -1898,22 +1867,21 @@ i32.load i32.const 536870911 i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/ures i32.load offset=4 i32.const 536870910 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 249 + i32.const 24 + i32.const 247 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -1935,22 +1903,21 @@ i32.load i32.const 8 i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/sres i32.load offset=4 i32.const 16 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 254 + i32.const 24 + i32.const 252 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -1969,7 +1936,6 @@ global.get $std/operator-overloading/pos i32.load i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/pres i32.load offset=4 @@ -1977,15 +1943,15 @@ i32.load offset=4 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 259 + i32.const 24 + i32.const 257 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const -1 @@ -2010,7 +1976,6 @@ i32.load i32.sub i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/nres i32.load offset=4 @@ -2020,15 +1985,15 @@ i32.sub i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 264 + i32.const 24 + i32.const 262 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 255 @@ -2053,7 +2018,6 @@ i32.const -1 i32.xor i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/res i32.load offset=4 @@ -2063,15 +2027,15 @@ i32.xor i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 269 + i32.const 24 + i32.const 267 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -2079,39 +2043,33 @@ call $std/operator-overloading/Tester#constructor global.set $std/operator-overloading/excl global.get $std/operator-overloading/excl - local.tee $1 - i32.load - i32.eqz local.tee $0 + i32.load if (result i32) - local.get $1 - i32.load offset=4 - i32.eqz + i32.const 0 else local.get $0 + i32.load offset=4 + i32.eqz end global.set $std/operator-overloading/bres - global.get $std/operator-overloading/bres - local.set $1 global.get $std/operator-overloading/excl i32.load - i32.eqz - local.tee $0 if (result i32) + i32.const 0 + else global.get $std/operator-overloading/excl i32.load offset=4 i32.eqz - else - local.get $0 end - local.get $1 + global.get $std/operator-overloading/bres i32.ne if i32.const 0 - i32.const 8 - i32.const 274 + i32.const 24 + i32.const 272 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/operator-overloading/bres @@ -2119,10 +2077,10 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 275 + i32.const 24 + i32.const 273 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -2148,22 +2106,21 @@ i32.load i32.const 1 i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/incdec i32.load offset=4 i32.const 2 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 281 + i32.const 24 + i32.const 279 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/operator-overloading/incdec @@ -2183,23 +2140,21 @@ global.set $std/operator-overloading/incdec global.get $std/operator-overloading/incdec i32.load - i32.eqz - local.tee $0 if (result i32) + i32.const 0 + else global.get $std/operator-overloading/incdec i32.load offset=4 i32.const 1 i32.eq - else - local.get $0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 284 + i32.const 24 + i32.const 282 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -2221,45 +2176,42 @@ global.set $std/operator-overloading/tmp global.get $std/operator-overloading/tmp i32.load - i32.eqz - local.tee $0 if (result i32) + i32.const 0 + else global.get $std/operator-overloading/tmp i32.load offset=4 i32.const 1 i32.eq - else - local.get $0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 289 + i32.const 24 + i32.const 287 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/operator-overloading/incdec i32.load i32.const 1 i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/incdec i32.load offset=4 i32.const 2 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 290 + i32.const 24 + i32.const 288 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/operator-overloading/incdec @@ -2279,48 +2231,45 @@ i32.load i32.const 1 i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/tmp i32.load offset=4 i32.const 2 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 293 + i32.const 24 + i32.const 291 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/operator-overloading/incdec i32.load - i32.eqz - local.tee $0 if (result i32) + i32.const 0 + else global.get $std/operator-overloading/incdec i32.load offset=4 i32.const 1 i32.eq - else - local.get $0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 294 + i32.const 24 + i32.const 292 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 i32.const 2 - call $std/operator-overloading/Tester#constructor + call $std/operator-overloading/TesterInlineStatic#constructor global.set $std/operator-overloading/ais1 global.get $std/operator-overloading/ais1 local.tee $0 @@ -2331,11 +2280,11 @@ i32.load offset=4 i32.const 1 i32.add - call $std/operator-overloading/Tester#constructor + call $std/operator-overloading/TesterInlineStatic#constructor global.set $std/operator-overloading/ais1 i32.const 2 i32.const 3 - call $std/operator-overloading/Tester#constructor + call $std/operator-overloading/TesterInlineStatic#constructor global.set $std/operator-overloading/ais2 global.get $std/operator-overloading/ais1 local.tee $0 @@ -2349,33 +2298,32 @@ local.get $1 i32.load offset=4 i32.add - call $std/operator-overloading/Tester#constructor + call $std/operator-overloading/TesterInlineStatic#constructor global.set $std/operator-overloading/ais global.get $std/operator-overloading/ais i32.load i32.const 4 i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/ais i32.load offset=4 i32.const 6 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 314 + i32.const 24 + i32.const 312 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 i32.const 2 - call $std/operator-overloading/Tester#constructor + call $std/operator-overloading/TesterInlineInstance#constructor global.set $std/operator-overloading/aii1 global.get $std/operator-overloading/aii1 local.tee $0 @@ -2386,11 +2334,11 @@ i32.load offset=4 i32.const 1 i32.add - call $std/operator-overloading/Tester#constructor + call $std/operator-overloading/TesterInlineInstance#constructor global.set $std/operator-overloading/aii1 i32.const 2 i32.const 3 - call $std/operator-overloading/Tester#constructor + call $std/operator-overloading/TesterInlineInstance#constructor global.set $std/operator-overloading/aii2 global.get $std/operator-overloading/aii1 local.tee $0 @@ -2404,35 +2352,34 @@ local.get $1 i32.load offset=4 i32.add - call $std/operator-overloading/Tester#constructor + call $std/operator-overloading/TesterInlineInstance#constructor global.set $std/operator-overloading/aii global.get $std/operator-overloading/aii i32.load i32.const 4 i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/aii i32.load offset=4 i32.const 6 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 334 + i32.const 24 + i32.const 332 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) - (func $start (; 7 ;) (type $FUNCSIG$v) + (func $start (; 11 ;) (type $FUNCSIG$v) call $start:std/operator-overloading ) - (func $null (; 8 ;) (type $FUNCSIG$v) + (func $null (; 12 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/operator-overloading.ts b/tests/compiler/std/operator-overloading.ts index d2098158d4..d8cca19adc 100644 --- a/tests/compiler/std/operator-overloading.ts +++ b/tests/compiler/std/operator-overloading.ts @@ -1,5 +1,3 @@ -import "allocator/arena"; - class Tester { constructor(public x: i32, public y: i32) { } diff --git a/tests/compiler/std/operator-overloading.untouched.wat b/tests/compiler/std/operator-overloading.untouched.wat index 9d76904f41..dfedd2fdfa 100644 --- a/tests/compiler/std/operator-overloading.untouched.wat +++ b/tests/compiler/std/operator-overloading.untouched.wat @@ -1,18 +1,19 @@ (module - (type $FUNCSIG$v (func)) (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) - (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$ddd (func (param f64 f64) (result f64))) (type $FUNCSIG$ddi (func (param f64 i32) (result f64))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (type $FUNCSIG$v (func)) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\1b\00\00\00s\00t\00d\00/\00o\00p\00e\00r\00a\00t\00o\00r\00-\00o\00v\00e\00r\00l\00o\00a\00d\00i\00n\00g\00.\00t\00s\00") + (data (i32.const 8) "6\00\00\00\01\00\00\00\01\00\00\006\00\00\00s\00t\00d\00/\00o\00p\00e\00r\00a\00t\00o\00r\00-\00o\00v\00e\00r\00l\00o\00a\00d\00i\00n\00g\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) (global $std/operator-overloading/a1 (mut i32) (i32.const 0)) (global $std/operator-overloading/a2 (mut i32) (i32.const 0)) (global $std/operator-overloading/a (mut i32) (i32.const 0)) @@ -80,64 +81,54 @@ (global $std/operator-overloading/aii1 (mut i32) (i32.const 0)) (global $std/operator-overloading/aii2 (mut i32) (i32.const 0)) (global $std/operator-overloading/aii (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 68)) + (global $~lib/heap/__heap_base i32 (i32.const 80)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) - (func $start:~lib/allocator/arena (; 1 ;) (type $FUNCSIG$v) - global.get $~lib/memory/HEAP_BASE - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - ) - (func $~lib/allocator/arena/__memory_allocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/rt/stub/__alloc (; 1 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) + (local $8 i32) local.get $0 - i32.const 1073741824 + i32.const 1073741808 i32.gt_u if unreachable end - global.get $~lib/allocator/arena/offset - local.set $1 - local.get $1 + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.set $2 + local.get $2 local.get $0 - local.tee $2 - i32.const 1 local.tee $3 - local.get $2 + i32.const 1 + local.tee $4 local.get $3 + local.get $4 i32.gt_u select i32.add - i32.const 7 + i32.const 15 i32.add - i32.const 7 + i32.const 15 i32.const -1 i32.xor i32.and - local.set $4 - current_memory local.set $5 - local.get $4 + memory.size + local.set $6 local.get $5 + local.get $6 i32.const 16 i32.shl i32.gt_u if - local.get $4 - local.get $1 + local.get $5 + local.get $2 i32.sub i32.const 65535 i32.add @@ -147,23 +138,23 @@ i32.and i32.const 16 i32.shr_u - local.set $2 - local.get $5 - local.tee $3 - local.get $2 - local.tee $6 - local.get $3 + local.set $3 local.get $6 + local.tee $4 + local.get $3 + local.tee $7 + local.get $4 + local.get $7 i32.gt_s select - local.set $3 - local.get $3 - grow_memory + local.set $4 + local.get $4 + memory.grow i32.const 0 i32.lt_s if - local.get $2 - grow_memory + local.get $3 + memory.grow i32.const 0 i32.lt_s if @@ -171,21 +162,31 @@ end end end - local.get $4 - global.set $~lib/allocator/arena/offset + local.get $5 + global.set $~lib/rt/stub/offset + local.get $2 + i32.const 16 + i32.sub + local.set $8 + local.get $8 local.get $1 + i32.store offset=8 + local.get $8 + local.get $0 + i32.store offset=12 + local.get $2 ) - (func $~lib/memory/memory.allocate (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/rt/stub/__retain (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - call $~lib/allocator/arena/__memory_allocate - return ) - (func $std/operator-overloading/Tester#constructor (; 4 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/operator-overloading/Tester#constructor (; 3 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.eqz if i32.const 8 - call $~lib/memory/memory.allocate + i32.const 3 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain local.set $0 end local.get $0 @@ -196,7 +197,17 @@ i32.store offset=4 local.get $0 ) + (func $~lib/rt/stub/__release (; 4 ;) (type $FUNCSIG$vi) (param $0 i32) + nop + ) (func $std/operator-overloading/Tester.add (; 5 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $1 + call $~lib/rt/stub/__retain + drop i32.const 0 local.get $0 i32.load @@ -209,8 +220,21 @@ i32.load offset=4 i32.add call $std/operator-overloading/Tester#constructor + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 ) (func $std/operator-overloading/Tester.sub (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $1 + call $~lib/rt/stub/__retain + drop i32.const 0 local.get $0 i32.load @@ -223,8 +247,21 @@ i32.load offset=4 i32.sub call $std/operator-overloading/Tester#constructor + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 ) (func $std/operator-overloading/Tester.mul (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $1 + call $~lib/rt/stub/__retain + drop i32.const 0 local.get $0 i32.load @@ -237,8 +274,21 @@ i32.load offset=4 i32.mul call $std/operator-overloading/Tester#constructor + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 ) (func $std/operator-overloading/Tester.div (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $1 + call $~lib/rt/stub/__retain + drop i32.const 0 local.get $0 i32.load @@ -251,8 +301,21 @@ i32.load offset=4 i32.div_s call $std/operator-overloading/Tester#constructor + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 ) (func $std/operator-overloading/Tester.mod (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $1 + call $~lib/rt/stub/__retain + drop i32.const 0 local.get $0 i32.load @@ -265,6 +328,12 @@ i32.load offset=4 i32.rem_s call $std/operator-overloading/Tester#constructor + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 ) (func $~lib/math/NativeMath.scalbn (; 10 ;) (type $FUNCSIG$ddi) (param $0 f64) (param $1 i32) (result f64) (local $2 f64) @@ -440,44 +509,39 @@ local.get $7 i32.const 2146435072 i32.gt_s - local.tee $9 if (result i32) - local.get $9 + i32.const 1 else local.get $7 i32.const 2146435072 i32.eq - local.tee $9 if (result i32) local.get $4 i32.const 0 i32.ne else - local.get $9 + i32.const 0 end end - local.tee $9 if (result i32) - local.get $9 + i32.const 1 else local.get $8 i32.const 2146435072 i32.gt_s end - local.tee $9 if (result i32) - local.get $9 + i32.const 1 else local.get $8 i32.const 2146435072 i32.eq - local.tee $9 if (result i32) local.get $6 i32.const 0 i32.ne else - local.get $9 + i32.const 0 end end if @@ -487,7 +551,7 @@ return end i32.const 0 - local.set $10 + local.set $9 local.get $3 i32.const 0 i32.lt_s @@ -497,7 +561,7 @@ i32.ge_s if i32.const 2 - local.set $10 + local.set $9 else local.get $8 i32.const 1072693248 @@ -508,21 +572,21 @@ i32.shr_s i32.const 1023 i32.sub - local.set $11 - local.get $11 + local.set $10 + local.get $10 i32.const 20 i32.gt_s - local.set $9 + local.set $11 i32.const 52 i32.const 20 - local.get $9 - select local.get $11 + select + local.get $10 i32.sub local.set $12 local.get $6 local.get $8 - local.get $9 + local.get $11 select local.set $13 local.get $13 @@ -540,7 +604,7 @@ i32.const 1 i32.and i32.sub - local.set $10 + local.set $9 end end end @@ -643,17 +707,15 @@ local.get $7 i32.const 0 i32.eq - local.tee $14 if (result i32) - local.get $14 + i32.const 1 else local.get $7 i32.const 2146435072 i32.eq end - local.tee $14 if (result i32) - local.get $14 + i32.const 1 else local.get $7 i32.const 1072693248 @@ -678,7 +740,7 @@ local.get $7 i32.const 1072693248 i32.sub - local.get $10 + local.get $9 i32.or i32.const 0 i32.eq @@ -692,7 +754,7 @@ f64.div local.set $16 else - local.get $10 + local.get $9 i32.const 1 i32.eq if @@ -712,7 +774,7 @@ i32.const 0 i32.lt_s if - local.get $10 + local.get $9 i32.const 0 i32.eq if @@ -725,7 +787,7 @@ f64.div return end - local.get $10 + local.get $9 i32.const 1 i32.eq if @@ -911,17 +973,17 @@ i32.le_s if i32.const 0 - local.set $11 + local.set $10 else local.get $28 i32.const 767610 i32.lt_s if i32.const 1 - local.set $11 + local.set $10 else i32.const 0 - local.set $11 + local.set $10 local.get $29 i32.const 1 i32.add @@ -945,7 +1007,7 @@ local.set $15 f64.const 1.5 f64.const 1 - local.get $11 + local.get $10 select local.set $35 local.get $15 @@ -977,7 +1039,7 @@ i32.or i32.const 524288 i32.add - local.get $11 + local.get $10 i32.const 18 i32.shl i32.add @@ -1100,7 +1162,7 @@ local.set $36 f64.const 1.350039202129749e-08 f64.const 0 - local.get $11 + local.get $10 select local.set $37 f64.const -7.028461650952758e-09 @@ -1118,7 +1180,7 @@ local.set $24 f64.const 0.5849624872207642 f64.const 0 - local.get $11 + local.get $10 select local.set $39 local.get $36 @@ -1263,7 +1325,7 @@ i32.shr_s i32.const 1023 i32.sub - local.set $11 + local.set $10 i32.const 0 local.set $29 local.get $41 @@ -1272,7 +1334,7 @@ if local.get $28 i32.const 1048576 - local.get $11 + local.get $10 i32.const 1 i32.add i32.shr_s @@ -1285,12 +1347,12 @@ i32.shr_s i32.const 1023 i32.sub - local.set $11 + local.set $10 f64.const 0 local.set $24 local.get $29 i32.const 1048575 - local.get $11 + local.get $10 i32.shr_s i32.const -1 i32.xor @@ -1306,7 +1368,7 @@ i32.const 1048576 i32.or i32.const 20 - local.get $11 + local.get $10 i32.sub i32.shr_s local.set $29 @@ -1446,6 +1508,13 @@ f64.mul ) (func $std/operator-overloading/Tester.pow (; 12 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $1 + call $~lib/rt/stub/__retain + drop i32.const 0 local.get $0 i32.load @@ -1464,8 +1533,21 @@ call $~lib/math/NativeMath.pow i32.trunc_f64_s call $std/operator-overloading/Tester#constructor + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 ) (func $std/operator-overloading/Tester.and (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $1 + call $~lib/rt/stub/__retain + drop i32.const 0 local.get $0 i32.load @@ -1478,8 +1560,21 @@ i32.load offset=4 i32.and call $std/operator-overloading/Tester#constructor + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 ) (func $std/operator-overloading/Tester.or (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $1 + call $~lib/rt/stub/__retain + drop i32.const 0 local.get $0 i32.load @@ -1492,8 +1587,21 @@ i32.load offset=4 i32.or call $std/operator-overloading/Tester#constructor + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 ) (func $std/operator-overloading/Tester.xor (; 15 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $1 + call $~lib/rt/stub/__retain + drop i32.const 0 local.get $0 i32.load @@ -1506,15 +1614,26 @@ i32.load offset=4 i32.xor call $std/operator-overloading/Tester#constructor + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 ) (func $std/operator-overloading/Tester.equals (; 16 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $1 + call $~lib/rt/stub/__retain + drop + local.get $0 i32.load local.get $1 i32.load i32.eq - local.tee $2 if (result i32) local.get $0 i32.load offset=4 @@ -1522,17 +1641,28 @@ i32.load offset=4 i32.eq else - local.get $2 + i32.const 0 end + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 ) (func $std/operator-overloading/Tester.notEquals (; 17 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $1 + call $~lib/rt/stub/__retain + drop + local.get $0 i32.load local.get $1 i32.load i32.ne - local.tee $2 if (result i32) local.get $0 i32.load offset=4 @@ -1540,17 +1670,28 @@ i32.load offset=4 i32.ne else - local.get $2 + i32.const 0 end + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 ) (func $std/operator-overloading/Tester.greater (; 18 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $1 + call $~lib/rt/stub/__retain + drop + local.get $0 i32.load local.get $1 i32.load i32.gt_s - local.tee $2 if (result i32) local.get $0 i32.load offset=4 @@ -1558,17 +1699,28 @@ i32.load offset=4 i32.gt_s else - local.get $2 + i32.const 0 end + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 ) (func $std/operator-overloading/Tester.greaterEquals (; 19 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $1 + call $~lib/rt/stub/__retain + drop + local.get $0 i32.load local.get $1 i32.load i32.ge_s - local.tee $2 if (result i32) local.get $0 i32.load offset=4 @@ -1576,17 +1728,28 @@ i32.load offset=4 i32.ge_s else - local.get $2 + i32.const 0 end + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 ) (func $std/operator-overloading/Tester.less (; 20 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $1 + call $~lib/rt/stub/__retain + drop + local.get $0 i32.load local.get $1 i32.load i32.lt_s - local.tee $2 if (result i32) local.get $0 i32.load offset=4 @@ -1594,17 +1757,28 @@ i32.load offset=4 i32.lt_s else - local.get $2 + i32.const 0 end + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 ) (func $std/operator-overloading/Tester.lessEquals (; 21 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $1 + call $~lib/rt/stub/__retain + drop + local.get $0 i32.load local.get $1 i32.load i32.le_s - local.tee $2 if (result i32) local.get $0 i32.load offset=4 @@ -1612,10 +1786,20 @@ i32.load offset=4 i32.le_s else - local.get $2 + i32.const 0 end + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 ) (func $std/operator-overloading/Tester.shr (; 22 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop i32.const 0 local.get $0 i32.load @@ -1626,8 +1810,16 @@ local.get $1 i32.shr_s call $std/operator-overloading/Tester#constructor + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $2 ) (func $std/operator-overloading/Tester.shu (; 23 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop i32.const 0 local.get $0 i32.load @@ -1638,8 +1830,16 @@ local.get $1 i32.shr_u call $std/operator-overloading/Tester#constructor + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $2 ) (func $std/operator-overloading/Tester.shl (; 24 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop i32.const 0 local.get $0 i32.load @@ -1650,16 +1850,32 @@ local.get $1 i32.shl call $std/operator-overloading/Tester#constructor + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $2 ) (func $std/operator-overloading/Tester.pos (; 25 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop i32.const 0 local.get $0 i32.load local.get $0 i32.load offset=4 call $std/operator-overloading/Tester#constructor + local.set $1 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 ) (func $std/operator-overloading/Tester.neg (; 26 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop i32.const 0 i32.const 0 local.get $0 @@ -1670,8 +1886,16 @@ i32.load offset=4 i32.sub call $std/operator-overloading/Tester#constructor + local.set $1 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 ) (func $std/operator-overloading/Tester.not (; 27 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop i32.const 0 local.get $0 i32.load @@ -1682,20 +1906,30 @@ i32.const -1 i32.xor call $std/operator-overloading/Tester#constructor + local.set $1 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 ) (func $std/operator-overloading/Tester.excl (; 28 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $0 i32.load i32.eqz - local.tee $1 if (result i32) local.get $0 i32.load offset=4 i32.eqz else - local.get $1 + i32.const 0 end + local.set $1 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 ) (func $std/operator-overloading/Tester#inc (; 29 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 @@ -1711,6 +1945,7 @@ i32.add i32.store offset=4 local.get $0 + call $~lib/rt/stub/__retain ) (func $std/operator-overloading/Tester#dec (; 30 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 @@ -1726,6 +1961,7 @@ i32.sub i32.store offset=4 local.get $0 + call $~lib/rt/stub/__retain ) (func $std/operator-overloading/Tester#postInc (; 31 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 0 @@ -1756,7 +1992,9 @@ i32.eqz if i32.const 8 - call $~lib/memory/memory.allocate + i32.const 4 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain local.set $0 end local.get $0 @@ -1767,13 +2005,62 @@ i32.store offset=4 local.get $0 ) - (func $std/operator-overloading/TesterInlineInstance#constructor (; 34 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/operator-overloading/TesterInlineStatic.postInc (; 34 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) local.get $0 - i32.eqz - if - i32.const 8 - call $~lib/memory/memory.allocate - local.set $0 + call $~lib/rt/stub/__retain + drop + i32.const 0 + local.get $0 + i32.load + i32.const 1 + i32.add + local.get $0 + i32.load offset=4 + i32.const 1 + i32.add + call $std/operator-overloading/TesterInlineStatic#constructor + local.set $1 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + ) + (func $std/operator-overloading/TesterInlineStatic.add (; 35 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $1 + call $~lib/rt/stub/__retain + drop + i32.const 0 + local.get $0 + i32.load + local.get $1 + i32.load + i32.add + local.get $0 + i32.load offset=4 + local.get $1 + i32.load offset=4 + i32.add + call $std/operator-overloading/TesterInlineStatic#constructor + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 + ) + (func $std/operator-overloading/TesterInlineInstance#constructor (; 36 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 8 + i32.const 5 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain + local.set $0 end local.get $0 local.get $1 @@ -1783,10 +2070,75 @@ i32.store offset=4 local.get $0 ) - (func $start:std/operator-overloading (; 35 ;) (type $FUNCSIG$v) + (func $std/operator-overloading/TesterInlineInstance#postInc (; 37 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.const 0 + local.get $0 + i32.load + i32.const 1 + i32.add + local.get $0 + i32.load offset=4 + i32.const 1 + i32.add + call $std/operator-overloading/TesterInlineInstance#constructor + ) + (func $std/operator-overloading/TesterInlineInstance#add (; 38 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + call $~lib/rt/stub/__retain + drop + i32.const 0 + local.get $0 + i32.load + local.get $1 + i32.load + i32.add + local.get $0 + i32.load offset=4 + local.get $1 + i32.load offset=4 + i32.add + call $std/operator-overloading/TesterInlineInstance#constructor + local.set $2 + local.get $1 + call $~lib/rt/stub/__release + local.get $2 + ) + (func $start:std/operator-overloading (; 39 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) - call $start:~lib/allocator/arena + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + (local $14 i32) + (local $15 i32) + (local $16 i32) + (local $17 i32) + (local $18 i32) + (local $19 i32) + (local $20 i32) + (local $21 i32) + (local $22 i32) + (local $23 i32) + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset i32.const 0 i32.const 1 i32.const 2 @@ -1800,27 +2152,28 @@ global.get $std/operator-overloading/a1 global.get $std/operator-overloading/a2 call $std/operator-overloading/Tester.add + local.tee $0 + call $~lib/rt/stub/__retain global.set $std/operator-overloading/a global.get $std/operator-overloading/a i32.load i32.const 3 i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/a i32.load offset=4 i32.const 5 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 147 + i32.const 24 + i32.const 145 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -1836,27 +2189,28 @@ global.get $std/operator-overloading/s1 global.get $std/operator-overloading/s2 call $std/operator-overloading/Tester.sub + local.tee $1 + call $~lib/rt/stub/__retain global.set $std/operator-overloading/s global.get $std/operator-overloading/s i32.load i32.const 0 i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/s i32.load offset=4 i32.const 6 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 153 + i32.const 24 + i32.const 151 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -1872,27 +2226,28 @@ global.get $std/operator-overloading/m1 global.get $std/operator-overloading/m2 call $std/operator-overloading/Tester.mul + local.tee $2 + call $~lib/rt/stub/__retain global.set $std/operator-overloading/m global.get $std/operator-overloading/m i32.load i32.const 6 i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/m i32.load offset=4 i32.const 10 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 159 + i32.const 24 + i32.const 157 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -1908,27 +2263,28 @@ global.get $std/operator-overloading/d1 global.get $std/operator-overloading/d2 call $std/operator-overloading/Tester.div + local.tee $3 + call $~lib/rt/stub/__retain global.set $std/operator-overloading/d global.get $std/operator-overloading/d i32.load i32.const 2 i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/d i32.load offset=4 i32.const 5 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 165 + i32.const 24 + i32.const 163 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -1944,27 +2300,28 @@ global.get $std/operator-overloading/f1 global.get $std/operator-overloading/f2 call $std/operator-overloading/Tester.mod + local.tee $4 + call $~lib/rt/stub/__retain global.set $std/operator-overloading/f global.get $std/operator-overloading/f i32.load i32.const 4 i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/f i32.load offset=4 i32.const 0 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 171 + i32.const 24 + i32.const 169 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -1980,27 +2337,28 @@ global.get $std/operator-overloading/p1 global.get $std/operator-overloading/p2 call $std/operator-overloading/Tester.pow + local.tee $5 + call $~lib/rt/stub/__retain global.set $std/operator-overloading/p global.get $std/operator-overloading/p i32.load i32.const 16 i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/p i32.load offset=4 i32.const 243 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 177 + i32.const 24 + i32.const 175 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -2016,27 +2374,28 @@ global.get $std/operator-overloading/n1 global.get $std/operator-overloading/n2 call $std/operator-overloading/Tester.and + local.tee $6 + call $~lib/rt/stub/__retain global.set $std/operator-overloading/n global.get $std/operator-overloading/n i32.load i32.const 15 i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/n i32.load offset=4 i32.const 15 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 183 + i32.const 24 + i32.const 181 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -2052,27 +2411,28 @@ global.get $std/operator-overloading/o1 global.get $std/operator-overloading/o2 call $std/operator-overloading/Tester.or + local.tee $7 + call $~lib/rt/stub/__retain global.set $std/operator-overloading/o global.get $std/operator-overloading/o i32.load i32.const 65535 i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/o i32.load offset=4 i32.const 255 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 189 + i32.const 24 + i32.const 187 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -2088,27 +2448,28 @@ global.get $std/operator-overloading/x1 global.get $std/operator-overloading/x2 call $std/operator-overloading/Tester.xor + local.tee $8 + call $~lib/rt/stub/__retain global.set $std/operator-overloading/x global.get $std/operator-overloading/x i32.load i32.const 65535 i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/x i32.load offset=4 i32.const 255 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 195 + i32.const 24 + i32.const 193 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -2131,10 +2492,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 201 + i32.const 24 + i32.const 199 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -2157,10 +2518,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 207 + i32.const 24 + i32.const 205 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/operator-overloading/eq1 @@ -2173,10 +2534,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 211 + i32.const 24 + i32.const 209 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/operator-overloading/eq3 @@ -2189,10 +2550,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 215 + i32.const 24 + i32.const 213 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -2215,10 +2576,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 221 + i32.const 24 + i32.const 219 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -2241,10 +2602,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 227 + i32.const 24 + i32.const 225 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -2267,10 +2628,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 233 + i32.const 24 + i32.const 231 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -2293,10 +2654,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 239 + i32.const 24 + i32.const 237 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -2307,27 +2668,28 @@ global.get $std/operator-overloading/shr i32.const 3 call $std/operator-overloading/Tester.shr + local.tee $9 + call $~lib/rt/stub/__retain global.set $std/operator-overloading/sres global.get $std/operator-overloading/sres i32.load i32.const 1 i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/sres i32.load offset=4 i32.const 2 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 244 + i32.const 24 + i32.const 242 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -2338,27 +2700,28 @@ global.get $std/operator-overloading/shu i32.const 3 call $std/operator-overloading/Tester.shu + local.tee $10 + call $~lib/rt/stub/__retain global.set $std/operator-overloading/ures global.get $std/operator-overloading/ures i32.load i32.const 536870911 i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/ures i32.load offset=4 i32.const 536870910 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 249 + i32.const 24 + i32.const 247 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -2366,30 +2729,44 @@ i32.const 2 call $std/operator-overloading/Tester#constructor global.set $std/operator-overloading/shl - global.get $std/operator-overloading/shl - i32.const 3 - call $std/operator-overloading/Tester.shl + block (result i32) + global.get $std/operator-overloading/shl + i32.const 3 + call $std/operator-overloading/Tester.shl + local.tee $11 + local.tee $12 + global.get $std/operator-overloading/sres + local.tee $13 + i32.ne + if + local.get $12 + call $~lib/rt/stub/__retain + drop + local.get $13 + call $~lib/rt/stub/__release + end + local.get $12 + end global.set $std/operator-overloading/sres global.get $std/operator-overloading/sres i32.load i32.const 8 i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/sres i32.load offset=4 i32.const 16 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 254 + i32.const 24 + i32.const 252 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -2399,13 +2776,14 @@ global.set $std/operator-overloading/pos global.get $std/operator-overloading/pos call $std/operator-overloading/Tester.pos + local.tee $12 + call $~lib/rt/stub/__retain global.set $std/operator-overloading/pres global.get $std/operator-overloading/pres i32.load global.get $std/operator-overloading/pos i32.load i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/pres i32.load offset=4 @@ -2413,15 +2791,15 @@ i32.load offset=4 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 259 + i32.const 24 + i32.const 257 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -2431,6 +2809,8 @@ global.set $std/operator-overloading/neg global.get $std/operator-overloading/neg call $std/operator-overloading/Tester.neg + local.tee $13 + call $~lib/rt/stub/__retain global.set $std/operator-overloading/nres global.get $std/operator-overloading/nres i32.load @@ -2439,7 +2819,6 @@ i32.load i32.sub i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/nres i32.load offset=4 @@ -2449,15 +2828,15 @@ i32.sub i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 264 + i32.const 24 + i32.const 262 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -2467,6 +2846,8 @@ global.set $std/operator-overloading/not global.get $std/operator-overloading/not call $std/operator-overloading/Tester.not + local.tee $14 + call $~lib/rt/stub/__retain global.set $std/operator-overloading/res global.get $std/operator-overloading/res i32.load @@ -2475,7 +2856,6 @@ i32.const -1 i32.xor i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/res i32.load offset=4 @@ -2485,15 +2865,15 @@ i32.xor i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 269 + i32.const 24 + i32.const 267 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -2508,22 +2888,21 @@ global.get $std/operator-overloading/excl i32.load i32.eqz - local.tee $0 if (result i32) global.get $std/operator-overloading/excl i32.load offset=4 i32.eqz else - local.get $0 + i32.const 0 end i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 274 + i32.const 24 + i32.const 272 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/operator-overloading/bres @@ -2532,10 +2911,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 275 + i32.const 24 + i32.const 273 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -2543,163 +2922,238 @@ i32.const 1 call $std/operator-overloading/Tester#constructor global.set $std/operator-overloading/incdec - global.get $std/operator-overloading/incdec - call $std/operator-overloading/Tester#inc + block (result i32) + global.get $std/operator-overloading/incdec + call $std/operator-overloading/Tester#inc + local.tee $15 + local.tee $16 + global.get $std/operator-overloading/incdec + local.tee $17 + i32.ne + if + local.get $16 + call $~lib/rt/stub/__retain + drop + local.get $17 + call $~lib/rt/stub/__release + end + local.get $16 + end global.set $std/operator-overloading/incdec global.get $std/operator-overloading/incdec i32.load i32.const 1 i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/incdec i32.load offset=4 i32.const 2 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 281 + i32.const 24 + i32.const 279 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $std/operator-overloading/incdec - call $std/operator-overloading/Tester#dec + block (result i32) + global.get $std/operator-overloading/incdec + call $std/operator-overloading/Tester#dec + local.tee $16 + local.tee $17 + global.get $std/operator-overloading/incdec + local.tee $18 + i32.ne + if + local.get $17 + call $~lib/rt/stub/__retain + drop + local.get $18 + call $~lib/rt/stub/__release + end + local.get $17 + end global.set $std/operator-overloading/incdec global.get $std/operator-overloading/incdec i32.load i32.const 0 i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/incdec i32.load offset=4 i32.const 1 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 284 + i32.const 24 + i32.const 282 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 0 - i32.const 0 - i32.const 1 - call $std/operator-overloading/Tester#constructor - global.set $std/operator-overloading/incdec block (result i32) + i32.const 0 + i32.const 0 + i32.const 1 + call $std/operator-overloading/Tester#constructor + local.set $18 global.get $std/operator-overloading/incdec - local.tee $0 - call $std/operator-overloading/Tester#postInc + call $~lib/rt/stub/__release + local.get $18 + end + global.set $std/operator-overloading/incdec + block (result i32) + block (result i32) + global.get $std/operator-overloading/incdec + local.tee $18 + call $std/operator-overloading/Tester#postInc + local.tee $17 + local.tee $19 + global.get $std/operator-overloading/incdec + local.tee $20 + i32.ne + if + local.get $19 + call $~lib/rt/stub/__retain + drop + local.get $20 + call $~lib/rt/stub/__release + end + local.get $19 + end global.set $std/operator-overloading/incdec - local.get $0 + local.get $18 end + call $~lib/rt/stub/__retain global.set $std/operator-overloading/tmp global.get $std/operator-overloading/tmp i32.load i32.const 0 i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/tmp i32.load offset=4 i32.const 1 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 289 + i32.const 24 + i32.const 287 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/operator-overloading/incdec i32.load i32.const 1 i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/incdec i32.load offset=4 i32.const 2 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 290 + i32.const 24 + i32.const 288 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block (result i32) - global.get $std/operator-overloading/incdec - local.tee $0 - call $std/operator-overloading/Tester#postDec - global.set $std/operator-overloading/incdec - local.get $0 + block (result i32) + block (result i32) + global.get $std/operator-overloading/incdec + local.tee $18 + call $std/operator-overloading/Tester#postDec + local.tee $19 + local.tee $20 + global.get $std/operator-overloading/incdec + local.tee $21 + i32.ne + if + local.get $20 + call $~lib/rt/stub/__retain + drop + local.get $21 + call $~lib/rt/stub/__release + end + local.get $20 + end + global.set $std/operator-overloading/incdec + local.get $18 + end + local.tee $21 + global.get $std/operator-overloading/tmp + local.tee $18 + i32.ne + if + local.get $21 + call $~lib/rt/stub/__retain + drop + local.get $18 + call $~lib/rt/stub/__release + end + local.get $21 end global.set $std/operator-overloading/tmp global.get $std/operator-overloading/tmp i32.load i32.const 1 i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/tmp i32.load offset=4 i32.const 2 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 293 + i32.const 24 + i32.const 291 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/operator-overloading/incdec i32.load i32.const 0 i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/incdec i32.load offset=4 i32.const 1 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 294 + i32.const 24 + i32.const 292 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -2707,19 +3161,22 @@ i32.const 2 call $std/operator-overloading/TesterInlineStatic#constructor global.set $std/operator-overloading/ais1 - block $std/operator-overloading/TesterInlineStatic.postInc|inlined.0 (result i32) + block (result i32) global.get $std/operator-overloading/ais1 - local.set $0 - i32.const 0 - local.get $0 - i32.load - i32.const 1 - i32.add - local.get $0 - i32.load offset=4 - i32.const 1 - i32.add - call $std/operator-overloading/TesterInlineStatic#constructor + call $std/operator-overloading/TesterInlineStatic.postInc + local.tee $21 + local.tee $20 + global.get $std/operator-overloading/ais1 + local.tee $18 + i32.ne + if + local.get $20 + call $~lib/rt/stub/__retain + drop + local.get $18 + call $~lib/rt/stub/__release + end + local.get $20 end global.set $std/operator-overloading/ais1 i32.const 0 @@ -2727,45 +3184,31 @@ i32.const 3 call $std/operator-overloading/TesterInlineStatic#constructor global.set $std/operator-overloading/ais2 - block $std/operator-overloading/TesterInlineStatic.add|inlined.0 (result i32) - global.get $std/operator-overloading/ais1 - local.set $0 - global.get $std/operator-overloading/ais2 - local.set $1 - i32.const 0 - local.get $0 - i32.load - local.get $1 - i32.load - i32.add - local.get $0 - i32.load offset=4 - local.get $1 - i32.load offset=4 - i32.add - call $std/operator-overloading/TesterInlineStatic#constructor - end + global.get $std/operator-overloading/ais1 + global.get $std/operator-overloading/ais2 + call $std/operator-overloading/TesterInlineStatic.add + local.tee $20 + call $~lib/rt/stub/__retain global.set $std/operator-overloading/ais global.get $std/operator-overloading/ais i32.load i32.const 4 i32.eq - local.tee $1 if (result i32) global.get $std/operator-overloading/ais i32.load offset=4 i32.const 6 i32.eq else - local.get $1 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 314 + i32.const 24 + i32.const 312 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -2773,19 +3216,22 @@ i32.const 2 call $std/operator-overloading/TesterInlineInstance#constructor global.set $std/operator-overloading/aii1 - block $std/operator-overloading/TesterInlineInstance#postInc|inlined.0 (result i32) + block (result i32) global.get $std/operator-overloading/aii1 - local.set $1 - i32.const 0 - local.get $1 - i32.load - i32.const 1 - i32.add - local.get $1 - i32.load offset=4 - i32.const 1 - i32.add - call $std/operator-overloading/TesterInlineInstance#constructor + call $std/operator-overloading/TesterInlineInstance#postInc + local.tee $18 + local.tee $22 + global.get $std/operator-overloading/aii1 + local.tee $23 + i32.ne + if + local.get $22 + call $~lib/rt/stub/__retain + drop + local.get $23 + call $~lib/rt/stub/__release + end + local.get $22 end global.set $std/operator-overloading/aii1 i32.const 0 @@ -2793,51 +3239,83 @@ i32.const 3 call $std/operator-overloading/TesterInlineInstance#constructor global.set $std/operator-overloading/aii2 - block $std/operator-overloading/TesterInlineInstance#add|inlined.0 (result i32) - global.get $std/operator-overloading/aii1 - local.set $1 - global.get $std/operator-overloading/aii2 - local.set $0 - i32.const 0 - local.get $1 - i32.load - local.get $0 - i32.load - i32.add - local.get $1 - i32.load offset=4 - local.get $0 - i32.load offset=4 - i32.add - call $std/operator-overloading/TesterInlineInstance#constructor - end + global.get $std/operator-overloading/aii1 + global.get $std/operator-overloading/aii2 + call $std/operator-overloading/TesterInlineInstance#add + local.tee $22 + call $~lib/rt/stub/__retain global.set $std/operator-overloading/aii global.get $std/operator-overloading/aii i32.load i32.const 4 i32.eq - local.tee $0 if (result i32) global.get $std/operator-overloading/aii i32.load offset=4 i32.const 6 i32.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 334 + i32.const 24 + i32.const 332 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 + call $~lib/rt/stub/__release + local.get $3 + call $~lib/rt/stub/__release + local.get $4 + call $~lib/rt/stub/__release + local.get $5 + call $~lib/rt/stub/__release + local.get $6 + call $~lib/rt/stub/__release + local.get $7 + call $~lib/rt/stub/__release + local.get $8 + call $~lib/rt/stub/__release + local.get $9 + call $~lib/rt/stub/__release + local.get $10 + call $~lib/rt/stub/__release + local.get $11 + call $~lib/rt/stub/__release + local.get $12 + call $~lib/rt/stub/__release + local.get $13 + call $~lib/rt/stub/__release + local.get $14 + call $~lib/rt/stub/__release + local.get $15 + call $~lib/rt/stub/__release + local.get $16 + call $~lib/rt/stub/__release + local.get $17 + call $~lib/rt/stub/__release + local.get $18 + call $~lib/rt/stub/__release + local.get $19 + call $~lib/rt/stub/__release + local.get $20 + call $~lib/rt/stub/__release + local.get $21 + call $~lib/rt/stub/__release + local.get $22 + call $~lib/rt/stub/__release ) - (func $start (; 36 ;) (type $FUNCSIG$v) + (func $start (; 40 ;) (type $FUNCSIG$v) call $start:std/operator-overloading ) - (func $null (; 37 ;) (type $FUNCSIG$v) + (func $null (; 41 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/std/pointer.json b/tests/compiler/std/pointer.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/std/pointer.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/std/pointer.optimized.wat b/tests/compiler/std/pointer.optimized.wat index f2994003ef..a1d95af279 100644 --- a/tests/compiler/std/pointer.optimized.wat +++ b/tests/compiler/std/pointer.optimized.wat @@ -1,13 +1,13 @@ (module + (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$viif (func (param i32 i32 f32))) (type $FUNCSIG$v (func)) (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$vii (func (param i32 i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\0e\00\00\00s\00t\00d\00/\00p\00o\00i\00n\00t\00e\00r\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $null) + (data (i32.const 8) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00s\00t\00d\00/\00p\00o\00i\00n\00t\00e\00r\00.\00t\00s") (global $std/pointer/one (mut i32) (i32.const 0)) (global $std/pointer/two (mut i32) (i32.const 0)) (global $std/pointer/add (mut i32) (i32.const 0)) @@ -15,9 +15,13 @@ (global $std/pointer/nextOne (mut i32) (i32.const 0)) (global $std/pointer/buf (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) - (func $~lib/internal/memory/memset (; 1 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $std/pointer/Pointer#dec (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 8 + i32.sub + ) + (func $~lib/memory/memory.fill (; 2 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) local.get $0 i32.const 0 @@ -61,915 +65,86 @@ i32.const 0 i32.store8 ) - (func $~lib/internal/memory/memcpy (; 2 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/memory/memory.copy (; 3 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - i32.const 8 - local.set $3 - loop $continue|0 - local.get $1 - i32.const 3 - i32.and - local.get $3 - local.get $3 - select - if - local.get $0 - local.tee $2 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $2 - local.get $4 - i32.load8_u - i32.store8 - local.get $3 - i32.const 1 - i32.sub - local.set $3 - br $continue|0 - end - end - local.get $0 - i32.const 3 - i32.and - i32.eqz - if - loop $continue|1 - local.get $3 - i32.const 16 - i32.ge_u - if - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $1 - i32.const 4 - i32.add - i32.load - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $1 - i32.const 8 - i32.add - i32.load - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 12 - i32.add - i32.load - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $3 - i32.const 16 - i32.sub - local.set $3 - br $continue|1 - end - end - local.get $3 + block $~lib/util/memory/memmove|inlined.0 i32.const 8 - i32.and - if - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $1 - i32.const 4 - i32.add - i32.load - i32.store - local.get $1 - i32.const 8 - i32.add - local.set $1 - local.get $0 - i32.const 8 - i32.add - local.set $0 - end - local.get $3 - i32.const 4 - i32.and - if - local.get $0 - local.get $1 - i32.load - i32.store - local.get $1 - i32.const 4 - i32.add - local.set $1 - local.get $0 - i32.const 4 - i32.add - local.set $0 - end - local.get $3 - i32.const 2 - i32.and + local.set $2 + local.get $0 + local.get $1 + i32.eq + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $1 + i32.lt_u if - local.get $0 local.get $1 - i32.load16_u - i32.store16 - local.get $1 - i32.const 2 - i32.add - local.set $1 + i32.const 7 + i32.and local.get $0 - i32.const 2 - i32.add - local.set $0 - end - local.get $3 - i32.const 1 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - end - return - end - local.get $3 - i32.const 32 - i32.ge_u - if - block $break|2 - block $case2|2 - block $case1|2 + i32.const 7 + i32.and + i32.eq + if + loop $continue|0 local.get $0 - i32.const 3 + i32.const 7 i32.and - local.tee $2 - i32.const 1 - i32.ne if local.get $2 - i32.const 2 - i32.eq - br_if $case1|2 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 local.get $2 - i32.const 3 - i32.eq - br_if $case2|2 - br $break|2 - end - local.get $1 - i32.load - local.set $5 - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $2 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $2 - local.get $4 - i32.load8_u - i32.store8 - local.get $3 - i32.const 3 - i32.sub - local.set $3 - loop $continue|3 + i32.const 1 + i32.sub + local.set $2 + local.get $0 + local.tee $3 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 local.get $3 - i32.const 17 - i32.ge_u - if - local.get $0 - local.get $1 - i32.const 1 - i32.add - i32.load - local.tee $2 - i32.const 8 - i32.shl - local.get $5 - i32.const 24 - i32.shr_u - i32.or - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $2 - i32.const 24 - i32.shr_u - local.get $1 - i32.const 5 - i32.add - i32.load - local.tee $2 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $2 - i32.const 24 - i32.shr_u - local.get $1 - i32.const 9 - i32.add - i32.load - local.tee $2 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 13 - i32.add - i32.load - local.tee $5 - i32.const 8 - i32.shl - local.get $2 - i32.const 24 - i32.shr_u - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $3 - i32.const 16 - i32.sub - local.set $3 - br $continue|3 - end + local.get $4 + i32.load8_u + i32.store8 + br $continue|0 end - br $break|2 end - local.get $1 - i32.load - local.set $5 - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $2 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $2 - local.get $4 - i32.load8_u - i32.store8 - local.get $3 - i32.const 2 - i32.sub - local.set $3 - loop $continue|4 - local.get $3 - i32.const 18 + loop $continue|1 + local.get $2 + i32.const 8 i32.ge_u if local.get $0 local.get $1 - i32.const 2 - i32.add - i32.load - local.tee $2 - i32.const 16 - i32.shl - local.get $5 - i32.const 16 - i32.shr_u - i32.or - i32.store - local.get $0 - i32.const 4 - i32.add + i64.load + i64.store local.get $2 - i32.const 16 - i32.shr_u - local.get $1 - i32.const 6 - i32.add - i32.load - local.tee $2 - i32.const 16 - i32.shl - i32.or - i32.store - local.get $0 i32.const 8 - i32.add - local.get $2 - i32.const 16 - i32.shr_u - local.get $1 - i32.const 10 - i32.add - i32.load - local.tee $2 - i32.const 16 - i32.shl - i32.or - i32.store + i32.sub + local.set $2 local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 14 + i32.const 8 i32.add - i32.load - local.tee $5 - i32.const 16 - i32.shl - local.get $2 - i32.const 16 - i32.shr_u - i32.or - i32.store + local.set $0 local.get $1 - i32.const 16 + i32.const 8 i32.add local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $3 - i32.const 16 - i32.sub - local.set $3 - br $continue|4 + br $continue|1 end end - br $break|2 - end - local.get $1 - i32.load - local.set $5 - local.get $0 - local.tee $2 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $2 - local.get $4 - i32.load8_u - i32.store8 - local.get $3 - i32.const 1 - i32.sub - local.set $3 - loop $continue|5 - local.get $3 - i32.const 19 - i32.ge_u - if - local.get $0 - local.get $1 - i32.const 3 - i32.add - i32.load - local.tee $2 - i32.const 24 - i32.shl - local.get $5 - i32.const 8 - i32.shr_u - i32.or - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $2 - i32.const 8 - i32.shr_u - local.get $1 - i32.const 7 - i32.add - i32.load - local.tee $2 - i32.const 24 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $2 - i32.const 8 - i32.shr_u - local.get $1 - i32.const 11 - i32.add - i32.load - local.tee $2 - i32.const 24 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 15 - i32.add - i32.load - local.tee $5 - i32.const 24 - i32.shl - local.get $2 - i32.const 8 - i32.shr_u - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $3 - i32.const 16 - i32.sub - local.set $3 - br $continue|5 - end end - end - end - local.get $3 - i32.const 16 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $2 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $2 - local.get $4 - i32.load8_u - i32.store8 - end - local.get $3 - i32.const 8 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $2 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $2 - local.get $4 - i32.load8_u - i32.store8 - end - local.get $3 - i32.const 4 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $2 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $2 - local.get $4 - i32.load8_u - i32.store8 - end - local.get $3 - i32.const 2 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $2 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $2 - local.get $4 - i32.load8_u - i32.store8 - end - local.get $3 - i32.const 1 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - end - ) - (func $~lib/internal/memory/memmove (; 3 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - i32.const 8 - local.set $2 - local.get $0 - local.get $1 - i32.eq - if - return - end - local.get $1 - i32.const 8 - i32.add - local.get $0 - i32.le_u - local.tee $3 - if (result i32) - local.get $3 - else - local.get $0 - i32.const 8 - i32.add - local.get $1 - i32.le_u - end - if - local.get $0 - local.get $1 - call $~lib/internal/memory/memcpy - return - end - local.get $0 - local.get $1 - i32.lt_u - if - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and - i32.eq - if - loop $continue|0 - local.get $0 - i32.const 7 - i32.and + loop $continue|2 + local.get $2 if - local.get $2 - i32.eqz - if - return - end - local.get $2 - i32.const 1 - i32.sub - local.set $2 local.get $0 local.tee $3 i32.const 1 @@ -984,100 +159,71 @@ local.get $4 i32.load8_u i32.store8 - br $continue|0 - end - end - loop $continue|1 - local.get $2 - i32.const 8 - i32.ge_u - if - local.get $0 - local.get $1 - i64.load - i64.store local.get $2 - i32.const 8 + i32.const 1 i32.sub local.set $2 - local.get $0 - i32.const 8 - i32.add - local.set $0 - local.get $1 - i32.const 8 - i32.add - local.set $1 - br $continue|1 + br $continue|2 end end - end - loop $continue|2 - local.get $2 + else + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq if - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - br $continue|2 - end - end - else - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and - i32.eq - if - loop $continue|3 - local.get $0 - local.get $2 - i32.add - i32.const 7 - i32.and - if + loop $continue|3 + local.get $0 local.get $2 - i32.eqz + i32.add + i32.const 7 + i32.and if - return + local.get $2 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $2 + i32.const 1 + i32.sub + local.tee $2 + local.get $0 + i32.add + local.get $1 + local.get $2 + i32.add + i32.load8_u + i32.store8 + br $continue|3 end + end + loop $continue|4 local.get $2 - i32.const 1 - i32.sub - local.tee $2 - local.get $0 - i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 - br $continue|3 + i32.const 8 + i32.ge_u + if + local.get $2 + i32.const 8 + i32.sub + local.tee $2 + local.get $0 + i32.add + local.get $1 + local.get $2 + i32.add + i64.load + i64.store + br $continue|4 + end end end - loop $continue|4 + loop $continue|5 local.get $2 - i32.const 8 - i32.ge_u if local.get $2 - i32.const 8 + i32.const 1 i32.sub local.tee $2 local.get $0 @@ -1085,32 +231,24 @@ local.get $1 local.get $2 i32.add - i64.load - i64.store - br $continue|4 + i32.load8_u + i32.store8 + br $continue|5 end end end - loop $continue|5 - local.get $2 - if - local.get $2 - i32.const 1 - i32.sub - local.tee $2 - local.get $0 - i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 - br $continue|5 - end - end end ) - (func $start:std/pointer (; 4 ;) (type $FUNCSIG$v) + (func $std/pointer/Pointer#set (; 4 ;) (type $FUNCSIG$viif) (param $0 i32) (param $1 i32) (param $2 f32) + local.get $1 + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $2 + f32.store + ) + (func $start:std/pointer (; 5 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 8 @@ -1122,10 +260,10 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 79 + i32.const 24 + i32.const 78 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/pointer/two @@ -1133,29 +271,28 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 80 + i32.const 24 + i32.const 79 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/pointer/one - local.tee $0 i32.const 1 i32.store - local.get $0 + global.get $std/pointer/one i32.const 2 i32.store offset=4 - local.get $0 + global.get $std/pointer/one i32.load i32.const 1 i32.ne if i32.const 0 - i32.const 8 - i32.const 84 + i32.const 24 + i32.const 83 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/pointer/one @@ -1164,10 +301,10 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 85 + i32.const 24 + i32.const 84 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/pointer/one @@ -1179,10 +316,10 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 88 + i32.const 24 + i32.const 87 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/pointer/two @@ -1194,10 +331,10 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 91 + i32.const 24 + i32.const 90 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/pointer/one @@ -1205,10 +342,10 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 93 + i32.const 24 + i32.const 92 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/pointer/one @@ -1216,17 +353,16 @@ i32.add global.set $std/pointer/one global.get $std/pointer/one - local.tee $0 global.set $std/pointer/nextOne global.get $std/pointer/nextOne - local.get $0 + global.get $std/pointer/one i32.ne if i32.const 0 - i32.const 8 - i32.const 95 + i32.const 24 + i32.const 94 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/pointer/one @@ -1234,10 +370,10 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 96 + i32.const 24 + i32.const 95 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/pointer/two @@ -1245,29 +381,27 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 98 + i32.const 24 + i32.const 97 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/pointer/two - i32.const 8 - i32.sub + call $std/pointer/Pointer#dec global.set $std/pointer/two global.get $std/pointer/two - i32.const 8 - i32.sub + call $std/pointer/Pointer#dec global.set $std/pointer/two global.get $std/pointer/two i32.const 8 i32.ne if i32.const 0 - i32.const 8 - i32.const 101 + i32.const 24 + i32.const 100 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/pointer/two @@ -1276,10 +410,10 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 102 + i32.const 24 + i32.const 101 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/pointer/two @@ -1288,10 +422,10 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 103 + i32.const 24 + i32.const 102 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/pointer/one @@ -1301,20 +435,20 @@ if local.get $0 local.get $1 - call $~lib/internal/memory/memmove + call $~lib/memory/memory.copy else local.get $0 - call $~lib/internal/memory/memset + call $~lib/memory/memory.fill end global.get $std/pointer/one global.get $std/pointer/two i32.eq if i32.const 0 - i32.const 8 - i32.const 106 + i32.const 24 + i32.const 105 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/pointer/one @@ -1323,10 +457,10 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 107 + i32.const 24 + i32.const 106 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/pointer/one @@ -1335,32 +469,32 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 108 + i32.const 24 + i32.const 107 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 global.set $std/pointer/buf global.get $std/pointer/buf + i32.const 0 f32.const 1.100000023841858 - f32.store + call $std/pointer/Pointer#set global.get $std/pointer/buf - i32.const 4 - i32.add + i32.const 1 f32.const 1.2000000476837158 - f32.store + call $std/pointer/Pointer#set global.get $std/pointer/buf f32.load f32.const 1.100000023841858 f32.ne if i32.const 0 - i32.const 8 - i32.const 114 + i32.const 24 + i32.const 113 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/pointer/buf @@ -1371,10 +505,10 @@ f32.ne if i32.const 0 - i32.const 8 - i32.const 115 + i32.const 24 + i32.const 114 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/pointer/buf @@ -1383,10 +517,10 @@ f32.ne if i32.const 0 - i32.const 8 - i32.const 117 + i32.const 24 + i32.const 116 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/pointer/buf @@ -1397,10 +531,10 @@ f32.ne if i32.const 0 - i32.const 8 - i32.const 118 + i32.const 24 + i32.const 117 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -1409,10 +543,10 @@ f32.ne if i32.const 0 - i32.const 8 - i32.const 120 + i32.const 24 + i32.const 119 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 4 @@ -1421,28 +555,29 @@ f32.ne if i32.const 0 - i32.const 8 - i32.const 121 + i32.const 24 + i32.const 120 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/pointer/buf i32.const 8 i32.add - local.tee $0 f32.const 1.2999999523162842 f32.store - local.get $0 + global.get $std/pointer/buf + i32.const 8 + i32.add f32.load f32.const 1.2999999523162842 f32.ne if i32.const 0 - i32.const 8 - i32.const 124 + i32.const 24 + i32.const 123 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/pointer/buf @@ -1453,10 +588,10 @@ f32.ne if i32.const 0 - i32.const 8 - i32.const 125 + i32.const 24 + i32.const 124 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 8 @@ -1465,10 +600,10 @@ f32.ne if i32.const 0 - i32.const 8 - i32.const 126 + i32.const 24 + i32.const 125 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/pointer/buf @@ -1480,10 +615,10 @@ f32.ne if i32.const 0 - i32.const 8 - i32.const 129 + i32.const 24 + i32.const 128 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -1492,17 +627,17 @@ f32.ne if i32.const 0 - i32.const 8 - i32.const 130 + i32.const 24 + i32.const 129 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) - (func $start (; 5 ;) (type $FUNCSIG$v) + (func $start (; 6 ;) (type $FUNCSIG$v) call $start:std/pointer ) - (func $null (; 6 ;) (type $FUNCSIG$v) + (func $null (; 7 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/pointer.ts b/tests/compiler/std/pointer.ts index bece2e1879..b9605afd67 100644 --- a/tests/compiler/std/pointer.ts +++ b/tests/compiler/std/pointer.ts @@ -2,7 +2,6 @@ class Pointer { - // FIXME: does not inline, always yields a trampoline @inline constructor(offset: usize = 0) { return changetype>(offset); } diff --git a/tests/compiler/std/pointer.untouched.wat b/tests/compiler/std/pointer.untouched.wat index 72b2e61eac..d338ec1e67 100644 --- a/tests/compiler/std/pointer.untouched.wat +++ b/tests/compiler/std/pointer.untouched.wat @@ -1,13 +1,16 @@ (module + (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$vii (func (param i32 i32))) (type $FUNCSIG$viii (func (param i32 i32 i32))) (type $FUNCSIG$viif (func (param i32 i32 f32))) (type $FUNCSIG$vif (func (param i32 f32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\0e\00\00\00s\00t\00d\00/\00p\00o\00i\00n\00t\00e\00r\00.\00t\00s\00") + (data (i32.const 8) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00s\00t\00d\00/\00p\00o\00i\00n\00t\00e\00r\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) (global $std/pointer/one (mut i32) (i32.const 0)) @@ -15,266 +18,320 @@ (global $std/pointer/add (mut i32) (i32.const 0)) (global $std/pointer/sub (mut i32) (i32.const 0)) (global $std/pointer/nextOne (mut i32) (i32.const 0)) + (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) (global $std/pointer/buf (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 40)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) - (func $~lib/internal/memory/memset (; 1 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i64) - local.get $2 - i32.eqz - if - return - end - local.get $0 - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 1 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 2 - i32.le_u - if - return - end + (func $~lib/rt/stub/__retain (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - i32.const 1 - i32.add + ) + (func $~lib/rt/stub/__release (; 2 ;) (type $FUNCSIG$vi) (param $0 i32) + nop + ) + (func $std/pointer/Pointer#add (; 3 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) local.get $1 - i32.store8 + call $~lib/rt/stub/__retain + drop local.get $0 - i32.const 2 - i32.add local.get $1 - i32.store8 - local.get $0 - local.get $2 i32.add - i32.const 2 - i32.sub - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 3 - i32.sub + call $~lib/rt/stub/__retain + local.set $2 local.get $1 - i32.store8 + call $~lib/rt/stub/__release local.get $2 - i32.const 6 - i32.le_u - if - return - end - local.get $0 - i32.const 3 - i32.add + ) + (func $std/pointer/Pointer#sub (; 4 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) local.get $1 - i32.store8 + call $~lib/rt/stub/__retain + drop local.get $0 - local.get $2 - i32.add - i32.const 4 - i32.sub local.get $1 - i32.store8 - local.get $2 - i32.const 8 - i32.le_u - if - return - end - i32.const 0 - local.get $0 - i32.sub - i32.const 3 - i32.and - local.set $3 - local.get $0 - local.get $3 - i32.add - local.set $0 - local.get $2 - local.get $3 i32.sub + call $~lib/rt/stub/__retain local.set $2 - local.get $2 - i32.const -4 - i32.and - local.set $2 - i32.const -1 - i32.const 255 - i32.div_u local.get $1 - i32.const 255 - i32.and - i32.mul - local.set $4 - local.get $0 - local.get $4 - i32.store - local.get $0 + call $~lib/rt/stub/__release local.get $2 - i32.add - i32.const 4 - i32.sub - local.get $4 - i32.store - local.get $2 - i32.const 8 - i32.le_u - if - return - end - local.get $0 - i32.const 4 - i32.add - local.get $4 - i32.store + ) + (func $std/pointer/Pointer#inc (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 8 i32.add - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 12 - i32.sub - local.get $4 - i32.store + call $~lib/rt/stub/__retain + ) + (func $std/pointer/Pointer#dec (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - local.get $2 - i32.add i32.const 8 i32.sub - local.get $4 - i32.store - local.get $2 - i32.const 24 - i32.le_u - if - return - end - local.get $0 - i32.const 12 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 16 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 20 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 24 - i32.add - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 28 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 24 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 20 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 16 - i32.sub - local.get $4 - i32.store - i32.const 24 - local.get $0 - i32.const 4 - i32.and - i32.add - local.set $3 - local.get $0 - local.get $3 - i32.add - local.set $0 - local.get $2 - local.get $3 - i32.sub - local.set $2 - local.get $4 - i64.extend_i32_u - local.get $4 - i64.extend_i32_u - i64.const 32 - i64.shl - i64.or - local.set $5 - block $break|0 - loop $continue|0 - local.get $2 - i32.const 32 - i32.ge_u - if - block - local.get $0 + call $~lib/rt/stub/__retain + ) + (func $~lib/memory/memory.fill (; 7 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i64) + block $~lib/util/memory/memset|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $3 + i32.eqz + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 1 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 2 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 1 + i32.add + local.get $4 + i32.store8 + local.get $5 + i32.const 2 + i32.add + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 2 + i32.sub + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 3 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 6 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 3 + i32.add + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + i32.const 0 + local.get $5 + i32.sub + i32.const 3 + i32.and + local.set $6 + local.get $5 + local.get $6 + i32.add + local.set $5 + local.get $3 + local.get $6 + i32.sub + local.set $3 + local.get $3 + i32.const -4 + i32.and + local.set $3 + i32.const -1 + i32.const 255 + i32.div_u + local.get $4 + i32.const 255 + i32.and + i32.mul + local.set $7 + local.get $5 + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.get $7 + i32.store + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 4 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 8 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 12 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 8 + i32.sub + local.get $7 + i32.store + local.get $3 + i32.const 24 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 12 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 16 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 20 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 24 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 28 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 24 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 20 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 16 + i32.sub + local.get $7 + i32.store + i32.const 24 + local.get $5 + i32.const 4 + i32.and + i32.add + local.set $6 + local.get $5 + local.get $6 + i32.add + local.set $5 + local.get $3 + local.get $6 + i32.sub + local.set $3 + local.get $7 + i64.extend_i32_u + local.get $7 + i64.extend_i32_u + i64.const 32 + i64.shl + i64.or + local.set $8 + block $break|0 + loop $continue|0 + local.get $3 + i32.const 32 + i32.ge_u + if local.get $5 + local.get $8 i64.store - local.get $0 + local.get $5 i32.const 8 i32.add - local.get $5 + local.get $8 i64.store - local.get $0 + local.get $5 i32.const 16 i32.add - local.get $5 + local.get $8 i64.store - local.get $0 + local.get $5 i32.const 24 i32.add - local.get $5 + local.get $8 i64.store - local.get $2 + local.get $3 i32.const 32 i32.sub - local.set $2 - local.get $0 + local.set $3 + local.get $5 i32.const 32 i32.add - local.set $0 + local.set $5 + br $continue|0 end - br $continue|0 end end end ) - (func $~lib/internal/memory/memcpy (; 2 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/memory/memcpy (; 8 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -286,33 +343,31 @@ i32.const 3 i32.and else - local.get $2 + i32.const 0 end if - block - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - local.get $2 + block (result i32) + local.get $0 + local.tee $5 i32.const 1 - i32.sub - local.set $2 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 br $continue|0 end end @@ -329,48 +384,46 @@ i32.const 16 i32.ge_u if - block - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $1 - i32.const 4 - i32.add - i32.load - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $1 - i32.const 8 - i32.add - i32.load - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 12 - i32.add - i32.load - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - end + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 8 + i32.add + i32.load + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 12 + i32.add + i32.load + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 br $continue|1 end end @@ -553,158 +606,22 @@ i32.const 17 i32.ge_u if - block - local.get $1 - i32.const 1 - i32.add - i32.load - local.set $4 - local.get $0 - local.get $3 - i32.const 24 - i32.shr_u - local.get $4 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 5 - i32.add - i32.load - local.set $3 - local.get $0 - i32.const 4 - i32.add - local.get $4 - i32.const 24 - i32.shr_u - local.get $3 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 9 - i32.add - i32.load - local.set $4 - local.get $0 - i32.const 8 - i32.add - local.get $3 - i32.const 24 - i32.shr_u - local.get $4 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 13 - i32.add - i32.load - local.set $3 - local.get $0 - i32.const 12 - i32.add - local.get $4 - i32.const 24 - i32.shr_u - local.get $3 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - end - br $continue|3 - end - end - end - br $break|2 - unreachable - end - unreachable - end - block - local.get $1 - i32.load - local.set $3 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - local.get $2 - i32.const 2 - i32.sub - local.set $2 - block $break|4 - loop $continue|4 - local.get $2 - i32.const 18 - i32.ge_u - if - block local.get $1 - i32.const 2 + i32.const 1 i32.add i32.load local.set $4 local.get $0 local.get $3 - i32.const 16 + i32.const 24 i32.shr_u local.get $4 - i32.const 16 + i32.const 8 i32.shl i32.or i32.store local.get $1 - i32.const 6 + i32.const 5 i32.add i32.load local.set $3 @@ -712,15 +629,15 @@ i32.const 4 i32.add local.get $4 - i32.const 16 + i32.const 24 i32.shr_u local.get $3 - i32.const 16 + i32.const 8 i32.shl i32.or i32.store local.get $1 - i32.const 10 + i32.const 9 i32.add i32.load local.set $4 @@ -728,15 +645,15 @@ i32.const 8 i32.add local.get $3 - i32.const 16 + i32.const 24 i32.shr_u local.get $4 - i32.const 16 + i32.const 8 i32.shl i32.or i32.store local.get $1 - i32.const 14 + i32.const 13 i32.add i32.load local.set $3 @@ -744,10 +661,10 @@ i32.const 12 i32.add local.get $4 - i32.const 16 + i32.const 24 i32.shr_u local.get $3 - i32.const 16 + i32.const 8 i32.shl i32.or i32.store @@ -763,65 +680,81 @@ i32.const 16 i32.sub local.set $2 + br $continue|3 end - br $continue|4 end end + br $break|2 + unreachable end - br $break|2 unreachable end - unreachable - end - block - local.get $1 - i32.load - local.set $3 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) + block local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - block $break|5 - loop $continue|5 - local.get $2 - i32.const 19 - i32.ge_u - if - block + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + block $break|4 + loop $continue|4 + local.get $2 + i32.const 18 + i32.ge_u + if local.get $1 - i32.const 3 + i32.const 2 i32.add i32.load local.set $4 local.get $0 local.get $3 - i32.const 8 + i32.const 16 i32.shr_u local.get $4 - i32.const 24 + i32.const 16 i32.shl i32.or i32.store local.get $1 - i32.const 7 + i32.const 6 i32.add i32.load local.set $3 @@ -829,15 +762,15 @@ i32.const 4 i32.add local.get $4 - i32.const 8 + i32.const 16 i32.shr_u local.get $3 - i32.const 24 + i32.const 16 i32.shl i32.or i32.store local.get $1 - i32.const 11 + i32.const 10 i32.add i32.load local.set $4 @@ -845,15 +778,15 @@ i32.const 8 i32.add local.get $3 - i32.const 8 + i32.const 16 i32.shr_u local.get $4 - i32.const 24 + i32.const 16 i32.shl i32.or i32.store local.get $1 - i32.const 15 + i32.const 14 i32.add i32.load local.set $3 @@ -861,10 +794,10 @@ i32.const 12 i32.add local.get $4 - i32.const 8 + i32.const 16 i32.shr_u local.get $3 - i32.const 24 + i32.const 16 i32.shl i32.or i32.store @@ -880,7 +813,121 @@ i32.const 16 i32.sub local.set $2 + br $continue|4 end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + block $break|5 + loop $continue|5 + local.get $2 + i32.const 19 + i32.ge_u + if + local.get $1 + i32.const 3 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 7 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 11 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 15 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 br $continue|5 end end @@ -1475,265 +1522,250 @@ i32.store8 end ) - (func $~lib/internal/memory/memmove (; 3 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/memory/memory.copy (; 9 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - local.get $0 - local.get $1 - i32.eq - if - return - end - local.get $1 - local.get $2 - i32.add - local.get $0 - i32.le_u - local.tee $3 - if (result i32) - local.get $3 - else - local.get $0 - local.get $2 - i32.add - local.get $1 - i32.le_u - end - if + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 local.get $0 + local.set $5 local.get $1 + local.set $4 local.get $2 - call $~lib/internal/memory/memcpy - return - end - local.get $0 - local.get $1 - i32.lt_u - if - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and + local.set $3 + local.get $5 + local.get $4 i32.eq if - block $break|0 - loop $continue|0 - local.get $0 - i32.const 7 - i32.and - if - block - local.get $2 + br $~lib/util/memory/memmove|inlined.0 + end + local.get $4 + local.get $3 + i32.add + local.get $5 + i32.le_u + if (result i32) + i32.const 1 + else + local.get $5 + local.get $3 + i32.add + local.get $4 + i32.le_u + end + if + local.get $5 + local.get $4 + local.get $3 + call $~lib/util/memory/memcpy + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 i32.eqz if - return + br $~lib/util/memory/memmove|inlined.0 end - local.get $2 + local.get $3 i32.const 1 i32.sub - local.set $2 + local.set $3 block (result i32) - local.get $0 - local.tee $3 + local.get $5 + local.tee $6 i32.const 1 i32.add - local.set $0 - local.get $3 + local.set $5 + local.get $6 end block (result i32) - local.get $1 - local.tee $3 + local.get $4 + local.tee $6 i32.const 1 i32.add - local.set $1 - local.get $3 + local.set $4 + local.get $6 end i32.load8_u i32.store8 + br $continue|0 end - br $continue|0 end end - end - block $break|1 - loop $continue|1 - local.get $2 - i32.const 8 - i32.ge_u - if - block - local.get $0 - local.get $1 + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 i64.load i64.store - local.get $2 + local.get $3 i32.const 8 i32.sub - local.set $2 - local.get $0 + local.set $3 + local.get $5 i32.const 8 i32.add - local.set $0 - local.get $1 + local.set $5 + local.get $4 i32.const 8 i32.add - local.set $1 + local.set $4 + br $continue|1 end - br $continue|1 end end end - end - block $break|2 - loop $continue|2 - local.get $2 - if - block + block $break|2 + loop $continue|2 + local.get $3 + if block (result i32) - local.get $0 - local.tee $3 + local.get $5 + local.tee $6 i32.const 1 i32.add - local.set $0 - local.get $3 + local.set $5 + local.get $6 end block (result i32) - local.get $1 - local.tee $3 + local.get $4 + local.tee $6 i32.const 1 i32.add - local.set $1 - local.get $3 + local.set $4 + local.get $6 end i32.load8_u i32.store8 - local.get $2 + local.get $3 i32.const 1 i32.sub - local.set $2 + local.set $3 + br $continue|2 end - br $continue|2 end end - end - else - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and - i32.eq - if - block $break|3 - loop $continue|3 - local.get $0 - local.get $2 - i32.add - i32.const 7 - i32.and - if - block - local.get $2 + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 i32.eqz if - return + br $~lib/util/memory/memmove|inlined.0 end - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.const 1 i32.sub - local.tee $2 + local.tee $3 i32.add - local.get $1 - local.get $2 + local.get $4 + local.get $3 i32.add i32.load8_u i32.store8 + br $continue|3 end - br $continue|3 end end - end - block $break|4 - loop $continue|4 - local.get $2 - i32.const 8 - i32.ge_u - if - block - local.get $2 + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 i32.const 8 i32.sub - local.set $2 - local.get $0 - local.get $2 + local.set $3 + local.get $5 + local.get $3 i32.add - local.get $1 - local.get $2 + local.get $4 + local.get $3 i32.add i64.load i64.store + br $continue|4 end - br $continue|4 + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 end end end end - block $break|5 - loop $continue|5 - local.get $2 - if - local.get $0 - local.get $2 - i32.const 1 - i32.sub - local.tee $2 - i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 - br $continue|5 - end - end - end end ) - (func $std/pointer/Pointer#set:value (; 4 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) + (func $std/pointer/Pointer#set:value (; 10 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) local.get $1 i32.const 0 i32.eq if local.get $0 - local.set $2 i32.const 0 - local.set $3 i32.const 8 - local.set $4 - local.get $2 - local.get $3 - local.get $4 - call $~lib/internal/memory/memset + call $~lib/memory/memory.fill else local.get $0 - local.set $4 local.get $1 - local.set $3 i32.const 8 - local.set $2 - local.get $4 - local.get $3 - local.get $2 - call $~lib/internal/memory/memmove + call $~lib/memory/memory.copy end ) - (func $std/pointer/Pointer#set (; 5 ;) (type $FUNCSIG$viif) (param $0 i32) (param $1 i32) (param $2 f32) + (func $std/pointer/Pointer#set (; 11 ;) (type $FUNCSIG$viif) (param $0 i32) (param $1 i32) (param $2 f32) local.get $0 local.get $1 i32.const 4 @@ -1742,21 +1774,27 @@ local.get $2 f32.store ) - (func $std/pointer/Pointer#set:value (; 6 ;) (type $FUNCSIG$vif) (param $0 i32) (param $1 f32) + (func $std/pointer/Pointer#set:value (; 12 ;) (type $FUNCSIG$vif) (param $0 i32) (param $1 f32) local.get $0 local.get $1 f32.store ) - (func $start:std/pointer (; 7 ;) (type $FUNCSIG$v) + (func $start:std/pointer (; 13 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) - (local $2 f32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 f32) block $std/pointer/Pointer#constructor|inlined.0 (result i32) i32.const 0 - local.set $0 - i32.const 8 local.set $1 - local.get $1 + i32.const 8 + local.set $0 + local.get $0 + call $~lib/rt/stub/__retain end global.set $std/pointer/one block $std/pointer/Pointer#constructor|inlined.1 (result i32) @@ -1765,6 +1803,7 @@ i32.const 24 local.set $0 local.get $0 + call $~lib/rt/stub/__retain end global.set $std/pointer/two block $std/pointer/Pointer#get:offset|inlined.0 (result i32) @@ -1777,26 +1816,26 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 79 + i32.const 24 + i32.const 78 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $std/pointer/Pointer#get:offset|inlined.1 (result i32) global.get $std/pointer/two - local.set $0 - local.get $0 + local.set $1 + local.get $1 end i32.const 24 i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 80 + i32.const 24 + i32.const 79 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $std/pointer/Pointer#get:value|inlined.0 (result i32) @@ -1809,8 +1848,8 @@ i32.store block $std/pointer/Pointer#get:value|inlined.1 (result i32) global.get $std/pointer/one - local.set $0 - local.get $0 + local.set $1 + local.get $1 br $std/pointer/Pointer#get:value|inlined.1 end i32.const 2 @@ -1827,16 +1866,16 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 84 + i32.const 24 + i32.const 83 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $std/pointer/Pointer#get:value|inlined.3 (result i32) global.get $std/pointer/one - local.set $0 - local.get $0 + local.set $1 + local.get $1 br $std/pointer/Pointer#get:value|inlined.3 end i32.load offset=4 @@ -1845,91 +1884,94 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 85 + i32.const 24 + i32.const 84 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $std/pointer/Pointer#add|inlined.0 (result i32) - global.get $std/pointer/one - local.set $0 - global.get $std/pointer/two - local.set $1 - local.get $0 - local.get $1 - i32.add - end + global.get $std/pointer/one + global.get $std/pointer/two + call $std/pointer/Pointer#add + local.tee $1 + call $~lib/rt/stub/__retain global.set $std/pointer/add block $std/pointer/Pointer#get:offset|inlined.2 (result i32) global.get $std/pointer/add - local.set $1 - local.get $1 + local.set $0 + local.get $0 end i32.const 32 i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 88 + i32.const 24 + i32.const 87 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $std/pointer/Pointer#sub|inlined.0 (result i32) - global.get $std/pointer/two - local.set $1 - global.get $std/pointer/one - local.set $0 - local.get $1 - local.get $0 - i32.sub - end + global.get $std/pointer/two + global.get $std/pointer/one + call $std/pointer/Pointer#sub + local.tee $0 + call $~lib/rt/stub/__retain global.set $std/pointer/sub block $std/pointer/Pointer#get:offset|inlined.3 (result i32) global.get $std/pointer/sub - local.set $0 - local.get $0 + local.set $2 + local.get $2 end i32.const 16 i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 91 + i32.const 24 + i32.const 90 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $std/pointer/Pointer#get:offset|inlined.4 (result i32) global.get $std/pointer/one - local.set $0 - local.get $0 + local.set $2 + local.get $2 end i32.const 8 i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 93 + i32.const 24 + i32.const 92 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block (result i32) - block $std/pointer/Pointer#inc|inlined.0 (result i32) + block (result i32) global.get $std/pointer/one - local.set $0 - local.get $0 - i32.const 8 - i32.add + call $std/pointer/Pointer#inc + local.tee $2 + local.tee $3 + global.get $std/pointer/one + local.tee $4 + i32.ne + if + local.get $3 + call $~lib/rt/stub/__retain + drop + local.get $4 + call $~lib/rt/stub/__release + end + local.get $3 end global.set $std/pointer/one global.get $std/pointer/one end + call $~lib/rt/stub/__retain global.set $std/pointer/nextOne global.get $std/pointer/nextOne global.get $std/pointer/one @@ -1937,80 +1979,100 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 95 + i32.const 24 + i32.const 94 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $std/pointer/Pointer#get:offset|inlined.5 (result i32) global.get $std/pointer/one - local.set $0 - local.get $0 + local.set $4 + local.get $4 end i32.const 16 i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 96 + i32.const 24 + i32.const 95 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $std/pointer/Pointer#get:offset|inlined.6 (result i32) global.get $std/pointer/two - local.set $0 - local.get $0 + local.set $3 + local.get $3 end i32.const 24 i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 98 + i32.const 24 + i32.const 97 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $std/pointer/Pointer#dec|inlined.0 (result i32) + block (result i32) global.get $std/pointer/two - local.set $0 - local.get $0 - i32.const 8 - i32.sub + call $std/pointer/Pointer#dec + local.tee $3 + local.tee $4 + global.get $std/pointer/two + local.tee $5 + i32.ne + if + local.get $4 + call $~lib/rt/stub/__retain + drop + local.get $5 + call $~lib/rt/stub/__release + end + local.get $4 end global.set $std/pointer/two - block $std/pointer/Pointer#dec|inlined.1 (result i32) + block (result i32) global.get $std/pointer/two - local.set $0 - local.get $0 - i32.const 8 - i32.sub + call $std/pointer/Pointer#dec + local.tee $4 + local.tee $5 + global.get $std/pointer/two + local.tee $6 + i32.ne + if + local.get $5 + call $~lib/rt/stub/__retain + drop + local.get $6 + call $~lib/rt/stub/__release + end + local.get $5 end global.set $std/pointer/two block $std/pointer/Pointer#get:offset|inlined.7 (result i32) global.get $std/pointer/two - local.set $0 - local.get $0 + local.set $6 + local.get $6 end i32.const 8 i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 101 + i32.const 24 + i32.const 100 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $std/pointer/Pointer#get:value|inlined.4 (result i32) global.get $std/pointer/two - local.set $0 - local.get $0 + local.set $5 + local.get $5 br $std/pointer/Pointer#get:value|inlined.4 end i32.load @@ -2019,16 +2081,16 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 102 + i32.const 24 + i32.const 101 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $std/pointer/Pointer#get:value|inlined.5 (result i32) global.get $std/pointer/two - local.set $0 - local.get $0 + local.set $6 + local.get $6 br $std/pointer/Pointer#get:value|inlined.5 end i32.load offset=4 @@ -2037,44 +2099,44 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 103 + i32.const 24 + i32.const 102 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/pointer/one block $std/pointer/Pointer#get:value|inlined.6 (result i32) global.get $std/pointer/two - local.set $0 - local.get $0 + local.set $5 + local.get $5 br $std/pointer/Pointer#get:value|inlined.6 end call $std/pointer/Pointer#set:value block $std/pointer/Pointer#get:offset|inlined.8 (result i32) global.get $std/pointer/one - local.set $0 - local.get $0 + local.set $6 + local.get $6 end block $std/pointer/Pointer#get:offset|inlined.9 (result i32) global.get $std/pointer/two - local.set $0 - local.get $0 + local.set $5 + local.get $5 end i32.ne i32.eqz if i32.const 0 - i32.const 8 - i32.const 106 + i32.const 24 + i32.const 105 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $std/pointer/Pointer#get:value|inlined.7 (result i32) global.get $std/pointer/one - local.set $0 - local.get $0 + local.set $6 + local.get $6 br $std/pointer/Pointer#get:value|inlined.7 end i32.load @@ -2083,16 +2145,16 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 107 + i32.const 24 + i32.const 106 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $std/pointer/Pointer#get:value|inlined.8 (result i32) global.get $std/pointer/one - local.set $0 - local.get $0 + local.set $5 + local.get $5 br $std/pointer/Pointer#get:value|inlined.8 end i32.load offset=4 @@ -2101,18 +2163,19 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 108 + i32.const 24 + i32.const 107 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $std/pointer/Pointer#constructor|inlined.0 (result i32) i32.const 0 - local.set $0 + local.set $5 i32.const 0 - local.set $1 - local.get $1 + local.set $6 + local.get $6 + call $~lib/rt/stub/__retain end global.set $std/pointer/buf global.get $std/pointer/buf @@ -2125,11 +2188,11 @@ call $std/pointer/Pointer#set block $std/pointer/Pointer#get|inlined.0 (result f32) global.get $std/pointer/buf - local.set $1 + local.set $5 i32.const 0 - local.set $0 - local.get $1 - local.get $0 + local.set $6 + local.get $5 + local.get $6 i32.const 4 i32.mul i32.add @@ -2140,19 +2203,19 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 114 + i32.const 24 + i32.const 113 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $std/pointer/Pointer#get|inlined.1 (result f32) global.get $std/pointer/buf - local.set $0 + local.set $5 i32.const 1 - local.set $1 - local.get $0 - local.get $1 + local.set $6 + local.get $5 + local.get $6 i32.const 4 i32.mul i32.add @@ -2163,19 +2226,19 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 115 + i32.const 24 + i32.const 114 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $std/pointer/Pointer#get|inlined.2 (result f32) global.get $std/pointer/buf - local.set $1 + local.set $5 i32.const 0 - local.set $0 - local.get $1 - local.get $0 + local.set $6 + local.get $5 + local.get $6 i32.const 4 i32.mul i32.add @@ -2186,19 +2249,19 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 117 + i32.const 24 + i32.const 116 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $std/pointer/Pointer#get|inlined.3 (result f32) global.get $std/pointer/buf - local.set $0 + local.set $5 i32.const 1 - local.set $1 - local.get $0 - local.get $1 + local.set $6 + local.get $5 + local.get $6 i32.const 4 i32.mul i32.add @@ -2209,10 +2272,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 118 + i32.const 24 + i32.const 117 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -2222,10 +2285,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 120 + i32.const 24 + i32.const 119 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 4 @@ -2235,34 +2298,34 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 121 + i32.const 24 + i32.const 120 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $std/pointer/Pointer#set|inlined.0 global.get $std/pointer/buf - local.set $1 + local.set $5 i32.const 2 - local.set $0 + local.set $6 f32.const 1.2999999523162842 - local.set $2 - local.get $1 - local.get $0 + local.set $7 + local.get $5 + local.get $6 i32.const 4 i32.mul i32.add - local.get $2 + local.get $7 f32.store end block $std/pointer/Pointer#get|inlined.4 (result f32) global.get $std/pointer/buf - local.set $0 + local.set $5 i32.const 2 - local.set $1 - local.get $0 - local.get $1 + local.set $6 + local.get $5 + local.get $6 i32.const 4 i32.mul i32.add @@ -2273,19 +2336,19 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 124 + i32.const 24 + i32.const 123 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $std/pointer/Pointer#get|inlined.5 (result f32) global.get $std/pointer/buf - local.set $1 + local.set $5 i32.const 2 - local.set $0 - local.get $1 - local.get $0 + local.set $6 + local.get $5 + local.get $6 i32.const 4 i32.mul i32.add @@ -2296,10 +2359,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 125 + i32.const 24 + i32.const 124 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 8 @@ -2309,10 +2372,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 126 + i32.const 24 + i32.const 125 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/pointer/buf @@ -2320,8 +2383,8 @@ call $std/pointer/Pointer#set:value block $std/pointer/Pointer#get:value|inlined.0 (result f32) global.get $std/pointer/buf - local.set $0 - local.get $0 + local.set $6 + local.get $6 f32.load br $std/pointer/Pointer#get:value|inlined.0 end @@ -2330,10 +2393,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 129 + i32.const 24 + i32.const 128 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -2343,16 +2406,26 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 130 + i32.const 24 + i32.const 129 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 + call $~lib/rt/stub/__release + local.get $3 + call $~lib/rt/stub/__release + local.get $4 + call $~lib/rt/stub/__release ) - (func $start (; 8 ;) (type $FUNCSIG$v) + (func $start (; 14 ;) (type $FUNCSIG$v) call $start:std/pointer ) - (func $null (; 9 ;) (type $FUNCSIG$v) + (func $null (; 15 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/std/polyfills.json b/tests/compiler/std/polyfills.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/std/polyfills.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/std/polyfills.optimized.wat b/tests/compiler/std/polyfills.optimized.wat index 819523fe1b..cf67499b8a 100644 --- a/tests/compiler/std/polyfills.optimized.wat +++ b/tests/compiler/std/polyfills.optimized.wat @@ -1,11 +1,8 @@ (module (type $FUNCSIG$v (func)) (memory $0 1) - (data (i32.const 8) "\10\00\00\00s\00t\00d\00/\00p\00o\00l\00y\00f\00i\00l\00l\00s\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $start) + (data (i32.const 8) " \00\00\00\01\00\00\00\01\00\00\00 \00\00\00s\00t\00d\00/\00p\00o\00l\00y\00f\00i\00l\00l\00s\00.\00t\00s") (export "memory" (memory $0)) - (export "table" (table $0)) (func $start (; 0 ;) (type $FUNCSIG$v) nop ) diff --git a/tests/compiler/std/polyfills.untouched.wat b/tests/compiler/std/polyfills.untouched.wat index 8a6f21d814..b6c4f1406e 100644 --- a/tests/compiler/std/polyfills.untouched.wat +++ b/tests/compiler/std/polyfills.untouched.wat @@ -3,14 +3,12 @@ (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$jj (func (param i64) (result i64))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00s\00t\00d\00/\00p\00o\00l\00y\00f\00i\00l\00l\00s\00.\00t\00s\00") + (data (i32.const 8) " \00\00\00\01\00\00\00\01\00\00\00 \00\00\00s\00t\00d\00/\00p\00o\00l\00y\00f\00i\00l\00l\00s\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/memory/HEAP_BASE i32 (i32.const 44)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $~lib/polyfills/bswap (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 @@ -184,8 +182,81 @@ i32.or return ) - (func $start:std/polyfills (; 11 ;) (type $FUNCSIG$v) - (local $0 i32) + (func $~lib/polyfills/bswap16 (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + return + ) + (func $~lib/polyfills/bswap16 (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + return + ) + (func $~lib/polyfills/bswap16 (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 8 + i32.shl + local.get $0 + i32.const 65535 + i32.and + i32.const 8 + i32.shr_u + i32.const 255 + i32.and + i32.or + return + ) + (func $~lib/polyfills/bswap16 (; 14 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 8 + i32.shl + local.get $0 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + i32.const 8 + i32.shr_s + i32.const 255 + i32.and + i32.or + return + ) + (func $~lib/polyfills/bswap16 (; 15 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 8 + i32.shl + i32.const 65280 + i32.and + local.get $0 + i32.const 8 + i32.shr_u + i32.const 255 + i32.and + i32.or + local.get $0 + i32.const -65536 + i32.and + i32.or + return + ) + (func $~lib/polyfills/bswap16 (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 8 + i32.shl + i32.const 65280 + i32.and + local.get $0 + i32.const 8 + i32.shr_s + i32.const 255 + i32.and + i32.or + local.get $0 + i32.const -65536 + i32.and + i32.or + return + ) + (func $start:std/polyfills (; 17 ;) (type $FUNCSIG$v) i32.const 170 call $~lib/polyfills/bswap i32.const 255 @@ -195,10 +266,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 4 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 170 @@ -216,10 +287,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 5 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 43707 @@ -231,10 +302,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 8 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 43707 @@ -252,10 +323,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 9 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const -1430532899 @@ -265,10 +336,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 12 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const -1430532899 @@ -278,10 +349,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 13 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 4822679907192029 @@ -291,10 +362,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 16 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 4822679907192029 @@ -304,10 +375,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 17 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const -1430532899 @@ -317,10 +388,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 20 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const -1430532899 @@ -330,18 +401,14 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 21 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/polyfills/bswap16|inlined.0 (result i32) - i32.const 170 - local.set $0 - local.get $0 - br $~lib/polyfills/bswap16|inlined.0 - end + i32.const 170 + call $~lib/polyfills/bswap16 i32.const 255 i32.and i32.const 170 @@ -349,18 +416,14 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 24 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/polyfills/bswap16|inlined.0 (result i32) - i32.const 170 - local.set $0 - local.get $0 - br $~lib/polyfills/bswap16|inlined.0 - end + i32.const 170 + call $~lib/polyfills/bswap16 i32.const 24 i32.shl i32.const 24 @@ -374,26 +437,14 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 25 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/polyfills/bswap16|inlined.0 (result i32) - i32.const 43707 - local.set $0 - local.get $0 - i32.const 8 - i32.shl - local.get $0 - i32.const 8 - i32.shr_u - i32.const 255 - i32.and - i32.or - br $~lib/polyfills/bswap16|inlined.0 - end + i32.const 43707 + call $~lib/polyfills/bswap16 i32.const 65535 i32.and i32.const 48042 @@ -401,30 +452,14 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 28 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/polyfills/bswap16|inlined.0 (result i32) - i32.const 43707 - local.set $0 - local.get $0 - i32.const 8 - i32.shl - local.get $0 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - i32.const 8 - i32.shr_s - i32.const 255 - i32.and - i32.or - br $~lib/polyfills/bswap16|inlined.0 - end + i32.const 43707 + call $~lib/polyfills/bswap16 i32.const 16 i32.shl i32.const 16 @@ -438,78 +473,42 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 29 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/polyfills/bswap16|inlined.0 (result i32) - i32.const -7820613 - local.set $0 - local.get $0 - i32.const 8 - i32.shl - i32.const 65280 - i32.and - local.get $0 - i32.const 8 - i32.shr_u - i32.const 255 - i32.and - i32.or - local.get $0 - i32.const -65536 - i32.and - i32.or - br $~lib/polyfills/bswap16|inlined.0 - end + i32.const -7820613 + call $~lib/polyfills/bswap16 i32.const -7816278 i32.eq i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 32 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/polyfills/bswap16|inlined.0 (result i32) - i32.const -7820613 - local.set $0 - local.get $0 - i32.const 8 - i32.shl - i32.const 65280 - i32.and - local.get $0 - i32.const 8 - i32.shr_s - i32.const 255 - i32.and - i32.or - local.get $0 - i32.const -65536 - i32.and - i32.or - br $~lib/polyfills/bswap16|inlined.0 - end + i32.const -7820613 + call $~lib/polyfills/bswap16 i32.const -7816278 i32.eq i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 33 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) - (func $start (; 12 ;) (type $FUNCSIG$v) + (func $start (; 18 ;) (type $FUNCSIG$v) call $start:std/polyfills ) - (func $null (; 13 ;) (type $FUNCSIG$v) + (func $null (; 19 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/std/set.json b/tests/compiler/std/set.json new file mode 100644 index 0000000000..9f7878d475 --- /dev/null +++ b/tests/compiler/std/set.json @@ -0,0 +1,6 @@ +{ + "asc_flags": [ + "--runtime half", + "--use ASC_RTRACE=1" + ] +} \ No newline at end of file diff --git a/tests/compiler/std/set.optimized.wat b/tests/compiler/std/set.optimized.wat index 1b5dbb5e51..aa7b9d8724 100644 --- a/tests/compiler/std/set.optimized.wat +++ b/tests/compiler/std/set.optimized.wat @@ -1,384 +1,1767 @@ (module (type $FUNCSIG$v (func)) (type $FUNCSIG$ii (func (param i32) (result i32))) - (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) - (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$iij (func (param i32 i64) (result i32))) (type $FUNCSIG$ij (func (param i64) (result i32))) (type $FUNCSIG$iiji (func (param i32 i64 i32) (result i32))) (type $FUNCSIG$vij (func (param i32 i64))) (type $FUNCSIG$iif (func (param i32 f32) (result i32))) - (type $FUNCSIG$if (func (param f32) (result i32))) (type $FUNCSIG$iifi (func (param i32 f32 i32) (result i32))) (type $FUNCSIG$vif (func (param i32 f32))) (type $FUNCSIG$iid (func (param i32 f64) (result i32))) - (type $FUNCSIG$id (func (param f64) (result i32))) (type $FUNCSIG$iidi (func (param i32 f64 i32) (result i32))) (type $FUNCSIG$vid (func (param i32 f64))) (type $FUNCSIG$i (func (result i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32))) + (import "rtrace" "onincrement" (func $~lib/rt/rtrace/onincrement (param i32))) + (import "rtrace" "ondecrement" (func $~lib/rt/rtrace/ondecrement (param i32))) + (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) (memory $0 1) - (data (i32.const 8) "\13\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") - (data (i32.const 56) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") - (data (i32.const 120) "\n\00\00\00s\00t\00d\00/\00s\00e\00t\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) + (data (i32.const 8) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s") + (data (i32.const 56) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e") + (data (i32.const 112) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s") + (data (i32.const 160) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h") + (data (i32.const 208) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") + (data (i32.const 264) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e") + (data (i32.const 320) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s") + (data (i32.const 360) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00s\00t\00d\00/\00s\00e\00t\00.\00t\00s") + (data (i32.const 400) "\0d\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\004\04\00\00\00\00\00\004\00\00\00\00\00\00\00T\04\00\00\00\00\00\00T\00\00\00\00\00\00\00\94\04\00\00\00\00\00\00\94\00\00\00\00\00\00\00\14\05\00\00\00\00\00\00\14\01\00\00\00\00\00\00\94\0c\00\00\00\00\00\00\14\0d") + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) - (func $~lib/allocator/arena/__memory_allocate (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/rt/tlsf/removeBlock (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) - local.get $0 - i32.const 1073741824 - i32.gt_u + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.tee $3 + i32.const 1 + i32.and + i32.eqz if + i32.const 0 + i32.const 24 + i32.const 276 + i32.const 13 + call $~lib/builtins/abort unreachable end - global.get $~lib/allocator/arena/offset - local.tee $1 - local.get $0 - i32.const 1 - local.get $0 - i32.const 1 - i32.gt_u - select - i32.add - i32.const 7 - i32.add - i32.const -8 + local.get $3 + i32.const -4 i32.and - local.tee $0 - current_memory local.tee $2 i32.const 16 - i32.shl - i32.gt_u + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz if + i32.const 0 + i32.const 24 + i32.const 278 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 256 + i32.lt_u + if (result i32) local.get $2 - local.get $0 - local.get $1 - i32.sub - i32.const 65535 - i32.add - i32.const -65536 - i32.and - i32.const 16 + i32.const 4 i32.shr_u - local.tee $3 + local.set $2 + i32.const 0 + else local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $3 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $2 local.get $3 - i32.gt_s - select - grow_memory + i32.const 7 + i32.sub + end + local.tee $3 + i32.const 23 + i32.lt_u + if (result i32) + local.get $2 + i32.const 16 + i32.lt_u + else i32.const 0 - i32.lt_s - if - local.get $3 - grow_memory - i32.const 0 - i32.lt_s - if - unreachable - end - end end - local.get $0 - global.set $~lib/allocator/arena/offset - local.get $1 - ) - (func $~lib/internal/arraybuffer/allocateUnsafe (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - local.get $0 - i32.const 1073741816 - i32.gt_u + i32.eqz if i32.const 0 - i32.const 56 - i32.const 26 - i32.const 2 - call $~lib/env/abort + i32.const 24 + i32.const 291 + i32.const 13 + call $~lib/builtins/abort unreachable end - i32.const 1 - i32.const 32 - local.get $0 - i32.const 7 - i32.add - i32.clz - i32.sub - i32.shl - call $~lib/allocator/arena/__memory_allocate - local.tee $1 - local.get $0 - i32.store local.get $1 - ) - (func $~lib/internal/memory/memset (; 3 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - (local $2 i32) + i32.load offset=20 + local.set $4 local.get $1 - i32.eqz + i32.load offset=16 + local.tee $5 if - return + local.get $5 + local.get $4 + i32.store offset=20 end - local.get $0 - i32.const 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - i32.const 1 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 2 - i32.le_u + local.get $4 if - return + local.get $4 + local.get $5 + i32.store offset=16 end - local.get $0 - i32.const 1 + local.get $3 + i32.const 4 + i32.shl + local.get $2 i32.add - i32.const 0 - i32.store8 - local.get $0 i32.const 2 - i32.add - i32.const 0 - i32.store8 + i32.shl local.get $0 - local.get $1 i32.add - local.tee $2 - i32.const 2 - i32.sub - i32.const 0 - i32.store8 - local.get $2 - i32.const 3 - i32.sub - i32.const 0 - i32.store8 + i32.load offset=96 local.get $1 - i32.const 6 - i32.le_u + i32.eq if - return + local.get $3 + i32.const 4 + i32.shl + local.get $2 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $4 + i32.store offset=96 + local.get $4 + i32.eqz + if + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const 1 + local.get $2 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.store offset=4 + local.get $1 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $3 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end end - local.get $0 - i32.const 3 - i32.add - i32.const 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - i32.const 4 - i32.sub - i32.const 0 - i32.store8 + ) + (func $~lib/rt/tlsf/insertBlock (; 6 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) local.get $1 - i32.const 8 - i32.le_u + i32.eqz if - return + i32.const 0 + i32.const 24 + i32.const 204 + i32.const 13 + call $~lib/builtins/abort + unreachable end - i32.const 0 - local.get $0 - i32.sub - i32.const 3 + local.get $1 + i32.load + local.tee $3 + i32.const 1 i32.and - local.tee $2 - local.get $0 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 206 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 i32.add - local.tee $0 - i32.const 0 - i32.store local.get $1 - local.get $2 - i32.sub + i32.load i32.const -4 i32.and - local.tee $1 - local.get $0 i32.add - i32.const 4 - i32.sub + local.tee $4 + i32.load + local.tee $5 + i32.const 1 + i32.and + if + local.get $3 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const -4 + i32.and + i32.add + local.tee $2 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $3 + i32.const 3 + i32.and + local.get $2 + i32.or + local.tee $3 + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.set $5 + end + end + local.get $3 + i32.const 2 + i32.and + if + local.get $1 + i32.const 4 + i32.sub + i32.load + local.tee $2 + i32.load + local.tee $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 227 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $3 + i32.const -4 + i32.and + i32.add + local.tee $7 + i32.const 1073741808 + i32.lt_u + if (result i32) + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $2 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $3 + i32.store + local.get $2 + else + local.get $1 + end + local.set $1 + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $3 + i32.const -4 + i32.and + local.tee $2 + i32.const 16 + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 243 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $2 + i32.const 256 + i32.lt_u + if (result i32) + local.get $2 + i32.const 4 + i32.shr_u + local.set $4 + i32.const 0 + else + local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $4 + local.get $2 + i32.const 7 + i32.sub + end + local.tee $3 + i32.const 23 + i32.lt_u + if (result i32) + local.get $4 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 259 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + local.set $2 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $2 + i32.store offset=20 + local.get $2 + if + local.get $2 + local.get $1 + i32.store offset=16 + end + local.get $3 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $1 + i32.store offset=96 + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $3 + i32.shl + i32.or + i32.store + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const 1 + local.get $4 + i32.shl + i32.or + i32.store offset=4 + ) + (func $~lib/rt/tlsf/addMemory (; 7 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $1 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $1 + local.get $2 + i32.le_u + select + select + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 385 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=1568 + local.tee $3 + if + local.get $1 + local.get $3 + i32.const 16 + i32.add + i32.lt_u + if + i32.const 0 + i32.const 24 + i32.const 395 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $3 + i32.eq + if + local.get $3 + i32.load + local.set $4 + local.get $1 + i32.const 16 + i32.sub + local.set $1 + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.lt_u + if + i32.const 0 + i32.const 24 + i32.const 407 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.tee $2 + i32.const 48 + i32.lt_u + if + return + end + local.get $1 + local.get $4 + i32.const 2 + i32.and + local.get $2 + i32.const 32 + i32.sub + i32.const 1 + i32.or + i32.or + i32.store + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $2 + i32.add + i32.const 16 + i32.sub + local.tee $2 + i32.const 2 + i32.store + local.get $0 + local.get $2 + i32.store offset=1568 + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/tlsf/initializeRoot (; 8 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 1 + memory.size + local.tee $0 + i32.gt_s + if (result i32) + i32.const 1 + local.get $0 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + i32.const 512 + i32.const 0 + i32.store + i32.const 2080 + i32.const 0 + i32.store + i32.const 0 + local.set $0 + loop $repeat|0 + block $break|0 + local.get $0 + i32.const 23 + i32.ge_u + br_if $break|0 + local.get $0 + i32.const 2 + i32.shl + i32.const 512 + i32.add + i32.const 0 + i32.store offset=4 + i32.const 0 + local.set $1 + loop $repeat|1 + block $break|1 + local.get $1 + i32.const 16 + i32.ge_u + br_if $break|1 + local.get $0 + i32.const 4 + i32.shl + local.get $1 + i32.add + i32.const 2 + i32.shl + i32.const 512 + i32.add + i32.const 0 + i32.store offset=96 + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|1 + end + end + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + end + i32.const 512 + i32.const 2096 + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + i32.const 512 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 72 + i32.const 24 + i32.const 447 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const -16 + i32.and + local.tee $0 + i32.const 16 + local.get $0 + i32.const 16 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + i32.const 256 + i32.lt_u + if (result i32) + local.get $1 + i32.const 4 + i32.shr_u + local.set $1 + i32.const 0 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + local.get $1 + i32.add + i32.const 1 + i32.sub + local.set $1 + end + local.get $1 + i32.const 31 + local.get $1 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $1 + local.get $2 + i32.const 7 + i32.sub + end + local.tee $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $1 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 337 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const -1 + local.get $1 + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $1 + i32.ctz + local.get $2 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + else + local.get $0 + i32.load + i32.const -1 + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $1 + i32.ctz + local.tee $1 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 350 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.ctz + local.get $1 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + else + i32.const 0 + end + end + ) + (func $~lib/rt/tlsf/growMemory (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + memory.size + local.tee $2 + local.get $1 + i32.const 65535 + i32.add + i32.const -65536 + i32.and + i32.const 16 + i32.shr_u + local.tee $1 + local.get $2 + local.get $1 + i32.gt_s + select + memory.grow + i32.const 0 + i32.lt_s + if + local.get $1 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + local.get $0 + local.get $2 + i32.const 16 + i32.shl + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + ) + (func $~lib/rt/tlsf/prepareBlock (; 12 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + if + i32.const 0 + i32.const 24 + i32.const 364 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const -4 + i32.and + local.get $2 + i32.sub + local.tee $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $3 + i32.const 2 + i32.and + local.get $2 + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.tee $1 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const -2 + i32.and + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + i32.load + i32.const -3 + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.tee $3 + call $~lib/rt/tlsf/searchBlock + local.tee $2 + i32.eqz + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $3 + call $~lib/rt/tlsf/searchBlock + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 477 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + i32.load + i32.const -4 + i32.and + local.get $3 + i32.lt_u + if + i32.const 0 + i32.const 24 + i32.const 479 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 0 + i32.store offset=4 + local.get $2 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $2 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $2 + call $~lib/rt/rtrace/onalloc + local.get $2 + ) + (func $~lib/rt/tlsf/__alloc (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + global.get $~lib/rt/tlsf/ROOT + local.tee $2 + if (result i32) + local.get $2 + else + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + end + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.tee $0 + local.get $1 + i32.store offset=8 + local.get $0 + i32.const 16 + i32.add + ) + (func $~lib/rt/pure/increment (; 15 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const -268435456 + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne + if + i32.const 0 + i32.const 128 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/rtrace/onincrement + local.get $0 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 128 + i32.const 107 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/pure/__retain (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 508 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment + end + local.get $0 + ) + (func $~lib/memory/memory.fill (; 17 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.eqz + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 0 + i32.store8 + local.get $0 + local.get $1 + i32.add + i32.const 1 + i32.sub + i32.const 0 + i32.store8 + local.get $1 + i32.const 2 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 1 + i32.add + i32.const 0 + i32.store8 + local.get $0 + i32.const 2 + i32.add + i32.const 0 + i32.store8 + local.get $0 + local.get $1 + i32.add + local.tee $2 + i32.const 2 + i32.sub + i32.const 0 + i32.store8 + local.get $2 + i32.const 3 + i32.sub + i32.const 0 + i32.store8 + local.get $1 + i32.const 6 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 3 + i32.add + i32.const 0 + i32.store8 + local.get $0 + local.get $1 + i32.add + i32.const 4 + i32.sub + i32.const 0 + i32.store8 + local.get $1 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + local.get $0 + i32.sub + i32.const 3 + i32.and + local.tee $1 + i32.sub + local.set $2 + local.get $0 + local.get $1 + i32.add + local.tee $0 + i32.const 0 + i32.store + local.get $2 + i32.const -4 + i32.and + local.tee $1 + local.get $0 + i32.add + i32.const 4 + i32.sub + i32.const 0 + i32.store + local.get $1 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 4 + i32.add + i32.const 0 + i32.store + local.get $0 + i32.const 8 + i32.add + i32.const 0 + i32.store + local.get $0 + local.get $1 + i32.add + local.tee $2 + i32.const 12 + i32.sub + i32.const 0 + i32.store + local.get $2 + i32.const 8 + i32.sub + i32.const 0 + i32.store + local.get $1 + i32.const 24 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 12 + i32.add + i32.const 0 + i32.store + local.get $0 + i32.const 16 + i32.add + i32.const 0 + i32.store + local.get $0 + i32.const 20 + i32.add + i32.const 0 + i32.store + local.get $0 + i32.const 24 + i32.add + i32.const 0 + i32.store + local.get $0 + local.get $1 + i32.add + local.tee $2 + i32.const 28 + i32.sub + i32.const 0 + i32.store + local.get $2 + i32.const 24 + i32.sub + i32.const 0 + i32.store + local.get $2 + i32.const 20 + i32.sub + i32.const 0 + i32.store + local.get $2 + i32.const 16 + i32.sub + i32.const 0 + i32.store + local.get $0 + i32.const 4 + i32.and + i32.const 24 + i32.add + local.tee $2 + local.get $0 + i32.add + local.set $0 + local.get $1 + local.get $2 + i32.sub + local.set $1 + loop $continue|0 + local.get $1 + i32.const 32 + i32.ge_u + if + local.get $0 + i64.const 0 + i64.store + local.get $0 + i32.const 8 + i32.add + i64.const 0 + i64.store + local.get $0 + i32.const 16 + i32.add + i64.const 0 + i64.store + local.get $0 + i32.const 24 + i32.add + i64.const 0 + i64.store + local.get $1 + i32.const 32 + i32.sub + local.set $1 + local.get $0 + i32.const 32 + i32.add + local.set $0 + br $continue|0 + end + end + end + ) + (func $~lib/arraybuffer/ArrayBuffer#constructor (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + i32.const 1073741808 + i32.gt_u + if + i32.const 176 + i32.const 224 + i32.const 56 + i32.const 42 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.tee $1 + local.get $0 + call $~lib/memory/memory.fill + local.get $1 + call $~lib/rt/pure/__retain + ) + (func $~lib/rt/tlsf/freeBlock (; 19 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.tee $2 + i32.const 1 + i32.and + if + i32.const 0 + i32.const 24 + i32.const 531 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/rtrace/onfree + ) + (func $~lib/rt/__typeinfo (; 20 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 400 + i32.load + i32.gt_u + if + i32.const 280 + i32.const 336 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 3 + i32.shl + i32.const 404 + i32.add + i32.load + ) + (func $~lib/memory/memory.copy (; 21 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $2 + local.set $3 + local.get $0 + local.get $1 + i32.eq + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $1 + i32.lt_u + if + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|0 + local.get $0 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + br $continue|0 + end + end + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $1 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + br $continue|1 + end + end + end + loop $continue|2 + local.get $3 + if + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + else + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|3 + local.get $0 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $3 + i32.const 8 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + loop $continue|5 + local.get $3 + if + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + ) + (func $~lib/rt/tlsf/__free (; 22 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 561 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.and + i32.eqz i32.const 0 - i32.store - local.get $1 - i32.const 8 - i32.le_u + local.get $0 + select + i32.eqz if - return + i32.const 0 + i32.const 24 + i32.const 562 + i32.const 2 + call $~lib/builtins/abort + unreachable end + global.get $~lib/rt/tlsf/ROOT local.get $0 - i32.const 4 - i32.add - i32.const 0 - i32.store + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/growRoots (; 23 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/pure/CUR + global.get $~lib/rt/pure/ROOTS + local.tee $1 + i32.sub + local.tee $2 + i32.const 1 + i32.shl + local.tee $0 + i32.const 256 local.get $0 - i32.const 8 - i32.add + i32.const 256 + i32.gt_u + select + local.tee $3 i32.const 0 - i32.store + call $~lib/rt/tlsf/__alloc + local.tee $0 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onfree local.get $0 local.get $1 - i32.add - local.tee $2 - i32.const 12 - i32.sub - i32.const 0 - i32.store local.get $2 - i32.const 8 - i32.sub - i32.const 0 - i32.store + call $~lib/memory/memory.copy local.get $1 - i32.const 24 - i32.le_u if - return + local.get $1 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onalloc + local.get $1 + call $~lib/rt/tlsf/__free end local.get $0 - i32.const 12 - i32.add - i32.const 0 - i32.store + global.set $~lib/rt/pure/ROOTS local.get $0 - i32.const 16 + local.get $2 i32.add - i32.const 0 - i32.store + global.set $~lib/rt/pure/CUR local.get $0 - i32.const 20 + local.get $3 i32.add - i32.const 0 - i32.store + global.set $~lib/rt/pure/END + ) + (func $~lib/rt/pure/appendRoot (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/pure/CUR + local.tee $1 + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 + end + local.get $1 local.get $0 - i32.const 24 - i32.add - i32.const 0 i32.store - local.get $0 local.get $1 - i32.add - local.tee $2 - i32.const 28 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 24 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 20 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 16 - i32.sub - i32.const 0 - i32.store - local.get $0 i32.const 4 - i32.and - i32.const 24 i32.add + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/decrement (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 local.tee $2 + i32.const 268435455 + i32.and + local.set $1 local.get $0 - i32.add - local.set $0 + call $~lib/rt/rtrace/ondecrement + local.get $0 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 128 + i32.const 115 + i32.const 13 + call $~lib/builtins/abort + unreachable + end local.get $1 - local.get $2 - i32.sub - local.set $1 - loop $continue|0 - local.get $1 - i32.const 32 - i32.ge_u + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/rt/__visit_members + local.get $2 + i32.const -2147483648 + i32.and if local.get $0 - i64.const 0 - i64.store - local.get $0 - i32.const 8 - i32.add - i64.const 0 - i64.store + i32.const -2147483648 + i32.store offset=4 + else + global.get $~lib/rt/tlsf/ROOT local.get $0 - i32.const 16 - i32.add - i64.const 0 - i64.store + call $~lib/rt/tlsf/freeBlock + end + else + local.get $1 + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 128 + i32.const 124 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 16 + i32.and + if local.get $0 - i32.const 24 - i32.add - i64.const 0 - i64.store local.get $1 - i32.const 32 + i32.const 1 i32.sub - local.set $1 + local.get $2 + i32.const -268435456 + i32.and + i32.or + i32.store offset=4 + else local.get $0 - i32.const 32 - i32.add - local.set $0 - br $continue|0 + local.get $1 + i32.const 1 + i32.sub + i32.const -1342177280 + i32.or + i32.store offset=4 + local.get $2 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/appendRoot + end end end ) - (func $~lib/arraybuffer/ArrayBuffer#constructor (; 4 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) + (func $~lib/rt/pure/__release (; 26 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 - i32.const 1073741816 + i32.const 508 i32.gt_u if - i32.const 0 - i32.const 8 - i32.const 47 - i32.const 40 - call $~lib/env/abort - unreachable - end - local.get $0 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $2 - local.get $1 - i32.eqz - if - local.get $2 - i32.const 8 - i32.add local.get $0 - call $~lib/internal/memory/memset + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement end - local.get $2 ) - (func $~lib/set/Set#clear (; 5 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 + (func $~lib/set/Set#clear (; 27 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) i32.const 16 - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 + local.get $0 + i32.load + call $~lib/rt/pure/__release + local.get $0 + local.get $1 i32.store local.get $0 i32.const 3 i32.store offset=4 - local.get $0 i32.const 32 - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 + local.get $0 + i32.load offset=8 + call $~lib/rt/pure/__release + local.get $0 + local.get $1 i32.store offset=8 local.get $0 i32.const 4 @@ -390,10 +1773,12 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 6 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/set/Set#constructor (; 28 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 - call $~lib/allocator/arena/__memory_allocate + i32.const 3 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.store @@ -416,7 +1801,14 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/set/Set#find (; 7 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/hash/hash8 (; 29 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const -2128831035 + i32.xor + i32.const 16777619 + i32.mul + ) + (func $~lib/set/Set#find (; 30 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.load local.get $0 @@ -426,42 +1818,40 @@ i32.const 2 i32.shl i32.add - i32.load offset=8 - local.set $2 + i32.load + local.set $0 loop $continue|0 - local.get $2 + local.get $0 if - local.get $2 + local.get $0 i32.load offset=4 i32.const 1 i32.and - i32.eqz - local.tee $0 - if - local.get $2 + if (result i32) + i32.const 0 + else + local.get $0 i32.load8_u local.get $1 i32.const 255 i32.and i32.eq - local.set $0 end - local.get $0 if - local.get $2 + local.get $0 return end - local.get $2 + local.get $0 i32.load offset=4 i32.const -2 i32.and - local.set $2 + local.set $0 br $continue|0 end end i32.const 0 ) - (func $~lib/set/Set#has (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#has (; 31 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 @@ -469,15 +1859,12 @@ i32.shl i32.const 24 i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash8 call $~lib/set/Set#find i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 9 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 32 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -488,13 +1875,12 @@ local.get $1 i32.const 1 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.shl - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 - local.get $2 + local.set $5 + local.get $3 f64.convert_i32_s f64.const 2.6666666666666665 f64.mul @@ -502,13 +1888,10 @@ local.tee $6 i32.const 3 i32.shl - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 + local.set $3 local.get $0 i32.load offset=8 - i32.const 8 - i32.add local.tee $2 local.get $0 i32.load offset=16 @@ -516,10 +1899,8 @@ i32.shl i32.add local.set $7 - local.get $5 - i32.const 8 - i32.add - local.set $3 + local.get $3 + local.set $4 loop $continue|0 local.get $2 local.get $7 @@ -531,33 +1912,30 @@ i32.and i32.eqz if - local.get $3 + local.get $4 local.get $2 i32.load8_s i32.store8 - local.get $3 + local.get $4 local.get $2 i32.load8_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash8 local.get $1 i32.and i32.const 2 i32.shl - local.get $4 + local.get $5 i32.add local.tee $8 - i32.load offset=8 + i32.load i32.store offset=4 local.get $8 - local.get $3 - i32.store offset=8 - local.get $3 + local.get $4 + i32.store + local.get $4 i32.const 8 i32.add - local.set $3 + local.set $4 end local.get $2 i32.const 8 @@ -567,13 +1945,37 @@ end end local.get $0 - local.get $4 + i32.load + local.tee $2 + local.get $5 + i32.ne + if + local.get $5 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release + end + local.get $0 + local.get $5 i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $5 + i32.load offset=8 + local.tee $1 + local.get $3 + i32.ne + if + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 + local.get $3 i32.store offset=8 local.get $0 local.get $6 @@ -582,25 +1984,24 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $5 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release ) - (func $~lib/set/Set#add (; 10 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#add (; 33 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) + local.get $0 + local.get $1 local.get $1 i32.const 24 i32.shl i32.const 24 i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.tee $2 - local.set $3 - local.get $0 - local.get $1 - local.get $2 + call $~lib/util/hash/hash8 + local.tee $3 call $~lib/set/Set#find i32.eqz if @@ -643,12 +2044,10 @@ i32.const 1 i32.add i32.store offset=16 - local.get $2 - i32.const 8 - i32.add local.get $4 i32.const 3 i32.shl + local.get $2 i32.add local.tee $2 local.get $1 @@ -670,14 +2069,14 @@ i32.shl i32.add local.tee $0 - i32.load offset=8 + i32.load i32.store offset=4 local.get $0 local.get $2 - i32.store offset=8 + i32.store end ) - (func $~lib/set/Set#delete (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#delete (; 34 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 local.get $1 @@ -686,10 +2085,7 @@ i32.shl i32.const 24 i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash8 call $~lib/set/Set#find local.tee $1 i32.eqz @@ -724,8 +2120,7 @@ i32.gt_u select i32.ge_u - local.tee $1 - if + if (result i32) local.get $0 i32.load offset=20 local.get $0 @@ -735,16 +2130,16 @@ f64.mul i32.trunc_f64_s i32.lt_s - local.set $1 + else + i32.const 0 end - local.get $1 if local.get $0 local.get $2 call $~lib/set/Set#rehash end ) - (func $std/set/test (; 12 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 35 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) call $~lib/set/Set#constructor @@ -759,10 +2154,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 8 + i32.const 376 + i32.const 6 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -779,10 +2174,10 @@ br $repeat|0 else i32.const 0 - i32.const 120 - i32.const 10 + i32.const 376 + i32.const 8 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end unreachable @@ -794,10 +2189,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 12 + i32.const 376 + i32.const 10 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 50 @@ -813,10 +2208,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 16 + i32.const 376 + i32.const 14 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -833,10 +2228,10 @@ br $repeat|1 else i32.const 0 - i32.const 120 - i32.const 18 + i32.const 376 + i32.const 16 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end unreachable @@ -848,10 +2243,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 20 + i32.const 376 + i32.const 18 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -867,10 +2262,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 24 + i32.const 376 + i32.const 22 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -881,10 +2276,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 26 + i32.const 376 + i32.const 24 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -902,10 +2297,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 28 + i32.const 376 + i32.const 26 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -920,10 +2315,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 32 + i32.const 376 + i32.const 30 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -935,10 +2330,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 34 + i32.const 376 + i32.const 32 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -949,10 +2344,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 36 + i32.const 376 + i32.const 34 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -970,10 +2365,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 38 + i32.const 376 + i32.const 36 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -982,28 +2377,55 @@ i32.load offset=20 if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + ) + (func $~lib/set/Set#constructor (; 36 ;) (type $FUNCSIG$i) (result i32) + (local $0 i32) + i32.const 24 + i32.const 4 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 + call $~lib/set/Set#clear + local.get $0 ) - (func $~lib/set/Set#has (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#has (; 37 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 i32.const 255 i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash8 call $~lib/set/Set#find i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 14 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 38 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1014,13 +2436,12 @@ local.get $1 i32.const 1 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.shl - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 - local.get $2 + local.set $5 + local.get $3 f64.convert_i32_s f64.const 2.6666666666666665 f64.mul @@ -1028,13 +2449,10 @@ local.tee $6 i32.const 3 i32.shl - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 + local.set $3 local.get $0 i32.load offset=8 - i32.const 8 - i32.add local.tee $2 local.get $0 i32.load offset=16 @@ -1042,10 +2460,8 @@ i32.shl i32.add local.set $7 - local.get $5 - i32.const 8 - i32.add - local.set $3 + local.get $3 + local.set $4 loop $continue|0 local.get $2 local.get $7 @@ -1057,33 +2473,30 @@ i32.and i32.eqz if - local.get $3 + local.get $4 local.get $2 i32.load8_u i32.store8 - local.get $3 + local.get $4 local.get $2 i32.load8_u - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash8 local.get $1 i32.and i32.const 2 i32.shl - local.get $4 + local.get $5 i32.add local.tee $8 - i32.load offset=8 + i32.load i32.store offset=4 local.get $8 - local.get $3 - i32.store offset=8 - local.get $3 + local.get $4 + i32.store + local.get $4 i32.const 8 i32.add - local.set $3 + local.set $4 end local.get $2 i32.const 8 @@ -1093,13 +2506,37 @@ end end local.get $0 - local.get $4 + i32.load + local.tee $2 + local.get $5 + i32.ne + if + local.get $5 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release + end + local.get $0 + local.get $5 i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $5 + i32.load offset=8 + local.tee $1 + local.get $3 + i32.ne + if + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 + local.get $3 i32.store offset=8 local.get $0 local.get $6 @@ -1108,23 +2545,22 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $5 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release ) - (func $~lib/set/Set#add (; 15 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#add (; 39 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) + local.get $0 + local.get $1 local.get $1 i32.const 255 i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.tee $2 - local.set $3 - local.get $0 - local.get $1 - local.get $2 + call $~lib/util/hash/hash8 + local.tee $3 call $~lib/set/Set#find i32.eqz if @@ -1167,12 +2603,10 @@ i32.const 1 i32.add i32.store offset=16 - local.get $2 - i32.const 8 - i32.add local.get $4 i32.const 3 i32.shl + local.get $2 i32.add local.tee $2 local.get $1 @@ -1194,24 +2628,21 @@ i32.shl i32.add local.tee $0 - i32.load offset=8 + i32.load i32.store offset=4 local.get $0 local.get $2 - i32.store offset=8 + i32.store end ) - (func $~lib/set/Set#delete (; 16 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#delete (; 40 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 local.get $1 local.get $1 i32.const 255 i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash8 call $~lib/set/Set#find local.tee $1 i32.eqz @@ -1246,8 +2677,7 @@ i32.gt_u select i32.ge_u - local.tee $1 - if + if (result i32) local.get $0 i32.load offset=20 local.get $0 @@ -1257,19 +2687,19 @@ f64.mul i32.trunc_f64_s i32.lt_s - local.set $1 + else + i32.const 0 end - local.get $1 if local.get $0 local.get $2 call $~lib/set/Set#rehash end ) - (func $std/set/test (; 17 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 41 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) - call $~lib/set/Set#constructor + call $~lib/set/Set#constructor local.set $1 loop $repeat|0 local.get $0 @@ -1281,10 +2711,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 8 + i32.const 376 + i32.const 6 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -1301,10 +2731,10 @@ br $repeat|0 else i32.const 0 - i32.const 120 - i32.const 10 + i32.const 376 + i32.const 8 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end unreachable @@ -1316,10 +2746,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 12 + i32.const 376 + i32.const 10 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 50 @@ -1335,10 +2765,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 16 + i32.const 376 + i32.const 14 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -1355,10 +2785,10 @@ br $repeat|1 else i32.const 0 - i32.const 120 - i32.const 18 + i32.const 376 + i32.const 16 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end unreachable @@ -1370,10 +2800,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 20 + i32.const 376 + i32.const 18 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -1389,10 +2819,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 24 + i32.const 376 + i32.const 22 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -1403,10 +2833,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 26 + i32.const 376 + i32.const 24 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -1424,10 +2854,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 28 + i32.const 376 + i32.const 26 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -1442,10 +2872,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 32 + i32.const 376 + i32.const 30 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -1457,10 +2887,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 34 + i32.const 376 + i32.const 32 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -1471,10 +2901,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 36 + i32.const 376 + i32.const 34 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -1492,10 +2922,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 38 + i32.const 376 + i32.const 36 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -1504,14 +2934,59 @@ i32.load offset=20 if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + ) + (func $~lib/set/Set#constructor (; 42 ;) (type $FUNCSIG$i) (result i32) + (local $0 i32) + i32.const 24 + i32.const 5 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 + call $~lib/set/Set#clear + local.get $0 + ) + (func $~lib/util/hash/hash16 (; 43 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 255 + i32.and + i32.const -2128831035 + i32.xor + i32.const 16777619 + i32.mul + local.get $0 + i32.const 8 + i32.shr_u + i32.xor + i32.const 16777619 + i32.mul ) - (func $~lib/set/Set#find (; 18 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 44 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.load local.get $0 @@ -1521,42 +2996,40 @@ i32.const 2 i32.shl i32.add - i32.load offset=8 - local.set $2 + i32.load + local.set $0 loop $continue|0 - local.get $2 + local.get $0 if - local.get $2 + local.get $0 i32.load offset=4 i32.const 1 i32.and - i32.eqz - local.tee $0 - if - local.get $2 + if (result i32) + i32.const 0 + else + local.get $0 i32.load16_u local.get $1 i32.const 65535 i32.and i32.eq - local.set $0 end - local.get $0 if - local.get $2 + local.get $0 return end - local.get $2 + local.get $0 i32.load offset=4 i32.const -2 i32.and - local.set $2 + local.set $0 br $continue|0 end end i32.const 0 ) - (func $~lib/set/Set#has (; 19 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#has (; 45 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 @@ -1564,24 +3037,12 @@ i32.shl i32.const 16 i32.shr_s - local.tee $0 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $0 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash16 call $~lib/set/Set#find i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 20 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 46 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1592,41 +3053,35 @@ local.get $1 i32.const 1 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.shl - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $5 - local.get $2 + local.get $3 f64.convert_i32_s f64.const 2.6666666666666665 f64.mul i32.trunc_f64_s - local.tee $7 + local.tee $6 i32.const 3 i32.shl - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $6 + local.set $3 local.get $0 i32.load offset=8 - i32.const 8 - i32.add local.tee $2 local.get $0 i32.load offset=16 i32.const 3 i32.shl i32.add - local.set $8 - local.get $6 - i32.const 8 - i32.add - local.set $3 + local.set $7 + local.get $3 + local.set $4 loop $continue|0 local.get $2 - local.get $8 + local.get $7 i32.ne if local.get $2 @@ -1635,42 +3090,30 @@ i32.and i32.eqz if - local.get $3 + local.get $4 local.get $2 i32.load16_s i32.store16 - local.get $3 + local.get $4 local.get $2 i32.load16_s - local.tee $4 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $4 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash16 local.get $1 i32.and i32.const 2 i32.shl local.get $5 i32.add - local.tee $4 - i32.load offset=8 + local.tee $8 + i32.load i32.store offset=4 + local.get $8 + local.get $4 + i32.store local.get $4 - local.get $3 - i32.store offset=8 - local.get $3 i32.const 8 i32.add - local.set $3 + local.set $4 end local.get $2 i32.const 8 @@ -1680,49 +3123,63 @@ end end local.get $0 + i32.load + local.tee $2 + local.get $5 + i32.ne + if + local.get $5 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release + end + local.get $0 local.get $5 i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $6 + i32.load offset=8 + local.tee $1 + local.get $3 + i32.ne + if + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 + local.get $3 i32.store offset=8 local.get $0 - local.get $7 + local.get $6 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 + local.get $5 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release ) - (func $~lib/set/Set#add (; 21 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#add (; 47 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) + local.get $0 + local.get $1 local.get $1 i32.const 16 i32.shl i32.const 16 i32.shr_s - local.tee $2 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $2 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - local.tee $2 - local.set $3 - local.get $0 - local.get $1 - local.get $2 + call $~lib/util/hash/hash16 + local.tee $3 call $~lib/set/Set#find i32.eqz if @@ -1765,12 +3222,10 @@ i32.const 1 i32.add i32.store offset=16 - local.get $2 - i32.const 8 - i32.add local.get $4 i32.const 3 i32.shl + local.get $2 i32.add local.tee $2 local.get $1 @@ -1792,14 +3247,14 @@ i32.shl i32.add local.tee $0 - i32.load offset=8 + i32.load i32.store offset=4 local.get $0 local.get $2 - i32.store offset=8 + i32.store end ) - (func $~lib/set/Set#delete (; 22 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#delete (; 48 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 local.get $1 @@ -1808,19 +3263,7 @@ i32.shl i32.const 16 i32.shr_s - local.tee $1 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $1 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash16 call $~lib/set/Set#find local.tee $1 i32.eqz @@ -1855,8 +3298,7 @@ i32.gt_u select i32.ge_u - local.tee $1 - if + if (result i32) local.get $0 i32.load offset=20 local.get $0 @@ -1866,19 +3308,19 @@ f64.mul i32.trunc_f64_s i32.lt_s - local.set $1 + else + i32.const 0 end - local.get $1 if local.get $0 local.get $2 call $~lib/set/Set#rehash end ) - (func $std/set/test (; 23 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 49 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) - call $~lib/set/Set#constructor + call $~lib/set/Set#constructor local.set $1 loop $repeat|0 local.get $0 @@ -1890,10 +3332,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 8 + i32.const 376 + i32.const 6 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -1910,10 +3352,10 @@ br $repeat|0 else i32.const 0 - i32.const 120 - i32.const 10 + i32.const 376 + i32.const 8 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end unreachable @@ -1925,10 +3367,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 12 + i32.const 376 + i32.const 10 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 50 @@ -1944,10 +3386,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 16 + i32.const 376 + i32.const 14 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -1964,10 +3406,10 @@ br $repeat|1 else i32.const 0 - i32.const 120 - i32.const 18 + i32.const 376 + i32.const 16 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end unreachable @@ -1979,10 +3421,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 20 + i32.const 376 + i32.const 18 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -1998,10 +3440,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 24 + i32.const 376 + i32.const 22 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -2012,10 +3454,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 26 + i32.const 376 + i32.const 24 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -2033,10 +3475,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 28 + i32.const 376 + i32.const 26 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -2051,10 +3493,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 32 + i32.const 376 + i32.const 30 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -2066,10 +3508,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 34 + i32.const 376 + i32.const 32 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -2080,10 +3522,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 36 + i32.const 376 + i32.const 34 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -2101,10 +3543,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 38 + i32.const 376 + i32.const 36 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -2113,37 +3555,55 @@ i32.load offset=20 if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + ) + (func $~lib/set/Set#constructor (; 50 ;) (type $FUNCSIG$i) (result i32) + (local $0 i32) + i32.const 24 + i32.const 6 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 + call $~lib/set/Set#clear + local.get $0 ) - (func $~lib/set/Set#has (; 24 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#has (; 51 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 i32.const 65535 i32.and - local.tee $0 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $0 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash16 call $~lib/set/Set#find i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 25 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 52 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2154,41 +3614,35 @@ local.get $1 i32.const 1 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.shl - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $5 - local.get $2 + local.get $3 f64.convert_i32_s f64.const 2.6666666666666665 f64.mul i32.trunc_f64_s - local.tee $7 + local.tee $6 i32.const 3 i32.shl - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $6 + local.set $3 local.get $0 i32.load offset=8 - i32.const 8 - i32.add local.tee $2 local.get $0 i32.load offset=16 i32.const 3 i32.shl i32.add - local.set $8 - local.get $6 - i32.const 8 - i32.add - local.set $3 + local.set $7 + local.get $3 + local.set $4 loop $continue|0 local.get $2 - local.get $8 + local.get $7 i32.ne if local.get $2 @@ -2197,42 +3651,30 @@ i32.and i32.eqz if - local.get $3 + local.get $4 local.get $2 i32.load16_u i32.store16 - local.get $3 + local.get $4 local.get $2 i32.load16_u - local.tee $4 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $4 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash16 local.get $1 i32.and i32.const 2 i32.shl local.get $5 i32.add - local.tee $4 - i32.load offset=8 + local.tee $8 + i32.load i32.store offset=4 + local.get $8 + local.get $4 + i32.store local.get $4 - local.get $3 - i32.store offset=8 - local.get $3 i32.const 8 i32.add - local.set $3 + local.set $4 end local.get $2 i32.const 8 @@ -2242,47 +3684,61 @@ end end local.get $0 + i32.load + local.tee $2 + local.get $5 + i32.ne + if + local.get $5 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release + end + local.get $0 local.get $5 i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $6 + i32.load offset=8 + local.tee $1 + local.get $3 + i32.ne + if + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 + local.get $3 i32.store offset=8 local.get $0 - local.get $7 + local.get $6 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 - i32.store offset=16 - ) - (func $~lib/set/Set#add (; 26 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - local.get $1 - i32.const 65535 - i32.and - local.tee $2 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $2 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - local.tee $2 - local.set $3 + i32.store offset=16 + local.get $5 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + ) + (func $~lib/set/Set#add (; 53 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) local.get $0 local.get $1 - local.get $2 + local.get $1 + i32.const 65535 + i32.and + call $~lib/util/hash/hash16 + local.tee $3 call $~lib/set/Set#find i32.eqz if @@ -2325,12 +3781,10 @@ i32.const 1 i32.add i32.store offset=16 - local.get $2 - i32.const 8 - i32.add local.get $4 i32.const 3 i32.shl + local.get $2 i32.add local.tee $2 local.get $1 @@ -2352,33 +3806,21 @@ i32.shl i32.add local.tee $0 - i32.load offset=8 + i32.load i32.store offset=4 local.get $0 local.get $2 - i32.store offset=8 + i32.store end ) - (func $~lib/set/Set#delete (; 27 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#delete (; 54 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 local.get $1 local.get $1 i32.const 65535 i32.and - local.tee $1 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $1 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash16 call $~lib/set/Set#find local.tee $1 i32.eqz @@ -2413,8 +3855,7 @@ i32.gt_u select i32.ge_u - local.tee $1 - if + if (result i32) local.get $0 i32.load offset=20 local.get $0 @@ -2424,19 +3865,19 @@ f64.mul i32.trunc_f64_s i32.lt_s - local.set $1 + else + i32.const 0 end - local.get $1 if local.get $0 local.get $2 call $~lib/set/Set#rehash end ) - (func $std/set/test (; 28 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 55 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) - call $~lib/set/Set#constructor + call $~lib/set/Set#constructor local.set $1 loop $repeat|0 local.get $0 @@ -2448,10 +3889,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 8 + i32.const 376 + i32.const 6 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -2468,10 +3909,10 @@ br $repeat|0 else i32.const 0 - i32.const 120 - i32.const 10 + i32.const 376 + i32.const 8 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end unreachable @@ -2483,10 +3924,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 12 + i32.const 376 + i32.const 10 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 50 @@ -2502,10 +3943,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 16 + i32.const 376 + i32.const 14 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -2522,10 +3963,10 @@ br $repeat|1 else i32.const 0 - i32.const 120 - i32.const 18 + i32.const 376 + i32.const 16 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end unreachable @@ -2537,10 +3978,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 20 + i32.const 376 + i32.const 18 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -2556,10 +3997,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 24 + i32.const 376 + i32.const 22 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -2570,10 +4011,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 26 + i32.const 376 + i32.const 24 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -2591,10 +4032,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 28 + i32.const 376 + i32.const 26 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -2609,10 +4050,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 32 + i32.const 376 + i32.const 30 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -2624,10 +4065,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 34 + i32.const 376 + i32.const 32 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -2638,10 +4079,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 36 + i32.const 376 + i32.const 34 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -2659,10 +4100,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 38 + i32.const 376 + i32.const 36 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -2671,14 +4112,44 @@ i32.load offset=20 if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + ) + (func $~lib/set/Set#constructor (; 56 ;) (type $FUNCSIG$i) (result i32) + (local $0 i32) + i32.const 24 + i32.const 7 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 + call $~lib/set/Set#clear + local.get $0 ) - (func $~lib/internal/hash/hash32 (; 29 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/hash32 (; 57 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 255 i32.and @@ -2709,7 +4180,7 @@ i32.const 16777619 i32.mul ) - (func $~lib/set/Set#find (; 30 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 58 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.load local.get $0 @@ -2719,49 +4190,47 @@ i32.const 2 i32.shl i32.add - i32.load offset=8 - local.set $2 + i32.load + local.set $0 loop $continue|0 - local.get $2 + local.get $0 if - local.get $2 + local.get $0 i32.load offset=4 i32.const 1 i32.and - i32.eqz - local.tee $0 - if - local.get $2 + if (result i32) + i32.const 0 + else + local.get $0 i32.load local.get $1 i32.eq - local.set $0 end - local.get $0 if - local.get $2 + local.get $0 return end - local.get $2 + local.get $0 i32.load offset=4 i32.const -2 i32.and - local.set $2 + local.set $0 br $continue|0 end end i32.const 0 ) - (func $~lib/set/Set#has (; 31 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#has (; 59 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 - call $~lib/internal/hash/hash32 + call $~lib/util/hash/hash32 call $~lib/set/Set#find i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 32 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 60 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2772,13 +4241,12 @@ local.get $1 i32.const 1 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.shl - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 - local.get $2 + local.set $5 + local.get $3 f64.convert_i32_s f64.const 2.6666666666666665 f64.mul @@ -2786,13 +4254,10 @@ local.tee $6 i32.const 3 i32.shl - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 + local.set $3 local.get $0 i32.load offset=8 - i32.const 8 - i32.add local.tee $2 local.get $0 i32.load offset=16 @@ -2800,10 +4265,8 @@ i32.shl i32.add local.set $7 - local.get $5 - i32.const 8 - i32.add - local.set $3 + local.get $3 + local.set $4 loop $continue|0 local.get $2 local.get $7 @@ -2815,30 +4278,30 @@ i32.and i32.eqz if - local.get $3 + local.get $4 local.get $2 i32.load i32.store - local.get $3 + local.get $4 local.get $2 i32.load - call $~lib/internal/hash/hash32 + call $~lib/util/hash/hash32 local.get $1 i32.and i32.const 2 i32.shl - local.get $4 + local.get $5 i32.add local.tee $8 - i32.load offset=8 + i32.load i32.store offset=4 local.get $8 - local.get $3 - i32.store offset=8 - local.get $3 + local.get $4 + i32.store + local.get $4 i32.const 8 i32.add - local.set $3 + local.set $4 end local.get $2 i32.const 8 @@ -2848,13 +4311,37 @@ end end local.get $0 - local.get $4 + i32.load + local.tee $2 + local.get $5 + i32.ne + if + local.get $5 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release + end + local.get $0 + local.get $5 i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $5 + i32.load offset=8 + local.tee $1 + local.get $3 + i32.ne + if + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 + local.get $3 i32.store offset=8 local.get $0 local.get $6 @@ -2863,18 +4350,20 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $5 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release ) - (func $~lib/set/Set#add (; 33 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#add (; 61 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - local.get $1 - call $~lib/internal/hash/hash32 - local.tee $2 - local.set $3 local.get $0 local.get $1 - local.get $2 + local.get $1 + call $~lib/util/hash/hash32 + local.tee $3 call $~lib/set/Set#find i32.eqz if @@ -2917,12 +4406,10 @@ i32.const 1 i32.add i32.store offset=16 - local.get $2 - i32.const 8 - i32.add local.get $4 i32.const 3 i32.shl + local.get $2 i32.add local.tee $2 local.get $1 @@ -2944,19 +4431,19 @@ i32.shl i32.add local.tee $0 - i32.load offset=8 + i32.load i32.store offset=4 local.get $0 local.get $2 - i32.store offset=8 + i32.store end ) - (func $~lib/set/Set#delete (; 34 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#delete (; 62 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 local.get $1 local.get $1 - call $~lib/internal/hash/hash32 + call $~lib/util/hash/hash32 call $~lib/set/Set#find local.tee $1 i32.eqz @@ -2991,7 +4478,6 @@ i32.gt_u select i32.ge_u - local.tee $1 if (result i32) local.get $0 i32.load offset=20 @@ -3003,7 +4489,7 @@ i32.trunc_f64_s i32.lt_s else - local.get $1 + i32.const 0 end if local.get $0 @@ -3011,10 +4497,10 @@ call $~lib/set/Set#rehash end ) - (func $std/set/test (; 35 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 63 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) - call $~lib/set/Set#constructor + call $~lib/set/Set#constructor local.set $1 loop $repeat|0 local.get $0 @@ -3026,10 +4512,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 8 + i32.const 376 + i32.const 6 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -3046,10 +4532,10 @@ br $repeat|0 else i32.const 0 - i32.const 120 - i32.const 10 + i32.const 376 + i32.const 8 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end unreachable @@ -3061,10 +4547,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 12 + i32.const 376 + i32.const 10 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 50 @@ -3080,10 +4566,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 16 + i32.const 376 + i32.const 14 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -3100,10 +4586,10 @@ br $repeat|1 else i32.const 0 - i32.const 120 - i32.const 18 + i32.const 376 + i32.const 16 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end unreachable @@ -3115,10 +4601,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 20 + i32.const 376 + i32.const 18 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -3134,10 +4620,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 24 + i32.const 376 + i32.const 22 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -3148,10 +4634,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 26 + i32.const 376 + i32.const 24 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -3169,10 +4655,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 28 + i32.const 376 + i32.const 26 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -3187,10 +4673,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 32 + i32.const 376 + i32.const 30 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -3202,10 +4688,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 34 + i32.const 376 + i32.const 32 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -3216,10 +4702,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 36 + i32.const 376 + i32.const 34 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -3237,10 +4723,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 38 + i32.const 376 + i32.const 36 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -3249,17 +4735,47 @@ i32.load offset=20 if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + ) + (func $~lib/set/Set#constructor (; 64 ;) (type $FUNCSIG$i) (result i32) + (local $0 i32) + i32.const 24 + i32.const 8 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 + call $~lib/set/Set#clear + local.get $0 ) - (func $std/set/test (; 36 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 65 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) - call $~lib/set/Set#constructor + call $~lib/set/Set#constructor local.set $1 loop $repeat|0 local.get $0 @@ -3271,10 +4787,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 8 + i32.const 376 + i32.const 6 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -3291,10 +4807,10 @@ br $repeat|0 else i32.const 0 - i32.const 120 - i32.const 10 + i32.const 376 + i32.const 8 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end unreachable @@ -3306,10 +4822,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 12 + i32.const 376 + i32.const 10 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 50 @@ -3325,10 +4841,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 16 + i32.const 376 + i32.const 14 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -3345,10 +4861,10 @@ br $repeat|1 else i32.const 0 - i32.const 120 - i32.const 18 + i32.const 376 + i32.const 16 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end unreachable @@ -3360,10 +4876,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 20 + i32.const 376 + i32.const 18 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -3379,10 +4895,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 24 + i32.const 376 + i32.const 22 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -3393,10 +4909,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 26 + i32.const 376 + i32.const 24 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -3414,10 +4930,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 28 + i32.const 376 + i32.const 26 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -3432,10 +4948,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 32 + i32.const 376 + i32.const 30 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -3447,10 +4963,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 34 + i32.const 376 + i32.const 32 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -3461,10 +4977,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 36 + i32.const 376 + i32.const 34 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -3482,10 +4998,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 38 + i32.const 376 + i32.const 36 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -3494,26 +5010,37 @@ i32.load offset=20 if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release ) - (func $~lib/set/Set#clear (; 37 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 + (func $~lib/set/Set#clear (; 66 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) i32.const 16 - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 + local.get $0 + i32.load + call $~lib/rt/pure/__release + local.get $0 + local.get $1 i32.store local.get $0 i32.const 3 i32.store offset=4 - local.get $0 i32.const 64 - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 + local.get $0 + i32.load offset=8 + call $~lib/rt/pure/__release + local.get $0 + local.get $1 i32.store offset=8 local.get $0 i32.const 4 @@ -3525,10 +5052,12 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 38 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/set/Set#constructor (; 67 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 - call $~lib/allocator/arena/__memory_allocate + i32.const 9 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.store @@ -3551,7 +5080,7 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/internal/hash/hash64 (; 39 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/hash/hash64 (; 68 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) local.get $0 i32.wrap_i64 @@ -3617,7 +5146,7 @@ i32.const 16777619 i32.mul ) - (func $~lib/set/Set#find (; 40 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 69 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) local.get $0 i32.load local.get $0 @@ -3627,49 +5156,47 @@ i32.const 2 i32.shl i32.add - i32.load offset=8 - local.set $2 + i32.load + local.set $0 loop $continue|0 - local.get $2 + local.get $0 if - local.get $2 + local.get $0 i32.load offset=8 i32.const 1 i32.and - i32.eqz - local.tee $0 - if - local.get $2 + if (result i32) + i32.const 0 + else + local.get $0 i64.load local.get $1 i64.eq - local.set $0 end - local.get $0 if - local.get $2 + local.get $0 return end - local.get $2 + local.get $0 i32.load offset=8 i32.const -2 i32.and - local.set $2 + local.set $0 br $continue|0 end end i32.const 0 ) - (func $~lib/set/Set#has (; 41 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/set/Set#has (; 70 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) local.get $0 local.get $1 local.get $1 - call $~lib/internal/hash/hash64 + call $~lib/util/hash/hash64 call $~lib/set/Set#find i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 42 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 71 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3680,13 +5207,12 @@ local.get $1 i32.const 1 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.shl - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 - local.get $2 + local.set $5 + local.get $3 f64.convert_i32_s f64.const 2.6666666666666665 f64.mul @@ -3694,13 +5220,10 @@ local.tee $6 i32.const 4 i32.shl - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 + local.set $3 local.get $0 i32.load offset=8 - i32.const 8 - i32.add local.tee $2 local.get $0 i32.load offset=16 @@ -3708,10 +5231,8 @@ i32.shl i32.add local.set $7 - local.get $5 - i32.const 8 - i32.add - local.set $3 + local.get $3 + local.set $4 loop $continue|0 local.get $2 local.get $7 @@ -3723,30 +5244,30 @@ i32.and i32.eqz if - local.get $3 + local.get $4 local.get $2 i64.load i64.store - local.get $3 + local.get $4 local.get $2 i64.load - call $~lib/internal/hash/hash64 + call $~lib/util/hash/hash64 local.get $1 i32.and i32.const 2 i32.shl - local.get $4 + local.get $5 i32.add local.tee $8 - i32.load offset=8 + i32.load i32.store offset=8 local.get $8 - local.get $3 - i32.store offset=8 - local.get $3 + local.get $4 + i32.store + local.get $4 i32.const 16 i32.add - local.set $3 + local.set $4 end local.get $2 i32.const 16 @@ -3756,13 +5277,37 @@ end end local.get $0 - local.get $4 + i32.load + local.tee $2 + local.get $5 + i32.ne + if + local.get $5 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release + end + local.get $0 + local.get $5 i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $5 + i32.load offset=8 + local.tee $1 + local.get $3 + i32.ne + if + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 + local.get $3 i32.store offset=8 local.get $0 local.get $6 @@ -3771,18 +5316,20 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $5 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release ) - (func $~lib/set/Set#add (; 43 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64) + (func $~lib/set/Set#add (; 72 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64) (local $2 i32) (local $3 i32) (local $4 i32) - local.get $1 - call $~lib/internal/hash/hash64 - local.tee $2 - local.set $3 local.get $0 local.get $1 - local.get $2 + local.get $1 + call $~lib/util/hash/hash64 + local.tee $3 call $~lib/set/Set#find i32.eqz if @@ -3825,12 +5372,10 @@ i32.const 1 i32.add i32.store offset=16 - local.get $2 - i32.const 8 - i32.add local.get $4 i32.const 4 i32.shl + local.get $2 i32.add local.tee $2 local.get $1 @@ -3852,20 +5397,20 @@ i32.shl i32.add local.tee $0 - i32.load offset=8 + i32.load i32.store offset=8 local.get $0 local.get $2 - i32.store offset=8 + i32.store end ) - (func $~lib/set/Set#delete (; 44 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64) + (func $~lib/set/Set#delete (; 73 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64) (local $2 i32) (local $3 i32) local.get $0 local.get $1 local.get $1 - call $~lib/internal/hash/hash64 + call $~lib/util/hash/hash64 call $~lib/set/Set#find local.tee $2 i32.eqz @@ -3900,7 +5445,6 @@ i32.gt_u select i32.ge_u - local.tee $2 if (result i32) local.get $0 i32.load offset=20 @@ -3912,7 +5456,7 @@ i32.trunc_f64_s i32.lt_s else - local.get $2 + i32.const 0 end if local.get $0 @@ -3920,7 +5464,7 @@ call $~lib/set/Set#rehash end ) - (func $std/set/test (; 45 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 74 ;) (type $FUNCSIG$v) (local $0 i64) (local $1 i32) call $~lib/set/Set#constructor @@ -3935,10 +5479,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 8 + i32.const 376 + i32.const 6 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -3955,10 +5499,10 @@ br $repeat|0 else i32.const 0 - i32.const 120 - i32.const 10 + i32.const 376 + i32.const 8 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end unreachable @@ -3970,10 +5514,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 12 + i32.const 376 + i32.const 10 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 50 @@ -3989,10 +5533,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 16 + i32.const 376 + i32.const 14 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -4009,10 +5553,10 @@ br $repeat|1 else i32.const 0 - i32.const 120 - i32.const 18 + i32.const 376 + i32.const 16 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end unreachable @@ -4024,10 +5568,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 20 + i32.const 376 + i32.const 18 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 0 @@ -4043,10 +5587,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 24 + i32.const 376 + i32.const 22 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -4057,10 +5601,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 26 + i32.const 376 + i32.const 24 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -4078,10 +5622,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 28 + i32.const 376 + i32.const 26 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 0 @@ -4096,10 +5640,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 32 + i32.const 376 + i32.const 30 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -4111,10 +5655,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 34 + i32.const 376 + i32.const 32 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -4125,10 +5669,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 36 + i32.const 376 + i32.const 34 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -4146,10 +5690,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 38 + i32.const 376 + i32.const 36 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -4158,17 +5702,47 @@ i32.load offset=20 if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + ) + (func $~lib/set/Set#constructor (; 75 ;) (type $FUNCSIG$i) (result i32) + (local $0 i32) + i32.const 24 + i32.const 10 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 + call $~lib/set/Set#clear + local.get $0 ) - (func $std/set/test (; 46 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 76 ;) (type $FUNCSIG$v) (local $0 i64) (local $1 i32) - call $~lib/set/Set#constructor + call $~lib/set/Set#constructor local.set $1 loop $repeat|0 local.get $0 @@ -4180,10 +5754,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 8 + i32.const 376 + i32.const 6 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -4200,10 +5774,10 @@ br $repeat|0 else i32.const 0 - i32.const 120 - i32.const 10 + i32.const 376 + i32.const 8 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end unreachable @@ -4215,10 +5789,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 12 + i32.const 376 + i32.const 10 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 50 @@ -4234,10 +5808,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 16 + i32.const 376 + i32.const 14 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -4254,10 +5828,10 @@ br $repeat|1 else i32.const 0 - i32.const 120 - i32.const 18 + i32.const 376 + i32.const 16 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end unreachable @@ -4269,10 +5843,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 20 + i32.const 376 + i32.const 18 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 0 @@ -4288,10 +5862,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 24 + i32.const 376 + i32.const 22 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -4302,10 +5876,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 26 + i32.const 376 + i32.const 24 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -4323,10 +5897,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 28 + i32.const 376 + i32.const 26 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 0 @@ -4341,10 +5915,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 32 + i32.const 376 + i32.const 30 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -4356,10 +5930,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 34 + i32.const 376 + i32.const 32 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -4370,10 +5944,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 36 + i32.const 376 + i32.const 34 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -4391,10 +5965,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 38 + i32.const 376 + i32.const 36 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -4403,19 +5977,44 @@ i32.load offset=20 if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release ) - (func $~lib/internal/hash/HASH (; 47 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) + (func $~lib/set/Set#constructor (; 77 ;) (type $FUNCSIG$i) (result i32) + (local $0 i32) + i32.const 24 + i32.const 11 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 + call $~lib/set/Set#clear local.get $0 - i32.reinterpret_f32 - call $~lib/internal/hash/hash32 ) - (func $~lib/set/Set#find (; 48 ;) (type $FUNCSIG$iifi) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 78 ;) (type $FUNCSIG$iifi) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) local.get $0 i32.load local.get $0 @@ -4425,49 +6024,48 @@ i32.const 2 i32.shl i32.add - i32.load offset=8 - local.set $2 + i32.load + local.set $0 loop $continue|0 - local.get $2 + local.get $0 if - local.get $2 + local.get $0 i32.load offset=4 i32.const 1 i32.and - i32.eqz - local.tee $0 - if - local.get $2 + if (result i32) + i32.const 0 + else + local.get $0 f32.load local.get $1 f32.eq - local.set $0 end - local.get $0 if - local.get $2 + local.get $0 return end - local.get $2 + local.get $0 i32.load offset=4 i32.const -2 i32.and - local.set $2 + local.set $0 br $continue|0 end end i32.const 0 ) - (func $~lib/set/Set#has (; 49 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) + (func $~lib/set/Set#has (; 79 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) local.get $0 local.get $1 local.get $1 - call $~lib/internal/hash/HASH + i32.reinterpret_f32 + call $~lib/util/hash/hash32 call $~lib/set/Set#find i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 50 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 80 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -4478,13 +6076,12 @@ local.get $1 i32.const 1 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.shl - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 - local.get $2 + local.set $5 + local.get $3 f64.convert_i32_s f64.const 2.6666666666666665 f64.mul @@ -4492,13 +6089,10 @@ local.tee $6 i32.const 3 i32.shl - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 + local.set $3 local.get $0 i32.load offset=8 - i32.const 8 - i32.add local.tee $2 local.get $0 i32.load offset=16 @@ -4506,10 +6100,8 @@ i32.shl i32.add local.set $7 - local.get $5 - i32.const 8 - i32.add - local.set $3 + local.get $3 + local.set $4 loop $continue|0 local.get $2 local.get $7 @@ -4521,31 +6113,31 @@ i32.and i32.eqz if - local.get $3 + local.get $4 local.get $2 f32.load f32.store - local.get $3 + local.get $4 local.get $2 f32.load i32.reinterpret_f32 - call $~lib/internal/hash/hash32 + call $~lib/util/hash/hash32 local.get $1 i32.and i32.const 2 i32.shl - local.get $4 + local.get $5 i32.add local.tee $8 - i32.load offset=8 + i32.load i32.store offset=4 local.get $8 - local.get $3 - i32.store offset=8 - local.get $3 + local.get $4 + i32.store + local.get $4 i32.const 8 i32.add - local.set $3 + local.set $4 end local.get $2 i32.const 8 @@ -4555,13 +6147,37 @@ end end local.get $0 - local.get $4 + i32.load + local.tee $2 + local.get $5 + i32.ne + if + local.get $5 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release + end + local.get $0 + local.get $5 i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $5 + i32.load offset=8 + local.tee $1 + local.get $3 + i32.ne + if + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 + local.get $3 i32.store offset=8 local.get $0 local.get $6 @@ -4570,15 +6186,20 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $5 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release ) - (func $~lib/set/Set#add (; 51 ;) (type $FUNCSIG$vif) (param $0 i32) (param $1 f32) + (func $~lib/set/Set#add (; 81 ;) (type $FUNCSIG$vif) (param $0 i32) (param $1 f32) (local $2 i32) (local $3 i32) (local $4 i32) local.get $0 local.get $1 local.get $1 - call $~lib/internal/hash/HASH + i32.reinterpret_f32 + call $~lib/util/hash/hash32 local.tee $3 call $~lib/set/Set#find i32.eqz @@ -4622,12 +6243,10 @@ i32.const 1 i32.add i32.store offset=16 - local.get $2 - i32.const 8 - i32.add local.get $4 i32.const 3 i32.shl + local.get $2 i32.add local.tee $2 local.get $1 @@ -4649,21 +6268,21 @@ i32.shl i32.add local.tee $0 - i32.load offset=8 + i32.load i32.store offset=4 local.get $0 local.get $2 - i32.store offset=8 + i32.store end ) - (func $~lib/set/Set#delete (; 52 ;) (type $FUNCSIG$vif) (param $0 i32) (param $1 f32) + (func $~lib/set/Set#delete (; 82 ;) (type $FUNCSIG$vif) (param $0 i32) (param $1 f32) (local $2 i32) (local $3 i32) local.get $0 local.get $1 local.get $1 i32.reinterpret_f32 - call $~lib/internal/hash/hash32 + call $~lib/util/hash/hash32 call $~lib/set/Set#find local.tee $2 i32.eqz @@ -4698,7 +6317,6 @@ i32.gt_u select i32.ge_u - local.tee $2 if (result i32) local.get $0 i32.load offset=20 @@ -4710,7 +6328,7 @@ i32.trunc_f64_s i32.lt_s else - local.get $2 + i32.const 0 end if local.get $0 @@ -4718,10 +6336,10 @@ call $~lib/set/Set#rehash end ) - (func $std/set/test (; 53 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 83 ;) (type $FUNCSIG$v) (local $0 f32) (local $1 i32) - call $~lib/set/Set#constructor + call $~lib/set/Set#constructor local.set $1 loop $repeat|0 local.get $0 @@ -4733,10 +6351,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 8 + i32.const 376 + i32.const 6 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -4753,10 +6371,10 @@ br $repeat|0 else i32.const 0 - i32.const 120 - i32.const 10 + i32.const 376 + i32.const 8 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end unreachable @@ -4768,10 +6386,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 12 + i32.const 376 + i32.const 10 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 50 @@ -4787,10 +6405,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 16 + i32.const 376 + i32.const 14 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -4807,10 +6425,10 @@ br $repeat|1 else i32.const 0 - i32.const 120 - i32.const 18 + i32.const 376 + i32.const 16 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end unreachable @@ -4822,10 +6440,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 20 + i32.const 376 + i32.const 18 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -4841,10 +6459,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 24 + i32.const 376 + i32.const 22 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -4855,10 +6473,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 26 + i32.const 376 + i32.const 24 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -4876,10 +6494,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 28 + i32.const 376 + i32.const 26 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f32.const 0 @@ -4894,10 +6512,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 32 + i32.const 376 + i32.const 30 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -4909,10 +6527,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 34 + i32.const 376 + i32.const 32 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -4923,10 +6541,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 36 + i32.const 376 + i32.const 34 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -4944,10 +6562,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 38 + i32.const 376 + i32.const 36 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -4956,19 +6574,44 @@ i32.load offset=20 if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release ) - (func $~lib/internal/hash/HASH (; 54 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + (func $~lib/set/Set#constructor (; 84 ;) (type $FUNCSIG$i) (result i32) + (local $0 i32) + i32.const 24 + i32.const 12 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 + call $~lib/set/Set#clear local.get $0 - i64.reinterpret_f64 - call $~lib/internal/hash/hash64 ) - (func $~lib/set/Set#find (; 55 ;) (type $FUNCSIG$iidi) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 85 ;) (type $FUNCSIG$iidi) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) local.get $0 i32.load local.get $0 @@ -4978,49 +6621,48 @@ i32.const 2 i32.shl i32.add - i32.load offset=8 - local.set $2 + i32.load + local.set $0 loop $continue|0 - local.get $2 + local.get $0 if - local.get $2 + local.get $0 i32.load offset=8 i32.const 1 i32.and - i32.eqz - local.tee $0 - if - local.get $2 + if (result i32) + i32.const 0 + else + local.get $0 f64.load local.get $1 f64.eq - local.set $0 end - local.get $0 if - local.get $2 + local.get $0 return end - local.get $2 + local.get $0 i32.load offset=8 i32.const -2 i32.and - local.set $2 + local.set $0 br $continue|0 end end i32.const 0 ) - (func $~lib/set/Set#has (; 56 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/set/Set#has (; 86 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) local.get $0 local.get $1 local.get $1 - call $~lib/internal/hash/HASH + i64.reinterpret_f64 + call $~lib/util/hash/hash64 call $~lib/set/Set#find i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 57 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 87 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -5031,13 +6673,12 @@ local.get $1 i32.const 1 i32.add - local.tee $2 + local.tee $3 i32.const 2 i32.shl - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 - local.get $2 + local.set $5 + local.get $3 f64.convert_i32_s f64.const 2.6666666666666665 f64.mul @@ -5045,13 +6686,10 @@ local.tee $6 i32.const 4 i32.shl - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 + local.set $3 local.get $0 i32.load offset=8 - i32.const 8 - i32.add local.tee $2 local.get $0 i32.load offset=16 @@ -5059,10 +6697,8 @@ i32.shl i32.add local.set $7 - local.get $5 - i32.const 8 - i32.add - local.set $3 + local.get $3 + local.set $4 loop $continue|0 local.get $2 local.get $7 @@ -5074,31 +6710,31 @@ i32.and i32.eqz if - local.get $3 + local.get $4 local.get $2 f64.load f64.store - local.get $3 + local.get $4 local.get $2 f64.load i64.reinterpret_f64 - call $~lib/internal/hash/hash64 + call $~lib/util/hash/hash64 local.get $1 i32.and i32.const 2 i32.shl - local.get $4 + local.get $5 i32.add local.tee $8 - i32.load offset=8 + i32.load i32.store offset=8 local.get $8 - local.get $3 - i32.store offset=8 - local.get $3 + local.get $4 + i32.store + local.get $4 i32.const 16 i32.add - local.set $3 + local.set $4 end local.get $2 i32.const 16 @@ -5108,13 +6744,37 @@ end end local.get $0 - local.get $4 + i32.load + local.tee $2 + local.get $5 + i32.ne + if + local.get $5 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release + end + local.get $0 + local.get $5 i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $5 + i32.load offset=8 + local.tee $1 + local.get $3 + i32.ne + if + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + local.get $0 + local.get $3 i32.store offset=8 local.get $0 local.get $6 @@ -5123,15 +6783,20 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $5 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release ) - (func $~lib/set/Set#add (; 58 ;) (type $FUNCSIG$vid) (param $0 i32) (param $1 f64) + (func $~lib/set/Set#add (; 88 ;) (type $FUNCSIG$vid) (param $0 i32) (param $1 f64) (local $2 i32) (local $3 i32) (local $4 i32) local.get $0 local.get $1 local.get $1 - call $~lib/internal/hash/HASH + i64.reinterpret_f64 + call $~lib/util/hash/hash64 local.tee $3 call $~lib/set/Set#find i32.eqz @@ -5175,12 +6840,10 @@ i32.const 1 i32.add i32.store offset=16 - local.get $2 - i32.const 8 - i32.add local.get $4 i32.const 4 i32.shl + local.get $2 i32.add local.tee $2 local.get $1 @@ -5202,21 +6865,21 @@ i32.shl i32.add local.tee $0 - i32.load offset=8 + i32.load i32.store offset=8 local.get $0 local.get $2 - i32.store offset=8 + i32.store end ) - (func $~lib/set/Set#delete (; 59 ;) (type $FUNCSIG$vid) (param $0 i32) (param $1 f64) + (func $~lib/set/Set#delete (; 89 ;) (type $FUNCSIG$vid) (param $0 i32) (param $1 f64) (local $2 i32) (local $3 i32) local.get $0 local.get $1 local.get $1 i64.reinterpret_f64 - call $~lib/internal/hash/hash64 + call $~lib/util/hash/hash64 call $~lib/set/Set#find local.tee $2 i32.eqz @@ -5251,7 +6914,6 @@ i32.gt_u select i32.ge_u - local.tee $2 if (result i32) local.get $0 i32.load offset=20 @@ -5263,7 +6925,7 @@ i32.trunc_f64_s i32.lt_s else - local.get $2 + i32.const 0 end if local.get $0 @@ -5271,10 +6933,10 @@ call $~lib/set/Set#rehash end ) - (func $std/set/test (; 60 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 90 ;) (type $FUNCSIG$v) (local $0 f64) (local $1 i32) - call $~lib/set/Set#constructor + call $~lib/set/Set#constructor local.set $1 loop $repeat|0 local.get $0 @@ -5286,10 +6948,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 8 + i32.const 376 + i32.const 6 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -5306,10 +6968,10 @@ br $repeat|0 else i32.const 0 - i32.const 120 - i32.const 10 + i32.const 376 + i32.const 8 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end unreachable @@ -5321,10 +6983,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 12 + i32.const 376 + i32.const 10 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 50 @@ -5340,10 +7002,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 16 + i32.const 376 + i32.const 14 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -5360,10 +7022,10 @@ br $repeat|1 else i32.const 0 - i32.const 120 - i32.const 18 + i32.const 376 + i32.const 16 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end unreachable @@ -5375,10 +7037,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 20 + i32.const 376 + i32.const 18 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -5394,10 +7056,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 24 + i32.const 376 + i32.const 22 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -5408,10 +7070,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 26 + i32.const 376 + i32.const 24 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -5429,10 +7091,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 28 + i32.const 376 + i32.const 26 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 @@ -5447,10 +7109,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 32 + i32.const 376 + i32.const 30 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -5462,10 +7124,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 34 + i32.const 376 + i32.const 32 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -5476,10 +7138,10 @@ call $~lib/set/Set#has if i32.const 0 - i32.const 120 - i32.const 36 + i32.const 376 + i32.const 34 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -5497,10 +7159,10 @@ i32.ne if i32.const 0 - i32.const 120 - i32.const 38 + i32.const 376 + i32.const 36 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -5509,30 +7171,276 @@ i32.load offset=20 if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + call $~lib/rt/pure/__release + ) + (func $start (; 91 ;) (type $FUNCSIG$v) + call $std/set/testNumeric + call $std/set/testNumeric + call $std/set/testNumeric + call $std/set/testNumeric + call $std/set/testNumeric + call $std/set/testNumeric + call $std/set/testNumeric + call $std/set/testNumeric + call $std/set/testNumeric + call $std/set/testNumeric + ) + (func $~lib/rt/pure/markGray (; 92 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add i32.const 2 - call $~lib/env/abort + call $~lib/rt/__visit_members + end + ) + (func $~lib/rt/pure/scanBlack (; 93 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 94 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (; 95 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + ) + (func $~lib/rt/pure/__visit (; 96 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + local.get $0 + i32.const 508 + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $0 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + local.get $1 + i32.const 1 + i32.ne + if + local.get $1 + i32.const 2 + i32.eq + br_if $case1|0 + block $tablify|0 + local.get $1 + i32.const 3 + i32.sub + br_table $case2|0 $case3|0 $case4|0 $tablify|0 + end + br $case5|0 + end + local.get $0 + call $~lib/rt/pure/decrement + br $break|0 + end + local.get $0 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 128 + i32.const 75 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $0 + call $~lib/rt/pure/markGray + br $break|0 + end + local.get $0 + call $~lib/rt/pure/scan + br $break|0 + end + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const -268435456 + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne + if + i32.const 0 + i32.const 128 + i32.const 86 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $1 + i32.const 1879048192 + i32.and + if + local.get $0 + call $~lib/rt/pure/scanBlack + end + br $break|0 + end + local.get $0 + call $~lib/rt/pure/collectWhite + br $break|0 + end + i32.const 0 + i32.const 128 + i32.const 97 + i32.const 24 + call $~lib/builtins/abort unreachable end ) - (func $start (; 61 ;) (type $FUNCSIG$v) - i32.const 144 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - call $std/set/test - call $std/set/test - call $std/set/test - call $std/set/test - call $std/set/test - call $std/set/test - call $std/set/test - call $std/set/test - call $std/set/test - call $std/set/test + (func $~lib/rt/__visit_members (; 97 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + block $folding-inner0 + block $switch$1$default + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $folding-inner0 $folding-inner0 $folding-inner0 $folding-inner0 $folding-inner0 $folding-inner0 $folding-inner0 $folding-inner0 $folding-inner0 $folding-inner0 $switch$1$default + end + return + end + local.get $0 + i32.load + local.tee $0 + if + local.get $0 + local.get $1 + call $~lib/rt/pure/__visit + end + return + end + unreachable + end + local.get $0 + i32.load + local.get $1 + call $~lib/rt/pure/__visit + local.get $0 + i32.load offset=8 + local.get $1 + call $~lib/rt/pure/__visit ) - (func $null (; 62 ;) (type $FUNCSIG$v) + (func $null (; 98 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/set.ts b/tests/compiler/std/set.ts index 353ff8051c..76c61b97cb 100644 --- a/tests/compiler/std/set.ts +++ b/tests/compiler/std/set.ts @@ -1,6 +1,4 @@ -import "allocator/arena"; - -function test(): void { +function testNumeric(): void { var set = new Set(); // insert new @@ -42,13 +40,13 @@ function test(): void { assert(set.size == 0); } -test(); -test(); -test(); -test(); -test(); -test(); -test(); -test(); -test(); -test(); +testNumeric(); +testNumeric(); +testNumeric(); +testNumeric(); +testNumeric(); +testNumeric(); +testNumeric(); +testNumeric(); +testNumeric(); +testNumeric(); diff --git a/tests/compiler/std/set.untouched.wat b/tests/compiler/std/set.untouched.wat index 29f1bc64dd..0752b23833 100644 --- a/tests/compiler/std/set.untouched.wat +++ b/tests/compiler/std/set.untouched.wat @@ -1,473 +1,3460 @@ (module (type $FUNCSIG$v (func)) (type $FUNCSIG$ii (func (param i32) (result i32))) - (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) - (type $FUNCSIG$viii (func (param i32 i32 i32))) - (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$iij (func (param i32 i64) (result i32))) (type $FUNCSIG$ij (func (param i64) (result i32))) (type $FUNCSIG$iiji (func (param i32 i64 i32) (result i32))) (type $FUNCSIG$vij (func (param i32 i64))) (type $FUNCSIG$iif (func (param i32 f32) (result i32))) - (type $FUNCSIG$if (func (param f32) (result i32))) (type $FUNCSIG$iifi (func (param i32 f32 i32) (result i32))) (type $FUNCSIG$vif (func (param i32 f32))) (type $FUNCSIG$iid (func (param i32 f64) (result i32))) - (type $FUNCSIG$id (func (param f64) (result i32))) (type $FUNCSIG$iidi (func (param i32 f64 i32) (result i32))) (type $FUNCSIG$vid (func (param i32 f64))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32))) + (import "rtrace" "onincrement" (func $~lib/rt/rtrace/onincrement (param i32))) + (import "rtrace" "ondecrement" (func $~lib/rt/rtrace/ondecrement (param i32))) + (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) (memory $0 1) - (data (i32.const 8) "\13\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") - (data (i32.const 56) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") - (data (i32.const 120) "\n\00\00\00s\00t\00d\00/\00s\00e\00t\00.\00t\00s\00") + (data (i32.const 8) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 56) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 112) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s\00") + (data (i32.const 160) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h\00") + (data (i32.const 208) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") + (data (i32.const 264) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 320) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s\00") + (data (i32.const 360) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00s\00t\00d\00/\00s\00e\00t\00.\00t\00s\00") + (data (i32.const 400) "\0d\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\004\04\00\00\00\00\00\004\00\00\00\00\00\00\00T\04\00\00\00\00\00\00T\00\00\00\00\00\00\00\94\04\00\00\00\00\00\00\94\00\00\00\00\00\00\00\14\05\00\00\00\00\00\00\14\01\00\00\00\00\00\00\94\0c\00\00\00\00\00\00\14\0d\00\00\00\00\00\00") (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 144)) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) + (global $~lib/rt/__rtti_base i32 (i32.const 400)) + (global $~lib/heap/__heap_base i32 (i32.const 508)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) - (func $start:~lib/allocator/arena (; 1 ;) (type $FUNCSIG$v) - global.get $~lib/memory/HEAP_BASE - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - ) - (func $~lib/allocator/arena/__memory_allocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/rt/tlsf/removeBlock (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - local.get $0 - i32.const 1073741824 - i32.gt_u + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz if + i32.const 0 + i32.const 24 + i32.const 276 + i32.const 13 + call $~lib/builtins/abort unreachable end - global.get $~lib/allocator/arena/offset - local.set $1 - local.get $1 - local.get $0 - local.tee $2 - i32.const 1 - local.tee $3 local.get $2 - local.get $3 - i32.gt_u - select - i32.add - i32.const 7 - i32.add - i32.const 7 + i32.const 3 i32.const -1 i32.xor i32.and - local.set $4 - current_memory - local.set $5 - local.get $4 - local.get $5 + local.set $3 + local.get $3 i32.const 16 - i32.shl - i32.gt_u + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 278 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 local.get $4 - local.get $1 + i32.const 4 i32.sub - i32.const 65535 - i32.add - i32.const 65535 - i32.const -1 - i32.xor - i32.and - i32.const 16 i32.shr_u - local.set $2 + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) local.get $5 - local.tee $3 - local.get $2 - local.tee $6 - local.get $3 - local.get $6 - i32.gt_s - select - local.set $3 - local.get $3 - grow_memory + i32.const 16 + i32.lt_u + else i32.const 0 - i32.lt_s - if - local.get $2 - grow_memory - i32.const 0 - i32.lt_s - if - unreachable - end - end end - local.get $4 - global.set $~lib/allocator/arena/offset - local.get $1 - ) - (func $~lib/memory/memory.allocate (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - call $~lib/allocator/arena/__memory_allocate - return - ) - (func $~lib/internal/arraybuffer/computeSize (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 1 - i32.const 32 - local.get $0 - i32.const 8 - i32.add - i32.const 1 - i32.sub - i32.clz - i32.sub - i32.shl - ) - (func $~lib/internal/arraybuffer/allocateUnsafe (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - local.get $0 - i32.const 1073741816 - i32.le_u i32.eqz if i32.const 0 - i32.const 56 - i32.const 26 - i32.const 2 - call $~lib/env/abort + i32.const 24 + i32.const 291 + i32.const 13 + call $~lib/builtins/abort unreachable end - block $~lib/memory/memory.allocate|inlined.0 (result i32) - local.get $0 - call $~lib/internal/arraybuffer/computeSize - local.set $2 - local.get $2 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.0 - end - local.set $1 local.get $1 - local.get $0 - i32.store + i32.load offset=16 + local.set $6 local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end + local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $9 + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $8 + local.get $4 + local.set $11 + local.get $9 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $9 + local.set $10 + local.get $8 + local.get $11 + i32.const 2 + i32.shl + i32.add + local.get $10 + i32.store offset=4 + end + local.get $9 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end ) - (func $~lib/internal/memory/memset (; 6 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/tlsf/insertBlock (; 6 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i64) - local.get $2 + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 i32.eqz if - return + i32.const 0 + i32.const 24 + i32.const 204 + i32.const 13 + call $~lib/builtins/abort + unreachable end - local.get $0 local.get $1 - i32.store8 - local.get $0 + i32.load + local.set $2 local.get $2 - i32.add i32.const 1 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 2 - i32.le_u + i32.and + i32.eqz if - return + i32.const 0 + i32.const 24 + i32.const 206 + i32.const 13 + call $~lib/builtins/abort + unreachable end - local.get $0 + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 i32.const 1 - i32.add - local.get $1 - i32.store8 - local.get $0 - i32.const 2 - i32.add - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 2 - i32.sub - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 3 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 6 - i32.le_u + i32.and if - return + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end end - local.get $0 - i32.const 3 - i32.add - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 4 - i32.sub - local.get $1 - i32.store8 local.get $2 - i32.const 8 - i32.le_u + i32.const 2 + i32.and if - return + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 4 + i32.sub + i32.load + end + local.set $6 + local.get $6 + i32.load + local.set $3 + local.get $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 227 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $6 + call $~lib/rt/tlsf/removeBlock + local.get $6 + local.get $3 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $6 + local.set $1 + end end - i32.const 0 - local.get $0 - i32.sub - i32.const 3 - i32.and - local.set $3 - local.get $0 - local.get $3 - i32.add - local.set $0 - local.get $2 - local.get $3 - i32.sub - local.set $2 - local.get $2 - i32.const -4 - i32.and - local.set $2 - i32.const -1 - i32.const 255 - i32.div_u - local.get $1 - i32.const 255 - i32.and - i32.mul - local.set $4 - local.get $0 - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 4 - i32.sub local.get $4 + local.get $5 + i32.const 2 + i32.or i32.store local.get $2 - i32.const 8 - i32.le_u + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz if - return + i32.const 0 + i32.const 24 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable end - local.get $0 - i32.const 4 + local.get $1 + i32.const 16 i32.add - local.get $4 - i32.store - local.get $0 - i32.const 8 + local.get $8 i32.add local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 12 - i32.sub + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 243 + i32.const 13 + call $~lib/builtins/abort + unreachable + end local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 8 + i32.const 4 i32.sub - local.get $4 + local.get $1 i32.store - local.get $2 - i32.const 24 - i32.le_u + local.get $8 + i32.const 256 + i32.lt_u if - return + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 259 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $7 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $7 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $0 + local.set $12 + local.get $9 + local.set $7 + local.get $10 + local.set $3 + local.get $1 + local.set $6 + local.get $12 + local.get $7 + i32.const 4 + i32.shl + local.get $3 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 end local.get $0 - i32.const 12 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 16 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 20 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 24 - i32.add - local.get $4 - i32.store local.get $0 - local.get $2 - i32.add - i32.const 28 - i32.sub - local.get $4 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or i32.store - local.get $0 - local.get $2 + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $0 + local.set $13 + local.get $9 + local.set $12 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + end + ) + (func $~lib/rt/tlsf/addMemory (; 7 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + local.get $2 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 385 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 395 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 407 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 8 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + memory.size + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end + block $break|0 + i32.const 0 + local.set $5 + loop $repeat|0 + local.get $5 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $3 + local.set $7 + local.get $5 + local.set $6 + i32.const 0 + local.set $4 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $7 + loop $repeat|1 + local.get $7 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $3 + local.set $9 + local.get $5 + local.set $8 + local.get $7 + local.set $6 + i32.const 0 + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store offset=96 + end + local.get $7 + i32.const 1 + i32.add + local.set $7 + br $repeat|1 + unreachable + end + unreachable + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 72 + i32.const 24 + i32.const 447 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 337 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + i32.const 0 + local.set $7 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $5 + local.get $5 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $5 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $4 + local.get $8 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 350 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + memory.size + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + memory.grow + i32.const 0 + i32.lt_s + if + local.get $3 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + memory.size + local.set $7 + local.get $0 + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (; 12 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 364 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 477 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 479 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + call $~lib/rt/rtrace/onalloc + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/rt/pure/increment (; 15 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/rtrace/onincrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 107 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/pure/__retain (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment + end + local.get $0 + ) + (func $~lib/memory/memory.fill (; 17 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i64) + block $~lib/util/memory/memset|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $3 + i32.eqz + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 1 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 2 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 1 + i32.add + local.get $4 + i32.store8 + local.get $5 + i32.const 2 + i32.add + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 2 + i32.sub + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 3 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 6 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 3 + i32.add + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + i32.const 0 + local.get $5 + i32.sub + i32.const 3 + i32.and + local.set $6 + local.get $5 + local.get $6 + i32.add + local.set $5 + local.get $3 + local.get $6 + i32.sub + local.set $3 + local.get $3 + i32.const -4 + i32.and + local.set $3 + i32.const -1 + i32.const 255 + i32.div_u + local.get $4 + i32.const 255 + i32.and + i32.mul + local.set $7 + local.get $5 + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.get $7 + i32.store + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 4 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 8 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 12 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 8 + i32.sub + local.get $7 + i32.store + local.get $3 + i32.const 24 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 12 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 16 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 20 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 24 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 28 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 24 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 20 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 16 + i32.sub + local.get $7 + i32.store + i32.const 24 + local.get $5 + i32.const 4 + i32.and + i32.add + local.set $6 + local.get $5 + local.get $6 + i32.add + local.set $5 + local.get $3 + local.get $6 + i32.sub + local.set $3 + local.get $7 + i64.extend_i32_u + local.get $7 + i64.extend_i32_u + i64.const 32 + i64.shl + i64.or + local.set $8 + block $break|0 + loop $continue|0 + local.get $3 + i32.const 32 + i32.ge_u + if + local.get $5 + local.get $8 + i64.store + local.get $5 + i32.const 8 + i32.add + local.get $8 + i64.store + local.get $5 + i32.const 16 + i32.add + local.get $8 + i64.store + local.get $5 + i32.const 24 + i32.add + local.get $8 + i64.store + local.get $3 + i32.const 32 + i32.sub + local.set $3 + local.get $5 + i32.const 32 + i32.add + local.set $5 + br $continue|0 + end + end + end + end + ) + (func $~lib/arraybuffer/ArrayBuffer#constructor (; 18 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + i32.const 1073741808 + i32.gt_u + if + i32.const 176 + i32.const 224 + i32.const 56 + i32.const 42 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $2 + local.get $2 + i32.const 0 + local.get $1 + call $~lib/memory/memory.fill + local.get $2 + call $~lib/rt/pure/__retain + ) + (func $~lib/rt/tlsf/freeBlock (; 19 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 531 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/rtrace/onfree + ) + (func $~lib/rt/__typeinfo (; 20 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/rt/__rtti_base + local.set $1 + local.get $0 + local.get $1 + i32.load + i32.gt_u + if + i32.const 280 + i32.const 336 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 4 + i32.add + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/util/memory/memcpy (; 21 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + block $break|0 + loop $continue|0 + local.get $2 + if (result i32) + local.get $1 + i32.const 3 + i32.and + else + i32.const 0 + end + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $continue|0 + end + end + end + local.get $0 + i32.const 3 + i32.and + i32.const 0 + i32.eq + if + block $break|1 + loop $continue|1 + local.get $2 + i32.const 16 + i32.ge_u + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 8 + i32.add + i32.load + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 12 + i32.add + i32.load + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|1 + end + end + end + local.get $2 + i32.const 8 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + end + local.get $2 + i32.const 4 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.set $0 + local.get $1 + i32.const 4 + i32.add + local.set $1 + end + local.get $2 + i32.const 2 + i32.and + if + local.get $0 + local.get $1 + i32.load16_u + i32.store16 + local.get $0 + i32.const 2 + i32.add + local.set $0 + local.get $1 + i32.const 2 + i32.add + local.set $1 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + return + end + local.get $2 + i32.const 32 + i32.ge_u + if + block $break|2 + block $case2|2 + block $case1|2 + block $case0|2 + local.get $0 + i32.const 3 + i32.and + local.set $5 + local.get $5 + i32.const 1 + i32.eq + br_if $case0|2 + local.get $5 + i32.const 2 + i32.eq + br_if $case1|2 + local.get $5 + i32.const 3 + i32.eq + br_if $case2|2 + br $break|2 + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 3 + i32.sub + local.set $2 + block $break|3 + loop $continue|3 + local.get $2 + i32.const 17 + i32.ge_u + if + local.get $1 + i32.const 1 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 5 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 9 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 13 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|3 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + block $break|4 + loop $continue|4 + local.get $2 + i32.const 18 + i32.ge_u + if + local.get $1 + i32.const 2 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 6 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 10 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 14 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|4 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + block $break|5 + loop $continue|5 + local.get $2 + i32.const 19 + i32.ge_u + if + local.get $1 + i32.const 3 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 7 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 11 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 15 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|5 + end + end + end + br $break|2 + unreachable + end + unreachable + end + end + local.get $2 + i32.const 16 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 8 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 4 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 2 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + ) + (func $~lib/memory/memory.copy (; 22 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $4 + local.get $3 + i32.add + local.get $5 + i32.le_u + if (result i32) + i32.const 1 + else + local.get $5 + local.get $3 + i32.add + local.get $4 + i32.le_u + end + if + local.get $5 + local.get $4 + local.get $3 + call $~lib/util/memory/memcpy + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/rt/tlsf/__free (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 561 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 562 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/growRoots (; 24 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/pure/ROOTS + local.set $0 + global.get $~lib/rt/pure/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onfree + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $0 + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onalloc + local.get $0 + call $~lib/rt/tlsf/__free + end + local.get $5 + global.set $~lib/rt/pure/ROOTS + local.get $5 + local.get $1 i32.add - i32.const 24 - i32.sub + global.set $~lib/rt/pure/CUR + local.get $5 local.get $4 - i32.store - local.get $0 - local.get $2 i32.add - i32.const 20 - i32.sub - local.get $4 - i32.store + global.set $~lib/rt/pure/END + ) + (func $~lib/rt/pure/appendRoot (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/pure/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 + end + local.get $1 local.get $0 - local.get $2 - i32.add - i32.const 16 - i32.sub - local.get $4 i32.store - i32.const 24 - local.get $0 + local.get $1 i32.const 4 - i32.and i32.add - local.set $3 + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/decrement (; 26 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) local.get $0 - local.get $3 - i32.add - local.set $0 - local.get $2 - local.get $3 - i32.sub + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and local.set $2 - local.get $4 - i64.extend_i32_u - local.get $4 - i64.extend_i32_u - i64.const 32 - i64.shl - i64.or - local.set $5 - block $break|0 - loop $continue|0 + local.get $0 + call $~lib/rt/rtrace/ondecrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 115 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/rt/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 124 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 16 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or local.get $2 - i32.const 32 - i32.ge_u + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz if - block - local.get $0 - local.get $5 - i64.store - local.get $0 - i32.const 8 - i32.add - local.get $5 - i64.store - local.get $0 - i32.const 16 - i32.add - local.get $5 - i64.store - local.get $0 - i32.const 24 - i32.add - local.get $5 - i64.store - local.get $2 - i32.const 32 - i32.sub - local.set $2 - local.get $0 - i32.const 32 - i32.add - local.set $0 - end - br $continue|0 + local.get $0 + call $~lib/rt/pure/appendRoot end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 end end ) - (func $~lib/arraybuffer/ArrayBuffer#constructor (; 7 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $1 - i32.const 1073741816 + (func $~lib/rt/pure/__release (; 27 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.get $~lib/heap/__heap_base i32.gt_u if - i32.const 0 - i32.const 8 - i32.const 47 - i32.const 40 - call $~lib/env/abort - unreachable + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement end - local.get $1 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $3 - local.get $2 - i32.const 0 - i32.ne - i32.eqz - if - local.get $3 - i32.const 8 - i32.add - local.set $4 + ) + (func $~lib/set/Set#clear (; 28 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + local.tee $1 + block (result i32) i32.const 0 - local.set $5 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $2 local.get $1 - local.set $6 - local.get $4 - local.get $5 - local.get $6 - call $~lib/internal/memory/memset + i32.load + call $~lib/rt/pure/__release + local.get $2 end - local.get $3 - ) - (func $~lib/set/Set#clear (; 8 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 - i32.const 0 - i32.const 16 - i32.const 0 - call $~lib/arraybuffer/ArrayBuffer#constructor i32.store local.get $0 i32.const 4 @@ -475,10 +3462,17 @@ i32.sub i32.store offset=4 local.get $0 - i32.const 0 - i32.const 32 - i32.const 1 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $2 + block (result i32) + i32.const 0 + i32.const 32 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 + local.get $2 + i32.load offset=8 + call $~lib/rt/pure/__release + local.get $1 + end i32.store offset=8 local.get $0 i32.const 4 @@ -490,13 +3484,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#constructor (; 29 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/memory/memory.allocate + i32.const 3 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.set $0 end local.get $0 @@ -522,25 +3518,15 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/internal/hash/hash8 (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/hash8 (; 30 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const -2128831035 local.get $0 i32.xor i32.const 16777619 i32.mul ) - (func $~lib/internal/hash/HASH (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/internal/hash/hash8 - return - ) - (func $~lib/set/Set#find (; 12 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 31 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - (local $4 i32) local.get $0 i32.load local.get $2 @@ -550,59 +3536,66 @@ i32.const 4 i32.mul i32.add - i32.load offset=8 + i32.load local.set $3 block $break|0 loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz - local.tee $4 - if (result i32) - local.get $3 - i32.load8_s - local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.eq - else - local.get $4 - end - if - local.get $3 - return - end + i32.load8_s + local.get $1 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.eq + else + i32.const 0 + end + if local.get $3 - i32.load offset=4 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + return end + local.get $3 + i32.load offset=4 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/set/Set#has (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#has (; 32 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) local.get $0 local.get $1 - local.get $1 - call $~lib/internal/hash/HASH + block $~lib/util/hash/HASH|inlined.0 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.0 + end call $~lib/set/Set#find i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 14 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 33 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -622,7 +3615,6 @@ local.get $2 i32.const 4 i32.mul - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $2 @@ -637,13 +3629,10 @@ i32.const 8 end i32.mul - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $5 local.get $0 i32.load offset=8 - i32.const 8 - i32.add local.set $6 local.get $6 local.get $0 @@ -655,8 +3644,6 @@ i32.add local.set $7 local.get $5 - i32.const 8 - i32.add local.set $8 block $break|0 loop $continue|0 @@ -664,71 +3651,101 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + i32.load8_s + i32.store8 + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 i32.load8_s - i32.store8 - block $~lib/internal/hash/HASH|inlined.0 (result i32) - local.get $9 - i32.load8_s - local.set $11 - local.get $11 - call $~lib/internal/hash/hash8 - br $~lib/internal/hash/HASH|inlined.0 - end - local.get $1 - i32.and local.set $11 - local.get $3 local.get $11 - i32.const 4 - i32.mul - i32.add - local.set $12 - local.get $10 - local.get $12 - i32.load offset=8 - i32.store offset=4 - local.get $12 - local.get $8 - i32.store offset=8 - local.get $8 - block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) - i32.const 8 - end - i32.add - local.set $8 + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=4 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) i32.const 8 end i32.add - local.set $6 + local.set $8 end + local.get $6 + block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + i32.const 8 + end + i32.add + local.set $6 br $continue|0 end end end local.get $0 - local.get $3 + local.tee $9 + block (result i32) + local.get $3 + local.tee $10 + local.get $9 + i32.load + local.tee $9 + i32.ne + if + local.get $10 + call $~lib/rt/pure/__retain + drop + local.get $9 + call $~lib/rt/pure/__release + end + local.get $10 + end i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $5 + local.tee $10 + block (result i32) + local.get $5 + local.tee $11 + local.get $10 + i32.load offset=8 + local.tee $10 + i32.ne + if + local.get $11 + call $~lib/rt/pure/__retain + drop + local.get $10 + call $~lib/rt/pure/__release + end + local.get $11 + end i32.store offset=8 local.get $0 local.get $4 @@ -737,21 +3754,33 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release ) - (func $~lib/set/Set#add (; 15 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#add (; 34 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - local.get $1 - call $~lib/internal/hash/HASH - local.set $2 + block $~lib/util/hash/HASH|inlined.1 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.1 + end + local.set $3 local.get $0 local.get $1 - local.get $2 - call $~lib/set/Set#find - local.set $3 local.get $3 + call $~lib/set/Set#find + local.set $4 + local.get $4 i32.eqz if local.get $0 @@ -785,27 +3814,23 @@ end local.get $0 i32.load offset=8 - local.set $4 - local.get $4 - i32.const 8 - i32.add block (result i32) local.get $0 local.get $0 i32.load offset=16 - local.tee $5 + local.tee $2 i32.const 1 i32.add i32.store offset=16 - local.get $5 + local.get $2 end block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) i32.const 8 end i32.mul i32.add - local.set $3 - local.get $3 + local.set $4 + local.get $4 local.get $1 i32.store8 local.get $0 @@ -816,35 +3841,35 @@ i32.store offset=20 local.get $0 i32.load - local.get $2 + local.get $3 local.get $0 i32.load offset=4 i32.and i32.const 4 i32.mul i32.add - local.set $5 - local.get $3 - local.get $5 - i32.load offset=8 + local.set $2 + local.get $4 + local.get $2 + i32.load i32.store offset=4 - local.get $5 - local.get $3 - i32.store offset=8 + local.get $2 + local.get $4 + i32.store end ) - (func $~lib/set/Set#get:size (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#get:size (; 35 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/set/Set#delete (; 17 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#delete (; 36 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.1 (result i32) + block $~lib/util/hash/HASH|inlined.3 (result i32) local.get $1 local.set $2 local.get $2 @@ -852,8 +3877,8 @@ i32.shl i32.const 24 i32.shr_s - call $~lib/internal/hash/hash8 - br $~lib/internal/hash/HASH|inlined.1 + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.3 end call $~lib/set/Set#find local.set $3 @@ -893,7 +3918,6 @@ i32.gt_u select i32.ge_u - local.tee $2 if (result i32) local.get $0 i32.load offset=20 @@ -905,7 +3929,7 @@ i32.trunc_f64_s i32.lt_s else - local.get $2 + i32.const 0 end if local.get $0 @@ -914,7 +3938,7 @@ end i32.const 1 ) - (func $std/set/test (; 18 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 37 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -929,35 +3953,33 @@ i32.lt_s i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 8 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 10 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -975,10 +3997,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 12 + i32.const 376 + i32.const 10 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|1 @@ -990,34 +4012,32 @@ i32.lt_s i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 16 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 18 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 14 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 16 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -1035,10 +4055,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 20 + i32.const 376 + i32.const 18 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|2 @@ -1050,36 +4070,34 @@ i32.lt_s i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 24 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 26 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 22 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 24 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -1097,10 +4115,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 28 + i32.const 376 + i32.const 26 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|3 @@ -1112,52 +4130,50 @@ i32.lt_s i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 32 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 34 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 36 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 32 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 34 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -1175,10 +4191,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 38 + i32.const 376 + i32.const 36 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -1190,19 +4206,30 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/set/Set#clear (; 19 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/set/Set#clear (; 38 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) local.get $0 - i32.const 0 - i32.const 16 - i32.const 0 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $1 + block (result i32) + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $2 + local.get $1 + i32.load + call $~lib/rt/pure/__release + local.get $2 + end i32.store local.get $0 i32.const 4 @@ -1210,10 +4237,17 @@ i32.sub i32.store offset=4 local.get $0 - i32.const 0 - i32.const 32 - i32.const 1 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $2 + block (result i32) + i32.const 0 + i32.const 32 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 + local.get $2 + i32.load offset=8 + call $~lib/rt/pure/__release + local.get $1 + end i32.store offset=8 local.get $0 i32.const 4 @@ -1225,13 +4259,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 20 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#constructor (; 39 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/memory/memory.allocate + i32.const 4 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.set $0 end local.get $0 @@ -1257,16 +4293,8 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/internal/hash/HASH (; 21 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.const 255 - i32.and - call $~lib/internal/hash/hash8 - return - ) - (func $~lib/set/Set#find (; 22 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 40 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - (local $4 i32) local.get $0 i32.load local.get $2 @@ -1276,57 +4304,62 @@ i32.const 4 i32.mul i32.add - i32.load offset=8 + i32.load local.set $3 block $break|0 loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=4 - i32.const 1 + i32.load8_u + local.get $1 + i32.const 255 i32.and - i32.eqz - local.tee $4 - if (result i32) - local.get $3 - i32.load8_u - local.get $1 - i32.const 255 - i32.and - i32.eq - else - local.get $4 - end - if - local.get $3 - return - end + i32.eq + else + i32.const 0 + end + if local.get $3 - i32.load offset=4 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + return end + local.get $3 + i32.load offset=4 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/set/Set#has (; 23 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#has (; 41 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) local.get $0 local.get $1 - local.get $1 - call $~lib/internal/hash/HASH + block $~lib/util/hash/HASH|inlined.0 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.const 255 + i32.and + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.0 + end call $~lib/set/Set#find i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 24 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 42 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1346,7 +4379,6 @@ local.get $2 i32.const 4 i32.mul - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $2 @@ -1361,13 +4393,10 @@ i32.const 8 end i32.mul - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $5 local.get $0 i32.load offset=8 - i32.const 8 - i32.add local.set $6 local.get $6 local.get $0 @@ -1379,8 +4408,6 @@ i32.add local.set $7 local.get $5 - i32.const 8 - i32.add local.set $8 block $break|0 loop $continue|0 @@ -1388,71 +4415,101 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + i32.load8_u + i32.store8 + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 i32.load8_u - i32.store8 - block $~lib/internal/hash/HASH|inlined.0 (result i32) - local.get $9 - i32.load8_u - local.set $11 - local.get $11 - call $~lib/internal/hash/hash8 - br $~lib/internal/hash/HASH|inlined.0 - end - local.get $1 - i32.and local.set $11 - local.get $3 local.get $11 - i32.const 4 - i32.mul - i32.add - local.set $12 - local.get $10 - local.get $12 - i32.load offset=8 - i32.store offset=4 - local.get $12 - local.get $8 - i32.store offset=8 - local.get $8 - block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) - i32.const 8 - end - i32.add - local.set $8 + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=4 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) i32.const 8 end i32.add - local.set $6 + local.set $8 end + local.get $6 + block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + i32.const 8 + end + i32.add + local.set $6 br $continue|0 end end end local.get $0 - local.get $3 + local.tee $9 + block (result i32) + local.get $3 + local.tee $10 + local.get $9 + i32.load + local.tee $9 + i32.ne + if + local.get $10 + call $~lib/rt/pure/__retain + drop + local.get $9 + call $~lib/rt/pure/__release + end + local.get $10 + end i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $5 + local.tee $10 + block (result i32) + local.get $5 + local.tee $11 + local.get $10 + i32.load offset=8 + local.tee $10 + i32.ne + if + local.get $11 + call $~lib/rt/pure/__retain + drop + local.get $10 + call $~lib/rt/pure/__release + end + local.get $11 + end i32.store offset=8 local.get $0 local.get $4 @@ -1461,21 +4518,31 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release ) - (func $~lib/set/Set#add (; 25 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#add (; 43 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - local.get $1 - call $~lib/internal/hash/HASH - local.set $2 + block $~lib/util/hash/HASH|inlined.1 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.const 255 + i32.and + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.1 + end + local.set $3 local.get $0 local.get $1 - local.get $2 - call $~lib/set/Set#find - local.set $3 local.get $3 + call $~lib/set/Set#find + local.set $4 + local.get $4 i32.eqz if local.get $0 @@ -1509,27 +4576,23 @@ end local.get $0 i32.load offset=8 - local.set $4 - local.get $4 - i32.const 8 - i32.add block (result i32) local.get $0 local.get $0 i32.load offset=16 - local.tee $5 + local.tee $2 i32.const 1 i32.add i32.store offset=16 - local.get $5 + local.get $2 end block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) i32.const 8 end i32.mul i32.add - local.set $3 - local.get $3 + local.set $4 + local.get $4 local.get $1 i32.store8 local.get $0 @@ -1540,42 +4603,42 @@ i32.store offset=20 local.get $0 i32.load - local.get $2 + local.get $3 local.get $0 i32.load offset=4 i32.and i32.const 4 i32.mul i32.add - local.set $5 - local.get $3 - local.get $5 - i32.load offset=8 + local.set $2 + local.get $4 + local.get $2 + i32.load i32.store offset=4 - local.get $5 - local.get $3 - i32.store offset=8 + local.get $2 + local.get $4 + i32.store end ) - (func $~lib/set/Set#get:size (; 26 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#get:size (; 44 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/set/Set#delete (; 27 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#delete (; 45 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.1 (result i32) + block $~lib/util/hash/HASH|inlined.3 (result i32) local.get $1 local.set $2 local.get $2 i32.const 255 i32.and - call $~lib/internal/hash/hash8 - br $~lib/internal/hash/HASH|inlined.1 + call $~lib/util/hash/hash8 + br $~lib/util/hash/HASH|inlined.3 end call $~lib/set/Set#find local.set $3 @@ -1615,7 +4678,6 @@ i32.gt_u select i32.ge_u - local.tee $2 if (result i32) local.get $0 i32.load offset=20 @@ -1627,7 +4689,7 @@ i32.trunc_f64_s i32.lt_s else - local.get $2 + i32.const 0 end if local.get $0 @@ -1636,7 +4698,7 @@ end i32.const 1 ) - (func $std/set/test (; 28 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 46 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -1651,35 +4713,33 @@ i32.lt_u i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 8 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 10 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -1697,10 +4757,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 12 + i32.const 376 + i32.const 10 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|1 @@ -1712,34 +4772,32 @@ i32.lt_u i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 16 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 18 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 14 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 16 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -1757,51 +4815,49 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 20 + i32.const 376 + i32.const 18 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $break|2 - i32.const 0 - local.set $1 - loop $repeat|2 - local.get $1 - i32.const 50 - i32.lt_u - i32.eqz - br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 24 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 26 - i32.const 4 - call $~lib/env/abort - unreachable - end + block $break|2 + i32.const 0 + local.set $1 + loop $repeat|2 + local.get $1 + i32.const 50 + i32.lt_u + i32.eqz + br_if $break|2 + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 22 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 24 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -1819,10 +4875,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 28 + i32.const 376 + i32.const 26 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|3 @@ -1834,52 +4890,50 @@ i32.lt_u i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 32 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 34 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 36 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 32 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 34 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -1897,10 +4951,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 38 + i32.const 376 + i32.const 36 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -1912,19 +4966,30 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/set/Set#clear (; 29 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/set/Set#clear (; 47 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) local.get $0 - i32.const 0 - i32.const 16 - i32.const 0 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $1 + block (result i32) + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $2 + local.get $1 + i32.load + call $~lib/rt/pure/__release + local.get $2 + end i32.store local.get $0 i32.const 4 @@ -1932,10 +4997,17 @@ i32.sub i32.store offset=4 local.get $0 - i32.const 0 - i32.const 32 - i32.const 1 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $2 + block (result i32) + i32.const 0 + i32.const 32 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 + local.get $2 + i32.load offset=8 + call $~lib/rt/pure/__release + local.get $1 + end i32.store offset=8 local.get $0 i32.const 4 @@ -1947,13 +5019,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 30 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#constructor (; 48 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/memory/memory.allocate + i32.const 5 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.set $0 end local.get $0 @@ -1979,7 +5053,7 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/internal/hash/hash16 (; 31 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/hash16 (; 49 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const -2128831035 local.set $1 @@ -2001,18 +5075,8 @@ local.set $1 local.get $1 ) - (func $~lib/internal/hash/HASH (; 32 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/internal/hash/hash16 - return - ) - (func $~lib/set/Set#find (; 33 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 50 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - (local $4 i32) local.get $0 i32.load local.get $2 @@ -2022,59 +5086,66 @@ i32.const 4 i32.mul i32.add - i32.load offset=8 + i32.load local.set $3 block $break|0 loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz - local.tee $4 - if (result i32) - local.get $3 - i32.load16_s - local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - i32.eq - else - local.get $4 - end - if - local.get $3 - return - end + i32.load16_s + local.get $1 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + i32.eq + else + i32.const 0 + end + if local.get $3 - i32.load offset=4 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + return end + local.get $3 + i32.load offset=4 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/set/Set#has (; 34 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#has (; 51 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) local.get $0 local.get $1 - local.get $1 - call $~lib/internal/hash/HASH + block $~lib/util/hash/HASH|inlined.0 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.0 + end call $~lib/set/Set#find i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 35 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 52 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2094,7 +5165,6 @@ local.get $2 i32.const 4 i32.mul - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $2 @@ -2109,13 +5179,10 @@ i32.const 8 end i32.mul - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $5 local.get $0 i32.load offset=8 - i32.const 8 - i32.add local.set $6 local.get $6 local.get $0 @@ -2127,8 +5194,6 @@ i32.add local.set $7 local.get $5 - i32.const 8 - i32.add local.set $8 block $break|0 loop $continue|0 @@ -2136,71 +5201,101 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + i32.load16_s + i32.store16 + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 i32.load16_s - i32.store16 - block $~lib/internal/hash/HASH|inlined.0 (result i32) - local.get $9 - i32.load16_s - local.set $11 - local.get $11 - call $~lib/internal/hash/hash16 - br $~lib/internal/hash/HASH|inlined.0 - end - local.get $1 - i32.and local.set $11 - local.get $3 local.get $11 - i32.const 4 - i32.mul - i32.add - local.set $12 - local.get $10 - local.get $12 - i32.load offset=8 - i32.store offset=4 - local.get $12 - local.get $8 - i32.store offset=8 - local.get $8 - block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) - i32.const 8 - end - i32.add - local.set $8 + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=4 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) i32.const 8 end i32.add - local.set $6 + local.set $8 + end + local.get $6 + block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + i32.const 8 end + i32.add + local.set $6 br $continue|0 end end end local.get $0 - local.get $3 + local.tee $9 + block (result i32) + local.get $3 + local.tee $10 + local.get $9 + i32.load + local.tee $9 + i32.ne + if + local.get $10 + call $~lib/rt/pure/__retain + drop + local.get $9 + call $~lib/rt/pure/__release + end + local.get $10 + end i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $5 + local.tee $10 + block (result i32) + local.get $5 + local.tee $11 + local.get $10 + i32.load offset=8 + local.tee $10 + i32.ne + if + local.get $11 + call $~lib/rt/pure/__retain + drop + local.get $10 + call $~lib/rt/pure/__release + end + local.get $11 + end i32.store offset=8 local.get $0 local.get $4 @@ -2209,21 +5304,33 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release ) - (func $~lib/set/Set#add (; 36 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#add (; 53 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - local.get $1 - call $~lib/internal/hash/HASH - local.set $2 + block $~lib/util/hash/HASH|inlined.1 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.1 + end + local.set $3 local.get $0 local.get $1 - local.get $2 - call $~lib/set/Set#find - local.set $3 local.get $3 + call $~lib/set/Set#find + local.set $4 + local.get $4 i32.eqz if local.get $0 @@ -2257,27 +5364,23 @@ end local.get $0 i32.load offset=8 - local.set $4 - local.get $4 - i32.const 8 - i32.add block (result i32) local.get $0 local.get $0 i32.load offset=16 - local.tee $5 + local.tee $2 i32.const 1 i32.add i32.store offset=16 - local.get $5 + local.get $2 end block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) i32.const 8 end i32.mul i32.add - local.set $3 - local.get $3 + local.set $4 + local.get $4 local.get $1 i32.store16 local.get $0 @@ -2288,35 +5391,35 @@ i32.store offset=20 local.get $0 i32.load - local.get $2 + local.get $3 local.get $0 i32.load offset=4 i32.and i32.const 4 i32.mul i32.add - local.set $5 - local.get $3 - local.get $5 - i32.load offset=8 + local.set $2 + local.get $4 + local.get $2 + i32.load i32.store offset=4 - local.get $5 - local.get $3 - i32.store offset=8 + local.get $2 + local.get $4 + i32.store end ) - (func $~lib/set/Set#get:size (; 37 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#get:size (; 54 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/set/Set#delete (; 38 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#delete (; 55 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.1 (result i32) + block $~lib/util/hash/HASH|inlined.3 (result i32) local.get $1 local.set $2 local.get $2 @@ -2324,8 +5427,8 @@ i32.shl i32.const 16 i32.shr_s - call $~lib/internal/hash/hash16 - br $~lib/internal/hash/HASH|inlined.1 + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.3 end call $~lib/set/Set#find local.set $3 @@ -2365,7 +5468,6 @@ i32.gt_u select i32.ge_u - local.tee $2 if (result i32) local.get $0 i32.load offset=20 @@ -2377,7 +5479,7 @@ i32.trunc_f64_s i32.lt_s else - local.get $2 + i32.const 0 end if local.get $0 @@ -2386,7 +5488,7 @@ end i32.const 1 ) - (func $std/set/test (; 39 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 56 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -2401,35 +5503,33 @@ i32.lt_s i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 8 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 10 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -2447,10 +5547,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 12 + i32.const 376 + i32.const 10 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|1 @@ -2462,34 +5562,32 @@ i32.lt_s i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 16 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 18 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 14 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 16 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -2507,10 +5605,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 20 + i32.const 376 + i32.const 18 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|2 @@ -2522,36 +5620,34 @@ i32.lt_s i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 24 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 26 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 22 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 24 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -2569,10 +5665,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 28 + i32.const 376 + i32.const 26 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|3 @@ -2584,52 +5680,50 @@ i32.lt_s i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 32 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 34 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 36 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 32 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 34 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -2647,10 +5741,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 38 + i32.const 376 + i32.const 36 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -2662,19 +5756,30 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/set/Set#clear (; 40 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/set/Set#clear (; 57 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) local.get $0 - i32.const 0 - i32.const 16 - i32.const 0 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $1 + block (result i32) + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $2 + local.get $1 + i32.load + call $~lib/rt/pure/__release + local.get $2 + end i32.store local.get $0 i32.const 4 @@ -2682,10 +5787,17 @@ i32.sub i32.store offset=4 local.get $0 - i32.const 0 - i32.const 32 - i32.const 1 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $2 + block (result i32) + i32.const 0 + i32.const 32 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 + local.get $2 + i32.load offset=8 + call $~lib/rt/pure/__release + local.get $1 + end i32.store offset=8 local.get $0 i32.const 4 @@ -2697,13 +5809,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 41 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#constructor (; 58 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/memory/memory.allocate + i32.const 6 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.set $0 end local.get $0 @@ -2729,16 +5843,8 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/internal/hash/HASH (; 42 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.const 65535 - i32.and - call $~lib/internal/hash/hash16 - return - ) - (func $~lib/set/Set#find (; 43 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 59 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - (local $4 i32) local.get $0 i32.load local.get $2 @@ -2748,57 +5854,62 @@ i32.const 4 i32.mul i32.add - i32.load offset=8 + i32.load local.set $3 block $break|0 loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=4 - i32.const 1 + i32.load16_u + local.get $1 + i32.const 65535 i32.and - i32.eqz - local.tee $4 - if (result i32) - local.get $3 - i32.load16_u - local.get $1 - i32.const 65535 - i32.and - i32.eq - else - local.get $4 - end - if - local.get $3 - return - end + i32.eq + else + i32.const 0 + end + if local.get $3 - i32.load offset=4 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + return end + local.get $3 + i32.load offset=4 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/set/Set#has (; 44 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#has (; 60 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) local.get $0 local.get $1 - local.get $1 - call $~lib/internal/hash/HASH + block $~lib/util/hash/HASH|inlined.0 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.const 65535 + i32.and + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.0 + end call $~lib/set/Set#find i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 45 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 61 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2818,7 +5929,6 @@ local.get $2 i32.const 4 i32.mul - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $2 @@ -2833,13 +5943,10 @@ i32.const 8 end i32.mul - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $5 local.get $0 i32.load offset=8 - i32.const 8 - i32.add local.set $6 local.get $6 local.get $0 @@ -2851,8 +5958,6 @@ i32.add local.set $7 local.get $5 - i32.const 8 - i32.add local.set $8 block $break|0 loop $continue|0 @@ -2860,71 +5965,101 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 - local.get $9 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 + local.get $9 + i32.load16_u + i32.store16 + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 i32.load16_u - i32.store16 - block $~lib/internal/hash/HASH|inlined.0 (result i32) - local.get $9 - i32.load16_u - local.set $11 - local.get $11 - call $~lib/internal/hash/hash16 - br $~lib/internal/hash/HASH|inlined.0 - end - local.get $1 - i32.and local.set $11 - local.get $3 local.get $11 - i32.const 4 - i32.mul - i32.add - local.set $12 - local.get $10 - local.get $12 - i32.load offset=8 - i32.store offset=4 - local.get $12 - local.get $8 - i32.store offset=8 - local.get $8 - block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) - i32.const 8 - end - i32.add - local.set $8 + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=4 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) i32.const 8 end i32.add - local.set $6 + local.set $8 + end + local.get $6 + block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + i32.const 8 end + i32.add + local.set $6 br $continue|0 end end end local.get $0 - local.get $3 + local.tee $9 + block (result i32) + local.get $3 + local.tee $10 + local.get $9 + i32.load + local.tee $9 + i32.ne + if + local.get $10 + call $~lib/rt/pure/__retain + drop + local.get $9 + call $~lib/rt/pure/__release + end + local.get $10 + end i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $5 + local.tee $10 + block (result i32) + local.get $5 + local.tee $11 + local.get $10 + i32.load offset=8 + local.tee $10 + i32.ne + if + local.get $11 + call $~lib/rt/pure/__retain + drop + local.get $10 + call $~lib/rt/pure/__release + end + local.get $11 + end i32.store offset=8 local.get $0 local.get $4 @@ -2933,21 +6068,31 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release ) - (func $~lib/set/Set#add (; 46 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#add (; 62 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - local.get $1 - call $~lib/internal/hash/HASH - local.set $2 + block $~lib/util/hash/HASH|inlined.1 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.const 65535 + i32.and + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.1 + end + local.set $3 local.get $0 local.get $1 - local.get $2 - call $~lib/set/Set#find - local.set $3 local.get $3 + call $~lib/set/Set#find + local.set $4 + local.get $4 i32.eqz if local.get $0 @@ -2981,27 +6126,23 @@ end local.get $0 i32.load offset=8 - local.set $4 - local.get $4 - i32.const 8 - i32.add block (result i32) local.get $0 local.get $0 i32.load offset=16 - local.tee $5 + local.tee $2 i32.const 1 i32.add i32.store offset=16 - local.get $5 + local.get $2 end block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) i32.const 8 end i32.mul i32.add - local.set $3 - local.get $3 + local.set $4 + local.get $4 local.get $1 i32.store16 local.get $0 @@ -3012,42 +6153,42 @@ i32.store offset=20 local.get $0 i32.load - local.get $2 + local.get $3 local.get $0 i32.load offset=4 i32.and i32.const 4 i32.mul i32.add - local.set $5 - local.get $3 - local.get $5 - i32.load offset=8 + local.set $2 + local.get $4 + local.get $2 + i32.load i32.store offset=4 - local.get $5 - local.get $3 - i32.store offset=8 + local.get $2 + local.get $4 + i32.store end ) - (func $~lib/set/Set#get:size (; 47 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#get:size (; 63 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/set/Set#delete (; 48 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#delete (; 64 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.1 (result i32) + block $~lib/util/hash/HASH|inlined.3 (result i32) local.get $1 local.set $2 local.get $2 i32.const 65535 i32.and - call $~lib/internal/hash/hash16 - br $~lib/internal/hash/HASH|inlined.1 + call $~lib/util/hash/hash16 + br $~lib/util/hash/HASH|inlined.3 end call $~lib/set/Set#find local.set $3 @@ -3087,7 +6228,6 @@ i32.gt_u select i32.ge_u - local.tee $2 if (result i32) local.get $0 i32.load offset=20 @@ -3099,7 +6239,7 @@ i32.trunc_f64_s i32.lt_s else - local.get $2 + i32.const 0 end if local.get $0 @@ -3108,7 +6248,7 @@ end i32.const 1 ) - (func $std/set/test (; 49 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 65 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -3123,35 +6263,33 @@ i32.lt_u i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 8 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 10 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -3169,10 +6307,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 12 + i32.const 376 + i32.const 10 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|1 @@ -3184,34 +6322,32 @@ i32.lt_u i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 16 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 18 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 14 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 16 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -3229,10 +6365,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 20 + i32.const 376 + i32.const 18 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|2 @@ -3244,36 +6380,34 @@ i32.lt_u i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 24 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 26 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 22 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 24 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -3291,10 +6425,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 28 + i32.const 376 + i32.const 26 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|3 @@ -3306,52 +6440,50 @@ i32.lt_u i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 32 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 34 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 36 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 32 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 34 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -3369,10 +6501,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 38 + i32.const 376 + i32.const 36 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -3384,19 +6516,30 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - ) - (func $~lib/set/Set#clear (; 50 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 - i32.const 0 - i32.const 16 - i32.const 0 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.get $0 + call $~lib/rt/pure/__release + ) + (func $~lib/set/Set#clear (; 66 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + local.tee $1 + block (result i32) + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $2 + local.get $1 + i32.load + call $~lib/rt/pure/__release + local.get $2 + end i32.store local.get $0 i32.const 4 @@ -3404,10 +6547,17 @@ i32.sub i32.store offset=4 local.get $0 - i32.const 0 - i32.const 32 - i32.const 1 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $2 + block (result i32) + i32.const 0 + i32.const 32 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 + local.get $2 + i32.load offset=8 + call $~lib/rt/pure/__release + local.get $1 + end i32.store offset=8 local.get $0 i32.const 4 @@ -3419,13 +6569,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 51 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#constructor (; 67 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/memory/memory.allocate + i32.const 7 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.set $0 end local.get $0 @@ -3451,7 +6603,7 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/internal/hash/hash32 (; 52 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/hash32 (; 68 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const -2128831035 local.set $1 @@ -3493,14 +6645,8 @@ local.set $1 local.get $1 ) - (func $~lib/internal/hash/HASH (; 53 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - call $~lib/internal/hash/hash32 - return - ) - (func $~lib/set/Set#find (; 54 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 69 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - (local $4 i32) local.get $0 i32.load local.get $2 @@ -3510,55 +6656,58 @@ i32.const 4 i32.mul i32.add - i32.load offset=8 + i32.load local.set $3 block $break|0 loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz - local.tee $4 - if (result i32) - local.get $3 - i32.load - local.get $1 - i32.eq - else - local.get $4 - end - if - local.get $3 - return - end + i32.load + local.get $1 + i32.eq + else + i32.const 0 + end + if local.get $3 - i32.load offset=4 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + return end + local.get $3 + i32.load offset=4 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/set/Set#has (; 55 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#has (; 70 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) local.get $0 local.get $1 - local.get $1 - call $~lib/internal/hash/HASH + block $~lib/util/hash/HASH|inlined.0 (result i32) + local.get $1 + local.set $2 + local.get $2 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.0 + end call $~lib/set/Set#find i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 56 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 71 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3578,7 +6727,6 @@ local.get $2 i32.const 4 i32.mul - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $2 @@ -3593,13 +6741,10 @@ i32.const 8 end i32.mul - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $5 local.get $0 i32.load offset=8 - i32.const 8 - i32.add local.set $6 local.get $6 local.get $0 @@ -3611,8 +6756,6 @@ i32.add local.set $7 local.get $5 - i32.const 8 - i32.add local.set $8 block $break|0 loop $continue|0 @@ -3620,71 +6763,101 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + i32.load + i32.store + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 i32.load - i32.store - block $~lib/internal/hash/HASH|inlined.0 (result i32) - local.get $9 - i32.load - local.set $11 - local.get $11 - call $~lib/internal/hash/hash32 - br $~lib/internal/hash/HASH|inlined.0 - end - local.get $1 - i32.and local.set $11 - local.get $3 local.get $11 - i32.const 4 - i32.mul - i32.add - local.set $12 - local.get $10 - local.get $12 - i32.load offset=8 - i32.store offset=4 - local.get $12 - local.get $8 - i32.store offset=8 - local.get $8 - block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) - i32.const 8 - end - i32.add - local.set $8 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=4 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) i32.const 8 end i32.add - local.set $6 + local.set $8 + end + local.get $6 + block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + i32.const 8 end + i32.add + local.set $6 br $continue|0 end end end local.get $0 - local.get $3 + local.tee $9 + block (result i32) + local.get $3 + local.tee $10 + local.get $9 + i32.load + local.tee $9 + i32.ne + if + local.get $10 + call $~lib/rt/pure/__retain + drop + local.get $9 + call $~lib/rt/pure/__release + end + local.get $10 + end i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $5 + local.tee $10 + block (result i32) + local.get $5 + local.tee $11 + local.get $10 + i32.load offset=8 + local.tee $10 + i32.ne + if + local.get $11 + call $~lib/rt/pure/__retain + drop + local.get $10 + call $~lib/rt/pure/__release + end + local.get $11 + end i32.store offset=8 local.get $0 local.get $4 @@ -3693,21 +6866,29 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release ) - (func $~lib/set/Set#add (; 57 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#add (; 72 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - local.get $1 - call $~lib/internal/hash/HASH - local.set $2 + block $~lib/util/hash/HASH|inlined.1 (result i32) + local.get $1 + local.set $2 + local.get $2 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.1 + end + local.set $3 local.get $0 local.get $1 - local.get $2 - call $~lib/set/Set#find - local.set $3 local.get $3 + call $~lib/set/Set#find + local.set $4 + local.get $4 i32.eqz if local.get $0 @@ -3741,27 +6922,23 @@ end local.get $0 i32.load offset=8 - local.set $4 - local.get $4 - i32.const 8 - i32.add block (result i32) local.get $0 local.get $0 i32.load offset=16 - local.tee $5 + local.tee $2 i32.const 1 i32.add i32.store offset=16 - local.get $5 + local.get $2 end block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) i32.const 8 end i32.mul i32.add - local.set $3 - local.get $3 + local.set $4 + local.get $4 local.get $1 i32.store local.get $0 @@ -3772,40 +6949,40 @@ i32.store offset=20 local.get $0 i32.load - local.get $2 + local.get $3 local.get $0 i32.load offset=4 i32.and i32.const 4 i32.mul i32.add - local.set $5 - local.get $3 - local.get $5 - i32.load offset=8 + local.set $2 + local.get $4 + local.get $2 + i32.load i32.store offset=4 - local.get $5 - local.get $3 - i32.store offset=8 + local.get $2 + local.get $4 + i32.store end ) - (func $~lib/set/Set#get:size (; 58 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#get:size (; 73 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/set/Set#delete (; 59 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#delete (; 74 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.1 (result i32) + block $~lib/util/hash/HASH|inlined.3 (result i32) local.get $1 local.set $2 local.get $2 - call $~lib/internal/hash/hash32 - br $~lib/internal/hash/HASH|inlined.1 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.3 end call $~lib/set/Set#find local.set $3 @@ -3845,7 +7022,6 @@ i32.gt_u select i32.ge_u - local.tee $2 if (result i32) local.get $0 i32.load offset=20 @@ -3857,7 +7033,7 @@ i32.trunc_f64_s i32.lt_s else - local.get $2 + i32.const 0 end if local.get $0 @@ -3866,7 +7042,7 @@ end i32.const 1 ) - (func $std/set/test (; 60 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 75 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -3881,35 +7057,33 @@ i32.lt_s i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 8 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 10 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -3927,10 +7101,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 12 + i32.const 376 + i32.const 10 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|1 @@ -3942,34 +7116,32 @@ i32.lt_s i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 16 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 18 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 14 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 16 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -3987,10 +7159,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 20 + i32.const 376 + i32.const 18 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|2 @@ -4002,36 +7174,34 @@ i32.lt_s i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 24 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 26 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 22 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 24 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -4049,10 +7219,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 28 + i32.const 376 + i32.const 26 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|3 @@ -4064,52 +7234,50 @@ i32.lt_s i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 32 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 34 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 36 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 32 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 34 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -4127,10 +7295,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 38 + i32.const 376 + i32.const 36 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -4142,19 +7310,30 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/set/Set#clear (; 61 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/set/Set#clear (; 76 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) local.get $0 - i32.const 0 - i32.const 16 - i32.const 0 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $1 + block (result i32) + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $2 + local.get $1 + i32.load + call $~lib/rt/pure/__release + local.get $2 + end i32.store local.get $0 i32.const 4 @@ -4162,10 +7341,17 @@ i32.sub i32.store offset=4 local.get $0 - i32.const 0 - i32.const 32 - i32.const 1 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $2 + block (result i32) + i32.const 0 + i32.const 32 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 + local.get $2 + i32.load offset=8 + call $~lib/rt/pure/__release + local.get $1 + end i32.store offset=8 local.get $0 i32.const 4 @@ -4177,13 +7363,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 62 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#constructor (; 77 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/memory/memory.allocate + i32.const 8 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.set $0 end local.get $0 @@ -4209,14 +7397,8 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/internal/hash/HASH (; 63 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - call $~lib/internal/hash/hash32 - return - ) - (func $~lib/set/Set#find (; 64 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 78 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - (local $4 i32) local.get $0 i32.load local.get $2 @@ -4226,55 +7408,58 @@ i32.const 4 i32.mul i32.add - i32.load offset=8 + i32.load local.set $3 block $break|0 loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz - local.tee $4 - if (result i32) - local.get $3 - i32.load - local.get $1 - i32.eq - else - local.get $4 - end - if - local.get $3 - return - end + i32.load + local.get $1 + i32.eq + else + i32.const 0 + end + if local.get $3 - i32.load offset=4 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + return end + local.get $3 + i32.load offset=4 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/set/Set#has (; 65 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#has (; 79 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) local.get $0 local.get $1 - local.get $1 - call $~lib/internal/hash/HASH + block $~lib/util/hash/HASH|inlined.0 (result i32) + local.get $1 + local.set $2 + local.get $2 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.0 + end call $~lib/set/Set#find i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 66 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 80 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -4294,7 +7479,6 @@ local.get $2 i32.const 4 i32.mul - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $2 @@ -4309,13 +7493,10 @@ i32.const 8 end i32.mul - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $5 local.get $0 i32.load offset=8 - i32.const 8 - i32.add local.set $6 local.get $6 local.get $0 @@ -4327,8 +7508,6 @@ i32.add local.set $7 local.get $5 - i32.const 8 - i32.add local.set $8 block $break|0 loop $continue|0 @@ -4336,71 +7515,101 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + i32.load + i32.store + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 i32.load - i32.store - block $~lib/internal/hash/HASH|inlined.0 (result i32) - local.get $9 - i32.load - local.set $11 - local.get $11 - call $~lib/internal/hash/hash32 - br $~lib/internal/hash/HASH|inlined.0 - end - local.get $1 - i32.and local.set $11 - local.get $3 local.get $11 - i32.const 4 - i32.mul - i32.add - local.set $12 - local.get $10 - local.get $12 - i32.load offset=8 - i32.store offset=4 - local.get $12 - local.get $8 - i32.store offset=8 - local.get $8 - block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) - i32.const 8 - end - i32.add - local.set $8 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=4 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) i32.const 8 end i32.add - local.set $6 + local.set $8 + end + local.get $6 + block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + i32.const 8 end + i32.add + local.set $6 br $continue|0 end end end local.get $0 - local.get $3 + local.tee $9 + block (result i32) + local.get $3 + local.tee $10 + local.get $9 + i32.load + local.tee $9 + i32.ne + if + local.get $10 + call $~lib/rt/pure/__retain + drop + local.get $9 + call $~lib/rt/pure/__release + end + local.get $10 + end i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $5 + local.tee $10 + block (result i32) + local.get $5 + local.tee $11 + local.get $10 + i32.load offset=8 + local.tee $10 + i32.ne + if + local.get $11 + call $~lib/rt/pure/__retain + drop + local.get $10 + call $~lib/rt/pure/__release + end + local.get $11 + end i32.store offset=8 local.get $0 local.get $4 @@ -4409,21 +7618,29 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release ) - (func $~lib/set/Set#add (; 67 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#add (; 81 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - local.get $1 - call $~lib/internal/hash/HASH - local.set $2 + block $~lib/util/hash/HASH|inlined.1 (result i32) + local.get $1 + local.set $2 + local.get $2 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.1 + end + local.set $3 local.get $0 local.get $1 - local.get $2 - call $~lib/set/Set#find - local.set $3 local.get $3 + call $~lib/set/Set#find + local.set $4 + local.get $4 i32.eqz if local.get $0 @@ -4457,27 +7674,23 @@ end local.get $0 i32.load offset=8 - local.set $4 - local.get $4 - i32.const 8 - i32.add block (result i32) local.get $0 local.get $0 i32.load offset=16 - local.tee $5 + local.tee $2 i32.const 1 i32.add i32.store offset=16 - local.get $5 + local.get $2 end block $~lib/set/ENTRY_SIZE|inlined.5 (result i32) i32.const 8 end i32.mul i32.add - local.set $3 - local.get $3 + local.set $4 + local.get $4 local.get $1 i32.store local.get $0 @@ -4488,40 +7701,40 @@ i32.store offset=20 local.get $0 i32.load - local.get $2 + local.get $3 local.get $0 i32.load offset=4 i32.and i32.const 4 i32.mul i32.add - local.set $5 - local.get $3 - local.get $5 - i32.load offset=8 + local.set $2 + local.get $4 + local.get $2 + i32.load i32.store offset=4 - local.get $5 - local.get $3 - i32.store offset=8 + local.get $2 + local.get $4 + i32.store end ) - (func $~lib/set/Set#get:size (; 68 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#get:size (; 82 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/set/Set#delete (; 69 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#delete (; 83 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.1 (result i32) + block $~lib/util/hash/HASH|inlined.3 (result i32) local.get $1 local.set $2 local.get $2 - call $~lib/internal/hash/hash32 - br $~lib/internal/hash/HASH|inlined.1 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.3 end call $~lib/set/Set#find local.set $3 @@ -4561,7 +7774,6 @@ i32.gt_u select i32.ge_u - local.tee $2 if (result i32) local.get $0 i32.load offset=20 @@ -4573,7 +7785,7 @@ i32.trunc_f64_s i32.lt_s else - local.get $2 + i32.const 0 end if local.get $0 @@ -4582,7 +7794,7 @@ end i32.const 1 ) - (func $std/set/test (; 70 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 84 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -4591,41 +7803,39 @@ block $break|0 i32.const 0 local.set $1 - loop $repeat|0 - local.get $1 - i32.const 100 - i32.lt_u - i32.eqz - br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 8 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 10 - i32.const 4 - call $~lib/env/abort - unreachable - end + loop $repeat|0 + local.get $1 + i32.const 100 + i32.lt_u + i32.eqz + br_if $break|0 + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -4643,10 +7853,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 12 + i32.const 376 + i32.const 10 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|1 @@ -4658,34 +7868,32 @@ i32.lt_u i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 16 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 18 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 14 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 16 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -4703,10 +7911,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 20 + i32.const 376 + i32.const 18 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|2 @@ -4718,36 +7926,34 @@ i32.lt_u i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 24 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 26 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 22 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 24 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -4765,10 +7971,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 28 + i32.const 376 + i32.const 26 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|3 @@ -4780,52 +7986,50 @@ i32.lt_u i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 32 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 34 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 36 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 32 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 34 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i32.const 1 @@ -4843,10 +8047,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 38 + i32.const 376 + i32.const 36 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -4858,19 +8062,30 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/set/Set#clear (; 71 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/set/Set#clear (; 85 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) local.get $0 - i32.const 0 - i32.const 16 - i32.const 0 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $1 + block (result i32) + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $2 + local.get $1 + i32.load + call $~lib/rt/pure/__release + local.get $2 + end i32.store local.get $0 i32.const 4 @@ -4878,10 +8093,17 @@ i32.sub i32.store offset=4 local.get $0 - i32.const 0 - i32.const 64 - i32.const 1 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $2 + block (result i32) + i32.const 0 + i32.const 64 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 + local.get $2 + i32.load offset=8 + call $~lib/rt/pure/__release + local.get $1 + end i32.store offset=8 local.get $0 i32.const 4 @@ -4893,13 +8115,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 72 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#constructor (; 86 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/memory/memory.allocate + i32.const 9 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.set $0 end local.get $0 @@ -4925,7 +8149,7 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/internal/hash/hash64 (; 73 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/hash/hash64 (; 87 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -5013,14 +8237,8 @@ local.set $3 local.get $3 ) - (func $~lib/internal/hash/HASH (; 74 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) - local.get $0 - call $~lib/internal/hash/hash64 - return - ) - (func $~lib/set/Set#find (; 75 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 88 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) (local $3 i32) - (local $4 i32) local.get $0 i32.load local.get $2 @@ -5030,55 +8248,58 @@ i32.const 4 i32.mul i32.add - i32.load offset=8 + i32.load local.set $3 block $break|0 loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - local.tee $4 - if (result i32) - local.get $3 - i64.load - local.get $1 - i64.eq - else - local.get $4 - end - if - local.get $3 - return - end + i64.load + local.get $1 + i64.eq + else + i32.const 0 + end + if local.get $3 - i32.load offset=8 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + return end + local.get $3 + i32.load offset=8 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/set/Set#has (; 76 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/set/Set#has (; 89 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (local $2 i64) local.get $0 local.get $1 - local.get $1 - call $~lib/internal/hash/HASH + block $~lib/util/hash/HASH|inlined.0 (result i32) + local.get $1 + local.set $2 + local.get $2 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.0 + end call $~lib/set/Set#find i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 77 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 90 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -5099,7 +8320,6 @@ local.get $2 i32.const 4 i32.mul - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $2 @@ -5114,13 +8334,10 @@ i32.const 16 end i32.mul - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $5 local.get $0 i32.load offset=8 - i32.const 8 - i32.add local.set $6 local.get $6 local.get $0 @@ -5132,8 +8349,6 @@ i32.add local.set $7 local.get $5 - i32.const 8 - i32.add local.set $8 block $break|0 loop $continue|0 @@ -5141,71 +8356,101 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + i64.load + i64.store + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 i64.load - i64.store - block $~lib/internal/hash/HASH|inlined.0 (result i32) - local.get $9 - i64.load - local.set $11 - local.get $11 - call $~lib/internal/hash/hash64 - br $~lib/internal/hash/HASH|inlined.0 - end - local.get $1 - i32.and - local.set $12 - local.get $3 - local.get $12 - i32.const 4 - i32.mul - i32.add - local.set $13 - local.get $10 - local.get $13 - i32.load offset=8 - i32.store offset=8 - local.get $13 - local.get $8 - i32.store offset=8 - local.get $8 - block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) - i32.const 16 - end - i32.add - local.set $8 + local.set $11 + local.get $11 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $12 + local.get $3 + local.get $12 + i32.const 4 + i32.mul + i32.add + local.set $13 + local.get $10 + local.get $13 + i32.load + i32.store offset=8 + local.get $13 + local.get $8 + i32.store + local.get $8 + block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) i32.const 16 end i32.add - local.set $6 + local.set $8 + end + local.get $6 + block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + i32.const 16 end + i32.add + local.set $6 br $continue|0 end end end local.get $0 - local.get $3 + local.tee $9 + block (result i32) + local.get $3 + local.tee $10 + local.get $9 + i32.load + local.tee $9 + i32.ne + if + local.get $10 + call $~lib/rt/pure/__retain + drop + local.get $9 + call $~lib/rt/pure/__release + end + local.get $10 + end i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $5 + local.tee $10 + block (result i32) + local.get $5 + local.tee $12 + local.get $10 + i32.load offset=8 + local.tee $10 + i32.ne + if + local.get $12 + call $~lib/rt/pure/__retain + drop + local.get $10 + call $~lib/rt/pure/__release + end + local.get $12 + end i32.store offset=8 local.get $0 local.get $4 @@ -5214,21 +8459,30 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release ) - (func $~lib/set/Set#add (; 78 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64) - (local $2 i32) + (func $~lib/set/Set#add (; 91 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64) + (local $2 i64) (local $3 i32) (local $4 i32) (local $5 i32) - local.get $1 - call $~lib/internal/hash/HASH - local.set $2 + block $~lib/util/hash/HASH|inlined.1 (result i32) + local.get $1 + local.set $2 + local.get $2 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.1 + end + local.set $3 local.get $0 local.get $1 - local.get $2 - call $~lib/set/Set#find - local.set $3 local.get $3 + call $~lib/set/Set#find + local.set $4 + local.get $4 i32.eqz if local.get $0 @@ -5262,10 +8516,6 @@ end local.get $0 i32.load offset=8 - local.set $4 - local.get $4 - i32.const 8 - i32.add block (result i32) local.get $0 local.get $0 @@ -5281,8 +8531,8 @@ end i32.mul i32.add - local.set $3 - local.get $3 + local.set $4 + local.get $4 local.get $1 i64.store local.get $0 @@ -5293,7 +8543,7 @@ i32.store offset=20 local.get $0 i32.load - local.get $2 + local.get $3 local.get $0 i32.load offset=4 i32.and @@ -5301,20 +8551,20 @@ i32.mul i32.add local.set $5 - local.get $3 + local.get $4 local.get $5 - i32.load offset=8 + i32.load i32.store offset=8 local.get $5 - local.get $3 - i32.store offset=8 + local.get $4 + i32.store end ) - (func $~lib/set/Set#get:size (; 79 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#get:size (; 92 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/set/Set#delete (; 80 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/set/Set#delete (; 93 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) (local $2 i64) (local $3 i32) (local $4 i32) @@ -5322,12 +8572,12 @@ (local $6 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.1 (result i32) + block $~lib/util/hash/HASH|inlined.3 (result i32) local.get $1 local.set $2 local.get $2 - call $~lib/internal/hash/hash64 - br $~lib/internal/hash/HASH|inlined.1 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.3 end call $~lib/set/Set#find local.set $3 @@ -5367,7 +8617,6 @@ i32.gt_u select i32.ge_u - local.tee $5 if (result i32) local.get $0 i32.load offset=20 @@ -5379,7 +8628,7 @@ i32.trunc_f64_s i32.lt_s else - local.get $5 + i32.const 0 end if local.get $0 @@ -5388,7 +8637,7 @@ end i32.const 1 ) - (func $std/set/test (; 81 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 94 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i64) i32.const 0 @@ -5403,35 +8652,33 @@ i64.lt_s i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 8 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 10 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i64.const 1 @@ -5449,10 +8696,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 12 + i32.const 376 + i32.const 10 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|1 @@ -5464,34 +8711,32 @@ i64.lt_s i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 16 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 18 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 14 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 16 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i64.const 1 @@ -5509,10 +8754,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 20 + i32.const 376 + i32.const 18 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|2 @@ -5524,36 +8769,34 @@ i64.lt_s i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 24 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 26 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 22 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 24 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i64.const 1 @@ -5571,10 +8814,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 28 + i32.const 376 + i32.const 26 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|3 @@ -5586,52 +8829,50 @@ i64.lt_s i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 32 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 34 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 36 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 32 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 34 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i64.const 1 @@ -5649,10 +8890,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 38 + i32.const 376 + i32.const 36 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -5664,19 +8905,30 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/set/Set#clear (; 82 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/set/Set#clear (; 95 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) local.get $0 - i32.const 0 - i32.const 16 - i32.const 0 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $1 + block (result i32) + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $2 + local.get $1 + i32.load + call $~lib/rt/pure/__release + local.get $2 + end i32.store local.get $0 i32.const 4 @@ -5684,10 +8936,17 @@ i32.sub i32.store offset=4 local.get $0 - i32.const 0 - i32.const 64 - i32.const 1 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $2 + block (result i32) + i32.const 0 + i32.const 64 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 + local.get $2 + i32.load offset=8 + call $~lib/rt/pure/__release + local.get $1 + end i32.store offset=8 local.get $0 i32.const 4 @@ -5699,13 +8958,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 83 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#constructor (; 96 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/memory/memory.allocate + i32.const 10 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.set $0 end local.get $0 @@ -5731,14 +8992,8 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/internal/hash/HASH (; 84 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) - local.get $0 - call $~lib/internal/hash/hash64 - return - ) - (func $~lib/set/Set#find (; 85 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 97 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) (local $3 i32) - (local $4 i32) local.get $0 i32.load local.get $2 @@ -5748,55 +9003,58 @@ i32.const 4 i32.mul i32.add - i32.load offset=8 + i32.load local.set $3 block $break|0 loop $continue|0 - local.get $3 - if - block - local.get $3 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - local.tee $4 - if (result i32) - local.get $3 - i64.load - local.get $1 - i64.eq - else - local.get $4 - end - if - local.get $3 - return - end + local.get $3 + if + local.get $3 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=8 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + i64.load + local.get $1 + i64.eq + else + i32.const 0 + end + if + local.get $3 + return end + local.get $3 + i32.load offset=8 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/set/Set#has (; 86 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/set/Set#has (; 98 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (local $2 i64) local.get $0 local.get $1 - local.get $1 - call $~lib/internal/hash/HASH + block $~lib/util/hash/HASH|inlined.0 (result i32) + local.get $1 + local.set $2 + local.get $2 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.0 + end call $~lib/set/Set#find i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 87 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 99 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -5817,7 +9075,6 @@ local.get $2 i32.const 4 i32.mul - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $2 @@ -5832,13 +9089,10 @@ i32.const 16 end i32.mul - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $5 local.get $0 i32.load offset=8 - i32.const 8 - i32.add local.set $6 local.get $6 local.get $0 @@ -5850,8 +9104,6 @@ i32.add local.set $7 local.get $5 - i32.const 8 - i32.add local.set $8 block $break|0 loop $continue|0 @@ -5859,71 +9111,101 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + i64.load + i64.store + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 i64.load - i64.store - block $~lib/internal/hash/HASH|inlined.0 (result i32) - local.get $9 - i64.load - local.set $11 - local.get $11 - call $~lib/internal/hash/hash64 - br $~lib/internal/hash/HASH|inlined.0 - end - local.get $1 - i32.and - local.set $12 - local.get $3 - local.get $12 - i32.const 4 - i32.mul - i32.add - local.set $13 - local.get $10 - local.get $13 - i32.load offset=8 - i32.store offset=8 - local.get $13 - local.get $8 - i32.store offset=8 - local.get $8 - block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) - i32.const 16 - end - i32.add - local.set $8 + local.set $11 + local.get $11 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $12 + local.get $3 + local.get $12 + i32.const 4 + i32.mul + i32.add + local.set $13 + local.get $10 + local.get $13 + i32.load + i32.store offset=8 + local.get $13 + local.get $8 + i32.store + local.get $8 + block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) i32.const 16 end i32.add - local.set $6 + local.set $8 + end + local.get $6 + block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + i32.const 16 end + i32.add + local.set $6 br $continue|0 end end end local.get $0 - local.get $3 + local.tee $9 + block (result i32) + local.get $3 + local.tee $10 + local.get $9 + i32.load + local.tee $9 + i32.ne + if + local.get $10 + call $~lib/rt/pure/__retain + drop + local.get $9 + call $~lib/rt/pure/__release + end + local.get $10 + end i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $5 + local.tee $10 + block (result i32) + local.get $5 + local.tee $12 + local.get $10 + i32.load offset=8 + local.tee $10 + i32.ne + if + local.get $12 + call $~lib/rt/pure/__retain + drop + local.get $10 + call $~lib/rt/pure/__release + end + local.get $12 + end i32.store offset=8 local.get $0 local.get $4 @@ -5932,21 +9214,30 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release ) - (func $~lib/set/Set#add (; 88 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64) - (local $2 i32) + (func $~lib/set/Set#add (; 100 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64) + (local $2 i64) (local $3 i32) (local $4 i32) (local $5 i32) - local.get $1 - call $~lib/internal/hash/HASH - local.set $2 + block $~lib/util/hash/HASH|inlined.1 (result i32) + local.get $1 + local.set $2 + local.get $2 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.1 + end + local.set $3 local.get $0 local.get $1 - local.get $2 - call $~lib/set/Set#find - local.set $3 local.get $3 + call $~lib/set/Set#find + local.set $4 + local.get $4 i32.eqz if local.get $0 @@ -5980,10 +9271,6 @@ end local.get $0 i32.load offset=8 - local.set $4 - local.get $4 - i32.const 8 - i32.add block (result i32) local.get $0 local.get $0 @@ -5999,8 +9286,8 @@ end i32.mul i32.add - local.set $3 - local.get $3 + local.set $4 + local.get $4 local.get $1 i64.store local.get $0 @@ -6011,7 +9298,7 @@ i32.store offset=20 local.get $0 i32.load - local.get $2 + local.get $3 local.get $0 i32.load offset=4 i32.and @@ -6019,20 +9306,20 @@ i32.mul i32.add local.set $5 - local.get $3 + local.get $4 local.get $5 - i32.load offset=8 + i32.load i32.store offset=8 local.get $5 - local.get $3 - i32.store offset=8 + local.get $4 + i32.store end ) - (func $~lib/set/Set#get:size (; 89 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#get:size (; 101 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/set/Set#delete (; 90 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/set/Set#delete (; 102 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) (local $2 i64) (local $3 i32) (local $4 i32) @@ -6040,12 +9327,12 @@ (local $6 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.1 (result i32) + block $~lib/util/hash/HASH|inlined.3 (result i32) local.get $1 local.set $2 local.get $2 - call $~lib/internal/hash/hash64 - br $~lib/internal/hash/HASH|inlined.1 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.3 end call $~lib/set/Set#find local.set $3 @@ -6085,7 +9372,6 @@ i32.gt_u select i32.ge_u - local.tee $5 if (result i32) local.get $0 i32.load offset=20 @@ -6097,7 +9383,7 @@ i32.trunc_f64_s i32.lt_s else - local.get $5 + i32.const 0 end if local.get $0 @@ -6106,7 +9392,7 @@ end i32.const 1 ) - (func $std/set/test (; 91 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 103 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i64) i32.const 0 @@ -6121,35 +9407,33 @@ i64.lt_u i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 8 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 10 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i64.const 1 @@ -6167,10 +9451,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 12 + i32.const 376 + i32.const 10 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|1 @@ -6182,34 +9466,32 @@ i64.lt_u i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 16 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 18 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 14 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 16 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i64.const 1 @@ -6227,10 +9509,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 20 + i32.const 376 + i32.const 18 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|2 @@ -6242,36 +9524,34 @@ i64.lt_u i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 24 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 26 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 22 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 24 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i64.const 1 @@ -6289,10 +9569,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 28 + i32.const 376 + i32.const 26 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|3 @@ -6304,52 +9584,50 @@ i64.lt_u i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 32 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 34 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 36 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 32 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 34 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 i64.const 1 @@ -6367,10 +9645,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 38 + i32.const 376 + i32.const 36 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -6382,19 +9660,30 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/set/Set#clear (; 92 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/set/Set#clear (; 104 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) local.get $0 - i32.const 0 - i32.const 16 - i32.const 0 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $1 + block (result i32) + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $2 + local.get $1 + i32.load + call $~lib/rt/pure/__release + local.get $2 + end i32.store local.get $0 i32.const 4 @@ -6402,10 +9691,17 @@ i32.sub i32.store offset=4 local.get $0 - i32.const 0 - i32.const 32 - i32.const 1 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $2 + block (result i32) + i32.const 0 + i32.const 32 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 + local.get $2 + i32.load offset=8 + call $~lib/rt/pure/__release + local.get $1 + end i32.store offset=8 local.get $0 i32.const 4 @@ -6417,13 +9713,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 93 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#constructor (; 105 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/memory/memory.allocate + i32.const 11 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.set $0 end local.get $0 @@ -6449,15 +9747,8 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/internal/hash/HASH (; 94 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) - local.get $0 - i32.reinterpret_f32 - call $~lib/internal/hash/hash32 - return - ) - (func $~lib/set/Set#find (; 95 ;) (type $FUNCSIG$iifi) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 106 ;) (type $FUNCSIG$iifi) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) (local $3 i32) - (local $4 i32) local.get $0 i32.load local.get $2 @@ -6467,55 +9758,59 @@ i32.const 4 i32.mul i32.add - i32.load offset=8 + i32.load local.set $3 block $break|0 loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz - local.tee $4 - if (result i32) - local.get $3 - f32.load - local.get $1 - f32.eq - else - local.get $4 - end - if - local.get $3 - return - end + f32.load + local.get $1 + f32.eq + else + i32.const 0 + end + if local.get $3 - i32.load offset=4 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + return end + local.get $3 + i32.load offset=4 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/set/Set#has (; 96 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) + (func $~lib/set/Set#has (; 107 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) + (local $2 f32) local.get $0 local.get $1 - local.get $1 - call $~lib/internal/hash/HASH + block $~lib/util/hash/HASH|inlined.0 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.reinterpret_f32 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.0 + end call $~lib/set/Set#find i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 97 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 108 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -6536,7 +9831,6 @@ local.get $2 i32.const 4 i32.mul - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $2 @@ -6551,13 +9845,10 @@ i32.const 8 end i32.mul - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $5 local.get $0 i32.load offset=8 - i32.const 8 - i32.add local.set $6 local.get $6 local.get $0 @@ -6569,8 +9860,6 @@ i32.add local.set $7 local.get $5 - i32.const 8 - i32.add local.set $8 block $break|0 loop $continue|0 @@ -6578,72 +9867,102 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=4 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + f32.load + f32.store + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 f32.load - f32.store - block $~lib/internal/hash/HASH|inlined.0 (result i32) - local.get $9 - f32.load - local.set $11 - local.get $11 - i32.reinterpret_f32 - call $~lib/internal/hash/hash32 - br $~lib/internal/hash/HASH|inlined.0 - end - local.get $1 - i32.and - local.set $12 - local.get $3 - local.get $12 - i32.const 4 - i32.mul - i32.add - local.set $13 - local.get $10 - local.get $13 - i32.load offset=8 - i32.store offset=4 - local.get $13 - local.get $8 - i32.store offset=8 - local.get $8 - block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) - i32.const 8 - end - i32.add - local.set $8 + local.set $11 + local.get $11 + i32.reinterpret_f32 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $12 + local.get $3 + local.get $12 + i32.const 4 + i32.mul + i32.add + local.set $13 + local.get $10 + local.get $13 + i32.load + i32.store offset=4 + local.get $13 + local.get $8 + i32.store + local.get $8 + block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) i32.const 8 end i32.add - local.set $6 + local.set $8 + end + local.get $6 + block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + i32.const 8 end + i32.add + local.set $6 br $continue|0 end end end local.get $0 - local.get $3 + local.tee $9 + block (result i32) + local.get $3 + local.tee $10 + local.get $9 + i32.load + local.tee $9 + i32.ne + if + local.get $10 + call $~lib/rt/pure/__retain + drop + local.get $9 + call $~lib/rt/pure/__release + end + local.get $10 + end i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $5 + local.tee $10 + block (result i32) + local.get $5 + local.tee $12 + local.get $10 + i32.load offset=8 + local.tee $10 + i32.ne + if + local.get $12 + call $~lib/rt/pure/__retain + drop + local.get $10 + call $~lib/rt/pure/__release + end + local.get $12 + end i32.store offset=8 local.get $0 local.get $4 @@ -6652,21 +9971,31 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release ) - (func $~lib/set/Set#add (; 98 ;) (type $FUNCSIG$vif) (param $0 i32) (param $1 f32) - (local $2 i32) + (func $~lib/set/Set#add (; 109 ;) (type $FUNCSIG$vif) (param $0 i32) (param $1 f32) + (local $2 f32) (local $3 i32) (local $4 i32) (local $5 i32) - local.get $1 - call $~lib/internal/hash/HASH - local.set $2 + block $~lib/util/hash/HASH|inlined.1 (result i32) + local.get $1 + local.set $2 + local.get $2 + i32.reinterpret_f32 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.1 + end + local.set $3 local.get $0 local.get $1 - local.get $2 - call $~lib/set/Set#find - local.set $3 local.get $3 + call $~lib/set/Set#find + local.set $4 + local.get $4 i32.eqz if local.get $0 @@ -6700,10 +10029,6 @@ end local.get $0 i32.load offset=8 - local.set $4 - local.get $4 - i32.const 8 - i32.add block (result i32) local.get $0 local.get $0 @@ -6719,8 +10044,8 @@ end i32.mul i32.add - local.set $3 - local.get $3 + local.set $4 + local.get $4 local.get $1 f32.store local.get $0 @@ -6731,7 +10056,7 @@ i32.store offset=20 local.get $0 i32.load - local.get $2 + local.get $3 local.get $0 i32.load offset=4 i32.and @@ -6739,20 +10064,20 @@ i32.mul i32.add local.set $5 - local.get $3 + local.get $4 local.get $5 - i32.load offset=8 + i32.load i32.store offset=4 local.get $5 - local.get $3 - i32.store offset=8 + local.get $4 + i32.store end ) - (func $~lib/set/Set#get:size (; 99 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#get:size (; 110 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/set/Set#delete (; 100 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) + (func $~lib/set/Set#delete (; 111 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) (local $2 f32) (local $3 i32) (local $4 i32) @@ -6760,13 +10085,13 @@ (local $6 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.1 (result i32) + block $~lib/util/hash/HASH|inlined.3 (result i32) local.get $1 local.set $2 local.get $2 i32.reinterpret_f32 - call $~lib/internal/hash/hash32 - br $~lib/internal/hash/HASH|inlined.1 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.3 end call $~lib/set/Set#find local.set $3 @@ -6806,7 +10131,6 @@ i32.gt_u select i32.ge_u - local.tee $5 if (result i32) local.get $0 i32.load offset=20 @@ -6818,7 +10142,7 @@ i32.trunc_f64_s i32.lt_s else - local.get $5 + i32.const 0 end if local.get $0 @@ -6827,7 +10151,7 @@ end i32.const 1 ) - (func $std/set/test (; 101 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 112 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 f32) i32.const 0 @@ -6842,35 +10166,33 @@ f32.lt i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 8 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 10 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 f32.const 1 @@ -6888,10 +10210,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 12 + i32.const 376 + i32.const 10 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|1 @@ -6903,34 +10225,32 @@ f32.lt i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 16 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 18 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 14 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 16 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 f32.const 1 @@ -6948,10 +10268,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 20 + i32.const 376 + i32.const 18 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|2 @@ -6962,37 +10282,35 @@ f32.const 50 f32.lt i32.eqz - br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 24 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 26 - i32.const 4 - call $~lib/env/abort - unreachable - end + br_if $break|2 + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 22 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 24 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 f32.const 1 @@ -7010,10 +10328,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 28 + i32.const 376 + i32.const 26 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|3 @@ -7025,52 +10343,50 @@ f32.lt i32.eqz br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 32 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 34 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 36 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 32 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 34 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 f32.const 1 @@ -7088,10 +10404,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 38 + i32.const 376 + i32.const 36 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -7103,19 +10419,30 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 42 + i32.const 376 + i32.const 40 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/set/Set#clear (; 102 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/set/Set#clear (; 113 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) local.get $0 - i32.const 0 - i32.const 16 - i32.const 0 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $1 + block (result i32) + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $2 + local.get $1 + i32.load + call $~lib/rt/pure/__release + local.get $2 + end i32.store local.get $0 i32.const 4 @@ -7123,10 +10450,17 @@ i32.sub i32.store offset=4 local.get $0 - i32.const 0 - i32.const 64 - i32.const 1 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $2 + block (result i32) + i32.const 0 + i32.const 64 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 + local.get $2 + i32.load offset=8 + call $~lib/rt/pure/__release + local.get $1 + end i32.store offset=8 local.get $0 i32.const 4 @@ -7138,13 +10472,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 103 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#constructor (; 114 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/memory/memory.allocate + i32.const 12 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.set $0 end local.get $0 @@ -7170,15 +10506,8 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/internal/hash/HASH (; 104 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) - local.get $0 - i64.reinterpret_f64 - call $~lib/internal/hash/hash64 - return - ) - (func $~lib/set/Set#find (; 105 ;) (type $FUNCSIG$iidi) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 115 ;) (type $FUNCSIG$iidi) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) (local $3 i32) - (local $4 i32) local.get $0 i32.load local.get $2 @@ -7188,55 +10517,59 @@ i32.const 4 i32.mul i32.add - i32.load offset=8 + i32.load local.set $3 block $break|0 loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - local.tee $4 - if (result i32) - local.get $3 - f64.load - local.get $1 - f64.eq - else - local.get $4 - end - if - local.get $3 - return - end + f64.load + local.get $1 + f64.eq + else + i32.const 0 + end + if local.get $3 - i32.load offset=8 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + return end + local.get $3 + i32.load offset=8 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/set/Set#has (; 106 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/set/Set#has (; 116 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (local $2 f64) local.get $0 local.get $1 - local.get $1 - call $~lib/internal/hash/HASH + block $~lib/util/hash/HASH|inlined.0 (result i32) + local.get $1 + local.set $2 + local.get $2 + i64.reinterpret_f64 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.0 + end call $~lib/set/Set#find i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 107 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 117 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -7257,7 +10590,6 @@ local.get $2 i32.const 4 i32.mul - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $2 @@ -7272,13 +10604,10 @@ i32.const 16 end i32.mul - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $5 local.get $0 i32.load offset=8 - i32.const 8 - i32.add local.set $6 local.get $6 local.get $0 @@ -7290,8 +10619,6 @@ i32.add local.set $7 local.get $5 - i32.const 8 - i32.add local.set $8 block $break|0 loop $continue|0 @@ -7299,72 +10626,102 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + f64.load + f64.store + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $9 f64.load - f64.store - block $~lib/internal/hash/HASH|inlined.0 (result i32) - local.get $9 - f64.load - local.set $11 - local.get $11 - i64.reinterpret_f64 - call $~lib/internal/hash/hash64 - br $~lib/internal/hash/HASH|inlined.0 - end - local.get $1 - i32.and - local.set $12 - local.get $3 - local.get $12 - i32.const 4 - i32.mul - i32.add - local.set $13 - local.get $10 - local.get $13 - i32.load offset=8 - i32.store offset=8 - local.get $13 - local.get $8 - i32.store offset=8 - local.get $8 - block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) - i32.const 16 - end - i32.add - local.set $8 + local.set $11 + local.get $11 + i64.reinterpret_f64 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.2 end - local.get $6 - block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $12 + local.get $3 + local.get $12 + i32.const 4 + i32.mul + i32.add + local.set $13 + local.get $10 + local.get $13 + i32.load + i32.store offset=8 + local.get $13 + local.get $8 + i32.store + local.get $8 + block $~lib/set/ENTRY_SIZE|inlined.3 (result i32) i32.const 16 end i32.add - local.set $6 + local.set $8 end + local.get $6 + block $~lib/set/ENTRY_SIZE|inlined.4 (result i32) + i32.const 16 + end + i32.add + local.set $6 br $continue|0 end end end local.get $0 - local.get $3 + local.tee $9 + block (result i32) + local.get $3 + local.tee $10 + local.get $9 + i32.load + local.tee $9 + i32.ne + if + local.get $10 + call $~lib/rt/pure/__retain + drop + local.get $9 + call $~lib/rt/pure/__release + end + local.get $10 + end i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $5 + local.tee $10 + block (result i32) + local.get $5 + local.tee $12 + local.get $10 + i32.load offset=8 + local.tee $10 + i32.ne + if + local.get $12 + call $~lib/rt/pure/__retain + drop + local.get $10 + call $~lib/rt/pure/__release + end + local.get $12 + end i32.store offset=8 local.get $0 local.get $4 @@ -7373,21 +10730,31 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release ) - (func $~lib/set/Set#add (; 108 ;) (type $FUNCSIG$vid) (param $0 i32) (param $1 f64) - (local $2 i32) + (func $~lib/set/Set#add (; 118 ;) (type $FUNCSIG$vid) (param $0 i32) (param $1 f64) + (local $2 f64) (local $3 i32) (local $4 i32) (local $5 i32) - local.get $1 - call $~lib/internal/hash/HASH - local.set $2 + block $~lib/util/hash/HASH|inlined.1 (result i32) + local.get $1 + local.set $2 + local.get $2 + i64.reinterpret_f64 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.1 + end + local.set $3 local.get $0 local.get $1 - local.get $2 - call $~lib/set/Set#find - local.set $3 local.get $3 + call $~lib/set/Set#find + local.set $4 + local.get $4 i32.eqz if local.get $0 @@ -7421,10 +10788,6 @@ end local.get $0 i32.load offset=8 - local.set $4 - local.get $4 - i32.const 8 - i32.add block (result i32) local.get $0 local.get $0 @@ -7440,8 +10803,8 @@ end i32.mul i32.add - local.set $3 - local.get $3 + local.set $4 + local.get $4 local.get $1 f64.store local.get $0 @@ -7452,7 +10815,7 @@ i32.store offset=20 local.get $0 i32.load - local.get $2 + local.get $3 local.get $0 i32.load offset=4 i32.and @@ -7460,20 +10823,20 @@ i32.mul i32.add local.set $5 - local.get $3 + local.get $4 local.get $5 - i32.load offset=8 + i32.load i32.store offset=8 local.get $5 - local.get $3 - i32.store offset=8 + local.get $4 + i32.store end ) - (func $~lib/set/Set#get:size (; 109 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#get:size (; 119 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/set/Set#delete (; 110 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/set/Set#delete (; 120 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) (local $2 f64) (local $3 i32) (local $4 i32) @@ -7481,13 +10844,13 @@ (local $6 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.1 (result i32) + block $~lib/util/hash/HASH|inlined.3 (result i32) local.get $1 local.set $2 local.get $2 i64.reinterpret_f64 - call $~lib/internal/hash/hash64 - br $~lib/internal/hash/HASH|inlined.1 + call $~lib/util/hash/hash64 + br $~lib/util/hash/HASH|inlined.3 end call $~lib/set/Set#find local.set $3 @@ -7527,7 +10890,6 @@ i32.gt_u select i32.ge_u - local.tee $5 if (result i32) local.get $0 i32.load offset=20 @@ -7539,7 +10901,7 @@ i32.trunc_f64_s i32.lt_s else - local.get $5 + i32.const 0 end if local.get $0 @@ -7548,7 +10910,7 @@ end i32.const 1 ) - (func $std/set/test (; 111 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 121 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 f64) i32.const 0 @@ -7563,35 +10925,33 @@ f64.lt i32.eqz br_if $break|0 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 8 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 10 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 6 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 8 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 f64.const 1 @@ -7609,10 +10969,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 12 + i32.const 376 + i32.const 10 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|1 @@ -7624,34 +10984,32 @@ f64.lt i32.eqz br_if $break|1 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 16 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 18 - i32.const 4 - call $~lib/env/abort - unreachable - end + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 14 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 16 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $1 f64.const 1 @@ -7669,10 +11027,10 @@ i32.eqz if i32.const 0 - i32.const 120 - i32.const 20 + i32.const 376 + i32.const 18 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block $break|2 @@ -7684,169 +11042,806 @@ f64.lt i32.eqz br_if $break|2 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 24 - i32.const 4 - call $~lib/env/abort + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 22 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 24 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $1 + f64.const 1 + f64.add + local.set $1 + br $repeat|2 + unreachable + end + unreachable + end + local.get $0 + call $~lib/set/Set#get:size + i32.const 50 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 26 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block $break|3 + f64.const 0 + local.set $1 + loop $repeat|3 + local.get $1 + f64.const 50 + f64.lt + i32.eqz + br_if $break|3 + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 30 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#add + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 32 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.get $1 + call $~lib/set/Set#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 34 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $1 + f64.const 1 + f64.add + local.set $1 + br $repeat|3 + unreachable + end + unreachable + end + local.get $0 + call $~lib/set/Set#get:size + i32.const 50 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 36 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/set/Set#clear + local.get $0 + call $~lib/set/Set#get:size + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 376 + i32.const 40 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/pure/__release + ) + (func $start:std/set (; 122 ;) (type $FUNCSIG$v) + call $std/set/testNumeric + call $std/set/testNumeric + call $std/set/testNumeric + call $std/set/testNumeric + call $std/set/testNumeric + call $std/set/testNumeric + call $std/set/testNumeric + call $std/set/testNumeric + call $std/set/testNumeric + call $std/set/testNumeric + ) + (func $start (; 123 ;) (type $FUNCSIG$v) + call $start:std/set + ) + (func $~lib/rt/pure/markGray (; 124 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members + end + ) + (func $~lib/rt/pure/scanBlack (; 125 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 126 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (; 127 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + ) + (func $~lib/rt/pure/__visit (; 128 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/pure/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 75 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/pure/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/scan + br $break|0 + unreachable + end unreachable end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 86 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and i32.const 0 - i32.const 120 - i32.const 26 - i32.const 4 - call $~lib/env/abort + i32.ne + if + local.get $2 + call $~lib/rt/pure/scanBlack + end + br $break|0 unreachable end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/collectWhite + br $break|0 + unreachable end - local.get $1 - f64.const 1 - f64.add - local.set $1 - br $repeat|2 unreachable end - unreachable - end - local.get $0 - call $~lib/set/Set#get:size - i32.const 50 - i32.eq - i32.eqz - if i32.const 0 - i32.const 120 - i32.const 28 - i32.const 2 - call $~lib/env/abort - unreachable + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 97 + i32.const 24 + call $~lib/builtins/abort + unreachable + end end - block $break|3 - f64.const 0 - local.set $1 - loop $repeat|3 - local.get $1 - f64.const 50 - f64.lt - i32.eqz - br_if $break|3 - block - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 32 - i32.const 4 - call $~lib/env/abort + ) + (func $~lib/set/Set#__visit_impl (; 129 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/pure/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + ) + (func $~lib/set/Set#__visit_impl (; 130 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/pure/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + ) + (func $~lib/set/Set#__visit_impl (; 131 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/pure/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + ) + (func $~lib/set/Set#__visit_impl (; 132 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/pure/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + ) + (func $~lib/set/Set#__visit_impl (; 133 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/pure/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + ) + (func $~lib/set/Set#__visit_impl (; 134 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/pure/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + ) + (func $~lib/set/Set#__visit_impl (; 135 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/pure/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + ) + (func $~lib/set/Set#__visit_impl (; 136 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/pure/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + ) + (func $~lib/set/Set#__visit_impl (; 137 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/pure/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + ) + (func $~lib/set/Set#__visit_impl (; 138 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.get $1 + call $~lib/rt/pure/__visit + local.get $0 + i32.load offset=8 + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + ) + (func $~lib/rt/__visit_members (; 139 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block + end + block $switch$1$leave + block $switch$1$default + block $switch$1$case$14 + block $switch$1$case$13 + block $switch$1$case$12 + block $switch$1$case$11 + block $switch$1$case$10 + block $switch$1$case$9 + block $switch$1$case$8 + block $switch$1$case$7 + block $switch$1$case$6 + block $switch$1$case$5 + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$case$5 $switch$1$case$6 $switch$1$case$7 $switch$1$case$8 $switch$1$case$9 $switch$1$case$10 $switch$1$case$11 $switch$1$case$12 $switch$1$case$13 $switch$1$case$14 $switch$1$default + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/set/Set#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/set/Set#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/set/Set#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/set/Set#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/set/Set#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/set/Set#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/set/Set#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/set/Set#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end unreachable end - local.get $0 - local.get $1 - call $~lib/set/Set#add - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 34 - i32.const 4 - call $~lib/env/abort + block + block + block + local.get $0 + local.get $1 + call $~lib/set/Set#__visit_impl + return + unreachable + end + unreachable + unreachable + end + unreachable unreachable end - local.get $0 - local.get $1 - call $~lib/set/Set#delete - drop - local.get $0 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 36 - i32.const 4 - call $~lib/env/abort + unreachable + end + block + block + block + local.get $0 + local.get $1 + call $~lib/set/Set#__visit_impl + return + unreachable + end + unreachable unreachable end + unreachable + unreachable end - local.get $1 - f64.const 1 - f64.add - local.set $1 - br $repeat|3 + unreachable + end + block + block + unreachable + unreachable + end + unreachable unreachable end unreachable end - local.get $0 - call $~lib/set/Set#get:size - i32.const 50 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 38 - i32.const 2 - call $~lib/env/abort - unreachable - end - local.get $0 - call $~lib/set/Set#clear - local.get $0 - call $~lib/set/Set#get:size - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 120 - i32.const 42 - i32.const 2 - call $~lib/env/abort - unreachable - end - ) - (func $start:std/set (; 112 ;) (type $FUNCSIG$v) - call $start:~lib/allocator/arena - call $std/set/test - call $std/set/test - call $std/set/test - call $std/set/test - call $std/set/test - call $std/set/test - call $std/set/test - call $std/set/test - call $std/set/test - call $std/set/test - ) - (func $start (; 113 ;) (type $FUNCSIG$v) - call $start:std/set ) - (func $null (; 114 ;) (type $FUNCSIG$v) + (func $null (; 140 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/std/simd.json b/tests/compiler/std/simd.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/std/simd.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/std/simd.optimized.wat b/tests/compiler/std/simd.optimized.wat index 587c7142d7..bb456a1172 100644 --- a/tests/compiler/std/simd.optimized.wat +++ b/tests/compiler/std/simd.optimized.wat @@ -1,10 +1,7 @@ (module (type $FUNCSIG$v (func)) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $null) (export "memory" (memory $0)) - (export "table" (table $0)) (func $null (; 0 ;) (type $FUNCSIG$v) nop ) diff --git a/tests/compiler/std/simd.untouched.wat b/tests/compiler/std/simd.untouched.wat index 2f0347c4aa..9f14327565 100644 --- a/tests/compiler/std/simd.untouched.wat +++ b/tests/compiler/std/simd.untouched.wat @@ -4,9 +4,7 @@ (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/ASC_FEATURE_SIMD i32 (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (func $null (; 0 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/std/static-array.json b/tests/compiler/std/static-array.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/std/static-array.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/std/static-array.optimized.wat b/tests/compiler/std/static-array.optimized.wat index 5c605936bb..0fc9400f9a 100644 --- a/tests/compiler/std/static-array.optimized.wat +++ b/tests/compiler/std/static-array.optimized.wat @@ -1,44 +1,70 @@ (module - (type $FUNCSIG$v (func)) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$v (func)) (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$vii (func (param i32 i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (type $FUNCSIG$ji (func (param i32) (result i64))) + (type $FUNCSIG$fi (func (param i32) (result f32))) + (type $FUNCSIG$di (func (param i32) (result f64))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\08\00\00\00\00\00\00\00\01\00\00\00\02") - (data (i32.const 24) "\08\00\00\00\02") - (data (i32.const 32) "\10\00\00\00\00\00\00\00\03\00\00\00\00\00\00\00\04") - (data (i32.const 64) " \00\00\00\02") - (data (i32.const 72) "\08") - (data (i32.const 82) "\c0?\00\00 @") - (data (i32.const 88) "H\00\00\00\02") - (data (i32.const 96) "\10") - (data (i32.const 110) "\f4?\00\00\00\00\00\00\02@") - (data (i32.const 128) "`\00\00\00\02") - (data (i32.const 136) "\13\00\00\00s\00t\00d\00/\00s\00t\00a\00t\00i\00c\00-\00a\00r\00r\00a\00y\00.\00t\00s") - (data (i32.const 184) "\0d\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s") - (data (i32.const 216) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) + (data (i32.const 8) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\01\00\00\00\02") + (data (i32.const 32) "\10\00\00\00\01\00\00\00\03\00\00\00\10\00\00\00\18\00\00\00\18\00\00\00\08\00\00\00\02") + (data (i32.const 64) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\03\00\00\00\00\00\00\00\04") + (data (i32.const 96) "\10\00\00\00\01\00\00\00\04\00\00\00\10\00\00\00P\00\00\00P\00\00\00\10\00\00\00\02") + (data (i32.const 128) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\00\00\c0?\00\00 @") + (data (i32.const 152) "\10\00\00\00\01\00\00\00\05\00\00\00\10\00\00\00\90\00\00\00\90\00\00\00\08\00\00\00\02") + (data (i32.const 184) "\10\00\00\00\01\00\00\00\00\00\00\00\10") + (data (i32.const 206) "\f4?\00\00\00\00\00\00\02@") + (data (i32.const 216) "\10\00\00\00\01\00\00\00\06\00\00\00\10\00\00\00\c8\00\00\00\c8\00\00\00\10\00\00\00\02") + (data (i32.const 248) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\00s\00t\00d\00/\00s\00t\00a\00t\00i\00c\00-\00a\00r\00r\00a\00y\00.\00t\00s") + (data (i32.const 304) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e") + (data (i32.const 360) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s") + (data (i32.const 408) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h") + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) - (func $~lib/allocator/arena/__memory_allocate (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/array/Array#__get (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 56 + i32.load + i32.const 2 + i32.shr_u + i32.ge_u + if + i32.const 320 + i32.const 376 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort + unreachable + end + i32.const 52 + i32.load + local.get $0 + i32.const 2 + i32.shl + i32.add + i32.load + ) + (func $~lib/rt/stub/__alloc (; 2 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) + (local $4 i32) + (local $5 i32) local.get $0 - i32.const 1073741824 + i32.const 1073741808 i32.gt_u if unreachable end - global.get $~lib/allocator/arena/offset - local.tee $1 + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.tee $3 local.get $0 i32.const 1 local.get $0 @@ -46,20 +72,20 @@ i32.gt_u select i32.add - i32.const 7 + i32.const 15 i32.add - i32.const -8 + i32.const -16 i32.and - local.tee $0 - current_memory local.tee $2 + memory.size + local.tee $4 i32.const 16 i32.shl i32.gt_u if + local.get $4 local.get $2 - local.get $0 - local.get $1 + local.get $3 i32.sub i32.const 65535 i32.add @@ -67,17 +93,17 @@ i32.and i32.const 16 i32.shr_u - local.tee $3 - local.get $2 - local.get $3 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select - grow_memory + memory.grow i32.const 0 i32.lt_s if - local.get $3 - grow_memory + local.get $5 + memory.grow i32.const 0 i32.lt_s if @@ -85,1842 +111,847 @@ end end end - local.get $0 - global.set $~lib/allocator/arena/offset - local.get $1 - ) - (func $~lib/internal/arraybuffer/allocateUnsafe (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - local.get $0 - i32.const 1073741816 - i32.gt_u - if - i32.const 0 - i32.const 216 - i32.const 26 - i32.const 2 - call $~lib/env/abort - unreachable - end - i32.const 1 - i32.const 32 - local.get $0 - i32.const 7 - i32.add - i32.clz + local.get $2 + global.set $~lib/rt/stub/offset + local.get $3 + i32.const 16 i32.sub - i32.shl - call $~lib/allocator/arena/__memory_allocate - local.tee $1 - local.get $0 - i32.store + local.tee $2 local.get $1 + i32.store offset=8 + local.get $2 + local.get $0 + i32.store offset=12 + local.get $3 ) - (func $~lib/internal/memory/memcpy (; 3 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/memory/memory.copy (; 3 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - loop $continue|0 - local.get $1 - i32.const 3 - i32.and - local.get $2 - local.get $2 - select - if - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - br $continue|0 - end - end - local.get $0 - i32.const 3 - i32.and - i32.eqz - if - loop $continue|1 - local.get $2 - i32.const 16 - i32.ge_u - if - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $1 - i32.const 4 - i32.add - i32.load - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $1 - i32.const 8 - i32.add - i32.load - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 12 - i32.add - i32.load - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - br $continue|1 - end - end - local.get $2 - i32.const 8 - i32.and - if - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $1 - i32.const 4 - i32.add - i32.load - i32.store - local.get $1 - i32.const 8 - i32.add - local.set $1 - local.get $0 - i32.const 8 - i32.add - local.set $0 - end - local.get $2 - i32.const 4 - i32.and - if - local.get $0 - local.get $1 - i32.load - i32.store - local.get $1 - i32.const 4 - i32.add - local.set $1 - local.get $0 - i32.const 4 - i32.add - local.set $0 - end + block $~lib/util/memory/memmove|inlined.0 local.get $2 - i32.const 2 - i32.and + local.set $3 + local.get $0 + local.get $1 + i32.eq + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $1 + i32.lt_u if - local.get $0 - local.get $1 - i32.load16_u - i32.store16 local.get $1 - i32.const 2 - i32.add - local.set $1 - local.get $0 - i32.const 2 - i32.add - local.set $0 - end - local.get $2 - i32.const 1 - i32.and - if + i32.const 7 + i32.and local.get $0 - local.get $1 - i32.load8_u - i32.store8 - end - return - end - local.get $2 - i32.const 32 - i32.ge_u - if - block $break|2 - block $case2|2 - block $case1|2 + i32.const 7 + i32.and + i32.eq + if + loop $continue|0 local.get $0 - i32.const 3 + i32.const 7 i32.and - local.tee $3 - i32.const 1 - i32.ne if local.get $3 - i32.const 2 - i32.eq - br_if $case1|2 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 local.get $3 - i32.const 3 - i32.eq - br_if $case2|2 - br $break|2 + i32.const 1 + i32.sub + local.set $3 + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + br $continue|0 end - local.get $1 - i32.load - local.set $5 - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 + end + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $1 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + br $continue|1 + end + end + end + loop $continue|2 + local.get $3 + if local.get $0 - i32.const 1 - i32.add - local.tee $3 + local.tee $2 i32.const 1 i32.add local.set $0 local.get $1 - i32.const 1 - i32.add local.tee $4 i32.const 1 i32.add local.set $1 - local.get $3 + local.get $2 local.get $4 i32.load8_u i32.store8 - local.get $2 - i32.const 3 + local.get $3 + i32.const 1 i32.sub - local.set $2 - loop $continue|3 - local.get $2 - i32.const 17 - i32.ge_u - if - local.get $0 - local.get $1 - i32.const 1 - i32.add - i32.load - local.tee $3 - i32.const 8 - i32.shl - local.get $5 - i32.const 24 - i32.shr_u - i32.or - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $3 - i32.const 24 - i32.shr_u - local.get $1 - i32.const 5 - i32.add - i32.load - local.tee $3 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $3 - i32.const 24 - i32.shr_u - local.get $1 - i32.const 9 - i32.add - i32.load - local.tee $3 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 13 - i32.add - i32.load - local.tee $5 - i32.const 8 - i32.shl - local.get $3 - i32.const 24 - i32.shr_u - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - br $continue|3 - end - end - br $break|2 + local.set $3 + br $continue|2 end - local.get $1 - i32.load - local.set $5 - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 2 - i32.sub - local.set $2 - loop $continue|4 - local.get $2 - i32.const 18 - i32.ge_u + end + else + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|3 + local.get $0 + local.get $3 + i32.add + i32.const 7 + i32.and if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 local.get $0 - local.get $1 - i32.const 2 - i32.add - i32.load + local.get $3 + i32.const 1 + i32.sub local.tee $3 - i32.const 16 - i32.shl - local.get $5 - i32.const 16 - i32.shr_u - i32.or - i32.store - local.get $0 - i32.const 4 i32.add - local.get $3 - i32.const 16 - i32.shr_u local.get $1 - i32.const 6 + local.get $3 i32.add - i32.load - local.tee $3 - i32.const 16 - i32.shl - i32.or - i32.store + i32.load8_u + i32.store8 + br $continue|3 + end + end + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if local.get $0 - i32.const 8 - i32.add local.get $3 - i32.const 16 - i32.shr_u - local.get $1 - i32.const 10 - i32.add - i32.load + i32.const 8 + i32.sub local.tee $3 - i32.const 16 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 12 i32.add local.get $1 - i32.const 14 - i32.add - i32.load - local.tee $5 - i32.const 16 - i32.shl local.get $3 - i32.const 16 - i32.shr_u - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 + i64.load + i64.store br $continue|4 end end - br $break|2 end - local.get $1 - i32.load - local.set $5 - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 loop $continue|5 - local.get $2 - i32.const 19 - i32.ge_u + local.get $3 if local.get $0 - local.get $1 - i32.const 3 - i32.add - i32.load - local.tee $3 - i32.const 24 - i32.shl - local.get $5 - i32.const 8 - i32.shr_u - i32.or - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $3 - i32.const 8 - i32.shr_u - local.get $1 - i32.const 7 - i32.add - i32.load - local.tee $3 - i32.const 24 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 8 - i32.add local.get $3 - i32.const 8 - i32.shr_u - local.get $1 - i32.const 11 - i32.add - i32.load + i32.const 1 + i32.sub local.tee $3 - i32.const 24 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 12 i32.add local.get $1 - i32.const 15 - i32.add - i32.load - local.tee $5 - i32.const 24 - i32.shl local.get $3 - i32.const 8 - i32.shr_u - i32.or - i32.store - local.get $1 - i32.const 16 i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 + i32.load8_u + i32.store8 br $continue|5 end end end end - local.get $2 + ) + (func $~lib/rt/stub/__realloc (; 4 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + local.get $0 i32.const 16 - i32.and + i32.sub + local.tee $2 + i32.load offset=12 + local.tee $3 + i32.gt_u if - local.get $0 local.get $1 - i32.load8_u - i32.store8 + local.get $2 + i32.load offset=8 + call $~lib/rt/stub/__alloc + local.tee $1 local.get $0 - i32.const 1 - i32.add - local.tee $0 + local.get $3 + call $~lib/memory/memory.copy local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u + local.set $0 + else + local.get $2 + local.get $1 + i32.store offset=12 + end + local.get $0 + ) + (func $~lib/memory/memory.fill (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.eqz + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 0 i32.store8 local.get $0 - i32.const 1 - i32.add - local.tee $0 local.get $1 - i32.const 1 i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 i32.const 1 - i32.add - local.tee $0 + i32.sub + i32.const 0 + i32.store8 local.get $1 + i32.const 2 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 i32.const 1 i32.add - local.tee $1 - i32.load8_u + i32.const 0 i32.store8 local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 + i32.const 2 i32.add - local.tee $1 - i32.load8_u + i32.const 0 i32.store8 local.get $0 - i32.const 1 - i32.add - local.tee $0 local.get $1 - i32.const 1 i32.add - local.tee $1 - i32.load8_u + local.tee $2 + i32.const 2 + i32.sub + i32.const 0 + i32.store8 + local.get $2 + i32.const 3 + i32.sub + i32.const 0 i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 local.get $1 - i32.const 1 + i32.const 6 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 3 i32.add - local.tee $1 - i32.load8_u + i32.const 0 i32.store8 local.get $0 - i32.const 1 - i32.add - local.tee $0 local.get $1 - i32.const 1 i32.add - local.tee $1 - i32.load8_u + i32.const 4 + i32.sub + i32.const 0 i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 local.get $1 - i32.const 1 - i32.add + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + local.get $0 + i32.sub + i32.const 3 + i32.and local.tee $1 - i32.load8_u - i32.store8 + i32.sub + local.set $2 local.get $0 - i32.const 1 - i32.add - local.tee $0 local.get $1 - i32.const 1 i32.add + local.tee $0 + i32.const 0 + i32.store + local.get $2 + i32.const -4 + i32.and local.tee $1 - i32.load8_u - i32.store8 local.get $0 - i32.const 1 i32.add - local.tee $0 + i32.const 4 + i32.sub + i32.const 0 + i32.store local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 local.get $0 - i32.const 1 + i32.const 4 i32.add - local.tee $0 - local.get $1 - i32.const 1 + i32.const 0 + i32.store + local.get $0 + i32.const 8 i32.add - local.tee $1 - i32.load8_u - i32.store8 + i32.const 0 + i32.store local.get $0 - i32.const 1 + local.get $1 i32.add - local.tee $0 + local.tee $2 + i32.const 12 + i32.sub + i32.const 0 + i32.store + local.get $2 + i32.const 8 + i32.sub + i32.const 0 + i32.store local.get $1 - i32.const 1 + i32.const 24 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 12 i32.add - local.tee $1 - i32.load8_u - i32.store8 + i32.const 0 + i32.store local.get $0 - i32.const 1 + i32.const 16 i32.add - local.tee $0 - local.get $1 - i32.const 1 + i32.const 0 + i32.store + local.get $0 + i32.const 20 i32.add - local.tee $1 - i32.load8_u - i32.store8 + i32.const 0 + i32.store local.get $0 - i32.const 1 + i32.const 24 i32.add - local.tee $0 + i32.const 0 + i32.store + local.get $0 local.get $1 - i32.const 1 i32.add - local.tee $1 - i32.load8_u - i32.store8 + local.tee $2 + i32.const 28 + i32.sub + i32.const 0 + i32.store + local.get $2 + i32.const 24 + i32.sub + i32.const 0 + i32.store + local.get $2 + i32.const 20 + i32.sub + i32.const 0 + i32.store + local.get $2 + i32.const 16 + i32.sub + i32.const 0 + i32.store local.get $0 - i32.const 1 + i32.const 4 + i32.and + i32.const 24 i32.add - local.tee $3 - i32.const 1 + local.tee $2 + local.get $0 i32.add local.set $0 local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - end - local.get $2 - i32.const 8 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - end - local.get $2 - i32.const 4 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - end - local.get $2 - i32.const 2 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - end - local.get $2 - i32.const 1 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - end - ) - (func $~lib/internal/memory/memmove (; 4 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - local.get $0 - local.get $1 - i32.eq - if - return - end - local.get $1 - local.get $2 - i32.add - local.get $0 - i32.le_u - local.tee $3 - i32.eqz - if - local.get $0 local.get $2 - i32.add - local.get $1 - i32.le_u - local.set $3 - end - local.get $3 - if - local.get $0 - local.get $1 - local.get $2 - call $~lib/internal/memory/memcpy - return - end - local.get $0 - local.get $1 - i32.lt_u - if - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and - i32.eq - if - loop $continue|0 - local.get $0 - i32.const 7 - i32.and - if - local.get $2 - i32.eqz - if - return - end - local.get $2 - i32.const 1 - i32.sub - local.set $2 - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - br $continue|0 - end - end - loop $continue|1 - local.get $2 - i32.const 8 - i32.ge_u - if - local.get $0 - local.get $1 - i64.load - i64.store - local.get $2 - i32.const 8 - i32.sub - local.set $2 - local.get $0 - i32.const 8 - i32.add - local.set $0 - local.get $1 - i32.const 8 - i32.add - local.set $1 - br $continue|1 - end - end - end - loop $continue|2 - local.get $2 + i32.sub + local.set $1 + loop $continue|0 + local.get $1 + i32.const 32 + i32.ge_u if local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 + i64.const 0 + i64.store + local.get $0 + i32.const 8 i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - br $continue|2 - end - end - else - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and - i32.eq - if - loop $continue|3 + i64.const 0 + i64.store local.get $0 - local.get $2 + i32.const 16 i32.add - i32.const 7 - i32.and - if - local.get $2 - i32.eqz - if - return - end - local.get $2 - i32.const 1 - i32.sub - local.tee $2 - local.get $0 - i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 - br $continue|3 - end - end - loop $continue|4 - local.get $2 - i32.const 8 - i32.ge_u - if - local.get $2 - i32.const 8 - i32.sub - local.tee $2 - local.get $0 - i32.add - local.get $1 - local.get $2 - i32.add - i64.load - i64.store - br $continue|4 - end - end - end - loop $continue|5 - local.get $2 - if - local.get $2 - i32.const 1 - i32.sub - local.tee $2 + i64.const 0 + i64.store local.get $0 + i32.const 24 i32.add + i64.const 0 + i64.store local.get $1 - local.get $2 + i32.const 32 + i32.sub + local.set $1 + local.get $0 + i32.const 32 i32.add - i32.load8_u - i32.store8 - br $continue|5 + local.set $0 + br $continue|0 end end end ) - (func $~lib/internal/memory/memset (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/array/ensureSize (; 6 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) - local.get $1 - i32.eqz - if - return - end - local.get $0 - i32.const 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - i32.const 1 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 2 - i32.le_u - if - return - end - local.get $0 + (local $3 i32) + (local $4 i32) i32.const 1 - i32.add - i32.const 0 - i32.store8 - local.get $0 - i32.const 2 - i32.add - i32.const 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 2 - i32.sub - i32.const 0 - i32.store8 - local.get $2 - i32.const 3 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 6 - i32.le_u - if - return - end - local.get $0 - i32.const 3 - i32.add - i32.const 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - i32.const 4 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 8 - i32.le_u - if - return - end - i32.const 0 local.get $0 - i32.sub - i32.const 3 - i32.and + i32.load offset=8 local.tee $2 - local.get $0 - i32.add - local.tee $0 - i32.const 0 - i32.store local.get $1 - local.get $2 - i32.sub - i32.const -4 - i32.and - local.tee $1 - local.get $0 - i32.add - i32.const 4 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 8 - i32.le_u - if - return - end - local.get $0 - i32.const 4 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 8 - i32.add - i32.const 0 - i32.store - local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 12 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 8 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 24 - i32.le_u - if - return - end - local.get $0 - i32.const 12 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 16 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 20 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 24 - i32.add - i32.const 0 - i32.store - local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 28 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 24 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 20 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 16 - i32.sub - i32.const 0 - i32.store - local.get $0 - i32.const 4 - i32.and - i32.const 24 - i32.add - local.tee $2 - local.get $0 - i32.add - local.set $0 - local.get $1 - local.get $2 - i32.sub - local.set $1 - loop $continue|0 - local.get $1 - i32.const 32 - i32.ge_u - if - local.get $0 - i64.const 0 - i64.store - local.get $0 - i32.const 8 - i32.add - i64.const 0 - i64.store - local.get $0 - i32.const 16 - i32.add - i64.const 0 - i64.store - local.get $0 - i32.const 24 - i32.add - i64.const 0 - i64.store - local.get $1 - i32.const 32 - i32.sub - local.set $1 - local.get $0 - i32.const 32 - i32.add - local.set $0 - br $continue|0 - end - end - ) - (func $~lib/internal/arraybuffer/reallocateUnsafe (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - local.get $1 - local.get $0 - i32.load - local.tee $2 - i32.gt_s - if - local.get $1 - i32.const 1073741816 - i32.gt_s - if - i32.const 0 - i32.const 216 - i32.const 40 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $1 - i32.const 1 - i32.const 32 - local.get $2 - i32.const 7 - i32.add - i32.clz - i32.sub - i32.shl - i32.const 8 - i32.sub - i32.le_s - if - local.get $0 - local.get $1 - i32.store - else - local.get $1 - call $~lib/internal/arraybuffer/allocateUnsafe - local.tee $3 - i32.const 8 - i32.add - local.get $0 - i32.const 8 - i32.add - local.get $2 - call $~lib/internal/memory/memmove - local.get $3 - local.set $0 + i32.shr_u + i32.gt_u + if + i32.const 1 + i32.const 1073741808 + local.get $1 + i32.shr_u + i32.gt_u + if + i32.const 424 + i32.const 376 + i32.const 14 + i32.const 47 + call $~lib/builtins/abort + unreachable end local.get $0 - i32.const 8 - i32.add + i32.load + local.tee $4 + i32.const 1 + local.get $1 + i32.shl + local.tee $3 + call $~lib/rt/stub/__realloc + local.tee $1 local.get $2 i32.add - local.get $1 + local.get $3 local.get $2 i32.sub - call $~lib/internal/memory/memset - else + call $~lib/memory/memory.fill local.get $1 - local.get $2 - i32.lt_s + local.get $4 + i32.ne if - local.get $1 - i32.const 0 - i32.lt_s - if - i32.const 0 - i32.const 216 - i32.const 62 - i32.const 4 - call $~lib/env/abort - unreachable - end local.get $0 local.get $1 i32.store + local.get $0 + local.get $1 + i32.store offset=4 end + local.get $0 + local.get $3 + i32.store offset=8 end - local.get $0 ) (func $~lib/array/Array#__set (; 7 ;) (type $FUNCSIG$v) (local $0 i32) - i32.const 0 - i32.const 24 + i32.const 60 i32.load - local.tee $0 + local.set $0 + i32.const 48 + i32.const 2 + call $~lib/array/ensureSize + i32.const 52 i32.load i32.const 2 - i32.shr_u - i32.ge_u + i32.store + i32.const 0 + local.get $0 + i32.ge_s if - i32.const 24 - local.get $0 - i32.const 4 - call $~lib/internal/arraybuffer/reallocateUnsafe - local.tee $0 - i32.store - i32.const 28 + i32.const 60 i32.const 1 i32.store end - local.get $0 - i32.const 2 - i32.store offset=8 ) - (func $~lib/array/Array#__set (; 8 ;) (type $FUNCSIG$v) - (local $0 i32) - i32.const 0 - i32.const 64 - i32.load - local.tee $0 + (func $~lib/array/Array#__get (; 8 ;) (type $FUNCSIG$ji) (param $0 i32) (result i64) + local.get $0 + i32.const 120 i32.load i32.const 3 i32.shr_u i32.ge_u if - i32.const 64 - local.get $0 - i32.const 8 - call $~lib/internal/arraybuffer/reallocateUnsafe - local.tee $0 - i32.store - i32.const 68 - i32.const 1 - i32.store + i32.const 320 + i32.const 376 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort + unreachable end + i32.const 116 + i32.load local.get $0 - i64.const 4 - i64.store offset=8 + i32.const 3 + i32.shl + i32.add + i64.load ) - (func $~lib/array/Array#__set (; 9 ;) (type $FUNCSIG$v) + (func $~lib/array/Array#__set (; 9 ;) (type $FUNCSIG$v) (local $0 i32) - i32.const 0 - i32.const 88 + i32.const 124 + i32.load + local.set $0 + i32.const 112 + i32.const 3 + call $~lib/array/ensureSize + i32.const 116 i32.load - local.tee $0 + i64.const 4 + i64.store + i32.const 0 + local.get $0 + i32.ge_s + if + i32.const 124 + i32.const 1 + i32.store + end + ) + (func $~lib/array/Array#__get (; 10 ;) (type $FUNCSIG$fi) (param $0 i32) (result f32) + local.get $0 + i32.const 176 i32.load i32.const 2 i32.shr_u i32.ge_u if - i32.const 88 - local.get $0 - i32.const 4 - call $~lib/internal/arraybuffer/reallocateUnsafe - local.tee $0 - i32.store - i32.const 92 - i32.const 1 - i32.store + i32.const 320 + i32.const 376 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort + unreachable end + i32.const 172 + i32.load local.get $0 - f32.const 2.5 - f32.store offset=8 + i32.const 2 + i32.shl + i32.add + f32.load ) - (func $~lib/array/Array#__set (; 10 ;) (type $FUNCSIG$v) + (func $~lib/array/Array#__set (; 11 ;) (type $FUNCSIG$v) (local $0 i32) - i32.const 0 - i32.const 128 + i32.const 180 + i32.load + local.set $0 + i32.const 168 + i32.const 2 + call $~lib/array/ensureSize + i32.const 172 i32.load - local.tee $0 + f32.const 2.5 + f32.store + i32.const 0 + local.get $0 + i32.ge_s + if + i32.const 180 + i32.const 1 + i32.store + end + ) + (func $~lib/array/Array#__get (; 12 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) + local.get $0 + i32.const 240 i32.load i32.const 3 i32.shr_u i32.ge_u if - i32.const 128 - local.get $0 - i32.const 8 - call $~lib/internal/arraybuffer/reallocateUnsafe - local.tee $0 - i32.store - i32.const 132 - i32.const 1 - i32.store + i32.const 320 + i32.const 376 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort + unreachable end + i32.const 236 + i32.load local.get $0 - f64.const 2.25 - f64.store offset=8 + i32.const 3 + i32.shl + i32.add + f64.load ) - (func $start:std/static-array (; 11 ;) (type $FUNCSIG$v) + (func $~lib/array/Array#__set (; 13 ;) (type $FUNCSIG$v) (local $0 i32) - i32.const 280 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - i32.const 28 + i32.const 244 + i32.load + local.set $0 + i32.const 232 + i32.const 3 + call $~lib/array/ensureSize + i32.const 236 + i32.load + f64.const 2.25 + f64.store + i32.const 0 + local.get $0 + i32.ge_s + if + i32.const 244 + i32.const 1 + i32.store + end + ) + (func $start:std/static-array (; 14 ;) (type $FUNCSIG$v) + i32.const 60 i32.load i32.const 2 i32.ne if i32.const 0 - i32.const 136 - i32.const 8 + i32.const 264 + i32.const 6 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 - i32.const 24 - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end + call $~lib/array/Array#__get i32.const 1 i32.ne if i32.const 0 - i32.const 136 - i32.const 9 + i32.const 264 + i32.const 7 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 - i32.const 24 - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else - unreachable - end + call $~lib/array/Array#__get i32.const 2 i32.ne if i32.const 0 - i32.const 136 - i32.const 10 + i32.const 264 + i32.const 8 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + i32.const 464 + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset call $~lib/array/Array#__set i32.const 0 - i32.const 24 - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end + call $~lib/array/Array#__get i32.const 2 i32.ne if i32.const 0 - i32.const 136 - i32.const 12 + i32.const 264 + i32.const 10 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 68 + i32.const 124 i32.load i32.const 2 i32.ne if i32.const 0 - i32.const 136 - i32.const 14 + i32.const 264 + i32.const 12 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 - i32.const 64 - i32.load - local.tee $0 - i32.load - i32.const 3 - i32.shr_u - i32.lt_u - if (result i64) - local.get $0 - i64.load offset=8 - else - unreachable - end + call $~lib/array/Array#__get i64.const 3 i64.ne if i32.const 0 - i32.const 136 - i32.const 15 + i32.const 264 + i32.const 13 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 - i32.const 64 - i32.load - local.tee $0 - i32.load - i32.const 3 - i32.shr_u - i32.lt_u - if (result i64) - local.get $0 - i32.const 8 - i32.add - i64.load offset=8 - else - unreachable - end + call $~lib/array/Array#__get i64.const 4 i64.ne if i32.const 0 - i32.const 136 - i32.const 16 + i32.const 264 + i32.const 14 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end call $~lib/array/Array#__set i32.const 0 - i32.const 64 - i32.load - local.tee $0 - i32.load - i32.const 3 - i32.shr_u - i32.lt_u - if (result i64) - local.get $0 - i64.load offset=8 - else - unreachable - end + call $~lib/array/Array#__get i64.const 4 i64.ne if i32.const 0 - i32.const 136 - i32.const 18 + i32.const 264 + i32.const 16 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 92 + i32.const 180 i32.load i32.const 2 i32.ne if i32.const 0 - i32.const 136 - i32.const 20 + i32.const 264 + i32.const 18 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 - i32.const 88 - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result f32) - local.get $0 - f32.load offset=8 - else - unreachable - end + call $~lib/array/Array#__get f32.const 1.5 f32.ne if i32.const 0 - i32.const 136 - i32.const 21 + i32.const 264 + i32.const 19 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 - i32.const 88 - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result f32) - local.get $0 - i32.const 4 - i32.add - f32.load offset=8 - else - unreachable - end + call $~lib/array/Array#__get f32.const 2.5 f32.ne if i32.const 0 - i32.const 136 - i32.const 22 + i32.const 264 + i32.const 20 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end call $~lib/array/Array#__set i32.const 0 - i32.const 88 - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result f32) - local.get $0 - f32.load offset=8 - else - unreachable - end + call $~lib/array/Array#__get f32.const 2.5 f32.ne if i32.const 0 - i32.const 136 - i32.const 24 + i32.const 264 + i32.const 22 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 132 + i32.const 244 i32.load i32.const 2 i32.ne if i32.const 0 - i32.const 136 - i32.const 26 + i32.const 264 + i32.const 24 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 - i32.const 128 - i32.load - local.tee $0 - i32.load - i32.const 3 - i32.shr_u - i32.lt_u - if (result f64) - local.get $0 - f64.load offset=8 - else - unreachable - end + call $~lib/array/Array#__get f64.const 1.25 f64.ne if i32.const 0 - i32.const 136 - i32.const 27 + i32.const 264 + i32.const 25 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 - i32.const 128 - i32.load - local.tee $0 - i32.load - i32.const 3 - i32.shr_u - i32.lt_u - if (result f64) - local.get $0 - i32.const 8 - i32.add - f64.load offset=8 - else - unreachable - end + call $~lib/array/Array#__get f64.const 2.25 f64.ne if i32.const 0 - i32.const 136 - i32.const 28 + i32.const 264 + i32.const 26 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end call $~lib/array/Array#__set i32.const 0 - i32.const 128 - i32.load - local.tee $0 - i32.load - i32.const 3 - i32.shr_u - i32.lt_u - if (result f64) - local.get $0 - f64.load offset=8 - else - unreachable - end + call $~lib/array/Array#__get f64.const 2.25 f64.ne if i32.const 0 - i32.const 136 - i32.const 30 + i32.const 264 + i32.const 28 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) - (func $start (; 12 ;) (type $FUNCSIG$v) + (func $start (; 15 ;) (type $FUNCSIG$v) call $start:std/static-array ) - (func $null (; 13 ;) (type $FUNCSIG$v) + (func $null (; 16 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/static-array.ts b/tests/compiler/std/static-array.ts index 535d3d8aee..4fee0db3e0 100644 --- a/tests/compiler/std/static-array.ts +++ b/tests/compiler/std/static-array.ts @@ -1,5 +1,3 @@ -import "allocator/arena"; // needed just because std/Array#[]= calls __grow conditionally - const i: i32[] = [1, 2]; const I: i64[] = [3, 4]; const f: f32[] = [1.5, 2.5]; diff --git a/tests/compiler/std/static-array.untouched.wat b/tests/compiler/std/static-array.untouched.wat index 266fc608ab..afc869cbbe 100644 --- a/tests/compiler/std/static-array.untouched.wat +++ b/tests/compiler/std/static-array.untouched.wat @@ -1,140 +1,118 @@ (module - (type $FUNCSIG$v (func)) + (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$viii (func (param i32 i32 i32))) - (type $FUNCSIG$ii (func (param i32) (result i32))) - (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$jii (func (param i32 i32) (result i64))) (type $FUNCSIG$viij (func (param i32 i32 i64))) (type $FUNCSIG$fii (func (param i32 i32) (result f32))) (type $FUNCSIG$viif (func (param i32 i32 f32))) (type $FUNCSIG$dii (func (param i32 i32) (result f64))) (type $FUNCSIG$viid (func (param i32 i32 f64))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (type $FUNCSIG$v (func)) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\08\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00") - (data (i32.const 24) "\08\00\00\00\02\00\00\00") - (data (i32.const 32) "\10\00\00\00\00\00\00\00\03\00\00\00\00\00\00\00\04\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 64) " \00\00\00\02\00\00\00") - (data (i32.const 72) "\08\00\00\00\00\00\00\00\00\00\c0?\00\00 @") - (data (i32.const 88) "H\00\00\00\02\00\00\00") - (data (i32.const 96) "\10\00\00\00\00\00\00\00\00\00\00\00\00\00\f4?\00\00\00\00\00\00\02@\00\00\00\00\00\00\00\00") - (data (i32.const 128) "`\00\00\00\02\00\00\00") - (data (i32.const 136) "\13\00\00\00s\00t\00d\00/\00s\00t\00a\00t\00i\00c\00-\00a\00r\00r\00a\00y\00.\00t\00s\00") - (data (i32.const 184) "\0d\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") - (data (i32.const 216) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") + (data (i32.const 8) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\01\00\00\00\02\00\00\00") + (data (i32.const 32) "\10\00\00\00\01\00\00\00\03\00\00\00\10\00\00\00\18\00\00\00\18\00\00\00\08\00\00\00\02\00\00\00") + (data (i32.const 64) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\03\00\00\00\00\00\00\00\04\00\00\00\00\00\00\00") + (data (i32.const 96) "\10\00\00\00\01\00\00\00\04\00\00\00\10\00\00\00P\00\00\00P\00\00\00\10\00\00\00\02\00\00\00") + (data (i32.const 128) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\00\00\c0?\00\00 @") + (data (i32.const 152) "\10\00\00\00\01\00\00\00\05\00\00\00\10\00\00\00\90\00\00\00\90\00\00\00\08\00\00\00\02\00\00\00") + (data (i32.const 184) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\00\00\f4?\00\00\00\00\00\00\02@") + (data (i32.const 216) "\10\00\00\00\01\00\00\00\06\00\00\00\10\00\00\00\c8\00\00\00\c8\00\00\00\10\00\00\00\02\00\00\00") + (data (i32.const 248) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\00s\00t\00d\00/\00s\00t\00a\00t\00i\00c\00-\00a\00r\00r\00a\00y\00.\00t\00s\00") + (data (i32.const 304) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 360) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") + (data (i32.const 408) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h\00") (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) - (global $std/static-array/i i32 (i32.const 24)) - (global $std/static-array/I i32 (i32.const 64)) - (global $std/static-array/f i32 (i32.const 88)) - (global $std/static-array/F i32 (i32.const 128)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 276)) + (global $std/static-array/i i32 (i32.const 48)) + (global $std/static-array/I i32 (i32.const 112)) + (global $std/static-array/f i32 (i32.const 168)) + (global $std/static-array/F i32 (i32.const 232)) + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) + (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/heap/__heap_base i32 (i32.const 452)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) - (func $start:~lib/allocator/arena (; 1 ;) (type $FUNCSIG$v) - global.get $~lib/memory/HEAP_BASE - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset + (func $~lib/array/Array#get:length (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=12 ) - (func $~lib/array/Array#__get (; 2 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) + (func $~lib/array/Array#__unchecked_get (; 2 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 - i32.load - local.set $2 + i32.load offset=4 local.get $1 - local.get $2 + i32.const 2 + i32.shl + i32.add i32.load + ) + (func $~lib/array/Array#__get (; 3 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 + local.get $0 + i32.load offset=8 i32.const 2 i32.shr_u - i32.lt_u - if (result i32) - local.get $2 - local.set $3 - local.get $1 - local.set $4 - i32.const 0 - local.set $5 - local.get $3 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $5 - i32.add - i32.load offset=8 - else + i32.ge_u + if + i32.const 320 + i32.const 376 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort unreachable end - ) - (func $~lib/internal/arraybuffer/computeSize (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 1 - i32.const 32 local.get $0 - i32.const 8 - i32.add - i32.const 1 - i32.sub - i32.clz - i32.sub - i32.shl + local.get $1 + call $~lib/array/Array#__unchecked_get ) - (func $~lib/allocator/arena/__memory_allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/rt/stub/__alloc (; 4 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) + (local $8 i32) local.get $0 - i32.const 1073741824 + i32.const 1073741808 i32.gt_u if unreachable end - global.get $~lib/allocator/arena/offset - local.set $1 - local.get $1 + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.set $2 + local.get $2 local.get $0 - local.tee $2 - i32.const 1 local.tee $3 - local.get $2 + i32.const 1 + local.tee $4 local.get $3 + local.get $4 i32.gt_u select i32.add - i32.const 7 + i32.const 15 i32.add - i32.const 7 + i32.const 15 i32.const -1 i32.xor i32.and - local.set $4 - current_memory local.set $5 - local.get $4 + memory.size + local.set $6 local.get $5 + local.get $6 i32.const 16 i32.shl i32.gt_u if - local.get $4 - local.get $1 + local.get $5 + local.get $2 i32.sub i32.const 65535 i32.add @@ -144,23 +122,23 @@ i32.and i32.const 16 i32.shr_u - local.set $2 - local.get $5 - local.tee $3 - local.get $2 - local.tee $6 - local.get $3 + local.set $3 local.get $6 + local.tee $4 + local.get $3 + local.tee $7 + local.get $4 + local.get $7 i32.gt_s select - local.set $3 - local.get $3 - grow_memory + local.set $4 + local.get $4 + memory.grow i32.const 0 i32.lt_s if - local.get $2 - grow_memory + local.get $3 + memory.grow i32.const 0 i32.lt_s if @@ -168,40 +146,21 @@ end end end - local.get $4 - global.set $~lib/allocator/arena/offset - local.get $1 - ) - (func $~lib/internal/arraybuffer/allocateUnsafe (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - local.get $0 - i32.const 1073741816 - i32.le_u - i32.eqz - if - i32.const 0 - i32.const 216 - i32.const 26 - i32.const 2 - call $~lib/env/abort - unreachable - end - block $~lib/memory/memory.allocate|inlined.0 (result i32) - local.get $0 - call $~lib/internal/arraybuffer/computeSize - local.set $2 - local.get $2 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.0 - end - local.set $1 + local.get $5 + global.set $~lib/rt/stub/offset + local.get $2 + i32.const 16 + i32.sub + local.set $8 + local.get $8 local.get $1 + i32.store offset=8 + local.get $8 local.get $0 - i32.store - local.get $1 + i32.store offset=12 + local.get $2 ) - (func $~lib/internal/memory/memcpy (; 6 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/memory/memcpy (; 5 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -213,33 +172,31 @@ i32.const 3 i32.and else - local.get $2 + i32.const 0 end if - block - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - local.get $2 + block (result i32) + local.get $0 + local.tee $5 i32.const 1 - i32.sub - local.set $2 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 br $continue|0 end end @@ -256,48 +213,46 @@ i32.const 16 i32.ge_u if - block - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $1 - i32.const 4 - i32.add - i32.load - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $1 - i32.const 8 - i32.add - i32.load - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 12 - i32.add - i32.load - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - end + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 8 + i32.add + i32.load + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 12 + i32.add + i32.load + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 br $continue|1 end end @@ -480,158 +435,22 @@ i32.const 17 i32.ge_u if - block - local.get $1 - i32.const 1 - i32.add - i32.load - local.set $4 - local.get $0 - local.get $3 - i32.const 24 - i32.shr_u - local.get $4 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 5 - i32.add - i32.load - local.set $3 - local.get $0 - i32.const 4 - i32.add - local.get $4 - i32.const 24 - i32.shr_u - local.get $3 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 9 - i32.add - i32.load - local.set $4 - local.get $0 - i32.const 8 - i32.add - local.get $3 - i32.const 24 - i32.shr_u - local.get $4 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 13 - i32.add - i32.load - local.set $3 - local.get $0 - i32.const 12 - i32.add - local.get $4 - i32.const 24 - i32.shr_u - local.get $3 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - end - br $continue|3 - end - end - end - br $break|2 - unreachable - end - unreachable - end - block - local.get $1 - i32.load - local.set $3 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - local.get $2 - i32.const 2 - i32.sub - local.set $2 - block $break|4 - loop $continue|4 - local.get $2 - i32.const 18 - i32.ge_u - if - block local.get $1 - i32.const 2 + i32.const 1 i32.add i32.load local.set $4 local.get $0 local.get $3 - i32.const 16 + i32.const 24 i32.shr_u local.get $4 - i32.const 16 + i32.const 8 i32.shl i32.or i32.store local.get $1 - i32.const 6 + i32.const 5 i32.add i32.load local.set $3 @@ -639,15 +458,15 @@ i32.const 4 i32.add local.get $4 - i32.const 16 + i32.const 24 i32.shr_u local.get $3 - i32.const 16 + i32.const 8 i32.shl i32.or i32.store local.get $1 - i32.const 10 + i32.const 9 i32.add i32.load local.set $4 @@ -655,15 +474,15 @@ i32.const 8 i32.add local.get $3 - i32.const 16 + i32.const 24 i32.shr_u local.get $4 - i32.const 16 + i32.const 8 i32.shl i32.or i32.store local.get $1 - i32.const 14 + i32.const 13 i32.add i32.load local.set $3 @@ -671,10 +490,10 @@ i32.const 12 i32.add local.get $4 - i32.const 16 + i32.const 24 i32.shr_u local.get $3 - i32.const 16 + i32.const 8 i32.shl i32.or i32.store @@ -690,65 +509,81 @@ i32.const 16 i32.sub local.set $2 + br $continue|3 end - br $continue|4 end end + br $break|2 + unreachable end - br $break|2 unreachable end - unreachable - end - block - local.get $1 - i32.load - local.set $3 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) + block local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - block $break|5 - loop $continue|5 - local.get $2 - i32.const 19 - i32.ge_u - if - block + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + block $break|4 + loop $continue|4 + local.get $2 + i32.const 18 + i32.ge_u + if local.get $1 - i32.const 3 + i32.const 2 i32.add i32.load local.set $4 local.get $0 local.get $3 - i32.const 8 + i32.const 16 i32.shr_u local.get $4 - i32.const 24 + i32.const 16 i32.shl i32.or i32.store local.get $1 - i32.const 7 + i32.const 6 i32.add i32.load local.set $3 @@ -756,15 +591,15 @@ i32.const 4 i32.add local.get $4 - i32.const 8 + i32.const 16 i32.shr_u local.get $3 - i32.const 24 + i32.const 16 i32.shl i32.or i32.store local.get $1 - i32.const 11 + i32.const 10 i32.add i32.load local.set $4 @@ -772,15 +607,15 @@ i32.const 8 i32.add local.get $3 - i32.const 8 + i32.const 16 i32.shr_u local.get $4 - i32.const 24 + i32.const 16 i32.shl i32.or i32.store local.get $1 - i32.const 15 + i32.const 14 i32.add i32.load local.set $3 @@ -788,10 +623,10 @@ i32.const 12 i32.add local.get $4 - i32.const 8 + i32.const 16 i32.shr_u local.get $3 - i32.const 24 + i32.const 16 i32.shl i32.or i32.store @@ -807,7 +642,121 @@ i32.const 16 i32.sub local.set $2 + br $continue|4 end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + block $break|5 + loop $continue|5 + local.get $2 + i32.const 19 + i32.ge_u + if + local.get $1 + i32.const 3 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 7 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 11 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 15 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 br $continue|5 end end @@ -1402,982 +1351,849 @@ i32.store8 end ) - (func $~lib/internal/memory/memmove (; 7 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/memory/memory.copy (; 6 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - local.get $0 - local.get $1 - i32.eq - if - return - end - local.get $1 - local.get $2 - i32.add - local.get $0 - i32.le_u - local.tee $3 - if (result i32) - local.get $3 - else - local.get $0 - local.get $2 - i32.add - local.get $1 - i32.le_u - end - if + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 local.get $0 + local.set $5 local.get $1 + local.set $4 local.get $2 - call $~lib/internal/memory/memcpy - return - end - local.get $0 - local.get $1 - i32.lt_u - if - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and + local.set $3 + local.get $5 + local.get $4 i32.eq if - block $break|0 - loop $continue|0 - local.get $0 - i32.const 7 - i32.and - if - block - local.get $2 - i32.eqz - if - return - end - local.get $2 - i32.const 1 - i32.sub - local.set $2 - block (result i32) - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $3 - end - block (result i32) - local.get $1 - local.tee $3 - i32.const 1 - i32.add - local.set $1 - local.get $3 + br $~lib/util/memory/memmove|inlined.0 + end + local.get $4 + local.get $3 + i32.add + local.get $5 + i32.le_u + if (result i32) + i32.const 1 + else + local.get $5 + local.get $3 + i32.add + local.get $4 + i32.le_u + end + if + local.get $5 + local.get $4 + local.get $3 + call $~lib/util/memory/memcpy + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 end i32.load8_u i32.store8 + br $continue|0 end - br $continue|0 end end - end - block $break|1 - loop $continue|1 - local.get $2 - i32.const 8 - i32.ge_u - if - block - local.get $0 - local.get $1 + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 i64.load i64.store - local.get $2 + local.get $3 i32.const 8 i32.sub - local.set $2 - local.get $0 + local.set $3 + local.get $5 i32.const 8 i32.add - local.set $0 - local.get $1 + local.set $5 + local.get $4 i32.const 8 i32.add - local.set $1 + local.set $4 + br $continue|1 end - br $continue|1 end end end - end - block $break|2 - loop $continue|2 - local.get $2 - if - block + block $break|2 + loop $continue|2 + local.get $3 + if block (result i32) - local.get $0 - local.tee $3 + local.get $5 + local.tee $6 i32.const 1 i32.add - local.set $0 - local.get $3 + local.set $5 + local.get $6 end block (result i32) - local.get $1 - local.tee $3 + local.get $4 + local.tee $6 i32.const 1 i32.add - local.set $1 - local.get $3 + local.set $4 + local.get $6 end i32.load8_u i32.store8 - local.get $2 + local.get $3 i32.const 1 i32.sub - local.set $2 + local.set $3 + br $continue|2 end - br $continue|2 end end - end - else - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and - i32.eq - if - block $break|3 - loop $continue|3 - local.get $0 - local.get $2 - i32.add - i32.const 7 - i32.and - if - block - local.get $2 + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 i32.eqz if - return + br $~lib/util/memory/memmove|inlined.0 end - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.const 1 i32.sub - local.tee $2 + local.tee $3 i32.add - local.get $1 - local.get $2 + local.get $4 + local.get $3 i32.add i32.load8_u i32.store8 + br $continue|3 end - br $continue|3 end end - end - block $break|4 - loop $continue|4 - local.get $2 - i32.const 8 - i32.ge_u - if - block - local.get $2 + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 i32.const 8 i32.sub - local.set $2 - local.get $0 - local.get $2 + local.set $3 + local.get $5 + local.get $3 i32.add - local.get $1 - local.get $2 + local.get $4 + local.get $3 i32.add i64.load i64.store + br $continue|4 end - br $continue|4 end end end - end - block $break|5 - loop $continue|5 - local.get $2 - if - local.get $0 - local.get $2 - i32.const 1 - i32.sub - local.tee $2 - i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 - br $continue|5 + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end end end end end ) - (func $~lib/allocator/arena/__memory_free (; 8 ;) (type $FUNCSIG$vi) (param $0 i32) - nop - ) - (func $~lib/internal/memory/memset (; 9 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/rt/stub/__realloc (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i64) - local.get $2 - i32.eqz - if - return - end - local.get $0 - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 1 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 2 - i32.le_u - if - return - end - local.get $0 - i32.const 1 - i32.add - local.get $1 - i32.store8 - local.get $0 - i32.const 2 - i32.add - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 2 - i32.sub - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 3 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 6 - i32.le_u - if - return - end local.get $0 - i32.const 3 - i32.add - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 4 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 8 - i32.le_u - if - return - end - i32.const 0 - local.get $0 - i32.sub - i32.const 3 - i32.and - local.set $3 - local.get $0 - local.get $3 - i32.add - local.set $0 - local.get $2 - local.get $3 + i32.const 16 i32.sub local.set $2 local.get $2 - i32.const -4 - i32.and - local.set $2 - i32.const -1 - i32.const 255 - i32.div_u + i32.load offset=12 + local.set $3 local.get $1 - i32.const 255 - i32.and - i32.mul - local.set $4 - local.get $0 - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 4 - i32.sub - local.get $4 - i32.store - local.get $2 - i32.const 8 - i32.le_u + local.get $3 + i32.gt_u if - return + local.get $1 + local.get $2 + i32.load offset=8 + call $~lib/rt/stub/__alloc + local.set $4 + local.get $4 + local.get $0 + local.get $3 + call $~lib/memory/memory.copy + local.get $4 + local.set $0 + else + local.get $2 + local.get $1 + i32.store offset=12 end local.get $0 - i32.const 4 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 12 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 8 - i32.sub - local.get $4 - i32.store - local.get $2 - i32.const 24 - i32.le_u - if - return - end - local.get $0 - i32.const 12 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 16 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 20 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 24 - i32.add - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 28 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 24 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 20 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 16 - i32.sub - local.get $4 - i32.store - i32.const 24 - local.get $0 - i32.const 4 - i32.and - i32.add - local.set $3 - local.get $0 - local.get $3 - i32.add - local.set $0 - local.get $2 - local.get $3 - i32.sub - local.set $2 - local.get $4 - i64.extend_i32_u - local.get $4 - i64.extend_i32_u - i64.const 32 - i64.shl - i64.or - local.set $5 - block $break|0 - loop $continue|0 - local.get $2 - i32.const 32 - i32.ge_u - if - block - local.get $0 + ) + (func $~lib/memory/memory.fill (; 8 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i64) + block $~lib/util/memory/memset|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $3 + i32.eqz + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 1 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 2 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 1 + i32.add + local.get $4 + i32.store8 + local.get $5 + i32.const 2 + i32.add + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 2 + i32.sub + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 3 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 6 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 3 + i32.add + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + i32.const 0 + local.get $5 + i32.sub + i32.const 3 + i32.and + local.set $6 + local.get $5 + local.get $6 + i32.add + local.set $5 + local.get $3 + local.get $6 + i32.sub + local.set $3 + local.get $3 + i32.const -4 + i32.and + local.set $3 + i32.const -1 + i32.const 255 + i32.div_u + local.get $4 + i32.const 255 + i32.and + i32.mul + local.set $7 + local.get $5 + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.get $7 + i32.store + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 4 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 8 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 12 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 8 + i32.sub + local.get $7 + i32.store + local.get $3 + i32.const 24 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 12 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 16 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 20 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 24 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 28 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 24 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 20 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 16 + i32.sub + local.get $7 + i32.store + i32.const 24 + local.get $5 + i32.const 4 + i32.and + i32.add + local.set $6 + local.get $5 + local.get $6 + i32.add + local.set $5 + local.get $3 + local.get $6 + i32.sub + local.set $3 + local.get $7 + i64.extend_i32_u + local.get $7 + i64.extend_i32_u + i64.const 32 + i64.shl + i64.or + local.set $8 + block $break|0 + loop $continue|0 + local.get $3 + i32.const 32 + i32.ge_u + if local.get $5 + local.get $8 i64.store - local.get $0 + local.get $5 i32.const 8 i32.add - local.get $5 + local.get $8 i64.store - local.get $0 + local.get $5 i32.const 16 i32.add - local.get $5 + local.get $8 i64.store - local.get $0 + local.get $5 i32.const 24 i32.add - local.get $5 + local.get $8 i64.store - local.get $2 + local.get $3 i32.const 32 i32.sub - local.set $2 - local.get $0 + local.set $3 + local.get $5 i32.const 32 i32.add - local.set $0 + local.set $5 + br $continue|0 end - br $continue|0 end end end ) - (func $~lib/internal/arraybuffer/reallocateUnsafe (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) + (func $~lib/rt/stub/__retain (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + ) + (func $~lib/array/ensureSize (; 10 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) local.get $0 - i32.load - local.set $2 + i32.load offset=8 + local.set $3 local.get $1 + local.get $3 local.get $2 - i32.gt_s + i32.shr_u + i32.gt_u if local.get $1 - i32.const 1073741816 - i32.le_s - i32.eqz + i32.const 1073741808 + local.get $2 + i32.shr_u + i32.gt_u if - i32.const 0 - i32.const 216 - i32.const 40 - i32.const 4 - call $~lib/env/abort + i32.const 424 + i32.const 376 + i32.const 14 + i32.const 47 + call $~lib/builtins/abort unreachable end + local.get $0 + i32.load + local.set $4 local.get $1 local.get $2 - call $~lib/internal/arraybuffer/computeSize - i32.const 8 + i32.shl + local.set $5 + local.get $4 + local.get $5 + call $~lib/rt/stub/__realloc + local.set $6 + local.get $6 + local.get $3 + i32.add + i32.const 0 + local.get $5 + local.get $3 i32.sub - i32.le_s + call $~lib/memory/memory.fill + local.get $6 + local.get $4 + i32.ne if local.get $0 - local.get $1 + local.get $6 + call $~lib/rt/stub/__retain i32.store - else - local.get $1 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $3 - block $~lib/memory/memory.copy|inlined.0 - local.get $3 - i32.const 8 - i32.add - local.set $4 - local.get $0 - i32.const 8 - i32.add - local.set $5 - local.get $2 - local.set $6 - local.get $4 - local.get $5 - local.get $6 - call $~lib/internal/memory/memmove - end - block $~lib/memory/memory.free|inlined.0 - local.get $0 - local.set $6 - local.get $6 - call $~lib/allocator/arena/__memory_free - br $~lib/memory/memory.free|inlined.0 - end - local.get $3 - local.set $0 - end - block $~lib/memory/memory.fill|inlined.0 local.get $0 - i32.const 8 - i32.add - local.get $2 - i32.add - local.set $3 - i32.const 0 - local.set $6 - local.get $1 - local.get $2 - i32.sub - local.set $5 - local.get $3 local.get $6 - local.get $5 - call $~lib/internal/memory/memset - end - else - local.get $1 - local.get $2 - i32.lt_s - if - local.get $1 - i32.const 0 - i32.ge_s - i32.eqz - if - i32.const 0 - i32.const 216 - i32.const 62 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.store + i32.store offset=4 end + local.get $0 + local.get $5 + i32.store offset=8 end + ) + (func $~lib/array/Array#__unchecked_set (; 11 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + local.get $2 + i32.store ) - (func $~lib/array/Array#__set (; 11 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array#__set (; 12 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) local.get $0 - i32.load + i32.load offset=12 local.set $3 - local.get $3 - i32.load + local.get $0 + local.get $1 + i32.const 1 + i32.add i32.const 2 - i32.shr_u - local.set $4 + call $~lib/array/ensureSize + local.get $0 local.get $1 - local.get $4 - i32.ge_u + local.get $2 + call $~lib/array/Array#__unchecked_set + local.get $1 + local.get $3 + i32.ge_s if - local.get $1 - i32.const 268435454 - i32.ge_u - if - i32.const 0 - i32.const 184 - i32.const 107 - i32.const 41 - call $~lib/env/abort - unreachable - end - local.get $3 - local.get $1 - i32.const 1 - i32.add - i32.const 2 - i32.shl - call $~lib/internal/arraybuffer/reallocateUnsafe - local.set $3 - local.get $0 - local.get $3 - i32.store local.get $0 local.get $1 i32.const 1 i32.add - i32.store offset=4 - end - block $~lib/internal/arraybuffer/STORE|inlined.0 - local.get $3 - local.set $5 - local.get $1 - local.set $6 - local.get $2 - local.set $7 - i32.const 0 - local.set $8 - local.get $5 - local.get $6 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.add - local.get $7 - i32.store offset=8 + i32.store offset=12 end ) - (func $~lib/array/Array#__get (; 12 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) + (func $~lib/array/Array#get:length (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - i32.load - local.set $2 + i32.load offset=12 + ) + (func $~lib/array/Array#__unchecked_get (; 14 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) + local.get $0 + i32.load offset=4 local.get $1 - local.get $2 - i32.load + i32.const 3 + i32.shl + i32.add + i64.load + ) + (func $~lib/array/Array#__get (; 15 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) + local.get $1 + local.get $0 + i32.load offset=8 i32.const 3 i32.shr_u - i32.lt_u - if (result i64) - local.get $2 - local.set $3 - local.get $1 - local.set $4 - i32.const 0 - local.set $5 - local.get $3 - local.get $4 - i32.const 3 - i32.shl - i32.add - local.get $5 - i32.add - i64.load offset=8 - else + i32.ge_u + if + i32.const 320 + i32.const 376 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort unreachable end + local.get $0 + local.get $1 + call $~lib/array/Array#__unchecked_get + ) + (func $~lib/array/Array#__unchecked_set (; 16 ;) (type $FUNCSIG$viij) (param $0 i32) (param $1 i32) (param $2 i64) + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 3 + i32.shl + i32.add + local.get $2 + i64.store ) - (func $~lib/array/Array#__set (; 13 ;) (type $FUNCSIG$viij) (param $0 i32) (param $1 i32) (param $2 i64) + (func $~lib/array/Array#__set (; 17 ;) (type $FUNCSIG$viij) (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i64) - (local $8 i32) local.get $0 - i32.load + i32.load offset=12 local.set $3 - local.get $3 - i32.load + local.get $0 + local.get $1 + i32.const 1 + i32.add i32.const 3 - i32.shr_u - local.set $4 + call $~lib/array/ensureSize + local.get $0 local.get $1 - local.get $4 - i32.ge_u + local.get $2 + call $~lib/array/Array#__unchecked_set + local.get $1 + local.get $3 + i32.ge_s if - local.get $1 - i32.const 134217727 - i32.ge_u - if - i32.const 0 - i32.const 184 - i32.const 107 - i32.const 41 - call $~lib/env/abort - unreachable - end - local.get $3 - local.get $1 - i32.const 1 - i32.add - i32.const 3 - i32.shl - call $~lib/internal/arraybuffer/reallocateUnsafe - local.set $3 - local.get $0 - local.get $3 - i32.store local.get $0 local.get $1 i32.const 1 i32.add - i32.store offset=4 - end - block $~lib/internal/arraybuffer/STORE|inlined.0 - local.get $3 - local.set $5 - local.get $1 - local.set $6 - local.get $2 - local.set $7 - i32.const 0 - local.set $8 - local.get $5 - local.get $6 - i32.const 3 - i32.shl - i32.add - local.get $8 - i32.add - local.get $7 - i64.store offset=8 + i32.store offset=12 end ) - (func $~lib/array/Array#__get (; 14 ;) (type $FUNCSIG$fii) (param $0 i32) (param $1 i32) (result f32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) + (func $~lib/array/Array#get:length (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - i32.load - local.set $2 + i32.load offset=12 + ) + (func $~lib/array/Array#__unchecked_get (; 19 ;) (type $FUNCSIG$fii) (param $0 i32) (param $1 i32) (result f32) + local.get $0 + i32.load offset=4 local.get $1 - local.get $2 - i32.load + i32.const 2 + i32.shl + i32.add + f32.load + ) + (func $~lib/array/Array#__get (; 20 ;) (type $FUNCSIG$fii) (param $0 i32) (param $1 i32) (result f32) + local.get $1 + local.get $0 + i32.load offset=8 i32.const 2 i32.shr_u - i32.lt_u - if (result f32) - local.get $2 - local.set $3 - local.get $1 - local.set $4 - i32.const 0 - local.set $5 - local.get $3 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $5 - i32.add - f32.load offset=8 - else + i32.ge_u + if + i32.const 320 + i32.const 376 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort unreachable end + local.get $0 + local.get $1 + call $~lib/array/Array#__unchecked_get + ) + (func $~lib/array/Array#__unchecked_set (; 21 ;) (type $FUNCSIG$viif) (param $0 i32) (param $1 i32) (param $2 f32) + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + local.get $2 + f32.store ) - (func $~lib/array/Array#__set (; 15 ;) (type $FUNCSIG$viif) (param $0 i32) (param $1 i32) (param $2 f32) + (func $~lib/array/Array#__set (; 22 ;) (type $FUNCSIG$viif) (param $0 i32) (param $1 i32) (param $2 f32) (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 f32) - (local $8 i32) local.get $0 - i32.load + i32.load offset=12 local.set $3 - local.get $3 - i32.load + local.get $0 + local.get $1 + i32.const 1 + i32.add i32.const 2 - i32.shr_u - local.set $4 + call $~lib/array/ensureSize + local.get $0 local.get $1 - local.get $4 - i32.ge_u + local.get $2 + call $~lib/array/Array#__unchecked_set + local.get $1 + local.get $3 + i32.ge_s if - local.get $1 - i32.const 268435454 - i32.ge_u - if - i32.const 0 - i32.const 184 - i32.const 107 - i32.const 41 - call $~lib/env/abort - unreachable - end - local.get $3 - local.get $1 - i32.const 1 - i32.add - i32.const 2 - i32.shl - call $~lib/internal/arraybuffer/reallocateUnsafe - local.set $3 - local.get $0 - local.get $3 - i32.store local.get $0 local.get $1 i32.const 1 i32.add - i32.store offset=4 - end - block $~lib/internal/arraybuffer/STORE|inlined.0 - local.get $3 - local.set $5 - local.get $1 - local.set $6 - local.get $2 - local.set $7 - i32.const 0 - local.set $8 - local.get $5 - local.get $6 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.add - local.get $7 - f32.store offset=8 + i32.store offset=12 end ) - (func $~lib/array/Array#__get (; 16 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) + (func $~lib/array/Array#get:length (; 23 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - i32.load - local.set $2 + i32.load offset=12 + ) + (func $~lib/array/Array#__unchecked_get (; 24 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) + local.get $0 + i32.load offset=4 local.get $1 - local.get $2 - i32.load + i32.const 3 + i32.shl + i32.add + f64.load + ) + (func $~lib/array/Array#__get (; 25 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) + local.get $1 + local.get $0 + i32.load offset=8 i32.const 3 i32.shr_u - i32.lt_u - if (result f64) - local.get $2 - local.set $3 - local.get $1 - local.set $4 - i32.const 0 - local.set $5 - local.get $3 - local.get $4 - i32.const 3 - i32.shl - i32.add - local.get $5 - i32.add - f64.load offset=8 - else + i32.ge_u + if + i32.const 320 + i32.const 376 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort unreachable end + local.get $0 + local.get $1 + call $~lib/array/Array#__unchecked_get + ) + (func $~lib/array/Array#__unchecked_set (; 26 ;) (type $FUNCSIG$viid) (param $0 i32) (param $1 i32) (param $2 f64) + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 3 + i32.shl + i32.add + local.get $2 + f64.store ) - (func $~lib/array/Array#__set (; 17 ;) (type $FUNCSIG$viid) (param $0 i32) (param $1 i32) (param $2 f64) + (func $~lib/array/Array#__set (; 27 ;) (type $FUNCSIG$viid) (param $0 i32) (param $1 i32) (param $2 f64) (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 f64) - (local $8 i32) local.get $0 - i32.load + i32.load offset=12 local.set $3 - local.get $3 - i32.load + local.get $0 + local.get $1 + i32.const 1 + i32.add i32.const 3 - i32.shr_u - local.set $4 + call $~lib/array/ensureSize + local.get $0 local.get $1 - local.get $4 - i32.ge_u + local.get $2 + call $~lib/array/Array#__unchecked_set + local.get $1 + local.get $3 + i32.ge_s if - local.get $1 - i32.const 134217727 - i32.ge_u - if - i32.const 0 - i32.const 184 - i32.const 107 - i32.const 41 - call $~lib/env/abort - unreachable - end - local.get $3 - local.get $1 - i32.const 1 - i32.add - i32.const 3 - i32.shl - call $~lib/internal/arraybuffer/reallocateUnsafe - local.set $3 - local.get $0 - local.get $3 - i32.store local.get $0 local.get $1 i32.const 1 i32.add - i32.store offset=4 - end - block $~lib/internal/arraybuffer/STORE|inlined.0 - local.get $3 - local.set $5 - local.get $1 - local.set $6 - local.get $2 - local.set $7 - i32.const 0 - local.set $8 - local.get $5 - local.get $6 - i32.const 3 - i32.shl - i32.add - local.get $8 - i32.add - local.get $7 - f64.store offset=8 + i32.store offset=12 end ) - (func $start:std/static-array (; 18 ;) (type $FUNCSIG$v) + (func $start:std/static-array (; 28 ;) (type $FUNCSIG$v) (local $0 i32) - call $start:~lib/allocator/arena - block $~lib/array/Array#get:length|inlined.0 (result i32) - global.get $std/static-array/i - local.set $0 - local.get $0 - i32.load offset=4 - end + (local $1 i32) + global.get $std/static-array/i + call $~lib/array/Array#get:length i32.const 2 i32.eq i32.eqz if i32.const 0 - i32.const 136 - i32.const 8 + i32.const 264 + i32.const 6 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/static-array/i @@ -2388,10 +2204,10 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 9 + i32.const 264 + i32.const 7 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/static-array/i @@ -2402,12 +2218,22 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 10 + i32.const 264 + i32.const 8 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset global.get $std/static-array/i i32.const 0 i32.const 2 @@ -2420,27 +2246,23 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 12 + i32.const 264 + i32.const 10 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/array/Array#get:length|inlined.0 (result i32) - global.get $std/static-array/I - local.set $0 - local.get $0 - i32.load offset=4 - end + global.get $std/static-array/I + call $~lib/array/Array#get:length i32.const 2 i32.eq i32.eqz if i32.const 0 - i32.const 136 - i32.const 14 + i32.const 264 + i32.const 12 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/static-array/I @@ -2451,10 +2273,10 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 15 + i32.const 264 + i32.const 13 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/static-array/I @@ -2465,10 +2287,10 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 16 + i32.const 264 + i32.const 14 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/static-array/I @@ -2483,27 +2305,23 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 18 + i32.const 264 + i32.const 16 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/array/Array#get:length|inlined.0 (result i32) - global.get $std/static-array/f - local.set $0 - local.get $0 - i32.load offset=4 - end + global.get $std/static-array/f + call $~lib/array/Array#get:length i32.const 2 i32.eq i32.eqz if i32.const 0 - i32.const 136 - i32.const 20 + i32.const 264 + i32.const 18 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/static-array/f @@ -2514,10 +2332,10 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 21 + i32.const 264 + i32.const 19 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/static-array/f @@ -2528,10 +2346,10 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 22 + i32.const 264 + i32.const 20 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/static-array/f @@ -2546,27 +2364,23 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 24 + i32.const 264 + i32.const 22 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/array/Array#get:length|inlined.0 (result i32) - global.get $std/static-array/F - local.set $0 - local.get $0 - i32.load offset=4 - end + global.get $std/static-array/F + call $~lib/array/Array#get:length i32.const 2 i32.eq i32.eqz if i32.const 0 - i32.const 136 - i32.const 26 + i32.const 264 + i32.const 24 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/static-array/F @@ -2577,10 +2391,10 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 27 + i32.const 264 + i32.const 25 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/static-array/F @@ -2591,10 +2405,10 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 28 + i32.const 264 + i32.const 26 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/static-array/F @@ -2609,16 +2423,16 @@ i32.eqz if i32.const 0 - i32.const 136 - i32.const 30 + i32.const 264 + i32.const 28 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) - (func $start (; 19 ;) (type $FUNCSIG$v) + (func $start (; 29 ;) (type $FUNCSIG$v) call $start:std/static-array ) - (func $null (; 20 ;) (type $FUNCSIG$v) + (func $null (; 30 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/std/string-utf8.json b/tests/compiler/std/string-utf8.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/std/string-utf8.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/std/string-utf8.optimized.wat b/tests/compiler/std/string-utf8.optimized.wat index d1c6bb54de..0499aa5ee9 100644 --- a/tests/compiler/std/string-utf8.optimized.wat +++ b/tests/compiler/std/string-utf8.optimized.wat @@ -1,31 +1,36 @@ (module - (type $FUNCSIG$v (func)) (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$v (func)) (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\06\00\00\00\01\d87\dch\00i\00R\d8b\df") - (data (i32.const 24) "\12\00\00\00s\00t\00d\00/\00s\00t\00r\00i\00n\00g\00-\00u\00t\00f\008\00.\00t\00s") - (data (i32.const 72) "\0e\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s") - (data (i32.const 104) "\17\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s") - (data (i32.const 160) "\02\00\00\00\01\d87\dc") - (data (i32.const 168) "\02\00\00\00h\00i") - (data (i32.const 176) "\02\00\00\00R\d8b\df") - (data (i32.const 184) "\01") - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) - (global $std/string-utf8/str (mut i32) (i32.const 8)) + (data (i32.const 8) "\0c\00\00\00\01\00\00\00\01\00\00\00\0c\00\00\00\01\d87\dch\00i\00R\d8b\df") + (data (i32.const 40) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00s\00t\00d\00/\00s\00t\00r\00i\00n\00g\00-\00u\00t\00f\008\00.\00t\00s") + (data (i32.const 100) "\01\00\00\00\01") + (data (i32.const 112) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s") + (data (i32.const 160) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00\01\d87\dc") + (data (i32.const 184) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00h\00i") + (data (i32.const 208) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00R\d8b\df") + (data (i32.const 232) "\02\00\00\00\01\00\00\00\01\00\00\00\02") + (global $std/string-utf8/str i32 (i32.const 24)) (global $std/string-utf8/len (mut i32) (i32.const 0)) + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) (global $std/string-utf8/ptr (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) - (func $~lib/string/String#get:lengthUTF8 (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/string/String#get:length (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u + ) + (func $~lib/string/String#get:lengthUTF8 (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -33,11 +38,11 @@ i32.const 1 local.set $1 local.get $0 - i32.load - local.set $4 + call $~lib/string/String#get:length + local.set $3 loop $continue|0 local.get $2 - local.get $4 + local.get $3 i32.lt_u if local.get $2 @@ -45,8 +50,8 @@ i32.shl local.get $0 i32.add - i32.load16_u offset=4 - local.tee $3 + i32.load16_u + local.tee $4 i32.const 128 i32.lt_u if (result i32) @@ -58,7 +63,7 @@ i32.const 1 i32.add else - local.get $3 + local.get $4 i32.const 2048 i32.lt_u if (result i32) @@ -70,22 +75,19 @@ i32.const 1 i32.add else + local.get $2 + i32.const 1 + i32.add local.get $3 + i32.lt_u + i32.const 0 + local.get $4 i32.const 64512 i32.and i32.const 55296 i32.eq - local.tee $3 - if - local.get $2 - i32.const 1 - i32.add - local.get $4 - i32.lt_u - local.set $3 - end - local.get $3 - if + select + if (result i32) local.get $2 i32.const 1 i32.add @@ -93,14 +95,14 @@ i32.shl local.get $0 i32.add - i32.load16_u offset=4 + i32.load16_u i32.const 64512 i32.and i32.const 56320 i32.eq - local.set $3 + else + i32.const 0 end - local.get $3 if (result i32) local.get $1 i32.const 4 @@ -126,18 +128,21 @@ end local.get $1 ) - (func $~lib/allocator/arena/__memory_allocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/rt/stub/__alloc (; 3 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) + (local $4 i32) + (local $5 i32) local.get $0 - i32.const 1073741824 + i32.const 1073741808 i32.gt_u if unreachable end - global.get $~lib/allocator/arena/offset - local.tee $1 + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.tee $3 local.get $0 i32.const 1 local.get $0 @@ -145,20 +150,20 @@ i32.gt_u select i32.add - i32.const 7 + i32.const 15 i32.add - i32.const -8 + i32.const -16 i32.and - local.tee $0 - current_memory local.tee $2 + memory.size + local.tee $4 i32.const 16 i32.shl i32.gt_u if + local.get $4 local.get $2 - local.get $0 - local.get $1 + local.get $3 i32.sub i32.const 65535 i32.add @@ -166,17 +171,17 @@ i32.and i32.const 16 i32.shr_u - local.tee $3 - local.get $2 - local.get $3 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select - grow_memory + memory.grow i32.const 0 i32.lt_s if - local.get $3 - grow_memory + local.get $5 + memory.grow i32.const 0 i32.lt_s if @@ -184,11 +189,20 @@ end end end - local.get $0 - global.set $~lib/allocator/arena/offset + local.get $2 + global.set $~lib/rt/stub/offset + local.get $3 + i32.const 16 + i32.sub + local.tee $2 local.get $1 + i32.store offset=8 + local.get $2 + local.get $0 + i32.store offset=12 + local.get $3 ) - (func $~lib/string/String#toUTF8 (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/string/String#toUTF8 (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -198,116 +212,114 @@ (local $7 i32) local.get $0 call $~lib/string/String#get:lengthUTF8 - call $~lib/allocator/arena/__memory_allocate - local.set $6 + i32.const 0 + call $~lib/rt/stub/__alloc + local.set $5 local.get $0 - i32.load - local.set $7 + call $~lib/string/String#get:length + local.set $6 loop $continue|0 - local.get $2 - local.get $7 + local.get $3 + local.get $6 i32.lt_u if - local.get $2 + local.get $3 i32.const 1 i32.shl local.get $0 i32.add - i32.load16_u offset=4 - local.tee $4 + i32.load16_u + local.tee $1 i32.const 128 i32.lt_u if - local.get $1 - local.get $6 + local.get $2 + local.get $5 i32.add - local.get $4 - i32.store8 local.get $1 + i32.store8 + local.get $2 i32.const 1 i32.add - local.set $1 + local.set $2 else - local.get $4 + local.get $1 i32.const 2048 i32.lt_u if - local.get $1 - local.get $6 + local.get $2 + local.get $5 i32.add - local.tee $3 - local.get $4 + local.tee $4 + local.get $1 i32.const 6 i32.shr_u i32.const 192 i32.or i32.store8 - local.get $3 local.get $4 + local.get $1 i32.const 63 i32.and i32.const 128 i32.or i32.store8 offset=1 - local.get $1 + local.get $2 i32.const 2 i32.add - local.set $1 + local.set $2 else - local.get $1 - local.get $6 + local.get $2 + local.get $5 i32.add - local.set $5 - local.get $4 + local.set $4 + local.get $3 + i32.const 1 + i32.add + local.get $6 + i32.lt_u + i32.const 0 + local.get $1 i32.const 64512 i32.and i32.const 55296 i32.eq - local.tee $3 - if - local.get $2 - i32.const 1 - i32.add - local.get $7 - i32.lt_u - local.set $3 - end - local.get $3 + select if - local.get $2 + local.get $3 i32.const 1 i32.add i32.const 1 i32.shl local.get $0 i32.add - i32.load16_u offset=4 - local.tee $3 + i32.load16_u + local.tee $7 i32.const 64512 i32.and i32.const 56320 i32.eq if - local.get $5 local.get $4 + local.get $1 i32.const 1023 i32.and i32.const 10 i32.shl i32.const 65536 i32.add - local.get $3 + local.get $7 i32.const 1023 i32.and i32.add - local.tee $3 + local.tee $1 i32.const 18 i32.shr_u i32.const 240 i32.or i32.store8 - local.get $5 - local.get $3 + local.get $4 + local.get $1 i32.const 12 i32.shr_u i32.const 63 @@ -315,8 +327,8 @@ i32.const 128 i32.or i32.store8 offset=1 - local.get $5 - local.get $3 + local.get $4 + local.get $1 i32.const 6 i32.shr_u i32.const 63 @@ -324,33 +336,33 @@ i32.const 128 i32.or i32.store8 offset=2 - local.get $5 - local.get $3 + local.get $4 + local.get $1 i32.const 63 i32.and i32.const 128 i32.or i32.store8 offset=3 - local.get $1 + local.get $2 i32.const 4 i32.add - local.set $1 - local.get $2 + local.set $2 + local.get $3 i32.const 2 i32.add - local.set $2 + local.set $3 br $continue|0 end end - local.get $5 local.get $4 + local.get $1 i32.const 12 i32.shr_u i32.const 224 i32.or i32.store8 - local.get $5 local.get $4 + local.get $1 i32.const 6 i32.shr_u i32.const 63 @@ -358,973 +370,114 @@ i32.const 128 i32.or i32.store8 offset=1 - local.get $5 local.get $4 + local.get $1 i32.const 63 i32.and i32.const 128 i32.or i32.store8 offset=2 - local.get $1 + local.get $2 i32.const 3 i32.add - local.set $1 + local.set $2 end end - local.get $2 + local.get $3 i32.const 1 i32.add - local.set $2 + local.set $3 br $continue|0 end end - local.get $1 - local.get $6 + local.get $2 + local.get $5 i32.add i32.const 0 i32.store8 - local.get $6 - ) - (func $~lib/internal/string/allocateUnsafe (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - local.get $0 - i32.const 0 - i32.gt_s - local.tee $1 - if - local.get $0 - i32.const 536870910 - i32.le_s - local.set $1 - end - local.get $1 - i32.eqz - if - i32.const 0 - i32.const 104 - i32.const 14 - i32.const 2 - call $~lib/env/abort - unreachable - end - local.get $0 - i32.const 1 - i32.shl - i32.const 4 - i32.add - call $~lib/allocator/arena/__memory_allocate - local.tee $1 - local.get $0 - i32.store - local.get $1 + local.get $5 ) - (func $~lib/internal/memory/memcpy (; 5 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/memory/memory.copy (; 5 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - loop $continue|0 - local.get $1 - i32.const 3 - i32.and - local.get $2 - local.get $2 - select - if - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - br $continue|0 - end - end - local.get $0 - i32.const 3 - i32.and - i32.eqz - if - loop $continue|1 - local.get $2 - i32.const 16 - i32.ge_u - if - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $1 - i32.const 4 - i32.add - i32.load - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $1 - i32.const 8 - i32.add - i32.load - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 12 - i32.add - i32.load - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - br $continue|1 - end - end - local.get $2 - i32.const 8 - i32.and - if - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $1 - i32.const 4 - i32.add - i32.load - i32.store - local.get $1 - i32.const 8 - i32.add - local.set $1 - local.get $0 - i32.const 8 - i32.add - local.set $0 - end + block $~lib/util/memory/memmove|inlined.0 local.get $2 - i32.const 4 - i32.and + local.set $3 + local.get $0 + local.get $1 + i32.eq + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $1 + i32.lt_u if - local.get $0 local.get $1 - i32.load - i32.store - local.get $1 - i32.const 4 - i32.add - local.set $1 + i32.const 7 + i32.and local.get $0 - i32.const 4 - i32.add - local.set $0 - end - local.get $2 - i32.const 2 - i32.and - if - local.get $0 - local.get $1 - i32.load16_u - i32.store16 - local.get $1 - i32.const 2 - i32.add - local.set $1 - local.get $0 - i32.const 2 - i32.add - local.set $0 - end - local.get $2 - i32.const 1 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - end - return - end - local.get $2 - i32.const 32 - i32.ge_u - if - block $break|2 - block $case2|2 - block $case1|2 + i32.const 7 + i32.and + i32.eq + if + loop $continue|0 local.get $0 - i32.const 3 + i32.const 7 i32.and - local.tee $3 - i32.const 1 - i32.ne - if - local.get $3 - i32.const 2 - i32.eq - br_if $case1|2 - local.get $3 - i32.const 3 - i32.eq - br_if $case2|2 - br $break|2 - end - local.get $1 - i32.load - local.set $5 - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 3 - i32.sub - local.set $2 - loop $continue|3 - local.get $2 - i32.const 17 - i32.ge_u - if - local.get $0 - local.get $1 - i32.const 1 - i32.add - i32.load - local.tee $3 - i32.const 8 - i32.shl - local.get $5 - i32.const 24 - i32.shr_u - i32.or - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $3 - i32.const 24 - i32.shr_u - local.get $1 - i32.const 5 - i32.add - i32.load - local.tee $3 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $3 - i32.const 24 - i32.shr_u - local.get $1 - i32.const 9 - i32.add - i32.load - local.tee $3 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 13 - i32.add - i32.load - local.tee $5 - i32.const 8 - i32.shl - local.get $3 - i32.const 24 - i32.shr_u - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - br $continue|3 - end - end - br $break|2 - end - local.get $1 - i32.load - local.set $5 - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 2 - i32.sub - local.set $2 - loop $continue|4 - local.get $2 - i32.const 18 - i32.ge_u if - local.get $0 - local.get $1 - i32.const 2 - i32.add - i32.load - local.tee $3 - i32.const 16 - i32.shl - local.get $5 - i32.const 16 - i32.shr_u - i32.or - i32.store - local.get $0 - i32.const 4 - i32.add local.get $3 - i32.const 16 - i32.shr_u - local.get $1 - i32.const 6 - i32.add - i32.load - local.tee $3 - i32.const 16 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 8 - i32.add + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 local.get $3 - i32.const 16 - i32.shr_u - local.get $1 - i32.const 10 - i32.add - i32.load - local.tee $3 - i32.const 16 - i32.shl - i32.or - i32.store + i32.const 1 + i32.sub + local.set $3 local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 14 + local.tee $2 + i32.const 1 i32.add - i32.load - local.tee $5 - i32.const 16 - i32.shl - local.get $3 - i32.const 16 - i32.shr_u - i32.or - i32.store + local.set $0 local.get $1 - i32.const 16 + local.tee $4 + i32.const 1 i32.add local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 local.get $2 - i32.const 16 - i32.sub - local.set $2 - br $continue|4 + local.get $4 + i32.load8_u + i32.store8 + br $continue|0 end end - br $break|2 - end - local.get $1 - i32.load - local.set $5 - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - loop $continue|5 - local.get $2 - i32.const 19 - i32.ge_u - if - local.get $0 - local.get $1 - i32.const 3 - i32.add - i32.load - local.tee $3 - i32.const 24 - i32.shl - local.get $5 - i32.const 8 - i32.shr_u - i32.or - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $3 - i32.const 8 - i32.shr_u - local.get $1 - i32.const 7 - i32.add - i32.load - local.tee $3 - i32.const 24 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $3 - i32.const 8 - i32.shr_u - local.get $1 - i32.const 11 - i32.add - i32.load - local.tee $3 - i32.const 24 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 15 - i32.add - i32.load - local.tee $5 - i32.const 24 - i32.shl + loop $continue|1 local.get $3 i32.const 8 - i32.shr_u - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - br $continue|5 - end - end - end - end - local.get $2 - i32.const 16 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - end - local.get $2 - i32.const 8 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - end - local.get $2 - i32.const 4 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - end - local.get $2 - i32.const 2 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - end - local.get $2 - i32.const 1 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - end - ) - (func $~lib/internal/memory/memmove (; 6 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - local.get $0 - local.get $1 - i32.eq - if - return - end - local.get $1 - local.get $2 - i32.add - local.get $0 - i32.le_u - local.tee $3 - i32.eqz - if - local.get $0 - local.get $2 - i32.add - local.get $1 - i32.le_u - local.set $3 - end - local.get $3 - if - local.get $0 - local.get $1 - local.get $2 - call $~lib/internal/memory/memcpy - return - end - local.get $0 - local.get $1 - i32.lt_u - if - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and - i32.eq - if - loop $continue|0 - local.get $0 - i32.const 7 - i32.and - if - local.get $2 - i32.eqz + i32.ge_u if - return + local.get $0 + local.get $1 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + br $continue|1 end - local.get $2 - i32.const 1 - i32.sub - local.set $2 + end + end + loop $continue|2 + local.get $3 + if local.get $0 - local.tee $3 + local.tee $2 i32.const 1 i32.add local.set $0 @@ -1333,137 +486,91 @@ i32.const 1 i32.add local.set $1 - local.get $3 + local.get $2 local.get $4 i32.load8_u i32.store8 - br $continue|0 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 end end - loop $continue|1 - local.get $2 - i32.const 8 - i32.ge_u - if - local.get $0 - local.get $1 - i64.load - i64.store - local.get $2 - i32.const 8 - i32.sub - local.set $2 + else + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|3 local.get $0 - i32.const 8 + local.get $3 i32.add - local.set $0 - local.get $1 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + loop $continue|4 + local.get $3 i32.const 8 - i32.add - local.set $1 - br $continue|1 + i32.ge_u + if + local.get $0 + local.get $3 + i32.const 8 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end end end - end - loop $continue|2 - local.get $2 - if - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 + loop $continue|5 local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - br $continue|2 - end - end - else - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and - i32.eq - if - loop $continue|3 - local.get $0 - local.get $2 - i32.add - i32.const 7 - i32.and if - local.get $2 - i32.eqz - if - return - end - local.get $2 + local.get $0 + local.get $3 i32.const 1 i32.sub - local.tee $2 - local.get $0 + local.tee $3 i32.add local.get $1 - local.get $2 + local.get $3 i32.add i32.load8_u i32.store8 - br $continue|3 - end - end - loop $continue|4 - local.get $2 - i32.const 8 - i32.ge_u - if - local.get $2 - i32.const 8 - i32.sub - local.tee $2 - local.get $0 - i32.add - local.get $1 - local.get $2 - i32.add - i64.load - i64.store - br $continue|4 + br $continue|5 end end end - loop $continue|5 - local.get $2 - if - local.get $2 - i32.const 1 - i32.sub - local.tee $2 - local.get $0 - i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 - br $continue|5 - end - end end ) - (func $~lib/string/String.fromUTF8 (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.fromUTF8 (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1473,13 +580,14 @@ i32.const 1 i32.lt_u if - i32.const 64 + i32.const 112 return end local.get $1 i32.const 1 i32.shl - call $~lib/allocator/arena/__memory_allocate + i32.const 0 + call $~lib/rt/stub/__alloc local.set $6 loop $continue|0 local.get $2 @@ -1487,35 +595,32 @@ i32.lt_u if local.get $2 - local.tee $3 + local.tee $4 i32.const 1 i32.add local.set $2 local.get $0 - local.get $3 + local.get $4 i32.add i32.load8_u - local.tee $4 + local.tee $3 i32.const 128 i32.lt_u if local.get $5 local.get $6 i32.add - local.get $4 + local.get $3 i32.store16 else - local.get $4 + local.get $3 + i32.const 224 + i32.lt_u + i32.const 0 + local.get $3 i32.const 191 i32.gt_u - local.tee $3 - if (result i32) - local.get $4 - i32.const 224 - i32.lt_u - else - local.get $3 - end + select if local.get $2 i32.const 1 @@ -1524,14 +629,14 @@ i32.gt_u if i32.const 0 - i32.const 72 - i32.const 512 + i32.const 128 + i32.const 450 i32.const 8 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $2 - local.tee $3 + local.tee $4 i32.const 1 i32.add local.set $2 @@ -1539,12 +644,12 @@ local.get $6 i32.add local.get $0 - local.get $3 + local.get $4 i32.add i32.load8_u i32.const 63 i32.and - local.get $4 + local.get $3 i32.const 31 i32.and i32.const 6 @@ -1552,17 +657,14 @@ i32.or i32.store16 else - local.get $4 + local.get $3 + i32.const 365 + i32.lt_u + i32.const 0 + local.get $3 i32.const 239 i32.gt_u - local.tee $3 - if (result i32) - local.get $4 - i32.const 365 - i32.lt_u - else - local.get $3 - end + select if local.get $2 i32.const 3 @@ -1571,13 +673,13 @@ i32.gt_u if i32.const 0 - i32.const 72 - i32.const 516 + i32.const 128 + i32.const 454 i32.const 8 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $4 + local.get $3 i32.const 7 i32.and i32.const 18 @@ -1603,11 +705,11 @@ i32.const 6 i32.shl i32.or - local.set $3 + local.set $4 local.get $2 i32.const 1 i32.add - local.tee $4 + local.tee $3 i32.const 1 i32.add local.set $2 @@ -1615,16 +717,16 @@ local.get $6 i32.add local.get $0 - local.get $4 + local.get $3 i32.add i32.load8_u i32.const 63 i32.and - local.get $3 + local.get $4 i32.or i32.const 65536 i32.sub - local.tee $3 + local.tee $4 i32.const 10 i32.shr_u i32.const 55296 @@ -1636,7 +738,7 @@ i32.add local.tee $5 i32.add - local.get $3 + local.get $4 i32.const 1023 i32.and i32.const 56320 @@ -1650,13 +752,13 @@ i32.gt_u if i32.const 0 - i32.const 72 - i32.const 528 + i32.const 128 + i32.const 466 i32.const 8 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $4 + local.get $3 i32.const 15 i32.and i32.const 12 @@ -1670,11 +772,11 @@ i32.const 6 i32.shl i32.or - local.set $3 + local.set $4 local.get $2 i32.const 1 i32.add - local.tee $4 + local.tee $3 i32.const 1 i32.add local.set $2 @@ -1682,12 +784,12 @@ local.get $6 i32.add local.get $0 - local.get $4 + local.get $3 i32.add i32.load8_u i32.const 63 i32.and - local.get $3 + local.get $4 i32.or i32.store16 end @@ -1705,38 +807,35 @@ i32.ne if i32.const 0 - i32.const 72 - i32.const 537 + i32.const 128 + i32.const 475 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $5 i32.const 1 - i32.shr_u - call $~lib/internal/string/allocateUnsafe + call $~lib/rt/stub/__alloc local.tee $0 - i32.const 4 - i32.add local.get $6 local.get $5 - call $~lib/internal/memory/memmove + call $~lib/memory/memory.copy local.get $0 ) - (func $~lib/internal/string/compareUnsafe (; 8 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/string/compareImpl (; 7 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) loop $continue|0 local.get $2 if (result i32) local.get $0 - i32.load16_u offset=4 + i32.load16_u local.get $1 - i32.load16_u offset=4 + i32.load16_u i32.sub local.tee $3 i32.eqz else - local.get $2 + i32.const 0 end if local.get $2 @@ -1756,7 +855,7 @@ end local.get $3 ) - (func $~lib/string/String.__eq (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__eq (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 local.get $1 @@ -1765,41 +864,30 @@ i32.const 1 return end - local.get $0 - i32.eqz - local.tee $2 - i32.eqz - if + block $folding-inner0 local.get $1 i32.eqz - local.set $2 - end - local.get $2 - if - i32.const 0 - return - end - local.get $0 - i32.load - local.tee $2 - local.get $1 - i32.load - i32.ne - if - i32.const 0 + i32.const 1 + local.get $0 + select + br_if $folding-inner0 + local.get $0 + call $~lib/string/String#get:length + local.tee $2 + local.get $1 + call $~lib/string/String#get:length + i32.ne + br_if $folding-inner0 + local.get $0 + local.get $1 + local.get $2 + call $~lib/util/string/compareImpl + i32.eqz return end - local.get $0 - local.get $1 - local.get $2 - call $~lib/internal/string/compareUnsafe - i32.eqz + i32.const 0 ) - (func $start:std/string-utf8 (; 10 ;) (type $FUNCSIG$v) - i32.const 192 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset + (func $start:std/string-utf8 (; 9 ;) (type $FUNCSIG$v) global.get $std/string-utf8/str call $~lib/string/String#get:lengthUTF8 global.set $std/string-utf8/len @@ -1808,12 +896,16 @@ i32.ne if i32.const 0 - i32.const 24 + i32.const 56 i32.const 7 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + i32.const 256 + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset global.get $std/string-utf8/str call $~lib/string/String#toUTF8 global.set $std/string-utf8/ptr @@ -1823,10 +915,10 @@ i32.ne if i32.const 0 - i32.const 24 + i32.const 56 i32.const 11 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string-utf8/ptr @@ -1835,10 +927,10 @@ i32.ne if i32.const 0 - i32.const 24 + i32.const 56 i32.const 12 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string-utf8/ptr @@ -1847,10 +939,10 @@ i32.ne if i32.const 0 - i32.const 24 + i32.const 56 i32.const 13 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string-utf8/ptr @@ -1859,10 +951,10 @@ i32.ne if i32.const 0 - i32.const 24 + i32.const 56 i32.const 14 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string-utf8/ptr @@ -1871,10 +963,10 @@ i32.ne if i32.const 0 - i32.const 24 + i32.const 56 i32.const 15 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string-utf8/ptr @@ -1883,10 +975,10 @@ i32.ne if i32.const 0 - i32.const 24 + i32.const 56 i32.const 16 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string-utf8/ptr @@ -1895,10 +987,10 @@ i32.ne if i32.const 0 - i32.const 24 + i32.const 56 i32.const 17 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string-utf8/ptr @@ -1907,10 +999,10 @@ i32.ne if i32.const 0 - i32.const 24 + i32.const 56 i32.const 18 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string-utf8/ptr @@ -1919,10 +1011,10 @@ i32.ne if i32.const 0 - i32.const 24 + i32.const 56 i32.const 19 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string-utf8/ptr @@ -1931,34 +1023,34 @@ i32.ne if i32.const 0 - i32.const 24 + i32.const 56 i32.const 20 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string-utf8/ptr i32.load8_u offset=10 if i32.const 0 - i32.const 24 + i32.const 56 i32.const 21 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string-utf8/ptr i32.const 0 call $~lib/string/String.fromUTF8 - i32.const 64 + i32.const 112 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 24 + i32.const 56 i32.const 23 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string-utf8/ptr @@ -1971,24 +1063,24 @@ i32.eqz if i32.const 0 - i32.const 24 + i32.const 56 i32.const 24 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string-utf8/ptr i32.const 4 call $~lib/string/String.fromUTF8 - i32.const 160 + i32.const 176 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 24 + i32.const 56 i32.const 25 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string-utf8/ptr @@ -1996,15 +1088,15 @@ i32.add i32.const 2 call $~lib/string/String.fromUTF8 - i32.const 168 + i32.const 200 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 24 + i32.const 56 i32.const 26 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string-utf8/ptr @@ -2012,15 +1104,15 @@ i32.add i32.const 4 call $~lib/string/String.fromUTF8 - i32.const 176 + i32.const 224 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 24 + i32.const 56 i32.const 27 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string-utf8/ptr @@ -2028,22 +1120,22 @@ i32.add i32.const 1 call $~lib/string/String.fromUTF8 - i32.const 184 + i32.const 248 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 24 + i32.const 56 i32.const 28 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) - (func $start (; 11 ;) (type $FUNCSIG$v) + (func $start (; 10 ;) (type $FUNCSIG$v) call $start:std/string-utf8 ) - (func $null (; 12 ;) (type $FUNCSIG$v) + (func $null (; 11 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/string-utf8.ts b/tests/compiler/std/string-utf8.ts index f3c6adbd96..cdaf7c90ee 100644 --- a/tests/compiler/std/string-utf8.ts +++ b/tests/compiler/std/string-utf8.ts @@ -1,4 +1,4 @@ -import "allocator/arena"; +/// var str = "𐐷hi𤭢"; // -> f0 90 90 b7 68 69 f0 a4 ad a2 00 @@ -27,4 +27,4 @@ assert(String.fromUTF8(ptr + 4, 2) == "hi"); assert(String.fromUTF8(ptr + 6, 4) == "𤭢"); assert(String.fromUTF8(ptr + 10, 1) == "\0"); -memory.free(ptr); +__free(ptr); diff --git a/tests/compiler/std/string-utf8.untouched.wat b/tests/compiler/std/string-utf8.untouched.wat index 2e1591386d..1fa46698b2 100644 --- a/tests/compiler/std/string-utf8.untouched.wat +++ b/tests/compiler/std/string-utf8.untouched.wat @@ -1,57 +1,51 @@ (module - (type $FUNCSIG$v (func)) (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$viii (func (param i32 i32 i32))) (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$iiiiii (func (param i32 i32 i32 i32 i32) (result i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (type $FUNCSIG$v (func)) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\06\00\00\00\01\d87\dch\00i\00R\d8b\df") - (data (i32.const 24) "\12\00\00\00s\00t\00d\00/\00s\00t\00r\00i\00n\00g\00-\00u\00t\00f\008\00.\00t\00s\00") - (data (i32.const 64) "\00\00\00\00") - (data (i32.const 72) "\0e\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s\00") - (data (i32.const 104) "\17\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s\00") - (data (i32.const 160) "\02\00\00\00\01\d87\dc") - (data (i32.const 168) "\02\00\00\00h\00i\00") - (data (i32.const 176) "\02\00\00\00R\d8b\df") - (data (i32.const 184) "\01\00\00\00\00\00") + (data (i32.const 8) "\0c\00\00\00\01\00\00\00\01\00\00\00\0c\00\00\00\01\d87\dch\00i\00R\d8b\df") + (data (i32.const 40) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00s\00t\00d\00/\00s\00t\00r\00i\00n\00g\00-\00u\00t\00f\008\00.\00t\00s\00") + (data (i32.const 96) "\00\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00") + (data (i32.const 112) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s\00") + (data (i32.const 160) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00\01\d87\dc") + (data (i32.const 184) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00h\00i\00") + (data (i32.const 208) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00R\d8b\df") + (data (i32.const 232) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00\00\00") (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) - (global $std/string-utf8/str (mut i32) (i32.const 8)) + (global $std/string-utf8/str (mut i32) (i32.const 24)) (global $std/string-utf8/len (mut i32) (i32.const 0)) + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) (global $std/string-utf8/ptr (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 192)) + (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/heap/__heap_base i32 (i32.const 252)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) - (func $start:~lib/allocator/arena (; 1 ;) (type $FUNCSIG$v) - global.get $~lib/memory/HEAP_BASE - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset + (func $~lib/string/String#get:length (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u ) (func $~lib/string/String#get:lengthUTF8 (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) i32.const 1 local.set $1 i32.const 0 local.set $2 local.get $0 - i32.load + call $~lib/string/String#get:length local.set $3 block $break|0 loop $continue|0 @@ -59,20 +53,32 @@ local.get $3 i32.lt_u if - block - local.get $0 + local.get $0 + local.get $2 + i32.const 1 + i32.shl + i32.add + i32.load16_u + local.set $4 + local.get $4 + i32.const 128 + i32.lt_u + if + local.get $1 + i32.const 1 + i32.add + local.set $1 local.get $2 i32.const 1 - i32.shl i32.add - i32.load16_u offset=4 - local.set $4 + local.set $2 + else local.get $4 - i32.const 128 + i32.const 2048 i32.lt_u if local.get $1 - i32.const 1 + i32.const 2 i32.add local.set $1 local.get $2 @@ -81,69 +87,53 @@ local.set $2 else local.get $4 - i32.const 2048 - i32.lt_u + i32.const 64512 + i32.and + i32.const 55296 + i32.eq + if (result i32) + local.get $2 + i32.const 1 + i32.add + local.get $3 + i32.lt_u + else + i32.const 0 + end + if (result i32) + local.get $0 + local.get $2 + i32.const 1 + i32.add + i32.const 1 + i32.shl + i32.add + i32.load16_u + i32.const 64512 + i32.and + i32.const 56320 + i32.eq + else + i32.const 0 + end if local.get $1 + i32.const 4 + i32.add + local.set $1 + local.get $2 i32.const 2 i32.add + local.set $2 + else + local.get $1 + i32.const 3 + i32.add local.set $1 local.get $2 i32.const 1 i32.add local.set $2 - else - local.get $4 - i32.const 64512 - i32.and - i32.const 55296 - i32.eq - local.tee $5 - if (result i32) - local.get $2 - i32.const 1 - i32.add - local.get $3 - i32.lt_u - else - local.get $5 - end - local.tee $5 - if (result i32) - local.get $0 - local.get $2 - i32.const 1 - i32.add - i32.const 1 - i32.shl - i32.add - i32.load16_u offset=4 - i32.const 64512 - i32.and - i32.const 56320 - i32.eq - else - local.get $5 - end - if - local.get $1 - i32.const 4 - i32.add - local.set $1 - local.get $2 - i32.const 2 - i32.add - local.set $2 - else - local.get $1 - i32.const 3 - i32.add - local.set $1 - local.get $2 - i32.const 1 - i32.add - local.set $2 - end end end end @@ -153,48 +143,51 @@ end local.get $1 ) - (func $~lib/allocator/arena/__memory_allocate (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/rt/stub/__alloc (; 3 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) + (local $8 i32) local.get $0 - i32.const 1073741824 + i32.const 1073741808 i32.gt_u if unreachable end - global.get $~lib/allocator/arena/offset - local.set $1 - local.get $1 + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.set $2 + local.get $2 local.get $0 - local.tee $2 - i32.const 1 local.tee $3 - local.get $2 + i32.const 1 + local.tee $4 local.get $3 + local.get $4 i32.gt_u select i32.add - i32.const 7 + i32.const 15 i32.add - i32.const 7 + i32.const 15 i32.const -1 i32.xor i32.and - local.set $4 - current_memory local.set $5 - local.get $4 + memory.size + local.set $6 local.get $5 + local.get $6 i32.const 16 i32.shl i32.gt_u if - local.get $4 - local.get $1 + local.get $5 + local.get $2 i32.sub i32.const 65535 i32.add @@ -204,23 +197,23 @@ i32.and i32.const 16 i32.shr_u - local.set $2 - local.get $5 - local.tee $3 - local.get $2 - local.tee $6 - local.get $3 + local.set $3 local.get $6 + local.tee $4 + local.get $3 + local.tee $7 + local.get $4 + local.get $7 i32.gt_s select - local.set $3 - local.get $3 - grow_memory + local.set $4 + local.get $4 + memory.grow i32.const 0 i32.lt_s if - local.get $2 - grow_memory + local.get $3 + memory.grow i32.const 0 i32.lt_s if @@ -228,9 +221,19 @@ end end end - local.get $4 - global.set $~lib/allocator/arena/offset + local.get $5 + global.set $~lib/rt/stub/offset + local.get $2 + i32.const 16 + i32.sub + local.set $8 + local.get $8 local.get $1 + i32.store offset=8 + local.get $8 + local.get $0 + i32.store offset=12 + local.get $2 ) (func $~lib/string/String#toUTF8 (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) @@ -240,261 +243,217 @@ (local $5 i32) (local $6 i32) (local $7 i32) - block $~lib/memory/memory.allocate|inlined.0 (result i32) - local.get $0 - call $~lib/string/String#get:lengthUTF8 - local.set $1 - local.get $1 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.0 - end - local.set $2 + local.get $0 + call $~lib/string/String#get:lengthUTF8 i32.const 0 - local.set $3 + call $~lib/rt/stub/__alloc + local.set $1 + i32.const 0 + local.set $2 local.get $0 - i32.load - local.set $4 + call $~lib/string/String#get:length + local.set $3 i32.const 0 - local.set $5 + local.set $4 block $break|0 loop $continue|0 + local.get $2 local.get $3 - local.get $4 i32.lt_u if - block - local.get $0 - local.get $3 + local.get $0 + local.get $2 + i32.const 1 + i32.shl + i32.add + i32.load16_u + local.set $5 + local.get $5 + i32.const 128 + i32.lt_u + if + local.get $1 + local.get $4 + i32.add + local.get $5 + i32.store8 + local.get $4 i32.const 1 - i32.shl i32.add - i32.load16_u offset=4 - local.set $1 - local.get $1 - i32.const 128 + local.set $4 + local.get $2 + i32.const 1 + i32.add + local.set $2 + else + local.get $5 + i32.const 2048 i32.lt_u if - local.get $2 - local.get $5 - i32.add local.get $1 + local.get $4 + i32.add + local.set $6 + local.get $6 + local.get $5 + i32.const 6 + i32.shr_u + i32.const 192 + i32.or i32.store8 + local.get $6 local.get $5 - i32.const 1 + i32.const 63 + i32.and + i32.const 128 + i32.or + i32.store8 offset=1 + local.get $4 + i32.const 2 i32.add - local.set $5 - local.get $3 + local.set $4 + local.get $2 i32.const 1 i32.add - local.set $3 + local.set $2 else local.get $1 - i32.const 2048 - i32.lt_u - if + local.get $4 + i32.add + local.set $6 + local.get $5 + i32.const 64512 + i32.and + i32.const 55296 + i32.eq + if (result i32) local.get $2 - local.get $5 - i32.add - local.set $6 - local.get $6 - local.get $1 - i32.const 6 - i32.shr_u - i32.const 192 - i32.or - i32.store8 - local.get $6 - local.get $1 - i32.const 63 - i32.and - i32.const 128 - i32.or - i32.store8 offset=1 - local.get $5 - i32.const 2 - i32.add - local.set $5 - local.get $3 i32.const 1 i32.add - local.set $3 + local.get $3 + i32.lt_u else + i32.const 0 + end + if + local.get $0 local.get $2 - local.get $5 + i32.const 1 i32.add - local.set $6 - local.get $1 + i32.const 1 + i32.shl + i32.add + i32.load16_u + local.set $7 + local.get $7 i32.const 64512 i32.and - i32.const 55296 + i32.const 56320 i32.eq - local.tee $7 - if (result i32) - local.get $3 - i32.const 1 - i32.add - local.get $4 - i32.lt_u - else - local.get $7 - end if - local.get $0 - local.get $3 - i32.const 1 - i32.add - i32.const 1 + i32.const 65536 + local.get $5 + i32.const 1023 + i32.and + i32.const 10 i32.shl i32.add - i32.load16_u offset=4 - local.set $7 local.get $7 - i32.const 64512 + i32.const 1023 i32.and - i32.const 56320 - i32.eq - if - i32.const 65536 - local.get $1 - i32.const 1023 - i32.and - i32.const 10 - i32.shl - i32.add - local.get $7 - i32.const 1023 - i32.and - i32.add - local.set $1 - local.get $6 - local.get $1 - i32.const 18 - i32.shr_u - i32.const 240 - i32.or - i32.store8 - local.get $6 - local.get $1 - i32.const 12 - i32.shr_u - i32.const 63 - i32.and - i32.const 128 - i32.or - i32.store8 offset=1 - local.get $6 - local.get $1 - i32.const 6 - i32.shr_u - i32.const 63 - i32.and - i32.const 128 - i32.or - i32.store8 offset=2 - local.get $6 - local.get $1 - i32.const 63 - i32.and - i32.const 128 - i32.or - i32.store8 offset=3 - local.get $5 - i32.const 4 - i32.add - local.set $5 - local.get $3 - i32.const 2 - i32.add - local.set $3 - br $continue|0 - end + i32.add + local.set $5 + local.get $6 + local.get $5 + i32.const 18 + i32.shr_u + i32.const 240 + i32.or + i32.store8 + local.get $6 + local.get $5 + i32.const 12 + i32.shr_u + i32.const 63 + i32.and + i32.const 128 + i32.or + i32.store8 offset=1 + local.get $6 + local.get $5 + i32.const 6 + i32.shr_u + i32.const 63 + i32.and + i32.const 128 + i32.or + i32.store8 offset=2 + local.get $6 + local.get $5 + i32.const 63 + i32.and + i32.const 128 + i32.or + i32.store8 offset=3 + local.get $4 + i32.const 4 + i32.add + local.set $4 + local.get $2 + i32.const 2 + i32.add + local.set $2 + br $continue|0 end - local.get $6 - local.get $1 - i32.const 12 - i32.shr_u - i32.const 224 - i32.or - i32.store8 - local.get $6 - local.get $1 - i32.const 6 - i32.shr_u - i32.const 63 - i32.and - i32.const 128 - i32.or - i32.store8 offset=1 - local.get $6 - local.get $1 - i32.const 63 - i32.and - i32.const 128 - i32.or - i32.store8 offset=2 - local.get $5 - i32.const 3 - i32.add - local.set $5 - local.get $3 - i32.const 1 - i32.add - local.set $3 end + local.get $6 + local.get $5 + i32.const 12 + i32.shr_u + i32.const 224 + i32.or + i32.store8 + local.get $6 + local.get $5 + i32.const 6 + i32.shr_u + i32.const 63 + i32.and + i32.const 128 + i32.or + i32.store8 offset=1 + local.get $6 + local.get $5 + i32.const 63 + i32.and + i32.const 128 + i32.or + i32.store8 offset=2 + local.get $4 + i32.const 3 + i32.add + local.set $4 + local.get $2 + i32.const 1 + i32.add + local.set $2 end end br $continue|0 end end end - local.get $2 - local.get $5 + local.get $1 + local.get $4 i32.add i32.const 0 i32.store8 - local.get $2 + local.get $1 ) - (func $~lib/internal/string/allocateUnsafe (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - local.get $0 - i32.const 0 - i32.gt_s - local.tee $1 - if (result i32) - local.get $0 - i32.const 536870910 - i32.le_s - else - local.get $1 - end - i32.eqz - if - i32.const 0 - i32.const 104 - i32.const 14 - i32.const 2 - call $~lib/env/abort - unreachable - end - block $~lib/memory/memory.allocate|inlined.2 (result i32) - i32.const 4 - local.get $0 - i32.const 1 - i32.shl - i32.add - local.set $1 - local.get $1 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.2 - end - local.set $2 - local.get $2 + (func $~lib/rt/stub/__retain (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - i32.store - local.get $2 ) - (func $~lib/internal/memory/memcpy (; 6 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/memory/memcpy (; 6 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -506,33 +465,31 @@ i32.const 3 i32.and else - local.get $2 + i32.const 0 end if - block - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - local.get $2 + block (result i32) + local.get $0 + local.tee $5 i32.const 1 - i32.sub - local.set $2 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 br $continue|0 end end @@ -549,48 +506,46 @@ i32.const 16 i32.ge_u if - block - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $1 - i32.const 4 - i32.add - i32.load - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $1 - i32.const 8 - i32.add - i32.load - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 12 - i32.add - i32.load - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - end + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 8 + i32.add + i32.load + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 12 + i32.add + i32.load + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 br $continue|1 end end @@ -773,158 +728,22 @@ i32.const 17 i32.ge_u if - block - local.get $1 - i32.const 1 - i32.add - i32.load - local.set $4 - local.get $0 - local.get $3 - i32.const 24 - i32.shr_u - local.get $4 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 5 - i32.add - i32.load - local.set $3 - local.get $0 - i32.const 4 - i32.add - local.get $4 - i32.const 24 - i32.shr_u - local.get $3 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 9 - i32.add - i32.load - local.set $4 - local.get $0 - i32.const 8 - i32.add - local.get $3 - i32.const 24 - i32.shr_u - local.get $4 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 13 - i32.add - i32.load - local.set $3 - local.get $0 - i32.const 12 - i32.add - local.get $4 - i32.const 24 - i32.shr_u - local.get $3 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - end - br $continue|3 - end - end - end - br $break|2 - unreachable - end - unreachable - end - block - local.get $1 - i32.load - local.set $3 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - local.get $2 - i32.const 2 - i32.sub - local.set $2 - block $break|4 - loop $continue|4 - local.get $2 - i32.const 18 - i32.ge_u - if - block local.get $1 - i32.const 2 + i32.const 1 i32.add i32.load local.set $4 local.get $0 local.get $3 - i32.const 16 + i32.const 24 i32.shr_u local.get $4 - i32.const 16 + i32.const 8 i32.shl i32.or i32.store local.get $1 - i32.const 6 + i32.const 5 i32.add i32.load local.set $3 @@ -932,15 +751,15 @@ i32.const 4 i32.add local.get $4 - i32.const 16 + i32.const 24 i32.shr_u local.get $3 - i32.const 16 + i32.const 8 i32.shl i32.or i32.store local.get $1 - i32.const 10 + i32.const 9 i32.add i32.load local.set $4 @@ -948,15 +767,15 @@ i32.const 8 i32.add local.get $3 - i32.const 16 + i32.const 24 i32.shr_u local.get $4 - i32.const 16 + i32.const 8 i32.shl i32.or i32.store local.get $1 - i32.const 14 + i32.const 13 i32.add i32.load local.set $3 @@ -964,10 +783,10 @@ i32.const 12 i32.add local.get $4 - i32.const 16 + i32.const 24 i32.shr_u local.get $3 - i32.const 16 + i32.const 8 i32.shl i32.or i32.store @@ -983,65 +802,81 @@ i32.const 16 i32.sub local.set $2 + br $continue|3 end - br $continue|4 end end + br $break|2 + unreachable end - br $break|2 unreachable end - unreachable - end - block - local.get $1 - i32.load - local.set $3 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) + block local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - block $break|5 - loop $continue|5 - local.get $2 - i32.const 19 - i32.ge_u - if - block + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + block $break|4 + loop $continue|4 + local.get $2 + i32.const 18 + i32.ge_u + if local.get $1 - i32.const 3 + i32.const 2 i32.add i32.load local.set $4 local.get $0 local.get $3 - i32.const 8 + i32.const 16 i32.shr_u local.get $4 - i32.const 24 + i32.const 16 i32.shl i32.or i32.store local.get $1 - i32.const 7 + i32.const 6 i32.add i32.load local.set $3 @@ -1049,15 +884,15 @@ i32.const 4 i32.add local.get $4 - i32.const 8 + i32.const 16 i32.shr_u local.get $3 - i32.const 24 + i32.const 16 i32.shl i32.or i32.store local.get $1 - i32.const 11 + i32.const 10 i32.add i32.load local.set $4 @@ -1065,15 +900,15 @@ i32.const 8 i32.add local.get $3 - i32.const 8 + i32.const 16 i32.shr_u local.get $4 - i32.const 24 + i32.const 16 i32.shl i32.or i32.store local.get $1 - i32.const 15 + i32.const 14 i32.add i32.load local.set $3 @@ -1081,10 +916,10 @@ i32.const 12 i32.add local.get $4 - i32.const 8 + i32.const 16 i32.shr_u local.get $3 - i32.const 24 + i32.const 16 i32.shl i32.or i32.store @@ -1100,7 +935,121 @@ i32.const 16 i32.sub local.set $2 + br $continue|4 end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + block $break|5 + loop $continue|5 + local.get $2 + i32.const 19 + i32.ge_u + if + local.get $1 + i32.const 3 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 7 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 11 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 15 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 br $continue|5 end end @@ -1695,234 +1644,234 @@ i32.store8 end ) - (func $~lib/internal/memory/memmove (; 7 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/memory/memory.copy (; 7 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - local.get $0 - local.get $1 - i32.eq - if - return - end - local.get $1 - local.get $2 - i32.add - local.get $0 - i32.le_u - local.tee $3 - if (result i32) - local.get $3 - else - local.get $0 - local.get $2 - i32.add - local.get $1 - i32.le_u - end - if + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 local.get $0 + local.set $5 local.get $1 + local.set $4 local.get $2 - call $~lib/internal/memory/memcpy - return - end - local.get $0 - local.get $1 - i32.lt_u - if - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and + local.set $3 + local.get $5 + local.get $4 i32.eq if - block $break|0 - loop $continue|0 - local.get $0 - i32.const 7 - i32.and - if - block - local.get $2 + br $~lib/util/memory/memmove|inlined.0 + end + local.get $4 + local.get $3 + i32.add + local.get $5 + i32.le_u + if (result i32) + i32.const 1 + else + local.get $5 + local.get $3 + i32.add + local.get $4 + i32.le_u + end + if + local.get $5 + local.get $4 + local.get $3 + call $~lib/util/memory/memcpy + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 i32.eqz if - return + br $~lib/util/memory/memmove|inlined.0 end - local.get $2 + local.get $3 i32.const 1 i32.sub - local.set $2 + local.set $3 block (result i32) - local.get $0 - local.tee $3 + local.get $5 + local.tee $6 i32.const 1 i32.add - local.set $0 - local.get $3 + local.set $5 + local.get $6 end block (result i32) - local.get $1 - local.tee $3 + local.get $4 + local.tee $6 i32.const 1 i32.add - local.set $1 - local.get $3 + local.set $4 + local.get $6 end i32.load8_u i32.store8 + br $continue|0 end - br $continue|0 end end - end - block $break|1 - loop $continue|1 - local.get $2 - i32.const 8 - i32.ge_u - if - block - local.get $0 - local.get $1 + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 i64.load i64.store - local.get $2 + local.get $3 i32.const 8 i32.sub - local.set $2 - local.get $0 + local.set $3 + local.get $5 i32.const 8 i32.add - local.set $0 - local.get $1 + local.set $5 + local.get $4 i32.const 8 i32.add - local.set $1 + local.set $4 + br $continue|1 end - br $continue|1 end end end - end - block $break|2 - loop $continue|2 - local.get $2 - if - block + block $break|2 + loop $continue|2 + local.get $3 + if block (result i32) - local.get $0 - local.tee $3 + local.get $5 + local.tee $6 i32.const 1 i32.add - local.set $0 - local.get $3 + local.set $5 + local.get $6 end block (result i32) - local.get $1 - local.tee $3 + local.get $4 + local.tee $6 i32.const 1 i32.add - local.set $1 - local.get $3 + local.set $4 + local.get $6 end i32.load8_u i32.store8 - local.get $2 + local.get $3 i32.const 1 i32.sub - local.set $2 + local.set $3 + br $continue|2 end - br $continue|2 end end - end - else - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and - i32.eq - if - block $break|3 - loop $continue|3 - local.get $0 - local.get $2 - i32.add - i32.const 7 - i32.and - if - block - local.get $2 + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 i32.eqz if - return + br $~lib/util/memory/memmove|inlined.0 end - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.const 1 i32.sub - local.tee $2 + local.tee $3 i32.add - local.get $1 - local.get $2 + local.get $4 + local.get $3 i32.add i32.load8_u i32.store8 + br $continue|3 end - br $continue|3 end end - end - block $break|4 - loop $continue|4 - local.get $2 - i32.const 8 - i32.ge_u - if - block - local.get $2 + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 i32.const 8 i32.sub - local.set $2 - local.get $0 - local.get $2 + local.set $3 + local.get $5 + local.get $3 i32.add - local.get $1 - local.get $2 + local.get $4 + local.get $3 i32.add i64.load i64.store + br $continue|4 end - br $continue|4 end end end - end - block $break|5 - loop $continue|5 - local.get $2 - if - local.get $0 - local.get $2 - i32.const 1 - i32.sub - local.tee $2 - i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 - br $continue|5 + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end end end end end ) - (func $~lib/allocator/arena/__memory_free (; 8 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/stub/__free (; 8 ;) (type $FUNCSIG$vi) (param $0 i32) nop ) (func $~lib/string/String.fromUTF8 (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) @@ -1932,95 +1881,253 @@ (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) local.get $1 i32.const 1 i32.lt_u if - i32.const 64 + i32.const 112 + call $~lib/rt/stub/__retain return end i32.const 0 local.set $2 - block $~lib/memory/memory.allocate|inlined.1 (result i32) - local.get $1 - i32.const 1 - i32.shl - local.set $3 - local.get $3 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.1 - end - local.set $4 + local.get $1 + i32.const 1 + i32.shl i32.const 0 - local.set $5 + call $~lib/rt/stub/__alloc + local.set $3 + i32.const 0 + local.set $4 block $break|0 loop $continue|0 local.get $2 local.get $1 i32.lt_u if - block - local.get $0 - block (result i32) + local.get $0 + block (result i32) + local.get $2 + local.tee $5 + i32.const 1 + i32.add + local.set $2 + local.get $5 + end + i32.add + i32.load8_u + local.set $5 + local.get $5 + i32.const 128 + i32.lt_u + if + local.get $3 + local.get $4 + i32.add + local.get $5 + i32.store16 + local.get $4 + i32.const 2 + i32.add + local.set $4 + else + local.get $5 + i32.const 191 + i32.gt_u + if (result i32) + local.get $5 + i32.const 224 + i32.lt_u + else + i32.const 0 + end + if local.get $2 - local.tee $3 i32.const 1 i32.add - local.set $2 + local.get $1 + i32.le_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 450 + i32.const 8 + call $~lib/builtins/abort + unreachable + end local.get $3 - end - i32.add - i32.load8_u - local.set $3 - local.get $3 - i32.const 128 - i32.lt_u - if local.get $4 + i32.add local.get $5 + i32.const 31 + i32.and + i32.const 6 + i32.shl + local.get $0 + block (result i32) + local.get $2 + local.tee $6 + i32.const 1 + i32.add + local.set $2 + local.get $6 + end i32.add - local.get $3 + i32.load8_u + i32.const 63 + i32.and + i32.or i32.store16 - local.get $5 + local.get $4 i32.const 2 i32.add - local.set $5 + local.set $4 else - local.get $3 - i32.const 191 + local.get $5 + i32.const 239 i32.gt_u - local.tee $6 if (result i32) - local.get $3 - i32.const 224 + local.get $5 + i32.const 365 i32.lt_u else - local.get $6 - end - if + i32.const 0 + end + if + local.get $2 + i32.const 3 + i32.add + local.get $1 + i32.le_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 454 + i32.const 8 + call $~lib/builtins/abort + unreachable + end + local.get $5 + i32.const 7 + i32.and + i32.const 18 + i32.shl + local.get $0 + block (result i32) + local.get $2 + local.tee $6 + i32.const 1 + i32.add + local.set $2 + local.get $6 + end + i32.add + i32.load8_u + i32.const 63 + i32.and + i32.const 12 + i32.shl + i32.or + local.get $0 + block (result i32) + local.get $2 + local.tee $6 + i32.const 1 + i32.add + local.set $2 + local.get $6 + end + i32.add + i32.load8_u + i32.const 63 + i32.and + i32.const 6 + i32.shl + i32.or + local.get $0 + block (result i32) + local.get $2 + local.tee $6 + i32.const 1 + i32.add + local.set $2 + local.get $6 + end + i32.add + i32.load8_u + i32.const 63 + i32.and + i32.or + i32.const 65536 + i32.sub + local.set $5 + local.get $3 + local.get $4 + i32.add + i32.const 55296 + local.get $5 + i32.const 10 + i32.shr_u + i32.add + i32.store16 + local.get $4 + i32.const 2 + i32.add + local.set $4 + local.get $3 + local.get $4 + i32.add + i32.const 56320 + local.get $5 + i32.const 1023 + i32.and + i32.add + i32.store16 + local.get $4 + i32.const 2 + i32.add + local.set $4 + else local.get $2 - i32.const 1 + i32.const 2 i32.add local.get $1 i32.le_u i32.eqz if i32.const 0 - i32.const 72 - i32.const 512 + i32.const 128 + i32.const 466 i32.const 8 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $3 local.get $4 + i32.add local.get $5 + i32.const 15 + i32.and + i32.const 12 + i32.shl + local.get $0 + block (result i32) + local.get $2 + local.tee $6 + i32.const 1 + i32.add + local.set $2 + local.get $6 + end i32.add - local.get $3 - i32.const 31 + i32.load8_u + i32.const 63 i32.and i32.const 6 i32.shl + i32.or local.get $0 block (result i32) local.get $2 @@ -2036,176 +2143,10 @@ i32.and i32.or i32.store16 - local.get $5 + local.get $4 i32.const 2 i32.add - local.set $5 - else - local.get $3 - i32.const 239 - i32.gt_u - local.tee $6 - if (result i32) - local.get $3 - i32.const 365 - i32.lt_u - else - local.get $6 - end - if - local.get $2 - i32.const 3 - i32.add - local.get $1 - i32.le_u - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 516 - i32.const 8 - call $~lib/env/abort - unreachable - end - local.get $3 - i32.const 7 - i32.and - i32.const 18 - i32.shl - local.get $0 - block (result i32) - local.get $2 - local.tee $6 - i32.const 1 - i32.add - local.set $2 - local.get $6 - end - i32.add - i32.load8_u - i32.const 63 - i32.and - i32.const 12 - i32.shl - i32.or - local.get $0 - block (result i32) - local.get $2 - local.tee $6 - i32.const 1 - i32.add - local.set $2 - local.get $6 - end - i32.add - i32.load8_u - i32.const 63 - i32.and - i32.const 6 - i32.shl - i32.or - local.get $0 - block (result i32) - local.get $2 - local.tee $6 - i32.const 1 - i32.add - local.set $2 - local.get $6 - end - i32.add - i32.load8_u - i32.const 63 - i32.and - i32.or - i32.const 65536 - i32.sub - local.set $3 - local.get $4 - local.get $5 - i32.add - i32.const 55296 - local.get $3 - i32.const 10 - i32.shr_u - i32.add - i32.store16 - local.get $5 - i32.const 2 - i32.add - local.set $5 - local.get $4 - local.get $5 - i32.add - i32.const 56320 - local.get $3 - i32.const 1023 - i32.and - i32.add - i32.store16 - local.get $5 - i32.const 2 - i32.add - local.set $5 - else - local.get $2 - i32.const 2 - i32.add - local.get $1 - i32.le_u - i32.eqz - if - i32.const 0 - i32.const 72 - i32.const 528 - i32.const 8 - call $~lib/env/abort - unreachable - end - local.get $4 - local.get $5 - i32.add - local.get $3 - i32.const 15 - i32.and - i32.const 12 - i32.shl - local.get $0 - block (result i32) - local.get $2 - local.tee $6 - i32.const 1 - i32.add - local.set $2 - local.get $6 - end - i32.add - i32.load8_u - i32.const 63 - i32.and - i32.const 6 - i32.shl - i32.or - local.get $0 - block (result i32) - local.get $2 - local.tee $6 - i32.const 1 - i32.add - local.set $2 - local.get $6 - end - i32.add - i32.load8_u - i32.const 63 - i32.and - i32.or - i32.store16 - local.get $5 - i32.const 2 - i32.add - local.set $5 - end + local.set $4 end end end @@ -2219,44 +2160,39 @@ i32.eqz if i32.const 0 - i32.const 72 - i32.const 537 + i32.const 128 + i32.const 475 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $5 + local.get $4 i32.const 1 - i32.shr_u - call $~lib/internal/string/allocateUnsafe + call $~lib/rt/stub/__alloc local.set $7 - block $~lib/memory/memory.copy|inlined.0 - local.get $7 - i32.const 4 - i32.add - local.set $3 - local.get $4 - local.set $6 - local.get $5 - local.set $8 - local.get $3 - local.get $6 - local.get $8 - call $~lib/internal/memory/memmove - end - block $~lib/memory/memory.free|inlined.0 - local.get $4 - local.set $8 - local.get $8 - call $~lib/allocator/arena/__memory_free - br $~lib/memory/memory.free|inlined.0 - end local.get $7 + local.get $3 + local.get $4 + call $~lib/memory/memory.copy + local.get $3 + call $~lib/rt/stub/__free + local.get $7 + call $~lib/rt/stub/__retain + ) + (func $~lib/rt/stub/__release (; 10 ;) (type $FUNCSIG$vi) (param $0 i32) + nop ) - (func $~lib/internal/string/compareUnsafe (; 10 ;) (type $FUNCSIG$iiiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) + (func $~lib/util/string/compareImpl (; 11 ;) (type $FUNCSIG$iiiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) (local $5 i32) (local $6 i32) (local $7 i32) + (local $8 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $2 + call $~lib/rt/stub/__retain + drop i32.const 0 local.set $5 local.get $0 @@ -2276,52 +2212,67 @@ local.get $4 if (result i32) local.get $6 - i32.load16_u offset=4 + i32.load16_u local.get $7 - i32.load16_u offset=4 + i32.load16_u i32.sub local.tee $5 i32.eqz else - local.get $4 + i32.const 0 end if - block - local.get $4 - i32.const 1 - i32.sub - local.set $4 - local.get $6 - i32.const 2 - i32.add - local.set $6 - local.get $7 - i32.const 2 - i32.add - local.set $7 - end + local.get $4 + i32.const 1 + i32.sub + local.set $4 + local.get $6 + i32.const 2 + i32.add + local.set $6 + local.get $7 + i32.const 2 + i32.add + local.set $7 br $continue|0 end end end local.get $5 + local.set $8 + local.get $0 + call $~lib/rt/stub/__release + local.get $2 + call $~lib/rt/stub/__release + local.get $8 ) - (func $~lib/string/String.__eq (; 11 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__eq (; 12 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $1 + call $~lib/rt/stub/__retain + drop + local.get $0 local.get $1 i32.eq if i32.const 1 + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 return end local.get $0 i32.const 0 i32.eq - local.tee $2 if (result i32) - local.get $2 + i32.const 1 else local.get $1 i32.const 0 @@ -2329,17 +2280,29 @@ end if i32.const 0 + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 return end local.get $0 - i32.load + call $~lib/string/String#get:length local.set $3 local.get $3 local.get $1 - i32.load + call $~lib/string/String#get:length i32.ne if i32.const 0 + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 return end local.get $0 @@ -2347,12 +2310,22 @@ local.get $1 i32.const 0 local.get $3 - call $~lib/internal/string/compareUnsafe + call $~lib/util/string/compareImpl i32.eqz + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 ) - (func $start:std/string-utf8 (; 12 ;) (type $FUNCSIG$v) + (func $start:std/string-utf8 (; 13 ;) (type $FUNCSIG$v) (local $0 i32) - call $start:~lib/allocator/arena + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) global.get $std/string-utf8/str call $~lib/string/String#get:lengthUTF8 global.set $std/string-utf8/len @@ -2362,12 +2335,22 @@ i32.eqz if i32.const 0 - i32.const 24 + i32.const 56 i32.const 7 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset global.get $std/string-utf8/str call $~lib/string/String#toUTF8 global.set $std/string-utf8/ptr @@ -2378,10 +2361,10 @@ i32.eqz if i32.const 0 - i32.const 24 + i32.const 56 i32.const 11 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string-utf8/ptr @@ -2391,10 +2374,10 @@ i32.eqz if i32.const 0 - i32.const 24 + i32.const 56 i32.const 12 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string-utf8/ptr @@ -2404,10 +2387,10 @@ i32.eqz if i32.const 0 - i32.const 24 + i32.const 56 i32.const 13 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string-utf8/ptr @@ -2417,10 +2400,10 @@ i32.eqz if i32.const 0 - i32.const 24 + i32.const 56 i32.const 14 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string-utf8/ptr @@ -2430,10 +2413,10 @@ i32.eqz if i32.const 0 - i32.const 24 + i32.const 56 i32.const 15 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string-utf8/ptr @@ -2443,10 +2426,10 @@ i32.eqz if i32.const 0 - i32.const 24 + i32.const 56 i32.const 16 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string-utf8/ptr @@ -2456,10 +2439,10 @@ i32.eqz if i32.const 0 - i32.const 24 + i32.const 56 i32.const 17 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string-utf8/ptr @@ -2469,10 +2452,10 @@ i32.eqz if i32.const 0 - i32.const 24 + i32.const 56 i32.const 18 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string-utf8/ptr @@ -2482,10 +2465,10 @@ i32.eqz if i32.const 0 - i32.const 24 + i32.const 56 i32.const 19 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string-utf8/ptr @@ -2495,10 +2478,10 @@ i32.eqz if i32.const 0 - i32.const 24 + i32.const 56 i32.const 20 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string-utf8/ptr @@ -2508,24 +2491,25 @@ i32.eqz if i32.const 0 - i32.const 24 + i32.const 56 i32.const 21 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string-utf8/ptr i32.const 0 call $~lib/string/String.fromUTF8 - i32.const 64 + local.tee $0 + i32.const 112 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 24 + i32.const 56 i32.const 23 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string-utf8/ptr @@ -2533,29 +2517,31 @@ i32.const 1 i32.sub call $~lib/string/String.fromUTF8 + local.tee $1 global.get $std/string-utf8/str call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 24 + i32.const 56 i32.const 24 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string-utf8/ptr i32.const 4 call $~lib/string/String.fromUTF8 - i32.const 160 + local.tee $2 + i32.const 176 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 24 + i32.const 56 i32.const 25 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string-utf8/ptr @@ -2563,15 +2549,16 @@ i32.add i32.const 2 call $~lib/string/String.fromUTF8 - i32.const 168 + local.tee $3 + i32.const 200 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 24 + i32.const 56 i32.const 26 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string-utf8/ptr @@ -2579,15 +2566,16 @@ i32.add i32.const 4 call $~lib/string/String.fromUTF8 - i32.const 176 + local.tee $4 + i32.const 224 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 24 + i32.const 56 i32.const 27 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string-utf8/ptr @@ -2595,28 +2583,36 @@ i32.add i32.const 1 call $~lib/string/String.fromUTF8 - i32.const 184 + local.tee $5 + i32.const 248 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 24 + i32.const 56 i32.const 28 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block $~lib/memory/memory.free|inlined.1 - global.get $std/string-utf8/ptr - local.set $0 - local.get $0 - call $~lib/allocator/arena/__memory_free - br $~lib/memory/memory.free|inlined.1 - end + global.get $std/string-utf8/ptr + call $~lib/rt/stub/__free + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 + call $~lib/rt/stub/__release + local.get $3 + call $~lib/rt/stub/__release + local.get $4 + call $~lib/rt/stub/__release + local.get $5 + call $~lib/rt/stub/__release ) - (func $start (; 13 ;) (type $FUNCSIG$v) + (func $start (; 14 ;) (type $FUNCSIG$v) call $start:std/string-utf8 ) - (func $null (; 14 ;) (type $FUNCSIG$v) + (func $null (; 15 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/std/string.json b/tests/compiler/std/string.json new file mode 100644 index 0000000000..59c251c705 --- /dev/null +++ b/tests/compiler/std/string.json @@ -0,0 +1,7 @@ +{ + "asc_flags": [ + "--runtime half", + "--explicitStart", + "--use ASC_RTRACE=1" + ] +} \ No newline at end of file diff --git a/tests/compiler/std/string.optimized.wat b/tests/compiler/std/string.optimized.wat index bdbcd96d04..f2eb774942 100644 --- a/tests/compiler/std/string.optimized.wat +++ b/tests/compiler/std/string.optimized.wat @@ -1,11 +1,12 @@ (module - (type $FUNCSIG$v (func)) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) - (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$v (func)) (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$viii (func (param i32 i32 i32))) - (type $FUNCSIG$viiiii (func (param i32 i32 i32 i32 i32))) (type $FUNCSIG$di (func (param i32) (result f64))) (type $FUNCSIG$ij (func (param i64) (result i32))) (type $FUNCSIG$viji (func (param i32 i64 i32))) @@ -14,2130 +15,2317 @@ (type $FUNCSIG$iijijiji (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) (type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$iiiii (func (param i32 i32 i32 i32) (result i32))) - (type $FUNCSIG$vii (func (param i32 i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "onincrement" (func $~lib/rt/rtrace/onincrement (param i32))) + (import "rtrace" "ondecrement" (func $~lib/rt/rtrace/ondecrement (param i32))) + (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) + (import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00h\00i\00,\00 \00I\00\'\00m\00 \00a\00 \00s\00t\00r\00i\00n\00g") - (data (i32.const 48) "\0d\00\00\00s\00t\00d\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s") - (data (i32.const 80) "\0e\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s") - (data (i32.const 120) "\01") - (data (i32.const 128) "\01\00\00\00a") - (data (i32.const 136) "\17\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s") - (data (i32.const 192) "\01\00\00\006") - (data (i32.const 200) "\02\00\00\004\d8\06\df") - (data (i32.const 208) "\02\00\00\00h\00i") - (data (i32.const 216) "\04\00\00\00n\00u\00l\00l") - (data (i32.const 232) "\06\00\00\00s\00t\00r\00i\00n\00g") - (data (i32.const 248) "\03\00\00\00I\00\'\00m") - (data (i32.const 264) "\01\00\00\00 ") - (data (i32.const 272) "\03\00\00\00 \00 \00 ") - (data (i32.const 288) "\03\00\00\00a\00b\00c") - (data (i32.const 304) "\05\00\00\00 \00 \00a\00b\00c") - (data (i32.const 320) "\03\00\00\001\002\003") - (data (i32.const 336) "\06\00\00\001\002\003\00a\00b\00c") - (data (i32.const 352) "\08\00\00\001\002\003\001\002\00a\00b\00c") - (data (i32.const 376) "\05\00\00\00a\00b\00c\00 \00 ") - (data (i32.const 392) "\06\00\00\00a\00b\00c\00a\00b\00c") - (data (i32.const 408) "\08\00\00\00a\00b\00c\00a\00b\00c\00a\00b") - (data (i32.const 432) "\01\00\00\00,") - (data (i32.const 440) "\01\00\00\00x") - (data (i32.const 448) "\03\00\00\00,\00 \00I") - (data (i32.const 464) "\01\00\00\00g") - (data (i32.const 472) "\01\00\00\00i") - (data (i32.const 480) "\01\00\00\000") - (data (i32.const 488) "\01\00\00\001") - (data (i32.const 496) "\05\00\00\000\00b\001\000\001") - (data (i32.const 512) "\05\00\00\000\00o\007\000\007") - (data (i32.const 528) "\05\00\00\000\00x\00f\000\00f") - (data (i32.const 544) "\05\00\00\000\00x\00F\000\00F") - (data (i32.const 560) "\03\00\00\000\001\001") - (data (i32.const 576) "\04\00\00\000\00x\001\00g") - (data (i32.const 592) "\03\00\00\000\00.\001") - (data (i32.const 608) "\03\00\00\00.\002\005") - (data (i32.const 624) "\08\00\00\00.\001\00f\00o\00o\00b\00a\00r") - (data (i32.const 648) "\01\00\00\00b") - (data (i32.const 656) "\02\00\00\00a\00b") - (data (i32.const 664) "\04\00\00\00k\00e\00y\001") - (data (i32.const 680) "\04\00\00\00k\00e\00y\002") - (data (i32.const 696) "\03\00\00\00k\00e\001") - (data (i32.const 712) "\03\00\00\00k\00e\002") - (data (i32.const 728) "\05\00\00\00k\00e\00y\001\002") - (data (i32.const 744) "\05\00\00\00k\00e\00y\001\001") - (data (i32.const 760) "\07\00\00\00\a40\ed0\cf0\cb0\db0\d80\c80") - (data (i32.const 784) "\07\00\00\00\a60\f00\ce0\aa0\af0\e40\de0") - (data (i32.const 808) "\0b\00\00\00D\00\19 f\00h\00u\00a\00s\00c\00a\00i\00l") - (data (i32.const 840) "\n\00\00\00D\00\19 \1f\1eu\00a\00s\00c\00a\00i\00l") - (data (i32.const 864) "\02\00\00\00b\00a") - (data (i32.const 872) "\02\00\00\00a\00a") - (data (i32.const 880) "\03\00\00\00a\00a\00a") - (data (i32.const 896) "\08\00\00\00a\00b\00a\00b\00a\00b\00a\00b") - (data (i32.const 920) "\05\00\00\00a\00a\00a\00a\00a") - (data (i32.const 936) "\06\00\00\00a\00a\00a\00a\00a\00a") - (data (i32.const 952) "\07\00\00\00a\00a\00a\00a\00a\00a\00a") - (data (i32.const 976) "\0e\00\00\00a\00b\00c\00d\00e\00f\00g\00h\00i\00j\00k\00l\00m\00n") - (data (i32.const 1008) "\01\00\00\00n") - (data (i32.const 1016) "\05\00\00\00j\00k\00l\00m\00n") - (data (i32.const 1032) "\05\00\00\00c\00d\00e\00f\00g") - (data (i32.const 1048) "\05\00\00\00d\00e\00f\00g\00h") - (data (i32.const 1064) "\0d\00\00\00a\00b\00c\00d\00e\00f\00g\00h\00i\00j\00k\00l\00m") - (data (i32.const 1096) "\0d\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s") - (data (i32.const 1128) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") - (data (i32.const 1192) "\05\00\00\00a\00,\00b\00,\00c") - (data (i32.const 1208) "\01\00\00\00.") - (data (i32.const 1216) "\01\00\00\00c") - (data (i32.const 1224) "\07\00\00\00a\00,\00 \00b\00,\00 \00c") - (data (i32.const 1248) "\02\00\00\00,\00 ") - (data (i32.const 1256) "\06\00\00\00a\00,\00b\00,\00,\00c") - (data (i32.const 1272) "\06\00\00\00,\00a\00,\00b\00,\00c") - (data (i32.const 1288) "\06\00\00\00a\00,\00b\00,\00c\00,") - (data (i32.const 1304) "\90\01\00\00\00\00\00\000\000\000\001\000\002\000\003\000\004\000\005\000\006\000\007\000\008\000\009\001\000\001\001\001\002\001\003\001\004\001\005\001\006\001\007\001\008\001\009\002\000\002\001\002\002\002\003\002\004\002\005\002\006\002\007\002\008\002\009\003\000\003\001\003\002\003\003\003\004\003\005\003\006\003\007\003\008\003\009\004\000\004\001\004\002\004\003\004\004\004\005\004\006\004\007\004\008\004\009\005\000\005\001\005\002\005\003\005\004\005\005\005\006\005\007\005\008\005\009\006\000\006\001\006\002\006\003\006\004\006\005\006\006\006\007\006\008\006\009\007\000\007\001\007\002\007\003\007\004\007\005\007\006\007\007\007\008\007\009\008\000\008\001\008\002\008\003\008\004\008\005\008\006\008\007\008\008\008\009\009\000\009\001\009\002\009\003\009\004\009\005\009\006\009\007\009\008\009\009") - (data (i32.const 1816) "\18\05\00\00d") - (data (i32.const 1824) "\01\00\00\008") - (data (i32.const 1832) "\05\00\00\00-\001\000\000\000") - (data (i32.const 1848) "\04\00\00\001\002\003\004") - (data (i32.const 1864) "\05\00\00\001\002\003\004\005") - (data (i32.const 1880) "\06\00\00\001\002\003\004\005\006") - (data (i32.const 1896) "\07\00\00\001\001\001\001\001\001\001") - (data (i32.const 1920) "\07\00\00\001\002\003\004\005\006\007") - (data (i32.const 1944) "\n\00\00\002\001\004\007\004\008\003\006\004\006") - (data (i32.const 1968) "\n\00\00\002\001\004\007\004\008\003\006\004\007") - (data (i32.const 1992) "\0b\00\00\00-\002\001\004\007\004\008\003\006\004\008") - (data (i32.const 2024) "\02\00\00\00-\001") - (data (i32.const 2032) "\04\00\00\001\000\000\000") - (data (i32.const 2048) "\n\00\00\002\001\004\007\004\008\003\006\004\008") - (data (i32.const 2072) "\n\00\00\004\002\009\004\009\006\007\002\009\005") - (data (i32.const 2096) "\08\00\00\009\009\009\009\009\009\009\009") - (data (i32.const 2120) "\t\00\00\001\000\000\000\000\000\000\000\000") - (data (i32.const 2144) "\0b\00\00\006\008\007\001\009\004\007\006\007\003\005") - (data (i32.const 2176) "\0c\00\00\008\006\008\007\001\009\004\007\006\007\003\005") - (data (i32.const 2208) "\0f\00\00\009\009\009\008\006\008\007\001\009\004\007\006\007\003\005") - (data (i32.const 2248) "\10\00\00\009\009\009\009\008\006\008\007\001\009\004\007\006\007\003\005") - (data (i32.const 2288) "\11\00\00\001\009\009\009\009\008\006\008\007\001\009\004\007\006\007\003\005") - (data (i32.const 2328) "\14\00\00\001\008\004\004\006\007\004\004\000\007\003\007\000\009\005\005\001\006\001\005") - (data (i32.const 2376) "\05\00\00\00-\001\002\003\004") - (data (i32.const 2392) "\0b\00\00\00-\004\002\009\004\009\006\007\002\009\005") - (data (i32.const 2424) "\0c\00\00\00-\006\008\007\001\009\004\007\006\007\003\005") - (data (i32.const 2456) "\0d\00\00\00-\008\006\008\007\001\009\004\007\006\007\003\005") - (data (i32.const 2488) "\10\00\00\00-\009\009\009\008\006\008\007\001\009\004\007\006\007\003\005") - (data (i32.const 2528) "\12\00\00\00-\001\009\009\009\009\008\006\008\007\001\009\004\007\006\007\003\005") - (data (i32.const 2568) "\13\00\00\009\002\002\003\003\007\002\000\003\006\008\005\004\007\007\005\008\000\007") - (data (i32.const 2616) "\14\00\00\00-\009\002\002\003\003\007\002\000\003\006\008\005\004\007\007\005\008\000\008") - (data (i32.const 2664) "\03\00\00\000\00.\000") - (data (i32.const 2680) "\03\00\00\00N\00a\00N") - (data (i32.const 2696) "\t\00\00\00-\00I\00n\00f\00i\00n\00i\00t\00y") - (data (i32.const 2720) "\08\00\00\00I\00n\00f\00i\00n\00i\00t\00y") - (data (i32.const 2744) "\b8\02\00\00\00\00\00\00\88\02\1c\08\a0\d5\8f\fav\bf>\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\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a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8 (; 21 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) + (func $~lib/util/string/parse (; 40 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) (local $1 i32) (local $2 i32) (local $3 i32) @@ -2211,630 +2432,776 @@ (local $5 f64) (local $6 f64) local.get $0 - i32.load - local.tee $2 - i32.eqz - if - f64.const nan:0x8000000000000 - return - end - local.get $0 - i32.load16_u offset=4 - local.tee $1 - i32.const 45 - i32.eq - if (result f64) - local.get $2 - i32.const 1 - i32.sub - local.tee $2 + call $~lib/rt/pure/__retain + drop + block $folding-inner0 + local.get $0 + call $~lib/string/String#get:length + local.tee $3 i32.eqz - if - f64.const nan:0x8000000000000 - return - end + br_if $folding-inner0 local.get $0 - i32.const 2 - i32.add - local.tee $0 - i32.load16_u offset=4 + local.tee $2 + i32.load16_u local.set $1 - f64.const -1 - else + loop $continue|0 + local.get $1 + call $~lib/util/string/isWhiteSpaceOrLineTerminator + if + local.get $2 + i32.const 2 + i32.add + local.tee $2 + i32.load16_u + local.set $1 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|0 + end + end local.get $1 - i32.const 43 + i32.const 45 i32.eq - if - local.get $2 + if (result f64) + local.get $3 i32.const 1 i32.sub - local.tee $2 + local.tee $3 i32.eqz - if - f64.const nan:0x8000000000000 - return - end - local.get $0 + br_if $folding-inner0 + local.get $2 i32.const 2 i32.add - local.tee $0 - i32.load16_u offset=4 + local.tee $2 + i32.load16_u local.set $1 + f64.const -1 + else + local.get $1 + i32.const 43 + i32.eq + if + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.eqz + if + local.get $0 + call $~lib/rt/pure/__release + f64.const nan:0x8000000000000 + return + end + local.get $2 + i32.const 2 + i32.add + local.tee $2 + i32.load16_u + local.set $1 + end + f64.const 1 end - f64.const 1 - end - local.set $6 - local.get $1 - i32.const 48 - i32.eq - local.tee $4 - if (result i32) - local.get $2 + local.set $6 + local.get $3 i32.const 2 i32.gt_s - else - local.get $4 - end - if (result i32) - block $break|0 (result i32) - block $case6|0 - block $case5|0 - block $case3|0 - block $case1|0 - local.get $0 + i32.const 0 + local.get $1 + i32.const 48 + i32.eq + select + if (result i32) + block $break|1 (result i32) + block $case6|1 + block $case5|1 + block $case3|1 + local.get $2 i32.const 2 i32.add - i32.load16_u offset=4 + i32.load16_u local.tee $1 i32.const 66 i32.eq - br_if $case1|0 local.get $1 i32.const 98 i32.eq - br_if $case1|0 - local.get $1 - i32.const 79 - i32.eq - br_if $case3|0 - local.get $1 - i32.const 111 - i32.eq - br_if $case3|0 - local.get $1 - i32.const 88 - i32.eq - br_if $case5|0 - local.get $1 - i32.const 120 - i32.eq - br_if $case5|0 - br $case6|0 + i32.or + i32.eqz + if + local.get $1 + i32.const 79 + i32.eq + local.get $1 + i32.const 111 + i32.eq + i32.or + br_if $case3|1 + local.get $1 + i32.const 88 + i32.eq + local.get $1 + i32.const 120 + i32.eq + i32.or + br_if $case5|1 + br $case6|1 + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + local.get $3 + i32.const 2 + i32.sub + local.set $3 + i32.const 2 + br $break|1 end - local.get $0 + local.get $2 i32.const 4 i32.add - local.set $0 - local.get $2 - i32.const 2 - i32.sub local.set $2 + local.get $3 i32.const 2 - br $break|0 - end - local.get $0 - i32.const 4 - i32.add - local.set $0 - local.get $2 - i32.const 2 - i32.sub - local.set $2 - i32.const 8 - br $break|0 - end - local.get $0 - i32.const 4 - i32.add - local.set $0 - local.get $2 - i32.const 2 - i32.sub - local.set $2 - i32.const 16 - br $break|0 - end - i32.const 10 - end - else - i32.const 10 - end - local.set $4 - loop $continue|1 - block $break|1 - local.get $2 - local.tee $1 - i32.const 1 - i32.sub - local.set $2 - local.get $1 - if - local.get $0 - i32.load16_u offset=4 - local.tee $3 - i32.const 48 - i32.ge_s - local.tee $1 - if (result i32) + i32.sub + local.set $3 + i32.const 8 + br $break|1 + end + local.get $2 + i32.const 4 + i32.add + local.set $2 local.get $3 - i32.const 57 - i32.le_s - else - local.get $1 + i32.const 2 + i32.sub + local.set $3 + i32.const 16 + br $break|1 end - if (result i32) - local.get $3 + i32.const 10 + end + else + i32.const 10 + end + local.set $4 + loop $continue|2 + block $break|2 + local.get $3 + local.tee $1 + i32.const 1 + i32.sub + local.set $3 + local.get $1 + if + local.get $2 + i32.load16_u + local.tee $1 i32.const 48 - i32.sub - else - local.get $3 - i32.const 65 i32.ge_s - local.tee $1 if (result i32) - local.get $3 - i32.const 90 + local.get $1 + i32.const 57 i32.le_s else - local.get $1 + i32.const 0 end if (result i32) - local.get $3 - i32.const 55 + local.get $1 + i32.const 48 i32.sub else - local.get $3 - i32.const 97 + local.get $1 + i32.const 90 + i32.le_s + i32.const 0 + local.get $1 + i32.const 65 i32.ge_s - local.tee $1 + select if (result i32) - local.get $3 + local.get $1 + i32.const 55 + i32.sub + else + local.get $1 i32.const 122 i32.le_s - else + i32.const 0 + local.get $1 + i32.const 97 + i32.ge_s + select + i32.eqz + br_if $break|2 local.get $1 + i32.const 87 + i32.sub end - i32.eqz - br_if $break|1 - local.get $3 - i32.const 87 - i32.sub end + local.tee $1 + local.get $4 + i32.ge_s + br_if $break|2 + local.get $5 + local.get $4 + f64.convert_i32_s + f64.mul + local.get $1 + f64.convert_i32_s + f64.add + local.set $5 + local.get $2 + i32.const 2 + i32.add + local.set $2 + br $continue|2 end - local.tee $1 - local.get $4 - i32.ge_s - br_if $break|1 - local.get $5 - local.get $4 - f64.convert_i32_s - f64.mul - local.get $1 - f64.convert_i32_s - f64.add - local.set $5 - local.get $0 - i32.const 2 - i32.add - local.set $0 - br $continue|1 end end + local.get $0 + call $~lib/rt/pure/__release + local.get $6 + local.get $5 + f64.mul + return end - local.get $6 - local.get $5 - f64.mul + local.get $0 + call $~lib/rt/pure/__release + f64.const nan:0x8000000000000 + ) + (func $~lib/string/parseInt (; 41 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) + (local $1 f64) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $0 + call $~lib/util/string/parse + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 ) - (func $~lib/string/parseFloat (; 22 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) + (func $~lib/string/parseFloat (; 42 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) (local $1 i32) (local $2 i32) - (local $3 f64) + (local $3 i32) (local $4 f64) - (local $5 i32) + (local $5 f64) (local $6 f64) local.get $0 - i32.load - local.tee $2 - i32.eqz - if - f64.const nan:0x8000000000000 - return - end - local.get $0 - i32.load16_u offset=4 - local.tee $1 - i32.const 45 - i32.eq - if (result f64) - local.get $2 - i32.const 1 - i32.sub - local.tee $2 + call $~lib/rt/pure/__retain + drop + block $folding-inner0 + local.get $0 + call $~lib/string/String#get:length + local.tee $3 i32.eqz if - f64.const nan:0x8000000000000 - return + br $folding-inner0 end local.get $0 - i32.const 2 - i32.add - local.tee $0 - i32.load16_u offset=4 - drop - f64.const -1 - else + local.tee $2 + i32.load16_u + local.set $1 + loop $continue|0 + local.get $1 + call $~lib/util/string/isWhiteSpaceOrLineTerminator + if + local.get $2 + i32.const 2 + i32.add + local.tee $2 + i32.load16_u + local.set $1 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|0 + end + end local.get $1 - i32.const 43 + i32.const 45 i32.eq - if - local.get $2 + if (result f64) + local.get $3 i32.const 1 i32.sub - local.tee $2 + local.tee $3 i32.eqz if - f64.const nan:0x8000000000000 - return + br $folding-inner0 end - local.get $0 + local.get $2 i32.const 2 i32.add - local.tee $0 - i32.load16_u offset=4 + local.tee $2 + i32.load16_u drop - end - f64.const 1 - end - local.set $6 - loop $continue|0 - block $break|0 - local.get $2 - local.tee $1 - i32.const 1 - i32.sub - local.set $2 + f64.const -1 + else local.get $1 + i32.const 43 + i32.eq if - local.get $0 - i32.load16_u offset=4 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.eqz + if + br $folding-inner0 + end + local.get $2 + i32.const 2 + i32.add + local.tee $2 + i32.load16_u + drop + end + f64.const 1 + end + local.set $6 + loop $continue|1 + block $break|1 + local.get $3 local.tee $1 - i32.const 46 - i32.eq + i32.const 1 + i32.sub + local.set $3 + local.get $1 if - local.get $0 - i32.const 2 - i32.add - local.set $0 - f64.const 0.1 - local.set $4 - loop $continue|1 - block $break|1 - local.get $2 - local.tee $1 - i32.const 1 - i32.sub - local.set $2 - local.get $1 - if - local.get $0 - i32.load16_u offset=4 - local.tee $5 - i32.const 69 - i32.eq + local.get $2 + i32.load16_u + local.tee $1 + i32.const 46 + i32.eq + if + local.get $2 + i32.const 2 + i32.add + local.set $2 + f64.const 0.1 + local.set $5 + loop $continue|2 + block $break|2 + local.get $3 local.tee $1 - i32.eqz - if - local.get $5 - i32.const 101 - i32.eq - local.set $1 - end + i32.const 1 + i32.sub + local.set $3 local.get $1 if - i32.const 0 - i32.const 80 - i32.const 630 - i32.const 10 - call $~lib/env/abort - unreachable + local.get $2 + i32.load16_u + local.tee $1 + i32.const 69 + i32.eq + if (result i32) + i32.const 1 + else + local.get $1 + i32.const 101 + i32.eq + end + if + i32.const 0 + i32.const 456 + i32.const 577 + i32.const 10 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 48 + i32.sub + local.tee $1 + i32.const 9 + i32.gt_u + br_if $break|2 + local.get $4 + local.get $1 + f64.convert_i32_s + local.get $5 + f64.mul + f64.add + local.set $4 + local.get $5 + f64.const 0.1 + f64.mul + local.set $5 + local.get $2 + i32.const 2 + i32.add + local.set $2 + br $continue|2 end - local.get $5 - i32.const 48 - i32.sub - local.tee $1 - i32.const 9 - i32.gt_u - br_if $break|1 - local.get $3 - local.get $1 - f64.convert_i32_s - local.get $4 - f64.mul - f64.add - local.set $3 - local.get $4 - f64.const 0.1 - f64.mul - local.set $4 - local.get $0 - i32.const 2 - i32.add - local.set $0 - br $continue|1 end end + br $break|1 end - br $break|0 + local.get $1 + i32.const 48 + i32.sub + local.tee $1 + i32.const 10 + i32.ge_u + br_if $break|1 + local.get $4 + f64.const 10 + f64.mul + local.get $1 + f64.convert_i32_s + f64.add + local.set $4 + local.get $2 + i32.const 2 + i32.add + local.set $2 + br $continue|1 end - local.get $1 - i32.const 48 - i32.sub - local.tee $1 - i32.const 10 - i32.ge_u - br_if $break|0 - local.get $3 - f64.const 10 - f64.mul - local.get $1 - f64.convert_i32_s - f64.add - local.set $3 - local.get $0 - i32.const 2 - i32.add - local.set $0 - br $continue|0 end end + local.get $0 + call $~lib/rt/pure/__release + local.get $6 + local.get $4 + f64.mul + return end - local.get $6 - local.get $3 - f64.mul + local.get $0 + call $~lib/rt/pure/__release + f64.const nan:0x8000000000000 ) - (func $~lib/string/String#concat (; 23 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#concat (; 43 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - local.get $0 + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $1 i32.eqz if - i32.const 0 - i32.const 80 - i32.const 110 - i32.const 4 - call $~lib/env/abort - unreachable + local.get $1 + i32.const 552 + i32.ne + if + i32.const 552 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__release + end + i32.const 552 + local.set $1 end local.get $0 - i32.load + call $~lib/string/String#get:length + i32.const 1 + i32.shl local.tee $3 local.get $1 - i32.const 216 - local.get $1 - select - local.tee $1 - i32.load + call $~lib/string/String#get:length + i32.const 1 + i32.shl local.tee $4 i32.add local.tee $2 i32.eqz if - i32.const 112 + i32.const 120 + call $~lib/rt/pure/__retain + local.set $0 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 return end local.get $2 - call $~lib/internal/string/allocateUnsafe + i32.const 1 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.tee $2 - i32.const 0 local.get $0 - i32.const 0 local.get $3 - call $~lib/internal/string/copyUnsafe + call $~lib/memory/memory.copy local.get $2 local.get $3 + i32.add local.get $1 - i32.const 0 local.get $4 - call $~lib/internal/string/copyUnsafe + call $~lib/memory/memory.copy + local.get $1 + call $~lib/rt/pure/__release local.get $2 ) - (func $~lib/string/String.__concat (; 24 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__concat (; 44 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 216 + i32.const 552 local.get $0 select local.get $1 call $~lib/string/String#concat + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 ) - (func $~lib/string/String.__ne (; 25 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__ne (; 45 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__retain + drop local.get $0 local.get $1 call $~lib/string/String.__eq i32.eqz + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 ) - (func $~lib/string/String.__gt (; 26 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__gt (; 46 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 + call $~lib/rt/pure/__retain + drop local.get $1 - i32.eq - local.tee $2 - i32.eqz - if + call $~lib/rt/pure/__retain + drop + block $folding-inner0 + i32.const 1 + local.get $1 + i32.eqz + i32.const 1 local.get $0 i32.eqz + local.get $0 + local.get $1 + i32.eq + select + select + if + br $folding-inner0 + end + local.get $0 + call $~lib/string/String#get:length local.set $2 - end - local.get $2 - i32.eqz - if local.get $1 + call $~lib/string/String#get:length + local.set $3 + local.get $2 i32.eqz - local.set $2 - end - local.get $2 - if + if + br $folding-inner0 + end + local.get $3 + i32.eqz + if + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + i32.const 1 + return + end + local.get $0 i32.const 0 - return - end - local.get $1 - i32.load - local.set $2 - local.get $0 - i32.load - local.tee $3 - i32.eqz - if + local.get $1 + local.get $2 + local.get $3 + local.get $2 + local.get $3 + i32.lt_s + select + call $~lib/util/string/compareImpl i32.const 0 - return - end - local.get $2 - i32.eqz - if - i32.const 1 + i32.gt_s + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 return end local.get $0 - i32.const 0 + call $~lib/rt/pure/__release local.get $1 - local.get $3 - local.get $2 - local.get $3 - local.get $2 - i32.lt_s - select - call $~lib/internal/string/compareUnsafe + call $~lib/rt/pure/__release i32.const 0 - i32.gt_s ) - (func $~lib/string/String.__lt (; 27 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__lt (; 47 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 + call $~lib/rt/pure/__retain + drop local.get $1 - i32.eq - local.tee $2 - i32.eqz - if + call $~lib/rt/pure/__retain + drop + block $folding-inner0 + i32.const 1 + local.get $1 + i32.eqz + i32.const 1 local.get $0 i32.eqz + local.get $0 + local.get $1 + i32.eq + select + select + if + br $folding-inner0 + end + local.get $0 + call $~lib/string/String#get:length local.set $2 - end - local.get $2 - i32.eqz - if local.get $1 + call $~lib/string/String#get:length + local.tee $3 i32.eqz - local.set $2 - end - local.get $2 - if + if + br $folding-inner0 + end + local.get $2 + i32.eqz + if + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + i32.const 1 + return + end + local.get $0 i32.const 0 - return - end - local.get $0 - i32.load - local.set $2 - local.get $1 - i32.load - local.tee $3 - i32.eqz - if + local.get $1 + local.get $2 + local.get $3 + local.get $2 + local.get $3 + i32.lt_s + select + call $~lib/util/string/compareImpl i32.const 0 - return - end - local.get $2 - i32.eqz - if - i32.const 1 + i32.lt_s + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 return end local.get $0 - i32.const 0 + call $~lib/rt/pure/__release local.get $1 - local.get $2 - local.get $3 - local.get $2 - local.get $3 - i32.lt_s - select - call $~lib/internal/string/compareUnsafe + call $~lib/rt/pure/__release i32.const 0 - i32.lt_s ) - (func $~lib/string/String.__gte (; 28 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__gte (; 48 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__retain + drop local.get $0 local.get $1 call $~lib/string/String.__lt i32.eqz + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 ) - (func $~lib/string/String.__lte (; 29 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 112 + (func $~lib/string/String.__lte (; 49 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + i32.const 120 + call $~lib/rt/pure/__retain + drop + local.get $0 + call $~lib/rt/pure/__retain + drop + i32.const 120 local.get $0 call $~lib/string/String.__gt i32.eqz + local.set $1 + i32.const 120 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 ) - (func $~lib/string/String#repeat (; 30 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#repeat (; 50 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 i32.eqz if i32.const 0 - i32.const 80 - i32.const 385 + i32.const 456 + i32.const 330 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 - i32.load - local.set $3 + call $~lib/string/String#get:length + local.set $2 + i32.const 1 + local.get $2 + i64.extend_i32_s + local.get $1 + i64.extend_i32_s + i64.mul + i64.const 268435456 + i64.gt_u local.get $1 i32.const 0 i32.lt_s - local.tee $2 - i32.eqz - if - local.get $1 - local.get $3 - i32.mul - i32.const 268435456 - i32.gt_s - local.set $2 - end - local.get $2 + select if - i32.const 0 - i32.const 80 - i32.const 390 + i32.const 1832 + i32.const 456 + i32.const 335 i32.const 6 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $1 - i32.eqz - local.tee $2 - i32.eqz - if - local.get $3 - i32.eqz - local.set $2 - end local.get $2 + i32.eqz + i32.const 1 + local.get $1 + select if - i32.const 112 + i32.const 120 + call $~lib/rt/pure/__retain return end local.get $1 @@ -2842,23 +3209,30 @@ i32.eq if local.get $0 + call $~lib/rt/pure/__retain return end local.get $1 - local.get $3 + local.get $2 i32.mul - call $~lib/internal/string/allocateUnsafe - local.tee $2 - i32.const 0 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + local.tee $3 local.get $0 - local.get $1 - call $~lib/internal/string/repeatUnsafe local.get $2 + i32.const 1 + i32.shl + local.get $1 + call $~lib/memory/memory.repeat + local.get $3 + call $~lib/rt/pure/__retain ) - (func $~lib/string/String#slice (; 31 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/string/String#slice (; 51 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $0 - i32.load + call $~lib/string/String#get:length local.set $3 local.get $1 i32.const 0 @@ -2909,867 +3283,841 @@ i32.const 0 i32.le_s if - i32.const 112 + i32.const 120 + call $~lib/rt/pure/__retain return end local.get $2 - call $~lib/internal/string/allocateUnsafe - local.tee $3 - i32.const 0 - local.get $0 - local.get $1 - local.get $2 - call $~lib/internal/string/copyUnsafe - local.get $3 - ) - (func $~lib/string/String#slice|trampoline (; 32 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - block $1of1 - block $0of1 - block $outOfRange - global.get $~lib/argc - i32.const 1 - i32.sub - br_table $0of1 $1of1 $outOfRange - end - unreachable - end - i32.const 2147483647 - local.set $2 - end - local.get $0 - local.get $1 - local.get $2 - call $~lib/string/String#slice - ) - (func $~lib/internal/arraybuffer/allocateUnsafe (; 33 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - local.get $0 - i32.const 1073741816 - i32.gt_u - if - i32.const 0 - i32.const 1128 - i32.const 26 - i32.const 2 - call $~lib/env/abort - unreachable - end i32.const 1 - i32.const 32 - local.get $0 - i32.const 7 - i32.add - i32.clz - i32.sub i32.shl - call $~lib/allocator/arena/__memory_allocate - local.tee $1 - local.get $0 - i32.store - local.get $1 - ) - (func $~lib/internal/memory/memset (; 34 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - (local $2 i32) - local.get $1 - i32.eqz - if - return - end - local.get $0 - i32.const 0 - i32.store8 - local.get $0 - local.get $1 - i32.add + local.tee $2 i32.const 1 - i32.sub - i32.const 0 - i32.store8 + call $~lib/rt/tlsf/__alloc + local.tee $3 local.get $1 - i32.const 2 - i32.le_u - if - return - end - local.get $0 i32.const 1 - i32.add - i32.const 0 - i32.store8 - local.get $0 - i32.const 2 - i32.add - i32.const 0 - i32.store8 + i32.shl local.get $0 - local.get $1 i32.add - local.tee $2 - i32.const 2 - i32.sub - i32.const 0 - i32.store8 local.get $2 + call $~lib/memory/memory.copy + local.get $3 + call $~lib/rt/pure/__retain + ) + (func $~lib/rt/__allocArray (; 52 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + i32.const 16 i32.const 3 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 6 - i32.le_u - if - return - end - local.get $0 - i32.const 3 - i32.add - i32.const 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - i32.const 4 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 8 - i32.le_u - if - return - end - i32.const 0 + call $~lib/rt/tlsf/__alloc + local.tee $1 local.get $0 - i32.sub - i32.const 3 - i32.and + i32.const 2 + i32.shl local.tee $2 - local.get $0 - i32.add - local.tee $0 i32.const 0 + call $~lib/rt/tlsf/__alloc + local.tee $3 + call $~lib/rt/pure/__retain i32.store local.get $1 + local.get $3 + i32.store offset=4 + local.get $1 local.get $2 - i32.sub - i32.const -4 - i32.and - local.tee $1 - local.get $0 - i32.add - i32.const 4 - i32.sub - i32.const 0 - i32.store + i32.store offset=8 local.get $1 - i32.const 8 - i32.le_u - if - return - end - local.get $0 - i32.const 4 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 8 - i32.add - i32.const 0 - i32.store local.get $0 + i32.store offset=12 local.get $1 - i32.add - local.tee $2 - i32.const 12 - i32.sub - i32.const 0 - i32.store + ) + (func $~lib/rt/tlsf/reallocateBlock (; 53 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) local.get $2 - i32.const 8 - i32.sub - i32.const 0 - i32.store + call $~lib/rt/tlsf/prepareSize + local.set $3 local.get $1 - i32.const 24 + i32.load + local.tee $4 + i32.const 1 + i32.and + if + i32.const 0 + i32.const 184 + i32.const 493 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + local.get $4 + i32.const -4 + i32.and i32.le_u if + local.get $0 + local.get $1 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $1 + local.get $2 + i32.store offset=12 + local.get $1 return end - local.get $0 - i32.const 12 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 16 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 20 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 24 - i32.add - i32.const 0 - i32.store - local.get $0 local.get $1 - i32.add - local.tee $2 - i32.const 28 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 24 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 20 - i32.sub - i32.const 0 - i32.store - local.get $2 i32.const 16 - i32.sub - i32.const 0 - i32.store - local.get $0 - i32.const 4 - i32.and - i32.const 24 - i32.add - local.tee $2 - local.get $0 - i32.add - local.set $0 - local.get $1 - local.get $2 - i32.sub - local.set $1 - loop $continue|0 - local.get $1 - i32.const 32 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $6 + i32.load + local.tee $5 + i32.const 1 + i32.and + if + local.get $4 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const -4 + i32.and + i32.add + local.tee $5 + local.get $3 i32.ge_u if local.get $0 - i64.const 0 - i64.store - local.get $0 - i32.const 8 - i32.add - i64.const 0 - i64.store - local.get $0 - i32.const 16 - i32.add - i64.const 0 - i64.store - local.get $0 - i32.const 24 - i32.add - i64.const 0 - i64.store + local.get $6 + call $~lib/rt/tlsf/removeBlock local.get $1 - i32.const 32 - i32.sub - local.set $1 + local.get $4 + i32.const 3 + i32.and + local.get $5 + i32.or + i32.store + local.get $1 + local.get $2 + i32.store offset=12 local.get $0 - i32.const 32 - i32.add - local.set $0 - br $continue|0 + local.get $1 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $1 + return end end - ) - (func $~lib/array/Array<~lib/string/String>#constructor (; 35 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - local.get $0 - i32.const 268435454 - i32.gt_u - if - i32.const 0 - i32.const 1096 - i32.const 45 - i32.const 39 - call $~lib/env/abort - unreachable - end local.get $0 - i32.const 2 - i32.shl + local.get $2 + call $~lib/rt/tlsf/allocateBlock local.tee $3 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $2 - i32.const 8 - call $~lib/allocator/arena/__memory_allocate - local.tee $1 - i32.const 0 - i32.store local.get $1 - i32.const 0 + i32.load offset=4 i32.store offset=4 + local.get $3 + local.get $1 + i32.load offset=8 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add local.get $1 + i32.const 16 + i32.add local.get $2 - i32.store + call $~lib/memory/memory.copy local.get $1 + local.get $4 + i32.const 1 + i32.or + i32.store local.get $0 - i32.store offset=4 - local.get $2 - i32.const 8 - i32.add - local.get $3 - call $~lib/internal/memory/memset local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $3 ) - (func $~lib/internal/arraybuffer/reallocateUnsafe (; 36 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - local.get $1 + (func $~lib/rt/tlsf/__realloc (; 54 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 184 + i32.const 553 + i32.const 13 + call $~lib/builtins/abort + unreachable + end local.get $0 - i32.load - local.tee $2 - i32.gt_s + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $0 + select + i32.eqz if + i32.const 0 + i32.const 184 + i32.const 554 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + local.get $1 + call $~lib/rt/tlsf/reallocateBlock + i32.const 16 + i32.add + ) + (func $~lib/memory/memory.fill (; 55 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block $~lib/util/memory/memset|inlined.0 local.get $1 - i32.const 1073741816 - i32.gt_s - if - i32.const 0 - i32.const 1128 - i32.const 40 - i32.const 4 - call $~lib/env/abort - unreachable - end + i32.eqz + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 0 + i32.store8 + local.get $0 local.get $1 + i32.add i32.const 1 - i32.const 32 + i32.sub + i32.const 0 + i32.store8 + local.get $1 + i32.const 2 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 1 + i32.add + i32.const 0 + i32.store8 + local.get $0 + i32.const 2 + i32.add + i32.const 0 + i32.store8 + local.get $0 + local.get $1 + i32.add + local.tee $2 + i32.const 2 + i32.sub + i32.const 0 + i32.store8 local.get $2 - i32.const 7 + i32.const 3 + i32.sub + i32.const 0 + i32.store8 + local.get $1 + i32.const 6 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 3 i32.add - i32.clz + i32.const 0 + i32.store8 + local.get $0 + local.get $1 + i32.add + i32.const 4 i32.sub - i32.shl + i32.const 0 + i32.store8 + local.get $1 i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + local.get $0 i32.sub - i32.le_s - if - local.get $0 - local.get $1 - i32.store - else - local.get $1 - call $~lib/internal/arraybuffer/allocateUnsafe - local.tee $3 - i32.const 8 - i32.add - local.get $0 - i32.const 8 - i32.add - local.get $2 - call $~lib/internal/memory/memmove - local.get $3 - local.set $0 - end + i32.const 3 + i32.and + local.tee $1 + i32.sub + local.set $2 + local.get $0 + local.get $1 + i32.add + local.tee $0 + i32.const 0 + i32.store + local.get $2 + i32.const -4 + i32.and + local.tee $1 + local.get $0 + i32.add + i32.const 4 + i32.sub + i32.const 0 + i32.store + local.get $1 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 4 + i32.add + i32.const 0 + i32.store + local.get $0 + i32.const 8 + i32.add + i32.const 0 + i32.store + local.get $0 + local.get $1 + i32.add + local.tee $2 + i32.const 12 + i32.sub + i32.const 0 + i32.store + local.get $2 + i32.const 8 + i32.sub + i32.const 0 + i32.store + local.get $1 + i32.const 24 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 12 + i32.add + i32.const 0 + i32.store + local.get $0 + i32.const 16 + i32.add + i32.const 0 + i32.store local.get $0 - i32.const 8 + i32.const 20 i32.add - local.get $2 + i32.const 0 + i32.store + local.get $0 + i32.const 24 i32.add + i32.const 0 + i32.store + local.get $0 local.get $1 - local.get $2 + i32.add + local.tee $2 + i32.const 28 i32.sub - call $~lib/internal/memory/memset - else - local.get $1 + i32.const 0 + i32.store local.get $2 - i32.lt_s - if - local.get $1 - i32.const 0 - i32.lt_s - if - i32.const 0 - i32.const 1128 - i32.const 62 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.store - end - end - local.get $0 - ) - (func $~lib/array/Array<~lib/string/String>#push (; 37 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - local.get $0 - i32.load offset=4 - local.tee $2 - i32.const 1 - i32.add - local.set $4 - local.get $2 - local.get $0 - i32.load - local.tee $3 - i32.load - i32.const 2 - i32.shr_u - i32.ge_u - if + i32.const 24 + i32.sub + i32.const 0 + i32.store local.get $2 - i32.const 268435454 - i32.ge_u - if - i32.const 0 - i32.const 1096 - i32.const 182 - i32.const 42 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $3 - local.get $4 - i32.const 2 - i32.shl - call $~lib/internal/arraybuffer/reallocateUnsafe - local.tee $3 + i32.const 20 + i32.sub + i32.const 0 i32.store - end - local.get $0 - local.get $4 - i32.store offset=4 - local.get $2 - i32.const 2 - i32.shl - local.get $3 - i32.add - local.get $1 - i32.store offset=8 - ) - (func $~lib/string/String#split (; 38 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - local.get $0 - i32.eqz - if + local.get $2 + i32.const 16 + i32.sub i32.const 0 - i32.const 80 - i32.const 413 + i32.store + local.get $0 i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $2 - i32.eqz - if - i32.const 0 - call $~lib/array/Array<~lib/string/String>#constructor - return - end - local.get $1 - i32.eqz - if - i32.const 1 - call $~lib/array/Array<~lib/string/String>#constructor - local.tee $1 - i32.load + i32.and + i32.const 24 + i32.add + local.tee $2 local.get $0 - i32.store offset=8 + i32.add + local.set $0 local.get $1 - return - end - local.get $0 - i32.load - local.set $3 - i32.const 2147483647 - local.get $2 - local.get $2 - i32.const 0 - i32.lt_s - select - local.set $5 - local.get $1 - i32.load - local.tee $8 - if - local.get $3 - i32.eqz - if - i32.const 1 - call $~lib/array/Array<~lib/string/String>#constructor - local.tee $0 - i32.load - i32.const 112 - i32.store offset=8 - local.get $0 - i32.load - i32.load offset=8 - drop - local.get $0 - return - end - else - local.get $3 - i32.eqz - if - i32.const 0 - call $~lib/array/Array<~lib/string/String>#constructor - return - end - local.get $3 - local.get $5 - local.get $3 - local.get $5 - i32.lt_s - select - local.tee $2 - call $~lib/array/Array<~lib/string/String>#constructor - local.tee $4 - i32.load - local.set $3 - i32.const 0 + local.get $2 + i32.sub local.set $1 - loop $repeat|0 + loop $continue|0 local.get $1 - local.get $2 - i32.lt_s + i32.const 32 + i32.ge_u if - i32.const 1 - call $~lib/internal/string/allocateUnsafe - local.tee $5 - local.get $1 - i32.const 1 - i32.shl local.get $0 + i64.const 0 + i64.store + local.get $0 + i32.const 8 i32.add - i32.load16_u offset=4 - i32.store16 offset=4 - local.get $1 - i32.const 2 - i32.shl - local.get $3 + i64.const 0 + i64.store + local.get $0 + i32.const 16 i32.add - local.get $5 - i32.store offset=8 - local.get $1 - i32.const 1 + i64.const 0 + i64.store + local.get $0 + i32.const 24 i32.add + i64.const 0 + i64.store + local.get $1 + i32.const 32 + i32.sub local.set $1 - br $repeat|0 - end - end - local.get $4 - return - end - i32.const 0 - call $~lib/array/Array<~lib/string/String>#constructor - local.set $2 - loop $continue|1 - local.get $0 - local.get $1 - local.get $4 - call $~lib/string/String#indexOf - local.tee $6 - i32.const -1 - i32.ne - if - local.get $6 - local.get $4 - i32.sub - local.tee $7 - i32.const 0 - i32.gt_s - if - local.get $7 - call $~lib/internal/string/allocateUnsafe - local.tee $9 - i32.const 0 local.get $0 - local.get $4 - local.get $7 - call $~lib/internal/string/copyUnsafe - local.get $2 - local.get $9 - call $~lib/array/Array<~lib/string/String>#push - else - local.get $2 - i32.const 112 - call $~lib/array/Array<~lib/string/String>#push - end - local.get $5 - local.get $10 - i32.const 1 - i32.add - local.tee $10 - i32.eq - if - local.get $2 - return + i32.const 32 + i32.add + local.set $0 + br $continue|0 end - local.get $6 - local.get $8 - i32.add - local.set $4 - br $continue|1 end end - local.get $4 - i32.eqz - if - i32.const 1 - call $~lib/array/Array<~lib/string/String>#constructor - local.tee $1 - i32.load - local.get $0 - i32.store offset=8 - local.get $1 - i32.load - i32.load offset=8 - drop - local.get $1 - return - end - local.get $3 - local.get $4 - i32.sub - local.tee $1 - i32.const 0 - i32.gt_s + ) + (func $~lib/array/ensureSize (; 56 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $1 + local.get $0 + i32.load offset=8 + local.tee $2 + i32.const 2 + i32.shr_u + i32.gt_u if local.get $1 - call $~lib/internal/string/allocateUnsafe - local.tee $3 - i32.const 0 + i32.const 268435452 + i32.gt_u + if + i32.const 1832 + i32.const 2248 + i32.const 14 + i32.const 47 + call $~lib/builtins/abort + unreachable + end local.get $0 - local.get $4 + i32.load + local.tee $4 local.get $1 - call $~lib/internal/string/copyUnsafe + i32.const 2 + i32.shl + local.tee $3 + call $~lib/rt/tlsf/__realloc + local.tee $1 local.get $2 + i32.add local.get $3 - call $~lib/array/Array<~lib/string/String>#push - else local.get $2 - i32.const 112 - call $~lib/array/Array<~lib/string/String>#push + i32.sub + call $~lib/memory/memory.fill + local.get $1 + local.get $4 + i32.ne + if + local.get $0 + local.get $1 + call $~lib/rt/pure/__retain + i32.store + local.get $0 + local.get $1 + i32.store offset=4 + end + local.get $0 + local.get $3 + i32.store offset=8 end - local.get $2 ) - (func $~lib/string/String#split|trampoline (; 39 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/string/String>#push (; 57 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) - block $2of2 - block $1of2 - block $0of2 - block $outOfRange - global.get $~lib/argc - br_table $0of2 $1of2 $2of2 $outOfRange - end - unreachable - end - i32.const 0 - local.set $1 - end - i32.const 2147483647 - local.set $2 - end - local.get $0 + (local $3 i32) local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $0 + i32.load offset=12 + local.tee $2 + i32.const 1 + i32.add + local.tee $3 + call $~lib/array/ensureSize + local.get $0 + i32.load offset=4 local.get $2 - call $~lib/string/String#split - ) - (func $~lib/internal/number/decimalCount32 (; 40 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.const 2 + i32.shl + i32.add + local.get $1 + call $~lib/rt/pure/__retain + i32.store local.get $0 - i32.const 100000 - i32.lt_u - if (result i32) - local.get $0 - i32.const 100 - i32.lt_u - if (result i32) - i32.const 1 - i32.const 2 - local.get $0 - i32.const 10 - i32.lt_u - select - else - i32.const 3 - i32.const 4 - i32.const 5 - local.get $0 - i32.const 10000 - i32.lt_u - select - local.get $0 - i32.const 1000 - i32.lt_u - select - end - else - local.get $0 - i32.const 10000000 - i32.lt_u - if (result i32) - i32.const 6 - i32.const 7 - local.get $0 - i32.const 1000000 - i32.lt_u - select - else - i32.const 8 - i32.const 9 - i32.const 10 - local.get $0 - i32.const 1000000000 - i32.lt_u - select - local.get $0 - i32.const 100000000 - i32.lt_u - select - end - end + local.get $3 + i32.store offset=12 + local.get $1 + call $~lib/rt/pure/__release ) - (func $~lib/internal/number/utoa32_lut (; 41 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/string/String#split (; 58 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) (local $3 i32) (local $4 i32) - i32.const 1816 - i32.load - local.set $3 - loop $continue|0 - local.get $1 - i32.const 10000 - i32.ge_u - if - local.get $1 - i32.const 10000 - i32.rem_u - local.set $4 + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.eqz + if + i32.const 0 + i32.const 456 + i32.const 357 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $folding-inner2 + block $folding-inner1 (result i32) local.get $1 - i32.const 10000 - i32.div_u - local.set $1 - local.get $2 - i32.const 4 - i32.sub - local.tee $2 - i32.const 1 - i32.shl + i32.eqz + if + i32.const 1 + call $~lib/rt/__allocArray + local.tee $2 + i32.load offset=4 + local.get $0 + call $~lib/rt/pure/__retain + i32.store + local.get $2 + call $~lib/rt/pure/__retain + br $folding-inner1 + end local.get $0 - i32.add - local.get $3 - local.get $4 - i32.const 100 - i32.div_u - i32.const 2 - i32.shl - i32.add - i64.load32_u offset=8 - local.get $3 - local.get $4 - i32.const 100 - i32.rem_u - i32.const 2 - i32.shl - i32.add - i64.load32_u offset=8 - i64.const 32 - i64.shl - i64.or - i64.store offset=4 - br $continue|0 + call $~lib/string/String#get:length + local.set $3 + block $folding-inner0 + local.get $1 + call $~lib/string/String#get:length + local.tee $6 + if + local.get $3 + i32.eqz + if + i32.const 1 + call $~lib/rt/__allocArray + local.tee $0 + i32.load offset=4 + i32.const 120 + i32.store + local.get $0 + call $~lib/rt/pure/__retain + br $folding-inner1 + end + else + local.get $3 + i32.eqz + br_if $folding-inner0 + local.get $3 + i32.const 2147483647 + local.get $3 + i32.const 2147483647 + i32.lt_s + select + local.tee $3 + call $~lib/rt/__allocArray + local.tee $5 + i32.load offset=4 + local.set $6 + loop $repeat|0 + local.get $2 + local.get $3 + i32.lt_s + if + i32.const 2 + i32.const 1 + call $~lib/rt/tlsf/__alloc + local.tee $4 + local.get $2 + i32.const 1 + i32.shl + local.get $0 + i32.add + i32.load16_u + i32.store16 + local.get $2 + i32.const 2 + i32.shl + local.get $6 + i32.add + local.get $4 + i32.store + local.get $4 + call $~lib/rt/pure/__retain + drop + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $repeat|0 + end + end + local.get $5 + call $~lib/rt/pure/__retain + br $folding-inner1 + end + i32.const 0 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.set $2 + loop $continue|1 + local.get $0 + local.get $1 + local.get $4 + call $~lib/string/String#indexOf + local.tee $5 + i32.const -1 + i32.ne + if + local.get $5 + local.get $4 + i32.sub + local.tee $7 + i32.const 0 + i32.gt_s + if + local.get $7 + i32.const 1 + i32.shl + local.tee $7 + i32.const 1 + call $~lib/rt/tlsf/__alloc + local.tee $8 + local.get $4 + i32.const 1 + i32.shl + local.get $0 + i32.add + local.get $7 + call $~lib/memory/memory.copy + local.get $2 + local.get $8 + call $~lib/array/Array<~lib/string/String>#push + else + local.get $2 + i32.const 120 + call $~lib/array/Array<~lib/string/String>#push + end + local.get $9 + i32.const 1 + i32.add + local.tee $9 + i32.const 2147483647 + i32.eq + if + br $folding-inner2 + end + local.get $5 + local.get $6 + i32.add + local.set $4 + br $continue|1 + end + end + local.get $4 + i32.eqz + if + local.get $2 + local.get $0 + call $~lib/array/Array<~lib/string/String>#push + br $folding-inner2 + end + local.get $3 + local.get $4 + i32.sub + local.tee $3 + i32.const 0 + i32.gt_s + if + local.get $3 + i32.const 1 + i32.shl + local.tee $3 + i32.const 1 + call $~lib/rt/tlsf/__alloc + local.tee $5 + local.get $4 + i32.const 1 + i32.shl + local.get $0 + i32.add + local.get $3 + call $~lib/memory/memory.copy + local.get $2 + local.get $5 + call $~lib/array/Array<~lib/string/String>#push + else + local.get $2 + i32.const 120 + call $~lib/array/Array<~lib/string/String>#push + end + br $folding-inner2 + end + i32.const 0 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain end + local.set $0 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + return end local.get $1 - i32.const 100 + call $~lib/rt/pure/__release + local.get $2 + ) + (func $~lib/array/Array<~lib/string/String>#__get (; 59 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 + local.get $0 + i32.load offset=12 i32.ge_u if - local.get $1 - i32.const 100 - i32.rem_u - local.set $4 - local.get $1 - i32.const 100 - i32.div_u - local.set $1 - local.get $2 - i32.const 2 - i32.sub - local.tee $2 - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $3 - local.get $4 - i32.const 2 - i32.shl - i32.add - i32.load offset=8 - i32.store offset=4 + i32.const 2296 + i32.const 2248 + i32.const 106 + i32.const 45 + call $~lib/builtins/abort + unreachable end local.get $1 - i32.const 10 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u i32.ge_u if - local.get $2 - i32.const 2 - i32.sub - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $3 + i32.const 232 + i32.const 2248 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + i32.load + call $~lib/rt/pure/__retain + ) + (func $~lib/util/number/decimalCount32 (; 60 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.const 1 + i32.const 2 + local.get $0 + i32.const 10 + i32.lt_u + select + i32.const 3 + i32.const 4 + i32.const 5 + local.get $0 + i32.const 10000 + i32.lt_u + select + local.get $0 + i32.const 1000 + i32.lt_u + select + local.get $0 + i32.const 100 + i32.lt_u + select + i32.const 6 + i32.const 7 + local.get $0 + i32.const 1000000 + i32.lt_u + select + i32.const 8 + i32.const 9 + i32.const 10 + local.get $0 + i32.const 1000000000 + i32.lt_u + select + local.get $0 + i32.const 100000000 + i32.lt_u + select + local.get $0 + i32.const 10000000 + i32.lt_u + select + local.get $0 + i32.const 100000 + i32.lt_u + select + ) + (func $~lib/util/number/utoa_simple (; 61 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + loop $continue|0 local.get $1 - i32.const 2 - i32.shl - i32.add - i32.load offset=8 - i32.store offset=4 - else + i32.const 10 + i32.div_u + local.set $3 local.get $2 i32.const 1 i32.sub + local.tee $2 i32.const 1 i32.shl local.get $0 i32.add local.get $1 + i32.const 10 + i32.rem_u i32.const 48 i32.add - i32.store16 offset=4 + i32.store16 + local.get $3 + local.tee $1 + br_if $continue|0 end ) - (func $~lib/internal/number/itoa32 (; 42 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/itoa32 (; 62 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) local.get $0 i32.eqz if - i32.const 480 + i32.const 1040 + call $~lib/rt/pure/__retain return end local.get $0 @@ -3783,201 +4131,137 @@ local.set $0 end local.get $0 - call $~lib/internal/number/decimalCount32 + call $~lib/util/number/decimalCount32 local.get $1 i32.add local.tee $3 - call $~lib/internal/string/allocateUnsafe + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc local.tee $2 local.get $0 local.get $3 - call $~lib/internal/number/utoa32_lut + call $~lib/util/number/utoa_simple local.get $1 if local.get $2 i32.const 45 - i32.store16 offset=4 + i32.store16 end local.get $2 + call $~lib/rt/pure/__retain ) - (func $~lib/internal/number/utoa32 (; 43 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/utoa32 (; 63 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) local.get $0 i32.eqz if - i32.const 480 + i32.const 1040 + call $~lib/rt/pure/__retain return end local.get $0 - call $~lib/internal/number/decimalCount32 + call $~lib/util/number/decimalCount32 local.tee $1 - call $~lib/internal/string/allocateUnsafe + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc local.tee $2 local.get $0 local.get $1 - call $~lib/internal/number/utoa32_lut + call $~lib/util/number/utoa_simple local.get $2 + call $~lib/rt/pure/__retain ) - (func $~lib/internal/number/decimalCount64 (; 44 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/number/decimalCount64 (; 64 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + i32.const 11 + i32.const 12 + local.get $0 + i64.const 100000000000 + i64.lt_u + select + i32.const 13 + i32.const 14 + i32.const 15 + local.get $0 + i64.const 100000000000000 + i64.lt_u + select + local.get $0 + i64.const 10000000000000 + i64.lt_u + select + local.get $0 + i64.const 1000000000000 + i64.lt_u + select + i32.const 16 + i32.const 17 + local.get $0 + i64.const 10000000000000000 + i64.lt_u + select + i32.const 18 + i32.const 19 + i32.const 20 + local.get $0 + i64.const -8446744073709551616 + i64.lt_u + select + local.get $0 + i64.const 1000000000000000000 + i64.lt_u + select + local.get $0 + i64.const 100000000000000000 + i64.lt_u + select local.get $0 i64.const 1000000000000000 i64.lt_u - if (result i32) - local.get $0 - i64.const 1000000000000 - i64.lt_u - if (result i32) - i32.const 11 - i32.const 12 - local.get $0 - i64.const 100000000000 - i64.lt_u - select - else - i32.const 13 - i32.const 14 - i32.const 15 - local.get $0 - i64.const 100000000000000 - i64.lt_u - select - local.get $0 - i64.const 10000000000000 - i64.lt_u - select - end - else - local.get $0 - i64.const 100000000000000000 - i64.lt_u - if (result i32) - i32.const 16 - i32.const 17 - local.get $0 - i64.const 10000000000000000 - i64.lt_u - select - else - i32.const 18 - i32.const 19 - i32.const 20 - local.get $0 - i64.const -8446744073709551616 - i64.lt_u - select - local.get $0 - i64.const 1000000000000000000 - i64.lt_u - select - end - end + select ) - (func $~lib/internal/number/utoa64_lut (; 45 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - i32.const 1816 - i32.load - local.set $3 + (func $~lib/util/number/utoa_simple (; 65 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) + (local $3 i64) loop $continue|0 local.get $1 - i64.const 100000000 - i64.ge_u - if - local.get $1 - local.get $1 - i64.const 100000000 - i64.div_u - local.tee $1 - i64.const 100000000 - i64.mul - i64.sub - i32.wrap_i64 - local.tee $4 - i32.const 10000 - i32.div_u - local.tee $5 - i32.const 100 - i32.div_u - local.set $6 - local.get $5 - i32.const 100 - i32.rem_u - local.set $5 - local.get $2 - i32.const 4 - i32.sub - local.tee $2 - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $3 - local.get $4 - i32.const 10000 - i32.rem_u - local.tee $4 - i32.const 100 - i32.div_u - i32.const 2 - i32.shl - i32.add - i64.load32_u offset=8 - local.get $3 - local.get $4 - i32.const 100 - i32.rem_u - i32.const 2 - i32.shl - i32.add - i64.load32_u offset=8 - i64.const 32 - i64.shl - i64.or - i64.store offset=4 - local.get $2 - i32.const 4 - i32.sub - local.tee $2 - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $3 - local.get $6 - i32.const 2 - i32.shl - i32.add - i64.load32_u offset=8 - local.get $3 - local.get $5 - i32.const 2 - i32.shl - i32.add - i64.load32_u offset=8 - i64.const 32 - i64.shl - i64.or - i64.store offset=4 - br $continue|0 - end + i64.const 10 + i64.div_u + local.set $3 + local.get $2 + i32.const 1 + i32.sub + local.tee $2 + i32.const 1 + i32.shl + local.get $0 + i32.add + local.get $1 + i64.const 10 + i64.rem_u + i32.wrap_i64 + i32.const 48 + i32.add + i32.store16 + local.get $3 + local.tee $1 + i64.const 0 + i64.ne + br_if $continue|0 end - local.get $0 - local.get $1 - i32.wrap_i64 - local.get $2 - call $~lib/internal/number/utoa32_lut ) - (func $~lib/internal/number/utoa64 (; 46 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/number/utoa64 (; 66 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) local.get $0 i64.eqz if - i32.const 480 + i32.const 1040 + call $~lib/rt/pure/__retain return end local.get $0 @@ -3987,26 +4271,33 @@ local.get $0 i32.wrap_i64 local.tee $1 - call $~lib/internal/number/decimalCount32 + call $~lib/util/number/decimalCount32 local.tee $3 - call $~lib/internal/string/allocateUnsafe + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc local.tee $2 local.get $1 local.get $3 - call $~lib/internal/number/utoa32_lut + call $~lib/util/number/utoa_simple else local.get $0 - call $~lib/internal/number/decimalCount64 + call $~lib/util/number/decimalCount64 local.tee $1 - call $~lib/internal/string/allocateUnsafe + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc local.tee $2 local.get $0 local.get $1 - call $~lib/internal/number/utoa64_lut + call $~lib/util/number/utoa_simple end local.get $2 + call $~lib/rt/pure/__retain ) - (func $~lib/internal/number/itoa64 (; 47 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/number/itoa64 (; 67 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -4014,7 +4305,8 @@ local.get $0 i64.eqz if - i32.const 480 + i32.const 1040 + call $~lib/rt/pure/__retain return end block (result i32) @@ -4036,55 +4328,61 @@ local.get $0 i32.wrap_i64 local.tee $2 - call $~lib/internal/number/decimalCount32 + call $~lib/util/number/decimalCount32 local.get $1 i32.add local.tee $4 - call $~lib/internal/string/allocateUnsafe + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc local.tee $3 local.get $2 local.get $4 - call $~lib/internal/number/utoa32_lut + call $~lib/util/number/utoa_simple else local.get $0 - call $~lib/internal/number/decimalCount64 + call $~lib/util/number/decimalCount64 local.get $1 i32.add local.tee $2 - call $~lib/internal/string/allocateUnsafe + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc local.tee $3 local.get $0 local.get $2 - call $~lib/internal/number/utoa64_lut + call $~lib/util/number/utoa_simple end local.get $1 if local.get $3 i32.const 45 - i32.store16 offset=4 + i32.store16 end local.get $3 + call $~lib/rt/pure/__retain ) - (func $~lib/internal/number/genDigits (; 48 ;) (type $FUNCSIG$iijijiji) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (param $6 i32) (result i32) + (func $~lib/util/number/genDigits (; 68 ;) (type $FUNCSIG$iijijiji) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (param $6 i32) (result i32) (local $7 i32) (local $8 i32) (local $9 i64) - (local $10 i64) + (local $10 i32) (local $11 i64) - (local $12 i32) + (local $12 i64) (local $13 i32) (local $14 i64) local.get $3 local.get $1 i64.sub - local.set $10 + local.set $9 i64.const 1 i32.const 0 local.get $4 i32.sub - local.tee $12 + local.tee $10 i64.extend_i32_s - local.tee $1 i64.shl local.tee $11 i64.const 1 @@ -4092,15 +4390,16 @@ local.tee $14 local.get $3 i64.and - local.set $9 + local.set $12 local.get $3 - local.get $1 + local.get $10 + i64.extend_i32_s i64.shr_u i32.wrap_i64 local.tee $7 - call $~lib/internal/number/decimalCount32 + call $~lib/util/number/decimalCount32 local.set $4 - i32.const 4104 + i32.const 4828 i32.load local.set $13 loop $continue|0 @@ -4253,7 +4552,7 @@ i32.and i32.const 48 i32.add - i32.store16 offset=4 + i32.store16 end local.get $4 i32.const 1 @@ -4261,26 +4560,26 @@ local.set $4 local.get $7 i64.extend_i32_u - local.get $12 + local.get $10 i64.extend_i32_s i64.shl - local.get $9 + local.get $12 i64.add local.tee $1 local.get $5 i64.le_u if - global.get $~lib/internal/number/_K + global.get $~lib/util/number/_K local.get $4 i32.add - global.set $~lib/internal/number/_K - local.get $13 + global.set $~lib/util/number/_K local.get $4 i32.const 2 i32.shl + local.get $13 i32.add - i64.load32_u offset=8 - local.get $12 + i64.load32_u + local.get $10 i64.extend_i32_s i64.shl local.set $3 @@ -4292,44 +4591,37 @@ local.get $0 i32.add local.tee $2 - i32.load16_u offset=4 + i32.load16_u local.set $4 loop $continue|2 + i32.const 1 + local.get $9 + local.get $1 + i64.sub + local.get $1 + local.get $3 + i64.add + local.get $9 + i64.sub + i64.gt_u local.get $1 - local.get $10 + local.get $3 + i64.add + local.get $9 i64.lt_u - local.tee $0 - if - local.get $5 - local.get $1 - i64.sub - local.get $3 - i64.ge_u - local.set $0 - end - local.get $0 - if - local.get $1 - local.get $3 - i64.add - local.get $10 - i64.lt_u - local.tee $0 - i32.eqz - if - local.get $10 - local.get $1 - i64.sub - local.get $1 - local.get $3 - i64.add - local.get $10 - i64.sub - i64.gt_u - local.set $0 - end - end - local.get $0 + select + i32.const 0 + local.get $5 + local.get $1 + i64.sub + local.get $3 + i64.ge_u + i32.const 0 + local.get $1 + local.get $9 + i64.lt_u + select + select if local.get $4 i32.const 1 @@ -4344,7 +4636,7 @@ end local.get $2 local.get $4 - i32.store16 offset=4 + i32.store16 local.get $6 return end @@ -4356,11 +4648,11 @@ i64.const 10 i64.mul local.set $5 - local.get $9 + local.get $12 i64.const 10 i64.mul local.tee $3 - local.get $12 + local.get $10 i64.extend_i32_s i64.shr_u local.tee $1 @@ -4386,7 +4678,7 @@ i32.and i32.const 48 i32.add - i32.store16 offset=4 + i32.store16 end local.get $4 i32.const 1 @@ -4395,25 +4687,27 @@ local.get $3 local.get $14 i64.and - local.tee $9 + local.tee $12 local.get $5 i64.ge_u br_if $continue|3 - global.get $~lib/internal/number/_K + global.get $~lib/util/number/_K local.get $4 i32.add - global.set $~lib/internal/number/_K - local.get $13 + global.set $~lib/util/number/_K + local.get $12 + local.set $1 i32.const 0 local.get $4 i32.sub i32.const 2 i32.shl + local.get $13 i32.add - i64.load32_u offset=8 - local.get $10 + i64.load32_u + local.get $9 i64.mul - local.set $1 + local.set $3 local.get $6 i32.const 1 i32.sub @@ -4422,65 +4716,57 @@ local.get $0 i32.add local.tee $2 - i32.load16_u offset=4 + i32.load16_u local.set $4 loop $continue|4 - local.get $9 + i32.const 1 + local.get $3 + local.get $1 + i64.sub + local.get $1 + local.get $11 + i64.add + local.get $3 + i64.sub + i64.gt_u local.get $1 + local.get $11 + i64.add + local.get $3 i64.lt_u - local.tee $0 - if - local.get $5 - local.get $9 - i64.sub - local.get $11 - i64.ge_u - local.set $0 - end - local.get $0 - if - local.get $9 - local.get $11 - i64.add - local.get $1 - i64.lt_u - local.tee $0 - i32.eqz - if - local.get $1 - local.get $9 - i64.sub - local.get $9 - local.get $11 - i64.add - local.get $1 - i64.sub - i64.gt_u - local.set $0 - end - end - local.get $0 + select + i32.const 0 + local.get $5 + local.get $1 + i64.sub + local.get $11 + i64.ge_u + i32.const 0 + local.get $1 + local.get $3 + i64.lt_u + select + select if local.get $4 i32.const 1 i32.sub local.set $4 - local.get $9 + local.get $1 local.get $11 i64.add - local.set $9 + local.set $1 br $continue|4 end end local.get $2 local.get $4 - i32.store16 offset=4 + i32.store16 local.get $6 end ) - (func $~lib/internal/number/prettify (; 49 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/prettify (; 69 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - (local $4 i32) local.get $2 i32.eqz if @@ -4490,7 +4776,7 @@ local.get $0 i32.add i32.const 3145774 - i32.store offset=4 + i32.store local.get $1 i32.const 2 i32.add @@ -4502,14 +4788,13 @@ i32.add local.tee $3 i32.le_s - local.tee $4 - if + if (result i32) local.get $3 i32.const 21 i32.le_s - local.set $4 + else + i32.const 0 end - local.get $4 if (result i32) loop $repeat|0 block $break|0 @@ -4523,7 +4808,7 @@ local.get $0 i32.add i32.const 48 - i32.store16 offset=4 + i32.store16 local.get $1 i32.const 1 i32.add @@ -4537,88 +4822,73 @@ local.get $0 i32.add i32.const 3145774 - i32.store offset=4 + i32.store local.get $3 i32.const 2 i32.add else + local.get $3 + i32.const 21 + i32.le_s + i32.const 0 local.get $3 i32.const 0 i32.gt_s - local.tee $4 - if - local.get $3 - i32.const 21 - i32.le_s - local.set $4 - end - local.get $4 + select if (result i32) local.get $3 i32.const 1 i32.shl local.get $0 i32.add - i32.const 4 - i32.add - local.tee $4 + local.tee $0 i32.const 2 i32.add - local.get $4 + local.get $0 i32.const 0 local.get $2 i32.sub i32.const 1 i32.shl - call $~lib/internal/memory/memmove - local.get $3 - i32.const 1 - i32.shl + call $~lib/memory/memory.copy local.get $0 - i32.add i32.const 46 - i32.store16 offset=4 + i32.store16 local.get $1 i32.const 1 i32.add else + local.get $3 + i32.const 0 + i32.le_s + i32.const 0 i32.const -6 local.get $3 i32.lt_s - local.tee $2 - if - local.get $3 - i32.const 0 - i32.le_s - local.set $2 - end - local.get $2 + select if (result i32) - local.get $0 - i32.const 4 - i32.add - local.tee $2 i32.const 2 local.get $3 i32.sub - local.tee $4 + local.tee $3 i32.const 1 i32.shl + local.get $0 i32.add - local.get $2 + local.get $0 local.get $1 i32.const 1 i32.shl - call $~lib/internal/memory/memmove + call $~lib/memory/memory.copy local.get $0 i32.const 3014704 - i32.store offset=4 + i32.store i32.const 2 local.set $2 loop $repeat|1 block $break|1 local.get $2 - local.get $4 + local.get $3 i32.ge_s br_if $break|1 local.get $2 @@ -4627,7 +4897,7 @@ local.get $0 i32.add i32.const 48 - i32.store16 offset=4 + i32.store16 local.get $2 i32.const 1 i32.add @@ -4636,7 +4906,7 @@ end end local.get $1 - local.get $4 + local.get $3 i32.add else local.get $1 @@ -4645,7 +4915,7 @@ if (result i32) local.get $0 i32.const 101 - i32.store16 offset=6 + i32.store16 offset=2 local.get $0 i32.const 4 i32.add @@ -4667,17 +4937,17 @@ local.get $2 end local.get $2 - call $~lib/internal/number/decimalCount32 + call $~lib/util/number/decimalCount32 i32.const 1 i32.add local.tee $2 - call $~lib/internal/number/utoa32_lut + call $~lib/util/number/utoa_simple local.get $0 i32.const 45 i32.const 43 local.get $1 select - i32.store16 offset=4 + i32.store16 local.get $2 i32.const 2 i32.add @@ -4685,10 +4955,7 @@ local.get $0 i32.const 4 i32.add - local.tee $2 - i32.const 4 - i32.add - local.get $2 + local.get $0 i32.const 2 i32.add local.get $1 @@ -4697,50 +4964,50 @@ local.tee $2 i32.const 2 i32.sub - call $~lib/internal/memory/memmove + call $~lib/memory/memory.copy local.get $0 i32.const 46 - i32.store16 offset=6 + i32.store16 offset=2 local.get $0 local.get $2 i32.add local.tee $0 i32.const 101 - i32.store16 offset=6 + i32.store16 offset=2 local.get $0 i32.const 4 i32.add - local.tee $0 + local.tee $2 block (result i32) local.get $3 i32.const 1 i32.sub - local.tee $2 + local.tee $0 i32.const 0 i32.lt_s - local.tee $4 + local.tee $3 if i32.const 0 - local.get $2 + local.get $0 i32.sub - local.set $2 + local.set $0 end - local.get $2 + local.get $0 end - local.get $2 - call $~lib/internal/number/decimalCount32 + local.get $0 + call $~lib/util/number/decimalCount32 i32.const 1 i32.add - local.tee $2 - call $~lib/internal/number/utoa32_lut - local.get $0 + local.tee $0 + call $~lib/util/number/utoa_simple + local.get $2 i32.const 45 i32.const 43 - local.get $4 + local.get $3 select - i32.store16 offset=4 + i32.store16 + local.get $0 local.get $1 - local.get $2 i32.add i32.const 2 i32.add @@ -4749,38 +5016,30 @@ end end ) - (func $~lib/internal/number/dtoa_core (; 50 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/util/number/dtoa_core (; 70 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) (local $2 i64) (local $3 i32) (local $4 i64) - (local $5 i32) - (local $6 i32) - (local $7 i64) + (local $5 i64) + (local $6 i64) + (local $7 i32) (local $8 i64) (local $9 i64) (local $10 i32) - (local $11 i64) - (local $12 i64) - (local $13 i32) - (local $14 i64) - (local $15 i64) - (local $16 i64) - (local $17 i64) - (local $18 i64) - (local $19 i64) + (local $11 i32) local.get $1 f64.const 0 f64.lt local.tee $10 - if (result f64) + if local.get $0 i32.const 45 - i32.store16 offset=4 + i32.store16 local.get $1 f64.neg - else - local.get $1 + local.set $1 end + local.get $1 i64.reinterpret_f64 local.tee $2 i64.const 9218868437227405312 @@ -4788,68 +5047,68 @@ i64.const 52 i64.shr_u i32.wrap_i64 - local.set $5 + local.tee $11 + i32.const 0 + i32.ne + local.set $7 local.get $2 i64.const 4503599627370495 i64.and - local.get $5 - i32.const 0 - i32.ne - local.tee $6 + local.get $7 i64.extend_i32_u i64.const 52 i64.shl i64.add - local.tee $2 + local.tee $5 i64.const 1 i64.shl i64.const 1 i64.add - local.tee $7 + local.tee $2 i64.clz i32.wrap_i64 local.set $3 - local.get $7 + local.get $2 local.get $3 i64.extend_i32_s i64.shl - global.set $~lib/internal/number/_frc_plus - local.get $5 + global.set $~lib/util/number/_frc_plus + local.get $11 i32.const 1 - local.get $6 + local.get $7 select i32.const 1075 i32.sub - local.tee $5 + local.tee $7 i32.const 1 i32.sub local.get $3 i32.sub local.set $3 - local.get $2 - local.get $2 + local.get $5 + local.get $5 i64.const 4503599627370496 i64.eq i32.const 1 i32.add - local.tee $6 + local.tee $11 i64.extend_i32_s i64.shl i64.const 1 i64.sub - local.get $5 - local.get $6 + local.get $7 + local.get $11 i32.sub local.get $3 i32.sub i64.extend_i32_s i64.shl - global.set $~lib/internal/number/_frc_minus + global.set $~lib/util/number/_frc_minus local.get $3 - global.set $~lib/internal/number/_exp + global.set $~lib/util/number/_exp i32.const 348 i32.const -61 - global.get $~lib/internal/number/_exp + global.get $~lib/util/number/_exp i32.sub f64.convert_i32_s f64.const 0.30102999566398114 @@ -4871,82 +5130,52 @@ local.tee $3 i32.const 3 i32.shl - local.tee $6 i32.sub - global.set $~lib/internal/number/_K - i32.const 4032 + global.set $~lib/util/number/_K + i32.const 4516 i32.load - local.set $13 - i32.const 3768 - i32.load - local.get $6 + local.get $3 + i32.const 3 + i32.shl i32.add - i64.load offset=8 - global.set $~lib/internal/number/_frc_pow - local.get $13 + i64.load + global.set $~lib/util/number/_frc_pow + i32.const 4740 + i32.load local.get $3 i32.const 1 i32.shl i32.add - i32.load16_s offset=8 - global.set $~lib/internal/number/_exp_pow - local.get $2 - local.get $2 - i64.clz - i32.wrap_i64 - local.tee $3 - i64.extend_i32_s - i64.shl - local.tee $7 - i64.const 4294967295 - i64.and - local.tee $11 - global.get $~lib/internal/number/_frc_pow - local.tee $2 + i32.load16_s + global.set $~lib/util/number/_exp_pow + global.get $~lib/util/number/_frc_pow + local.tee $6 i64.const 4294967295 i64.and - local.tee $14 - i64.mul - local.set $15 - global.get $~lib/internal/number/_frc_plus + local.set $2 + global.get $~lib/util/number/_frc_plus local.tee $8 i64.const 4294967295 i64.and local.tee $4 - local.get $2 - i64.const 4294967295 - i64.and - local.tee $9 - i64.mul - local.set $12 - global.get $~lib/internal/number/_frc_minus - local.tee $16 - i64.const 4294967295 - i64.and - local.tee $17 - local.get $2 - i64.const 4294967295 - i64.and - local.tee $18 - i64.mul - local.set $19 - local.get $4 - local.get $2 + local.get $6 i64.const 32 i64.shr_u - local.tee $4 + local.tee $6 i64.mul local.get $8 i64.const 32 i64.shr_u local.tee $8 - local.get $9 + local.get $2 + i64.mul + local.get $2 + local.get $4 i64.mul - local.get $12 i64.const 32 i64.shr_u i64.add - local.tee $9 + local.tee $4 i64.const 4294967295 i64.and i64.add @@ -4954,10 +5183,10 @@ i64.add i64.const 32 i64.shr_u - local.get $4 + local.get $6 local.get $8 i64.mul - local.get $9 + local.get $4 i64.const 32 i64.shr_u i64.add @@ -4965,23 +5194,26 @@ i64.const 1 i64.sub local.tee $8 - local.get $2 - i64.const 32 - i64.shr_u + local.get $6 + global.get $~lib/util/number/_frc_minus local.tee $4 - local.get $17 + i64.const 4294967295 + i64.and + local.tee $9 i64.mul - local.get $16 + local.get $4 i64.const 32 i64.shr_u - local.tee $9 - local.get $18 + local.tee $4 + local.get $2 + i64.mul + local.get $2 + local.get $9 i64.mul - local.get $19 i64.const 32 i64.shr_u i64.add - local.tee $12 + local.tee $9 i64.const 4294967295 i64.and i64.add @@ -4990,9 +5222,9 @@ i64.const 32 i64.shr_u local.get $4 - local.get $9 + local.get $6 i64.mul - local.get $12 + local.get $9 i64.const 32 i64.shr_u i64.add @@ -5007,23 +5239,32 @@ local.get $0 i32.add local.get $0 - local.get $2 - i64.const 32 - i64.shr_u - local.tee $2 - local.get $11 + local.get $6 + local.get $5 + local.get $5 + i64.clz + i32.wrap_i64 + local.tee $0 + i64.extend_i32_s + i64.shl + local.tee $5 + i64.const 4294967295 + i64.and + local.tee $9 i64.mul - local.get $7 + local.get $5 i64.const 32 i64.shr_u - local.tee $7 - local.get $14 + local.tee $5 + local.get $2 + i64.mul + local.get $2 + local.get $9 i64.mul - local.get $15 i64.const 32 i64.shr_u i64.add - local.tee $11 + local.tee $2 i64.const 4294967295 i64.and i64.add @@ -5031,61 +5272,60 @@ i64.add i64.const 32 i64.shr_u - local.get $2 - local.get $7 + local.get $5 + local.get $6 i64.mul - local.get $11 + local.get $2 i64.const 32 i64.shr_u i64.add i64.add - global.get $~lib/internal/number/_exp_pow - local.tee $0 - local.get $5 - local.get $3 + global.get $~lib/util/number/_exp_pow + local.tee $3 + local.get $7 + local.get $0 i32.sub i32.add i32.const -64 i32.sub local.get $8 - global.get $~lib/internal/number/_exp - local.get $0 + global.get $~lib/util/number/_exp + local.get $3 i32.add i32.const -64 i32.sub local.get $4 local.get $10 - call $~lib/internal/number/genDigits + call $~lib/util/number/genDigits local.get $10 i32.sub - global.get $~lib/internal/number/_K - call $~lib/internal/number/prettify + global.get $~lib/util/number/_K + call $~lib/util/number/prettify local.get $10 i32.add ) - (func $~lib/string/String#substring (; 51 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#substring (; 71 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - (local $4 i32) local.get $0 i32.eqz if i32.const 0 - i32.const 80 - i32.const 254 + i32.const 456 + i32.const 196 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 local.get $0 - i32.load - local.tee $3 + call $~lib/string/String#get:length + local.tee $2 i32.const 0 - local.get $3 + local.get $2 i32.lt_s select - local.tee $2 + local.tee $3 local.get $1 i32.const 0 local.get $1 @@ -5093,64 +5333,73 @@ i32.gt_s select local.tee $1 - local.get $3 + local.get $2 local.get $1 - local.get $3 + local.get $2 i32.lt_s select - local.tee $1 + local.tee $2 + local.get $3 local.get $2 - local.get $1 i32.gt_s select - local.tee $4 + i32.const 1 + i32.shl + local.tee $1 + local.get $3 local.get $2 - local.get $1 + local.get $3 local.get $2 - local.get $1 i32.lt_s select - local.tee $1 - i32.sub + i32.const 1 + i32.shl local.tee $3 + i32.sub + local.tee $2 i32.eqz if - i32.const 112 + i32.const 120 + call $~lib/rt/pure/__retain return end - local.get $1 - i32.eqz - local.tee $2 + local.get $3 if (result i32) + i32.const 0 + else local.get $0 - i32.load - local.get $4 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.get $1 i32.eq - else - local.get $2 end if local.get $0 + call $~lib/rt/pure/__retain return end - local.get $3 - call $~lib/internal/string/allocateUnsafe - local.tee $2 - i32.const 0 + local.get $2 + i32.const 1 + call $~lib/rt/tlsf/__alloc + local.tee $1 local.get $0 - local.get $1 local.get $3 - call $~lib/internal/string/copyUnsafe + i32.add local.get $2 + call $~lib/memory/memory.copy + local.get $1 + call $~lib/rt/pure/__retain ) - (func $~lib/internal/number/dtoa (; 52 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + (func $~lib/util/number/dtoa (; 72 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) (local $1 i32) (local $2 i32) local.get $0 f64.const 0 f64.eq if - i32.const 2664 + i32.const 3680 + call $~lib/rt/pure/__retain return end local.get $0 @@ -5163,193 +5412,339 @@ local.get $0 f64.ne if - i32.const 2680 + i32.const 3704 + call $~lib/rt/pure/__retain return end - i32.const 2696 - i32.const 2720 + i32.const 3728 + i32.const 3768 local.get $0 f64.const 0 f64.lt select + call $~lib/rt/pure/__retain return end - i32.const 28 - call $~lib/internal/string/allocateUnsafe - local.tee $2 + i32.const 56 + i32.const 1 + call $~lib/rt/tlsf/__alloc + local.tee $1 local.get $0 - call $~lib/internal/number/dtoa_core - local.set $1 - local.get $2 - local.get $1 - call $~lib/string/String#substring - local.set $1 - local.get $2 - i32.eqz + call $~lib/util/number/dtoa_core + local.tee $2 + i32.const 28 + i32.eq if - i32.const 0 - i32.const 136 - i32.const 28 - i32.const 4 - call $~lib/env/abort - unreachable + local.get $1 + call $~lib/rt/pure/__retain + return end local.get $1 + local.get $2 + call $~lib/string/String#substring + local.set $2 + local.get $1 + call $~lib/rt/tlsf/__free + local.get $2 ) - (func $start:std/string (; 53 ;) (type $FUNCSIG$v) + (func $start:std/string (; 73 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) - i32.const 5360 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + (local $14 i32) + (local $15 i32) + (local $16 i32) + (local $17 i32) + (local $18 i32) + (local $19 i32) + (local $20 i32) + (local $21 i32) + (local $22 i32) + (local $23 i32) + (local $24 i32) + (local $25 i32) + (local $26 i32) + (local $27 i32) + (local $28 i32) + (local $29 i32) + (local $30 i32) + (local $31 i32) + (local $32 i32) + (local $33 i32) + (local $34 i32) + (local $35 i32) + (local $36 i32) + (local $37 i32) + (local $38 i32) + (local $39 i32) + (local $40 i32) + (local $41 i32) + (local $42 i32) + (local $43 i32) + (local $44 i32) + (local $45 i32) + (local $46 i32) + (local $47 i32) + (local $48 i32) + (local $49 i32) + (local $50 i32) + (local $51 i32) + (local $52 i32) + (local $53 i32) + (local $54 i32) + (local $55 i32) + (local $56 i32) + (local $57 i32) + (local $58 i32) + (local $59 i32) + (local $60 i32) + (local $61 i32) + (local $62 i32) + (local $63 i32) + (local $64 i32) + (local $65 i32) + (local $66 i32) + (local $67 i32) + (local $68 i32) + (local $69 i32) + (local $70 i32) + (local $71 i32) + (local $72 i32) + (local $73 i32) + (local $74 i32) + (local $75 i32) + (local $76 i32) + (local $77 i32) + (local $78 i32) + (local $79 i32) + (local $80 i32) + (local $81 i32) + (local $82 i32) + (local $83 i32) + (local $84 i32) + (local $85 i32) + (local $86 i32) + (local $87 i32) + (local $88 i32) + (local $89 i32) + (local $90 i32) + (local $91 i32) + (local $92 i32) + (local $93 i32) + (local $94 i32) + (local $95 i32) + (local $96 i32) + (local $97 i32) + (local $98 i32) + (local $99 i32) + (local $100 i32) + (local $101 i32) + (local $102 i32) + (local $103 i32) + (local $104 i32) + (local $105 i32) + (local $106 i32) + (local $107 i32) + (local $108 i32) + (local $109 i32) + (local $110 i32) + (local $111 i32) + (local $112 i32) + (local $113 i32) + (local $114 i32) + (local $115 i32) + (local $116 i32) + (local $117 i32) + (local $118 i32) + (local $119 i32) + (local $120 i32) + (local $121 i32) + (local $122 i32) + (local $123 i32) + (local $124 i32) + (local $125 i32) + (local $126 i32) + (local $127 i32) + (local $128 i32) global.get $std/string/str - i32.const 8 + i32.const 24 i32.ne if i32.const 0 - i32.const 48 - i32.const 16 + i32.const 72 + i32.const 8 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string/str - i32.load + call $~lib/string/String#get:length i32.const 16 i32.ne if i32.const 0 - i32.const 48 - i32.const 18 - i32.const 0 - call $~lib/env/abort + i32.const 72 + i32.const 10 + i32.const 0 + call $~lib/builtins/abort unreachable end - global.get $std/string/str - call $~lib/string/String#charCodeAt + block $__inlined_func$~lib/string/String#charCodeAt (result i32) + i32.const -1 + i32.const 0 + global.get $std/string/str + local.tee $0 + call $~lib/string/String#get:length + i32.ge_u + br_if $__inlined_func$~lib/string/String#charCodeAt + drop + local.get $0 + i32.load16_u + end i32.const 104 i32.ne if i32.const 0 - i32.const 48 - i32.const 19 + i32.const 72 + i32.const 11 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 112 - i32.load + i32.const 120 + call $~lib/string/String.__not + i32.eqz if i32.const 0 - i32.const 48 - i32.const 21 + i32.const 72 + i32.const 13 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 120 - i32.load - i32.eqz + i32.const 384 + call $~lib/string/String.__not i32.eqz i32.const 1 i32.ne if i32.const 0 - i32.const 48 - i32.const 22 + i32.const 72 + i32.const 14 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 128 - i32.load - i32.eqz + i32.const 408 + call $~lib/string/String.__not i32.eqz i32.const 1 i32.ne if i32.const 0 - i32.const 48 - i32.const 23 + i32.const 72 + i32.const 15 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + i32.const 1 + global.set $~lib/argc i32.const 0 - call $~lib/string/String.fromCharCode - i32.const 120 + call $~lib/string/String.fromCharCode|trampoline + local.tee $5 + i32.const 384 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 25 + i32.const 72 + i32.const 17 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + i32.const 1 + global.set $~lib/argc i32.const 54 - call $~lib/string/String.fromCharCode - i32.const 192 + call $~lib/string/String.fromCharCode|trampoline + local.tee $6 + i32.const 432 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 26 + i32.const 72 + i32.const 18 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + i32.const 1 + global.set $~lib/argc i32.const 65590 - call $~lib/string/String.fromCharCode - i32.const 192 + call $~lib/string/String.fromCharCode|trampoline + local.tee $7 + i32.const 432 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 27 + i32.const 72 + i32.const 19 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 call $~lib/string/String.fromCodePoint - i32.const 120 + local.tee $8 + i32.const 384 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 29 + i32.const 72 + i32.const 21 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 54 call $~lib/string/String.fromCodePoint - i32.const 192 + local.tee $9 + i32.const 432 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 30 + i32.const 72 + i32.const 22 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 119558 call $~lib/string/String.fromCodePoint + local.tee $10 i32.eqz if - i32.const 200 - i32.const 48 - i32.const 31 + i32.const 504 + i32.const 72 + i32.const 23 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string/str @@ -5357,3666 +5752,3466 @@ i32.eqz if i32.const 0 - i32.const 48 - i32.const 33 + i32.const 72 + i32.const 25 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 - global.set $~lib/argc global.get $std/string/str - local.set $1 - block $1of1 - block $0of1 - block $outOfRange - global.get $~lib/argc - i32.const 1 - i32.sub - br_table $0of1 $1of1 $outOfRange - end - unreachable - end - i32.const 536870910 - local.set $0 - end - local.get $1 - local.get $0 call $~lib/string/String#endsWith i32.eqz if i32.const 0 - i32.const 48 - i32.const 34 + i32.const 72 + i32.const 26 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string/str - i32.const 248 + local.set $0 + i32.const 608 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.const 608 i32.const 0 call $~lib/string/String#indexOf i32.const -1 - i32.eq + i32.ne + local.set $0 + i32.const 608 + call $~lib/rt/pure/__release + local.get $0 + i32.eqz if i32.const 0 - i32.const 48 - i32.const 35 + i32.const 72 + i32.const 27 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 - global.set $~lib/argc global.get $std/string/str i32.const 0 - call $~lib/string/String#padStart|trampoline + i32.const 632 + call $~lib/string/String#padStart + local.tee $11 global.get $std/string/str call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 37 + i32.const 72 + i32.const 29 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 - global.set $~lib/argc global.get $std/string/str i32.const 15 - call $~lib/string/String#padStart|trampoline + i32.const 632 + call $~lib/string/String#padStart + local.tee $12 global.get $std/string/str call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 38 + i32.const 72 + i32.const 30 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 - global.set $~lib/argc - i32.const 112 + i32.const 120 i32.const 3 - call $~lib/string/String#padStart|trampoline - i32.const 272 + i32.const 632 + call $~lib/string/String#padStart + local.tee $13 + i32.const 656 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 39 + i32.const 72 + i32.const 31 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 112 + i32.const 120 i32.const 10 - i32.const 112 + i32.const 120 call $~lib/string/String#padStart - i32.const 112 + local.tee $14 + i32.const 120 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 40 + i32.const 72 + i32.const 32 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 128 + i32.const 408 i32.const 100 - i32.const 112 + i32.const 120 call $~lib/string/String#padStart - i32.const 128 + local.tee $15 + i32.const 408 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 41 + i32.const 72 + i32.const 33 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 - global.set $~lib/argc - i32.const 288 + i32.const 680 i32.const 5 - call $~lib/string/String#padStart|trampoline - i32.const 304 + i32.const 632 + call $~lib/string/String#padStart + local.tee $16 + i32.const 704 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 42 + i32.const 72 + i32.const 34 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 288 + i32.const 680 i32.const 6 - i32.const 320 + i32.const 736 call $~lib/string/String#padStart - i32.const 336 + local.tee $17 + i32.const 760 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 43 + i32.const 72 + i32.const 35 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 288 + i32.const 680 i32.const 8 - i32.const 320 + i32.const 736 call $~lib/string/String#padStart - i32.const 352 + local.tee $18 + i32.const 792 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 44 + i32.const 72 + i32.const 36 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 - global.set $~lib/argc global.get $std/string/str i32.const 0 - call $~lib/string/String#padEnd|trampoline + i32.const 632 + call $~lib/string/String#padEnd + local.tee $19 global.get $std/string/str call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 46 + i32.const 72 + i32.const 38 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 - global.set $~lib/argc global.get $std/string/str i32.const 15 - call $~lib/string/String#padEnd|trampoline + i32.const 632 + call $~lib/string/String#padEnd + local.tee $20 global.get $std/string/str call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 47 + i32.const 72 + i32.const 39 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 - global.set $~lib/argc - i32.const 112 + i32.const 120 i32.const 3 - call $~lib/string/String#padEnd|trampoline - i32.const 272 + i32.const 632 + call $~lib/string/String#padEnd + local.tee $21 + i32.const 656 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 48 + i32.const 72 + i32.const 40 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 112 + i32.const 120 i32.const 10 - i32.const 112 + i32.const 120 call $~lib/string/String#padEnd - i32.const 112 + local.tee $22 + i32.const 120 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 49 + i32.const 72 + i32.const 41 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 128 + i32.const 408 i32.const 100 - i32.const 112 + i32.const 120 call $~lib/string/String#padEnd - i32.const 128 + local.tee $23 + i32.const 408 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 50 + i32.const 72 + i32.const 42 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 - global.set $~lib/argc - i32.const 288 + i32.const 680 i32.const 5 - call $~lib/string/String#padEnd|trampoline - i32.const 376 + i32.const 632 + call $~lib/string/String#padEnd + local.tee $24 + i32.const 824 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 51 + i32.const 72 + i32.const 43 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 288 + i32.const 680 i32.const 6 - i32.const 288 + i32.const 680 call $~lib/string/String#padEnd - i32.const 392 + local.tee $25 + i32.const 856 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 52 + i32.const 72 + i32.const 44 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 288 + i32.const 680 i32.const 8 - i32.const 288 + i32.const 680 call $~lib/string/String#padEnd - i32.const 408 + local.tee $26 + i32.const 888 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 53 + i32.const 72 + i32.const 45 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 112 - i32.const 112 + i32.const 120 + i32.const 120 i32.const 0 call $~lib/string/String#indexOf if i32.const 0 - i32.const 48 - i32.const 55 + i32.const 72 + i32.const 47 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 112 - i32.const 208 + i32.const 120 + i32.const 528 i32.const 0 call $~lib/string/String#indexOf i32.const -1 i32.ne if i32.const 0 + i32.const 72 i32.const 48 - i32.const 56 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 128 - i32.const 128 + i32.const 408 + i32.const 408 i32.const 0 call $~lib/string/String#indexOf if i32.const 0 - i32.const 48 - i32.const 57 + i32.const 72 + i32.const 49 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string/str - local.tee $0 - local.get $0 + global.get $std/string/str i32.const 0 call $~lib/string/String#indexOf if i32.const 0 - i32.const 48 - i32.const 58 + i32.const 72 + i32.const 50 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string/str - i32.const 112 + i32.const 120 i32.const 0 call $~lib/string/String#indexOf if i32.const 0 - i32.const 48 - i32.const 59 + i32.const 72 + i32.const 51 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string/str - i32.const 432 + i32.const 920 i32.const 0 call $~lib/string/String#indexOf i32.const 2 i32.ne if i32.const 0 - i32.const 48 - i32.const 60 + i32.const 72 + i32.const 52 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string/str - i32.const 440 + i32.const 944 i32.const 0 call $~lib/string/String#indexOf i32.const -1 i32.ne if i32.const 0 - i32.const 48 - i32.const 61 + i32.const 72 + i32.const 53 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string/str - i32.const 432 + i32.const 920 i32.const 2 call $~lib/string/String#indexOf i32.const 2 i32.ne if i32.const 0 - i32.const 48 - i32.const 62 + i32.const 72 + i32.const 54 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string/str - i32.const 432 + i32.const 920 i32.const 3 call $~lib/string/String#indexOf i32.const -1 i32.ne if i32.const 0 - i32.const 48 - i32.const 63 + i32.const 72 + i32.const 55 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string/str - i32.const 448 + i32.const 968 i32.const -1 call $~lib/string/String#indexOf i32.const 2 i32.ne if i32.const 0 - i32.const 48 - i32.const 64 + i32.const 72 + i32.const 56 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 - global.set $~lib/argc - i32.const 112 - i32.const 112 - call $~lib/string/String#lastIndexOf|trampoline + i32.const 120 + i32.const 120 + i32.const 2147483647 + call $~lib/string/String#lastIndexOf if i32.const 0 - i32.const 48 - i32.const 66 + i32.const 72 + i32.const 58 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 - global.set $~lib/argc - i32.const 112 - i32.const 208 - call $~lib/string/String#lastIndexOf|trampoline + i32.const 120 + i32.const 528 + i32.const 2147483647 + call $~lib/string/String#lastIndexOf i32.const -1 i32.ne if i32.const 0 - i32.const 48 - i32.const 67 + i32.const 72 + i32.const 59 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 - global.set $~lib/argc global.get $std/string/str - i32.const 112 - call $~lib/string/String#lastIndexOf|trampoline + i32.const 120 + i32.const 2147483647 + call $~lib/string/String#lastIndexOf global.get $std/string/str - i32.load + call $~lib/string/String#get:length i32.ne if i32.const 0 - i32.const 48 - i32.const 68 + i32.const 72 + i32.const 60 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 - global.set $~lib/argc global.get $std/string/str - i32.const 432 - call $~lib/string/String#lastIndexOf|trampoline + i32.const 920 + i32.const 2147483647 + call $~lib/string/String#lastIndexOf i32.const 2 i32.ne if i32.const 0 - i32.const 48 - i32.const 69 + i32.const 72 + i32.const 61 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 - global.set $~lib/argc global.get $std/string/str - i32.const 440 - call $~lib/string/String#lastIndexOf|trampoline + i32.const 944 + i32.const 2147483647 + call $~lib/string/String#lastIndexOf i32.const -1 i32.ne if i32.const 0 - i32.const 48 - i32.const 70 + i32.const 72 + i32.const 62 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 - global.set $~lib/argc global.get $std/string/str - i32.const 464 - call $~lib/string/String#lastIndexOf|trampoline + i32.const 992 + i32.const 2147483647 + call $~lib/string/String#lastIndexOf i32.const 15 i32.ne if i32.const 0 - i32.const 48 - i32.const 71 + i32.const 72 + i32.const 63 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string/str - i32.const 432 + i32.const 920 i32.const 2 call $~lib/string/String#lastIndexOf i32.const 2 i32.ne if i32.const 0 - i32.const 48 i32.const 72 + i32.const 64 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string/str - i32.const 432 + i32.const 920 i32.const 3 call $~lib/string/String#lastIndexOf i32.const 2 i32.ne if i32.const 0 - i32.const 48 - i32.const 73 + i32.const 72 + i32.const 65 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string/str - i32.const 448 + i32.const 968 i32.const -1 call $~lib/string/String#lastIndexOf i32.const -1 i32.ne if i32.const 0 - i32.const 48 - i32.const 74 + i32.const 72 + i32.const 66 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string/str - i32.const 472 + i32.const 1016 i32.const 0 call $~lib/string/String#lastIndexOf i32.const -1 i32.ne if i32.const 0 - i32.const 48 - i32.const 75 + i32.const 72 + i32.const 67 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string/str - i32.const 208 + i32.const 528 i32.const 0 call $~lib/string/String#lastIndexOf if i32.const 0 - i32.const 48 - i32.const 76 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 480 - call $~lib/internal/string/parse - f64.const 0 - f64.ne - if - i32.const 0 - i32.const 48 - i32.const 82 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 488 - call $~lib/internal/string/parse - f64.const 1 - f64.ne - if - i32.const 0 - i32.const 48 - i32.const 83 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 496 - call $~lib/internal/string/parse - f64.const 5 - f64.ne - if - i32.const 0 - i32.const 48 - i32.const 84 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 512 - call $~lib/internal/string/parse - f64.const 455 - f64.ne - if - i32.const 0 - i32.const 48 - i32.const 85 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 528 - call $~lib/internal/string/parse - f64.const 3855 - f64.ne - if - i32.const 0 - i32.const 48 - i32.const 86 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 544 - call $~lib/internal/string/parse - f64.const 3855 - f64.ne - if - i32.const 0 - i32.const 48 - i32.const 87 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 560 - call $~lib/internal/string/parse - f64.const 11 - f64.ne - if - i32.const 0 - i32.const 48 - i32.const 88 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 576 - call $~lib/internal/string/parse - f64.const 1 - f64.ne - if - i32.const 0 - i32.const 48 - i32.const 89 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 480 - call $~lib/string/parseFloat - f64.const 0 - f64.ne - if - i32.const 0 - i32.const 48 - i32.const 91 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 488 - call $~lib/string/parseFloat - f64.const 1 - f64.ne - if - i32.const 0 - i32.const 48 - i32.const 92 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 592 - call $~lib/string/parseFloat - f64.const 0.1 - f64.ne - if - i32.const 0 - i32.const 48 - i32.const 93 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 608 - call $~lib/string/parseFloat - f64.const 0.25 - f64.ne - if - i32.const 0 - i32.const 48 - i32.const 94 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 624 - call $~lib/string/parseFloat - f64.const 0.1 - f64.ne - if - i32.const 0 - i32.const 48 - i32.const 95 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 128 - i32.const 648 - call $~lib/string/String.__concat - global.set $std/string/c - global.get $std/string/c - i32.const 656 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 48 - i32.const 98 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/string/c - i32.const 128 - call $~lib/string/String.__ne - i32.eqz - if - i32.const 0 - i32.const 48 - i32.const 99 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 112 - i32.const 112 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 48 - i32.const 100 + i32.const 72 + i32.const 68 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 112 - global.get $std/string/nullStr - call $~lib/string/String.__ne - i32.eqz + i32.const 1040 + call $~lib/string/parseInt + f64.const 0 + f64.ne if i32.const 0 - i32.const 48 - i32.const 101 + i32.const 72 + i32.const 70 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $std/string/nullStr - i32.const 112 - call $~lib/string/String.__ne - i32.eqz + i32.const 1064 + call $~lib/string/parseInt + f64.const 1 + f64.ne if i32.const 0 - i32.const 48 - i32.const 102 + i32.const 72 + i32.const 71 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 128 - i32.const 648 - call $~lib/string/String.__ne - i32.eqz + i32.const 1088 + call $~lib/string/parseInt + f64.const 5 + f64.ne if i32.const 0 - i32.const 48 - i32.const 103 + i32.const 72 + i32.const 72 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 128 - i32.const 128 - call $~lib/string/String.__eq - i32.eqz + i32.const 1120 + call $~lib/string/parseInt + f64.const 455 + f64.ne if i32.const 0 - i32.const 48 - i32.const 104 + i32.const 72 + i32.const 73 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 664 - i32.const 680 - call $~lib/string/String.__ne - i32.eqz + i32.const 1152 + call $~lib/string/parseInt + f64.const 3855 + f64.ne if i32.const 0 - i32.const 48 - i32.const 105 + i32.const 72 + i32.const 74 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 664 - i32.const 664 - call $~lib/string/String.__eq - i32.eqz + i32.const 1184 + call $~lib/string/parseInt + f64.const 3855 + f64.ne if i32.const 0 - i32.const 48 - i32.const 106 + i32.const 72 + i32.const 75 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 696 - i32.const 712 - call $~lib/string/String.__ne - i32.eqz + i32.const 1216 + call $~lib/string/parseInt + f64.const 11 + f64.ne if i32.const 0 - i32.const 48 - i32.const 107 + i32.const 72 + i32.const 76 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 728 - i32.const 744 - call $~lib/string/String.__ne - i32.eqz + i32.const 1240 + call $~lib/string/parseInt + f64.const 1 + f64.ne if i32.const 0 - i32.const 48 - i32.const 108 + i32.const 72 + i32.const 77 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 760 - i32.const 760 - call $~lib/string/String.__eq - i32.eqz + i32.const 1264 + call $~lib/string/parseInt + f64.const 1 + f64.ne if i32.const 0 - i32.const 48 - i32.const 109 + i32.const 72 + i32.const 79 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 760 - i32.const 784 - call $~lib/string/String.__ne - i32.eqz + i32.const 1288 + call $~lib/string/parseInt + f64.const 2 + f64.ne if i32.const 0 - i32.const 48 - i32.const 110 + i32.const 72 + i32.const 80 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 808 - i32.const 840 - call $~lib/string/String.__ne - i32.eqz + i32.const 1040 + call $~lib/string/parseFloat + f64.const 0 + f64.ne if i32.const 0 - i32.const 48 - i32.const 111 + i32.const 72 + i32.const 82 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 648 - i32.const 128 - call $~lib/string/String.__gt - i32.eqz + i32.const 1064 + call $~lib/string/parseFloat + f64.const 1 + f64.ne if i32.const 0 - i32.const 48 - i32.const 113 + i32.const 72 + i32.const 83 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 864 - i32.const 128 - call $~lib/string/String.__gt - i32.eqz + i32.const 1320 + call $~lib/string/parseFloat + f64.const 0.1 + f64.ne if i32.const 0 - i32.const 48 - i32.const 114 + i32.const 72 + i32.const 84 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 864 - i32.const 872 - call $~lib/string/String.__gte - i32.eqz + i32.const 1344 + call $~lib/string/parseFloat + f64.const 0.25 + f64.ne if i32.const 0 - i32.const 48 - i32.const 115 + i32.const 72 + i32.const 85 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 864 - i32.const 656 - call $~lib/string/String.__gt - i32.eqz + i32.const 1368 + call $~lib/string/parseFloat + f64.const 0.1 + f64.ne if i32.const 0 - i32.const 48 - i32.const 116 + i32.const 72 + i32.const 86 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 864 - i32.const 656 - call $~lib/string/String.__lt + i32.const 1400 + call $~lib/string/parseFloat + f64.const 0.1 + f64.ne if i32.const 0 - i32.const 48 - i32.const 117 + i32.const 72 + i32.const 88 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 648 - global.get $std/string/nullStr - call $~lib/string/String.__lt + i32.const 408 + i32.const 1432 + call $~lib/string/String.__concat + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 1456 + call $~lib/string/String.__eq + i32.eqz if i32.const 0 - i32.const 48 - i32.const 119 + i32.const 72 + i32.const 92 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 408 + call $~lib/string/String.__ne + i32.eqz + if i32.const 0 - call $~lib/env/abort + i32.const 72 + i32.const 93 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/string/nullStr - i32.const 648 - call $~lib/string/String.__lt + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 120 + i32.const 120 + call $~lib/string/String.__eq + i32.eqz if i32.const 0 - i32.const 48 - i32.const 120 + i32.const 72 + i32.const 95 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 288 - i32.const 112 - call $~lib/string/String.__gt + i32.const 120 + global.get $std/string/nullStr + call $~lib/string/String.__ne i32.eqz if i32.const 0 - i32.const 48 - i32.const 122 + i32.const 72 + i32.const 96 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 112 - i32.const 288 - call $~lib/string/String.__lt + global.get $std/string/nullStr + i32.const 120 + call $~lib/string/String.__ne i32.eqz if i32.const 0 - i32.const 48 - i32.const 123 + i32.const 72 + i32.const 97 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 288 - i32.const 112 - call $~lib/string/String.__gte + i32.const 408 + i32.const 1432 + call $~lib/string/String.__ne i32.eqz if i32.const 0 - i32.const 48 - i32.const 124 + i32.const 72 + i32.const 98 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 288 - call $~lib/string/String.__lte + i32.const 408 + i32.const 408 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 125 + i32.const 72 + i32.const 99 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 288 - i32.const 112 - call $~lib/string/String.__lt + i32.const 1480 + i32.const 1504 + call $~lib/string/String.__ne + i32.eqz if i32.const 0 - i32.const 48 - i32.const 126 + i32.const 72 + i32.const 100 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 112 - i32.const 288 - call $~lib/string/String.__gt + i32.const 1480 + i32.const 1480 + call $~lib/string/String.__eq + i32.eqz if i32.const 0 - i32.const 48 - i32.const 127 + i32.const 72 + i32.const 101 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 112 - i32.const 112 - call $~lib/string/String.__lt + i32.const 1528 + i32.const 1552 + call $~lib/string/String.__ne + i32.eqz if i32.const 0 - i32.const 48 - i32.const 128 + i32.const 72 + i32.const 102 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 112 - i32.const 112 - call $~lib/string/String.__gt + i32.const 1576 + i32.const 1608 + call $~lib/string/String.__ne + i32.eqz if i32.const 0 - i32.const 48 - i32.const 129 + i32.const 72 + i32.const 103 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 112 - i32.const 112 - call $~lib/string/String.__gte + i32.const 1640 + i32.const 1640 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 130 + i32.const 72 + i32.const 104 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 112 - call $~lib/string/String.__lte + i32.const 1640 + i32.const 1672 + call $~lib/string/String.__ne i32.eqz if i32.const 0 - i32.const 48 - i32.const 131 + i32.const 72 + i32.const 105 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 65377 - call $~lib/string/String.fromCodePoint - global.set $std/string/a - i32.const 55296 - call $~lib/string/String.fromCodePoint - i32.const 56322 - call $~lib/string/String.fromCodePoint - call $~lib/string/String.__concat - global.set $std/string/b - global.get $std/string/a - global.get $std/string/b - call $~lib/string/String.__gt + i32.const 1704 + i32.const 1744 + call $~lib/string/String.__ne i32.eqz if i32.const 0 - i32.const 48 - i32.const 135 + i32.const 72 + i32.const 106 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable - end - i32.const 320 - i32.load - i32.const 3 - i32.ne + end + i32.const 1432 + i32.const 408 + call $~lib/string/String.__gt + i32.eqz if i32.const 0 - i32.const 48 - i32.const 137 + i32.const 72 + i32.const 108 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 112 - i32.const 100 - call $~lib/string/String#repeat - i32.const 112 - call $~lib/string/String.__eq + i32.const 1784 + i32.const 408 + call $~lib/string/String.__gt i32.eqz if i32.const 0 - i32.const 48 - i32.const 139 + i32.const 72 + i32.const 109 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 128 - i32.const 0 - call $~lib/string/String#repeat - i32.const 112 - call $~lib/string/String.__eq + i32.const 1784 + i32.const 1808 + call $~lib/string/String.__gte i32.eqz if i32.const 0 - i32.const 48 - i32.const 140 + i32.const 72 + i32.const 110 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 128 - i32.const 1 - call $~lib/string/String#repeat - i32.const 128 - call $~lib/string/String.__eq + i32.const 1784 + i32.const 1456 + call $~lib/string/String.__gt i32.eqz if i32.const 0 - i32.const 48 - i32.const 141 + i32.const 72 + i32.const 111 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 128 - i32.const 2 - call $~lib/string/String#repeat - i32.const 872 - call $~lib/string/String.__eq - i32.eqz + i32.const 1784 + i32.const 1456 + call $~lib/string/String.__lt if i32.const 0 - i32.const 48 - i32.const 142 + i32.const 72 + i32.const 112 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 128 - i32.const 3 - call $~lib/string/String#repeat - i32.const 880 - call $~lib/string/String.__eq - i32.eqz + i32.const 1432 + global.get $std/string/nullStr + call $~lib/string/String.__lt if i32.const 0 - i32.const 48 - i32.const 143 + i32.const 72 + i32.const 114 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 656 - i32.const 4 - call $~lib/string/String#repeat - i32.const 896 - call $~lib/string/String.__eq - i32.eqz + global.get $std/string/nullStr + i32.const 1432 + call $~lib/string/String.__lt if i32.const 0 - i32.const 48 - i32.const 144 + i32.const 72 + i32.const 115 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 128 - i32.const 5 - call $~lib/string/String#repeat - i32.const 920 - call $~lib/string/String.__eq + i32.const 680 + i32.const 120 + call $~lib/string/String.__gt i32.eqz if i32.const 0 - i32.const 48 - i32.const 145 + i32.const 72 + i32.const 117 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 128 - i32.const 6 - call $~lib/string/String#repeat - i32.const 936 - call $~lib/string/String.__eq + i32.const 120 + i32.const 680 + call $~lib/string/String.__lt i32.eqz if i32.const 0 - i32.const 48 - i32.const 146 + i32.const 72 + i32.const 118 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 128 - i32.const 7 - call $~lib/string/String#repeat - i32.const 952 - call $~lib/string/String.__eq + i32.const 680 + i32.const 120 + call $~lib/string/String.__gte i32.eqz if i32.const 0 - i32.const 48 - i32.const 147 + i32.const 72 + i32.const 119 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 976 - global.set $std/string/str - i32.const 1 - global.set $~lib/argc - global.get $std/string/str - i32.const 0 - call $~lib/string/String#slice|trampoline - i32.const 976 - call $~lib/string/String.__eq + i32.const 680 + call $~lib/string/String.__lte i32.eqz if i32.const 0 - i32.const 48 - i32.const 151 + i32.const 72 + i32.const 120 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 - global.set $~lib/argc - global.get $std/string/str - i32.const -1 - call $~lib/string/String#slice|trampoline - i32.const 1008 - call $~lib/string/String.__eq - i32.eqz + i32.const 680 + i32.const 120 + call $~lib/string/String.__lt if i32.const 0 - i32.const 48 - i32.const 152 + i32.const 72 + i32.const 121 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 - global.set $~lib/argc - global.get $std/string/str - i32.const -5 - call $~lib/string/String#slice|trampoline - i32.const 1016 - call $~lib/string/String.__eq - i32.eqz + i32.const 120 + i32.const 680 + call $~lib/string/String.__gt if i32.const 0 - i32.const 48 - i32.const 153 + i32.const 72 + i32.const 122 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $std/string/str - i32.const 2 - i32.const 7 - call $~lib/string/String#slice - i32.const 1032 - call $~lib/string/String.__eq - i32.eqz + i32.const 120 + i32.const 120 + call $~lib/string/String.__lt if i32.const 0 - i32.const 48 - i32.const 154 + i32.const 72 + i32.const 123 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $std/string/str - i32.const -11 - i32.const -6 - call $~lib/string/String#slice - i32.const 1048 - call $~lib/string/String.__eq - i32.eqz + i32.const 120 + i32.const 120 + call $~lib/string/String.__gt if i32.const 0 - i32.const 48 - i32.const 155 + i32.const 72 + i32.const 124 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $std/string/str - i32.const 4 - i32.const 3 - call $~lib/string/String#slice - i32.const 112 - call $~lib/string/String.__eq + i32.const 120 + i32.const 120 + call $~lib/string/String.__gte i32.eqz if i32.const 0 - i32.const 48 - i32.const 156 + i32.const 72 + i32.const 125 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $std/string/str - i32.const 0 - i32.const -1 - call $~lib/string/String#slice - i32.const 1064 - call $~lib/string/String.__eq + i32.const 120 + call $~lib/string/String.__lte i32.eqz if i32.const 0 - i32.const 48 - i32.const 157 + i32.const 72 + i32.const 126 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 0 - global.set $~lib/argc - i32.const 112 - i32.const 0 - call $~lib/string/String#split|trampoline - global.set $std/string/sa - global.get $std/string/sa - i32.load offset=4 - i32.const 1 - i32.eq + i32.const 65377 + call $~lib/string/String.fromCodePoint local.tee $0 - if (result i32) - i32.const 0 - global.get $std/string/sa - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end - i32.const 112 - call $~lib/string/String.__eq - else - local.get $0 - end + i32.const 55296 + call $~lib/string/String.fromCodePoint + local.tee $1 + i32.const 56322 + call $~lib/string/String.fromCodePoint + local.tee $2 + call $~lib/string/String.__concat + local.tee $3 + call $~lib/rt/pure/__retain + local.tee $4 + call $~lib/string/String.__gt i32.eqz if i32.const 0 - i32.const 48 - i32.const 162 - i32.const 0 - call $~lib/env/abort + i32.const 72 + i32.const 131 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 1 - global.set $~lib/argc - i32.const 112 - i32.const 112 - call $~lib/string/String#split|trampoline - global.set $std/string/sa - global.get $std/string/sa - i32.load offset=4 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + i32.const 736 + call $~lib/string/String#get:length + i32.const 3 + i32.ne if i32.const 0 - i32.const 48 - i32.const 164 + i32.const 72 + i32.const 134 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 - global.set $~lib/argc - i32.const 112 - i32.const 432 - call $~lib/string/String#split|trampoline - global.set $std/string/sa - global.get $std/string/sa - i32.load offset=4 - i32.const 1 - i32.eq - local.tee $0 - if (result i32) - i32.const 0 - global.get $std/string/sa - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end - i32.const 112 - call $~lib/string/String.__eq - else - local.get $0 - end + i32.const 120 + i32.const 100 + call $~lib/string/String#repeat + local.tee $3 + i32.const 120 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 166 + i32.const 72 + i32.const 136 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 - global.set $~lib/argc - i32.const 1192 - i32.const 1208 - call $~lib/string/String#split|trampoline - global.set $std/string/sa - global.get $std/string/sa - i32.load offset=4 - i32.const 1 - i32.eq - local.tee $0 - if (result i32) - i32.const 0 - global.get $std/string/sa - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end - i32.const 1192 - call $~lib/string/String.__eq - else - local.get $0 - end + i32.const 408 + i32.const 0 + call $~lib/string/String#repeat + local.tee $4 + i32.const 120 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 168 + i32.const 72 + i32.const 137 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + i32.const 408 i32.const 1 - global.set $~lib/argc - i32.const 1192 - i32.const 432 - call $~lib/string/String#split|trampoline - global.set $std/string/sa - block (result i32) - block (result i32) - global.get $std/string/sa - i32.load offset=4 - i32.const 3 - i32.eq - local.tee $0 - if - i32.const 0 - global.get $std/string/sa - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end - i32.const 128 - call $~lib/string/String.__eq - local.set $0 - end - local.get $0 - end - if - i32.const 1 - global.get $std/string/sa - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 648 - call $~lib/string/String.__eq - local.set $0 - end - local.get $0 - end - if (result i32) - i32.const 2 - global.get $std/string/sa - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 8 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 1216 - call $~lib/string/String.__eq - else - local.get $0 - end + call $~lib/string/String#repeat + local.tee $27 + i32.const 408 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 170 + i32.const 72 + i32.const 138 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 - global.set $~lib/argc - i32.const 1224 - i32.const 1248 - call $~lib/string/String#split|trampoline - global.set $std/string/sa - block (result i32) - block (result i32) - global.get $std/string/sa - i32.load offset=4 - i32.const 3 - i32.eq - local.tee $0 - if - i32.const 0 - global.get $std/string/sa - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end - i32.const 128 - call $~lib/string/String.__eq - local.set $0 - end - local.get $0 - end - if - i32.const 1 - global.get $std/string/sa - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 648 - call $~lib/string/String.__eq - local.set $0 - end - local.get $0 - end - if (result i32) - i32.const 2 - global.get $std/string/sa - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 8 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 1216 - call $~lib/string/String.__eq - else - local.get $0 - end + i32.const 408 + i32.const 2 + call $~lib/string/String#repeat + local.tee $28 + i32.const 1808 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 172 + i32.const 72 + i32.const 139 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 - global.set $~lib/argc - i32.const 1256 - i32.const 432 - call $~lib/string/String#split|trampoline - global.set $std/string/sa - block (result i32) - block (result i32) - block (result i32) - global.get $std/string/sa - i32.load offset=4 - i32.const 4 - i32.eq - local.tee $0 - if - i32.const 0 - global.get $std/string/sa - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end - i32.const 128 - call $~lib/string/String.__eq - local.set $0 - end - local.get $0 - end - if - i32.const 1 - global.get $std/string/sa - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 648 - call $~lib/string/String.__eq - local.set $0 - end - local.get $0 - end - if - i32.const 2 - global.get $std/string/sa - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 8 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 112 - call $~lib/string/String.__eq - local.set $0 - end - local.get $0 + i32.const 408 + i32.const 3 + call $~lib/string/String#repeat + local.tee $29 + i32.const 1880 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 140 + i32.const 0 + call $~lib/builtins/abort + unreachable end - if (result i32) - i32.const 3 - global.get $std/string/sa - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 12 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 1216 - call $~lib/string/String.__eq - else - local.get $0 + i32.const 1456 + i32.const 4 + call $~lib/string/String#repeat + local.tee $30 + i32.const 1904 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 141 + i32.const 0 + call $~lib/builtins/abort + unreachable end + i32.const 408 + i32.const 5 + call $~lib/string/String#repeat + local.tee $31 + i32.const 1936 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 174 + i32.const 72 + i32.const 142 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 - global.set $~lib/argc - i32.const 1272 - i32.const 432 - call $~lib/string/String#split|trampoline - global.set $std/string/sa - block (result i32) - block (result i32) - block (result i32) - global.get $std/string/sa - i32.load offset=4 - i32.const 4 - i32.eq - local.tee $0 - if - i32.const 0 - global.get $std/string/sa - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end - i32.const 112 - call $~lib/string/String.__eq - local.set $0 - end - local.get $0 - end - if - i32.const 1 - global.get $std/string/sa - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 128 - call $~lib/string/String.__eq - local.set $0 - end - local.get $0 - end - if - i32.const 2 - global.get $std/string/sa - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 8 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 648 - call $~lib/string/String.__eq - local.set $0 - end - local.get $0 - end - if (result i32) - i32.const 3 - global.get $std/string/sa - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 12 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 1216 - call $~lib/string/String.__eq - else - local.get $0 + i32.const 408 + i32.const 6 + call $~lib/string/String#repeat + local.tee $32 + i32.const 1968 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 143 + i32.const 0 + call $~lib/builtins/abort + unreachable end + i32.const 408 + i32.const 7 + call $~lib/string/String#repeat + local.tee $33 + i32.const 2000 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 176 + i32.const 72 + i32.const 144 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 - global.set $~lib/argc - i32.const 1288 - i32.const 432 - call $~lib/string/String#split|trampoline - global.set $std/string/sa - block (result i32) - block (result i32) - block (result i32) - global.get $std/string/sa - i32.load offset=4 - i32.const 4 - i32.eq - local.tee $0 - if - i32.const 0 - global.get $std/string/sa - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end - i32.const 128 - call $~lib/string/String.__eq - local.set $0 - end - local.get $0 - end - if - i32.const 1 - global.get $std/string/sa - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 648 - call $~lib/string/String.__eq - local.set $0 - end - local.get $0 - end - if - i32.const 2 - global.get $std/string/sa - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 8 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 1216 - call $~lib/string/String.__eq - local.set $0 - end + global.get $std/string/str + local.tee $0 + i32.const 2032 + i32.ne + if + i32.const 2032 + call $~lib/rt/pure/__retain + drop local.get $0 + call $~lib/rt/pure/__release end - if (result i32) - i32.const 3 - global.get $std/string/sa - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 12 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 112 - call $~lib/string/String.__eq - else - local.get $0 + i32.const 2032 + global.set $std/string/str + global.get $std/string/str + i32.const 0 + i32.const 2147483647 + call $~lib/string/String#slice + local.tee $34 + i32.const 2032 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 148 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $std/string/str + i32.const -1 + i32.const 2147483647 + call $~lib/string/String#slice + local.tee $35 + i32.const 2080 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 149 + i32.const 0 + call $~lib/builtins/abort + unreachable end + global.get $std/string/str + i32.const -5 + i32.const 2147483647 + call $~lib/string/String#slice + local.tee $36 + i32.const 2104 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 178 + i32.const 72 + i32.const 150 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1 - global.set $~lib/argc - i32.const 288 - i32.const 112 - call $~lib/string/String#split|trampoline - global.set $std/string/sa - block (result i32) - block (result i32) - global.get $std/string/sa - i32.load offset=4 - i32.const 3 - i32.eq - local.tee $0 - if - i32.const 0 - global.get $std/string/sa - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end - i32.const 128 - call $~lib/string/String.__eq - local.set $0 - end - local.get $0 - end - if - i32.const 1 - global.get $std/string/sa - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 648 - call $~lib/string/String.__eq - local.set $0 - end - local.get $0 + global.get $std/string/str + i32.const 2 + i32.const 7 + call $~lib/string/String#slice + local.tee $37 + i32.const 2136 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 151 + i32.const 0 + call $~lib/builtins/abort + unreachable end - if (result i32) - i32.const 2 - global.get $std/string/sa - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 8 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 1216 - call $~lib/string/String.__eq - else - local.get $0 + global.get $std/string/str + i32.const -11 + i32.const -6 + call $~lib/string/String#slice + local.tee $38 + i32.const 2168 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 152 + i32.const 0 + call $~lib/builtins/abort + unreachable end + global.get $std/string/str + i32.const 4 + i32.const 3 + call $~lib/string/String#slice + local.tee $39 + i32.const 120 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 180 + i32.const 72 + i32.const 153 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 288 - i32.const 112 + global.get $std/string/str i32.const 0 - call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - i32.load offset=4 + i32.const -1 + call $~lib/string/String#slice + local.tee $40 + i32.const 2200 + call $~lib/string/String.__eq + i32.eqz if i32.const 0 - i32.const 48 - i32.const 182 + i32.const 72 + i32.const 154 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 288 - i32.const 112 - i32.const 1 + i32.const 120 + i32.const 0 call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - i32.load offset=4 + local.set $0 + i32.const 0 + call $~lib/rt/pure/__release + local.get $0 + i32.load offset=12 i32.const 1 i32.eq - local.tee $0 - if (result i32) + if + local.get $0 i32.const 0 - global.get $std/string/sa - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end - i32.const 128 + call $~lib/array/Array<~lib/string/String>#__get + local.tee $2 + i32.const 120 call $~lib/string/String.__eq + local.set $1 + local.get $2 + call $~lib/rt/pure/__release else - local.get $0 + i32.const 0 + local.set $1 end + local.get $1 i32.eqz if i32.const 0 - i32.const 48 - i32.const 184 + i32.const 72 + i32.const 160 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 120 + i32.const 120 + call $~lib/string/String#split + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + i32.load offset=12 + if i32.const 0 - call $~lib/env/abort + i32.const 72 + i32.const 162 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 1192 - i32.const 432 - i32.const 1 + i32.const 120 + i32.const 920 call $~lib/string/String#split - global.set $std/string/sa - global.get $std/string/sa - i32.load offset=4 + local.set $2 + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + i32.load offset=12 i32.const 1 i32.eq - local.tee $0 - if (result i32) + if + local.get $2 i32.const 0 - global.get $std/string/sa - i32.load + call $~lib/array/Array<~lib/string/String>#__get local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end - i32.const 128 + i32.const 120 call $~lib/string/String.__eq - else + local.set $1 local.get $0 + call $~lib/rt/pure/__release + else + i32.const 0 + local.set $1 end + local.get $1 i32.eqz if i32.const 0 - i32.const 48 - i32.const 186 - i32.const 0 - call $~lib/env/abort + i32.const 72 + i32.const 164 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 288 - i32.const 112 - i32.const 4 + i32.const 2408 + i32.const 2440 call $~lib/string/String#split - global.set $std/string/sa - block (result i32) - block (result i32) - global.get $std/string/sa - i32.load offset=4 - i32.const 3 - i32.eq - local.tee $0 - if - i32.const 0 - global.get $std/string/sa - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end - i32.const 128 - call $~lib/string/String.__eq - local.set $0 - end - local.get $0 - end - if - i32.const 1 - global.get $std/string/sa - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 648 - call $~lib/string/String.__eq - local.set $0 - end + local.set $0 + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + i32.load offset=12 + i32.const 1 + i32.eq + if local.get $0 - end - if (result i32) - i32.const 2 - global.get $std/string/sa - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 8 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 1216 + i32.const 0 + call $~lib/array/Array<~lib/string/String>#__get + local.tee $2 + i32.const 2408 call $~lib/string/String.__eq + local.set $1 + local.get $2 + call $~lib/rt/pure/__release else - local.get $0 + i32.const 0 + local.set $1 end + local.get $1 i32.eqz if i32.const 0 - i32.const 48 - i32.const 188 - i32.const 0 - call $~lib/env/abort + i32.const 72 + i32.const 166 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 288 - i32.const 112 - i32.const -1 + i32.const 2408 + i32.const 920 call $~lib/string/String#split - global.set $std/string/sa - block (result i32) - block (result i32) - global.get $std/string/sa - i32.load offset=4 - i32.const 3 - i32.eq - local.tee $0 - if - i32.const 0 - global.get $std/string/sa - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end - i32.const 128 - call $~lib/string/String.__eq - local.set $0 - end - local.get $0 - end - if - i32.const 1 - global.get $std/string/sa - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 648 - call $~lib/string/String.__eq - local.set $0 - end + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + local.tee $0 + i32.load offset=12 + i32.const 3 + i32.eq + if local.get $0 - end - if (result i32) - i32.const 2 - global.get $std/string/sa - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 8 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 1216 + i32.const 0 + call $~lib/array/Array<~lib/string/String>#__get + local.tee $2 + i32.const 408 call $~lib/string/String.__eq + local.set $1 + local.get $2 + call $~lib/rt/pure/__release else - local.get $0 + i32.const 0 + local.set $1 end - i32.eqz + local.get $1 if + local.get $0 + i32.const 1 + call $~lib/array/Array<~lib/string/String>#__get + local.tee $2 + i32.const 1432 + call $~lib/string/String.__eq + local.set $1 + local.get $2 + call $~lib/rt/pure/__release + else i32.const 0 - i32.const 48 - i32.const 190 - i32.const 0 - call $~lib/env/abort - unreachable + local.set $1 end - i32.const 1192 - i32.const 432 - i32.const -1 - call $~lib/string/String#split - global.set $std/string/sa - block (result i32) - block (result i32) - global.get $std/string/sa - i32.load offset=4 - i32.const 3 - i32.eq - local.tee $0 - if - i32.const 0 - global.get $std/string/sa - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end - i32.const 128 - call $~lib/string/String.__eq - local.set $0 - end - local.get $0 - end - if - i32.const 1 - global.get $std/string/sa - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 648 - call $~lib/string/String.__eq - local.set $0 - end + local.get $1 + if local.get $0 - end - if (result i32) - i32.const 2 - global.get $std/string/sa - i32.load - local.tee $0 - i32.load i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 8 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 1216 + call $~lib/array/Array<~lib/string/String>#__get + local.tee $2 + i32.const 2464 call $~lib/string/String.__eq + local.set $1 + local.get $2 + call $~lib/rt/pure/__release else - local.get $0 + i32.const 0 + local.set $1 end + local.get $1 i32.eqz if i32.const 0 - i32.const 48 - i32.const 192 - i32.const 0 - call $~lib/env/abort + i32.const 72 + i32.const 168 + i32.const 2 + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release i32.const 0 - call $~lib/internal/number/itoa32 - i32.const 480 + call $~lib/util/number/itoa32 + local.tee $0 + i32.const 1040 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 194 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 - call $~lib/internal/number/itoa32 - i32.const 488 + call $~lib/util/number/itoa32 + local.tee $1 + i32.const 1064 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 195 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 8 - call $~lib/internal/number/itoa32 - i32.const 1824 + call $~lib/util/number/itoa32 + local.tee $2 + i32.const 2488 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 196 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 123 - call $~lib/internal/number/itoa32 - i32.const 320 + call $~lib/util/number/itoa32 + local.tee $41 + i32.const 736 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 197 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const -1000 - call $~lib/internal/number/itoa32 - i32.const 1832 + call $~lib/util/number/itoa32 + local.tee $42 + i32.const 2512 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 198 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1234 - call $~lib/internal/number/itoa32 - i32.const 1848 + call $~lib/util/number/itoa32 + local.tee $43 + i32.const 2544 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 199 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 12345 - call $~lib/internal/number/itoa32 - i32.const 1864 + call $~lib/util/number/itoa32 + local.tee $44 + i32.const 2568 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 200 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 123456 - call $~lib/internal/number/itoa32 - i32.const 1880 + call $~lib/util/number/itoa32 + local.tee $45 + i32.const 2600 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 201 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1111111 - call $~lib/internal/number/itoa32 - i32.const 1896 + call $~lib/util/number/itoa32 + local.tee $46 + i32.const 2632 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 202 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1234567 - call $~lib/internal/number/itoa32 - i32.const 1920 + call $~lib/util/number/itoa32 + local.tee $47 + i32.const 2664 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 203 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2147483646 - call $~lib/internal/number/itoa32 - i32.const 1944 + call $~lib/util/number/itoa32 + local.tee $48 + i32.const 2696 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 204 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2147483647 - call $~lib/internal/number/itoa32 - i32.const 1968 + call $~lib/util/number/itoa32 + local.tee $49 + i32.const 2736 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 205 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const -2147483648 - call $~lib/internal/number/itoa32 - i32.const 1992 + call $~lib/util/number/itoa32 + local.tee $50 + i32.const 2776 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 206 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const -1 - call $~lib/internal/number/itoa32 - i32.const 2024 + call $~lib/util/number/itoa32 + local.tee $51 + i32.const 2816 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 207 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 - call $~lib/internal/number/utoa32 - i32.const 480 + call $~lib/util/number/utoa32 + local.tee $52 + i32.const 1040 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 209 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1000 - call $~lib/internal/number/utoa32 - i32.const 2032 + call $~lib/util/number/utoa32 + local.tee $53 + i32.const 2840 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 210 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2147483647 - call $~lib/internal/number/utoa32 - i32.const 1968 + call $~lib/util/number/utoa32 + local.tee $54 + i32.const 2736 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 211 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const -2147483648 - call $~lib/internal/number/utoa32 - i32.const 2048 + call $~lib/util/number/utoa32 + local.tee $55 + i32.const 2864 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 212 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const -1 - call $~lib/internal/number/utoa32 - i32.const 2072 + call $~lib/util/number/utoa32 + local.tee $56 + i32.const 2904 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 213 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 0 - call $~lib/internal/number/utoa64 - i32.const 480 + call $~lib/util/number/utoa64 + local.tee $57 + i32.const 1040 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 215 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 1234 - call $~lib/internal/number/utoa64 - i32.const 1848 + call $~lib/util/number/utoa64 + local.tee $58 + i32.const 2544 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 216 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 99999999 - call $~lib/internal/number/utoa64 - i32.const 2096 + call $~lib/util/number/utoa64 + local.tee $59 + i32.const 2944 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 217 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 100000000 - call $~lib/internal/number/utoa64 - i32.const 2120 + call $~lib/util/number/utoa64 + local.tee $60 + i32.const 2976 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 218 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 4294967295 - call $~lib/internal/number/utoa64 - i32.const 2072 + call $~lib/util/number/utoa64 + local.tee $61 + i32.const 2904 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 219 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 68719476735 - call $~lib/internal/number/utoa64 - i32.const 2144 + call $~lib/util/number/utoa64 + local.tee $62 + i32.const 3016 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 220 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 868719476735 - call $~lib/internal/number/utoa64 - i32.const 2176 + call $~lib/util/number/utoa64 + local.tee $63 + i32.const 3056 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 221 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 999868719476735 - call $~lib/internal/number/utoa64 - i32.const 2208 + call $~lib/util/number/utoa64 + local.tee $64 + i32.const 3096 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 222 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 9999868719476735 - call $~lib/internal/number/utoa64 - i32.const 2248 + call $~lib/util/number/utoa64 + local.tee $65 + i32.const 3144 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 223 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 19999868719476735 - call $~lib/internal/number/utoa64 - i32.const 2288 + call $~lib/util/number/utoa64 + local.tee $66 + i32.const 3192 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 224 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -1 - call $~lib/internal/number/utoa64 - i32.const 2328 + call $~lib/util/number/utoa64 + local.tee $67 + i32.const 3248 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 225 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 0 - call $~lib/internal/number/itoa64 - i32.const 480 + call $~lib/util/number/itoa64 + local.tee $68 + i32.const 1040 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 227 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -1234 - call $~lib/internal/number/itoa64 - i32.const 2376 + call $~lib/util/number/itoa64 + local.tee $69 + i32.const 3304 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 228 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 4294967295 - call $~lib/internal/number/itoa64 - i32.const 2072 + call $~lib/util/number/itoa64 + local.tee $70 + i32.const 2904 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 229 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -4294967295 - call $~lib/internal/number/itoa64 - i32.const 2392 + call $~lib/util/number/itoa64 + local.tee $71 + i32.const 3336 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 230 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 68719476735 - call $~lib/internal/number/itoa64 - i32.const 2144 + call $~lib/util/number/itoa64 + local.tee $72 + i32.const 3016 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 231 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -68719476735 - call $~lib/internal/number/itoa64 - i32.const 2424 + call $~lib/util/number/itoa64 + local.tee $73 + i32.const 3376 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 232 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -868719476735 - call $~lib/internal/number/itoa64 - i32.const 2456 + call $~lib/util/number/itoa64 + local.tee $74 + i32.const 3416 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 233 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -999868719476735 - call $~lib/internal/number/itoa64 - i32.const 2488 + call $~lib/util/number/itoa64 + local.tee $75 + i32.const 3464 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 234 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -19999868719476735 - call $~lib/internal/number/itoa64 - i32.const 2528 + call $~lib/util/number/itoa64 + local.tee $76 + i32.const 3512 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 235 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 9223372036854775807 - call $~lib/internal/number/itoa64 - i32.const 2568 + call $~lib/util/number/itoa64 + local.tee $77 + i32.const 3568 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 236 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -9223372036854775808 - call $~lib/internal/number/itoa64 - i32.const 2616 + call $~lib/util/number/itoa64 + local.tee $78 + i32.const 3624 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 237 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 - call $~lib/internal/number/dtoa - i32.const 2664 + call $~lib/util/number/dtoa + local.tee $79 + i32.const 3680 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 240 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 - call $~lib/internal/number/dtoa - i32.const 2664 + call $~lib/util/number/dtoa + local.tee $80 + i32.const 3680 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 241 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 - call $~lib/internal/number/dtoa - i32.const 2680 + call $~lib/util/number/dtoa + local.tee $81 + i32.const 3704 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 242 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf - call $~lib/internal/number/dtoa - i32.const 2720 + call $~lib/util/number/dtoa + local.tee $82 + i32.const 3768 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 243 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf - call $~lib/internal/number/dtoa - i32.const 2696 + call $~lib/util/number/dtoa + local.tee $83 + i32.const 3728 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 244 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.220446049250313e-16 - call $~lib/internal/number/dtoa - i32.const 4112 + call $~lib/util/number/dtoa + local.tee $84 + i32.const 4856 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 245 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -2.220446049250313e-16 - call $~lib/internal/number/dtoa - i32.const 4160 + call $~lib/util/number/dtoa + local.tee $85 + i32.const 4920 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 246 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1797693134862315708145274e284 - call $~lib/internal/number/dtoa - i32.const 4208 + call $~lib/util/number/dtoa + local.tee $86 + i32.const 4984 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 247 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1797693134862315708145274e284 - call $~lib/internal/number/dtoa - i32.const 4264 + call $~lib/util/number/dtoa + local.tee $87 + i32.const 5048 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 248 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4185580496821356722454785e274 - call $~lib/internal/number/dtoa - i32.const 4320 + call $~lib/util/number/dtoa + local.tee $88 + i32.const 5112 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 249 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.2250738585072014e-308 - call $~lib/internal/number/dtoa - i32.const 4368 + call $~lib/util/number/dtoa + local.tee $89 + i32.const 5176 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 250 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.940656e-318 - call $~lib/internal/number/dtoa - i32.const 4424 + call $~lib/util/number/dtoa + local.tee $90 + i32.const 5240 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 253 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9060801153433600 - call $~lib/internal/number/dtoa - i32.const 4456 + call $~lib/util/number/dtoa + local.tee $91 + i32.const 5288 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 254 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4708356024711512064 - call $~lib/internal/number/dtoa - i32.const 4496 + call $~lib/util/number/dtoa + local.tee $92 + i32.const 5344 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 255 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9409340012568248320 - call $~lib/internal/number/dtoa - i32.const 4544 + call $~lib/util/number/dtoa + local.tee $93 + i32.const 5408 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 256 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 5e-324 - call $~lib/internal/number/dtoa - i32.const 4592 + call $~lib/util/number/dtoa + local.tee $94 + i32.const 5472 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 257 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 - call $~lib/internal/number/dtoa - i32.const 4608 + call $~lib/util/number/dtoa + local.tee $95 + i32.const 5504 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 263 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.1 - call $~lib/internal/number/dtoa - i32.const 592 + call $~lib/util/number/dtoa + local.tee $96 + i32.const 1320 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 264 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 - call $~lib/internal/number/dtoa - i32.const 4624 + call $~lib/util/number/dtoa + local.tee $97 + i32.const 5528 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 265 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.1 - call $~lib/internal/number/dtoa - i32.const 4640 + call $~lib/util/number/dtoa + local.tee $98 + i32.const 5552 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 266 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1e6 - call $~lib/internal/number/dtoa - i32.const 4656 + call $~lib/util/number/dtoa + local.tee $99 + i32.const 5576 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 268 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1e-06 - call $~lib/internal/number/dtoa - i32.const 4680 + call $~lib/util/number/dtoa + local.tee $100 + i32.const 5616 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 269 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1e6 - call $~lib/internal/number/dtoa - i32.const 4704 + call $~lib/util/number/dtoa + local.tee $101 + i32.const 5648 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 270 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1e-06 - call $~lib/internal/number/dtoa - i32.const 4728 + call $~lib/util/number/dtoa + local.tee $102 + i32.const 5688 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 271 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1e7 - call $~lib/internal/number/dtoa - i32.const 4752 + call $~lib/util/number/dtoa + local.tee $103 + i32.const 5728 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 272 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1e-07 - call $~lib/internal/number/dtoa - i32.const 4776 + call $~lib/util/number/dtoa + local.tee $104 + i32.const 5768 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 273 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.e+308 - call $~lib/internal/number/dtoa - i32.const 4792 + call $~lib/util/number/dtoa + local.tee $105 + i32.const 5792 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 275 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.e+308 - call $~lib/internal/number/dtoa - i32.const 4808 + call $~lib/util/number/dtoa + local.tee $106 + i32.const 5824 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 276 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf - call $~lib/internal/number/dtoa - i32.const 2720 + call $~lib/util/number/dtoa + local.tee $107 + i32.const 3768 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 277 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf - call $~lib/internal/number/dtoa - i32.const 2696 + call $~lib/util/number/dtoa + local.tee $108 + i32.const 3728 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 278 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1e-308 - call $~lib/internal/number/dtoa - i32.const 4832 + call $~lib/util/number/dtoa + local.tee $109 + i32.const 5856 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 279 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1e-308 - call $~lib/internal/number/dtoa - i32.const 4848 + call $~lib/util/number/dtoa + local.tee $110 + i32.const 5888 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 280 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1e-323 - call $~lib/internal/number/dtoa - i32.const 4872 + call $~lib/util/number/dtoa + local.tee $111 + i32.const 5920 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 281 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1e-323 - call $~lib/internal/number/dtoa - i32.const 4888 + call $~lib/util/number/dtoa + local.tee $112 + i32.const 5952 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 282 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 - call $~lib/internal/number/dtoa - i32.const 2664 + call $~lib/util/number/dtoa + local.tee $113 + i32.const 3680 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 283 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4294967272 - call $~lib/internal/number/dtoa - i32.const 4912 + call $~lib/util/number/dtoa + local.tee $114 + i32.const 5984 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 285 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.2312145673456234e-08 - call $~lib/internal/number/dtoa - i32.const 4944 + call $~lib/util/number/dtoa + local.tee $115 + i32.const 6024 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 286 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 555555555.5555556 - call $~lib/internal/number/dtoa - i32.const 4992 + call $~lib/util/number/dtoa + local.tee $116 + i32.const 6088 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 288 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.9999999999999999 - call $~lib/internal/number/dtoa - i32.const 5032 + call $~lib/util/number/dtoa + local.tee $117 + i32.const 6144 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 289 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 - call $~lib/internal/number/dtoa - i32.const 4608 + call $~lib/util/number/dtoa + local.tee $118 + i32.const 5504 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 290 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 12.34 - call $~lib/internal/number/dtoa - i32.const 5072 + call $~lib/util/number/dtoa + local.tee $119 + i32.const 6200 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 291 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.3333333333333333 - call $~lib/internal/number/dtoa - i32.const 5088 + call $~lib/util/number/dtoa + local.tee $120 + i32.const 6232 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 293 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1234e17 - call $~lib/internal/number/dtoa - i32.const 5128 + call $~lib/util/number/dtoa + local.tee $121 + i32.const 6288 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 294 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1234e18 - call $~lib/internal/number/dtoa - i32.const 5184 + call $~lib/util/number/dtoa + local.tee $122 + i32.const 6352 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 295 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.71828 - call $~lib/internal/number/dtoa - i32.const 5208 + call $~lib/util/number/dtoa + local.tee $123 + i32.const 6392 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 296 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.0271828 - call $~lib/internal/number/dtoa - i32.const 5232 + call $~lib/util/number/dtoa + local.tee $124 + i32.const 6424 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 297 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 271.828 - call $~lib/internal/number/dtoa - i32.const 5256 + call $~lib/util/number/dtoa + local.tee $125 + i32.const 6464 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 298 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.1e+128 - call $~lib/internal/number/dtoa - i32.const 5280 + call $~lib/util/number/dtoa + local.tee $126 + i32.const 6496 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 299 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.1e-64 - call $~lib/internal/number/dtoa - i32.const 5304 + call $~lib/util/number/dtoa + local.tee $127 + i32.const 6528 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 300 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.000035689 - call $~lib/internal/number/dtoa - i32.const 5328 + call $~lib/util/number/dtoa + local.tee $128 + i32.const 6560 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 301 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + global.get $std/string/str + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release + local.get $8 + call $~lib/rt/pure/__release + local.get $9 + call $~lib/rt/pure/__release + local.get $10 + call $~lib/rt/pure/__release + local.get $11 + call $~lib/rt/pure/__release + local.get $12 + call $~lib/rt/pure/__release + local.get $13 + call $~lib/rt/pure/__release + local.get $14 + call $~lib/rt/pure/__release + local.get $15 + call $~lib/rt/pure/__release + local.get $16 + call $~lib/rt/pure/__release + local.get $17 + call $~lib/rt/pure/__release + local.get $18 + call $~lib/rt/pure/__release + local.get $19 + call $~lib/rt/pure/__release + local.get $20 + call $~lib/rt/pure/__release + local.get $21 + call $~lib/rt/pure/__release + local.get $22 + call $~lib/rt/pure/__release + local.get $23 + call $~lib/rt/pure/__release + local.get $24 + call $~lib/rt/pure/__release + local.get $25 + call $~lib/rt/pure/__release + local.get $26 + call $~lib/rt/pure/__release + local.get $28 + call $~lib/rt/pure/__release + local.get $29 + call $~lib/rt/pure/__release + local.get $27 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $30 + call $~lib/rt/pure/__release + local.get $31 + call $~lib/rt/pure/__release + local.get $32 + call $~lib/rt/pure/__release + local.get $33 + call $~lib/rt/pure/__release + local.get $34 + call $~lib/rt/pure/__release + local.get $35 + call $~lib/rt/pure/__release + local.get $36 + call $~lib/rt/pure/__release + local.get $37 + call $~lib/rt/pure/__release + local.get $38 + call $~lib/rt/pure/__release + local.get $39 + call $~lib/rt/pure/__release + local.get $40 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $41 + call $~lib/rt/pure/__release + local.get $42 + call $~lib/rt/pure/__release + local.get $43 + call $~lib/rt/pure/__release + local.get $44 + call $~lib/rt/pure/__release + local.get $45 + call $~lib/rt/pure/__release + local.get $46 + call $~lib/rt/pure/__release + local.get $47 + call $~lib/rt/pure/__release + local.get $48 + call $~lib/rt/pure/__release + local.get $49 + call $~lib/rt/pure/__release + local.get $50 + call $~lib/rt/pure/__release + local.get $51 + call $~lib/rt/pure/__release + local.get $52 + call $~lib/rt/pure/__release + local.get $53 + call $~lib/rt/pure/__release + local.get $54 + call $~lib/rt/pure/__release + local.get $55 + call $~lib/rt/pure/__release + local.get $56 + call $~lib/rt/pure/__release + local.get $57 + call $~lib/rt/pure/__release + local.get $58 + call $~lib/rt/pure/__release + local.get $59 + call $~lib/rt/pure/__release + local.get $60 + call $~lib/rt/pure/__release + local.get $61 + call $~lib/rt/pure/__release + local.get $62 + call $~lib/rt/pure/__release + local.get $63 + call $~lib/rt/pure/__release + local.get $64 + call $~lib/rt/pure/__release + local.get $65 + call $~lib/rt/pure/__release + local.get $66 + call $~lib/rt/pure/__release + local.get $67 + call $~lib/rt/pure/__release + local.get $68 + call $~lib/rt/pure/__release + local.get $69 + call $~lib/rt/pure/__release + local.get $70 + call $~lib/rt/pure/__release + local.get $71 + call $~lib/rt/pure/__release + local.get $72 + call $~lib/rt/pure/__release + local.get $73 + call $~lib/rt/pure/__release + local.get $74 + call $~lib/rt/pure/__release + local.get $75 + call $~lib/rt/pure/__release + local.get $76 + call $~lib/rt/pure/__release + local.get $77 + call $~lib/rt/pure/__release + local.get $78 + call $~lib/rt/pure/__release + local.get $79 + call $~lib/rt/pure/__release + local.get $80 + call $~lib/rt/pure/__release + local.get $81 + call $~lib/rt/pure/__release + local.get $82 + call $~lib/rt/pure/__release + local.get $83 + call $~lib/rt/pure/__release + local.get $84 + call $~lib/rt/pure/__release + local.get $85 + call $~lib/rt/pure/__release + local.get $86 + call $~lib/rt/pure/__release + local.get $87 + call $~lib/rt/pure/__release + local.get $88 + call $~lib/rt/pure/__release + local.get $89 + call $~lib/rt/pure/__release + local.get $90 + call $~lib/rt/pure/__release + local.get $91 + call $~lib/rt/pure/__release + local.get $92 + call $~lib/rt/pure/__release + local.get $93 + call $~lib/rt/pure/__release + local.get $94 + call $~lib/rt/pure/__release + local.get $95 + call $~lib/rt/pure/__release + local.get $96 + call $~lib/rt/pure/__release + local.get $97 + call $~lib/rt/pure/__release + local.get $98 + call $~lib/rt/pure/__release + local.get $99 + call $~lib/rt/pure/__release + local.get $100 + call $~lib/rt/pure/__release + local.get $101 + call $~lib/rt/pure/__release + local.get $102 + call $~lib/rt/pure/__release + local.get $103 + call $~lib/rt/pure/__release + local.get $104 + call $~lib/rt/pure/__release + local.get $105 + call $~lib/rt/pure/__release + local.get $106 + call $~lib/rt/pure/__release + local.get $107 + call $~lib/rt/pure/__release + local.get $108 + call $~lib/rt/pure/__release + local.get $109 + call $~lib/rt/pure/__release + local.get $110 + call $~lib/rt/pure/__release + local.get $111 + call $~lib/rt/pure/__release + local.get $112 + call $~lib/rt/pure/__release + local.get $113 + call $~lib/rt/pure/__release + local.get $114 + call $~lib/rt/pure/__release + local.get $115 + call $~lib/rt/pure/__release + local.get $116 + call $~lib/rt/pure/__release + local.get $117 + call $~lib/rt/pure/__release + local.get $118 + call $~lib/rt/pure/__release + local.get $119 + call $~lib/rt/pure/__release + local.get $120 + call $~lib/rt/pure/__release + local.get $121 + call $~lib/rt/pure/__release + local.get $122 + call $~lib/rt/pure/__release + local.get $123 + call $~lib/rt/pure/__release + local.get $124 + call $~lib/rt/pure/__release + local.get $125 + call $~lib/rt/pure/__release + local.get $126 + call $~lib/rt/pure/__release + local.get $127 + call $~lib/rt/pure/__release + local.get $128 + call $~lib/rt/pure/__release ) - (func $std/string/getString (; 54 ;) (type $FUNCSIG$i) (result i32) + (func $std/string/getString (; 74 ;) (type $FUNCSIG$i) (result i32) global.get $std/string/str + call $~lib/rt/pure/__retain ) - (func $start (; 55 ;) (type $FUNCSIG$v) + (func $start (; 75 ;) (type $FUNCSIG$v) + global.get $~lib/started + if + return + else + i32.const 1 + global.set $~lib/started + end call $start:std/string ) - (func $null (; 56 ;) (type $FUNCSIG$v) + (func $~lib/rt/pure/markGray (; 76 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members + end + ) + (func $~lib/rt/pure/scanBlack (; 77 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 78 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (; 79 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + ) + (func $~lib/rt/pure/__visit (; 80 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + local.get $0 + i32.const 6652 + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $0 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + local.get $1 + i32.const 1 + i32.ne + if + local.get $1 + i32.const 2 + i32.eq + br_if $case1|0 + block $tablify|0 + local.get $1 + i32.const 3 + i32.sub + br_table $case2|0 $case3|0 $case4|0 $tablify|0 + end + br $case5|0 + end + local.get $0 + call $~lib/rt/pure/decrement + br $break|0 + end + local.get $0 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 136 + i32.const 75 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $0 + call $~lib/rt/pure/markGray + br $break|0 + end + local.get $0 + call $~lib/rt/pure/scan + br $break|0 + end + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const -268435456 + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne + if + i32.const 0 + i32.const 136 + i32.const 86 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $1 + i32.const 1879048192 + i32.and + if + local.get $0 + call $~lib/rt/pure/scanBlack + end + br $break|0 + end + local.get $0 + call $~lib/rt/pure/collectWhite + br $break|0 + end + i32.const 0 + i32.const 136 + i32.const 97 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/array/Array<~lib/string/String>#__visit_impl (; 81 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + i32.load offset=4 + local.tee $2 + local.get $0 + i32.load offset=12 + i32.const 2 + i32.shl + i32.add + local.set $0 + loop $continue|0 + local.get $2 + local.get $0 + i32.lt_u + if + local.get $2 + i32.load + local.tee $3 + if + local.get $3 + local.get $1 + call $~lib/rt/pure/__visit + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 + end + end + ) + (func $~lib/rt/__visit_members (; 82 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + block $block$4$break + block $switch$1$default + block $switch$1$case$5 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $block$4$break $switch$1$case$5 $block$4$break $block$4$break $block$4$break $block$4$break $switch$1$default + end + return + end + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/string/String>#__visit_impl + br $block$4$break + end + unreachable + end + local.get $0 + i32.load + local.tee $0 + if + local.get $0 + local.get $1 + call $~lib/rt/pure/__visit + end + ) + (func $null (; 83 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/string.ts b/tests/compiler/std/string.ts index 2393c27a3b..74a0f04eef 100644 --- a/tests/compiler/std/string.ts +++ b/tests/compiler/std/string.ts @@ -1,14 +1,6 @@ -import "allocator/arena"; -import { - utoa32, - itoa32, - utoa64, - itoa64, - dtoa -} from "internal/number"; +import { utoa32, itoa32, utoa64, itoa64, dtoa } from "util/number"; // preliminary - var str: string = "hi, I'm a string"; var nullStr: string; @@ -75,10 +67,6 @@ assert(str.lastIndexOf(", I", -1) == -1); assert(str.lastIndexOf("i", 0) == -1); assert(str.lastIndexOf("hi", 0) == 0); -export function getString(): string { - return str; -} - assert(parseInt("0") == 0); assert(parseInt("1") == 1); assert(parseInt("0b101") == 0b101); @@ -88,15 +76,22 @@ assert(parseInt("0xF0F") == 0xf0f); assert(parseInt("011") == 11); // not octal assert(parseInt("0x1g") == 1); // not valid +assert(parseInt(" \t\n1") == 1); +assert(parseInt(" \t\n0x02") == 2); + assert(parseFloat("0") == 0); assert(parseFloat("1") == 1); assert(parseFloat("0.1") == 0.1); assert(parseFloat(".25") == 0.25); assert(parseFloat(".1foobar") == 0.1); -var c = "a" + "b"; -assert(c == "ab"); -assert(c != "a"); +assert(parseFloat(" \t\n.1") == 0.1); + +{ + let c = "a" + "b"; + assert(c == "ab"); + assert(c != "a"); +} assert("" == ""); assert("" != nullStr); assert(nullStr != ""); @@ -130,9 +125,11 @@ assert(!("" > "")); assert("" >= ""); assert("" <= ""); -var a = String.fromCodePoint(0xFF61); -var b = String.fromCodePoint(0xD800) + String.fromCodePoint(0xDC02); -assert(a > b); +{ + let a = String.fromCodePoint(0xFF61); + let b = String.fromCodePoint(0xD800) + String.fromCodePoint(0xDC02); + assert(a > b); +} assert("123".length == 3); @@ -156,40 +153,43 @@ assert(str.slice(-11, -6) == "defgh"); assert(str.slice(4, 3) == ""); assert(str.slice(0, -1) == "abcdefghijklm"); -var sa: string[]; - -sa = "".split(); -assert(sa.length == 1 && sa[0] == ""); -sa = "".split(""); -assert(sa.length == 0); -sa = "".split(","); -assert(sa.length == 1 && sa[0] == ""); -sa = "a,b,c".split("."); -assert(sa.length == 1 && sa[0] == "a,b,c"); -sa = "a,b,c".split(","); -assert(sa.length == 3 && sa[0] == "a" && sa[1] == "b" && sa[2] == "c"); -sa = "a, b, c".split(", "); -assert(sa.length == 3 && sa[0] == "a" && sa[1] == "b" && sa[2] == "c"); -sa = "a,b,,c".split(","); -assert(sa.length == 4 && sa[0] == "a" && sa[1] == "b" && sa[2] == "" && sa[3] == "c"); -sa = ",a,b,c".split(","); -assert(sa.length == 4 && sa[0] == "" && sa[1] == "a" && sa[2] == "b" && sa[3] == "c"); -sa = "a,b,c,".split(","); -assert(sa.length == 4 && sa[0] == "a" && sa[1] == "b" && sa[2] == "c" && sa[3] == ""); -sa = "abc".split(""); -assert(sa.length == 3 && sa[0] == "a" && sa[1] == "b" && sa[2] == "c"); -sa = "abc".split("", 0); -assert(sa.length == 0); -sa = "abc".split("", 1); -assert(sa.length == 1 && sa[0] == "a"); -sa = "a,b,c".split(",", 1); -assert(sa.length == 1 && sa[0] == "a"); -sa = "abc".split("", 4); -assert(sa.length == 3 && sa[0] == "a" && sa[1] == "b" && sa[2] == "c"); -sa = "abc".split("", -1); -assert(sa.length == 3 && sa[0] == "a" && sa[1] == "b" && sa[2] == "c"); -sa = "a,b,c".split(",", -1); -assert(sa.length == 3 && sa[0] == "a" && sa[1] == "b" && sa[2] == "c"); +{ + let sa: string[]; + + sa = "".split(); + assert(sa.length == 1 && sa[0] == ""); + sa = "".split(""); + assert(sa.length == 0); + sa = "".split(","); + assert(sa.length == 1 && sa[0] == ""); + sa = "a,b,c".split("."); + assert(sa.length == 1 && sa[0] == "a,b,c"); + sa = "a,b,c".split(","); + assert(sa.length == 3 && sa[0] == "a" && sa[1] == "b" && sa[2] == "c"); + /*sa = "a, b, c".split(", "); + assert(sa.length == 3 && sa[0] == "a" && sa[1] == "b" && sa[2] == "c"); + sa = "a,b,,c".split(","); + assert(sa.length == 4 && sa[0] == "a" && sa[1] == "b" && sa[2] == "" && sa[3] == "c"); + sa = ",a,b,c".split(","); + assert(sa.length == 4 && sa[0] == "" && sa[1] == "a" && sa[2] == "b" && sa[3] == "c"); + sa = "a,b,c,".split(","); + assert(sa.length == 4 && sa[0] == "a" && sa[1] == "b" && sa[2] == "c" && sa[3] == ""); + sa = "abc".split(""); + assert(sa.length == 3 && sa[0] == "a" && sa[1] == "b" && sa[2] == "c"); + sa = "abc".split("", 0); + assert(sa.length == 0); + sa = "abc".split("", 1); + assert(sa.length == 1 && sa[0] == "a"); + sa = "a,b,c".split(",", 1); + assert(sa.length == 1 && sa[0] == "a"); + sa = "abc".split("", 4); + assert(sa.length == 3 && sa[0] == "a" && sa[1] == "b" && sa[2] == "c"); + sa = "abc".split("", -1); + assert(sa.length == 3 && sa[0] == "a" && sa[1] == "b" && sa[2] == "c"); + sa = "a,b,c".split(",", -1); + assert(sa.length == 3 && sa[0] == "a" && sa[1] == "b" && sa[2] == "c"); + */ +} assert(itoa32(0) == "0"); assert(itoa32(1) == "1"); @@ -302,3 +302,11 @@ assert(dtoa(0.000035689) == "0.000035689"); // assert(dtoa(f32.MAX_VALUE) == "3.4028234663852886e+38"); // FIXME // assert(dtoa(f32.EPSILON) == "1.1920928955078125e-7"); // FIXME + +export function getString(): string { + return str; +} + +// Unleak globals + +__release(changetype(str)); diff --git a/tests/compiler/std/string.untouched.wat b/tests/compiler/std/string.untouched.wat index be9c7aed6d..c07bcf3e68 100644 --- a/tests/compiler/std/string.untouched.wat +++ b/tests/compiler/std/string.untouched.wat @@ -1,237 +1,231 @@ (module - (type $FUNCSIG$v (func)) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) - (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) - (type $FUNCSIG$iiiiii (func (param i32 i32 i32 i32 i32) (result i32))) + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$v (func)) (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$viii (func (param i32 i32 i32))) - (type $FUNCSIG$viiiii (func (param i32 i32 i32 i32 i32))) + (type $FUNCSIG$iiiiii (func (param i32 i32 i32 i32 i32) (result i32))) (type $FUNCSIG$dii (func (param i32 i32) (result f64))) (type $FUNCSIG$di (func (param i32) (result f64))) - (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$iiiii (func (param i32 i32 i32 i32) (result i32))) (type $FUNCSIG$ij (func (param i64) (result i32))) (type $FUNCSIG$viji (func (param i32 i64 i32))) (type $FUNCSIG$id (func (param f64) (result i32))) (type $FUNCSIG$iid (func (param i32 f64) (result i32))) + (type $FUNCSIG$jii (func (param i32 i32) (result i64))) (type $FUNCSIG$iijijiji (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) (type $FUNCSIG$i (func (result i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "onincrement" (func $~lib/rt/rtrace/onincrement (param i32))) + (import "rtrace" "ondecrement" (func $~lib/rt/rtrace/ondecrement (param i32))) + (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) + (import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32))) (memory $0 1) - (data (i32.const 8) "\10\00\00\00h\00i\00,\00 \00I\00\'\00m\00 \00a\00 \00s\00t\00r\00i\00n\00g\00") - (data (i32.const 48) "\0d\00\00\00s\00t\00d\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s\00") - (data (i32.const 80) "\0e\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s\00") - (data (i32.const 112) "\00\00\00\00") - (data (i32.const 120) "\01\00\00\00\00\00") - (data (i32.const 128) "\01\00\00\00a\00") - (data (i32.const 136) "\17\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s\00") - (data (i32.const 192) "\01\00\00\006\00") - (data (i32.const 200) "\02\00\00\004\d8\06\df") - (data (i32.const 208) "\02\00\00\00h\00i\00") - (data (i32.const 216) "\04\00\00\00n\00u\00l\00l\00") - (data (i32.const 232) "\06\00\00\00s\00t\00r\00i\00n\00g\00") - (data (i32.const 248) "\03\00\00\00I\00\'\00m\00") - (data (i32.const 264) "\01\00\00\00 \00") - (data (i32.const 272) "\03\00\00\00 \00 \00 \00") - (data (i32.const 288) "\03\00\00\00a\00b\00c\00") - (data (i32.const 304) "\05\00\00\00 \00 \00a\00b\00c\00") - (data (i32.const 320) "\03\00\00\001\002\003\00") - (data (i32.const 336) "\06\00\00\001\002\003\00a\00b\00c\00") - (data (i32.const 352) "\08\00\00\001\002\003\001\002\00a\00b\00c\00") - (data (i32.const 376) "\05\00\00\00a\00b\00c\00 \00 \00") - (data (i32.const 392) "\06\00\00\00a\00b\00c\00a\00b\00c\00") - (data (i32.const 408) "\08\00\00\00a\00b\00c\00a\00b\00c\00a\00b\00") - (data (i32.const 432) "\01\00\00\00,\00") - (data (i32.const 440) "\01\00\00\00x\00") - (data (i32.const 448) "\03\00\00\00,\00 \00I\00") - (data (i32.const 464) "\01\00\00\00g\00") - (data (i32.const 472) "\01\00\00\00i\00") - (data (i32.const 480) "\01\00\00\000\00") - (data (i32.const 488) "\01\00\00\001\00") - (data (i32.const 496) "\05\00\00\000\00b\001\000\001\00") - (data (i32.const 512) "\05\00\00\000\00o\007\000\007\00") - (data (i32.const 528) "\05\00\00\000\00x\00f\000\00f\00") - (data (i32.const 544) "\05\00\00\000\00x\00F\000\00F\00") - (data (i32.const 560) "\03\00\00\000\001\001\00") - (data (i32.const 576) "\04\00\00\000\00x\001\00g\00") - (data (i32.const 592) "\03\00\00\000\00.\001\00") - (data (i32.const 608) "\03\00\00\00.\002\005\00") - (data (i32.const 624) "\08\00\00\00.\001\00f\00o\00o\00b\00a\00r\00") - (data (i32.const 648) "\01\00\00\00b\00") - (data (i32.const 656) "\02\00\00\00a\00b\00") - (data (i32.const 664) "\04\00\00\00k\00e\00y\001\00") - (data (i32.const 680) "\04\00\00\00k\00e\00y\002\00") - (data (i32.const 696) "\03\00\00\00k\00e\001\00") - (data (i32.const 712) "\03\00\00\00k\00e\002\00") - (data (i32.const 728) "\05\00\00\00k\00e\00y\001\002\00") - (data (i32.const 744) "\05\00\00\00k\00e\00y\001\001\00") - (data (i32.const 760) "\07\00\00\00\a40\ed0\cf0\cb0\db0\d80\c80") - (data (i32.const 784) "\07\00\00\00\a60\f00\ce0\aa0\af0\e40\de0") - (data (i32.const 808) "\0b\00\00\00D\00\19 f\00h\00u\00a\00s\00c\00a\00i\00l\00") - (data (i32.const 840) "\n\00\00\00D\00\19 \1f\1eu\00a\00s\00c\00a\00i\00l\00") - (data (i32.const 864) "\02\00\00\00b\00a\00") - (data (i32.const 872) "\02\00\00\00a\00a\00") - (data (i32.const 880) "\03\00\00\00a\00a\00a\00") - (data (i32.const 896) "\08\00\00\00a\00b\00a\00b\00a\00b\00a\00b\00") - (data (i32.const 920) "\05\00\00\00a\00a\00a\00a\00a\00") - (data (i32.const 936) "\06\00\00\00a\00a\00a\00a\00a\00a\00") - (data (i32.const 952) "\07\00\00\00a\00a\00a\00a\00a\00a\00a\00") - (data (i32.const 976) "\0e\00\00\00a\00b\00c\00d\00e\00f\00g\00h\00i\00j\00k\00l\00m\00n\00") - (data (i32.const 1008) "\01\00\00\00n\00") - (data (i32.const 1016) "\05\00\00\00j\00k\00l\00m\00n\00") - (data (i32.const 1032) "\05\00\00\00c\00d\00e\00f\00g\00") - (data (i32.const 1048) "\05\00\00\00d\00e\00f\00g\00h\00") - (data (i32.const 1064) "\0d\00\00\00a\00b\00c\00d\00e\00f\00g\00h\00i\00j\00k\00l\00m\00") - (data (i32.const 1096) "\0d\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") - (data (i32.const 1128) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") - (data (i32.const 1192) "\05\00\00\00a\00,\00b\00,\00c\00") - (data (i32.const 1208) "\01\00\00\00.\00") - (data (i32.const 1216) "\01\00\00\00c\00") - (data (i32.const 1224) "\07\00\00\00a\00,\00 \00b\00,\00 \00c\00") - (data (i32.const 1248) "\02\00\00\00,\00 \00") - (data (i32.const 1256) "\06\00\00\00a\00,\00b\00,\00,\00c\00") - (data (i32.const 1272) "\06\00\00\00,\00a\00,\00b\00,\00c\00") - (data (i32.const 1288) "\06\00\00\00a\00,\00b\00,\00c\00,\00") - (data (i32.const 1304) "\90\01\00\00\00\00\00\000\000\000\001\000\002\000\003\000\004\000\005\000\006\000\007\000\008\000\009\001\000\001\001\001\002\001\003\001\004\001\005\001\006\001\007\001\008\001\009\002\000\002\001\002\002\002\003\002\004\002\005\002\006\002\007\002\008\002\009\003\000\003\001\003\002\003\003\003\004\003\005\003\006\003\007\003\008\003\009\004\000\004\001\004\002\004\003\004\004\004\005\004\006\004\007\004\008\004\009\005\000\005\001\005\002\005\003\005\004\005\005\005\006\005\007\005\008\005\009\006\000\006\001\006\002\006\003\006\004\006\005\006\006\006\007\006\008\006\009\007\000\007\001\007\002\007\003\007\004\007\005\007\006\007\007\007\008\007\009\008\000\008\001\008\002\008\003\008\004\008\005\008\006\008\007\008\008\008\009\009\000\009\001\009\002\009\003\009\004\009\005\009\006\009\007\009\008\009\009\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 1816) "\18\05\00\00d\00\00\00") - (data (i32.const 1824) "\01\00\00\008\00") - (data (i32.const 1832) "\05\00\00\00-\001\000\000\000\00") - (data (i32.const 1848) "\04\00\00\001\002\003\004\00") - (data (i32.const 1864) "\05\00\00\001\002\003\004\005\00") - (data (i32.const 1880) "\06\00\00\001\002\003\004\005\006\00") - (data (i32.const 1896) "\07\00\00\001\001\001\001\001\001\001\00") - (data (i32.const 1920) "\07\00\00\001\002\003\004\005\006\007\00") - (data (i32.const 1944) "\n\00\00\002\001\004\007\004\008\003\006\004\006\00") - (data (i32.const 1968) "\n\00\00\002\001\004\007\004\008\003\006\004\007\00") - (data (i32.const 1992) "\0b\00\00\00-\002\001\004\007\004\008\003\006\004\008\00") - (data (i32.const 2024) "\02\00\00\00-\001\00") - (data (i32.const 2032) "\04\00\00\001\000\000\000\00") - (data (i32.const 2048) "\n\00\00\002\001\004\007\004\008\003\006\004\008\00") - (data (i32.const 2072) "\n\00\00\004\002\009\004\009\006\007\002\009\005\00") - (data (i32.const 2096) "\08\00\00\009\009\009\009\009\009\009\009\00") - (data (i32.const 2120) "\t\00\00\001\000\000\000\000\000\000\000\000\00") - (data (i32.const 2144) "\0b\00\00\006\008\007\001\009\004\007\006\007\003\005\00") - (data (i32.const 2176) "\0c\00\00\008\006\008\007\001\009\004\007\006\007\003\005\00") - (data (i32.const 2208) "\0f\00\00\009\009\009\008\006\008\007\001\009\004\007\006\007\003\005\00") - (data (i32.const 2248) "\10\00\00\009\009\009\009\008\006\008\007\001\009\004\007\006\007\003\005\00") - (data (i32.const 2288) "\11\00\00\001\009\009\009\009\008\006\008\007\001\009\004\007\006\007\003\005\00") - (data (i32.const 2328) "\14\00\00\001\008\004\004\006\007\004\004\000\007\003\007\000\009\005\005\001\006\001\005\00") - (data (i32.const 2376) "\05\00\00\00-\001\002\003\004\00") - (data (i32.const 2392) "\0b\00\00\00-\004\002\009\004\009\006\007\002\009\005\00") - (data (i32.const 2424) "\0c\00\00\00-\006\008\007\001\009\004\007\006\007\003\005\00") - (data (i32.const 2456) "\0d\00\00\00-\008\006\008\007\001\009\004\007\006\007\003\005\00") - (data (i32.const 2488) "\10\00\00\00-\009\009\009\008\006\008\007\001\009\004\007\006\007\003\005\00") - (data (i32.const 2528) "\12\00\00\00-\001\009\009\009\009\008\006\008\007\001\009\004\007\006\007\003\005\00") - (data (i32.const 2568) "\13\00\00\009\002\002\003\003\007\002\000\003\006\008\005\004\007\007\005\008\000\007\00") - (data (i32.const 2616) "\14\00\00\00-\009\002\002\003\003\007\002\000\003\006\008\005\004\007\007\005\008\000\008\00") - (data (i32.const 2664) "\03\00\00\000\00.\000\00") - (data (i32.const 2680) "\03\00\00\00N\00a\00N\00") - (data (i32.const 2696) "\t\00\00\00-\00I\00n\00f\00i\00n\00i\00t\00y\00") - (data (i32.const 2720) "\08\00\00\00I\00n\00f\00i\00n\00i\00t\00y\00") - (data (i32.const 2744) "\b8\02\00\00\00\00\00\00\88\02\1c\08\a0\d5\8f\fav\bf>\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\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\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8 (; 24 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 f64) - (local $6 i32) - (local $7 f64) - local.get $0 - i32.load - local.set $2 - local.get $2 - i32.eqz - if - f64.const nan:0x8000000000000 - return - end - local.get $0 - local.set $3 - local.get $3 - i32.load16_u offset=4 - local.set $4 - local.get $4 - i32.const 45 - i32.eq - if - local.get $2 - i32.const 1 - i32.sub - local.tee $2 - i32.eqz - if - f64.const nan:0x8000000000000 - return + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 end - local.get $3 - i32.const 2 - i32.add - local.tee $3 - i32.load16_u offset=4 - local.set $4 - f64.const -1 - local.set $5 - else - local.get $4 - i32.const 43 - i32.eq - if - local.get $2 + block (result i32) + local.get $1 + local.tee $5 i32.const 1 - i32.sub - local.tee $2 - i32.eqz - if - f64.const nan:0x8000000000000 - return - end - local.get $3 - i32.const 2 i32.add - local.tee $3 - i32.load16_u offset=4 - local.set $4 - f64.const 1 - local.set $5 - else - f64.const 1 - local.set $5 + local.set $1 + local.get $5 end - end - local.get $1 - i32.eqz - if - local.get $4 - i32.const 48 - i32.eq - local.tee $6 - if (result i32) - local.get $2 - i32.const 2 - i32.gt_s - else - local.get $6 + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 end - if - block $break|0 - block $case6|0 - block $case5|0 - block $case4|0 - block $case3|0 - block $case2|0 - block $case1|0 - block $case0|0 - local.get $3 - i32.const 2 - i32.add - i32.load16_u offset=4 - local.set $6 - local.get $6 - i32.const 66 - i32.eq - br_if $case0|0 - local.get $6 - i32.const 98 - i32.eq - br_if $case1|0 - local.get $6 - i32.const 79 - i32.eq - br_if $case2|0 - local.get $6 - i32.const 111 - i32.eq - br_if $case3|0 - local.get $6 - i32.const 88 - i32.eq - br_if $case4|0 - local.get $6 - i32.const 120 - i32.eq - br_if $case5|0 - br $case6|0 - end - end - block - local.get $3 - i32.const 4 - i32.add - local.set $3 - local.get $2 - i32.const 2 - i32.sub - local.set $2 - i32.const 2 - local.set $1 - br $break|0 - unreachable - end - unreachable - end - end - block - local.get $3 - i32.const 4 - i32.add - local.set $3 - local.get $2 - i32.const 2 - i32.sub - local.set $2 - i32.const 8 - local.set $1 - br $break|0 - unreachable - end - unreachable - end - end - block - local.get $3 - i32.const 4 - i32.add - local.set $3 - local.get $2 - i32.const 2 - i32.sub - local.set $2 - i32.const 16 - local.set $1 - br $break|0 - unreachable - end - unreachable - end - i32.const 10 - local.set $1 - end - else - i32.const 10 + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add local.set $1 + local.get $5 end - else - local.get $1 - i32.const 2 - i32.lt_s - local.tee $6 - if (result i32) - local.get $6 - else - local.get $1 - i32.const 36 - i32.gt_s + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 end - if - f64.const nan:0x8000000000000 - return + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 end - end - f64.const 0 - local.set $7 - block $break|1 - loop $continue|1 - block (result i32) - local.get $2 - local.tee $6 - i32.const 1 - i32.sub - local.set $2 - local.get $6 - end - if - block - local.get $3 - i32.load16_u offset=4 - local.set $4 - local.get $4 - i32.const 48 - i32.ge_s - local.tee $6 - if (result i32) - local.get $4 - i32.const 57 - i32.le_s - else - local.get $6 - end - if - local.get $4 - i32.const 48 - i32.sub - local.set $4 - else - local.get $4 - i32.const 65 - i32.ge_s - local.tee $6 - if (result i32) - local.get $4 - i32.const 90 - i32.le_s - else - local.get $6 - end - if - local.get $4 - i32.const 65 - i32.const 10 - i32.sub - i32.sub - local.set $4 - else - local.get $4 - i32.const 97 - i32.ge_s - local.tee $6 - if (result i32) - local.get $4 - i32.const 122 - i32.le_s - else - local.get $6 - end - if - local.get $4 - i32.const 97 - i32.const 10 - i32.sub - i32.sub - local.set $4 - else - br $break|1 - end - end - end - local.get $4 - local.get $1 - i32.ge_s - if - br $break|1 - end - local.get $7 - local.get $1 - f64.convert_i32_s - f64.mul - local.get $4 - f64.convert_i32_s - f64.add - local.set $7 - local.get $3 - i32.const 2 - i32.add - local.set $3 - end - br $continue|1 - end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 end - end - local.get $5 - local.get $7 - f64.mul - ) - (func $~lib/string/parseInt (; 25 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) - local.get $0 - local.get $1 - call $~lib/internal/string/parse - ) - (func $~lib/string/parseFloat (; 26 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 f64) - (local $5 f64) - (local $6 i32) - (local $7 f64) - local.get $0 - i32.load - local.set $1 - local.get $1 - i32.eqz - if - f64.const nan:0x8000000000000 - return - end - local.get $0 - local.set $2 - local.get $2 - i32.load16_u offset=4 - local.set $3 - local.get $3 - i32.const 45 - i32.eq - if - local.get $1 - i32.const 1 - i32.sub - local.tee $1 - i32.eqz - if - f64.const nan:0x8000000000000 - return + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 end - local.get $2 - i32.const 2 - i32.add - local.tee $2 - i32.load16_u offset=4 - local.set $3 - f64.const -1 - local.set $4 - else - local.get $3 - i32.const 43 - i32.eq - if + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) local.get $1 + local.tee $5 i32.const 1 - i32.sub - local.tee $1 - i32.eqz - if - f64.const nan:0x8000000000000 - return - end - local.get $2 - i32.const 2 i32.add - local.tee $2 - i32.load16_u offset=4 - local.set $3 - f64.const 1 - local.set $4 - else - f64.const 1 - local.set $4 + local.set $1 + local.get $5 end - end - f64.const 0 - local.set $5 - block $break|0 - loop $continue|0 - block (result i32) - local.get $1 - local.tee $6 - i32.const 1 - i32.sub - local.set $1 - local.get $6 - end - if - block - local.get $2 - i32.load16_u offset=4 - local.set $3 - local.get $3 - i32.const 46 - i32.eq - if - local.get $2 - i32.const 2 - i32.add - local.set $2 - f64.const 0.1 - local.set $7 - block $break|1 - loop $continue|1 - block (result i32) - local.get $1 - local.tee $6 - i32.const 1 - i32.sub - local.set $1 - local.get $6 - end - if - block - local.get $2 - i32.load16_u offset=4 - local.set $3 - local.get $3 - i32.const 69 - i32.eq - local.tee $6 - if (result i32) - local.get $6 - else - local.get $3 - i32.const 101 - i32.eq - end - if - i32.const 0 - i32.eqz - if - i32.const 0 - i32.const 80 - i32.const 630 - i32.const 10 - call $~lib/env/abort - unreachable - end - end - local.get $3 - i32.const 48 - i32.sub - local.set $3 - local.get $3 - i32.const 9 - i32.gt_u - if - br $break|1 - end - local.get $5 - local.get $3 - f64.convert_i32_s - local.get $7 - f64.mul - f64.add - local.set $5 - local.get $7 - f64.const 0.1 - f64.mul - local.set $7 - local.get $2 - i32.const 2 - i32.add - local.set $2 - end - br $continue|1 - end - end - end - br $break|0 - end - local.get $3 - i32.const 48 - i32.sub - local.set $3 - local.get $3 - i32.const 10 - i32.ge_u - if - br $break|0 - end - local.get $5 - f64.const 10 - f64.mul - local.get $3 - f64.convert_i32_s - f64.add - local.set $5 - local.get $2 - i32.const 2 - i32.add - local.set $2 - end - br $continue|0 - end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 end + i32.load8_u + i32.store8 end - local.get $4 - local.get $5 - f64.mul - ) - (func $~lib/string/String#concat (; 27 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.const 0 - i32.ne - i32.eqz + local.get $2 + i32.const 8 + i32.and if - i32.const 0 - i32.const 80 - i32.const 110 - i32.const 4 - call $~lib/env/abort - unreachable + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 end - local.get $1 - i32.const 0 - i32.eq + local.get $2 + i32.const 4 + i32.and if - i32.const 216 - local.set $1 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 end - local.get $0 - i32.load - local.set $2 - local.get $1 - i32.load - local.set $3 local.get $2 - local.get $3 - i32.add - local.set $4 - local.get $4 - i32.const 0 - i32.eq + i32.const 2 + i32.and if - i32.const 112 - return + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 end - local.get $4 - call $~lib/internal/string/allocateUnsafe - local.set $5 - local.get $5 - i32.const 0 - local.get $0 - i32.const 0 local.get $2 - call $~lib/internal/string/copyUnsafe - local.get $5 - local.get $2 - local.get $1 - i32.const 0 - local.get $3 - call $~lib/internal/string/copyUnsafe - local.get $5 - ) - (func $~lib/string/String.__concat (; 28 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 - i32.eqz + i32.const 1 + i32.and if - i32.const 216 - local.set $0 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 end - local.get $0 - local.get $1 - call $~lib/string/String#concat - ) - (func $~lib/string/String.__ne (; 29 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 - local.get $1 - call $~lib/string/String.__eq - i32.eqz ) - (func $~lib/string/String.__gt (; 30 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) + (func $~lib/memory/memory.copy (; 22 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - local.get $0 - local.get $1 - i32.eq - local.tee $2 - if (result i32) - local.get $2 - else + block $~lib/util/memory/memmove|inlined.0 local.get $0 - i32.const 0 - i32.eq - end - local.tee $2 - if (result i32) - local.get $2 - else + local.set $5 local.get $1 - i32.const 0 - i32.eq - end - if - i32.const 0 - return - end - local.get $0 - i32.load - local.set $3 - local.get $1 - i32.load - local.set $4 - local.get $3 - i32.eqz - if - i32.const 0 - return - end - local.get $4 - i32.eqz - if - i32.const 1 - return - end - local.get $3 - local.tee $2 - local.get $4 - local.tee $5 - local.get $2 - local.get $5 - i32.lt_s - select - local.set $6 - local.get $0 - i32.const 0 - local.get $1 - i32.const 0 - local.get $6 - call $~lib/internal/string/compareUnsafe - i32.const 0 - i32.gt_s - ) - (func $~lib/string/String.__lt (; 31 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $0 - local.get $1 - i32.eq - local.tee $2 - if (result i32) - local.get $2 - else - local.get $0 - i32.const 0 - i32.eq - end - local.tee $2 - if (result i32) + local.set $4 local.get $2 - else - local.get $1 - i32.const 0 + local.set $3 + local.get $5 + local.get $4 i32.eq - end - if - i32.const 0 - return - end - local.get $0 - i32.load - local.set $3 - local.get $1 - i32.load - local.set $4 - local.get $4 - i32.eqz - if - i32.const 0 - return - end - local.get $3 - i32.eqz - if - i32.const 1 - return - end - local.get $3 - local.tee $2 - local.get $4 - local.tee $5 - local.get $2 - local.get $5 - i32.lt_s - select - local.set $6 - local.get $0 - i32.const 0 - local.get $1 - i32.const 0 - local.get $6 - call $~lib/internal/string/compareUnsafe - i32.const 0 - i32.lt_s - ) - (func $~lib/string/String.__gte (; 32 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 - local.get $1 - call $~lib/string/String.__lt - i32.eqz - ) - (func $~lib/string/String.__lte (; 33 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 - local.get $1 - call $~lib/string/String.__gt - i32.eqz - ) - (func $~lib/string/String#repeat (; 34 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - local.get $0 - i32.const 0 - i32.ne - i32.eqz - if - i32.const 0 - i32.const 80 - i32.const 385 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - i32.load - local.set $2 - local.get $1 - i32.const 0 - i32.lt_s - local.tee $3 - if (result i32) + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $4 local.get $3 - else - local.get $2 - local.get $1 - i32.mul - i32.const 1 - i32.const 28 - i32.shl - i32.gt_s - end - if - i32.const 0 - i32.const 80 - i32.const 390 - i32.const 6 - call $~lib/env/abort - unreachable - end - local.get $1 + i32.add + local.get $5 + i32.le_u + if (result i32) + i32.const 1 + else + local.get $5 + local.get $3 + i32.add + local.get $4 + i32.le_u + end + if + local.get $5 + local.get $4 + local.get $3 + call $~lib/util/memory/memcpy + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/rt/tlsf/__free (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 184 + i32.const 561 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 i32.const 0 - i32.eq - local.tee $3 + i32.ne if (result i32) - local.get $3 - else - local.get $2 + local.get $0 + i32.const 15 + i32.and i32.eqz + else + i32.const 0 end + i32.eqz if - i32.const 112 - return - end - local.get $1 - i32.const 1 - i32.eq - if - local.get $0 - return + i32.const 0 + i32.const 184 + i32.const 562 + i32.const 2 + call $~lib/builtins/abort + unreachable end - local.get $2 + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/growRoots (; 24 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/pure/ROOTS + local.set $0 + global.get $~lib/rt/pure/CUR + local.get $0 + i32.sub + local.set $1 local.get $1 + i32.const 2 i32.mul - call $~lib/internal/string/allocateUnsafe + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select local.set $4 local.get $4 i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onfree + local.get $5 local.get $0 local.get $1 - call $~lib/internal/string/repeatUnsafe - local.get $4 - ) - (func $~lib/string/String#slice (; 35 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) + call $~lib/memory/memory.copy local.get $0 - i32.load - local.set $3 + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onalloc + local.get $0 + call $~lib/rt/tlsf/__free + end + local.get $5 + global.set $~lib/rt/pure/ROOTS + local.get $5 local.get $1 - i32.const 0 - i32.lt_s - if (result i32) - local.get $1 - local.get $3 - i32.add - local.tee $4 + i32.add + global.set $~lib/rt/pure/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/pure/END + ) + (func $~lib/rt/pure/appendRoot (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/pure/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 4 + i32.add + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/decrement (; 26 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + call $~lib/rt/rtrace/ondecrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if i32.const 0 - local.tee $5 - local.get $4 - local.get $5 - i32.gt_s - select - else - local.get $1 - local.tee $4 - local.get $3 - local.tee $5 - local.get $4 - local.get $5 - i32.lt_s - select + i32.const 136 + i32.const 115 + i32.const 13 + call $~lib/builtins/abort + unreachable end - local.set $6 local.get $2 - i32.const 0 - i32.lt_s - if (result i32) - local.get $2 - local.get $3 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 i32.add - local.tee $4 - i32.const 0 - local.tee $5 - local.get $4 - local.get $5 - i32.gt_s - select + i32.const 1 + call $~lib/rt/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end else local.get $2 - local.tee $4 - local.get $3 - local.tee $5 - local.get $4 - local.get $5 - i32.lt_s - select + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 136 + i32.const 124 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 16 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end end - local.set $7 - local.get $7 - local.get $6 - i32.sub - local.set $3 - local.get $3 - i32.const 0 - i32.le_s + ) + (func $~lib/rt/pure/__release (; 27 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u if - i32.const 112 - return + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement end - local.get $3 - call $~lib/internal/string/allocateUnsafe - local.set $8 - local.get $8 + ) + (func $~lib/string/String.__not (; 28 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $0 i32.const 0 + i32.eq + if (result i32) + i32.const 1 + else + local.get $0 + call $~lib/string/String#get:length + i32.eqz + end + local.set $1 local.get $0 - local.get $6 - local.get $3 - call $~lib/internal/string/copyUnsafe - local.get $8 + call $~lib/rt/pure/__release + local.get $1 + ) + (func $~lib/string/String.fromCharCode (; 29 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + i32.const -1 + i32.xor + if + i32.const 4 + i32.const 1 + call $~lib/rt/tlsf/__alloc + local.set $2 + local.get $2 + local.get $0 + i32.store16 + local.get $2 + local.get $1 + i32.store16 offset=2 + else + i32.const 2 + i32.const 1 + call $~lib/rt/tlsf/__alloc + local.set $2 + local.get $2 + local.get $0 + i32.store16 + end + local.get $2 + call $~lib/rt/pure/__retain ) - (func $~lib/string/String#slice|trampoline (; 36 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/string/String.fromCharCode|trampoline (; 30 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) block $1of1 block $0of1 block $outOfRange @@ -3759,531 +3407,631 @@ end unreachable end - global.get $~lib/builtins/i32.MAX_VALUE - local.set $2 + i32.const -1 + local.set $1 end local.get $0 local.get $1 - local.get $2 - call $~lib/string/String#slice + call $~lib/string/String.fromCharCode ) - (func $~lib/internal/arraybuffer/computeSize (; 37 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 1 - i32.const 32 + (func $~lib/util/string/compareImpl (; 31 ;) (type $FUNCSIG$iiiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) local.get $0 - i32.const 8 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__retain + drop + i32.const 0 + local.set $5 + local.get $0 + local.get $1 + i32.const 1 + i32.shl i32.add + local.set $6 + local.get $2 + local.get $3 i32.const 1 - i32.sub - i32.clz - i32.sub i32.shl + i32.add + local.set $7 + block $break|0 + loop $continue|0 + local.get $4 + if (result i32) + local.get $6 + i32.load16_u + local.get $7 + i32.load16_u + i32.sub + local.tee $5 + i32.eqz + else + i32.const 0 + end + if + local.get $4 + i32.const 1 + i32.sub + local.set $4 + local.get $6 + i32.const 2 + i32.add + local.set $6 + local.get $7 + i32.const 2 + i32.add + local.set $7 + br $continue|0 + end + end + end + local.get $5 + local.set $8 + local.get $0 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $8 ) - (func $~lib/internal/arraybuffer/allocateUnsafe (; 38 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/string/String.__eq (; 32 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + (local $3 i32) local.get $0 - i32.const 1073741816 - i32.le_u - i32.eqz - if - i32.const 0 - i32.const 1128 - i32.const 26 - i32.const 2 - call $~lib/env/abort - unreachable - end - block $~lib/memory/memory.allocate|inlined.1 (result i32) - local.get $0 - call $~lib/internal/arraybuffer/computeSize - local.set $2 - local.get $2 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.1 - end - local.set $1 + call $~lib/rt/pure/__retain + drop local.get $1 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.store local.get $1 - ) - (func $~lib/memory/memory.allocate (; 39 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.eq + if + i32.const 1 + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + return + end local.get $0 - call $~lib/allocator/arena/__memory_allocate - return - ) - (func $~lib/internal/memory/memset (; 40 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i64) - local.get $2 - i32.eqz + i32.const 0 + i32.eq + if (result i32) + i32.const 1 + else + local.get $1 + i32.const 0 + i32.eq + end + if + i32.const 0 + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + return + end + local.get $0 + call $~lib/string/String#get:length + local.set $3 + local.get $3 + local.get $1 + call $~lib/string/String#get:length + i32.ne if + i32.const 0 + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 return end local.get $0 + i32.const 0 local.get $1 - i32.store8 + i32.const 0 + local.get $3 + call $~lib/util/string/compareImpl + i32.eqz + local.set $2 local.get $0 - local.get $2 - i32.add - i32.const 1 - i32.sub + call $~lib/rt/pure/__release local.get $1 - i32.store8 + call $~lib/rt/pure/__release local.get $2 - i32.const 2 + ) + (func $~lib/string/String.fromCodePoint (; 33 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.const 1114111 i32.le_u + i32.eqz if - return + i32.const 0 + i32.const 456 + i32.const 27 + i32.const 4 + call $~lib/builtins/abort + unreachable end local.get $0 + i32.const 65535 + i32.gt_s + local.set $1 + local.get $1 i32.const 1 i32.add + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + local.set $2 local.get $1 - i32.store8 - local.get $0 - i32.const 2 - i32.add + i32.eqz + if + local.get $2 + local.get $0 + i32.store16 + else + local.get $0 + i32.const 65536 + i32.sub + local.set $0 + local.get $0 + i32.const 10 + i32.shr_u + i32.const 55296 + i32.add + local.set $3 + local.get $0 + i32.const 1023 + i32.and + i32.const 56320 + i32.add + local.set $4 + local.get $2 + local.get $3 + i32.const 16 + i32.shl + local.get $4 + i32.or + i32.store + end + local.get $2 + call $~lib/rt/pure/__retain + ) + (func $~lib/string/String#startsWith (; 34 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) local.get $1 - i32.store8 + call $~lib/rt/pure/__retain + drop local.get $0 - local.get $2 - i32.add - i32.const 2 - i32.sub + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 456 + i32.const 172 + i32.const 4 + call $~lib/builtins/abort + unreachable + end local.get $1 - i32.store8 + i32.const 0 + i32.eq + if + block (result i32) + i32.const 552 + local.tee $3 + local.get $1 + local.tee $4 + i32.ne + if + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $4 + call $~lib/rt/pure/__release + end + local.get $3 + end + local.set $1 + end local.get $0 + call $~lib/string/String#get:length + local.set $5 local.get $2 - i32.add - i32.const 3 - i32.sub + local.tee $3 + i32.const 0 + local.tee $4 + local.get $3 + local.get $4 + i32.gt_s + select + local.tee $3 + local.get $5 + local.tee $4 + local.get $3 + local.get $4 + i32.lt_s + select + local.set $6 local.get $1 - i32.store8 - local.get $2 - i32.const 6 - i32.le_u + call $~lib/string/String#get:length + local.set $7 + local.get $7 + local.get $6 + i32.add + local.get $5 + i32.gt_s if + i32.const 0 + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $3 return end local.get $0 - i32.const 3 - i32.add + local.get $6 + local.get $1 + i32.const 0 + local.get $7 + call $~lib/util/string/compareImpl + i32.eqz + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $~lib/string/String#endsWith (; 35 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) local.get $1 - i32.store8 + call $~lib/rt/pure/__retain + drop local.get $0 - local.get $2 - i32.add - i32.const 4 - i32.sub + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 456 + i32.const 84 + i32.const 4 + call $~lib/builtins/abort + unreachable + end local.get $1 - i32.store8 - local.get $2 - i32.const 8 - i32.le_u + i32.const 0 + i32.eq if + i32.const 0 + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $3 return end + local.get $2 + local.tee $3 i32.const 0 - local.get $0 - i32.sub - i32.const 3 - i32.and - local.set $3 - local.get $0 + local.tee $4 local.get $3 - i32.add - local.set $0 - local.get $2 + local.get $4 + i32.gt_s + select + local.tee $3 + local.get $0 + call $~lib/string/String#get:length + local.tee $4 local.get $3 - i32.sub - local.set $2 - local.get $2 - i32.const -4 - i32.and + local.get $4 + i32.lt_s + select local.set $2 - i32.const -1 - i32.const 255 - i32.div_u local.get $1 - i32.const 255 - i32.and - i32.mul - local.set $4 - local.get $0 - local.get $4 - i32.store - local.get $0 + call $~lib/string/String#get:length + local.set $5 local.get $2 - i32.add - i32.const 4 + local.get $5 i32.sub - local.get $4 - i32.store - local.get $2 - i32.const 8 - i32.le_u - if - return + local.set $6 + local.get $6 + i32.const 0 + i32.lt_s + if + i32.const 0 + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + return end local.get $0 - i32.const 4 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 12 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 8 - i32.sub - local.get $4 - i32.store - local.get $2 - i32.const 24 - i32.le_u + local.get $6 + local.get $1 + i32.const 0 + local.get $5 + call $~lib/util/string/compareImpl + i32.eqz + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $~lib/string/String#indexOf (; 36 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/string/String#get:length + local.set $3 + local.get $3 + i32.eqz if + i32.const 0 + local.set $4 + local.get $1 + call $~lib/rt/pure/__release + local.get $4 return end local.get $0 - i32.const 12 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 16 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 20 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 24 - i32.add - local.get $4 - i32.store - local.get $0 + call $~lib/string/String#get:length + local.set $5 + local.get $5 + i32.eqz + if + i32.const -1 + local.set $4 + local.get $1 + call $~lib/rt/pure/__release + local.get $4 + return + end local.get $2 - i32.add - i32.const 28 - i32.sub + local.tee $4 + i32.const 0 + local.tee $6 local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 24 - i32.sub + local.get $6 + i32.gt_s + select + local.tee $4 + local.get $5 + local.tee $6 local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 20 - i32.sub + local.get $6 + i32.lt_s + select + local.set $7 + block $break|0 + local.get $5 + local.get $3 + i32.sub + local.set $5 + loop $repeat|0 + local.get $7 + local.get $5 + i32.le_s + i32.eqz + br_if $break|0 + local.get $0 + local.get $7 + local.get $1 + i32.const 0 + local.get $3 + call $~lib/util/string/compareImpl + i32.eqz + if + local.get $7 + local.set $4 + local.get $1 + call $~lib/rt/pure/__release + local.get $4 + return + end + local.get $7 + i32.const 1 + i32.add + local.set $7 + br $repeat|0 + unreachable + end + unreachable + end + i32.const -1 + local.set $4 + local.get $1 + call $~lib/rt/pure/__release local.get $4 - i32.store + ) + (func $~lib/string/String#includes (; 37 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop local.get $0 + local.get $1 local.get $2 - i32.add - i32.const 16 - i32.sub - local.get $4 - i32.store - i32.const 24 - local.get $0 - i32.const 4 - i32.and - i32.add + call $~lib/string/String#indexOf + i32.const -1 + i32.ne local.set $3 - local.get $0 + local.get $1 + call $~lib/rt/pure/__release local.get $3 - i32.add - local.set $0 + ) + (func $~lib/memory/memory.repeat (; 38 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (local $4 i32) + (local $5 i32) + i32.const 0 + local.set $4 local.get $2 local.get $3 - i32.sub - local.set $2 - local.get $4 - i64.extend_i32_u - local.get $4 - i64.extend_i32_u - i64.const 32 - i64.shl - i64.or + i32.mul local.set $5 block $break|0 loop $continue|0 - local.get $2 - i32.const 32 - i32.ge_u + local.get $4 + local.get $5 + i32.lt_u if - block - local.get $0 - local.get $5 - i64.store - local.get $0 - i32.const 8 - i32.add - local.get $5 - i64.store - local.get $0 - i32.const 16 - i32.add - local.get $5 - i64.store - local.get $0 - i32.const 24 - i32.add - local.get $5 - i64.store - local.get $2 - i32.const 32 - i32.sub - local.set $2 - local.get $0 - i32.const 32 - i32.add - local.set $0 - end + local.get $0 + local.get $4 + i32.add + local.get $1 + local.get $2 + call $~lib/memory/memory.copy + local.get $4 + local.get $2 + i32.add + local.set $4 br $continue|0 end end end ) - (func $~lib/array/Array<~lib/string/String>#constructor (; 41 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) + (func $~lib/string/String#padStart (; 39 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - local.get $1 - i32.const 268435454 - i32.gt_u + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.const 0 + i32.ne + i32.eqz if i32.const 0 - i32.const 1096 - i32.const 45 - i32.const 39 - call $~lib/env/abort + i32.const 456 + i32.const 288 + i32.const 4 + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.set $3 local.get $1 - i32.const 2 + i32.const 1 i32.shl - local.set $2 + local.set $4 local.get $2 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $3 - block (result i32) - local.get $0 - i32.eqz - if - i32.const 8 - call $~lib/memory/memory.allocate - local.set $0 - end - local.get $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - end + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.set $5 + local.get $4 local.get $3 - i32.store - local.get $0 - local.get $1 - i32.store offset=4 - block $~lib/memory/memory.fill|inlined.0 - local.get $3 - i32.const 8 - i32.add - local.set $4 - i32.const 0 - local.set $5 - local.get $2 - local.set $6 - local.get $4 + i32.lt_u + if (result i32) + i32.const 1 + else local.get $5 + i32.eqz + end + if + local.get $0 + call $~lib/rt/pure/__retain + local.set $6 + local.get $2 + call $~lib/rt/pure/__release local.get $6 - call $~lib/internal/memory/memset + return end - local.get $0 - ) - (func $~lib/array/Array<~lib/string/String>#__unchecked_set (; 42 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $0 - i32.load - local.set $3 - local.get $1 - local.set $4 - local.get $2 - local.set $5 - i32.const 0 - local.set $6 - local.get $3 local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $6 - i32.add - local.get $5 - i32.store offset=8 - ) - (func $~lib/array/Array<~lib/string/String>#__unchecked_get (; 43 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - local.get $0 - i32.load - local.set $2 - local.get $1 - local.set $3 - i32.const 0 - local.set $4 - local.get $2 local.get $3 - i32.const 2 - i32.shl - i32.add + i32.sub + local.set $7 local.get $4 - i32.add - i32.load offset=8 - ) - (func $~lib/allocator/arena/__memory_free (; 44 ;) (type $FUNCSIG$vi) (param $0 i32) - nop - ) - (func $~lib/internal/arraybuffer/reallocateUnsafe (; 45 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $0 - i32.load - local.set $2 - local.get $1 - local.get $2 - i32.gt_s + i32.const 1 + call $~lib/rt/tlsf/__alloc + local.set $8 + local.get $7 + local.get $5 + i32.gt_u if - local.get $1 - i32.const 1073741816 - i32.le_s - i32.eqz - if - i32.const 0 - i32.const 1128 - i32.const 40 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $1 - local.get $2 - call $~lib/internal/arraybuffer/computeSize - i32.const 8 + local.get $7 + i32.const 2 i32.sub - i32.le_s - if - local.get $0 - local.get $1 - i32.store - else - local.get $1 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $3 - block $~lib/memory/memory.copy|inlined.2 - local.get $3 - i32.const 8 - i32.add - local.set $4 - local.get $0 - i32.const 8 - i32.add - local.set $5 - local.get $2 - local.set $6 - local.get $4 - local.get $5 - local.get $6 - call $~lib/internal/memory/memmove - end - block $~lib/memory/memory.free|inlined.0 - local.get $0 - local.set $6 - local.get $6 - call $~lib/allocator/arena/__memory_free - br $~lib/memory/memory.free|inlined.0 - end - local.get $3 - local.set $0 - end - block $~lib/memory/memory.fill|inlined.1 - local.get $0 - i32.const 8 - i32.add - local.get $2 - i32.add - local.set $3 - i32.const 0 - local.set $6 - local.get $1 - local.get $2 - i32.sub - local.set $5 - local.get $3 - local.get $6 - local.get $5 - call $~lib/internal/memory/memset - end + local.get $5 + i32.div_u + local.set $6 + local.get $6 + local.get $5 + i32.mul + local.set $9 + local.get $7 + local.get $9 + i32.sub + local.set $10 + local.get $8 + local.get $2 + local.get $5 + local.get $6 + call $~lib/memory/memory.repeat + local.get $8 + local.get $9 + i32.add + local.get $2 + local.get $10 + call $~lib/memory/memory.copy else - local.get $1 + local.get $8 local.get $2 - i32.lt_s - if - local.get $1 - i32.const 0 - i32.ge_s - i32.eqz - if - i32.const 0 - i32.const 1128 - i32.const 62 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - local.get $1 - i32.store - end + local.get $7 + call $~lib/memory/memory.copy end + local.get $8 + local.get $7 + i32.add local.get $0 + local.get $3 + call $~lib/memory/memory.copy + local.get $8 + call $~lib/rt/pure/__retain + local.set $10 + local.get $2 + call $~lib/rt/pure/__release + local.get $10 ) - (func $~lib/array/Array<~lib/string/String>#push (; 46 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) + (func $~lib/string/String#padEnd (; 40 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -4291,6364 +4039,8591 @@ (local $7 i32) (local $8 i32) (local $9 i32) + (local $10 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.load offset=4 - local.set $2 + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 456 + i32.const 309 + i32.const 4 + call $~lib/builtins/abort + unreachable + end local.get $0 - i32.load + call $~lib/string/String#get:length + i32.const 1 + i32.shl local.set $3 - local.get $3 - i32.load - i32.const 2 - i32.shr_u + local.get $1 + i32.const 1 + i32.shl local.set $4 local.get $2 + call $~lib/string/String#get:length i32.const 1 - i32.add + i32.shl local.set $5 - local.get $2 local.get $4 - i32.ge_u - if - local.get $2 - i32.const 268435454 - i32.ge_u - if - i32.const 0 - i32.const 1096 - i32.const 182 - i32.const 42 - call $~lib/env/abort - unreachable - end - local.get $3 + local.get $3 + i32.lt_u + if (result i32) + i32.const 1 + else local.get $5 - i32.const 2 - i32.shl - call $~lib/internal/arraybuffer/reallocateUnsafe - local.set $3 - local.get $0 - local.get $3 - i32.store + i32.eqz end - local.get $0 - local.get $5 - i32.store offset=4 - block $~lib/internal/arraybuffer/STORE<~lib/string/String,~lib/string/String>|inlined.2 - local.get $3 + if + local.get $0 + call $~lib/rt/pure/__retain local.set $6 local.get $2 - local.set $7 - local.get $1 - local.set $8 - i32.const 0 - local.set $9 + call $~lib/rt/pure/__release local.get $6 - local.get $7 + return + end + local.get $4 + local.get $3 + i32.sub + local.set $7 + local.get $4 + i32.const 1 + call $~lib/rt/tlsf/__alloc + local.set $8 + local.get $8 + local.get $0 + local.get $3 + call $~lib/memory/memory.copy + local.get $7 + local.get $5 + i32.gt_u + if + local.get $7 i32.const 2 - i32.shl + i32.sub + local.get $5 + i32.div_u + local.set $6 + local.get $6 + local.get $5 + i32.mul + local.set $9 + local.get $7 + local.get $9 + i32.sub + local.set $10 + local.get $8 + local.get $3 + i32.add + local.get $2 + local.get $5 + local.get $6 + call $~lib/memory/memory.repeat + local.get $8 + local.get $3 i32.add local.get $9 i32.add + local.get $2 + local.get $10 + call $~lib/memory/memory.copy + else local.get $8 - i32.store offset=8 + local.get $3 + i32.add + local.get $2 + local.get $7 + call $~lib/memory/memory.copy end - local.get $5 + local.get $8 + call $~lib/rt/pure/__retain + local.set $10 + local.get $2 + call $~lib/rt/pure/__release + local.get $10 ) - (func $~lib/string/String#split (; 47 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/string/String#lastIndexOf (; 41 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 i32) - (local $16 i32) - (local $17 i32) - local.get $0 - i32.const 0 - i32.ne + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/string/String#get:length + local.set $3 + local.get $3 i32.eqz if - i32.const 0 - i32.const 80 - i32.const 413 - i32.const 4 - call $~lib/env/abort - unreachable + local.get $0 + call $~lib/string/String#get:length + local.set $4 + local.get $1 + call $~lib/rt/pure/__release + local.get $4 + return end - local.get $2 + local.get $0 + call $~lib/string/String#get:length + local.set $5 + local.get $5 i32.eqz if - i32.const 0 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#constructor + i32.const -1 + local.set $4 + local.get $1 + call $~lib/rt/pure/__release + local.get $4 return end - local.get $1 + local.get $2 + local.tee $4 i32.const 0 - i32.eq - if - block (result i32) - i32.const 0 - i32.const 1 - call $~lib/array/Array<~lib/string/String>#constructor - local.set $3 - local.get $3 + local.tee $6 + local.get $4 + local.get $6 + i32.gt_s + select + local.tee $4 + local.get $5 + local.get $3 + i32.sub + local.tee $6 + local.get $4 + local.get $6 + i32.lt_s + select + local.set $7 + block $break|0 + loop $repeat|0 + local.get $7 i32.const 0 + i32.ge_s + i32.eqz + br_if $break|0 local.get $0 - call $~lib/array/Array<~lib/string/String>#__unchecked_set + local.get $7 + local.get $1 + i32.const 0 local.get $3 + call $~lib/util/string/compareImpl + i32.eqz + if + local.get $7 + local.set $4 + local.get $1 + call $~lib/rt/pure/__release + local.get $4 + return + end + local.get $7 + i32.const 1 + i32.sub + local.set $7 + br $repeat|0 + unreachable end - return + unreachable end - local.get $0 - i32.load + i32.const -1 local.set $4 local.get $1 - i32.load - local.set $5 + call $~lib/rt/pure/__release + local.get $4 + ) + (func $~lib/util/string/isWhiteSpaceOrLineTerminator (; 42 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + block $break|0 + block $case10|0 + block $case9|0 + block $case8|0 + block $case7|0 + block $case6|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $0 + local.set $1 + local.get $1 + i32.const 9 + i32.eq + br_if $case0|0 + local.get $1 + i32.const 10 + i32.eq + br_if $case1|0 + local.get $1 + i32.const 13 + i32.eq + br_if $case2|0 + local.get $1 + i32.const 11 + i32.eq + br_if $case3|0 + local.get $1 + i32.const 12 + i32.eq + br_if $case4|0 + local.get $1 + i32.const 32 + i32.eq + br_if $case5|0 + local.get $1 + i32.const 160 + i32.eq + br_if $case6|0 + local.get $1 + i32.const 8232 + i32.eq + br_if $case7|0 + local.get $1 + i32.const 8233 + i32.eq + br_if $case8|0 + local.get $1 + i32.const 65279 + i32.eq + br_if $case9|0 + br $case10|0 + end + end + end + end + end + end + end + end + end + end + i32.const 1 + return + end + i32.const 0 + return + unreachable + end + unreachable + unreachable + ) + (func $~lib/util/string/parse (; 43 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) + (local $2 i32) + (local $3 f64) + (local $4 i32) + (local $5 i32) + (local $6 f64) + (local $7 i32) + (local $8 f64) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $0 + call $~lib/string/String#get:length + local.set $2 local.get $2 - i32.const 0 - i32.lt_s + i32.eqz if - global.get $~lib/builtins/i32.MAX_VALUE - local.set $2 + f64.const nan:0x8000000000000 + local.set $3 + local.get $0 + call $~lib/rt/pure/__release + local.get $3 + return + end + local.get $0 + local.set $4 + local.get $4 + i32.load16_u + local.set $5 + block $break|0 + loop $continue|0 + local.get $5 + call $~lib/util/string/isWhiteSpaceOrLineTerminator + if + local.get $4 + i32.const 2 + i32.add + local.tee $4 + i32.load16_u + local.set $5 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $continue|0 + end + end end local.get $5 - i32.eqz + i32.const 45 + i32.eq if - local.get $4 + local.get $2 + i32.const 1 + i32.sub + local.tee $2 i32.eqz if - i32.const 0 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#constructor + f64.const nan:0x8000000000000 + local.set $3 + local.get $0 + call $~lib/rt/pure/__release + local.get $3 return end local.get $4 - local.tee $3 - local.get $2 - local.tee $6 - local.get $3 - local.get $6 - i32.lt_s - select - local.set $4 - i32.const 0 - local.get $4 - call $~lib/array/Array<~lib/string/String>#constructor - local.set $3 - local.get $3 - i32.load + i32.const 2 + i32.add + local.tee $4 + i32.load16_u + local.set $5 + f64.const -1 local.set $6 - block $break|0 - i32.const 0 - local.set $7 - loop $repeat|0 - local.get $7 - local.get $4 - i32.lt_s - i32.eqz - br_if $break|0 - block - i32.const 1 - call $~lib/internal/string/allocateUnsafe - local.set $8 - local.get $8 - local.get $0 - local.get $7 - i32.const 1 - i32.shl - i32.add - i32.load16_u offset=4 - i32.store16 offset=4 - block $~lib/internal/arraybuffer/STORE<~lib/string/String,~lib/string/String>|inlined.1 - local.get $6 - local.set $9 - local.get $7 - local.set $10 - local.get $8 - local.set $11 - i32.const 0 - local.set $12 - local.get $9 - local.get $10 - i32.const 2 - i32.shl - i32.add - local.get $12 + else + local.get $5 + i32.const 43 + i32.eq + if + local.get $2 + i32.const 1 + i32.sub + local.tee $2 + i32.eqz + if + f64.const nan:0x8000000000000 + local.set $3 + local.get $0 + call $~lib/rt/pure/__release + local.get $3 + return + end + local.get $4 + i32.const 2 + i32.add + local.tee $4 + i32.load16_u + local.set $5 + f64.const 1 + local.set $6 + else + f64.const 1 + local.set $6 + end + end + local.get $1 + i32.eqz + if + local.get $5 + i32.const 48 + i32.eq + if (result i32) + local.get $2 + i32.const 2 + i32.gt_s + else + i32.const 0 + end + if + block $break|1 + block $case6|1 + block $case5|1 + block $case4|1 + block $case3|1 + block $case2|1 + block $case1|1 + block $case0|1 + local.get $4 + i32.const 2 + i32.add + i32.load16_u + local.set $7 + local.get $7 + i32.const 66 + i32.eq + br_if $case0|1 + local.get $7 + i32.const 98 + i32.eq + br_if $case1|1 + local.get $7 + i32.const 79 + i32.eq + br_if $case2|1 + local.get $7 + i32.const 111 + i32.eq + br_if $case3|1 + local.get $7 + i32.const 88 + i32.eq + br_if $case4|1 + local.get $7 + i32.const 120 + i32.eq + br_if $case5|1 + br $case6|1 + end + end + block + local.get $4 + i32.const 4 + i32.add + local.set $4 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + i32.const 2 + local.set $1 + br $break|1 + unreachable + end + unreachable + end + end + block + local.get $4 + i32.const 4 + i32.add + local.set $4 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + i32.const 8 + local.set $1 + br $break|1 + unreachable + end + unreachable + end + end + block + local.get $4 + i32.const 4 i32.add - local.get $11 - i32.store offset=8 + local.set $4 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + i32.const 16 + local.set $1 + br $break|1 + unreachable end + unreachable end - local.get $7 - i32.const 1 - i32.add - local.set $7 - br $repeat|0 - unreachable + i32.const 10 + local.set $1 end - unreachable + else + i32.const 10 + local.set $1 end - local.get $3 - return else - local.get $4 - i32.eqz - if - i32.const 0 + local.get $1 + i32.const 2 + i32.lt_s + if (result i32) i32.const 1 - call $~lib/array/Array<~lib/string/String>#constructor - local.set $6 + else + local.get $1 + i32.const 36 + i32.gt_s + end + if + f64.const nan:0x8000000000000 + local.set $3 + local.get $0 + call $~lib/rt/pure/__release + local.get $3 + return + end + end + f64.const 0 + local.set $8 + block $break|2 + loop $continue|2 block (result i32) - local.get $6 - local.tee $3 - i32.const 0 + local.get $2 local.tee $7 - i32.const 112 - call $~lib/array/Array<~lib/string/String>#__unchecked_set - local.get $3 + i32.const 1 + i32.sub + local.set $2 local.get $7 - call $~lib/array/Array<~lib/string/String>#__unchecked_get end - drop - local.get $6 - return - end - end - i32.const 0 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#constructor - local.set $13 - i32.const 0 - local.set $14 - i32.const 0 - local.set $15 - i32.const 0 - local.set $16 - block $break|1 - loop $continue|1 - local.get $0 - local.get $1 - local.get $15 - call $~lib/string/String#indexOf - local.tee $14 - i32.const -1 - i32.ne if - block - local.get $14 - local.get $15 - i32.sub - local.set $6 - local.get $6 + local.get $4 + i32.load16_u + local.set $5 + local.get $5 + i32.const 48 + i32.ge_s + if (result i32) + local.get $5 + i32.const 57 + i32.le_s + else i32.const 0 - i32.gt_s - if - local.get $6 - call $~lib/internal/string/allocateUnsafe - local.set $3 - local.get $3 - i32.const 0 - local.get $0 - local.get $15 - local.get $6 - call $~lib/internal/string/copyUnsafe - local.get $13 - local.get $3 - call $~lib/array/Array<~lib/string/String>#push - drop + end + if + local.get $5 + i32.const 48 + i32.sub + local.set $5 + else + local.get $5 + i32.const 65 + i32.ge_s + if (result i32) + local.get $5 + i32.const 90 + i32.le_s else - local.get $13 - i32.const 112 - call $~lib/array/Array<~lib/string/String>#push - drop + i32.const 0 end - local.get $16 - i32.const 1 - i32.add - local.tee $16 - local.get $2 - i32.eq if - local.get $13 - return + local.get $5 + i32.const 65 + i32.const 10 + i32.sub + i32.sub + local.set $5 + else + local.get $5 + i32.const 97 + i32.ge_s + if (result i32) + local.get $5 + i32.const 122 + i32.le_s + else + i32.const 0 + end + if + local.get $5 + i32.const 97 + i32.const 10 + i32.sub + i32.sub + local.set $5 + else + br $break|2 + end end - local.get $14 - local.get $5 - i32.add - local.set $15 end - br $continue|1 - end - end - end - local.get $15 - i32.eqz - if - i32.const 0 - i32.const 1 - call $~lib/array/Array<~lib/string/String>#constructor - local.set $6 - block (result i32) - local.get $6 - local.tee $3 - i32.const 0 - local.tee $7 - local.get $0 - call $~lib/array/Array<~lib/string/String>#__unchecked_set - local.get $3 - local.get $7 - call $~lib/array/Array<~lib/string/String>#__unchecked_get - end - drop - local.get $6 - return - end - local.get $4 - local.get $15 - i32.sub - local.set $17 - local.get $17 - i32.const 0 - i32.gt_s - if - local.get $17 - call $~lib/internal/string/allocateUnsafe - local.set $6 - local.get $6 - i32.const 0 - local.get $0 - local.get $15 - local.get $17 - call $~lib/internal/string/copyUnsafe - local.get $13 - local.get $6 - call $~lib/array/Array<~lib/string/String>#push - drop - else - local.get $13 - i32.const 112 - call $~lib/array/Array<~lib/string/String>#push - drop - end - local.get $13 - ) - (func $~lib/string/String#split|trampoline (; 48 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - block $2of2 - block $1of2 - block $0of2 - block $outOfRange - global.get $~lib/argc - br_table $0of2 $1of2 $2of2 $outOfRange + local.get $5 + local.get $1 + i32.ge_s + if + br $break|2 end - unreachable + local.get $8 + local.get $1 + f64.convert_i32_s + f64.mul + local.get $5 + f64.convert_i32_s + f64.add + local.set $8 + local.get $4 + i32.const 2 + i32.add + local.set $4 + br $continue|2 end - i32.const 0 - local.set $1 end - global.get $~lib/builtins/i32.MAX_VALUE - local.set $2 end + local.get $6 + local.get $8 + f64.mul + local.set $3 local.get $0 - local.get $1 - local.get $2 - call $~lib/string/String#split + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/array/Array<~lib/string/String>#__get (; 49 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) + (func $~lib/string/parseInt (; 44 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) + (local $2 f64) + local.get $0 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.load - local.set $2 local.get $1 + call $~lib/util/string/parse + local.set $2 + local.get $0 + call $~lib/rt/pure/__release local.get $2 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $2 - local.set $3 - local.get $1 - local.set $4 - i32.const 0 - local.set $5 - local.get $3 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $5 - i32.add - i32.load offset=8 - else - unreachable - end ) - (func $~lib/internal/number/decimalCount32 (; 50 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/string/parseFloat (; 45 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) (local $1 i32) + (local $2 f64) + (local $3 i32) + (local $4 i32) + (local $5 f64) + (local $6 f64) + (local $7 i32) local.get $0 - i32.const 100000 - i32.lt_u + call $~lib/rt/pure/__retain + drop + local.get $0 + call $~lib/string/String#get:length + local.set $1 + local.get $1 + i32.eqz if + f64.const nan:0x8000000000000 + local.set $2 local.get $0 - i32.const 100 - i32.lt_u - if - i32.const 1 - i32.const 2 - local.get $0 - i32.const 10 - i32.lt_u - select - return - else - i32.const 4 - i32.const 5 - local.get $0 - i32.const 10000 - i32.lt_u - select - local.set $1 - i32.const 3 - local.get $1 - local.get $0 - i32.const 1000 - i32.lt_u - select - return - end - unreachable - unreachable - else - local.get $0 - i32.const 10000000 - i32.lt_u - if - i32.const 6 - i32.const 7 - local.get $0 - i32.const 1000000 - i32.lt_u - select - return - else - i32.const 9 - i32.const 10 - local.get $0 - i32.const 1000000000 - i32.lt_u - select - local.set $1 - i32.const 8 - local.get $1 - local.get $0 - i32.const 100000000 - i32.lt_u - select - return - end - unreachable - unreachable + call $~lib/rt/pure/__release + local.get $2 + return end - unreachable - unreachable - ) - (func $~lib/internal/number/utoa32_lut (; 51 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i64) - (local $12 i64) - i32.const 1816 - i32.load + local.get $0 local.set $3 + local.get $3 + i32.load16_u + local.set $4 block $break|0 loop $continue|0 - local.get $1 - i32.const 10000 - i32.ge_u + local.get $4 + call $~lib/util/string/isWhiteSpaceOrLineTerminator if - block - local.get $1 - i32.const 10000 - i32.div_u - local.set $4 - local.get $1 - i32.const 10000 - i32.rem_u - local.set $5 - local.get $4 - local.set $1 - local.get $5 - i32.const 100 - i32.div_u - local.set $6 - local.get $5 - i32.const 100 - i32.rem_u - local.set $7 - block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i64) - local.get $3 - local.set $8 - local.get $6 - local.set $9 - i32.const 0 - local.set $10 - local.get $8 - local.get $9 - i32.const 2 - i32.shl - i32.add - local.get $10 - i32.add - i64.load32_u offset=8 - end - local.set $11 - block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i64) - local.get $3 - local.set $10 - local.get $7 - local.set $9 - i32.const 0 - local.set $8 - local.get $10 - local.get $9 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.add - i64.load32_u offset=8 - end - local.set $12 - local.get $2 - i32.const 4 - i32.sub - local.set $2 - local.get $0 - local.get $2 - i32.const 1 - i32.shl - i32.add - local.get $11 - local.get $12 - i64.const 32 - i64.shl - i64.or - i64.store offset=4 - end + local.get $3 + i32.const 2 + i32.add + local.tee $3 + i32.load16_u + local.set $4 + local.get $1 + i32.const 1 + i32.sub + local.set $1 br $continue|0 end end end - local.get $1 - i32.const 100 - i32.ge_u + local.get $4 + i32.const 45 + i32.eq if local.get $1 - i32.const 100 - i32.div_u - local.set $7 - local.get $1 - i32.const 100 - i32.rem_u - local.set $6 - local.get $7 - local.set $1 - local.get $2 - i32.const 2 + i32.const 1 i32.sub - local.set $2 - block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) - local.get $3 - local.set $5 - local.get $6 - local.set $4 - i32.const 0 - local.set $8 - local.get $5 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.add - i32.load offset=8 + local.tee $1 + i32.eqz + if + f64.const nan:0x8000000000000 + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $2 + return end - local.set $8 - local.get $0 - local.get $2 - i32.const 1 - i32.shl - i32.add - local.get $8 - i32.store offset=4 - end - local.get $1 - i32.const 10 - i32.ge_u - if - local.get $2 + local.get $3 i32.const 2 - i32.sub - local.set $2 - block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i32) - local.get $3 - local.set $8 + i32.add + local.tee $3 + i32.load16_u + local.set $4 + f64.const -1 + local.set $5 + else + local.get $4 + i32.const 43 + i32.eq + if local.get $1 - local.set $6 - i32.const 0 - local.set $7 - local.get $8 - local.get $6 + i32.const 1 + i32.sub + local.tee $1 + i32.eqz + if + f64.const nan:0x8000000000000 + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $2 + return + end + local.get $3 i32.const 2 - i32.shl i32.add - local.get $7 - i32.add - i32.load offset=8 + local.tee $3 + i32.load16_u + local.set $4 + f64.const 1 + local.set $5 + else + f64.const 1 + local.set $5 + end + end + f64.const 0 + local.set $6 + block $break|1 + loop $continue|1 + block (result i32) + local.get $1 + local.tee $7 + i32.const 1 + i32.sub + local.set $1 + local.get $7 + end + if + local.get $3 + i32.load16_u + local.set $4 + local.get $4 + i32.const 46 + i32.eq + if + local.get $3 + i32.const 2 + i32.add + local.set $3 + f64.const 0.1 + local.set $2 + block $break|2 + loop $continue|2 + block (result i32) + local.get $1 + local.tee $7 + i32.const 1 + i32.sub + local.set $1 + local.get $7 + end + if + local.get $3 + i32.load16_u + local.set $4 + local.get $4 + i32.const 69 + i32.eq + if (result i32) + i32.const 1 + else + local.get $4 + i32.const 101 + i32.eq + end + if + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 456 + i32.const 577 + i32.const 10 + call $~lib/builtins/abort + unreachable + end + end + local.get $4 + i32.const 48 + i32.sub + local.set $4 + local.get $4 + i32.const 9 + i32.gt_u + if + br $break|2 + end + local.get $6 + local.get $4 + f64.convert_i32_s + local.get $2 + f64.mul + f64.add + local.set $6 + local.get $2 + f64.const 0.1 + f64.mul + local.set $2 + local.get $3 + i32.const 2 + i32.add + local.set $3 + br $continue|2 + end + end + end + br $break|1 + end + local.get $4 + i32.const 48 + i32.sub + local.set $4 + local.get $4 + i32.const 10 + i32.ge_u + if + br $break|1 + end + local.get $6 + f64.const 10 + f64.mul + local.get $4 + f64.convert_i32_s + f64.add + local.set $6 + local.get $3 + i32.const 2 + i32.add + local.set $3 + br $continue|1 + end end - local.set $7 - local.get $0 - local.get $2 - i32.const 1 - i32.shl - i32.add - local.get $7 - i32.store offset=4 - else - local.get $2 - i32.const 1 - i32.sub - local.set $2 - i32.const 48 - local.get $1 - i32.add - local.set $7 - local.get $0 - local.get $2 - i32.const 1 - i32.shl - i32.add - local.get $7 - i32.store16 offset=4 end + local.get $5 + local.get $6 + f64.mul + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $2 ) - (func $~lib/internal/number/itoa32 (; 52 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/string/String#concat (; 46 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - local.get $0 - i32.eqz + (local $7 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $1 + i32.const 0 + i32.eq if - i32.const 480 - return + block (result i32) + i32.const 552 + local.tee $2 + local.get $1 + local.tee $3 + i32.ne + if + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $3 + call $~lib/rt/pure/__release + end + local.get $2 + end + local.set $1 end local.get $0 - i32.const 0 - i32.lt_s - local.set $1 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.set $4 local.get $1 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.set $5 + local.get $4 + local.get $5 + i32.add + local.set $6 + local.get $6 + i32.const 0 + i32.eq if - i32.const 0 - local.get $0 - i32.sub - local.set $0 + i32.const 120 + call $~lib/rt/pure/__retain + local.set $2 + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + return end + local.get $6 + i32.const 1 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $7 + local.get $7 local.get $0 - call $~lib/internal/number/decimalCount32 - local.get $1 + local.get $4 + call $~lib/memory/memory.copy + local.get $7 + local.get $4 i32.add + local.get $1 + local.get $5 + call $~lib/memory/memory.copy + local.get $7 local.set $2 + local.get $1 + call $~lib/rt/pure/__release local.get $2 - call $~lib/internal/string/allocateUnsafe - local.set $3 - block $~lib/internal/number/utoa32_core|inlined.0 - local.get $3 - local.set $4 - local.get $0 - local.set $5 - local.get $2 - local.set $6 - local.get $4 - local.get $5 - local.get $6 - call $~lib/internal/number/utoa32_lut + ) + (func $~lib/string/String.__concat (; 47 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.const 552 + local.get $0 + i32.const 0 + i32.ne + select + local.get $1 + call $~lib/string/String#concat + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + ) + (func $~lib/string/String.__ne (; 48 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + call $~lib/string/String.__eq + i32.eqz + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + ) + (func $~lib/string/String.__gt (; 49 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + i32.eq + if (result i32) + i32.const 1 + else + local.get $0 + i32.const 0 + i32.eq + end + if (result i32) + i32.const 1 + else + local.get $1 + i32.const 0 + i32.eq + end + if + i32.const 0 + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + return end + local.get $0 + call $~lib/string/String#get:length + local.set $3 local.get $1 + call $~lib/string/String#get:length + local.set $4 + local.get $3 + i32.eqz if - local.get $3 - i32.const 45 - i32.store16 offset=4 + i32.const 0 + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + return + end + local.get $4 + i32.eqz + if + i32.const 1 + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + return end + local.get $0 + i32.const 0 + local.get $1 + i32.const 0 local.get $3 + local.tee $2 + local.get $4 + local.tee $5 + local.get $2 + local.get $5 + i32.lt_s + select + call $~lib/util/string/compareImpl + i32.const 0 + i32.gt_s + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 ) - (func $~lib/internal/number/utoa32 (; 53 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/string/String.__lt (; 50 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) local.get $0 - i32.eqz + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + i32.eq + if (result i32) + i32.const 1 + else + local.get $0 + i32.const 0 + i32.eq + end + if (result i32) + i32.const 1 + else + local.get $1 + i32.const 0 + i32.eq + end if - i32.const 480 + i32.const 0 + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 return end local.get $0 - call $~lib/internal/number/decimalCount32 - local.set $1 + call $~lib/string/String#get:length + local.set $3 local.get $1 - call $~lib/internal/string/allocateUnsafe - local.set $2 - block $~lib/internal/number/utoa32_core|inlined.1 + call $~lib/string/String#get:length + local.set $4 + local.get $4 + i32.eqz + if + i32.const 0 + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release local.get $2 - local.set $3 + return + end + local.get $3 + i32.eqz + if + i32.const 1 + local.set $2 local.get $0 - local.set $4 + call $~lib/rt/pure/__release local.get $1 - local.set $5 - local.get $3 - local.get $4 - local.get $5 - call $~lib/internal/number/utoa32_lut + call $~lib/rt/pure/__release + local.get $2 + return end + local.get $0 + i32.const 0 + local.get $1 + i32.const 0 + local.get $3 + local.tee $2 + local.get $4 + local.tee $5 + local.get $2 + local.get $5 + i32.lt_s + select + call $~lib/util/string/compareImpl + i32.const 0 + i32.lt_s + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release local.get $2 ) - (func $~lib/internal/number/decimalCount64 (; 54 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) - (local $1 i32) + (func $~lib/string/String.__gte (; 51 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) local.get $0 - i64.const 1000000000000000 - i64.lt_u + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + call $~lib/string/String.__lt + i32.eqz + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + ) + (func $~lib/string/String.__lte (; 52 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + call $~lib/string/String.__gt + i32.eqz + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + ) + (func $~lib/string/String#repeat (; 53 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + i32.const 0 + i32.ne + i32.eqz if - local.get $0 - i64.const 1000000000000 - i64.lt_u - if - i32.const 11 - i32.const 12 - local.get $0 - i64.const 100000000000 - i64.lt_u - select - return - else - i32.const 14 - i32.const 15 - local.get $0 - i64.const 100000000000000 - i64.lt_u - select - local.set $1 - i32.const 13 - local.get $1 - local.get $0 - i64.const 10000000000000 - i64.lt_u - select - return - end + i32.const 0 + i32.const 456 + i32.const 330 + i32.const 4 + call $~lib/builtins/abort unreachable + end + local.get $0 + call $~lib/string/String#get:length + local.set $2 + local.get $1 + i32.const 0 + i32.lt_s + if (result i32) + i32.const 1 + else + local.get $2 + i64.extend_i32_s + local.get $1 + i64.extend_i32_s + i64.mul + i64.const 268435456 + i64.gt_u + end + if + i32.const 1832 + i32.const 456 + i32.const 335 + i32.const 6 + call $~lib/builtins/abort unreachable + end + local.get $1 + i32.const 0 + i32.eq + if (result i32) + i32.const 1 else - local.get $0 - i64.const 100000000000000000 - i64.lt_u - if - i32.const 16 - i32.const 17 - local.get $0 - i64.const 10000000000000000 - i64.lt_u - select - return - else - i32.const 19 - i32.const 20 - local.get $0 - i64.const -8446744073709551616 - i64.lt_u - select - local.set $1 - i32.const 18 - local.get $1 - local.get $0 - i64.const 1000000000000000000 - i64.lt_u - select - return - end - unreachable - unreachable - end - unreachable - unreachable - ) - (func $~lib/internal/number/utoa64_lut (; 55 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) - (local $3 i32) - (local $4 i64) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 i64) - (local $16 i64) - i32.const 1816 - i32.load - local.set $3 - block $break|0 - loop $continue|0 - local.get $1 - i64.const 100000000 - i64.ge_u - if - block - local.get $1 - i64.const 100000000 - i64.div_u - local.set $4 - local.get $1 - local.get $4 - i64.const 100000000 - i64.mul - i64.sub - i32.wrap_i64 - local.set $5 - local.get $4 - local.set $1 - local.get $5 - i32.const 10000 - i32.div_u - local.set $6 - local.get $5 - i32.const 10000 - i32.rem_u - local.set $7 - local.get $6 - i32.const 100 - i32.div_u - local.set $8 - local.get $6 - i32.const 100 - i32.rem_u - local.set $9 - local.get $7 - i32.const 100 - i32.div_u - local.set $10 - local.get $7 - i32.const 100 - i32.rem_u - local.set $11 - block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i64) - local.get $3 - local.set $12 - local.get $10 - local.set $13 - i32.const 0 - local.set $14 - local.get $12 - local.get $13 - i32.const 2 - i32.shl - i32.add - local.get $14 - i32.add - i64.load32_u offset=8 - end - local.set $15 - block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i64) - local.get $3 - local.set $14 - local.get $11 - local.set $13 - i32.const 0 - local.set $12 - local.get $14 - local.get $13 - i32.const 2 - i32.shl - i32.add - local.get $12 - i32.add - i64.load32_u offset=8 - end - local.set $16 - local.get $2 - i32.const 4 - i32.sub - local.set $2 - local.get $0 - local.get $2 - i32.const 1 - i32.shl - i32.add - local.get $15 - local.get $16 - i64.const 32 - i64.shl - i64.or - i64.store offset=4 - block $~lib/internal/arraybuffer/LOAD|inlined.4 (result i64) - local.get $3 - local.set $12 - local.get $8 - local.set $13 - i32.const 0 - local.set $14 - local.get $12 - local.get $13 - i32.const 2 - i32.shl - i32.add - local.get $14 - i32.add - i64.load32_u offset=8 - end - local.set $15 - block $~lib/internal/arraybuffer/LOAD|inlined.5 (result i64) - local.get $3 - local.set $14 - local.get $9 - local.set $13 - i32.const 0 - local.set $12 - local.get $14 - local.get $13 - i32.const 2 - i32.shl - i32.add - local.get $12 - i32.add - i64.load32_u offset=8 - end - local.set $16 - local.get $2 - i32.const 4 - i32.sub - local.set $2 - local.get $0 - local.get $2 - i32.const 1 - i32.shl - i32.add - local.get $15 - local.get $16 - i64.const 32 - i64.shl - i64.or - i64.store offset=4 - end - br $continue|0 - end - end + local.get $2 + i32.eqz end - local.get $0 - local.get $1 - i32.wrap_i64 - local.get $2 - call $~lib/internal/number/utoa32_lut - ) - (func $~lib/internal/number/utoa64 (; 56 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i64) - local.get $0 - i64.eqz if - i32.const 480 + i32.const 120 + call $~lib/rt/pure/__retain return end - local.get $0 - global.get $~lib/builtins/u32.MAX_VALUE - i64.extend_i32_u - i64.le_u + local.get $1 + i32.const 1 + i32.eq if local.get $0 - i32.wrap_i64 - local.set $2 - local.get $2 - call $~lib/internal/number/decimalCount32 - local.set $3 - local.get $3 - call $~lib/internal/string/allocateUnsafe - local.set $1 - block $~lib/internal/number/utoa32_core|inlined.2 - local.get $1 - local.set $4 - local.get $2 - local.set $5 - local.get $3 - local.set $6 - local.get $4 - local.get $5 - local.get $6 - call $~lib/internal/number/utoa32_lut - end - else - local.get $0 - call $~lib/internal/number/decimalCount64 - local.set $3 - local.get $3 - call $~lib/internal/string/allocateUnsafe - local.set $1 - block $~lib/internal/number/utoa64_core|inlined.0 - local.get $1 - local.set $2 - local.get $0 - local.set $7 - local.get $3 - local.set $6 - local.get $2 - local.get $7 - local.get $6 - call $~lib/internal/number/utoa64_lut - end + call $~lib/rt/pure/__retain + return end + local.get $2 + local.get $1 + i32.mul + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + local.set $3 + local.get $3 + local.get $0 + local.get $2 + i32.const 1 + i32.shl local.get $1 + call $~lib/memory/memory.repeat + local.get $3 + call $~lib/rt/pure/__retain ) - (func $~lib/internal/number/itoa64 (; 57 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) - (local $1 i32) - (local $2 i32) + (func $~lib/string/String#slice (; 54 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - (local $8 i64) - local.get $0 - i64.eqz - if - i32.const 480 - return - end local.get $0 - i64.const 0 - i64.lt_s - local.set $1 + call $~lib/string/String#get:length + local.set $3 local.get $1 - if - i64.const 0 - local.get $0 - i64.sub - local.set $0 - end - local.get $0 - global.get $~lib/builtins/u32.MAX_VALUE - i64.extend_i32_u - i64.le_u - if - local.get $0 - i32.wrap_i64 - local.set $3 - local.get $3 - call $~lib/internal/number/decimalCount32 + i32.const 0 + i32.lt_s + if (result i32) local.get $1 + local.get $3 i32.add - local.set $4 + local.tee $4 + i32.const 0 + local.tee $5 local.get $4 - call $~lib/internal/string/allocateUnsafe - local.set $2 - block $~lib/internal/number/utoa32_core|inlined.3 - local.get $2 - local.set $5 - local.get $3 - local.set $6 - local.get $4 - local.set $7 - local.get $5 - local.get $6 - local.get $7 - call $~lib/internal/number/utoa32_lut - end + local.get $5 + i32.gt_s + select else - local.get $0 - call $~lib/internal/number/decimalCount64 local.get $1 - i32.add - local.set $4 + local.tee $4 + local.get $3 + local.tee $5 local.get $4 - call $~lib/internal/string/allocateUnsafe - local.set $2 - block $~lib/internal/number/utoa64_core|inlined.1 - local.get $2 - local.set $3 - local.get $0 - local.set $8 - local.get $4 - local.set $7 - local.get $3 - local.get $8 - local.get $7 - call $~lib/internal/number/utoa64_lut - end + local.get $5 + i32.lt_s + select end - local.get $1 - if + local.set $1 + local.get $2 + i32.const 0 + i32.lt_s + if (result i32) local.get $2 - i32.const 45 - i32.store16 offset=4 + local.get $3 + i32.add + local.tee $4 + i32.const 0 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + else + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.lt_s + select end + local.set $2 local.get $2 - ) - (func $~lib/builtins/isFinite (; 58 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) - local.get $0 + local.get $1 + i32.sub + local.set $3 + local.get $3 + i32.const 0 + i32.le_s + if + i32.const 120 + call $~lib/rt/pure/__retain + return + end + local.get $3 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + local.set $6 + local.get $6 local.get $0 - f64.sub - f64.const 0 - f64.eq + local.get $1 + i32.const 1 + i32.shl + i32.add + local.get $3 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $6 + call $~lib/rt/pure/__retain ) - (func $~lib/builtins/isNaN (; 59 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + (func $~lib/rt/__allocArray (; 55 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + i32.const 16 + local.get $2 + call $~lib/rt/tlsf/__alloc + local.set $4 local.get $0 + local.get $1 + i32.shl + local.set $5 + local.get $5 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $6 + local.get $4 + local.get $6 + call $~lib/rt/pure/__retain + i32.store + local.get $4 + local.get $6 + i32.store offset=4 + local.get $4 + local.get $5 + i32.store offset=8 + local.get $4 local.get $0 - f64.ne + i32.store offset=12 + local.get $3 + if + local.get $6 + local.get $3 + local.get $5 + call $~lib/memory/memory.copy + end + local.get $4 ) - (func $~lib/internal/number/genDigits (; 60 ;) (type $FUNCSIG$iijijiji) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (param $6 i32) (result i32) + (func $~lib/rt/tlsf/reallocateBlock (; 56 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) (local $7 i32) - (local $8 i64) - (local $9 i64) - (local $10 i64) - (local $11 i32) - (local $12 i32) - (local $13 i64) - (local $14 i32) - (local $15 i32) - (local $16 i32) - (local $17 i32) - (local $18 i32) - (local $19 i64) - (local $20 i32) - (local $21 i64) - (local $22 i64) - (local $23 i32) - (local $24 i32) - (local $25 i32) - (local $26 i64) - (local $27 i64) - i32.const 0 + (local $8 i32) + local.get $2 + call $~lib/rt/tlsf/prepareSize + local.set $3 + local.get $1 + i32.load + local.set $4 local.get $4 - i32.sub + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 184 + i32.const 493 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + local.get $4 + i32.const -4 + i32.and + i32.le_u + if + local.get $0 + local.get $1 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $1 + local.get $2 + i32.store offset=12 + local.get $1 + return + end + block $~lib/rt/tlsf/GETRIGHT|inlined.4 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $6 + local.get $6 + i32.load local.set $7 - i64.const 1 local.get $7 - i64.extend_i32_s - i64.shl + i32.const 1 + i32.and + if + local.get $4 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $7 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $5 + local.get $5 + local.get $3 + i32.ge_u + if + local.get $0 + local.get $6 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $4 + i32.const 3 + i32.and + local.get $5 + i32.or + i32.store + local.get $1 + local.get $2 + i32.store offset=12 + local.get $0 + local.get $1 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $1 + return + end + end + local.get $0 + local.get $2 + call $~lib/rt/tlsf/allocateBlock local.set $8 local.get $8 - i64.const 1 - i64.sub - local.set $9 - local.get $3 local.get $1 - i64.sub - local.set $10 + i32.load offset=4 + i32.store offset=4 + local.get $8 + local.get $1 + i32.load offset=8 + i32.store offset=8 + local.get $8 + i32.const 16 + i32.add + local.get $1 + i32.const 16 + i32.add + local.get $2 + call $~lib/memory/memory.copy + local.get $1 local.get $4 - local.set $11 - local.get $3 - local.get $7 - i64.extend_i32_s - i64.shr_u - i32.wrap_i64 - local.set $12 - local.get $3 - local.get $9 - i64.and - local.set $13 - local.get $12 - call $~lib/internal/number/decimalCount32 - local.set $14 - local.get $6 - local.set $15 - i32.const 4104 - i32.load - local.set $16 - block $break|0 - loop $continue|0 - local.get $14 - i32.const 0 - i32.gt_s - if - block - block $break|1 - block $case10|1 - block $case9|1 - block $case8|1 - block $case7|1 - block $case6|1 - block $case5|1 - block $case4|1 - block $case3|1 - block $case2|1 - block $case1|1 - block $case0|1 - local.get $14 - local.set $18 - local.get $18 - i32.const 10 - i32.eq - br_if $case0|1 - local.get $18 - i32.const 9 - i32.eq - br_if $case1|1 - local.get $18 - i32.const 8 - i32.eq - br_if $case2|1 - local.get $18 - i32.const 7 - i32.eq - br_if $case3|1 - local.get $18 - i32.const 6 - i32.eq - br_if $case4|1 - local.get $18 - i32.const 5 - i32.eq - br_if $case5|1 - local.get $18 - i32.const 4 - i32.eq - br_if $case6|1 - local.get $18 - i32.const 3 - i32.eq - br_if $case7|1 - local.get $18 - i32.const 2 - i32.eq - br_if $case8|1 - local.get $18 - i32.const 1 - i32.eq - br_if $case9|1 - br $case10|1 - end - block - local.get $12 - i32.const 1000000000 - i32.div_u - local.set $17 - local.get $12 - i32.const 1000000000 - i32.rem_u - local.set $12 - br $break|1 - unreachable - end - unreachable - end - block - local.get $12 - i32.const 100000000 - i32.div_u - local.set $17 - local.get $12 - i32.const 100000000 - i32.rem_u - local.set $12 - br $break|1 - unreachable - end - unreachable - end - block - local.get $12 - i32.const 10000000 - i32.div_u - local.set $17 - local.get $12 - i32.const 10000000 - i32.rem_u - local.set $12 - br $break|1 - unreachable - end - unreachable - end - block - local.get $12 - i32.const 1000000 - i32.div_u - local.set $17 - local.get $12 - i32.const 1000000 - i32.rem_u - local.set $12 - br $break|1 - unreachable - end - unreachable - end - block - local.get $12 - i32.const 100000 - i32.div_u - local.set $17 - local.get $12 - i32.const 100000 - i32.rem_u - local.set $12 - br $break|1 - unreachable - end - unreachable - end - block - local.get $12 - i32.const 10000 - i32.div_u - local.set $17 - local.get $12 - i32.const 10000 - i32.rem_u - local.set $12 - br $break|1 - unreachable - end - unreachable - end - block - local.get $12 - i32.const 1000 - i32.div_u - local.set $17 - local.get $12 - i32.const 1000 - i32.rem_u - local.set $12 - br $break|1 - unreachable - end - unreachable - end - block - local.get $12 - i32.const 100 - i32.div_u - local.set $17 - local.get $12 - i32.const 100 - i32.rem_u - local.set $12 - br $break|1 - unreachable - end - unreachable - end - block - local.get $12 - i32.const 10 - i32.div_u - local.set $17 - local.get $12 - i32.const 10 - i32.rem_u - local.set $12 - br $break|1 - unreachable - end - unreachable - end - block - local.get $12 - local.set $17 - i32.const 0 - local.set $12 - br $break|1 - unreachable - end - unreachable - end - block - i32.const 0 - local.set $17 - br $break|1 - unreachable - end - unreachable - end - local.get $17 - local.get $15 - i32.or - if - local.get $0 - block (result i32) - local.get $15 - local.tee $18 - i32.const 1 - i32.add - local.set $15 - local.get $18 - end - i32.const 1 - i32.shl - i32.add - i32.const 48 - local.get $17 - i32.const 65535 - i32.and - i32.add - i32.store16 offset=4 - end - local.get $14 - i32.const 1 - i32.sub - local.set $14 - local.get $12 - i64.extend_i32_u - local.get $7 - i64.extend_i32_s - i64.shl - local.get $13 - i64.add - local.set $19 - local.get $19 - local.get $5 - i64.le_u - if - global.get $~lib/internal/number/_K - local.get $14 - i32.add - global.set $~lib/internal/number/_K - block $~lib/internal/number/grisuRound|inlined.0 - local.get $0 - local.set $18 - local.get $15 - local.set $20 - local.get $5 - local.set $21 - local.get $19 - local.set $22 - block $~lib/internal/arraybuffer/LOAD|inlined.6 (result i64) - local.get $16 - local.set $23 - local.get $14 - local.set $24 - i32.const 0 - local.set $25 - local.get $23 - local.get $24 - i32.const 2 - i32.shl - i32.add - local.get $25 - i32.add - i64.load32_u offset=8 - end - local.get $7 - i64.extend_i32_s - i64.shl - local.set $26 - local.get $10 - local.set $27 - local.get $18 - local.get $20 - i32.const 1 - i32.sub - i32.const 1 - i32.shl - i32.add - local.set $25 - local.get $25 - i32.load16_u offset=4 - local.set $24 - block $break|2 - loop $continue|2 - local.get $22 - local.get $27 - i64.lt_u - local.tee $23 - if (result i32) - local.get $21 - local.get $22 - i64.sub - local.get $26 - i64.ge_u - else - local.get $23 - end - local.tee $23 - if (result i32) - local.get $22 - local.get $26 - i64.add - local.get $27 - i64.lt_u - local.tee $23 - if (result i32) - local.get $23 - else - local.get $27 - local.get $22 - i64.sub - local.get $22 - local.get $26 - i64.add - local.get $27 - i64.sub - i64.gt_u - end - else - local.get $23 - end - if - block - local.get $24 - i32.const 1 - i32.sub - local.set $24 - local.get $22 - local.get $26 - i64.add - local.set $22 - end - br $continue|2 - end - end - end - local.get $25 - local.get $24 - i32.store16 offset=4 - end - local.get $15 - return - end - end - br $continue|0 - end - end + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $8 + ) + (func $~lib/rt/tlsf/__realloc (; 57 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 184 + i32.const 553 + i32.const 13 + call $~lib/builtins/abort + unreachable end - block $break|3 - loop $continue|3 - i32.const 1 - if - block - local.get $13 - i64.const 10 - i64.mul - local.set $13 - local.get $5 - i64.const 10 - i64.mul - local.set $5 - local.get $13 - local.get $7 - i64.extend_i32_s - i64.shr_u - local.set $19 - local.get $19 - local.get $15 - i64.extend_i32_s - i64.or - i64.const 0 - i64.ne - if - local.get $0 - block (result i32) - local.get $15 - local.tee $17 - i32.const 1 - i32.add - local.set $15 - local.get $17 - end - i32.const 1 - i32.shl - i32.add - i32.const 48 - local.get $19 - i32.wrap_i64 - i32.const 65535 - i32.and - i32.add - i32.store16 offset=4 - end - local.get $13 - local.get $9 - i64.and - local.set $13 - local.get $14 - i32.const 1 - i32.sub - local.set $14 - local.get $13 - local.get $5 - i64.lt_u - if - global.get $~lib/internal/number/_K - local.get $14 - i32.add - global.set $~lib/internal/number/_K - local.get $10 - block $~lib/internal/arraybuffer/LOAD|inlined.7 (result i64) - local.get $16 - local.set $17 - i32.const 0 - local.get $14 - i32.sub - local.set $24 - i32.const 0 - local.set $25 - local.get $17 - local.get $24 - i32.const 2 - i32.shl - i32.add - local.get $25 - i32.add - i64.load32_u offset=8 - end - i64.mul - local.set $10 - block $~lib/internal/number/grisuRound|inlined.1 - local.get $0 - local.set $25 - local.get $15 - local.set $24 - local.get $5 - local.set $27 - local.get $13 - local.set $26 - local.get $8 - local.set $22 - local.get $10 - local.set $21 - local.get $25 - local.get $24 - i32.const 1 - i32.sub - i32.const 1 - i32.shl - i32.add - local.set $17 - local.get $17 - i32.load16_u offset=4 - local.set $20 - block $break|4 - loop $continue|4 - local.get $26 - local.get $21 - i64.lt_u - local.tee $18 - if (result i32) - local.get $27 - local.get $26 - i64.sub - local.get $22 - i64.ge_u - else - local.get $18 - end - local.tee $18 - if (result i32) - local.get $26 - local.get $22 - i64.add - local.get $21 - i64.lt_u - local.tee $18 - if (result i32) - local.get $18 - else - local.get $21 - local.get $26 - i64.sub - local.get $26 - local.get $22 - i64.add - local.get $21 - i64.sub - i64.gt_u - end - else - local.get $18 - end - if - block - local.get $20 - i32.const 1 - i32.sub - local.set $20 - local.get $26 - local.get $22 - i64.add - local.set $26 - end - br $continue|4 - end - end - end - local.get $17 - local.get $20 - i32.store16 offset=4 - end - local.get $15 - return - end - end - br $continue|3 - end - end + local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 end - local.get $15 + i32.eqz + if + i32.const 0 + i32.const 184 + i32.const 554 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + local.get $1 + call $~lib/rt/tlsf/reallocateBlock + i32.const 16 + i32.add ) - (func $~lib/internal/number/prettify (; 61 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/memory/memory.fill (; 58 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - local.get $2 - i32.eqz - if + (local $8 i64) + block $~lib/util/memory/memset|inlined.0 local.get $0 + local.set $5 local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $3 + i32.eqz + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 1 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 2 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 i32.const 1 - i32.shl i32.add - i32.const 46 - i32.const 48 - i32.const 16 - i32.shl - i32.or - i32.store offset=4 - local.get $1 + local.get $4 + i32.store8 + local.get $5 i32.const 2 i32.add - return - end - local.get $1 - local.get $2 - i32.add - local.set $3 - local.get $1 - local.get $3 - i32.le_s - local.tee $4 - if (result i32) + local.get $4 + i32.store8 + local.get $5 local.get $3 - i32.const 21 - i32.le_s - else + i32.add + i32.const 2 + i32.sub local.get $4 - end - if - block $break|0 - local.get $1 - local.set $4 - loop $repeat|0 - local.get $4 - local.get $3 - i32.lt_s - i32.eqz - br_if $break|0 - local.get $0 - local.get $4 - i32.const 1 - i32.shl - i32.add - i32.const 48 - i32.store16 offset=4 - local.get $4 - i32.const 1 - i32.add - local.set $4 - br $repeat|0 - unreachable - end - unreachable - end - local.get $0 + i32.store8 + local.get $5 local.get $3 - i32.const 1 - i32.shl i32.add - i32.const 46 - i32.const 48 - i32.const 16 - i32.shl - i32.or - i32.store offset=4 + i32.const 3 + i32.sub + local.get $4 + i32.store8 local.get $3 - i32.const 2 + i32.const 6 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 3 i32.add - return - else + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.get $4 + i32.store8 local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end i32.const 0 - i32.gt_s - local.tee $4 - if (result i32) - local.get $3 - i32.const 21 - i32.le_s - else - local.get $4 + local.get $5 + i32.sub + i32.const 3 + i32.and + local.set $6 + local.get $5 + local.get $6 + i32.add + local.set $5 + local.get $3 + local.get $6 + i32.sub + local.set $3 + local.get $3 + i32.const -4 + i32.and + local.set $3 + i32.const -1 + i32.const 255 + i32.div_u + local.get $4 + i32.const 255 + i32.and + i32.mul + local.set $7 + local.get $5 + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.get $7 + i32.store + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 end + local.get $5 + i32.const 4 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 8 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 12 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 8 + i32.sub + local.get $7 + i32.store + local.get $3 + i32.const 24 + i32.le_u if - local.get $0 - local.get $3 - i32.const 1 - i32.shl - i32.add - local.set $4 - block $~lib/memory/memory.copy|inlined.3 - local.get $4 - i32.const 4 - i32.add - i32.const 2 - i32.add - local.set $5 - local.get $4 - i32.const 4 - i32.add - local.set $6 - i32.const 0 - local.get $2 - i32.sub - i32.const 1 - i32.shl - local.set $7 - local.get $5 - local.get $6 - local.get $7 - call $~lib/internal/memory/memmove - end - local.get $0 - local.get $3 - i32.const 1 - i32.shl - i32.add - i32.const 46 - i32.store16 offset=4 - local.get $1 - i32.const 1 - i32.add - return - else - i32.const -6 - local.get $3 - i32.lt_s - local.tee $4 - if (result i32) - local.get $3 - i32.const 0 - i32.le_s - else - local.get $4 - end - if - i32.const 2 + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 12 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 16 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 20 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 24 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 28 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 24 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 20 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 16 + i32.sub + local.get $7 + i32.store + i32.const 24 + local.get $5 + i32.const 4 + i32.and + i32.add + local.set $6 + local.get $5 + local.get $6 + i32.add + local.set $5 + local.get $3 + local.get $6 + i32.sub + local.set $3 + local.get $7 + i64.extend_i32_u + local.get $7 + i64.extend_i32_u + i64.const 32 + i64.shl + i64.or + local.set $8 + block $break|0 + loop $continue|0 local.get $3 - i32.sub - local.set $4 - block $~lib/memory/memory.copy|inlined.4 - local.get $0 - i32.const 4 + i32.const 32 + i32.ge_u + if + local.get $5 + local.get $8 + i64.store + local.get $5 + i32.const 8 i32.add - local.get $4 - i32.const 1 - i32.shl + local.get $8 + i64.store + local.get $5 + i32.const 16 i32.add - local.set $7 - local.get $0 - i32.const 4 + local.get $8 + i64.store + local.get $5 + i32.const 24 i32.add - local.set $6 - local.get $1 - i32.const 1 - i32.shl - local.set $5 - local.get $7 - local.get $6 + local.get $8 + i64.store + local.get $3 + i32.const 32 + i32.sub + local.set $3 local.get $5 - call $~lib/internal/memory/memmove - end - local.get $0 - i32.const 48 - i32.const 46 - i32.const 16 - i32.shl - i32.or - i32.store offset=4 - block $break|1 - i32.const 2 + i32.const 32 + i32.add local.set $5 - loop $repeat|1 - local.get $5 - local.get $4 - i32.lt_s - i32.eqz - br_if $break|1 - local.get $0 - local.get $5 - i32.const 1 - i32.shl - i32.add - i32.const 48 - i32.store16 offset=4 - local.get $5 - i32.const 1 - i32.add - local.set $5 - br $repeat|1 - unreachable - end - unreachable + br $continue|0 end - local.get $1 - local.get $4 - i32.add - return - else - local.get $1 - i32.const 1 - i32.eq - if - local.get $0 - i32.const 101 - i32.store16 offset=6 - block $~lib/internal/number/genExponent|inlined.0 (result i32) - local.get $0 - i32.const 4 - i32.add - local.set $4 - local.get $3 - i32.const 1 - i32.sub - local.set $5 - local.get $5 - i32.const 0 - i32.lt_s - local.set $6 - local.get $6 - if - i32.const 0 - local.get $5 - i32.sub - local.set $5 - end - local.get $5 - call $~lib/internal/number/decimalCount32 - i32.const 1 - i32.add - local.set $7 - block $~lib/internal/number/utoa32_core|inlined.4 - local.get $4 - local.set $8 - local.get $5 - local.set $9 - local.get $7 - local.set $10 - local.get $8 - local.get $9 - local.get $10 - call $~lib/internal/number/utoa32_lut - end - local.get $4 - i32.const 45 - i32.const 43 - local.get $6 - select - i32.store16 offset=4 - local.get $7 - end - local.set $1 - local.get $1 - i32.const 2 - i32.add - return - else - local.get $1 - i32.const 1 - i32.shl - local.set $7 - block $~lib/memory/memory.copy|inlined.5 - local.get $0 - i32.const 4 - i32.add - i32.const 4 - i32.add - local.set $6 - local.get $0 - i32.const 4 - i32.add - i32.const 2 - i32.add - local.set $5 - local.get $7 - i32.const 2 - i32.sub - local.set $4 - local.get $6 - local.get $5 - local.get $4 - call $~lib/internal/memory/memmove - end - local.get $0 - i32.const 46 - i32.store16 offset=6 - local.get $0 - local.get $7 - i32.add - i32.const 101 - i32.store16 offset=6 - local.get $1 - block $~lib/internal/number/genExponent|inlined.1 (result i32) - local.get $0 - local.get $7 - i32.add - i32.const 4 - i32.add - local.set $4 - local.get $3 - i32.const 1 - i32.sub - local.set $5 - local.get $5 - i32.const 0 - i32.lt_s - local.set $6 - local.get $6 - if - i32.const 0 - local.get $5 - i32.sub - local.set $5 - end - local.get $5 - call $~lib/internal/number/decimalCount32 - i32.const 1 - i32.add - local.set $10 - block $~lib/internal/number/utoa32_core|inlined.5 - local.get $4 - local.set $9 - local.get $5 - local.set $8 - local.get $10 - local.set $11 - local.get $9 - local.get $8 - local.get $11 - call $~lib/internal/number/utoa32_lut - end - local.get $4 - i32.const 45 - i32.const 43 - local.get $6 - select - i32.store16 offset=4 - local.get $10 - end - i32.add - local.set $1 - local.get $1 - i32.const 2 - i32.add - return - end - unreachable end - unreachable end - unreachable end - unreachable - unreachable ) - (func $~lib/internal/number/dtoa_core (; 62 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) - (local $2 i32) - (local $3 f64) + (func $~lib/array/ensureSize (; 59 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i64) - (local $7 i32) - (local $8 i64) - (local $9 i64) - (local $10 i64) - (local $11 i32) - (local $12 i64) - (local $13 i32) - (local $14 i32) - (local $15 i32) - (local $16 f64) - (local $17 i32) - (local $18 i32) - (local $19 i32) - (local $20 i32) - (local $21 i64) - (local $22 i64) - (local $23 i64) - (local $24 i64) - (local $25 i64) - (local $26 i64) - (local $27 i64) - (local $28 i64) - (local $29 i64) - (local $30 i64) - (local $31 i32) + (local $6 i32) + local.get $0 + i32.load offset=8 + local.set $3 local.get $1 - f64.const 0 - f64.lt - local.set $2 + local.get $3 local.get $2 + i32.shr_u + i32.gt_u if local.get $1 - f64.neg - local.set $1 - local.get $0 - i32.const 45 - i32.store16 offset=4 - end - block $~lib/internal/number/grisu2|inlined.0 (result i32) - local.get $1 - local.set $3 + i32.const 1073741808 + local.get $2 + i32.shr_u + i32.gt_u + if + i32.const 1832 + i32.const 2248 + i32.const 14 + i32.const 47 + call $~lib/builtins/abort + unreachable + end local.get $0 + i32.load local.set $4 + local.get $1 local.get $2 + i32.shl local.set $5 - local.get $3 - i64.reinterpret_f64 + local.get $4 + local.get $5 + call $~lib/rt/tlsf/__realloc local.set $6 local.get $6 - i64.const 9218868437227405312 - i64.and - i64.const 52 - i64.shr_u - i32.wrap_i64 - local.set $7 - local.get $6 - i64.const 4503599627370495 - i64.and - local.set $8 - local.get $7 + local.get $3 + i32.add i32.const 0 + local.get $5 + local.get $3 + i32.sub + call $~lib/memory/memory.fill + local.get $6 + local.get $4 i32.ne - i64.extend_i32_u - i64.const 52 - i64.shl - local.get $8 - i64.add - local.set $9 - local.get $7 - i32.const 1 - local.get $7 + if + local.get $0 + local.get $6 + call $~lib/rt/pure/__retain + i32.store + local.get $0 + local.get $6 + i32.store offset=4 + end + local.get $0 + local.get $5 + i32.store offset=8 + end + ) + (func $~lib/array/Array<~lib/string/String>#push (; 60 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.load offset=12 + local.set $2 + local.get $2 + i32.const 1 + i32.add + local.set $3 + local.get $0 + local.get $3 + i32.const 2 + call $~lib/array/ensureSize + local.get $0 + i32.load offset=4 + local.get $2 + i32.const 2 + i32.shl + i32.add + local.get $1 + call $~lib/rt/pure/__retain + i32.store + local.get $0 + local.get $3 + i32.store offset=12 + local.get $3 + local.set $4 + local.get $1 + call $~lib/rt/pure/__release + local.get $4 + ) + (func $~lib/string/String#split (; 61 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.const 0 + i32.ne + i32.eqz + if i32.const 0 - i32.ne - select - i32.const 1023 - i32.const 52 - i32.add - i32.sub - local.set $7 - block $~lib/internal/number/normalizedBoundaries|inlined.0 - local.get $9 - local.set $10 - local.get $7 - local.set $11 - local.get $10 - i64.const 1 - i64.shl - i64.const 1 - i64.add - local.set $12 - local.get $11 - i32.const 1 - i32.sub - local.set $13 - local.get $12 - i64.clz - i32.wrap_i64 - local.set $14 - local.get $12 - local.get $14 - i64.extend_i32_s - i64.shl - local.set $12 - local.get $13 - local.get $14 - i32.sub - local.set $13 + i32.const 456 + i32.const 357 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.eqz + if + i32.const 0 + i32.const 2 + i32.const 3 + i32.const 0 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + return + end + local.get $1 + i32.const 0 + i32.eq + if + block (result i32) i32.const 1 - local.get $10 - i64.const 4503599627370496 - i64.eq - i32.add - local.set $15 - local.get $12 - global.set $~lib/internal/number/_frc_plus - local.get $10 - local.get $15 - i64.extend_i32_s - i64.shl - i64.const 1 - i64.sub - local.get $11 - local.get $15 - i32.sub - local.get $13 - i32.sub - i64.extend_i32_s - i64.shl - global.set $~lib/internal/number/_frc_minus - local.get $13 - global.set $~lib/internal/number/_exp - end - block $~lib/internal/number/getCachedPower|inlined.0 - global.get $~lib/internal/number/_exp - local.set $15 - i32.const -61 - local.get $15 - i32.sub - f64.convert_i32_s - f64.const 0.30102999566398114 - f64.mul - f64.const 347 - f64.add - local.set $16 - local.get $16 - i32.trunc_f64_s - local.set $14 - local.get $14 - local.get $14 - f64.convert_i32_s - local.get $16 - f64.ne - i32.add - local.set $14 - local.get $14 + i32.const 2 i32.const 3 - i32.shr_s - i32.const 1 - i32.add - local.set $13 - i32.const 348 - local.get $13 + i32.const 0 + call $~lib/rt/__allocArray + local.set $3 + local.get $3 + i32.load offset=4 + local.set $4 + local.get $4 + local.get $0 + call $~lib/rt/pure/__retain + i32.store + local.get $3 + end + call $~lib/rt/pure/__retain + local.set $4 + local.get $1 + call $~lib/rt/pure/__release + local.get $4 + return + end + local.get $0 + call $~lib/string/String#get:length + local.set $5 + local.get $1 + call $~lib/string/String#get:length + local.set $6 + local.get $2 + i32.const 0 + i32.lt_s + if + global.get $~lib/builtins/i32.MAX_VALUE + local.set $2 + end + local.get $6 + i32.eqz + if + local.get $5 + i32.eqz + if + i32.const 0 + i32.const 2 i32.const 3 - i32.shl - i32.sub - global.set $~lib/internal/number/_K - i32.const 3768 - i32.load - local.set $11 - i32.const 4032 - i32.load - local.set $17 - block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i64) - local.get $11 - local.set $18 - local.get $13 - local.set $19 - i32.const 0 - local.set $20 - local.get $18 - local.get $19 - i32.const 3 + i32.const 0 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.set $4 + local.get $1 + call $~lib/rt/pure/__release + local.get $4 + return + end + local.get $5 + local.tee $4 + local.get $2 + local.tee $3 + local.get $4 + local.get $3 + i32.lt_s + select + local.set $5 + local.get $5 + i32.const 2 + i32.const 3 + i32.const 0 + call $~lib/rt/__allocArray + local.set $4 + local.get $4 + i32.load offset=4 + local.set $3 + block $break|0 + i32.const 0 + local.set $7 + loop $repeat|0 + local.get $7 + local.get $5 + i32.lt_s + i32.eqz + br_if $break|0 + i32.const 2 + i32.const 1 + call $~lib/rt/tlsf/__alloc + local.set $8 + local.get $8 + local.get $0 + local.get $7 + i32.const 1 + i32.shl + i32.add + i32.load16_u + i32.store16 + local.get $3 + local.get $7 + i32.const 2 i32.shl i32.add - local.get $20 + local.get $8 + i32.store + local.get $8 + call $~lib/rt/pure/__retain + drop + local.get $7 + i32.const 1 i32.add - i64.load offset=8 + local.set $7 + br $repeat|0 + unreachable end - global.set $~lib/internal/number/_frc_pow - block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) - local.get $17 - local.set $20 - local.get $13 - local.set $19 + unreachable + end + local.get $4 + call $~lib/rt/pure/__retain + local.set $8 + local.get $1 + call $~lib/rt/pure/__release + local.get $8 + return + else + local.get $5 + i32.eqz + if + i32.const 1 + i32.const 2 + i32.const 3 + i32.const 0 + call $~lib/rt/__allocArray + local.set $3 + local.get $3 + i32.load offset=4 + i32.const 120 + i32.store + local.get $3 + call $~lib/rt/pure/__retain + local.set $4 + local.get $1 + call $~lib/rt/pure/__release + local.get $4 + return + end + end + i32.const 0 + i32.const 2 + i32.const 3 + i32.const 0 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.set $9 + i32.const 0 + local.set $10 + i32.const 0 + local.set $11 + i32.const 0 + local.set $12 + block $break|1 + loop $continue|1 + local.get $0 + local.get $1 + local.get $11 + call $~lib/string/String#indexOf + local.tee $10 + i32.const -1 + i32.ne + if + local.get $10 + local.get $11 + i32.sub + local.set $3 + local.get $3 i32.const 0 - local.set $18 - local.get $20 - local.get $19 + i32.gt_s + if + local.get $3 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + local.set $4 + local.get $4 + local.get $0 + local.get $11 + i32.const 1 + i32.shl + i32.add + local.get $3 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $4 + call $~lib/array/Array<~lib/string/String>#push + drop + else + local.get $9 + i32.const 120 + call $~lib/array/Array<~lib/string/String>#push + drop + end + local.get $12 i32.const 1 - i32.shl i32.add - local.get $18 + local.tee $12 + local.get $2 + i32.eq + if + local.get $9 + local.set $4 + local.get $1 + call $~lib/rt/pure/__release + local.get $4 + return + end + local.get $10 + local.get $6 i32.add - i32.load16_s offset=8 + local.set $11 + br $continue|1 end - global.set $~lib/internal/number/_exp_pow end + end + local.get $11 + i32.eqz + if local.get $9 - i64.clz - i32.wrap_i64 - local.set $17 + local.get $0 + call $~lib/array/Array<~lib/string/String>#push + drop local.get $9 - local.get $17 - i64.extend_i32_s - i64.shl - local.set $9 - local.get $7 - local.get $17 - i32.sub - local.set $7 - global.get $~lib/internal/number/_frc_pow - local.set $12 - global.get $~lib/internal/number/_exp_pow - local.set $11 - block $~lib/internal/number/umul64f|inlined.0 (result i64) - local.get $9 - local.set $10 - local.get $12 - local.set $21 - local.get $10 - i64.const 4294967295 - i64.and - local.set $22 - local.get $21 - i64.const 4294967295 - i64.and - local.set $23 - local.get $10 - i64.const 32 - i64.shr_u - local.set $24 - local.get $21 - i64.const 32 - i64.shr_u - local.set $25 - local.get $22 - local.get $23 - i64.mul - local.set $26 - local.get $24 - local.get $23 - i64.mul - local.get $26 - i64.const 32 - i64.shr_u - i64.add - local.set $27 - local.get $22 - local.get $25 - i64.mul - local.get $27 - i64.const 4294967295 - i64.and - i64.add - local.set $28 - local.get $28 - i64.const 2147483647 - i64.add - local.set $28 - local.get $27 - i64.const 32 - i64.shr_u - local.set $27 - local.get $28 - i64.const 32 - i64.shr_u - local.set $28 - local.get $24 - local.get $25 - i64.mul - local.get $27 - i64.add - local.get $28 - i64.add - end - local.set $28 - block $~lib/internal/number/umul64e|inlined.0 (result i32) - local.get $7 - local.set $13 - local.get $11 - local.set $14 - local.get $13 - local.get $14 - i32.add - i32.const 64 - i32.add - end - local.set $14 - block $~lib/internal/number/umul64f|inlined.1 (result i64) - global.get $~lib/internal/number/_frc_plus - local.set $27 - local.get $12 - local.set $26 - local.get $27 - i64.const 4294967295 - i64.and - local.set $25 - local.get $26 - i64.const 4294967295 - i64.and - local.set $24 - local.get $27 - i64.const 32 - i64.shr_u - local.set $23 - local.get $26 - i64.const 32 - i64.shr_u - local.set $22 - local.get $25 - local.get $24 - i64.mul - local.set $21 - local.get $23 - local.get $24 - i64.mul - local.get $21 - i64.const 32 - i64.shr_u - i64.add - local.set $10 - local.get $25 - local.get $22 - i64.mul - local.get $10 - i64.const 4294967295 - i64.and - i64.add - local.set $29 - local.get $29 - i64.const 2147483647 - i64.add - local.set $29 - local.get $10 - i64.const 32 - i64.shr_u - local.set $10 - local.get $29 - i64.const 32 - i64.shr_u - local.set $29 - local.get $23 - local.get $22 - i64.mul - local.get $10 - i64.add - local.get $29 - i64.add - end - i64.const 1 - i64.sub - local.set $29 - block $~lib/internal/number/umul64e|inlined.1 (result i32) - global.get $~lib/internal/number/_exp - local.set $13 - local.get $11 - local.set $15 - local.get $13 - local.get $15 - i32.add - i32.const 64 - i32.add - end - local.set $15 - block $~lib/internal/number/umul64f|inlined.2 (result i64) - global.get $~lib/internal/number/_frc_minus - local.set $10 - local.get $12 - local.set $21 - local.get $10 - i64.const 4294967295 - i64.and - local.set $22 - local.get $21 - i64.const 4294967295 - i64.and - local.set $23 - local.get $10 - i64.const 32 - i64.shr_u - local.set $24 - local.get $21 - i64.const 32 - i64.shr_u - local.set $25 - local.get $22 - local.get $23 - i64.mul - local.set $26 - local.get $24 - local.get $23 - i64.mul - local.get $26 - i64.const 32 - i64.shr_u - i64.add - local.set $27 - local.get $22 - local.get $25 - i64.mul - local.get $27 - i64.const 4294967295 - i64.and - i64.add - local.set $30 - local.get $30 - i64.const 2147483647 - i64.add - local.set $30 - local.get $27 - i64.const 32 - i64.shr_u - local.set $27 - local.get $30 - i64.const 32 - i64.shr_u - local.set $30 - local.get $24 - local.get $25 - i64.mul - local.get $27 - i64.add - local.get $30 - i64.add - end - i64.const 1 - i64.add - local.set $30 - local.get $29 - local.get $30 - i64.sub - local.set $27 - local.get $4 - local.get $28 - local.get $14 - local.get $29 - local.get $15 - local.get $27 - local.get $5 - call $~lib/internal/number/genDigits + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + return + end + local.get $5 + local.get $11 + i32.sub + local.set $13 + local.get $13 + i32.const 0 + i32.gt_s + if + local.get $13 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + local.set $3 + local.get $3 + local.get $0 + local.get $11 + i32.const 1 + i32.shl + i32.add + local.get $13 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $9 + local.get $3 + call $~lib/array/Array<~lib/string/String>#push + drop + else + local.get $9 + i32.const 120 + call $~lib/array/Array<~lib/string/String>#push + drop end - local.set $31 + local.get $9 + local.set $3 + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $~lib/array/Array<~lib/string/String>#get:length (; 62 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - local.get $2 - i32.const 1 + i32.load offset=12 + ) + (func $~lib/array/Array<~lib/string/String>#__unchecked_get (; 63 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 i32.shl i32.add - local.get $31 - local.get $2 - i32.sub - global.get $~lib/internal/number/_K - call $~lib/internal/number/prettify - local.set $31 - local.get $31 - local.get $2 - i32.add + i32.load + call $~lib/rt/pure/__retain ) - (func $~lib/string/String#substring (; 63 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) + (func $~lib/array/Array<~lib/string/String>#__get (; 64 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 local.get $0 - i32.const 0 - i32.ne - i32.eqz + i32.load offset=12 + i32.ge_u if - i32.const 0 - i32.const 80 - i32.const 254 - i32.const 4 - call $~lib/env/abort + i32.const 2296 + i32.const 2248 + i32.const 106 + i32.const 45 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ge_u + if + i32.const 232 + i32.const 2248 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort unreachable end local.get $0 - i32.load - local.set $3 local.get $1 - local.tee $4 - i32.const 0 - local.tee $5 - local.get $4 - local.get $5 - i32.gt_s - select - local.tee $4 - local.get $3 - local.tee $5 - local.get $4 - local.get $5 - i32.lt_s - select - local.set $6 - local.get $2 - local.tee $4 - i32.const 0 - local.tee $5 - local.get $4 - local.get $5 - i32.gt_s - select - local.tee $4 - local.get $3 - local.tee $5 - local.get $4 - local.get $5 - i32.lt_s - select - local.set $7 - local.get $6 - local.tee $4 - local.get $7 - local.tee $5 - local.get $4 - local.get $5 - i32.lt_s - select - local.set $8 - local.get $6 - local.tee $4 - local.get $7 - local.tee $5 - local.get $4 - local.get $5 - i32.gt_s - select - local.set $9 - local.get $9 - local.get $8 - i32.sub - local.set $3 - local.get $3 - i32.eqz + call $~lib/array/Array<~lib/string/String>#__unchecked_get + ) + (func $~lib/util/number/decimalCount32 (; 65 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + i32.const 100000 + i32.lt_u if - i32.const 112 - return - end - local.get $8 - i32.eqz - local.tee $4 - if (result i32) - local.get $9 local.get $0 - i32.load - i32.eq + i32.const 100 + i32.lt_u + if + i32.const 1 + i32.const 2 + local.get $0 + i32.const 10 + i32.lt_u + select + return + else + i32.const 4 + i32.const 5 + local.get $0 + i32.const 10000 + i32.lt_u + select + local.set $1 + i32.const 3 + local.get $1 + local.get $0 + i32.const 1000 + i32.lt_u + select + return + end + unreachable + unreachable else - local.get $4 + local.get $0 + i32.const 10000000 + i32.lt_u + if + i32.const 6 + i32.const 7 + local.get $0 + i32.const 1000000 + i32.lt_u + select + return + else + i32.const 9 + i32.const 10 + local.get $0 + i32.const 1000000000 + i32.lt_u + select + local.set $1 + i32.const 8 + local.get $1 + local.get $0 + i32.const 100000000 + i32.lt_u + select + return + end + unreachable + unreachable + end + unreachable + unreachable + ) + (func $~lib/util/number/utoa32_lut (; 66 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i64) + (local $9 i64) + i32.const 2904 + i32.load offset=4 + local.set $3 + block $break|0 + loop $continue|0 + local.get $1 + i32.const 10000 + i32.ge_u + if + local.get $1 + i32.const 10000 + i32.div_u + local.set $4 + local.get $1 + i32.const 10000 + i32.rem_u + local.set $5 + local.get $4 + local.set $1 + local.get $5 + i32.const 100 + i32.div_u + local.set $6 + local.get $5 + i32.const 100 + i32.rem_u + local.set $7 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $8 + local.get $3 + local.get $7 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $9 + local.get $2 + i32.const 4 + i32.sub + local.set $2 + local.get $0 + local.get $2 + i32.const 1 + i32.shl + i32.add + local.get $8 + local.get $9 + i64.const 32 + i64.shl + i64.or + i64.store + br $continue|0 + end + end + end + local.get $1 + i32.const 100 + i32.ge_u + if + local.get $1 + i32.const 100 + i32.div_u + local.set $7 + local.get $1 + i32.const 100 + i32.rem_u + local.set $6 + local.get $7 + local.set $1 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $5 + local.get $0 + local.get $2 + i32.const 1 + i32.shl + i32.add + local.get $5 + i32.store end + local.get $1 + i32.const 10 + i32.ge_u if + local.get $2 + i32.const 2 + i32.sub + local.set $2 + local.get $3 + local.get $1 + i32.const 2 + i32.shl + i32.add + i32.load + local.set $5 local.get $0 - return + local.get $2 + i32.const 1 + i32.shl + i32.add + local.get $5 + i32.store + else + local.get $2 + i32.const 1 + i32.sub + local.set $2 + i32.const 48 + local.get $1 + i32.add + local.set $5 + local.get $0 + local.get $2 + i32.const 1 + i32.shl + i32.add + local.get $5 + i32.store16 end - local.get $3 - call $~lib/internal/string/allocateUnsafe - local.set $10 - local.get $10 - i32.const 0 - local.get $0 - local.get $8 - local.get $3 - call $~lib/internal/string/copyUnsafe - local.get $10 ) - (func $~lib/internal/number/dtoa (; 64 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + (func $~lib/util/number/itoa32 (; 67 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + (local $6 i32) local.get $0 - f64.const 0 - f64.eq + i32.eqz if - i32.const 2664 + i32.const 1040 + call $~lib/rt/pure/__retain return end local.get $0 - call $~lib/builtins/isFinite - i32.eqz + i32.const 0 + i32.lt_s + local.set $1 + local.get $1 if + i32.const 0 local.get $0 - call $~lib/builtins/isNaN - if - i32.const 2680 - return - end - i32.const 2696 - i32.const 2720 - local.get $0 - f64.const 0 - f64.lt - select - return + i32.sub + local.set $0 end - i32.const 28 - call $~lib/internal/string/allocateUnsafe - local.set $1 - local.get $1 local.get $0 - call $~lib/internal/number/dtoa_core - local.set $2 + call $~lib/util/number/decimalCount32 local.get $1 - i32.const 0 + i32.add + local.set $2 local.get $2 - call $~lib/string/String#substring + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc local.set $3 - block $~lib/internal/string/freeUnsafe|inlined.0 - local.get $1 + block $~lib/util/number/utoa32_core|inlined.0 + local.get $3 + local.set $6 + local.get $0 + local.set $5 + local.get $2 local.set $4 + local.get $6 + local.get $5 local.get $4 - i32.eqz - if - i32.const 0 - i32.const 136 - i32.const 28 - i32.const 4 - call $~lib/env/abort - unreachable - end - block $~lib/memory/memory.free|inlined.1 - local.get $4 - local.set $5 - local.get $5 - call $~lib/allocator/arena/__memory_free - br $~lib/memory/memory.free|inlined.1 - end + call $~lib/util/number/utoa32_lut + end + local.get $1 + if + local.get $3 + i32.const 45 + i32.store16 end local.get $3 + call $~lib/rt/pure/__retain ) - (func $start:std/string (; 65 ;) (type $FUNCSIG$v) - (local $0 i32) + (func $~lib/util/number/utoa32 (; 68 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - call $start:~lib/allocator/arena - global.get $std/string/str - i32.const 8 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 48 - i32.const 16 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/string/str - i32.load - i32.const 16 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 48 - i32.const 18 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/string/str - i32.const 0 - call $~lib/string/String#charCodeAt - i32.const 104 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 48 - i32.const 19 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 112 - call $~lib/string/String.__not - i32.eqz - i32.const 0 - i32.eq + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 i32.eqz if - i32.const 0 - i32.const 48 - i32.const 21 - i32.const 0 - call $~lib/env/abort - unreachable + i32.const 1040 + call $~lib/rt/pure/__retain + return end - i32.const 120 - call $~lib/string/String.__not - i32.eqz + local.get $0 + call $~lib/util/number/decimalCount32 + local.set $1 + local.get $1 i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 48 - i32.const 22 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 128 - call $~lib/string/String.__not - i32.eqz + i32.shl i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 48 - i32.const 23 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 0 - call $~lib/string/String.fromCharCode - i32.const 120 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 48 - i32.const 25 - i32.const 0 - call $~lib/env/abort - unreachable + call $~lib/rt/tlsf/__alloc + local.set $2 + block $~lib/util/number/utoa32_core|inlined.1 + local.get $2 + local.set $5 + local.get $0 + local.set $4 + local.get $1 + local.set $3 + local.get $5 + local.get $4 + local.get $3 + call $~lib/util/number/utoa32_lut end - i32.const 54 - call $~lib/string/String.fromCharCode - i32.const 192 - call $~lib/string/String.__eq - i32.eqz + local.get $2 + call $~lib/rt/pure/__retain + ) + (func $~lib/util/number/decimalCount64 (; 69 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (local $1 i32) + local.get $0 + i64.const 1000000000000000 + i64.lt_u if - i32.const 0 - i32.const 48 - i32.const 26 - i32.const 0 - call $~lib/env/abort + local.get $0 + i64.const 1000000000000 + i64.lt_u + if + i32.const 11 + i32.const 12 + local.get $0 + i64.const 100000000000 + i64.lt_u + select + return + else + i32.const 14 + i32.const 15 + local.get $0 + i64.const 100000000000000 + i64.lt_u + select + local.set $1 + i32.const 13 + local.get $1 + local.get $0 + i64.const 10000000000000 + i64.lt_u + select + return + end unreachable - end - i32.const 65536 - i32.const 54 - i32.add - call $~lib/string/String.fromCharCode - i32.const 192 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 48 - i32.const 27 - i32.const 0 - call $~lib/env/abort unreachable - end - i32.const 0 - call $~lib/string/String.fromCodePoint - i32.const 120 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 48 - i32.const 29 - i32.const 0 - call $~lib/env/abort + else + local.get $0 + i64.const 100000000000000000 + i64.lt_u + if + i32.const 16 + i32.const 17 + local.get $0 + i64.const 10000000000000000 + i64.lt_u + select + return + else + i32.const 19 + i32.const 20 + local.get $0 + i64.const -8446744073709551616 + i64.lt_u + select + local.set $1 + i32.const 18 + local.get $1 + local.get $0 + i64.const 1000000000000000000 + i64.lt_u + select + return + end unreachable - end - i32.const 54 - call $~lib/string/String.fromCodePoint - i32.const 192 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 48 - i32.const 30 - i32.const 0 - call $~lib/env/abort unreachable end - i32.const 119558 - call $~lib/string/String.fromCodePoint - i32.eqz - if - i32.const 200 - i32.const 48 - i32.const 31 - i32.const 0 - call $~lib/env/abort - unreachable + unreachable + unreachable + ) + (func $~lib/util/number/utoa64_lut (; 70 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) + (local $3 i32) + (local $4 i64) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i64) + (local $13 i64) + i32.const 2904 + i32.load offset=4 + local.set $3 + block $break|0 + loop $continue|0 + local.get $1 + i64.const 100000000 + i64.ge_u + if + local.get $1 + i64.const 100000000 + i64.div_u + local.set $4 + local.get $1 + local.get $4 + i64.const 100000000 + i64.mul + i64.sub + i32.wrap_i64 + local.set $5 + local.get $4 + local.set $1 + local.get $5 + i32.const 10000 + i32.div_u + local.set $6 + local.get $5 + i32.const 10000 + i32.rem_u + local.set $7 + local.get $6 + i32.const 100 + i32.div_u + local.set $8 + local.get $6 + i32.const 100 + i32.rem_u + local.set $9 + local.get $7 + i32.const 100 + i32.div_u + local.set $10 + local.get $7 + i32.const 100 + i32.rem_u + local.set $11 + local.get $3 + local.get $10 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $12 + local.get $3 + local.get $11 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $13 + local.get $2 + i32.const 4 + i32.sub + local.set $2 + local.get $0 + local.get $2 + i32.const 1 + i32.shl + i32.add + local.get $12 + local.get $13 + i64.const 32 + i64.shl + i64.or + i64.store + local.get $3 + local.get $8 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $12 + local.get $3 + local.get $9 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.set $13 + local.get $2 + i32.const 4 + i32.sub + local.set $2 + local.get $0 + local.get $2 + i32.const 1 + i32.shl + i32.add + local.get $12 + local.get $13 + i64.const 32 + i64.shl + i64.or + i64.store + br $continue|0 + end + end end - global.get $std/string/str - i32.const 208 - i32.const 0 - call $~lib/string/String#startsWith - i32.eqz + local.get $0 + local.get $1 + i32.wrap_i64 + local.get $2 + call $~lib/util/number/utoa32_lut + ) + (func $~lib/util/number/utoa64 (; 71 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i64) + local.get $0 + i64.eqz if - i32.const 0 - i32.const 48 - i32.const 33 - i32.const 0 - call $~lib/env/abort - unreachable + i32.const 1040 + call $~lib/rt/pure/__retain + return end - block (result i32) + local.get $0 + i64.const 4294967295 + i64.le_u + if + local.get $0 + i32.wrap_i64 + local.set $2 + local.get $2 + call $~lib/util/number/decimalCount32 + local.set $3 + local.get $3 i32.const 1 - global.set $~lib/argc - global.get $std/string/str - i32.const 232 - i32.const 0 - call $~lib/string/String#endsWith|trampoline + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + local.set $1 + block $~lib/util/number/utoa32_core|inlined.2 + local.get $1 + local.set $6 + local.get $2 + local.set $5 + local.get $3 + local.set $4 + local.get $6 + local.get $5 + local.get $4 + call $~lib/util/number/utoa32_lut + end + else + local.get $0 + call $~lib/util/number/decimalCount64 + local.set $3 + local.get $3 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + local.set $1 + block $~lib/util/number/utoa64_core|inlined.0 + local.get $1 + local.set $5 + local.get $0 + local.set $7 + local.get $3 + local.set $4 + local.get $5 + local.get $7 + local.get $4 + call $~lib/util/number/utoa64_lut + end end - i32.eqz + local.get $1 + call $~lib/rt/pure/__retain + ) + (func $~lib/util/number/itoa64 (; 72 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i64) + local.get $0 + i64.eqz if - i32.const 0 - i32.const 48 - i32.const 34 - i32.const 0 - call $~lib/env/abort - unreachable + i32.const 1040 + call $~lib/rt/pure/__retain + return end - block $~lib/string/String#includes|inlined.0 (result i32) - global.get $std/string/str + local.get $0 + i64.const 0 + i64.lt_s + local.set $1 + local.get $1 + if + i64.const 0 + local.get $0 + i64.sub local.set $0 - i32.const 248 - local.set $1 - i32.const 0 + end + local.get $0 + i64.const 4294967295 + i64.le_u + if + local.get $0 + i32.wrap_i64 + local.set $3 + local.get $3 + call $~lib/util/number/decimalCount32 + local.get $1 + i32.add + local.set $4 + local.get $4 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc local.set $2 + block $~lib/util/number/utoa32_core|inlined.3 + local.get $2 + local.set $7 + local.get $3 + local.set $6 + local.get $4 + local.set $5 + local.get $7 + local.get $6 + local.get $5 + call $~lib/util/number/utoa32_lut + end + else local.get $0 + call $~lib/util/number/decimalCount64 local.get $1 - local.get $2 - call $~lib/string/String#indexOf - i32.const -1 - i32.ne - end - i32.const 0 - i32.ne - i32.eqz - if - i32.const 0 - i32.const 48 - i32.const 35 - i32.const 0 - call $~lib/env/abort - unreachable - end - block (result i32) + i32.add + local.set $4 + local.get $4 i32.const 1 - global.set $~lib/argc - global.get $std/string/str - i32.const 0 - i32.const 0 - call $~lib/string/String#padStart|trampoline + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + local.set $2 + block $~lib/util/number/utoa64_core|inlined.1 + local.get $2 + local.set $6 + local.get $0 + local.set $8 + local.get $4 + local.set $5 + local.get $6 + local.get $8 + local.get $5 + call $~lib/util/number/utoa64_lut + end end - global.get $std/string/str - call $~lib/string/String.__eq - i32.eqz + local.get $1 if - i32.const 0 - i32.const 48 - i32.const 37 - i32.const 0 - call $~lib/env/abort - unreachable + local.get $2 + i32.const 45 + i32.store16 end - block (result i32) - i32.const 1 - global.set $~lib/argc - global.get $std/string/str - i32.const 15 - i32.const 0 - call $~lib/string/String#padStart|trampoline + local.get $2 + call $~lib/rt/pure/__retain + ) + (func $~lib/builtins/isFinite (; 73 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + local.get $0 + f64.sub + f64.const 0 + f64.eq + ) + (func $~lib/builtins/isNaN (; 74 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + local.get $0 + f64.ne + ) + (func $~lib/array/Array#__unchecked_get (; 75 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 3 + i32.shl + i32.add + i64.load + ) + (func $~lib/array/Array#__unchecked_get (; 76 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 1 + i32.shl + i32.add + i32.load16_s + ) + (func $~lib/util/number/genDigits (; 77 ;) (type $FUNCSIG$iijijiji) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (param $6 i32) (result i32) + (local $7 i32) + (local $8 i64) + (local $9 i64) + (local $10 i64) + (local $11 i32) + (local $12 i32) + (local $13 i64) + (local $14 i32) + (local $15 i32) + (local $16 i32) + (local $17 i32) + (local $18 i32) + (local $19 i64) + (local $20 i64) + (local $21 i64) + (local $22 i64) + (local $23 i64) + (local $24 i32) + (local $25 i32) + (local $26 i32) + i32.const 0 + local.get $4 + i32.sub + local.set $7 + i64.const 1 + local.get $7 + i64.extend_i32_s + i64.shl + local.set $8 + local.get $8 + i64.const 1 + i64.sub + local.set $9 + local.get $3 + local.get $1 + i64.sub + local.set $10 + local.get $4 + local.set $11 + local.get $3 + local.get $7 + i64.extend_i32_s + i64.shr_u + i32.wrap_i64 + local.set $12 + local.get $3 + local.get $9 + i64.and + local.set $13 + local.get $12 + call $~lib/util/number/decimalCount32 + local.set $14 + local.get $6 + local.set $15 + i32.const 5272 + i32.load offset=4 + local.set $16 + block $break|0 + loop $continue|0 + local.get $14 + i32.const 0 + i32.gt_s + if + block $break|1 + block $case10|1 + block $case9|1 + block $case8|1 + block $case7|1 + block $case6|1 + block $case5|1 + block $case4|1 + block $case3|1 + block $case2|1 + block $case1|1 + block $case0|1 + local.get $14 + local.set $18 + local.get $18 + i32.const 10 + i32.eq + br_if $case0|1 + local.get $18 + i32.const 9 + i32.eq + br_if $case1|1 + local.get $18 + i32.const 8 + i32.eq + br_if $case2|1 + local.get $18 + i32.const 7 + i32.eq + br_if $case3|1 + local.get $18 + i32.const 6 + i32.eq + br_if $case4|1 + local.get $18 + i32.const 5 + i32.eq + br_if $case5|1 + local.get $18 + i32.const 4 + i32.eq + br_if $case6|1 + local.get $18 + i32.const 3 + i32.eq + br_if $case7|1 + local.get $18 + i32.const 2 + i32.eq + br_if $case8|1 + local.get $18 + i32.const 1 + i32.eq + br_if $case9|1 + br $case10|1 + end + block + local.get $12 + i32.const 1000000000 + i32.div_u + local.set $17 + local.get $12 + i32.const 1000000000 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable + end + block + local.get $12 + i32.const 100000000 + i32.div_u + local.set $17 + local.get $12 + i32.const 100000000 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable + end + block + local.get $12 + i32.const 10000000 + i32.div_u + local.set $17 + local.get $12 + i32.const 10000000 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable + end + block + local.get $12 + i32.const 1000000 + i32.div_u + local.set $17 + local.get $12 + i32.const 1000000 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable + end + block + local.get $12 + i32.const 100000 + i32.div_u + local.set $17 + local.get $12 + i32.const 100000 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable + end + block + local.get $12 + i32.const 10000 + i32.div_u + local.set $17 + local.get $12 + i32.const 10000 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable + end + block + local.get $12 + i32.const 1000 + i32.div_u + local.set $17 + local.get $12 + i32.const 1000 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable + end + block + local.get $12 + i32.const 100 + i32.div_u + local.set $17 + local.get $12 + i32.const 100 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable + end + block + local.get $12 + i32.const 10 + i32.div_u + local.set $17 + local.get $12 + i32.const 10 + i32.rem_u + local.set $12 + br $break|1 + unreachable + end + unreachable + end + block + local.get $12 + local.set $17 + i32.const 0 + local.set $12 + br $break|1 + unreachable + end + unreachable + end + block + i32.const 0 + local.set $17 + br $break|1 + unreachable + end + unreachable + end + local.get $17 + local.get $15 + i32.or + if + local.get $0 + block (result i32) + local.get $15 + local.tee $18 + i32.const 1 + i32.add + local.set $15 + local.get $18 + end + i32.const 1 + i32.shl + i32.add + i32.const 48 + local.get $17 + i32.const 65535 + i32.and + i32.add + i32.store16 + end + local.get $14 + i32.const 1 + i32.sub + local.set $14 + local.get $12 + i64.extend_i32_u + local.get $7 + i64.extend_i32_s + i64.shl + local.get $13 + i64.add + local.set $19 + local.get $19 + local.get $5 + i64.le_u + if + global.get $~lib/util/number/_K + local.get $14 + i32.add + global.set $~lib/util/number/_K + block $~lib/util/number/grisuRound|inlined.0 + local.get $0 + local.set $24 + local.get $15 + local.set $18 + local.get $5 + local.set $23 + local.get $19 + local.set $22 + local.get $16 + local.get $14 + i32.const 2 + i32.shl + i32.add + i64.load32_u + local.get $7 + i64.extend_i32_s + i64.shl + local.set $21 + local.get $10 + local.set $20 + local.get $24 + local.get $18 + i32.const 1 + i32.sub + i32.const 1 + i32.shl + i32.add + local.set $25 + local.get $25 + i32.load16_u + local.set $26 + block $break|2 + loop $continue|2 + local.get $22 + local.get $20 + i64.lt_u + if (result i32) + local.get $23 + local.get $22 + i64.sub + local.get $21 + i64.ge_u + else + i32.const 0 + end + if (result i32) + local.get $22 + local.get $21 + i64.add + local.get $20 + i64.lt_u + if (result i32) + i32.const 1 + else + local.get $20 + local.get $22 + i64.sub + local.get $22 + local.get $21 + i64.add + local.get $20 + i64.sub + i64.gt_u + end + else + i32.const 0 + end + if + local.get $26 + i32.const 1 + i32.sub + local.set $26 + local.get $22 + local.get $21 + i64.add + local.set $22 + br $continue|2 + end + end + end + local.get $25 + local.get $26 + i32.store16 + end + local.get $15 + return + end + br $continue|0 + end + end + end + block $break|3 + loop $continue|3 + i32.const 1 + if + local.get $13 + i64.const 10 + i64.mul + local.set $13 + local.get $5 + i64.const 10 + i64.mul + local.set $5 + local.get $13 + local.get $7 + i64.extend_i32_s + i64.shr_u + local.set $19 + local.get $19 + local.get $15 + i64.extend_i32_s + i64.or + i64.const 0 + i64.ne + if + local.get $0 + block (result i32) + local.get $15 + local.tee $17 + i32.const 1 + i32.add + local.set $15 + local.get $17 + end + i32.const 1 + i32.shl + i32.add + i32.const 48 + local.get $19 + i32.wrap_i64 + i32.const 65535 + i32.and + i32.add + i32.store16 + end + local.get $13 + local.get $9 + i64.and + local.set $13 + local.get $14 + i32.const 1 + i32.sub + local.set $14 + local.get $13 + local.get $5 + i64.lt_u + if + global.get $~lib/util/number/_K + local.get $14 + i32.add + global.set $~lib/util/number/_K + local.get $10 + local.get $16 + i32.const 0 + local.get $14 + i32.sub + i32.const 2 + i32.shl + i32.add + i64.load32_u + i64.mul + local.set $10 + block $~lib/util/number/grisuRound|inlined.1 + local.get $0 + local.set $24 + local.get $15 + local.set $18 + local.get $5 + local.set $23 + local.get $13 + local.set $22 + local.get $8 + local.set $21 + local.get $10 + local.set $20 + local.get $24 + local.get $18 + i32.const 1 + i32.sub + i32.const 1 + i32.shl + i32.add + local.set $17 + local.get $17 + i32.load16_u + local.set $26 + block $break|4 + loop $continue|4 + local.get $22 + local.get $20 + i64.lt_u + if (result i32) + local.get $23 + local.get $22 + i64.sub + local.get $21 + i64.ge_u + else + i32.const 0 + end + if (result i32) + local.get $22 + local.get $21 + i64.add + local.get $20 + i64.lt_u + if (result i32) + i32.const 1 + else + local.get $20 + local.get $22 + i64.sub + local.get $22 + local.get $21 + i64.add + local.get $20 + i64.sub + i64.gt_u + end + else + i32.const 0 + end + if + local.get $26 + i32.const 1 + i32.sub + local.set $26 + local.get $22 + local.get $21 + i64.add + local.set $22 + br $continue|4 + end + end + end + local.get $17 + local.get $26 + i32.store16 + end + local.get $15 + return + end + br $continue|3 + end + end end - global.get $std/string/str - call $~lib/string/String.__eq + local.get $15 + ) + (func $~lib/util/number/prettify (; 78 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $2 i32.eqz if - i32.const 0 - i32.const 48 - i32.const 38 - i32.const 0 - call $~lib/env/abort - unreachable - end - block (result i32) + local.get $0 + local.get $1 i32.const 1 - global.set $~lib/argc - i32.const 112 - i32.const 3 - i32.const 0 - call $~lib/string/String#padStart|trampoline - end - i32.const 272 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 + i32.shl + i32.add + i32.const 46 i32.const 48 - i32.const 39 - i32.const 0 - call $~lib/env/abort - unreachable + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 2 + i32.add + return end - i32.const 112 - i32.const 10 - i32.const 112 - call $~lib/string/String#padStart - i32.const 112 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 48 - i32.const 40 + local.get $1 + local.get $2 + i32.add + local.set $3 + local.get $1 + local.get $3 + i32.le_s + if (result i32) + local.get $3 + i32.const 21 + i32.le_s + else i32.const 0 - call $~lib/env/abort - unreachable end - i32.const 128 - i32.const 100 - i32.const 112 - call $~lib/string/String#padStart - i32.const 128 - call $~lib/string/String.__eq - i32.eqz if - i32.const 0 - i32.const 48 - i32.const 41 - i32.const 0 - call $~lib/env/abort - unreachable - end - block (result i32) + block $break|0 + local.get $1 + local.set $4 + loop $repeat|0 + local.get $4 + local.get $3 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $0 + local.get $4 + i32.const 1 + i32.shl + i32.add + i32.const 48 + i32.store16 + local.get $4 + i32.const 1 + i32.add + local.set $4 + br $repeat|0 + unreachable + end + unreachable + end + local.get $0 + local.get $3 i32.const 1 - global.set $~lib/argc - i32.const 288 - i32.const 5 - i32.const 0 - call $~lib/string/String#padStart|trampoline - end - i32.const 304 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 48 - i32.const 42 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 288 - i32.const 6 - i32.const 320 - call $~lib/string/String#padStart - i32.const 336 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 48 - i32.const 43 - i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 288 - i32.const 8 - i32.const 320 - call $~lib/string/String#padStart - i32.const 352 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 + i32.shl + i32.add + i32.const 46 i32.const 48 - i32.const 44 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $3 + i32.const 2 + i32.add + return + else + local.get $3 i32.const 0 - call $~lib/env/abort + i32.gt_s + if (result i32) + local.get $3 + i32.const 21 + i32.le_s + else + i32.const 0 + end + if + local.get $0 + local.get $3 + i32.const 1 + i32.shl + i32.add + local.set $4 + local.get $4 + i32.const 2 + i32.add + local.get $4 + i32.const 0 + local.get $2 + i32.sub + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $0 + local.get $3 + i32.const 1 + i32.shl + i32.add + i32.const 46 + i32.store16 + local.get $1 + i32.const 1 + i32.add + return + else + i32.const -6 + local.get $3 + i32.lt_s + if (result i32) + local.get $3 + i32.const 0 + i32.le_s + else + i32.const 0 + end + if + i32.const 2 + local.get $3 + i32.sub + local.set $4 + local.get $0 + local.get $4 + i32.const 1 + i32.shl + i32.add + local.get $0 + local.get $1 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $0 + i32.const 48 + i32.const 46 + i32.const 16 + i32.shl + i32.or + i32.store + block $break|1 + i32.const 2 + local.set $5 + loop $repeat|1 + local.get $5 + local.get $4 + i32.lt_s + i32.eqz + br_if $break|1 + local.get $0 + local.get $5 + i32.const 1 + i32.shl + i32.add + i32.const 48 + i32.store16 + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|1 + unreachable + end + unreachable + end + local.get $1 + local.get $4 + i32.add + return + else + local.get $1 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 101 + i32.store16 offset=2 + block $~lib/util/number/genExponent|inlined.0 (result i32) + local.get $0 + i32.const 4 + i32.add + local.set $4 + local.get $3 + i32.const 1 + i32.sub + local.set $5 + local.get $5 + i32.const 0 + i32.lt_s + local.set $6 + local.get $6 + if + i32.const 0 + local.get $5 + i32.sub + local.set $5 + end + local.get $5 + call $~lib/util/number/decimalCount32 + i32.const 1 + i32.add + local.set $7 + block $~lib/util/number/utoa32_core|inlined.4 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $10 + local.get $9 + local.get $8 + call $~lib/util/number/utoa32_lut + end + local.get $4 + i32.const 45 + i32.const 43 + local.get $6 + select + i32.store16 + local.get $7 + end + local.set $1 + local.get $1 + i32.const 2 + i32.add + return + else + local.get $1 + i32.const 1 + i32.shl + local.set $7 + local.get $0 + i32.const 4 + i32.add + local.get $0 + i32.const 2 + i32.add + local.get $7 + i32.const 2 + i32.sub + call $~lib/memory/memory.copy + local.get $0 + i32.const 46 + i32.store16 offset=2 + local.get $0 + local.get $7 + i32.add + i32.const 101 + i32.store16 offset=2 + local.get $1 + block $~lib/util/number/genExponent|inlined.1 (result i32) + local.get $0 + local.get $7 + i32.add + i32.const 4 + i32.add + local.set $9 + local.get $3 + i32.const 1 + i32.sub + local.set $8 + local.get $8 + i32.const 0 + i32.lt_s + local.set $6 + local.get $6 + if + i32.const 0 + local.get $8 + i32.sub + local.set $8 + end + local.get $8 + call $~lib/util/number/decimalCount32 + i32.const 1 + i32.add + local.set $4 + block $~lib/util/number/utoa32_core|inlined.5 + local.get $9 + local.set $11 + local.get $8 + local.set $5 + local.get $4 + local.set $10 + local.get $11 + local.get $5 + local.get $10 + call $~lib/util/number/utoa32_lut + end + local.get $9 + i32.const 45 + i32.const 43 + local.get $6 + select + i32.store16 + local.get $4 + end + i32.add + local.set $1 + local.get $1 + i32.const 2 + i32.add + return + end + unreachable + end + unreachable + end unreachable end - block (result i32) - i32.const 1 - global.set $~lib/argc - global.get $std/string/str - i32.const 0 - i32.const 0 - call $~lib/string/String#padEnd|trampoline - end - global.get $std/string/str - call $~lib/string/String.__eq - i32.eqz + unreachable + unreachable + ) + (func $~lib/util/number/dtoa_core (; 79 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 f64) + (local $6 i64) + (local $7 i32) + (local $8 i64) + (local $9 i64) + (local $10 i32) + (local $11 i64) + (local $12 i64) + (local $13 i32) + (local $14 i32) + (local $15 i32) + (local $16 f64) + (local $17 i64) + (local $18 i64) + (local $19 i64) + (local $20 i64) + (local $21 i64) + (local $22 i64) + (local $23 i64) + (local $24 i64) + (local $25 i64) + (local $26 i32) + (local $27 i64) + (local $28 i32) + local.get $1 + f64.const 0 + f64.lt + local.set $2 + local.get $2 if - i32.const 0 - i32.const 48 - i32.const 46 - i32.const 0 - call $~lib/env/abort - unreachable - end - block (result i32) - i32.const 1 - global.set $~lib/argc - global.get $std/string/str - i32.const 15 - i32.const 0 - call $~lib/string/String#padEnd|trampoline + local.get $1 + f64.neg + local.set $1 + local.get $0 + i32.const 45 + i32.store16 end - global.get $std/string/str - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 48 - i32.const 47 + block $~lib/util/number/grisu2|inlined.0 (result i32) + local.get $1 + local.set $5 + local.get $0 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + i64.reinterpret_f64 + local.set $6 + local.get $6 + i64.const 9218868437227405312 + i64.and + i64.const 52 + i64.shr_u + i32.wrap_i64 + local.set $7 + local.get $6 + i64.const 4503599627370495 + i64.and + local.set $8 + local.get $7 i32.const 0 - call $~lib/env/abort - unreachable - end - block (result i32) + i32.ne + i64.extend_i32_u + i64.const 52 + i64.shl + local.get $8 + i64.add + local.set $9 + local.get $7 i32.const 1 - global.set $~lib/argc - i32.const 112 - i32.const 3 + local.get $7 i32.const 0 - call $~lib/string/String#padEnd|trampoline + i32.ne + select + i32.const 1023 + i32.const 52 + i32.add + i32.sub + local.set $7 + block $~lib/util/number/normalizedBoundaries|inlined.0 + local.get $9 + local.set $11 + local.get $7 + local.set $10 + local.get $11 + i64.const 1 + i64.shl + i64.const 1 + i64.add + local.set $12 + local.get $10 + i32.const 1 + i32.sub + local.set $13 + local.get $12 + i64.clz + i32.wrap_i64 + local.set $14 + local.get $12 + local.get $14 + i64.extend_i32_s + i64.shl + local.set $12 + local.get $13 + local.get $14 + i32.sub + local.set $13 + i32.const 1 + local.get $11 + i64.const 4503599627370496 + i64.eq + i32.add + local.set $15 + local.get $12 + global.set $~lib/util/number/_frc_plus + local.get $11 + local.get $15 + i64.extend_i32_s + i64.shl + i64.const 1 + i64.sub + local.get $10 + local.get $15 + i32.sub + local.get $13 + i32.sub + i64.extend_i32_s + i64.shl + global.set $~lib/util/number/_frc_minus + local.get $13 + global.set $~lib/util/number/_exp + end + block $~lib/util/number/getCachedPower|inlined.0 + global.get $~lib/util/number/_exp + local.set $10 + i32.const -61 + local.get $10 + i32.sub + f64.convert_i32_s + f64.const 0.30102999566398114 + f64.mul + f64.const 347 + f64.add + local.set $16 + local.get $16 + i32.trunc_f64_s + local.set $15 + local.get $15 + local.get $15 + f64.convert_i32_s + local.get $16 + f64.ne + i32.add + local.set $15 + local.get $15 + i32.const 3 + i32.shr_s + i32.const 1 + i32.add + local.set $14 + i32.const 348 + local.get $14 + i32.const 3 + i32.shl + i32.sub + global.set $~lib/util/number/_K + i32.const 4960 + local.get $14 + call $~lib/array/Array#__unchecked_get + global.set $~lib/util/number/_frc_pow + i32.const 5184 + local.get $14 + call $~lib/array/Array#__unchecked_get + global.set $~lib/util/number/_exp_pow + end + local.get $9 + i64.clz + i32.wrap_i64 + local.set $14 + local.get $9 + local.get $14 + i64.extend_i32_s + i64.shl + local.set $9 + local.get $7 + local.get $14 + i32.sub + local.set $7 + global.get $~lib/util/number/_frc_pow + local.set $12 + global.get $~lib/util/number/_exp_pow + local.set $15 + block $~lib/util/number/umul64f|inlined.0 (result i64) + local.get $9 + local.set $17 + local.get $12 + local.set $11 + local.get $17 + i64.const 4294967295 + i64.and + local.set $18 + local.get $11 + i64.const 4294967295 + i64.and + local.set $19 + local.get $17 + i64.const 32 + i64.shr_u + local.set $20 + local.get $11 + i64.const 32 + i64.shr_u + local.set $21 + local.get $18 + local.get $19 + i64.mul + local.set $22 + local.get $20 + local.get $19 + i64.mul + local.get $22 + i64.const 32 + i64.shr_u + i64.add + local.set $23 + local.get $18 + local.get $21 + i64.mul + local.get $23 + i64.const 4294967295 + i64.and + i64.add + local.set $24 + local.get $24 + i64.const 2147483647 + i64.add + local.set $24 + local.get $23 + i64.const 32 + i64.shr_u + local.set $23 + local.get $24 + i64.const 32 + i64.shr_u + local.set $24 + local.get $20 + local.get $21 + i64.mul + local.get $23 + i64.add + local.get $24 + i64.add + end + local.set $24 + block $~lib/util/number/umul64e|inlined.0 (result i32) + local.get $7 + local.set $10 + local.get $15 + local.set $13 + local.get $10 + local.get $13 + i32.add + i32.const 64 + i32.add + end + local.set $10 + block $~lib/util/number/umul64f|inlined.1 (result i64) + global.get $~lib/util/number/_frc_plus + local.set $17 + local.get $12 + local.set $11 + local.get $17 + i64.const 4294967295 + i64.and + local.set $23 + local.get $11 + i64.const 4294967295 + i64.and + local.set $22 + local.get $17 + i64.const 32 + i64.shr_u + local.set $21 + local.get $11 + i64.const 32 + i64.shr_u + local.set $20 + local.get $23 + local.get $22 + i64.mul + local.set $19 + local.get $21 + local.get $22 + i64.mul + local.get $19 + i64.const 32 + i64.shr_u + i64.add + local.set $18 + local.get $23 + local.get $20 + i64.mul + local.get $18 + i64.const 4294967295 + i64.and + i64.add + local.set $25 + local.get $25 + i64.const 2147483647 + i64.add + local.set $25 + local.get $18 + i64.const 32 + i64.shr_u + local.set $18 + local.get $25 + i64.const 32 + i64.shr_u + local.set $25 + local.get $21 + local.get $20 + i64.mul + local.get $18 + i64.add + local.get $25 + i64.add + end + i64.const 1 + i64.sub + local.set $25 + block $~lib/util/number/umul64e|inlined.1 (result i32) + global.get $~lib/util/number/_exp + local.set $26 + local.get $15 + local.set $13 + local.get $26 + local.get $13 + i32.add + i32.const 64 + i32.add + end + local.set $26 + block $~lib/util/number/umul64f|inlined.2 (result i64) + global.get $~lib/util/number/_frc_minus + local.set $17 + local.get $12 + local.set $11 + local.get $17 + i64.const 4294967295 + i64.and + local.set $18 + local.get $11 + i64.const 4294967295 + i64.and + local.set $19 + local.get $17 + i64.const 32 + i64.shr_u + local.set $20 + local.get $11 + i64.const 32 + i64.shr_u + local.set $21 + local.get $18 + local.get $19 + i64.mul + local.set $22 + local.get $20 + local.get $19 + i64.mul + local.get $22 + i64.const 32 + i64.shr_u + i64.add + local.set $23 + local.get $18 + local.get $21 + i64.mul + local.get $23 + i64.const 4294967295 + i64.and + i64.add + local.set $27 + local.get $27 + i64.const 2147483647 + i64.add + local.set $27 + local.get $23 + i64.const 32 + i64.shr_u + local.set $23 + local.get $27 + i64.const 32 + i64.shr_u + local.set $27 + local.get $20 + local.get $21 + i64.mul + local.get $23 + i64.add + local.get $27 + i64.add + end + i64.const 1 + i64.add + local.set $27 + local.get $25 + local.get $27 + i64.sub + local.set $23 + local.get $4 + local.get $24 + local.get $10 + local.get $25 + local.get $26 + local.get $23 + local.get $3 + call $~lib/util/number/genDigits end - i32.const 272 - call $~lib/string/String.__eq + local.set $28 + local.get $0 + local.get $2 + i32.const 1 + i32.shl + i32.add + local.get $28 + local.get $2 + i32.sub + global.get $~lib/util/number/_K + call $~lib/util/number/prettify + local.set $28 + local.get $28 + local.get $2 + i32.add + ) + (func $~lib/string/String#substring (; 80 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + local.get $0 + i32.const 0 + i32.ne i32.eqz if i32.const 0 - i32.const 48 - i32.const 48 - i32.const 0 - call $~lib/env/abort + i32.const 456 + i32.const 196 + i32.const 4 + call $~lib/builtins/abort unreachable end - i32.const 112 - i32.const 10 - i32.const 112 - call $~lib/string/String#padEnd - i32.const 112 - call $~lib/string/String.__eq + local.get $0 + call $~lib/string/String#get:length + local.set $3 + local.get $1 + local.tee $4 + i32.const 0 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.lt_s + select + local.set $6 + local.get $2 + local.tee $4 + i32.const 0 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.lt_s + select + local.set $7 + local.get $6 + local.tee $4 + local.get $7 + local.tee $5 + local.get $4 + local.get $5 + i32.lt_s + select + i32.const 1 + i32.shl + local.set $8 + local.get $6 + local.tee $4 + local.get $7 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + i32.const 1 + i32.shl + local.set $9 + local.get $9 + local.get $8 + i32.sub + local.set $3 + local.get $3 i32.eqz if - i32.const 0 - i32.const 48 - i32.const 49 - i32.const 0 - call $~lib/env/abort - unreachable + i32.const 120 + call $~lib/rt/pure/__retain + return end - i32.const 128 - i32.const 100 - i32.const 112 - call $~lib/string/String#padEnd - i32.const 128 - call $~lib/string/String.__eq + local.get $8 i32.eqz - if - i32.const 0 - i32.const 48 - i32.const 50 - i32.const 0 - call $~lib/env/abort - unreachable - end - block (result i32) + if (result i32) + local.get $9 + local.get $0 + call $~lib/string/String#get:length i32.const 1 - global.set $~lib/argc - i32.const 288 - i32.const 5 - i32.const 0 - call $~lib/string/String#padEnd|trampoline - end - i32.const 376 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 48 - i32.const 51 + i32.shl + i32.eq + else i32.const 0 - call $~lib/env/abort - unreachable end - i32.const 288 - i32.const 6 - i32.const 288 - call $~lib/string/String#padEnd - i32.const 392 - call $~lib/string/String.__eq - i32.eqz if - i32.const 0 - i32.const 48 - i32.const 52 - i32.const 0 - call $~lib/env/abort - unreachable + local.get $0 + call $~lib/rt/pure/__retain + return end - i32.const 288 - i32.const 8 - i32.const 288 - call $~lib/string/String#padEnd - i32.const 408 - call $~lib/string/String.__eq - i32.eqz + local.get $3 + i32.const 1 + call $~lib/rt/tlsf/__alloc + local.set $10 + local.get $10 + local.get $0 + local.get $8 + i32.add + local.get $3 + call $~lib/memory/memory.copy + local.get $10 + call $~lib/rt/pure/__retain + ) + (func $~lib/util/number/dtoa (; 81 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + f64.const 0 + f64.eq if - i32.const 0 - i32.const 48 - i32.const 53 - i32.const 0 - call $~lib/env/abort - unreachable + i32.const 4128 + call $~lib/rt/pure/__retain + return end - i32.const 112 - i32.const 112 - i32.const 0 - call $~lib/string/String#indexOf - i32.const 0 - i32.eq + local.get $0 + call $~lib/builtins/isFinite i32.eqz if - i32.const 0 - i32.const 48 - i32.const 55 - i32.const 0 - call $~lib/env/abort - unreachable + local.get $0 + call $~lib/builtins/isNaN + if + i32.const 4152 + call $~lib/rt/pure/__retain + return + end + i32.const 4176 + i32.const 4216 + local.get $0 + f64.const 0 + f64.lt + select + call $~lib/rt/pure/__retain + return end - i32.const 112 - i32.const 208 - i32.const 0 - call $~lib/string/String#indexOf - i32.const -1 + i32.const 28 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/__alloc + local.set $1 + local.get $1 + local.get $0 + call $~lib/util/number/dtoa_core + local.set $2 + local.get $2 + i32.const 28 i32.eq - i32.eqz if - i32.const 0 - i32.const 48 - i32.const 56 - i32.const 0 - call $~lib/env/abort - unreachable + local.get $1 + call $~lib/rt/pure/__retain + return end - i32.const 128 - i32.const 128 - i32.const 0 - call $~lib/string/String#indexOf + local.get $1 i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 48 - i32.const 57 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/string/str + local.get $2 + call $~lib/string/String#substring + local.set $3 + local.get $1 + call $~lib/rt/tlsf/__free + local.get $3 + ) + (func $start:std/string (; 82 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + (local $14 i32) + (local $15 i32) + (local $16 i32) + (local $17 i32) + (local $18 i32) + (local $19 i32) + (local $20 i32) + (local $21 i32) + (local $22 i32) + (local $23 i32) + (local $24 i32) + (local $25 i32) + (local $26 i32) + (local $27 i32) + (local $28 i32) + (local $29 i32) + (local $30 i32) + (local $31 i32) + (local $32 i32) + (local $33 i32) + (local $34 i32) + (local $35 i32) + (local $36 i32) + (local $37 i32) + (local $38 i32) + (local $39 i32) + (local $40 i32) + (local $41 i32) + (local $42 i32) + (local $43 i32) + (local $44 i32) + (local $45 i32) + (local $46 i32) + (local $47 i32) + (local $48 i32) + (local $49 i32) + (local $50 i32) + (local $51 i32) + (local $52 i32) + (local $53 i32) + (local $54 i32) + (local $55 i32) + (local $56 i32) + (local $57 i32) + (local $58 i32) + (local $59 i32) + (local $60 i32) + (local $61 i32) + (local $62 i32) + (local $63 i32) + (local $64 i32) + (local $65 i32) + (local $66 i32) + (local $67 i32) + (local $68 i32) + (local $69 i32) + (local $70 i32) + (local $71 i32) + (local $72 i32) + (local $73 i32) + (local $74 i32) + (local $75 i32) + (local $76 i32) + (local $77 i32) + (local $78 i32) + (local $79 i32) + (local $80 i32) + (local $81 i32) + (local $82 i32) + (local $83 i32) + (local $84 i32) + (local $85 i32) + (local $86 i32) + (local $87 i32) + (local $88 i32) + (local $89 i32) + (local $90 i32) + (local $91 i32) + (local $92 i32) + (local $93 i32) + (local $94 i32) + (local $95 i32) + (local $96 i32) + (local $97 i32) + (local $98 i32) + (local $99 i32) + (local $100 i32) + (local $101 i32) + (local $102 i32) + (local $103 i32) + (local $104 i32) + (local $105 i32) + (local $106 i32) + (local $107 i32) + (local $108 i32) + (local $109 i32) + (local $110 i32) + (local $111 i32) + (local $112 i32) + (local $113 i32) + (local $114 i32) + (local $115 i32) + (local $116 i32) + (local $117 i32) + (local $118 i32) + (local $119 i32) + (local $120 i32) + (local $121 i32) + (local $122 i32) + (local $123 i32) + (local $124 i32) + (local $125 i32) + (local $126 i32) + (local $127 i32) + (local $128 i32) global.get $std/string/str - i32.const 0 - call $~lib/string/String#indexOf - i32.const 0 + i32.const 24 i32.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 58 + i32.const 72 + i32.const 8 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string/str - i32.const 112 - i32.const 0 - call $~lib/string/String#indexOf - i32.const 0 + call $~lib/string/String#get:length + i32.const 16 i32.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 59 + i32.const 72 + i32.const 10 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string/str - i32.const 432 i32.const 0 - call $~lib/string/String#indexOf - i32.const 2 + call $~lib/string/String#charCodeAt + i32.const 104 i32.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 60 + i32.const 72 + i32.const 11 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $std/string/str - i32.const 440 + i32.const 120 + call $~lib/string/String.__not + i32.eqz i32.const 0 - call $~lib/string/String#indexOf - i32.const -1 i32.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 61 + i32.const 72 + i32.const 13 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $std/string/str - i32.const 432 - i32.const 2 - call $~lib/string/String#indexOf - i32.const 2 - i32.eq + i32.const 384 + call $~lib/string/String.__not i32.eqz - if - i32.const 0 - i32.const 48 - i32.const 62 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/string/str - i32.const 432 - i32.const 3 - call $~lib/string/String#indexOf - i32.const -1 + i32.const 1 i32.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 63 + i32.const 72 + i32.const 14 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $std/string/str - i32.const 448 - i32.const -1 - call $~lib/string/String#indexOf - i32.const 2 - i32.eq + i32.const 408 + call $~lib/string/String.__not i32.eqz - if - i32.const 0 - i32.const 48 - i32.const 64 - i32.const 0 - call $~lib/env/abort - unreachable - end - block (result i32) - i32.const 1 - global.set $~lib/argc - i32.const 112 - i32.const 112 - i32.const 0 - call $~lib/string/String#lastIndexOf|trampoline - end - i32.const 0 + i32.const 1 i32.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 66 + i32.const 72 + i32.const 15 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block (result i32) i32.const 1 global.set $~lib/argc - i32.const 112 - i32.const 208 - i32.const 0 - call $~lib/string/String#lastIndexOf|trampoline - end - i32.const -1 - i32.eq - i32.eqz - if i32.const 0 - i32.const 48 - i32.const 67 - i32.const 0 - call $~lib/env/abort - unreachable - end - block (result i32) - i32.const 1 - global.set $~lib/argc - global.get $std/string/str - i32.const 112 i32.const 0 - call $~lib/string/String#lastIndexOf|trampoline + call $~lib/string/String.fromCharCode|trampoline + local.tee $0 end - global.get $std/string/str - i32.load - i32.eq + i32.const 384 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 68 + i32.const 72 + i32.const 17 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block (result i32) i32.const 1 global.set $~lib/argc - global.get $std/string/str - i32.const 432 + i32.const 54 i32.const 0 - call $~lib/string/String#lastIndexOf|trampoline + call $~lib/string/String.fromCharCode|trampoline + local.tee $1 end - i32.const 2 - i32.eq + i32.const 432 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 69 + i32.const 72 + i32.const 18 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block (result i32) i32.const 1 global.set $~lib/argc - global.get $std/string/str - i32.const 440 + i32.const 65536 + i32.const 54 + i32.add i32.const 0 - call $~lib/string/String#lastIndexOf|trampoline + call $~lib/string/String.fromCharCode|trampoline + local.tee $2 end - i32.const -1 - i32.eq + i32.const 432 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 70 + i32.const 72 + i32.const 19 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block (result i32) - i32.const 1 - global.set $~lib/argc - global.get $std/string/str - i32.const 464 - i32.const 0 - call $~lib/string/String#lastIndexOf|trampoline - end - i32.const 15 - i32.eq + i32.const 0 + call $~lib/string/String.fromCodePoint + local.tee $3 + i32.const 384 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 71 + i32.const 72 + i32.const 21 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $std/string/str + i32.const 54 + call $~lib/string/String.fromCodePoint + local.tee $4 i32.const 432 - i32.const 2 - call $~lib/string/String#lastIndexOf - i32.const 2 - i32.eq + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 i32.const 72 + i32.const 22 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $std/string/str - i32.const 432 - i32.const 3 - call $~lib/string/String#lastIndexOf - i32.const 2 - i32.eq + i32.const 119558 + call $~lib/string/String.fromCodePoint + local.tee $5 i32.eqz if + i32.const 504 + i32.const 72 + i32.const 23 i32.const 0 - i32.const 48 - i32.const 73 - i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string/str - i32.const 448 - i32.const -1 - call $~lib/string/String#lastIndexOf - i32.const -1 - i32.eq + i32.const 528 + i32.const 0 + call $~lib/string/String#startsWith i32.eqz if i32.const 0 - i32.const 48 - i32.const 74 + i32.const 72 + i32.const 25 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string/str - i32.const 472 - i32.const 0 - call $~lib/string/String#lastIndexOf - i32.const -1 - i32.eq + i32.const 576 + global.get $~lib/string/String.MAX_LENGTH + call $~lib/string/String#endsWith i32.eqz if i32.const 0 - i32.const 48 - i32.const 75 + i32.const 72 + i32.const 26 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/string/str - i32.const 208 - i32.const 0 - call $~lib/string/String#lastIndexOf + i32.const 608 i32.const 0 - i32.eq + call $~lib/string/String#includes i32.eqz if i32.const 0 - i32.const 48 - i32.const 76 + i32.const 72 + i32.const 27 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 480 + global.get $std/string/str i32.const 0 - call $~lib/string/parseInt - f64.const 0 - f64.eq + i32.const 632 + call $~lib/string/String#padStart + local.tee $6 + global.get $std/string/str + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 82 + i32.const 72 + i32.const 29 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 488 - i32.const 0 - call $~lib/string/parseInt - f64.const 1 - f64.eq + global.get $std/string/str + i32.const 15 + i32.const 632 + call $~lib/string/String#padStart + local.tee $7 + global.get $std/string/str + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 83 + i32.const 72 + i32.const 30 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 496 - i32.const 0 - call $~lib/string/parseInt - f64.const 5 - f64.eq + i32.const 120 + i32.const 3 + i32.const 632 + call $~lib/string/String#padStart + local.tee $8 + i32.const 656 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 84 + i32.const 72 + i32.const 31 i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 512 - i32.const 0 - call $~lib/string/parseInt - f64.const 455 - f64.eq + call $~lib/builtins/abort + unreachable + end + i32.const 120 + i32.const 10 + i32.const 120 + call $~lib/string/String#padStart + local.tee $9 + i32.const 120 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 85 + i32.const 72 + i32.const 32 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 528 - i32.const 0 - call $~lib/string/parseInt - f64.const 3855 - f64.eq + i32.const 408 + i32.const 100 + i32.const 120 + call $~lib/string/String#padStart + local.tee $10 + i32.const 408 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 86 + i32.const 72 + i32.const 33 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 544 - i32.const 0 - call $~lib/string/parseInt - f64.const 3855 - f64.eq + i32.const 680 + i32.const 5 + i32.const 632 + call $~lib/string/String#padStart + local.tee $11 + i32.const 704 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 87 + i32.const 72 + i32.const 34 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 560 - i32.const 0 - call $~lib/string/parseInt - f64.const 11 - f64.eq + i32.const 680 + i32.const 6 + i32.const 736 + call $~lib/string/String#padStart + local.tee $12 + i32.const 760 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 88 + i32.const 72 + i32.const 35 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 576 - i32.const 0 - call $~lib/string/parseInt - f64.const 1 - f64.eq + i32.const 680 + i32.const 8 + i32.const 736 + call $~lib/string/String#padStart + local.tee $13 + i32.const 792 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 89 + i32.const 72 + i32.const 36 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 480 - call $~lib/string/parseFloat - f64.const 0 - f64.eq + global.get $std/string/str + i32.const 0 + i32.const 632 + call $~lib/string/String#padEnd + local.tee $14 + global.get $std/string/str + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 91 + i32.const 72 + i32.const 38 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 488 - call $~lib/string/parseFloat - f64.const 1 - f64.eq + global.get $std/string/str + i32.const 15 + i32.const 632 + call $~lib/string/String#padEnd + local.tee $15 + global.get $std/string/str + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 92 + i32.const 72 + i32.const 39 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 592 - call $~lib/string/parseFloat - f64.const 0.1 - f64.eq + i32.const 120 + i32.const 3 + i32.const 632 + call $~lib/string/String#padEnd + local.tee $16 + i32.const 656 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 93 + i32.const 72 + i32.const 40 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 608 - call $~lib/string/parseFloat - f64.const 0.25 - f64.eq + i32.const 120 + i32.const 10 + i32.const 120 + call $~lib/string/String#padEnd + local.tee $17 + i32.const 120 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 94 + i32.const 72 + i32.const 41 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 624 - call $~lib/string/parseFloat - f64.const 0.1 - f64.eq + i32.const 408 + i32.const 100 + i32.const 120 + call $~lib/string/String#padEnd + local.tee $18 + i32.const 408 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 95 + i32.const 72 + i32.const 42 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 128 - i32.const 648 - call $~lib/string/String.__concat - global.set $std/string/c - global.get $std/string/c - i32.const 656 + i32.const 680 + i32.const 5 + i32.const 632 + call $~lib/string/String#padEnd + local.tee $19 + i32.const 824 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 98 + i32.const 72 + i32.const 43 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $std/string/c - i32.const 128 - call $~lib/string/String.__ne + i32.const 680 + i32.const 6 + i32.const 680 + call $~lib/string/String#padEnd + local.tee $20 + i32.const 856 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 99 + i32.const 72 + i32.const 44 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 112 - i32.const 112 + i32.const 680 + i32.const 8 + i32.const 680 + call $~lib/string/String#padEnd + local.tee $21 + i32.const 888 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 100 + i32.const 72 + i32.const 45 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 112 - global.get $std/string/nullStr - call $~lib/string/String.__ne + i32.const 120 + i32.const 120 + i32.const 0 + call $~lib/string/String#indexOf + i32.const 0 + i32.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 101 + i32.const 72 + i32.const 47 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $std/string/nullStr - i32.const 112 - call $~lib/string/String.__ne + i32.const 120 + i32.const 528 + i32.const 0 + call $~lib/string/String#indexOf + i32.const -1 + i32.eq i32.eqz if i32.const 0 + i32.const 72 i32.const 48 - i32.const 102 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 128 - i32.const 648 - call $~lib/string/String.__ne + i32.const 408 + i32.const 408 + i32.const 0 + call $~lib/string/String#indexOf + i32.const 0 + i32.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 103 + i32.const 72 + i32.const 49 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 128 - i32.const 128 - call $~lib/string/String.__eq + global.get $std/string/str + global.get $std/string/str + i32.const 0 + call $~lib/string/String#indexOf + i32.const 0 + i32.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 104 + i32.const 72 + i32.const 50 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 664 - i32.const 680 - call $~lib/string/String.__ne + global.get $std/string/str + i32.const 120 + i32.const 0 + call $~lib/string/String#indexOf + i32.const 0 + i32.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 105 + i32.const 72 + i32.const 51 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 664 - i32.const 664 - call $~lib/string/String.__eq + global.get $std/string/str + i32.const 920 + i32.const 0 + call $~lib/string/String#indexOf + i32.const 2 + i32.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 106 + i32.const 72 + i32.const 52 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 696 - i32.const 712 - call $~lib/string/String.__ne + global.get $std/string/str + i32.const 944 + i32.const 0 + call $~lib/string/String#indexOf + i32.const -1 + i32.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 107 + i32.const 72 + i32.const 53 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 728 - i32.const 744 - call $~lib/string/String.__ne + global.get $std/string/str + i32.const 920 + i32.const 2 + call $~lib/string/String#indexOf + i32.const 2 + i32.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 108 + i32.const 72 + i32.const 54 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 760 - i32.const 760 - call $~lib/string/String.__eq + global.get $std/string/str + i32.const 920 + i32.const 3 + call $~lib/string/String#indexOf + i32.const -1 + i32.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 109 + i32.const 72 + i32.const 55 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 760 - i32.const 784 - call $~lib/string/String.__ne + global.get $std/string/str + i32.const 968 + i32.const -1 + call $~lib/string/String#indexOf + i32.const 2 + i32.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 110 + i32.const 72 + i32.const 56 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 808 - i32.const 840 - call $~lib/string/String.__ne + i32.const 120 + i32.const 120 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#lastIndexOf + i32.const 0 + i32.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 111 + i32.const 72 + i32.const 58 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 648 - i32.const 128 - call $~lib/string/String.__gt + i32.const 120 + i32.const 528 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#lastIndexOf + i32.const -1 + i32.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 113 + i32.const 72 + i32.const 59 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 864 - i32.const 128 - call $~lib/string/String.__gt + global.get $std/string/str + i32.const 120 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#lastIndexOf + global.get $std/string/str + call $~lib/string/String#get:length + i32.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 114 + i32.const 72 + i32.const 60 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 864 - i32.const 872 - call $~lib/string/String.__gte + global.get $std/string/str + i32.const 920 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#lastIndexOf + i32.const 2 + i32.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 115 + i32.const 72 + i32.const 61 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 864 - i32.const 656 - call $~lib/string/String.__gt + global.get $std/string/str + i32.const 944 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#lastIndexOf + i32.const -1 + i32.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 116 + i32.const 72 + i32.const 62 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 864 - i32.const 656 - call $~lib/string/String.__lt - i32.eqz + global.get $std/string/str + i32.const 992 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#lastIndexOf + i32.const 15 + i32.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 117 + i32.const 72 + i32.const 63 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 648 - global.get $std/string/nullStr - call $~lib/string/String.__lt - i32.eqz + global.get $std/string/str + i32.const 920 + i32.const 2 + call $~lib/string/String#lastIndexOf + i32.const 2 + i32.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 119 + i32.const 72 + i32.const 64 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $std/string/nullStr - i32.const 648 - call $~lib/string/String.__lt - i32.eqz + global.get $std/string/str + i32.const 920 + i32.const 3 + call $~lib/string/String#lastIndexOf + i32.const 2 + i32.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 120 + i32.const 72 + i32.const 65 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 288 - i32.const 112 - call $~lib/string/String.__gt + global.get $std/string/str + i32.const 968 + i32.const -1 + call $~lib/string/String#lastIndexOf + i32.const -1 + i32.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 122 + i32.const 72 + i32.const 66 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 112 - i32.const 288 - call $~lib/string/String.__lt + global.get $std/string/str + i32.const 1016 + i32.const 0 + call $~lib/string/String#lastIndexOf + i32.const -1 + i32.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 123 + i32.const 72 + i32.const 67 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 288 - i32.const 112 - call $~lib/string/String.__gte + global.get $std/string/str + i32.const 528 + i32.const 0 + call $~lib/string/String#lastIndexOf + i32.const 0 + i32.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 124 + i32.const 72 + i32.const 68 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 112 - i32.const 288 - call $~lib/string/String.__lte + i32.const 1040 + i32.const 0 + call $~lib/string/parseInt + f64.const 0 + f64.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 125 + i32.const 72 + i32.const 70 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 288 - i32.const 112 - call $~lib/string/String.__lt - i32.eqz + i32.const 1064 + i32.const 0 + call $~lib/string/parseInt + f64.const 1 + f64.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 126 + i32.const 72 + i32.const 71 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 112 - i32.const 288 - call $~lib/string/String.__gt - i32.eqz + i32.const 1088 + i32.const 0 + call $~lib/string/parseInt + f64.const 5 + f64.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 127 + i32.const 72 + i32.const 72 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 112 - i32.const 112 - call $~lib/string/String.__lt - i32.eqz + i32.const 1120 + i32.const 0 + call $~lib/string/parseInt + f64.const 455 + f64.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 128 + i32.const 72 + i32.const 73 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 112 - i32.const 112 - call $~lib/string/String.__gt - i32.eqz + i32.const 1152 + i32.const 0 + call $~lib/string/parseInt + f64.const 3855 + f64.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 129 + i32.const 72 + i32.const 74 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 112 - i32.const 112 - call $~lib/string/String.__gte + i32.const 1184 + i32.const 0 + call $~lib/string/parseInt + f64.const 3855 + f64.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 130 + i32.const 72 + i32.const 75 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 112 - i32.const 112 - call $~lib/string/String.__lte + i32.const 1216 + i32.const 0 + call $~lib/string/parseInt + f64.const 11 + f64.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 131 + i32.const 72 + i32.const 76 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 65377 - call $~lib/string/String.fromCodePoint - global.set $std/string/a - i32.const 55296 - call $~lib/string/String.fromCodePoint - i32.const 56322 - call $~lib/string/String.fromCodePoint - call $~lib/string/String.__concat - global.set $std/string/b - global.get $std/string/a - global.get $std/string/b - call $~lib/string/String.__gt + i32.const 1240 + i32.const 0 + call $~lib/string/parseInt + f64.const 1 + f64.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 135 + i32.const 72 + i32.const 77 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 320 - i32.load - i32.const 3 - i32.eq + i32.const 1264 + i32.const 0 + call $~lib/string/parseInt + f64.const 1 + f64.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 137 + i32.const 72 + i32.const 79 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 112 - i32.const 100 - call $~lib/string/String#repeat - i32.const 112 - call $~lib/string/String.__eq + i32.const 1288 + i32.const 0 + call $~lib/string/parseInt + f64.const 2 + f64.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 139 + i32.const 72 + i32.const 80 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 128 - i32.const 0 - call $~lib/string/String#repeat - i32.const 112 - call $~lib/string/String.__eq + i32.const 1040 + call $~lib/string/parseFloat + f64.const 0 + f64.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 140 + i32.const 72 + i32.const 82 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 128 - i32.const 1 - call $~lib/string/String#repeat - i32.const 128 - call $~lib/string/String.__eq + i32.const 1064 + call $~lib/string/parseFloat + f64.const 1 + f64.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 141 + i32.const 72 + i32.const 83 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 128 - i32.const 2 - call $~lib/string/String#repeat - i32.const 872 - call $~lib/string/String.__eq + i32.const 1320 + call $~lib/string/parseFloat + f64.const 0.1 + f64.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 142 + i32.const 72 + i32.const 84 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 128 - i32.const 3 - call $~lib/string/String#repeat - i32.const 880 - call $~lib/string/String.__eq + i32.const 1344 + call $~lib/string/parseFloat + f64.const 0.25 + f64.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 143 + i32.const 72 + i32.const 85 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 656 - i32.const 4 - call $~lib/string/String#repeat - i32.const 896 - call $~lib/string/String.__eq + i32.const 1368 + call $~lib/string/parseFloat + f64.const 0.1 + f64.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 144 + i32.const 72 + i32.const 86 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 128 - i32.const 5 - call $~lib/string/String#repeat - i32.const 920 - call $~lib/string/String.__eq + i32.const 1400 + call $~lib/string/parseFloat + f64.const 0.1 + f64.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 145 + i32.const 72 + i32.const 88 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 128 - i32.const 6 - call $~lib/string/String#repeat - i32.const 936 + block + i32.const 408 + i32.const 1432 + call $~lib/string/String.__concat + local.tee $22 + call $~lib/rt/pure/__retain + local.set $23 + local.get $23 + i32.const 1456 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 92 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $23 + i32.const 408 + call $~lib/string/String.__ne + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 93 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $22 + call $~lib/rt/pure/__release + local.get $23 + call $~lib/rt/pure/__release + end + i32.const 120 + i32.const 120 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 146 + i32.const 72 + i32.const 95 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 128 - i32.const 7 - call $~lib/string/String#repeat - i32.const 952 - call $~lib/string/String.__eq + i32.const 120 + global.get $std/string/nullStr + call $~lib/string/String.__ne i32.eqz if i32.const 0 - i32.const 48 - i32.const 147 + i32.const 72 + i32.const 96 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 976 - global.set $std/string/str - block (result i32) - i32.const 1 - global.set $~lib/argc - global.get $std/string/str + global.get $std/string/nullStr + i32.const 120 + call $~lib/string/String.__ne + i32.eqz + if i32.const 0 + i32.const 72 + i32.const 97 i32.const 0 - call $~lib/string/String#slice|trampoline + call $~lib/builtins/abort + unreachable end - i32.const 976 - call $~lib/string/String.__eq + i32.const 408 + i32.const 1432 + call $~lib/string/String.__ne i32.eqz if i32.const 0 - i32.const 48 - i32.const 151 + i32.const 72 + i32.const 98 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block (result i32) - i32.const 1 - global.set $~lib/argc - global.get $std/string/str - i32.const -1 - i32.const 0 - call $~lib/string/String#slice|trampoline - end - i32.const 1008 + i32.const 408 + i32.const 408 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 152 + i32.const 72 + i32.const 99 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block (result i32) - i32.const 1 - global.set $~lib/argc - global.get $std/string/str - i32.const -5 - i32.const 0 - call $~lib/string/String#slice|trampoline - end - i32.const 1016 - call $~lib/string/String.__eq + i32.const 1480 + i32.const 1504 + call $~lib/string/String.__ne i32.eqz if i32.const 0 - i32.const 48 - i32.const 153 + i32.const 72 + i32.const 100 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $std/string/str - i32.const 2 - i32.const 7 - call $~lib/string/String#slice - i32.const 1032 + i32.const 1480 + i32.const 1480 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 154 + i32.const 72 + i32.const 101 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $std/string/str - i32.const -11 - i32.const -6 - call $~lib/string/String#slice - i32.const 1048 - call $~lib/string/String.__eq + i32.const 1528 + i32.const 1552 + call $~lib/string/String.__ne i32.eqz if i32.const 0 - i32.const 48 - i32.const 155 + i32.const 72 + i32.const 102 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $std/string/str - i32.const 4 - i32.const 3 - call $~lib/string/String#slice - i32.const 112 - call $~lib/string/String.__eq + i32.const 1576 + i32.const 1608 + call $~lib/string/String.__ne i32.eqz if i32.const 0 - i32.const 48 - i32.const 156 + i32.const 72 + i32.const 103 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $std/string/str - i32.const 0 - i32.const -1 - call $~lib/string/String#slice - i32.const 1064 + i32.const 1640 + i32.const 1640 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 157 + i32.const 72 + i32.const 104 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block (result i32) - i32.const 0 - global.set $~lib/argc - i32.const 112 - i32.const 0 - i32.const 0 - call $~lib/string/String#split|trampoline - end - global.set $std/string/sa - block $~lib/array/Array<~lib/string/String>#get:length|inlined.0 (result i32) - global.get $std/string/sa - local.set $2 - local.get $2 - i32.load offset=4 - end - i32.const 1 - i32.eq - local.tee $2 - if (result i32) - global.get $std/string/sa - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 112 - call $~lib/string/String.__eq - else - local.get $2 - end + i32.const 1640 + i32.const 1672 + call $~lib/string/String.__ne i32.eqz if i32.const 0 - i32.const 48 - i32.const 162 + i32.const 72 + i32.const 105 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block (result i32) - i32.const 1 - global.set $~lib/argc - i32.const 112 - i32.const 112 - i32.const 0 - call $~lib/string/String#split|trampoline - end - global.set $std/string/sa - block $~lib/array/Array<~lib/string/String>#get:length|inlined.1 (result i32) - global.get $std/string/sa - local.set $2 - local.get $2 - i32.load offset=4 - end - i32.const 0 - i32.eq + i32.const 1704 + i32.const 1744 + call $~lib/string/String.__ne i32.eqz if i32.const 0 - i32.const 48 - i32.const 164 + i32.const 72 + i32.const 106 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block (result i32) - i32.const 1 - global.set $~lib/argc - i32.const 112 - i32.const 432 + i32.const 1432 + i32.const 408 + call $~lib/string/String.__gt + i32.eqz + if i32.const 0 - call $~lib/string/String#split|trampoline - end - global.set $std/string/sa - block $~lib/array/Array<~lib/string/String>#get:length|inlined.2 (result i32) - global.get $std/string/sa - local.set $2 - local.get $2 - i32.load offset=4 - end - i32.const 1 - i32.eq - local.tee $2 - if (result i32) - global.get $std/string/sa + i32.const 72 + i32.const 108 i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 112 - call $~lib/string/String.__eq - else - local.get $2 + call $~lib/builtins/abort + unreachable end + i32.const 1784 + i32.const 408 + call $~lib/string/String.__gt i32.eqz if i32.const 0 - i32.const 48 - i32.const 166 + i32.const 72 + i32.const 109 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block (result i32) - i32.const 1 - global.set $~lib/argc - i32.const 1192 - i32.const 1208 + i32.const 1784 + i32.const 1808 + call $~lib/string/String.__gte + i32.eqz + if i32.const 0 - call $~lib/string/String#split|trampoline - end - global.set $std/string/sa - block $~lib/array/Array<~lib/string/String>#get:length|inlined.3 (result i32) - global.get $std/string/sa - local.set $2 - local.get $2 - i32.load offset=4 - end - i32.const 1 - i32.eq - local.tee $2 - if (result i32) - global.get $std/string/sa + i32.const 72 + i32.const 110 i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 1192 - call $~lib/string/String.__eq - else - local.get $2 + call $~lib/builtins/abort + unreachable end + i32.const 1784 + i32.const 1456 + call $~lib/string/String.__gt i32.eqz if i32.const 0 - i32.const 48 - i32.const 168 + i32.const 72 + i32.const 111 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block (result i32) - i32.const 1 - global.set $~lib/argc - i32.const 1192 - i32.const 432 - i32.const 0 - call $~lib/string/String#split|trampoline - end - global.set $std/string/sa - block $~lib/array/Array<~lib/string/String>#get:length|inlined.4 (result i32) - global.get $std/string/sa - local.set $2 - local.get $2 - i32.load offset=4 - end - i32.const 3 - i32.eq - local.tee $2 - if (result i32) - global.get $std/string/sa + i32.const 1784 + i32.const 1456 + call $~lib/string/String.__lt + i32.eqz + i32.eqz + if i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 128 - call $~lib/string/String.__eq - else - local.get $2 - end - local.tee $2 - if (result i32) - global.get $std/string/sa - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 648 - call $~lib/string/String.__eq - else - local.get $2 - end - local.tee $2 - if (result i32) - global.get $std/string/sa - i32.const 2 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 1216 - call $~lib/string/String.__eq - else - local.get $2 + i32.const 72 + i32.const 112 + i32.const 0 + call $~lib/builtins/abort + unreachable end + i32.const 1432 + global.get $std/string/nullStr + call $~lib/string/String.__lt + i32.eqz i32.eqz if i32.const 0 - i32.const 48 - i32.const 170 + i32.const 72 + i32.const 114 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block (result i32) - i32.const 1 - global.set $~lib/argc - i32.const 1224 - i32.const 1248 + global.get $std/string/nullStr + i32.const 1432 + call $~lib/string/String.__lt + i32.eqz + i32.eqz + if i32.const 0 - call $~lib/string/String#split|trampoline - end - global.set $std/string/sa - block $~lib/array/Array<~lib/string/String>#get:length|inlined.5 (result i32) - global.get $std/string/sa - local.set $2 - local.get $2 - i32.load offset=4 - end - i32.const 3 - i32.eq - local.tee $2 - if (result i32) - global.get $std/string/sa + i32.const 72 + i32.const 115 i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 128 - call $~lib/string/String.__eq - else - local.get $2 - end - local.tee $2 - if (result i32) - global.get $std/string/sa - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 648 - call $~lib/string/String.__eq - else - local.get $2 - end - local.tee $2 - if (result i32) - global.get $std/string/sa - i32.const 2 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 1216 - call $~lib/string/String.__eq - else - local.get $2 + call $~lib/builtins/abort + unreachable end + i32.const 680 + i32.const 120 + call $~lib/string/String.__gt i32.eqz if i32.const 0 - i32.const 48 - i32.const 172 + i32.const 72 + i32.const 117 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block (result i32) - i32.const 1 - global.set $~lib/argc - i32.const 1256 - i32.const 432 + i32.const 120 + i32.const 680 + call $~lib/string/String.__lt + i32.eqz + if i32.const 0 - call $~lib/string/String#split|trampoline - end - global.set $std/string/sa - block $~lib/array/Array<~lib/string/String>#get:length|inlined.6 (result i32) - global.get $std/string/sa - local.set $2 - local.get $2 - i32.load offset=4 - end - i32.const 4 - i32.eq - local.tee $2 - if (result i32) - global.get $std/string/sa + i32.const 72 + i32.const 118 i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 128 - call $~lib/string/String.__eq - else - local.get $2 - end - local.tee $2 - if (result i32) - global.get $std/string/sa - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 648 - call $~lib/string/String.__eq - else - local.get $2 - end - local.tee $2 - if (result i32) - global.get $std/string/sa - i32.const 2 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 112 - call $~lib/string/String.__eq - else - local.get $2 - end - local.tee $2 - if (result i32) - global.get $std/string/sa - i32.const 3 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 1216 - call $~lib/string/String.__eq - else - local.get $2 + call $~lib/builtins/abort + unreachable end + i32.const 680 + i32.const 120 + call $~lib/string/String.__gte i32.eqz if i32.const 0 - i32.const 48 - i32.const 174 + i32.const 72 + i32.const 119 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block (result i32) - i32.const 1 - global.set $~lib/argc - i32.const 1272 - i32.const 432 + i32.const 120 + i32.const 680 + call $~lib/string/String.__lte + i32.eqz + if i32.const 0 - call $~lib/string/String#split|trampoline - end - global.set $std/string/sa - block $~lib/array/Array<~lib/string/String>#get:length|inlined.7 (result i32) - global.get $std/string/sa - local.set $2 - local.get $2 - i32.load offset=4 - end - i32.const 4 - i32.eq - local.tee $2 - if (result i32) - global.get $std/string/sa + i32.const 72 + i32.const 120 i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 112 - call $~lib/string/String.__eq - else - local.get $2 - end - local.tee $2 - if (result i32) - global.get $std/string/sa - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 128 - call $~lib/string/String.__eq - else - local.get $2 - end - local.tee $2 - if (result i32) - global.get $std/string/sa - i32.const 2 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 648 - call $~lib/string/String.__eq - else - local.get $2 - end - local.tee $2 - if (result i32) - global.get $std/string/sa - i32.const 3 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 1216 - call $~lib/string/String.__eq - else - local.get $2 + call $~lib/builtins/abort + unreachable end + i32.const 680 + i32.const 120 + call $~lib/string/String.__lt + i32.eqz i32.eqz if i32.const 0 - i32.const 48 - i32.const 176 + i32.const 72 + i32.const 121 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block (result i32) - i32.const 1 - global.set $~lib/argc - i32.const 1288 - i32.const 432 + i32.const 120 + i32.const 680 + call $~lib/string/String.__gt + i32.eqz + i32.eqz + if i32.const 0 - call $~lib/string/String#split|trampoline - end - global.set $std/string/sa - block $~lib/array/Array<~lib/string/String>#get:length|inlined.8 (result i32) - global.get $std/string/sa - local.set $2 - local.get $2 - i32.load offset=4 - end - i32.const 4 - i32.eq - local.tee $2 - if (result i32) - global.get $std/string/sa + i32.const 72 + i32.const 122 i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 128 - call $~lib/string/String.__eq - else - local.get $2 - end - local.tee $2 - if (result i32) - global.get $std/string/sa - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 648 - call $~lib/string/String.__eq - else - local.get $2 - end - local.tee $2 - if (result i32) - global.get $std/string/sa - i32.const 2 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 1216 - call $~lib/string/String.__eq - else - local.get $2 - end - local.tee $2 - if (result i32) - global.get $std/string/sa - i32.const 3 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 112 - call $~lib/string/String.__eq - else - local.get $2 + call $~lib/builtins/abort + unreachable end + i32.const 120 + i32.const 120 + call $~lib/string/String.__lt + i32.eqz i32.eqz if i32.const 0 - i32.const 48 - i32.const 178 + i32.const 72 + i32.const 123 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block (result i32) - i32.const 1 - global.set $~lib/argc - i32.const 288 - i32.const 112 + i32.const 120 + i32.const 120 + call $~lib/string/String.__gt + i32.eqz + i32.eqz + if i32.const 0 - call $~lib/string/String#split|trampoline - end - global.set $std/string/sa - block $~lib/array/Array<~lib/string/String>#get:length|inlined.9 (result i32) - global.get $std/string/sa - local.set $2 - local.get $2 - i32.load offset=4 - end - i32.const 3 - i32.eq - local.tee $2 - if (result i32) - global.get $std/string/sa + i32.const 72 + i32.const 124 i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 128 - call $~lib/string/String.__eq - else - local.get $2 - end - local.tee $2 - if (result i32) - global.get $std/string/sa - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 648 - call $~lib/string/String.__eq - else - local.get $2 + call $~lib/builtins/abort + unreachable end - local.tee $2 - if (result i32) - global.get $std/string/sa - i32.const 2 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 1216 - call $~lib/string/String.__eq - else - local.get $2 + i32.const 120 + i32.const 120 + call $~lib/string/String.__gte + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 125 + i32.const 0 + call $~lib/builtins/abort + unreachable end + i32.const 120 + i32.const 120 + call $~lib/string/String.__lte i32.eqz if i32.const 0 - i32.const 48 - i32.const 180 + i32.const 72 + i32.const 126 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 288 - i32.const 112 - i32.const 0 - call $~lib/string/String#split - global.set $std/string/sa - block $~lib/array/Array<~lib/string/String>#get:length|inlined.10 (result i32) - global.get $std/string/sa - local.set $2 - local.get $2 - i32.load offset=4 - end - i32.const 0 + block + i32.const 65377 + call $~lib/string/String.fromCodePoint + local.set $23 + i32.const 55296 + call $~lib/string/String.fromCodePoint + local.tee $22 + i32.const 56322 + call $~lib/string/String.fromCodePoint + local.tee $24 + call $~lib/string/String.__concat + local.tee $25 + call $~lib/rt/pure/__retain + local.set $26 + local.get $23 + local.get $26 + call $~lib/string/String.__gt + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 131 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $23 + call $~lib/rt/pure/__release + local.get $22 + call $~lib/rt/pure/__release + local.get $24 + call $~lib/rt/pure/__release + local.get $25 + call $~lib/rt/pure/__release + local.get $26 + call $~lib/rt/pure/__release + end + i32.const 736 + call $~lib/string/String#get:length + i32.const 3 i32.eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 182 + i32.const 72 + i32.const 134 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 288 - i32.const 112 - i32.const 1 - call $~lib/string/String#split - global.set $std/string/sa - block $~lib/array/Array<~lib/string/String>#get:length|inlined.11 (result i32) - global.get $std/string/sa - local.set $2 - local.get $2 - i32.load offset=4 - end - i32.const 1 - i32.eq - local.tee $2 - if (result i32) - global.get $std/string/sa + i32.const 120 + i32.const 100 + call $~lib/string/String#repeat + local.tee $26 + i32.const 120 + call $~lib/string/String.__eq + i32.eqz + if i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 128 - call $~lib/string/String.__eq - else - local.get $2 + i32.const 72 + i32.const 136 + i32.const 0 + call $~lib/builtins/abort + unreachable end + i32.const 408 + i32.const 0 + call $~lib/string/String#repeat + local.tee $25 + i32.const 120 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 184 + i32.const 72 + i32.const 137 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1192 - i32.const 432 - i32.const 1 - call $~lib/string/String#split - global.set $std/string/sa - block $~lib/array/Array<~lib/string/String>#get:length|inlined.12 (result i32) - global.get $std/string/sa - local.set $2 - local.get $2 - i32.load offset=4 - end + i32.const 408 i32.const 1 - i32.eq - local.tee $2 - if (result i32) - global.get $std/string/sa + call $~lib/string/String#repeat + local.tee $24 + i32.const 408 + call $~lib/string/String.__eq + i32.eqz + if i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 128 - call $~lib/string/String.__eq - else - local.get $2 + i32.const 72 + i32.const 138 + i32.const 0 + call $~lib/builtins/abort + unreachable end + i32.const 408 + i32.const 2 + call $~lib/string/String#repeat + local.tee $22 + i32.const 1808 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 186 + i32.const 72 + i32.const 139 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 288 - i32.const 112 - i32.const 4 - call $~lib/string/String#split - global.set $std/string/sa - block $~lib/array/Array<~lib/string/String>#get:length|inlined.13 (result i32) - global.get $std/string/sa - local.set $2 - local.get $2 - i32.load offset=4 - end + i32.const 408 i32.const 3 - i32.eq - local.tee $2 - if (result i32) - global.get $std/string/sa + call $~lib/string/String#repeat + local.tee $23 + i32.const 1880 + call $~lib/string/String.__eq + i32.eqz + if i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 128 - call $~lib/string/String.__eq - else - local.get $2 - end - local.tee $2 - if (result i32) - global.get $std/string/sa - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 648 - call $~lib/string/String.__eq - else - local.get $2 - end - local.tee $2 - if (result i32) - global.get $std/string/sa - i32.const 2 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 1216 - call $~lib/string/String.__eq - else - local.get $2 + i32.const 72 + i32.const 140 + i32.const 0 + call $~lib/builtins/abort + unreachable end + i32.const 1456 + i32.const 4 + call $~lib/string/String#repeat + local.tee $27 + i32.const 1904 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 188 + i32.const 72 + i32.const 141 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 288 - i32.const 112 - i32.const -1 - call $~lib/string/String#split - global.set $std/string/sa - block $~lib/array/Array<~lib/string/String>#get:length|inlined.14 (result i32) - global.get $std/string/sa - local.set $2 - local.get $2 - i32.load offset=4 + i32.const 408 + i32.const 5 + call $~lib/string/String#repeat + local.tee $28 + i32.const 1936 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 142 + i32.const 0 + call $~lib/builtins/abort + unreachable end - i32.const 3 - i32.eq - local.tee $2 - if (result i32) - global.get $std/string/sa + i32.const 408 + i32.const 6 + call $~lib/string/String#repeat + local.tee $29 + i32.const 1968 + call $~lib/string/String.__eq + i32.eqz + if i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 128 - call $~lib/string/String.__eq - else - local.get $2 + i32.const 72 + i32.const 143 + i32.const 0 + call $~lib/builtins/abort + unreachable end - local.tee $2 - if (result i32) - global.get $std/string/sa - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 648 - call $~lib/string/String.__eq - else - local.get $2 + i32.const 408 + i32.const 7 + call $~lib/string/String#repeat + local.tee $30 + i32.const 2000 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 144 + i32.const 0 + call $~lib/builtins/abort + unreachable end - local.tee $2 - if (result i32) - global.get $std/string/sa - i32.const 2 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 1216 - call $~lib/string/String.__eq - else - local.get $2 + block (result i32) + i32.const 2032 + local.tee $31 + global.get $std/string/str + local.tee $32 + i32.ne + if + local.get $31 + call $~lib/rt/pure/__retain + drop + local.get $32 + call $~lib/rt/pure/__release + end + local.get $31 end + global.set $std/string/str + global.get $std/string/str + i32.const 0 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#slice + local.tee $31 + i32.const 2032 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 190 + i32.const 72 + i32.const 148 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 1192 - i32.const 432 + global.get $std/string/str i32.const -1 - call $~lib/string/String#split - global.set $std/string/sa - block $~lib/array/Array<~lib/string/String>#get:length|inlined.15 (result i32) - global.get $std/string/sa - local.set $2 - local.get $2 - i32.load offset=4 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#slice + local.tee $32 + i32.const 2080 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 149 + i32.const 0 + call $~lib/builtins/abort + unreachable end - i32.const 3 - i32.eq - local.tee $2 - if (result i32) - global.get $std/string/sa + global.get $std/string/str + i32.const -5 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#slice + local.tee $33 + i32.const 2104 + call $~lib/string/String.__eq + i32.eqz + if i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 128 - call $~lib/string/String.__eq - else - local.get $2 + i32.const 72 + i32.const 150 + i32.const 0 + call $~lib/builtins/abort + unreachable end - local.tee $2 - if (result i32) - global.get $std/string/sa - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 648 - call $~lib/string/String.__eq - else - local.get $2 + global.get $std/string/str + i32.const 2 + i32.const 7 + call $~lib/string/String#slice + local.tee $34 + i32.const 2136 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 151 + i32.const 0 + call $~lib/builtins/abort + unreachable end - local.tee $2 - if (result i32) - global.get $std/string/sa - i32.const 2 - call $~lib/array/Array<~lib/string/String>#__get - i32.const 1216 - call $~lib/string/String.__eq - else - local.get $2 + global.get $std/string/str + i32.const -11 + i32.const -6 + call $~lib/string/String#slice + local.tee $35 + i32.const 2168 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 152 + i32.const 0 + call $~lib/builtins/abort + unreachable end + global.get $std/string/str + i32.const 4 + i32.const 3 + call $~lib/string/String#slice + local.tee $36 + i32.const 120 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 - i32.const 192 + i32.const 72 + i32.const 153 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + global.get $std/string/str i32.const 0 - call $~lib/internal/number/itoa32 - i32.const 480 + i32.const -1 + call $~lib/string/String#slice + local.tee $37 + i32.const 2200 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 + i32.const 154 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + block + i32.const 0 + local.set $38 + block (result i32) + i32.const 120 + i32.const 0 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#split + local.set $39 + local.get $38 + call $~lib/rt/pure/__release + local.get $39 + end + local.set $38 + local.get $38 + call $~lib/array/Array<~lib/string/String>#get:length + i32.const 1 + i32.eq + if (result i32) + local.get $38 + i32.const 0 + call $~lib/array/Array<~lib/string/String>#__get + local.tee $39 + i32.const 120 + call $~lib/string/String.__eq + local.set $40 + local.get $39 + call $~lib/rt/pure/__release + local.get $40 + else + i32.const 0 + end + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 160 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 120 + i32.const 120 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#split + local.set $40 + local.get $38 + call $~lib/rt/pure/__release + local.get $40 + end + local.set $38 + local.get $38 + call $~lib/array/Array<~lib/string/String>#get:length + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 162 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 120 + i32.const 920 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#split + local.set $39 + local.get $38 + call $~lib/rt/pure/__release + local.get $39 + end + local.set $38 + local.get $38 + call $~lib/array/Array<~lib/string/String>#get:length + i32.const 1 + i32.eq + if (result i32) + local.get $38 + i32.const 0 + call $~lib/array/Array<~lib/string/String>#__get + local.tee $39 + i32.const 120 + call $~lib/string/String.__eq + local.set $40 + local.get $39 + call $~lib/rt/pure/__release + local.get $40 + else + i32.const 0 + end + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 164 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 2408 + i32.const 2440 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#split + local.set $40 + local.get $38 + call $~lib/rt/pure/__release + local.get $40 + end + local.set $38 + local.get $38 + call $~lib/array/Array<~lib/string/String>#get:length + i32.const 1 + i32.eq + if (result i32) + local.get $38 + i32.const 0 + call $~lib/array/Array<~lib/string/String>#__get + local.tee $40 + i32.const 2408 + call $~lib/string/String.__eq + local.set $39 + local.get $40 + call $~lib/rt/pure/__release + local.get $39 + else + i32.const 0 + end + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 166 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + i32.const 2408 + i32.const 920 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/string/String#split + local.set $39 + local.get $38 + call $~lib/rt/pure/__release + local.get $39 + end + local.set $38 + local.get $38 + call $~lib/array/Array<~lib/string/String>#get:length + i32.const 3 + i32.eq + if (result i32) + local.get $38 + i32.const 0 + call $~lib/array/Array<~lib/string/String>#__get + local.tee $39 + i32.const 408 + call $~lib/string/String.__eq + local.set $40 + local.get $39 + call $~lib/rt/pure/__release + local.get $40 + else + i32.const 0 + end + i32.const 0 + i32.ne + if (result i32) + local.get $38 + i32.const 1 + call $~lib/array/Array<~lib/string/String>#__get + local.tee $39 + i32.const 1432 + call $~lib/string/String.__eq + local.set $40 + local.get $39 + call $~lib/rt/pure/__release + local.get $40 + else + i32.const 0 + end + i32.const 0 + i32.ne + if (result i32) + local.get $38 + i32.const 2 + call $~lib/array/Array<~lib/string/String>#__get + local.tee $39 + i32.const 2464 + call $~lib/string/String.__eq + local.set $40 + local.get $39 + call $~lib/rt/pure/__release + local.get $40 + else + i32.const 0 + end + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 168 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $38 + call $~lib/rt/pure/__release + end + i32.const 0 + call $~lib/util/number/itoa32 + local.tee $38 + i32.const 1040 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 i32.const 194 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 - call $~lib/internal/number/itoa32 - i32.const 488 + call $~lib/util/number/itoa32 + local.tee $39 + i32.const 1064 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 195 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 8 - call $~lib/internal/number/itoa32 - i32.const 1824 + call $~lib/util/number/itoa32 + local.tee $40 + i32.const 2936 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 196 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 123 - call $~lib/internal/number/itoa32 - i32.const 320 + call $~lib/util/number/itoa32 + local.tee $41 + i32.const 736 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 197 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const -1000 - call $~lib/internal/number/itoa32 - i32.const 1832 + call $~lib/util/number/itoa32 + local.tee $42 + i32.const 2960 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 198 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1234 - call $~lib/internal/number/itoa32 - i32.const 1848 + call $~lib/util/number/itoa32 + local.tee $43 + i32.const 2992 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 199 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 12345 - call $~lib/internal/number/itoa32 - i32.const 1864 + call $~lib/util/number/itoa32 + local.tee $44 + i32.const 3016 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 200 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 123456 - call $~lib/internal/number/itoa32 - i32.const 1880 + call $~lib/util/number/itoa32 + local.tee $45 + i32.const 3048 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 201 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1111111 - call $~lib/internal/number/itoa32 - i32.const 1896 + call $~lib/util/number/itoa32 + local.tee $46 + i32.const 3080 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 202 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1234567 - call $~lib/internal/number/itoa32 - i32.const 1920 + call $~lib/util/number/itoa32 + local.tee $47 + i32.const 3112 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 203 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2147483646 - call $~lib/internal/number/itoa32 - i32.const 1944 + call $~lib/util/number/itoa32 + local.tee $48 + i32.const 3144 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 204 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2147483647 - call $~lib/internal/number/itoa32 - i32.const 1968 + call $~lib/util/number/itoa32 + local.tee $49 + i32.const 3184 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 205 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const -2147483648 - call $~lib/internal/number/itoa32 - i32.const 1992 + call $~lib/util/number/itoa32 + local.tee $50 + i32.const 3224 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 206 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const -1 - call $~lib/internal/number/itoa32 - i32.const 2024 + call $~lib/util/number/itoa32 + local.tee $51 + i32.const 3264 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 207 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 - call $~lib/internal/number/utoa32 - i32.const 480 + call $~lib/util/number/utoa32 + local.tee $52 + i32.const 1040 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 209 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1000 - call $~lib/internal/number/utoa32 - i32.const 2032 + call $~lib/util/number/utoa32 + local.tee $53 + i32.const 3288 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 210 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2147483647 - call $~lib/internal/number/utoa32 - i32.const 1968 + call $~lib/util/number/utoa32 + local.tee $54 + i32.const 3184 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 211 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const -2147483648 - call $~lib/internal/number/utoa32 - i32.const 2048 + call $~lib/util/number/utoa32 + local.tee $55 + i32.const 3312 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 212 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/u32.MAX_VALUE - call $~lib/internal/number/utoa32 - i32.const 2072 + call $~lib/util/number/utoa32 + local.tee $56 + i32.const 3352 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 213 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 0 - call $~lib/internal/number/utoa64 - i32.const 480 + call $~lib/util/number/utoa64 + local.tee $57 + i32.const 1040 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 215 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 1234 - call $~lib/internal/number/utoa64 - i32.const 1848 + call $~lib/util/number/utoa64 + local.tee $58 + i32.const 2992 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 216 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 99999999 - call $~lib/internal/number/utoa64 - i32.const 2096 + call $~lib/util/number/utoa64 + local.tee $59 + i32.const 3392 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 217 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 100000000 - call $~lib/internal/number/utoa64 - i32.const 2120 + call $~lib/util/number/utoa64 + local.tee $60 + i32.const 3424 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 218 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 4294967295 - call $~lib/internal/number/utoa64 - i32.const 2072 + call $~lib/util/number/utoa64 + local.tee $61 + i32.const 3352 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 219 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 68719476735 - call $~lib/internal/number/utoa64 - i32.const 2144 + call $~lib/util/number/utoa64 + local.tee $62 + i32.const 3464 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 220 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 868719476735 - call $~lib/internal/number/utoa64 - i32.const 2176 + call $~lib/util/number/utoa64 + local.tee $63 + i32.const 3504 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 221 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 999868719476735 - call $~lib/internal/number/utoa64 - i32.const 2208 + call $~lib/util/number/utoa64 + local.tee $64 + i32.const 3544 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 222 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 9999868719476735 - call $~lib/internal/number/utoa64 - i32.const 2248 + call $~lib/util/number/utoa64 + local.tee $65 + i32.const 3592 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 223 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 19999868719476735 - call $~lib/internal/number/utoa64 - i32.const 2288 + call $~lib/util/number/utoa64 + local.tee $66 + i32.const 3640 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 224 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/u64.MAX_VALUE - call $~lib/internal/number/utoa64 - i32.const 2328 + call $~lib/util/number/utoa64 + local.tee $67 + i32.const 3696 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 225 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 0 - call $~lib/internal/number/itoa64 - i32.const 480 + call $~lib/util/number/itoa64 + local.tee $68 + i32.const 1040 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 227 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -1234 - call $~lib/internal/number/itoa64 - i32.const 2376 + call $~lib/util/number/itoa64 + local.tee $69 + i32.const 3752 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 228 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 4294967295 - call $~lib/internal/number/itoa64 - i32.const 2072 + call $~lib/util/number/itoa64 + local.tee $70 + i32.const 3352 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 229 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -4294967295 - call $~lib/internal/number/itoa64 - i32.const 2392 + call $~lib/util/number/itoa64 + local.tee $71 + i32.const 3784 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 230 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const 68719476735 - call $~lib/internal/number/itoa64 - i32.const 2144 + call $~lib/util/number/itoa64 + local.tee $72 + i32.const 3464 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 231 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -68719476735 - call $~lib/internal/number/itoa64 - i32.const 2424 + call $~lib/util/number/itoa64 + local.tee $73 + i32.const 3824 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 232 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -868719476735 - call $~lib/internal/number/itoa64 - i32.const 2456 + call $~lib/util/number/itoa64 + local.tee $74 + i32.const 3864 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 233 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -999868719476735 - call $~lib/internal/number/itoa64 - i32.const 2488 + call $~lib/util/number/itoa64 + local.tee $75 + i32.const 3912 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 234 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i64.const -19999868719476735 - call $~lib/internal/number/itoa64 - i32.const 2528 + call $~lib/util/number/itoa64 + local.tee $76 + i32.const 3960 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 235 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/i64.MAX_VALUE - call $~lib/internal/number/itoa64 - i32.const 2568 + call $~lib/util/number/itoa64 + local.tee $77 + i32.const 4016 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 236 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/i64.MIN_VALUE - call $~lib/internal/number/itoa64 - i32.const 2616 + call $~lib/util/number/itoa64 + local.tee $78 + i32.const 4072 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 237 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 - call $~lib/internal/number/dtoa - i32.const 2664 + call $~lib/util/number/dtoa + local.tee $79 + i32.const 4128 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 240 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0 - call $~lib/internal/number/dtoa - i32.const 2664 + call $~lib/util/number/dtoa + local.tee $80 + i32.const 4128 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 241 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const nan:0x8000000000000 - call $~lib/internal/number/dtoa - i32.const 2680 + call $~lib/util/number/dtoa + local.tee $81 + i32.const 4152 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 242 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf - call $~lib/internal/number/dtoa - i32.const 2720 + call $~lib/util/number/dtoa + local.tee $82 + i32.const 4216 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 243 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf f64.neg - call $~lib/internal/number/dtoa - i32.const 2696 + call $~lib/util/number/dtoa + local.tee $83 + i32.const 4176 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 244 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f64.EPSILON - call $~lib/internal/number/dtoa - i32.const 4112 + call $~lib/util/number/dtoa + local.tee $84 + i32.const 5304 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 245 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f64.EPSILON f64.neg - call $~lib/internal/number/dtoa - i32.const 4160 + call $~lib/util/number/dtoa + local.tee $85 + i32.const 5368 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 246 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f64.MAX_VALUE - call $~lib/internal/number/dtoa - i32.const 4208 + call $~lib/util/number/dtoa + local.tee $86 + i32.const 5432 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 247 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $~lib/builtins/f64.MAX_VALUE f64.neg - call $~lib/internal/number/dtoa - i32.const 4264 + call $~lib/util/number/dtoa + local.tee $87 + i32.const 5496 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 248 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4185580496821356722454785e274 - call $~lib/internal/number/dtoa - i32.const 4320 + call $~lib/util/number/dtoa + local.tee $88 + i32.const 5560 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 249 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.2250738585072014e-308 - call $~lib/internal/number/dtoa - i32.const 4368 + call $~lib/util/number/dtoa + local.tee $89 + i32.const 5624 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 250 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4.940656e-318 - call $~lib/internal/number/dtoa - i32.const 4424 + call $~lib/util/number/dtoa + local.tee $90 + i32.const 5688 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 253 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9060801153433600 - call $~lib/internal/number/dtoa - i32.const 4456 + call $~lib/util/number/dtoa + local.tee $91 + i32.const 5736 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 254 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4708356024711512064 - call $~lib/internal/number/dtoa - i32.const 4496 + call $~lib/util/number/dtoa + local.tee $92 + i32.const 5792 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 255 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 9409340012568248320 - call $~lib/internal/number/dtoa - i32.const 4544 + call $~lib/util/number/dtoa + local.tee $93 + i32.const 5856 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 256 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 5e-324 - call $~lib/internal/number/dtoa - i32.const 4592 + call $~lib/util/number/dtoa + local.tee $94 + i32.const 5920 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 257 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 - call $~lib/internal/number/dtoa - i32.const 4608 + call $~lib/util/number/dtoa + local.tee $95 + i32.const 5952 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 263 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.1 - call $~lib/internal/number/dtoa - i32.const 592 + call $~lib/util/number/dtoa + local.tee $96 + i32.const 1320 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 264 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1 - call $~lib/internal/number/dtoa - i32.const 4624 + call $~lib/util/number/dtoa + local.tee $97 + i32.const 5976 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 265 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -0.1 - call $~lib/internal/number/dtoa - i32.const 4640 + call $~lib/util/number/dtoa + local.tee $98 + i32.const 6000 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 266 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1e6 - call $~lib/internal/number/dtoa - i32.const 4656 + call $~lib/util/number/dtoa + local.tee $99 + i32.const 6024 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 268 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1e-06 - call $~lib/internal/number/dtoa - i32.const 4680 + call $~lib/util/number/dtoa + local.tee $100 + i32.const 6064 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 269 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1e6 - call $~lib/internal/number/dtoa - i32.const 4704 + call $~lib/util/number/dtoa + local.tee $101 + i32.const 6096 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 270 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1e-06 - call $~lib/internal/number/dtoa - i32.const 4728 + call $~lib/util/number/dtoa + local.tee $102 + i32.const 6136 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 271 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1e7 - call $~lib/internal/number/dtoa - i32.const 4752 + call $~lib/util/number/dtoa + local.tee $103 + i32.const 6176 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 272 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1e-07 - call $~lib/internal/number/dtoa - i32.const 4776 + call $~lib/util/number/dtoa + local.tee $104 + i32.const 6216 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 273 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.e+308 - call $~lib/internal/number/dtoa - i32.const 4792 + call $~lib/util/number/dtoa + local.tee $105 + i32.const 6240 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 275 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1.e+308 - call $~lib/internal/number/dtoa - i32.const 4808 + call $~lib/util/number/dtoa + local.tee $106 + i32.const 6272 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 276 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const inf - call $~lib/internal/number/dtoa - i32.const 2720 + call $~lib/util/number/dtoa + local.tee $107 + i32.const 4216 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 277 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -inf - call $~lib/internal/number/dtoa - i32.const 2696 + call $~lib/util/number/dtoa + local.tee $108 + i32.const 4176 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 278 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1e-308 - call $~lib/internal/number/dtoa - i32.const 4832 + call $~lib/util/number/dtoa + local.tee $109 + i32.const 6304 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 279 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1e-308 - call $~lib/internal/number/dtoa - i32.const 4848 + call $~lib/util/number/dtoa + local.tee $110 + i32.const 6336 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 280 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1e-323 - call $~lib/internal/number/dtoa - i32.const 4872 + call $~lib/util/number/dtoa + local.tee $111 + i32.const 6368 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 281 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const -1e-323 - call $~lib/internal/number/dtoa - i32.const 4888 + call $~lib/util/number/dtoa + local.tee $112 + i32.const 6400 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 282 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0 - call $~lib/internal/number/dtoa - i32.const 2664 + call $~lib/util/number/dtoa + local.tee $113 + i32.const 4128 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 283 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 4294967272 - call $~lib/internal/number/dtoa - i32.const 4912 + call $~lib/util/number/dtoa + local.tee $114 + i32.const 6432 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 285 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1.2312145673456234e-08 - call $~lib/internal/number/dtoa - i32.const 4944 + call $~lib/util/number/dtoa + local.tee $115 + i32.const 6472 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 286 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 555555555.5555556 - call $~lib/internal/number/dtoa - i32.const 4992 + call $~lib/util/number/dtoa + local.tee $116 + i32.const 6536 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 288 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.9999999999999999 - call $~lib/internal/number/dtoa - i32.const 5032 + call $~lib/util/number/dtoa + local.tee $117 + i32.const 6592 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 289 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 - call $~lib/internal/number/dtoa - i32.const 4608 + call $~lib/util/number/dtoa + local.tee $118 + i32.const 5952 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 290 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 12.34 - call $~lib/internal/number/dtoa - i32.const 5072 + call $~lib/util/number/dtoa + local.tee $119 + i32.const 6648 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 291 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1 f64.const 3 f64.div - call $~lib/internal/number/dtoa - i32.const 5088 + call $~lib/util/number/dtoa + local.tee $120 + i32.const 6680 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 293 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1234e17 - call $~lib/internal/number/dtoa - i32.const 5128 + call $~lib/util/number/dtoa + local.tee $121 + i32.const 6736 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 294 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 1234e18 - call $~lib/internal/number/dtoa - i32.const 5184 + call $~lib/util/number/dtoa + local.tee $122 + i32.const 6800 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 295 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 2.71828 - call $~lib/internal/number/dtoa - i32.const 5208 + call $~lib/util/number/dtoa + local.tee $123 + i32.const 6840 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 296 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end f64.const 0.0271828 - call $~lib/internal/number/dtoa - i32.const 5232 + call $~lib/util/number/dtoa + local.tee $124 + i32.const 6872 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 48 + i32.const 72 i32.const 297 i32.const 0 - call $~lib/env/abort - unreachable + call $~lib/builtins/abort + unreachable + end + f64.const 271.828 + call $~lib/util/number/dtoa + local.tee $125 + i32.const 6912 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 298 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const 1.1e+128 + call $~lib/util/number/dtoa + local.tee $126 + i32.const 6944 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 299 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const 1.1e-64 + call $~lib/util/number/dtoa + local.tee $127 + i32.const 6976 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 300 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const 0.000035689 + call $~lib/util/number/dtoa + local.tee $128 + i32.const 7008 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 301 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + global.get $std/string/str + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release + local.get $8 + call $~lib/rt/pure/__release + local.get $9 + call $~lib/rt/pure/__release + local.get $10 + call $~lib/rt/pure/__release + local.get $11 + call $~lib/rt/pure/__release + local.get $12 + call $~lib/rt/pure/__release + local.get $13 + call $~lib/rt/pure/__release + local.get $14 + call $~lib/rt/pure/__release + local.get $15 + call $~lib/rt/pure/__release + local.get $16 + call $~lib/rt/pure/__release + local.get $17 + call $~lib/rt/pure/__release + local.get $18 + call $~lib/rt/pure/__release + local.get $19 + call $~lib/rt/pure/__release + local.get $20 + call $~lib/rt/pure/__release + local.get $21 + call $~lib/rt/pure/__release + local.get $22 + call $~lib/rt/pure/__release + local.get $23 + call $~lib/rt/pure/__release + local.get $24 + call $~lib/rt/pure/__release + local.get $25 + call $~lib/rt/pure/__release + local.get $26 + call $~lib/rt/pure/__release + local.get $27 + call $~lib/rt/pure/__release + local.get $28 + call $~lib/rt/pure/__release + local.get $29 + call $~lib/rt/pure/__release + local.get $30 + call $~lib/rt/pure/__release + local.get $31 + call $~lib/rt/pure/__release + local.get $32 + call $~lib/rt/pure/__release + local.get $33 + call $~lib/rt/pure/__release + local.get $34 + call $~lib/rt/pure/__release + local.get $35 + call $~lib/rt/pure/__release + local.get $36 + call $~lib/rt/pure/__release + local.get $37 + call $~lib/rt/pure/__release + local.get $38 + call $~lib/rt/pure/__release + local.get $39 + call $~lib/rt/pure/__release + local.get $40 + call $~lib/rt/pure/__release + local.get $41 + call $~lib/rt/pure/__release + local.get $42 + call $~lib/rt/pure/__release + local.get $43 + call $~lib/rt/pure/__release + local.get $44 + call $~lib/rt/pure/__release + local.get $45 + call $~lib/rt/pure/__release + local.get $46 + call $~lib/rt/pure/__release + local.get $47 + call $~lib/rt/pure/__release + local.get $48 + call $~lib/rt/pure/__release + local.get $49 + call $~lib/rt/pure/__release + local.get $50 + call $~lib/rt/pure/__release + local.get $51 + call $~lib/rt/pure/__release + local.get $52 + call $~lib/rt/pure/__release + local.get $53 + call $~lib/rt/pure/__release + local.get $54 + call $~lib/rt/pure/__release + local.get $55 + call $~lib/rt/pure/__release + local.get $56 + call $~lib/rt/pure/__release + local.get $57 + call $~lib/rt/pure/__release + local.get $58 + call $~lib/rt/pure/__release + local.get $59 + call $~lib/rt/pure/__release + local.get $60 + call $~lib/rt/pure/__release + local.get $61 + call $~lib/rt/pure/__release + local.get $62 + call $~lib/rt/pure/__release + local.get $63 + call $~lib/rt/pure/__release + local.get $64 + call $~lib/rt/pure/__release + local.get $65 + call $~lib/rt/pure/__release + local.get $66 + call $~lib/rt/pure/__release + local.get $67 + call $~lib/rt/pure/__release + local.get $68 + call $~lib/rt/pure/__release + local.get $69 + call $~lib/rt/pure/__release + local.get $70 + call $~lib/rt/pure/__release + local.get $71 + call $~lib/rt/pure/__release + local.get $72 + call $~lib/rt/pure/__release + local.get $73 + call $~lib/rt/pure/__release + local.get $74 + call $~lib/rt/pure/__release + local.get $75 + call $~lib/rt/pure/__release + local.get $76 + call $~lib/rt/pure/__release + local.get $77 + call $~lib/rt/pure/__release + local.get $78 + call $~lib/rt/pure/__release + local.get $79 + call $~lib/rt/pure/__release + local.get $80 + call $~lib/rt/pure/__release + local.get $81 + call $~lib/rt/pure/__release + local.get $82 + call $~lib/rt/pure/__release + local.get $83 + call $~lib/rt/pure/__release + local.get $84 + call $~lib/rt/pure/__release + local.get $85 + call $~lib/rt/pure/__release + local.get $86 + call $~lib/rt/pure/__release + local.get $87 + call $~lib/rt/pure/__release + local.get $88 + call $~lib/rt/pure/__release + local.get $89 + call $~lib/rt/pure/__release + local.get $90 + call $~lib/rt/pure/__release + local.get $91 + call $~lib/rt/pure/__release + local.get $92 + call $~lib/rt/pure/__release + local.get $93 + call $~lib/rt/pure/__release + local.get $94 + call $~lib/rt/pure/__release + local.get $95 + call $~lib/rt/pure/__release + local.get $96 + call $~lib/rt/pure/__release + local.get $97 + call $~lib/rt/pure/__release + local.get $98 + call $~lib/rt/pure/__release + local.get $99 + call $~lib/rt/pure/__release + local.get $100 + call $~lib/rt/pure/__release + local.get $101 + call $~lib/rt/pure/__release + local.get $102 + call $~lib/rt/pure/__release + local.get $103 + call $~lib/rt/pure/__release + local.get $104 + call $~lib/rt/pure/__release + local.get $105 + call $~lib/rt/pure/__release + local.get $106 + call $~lib/rt/pure/__release + local.get $107 + call $~lib/rt/pure/__release + local.get $108 + call $~lib/rt/pure/__release + local.get $109 + call $~lib/rt/pure/__release + local.get $110 + call $~lib/rt/pure/__release + local.get $111 + call $~lib/rt/pure/__release + local.get $112 + call $~lib/rt/pure/__release + local.get $113 + call $~lib/rt/pure/__release + local.get $114 + call $~lib/rt/pure/__release + local.get $115 + call $~lib/rt/pure/__release + local.get $116 + call $~lib/rt/pure/__release + local.get $117 + call $~lib/rt/pure/__release + local.get $118 + call $~lib/rt/pure/__release + local.get $119 + call $~lib/rt/pure/__release + local.get $120 + call $~lib/rt/pure/__release + local.get $121 + call $~lib/rt/pure/__release + local.get $122 + call $~lib/rt/pure/__release + local.get $123 + call $~lib/rt/pure/__release + local.get $124 + call $~lib/rt/pure/__release + local.get $125 + call $~lib/rt/pure/__release + local.get $126 + call $~lib/rt/pure/__release + local.get $127 + call $~lib/rt/pure/__release + local.get $128 + call $~lib/rt/pure/__release + ) + (func $std/string/getString (; 83 ;) (type $FUNCSIG$i) (result i32) + global.get $std/string/str + call $~lib/rt/pure/__retain + ) + (func $start (; 84 ;) (type $FUNCSIG$v) + global.get $~lib/started + if + return + else + i32.const 1 + global.set $~lib/started + end + call $start:std/string + ) + (func $~lib/rt/pure/markGray (; 85 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members + end + ) + (func $~lib/rt/pure/scanBlack (; 86 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 87 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (; 88 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + ) + (func $~lib/rt/pure/__visit (; 89 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/pure/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 136 + i32.const 75 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/pure/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 136 + i32.const 86 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/pure/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 136 + i32.const 97 + i32.const 24 + call $~lib/builtins/abort + unreachable + end end - f64.const 271.828 - call $~lib/internal/number/dtoa - i32.const 5256 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 48 - i32.const 298 - i32.const 0 - call $~lib/env/abort - unreachable + ) + (func $~lib/array/Array<~lib/string/String>#__visit_impl (; 90 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=4 + local.set $2 + local.get $2 + local.get $0 + i32.load offset=12 + i32.const 2 + i32.shl + i32.add + local.set $3 + block $break|0 + loop $continue|0 + local.get $2 + local.get $3 + i32.lt_u + if + local.get $2 + i32.load + local.set $4 + local.get $4 + if + local.get $4 + local.get $1 + call $~lib/rt/pure/__visit + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $continue|0 + end + end end - f64.const 1.1e+128 - call $~lib/internal/number/dtoa - i32.const 5280 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 48 - i32.const 299 - i32.const 0 - call $~lib/env/abort - unreachable + ) + (func $~lib/array/Array#__visit_impl (; 91 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/array/Array#__visit_impl (; 92 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/array/Array#__visit_impl (; 93 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/array/Array#__visit_impl (; 94 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/rt/__visit_members (; 95 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block $block$4$break + block + end + block $switch$1$leave + block $switch$1$default + block $switch$1$case$9 + block $switch$1$case$8 + block $switch$1$case$7 + block $switch$1$case$6 + block $switch$1$case$5 + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$case$5 $switch$1$case$6 $switch$1$case$7 $switch$1$case$8 $switch$1$case$9 $switch$1$default + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + br $block$4$break + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/string/String>#__visit_impl + block + br $block$4$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$4$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$4$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$4$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$4$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end end - f64.const 1.1e-64 - call $~lib/internal/number/dtoa - i32.const 5304 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 48 - i32.const 300 - i32.const 0 - call $~lib/env/abort + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + end + return + unreachable + end unreachable - end - f64.const 0.000035689 - call $~lib/internal/number/dtoa - i32.const 5328 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 48 - i32.const 301 - i32.const 0 - call $~lib/env/abort unreachable end + unreachable ) - (func $std/string/getString (; 66 ;) (type $FUNCSIG$i) (result i32) - global.get $std/string/str - ) - (func $start (; 67 ;) (type $FUNCSIG$v) - call $start:std/string - ) - (func $null (; 68 ;) (type $FUNCSIG$v) + (func $null (; 96 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/std/symbol.json b/tests/compiler/std/symbol.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/std/symbol.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/std/symbol.optimized.wat b/tests/compiler/std/symbol.optimized.wat index b49424c1d1..2ec361f760 100644 --- a/tests/compiler/std/symbol.optimized.wat +++ b/tests/compiler/std/symbol.optimized.wat @@ -1,47 +1,44 @@ (module - (type $FUNCSIG$v (func)) (type $FUNCSIG$ii (func (param i32) (result i32))) - (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$vi (func (param i32))) - (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) - (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$v (func)) (type $FUNCSIG$i (func (result i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\03\00\00\001\002\003") - (data (i32.const 24) "\0d\00\00\00s\00t\00d\00/\00s\00y\00m\00b\00o\00l\00.\00t\00s") - (data (i32.const 56) "\13\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") - (data (i32.const 104) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") - (data (i32.const 176) "\0b\00\00\00h\00a\00s\00I\00n\00s\00t\00a\00n\00c\00e") - (data (i32.const 208) "\12\00\00\00i\00s\00C\00o\00n\00c\00a\00t\00S\00p\00r\00e\00a\00d\00a\00b\00l\00e") - (data (i32.const 248) "\08\00\00\00i\00s\00R\00e\00g\00E\00x\00p") - (data (i32.const 272) "\05\00\00\00m\00a\00t\00c\00h") - (data (i32.const 288) "\07\00\00\00r\00e\00p\00l\00a\00c\00e") - (data (i32.const 312) "\06\00\00\00s\00e\00a\00r\00c\00h") - (data (i32.const 328) "\07\00\00\00s\00p\00e\00c\00i\00e\00s") - (data (i32.const 352) "\05\00\00\00s\00p\00l\00i\00t") - (data (i32.const 368) "\0b\00\00\00t\00o\00P\00r\00i\00m\00i\00t\00i\00v\00e") - (data (i32.const 400) "\0b\00\00\00t\00o\00S\00t\00r\00i\00n\00g\00T\00a\00g") - (data (i32.const 432) "\0b\00\00\00u\00n\00s\00c\00o\00p\00a\00b\00l\00e\00s") - (data (i32.const 464) "\07\00\00\00S\00y\00m\00b\00o\00l\00(") - (data (i32.const 488) "\04\00\00\00n\00u\00l\00l") - (data (i32.const 504) "\0e\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s") - (data (i32.const 536) "\17\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s") - (data (i32.const 592) "\01\00\00\00)") - (data (i32.const 600) "\08\00\00\00S\00y\00m\00b\00o\00l\00(\00)") - (data (i32.const 624) "\0b\00\00\00S\00y\00m\00b\00o\00l\00(\001\002\003\00)") - (data (i32.const 656) "\13\00\00\00S\00y\00m\00b\00o\00l\00(\00h\00a\00s\00I\00n\00s\00t\00a\00n\00c\00e\00)") - (data (i32.const 704) "\1a\00\00\00S\00y\00m\00b\00o\00l\00(\00i\00s\00C\00o\00n\00c\00a\00t\00S\00p\00r\00e\00a\00d\00a\00b\00l\00e\00)") - (table $0 1 funcref) - (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) + (data (i32.const 8) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\001\002\003") + (data (i32.const 32) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00s\00t\00d\00/\00s\00y\00m\00b\00o\00l\00.\00t\00s") + (data (i32.const 80) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h") + (data (i32.const 128) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") + (data (i32.const 188) "\01\00\00\00\01") + (data (i32.const 200) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00h\00a\00s\00I\00n\00s\00t\00a\00n\00c\00e") + (data (i32.const 240) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00i\00s\00C\00o\00n\00c\00a\00t\00S\00p\00r\00e\00a\00d\00a\00b\00l\00e") + (data (i32.const 296) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00i\00s\00R\00e\00g\00E\00x\00p") + (data (i32.const 328) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00m\00a\00t\00c\00h") + (data (i32.const 360) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\00r\00e\00p\00l\00a\00c\00e") + (data (i32.const 392) "\0c\00\00\00\01\00\00\00\01\00\00\00\0c\00\00\00s\00e\00a\00r\00c\00h") + (data (i32.const 424) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\00s\00p\00e\00c\00i\00e\00s") + (data (i32.const 456) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00s\00p\00l\00i\00t") + (data (i32.const 488) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00t\00o\00P\00r\00i\00m\00i\00t\00i\00v\00e") + (data (i32.const 528) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00t\00o\00S\00t\00r\00i\00n\00g\00T\00a\00g") + (data (i32.const 568) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00u\00n\00s\00c\00o\00p\00a\00b\00l\00e\00s") + (data (i32.const 608) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\00S\00y\00m\00b\00o\00l\00(") + (data (i32.const 640) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00n\00u\00l\00l") + (data (i32.const 664) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00)") + (data (i32.const 688) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00S\00y\00m\00b\00o\00l\00(\00)") + (data (i32.const 720) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00S\00y\00m\00b\00o\00l\00(\001\002\003\00)") + (data (i32.const 760) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\00S\00y\00m\00b\00o\00l\00(\00h\00a\00s\00I\00n\00s\00t\00a\00n\00c\00e\00)") + (data (i32.const 816) "4\00\00\00\01\00\00\00\01\00\00\004\00\00\00S\00y\00m\00b\00o\00l\00(\00i\00s\00C\00o\00n\00c\00a\00t\00S\00p\00r\00e\00a\00d\00a\00b\00l\00e\00)") (global $~lib/symbol/nextId (mut i32) (i32.const 12)) (global $std/symbol/sym1 (mut i32) (i32.const 0)) (global $std/symbol/sym2 (mut i32) (i32.const 0)) (global $~lib/symbol/stringToId (mut i32) (i32.const 0)) + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) (global $~lib/symbol/idToString (mut i32) (i32.const 0)) (global $std/symbol/sym3 (mut i32) (i32.const 0)) (global $std/symbol/sym4 (mut i32) (i32.const 0)) @@ -52,20 +49,35 @@ (global $std/symbol/hasInstance (mut i32) (i32.const 0)) (global $std/symbol/isConcatSpreadable (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) - (func $~lib/allocator/arena/__memory_allocate (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/symbol/Symbol (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + global.get $~lib/symbol/nextId + local.tee $0 + i32.const 1 + i32.add + global.set $~lib/symbol/nextId + local.get $0 + i32.eqz + if + unreachable + end + local.get $0 + ) + (func $~lib/rt/stub/__alloc (; 2 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) + (local $4 i32) + (local $5 i32) local.get $0 - i32.const 1073741824 + i32.const 1073741808 i32.gt_u if unreachable end - global.get $~lib/allocator/arena/offset - local.tee $1 + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.tee $3 local.get $0 i32.const 1 local.get $0 @@ -73,20 +85,20 @@ i32.gt_u select i32.add - i32.const 7 + i32.const 15 i32.add - i32.const -8 + i32.const -16 i32.and - local.tee $0 - current_memory local.tee $2 + memory.size + local.tee $4 i32.const 16 i32.shl i32.gt_u if + local.get $4 local.get $2 - local.get $0 - local.get $1 + local.get $3 i32.sub i32.const 65535 i32.add @@ -94,17 +106,17 @@ i32.and i32.const 16 i32.shr_u - local.tee $3 - local.get $2 - local.get $3 + local.tee $5 + local.get $4 + local.get $5 i32.gt_s select - grow_memory + memory.grow i32.const 0 i32.lt_s if - local.get $3 - grow_memory + local.get $5 + memory.grow i32.const 0 i32.lt_s if @@ -112,299 +124,300 @@ end end end - local.get $0 - global.set $~lib/allocator/arena/offset + local.get $2 + global.set $~lib/rt/stub/offset + local.get $3 + i32.const 16 + i32.sub + local.tee $2 local.get $1 + i32.store offset=8 + local.get $2 + local.get $0 + i32.store offset=12 + local.get $3 + ) + (func $~lib/memory/memory.fill (; 3 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.eqz + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 0 + i32.store8 + local.get $0 + local.get $1 + i32.add + i32.const 1 + i32.sub + i32.const 0 + i32.store8 + local.get $1 + i32.const 2 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 1 + i32.add + i32.const 0 + i32.store8 + local.get $0 + i32.const 2 + i32.add + i32.const 0 + i32.store8 + local.get $0 + local.get $1 + i32.add + local.tee $2 + i32.const 2 + i32.sub + i32.const 0 + i32.store8 + local.get $2 + i32.const 3 + i32.sub + i32.const 0 + i32.store8 + local.get $1 + i32.const 6 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 3 + i32.add + i32.const 0 + i32.store8 + local.get $0 + local.get $1 + i32.add + i32.const 4 + i32.sub + i32.const 0 + i32.store8 + local.get $1 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + local.get $0 + i32.sub + i32.const 3 + i32.and + local.tee $1 + i32.sub + local.set $2 + local.get $0 + local.get $1 + i32.add + local.tee $0 + i32.const 0 + i32.store + local.get $2 + i32.const -4 + i32.and + local.tee $1 + local.get $0 + i32.add + i32.const 4 + i32.sub + i32.const 0 + i32.store + local.get $1 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 4 + i32.add + i32.const 0 + i32.store + local.get $0 + i32.const 8 + i32.add + i32.const 0 + i32.store + local.get $0 + local.get $1 + i32.add + local.tee $2 + i32.const 12 + i32.sub + i32.const 0 + i32.store + local.get $2 + i32.const 8 + i32.sub + i32.const 0 + i32.store + local.get $1 + i32.const 24 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 12 + i32.add + i32.const 0 + i32.store + local.get $0 + i32.const 16 + i32.add + i32.const 0 + i32.store + local.get $0 + i32.const 20 + i32.add + i32.const 0 + i32.store + local.get $0 + i32.const 24 + i32.add + i32.const 0 + i32.store + local.get $0 + local.get $1 + i32.add + local.tee $2 + i32.const 28 + i32.sub + i32.const 0 + i32.store + local.get $2 + i32.const 24 + i32.sub + i32.const 0 + i32.store + local.get $2 + i32.const 20 + i32.sub + i32.const 0 + i32.store + local.get $2 + i32.const 16 + i32.sub + i32.const 0 + i32.store + local.get $0 + i32.const 4 + i32.and + i32.const 24 + i32.add + local.tee $2 + local.get $0 + i32.add + local.set $0 + local.get $1 + local.get $2 + i32.sub + local.set $1 + loop $continue|0 + local.get $1 + i32.const 32 + i32.ge_u + if + local.get $0 + i64.const 0 + i64.store + local.get $0 + i32.const 8 + i32.add + i64.const 0 + i64.store + local.get $0 + i32.const 16 + i32.add + i64.const 0 + i64.store + local.get $0 + i32.const 24 + i32.add + i64.const 0 + i64.store + local.get $1 + i32.const 32 + i32.sub + local.set $1 + local.get $0 + i32.const 32 + i32.add + local.set $0 + br $continue|0 + end + end + end ) - (func $~lib/internal/arraybuffer/allocateUnsafe (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/arraybuffer/ArrayBuffer#constructor (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - i32.const 1073741816 + i32.const 1073741808 i32.gt_u if - i32.const 0 - i32.const 104 - i32.const 26 - i32.const 2 - call $~lib/env/abort + i32.const 96 + i32.const 144 + i32.const 56 + i32.const 42 + call $~lib/builtins/abort unreachable end - i32.const 1 - i32.const 32 local.get $0 - i32.const 7 - i32.add - i32.clz - i32.sub - i32.shl - call $~lib/allocator/arena/__memory_allocate + i32.const 0 + call $~lib/rt/stub/__alloc local.tee $1 local.get $0 - i32.store + call $~lib/memory/memory.fill local.get $1 ) - (func $~lib/internal/memory/memset (; 3 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - (local $2 i32) - local.get $1 - i32.eqz - if - return - end + (func $~lib/map/Map<~lib/string/String,usize>#clear (; 5 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 local.get $0 - i32.const 0 - i32.store8 + i32.load + drop local.get $0 local.get $1 - i32.add - i32.const 1 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 2 - i32.le_u - if - return - end - local.get $0 - i32.const 1 - i32.add - i32.const 0 - i32.store8 - local.get $0 - i32.const 2 - i32.add - i32.const 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 2 - i32.sub - i32.const 0 - i32.store8 - local.get $2 - i32.const 3 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 6 - i32.le_u - if - return - end - local.get $0 - i32.const 3 - i32.add - i32.const 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - i32.const 4 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 8 - i32.le_u - if - return - end - i32.const 0 + i32.store local.get $0 - i32.sub i32.const 3 - i32.and - local.tee $2 + i32.store offset=4 + i32.const 48 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 local.get $0 - i32.add - local.tee $0 - i32.const 0 - i32.store - local.get $1 - local.get $2 - i32.sub - i32.const -4 - i32.and - local.tee $1 + i32.load offset=8 + drop local.get $0 - i32.add - i32.const 4 - i32.sub - i32.const 0 - i32.store local.get $1 - i32.const 8 - i32.le_u - if - return - end + i32.store offset=8 local.get $0 i32.const 4 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 8 - i32.add - i32.const 0 - i32.store - local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 12 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 8 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 24 - i32.le_u - if - return - end - local.get $0 - i32.const 12 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 16 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 20 - i32.add - i32.const 0 - i32.store + i32.store offset=12 local.get $0 - i32.const 24 - i32.add i32.const 0 - i32.store + i32.store offset=16 local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 28 - i32.sub i32.const 0 - i32.store - local.get $2 + i32.store offset=20 + ) + (func $~lib/map/Map<~lib/string/String,usize>#constructor (; 6 ;) (type $FUNCSIG$i) (result i32) + (local $0 i32) i32.const 24 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 20 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 16 - i32.sub + i32.const 3 + call $~lib/rt/stub/__alloc + local.tee $0 i32.const 0 i32.store local.get $0 - i32.const 4 - i32.and - i32.const 24 - i32.add - local.tee $2 - local.get $0 - i32.add - local.set $0 - local.get $1 - local.get $2 - i32.sub - local.set $1 - loop $continue|0 - local.get $1 - i32.const 32 - i32.ge_u - if - local.get $0 - i64.const 0 - i64.store - local.get $0 - i32.const 8 - i32.add - i64.const 0 - i64.store - local.get $0 - i32.const 16 - i32.add - i64.const 0 - i64.store - local.get $0 - i32.const 24 - i32.add - i64.const 0 - i64.store - local.get $1 - i32.const 32 - i32.sub - local.set $1 - local.get $0 - i32.const 32 - i32.add - local.set $0 - br $continue|0 - end - end - ) - (func $~lib/arraybuffer/ArrayBuffer#constructor (; 4 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - local.get $0 - i32.const 1073741816 - i32.gt_u - if - i32.const 0 - i32.const 56 - i32.const 47 - i32.const 40 - call $~lib/env/abort - unreachable - end - local.get $0 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $2 - local.get $1 - i32.eqz - if - local.get $2 - i32.const 8 - i32.add - local.get $0 - call $~lib/internal/memory/memset - end - local.get $2 - ) - (func $~lib/map/Map<~lib/string/String,usize>#clear (; 5 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 - i32.const 16 i32.const 0 - call $~lib/arraybuffer/ArrayBuffer#constructor - i32.store - local.get $0 - i32.const 3 i32.store offset=4 local.get $0 - i32.const 48 - i32.const 1 - call $~lib/arraybuffer/ArrayBuffer#constructor + i32.const 0 i32.store offset=8 local.get $0 - i32.const 4 + i32.const 0 i32.store offset=12 local.get $0 i32.const 0 @@ -412,11 +425,15 @@ local.get $0 i32.const 0 i32.store offset=20 + local.get $0 + call $~lib/map/Map<~lib/string/String,usize>#clear + local.get $0 ) - (func $~lib/map/Map<~lib/string/String,usize>#constructor (; 6 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/map/Map#constructor (; 7 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 - call $~lib/allocator/arena/__memory_allocate + i32.const 4 + call $~lib/rt/stub/__alloc local.tee $0 i32.const 0 i32.store @@ -439,55 +456,68 @@ call $~lib/map/Map<~lib/string/String,usize>#clear local.get $0 ) - (func $~lib/internal/hash/hashStr (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/string/String#get:length (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u + ) + (func $~lib/util/hash/hashStr (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) i32.const -2128831035 - local.set $2 + local.set $1 local.get $0 - i32.load - i32.const 1 - i32.shl - local.set $3 - loop $repeat|0 + if block $break|0 - local.get $1 - local.get $3 - i32.ge_u - br_if $break|0 local.get $0 - local.get $1 - i32.add - i32.load8_u offset=4 - local.get $2 - i32.xor - i32.const 16777619 - i32.mul - local.set $2 - local.get $1 + call $~lib/string/String#get:length i32.const 1 - i32.add - local.set $1 - br $repeat|0 + i32.shl + local.set $3 + loop $repeat|0 + local.get $2 + local.get $3 + i32.ge_u + br_if $break|0 + local.get $0 + local.get $2 + i32.add + i32.load8_u + local.get $1 + i32.xor + i32.const 16777619 + i32.mul + local.set $1 + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $repeat|0 + unreachable + end + unreachable end end - local.get $2 + local.get $1 ) - (func $~lib/internal/string/compareUnsafe (; 8 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/string/compareImpl (; 10 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) loop $continue|0 local.get $2 if (result i32) local.get $0 - i32.load16_u offset=4 + i32.load16_u local.get $1 - i32.load16_u offset=4 + i32.load16_u i32.sub local.tee $3 i32.eqz else - local.get $2 + i32.const 0 end if local.get $2 @@ -507,7 +537,7 @@ end local.get $3 ) - (func $~lib/string/String.__eq (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__eq (; 11 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 local.get $1 @@ -516,37 +546,30 @@ i32.const 1 return end - local.get $0 - i32.eqz - local.tee $2 - i32.eqz - if + block $folding-inner0 local.get $1 i32.eqz - local.set $2 - end - local.get $2 - if - i32.const 0 - return - end - local.get $0 - i32.load - local.tee $2 - local.get $1 - i32.load - i32.ne - if - i32.const 0 + i32.const 1 + local.get $0 + select + br_if $folding-inner0 + local.get $0 + call $~lib/string/String#get:length + local.tee $2 + local.get $1 + call $~lib/string/String#get:length + i32.ne + br_if $folding-inner0 + local.get $0 + local.get $1 + local.get $2 + call $~lib/util/string/compareImpl + i32.eqz return end - local.get $0 - local.get $1 - local.get $2 - call $~lib/internal/string/compareUnsafe - i32.eqz + i32.const 0 ) - (func $~lib/map/Map<~lib/string/String,usize>#find (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map<~lib/string/String,usize>#find (; 12 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.load local.get $0 @@ -556,40 +579,38 @@ i32.const 2 i32.shl i32.add - i32.load offset=8 - local.set $1 + i32.load + local.set $0 loop $continue|0 - local.get $1 + local.get $0 if - local.get $1 + local.get $0 i32.load offset=8 i32.const 1 i32.and - i32.eqz - local.tee $0 if (result i32) - local.get $1 - i32.load - i32.const 8 - call $~lib/string/String.__eq + i32.const 0 else local.get $0 + i32.load + i32.const 24 + call $~lib/string/String.__eq end if - local.get $1 + local.get $0 return end - local.get $1 + local.get $0 i32.load offset=8 i32.const -2 i32.and - local.set $1 + local.set $0 br $continue|0 end end i32.const 0 ) - (func $~lib/map/Map<~lib/string/String,usize>#rehash (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map<~lib/string/String,usize>#rehash (; 13 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -603,7 +624,6 @@ local.tee $2 i32.const 2 i32.shl - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $4 local.get $2 @@ -614,14 +634,11 @@ local.tee $6 i32.const 12 i32.mul - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $5 local.get $0 i32.load offset=8 - i32.const 8 - i32.add - local.tee $2 + local.tee $3 local.get $0 i32.load offset=16 i32.const 12 @@ -629,32 +646,30 @@ i32.add local.set $7 local.get $5 - i32.const 8 - i32.add - local.set $3 + local.set $2 loop $continue|0 - local.get $2 + local.get $3 local.get $7 i32.ne if - local.get $2 + local.get $3 i32.load offset=8 i32.const 1 i32.and i32.eqz if - local.get $3 local.get $2 + local.get $3 i32.load i32.store - local.get $3 local.get $2 + local.get $3 i32.load offset=4 i32.store offset=4 - local.get $3 local.get $2 + local.get $3 i32.load - call $~lib/internal/hash/hashStr + call $~lib/util/hash/hashStr local.get $1 i32.and i32.const 2 @@ -662,30 +677,36 @@ local.get $4 i32.add local.tee $8 - i32.load offset=8 + i32.load i32.store offset=8 local.get $8 - local.get $3 - i32.store offset=8 - local.get $3 + local.get $2 + i32.store + local.get $2 i32.const 12 i32.add - local.set $3 + local.set $2 end - local.get $2 + local.get $3 i32.const 12 i32.add - local.set $2 + local.set $3 br $continue|0 end end local.get $0 + i32.load + drop + local.get $0 local.get $4 i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 + i32.load offset=8 + drop + local.get $0 local.get $5 i32.store offset=8 local.get $0 @@ -696,13 +717,13 @@ i32.load offset=20 i32.store offset=16 ) - (func $~lib/map/Map<~lib/string/String,usize>#set (; 12 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map<~lib/string/String,usize>#set (; 14 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) local.get $0 - i32.const 8 - call $~lib/internal/hash/hashStr + i32.const 24 + call $~lib/util/hash/hashStr local.tee $3 call $~lib/map/Map<~lib/string/String,usize>#find local.tee $2 @@ -750,15 +771,13 @@ i32.const 1 i32.add i32.store offset=16 - local.get $2 - i32.const 8 - i32.add local.get $4 i32.const 12 i32.mul + local.get $2 i32.add local.tee $2 - i32.const 8 + i32.const 24 i32.store local.get $2 local.get $1 @@ -780,14 +799,14 @@ i32.shl i32.add local.tee $0 - i32.load offset=8 + i32.load i32.store offset=8 local.get $0 local.get $2 - i32.store offset=8 + i32.store end ) - (func $~lib/internal/hash/hash32 (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/hash32 (; 15 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 255 i32.and @@ -818,7 +837,7 @@ i32.const 16777619 i32.mul ) - (func $~lib/map/Map#find (; 14 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 16 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.load local.get $0 @@ -828,40 +847,38 @@ i32.const 2 i32.shl i32.add - i32.load offset=8 - local.set $2 + i32.load + local.set $0 loop $continue|0 - local.get $2 + local.get $0 if - local.get $2 + local.get $0 i32.load offset=8 i32.const 1 i32.and - i32.eqz - local.tee $0 - if - local.get $2 + if (result i32) + i32.const 0 + else + local.get $0 i32.load local.get $1 i32.eq - local.set $0 end - local.get $0 if - local.get $2 + local.get $0 return end - local.get $2 + local.get $0 i32.load offset=8 i32.const -2 i32.and - local.set $2 + local.set $0 br $continue|0 end end i32.const 0 ) - (func $~lib/map/Map#rehash (; 15 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 17 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -875,7 +892,6 @@ local.tee $2 i32.const 2 i32.shl - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $4 local.get $2 @@ -886,14 +902,11 @@ local.tee $6 i32.const 12 i32.mul - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $5 local.get $0 i32.load offset=8 - i32.const 8 - i32.add - local.tee $2 + local.tee $3 local.get $0 i32.load offset=16 i32.const 12 @@ -901,32 +914,30 @@ i32.add local.set $7 local.get $5 - i32.const 8 - i32.add - local.set $3 + local.set $2 loop $continue|0 - local.get $2 + local.get $3 local.get $7 i32.ne if - local.get $2 + local.get $3 i32.load offset=8 i32.const 1 i32.and i32.eqz if - local.get $3 local.get $2 + local.get $3 i32.load i32.store - local.get $3 local.get $2 + local.get $3 i32.load offset=4 i32.store offset=4 - local.get $3 local.get $2 + local.get $3 i32.load - call $~lib/internal/hash/hash32 + call $~lib/util/hash/hash32 local.get $1 i32.and i32.const 2 @@ -934,30 +945,36 @@ local.get $4 i32.add local.tee $8 - i32.load offset=8 + i32.load i32.store offset=8 local.get $8 - local.get $3 - i32.store offset=8 - local.get $3 + local.get $2 + i32.store + local.get $2 i32.const 12 i32.add - local.set $3 + local.set $2 end - local.get $2 + local.get $3 i32.const 12 i32.add - local.set $2 + local.set $3 br $continue|0 end end local.get $0 + i32.load + drop + local.get $0 local.get $4 i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 + i32.load offset=8 + drop + local.get $0 local.get $5 i32.store offset=8 local.get $0 @@ -968,21 +985,27 @@ i32.load offset=20 i32.store offset=16 ) - (func $~lib/map/Map#set (; 16 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#set (; 18 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) local.get $0 local.get $1 local.get $1 - call $~lib/internal/hash/hash32 + call $~lib/util/hash/hash32 local.tee $3 call $~lib/map/Map#find local.tee $2 if local.get $2 - i32.const 8 - i32.store offset=4 + i32.load offset=4 + i32.const 24 + i32.ne + if + local.get $2 + i32.const 24 + i32.store offset=4 + end else local.get $0 i32.load offset=16 @@ -1023,18 +1046,16 @@ i32.const 1 i32.add i32.store offset=16 - local.get $2 - i32.const 8 - i32.add local.get $4 i32.const 12 i32.mul + local.get $2 i32.add local.tee $2 local.get $1 i32.store local.get $2 - i32.const 8 + i32.const 24 i32.store offset=4 local.get $0 local.get $0 @@ -1053,25 +1074,25 @@ i32.shl i32.add local.tee $0 - i32.load offset=8 + i32.load i32.store offset=8 local.get $0 local.get $2 - i32.store offset=8 + i32.store end ) - (func $~lib/symbol/Symbol.for (; 17 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/symbol/_Symbol.for (; 19 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) global.get $~lib/symbol/stringToId if global.get $~lib/symbol/stringToId - i32.const 8 - call $~lib/internal/hash/hashStr + i32.const 24 + call $~lib/util/hash/hashStr call $~lib/map/Map<~lib/string/String,usize>#find if global.get $~lib/symbol/stringToId - i32.const 8 - call $~lib/internal/hash/hashStr + i32.const 24 + call $~lib/util/hash/hashStr call $~lib/map/Map<~lib/string/String,usize>#find local.tee $0 if (result i32) @@ -1085,7 +1106,7 @@ else call $~lib/map/Map<~lib/string/String,usize>#constructor global.set $~lib/symbol/stringToId - call $~lib/map/Map<~lib/string/String,usize>#constructor + call $~lib/map/Map#constructor global.set $~lib/symbol/idToString end global.get $~lib/symbol/nextId @@ -1106,20 +1127,20 @@ call $~lib/map/Map#set local.get $0 ) - (func $~lib/map/Map#has (; 18 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#has (; 20 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 - call $~lib/internal/hash/hash32 + call $~lib/util/hash/hash32 call $~lib/map/Map#find i32.const 0 i32.ne ) - (func $~lib/map/Map#get (; 19 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#get (; 21 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 - call $~lib/internal/hash/hash32 + call $~lib/util/hash/hash32 call $~lib/map/Map#find local.tee $0 if (result i32) @@ -1129,19 +1150,15 @@ unreachable end ) - (func $~lib/symbol/Symbol.keyFor (; 20 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/symbol/_Symbol.keyFor (; 22 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) global.get $~lib/symbol/idToString - i32.const 0 - i32.ne - local.tee $1 - if + if (result i32) global.get $~lib/symbol/idToString local.get $0 call $~lib/map/Map#has - local.set $1 + else + i32.const 0 end - local.get $1 if (result i32) global.get $~lib/symbol/idToString local.get $0 @@ -1150,946 +1167,87 @@ i32.const 0 end ) - (func $~lib/internal/string/allocateUnsafe (; 21 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - local.get $0 - i32.const 0 - i32.gt_s - local.tee $1 - if - local.get $0 - i32.const 536870910 - i32.le_s - local.set $1 - end - local.get $1 - i32.eqz - if - i32.const 0 - i32.const 536 - i32.const 14 - i32.const 2 - call $~lib/env/abort - unreachable - end - local.get $0 - i32.const 1 - i32.shl - i32.const 4 - i32.add - call $~lib/allocator/arena/__memory_allocate - local.tee $1 - local.get $0 - i32.store - local.get $1 - ) - (func $~lib/internal/memory/memcpy (; 22 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/memory/memory.copy (; 23 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - loop $continue|0 - local.get $1 - i32.const 3 - i32.and + block $~lib/util/memory/memmove|inlined.0 local.get $2 - local.get $2 - select + local.set $3 + local.get $0 + local.get $1 + i32.eq + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $1 + i32.lt_u if - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - br $continue|0 - end - end - local.get $0 - i32.const 3 - i32.and - i32.eqz - if - loop $continue|1 - local.get $2 - i32.const 16 - i32.ge_u - if - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $1 - i32.const 4 - i32.add - i32.load - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $1 - i32.const 8 - i32.add - i32.load - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 12 - i32.add - i32.load - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - br $continue|1 - end - end - local.get $2 - i32.const 8 - i32.and - if - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $1 - i32.const 4 - i32.add - i32.load - i32.store - local.get $1 - i32.const 8 - i32.add - local.set $1 - local.get $0 - i32.const 8 - i32.add - local.set $0 - end - local.get $2 - i32.const 4 - i32.and - if - local.get $0 - local.get $1 - i32.load - i32.store - local.get $1 - i32.const 4 - i32.add - local.set $1 - local.get $0 - i32.const 4 - i32.add - local.set $0 - end - local.get $2 - i32.const 2 - i32.and - if - local.get $0 - local.get $1 - i32.load16_u - i32.store16 - local.get $1 - i32.const 2 - i32.add - local.set $1 - local.get $0 - i32.const 2 - i32.add - local.set $0 - end - local.get $2 - i32.const 1 - i32.and - if + i32.const 7 + i32.and local.get $0 - local.get $1 - i32.load8_u - i32.store8 - end - return - end - local.get $2 - i32.const 32 - i32.ge_u - if - block $break|2 - block $case2|2 - block $case1|2 + i32.const 7 + i32.and + i32.eq + if + loop $continue|0 local.get $0 - i32.const 3 + i32.const 7 i32.and - local.tee $3 - i32.const 1 - i32.ne - if - local.get $3 - i32.const 2 - i32.eq - br_if $case1|2 - local.get $3 - i32.const 3 - i32.eq - br_if $case2|2 - br $break|2 - end - local.get $1 - i32.load - local.set $5 - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 3 - i32.sub - local.set $2 - loop $continue|3 - local.get $2 - i32.const 17 - i32.ge_u - if - local.get $0 - local.get $1 - i32.const 1 - i32.add - i32.load - local.tee $3 - i32.const 8 - i32.shl - local.get $5 - i32.const 24 - i32.shr_u - i32.or - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $3 - i32.const 24 - i32.shr_u - local.get $1 - i32.const 5 - i32.add - i32.load - local.tee $3 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $3 - i32.const 24 - i32.shr_u - local.get $1 - i32.const 9 - i32.add - i32.load - local.tee $3 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 13 - i32.add - i32.load - local.tee $5 - i32.const 8 - i32.shl - local.get $3 - i32.const 24 - i32.shr_u - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - br $continue|3 - end - end - br $break|2 - end - local.get $1 - i32.load - local.set $5 - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 2 - i32.sub - local.set $2 - loop $continue|4 - local.get $2 - i32.const 18 - i32.ge_u if - local.get $0 - local.get $1 - i32.const 2 - i32.add - i32.load - local.tee $3 - i32.const 16 - i32.shl - local.get $5 - i32.const 16 - i32.shr_u - i32.or - i32.store - local.get $0 - i32.const 4 - i32.add local.get $3 - i32.const 16 - i32.shr_u - local.get $1 - i32.const 6 - i32.add - i32.load - local.tee $3 - i32.const 16 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 8 - i32.add + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 local.get $3 - i32.const 16 - i32.shr_u - local.get $1 - i32.const 10 - i32.add - i32.load - local.tee $3 - i32.const 16 - i32.shl - i32.or - i32.store + i32.const 1 + i32.sub + local.set $3 local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 14 + local.tee $2 + i32.const 1 i32.add - i32.load - local.tee $5 - i32.const 16 - i32.shl - local.get $3 - i32.const 16 - i32.shr_u - i32.or - i32.store + local.set $0 local.get $1 - i32.const 16 + local.tee $4 + i32.const 1 i32.add local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 local.get $2 - i32.const 16 - i32.sub - local.set $2 - br $continue|4 - end - end - br $break|2 - end - local.get $1 - i32.load - local.set $5 - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - loop $continue|5 - local.get $2 - i32.const 19 - i32.ge_u - if - local.get $0 - local.get $1 - i32.const 3 - i32.add - i32.load - local.tee $3 - i32.const 24 - i32.shl - local.get $5 - i32.const 8 - i32.shr_u - i32.or - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $3 - i32.const 8 - i32.shr_u - local.get $1 - i32.const 7 - i32.add - i32.load - local.tee $3 - i32.const 24 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $3 - i32.const 8 - i32.shr_u - local.get $1 - i32.const 11 - i32.add - i32.load - local.tee $3 - i32.const 24 - i32.shl - i32.or - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 15 - i32.add - i32.load - local.tee $5 - i32.const 24 - i32.shl - local.get $3 - i32.const 8 - i32.shr_u - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - br $continue|5 - end - end - end - end - local.get $2 - i32.const 16 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - end - local.get $2 - i32.const 8 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - end - local.get $2 - i32.const 4 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $0 - local.get $1 - i32.const 1 - i32.add - local.tee $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - end - local.get $2 - i32.const 2 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - local.get $0 - i32.const 1 - i32.add - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - i32.const 1 - i32.add - local.tee $4 - i32.const 1 - i32.add - local.set $1 - local.get $3 - local.get $4 - i32.load8_u - i32.store8 - end - local.get $2 - i32.const 1 - i32.and - if - local.get $0 - local.get $1 - i32.load8_u - i32.store8 - end - ) - (func $~lib/internal/memory/memmove (; 23 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - local.get $0 - local.get $1 - i32.eq - if - return - end - local.get $1 - local.get $2 - i32.add - local.get $0 - i32.le_u - local.tee $3 - i32.eqz - if - local.get $0 - local.get $2 - i32.add - local.get $1 - i32.le_u - local.set $3 - end - local.get $3 - if - local.get $0 - local.get $1 - local.get $2 - call $~lib/internal/memory/memcpy - return - end - local.get $0 - local.get $1 - i32.lt_u - if - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and - i32.eq - if - loop $continue|0 - local.get $0 - i32.const 7 - i32.and - if - local.get $2 - i32.eqz + local.get $4 + i32.load8_u + i32.store8 + br $continue|0 + end + end + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u if - return + local.get $0 + local.get $1 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + br $continue|1 end - local.get $2 - i32.const 1 - i32.sub - local.set $2 + end + end + loop $continue|2 + local.get $3 + if local.get $0 - local.tee $3 + local.tee $2 i32.const 1 i32.add local.set $0 @@ -2098,211 +1256,140 @@ i32.const 1 i32.add local.set $1 - local.get $3 + local.get $2 local.get $4 i32.load8_u i32.store8 - br $continue|0 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 end end - loop $continue|1 - local.get $2 - i32.const 8 - i32.ge_u - if - local.get $0 - local.get $1 - i64.load - i64.store - local.get $2 - i32.const 8 - i32.sub - local.set $2 + else + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|3 local.get $0 - i32.const 8 + local.get $3 i32.add - local.set $0 - local.get $1 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + loop $continue|4 + local.get $3 i32.const 8 - i32.add - local.set $1 - br $continue|1 + i32.ge_u + if + local.get $0 + local.get $3 + i32.const 8 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end end end - end - loop $continue|2 - local.get $2 - if - local.get $0 - local.tee $3 - i32.const 1 - i32.add - local.set $0 - local.get $1 - local.tee $4 - i32.const 1 - i32.add - local.set $1 + loop $continue|5 local.get $3 - local.get $4 - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - br $continue|2 - end - end - else - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and - i32.eq - if - loop $continue|3 - local.get $0 - local.get $2 - i32.add - i32.const 7 - i32.and if - local.get $2 - i32.eqz - if - return - end - local.get $2 + local.get $0 + local.get $3 i32.const 1 i32.sub - local.tee $2 - local.get $0 + local.tee $3 i32.add local.get $1 - local.get $2 + local.get $3 i32.add i32.load8_u i32.store8 - br $continue|3 - end - end - loop $continue|4 - local.get $2 - i32.const 8 - i32.ge_u - if - local.get $2 - i32.const 8 - i32.sub - local.tee $2 - local.get $0 - i32.add - local.get $1 - local.get $2 - i32.add - i64.load - i64.store - br $continue|4 + br $continue|5 end end end - loop $continue|5 - local.get $2 - if - local.get $2 - i32.const 1 - i32.sub - local.tee $2 - local.get $0 - i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 - br $continue|5 - end - end end ) - (func $~lib/internal/string/copyUnsafe (; 24 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - local.get $1 - i32.const 1 - i32.shl - local.get $0 - i32.add - i32.const 4 - i32.add - local.get $2 - i32.const 4 - i32.add - local.get $3 - i32.const 1 - i32.shl - call $~lib/internal/memory/memmove - ) - (func $~lib/string/String#concat (; 25 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#concat (; 24 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) local.get $0 - i32.eqz - if - i32.const 0 - i32.const 504 - i32.const 110 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $0 - i32.load + call $~lib/string/String#get:length + i32.const 1 + i32.shl local.tee $3 local.get $1 - i32.const 488 + i32.const 656 local.get $1 select local.tee $1 - i32.load + call $~lib/string/String#get:length + i32.const 1 + i32.shl local.tee $4 i32.add local.tee $2 i32.eqz if - i32.const 168 + i32.const 200 return end local.get $2 - call $~lib/internal/string/allocateUnsafe + i32.const 1 + call $~lib/rt/stub/__alloc local.tee $2 - i32.const 0 local.get $0 local.get $3 - call $~lib/internal/string/copyUnsafe + call $~lib/memory/memory.copy local.get $2 local.get $3 + i32.add local.get $1 local.get $4 - call $~lib/internal/string/copyUnsafe + call $~lib/memory/memory.copy local.get $2 ) - (func $~lib/string/String.__concat (; 26 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__concat (; 25 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 - i32.const 488 + i32.const 656 local.get $0 select local.get $1 call $~lib/string/String#concat ) - (func $~lib/symbol/symbol#toString (; 27 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - i32.const 168 - local.set $2 - i32.const 464 + (func $~lib/symbol/_Symbol#toString (; 26 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.const 624 block $break|0 (result i32) block $case11|0 block $case10|0 @@ -2320,170 +1407,147 @@ i32.ne if local.get $0 - local.tee $1 i32.const 2 i32.eq br_if $case1|0 block $tablify|0 - local.get $1 + local.get $0 i32.const 3 i32.sub br_table $case2|0 $case3|0 $case4|0 $case5|0 $case6|0 $case7|0 $case8|0 $case9|0 $case10|0 $tablify|0 end br $case11|0 end - i32.const 176 + i32.const 216 br $break|0 end - i32.const 208 + i32.const 256 br $break|0 end - i32.const 248 + i32.const 312 br $break|0 end - i32.const 272 + i32.const 344 br $break|0 end - i32.const 288 + i32.const 376 br $break|0 end - i32.const 312 + i32.const 408 br $break|0 end - i32.const 328 + i32.const 440 br $break|0 end - i32.const 352 + i32.const 472 br $break|0 end - i32.const 368 + i32.const 504 br $break|0 end - i32.const 400 + i32.const 544 br $break|0 end - i32.const 432 + i32.const 584 br $break|0 end global.get $~lib/symbol/idToString - i32.const 0 - i32.ne - local.tee $1 - if + if (result i32) global.get $~lib/symbol/idToString local.get $0 call $~lib/map/Map#has - local.set $1 + else + i32.const 0 end - local.get $1 if (result i32) global.get $~lib/symbol/idToString local.get $0 call $~lib/map/Map#get else - i32.const 168 + i32.const 200 end end call $~lib/string/String.__concat - i32.const 592 + i32.const 680 call $~lib/string/String.__concat ) - (func $start:std/symbol (; 28 ;) (type $FUNCSIG$v) - (local $0 i32) - i32.const 760 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - global.get $~lib/symbol/nextId - local.tee $0 - i32.const 1 - i32.add - global.set $~lib/symbol/nextId - local.get $0 - i32.eqz - if - unreachable - end - local.get $0 + (func $start:std/symbol (; 27 ;) (type $FUNCSIG$v) + i32.const 24 + call $~lib/symbol/Symbol global.set $std/symbol/sym1 - global.get $~lib/symbol/nextId - local.tee $0 - i32.const 1 - i32.add - global.set $~lib/symbol/nextId - local.get $0 - i32.eqz - if - unreachable - end - local.get $0 + i32.const 24 + call $~lib/symbol/Symbol global.set $std/symbol/sym2 global.get $std/symbol/sym1 global.get $std/symbol/sym2 i32.eq if i32.const 0 - i32.const 24 - i32.const 6 + i32.const 48 + i32.const 4 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - call $~lib/symbol/Symbol.for + i32.const 896 + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset + call $~lib/symbol/_Symbol.for global.set $std/symbol/sym3 - call $~lib/symbol/Symbol.for + call $~lib/symbol/_Symbol.for global.set $std/symbol/sym4 global.get $std/symbol/sym3 global.get $std/symbol/sym4 i32.ne if i32.const 0 - i32.const 24 - i32.const 11 + i32.const 48 + i32.const 9 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/symbol/sym1 - call $~lib/symbol/Symbol.keyFor + call $~lib/symbol/_Symbol.keyFor global.set $std/symbol/key1 global.get $std/symbol/sym2 - call $~lib/symbol/Symbol.keyFor + call $~lib/symbol/_Symbol.keyFor global.set $std/symbol/key2 global.get $std/symbol/key1 if i32.const 0 - i32.const 24 - i32.const 16 + i32.const 48 + i32.const 14 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/symbol/key2 if i32.const 0 - i32.const 24 - i32.const 17 + i32.const 48 + i32.const 15 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/symbol/sym3 - call $~lib/symbol/Symbol.keyFor + call $~lib/symbol/_Symbol.keyFor global.set $std/symbol/key3 global.get $std/symbol/sym4 - call $~lib/symbol/Symbol.keyFor + call $~lib/symbol/_Symbol.keyFor global.set $std/symbol/key4 global.get $std/symbol/key3 - i32.const 8 + i32.const 24 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 24 - i32.const 22 + i32.const 48 + i32.const 20 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/symbol/key3 @@ -2492,46 +1556,37 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 23 + i32.const 48 + i32.const 21 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $~lib/symbol/nextId - local.tee $0 - i32.const 1 - i32.add - global.set $~lib/symbol/nextId - local.get $0 - i32.eqz - if + call $~lib/builtins/abort unreachable end - local.get $0 - call $~lib/symbol/symbol#toString - i32.const 600 + i32.const 0 + call $~lib/symbol/Symbol + call $~lib/symbol/_Symbol#toString + i32.const 704 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 24 - i32.const 25 + i32.const 48 + i32.const 23 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/symbol/sym3 - call $~lib/symbol/symbol#toString - i32.const 624 + call $~lib/symbol/_Symbol#toString + i32.const 736 call $~lib/string/String.__eq i32.eqz if i32.const 0 + i32.const 48 i32.const 24 - i32.const 26 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -2539,36 +1594,36 @@ i32.const 2 global.set $std/symbol/isConcatSpreadable global.get $std/symbol/hasInstance - call $~lib/symbol/symbol#toString - i32.const 656 + call $~lib/symbol/_Symbol#toString + i32.const 776 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 24 - i32.const 30 + i32.const 48 + i32.const 28 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/symbol/isConcatSpreadable - call $~lib/symbol/symbol#toString - i32.const 704 + call $~lib/symbol/_Symbol#toString + i32.const 832 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 24 - i32.const 31 + i32.const 48 + i32.const 29 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) - (func $start (; 29 ;) (type $FUNCSIG$v) + (func $start (; 28 ;) (type $FUNCSIG$v) call $start:std/symbol ) - (func $null (; 30 ;) (type $FUNCSIG$v) + (func $null (; 29 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/symbol.ts b/tests/compiler/std/symbol.ts index e5168b36aa..9fb8c76a71 100644 --- a/tests/compiler/std/symbol.ts +++ b/tests/compiler/std/symbol.ts @@ -1,5 +1,3 @@ -import "allocator/arena"; - var sym1 = Symbol("123"); var sym2 = Symbol("123"); @@ -16,8 +14,8 @@ var key2 = Symbol.keyFor(sym2); assert(key1 === null); assert(key2 === null); -var key3 = Symbol.keyFor(sym3); -var key4 = Symbol.keyFor(sym4); +var key3 = Symbol.keyFor(sym3)!; +var key4 = Symbol.keyFor(sym4)!; assert(key3 == "123"); assert(key3 == key4); diff --git a/tests/compiler/std/symbol.untouched.wat b/tests/compiler/std/symbol.untouched.wat index 91393d7c6d..3e851935bd 100644 --- a/tests/compiler/std/symbol.untouched.wat +++ b/tests/compiler/std/symbol.untouched.wat @@ -1,49 +1,47 @@ (module - (type $FUNCSIG$v (func)) (type $FUNCSIG$ii (func (param i32) (result i32))) - (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$vi (func (param i32))) - (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) - (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$iiiiii (func (param i32 i32 i32 i32 i32) (result i32))) (type $FUNCSIG$vii (func (param i32 i32))) - (type $FUNCSIG$viiiii (func (param i32 i32 i32 i32 i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (type $FUNCSIG$v (func)) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\03\00\00\001\002\003\00") - (data (i32.const 24) "\0d\00\00\00s\00t\00d\00/\00s\00y\00m\00b\00o\00l\00.\00t\00s\00") - (data (i32.const 56) "\13\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") - (data (i32.const 104) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") - (data (i32.const 168) "\00\00\00\00") - (data (i32.const 176) "\0b\00\00\00h\00a\00s\00I\00n\00s\00t\00a\00n\00c\00e\00") - (data (i32.const 208) "\12\00\00\00i\00s\00C\00o\00n\00c\00a\00t\00S\00p\00r\00e\00a\00d\00a\00b\00l\00e\00") - (data (i32.const 248) "\08\00\00\00i\00s\00R\00e\00g\00E\00x\00p\00") - (data (i32.const 272) "\05\00\00\00m\00a\00t\00c\00h\00") - (data (i32.const 288) "\07\00\00\00r\00e\00p\00l\00a\00c\00e\00") - (data (i32.const 312) "\06\00\00\00s\00e\00a\00r\00c\00h\00") - (data (i32.const 328) "\07\00\00\00s\00p\00e\00c\00i\00e\00s\00") - (data (i32.const 352) "\05\00\00\00s\00p\00l\00i\00t\00") - (data (i32.const 368) "\0b\00\00\00t\00o\00P\00r\00i\00m\00i\00t\00i\00v\00e\00") - (data (i32.const 400) "\0b\00\00\00t\00o\00S\00t\00r\00i\00n\00g\00T\00a\00g\00") - (data (i32.const 432) "\0b\00\00\00u\00n\00s\00c\00o\00p\00a\00b\00l\00e\00s\00") - (data (i32.const 464) "\07\00\00\00S\00y\00m\00b\00o\00l\00(\00") - (data (i32.const 488) "\04\00\00\00n\00u\00l\00l\00") - (data (i32.const 504) "\0e\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s\00") - (data (i32.const 536) "\17\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s\00") - (data (i32.const 592) "\01\00\00\00)\00") - (data (i32.const 600) "\08\00\00\00S\00y\00m\00b\00o\00l\00(\00)\00") - (data (i32.const 624) "\0b\00\00\00S\00y\00m\00b\00o\00l\00(\001\002\003\00)\00") - (data (i32.const 656) "\13\00\00\00S\00y\00m\00b\00o\00l\00(\00h\00a\00s\00I\00n\00s\00t\00a\00n\00c\00e\00)\00") - (data (i32.const 704) "\1a\00\00\00S\00y\00m\00b\00o\00l\00(\00i\00s\00C\00o\00n\00c\00a\00t\00S\00p\00r\00e\00a\00d\00a\00b\00l\00e\00)\00") + (data (i32.const 8) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\001\002\003\00") + (data (i32.const 32) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00s\00t\00d\00/\00s\00y\00m\00b\00o\00l\00.\00t\00s\00") + (data (i32.const 80) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h\00") + (data (i32.const 128) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") + (data (i32.const 184) "\00\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00") + (data (i32.const 200) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00h\00a\00s\00I\00n\00s\00t\00a\00n\00c\00e\00") + (data (i32.const 240) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00i\00s\00C\00o\00n\00c\00a\00t\00S\00p\00r\00e\00a\00d\00a\00b\00l\00e\00") + (data (i32.const 296) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00i\00s\00R\00e\00g\00E\00x\00p\00") + (data (i32.const 328) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00m\00a\00t\00c\00h\00") + (data (i32.const 360) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\00r\00e\00p\00l\00a\00c\00e\00") + (data (i32.const 392) "\0c\00\00\00\01\00\00\00\01\00\00\00\0c\00\00\00s\00e\00a\00r\00c\00h\00") + (data (i32.const 424) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\00s\00p\00e\00c\00i\00e\00s\00") + (data (i32.const 456) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00s\00p\00l\00i\00t\00") + (data (i32.const 488) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00t\00o\00P\00r\00i\00m\00i\00t\00i\00v\00e\00") + (data (i32.const 528) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00t\00o\00S\00t\00r\00i\00n\00g\00T\00a\00g\00") + (data (i32.const 568) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00u\00n\00s\00c\00o\00p\00a\00b\00l\00e\00s\00") + (data (i32.const 608) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\00S\00y\00m\00b\00o\00l\00(\00") + (data (i32.const 640) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00n\00u\00l\00l\00") + (data (i32.const 664) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00)\00") + (data (i32.const 688) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00S\00y\00m\00b\00o\00l\00(\00)\00") + (data (i32.const 720) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00S\00y\00m\00b\00o\00l\00(\001\002\003\00)\00") + (data (i32.const 760) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\00S\00y\00m\00b\00o\00l\00(\00h\00a\00s\00I\00n\00s\00t\00a\00n\00c\00e\00)\00") + (data (i32.const 816) "4\00\00\00\01\00\00\00\01\00\00\004\00\00\00S\00y\00m\00b\00o\00l\00(\00i\00s\00C\00o\00n\00c\00a\00t\00S\00p\00r\00e\00a\00d\00a\00b\00l\00e\00)\00") (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) (global $~lib/symbol/nextId (mut i32) (i32.const 12)) (global $std/symbol/sym1 (mut i32) (i32.const 0)) (global $std/symbol/sym2 (mut i32) (i32.const 0)) (global $~lib/symbol/stringToId (mut i32) (i32.const 0)) + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) + (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) (global $~lib/symbol/idToString (mut i32) (i32.const 0)) (global $std/symbol/sym3 (mut i32) (i32.const 0)) (global $std/symbol/sym4 (mut i32) (i32.const 0)) @@ -51,29 +49,25 @@ (global $std/symbol/key2 (mut i32) (i32.const 0)) (global $std/symbol/key3 (mut i32) (i32.const 0)) (global $std/symbol/key4 (mut i32) (i32.const 0)) - (global $~lib/symbol/Symbol.hasInstance i32 (i32.const 1)) + (global $~lib/symbol/_Symbol.hasInstance i32 (i32.const 1)) (global $std/symbol/hasInstance (mut i32) (i32.const 0)) - (global $~lib/symbol/Symbol.isConcatSpreadable i32 (i32.const 2)) + (global $~lib/symbol/_Symbol.isConcatSpreadable i32 (i32.const 2)) (global $std/symbol/isConcatSpreadable (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 760)) + (global $~lib/heap/__heap_base i32 (i32.const 884)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) - (func $start:~lib/allocator/arena (; 1 ;) (type $FUNCSIG$v) - global.get $~lib/memory/HEAP_BASE - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset + (func $~lib/rt/stub/__retain (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + ) + (func $~lib/rt/stub/__release (; 2 ;) (type $FUNCSIG$vi) (param $0 i32) + nop ) - (func $~lib/symbol/Symbol (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/symbol/Symbol (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop block (result i32) global.get $~lib/symbol/nextId local.tee $1 @@ -89,49 +83,56 @@ unreachable end local.get $2 + local.set $1 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 ) - (func $~lib/allocator/arena/__memory_allocate (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/rt/stub/__alloc (; 4 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) + (local $8 i32) local.get $0 - i32.const 1073741824 + i32.const 1073741808 i32.gt_u if unreachable end - global.get $~lib/allocator/arena/offset - local.set $1 - local.get $1 + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.set $2 + local.get $2 local.get $0 - local.tee $2 - i32.const 1 local.tee $3 - local.get $2 + i32.const 1 + local.tee $4 local.get $3 + local.get $4 i32.gt_u select i32.add - i32.const 7 + i32.const 15 i32.add - i32.const 7 + i32.const 15 i32.const -1 i32.xor i32.and - local.set $4 - current_memory local.set $5 - local.get $4 + memory.size + local.set $6 local.get $5 + local.get $6 i32.const 16 i32.shl i32.gt_u if - local.get $4 - local.get $1 + local.get $5 + local.get $2 i32.sub i32.const 65535 i32.add @@ -141,23 +142,23 @@ i32.and i32.const 16 i32.shr_u - local.set $2 - local.get $5 - local.tee $3 - local.get $2 - local.tee $6 - local.get $3 + local.set $3 local.get $6 + local.tee $4 + local.get $3 + local.tee $7 + local.get $4 + local.get $7 i32.gt_s select - local.set $3 - local.get $3 - grow_memory + local.set $4 + local.get $4 + memory.grow i32.const 0 i32.lt_s if - local.get $2 - grow_memory + local.get $3 + memory.grow i32.const 0 i32.lt_s if @@ -165,355 +166,322 @@ end end end - local.get $4 - global.set $~lib/allocator/arena/offset - local.get $1 - ) - (func $~lib/memory/memory.allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - call $~lib/allocator/arena/__memory_allocate - return - ) - (func $~lib/internal/arraybuffer/computeSize (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 1 - i32.const 32 - local.get $0 - i32.const 8 - i32.add - i32.const 1 - i32.sub - i32.clz + local.get $5 + global.set $~lib/rt/stub/offset + local.get $2 + i32.const 16 i32.sub - i32.shl - ) - (func $~lib/internal/arraybuffer/allocateUnsafe (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - local.get $0 - i32.const 1073741816 - i32.le_u - i32.eqz - if - i32.const 0 - i32.const 104 - i32.const 26 - i32.const 2 - call $~lib/env/abort - unreachable - end - block $~lib/memory/memory.allocate|inlined.0 (result i32) - local.get $0 - call $~lib/internal/arraybuffer/computeSize - local.set $2 - local.get $2 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.0 - end - local.set $1 + local.set $8 + local.get $8 local.get $1 + i32.store offset=8 + local.get $8 local.get $0 - i32.store - local.get $1 + i32.store offset=12 + local.get $2 ) - (func $~lib/internal/memory/memset (; 7 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/memory/memory.fill (; 5 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) - (local $5 i64) - local.get $2 - i32.eqz - if - return - end - local.get $0 - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 1 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 2 - i32.le_u - if - return - end - local.get $0 - i32.const 1 - i32.add - local.get $1 - i32.store8 - local.get $0 - i32.const 2 - i32.add - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 2 - i32.sub - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 3 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 6 - i32.le_u - if - return - end - local.get $0 - i32.const 3 - i32.add - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 4 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 8 - i32.le_u - if - return - end - i32.const 0 - local.get $0 - i32.sub - i32.const 3 - i32.and - local.set $3 - local.get $0 - local.get $3 - i32.add - local.set $0 - local.get $2 - local.get $3 - i32.sub - local.set $2 - local.get $2 - i32.const -4 - i32.and - local.set $2 - i32.const -1 - i32.const 255 - i32.div_u - local.get $1 - i32.const 255 - i32.and - i32.mul - local.set $4 - local.get $0 - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 4 - i32.sub - local.get $4 - i32.store - local.get $2 - i32.const 8 - i32.le_u - if - return - end - local.get $0 - i32.const 4 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 12 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 8 - i32.sub - local.get $4 - i32.store - local.get $2 - i32.const 24 - i32.le_u - if - return - end - local.get $0 - i32.const 12 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 16 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 20 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 24 - i32.add - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 28 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 24 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 20 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 16 - i32.sub - local.get $4 - i32.store - i32.const 24 - local.get $0 - i32.const 4 - i32.and - i32.add - local.set $3 - local.get $0 - local.get $3 - i32.add - local.set $0 - local.get $2 - local.get $3 - i32.sub - local.set $2 - local.get $4 - i64.extend_i32_u - local.get $4 - i64.extend_i32_u - i64.const 32 - i64.shl - i64.or - local.set $5 - block $break|0 - loop $continue|0 - local.get $2 - i32.const 32 - i32.ge_u - if - block - local.get $0 + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i64) + block $~lib/util/memory/memset|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $3 + i32.eqz + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 1 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 2 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 1 + i32.add + local.get $4 + i32.store8 + local.get $5 + i32.const 2 + i32.add + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 2 + i32.sub + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 3 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 6 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 3 + i32.add + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + i32.const 0 + local.get $5 + i32.sub + i32.const 3 + i32.and + local.set $6 + local.get $5 + local.get $6 + i32.add + local.set $5 + local.get $3 + local.get $6 + i32.sub + local.set $3 + local.get $3 + i32.const -4 + i32.and + local.set $3 + i32.const -1 + i32.const 255 + i32.div_u + local.get $4 + i32.const 255 + i32.and + i32.mul + local.set $7 + local.get $5 + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.get $7 + i32.store + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 4 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 8 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 12 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 8 + i32.sub + local.get $7 + i32.store + local.get $3 + i32.const 24 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 12 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 16 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 20 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 24 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 28 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 24 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 20 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 16 + i32.sub + local.get $7 + i32.store + i32.const 24 + local.get $5 + i32.const 4 + i32.and + i32.add + local.set $6 + local.get $5 + local.get $6 + i32.add + local.set $5 + local.get $3 + local.get $6 + i32.sub + local.set $3 + local.get $7 + i64.extend_i32_u + local.get $7 + i64.extend_i32_u + i64.const 32 + i64.shl + i64.or + local.set $8 + block $break|0 + loop $continue|0 + local.get $3 + i32.const 32 + i32.ge_u + if local.get $5 + local.get $8 i64.store - local.get $0 + local.get $5 i32.const 8 i32.add - local.get $5 + local.get $8 i64.store - local.get $0 + local.get $5 i32.const 16 i32.add - local.get $5 + local.get $8 i64.store - local.get $0 + local.get $5 i32.const 24 i32.add - local.get $5 + local.get $8 i64.store - local.get $2 + local.get $3 i32.const 32 i32.sub - local.set $2 - local.get $0 + local.set $3 + local.get $5 i32.const 32 i32.add - local.set $0 + local.set $5 + br $continue|0 end - br $continue|0 end end end ) - (func $~lib/arraybuffer/ArrayBuffer#constructor (; 8 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) + (func $~lib/arraybuffer/ArrayBuffer#constructor (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) local.get $1 - i32.const 1073741816 + i32.const 1073741808 i32.gt_u if - i32.const 0 + i32.const 96 + i32.const 144 i32.const 56 - i32.const 47 - i32.const 40 - call $~lib/env/abort + i32.const 42 + call $~lib/builtins/abort unreachable end local.get $1 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $3 + i32.const 0 + call $~lib/rt/stub/__alloc + local.set $2 local.get $2 i32.const 0 - i32.ne - i32.eqz - if - local.get $3 - i32.const 8 - i32.add - local.set $4 + local.get $1 + call $~lib/memory/memory.fill + local.get $2 + call $~lib/rt/stub/__retain + ) + (func $~lib/map/Map<~lib/string/String,usize>#clear (; 7 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + local.tee $1 + block (result i32) i32.const 0 - local.set $5 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $2 local.get $1 - local.set $6 - local.get $4 - local.get $5 - local.get $6 - call $~lib/internal/memory/memset + i32.load + call $~lib/rt/stub/__release + local.get $2 end - local.get $3 - ) - (func $~lib/map/Map<~lib/string/String,usize>#clear (; 9 ;) (type $FUNCSIG$vi) (param $0 i32) - local.get $0 - i32.const 0 - i32.const 16 - i32.const 0 - call $~lib/arraybuffer/ArrayBuffer#constructor i32.store local.get $0 i32.const 4 @@ -521,10 +489,17 @@ i32.sub i32.store offset=4 local.get $0 - i32.const 0 - i32.const 48 - i32.const 1 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $2 + block (result i32) + i32.const 0 + i32.const 48 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 + local.get $2 + i32.load offset=8 + call $~lib/rt/stub/__release + local.get $1 + end i32.store offset=8 local.get $0 i32.const 4 @@ -536,13 +511,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map<~lib/string/String,usize>#constructor (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map<~lib/string/String,usize>#constructor (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/memory/memory.allocate + i32.const 3 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain local.set $0 end local.get $0 @@ -568,12 +545,21 @@ call $~lib/map/Map<~lib/string/String,usize>#clear local.get $0 ) - (func $~lib/map/Map#clear (; 11 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/map/Map#clear (; 9 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) local.get $0 - i32.const 0 - i32.const 16 - i32.const 0 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $1 + block (result i32) + i32.const 0 + i32.const 16 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $2 + local.get $1 + i32.load + call $~lib/rt/stub/__release + local.get $2 + end i32.store local.get $0 i32.const 4 @@ -581,10 +567,17 @@ i32.sub i32.store offset=4 local.get $0 - i32.const 0 - i32.const 48 - i32.const 1 - call $~lib/arraybuffer/ArrayBuffer#constructor + local.tee $2 + block (result i32) + i32.const 0 + i32.const 48 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 + local.get $2 + i32.load offset=8 + call $~lib/rt/stub/__release + local.get $1 + end i32.store offset=8 local.get $0 i32.const 4 @@ -596,13 +589,15 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#constructor (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block (result i32) local.get $0 i32.eqz if i32.const 24 - call $~lib/memory/memory.allocate + i32.const 4 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain local.set $0 end local.get $0 @@ -628,52 +623,79 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/internal/hash/hashStr (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/string/String#get:length (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u + ) + (func $~lib/util/hash/hashStr (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop i32.const -2128831035 local.set $1 - block $break|0 - block - i32.const 0 - local.set $2 - local.get $0 - i32.load - i32.const 1 - i32.shl - local.set $3 - end - loop $repeat|0 - local.get $2 - local.get $3 - i32.lt_u - i32.eqz - br_if $break|0 - local.get $1 - local.get $0 - local.get $2 - i32.add - i32.load8_u offset=4 - i32.xor - i32.const 16777619 - i32.mul - local.set $1 - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $repeat|0 + local.get $0 + i32.const 0 + i32.ne + if + block $break|0 + block + i32.const 0 + local.set $2 + local.get $0 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.set $3 + end + loop $repeat|0 + local.get $2 + local.get $3 + i32.lt_u + i32.eqz + br_if $break|0 + local.get $1 + local.get $0 + local.get $2 + i32.add + i32.load8_u + i32.xor + i32.const 16777619 + i32.mul + local.set $1 + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $repeat|0 + unreachable + end unreachable end - unreachable end local.get $1 + local.set $3 + local.get $0 + call $~lib/rt/stub/__release + local.get $3 ) - (func $~lib/internal/string/compareUnsafe (; 14 ;) (type $FUNCSIG$iiiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) + (func $~lib/util/string/compareImpl (; 13 ;) (type $FUNCSIG$iiiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) (local $5 i32) (local $6 i32) (local $7 i32) + (local $8 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $2 + call $~lib/rt/stub/__retain + drop i32.const 0 local.set $5 local.get $0 @@ -693,52 +715,67 @@ local.get $4 if (result i32) local.get $6 - i32.load16_u offset=4 + i32.load16_u local.get $7 - i32.load16_u offset=4 + i32.load16_u i32.sub local.tee $5 i32.eqz else - local.get $4 + i32.const 0 end if - block - local.get $4 - i32.const 1 - i32.sub - local.set $4 - local.get $6 - i32.const 2 - i32.add - local.set $6 - local.get $7 - i32.const 2 - i32.add - local.set $7 - end + local.get $4 + i32.const 1 + i32.sub + local.set $4 + local.get $6 + i32.const 2 + i32.add + local.set $6 + local.get $7 + i32.const 2 + i32.add + local.set $7 br $continue|0 end end end local.get $5 + local.set $8 + local.get $0 + call $~lib/rt/stub/__release + local.get $2 + call $~lib/rt/stub/__release + local.get $8 ) - (func $~lib/string/String.__eq (; 15 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__eq (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 + call $~lib/rt/stub/__retain + drop + local.get $1 + call $~lib/rt/stub/__retain + drop + local.get $0 local.get $1 i32.eq if i32.const 1 + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 return end local.get $0 i32.const 0 i32.eq - local.tee $2 if (result i32) - local.get $2 + i32.const 1 else local.get $1 i32.const 0 @@ -746,17 +783,29 @@ end if i32.const 0 + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 return end local.get $0 - i32.load + call $~lib/string/String#get:length local.set $3 local.get $3 local.get $1 - i32.load + call $~lib/string/String#get:length i32.ne if i32.const 0 + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 return end local.get $0 @@ -764,12 +813,21 @@ local.get $1 i32.const 0 local.get $3 - call $~lib/internal/string/compareUnsafe + call $~lib/util/string/compareImpl i32.eqz + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 ) - (func $~lib/map/Map<~lib/string/String,usize>#find (; 16 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/map/Map<~lib/string/String,usize>#find (; 15 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) + local.get $1 + call $~lib/rt/stub/__retain + drop local.get $0 i32.load local.get $2 @@ -779,83 +837,114 @@ i32.const 4 i32.mul i32.add - i32.load offset=8 + i32.load local.set $3 block $break|0 loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - local.tee $4 - if (result i32) - local.get $3 - i32.load - local.get $1 - call $~lib/string/String.__eq - else - local.get $4 - end - if - local.get $3 - return - end + i32.load + local.get $1 + call $~lib/string/String.__eq + else + i32.const 0 + end + if local.get $3 - i32.load offset=8 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + local.set $4 + local.get $1 + call $~lib/rt/stub/__release + local.get $4 + return end + local.get $3 + i32.load offset=8 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 + local.set $4 + local.get $1 + call $~lib/rt/stub/__release + local.get $4 ) - (func $~lib/map/Map<~lib/string/String,usize>#has (; 17 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map<~lib/string/String,usize>#has (; 16 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/stub/__retain + drop local.get $0 local.get $1 - block $~lib/internal/hash/HASH<~lib/string/String>|inlined.0 (result i32) + block $~lib/util/hash/HASH<~lib/string/String>|inlined.0 (result i32) local.get $1 + call $~lib/rt/stub/__retain local.set $2 local.get $2 - call $~lib/internal/hash/hashStr - br $~lib/internal/hash/HASH<~lib/string/String>|inlined.0 + call $~lib/util/hash/hashStr + local.set $3 + local.get $2 + call $~lib/rt/stub/__release + local.get $3 + br $~lib/util/hash/HASH<~lib/string/String>|inlined.0 end call $~lib/map/Map<~lib/string/String,usize>#find i32.const 0 i32.ne + local.set $2 + local.get $1 + call $~lib/rt/stub/__release + local.get $2 ) - (func $~lib/map/Map<~lib/string/String,usize>#get (; 18 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map<~lib/string/String,usize>#get (; 17 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) + (local $4 i32) + local.get $1 + call $~lib/rt/stub/__retain + drop local.get $0 local.get $1 - block $~lib/internal/hash/HASH<~lib/string/String>|inlined.1 (result i32) + block $~lib/util/hash/HASH<~lib/string/String>|inlined.1 (result i32) local.get $1 + call $~lib/rt/stub/__retain local.set $2 local.get $2 - call $~lib/internal/hash/hashStr - br $~lib/internal/hash/HASH<~lib/string/String>|inlined.1 + call $~lib/util/hash/hashStr + local.set $3 + local.get $2 + call $~lib/rt/stub/__release + local.get $3 + br $~lib/util/hash/HASH<~lib/string/String>|inlined.1 end call $~lib/map/Map<~lib/string/String,usize>#find - local.set $3 - local.get $3 + local.set $4 + local.get $4 if (result i32) - local.get $3 + local.get $4 i32.load offset=4 else unreachable end + local.set $2 + local.get $1 + call $~lib/rt/stub/__release + local.get $2 ) - (func $~lib/map/Map<~lib/string/String,usize>#rehash (; 19 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map<~lib/string/String,usize>#rehash (; 18 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -875,7 +964,6 @@ local.get $2 i32.const 4 i32.mul - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $2 @@ -890,13 +978,10 @@ i32.const 12 end i32.mul - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $5 local.get $0 i32.load offset=8 - i32.const 8 - i32.add local.set $6 local.get $6 local.get $0 @@ -908,8 +993,6 @@ i32.add local.set $7 local.get $5 - i32.const 8 - i32.add local.set $8 block $break|0 loop $continue|0 @@ -917,75 +1000,110 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + i32.load + i32.store + local.get $10 + local.get $9 + i32.load offset=4 + i32.store offset=4 + block $~lib/util/hash/HASH<~lib/string/String>|inlined.3 (result i32) local.get $9 i32.load - i32.store - local.get $10 - local.get $9 - i32.load offset=4 - i32.store offset=4 - block $~lib/internal/hash/HASH<~lib/string/String>|inlined.3 (result i32) - local.get $9 - i32.load - local.set $11 - local.get $11 - call $~lib/internal/hash/hashStr - br $~lib/internal/hash/HASH<~lib/string/String>|inlined.3 - end - local.get $1 - i32.and + call $~lib/rt/stub/__retain local.set $11 - local.get $3 local.get $11 - i32.const 4 - i32.mul - i32.add + call $~lib/util/hash/hashStr local.set $12 - local.get $10 - local.get $12 - i32.load offset=8 - i32.store offset=8 + local.get $11 + call $~lib/rt/stub/__release local.get $12 - local.get $8 - i32.store offset=8 - local.get $8 - block $~lib/map/ENTRY_SIZE<~lib/string/String,usize>|inlined.3 (result i32) - i32.const 12 - end - i32.add - local.set $8 + br $~lib/util/hash/HASH<~lib/string/String>|inlined.3 end - local.get $6 - block $~lib/map/ENTRY_SIZE<~lib/string/String,usize>|inlined.4 (result i32) + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=8 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/map/ENTRY_SIZE<~lib/string/String,usize>|inlined.3 (result i32) i32.const 12 end i32.add - local.set $6 + local.set $8 + end + local.get $6 + block $~lib/map/ENTRY_SIZE<~lib/string/String,usize>|inlined.4 (result i32) + i32.const 12 end + i32.add + local.set $6 br $continue|0 end end end local.get $0 - local.get $3 + local.tee $9 + block (result i32) + local.get $3 + local.tee $10 + local.get $9 + i32.load + local.tee $9 + i32.ne + if + local.get $10 + call $~lib/rt/stub/__retain + drop + local.get $9 + call $~lib/rt/stub/__release + end + local.get $10 + end i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $5 + local.tee $10 + block (result i32) + local.get $5 + local.tee $11 + local.get $10 + i32.load offset=8 + local.tee $10 + i32.ne + if + local.get $11 + call $~lib/rt/stub/__retain + drop + local.get $10 + call $~lib/rt/stub/__release + end + local.get $11 + end i32.store offset=8 local.get $0 local.get $4 @@ -994,28 +1112,40 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/stub/__release + local.get $5 + call $~lib/rt/stub/__release ) - (func $~lib/map/Map<~lib/string/String,usize>#set (; 20 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map<~lib/string/String,usize>#set (; 19 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - block $~lib/internal/hash/HASH<~lib/string/String>|inlined.2 (result i32) + local.get $1 + call $~lib/rt/stub/__retain + drop + block $~lib/util/hash/HASH<~lib/string/String>|inlined.2 (result i32) local.get $1 + call $~lib/rt/stub/__retain local.set $3 local.get $3 - call $~lib/internal/hash/hashStr - br $~lib/internal/hash/HASH<~lib/string/String>|inlined.2 + call $~lib/util/hash/hashStr + local.set $4 + local.get $3 + call $~lib/rt/stub/__release + local.get $4 + br $~lib/util/hash/HASH<~lib/string/String>|inlined.2 end - local.set $4 + local.set $5 local.get $0 local.get $1 - local.get $4 - call $~lib/map/Map<~lib/string/String,usize>#find - local.set $5 local.get $5 + call $~lib/map/Map<~lib/string/String,usize>#find + local.set $6 + local.get $6 if - local.get $5 + local.get $6 local.get $2 i32.store offset=4 else @@ -1050,30 +1180,30 @@ end local.get $0 i32.load offset=8 + call $~lib/rt/stub/__retain local.set $3 local.get $3 - i32.const 8 - i32.add block (result i32) local.get $0 local.get $0 i32.load offset=16 - local.tee $6 + local.tee $4 i32.const 1 i32.add i32.store offset=16 - local.get $6 + local.get $4 end block $~lib/map/ENTRY_SIZE<~lib/string/String,usize>|inlined.5 (result i32) i32.const 12 end i32.mul i32.add - local.set $5 - local.get $5 + local.set $6 + local.get $6 local.get $1 + call $~lib/rt/stub/__retain i32.store - local.get $5 + local.get $6 local.get $2 i32.store offset=4 local.get $0 @@ -1084,24 +1214,28 @@ i32.store offset=20 local.get $0 i32.load - local.get $4 + local.get $5 local.get $0 i32.load offset=4 i32.and i32.const 4 i32.mul i32.add - local.set $6 - local.get $5 + local.set $4 local.get $6 - i32.load offset=8 + local.get $4 + i32.load i32.store offset=8 + local.get $4 local.get $6 - local.get $5 - i32.store offset=8 + i32.store + local.get $3 + call $~lib/rt/stub/__release end + local.get $1 + call $~lib/rt/stub/__release ) - (func $~lib/internal/hash/hash32 (; 21 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/hash32 (; 20 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const -2128831035 local.set $1 @@ -1143,9 +1277,8 @@ local.set $1 local.get $1 ) - (func $~lib/map/Map#find (; 22 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 21 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - (local $4 i32) local.get $0 i32.load local.get $2 @@ -1155,46 +1288,43 @@ i32.const 4 i32.mul i32.add - i32.load offset=8 + i32.load local.set $3 block $break|0 loop $continue|0 local.get $3 if - block + local.get $3 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if (result i32) local.get $3 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - local.tee $4 - if (result i32) - local.get $3 - i32.load - local.get $1 - i32.eq - else - local.get $4 - end - if - local.get $3 - return - end + i32.load + local.get $1 + i32.eq + else + i32.const 0 + end + if local.get $3 - i32.load offset=8 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 + return end + local.get $3 + i32.load offset=8 + i32.const 1 + i32.const -1 + i32.xor + i32.and + local.set $3 br $continue|0 end end end i32.const 0 ) - (func $~lib/map/Map#rehash (; 23 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 22 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1214,7 +1344,6 @@ local.get $2 i32.const 4 i32.mul - i32.const 0 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $2 @@ -1229,13 +1358,10 @@ i32.const 12 end i32.mul - i32.const 1 call $~lib/arraybuffer/ArrayBuffer#constructor local.set $5 local.get $0 i32.load offset=8 - i32.const 8 - i32.add local.set $6 local.get $6 local.get $0 @@ -1247,8 +1373,6 @@ i32.add local.set $7 local.get $5 - i32.const 8 - i32.add local.set $8 block $break|0 loop $continue|0 @@ -1256,75 +1380,105 @@ local.get $7 i32.ne if - block - local.get $6 - local.set $9 + local.get $6 + local.set $9 + local.get $9 + i32.load offset=8 + i32.const 1 + i32.and + i32.eqz + if + local.get $8 + local.set $10 + local.get $10 local.get $9 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $10 - local.get $10 + i32.load + i32.store + local.get $10 + local.get $9 + i32.load offset=4 + i32.store offset=4 + block $~lib/util/hash/HASH|inlined.1 (result i32) local.get $9 i32.load - i32.store - local.get $10 - local.get $9 - i32.load offset=4 - i32.store offset=4 - block $~lib/internal/hash/HASH|inlined.1 (result i32) - local.get $9 - i32.load - local.set $11 - local.get $11 - call $~lib/internal/hash/hash32 - br $~lib/internal/hash/HASH|inlined.1 - end - local.get $1 - i32.and local.set $11 - local.get $3 local.get $11 - i32.const 4 - i32.mul - i32.add - local.set $12 - local.get $10 - local.get $12 - i32.load offset=8 - i32.store offset=8 - local.get $12 - local.get $8 - i32.store offset=8 - local.get $8 - block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) - i32.const 12 - end - i32.add - local.set $8 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.1 end - local.get $6 - block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + local.get $1 + i32.and + local.set $11 + local.get $3 + local.get $11 + i32.const 4 + i32.mul + i32.add + local.set $12 + local.get $10 + local.get $12 + i32.load + i32.store offset=8 + local.get $12 + local.get $8 + i32.store + local.get $8 + block $~lib/map/ENTRY_SIZE|inlined.3 (result i32) i32.const 12 end i32.add - local.set $6 + local.set $8 + end + local.get $6 + block $~lib/map/ENTRY_SIZE|inlined.4 (result i32) + i32.const 12 end + i32.add + local.set $6 br $continue|0 end end end local.get $0 - local.get $3 + local.tee $9 + block (result i32) + local.get $3 + local.tee $10 + local.get $9 + i32.load + local.tee $9 + i32.ne + if + local.get $10 + call $~lib/rt/stub/__retain + drop + local.get $9 + call $~lib/rt/stub/__release + end + local.get $10 + end i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.get $5 + local.tee $10 + block (result i32) + local.get $5 + local.tee $11 + local.get $10 + i32.load offset=8 + local.tee $10 + i32.ne + if + local.get $11 + call $~lib/rt/stub/__retain + drop + local.get $10 + call $~lib/rt/stub/__release + end + local.get $11 + end i32.store offset=8 local.get $0 local.get $4 @@ -1333,18 +1487,25 @@ local.get $0 i32.load offset=20 i32.store offset=16 + local.get $3 + call $~lib/rt/stub/__release + local.get $5 + call $~lib/rt/stub/__release ) - (func $~lib/map/Map#set (; 24 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#set (; 23 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - block $~lib/internal/hash/HASH|inlined.0 (result i32) + local.get $2 + call $~lib/rt/stub/__retain + drop + block $~lib/util/hash/HASH|inlined.0 (result i32) local.get $1 local.set $3 local.get $3 - call $~lib/internal/hash/hash32 - br $~lib/internal/hash/HASH|inlined.0 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.0 end local.set $4 local.get $0 @@ -1355,8 +1516,19 @@ local.get $5 if local.get $5 + i32.load offset=4 + local.set $3 local.get $2 - i32.store offset=4 + local.get $3 + i32.ne + if + local.get $5 + local.get $2 + call $~lib/rt/stub/__retain + i32.store offset=4 + local.get $3 + call $~lib/rt/stub/__release + end else local.get $0 i32.load offset=16 @@ -1389,10 +1561,9 @@ end local.get $0 i32.load offset=8 + call $~lib/rt/stub/__retain local.set $3 local.get $3 - i32.const 8 - i32.add block (result i32) local.get $0 local.get $0 @@ -1414,6 +1585,7 @@ i32.store local.get $5 local.get $2 + call $~lib/rt/stub/__retain i32.store offset=4 local.get $0 local.get $0 @@ -1433,24 +1605,43 @@ local.set $6 local.get $5 local.get $6 - i32.load offset=8 + i32.load i32.store offset=8 local.get $6 local.get $5 - i32.store offset=8 + i32.store + local.get $3 + call $~lib/rt/stub/__release end + local.get $2 + call $~lib/rt/stub/__release ) - (func $~lib/symbol/Symbol.for (; 25 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/symbol/_Symbol.for (; 24 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) + local.get $0 + call $~lib/rt/stub/__retain + drop global.get $~lib/symbol/stringToId i32.eqz if - i32.const 0 - call $~lib/map/Map<~lib/string/String,usize>#constructor + block (result i32) + i32.const 0 + call $~lib/map/Map<~lib/string/String,usize>#constructor + local.set $1 + global.get $~lib/symbol/stringToId + call $~lib/rt/stub/__release + local.get $1 + end global.set $~lib/symbol/stringToId - i32.const 0 - call $~lib/map/Map#constructor + block (result i32) + i32.const 0 + call $~lib/map/Map#constructor + local.set $1 + global.get $~lib/symbol/idToString + call $~lib/rt/stub/__release + local.get $1 + end global.set $~lib/symbol/idToString else global.get $~lib/symbol/stringToId @@ -1460,6 +1651,10 @@ global.get $~lib/symbol/stringToId local.get $0 call $~lib/map/Map<~lib/string/String,usize>#get + local.set $1 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 return end end @@ -1486,33 +1681,38 @@ local.get $0 call $~lib/map/Map#set local.get $2 + local.set $1 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 ) - (func $~lib/map/Map#has (; 26 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#has (; 25 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.2 (result i32) + block $~lib/util/hash/HASH|inlined.2 (result i32) local.get $1 local.set $2 local.get $2 - call $~lib/internal/hash/hash32 - br $~lib/internal/hash/HASH|inlined.2 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.2 end call $~lib/map/Map#find i32.const 0 i32.ne ) - (func $~lib/map/Map#get (; 27 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#get (; 26 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) + (local $4 i32) local.get $0 local.get $1 - block $~lib/internal/hash/HASH|inlined.3 (result i32) + block $~lib/util/hash/HASH|inlined.3 (result i32) local.get $1 local.set $2 local.get $2 - call $~lib/internal/hash/hash32 - br $~lib/internal/hash/HASH|inlined.3 + call $~lib/util/hash/hash32 + br $~lib/util/hash/HASH|inlined.3 end call $~lib/map/Map#find local.set $3 @@ -1520,22 +1720,27 @@ if (result i32) local.get $3 i32.load offset=4 + call $~lib/rt/stub/__retain + local.tee $2 else unreachable + call $~lib/rt/stub/__retain + unreachable + local.tee $4 + unreachable end + call $~lib/rt/stub/__retain ) - (func $~lib/symbol/Symbol.keyFor (; 28 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/symbol/_Symbol.keyFor (; 27 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) global.get $~lib/symbol/idToString i32.const 0 i32.ne - local.tee $1 if (result i32) global.get $~lib/symbol/idToString local.get $0 call $~lib/map/Map#has else - local.get $1 + i32.const 0 end if (result i32) global.get $~lib/symbol/idToString @@ -1543,49 +1748,10 @@ call $~lib/map/Map#get else i32.const 0 + call $~lib/rt/stub/__retain end ) - (func $~lib/internal/string/allocateUnsafe (; 29 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - local.get $0 - i32.const 0 - i32.gt_s - local.tee $1 - if (result i32) - local.get $0 - i32.const 536870910 - i32.le_s - else - local.get $1 - end - i32.eqz - if - i32.const 0 - i32.const 536 - i32.const 14 - i32.const 2 - call $~lib/env/abort - unreachable - end - block $~lib/memory/memory.allocate|inlined.1 (result i32) - i32.const 4 - local.get $0 - i32.const 1 - i32.shl - i32.add - local.set $1 - local.get $1 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.1 - end - local.set $2 - local.get $2 - local.get $0 - i32.store - local.get $2 - ) - (func $~lib/internal/memory/memcpy (; 30 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/memory/memcpy (; 28 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -1597,33 +1763,31 @@ i32.const 3 i32.and else - local.get $2 + i32.const 0 end if - block - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - local.get $2 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 i32.const 1 - i32.sub - local.set $2 + i32.add + local.set $1 + local.get $5 end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 br $continue|0 end end @@ -1640,48 +1804,46 @@ i32.const 16 i32.ge_u if - block - local.get $0 - local.get $1 - i32.load - i32.store - local.get $0 - i32.const 4 - i32.add - local.get $1 - i32.const 4 - i32.add - i32.load - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $1 - i32.const 8 - i32.add - i32.load - i32.store - local.get $0 - i32.const 12 - i32.add - local.get $1 - i32.const 12 - i32.add - i32.load - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - end + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 8 + i32.add + i32.load + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 12 + i32.add + i32.load + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 br $continue|1 end end @@ -1864,158 +2026,22 @@ i32.const 17 i32.ge_u if - block - local.get $1 - i32.const 1 - i32.add - i32.load - local.set $4 - local.get $0 - local.get $3 - i32.const 24 - i32.shr_u - local.get $4 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 5 - i32.add - i32.load - local.set $3 - local.get $0 - i32.const 4 - i32.add - local.get $4 - i32.const 24 - i32.shr_u - local.get $3 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 9 - i32.add - i32.load - local.set $4 - local.get $0 - i32.const 8 - i32.add - local.get $3 - i32.const 24 - i32.shr_u - local.get $4 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 13 - i32.add - i32.load - local.set $3 - local.get $0 - i32.const 12 - i32.add - local.get $4 - i32.const 24 - i32.shr_u - local.get $3 - i32.const 8 - i32.shl - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.set $1 - local.get $0 - i32.const 16 - i32.add - local.set $0 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - end - br $continue|3 - end - end - end - br $break|2 - unreachable - end - unreachable - end - block - local.get $1 - i32.load - local.set $3 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) - local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - local.get $2 - i32.const 2 - i32.sub - local.set $2 - block $break|4 - loop $continue|4 - local.get $2 - i32.const 18 - i32.ge_u - if - block local.get $1 - i32.const 2 + i32.const 1 i32.add i32.load local.set $4 local.get $0 local.get $3 - i32.const 16 + i32.const 24 i32.shr_u local.get $4 - i32.const 16 + i32.const 8 i32.shl i32.or i32.store local.get $1 - i32.const 6 + i32.const 5 i32.add i32.load local.set $3 @@ -2023,15 +2049,15 @@ i32.const 4 i32.add local.get $4 - i32.const 16 + i32.const 24 i32.shr_u local.get $3 - i32.const 16 + i32.const 8 i32.shl i32.or i32.store local.get $1 - i32.const 10 + i32.const 9 i32.add i32.load local.set $4 @@ -2039,15 +2065,15 @@ i32.const 8 i32.add local.get $3 - i32.const 16 + i32.const 24 i32.shr_u local.get $4 - i32.const 16 + i32.const 8 i32.shl i32.or i32.store local.get $1 - i32.const 14 + i32.const 13 i32.add i32.load local.set $3 @@ -2055,10 +2081,10 @@ i32.const 12 i32.add local.get $4 - i32.const 16 + i32.const 24 i32.shr_u local.get $3 - i32.const 16 + i32.const 8 i32.shl i32.or i32.store @@ -2074,65 +2100,81 @@ i32.const 16 i32.sub local.set $2 + br $continue|3 end - br $continue|4 end end + br $break|2 + unreachable end - br $break|2 unreachable end - unreachable - end - block - local.get $1 - i32.load - local.set $3 - block (result i32) - local.get $0 - local.tee $5 - i32.const 1 - i32.add - local.set $0 - local.get $5 - end - block (result i32) + block local.get $1 - local.tee $5 - i32.const 1 - i32.add - local.set $1 - local.get $5 - end - i32.load8_u - i32.store8 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - block $break|5 - loop $continue|5 - local.get $2 - i32.const 19 - i32.ge_u - if - block + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + block $break|4 + loop $continue|4 + local.get $2 + i32.const 18 + i32.ge_u + if local.get $1 - i32.const 3 + i32.const 2 i32.add i32.load local.set $4 local.get $0 local.get $3 - i32.const 8 + i32.const 16 i32.shr_u local.get $4 - i32.const 24 + i32.const 16 i32.shl i32.or i32.store local.get $1 - i32.const 7 + i32.const 6 i32.add i32.load local.set $3 @@ -2140,15 +2182,15 @@ i32.const 4 i32.add local.get $4 - i32.const 8 + i32.const 16 i32.shr_u local.get $3 - i32.const 24 + i32.const 16 i32.shl i32.or i32.store local.get $1 - i32.const 11 + i32.const 10 i32.add i32.load local.set $4 @@ -2156,15 +2198,15 @@ i32.const 8 i32.add local.get $3 - i32.const 8 + i32.const 16 i32.shr_u local.get $4 - i32.const 24 + i32.const 16 i32.shl i32.or i32.store local.get $1 - i32.const 15 + i32.const 14 i32.add i32.load local.set $3 @@ -2172,10 +2214,10 @@ i32.const 12 i32.add local.get $4 - i32.const 8 + i32.const 16 i32.shr_u local.get $3 - i32.const 24 + i32.const 16 i32.shl i32.or i32.store @@ -2191,7 +2233,121 @@ i32.const 16 i32.sub local.set $2 + br $continue|4 end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + block $break|5 + loop $continue|5 + local.get $2 + i32.const 19 + i32.ge_u + if + local.get $1 + i32.const 3 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 7 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 11 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 15 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 br $continue|5 end end @@ -2786,338 +2942,344 @@ i32.store8 end ) - (func $~lib/internal/memory/memmove (; 31 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/memory/memory.copy (; 29 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - local.get $0 - local.get $1 - i32.eq - if - return - end - local.get $1 - local.get $2 - i32.add - local.get $0 - i32.le_u - local.tee $3 - if (result i32) - local.get $3 - else - local.get $0 - local.get $2 - i32.add - local.get $1 - i32.le_u - end - if + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 local.get $0 + local.set $5 local.get $1 + local.set $4 local.get $2 - call $~lib/internal/memory/memcpy - return - end - local.get $0 - local.get $1 - i32.lt_u - if - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and + local.set $3 + local.get $5 + local.get $4 i32.eq if - block $break|0 - loop $continue|0 - local.get $0 - i32.const 7 - i32.and - if - block - local.get $2 + br $~lib/util/memory/memmove|inlined.0 + end + local.get $4 + local.get $3 + i32.add + local.get $5 + i32.le_u + if (result i32) + i32.const 1 + else + local.get $5 + local.get $3 + i32.add + local.get $4 + i32.le_u + end + if + local.get $5 + local.get $4 + local.get $3 + call $~lib/util/memory/memcpy + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 i32.eqz if - return + br $~lib/util/memory/memmove|inlined.0 end - local.get $2 + local.get $3 i32.const 1 i32.sub - local.set $2 + local.set $3 block (result i32) - local.get $0 - local.tee $3 + local.get $5 + local.tee $6 i32.const 1 i32.add - local.set $0 - local.get $3 + local.set $5 + local.get $6 end block (result i32) - local.get $1 - local.tee $3 + local.get $4 + local.tee $6 i32.const 1 i32.add - local.set $1 - local.get $3 + local.set $4 + local.get $6 end i32.load8_u i32.store8 + br $continue|0 end - br $continue|0 end end - end - block $break|1 - loop $continue|1 - local.get $2 - i32.const 8 - i32.ge_u - if - block - local.get $0 - local.get $1 + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 i64.load i64.store - local.get $2 + local.get $3 i32.const 8 i32.sub - local.set $2 - local.get $0 + local.set $3 + local.get $5 i32.const 8 i32.add - local.set $0 - local.get $1 + local.set $5 + local.get $4 i32.const 8 i32.add - local.set $1 + local.set $4 + br $continue|1 end - br $continue|1 end end end - end - block $break|2 - loop $continue|2 - local.get $2 - if - block + block $break|2 + loop $continue|2 + local.get $3 + if block (result i32) - local.get $0 - local.tee $3 + local.get $5 + local.tee $6 i32.const 1 i32.add - local.set $0 - local.get $3 + local.set $5 + local.get $6 end block (result i32) - local.get $1 - local.tee $3 + local.get $4 + local.tee $6 i32.const 1 i32.add - local.set $1 - local.get $3 + local.set $4 + local.get $6 end i32.load8_u i32.store8 - local.get $2 + local.get $3 i32.const 1 i32.sub - local.set $2 + local.set $3 + br $continue|2 end - br $continue|2 end end - end - else - local.get $1 - i32.const 7 - i32.and - local.get $0 - i32.const 7 - i32.and - i32.eq - if - block $break|3 - loop $continue|3 - local.get $0 - local.get $2 - i32.add - i32.const 7 - i32.and - if - block - local.get $2 + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 i32.eqz if - return + br $~lib/util/memory/memmove|inlined.0 end - local.get $0 - local.get $2 + local.get $5 + local.get $3 i32.const 1 i32.sub - local.tee $2 + local.tee $3 i32.add - local.get $1 - local.get $2 + local.get $4 + local.get $3 i32.add i32.load8_u i32.store8 + br $continue|3 end - br $continue|3 end end - end - block $break|4 - loop $continue|4 - local.get $2 - i32.const 8 - i32.ge_u - if - block - local.get $2 + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 i32.const 8 i32.sub - local.set $2 - local.get $0 - local.get $2 + local.set $3 + local.get $5 + local.get $3 i32.add - local.get $1 - local.get $2 + local.get $4 + local.get $3 i32.add i64.load i64.store + br $continue|4 end - br $continue|4 end end end - end - block $break|5 - loop $continue|5 - local.get $2 - if - local.get $0 - local.get $2 - i32.const 1 - i32.sub - local.tee $2 - i32.add - local.get $1 - local.get $2 - i32.add - i32.load8_u - i32.store8 - br $continue|5 + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end end end end end ) - (func $~lib/internal/string/copyUnsafe (; 32 ;) (type $FUNCSIG$viiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - local.get $0 - local.get $1 - i32.const 1 - i32.shl - i32.add - i32.const 4 - i32.add - local.set $5 - local.get $2 - local.get $3 - i32.const 1 - i32.shl - i32.add - i32.const 4 - i32.add - local.set $6 - local.get $4 - i32.const 1 - i32.shl - local.set $7 - local.get $5 - local.get $6 - local.get $7 - call $~lib/internal/memory/memmove - ) - (func $~lib/string/String#concat (; 33 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#concat (; 30 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - local.get $0 - i32.const 0 - i32.ne - i32.eqz - if - i32.const 0 - i32.const 504 - i32.const 110 - i32.const 4 - call $~lib/env/abort - unreachable - end + (local $6 i32) + (local $7 i32) + local.get $1 + call $~lib/rt/stub/__retain + drop local.get $1 i32.const 0 i32.eq if - i32.const 488 + block (result i32) + i32.const 656 + local.tee $2 + local.get $1 + local.tee $3 + i32.ne + if + local.get $2 + call $~lib/rt/stub/__retain + drop + local.get $3 + call $~lib/rt/stub/__release + end + local.get $2 + end local.set $1 end local.get $0 - i32.load - local.set $2 - local.get $1 - i32.load - local.set $3 - local.get $2 - local.get $3 - i32.add + call $~lib/string/String#get:length + i32.const 1 + i32.shl local.set $4 + local.get $1 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.set $5 local.get $4 + local.get $5 + i32.add + local.set $6 + local.get $6 i32.const 0 i32.eq if - i32.const 168 + i32.const 200 + call $~lib/rt/stub/__retain + local.set $2 + local.get $1 + call $~lib/rt/stub/__release + local.get $2 return end - local.get $4 - call $~lib/internal/string/allocateUnsafe - local.set $5 - local.get $5 - i32.const 0 + local.get $6 + i32.const 1 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain + local.set $7 + local.get $7 local.get $0 - i32.const 0 - local.get $2 - call $~lib/internal/string/copyUnsafe - local.get $5 - local.get $2 + local.get $4 + call $~lib/memory/memory.copy + local.get $7 + local.get $4 + i32.add local.get $1 - i32.const 0 - local.get $3 - call $~lib/internal/string/copyUnsafe local.get $5 + call $~lib/memory/memory.copy + local.get $7 + local.set $2 + local.get $1 + call $~lib/rt/stub/__release + local.get $2 ) - (func $~lib/string/String.__concat (; 34 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__concat (; 31 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) local.get $0 - i32.eqz - if - i32.const 488 - local.set $0 - end + call $~lib/rt/stub/__retain + drop + local.get $1 + call $~lib/rt/stub/__retain + drop + local.get $0 + i32.const 656 local.get $0 + i32.const 0 + i32.ne + select local.get $1 call $~lib/string/String#concat + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 ) - (func $~lib/symbol/symbol#toString (; 35 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/symbol/_Symbol#toString (; 32 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) + (local $4 i32) + (local $5 i32) local.get $0 local.set $1 - i32.const 168 + i32.const 200 + call $~lib/rt/stub/__retain local.set $2 block $break|0 block $case11|0 @@ -3181,7 +3343,21 @@ br $case11|0 end block - i32.const 176 + block (result i32) + i32.const 216 + local.tee $3 + local.get $2 + local.tee $4 + i32.ne + if + local.get $3 + call $~lib/rt/stub/__retain + drop + local.get $4 + call $~lib/rt/stub/__release + end + local.get $3 + end local.set $2 br $break|0 unreachable @@ -3189,7 +3365,21 @@ unreachable end block - i32.const 208 + block (result i32) + i32.const 256 + local.tee $4 + local.get $2 + local.tee $3 + i32.ne + if + local.get $4 + call $~lib/rt/stub/__retain + drop + local.get $3 + call $~lib/rt/stub/__release + end + local.get $4 + end local.set $2 br $break|0 unreachable @@ -3197,7 +3387,21 @@ unreachable end block - i32.const 248 + block (result i32) + i32.const 312 + local.tee $3 + local.get $2 + local.tee $4 + i32.ne + if + local.get $3 + call $~lib/rt/stub/__retain + drop + local.get $4 + call $~lib/rt/stub/__release + end + local.get $3 + end local.set $2 br $break|0 unreachable @@ -3205,7 +3409,21 @@ unreachable end block - i32.const 272 + block (result i32) + i32.const 344 + local.tee $4 + local.get $2 + local.tee $3 + i32.ne + if + local.get $4 + call $~lib/rt/stub/__retain + drop + local.get $3 + call $~lib/rt/stub/__release + end + local.get $4 + end local.set $2 br $break|0 unreachable @@ -3213,7 +3431,21 @@ unreachable end block - i32.const 288 + block (result i32) + i32.const 376 + local.tee $3 + local.get $2 + local.tee $4 + i32.ne + if + local.get $3 + call $~lib/rt/stub/__retain + drop + local.get $4 + call $~lib/rt/stub/__release + end + local.get $3 + end local.set $2 br $break|0 unreachable @@ -3221,7 +3453,21 @@ unreachable end block - i32.const 312 + block (result i32) + i32.const 408 + local.tee $4 + local.get $2 + local.tee $3 + i32.ne + if + local.get $4 + call $~lib/rt/stub/__retain + drop + local.get $3 + call $~lib/rt/stub/__release + end + local.get $4 + end local.set $2 br $break|0 unreachable @@ -3229,7 +3475,21 @@ unreachable end block - i32.const 328 + block (result i32) + i32.const 440 + local.tee $3 + local.get $2 + local.tee $4 + i32.ne + if + local.get $3 + call $~lib/rt/stub/__retain + drop + local.get $4 + call $~lib/rt/stub/__release + end + local.get $3 + end local.set $2 br $break|0 unreachable @@ -3237,7 +3497,21 @@ unreachable end block - i32.const 352 + block (result i32) + i32.const 472 + local.tee $4 + local.get $2 + local.tee $3 + i32.ne + if + local.get $4 + call $~lib/rt/stub/__retain + drop + local.get $3 + call $~lib/rt/stub/__release + end + local.get $4 + end local.set $2 br $break|0 unreachable @@ -3245,7 +3519,21 @@ unreachable end block - i32.const 368 + block (result i32) + i32.const 504 + local.tee $3 + local.get $2 + local.tee $4 + i32.ne + if + local.get $3 + call $~lib/rt/stub/__retain + drop + local.get $4 + call $~lib/rt/stub/__release + end + local.get $3 + end local.set $2 br $break|0 unreachable @@ -3253,7 +3541,21 @@ unreachable end block - i32.const 400 + block (result i32) + i32.const 544 + local.tee $4 + local.get $2 + local.tee $3 + i32.ne + if + local.get $4 + call $~lib/rt/stub/__retain + drop + local.get $3 + call $~lib/rt/stub/__release + end + local.get $4 + end local.set $2 br $break|0 unreachable @@ -3261,7 +3563,21 @@ unreachable end block - i32.const 432 + block (result i32) + i32.const 584 + local.tee $3 + local.get $2 + local.tee $4 + i32.ne + if + local.get $3 + call $~lib/rt/stub/__retain + drop + local.get $4 + call $~lib/rt/stub/__release + end + local.get $3 + end local.set $2 br $break|0 unreachable @@ -3272,18 +3588,23 @@ global.get $~lib/symbol/idToString i32.const 0 i32.ne - local.tee $3 if (result i32) global.get $~lib/symbol/idToString local.get $1 call $~lib/map/Map#has else - local.get $3 + i32.const 0 end if - global.get $~lib/symbol/idToString - local.get $1 - call $~lib/map/Map#get + block (result i32) + global.get $~lib/symbol/idToString + local.get $1 + call $~lib/map/Map#get + local.set $4 + local.get $2 + call $~lib/rt/stub/__release + local.get $4 + end local.set $2 end br $break|0 @@ -3291,18 +3612,34 @@ end unreachable end - i32.const 464 + i32.const 624 local.get $2 call $~lib/string/String.__concat - i32.const 592 + local.tee $4 + i32.const 680 call $~lib/string/String.__concat + local.tee $3 + call $~lib/rt/stub/__retain + local.set $5 + local.get $4 + call $~lib/rt/stub/__release + local.get $3 + call $~lib/rt/stub/__release + local.get $2 + call $~lib/rt/stub/__release + local.get $5 ) - (func $start:std/symbol (; 36 ;) (type $FUNCSIG$v) - call $start:~lib/allocator/arena - i32.const 8 + (func $start:std/symbol (; 33 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + i32.const 24 call $~lib/symbol/Symbol global.set $std/symbol/sym1 - i32.const 8 + i32.const 24 call $~lib/symbol/Symbol global.set $std/symbol/sym2 global.get $std/symbol/sym1 @@ -3311,17 +3648,27 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 6 + i32.const 48 + i32.const 4 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 8 - call $~lib/symbol/Symbol.for + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset + i32.const 24 + call $~lib/symbol/_Symbol.for global.set $std/symbol/sym3 - i32.const 8 - call $~lib/symbol/Symbol.for + i32.const 24 + call $~lib/symbol/_Symbol.for global.set $std/symbol/sym4 global.get $std/symbol/sym3 global.get $std/symbol/sym4 @@ -3329,17 +3676,17 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 11 + i32.const 48 + i32.const 9 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/symbol/sym1 - call $~lib/symbol/Symbol.keyFor + call $~lib/symbol/_Symbol.keyFor global.set $std/symbol/key1 global.get $std/symbol/sym2 - call $~lib/symbol/Symbol.keyFor + call $~lib/symbol/_Symbol.keyFor global.set $std/symbol/key2 global.get $std/symbol/key1 i32.const 0 @@ -3347,10 +3694,10 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 16 + i32.const 48 + i32.const 14 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/symbol/key2 @@ -3359,28 +3706,32 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 17 + i32.const 48 + i32.const 15 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/symbol/sym3 - call $~lib/symbol/Symbol.keyFor + call $~lib/symbol/_Symbol.keyFor + local.tee $0 + call $~lib/rt/stub/__retain global.set $std/symbol/key3 global.get $std/symbol/sym4 - call $~lib/symbol/Symbol.keyFor + call $~lib/symbol/_Symbol.keyFor + local.tee $1 + call $~lib/rt/stub/__retain global.set $std/symbol/key4 global.get $std/symbol/key3 - i32.const 8 + i32.const 24 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 24 - i32.const 22 + i32.const 48 + i32.const 20 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/symbol/key3 @@ -3389,77 +3740,93 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 23 + i32.const 48 + i32.const 21 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 call $~lib/symbol/Symbol - call $~lib/symbol/symbol#toString - i32.const 600 + call $~lib/symbol/_Symbol#toString + local.tee $2 + i32.const 704 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 24 - i32.const 25 + i32.const 48 + i32.const 23 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/symbol/sym3 - call $~lib/symbol/symbol#toString - i32.const 624 + call $~lib/symbol/_Symbol#toString + local.tee $3 + i32.const 736 call $~lib/string/String.__eq i32.eqz if i32.const 0 + i32.const 48 i32.const 24 - i32.const 26 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $~lib/symbol/Symbol.hasInstance + global.get $~lib/symbol/_Symbol.hasInstance global.set $std/symbol/hasInstance - global.get $~lib/symbol/Symbol.isConcatSpreadable + global.get $~lib/symbol/_Symbol.isConcatSpreadable global.set $std/symbol/isConcatSpreadable global.get $std/symbol/hasInstance - call $~lib/symbol/symbol#toString - i32.const 656 + call $~lib/symbol/_Symbol#toString + local.tee $4 + i32.const 776 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 24 - i32.const 30 + i32.const 48 + i32.const 28 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/symbol/isConcatSpreadable - call $~lib/symbol/symbol#toString - i32.const 704 + call $~lib/symbol/_Symbol#toString + local.tee $5 + i32.const 832 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 24 - i32.const 31 + i32.const 48 + i32.const 29 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $~lib/symbol/Symbol.hasInstance + global.get $~lib/symbol/_Symbol.hasInstance drop - global.get $~lib/symbol/Symbol.isConcatSpreadable + global.get $~lib/symbol/_Symbol.isConcatSpreadable drop + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 + call $~lib/rt/stub/__release + local.get $3 + call $~lib/rt/stub/__release + local.get $4 + call $~lib/rt/stub/__release + local.get $5 + call $~lib/rt/stub/__release ) - (func $start (; 37 ;) (type $FUNCSIG$v) + (func $start (; 34 ;) (type $FUNCSIG$v) call $start:std/symbol ) - (func $null (; 38 ;) (type $FUNCSIG$v) + (func $null (; 35 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/std/trace.json b/tests/compiler/std/trace.json new file mode 100644 index 0000000000..bf222c4d2d --- /dev/null +++ b/tests/compiler/std/trace.json @@ -0,0 +1,6 @@ +{ + "asc_flags": [ + "--runtime none", + "--explicitStart" + ] +} \ No newline at end of file diff --git a/tests/compiler/std/trace.optimized.wat b/tests/compiler/std/trace.optimized.wat index fb24789172..bb56057915 100644 --- a/tests/compiler/std/trace.optimized.wat +++ b/tests/compiler/std/trace.optimized.wat @@ -1,96 +1,94 @@ (module (type $FUNCSIG$viiddddd (func (param i32 i32 f64 f64 f64 f64 f64))) (type $FUNCSIG$v (func)) - (import "env" "trace" (func $~lib/env/trace (param i32 i32 f64 f64 f64 f64 f64))) + (import "env" "trace" (func $~lib/builtins/trace (param i32 i32 f64 f64 f64 f64 f64))) (memory $0 1) - (data (i32.const 8) "\0d\00\00\00z\00e\00r\00o\00_\00i\00m\00p\00l\00i\00c\00i\00t") - (data (i32.const 40) "\0d\00\00\00z\00e\00r\00o\00_\00e\00x\00p\00l\00i\00c\00i\00t") - (data (i32.const 72) "\07\00\00\00o\00n\00e\00_\00i\00n\00t") - (data (i32.const 96) "\07\00\00\00t\00w\00o\00_\00i\00n\00t") - (data (i32.const 120) "\t\00\00\00t\00h\00r\00e\00e\00_\00i\00n\00t") - (data (i32.const 144) "\08\00\00\00f\00o\00u\00r\00_\00i\00n\00t") - (data (i32.const 168) "\08\00\00\00f\00i\00v\00e\00_\00i\00n\00t") - (data (i32.const 192) "\08\00\00\00f\00i\00v\00e\00_\00d\00b\00l") - (table $0 1 funcref) - (elem (i32.const 0) $null) + (data (i32.const 8) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00z\00e\00r\00o\00_\00i\00m\00p\00l\00i\00c\00i\00t") + (data (i32.const 56) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00z\00e\00r\00o\00_\00e\00x\00p\00l\00i\00c\00i\00t") + (data (i32.const 104) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\00o\00n\00e\00_\00i\00n\00t") + (data (i32.const 136) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\00t\00w\00o\00_\00i\00n\00t") + (data (i32.const 168) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\00t\00h\00r\00e\00e\00_\00i\00n\00t") + (data (i32.const 208) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00f\00o\00u\00r\00_\00i\00n\00t") + (data (i32.const 240) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00f\00i\00v\00e\00_\00i\00n\00t") + (data (i32.const 272) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00f\00i\00v\00e\00_\00d\00b\00l") (global $~lib/started (mut i32) (i32.const 0)) + (export "__start" (func $start)) (export "memory" (memory $0)) - (export "table" (table $0)) - (export "main" (func $std/trace/main)) (func $start:std/trace (; 1 ;) (type $FUNCSIG$v) - i32.const 8 + i32.const 24 i32.const 0 f64.const 0 f64.const 0 f64.const 0 f64.const 0 f64.const 0 - call $~lib/env/trace - i32.const 40 + call $~lib/builtins/trace + i32.const 72 i32.const 0 f64.const 0 f64.const 0 f64.const 0 f64.const 0 f64.const 0 - call $~lib/env/trace - i32.const 72 + call $~lib/builtins/trace + i32.const 120 i32.const 1 f64.const 1 f64.const 0 f64.const 0 f64.const 0 f64.const 0 - call $~lib/env/trace - i32.const 96 + call $~lib/builtins/trace + i32.const 152 i32.const 2 f64.const 1 f64.const 2 f64.const 0 f64.const 0 f64.const 0 - call $~lib/env/trace - i32.const 120 + call $~lib/builtins/trace + i32.const 184 i32.const 3 f64.const 1 f64.const 2 f64.const 3 f64.const 0 f64.const 0 - call $~lib/env/trace - i32.const 144 + call $~lib/builtins/trace + i32.const 224 i32.const 4 f64.const 1 f64.const 2 f64.const 3 f64.const 4 f64.const 0 - call $~lib/env/trace - i32.const 168 + call $~lib/builtins/trace + i32.const 256 i32.const 5 f64.const 1 f64.const 2 f64.const 3 f64.const 4 f64.const 5 - call $~lib/env/trace - i32.const 192 + call $~lib/builtins/trace + i32.const 288 i32.const 5 f64.const 1.1 f64.const 2.2 f64.const 3.3 f64.const 4.4 f64.const 5.5 - call $~lib/env/trace + call $~lib/builtins/trace ) - (func $std/trace/main (; 2 ;) (type $FUNCSIG$v) + (func $start (; 2 ;) (type $FUNCSIG$v) global.get $~lib/started - i32.eqz if - call $start:std/trace + return + else i32.const 1 global.set $~lib/started end + call $start:std/trace ) (func $null (; 3 ;) (type $FUNCSIG$v) nop diff --git a/tests/compiler/std/trace.ts b/tests/compiler/std/trace.ts index 0c49346125..e8bb145fcb 100644 --- a/tests/compiler/std/trace.ts +++ b/tests/compiler/std/trace.ts @@ -6,6 +6,3 @@ trace("three_int", 3, 1, 2, 3); trace("four_int", 4, 1, 2, 3, 4); trace("five_int", 5, 1, 2, 3, 4, 5); trace("five_dbl", 5, 1.1, 2.2, 3.3, 4.4, 5.5); - -@start -export function main(): void {} diff --git a/tests/compiler/std/trace.untouched.wat b/tests/compiler/std/trace.untouched.wat index 2486b5ad66..affdaeadbc 100644 --- a/tests/compiler/std/trace.untouched.wat +++ b/tests/compiler/std/trace.untouched.wat @@ -1,101 +1,97 @@ (module (type $FUNCSIG$viiddddd (func (param i32 i32 f64 f64 f64 f64 f64))) (type $FUNCSIG$v (func)) - (import "env" "trace" (func $~lib/env/trace (param i32 i32 f64 f64 f64 f64 f64))) + (import "env" "trace" (func $~lib/builtins/trace (param i32 i32 f64 f64 f64 f64 f64))) (memory $0 1) - (data (i32.const 8) "\0d\00\00\00z\00e\00r\00o\00_\00i\00m\00p\00l\00i\00c\00i\00t\00") - (data (i32.const 40) "\0d\00\00\00z\00e\00r\00o\00_\00e\00x\00p\00l\00i\00c\00i\00t\00") - (data (i32.const 72) "\07\00\00\00o\00n\00e\00_\00i\00n\00t\00") - (data (i32.const 96) "\07\00\00\00t\00w\00o\00_\00i\00n\00t\00") - (data (i32.const 120) "\t\00\00\00t\00h\00r\00e\00e\00_\00i\00n\00t\00") - (data (i32.const 144) "\08\00\00\00f\00o\00u\00r\00_\00i\00n\00t\00") - (data (i32.const 168) "\08\00\00\00f\00i\00v\00e\00_\00i\00n\00t\00") - (data (i32.const 192) "\08\00\00\00f\00i\00v\00e\00_\00d\00b\00l\00") + (data (i32.const 8) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00z\00e\00r\00o\00_\00i\00m\00p\00l\00i\00c\00i\00t\00") + (data (i32.const 56) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00z\00e\00r\00o\00_\00e\00x\00p\00l\00i\00c\00i\00t\00") + (data (i32.const 104) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\00o\00n\00e\00_\00i\00n\00t\00") + (data (i32.const 136) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\00t\00w\00o\00_\00i\00n\00t\00") + (data (i32.const 168) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\00t\00h\00r\00e\00e\00_\00i\00n\00t\00") + (data (i32.const 208) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00f\00o\00u\00r\00_\00i\00n\00t\00") + (data (i32.const 240) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00f\00i\00v\00e\00_\00i\00n\00t\00") + (data (i32.const 272) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00f\00i\00v\00e\00_\00d\00b\00l\00") (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/started (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 212)) + (export "__start" (func $start)) (export "memory" (memory $0)) - (export "table" (table $0)) - (export "main" (func $std/trace/main)) (func $start:std/trace (; 1 ;) (type $FUNCSIG$v) - i32.const 8 + i32.const 24 i32.const 0 f64.const 0 f64.const 0 f64.const 0 f64.const 0 f64.const 0 - call $~lib/env/trace - i32.const 40 + call $~lib/builtins/trace + i32.const 72 i32.const 0 f64.const 0 f64.const 0 f64.const 0 f64.const 0 f64.const 0 - call $~lib/env/trace - i32.const 72 + call $~lib/builtins/trace + i32.const 120 i32.const 1 f64.const 1 f64.const 0 f64.const 0 f64.const 0 f64.const 0 - call $~lib/env/trace - i32.const 96 + call $~lib/builtins/trace + i32.const 152 i32.const 2 f64.const 1 f64.const 2 f64.const 0 f64.const 0 f64.const 0 - call $~lib/env/trace - i32.const 120 + call $~lib/builtins/trace + i32.const 184 i32.const 3 f64.const 1 f64.const 2 f64.const 3 f64.const 0 f64.const 0 - call $~lib/env/trace - i32.const 144 + call $~lib/builtins/trace + i32.const 224 i32.const 4 f64.const 1 f64.const 2 f64.const 3 f64.const 4 f64.const 0 - call $~lib/env/trace - i32.const 168 + call $~lib/builtins/trace + i32.const 256 i32.const 5 f64.const 1 f64.const 2 f64.const 3 f64.const 4 f64.const 5 - call $~lib/env/trace - i32.const 192 + call $~lib/builtins/trace + i32.const 288 i32.const 5 f64.const 1.1 f64.const 2.2 f64.const 3.3 f64.const 4.4 f64.const 5.5 - call $~lib/env/trace + call $~lib/builtins/trace ) - (func $std/trace/main (; 2 ;) (type $FUNCSIG$v) + (func $start (; 2 ;) (type $FUNCSIG$v) global.get $~lib/started - i32.eqz if - call $start + return + else i32.const 1 global.set $~lib/started end - ) - (func $start (; 3 ;) (type $FUNCSIG$v) call $start:std/trace ) - (func $null (; 4 ;) (type $FUNCSIG$v) + (func $null (; 3 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/std/typedarray.json b/tests/compiler/std/typedarray.json new file mode 100644 index 0000000000..59c251c705 --- /dev/null +++ b/tests/compiler/std/typedarray.json @@ -0,0 +1,7 @@ +{ + "asc_flags": [ + "--runtime half", + "--explicitStart", + "--use ASC_RTRACE=1" + ] +} \ No newline at end of file diff --git a/tests/compiler/std/typedarray.optimized.wat b/tests/compiler/std/typedarray.optimized.wat index cf31cc7f03..8e47af5dd9 100644 --- a/tests/compiler/std/typedarray.optimized.wat +++ b/tests/compiler/std/typedarray.optimized.wat @@ -1,11 +1,12 @@ (module (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) - (type $FUNCSIG$v (func)) (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$vii (func (param i32 i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$viii (func (param i32 i32 i32))) - (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$viid (func (param i32 i32 f64))) (type $FUNCSIG$idd (func (param f64 f64) (result i32))) (type $FUNCSIG$dii (func (param i32 i32) (result f64))) @@ -23,7 +24,6 @@ (type $FUNCSIG$ijii (func (param i64 i32 i32) (result i32))) (type $FUNCSIG$ifii (func (param f32 i32 i32) (result i32))) (type $FUNCSIG$idii (func (param f64 i32 i32) (result i32))) - (type $FUNCSIG$vii (func (param i32 i32))) (type $FUNCSIG$vjii (func (param i64 i32 i32))) (type $FUNCSIG$vfii (func (param f32 i32 i32))) (type $FUNCSIG$vdii (func (param f64 i32 i32))) @@ -31,494 +31,1561 @@ (type $FUNCSIG$di (func (param i32) (result f64))) (type $FUNCSIG$ff (func (param f32) (result f32))) (type $FUNCSIG$dd (func (param f64) (result f64))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32))) + (import "rtrace" "onincrement" (func $~lib/rt/rtrace/onincrement (param i32))) + (import "rtrace" "ondecrement" (func $~lib/rt/rtrace/ondecrement (param i32))) + (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) (memory $0 1) - (data (i32.const 8) "\11\00\00\00s\00t\00d\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s") - (data (i32.const 48) "\1b\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s") - (data (i32.const 112) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") - (data (i32.const 176) "\05\00\00\00\00\00\00\00\01\01\01\04\05") - (data (i32.const 192) "\b0\00\00\00\05") - (data (i32.const 200) "\05") - (data (i32.const 216) "\c8\00\00\00\05") - (data (i32.const 224) "\05\00\00\00\00\00\00\00\01\01") - (data (i32.const 240) "\e0\00\00\00\05") - (data (i32.const 248) "\05\00\00\00\00\00\00\00\01\01\00\02\02") - (data (i32.const 264) "\f8\00\00\00\05") - (data (i32.const 272) "\05\00\00\00\00\00\00\00\01\01\00\02\02") - (data (i32.const 288) "\10\01\00\00\05") - (data (i32.const 296) "\03") - (data (i32.const 312) "(\01\00\00\03") - (data (i32.const 320) "\05\00\00\00\00\00\00\00\01\00\00\00\02") - (data (i32.const 336) "@\01\00\00\05") - (data (i32.const 344) "\14\00\00\00\00\00\00\00\01\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00\05") - (data (i32.const 376) "X\01\00\00\05") - (data (i32.const 384) "\14") - (data (i32.const 416) "\80\01\00\00\05") - (data (i32.const 424) "\14\00\00\00\00\00\00\00\01\00\00\00\01") - (data (i32.const 456) "\a8\01\00\00\05") - (data (i32.const 464) "\14\00\00\00\00\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\02") - (data (i32.const 496) "\d0\01\00\00\05") - (data (i32.const 504) "\14\00\00\00\00\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\02") - (data (i32.const 536) "\f8\01\00\00\05") - (data (i32.const 544) "\0c") - (data (i32.const 576) " \02\00\00\03") - (data (i32.const 584) "\14\00\00\00\00\00\00\00\01") - (data (i32.const 608) "\02") - (data (i32.const 616) "H\02\00\00\05") - (data (i32.const 624) "\0f\00\00\00r\00e\00s\00u\00l\00t\00 \00m\00i\00s\00m\00a\00t\00c\00h") - (data (i32.const 664) "\14\00\00\00f\00a\00i\00l\00 \00r\00e\00s\00u\00l\00t\00 \00m\00i\00s\00m\00a\00t\00c\00h") - (data (i32.const 712) "\0c\00\00\00\00\00\00\00\n\00\00\00\0c\00\00\00\0e") - (data (i32.const 744) "\c8\02\00\00\03") - (data (i32.const 752) "\16\00\00\00f\00o\00r\00E\00a\00c\00h\00 \00v\00a\00l\00u\00e\00 \00m\00i\00s\00m\00a\00t\00c\00h") - (data (i32.const 800) "\16\00\00\00f\00o\00r\00E\00a\00c\00h\00 \00i\00n\00d\00e\00x\00 \00m\00i\00s\00m\00a\00t\00c\00h") - (data (i32.const 848) "\1f\00\00\00f\00o\00r\00E\00a\00c\00h\00 \00s\00e\00l\00f\00 \00p\00a\00r\00a\00m\00e\00t\00e\00r\00 \00m\00i\00s\00m\00a\00t\00c\00h") - (data (i32.const 920) "\1b\00\00\00f\00o\00r\00E\00a\00c\00h\00 \00c\00a\00l\00l\00 \00c\00o\00u\00n\00t\00 \00m\00i\00s\00m\00a\00t\00c\00h") - (data (i32.const 984) "$\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\06\00\00\00\07\00\00\00\08\00\00\00\t") - (data (i32.const 1048) "\d8\03\00\00\t") - (data (i32.const 1056) "!\00\00\00T\00y\00p\00e\00d\00A\00r\00r\00a\00y\00 \00r\00e\00v\00e\00r\00s\00e\00 \00v\00a\00l\00u\00e\00 \00m\00i\00s\00m\00a\00t\00c\00h") - (data (i32.const 1128) "+\00\00\00T\00y\00p\00e\00d\00A\00r\00r\00a\00y\00 \00r\00e\00v\00e\00r\00s\00e\00 \00w\00i\00t\00h\00 \00b\00y\00t\00e\00O\00f\00f\00s\00e\00t\00 \00m\00i\00s\00m\00a\00t\00c\00h") + (data (i32.const 8) "\"\00\00\00\01\00\00\00\01\00\00\00\"\00\00\00s\00t\00d\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s") + (data (i32.const 64) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h") + (data (i32.const 112) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") + (data (i32.const 168) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s") + (data (i32.const 216) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e") + (data (i32.const 272) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s") + (data (i32.const 320) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e") + (data (i32.const 376) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s") + (data (i32.const 416) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00~\00l\00i\00b\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s") + (data (i32.const 472) "\05\00\00\00\01\00\00\00\00\00\00\00\05\00\00\00\01\01\01\04\05") + (data (i32.const 496) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s") + (data (i32.const 544) "\05\00\00\00\01\00\00\00\00\00\00\00\05") + (data (i32.const 568) "\05\00\00\00\01\00\00\00\00\00\00\00\05\00\00\00\01\01") + (data (i32.const 592) "\05\00\00\00\01\00\00\00\00\00\00\00\05\00\00\00\01\01\00\02\02") + (data (i32.const 616) "\05\00\00\00\01\00\00\00\00\00\00\00\05\00\00\00\01\01\00\02\02") + (data (i32.const 640) "\03\00\00\00\01\00\00\00\00\00\00\00\03") + (data (i32.const 664) "\05\00\00\00\01\00\00\00\00\00\00\00\05\00\00\00\01\00\00\00\02") + (data (i32.const 688) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00\05") + (data (i32.const 728) "\14\00\00\00\01\00\00\00\00\00\00\00\14") + (data (i32.const 768) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\01") + (data (i32.const 808) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\02") + (data (i32.const 848) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\02") + (data (i32.const 888) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c") + (data (i32.const 920) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01") + (data (i32.const 952) "\02") + (data (i32.const 960) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00r\00e\00s\00u\00l\00t\00 \00m\00i\00s\00m\00a\00t\00c\00h") + (data (i32.const 1008) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00f\00a\00i\00l\00 \00r\00e\00s\00u\00l\00t\00 \00m\00i\00s\00m\00a\00t\00c\00h") + (data (i32.const 1064) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\n\00\00\00\0c\00\00\00\0e") + (data (i32.const 1096) "\10\00\00\00\01\00\00\00\0f\00\00\00\10\00\00\008\04\00\008\04\00\00\0c\00\00\00\03") + (data (i32.const 1128) ",\00\00\00\01\00\00\00\01\00\00\00,\00\00\00f\00o\00r\00E\00a\00c\00h\00 \00v\00a\00l\00u\00e\00 \00m\00i\00s\00m\00a\00t\00c\00h") + (data (i32.const 1192) ",\00\00\00\01\00\00\00\01\00\00\00,\00\00\00f\00o\00r\00E\00a\00c\00h\00 \00i\00n\00d\00e\00x\00 \00m\00i\00s\00m\00a\00t\00c\00h") + (data (i32.const 1256) ">\00\00\00\01\00\00\00\01\00\00\00>\00\00\00f\00o\00r\00E\00a\00c\00h\00 \00s\00e\00l\00f\00 \00p\00a\00r\00a\00m\00e\00t\00e\00r\00 \00m\00i\00s\00m\00a\00t\00c\00h") + (data (i32.const 1336) "6\00\00\00\01\00\00\00\01\00\00\006\00\00\00f\00o\00r\00E\00a\00c\00h\00 \00c\00a\00l\00l\00 \00c\00o\00u\00n\00t\00 \00m\00i\00s\00m\00a\00t\00c\00h") + (data (i32.const 1408) "$\00\00\00\01\00\00\00\00\00\00\00$\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\06\00\00\00\07\00\00\00\08\00\00\00\t") + (data (i32.const 1464) "\10\00\00\00\01\00\00\00\0f\00\00\00\10\00\00\00\90\05\00\00\90\05\00\00$\00\00\00\t") + (data (i32.const 1496) "B\00\00\00\01\00\00\00\01\00\00\00B\00\00\00T\00y\00p\00e\00d\00A\00r\00r\00a\00y\00 \00r\00e\00v\00e\00r\00s\00e\00 \00v\00a\00l\00u\00e\00 \00m\00i\00s\00m\00a\00t\00c\00h") + (data (i32.const 1584) "V\00\00\00\01\00\00\00\01\00\00\00V\00\00\00T\00y\00p\00e\00d\00A\00r\00r\00a\00y\00 \00r\00e\00v\00e\00r\00s\00e\00 \00w\00i\00t\00h\00 \00b\00y\00t\00e\00O\00f\00f\00s\00e\00t\00 \00m\00i\00s\00m\00a\00t\00c\00h") + (data (i32.const 1688) "\10\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\001\04\00\00\02\00\00\001\00\00\00\02\00\00\001\00\00\00\02\00\00\00Q\04\00\00\02\00\00\00Q\00\00\00\02\00\00\00\91\04\00\00\02\00\00\00\91\00\00\00\02\00\00\00\11\05\00\00\02\00\00\00\11\01\00\00\02\00\00\00\91\0c\00\00\02\00\00\00\11\0d\00\00\02\00\00\003\04\00\00\02\00\00\00\93\04\00\00\02") (table $0 112 funcref) - (elem (i32.const 0) $null $~lib/internal/sort/COMPARATOR~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int16Array,i16>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int16Array,i16>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int32Array,i32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int32Array,i32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int64Array,i64>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int64Array,i64>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Float32Array,f32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Float64Array,f64>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint64Array,u64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Float64Array,f64>~anonymous|0) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) - (global $std/typedarray/arr (mut i32) (i32.const 0)) - (global $std/typedarray/af64 (mut i32) (i32.const 0)) + (elem (i32.const 0) $null $~lib/util/sort/COMPARATOR~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int16Array,i16>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int16Array,i16>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int32Array,i32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int32Array,i32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int64Array,i64>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int64Array,i64>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Float32Array,f32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Float64Array,f64>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint64Array,u64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Float64Array,f64>~anonymous|0) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) (global $~lib/argc (mut i32) (i32.const 0)) - (global $std/typedarray/clampedArr (mut i32) (i32.const 0)) - (global $std/typedarray/arr8 (mut i32) (i32.const 0)) - (global $std/typedarray/sub8 (mut i32) (i32.const 0)) - (global $std/typedarray/arr32 (mut i32) (i32.const 0)) - (global $std/typedarray/sub32 (mut i32) (i32.const 0)) - (global $std/typedarray/multisubarr (mut i32) (i32.const 0)) - (global $std/typedarray/multisubarr1 (mut i32) (i32.const 0)) - (global $std/typedarray/multisubarr2 (mut i32) (i32.const 0)) - (global $std/typedarray/multisubarr3 (mut i32) (i32.const 0)) (global $std/typedarray/forEachCallCount (mut i32) (i32.const 0)) (global $std/typedarray/forEachSelf (mut i32) (i32.const 0)) - (global $std/typedarray/forEachValues (mut i32) (i32.const 744)) - (global $std/typedarray/testArrayReverseValues (mut i32) (i32.const 1048)) + (global $std/typedarray/forEachValues i32 (i32.const 1112)) + (global $std/typedarray/testArrayReverseValues i32 (i32.const 1480)) + (global $~lib/started (mut i32) (i32.const 0)) + (export "__start" (func $start)) (export "memory" (memory $0)) - (export "table" (table $0)) - (start $start) - (func $~lib/allocator/arena/__memory_allocate (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/rt/tlsf/removeBlock (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) - local.get $0 - i32.const 1073741824 - i32.gt_u + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.tee $3 + i32.const 1 + i32.and + i32.eqz if + i32.const 0 + i32.const 184 + i32.const 276 + i32.const 13 + call $~lib/builtins/abort unreachable end - global.get $~lib/allocator/arena/offset - local.tee $1 - local.get $0 - i32.const 1 - local.get $0 - i32.const 1 - i32.gt_u - select - i32.add - i32.const 7 - i32.add - i32.const -8 + local.get $3 + i32.const -4 i32.and - local.tee $0 - current_memory local.tee $2 i32.const 16 - i32.shl - i32.gt_u + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz if + i32.const 0 + i32.const 184 + i32.const 278 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 256 + i32.lt_u + if (result i32) local.get $2 - local.get $0 - local.get $1 - i32.sub - i32.const 65535 - i32.add - i32.const -65536 - i32.and - i32.const 16 + i32.const 4 i32.shr_u - local.tee $3 + local.set $2 + i32.const 0 + else + local.get $2 + i32.const 31 local.get $2 + i32.clz + i32.sub + local.tee $3 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $2 local.get $3 - i32.gt_s - select - grow_memory + i32.const 7 + i32.sub + end + local.tee $3 + i32.const 23 + i32.lt_u + if (result i32) + local.get $2 + i32.const 16 + i32.lt_u + else i32.const 0 - i32.lt_s - if - local.get $3 - grow_memory - i32.const 0 - i32.lt_s - if - unreachable - end - end end - local.get $0 - global.set $~lib/allocator/arena/offset - local.get $1 - ) - (func $~lib/internal/arraybuffer/allocateUnsafe (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - local.get $0 - i32.const 1073741816 - i32.gt_u + i32.eqz if i32.const 0 - i32.const 112 - i32.const 26 - i32.const 2 - call $~lib/env/abort + i32.const 184 + i32.const 291 + i32.const 13 + call $~lib/builtins/abort unreachable end - i32.const 1 - i32.const 32 - local.get $0 - i32.const 7 - i32.add - i32.clz - i32.sub - i32.shl - call $~lib/allocator/arena/__memory_allocate - local.tee $1 - local.get $0 - i32.store local.get $1 - ) - (func $~lib/internal/memory/memset (; 3 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i64) - local.get $2 - i32.eqz + i32.load offset=20 + local.set $4 + local.get $1 + i32.load offset=16 + local.tee $5 if - return + local.get $5 + local.get $4 + i32.store offset=20 end - local.get $0 - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 1 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 2 - i32.le_u + local.get $4 if - return + local.get $4 + local.get $5 + i32.store offset=16 end - local.get $0 - i32.const 1 + local.get $3 + i32.const 4 + i32.shl + local.get $2 i32.add - local.get $1 - i32.store8 - local.get $0 i32.const 2 - i32.add - local.get $1 - i32.store8 + i32.shl local.get $0 - local.get $2 i32.add - local.tee $3 - i32.const 2 - i32.sub - local.get $1 - i32.store8 - local.get $3 - i32.const 3 - i32.sub + i32.load offset=96 local.get $1 - i32.store8 - local.get $2 - i32.const 6 - i32.le_u + i32.eq if - return + local.get $3 + i32.const 4 + i32.shl + local.get $2 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $4 + i32.store offset=96 + local.get $4 + i32.eqz + if + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const 1 + local.get $2 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.store offset=4 + local.get $1 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $3 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end end - local.get $0 - i32.const 3 - i32.add - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 4 - i32.sub + ) + (func $~lib/rt/tlsf/insertBlock (; 6 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) local.get $1 - i32.store8 - local.get $2 - i32.const 8 - i32.le_u + i32.eqz if - return + i32.const 0 + i32.const 184 + i32.const 204 + i32.const 13 + call $~lib/builtins/abort + unreachable end - local.get $2 - i32.const 0 - local.get $0 - i32.sub - i32.const 3 + local.get $1 + i32.load + local.tee $3 + i32.const 1 i32.and - local.tee $2 - i32.sub - local.set $3 - local.get $0 - local.get $2 + i32.eqz + if + i32.const 0 + i32.const 184 + i32.const 206 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 i32.add - local.tee $0 local.get $1 - i32.const 255 - i32.and - i32.const 16843009 - i32.mul - local.tee $1 - i32.store - local.get $3 + i32.load i32.const -4 i32.and - local.tee $2 - local.get $0 i32.add - i32.const 4 - i32.sub - local.get $1 + local.tee $4 + i32.load + local.tee $5 + i32.const 1 + i32.and + if + local.get $3 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const -4 + i32.and + i32.add + local.tee $2 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $3 + i32.const 3 + i32.and + local.get $2 + i32.or + local.tee $3 + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.set $5 + end + end + local.get $3 + i32.const 2 + i32.and + if + local.get $1 + i32.const 4 + i32.sub + i32.load + local.tee $2 + i32.load + local.tee $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 184 + i32.const 227 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $3 + i32.const -4 + i32.and + i32.add + local.tee $7 + i32.const 1073741808 + i32.lt_u + if (result i32) + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $2 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $3 + i32.store + local.get $2 + else + local.get $1 + end + local.set $1 + end + local.get $4 + local.get $5 + i32.const 2 + i32.or i32.store - local.get $2 - i32.const 8 - i32.le_u + local.get $3 + i32.const -4 + i32.and + local.tee $2 + i32.const 16 + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz if - return + i32.const 0 + i32.const 184 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable end - local.get $0 - i32.const 4 - i32.add + local.get $4 local.get $1 - i32.store - local.get $0 - i32.const 8 + i32.const 16 i32.add - local.get $1 - i32.store - local.get $0 local.get $2 i32.add - local.tee $3 - i32.const 12 - i32.sub - local.get $1 - i32.store - local.get $3 - i32.const 8 + i32.ne + if + i32.const 0 + i32.const 184 + i32.const 243 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 i32.sub local.get $1 i32.store local.get $2 - i32.const 24 - i32.le_u + i32.const 256 + i32.lt_u + if (result i32) + local.get $2 + i32.const 4 + i32.shr_u + local.set $4 + i32.const 0 + else + local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $4 + local.get $2 + i32.const 7 + i32.sub + end + local.tee $3 + i32.const 23 + i32.lt_u + if (result i32) + local.get $4 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz if - return + i32.const 0 + i32.const 184 + i32.const 259 + i32.const 13 + call $~lib/builtins/abort + unreachable end - local.get $0 - i32.const 12 + local.get $3 + i32.const 4 + i32.shl + local.get $4 i32.add - local.get $1 - i32.store + i32.const 2 + i32.shl local.get $0 - i32.const 16 i32.add + i32.load offset=96 + local.set $2 local.get $1 - i32.store - local.get $0 - i32.const 20 - i32.add + i32.const 0 + i32.store offset=16 local.get $1 - i32.store - local.get $0 - i32.const 24 + local.get $2 + i32.store offset=20 + local.get $2 + if + local.get $2 + local.get $1 + i32.store offset=16 + end + local.get $3 + i32.const 4 + i32.shl + local.get $4 i32.add - local.get $1 - i32.store + i32.const 2 + i32.shl local.get $0 - local.get $2 i32.add - local.tee $3 - i32.const 28 - i32.sub - local.get $1 - i32.store - local.get $3 - i32.const 24 - i32.sub local.get $1 - i32.store + i32.store offset=96 + local.get $0 + local.get $0 + i32.load + i32.const 1 local.get $3 - i32.const 20 - i32.sub - local.get $1 + i32.shl + i32.or i32.store local.get $3 - i32.const 16 - i32.sub - local.get $1 - i32.store + i32.const 2 + i32.shl local.get $0 - i32.const 4 - i32.and - i32.const 24 i32.add - local.tee $3 + local.get $3 + i32.const 2 + i32.shl local.get $0 i32.add - local.set $0 + i32.load offset=4 + i32.const 1 + local.get $4 + i32.shl + i32.or + i32.store offset=4 + ) + (func $~lib/rt/tlsf/addMemory (; 7 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) local.get $2 - local.get $3 - i32.sub - local.set $2 + i32.const 15 + i32.and + i32.eqz + i32.const 0 local.get $1 - i64.extend_i32_u - local.tee $4 - local.get $4 - i64.const 32 - i64.shl - i64.or - local.set $4 - loop $continue|0 - local.get $2 - i32.const 32 - i32.ge_u - if - local.get $0 - local.get $4 - i64.store - local.get $0 - i32.const 8 - i32.add - local.get $4 - i64.store - local.get $0 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $1 + local.get $2 + i32.le_u + select + select + i32.eqz + if + i32.const 0 + i32.const 184 + i32.const 385 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=1568 + local.tee $3 + if + local.get $1 + local.get $3 + i32.const 16 + i32.add + i32.lt_u + if + i32.const 0 + i32.const 184 + i32.const 395 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $3 + i32.eq + if + local.get $3 + i32.load + local.set $4 + local.get $1 i32.const 16 + i32.sub + local.set $1 + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.lt_u + if + i32.const 0 + i32.const 184 + i32.const 407 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.tee $2 + i32.const 48 + i32.lt_u + if + return + end + local.get $1 + local.get $4 + i32.const 2 + i32.and + local.get $2 + i32.const 32 + i32.sub + i32.const 1 + i32.or + i32.or + i32.store + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $2 + i32.add + i32.const 16 + i32.sub + local.tee $2 + i32.const 2 + i32.store + local.get $0 + local.get $2 + i32.store offset=1568 + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/tlsf/initializeRoot (; 8 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 1 + memory.size + local.tee $0 + i32.gt_s + if (result i32) + i32.const 1 + local.get $0 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + i32.const 1824 + i32.const 0 + i32.store + i32.const 3392 + i32.const 0 + i32.store + i32.const 0 + local.set $0 + loop $repeat|0 + block $break|0 + local.get $0 + i32.const 23 + i32.ge_u + br_if $break|0 + local.get $0 + i32.const 2 + i32.shl + i32.const 1824 i32.add - local.get $4 - i64.store + i32.const 0 + i32.store offset=4 + i32.const 0 + local.set $1 + loop $repeat|1 + block $break|1 + local.get $1 + i32.const 16 + i32.ge_u + br_if $break|1 + local.get $0 + i32.const 4 + i32.shl + local.get $1 + i32.add + i32.const 2 + i32.shl + i32.const 1824 + i32.add + i32.const 0 + i32.store offset=96 + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|1 + end + end local.get $0 - i32.const 24 + i32.const 1 i32.add - local.get $4 - i64.store - local.get $2 - i32.const 32 + local.set $0 + br $repeat|0 + end + end + i32.const 1824 + i32.const 3408 + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + i32.const 1824 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 232 + i32.const 184 + i32.const 447 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const -16 + i32.and + local.tee $0 + i32.const 16 + local.get $0 + i32.const 16 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + i32.const 256 + i32.lt_u + if (result i32) + local.get $1 + i32.const 4 + i32.shr_u + local.set $1 + i32.const 0 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if + i32.const 1 + i32.const 27 + local.get $1 + i32.clz i32.sub - local.set $2 + i32.shl + local.get $1 + i32.add + i32.const 1 + i32.sub + local.set $1 + end + local.get $1 + i32.const 31 + local.get $1 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $1 + local.get $2 + i32.const 7 + i32.sub + end + local.tee $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $1 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 184 + i32.const 337 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const -1 + local.get $1 + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $1 + i32.ctz + local.get $2 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + else + local.get $0 + i32.load + i32.const -1 + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $1 + i32.ctz + local.tee $1 + i32.const 2 + i32.shl local.get $0 - i32.const 32 i32.add - local.set $0 - br $continue|0 + i32.load offset=4 + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 184 + i32.const 350 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.ctz + local.get $1 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + else + i32.const 0 + end + end + ) + (func $~lib/rt/tlsf/growMemory (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + memory.size + local.tee $2 + local.get $1 + i32.const 65535 + i32.add + i32.const -65536 + i32.and + i32.const 16 + i32.shr_u + local.tee $1 + local.get $2 + local.get $1 + i32.gt_s + select + memory.grow + i32.const 0 + i32.lt_s + if + local.get $1 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable end end + local.get $0 + local.get $2 + i32.const 16 + i32.shl + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + ) + (func $~lib/rt/tlsf/prepareBlock (; 12 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + if + i32.const 0 + i32.const 184 + i32.const 364 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const -4 + i32.and + local.get $2 + i32.sub + local.tee $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $3 + i32.const 2 + i32.and + local.get $2 + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.tee $1 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const -2 + i32.and + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + i32.load + i32.const -3 + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.tee $3 + call $~lib/rt/tlsf/searchBlock + local.tee $2 + i32.eqz + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $3 + call $~lib/rt/tlsf/searchBlock + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 184 + i32.const 477 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + i32.load + i32.const -4 + i32.and + local.get $3 + i32.lt_u + if + i32.const 0 + i32.const 184 + i32.const 479 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 0 + i32.store offset=4 + local.get $2 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $2 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $2 + call $~lib/rt/rtrace/onalloc + local.get $2 ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 4 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/rt/tlsf/__alloc (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + global.get $~lib/rt/tlsf/ROOT + local.tee $2 + if (result i32) + local.get $2 + else + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + end + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.tee $0 local.get $1 - i32.const 1073741816 - i32.gt_u + i32.store offset=8 + local.get $0 + i32.const 16 + i32.add + ) + (func $~lib/rt/pure/increment (; 15 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const -268435456 + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne if i32.const 0 - i32.const 48 - i32.const 23 - i32.const 34 - call $~lib/env/abort + i32.const 288 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort unreachable end + local.get $0 local.get $1 - call $~lib/internal/arraybuffer/allocateUnsafe - local.tee $2 - i32.const 8 + i32.const 1 i32.add - i32.const 0 + i32.store offset=4 + local.get $0 + call $~lib/rt/rtrace/onincrement + local.get $0 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 288 + i32.const 107 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/pure/__retain (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 1820 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment + end + local.get $0 + ) + (func $~lib/rt/tlsf/freeBlock (; 17 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) local.get $1 - call $~lib/internal/memory/memset + i32.load + local.tee $2 + i32.const 1 + i32.and + if + i32.const 0 + i32.const 184 + i32.const 531 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/rtrace/onfree + ) + (func $~lib/rt/__typeinfo (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 1688 + i32.load + i32.gt_u + if + i32.const 336 + i32.const 392 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort + unreachable + end local.get $0 + i32.const 3 + i32.shl + i32.const 1692 + i32.add + i32.load + ) + (func $~lib/memory/memory.copy (; 19 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $2 + local.set $3 + local.get $0 + local.get $1 + i32.eq + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $1 + i32.lt_u + if + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|0 + local.get $0 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + br $continue|0 + end + end + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $1 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + br $continue|1 + end + end + end + loop $continue|2 + local.get $3 + if + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + else + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|3 + local.get $0 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $3 + i32.const 8 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + loop $continue|5 + local.get $3 + if + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + ) + (func $~lib/rt/tlsf/__free (; 20 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT i32.eqz if - i32.const 12 - call $~lib/allocator/arena/__memory_allocate - local.set $0 + i32.const 0 + i32.const 184 + i32.const 561 + i32.const 13 + call $~lib/builtins/abort + unreachable end local.get $0 + i32.const 15 + i32.and + i32.eqz i32.const 0 - i32.store local.get $0 - i32.const 0 - i32.store offset=4 + select + i32.eqz + if + i32.const 0 + i32.const 184 + i32.const 562 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/growRoots (; 21 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/pure/CUR + global.get $~lib/rt/pure/ROOTS + local.tee $1 + i32.sub + local.tee $2 + i32.const 1 + i32.shl + local.tee $0 + i32.const 256 local.get $0 + i32.const 256 + i32.gt_u + select + local.tee $3 i32.const 0 - i32.store offset=8 + call $~lib/rt/tlsf/__alloc + local.tee $0 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onfree + local.get $0 + local.get $1 + local.get $2 + call $~lib/memory/memory.copy + local.get $1 + if + local.get $1 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onalloc + local.get $1 + call $~lib/rt/tlsf/__free + end + local.get $0 + global.set $~lib/rt/pure/ROOTS local.get $0 local.get $2 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 + i32.add + global.set $~lib/rt/pure/CUR local.get $0 + local.get $3 + i32.add + global.set $~lib/rt/pure/END + ) + (func $~lib/rt/pure/appendRoot (; 22 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/pure/CUR + local.tee $1 + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 + end local.get $1 - i32.store offset=8 local.get $0 + i32.store + local.get $1 + i32.const 4 + i32.add + global.set $~lib/rt/pure/CUR ) - (func $~lib/typedarray/Int8Array#constructor (; 5 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/rt/pure/decrement (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) local.get $0 - i32.eqz + i32.load offset=4 + local.tee $2 + i32.const 268435455 + i32.and + local.set $1 + local.get $0 + call $~lib/rt/rtrace/ondecrement + local.get $0 + i32.load + i32.const 1 + i32.and if - i32.const 12 - call $~lib/allocator/arena/__memory_allocate - local.set $0 + i32.const 0 + i32.const 288 + i32.const 115 + i32.const 13 + call $~lib/builtins/abort + unreachable end - local.get $0 local.get $1 - call $~lib/internal/typedarray/TypedArray#constructor + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/rt/__visit_members + local.get $2 + i32.const -2147483648 + i32.and + if + local.get $0 + i32.const -2147483648 + i32.store offset=4 + else + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + else + local.get $1 + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 288 + i32.const 124 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 16 + i32.and + if + local.get $0 + local.get $1 + i32.const 1 + i32.sub + local.get $2 + i32.const -268435456 + i32.and + i32.or + i32.store offset=4 + else + local.get $0 + local.get $1 + i32.const 1 + i32.sub + i32.const -1342177280 + i32.or + i32.store offset=4 + local.get $2 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/appendRoot + end + end + end ) - (func $~lib/typedarray/Uint8ClampedArray#constructor (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 12 - call $~lib/allocator/arena/__memory_allocate + (func $~lib/rt/pure/__release (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 - call $~lib/typedarray/Int8Array#constructor + i32.const 1820 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + end ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) + (func $~lib/arraybuffer/ArrayBufferView#constructor (; 25 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) local.get $1 - i32.const 536870908 + i32.const 1073741808 + local.get $2 + i32.shr_u i32.gt_u if - i32.const 0 - i32.const 48 - i32.const 23 - i32.const 34 - call $~lib/env/abort + i32.const 80 + i32.const 128 + i32.const 14 + i32.const 56 + call $~lib/builtins/abort unreachable end local.get $1 - i32.const 1 + local.get $2 i32.shl - local.tee $1 - call $~lib/internal/arraybuffer/allocateUnsafe local.tee $2 - i32.const 8 - i32.add i32.const 0 - local.get $1 - call $~lib/internal/memory/memset + call $~lib/rt/tlsf/__alloc + local.set $1 local.get $0 i32.eqz if i32.const 12 - call $~lib/allocator/arena/__memory_allocate + i32.const 2 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.set $0 end local.get $0 @@ -531,149 +1598,174 @@ i32.const 0 i32.store offset=8 local.get $0 - local.get $2 + i32.load + local.tee $3 + local.get $1 + i32.ne + if + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $3 + call $~lib/rt/pure/__release + end + local.get $0 + local.get $1 i32.store local.get $0 - i32.const 0 + local.get $1 i32.store offset=4 local.get $0 - local.get $1 + local.get $2 i32.store offset=8 local.get $0 ) - (func $~lib/typedarray/Int16Array#constructor (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Int8Array#constructor (; 26 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 12 - call $~lib/allocator/arena/__memory_allocate + i32.const 3 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.get $0 - call $~lib/internal/typedarray/TypedArray#constructor - ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - local.get $1 - i32.const 268435454 - i32.gt_u - if - i32.const 0 - i32.const 48 - i32.const 23 - i32.const 34 - call $~lib/env/abort - unreachable - end - local.get $1 - i32.const 2 - i32.shl - local.tee $1 - call $~lib/internal/arraybuffer/allocateUnsafe - local.tee $2 - i32.const 8 - i32.add i32.const 0 - local.get $1 - call $~lib/internal/memory/memset - local.get $0 - i32.eqz - if - i32.const 12 - call $~lib/allocator/arena/__memory_allocate - local.set $0 - end + call $~lib/arraybuffer/ArrayBufferView#constructor + ) + (func $~lib/arraybuffer/ArrayBufferView#get:byteOffset (; 27 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - i32.const 0 - i32.store + i32.load offset=4 local.get $0 - i32.const 0 - i32.store offset=4 + i32.load + i32.sub + ) + (func $~lib/typedarray/Uint8Array#constructor (; 28 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.const 12 + i32.const 4 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.get $0 i32.const 0 - i32.store offset=8 - local.get $0 - local.get $2 - i32.store + call $~lib/arraybuffer/ArrayBufferView#constructor + ) + (func $~lib/typedarray/Uint8ClampedArray#constructor (; 29 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.const 12 + i32.const 5 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.get $0 i32.const 0 - i32.store offset=4 + call $~lib/arraybuffer/ArrayBufferView#constructor + ) + (func $~lib/typedarray/Int16Array#constructor (; 30 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.const 12 + i32.const 6 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.get $0 - local.get $1 - i32.store offset=8 + i32.const 1 + call $~lib/arraybuffer/ArrayBufferView#constructor + ) + (func $~lib/typedarray/Int16Array#get:length (; 31 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 + i32.load offset=8 + i32.const 1 + i32.shr_u ) - (func $~lib/typedarray/Int32Array#constructor (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Uint16Array#constructor (; 32 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 12 - call $~lib/allocator/arena/__memory_allocate + i32.const 7 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.get $0 - call $~lib/internal/typedarray/TypedArray#constructor + i32.const 1 + call $~lib/arraybuffer/ArrayBufferView#constructor ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 11 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - local.get $1 - i32.const 134217727 - i32.gt_u - if - i32.const 0 - i32.const 48 - i32.const 23 - i32.const 34 - call $~lib/env/abort - unreachable - end - local.get $1 - i32.const 3 - i32.shl - local.tee $1 - call $~lib/internal/arraybuffer/allocateUnsafe - local.tee $2 + (func $~lib/typedarray/Int32Array#constructor (; 33 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.const 12 i32.const 8 - i32.add - i32.const 0 - local.get $1 - call $~lib/internal/memory/memset + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.get $0 - i32.eqz - if - i32.const 12 - call $~lib/allocator/arena/__memory_allocate - local.set $0 - end - local.get $0 - i32.const 0 - i32.store + i32.const 2 + call $~lib/arraybuffer/ArrayBufferView#constructor + ) + (func $~lib/typedarray/Int32Array#get:length (; 34 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - i32.const 0 - i32.store offset=4 + i32.load offset=8 + i32.const 2 + i32.shr_u + ) + (func $~lib/typedarray/Uint32Array#constructor (; 35 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.const 12 + i32.const 9 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.get $0 - i32.const 0 - i32.store offset=8 + i32.const 2 + call $~lib/arraybuffer/ArrayBufferView#constructor + ) + (func $~lib/typedarray/Int64Array#constructor (; 36 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.const 12 + i32.const 10 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.get $0 - local.get $2 - i32.store + i32.const 3 + call $~lib/arraybuffer/ArrayBufferView#constructor + ) + (func $~lib/typedarray/Int64Array#get:length (; 37 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - i32.const 0 - i32.store offset=4 + i32.load offset=8 + i32.const 3 + i32.shr_u + ) + (func $~lib/typedarray/Uint64Array#constructor (; 38 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.const 12 + i32.const 11 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.get $0 - local.get $1 - i32.store offset=8 + i32.const 3 + call $~lib/arraybuffer/ArrayBufferView#constructor + ) + (func $~lib/typedarray/Float32Array#constructor (; 39 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.const 12 + i32.const 12 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.get $0 + i32.const 2 + call $~lib/arraybuffer/ArrayBufferView#constructor ) - (func $~lib/typedarray/Int64Array#constructor (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Float64Array#constructor (; 40 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 12 - call $~lib/allocator/arena/__memory_allocate + i32.const 13 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.get $0 - call $~lib/internal/typedarray/TypedArray#constructor + i32.const 3 + call $~lib/arraybuffer/ArrayBufferView#constructor ) - (func $std/typedarray/testInstantiate (; 13 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $std/typedarray/testInstantiate (; 41 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) - i32.const 0 + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) local.get $0 call $~lib/typedarray/Int8Array#constructor local.tee $1 - i32.load offset=4 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset if - i32.const 0 - i32.const 8 - i32.const 34 + i32.const 0 + i32.const 24 + i32.const 32 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -682,110 +1774,109 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 35 + i32.const 24 + i32.const 33 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 local.get $1 i32.load offset=8 + local.get $0 i32.ne if i32.const 0 - i32.const 8 - i32.const 36 + i32.const 24 + i32.const 34 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 0 local.get $0 - call $~lib/typedarray/Int8Array#constructor - local.tee $1 - i32.load offset=4 + call $~lib/typedarray/Uint8Array#constructor + local.tee $2 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset if i32.const 0 - i32.const 8 - i32.const 39 + i32.const 24 + i32.const 37 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $1 + local.get $2 i32.load offset=8 local.get $0 i32.ne if i32.const 0 - i32.const 8 - i32.const 40 + i32.const 24 + i32.const 38 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 - local.get $1 + local.get $2 i32.load offset=8 + local.get $0 i32.ne if i32.const 0 - i32.const 8 - i32.const 41 + i32.const 24 + i32.const 39 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 call $~lib/typedarray/Uint8ClampedArray#constructor - local.tee $1 - i32.load offset=4 + local.tee $3 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset if i32.const 0 - i32.const 8 - i32.const 44 + i32.const 24 + i32.const 42 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $1 + local.get $3 i32.load offset=8 local.get $0 i32.ne if i32.const 0 - i32.const 8 - i32.const 45 + i32.const 24 + i32.const 43 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 - local.get $1 + local.get $3 i32.load offset=8 + local.get $0 i32.ne if i32.const 0 - i32.const 8 - i32.const 46 + i32.const 24 + i32.const 44 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 call $~lib/typedarray/Int16Array#constructor - local.tee $1 - i32.load offset=4 + local.tee $4 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset if i32.const 0 - i32.const 8 - i32.const 49 + i32.const 24 + i32.const 47 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $1 + local.get $4 i32.load offset=8 local.get $0 i32.const 1 @@ -793,39 +1884,37 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 50 + i32.const 24 + i32.const 48 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $4 + call $~lib/typedarray/Int16Array#get:length local.get $0 - local.get $1 - i32.load offset=8 - i32.const 1 - i32.shr_u i32.ne if i32.const 0 - i32.const 8 - i32.const 51 + i32.const 24 + i32.const 49 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 - call $~lib/typedarray/Int16Array#constructor - local.tee $1 - i32.load offset=4 + call $~lib/typedarray/Uint16Array#constructor + local.tee $5 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset if i32.const 0 - i32.const 8 - i32.const 54 + i32.const 24 + i32.const 52 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $1 + local.get $5 i32.load offset=8 local.get $0 i32.const 1 @@ -833,39 +1922,37 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 55 + i32.const 24 + i32.const 53 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $5 + call $~lib/typedarray/Int16Array#get:length local.get $0 - local.get $1 - i32.load offset=8 - i32.const 1 - i32.shr_u i32.ne if i32.const 0 - i32.const 8 - i32.const 56 + i32.const 24 + i32.const 54 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 call $~lib/typedarray/Int32Array#constructor - local.tee $1 - i32.load offset=4 + local.tee $6 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset if i32.const 0 - i32.const 8 - i32.const 59 + i32.const 24 + i32.const 57 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $1 + local.get $6 i32.load offset=8 local.get $0 i32.const 2 @@ -873,39 +1960,37 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 60 + i32.const 24 + i32.const 58 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $6 + call $~lib/typedarray/Int32Array#get:length local.get $0 - local.get $1 - i32.load offset=8 - i32.const 2 - i32.shr_u i32.ne if i32.const 0 - i32.const 8 - i32.const 61 + i32.const 24 + i32.const 59 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 - call $~lib/typedarray/Int32Array#constructor - local.tee $1 - i32.load offset=4 + call $~lib/typedarray/Uint32Array#constructor + local.tee $7 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset if i32.const 0 - i32.const 8 - i32.const 64 + i32.const 24 + i32.const 62 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $1 + local.get $7 i32.load offset=8 local.get $0 i32.const 2 @@ -913,39 +1998,37 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 65 + i32.const 24 + i32.const 63 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $7 + call $~lib/typedarray/Int32Array#get:length local.get $0 - local.get $1 - i32.load offset=8 - i32.const 2 - i32.shr_u i32.ne if i32.const 0 - i32.const 8 - i32.const 66 + i32.const 24 + i32.const 64 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 call $~lib/typedarray/Int64Array#constructor - local.tee $1 - i32.load offset=4 + local.tee $8 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset if i32.const 0 - i32.const 8 - i32.const 69 + i32.const 24 + i32.const 67 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $1 + local.get $8 i32.load offset=8 local.get $0 i32.const 3 @@ -953,39 +2036,37 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 70 + i32.const 24 + i32.const 68 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $8 + call $~lib/typedarray/Int64Array#get:length local.get $0 - local.get $1 - i32.load offset=8 - i32.const 3 - i32.shr_u i32.ne if i32.const 0 - i32.const 8 - i32.const 71 + i32.const 24 + i32.const 69 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 - call $~lib/typedarray/Int64Array#constructor - local.tee $1 - i32.load offset=4 + call $~lib/typedarray/Uint64Array#constructor + local.tee $9 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset if i32.const 0 - i32.const 8 - i32.const 74 + i32.const 24 + i32.const 72 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $1 + local.get $9 i32.load offset=8 local.get $0 i32.const 3 @@ -993,39 +2074,37 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 75 + i32.const 24 + i32.const 73 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $9 + call $~lib/typedarray/Int64Array#get:length local.get $0 - local.get $1 - i32.load offset=8 - i32.const 3 - i32.shr_u i32.ne if i32.const 0 - i32.const 8 - i32.const 76 + i32.const 24 + i32.const 74 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 - call $~lib/typedarray/Int32Array#constructor - local.tee $1 - i32.load offset=4 + call $~lib/typedarray/Float32Array#constructor + local.tee $10 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset if i32.const 0 - i32.const 8 - i32.const 79 + i32.const 24 + i32.const 77 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $1 + local.get $10 i32.load offset=8 local.get $0 i32.const 2 @@ -1033,39 +2112,37 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 80 + i32.const 24 + i32.const 78 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $10 + call $~lib/typedarray/Int32Array#get:length local.get $0 - local.get $1 - i32.load offset=8 - i32.const 2 - i32.shr_u i32.ne if i32.const 0 - i32.const 8 - i32.const 81 + i32.const 24 + i32.const 79 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 - call $~lib/typedarray/Int64Array#constructor - local.tee $1 - i32.load offset=4 + call $~lib/typedarray/Float64Array#constructor + local.tee $11 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset if i32.const 0 - i32.const 8 - i32.const 84 + i32.const 24 + i32.const 82 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $1 + local.get $11 i32.load offset=8 local.get $0 i32.const 3 @@ -1073,28 +2150,48 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 85 + i32.const 24 + i32.const 83 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $11 + call $~lib/typedarray/Int64Array#get:length local.get $0 - local.get $1 - i32.load offset=8 - i32.const 3 - i32.shr_u i32.ne if i32.const 0 - i32.const 8 - i32.const 86 + i32.const 24 + i32.const 84 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release + local.get $8 + call $~lib/rt/pure/__release + local.get $9 + call $~lib/rt/pure/__release + local.get $10 + call $~lib/rt/pure/__release + local.get $11 + call $~lib/rt/pure/__release ) - (func $~lib/internal/typedarray/TypedArray#__set (; 14 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/typedarray/Int32Array#__set (; 42 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) local.get $1 local.get $0 i32.load offset=8 @@ -1102,26 +2199,23 @@ i32.shr_u i32.ge_u if - i32.const 0 - i32.const 48 - i32.const 50 + i32.const 336 + i32.const 432 + i32.const 443 i32.const 63 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 i32.load offset=4 - local.get $0 - i32.load local.get $1 i32.const 2 i32.shl i32.add - i32.add local.get $2 - i32.store offset=8 + i32.store ) - (func $~lib/internal/typedarray/TypedArray#__get (; 15 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int32Array#__get (; 43 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=8 @@ -1129,30 +2223,30 @@ i32.shr_u i32.ge_u if - i32.const 0 - i32.const 48 - i32.const 39 + i32.const 336 + i32.const 432 + i32.const 437 i32.const 63 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 i32.load offset=4 - local.get $0 - i32.load local.get $1 i32.const 2 i32.shl i32.add - i32.add - i32.load offset=8 + i32.load ) - (func $~lib/typedarray/Int32Array#subarray (; 16 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/typedarray/Int32Array#subarray (; 44 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u + call $~lib/rt/pure/__retain + local.tee $4 + call $~lib/typedarray/Int32Array#get:length local.set $3 local.get $1 i32.const 0 @@ -1161,9 +2255,9 @@ local.get $1 local.get $3 i32.add - local.tee $1 + local.tee $0 i32.const 0 - local.get $1 + local.get $0 i32.const 0 i32.gt_s select @@ -1175,7 +2269,7 @@ i32.lt_s select end - local.set $1 + local.set $0 local.get $2 i32.const 0 i32.lt_s @@ -1183,10 +2277,10 @@ local.get $2 local.get $3 i32.add - local.tee $2 - local.get $1 - local.get $2 + local.tee $1 + i32.const 0 local.get $1 + i32.const 0 i32.gt_s select else @@ -1196,38 +2290,57 @@ local.get $3 i32.lt_s select - local.tee $2 - local.get $1 - local.get $2 - local.get $1 - i32.gt_s - select end + local.tee $1 + local.get $0 + local.get $1 + local.get $0 + i32.gt_s + select local.set $3 i32.const 12 - call $~lib/allocator/arena/__memory_allocate + i32.const 8 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $1 + local.set $5 + local.get $4 + i32.load local.tee $2 - local.get $0 + local.get $1 i32.load - i32.store + local.tee $6 + i32.ne + if + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $6 + call $~lib/rt/pure/__release + end + local.get $5 local.get $2 - local.get $0 - i32.load offset=4 + i32.store local.get $1 + local.get $4 + i32.load offset=4 + local.get $0 i32.const 2 i32.shl i32.add i32.store offset=4 - local.get $2 - local.get $3 local.get $1 + local.get $3 + local.get $0 i32.sub i32.const 2 i32.shl i32.store offset=8 - local.get $2 + local.get $4 + call $~lib/rt/pure/__release + local.get $1 ) - (func $~lib/internal/typedarray/TypedArray#__set (; 17 ;) (type $FUNCSIG$viid) (param $0 i32) (param $1 i32) (param $2 f64) + (func $~lib/typedarray/Float64Array#__set (; 45 ;) (type $FUNCSIG$viid) (param $0 i32) (param $1 i32) (param $2 f64) local.get $1 local.get $0 i32.load offset=8 @@ -1235,31 +2348,31 @@ i32.shr_u i32.ge_u if - i32.const 0 - i32.const 48 - i32.const 50 + i32.const 336 + i32.const 432 + i32.const 853 i32.const 63 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 i32.load offset=4 - local.get $0 - i32.load local.get $1 i32.const 3 i32.shl i32.add - i32.add local.get $2 - f64.store offset=8 + f64.store ) - (func $~lib/typedarray/Float64Array#subarray (; 18 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/typedarray/Float64Array#subarray (; 46 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) local.get $0 - i32.load offset=8 - i32.const 3 - i32.shr_u + call $~lib/rt/pure/__retain + local.tee $4 + call $~lib/typedarray/Int64Array#get:length local.set $3 local.get $1 i32.const 0 @@ -1268,9 +2381,9 @@ local.get $1 local.get $3 i32.add - local.tee $1 + local.tee $0 i32.const 0 - local.get $1 + local.get $0 i32.const 0 i32.gt_s select @@ -1282,7 +2395,7 @@ i32.lt_s select end - local.set $1 + local.set $0 local.get $2 i32.const 0 i32.lt_s @@ -1290,10 +2403,10 @@ local.get $2 local.get $3 i32.add - local.tee $2 - local.get $1 - local.get $2 + local.tee $1 + i32.const 0 local.get $1 + i32.const 0 i32.gt_s select else @@ -1303,171 +2416,409 @@ local.get $3 i32.lt_s select - local.tee $2 - local.get $1 - local.get $2 - local.get $1 - i32.gt_s - select end + local.tee $1 + local.get $0 + local.get $1 + local.get $0 + i32.gt_s + select local.set $3 i32.const 12 - call $~lib/allocator/arena/__memory_allocate + i32.const 13 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $1 + local.set $5 + local.get $4 + i32.load local.tee $2 - local.get $0 + local.get $1 i32.load - i32.store + local.tee $6 + i32.ne + if + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $6 + call $~lib/rt/pure/__release + end + local.get $5 local.get $2 - local.get $0 - i32.load offset=4 + i32.store local.get $1 + local.get $4 + i32.load offset=4 + local.get $0 i32.const 3 i32.shl i32.add i32.store offset=4 - local.get $2 - local.get $3 local.get $1 + local.get $3 + local.get $0 i32.sub i32.const 3 i32.shl i32.store offset=8 - local.get $2 + local.get $4 + call $~lib/rt/pure/__release + local.get $1 ) - (func $~lib/internal/sort/insertionSort (; 19 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $~lib/util/sort/insertionSort (; 47 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) (local $4 i32) - (local $5 i32) + (local $5 f64) (local $6 f64) - (local $7 f64) - (local $8 i32) + (local $7 i32) block $break|0 loop $repeat|0 + local.get $3 + local.get $1 + i32.ge_s + br_if $break|0 + local.get $3 + i32.const 3 + i32.shl + local.get $0 + i32.add + f64.load + local.set $5 + local.get $3 + i32.const 1 + i32.sub + local.set $4 + loop $continue|1 + local.get $4 + i32.const 0 + i32.ge_s + if + block $break|1 + local.get $4 + i32.const 3 + i32.shl + local.get $0 + i32.add + f64.load + local.set $6 + i32.const 2 + global.set $~lib/argc + local.get $5 + local.get $6 + local.get $2 + call_indirect (type $FUNCSIG$idd) + i32.const 0 + i32.ge_s + br_if $break|1 + local.get $4 + local.tee $7 + i32.const 1 + i32.sub + local.set $4 + local.get $7 + i32.const 1 + i32.add + i32.const 3 + i32.shl + local.get $0 + i32.add + local.get $6 + f64.store + br $continue|1 + end + end + end local.get $4 + i32.const 1 + i32.add + i32.const 3 + i32.shl + local.get $0 + i32.add + local.get $5 + f64.store + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end + unreachable + end + ) + (func $~lib/memory/memory.fill (; 48 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i64) + block $~lib/util/memory/memset|inlined.0 + local.get $2 + i32.eqz + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + local.get $1 + i32.store8 + local.get $0 + local.get $2 + i32.add + i32.const 1 + i32.sub + local.get $1 + i32.store8 + local.get $2 + i32.const 2 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 1 + i32.add + local.get $1 + i32.store8 + local.get $0 + i32.const 2 + i32.add + local.get $1 + i32.store8 + local.get $0 + local.get $2 + i32.add + local.tee $3 + i32.const 2 + i32.sub + local.get $1 + i32.store8 + local.get $3 + i32.const 3 + i32.sub + local.get $1 + i32.store8 + local.get $2 + i32.const 6 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 3 + i32.add + local.get $1 + i32.store8 + local.get $0 + local.get $2 + i32.add + i32.const 4 + i32.sub + local.get $1 + i32.store8 + local.get $2 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $2 + i32.const 0 + local.get $0 + i32.sub + i32.const 3 + i32.and + local.tee $2 + i32.sub + local.set $3 + local.get $0 + local.get $2 + i32.add + local.tee $2 + local.get $1 + i32.const 255 + i32.and + i32.const 16843009 + i32.mul + local.tee $0 + i32.store + local.get $3 + i32.const -4 + i32.and + local.tee $3 + local.get $2 + i32.add + i32.const 4 + i32.sub + local.get $0 + i32.store + local.get $3 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $2 + i32.const 4 + i32.add + local.get $0 + i32.store + local.get $2 + i32.const 8 + i32.add + local.get $0 + i32.store + local.get $2 + local.get $3 + i32.add + local.tee $1 + i32.const 12 + i32.sub + local.get $0 + i32.store + local.get $1 + i32.const 8 + i32.sub + local.get $0 + i32.store + local.get $3 + i32.const 24 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $2 + i32.const 12 + i32.add + local.get $0 + i32.store + local.get $2 + i32.const 16 + i32.add + local.get $0 + i32.store + local.get $2 + i32.const 20 + i32.add + local.get $0 + i32.store + local.get $2 + i32.const 24 + i32.add + local.get $0 + i32.store + local.get $2 + local.get $3 + i32.add + local.tee $1 + i32.const 28 + i32.sub + local.get $0 + i32.store + local.get $1 + i32.const 24 + i32.sub + local.get $0 + i32.store + local.get $1 + i32.const 20 + i32.sub + local.get $0 + i32.store + local.get $1 + i32.const 16 + i32.sub + local.get $0 + i32.store + local.get $2 + local.get $2 + i32.const 4 + i32.and + i32.const 24 + i32.add + local.tee $2 + i32.add + local.set $1 + local.get $3 + local.get $2 + i32.sub + local.set $2 + local.get $0 + i64.extend_i32_u + local.get $0 + i64.extend_i32_u + i64.const 32 + i64.shl + i64.or + local.set $4 + loop $continue|0 local.get $2 - i32.ge_s - br_if $break|0 - local.get $4 - i32.const 3 - i32.shl - local.get $0 - i32.add - local.get $1 - i32.add - f64.load offset=8 - local.set $6 - local.get $4 - i32.const 1 - i32.sub - local.set $5 - loop $continue|1 - local.get $5 - i32.const 0 - i32.ge_s - if - block $break|1 - local.get $5 - i32.const 3 - i32.shl - local.get $0 - i32.add - local.get $1 - i32.add - f64.load offset=8 - local.set $7 - i32.const 2 - global.set $~lib/argc - local.get $6 - local.get $7 - local.get $3 - call_indirect (type $FUNCSIG$idd) - i32.const 0 - i32.ge_s - br_if $break|1 - local.get $5 - local.tee $8 - i32.const 1 - i32.sub - local.set $5 - local.get $8 - i32.const 1 - i32.add - i32.const 3 - i32.shl - local.get $0 - i32.add - local.get $1 - i32.add - local.get $7 - f64.store offset=8 - br $continue|1 - end - end + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $4 + i64.store + local.get $1 + i32.const 8 + i32.add + local.get $4 + i64.store + local.get $1 + i32.const 16 + i32.add + local.get $4 + i64.store + local.get $1 + i32.const 24 + i32.add + local.get $4 + i64.store + local.get $2 + i32.const 32 + i32.sub + local.set $2 + local.get $1 + i32.const 32 + i32.add + local.set $1 + br $continue|0 end - local.get $5 - i32.const 1 - i32.add - i32.const 3 - i32.shl - local.get $0 - i32.add - local.get $1 - i32.add - local.get $6 - f64.store offset=8 - local.get $4 - i32.const 1 - i32.add - local.set $4 - br $repeat|0 - unreachable end - unreachable end ) - (func $~lib/internal/sort/weakHeapSort (; 20 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $~lib/util/sort/weakHeapSort (; 49 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) (local $4 i32) - (local $5 i32) - (local $6 f64) + (local $5 f64) + (local $6 i32) (local $7 f64) (local $8 i32) - (local $9 i32) - local.get $2 + local.get $1 i32.const 31 i32.add i32.const 5 i32.shr_s i32.const 2 i32.shl - local.tee $4 - call $~lib/allocator/arena/__memory_allocate - local.tee $8 + local.tee $3 i32.const 0 - local.get $4 - call $~lib/internal/memory/memset - local.get $2 + call $~lib/rt/tlsf/__alloc + local.tee $6 + i32.const 0 + local.get $3 + call $~lib/memory/memory.fill + local.get $1 i32.const 1 i32.sub - local.set $5 + local.set $4 loop $repeat|0 - local.get $5 - i32.const 0 - i32.gt_s - if - local.get $5 - local.set $4 + block $break|0 + local.get $4 + i32.const 0 + i32.le_s + br_if $break|0 + local.get $4 + local.set $3 loop $continue|1 - local.get $4 + local.get $3 i32.const 1 i32.and - local.get $4 + local.get $3 i32.const 6 i32.shr_s i32.const 2 i32.shl - local.get $8 + local.get $6 i32.add i32.load - local.get $4 + local.get $3 i32.const 1 i32.shr_s i32.const 31 @@ -1477,273 +2828,242 @@ i32.and i32.eq if - local.get $4 + local.get $3 i32.const 1 i32.shr_s - local.set $4 + local.set $3 br $continue|1 end end - local.get $4 + local.get $3 i32.const 1 i32.shr_s - local.tee $4 + local.tee $3 i32.const 3 i32.shl local.get $0 i32.add - local.get $1 - i32.add - f64.load offset=8 - local.set $6 - local.get $5 + f64.load + local.set $5 + local.get $4 i32.const 3 i32.shl local.get $0 i32.add - local.get $1 - i32.add - f64.load offset=8 + f64.load local.set $7 i32.const 2 global.set $~lib/argc - local.get $6 + local.get $5 local.get $7 - local.get $3 + local.get $2 call_indirect (type $FUNCSIG$idd) i32.const 0 i32.lt_s if - local.get $5 + local.get $4 i32.const 5 i32.shr_s i32.const 2 i32.shl - local.get $8 + local.get $6 i32.add - local.tee $9 - local.get $9 + local.tee $8 + local.get $8 i32.load i32.const 1 - local.get $5 + local.get $4 i32.const 31 i32.and i32.shl i32.xor i32.store - local.get $5 + local.get $4 i32.const 3 i32.shl local.get $0 i32.add - local.get $1 - i32.add - local.get $6 - f64.store offset=8 - local.get $4 + local.get $5 + f64.store + local.get $3 i32.const 3 i32.shl local.get $0 i32.add - local.get $1 - i32.add local.get $7 - f64.store offset=8 + f64.store end - local.get $5 + local.get $4 i32.const 1 i32.sub - local.set $5 + local.set $4 br $repeat|0 end end - local.get $2 + local.get $1 i32.const 1 i32.sub - local.set $5 + local.set $4 loop $repeat|2 - local.get $5 - i32.const 2 - i32.ge_s - if + block $break|2 + local.get $4 + i32.const 2 + i32.lt_s + br_if $break|2 local.get $0 - local.get $1 - i32.add - local.tee $2 - f64.load offset=8 - local.set $6 - local.get $2 - local.get $5 + f64.load + local.set $5 + local.get $0 + local.get $4 i32.const 3 i32.shl local.get $0 i32.add + local.tee $1 + f64.load + f64.store local.get $1 - i32.add - local.tee $2 - f64.load offset=8 - f64.store offset=8 - local.get $2 - local.get $6 - f64.store offset=8 + local.get $5 + f64.store i32.const 1 - local.set $2 + local.set $3 loop $continue|3 - local.get $2 + local.get $3 i32.const 5 i32.shr_s i32.const 2 i32.shl - local.get $8 + local.get $6 i32.add i32.load - local.get $2 + local.get $3 i32.const 31 i32.and i32.shr_u i32.const 1 i32.and - local.get $2 + local.get $3 i32.const 1 i32.shl i32.add - local.tee $4 - local.get $5 + local.tee $1 + local.get $4 i32.lt_s if - local.get $4 - local.set $2 + local.get $1 + local.set $3 br $continue|3 end end loop $continue|4 - local.get $2 + local.get $3 i32.const 0 i32.gt_s if local.get $0 - local.get $1 - i32.add - f64.load offset=8 - local.set $6 - local.get $2 + f64.load + local.set $5 + local.get $3 i32.const 3 i32.shl local.get $0 i32.add - local.get $1 - i32.add - f64.load offset=8 + f64.load local.set $7 i32.const 2 global.set $~lib/argc - local.get $6 + local.get $5 local.get $7 - local.get $3 + local.get $2 call_indirect (type $FUNCSIG$idd) i32.const 0 i32.lt_s if - local.get $2 + local.get $3 i32.const 5 i32.shr_s i32.const 2 i32.shl - local.get $8 + local.get $6 i32.add - local.tee $4 - local.get $4 + local.tee $1 + local.get $1 i32.load i32.const 1 - local.get $2 + local.get $3 i32.const 31 i32.and i32.shl i32.xor i32.store - local.get $2 + local.get $3 i32.const 3 i32.shl local.get $0 i32.add - local.get $1 - i32.add - local.get $6 - f64.store offset=8 + local.get $5 + f64.store local.get $0 - local.get $1 - i32.add local.get $7 - f64.store offset=8 + f64.store end - local.get $2 + local.get $3 i32.const 1 i32.shr_s - local.set $2 + local.set $3 br $continue|4 end end - local.get $5 + local.get $4 i32.const 1 i32.sub - local.set $5 + local.set $4 br $repeat|2 end end + local.get $6 + call $~lib/rt/tlsf/__free local.get $0 - i32.const 8 - i32.add - local.get $1 - i32.add - local.tee $2 f64.load offset=8 - local.set $6 - local.get $2 + local.set $5 local.get $0 - local.get $1 - i32.add - local.tee $0 - f64.load offset=8 - f64.store offset=8 local.get $0 - local.get $6 + f64.load f64.store offset=8 + local.get $0 + local.get $5 + f64.store ) - (func $~lib/typedarray/Float64Array#sort (; 21 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/typedarray/Float64Array#sort (; 50 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 f64) (local $5 f64) - local.get $0 - i32.load offset=4 - local.set $2 - block $~lib/internal/typedarray/SORT<~lib/typedarray/Float64Array,f64>|inlined.0 + block $~lib/typedarray/SORT<~lib/typedarray/Float64Array,f64>|inlined.0 local.get $0 - i32.load offset=8 - i32.const 3 - i32.shr_u + call $~lib/rt/pure/__retain + local.tee $0 + call $~lib/typedarray/Int64Array#get:length local.tee $3 i32.const 1 i32.le_s - br_if $~lib/internal/typedarray/SORT<~lib/typedarray/Float64Array,f64>|inlined.0 + if + local.get $0 + call $~lib/rt/pure/__release + br $~lib/typedarray/SORT<~lib/typedarray/Float64Array,f64>|inlined.0 + end local.get $0 - i32.load - local.set $0 + i32.load offset=4 + local.set $2 local.get $3 i32.const 2 i32.eq if - local.get $0 - i32.const 8 - i32.add local.get $2 - i32.add f64.load offset=8 local.set $4 - local.get $0 local.get $2 - i32.add - f64.load offset=8 + f64.load local.set $5 i32.const 2 global.set $~lib/argc @@ -1754,40 +3074,35 @@ i32.const 0 i32.lt_s if - local.get $0 - i32.const 8 - i32.add local.get $2 - i32.add local.get $5 f64.store offset=8 - local.get $0 local.get $2 - i32.add local.get $4 - f64.store offset=8 + f64.store end - br $~lib/internal/typedarray/SORT<~lib/typedarray/Float64Array,f64>|inlined.0 + local.get $0 + call $~lib/rt/pure/__release + br $~lib/typedarray/SORT<~lib/typedarray/Float64Array,f64>|inlined.0 end local.get $3 i32.const 256 i32.lt_s if - local.get $0 local.get $2 local.get $3 local.get $1 - call $~lib/internal/sort/insertionSort + call $~lib/util/sort/insertionSort else - local.get $0 local.get $2 local.get $3 local.get $1 - call $~lib/internal/sort/weakHeapSort + call $~lib/util/sort/weakHeapSort end end + local.get $0 ) - (func $~lib/internal/sort/COMPARATOR~anonymous|0 (; 22 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) + (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 51 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) (local $2 i64) (local $3 i64) local.get $0 @@ -1816,7 +3131,7 @@ i64.lt_s i32.sub ) - (func $~lib/internal/typedarray/TypedArray#__get (; 23 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) + (func $~lib/typedarray/Float64Array#__get (; 52 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) local.get $1 local.get $0 i32.load offset=8 @@ -1824,50 +3139,38 @@ i32.shr_u i32.ge_u if - i32.const 0 - i32.const 48 - i32.const 39 + i32.const 336 + i32.const 432 + i32.const 847 i32.const 63 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 i32.load offset=4 - local.get $0 - i32.load local.get $1 i32.const 3 i32.shl i32.add - i32.add - f64.load offset=8 + f64.load ) - (func $~lib/internal/typedarray/TypedArray#__set (; 24 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/typedarray/Uint8ClampedArray#__set (; 53 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) local.get $1 local.get $0 i32.load offset=8 i32.ge_u if - i32.const 0 - i32.const 48 - i32.const 50 - i32.const 63 - call $~lib/env/abort + i32.const 336 + i32.const 432 + i32.const 197 + i32.const 44 + call $~lib/builtins/abort unreachable end local.get $0 i32.load offset=4 local.get $1 - local.get $0 - i32.load - i32.add i32.add - local.get $2 - i32.store8 offset=8 - ) - (func $~lib/typedarray/Uint8ClampedArray#__set (; 25 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - local.get $0 - local.get $1 i32.const 255 local.get $2 i32.sub @@ -1881,41 +3184,57 @@ i32.const -1 i32.xor i32.and - call $~lib/internal/typedarray/TypedArray#__set + i32.store8 ) - (func $~lib/internal/typedarray/TypedArray#__get (; 26 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint8ClampedArray#__get (; 54 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=8 i32.ge_u if - i32.const 0 - i32.const 48 - i32.const 39 - i32.const 63 - call $~lib/env/abort + i32.const 336 + i32.const 432 + i32.const 191 + i32.const 44 + call $~lib/builtins/abort unreachable end local.get $0 i32.load offset=4 local.get $1 - local.get $0 - i32.load i32.add + i32.load8_u + ) + (func $~lib/typedarray/Int8Array#__set (; 55 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $1 + local.get $0 + i32.load offset=8 + i32.ge_u + if + i32.const 336 + i32.const 432 + i32.const 33 + i32.const 44 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + local.get $1 i32.add - i32.load8_u offset=8 + local.get $2 + i32.store8 ) - (func $~lib/typedarray/Int8Array#fill (; 27 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $~lib/typedarray/Int8Array#fill (; 56 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) local.get $0 - i32.load - local.set $5 - local.get $0 + call $~lib/rt/pure/__retain + local.tee $5 i32.load offset=4 local.set $6 - local.get $0 + local.get $5 i32.load offset=8 local.set $4 local.get $2 @@ -1965,127 +3284,147 @@ i32.lt_s if local.get $2 - local.get $5 - i32.add local.get $6 i32.add - i32.const 8 - i32.add local.get $1 local.get $0 local.get $2 i32.sub - call $~lib/internal/memory/memset + call $~lib/memory/memory.fill + end + local.get $5 + ) + (func $~lib/rt/__allocArray (; 57 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + i32.const 16 + local.get $2 + call $~lib/rt/tlsf/__alloc + local.tee $2 + local.get $0 + local.get $1 + i32.shl + local.tee $1 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.tee $4 + call $~lib/rt/pure/__retain + i32.store + local.get $2 + local.get $4 + i32.store offset=4 + local.get $2 + local.get $1 + i32.store offset=8 + local.get $2 + local.get $0 + i32.store offset=12 + local.get $3 + if + local.get $4 + local.get $3 + local.get $1 + call $~lib/memory/memory.copy end + local.get $2 ) - (func $~lib/internal/typedarray/TypedArray#__get (; 28 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int8Array#__get (; 58 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=8 i32.ge_u if - i32.const 0 - i32.const 48 - i32.const 39 - i32.const 63 - call $~lib/env/abort + i32.const 336 + i32.const 432 + i32.const 27 + i32.const 44 + call $~lib/builtins/abort unreachable end local.get $0 i32.load offset=4 local.get $1 - local.get $0 - i32.load i32.add - i32.add - i32.load8_s offset=8 + i32.load8_s ) - (func $std/typedarray/isInt8ArrayEqual (; 29 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) + (func $~lib/array/Array#__get (; 59 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 local.get $0 i32.load offset=8 - local.get $1 - i32.load offset=4 - i32.ne + i32.ge_u if - i32.const 0 - return + i32.const 336 + i32.const 512 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort + unreachable end local.get $0 - i32.load offset=8 - local.set $3 - loop $repeat|0 - local.get $2 - local.get $3 - i32.lt_s - if - local.get $0 - local.get $2 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and + i32.load offset=4 + local.get $1 + i32.add + i32.load8_s + ) + (func $std/typedarray/isInt8ArrayEqual (; 60 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__retain + drop + block $folding-inner0 + local.get $0 + i32.load offset=8 + local.get $1 + i32.load offset=12 + i32.ne + br_if $folding-inner0 + local.get $0 + i32.load offset=8 + local.set $3 + loop $repeat|0 local.get $2 - local.get $1 - i32.load - local.tee $4 - i32.load - i32.lt_u - if (result i32) - local.get $2 - local.get $4 - i32.add - i32.load8_s offset=8 - else - unreachable - end - i32.const 255 - i32.and - i32.ne + local.get $3 + i32.lt_s if - i32.const 0 - return - else + local.get $0 + local.get $2 + call $~lib/typedarray/Int8Array#__get + local.get $1 + local.get $2 + call $~lib/array/Array#__get + i32.ne + br_if $folding-inner0 local.get $2 i32.const 1 i32.add local.set $2 br $repeat|0 end - unreachable - end - end - i32.const 1 - ) - (func $~lib/typedarray/Int8Array#fill|trampoline (; 30 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - block $2of2 - block $1of2 - block $0of2 - block $outOfRange - global.get $~lib/argc - i32.const 1 - i32.sub - br_table $0of2 $1of2 $2of2 $outOfRange - end - unreachable - end - i32.const 0 - local.set $2 end - i32.const 2147483647 - local.set $3 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + i32.const 1 + return end local.get $0 + call $~lib/rt/pure/__release local.get $1 - local.get $2 - local.get $3 - call $~lib/typedarray/Int8Array#fill + call $~lib/rt/pure/__release + i32.const 0 ) - (func $~lib/typedarray/Int8Array#subarray (; 31 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/typedarray/Int8Array#subarray (; 61 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) local.get $0 + call $~lib/rt/pure/__retain + local.tee $4 i32.load offset=8 local.set $3 local.get $1 @@ -2095,9 +3434,9 @@ local.get $1 local.get $3 i32.add - local.tee $1 + local.tee $0 i32.const 0 - local.get $1 + local.get $0 i32.const 0 i32.gt_s select @@ -2109,7 +3448,7 @@ i32.lt_s select end - local.set $1 + local.set $0 local.get $2 i32.const 0 i32.lt_s @@ -2117,10 +3456,10 @@ local.get $2 local.get $3 i32.add - local.tee $2 - local.get $1 - local.get $2 + local.tee $1 + i32.const 0 local.get $1 + i32.const 0 i32.gt_s select else @@ -2130,49 +3469,65 @@ local.get $3 i32.lt_s select - local.tee $2 - local.get $1 - local.get $2 - local.get $1 - i32.gt_s - select end + local.tee $1 + local.get $0 + local.get $1 + local.get $0 + i32.gt_s + select local.set $3 i32.const 12 - call $~lib/allocator/arena/__memory_allocate - local.tee $2 - local.get $0 + i32.const 3 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $1 + local.set $5 + local.get $1 i32.load - i32.store + local.tee $6 + local.get $4 + i32.load + local.tee $2 + i32.ne + if + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $6 + call $~lib/rt/pure/__release + end + local.get $5 local.get $2 + i32.store local.get $1 - local.get $0 + local.get $4 i32.load offset=4 + local.get $0 i32.add i32.store offset=4 - local.get $2 - local.get $3 local.get $1 + local.get $3 + local.get $0 i32.sub i32.store offset=8 - local.get $2 + local.get $4 + call $~lib/rt/pure/__release + local.get $1 ) - (func $~lib/typedarray/Int32Array#fill (; 32 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $~lib/typedarray/Int32Array#fill (; 62 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) local.get $1 - local.set $4 - local.get $0 - i32.load local.set $5 local.get $0 + call $~lib/rt/pure/__retain + local.tee $4 i32.load offset=4 local.set $6 - local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u + local.get $4 + call $~lib/typedarray/Int32Array#get:length local.set $1 local.get $2 i32.const 0 @@ -2221,17 +3576,16 @@ loop $repeat|0 local.get $0 local.get $1 - i32.lt_s + i32.ge_s + i32.eqz if local.get $0 i32.const 2 i32.shl - local.get $5 - i32.add local.get $6 i32.add - local.get $4 - i32.store offset=8 + local.get $5 + i32.store local.get $0 i32.const 1 i32.add @@ -2239,159 +3593,154 @@ br $repeat|0 end end + local.get $4 ) - (func $std/typedarray/isInt32ArrayEqual (; 33 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) + (func $~lib/array/Array#__get (; 63 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 - i32.load offset=4 local.get $0 i32.load offset=8 i32.const 2 i32.shr_u - i32.ne + i32.ge_u if - i32.const 0 - return + i32.const 336 + i32.const 512 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort + unreachable end local.get $0 - i32.load offset=8 + i32.load offset=4 + local.get $1 i32.const 2 - i32.shr_u - local.set $3 - loop $repeat|0 - local.get $2 - local.get $3 - i32.lt_s - if - local.get $0 - local.get $2 - call $~lib/internal/typedarray/TypedArray#__get + i32.shl + i32.add + i32.load + ) + (func $std/typedarray/isInt32ArrayEqual (; 64 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop + local.get $1 + call $~lib/rt/pure/__retain + drop + block $folding-inner0 + local.get $0 + call $~lib/typedarray/Int32Array#get:length + local.get $1 + i32.load offset=12 + i32.ne + br_if $folding-inner0 + local.get $0 + call $~lib/typedarray/Int32Array#get:length + local.set $3 + loop $repeat|0 local.get $2 - local.get $1 - i32.load - local.tee $4 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $2 - i32.const 2 - i32.shl - local.get $4 - i32.add - i32.load offset=8 - else - unreachable - end - i32.ne + local.get $3 + i32.lt_s if - i32.const 0 - return - else + local.get $0 + local.get $2 + call $~lib/typedarray/Int32Array#__get + local.get $1 + local.get $2 + call $~lib/array/Array#__get + i32.ne + br_if $folding-inner0 local.get $2 i32.const 1 i32.add local.set $2 br $repeat|0 end - unreachable - end - end - i32.const 1 - ) - (func $~lib/typedarray/Int32Array#fill|trampoline (; 34 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - block $2of2 - block $1of2 - block $0of2 - block $outOfRange - global.get $~lib/argc - i32.const 1 - i32.sub - br_table $0of2 $1of2 $2of2 $outOfRange - end - unreachable - end - i32.const 0 - local.set $2 end - i32.const 2147483647 - local.set $3 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + i32.const 1 + return end local.get $0 + call $~lib/rt/pure/__release local.get $1 - local.get $2 - local.get $3 - call $~lib/typedarray/Int32Array#fill + call $~lib/rt/pure/__release + i32.const 0 ) - (func $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 (; 35 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 (; 65 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $3 + call $~lib/rt/pure/__release local.get $0 local.get $1 i32.add ) - (func $~lib/typedarray/Int8Array#reduce (; 36 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Int8Array#reduce (; 66 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) local.get $0 - i32.load offset=8 + call $~lib/rt/pure/__retain + local.tee $1 + i32.load offset=4 local.set $3 - local.get $0 - i32.load + i32.const 0 + local.set $0 + local.get $1 + i32.load offset=8 local.set $4 - local.get $0 - i32.load offset=4 - local.set $5 loop $repeat|0 - local.get $1 - local.get $3 + local.get $0 + local.get $4 i32.lt_s if i32.const 4 global.set $~lib/argc local.get $2 - local.get $1 - local.get $4 - i32.add - local.get $5 + local.get $0 + local.get $3 i32.add - i32.load8_s offset=8 - local.get $1 + i32.load8_s local.get $0 - i32.const 2 - call_indirect (type $FUNCSIG$iiiii) - local.set $2 local.get $1 + call $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 + local.set $2 + local.get $0 i32.const 1 i32.add - local.set $1 + local.set $0 br $repeat|0 end end + local.get $1 + call $~lib/rt/pure/__release local.get $2 ) - (func $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8> (; 37 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8> (; 67 ;) (type $FUNCSIG$v) (local $0 i32) - i32.const 0 + (local $1 i32) i32.const 3 call $~lib/typedarray/Int8Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int8Array#__set local.get $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int8Array#__set local.get $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int8Array#__set local.get $0 call $~lib/typedarray/Int8Array#reduce i32.const 255 @@ -2400,73 +3749,99 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 252 + i32.const 24 + i32.const 263 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort + unreachable + end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + ) + (func $~lib/typedarray/Uint8Array#__set (; 68 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $1 + local.get $0 + i32.load offset=8 + i32.ge_u + if + i32.const 336 + i32.const 432 + i32.const 115 + i32.const 44 + call $~lib/builtins/abort unreachable end + local.get $0 + i32.load offset=4 + local.get $1 + i32.add + local.get $2 + i32.store8 ) - (func $~lib/typedarray/Uint8Array#reduce (; 38 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint8Array#reduce (; 69 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) local.get $0 - i32.load offset=8 + call $~lib/rt/pure/__retain + local.tee $2 + i32.load offset=4 local.set $4 - local.get $0 - i32.load + i32.const 0 + local.set $0 + local.get $2 + i32.load offset=8 local.set $5 - local.get $0 - i32.load offset=4 - local.set $6 loop $repeat|0 - local.get $2 - local.get $4 + local.get $0 + local.get $5 i32.lt_s if i32.const 4 global.set $~lib/argc local.get $3 - local.get $2 - local.get $5 - i32.add - local.get $6 + local.get $0 + local.get $4 i32.add - i32.load8_u offset=8 - local.get $2 + i32.load8_u local.get $0 + local.get $2 local.get $1 call_indirect (type $FUNCSIG$iiiii) local.set $3 - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $repeat|0 end end + local.get $2 + call $~lib/rt/pure/__release local.get $3 ) - (func $std/typedarray/testReduce<~lib/typedarray/Uint8Array,u8> (; 39 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduce<~lib/typedarray/Uint8Array,u8> (; 70 ;) (type $FUNCSIG$v) (local $0 i32) - i32.const 0 + (local $1 i32) i32.const 3 - call $~lib/typedarray/Int8Array#constructor + call $~lib/typedarray/Uint8Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint8Array#__set local.get $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint8Array#__set local.get $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint8Array#__set local.get $0 i32.const 3 call $~lib/typedarray/Uint8Array#reduce @@ -2476,17 +3851,24 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 252 + i32.const 24 + i32.const 263 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testReduce<~lib/typedarray/Uint8ClampedArray,u8> (; 40 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduce<~lib/typedarray/Uint8ClampedArray,u8> (; 71 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 call $~lib/typedarray/Uint8ClampedArray#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 1 @@ -2508,14 +3890,18 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 252 + i32.const 24 + i32.const 263 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/internal/typedarray/TypedArray#__set (; 41 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/typedarray/Int16Array#__set (; 72 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) local.get $1 local.get $0 i32.load offset=8 @@ -2523,88 +3909,85 @@ i32.shr_u i32.ge_u if - i32.const 0 - i32.const 48 - i32.const 50 + i32.const 336 + i32.const 432 + i32.const 279 i32.const 63 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 i32.load offset=4 - local.get $0 - i32.load local.get $1 i32.const 1 i32.shl i32.add - i32.add local.get $2 - i32.store16 offset=8 + i32.store16 ) - (func $~lib/typedarray/Int16Array#reduce (; 42 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Int16Array#reduce (; 73 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) local.get $0 - i32.load offset=8 - i32.const 1 - i32.shr_u + call $~lib/rt/pure/__retain + local.tee $2 + i32.load offset=4 local.set $3 - local.get $0 - i32.load + i32.const 0 + local.set $0 + local.get $2 + call $~lib/typedarray/Int16Array#get:length local.set $4 - local.get $0 - i32.load offset=4 - local.set $5 loop $repeat|0 - local.get $1 - local.get $3 + local.get $0 + local.get $4 i32.lt_s if i32.const 4 global.set $~lib/argc - local.get $2 local.get $1 + local.get $0 i32.const 1 i32.shl - local.get $4 - i32.add - local.get $5 + local.get $3 i32.add - i32.load16_s offset=8 - local.get $1 + i32.load16_s + local.get $0 + local.get $2 + call $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 + local.set $1 local.get $0 - i32.const 5 - call_indirect (type $FUNCSIG$iiiii) - local.set $2 - local.get $1 i32.const 1 i32.add - local.set $1 + local.set $0 br $repeat|0 end end local.get $2 + call $~lib/rt/pure/__release + local.get $1 ) - (func $std/typedarray/testReduce<~lib/typedarray/Int16Array,i16> (; 43 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduce<~lib/typedarray/Int16Array,i16> (; 74 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 call $~lib/typedarray/Int16Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int16Array#__set local.get $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int16Array#__set local.get $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int16Array#__set local.get $0 call $~lib/typedarray/Int16Array#reduce i32.const 65535 @@ -2612,77 +3995,105 @@ i32.const 6 i32.ne if - i32.const 0 - i32.const 8 - i32.const 252 - i32.const 2 - call $~lib/env/abort + i32.const 0 + i32.const 24 + i32.const 263 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + ) + (func $~lib/typedarray/Uint16Array#__set (; 75 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 1 + i32.shr_u + i32.ge_u + if + i32.const 336 + i32.const 432 + i32.const 361 + i32.const 63 + call $~lib/builtins/abort unreachable end + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 1 + i32.shl + i32.add + local.get $2 + i32.store16 ) - (func $~lib/typedarray/Uint16Array#reduce (; 44 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Uint16Array#reduce (; 76 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) local.get $0 - i32.load offset=8 - i32.const 1 - i32.shr_u + call $~lib/rt/pure/__retain + local.tee $2 + i32.load offset=4 local.set $3 - local.get $0 - i32.load + i32.const 0 + local.set $0 + local.get $2 + call $~lib/typedarray/Int16Array#get:length local.set $4 - local.get $0 - i32.load offset=4 - local.set $5 loop $repeat|0 - local.get $1 - local.get $3 + local.get $0 + local.get $4 i32.lt_s if i32.const 4 global.set $~lib/argc - local.get $2 local.get $1 + local.get $0 i32.const 1 i32.shl - local.get $4 - i32.add - local.get $5 + local.get $3 i32.add - i32.load16_u offset=8 - local.get $1 + i32.load16_u + local.get $0 + local.get $2 + call $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 + local.set $1 local.get $0 - i32.const 6 - call_indirect (type $FUNCSIG$iiiii) - local.set $2 - local.get $1 i32.const 1 i32.add - local.set $1 + local.set $0 br $repeat|0 end end local.get $2 + call $~lib/rt/pure/__release + local.get $1 ) - (func $std/typedarray/testReduce<~lib/typedarray/Uint16Array,u16> (; 45 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduce<~lib/typedarray/Uint16Array,u16> (; 77 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 - call $~lib/typedarray/Int16Array#constructor + call $~lib/typedarray/Uint16Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint16Array#__set local.get $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint16Array#__set local.get $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint16Array#__set local.get $0 call $~lib/typedarray/Uint16Array#reduce i32.const 65535 @@ -2691,76 +4102,81 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 252 + i32.const 24 + i32.const 263 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int32Array#reduce (; 46 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int32Array#reduce (; 78 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u + call $~lib/rt/pure/__retain + local.tee $3 + i32.load offset=4 local.set $4 - local.get $0 - i32.load + i32.const 0 + local.set $0 + local.get $3 + call $~lib/typedarray/Int32Array#get:length local.set $5 - local.get $0 - i32.load offset=4 - local.set $6 loop $repeat|0 - local.get $2 - local.get $4 + local.get $0 + local.get $5 i32.lt_s if i32.const 4 global.set $~lib/argc - local.get $3 local.get $2 + local.get $0 i32.const 2 i32.shl - local.get $5 - i32.add - local.get $6 + local.get $4 i32.add - i32.load offset=8 - local.get $2 + i32.load local.get $0 + local.get $3 local.get $1 call_indirect (type $FUNCSIG$iiiii) - local.set $3 - local.get $2 + local.set $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $repeat|0 end end local.get $3 + call $~lib/rt/pure/__release + local.get $2 ) - (func $std/typedarray/testReduce<~lib/typedarray/Int32Array,i32> (; 47 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduce<~lib/typedarray/Int32Array,i32> (; 79 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 call $~lib/typedarray/Int32Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int32Array#__set local.get $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int32Array#__set local.get $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int32Array#__set local.get $0 i32.const 7 call $~lib/typedarray/Int32Array#reduce @@ -2768,29 +4184,60 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 252 + i32.const 24 + i32.const 263 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort + unreachable + end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + ) + (func $~lib/typedarray/Uint32Array#__set (; 80 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ge_u + if + i32.const 336 + i32.const 432 + i32.const 525 + i32.const 63 + call $~lib/builtins/abort unreachable end + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + local.get $2 + i32.store ) - (func $std/typedarray/testReduce<~lib/typedarray/Uint32Array,u32> (; 48 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduce<~lib/typedarray/Uint32Array,u32> (; 81 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 - call $~lib/typedarray/Int32Array#constructor + call $~lib/typedarray/Uint32Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint32Array#__set local.get $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint32Array#__set local.get $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint32Array#__set local.get $0 i32.const 8 call $~lib/typedarray/Int32Array#reduce @@ -2798,14 +4245,18 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 252 + i32.const 24 + i32.const 263 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/internal/typedarray/TypedArray#__set (; 49 ;) (type $FUNCSIG$viij) (param $0 i32) (param $1 i32) (param $2 i64) + (func $~lib/typedarray/Int64Array#__set (; 82 ;) (type $FUNCSIG$viij) (param $0 i32) (param $1 i32) (param $2 i64) local.get $1 local.get $0 i32.load offset=8 @@ -2813,93 +4264,96 @@ i32.shr_u i32.ge_u if - i32.const 0 - i32.const 48 - i32.const 50 + i32.const 336 + i32.const 432 + i32.const 607 i32.const 63 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 i32.load offset=4 - local.get $0 - i32.load local.get $1 i32.const 3 i32.shl i32.add - i32.add local.get $2 - i64.store offset=8 + i64.store ) - (func $std/typedarray/testReduce<~lib/typedarray/Int64Array,i64>~anonymous|0 (; 50 ;) (type $FUNCSIG$jjjii) (param $0 i64) (param $1 i64) (param $2 i32) (param $3 i32) (result i64) + (func $std/typedarray/testReduce<~lib/typedarray/Int64Array,i64>~anonymous|0 (; 83 ;) (type $FUNCSIG$jjjii) (param $0 i64) (param $1 i64) (param $2 i32) (param $3 i32) (result i64) + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $3 + call $~lib/rt/pure/__release local.get $0 local.get $1 i64.add ) - (func $~lib/typedarray/Int64Array#reduce (; 51 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) - (local $2 i32) - (local $3 i64) + (func $~lib/typedarray/Int64Array#reduce (; 84 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) + (local $2 i64) + (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) local.get $0 - i32.load offset=8 - i32.const 3 - i32.shr_u + call $~lib/rt/pure/__retain + local.tee $3 + i32.load offset=4 local.set $4 - local.get $0 - i32.load + i32.const 0 + local.set $0 + local.get $3 + call $~lib/typedarray/Int64Array#get:length local.set $5 - local.get $0 - i32.load offset=4 - local.set $6 loop $repeat|0 - local.get $2 - local.get $4 + local.get $0 + local.get $5 i32.lt_s if i32.const 4 global.set $~lib/argc - local.get $3 local.get $2 + local.get $0 i32.const 3 i32.shl - local.get $5 - i32.add - local.get $6 + local.get $4 i32.add - i64.load offset=8 - local.get $2 + i64.load local.get $0 + local.get $3 local.get $1 call_indirect (type $FUNCSIG$jjjii) - local.set $3 - local.get $2 + local.set $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $repeat|0 end end local.get $3 + call $~lib/rt/pure/__release + local.get $2 ) - (func $std/typedarray/testReduce<~lib/typedarray/Int64Array,i64> (; 52 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduce<~lib/typedarray/Int64Array,i64> (; 85 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 call $~lib/typedarray/Int64Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i64.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int64Array#__set local.get $0 i32.const 1 i64.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int64Array#__set local.get $0 i32.const 2 i64.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int64Array#__set local.get $0 i32.const 9 call $~lib/typedarray/Int64Array#reduce @@ -2907,29 +4361,60 @@ i64.ne if i32.const 0 - i32.const 8 - i32.const 252 + i32.const 24 + i32.const 263 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort + unreachable + end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + ) + (func $~lib/typedarray/Uint64Array#__set (; 86 ;) (type $FUNCSIG$viij) (param $0 i32) (param $1 i32) (param $2 i64) + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 3 + i32.shr_u + i32.ge_u + if + i32.const 336 + i32.const 432 + i32.const 689 + i32.const 63 + call $~lib/builtins/abort unreachable end + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 3 + i32.shl + i32.add + local.get $2 + i64.store ) - (func $std/typedarray/testReduce<~lib/typedarray/Uint64Array,u64> (; 53 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduce<~lib/typedarray/Uint64Array,u64> (; 87 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 - call $~lib/typedarray/Int64Array#constructor + call $~lib/typedarray/Uint64Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i64.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint64Array#__set local.get $0 i32.const 1 i64.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint64Array#__set local.get $0 i32.const 2 i64.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint64Array#__set local.get $0 i32.const 10 call $~lib/typedarray/Int64Array#reduce @@ -2937,14 +4422,18 @@ i64.ne if i32.const 0 - i32.const 8 - i32.const 252 + i32.const 24 + i32.const 263 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/internal/typedarray/TypedArray#__set (; 54 ;) (type $FUNCSIG$viif) (param $0 i32) (param $1 i32) (param $2 f32) + (func $~lib/typedarray/Float32Array#__set (; 88 ;) (type $FUNCSIG$viif) (param $0 i32) (param $1 i32) (param $2 f32) local.get $1 local.get $0 i32.load offset=8 @@ -2952,248 +4441,262 @@ i32.shr_u i32.ge_u if - i32.const 0 - i32.const 48 - i32.const 50 + i32.const 336 + i32.const 432 + i32.const 771 i32.const 63 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 i32.load offset=4 - local.get $0 - i32.load local.get $1 i32.const 2 i32.shl i32.add - i32.add local.get $2 - f32.store offset=8 + f32.store ) - (func $std/typedarray/testReduce<~lib/typedarray/Float32Array,f32>~anonymous|0 (; 55 ;) (type $FUNCSIG$fffii) (param $0 f32) (param $1 f32) (param $2 i32) (param $3 i32) (result f32) + (func $std/typedarray/testReduce<~lib/typedarray/Float32Array,f32>~anonymous|0 (; 89 ;) (type $FUNCSIG$fffii) (param $0 f32) (param $1 f32) (param $2 i32) (param $3 i32) (result f32) + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $3 + call $~lib/rt/pure/__release local.get $0 local.get $1 f32.add ) - (func $~lib/typedarray/Float32Array#reduce (; 56 ;) (type $FUNCSIG$fi) (param $0 i32) (result f32) - (local $1 i32) - (local $2 f32) + (func $~lib/typedarray/Float32Array#reduce (; 90 ;) (type $FUNCSIG$fi) (param $0 i32) (result f32) + (local $1 f32) + (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u + call $~lib/rt/pure/__retain + local.tee $2 + i32.load offset=4 local.set $3 - local.get $0 - i32.load + i32.const 0 + local.set $0 + local.get $2 + call $~lib/typedarray/Int32Array#get:length local.set $4 - local.get $0 - i32.load offset=4 - local.set $5 loop $repeat|0 - local.get $1 - local.get $3 + local.get $0 + local.get $4 i32.lt_s if i32.const 4 global.set $~lib/argc - local.get $2 local.get $1 + local.get $0 i32.const 2 i32.shl - local.get $4 - i32.add - local.get $5 + local.get $3 i32.add - f32.load offset=8 - local.get $1 + f32.load + local.get $0 + local.get $2 + call $std/typedarray/testReduce<~lib/typedarray/Float32Array,f32>~anonymous|0 + local.set $1 local.get $0 - i32.const 11 - call_indirect (type $FUNCSIG$fffii) - local.set $2 - local.get $1 i32.const 1 i32.add - local.set $1 + local.set $0 br $repeat|0 end end local.get $2 + call $~lib/rt/pure/__release + local.get $1 ) - (func $std/typedarray/testReduce<~lib/typedarray/Float32Array,f32> (; 57 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduce<~lib/typedarray/Float32Array,f32> (; 91 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 - call $~lib/typedarray/Int32Array#constructor + call $~lib/typedarray/Float32Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 f32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Float32Array#__set local.get $0 i32.const 1 f32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Float32Array#__set local.get $0 i32.const 2 f32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Float32Array#__set local.get $0 call $~lib/typedarray/Float32Array#reduce f32.const 6 f32.ne if i32.const 0 - i32.const 8 - i32.const 252 + i32.const 24 + i32.const 263 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testReduce<~lib/typedarray/Float64Array,f64>~anonymous|0 (; 58 ;) (type $FUNCSIG$dddii) (param $0 f64) (param $1 f64) (param $2 i32) (param $3 i32) (result f64) + (func $std/typedarray/testReduce<~lib/typedarray/Float64Array,f64>~anonymous|0 (; 92 ;) (type $FUNCSIG$dddii) (param $0 f64) (param $1 f64) (param $2 i32) (param $3 i32) (result f64) + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $3 + call $~lib/rt/pure/__release local.get $0 local.get $1 f64.add ) - (func $~lib/typedarray/Float64Array#reduce (; 59 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) - (local $1 i32) - (local $2 f64) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load offset=8 - i32.const 3 - i32.shr_u - local.set $3 - local.get $0 - i32.load - local.set $4 + (func $~lib/typedarray/Float64Array#reduce (; 93 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) + (local $1 f64) + (local $2 i32) + (local $3 i32) + (local $4 i32) local.get $0 + call $~lib/rt/pure/__retain + local.tee $2 i32.load offset=4 - local.set $5 + local.set $3 + i32.const 0 + local.set $0 + local.get $2 + call $~lib/typedarray/Int64Array#get:length + local.set $4 loop $repeat|0 - local.get $1 - local.get $3 + local.get $0 + local.get $4 i32.lt_s if i32.const 4 global.set $~lib/argc - local.get $2 local.get $1 + local.get $0 i32.const 3 i32.shl - local.get $4 - i32.add - local.get $5 + local.get $3 i32.add - f64.load offset=8 - local.get $1 + f64.load + local.get $0 + local.get $2 + call $std/typedarray/testReduce<~lib/typedarray/Float64Array,f64>~anonymous|0 + local.set $1 local.get $0 - i32.const 12 - call_indirect (type $FUNCSIG$dddii) - local.set $2 - local.get $1 i32.const 1 i32.add - local.set $1 + local.set $0 br $repeat|0 end end local.get $2 + call $~lib/rt/pure/__release + local.get $1 ) - (func $std/typedarray/testReduce<~lib/typedarray/Float64Array,f64> (; 60 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduce<~lib/typedarray/Float64Array,f64> (; 94 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 - call $~lib/typedarray/Int64Array#constructor + call $~lib/typedarray/Float64Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 f64.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Float64Array#__set local.get $0 i32.const 1 f64.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Float64Array#__set local.get $0 i32.const 2 f64.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Float64Array#__set local.get $0 call $~lib/typedarray/Float64Array#reduce f64.const 6 f64.ne if i32.const 0 - i32.const 8 - i32.const 252 + i32.const 24 + i32.const 263 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int8Array#reduceRight (; 61 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Int8Array#reduceRight (; 95 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) - (local $4 i32) - local.get $0 - i32.load - local.set $3 local.get $0 + call $~lib/rt/pure/__retain + local.tee $1 i32.load offset=4 - local.set $4 - local.get $0 + local.set $3 + local.get $1 i32.load offset=8 i32.const 1 i32.sub - local.set $1 + local.set $0 loop $repeat|0 - local.get $1 + local.get $0 i32.const 0 i32.ge_s if i32.const 4 global.set $~lib/argc local.get $2 - local.get $1 + local.get $0 local.get $3 i32.add - local.get $4 - i32.add - i32.load8_s offset=8 - local.get $1 + i32.load8_s local.get $0 - i32.const 13 - call_indirect (type $FUNCSIG$iiiii) - local.set $2 local.get $1 + call $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 + local.set $2 + local.get $0 i32.const 1 i32.sub - local.set $1 + local.set $0 br $repeat|0 end end + local.get $1 + call $~lib/rt/pure/__release local.get $2 ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Int8Array,i8> (; 62 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduceRight<~lib/typedarray/Int8Array,i8> (; 96 ;) (type $FUNCSIG$v) (local $0 i32) - i32.const 0 + (local $1 i32) i32.const 3 call $~lib/typedarray/Int8Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int8Array#__set local.get $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int8Array#__set local.get $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int8Array#__set local.get $0 call $~lib/typedarray/Int8Array#reduceRight i32.const 255 @@ -3202,74 +4705,78 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 279 + i32.const 24 + i32.const 290 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint8Array#reduceRight (; 63 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint8Array#reduceRight (; 97 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - local.get $0 - i32.load - local.set $4 local.get $0 + call $~lib/rt/pure/__retain + local.tee $2 i32.load offset=4 - local.set $5 - local.get $0 + local.set $4 + local.get $2 i32.load offset=8 i32.const 1 i32.sub - local.set $2 + local.set $0 loop $repeat|0 - local.get $2 + local.get $0 i32.const 0 i32.ge_s if i32.const 4 global.set $~lib/argc local.get $3 - local.get $2 + local.get $0 local.get $4 i32.add - local.get $5 - i32.add - i32.load8_u offset=8 - local.get $2 + i32.load8_u local.get $0 + local.get $2 local.get $1 call_indirect (type $FUNCSIG$iiiii) local.set $3 - local.get $2 + local.get $0 i32.const 1 i32.sub - local.set $2 + local.set $0 br $repeat|0 end end + local.get $2 + call $~lib/rt/pure/__release local.get $3 ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Uint8Array,u8> (; 64 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduceRight<~lib/typedarray/Uint8Array,u8> (; 98 ;) (type $FUNCSIG$v) (local $0 i32) - i32.const 0 + (local $1 i32) i32.const 3 - call $~lib/typedarray/Int8Array#constructor + call $~lib/typedarray/Uint8Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint8Array#__set local.get $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint8Array#__set local.get $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint8Array#__set local.get $0 i32.const 14 call $~lib/typedarray/Uint8Array#reduceRight @@ -3279,17 +4786,24 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 279 + i32.const 24 + i32.const 290 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Uint8ClampedArray,u8> (; 65 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduceRight<~lib/typedarray/Uint8ClampedArray,u8> (; 99 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 call $~lib/typedarray/Uint8ClampedArray#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 1 @@ -3311,77 +4825,79 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 279 + i32.const 24 + i32.const 290 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int16Array#reduceRight (; 66 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Int16Array#reduceRight (; 100 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) - (local $4 i32) - local.get $0 - i32.load - local.set $3 local.get $0 + call $~lib/rt/pure/__retain + local.tee $2 i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - i32.const 1 - i32.shr_u + local.set $3 + local.get $2 + call $~lib/typedarray/Int16Array#get:length i32.const 1 i32.sub - local.set $1 + local.set $0 loop $repeat|0 - local.get $1 + local.get $0 i32.const 0 i32.ge_s if i32.const 4 global.set $~lib/argc - local.get $2 local.get $1 + local.get $0 i32.const 1 i32.shl local.get $3 i32.add - local.get $4 - i32.add - i32.load16_s offset=8 - local.get $1 + i32.load16_s + local.get $0 + local.get $2 + call $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 + local.set $1 local.get $0 - i32.const 16 - call_indirect (type $FUNCSIG$iiiii) - local.set $2 - local.get $1 i32.const 1 i32.sub - local.set $1 + local.set $0 br $repeat|0 end end local.get $2 + call $~lib/rt/pure/__release + local.get $1 ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Int16Array,i16> (; 67 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduceRight<~lib/typedarray/Int16Array,i16> (; 101 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 call $~lib/typedarray/Int16Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int16Array#__set local.get $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int16Array#__set local.get $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int16Array#__set local.get $0 call $~lib/typedarray/Int16Array#reduceRight i32.const 65535 @@ -3390,77 +4906,79 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 279 + i32.const 24 + i32.const 290 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint16Array#reduceRight (; 68 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Uint16Array#reduceRight (; 102 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) - (local $4 i32) - local.get $0 - i32.load - local.set $3 local.get $0 + call $~lib/rt/pure/__retain + local.tee $2 i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - i32.const 1 - i32.shr_u + local.set $3 + local.get $2 + call $~lib/typedarray/Int16Array#get:length i32.const 1 i32.sub - local.set $1 + local.set $0 loop $repeat|0 - local.get $1 + local.get $0 i32.const 0 i32.ge_s if i32.const 4 global.set $~lib/argc - local.get $2 local.get $1 + local.get $0 i32.const 1 i32.shl local.get $3 i32.add - local.get $4 - i32.add - i32.load16_u offset=8 - local.get $1 + i32.load16_u + local.get $0 + local.get $2 + call $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 + local.set $1 local.get $0 - i32.const 17 - call_indirect (type $FUNCSIG$iiiii) - local.set $2 - local.get $1 i32.const 1 i32.sub - local.set $1 + local.set $0 br $repeat|0 end end local.get $2 + call $~lib/rt/pure/__release + local.get $1 ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Uint16Array,u16> (; 69 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduceRight<~lib/typedarray/Uint16Array,u16> (; 103 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 - call $~lib/typedarray/Int16Array#constructor + call $~lib/typedarray/Uint16Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint16Array#__set local.get $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint16Array#__set local.get $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint16Array#__set local.get $0 call $~lib/typedarray/Uint16Array#reduceRight i32.const 65535 @@ -3469,77 +4987,80 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 279 + i32.const 24 + i32.const 290 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int32Array#reduceRight (; 70 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int32Array#reduceRight (; 104 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - local.get $0 - i32.load - local.set $4 local.get $0 + call $~lib/rt/pure/__retain + local.tee $3 i32.load offset=4 - local.set $5 - local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u + local.set $4 + local.get $3 + call $~lib/typedarray/Int32Array#get:length i32.const 1 i32.sub - local.set $2 + local.set $0 loop $repeat|0 - local.get $2 + local.get $0 i32.const 0 i32.ge_s if i32.const 4 global.set $~lib/argc - local.get $3 local.get $2 + local.get $0 i32.const 2 i32.shl local.get $4 i32.add - local.get $5 - i32.add - i32.load offset=8 - local.get $2 + i32.load local.get $0 + local.get $3 local.get $1 call_indirect (type $FUNCSIG$iiiii) - local.set $3 - local.get $2 + local.set $2 + local.get $0 i32.const 1 i32.sub - local.set $2 + local.set $0 br $repeat|0 end end local.get $3 + call $~lib/rt/pure/__release + local.get $2 ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Int32Array,i32> (; 71 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduceRight<~lib/typedarray/Int32Array,i32> (; 105 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 call $~lib/typedarray/Int32Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int32Array#__set local.get $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int32Array#__set local.get $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int32Array#__set local.get $0 i32.const 18 call $~lib/typedarray/Int32Array#reduceRight @@ -3547,29 +5068,36 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 279 + i32.const 24 + i32.const 290 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Uint32Array,u32> (; 72 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduceRight<~lib/typedarray/Uint32Array,u32> (; 106 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 - call $~lib/typedarray/Int32Array#constructor + call $~lib/typedarray/Uint32Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint32Array#__set local.get $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint32Array#__set local.get $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint32Array#__set local.get $0 i32.const 19 call $~lib/typedarray/Int32Array#reduceRight @@ -3577,77 +5105,80 @@ i32.ne if i32.const 0 - i32.const 8 - i32.const 279 + i32.const 24 + i32.const 290 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int64Array#reduceRight (; 73 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) - (local $2 i32) - (local $3 i64) + (func $~lib/typedarray/Int64Array#reduceRight (; 107 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) + (local $2 i64) + (local $3 i32) (local $4 i32) - (local $5 i32) - local.get $0 - i32.load - local.set $4 local.get $0 + call $~lib/rt/pure/__retain + local.tee $3 i32.load offset=4 - local.set $5 - local.get $0 - i32.load offset=8 - i32.const 3 - i32.shr_u + local.set $4 + local.get $3 + call $~lib/typedarray/Int64Array#get:length i32.const 1 i32.sub - local.set $2 + local.set $0 loop $repeat|0 - local.get $2 + local.get $0 i32.const 0 i32.ge_s if i32.const 4 global.set $~lib/argc - local.get $3 local.get $2 + local.get $0 i32.const 3 i32.shl local.get $4 i32.add - local.get $5 - i32.add - i64.load offset=8 - local.get $2 + i64.load local.get $0 + local.get $3 local.get $1 call_indirect (type $FUNCSIG$jjjii) - local.set $3 - local.get $2 + local.set $2 + local.get $0 i32.const 1 i32.sub - local.set $2 + local.set $0 br $repeat|0 end end local.get $3 + call $~lib/rt/pure/__release + local.get $2 ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Int64Array,i64> (; 74 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduceRight<~lib/typedarray/Int64Array,i64> (; 108 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 call $~lib/typedarray/Int64Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i64.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int64Array#__set local.get $0 i32.const 1 i64.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int64Array#__set local.get $0 i32.const 2 i64.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int64Array#__set local.get $0 i32.const 20 call $~lib/typedarray/Int64Array#reduceRight @@ -3655,29 +5186,36 @@ i64.ne if i32.const 0 - i32.const 8 - i32.const 279 + i32.const 24 + i32.const 290 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Uint64Array,u64> (; 75 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduceRight<~lib/typedarray/Uint64Array,u64> (; 109 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 - call $~lib/typedarray/Int64Array#constructor + call $~lib/typedarray/Uint64Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i64.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint64Array#__set local.get $0 i32.const 1 i64.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint64Array#__set local.get $0 i32.const 2 i64.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint64Array#__set local.get $0 i32.const 21 call $~lib/typedarray/Int64Array#reduceRight @@ -3685,173 +5223,186 @@ i64.ne if i32.const 0 - i32.const 8 - i32.const 279 + i32.const 24 + i32.const 290 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Float32Array#reduceRight (; 76 ;) (type $FUNCSIG$fi) (param $0 i32) (result f32) - (local $1 i32) - (local $2 f32) + (func $~lib/typedarray/Float32Array#reduceRight (; 110 ;) (type $FUNCSIG$fi) (param $0 i32) (result f32) + (local $1 f32) + (local $2 i32) (local $3 i32) - (local $4 i32) - local.get $0 - i32.load - local.set $3 local.get $0 + call $~lib/rt/pure/__retain + local.tee $2 i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u + local.set $3 + local.get $2 + call $~lib/typedarray/Int32Array#get:length i32.const 1 i32.sub - local.set $1 + local.set $0 loop $repeat|0 - local.get $1 + local.get $0 i32.const 0 i32.ge_s if i32.const 4 global.set $~lib/argc - local.get $2 local.get $1 + local.get $0 i32.const 2 i32.shl local.get $3 i32.add - local.get $4 - i32.add - f32.load offset=8 - local.get $1 + f32.load + local.get $0 + local.get $2 + call $std/typedarray/testReduce<~lib/typedarray/Float32Array,f32>~anonymous|0 + local.set $1 local.get $0 - i32.const 22 - call_indirect (type $FUNCSIG$fffii) - local.set $2 - local.get $1 i32.const 1 i32.sub - local.set $1 + local.set $0 br $repeat|0 end end local.get $2 + call $~lib/rt/pure/__release + local.get $1 ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Float32Array,f32> (; 77 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduceRight<~lib/typedarray/Float32Array,f32> (; 111 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 - call $~lib/typedarray/Int32Array#constructor + call $~lib/typedarray/Float32Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 f32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Float32Array#__set local.get $0 i32.const 1 f32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Float32Array#__set local.get $0 i32.const 2 f32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Float32Array#__set local.get $0 call $~lib/typedarray/Float32Array#reduceRight f32.const 6 f32.ne if i32.const 0 - i32.const 8 - i32.const 279 + i32.const 24 + i32.const 290 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Float64Array#reduceRight (; 78 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) - (local $1 i32) - (local $2 f64) + (func $~lib/typedarray/Float64Array#reduceRight (; 112 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) + (local $1 f64) + (local $2 i32) (local $3 i32) - (local $4 i32) - local.get $0 - i32.load - local.set $3 local.get $0 + call $~lib/rt/pure/__retain + local.tee $2 i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - i32.const 3 - i32.shr_u + local.set $3 + local.get $2 + call $~lib/typedarray/Int64Array#get:length i32.const 1 i32.sub - local.set $1 + local.set $0 loop $repeat|0 - local.get $1 + local.get $0 i32.const 0 i32.ge_s if i32.const 4 global.set $~lib/argc - local.get $2 local.get $1 + local.get $0 i32.const 3 i32.shl local.get $3 i32.add - local.get $4 - i32.add - f64.load offset=8 - local.get $1 + f64.load + local.get $0 + local.get $2 + call $std/typedarray/testReduce<~lib/typedarray/Float64Array,f64>~anonymous|0 + local.set $1 local.get $0 - i32.const 23 - call_indirect (type $FUNCSIG$dddii) - local.set $2 - local.get $1 i32.const 1 i32.sub - local.set $1 + local.set $0 br $repeat|0 end end local.get $2 + call $~lib/rt/pure/__release + local.get $1 ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Float64Array,f64> (; 79 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduceRight<~lib/typedarray/Float64Array,f64> (; 113 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 - call $~lib/typedarray/Int64Array#constructor + call $~lib/typedarray/Float64Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 f64.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Float64Array#__set local.get $0 i32.const 1 f64.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Float64Array#__set local.get $0 i32.const 2 f64.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Float64Array#__set local.get $0 call $~lib/typedarray/Float64Array#reduceRight f64.const 6 f64.ne if i32.const 0 - i32.const 8 - i32.const 279 + i32.const 24 + i32.const 290 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 (; 80 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 (; 114 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 local.get $0 i32.mul ) - (func $~lib/typedarray/Int8Array#map (; 81 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Int8Array#map (; 115 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -3859,115 +5410,122 @@ (local $5 i32) (local $6 i32) local.get $0 - i32.load + call $~lib/rt/pure/__retain + local.tee $1 + i32.load offset=8 local.set $2 - local.get $0 + local.get $1 i32.load offset=4 local.set $3 - i32.const 0 - local.get $0 - i32.load offset=8 - local.tee $4 + local.get $2 call $~lib/typedarray/Int8Array#constructor + local.tee $4 + call $~lib/rt/pure/__retain local.tee $5 - i32.load + i32.load offset=4 local.set $6 + i32.const 0 + local.set $0 loop $repeat|0 - local.get $1 - local.get $4 + local.get $0 + local.get $2 i32.lt_s if i32.const 3 global.set $~lib/argc - local.get $1 + local.get $0 local.get $6 i32.add - local.get $1 - local.get $2 - i32.add + local.get $0 local.get $3 i32.add - i32.load8_s offset=8 - local.get $1 + i32.load8_s local.get $0 - i32.const 24 - call_indirect (type $FUNCSIG$iiii) - i32.store8 offset=8 local.get $1 + call $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 + i32.store8 + local.get $0 i32.const 1 i32.add - local.set $1 + local.set $0 br $repeat|0 end end + local.get $1 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release local.get $5 ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8> (; 82 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8> (; 116 ;) (type $FUNCSIG$v) (local $0 i32) - i32.const 0 + (local $1 i32) + (local $2 i32) i32.const 3 call $~lib/typedarray/Int8Array#constructor + local.tee $2 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int8Array#__set local.get $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int8Array#__set local.get $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int8Array#__set local.get $0 call $~lib/typedarray/Int8Array#map - local.tee $0 + local.tee $1 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and + call $~lib/typedarray/Int8Array#__get i32.const 1 i32.ne if i32.const 0 - i32.const 8 - i32.const 306 + i32.const 24 + i32.const 317 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 + local.get $1 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and + call $~lib/typedarray/Int8Array#__get i32.const 4 i32.ne if i32.const 0 - i32.const 8 - i32.const 307 + i32.const 24 + i32.const 318 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 + local.get $1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and + call $~lib/typedarray/Int8Array#__get i32.const 9 i32.ne if i32.const 0 - i32.const 8 - i32.const 308 + i32.const 24 + i32.const 319 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint8Array#map (; 83 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Uint8Array#map (; 117 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -3975,115 +5533,141 @@ (local $5 i32) (local $6 i32) local.get $0 - i32.load + call $~lib/rt/pure/__retain + local.tee $1 + i32.load offset=8 local.set $2 - local.get $0 + local.get $1 i32.load offset=4 local.set $3 - i32.const 0 - local.get $0 - i32.load offset=8 + local.get $2 + call $~lib/typedarray/Uint8Array#constructor local.tee $4 - call $~lib/typedarray/Int8Array#constructor + call $~lib/rt/pure/__retain local.tee $5 - i32.load + i32.load offset=4 local.set $6 + i32.const 0 + local.set $0 loop $repeat|0 - local.get $1 - local.get $4 + local.get $0 + local.get $2 i32.lt_s if i32.const 3 global.set $~lib/argc - local.get $1 + local.get $0 local.get $6 i32.add - local.get $1 - local.get $2 - i32.add + local.get $0 local.get $3 i32.add - i32.load8_u offset=8 - local.get $1 + i32.load8_u local.get $0 - i32.const 25 - call_indirect (type $FUNCSIG$iiii) - i32.store8 offset=8 local.get $1 + call $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 + i32.store8 + local.get $0 i32.const 1 i32.add - local.set $1 + local.set $0 br $repeat|0 end end + local.get $1 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release local.get $5 ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Uint8Array,u8> (; 84 ;) (type $FUNCSIG$v) + (func $~lib/typedarray/Uint8Array#__get (; 118 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 + local.get $0 + i32.load offset=8 + i32.ge_u + if + i32.const 336 + i32.const 432 + i32.const 109 + i32.const 44 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + local.get $1 + i32.add + i32.load8_u + ) + (func $std/typedarray/testArrayMap<~lib/typedarray/Uint8Array,u8> (; 119 ;) (type $FUNCSIG$v) (local $0 i32) - i32.const 0 + (local $1 i32) + (local $2 i32) i32.const 3 - call $~lib/typedarray/Int8Array#constructor + call $~lib/typedarray/Uint8Array#constructor + local.tee $2 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint8Array#__set local.get $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint8Array#__set local.get $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint8Array#__set local.get $0 call $~lib/typedarray/Uint8Array#map - local.tee $0 + local.tee $1 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and + call $~lib/typedarray/Uint8Array#__get i32.const 1 i32.ne if i32.const 0 - i32.const 8 - i32.const 306 + i32.const 24 + i32.const 317 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 + local.get $1 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and + call $~lib/typedarray/Uint8Array#__get i32.const 4 i32.ne if i32.const 0 - i32.const 8 - i32.const 307 + i32.const 24 + i32.const 318 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 + local.get $1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and + call $~lib/typedarray/Uint8Array#__get i32.const 9 i32.ne if i32.const 0 - i32.const 8 - i32.const 308 + i32.const 24 + i32.const 319 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint8ClampedArray#map (; 85 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Uint8ClampedArray#map (; 120 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -4091,52 +5675,61 @@ (local $5 i32) (local $6 i32) local.get $0 - i32.load + call $~lib/rt/pure/__retain + local.tee $1 + i32.load offset=8 local.set $2 - local.get $0 + local.get $1 i32.load offset=4 local.set $3 - local.get $0 - i32.load offset=8 - local.tee $4 + local.get $2 call $~lib/typedarray/Uint8ClampedArray#constructor + local.tee $4 + call $~lib/rt/pure/__retain local.tee $5 - i32.load + i32.load offset=4 local.set $6 + i32.const 0 + local.set $0 loop $repeat|0 - local.get $1 - local.get $4 + local.get $0 + local.get $2 i32.lt_s if i32.const 3 global.set $~lib/argc - local.get $1 + local.get $0 local.get $6 i32.add - local.get $1 - local.get $2 - i32.add + local.get $0 local.get $3 i32.add - i32.load8_u offset=8 - local.get $1 + i32.load8_u local.get $0 - i32.const 26 - call_indirect (type $FUNCSIG$iiii) - i32.store8 offset=8 local.get $1 + call $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 + i32.store8 + local.get $0 i32.const 1 i32.add - local.set $1 + local.set $0 br $repeat|0 end end + local.get $1 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release local.get $5 ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Uint8ClampedArray,u8> (; 86 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayMap<~lib/typedarray/Uint8ClampedArray,u8> (; 121 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) + (local $2 i32) i32.const 3 call $~lib/typedarray/Uint8ClampedArray#constructor + local.tee $2 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 1 @@ -4151,53 +5744,53 @@ call $~lib/typedarray/Uint8ClampedArray#__set local.get $0 call $~lib/typedarray/Uint8ClampedArray#map - local.tee $0 + local.tee $1 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and + call $~lib/typedarray/Uint8ClampedArray#__get i32.const 1 i32.ne if i32.const 0 - i32.const 8 - i32.const 306 + i32.const 24 + i32.const 317 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and + local.get $1 + i32.const 1 + call $~lib/typedarray/Uint8ClampedArray#__get i32.const 4 i32.ne if i32.const 0 - i32.const 8 - i32.const 307 + i32.const 24 + i32.const 318 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 + local.get $1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and + call $~lib/typedarray/Uint8ClampedArray#__get i32.const 9 i32.ne if i32.const 0 - i32.const 8 - i32.const 308 + i32.const 24 + i32.const 319 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int16Array#map (; 87 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Int16Array#map (; 122 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -4205,55 +5798,61 @@ (local $5 i32) (local $6 i32) (local $7 i32) + (local $8 i32) local.get $0 - i32.load + call $~lib/rt/pure/__retain + local.tee $1 + call $~lib/typedarray/Int16Array#get:length local.set $2 - local.get $0 + local.get $1 i32.load offset=4 local.set $3 - local.get $0 - i32.load offset=8 - i32.const 1 - i32.shr_u - local.tee $4 + local.get $2 call $~lib/typedarray/Int16Array#constructor + local.tee $4 + call $~lib/rt/pure/__retain local.tee $5 - i32.load + i32.load offset=4 local.set $6 + i32.const 0 + local.set $0 loop $repeat|0 - local.get $1 - local.get $4 + local.get $0 + local.get $2 i32.lt_s if i32.const 3 global.set $~lib/argc - local.get $1 + local.get $0 i32.const 1 i32.shl local.tee $7 - local.get $6 - i32.add - local.get $2 - local.get $7 - i32.add local.get $3 i32.add - i32.load16_s offset=8 - local.get $1 + i32.load16_s local.get $0 - i32.const 27 - call_indirect (type $FUNCSIG$iiii) - i32.store16 offset=8 local.get $1 + call $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 + local.set $8 + local.get $6 + local.get $7 + i32.add + local.get $8 + i32.store16 + local.get $0 i32.const 1 i32.add - local.set $1 + local.set $0 br $repeat|0 end end + local.get $1 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release local.get $5 ) - (func $~lib/internal/typedarray/TypedArray#__get (; 88 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int16Array#__get (; 123 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=8 @@ -4261,89 +5860,90 @@ i32.shr_u i32.ge_u if - i32.const 0 - i32.const 48 - i32.const 39 + i32.const 336 + i32.const 432 + i32.const 273 i32.const 63 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 i32.load offset=4 - local.get $0 - i32.load local.get $1 i32.const 1 i32.shl i32.add - i32.add - i32.load16_s offset=8 + i32.load16_s ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Int16Array,i16> (; 89 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayMap<~lib/typedarray/Int16Array,i16> (; 124 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) + (local $2 i32) i32.const 3 call $~lib/typedarray/Int16Array#constructor + local.tee $2 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int16Array#__set local.get $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int16Array#__set local.get $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int16Array#__set local.get $0 call $~lib/typedarray/Int16Array#map - local.tee $0 + local.tee $1 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 65535 - i32.and + call $~lib/typedarray/Int16Array#__get i32.const 1 i32.ne if i32.const 0 - i32.const 8 - i32.const 306 + i32.const 24 + i32.const 317 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 + local.get $1 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 65535 - i32.and + call $~lib/typedarray/Int16Array#__get i32.const 4 i32.ne if i32.const 0 - i32.const 8 - i32.const 307 + i32.const 24 + i32.const 318 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 + local.get $1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 65535 - i32.and + call $~lib/typedarray/Int16Array#__get i32.const 9 i32.ne if i32.const 0 - i32.const 8 - i32.const 308 + i32.const 24 + i32.const 319 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint16Array#map (; 90 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Uint16Array#map (; 125 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -4351,55 +5951,61 @@ (local $5 i32) (local $6 i32) (local $7 i32) + (local $8 i32) local.get $0 - i32.load + call $~lib/rt/pure/__retain + local.tee $1 + call $~lib/typedarray/Int16Array#get:length local.set $2 - local.get $0 + local.get $1 i32.load offset=4 local.set $3 - local.get $0 - i32.load offset=8 - i32.const 1 - i32.shr_u + local.get $2 + call $~lib/typedarray/Uint16Array#constructor local.tee $4 - call $~lib/typedarray/Int16Array#constructor + call $~lib/rt/pure/__retain local.tee $5 - i32.load + i32.load offset=4 local.set $6 + i32.const 0 + local.set $0 loop $repeat|0 - local.get $1 - local.get $4 + local.get $0 + local.get $2 i32.lt_s if i32.const 3 global.set $~lib/argc - local.get $1 + local.get $0 i32.const 1 i32.shl local.tee $7 - local.get $6 - i32.add - local.get $2 - local.get $7 - i32.add local.get $3 i32.add - i32.load16_u offset=8 - local.get $1 + i32.load16_u local.get $0 - i32.const 28 - call_indirect (type $FUNCSIG$iiii) - i32.store16 offset=8 local.get $1 + call $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 + local.set $8 + local.get $6 + local.get $7 + i32.add + local.get $8 + i32.store16 + local.get $0 i32.const 1 i32.add - local.set $1 + local.set $0 br $repeat|0 end end + local.get $1 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release local.get $5 ) - (func $~lib/internal/typedarray/TypedArray#__get (; 91 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint16Array#__get (; 126 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=8 @@ -4407,326 +6013,445 @@ i32.shr_u i32.ge_u if - i32.const 0 - i32.const 48 - i32.const 39 + i32.const 336 + i32.const 432 + i32.const 355 i32.const 63 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 i32.load offset=4 - local.get $0 - i32.load local.get $1 i32.const 1 i32.shl i32.add - i32.add - i32.load16_u offset=8 + i32.load16_u ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Uint16Array,u16> (; 92 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayMap<~lib/typedarray/Uint16Array,u16> (; 127 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) + (local $2 i32) i32.const 3 - call $~lib/typedarray/Int16Array#constructor + call $~lib/typedarray/Uint16Array#constructor + local.tee $2 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint16Array#__set local.get $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint16Array#__set local.get $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint16Array#__set local.get $0 call $~lib/typedarray/Uint16Array#map - local.tee $0 + local.tee $1 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 65535 - i32.and + call $~lib/typedarray/Uint16Array#__get i32.const 1 i32.ne if i32.const 0 - i32.const 8 - i32.const 306 + i32.const 24 + i32.const 317 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 + local.get $1 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 65535 - i32.and + call $~lib/typedarray/Uint16Array#__get i32.const 4 i32.ne if i32.const 0 - i32.const 8 - i32.const 307 + i32.const 24 + i32.const 318 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 + local.get $1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 65535 - i32.and + call $~lib/typedarray/Uint16Array#__get i32.const 9 i32.ne if i32.const 0 - i32.const 8 - i32.const 308 + i32.const 24 + i32.const 319 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int32Array#map (; 93 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int32Array#map (; 128 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) + (local $8 i32) local.get $0 - i32.load - local.set $3 - local.get $0 + call $~lib/rt/pure/__retain + local.tee $1 + call $~lib/typedarray/Int32Array#get:length + local.set $2 + local.get $1 i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u - local.tee $5 + local.set $3 + local.get $2 call $~lib/typedarray/Int32Array#constructor - local.tee $6 - i32.load - local.set $7 + local.tee $4 + call $~lib/rt/pure/__retain + local.tee $5 + i32.load offset=4 + local.set $6 + i32.const 0 + local.set $0 loop $repeat|0 - block $break|0 - local.get $2 - local.get $5 - i32.ge_s - br_if $break|0 + local.get $0 + local.get $2 + i32.lt_s + if i32.const 3 global.set $~lib/argc - local.get $7 - local.get $2 - i32.const 2 - i32.shl - i32.add - local.get $2 + local.get $0 i32.const 2 i32.shl + local.tee $7 local.get $3 i32.add - local.get $4 - i32.add - i32.load offset=8 - local.get $2 + i32.load local.get $0 local.get $1 - call_indirect (type $FUNCSIG$iiii) - i32.store offset=8 - local.get $2 + call $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 + local.set $8 + local.get $6 + local.get $7 + i32.add + local.get $8 + i32.store + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $repeat|0 end end - local.get $6 + local.get $1 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $5 ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Int32Array,i32> (; 94 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayMap<~lib/typedarray/Int32Array,i32> (; 129 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) + (local $2 i32) i32.const 3 call $~lib/typedarray/Int32Array#constructor + local.tee $2 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int32Array#__set local.get $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int32Array#__set local.get $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int32Array#__set local.get $0 - i32.const 29 call $~lib/typedarray/Int32Array#map - local.tee $0 + local.tee $1 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Int32Array#__get i32.const 1 i32.ne if i32.const 0 - i32.const 8 - i32.const 306 + i32.const 24 + i32.const 317 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 1 + call $~lib/typedarray/Int32Array#__get + i32.const 4 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 318 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + i32.const 2 + call $~lib/typedarray/Int32Array#__get + i32.const 9 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 319 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + ) + (func $~lib/typedarray/Uint32Array#map (; 130 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + local.get $0 + call $~lib/rt/pure/__retain + local.tee $1 + call $~lib/typedarray/Int32Array#get:length + local.set $2 + local.get $1 + i32.load offset=4 + local.set $3 + local.get $2 + call $~lib/typedarray/Uint32Array#constructor + local.tee $4 + call $~lib/rt/pure/__retain + local.tee $5 + i32.load offset=4 + local.set $6 + i32.const 0 + local.set $0 + loop $repeat|0 + local.get $0 + local.get $2 + i32.lt_s + if + i32.const 3 + global.set $~lib/argc + local.get $0 + i32.const 2 + i32.shl + local.tee $7 + local.get $3 + i32.add + i32.load + local.get $0 + local.get $1 + call $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 + local.set $8 + local.get $6 + local.get $7 + i32.add + local.get $8 + i32.store + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + end + local.get $1 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + ) + (func $~lib/typedarray/Uint32Array#__get (; 131 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 local.get $0 - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 4 - i32.ne + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ge_u if - i32.const 0 - i32.const 8 - i32.const 307 - i32.const 2 - call $~lib/env/abort + i32.const 336 + i32.const 432 + i32.const 519 + i32.const 63 + call $~lib/builtins/abort unreachable end local.get $0 + i32.load offset=4 + local.get $1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 9 - i32.ne - if - i32.const 0 - i32.const 8 - i32.const 308 - i32.const 2 - call $~lib/env/abort - unreachable - end + i32.shl + i32.add + i32.load ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Uint32Array,u32> (; 95 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayMap<~lib/typedarray/Uint32Array,u32> (; 132 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) + (local $2 i32) i32.const 3 - call $~lib/typedarray/Int32Array#constructor + call $~lib/typedarray/Uint32Array#constructor + local.tee $2 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint32Array#__set local.get $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint32Array#__set local.get $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint32Array#__set local.get $0 - i32.const 30 - call $~lib/typedarray/Int32Array#map - local.tee $0 + call $~lib/typedarray/Uint32Array#map + local.tee $1 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Uint32Array#__get i32.const 1 i32.ne if i32.const 0 - i32.const 8 - i32.const 306 + i32.const 24 + i32.const 317 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 + local.get $1 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Uint32Array#__get i32.const 4 i32.ne if i32.const 0 - i32.const 8 - i32.const 307 + i32.const 24 + i32.const 318 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 + local.get $1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Uint32Array#__get i32.const 9 i32.ne if i32.const 0 - i32.const 8 - i32.const 308 + i32.const 24 + i32.const 319 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Int64Array,i64>~anonymous|0 (; 96 ;) (type $FUNCSIG$jjii) (param $0 i64) (param $1 i32) (param $2 i32) (result i64) + (func $std/typedarray/testArrayMap<~lib/typedarray/Int64Array,i64>~anonymous|0 (; 133 ;) (type $FUNCSIG$jjii) (param $0 i64) (param $1 i32) (param $2 i32) (result i64) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 local.get $0 i64.mul ) - (func $~lib/typedarray/Int64Array#map (; 97 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int64Array#map (; 134 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) + (local $8 i64) local.get $0 - i32.load - local.set $3 - local.get $0 + call $~lib/rt/pure/__retain + local.tee $1 + call $~lib/typedarray/Int64Array#get:length + local.set $2 + local.get $1 i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - i32.const 3 - i32.shr_u - local.tee $5 + local.set $3 + local.get $2 call $~lib/typedarray/Int64Array#constructor - local.tee $6 - i32.load - local.set $7 + local.tee $4 + call $~lib/rt/pure/__retain + local.tee $5 + i32.load offset=4 + local.set $6 + i32.const 0 + local.set $0 loop $repeat|0 - block $break|0 - local.get $2 - local.get $5 - i32.ge_s - br_if $break|0 + local.get $0 + local.get $2 + i32.lt_s + if i32.const 3 global.set $~lib/argc - local.get $7 - local.get $2 - i32.const 3 - i32.shl - i32.add - local.get $2 + local.get $0 i32.const 3 i32.shl + local.tee $7 local.get $3 i32.add - local.get $4 - i32.add - i64.load offset=8 - local.get $2 + i64.load local.get $0 local.get $1 - call_indirect (type $FUNCSIG$jjii) - i64.store offset=8 - local.get $2 + call $std/typedarray/testArrayMap<~lib/typedarray/Int64Array,i64>~anonymous|0 + local.set $8 + local.get $6 + local.get $7 + i32.add + local.get $8 + i64.store + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $repeat|0 end end - local.get $6 + local.get $1 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $5 ) - (func $~lib/internal/typedarray/TypedArray#__get (; 98 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) + (func $~lib/typedarray/Int64Array#__get (; 135 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) local.get $1 local.get $0 i32.load offset=8 @@ -4734,148 +6459,253 @@ i32.shr_u i32.ge_u if - i32.const 0 - i32.const 48 - i32.const 39 + i32.const 336 + i32.const 432 + i32.const 601 i32.const 63 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 i32.load offset=4 - local.get $0 - i32.load local.get $1 i32.const 3 i32.shl i32.add - i32.add - i64.load offset=8 + i64.load ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Int64Array,i64> (; 99 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayMap<~lib/typedarray/Int64Array,i64> (; 136 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) + (local $2 i32) i32.const 3 call $~lib/typedarray/Int64Array#constructor + local.tee $2 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i64.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int64Array#__set local.get $0 i32.const 1 i64.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int64Array#__set local.get $0 i32.const 2 i64.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int64Array#__set local.get $0 - i32.const 31 call $~lib/typedarray/Int64Array#map - local.tee $0 + local.tee $1 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Int64Array#__get i64.const 1 i64.ne if i32.const 0 - i32.const 8 - i32.const 306 + i32.const 24 + i32.const 317 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 + local.get $1 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Int64Array#__get i64.const 4 i64.ne if i32.const 0 - i32.const 8 - i32.const 307 + i32.const 24 + i32.const 318 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 + local.get $1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Int64Array#__get i64.const 9 i64.ne if i32.const 0 - i32.const 8 - i32.const 308 + i32.const 24 + i32.const 319 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort + unreachable + end + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + ) + (func $~lib/typedarray/Uint64Array#map (; 137 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i64) + local.get $0 + call $~lib/rt/pure/__retain + local.tee $1 + call $~lib/typedarray/Int64Array#get:length + local.set $2 + local.get $1 + i32.load offset=4 + local.set $3 + local.get $2 + call $~lib/typedarray/Uint64Array#constructor + local.tee $4 + call $~lib/rt/pure/__retain + local.tee $5 + i32.load offset=4 + local.set $6 + i32.const 0 + local.set $0 + loop $repeat|0 + local.get $0 + local.get $2 + i32.lt_s + if + i32.const 3 + global.set $~lib/argc + local.get $0 + i32.const 3 + i32.shl + local.tee $7 + local.get $3 + i32.add + i64.load + local.get $0 + local.get $1 + call $std/typedarray/testArrayMap<~lib/typedarray/Int64Array,i64>~anonymous|0 + local.set $8 + local.get $6 + local.get $7 + i32.add + local.get $8 + i64.store + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + end + local.get $1 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + ) + (func $~lib/typedarray/Uint64Array#__get (; 138 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 3 + i32.shr_u + i32.ge_u + if + i32.const 336 + i32.const 432 + i32.const 683 + i32.const 63 + call $~lib/builtins/abort unreachable end + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 3 + i32.shl + i32.add + i64.load ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Uint64Array,u64> (; 100 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayMap<~lib/typedarray/Uint64Array,u64> (; 139 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) + (local $2 i32) i32.const 3 - call $~lib/typedarray/Int64Array#constructor + call $~lib/typedarray/Uint64Array#constructor + local.tee $2 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i64.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint64Array#__set local.get $0 i32.const 1 i64.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint64Array#__set local.get $0 i32.const 2 i64.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint64Array#__set local.get $0 - i32.const 32 - call $~lib/typedarray/Int64Array#map - local.tee $0 + call $~lib/typedarray/Uint64Array#map + local.tee $1 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Uint64Array#__get i64.const 1 i64.ne if i32.const 0 - i32.const 8 - i32.const 306 + i32.const 24 + i32.const 317 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 + local.get $1 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Uint64Array#__get i64.const 4 i64.ne if i32.const 0 - i32.const 8 - i32.const 307 + i32.const 24 + i32.const 318 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 + local.get $1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Uint64Array#__get i64.const 9 i64.ne if i32.const 0 - i32.const 8 - i32.const 308 + i32.const 24 + i32.const 319 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Float32Array,f32>~anonymous|0 (; 101 ;) (type $FUNCSIG$ffii) (param $0 f32) (param $1 i32) (param $2 i32) (result f32) + (func $std/typedarray/testArrayMap<~lib/typedarray/Float32Array,f32>~anonymous|0 (; 140 ;) (type $FUNCSIG$ffii) (param $0 f32) (param $1 i32) (param $2 i32) (result f32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 local.get $0 f32.mul ) - (func $~lib/typedarray/Float32Array#map (; 102 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Float32Array#map (; 141 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -4883,55 +6713,61 @@ (local $5 i32) (local $6 i32) (local $7 i32) + (local $8 f32) local.get $0 - i32.load + call $~lib/rt/pure/__retain + local.tee $1 + call $~lib/typedarray/Int32Array#get:length local.set $2 - local.get $0 + local.get $1 i32.load offset=4 local.set $3 - local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u + local.get $2 + call $~lib/typedarray/Float32Array#constructor local.tee $4 - call $~lib/typedarray/Int32Array#constructor + call $~lib/rt/pure/__retain local.tee $5 - i32.load + i32.load offset=4 local.set $6 + i32.const 0 + local.set $0 loop $repeat|0 - local.get $1 - local.get $4 + local.get $0 + local.get $2 i32.lt_s if i32.const 3 global.set $~lib/argc - local.get $1 + local.get $0 i32.const 2 i32.shl local.tee $7 - local.get $6 - i32.add - local.get $2 - local.get $7 - i32.add local.get $3 i32.add - f32.load offset=8 - local.get $1 + f32.load local.get $0 - i32.const 33 - call_indirect (type $FUNCSIG$ffii) - f32.store offset=8 local.get $1 + call $std/typedarray/testArrayMap<~lib/typedarray/Float32Array,f32>~anonymous|0 + local.set $8 + local.get $6 + local.get $7 + i32.add + local.get $8 + f32.store + local.get $0 i32.const 1 i32.add - local.set $1 + local.set $0 br $repeat|0 end end + local.get $1 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release local.get $5 ) - (func $~lib/internal/typedarray/TypedArray#__get (; 103 ;) (type $FUNCSIG$fii) (param $0 i32) (param $1 i32) (result f32) + (func $~lib/typedarray/Float32Array#__get (; 142 ;) (type $FUNCSIG$fii) (param $0 i32) (param $1 i32) (result f32) local.get $1 local.get $0 i32.load offset=8 @@ -4939,88 +6775,100 @@ i32.shr_u i32.ge_u if - i32.const 0 - i32.const 48 - i32.const 39 + i32.const 336 + i32.const 432 + i32.const 765 i32.const 63 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 i32.load offset=4 - local.get $0 - i32.load local.get $1 i32.const 2 i32.shl i32.add - i32.add - f32.load offset=8 + f32.load ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Float32Array,f32> (; 104 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayMap<~lib/typedarray/Float32Array,f32> (; 143 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) + (local $2 i32) i32.const 3 - call $~lib/typedarray/Int32Array#constructor + call $~lib/typedarray/Float32Array#constructor + local.tee $2 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 f32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Float32Array#__set local.get $0 i32.const 1 f32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Float32Array#__set local.get $0 i32.const 2 f32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Float32Array#__set local.get $0 call $~lib/typedarray/Float32Array#map - local.tee $0 + local.tee $1 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Float32Array#__get f32.const 1 f32.ne if i32.const 0 - i32.const 8 - i32.const 306 + i32.const 24 + i32.const 317 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 + local.get $1 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Float32Array#__get f32.const 4 f32.ne if i32.const 0 - i32.const 8 - i32.const 307 + i32.const 24 + i32.const 318 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 + local.get $1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Float32Array#__get f32.const 9 f32.ne if i32.const 0 - i32.const 8 - i32.const 308 + i32.const 24 + i32.const 319 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Float64Array,f64>~anonymous|0 (; 105 ;) (type $FUNCSIG$ddii) (param $0 f64) (param $1 i32) (param $2 i32) (result f64) + (func $std/typedarray/testArrayMap<~lib/typedarray/Float64Array,f64>~anonymous|0 (; 144 ;) (type $FUNCSIG$ddii) (param $0 f64) (param $1 i32) (param $2 i32) (result f64) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 local.get $0 f64.mul ) - (func $~lib/typedarray/Float64Array#map (; 106 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Float64Array#map (; 145 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -5028,198 +6876,230 @@ (local $5 i32) (local $6 i32) (local $7 i32) + (local $8 f64) local.get $0 - i32.load + call $~lib/rt/pure/__retain + local.tee $1 + call $~lib/typedarray/Int64Array#get:length local.set $2 - local.get $0 + local.get $1 i32.load offset=4 local.set $3 - local.get $0 - i32.load offset=8 - i32.const 3 - i32.shr_u + local.get $2 + call $~lib/typedarray/Float64Array#constructor local.tee $4 - call $~lib/typedarray/Int64Array#constructor + call $~lib/rt/pure/__retain local.tee $5 - i32.load + i32.load offset=4 local.set $6 + i32.const 0 + local.set $0 loop $repeat|0 - local.get $1 - local.get $4 + local.get $0 + local.get $2 i32.lt_s if i32.const 3 global.set $~lib/argc - local.get $1 + local.get $0 i32.const 3 i32.shl local.tee $7 - local.get $6 - i32.add - local.get $2 - local.get $7 - i32.add local.get $3 i32.add - f64.load offset=8 - local.get $1 + f64.load local.get $0 - i32.const 34 - call_indirect (type $FUNCSIG$ddii) - f64.store offset=8 local.get $1 + call $std/typedarray/testArrayMap<~lib/typedarray/Float64Array,f64>~anonymous|0 + local.set $8 + local.get $6 + local.get $7 + i32.add + local.get $8 + f64.store + local.get $0 i32.const 1 i32.add - local.set $1 + local.set $0 br $repeat|0 end end + local.get $1 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release local.get $5 ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Float64Array,f64> (; 107 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayMap<~lib/typedarray/Float64Array,f64> (; 146 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) + (local $2 i32) i32.const 3 - call $~lib/typedarray/Int64Array#constructor + call $~lib/typedarray/Float64Array#constructor + local.tee $2 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 f64.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Float64Array#__set local.get $0 i32.const 1 f64.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Float64Array#__set local.get $0 i32.const 2 f64.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Float64Array#__set local.get $0 call $~lib/typedarray/Float64Array#map - local.tee $0 + local.tee $1 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Float64Array#__get f64.const 1 f64.ne if i32.const 0 - i32.const 8 - i32.const 306 + i32.const 24 + i32.const 317 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 + local.get $1 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Float64Array#__get f64.const 4 f64.ne if i32.const 0 - i32.const 8 - i32.const 307 + i32.const 24 + i32.const 318 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 + local.get $1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Float64Array#__get f64.const 9 f64.ne if i32.const 0 - i32.const 8 - i32.const 308 + i32.const 24 + i32.const 319 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 (; 108 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 (; 147 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 i32.const 255 i32.and i32.const 2 i32.eq ) - (func $~lib/typedarray/Int8Array#some (; 109 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int8Array#some (; 148 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - block $~lib/internal/typedarray/SOME<~lib/typedarray/Int8Array,i8>|inlined.0 (result i32) + block $~lib/typedarray/SOME<~lib/typedarray/Int8Array,i8>|inlined.0 (result i32) local.get $0 - i32.load offset=8 + call $~lib/rt/pure/__retain + local.tee $2 + i32.load offset=4 local.set $3 - local.get $0 - i32.load + i32.const 0 + local.set $0 + local.get $2 + i32.load offset=8 local.set $4 - local.get $0 - i32.load offset=4 - local.set $5 loop $repeat|0 - block $break|0 - local.get $2 - local.get $3 - i32.ge_s - br_if $break|0 + local.get $0 + local.get $4 + i32.lt_s + if i32.const 3 global.set $~lib/argc - i32.const 1 - local.get $2 - local.get $4 - i32.add - local.get $5 + local.get $0 + local.get $3 i32.add - i32.load8_s offset=8 - local.get $2 + i32.load8_s local.get $0 + local.get $2 local.get $1 call_indirect (type $FUNCSIG$iiii) - br_if $~lib/internal/typedarray/SOME<~lib/typedarray/Int8Array,i8>|inlined.0 - drop - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $repeat|0 + if + local.get $2 + call $~lib/rt/pure/__release + i32.const 1 + br $~lib/typedarray/SOME<~lib/typedarray/Int8Array,i8>|inlined.0 + else + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + unreachable end end + local.get $2 + call $~lib/rt/pure/__release i32.const 0 end ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|1 (; 110 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|1 (; 149 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 i32.const 255 i32.and i32.eqz ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8> (; 111 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8> (; 150 ;) (type $FUNCSIG$v) (local $0 i32) - i32.const 0 + (local $1 i32) i32.const 3 call $~lib/typedarray/Int8Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int8Array#__set local.get $0 i32.const 1 i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int8Array#__set local.get $0 i32.const 2 i32.const 6 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int8Array#__set local.get $0 i32.const 35 call $~lib/typedarray/Int8Array#some i32.eqz if i32.const 0 - i32.const 8 - i32.const 335 + i32.const 24 + i32.const 346 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -5227,86 +7107,96 @@ call $~lib/typedarray/Int8Array#some if i32.const 0 - i32.const 8 - i32.const 338 + i32.const 24 + i32.const 349 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint8Array#some (; 112 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint8Array#some (; 151 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - block $~lib/internal/typedarray/SOME<~lib/typedarray/Uint8Array,u8>|inlined.0 (result i32) + block $~lib/typedarray/SOME<~lib/typedarray/Uint8Array,u8>|inlined.0 (result i32) local.get $0 - i32.load offset=8 + call $~lib/rt/pure/__retain + local.tee $2 + i32.load offset=4 local.set $3 - local.get $0 - i32.load + i32.const 0 + local.set $0 + local.get $2 + i32.load offset=8 local.set $4 - local.get $0 - i32.load offset=4 - local.set $5 loop $repeat|0 - block $break|0 - local.get $2 - local.get $3 - i32.ge_s - br_if $break|0 + local.get $0 + local.get $4 + i32.lt_s + if i32.const 3 global.set $~lib/argc - i32.const 1 - local.get $2 - local.get $4 - i32.add - local.get $5 + local.get $0 + local.get $3 i32.add - i32.load8_u offset=8 - local.get $2 + i32.load8_u local.get $0 + local.get $2 local.get $1 call_indirect (type $FUNCSIG$iiii) - br_if $~lib/internal/typedarray/SOME<~lib/typedarray/Uint8Array,u8>|inlined.0 - drop - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $repeat|0 + if + local.get $2 + call $~lib/rt/pure/__release + i32.const 1 + br $~lib/typedarray/SOME<~lib/typedarray/Uint8Array,u8>|inlined.0 + else + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + unreachable end end + local.get $2 + call $~lib/rt/pure/__release i32.const 0 end ) - (func $std/typedarray/testArraySome<~lib/typedarray/Uint8Array,u8> (; 113 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArraySome<~lib/typedarray/Uint8Array,u8> (; 152 ;) (type $FUNCSIG$v) (local $0 i32) - i32.const 0 + (local $1 i32) i32.const 3 - call $~lib/typedarray/Int8Array#constructor + call $~lib/typedarray/Uint8Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint8Array#__set local.get $0 i32.const 1 i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint8Array#__set local.get $0 i32.const 2 i32.const 6 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint8Array#__set local.get $0 i32.const 37 call $~lib/typedarray/Uint8Array#some i32.eqz if i32.const 0 - i32.const 8 - i32.const 335 + i32.const 24 + i32.const 346 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -5314,17 +7204,24 @@ call $~lib/typedarray/Uint8Array#some if i32.const 0 - i32.const 8 - i32.const 338 + i32.const 24 + i32.const 349 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArraySome<~lib/typedarray/Uint8ClampedArray,u8> (; 114 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArraySome<~lib/typedarray/Uint8ClampedArray,u8> (; 153 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 call $~lib/typedarray/Uint8ClampedArray#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 2 @@ -5343,10 +7240,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 335 + i32.const 24 + i32.const 346 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -5354,102 +7251,122 @@ call $~lib/typedarray/Uint8Array#some if i32.const 0 - i32.const 8 - i32.const 338 + i32.const 24 + i32.const 349 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 (; 115 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 (; 154 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 i32.const 65535 i32.and i32.const 2 i32.eq ) - (func $~lib/typedarray/Int16Array#some (; 116 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int16Array#some (; 155 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - block $~lib/internal/typedarray/SOME<~lib/typedarray/Int16Array,i16>|inlined.0 (result i32) + block $~lib/typedarray/SOME<~lib/typedarray/Int16Array,i16>|inlined.0 (result i32) local.get $0 - i32.load offset=8 - i32.const 1 - i32.shr_u + call $~lib/rt/pure/__retain + local.tee $2 + i32.load offset=4 local.set $3 - local.get $0 - i32.load + i32.const 0 + local.set $0 + local.get $2 + call $~lib/typedarray/Int16Array#get:length local.set $4 - local.get $0 - i32.load offset=4 - local.set $5 loop $repeat|0 block $break|0 - local.get $2 - local.get $3 + local.get $0 + local.get $4 i32.ge_s br_if $break|0 i32.const 3 global.set $~lib/argc - i32.const 1 - local.get $2 + local.get $0 i32.const 1 i32.shl - local.get $4 - i32.add - local.get $5 + local.get $3 i32.add - i32.load16_s offset=8 - local.get $2 + i32.load16_s local.get $0 + local.get $2 local.get $1 call_indirect (type $FUNCSIG$iiii) - br_if $~lib/internal/typedarray/SOME<~lib/typedarray/Int16Array,i16>|inlined.0 - drop - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $repeat|0 + if + local.get $2 + call $~lib/rt/pure/__release + i32.const 1 + br $~lib/typedarray/SOME<~lib/typedarray/Int16Array,i16>|inlined.0 + else + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + unreachable end end + local.get $2 + call $~lib/rt/pure/__release i32.const 0 end ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|1 (; 117 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|1 (; 156 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 i32.const 65535 i32.and i32.eqz ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16> (; 118 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16> (; 157 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 call $~lib/typedarray/Int16Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int16Array#__set local.get $0 i32.const 1 i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int16Array#__set local.get $0 i32.const 2 i32.const 6 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int16Array#__set local.get $0 i32.const 41 call $~lib/typedarray/Int16Array#some i32.eqz if i32.const 0 - i32.const 8 - i32.const 335 + i32.const 24 + i32.const 346 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -5457,89 +7374,99 @@ call $~lib/typedarray/Int16Array#some if i32.const 0 - i32.const 8 - i32.const 338 + i32.const 24 + i32.const 349 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint16Array#some (; 119 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint16Array#some (; 158 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - block $~lib/internal/typedarray/SOME<~lib/typedarray/Uint16Array,u16>|inlined.0 (result i32) - local.get $0 - i32.load offset=8 - i32.const 1 - i32.shr_u - local.set $3 - local.get $0 - i32.load - local.set $4 + block $~lib/typedarray/SOME<~lib/typedarray/Uint16Array,u16>|inlined.0 (result i32) local.get $0 + call $~lib/rt/pure/__retain + local.tee $2 i32.load offset=4 - local.set $5 + local.set $3 + i32.const 0 + local.set $0 + local.get $2 + call $~lib/typedarray/Int16Array#get:length + local.set $4 loop $repeat|0 block $break|0 - local.get $2 - local.get $3 + local.get $0 + local.get $4 i32.ge_s br_if $break|0 i32.const 3 global.set $~lib/argc - i32.const 1 - local.get $2 + local.get $0 i32.const 1 i32.shl - local.get $4 - i32.add - local.get $5 + local.get $3 i32.add - i32.load16_u offset=8 - local.get $2 + i32.load16_u local.get $0 + local.get $2 local.get $1 call_indirect (type $FUNCSIG$iiii) - br_if $~lib/internal/typedarray/SOME<~lib/typedarray/Uint16Array,u16>|inlined.0 - drop - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $repeat|0 + if + local.get $2 + call $~lib/rt/pure/__release + i32.const 1 + br $~lib/typedarray/SOME<~lib/typedarray/Uint16Array,u16>|inlined.0 + else + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + unreachable end end + local.get $2 + call $~lib/rt/pure/__release i32.const 0 end ) - (func $std/typedarray/testArraySome<~lib/typedarray/Uint16Array,u16> (; 120 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArraySome<~lib/typedarray/Uint16Array,u16> (; 159 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 - call $~lib/typedarray/Int16Array#constructor + call $~lib/typedarray/Uint16Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint16Array#__set local.get $0 i32.const 1 i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint16Array#__set local.get $0 i32.const 2 i32.const 6 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint16Array#__set local.get $0 i32.const 43 call $~lib/typedarray/Uint16Array#some i32.eqz if i32.const 0 - i32.const 8 - i32.const 335 + i32.const 24 + i32.const 346 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -5547,98 +7474,118 @@ call $~lib/typedarray/Uint16Array#some if i32.const 0 - i32.const 8 - i32.const 338 + i32.const 24 + i32.const 349 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 (; 121 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 (; 160 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 i32.const 2 i32.eq ) - (func $~lib/typedarray/Int32Array#some (; 122 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int32Array#some (; 161 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - block $~lib/internal/typedarray/SOME<~lib/typedarray/Int32Array,i32>|inlined.0 (result i32) + block $~lib/typedarray/SOME<~lib/typedarray/Int32Array,i32>|inlined.0 (result i32) local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u + call $~lib/rt/pure/__retain + local.tee $2 + i32.load offset=4 local.set $3 - local.get $0 - i32.load + i32.const 0 + local.set $0 + local.get $2 + call $~lib/typedarray/Int32Array#get:length local.set $4 - local.get $0 - i32.load offset=4 - local.set $5 loop $repeat|0 block $break|0 - local.get $2 - local.get $3 + local.get $0 + local.get $4 i32.ge_s br_if $break|0 i32.const 3 global.set $~lib/argc - i32.const 1 - local.get $2 + local.get $0 i32.const 2 i32.shl - local.get $4 - i32.add - local.get $5 + local.get $3 i32.add - i32.load offset=8 - local.get $2 + i32.load local.get $0 + local.get $2 local.get $1 call_indirect (type $FUNCSIG$iiii) - br_if $~lib/internal/typedarray/SOME<~lib/typedarray/Int32Array,i32>|inlined.0 - drop - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $repeat|0 + if + local.get $2 + call $~lib/rt/pure/__release + i32.const 1 + br $~lib/typedarray/SOME<~lib/typedarray/Int32Array,i32>|inlined.0 + else + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + unreachable end end + local.get $2 + call $~lib/rt/pure/__release i32.const 0 end ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|1 (; 123 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|1 (; 162 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 i32.eqz ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32> (; 124 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32> (; 163 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 call $~lib/typedarray/Int32Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int32Array#__set local.get $0 i32.const 1 i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int32Array#__set local.get $0 i32.const 2 i32.const 6 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int32Array#__set local.get $0 i32.const 45 call $~lib/typedarray/Int32Array#some i32.eqz if i32.const 0 - i32.const 8 - i32.const 335 + i32.const 24 + i32.const 346 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -5646,39 +7593,46 @@ call $~lib/typedarray/Int32Array#some if i32.const 0 - i32.const 8 - i32.const 338 + i32.const 24 + i32.const 349 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArraySome<~lib/typedarray/Uint32Array,u32> (; 125 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArraySome<~lib/typedarray/Uint32Array,u32> (; 164 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 - call $~lib/typedarray/Int32Array#constructor + call $~lib/typedarray/Uint32Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint32Array#__set local.get $0 i32.const 1 i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint32Array#__set local.get $0 i32.const 2 i32.const 6 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint32Array#__set local.get $0 i32.const 47 call $~lib/typedarray/Int32Array#some i32.eqz if i32.const 0 - i32.const 8 - i32.const 335 + i32.const 24 + i32.const 346 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -5686,99 +7640,119 @@ call $~lib/typedarray/Int32Array#some if i32.const 0 - i32.const 8 - i32.const 338 + i32.const 24 + i32.const 349 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|0 (; 126 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|0 (; 165 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 i64.const 2 i64.eq ) - (func $~lib/typedarray/Int64Array#some (; 127 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int64Array#some (; 166 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - block $~lib/internal/typedarray/SOME<~lib/typedarray/Int64Array,i64>|inlined.0 (result i32) + block $~lib/typedarray/SOME<~lib/typedarray/Int64Array,i64>|inlined.0 (result i32) local.get $0 - i32.load offset=8 - i32.const 3 - i32.shr_u + call $~lib/rt/pure/__retain + local.tee $2 + i32.load offset=4 local.set $3 - local.get $0 - i32.load + i32.const 0 + local.set $0 + local.get $2 + call $~lib/typedarray/Int64Array#get:length local.set $4 - local.get $0 - i32.load offset=4 - local.set $5 loop $repeat|0 block $break|0 - local.get $2 - local.get $3 + local.get $0 + local.get $4 i32.ge_s br_if $break|0 i32.const 3 global.set $~lib/argc - i32.const 1 - local.get $2 + local.get $0 i32.const 3 i32.shl - local.get $4 - i32.add - local.get $5 + local.get $3 i32.add - i64.load offset=8 - local.get $2 + i64.load local.get $0 + local.get $2 local.get $1 call_indirect (type $FUNCSIG$ijii) - br_if $~lib/internal/typedarray/SOME<~lib/typedarray/Int64Array,i64>|inlined.0 - drop - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $repeat|0 + if + local.get $2 + call $~lib/rt/pure/__release + i32.const 1 + br $~lib/typedarray/SOME<~lib/typedarray/Int64Array,i64>|inlined.0 + else + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + unreachable end end + local.get $2 + call $~lib/rt/pure/__release i32.const 0 end ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|1 (; 128 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|1 (; 167 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 i64.const 0 i64.eq ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64> (; 129 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64> (; 168 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 call $~lib/typedarray/Int64Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i64.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int64Array#__set local.get $0 i32.const 1 i64.const 4 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int64Array#__set local.get $0 i32.const 2 i64.const 6 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int64Array#__set local.get $0 i32.const 49 call $~lib/typedarray/Int64Array#some i32.eqz if i32.const 0 - i32.const 8 - i32.const 335 + i32.const 24 + i32.const 346 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -5786,39 +7760,46 @@ call $~lib/typedarray/Int64Array#some if i32.const 0 - i32.const 8 - i32.const 338 + i32.const 24 + i32.const 349 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArraySome<~lib/typedarray/Uint64Array,u64> (; 130 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArraySome<~lib/typedarray/Uint64Array,u64> (; 169 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 - call $~lib/typedarray/Int64Array#constructor + call $~lib/typedarray/Uint64Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i64.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint64Array#__set local.get $0 i32.const 1 i64.const 4 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint64Array#__set local.get $0 i32.const 2 i64.const 6 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint64Array#__set local.get $0 i32.const 51 call $~lib/typedarray/Int64Array#some i32.eqz if i32.const 0 - i32.const 8 - i32.const 335 + i32.const 24 + i32.const 346 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -5826,99 +7807,119 @@ call $~lib/typedarray/Int64Array#some if i32.const 0 - i32.const 8 - i32.const 338 + i32.const 24 + i32.const 349 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|0 (; 131 ;) (type $FUNCSIG$ifii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|0 (; 170 ;) (type $FUNCSIG$ifii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 f32.const 2 f32.eq ) - (func $~lib/typedarray/Float32Array#some (; 132 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Float32Array#some (; 171 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - block $~lib/internal/typedarray/SOME<~lib/typedarray/Float32Array,f32>|inlined.0 (result i32) + block $~lib/typedarray/SOME<~lib/typedarray/Float32Array,f32>|inlined.0 (result i32) local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u + call $~lib/rt/pure/__retain + local.tee $2 + i32.load offset=4 local.set $3 - local.get $0 - i32.load + i32.const 0 + local.set $0 + local.get $2 + call $~lib/typedarray/Int32Array#get:length local.set $4 - local.get $0 - i32.load offset=4 - local.set $5 loop $repeat|0 block $break|0 - local.get $2 - local.get $3 + local.get $0 + local.get $4 i32.ge_s br_if $break|0 i32.const 3 global.set $~lib/argc - i32.const 1 - local.get $2 + local.get $0 i32.const 2 i32.shl - local.get $4 - i32.add - local.get $5 + local.get $3 i32.add - f32.load offset=8 - local.get $2 + f32.load local.get $0 + local.get $2 local.get $1 call_indirect (type $FUNCSIG$ifii) - br_if $~lib/internal/typedarray/SOME<~lib/typedarray/Float32Array,f32>|inlined.0 - drop - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $repeat|0 + if + local.get $2 + call $~lib/rt/pure/__release + i32.const 1 + br $~lib/typedarray/SOME<~lib/typedarray/Float32Array,f32>|inlined.0 + else + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + unreachable end end + local.get $2 + call $~lib/rt/pure/__release i32.const 0 end ) - (func $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|1 (; 133 ;) (type $FUNCSIG$ifii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|1 (; 172 ;) (type $FUNCSIG$ifii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 f32.const 0 f32.eq ) - (func $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32> (; 134 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32> (; 173 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 - call $~lib/typedarray/Int32Array#constructor + call $~lib/typedarray/Float32Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 f32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Float32Array#__set local.get $0 i32.const 1 f32.const 4 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Float32Array#__set local.get $0 i32.const 2 f32.const 6 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Float32Array#__set local.get $0 i32.const 53 call $~lib/typedarray/Float32Array#some i32.eqz if i32.const 0 - i32.const 8 - i32.const 335 + i32.const 24 + i32.const 346 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -5926,99 +7927,119 @@ call $~lib/typedarray/Float32Array#some if i32.const 0 - i32.const 8 - i32.const 338 + i32.const 24 + i32.const 349 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|0 (; 135 ;) (type $FUNCSIG$idii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|0 (; 174 ;) (type $FUNCSIG$idii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 f64.const 2 f64.eq ) - (func $~lib/typedarray/Float64Array#some (; 136 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Float64Array#some (; 175 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - block $~lib/internal/typedarray/SOME<~lib/typedarray/Float64Array,f64>|inlined.0 (result i32) + block $~lib/typedarray/SOME<~lib/typedarray/Float64Array,f64>|inlined.0 (result i32) local.get $0 - i32.load offset=8 - i32.const 3 - i32.shr_u + call $~lib/rt/pure/__retain + local.tee $2 + i32.load offset=4 local.set $3 - local.get $0 - i32.load + i32.const 0 + local.set $0 + local.get $2 + call $~lib/typedarray/Int64Array#get:length local.set $4 - local.get $0 - i32.load offset=4 - local.set $5 loop $repeat|0 block $break|0 - local.get $2 - local.get $3 + local.get $0 + local.get $4 i32.ge_s br_if $break|0 i32.const 3 global.set $~lib/argc - i32.const 1 - local.get $2 + local.get $0 i32.const 3 i32.shl - local.get $4 - i32.add - local.get $5 + local.get $3 i32.add - f64.load offset=8 - local.get $2 + f64.load local.get $0 + local.get $2 local.get $1 call_indirect (type $FUNCSIG$idii) - br_if $~lib/internal/typedarray/SOME<~lib/typedarray/Float64Array,f64>|inlined.0 - drop - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $repeat|0 + if + local.get $2 + call $~lib/rt/pure/__release + i32.const 1 + br $~lib/typedarray/SOME<~lib/typedarray/Float64Array,f64>|inlined.0 + else + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + unreachable end end + local.get $2 + call $~lib/rt/pure/__release i32.const 0 end ) - (func $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|1 (; 137 ;) (type $FUNCSIG$idii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|1 (; 176 ;) (type $FUNCSIG$idii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 f64.const 0 f64.eq ) - (func $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64> (; 138 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64> (; 177 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 - call $~lib/typedarray/Int64Array#constructor + call $~lib/typedarray/Float64Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 f64.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Float64Array#__set local.get $0 i32.const 1 f64.const 4 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Float64Array#__set local.get $0 i32.const 2 f64.const 6 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Float64Array#__set local.get $0 i32.const 55 call $~lib/typedarray/Float64Array#some i32.eqz if i32.const 0 - i32.const 8 - i32.const 335 + i32.const 24 + i32.const 346 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -6026,97 +8047,110 @@ call $~lib/typedarray/Float64Array#some if i32.const 0 - i32.const 8 - i32.const 338 + i32.const 24 + i32.const 349 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int8Array#findIndex (; 139 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int8Array#findIndex (; 178 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - local.get $0 - i32.load offset=8 - local.set $2 - local.get $0 - local.tee $3 - i32.load - local.set $4 local.get $0 + call $~lib/rt/pure/__retain + local.tee $2 i32.load offset=4 - local.set $5 + local.set $3 i32.const 0 local.set $0 - block $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Int8Array,i8>|inlined.0 + local.get $2 + i32.load offset=8 + local.set $4 + block $~lib/typedarray/FIND_INDEX<~lib/typedarray/Int8Array,i8>|inlined.0 loop $repeat|0 - block $break|0 - local.get $0 - local.get $2 - i32.ge_s - br_if $break|0 + local.get $0 + local.get $4 + i32.lt_s + if i32.const 3 global.set $~lib/argc local.get $0 - local.get $4 - i32.add - local.get $5 + local.get $3 i32.add - i32.load8_s offset=8 + i32.load8_s local.get $0 - local.get $3 + local.get $2 local.get $1 call_indirect (type $FUNCSIG$iiii) - br_if $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Int8Array,i8>|inlined.0 - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 + if + local.get $2 + call $~lib/rt/pure/__release + br $~lib/typedarray/FIND_INDEX<~lib/typedarray/Int8Array,i8>|inlined.0 + else + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + unreachable end end + local.get $2 + call $~lib/rt/pure/__release i32.const -1 local.set $0 end local.get $0 ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int8Array,i8>~anonymous|1 (; 140 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int8Array,i8>~anonymous|1 (; 179 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 i32.const 255 i32.and i32.const 4 i32.eq ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int8Array,i8> (; 141 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int8Array,i8> (; 180 ;) (type $FUNCSIG$v) (local $0 i32) - i32.const 0 + (local $1 i32) i32.const 3 call $~lib/typedarray/Int8Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int8Array#__set local.get $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int8Array#__set local.get $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int8Array#__set local.get $0 i32.const 57 call $~lib/typedarray/Int8Array#findIndex i32.const 1 i32.ne if - i32.const 624 - i32.const 8 - i32.const 365 + i32.const 976 + i32.const 24 + i32.const 376 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -6125,91 +8159,99 @@ i32.const -1 i32.ne if - i32.const 664 - i32.const 8 - i32.const 368 + i32.const 1024 + i32.const 24 + i32.const 379 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint8Array#findIndex (; 142 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint8Array#findIndex (; 181 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - local.get $0 - i32.load offset=8 - local.set $2 - local.get $0 - local.tee $3 - i32.load - local.set $4 local.get $0 + call $~lib/rt/pure/__retain + local.tee $2 i32.load offset=4 - local.set $5 + local.set $3 i32.const 0 local.set $0 - block $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Uint8Array,u8>|inlined.0 + local.get $2 + i32.load offset=8 + local.set $4 + block $~lib/typedarray/FIND_INDEX<~lib/typedarray/Uint8Array,u8>|inlined.0 loop $repeat|0 - block $break|0 - local.get $0 - local.get $2 - i32.ge_s - br_if $break|0 + local.get $0 + local.get $4 + i32.lt_s + if i32.const 3 global.set $~lib/argc local.get $0 - local.get $4 - i32.add - local.get $5 + local.get $3 i32.add - i32.load8_u offset=8 + i32.load8_u local.get $0 - local.get $3 + local.get $2 local.get $1 call_indirect (type $FUNCSIG$iiii) - br_if $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Uint8Array,u8>|inlined.0 - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 + if + local.get $2 + call $~lib/rt/pure/__release + br $~lib/typedarray/FIND_INDEX<~lib/typedarray/Uint8Array,u8>|inlined.0 + else + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + unreachable end end + local.get $2 + call $~lib/rt/pure/__release i32.const -1 local.set $0 end local.get $0 ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8Array,u8> (; 143 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8Array,u8> (; 182 ;) (type $FUNCSIG$v) (local $0 i32) - i32.const 0 + (local $1 i32) i32.const 3 - call $~lib/typedarray/Int8Array#constructor + call $~lib/typedarray/Uint8Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint8Array#__set local.get $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint8Array#__set local.get $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint8Array#__set local.get $0 i32.const 59 call $~lib/typedarray/Uint8Array#findIndex i32.const 1 i32.ne if - i32.const 624 - i32.const 8 - i32.const 365 + i32.const 976 + i32.const 24 + i32.const 376 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -6218,18 +8260,25 @@ i32.const -1 i32.ne if - i32.const 664 - i32.const 8 - i32.const 368 + i32.const 1024 + i32.const 24 + i32.const 379 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8ClampedArray,u8> (; 144 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8ClampedArray,u8> (; 183 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 call $~lib/typedarray/Uint8ClampedArray#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 1 @@ -6248,11 +8297,11 @@ i32.const 1 i32.ne if - i32.const 624 - i32.const 8 - i32.const 365 + i32.const 976 + i32.const 24 + i32.const 376 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -6261,38 +8310,37 @@ i32.const -1 i32.ne if - i32.const 664 - i32.const 8 - i32.const 368 + i32.const 1024 + i32.const 24 + i32.const 379 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int16Array#findIndex (; 145 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int16Array#findIndex (; 184 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - local.get $0 - i32.load offset=8 - i32.const 1 - i32.shr_u - local.set $2 - local.get $0 - local.tee $3 - i32.load - local.set $4 local.get $0 + call $~lib/rt/pure/__retain + local.tee $2 i32.load offset=4 - local.set $5 + local.set $3 i32.const 0 local.set $0 - block $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Int16Array,i16>|inlined.0 + local.get $2 + call $~lib/typedarray/Int16Array#get:length + local.set $4 + block $~lib/typedarray/FIND_INDEX<~lib/typedarray/Int16Array,i16>|inlined.0 loop $repeat|0 block $break|0 local.get $0 - local.get $2 + local.get $4 i32.ge_s br_if $break|0 i32.const 3 @@ -6300,62 +8348,76 @@ local.get $0 i32.const 1 i32.shl - local.get $4 - i32.add - local.get $5 + local.get $3 i32.add - i32.load16_s offset=8 + i32.load16_s local.get $0 - local.get $3 + local.get $2 local.get $1 call_indirect (type $FUNCSIG$iiii) - br_if $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Int16Array,i16>|inlined.0 - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 + if + local.get $2 + call $~lib/rt/pure/__release + br $~lib/typedarray/FIND_INDEX<~lib/typedarray/Int16Array,i16>|inlined.0 + else + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + unreachable end end + local.get $2 + call $~lib/rt/pure/__release i32.const -1 local.set $0 end local.get $0 ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int16Array,i16>~anonymous|1 (; 146 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int16Array,i16>~anonymous|1 (; 185 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 i32.const 65535 i32.and i32.const 4 i32.eq ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int16Array,i16> (; 147 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int16Array,i16> (; 186 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 call $~lib/typedarray/Int16Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int16Array#__set local.get $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int16Array#__set local.get $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int16Array#__set local.get $0 i32.const 63 call $~lib/typedarray/Int16Array#findIndex i32.const 1 i32.ne if - i32.const 624 - i32.const 8 - i32.const 365 + i32.const 976 + i32.const 24 + i32.const 376 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -6364,38 +8426,37 @@ i32.const -1 i32.ne if - i32.const 664 - i32.const 8 - i32.const 368 + i32.const 1024 + i32.const 24 + i32.const 379 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint16Array#findIndex (; 148 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint16Array#findIndex (; 187 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - local.get $0 - i32.load offset=8 - i32.const 1 - i32.shr_u - local.set $2 - local.get $0 - local.tee $3 - i32.load - local.set $4 local.get $0 + call $~lib/rt/pure/__retain + local.tee $2 i32.load offset=4 - local.set $5 + local.set $3 i32.const 0 local.set $0 - block $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Uint16Array,u16>|inlined.0 + local.get $2 + call $~lib/typedarray/Int16Array#get:length + local.set $4 + block $~lib/typedarray/FIND_INDEX<~lib/typedarray/Uint16Array,u16>|inlined.0 loop $repeat|0 block $break|0 local.get $0 - local.get $2 + local.get $4 i32.ge_s br_if $break|0 i32.const 3 @@ -6403,55 +8464,64 @@ local.get $0 i32.const 1 i32.shl - local.get $4 - i32.add - local.get $5 + local.get $3 i32.add - i32.load16_u offset=8 + i32.load16_u local.get $0 - local.get $3 + local.get $2 local.get $1 call_indirect (type $FUNCSIG$iiii) - br_if $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Uint16Array,u16>|inlined.0 - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 + if + local.get $2 + call $~lib/rt/pure/__release + br $~lib/typedarray/FIND_INDEX<~lib/typedarray/Uint16Array,u16>|inlined.0 + else + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + unreachable end end + local.get $2 + call $~lib/rt/pure/__release i32.const -1 local.set $0 end local.get $0 ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint16Array,u16> (; 149 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint16Array,u16> (; 188 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 - call $~lib/typedarray/Int16Array#constructor + call $~lib/typedarray/Uint16Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint16Array#__set local.get $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint16Array#__set local.get $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint16Array#__set local.get $0 i32.const 65 call $~lib/typedarray/Uint16Array#findIndex i32.const 1 i32.ne if - i32.const 624 - i32.const 8 - i32.const 365 + i32.const 976 + i32.const 24 + i32.const 376 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -6460,38 +8530,37 @@ i32.const -1 i32.ne if - i32.const 664 - i32.const 8 - i32.const 368 + i32.const 1024 + i32.const 24 + i32.const 379 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int32Array#findIndex (; 150 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int32Array#findIndex (; 189 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u - local.set $2 - local.get $0 - local.tee $3 - i32.load - local.set $4 local.get $0 + call $~lib/rt/pure/__retain + local.tee $2 i32.load offset=4 - local.set $5 + local.set $3 i32.const 0 local.set $0 - block $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Int32Array,i32>|inlined.0 + local.get $2 + call $~lib/typedarray/Int32Array#get:length + local.set $4 + block $~lib/typedarray/FIND_INDEX<~lib/typedarray/Int32Array,i32>|inlined.0 loop $repeat|0 block $break|0 local.get $0 - local.get $2 + local.get $4 i32.ge_s br_if $break|0 i32.const 3 @@ -6499,60 +8568,74 @@ local.get $0 i32.const 2 i32.shl - local.get $4 - i32.add - local.get $5 + local.get $3 i32.add - i32.load offset=8 + i32.load local.get $0 - local.get $3 + local.get $2 local.get $1 call_indirect (type $FUNCSIG$iiii) - br_if $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Int32Array,i32>|inlined.0 - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 + if + local.get $2 + call $~lib/rt/pure/__release + br $~lib/typedarray/FIND_INDEX<~lib/typedarray/Int32Array,i32>|inlined.0 + else + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + unreachable end end + local.get $2 + call $~lib/rt/pure/__release i32.const -1 local.set $0 end local.get $0 ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int32Array,i32>~anonymous|1 (; 151 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int32Array,i32>~anonymous|1 (; 190 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 i32.const 4 i32.eq ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int32Array,i32> (; 152 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int32Array,i32> (; 191 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 call $~lib/typedarray/Int32Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int32Array#__set local.get $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int32Array#__set local.get $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int32Array#__set local.get $0 i32.const 67 call $~lib/typedarray/Int32Array#findIndex i32.const 1 i32.ne if - i32.const 624 - i32.const 8 - i32.const 365 + i32.const 976 + i32.const 24 + i32.const 376 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -6561,41 +8644,48 @@ i32.const -1 i32.ne if - i32.const 664 - i32.const 8 - i32.const 368 + i32.const 1024 + i32.const 24 + i32.const 379 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint32Array,u32> (; 153 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint32Array,u32> (; 192 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 - call $~lib/typedarray/Int32Array#constructor + call $~lib/typedarray/Uint32Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint32Array#__set local.get $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint32Array#__set local.get $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint32Array#__set local.get $0 i32.const 69 call $~lib/typedarray/Int32Array#findIndex i32.const 1 i32.ne if - i32.const 624 - i32.const 8 - i32.const 365 + i32.const 976 + i32.const 24 + i32.const 376 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -6604,38 +8694,37 @@ i32.const -1 i32.ne if - i32.const 664 - i32.const 8 - i32.const 368 + i32.const 1024 + i32.const 24 + i32.const 379 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int64Array#findIndex (; 154 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int64Array#findIndex (; 193 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - local.get $0 - i32.load offset=8 - i32.const 3 - i32.shr_u - local.set $2 - local.get $0 - local.tee $3 - i32.load - local.set $4 local.get $0 + call $~lib/rt/pure/__retain + local.tee $2 i32.load offset=4 - local.set $5 + local.set $3 i32.const 0 local.set $0 - block $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Int64Array,i64>|inlined.0 + local.get $2 + call $~lib/typedarray/Int64Array#get:length + local.set $4 + block $~lib/typedarray/FIND_INDEX<~lib/typedarray/Int64Array,i64>|inlined.0 loop $repeat|0 block $break|0 local.get $0 - local.get $2 + local.get $4 i32.ge_s br_if $break|0 i32.const 3 @@ -6643,60 +8732,74 @@ local.get $0 i32.const 3 i32.shl - local.get $4 - i32.add - local.get $5 + local.get $3 i32.add - i64.load offset=8 + i64.load local.get $0 - local.get $3 + local.get $2 local.get $1 call_indirect (type $FUNCSIG$ijii) - br_if $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Int64Array,i64>|inlined.0 - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 + if + local.get $2 + call $~lib/rt/pure/__release + br $~lib/typedarray/FIND_INDEX<~lib/typedarray/Int64Array,i64>|inlined.0 + else + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + unreachable end end + local.get $2 + call $~lib/rt/pure/__release i32.const -1 local.set $0 end local.get $0 ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int64Array,i64>~anonymous|1 (; 155 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int64Array,i64>~anonymous|1 (; 194 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 i64.const 4 i64.eq ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int64Array,i64> (; 156 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int64Array,i64> (; 195 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 call $~lib/typedarray/Int64Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i64.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int64Array#__set local.get $0 i32.const 1 i64.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int64Array#__set local.get $0 i32.const 2 i64.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int64Array#__set local.get $0 i32.const 71 call $~lib/typedarray/Int64Array#findIndex i32.const 1 i32.ne if - i32.const 624 - i32.const 8 - i32.const 365 + i32.const 976 + i32.const 24 + i32.const 376 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -6705,41 +8808,48 @@ i32.const -1 i32.ne if - i32.const 664 - i32.const 8 - i32.const 368 + i32.const 1024 + i32.const 24 + i32.const 379 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint64Array,u64> (; 157 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint64Array,u64> (; 196 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 - call $~lib/typedarray/Int64Array#constructor + call $~lib/typedarray/Uint64Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i64.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint64Array#__set local.get $0 i32.const 1 i64.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint64Array#__set local.get $0 i32.const 2 i64.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint64Array#__set local.get $0 i32.const 73 call $~lib/typedarray/Int64Array#findIndex i32.const 1 i32.ne if - i32.const 624 - i32.const 8 - i32.const 365 + i32.const 976 + i32.const 24 + i32.const 376 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -6748,38 +8858,37 @@ i32.const -1 i32.ne if - i32.const 664 - i32.const 8 - i32.const 368 + i32.const 1024 + i32.const 24 + i32.const 379 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Float32Array#findIndex (; 158 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Float32Array#findIndex (; 197 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u - local.set $2 - local.get $0 - local.tee $3 - i32.load - local.set $4 local.get $0 + call $~lib/rt/pure/__retain + local.tee $2 i32.load offset=4 - local.set $5 + local.set $3 i32.const 0 local.set $0 - block $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Float32Array,f32>|inlined.0 + local.get $2 + call $~lib/typedarray/Int32Array#get:length + local.set $4 + block $~lib/typedarray/FIND_INDEX<~lib/typedarray/Float32Array,f32>|inlined.0 loop $repeat|0 block $break|0 local.get $0 - local.get $2 + local.get $4 i32.ge_s br_if $break|0 i32.const 3 @@ -6787,60 +8896,74 @@ local.get $0 i32.const 2 i32.shl - local.get $4 - i32.add - local.get $5 + local.get $3 i32.add - f32.load offset=8 + f32.load local.get $0 - local.get $3 + local.get $2 local.get $1 call_indirect (type $FUNCSIG$ifii) - br_if $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Float32Array,f32>|inlined.0 - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 + if + local.get $2 + call $~lib/rt/pure/__release + br $~lib/typedarray/FIND_INDEX<~lib/typedarray/Float32Array,f32>|inlined.0 + else + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + unreachable end end + local.get $2 + call $~lib/rt/pure/__release i32.const -1 local.set $0 end local.get $0 ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Float32Array,f32>~anonymous|1 (; 159 ;) (type $FUNCSIG$ifii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Float32Array,f32>~anonymous|1 (; 198 ;) (type $FUNCSIG$ifii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 f32.const 4 f32.eq ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Float32Array,f32> (; 160 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Float32Array,f32> (; 199 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 - call $~lib/typedarray/Int32Array#constructor + call $~lib/typedarray/Float32Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 f32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Float32Array#__set local.get $0 i32.const 1 f32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Float32Array#__set local.get $0 i32.const 2 f32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Float32Array#__set local.get $0 i32.const 75 call $~lib/typedarray/Float32Array#findIndex i32.const 1 i32.ne if - i32.const 624 - i32.const 8 - i32.const 365 + i32.const 976 + i32.const 24 + i32.const 376 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -6849,38 +8972,37 @@ i32.const -1 i32.ne if - i32.const 664 - i32.const 8 - i32.const 368 + i32.const 1024 + i32.const 24 + i32.const 379 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Float64Array#findIndex (; 161 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Float64Array#findIndex (; 200 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - local.get $0 - i32.load offset=8 - i32.const 3 - i32.shr_u - local.set $2 - local.get $0 - local.tee $3 - i32.load - local.set $4 local.get $0 + call $~lib/rt/pure/__retain + local.tee $2 i32.load offset=4 - local.set $5 + local.set $3 i32.const 0 local.set $0 - block $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Float64Array,f64>|inlined.0 + local.get $2 + call $~lib/typedarray/Int64Array#get:length + local.set $4 + block $~lib/typedarray/FIND_INDEX<~lib/typedarray/Float64Array,f64>|inlined.0 loop $repeat|0 block $break|0 local.get $0 - local.get $2 + local.get $4 i32.ge_s br_if $break|0 i32.const 3 @@ -6888,60 +9010,74 @@ local.get $0 i32.const 3 i32.shl - local.get $4 - i32.add - local.get $5 + local.get $3 i32.add - f64.load offset=8 + f64.load local.get $0 - local.get $3 + local.get $2 local.get $1 call_indirect (type $FUNCSIG$idii) - br_if $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Float64Array,f64>|inlined.0 - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 + if + local.get $2 + call $~lib/rt/pure/__release + br $~lib/typedarray/FIND_INDEX<~lib/typedarray/Float64Array,f64>|inlined.0 + else + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + unreachable end end + local.get $2 + call $~lib/rt/pure/__release i32.const -1 local.set $0 end local.get $0 ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Float64Array,f64>~anonymous|1 (; 162 ;) (type $FUNCSIG$idii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Float64Array,f64>~anonymous|1 (; 201 ;) (type $FUNCSIG$idii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 f64.const 4 f64.eq ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Float64Array,f64> (; 163 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Float64Array,f64> (; 202 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 - call $~lib/typedarray/Int64Array#constructor + call $~lib/typedarray/Float64Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 f64.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Float64Array#__set local.get $0 i32.const 1 f64.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Float64Array#__set local.get $0 i32.const 2 f64.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Float64Array#__set local.get $0 i32.const 77 call $~lib/typedarray/Float64Array#findIndex i32.const 1 i32.ne if - i32.const 624 - i32.const 8 - i32.const 365 + i32.const 976 + i32.const 24 + i32.const 376 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -6950,15 +9086,22 @@ i32.const -1 i32.ne if - i32.const 664 - i32.const 8 - i32.const 368 + i32.const 1024 + i32.const 24 + i32.const 379 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Int8Array,i8>~anonymous|0 (; 164 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Int8Array,i8>~anonymous|0 (; 203 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 i32.const 24 i32.shl @@ -6967,82 +9110,90 @@ i32.const 2 i32.rem_s i32.eqz + local.set $0 + local.get $2 + call $~lib/rt/pure/__release + local.get $0 ) - (func $~lib/typedarray/Int8Array#every (; 165 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int8Array#every (; 204 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - block $~lib/internal/typedarray/EVERY<~lib/typedarray/Int8Array,i8>|inlined.0 (result i32) + block $~lib/typedarray/EVERY<~lib/typedarray/Int8Array,i8>|inlined.0 (result i32) local.get $0 - i32.load offset=8 + call $~lib/rt/pure/__retain + local.tee $2 + i32.load offset=4 local.set $3 - local.get $0 - i32.load + i32.const 0 + local.set $0 + local.get $2 + i32.load offset=8 local.set $4 - local.get $0 - i32.load offset=4 - local.set $5 loop $repeat|0 - block $break|0 - local.get $2 - local.get $3 - i32.ge_s - br_if $break|0 + local.get $0 + local.get $4 + i32.lt_s + if i32.const 3 global.set $~lib/argc - local.get $2 - local.get $4 - i32.add - local.get $5 + local.get $0 + local.get $3 i32.add - i32.load8_s offset=8 - local.get $2 + i32.load8_s local.get $0 + local.get $2 local.get $1 call_indirect (type $FUNCSIG$iiii) - i32.eqz if + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + else + local.get $2 + call $~lib/rt/pure/__release i32.const 0 - br $~lib/internal/typedarray/EVERY<~lib/typedarray/Int8Array,i8>|inlined.0 + br $~lib/typedarray/EVERY<~lib/typedarray/Int8Array,i8>|inlined.0 end - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $repeat|0 + unreachable end end + local.get $2 + call $~lib/rt/pure/__release i32.const 1 end ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Int8Array,i8> (; 166 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Int8Array,i8> (; 205 ;) (type $FUNCSIG$v) (local $0 i32) - i32.const 0 + (local $1 i32) i32.const 3 call $~lib/typedarray/Int8Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int8Array#__set local.get $0 i32.const 1 i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int8Array#__set local.get $0 i32.const 2 i32.const 6 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int8Array#__set local.get $0 i32.const 79 call $~lib/typedarray/Int8Array#every i32.eqz if i32.const 0 - i32.const 8 - i32.const 395 + i32.const 24 + i32.const 406 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -7050,94 +9201,107 @@ call $~lib/typedarray/Int8Array#every if i32.const 0 - i32.const 8 - i32.const 398 + i32.const 24 + i32.const 409 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8>~anonymous|0 (; 167 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8>~anonymous|0 (; 206 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $2 + call $~lib/rt/pure/__release local.get $0 i32.const 1 i32.and i32.eqz ) - (func $~lib/typedarray/Uint8Array#every (; 168 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint8Array#every (; 207 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - block $~lib/internal/typedarray/EVERY<~lib/typedarray/Uint8Array,u8>|inlined.0 (result i32) + block $~lib/typedarray/EVERY<~lib/typedarray/Uint8Array,u8>|inlined.0 (result i32) local.get $0 - i32.load offset=8 + call $~lib/rt/pure/__retain + local.tee $2 + i32.load offset=4 local.set $3 - local.get $0 - i32.load + i32.const 0 + local.set $0 + local.get $2 + i32.load offset=8 local.set $4 - local.get $0 - i32.load offset=4 - local.set $5 loop $repeat|0 - block $break|0 - local.get $2 - local.get $3 - i32.ge_s - br_if $break|0 + local.get $0 + local.get $4 + i32.lt_s + if i32.const 3 global.set $~lib/argc - local.get $2 - local.get $4 - i32.add - local.get $5 + local.get $0 + local.get $3 i32.add - i32.load8_u offset=8 - local.get $2 + i32.load8_u local.get $0 + local.get $2 local.get $1 call_indirect (type $FUNCSIG$iiii) - i32.eqz if + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + else + local.get $2 + call $~lib/rt/pure/__release i32.const 0 - br $~lib/internal/typedarray/EVERY<~lib/typedarray/Uint8Array,u8>|inlined.0 + br $~lib/typedarray/EVERY<~lib/typedarray/Uint8Array,u8>|inlined.0 end - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $repeat|0 + unreachable end end + local.get $2 + call $~lib/rt/pure/__release i32.const 1 end ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8> (; 169 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8> (; 208 ;) (type $FUNCSIG$v) (local $0 i32) - i32.const 0 + (local $1 i32) i32.const 3 - call $~lib/typedarray/Int8Array#constructor + call $~lib/typedarray/Uint8Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint8Array#__set local.get $0 i32.const 1 i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint8Array#__set local.get $0 i32.const 2 i32.const 6 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint8Array#__set local.get $0 i32.const 81 call $~lib/typedarray/Uint8Array#every i32.eqz if i32.const 0 - i32.const 8 - i32.const 395 + i32.const 24 + i32.const 406 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -7145,17 +9309,24 @@ call $~lib/typedarray/Uint8Array#every if i32.const 0 - i32.const 8 - i32.const 398 + i32.const 24 + i32.const 409 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint8ClampedArray,u8> (; 170 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint8ClampedArray,u8> (; 209 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 call $~lib/typedarray/Uint8ClampedArray#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 2 @@ -7174,10 +9345,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 395 + i32.const 24 + i32.const 406 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -7185,14 +9356,21 @@ call $~lib/typedarray/Uint8Array#every if i32.const 0 - i32.const 8 - i32.const 398 + i32.const 24 + i32.const 409 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Int16Array,i16>~anonymous|0 (; 171 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Int16Array,i16>~anonymous|0 (; 210 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 i32.const 16 i32.shl @@ -7201,85 +9379,92 @@ i32.const 2 i32.rem_s i32.eqz + local.set $0 + local.get $2 + call $~lib/rt/pure/__release + local.get $0 ) - (func $~lib/typedarray/Int16Array#every (; 172 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int16Array#every (; 211 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - block $~lib/internal/typedarray/EVERY<~lib/typedarray/Int16Array,i16>|inlined.0 (result i32) + block $~lib/typedarray/EVERY<~lib/typedarray/Int16Array,i16>|inlined.0 (result i32) local.get $0 - i32.load offset=8 - i32.const 1 - i32.shr_u + call $~lib/rt/pure/__retain + local.tee $2 + i32.load offset=4 local.set $3 - local.get $0 - i32.load + i32.const 0 + local.set $0 + local.get $2 + call $~lib/typedarray/Int16Array#get:length local.set $4 - local.get $0 - i32.load offset=4 - local.set $5 loop $repeat|0 block $break|0 - local.get $2 - local.get $3 + local.get $0 + local.get $4 i32.ge_s br_if $break|0 i32.const 3 global.set $~lib/argc - local.get $2 + local.get $0 i32.const 1 i32.shl - local.get $4 - i32.add - local.get $5 + local.get $3 i32.add - i32.load16_s offset=8 - local.get $2 + i32.load16_s local.get $0 + local.get $2 local.get $1 call_indirect (type $FUNCSIG$iiii) i32.eqz if + local.get $2 + call $~lib/rt/pure/__release i32.const 0 - br $~lib/internal/typedarray/EVERY<~lib/typedarray/Int16Array,i16>|inlined.0 + br $~lib/typedarray/EVERY<~lib/typedarray/Int16Array,i16>|inlined.0 end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $repeat|0 end end + local.get $2 + call $~lib/rt/pure/__release i32.const 1 end ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Int16Array,i16> (; 173 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Int16Array,i16> (; 212 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 call $~lib/typedarray/Int16Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int16Array#__set local.get $0 i32.const 1 i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int16Array#__set local.get $0 i32.const 2 i32.const 6 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int16Array#__set local.get $0 i32.const 85 call $~lib/typedarray/Int16Array#every i32.eqz if i32.const 0 - i32.const 8 - i32.const 395 + i32.const 24 + i32.const 406 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -7287,91 +9472,98 @@ call $~lib/typedarray/Int16Array#every if i32.const 0 - i32.const 8 - i32.const 398 + i32.const 24 + i32.const 409 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint16Array#every (; 174 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint16Array#every (; 213 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - block $~lib/internal/typedarray/EVERY<~lib/typedarray/Uint16Array,u16>|inlined.0 (result i32) + block $~lib/typedarray/EVERY<~lib/typedarray/Uint16Array,u16>|inlined.0 (result i32) local.get $0 - i32.load offset=8 - i32.const 1 - i32.shr_u + call $~lib/rt/pure/__retain + local.tee $2 + i32.load offset=4 local.set $3 - local.get $0 - i32.load + i32.const 0 + local.set $0 + local.get $2 + call $~lib/typedarray/Int16Array#get:length local.set $4 - local.get $0 - i32.load offset=4 - local.set $5 loop $repeat|0 block $break|0 - local.get $2 - local.get $3 + local.get $0 + local.get $4 i32.ge_s br_if $break|0 i32.const 3 global.set $~lib/argc - local.get $2 + local.get $0 i32.const 1 i32.shl - local.get $4 - i32.add - local.get $5 + local.get $3 i32.add - i32.load16_u offset=8 - local.get $2 + i32.load16_u local.get $0 + local.get $2 local.get $1 call_indirect (type $FUNCSIG$iiii) i32.eqz if + local.get $2 + call $~lib/rt/pure/__release i32.const 0 - br $~lib/internal/typedarray/EVERY<~lib/typedarray/Uint16Array,u16>|inlined.0 + br $~lib/typedarray/EVERY<~lib/typedarray/Uint16Array,u16>|inlined.0 end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $repeat|0 end end + local.get $2 + call $~lib/rt/pure/__release i32.const 1 end ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint16Array,u16> (; 175 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint16Array,u16> (; 214 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 - call $~lib/typedarray/Int16Array#constructor + call $~lib/typedarray/Uint16Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint16Array#__set local.get $0 i32.const 1 i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint16Array#__set local.get $0 i32.const 2 i32.const 6 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint16Array#__set local.get $0 i32.const 87 call $~lib/typedarray/Uint16Array#every i32.eqz if i32.const 0 - i32.const 8 - i32.const 395 + i32.const 24 + i32.const 406 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -7379,97 +9571,111 @@ call $~lib/typedarray/Uint16Array#every if i32.const 0 - i32.const 8 - i32.const 398 + i32.const 24 + i32.const 409 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Int32Array,i32>~anonymous|0 (; 176 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Int32Array,i32>~anonymous|0 (; 215 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 i32.const 2 i32.rem_s i32.eqz + local.set $0 + local.get $2 + call $~lib/rt/pure/__release + local.get $0 ) - (func $~lib/typedarray/Int32Array#every (; 177 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int32Array#every (; 216 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - block $~lib/internal/typedarray/EVERY<~lib/typedarray/Int32Array,i32>|inlined.0 (result i32) + block $~lib/typedarray/EVERY<~lib/typedarray/Int32Array,i32>|inlined.0 (result i32) local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u + call $~lib/rt/pure/__retain + local.tee $2 + i32.load offset=4 local.set $3 - local.get $0 - i32.load + i32.const 0 + local.set $0 + local.get $2 + call $~lib/typedarray/Int32Array#get:length local.set $4 - local.get $0 - i32.load offset=4 - local.set $5 loop $repeat|0 block $break|0 - local.get $2 - local.get $3 + local.get $0 + local.get $4 i32.ge_s br_if $break|0 i32.const 3 global.set $~lib/argc - local.get $2 + local.get $0 i32.const 2 i32.shl - local.get $4 - i32.add - local.get $5 + local.get $3 i32.add - i32.load offset=8 - local.get $2 + i32.load local.get $0 + local.get $2 local.get $1 call_indirect (type $FUNCSIG$iiii) i32.eqz if + local.get $2 + call $~lib/rt/pure/__release i32.const 0 - br $~lib/internal/typedarray/EVERY<~lib/typedarray/Int32Array,i32>|inlined.0 + br $~lib/typedarray/EVERY<~lib/typedarray/Int32Array,i32>|inlined.0 end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $repeat|0 end end + local.get $2 + call $~lib/rt/pure/__release i32.const 1 end ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Int32Array,i32> (; 178 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Int32Array,i32> (; 217 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 call $~lib/typedarray/Int32Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int32Array#__set local.get $0 i32.const 1 i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int32Array#__set local.get $0 i32.const 2 i32.const 6 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int32Array#__set local.get $0 i32.const 89 call $~lib/typedarray/Int32Array#every i32.eqz if i32.const 0 - i32.const 8 - i32.const 395 + i32.const 24 + i32.const 406 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -7477,39 +9683,46 @@ call $~lib/typedarray/Int32Array#every if i32.const 0 - i32.const 8 - i32.const 398 + i32.const 24 + i32.const 409 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint32Array,u32> (; 179 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint32Array,u32> (; 218 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 - call $~lib/typedarray/Int32Array#constructor + call $~lib/typedarray/Uint32Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint32Array#__set local.get $0 i32.const 1 i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint32Array#__set local.get $0 i32.const 2 i32.const 6 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint32Array#__set local.get $0 i32.const 91 call $~lib/typedarray/Int32Array#every i32.eqz if i32.const 0 - i32.const 8 - i32.const 395 + i32.const 24 + i32.const 406 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -7517,98 +9730,112 @@ call $~lib/typedarray/Int32Array#every if i32.const 0 - i32.const 8 - i32.const 398 + i32.const 24 + i32.const 409 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Int64Array,i64>~anonymous|0 (; 180 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Int64Array,i64>~anonymous|0 (; 219 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 i64.const 2 i64.rem_s i64.const 0 i64.eq + local.set $1 + local.get $2 + call $~lib/rt/pure/__release + local.get $1 ) - (func $~lib/typedarray/Int64Array#every (; 181 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int64Array#every (; 220 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - block $~lib/internal/typedarray/EVERY<~lib/typedarray/Int64Array,i64>|inlined.0 (result i32) + block $~lib/typedarray/EVERY<~lib/typedarray/Int64Array,i64>|inlined.0 (result i32) local.get $0 - i32.load offset=8 - i32.const 3 - i32.shr_u + call $~lib/rt/pure/__retain + local.tee $2 + i32.load offset=4 local.set $3 - local.get $0 - i32.load + i32.const 0 + local.set $0 + local.get $2 + call $~lib/typedarray/Int64Array#get:length local.set $4 - local.get $0 - i32.load offset=4 - local.set $5 loop $repeat|0 block $break|0 - local.get $2 - local.get $3 + local.get $0 + local.get $4 i32.ge_s br_if $break|0 i32.const 3 global.set $~lib/argc - local.get $2 + local.get $0 i32.const 3 i32.shl - local.get $4 - i32.add - local.get $5 + local.get $3 i32.add - i64.load offset=8 - local.get $2 + i64.load local.get $0 + local.get $2 local.get $1 call_indirect (type $FUNCSIG$ijii) i32.eqz if + local.get $2 + call $~lib/rt/pure/__release i32.const 0 - br $~lib/internal/typedarray/EVERY<~lib/typedarray/Int64Array,i64>|inlined.0 + br $~lib/typedarray/EVERY<~lib/typedarray/Int64Array,i64>|inlined.0 end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $repeat|0 end end + local.get $2 + call $~lib/rt/pure/__release i32.const 1 end ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Int64Array,i64> (; 182 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Int64Array,i64> (; 221 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 call $~lib/typedarray/Int64Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i64.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int64Array#__set local.get $0 i32.const 1 i64.const 4 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int64Array#__set local.get $0 i32.const 2 i64.const 6 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int64Array#__set local.get $0 i32.const 93 call $~lib/typedarray/Int64Array#every i32.eqz if i32.const 0 - i32.const 8 - i32.const 395 + i32.const 24 + i32.const 406 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -7616,46 +9843,60 @@ call $~lib/typedarray/Int64Array#every if i32.const 0 - i32.const 8 - i32.const 398 + i32.const 24 + i32.const 409 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint64Array,u64>~anonymous|0 (; 183 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint64Array,u64>~anonymous|0 (; 222 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 i64.const 2 i64.rem_u i64.const 0 i64.eq + local.set $1 + local.get $2 + call $~lib/rt/pure/__release + local.get $1 ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint64Array,u64> (; 184 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint64Array,u64> (; 223 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 - call $~lib/typedarray/Int64Array#constructor + call $~lib/typedarray/Uint64Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 i64.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint64Array#__set local.get $0 i32.const 1 i64.const 4 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint64Array#__set local.get $0 i32.const 2 i64.const 6 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint64Array#__set local.get $0 i32.const 95 call $~lib/typedarray/Int64Array#every i32.eqz if i32.const 0 - i32.const 8 - i32.const 395 + i32.const 24 + i32.const 406 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -7663,36 +9904,38 @@ call $~lib/typedarray/Int64Array#every if i32.const 0 - i32.const 8 - i32.const 398 + i32.const 24 + i32.const 409 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/math/NativeMathf.mod (; 185 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.mod (; 224 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) local.get $0 i32.reinterpret_f32 - local.tee $3 - i32.const 23 - i32.shr_u - i32.const 255 - i32.and - local.set $2 - local.get $3 + local.tee $2 i32.const -2147483648 i32.and local.set $4 local.get $2 + i32.const 23 + i32.shr_u + i32.const 255 + i32.and + local.tee $3 i32.const 255 i32.eq - local.tee $1 if (result i32) - local.get $1 + i32.const 1 else i32.const 0 end @@ -7706,7 +9949,7 @@ return end block $folding-inner0 - local.get $3 + local.get $2 i32.const 1 i32.shl local.tee $1 @@ -7720,36 +9963,36 @@ local.get $0 return end - local.get $2 + local.get $3 if (result i32) - local.get $3 + local.get $2 i32.const 8388607 i32.and i32.const 8388608 i32.or else - local.get $3 - i32.const 1 local.get $2 + i32.const 1 local.get $3 + local.get $2 i32.const 9 i32.shl i32.clz i32.sub - local.tee $2 + local.tee $3 i32.sub i32.shl end local.set $1 loop $continue|0 - local.get $2 + local.get $3 i32.const 128 i32.gt_s if local.get $1 i32.const 8388608 i32.ge_u - if + if (result i32) local.get $1 i32.const 8388608 i32.eq @@ -7757,16 +10000,16 @@ local.get $1 i32.const 8388608 i32.sub - local.set $1 + else + local.get $1 end - local.get $1 i32.const 1 i32.shl local.set $1 - local.get $2 + local.get $3 i32.const 1 i32.sub - local.set $2 + local.set $3 br $continue|0 end end @@ -7788,27 +10031,27 @@ i32.const 8 i32.shl i32.clz - local.tee $3 + local.tee $1 i32.shl - local.set $1 - local.get $2 + local.set $2 local.get $3 + local.get $1 i32.sub - local.tee $2 + local.tee $1 i32.const 0 i32.gt_s if (result i32) - local.get $1 + local.get $2 i32.const 8388608 i32.sub - local.get $2 + local.get $1 i32.const 23 i32.shl i32.or else - local.get $1 - i32.const 1 local.get $2 + i32.const 1 + local.get $1 i32.sub i32.shr_u end @@ -7821,90 +10064,100 @@ local.get $0 f32.mul ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Float32Array,f32>~anonymous|0 (; 186 ;) (type $FUNCSIG$ifii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Float32Array,f32>~anonymous|0 (; 225 ;) (type $FUNCSIG$ifii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 call $~lib/math/NativeMathf.mod f32.const 0 f32.eq + local.set $1 + local.get $2 + call $~lib/rt/pure/__release + local.get $1 ) - (func $~lib/typedarray/Float32Array#every (; 187 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Float32Array#every (; 226 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - block $~lib/internal/typedarray/EVERY<~lib/typedarray/Float32Array,f32>|inlined.0 (result i32) + block $~lib/typedarray/EVERY<~lib/typedarray/Float32Array,f32>|inlined.0 (result i32) local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u + call $~lib/rt/pure/__retain + local.tee $2 + i32.load offset=4 local.set $3 - local.get $0 - i32.load + i32.const 0 + local.set $0 + local.get $2 + call $~lib/typedarray/Int32Array#get:length local.set $4 - local.get $0 - i32.load offset=4 - local.set $5 loop $repeat|0 block $break|0 - local.get $2 - local.get $3 + local.get $0 + local.get $4 i32.ge_s br_if $break|0 i32.const 3 global.set $~lib/argc - local.get $2 + local.get $0 i32.const 2 i32.shl - local.get $4 - i32.add - local.get $5 + local.get $3 i32.add - f32.load offset=8 - local.get $2 + f32.load local.get $0 + local.get $2 local.get $1 call_indirect (type $FUNCSIG$ifii) i32.eqz if + local.get $2 + call $~lib/rt/pure/__release i32.const 0 - br $~lib/internal/typedarray/EVERY<~lib/typedarray/Float32Array,f32>|inlined.0 + br $~lib/typedarray/EVERY<~lib/typedarray/Float32Array,f32>|inlined.0 end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $repeat|0 end end + local.get $2 + call $~lib/rt/pure/__release i32.const 1 end ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Float32Array,f32> (; 188 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Float32Array,f32> (; 227 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 3 - call $~lib/typedarray/Int32Array#constructor + call $~lib/typedarray/Float32Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 i32.const 0 f32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Float32Array#__set local.get $0 i32.const 1 f32.const 4 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Float32Array#__set local.get $0 i32.const 2 f32.const 6 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Float32Array#__set local.get $0 i32.const 97 call $~lib/typedarray/Float32Array#every i32.eqz if i32.const 0 - i32.const 8 - i32.const 395 + i32.const 24 + i32.const 406 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 @@ -7912,37 +10165,38 @@ call $~lib/typedarray/Float32Array#every if i32.const 0 - i32.const 8 - i32.const 398 + i32.const 24 + i32.const 409 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/math/NativeMath.mod (; 189 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.mod (; 228 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i64) (local $2 i64) (local $3 i64) (local $4 i64) - (local $5 i32) local.get $0 i64.reinterpret_f64 - local.tee $1 - i64.const 52 - i64.shr_u - i64.const 2047 - i64.and - local.set $2 - local.get $1 + local.tee $2 i64.const 63 i64.shr_u local.set $4 local.get $2 + i64.const 52 + i64.shr_u + i64.const 2047 + i64.and + local.tee $3 i64.const 2047 i64.eq - local.tee $5 if (result i32) - local.get $5 + i32.const 1 else i32.const 0 end @@ -7956,38 +10210,38 @@ return end block $folding-inner0 - local.get $1 + local.get $2 i64.const 1 i64.shl - local.tee $3 + local.tee $1 i64.const -9223372036854775808 i64.le_u if - local.get $3 + local.get $1 i64.const -9223372036854775808 i64.eq br_if $folding-inner0 local.get $0 return end - local.get $2 + local.get $3 i64.eqz if (result i64) - local.get $1 + local.get $2 i64.const 0 + local.get $3 local.get $2 - local.get $1 i64.const 12 i64.shl i64.clz i64.sub - local.tee $2 + local.tee $3 i64.sub i64.const 1 i64.add i64.shl else - local.get $1 + local.get $2 i64.const 4503599627370495 i64.and i64.const 4503599627370496 @@ -7995,14 +10249,14 @@ end local.set $1 loop $continue|0 - local.get $2 + local.get $3 i64.const 1024 i64.gt_s if local.get $1 i64.const 4503599627370496 i64.ge_u - if + if (result i64) local.get $1 i64.const 4503599627370496 i64.eq @@ -8010,16 +10264,16 @@ local.get $1 i64.const 4503599627370496 i64.sub - local.set $1 + else + local.get $1 end - local.get $1 i64.const 1 i64.shl local.set $1 - local.get $2 + local.get $3 i64.const 1 i64.sub - local.set $2 + local.set $3 br $continue|0 end end @@ -8041,27 +10295,27 @@ i64.const 11 i64.shl i64.clz - local.tee $3 + local.tee $1 i64.shl - local.set $1 - local.get $2 + local.set $2 local.get $3 + local.get $1 i64.sub - local.tee $2 + local.tee $1 i64.const 0 i64.gt_s if (result i64) - local.get $1 + local.get $2 i64.const 4503599627370496 i64.sub - local.get $2 + local.get $1 i64.const 52 i64.shl i64.or else - local.get $1 - i64.const 0 local.get $2 + i64.const 0 + local.get $1 i64.sub i64.const 1 i64.add @@ -8078,1847 +10332,2208 @@ local.get $0 f64.mul ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Float64Array,f64>~anonymous|0 (; 190 ;) (type $FUNCSIG$idii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Float64Array,f64>~anonymous|0 (; 229 ;) (type $FUNCSIG$idii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 call $~lib/math/NativeMath.mod f64.const 0 f64.eq + local.set $1 + local.get $2 + call $~lib/rt/pure/__release + local.get $1 ) - (func $~lib/typedarray/Float64Array#every (; 191 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Float64Array#every (; 230 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - block $~lib/internal/typedarray/EVERY<~lib/typedarray/Float64Array,f64>|inlined.0 (result i32) + block $~lib/typedarray/EVERY<~lib/typedarray/Float64Array,f64>|inlined.0 (result i32) local.get $0 - i32.load offset=8 - i32.const 3 - i32.shr_u + call $~lib/rt/pure/__retain + local.tee $2 + i32.load offset=4 local.set $3 - local.get $0 - i32.load + i32.const 0 + local.set $0 + local.get $2 + call $~lib/typedarray/Int64Array#get:length local.set $4 - local.get $0 - i32.load offset=4 - local.set $5 loop $repeat|0 block $break|0 - local.get $2 - local.get $3 + local.get $0 + local.get $4 i32.ge_s br_if $break|0 i32.const 3 global.set $~lib/argc - local.get $2 + local.get $0 i32.const 3 i32.shl - local.get $4 - i32.add - local.get $5 + local.get $3 i32.add - f64.load offset=8 - local.get $2 + f64.load local.get $0 + local.get $2 local.get $1 call_indirect (type $FUNCSIG$idii) i32.eqz if + local.get $2 + call $~lib/rt/pure/__release i32.const 0 - br $~lib/internal/typedarray/EVERY<~lib/typedarray/Float64Array,f64>|inlined.0 + br $~lib/typedarray/EVERY<~lib/typedarray/Float64Array,f64>|inlined.0 end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $repeat|0 end end - i32.const 1 + local.get $2 + call $~lib/rt/pure/__release + i32.const 1 + end + ) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Float64Array,f64> (; 231 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 3 + call $~lib/typedarray/Float64Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + f64.const 2 + call $~lib/typedarray/Float64Array#__set + local.get $0 + i32.const 1 + f64.const 4 + call $~lib/typedarray/Float64Array#__set + local.get $0 + i32.const 2 + f64.const 6 + call $~lib/typedarray/Float64Array#__set + local.get $0 + i32.const 99 + call $~lib/typedarray/Float64Array#every + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 406 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 100 + call $~lib/typedarray/Float64Array#every + if + i32.const 0 + i32.const 24 + i32.const 409 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + ) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Int8Array,i8>~anonymous|0 (; 232 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.const 255 + i32.and + global.get $std/typedarray/forEachValues + local.get $1 + call $~lib/array/Array#__get + i32.const 255 + i32.and + i32.ne + if + i32.const 1144 + i32.const 24 + i32.const 436 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $1 + global.get $std/typedarray/forEachCallCount + i32.ne + if + i32.const 1208 + i32.const 24 + i32.const 437 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $2 + global.get $std/typedarray/forEachSelf + i32.ne + if + i32.const 1272 + i32.const 24 + i32.const 438 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + global.get $std/typedarray/forEachCallCount + i32.const 1 + i32.add + global.set $std/typedarray/forEachCallCount + local.get $2 + call $~lib/rt/pure/__release + ) + (func $~lib/typedarray/Int8Array#forEach (; 233 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + call $~lib/rt/pure/__retain + local.tee $1 + i32.load offset=4 + local.set $2 + i32.const 0 + local.set $0 + local.get $1 + i32.load offset=8 + local.set $3 + loop $repeat|0 + local.get $0 + local.get $3 + i32.lt_s + if + i32.const 3 + global.set $~lib/argc + local.get $0 + local.get $2 + i32.add + i32.load8_s + local.get $0 + local.get $1 + call $std/typedarray/testArrayForEach<~lib/typedarray/Int8Array,i8>~anonymous|0 + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + end + local.get $1 + call $~lib/rt/pure/__release + ) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Int8Array,i8> (; 234 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 3 + call $~lib/typedarray/Int8Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + global.set $std/typedarray/forEachSelf + local.get $0 + i32.const 0 + global.get $std/typedarray/forEachValues + i32.const 0 + call $~lib/array/Array#__get + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + call $~lib/typedarray/Int8Array#__set + local.get $0 + i32.const 1 + global.get $std/typedarray/forEachValues + i32.const 1 + call $~lib/array/Array#__get + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + call $~lib/typedarray/Int8Array#__set + local.get $0 + i32.const 2 + global.get $std/typedarray/forEachValues + i32.const 2 + call $~lib/array/Array#__get + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + call $~lib/typedarray/Int8Array#__set + local.get $0 + call $~lib/typedarray/Int8Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.ne + if + i32.const 1352 + i32.const 24 + i32.const 441 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + ) + (func $~lib/typedarray/Uint8Array#forEach (; 235 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + call $~lib/rt/pure/__retain + local.tee $2 + i32.load offset=4 + local.set $3 + i32.const 0 + local.set $0 + local.get $2 + i32.load offset=8 + local.set $4 + loop $repeat|0 + local.get $0 + local.get $4 + i32.lt_s + if + i32.const 3 + global.set $~lib/argc + local.get $0 + local.get $3 + i32.add + i32.load8_u + local.get $0 + local.get $2 + local.get $1 + call_indirect (type $FUNCSIG$viii) + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end end + local.get $2 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Float64Array,f64> (; 192 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint8Array,u8> (; 236 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) + i32.const 0 + global.set $std/typedarray/forEachCallCount i32.const 3 - call $~lib/typedarray/Int64Array#constructor + call $~lib/typedarray/Uint8Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain local.tee $0 + global.set $std/typedarray/forEachSelf + local.get $0 i32.const 0 - f64.const 2 - call $~lib/internal/typedarray/TypedArray#__set + global.get $std/typedarray/forEachValues + i32.const 0 + call $~lib/array/Array#__get + i32.const 255 + i32.and + call $~lib/typedarray/Uint8Array#__set local.get $0 i32.const 1 - f64.const 4 - call $~lib/internal/typedarray/TypedArray#__set + global.get $std/typedarray/forEachValues + i32.const 1 + call $~lib/array/Array#__get + i32.const 255 + i32.and + call $~lib/typedarray/Uint8Array#__set local.get $0 i32.const 2 - f64.const 6 - call $~lib/internal/typedarray/TypedArray#__set + global.get $std/typedarray/forEachValues + i32.const 2 + call $~lib/array/Array#__get + i32.const 255 + i32.and + call $~lib/typedarray/Uint8Array#__set local.get $0 - i32.const 99 - call $~lib/typedarray/Float64Array#every - i32.eqz + i32.const 102 + call $~lib/typedarray/Uint8Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.ne if - i32.const 0 - i32.const 8 - i32.const 395 + i32.const 1352 + i32.const 24 + i32.const 441 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release local.get $0 - i32.const 100 - call $~lib/typedarray/Float64Array#every - if - i32.const 0 - i32.const 8 - i32.const 398 - i32.const 2 - call $~lib/env/abort - unreachable - end + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Int8Array,i8>~anonymous|0 (; 193 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint8ClampedArray,u8> (; 237 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 3 + call $~lib/typedarray/Uint8ClampedArray#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + global.set $std/typedarray/forEachSelf local.get $0 + i32.const 0 + global.get $std/typedarray/forEachValues + i32.const 0 + call $~lib/array/Array#__get i32.const 255 i32.and - local.get $1 + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $0 + i32.const 1 global.get $std/typedarray/forEachValues - i32.load - local.tee $0 - i32.load + i32.const 1 + call $~lib/array/Array#__get + i32.const 255 + i32.and + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $0 i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $1 + global.get $std/typedarray/forEachValues + i32.const 2 + call $~lib/array/Array#__get + i32.const 255 + i32.and + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $0 + i32.const 103 + call $~lib/typedarray/Uint8Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.ne + if + i32.const 1352 + i32.const 24 + i32.const 441 i32.const 2 - i32.shl - local.get $0 - i32.add - i32.load offset=8 - else + call $~lib/builtins/abort unreachable end - i32.const 255 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + ) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Int16Array,i16>~anonymous|0 (; 238 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.const 65535 + i32.and + global.get $std/typedarray/forEachValues + local.get $1 + call $~lib/array/Array#__get + i32.const 65535 i32.and i32.ne if - i32.const 752 - i32.const 8 - i32.const 425 + i32.const 1144 + i32.const 24 + i32.const 436 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/forEachCallCount local.get $1 + global.get $std/typedarray/forEachCallCount i32.ne if - i32.const 800 - i32.const 8 - i32.const 426 + i32.const 1208 + i32.const 24 + i32.const 437 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/forEachSelf local.get $2 + global.get $std/typedarray/forEachSelf i32.ne if - i32.const 848 - i32.const 8 - i32.const 427 + i32.const 1272 + i32.const 24 + i32.const 438 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/typedarray/forEachCallCount i32.const 1 i32.add global.set $std/typedarray/forEachCallCount + local.get $2 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int8Array#forEach (; 194 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/typedarray/Int16Array#forEach (; 239 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) - (local $4 i32) local.get $0 - i32.load offset=8 + call $~lib/rt/pure/__retain + local.tee $1 + i32.load offset=4 local.set $2 - local.get $0 - i32.load + i32.const 0 + local.set $0 + local.get $1 + call $~lib/typedarray/Int16Array#get:length local.set $3 - local.get $0 - i32.load offset=4 - local.set $4 loop $repeat|0 - local.get $1 - local.get $2 + local.get $0 + local.get $3 i32.lt_s if i32.const 3 global.set $~lib/argc - local.get $1 - local.get $3 - i32.add - local.get $4 + local.get $0 + i32.const 1 + i32.shl + local.get $2 i32.add - i32.load8_s offset=8 - local.get $1 + i32.load16_s local.get $0 - i32.const 101 - call_indirect (type $FUNCSIG$viii) local.get $1 + call $std/typedarray/testArrayForEach<~lib/typedarray/Int16Array,i16>~anonymous|0 + local.get $0 i32.const 1 i32.add - local.set $1 + local.set $0 br $repeat|0 end end + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Int8Array,i8> (; 195 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Int16Array,i16> (; 240 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 global.set $std/typedarray/forEachCallCount - i32.const 0 i32.const 3 - call $~lib/typedarray/Int8Array#constructor + call $~lib/typedarray/Int16Array#constructor local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 global.set $std/typedarray/forEachSelf - local.get $1 + local.get $0 i32.const 0 + global.get $std/typedarray/forEachValues i32.const 0 + call $~lib/array/Array#__get + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + call $~lib/typedarray/Int16Array#__set + local.get $0 + i32.const 1 global.get $std/typedarray/forEachValues - i32.load - local.tee $0 - i32.load + i32.const 1 + call $~lib/array/Array#__get + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + call $~lib/typedarray/Int16Array#__set + local.get $0 i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end - i32.const 24 + global.get $std/typedarray/forEachValues + i32.const 2 + call $~lib/array/Array#__get + i32.const 16 i32.shl - i32.const 24 + i32.const 16 i32.shr_s - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int16Array#__set + local.get $0 + call $~lib/typedarray/Int16Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.ne + if + i32.const 1352 + i32.const 24 + i32.const 441 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + ) + (func $~lib/typedarray/Uint16Array#forEach (; 241 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + call $~lib/rt/pure/__retain + local.tee $1 + i32.load offset=4 + local.set $2 + i32.const 0 + local.set $0 + local.get $1 + call $~lib/typedarray/Int16Array#get:length + local.set $3 + loop $repeat|0 + local.get $0 + local.get $3 + i32.lt_s + if + i32.const 3 + global.set $~lib/argc + local.get $0 + i32.const 1 + i32.shl + local.get $2 + i32.add + i32.load16_u + local.get $0 + local.get $1 + call $std/typedarray/testArrayForEach<~lib/typedarray/Int16Array,i16>~anonymous|0 + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + end local.get $1 + call $~lib/rt/pure/__release + ) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint16Array,u16> (; 242 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 3 + call $~lib/typedarray/Uint16Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + global.set $std/typedarray/forEachSelf + local.get $0 + i32.const 0 + global.get $std/typedarray/forEachValues + i32.const 0 + call $~lib/array/Array#__get + i32.const 65535 + i32.and + call $~lib/typedarray/Uint16Array#__set + local.get $0 i32.const 1 + global.get $std/typedarray/forEachValues i32.const 1 + call $~lib/array/Array#__get + i32.const 65535 + i32.and + call $~lib/typedarray/Uint16Array#__set + local.get $0 + i32.const 2 global.get $std/typedarray/forEachValues - i32.load - local.tee $0 - i32.load i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else + call $~lib/array/Array#__get + i32.const 65535 + i32.and + call $~lib/typedarray/Uint16Array#__set + local.get $0 + call $~lib/typedarray/Uint16Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.ne + if + i32.const 1352 + i32.const 24 + i32.const 441 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/internal/typedarray/TypedArray#__set local.get $1 - i32.const 2 - i32.const 2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + ) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Int32Array,i32>~anonymous|0 (; 243 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop global.get $std/typedarray/forEachValues - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 8 - i32.add - i32.load offset=8 - else + local.get $1 + call $~lib/array/Array#__get + local.get $0 + i32.ne + if + i32.const 1144 + i32.const 24 + i32.const 436 + i32.const 4 + call $~lib/builtins/abort unreachable end - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/internal/typedarray/TypedArray#__set local.get $1 - call $~lib/typedarray/Int8Array#forEach global.get $std/typedarray/forEachCallCount - i32.const 3 i32.ne if - i32.const 920 - i32.const 8 - i32.const 430 - i32.const 2 - call $~lib/env/abort + i32.const 1208 + i32.const 24 + i32.const 437 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $2 + global.get $std/typedarray/forEachSelf + i32.ne + if + i32.const 1272 + i32.const 24 + i32.const 438 + i32.const 4 + call $~lib/builtins/abort unreachable end + global.get $std/typedarray/forEachCallCount + i32.const 1 + i32.add + global.set $std/typedarray/forEachCallCount + local.get $2 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint8Array#forEach (; 196 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/typedarray/Int32Array#forEach (; 244 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) local.get $0 - i32.load offset=8 + call $~lib/rt/pure/__retain + local.tee $2 + i32.load offset=4 local.set $3 - local.get $0 - i32.load + i32.const 0 + local.set $0 + local.get $2 + call $~lib/typedarray/Int32Array#get:length local.set $4 - local.get $0 - i32.load offset=4 - local.set $5 loop $repeat|0 block $break|0 - local.get $2 - local.get $3 + local.get $0 + local.get $4 i32.ge_s br_if $break|0 i32.const 3 global.set $~lib/argc - local.get $2 - local.get $4 - i32.add - local.get $5 + local.get $0 + i32.const 2 + i32.shl + local.get $3 i32.add - i32.load8_u offset=8 - local.get $2 + i32.load local.get $0 + local.get $2 local.get $1 call_indirect (type $FUNCSIG$viii) - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $repeat|0 end end + local.get $2 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint8Array,u8> (; 197 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Int32Array,i32> (; 245 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 global.set $std/typedarray/forEachCallCount - i32.const 0 i32.const 3 - call $~lib/typedarray/Int8Array#constructor + call $~lib/typedarray/Int32Array#constructor local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 global.set $std/typedarray/forEachSelf - local.get $1 - i32.const 0 + local.get $0 i32.const 0 global.get $std/typedarray/forEachValues - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end - i32.const 255 - i32.and - call $~lib/internal/typedarray/TypedArray#__set - local.get $1 - i32.const 1 + i32.const 0 + call $~lib/array/Array#__get + call $~lib/typedarray/Int32Array#__set + local.get $0 i32.const 1 global.get $std/typedarray/forEachValues - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 255 - i32.and - call $~lib/internal/typedarray/TypedArray#__set - local.get $1 - i32.const 2 + i32.const 1 + call $~lib/array/Array#__get + call $~lib/typedarray/Int32Array#__set + local.get $0 i32.const 2 global.get $std/typedarray/forEachValues - i32.load - local.tee $0 - i32.load i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 8 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 255 - i32.and - call $~lib/internal/typedarray/TypedArray#__set - local.get $1 - i32.const 102 - call $~lib/typedarray/Uint8Array#forEach + call $~lib/array/Array#__get + call $~lib/typedarray/Int32Array#__set + local.get $0 + i32.const 106 + call $~lib/typedarray/Int32Array#forEach global.get $std/typedarray/forEachCallCount i32.const 3 i32.ne if - i32.const 920 - i32.const 8 - i32.const 430 + i32.const 1352 + i32.const 24 + i32.const 441 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint8ClampedArray,u8> (; 198 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint32Array,u32> (; 246 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 global.set $std/typedarray/forEachCallCount i32.const 3 - call $~lib/typedarray/Uint8ClampedArray#constructor + call $~lib/typedarray/Uint32Array#constructor local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 global.set $std/typedarray/forEachSelf - local.get $1 - i32.const 0 + local.get $0 i32.const 0 global.get $std/typedarray/forEachValues - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end - i32.const 255 - i32.and - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $1 - i32.const 1 + i32.const 0 + call $~lib/array/Array#__get + call $~lib/typedarray/Uint32Array#__set + local.get $0 i32.const 1 global.get $std/typedarray/forEachValues - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 255 - i32.and - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $1 - i32.const 2 + i32.const 1 + call $~lib/array/Array#__get + call $~lib/typedarray/Uint32Array#__set + local.get $0 i32.const 2 global.get $std/typedarray/forEachValues - i32.load - local.tee $0 - i32.load i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 8 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 255 - i32.and - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $1 - i32.const 103 - call $~lib/typedarray/Uint8Array#forEach + call $~lib/array/Array#__get + call $~lib/typedarray/Uint32Array#__set + local.get $0 + i32.const 107 + call $~lib/typedarray/Int32Array#forEach global.get $std/typedarray/forEachCallCount i32.const 3 i32.ne if - i32.const 920 - i32.const 8 - i32.const 430 + i32.const 1352 + i32.const 24 + i32.const 441 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Int16Array,i16>~anonymous|0 (; 199 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Int64Array,i64>~anonymous|0 (; 247 ;) (type $FUNCSIG$vjii) (param $0 i64) (param $1 i32) (param $2 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 65535 - i32.and - local.get $1 global.get $std/typedarray/forEachValues - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $1 - i32.const 2 - i32.shl - local.get $0 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 65535 - i32.and - i32.ne + local.get $1 + call $~lib/array/Array#__get + i64.extend_i32_s + i64.ne if - i32.const 752 - i32.const 8 - i32.const 425 + i32.const 1144 + i32.const 24 + i32.const 436 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/forEachCallCount local.get $1 + global.get $std/typedarray/forEachCallCount i32.ne if - i32.const 800 - i32.const 8 - i32.const 426 + i32.const 1208 + i32.const 24 + i32.const 437 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/forEachSelf local.get $2 + global.get $std/typedarray/forEachSelf i32.ne if - i32.const 848 - i32.const 8 - i32.const 427 + i32.const 1272 + i32.const 24 + i32.const 438 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/typedarray/forEachCallCount i32.const 1 i32.add global.set $std/typedarray/forEachCallCount + local.get $2 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int16Array#forEach (; 200 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) + (func $~lib/typedarray/Int64Array#forEach (; 248 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) local.get $0 - i32.load offset=8 - i32.const 1 - i32.shr_u - local.set $2 - local.get $0 - i32.load - local.set $3 - local.get $0 + call $~lib/rt/pure/__retain + local.tee $2 i32.load offset=4 + local.set $3 + i32.const 0 + local.set $0 + local.get $2 + call $~lib/typedarray/Int64Array#get:length local.set $4 loop $repeat|0 - local.get $1 - local.get $2 - i32.lt_s - if + block $break|0 + local.get $0 + local.get $4 + i32.ge_s + br_if $break|0 i32.const 3 global.set $~lib/argc - local.get $1 - i32.const 1 + local.get $0 + i32.const 3 i32.shl local.get $3 i32.add - local.get $4 - i32.add - i32.load16_s offset=8 - local.get $1 + i64.load local.get $0 - i32.const 104 - call_indirect (type $FUNCSIG$viii) + local.get $2 local.get $1 + call_indirect (type $FUNCSIG$vjii) + local.get $0 i32.const 1 i32.add - local.set $1 + local.set $0 br $repeat|0 end end + local.get $2 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Int16Array,i16> (; 201 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Int64Array,i64> (; 249 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 global.set $std/typedarray/forEachCallCount i32.const 3 - call $~lib/typedarray/Int16Array#constructor + call $~lib/typedarray/Int64Array#constructor local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 global.set $std/typedarray/forEachSelf - local.get $1 - i32.const 0 + local.get $0 i32.const 0 global.get $std/typedarray/forEachValues - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $1 - i32.const 1 + i32.const 0 + call $~lib/array/Array#__get + i64.extend_i32_s + call $~lib/typedarray/Int64Array#__set + local.get $0 i32.const 1 global.get $std/typedarray/forEachValues - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $1 - i32.const 2 + i32.const 1 + call $~lib/array/Array#__get + i64.extend_i32_s + call $~lib/typedarray/Int64Array#__set + local.get $0 i32.const 2 global.get $std/typedarray/forEachValues - i32.load - local.tee $0 - i32.load i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 8 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $1 - call $~lib/typedarray/Int16Array#forEach + call $~lib/array/Array#__get + i64.extend_i32_s + call $~lib/typedarray/Int64Array#__set + local.get $0 + i32.const 108 + call $~lib/typedarray/Int64Array#forEach global.get $std/typedarray/forEachCallCount i32.const 3 i32.ne if - i32.const 920 - i32.const 8 - i32.const 430 + i32.const 1352 + i32.const 24 + i32.const 441 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - ) - (func $~lib/typedarray/Uint16Array#forEach (; 202 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - local.get $0 - i32.load offset=8 - i32.const 1 - i32.shr_u - local.set $2 - local.get $0 - i32.load - local.set $3 + local.get $1 + call $~lib/rt/pure/__release local.get $0 - i32.load offset=4 - local.set $4 - loop $repeat|0 - local.get $1 - local.get $2 - i32.lt_s - if - i32.const 3 - global.set $~lib/argc - local.get $1 - i32.const 1 - i32.shl - local.get $3 - i32.add - local.get $4 - i32.add - i32.load16_u offset=8 - local.get $1 - local.get $0 - i32.const 105 - call_indirect (type $FUNCSIG$viii) - local.get $1 - i32.const 1 - i32.add - local.set $1 - br $repeat|0 - end - end + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint16Array,u16> (; 203 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint64Array,u64> (; 250 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 global.set $std/typedarray/forEachCallCount i32.const 3 - call $~lib/typedarray/Int16Array#constructor + call $~lib/typedarray/Uint64Array#constructor local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 global.set $std/typedarray/forEachSelf - local.get $1 - i32.const 0 + local.get $0 i32.const 0 global.get $std/typedarray/forEachValues - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end - i32.const 65535 - i32.and - call $~lib/internal/typedarray/TypedArray#__set - local.get $1 - i32.const 1 + i32.const 0 + call $~lib/array/Array#__get + i64.extend_i32_s + call $~lib/typedarray/Uint64Array#__set + local.get $0 i32.const 1 global.get $std/typedarray/forEachValues - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 65535 - i32.and - call $~lib/internal/typedarray/TypedArray#__set - local.get $1 - i32.const 2 + i32.const 1 + call $~lib/array/Array#__get + i64.extend_i32_s + call $~lib/typedarray/Uint64Array#__set + local.get $0 i32.const 2 global.get $std/typedarray/forEachValues - i32.load - local.tee $0 - i32.load i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 8 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 65535 - i32.and - call $~lib/internal/typedarray/TypedArray#__set - local.get $1 - call $~lib/typedarray/Uint16Array#forEach + call $~lib/array/Array#__get + i64.extend_i32_s + call $~lib/typedarray/Uint64Array#__set + local.get $0 + i32.const 109 + call $~lib/typedarray/Int64Array#forEach global.get $std/typedarray/forEachCallCount i32.const 3 i32.ne if - i32.const 920 - i32.const 8 - i32.const 430 + i32.const 1352 + i32.const 24 + i32.const 441 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Int32Array,i32>~anonymous|0 (; 204 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Float32Array,f32>~anonymous|0 (; 251 ;) (type $FUNCSIG$vfii) (param $0 f32) (param $1 i32) (param $2 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - local.get $1 global.get $std/typedarray/forEachValues - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $1 - i32.const 2 - i32.shl - local.get $0 - i32.add - i32.load offset=8 - else - unreachable - end - i32.ne + local.get $1 + call $~lib/array/Array#__get + f32.convert_i32_s + f32.ne if - i32.const 752 - i32.const 8 - i32.const 425 + i32.const 1144 + i32.const 24 + i32.const 436 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/forEachCallCount local.get $1 + global.get $std/typedarray/forEachCallCount i32.ne if - i32.const 800 - i32.const 8 - i32.const 426 + i32.const 1208 + i32.const 24 + i32.const 437 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/forEachSelf local.get $2 + global.get $std/typedarray/forEachSelf i32.ne if - i32.const 848 - i32.const 8 - i32.const 427 + i32.const 1272 + i32.const 24 + i32.const 438 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/typedarray/forEachCallCount i32.const 1 i32.add global.set $std/typedarray/forEachCallCount + local.get $2 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int32Array#forEach (; 205 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/typedarray/Float32Array#forEach (; 252 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) (local $2 i32) (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u - local.set $3 - local.get $0 - i32.load - local.set $4 local.get $0 + call $~lib/rt/pure/__retain + local.tee $1 i32.load offset=4 - local.set $5 + local.set $2 + i32.const 0 + local.set $0 + local.get $1 + call $~lib/typedarray/Int32Array#get:length + local.set $3 loop $repeat|0 - block $break|0 - local.get $2 - local.get $3 - i32.ge_s - br_if $break|0 + local.get $0 + local.get $3 + i32.lt_s + if i32.const 3 global.set $~lib/argc - local.get $2 + local.get $0 i32.const 2 i32.shl - local.get $4 - i32.add - local.get $5 - i32.add - i32.load offset=8 local.get $2 + i32.add + f32.load local.get $0 local.get $1 - call_indirect (type $FUNCSIG$viii) - local.get $2 + call $std/typedarray/testArrayForEach<~lib/typedarray/Float32Array,f32>~anonymous|0 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $repeat|0 end end - ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Int32Array,i32> (; 206 ;) (type $FUNCSIG$v) - (local $0 i32) - (local $1 i32) - i32.const 0 - global.set $std/typedarray/forEachCallCount - i32.const 3 - call $~lib/typedarray/Int32Array#constructor - local.tee $1 - global.set $std/typedarray/forEachSelf - local.get $1 - i32.const 0 - i32.const 0 - global.get $std/typedarray/forEachValues - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end - call $~lib/internal/typedarray/TypedArray#__set - local.get $1 - i32.const 1 - i32.const 1 - global.get $std/typedarray/forEachValues - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else - unreachable - end - call $~lib/internal/typedarray/TypedArray#__set - local.get $1 - i32.const 2 - i32.const 2 - global.get $std/typedarray/forEachValues - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 8 - i32.add - i32.load offset=8 - else - unreachable - end - call $~lib/internal/typedarray/TypedArray#__set local.get $1 - i32.const 106 - call $~lib/typedarray/Int32Array#forEach - global.get $std/typedarray/forEachCallCount - i32.const 3 - i32.ne - if - i32.const 920 - i32.const 8 - i32.const 430 - i32.const 2 - call $~lib/env/abort - unreachable - end + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint32Array,u32> (; 207 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Float32Array,f32> (; 253 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 global.set $std/typedarray/forEachCallCount i32.const 3 - call $~lib/typedarray/Int32Array#constructor + call $~lib/typedarray/Float32Array#constructor local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 global.set $std/typedarray/forEachSelf - local.get $1 - i32.const 0 + local.get $0 i32.const 0 global.get $std/typedarray/forEachValues - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end - call $~lib/internal/typedarray/TypedArray#__set - local.get $1 - i32.const 1 + i32.const 0 + call $~lib/array/Array#__get + f32.convert_i32_s + call $~lib/typedarray/Float32Array#__set + local.get $0 i32.const 1 global.get $std/typedarray/forEachValues - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else - unreachable - end - call $~lib/internal/typedarray/TypedArray#__set - local.get $1 - i32.const 2 + i32.const 1 + call $~lib/array/Array#__get + f32.convert_i32_s + call $~lib/typedarray/Float32Array#__set + local.get $0 i32.const 2 global.get $std/typedarray/forEachValues - i32.load - local.tee $0 - i32.load i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 8 - i32.add - i32.load offset=8 - else - unreachable - end - call $~lib/internal/typedarray/TypedArray#__set - local.get $1 - i32.const 107 - call $~lib/typedarray/Int32Array#forEach + call $~lib/array/Array#__get + f32.convert_i32_s + call $~lib/typedarray/Float32Array#__set + local.get $0 + call $~lib/typedarray/Float32Array#forEach global.get $std/typedarray/forEachCallCount i32.const 3 i32.ne if - i32.const 920 - i32.const 8 - i32.const 430 + i32.const 1352 + i32.const 24 + i32.const 441 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Int64Array,i64>~anonymous|0 (; 208 ;) (type $FUNCSIG$vjii) (param $0 i64) (param $1 i32) (param $2 i32) - (local $3 i32) local.get $1 - global.get $std/typedarray/forEachValues - i32.load - local.tee $3 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $1 - i32.const 2 - i32.shl - local.get $3 - i32.add - i32.load offset=8 - else - unreachable - end - i64.extend_i32_s + call $~lib/rt/pure/__release local.get $0 - i64.ne + call $~lib/rt/pure/__release + ) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Float64Array,f64>~anonymous|0 (; 254 ;) (type $FUNCSIG$vdii) (param $0 f64) (param $1 i32) (param $2 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $0 + global.get $std/typedarray/forEachValues + local.get $1 + call $~lib/array/Array#__get + f64.convert_i32_s + f64.ne if - i32.const 752 - i32.const 8 - i32.const 425 + i32.const 1144 + i32.const 24 + i32.const 436 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/forEachCallCount local.get $1 + global.get $std/typedarray/forEachCallCount i32.ne if - i32.const 800 - i32.const 8 - i32.const 426 + i32.const 1208 + i32.const 24 + i32.const 437 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/forEachSelf local.get $2 + global.get $std/typedarray/forEachSelf i32.ne if - i32.const 848 - i32.const 8 - i32.const 427 + i32.const 1272 + i32.const 24 + i32.const 438 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/typedarray/forEachCallCount i32.const 1 i32.add - global.set $std/typedarray/forEachCallCount - ) - (func $~lib/typedarray/Int64Array#forEach (; 209 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load offset=8 - i32.const 3 - i32.shr_u - local.set $3 - local.get $0 - i32.load - local.set $4 + global.set $std/typedarray/forEachCallCount + local.get $2 + call $~lib/rt/pure/__release + ) + (func $~lib/typedarray/Float64Array#forEach (; 255 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) local.get $0 + call $~lib/rt/pure/__retain + local.tee $1 i32.load offset=4 - local.set $5 + local.set $2 + i32.const 0 + local.set $0 + local.get $1 + call $~lib/typedarray/Int64Array#get:length + local.set $3 loop $repeat|0 - block $break|0 - local.get $2 - local.get $3 - i32.ge_s - br_if $break|0 + local.get $0 + local.get $3 + i32.lt_s + if i32.const 3 global.set $~lib/argc - local.get $2 + local.get $0 i32.const 3 i32.shl - local.get $4 - i32.add - local.get $5 - i32.add - i64.load offset=8 local.get $2 + i32.add + f64.load local.get $0 local.get $1 - call_indirect (type $FUNCSIG$vjii) - local.get $2 + call $std/typedarray/testArrayForEach<~lib/typedarray/Float64Array,f64>~anonymous|0 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $repeat|0 end end + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Int64Array,i64> (; 210 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Float64Array,f64> (; 256 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 global.set $std/typedarray/forEachCallCount i32.const 3 - call $~lib/typedarray/Int64Array#constructor + call $~lib/typedarray/Float64Array#constructor local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 global.set $std/typedarray/forEachSelf - local.get $1 - i32.const 0 + local.get $0 i32.const 0 global.get $std/typedarray/forEachValues - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end - i64.extend_i32_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $1 - i32.const 1 + i32.const 0 + call $~lib/array/Array#__get + f64.convert_i32_s + call $~lib/typedarray/Float64Array#__set + local.get $0 i32.const 1 global.get $std/typedarray/forEachValues - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else - unreachable - end - i64.extend_i32_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $1 - i32.const 2 + i32.const 1 + call $~lib/array/Array#__get + f64.convert_i32_s + call $~lib/typedarray/Float64Array#__set + local.get $0 i32.const 2 global.get $std/typedarray/forEachValues - i32.load - local.tee $0 - i32.load i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 8 - i32.add - i32.load offset=8 - else - unreachable - end - i64.extend_i32_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $1 - i32.const 108 - call $~lib/typedarray/Int64Array#forEach + call $~lib/array/Array#__get + f64.convert_i32_s + call $~lib/typedarray/Float64Array#__set + local.get $0 + call $~lib/typedarray/Float64Array#forEach global.get $std/typedarray/forEachCallCount i32.const 3 i32.ne if - i32.const 920 - i32.const 8 - i32.const 430 + i32.const 1352 + i32.const 24 + i32.const 441 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint64Array,u64> (; 211 ;) (type $FUNCSIG$v) - (local $0 i32) + (func $~lib/typedarray/Int8Array#reverse (; 257 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + call $~lib/rt/pure/__retain + local.tee $3 + i32.load offset=4 + local.set $4 i32.const 0 - global.set $std/typedarray/forEachCallCount - i32.const 3 - call $~lib/typedarray/Int64Array#constructor - local.tee $1 - global.set $std/typedarray/forEachSelf - local.get $1 - i32.const 0 - i32.const 0 - global.get $std/typedarray/forEachValues - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end - i64.extend_i32_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $1 - i32.const 1 + local.set $0 + local.get $3 + i32.load offset=8 i32.const 1 - global.get $std/typedarray/forEachValues - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) + i32.sub + local.set $1 + loop $repeat|0 local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else - unreachable + local.get $1 + i32.lt_s + if + local.get $0 + local.get $4 + i32.add + local.tee $2 + i32.load8_s + local.set $5 + local.get $2 + local.get $1 + local.get $4 + i32.add + local.tee $2 + i32.load8_s + i32.store8 + local.get $2 + local.get $5 + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.set $0 + local.get $1 + i32.const 1 + i32.sub + local.set $1 + br $repeat|0 + end + end + local.get $3 + ) + (func $std/typedarray/testArrayReverse<~lib/typedarray/Int8Array,i8> (; 258 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + global.get $std/typedarray/testArrayReverseValues + call $~lib/rt/pure/__retain + local.set $1 + i32.const 9 + call $~lib/typedarray/Int8Array#constructor + local.tee $4 + call $~lib/rt/pure/__retain + local.set $2 + i32.const 9 + call $~lib/typedarray/Int8Array#constructor + local.tee $5 + call $~lib/rt/pure/__retain + local.set $3 + loop $repeat|0 + block $break|0 + local.get $0 + i32.const 9 + i32.ge_s + br_if $break|0 + local.get $2 + local.get $0 + local.get $1 + local.get $0 + call $~lib/array/Array#__get + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + call $~lib/typedarray/Int8Array#__set + local.get $3 + local.get $0 + local.get $1 + local.get $0 + call $~lib/array/Array#__get + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + call $~lib/typedarray/Int8Array#__set + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + end + local.get $2 + call $~lib/typedarray/Int8Array#reverse + call $~lib/rt/pure/__release + i32.const 0 + local.set $0 + loop $repeat|1 + block $break|1 + local.get $0 + i32.const 9 + i32.ge_s + br_if $break|1 + local.get $2 + local.get $0 + call $~lib/typedarray/Int8Array#__get + local.get $1 + i32.const 8 + local.get $0 + i32.sub + call $~lib/array/Array#__get + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.ne + if + i32.const 1512 + i32.const 24 + i32.const 471 + i32.const 4 + call $~lib/builtins/abort + unreachable + else + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|1 + end + unreachable + end end - i64.extend_i32_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $1 - i32.const 2 - i32.const 2 - global.get $std/typedarray/forEachValues - i32.load + local.get $3 + i32.const 4 + i32.const 8 + call $~lib/typedarray/Int8Array#subarray + local.tee $6 + call $~lib/typedarray/Int8Array#reverse local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 8 - i32.add - i32.load offset=8 - else - unreachable - end - i64.extend_i32_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $1 - i32.const 109 - call $~lib/typedarray/Int64Array#forEach - global.get $std/typedarray/forEachCallCount - i32.const 3 + i32.const 0 + call $~lib/typedarray/Int8Array#__get + i32.const 8 i32.ne if - i32.const 920 - i32.const 8 - i32.const 430 + i32.const 1600 + i32.const 24 + i32.const 476 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Float32Array,f32>~anonymous|0 (; 212 ;) (type $FUNCSIG$vfii) (param $0 f32) (param $1 i32) (param $2 i32) - (local $3 i32) local.get $0 - local.get $1 - global.get $std/typedarray/forEachValues - i32.load - local.tee $3 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $1 - i32.const 2 - i32.shl - local.get $3 - i32.add - i32.load offset=8 - else - unreachable - end - f32.convert_i32_s - f32.ne + i32.const 1 + call $~lib/typedarray/Int8Array#__get + i32.const 7 + i32.ne if - i32.const 752 - i32.const 8 - i32.const 425 - i32.const 4 - call $~lib/env/abort + i32.const 1600 + i32.const 24 + i32.const 477 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/forEachCallCount - local.get $1 + local.get $0 + i32.const 2 + call $~lib/typedarray/Int8Array#__get + i32.const 6 i32.ne if - i32.const 800 - i32.const 8 - i32.const 426 - i32.const 4 - call $~lib/env/abort + i32.const 1600 + i32.const 24 + i32.const 478 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/forEachSelf - local.get $2 + local.get $0 + i32.const 3 + call $~lib/typedarray/Int8Array#__get + i32.const 5 i32.ne if - i32.const 848 - i32.const 8 - i32.const 427 - i32.const 4 - call $~lib/env/abort + i32.const 1600 + i32.const 24 + i32.const 479 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/forEachCallCount - i32.const 1 - i32.add - global.set $std/typedarray/forEachCallCount + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Float32Array#forEach (; 213 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/typedarray/Uint8Array#reverse (; 259 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) + (local $5 i32) local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u - local.set $2 - local.get $0 - i32.load - local.set $3 - local.get $0 + call $~lib/rt/pure/__retain + local.tee $3 i32.load offset=4 local.set $4 + i32.const 0 + local.set $0 + local.get $3 + i32.load offset=8 + i32.const 1 + i32.sub + local.set $1 loop $repeat|0 + local.get $0 local.get $1 - local.get $2 i32.lt_s if - i32.const 3 - global.set $~lib/argc - local.get $1 - i32.const 2 - i32.shl - local.get $3 - i32.add + local.get $0 local.get $4 i32.add - f32.load offset=8 + local.tee $2 + i32.load8_u + local.set $5 + local.get $2 local.get $1 + local.get $4 + i32.add + local.tee $2 + i32.load8_u + i32.store8 + local.get $2 + local.get $5 + i32.store8 local.get $0 - i32.const 110 - call_indirect (type $FUNCSIG$vfii) - local.get $1 i32.const 1 i32.add + local.set $0 + local.get $1 + i32.const 1 + i32.sub local.set $1 br $repeat|0 end end + local.get $3 ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Float32Array,f32> (; 214 ;) (type $FUNCSIG$v) - (local $0 i32) + (func $~lib/typedarray/Uint8Array#subarray (; 260 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) - i32.const 0 - global.set $std/typedarray/forEachCallCount - i32.const 3 - call $~lib/typedarray/Int32Array#constructor + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + i32.const 8 + local.get $0 + call $~lib/rt/pure/__retain + local.tee $2 + i32.load offset=8 + local.tee $0 + i32.const 8 + local.get $0 + i32.lt_s + select local.tee $1 - global.set $std/typedarray/forEachSelf + i32.const 4 + local.get $0 + i32.const 4 + local.get $0 + i32.lt_s + select + local.tee $3 local.get $1 - i32.const 0 - i32.const 0 - global.get $std/typedarray/forEachValues + local.get $3 + i32.gt_s + select + local.set $4 + i32.const 12 + i32.const 4 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $0 + local.set $5 + local.get $2 + i32.load + local.tee $1 + local.get $0 i32.load + local.tee $6 + i32.ne + if + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $6 + call $~lib/rt/pure/__release + end + local.get $5 + local.get $1 + i32.store + local.get $0 + local.get $2 + i32.load offset=4 + local.get $3 + i32.add + i32.store offset=4 + local.get $0 + local.get $4 + local.get $3 + i32.sub + i32.store offset=8 + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + ) + (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint8Array,u8> (; 261 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + global.get $std/typedarray/testArrayReverseValues + call $~lib/rt/pure/__retain + local.set $1 + i32.const 9 + call $~lib/typedarray/Uint8Array#constructor + local.tee $4 + call $~lib/rt/pure/__retain + local.set $2 + i32.const 9 + call $~lib/typedarray/Uint8Array#constructor + local.tee $5 + call $~lib/rt/pure/__retain + local.set $3 + loop $repeat|0 + block $break|0 + local.get $0 + i32.const 9 + i32.ge_s + br_if $break|0 + local.get $2 + local.get $0 + local.get $1 + local.get $0 + call $~lib/array/Array#__get + i32.const 255 + i32.and + call $~lib/typedarray/Uint8Array#__set + local.get $3 + local.get $0 + local.get $1 + local.get $0 + call $~lib/array/Array#__get + i32.const 255 + i32.and + call $~lib/typedarray/Uint8Array#__set + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + end + local.get $2 + call $~lib/typedarray/Uint8Array#reverse + call $~lib/rt/pure/__release + i32.const 0 + local.set $0 + loop $repeat|1 + block $break|1 + local.get $0 + i32.const 9 + i32.ge_s + br_if $break|1 + local.get $2 + local.get $0 + call $~lib/typedarray/Uint8Array#__get + local.get $1 + i32.const 8 + local.get $0 + i32.sub + call $~lib/array/Array#__get + i32.const 255 + i32.and + i32.ne + if + i32.const 1512 + i32.const 24 + i32.const 471 + i32.const 4 + call $~lib/builtins/abort + unreachable + else + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|1 + end + unreachable + end + end + local.get $3 + call $~lib/typedarray/Uint8Array#subarray + local.tee $6 + call $~lib/typedarray/Uint8Array#reverse local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else + i32.const 0 + call $~lib/typedarray/Uint8Array#__get + i32.const 8 + i32.ne + if + i32.const 1600 + i32.const 24 + i32.const 476 + i32.const 2 + call $~lib/builtins/abort unreachable end - f32.convert_i32_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $1 - i32.const 1 + local.get $0 i32.const 1 - global.get $std/typedarray/forEachValues - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else + call $~lib/typedarray/Uint8Array#__get + i32.const 7 + i32.ne + if + i32.const 1600 + i32.const 24 + i32.const 477 + i32.const 2 + call $~lib/builtins/abort unreachable end - f32.convert_i32_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $1 - i32.const 2 - i32.const 2 - global.get $std/typedarray/forEachValues - i32.load - local.tee $0 - i32.load + local.get $0 i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 8 - i32.add - i32.load offset=8 - else + call $~lib/typedarray/Uint8Array#__get + i32.const 6 + i32.ne + if + i32.const 1600 + i32.const 24 + i32.const 478 + i32.const 2 + call $~lib/builtins/abort unreachable end - f32.convert_i32_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $1 - call $~lib/typedarray/Float32Array#forEach - global.get $std/typedarray/forEachCallCount + local.get $0 i32.const 3 + call $~lib/typedarray/Uint8Array#__get + i32.const 5 i32.ne if - i32.const 920 - i32.const 8 - i32.const 430 + i32.const 1600 + i32.const 24 + i32.const 479 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Float64Array,f64>~anonymous|0 (; 215 ;) (type $FUNCSIG$vdii) (param $0 f64) (param $1 i32) (param $2 i32) + (func $~lib/typedarray/Uint8ClampedArray#subarray (; 262 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + i32.const 8 + local.get $0 + call $~lib/rt/pure/__retain + local.tee $2 + i32.load offset=8 + local.tee $0 + i32.const 8 + local.get $0 + i32.lt_s + select + local.tee $1 + i32.const 4 + local.get $0 + i32.const 4 local.get $0 + i32.lt_s + select + local.tee $3 local.get $1 - global.get $std/typedarray/forEachValues + local.get $3 + i32.gt_s + select + local.set $4 + i32.const 12 + i32.const 5 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $0 + local.set $5 + local.get $2 i32.load - local.tee $3 + local.tee $1 + local.get $0 i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $1 - i32.const 2 - i32.shl - local.get $3 - i32.add - i32.load offset=8 - else - unreachable - end - f64.convert_i32_s - f64.ne - if - i32.const 752 - i32.const 8 - i32.const 425 - i32.const 4 - call $~lib/env/abort - unreachable - end - global.get $std/typedarray/forEachCallCount - local.get $1 + local.tee $6 i32.ne if - i32.const 800 - i32.const 8 - i32.const 426 - i32.const 4 - call $~lib/env/abort - unreachable + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $6 + call $~lib/rt/pure/__release end - global.get $std/typedarray/forEachSelf + local.get $5 + local.get $1 + i32.store + local.get $0 local.get $2 - i32.ne - if - i32.const 848 - i32.const 8 - i32.const 427 - i32.const 4 - call $~lib/env/abort - unreachable - end - global.get $std/typedarray/forEachCallCount - i32.const 1 + i32.load offset=4 + local.get $3 i32.add - global.set $std/typedarray/forEachCallCount + i32.store offset=4 + local.get $0 + local.get $4 + local.get $3 + i32.sub + i32.store offset=8 + local.get $2 + call $~lib/rt/pure/__release + local.get $0 ) - (func $~lib/typedarray/Float64Array#forEach (; 216 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint8ClampedArray,u8> (; 263 ;) (type $FUNCSIG$v) + (local $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - local.get $0 - i32.load offset=8 - i32.const 3 - i32.shr_u + (local $5 i32) + (local $6 i32) + global.get $std/typedarray/testArrayReverseValues + call $~lib/rt/pure/__retain + local.set $1 + i32.const 9 + call $~lib/typedarray/Uint8ClampedArray#constructor + local.tee $4 + call $~lib/rt/pure/__retain local.set $2 - local.get $0 - i32.load + i32.const 9 + call $~lib/typedarray/Uint8ClampedArray#constructor + local.tee $5 + call $~lib/rt/pure/__retain local.set $3 - local.get $0 - i32.load offset=4 - local.set $4 loop $repeat|0 - local.get $1 - local.get $2 - i32.lt_s - if - i32.const 3 - global.set $~lib/argc + block $break|0 + local.get $0 + i32.const 9 + i32.ge_s + br_if $break|0 + local.get $2 + local.get $0 local.get $1 - i32.const 3 - i32.shl + local.get $0 + call $~lib/array/Array#__get + i32.const 255 + i32.and + call $~lib/typedarray/Uint8ClampedArray#__set local.get $3 - i32.add - local.get $4 - i32.add - f64.load offset=8 - local.get $1 local.get $0 - i32.const 111 - call_indirect (type $FUNCSIG$vdii) local.get $1 + local.get $0 + call $~lib/array/Array#__get + i32.const 255 + i32.and + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $0 i32.const 1 i32.add - local.set $1 + local.set $0 br $repeat|0 end end - ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Float64Array,f64> (; 217 ;) (type $FUNCSIG$v) - (local $0 i32) - (local $1 i32) - i32.const 0 - global.set $std/typedarray/forEachCallCount - i32.const 3 - call $~lib/typedarray/Int64Array#constructor - local.tee $1 - global.set $std/typedarray/forEachSelf - local.get $1 - i32.const 0 + local.get $2 + call $~lib/typedarray/Uint8Array#reverse + call $~lib/rt/pure/__release i32.const 0 - global.get $std/typedarray/forEachValues - i32.load + local.set $0 + loop $repeat|1 + block $break|1 + local.get $0 + i32.const 9 + i32.ge_s + br_if $break|1 + local.get $2 + local.get $0 + call $~lib/typedarray/Uint8ClampedArray#__get + local.get $1 + i32.const 8 + local.get $0 + i32.sub + call $~lib/array/Array#__get + i32.const 255 + i32.and + i32.ne + if + i32.const 1512 + i32.const 24 + i32.const 471 + i32.const 4 + call $~lib/builtins/abort + unreachable + else + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|1 + end + unreachable + end + end + local.get $3 + call $~lib/typedarray/Uint8ClampedArray#subarray + local.tee $6 + call $~lib/typedarray/Uint8Array#reverse local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else + i32.const 0 + call $~lib/typedarray/Uint8ClampedArray#__get + i32.const 8 + i32.ne + if + i32.const 1600 + i32.const 24 + i32.const 476 + i32.const 2 + call $~lib/builtins/abort unreachable end - f64.convert_i32_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $1 - i32.const 1 + local.get $0 i32.const 1 - global.get $std/typedarray/forEachValues - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else + call $~lib/typedarray/Uint8ClampedArray#__get + i32.const 7 + i32.ne + if + i32.const 1600 + i32.const 24 + i32.const 477 + i32.const 2 + call $~lib/builtins/abort unreachable end - f64.convert_i32_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $1 - i32.const 2 - i32.const 2 - global.get $std/typedarray/forEachValues - i32.load - local.tee $0 - i32.load + local.get $0 i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 8 - i32.add - i32.load offset=8 - else + call $~lib/typedarray/Uint8ClampedArray#__get + i32.const 6 + i32.ne + if + i32.const 1600 + i32.const 24 + i32.const 478 + i32.const 2 + call $~lib/builtins/abort unreachable end - f64.convert_i32_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $1 - call $~lib/typedarray/Float64Array#forEach - global.get $std/typedarray/forEachCallCount + local.get $0 i32.const 3 + call $~lib/typedarray/Uint8ClampedArray#__get + i32.const 5 i32.ne if - i32.const 920 - i32.const 8 - i32.const 430 + i32.const 1600 + i32.const 24 + i32.const 479 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int8Array#reverse (; 218 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Int16Array#reverse (; 264 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) local.get $0 - i32.load - local.set $3 - local.get $0 + call $~lib/rt/pure/__retain + local.tee $3 i32.load offset=4 local.set $4 - local.get $0 - i32.load offset=8 + i32.const 0 + local.set $0 + local.get $3 + call $~lib/typedarray/Int16Array#get:length i32.const 1 i32.sub - local.set $2 + local.set $1 loop $repeat|0 block $break|0 + local.get $0 local.get $1 - local.get $2 i32.ge_s br_if $break|0 - local.get $1 - local.get $3 - i32.add + local.get $0 + i32.const 1 + i32.shl local.get $4 i32.add - i32.load8_s offset=8 + local.tee $2 + i32.load16_s local.set $5 - local.get $1 - local.get $3 - i32.add - local.get $4 - i32.add local.get $2 - local.get $3 - i32.add + local.get $1 + i32.const 1 + i32.shl local.get $4 i32.add - i32.load8_s offset=8 - i32.store8 offset=8 + local.tee $2 + i32.load16_s + i32.store16 local.get $2 - local.get $3 - i32.add - local.get $4 - i32.add local.get $5 - i32.store8 offset=8 - local.get $1 + i32.store16 + local.get $0 i32.const 1 i32.add - local.set $1 - local.get $2 + local.set $0 + local.get $1 i32.const 1 i32.sub - local.set $2 + local.set $1 br $repeat|0 end end + local.get $3 + ) + (func $~lib/typedarray/Int16Array#subarray (; 265 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + i32.const 4 + local.get $0 + call $~lib/rt/pure/__retain + local.tee $2 + call $~lib/typedarray/Int16Array#get:length + local.tee $1 + i32.const 4 + local.get $1 + i32.lt_s + select + local.set $0 + i32.const 8 + local.get $1 + i32.const 8 + local.get $1 + i32.lt_s + select + local.tee $1 + local.get $0 + local.get $1 + local.get $0 + i32.gt_s + select + local.set $4 + i32.const 12 + i32.const 6 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $1 + local.set $5 + local.get $1 + i32.load + local.tee $6 + local.get $2 + i32.load + local.tee $3 + i32.ne + if + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $6 + call $~lib/rt/pure/__release + end + local.get $5 + local.get $3 + i32.store + local.get $1 + local.get $2 + i32.load offset=4 + local.get $0 + i32.const 1 + i32.shl + i32.add + i32.store offset=4 + local.get $1 + local.get $4 local.get $0 + i32.sub + i32.const 1 + i32.shl + i32.store offset=8 + local.get $2 + call $~lib/rt/pure/__release + local.get $1 ) - (func $std/typedarray/testArrayReverse<~lib/typedarray/Int8Array,i8> (; 219 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayReverse<~lib/typedarray/Int16Array,i16> (; 266 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + (local $6 i32) global.get $std/typedarray/testArrayReverseValues + call $~lib/rt/pure/__retain + local.set $1 + i32.const 9 + call $~lib/typedarray/Int16Array#constructor + local.tee $4 + call $~lib/rt/pure/__retain local.set $2 - i32.const 0 i32.const 9 - call $~lib/typedarray/Int8Array#constructor + call $~lib/typedarray/Int16Array#constructor + local.tee $5 + call $~lib/rt/pure/__retain local.set $3 - i32.const 0 - i32.const 9 - call $~lib/typedarray/Int8Array#constructor - local.set $4 loop $repeat|0 - local.get $0 - i32.const 9 - i32.lt_s - if - local.get $3 - local.get $0 + block $break|0 local.get $0 + i32.const 9 + i32.ge_s + br_if $break|0 local.get $2 - i32.load - local.tee $1 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 2 - i32.shl - local.get $1 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 24 + local.get $0 + local.get $1 + local.get $0 + call $~lib/array/Array#__get + i32.const 16 i32.shl - i32.const 24 + i32.const 16 i32.shr_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $4 + call $~lib/typedarray/Int16Array#__set + local.get $3 local.get $0 + local.get $1 local.get $0 - local.get $2 - i32.load - local.tee $1 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 2 - i32.shl - local.get $1 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 24 + call $~lib/array/Array#__get + i32.const 16 i32.shl - i32.const 24 + i32.const 16 i32.shr_s - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Int16Array#__set local.get $0 i32.const 1 i32.add @@ -9926,51 +12541,36 @@ br $repeat|0 end end - local.get $3 - call $~lib/typedarray/Int8Array#reverse - drop + local.get $2 + call $~lib/typedarray/Int16Array#reverse + call $~lib/rt/pure/__release i32.const 0 local.set $0 loop $repeat|1 - local.get $0 - i32.const 9 - i32.lt_s - if - local.get $3 + block $break|1 local.get $0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and + i32.const 9 + i32.ge_s + br_if $break|1 + local.get $2 + local.get $0 + call $~lib/typedarray/Int16Array#__get + local.get $1 i32.const 8 local.get $0 i32.sub - local.tee $1 - local.get $2 - i32.load - local.tee $5 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $1 - i32.const 2 - i32.shl - local.get $5 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 255 - i32.and + call $~lib/array/Array#__get + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s i32.ne if - i32.const 1056 - i32.const 8 - i32.const 461 + i32.const 1512 + i32.const 24 + i32.const 471 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -9982,397 +12582,250 @@ unreachable end end - local.get $4 - i32.const 4 - i32.const 8 - call $~lib/typedarray/Int8Array#subarray - call $~lib/typedarray/Int8Array#reverse + local.get $3 + call $~lib/typedarray/Int16Array#subarray + local.tee $6 + call $~lib/typedarray/Int16Array#reverse local.tee $0 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and + call $~lib/typedarray/Int16Array#__get i32.const 8 i32.ne if - i32.const 1128 - i32.const 8 - i32.const 466 + i32.const 1600 + i32.const 24 + i32.const 476 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and + call $~lib/typedarray/Int16Array#__get i32.const 7 i32.ne if - i32.const 1128 - i32.const 8 - i32.const 467 + i32.const 1600 + i32.const 24 + i32.const 477 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and + call $~lib/typedarray/Int16Array#__get i32.const 6 i32.ne if - i32.const 1128 - i32.const 8 - i32.const 468 + i32.const 1600 + i32.const 24 + i32.const 478 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and + call $~lib/typedarray/Int16Array#__get i32.const 5 i32.ne if - i32.const 1128 - i32.const 8 - i32.const 469 + i32.const 1600 + i32.const 24 + i32.const 479 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint8Array#reverse (; 220 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Uint16Array#reverse (; 267 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) local.get $0 - i32.load - local.set $3 - local.get $0 + call $~lib/rt/pure/__retain + local.tee $3 i32.load offset=4 local.set $4 - local.get $0 - i32.load offset=8 + i32.const 0 + local.set $0 + local.get $3 + call $~lib/typedarray/Int16Array#get:length i32.const 1 i32.sub - local.set $2 + local.set $1 loop $repeat|0 block $break|0 + local.get $0 local.get $1 - local.get $2 i32.ge_s br_if $break|0 - local.get $1 - local.get $3 - i32.add + local.get $0 + i32.const 1 + i32.shl local.get $4 i32.add - i32.load8_u offset=8 + local.tee $2 + i32.load16_u local.set $5 - local.get $1 - local.get $3 - i32.add - local.get $4 - i32.add local.get $2 - local.get $3 - i32.add + local.get $1 + i32.const 1 + i32.shl local.get $4 i32.add - i32.load8_u offset=8 - i32.store8 offset=8 + local.tee $2 + i32.load16_u + i32.store16 local.get $2 - local.get $3 - i32.add - local.get $4 - i32.add local.get $5 - i32.store8 offset=8 - local.get $1 + i32.store16 + local.get $0 i32.const 1 i32.add - local.set $1 - local.get $2 + local.set $0 + local.get $1 i32.const 1 i32.sub - local.set $2 + local.set $1 br $repeat|0 end end - local.get $0 + local.get $3 ) - (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint8Array,u8> (; 221 ;) (type $FUNCSIG$v) - (local $0 i32) + (func $~lib/typedarray/Uint16Array#subarray (; 268 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - global.get $std/typedarray/testArrayReverseValues - local.set $2 - i32.const 0 - i32.const 9 - call $~lib/typedarray/Int8Array#constructor - local.set $3 - i32.const 0 - i32.const 9 - call $~lib/typedarray/Int8Array#constructor - local.set $4 - loop $repeat|0 - local.get $0 - i32.const 9 - i32.lt_s - if - local.get $3 - local.get $0 - local.get $0 - local.get $2 - i32.load - local.tee $1 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 2 - i32.shl - local.get $1 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 255 - i32.and - call $~lib/internal/typedarray/TypedArray#__set - local.get $4 - local.get $0 - local.get $0 - local.get $2 - i32.load - local.tee $1 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 2 - i32.shl - local.get $1 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 255 - i32.and - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 - end - end - local.get $3 - call $~lib/typedarray/Uint8Array#reverse - drop - i32.const 0 - local.set $0 - loop $repeat|1 - local.get $0 - i32.const 9 - i32.lt_s - if - local.get $3 - local.get $0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and - i32.const 8 - local.get $0 - i32.sub - local.tee $1 - local.get $2 - i32.load - local.tee $5 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $1 - i32.const 2 - i32.shl - local.get $5 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 255 - i32.and - i32.ne - if - i32.const 1056 - i32.const 8 - i32.const 461 - i32.const 4 - call $~lib/env/abort - unreachable - else - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|1 - end - unreachable - end - end - local.get $4 + (local $6 i32) + i32.const 4 + local.get $0 + call $~lib/rt/pure/__retain + local.tee $2 + call $~lib/typedarray/Int16Array#get:length + local.tee $1 i32.const 4 + local.get $1 + i32.lt_s + select + local.set $0 i32.const 8 - call $~lib/typedarray/Int8Array#subarray - call $~lib/typedarray/Uint8Array#reverse - local.tee $0 - i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and + local.get $1 i32.const 8 - i32.ne - if - i32.const 1128 - i32.const 8 - i32.const 466 - i32.const 2 - call $~lib/env/abort - unreachable - end + local.get $1 + i32.lt_s + select + local.tee $1 local.get $0 - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and - i32.const 7 - i32.ne - if - i32.const 1128 - i32.const 8 - i32.const 467 - i32.const 2 - call $~lib/env/abort - unreachable - end + local.get $1 local.get $0 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and - i32.const 6 + i32.gt_s + select + local.set $4 + i32.const 12 + i32.const 7 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $1 + local.set $5 + local.get $1 + i32.load + local.tee $6 + local.get $2 + i32.load + local.tee $3 i32.ne if - i32.const 1128 - i32.const 8 - i32.const 468 - i32.const 2 - call $~lib/env/abort - unreachable + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $6 + call $~lib/rt/pure/__release end + local.get $5 + local.get $3 + i32.store + local.get $1 + local.get $2 + i32.load offset=4 local.get $0 - i32.const 3 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and - i32.const 5 - i32.ne - if - i32.const 1128 - i32.const 8 - i32.const 469 - i32.const 2 - call $~lib/env/abort - unreachable - end + i32.const 1 + i32.shl + i32.add + i32.store offset=4 + local.get $1 + local.get $4 + local.get $0 + i32.sub + i32.const 1 + i32.shl + i32.store offset=8 + local.get $2 + call $~lib/rt/pure/__release + local.get $1 ) - (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint8ClampedArray,u8> (; 222 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint16Array,u16> (; 269 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + (local $6 i32) global.get $std/typedarray/testArrayReverseValues + call $~lib/rt/pure/__retain + local.set $1 + i32.const 9 + call $~lib/typedarray/Uint16Array#constructor + local.tee $4 + call $~lib/rt/pure/__retain local.set $2 i32.const 9 - call $~lib/typedarray/Uint8ClampedArray#constructor + call $~lib/typedarray/Uint16Array#constructor + local.tee $5 + call $~lib/rt/pure/__retain local.set $3 - i32.const 9 - call $~lib/typedarray/Uint8ClampedArray#constructor - local.set $4 loop $repeat|0 - local.get $0 - i32.const 9 - i32.lt_s - if - local.get $3 - local.get $0 + block $break|0 local.get $0 + i32.const 9 + i32.ge_s + br_if $break|0 local.get $2 - i32.load - local.tee $1 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 2 - i32.shl - local.get $1 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 255 + local.get $0 + local.get $1 + local.get $0 + call $~lib/array/Array#__get + i32.const 65535 i32.and - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $4 + call $~lib/typedarray/Uint16Array#__set + local.get $3 local.get $0 + local.get $1 local.get $0 - local.get $2 - i32.load - local.tee $1 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 2 - i32.shl - local.get $1 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 255 + call $~lib/array/Array#__get + i32.const 65535 i32.and - call $~lib/typedarray/Uint8ClampedArray#__set + call $~lib/typedarray/Uint16Array#__set local.get $0 i32.const 1 i32.add @@ -10380,51 +12833,34 @@ br $repeat|0 end end - local.get $3 - call $~lib/typedarray/Uint8Array#reverse - drop + local.get $2 + call $~lib/typedarray/Uint16Array#reverse + call $~lib/rt/pure/__release i32.const 0 local.set $0 loop $repeat|1 - local.get $0 - i32.const 9 - i32.lt_s - if - local.get $3 + block $break|1 local.get $0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and + i32.const 9 + i32.ge_s + br_if $break|1 + local.get $2 + local.get $0 + call $~lib/typedarray/Uint16Array#__get + local.get $1 i32.const 8 local.get $0 i32.sub - local.tee $1 - local.get $2 - i32.load - local.tee $5 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $1 - i32.const 2 - i32.shl - local.get $5 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 255 + call $~lib/array/Array#__get + i32.const 65535 i32.and i32.ne if - i32.const 1056 - i32.const 8 - i32.const 461 + i32.const 1512 + i32.const 24 + i32.const 471 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -10436,265 +12872,173 @@ unreachable end end - local.get $4 - i32.const 4 - i32.const 8 - call $~lib/typedarray/Int8Array#subarray - call $~lib/typedarray/Uint8Array#reverse + local.get $3 + call $~lib/typedarray/Uint16Array#subarray + local.tee $6 + call $~lib/typedarray/Uint16Array#reverse local.tee $0 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and + call $~lib/typedarray/Uint16Array#__get i32.const 8 i32.ne if - i32.const 1128 - i32.const 8 - i32.const 466 + i32.const 1600 + i32.const 24 + i32.const 476 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and + call $~lib/typedarray/Uint16Array#__get i32.const 7 i32.ne if - i32.const 1128 - i32.const 8 - i32.const 467 + i32.const 1600 + i32.const 24 + i32.const 477 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and + call $~lib/typedarray/Uint16Array#__get i32.const 6 i32.ne if - i32.const 1128 - i32.const 8 - i32.const 468 + i32.const 1600 + i32.const 24 + i32.const 478 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and + call $~lib/typedarray/Uint16Array#__get i32.const 5 i32.ne if - i32.const 1128 - i32.const 8 - i32.const 469 + i32.const 1600 + i32.const 24 + i32.const 479 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int16Array#reverse (; 223 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Int32Array#reverse (; 270 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) local.get $0 - i32.load - local.set $3 - local.get $0 + call $~lib/rt/pure/__retain + local.tee $3 i32.load offset=4 local.set $4 - local.get $0 - i32.load offset=8 - i32.const 1 - i32.shr_u + i32.const 0 + local.set $0 + local.get $3 + call $~lib/typedarray/Int32Array#get:length i32.const 1 i32.sub - local.set $2 + local.set $1 loop $repeat|0 block $break|0 + local.get $0 local.get $1 - local.get $2 i32.ge_s br_if $break|0 - local.get $1 - i32.const 1 + local.get $0 + i32.const 2 i32.shl - local.get $3 - i32.add local.get $4 i32.add - i32.load16_s offset=8 + local.tee $2 + i32.load local.set $5 - local.get $1 - i32.const 1 - i32.shl - local.get $3 - i32.add - local.get $4 - i32.add local.get $2 - i32.const 1 + local.get $1 + i32.const 2 i32.shl - local.get $3 - i32.add local.get $4 i32.add - i32.load16_s offset=8 - i32.store16 offset=8 + local.tee $2 + i32.load + i32.store local.get $2 - i32.const 1 - i32.shl - local.get $3 - i32.add - local.get $4 - i32.add local.get $5 - i32.store16 offset=8 - local.get $1 - i32.const 1 - i32.add - local.set $1 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - br $repeat|0 - end - end - local.get $0 - ) - (func $~lib/typedarray/Int16Array#subarray (; 224 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - i32.const 4 - local.get $0 - i32.load offset=8 - i32.const 1 - i32.shr_u - local.tee $1 - i32.const 4 - local.get $1 - i32.lt_s - select - local.set $2 - i32.const 8 - local.get $1 - i32.const 8 - local.get $1 - i32.lt_s - select - local.tee $1 - local.get $2 - local.get $1 - local.get $2 - i32.gt_s - select - local.set $3 - i32.const 12 - call $~lib/allocator/arena/__memory_allocate - local.tee $1 - local.get $0 - i32.load - i32.store - local.get $1 - local.get $0 - i32.load offset=4 - local.get $2 - i32.const 1 - i32.shl - i32.add - i32.store offset=4 - local.get $1 + i32.store + local.get $0 + i32.const 1 + i32.add + local.set $0 + local.get $1 + i32.const 1 + i32.sub + local.set $1 + br $repeat|0 + end + end local.get $3 - local.get $2 - i32.sub - i32.const 1 - i32.shl - i32.store offset=8 - local.get $1 ) - (func $std/typedarray/testArrayReverse<~lib/typedarray/Int16Array,i16> (; 225 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayReverse<~lib/typedarray/Int32Array,i32> (; 271 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + (local $6 i32) global.get $std/typedarray/testArrayReverseValues + call $~lib/rt/pure/__retain + local.set $1 + i32.const 9 + call $~lib/typedarray/Int32Array#constructor + local.tee $4 + call $~lib/rt/pure/__retain local.set $2 i32.const 9 - call $~lib/typedarray/Int16Array#constructor + call $~lib/typedarray/Int32Array#constructor + local.tee $5 + call $~lib/rt/pure/__retain local.set $3 - i32.const 9 - call $~lib/typedarray/Int16Array#constructor - local.set $4 loop $repeat|0 - local.get $0 - i32.const 9 - i32.lt_s - if - local.get $3 - local.get $0 + block $break|0 local.get $0 + i32.const 9 + i32.ge_s + br_if $break|0 local.get $2 - i32.load - local.tee $1 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 2 - i32.shl - local.get $1 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $4 local.get $0 + local.get $1 local.get $0 - local.get $2 - i32.load - local.tee $1 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 2 - i32.shl - local.get $1 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/array/Array#__get + call $~lib/typedarray/Int32Array#__set + local.get $3 + local.get $0 + local.get $1 + local.get $0 + call $~lib/array/Array#__get + call $~lib/typedarray/Int32Array#__set local.get $0 i32.const 1 i32.add @@ -10702,51 +13046,32 @@ br $repeat|0 end end - local.get $3 - call $~lib/typedarray/Int16Array#reverse - drop + local.get $2 + call $~lib/typedarray/Int32Array#reverse + call $~lib/rt/pure/__release i32.const 0 local.set $0 loop $repeat|1 - local.get $0 - i32.const 9 - i32.lt_s - if - local.get $3 + block $break|1 local.get $0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 65535 - i32.and + i32.const 9 + i32.ge_s + br_if $break|1 + local.get $2 + local.get $0 + call $~lib/typedarray/Int32Array#__get + local.get $1 i32.const 8 local.get $0 i32.sub - local.tee $1 - local.get $2 - i32.load - local.tee $5 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $1 - i32.const 2 - i32.shl - local.get $5 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 65535 - i32.and + call $~lib/array/Array#__get i32.ne if - i32.const 1056 - i32.const 8 - i32.const 461 + i32.const 1512 + i32.const 24 + i32.const 471 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -10758,208 +13083,191 @@ unreachable end end - local.get $4 - call $~lib/typedarray/Int16Array#subarray - call $~lib/typedarray/Int16Array#reverse + local.get $3 + i32.const 4 + i32.const 8 + call $~lib/typedarray/Int32Array#subarray + local.tee $6 + call $~lib/typedarray/Int32Array#reverse local.tee $0 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 65535 - i32.and + call $~lib/typedarray/Int32Array#__get i32.const 8 i32.ne if - i32.const 1128 - i32.const 8 - i32.const 466 + i32.const 1600 + i32.const 24 + i32.const 476 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 65535 - i32.and + call $~lib/typedarray/Int32Array#__get i32.const 7 i32.ne if - i32.const 1128 - i32.const 8 - i32.const 467 + i32.const 1600 + i32.const 24 + i32.const 477 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 65535 - i32.and + call $~lib/typedarray/Int32Array#__get i32.const 6 i32.ne if - i32.const 1128 - i32.const 8 - i32.const 468 + i32.const 1600 + i32.const 24 + i32.const 478 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 65535 - i32.and + call $~lib/typedarray/Int32Array#__get i32.const 5 i32.ne if - i32.const 1128 - i32.const 8 - i32.const 469 + i32.const 1600 + i32.const 24 + i32.const 479 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint16Array#reverse (; 226 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Uint32Array#subarray (; 272 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + (local $6 i32) + i32.const 4 local.get $0 - i32.load - local.set $3 + call $~lib/rt/pure/__retain + local.tee $2 + call $~lib/typedarray/Int32Array#get:length + local.tee $1 + i32.const 4 + local.get $1 + i32.lt_s + select + local.set $0 + i32.const 8 + local.get $1 + i32.const 8 + local.get $1 + i32.lt_s + select + local.tee $1 local.get $0 - i32.load offset=4 - local.set $4 + local.get $1 local.get $0 - i32.load offset=8 - i32.const 1 - i32.shr_u - i32.const 1 - i32.sub - local.set $2 - loop $repeat|0 - block $break|0 - local.get $1 - local.get $2 - i32.ge_s - br_if $break|0 - local.get $1 - i32.const 1 - i32.shl - local.get $3 - i32.add - local.get $4 - i32.add - i32.load16_u offset=8 - local.set $5 - local.get $1 - i32.const 1 - i32.shl - local.get $3 - i32.add - local.get $4 - i32.add - local.get $2 - i32.const 1 - i32.shl - local.get $3 - i32.add - local.get $4 - i32.add - i32.load16_u offset=8 - i32.store16 offset=8 - local.get $2 - i32.const 1 - i32.shl - local.get $3 - i32.add - local.get $4 - i32.add - local.get $5 - i32.store16 offset=8 - local.get $1 - i32.const 1 - i32.add - local.set $1 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - br $repeat|0 - end + i32.gt_s + select + local.set $4 + i32.const 12 + i32.const 9 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $1 + local.set $5 + local.get $1 + i32.load + local.tee $6 + local.get $2 + i32.load + local.tee $3 + i32.ne + if + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $6 + call $~lib/rt/pure/__release end + local.get $5 + local.get $3 + i32.store + local.get $1 + local.get $2 + i32.load offset=4 + local.get $0 + i32.const 2 + i32.shl + i32.add + i32.store offset=4 + local.get $1 + local.get $4 local.get $0 + i32.sub + i32.const 2 + i32.shl + i32.store offset=8 + local.get $2 + call $~lib/rt/pure/__release + local.get $1 ) - (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint16Array,u16> (; 227 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint32Array,u32> (; 273 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + (local $6 i32) global.get $std/typedarray/testArrayReverseValues - local.set $2 + call $~lib/rt/pure/__retain + local.set $1 i32.const 9 - call $~lib/typedarray/Int16Array#constructor - local.set $3 + call $~lib/typedarray/Uint32Array#constructor + local.tee $4 + call $~lib/rt/pure/__retain + local.set $2 i32.const 9 - call $~lib/typedarray/Int16Array#constructor - local.set $4 + call $~lib/typedarray/Uint32Array#constructor + local.tee $5 + call $~lib/rt/pure/__retain + local.set $3 loop $repeat|0 - local.get $0 - i32.const 9 - i32.lt_s - if - local.get $3 - local.get $0 + block $break|0 local.get $0 + i32.const 9 + i32.ge_s + br_if $break|0 local.get $2 - i32.load - local.tee $1 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 2 - i32.shl - local.get $1 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 65535 - i32.and - call $~lib/internal/typedarray/TypedArray#__set - local.get $4 local.get $0 + local.get $1 local.get $0 - local.get $2 - i32.load - local.tee $1 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 2 - i32.shl - local.get $1 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 65535 - i32.and - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/array/Array#__get + call $~lib/typedarray/Uint32Array#__set + local.get $3 + local.get $0 + local.get $1 + local.get $0 + call $~lib/array/Array#__get + call $~lib/typedarray/Uint32Array#__set local.get $0 i32.const 1 i32.add @@ -10967,51 +13275,32 @@ br $repeat|0 end end - local.get $3 - call $~lib/typedarray/Uint16Array#reverse - drop + local.get $2 + call $~lib/typedarray/Int32Array#reverse + call $~lib/rt/pure/__release i32.const 0 local.set $0 loop $repeat|1 - local.get $0 - i32.const 9 - i32.lt_s - if - local.get $3 + block $break|1 local.get $0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 65535 - i32.and + i32.const 9 + i32.ge_s + br_if $break|1 + local.get $2 + local.get $0 + call $~lib/typedarray/Uint32Array#__get + local.get $1 i32.const 8 local.get $0 i32.sub - local.tee $1 - local.get $2 - i32.load - local.tee $5 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $1 - i32.const 2 - i32.shl - local.get $5 - i32.add - i32.load offset=8 - else - unreachable - end - i32.const 65535 - i32.and + call $~lib/array/Array#__get i32.ne if - i32.const 1056 - i32.const 8 - i32.const 461 + i32.const 1512 + i32.const 24 + i32.const 471 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -11023,204 +13312,248 @@ unreachable end end - local.get $4 - call $~lib/typedarray/Int16Array#subarray - call $~lib/typedarray/Uint16Array#reverse + local.get $3 + call $~lib/typedarray/Uint32Array#subarray + local.tee $6 + call $~lib/typedarray/Int32Array#reverse local.tee $0 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 65535 - i32.and + call $~lib/typedarray/Uint32Array#__get i32.const 8 i32.ne if - i32.const 1128 - i32.const 8 - i32.const 466 + i32.const 1600 + i32.const 24 + i32.const 476 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 65535 - i32.and + call $~lib/typedarray/Uint32Array#__get i32.const 7 i32.ne if - i32.const 1128 - i32.const 8 - i32.const 467 + i32.const 1600 + i32.const 24 + i32.const 477 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 65535 - i32.and + call $~lib/typedarray/Uint32Array#__get i32.const 6 i32.ne if - i32.const 1128 - i32.const 8 - i32.const 468 + i32.const 1600 + i32.const 24 + i32.const 478 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 65535 - i32.and + call $~lib/typedarray/Uint32Array#__get i32.const 5 i32.ne if - i32.const 1128 - i32.const 8 - i32.const 469 + i32.const 1600 + i32.const 24 + i32.const 479 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int32Array#reverse (; 228 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Int64Array#reverse (; 274 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - local.get $0 - i32.load - local.set $3 + (local $5 i64) local.get $0 + call $~lib/rt/pure/__retain + local.tee $3 i32.load offset=4 local.set $4 - local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u + i32.const 0 + local.set $0 + local.get $3 + call $~lib/typedarray/Int64Array#get:length i32.const 1 i32.sub - local.set $2 + local.set $1 loop $repeat|0 block $break|0 + local.get $0 local.get $1 - local.get $2 i32.ge_s br_if $break|0 - local.get $1 - i32.const 2 + local.get $0 + i32.const 3 i32.shl - local.get $3 - i32.add local.get $4 i32.add - i32.load offset=8 + local.tee $2 + i64.load local.set $5 - local.get $1 - i32.const 2 - i32.shl - local.get $3 - i32.add - local.get $4 - i32.add local.get $2 - i32.const 2 + local.get $1 + i32.const 3 i32.shl - local.get $3 - i32.add local.get $4 i32.add - i32.load offset=8 - i32.store offset=8 + local.tee $2 + i64.load + i64.store local.get $2 - i32.const 2 - i32.shl - local.get $3 - i32.add - local.get $4 - i32.add local.get $5 - i32.store offset=8 - local.get $1 + i64.store + local.get $0 i32.const 1 i32.add - local.set $1 - local.get $2 + local.set $0 + local.get $1 i32.const 1 i32.sub - local.set $2 + local.set $1 br $repeat|0 end end + local.get $3 + ) + (func $~lib/typedarray/Int64Array#subarray (; 275 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + i32.const 4 + local.get $0 + call $~lib/rt/pure/__retain + local.tee $2 + call $~lib/typedarray/Int64Array#get:length + local.tee $1 + i32.const 4 + local.get $1 + i32.lt_s + select + local.set $0 + i32.const 8 + local.get $1 + i32.const 8 + local.get $1 + i32.lt_s + select + local.tee $1 + local.get $0 + local.get $1 + local.get $0 + i32.gt_s + select + local.set $4 + i32.const 12 + i32.const 10 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $1 + local.set $5 + local.get $1 + i32.load + local.tee $6 + local.get $2 + i32.load + local.tee $3 + i32.ne + if + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $6 + call $~lib/rt/pure/__release + end + local.get $5 + local.get $3 + i32.store + local.get $1 + local.get $2 + i32.load offset=4 + local.get $0 + i32.const 3 + i32.shl + i32.add + i32.store offset=4 + local.get $1 + local.get $4 local.get $0 + i32.sub + i32.const 3 + i32.shl + i32.store offset=8 + local.get $2 + call $~lib/rt/pure/__release + local.get $1 ) - (func $std/typedarray/testArrayReverse<~lib/typedarray/Int32Array,i32> (; 229 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayReverse<~lib/typedarray/Int64Array,i64> (; 276 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + (local $6 i32) global.get $std/typedarray/testArrayReverseValues - local.set $2 + call $~lib/rt/pure/__retain + local.set $1 i32.const 9 - call $~lib/typedarray/Int32Array#constructor - local.set $3 + call $~lib/typedarray/Int64Array#constructor + local.tee $4 + call $~lib/rt/pure/__retain + local.set $2 i32.const 9 - call $~lib/typedarray/Int32Array#constructor - local.set $4 - loop $repeat|0 - local.get $0 - i32.const 9 - i32.lt_s - if - local.get $3 - local.get $0 - local.get $0 - local.get $2 - i32.load - local.tee $1 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 2 - i32.shl - local.get $1 - i32.add - i32.load offset=8 - else - unreachable - end - call $~lib/internal/typedarray/TypedArray#__set - local.get $4 - local.get $0 + call $~lib/typedarray/Int64Array#constructor + local.tee $5 + call $~lib/rt/pure/__retain + local.set $3 + loop $repeat|0 + block $break|0 local.get $0 + i32.const 9 + i32.ge_s + br_if $break|0 local.get $2 - i32.load - local.tee $1 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 2 - i32.shl - local.get $1 - i32.add - i32.load offset=8 - else - unreachable - end - call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + local.get $1 + local.get $0 + call $~lib/array/Array#__get + i64.extend_i32_s + call $~lib/typedarray/Int64Array#__set + local.get $3 + local.get $0 + local.get $1 + local.get $0 + call $~lib/array/Array#__get + i64.extend_i32_s + call $~lib/typedarray/Int64Array#__set local.get $0 i32.const 1 i32.add @@ -11228,47 +13561,33 @@ br $repeat|0 end end - local.get $3 - call $~lib/typedarray/Int32Array#reverse - drop + local.get $2 + call $~lib/typedarray/Int64Array#reverse + call $~lib/rt/pure/__release i32.const 0 local.set $0 loop $repeat|1 - local.get $0 - i32.const 9 - i32.lt_s - if - local.get $3 + block $break|1 + local.get $0 + i32.const 9 + i32.ge_s + br_if $break|1 + local.get $2 local.get $0 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Int64Array#__get + local.get $1 i32.const 8 local.get $0 i32.sub - local.tee $1 - local.get $2 - i32.load - local.tee $5 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $1 - i32.const 2 - i32.shl - local.get $5 - i32.add - i32.load offset=8 - else - unreachable - end - i32.ne + call $~lib/array/Array#__get + i64.extend_i32_s + i64.ne if - i32.const 1056 - i32.const 8 - i32.const 461 + i32.const 1512 + i32.const 24 + i32.const 471 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -11280,201 +13599,191 @@ unreachable end end - local.get $4 - i32.const 4 - i32.const 8 - call $~lib/typedarray/Int32Array#subarray - call $~lib/typedarray/Int32Array#reverse + local.get $3 + call $~lib/typedarray/Int64Array#subarray + local.tee $6 + call $~lib/typedarray/Int64Array#reverse local.tee $0 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 8 - i32.ne + call $~lib/typedarray/Int64Array#__get + i64.const 8 + i64.ne if - i32.const 1128 - i32.const 8 - i32.const 466 + i32.const 1600 + i32.const 24 + i32.const 476 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 7 - i32.ne + call $~lib/typedarray/Int64Array#__get + i64.const 7 + i64.ne if - i32.const 1128 - i32.const 8 - i32.const 467 + i32.const 1600 + i32.const 24 + i32.const 477 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 6 - i32.ne + call $~lib/typedarray/Int64Array#__get + i64.const 6 + i64.ne if - i32.const 1128 - i32.const 8 - i32.const 468 + i32.const 1600 + i32.const 24 + i32.const 478 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 5 - i32.ne + call $~lib/typedarray/Int64Array#__get + i64.const 5 + i64.ne if - i32.const 1128 - i32.const 8 - i32.const 469 + i32.const 1600 + i32.const 24 + i32.const 479 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int64Array#reverse (; 230 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Uint64Array#subarray (; 277 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i64) + (local $5 i32) + (local $6 i32) + i32.const 4 local.get $0 - i32.load - local.set $3 + call $~lib/rt/pure/__retain + local.tee $2 + call $~lib/typedarray/Int64Array#get:length + local.tee $1 + i32.const 4 + local.get $1 + i32.lt_s + select + local.set $0 + i32.const 8 + local.get $1 + i32.const 8 + local.get $1 + i32.lt_s + select + local.tee $1 local.get $0 - i32.load offset=4 + local.get $1 + local.get $0 + i32.gt_s + select local.set $4 + i32.const 12 + i32.const 11 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $1 + local.set $5 + local.get $1 + i32.load + local.tee $6 + local.get $2 + i32.load + local.tee $3 + i32.ne + if + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $6 + call $~lib/rt/pure/__release + end + local.get $5 + local.get $3 + i32.store + local.get $1 + local.get $2 + i32.load offset=4 local.get $0 - i32.load offset=8 i32.const 3 - i32.shr_u - i32.const 1 - i32.sub - local.set $2 - loop $repeat|0 - block $break|0 - local.get $1 - local.get $2 - i32.ge_s - br_if $break|0 - local.get $1 - i32.const 3 - i32.shl - local.get $3 - i32.add - local.get $4 - i32.add - i64.load offset=8 - local.set $5 - local.get $1 - i32.const 3 - i32.shl - local.get $3 - i32.add - local.get $4 - i32.add - local.get $2 - i32.const 3 - i32.shl - local.get $3 - i32.add - local.get $4 - i32.add - i64.load offset=8 - i64.store offset=8 - local.get $2 - i32.const 3 - i32.shl - local.get $3 - i32.add - local.get $4 - i32.add - local.get $5 - i64.store offset=8 - local.get $1 - i32.const 1 - i32.add - local.set $1 - local.get $2 - i32.const 1 - i32.sub - local.set $2 - br $repeat|0 - end - end + i32.shl + i32.add + i32.store offset=4 + local.get $1 + local.get $4 local.get $0 + i32.sub + i32.const 3 + i32.shl + i32.store offset=8 + local.get $2 + call $~lib/rt/pure/__release + local.get $1 ) - (func $std/typedarray/testArrayReverse<~lib/typedarray/Int64Array,i64> (; 231 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint64Array,u64> (; 278 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + (local $6 i32) global.get $std/typedarray/testArrayReverseValues - local.set $3 + call $~lib/rt/pure/__retain + local.set $1 i32.const 9 - call $~lib/typedarray/Int64Array#constructor - local.set $4 + call $~lib/typedarray/Uint64Array#constructor + local.tee $4 + call $~lib/rt/pure/__retain + local.set $2 i32.const 9 - call $~lib/typedarray/Int64Array#constructor - local.set $5 + call $~lib/typedarray/Uint64Array#constructor + local.tee $5 + call $~lib/rt/pure/__retain + local.set $3 loop $repeat|0 - local.get $0 - i32.const 9 - i32.lt_s - if - local.get $4 - local.get $0 + block $break|0 local.get $0 - local.tee $1 - local.get $3 - i32.load - local.tee $2 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $1 - i32.const 2 - i32.shl - local.get $2 - i32.add - i32.load offset=8 - else - unreachable - end - i64.extend_i32_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $5 - local.get $1 - local.get $1 - local.get $3 - i32.load - local.tee $2 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 2 - i32.shl - local.get $2 - i32.add - i32.load offset=8 - else - unreachable - end + i32.const 9 + i32.ge_s + br_if $break|0 + local.get $2 + local.get $0 + local.get $1 + local.get $0 + call $~lib/array/Array#__get + i64.extend_i32_s + call $~lib/typedarray/Uint64Array#__set + local.get $3 + local.get $0 + local.get $1 + local.get $0 + call $~lib/array/Array#__get i64.extend_i32_s - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Uint64Array#__set local.get $0 i32.const 1 i32.add @@ -11482,48 +13791,33 @@ br $repeat|0 end end - local.get $4 + local.get $2 call $~lib/typedarray/Int64Array#reverse - drop + call $~lib/rt/pure/__release i32.const 0 local.set $0 loop $repeat|1 - local.get $0 - i32.const 9 - i32.lt_s - if - local.get $4 + block $break|1 + local.get $0 + i32.const 9 + i32.ge_s + br_if $break|1 + local.get $2 local.get $0 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Uint64Array#__get + local.get $1 i32.const 8 local.get $0 i32.sub - local.tee $1 - local.get $3 - i32.load - local.tee $2 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $1 - i32.const 2 - i32.shl - local.get $2 - i32.add - i32.load offset=8 - else - unreachable - end + call $~lib/array/Array#__get i64.extend_i32_s i64.ne if - i32.const 1056 - i32.const 8 - i32.const 461 + i32.const 1512 + i32.const 24 + i32.const 471 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -11535,201 +13829,248 @@ unreachable end end - local.get $5 - i32.const 4 - i32.const 8 - call $~lib/typedarray/Float64Array#subarray + local.get $3 + call $~lib/typedarray/Uint64Array#subarray + local.tee $6 call $~lib/typedarray/Int64Array#reverse local.tee $0 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Uint64Array#__get i64.const 8 i64.ne if - i32.const 1128 - i32.const 8 - i32.const 466 + i32.const 1600 + i32.const 24 + i32.const 476 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Uint64Array#__get i64.const 7 i64.ne if - i32.const 1128 - i32.const 8 - i32.const 467 + i32.const 1600 + i32.const 24 + i32.const 477 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Uint64Array#__get i64.const 6 i64.ne if - i32.const 1128 - i32.const 8 - i32.const 468 + i32.const 1600 + i32.const 24 + i32.const 478 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Uint64Array#__get i64.const 5 i64.ne if - i32.const 1128 - i32.const 8 - i32.const 469 + i32.const 1600 + i32.const 24 + i32.const 479 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Float32Array#reverse (; 232 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Float32Array#reverse (; 279 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 f32) local.get $0 - i32.load - local.set $3 - local.get $0 + call $~lib/rt/pure/__retain + local.tee $3 i32.load offset=4 local.set $4 - local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u + i32.const 0 + local.set $0 + local.get $3 + call $~lib/typedarray/Int32Array#get:length i32.const 1 i32.sub - local.set $2 + local.set $1 loop $repeat|0 block $break|0 + local.get $0 local.get $1 - local.get $2 i32.ge_s br_if $break|0 - local.get $1 + local.get $0 i32.const 2 i32.shl - local.get $3 - i32.add local.get $4 i32.add - f32.load offset=8 + local.tee $2 + f32.load local.set $5 - local.get $1 - i32.const 2 - i32.shl - local.get $3 - i32.add - local.get $4 - i32.add local.get $2 + local.get $1 i32.const 2 i32.shl - local.get $3 - i32.add local.get $4 i32.add - f32.load offset=8 - f32.store offset=8 + local.tee $2 + f32.load + f32.store local.get $2 - i32.const 2 - i32.shl - local.get $3 - i32.add - local.get $4 - i32.add local.get $5 - f32.store offset=8 - local.get $1 + f32.store + local.get $0 i32.const 1 i32.add - local.set $1 - local.get $2 + local.set $0 + local.get $1 i32.const 1 i32.sub - local.set $2 + local.set $1 br $repeat|0 end end + local.get $3 + ) + (func $~lib/typedarray/Float32Array#subarray (; 280 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + i32.const 4 + local.get $0 + call $~lib/rt/pure/__retain + local.tee $2 + call $~lib/typedarray/Int32Array#get:length + local.tee $1 + i32.const 4 + local.get $1 + i32.lt_s + select + local.set $0 + i32.const 8 + local.get $1 + i32.const 8 + local.get $1 + i32.lt_s + select + local.tee $1 + local.get $0 + local.get $1 + local.get $0 + i32.gt_s + select + local.set $4 + i32.const 12 + i32.const 12 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $1 + local.set $5 + local.get $1 + i32.load + local.tee $6 + local.get $2 + i32.load + local.tee $3 + i32.ne + if + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $6 + call $~lib/rt/pure/__release + end + local.get $5 + local.get $3 + i32.store + local.get $1 + local.get $2 + i32.load offset=4 local.get $0 + i32.const 2 + i32.shl + i32.add + i32.store offset=4 + local.get $1 + local.get $4 + local.get $0 + i32.sub + i32.const 2 + i32.shl + i32.store offset=8 + local.get $2 + call $~lib/rt/pure/__release + local.get $1 ) - (func $std/typedarray/testArrayReverse<~lib/typedarray/Float32Array,f32> (; 233 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayReverse<~lib/typedarray/Float32Array,f32> (; 281 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + (local $6 i32) global.get $std/typedarray/testArrayReverseValues - local.set $3 + call $~lib/rt/pure/__retain + local.set $1 i32.const 9 - call $~lib/typedarray/Int32Array#constructor - local.set $4 + call $~lib/typedarray/Float32Array#constructor + local.tee $4 + call $~lib/rt/pure/__retain + local.set $2 i32.const 9 - call $~lib/typedarray/Int32Array#constructor - local.set $5 + call $~lib/typedarray/Float32Array#constructor + local.tee $5 + call $~lib/rt/pure/__retain + local.set $3 loop $repeat|0 - local.get $0 - i32.const 9 - i32.lt_s - if - local.get $4 + block $break|0 local.get $0 + i32.const 9 + i32.ge_s + br_if $break|0 + local.get $2 local.get $0 - local.tee $1 - local.get $3 - i32.load - local.tee $2 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $1 - i32.const 2 - i32.shl - local.get $2 - i32.add - i32.load offset=8 - else - unreachable - end - f32.convert_i32_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $5 - local.get $1 local.get $1 + local.get $0 + call $~lib/array/Array#__get + f32.convert_i32_s + call $~lib/typedarray/Float32Array#__set local.get $3 - i32.load - local.tee $2 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 2 - i32.shl - local.get $2 - i32.add - i32.load offset=8 - else - unreachable - end + local.get $0 + local.get $1 + local.get $0 + call $~lib/array/Array#__get f32.convert_i32_s - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Float32Array#__set local.get $0 i32.const 1 i32.add @@ -11737,48 +14078,33 @@ br $repeat|0 end end - local.get $4 + local.get $2 call $~lib/typedarray/Float32Array#reverse - drop + call $~lib/rt/pure/__release i32.const 0 local.set $0 loop $repeat|1 - local.get $0 - i32.const 9 - i32.lt_s - if - local.get $4 + block $break|1 + local.get $0 + i32.const 9 + i32.ge_s + br_if $break|1 + local.get $2 local.get $0 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Float32Array#__get + local.get $1 i32.const 8 local.get $0 i32.sub - local.tee $1 - local.get $3 - i32.load - local.tee $2 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $1 - i32.const 2 - i32.shl - local.get $2 - i32.add - i32.load offset=8 - else - unreachable - end + call $~lib/array/Array#__get f32.convert_i32_s f32.ne if - i32.const 1056 - i32.const 8 - i32.const 461 + i32.const 1512 + i32.const 24 + i32.const 471 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -11787,204 +14113,178 @@ local.set $0 br $repeat|1 end - unreachable - end - end - local.get $5 - i32.const 4 - i32.const 8 - call $~lib/typedarray/Int32Array#subarray + unreachable + end + end + local.get $3 + call $~lib/typedarray/Float32Array#subarray + local.tee $6 call $~lib/typedarray/Float32Array#reverse local.tee $0 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Float32Array#__get f32.const 8 f32.ne if - i32.const 1128 - i32.const 8 - i32.const 466 + i32.const 1600 + i32.const 24 + i32.const 476 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Float32Array#__get f32.const 7 f32.ne if - i32.const 1128 - i32.const 8 - i32.const 467 + i32.const 1600 + i32.const 24 + i32.const 477 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Float32Array#__get f32.const 6 f32.ne if - i32.const 1128 - i32.const 8 - i32.const 468 + i32.const 1600 + i32.const 24 + i32.const 478 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Float32Array#__get f32.const 5 f32.ne if - i32.const 1128 - i32.const 8 - i32.const 469 + i32.const 1600 + i32.const 24 + i32.const 479 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Float64Array#reverse (; 234 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Float64Array#reverse (; 282 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 f64) local.get $0 - i32.load - local.set $3 - local.get $0 + call $~lib/rt/pure/__retain + local.tee $3 i32.load offset=4 local.set $4 - local.get $0 - i32.load offset=8 - i32.const 3 - i32.shr_u + i32.const 0 + local.set $0 + local.get $3 + call $~lib/typedarray/Int64Array#get:length i32.const 1 i32.sub - local.set $2 + local.set $1 loop $repeat|0 block $break|0 + local.get $0 local.get $1 - local.get $2 i32.ge_s br_if $break|0 - local.get $1 + local.get $0 i32.const 3 i32.shl - local.get $3 - i32.add local.get $4 i32.add - f64.load offset=8 + local.tee $2 + f64.load local.set $5 - local.get $1 - i32.const 3 - i32.shl - local.get $3 - i32.add - local.get $4 - i32.add local.get $2 + local.get $1 i32.const 3 i32.shl - local.get $3 - i32.add local.get $4 i32.add - f64.load offset=8 - f64.store offset=8 + local.tee $2 + f64.load + f64.store local.get $2 - i32.const 3 - i32.shl - local.get $3 - i32.add - local.get $4 - i32.add local.get $5 - f64.store offset=8 - local.get $1 + f64.store + local.get $0 i32.const 1 i32.add - local.set $1 - local.get $2 + local.set $0 + local.get $1 i32.const 1 i32.sub - local.set $2 + local.set $1 br $repeat|0 end end - local.get $0 + local.get $3 ) - (func $std/typedarray/testArrayReverse<~lib/typedarray/Float64Array,f64> (; 235 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayReverse<~lib/typedarray/Float64Array,f64> (; 283 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + (local $6 i32) global.get $std/typedarray/testArrayReverseValues - local.set $3 + call $~lib/rt/pure/__retain + local.set $1 i32.const 9 - call $~lib/typedarray/Int64Array#constructor - local.set $4 + call $~lib/typedarray/Float64Array#constructor + local.tee $4 + call $~lib/rt/pure/__retain + local.set $2 i32.const 9 - call $~lib/typedarray/Int64Array#constructor - local.set $5 + call $~lib/typedarray/Float64Array#constructor + local.tee $5 + call $~lib/rt/pure/__retain + local.set $3 loop $repeat|0 - local.get $0 - i32.const 9 - i32.lt_s - if - local.get $4 + block $break|0 local.get $0 + i32.const 9 + i32.ge_s + br_if $break|0 + local.get $2 local.get $0 - local.tee $1 - local.get $3 - i32.load - local.tee $2 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $1 - i32.const 2 - i32.shl - local.get $2 - i32.add - i32.load offset=8 - else - unreachable - end - f64.convert_i32_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $5 - local.get $1 local.get $1 + local.get $0 + call $~lib/array/Array#__get + f64.convert_i32_s + call $~lib/typedarray/Float64Array#__set local.get $3 - i32.load - local.tee $2 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 2 - i32.shl - local.get $2 - i32.add - i32.load offset=8 - else - unreachable - end + local.get $0 + local.get $1 + local.get $0 + call $~lib/array/Array#__get f64.convert_i32_s - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/typedarray/Float64Array#__set local.get $0 i32.const 1 i32.add @@ -11992,48 +14292,33 @@ br $repeat|0 end end - local.get $4 + local.get $2 call $~lib/typedarray/Float64Array#reverse - drop + call $~lib/rt/pure/__release i32.const 0 local.set $0 loop $repeat|1 - local.get $0 - i32.const 9 - i32.lt_s - if - local.get $4 + block $break|1 local.get $0 - call $~lib/internal/typedarray/TypedArray#__get + i32.const 9 + i32.ge_s + br_if $break|1 + local.get $2 + local.get $0 + call $~lib/typedarray/Float64Array#__get + local.get $1 i32.const 8 local.get $0 i32.sub - local.tee $1 - local.get $3 - i32.load - local.tee $2 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $1 - i32.const 2 - i32.shl - local.get $2 - i32.add - i32.load offset=8 - else - unreachable - end + call $~lib/array/Array#__get f64.convert_i32_s f64.ne if - i32.const 1056 - i32.const 8 - i32.const 461 + i32.const 1512 + i32.const 24 + i32.const 471 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable else local.get $0 @@ -12045,303 +14330,319 @@ unreachable end end - local.get $5 + local.get $3 i32.const 4 i32.const 8 call $~lib/typedarray/Float64Array#subarray + local.tee $6 call $~lib/typedarray/Float64Array#reverse local.tee $0 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Float64Array#__get f64.const 8 f64.ne if - i32.const 1128 - i32.const 8 - i32.const 466 + i32.const 1600 + i32.const 24 + i32.const 476 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Float64Array#__get f64.const 7 f64.ne if - i32.const 1128 - i32.const 8 - i32.const 467 + i32.const 1600 + i32.const 24 + i32.const 477 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Float64Array#__get f64.const 6 f64.ne if - i32.const 1128 - i32.const 8 - i32.const 468 + i32.const 1600 + i32.const 24 + i32.const 478 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $0 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Float64Array#__get f64.const 5 f64.ne if - i32.const 1128 - i32.const 8 - i32.const 469 + i32.const 1600 + i32.const 24 + i32.const 479 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release ) - (func $start:std/typedarray (; 236 ;) (type $FUNCSIG$v) + (func $start:std/typedarray (; 284 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) - i32.const 1224 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) i32.const 0 call $std/typedarray/testInstantiate i32.const 5 call $std/typedarray/testInstantiate i32.const 3 call $~lib/typedarray/Int32Array#constructor - global.set $std/typedarray/arr - global.get $std/typedarray/arr + local.tee $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/arr + call $~lib/typedarray/Int32Array#__set + local.get $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/arr + call $~lib/typedarray/Int32Array#__set + local.get $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/arr - i32.load offset=8 - i32.const 2 - i32.shr_u + call $~lib/typedarray/Int32Array#__set + local.get $0 + call $~lib/typedarray/Int32Array#get:length i32.const 3 i32.ne if i32.const 0 - i32.const 8 - i32.const 96 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 95 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/arr - i32.load offset=4 + local.get $0 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset if i32.const 0 - i32.const 8 - i32.const 97 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 96 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/arr + local.get $0 i32.load offset=8 i32.const 12 i32.ne if i32.const 0 - i32.const 8 - i32.const 98 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 97 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/arr + local.get $0 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Int32Array#__get i32.const 1 i32.ne if i32.const 0 - i32.const 8 - i32.const 99 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 98 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/arr + local.get $0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Int32Array#__get i32.const 2 i32.ne if i32.const 0 - i32.const 8 - i32.const 100 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 99 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/arr + local.get $0 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Int32Array#__get i32.const 3 i32.ne if i32.const 0 - i32.const 8 - i32.const 101 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 100 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/arr + local.get $0 i32.const 1 i32.const 2 call $~lib/typedarray/Int32Array#subarray - global.set $std/typedarray/arr - global.get $std/typedarray/arr - i32.load offset=8 - i32.const 2 - i32.shr_u + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/typedarray/Int32Array#get:length i32.const 1 i32.ne if i32.const 0 - i32.const 8 - i32.const 104 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 103 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/arr - i32.load offset=4 + local.get $1 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 4 i32.ne if i32.const 0 - i32.const 8 - i32.const 105 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/arr + local.get $1 i32.load offset=8 i32.const 4 i32.ne if i32.const 0 - i32.const 8 - i32.const 106 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 105 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/arr + local.get $1 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Int32Array#__get i32.const 2 i32.ne if i32.const 0 - i32.const 8 - i32.const 107 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 106 + i32.const 2 + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release i32.const 8 - call $~lib/typedarray/Int64Array#constructor - global.set $std/typedarray/af64 - global.get $std/typedarray/af64 + call $~lib/typedarray/Float64Array#constructor + local.tee $0 i32.const 0 f64.const 1 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/af64 + call $~lib/typedarray/Float64Array#__set + local.get $0 i32.const 1 f64.const 2 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/af64 + call $~lib/typedarray/Float64Array#__set + local.get $0 i32.const 2 f64.const 7 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/af64 + call $~lib/typedarray/Float64Array#__set + local.get $0 i32.const 3 f64.const 6 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/af64 + call $~lib/typedarray/Float64Array#__set + local.get $0 i32.const 4 f64.const 5 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/af64 + call $~lib/typedarray/Float64Array#__set + local.get $0 i32.const 5 f64.const 4 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/af64 + call $~lib/typedarray/Float64Array#__set + local.get $0 i32.const 6 f64.const 3 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/af64 + call $~lib/typedarray/Float64Array#__set + local.get $0 i32.const 7 f64.const 8 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/af64 + call $~lib/typedarray/Float64Array#__set + local.get $0 i32.const 2 i32.const 6 call $~lib/typedarray/Float64Array#subarray - global.set $std/typedarray/af64 - global.get $std/typedarray/af64 - i32.load offset=8 - i32.const 3 - i32.shr_u + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/typedarray/Int64Array#get:length i32.const 4 i32.ne if i32.const 0 - i32.const 8 - i32.const 121 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 122 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/af64 - i32.load offset=4 + local.get $1 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 16 i32.ne if i32.const 0 - i32.const 8 - i32.const 122 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 123 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/af64 + local.get $1 i32.load offset=8 i32.const 32 i32.ne if i32.const 0 - i32.const 8 - i32.const 123 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 124 + i32.const 2 + call $~lib/builtins/abort unreachable end i32.const 0 global.set $~lib/argc - global.get $std/typedarray/af64 - local.set $1 + i32.const 0 + local.set $0 block $1of1 block $0of1 block $outOfRange @@ -12356,674 +14657,780 @@ local.get $1 local.get $0 call $~lib/typedarray/Float64Array#sort - block (result i32) - block (result i32) - global.get $std/typedarray/af64 - i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - f64.const 4 - f64.eq - local.tee $0 - if - global.get $std/typedarray/af64 - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - f64.const 5 - f64.eq - local.set $0 - end - local.get $0 - end - if - global.get $std/typedarray/af64 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - f64.const 6 - f64.eq - local.set $0 - end - local.get $0 + call $~lib/rt/pure/__release + local.get $1 + i32.const 0 + call $~lib/typedarray/Float64Array#__get + f64.const 4 + f64.eq + if (result i32) + local.get $1 + i32.const 1 + call $~lib/typedarray/Float64Array#__get + f64.const 5 + f64.eq + else + i32.const 0 + end + if (result i32) + local.get $1 + i32.const 2 + call $~lib/typedarray/Float64Array#__get + f64.const 6 + f64.eq + else + i32.const 0 end if (result i32) - global.get $std/typedarray/af64 + local.get $1 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Float64Array#__get f64.const 7 f64.eq else - local.get $0 + i32.const 0 end i32.eqz if i32.const 0 - i32.const 8 - i32.const 125 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 126 + i32.const 2 + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release i32.const 3 call $~lib/typedarray/Uint8ClampedArray#constructor - global.set $std/typedarray/clampedArr - global.get $std/typedarray/clampedArr + local.tee $0 i32.const 0 i32.const -32 call $~lib/typedarray/Uint8ClampedArray#__set - global.get $std/typedarray/clampedArr + local.get $0 i32.const 1 i32.const 2 call $~lib/typedarray/Uint8ClampedArray#__set - global.get $std/typedarray/clampedArr + local.get $0 i32.const 2 i32.const 256 call $~lib/typedarray/Uint8ClampedArray#__set - global.get $std/typedarray/clampedArr + local.get $0 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and + call $~lib/typedarray/Uint8ClampedArray#__get if i32.const 0 - i32.const 8 - i32.const 132 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 135 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/clampedArr + local.get $0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and + call $~lib/typedarray/Uint8ClampedArray#__get i32.const 2 i32.ne if i32.const 0 - i32.const 8 - i32.const 133 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 136 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/clampedArr + local.get $0 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and + call $~lib/typedarray/Uint8ClampedArray#__get i32.const 255 i32.ne if i32.const 0 - i32.const 8 - i32.const 134 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 137 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 0 + local.get $0 + call $~lib/rt/pure/__release i32.const 5 call $~lib/typedarray/Int8Array#constructor - global.set $std/typedarray/arr8 - global.get $std/typedarray/arr8 + local.tee $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/arr8 + call $~lib/typedarray/Int8Array#__set + local.get $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/arr8 + call $~lib/typedarray/Int8Array#__set + local.get $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/arr8 + call $~lib/typedarray/Int8Array#__set + local.get $0 i32.const 3 i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/arr8 + call $~lib/typedarray/Int8Array#__set + local.get $0 i32.const 4 i32.const 5 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/arr8 + call $~lib/typedarray/Int8Array#__set + local.get $0 i32.const 1 i32.const 1 i32.const 3 call $~lib/typedarray/Int8Array#fill - global.get $std/typedarray/arr8 - i32.const 192 + call $~lib/rt/pure/__release + local.get $0 + i32.const 5 + i32.const 0 + i32.const 14 + i32.const 488 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $2 call $std/typedarray/isInt8ArrayEqual i32.eqz if i32.const 0 - i32.const 8 - i32.const 144 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 149 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 1 - global.set $~lib/argc - global.get $std/typedarray/arr8 + local.get $0 + i32.const 0 i32.const 0 + i32.const 2147483647 + call $~lib/typedarray/Int8Array#fill + call $~lib/rt/pure/__release + local.get $0 + i32.const 5 i32.const 0 - call $~lib/typedarray/Int8Array#fill|trampoline - global.get $std/typedarray/arr8 - i32.const 216 + i32.const 14 + i32.const 560 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $3 call $std/typedarray/isInt8ArrayEqual i32.eqz if i32.const 0 - i32.const 8 - i32.const 147 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 152 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/arr8 + local.get $0 i32.const 1 i32.const 0 i32.const -3 call $~lib/typedarray/Int8Array#fill - global.get $std/typedarray/arr8 - i32.const 240 + call $~lib/rt/pure/__release + local.get $0 + i32.const 5 + i32.const 0 + i32.const 14 + i32.const 584 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $4 call $std/typedarray/isInt8ArrayEqual i32.eqz if i32.const 0 - i32.const 8 - i32.const 150 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 155 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 2 - global.set $~lib/argc - global.get $std/typedarray/arr8 + local.get $0 i32.const 2 i32.const -2 - call $~lib/typedarray/Int8Array#fill|trampoline - global.get $std/typedarray/arr8 - i32.const 264 + i32.const 2147483647 + call $~lib/typedarray/Int8Array#fill + call $~lib/rt/pure/__release + local.get $0 + i32.const 5 + i32.const 0 + i32.const 14 + i32.const 608 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $5 call $std/typedarray/isInt8ArrayEqual i32.eqz if i32.const 0 - i32.const 8 - i32.const 153 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 158 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/arr8 + local.get $0 i32.const 0 i32.const 1 i32.const 0 call $~lib/typedarray/Int8Array#fill - global.get $std/typedarray/arr8 - i32.const 288 + call $~lib/rt/pure/__release + local.get $0 + i32.const 5 + i32.const 0 + i32.const 14 + i32.const 632 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $6 call $std/typedarray/isInt8ArrayEqual i32.eqz if i32.const 0 - i32.const 8 - i32.const 156 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 161 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/arr8 + local.get $0 i32.const 1 i32.const 4 call $~lib/typedarray/Int8Array#subarray - global.set $std/typedarray/sub8 - i32.const 1 - global.set $~lib/argc - global.get $std/typedarray/sub8 + local.tee $1 i32.const 0 i32.const 0 - call $~lib/typedarray/Int8Array#fill|trampoline - global.get $std/typedarray/sub8 + i32.const 2147483647 + call $~lib/typedarray/Int8Array#fill + call $~lib/rt/pure/__release + local.get $1 i32.load offset=8 i32.const 3 i32.ne if i32.const 0 - i32.const 8 - i32.const 160 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 165 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/sub8 - i32.load offset=4 + local.get $1 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 1 i32.ne if i32.const 0 - i32.const 8 - i32.const 161 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 166 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/sub8 + local.get $1 i32.load offset=8 i32.const 3 i32.ne if i32.const 0 - i32.const 8 - i32.const 162 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 167 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/sub8 - i32.const 312 + local.get $1 + i32.const 3 + i32.const 0 + i32.const 14 + i32.const 656 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $7 call $std/typedarray/isInt8ArrayEqual i32.eqz if i32.const 0 - i32.const 8 - i32.const 163 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 168 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/arr8 - i32.const 336 + local.get $0 + i32.const 5 + i32.const 0 + i32.const 14 + i32.const 680 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $8 call $std/typedarray/isInt8ArrayEqual i32.eqz if i32.const 0 - i32.const 8 - i32.const 164 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 169 + i32.const 2 + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release + local.get $8 + call $~lib/rt/pure/__release i32.const 5 call $~lib/typedarray/Int32Array#constructor - global.set $std/typedarray/arr32 - global.get $std/typedarray/arr32 + local.tee $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/arr32 + call $~lib/typedarray/Int32Array#__set + local.get $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/arr32 + call $~lib/typedarray/Int32Array#__set + local.get $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/arr32 + call $~lib/typedarray/Int32Array#__set + local.get $0 i32.const 3 i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/arr32 + call $~lib/typedarray/Int32Array#__set + local.get $0 i32.const 4 i32.const 5 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/arr32 + call $~lib/typedarray/Int32Array#__set + local.get $0 i32.const 1 i32.const 1 i32.const 3 call $~lib/typedarray/Int32Array#fill - global.get $std/typedarray/arr32 - i32.const 376 + call $~lib/rt/pure/__release + local.get $0 + i32.const 5 + i32.const 2 + i32.const 15 + i32.const 704 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $2 call $std/typedarray/isInt32ArrayEqual i32.eqz if i32.const 0 - i32.const 8 - i32.const 174 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 181 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 1 - global.set $~lib/argc - global.get $std/typedarray/arr32 + local.get $0 i32.const 0 i32.const 0 - call $~lib/typedarray/Int32Array#fill|trampoline - global.get $std/typedarray/arr32 - i32.const 416 + i32.const 2147483647 + call $~lib/typedarray/Int32Array#fill + call $~lib/rt/pure/__release + local.get $0 + i32.const 5 + i32.const 2 + i32.const 15 + i32.const 744 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $3 call $std/typedarray/isInt32ArrayEqual i32.eqz if i32.const 0 - i32.const 8 - i32.const 177 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 184 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/arr32 + local.get $0 i32.const 1 i32.const 0 i32.const -3 call $~lib/typedarray/Int32Array#fill - global.get $std/typedarray/arr32 - i32.const 456 + call $~lib/rt/pure/__release + local.get $0 + i32.const 5 + i32.const 2 + i32.const 15 + i32.const 784 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $4 call $std/typedarray/isInt32ArrayEqual i32.eqz if i32.const 0 - i32.const 8 - i32.const 180 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 187 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 2 - global.set $~lib/argc - global.get $std/typedarray/arr32 + local.get $0 i32.const 2 i32.const -2 - call $~lib/typedarray/Int32Array#fill|trampoline - global.get $std/typedarray/arr32 - i32.const 496 + i32.const 2147483647 + call $~lib/typedarray/Int32Array#fill + call $~lib/rt/pure/__release + local.get $0 + i32.const 5 + i32.const 2 + i32.const 15 + i32.const 824 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $5 call $std/typedarray/isInt32ArrayEqual i32.eqz if i32.const 0 - i32.const 8 - i32.const 183 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 190 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/arr32 + local.get $0 i32.const 0 i32.const 1 i32.const 0 call $~lib/typedarray/Int32Array#fill - global.get $std/typedarray/arr32 - i32.const 536 + call $~lib/rt/pure/__release + local.get $0 + i32.const 5 + i32.const 2 + i32.const 15 + i32.const 864 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $6 call $std/typedarray/isInt32ArrayEqual i32.eqz if i32.const 0 - i32.const 8 - i32.const 186 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 193 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/arr32 + local.get $0 i32.const 1 i32.const 4 call $~lib/typedarray/Int32Array#subarray - global.set $std/typedarray/sub32 - i32.const 1 - global.set $~lib/argc - global.get $std/typedarray/sub32 + local.tee $1 i32.const 0 i32.const 0 - call $~lib/typedarray/Int32Array#fill|trampoline - global.get $std/typedarray/sub32 - i32.load offset=8 - i32.const 2 - i32.shr_u + i32.const 2147483647 + call $~lib/typedarray/Int32Array#fill + call $~lib/rt/pure/__release + local.get $1 + call $~lib/typedarray/Int32Array#get:length i32.const 3 i32.ne if i32.const 0 - i32.const 8 - i32.const 190 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 197 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/sub32 - i32.load offset=4 + local.get $1 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 4 - i32.ne - if - i32.const 0 - i32.const 8 - i32.const 191 + i32.ne + if i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 198 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/sub32 + local.get $1 i32.load offset=8 i32.const 12 i32.ne if i32.const 0 - i32.const 8 - i32.const 192 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 199 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/sub32 - i32.const 576 + local.get $1 + i32.const 3 + i32.const 2 + i32.const 15 + i32.const 904 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $7 call $std/typedarray/isInt32ArrayEqual i32.eqz if i32.const 0 - i32.const 8 - i32.const 193 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 200 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/arr32 - i32.const 616 + local.get $0 + i32.const 5 + i32.const 2 + i32.const 15 + i32.const 936 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $8 call $std/typedarray/isInt32ArrayEqual i32.eqz if i32.const 0 - i32.const 8 - i32.const 194 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 201 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 134217727 - call $~lib/typedarray/Int64Array#constructor - drop - i32.const 0 + local.get $0 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release + local.get $8 + call $~lib/rt/pure/__release i32.const 6 call $~lib/typedarray/Int8Array#constructor - global.set $std/typedarray/multisubarr - global.get $std/typedarray/multisubarr + local.tee $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/multisubarr + call $~lib/typedarray/Int8Array#__set + local.get $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/multisubarr + call $~lib/typedarray/Int8Array#__set + local.get $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/multisubarr + call $~lib/typedarray/Int8Array#__set + local.get $0 i32.const 3 i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/multisubarr + call $~lib/typedarray/Int8Array#__set + local.get $0 i32.const 4 i32.const 5 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/multisubarr + call $~lib/typedarray/Int8Array#__set + local.get $0 i32.const 5 i32.const 6 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/multisubarr + call $~lib/typedarray/Int8Array#__set + local.get $0 i32.const 1 i32.const 6 call $~lib/typedarray/Int8Array#subarray - global.set $std/typedarray/multisubarr1 - global.get $std/typedarray/multisubarr1 + local.tee $1 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and + call $~lib/typedarray/Int8Array#__get i32.const 2 i32.ne if i32.const 0 - i32.const 8 - i32.const 211 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 222 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/multisubarr1 + local.get $1 i32.load offset=8 i32.const 5 i32.ne if i32.const 0 - i32.const 8 - i32.const 212 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 223 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/multisubarr1 - i32.load offset=4 + local.get $1 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 1 i32.ne if i32.const 0 - i32.const 8 - i32.const 213 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 224 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/multisubarr1 + local.get $1 i32.load offset=8 i32.const 5 i32.ne if i32.const 0 - i32.const 8 - i32.const 214 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 225 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/multisubarr1 + local.get $1 i32.const 1 i32.const 5 call $~lib/typedarray/Int8Array#subarray - global.set $std/typedarray/multisubarr2 - global.get $std/typedarray/multisubarr2 + local.tee $2 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and + call $~lib/typedarray/Int8Array#__get i32.const 3 i32.ne if i32.const 0 - i32.const 8 - i32.const 217 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 228 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/multisubarr2 + local.get $2 i32.load offset=8 i32.const 4 i32.ne if i32.const 0 - i32.const 8 - i32.const 218 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 229 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/multisubarr2 - i32.load offset=4 + local.get $2 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 2 i32.ne if i32.const 0 - i32.const 8 - i32.const 219 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 230 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/multisubarr2 + local.get $2 i32.load offset=8 i32.const 4 i32.ne if i32.const 0 - i32.const 8 - i32.const 220 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 231 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/multisubarr2 + local.get $2 i32.const 1 i32.const 4 call $~lib/typedarray/Int8Array#subarray - global.set $std/typedarray/multisubarr3 - global.get $std/typedarray/multisubarr3 + local.tee $3 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and + call $~lib/typedarray/Int8Array#__get i32.const 4 i32.ne if i32.const 0 - i32.const 8 - i32.const 223 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 234 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/multisubarr3 + local.get $3 i32.load offset=8 i32.const 3 i32.ne if i32.const 0 - i32.const 8 - i32.const 224 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 235 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/multisubarr3 - i32.load offset=4 + local.get $3 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 3 i32.ne if i32.const 0 - i32.const 8 - i32.const 225 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 236 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/multisubarr3 + local.get $3 i32.load offset=8 i32.const 3 i32.ne if i32.const 0 - i32.const 8 - i32.const 226 - i32.const 0 - call $~lib/env/abort + i32.const 24 + i32.const 237 + i32.const 2 + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release call $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8> call $std/typedarray/testReduce<~lib/typedarray/Uint8Array,u8> call $std/typedarray/testReduce<~lib/typedarray/Uint8ClampedArray,u8> @@ -13107,16 +15514,264 @@ call $std/typedarray/testArrayReverse<~lib/typedarray/Int16Array,i16> call $std/typedarray/testArrayReverse<~lib/typedarray/Uint16Array,u16> call $std/typedarray/testArrayReverse<~lib/typedarray/Int32Array,i32> - call $std/typedarray/testArrayReverse<~lib/typedarray/Int32Array,i32> - call $std/typedarray/testArrayReverse<~lib/typedarray/Int64Array,i64> + call $std/typedarray/testArrayReverse<~lib/typedarray/Uint32Array,u32> call $std/typedarray/testArrayReverse<~lib/typedarray/Int64Array,i64> + call $std/typedarray/testArrayReverse<~lib/typedarray/Uint64Array,u64> call $std/typedarray/testArrayReverse<~lib/typedarray/Float32Array,f32> call $std/typedarray/testArrayReverse<~lib/typedarray/Float64Array,f64> + global.get $std/typedarray/forEachValues + call $~lib/rt/pure/__release + global.get $std/typedarray/testArrayReverseValues + call $~lib/rt/pure/__release ) - (func $start (; 237 ;) (type $FUNCSIG$v) + (func $start (; 285 ;) (type $FUNCSIG$v) + global.get $~lib/started + if + return + else + i32.const 1 + global.set $~lib/started + end call $start:std/typedarray ) - (func $null (; 238 ;) (type $FUNCSIG$v) + (func $~lib/rt/pure/markGray (; 286 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members + end + ) + (func $~lib/rt/pure/scanBlack (; 287 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 288 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (; 289 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + ) + (func $~lib/rt/pure/__visit (; 290 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + local.get $0 + i32.const 1820 + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $0 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + local.get $1 + i32.const 1 + i32.ne + if + local.get $1 + i32.const 2 + i32.eq + br_if $case1|0 + block $tablify|0 + local.get $1 + i32.const 3 + i32.sub + br_table $case2|0 $case3|0 $case4|0 $tablify|0 + end + br $case5|0 + end + local.get $0 + call $~lib/rt/pure/decrement + br $break|0 + end + local.get $0 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 288 + i32.const 75 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $0 + call $~lib/rt/pure/markGray + br $break|0 + end + local.get $0 + call $~lib/rt/pure/scan + br $break|0 + end + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const -268435456 + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne + if + i32.const 0 + i32.const 288 + i32.const 86 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $1 + i32.const 1879048192 + i32.and + if + local.get $0 + call $~lib/rt/pure/scanBlack + end + br $break|0 + end + local.get $0 + call $~lib/rt/pure/collectWhite + br $break|0 + end + i32.const 0 + i32.const 288 + i32.const 97 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/__visit_members (; 291 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + block $block$4$break + block $switch$1$default + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $block$4$break $block$4$break $block$4$break $block$4$break $block$4$break $block$4$break $block$4$break $block$4$break $block$4$break $block$4$break $block$4$break $block$4$break $block$4$break $block$4$break $switch$1$default + end + return + end + unreachable + end + local.get $0 + i32.load + local.tee $0 + if + local.get $0 + local.get $1 + call $~lib/rt/pure/__visit + end + ) + (func $null (; 292 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/typedarray.ts b/tests/compiler/std/typedarray.ts index 743198c183..83e19de565 100644 --- a/tests/compiler/std/typedarray.ts +++ b/tests/compiler/std/typedarray.ts @@ -26,8 +26,6 @@ function isInt32ArrayEqual(a: Int32Array, b: Array): bool { return true; } -import "allocator/arena"; - function testInstantiate(len: i32): void { var i8a = new Int8Array(len); @@ -89,153 +87,166 @@ function testInstantiate(len: i32): void { testInstantiate(0); testInstantiate(5); -var arr = new Int32Array(3); -arr[0] = 1; -arr[1] = 2; -arr[2] = 3; -assert(arr.length == 3); -assert(arr.byteOffset == 0); -assert(arr.byteLength == 3 * sizeof()); -assert(arr[0] == 1); -assert(arr[1] == 2); -assert(arr[2] == 3); - -arr = arr.subarray(1, 2); -assert(arr.length == 1); -assert(arr.byteOffset == 1 * sizeof()); -assert(arr.byteLength == 1 * sizeof()); -assert(arr[0] == 2); - -var af64 = new Float64Array(8); -af64[0] = 1; -af64[1] = 2; - -af64[2] = 7; -af64[3] = 6; -af64[4] = 5; -af64[5] = 4; - -af64[6] = 3; -af64[7] = 8; -af64 = af64.subarray(2, 6); -assert(af64.length == 4); -assert(af64.byteOffset == 2 * sizeof()); -assert(af64.byteLength == 4 * sizeof()); -af64.sort(); -assert(af64[0] == 4 && af64[1] == 5 && af64[2] == 6 && af64[3] == 7); - -var clampedArr = new Uint8ClampedArray(3); -clampedArr[0] = -32; -clampedArr[1] = 2; -clampedArr[2] = 256; - -assert(clampedArr[0] == 0); -assert(clampedArr[1] == 2); -assert(clampedArr[2] == 255); - -var arr8 = new Int8Array(5); -arr8[0] = 1; -arr8[1] = 2; -arr8[2] = 3; -arr8[3] = 4; -arr8[4] = 5; - -arr8.fill(1, 1, 3); -assert(isInt8ArrayEqual(arr8, [1, 1, 1, 4, 5])); - -arr8.fill(0); -assert(isInt8ArrayEqual(arr8, [0, 0, 0, 0, 0])); - -arr8.fill(1, 0, -3); -assert(isInt8ArrayEqual(arr8, [1, 1, 0, 0, 0])); - -arr8.fill(2, -2); -assert(isInt8ArrayEqual(arr8, [1, 1, 0, 2, 2])); - -arr8.fill(0, 1, 0); -assert(isInt8ArrayEqual(arr8, [1, 1, 0, 2, 2])); - -var sub8 = arr8.subarray(1, 4); -sub8.fill(0); -assert(sub8.length == 3); -assert(sub8.byteOffset == 1); -assert(sub8.byteLength == 3); -assert(isInt8ArrayEqual(sub8, [0, 0, 0])); -assert(isInt8ArrayEqual(arr8, [1, 0, 0, 0, 2])); - -var arr32 = new Int32Array(5); -arr32[0] = 1; -arr32[1] = 2; -arr32[2] = 3; -arr32[3] = 4; -arr32[4] = 5; - -arr32.fill(1, 1, 3); -assert(isInt32ArrayEqual(arr32, [1, 1, 1, 4, 5])); - -arr32.fill(0); -assert(isInt32ArrayEqual(arr32, [0, 0, 0, 0, 0])); - -arr32.fill(1, 0, -3); -assert(isInt32ArrayEqual(arr32, [1, 1, 0, 0, 0])); - -arr32.fill(2, -2); -assert(isInt32ArrayEqual(arr32, [1, 1, 0, 2, 2])); - -arr32.fill(0, 1, 0); -assert(isInt32ArrayEqual(arr32, [1, 1, 0, 2, 2])); - -var sub32 = arr32.subarray(1, 4); -sub32.fill(0); -assert(sub32.length == 3); -assert(sub32.byteOffset == 1 * sizeof()); -assert(sub32.byteLength == 3 * sizeof()); -assert(isInt32ArrayEqual(sub32, [0, 0, 0])); -assert(isInt32ArrayEqual(arr32, [1, 0, 0, 0, 2])); - -import { MAX_BLENGTH } from "internal/arraybuffer"; - -const MAX_F64LENGTH = MAX_BLENGTH >> alignof(); -new Float64Array(MAX_F64LENGTH); // 1GB -// new Float64Array(MAX_F64 + 1); // throws - -var multisubarr = new Int8Array(6); -multisubarr[0] = 1; -multisubarr[1] = 2; -multisubarr[2] = 3; -multisubarr[3] = 4; -multisubarr[4] = 5; -multisubarr[5] = 6; - -var multisubarr1 = multisubarr.subarray(1, 6); -assert(multisubarr1[0] === 2); -assert(multisubarr1.length === 5); -assert(multisubarr1.byteOffset === 1); -assert(multisubarr1.byteLength === 5); - -var multisubarr2 = multisubarr1.subarray(1, 5); -assert(multisubarr2[0] === 3); -assert(multisubarr2.length === 4); -assert(multisubarr2.byteOffset === 2); -assert(multisubarr2.byteLength === 4); - -var multisubarr3 = multisubarr2.subarray(1, 4); -assert(multisubarr3[0] === 4); -assert(multisubarr3.length === 3); -assert(multisubarr3.byteOffset === 3); -assert(multisubarr3.byteLength === 3); - -/** - * Reduce test suite: - * The reduce test is designed to test a simple sum reduction. In each test it instantiates the - * tested typedarray, and sets the values manually. Then it calls `TypedArray.prototype.reduce` with a - * single sum arrow function reduction. For each reduction, it verifies the `self` parameter is the - * instantiated array, the index is the correct index, and it increments the testIndex variable. - * Finally, it asserts the value is 6. - * - * TODO: When function closure support is added, remove the function comments to fully verify the - * tests work. - */ +{ + let arr = new Int32Array(3); + arr[0] = 1; + arr[1] = 2; + arr[2] = 3; + assert(arr.length == 3); + assert(arr.byteOffset == 0); + assert(arr.byteLength == 3 * sizeof()); + assert(arr[0] == 1); + assert(arr[1] == 2); + assert(arr[2] == 3); + + arr = arr.subarray(1, 2); + assert(arr.length == 1); + assert(arr.byteOffset == 1 * sizeof()); + assert(arr.byteLength == 1 * sizeof()); + assert(arr[0] == 2); +} + +{ + let af64 = new Float64Array(8); + af64[0] = 1; + af64[1] = 2; + + af64[2] = 7; + af64[3] = 6; + af64[4] = 5; + af64[5] = 4; + + af64[6] = 3; + af64[7] = 8; + af64 = af64.subarray(2, 6); + assert(af64.length == 4); + assert(af64.byteOffset == 2 * sizeof()); + assert(af64.byteLength == 4 * sizeof()); + af64.sort(); + assert(af64[0] == 4 && af64[1] == 5 && af64[2] == 6 && af64[3] == 7); +} + +{ + let clampedArr = new Uint8ClampedArray(3); + clampedArr[0] = -32; + clampedArr[1] = 2; + clampedArr[2] = 256; + + assert(clampedArr[0] == 0); + assert(clampedArr[1] == 2); + assert(clampedArr[2] == 255); +} + +{ + let arr8 = new Int8Array(5); + arr8[0] = 1; + arr8[1] = 2; + arr8[2] = 3; + arr8[3] = 4; + arr8[4] = 5; + + arr8.fill(1, 1, 3); + assert(isInt8ArrayEqual(arr8, [1, 1, 1, 4, 5])); + + arr8.fill(0); + assert(isInt8ArrayEqual(arr8, [0, 0, 0, 0, 0])); + + arr8.fill(1, 0, -3); + assert(isInt8ArrayEqual(arr8, [1, 1, 0, 0, 0])); + + arr8.fill(2, -2); + assert(isInt8ArrayEqual(arr8, [1, 1, 0, 2, 2])); + + arr8.fill(0, 1, 0); + assert(isInt8ArrayEqual(arr8, [1, 1, 0, 2, 2])); + + let sub8 = arr8.subarray(1, 4); + sub8.fill(0); + assert(sub8.length == 3); + assert(sub8.byteOffset == 1); + assert(sub8.byteLength == 3); + assert(isInt8ArrayEqual(sub8, [0, 0, 0])); + assert(isInt8ArrayEqual(arr8, [1, 0, 0, 0, 2])); +} + +{ + let arr32 = new Int32Array(5); + arr32[0] = 1; + arr32[1] = 2; + arr32[2] = 3; + arr32[3] = 4; + arr32[4] = 5; + + arr32.fill(1, 1, 3); + assert(isInt32ArrayEqual(arr32, [1, 1, 1, 4, 5])); + + arr32.fill(0); + assert(isInt32ArrayEqual(arr32, [0, 0, 0, 0, 0])); + + arr32.fill(1, 0, -3); + assert(isInt32ArrayEqual(arr32, [1, 1, 0, 0, 0])); + + arr32.fill(2, -2); + assert(isInt32ArrayEqual(arr32, [1, 1, 0, 2, 2])); + + arr32.fill(0, 1, 0); + assert(isInt32ArrayEqual(arr32, [1, 1, 0, 2, 2])); + + let sub32 = arr32.subarray(1, 4); + sub32.fill(0); + assert(sub32.length == 3); + assert(sub32.byteOffset == 1 * sizeof()); + assert(sub32.byteLength == 3 * sizeof()); + assert(isInt32ArrayEqual(sub32, [0, 0, 0])); + assert(isInt32ArrayEqual(arr32, [1, 0, 0, 0, 2])); +} + +import { BLOCK_MAXSIZE } from "rt/common"; + +// FIXME: this does not work / failing assertion on insertBlock(addMemory) +{ + // const MAX_F64LENGTH = (BLOCK_MAXSIZE >> alignof()) >> 1; + // new Float64Array(MAX_F64LENGTH + 200); +} + +{ + let multisubarr = new Int8Array(6); + multisubarr[0] = 1; + multisubarr[1] = 2; + multisubarr[2] = 3; + multisubarr[3] = 4; + multisubarr[4] = 5; + multisubarr[5] = 6; + + let multisubarr1 = multisubarr.subarray(1, 6); + assert(multisubarr1[0] === 2); + assert(multisubarr1.length === 5); + assert(multisubarr1.byteOffset === 1); + assert(multisubarr1.byteLength === 5); + + let multisubarr2 = multisubarr1.subarray(1, 5); + assert(multisubarr2[0] === 3); + assert(multisubarr2.length === 4); + assert(multisubarr2.byteOffset === 2); + assert(multisubarr2.byteLength === 4); + + let multisubarr3 = multisubarr2.subarray(1, 4); + assert(multisubarr3[0] === 4); + assert(multisubarr3.length === 3); + assert(multisubarr3.byteOffset === 3); + assert(multisubarr3.byteLength === 3); +} + +// Reduce test suite: + +// The reduce test is designed to test a simple sum reduction. In each test it instantiates the +// tested typedarray, and sets the values manually. Then it calls `TypedArray.prototype.reduce` with a +// single sum arrow function reduction. For each reduction, it verifies the `self` parameter is the +// instantiated array, the index is the correct index, and it increments the testIndex variable. +// Finally, it asserts the value is 6. + +// TODO: When function closure support is added, remove the function comments to fully verify the +// tests work. function testReduce, T extends number>(): void { var array: ArrayType = instantiate(3); @@ -442,7 +453,6 @@ testArrayForEach(); testArrayForEach(); testArrayForEach(); - var testArrayReverseValues: i32[] = [1, 2, 3, 4, 5, 6, 7, 8, 9]; function testArrayReverse, T extends number>(): void { var values = testArrayReverseValues; @@ -480,3 +490,8 @@ testArrayReverse(); testArrayReverse(); testArrayReverse(); testArrayReverse(); + +// Unleak globals + +__release(changetype(forEachValues)); +__release(changetype(testArrayReverseValues)); diff --git a/tests/compiler/std/typedarray.untouched.wat b/tests/compiler/std/typedarray.untouched.wat index fe461b5379..019e9be28d 100644 --- a/tests/compiler/std/typedarray.untouched.wat +++ b/tests/compiler/std/typedarray.untouched.wat @@ -1,11 +1,12 @@ (module (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) - (type $FUNCSIG$v (func)) (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$vii (func (param i32 i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$viii (func (param i32 i32 i32))) - (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$viid (func (param i32 i32 f64))) (type $FUNCSIG$idd (func (param f64 f64) (result i32))) (type $FUNCSIG$dii (func (param i32 i32) (result f64))) @@ -27,58 +28,57 @@ (type $FUNCSIG$ifii (func (param f32 i32 i32) (result i32))) (type $FUNCSIG$idii (func (param f64 i32 i32) (result i32))) (type $FUNCSIG$fff (func (param f32 f32) (result f32))) + (type $FUNCSIG$if (func (param f32) (result i32))) (type $FUNCSIG$ddd (func (param f64 f64) (result f64))) - (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$id (func (param f64) (result i32))) (type $FUNCSIG$vjii (func (param i64 i32 i32))) (type $FUNCSIG$vfii (func (param f32 i32 i32))) (type $FUNCSIG$vdii (func (param f64 i32 i32))) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32))) + (import "rtrace" "onincrement" (func $~lib/rt/rtrace/onincrement (param i32))) + (import "rtrace" "ondecrement" (func $~lib/rt/rtrace/ondecrement (param i32))) + (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) (memory $0 1) - (data (i32.const 8) "\11\00\00\00s\00t\00d\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s\00") - (data (i32.const 48) "\1b\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s\00") - (data (i32.const 112) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") - (data (i32.const 176) "\05\00\00\00\00\00\00\00\01\01\01\04\05\00\00\00") - (data (i32.const 192) "\b0\00\00\00\05\00\00\00") - (data (i32.const 200) "\05\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 216) "\c8\00\00\00\05\00\00\00") - (data (i32.const 224) "\05\00\00\00\00\00\00\00\01\01\00\00\00\00\00\00") - (data (i32.const 240) "\e0\00\00\00\05\00\00\00") - (data (i32.const 248) "\05\00\00\00\00\00\00\00\01\01\00\02\02\00\00\00") - (data (i32.const 264) "\f8\00\00\00\05\00\00\00") - (data (i32.const 272) "\05\00\00\00\00\00\00\00\01\01\00\02\02\00\00\00") - (data (i32.const 288) "\10\01\00\00\05\00\00\00") - (data (i32.const 296) "\03\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 312) "(\01\00\00\03\00\00\00") - (data (i32.const 320) "\05\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00") - (data (i32.const 336) "@\01\00\00\05\00\00\00") - (data (i32.const 344) "\14\00\00\00\00\00\00\00\01\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00\05\00\00\00\00\00\00\00") - (data (i32.const 376) "X\01\00\00\05\00\00\00") - (data (i32.const 384) "\14\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 416) "\80\01\00\00\05\00\00\00") - (data (i32.const 424) "\14\00\00\00\00\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 456) "\a8\01\00\00\05\00\00\00") - (data (i32.const 464) "\14\00\00\00\00\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\02\00\00\00\00\00\00\00") - (data (i32.const 496) "\d0\01\00\00\05\00\00\00") - (data (i32.const 504) "\14\00\00\00\00\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\02\00\00\00\00\00\00\00") - (data (i32.const 536) "\f8\01\00\00\05\00\00\00") - (data (i32.const 544) "\0c\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 576) " \02\00\00\03\00\00\00") - (data (i32.const 584) "\14\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\02\00\00\00\00\00\00\00") - (data (i32.const 616) "H\02\00\00\05\00\00\00") - (data (i32.const 624) "\0f\00\00\00r\00e\00s\00u\00l\00t\00 \00m\00i\00s\00m\00a\00t\00c\00h\00") - (data (i32.const 664) "\14\00\00\00f\00a\00i\00l\00 \00r\00e\00s\00u\00l\00t\00 \00m\00i\00s\00m\00a\00t\00c\00h\00") - (data (i32.const 712) "\0c\00\00\00\00\00\00\00\n\00\00\00\0c\00\00\00\0e\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 744) "\c8\02\00\00\03\00\00\00") - (data (i32.const 752) "\16\00\00\00f\00o\00r\00E\00a\00c\00h\00 \00v\00a\00l\00u\00e\00 \00m\00i\00s\00m\00a\00t\00c\00h\00") - (data (i32.const 800) "\16\00\00\00f\00o\00r\00E\00a\00c\00h\00 \00i\00n\00d\00e\00x\00 \00m\00i\00s\00m\00a\00t\00c\00h\00") - (data (i32.const 848) "\1f\00\00\00f\00o\00r\00E\00a\00c\00h\00 \00s\00e\00l\00f\00 \00p\00a\00r\00a\00m\00e\00t\00e\00r\00 \00m\00i\00s\00m\00a\00t\00c\00h\00") - (data (i32.const 920) "\1b\00\00\00f\00o\00r\00E\00a\00c\00h\00 \00c\00a\00l\00l\00 \00c\00o\00u\00n\00t\00 \00m\00i\00s\00m\00a\00t\00c\00h\00") - (data (i32.const 984) "$\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\06\00\00\00\07\00\00\00\08\00\00\00\t\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 1048) "\d8\03\00\00\t\00\00\00") - (data (i32.const 1056) "!\00\00\00T\00y\00p\00e\00d\00A\00r\00r\00a\00y\00 \00r\00e\00v\00e\00r\00s\00e\00 \00v\00a\00l\00u\00e\00 \00m\00i\00s\00m\00a\00t\00c\00h\00") - (data (i32.const 1128) "+\00\00\00T\00y\00p\00e\00d\00A\00r\00r\00a\00y\00 \00r\00e\00v\00e\00r\00s\00e\00 \00w\00i\00t\00h\00 \00b\00y\00t\00e\00O\00f\00f\00s\00e\00t\00 \00m\00i\00s\00m\00a\00t\00c\00h\00") + (data (i32.const 8) "\"\00\00\00\01\00\00\00\01\00\00\00\"\00\00\00s\00t\00d\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s\00") + (data (i32.const 64) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h\00") + (data (i32.const 112) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") + (data (i32.const 168) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 216) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 272) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s\00") + (data (i32.const 320) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 376) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s\00") + (data (i32.const 416) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00~\00l\00i\00b\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s\00") + (data (i32.const 472) "\05\00\00\00\01\00\00\00\00\00\00\00\05\00\00\00\01\01\01\04\05") + (data (i32.const 496) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") + (data (i32.const 544) "\05\00\00\00\01\00\00\00\00\00\00\00\05\00\00\00\00\00\00\00\00") + (data (i32.const 568) "\05\00\00\00\01\00\00\00\00\00\00\00\05\00\00\00\01\01\00\00\00") + (data (i32.const 592) "\05\00\00\00\01\00\00\00\00\00\00\00\05\00\00\00\01\01\00\02\02") + (data (i32.const 616) "\05\00\00\00\01\00\00\00\00\00\00\00\05\00\00\00\01\01\00\02\02") + (data (i32.const 640) "\03\00\00\00\01\00\00\00\00\00\00\00\03\00\00\00\00\00\00") + (data (i32.const 664) "\05\00\00\00\01\00\00\00\00\00\00\00\05\00\00\00\01\00\00\00\02") + (data (i32.const 688) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00\05\00\00\00") + (data (i32.const 728) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 768) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 808) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\02\00\00\00") + (data (i32.const 848) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\02\00\00\00") + (data (i32.const 888) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 920) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\02\00\00\00") + (data (i32.const 960) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00r\00e\00s\00u\00l\00t\00 \00m\00i\00s\00m\00a\00t\00c\00h\00") + (data (i32.const 1008) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00f\00a\00i\00l\00 \00r\00e\00s\00u\00l\00t\00 \00m\00i\00s\00m\00a\00t\00c\00h\00") + (data (i32.const 1064) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\n\00\00\00\0c\00\00\00\0e\00\00\00") + (data (i32.const 1096) "\10\00\00\00\01\00\00\00\0f\00\00\00\10\00\00\008\04\00\008\04\00\00\0c\00\00\00\03\00\00\00") + (data (i32.const 1128) ",\00\00\00\01\00\00\00\01\00\00\00,\00\00\00f\00o\00r\00E\00a\00c\00h\00 \00v\00a\00l\00u\00e\00 \00m\00i\00s\00m\00a\00t\00c\00h\00") + (data (i32.const 1192) ",\00\00\00\01\00\00\00\01\00\00\00,\00\00\00f\00o\00r\00E\00a\00c\00h\00 \00i\00n\00d\00e\00x\00 \00m\00i\00s\00m\00a\00t\00c\00h\00") + (data (i32.const 1256) ">\00\00\00\01\00\00\00\01\00\00\00>\00\00\00f\00o\00r\00E\00a\00c\00h\00 \00s\00e\00l\00f\00 \00p\00a\00r\00a\00m\00e\00t\00e\00r\00 \00m\00i\00s\00m\00a\00t\00c\00h\00") + (data (i32.const 1336) "6\00\00\00\01\00\00\00\01\00\00\006\00\00\00f\00o\00r\00E\00a\00c\00h\00 \00c\00a\00l\00l\00 \00c\00o\00u\00n\00t\00 \00m\00i\00s\00m\00a\00t\00c\00h\00") + (data (i32.const 1408) "$\00\00\00\01\00\00\00\00\00\00\00$\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\06\00\00\00\07\00\00\00\08\00\00\00\t\00\00\00") + (data (i32.const 1464) "\10\00\00\00\01\00\00\00\0f\00\00\00\10\00\00\00\90\05\00\00\90\05\00\00$\00\00\00\t\00\00\00") + (data (i32.const 1496) "B\00\00\00\01\00\00\00\01\00\00\00B\00\00\00T\00y\00p\00e\00d\00A\00r\00r\00a\00y\00 \00r\00e\00v\00e\00r\00s\00e\00 \00v\00a\00l\00u\00e\00 \00m\00i\00s\00m\00a\00t\00c\00h\00") + (data (i32.const 1584) "V\00\00\00\01\00\00\00\01\00\00\00V\00\00\00T\00y\00p\00e\00d\00A\00r\00r\00a\00y\00 \00r\00e\00v\00e\00r\00s\00e\00 \00w\00i\00t\00h\00 \00b\00y\00t\00e\00O\00f\00f\00s\00e\00t\00 \00m\00i\00s\00m\00a\00t\00c\00h\00") + (data (i32.const 1688) "\10\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\001\04\00\00\02\00\00\001\00\00\00\02\00\00\001\00\00\00\02\00\00\00Q\04\00\00\02\00\00\00Q\00\00\00\02\00\00\00\91\04\00\00\02\00\00\00\91\00\00\00\02\00\00\00\11\05\00\00\02\00\00\00\11\01\00\00\02\00\00\00\91\0c\00\00\02\00\00\00\11\0d\00\00\02\00\00\003\04\00\00\02\00\00\00\93\04\00\00\02\00\00\00") (table $0 112 funcref) - (elem (i32.const 0) $null $~lib/internal/sort/COMPARATOR~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Uint16Array,u16>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Uint32Array,u32>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Uint64Array,u64>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Uint16Array,u16>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Uint32Array,u32>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Uint64Array,u64>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Uint16Array,u16>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Uint32Array,u32>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Uint64Array,u64>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Uint8Array,u8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Uint16Array,u16>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Uint16Array,u16>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Uint32Array,u32>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Uint32Array,u32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Uint64Array,u64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Uint64Array,u64>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8Array,u8>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int16Array,i16>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint16Array,u16>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint16Array,u16>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int32Array,i32>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint32Array,u32>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint32Array,u32>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int64Array,i64>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint64Array,u64>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint64Array,u64>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Float32Array,f32>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Float64Array,f64>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Int16Array,i16>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Uint16Array,u16>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint16Array,u16>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Int32Array,i32>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Uint32Array,u32>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint32Array,u32>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Int64Array,i64>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Uint64Array,u64>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint64Array,u64>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Float32Array,f32>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Float64Array,f64>~anonymous|1 $std/typedarray/testArrayForEach<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Uint16Array,u16>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Uint32Array,u32>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Uint64Array,u64>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Float64Array,f64>~anonymous|0) + (elem (i32.const 0) $null $~lib/util/sort/COMPARATOR~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Uint16Array,u16>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Uint32Array,u32>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Uint64Array,u64>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Uint16Array,u16>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Uint32Array,u32>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Uint64Array,u64>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Uint16Array,u16>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Uint32Array,u32>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Uint64Array,u64>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Uint8Array,u8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Uint16Array,u16>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Uint16Array,u16>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Uint32Array,u32>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Uint32Array,u32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Uint64Array,u64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Uint64Array,u64>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8Array,u8>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int16Array,i16>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint16Array,u16>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint16Array,u16>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int32Array,i32>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint32Array,u32>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint32Array,u32>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int64Array,i64>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint64Array,u64>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint64Array,u64>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Float32Array,f32>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Float64Array,f64>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Int16Array,i16>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Uint16Array,u16>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint16Array,u16>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Int32Array,i32>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Uint32Array,u32>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint32Array,u32>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Int64Array,i64>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Uint64Array,u64>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint64Array,u64>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Float32Array,f32>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Float64Array,f64>~anonymous|1 $std/typedarray/testArrayForEach<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Uint16Array,u16>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Uint32Array,u32>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Uint64Array,u64>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Float64Array,f64>~anonymous|0) (global $~lib/typedarray/Int8Array.BYTES_PER_ELEMENT i32 (i32.const 1)) (global $~lib/typedarray/Uint8Array.BYTES_PER_ELEMENT i32 (i32.const 1)) (global $~lib/typedarray/Uint8ClampedArray.BYTES_PER_ELEMENT i32 (i32.const 1)) @@ -90,3524 +90,4049 @@ (global $~lib/typedarray/Uint64Array.BYTES_PER_ELEMENT i32 (i32.const 8)) (global $~lib/typedarray/Float32Array.BYTES_PER_ELEMENT i32 (i32.const 4)) (global $~lib/typedarray/Float64Array.BYTES_PER_ELEMENT i32 (i32.const 8)) - (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) - (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) - (global $std/typedarray/arr (mut i32) (i32.const 0)) - (global $std/typedarray/af64 (mut i32) (i32.const 0)) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) + (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) (global $~lib/argc (mut i32) (i32.const 0)) - (global $std/typedarray/clampedArr (mut i32) (i32.const 0)) - (global $std/typedarray/arr8 (mut i32) (i32.const 0)) (global $~lib/builtins/i32.MAX_VALUE i32 (i32.const 2147483647)) - (global $std/typedarray/sub8 (mut i32) (i32.const 0)) - (global $std/typedarray/arr32 (mut i32) (i32.const 0)) - (global $std/typedarray/sub32 (mut i32) (i32.const 0)) - (global $std/typedarray/MAX_F64LENGTH i32 (i32.const 134217727)) - (global $std/typedarray/multisubarr (mut i32) (i32.const 0)) - (global $std/typedarray/multisubarr1 (mut i32) (i32.const 0)) - (global $std/typedarray/multisubarr2 (mut i32) (i32.const 0)) - (global $std/typedarray/multisubarr3 (mut i32) (i32.const 0)) (global $std/typedarray/forEachCallCount (mut i32) (i32.const 0)) (global $std/typedarray/forEachSelf (mut i32) (i32.const 0)) - (global $std/typedarray/forEachValues (mut i32) (i32.const 744)) - (global $std/typedarray/testArrayReverseValues (mut i32) (i32.const 1048)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 1220)) + (global $std/typedarray/forEachValues (mut i32) (i32.const 1112)) + (global $std/typedarray/testArrayReverseValues (mut i32) (i32.const 1480)) + (global $~lib/started (mut i32) (i32.const 0)) + (global $~lib/rt/__rtti_base i32 (i32.const 1688)) + (global $~lib/heap/__heap_base i32 (i32.const 1820)) + (export "__start" (func $start)) (export "memory" (memory $0)) - (export "table" (table $0)) - (start $start) - (func $start:~lib/allocator/arena (; 1 ;) (type $FUNCSIG$v) - global.get $~lib/memory/HEAP_BASE - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - ) - (func $~lib/internal/arraybuffer/computeSize (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 1 - i32.const 32 - local.get $0 - i32.const 8 - i32.add - i32.const 1 - i32.sub - i32.clz - i32.sub - i32.shl - ) - (func $~lib/allocator/arena/__memory_allocate (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/rt/tlsf/removeBlock (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - local.get $0 - i32.const 1073741824 - i32.gt_u + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz if + i32.const 0 + i32.const 184 + i32.const 276 + i32.const 13 + call $~lib/builtins/abort unreachable end - global.get $~lib/allocator/arena/offset - local.set $1 - local.get $1 - local.get $0 - local.tee $2 - i32.const 1 - local.tee $3 local.get $2 - local.get $3 - i32.gt_u - select - i32.add - i32.const 7 - i32.add - i32.const 7 + i32.const 3 i32.const -1 i32.xor i32.and - local.set $4 - current_memory - local.set $5 - local.get $4 - local.get $5 + local.set $3 + local.get $3 i32.const 16 - i32.shl - i32.gt_u + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 184 + i32.const 278 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 local.get $4 - local.get $1 + i32.const 4 i32.sub - i32.const 65535 - i32.add - i32.const 65535 - i32.const -1 - i32.xor - i32.and - i32.const 16 i32.shr_u - local.set $2 + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) local.get $5 - local.tee $3 - local.get $2 - local.tee $6 - local.get $3 - local.get $6 - i32.gt_s - select - local.set $3 - local.get $3 - grow_memory + i32.const 16 + i32.lt_u + else i32.const 0 - i32.lt_s - if - local.get $2 - grow_memory - i32.const 0 - i32.lt_s - if - unreachable - end - end end - local.get $4 - global.set $~lib/allocator/arena/offset - local.get $1 - ) - (func $~lib/internal/arraybuffer/allocateUnsafe (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - local.get $0 - i32.const 1073741816 - i32.le_u i32.eqz if i32.const 0 - i32.const 112 - i32.const 26 - i32.const 2 - call $~lib/env/abort + i32.const 184 + i32.const 291 + i32.const 13 + call $~lib/builtins/abort unreachable end - block $~lib/memory/memory.allocate|inlined.0 (result i32) - local.get $0 - call $~lib/internal/arraybuffer/computeSize - local.set $2 - local.get $2 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.0 - end - local.set $1 local.get $1 - local.get $0 - i32.store + i32.load offset=16 + local.set $6 local.get $1 - ) - (func $~lib/internal/memory/memset (; 5 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i64) - local.get $2 - i32.eqz + i32.load offset=20 + local.set $7 + local.get $6 if - return + local.get $6 + local.get $7 + i32.store offset=20 end - local.get $0 - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 1 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 2 - i32.le_u + local.get $7 if - return + local.get $7 + local.get $6 + i32.store offset=16 end - local.get $0 - i32.const 1 - i32.add - local.get $1 - i32.store8 - local.get $0 - i32.const 2 - i32.add - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 2 - i32.sub - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 3 - i32.sub local.get $1 - i32.store8 - local.get $2 - i32.const 6 - i32.le_u - if - return + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 end - local.get $0 - i32.const 3 - i32.add - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 4 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 8 - i32.le_u + i32.eq if - return - end - i32.const 0 - local.get $0 - i32.sub - i32.const 3 - i32.and - local.set $3 - local.get $0 - local.get $3 - i32.add - local.set $0 - local.get $2 - local.get $3 - i32.sub - local.set $2 - local.get $2 - i32.const -4 - i32.and - local.set $2 - i32.const -1 - i32.const 255 - i32.div_u - local.get $1 - i32.const 255 - i32.and - i32.mul - local.set $4 - local.get $0 - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 4 - i32.sub - local.get $4 - i32.store - local.get $2 - i32.const 8 - i32.le_u - if - return - end - local.get $0 - i32.const 4 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 12 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 8 - i32.sub - local.get $4 - i32.store - local.get $2 - i32.const 24 - i32.le_u - if - return - end - local.get $0 - i32.const 12 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 16 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 20 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 24 - i32.add - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 28 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 24 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 20 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 16 - i32.sub - local.get $4 - i32.store - i32.const 24 - local.get $0 - i32.const 4 - i32.and - i32.add - local.set $3 - local.get $0 - local.get $3 - i32.add - local.set $0 - local.get $2 - local.get $3 - i32.sub - local.set $2 - local.get $4 - i64.extend_i32_u - local.get $4 - i64.extend_i32_u - i64.const 32 - i64.shl - i64.or - local.set $5 - block $break|0 - loop $continue|0 - local.get $2 - i32.const 32 - i32.ge_u + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $9 + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $8 + local.get $4 + local.set $11 + local.get $9 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $9 + local.set $10 + local.get $8 + local.get $11 + i32.const 2 + i32.shl + i32.add + local.get $10 + i32.store offset=4 + end + local.get $9 + i32.eqz if - block - local.get $0 - local.get $5 - i64.store - local.get $0 - i32.const 8 - i32.add - local.get $5 - i64.store - local.get $0 - i32.const 16 - i32.add - local.get $5 - i64.store - local.get $0 - i32.const 24 - i32.add - local.get $5 - i64.store - local.get $2 - i32.const 32 - i32.sub - local.set $2 - local.get $0 - i32.const 32 - i32.add - local.set $0 - end - br $continue|0 + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store end end end ) - (func $~lib/memory/memory.allocate (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - call $~lib/allocator/arena/__memory_allocate - return - ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/rt/tlsf/insertBlock (; 6 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) local.get $1 - i32.const 1073741816 - i32.gt_u + i32.eqz if i32.const 0 - i32.const 48 - i32.const 23 - i32.const 34 - call $~lib/env/abort + i32.const 184 + i32.const 204 + i32.const 13 + call $~lib/builtins/abort unreachable end local.get $1 - i32.const 0 - i32.shl + i32.load local.set $2 local.get $2 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $3 - block $~lib/memory/memory.fill|inlined.0 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 184 + i32.const 206 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 local.get $3 - i32.const 8 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and i32.add - local.set $4 - i32.const 0 - local.set $5 - local.get $2 - local.set $6 - local.get $4 - local.get $5 - local.get $6 - call $~lib/internal/memory/memset end - block (result i32) - local.get $0 - i32.eqz - if - i32.const 12 - call $~lib/memory/memory.allocate - local.set $0 + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 + i32.const 1 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 end - local.get $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 0 - i32.store offset=8 - local.get $0 end - local.get $3 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 local.get $2 - i32.store offset=8 - local.get $0 - ) - (func $~lib/typedarray/Int8Array#constructor (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 - i32.eqz - if - i32.const 12 - call $~lib/memory/memory.allocate - local.set $0 - end - local.get $0 - local.get $1 - call $~lib/internal/typedarray/TypedArray#constructor - local.set $0 - local.get $0 - ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $1 - i32.const 1073741816 - i32.gt_u + i32.const 2 + i32.and if - i32.const 0 - i32.const 48 - i32.const 23 - i32.const 34 - call $~lib/env/abort - unreachable - end - local.get $1 - i32.const 0 - i32.shl - local.set $2 - local.get $2 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $3 - block $~lib/memory/memory.fill|inlined.1 - local.get $3 - i32.const 8 - i32.add - local.set $4 - i32.const 0 - local.set $5 - local.get $2 + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 4 + i32.sub + i32.load + end local.set $6 - local.get $4 - local.get $5 local.get $6 - call $~lib/internal/memory/memset - end - block (result i32) - local.get $0 + i32.load + local.set $3 + local.get $3 + i32.const 1 + i32.and i32.eqz if - i32.const 12 - call $~lib/memory/memory.allocate - local.set $0 + i32.const 0 + i32.const 184 + i32.const 227 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $6 + call $~lib/rt/tlsf/removeBlock + local.get $6 + local.get $3 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $6 + local.set $1 end - local.get $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 0 - i32.store offset=8 - local.get $0 end - local.get $3 + local.get $4 + local.get $5 + i32.const 2 + i32.or i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 local.get $2 - i32.store offset=8 - local.get $0 - ) - (func $~lib/typedarray/Uint8Array#constructor (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 - i32.eqz - if - i32.const 12 - call $~lib/memory/memory.allocate - local.set $0 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 end - local.get $0 - local.get $1 - call $~lib/internal/typedarray/TypedArray#constructor - local.set $0 - local.get $0 - ) - (func $~lib/typedarray/Uint8ClampedArray#constructor (; 11 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 i32.eqz if - i32.const 12 - call $~lib/memory/memory.allocate - local.set $0 + i32.const 0 + i32.const 184 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable end - local.get $0 - local.get $1 - call $~lib/typedarray/Uint8Array#constructor - local.set $0 - local.get $0 - ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 12 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) local.get $1 - i32.const 536870908 - i32.gt_u + i32.const 16 + i32.add + local.get $8 + i32.add + local.get $4 + i32.eq + i32.eqz if i32.const 0 - i32.const 48 - i32.const 23 - i32.const 34 - call $~lib/env/abort + i32.const 184 + i32.const 243 + i32.const 13 + call $~lib/builtins/abort unreachable end + local.get $4 + i32.const 4 + i32.sub local.get $1 - i32.const 1 - i32.shl - local.set $2 - local.get $2 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $3 - block $~lib/memory/memory.fill|inlined.2 - local.get $3 - i32.const 8 - i32.add - local.set $4 - i32.const 0 - local.set $5 - local.get $2 - local.set $6 - local.get $4 - local.get $5 - local.get $6 - call $~lib/internal/memory/memset - end - block (result i32) - local.get $0 - i32.eqz - if - i32.const 12 - call $~lib/memory/memory.allocate - local.set $0 - end - local.get $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 0 - i32.store offset=8 - local.get $0 - end - local.get $3 i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - local.get $2 - i32.store offset=8 - local.get $0 - ) - (func $~lib/typedarray/Int16Array#constructor (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 - i32.eqz + local.get $8 + i32.const 256 + i32.lt_u if - i32.const 12 - call $~lib/memory/memory.allocate - local.set $0 + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 end - local.get $0 - local.get $1 - call $~lib/internal/typedarray/TypedArray#constructor - local.set $0 - local.get $0 - ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $1 - i32.const 536870908 - i32.gt_u + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz if i32.const 0 - i32.const 48 - i32.const 23 - i32.const 34 - call $~lib/env/abort + i32.const 184 + i32.const 259 + i32.const 13 + call $~lib/builtins/abort unreachable end - local.get $1 - i32.const 1 - i32.shl - local.set $2 - local.get $2 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $3 - block $~lib/memory/memory.fill|inlined.3 + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $7 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $7 local.get $3 - i32.const 8 + i32.const 4 + i32.shl + local.get $6 i32.add - local.set $4 - i32.const 0 - local.set $5 - local.get $2 + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $0 + local.set $12 + local.get $9 + local.set $7 + local.get $10 + local.set $3 + local.get $1 local.set $6 - local.get $4 - local.get $5 + local.get $12 + local.get $7 + i32.const 4 + i32.shl + local.get $3 + i32.add + i32.const 2 + i32.shl + i32.add local.get $6 - call $~lib/internal/memory/memset + i32.store offset=96 end - block (result i32) + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + block $~lib/rt/tlsf/SETSL|inlined.2 local.get $0 - i32.eqz - if - i32.const 12 - call $~lib/memory/memory.allocate - local.set $0 + local.set $13 + local.get $9 + local.set $12 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 end - local.get $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + local.get $7 i32.store offset=4 - local.get $0 - i32.const 0 - i32.store offset=8 - local.get $0 - end - local.get $3 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - local.get $2 - i32.store offset=8 - local.get $0 - ) - (func $~lib/typedarray/Uint16Array#constructor (; 15 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 - i32.eqz - if - i32.const 12 - call $~lib/memory/memory.allocate - local.set $0 end - local.get $0 - local.get $1 - call $~lib/internal/typedarray/TypedArray#constructor - local.set $0 - local.get $0 ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 16 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) + (func $~lib/rt/tlsf/addMemory (; 7 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) local.get $1 - i32.const 268435454 - i32.gt_u - if - i32.const 0 - i32.const 48 - i32.const 23 - i32.const 34 - call $~lib/env/abort - unreachable - end - local.get $1 - i32.const 2 - i32.shl - local.set $2 local.get $2 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $3 - block $~lib/memory/memory.fill|inlined.4 - local.get $3 - i32.const 8 - i32.add - local.set $4 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else i32.const 0 - local.set $5 - local.get $2 - local.set $6 - local.get $4 - local.get $5 - local.get $6 - call $~lib/internal/memory/memset end - block (result i32) - local.get $0 + if (result i32) + local.get $2 + i32.const 15 + i32.and i32.eqz - if - i32.const 12 - call $~lib/memory/memory.allocate - local.set $0 - end - local.get $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 + else i32.const 0 - i32.store offset=8 - local.get $0 end - local.get $3 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - local.get $2 - i32.store offset=8 - local.get $0 - ) - (func $~lib/typedarray/Int32Array#constructor (; 17 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 i32.eqz if - i32.const 12 - call $~lib/memory/memory.allocate - local.set $0 + i32.const 0 + i32.const 184 + i32.const 385 + i32.const 4 + call $~lib/builtins/abort + unreachable end - local.get $0 - local.get $1 - call $~lib/internal/typedarray/TypedArray#constructor - local.set $0 - local.get $0 - ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 18 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $1 - i32.const 268435454 - i32.gt_u - if - i32.const 0 - i32.const 48 - i32.const 23 - i32.const 34 - call $~lib/env/abort - unreachable - end - local.get $1 - i32.const 2 - i32.shl - local.set $2 - local.get $2 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $3 - block $~lib/memory/memory.fill|inlined.5 + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 local.get $3 - i32.const 8 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + local.get $1 + local.get $4 + i32.const 16 i32.add - local.set $4 - i32.const 0 - local.set $5 - local.get $2 - local.set $6 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 184 + i32.const 395 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub local.get $4 - local.get $5 - local.get $6 - call $~lib/internal/memory/memset - end - block (result i32) + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 local.get $0 + i32.const 1572 + i32.add + i32.ge_u i32.eqz if - i32.const 12 - call $~lib/memory/memory.allocate - local.set $0 + i32.const 0 + i32.const 184 + i32.const 407 + i32.const 4 + call $~lib/builtins/abort + unreachable end - local.get $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 0 - i32.store offset=8 - local.get $0 end - local.get $3 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 local.get $2 - i32.store offset=8 - local.get $0 - ) - (func $~lib/typedarray/Uint32Array#constructor (; 19 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 - i32.eqz - if - i32.const 12 - call $~lib/memory/memory.allocate - local.set $0 - end - local.get $0 - local.get $1 - call $~lib/internal/typedarray/TypedArray#constructor - local.set $0 - local.get $0 - ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 20 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) local.get $1 - i32.const 134217727 - i32.gt_u + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u if i32.const 0 - i32.const 48 - i32.const 23 - i32.const 34 - call $~lib/env/abort - unreachable + return end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 local.get $1 - i32.const 3 - i32.shl - local.set $2 - local.get $2 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $3 - block $~lib/memory/memory.fill|inlined.6 - local.get $3 - i32.const 8 - i32.add - local.set $4 - i32.const 0 - local.set $5 - local.get $2 - local.set $6 - local.get $4 - local.get $5 - local.get $6 - call $~lib/internal/memory/memset - end - block (result i32) - local.get $0 - i32.eqz - if - i32.const 12 - call $~lib/memory/memory.allocate - local.set $0 - end - local.get $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 0 - i32.store offset=8 - local.get $0 - end - local.get $3 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or i32.store - local.get $0 + local.get $8 i32.const 0 - i32.store offset=4 - local.get $0 - local.get $2 - i32.store offset=8 - local.get $0 - ) - (func $~lib/typedarray/Int64Array#constructor (; 21 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 - i32.eqz - if - i32.const 12 - call $~lib/memory/memory.allocate - local.set $0 - end - local.get $0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 local.get $1 - call $~lib/internal/typedarray/TypedArray#constructor - local.set $0 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 22 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/rt/tlsf/initializeRoot (; 8 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + memory.size + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $2 + local.get $2 local.get $1 - i32.const 134217727 - i32.gt_u - if + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + memory.grow i32.const 0 - i32.const 48 - i32.const 23 - i32.const 34 - call $~lib/env/abort + i32.lt_s + else + i32.const 0 + end + if unreachable end - local.get $1 - i32.const 3 - i32.shl - local.set $2 - local.get $2 - call $~lib/internal/arraybuffer/allocateUnsafe + local.get $0 local.set $3 - block $~lib/memory/memory.fill|inlined.7 + local.get $3 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 local.get $3 - i32.const 8 - i32.add - local.set $4 - i32.const 0 local.set $5 - local.get $2 - local.set $6 - local.get $4 + i32.const 0 + local.set $4 local.get $5 - local.get $6 - call $~lib/internal/memory/memset + local.get $4 + i32.store offset=1568 end - block (result i32) - local.get $0 - i32.eqz - if - i32.const 12 - call $~lib/memory/memory.allocate - local.set $0 - end - local.get $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 + block $break|0 i32.const 0 - i32.store offset=8 - local.get $0 + local.set $5 + loop $repeat|0 + local.get $5 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $3 + local.set $7 + local.get $5 + local.set $6 + i32.const 0 + local.set $4 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $7 + loop $repeat|1 + local.get $7 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $3 + local.set $9 + local.get $5 + local.set $8 + local.get $7 + local.set $6 + i32.const 0 + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store offset=96 + end + local.get $7 + i32.const 1 + i32.add + local.set $7 + br $repeat|1 + unreachable + end + unreachable + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|0 + unreachable + end + unreachable end local.get $3 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - local.get $2 - i32.store offset=8 local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT ) - (func $~lib/typedarray/Uint64Array#constructor (; 23 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/rt/tlsf/prepareSize (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) local.get $0 - i32.eqz + i32.const 1073741808 + i32.ge_u if - i32.const 12 - call $~lib/memory/memory.allocate - local.set $0 + i32.const 232 + i32.const 184 + i32.const 447 + i32.const 29 + call $~lib/builtins/abort + unreachable end local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 local.get $1 - call $~lib/internal/typedarray/TypedArray#constructor - local.set $0 - local.get $0 + local.get $2 + i32.gt_u + select ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 24 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/rt/tlsf/searchBlock (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) local.get $1 - i32.const 268435454 - i32.gt_u + i32.const 256 + i32.lt_u if i32.const 0 - i32.const 48 - i32.const 23 - i32.const 34 - call $~lib/env/abort - unreachable - end - local.get $1 - i32.const 2 - i32.shl - local.set $2 - local.get $2 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $3 - block $~lib/memory/memory.fill|inlined.8 - local.get $3 - i32.const 8 - i32.add + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end local.set $4 - i32.const 0 - local.set $5 - local.get $2 - local.set $6 + i32.const 31 local.get $4 - local.get $5 - local.get $6 - call $~lib/internal/memory/memset + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 end - block (result i32) - local.get $0 - i32.eqz - if - i32.const 12 - call $~lib/memory/memory.allocate - local.set $0 - end - local.get $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else i32.const 0 - i32.store offset=8 - local.get $0 end - local.get $3 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - local.get $2 - i32.store offset=8 - local.get $0 - ) - (func $~lib/typedarray/Float32Array#constructor (; 25 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 i32.eqz - if - i32.const 12 - call $~lib/memory/memory.allocate - local.set $0 - end - local.get $0 - local.get $1 - call $~lib/internal/typedarray/TypedArray#constructor - local.set $0 - local.get $0 - ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 26 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $1 - i32.const 134217727 - i32.gt_u if i32.const 0 - i32.const 48 - i32.const 23 - i32.const 34 - call $~lib/env/abort + i32.const 184 + i32.const 337 + i32.const 13 + call $~lib/builtins/abort unreachable end - local.get $1 - i32.const 3 - i32.shl - local.set $2 - local.get $2 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $3 - block $~lib/memory/memory.fill|inlined.9 - local.get $3 - i32.const 8 - i32.add - local.set $4 - i32.const 0 + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 local.set $5 local.get $2 - local.set $6 - local.get $4 + local.set $4 local.get $5 - local.get $6 - call $~lib/internal/memory/memset - end - block (result i32) - local.get $0 - i32.eqz - if - i32.const 12 - call $~lib/memory/memory.allocate - local.set $0 - end - local.get $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 0 - i32.store offset=8 - local.get $0 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 end + i32.const 0 + i32.const -1 + i32.xor local.get $3 - i32.store - local.get $0 + i32.shl + i32.and + local.set $6 i32.const 0 - i32.store offset=4 - local.get $0 - local.get $2 - i32.store offset=8 - local.get $0 - ) - (func $~lib/typedarray/Float64Array#constructor (; 27 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - local.get $0 + local.set $7 + local.get $6 i32.eqz if - i32.const 12 - call $~lib/memory/memory.allocate - local.set $0 + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $5 + local.get $5 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $5 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $4 + local.get $8 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 184 + i32.const 350 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 end - local.get $0 - local.get $1 - call $~lib/internal/typedarray/TypedArray#constructor - local.set $0 - local.get $0 + local.get $7 ) - (func $std/typedarray/testInstantiate (; 28 ;) (type $FUNCSIG$vi) (param $0 i32) - (local $1 i32) + (func $~lib/rt/tlsf/growMemory (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - i32.const 0 - local.get $0 - call $~lib/typedarray/Int8Array#constructor - local.set $1 - local.get $1 - i32.load offset=4 - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 34 - i32.const 2 - call $~lib/env/abort - unreachable - end + memory.size + local.set $2 local.get $1 - i32.load offset=8 - local.get $0 - global.get $~lib/typedarray/Int8Array.BYTES_PER_ELEMENT - i32.mul - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 35 - i32.const 2 - call $~lib/env/abort - unreachable - end - block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) - local.get $1 - local.set $2 - local.get $2 - i32.load offset=8 - i32.const 0 - i32.shr_u - end - local.get $0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 36 - i32.const 2 - call $~lib/env/abort - unreachable - end - i32.const 0 - local.get $0 - call $~lib/typedarray/Uint8Array#constructor + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u local.set $3 + local.get $2 + local.tee $4 local.get $3 - i32.load offset=4 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + memory.grow i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 39 - i32.const 2 - call $~lib/env/abort - unreachable - end - local.get $3 - i32.load offset=8 - local.get $0 - global.get $~lib/typedarray/Uint8Array.BYTES_PER_ELEMENT - i32.mul - i32.eq - i32.eqz + i32.lt_s if - i32.const 0 - i32.const 8 - i32.const 40 - i32.const 2 - call $~lib/env/abort - unreachable - end - block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) local.get $3 - local.set $2 - local.get $2 - i32.load offset=8 + memory.grow i32.const 0 - i32.shr_u + i32.lt_s + if + unreachable + end end + memory.size + local.set $7 local.get $0 - i32.eq + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (; 12 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz i32.eqz if i32.const 0 - i32.const 8 - i32.const 41 - i32.const 2 - call $~lib/env/abort + i32.const 184 + i32.const 364 + i32.const 13 + call $~lib/builtins/abort unreachable end - i32.const 0 - local.get $0 - call $~lib/typedarray/Uint8ClampedArray#constructor + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub local.set $4 local.get $4 - i32.load offset=4 - i32.const 0 - i32.eq - i32.eqz + i32.const 32 + i32.ge_u if - i32.const 0 - i32.const 8 - i32.const 44 + local.get $1 + local.get $2 + local.get $3 i32.const 2 - call $~lib/env/abort - unreachable - end - local.get $4 - i32.load offset=8 - local.get $0 - global.get $~lib/typedarray/Uint8Array.BYTES_PER_ELEMENT - i32.mul - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 45 - i32.const 2 - call $~lib/env/abort - unreachable - end - block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) - local.get $4 - local.set $2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add local.get $2 - i32.load offset=8 - i32.const 0 - i32.shr_u + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store end + ) + (func $~lib/rt/tlsf/allocateBlock (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 local.get $0 - i32.eq + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 i32.eqz if - i32.const 0 - i32.const 8 - i32.const 46 - i32.const 2 - call $~lib/env/abort - unreachable + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 184 + i32.const 477 + i32.const 15 + call $~lib/builtins/abort + unreachable + end end - i32.const 0 - local.get $0 - call $~lib/typedarray/Int16Array#constructor - local.set $5 - local.get $5 - i32.load offset=4 - i32.const 0 - i32.eq + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u i32.eqz if i32.const 0 - i32.const 8 - i32.const 49 - i32.const 2 - call $~lib/env/abort + i32.const 184 + i32.const 479 + i32.const 13 + call $~lib/builtins/abort unreachable end - local.get $5 - i32.load offset=8 + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 local.get $0 - global.get $~lib/typedarray/Int16Array.BYTES_PER_ELEMENT - i32.mul - i32.eq + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + call $~lib/rt/rtrace/onalloc + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 i32.eqz if - i32.const 0 - i32.const 8 - i32.const 50 - i32.const 2 - call $~lib/env/abort - unreachable - end - block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) - local.get $5 + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT local.set $2 - local.get $2 - i32.load offset=8 - i32.const 1 - i32.shr_u end + local.get $2 local.get $0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 51 - i32.const 2 - call $~lib/env/abort - unreachable - end - i32.const 0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/rt/pure/increment (; 15 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) local.get $0 - call $~lib/typedarray/Uint16Array#constructor - local.set $6 - local.get $6 i32.load offset=4 - i32.const 0 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 54 + i32.const 288 + i32.const 104 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $6 - i32.load offset=8 local.get $0 - global.get $~lib/typedarray/Uint16Array.BYTES_PER_ELEMENT - i32.mul - i32.eq + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/rtrace/onincrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz i32.eqz if i32.const 0 - i32.const 8 - i32.const 55 - i32.const 2 - call $~lib/env/abort + i32.const 288 + i32.const 107 + i32.const 13 + call $~lib/builtins/abort unreachable end - block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) - local.get $6 - local.set $2 - local.get $2 - i32.load offset=8 - i32.const 1 - i32.shr_u - end + ) + (func $~lib/rt/pure/__retain (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - i32.eq - i32.eqz + global.get $~lib/heap/__heap_base + i32.gt_u if - i32.const 0 - i32.const 8 - i32.const 56 - i32.const 2 - call $~lib/env/abort - unreachable + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment end - i32.const 0 local.get $0 - call $~lib/typedarray/Int32Array#constructor - local.set $7 - local.get $7 - i32.load offset=4 - i32.const 0 - i32.eq + ) + (func $~lib/rt/tlsf/freeBlock (; 17 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz i32.eqz if i32.const 0 - i32.const 8 - i32.const 59 + i32.const 184 + i32.const 531 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $7 - i32.load offset=8 + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store local.get $0 - global.get $~lib/typedarray/Int32Array.BYTES_PER_ELEMENT - i32.mul - i32.eq - i32.eqz + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/rtrace/onfree + ) + (func $~lib/rt/__typeinfo (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/rt/__rtti_base + local.set $1 + local.get $0 + local.get $1 + i32.load + i32.gt_u if - i32.const 0 - i32.const 8 - i32.const 60 - i32.const 2 - call $~lib/env/abort + i32.const 336 + i32.const 392 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort unreachable end - block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) - local.get $7 - local.set $2 - local.get $2 - i32.load offset=8 - i32.const 2 - i32.shr_u - end - local.get $0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 61 - i32.const 2 - call $~lib/env/abort - unreachable - end - i32.const 0 - local.get $0 - call $~lib/typedarray/Uint32Array#constructor - local.set $8 - local.get $8 - i32.load offset=4 - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 64 - i32.const 2 - call $~lib/env/abort - unreachable - end - local.get $8 - i32.load offset=8 + local.get $1 + i32.const 4 + i32.add local.get $0 - global.get $~lib/typedarray/Uint32Array.BYTES_PER_ELEMENT + i32.const 8 i32.mul - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 65 - i32.const 2 - call $~lib/env/abort - unreachable - end - block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) - local.get $8 - local.set $2 - local.get $2 - i32.load offset=8 - i32.const 2 - i32.shr_u - end - local.get $0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 66 - i32.const 2 - call $~lib/env/abort - unreachable + i32.add + i32.load + ) + (func $~lib/util/memory/memcpy (; 19 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + block $break|0 + loop $continue|0 + local.get $2 + if (result i32) + local.get $1 + i32.const 3 + i32.and + else + i32.const 0 + end + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $continue|0 + end + end end - i32.const 0 local.get $0 - call $~lib/typedarray/Int64Array#constructor - local.set $9 - local.get $9 - i32.load offset=4 + i32.const 3 + i32.and i32.const 0 i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 69 - i32.const 2 - call $~lib/env/abort - unreachable - end - local.get $9 - i32.load offset=8 - local.get $0 - global.get $~lib/typedarray/Int64Array.BYTES_PER_ELEMENT - i32.mul - i32.eq - i32.eqz if - i32.const 0 - i32.const 8 - i32.const 70 - i32.const 2 - call $~lib/env/abort - unreachable - end - block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) - local.get $9 - local.set $2 + block $break|1 + loop $continue|1 + local.get $2 + i32.const 16 + i32.ge_u + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 8 + i32.add + i32.load + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 12 + i32.add + i32.load + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|1 + end + end + end local.get $2 - i32.load offset=8 - i32.const 3 - i32.shr_u - end - local.get $0 - i32.eq - i32.eqz - if - i32.const 0 i32.const 8 - i32.const 71 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + end + local.get $2 + i32.const 4 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.set $0 + local.get $1 + i32.const 4 + i32.add + local.set $1 + end + local.get $2 i32.const 2 - call $~lib/env/abort - unreachable + i32.and + if + local.get $0 + local.get $1 + i32.load16_u + i32.store16 + local.get $0 + i32.const 2 + i32.add + local.set $0 + local.get $1 + i32.const 2 + i32.add + local.set $1 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + return end - i32.const 0 - local.get $0 - call $~lib/typedarray/Uint64Array#constructor - local.set $10 - local.get $10 - i32.load offset=4 - i32.const 0 - i32.eq - i32.eqz + local.get $2 + i32.const 32 + i32.ge_u if - i32.const 0 - i32.const 8 - i32.const 74 - i32.const 2 - call $~lib/env/abort - unreachable - end - local.get $10 - i32.load offset=8 - local.get $0 - global.get $~lib/typedarray/Uint64Array.BYTES_PER_ELEMENT - i32.mul - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 75 - i32.const 2 - call $~lib/env/abort - unreachable - end - block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) - local.get $10 - local.set $2 - local.get $2 - i32.load offset=8 - i32.const 3 - i32.shr_u - end - local.get $0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 76 - i32.const 2 - call $~lib/env/abort - unreachable - end - i32.const 0 - local.get $0 - call $~lib/typedarray/Float32Array#constructor - local.set $11 - local.get $11 - i32.load offset=4 - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 79 - i32.const 2 - call $~lib/env/abort - unreachable - end - local.get $11 - i32.load offset=8 - local.get $0 - global.get $~lib/typedarray/Float32Array.BYTES_PER_ELEMENT - i32.mul - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 80 - i32.const 2 - call $~lib/env/abort - unreachable - end - block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) - local.get $11 - local.set $2 - local.get $2 - i32.load offset=8 - i32.const 2 - i32.shr_u - end - local.get $0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 81 - i32.const 2 - call $~lib/env/abort - unreachable - end - i32.const 0 - local.get $0 - call $~lib/typedarray/Float64Array#constructor - local.set $12 - local.get $12 - i32.load offset=4 - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 84 - i32.const 2 - call $~lib/env/abort - unreachable - end - local.get $12 - i32.load offset=8 - local.get $0 - global.get $~lib/typedarray/Float64Array.BYTES_PER_ELEMENT - i32.mul - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 85 - i32.const 2 - call $~lib/env/abort - unreachable - end - block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) - local.get $12 - local.set $2 - local.get $2 - i32.load offset=8 - i32.const 3 - i32.shr_u - end - local.get $0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 86 - i32.const 2 - call $~lib/env/abort - unreachable - end - ) - (func $~lib/internal/typedarray/TypedArray#__set (; 29 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $1 - local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u - i32.ge_u - if - i32.const 0 - i32.const 48 - i32.const 50 - i32.const 63 - call $~lib/env/abort - unreachable - end - block $~lib/internal/arraybuffer/STORE|inlined.0 - local.get $0 - i32.load - local.set $3 - local.get $1 - local.set $4 - local.get $2 - local.set $5 - local.get $0 - i32.load offset=4 - local.set $6 - local.get $3 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $6 - i32.add - local.get $5 - i32.store offset=8 - end - ) - (func $~lib/internal/typedarray/TypedArray#__get (; 30 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - local.get $1 - local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u - i32.ge_u - if - i32.const 0 - i32.const 48 - i32.const 39 - i32.const 63 - call $~lib/env/abort - unreachable - end - block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) - local.get $0 - i32.load - local.set $2 - local.get $1 - local.set $3 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $2 - local.get $3 - i32.const 2 - i32.shl - i32.add - local.get $4 - i32.add - i32.load offset=8 - end - ) - (func $~lib/typedarray/Int32Array#subarray (; 31 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - local.get $0 - local.set $3 - local.get $1 - local.set $4 - local.get $2 - local.set $5 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.2 (result i32) - local.get $3 - local.set $6 - local.get $6 - i32.load offset=8 - i32.const 2 - i32.shr_u - end - local.set $6 - local.get $4 - i32.const 0 - i32.lt_s - if - local.get $6 - local.get $4 - i32.add - local.tee $7 - i32.const 0 - local.tee $8 - local.get $7 - local.get $8 - i32.gt_s - select - local.set $4 - else - local.get $4 - local.tee $7 - local.get $6 - local.tee $8 - local.get $7 - local.get $8 - i32.lt_s - select - local.set $4 - end - local.get $5 - i32.const 0 - i32.lt_s - if - local.get $6 - local.get $5 - i32.add - local.tee $7 - local.get $4 - local.tee $8 - local.get $7 - local.get $8 - i32.gt_s - select - local.set $5 - else - local.get $5 - local.tee $7 - local.get $6 - local.tee $8 - local.get $7 - local.get $8 - i32.lt_s - select - local.tee $7 - local.get $4 - local.tee $8 - local.get $7 - local.get $8 - i32.gt_s - select - local.set $5 - end - block $~lib/memory/memory.allocate|inlined.1 (result i32) - i32.const 12 - local.set $7 - local.get $7 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.1 + block $break|2 + block $case2|2 + block $case1|2 + block $case0|2 + local.get $0 + i32.const 3 + i32.and + local.set $5 + local.get $5 + i32.const 1 + i32.eq + br_if $case0|2 + local.get $5 + i32.const 2 + i32.eq + br_if $case1|2 + local.get $5 + i32.const 3 + i32.eq + br_if $case2|2 + br $break|2 + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 3 + i32.sub + local.set $2 + block $break|3 + loop $continue|3 + local.get $2 + i32.const 17 + i32.ge_u + if + local.get $1 + i32.const 1 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 5 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 9 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 13 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|3 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + block $break|4 + loop $continue|4 + local.get $2 + i32.const 18 + i32.ge_u + if + local.get $1 + i32.const 2 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 6 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 10 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 14 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|4 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + block $break|5 + loop $continue|5 + local.get $2 + i32.const 19 + i32.ge_u + if + local.get $1 + i32.const 3 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 7 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 11 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 15 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|5 + end + end + end + br $break|2 + unreachable + end + unreachable + end end - local.set $7 - local.get $7 - local.get $3 - i32.load - i32.store - local.get $7 - local.get $3 - i32.load offset=4 - local.get $4 - i32.const 2 - i32.shl - i32.add - i32.store offset=4 - local.get $7 - local.get $5 - local.get $4 - i32.sub - i32.const 2 - i32.shl - i32.store offset=8 - local.get $7 - ) - (func $~lib/internal/typedarray/TypedArray#__set (; 32 ;) (type $FUNCSIG$viid) (param $0 i32) (param $1 i32) (param $2 f64) - (local $3 i32) - (local $4 i32) - (local $5 f64) - (local $6 i32) - local.get $1 - local.get $0 - i32.load offset=8 - i32.const 3 - i32.shr_u - i32.ge_u + local.get $2 + i32.const 16 + i32.and if - i32.const 0 - i32.const 48 - i32.const 50 - i32.const 63 - call $~lib/env/abort - unreachable - end - block $~lib/internal/arraybuffer/STORE|inlined.0 - local.get $0 - i32.load - local.set $3 - local.get $1 - local.set $4 - local.get $2 - local.set $5 - local.get $0 - i32.load offset=4 - local.set $6 - local.get $3 - local.get $4 - i32.const 3 - i32.shl - i32.add - local.get $6 - i32.add - local.get $5 - f64.store offset=8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 end - ) - (func $~lib/typedarray/Float64Array#subarray (; 33 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - local.get $0 - local.set $3 - local.get $1 - local.set $4 local.get $2 - local.set $5 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) - local.get $3 - local.set $6 - local.get $6 - i32.load offset=8 - i32.const 3 - i32.shr_u + i32.const 8 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 end - local.set $6 - local.get $4 - i32.const 0 - i32.lt_s + local.get $2 + i32.const 4 + i32.and if - local.get $6 - local.get $4 - i32.add - local.tee $7 - i32.const 0 - local.tee $8 - local.get $7 - local.get $8 - i32.gt_s - select - local.set $4 - else - local.get $4 - local.tee $7 - local.get $6 - local.tee $8 - local.get $7 - local.get $8 - i32.lt_s - select - local.set $4 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 end - local.get $5 - i32.const 0 - i32.lt_s + local.get $2 + i32.const 2 + i32.and if - local.get $6 - local.get $5 - i32.add - local.tee $7 - local.get $4 - local.tee $8 - local.get $7 - local.get $8 - i32.gt_s - select - local.set $5 - else - local.get $5 - local.tee $7 - local.get $6 - local.tee $8 - local.get $7 - local.get $8 - i32.lt_s - select - local.tee $7 - local.get $4 - local.tee $8 - local.get $7 - local.get $8 - i32.gt_s - select - local.set $5 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 end - block $~lib/memory/memory.allocate|inlined.2 (result i32) - i32.const 12 - local.set $7 - local.get $7 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.2 + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 end - local.set $7 - local.get $7 - local.get $3 - i32.load - i32.store - local.get $7 - local.get $3 - i32.load offset=4 - local.get $4 - i32.const 3 - i32.shl - i32.add - i32.store offset=4 - local.get $7 - local.get $5 - local.get $4 - i32.sub - i32.const 3 - i32.shl - i32.store offset=8 - local.get $7 ) - (func $~lib/internal/sort/insertionSort (; 34 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (func $~lib/memory/memory.copy (; 20 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - (local $8 f64) - (local $9 i32) - (local $10 f64) - (local $11 f64) - block $break|0 - i32.const 0 + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 local.set $4 - loop $repeat|0 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $4 + local.get $3 + i32.add + local.get $5 + i32.le_u + if (result i32) + i32.const 1 + else + local.get $5 + local.get $3 + i32.add local.get $4 - local.get $2 - i32.lt_s - i32.eqz - br_if $break|0 - block - block $~lib/internal/arraybuffer/LOAD|inlined.2 (result f64) - local.get $0 - local.set $5 - local.get $4 - local.set $6 - local.get $1 - local.set $7 - local.get $5 - local.get $6 - i32.const 3 - i32.shl - i32.add - local.get $7 - i32.add - f64.load offset=8 + i32.le_u + end + if + local.get $5 + local.get $4 + local.get $3 + call $~lib/util/memory/memcpy + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end end - local.set $8 - local.get $4 - i32.const 1 - i32.sub - local.set $7 block $break|1 loop $continue|1 - local.get $7 - i32.const 0 - i32.ge_s + local.get $3 + i32.const 8 + i32.ge_u if - block - block $~lib/internal/arraybuffer/LOAD|inlined.3 (result f64) - local.get $0 - local.set $6 - local.get $7 - local.set $5 - local.get $1 - local.set $9 - local.get $6 - local.get $5 - i32.const 3 - i32.shl - i32.add - local.get $9 - i32.add - f64.load offset=8 - end - local.set $10 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $8 - local.get $10 - local.get $3 - call_indirect (type $FUNCSIG$idd) - end - i32.const 0 - i32.lt_s - if - local.get $0 - local.set $9 - block (result i32) - local.get $7 - local.tee $5 - i32.const 1 - i32.sub - local.set $7 - local.get $5 - end - i32.const 1 - i32.add - local.set $5 - local.get $10 - local.set $11 - local.get $1 - local.set $6 - local.get $9 - local.get $5 - i32.const 3 - i32.shl - i32.add - local.get $6 - i32.add - local.get $11 - f64.store offset=8 - else - br $break|1 - end - end + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 br $continue|1 end end end - block $~lib/internal/arraybuffer/STORE|inlined.4 - local.get $0 - local.set $6 - local.get $7 - i32.const 1 - i32.add - local.set $5 - local.get $8 - local.set $10 - local.get $1 - local.set $9 - local.get $6 - local.get $5 - i32.const 3 - i32.shl - i32.add - local.get $9 - i32.add - local.get $10 - f64.store offset=8 - end end - local.get $4 - i32.const 1 - i32.add - local.set $4 - br $repeat|0 - unreachable - end - unreachable - end - ) - (func $~lib/allocator/arena/__memory_free (; 35 ;) (type $FUNCSIG$vi) (param $0 i32) - nop - ) - (func $~lib/internal/sort/weakHeapSort (; 36 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 f64) - (local $13 f64) - (local $14 f64) - (local $15 f64) - local.get $2 - i32.const 31 - i32.add - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - local.set $4 - block $~lib/memory/memory.allocate|inlined.3 (result i32) - local.get $4 - local.set $5 - local.get $5 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.3 - end - local.set $6 - block $~lib/memory/memory.fill|inlined.10 - local.get $6 - local.set $5 - i32.const 0 - local.set $7 - local.get $4 - local.set $8 - local.get $5 - local.get $7 - local.get $8 - call $~lib/internal/memory/memset - end - block $break|0 - local.get $2 - i32.const 1 - i32.sub - local.set $8 - loop $repeat|0 - local.get $8 - i32.const 0 - i32.gt_s - i32.eqz - br_if $break|0 - block - local.get $8 - local.set $7 - block $break|1 - loop $continue|1 - local.get $7 - i32.const 1 - i32.and - local.get $6 - local.get $7 - i32.const 6 - i32.shr_s - i32.const 2 - i32.shl - i32.add - i32.load - local.get $7 - i32.const 1 - i32.shr_s - i32.const 31 - i32.and - i32.shr_u + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 i32.and - i32.eq if - local.get $7 + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 i32.const 1 - i32.shr_s - local.set $7 - br $continue|1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 end end end - local.get $7 - i32.const 1 - i32.shr_s - local.set $5 - block $~lib/internal/arraybuffer/LOAD|inlined.4 (result f64) - local.get $0 - local.set $9 - local.get $5 - local.set $10 - local.get $1 - local.set $11 - local.get $9 - local.get $10 - i32.const 3 - i32.shl - i32.add - local.get $11 - i32.add - f64.load offset=8 - end - local.set $12 - block $~lib/internal/arraybuffer/LOAD|inlined.5 (result f64) - local.get $0 - local.set $11 - local.get $8 - local.set $10 - local.get $1 - local.set $9 - local.get $11 - local.get $10 - i32.const 3 - i32.shl - i32.add - local.get $9 - i32.add - f64.load offset=8 + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end end - local.set $13 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $12 - local.get $13 + end + block $break|5 + loop $continue|5 local.get $3 - call_indirect (type $FUNCSIG$idd) - end - i32.const 0 - i32.lt_s - if - local.get $6 - local.get $8 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - local.get $6 - local.get $8 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - i32.load - i32.const 1 - local.get $8 - i32.const 31 - i32.and - i32.shl - i32.xor - i32.store - block $~lib/internal/arraybuffer/STORE|inlined.5 - local.get $0 - local.set $9 - local.get $8 - local.set $10 - local.get $12 - local.set $14 - local.get $1 - local.set $11 - local.get $9 - local.get $10 - i32.const 3 - i32.shl - i32.add - local.get $11 - i32.add - local.get $14 - f64.store offset=8 - end - block $~lib/internal/arraybuffer/STORE|inlined.6 - local.get $0 - local.set $11 + if local.get $5 - local.set $10 - local.get $13 - local.set $14 - local.get $1 - local.set $9 - local.get $11 - local.get $10 - i32.const 3 - i32.shl + local.get $3 + i32.const 1 + i32.sub + local.tee $3 i32.add - local.get $9 + local.get $4 + local.get $3 i32.add - local.get $14 - f64.store offset=8 + i32.load8_u + i32.store8 + br $continue|5 end end end - local.get $8 + end + end + ) + (func $~lib/rt/tlsf/__free (; 21 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 184 + i32.const 561 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 184 + i32.const 562 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/growRoots (; 22 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/pure/ROOTS + local.set $0 + global.get $~lib/rt/pure/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onfree + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $0 + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/rtrace/onalloc + local.get $0 + call $~lib/rt/tlsf/__free + end + local.get $5 + global.set $~lib/rt/pure/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/pure/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/pure/END + ) + (func $~lib/rt/pure/appendRoot (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/pure/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 4 + i32.add + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/decrement (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + call $~lib/rt/rtrace/ondecrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 288 + i32.const 115 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/rt/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 288 + i32.const 124 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 16 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 i32.const 1 i32.sub - local.set $8 - br $repeat|0 - unreachable + i32.or + i32.store offset=4 end - unreachable end - block $break|2 - local.get $2 - i32.const 1 + ) + (func $~lib/rt/pure/__release (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 i32.sub - local.set $8 - loop $repeat|2 - local.get $8 + call $~lib/rt/pure/decrement + end + ) + (func $~lib/arraybuffer/ArrayBufferView#constructor (; 26 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.const 1073741808 + local.get $2 + i32.shr_u + i32.gt_u + if + i32.const 80 + i32.const 128 + i32.const 14 + i32.const 56 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.shl + local.tee $1 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $3 + block (result i32) + local.get $0 + i32.eqz + if + i32.const 12 i32.const 2 - i32.ge_s - i32.eqz - br_if $break|2 - block - block $~lib/internal/arraybuffer/LOAD|inlined.6 (result f64) - local.get $0 - local.set $5 - i32.const 0 - local.set $7 - local.get $1 - local.set $9 - local.get $5 - local.get $7 - i32.const 3 - i32.shl - i32.add - local.get $9 - i32.add - f64.load offset=8 - end - local.set $13 - block $~lib/internal/arraybuffer/STORE|inlined.7 - local.get $0 - local.set $9 - i32.const 0 - local.set $7 - block $~lib/internal/arraybuffer/LOAD|inlined.7 (result f64) - local.get $0 - local.set $5 - local.get $8 - local.set $10 - local.get $1 - local.set $11 - local.get $5 - local.get $10 - i32.const 3 - i32.shl - i32.add - local.get $11 - i32.add - f64.load offset=8 - end - local.set $12 - local.get $1 - local.set $11 - local.get $9 - local.get $7 - i32.const 3 - i32.shl - i32.add - local.get $11 - i32.add - local.get $12 - f64.store offset=8 - end - block $~lib/internal/arraybuffer/STORE|inlined.8 - local.get $0 - local.set $11 - local.get $8 - local.set $7 - local.get $13 - local.set $12 - local.get $1 - local.set $9 - local.get $11 - local.get $7 - i32.const 3 - i32.shl - i32.add - local.get $9 - i32.add - local.get $12 - f64.store offset=8 - end - i32.const 1 - local.set $9 - block $break|3 - loop $continue|3 - local.get $9 - i32.const 1 - i32.shl - local.get $6 - local.get $9 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - i32.load - local.get $9 - i32.const 31 - i32.and - i32.shr_u - i32.const 1 - i32.and - i32.add - local.tee $7 - local.get $8 - i32.lt_s - if - local.get $7 - local.set $9 - br $continue|3 - end - end - end - block $break|4 - loop $continue|4 - local.get $9 - i32.const 0 - i32.gt_s - if - block - block $~lib/internal/arraybuffer/LOAD|inlined.8 (result f64) - local.get $0 - local.set $11 - i32.const 0 - local.set $10 - local.get $1 - local.set $5 - local.get $11 - local.get $10 - i32.const 3 - i32.shl - i32.add - local.get $5 - i32.add - f64.load offset=8 - end - local.set $13 - block $~lib/internal/arraybuffer/LOAD|inlined.9 (result f64) - local.get $0 - local.set $5 - local.get $9 - local.set $10 - local.get $1 - local.set $11 - local.get $5 - local.get $10 - i32.const 3 - i32.shl - i32.add - local.get $11 - i32.add - f64.load offset=8 - end - local.set $12 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $13 - local.get $12 - local.get $3 - call_indirect (type $FUNCSIG$idd) - end - i32.const 0 - i32.lt_s - if - local.get $6 - local.get $9 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - local.get $6 - local.get $9 - i32.const 5 - i32.shr_s - i32.const 2 - i32.shl - i32.add - i32.load - i32.const 1 - local.get $9 - i32.const 31 - i32.and - i32.shl - i32.xor - i32.store - block $~lib/internal/arraybuffer/STORE|inlined.9 - local.get $0 - local.set $11 - local.get $9 - local.set $10 - local.get $13 - local.set $14 - local.get $1 - local.set $5 - local.get $11 - local.get $10 - i32.const 3 - i32.shl - i32.add - local.get $5 - i32.add - local.get $14 - f64.store offset=8 - end - block $~lib/internal/arraybuffer/STORE|inlined.10 - local.get $0 - local.set $5 - i32.const 0 - local.set $10 - local.get $12 - local.set $14 - local.get $1 - local.set $11 - local.get $5 - local.get $10 - i32.const 3 - i32.shl - i32.add - local.get $11 - i32.add - local.get $14 - f64.store offset=8 - end - end - local.get $9 - i32.const 1 - i32.shr_s - local.set $9 - end - br $continue|4 - end - end - end - end - local.get $8 - i32.const 1 - i32.sub - local.set $8 - br $repeat|2 - unreachable + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $0 end - unreachable + local.get $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + end + local.tee $4 + block (result i32) + local.get $3 + local.tee $5 + local.get $4 + i32.load + local.tee $4 + i32.ne + if + local.get $5 + call $~lib/rt/pure/__retain + drop + local.get $4 + call $~lib/rt/pure/__release + end + local.get $5 + end + i32.store + local.get $0 + local.get $3 + i32.store offset=4 + local.get $0 + local.get $1 + i32.store offset=8 + local.get $0 + ) + (func $~lib/typedarray/Int8Array#constructor (; 27 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + if (result i32) + local.get $0 + else + i32.const 12 + i32.const 3 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + end + local.get $1 + i32.const 0 + call $~lib/arraybuffer/ArrayBufferView#constructor + local.set $0 + local.get $0 + ) + (func $~lib/arraybuffer/ArrayBufferView#get:byteOffset (; 28 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=4 + local.get $0 + i32.load + i32.sub + ) + (func $~lib/arraybuffer/ArrayBufferView#get:byteLength (; 29 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=8 + ) + (func $~lib/typedarray/Int8Array#get:length (; 30 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + call $~lib/arraybuffer/ArrayBufferView#get:byteLength + ) + (func $~lib/typedarray/Uint8Array#constructor (; 31 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + if (result i32) + local.get $0 + else + i32.const 12 + i32.const 4 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + end + local.get $1 + i32.const 0 + call $~lib/arraybuffer/ArrayBufferView#constructor + local.set $0 + local.get $0 + ) + (func $~lib/typedarray/Uint8Array#get:length (; 32 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + call $~lib/arraybuffer/ArrayBufferView#get:byteLength + ) + (func $~lib/typedarray/Uint8ClampedArray#constructor (; 33 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + if (result i32) + local.get $0 + else + i32.const 12 + i32.const 5 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + end + local.get $1 + i32.const 0 + call $~lib/arraybuffer/ArrayBufferView#constructor + local.set $0 + local.get $0 + ) + (func $~lib/typedarray/Uint8ClampedArray#get:length (; 34 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + call $~lib/arraybuffer/ArrayBufferView#get:byteLength + ) + (func $~lib/typedarray/Int16Array#constructor (; 35 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + if (result i32) + local.get $0 + else + i32.const 12 + i32.const 6 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain end - block $~lib/memory/memory.free|inlined.0 - local.get $6 - local.set $8 - local.get $8 - call $~lib/allocator/arena/__memory_free - br $~lib/memory/memory.free|inlined.0 + local.get $1 + i32.const 1 + call $~lib/arraybuffer/ArrayBufferView#constructor + local.set $0 + local.get $0 + ) + (func $~lib/typedarray/Int16Array#get:length (; 36 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + call $~lib/arraybuffer/ArrayBufferView#get:byteLength + i32.const 1 + i32.shr_u + ) + (func $~lib/typedarray/Uint16Array#constructor (; 37 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + if (result i32) + local.get $0 + else + i32.const 12 + i32.const 7 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain end - block $~lib/internal/arraybuffer/LOAD|inlined.10 (result f64) + local.get $1 + i32.const 1 + call $~lib/arraybuffer/ArrayBufferView#constructor + local.set $0 + local.get $0 + ) + (func $~lib/typedarray/Uint16Array#get:length (; 38 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + call $~lib/arraybuffer/ArrayBufferView#get:byteLength + i32.const 1 + i32.shr_u + ) + (func $~lib/typedarray/Int32Array#constructor (; 39 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + if (result i32) local.get $0 - local.set $8 - i32.const 1 - local.set $7 - local.get $1 - local.set $9 - local.get $8 - local.get $7 - i32.const 3 - i32.shl - i32.add - local.get $9 - i32.add - f64.load offset=8 + else + i32.const 12 + i32.const 8 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain end - local.set $15 - block $~lib/internal/arraybuffer/STORE|inlined.11 + local.get $1 + i32.const 2 + call $~lib/arraybuffer/ArrayBufferView#constructor + local.set $0 + local.get $0 + ) + (func $~lib/typedarray/Int32Array#get:length (; 40 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + call $~lib/arraybuffer/ArrayBufferView#get:byteLength + i32.const 2 + i32.shr_u + ) + (func $~lib/typedarray/Uint32Array#constructor (; 41 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + if (result i32) local.get $0 - local.set $9 - i32.const 1 - local.set $7 - block $~lib/internal/arraybuffer/LOAD|inlined.11 (result f64) - local.get $0 - local.set $8 - i32.const 0 - local.set $11 - local.get $1 - local.set $10 - local.get $8 - local.get $11 - i32.const 3 - i32.shl - i32.add - local.get $10 - i32.add - f64.load offset=8 - end - local.set $13 - local.get $1 - local.set $10 - local.get $9 - local.get $7 - i32.const 3 - i32.shl - i32.add - local.get $10 - i32.add - local.get $13 - f64.store offset=8 + else + i32.const 12 + i32.const 9 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain end - block $~lib/internal/arraybuffer/STORE|inlined.12 + local.get $1 + i32.const 2 + call $~lib/arraybuffer/ArrayBufferView#constructor + local.set $0 + local.get $0 + ) + (func $~lib/typedarray/Uint32Array#get:length (; 42 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + call $~lib/arraybuffer/ArrayBufferView#get:byteLength + i32.const 2 + i32.shr_u + ) + (func $~lib/typedarray/Int64Array#constructor (; 43 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + if (result i32) local.get $0 - local.set $10 - i32.const 0 - local.set $7 - local.get $15 - local.set $13 - local.get $1 - local.set $9 - local.get $10 - local.get $7 - i32.const 3 - i32.shl - i32.add - local.get $9 - i32.add - local.get $13 - f64.store offset=8 + else + i32.const 12 + i32.const 10 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain end + local.get $1 + i32.const 3 + call $~lib/arraybuffer/ArrayBufferView#constructor + local.set $0 + local.get $0 ) - (func $~lib/typedarray/Float64Array#sort (; 37 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 f64) - (local $11 f64) - (local $12 f64) - (local $13 i32) - block $~lib/internal/typedarray/SORT<~lib/typedarray/Float64Array,f64>|inlined.0 (result i32) + (func $~lib/typedarray/Int64Array#get:length (; 44 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + call $~lib/arraybuffer/ArrayBufferView#get:byteLength + i32.const 3 + i32.shr_u + ) + (func $~lib/typedarray/Uint64Array#constructor (; 45 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + if (result i32) local.get $0 - local.set $2 - local.get $1 - local.set $3 - local.get $2 - i32.load offset=4 - local.set $4 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.3 (result i32) - local.get $2 - local.set $5 - local.get $5 - i32.load offset=8 - i32.const 3 - i32.shr_u - end - local.set $5 - local.get $5 - i32.const 1 - i32.le_s - if - local.get $2 - br $~lib/internal/typedarray/SORT<~lib/typedarray/Float64Array,f64>|inlined.0 - end - local.get $2 - i32.load - local.set $6 - local.get $5 - i32.const 2 - i32.eq - if - block $~lib/internal/arraybuffer/LOAD|inlined.0 (result f64) - local.get $6 - local.set $7 - i32.const 1 - local.set $8 - local.get $4 - local.set $9 - local.get $7 - local.get $8 - i32.const 3 - i32.shl - i32.add - local.get $9 - i32.add - f64.load offset=8 - end - local.set $10 - block $~lib/internal/arraybuffer/LOAD|inlined.1 (result f64) - local.get $6 - local.set $9 - i32.const 0 - local.set $8 - local.get $4 - local.set $7 - local.get $9 - local.get $8 - i32.const 3 - i32.shl - i32.add - local.get $7 - i32.add - f64.load offset=8 - end - local.set $11 - block (result i32) - i32.const 2 - global.set $~lib/argc - local.get $10 - local.get $11 - local.get $3 - call_indirect (type $FUNCSIG$idd) - end - i32.const 0 - i32.lt_s - if - block $~lib/internal/arraybuffer/STORE|inlined.1 - local.get $6 - local.set $7 - i32.const 1 - local.set $8 - local.get $11 - local.set $12 - local.get $4 - local.set $9 - local.get $7 - local.get $8 - i32.const 3 - i32.shl - i32.add - local.get $9 - i32.add - local.get $12 - f64.store offset=8 - end - block $~lib/internal/arraybuffer/STORE|inlined.2 - local.get $6 - local.set $9 - i32.const 0 - local.set $8 - local.get $10 - local.set $12 - local.get $4 - local.set $7 - local.get $9 - local.get $8 - i32.const 3 - i32.shl - i32.add - local.get $7 - i32.add - local.get $12 - f64.store offset=8 - end - end - local.get $2 - br $~lib/internal/typedarray/SORT<~lib/typedarray/Float64Array,f64>|inlined.0 - end - block $~lib/internal/sort/SORT|inlined.0 - local.get $6 - local.set $7 - local.get $4 - local.set $8 - local.get $5 - local.set $9 - local.get $3 - local.set $13 - local.get $9 - i32.const 256 - i32.lt_s - if - local.get $7 - local.get $8 - local.get $9 - local.get $13 - call $~lib/internal/sort/insertionSort - else - local.get $7 - local.get $8 - local.get $9 - local.get $13 - call $~lib/internal/sort/weakHeapSort - end - end - local.get $2 + else + i32.const 12 + i32.const 11 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain end + local.get $1 + i32.const 3 + call $~lib/arraybuffer/ArrayBufferView#constructor + local.set $0 + local.get $0 + ) + (func $~lib/typedarray/Uint64Array#get:length (; 46 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + call $~lib/arraybuffer/ArrayBufferView#get:byteLength + i32.const 3 + i32.shr_u ) - (func $~lib/internal/sort/COMPARATOR~anonymous|0 (; 38 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) - (local $2 i64) - (local $3 i64) + (func $~lib/typedarray/Float32Array#constructor (; 47 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 - i64.reinterpret_f64 - local.set $2 + if (result i32) + local.get $0 + else + i32.const 12 + i32.const 12 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + end local.get $1 - i64.reinterpret_f64 - local.set $3 - local.get $2 - local.get $2 - i64.const 63 - i64.shr_s - i64.const 1 - i64.shr_u - i64.xor - local.set $2 - local.get $3 - local.get $3 - i64.const 63 - i64.shr_s - i64.const 1 - i64.shr_u - i64.xor - local.set $3 - local.get $2 - local.get $3 - i64.gt_s - local.get $2 - local.get $3 - i64.lt_s - i32.sub + i32.const 2 + call $~lib/arraybuffer/ArrayBufferView#constructor + local.set $0 + local.get $0 ) - (func $~lib/typedarray/Float64Array#sort|trampoline (; 39 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - block $1of1 - block $0of1 - block $outOfRange - global.get $~lib/argc - br_table $0of1 $1of1 $outOfRange - end - unreachable - end - block $~lib/internal/sort/COMPARATOR|inlined.0 (result i32) - i32.const 1 - br $~lib/internal/sort/COMPARATOR|inlined.0 - end - local.set $1 - end + (func $~lib/typedarray/Float32Array#get:length (; 48 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + call $~lib/arraybuffer/ArrayBufferView#get:byteLength + i32.const 2 + i32.shr_u + ) + (func $~lib/typedarray/Float64Array#constructor (; 49 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 + if (result i32) + local.get $0 + else + i32.const 12 + i32.const 13 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + end local.get $1 - call $~lib/typedarray/Float64Array#sort + i32.const 3 + call $~lib/arraybuffer/ArrayBufferView#constructor + local.set $0 + local.get $0 + ) + (func $~lib/typedarray/Float64Array#get:length (; 50 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + call $~lib/arraybuffer/ArrayBufferView#get:byteLength + i32.const 3 + i32.shr_u ) - (func $~lib/internal/typedarray/TypedArray#__get (; 40 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) + (func $std/typedarray/testInstantiate (; 51 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + i32.const 0 + local.get $0 + call $~lib/typedarray/Int8Array#constructor + local.set $1 + local.get $1 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 32 + i32.const 2 + call $~lib/builtins/abort + unreachable + end local.get $1 + call $~lib/arraybuffer/ArrayBufferView#get:byteLength local.get $0 - i32.load offset=8 - i32.const 3 - i32.shr_u - i32.ge_u + global.get $~lib/typedarray/Int8Array.BYTES_PER_ELEMENT + i32.mul + i32.eq + i32.eqz if i32.const 0 - i32.const 48 + i32.const 24 + i32.const 33 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + call $~lib/typedarray/Int8Array#get:length + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 34 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + local.get $0 + call $~lib/typedarray/Uint8Array#constructor + local.set $2 + local.get $2 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 37 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $2 + call $~lib/arraybuffer/ArrayBufferView#get:byteLength + local.get $0 + global.get $~lib/typedarray/Uint8Array.BYTES_PER_ELEMENT + i32.mul + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 38 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $2 + call $~lib/typedarray/Uint8Array#get:length + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 i32.const 39 - i32.const 63 - call $~lib/env/abort + i32.const 2 + call $~lib/builtins/abort unreachable end - block $~lib/internal/arraybuffer/LOAD|inlined.12 (result f64) - local.get $0 - i32.load - local.set $2 - local.get $1 - local.set $3 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $2 - local.get $3 - i32.const 3 - i32.shl - i32.add - local.get $4 - i32.add - f64.load offset=8 + i32.const 0 + local.get $0 + call $~lib/typedarray/Uint8ClampedArray#constructor + local.set $3 + local.get $3 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 42 + i32.const 2 + call $~lib/builtins/abort + unreachable end - ) - (func $~lib/typedarray/clampToByte (; 41 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $3 + call $~lib/arraybuffer/ArrayBufferView#get:byteLength local.get $0 - i32.const 31 - i32.shr_s - i32.const -1 - i32.xor - i32.const 255 + global.get $~lib/typedarray/Uint8Array.BYTES_PER_ELEMENT + i32.mul + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 43 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $3 + call $~lib/typedarray/Uint8ClampedArray#get:length local.get $0 - i32.sub - i32.const 31 - i32.shr_s + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 44 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + i32.const 0 local.get $0 - i32.or - i32.and - ) - (func $~lib/internal/typedarray/TypedArray#__set (; 42 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $1 + call $~lib/typedarray/Int16Array#constructor + local.set $4 + local.get $4 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 47 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $4 + call $~lib/arraybuffer/ArrayBufferView#get:byteLength local.get $0 - i32.load offset=8 + global.get $~lib/typedarray/Int16Array.BYTES_PER_ELEMENT + i32.mul + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 48 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $4 + call $~lib/typedarray/Int16Array#get:length + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 49 + i32.const 2 + call $~lib/builtins/abort + unreachable + end i32.const 0 - i32.shr_u - i32.ge_u + local.get $0 + call $~lib/typedarray/Uint16Array#constructor + local.set $5 + local.get $5 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 52 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $5 + call $~lib/arraybuffer/ArrayBufferView#get:byteLength + local.get $0 + global.get $~lib/typedarray/Uint16Array.BYTES_PER_ELEMENT + i32.mul + i32.eq + i32.eqz if i32.const 0 - i32.const 48 - i32.const 50 - i32.const 63 - call $~lib/env/abort + i32.const 24 + i32.const 53 + i32.const 2 + call $~lib/builtins/abort unreachable end - block $~lib/internal/arraybuffer/STORE|inlined.0 - local.get $0 - i32.load - local.set $3 - local.get $1 - local.set $4 - local.get $2 - local.set $5 - local.get $0 - i32.load offset=4 - local.set $6 - local.get $3 - local.get $4 + local.get $5 + call $~lib/typedarray/Uint16Array#get:length + local.get $0 + i32.eq + i32.eqz + if i32.const 0 - i32.shl - i32.add - local.get $6 - i32.add - local.get $5 - i32.store8 offset=8 + i32.const 24 + i32.const 54 + i32.const 2 + call $~lib/builtins/abort + unreachable end - ) - (func $~lib/typedarray/Uint8ClampedArray#__set (; 43 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - local.get $0 - local.get $1 - local.get $2 - call $~lib/typedarray/clampToByte - call $~lib/internal/typedarray/TypedArray#__set - ) - (func $~lib/internal/typedarray/TypedArray#__get (; 44 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - local.get $1 + i32.const 0 local.get $0 - i32.load offset=8 + call $~lib/typedarray/Int32Array#constructor + local.set $6 + local.get $6 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 0 - i32.shr_u - i32.ge_u + i32.eq + i32.eqz if i32.const 0 - i32.const 48 - i32.const 39 - i32.const 63 - call $~lib/env/abort + i32.const 24 + i32.const 57 + i32.const 2 + call $~lib/builtins/abort unreachable end - block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) - local.get $0 - i32.load - local.set $2 - local.get $1 - local.set $3 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $2 - local.get $3 + local.get $6 + call $~lib/arraybuffer/ArrayBufferView#get:byteLength + local.get $0 + global.get $~lib/typedarray/Int32Array.BYTES_PER_ELEMENT + i32.mul + i32.eq + i32.eqz + if i32.const 0 - i32.shl - i32.add - local.get $4 - i32.add - i32.load8_u offset=8 + i32.const 24 + i32.const 58 + i32.const 2 + call $~lib/builtins/abort + unreachable end - ) - (func $~lib/internal/typedarray/TypedArray#__set (; 45 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $1 + local.get $6 + call $~lib/typedarray/Int32Array#get:length local.get $0 - i32.load offset=8 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 59 + i32.const 2 + call $~lib/builtins/abort + unreachable + end i32.const 0 - i32.shr_u - i32.ge_u + local.get $0 + call $~lib/typedarray/Uint32Array#constructor + local.set $7 + local.get $7 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset + i32.const 0 + i32.eq + i32.eqz if i32.const 0 - i32.const 48 - i32.const 50 - i32.const 63 - call $~lib/env/abort + i32.const 24 + i32.const 62 + i32.const 2 + call $~lib/builtins/abort unreachable end - block $~lib/internal/arraybuffer/STORE|inlined.0 - local.get $0 - i32.load - local.set $3 - local.get $1 - local.set $4 - local.get $2 - local.set $5 - local.get $0 - i32.load offset=4 - local.set $6 - local.get $3 - local.get $4 + local.get $7 + call $~lib/arraybuffer/ArrayBufferView#get:byteLength + local.get $0 + global.get $~lib/typedarray/Uint32Array.BYTES_PER_ELEMENT + i32.mul + i32.eq + i32.eqz + if i32.const 0 - i32.shl - i32.add - local.get $6 - i32.add - local.get $5 - i32.store8 offset=8 + i32.const 24 + i32.const 63 + i32.const 2 + call $~lib/builtins/abort + unreachable end - ) - (func $~lib/typedarray/Int8Array#fill (; 46 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) + local.get $7 + call $~lib/typedarray/Uint32Array#get:length local.get $0 - local.set $4 - local.get $1 - local.set $5 - local.get $2 - local.set $6 - local.get $3 - local.set $7 - local.get $4 - i32.load - local.set $8 - local.get $4 - i32.load offset=4 - local.set $9 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) - local.get $4 - local.set $10 - local.get $10 - i32.load offset=8 + i32.eq + i32.eqz + if i32.const 0 - i32.shr_u + i32.const 24 + i32.const 64 + i32.const 2 + call $~lib/builtins/abort + unreachable end - local.set $10 - local.get $6 i32.const 0 - i32.lt_s - if (result i32) - local.get $10 - local.get $6 - i32.add - local.tee $11 + local.get $0 + call $~lib/typedarray/Int64Array#constructor + local.set $8 + local.get $8 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset + i32.const 0 + i32.eq + i32.eqz + if i32.const 0 - local.tee $12 - local.get $11 - local.get $12 - i32.gt_s - select - else - local.get $6 - local.tee $11 - local.get $10 - local.tee $12 - local.get $11 - local.get $12 - i32.lt_s - select + i32.const 24 + i32.const 67 + i32.const 2 + call $~lib/builtins/abort + unreachable end - local.set $6 - local.get $7 - i32.const 0 - i32.lt_s - if (result i32) - local.get $10 - local.get $7 - i32.add - local.tee $11 + local.get $8 + call $~lib/arraybuffer/ArrayBufferView#get:byteLength + local.get $0 + global.get $~lib/typedarray/Int64Array.BYTES_PER_ELEMENT + i32.mul + i32.eq + i32.eqz + if i32.const 0 - local.tee $12 - local.get $11 - local.get $12 - i32.gt_s - select - else - local.get $7 - local.tee $11 - local.get $10 - local.tee $12 - local.get $11 - local.get $12 - i32.lt_s - select + i32.const 24 + i32.const 68 + i32.const 2 + call $~lib/builtins/abort + unreachable end - local.set $7 - local.get $6 - local.get $7 - i32.lt_s + local.get $8 + call $~lib/typedarray/Int64Array#get:length + local.get $0 + i32.eq + i32.eqz if - local.get $8 - local.get $6 - i32.add - local.get $9 - i32.add - i32.const 8 - i32.add - local.set $11 - local.get $5 - local.set $12 - local.get $7 - local.get $6 - i32.sub - local.set $13 - local.get $11 - local.get $12 - local.get $13 - call $~lib/internal/memory/memset + i32.const 0 + i32.const 24 + i32.const 69 + i32.const 2 + call $~lib/builtins/abort + unreachable end - local.get $4 - ) - (func $~lib/internal/typedarray/TypedArray#__get (; 47 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - local.get $1 + i32.const 0 local.get $0 - i32.load offset=8 + call $~lib/typedarray/Uint64Array#constructor + local.set $9 + local.get $9 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 0 - i32.shr_u - i32.ge_u + i32.eq + i32.eqz if i32.const 0 - i32.const 48 - i32.const 39 - i32.const 63 - call $~lib/env/abort + i32.const 24 + i32.const 72 + i32.const 2 + call $~lib/builtins/abort unreachable end - block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) - local.get $0 - i32.load - local.set $2 - local.get $1 - local.set $3 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $2 - local.get $3 + local.get $9 + call $~lib/arraybuffer/ArrayBufferView#get:byteLength + local.get $0 + global.get $~lib/typedarray/Uint64Array.BYTES_PER_ELEMENT + i32.mul + i32.eq + i32.eqz + if i32.const 0 - i32.shl - i32.add - local.get $4 - i32.add - i32.load8_s offset=8 + i32.const 24 + i32.const 73 + i32.const 2 + call $~lib/builtins/abort + unreachable end - ) - (func $~lib/array/Array#__get (; 48 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) + local.get $9 + call $~lib/typedarray/Uint64Array#get:length local.get $0 - i32.load - local.set $2 - local.get $1 - local.get $2 - i32.load + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 74 + i32.const 2 + call $~lib/builtins/abort + unreachable + end i32.const 0 - i32.shr_u - i32.lt_u - if (result i32) - local.get $2 - local.set $3 - local.get $1 - local.set $4 + local.get $0 + call $~lib/typedarray/Float32Array#constructor + local.set $10 + local.get $10 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset + i32.const 0 + i32.eq + i32.eqz + if i32.const 0 - local.set $5 - local.get $3 - local.get $4 + i32.const 24 + i32.const 77 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $10 + call $~lib/arraybuffer/ArrayBufferView#get:byteLength + local.get $0 + global.get $~lib/typedarray/Float32Array.BYTES_PER_ELEMENT + i32.mul + i32.eq + i32.eqz + if i32.const 0 - i32.shl - i32.add - local.get $5 - i32.add - i32.load8_s offset=8 - else + i32.const 24 + i32.const 78 + i32.const 2 + call $~lib/builtins/abort unreachable end - ) - (func $std/typedarray/isInt8ArrayEqual (; 49 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - block $~lib/internal/typedarray/TypedArray#get:length|inlined.3 (result i32) - local.get $0 - local.set $2 - local.get $2 - i32.load offset=8 + local.get $10 + call $~lib/typedarray/Float32Array#get:length + local.get $0 + i32.eq + i32.eqz + if i32.const 0 - i32.shr_u + i32.const 24 + i32.const 79 + i32.const 2 + call $~lib/builtins/abort + unreachable end - block $~lib/array/Array#get:length|inlined.1 (result i32) - local.get $1 - local.set $2 - local.get $2 - i32.load offset=4 + i32.const 0 + local.get $0 + call $~lib/typedarray/Float64Array#constructor + local.set $11 + local.get $11 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 82 + i32.const 2 + call $~lib/builtins/abort + unreachable end - i32.ne + local.get $11 + call $~lib/arraybuffer/ArrayBufferView#get:byteLength + local.get $0 + global.get $~lib/typedarray/Float64Array.BYTES_PER_ELEMENT + i32.mul + i32.eq + i32.eqz if i32.const 0 - return + i32.const 24 + i32.const 83 + i32.const 2 + call $~lib/builtins/abort + unreachable end - block $break|0 - block - i32.const 0 - local.set $2 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.4 (result i32) - local.get $0 - local.set $3 - local.get $3 - i32.load offset=8 - i32.const 0 - i32.shr_u - end - local.set $3 - end - loop $repeat|0 - local.get $2 - local.get $3 - i32.lt_s - i32.eqz - br_if $break|0 - local.get $0 - local.get $2 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - local.get $1 - local.get $2 - call $~lib/array/Array#__get - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.ne - if - i32.const 0 - return - end - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $repeat|0 - unreachable - end + local.get $11 + call $~lib/typedarray/Float64Array#get:length + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 84 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 1 + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release + local.get $8 + call $~lib/rt/pure/__release + local.get $9 + call $~lib/rt/pure/__release + local.get $10 + call $~lib/rt/pure/__release + local.get $11 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int8Array#fill|trampoline (; 50 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - block $2of2 - block $1of2 - block $0of2 - block $outOfRange - global.get $~lib/argc - i32.const 1 - i32.sub - br_table $0of2 $1of2 $2of2 $outOfRange - end - unreachable - end - i32.const 0 - local.set $2 - end - global.get $~lib/builtins/i32.MAX_VALUE - local.set $3 + (func $~lib/typedarray/Int32Array#__set (; 52 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ge_u + if + i32.const 336 + i32.const 432 + i32.const 443 + i32.const 63 + call $~lib/builtins/abort + unreachable end local.get $0 + i32.load offset=4 local.get $1 + i32.const 2 + i32.shl + i32.add local.get $2 - local.get $3 - call $~lib/typedarray/Int8Array#fill + i32.store + ) + (func $~lib/typedarray/Int32Array#__get (; 53 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ge_u + if + i32.const 336 + i32.const 432 + i32.const 437 + i32.const 63 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + i32.load ) - (func $~lib/typedarray/Int8Array#subarray (; 51 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/typedarray/Int32Array#subarray (; 54 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) (local $8 i32) + (local $9 i32) local.get $0 - local.set $3 + call $~lib/rt/pure/__retain + local.set $5 local.get $1 local.set $4 local.get $2 - local.set $5 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.5 (result i32) - local.get $3 - local.set $6 - local.get $6 - i32.load offset=8 - i32.const 0 - i32.shr_u - end + local.set $3 + local.get $5 + call $~lib/typedarray/Int32Array#get:length local.set $6 local.get $4 i32.const 0 i32.lt_s - if + if (result i32) local.get $6 local.get $4 i32.add @@ -3618,7 +4143,6 @@ local.get $8 i32.gt_s select - local.set $4 else local.get $4 local.tee $7 @@ -3628,25 +4152,24 @@ local.get $8 i32.lt_s select - local.set $4 end - local.get $5 + local.set $4 + local.get $3 i32.const 0 i32.lt_s - if + if (result i32) local.get $6 - local.get $5 + local.get $3 i32.add local.tee $7 - local.get $4 + i32.const 0 local.tee $8 local.get $7 local.get $8 i32.gt_s select - local.set $5 else - local.get $5 + local.get $3 local.tee $7 local.get $6 local.tee $8 @@ -3654,293 +4177,88 @@ local.get $8 i32.lt_s select - local.tee $7 - local.get $4 - local.tee $8 - local.get $7 - local.get $8 - i32.gt_s - select - local.set $5 end - block $~lib/memory/memory.allocate|inlined.4 (result i32) - i32.const 12 - local.set $7 - local.get $7 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.4 - end - local.set $7 - local.get $7 - local.get $3 - i32.load - i32.store - local.get $7 - local.get $3 - i32.load offset=4 - local.get $4 - i32.const 0 - i32.shl - i32.add - i32.store offset=4 - local.get $7 - local.get $5 - local.get $4 - i32.sub - i32.const 0 - i32.shl - i32.store offset=8 - local.get $7 - ) - (func $~lib/typedarray/Int32Array#fill (; 52 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - local.get $0 - local.set $4 - local.get $1 - local.set $5 - local.get $2 - local.set $6 + local.set $3 local.get $3 - local.set $7 + local.tee $7 local.get $4 - i32.load - local.set $8 - local.get $4 - i32.load offset=4 - local.set $9 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.4 (result i32) - local.get $4 - local.set $10 - local.get $10 - i32.load offset=8 - i32.const 2 - i32.shr_u - end - local.set $10 - local.get $6 - i32.const 0 - i32.lt_s - if (result i32) - local.get $10 - local.get $6 - i32.add - local.tee $11 - i32.const 0 - local.tee $12 - local.get $11 - local.get $12 - i32.gt_s - select - else - local.get $6 - local.tee $11 - local.get $10 - local.tee $12 - local.get $11 - local.get $12 - i32.lt_s - select - end - local.set $6 + local.tee $8 local.get $7 - i32.const 0 - i32.lt_s - if (result i32) - local.get $10 - local.get $7 - i32.add - local.tee $11 - i32.const 0 - local.tee $12 - local.get $11 - local.get $12 - i32.gt_s - select - else - local.get $7 - local.tee $11 - local.get $10 - local.tee $12 - local.get $11 - local.get $12 - i32.lt_s - select - end - local.set $7 - block $break|0 - loop $repeat|0 - local.get $6 - local.get $7 - i32.lt_s - i32.eqz - br_if $break|0 - block $~lib/internal/arraybuffer/STORE|inlined.1 - local.get $8 - local.set $11 - local.get $6 - local.set $12 - local.get $5 - local.set $13 - local.get $9 - local.set $14 - local.get $11 - local.get $12 - i32.const 2 - i32.shl - i32.add - local.get $14 - i32.add - local.get $13 - i32.store offset=8 - end - local.get $6 - i32.const 1 - i32.add - local.set $6 - br $repeat|0 - unreachable - end - unreachable - end - local.get $4 - ) - (func $~lib/array/Array#__get (; 53 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load - local.set $2 - local.get $1 - local.get $2 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $2 - local.set $3 - local.get $1 - local.set $4 - i32.const 0 - local.set $5 - local.get $3 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $5 - i32.add - i32.load offset=8 - else - unreachable - end - ) - (func $std/typedarray/isInt32ArrayEqual (; 54 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - block $~lib/internal/typedarray/TypedArray#get:length|inlined.6 (result i32) - local.get $0 - local.set $2 - local.get $2 - i32.load offset=8 - i32.const 2 - i32.shr_u - end - block $~lib/array/Array#get:length|inlined.1 (result i32) - local.get $1 - local.set $2 - local.get $2 - i32.load offset=4 - end - i32.ne - if - i32.const 0 - return - end - block $break|0 - block - i32.const 0 - local.set $2 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.7 (result i32) - local.get $0 - local.set $3 - local.get $3 - i32.load offset=8 - i32.const 2 - i32.shr_u - end - local.set $3 - end - loop $repeat|0 - local.get $2 - local.get $3 - i32.lt_s - i32.eqz - br_if $break|0 - local.get $0 - local.get $2 - call $~lib/internal/typedarray/TypedArray#__get - local.get $1 - local.get $2 - call $~lib/array/Array#__get - i32.ne - if - i32.const 0 - return - end - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $repeat|0 - unreachable - end - unreachable - end - i32.const 1 - ) - (func $~lib/typedarray/Int32Array#fill|trampoline (; 55 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - block $2of2 - block $1of2 - block $0of2 - block $outOfRange - global.get $~lib/argc - i32.const 1 - i32.sub - br_table $0of2 $1of2 $2of2 $outOfRange - end - unreachable - end - i32.const 0 - local.set $2 + local.get $8 + i32.gt_s + select + local.set $3 + i32.const 12 + i32.const 8 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $7 + local.get $7 + local.tee $8 + block (result i32) + local.get $5 + i32.load + local.tee $9 + local.get $8 + i32.load + local.tee $8 + i32.ne + if + local.get $9 + call $~lib/rt/pure/__retain + drop + local.get $8 + call $~lib/rt/pure/__release end - global.get $~lib/builtins/i32.MAX_VALUE - local.set $3 + local.get $9 end - local.get $0 - local.get $1 - local.get $2 + i32.store + local.get $7 + local.get $5 + i32.load offset=4 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.store offset=4 + local.get $7 local.get $3 - call $~lib/typedarray/Int32Array#fill + local.get $4 + i32.sub + i32.const 2 + i32.shl + i32.store offset=8 + local.get $7 + local.set $9 + local.get $5 + call $~lib/rt/pure/__release + local.get $9 ) - (func $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 (; 56 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/typedarray/Float64Array#__set (; 55 ;) (type $FUNCSIG$viid) (param $0 i32) (param $1 i32) (param $2 f64) + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 3 + i32.shr_u + i32.ge_u + if + i32.const 336 + i32.const 432 + i32.const 853 + i32.const 63 + call $~lib/builtins/abort + unreachable + end local.get $0 + i32.load offset=4 local.get $1 + i32.const 3 + i32.shl i32.add + local.get $2 + f64.store ) - (func $~lib/typedarray/Int8Array#reduce (; 57 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/typedarray/Float64Array#subarray (; 56 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -3948,574 +4266,1011 @@ (local $7 i32) (local $8 i32) (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) local.get $0 - local.set $3 + call $~lib/rt/pure/__retain + local.set $5 local.get $1 local.set $4 local.get $2 - local.set $5 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.10 (result i32) - local.get $3 - local.set $6 + local.set $3 + local.get $5 + call $~lib/typedarray/Float64Array#get:length + local.set $6 + local.get $4 + i32.const 0 + i32.lt_s + if (result i32) local.get $6 - i32.load offset=8 + local.get $4 + i32.add + local.tee $7 i32.const 0 - i32.shr_u + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + else + local.get $4 + local.tee $7 + local.get $6 + local.tee $8 + local.get $7 + local.get $8 + i32.lt_s + select end - local.set $6 - local.get $3 - i32.load - local.set $7 + local.set $4 local.get $3 - i32.load offset=4 - local.set $8 - block $break|0 + i32.const 0 + i32.lt_s + if (result i32) + local.get $6 + local.get $3 + i32.add + local.tee $7 i32.const 0 - local.set $9 - loop $repeat|0 - local.get $9 - local.get $6 - i32.lt_s - i32.eqz - br_if $break|0 - block (result i32) - i32.const 4 - global.set $~lib/argc - local.get $5 - block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i32) - local.get $7 - local.set $10 - local.get $9 - local.set $11 - local.get $8 - local.set $12 - local.get $10 - local.get $11 - i32.const 0 - i32.shl - i32.add - local.get $12 - i32.add - i32.load8_s offset=8 - end - local.get $9 - local.get $3 - local.get $4 - call_indirect (type $FUNCSIG$iiiii) - end - local.set $5 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + else + local.get $3 + local.tee $7 + local.get $6 + local.tee $8 + local.get $7 + local.get $8 + i32.lt_s + select + end + local.set $3 + local.get $3 + local.tee $7 + local.get $4 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + local.set $3 + i32.const 12 + i32.const 13 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $7 + local.get $7 + local.tee $8 + block (result i32) + local.get $5 + i32.load + local.tee $9 + local.get $8 + i32.load + local.tee $8 + i32.ne + if local.get $9 - i32.const 1 - i32.add - local.set $9 - br $repeat|0 - unreachable + call $~lib/rt/pure/__retain + drop + local.get $8 + call $~lib/rt/pure/__release end - unreachable + local.get $9 end + i32.store + local.get $7 local.get $5 - ) - (func $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8> (; 58 ;) (type $FUNCSIG$v) - (local $0 i32) - (local $1 i32) - i32.const 0 + i32.load offset=4 + local.get $4 i32.const 3 - call $~lib/typedarray/Int8Array#constructor - local.set $0 - local.get $0 - i32.const 0 - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 2 + i32.shl + i32.add + i32.store offset=4 + local.get $7 + local.get $3 + local.get $4 + i32.sub i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 2 - i32.const 0 - call $~lib/typedarray/Int8Array#reduce - local.set $1 - local.get $1 - i32.const 24 i32.shl - i32.const 24 - i32.shr_s - i32.const 6 - i32.eq - i32.eqz - if + i32.store offset=8 + local.get $7 + local.set $9 + local.get $5 + call $~lib/rt/pure/__release + local.get $9 + ) + (func $~lib/util/sort/insertionSort (; 57 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 f64) + (local $5 i32) + (local $6 f64) + (local $7 i32) + block $break|0 i32.const 0 - i32.const 8 - i32.const 252 - i32.const 2 - call $~lib/env/abort + local.set $3 + loop $repeat|0 + local.get $3 + local.get $1 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $0 + local.get $3 + i32.const 3 + i32.shl + i32.add + f64.load + local.set $4 + local.get $3 + i32.const 1 + i32.sub + local.set $5 + block $break|1 + loop $continue|1 + local.get $5 + i32.const 0 + i32.ge_s + if + local.get $0 + local.get $5 + i32.const 3 + i32.shl + i32.add + f64.load + local.set $6 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $4 + local.get $6 + local.get $2 + call_indirect (type $FUNCSIG$idd) + end + i32.const 0 + i32.lt_s + if + local.get $0 + block (result i32) + local.get $5 + local.tee $7 + i32.const 1 + i32.sub + local.set $5 + local.get $7 + end + i32.const 1 + i32.add + i32.const 3 + i32.shl + i32.add + local.get $6 + f64.store + else + br $break|1 + end + br $continue|1 + end + end + end + local.get $0 + local.get $5 + i32.const 1 + i32.add + i32.const 3 + i32.shl + i32.add + local.get $4 + f64.store + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end unreachable end ) - (func $std/typedarray/testReduce<~lib/typedarray/Uint8Array,u8>~anonymous|0 (; 59 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - local.get $0 - local.get $1 - i32.add - ) - (func $~lib/typedarray/Uint8Array#reduce (; 60 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/memory/memory.fill (; 58 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - local.get $0 - local.set $3 - local.get $1 - local.set $4 - local.get $2 - local.set $5 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.2 (result i32) + (local $8 i64) + block $~lib/util/memory/memset|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $3 + i32.eqz + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 1 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 2 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 1 + i32.add + local.get $4 + i32.store8 + local.get $5 + i32.const 2 + i32.add + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 2 + i32.sub + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 3 + i32.sub + local.get $4 + i32.store8 local.get $3 + i32.const 6 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 3 + i32.add + local.get $4 + i32.store8 + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + i32.const 0 + local.get $5 + i32.sub + i32.const 3 + i32.and local.set $6 + local.get $5 local.get $6 - i32.load offset=8 - i32.const 0 - i32.shr_u - end - local.set $6 - local.get $3 - i32.load - local.set $7 - local.get $3 - i32.load offset=4 - local.set $8 - block $break|0 - i32.const 0 - local.set $9 - loop $repeat|0 - local.get $9 - local.get $6 - i32.lt_s - i32.eqz - br_if $break|0 - block (result i32) - i32.const 4 - global.set $~lib/argc - local.get $5 - block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i32) - local.get $7 - local.set $10 - local.get $9 - local.set $11 + i32.add + local.set $5 + local.get $3 + local.get $6 + i32.sub + local.set $3 + local.get $3 + i32.const -4 + i32.and + local.set $3 + i32.const -1 + i32.const 255 + i32.div_u + local.get $4 + i32.const 255 + i32.and + i32.mul + local.set $7 + local.get $5 + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.get $7 + i32.store + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 4 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 8 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 12 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 8 + i32.sub + local.get $7 + i32.store + local.get $3 + i32.const 24 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + i32.const 12 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 16 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 20 + i32.add + local.get $7 + i32.store + local.get $5 + i32.const 24 + i32.add + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 28 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 24 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 20 + i32.sub + local.get $7 + i32.store + local.get $5 + local.get $3 + i32.add + i32.const 16 + i32.sub + local.get $7 + i32.store + i32.const 24 + local.get $5 + i32.const 4 + i32.and + i32.add + local.set $6 + local.get $5 + local.get $6 + i32.add + local.set $5 + local.get $3 + local.get $6 + i32.sub + local.set $3 + local.get $7 + i64.extend_i32_u + local.get $7 + i64.extend_i32_u + i64.const 32 + i64.shl + i64.or + local.set $8 + block $break|0 + loop $continue|0 + local.get $3 + i32.const 32 + i32.ge_u + if + local.get $5 + local.get $8 + i64.store + local.get $5 + i32.const 8 + i32.add + local.get $8 + i64.store + local.get $5 + i32.const 16 + i32.add local.get $8 - local.set $12 - local.get $10 - local.get $11 - i32.const 0 - i32.shl + i64.store + local.get $5 + i32.const 24 i32.add - local.get $12 + local.get $8 + i64.store + local.get $3 + i32.const 32 + i32.sub + local.set $3 + local.get $5 + i32.const 32 i32.add - i32.load8_u offset=8 + local.set $5 + br $continue|0 end - local.get $9 - local.get $3 - local.get $4 - call_indirect (type $FUNCSIG$iiiii) end - local.set $5 - local.get $9 - i32.const 1 - i32.add - local.set $9 - br $repeat|0 - unreachable end - unreachable - end - local.get $5 - ) - (func $std/typedarray/testReduce<~lib/typedarray/Uint8Array,u8> (; 61 ;) (type $FUNCSIG$v) - (local $0 i32) - (local $1 i32) - i32.const 0 - i32.const 3 - call $~lib/typedarray/Uint8Array#constructor - local.set $0 - local.get $0 - i32.const 0 - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 2 - i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 3 - i32.const 0 - call $~lib/typedarray/Uint8Array#reduce - local.set $1 - local.get $1 - i32.const 255 - i32.and - i32.const 6 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 252 - i32.const 2 - call $~lib/env/abort - unreachable end ) - (func $std/typedarray/testReduce<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 (; 62 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - local.get $0 - local.get $1 - i32.add - ) - (func $~lib/typedarray/Uint8ClampedArray#reduce (; 63 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/sort/weakHeapSort (; 59 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - local.get $0 - local.set $3 + (local $8 f64) + (local $9 f64) + (local $10 f64) local.get $1 - local.set $4 - local.get $2 - local.set $5 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.3 (result i32) - local.get $3 - local.set $6 - local.get $6 - i32.load offset=8 - i32.const 0 - i32.shr_u - end - local.set $6 + i32.const 31 + i32.add + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + local.set $3 local.get $3 - i32.load - local.set $7 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $4 + local.get $4 + i32.const 0 local.get $3 - i32.load offset=4 - local.set $8 + call $~lib/memory/memory.fill block $break|0 - i32.const 0 - local.set $9 + local.get $1 + i32.const 1 + i32.sub + local.set $5 loop $repeat|0 - local.get $9 - local.get $6 - i32.lt_s + local.get $5 + i32.const 0 + i32.gt_s i32.eqz br_if $break|0 + local.get $5 + local.set $6 + block $break|1 + loop $continue|1 + local.get $6 + i32.const 1 + i32.and + local.get $4 + local.get $6 + i32.const 6 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + local.get $6 + i32.const 1 + i32.shr_s + i32.const 31 + i32.and + i32.shr_u + i32.const 1 + i32.and + i32.eq + if + local.get $6 + i32.const 1 + i32.shr_s + local.set $6 + br $continue|1 + end + end + end + local.get $6 + i32.const 1 + i32.shr_s + local.set $7 + local.get $0 + local.get $7 + i32.const 3 + i32.shl + i32.add + f64.load + local.set $8 + local.get $0 + local.get $5 + i32.const 3 + i32.shl + i32.add + f64.load + local.set $9 block (result i32) - i32.const 4 + i32.const 2 global.set $~lib/argc + local.get $8 + local.get $9 + local.get $2 + call_indirect (type $FUNCSIG$idd) + end + i32.const 0 + i32.lt_s + if + local.get $4 + local.get $5 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + local.get $4 + local.get $5 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + i32.const 1 + local.get $5 + i32.const 31 + i32.and + i32.shl + i32.xor + i32.store + local.get $0 local.get $5 - block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i32) + i32.const 3 + i32.shl + i32.add + local.get $8 + f64.store + local.get $0 + local.get $7 + i32.const 3 + i32.shl + i32.add + local.get $9 + f64.store + end + local.get $5 + i32.const 1 + i32.sub + local.set $5 + br $repeat|0 + unreachable + end + unreachable + end + block $break|2 + local.get $1 + i32.const 1 + i32.sub + local.set $7 + loop $repeat|2 + local.get $7 + i32.const 2 + i32.ge_s + i32.eqz + br_if $break|2 + local.get $0 + f64.load + local.set $9 + local.get $0 + local.get $0 + local.get $7 + i32.const 3 + i32.shl + i32.add + f64.load + f64.store + local.get $0 + local.get $7 + i32.const 3 + i32.shl + i32.add + local.get $9 + f64.store + i32.const 1 + local.set $6 + block $break|3 + loop $continue|3 + local.get $6 + i32.const 1 + i32.shl + local.get $4 + local.get $6 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + local.get $6 + i32.const 31 + i32.and + i32.shr_u + i32.const 1 + i32.and + i32.add + local.tee $5 local.get $7 - local.set $10 - local.get $9 - local.set $11 - local.get $8 - local.set $12 - local.get $10 - local.get $11 + i32.lt_s + if + local.get $5 + local.set $6 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $6 i32.const 0 - i32.shl - i32.add - local.get $12 - i32.add - i32.load8_u offset=8 + i32.gt_s + if + local.get $0 + f64.load + local.set $9 + local.get $0 + local.get $6 + i32.const 3 + i32.shl + i32.add + f64.load + local.set $8 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $9 + local.get $8 + local.get $2 + call_indirect (type $FUNCSIG$idd) + end + i32.const 0 + i32.lt_s + if + local.get $4 + local.get $6 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + local.get $4 + local.get $6 + i32.const 5 + i32.shr_s + i32.const 2 + i32.shl + i32.add + i32.load + i32.const 1 + local.get $6 + i32.const 31 + i32.and + i32.shl + i32.xor + i32.store + local.get $0 + local.get $6 + i32.const 3 + i32.shl + i32.add + local.get $9 + f64.store + local.get $0 + local.get $8 + f64.store + end + local.get $6 + i32.const 1 + i32.shr_s + local.set $6 + br $continue|4 + end end - local.get $9 - local.get $3 - local.get $4 - call_indirect (type $FUNCSIG$iiiii) end - local.set $5 - local.get $9 + local.get $7 i32.const 1 - i32.add - local.set $9 - br $repeat|0 + i32.sub + local.set $7 + br $repeat|2 unreachable end unreachable end - local.get $5 - ) - (func $std/typedarray/testReduce<~lib/typedarray/Uint8ClampedArray,u8> (; 64 ;) (type $FUNCSIG$v) - (local $0 i32) - (local $1 i32) - i32.const 0 - i32.const 3 - call $~lib/typedarray/Uint8ClampedArray#constructor - local.set $0 + local.get $4 + call $~lib/rt/tlsf/__free local.get $0 - i32.const 0 - i32.const 1 - call $~lib/typedarray/Uint8ClampedArray#__set + f64.load offset=8 + local.set $10 local.get $0 - i32.const 1 - i32.const 2 - call $~lib/typedarray/Uint8ClampedArray#__set local.get $0 - i32.const 2 - i32.const 3 - call $~lib/typedarray/Uint8ClampedArray#__set + f64.load + f64.store offset=8 local.get $0 - i32.const 4 - i32.const 0 - call $~lib/typedarray/Uint8ClampedArray#reduce - local.set $1 - local.get $1 - i32.const 255 - i32.and - i32.const 6 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 252 - i32.const 2 - call $~lib/env/abort - unreachable - end + local.get $10 + f64.store ) - (func $~lib/internal/typedarray/TypedArray#__set (; 65 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/typedarray/Float64Array#sort (; 60 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) - local.get $1 - local.get $0 - i32.load offset=8 - i32.const 1 - i32.shr_u - i32.ge_u - if - i32.const 0 - i32.const 48 - i32.const 50 - i32.const 63 - call $~lib/env/abort - unreachable - end - block $~lib/internal/arraybuffer/STORE|inlined.0 + (local $6 f64) + (local $7 f64) + (local $8 i32) + (local $9 i32) + (local $10 i32) + block $~lib/typedarray/SORT<~lib/typedarray/Float64Array,f64>|inlined.0 (result i32) local.get $0 - i32.load + call $~lib/rt/pure/__retain local.set $3 local.get $1 - local.set $4 - local.get $2 - local.set $5 - local.get $0 - i32.load offset=4 - local.set $6 + local.set $2 local.get $3 + call $~lib/typedarray/Float64Array#get:length + local.set $4 local.get $4 i32.const 1 - i32.shl - i32.add - local.get $6 - i32.add - local.get $5 - i32.store16 offset=8 + i32.le_s + if + local.get $3 + local.set $5 + local.get $3 + call $~lib/rt/pure/__release + local.get $5 + br $~lib/typedarray/SORT<~lib/typedarray/Float64Array,f64>|inlined.0 + end + local.get $3 + i32.load offset=4 + local.set $5 + local.get $4 + i32.const 2 + i32.eq + if + local.get $5 + f64.load offset=8 + local.set $6 + local.get $5 + f64.load + local.set $7 + block (result i32) + i32.const 2 + global.set $~lib/argc + local.get $6 + local.get $7 + local.get $2 + call_indirect (type $FUNCSIG$idd) + end + i32.const 0 + i32.lt_s + if + local.get $5 + local.get $7 + f64.store offset=8 + local.get $5 + local.get $6 + f64.store + end + local.get $3 + local.set $8 + local.get $3 + call $~lib/rt/pure/__release + local.get $8 + br $~lib/typedarray/SORT<~lib/typedarray/Float64Array,f64>|inlined.0 + end + block $~lib/util/sort/SORT|inlined.0 + local.get $5 + local.set $10 + local.get $4 + local.set $9 + local.get $2 + local.set $8 + local.get $9 + i32.const 256 + i32.lt_s + if + local.get $10 + local.get $9 + local.get $8 + call $~lib/util/sort/insertionSort + else + local.get $10 + local.get $9 + local.get $8 + call $~lib/util/sort/weakHeapSort + end + end + local.get $3 end ) - (func $std/typedarray/testReduce<~lib/typedarray/Int16Array,i16>~anonymous|0 (; 66 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 61 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) + (local $2 i64) + (local $3 i64) local.get $0 + i64.reinterpret_f64 + local.set $2 local.get $1 - i32.add - ) - (func $~lib/typedarray/Int16Array#reduce (; 67 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - local.get $0 + i64.reinterpret_f64 local.set $3 - local.get $1 - local.set $4 local.get $2 - local.set $5 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) - local.get $3 - local.set $6 - local.get $6 - i32.load offset=8 - i32.const 1 - i32.shr_u - end - local.set $6 + local.get $2 + i64.const 63 + i64.shr_s + i64.const 1 + i64.shr_u + i64.xor + local.set $2 local.get $3 - i32.load - local.set $7 local.get $3 - i32.load offset=4 - local.set $8 - block $break|0 - i32.const 0 - local.set $9 - loop $repeat|0 - local.get $9 - local.get $6 - i32.lt_s - i32.eqz - br_if $break|0 - block (result i32) - i32.const 4 - global.set $~lib/argc - local.get $5 - block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) - local.get $7 - local.set $10 - local.get $9 - local.set $11 - local.get $8 - local.set $12 - local.get $10 - local.get $11 - i32.const 1 - i32.shl - i32.add - local.get $12 - i32.add - i32.load16_s offset=8 - end - local.get $9 - local.get $3 - local.get $4 - call_indirect (type $FUNCSIG$iiiii) + i64.const 63 + i64.shr_s + i64.const 1 + i64.shr_u + i64.xor + local.set $3 + local.get $2 + local.get $3 + i64.gt_s + local.get $2 + local.get $3 + i64.lt_s + i32.sub + ) + (func $~lib/typedarray/Float64Array#sort|trampoline (; 62 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + block $1of1 + block $0of1 + block $outOfRange + global.get $~lib/argc + br_table $0of1 $1of1 $outOfRange end - local.set $5 - local.get $9 - i32.const 1 - i32.add - local.set $9 - br $repeat|0 unreachable end - unreachable + block $~lib/util/sort/COMPARATOR|inlined.0 (result i32) + i32.const 1 + br $~lib/util/sort/COMPARATOR|inlined.0 + end + local.set $1 end - local.get $5 - ) - (func $std/typedarray/testReduce<~lib/typedarray/Int16Array,i16> (; 68 ;) (type $FUNCSIG$v) - (local $0 i32) - (local $1 i32) - i32.const 0 - i32.const 3 - call $~lib/typedarray/Int16Array#constructor - local.set $0 - local.get $0 - i32.const 0 - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set local.get $0 - i32.const 1 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + local.get $1 + call $~lib/typedarray/Float64Array#sort + ) + (func $~lib/typedarray/Float64Array#__get (; 63 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) + local.get $1 local.get $0 - i32.const 2 + i32.load offset=8 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + i32.shr_u + i32.ge_u + if + i32.const 336 + i32.const 432 + i32.const 847 + i32.const 63 + call $~lib/builtins/abort + unreachable + end local.get $0 - i32.const 5 - i32.const 0 - call $~lib/typedarray/Int16Array#reduce - local.set $1 + i32.load offset=4 local.get $1 - i32.const 16 + i32.const 3 i32.shl - i32.const 16 - i32.shr_s - i32.const 6 - i32.eq - i32.eqz + i32.add + f64.load + ) + (func $~lib/typedarray/Uint8ClampedArray#__set (; 64 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $1 + local.get $0 + i32.load offset=8 + i32.ge_u if - i32.const 0 - i32.const 8 - i32.const 252 - i32.const 2 - call $~lib/env/abort + i32.const 336 + i32.const 432 + i32.const 197 + i32.const 44 + call $~lib/builtins/abort unreachable end + local.get $0 + i32.load offset=4 + local.get $1 + i32.add + local.get $2 + i32.const 31 + i32.shr_s + i32.const -1 + i32.xor + i32.const 255 + local.get $2 + i32.sub + i32.const 31 + i32.shr_s + local.get $2 + i32.or + i32.and + i32.store8 ) - (func $~lib/internal/typedarray/TypedArray#__set (; 69 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) + (func $~lib/typedarray/Uint8ClampedArray#__get (; 65 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=8 - i32.const 1 - i32.shr_u i32.ge_u if - i32.const 0 - i32.const 48 - i32.const 50 - i32.const 63 - call $~lib/env/abort + i32.const 336 + i32.const 432 + i32.const 191 + i32.const 44 + call $~lib/builtins/abort unreachable end - block $~lib/internal/arraybuffer/STORE|inlined.0 - local.get $0 - i32.load - local.set $3 - local.get $1 - local.set $4 - local.get $2 - local.set $5 - local.get $0 - i32.load offset=4 - local.set $6 - local.get $3 - local.get $4 - i32.const 1 - i32.shl - i32.add - local.get $6 - i32.add - local.get $5 - i32.store16 offset=8 - end + local.get $0 + i32.load offset=4 + local.get $1 + i32.add + i32.load8_u ) - (func $std/typedarray/testReduce<~lib/typedarray/Uint16Array,u16>~anonymous|0 (; 70 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/typedarray/Int8Array#__set (; 66 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $1 + local.get $0 + i32.load offset=8 + i32.ge_u + if + i32.const 336 + i32.const 432 + i32.const 33 + i32.const 44 + call $~lib/builtins/abort + unreachable + end local.get $0 + i32.load offset=4 local.get $1 i32.add + local.get $2 + i32.store8 ) - (func $~lib/typedarray/Uint16Array#reduce (; 71 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) + (func $~lib/typedarray/Int8Array#fill (; 67 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) @@ -4524,3915 +5279,3374 @@ (local $9 i32) (local $10 i32) (local $11 i32) - (local $12 i32) local.get $0 - local.set $3 + call $~lib/rt/pure/__retain + local.set $7 local.get $1 - local.set $4 + local.set $6 local.get $2 local.set $5 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) - local.get $3 - local.set $6 - local.get $6 - i32.load offset=8 - i32.const 1 - i32.shr_u - end - local.set $6 - local.get $3 - i32.load - local.set $7 local.get $3 + local.set $4 + local.get $7 i32.load offset=4 local.set $8 - block $break|0 - i32.const 0 - local.set $9 - loop $repeat|0 - local.get $9 - local.get $6 - i32.lt_s - i32.eqz - br_if $break|0 - block (result i32) - i32.const 4 - global.set $~lib/argc - local.get $5 - block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) - local.get $7 - local.set $10 - local.get $9 - local.set $11 - local.get $8 - local.set $12 - local.get $10 - local.get $11 - i32.const 1 - i32.shl - i32.add - local.get $12 - i32.add - i32.load16_u offset=8 - end - local.get $9 - local.get $3 - local.get $4 - call_indirect (type $FUNCSIG$iiiii) - end - local.set $5 - local.get $9 - i32.const 1 - i32.add - local.set $9 - br $repeat|0 - unreachable - end - unreachable - end + local.get $7 + call $~lib/typedarray/Int8Array#get:length + local.set $9 local.get $5 - ) - (func $std/typedarray/testReduce<~lib/typedarray/Uint16Array,u16> (; 72 ;) (type $FUNCSIG$v) - (local $0 i32) - (local $1 i32) - i32.const 0 - i32.const 3 - call $~lib/typedarray/Uint16Array#constructor - local.set $0 - local.get $0 i32.const 0 - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 2 - i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 6 + i32.lt_s + if (result i32) + local.get $9 + local.get $5 + i32.add + local.tee $10 + i32.const 0 + local.tee $11 + local.get $10 + local.get $11 + i32.gt_s + select + else + local.get $5 + local.tee $10 + local.get $9 + local.tee $11 + local.get $10 + local.get $11 + i32.lt_s + select + end + local.set $5 + local.get $4 i32.const 0 - call $~lib/typedarray/Uint16Array#reduce - local.set $1 - local.get $1 - i32.const 65535 - i32.and - i32.const 6 - i32.eq - i32.eqz - if + i32.lt_s + if (result i32) + local.get $9 + local.get $4 + i32.add + local.tee $10 i32.const 0 - i32.const 8 - i32.const 252 - i32.const 2 - call $~lib/env/abort - unreachable + local.tee $11 + local.get $10 + local.get $11 + i32.gt_s + select + else + local.get $4 + local.tee $10 + local.get $9 + local.tee $11 + local.get $10 + local.get $11 + i32.lt_s + select + end + local.set $4 + local.get $5 + local.get $4 + i32.lt_s + if + local.get $8 + local.get $5 + i32.add + local.get $6 + local.get $4 + local.get $5 + i32.sub + call $~lib/memory/memory.fill end + local.get $7 ) - (func $std/typedarray/testReduce<~lib/typedarray/Int32Array,i32>~anonymous|0 (; 73 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - local.get $0 - local.get $1 - i32.add - ) - (func $~lib/typedarray/Int32Array#reduce (; 74 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) + (func $~lib/rt/__allocArray (; 68 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) + i32.const 16 + local.get $2 + call $~lib/rt/tlsf/__alloc + local.set $4 local.get $0 - local.set $3 local.get $1 - local.set $4 - local.get $2 + i32.shl local.set $5 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.9 (result i32) - local.get $3 - local.set $6 - local.get $6 - i32.load offset=8 - i32.const 2 - i32.shr_u - end + local.get $5 + i32.const 0 + call $~lib/rt/tlsf/__alloc local.set $6 + local.get $4 + local.get $6 + call $~lib/rt/pure/__retain + i32.store + local.get $4 + local.get $6 + i32.store offset=4 + local.get $4 + local.get $5 + i32.store offset=8 + local.get $4 + local.get $0 + i32.store offset=12 local.get $3 - i32.load - local.set $7 - local.get $3 - i32.load offset=4 - local.set $8 - block $break|0 - i32.const 0 - local.set $9 - loop $repeat|0 - local.get $9 - local.get $6 - i32.lt_s - i32.eqz - br_if $break|0 - block (result i32) - i32.const 4 - global.set $~lib/argc - local.get $5 - block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i32) - local.get $7 - local.set $10 - local.get $9 - local.set $11 - local.get $8 - local.set $12 - local.get $10 - local.get $11 - i32.const 2 - i32.shl - i32.add - local.get $12 - i32.add - i32.load offset=8 - end - local.get $9 - local.get $3 - local.get $4 - call_indirect (type $FUNCSIG$iiiii) - end - local.set $5 - local.get $9 - i32.const 1 - i32.add - local.set $9 - br $repeat|0 - unreachable - end - unreachable + if + local.get $6 + local.get $3 + local.get $5 + call $~lib/memory/memory.copy end - local.get $5 + local.get $4 ) - (func $std/typedarray/testReduce<~lib/typedarray/Int32Array,i32> (; 75 ;) (type $FUNCSIG$v) - (local $0 i32) - (local $1 i32) - i32.const 0 - i32.const 3 - call $~lib/typedarray/Int32Array#constructor - local.set $0 - local.get $0 - i32.const 0 - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 2 - i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + (func $~lib/array/Array#get:length (; 69 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - i32.const 7 - i32.const 0 - call $~lib/typedarray/Int32Array#reduce - local.set $1 + i32.load offset=12 + ) + (func $~lib/typedarray/Int8Array#__get (; 70 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 - i32.const 6 - i32.eq - i32.eqz + local.get $0 + i32.load offset=8 + i32.ge_u if - i32.const 0 - i32.const 8 - i32.const 252 - i32.const 2 - call $~lib/env/abort + i32.const 336 + i32.const 432 + i32.const 27 + i32.const 44 + call $~lib/builtins/abort unreachable end + local.get $0 + i32.load offset=4 + local.get $1 + i32.add + i32.load8_s ) - (func $~lib/internal/typedarray/TypedArray#__set (; 76 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) + (func $~lib/array/Array#__unchecked_get (; 71 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 0 + i32.shl + i32.add + i32.load8_s + ) + (func $~lib/array/Array#__get (; 72 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=8 - i32.const 2 + i32.const 0 i32.shr_u i32.ge_u if - i32.const 0 - i32.const 48 - i32.const 50 - i32.const 63 - call $~lib/env/abort + i32.const 336 + i32.const 512 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort unreachable end - block $~lib/internal/arraybuffer/STORE|inlined.0 - local.get $0 - i32.load - local.set $3 - local.get $1 - local.set $4 - local.get $2 - local.set $5 - local.get $0 - i32.load offset=4 - local.set $6 - local.get $3 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $6 - i32.add - local.get $5 - i32.store offset=8 - end - ) - (func $std/typedarray/testReduce<~lib/typedarray/Uint32Array,u32>~anonymous|0 (; 77 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) local.get $0 local.get $1 - i32.add + call $~lib/array/Array#__unchecked_get ) - (func $~lib/typedarray/Uint32Array#reduce (; 78 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/isInt8ArrayEqual (; 73 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) local.get $0 - local.set $3 + call $~lib/rt/pure/__retain + drop local.get $1 - local.set $4 - local.get $2 - local.set $5 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) - local.get $3 - local.set $6 - local.get $6 - i32.load offset=8 - i32.const 2 - i32.shr_u + call $~lib/rt/pure/__retain + drop + local.get $0 + call $~lib/typedarray/Int8Array#get:length + local.get $1 + call $~lib/array/Array#get:length + i32.ne + if + i32.const 0 + local.set $2 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + return end - local.set $6 - local.get $3 - i32.load - local.set $7 - local.get $3 - i32.load offset=4 - local.set $8 block $break|0 - i32.const 0 - local.set $9 + block + i32.const 0 + local.set $2 + local.get $0 + call $~lib/typedarray/Int8Array#get:length + local.set $3 + end loop $repeat|0 - local.get $9 - local.get $6 + local.get $2 + local.get $3 i32.lt_s i32.eqz br_if $break|0 - block (result i32) - i32.const 4 - global.set $~lib/argc - local.get $5 - block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) - local.get $7 - local.set $10 - local.get $9 - local.set $11 - local.get $8 - local.set $12 - local.get $10 - local.get $11 - i32.const 2 - i32.shl - i32.add - local.get $12 - i32.add - i32.load offset=8 - end - local.get $9 - local.get $3 + local.get $0 + local.get $2 + call $~lib/typedarray/Int8Array#__get + local.get $1 + local.get $2 + call $~lib/array/Array#__get + i32.ne + if + i32.const 0 + local.set $4 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release local.get $4 - call_indirect (type $FUNCSIG$iiiii) + return end - local.set $5 - local.get $9 + local.get $2 i32.const 1 i32.add - local.set $9 - br $repeat|0 - unreachable - end - unreachable - end - local.get $5 - ) - (func $std/typedarray/testReduce<~lib/typedarray/Uint32Array,u32> (; 79 ;) (type $FUNCSIG$v) - (local $0 i32) - (local $1 i32) - i32.const 0 - i32.const 3 - call $~lib/typedarray/Uint32Array#constructor - local.set $0 - local.get $0 - i32.const 0 - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + local.set $2 + br $repeat|0 + unreachable + end + unreachable + end i32.const 1 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 2 - i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + local.set $3 local.get $0 - i32.const 8 - i32.const 0 - call $~lib/typedarray/Uint32Array#reduce - local.set $1 + call $~lib/rt/pure/__release local.get $1 - i32.const 6 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 252 - i32.const 2 - call $~lib/env/abort - unreachable - end + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/internal/typedarray/TypedArray#__set (; 80 ;) (type $FUNCSIG$viij) (param $0 i32) (param $1 i32) (param $2 i64) + (func $~lib/typedarray/Int8Array#subarray (; 74 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - (local $5 i64) + (local $5 i32) (local $6 i32) - local.get $1 + (local $7 i32) + (local $8 i32) + (local $9 i32) local.get $0 - i32.load offset=8 - i32.const 3 - i32.shr_u - i32.ge_u - if + call $~lib/rt/pure/__retain + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + call $~lib/typedarray/Int8Array#get:length + local.set $6 + local.get $4 + i32.const 0 + i32.lt_s + if (result i32) + local.get $6 + local.get $4 + i32.add + local.tee $7 i32.const 0 - i32.const 48 - i32.const 50 - i32.const 63 - call $~lib/env/abort - unreachable + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + else + local.get $4 + local.tee $7 + local.get $6 + local.tee $8 + local.get $7 + local.get $8 + i32.lt_s + select end - block $~lib/internal/arraybuffer/STORE|inlined.0 - local.get $0 - i32.load - local.set $3 - local.get $1 - local.set $4 - local.get $2 - local.set $5 - local.get $0 - i32.load offset=4 - local.set $6 + local.set $4 + local.get $3 + i32.const 0 + i32.lt_s + if (result i32) + local.get $6 local.get $3 - local.get $4 - i32.const 3 - i32.shl i32.add + local.tee $7 + i32.const 0 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + else + local.get $3 + local.tee $7 local.get $6 - i32.add + local.tee $8 + local.get $7 + local.get $8 + i32.lt_s + select + end + local.set $3 + local.get $3 + local.tee $7 + local.get $4 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + local.set $3 + i32.const 12 + i32.const 3 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $7 + local.get $7 + local.tee $8 + block (result i32) local.get $5 - i64.store offset=8 + i32.load + local.tee $9 + local.get $8 + i32.load + local.tee $8 + i32.ne + if + local.get $9 + call $~lib/rt/pure/__retain + drop + local.get $8 + call $~lib/rt/pure/__release + end + local.get $9 end + i32.store + local.get $7 + local.get $5 + i32.load offset=4 + local.get $4 + i32.const 0 + i32.shl + i32.add + i32.store offset=4 + local.get $7 + local.get $3 + local.get $4 + i32.sub + i32.const 0 + i32.shl + i32.store offset=8 + local.get $7 + local.set $9 + local.get $5 + call $~lib/rt/pure/__release + local.get $9 ) - (func $std/typedarray/testReduce<~lib/typedarray/Int64Array,i64>~anonymous|0 (; 81 ;) (type $FUNCSIG$jjjii) (param $0 i64) (param $1 i64) (param $2 i32) (param $3 i32) (result i64) - local.get $0 - local.get $1 - i64.add - ) - (func $~lib/typedarray/Int64Array#reduce (; 82 ;) (type $FUNCSIG$jiij) (param $0 i32) (param $1 i32) (param $2 i64) (result i64) - (local $3 i32) + (func $~lib/typedarray/Int32Array#fill (; 75 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) - (local $5 i64) + (local $5 i32) (local $6 i32) (local $7 i32) (local $8 i32) (local $9 i32) (local $10 i32) (local $11 i32) - (local $12 i32) local.get $0 - local.set $3 + call $~lib/rt/pure/__retain + local.set $7 local.get $1 - local.set $4 + local.set $6 local.get $2 local.set $5 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) - local.get $3 - local.set $6 - local.get $6 - i32.load offset=8 - i32.const 3 - i32.shr_u - end - local.set $6 - local.get $3 - i32.load - local.set $7 local.get $3 + local.set $4 + local.get $7 i32.load offset=4 local.set $8 - block $break|0 + local.get $7 + call $~lib/typedarray/Int32Array#get:length + local.set $9 + local.get $5 + i32.const 0 + i32.lt_s + if (result i32) + local.get $9 + local.get $5 + i32.add + local.tee $10 i32.const 0 - local.set $9 + local.tee $11 + local.get $10 + local.get $11 + i32.gt_s + select + else + local.get $5 + local.tee $10 + local.get $9 + local.tee $11 + local.get $10 + local.get $11 + i32.lt_s + select + end + local.set $5 + local.get $4 + i32.const 0 + i32.lt_s + if (result i32) + local.get $9 + local.get $4 + i32.add + local.tee $10 + i32.const 0 + local.tee $11 + local.get $10 + local.get $11 + i32.gt_s + select + else + local.get $4 + local.tee $10 + local.get $9 + local.tee $11 + local.get $10 + local.get $11 + i32.lt_s + select + end + local.set $4 + block $break|0 loop $repeat|0 - local.get $9 - local.get $6 + local.get $5 + local.get $4 i32.lt_s i32.eqz br_if $break|0 - block (result i64) - i32.const 4 - global.set $~lib/argc - local.get $5 - block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i64) - local.get $7 - local.set $10 - local.get $9 - local.set $11 - local.get $8 - local.set $12 - local.get $10 - local.get $11 - i32.const 3 - i32.shl - i32.add - local.get $12 - i32.add - i64.load offset=8 - end - local.get $9 - local.get $3 - local.get $4 - call_indirect (type $FUNCSIG$jjjii) - end - local.set $5 - local.get $9 + local.get $8 + local.get $5 + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store + local.get $5 i32.const 1 i32.add - local.set $9 + local.set $5 br $repeat|0 unreachable end unreachable end - local.get $5 + local.get $7 ) - (func $std/typedarray/testReduce<~lib/typedarray/Int64Array,i64> (; 83 ;) (type $FUNCSIG$v) - (local $0 i32) - (local $1 i64) - i32.const 0 - i32.const 3 - call $~lib/typedarray/Int64Array#constructor - local.set $0 - local.get $0 - i32.const 0 - i64.const 1 - call $~lib/internal/typedarray/TypedArray#__set + (func $~lib/array/Array#get:length (; 76 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - i32.const 1 - i64.const 2 - call $~lib/internal/typedarray/TypedArray#__set + i32.load offset=12 + ) + (func $~lib/array/Array#__unchecked_get (; 77 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 + i32.load offset=4 + local.get $1 i32.const 2 - i64.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 9 - i64.const 0 - call $~lib/typedarray/Int64Array#reduce - local.set $1 + i32.shl + i32.add + i32.load + ) + (func $~lib/array/Array#__get (; 78 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 - i64.const 6 - i64.eq - i32.eqz + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ge_u if - i32.const 0 - i32.const 8 - i32.const 252 - i32.const 2 - call $~lib/env/abort + i32.const 336 + i32.const 512 + i32.const 109 + i32.const 61 + call $~lib/builtins/abort unreachable end + local.get $0 + local.get $1 + call $~lib/array/Array#__unchecked_get ) - (func $~lib/internal/typedarray/TypedArray#__set (; 84 ;) (type $FUNCSIG$viij) (param $0 i32) (param $1 i32) (param $2 i64) + (func $std/typedarray/isInt32ArrayEqual (; 79 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i64) - (local $6 i32) + local.get $0 + call $~lib/rt/pure/__retain + drop local.get $1 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.load offset=8 - i32.const 3 - i32.shr_u - i32.ge_u + call $~lib/typedarray/Int32Array#get:length + local.get $1 + call $~lib/array/Array#get:length + i32.ne if i32.const 0 - i32.const 48 - i32.const 50 - i32.const 63 - call $~lib/env/abort - unreachable - end - block $~lib/internal/arraybuffer/STORE|inlined.0 + local.set $2 local.get $0 - i32.load - local.set $3 + call $~lib/rt/pure/__release local.get $1 - local.set $4 + call $~lib/rt/pure/__release local.get $2 - local.set $5 - local.get $0 - i32.load offset=4 - local.set $6 - local.get $3 - local.get $4 - i32.const 3 - i32.shl - i32.add - local.get $6 - i32.add - local.get $5 - i64.store offset=8 + return + end + block $break|0 + block + i32.const 0 + local.set $2 + local.get $0 + call $~lib/typedarray/Int32Array#get:length + local.set $3 + end + loop $repeat|0 + local.get $2 + local.get $3 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $0 + local.get $2 + call $~lib/typedarray/Int32Array#__get + local.get $1 + local.get $2 + call $~lib/array/Array#__get + i32.ne + if + i32.const 0 + local.set $4 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $4 + return + end + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $repeat|0 + unreachable + end + unreachable end + i32.const 1 + local.set $3 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $3 ) - (func $std/typedarray/testReduce<~lib/typedarray/Uint64Array,u64>~anonymous|0 (; 85 ;) (type $FUNCSIG$jjjii) (param $0 i64) (param $1 i64) (param $2 i32) (param $3 i32) (result i64) + (func $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 (; 80 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/pure/__retain + drop local.get $0 local.get $1 - i64.add + i32.add + local.set $4 + local.get $3 + call $~lib/rt/pure/__release + local.get $4 ) - (func $~lib/typedarray/Uint64Array#reduce (; 86 ;) (type $FUNCSIG$jiij) (param $0 i32) (param $1 i32) (param $2 i64) (result i64) + (func $~lib/typedarray/Int8Array#reduce (; 81 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - (local $5 i64) + (local $5 i32) (local $6 i32) (local $7 i32) (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) local.get $0 - local.set $3 + call $~lib/rt/pure/__retain + local.set $5 local.get $1 local.set $4 local.get $2 - local.set $5 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) - local.get $3 - local.set $6 - local.get $6 - i32.load offset=8 - i32.const 3 - i32.shr_u - end - local.set $6 - local.get $3 - i32.load - local.set $7 - local.get $3 + local.set $3 + local.get $5 i32.load offset=4 - local.set $8 + local.set $6 block $break|0 - i32.const 0 - local.set $9 + block + i32.const 0 + local.set $7 + local.get $5 + call $~lib/typedarray/Int8Array#get:length + local.set $8 + end loop $repeat|0 - local.get $9 - local.get $6 + local.get $7 + local.get $8 i32.lt_s i32.eqz br_if $break|0 - block (result i64) + block (result i32) i32.const 4 global.set $~lib/argc - local.get $5 - block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i64) - local.get $7 - local.set $10 - local.get $9 - local.set $11 - local.get $8 - local.set $12 - local.get $10 - local.get $11 - i32.const 3 - i32.shl - i32.add - local.get $12 - i32.add - i64.load offset=8 - end - local.get $9 local.get $3 + local.get $6 + local.get $7 + i32.const 0 + i32.shl + i32.add + i32.load8_s + local.get $7 + local.get $5 local.get $4 - call_indirect (type $FUNCSIG$jjjii) + call_indirect (type $FUNCSIG$iiiii) end - local.set $5 - local.get $9 + local.set $3 + local.get $7 i32.const 1 i32.add - local.set $9 + local.set $7 br $repeat|0 unreachable end unreachable end + local.get $3 + local.set $8 local.get $5 + call $~lib/rt/pure/__release + local.get $8 ) - (func $std/typedarray/testReduce<~lib/typedarray/Uint64Array,u64> (; 87 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8> (; 82 ;) (type $FUNCSIG$v) (local $0 i32) - (local $1 i64) + (local $1 i32) + (local $2 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Uint64Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Int8Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - i64.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 i32.const 1 - i64.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + call $~lib/typedarray/Int8Array#__set + local.get $1 + i32.const 1 i32.const 2 - i64.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 10 - i64.const 0 - call $~lib/typedarray/Uint64Array#reduce - local.set $1 + call $~lib/typedarray/Int8Array#__set local.get $1 - i64.const 6 - i64.eq + i32.const 2 + i32.const 3 + call $~lib/typedarray/Int8Array#__set + local.get $1 + i32.const 2 + i32.const 0 + call $~lib/typedarray/Int8Array#reduce + local.set $2 + local.get $2 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.const 6 + i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 252 + i32.const 24 + i32.const 263 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - ) - (func $~lib/internal/typedarray/TypedArray#__set (; 88 ;) (type $FUNCSIG$viif) (param $0 i32) (param $1 i32) (param $2 f32) - (local $3 i32) - (local $4 i32) - (local $5 f32) - (local $6 i32) - local.get $1 local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u - i32.ge_u - if - i32.const 0 - i32.const 48 - i32.const 50 - i32.const 63 - call $~lib/env/abort - unreachable - end - block $~lib/internal/arraybuffer/STORE|inlined.0 - local.get $0 - i32.load - local.set $3 - local.get $1 - local.set $4 - local.get $2 - local.set $5 - local.get $0 - i32.load offset=4 - local.set $6 - local.get $3 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $6 - i32.add - local.get $5 - f32.store offset=8 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + ) + (func $~lib/typedarray/Uint8Array#__set (; 83 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $1 + local.get $0 + i32.load offset=8 + i32.ge_u + if + i32.const 336 + i32.const 432 + i32.const 115 + i32.const 44 + call $~lib/builtins/abort + unreachable end + local.get $0 + i32.load offset=4 + local.get $1 + i32.add + local.get $2 + i32.store8 ) - (func $std/typedarray/testReduce<~lib/typedarray/Float32Array,f32>~anonymous|0 (; 89 ;) (type $FUNCSIG$fffii) (param $0 f32) (param $1 f32) (param $2 i32) (param $3 i32) (result f32) + (func $std/typedarray/testReduce<~lib/typedarray/Uint8Array,u8>~anonymous|0 (; 84 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/pure/__retain + drop local.get $0 local.get $1 - f32.add + i32.add + local.set $4 + local.get $3 + call $~lib/rt/pure/__release + local.get $4 ) - (func $~lib/typedarray/Float32Array#reduce (; 90 ;) (type $FUNCSIG$fiif) (param $0 i32) (param $1 i32) (param $2 f32) (result f32) + (func $~lib/typedarray/Uint8Array#reduce (; 85 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - (local $5 f32) + (local $5 i32) (local $6 i32) (local $7 i32) (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) local.get $0 - local.set $3 + call $~lib/rt/pure/__retain + local.set $5 local.get $1 local.set $4 local.get $2 - local.set $5 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) - local.get $3 - local.set $6 - local.get $6 - i32.load offset=8 - i32.const 2 - i32.shr_u - end - local.set $6 - local.get $3 - i32.load - local.set $7 - local.get $3 + local.set $3 + local.get $5 i32.load offset=4 - local.set $8 + local.set $6 block $break|0 - i32.const 0 - local.set $9 + block + i32.const 0 + local.set $7 + local.get $5 + call $~lib/typedarray/Uint8Array#get:length + local.set $8 + end loop $repeat|0 - local.get $9 - local.get $6 + local.get $7 + local.get $8 i32.lt_s i32.eqz br_if $break|0 - block (result f32) + block (result i32) i32.const 4 global.set $~lib/argc - local.get $5 - block $~lib/internal/arraybuffer/LOAD|inlined.0 (result f32) - local.get $7 - local.set $10 - local.get $9 - local.set $11 - local.get $8 - local.set $12 - local.get $10 - local.get $11 - i32.const 2 - i32.shl - i32.add - local.get $12 - i32.add - f32.load offset=8 - end - local.get $9 local.get $3 + local.get $6 + local.get $7 + i32.const 0 + i32.shl + i32.add + i32.load8_u + local.get $7 + local.get $5 local.get $4 - call_indirect (type $FUNCSIG$fffii) + call_indirect (type $FUNCSIG$iiiii) end - local.set $5 - local.get $9 + local.set $3 + local.get $7 i32.const 1 i32.add - local.set $9 + local.set $7 br $repeat|0 unreachable end unreachable end + local.get $3 + local.set $8 local.get $5 + call $~lib/rt/pure/__release + local.get $8 ) - (func $std/typedarray/testReduce<~lib/typedarray/Float32Array,f32> (; 91 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduce<~lib/typedarray/Uint8Array,u8> (; 86 ;) (type $FUNCSIG$v) (local $0 i32) - (local $1 f32) + (local $1 i32) + (local $2 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Float32Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Uint8Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - f32.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 i32.const 1 - f32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + call $~lib/typedarray/Uint8Array#__set + local.get $1 + i32.const 1 i32.const 2 - f32.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 11 - f32.const 0 - call $~lib/typedarray/Float32Array#reduce - local.set $1 + call $~lib/typedarray/Uint8Array#__set local.get $1 - f32.const 6 - f32.eq + i32.const 2 + i32.const 3 + call $~lib/typedarray/Uint8Array#__set + local.get $1 + i32.const 3 + i32.const 0 + call $~lib/typedarray/Uint8Array#reduce + local.set $2 + local.get $2 + i32.const 255 + i32.and + i32.const 6 + i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 252 + i32.const 24 + i32.const 263 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testReduce<~lib/typedarray/Float64Array,f64>~anonymous|0 (; 92 ;) (type $FUNCSIG$dddii) (param $0 f64) (param $1 f64) (param $2 i32) (param $3 i32) (result f64) + (func $std/typedarray/testReduce<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 (; 87 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/pure/__retain + drop local.get $0 local.get $1 - f64.add + i32.add + local.set $4 + local.get $3 + call $~lib/rt/pure/__release + local.get $4 ) - (func $~lib/typedarray/Float64Array#reduce (; 93 ;) (type $FUNCSIG$diid) (param $0 i32) (param $1 i32) (param $2 f64) (result f64) + (func $~lib/typedarray/Uint8ClampedArray#reduce (; 88 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - (local $5 f64) + (local $5 i32) (local $6 i32) (local $7 i32) (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) local.get $0 - local.set $3 + call $~lib/rt/pure/__retain + local.set $5 local.get $1 local.set $4 local.get $2 - local.set $5 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.4 (result i32) - local.get $3 - local.set $6 - local.get $6 - i32.load offset=8 - i32.const 3 - i32.shr_u - end - local.set $6 - local.get $3 - i32.load - local.set $7 - local.get $3 + local.set $3 + local.get $5 i32.load offset=4 - local.set $8 + local.set $6 block $break|0 - i32.const 0 - local.set $9 + block + i32.const 0 + local.set $7 + local.get $5 + call $~lib/typedarray/Uint8ClampedArray#get:length + local.set $8 + end loop $repeat|0 - local.get $9 - local.get $6 + local.get $7 + local.get $8 i32.lt_s i32.eqz br_if $break|0 - block (result f64) + block (result i32) i32.const 4 global.set $~lib/argc - local.get $5 - block $~lib/internal/arraybuffer/LOAD|inlined.13 (result f64) - local.get $7 - local.set $10 - local.get $9 - local.set $11 - local.get $8 - local.set $12 - local.get $10 - local.get $11 - i32.const 3 - i32.shl - i32.add - local.get $12 - i32.add - f64.load offset=8 - end - local.get $9 local.get $3 + local.get $6 + local.get $7 + i32.const 0 + i32.shl + i32.add + i32.load8_u + local.get $7 + local.get $5 local.get $4 - call_indirect (type $FUNCSIG$dddii) + call_indirect (type $FUNCSIG$iiiii) end - local.set $5 - local.get $9 + local.set $3 + local.get $7 i32.const 1 i32.add - local.set $9 + local.set $7 br $repeat|0 unreachable end unreachable end + local.get $3 + local.set $8 local.get $5 + call $~lib/rt/pure/__release + local.get $8 ) - (func $std/typedarray/testReduce<~lib/typedarray/Float64Array,f64> (; 94 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduce<~lib/typedarray/Uint8ClampedArray,u8> (; 89 ;) (type $FUNCSIG$v) (local $0 i32) - (local $1 f64) + (local $1 i32) + (local $2 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Float64Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Uint8ClampedArray#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - f64.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 i32.const 1 - f64.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $1 + i32.const 1 i32.const 2 - f64.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 12 - f64.const 0 - call $~lib/typedarray/Float64Array#reduce - local.set $1 + call $~lib/typedarray/Uint8ClampedArray#__set local.get $1 - f64.const 6 - f64.eq + i32.const 2 + i32.const 3 + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $1 + i32.const 4 + i32.const 0 + call $~lib/typedarray/Uint8ClampedArray#reduce + local.set $2 + local.get $2 + i32.const 255 + i32.and + i32.const 6 + i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 252 + i32.const 24 + i32.const 263 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + ) + (func $~lib/typedarray/Int16Array#__set (; 90 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 1 + i32.shr_u + i32.ge_u + if + i32.const 336 + i32.const 432 + i32.const 279 + i32.const 63 + call $~lib/builtins/abort unreachable end + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 1 + i32.shl + i32.add + local.get $2 + i32.store16 ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Int8Array,i8>~anonymous|0 (; 95 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $std/typedarray/testReduce<~lib/typedarray/Int16Array,i16>~anonymous|0 (; 91 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/pure/__retain + drop local.get $0 local.get $1 i32.add + local.set $4 + local.get $3 + call $~lib/rt/pure/__release + local.get $4 ) - (func $~lib/typedarray/Int8Array#reduceRight (; 96 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/typedarray/Int16Array#reduce (; 92 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) local.get $0 - local.set $3 + call $~lib/rt/pure/__retain + local.set $5 local.get $1 local.set $4 local.get $2 - local.set $5 - local.get $3 - i32.load - local.set $6 - local.get $3 + local.set $3 + local.get $5 i32.load offset=4 - local.set $7 + local.set $6 block $break|0 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.11 (result i32) - local.get $3 - local.set $8 - local.get $8 - i32.load offset=8 + block i32.const 0 - i32.shr_u + local.set $7 + local.get $5 + call $~lib/typedarray/Int16Array#get:length + local.set $8 end - i32.const 1 - i32.sub - local.set $8 loop $repeat|0 + local.get $7 local.get $8 - i32.const 0 - i32.ge_s + i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 4 global.set $~lib/argc - local.get $5 - block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i32) - local.get $6 - local.set $9 - local.get $8 - local.set $10 - local.get $7 - local.set $11 - local.get $9 - local.get $10 - i32.const 0 - i32.shl - i32.add - local.get $11 - i32.add - i32.load8_s offset=8 - end - local.get $8 local.get $3 + local.get $6 + local.get $7 + i32.const 1 + i32.shl + i32.add + i32.load16_s + local.get $7 + local.get $5 local.get $4 call_indirect (type $FUNCSIG$iiiii) end - local.set $5 - local.get $8 + local.set $3 + local.get $7 i32.const 1 - i32.sub - local.set $8 + i32.add + local.set $7 br $repeat|0 unreachable end unreachable end + local.get $3 + local.set $8 local.get $5 + call $~lib/rt/pure/__release + local.get $8 ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Int8Array,i8> (; 97 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduce<~lib/typedarray/Int16Array,i16> (; 93 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) + (local $2 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Int8Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Int16Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + call $~lib/typedarray/Int16Array#__set + local.get $1 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + call $~lib/typedarray/Int16Array#__set + local.get $1 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 13 - i32.const 0 - call $~lib/typedarray/Int8Array#reduceRight - local.set $1 + call $~lib/typedarray/Int16Array#__set local.get $1 - i32.const 24 + i32.const 5 + i32.const 0 + call $~lib/typedarray/Int16Array#reduce + local.set $2 + local.get $2 + i32.const 16 i32.shl - i32.const 24 + i32.const 16 i32.shr_s i32.const 6 i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 279 + i32.const 24 + i32.const 263 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + ) + (func $~lib/typedarray/Uint16Array#__set (; 94 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 1 + i32.shr_u + i32.ge_u + if + i32.const 336 + i32.const 432 + i32.const 361 + i32.const 63 + call $~lib/builtins/abort unreachable end + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 1 + i32.shl + i32.add + local.get $2 + i32.store16 ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Uint8Array,u8>~anonymous|0 (; 98 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $std/typedarray/testReduce<~lib/typedarray/Uint16Array,u16>~anonymous|0 (; 95 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/pure/__retain + drop local.get $0 local.get $1 i32.add + local.set $4 + local.get $3 + call $~lib/rt/pure/__release + local.get $4 ) - (func $~lib/typedarray/Uint8Array#reduceRight (; 99 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/typedarray/Uint16Array#reduce (; 96 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) local.get $0 - local.set $3 + call $~lib/rt/pure/__retain + local.set $5 local.get $1 local.set $4 local.get $2 - local.set $5 - local.get $3 - i32.load - local.set $6 - local.get $3 + local.set $3 + local.get $5 i32.load offset=4 - local.set $7 + local.set $6 block $break|0 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.4 (result i32) - local.get $3 - local.set $8 - local.get $8 - i32.load offset=8 + block i32.const 0 - i32.shr_u + local.set $7 + local.get $5 + call $~lib/typedarray/Uint16Array#get:length + local.set $8 end - i32.const 1 - i32.sub - local.set $8 loop $repeat|0 + local.get $7 local.get $8 - i32.const 0 - i32.ge_s + i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 4 global.set $~lib/argc - local.get $5 - block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i32) - local.get $6 - local.set $9 - local.get $8 - local.set $10 - local.get $7 - local.set $11 - local.get $9 - local.get $10 - i32.const 0 - i32.shl - i32.add - local.get $11 - i32.add - i32.load8_u offset=8 - end - local.get $8 local.get $3 + local.get $6 + local.get $7 + i32.const 1 + i32.shl + i32.add + i32.load16_u + local.get $7 + local.get $5 local.get $4 call_indirect (type $FUNCSIG$iiiii) end - local.set $5 - local.get $8 + local.set $3 + local.get $7 i32.const 1 - i32.sub - local.set $8 + i32.add + local.set $7 br $repeat|0 unreachable end unreachable end + local.get $3 + local.set $8 local.get $5 + call $~lib/rt/pure/__release + local.get $8 ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Uint8Array,u8> (; 100 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduce<~lib/typedarray/Uint16Array,u16> (; 97 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) + (local $2 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Uint8Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Uint16Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + call $~lib/typedarray/Uint16Array#__set + local.get $1 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + call $~lib/typedarray/Uint16Array#__set + local.get $1 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 14 - i32.const 0 - call $~lib/typedarray/Uint8Array#reduceRight - local.set $1 + call $~lib/typedarray/Uint16Array#__set local.get $1 - i32.const 255 + i32.const 6 + i32.const 0 + call $~lib/typedarray/Uint16Array#reduce + local.set $2 + local.get $2 + i32.const 65535 i32.and i32.const 6 i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 279 + i32.const 24 + i32.const 263 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 (; 101 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $std/typedarray/testReduce<~lib/typedarray/Int32Array,i32>~anonymous|0 (; 98 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/pure/__retain + drop local.get $0 local.get $1 i32.add + local.set $4 + local.get $3 + call $~lib/rt/pure/__release + local.get $4 ) - (func $~lib/typedarray/Uint8ClampedArray#reduceRight (; 102 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/typedarray/Int32Array#reduce (; 99 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) local.get $0 - local.set $3 + call $~lib/rt/pure/__retain + local.set $5 local.get $1 local.set $4 local.get $2 - local.set $5 - local.get $3 - i32.load - local.set $6 - local.get $3 + local.set $3 + local.get $5 i32.load offset=4 - local.set $7 + local.set $6 block $break|0 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.5 (result i32) - local.get $3 - local.set $8 - local.get $8 - i32.load offset=8 + block i32.const 0 - i32.shr_u + local.set $7 + local.get $5 + call $~lib/typedarray/Int32Array#get:length + local.set $8 end - i32.const 1 - i32.sub - local.set $8 loop $repeat|0 + local.get $7 local.get $8 - i32.const 0 - i32.ge_s + i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 4 global.set $~lib/argc - local.get $5 - block $~lib/internal/arraybuffer/LOAD|inlined.4 (result i32) - local.get $6 - local.set $9 - local.get $8 - local.set $10 - local.get $7 - local.set $11 - local.get $9 - local.get $10 - i32.const 0 - i32.shl - i32.add - local.get $11 - i32.add - i32.load8_u offset=8 - end - local.get $8 local.get $3 + local.get $6 + local.get $7 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $7 + local.get $5 local.get $4 call_indirect (type $FUNCSIG$iiiii) end - local.set $5 - local.get $8 + local.set $3 + local.get $7 i32.const 1 - i32.sub - local.set $8 + i32.add + local.set $7 br $repeat|0 unreachable end unreachable end + local.get $3 + local.set $8 local.get $5 + call $~lib/rt/pure/__release + local.get $8 ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Uint8ClampedArray,u8> (; 103 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduce<~lib/typedarray/Int32Array,i32> (; 100 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) + (local $2 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Uint8ClampedArray#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Int32Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 i32.const 1 - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 + call $~lib/typedarray/Int32Array#__set + local.get $1 i32.const 1 i32.const 2 - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 + call $~lib/typedarray/Int32Array#__set + local.get $1 i32.const 2 i32.const 3 - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 - i32.const 15 - i32.const 0 - call $~lib/typedarray/Uint8ClampedArray#reduceRight - local.set $1 + call $~lib/typedarray/Int32Array#__set local.get $1 - i32.const 255 - i32.and + i32.const 7 + i32.const 0 + call $~lib/typedarray/Int32Array#reduce + local.set $2 + local.get $2 i32.const 6 i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 279 + i32.const 24 + i32.const 263 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + ) + (func $~lib/typedarray/Uint32Array#__set (; 101 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ge_u + if + i32.const 336 + i32.const 432 + i32.const 525 + i32.const 63 + call $~lib/builtins/abort unreachable end + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + local.get $2 + i32.store ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Int16Array,i16>~anonymous|0 (; 104 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $std/typedarray/testReduce<~lib/typedarray/Uint32Array,u32>~anonymous|0 (; 102 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/pure/__retain + drop local.get $0 local.get $1 i32.add + local.set $4 + local.get $3 + call $~lib/rt/pure/__release + local.get $4 ) - (func $~lib/typedarray/Int16Array#reduceRight (; 105 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/typedarray/Uint32Array#reduce (; 103 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) local.get $0 - local.set $3 + call $~lib/rt/pure/__retain + local.set $5 local.get $1 local.set $4 local.get $2 - local.set $5 - local.get $3 - i32.load - local.set $6 - local.get $3 + local.set $3 + local.get $5 i32.load offset=4 - local.set $7 + local.set $6 block $break|0 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.2 (result i32) - local.get $3 + block + i32.const 0 + local.set $7 + local.get $5 + call $~lib/typedarray/Uint32Array#get:length local.set $8 - local.get $8 - i32.load offset=8 - i32.const 1 - i32.shr_u end - i32.const 1 - i32.sub - local.set $8 loop $repeat|0 + local.get $7 local.get $8 - i32.const 0 - i32.ge_s + i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 4 global.set $~lib/argc - local.get $5 - block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i32) - local.get $6 - local.set $9 - local.get $8 - local.set $10 - local.get $7 - local.set $11 - local.get $9 - local.get $10 - i32.const 1 - i32.shl - i32.add - local.get $11 - i32.add - i32.load16_s offset=8 - end - local.get $8 local.get $3 + local.get $6 + local.get $7 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $7 + local.get $5 local.get $4 call_indirect (type $FUNCSIG$iiiii) end - local.set $5 - local.get $8 + local.set $3 + local.get $7 i32.const 1 - i32.sub - local.set $8 + i32.add + local.set $7 br $repeat|0 unreachable end unreachable end + local.get $3 + local.set $8 local.get $5 + call $~lib/rt/pure/__release + local.get $8 ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Int16Array,i16> (; 106 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduce<~lib/typedarray/Uint32Array,u32> (; 104 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) + (local $2 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Int16Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Uint32Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + call $~lib/typedarray/Uint32Array#__set + local.get $1 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + call $~lib/typedarray/Uint32Array#__set + local.get $1 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 16 - i32.const 0 - call $~lib/typedarray/Int16Array#reduceRight - local.set $1 + call $~lib/typedarray/Uint32Array#__set local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s + i32.const 8 + i32.const 0 + call $~lib/typedarray/Uint32Array#reduce + local.set $2 + local.get $2 i32.const 6 i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 279 + i32.const 24 + i32.const 263 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Uint16Array,u16>~anonymous|0 (; 107 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/typedarray/Int64Array#__set (; 105 ;) (type $FUNCSIG$viij) (param $0 i32) (param $1 i32) (param $2 i64) + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 3 + i32.shr_u + i32.ge_u + if + i32.const 336 + i32.const 432 + i32.const 607 + i32.const 63 + call $~lib/builtins/abort + unreachable + end local.get $0 + i32.load offset=4 local.get $1 + i32.const 3 + i32.shl i32.add + local.get $2 + i64.store ) - (func $~lib/typedarray/Uint16Array#reduceRight (; 108 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) + (func $std/typedarray/testReduce<~lib/typedarray/Int64Array,i64>~anonymous|0 (; 106 ;) (type $FUNCSIG$jjjii) (param $0 i64) (param $1 i64) (param $2 i32) (param $3 i32) (result i64) + (local $4 i64) + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + i64.add + local.set $4 + local.get $3 + call $~lib/rt/pure/__release + local.get $4 + ) + (func $~lib/typedarray/Int64Array#reduce (; 107 ;) (type $FUNCSIG$jiij) (param $0 i32) (param $1 i32) (param $2 i64) (result i64) + (local $3 i64) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) + (local $9 i64) local.get $0 - local.set $3 + call $~lib/rt/pure/__retain + local.set $5 local.get $1 local.set $4 local.get $2 - local.set $5 - local.get $3 - i32.load - local.set $6 - local.get $3 + local.set $3 + local.get $5 i32.load offset=4 - local.set $7 + local.set $6 block $break|0 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.2 (result i32) - local.get $3 + block + i32.const 0 + local.set $7 + local.get $5 + call $~lib/typedarray/Int64Array#get:length local.set $8 - local.get $8 - i32.load offset=8 - i32.const 1 - i32.shr_u end - i32.const 1 - i32.sub - local.set $8 loop $repeat|0 + local.get $7 local.get $8 - i32.const 0 - i32.ge_s + i32.lt_s i32.eqz br_if $break|0 - block (result i32) + block (result i64) i32.const 4 global.set $~lib/argc - local.get $5 - block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i32) - local.get $6 - local.set $9 - local.get $8 - local.set $10 - local.get $7 - local.set $11 - local.get $9 - local.get $10 - i32.const 1 - i32.shl - i32.add - local.get $11 - i32.add - i32.load16_u offset=8 - end - local.get $8 local.get $3 + local.get $6 + local.get $7 + i32.const 3 + i32.shl + i32.add + i64.load + local.get $7 + local.get $5 local.get $4 - call_indirect (type $FUNCSIG$iiiii) + call_indirect (type $FUNCSIG$jjjii) end - local.set $5 - local.get $8 + local.set $3 + local.get $7 i32.const 1 - i32.sub - local.set $8 + i32.add + local.set $7 br $repeat|0 unreachable end unreachable end + local.get $3 + local.set $9 local.get $5 + call $~lib/rt/pure/__release + local.get $9 ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Uint16Array,u16> (; 109 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduce<~lib/typedarray/Int64Array,i64> (; 108 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) + (local $2 i64) i32.const 0 i32.const 3 - call $~lib/typedarray/Uint16Array#constructor - local.set $0 - local.get $0 - i32.const 0 - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 2 - i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 17 - i32.const 0 - call $~lib/typedarray/Uint16Array#reduceRight + call $~lib/typedarray/Int64Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain local.set $1 local.get $1 - i32.const 65535 - i32.and - i32.const 6 - i32.eq + i32.const 0 + i64.const 1 + call $~lib/typedarray/Int64Array#__set + local.get $1 + i32.const 1 + i64.const 2 + call $~lib/typedarray/Int64Array#__set + local.get $1 + i32.const 2 + i64.const 3 + call $~lib/typedarray/Int64Array#__set + local.get $1 + i32.const 9 + i64.const 0 + call $~lib/typedarray/Int64Array#reduce + local.set $2 + local.get $2 + i64.const 6 + i64.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 279 + i32.const 24 + i32.const 263 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Int32Array,i32>~anonymous|0 (; 110 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/typedarray/Uint64Array#__set (; 109 ;) (type $FUNCSIG$viij) (param $0 i32) (param $1 i32) (param $2 i64) + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 3 + i32.shr_u + i32.ge_u + if + i32.const 336 + i32.const 432 + i32.const 689 + i32.const 63 + call $~lib/builtins/abort + unreachable + end local.get $0 + i32.load offset=4 local.get $1 + i32.const 3 + i32.shl i32.add + local.get $2 + i64.store ) - (func $~lib/typedarray/Int32Array#reduceRight (; 111 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) + (func $std/typedarray/testReduce<~lib/typedarray/Uint64Array,u64>~anonymous|0 (; 110 ;) (type $FUNCSIG$jjjii) (param $0 i64) (param $1 i64) (param $2 i32) (param $3 i32) (result i64) + (local $4 i64) + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + i64.add + local.set $4 + local.get $3 + call $~lib/rt/pure/__release + local.get $4 + ) + (func $~lib/typedarray/Uint64Array#reduce (; 111 ;) (type $FUNCSIG$jiij) (param $0 i32) (param $1 i32) (param $2 i64) (result i64) + (local $3 i64) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) + (local $9 i64) local.get $0 - local.set $3 + call $~lib/rt/pure/__retain + local.set $5 local.get $1 local.set $4 local.get $2 - local.set $5 - local.get $3 - i32.load - local.set $6 - local.get $3 + local.set $3 + local.get $5 i32.load offset=4 - local.set $7 + local.set $6 block $break|0 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.10 (result i32) - local.get $3 + block + i32.const 0 + local.set $7 + local.get $5 + call $~lib/typedarray/Uint64Array#get:length local.set $8 - local.get $8 - i32.load offset=8 - i32.const 2 - i32.shr_u end - i32.const 1 - i32.sub - local.set $8 loop $repeat|0 + local.get $7 local.get $8 - i32.const 0 - i32.ge_s + i32.lt_s i32.eqz br_if $break|0 - block (result i32) + block (result i64) i32.const 4 global.set $~lib/argc - local.get $5 - block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i32) - local.get $6 - local.set $9 - local.get $8 - local.set $10 - local.get $7 - local.set $11 - local.get $9 - local.get $10 - i32.const 2 - i32.shl - i32.add - local.get $11 - i32.add - i32.load offset=8 - end - local.get $8 local.get $3 + local.get $6 + local.get $7 + i32.const 3 + i32.shl + i32.add + i64.load + local.get $7 + local.get $5 local.get $4 - call_indirect (type $FUNCSIG$iiiii) + call_indirect (type $FUNCSIG$jjjii) end - local.set $5 - local.get $8 + local.set $3 + local.get $7 i32.const 1 - i32.sub - local.set $8 + i32.add + local.set $7 br $repeat|0 unreachable end unreachable end + local.get $3 + local.set $9 local.get $5 + call $~lib/rt/pure/__release + local.get $9 ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Int32Array,i32> (; 112 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduce<~lib/typedarray/Uint64Array,u64> (; 112 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) + (local $2 i64) i32.const 0 i32.const 3 - call $~lib/typedarray/Int32Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Uint64Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 + i64.const 1 + call $~lib/typedarray/Uint64Array#__set + local.get $1 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + i64.const 2 + call $~lib/typedarray/Uint64Array#__set + local.get $1 i32.const 2 - i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 18 - i32.const 0 - call $~lib/typedarray/Int32Array#reduceRight - local.set $1 + i64.const 3 + call $~lib/typedarray/Uint64Array#__set local.get $1 - i32.const 6 - i32.eq + i32.const 10 + i64.const 0 + call $~lib/typedarray/Uint64Array#reduce + local.set $2 + local.get $2 + i64.const 6 + i64.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 279 + i32.const 24 + i32.const 263 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Uint32Array,u32>~anonymous|0 (; 113 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/typedarray/Float32Array#__set (; 113 ;) (type $FUNCSIG$viif) (param $0 i32) (param $1 i32) (param $2 f32) + local.get $1 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ge_u + if + i32.const 336 + i32.const 432 + i32.const 771 + i32.const 63 + call $~lib/builtins/abort + unreachable + end local.get $0 + i32.load offset=4 local.get $1 + i32.const 2 + i32.shl i32.add + local.get $2 + f32.store ) - (func $~lib/typedarray/Uint32Array#reduceRight (; 114 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) + (func $std/typedarray/testReduce<~lib/typedarray/Float32Array,f32>~anonymous|0 (; 114 ;) (type $FUNCSIG$fffii) (param $0 f32) (param $1 f32) (param $2 i32) (param $3 i32) (result f32) + (local $4 f32) + local.get $3 + call $~lib/rt/pure/__retain + drop + local.get $0 + local.get $1 + f32.add + local.set $4 + local.get $3 + call $~lib/rt/pure/__release + local.get $4 + ) + (func $~lib/typedarray/Float32Array#reduce (; 115 ;) (type $FUNCSIG$fiif) (param $0 i32) (param $1 i32) (param $2 f32) (result f32) + (local $3 f32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) + (local $9 f32) local.get $0 - local.set $3 + call $~lib/rt/pure/__retain + local.set $5 local.get $1 local.set $4 local.get $2 - local.set $5 - local.get $3 - i32.load - local.set $6 - local.get $3 + local.set $3 + local.get $5 i32.load offset=4 - local.set $7 + local.set $6 block $break|0 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.2 (result i32) - local.get $3 + block + i32.const 0 + local.set $7 + local.get $5 + call $~lib/typedarray/Float32Array#get:length local.set $8 - local.get $8 - i32.load offset=8 - i32.const 2 - i32.shr_u end - i32.const 1 - i32.sub - local.set $8 loop $repeat|0 + local.get $7 local.get $8 - i32.const 0 - i32.ge_s + i32.lt_s i32.eqz br_if $break|0 - block (result i32) + block (result f32) i32.const 4 global.set $~lib/argc - local.get $5 - block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i32) - local.get $6 - local.set $9 - local.get $8 - local.set $10 - local.get $7 - local.set $11 - local.get $9 - local.get $10 - i32.const 2 - i32.shl - i32.add - local.get $11 - i32.add - i32.load offset=8 - end - local.get $8 local.get $3 + local.get $6 + local.get $7 + i32.const 2 + i32.shl + i32.add + f32.load + local.get $7 + local.get $5 local.get $4 - call_indirect (type $FUNCSIG$iiiii) + call_indirect (type $FUNCSIG$fffii) end - local.set $5 - local.get $8 + local.set $3 + local.get $7 i32.const 1 - i32.sub - local.set $8 + i32.add + local.set $7 br $repeat|0 unreachable end unreachable end + local.get $3 + local.set $9 local.get $5 + call $~lib/rt/pure/__release + local.get $9 ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Uint32Array,u32> (; 115 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduce<~lib/typedarray/Float32Array,f32> (; 116 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) + (local $2 f32) i32.const 0 i32.const 3 - call $~lib/typedarray/Uint32Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Float32Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 + f32.const 1 + call $~lib/typedarray/Float32Array#__set + local.get $1 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + f32.const 2 + call $~lib/typedarray/Float32Array#__set + local.get $1 i32.const 2 - i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 19 - i32.const 0 - call $~lib/typedarray/Uint32Array#reduceRight - local.set $1 + f32.const 3 + call $~lib/typedarray/Float32Array#__set local.get $1 - i32.const 6 - i32.eq + i32.const 11 + f32.const 0 + call $~lib/typedarray/Float32Array#reduce + local.set $2 + local.get $2 + f32.const 6 + f32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 279 + i32.const 24 + i32.const 263 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Int64Array,i64>~anonymous|0 (; 116 ;) (type $FUNCSIG$jjjii) (param $0 i64) (param $1 i64) (param $2 i32) (param $3 i32) (result i64) + (func $std/typedarray/testReduce<~lib/typedarray/Float64Array,f64>~anonymous|0 (; 117 ;) (type $FUNCSIG$dddii) (param $0 f64) (param $1 f64) (param $2 i32) (param $3 i32) (result f64) + (local $4 f64) + local.get $3 + call $~lib/rt/pure/__retain + drop local.get $0 local.get $1 - i64.add + f64.add + local.set $4 + local.get $3 + call $~lib/rt/pure/__release + local.get $4 ) - (func $~lib/typedarray/Int64Array#reduceRight (; 117 ;) (type $FUNCSIG$jiij) (param $0 i32) (param $1 i32) (param $2 i64) (result i64) - (local $3 i32) + (func $~lib/typedarray/Float64Array#reduce (; 118 ;) (type $FUNCSIG$diid) (param $0 i32) (param $1 i32) (param $2 f64) (result f64) + (local $3 f64) (local $4 i32) - (local $5 i64) + (local $5 i32) (local $6 i32) (local $7 i32) (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) + (local $9 f64) local.get $0 - local.set $3 + call $~lib/rt/pure/__retain + local.set $5 local.get $1 local.set $4 local.get $2 - local.set $5 - local.get $3 - i32.load - local.set $6 - local.get $3 + local.set $3 + local.get $5 i32.load offset=4 - local.set $7 + local.set $6 block $break|0 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.2 (result i32) - local.get $3 + block + i32.const 0 + local.set $7 + local.get $5 + call $~lib/typedarray/Float64Array#get:length local.set $8 - local.get $8 - i32.load offset=8 - i32.const 3 - i32.shr_u end - i32.const 1 - i32.sub - local.set $8 loop $repeat|0 + local.get $7 local.get $8 - i32.const 0 - i32.ge_s + i32.lt_s i32.eqz br_if $break|0 - block (result i64) + block (result f64) i32.const 4 global.set $~lib/argc - local.get $5 - block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i64) - local.get $6 - local.set $9 - local.get $8 - local.set $10 - local.get $7 - local.set $11 - local.get $9 - local.get $10 - i32.const 3 - i32.shl - i32.add - local.get $11 - i32.add - i64.load offset=8 - end - local.get $8 local.get $3 + local.get $6 + local.get $7 + i32.const 3 + i32.shl + i32.add + f64.load + local.get $7 + local.get $5 local.get $4 - call_indirect (type $FUNCSIG$jjjii) + call_indirect (type $FUNCSIG$dddii) end - local.set $5 - local.get $8 + local.set $3 + local.get $7 i32.const 1 - i32.sub - local.set $8 + i32.add + local.set $7 br $repeat|0 unreachable end unreachable end + local.get $3 + local.set $9 local.get $5 + call $~lib/rt/pure/__release + local.get $9 ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Int64Array,i64> (; 118 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduce<~lib/typedarray/Float64Array,f64> (; 119 ;) (type $FUNCSIG$v) (local $0 i32) - (local $1 i64) + (local $1 i32) + (local $2 f64) i32.const 0 i32.const 3 - call $~lib/typedarray/Int64Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Float64Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - i64.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + f64.const 1 + call $~lib/typedarray/Float64Array#__set + local.get $1 i32.const 1 - i64.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + f64.const 2 + call $~lib/typedarray/Float64Array#__set + local.get $1 i32.const 2 - i64.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 20 - i64.const 0 - call $~lib/typedarray/Int64Array#reduceRight - local.set $1 + f64.const 3 + call $~lib/typedarray/Float64Array#__set local.get $1 - i64.const 6 - i64.eq + i32.const 12 + f64.const 0 + call $~lib/typedarray/Float64Array#reduce + local.set $2 + local.get $2 + f64.const 6 + f64.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 279 + i32.const 24 + i32.const 263 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Uint64Array,u64>~anonymous|0 (; 119 ;) (type $FUNCSIG$jjjii) (param $0 i64) (param $1 i64) (param $2 i32) (param $3 i32) (result i64) + (func $std/typedarray/testReduceRight<~lib/typedarray/Int8Array,i8>~anonymous|0 (; 120 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/pure/__retain + drop local.get $0 local.get $1 - i64.add + i32.add + local.set $4 + local.get $3 + call $~lib/rt/pure/__release + local.get $4 ) - (func $~lib/typedarray/Uint64Array#reduceRight (; 120 ;) (type $FUNCSIG$jiij) (param $0 i32) (param $1 i32) (param $2 i64) (result i64) + (func $~lib/typedarray/Int8Array#reduceRight (; 121 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - (local $5 i64) + (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) local.get $0 - local.set $3 + call $~lib/rt/pure/__retain + local.set $5 local.get $1 local.set $4 local.get $2 - local.set $5 - local.get $3 - i32.load - local.set $6 - local.get $3 + local.set $3 + local.get $5 i32.load offset=4 - local.set $7 + local.set $6 block $break|0 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.2 (result i32) - local.get $3 - local.set $8 - local.get $8 - i32.load offset=8 - i32.const 3 - i32.shr_u - end + local.get $5 + call $~lib/typedarray/Int8Array#get:length i32.const 1 i32.sub - local.set $8 + local.set $7 loop $repeat|0 - local.get $8 + local.get $7 i32.const 0 i32.ge_s i32.eqz br_if $break|0 - block (result i64) + block (result i32) i32.const 4 global.set $~lib/argc - local.get $5 - block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i64) - local.get $6 - local.set $9 - local.get $8 - local.set $10 - local.get $7 - local.set $11 - local.get $9 - local.get $10 - i32.const 3 - i32.shl - i32.add - local.get $11 - i32.add - i64.load offset=8 - end - local.get $8 local.get $3 + local.get $6 + local.get $7 + i32.const 0 + i32.shl + i32.add + i32.load8_s + local.get $7 + local.get $5 local.get $4 - call_indirect (type $FUNCSIG$jjjii) + call_indirect (type $FUNCSIG$iiiii) end - local.set $5 - local.get $8 + local.set $3 + local.get $7 i32.const 1 i32.sub - local.set $8 + local.set $7 br $repeat|0 unreachable end unreachable end + local.get $3 + local.set $7 local.get $5 + call $~lib/rt/pure/__release + local.get $7 ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Uint64Array,u64> (; 121 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduceRight<~lib/typedarray/Int8Array,i8> (; 122 ;) (type $FUNCSIG$v) (local $0 i32) - (local $1 i64) + (local $1 i32) + (local $2 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Uint64Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Int8Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - i64.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 i32.const 1 - i64.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + call $~lib/typedarray/Int8Array#__set + local.get $1 + i32.const 1 i32.const 2 - i64.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 21 - i64.const 0 - call $~lib/typedarray/Uint64Array#reduceRight - local.set $1 + call $~lib/typedarray/Int8Array#__set local.get $1 - i64.const 6 - i64.eq + i32.const 2 + i32.const 3 + call $~lib/typedarray/Int8Array#__set + local.get $1 + i32.const 13 + i32.const 0 + call $~lib/typedarray/Int8Array#reduceRight + local.set $2 + local.get $2 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.const 6 + i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 279 + i32.const 24 + i32.const 290 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Float32Array,f32>~anonymous|0 (; 122 ;) (type $FUNCSIG$fffii) (param $0 f32) (param $1 f32) (param $2 i32) (param $3 i32) (result f32) + (func $std/typedarray/testReduceRight<~lib/typedarray/Uint8Array,u8>~anonymous|0 (; 123 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/pure/__retain + drop local.get $0 local.get $1 - f32.add + i32.add + local.set $4 + local.get $3 + call $~lib/rt/pure/__release + local.get $4 ) - (func $~lib/typedarray/Float32Array#reduceRight (; 123 ;) (type $FUNCSIG$fiif) (param $0 i32) (param $1 i32) (param $2 f32) (result f32) + (func $~lib/typedarray/Uint8Array#reduceRight (; 124 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - (local $5 f32) + (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) local.get $0 - local.set $3 + call $~lib/rt/pure/__retain + local.set $5 local.get $1 local.set $4 local.get $2 - local.set $5 - local.get $3 - i32.load - local.set $6 - local.get $3 + local.set $3 + local.get $5 i32.load offset=4 - local.set $7 + local.set $6 block $break|0 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.2 (result i32) - local.get $3 - local.set $8 - local.get $8 - i32.load offset=8 - i32.const 2 - i32.shr_u - end + local.get $5 + call $~lib/typedarray/Uint8Array#get:length i32.const 1 i32.sub - local.set $8 + local.set $7 loop $repeat|0 - local.get $8 + local.get $7 i32.const 0 i32.ge_s i32.eqz br_if $break|0 - block (result f32) + block (result i32) i32.const 4 global.set $~lib/argc - local.get $5 - block $~lib/internal/arraybuffer/LOAD|inlined.1 (result f32) - local.get $6 - local.set $9 - local.get $8 - local.set $10 - local.get $7 - local.set $11 - local.get $9 - local.get $10 - i32.const 2 - i32.shl - i32.add - local.get $11 - i32.add - f32.load offset=8 - end - local.get $8 local.get $3 + local.get $6 + local.get $7 + i32.const 0 + i32.shl + i32.add + i32.load8_u + local.get $7 + local.get $5 local.get $4 - call_indirect (type $FUNCSIG$fffii) + call_indirect (type $FUNCSIG$iiiii) end - local.set $5 - local.get $8 + local.set $3 + local.get $7 i32.const 1 i32.sub - local.set $8 + local.set $7 br $repeat|0 unreachable end unreachable end + local.get $3 + local.set $7 local.get $5 + call $~lib/rt/pure/__release + local.get $7 ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Float32Array,f32> (; 124 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduceRight<~lib/typedarray/Uint8Array,u8> (; 125 ;) (type $FUNCSIG$v) (local $0 i32) - (local $1 f32) + (local $1 i32) + (local $2 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Float32Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Uint8Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - f32.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 i32.const 1 - f32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + call $~lib/typedarray/Uint8Array#__set + local.get $1 + i32.const 1 i32.const 2 - f32.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 22 - f32.const 0 - call $~lib/typedarray/Float32Array#reduceRight - local.set $1 + call $~lib/typedarray/Uint8Array#__set local.get $1 - f32.const 6 - f32.eq + i32.const 2 + i32.const 3 + call $~lib/typedarray/Uint8Array#__set + local.get $1 + i32.const 14 + i32.const 0 + call $~lib/typedarray/Uint8Array#reduceRight + local.set $2 + local.get $2 + i32.const 255 + i32.and + i32.const 6 + i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 279 + i32.const 24 + i32.const 290 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Float64Array,f64>~anonymous|0 (; 125 ;) (type $FUNCSIG$dddii) (param $0 f64) (param $1 f64) (param $2 i32) (param $3 i32) (result f64) + (func $std/typedarray/testReduceRight<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 (; 126 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/pure/__retain + drop local.get $0 local.get $1 - f64.add + i32.add + local.set $4 + local.get $3 + call $~lib/rt/pure/__release + local.get $4 ) - (func $~lib/typedarray/Float64Array#reduceRight (; 126 ;) (type $FUNCSIG$diid) (param $0 i32) (param $1 i32) (param $2 f64) (result f64) + (func $~lib/typedarray/Uint8ClampedArray#reduceRight (; 127 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - (local $5 f64) + (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) local.get $0 - local.set $3 + call $~lib/rt/pure/__retain + local.set $5 local.get $1 local.set $4 local.get $2 - local.set $5 - local.get $3 - i32.load - local.set $6 - local.get $3 + local.set $3 + local.get $5 i32.load offset=4 - local.set $7 + local.set $6 block $break|0 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.5 (result i32) - local.get $3 - local.set $8 - local.get $8 - i32.load offset=8 - i32.const 3 - i32.shr_u - end + local.get $5 + call $~lib/typedarray/Uint8ClampedArray#get:length i32.const 1 i32.sub - local.set $8 + local.set $7 loop $repeat|0 - local.get $8 + local.get $7 i32.const 0 i32.ge_s i32.eqz br_if $break|0 - block (result f64) + block (result i32) i32.const 4 global.set $~lib/argc - local.get $5 - block $~lib/internal/arraybuffer/LOAD|inlined.14 (result f64) - local.get $6 - local.set $9 - local.get $8 - local.set $10 - local.get $7 - local.set $11 - local.get $9 - local.get $10 - i32.const 3 - i32.shl - i32.add - local.get $11 - i32.add - f64.load offset=8 - end - local.get $8 local.get $3 + local.get $6 + local.get $7 + i32.const 0 + i32.shl + i32.add + i32.load8_u + local.get $7 + local.get $5 local.get $4 - call_indirect (type $FUNCSIG$dddii) + call_indirect (type $FUNCSIG$iiiii) end - local.set $5 - local.get $8 + local.set $3 + local.get $7 i32.const 1 i32.sub - local.set $8 + local.set $7 br $repeat|0 unreachable end unreachable end + local.get $3 + local.set $7 local.get $5 + call $~lib/rt/pure/__release + local.get $7 ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Float64Array,f64> (; 127 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduceRight<~lib/typedarray/Uint8ClampedArray,u8> (; 128 ;) (type $FUNCSIG$v) (local $0 i32) - (local $1 f64) + (local $1 i32) + (local $2 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Float64Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Uint8ClampedArray#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - f64.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 i32.const 1 - f64.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $1 + i32.const 1 i32.const 2 - f64.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 23 - f64.const 0 - call $~lib/typedarray/Float64Array#reduceRight - local.set $1 + call $~lib/typedarray/Uint8ClampedArray#__set local.get $1 - f64.const 6 - f64.eq + i32.const 2 + i32.const 3 + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $1 + i32.const 15 + i32.const 0 + call $~lib/typedarray/Uint8ClampedArray#reduceRight + local.set $2 + local.get $2 + i32.const 255 + i32.and + i32.const 6 + i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 279 + i32.const 24 + i32.const 290 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 (; 128 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + ) + (func $std/typedarray/testReduceRight<~lib/typedarray/Int16Array,i16>~anonymous|0 (; 129 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.mul + local.get $1 + i32.add + local.set $4 + local.get $3 + call $~lib/rt/pure/__release + local.get $4 ) - (func $~lib/typedarray/Int8Array#map (; 129 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) + (func $~lib/typedarray/Int16Array#reduceRight (; 130 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) local.get $0 - local.set $2 + call $~lib/rt/pure/__retain + local.set $5 local.get $1 - local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.12 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 0 - i32.shr_u - end local.set $4 local.get $2 - i32.load - local.set $5 - local.get $2 + local.set $3 + local.get $5 i32.load offset=4 local.set $6 - i32.const 0 - local.get $4 - call $~lib/typedarray/Int8Array#constructor - local.set $7 - local.get $7 - i32.load - local.set $8 block $break|0 - i32.const 0 - local.set $9 + local.get $5 + call $~lib/typedarray/Int16Array#get:length + i32.const 1 + i32.sub + local.set $7 loop $repeat|0 - local.get $9 - local.get $4 - i32.lt_s + local.get $7 + i32.const 0 + i32.ge_s i32.eqz br_if $break|0 - block $~lib/internal/arraybuffer/STORE|inlined.1 - local.get $8 - local.set $10 - local.get $9 - local.set $11 - block (result i32) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.4 (result i32) - local.get $5 - local.set $12 - local.get $9 - local.set $13 - local.get $6 - local.set $14 - local.get $12 - local.get $13 - i32.const 0 - i32.shl - i32.add - local.get $14 - i32.add - i32.load8_s offset=8 - end - local.get $9 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$iiii) - end - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - local.set $14 - i32.const 0 - local.set $13 - local.get $10 - local.get $11 - i32.const 0 + block (result i32) + i32.const 4 + global.set $~lib/argc + local.get $3 + local.get $6 + local.get $7 + i32.const 1 i32.shl i32.add - local.get $13 - i32.add - local.get $14 - i32.store8 offset=8 + i32.load16_s + local.get $7 + local.get $5 + local.get $4 + call_indirect (type $FUNCSIG$iiiii) end - local.get $9 + local.set $3 + local.get $7 i32.const 1 - i32.add - local.set $9 + i32.sub + local.set $7 br $repeat|0 unreachable end unreachable end + local.get $3 + local.set $7 + local.get $5 + call $~lib/rt/pure/__release local.get $7 ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8> (; 130 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduceRight<~lib/typedarray/Int16Array,i16> (; 131 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) + (local $2 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Int8Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Int16Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + call $~lib/typedarray/Int16Array#__set + local.get $1 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + call $~lib/typedarray/Int16Array#__set + local.get $1 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 24 - call $~lib/typedarray/Int8Array#map - local.set $1 + call $~lib/typedarray/Int16Array#__set local.get $1 + i32.const 16 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 306 - i32.const 2 - call $~lib/env/abort - unreachable - end - local.get $1 - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 24 + call $~lib/typedarray/Int16Array#reduceRight + local.set $2 + local.get $2 + i32.const 16 i32.shl - i32.const 24 + i32.const 16 i32.shr_s - i32.const 4 + i32.const 6 i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 307 + i32.const 24 + i32.const 290 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release local.get $1 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.const 9 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 308 - i32.const 2 - call $~lib/env/abort - unreachable - end + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Uint8Array,u8>~anonymous|0 (; 131 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $0 + (func $std/typedarray/testReduceRight<~lib/typedarray/Uint16Array,u16>~anonymous|0 (; 132 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.mul + local.get $1 + i32.add + local.set $4 + local.get $3 + call $~lib/rt/pure/__release + local.get $4 ) - (func $~lib/typedarray/Uint8Array#map (; 132 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) + (func $~lib/typedarray/Uint16Array#reduceRight (; 133 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) local.get $0 - local.set $2 + call $~lib/rt/pure/__retain + local.set $5 local.get $1 - local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.6 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 0 - i32.shr_u - end local.set $4 local.get $2 - i32.load - local.set $5 - local.get $2 + local.set $3 + local.get $5 i32.load offset=4 local.set $6 - i32.const 0 - local.get $4 - call $~lib/typedarray/Uint8Array#constructor - local.set $7 - local.get $7 - i32.load - local.set $8 block $break|0 - i32.const 0 - local.set $9 + local.get $5 + call $~lib/typedarray/Uint16Array#get:length + i32.const 1 + i32.sub + local.set $7 loop $repeat|0 - local.get $9 - local.get $4 - i32.lt_s + local.get $7 + i32.const 0 + i32.ge_s i32.eqz br_if $break|0 - block $~lib/internal/arraybuffer/STORE|inlined.1 - local.get $8 - local.set $10 - local.get $9 - local.set $11 - block (result i32) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.5 (result i32) - local.get $5 - local.set $12 - local.get $9 - local.set $13 - local.get $6 - local.set $14 - local.get $12 - local.get $13 - i32.const 0 - i32.shl - i32.add - local.get $14 - i32.add - i32.load8_u offset=8 - end - local.get $9 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$iiii) - end - i32.const 255 - i32.and - local.set $14 - i32.const 0 - local.set $13 - local.get $10 - local.get $11 - i32.const 0 + block (result i32) + i32.const 4 + global.set $~lib/argc + local.get $3 + local.get $6 + local.get $7 + i32.const 1 i32.shl i32.add - local.get $13 - i32.add - local.get $14 - i32.store8 offset=8 + i32.load16_u + local.get $7 + local.get $5 + local.get $4 + call_indirect (type $FUNCSIG$iiiii) end - local.get $9 + local.set $3 + local.get $7 i32.const 1 - i32.add - local.set $9 + i32.sub + local.set $7 br $repeat|0 unreachable end unreachable end + local.get $3 + local.set $7 + local.get $5 + call $~lib/rt/pure/__release local.get $7 ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Uint8Array,u8> (; 133 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduceRight<~lib/typedarray/Uint16Array,u16> (; 134 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) + (local $2 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Uint8Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Uint16Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + call $~lib/typedarray/Uint16Array#__set + local.get $1 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + call $~lib/typedarray/Uint16Array#__set + local.get $1 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 25 - call $~lib/typedarray/Uint8Array#map - local.set $1 + call $~lib/typedarray/Uint16Array#__set local.get $1 + i32.const 17 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 306 - i32.const 2 - call $~lib/env/abort - unreachable - end - local.get $1 - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 + call $~lib/typedarray/Uint16Array#reduceRight + local.set $2 + local.get $2 + i32.const 65535 i32.and - i32.const 4 + i32.const 6 i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 307 + i32.const 24 + i32.const 290 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release local.get $1 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and - i32.const 9 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 308 - i32.const 2 - call $~lib/env/abort - unreachable - end + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 (; 134 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $0 + (func $std/typedarray/testReduceRight<~lib/typedarray/Int32Array,i32>~anonymous|0 (; 135 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.mul + local.get $1 + i32.add + local.set $4 + local.get $3 + call $~lib/rt/pure/__release + local.get $4 ) - (func $~lib/typedarray/Uint8ClampedArray#map (; 135 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) + (func $~lib/typedarray/Int32Array#reduceRight (; 136 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) local.get $0 - local.set $2 - local.get $1 - local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.7 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 0 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load + call $~lib/rt/pure/__retain local.set $5 + local.get $1 + local.set $4 local.get $2 + local.set $3 + local.get $5 i32.load offset=4 local.set $6 - i32.const 0 - local.get $4 - call $~lib/typedarray/Uint8ClampedArray#constructor - local.set $7 - local.get $7 - i32.load - local.set $8 block $break|0 - i32.const 0 - local.set $9 + local.get $5 + call $~lib/typedarray/Int32Array#get:length + i32.const 1 + i32.sub + local.set $7 loop $repeat|0 - local.get $9 - local.get $4 - i32.lt_s + local.get $7 + i32.const 0 + i32.ge_s i32.eqz br_if $break|0 - block $~lib/internal/arraybuffer/STORE|inlined.2 - local.get $8 - local.set $10 - local.get $9 - local.set $11 - block (result i32) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.6 (result i32) - local.get $5 - local.set $12 - local.get $9 - local.set $13 - local.get $6 - local.set $14 - local.get $12 - local.get $13 - i32.const 0 - i32.shl - i32.add - local.get $14 - i32.add - i32.load8_u offset=8 - end - local.get $9 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$iiii) - end - i32.const 255 - i32.and - local.set $14 - i32.const 0 - local.set $13 - local.get $10 - local.get $11 - i32.const 0 + block (result i32) + i32.const 4 + global.set $~lib/argc + local.get $3 + local.get $6 + local.get $7 + i32.const 2 i32.shl i32.add - local.get $13 - i32.add - local.get $14 - i32.store8 offset=8 + i32.load + local.get $7 + local.get $5 + local.get $4 + call_indirect (type $FUNCSIG$iiiii) end - local.get $9 + local.set $3 + local.get $7 i32.const 1 - i32.add - local.set $9 + i32.sub + local.set $7 br $repeat|0 unreachable end unreachable end + local.get $3 + local.set $7 + local.get $5 + call $~lib/rt/pure/__release local.get $7 ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Uint8ClampedArray,u8> (; 136 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduceRight<~lib/typedarray/Int32Array,i32> (; 137 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) + (local $2 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Uint8ClampedArray#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Int32Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 i32.const 1 - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 + call $~lib/typedarray/Int32Array#__set + local.get $1 i32.const 1 i32.const 2 - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 + call $~lib/typedarray/Int32Array#__set + local.get $1 i32.const 2 i32.const 3 - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 - i32.const 26 - call $~lib/typedarray/Uint8ClampedArray#map - local.set $1 + call $~lib/typedarray/Int32Array#__set local.get $1 + i32.const 18 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 306 - i32.const 2 - call $~lib/env/abort - unreachable - end - local.get $1 - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and - i32.const 4 + call $~lib/typedarray/Int32Array#reduceRight + local.set $2 + local.get $2 + i32.const 6 i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 307 + i32.const 24 + i32.const 290 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release local.get $1 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and - i32.const 9 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 308 - i32.const 2 - call $~lib/env/abort - unreachable - end + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Int16Array,i16>~anonymous|0 (; 137 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $0 + (func $std/typedarray/testReduceRight<~lib/typedarray/Uint32Array,u32>~anonymous|0 (; 138 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (local $4 i32) + local.get $3 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.mul + local.get $1 + i32.add + local.set $4 + local.get $3 + call $~lib/rt/pure/__release + local.get $4 ) - (func $~lib/typedarray/Int16Array#map (; 138 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) + (func $~lib/typedarray/Uint32Array#reduceRight (; 139 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) local.get $0 - local.set $2 + call $~lib/rt/pure/__retain + local.set $5 local.get $1 - local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.3 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 1 - i32.shr_u - end local.set $4 local.get $2 - i32.load - local.set $5 - local.get $2 + local.set $3 + local.get $5 i32.load offset=4 local.set $6 - i32.const 0 - local.get $4 - call $~lib/typedarray/Int16Array#constructor - local.set $7 - local.get $7 - i32.load - local.set $8 block $break|0 - i32.const 0 - local.set $9 + local.get $5 + call $~lib/typedarray/Uint32Array#get:length + i32.const 1 + i32.sub + local.set $7 loop $repeat|0 - local.get $9 - local.get $4 - i32.lt_s + local.get $7 + i32.const 0 + i32.ge_s i32.eqz br_if $break|0 - block $~lib/internal/arraybuffer/STORE|inlined.1 - local.get $8 - local.set $10 - local.get $9 - local.set $11 - block (result i32) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i32) - local.get $5 - local.set $12 - local.get $9 - local.set $13 - local.get $6 - local.set $14 - local.get $12 - local.get $13 - i32.const 1 - i32.shl - i32.add - local.get $14 - i32.add - i32.load16_s offset=8 - end - local.get $9 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$iiii) - end - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - local.set $14 - i32.const 0 - local.set $13 - local.get $10 - local.get $11 - i32.const 1 + block (result i32) + i32.const 4 + global.set $~lib/argc + local.get $3 + local.get $6 + local.get $7 + i32.const 2 i32.shl i32.add - local.get $13 - i32.add - local.get $14 - i32.store16 offset=8 + i32.load + local.get $7 + local.get $5 + local.get $4 + call_indirect (type $FUNCSIG$iiiii) end - local.get $9 + local.set $3 + local.get $7 i32.const 1 - i32.add - local.set $9 + i32.sub + local.set $7 br $repeat|0 unreachable - end - unreachable - end - local.get $7 - ) - (func $~lib/internal/typedarray/TypedArray#__get (; 139 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - local.get $1 - local.get $0 - i32.load offset=8 - i32.const 1 - i32.shr_u - i32.ge_u - if - i32.const 0 - i32.const 48 - i32.const 39 - i32.const 63 - call $~lib/env/abort - unreachable - end - block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i32) - local.get $0 - i32.load - local.set $2 - local.get $1 - local.set $3 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $2 - local.get $3 - i32.const 1 - i32.shl - i32.add - local.get $4 - i32.add - i32.load16_s offset=8 + end + unreachable end + local.get $3 + local.set $7 + local.get $5 + call $~lib/rt/pure/__release + local.get $7 ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Int16Array,i16> (; 140 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduceRight<~lib/typedarray/Uint32Array,u32> (; 140 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) + (local $2 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Int16Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Uint32Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + call $~lib/typedarray/Uint32Array#__set + local.get $1 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + call $~lib/typedarray/Uint32Array#__set + local.get $1 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 27 - call $~lib/typedarray/Int16Array#map - local.set $1 + call $~lib/typedarray/Uint32Array#__set local.get $1 + i32.const 19 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 306 - i32.const 2 - call $~lib/env/abort - unreachable - end - local.get $1 - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - i32.const 4 + call $~lib/typedarray/Uint32Array#reduceRight + local.set $2 + local.get $2 + i32.const 6 i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 307 + i32.const 24 + i32.const 290 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release local.get $1 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - i32.const 9 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 308 - i32.const 2 - call $~lib/env/abort - unreachable - end + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Uint16Array,u16>~anonymous|0 (; 141 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $0 + (func $std/typedarray/testReduceRight<~lib/typedarray/Int64Array,i64>~anonymous|0 (; 141 ;) (type $FUNCSIG$jjjii) (param $0 i64) (param $1 i64) (param $2 i32) (param $3 i32) (result i64) + (local $4 i64) + local.get $3 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.mul + local.get $1 + i64.add + local.set $4 + local.get $3 + call $~lib/rt/pure/__release + local.get $4 ) - (func $~lib/typedarray/Uint16Array#map (; 142 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) + (func $~lib/typedarray/Int64Array#reduceRight (; 142 ;) (type $FUNCSIG$jiij) (param $0 i32) (param $1 i32) (param $2 i64) (result i64) + (local $3 i64) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) + (local $8 i64) local.get $0 - local.set $2 + call $~lib/rt/pure/__retain + local.set $5 local.get $1 - local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.3 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 1 - i32.shr_u - end local.set $4 local.get $2 - i32.load - local.set $5 - local.get $2 + local.set $3 + local.get $5 i32.load offset=4 local.set $6 - i32.const 0 - local.get $4 - call $~lib/typedarray/Uint16Array#constructor - local.set $7 - local.get $7 - i32.load - local.set $8 block $break|0 - i32.const 0 - local.set $9 + local.get $5 + call $~lib/typedarray/Int64Array#get:length + i32.const 1 + i32.sub + local.set $7 loop $repeat|0 - local.get $9 - local.get $4 - i32.lt_s + local.get $7 + i32.const 0 + i32.ge_s i32.eqz br_if $break|0 - block $~lib/internal/arraybuffer/STORE|inlined.1 - local.get $8 - local.set $10 - local.get $9 - local.set $11 - block (result i32) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i32) - local.get $5 - local.set $12 - local.get $9 - local.set $13 - local.get $6 - local.set $14 - local.get $12 - local.get $13 - i32.const 1 - i32.shl - i32.add - local.get $14 - i32.add - i32.load16_u offset=8 - end - local.get $9 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$iiii) - end - i32.const 65535 - i32.and - local.set $14 - i32.const 0 - local.set $13 - local.get $10 - local.get $11 - i32.const 1 + block (result i64) + i32.const 4 + global.set $~lib/argc + local.get $3 + local.get $6 + local.get $7 + i32.const 3 i32.shl i32.add - local.get $13 - i32.add - local.get $14 - i32.store16 offset=8 + i64.load + local.get $7 + local.get $5 + local.get $4 + call_indirect (type $FUNCSIG$jjjii) end - local.get $9 + local.set $3 + local.get $7 i32.const 1 - i32.add - local.set $9 + i32.sub + local.set $7 br $repeat|0 unreachable end unreachable end - local.get $7 - ) - (func $~lib/internal/typedarray/TypedArray#__get (; 143 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - local.get $1 - local.get $0 - i32.load offset=8 - i32.const 1 - i32.shr_u - i32.ge_u - if - i32.const 0 - i32.const 48 - i32.const 39 - i32.const 63 - call $~lib/env/abort - unreachable - end - block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i32) - local.get $0 - i32.load - local.set $2 - local.get $1 - local.set $3 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $2 - local.get $3 - i32.const 1 - i32.shl - i32.add - local.get $4 - i32.add - i32.load16_u offset=8 - end + local.get $3 + local.set $8 + local.get $5 + call $~lib/rt/pure/__release + local.get $8 ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Uint16Array,u16> (; 144 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduceRight<~lib/typedarray/Int64Array,i64> (; 143 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) + (local $2 i64) i32.const 0 i32.const 3 - call $~lib/typedarray/Uint16Array#constructor - local.set $0 - local.get $0 - i32.const 0 - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 2 - i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 28 - call $~lib/typedarray/Uint16Array#map + call $~lib/typedarray/Int64Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain local.set $1 local.get $1 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 65535 - i32.and - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 306 - i32.const 2 - call $~lib/env/abort - unreachable - end + i64.const 1 + call $~lib/typedarray/Int64Array#__set local.get $1 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 65535 - i32.and - i32.const 4 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 307 - i32.const 2 - call $~lib/env/abort - unreachable - end + i64.const 2 + call $~lib/typedarray/Int64Array#__set local.get $1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 65535 - i32.and - i32.const 9 - i32.eq + i64.const 3 + call $~lib/typedarray/Int64Array#__set + local.get $1 + i32.const 20 + i64.const 0 + call $~lib/typedarray/Int64Array#reduceRight + local.set $2 + local.get $2 + i64.const 6 + i64.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 308 + i32.const 24 + i32.const 290 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Int32Array,i32>~anonymous|0 (; 145 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + ) + (func $std/typedarray/testReduceRight<~lib/typedarray/Uint64Array,u64>~anonymous|0 (; 144 ;) (type $FUNCSIG$jjjii) (param $0 i64) (param $1 i64) (param $2 i32) (param $3 i32) (result i64) + (local $4 i64) + local.get $3 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.mul + local.get $1 + i64.add + local.set $4 + local.get $3 + call $~lib/rt/pure/__release + local.get $4 ) - (func $~lib/typedarray/Int32Array#map (; 146 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) + (func $~lib/typedarray/Uint64Array#reduceRight (; 145 ;) (type $FUNCSIG$jiij) (param $0 i32) (param $1 i32) (param $2 i64) (result i64) + (local $3 i64) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) + (local $8 i64) local.get $0 - local.set $2 + call $~lib/rt/pure/__retain + local.set $5 local.get $1 - local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.11 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 2 - i32.shr_u - end local.set $4 local.get $2 - i32.load - local.set $5 - local.get $2 + local.set $3 + local.get $5 i32.load offset=4 local.set $6 - i32.const 0 - local.get $4 - call $~lib/typedarray/Int32Array#constructor - local.set $7 - local.get $7 - i32.load - local.set $8 block $break|0 - i32.const 0 - local.set $9 + local.get $5 + call $~lib/typedarray/Uint64Array#get:length + i32.const 1 + i32.sub + local.set $7 loop $repeat|0 - local.get $9 - local.get $4 - i32.lt_s + local.get $7 + i32.const 0 + i32.ge_s i32.eqz br_if $break|0 - block $~lib/internal/arraybuffer/STORE|inlined.2 - local.get $8 - local.set $10 - local.get $9 - local.set $11 - block (result i32) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.4 (result i32) - local.get $5 - local.set $12 - local.get $9 - local.set $13 - local.get $6 - local.set $14 - local.get $12 - local.get $13 - i32.const 2 - i32.shl - i32.add - local.get $14 - i32.add - i32.load offset=8 - end - local.get $9 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$iiii) - end - local.set $14 - i32.const 0 - local.set $13 - local.get $10 - local.get $11 - i32.const 2 + block (result i64) + i32.const 4 + global.set $~lib/argc + local.get $3 + local.get $6 + local.get $7 + i32.const 3 i32.shl i32.add - local.get $13 - i32.add - local.get $14 - i32.store offset=8 + i64.load + local.get $7 + local.get $5 + local.get $4 + call_indirect (type $FUNCSIG$jjjii) end - local.get $9 + local.set $3 + local.get $7 i32.const 1 - i32.add - local.set $9 + i32.sub + local.set $7 br $repeat|0 unreachable end unreachable end - local.get $7 + local.get $3 + local.set $8 + local.get $5 + call $~lib/rt/pure/__release + local.get $8 ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Int32Array,i32> (; 147 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduceRight<~lib/typedarray/Uint64Array,u64> (; 146 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) + (local $2 i64) i32.const 0 i32.const 3 - call $~lib/typedarray/Int32Array#constructor - local.set $0 - local.get $0 - i32.const 0 - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 2 - i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 29 - call $~lib/typedarray/Int32Array#map + call $~lib/typedarray/Uint64Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain local.set $1 local.get $1 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 306 - i32.const 2 - call $~lib/env/abort - unreachable - end + i64.const 1 + call $~lib/typedarray/Uint64Array#__set local.get $1 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 4 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 307 - i32.const 2 - call $~lib/env/abort - unreachable - end + i64.const 2 + call $~lib/typedarray/Uint64Array#__set local.get $1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 9 - i32.eq + i64.const 3 + call $~lib/typedarray/Uint64Array#__set + local.get $1 + i32.const 21 + i64.const 0 + call $~lib/typedarray/Uint64Array#reduceRight + local.set $2 + local.get $2 + i64.const 6 + i64.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 308 + i32.const 24 + i32.const 290 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Uint32Array,u32>~anonymous|0 (; 148 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + ) + (func $std/typedarray/testReduceRight<~lib/typedarray/Float32Array,f32>~anonymous|0 (; 147 ;) (type $FUNCSIG$fffii) (param $0 f32) (param $1 f32) (param $2 i32) (param $3 i32) (result f32) + (local $4 f32) + local.get $3 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.mul + local.get $1 + f32.add + local.set $4 + local.get $3 + call $~lib/rt/pure/__release + local.get $4 ) - (func $~lib/typedarray/Uint32Array#map (; 149 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) + (func $~lib/typedarray/Float32Array#reduceRight (; 148 ;) (type $FUNCSIG$fiif) (param $0 i32) (param $1 i32) (param $2 f32) (result f32) + (local $3 f32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) + (local $8 f32) local.get $0 - local.set $2 + call $~lib/rt/pure/__retain + local.set $5 local.get $1 - local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.3 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 2 - i32.shr_u - end local.set $4 local.get $2 - i32.load - local.set $5 - local.get $2 + local.set $3 + local.get $5 i32.load offset=4 local.set $6 - i32.const 0 - local.get $4 - call $~lib/typedarray/Uint32Array#constructor - local.set $7 - local.get $7 - i32.load - local.set $8 block $break|0 - i32.const 0 - local.set $9 + local.get $5 + call $~lib/typedarray/Float32Array#get:length + i32.const 1 + i32.sub + local.set $7 loop $repeat|0 - local.get $9 - local.get $4 - i32.lt_s + local.get $7 + i32.const 0 + i32.ge_s i32.eqz br_if $break|0 - block $~lib/internal/arraybuffer/STORE|inlined.1 - local.get $8 - local.set $10 - local.get $9 - local.set $11 - block (result i32) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i32) - local.get $5 - local.set $12 - local.get $9 - local.set $13 - local.get $6 - local.set $14 - local.get $12 - local.get $13 - i32.const 2 - i32.shl - i32.add - local.get $14 - i32.add - i32.load offset=8 - end - local.get $9 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$iiii) - end - local.set $14 - i32.const 0 - local.set $13 - local.get $10 - local.get $11 + block (result f32) + i32.const 4 + global.set $~lib/argc + local.get $3 + local.get $6 + local.get $7 i32.const 2 i32.shl i32.add - local.get $13 - i32.add - local.get $14 - i32.store offset=8 - end - local.get $9 - i32.const 1 - i32.add - local.set $9 - br $repeat|0 - unreachable - end - unreachable - end - local.get $7 - ) - (func $~lib/internal/typedarray/TypedArray#__get (; 150 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - local.get $1 - local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u - i32.ge_u - if - i32.const 0 - i32.const 48 - i32.const 39 - i32.const 63 - call $~lib/env/abort + f32.load + local.get $7 + local.get $5 + local.get $4 + call_indirect (type $FUNCSIG$fffii) + end + local.set $3 + local.get $7 + i32.const 1 + i32.sub + local.set $7 + br $repeat|0 + unreachable + end unreachable end - block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i32) - local.get $0 - i32.load - local.set $2 - local.get $1 - local.set $3 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $2 - local.get $3 - i32.const 2 - i32.shl - i32.add - local.get $4 - i32.add - i32.load offset=8 - end + local.get $3 + local.set $8 + local.get $5 + call $~lib/rt/pure/__release + local.get $8 ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Uint32Array,u32> (; 151 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduceRight<~lib/typedarray/Float32Array,f32> (; 149 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) + (local $2 f32) i32.const 0 i32.const 3 - call $~lib/typedarray/Uint32Array#constructor - local.set $0 - local.get $0 - i32.const 0 - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 2 - i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 30 - call $~lib/typedarray/Uint32Array#map + call $~lib/typedarray/Float32Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain local.set $1 local.get $1 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 306 - i32.const 2 - call $~lib/env/abort - unreachable - end + f32.const 1 + call $~lib/typedarray/Float32Array#__set local.get $1 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 4 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 307 - i32.const 2 - call $~lib/env/abort - unreachable - end + f32.const 2 + call $~lib/typedarray/Float32Array#__set local.get $1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 9 - i32.eq + f32.const 3 + call $~lib/typedarray/Float32Array#__set + local.get $1 + i32.const 22 + f32.const 0 + call $~lib/typedarray/Float32Array#reduceRight + local.set $2 + local.get $2 + f32.const 6 + f32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 308 + i32.const 24 + i32.const 290 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Int64Array,i64>~anonymous|0 (; 152 ;) (type $FUNCSIG$jjii) (param $0 i64) (param $1 i32) (param $2 i32) (result i64) local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + ) + (func $std/typedarray/testReduceRight<~lib/typedarray/Float64Array,f64>~anonymous|0 (; 150 ;) (type $FUNCSIG$dddii) (param $0 f64) (param $1 f64) (param $2 i32) (param $3 i32) (result f64) + (local $4 f64) + local.get $3 + call $~lib/rt/pure/__retain + drop local.get $0 - i64.mul + local.get $1 + f64.add + local.set $4 + local.get $3 + call $~lib/rt/pure/__release + local.get $4 ) - (func $~lib/typedarray/Int64Array#map (; 153 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) + (func $~lib/typedarray/Float64Array#reduceRight (; 151 ;) (type $FUNCSIG$diid) (param $0 i32) (param $1 i32) (param $2 f64) (result f64) + (local $3 f64) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 i64) + (local $8 f64) local.get $0 - local.set $2 + call $~lib/rt/pure/__retain + local.set $5 local.get $1 - local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.3 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 3 - i32.shr_u - end local.set $4 local.get $2 - i32.load - local.set $5 - local.get $2 + local.set $3 + local.get $5 i32.load offset=4 local.set $6 - i32.const 0 - local.get $4 - call $~lib/typedarray/Int64Array#constructor - local.set $7 - local.get $7 - i32.load - local.set $8 block $break|0 - i32.const 0 - local.set $9 + local.get $5 + call $~lib/typedarray/Float64Array#get:length + i32.const 1 + i32.sub + local.set $7 loop $repeat|0 - local.get $9 - local.get $4 - i32.lt_s + local.get $7 + i32.const 0 + i32.ge_s i32.eqz br_if $break|0 - block $~lib/internal/arraybuffer/STORE|inlined.1 - local.get $8 - local.set $10 - local.get $9 - local.set $11 - block (result i64) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i64) - local.get $5 - local.set $12 - local.get $9 - local.set $13 - local.get $6 - local.set $14 - local.get $12 - local.get $13 - i32.const 3 - i32.shl - i32.add - local.get $14 - i32.add - i64.load offset=8 - end - local.get $9 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$jjii) - end - local.set $15 - i32.const 0 - local.set $14 - local.get $10 - local.get $11 + block (result f64) + i32.const 4 + global.set $~lib/argc + local.get $3 + local.get $6 + local.get $7 i32.const 3 i32.shl i32.add - local.get $14 - i32.add - local.get $15 - i64.store offset=8 + f64.load + local.get $7 + local.get $5 + local.get $4 + call_indirect (type $FUNCSIG$dddii) end - local.get $9 + local.set $3 + local.get $7 i32.const 1 - i32.add - local.set $9 + i32.sub + local.set $7 br $repeat|0 unreachable end unreachable end - local.get $7 - ) - (func $~lib/internal/typedarray/TypedArray#__get (; 154 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) - (local $2 i32) - (local $3 i32) - (local $4 i32) - local.get $1 - local.get $0 - i32.load offset=8 - i32.const 3 - i32.shr_u - i32.ge_u - if - i32.const 0 - i32.const 48 - i32.const 39 - i32.const 63 - call $~lib/env/abort - unreachable - end - block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i64) - local.get $0 - i32.load - local.set $2 - local.get $1 - local.set $3 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $2 - local.get $3 - i32.const 3 - i32.shl - i32.add - local.get $4 - i32.add - i64.load offset=8 - end + local.get $3 + local.set $8 + local.get $5 + call $~lib/rt/pure/__release + local.get $8 ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Int64Array,i64> (; 155 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduceRight<~lib/typedarray/Float64Array,f64> (; 152 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) + (local $2 f64) i32.const 0 i32.const 3 - call $~lib/typedarray/Int64Array#constructor - local.set $0 - local.get $0 - i32.const 0 - i64.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 1 - i64.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 2 - i64.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 31 - call $~lib/typedarray/Int64Array#map + call $~lib/typedarray/Float64Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain local.set $1 local.get $1 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i64.const 1 - i64.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 306 - i32.const 2 - call $~lib/env/abort - unreachable - end + f64.const 1 + call $~lib/typedarray/Float64Array#__set local.get $1 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - i64.const 4 - i64.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 307 - i32.const 2 - call $~lib/env/abort - unreachable - end + f64.const 2 + call $~lib/typedarray/Float64Array#__set local.get $1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - i64.const 9 - i64.eq + f64.const 3 + call $~lib/typedarray/Float64Array#__set + local.get $1 + i32.const 23 + f64.const 0 + call $~lib/typedarray/Float64Array#reduceRight + local.set $2 + local.get $2 + f64.const 6 + f64.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 308 + i32.const 24 + i32.const 290 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Uint64Array,u64>~anonymous|0 (; 156 ;) (type $FUNCSIG$jjii) (param $0 i64) (param $1 i32) (param $2 i32) (result i64) + (func $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 (; 153 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 local.get $0 - i64.mul + i32.mul + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Uint64Array#map (; 157 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int8Array#map (; 154 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -8441,37 +8655,25 @@ (local $7 i32) (local $8 i32) (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 i64) local.get $0 - local.set $2 - local.get $1 + call $~lib/rt/pure/__retain local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.3 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 3 - i32.shr_u - end + local.get $1 + local.set $2 + local.get $3 + call $~lib/typedarray/Int8Array#get:length local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 + local.get $3 i32.load offset=4 - local.set $6 + local.set $5 i32.const 0 local.get $4 - call $~lib/typedarray/Uint64Array#constructor + call $~lib/typedarray/Int8Array#constructor + local.tee $6 + call $~lib/rt/pure/__retain local.set $7 local.get $7 - i32.load + i32.load offset=4 local.set $8 block $break|0 i32.const 0 @@ -8482,48 +8684,26 @@ i32.lt_s i32.eqz br_if $break|0 - block $~lib/internal/arraybuffer/STORE|inlined.1 - local.get $8 - local.set $10 + local.get $8 + local.get $9 + i32.const 0 + i32.shl + i32.add + block (result i32) + i32.const 3 + global.set $~lib/argc + local.get $5 local.get $9 - local.set $11 - block (result i64) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i64) - local.get $5 - local.set $12 - local.get $9 - local.set $13 - local.get $6 - local.set $14 - local.get $12 - local.get $13 - i32.const 3 - i32.shl - i32.add - local.get $14 - i32.add - i64.load offset=8 - end - local.get $9 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$jjii) - end - local.set $15 i32.const 0 - local.set $14 - local.get $10 - local.get $11 - i32.const 3 i32.shl i32.add - local.get $14 - i32.add - local.get $15 - i64.store offset=8 + i32.load8_s + local.get $9 + local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$iiii) end + i32.store8 local.get $9 i32.const 1 i32.add @@ -8534,116 +8714,102 @@ unreachable end local.get $7 + local.set $9 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $9 ) - (func $~lib/internal/typedarray/TypedArray#__get (; 158 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) - (local $2 i32) - (local $3 i32) - (local $4 i32) - local.get $1 - local.get $0 - i32.load offset=8 - i32.const 3 - i32.shr_u - i32.ge_u - if - i32.const 0 - i32.const 48 - i32.const 39 - i32.const 63 - call $~lib/env/abort - unreachable - end - block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i64) - local.get $0 - i32.load - local.set $2 - local.get $1 - local.set $3 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $2 - local.get $3 - i32.const 3 - i32.shl - i32.add - local.get $4 - i32.add - i64.load offset=8 - end - ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Uint64Array,u64> (; 159 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8> (; 155 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) + (local $2 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Uint64Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Int8Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - i64.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 i32.const 1 - i64.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + call $~lib/typedarray/Int8Array#__set + local.get $1 + i32.const 1 i32.const 2 - i64.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 32 - call $~lib/typedarray/Uint64Array#map - local.set $1 + call $~lib/typedarray/Int8Array#__set local.get $1 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Int8Array#__set + local.get $1 + i32.const 24 + call $~lib/typedarray/Int8Array#map + local.set $2 + local.get $2 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i64.const 1 - i64.eq + call $~lib/typedarray/Int8Array#__get + i32.const 1 + i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 306 + i32.const 24 + i32.const 317 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $1 + local.get $2 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - i64.const 4 - i64.eq + call $~lib/typedarray/Int8Array#__get + i32.const 4 + i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 307 + i32.const 24 + i32.const 318 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $1 + local.get $2 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - i64.const 9 - i64.eq + call $~lib/typedarray/Int8Array#__get + i32.const 9 + i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 308 + i32.const 24 + i32.const 319 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Float32Array,f32>~anonymous|0 (; 160 ;) (type $FUNCSIG$ffii) (param $0 f32) (param $1 i32) (param $2 i32) (result f32) + (func $std/typedarray/testArrayMap<~lib/typedarray/Uint8Array,u8>~anonymous|0 (; 156 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 local.get $0 - f32.mul + i32.mul + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Float32Array#map (; 161 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint8Array#map (; 157 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -8652,37 +8818,25 @@ (local $7 i32) (local $8 i32) (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 f32) local.get $0 - local.set $2 - local.get $1 + call $~lib/rt/pure/__retain local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.3 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 2 - i32.shr_u - end + local.get $1 + local.set $2 + local.get $3 + call $~lib/typedarray/Uint8Array#get:length local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 + local.get $3 i32.load offset=4 - local.set $6 + local.set $5 i32.const 0 local.get $4 - call $~lib/typedarray/Float32Array#constructor + call $~lib/typedarray/Uint8Array#constructor + local.tee $6 + call $~lib/rt/pure/__retain local.set $7 local.get $7 - i32.load + i32.load offset=4 local.set $8 block $break|0 i32.const 0 @@ -8693,48 +8847,26 @@ i32.lt_s i32.eqz br_if $break|0 - block $~lib/internal/arraybuffer/STORE|inlined.1 - local.get $8 - local.set $10 + local.get $8 + local.get $9 + i32.const 0 + i32.shl + i32.add + block (result i32) + i32.const 3 + global.set $~lib/argc + local.get $5 local.get $9 - local.set $11 - block (result f32) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.2 (result f32) - local.get $5 - local.set $12 - local.get $9 - local.set $13 - local.get $6 - local.set $14 - local.get $12 - local.get $13 - i32.const 2 - i32.shl - i32.add - local.get $14 - i32.add - f32.load offset=8 - end - local.get $9 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$ffii) - end - local.set $15 i32.const 0 - local.set $14 - local.get $10 - local.get $11 - i32.const 2 i32.shl i32.add - local.get $14 - i32.add - local.get $15 - f32.store offset=8 + i32.load8_u + local.get $9 + local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$iiii) end + i32.store8 local.get $9 i32.const 1 i32.add @@ -8745,116 +8877,121 @@ unreachable end local.get $7 + local.set $9 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $9 ) - (func $~lib/internal/typedarray/TypedArray#__get (; 162 ;) (type $FUNCSIG$fii) (param $0 i32) (param $1 i32) (result f32) - (local $2 i32) - (local $3 i32) - (local $4 i32) + (func $~lib/typedarray/Uint8Array#__get (; 158 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=8 - i32.const 2 - i32.shr_u - i32.ge_u - if - i32.const 0 - i32.const 48 - i32.const 39 - i32.const 63 - call $~lib/env/abort - unreachable - end - block $~lib/internal/arraybuffer/LOAD|inlined.3 (result f32) - local.get $0 - i32.load - local.set $2 - local.get $1 - local.set $3 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $2 - local.get $3 - i32.const 2 - i32.shl - i32.add - local.get $4 - i32.add - f32.load offset=8 + i32.ge_u + if + i32.const 336 + i32.const 432 + i32.const 109 + i32.const 44 + call $~lib/builtins/abort + unreachable end + local.get $0 + i32.load offset=4 + local.get $1 + i32.add + i32.load8_u ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Float32Array,f32> (; 163 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayMap<~lib/typedarray/Uint8Array,u8> (; 159 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) + (local $2 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Float32Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Uint8Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - f32.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 i32.const 1 - f32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + call $~lib/typedarray/Uint8Array#__set + local.get $1 + i32.const 1 i32.const 2 - f32.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 33 - call $~lib/typedarray/Float32Array#map - local.set $1 + call $~lib/typedarray/Uint8Array#__set + local.get $1 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Uint8Array#__set local.get $1 + i32.const 25 + call $~lib/typedarray/Uint8Array#map + local.set $2 + local.get $2 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - f32.const 1 - f32.eq + call $~lib/typedarray/Uint8Array#__get + i32.const 1 + i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 306 + i32.const 24 + i32.const 317 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $1 + local.get $2 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - f32.const 4 - f32.eq + call $~lib/typedarray/Uint8Array#__get + i32.const 4 + i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 307 + i32.const 24 + i32.const 318 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $1 + local.get $2 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - f32.const 9 - f32.eq + call $~lib/typedarray/Uint8Array#__get + i32.const 9 + i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 308 + i32.const 24 + i32.const 319 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Float64Array,f64>~anonymous|0 (; 164 ;) (type $FUNCSIG$ddii) (param $0 f64) (param $1 i32) (param $2 i32) (result f64) + (func $std/typedarray/testArrayMap<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 (; 160 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 local.get $0 - f64.mul + i32.mul + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Float64Array#map (; 165 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint8ClampedArray#map (; 161 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -8863,37 +9000,25 @@ (local $7 i32) (local $8 i32) (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 f64) local.get $0 - local.set $2 - local.get $1 + call $~lib/rt/pure/__retain local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.6 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 3 - i32.shr_u - end + local.get $1 + local.set $2 + local.get $3 + call $~lib/typedarray/Uint8ClampedArray#get:length local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 + local.get $3 i32.load offset=4 - local.set $6 + local.set $5 i32.const 0 local.get $4 - call $~lib/typedarray/Float64Array#constructor + call $~lib/typedarray/Uint8ClampedArray#constructor + local.tee $6 + call $~lib/rt/pure/__retain local.set $7 local.get $7 - i32.load + i32.load offset=4 local.set $8 block $break|0 i32.const 0 @@ -8904,48 +9029,26 @@ i32.lt_s i32.eqz br_if $break|0 - block $~lib/internal/arraybuffer/STORE|inlined.13 - local.get $8 - local.set $10 + local.get $8 + local.get $9 + i32.const 0 + i32.shl + i32.add + block (result i32) + i32.const 3 + global.set $~lib/argc + local.get $5 local.get $9 - local.set $11 - block (result f64) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.15 (result f64) - local.get $5 - local.set $12 - local.get $9 - local.set $13 - local.get $6 - local.set $14 - local.get $12 - local.get $13 - i32.const 3 - i32.shl - i32.add - local.get $14 - i32.add - f64.load offset=8 - end - local.get $9 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$ddii) - end - local.set $15 i32.const 0 - local.set $14 - local.get $10 - local.get $11 - i32.const 3 i32.shl i32.add - local.get $14 - i32.add - local.get $15 - f64.store offset=8 + i32.load8_u + local.get $9 + local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$iiii) end + i32.store8 local.get $9 i32.const 1 i32.add @@ -8956,83 +9059,102 @@ unreachable end local.get $7 + local.set $9 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $9 ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Float64Array,f64> (; 166 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayMap<~lib/typedarray/Uint8ClampedArray,u8> (; 162 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) + (local $2 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Float64Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Uint8ClampedArray#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - f64.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 i32.const 1 - f64.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $1 + i32.const 1 i32.const 2 - f64.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 34 - call $~lib/typedarray/Float64Array#map - local.set $1 + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $1 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Uint8ClampedArray#__set local.get $1 + i32.const 26 + call $~lib/typedarray/Uint8ClampedArray#map + local.set $2 + local.get $2 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - f64.const 1 - f64.eq + call $~lib/typedarray/Uint8ClampedArray#__get + i32.const 1 + i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 306 + i32.const 24 + i32.const 317 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $1 + local.get $2 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - f64.const 4 - f64.eq + call $~lib/typedarray/Uint8ClampedArray#__get + i32.const 4 + i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 307 + i32.const 24 + i32.const 318 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $1 + local.get $2 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - f64.const 9 - f64.eq + call $~lib/typedarray/Uint8ClampedArray#__get + i32.const 9 + i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 308 + i32.const 24 + i32.const 319 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 (; 167 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayMap<~lib/typedarray/Int16Array,i16>~anonymous|0 (; 163 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.const 2 - i32.eq + local.get $0 + i32.mul + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Int8Array#some (; 168 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int16Array#map (; 164 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -9041,149 +9163,184 @@ (local $7 i32) (local $8 i32) (local $9 i32) - (local $10 i32) - block $~lib/internal/typedarray/SOME<~lib/typedarray/Int8Array,i8>|inlined.0 (result i32) - local.get $0 - local.set $2 - local.get $1 - local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.13 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 0 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 - i32.load offset=4 - local.set $6 - block $break|0 - i32.const 0 - local.set $7 - loop $repeat|0 - local.get $7 - local.get $4 - i32.lt_s - i32.eqz - br_if $break|0 - block (result i32) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.6 (result i32) - local.get $5 - local.set $10 - local.get $7 - local.set $9 - local.get $6 - local.set $8 - local.get $10 - local.get $9 - i32.const 0 - i32.shl - i32.add - local.get $8 - i32.add - i32.load8_s offset=8 - end - local.get $7 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$iiii) - end - i32.const 0 - i32.ne - if - i32.const 1 - br $~lib/internal/typedarray/SOME<~lib/typedarray/Int8Array,i8>|inlined.0 - end - local.get $7 + local.get $0 + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 + local.set $2 + local.get $3 + call $~lib/typedarray/Int16Array#get:length + local.set $4 + local.get $3 + i32.load offset=4 + local.set $5 + i32.const 0 + local.get $4 + call $~lib/typedarray/Int16Array#constructor + local.tee $6 + call $~lib/rt/pure/__retain + local.set $7 + local.get $7 + i32.load offset=4 + local.set $8 + block $break|0 + i32.const 0 + local.set $9 + loop $repeat|0 + local.get $9 + local.get $4 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $8 + local.get $9 + i32.const 1 + i32.shl + i32.add + block (result i32) + i32.const 3 + global.set $~lib/argc + local.get $5 + local.get $9 i32.const 1 + i32.shl i32.add - local.set $7 - br $repeat|0 - unreachable + i32.load16_s + local.get $9 + local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$iiii) end + i32.store16 + local.get $9 + i32.const 1 + i32.add + local.set $9 + br $repeat|0 unreachable end - i32.const 0 + unreachable end + local.get $7 + local.set $9 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $9 ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|1 (; 169 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/typedarray/Int16Array#__get (; 165 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 local.get $0 - i32.const 24 + i32.load offset=8 + i32.const 1 + i32.shr_u + i32.ge_u + if + i32.const 336 + i32.const 432 + i32.const 273 + i32.const 63 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 1 i32.shl - i32.const 24 - i32.shr_s - i32.const 0 - i32.eq + i32.add + i32.load16_s ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8> (; 170 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayMap<~lib/typedarray/Int16Array,i16> (; 166 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Int8Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Int16Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 i32.const 1 - i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + call $~lib/typedarray/Int16Array#__set + local.get $1 + i32.const 1 i32.const 2 - i32.const 6 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 35 - call $~lib/typedarray/Int8Array#some - local.set $1 + call $~lib/typedarray/Int16Array#__set + local.get $1 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Int16Array#__set local.get $1 + i32.const 27 + call $~lib/typedarray/Int16Array#map + local.set $2 + local.get $2 i32.const 0 - i32.ne + call $~lib/typedarray/Int16Array#__get + i32.const 1 + i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 335 + i32.const 24 + i32.const 317 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 - i32.const 36 - call $~lib/typedarray/Int8Array#some - local.set $2 local.get $2 - i32.const 0 - i32.ne + i32.const 1 + call $~lib/typedarray/Int16Array#__get + i32.const 4 + i32.eq i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 318 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 2 + call $~lib/typedarray/Int16Array#__get + i32.const 9 + i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 338 + i32.const 24 + i32.const 319 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArraySome<~lib/typedarray/Uint8Array,u8>~anonymous|0 (; 171 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayMap<~lib/typedarray/Uint16Array,u16>~anonymous|0 (; 167 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 255 - i32.and - i32.const 2 - i32.eq + local.get $0 + i32.mul + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Uint8Array#some (; 172 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint16Array#map (; 168 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -9192,147 +9349,184 @@ (local $7 i32) (local $8 i32) (local $9 i32) - (local $10 i32) - block $~lib/internal/typedarray/SOME<~lib/typedarray/Uint8Array,u8>|inlined.0 (result i32) - local.get $0 - local.set $2 - local.get $1 - local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.8 (result i32) - local.get $2 - local.set $4 + local.get $0 + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 + local.set $2 + local.get $3 + call $~lib/typedarray/Uint16Array#get:length + local.set $4 + local.get $3 + i32.load offset=4 + local.set $5 + i32.const 0 + local.get $4 + call $~lib/typedarray/Uint16Array#constructor + local.tee $6 + call $~lib/rt/pure/__retain + local.set $7 + local.get $7 + i32.load offset=4 + local.set $8 + block $break|0 + i32.const 0 + local.set $9 + loop $repeat|0 + local.get $9 local.get $4 - i32.load offset=8 - i32.const 0 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 - i32.load offset=4 - local.set $6 - block $break|0 - i32.const 0 - local.set $7 - loop $repeat|0 - local.get $7 - local.get $4 - i32.lt_s - i32.eqz - br_if $break|0 - block (result i32) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.8 (result i32) - local.get $5 - local.set $10 - local.get $7 - local.set $9 - local.get $6 - local.set $8 - local.get $10 - local.get $9 - i32.const 0 - i32.shl - i32.add - local.get $8 - i32.add - i32.load8_u offset=8 - end - local.get $7 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$iiii) - end - i32.const 0 - i32.ne - if - i32.const 1 - br $~lib/internal/typedarray/SOME<~lib/typedarray/Uint8Array,u8>|inlined.0 - end - local.get $7 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $8 + local.get $9 + i32.const 1 + i32.shl + i32.add + block (result i32) + i32.const 3 + global.set $~lib/argc + local.get $5 + local.get $9 i32.const 1 + i32.shl i32.add - local.set $7 - br $repeat|0 - unreachable + i32.load16_u + local.get $9 + local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$iiii) end + i32.store16 + local.get $9 + i32.const 1 + i32.add + local.set $9 + br $repeat|0 unreachable end - i32.const 0 + unreachable end + local.get $7 + local.set $9 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $9 ) - (func $std/typedarray/testArraySome<~lib/typedarray/Uint8Array,u8>~anonymous|1 (; 173 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/typedarray/Uint16Array#__get (; 169 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 local.get $0 - i32.const 255 - i32.and - i32.const 0 - i32.eq + i32.load offset=8 + i32.const 1 + i32.shr_u + i32.ge_u + if + i32.const 336 + i32.const 432 + i32.const 355 + i32.const 63 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 1 + i32.shl + i32.add + i32.load16_u ) - (func $std/typedarray/testArraySome<~lib/typedarray/Uint8Array,u8> (; 174 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayMap<~lib/typedarray/Uint16Array,u16> (; 170 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Uint8Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Uint16Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 i32.const 1 - i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + call $~lib/typedarray/Uint16Array#__set + local.get $1 + i32.const 1 i32.const 2 - i32.const 6 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 37 - call $~lib/typedarray/Uint8Array#some - local.set $1 + call $~lib/typedarray/Uint16Array#__set local.get $1 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Uint16Array#__set + local.get $1 + i32.const 28 + call $~lib/typedarray/Uint16Array#map + local.set $2 + local.get $2 i32.const 0 - i32.ne + call $~lib/typedarray/Uint16Array#__get + i32.const 1 + i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 335 + i32.const 24 + i32.const 317 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 - i32.const 38 - call $~lib/typedarray/Uint8Array#some - local.set $2 local.get $2 - i32.const 0 - i32.ne + i32.const 1 + call $~lib/typedarray/Uint16Array#__get + i32.const 4 + i32.eq i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 318 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 2 + call $~lib/typedarray/Uint16Array#__get + i32.const 9 + i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 338 + i32.const 24 + i32.const 319 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArraySome<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 (; 175 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayMap<~lib/typedarray/Int32Array,i32>~anonymous|0 (; 171 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 255 - i32.and - i32.const 2 - i32.eq + local.get $0 + i32.mul + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Uint8ClampedArray#some (; 176 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int32Array#map (; 172 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -9341,149 +9535,161 @@ (local $7 i32) (local $8 i32) (local $9 i32) - (local $10 i32) - block $~lib/internal/typedarray/SOME<~lib/typedarray/Uint8ClampedArray,u8>|inlined.0 (result i32) - local.get $0 - local.set $2 - local.get $1 - local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.9 (result i32) - local.get $2 - local.set $4 + local.get $0 + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 + local.set $2 + local.get $3 + call $~lib/typedarray/Int32Array#get:length + local.set $4 + local.get $3 + i32.load offset=4 + local.set $5 + i32.const 0 + local.get $4 + call $~lib/typedarray/Int32Array#constructor + local.tee $6 + call $~lib/rt/pure/__retain + local.set $7 + local.get $7 + i32.load offset=4 + local.set $8 + block $break|0 + i32.const 0 + local.set $9 + loop $repeat|0 + local.get $9 local.get $4 - i32.load offset=8 - i32.const 0 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 - i32.load offset=4 - local.set $6 - block $break|0 - i32.const 0 - local.set $7 - loop $repeat|0 - local.get $7 - local.get $4 - i32.lt_s - i32.eqz - br_if $break|0 - block (result i32) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.10 (result i32) - local.get $5 - local.set $10 - local.get $7 - local.set $9 - local.get $6 - local.set $8 - local.get $10 - local.get $9 - i32.const 0 - i32.shl - i32.add - local.get $8 - i32.add - i32.load8_u offset=8 - end - local.get $7 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$iiii) - end - i32.const 0 - i32.ne - if - i32.const 1 - br $~lib/internal/typedarray/SOME<~lib/typedarray/Uint8ClampedArray,u8>|inlined.0 - end - local.get $7 - i32.const 1 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $8 + local.get $9 + i32.const 2 + i32.shl + i32.add + block (result i32) + i32.const 3 + global.set $~lib/argc + local.get $5 + local.get $9 + i32.const 2 + i32.shl i32.add - local.set $7 - br $repeat|0 - unreachable + i32.load + local.get $9 + local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$iiii) end + i32.store + local.get $9 + i32.const 1 + i32.add + local.set $9 + br $repeat|0 unreachable end - i32.const 0 + unreachable end + local.get $7 + local.set $9 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $9 ) - (func $std/typedarray/testArraySome<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|1 (; 177 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $0 - i32.const 255 - i32.and - i32.const 0 - i32.eq - ) - (func $std/typedarray/testArraySome<~lib/typedarray/Uint8ClampedArray,u8> (; 178 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayMap<~lib/typedarray/Int32Array,i32> (; 173 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Uint8ClampedArray#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Int32Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - i32.const 2 - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 i32.const 1 - i32.const 4 - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 + call $~lib/typedarray/Int32Array#__set + local.get $1 + i32.const 1 i32.const 2 - i32.const 6 - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 - i32.const 39 - call $~lib/typedarray/Uint8ClampedArray#some - local.set $1 + call $~lib/typedarray/Int32Array#__set + local.get $1 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Int32Array#__set local.get $1 + i32.const 29 + call $~lib/typedarray/Int32Array#map + local.set $2 + local.get $2 i32.const 0 - i32.ne + call $~lib/typedarray/Int32Array#__get + i32.const 1 + i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 335 + i32.const 24 + i32.const 317 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 - i32.const 40 - call $~lib/typedarray/Uint8ClampedArray#some - local.set $2 local.get $2 - i32.const 0 - i32.ne + i32.const 1 + call $~lib/typedarray/Int32Array#__get + i32.const 4 + i32.eq i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 318 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 2 + call $~lib/typedarray/Int32Array#__get + i32.const 9 + i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 338 + i32.const 24 + i32.const 319 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 (; 179 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayMap<~lib/typedarray/Uint32Array,u32>~anonymous|0 (; 174 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - i32.const 2 - i32.eq + local.get $0 + i32.mul + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Int16Array#some (; 180 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint32Array#map (; 175 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -9492,149 +9698,184 @@ (local $7 i32) (local $8 i32) (local $9 i32) - (local $10 i32) - block $~lib/internal/typedarray/SOME<~lib/typedarray/Int16Array,i16>|inlined.0 (result i32) - local.get $0 - local.set $2 - local.get $1 - local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.4 (result i32) - local.get $2 - local.set $4 + local.get $0 + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 + local.set $2 + local.get $3 + call $~lib/typedarray/Uint32Array#get:length + local.set $4 + local.get $3 + i32.load offset=4 + local.set $5 + i32.const 0 + local.get $4 + call $~lib/typedarray/Uint32Array#constructor + local.tee $6 + call $~lib/rt/pure/__retain + local.set $7 + local.get $7 + i32.load offset=4 + local.set $8 + block $break|0 + i32.const 0 + local.set $9 + loop $repeat|0 + local.get $9 local.get $4 - i32.load offset=8 - i32.const 1 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 - i32.load offset=4 - local.set $6 - block $break|0 - i32.const 0 - local.set $7 - loop $repeat|0 - local.get $7 - local.get $4 - i32.lt_s - i32.eqz - br_if $break|0 - block (result i32) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.5 (result i32) - local.get $5 - local.set $10 - local.get $7 - local.set $9 - local.get $6 - local.set $8 - local.get $10 - local.get $9 - i32.const 1 - i32.shl - i32.add - local.get $8 - i32.add - i32.load16_s offset=8 - end - local.get $7 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$iiii) - end - i32.const 0 - i32.ne - if - i32.const 1 - br $~lib/internal/typedarray/SOME<~lib/typedarray/Int16Array,i16>|inlined.0 - end - local.get $7 - i32.const 1 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $8 + local.get $9 + i32.const 2 + i32.shl + i32.add + block (result i32) + i32.const 3 + global.set $~lib/argc + local.get $5 + local.get $9 + i32.const 2 + i32.shl i32.add - local.set $7 - br $repeat|0 - unreachable + i32.load + local.get $9 + local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$iiii) end + i32.store + local.get $9 + i32.const 1 + i32.add + local.set $9 + br $repeat|0 unreachable end - i32.const 0 + unreachable end + local.get $7 + local.set $9 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $9 ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|1 (; 181 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/typedarray/Uint32Array#__get (; 176 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $1 local.get $0 - i32.const 16 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ge_u + if + i32.const 336 + i32.const 432 + i32.const 519 + i32.const 63 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 i32.shl - i32.const 16 - i32.shr_s - i32.const 0 - i32.eq + i32.add + i32.load ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16> (; 182 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayMap<~lib/typedarray/Uint32Array,u32> (; 177 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Int16Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Uint32Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 i32.const 1 - i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + call $~lib/typedarray/Uint32Array#__set + local.get $1 + i32.const 1 i32.const 2 - i32.const 6 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 41 - call $~lib/typedarray/Int16Array#some - local.set $1 + call $~lib/typedarray/Uint32Array#__set + local.get $1 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Uint32Array#__set local.get $1 + i32.const 30 + call $~lib/typedarray/Uint32Array#map + local.set $2 + local.get $2 i32.const 0 - i32.ne + call $~lib/typedarray/Uint32Array#__get + i32.const 1 + i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 335 + i32.const 24 + i32.const 317 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 - i32.const 42 - call $~lib/typedarray/Int16Array#some - local.set $2 local.get $2 - i32.const 0 - i32.ne + i32.const 1 + call $~lib/typedarray/Uint32Array#__get + i32.const 4 + i32.eq i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 318 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 2 + call $~lib/typedarray/Uint32Array#__get + i32.const 9 + i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 338 + i32.const 24 + i32.const 319 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArraySome<~lib/typedarray/Uint16Array,u16>~anonymous|0 (; 183 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayMap<~lib/typedarray/Int64Array,i64>~anonymous|0 (; 178 ;) (type $FUNCSIG$jjii) (param $0 i64) (param $1 i32) (param $2 i32) (result i64) + (local $3 i64) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 65535 - i32.and - i32.const 2 - i32.eq + local.get $0 + i64.mul + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Uint16Array#some (; 184 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int64Array#map (; 179 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -9643,145 +9884,184 @@ (local $7 i32) (local $8 i32) (local $9 i32) - (local $10 i32) - block $~lib/internal/typedarray/SOME<~lib/typedarray/Uint16Array,u16>|inlined.0 (result i32) - local.get $0 - local.set $2 - local.get $1 - local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.4 (result i32) - local.get $2 - local.set $4 + local.get $0 + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 + local.set $2 + local.get $3 + call $~lib/typedarray/Int64Array#get:length + local.set $4 + local.get $3 + i32.load offset=4 + local.set $5 + i32.const 0 + local.get $4 + call $~lib/typedarray/Int64Array#constructor + local.tee $6 + call $~lib/rt/pure/__retain + local.set $7 + local.get $7 + i32.load offset=4 + local.set $8 + block $break|0 + i32.const 0 + local.set $9 + loop $repeat|0 + local.get $9 local.get $4 - i32.load offset=8 - i32.const 1 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 - i32.load offset=4 - local.set $6 - block $break|0 - i32.const 0 - local.set $7 - loop $repeat|0 - local.get $7 - local.get $4 - i32.lt_s - i32.eqz - br_if $break|0 - block (result i32) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.5 (result i32) - local.get $5 - local.set $10 - local.get $7 - local.set $9 - local.get $6 - local.set $8 - local.get $10 - local.get $9 - i32.const 1 - i32.shl - i32.add - local.get $8 - i32.add - i32.load16_u offset=8 - end - local.get $7 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$iiii) - end - i32.const 0 - i32.ne - if - i32.const 1 - br $~lib/internal/typedarray/SOME<~lib/typedarray/Uint16Array,u16>|inlined.0 - end - local.get $7 - i32.const 1 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $8 + local.get $9 + i32.const 3 + i32.shl + i32.add + block (result i64) + i32.const 3 + global.set $~lib/argc + local.get $5 + local.get $9 + i32.const 3 + i32.shl i32.add - local.set $7 - br $repeat|0 - unreachable + i64.load + local.get $9 + local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$jjii) end + i64.store + local.get $9 + i32.const 1 + i32.add + local.set $9 + br $repeat|0 unreachable end - i32.const 0 + unreachable end + local.get $7 + local.set $9 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $9 ) - (func $std/typedarray/testArraySome<~lib/typedarray/Uint16Array,u16>~anonymous|1 (; 185 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/typedarray/Int64Array#__get (; 180 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) + local.get $1 local.get $0 - i32.const 65535 - i32.and - i32.const 0 - i32.eq + i32.load offset=8 + i32.const 3 + i32.shr_u + i32.ge_u + if + i32.const 336 + i32.const 432 + i32.const 601 + i32.const 63 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 3 + i32.shl + i32.add + i64.load ) - (func $std/typedarray/testArraySome<~lib/typedarray/Uint16Array,u16> (; 186 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayMap<~lib/typedarray/Int64Array,i64> (; 181 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Uint16Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Int64Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + i64.const 1 + call $~lib/typedarray/Int64Array#__set + local.get $1 i32.const 1 - i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + i64.const 2 + call $~lib/typedarray/Int64Array#__set + local.get $1 i32.const 2 - i32.const 6 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 43 - call $~lib/typedarray/Uint16Array#some - local.set $1 + i64.const 3 + call $~lib/typedarray/Int64Array#__set local.get $1 + i32.const 31 + call $~lib/typedarray/Int64Array#map + local.set $2 + local.get $2 i32.const 0 - i32.ne + call $~lib/typedarray/Int64Array#__get + i64.const 1 + i64.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 335 + i32.const 24 + i32.const 317 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 - i32.const 44 - call $~lib/typedarray/Uint16Array#some - local.set $2 local.get $2 - i32.const 0 - i32.ne + i32.const 1 + call $~lib/typedarray/Int64Array#__get + i64.const 4 + i64.eq i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 318 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 2 + call $~lib/typedarray/Int64Array#__get + i64.const 9 + i64.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 338 + i32.const 24 + i32.const 319 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 (; 187 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayMap<~lib/typedarray/Uint64Array,u64>~anonymous|0 (; 182 ;) (type $FUNCSIG$jjii) (param $0 i64) (param $1 i32) (param $2 i32) (result i64) + (local $3 i64) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 2 - i32.eq + local.get $0 + i64.mul + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Int32Array#some (; 188 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint64Array#map (; 183 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -9790,143 +10070,184 @@ (local $7 i32) (local $8 i32) (local $9 i32) - (local $10 i32) - block $~lib/internal/typedarray/SOME<~lib/typedarray/Int32Array,i32>|inlined.0 (result i32) - local.get $0 - local.set $2 - local.get $1 - local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.12 (result i32) - local.get $2 - local.set $4 + local.get $0 + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 + local.set $2 + local.get $3 + call $~lib/typedarray/Uint64Array#get:length + local.set $4 + local.get $3 + i32.load offset=4 + local.set $5 + i32.const 0 + local.get $4 + call $~lib/typedarray/Uint64Array#constructor + local.tee $6 + call $~lib/rt/pure/__retain + local.set $7 + local.get $7 + i32.load offset=4 + local.set $8 + block $break|0 + i32.const 0 + local.set $9 + loop $repeat|0 + local.get $9 local.get $4 - i32.load offset=8 - i32.const 2 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 - i32.load offset=4 - local.set $6 - block $break|0 - i32.const 0 - local.set $7 - loop $repeat|0 - local.get $7 - local.get $4 - i32.lt_s - i32.eqz - br_if $break|0 - block (result i32) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.6 (result i32) - local.get $5 - local.set $10 - local.get $7 - local.set $9 - local.get $6 - local.set $8 - local.get $10 - local.get $9 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.add - i32.load offset=8 - end - local.get $7 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$iiii) - end - i32.const 0 - i32.ne - if - i32.const 1 - br $~lib/internal/typedarray/SOME<~lib/typedarray/Int32Array,i32>|inlined.0 - end - local.get $7 - i32.const 1 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $8 + local.get $9 + i32.const 3 + i32.shl + i32.add + block (result i64) + i32.const 3 + global.set $~lib/argc + local.get $5 + local.get $9 + i32.const 3 + i32.shl i32.add - local.set $7 - br $repeat|0 - unreachable + i64.load + local.get $9 + local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$jjii) end + i64.store + local.get $9 + i32.const 1 + i32.add + local.set $9 + br $repeat|0 unreachable end - i32.const 0 + unreachable end + local.get $7 + local.set $9 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $9 ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|1 (; 189 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/typedarray/Uint64Array#__get (; 184 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) + local.get $1 local.get $0 - i32.const 0 - i32.eq + i32.load offset=8 + i32.const 3 + i32.shr_u + i32.ge_u + if + i32.const 336 + i32.const 432 + i32.const 683 + i32.const 63 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 3 + i32.shl + i32.add + i64.load ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32> (; 190 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayMap<~lib/typedarray/Uint64Array,u64> (; 185 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Int32Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Uint64Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + i64.const 1 + call $~lib/typedarray/Uint64Array#__set + local.get $1 i32.const 1 - i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + i64.const 2 + call $~lib/typedarray/Uint64Array#__set + local.get $1 i32.const 2 - i32.const 6 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 45 - call $~lib/typedarray/Int32Array#some - local.set $1 + i64.const 3 + call $~lib/typedarray/Uint64Array#__set local.get $1 + i32.const 32 + call $~lib/typedarray/Uint64Array#map + local.set $2 + local.get $2 i32.const 0 - i32.ne + call $~lib/typedarray/Uint64Array#__get + i64.const 1 + i64.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 335 + i32.const 24 + i32.const 317 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + call $~lib/typedarray/Uint64Array#__get + i64.const 4 + i64.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 318 + i32.const 2 + call $~lib/builtins/abort unreachable end - local.get $0 - i32.const 46 - call $~lib/typedarray/Int32Array#some - local.set $2 local.get $2 - i32.const 0 - i32.ne - i32.eqz + i32.const 2 + call $~lib/typedarray/Uint64Array#__get + i64.const 9 + i64.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 338 + i32.const 24 + i32.const 319 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArraySome<~lib/typedarray/Uint32Array,u32>~anonymous|0 (; 191 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayMap<~lib/typedarray/Float32Array,f32>~anonymous|0 (; 186 ;) (type $FUNCSIG$ffii) (param $0 f32) (param $1 i32) (param $2 i32) (result f32) + (local $3 f32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 2 - i32.eq + local.get $0 + f32.mul + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Uint32Array#some (; 192 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Float32Array#map (; 187 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -9935,5960 +10256,6107 @@ (local $7 i32) (local $8 i32) (local $9 i32) - (local $10 i32) - block $~lib/internal/typedarray/SOME<~lib/typedarray/Uint32Array,u32>|inlined.0 (result i32) - local.get $0 - local.set $2 - local.get $1 - local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.4 (result i32) - local.get $2 - local.set $4 + local.get $0 + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 + local.set $2 + local.get $3 + call $~lib/typedarray/Float32Array#get:length + local.set $4 + local.get $3 + i32.load offset=4 + local.set $5 + i32.const 0 + local.get $4 + call $~lib/typedarray/Float32Array#constructor + local.tee $6 + call $~lib/rt/pure/__retain + local.set $7 + local.get $7 + i32.load offset=4 + local.set $8 + block $break|0 + i32.const 0 + local.set $9 + loop $repeat|0 + local.get $9 local.get $4 - i32.load offset=8 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $8 + local.get $9 i32.const 2 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 - i32.load offset=4 - local.set $6 - block $break|0 - i32.const 0 - local.set $7 - loop $repeat|0 - local.get $7 - local.get $4 - i32.lt_s - i32.eqz - br_if $break|0 - block (result i32) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.5 (result i32) - local.get $5 - local.set $10 - local.get $7 - local.set $9 - local.get $6 - local.set $8 - local.get $10 - local.get $9 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.add - i32.load offset=8 - end - local.get $7 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$iiii) - end - i32.const 0 - i32.ne - if - i32.const 1 - br $~lib/internal/typedarray/SOME<~lib/typedarray/Uint32Array,u32>|inlined.0 - end - local.get $7 - i32.const 1 + i32.shl + i32.add + block (result f32) + i32.const 3 + global.set $~lib/argc + local.get $5 + local.get $9 + i32.const 2 + i32.shl i32.add - local.set $7 - br $repeat|0 - unreachable + f32.load + local.get $9 + local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$ffii) end + f32.store + local.get $9 + i32.const 1 + i32.add + local.set $9 + br $repeat|0 unreachable end - i32.const 0 + unreachable end + local.get $7 + local.set $9 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $9 ) - (func $std/typedarray/testArraySome<~lib/typedarray/Uint32Array,u32>~anonymous|1 (; 193 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/typedarray/Float32Array#__get (; 188 ;) (type $FUNCSIG$fii) (param $0 i32) (param $1 i32) (result f32) + local.get $1 local.get $0 - i32.const 0 - i32.eq + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ge_u + if + i32.const 336 + i32.const 432 + i32.const 765 + i32.const 63 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + f32.load ) - (func $std/typedarray/testArraySome<~lib/typedarray/Uint32Array,u32> (; 194 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayMap<~lib/typedarray/Float32Array,f32> (; 189 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Uint32Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Float32Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + f32.const 1 + call $~lib/typedarray/Float32Array#__set + local.get $1 i32.const 1 - i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + f32.const 2 + call $~lib/typedarray/Float32Array#__set + local.get $1 i32.const 2 - i32.const 6 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 47 - call $~lib/typedarray/Uint32Array#some - local.set $1 + f32.const 3 + call $~lib/typedarray/Float32Array#__set local.get $1 + i32.const 33 + call $~lib/typedarray/Float32Array#map + local.set $2 + local.get $2 i32.const 0 - i32.ne + call $~lib/typedarray/Float32Array#__get + f32.const 1 + f32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 335 + i32.const 24 + i32.const 317 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 - i32.const 48 - call $~lib/typedarray/Uint32Array#some - local.set $2 local.get $2 - i32.const 0 - i32.ne + i32.const 1 + call $~lib/typedarray/Float32Array#__get + f32.const 4 + f32.eq i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 318 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 2 + call $~lib/typedarray/Float32Array#__get + f32.const 9 + f32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 338 + i32.const 24 + i32.const 319 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|0 (; 195 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayMap<~lib/typedarray/Float64Array,f64>~anonymous|0 (; 190 ;) (type $FUNCSIG$ddii) (param $0 f64) (param $1 i32) (param $2 i32) (result f64) + (local $3 f64) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i64.const 2 - i64.eq + local.get $0 + f64.mul + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Int64Array#some (; 196 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Float64Array#map (; 191 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - block $~lib/internal/typedarray/SOME<~lib/typedarray/Int64Array,i64>|inlined.0 (result i32) - local.get $0 - local.set $2 - local.get $1 - local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.4 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 3 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 - i32.load offset=4 - local.set $6 - block $break|0 - i32.const 0 - local.set $7 - loop $repeat|0 - local.get $7 - local.get $4 - i32.lt_s - i32.eqz - br_if $break|0 - block (result i32) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.5 (result i64) - local.get $5 - local.set $10 - local.get $7 - local.set $9 - local.get $6 - local.set $8 - local.get $10 - local.get $9 - i32.const 3 - i32.shl - i32.add - local.get $8 - i32.add - i64.load offset=8 - end - local.get $7 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$ijii) - end - i32.const 0 - i32.ne - if - i32.const 1 - br $~lib/internal/typedarray/SOME<~lib/typedarray/Int64Array,i64>|inlined.0 - end - local.get $7 - i32.const 1 + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 + local.set $2 + local.get $3 + call $~lib/typedarray/Float64Array#get:length + local.set $4 + local.get $3 + i32.load offset=4 + local.set $5 + i32.const 0 + local.get $4 + call $~lib/typedarray/Float64Array#constructor + local.tee $6 + call $~lib/rt/pure/__retain + local.set $7 + local.get $7 + i32.load offset=4 + local.set $8 + block $break|0 + i32.const 0 + local.set $9 + loop $repeat|0 + local.get $9 + local.get $4 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $8 + local.get $9 + i32.const 3 + i32.shl + i32.add + block (result f64) + i32.const 3 + global.set $~lib/argc + local.get $5 + local.get $9 + i32.const 3 + i32.shl i32.add - local.set $7 - br $repeat|0 - unreachable + f64.load + local.get $9 + local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$ddii) end + f64.store + local.get $9 + i32.const 1 + i32.add + local.set $9 + br $repeat|0 unreachable end - i32.const 0 + unreachable end + local.get $7 + local.set $9 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $9 ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|1 (; 197 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) - local.get $0 - i64.const 0 - i64.eq - ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64> (; 198 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayMap<~lib/typedarray/Float64Array,f64> (; 192 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Int64Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Float64Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - i64.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + f64.const 1 + call $~lib/typedarray/Float64Array#__set + local.get $1 i32.const 1 - i64.const 4 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + f64.const 2 + call $~lib/typedarray/Float64Array#__set + local.get $1 i32.const 2 - i64.const 6 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 49 - call $~lib/typedarray/Int64Array#some - local.set $1 + f64.const 3 + call $~lib/typedarray/Float64Array#__set local.get $1 + i32.const 34 + call $~lib/typedarray/Float64Array#map + local.set $2 + local.get $2 i32.const 0 - i32.ne + call $~lib/typedarray/Float64Array#__get + f64.const 1 + f64.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 335 + i32.const 24 + i32.const 317 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 - i32.const 50 - call $~lib/typedarray/Int64Array#some - local.set $2 local.get $2 - i32.const 0 - i32.ne + i32.const 1 + call $~lib/typedarray/Float64Array#__get + f64.const 4 + f64.eq i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 318 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 2 + call $~lib/typedarray/Float64Array#__get + f64.const 9 + f64.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 338 + i32.const 24 + i32.const 319 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArraySome<~lib/typedarray/Uint64Array,u64>~anonymous|0 (; 199 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 (; 193 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i64.const 2 - i64.eq + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.const 2 + i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Uint64Array#some (; 200 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int8Array#some (; 194 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - block $~lib/internal/typedarray/SOME<~lib/typedarray/Uint64Array,u64>|inlined.0 (result i32) + block $~lib/typedarray/SOME<~lib/typedarray/Int8Array,i8>|inlined.0 (result i32) local.get $0 - local.set $2 - local.get $1 + call $~lib/rt/pure/__retain local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.4 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 3 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 + local.get $1 + local.set $2 + local.get $3 i32.load offset=4 - local.set $6 + local.set $4 block $break|0 - i32.const 0 - local.set $7 + block + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Int8Array#get:length + local.set $6 + end loop $repeat|0 - local.get $7 - local.get $4 + local.get $5 + local.get $6 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 3 global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.5 (result i64) - local.get $5 - local.set $10 - local.get $7 - local.set $9 - local.get $6 - local.set $8 - local.get $10 - local.get $9 - i32.const 3 - i32.shl - i32.add - local.get $8 - i32.add - i64.load offset=8 - end - local.get $7 - local.get $2 + local.get $4 + local.get $5 + i32.const 0 + i32.shl + i32.add + i32.load8_s + local.get $5 local.get $3 - call_indirect (type $FUNCSIG$ijii) + local.get $2 + call_indirect (type $FUNCSIG$iiii) end - i32.const 0 - i32.ne if i32.const 1 - br $~lib/internal/typedarray/SOME<~lib/typedarray/Uint64Array,u64>|inlined.0 + local.set $7 + local.get $3 + call $~lib/rt/pure/__release + local.get $7 + br $~lib/typedarray/SOME<~lib/typedarray/Int8Array,i8>|inlined.0 end - local.get $7 + local.get $5 i32.const 1 i32.add - local.set $7 + local.set $5 br $repeat|0 unreachable end unreachable end i32.const 0 + local.set $6 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 end ) - (func $std/typedarray/testArraySome<~lib/typedarray/Uint64Array,u64>~anonymous|1 (; 201 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|1 (; 195 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i64.const 0 - i64.eq + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.const 0 + i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $std/typedarray/testArraySome<~lib/typedarray/Uint64Array,u64> (; 202 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8> (; 196 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) + (local $3 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Uint64Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Int8Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - i64.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + i32.const 2 + call $~lib/typedarray/Int8Array#__set + local.get $1 i32.const 1 - i64.const 4 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + i32.const 4 + call $~lib/typedarray/Int8Array#__set + local.get $1 i32.const 2 - i64.const 6 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 51 - call $~lib/typedarray/Uint64Array#some - local.set $1 + i32.const 6 + call $~lib/typedarray/Int8Array#__set local.get $1 + i32.const 35 + call $~lib/typedarray/Int8Array#some + local.set $2 + local.get $2 i32.const 0 i32.ne i32.eqz if i32.const 0 - i32.const 8 - i32.const 335 + i32.const 24 + i32.const 346 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 - i32.const 52 - call $~lib/typedarray/Uint64Array#some - local.set $2 - local.get $2 + local.get $1 + i32.const 36 + call $~lib/typedarray/Int8Array#some + local.set $3 + local.get $3 i32.const 0 i32.ne i32.eqz i32.eqz if i32.const 0 - i32.const 8 - i32.const 338 + i32.const 24 + i32.const 349 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|0 (; 203 ;) (type $FUNCSIG$ifii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Uint8Array,u8>~anonymous|0 (; 197 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - f32.const 2 - f32.eq + i32.const 255 + i32.and + i32.const 2 + i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Float32Array#some (; 204 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint8Array#some (; 198 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - block $~lib/internal/typedarray/SOME<~lib/typedarray/Float32Array,f32>|inlined.0 (result i32) + block $~lib/typedarray/SOME<~lib/typedarray/Uint8Array,u8>|inlined.0 (result i32) local.get $0 - local.set $2 - local.get $1 + call $~lib/rt/pure/__retain local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.4 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 2 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 + local.get $1 + local.set $2 + local.get $3 i32.load offset=4 - local.set $6 + local.set $4 block $break|0 - i32.const 0 - local.set $7 + block + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Uint8Array#get:length + local.set $6 + end loop $repeat|0 - local.get $7 - local.get $4 + local.get $5 + local.get $6 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 3 global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.5 (result f32) - local.get $5 - local.set $10 - local.get $7 - local.set $9 - local.get $6 - local.set $8 - local.get $10 - local.get $9 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.add - f32.load offset=8 - end - local.get $7 - local.get $2 + local.get $4 + local.get $5 + i32.const 0 + i32.shl + i32.add + i32.load8_u + local.get $5 local.get $3 - call_indirect (type $FUNCSIG$ifii) + local.get $2 + call_indirect (type $FUNCSIG$iiii) end - i32.const 0 - i32.ne if i32.const 1 - br $~lib/internal/typedarray/SOME<~lib/typedarray/Float32Array,f32>|inlined.0 + local.set $7 + local.get $3 + call $~lib/rt/pure/__release + local.get $7 + br $~lib/typedarray/SOME<~lib/typedarray/Uint8Array,u8>|inlined.0 end - local.get $7 + local.get $5 i32.const 1 i32.add - local.set $7 + local.set $5 br $repeat|0 unreachable end unreachable end i32.const 0 + local.set $6 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 end ) - (func $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|1 (; 205 ;) (type $FUNCSIG$ifii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Uint8Array,u8>~anonymous|1 (; 199 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - f32.const 0 - f32.eq + i32.const 255 + i32.and + i32.const 0 + i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32> (; 206 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArraySome<~lib/typedarray/Uint8Array,u8> (; 200 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) + (local $3 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Float32Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Uint8Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - f32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + i32.const 2 + call $~lib/typedarray/Uint8Array#__set + local.get $1 i32.const 1 - f32.const 4 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + i32.const 4 + call $~lib/typedarray/Uint8Array#__set + local.get $1 i32.const 2 - f32.const 6 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 53 - call $~lib/typedarray/Float32Array#some - local.set $1 + i32.const 6 + call $~lib/typedarray/Uint8Array#__set local.get $1 + i32.const 37 + call $~lib/typedarray/Uint8Array#some + local.set $2 + local.get $2 i32.const 0 i32.ne i32.eqz if i32.const 0 - i32.const 8 - i32.const 335 + i32.const 24 + i32.const 346 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 - i32.const 54 - call $~lib/typedarray/Float32Array#some - local.set $2 - local.get $2 + local.get $1 + i32.const 38 + call $~lib/typedarray/Uint8Array#some + local.set $3 + local.get $3 i32.const 0 i32.ne i32.eqz i32.eqz if i32.const 0 - i32.const 8 - i32.const 338 + i32.const 24 + i32.const 349 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|0 (; 207 ;) (type $FUNCSIG$idii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 (; 201 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - f64.const 2 - f64.eq + i32.const 255 + i32.and + i32.const 2 + i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Float64Array#some (; 208 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint8ClampedArray#some (; 202 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - block $~lib/internal/typedarray/SOME<~lib/typedarray/Float64Array,f64>|inlined.0 (result i32) + block $~lib/typedarray/SOME<~lib/typedarray/Uint8ClampedArray,u8>|inlined.0 (result i32) local.get $0 - local.set $2 - local.get $1 + call $~lib/rt/pure/__retain local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.7 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 3 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 + local.get $1 + local.set $2 + local.get $3 i32.load offset=4 - local.set $6 + local.set $4 block $break|0 - i32.const 0 - local.set $7 + block + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Uint8ClampedArray#get:length + local.set $6 + end loop $repeat|0 - local.get $7 - local.get $4 + local.get $5 + local.get $6 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 3 global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.17 (result f64) - local.get $5 - local.set $10 - local.get $7 - local.set $9 - local.get $6 - local.set $8 - local.get $10 - local.get $9 - i32.const 3 - i32.shl - i32.add - local.get $8 - i32.add - f64.load offset=8 - end - local.get $7 - local.get $2 + local.get $4 + local.get $5 + i32.const 0 + i32.shl + i32.add + i32.load8_u + local.get $5 local.get $3 - call_indirect (type $FUNCSIG$idii) + local.get $2 + call_indirect (type $FUNCSIG$iiii) end - i32.const 0 - i32.ne if i32.const 1 - br $~lib/internal/typedarray/SOME<~lib/typedarray/Float64Array,f64>|inlined.0 + local.set $7 + local.get $3 + call $~lib/rt/pure/__release + local.get $7 + br $~lib/typedarray/SOME<~lib/typedarray/Uint8ClampedArray,u8>|inlined.0 end - local.get $7 + local.get $5 i32.const 1 i32.add - local.set $7 + local.set $5 br $repeat|0 unreachable end unreachable end i32.const 0 + local.set $6 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 end ) - (func $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|1 (; 209 ;) (type $FUNCSIG$idii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|1 (; 203 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - f64.const 0 - f64.eq + i32.const 255 + i32.and + i32.const 0 + i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64> (; 210 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArraySome<~lib/typedarray/Uint8ClampedArray,u8> (; 204 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) + (local $3 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Float64Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Uint8ClampedArray#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - f64.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + i32.const 2 + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $1 i32.const 1 - f64.const 4 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + i32.const 4 + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $1 i32.const 2 - f64.const 6 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 55 - call $~lib/typedarray/Float64Array#some - local.set $1 + i32.const 6 + call $~lib/typedarray/Uint8ClampedArray#__set local.get $1 + i32.const 39 + call $~lib/typedarray/Uint8ClampedArray#some + local.set $2 + local.get $2 i32.const 0 i32.ne i32.eqz if i32.const 0 - i32.const 8 - i32.const 335 + i32.const 24 + i32.const 346 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 - i32.const 56 - call $~lib/typedarray/Float64Array#some - local.set $2 - local.get $2 + local.get $1 + i32.const 40 + call $~lib/typedarray/Uint8ClampedArray#some + local.set $3 + local.get $3 i32.const 0 i32.ne i32.eqz i32.eqz if i32.const 0 - i32.const 8 - i32.const 338 + i32.const 24 + i32.const 349 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int8Array,i8>~anonymous|0 (; 211 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 (; 205 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 24 + i32.const 16 i32.shl - i32.const 24 + i32.const 16 i32.shr_s i32.const 2 i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Int8Array#findIndex (; 212 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int16Array#some (; 206 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - block $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Int8Array,i8>|inlined.0 (result i32) + block $~lib/typedarray/SOME<~lib/typedarray/Int16Array,i16>|inlined.0 (result i32) local.get $0 - local.set $2 - local.get $1 + call $~lib/rt/pure/__retain local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.14 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 0 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 + local.get $1 + local.set $2 + local.get $3 i32.load offset=4 - local.set $6 + local.set $4 block $break|0 - i32.const 0 - local.set $7 + block + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Int16Array#get:length + local.set $6 + end loop $repeat|0 - local.get $7 - local.get $4 + local.get $5 + local.get $6 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 3 global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.8 (result i32) - local.get $5 - local.set $10 - local.get $7 - local.set $9 - local.get $6 - local.set $8 - local.get $10 - local.get $9 - i32.const 0 - i32.shl - i32.add - local.get $8 - i32.add - i32.load8_s offset=8 - end - local.get $7 - local.get $2 + local.get $4 + local.get $5 + i32.const 1 + i32.shl + i32.add + i32.load16_s + local.get $5 local.get $3 + local.get $2 call_indirect (type $FUNCSIG$iiii) end - i32.const 0 - i32.ne if + i32.const 1 + local.set $7 + local.get $3 + call $~lib/rt/pure/__release local.get $7 - br $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Int8Array,i8>|inlined.0 + br $~lib/typedarray/SOME<~lib/typedarray/Int16Array,i16>|inlined.0 end - local.get $7 + local.get $5 i32.const 1 i32.add - local.set $7 + local.set $5 br $repeat|0 unreachable end unreachable end - i32.const -1 + i32.const 0 + local.set $6 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 end ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int8Array,i8>~anonymous|1 (; 213 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|1 (; 207 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 24 + i32.const 16 i32.shl - i32.const 24 + i32.const 16 i32.shr_s - i32.const 4 + i32.const 0 i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int8Array,i8> (; 214 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16> (; 208 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) + (local $3 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Int8Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Int16Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 i32.const 2 - i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 57 - call $~lib/typedarray/Int8Array#findIndex - local.set $1 + call $~lib/typedarray/Int16Array#__set local.get $1 i32.const 1 - i32.eq + i32.const 4 + call $~lib/typedarray/Int16Array#__set + local.get $1 + i32.const 2 + i32.const 6 + call $~lib/typedarray/Int16Array#__set + local.get $1 + i32.const 41 + call $~lib/typedarray/Int16Array#some + local.set $2 + local.get $2 + i32.const 0 + i32.ne i32.eqz if - i32.const 624 - i32.const 8 - i32.const 365 + i32.const 0 + i32.const 24 + i32.const 346 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 - i32.const 58 - call $~lib/typedarray/Int8Array#findIndex - local.set $2 - local.get $2 - i32.const -1 - i32.eq + local.get $1 + i32.const 42 + call $~lib/typedarray/Int16Array#some + local.set $3 + local.get $3 + i32.const 0 + i32.ne + i32.eqz i32.eqz if - i32.const 664 - i32.const 8 - i32.const 368 + i32.const 0 + i32.const 24 + i32.const 349 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8Array,u8>~anonymous|0 (; 215 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Uint16Array,u16>~anonymous|0 (; 209 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 255 + i32.const 65535 i32.and i32.const 2 i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Uint8Array#findIndex (; 216 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint16Array#some (; 210 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - block $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Uint8Array,u8>|inlined.0 (result i32) + block $~lib/typedarray/SOME<~lib/typedarray/Uint16Array,u16>|inlined.0 (result i32) local.get $0 - local.set $2 - local.get $1 + call $~lib/rt/pure/__retain local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.10 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 0 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 + local.get $1 + local.set $2 + local.get $3 i32.load offset=4 - local.set $6 + local.set $4 block $break|0 - i32.const 0 - local.set $7 + block + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Uint16Array#get:length + local.set $6 + end loop $repeat|0 - local.get $7 - local.get $4 + local.get $5 + local.get $6 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 3 global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.12 (result i32) - local.get $5 - local.set $10 - local.get $7 - local.set $9 - local.get $6 - local.set $8 - local.get $10 - local.get $9 - i32.const 0 - i32.shl - i32.add - local.get $8 - i32.add - i32.load8_u offset=8 - end - local.get $7 - local.get $2 + local.get $4 + local.get $5 + i32.const 1 + i32.shl + i32.add + i32.load16_u + local.get $5 local.get $3 + local.get $2 call_indirect (type $FUNCSIG$iiii) end - i32.const 0 - i32.ne if + i32.const 1 + local.set $7 + local.get $3 + call $~lib/rt/pure/__release local.get $7 - br $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Uint8Array,u8>|inlined.0 + br $~lib/typedarray/SOME<~lib/typedarray/Uint16Array,u16>|inlined.0 end - local.get $7 + local.get $5 i32.const 1 i32.add - local.set $7 + local.set $5 br $repeat|0 unreachable end unreachable end - i32.const -1 + i32.const 0 + local.set $6 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 end ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8Array,u8>~anonymous|1 (; 217 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Uint16Array,u16>~anonymous|1 (; 211 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 255 + i32.const 65535 i32.and - i32.const 4 + i32.const 0 i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8Array,u8> (; 218 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArraySome<~lib/typedarray/Uint16Array,u16> (; 212 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) + (local $3 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Uint8Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Uint16Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 i32.const 2 - i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 59 - call $~lib/typedarray/Uint8Array#findIndex - local.set $1 + call $~lib/typedarray/Uint16Array#__set local.get $1 i32.const 1 - i32.eq + i32.const 4 + call $~lib/typedarray/Uint16Array#__set + local.get $1 + i32.const 2 + i32.const 6 + call $~lib/typedarray/Uint16Array#__set + local.get $1 + i32.const 43 + call $~lib/typedarray/Uint16Array#some + local.set $2 + local.get $2 + i32.const 0 + i32.ne i32.eqz if - i32.const 624 - i32.const 8 - i32.const 365 + i32.const 0 + i32.const 24 + i32.const 346 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 - i32.const 60 - call $~lib/typedarray/Uint8Array#findIndex - local.set $2 - local.get $2 - i32.const -1 - i32.eq + local.get $1 + i32.const 44 + call $~lib/typedarray/Uint16Array#some + local.set $3 + local.get $3 + i32.const 0 + i32.ne + i32.eqz i32.eqz if - i32.const 664 - i32.const 8 - i32.const 368 + i32.const 0 + i32.const 24 + i32.const 349 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 (; 219 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 (; 213 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 255 - i32.and i32.const 2 i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Uint8ClampedArray#findIndex (; 220 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int32Array#some (; 214 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - block $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Uint8ClampedArray,u8>|inlined.0 (result i32) + block $~lib/typedarray/SOME<~lib/typedarray/Int32Array,i32>|inlined.0 (result i32) local.get $0 - local.set $2 - local.get $1 + call $~lib/rt/pure/__retain local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.11 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 0 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 + local.get $1 + local.set $2 + local.get $3 i32.load offset=4 - local.set $6 + local.set $4 block $break|0 - i32.const 0 - local.set $7 + block + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Int32Array#get:length + local.set $6 + end loop $repeat|0 - local.get $7 - local.get $4 + local.get $5 + local.get $6 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 3 global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.14 (result i32) - local.get $5 - local.set $10 - local.get $7 - local.set $9 - local.get $6 - local.set $8 - local.get $10 - local.get $9 - i32.const 0 - i32.shl - i32.add - local.get $8 - i32.add - i32.load8_u offset=8 - end - local.get $7 - local.get $2 + local.get $4 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $5 local.get $3 + local.get $2 call_indirect (type $FUNCSIG$iiii) end - i32.const 0 - i32.ne if + i32.const 1 + local.set $7 + local.get $3 + call $~lib/rt/pure/__release local.get $7 - br $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Uint8ClampedArray,u8>|inlined.0 + br $~lib/typedarray/SOME<~lib/typedarray/Int32Array,i32>|inlined.0 end - local.get $7 + local.get $5 i32.const 1 i32.add - local.set $7 + local.set $5 br $repeat|0 unreachable end unreachable end - i32.const -1 + i32.const 0 + local.set $6 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 end ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|1 (; 221 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|1 (; 215 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 255 - i32.and - i32.const 4 + i32.const 0 i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8ClampedArray,u8> (; 222 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32> (; 216 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) + (local $3 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Uint8ClampedArray#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Int32Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - i32.const 1 - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 i32.const 2 - i32.const 3 - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 - i32.const 61 - call $~lib/typedarray/Uint8ClampedArray#findIndex - local.set $1 + call $~lib/typedarray/Int32Array#__set local.get $1 i32.const 1 - i32.eq + i32.const 4 + call $~lib/typedarray/Int32Array#__set + local.get $1 + i32.const 2 + i32.const 6 + call $~lib/typedarray/Int32Array#__set + local.get $1 + i32.const 45 + call $~lib/typedarray/Int32Array#some + local.set $2 + local.get $2 + i32.const 0 + i32.ne i32.eqz if - i32.const 624 - i32.const 8 - i32.const 365 + i32.const 0 + i32.const 24 + i32.const 346 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 - i32.const 62 - call $~lib/typedarray/Uint8ClampedArray#findIndex - local.set $2 - local.get $2 - i32.const -1 - i32.eq + local.get $1 + i32.const 46 + call $~lib/typedarray/Int32Array#some + local.set $3 + local.get $3 + i32.const 0 + i32.ne + i32.eqz i32.eqz if - i32.const 664 - i32.const 8 - i32.const 368 + i32.const 0 + i32.const 24 + i32.const 349 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int16Array,i16>~anonymous|0 (; 223 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Uint32Array,u32>~anonymous|0 (; 217 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s i32.const 2 i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Int16Array#findIndex (; 224 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint32Array#some (; 218 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - block $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Int16Array,i16>|inlined.0 (result i32) + block $~lib/typedarray/SOME<~lib/typedarray/Uint32Array,u32>|inlined.0 (result i32) local.get $0 - local.set $2 - local.get $1 + call $~lib/rt/pure/__retain local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.5 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 1 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 + local.get $1 + local.set $2 + local.get $3 i32.load offset=4 - local.set $6 + local.set $4 block $break|0 - i32.const 0 - local.set $7 + block + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Uint32Array#get:length + local.set $6 + end loop $repeat|0 - local.get $7 - local.get $4 + local.get $5 + local.get $6 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 3 global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.7 (result i32) - local.get $5 - local.set $10 - local.get $7 - local.set $9 - local.get $6 - local.set $8 - local.get $10 - local.get $9 - i32.const 1 - i32.shl - i32.add - local.get $8 - i32.add - i32.load16_s offset=8 - end - local.get $7 - local.get $2 + local.get $4 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $5 local.get $3 + local.get $2 call_indirect (type $FUNCSIG$iiii) end - i32.const 0 - i32.ne if + i32.const 1 + local.set $7 + local.get $3 + call $~lib/rt/pure/__release local.get $7 - br $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Int16Array,i16>|inlined.0 + br $~lib/typedarray/SOME<~lib/typedarray/Uint32Array,u32>|inlined.0 end - local.get $7 + local.get $5 i32.const 1 i32.add - local.set $7 + local.set $5 br $repeat|0 unreachable end unreachable end - i32.const -1 + i32.const 0 + local.set $6 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 end ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int16Array,i16>~anonymous|1 (; 225 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Uint32Array,u32>~anonymous|1 (; 219 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - i32.const 4 + i32.const 0 i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int16Array,i16> (; 226 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArraySome<~lib/typedarray/Uint32Array,u32> (; 220 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) + (local $3 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Int16Array#constructor - local.set $0 - local.get $0 - i32.const 0 - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 2 - i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 63 - call $~lib/typedarray/Int16Array#findIndex + call $~lib/typedarray/Uint32Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain local.set $1 local.get $1 + i32.const 0 + i32.const 2 + call $~lib/typedarray/Uint32Array#__set + local.get $1 i32.const 1 - i32.eq + i32.const 4 + call $~lib/typedarray/Uint32Array#__set + local.get $1 + i32.const 2 + i32.const 6 + call $~lib/typedarray/Uint32Array#__set + local.get $1 + i32.const 47 + call $~lib/typedarray/Uint32Array#some + local.set $2 + local.get $2 + i32.const 0 + i32.ne i32.eqz if - i32.const 624 - i32.const 8 - i32.const 365 + i32.const 0 + i32.const 24 + i32.const 346 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 - i32.const 64 - call $~lib/typedarray/Int16Array#findIndex - local.set $2 - local.get $2 - i32.const -1 - i32.eq + local.get $1 + i32.const 48 + call $~lib/typedarray/Uint32Array#some + local.set $3 + local.get $3 + i32.const 0 + i32.ne + i32.eqz i32.eqz if - i32.const 664 - i32.const 8 - i32.const 368 + i32.const 0 + i32.const 24 + i32.const 349 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint16Array,u16>~anonymous|0 (; 227 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|0 (; 221 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 65535 - i32.and - i32.const 2 - i32.eq + i64.const 2 + i64.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Uint16Array#findIndex (; 228 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int64Array#some (; 222 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - block $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Uint16Array,u16>|inlined.0 (result i32) + block $~lib/typedarray/SOME<~lib/typedarray/Int64Array,i64>|inlined.0 (result i32) local.get $0 - local.set $2 - local.get $1 + call $~lib/rt/pure/__retain local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.5 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 1 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 + local.get $1 + local.set $2 + local.get $3 i32.load offset=4 - local.set $6 + local.set $4 block $break|0 - i32.const 0 - local.set $7 + block + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Int64Array#get:length + local.set $6 + end loop $repeat|0 - local.get $7 - local.get $4 + local.get $5 + local.get $6 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 3 global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.7 (result i32) - local.get $5 - local.set $10 - local.get $7 - local.set $9 - local.get $6 - local.set $8 - local.get $10 - local.get $9 - i32.const 1 - i32.shl - i32.add - local.get $8 - i32.add - i32.load16_u offset=8 - end - local.get $7 - local.get $2 + local.get $4 + local.get $5 + i32.const 3 + i32.shl + i32.add + i64.load + local.get $5 local.get $3 - call_indirect (type $FUNCSIG$iiii) + local.get $2 + call_indirect (type $FUNCSIG$ijii) end - i32.const 0 - i32.ne if + i32.const 1 + local.set $7 + local.get $3 + call $~lib/rt/pure/__release local.get $7 - br $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Uint16Array,u16>|inlined.0 + br $~lib/typedarray/SOME<~lib/typedarray/Int64Array,i64>|inlined.0 end - local.get $7 + local.get $5 i32.const 1 i32.add - local.set $7 + local.set $5 br $repeat|0 unreachable end unreachable end - i32.const -1 + i32.const 0 + local.set $6 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 end ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint16Array,u16>~anonymous|1 (; 229 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|1 (; 223 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 65535 - i32.and - i32.const 4 - i32.eq + i64.const 0 + i64.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint16Array,u16> (; 230 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64> (; 224 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) + (local $3 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Uint16Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Int64Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 + i64.const 2 + call $~lib/typedarray/Int64Array#__set + local.get $1 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + i64.const 4 + call $~lib/typedarray/Int64Array#__set + local.get $1 i32.const 2 - i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 65 - call $~lib/typedarray/Uint16Array#findIndex - local.set $1 + i64.const 6 + call $~lib/typedarray/Int64Array#__set local.get $1 - i32.const 1 - i32.eq + i32.const 49 + call $~lib/typedarray/Int64Array#some + local.set $2 + local.get $2 + i32.const 0 + i32.ne i32.eqz if - i32.const 624 - i32.const 8 - i32.const 365 + i32.const 0 + i32.const 24 + i32.const 346 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 - i32.const 66 - call $~lib/typedarray/Uint16Array#findIndex - local.set $2 - local.get $2 - i32.const -1 - i32.eq + local.get $1 + i32.const 50 + call $~lib/typedarray/Int64Array#some + local.set $3 + local.get $3 + i32.const 0 + i32.ne + i32.eqz i32.eqz if - i32.const 664 - i32.const 8 - i32.const 368 + i32.const 0 + i32.const 24 + i32.const 349 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int32Array,i32>~anonymous|0 (; 231 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Uint64Array,u64>~anonymous|0 (; 225 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 2 - i32.eq + i64.const 2 + i64.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Int32Array#findIndex (; 232 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint64Array#some (; 226 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - block $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Int32Array,i32>|inlined.0 (result i32) + block $~lib/typedarray/SOME<~lib/typedarray/Uint64Array,u64>|inlined.0 (result i32) local.get $0 - local.set $2 - local.get $1 + call $~lib/rt/pure/__retain local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.13 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 2 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 + local.get $1 + local.set $2 + local.get $3 i32.load offset=4 - local.set $6 + local.set $4 block $break|0 - i32.const 0 - local.set $7 + block + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Uint64Array#get:length + local.set $6 + end loop $repeat|0 - local.get $7 - local.get $4 + local.get $5 + local.get $6 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 3 global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.8 (result i32) - local.get $5 - local.set $10 - local.get $7 - local.set $9 - local.get $6 - local.set $8 - local.get $10 - local.get $9 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.add - i32.load offset=8 - end - local.get $7 - local.get $2 + local.get $4 + local.get $5 + i32.const 3 + i32.shl + i32.add + i64.load + local.get $5 local.get $3 - call_indirect (type $FUNCSIG$iiii) + local.get $2 + call_indirect (type $FUNCSIG$ijii) end - i32.const 0 - i32.ne if + i32.const 1 + local.set $7 + local.get $3 + call $~lib/rt/pure/__release local.get $7 - br $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Int32Array,i32>|inlined.0 + br $~lib/typedarray/SOME<~lib/typedarray/Uint64Array,u64>|inlined.0 end - local.get $7 + local.get $5 i32.const 1 i32.add - local.set $7 + local.set $5 br $repeat|0 unreachable end unreachable end - i32.const -1 + i32.const 0 + local.set $6 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 end ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int32Array,i32>~anonymous|1 (; 233 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Uint64Array,u64>~anonymous|1 (; 227 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 4 - i32.eq + i64.const 0 + i64.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int32Array,i32> (; 234 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArraySome<~lib/typedarray/Uint64Array,u64> (; 228 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) + (local $3 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Int32Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Uint64Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 + i64.const 2 + call $~lib/typedarray/Uint64Array#__set + local.get $1 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + i64.const 4 + call $~lib/typedarray/Uint64Array#__set + local.get $1 i32.const 2 - i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 67 - call $~lib/typedarray/Int32Array#findIndex - local.set $1 + i64.const 6 + call $~lib/typedarray/Uint64Array#__set local.get $1 - i32.const 1 - i32.eq + i32.const 51 + call $~lib/typedarray/Uint64Array#some + local.set $2 + local.get $2 + i32.const 0 + i32.ne i32.eqz if - i32.const 624 - i32.const 8 - i32.const 365 + i32.const 0 + i32.const 24 + i32.const 346 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 - i32.const 68 - call $~lib/typedarray/Int32Array#findIndex - local.set $2 - local.get $2 - i32.const -1 - i32.eq + local.get $1 + i32.const 52 + call $~lib/typedarray/Uint64Array#some + local.set $3 + local.get $3 + i32.const 0 + i32.ne + i32.eqz i32.eqz if - i32.const 664 - i32.const 8 - i32.const 368 + i32.const 0 + i32.const 24 + i32.const 349 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint32Array,u32>~anonymous|0 (; 235 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|0 (; 229 ;) (type $FUNCSIG$ifii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 2 - i32.eq + f32.const 2 + f32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Uint32Array#findIndex (; 236 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Float32Array#some (; 230 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - block $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Uint32Array,u32>|inlined.0 (result i32) + block $~lib/typedarray/SOME<~lib/typedarray/Float32Array,f32>|inlined.0 (result i32) local.get $0 - local.set $2 - local.get $1 + call $~lib/rt/pure/__retain local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.5 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 2 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 + local.get $1 + local.set $2 + local.get $3 i32.load offset=4 - local.set $6 + local.set $4 block $break|0 - i32.const 0 - local.set $7 + block + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Float32Array#get:length + local.set $6 + end loop $repeat|0 - local.get $7 - local.get $4 + local.get $5 + local.get $6 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 3 global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.7 (result i32) - local.get $5 - local.set $10 - local.get $7 - local.set $9 - local.get $6 - local.set $8 - local.get $10 - local.get $9 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.add - i32.load offset=8 - end - local.get $7 - local.get $2 + local.get $4 + local.get $5 + i32.const 2 + i32.shl + i32.add + f32.load + local.get $5 local.get $3 - call_indirect (type $FUNCSIG$iiii) + local.get $2 + call_indirect (type $FUNCSIG$ifii) end - i32.const 0 - i32.ne if + i32.const 1 + local.set $7 + local.get $3 + call $~lib/rt/pure/__release local.get $7 - br $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Uint32Array,u32>|inlined.0 + br $~lib/typedarray/SOME<~lib/typedarray/Float32Array,f32>|inlined.0 end - local.get $7 + local.get $5 i32.const 1 i32.add - local.set $7 + local.set $5 br $repeat|0 unreachable end unreachable end - i32.const -1 + i32.const 0 + local.set $6 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 end ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint32Array,u32>~anonymous|1 (; 237 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|1 (; 231 ;) (type $FUNCSIG$ifii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 4 - i32.eq + f32.const 0 + f32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint32Array,u32> (; 238 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32> (; 232 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) + (local $3 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Uint32Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Float32Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 + f32.const 2 + call $~lib/typedarray/Float32Array#__set + local.get $1 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + f32.const 4 + call $~lib/typedarray/Float32Array#__set + local.get $1 i32.const 2 - i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 69 - call $~lib/typedarray/Uint32Array#findIndex - local.set $1 + f32.const 6 + call $~lib/typedarray/Float32Array#__set local.get $1 - i32.const 1 - i32.eq + i32.const 53 + call $~lib/typedarray/Float32Array#some + local.set $2 + local.get $2 + i32.const 0 + i32.ne i32.eqz if - i32.const 624 - i32.const 8 - i32.const 365 + i32.const 0 + i32.const 24 + i32.const 346 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 - i32.const 70 - call $~lib/typedarray/Uint32Array#findIndex - local.set $2 - local.get $2 - i32.const -1 - i32.eq + local.get $1 + i32.const 54 + call $~lib/typedarray/Float32Array#some + local.set $3 + local.get $3 + i32.const 0 + i32.ne + i32.eqz i32.eqz if - i32.const 664 - i32.const 8 - i32.const 368 + i32.const 0 + i32.const 24 + i32.const 349 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int64Array,i64>~anonymous|0 (; 239 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|0 (; 233 ;) (type $FUNCSIG$idii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i64.const 2 - i64.eq + f64.const 2 + f64.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Int64Array#findIndex (; 240 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Float64Array#some (; 234 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - block $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Int64Array,i64>|inlined.0 (result i32) + block $~lib/typedarray/SOME<~lib/typedarray/Float64Array,f64>|inlined.0 (result i32) local.get $0 - local.set $2 - local.get $1 + call $~lib/rt/pure/__retain local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.5 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 3 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 + local.get $1 + local.set $2 + local.get $3 i32.load offset=4 - local.set $6 + local.set $4 block $break|0 - i32.const 0 - local.set $7 + block + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Float64Array#get:length + local.set $6 + end loop $repeat|0 - local.get $7 - local.get $4 + local.get $5 + local.get $6 i32.lt_s - i32.eqz - br_if $break|0 - block (result i32) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.7 (result i64) - local.get $5 - local.set $10 - local.get $7 - local.set $9 - local.get $6 - local.set $8 - local.get $10 - local.get $9 - i32.const 3 - i32.shl - i32.add - local.get $8 - i32.add - i64.load offset=8 - end - local.get $7 - local.get $2 + i32.eqz + br_if $break|0 + block (result i32) + i32.const 3 + global.set $~lib/argc + local.get $4 + local.get $5 + i32.const 3 + i32.shl + i32.add + f64.load + local.get $5 local.get $3 - call_indirect (type $FUNCSIG$ijii) + local.get $2 + call_indirect (type $FUNCSIG$idii) end - i32.const 0 - i32.ne if + i32.const 1 + local.set $7 + local.get $3 + call $~lib/rt/pure/__release local.get $7 - br $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Int64Array,i64>|inlined.0 + br $~lib/typedarray/SOME<~lib/typedarray/Float64Array,f64>|inlined.0 end - local.get $7 + local.get $5 i32.const 1 i32.add - local.set $7 + local.set $5 br $repeat|0 unreachable end unreachable end - i32.const -1 + i32.const 0 + local.set $6 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 end ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int64Array,i64>~anonymous|1 (; 241 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|1 (; 235 ;) (type $FUNCSIG$idii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i64.const 4 - i64.eq + f64.const 0 + f64.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int64Array,i64> (; 242 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64> (; 236 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) + (local $3 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Int64Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Float64Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - i64.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + f64.const 2 + call $~lib/typedarray/Float64Array#__set + local.get $1 i32.const 1 - i64.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + f64.const 4 + call $~lib/typedarray/Float64Array#__set + local.get $1 i32.const 2 - i64.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 71 - call $~lib/typedarray/Int64Array#findIndex - local.set $1 + f64.const 6 + call $~lib/typedarray/Float64Array#__set local.get $1 - i32.const 1 - i32.eq + i32.const 55 + call $~lib/typedarray/Float64Array#some + local.set $2 + local.get $2 + i32.const 0 + i32.ne i32.eqz if - i32.const 624 - i32.const 8 - i32.const 365 + i32.const 0 + i32.const 24 + i32.const 346 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 - i32.const 72 - call $~lib/typedarray/Int64Array#findIndex - local.set $2 - local.get $2 - i32.const -1 - i32.eq + local.get $1 + i32.const 56 + call $~lib/typedarray/Float64Array#some + local.set $3 + local.get $3 + i32.const 0 + i32.ne + i32.eqz i32.eqz if - i32.const 664 - i32.const 8 - i32.const 368 + i32.const 0 + i32.const 24 + i32.const 349 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint64Array,u64>~anonymous|0 (; 243 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int8Array,i8>~anonymous|0 (; 237 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i64.const 2 - i64.eq + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.const 2 + i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Uint64Array#findIndex (; 244 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int8Array#findIndex (; 238 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - block $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Uint64Array,u64>|inlined.0 (result i32) + block $~lib/typedarray/FIND_INDEX<~lib/typedarray/Int8Array,i8>|inlined.0 (result i32) local.get $0 - local.set $2 - local.get $1 + call $~lib/rt/pure/__retain local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.5 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 3 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 + local.get $1 + local.set $2 + local.get $3 i32.load offset=4 - local.set $6 + local.set $4 block $break|0 - i32.const 0 - local.set $7 + block + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Int8Array#get:length + local.set $6 + end loop $repeat|0 - local.get $7 - local.get $4 + local.get $5 + local.get $6 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 3 global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.7 (result i64) - local.get $5 - local.set $10 - local.get $7 - local.set $9 - local.get $6 - local.set $8 - local.get $10 - local.get $9 - i32.const 3 - i32.shl - i32.add - local.get $8 - i32.add - i64.load offset=8 - end - local.get $7 - local.get $2 + local.get $4 + local.get $5 + i32.const 0 + i32.shl + i32.add + i32.load8_s + local.get $5 local.get $3 - call_indirect (type $FUNCSIG$ijii) + local.get $2 + call_indirect (type $FUNCSIG$iiii) end - i32.const 0 - i32.ne if + local.get $5 + local.set $7 + local.get $3 + call $~lib/rt/pure/__release local.get $7 - br $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Uint64Array,u64>|inlined.0 + br $~lib/typedarray/FIND_INDEX<~lib/typedarray/Int8Array,i8>|inlined.0 end - local.get $7 + local.get $5 i32.const 1 i32.add - local.set $7 + local.set $5 br $repeat|0 unreachable end unreachable end i32.const -1 + local.set $6 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 end ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint64Array,u64>~anonymous|1 (; 245 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int8Array,i8>~anonymous|1 (; 239 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i64.const 4 - i64.eq + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.const 4 + i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint64Array,u64> (; 246 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int8Array,i8> (; 240 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) + (local $3 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Uint64Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Int8Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - i64.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 i32.const 1 - i64.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + call $~lib/typedarray/Int8Array#__set + local.get $1 + i32.const 1 i32.const 2 - i64.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 73 - call $~lib/typedarray/Uint64Array#findIndex - local.set $1 + call $~lib/typedarray/Int8Array#__set local.get $1 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Int8Array#__set + local.get $1 + i32.const 57 + call $~lib/typedarray/Int8Array#findIndex + local.set $2 + local.get $2 i32.const 1 i32.eq i32.eqz if - i32.const 624 - i32.const 8 - i32.const 365 + i32.const 976 + i32.const 24 + i32.const 376 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 - i32.const 74 - call $~lib/typedarray/Uint64Array#findIndex - local.set $2 - local.get $2 + local.get $1 + i32.const 58 + call $~lib/typedarray/Int8Array#findIndex + local.set $3 + local.get $3 i32.const -1 i32.eq i32.eqz if - i32.const 664 - i32.const 8 - i32.const 368 + i32.const 1024 + i32.const 24 + i32.const 379 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Float32Array,f32>~anonymous|0 (; 247 ;) (type $FUNCSIG$ifii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8Array,u8>~anonymous|0 (; 241 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - f32.const 2 - f32.eq + i32.const 255 + i32.and + i32.const 2 + i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Float32Array#findIndex (; 248 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint8Array#findIndex (; 242 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - block $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Float32Array,f32>|inlined.0 (result i32) + block $~lib/typedarray/FIND_INDEX<~lib/typedarray/Uint8Array,u8>|inlined.0 (result i32) local.get $0 - local.set $2 - local.get $1 + call $~lib/rt/pure/__retain local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.5 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 2 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 + local.get $1 + local.set $2 + local.get $3 i32.load offset=4 - local.set $6 - block $break|0 - i32.const 0 - local.set $7 + local.set $4 + block $break|0 + block + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Uint8Array#get:length + local.set $6 + end loop $repeat|0 - local.get $7 - local.get $4 + local.get $5 + local.get $6 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 3 global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.7 (result f32) - local.get $5 - local.set $10 - local.get $7 - local.set $9 - local.get $6 - local.set $8 - local.get $10 - local.get $9 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.add - f32.load offset=8 - end - local.get $7 - local.get $2 + local.get $4 + local.get $5 + i32.const 0 + i32.shl + i32.add + i32.load8_u + local.get $5 local.get $3 - call_indirect (type $FUNCSIG$ifii) + local.get $2 + call_indirect (type $FUNCSIG$iiii) end - i32.const 0 - i32.ne if + local.get $5 + local.set $7 + local.get $3 + call $~lib/rt/pure/__release local.get $7 - br $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Float32Array,f32>|inlined.0 + br $~lib/typedarray/FIND_INDEX<~lib/typedarray/Uint8Array,u8>|inlined.0 end - local.get $7 + local.get $5 i32.const 1 i32.add - local.set $7 + local.set $5 br $repeat|0 unreachable end unreachable end i32.const -1 + local.set $6 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 end ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Float32Array,f32>~anonymous|1 (; 249 ;) (type $FUNCSIG$ifii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8Array,u8>~anonymous|1 (; 243 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - f32.const 4 - f32.eq + i32.const 255 + i32.and + i32.const 4 + i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Float32Array,f32> (; 250 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8Array,u8> (; 244 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) + (local $3 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Float32Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Uint8Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - f32.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 i32.const 1 - f32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + call $~lib/typedarray/Uint8Array#__set + local.get $1 + i32.const 1 i32.const 2 - f32.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 75 - call $~lib/typedarray/Float32Array#findIndex - local.set $1 + call $~lib/typedarray/Uint8Array#__set + local.get $1 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Uint8Array#__set local.get $1 + i32.const 59 + call $~lib/typedarray/Uint8Array#findIndex + local.set $2 + local.get $2 i32.const 1 i32.eq i32.eqz if - i32.const 624 - i32.const 8 - i32.const 365 + i32.const 976 + i32.const 24 + i32.const 376 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 - i32.const 76 - call $~lib/typedarray/Float32Array#findIndex - local.set $2 - local.get $2 + local.get $1 + i32.const 60 + call $~lib/typedarray/Uint8Array#findIndex + local.set $3 + local.get $3 i32.const -1 i32.eq i32.eqz if - i32.const 664 - i32.const 8 - i32.const 368 + i32.const 1024 + i32.const 24 + i32.const 379 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Float64Array,f64>~anonymous|0 (; 251 ;) (type $FUNCSIG$idii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 (; 245 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - f64.const 2 - f64.eq + i32.const 255 + i32.and + i32.const 2 + i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Float64Array#findIndex (; 252 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint8ClampedArray#findIndex (; 246 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - block $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Float64Array,f64>|inlined.0 (result i32) + block $~lib/typedarray/FIND_INDEX<~lib/typedarray/Uint8ClampedArray,u8>|inlined.0 (result i32) local.get $0 - local.set $2 - local.get $1 + call $~lib/rt/pure/__retain local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.8 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 3 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 + local.get $1 + local.set $2 + local.get $3 i32.load offset=4 - local.set $6 + local.set $4 block $break|0 - i32.const 0 - local.set $7 + block + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Uint8ClampedArray#get:length + local.set $6 + end loop $repeat|0 - local.get $7 - local.get $4 + local.get $5 + local.get $6 i32.lt_s i32.eqz br_if $break|0 block (result i32) i32.const 3 global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.19 (result f64) - local.get $5 - local.set $10 - local.get $7 - local.set $9 - local.get $6 - local.set $8 - local.get $10 - local.get $9 - i32.const 3 - i32.shl - i32.add - local.get $8 - i32.add - f64.load offset=8 - end - local.get $7 - local.get $2 + local.get $4 + local.get $5 + i32.const 0 + i32.shl + i32.add + i32.load8_u + local.get $5 local.get $3 - call_indirect (type $FUNCSIG$idii) + local.get $2 + call_indirect (type $FUNCSIG$iiii) end - i32.const 0 - i32.ne if + local.get $5 + local.set $7 + local.get $3 + call $~lib/rt/pure/__release local.get $7 - br $~lib/internal/typedarray/FIND_INDEX<~lib/typedarray/Float64Array,f64>|inlined.0 + br $~lib/typedarray/FIND_INDEX<~lib/typedarray/Uint8ClampedArray,u8>|inlined.0 end - local.get $7 + local.get $5 i32.const 1 i32.add - local.set $7 + local.set $5 br $repeat|0 unreachable end unreachable end i32.const -1 + local.set $6 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 end ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Float64Array,f64>~anonymous|1 (; 253 ;) (type $FUNCSIG$idii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|1 (; 247 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - f64.const 4 - f64.eq + i32.const 255 + i32.and + i32.const 4 + i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Float64Array,f64> (; 254 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8ClampedArray,u8> (; 248 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) + (local $3 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Float64Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Uint8ClampedArray#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - f64.const 1 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 i32.const 1 - f64.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $1 + i32.const 1 i32.const 2 - f64.const 3 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 77 - call $~lib/typedarray/Float64Array#findIndex - local.set $1 + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $1 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Uint8ClampedArray#__set local.get $1 + i32.const 61 + call $~lib/typedarray/Uint8ClampedArray#findIndex + local.set $2 + local.get $2 i32.const 1 i32.eq i32.eqz if - i32.const 624 - i32.const 8 - i32.const 365 + i32.const 976 + i32.const 24 + i32.const 376 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 - i32.const 78 - call $~lib/typedarray/Float64Array#findIndex - local.set $2 - local.get $2 + local.get $1 + i32.const 62 + call $~lib/typedarray/Uint8ClampedArray#findIndex + local.set $3 + local.get $3 i32.const -1 i32.eq i32.eqz if - i32.const 664 - i32.const 8 - i32.const 368 + i32.const 1024 + i32.const 24 + i32.const 379 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Int8Array,i8>~anonymous|0 (; 255 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int16Array,i16>~anonymous|0 (; 249 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 24 + i32.const 16 i32.shl - i32.const 24 + i32.const 16 i32.shr_s i32.const 2 - i32.rem_s - i32.const 0 i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Int8Array#every (; 256 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int16Array#findIndex (; 250 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - block $~lib/internal/typedarray/EVERY<~lib/typedarray/Int8Array,i8>|inlined.0 (result i32) + block $~lib/typedarray/FIND_INDEX<~lib/typedarray/Int16Array,i16>|inlined.0 (result i32) local.get $0 - local.set $2 - local.get $1 - local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.15 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 0 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 + local.set $2 + local.get $3 i32.load offset=4 - local.set $6 + local.set $4 block $break|0 - i32.const 0 - local.set $7 + block + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Int16Array#get:length + local.set $6 + end loop $repeat|0 - block $continue|0 - local.get $7 + local.get $5 + local.get $6 + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + i32.const 3 + global.set $~lib/argc local.get $4 - i32.lt_s - i32.eqz - br_if $break|0 - block - block (result i32) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.10 (result i32) - local.get $5 - local.set $10 - local.get $7 - local.set $9 - local.get $6 - local.set $8 - local.get $10 - local.get $9 - i32.const 0 - i32.shl - i32.add - local.get $8 - i32.add - i32.load8_s offset=8 - end - local.get $7 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$iiii) - end - i32.const 0 - i32.ne - if - br $continue|0 - end - i32.const 0 - br $~lib/internal/typedarray/EVERY<~lib/typedarray/Int8Array,i8>|inlined.0 - unreachable - end - unreachable + local.get $5 + i32.const 1 + i32.shl + i32.add + i32.load16_s + local.get $5 + local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$iiii) end - local.get $7 + if + local.get $5 + local.set $7 + local.get $3 + call $~lib/rt/pure/__release + local.get $7 + br $~lib/typedarray/FIND_INDEX<~lib/typedarray/Int16Array,i16>|inlined.0 + end + local.get $5 i32.const 1 i32.add - local.set $7 + local.set $5 br $repeat|0 unreachable end unreachable end - i32.const 1 + i32.const -1 + local.set $6 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 end ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Int8Array,i8>~anonymous|1 (; 257 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int16Array,i16>~anonymous|1 (; 251 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 24 + i32.const 16 i32.shl - i32.const 24 + i32.const 16 i32.shr_s - i32.const 2 + i32.const 4 i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Int8Array,i8> (; 258 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int16Array,i16> (; 252 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) + (local $3 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Int8Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Int16Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 i32.const 1 - i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + call $~lib/typedarray/Int16Array#__set + local.get $1 + i32.const 1 i32.const 2 - i32.const 6 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 79 - call $~lib/typedarray/Int8Array#every - local.set $1 + call $~lib/typedarray/Int16Array#__set local.get $1 - i32.const 0 - i32.ne + i32.const 2 + i32.const 3 + call $~lib/typedarray/Int16Array#__set + local.get $1 + i32.const 63 + call $~lib/typedarray/Int16Array#findIndex + local.set $2 + local.get $2 + i32.const 1 + i32.eq i32.eqz if - i32.const 0 - i32.const 8 - i32.const 395 + i32.const 976 + i32.const 24 + i32.const 376 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 - i32.const 80 - call $~lib/typedarray/Int8Array#every - local.set $2 - local.get $2 - i32.const 0 - i32.ne - i32.eqz + local.get $1 + i32.const 64 + call $~lib/typedarray/Int16Array#findIndex + local.set $3 + local.get $3 + i32.const -1 + i32.eq i32.eqz if - i32.const 0 - i32.const 8 - i32.const 398 + i32.const 1024 + i32.const 24 + i32.const 379 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8>~anonymous|0 (; 259 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint16Array,u16>~anonymous|0 (; 253 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 255 + i32.const 65535 i32.and i32.const 2 - i32.rem_u - i32.const 0 i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Uint8Array#every (; 260 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint16Array#findIndex (; 254 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - block $~lib/internal/typedarray/EVERY<~lib/typedarray/Uint8Array,u8>|inlined.0 (result i32) + block $~lib/typedarray/FIND_INDEX<~lib/typedarray/Uint16Array,u16>|inlined.0 (result i32) local.get $0 - local.set $2 - local.get $1 + call $~lib/rt/pure/__retain local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.12 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 0 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 + local.get $1 + local.set $2 + local.get $3 i32.load offset=4 - local.set $6 + local.set $4 block $break|0 - i32.const 0 - local.set $7 + block + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Uint16Array#get:length + local.set $6 + end loop $repeat|0 - block $continue|0 - local.get $7 + local.get $5 + local.get $6 + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + i32.const 3 + global.set $~lib/argc local.get $4 - i32.lt_s - i32.eqz - br_if $break|0 - block - block (result i32) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.16 (result i32) - local.get $5 - local.set $10 - local.get $7 - local.set $9 - local.get $6 - local.set $8 - local.get $10 - local.get $9 - i32.const 0 - i32.shl - i32.add - local.get $8 - i32.add - i32.load8_u offset=8 - end - local.get $7 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$iiii) - end - i32.const 0 - i32.ne - if - br $continue|0 - end - i32.const 0 - br $~lib/internal/typedarray/EVERY<~lib/typedarray/Uint8Array,u8>|inlined.0 - unreachable - end - unreachable + local.get $5 + i32.const 1 + i32.shl + i32.add + i32.load16_u + local.get $5 + local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$iiii) end - local.get $7 + if + local.get $5 + local.set $7 + local.get $3 + call $~lib/rt/pure/__release + local.get $7 + br $~lib/typedarray/FIND_INDEX<~lib/typedarray/Uint16Array,u16>|inlined.0 + end + local.get $5 i32.const 1 i32.add - local.set $7 + local.set $5 br $repeat|0 unreachable end unreachable end - i32.const 1 + i32.const -1 + local.set $6 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 end ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8>~anonymous|1 (; 261 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint16Array,u16>~anonymous|1 (; 255 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 255 + i32.const 65535 i32.and - i32.const 2 + i32.const 4 i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8> (; 262 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint16Array,u16> (; 256 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) + (local $3 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Uint8Array#constructor - local.set $0 - local.get $0 - i32.const 0 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 1 - i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 2 - i32.const 6 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 81 - call $~lib/typedarray/Uint8Array#every + call $~lib/typedarray/Uint16Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain local.set $1 local.get $1 i32.const 0 - i32.ne + i32.const 1 + call $~lib/typedarray/Uint16Array#__set + local.get $1 + i32.const 1 + i32.const 2 + call $~lib/typedarray/Uint16Array#__set + local.get $1 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Uint16Array#__set + local.get $1 + i32.const 65 + call $~lib/typedarray/Uint16Array#findIndex + local.set $2 + local.get $2 + i32.const 1 + i32.eq i32.eqz if - i32.const 0 - i32.const 8 - i32.const 395 + i32.const 976 + i32.const 24 + i32.const 376 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 - i32.const 82 - call $~lib/typedarray/Uint8Array#every - local.set $2 - local.get $2 - i32.const 0 - i32.ne - i32.eqz + local.get $1 + i32.const 66 + call $~lib/typedarray/Uint16Array#findIndex + local.set $3 + local.get $3 + i32.const -1 + i32.eq i32.eqz if - i32.const 0 - i32.const 8 - i32.const 398 + i32.const 1024 + i32.const 24 + i32.const 379 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 (; 263 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int32Array,i32>~anonymous|0 (; 257 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 255 - i32.and i32.const 2 - i32.rem_u - i32.const 0 i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Uint8ClampedArray#every (; 264 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int32Array#findIndex (; 258 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - block $~lib/internal/typedarray/EVERY<~lib/typedarray/Uint8ClampedArray,u8>|inlined.0 (result i32) + block $~lib/typedarray/FIND_INDEX<~lib/typedarray/Int32Array,i32>|inlined.0 (result i32) local.get $0 - local.set $2 - local.get $1 + call $~lib/rt/pure/__retain local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.13 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 0 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 + local.get $1 + local.set $2 + local.get $3 i32.load offset=4 - local.set $6 + local.set $4 block $break|0 - i32.const 0 - local.set $7 + block + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Int32Array#get:length + local.set $6 + end loop $repeat|0 - block $continue|0 - local.get $7 + local.get $5 + local.get $6 + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + i32.const 3 + global.set $~lib/argc local.get $4 - i32.lt_s - i32.eqz - br_if $break|0 - block - block (result i32) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.18 (result i32) - local.get $5 - local.set $10 - local.get $7 - local.set $9 - local.get $6 - local.set $8 - local.get $10 - local.get $9 - i32.const 0 - i32.shl - i32.add - local.get $8 - i32.add - i32.load8_u offset=8 - end - local.get $7 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$iiii) - end - i32.const 0 - i32.ne - if - br $continue|0 - end - i32.const 0 - br $~lib/internal/typedarray/EVERY<~lib/typedarray/Uint8ClampedArray,u8>|inlined.0 - unreachable - end - unreachable + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $5 + local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$iiii) end - local.get $7 + if + local.get $5 + local.set $7 + local.get $3 + call $~lib/rt/pure/__release + local.get $7 + br $~lib/typedarray/FIND_INDEX<~lib/typedarray/Int32Array,i32>|inlined.0 + end + local.get $5 i32.const 1 i32.add - local.set $7 + local.set $5 br $repeat|0 unreachable end unreachable end - i32.const 1 + i32.const -1 + local.set $6 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 end ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|1 (; 265 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int32Array,i32>~anonymous|1 (; 259 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 255 - i32.and - i32.const 2 + i32.const 4 i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint8ClampedArray,u8> (; 266 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int32Array,i32> (; 260 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) + (local $3 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Uint8ClampedArray#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Int32Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - i32.const 2 - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 i32.const 1 - i32.const 4 - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 + call $~lib/typedarray/Int32Array#__set + local.get $1 + i32.const 1 i32.const 2 - i32.const 6 - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 - i32.const 83 - call $~lib/typedarray/Uint8ClampedArray#every - local.set $1 + call $~lib/typedarray/Int32Array#__set local.get $1 - i32.const 0 - i32.ne + i32.const 2 + i32.const 3 + call $~lib/typedarray/Int32Array#__set + local.get $1 + i32.const 67 + call $~lib/typedarray/Int32Array#findIndex + local.set $2 + local.get $2 + i32.const 1 + i32.eq i32.eqz if - i32.const 0 - i32.const 8 - i32.const 395 + i32.const 976 + i32.const 24 + i32.const 376 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 - i32.const 84 - call $~lib/typedarray/Uint8ClampedArray#every - local.set $2 - local.get $2 - i32.const 0 - i32.ne - i32.eqz + local.get $1 + i32.const 68 + call $~lib/typedarray/Int32Array#findIndex + local.set $3 + local.get $3 + i32.const -1 + i32.eq i32.eqz if - i32.const 0 - i32.const 8 - i32.const 398 + i32.const 1024 + i32.const 24 + i32.const 379 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Int16Array,i16>~anonymous|0 (; 267 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint32Array,u32>~anonymous|0 (; 261 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s i32.const 2 - i32.rem_s - i32.const 0 i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Int16Array#every (; 268 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint32Array#findIndex (; 262 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - block $~lib/internal/typedarray/EVERY<~lib/typedarray/Int16Array,i16>|inlined.0 (result i32) + block $~lib/typedarray/FIND_INDEX<~lib/typedarray/Uint32Array,u32>|inlined.0 (result i32) local.get $0 - local.set $2 - local.get $1 + call $~lib/rt/pure/__retain local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.6 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 1 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 + local.get $1 + local.set $2 + local.get $3 i32.load offset=4 - local.set $6 + local.set $4 block $break|0 - i32.const 0 - local.set $7 + block + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Uint32Array#get:length + local.set $6 + end loop $repeat|0 - block $continue|0 + local.get $5 + local.get $6 + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + i32.const 3 + global.set $~lib/argc + local.get $4 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $5 + local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$iiii) + end + if + local.get $5 + local.set $7 + local.get $3 + call $~lib/rt/pure/__release local.get $7 - local.get $4 - i32.lt_s - i32.eqz - br_if $break|0 - block - block (result i32) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.9 (result i32) - local.get $5 - local.set $10 - local.get $7 - local.set $9 - local.get $6 - local.set $8 - local.get $10 - local.get $9 - i32.const 1 - i32.shl - i32.add - local.get $8 - i32.add - i32.load16_s offset=8 - end - local.get $7 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$iiii) - end - i32.const 0 - i32.ne - if - br $continue|0 - end - i32.const 0 - br $~lib/internal/typedarray/EVERY<~lib/typedarray/Int16Array,i16>|inlined.0 - unreachable - end - unreachable + br $~lib/typedarray/FIND_INDEX<~lib/typedarray/Uint32Array,u32>|inlined.0 end - local.get $7 + local.get $5 i32.const 1 i32.add - local.set $7 + local.set $5 br $repeat|0 unreachable end unreachable end - i32.const 1 + i32.const -1 + local.set $6 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 end ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Int16Array,i16>~anonymous|1 (; 269 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint32Array,u32>~anonymous|1 (; 263 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - i32.const 2 + i32.const 4 i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Int16Array,i16> (; 270 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint32Array,u32> (; 264 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) + (local $3 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Int16Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Uint32Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 i32.const 1 - i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + call $~lib/typedarray/Uint32Array#__set + local.get $1 + i32.const 1 i32.const 2 - i32.const 6 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 85 - call $~lib/typedarray/Int16Array#every - local.set $1 + call $~lib/typedarray/Uint32Array#__set local.get $1 - i32.const 0 - i32.ne + i32.const 2 + i32.const 3 + call $~lib/typedarray/Uint32Array#__set + local.get $1 + i32.const 69 + call $~lib/typedarray/Uint32Array#findIndex + local.set $2 + local.get $2 + i32.const 1 + i32.eq i32.eqz if - i32.const 0 - i32.const 8 - i32.const 395 + i32.const 976 + i32.const 24 + i32.const 376 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 - i32.const 86 - call $~lib/typedarray/Int16Array#every - local.set $2 - local.get $2 - i32.const 0 - i32.ne - i32.eqz + local.get $1 + i32.const 70 + call $~lib/typedarray/Uint32Array#findIndex + local.set $3 + local.get $3 + i32.const -1 + i32.eq i32.eqz if - i32.const 0 - i32.const 8 - i32.const 398 + i32.const 1024 + i32.const 24 + i32.const 379 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint16Array,u16>~anonymous|0 (; 271 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int64Array,i64>~anonymous|0 (; 265 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 65535 - i32.and - i32.const 2 - i32.rem_u - i32.const 0 - i32.eq + i64.const 2 + i64.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Uint16Array#every (; 272 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int64Array#findIndex (; 266 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - block $~lib/internal/typedarray/EVERY<~lib/typedarray/Uint16Array,u16>|inlined.0 (result i32) + block $~lib/typedarray/FIND_INDEX<~lib/typedarray/Int64Array,i64>|inlined.0 (result i32) local.get $0 - local.set $2 - local.get $1 + call $~lib/rt/pure/__retain local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.6 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 1 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 + local.get $1 + local.set $2 + local.get $3 i32.load offset=4 - local.set $6 + local.set $4 block $break|0 - i32.const 0 - local.set $7 + block + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Int64Array#get:length + local.set $6 + end loop $repeat|0 - block $continue|0 - local.get $7 + local.get $5 + local.get $6 + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + i32.const 3 + global.set $~lib/argc local.get $4 - i32.lt_s - i32.eqz - br_if $break|0 - block - block (result i32) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.9 (result i32) - local.get $5 - local.set $10 - local.get $7 - local.set $9 - local.get $6 - local.set $8 - local.get $10 - local.get $9 - i32.const 1 - i32.shl - i32.add - local.get $8 - i32.add - i32.load16_u offset=8 - end - local.get $7 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$iiii) - end - i32.const 0 - i32.ne - if - br $continue|0 - end - i32.const 0 - br $~lib/internal/typedarray/EVERY<~lib/typedarray/Uint16Array,u16>|inlined.0 - unreachable - end - unreachable + local.get $5 + i32.const 3 + i32.shl + i32.add + i64.load + local.get $5 + local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$ijii) end - local.get $7 + if + local.get $5 + local.set $7 + local.get $3 + call $~lib/rt/pure/__release + local.get $7 + br $~lib/typedarray/FIND_INDEX<~lib/typedarray/Int64Array,i64>|inlined.0 + end + local.get $5 i32.const 1 i32.add - local.set $7 + local.set $5 br $repeat|0 unreachable end unreachable end - i32.const 1 + i32.const -1 + local.set $6 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 end ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint16Array,u16>~anonymous|1 (; 273 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int64Array,i64>~anonymous|1 (; 267 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 65535 - i32.and - i32.const 2 - i32.eq + i64.const 4 + i64.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint16Array,u16> (; 274 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int64Array,i64> (; 268 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) + (local $3 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Uint16Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Int64Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + i64.const 1 + call $~lib/typedarray/Int64Array#__set + local.get $1 i32.const 1 - i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + i64.const 2 + call $~lib/typedarray/Int64Array#__set + local.get $1 i32.const 2 - i32.const 6 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 87 - call $~lib/typedarray/Uint16Array#every - local.set $1 + i64.const 3 + call $~lib/typedarray/Int64Array#__set local.get $1 - i32.const 0 - i32.ne - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 395 - i32.const 2 - call $~lib/env/abort - unreachable - end - local.get $0 - i32.const 88 - call $~lib/typedarray/Uint16Array#every + i32.const 71 + call $~lib/typedarray/Int64Array#findIndex local.set $2 - local.get $2 - i32.const 0 - i32.ne + local.get $2 + i32.const 1 + i32.eq i32.eqz + if + i32.const 976 + i32.const 24 + i32.const 376 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 72 + call $~lib/typedarray/Int64Array#findIndex + local.set $3 + local.get $3 + i32.const -1 + i32.eq i32.eqz if - i32.const 0 - i32.const 8 - i32.const 398 + i32.const 1024 + i32.const 24 + i32.const 379 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Int32Array,i32>~anonymous|0 (; 275 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint64Array,u64>~anonymous|0 (; 269 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 2 - i32.rem_s - i32.const 0 - i32.eq + i64.const 2 + i64.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Int32Array#every (; 276 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint64Array#findIndex (; 270 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - block $~lib/internal/typedarray/EVERY<~lib/typedarray/Int32Array,i32>|inlined.0 (result i32) + block $~lib/typedarray/FIND_INDEX<~lib/typedarray/Uint64Array,u64>|inlined.0 (result i32) local.get $0 - local.set $2 - local.get $1 + call $~lib/rt/pure/__retain local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.14 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 2 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 + local.get $1 + local.set $2 + local.get $3 i32.load offset=4 - local.set $6 + local.set $4 block $break|0 - i32.const 0 - local.set $7 + block + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Uint64Array#get:length + local.set $6 + end loop $repeat|0 - block $continue|0 - local.get $7 + local.get $5 + local.get $6 + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + i32.const 3 + global.set $~lib/argc local.get $4 - i32.lt_s - i32.eqz - br_if $break|0 - block - block (result i32) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.10 (result i32) - local.get $5 - local.set $10 - local.get $7 - local.set $9 - local.get $6 - local.set $8 - local.get $10 - local.get $9 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.add - i32.load offset=8 - end - local.get $7 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$iiii) - end - i32.const 0 - i32.ne - if - br $continue|0 - end - i32.const 0 - br $~lib/internal/typedarray/EVERY<~lib/typedarray/Int32Array,i32>|inlined.0 - unreachable - end - unreachable + local.get $5 + i32.const 3 + i32.shl + i32.add + i64.load + local.get $5 + local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$ijii) end - local.get $7 + if + local.get $5 + local.set $7 + local.get $3 + call $~lib/rt/pure/__release + local.get $7 + br $~lib/typedarray/FIND_INDEX<~lib/typedarray/Uint64Array,u64>|inlined.0 + end + local.get $5 i32.const 1 i32.add - local.set $7 + local.set $5 br $repeat|0 unreachable end unreachable end - i32.const 1 + i32.const -1 + local.set $6 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 end ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Int32Array,i32>~anonymous|1 (; 277 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint64Array,u64>~anonymous|1 (; 271 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 2 - i32.eq + i64.const 4 + i64.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Int32Array,i32> (; 278 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint64Array,u64> (; 272 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) + (local $3 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Int32Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Uint64Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + i64.const 1 + call $~lib/typedarray/Uint64Array#__set + local.get $1 i32.const 1 - i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + i64.const 2 + call $~lib/typedarray/Uint64Array#__set + local.get $1 i32.const 2 - i32.const 6 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 89 - call $~lib/typedarray/Int32Array#every - local.set $1 + i64.const 3 + call $~lib/typedarray/Uint64Array#__set local.get $1 - i32.const 0 - i32.ne + i32.const 73 + call $~lib/typedarray/Uint64Array#findIndex + local.set $2 + local.get $2 + i32.const 1 + i32.eq i32.eqz if - i32.const 0 - i32.const 8 - i32.const 395 + i32.const 976 + i32.const 24 + i32.const 376 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 - i32.const 90 - call $~lib/typedarray/Int32Array#every - local.set $2 - local.get $2 - i32.const 0 - i32.ne - i32.eqz + local.get $1 + i32.const 74 + call $~lib/typedarray/Uint64Array#findIndex + local.set $3 + local.get $3 + i32.const -1 + i32.eq i32.eqz if - i32.const 0 - i32.const 8 - i32.const 398 + i32.const 1024 + i32.const 24 + i32.const 379 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint32Array,u32>~anonymous|0 (; 279 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Float32Array,f32>~anonymous|0 (; 273 ;) (type $FUNCSIG$ifii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 2 - i32.rem_u - i32.const 0 - i32.eq + f32.const 2 + f32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Uint32Array#every (; 280 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Float32Array#findIndex (; 274 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - block $~lib/internal/typedarray/EVERY<~lib/typedarray/Uint32Array,u32>|inlined.0 (result i32) + block $~lib/typedarray/FIND_INDEX<~lib/typedarray/Float32Array,f32>|inlined.0 (result i32) local.get $0 - local.set $2 - local.get $1 + call $~lib/rt/pure/__retain local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.6 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 2 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 + local.get $1 + local.set $2 + local.get $3 i32.load offset=4 - local.set $6 + local.set $4 block $break|0 - i32.const 0 - local.set $7 + block + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Float32Array#get:length + local.set $6 + end loop $repeat|0 - block $continue|0 - local.get $7 + local.get $5 + local.get $6 + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + i32.const 3 + global.set $~lib/argc local.get $4 - i32.lt_s - i32.eqz - br_if $break|0 - block - block (result i32) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.9 (result i32) - local.get $5 - local.set $10 - local.get $7 - local.set $9 - local.get $6 - local.set $8 - local.get $10 - local.get $9 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.add - i32.load offset=8 - end - local.get $7 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$iiii) - end - i32.const 0 - i32.ne - if - br $continue|0 - end - i32.const 0 - br $~lib/internal/typedarray/EVERY<~lib/typedarray/Uint32Array,u32>|inlined.0 - unreachable - end - unreachable + local.get $5 + i32.const 2 + i32.shl + i32.add + f32.load + local.get $5 + local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$ifii) end - local.get $7 + if + local.get $5 + local.set $7 + local.get $3 + call $~lib/rt/pure/__release + local.get $7 + br $~lib/typedarray/FIND_INDEX<~lib/typedarray/Float32Array,f32>|inlined.0 + end + local.get $5 i32.const 1 i32.add - local.set $7 + local.set $5 br $repeat|0 unreachable end unreachable end - i32.const 1 + i32.const -1 + local.set $6 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 end ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint32Array,u32>~anonymous|1 (; 281 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Float32Array,f32>~anonymous|1 (; 275 ;) (type $FUNCSIG$ifii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i32.const 2 - i32.eq + f32.const 4 + f32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint32Array,u32> (; 282 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Float32Array,f32> (; 276 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) + (local $3 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Uint32Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Float32Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + f32.const 1 + call $~lib/typedarray/Float32Array#__set + local.get $1 i32.const 1 - i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + f32.const 2 + call $~lib/typedarray/Float32Array#__set + local.get $1 i32.const 2 - i32.const 6 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 91 - call $~lib/typedarray/Uint32Array#every - local.set $1 + f32.const 3 + call $~lib/typedarray/Float32Array#__set local.get $1 - i32.const 0 - i32.ne + i32.const 75 + call $~lib/typedarray/Float32Array#findIndex + local.set $2 + local.get $2 + i32.const 1 + i32.eq i32.eqz if - i32.const 0 - i32.const 8 - i32.const 395 + i32.const 976 + i32.const 24 + i32.const 376 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 - i32.const 92 - call $~lib/typedarray/Uint32Array#every - local.set $2 - local.get $2 - i32.const 0 - i32.ne - i32.eqz + local.get $1 + i32.const 76 + call $~lib/typedarray/Float32Array#findIndex + local.set $3 + local.get $3 + i32.const -1 + i32.eq i32.eqz if - i32.const 0 - i32.const 8 - i32.const 398 + i32.const 1024 + i32.const 24 + i32.const 379 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Int64Array,i64>~anonymous|0 (; 283 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Float64Array,f64>~anonymous|0 (; 277 ;) (type $FUNCSIG$idii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i64.const 2 - i64.rem_s - i64.const 0 - i64.eq + f64.const 2 + f64.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Int64Array#every (; 284 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Float64Array#findIndex (; 278 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - block $~lib/internal/typedarray/EVERY<~lib/typedarray/Int64Array,i64>|inlined.0 (result i32) + block $~lib/typedarray/FIND_INDEX<~lib/typedarray/Float64Array,f64>|inlined.0 (result i32) local.get $0 - local.set $2 - local.get $1 + call $~lib/rt/pure/__retain local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.6 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 3 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 + local.get $1 + local.set $2 + local.get $3 i32.load offset=4 - local.set $6 + local.set $4 block $break|0 - i32.const 0 - local.set $7 + block + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Float64Array#get:length + local.set $6 + end loop $repeat|0 - block $continue|0 - local.get $7 + local.get $5 + local.get $6 + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + i32.const 3 + global.set $~lib/argc local.get $4 - i32.lt_s - i32.eqz - br_if $break|0 - block - block (result i32) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.9 (result i64) - local.get $5 - local.set $10 - local.get $7 - local.set $9 - local.get $6 - local.set $8 - local.get $10 - local.get $9 - i32.const 3 - i32.shl - i32.add - local.get $8 - i32.add - i64.load offset=8 - end - local.get $7 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$ijii) - end - i32.const 0 - i32.ne - if - br $continue|0 - end - i32.const 0 - br $~lib/internal/typedarray/EVERY<~lib/typedarray/Int64Array,i64>|inlined.0 - unreachable - end - unreachable + local.get $5 + i32.const 3 + i32.shl + i32.add + f64.load + local.get $5 + local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$idii) end - local.get $7 + if + local.get $5 + local.set $7 + local.get $3 + call $~lib/rt/pure/__release + local.get $7 + br $~lib/typedarray/FIND_INDEX<~lib/typedarray/Float64Array,f64>|inlined.0 + end + local.get $5 i32.const 1 i32.add - local.set $7 + local.set $5 br $repeat|0 unreachable end unreachable end - i32.const 1 + i32.const -1 + local.set $6 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 end ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Int64Array,i64>~anonymous|1 (; 285 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Float64Array,f64>~anonymous|1 (; 279 ;) (type $FUNCSIG$idii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i64.const 2 - i64.eq + f64.const 4 + f64.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Int64Array,i64> (; 286 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Float64Array,f64> (; 280 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) + (local $3 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Int64Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Float64Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - i64.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + f64.const 1 + call $~lib/typedarray/Float64Array#__set + local.get $1 i32.const 1 - i64.const 4 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + f64.const 2 + call $~lib/typedarray/Float64Array#__set + local.get $1 i32.const 2 - i64.const 6 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 93 - call $~lib/typedarray/Int64Array#every - local.set $1 + f64.const 3 + call $~lib/typedarray/Float64Array#__set local.get $1 - i32.const 0 - i32.ne + i32.const 77 + call $~lib/typedarray/Float64Array#findIndex + local.set $2 + local.get $2 + i32.const 1 + i32.eq i32.eqz if - i32.const 0 - i32.const 8 - i32.const 395 + i32.const 976 + i32.const 24 + i32.const 376 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 - i32.const 94 - call $~lib/typedarray/Int64Array#every - local.set $2 - local.get $2 - i32.const 0 - i32.ne - i32.eqz + local.get $1 + i32.const 78 + call $~lib/typedarray/Float64Array#findIndex + local.set $3 + local.get $3 + i32.const -1 + i32.eq i32.eqz if - i32.const 0 - i32.const 8 - i32.const 398 + i32.const 1024 + i32.const 24 + i32.const 379 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint64Array,u64>~anonymous|0 (; 287 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Int8Array,i8>~anonymous|0 (; 281 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i64.const 2 - i64.rem_u - i64.const 0 - i64.eq + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.const 2 + i32.rem_s + i32.const 0 + i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Uint64Array#every (; 288 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int8Array#every (; 282 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - block $~lib/internal/typedarray/EVERY<~lib/typedarray/Uint64Array,u64>|inlined.0 (result i32) + block $~lib/typedarray/EVERY<~lib/typedarray/Int8Array,i8>|inlined.0 (result i32) local.get $0 - local.set $2 - local.get $1 + call $~lib/rt/pure/__retain local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.6 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 3 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 + local.get $1 + local.set $2 + local.get $3 i32.load offset=4 - local.set $6 + local.set $4 block $break|0 - i32.const 0 - local.set $7 + block + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Int8Array#get:length + local.set $6 + end loop $repeat|0 block $continue|0 - local.get $7 - local.get $4 + local.get $5 + local.get $6 i32.lt_s i32.eqz br_if $break|0 - block - block (result i32) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.9 (result i64) - local.get $5 - local.set $10 - local.get $7 - local.set $9 - local.get $6 - local.set $8 - local.get $10 - local.get $9 - i32.const 3 - i32.shl - i32.add - local.get $8 - i32.add - i64.load offset=8 - end - local.get $7 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$ijii) - end - i32.const 0 - i32.ne - if - br $continue|0 - end + block (result i32) + i32.const 3 + global.set $~lib/argc + local.get $4 + local.get $5 i32.const 0 - br $~lib/internal/typedarray/EVERY<~lib/typedarray/Uint64Array,u64>|inlined.0 - unreachable + i32.shl + i32.add + i32.load8_s + local.get $5 + local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$iiii) end - unreachable + if + br $continue|0 + end + i32.const 0 + local.set $7 + local.get $3 + call $~lib/rt/pure/__release + local.get $7 + br $~lib/typedarray/EVERY<~lib/typedarray/Int8Array,i8>|inlined.0 end - local.get $7 + local.get $5 i32.const 1 i32.add - local.set $7 + local.set $5 br $repeat|0 unreachable end unreachable end i32.const 1 + local.set $6 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 end ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint64Array,u64>~anonymous|1 (; 289 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Int8Array,i8>~anonymous|1 (; 283 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - i64.const 2 - i64.eq + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.const 2 + i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint64Array,u64> (; 290 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Int8Array,i8> (; 284 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) + (local $3 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Uint64Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Int8Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - i64.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + i32.const 2 + call $~lib/typedarray/Int8Array#__set + local.get $1 i32.const 1 - i64.const 4 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + i32.const 4 + call $~lib/typedarray/Int8Array#__set + local.get $1 i32.const 2 - i64.const 6 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 95 - call $~lib/typedarray/Uint64Array#every - local.set $1 + i32.const 6 + call $~lib/typedarray/Int8Array#__set local.get $1 - i32.const 0 - i32.ne - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 395 - i32.const 2 - call $~lib/env/abort - unreachable - end - local.get $0 - i32.const 96 - call $~lib/typedarray/Uint64Array#every + i32.const 79 + call $~lib/typedarray/Int8Array#every local.set $2 local.get $2 i32.const 0 i32.ne i32.eqz - i32.eqz if i32.const 0 - i32.const 8 - i32.const 398 + i32.const 24 + i32.const 406 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - ) - (func $~lib/math/NativeMathf.mod (; 291 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 f32) - (local $10 i32) - (local $11 i32) - local.get $0 - i32.reinterpret_f32 - local.set $2 local.get $1 - i32.reinterpret_f32 + i32.const 80 + call $~lib/typedarray/Int8Array#every local.set $3 - local.get $2 - i32.const 23 - i32.shr_u - i32.const 255 - i32.and - local.set $4 - local.get $3 - i32.const 23 - i32.shr_u - i32.const 255 - i32.and - local.set $5 - local.get $2 - i32.const -2147483648 - i32.and - local.set $6 local.get $3 - i32.const 1 - i32.shl - local.set $7 - local.get $7 - i32.const 0 - i32.eq - local.tee $8 - if (result i32) - local.get $8 - else - local.get $4 - i32.const 255 - i32.eq - end - local.tee $8 - if (result i32) - local.get $8 - else - local.get $1 - local.set $9 - local.get $9 - local.get $9 - f32.ne - end - i32.const 0 - i32.ne - if - local.get $0 - local.get $1 - f32.mul - local.set $9 - local.get $9 - local.get $9 - f32.div - return - end - local.get $2 - i32.const 1 - i32.shl - local.set $10 - local.get $10 - local.get $7 - i32.le_u - if - local.get $10 - local.get $7 - i32.eq - if - f32.const 0 - local.get $0 - f32.mul - return - end - local.get $0 - return - end - local.get $4 - i32.eqz - if - local.get $4 - local.get $2 - i32.const 9 - i32.shl - i32.clz - i32.sub - local.set $4 - local.get $2 - i32.const 0 - local.get $4 - i32.sub - i32.const 1 - i32.add - i32.shl - local.set $2 - else - local.get $2 - i32.const -1 - i32.const 9 - i32.shr_u - i32.and - local.set $2 - local.get $2 - i32.const 1 - i32.const 23 - i32.shl - i32.or - local.set $2 - end - local.get $5 - i32.eqz - if - local.get $5 - local.get $3 - i32.const 9 - i32.shl - i32.clz - i32.sub - local.set $5 - local.get $3 + i32.const 0 + i32.ne + i32.eqz + i32.eqz + if i32.const 0 - local.get $5 - i32.sub - i32.const 1 - i32.add - i32.shl - local.set $3 - else - local.get $3 - i32.const -1 - i32.const 9 - i32.shr_u - i32.and + i32.const 24 + i32.const 409 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + ) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8>~anonymous|0 (; 285 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.const 255 + i32.and + i32.const 2 + i32.rem_u + i32.const 0 + i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $~lib/typedarray/Uint8Array#every (; 286 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + block $~lib/typedarray/EVERY<~lib/typedarray/Uint8Array,u8>|inlined.0 (result i32) + local.get $0 + call $~lib/rt/pure/__retain local.set $3 + local.get $1 + local.set $2 local.get $3 - i32.const 1 - i32.const 23 - i32.shl - i32.or - local.set $3 - end - block $break|0 - loop $continue|0 - local.get $4 - local.get $5 - i32.gt_s - if - block - local.get $2 - local.get $3 - i32.ge_u - if - local.get $2 + i32.load offset=4 + local.set $4 + block $break|0 + block + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Uint8Array#get:length + local.set $6 + end + loop $repeat|0 + block $continue|0 + local.get $5 + local.get $6 + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + i32.const 3 + global.set $~lib/argc + local.get $4 + local.get $5 + i32.const 0 + i32.shl + i32.add + i32.load8_u + local.get $5 local.get $3 - i32.eq - if - f32.const 0 - local.get $0 - f32.mul - return - end local.get $2 - local.get $3 - i32.sub - local.set $2 + call_indirect (type $FUNCSIG$iiii) end - local.get $2 - i32.const 1 - i32.shl - local.set $2 - local.get $4 - i32.const 1 - i32.sub - local.set $4 + if + br $continue|0 + end + i32.const 0 + local.set $7 + local.get $3 + call $~lib/rt/pure/__release + local.get $7 + br $~lib/typedarray/EVERY<~lib/typedarray/Uint8Array,u8>|inlined.0 end - br $continue|0 + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|0 + unreachable end + unreachable end - end - local.get $2 - local.get $3 - i32.ge_u - if - local.get $2 - local.get $3 - i32.eq - if - f32.const 0 - local.get $0 - f32.mul - return - end - local.get $2 + i32.const 1 + local.set $6 local.get $3 - i32.sub - local.set $2 + call $~lib/rt/pure/__release + local.get $6 end + ) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8>~anonymous|1 (; 287 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) local.get $2 - i32.const 8 - i32.shl - i32.clz - local.set $11 - local.get $4 - local.get $11 - i32.sub - local.set $4 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.const 255 + i32.and + i32.const 2 + i32.eq + local.set $3 local.get $2 - local.get $11 - i32.shl + call $~lib/rt/pure/__release + local.get $3 + ) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8> (; 288 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + i32.const 0 + i32.const 3 + call $~lib/typedarray/Uint8Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 + i32.const 0 + i32.const 2 + call $~lib/typedarray/Uint8Array#__set + local.get $1 + i32.const 1 + i32.const 4 + call $~lib/typedarray/Uint8Array#__set + local.get $1 + i32.const 2 + i32.const 6 + call $~lib/typedarray/Uint8Array#__set + local.get $1 + i32.const 81 + call $~lib/typedarray/Uint8Array#every local.set $2 - local.get $4 + local.get $2 i32.const 0 - i32.gt_s + i32.ne + i32.eqz if - local.get $2 - i32.const 1 - i32.const 23 - i32.shl - i32.sub - local.set $2 - local.get $2 - local.get $4 - i32.const 23 - i32.shl - i32.or - local.set $2 - else - local.get $2 i32.const 0 - local.get $4 - i32.sub - i32.const 1 - i32.add - i32.shr_u - local.set $2 + i32.const 24 + i32.const 406 + i32.const 2 + call $~lib/builtins/abort + unreachable end - local.get $2 - local.get $6 - i32.or - local.set $2 - local.get $2 - f32.reinterpret_i32 + local.get $1 + i32.const 82 + call $~lib/typedarray/Uint8Array#every + local.set $3 + local.get $3 + i32.const 0 + i32.ne + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 409 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Float32Array,f32>~anonymous|0 (; 292 ;) (type $FUNCSIG$ifii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 (; 289 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - f32.const 2 - call $~lib/math/NativeMathf.mod - f32.const 0 - f32.eq + i32.const 255 + i32.and + i32.const 2 + i32.rem_u + i32.const 0 + i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Float32Array#every (; 293 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint8ClampedArray#every (; 290 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - block $~lib/internal/typedarray/EVERY<~lib/typedarray/Float32Array,f32>|inlined.0 (result i32) - local.get $0 - local.set $2 - local.get $1 - local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.6 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 2 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 + block $~lib/typedarray/EVERY<~lib/typedarray/Uint8ClampedArray,u8>|inlined.0 (result i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 + local.set $2 + local.get $3 i32.load offset=4 - local.set $6 + local.set $4 block $break|0 - i32.const 0 - local.set $7 + block + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Uint8ClampedArray#get:length + local.set $6 + end loop $repeat|0 block $continue|0 - local.get $7 - local.get $4 + local.get $5 + local.get $6 i32.lt_s i32.eqz br_if $break|0 - block - block (result i32) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.9 (result f32) - local.get $5 - local.set $10 - local.get $7 - local.set $9 - local.get $6 - local.set $8 - local.get $10 - local.get $9 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.add - f32.load offset=8 - end - local.get $7 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$ifii) - end - i32.const 0 - i32.ne - if - br $continue|0 - end + block (result i32) + i32.const 3 + global.set $~lib/argc + local.get $4 + local.get $5 i32.const 0 - br $~lib/internal/typedarray/EVERY<~lib/typedarray/Float32Array,f32>|inlined.0 - unreachable + i32.shl + i32.add + i32.load8_u + local.get $5 + local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$iiii) end - unreachable + if + br $continue|0 + end + i32.const 0 + local.set $7 + local.get $3 + call $~lib/rt/pure/__release + local.get $7 + br $~lib/typedarray/EVERY<~lib/typedarray/Uint8ClampedArray,u8>|inlined.0 end - local.get $7 + local.get $5 i32.const 1 i32.add - local.set $7 + local.set $5 br $repeat|0 unreachable end unreachable end i32.const 1 + local.set $6 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 end ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Float32Array,f32>~anonymous|1 (; 294 ;) (type $FUNCSIG$ifii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|1 (; 291 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - f32.const 2 - f32.eq + i32.const 255 + i32.and + i32.const 2 + i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Float32Array,f32> (; 295 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint8ClampedArray,u8> (; 292 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) + (local $3 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Float32Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Uint8ClampedArray#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - f32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + i32.const 2 + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $1 i32.const 1 - f32.const 4 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + i32.const 4 + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $1 i32.const 2 - f32.const 6 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 97 - call $~lib/typedarray/Float32Array#every - local.set $1 + i32.const 6 + call $~lib/typedarray/Uint8ClampedArray#__set local.get $1 - i32.const 0 - i32.ne - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 395 - i32.const 2 - call $~lib/env/abort - unreachable - end - local.get $0 - i32.const 98 - call $~lib/typedarray/Float32Array#every + i32.const 83 + call $~lib/typedarray/Uint8ClampedArray#every local.set $2 local.get $2 i32.const 0 i32.ne i32.eqz - i32.eqz if i32.const 0 - i32.const 8 - i32.const 398 + i32.const 24 + i32.const 406 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - ) - (func $~lib/math/NativeMath.mod (; 296 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) - (local $2 i64) - (local $3 i64) - (local $4 i64) - (local $5 i64) - (local $6 i64) - (local $7 i64) - (local $8 i32) - (local $9 f64) - (local $10 i64) - (local $11 i64) - local.get $0 - i64.reinterpret_f64 - local.set $2 local.get $1 - i64.reinterpret_f64 + i32.const 84 + call $~lib/typedarray/Uint8ClampedArray#every local.set $3 - local.get $2 - i64.const 52 - i64.shr_u - i64.const 2047 - i64.and - local.set $4 - local.get $3 - i64.const 52 - i64.shr_u - i64.const 2047 - i64.and - local.set $5 - local.get $2 - i64.const 63 - i64.shr_u - local.set $6 local.get $3 - i64.const 1 - i64.shl - local.set $7 - local.get $7 - i64.const 0 - i64.eq - local.tee $8 - if (result i32) - local.get $8 - else - local.get $4 - i64.const 2047 - i64.eq - end - local.tee $8 - if (result i32) - local.get $8 - else - local.get $1 - local.set $9 - local.get $9 - local.get $9 - f64.ne - end i32.const 0 i32.ne + i32.eqz + i32.eqz if - local.get $0 - local.get $1 - f64.mul - local.set $9 - local.get $9 - local.get $9 - f64.div - return - end - local.get $2 - i64.const 1 - i64.shl - local.set $10 - local.get $10 - local.get $7 - i64.le_u - if - local.get $10 - local.get $7 - i64.eq - if - f64.const 0 - local.get $0 - f64.mul - return - end - local.get $0 - return - end - local.get $4 - i64.eqz - if - local.get $4 - local.get $2 - i64.const 12 - i64.shl - i64.clz - i64.sub - local.set $4 - local.get $2 - i64.const 0 - local.get $4 - i64.sub - i64.const 1 - i64.add - i64.shl - local.set $2 - else - local.get $2 - i64.const -1 - i64.const 12 - i64.shr_u - i64.and - local.set $2 - local.get $2 - i64.const 1 - i64.const 52 - i64.shl - i64.or - local.set $2 + i32.const 0 + i32.const 24 + i32.const 409 + i32.const 2 + call $~lib/builtins/abort + unreachable end - local.get $5 - i64.eqz - if - local.get $5 - local.get $3 - i64.const 12 - i64.shl - i64.clz - i64.sub - local.set $5 - local.get $3 - i64.const 0 - local.get $5 - i64.sub - i64.const 1 - i64.add - i64.shl - local.set $3 - else - local.get $3 - i64.const -1 - i64.const 12 - i64.shr_u - i64.and + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + ) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Int16Array,i16>~anonymous|0 (; 293 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + i32.const 2 + i32.rem_s + i32.const 0 + i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $~lib/typedarray/Int16Array#every (; 294 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + block $~lib/typedarray/EVERY<~lib/typedarray/Int16Array,i16>|inlined.0 (result i32) + local.get $0 + call $~lib/rt/pure/__retain local.set $3 + local.get $1 + local.set $2 local.get $3 - i64.const 1 - i64.const 52 - i64.shl - i64.or - local.set $3 - end - block $break|0 - loop $continue|0 - local.get $4 - local.get $5 - i64.gt_s - if - block - local.get $2 - local.get $3 - i64.ge_u - if - local.get $2 + i32.load offset=4 + local.set $4 + block $break|0 + block + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Int16Array#get:length + local.set $6 + end + loop $repeat|0 + block $continue|0 + local.get $5 + local.get $6 + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + i32.const 3 + global.set $~lib/argc + local.get $4 + local.get $5 + i32.const 1 + i32.shl + i32.add + i32.load16_s + local.get $5 local.get $3 - i64.eq - if - f64.const 0 - local.get $0 - f64.mul - return - end local.get $2 - local.get $3 - i64.sub - local.set $2 + call_indirect (type $FUNCSIG$iiii) end - local.get $2 - i64.const 1 - i64.shl - local.set $2 - local.get $4 - i64.const 1 - i64.sub - local.set $4 + if + br $continue|0 + end + i32.const 0 + local.set $7 + local.get $3 + call $~lib/rt/pure/__release + local.get $7 + br $~lib/typedarray/EVERY<~lib/typedarray/Int16Array,i16>|inlined.0 end - br $continue|0 + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|0 + unreachable end + unreachable end + i32.const 1 + local.set $6 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 end + ) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Int16Array,i16>~anonymous|1 (; 295 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + i32.const 2 + i32.eq + local.set $3 local.get $2 + call $~lib/rt/pure/__release local.get $3 - i64.ge_u + ) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Int16Array,i16> (; 296 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + i32.const 0 + i32.const 3 + call $~lib/typedarray/Int16Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 + i32.const 0 + i32.const 2 + call $~lib/typedarray/Int16Array#__set + local.get $1 + i32.const 1 + i32.const 4 + call $~lib/typedarray/Int16Array#__set + local.get $1 + i32.const 2 + i32.const 6 + call $~lib/typedarray/Int16Array#__set + local.get $1 + i32.const 85 + call $~lib/typedarray/Int16Array#every + local.set $2 + local.get $2 + i32.const 0 + i32.ne + i32.eqz if - local.get $2 - local.get $3 - i64.eq - if - f64.const 0 - local.get $0 - f64.mul - return - end - local.get $2 - local.get $3 - i64.sub - local.set $2 + i32.const 0 + i32.const 24 + i32.const 406 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 86 + call $~lib/typedarray/Int16Array#every + local.set $3 + local.get $3 + i32.const 0 + i32.ne + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 409 + i32.const 2 + call $~lib/builtins/abort + unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + ) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint16Array,u16>~anonymous|0 (; 297 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) local.get $2 - i64.const 11 - i64.shl - i64.clz - local.set $11 - local.get $4 - local.get $11 - i64.sub - local.set $4 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.const 65535 + i32.and + i32.const 2 + i32.rem_u + i32.const 0 + i32.eq + local.set $3 local.get $2 - local.get $11 - i64.shl - local.set $2 - local.get $4 - i64.const 0 - i64.gt_s - if - local.get $2 - i64.const 1 - i64.const 52 - i64.shl - i64.sub - local.set $2 - local.get $2 - local.get $4 - i64.const 52 - i64.shl - i64.or - local.set $2 - else - local.get $2 - i64.const 0 - local.get $4 - i64.sub - i64.const 1 - i64.add - i64.shr_u + call $~lib/rt/pure/__release + local.get $3 + ) + (func $~lib/typedarray/Uint16Array#every (; 298 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + block $~lib/typedarray/EVERY<~lib/typedarray/Uint16Array,u16>|inlined.0 (result i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 local.set $2 + local.get $3 + i32.load offset=4 + local.set $4 + block $break|0 + block + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Uint16Array#get:length + local.set $6 + end + loop $repeat|0 + block $continue|0 + local.get $5 + local.get $6 + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + i32.const 3 + global.set $~lib/argc + local.get $4 + local.get $5 + i32.const 1 + i32.shl + i32.add + i32.load16_u + local.get $5 + local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$iiii) + end + if + br $continue|0 + end + i32.const 0 + local.set $7 + local.get $3 + call $~lib/rt/pure/__release + local.get $7 + br $~lib/typedarray/EVERY<~lib/typedarray/Uint16Array,u16>|inlined.0 + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|0 + unreachable + end + unreachable + end + i32.const 1 + local.set $6 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 end + ) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint16Array,u16>~anonymous|1 (; 299 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) local.get $2 - local.get $6 - i64.const 63 - i64.shl - i64.or + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.const 65535 + i32.and + i32.const 2 + i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint16Array,u16> (; 300 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + i32.const 0 + i32.const 3 + call $~lib/typedarray/Uint16Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 + i32.const 0 + i32.const 2 + call $~lib/typedarray/Uint16Array#__set + local.get $1 + i32.const 1 + i32.const 4 + call $~lib/typedarray/Uint16Array#__set + local.get $1 + i32.const 2 + i32.const 6 + call $~lib/typedarray/Uint16Array#__set + local.get $1 + i32.const 87 + call $~lib/typedarray/Uint16Array#every local.set $2 local.get $2 - f64.reinterpret_i64 + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 406 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 88 + call $~lib/typedarray/Uint16Array#every + local.set $3 + local.get $3 + i32.const 0 + i32.ne + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 409 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Float64Array,f64>~anonymous|0 (; 297 ;) (type $FUNCSIG$idii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Int32Array,i32>~anonymous|0 (; 301 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - f64.const 2 - call $~lib/math/NativeMath.mod - f64.const 0 - f64.eq + i32.const 2 + i32.rem_s + i32.const 0 + i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Float64Array#every (; 298 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int32Array#every (; 302 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - block $~lib/internal/typedarray/EVERY<~lib/typedarray/Float64Array,f64>|inlined.0 (result i32) + block $~lib/typedarray/EVERY<~lib/typedarray/Int32Array,i32>|inlined.0 (result i32) local.get $0 - local.set $2 - local.get $1 + call $~lib/rt/pure/__retain local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.9 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 3 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 + local.get $1 + local.set $2 + local.get $3 i32.load offset=4 - local.set $6 + local.set $4 block $break|0 - i32.const 0 - local.set $7 + block + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Int32Array#get:length + local.set $6 + end loop $repeat|0 block $continue|0 - local.get $7 - local.get $4 + local.get $5 + local.get $6 i32.lt_s i32.eqz br_if $break|0 - block - block (result i32) - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.21 (result f64) - local.get $5 - local.set $10 - local.get $7 - local.set $9 - local.get $6 - local.set $8 - local.get $10 - local.get $9 - i32.const 3 - i32.shl - i32.add - local.get $8 - i32.add - f64.load offset=8 - end - local.get $7 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$idii) - end - i32.const 0 - i32.ne - if - br $continue|0 - end - i32.const 0 - br $~lib/internal/typedarray/EVERY<~lib/typedarray/Float64Array,f64>|inlined.0 - unreachable + block (result i32) + i32.const 3 + global.set $~lib/argc + local.get $4 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $5 + local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$iiii) end - unreachable + if + br $continue|0 + end + i32.const 0 + local.set $7 + local.get $3 + call $~lib/rt/pure/__release + local.get $7 + br $~lib/typedarray/EVERY<~lib/typedarray/Int32Array,i32>|inlined.0 end - local.get $7 + local.get $5 i32.const 1 i32.add - local.set $7 + local.set $5 br $repeat|0 unreachable end unreachable end i32.const 1 + local.set $6 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 end ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Float64Array,f64>~anonymous|1 (; 299 ;) (type $FUNCSIG$idii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Int32Array,i32>~anonymous|1 (; 303 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - f64.const 2 - f64.eq + i32.const 2 + i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Float64Array,f64> (; 300 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Int32Array,i32> (; 304 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) + (local $3 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Float64Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Int32Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - f64.const 2 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + i32.const 2 + call $~lib/typedarray/Int32Array#__set + local.get $1 i32.const 1 - f64.const 4 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + i32.const 4 + call $~lib/typedarray/Int32Array#__set + local.get $1 i32.const 2 - f64.const 6 - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 99 - call $~lib/typedarray/Float64Array#every - local.set $1 + i32.const 6 + call $~lib/typedarray/Int32Array#__set local.get $1 + i32.const 89 + call $~lib/typedarray/Int32Array#every + local.set $2 + local.get $2 i32.const 0 i32.ne i32.eqz if i32.const 0 - i32.const 8 - i32.const 395 + i32.const 24 + i32.const 406 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $0 - i32.const 100 - call $~lib/typedarray/Float64Array#every - local.set $2 - local.get $2 + local.get $1 + i32.const 90 + call $~lib/typedarray/Int32Array#every + local.set $3 + local.get $3 i32.const 0 i32.ne i32.eqz i32.eqz if i32.const 0 - i32.const 8 - i32.const 398 + i32.const 24 + i32.const 409 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Int8Array,i8>~anonymous|0 (; 301 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - global.get $std/typedarray/forEachValues - local.get $1 - call $~lib/array/Array#__get - local.set $3 local.get $0 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - local.get $3 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.eq - i32.eqz - if - i32.const 752 - i32.const 8 - i32.const 425 - i32.const 4 - call $~lib/env/abort - unreachable - end + call $~lib/rt/pure/__release local.get $1 - global.get $std/typedarray/forEachCallCount - i32.eq - i32.eqz - if - i32.const 800 - i32.const 8 - i32.const 426 - i32.const 4 - call $~lib/env/abort - unreachable - end - global.get $std/typedarray/forEachSelf + call $~lib/rt/pure/__release + ) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint32Array,u32>~anonymous|0 (; 305 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) local.get $2 - i32.eq - i32.eqz - if - i32.const 848 - i32.const 8 - i32.const 427 - i32.const 4 - call $~lib/env/abort - unreachable - end - global.get $std/typedarray/forEachCallCount - i32.const 1 - i32.add - global.set $std/typedarray/forEachCallCount + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.const 2 + i32.rem_u + i32.const 0 + i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Int8Array#forEach (; 302 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/typedarray/Uint32Array#every (; 306 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - local.get $0 - local.set $2 - local.get $1 - local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.16 (result i32) - local.get $2 + block $~lib/typedarray/EVERY<~lib/typedarray/Uint32Array,u32>|inlined.0 (result i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 + local.set $2 + local.get $3 + i32.load offset=4 local.set $4 - local.get $4 - i32.load offset=8 - i32.const 0 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 - i32.load offset=4 - local.set $6 - block $break|0 - i32.const 0 - local.set $7 - loop $repeat|0 - local.get $7 - local.get $4 - i32.lt_s - i32.eqz - br_if $break|0 + block $break|0 block - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.11 (result i32) + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Uint32Array#get:length + local.set $6 + end + loop $repeat|0 + block $continue|0 local.get $5 - local.set $8 - local.get $7 - local.set $9 local.get $6 - local.set $10 - local.get $8 - local.get $9 + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + i32.const 3 + global.set $~lib/argc + local.get $4 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $5 + local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$iiii) + end + if + br $continue|0 + end i32.const 0 - i32.shl - i32.add - local.get $10 - i32.add - i32.load8_s offset=8 + local.set $7 + local.get $3 + call $~lib/rt/pure/__release + local.get $7 + br $~lib/typedarray/EVERY<~lib/typedarray/Uint32Array,u32>|inlined.0 end - local.get $7 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$viii) + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|0 + unreachable end - local.get $7 - i32.const 1 - i32.add - local.set $7 - br $repeat|0 unreachable end - unreachable + i32.const 1 + local.set $6 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 end ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Int8Array,i8> (; 303 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint32Array,u32>~anonymous|1 (; 307 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $0 + i32.const 2 + i32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint32Array,u32> (; 308 ;) (type $FUNCSIG$v) (local $0 i32) - i32.const 0 - global.set $std/typedarray/forEachCallCount + (local $1 i32) + (local $2 i32) + (local $3 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Int8Array#constructor - local.set $0 - local.get $0 - global.set $std/typedarray/forEachSelf - local.get $0 - i32.const 0 - global.get $std/typedarray/forEachValues + call $~lib/typedarray/Uint32Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - call $~lib/array/Array#__get - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 1 - global.get $std/typedarray/forEachValues - i32.const 1 - call $~lib/array/Array#__get - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 i32.const 2 - global.get $std/typedarray/forEachValues + call $~lib/typedarray/Uint32Array#__set + local.get $1 + i32.const 1 + i32.const 4 + call $~lib/typedarray/Uint32Array#__set + local.get $1 i32.const 2 - call $~lib/array/Array#__get - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 101 - call $~lib/typedarray/Int8Array#forEach - global.get $std/typedarray/forEachCallCount - i32.const 3 - i32.eq + i32.const 6 + call $~lib/typedarray/Uint32Array#__set + local.get $1 + i32.const 91 + call $~lib/typedarray/Uint32Array#every + local.set $2 + local.get $2 + i32.const 0 + i32.ne i32.eqz if - i32.const 920 - i32.const 8 - i32.const 430 + i32.const 0 + i32.const 24 + i32.const 406 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint8Array,u8>~anonymous|0 (; 304 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - global.get $std/typedarray/forEachValues local.get $1 - call $~lib/array/Array#__get + i32.const 92 + call $~lib/typedarray/Uint32Array#every local.set $3 - local.get $0 - i32.const 255 - i32.and local.get $3 - i32.const 255 - i32.and - i32.eq + i32.const 0 + i32.ne i32.eqz - if - i32.const 752 - i32.const 8 - i32.const 425 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $1 - global.get $std/typedarray/forEachCallCount - i32.eq i32.eqz if - i32.const 800 - i32.const 8 - i32.const 426 - i32.const 4 - call $~lib/env/abort + i32.const 0 + i32.const 24 + i32.const 409 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/forEachSelf + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + ) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Int64Array,i64>~anonymous|0 (; 309 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) local.get $2 - i32.eq - i32.eqz - if - i32.const 848 - i32.const 8 - i32.const 427 - i32.const 4 - call $~lib/env/abort - unreachable - end - global.get $std/typedarray/forEachCallCount - i32.const 1 - i32.add - global.set $std/typedarray/forEachCallCount + call $~lib/rt/pure/__retain + drop + local.get $0 + i64.const 2 + i64.rem_s + i64.const 0 + i64.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Uint8Array#forEach (; 305 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/typedarray/Int64Array#every (; 310 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - local.get $0 - local.set $2 - local.get $1 - local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.14 (result i32) - local.get $2 + block $~lib/typedarray/EVERY<~lib/typedarray/Int64Array,i64>|inlined.0 (result i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 + local.set $2 + local.get $3 + i32.load offset=4 local.set $4 - local.get $4 - i32.load offset=8 - i32.const 0 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 - i32.load offset=4 - local.set $6 - block $break|0 - i32.const 0 - local.set $7 - loop $repeat|0 - local.get $7 - local.get $4 - i32.lt_s - i32.eqz - br_if $break|0 + block $break|0 block - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.19 (result i32) + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Int64Array#get:length + local.set $6 + end + loop $repeat|0 + block $continue|0 local.get $5 - local.set $8 - local.get $7 - local.set $9 local.get $6 - local.set $10 - local.get $8 - local.get $9 + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + i32.const 3 + global.set $~lib/argc + local.get $4 + local.get $5 + i32.const 3 + i32.shl + i32.add + i64.load + local.get $5 + local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$ijii) + end + if + br $continue|0 + end i32.const 0 - i32.shl - i32.add - local.get $10 - i32.add - i32.load8_u offset=8 + local.set $7 + local.get $3 + call $~lib/rt/pure/__release + local.get $7 + br $~lib/typedarray/EVERY<~lib/typedarray/Int64Array,i64>|inlined.0 end - local.get $7 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$viii) + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|0 + unreachable end - local.get $7 - i32.const 1 - i32.add - local.set $7 - br $repeat|0 unreachable end - unreachable + i32.const 1 + local.set $6 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 end ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint8Array,u8> (; 306 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Int64Array,i64>~anonymous|1 (; 311 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $0 + i64.const 2 + i64.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Int64Array,i64> (; 312 ;) (type $FUNCSIG$v) (local $0 i32) - i32.const 0 - global.set $std/typedarray/forEachCallCount + (local $1 i32) + (local $2 i32) + (local $3 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Uint8Array#constructor - local.set $0 - local.get $0 - global.set $std/typedarray/forEachSelf - local.get $0 - i32.const 0 - global.get $std/typedarray/forEachValues + call $~lib/typedarray/Int64Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - call $~lib/array/Array#__get - i32.const 255 - i32.and - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 1 - global.get $std/typedarray/forEachValues + i64.const 2 + call $~lib/typedarray/Int64Array#__set + local.get $1 i32.const 1 - call $~lib/array/Array#__get - i32.const 255 - i32.and - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 2 - global.get $std/typedarray/forEachValues + i64.const 4 + call $~lib/typedarray/Int64Array#__set + local.get $1 i32.const 2 - call $~lib/array/Array#__get - i32.const 255 - i32.and - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 102 - call $~lib/typedarray/Uint8Array#forEach - global.get $std/typedarray/forEachCallCount - i32.const 3 - i32.eq + i64.const 6 + call $~lib/typedarray/Int64Array#__set + local.get $1 + i32.const 93 + call $~lib/typedarray/Int64Array#every + local.set $2 + local.get $2 + i32.const 0 + i32.ne i32.eqz if - i32.const 920 - i32.const 8 - i32.const 430 + i32.const 0 + i32.const 24 + i32.const 406 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 (; 307 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - global.get $std/typedarray/forEachValues local.get $1 - call $~lib/array/Array#__get + i32.const 94 + call $~lib/typedarray/Int64Array#every local.set $3 - local.get $0 - i32.const 255 - i32.and local.get $3 - i32.const 255 - i32.and - i32.eq + i32.const 0 + i32.ne i32.eqz - if - i32.const 752 - i32.const 8 - i32.const 425 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $1 - global.get $std/typedarray/forEachCallCount - i32.eq i32.eqz if - i32.const 800 - i32.const 8 - i32.const 426 - i32.const 4 - call $~lib/env/abort + i32.const 0 + i32.const 24 + i32.const 409 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/forEachSelf + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + ) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint64Array,u64>~anonymous|0 (; 313 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) local.get $2 - i32.eq - i32.eqz - if - i32.const 848 - i32.const 8 - i32.const 427 - i32.const 4 - call $~lib/env/abort - unreachable - end - global.get $std/typedarray/forEachCallCount - i32.const 1 - i32.add - global.set $std/typedarray/forEachCallCount + call $~lib/rt/pure/__retain + drop + local.get $0 + i64.const 2 + i64.rem_u + i64.const 0 + i64.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Uint8ClampedArray#forEach (; 308 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/typedarray/Uint64Array#every (; 314 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - local.get $0 - local.set $2 - local.get $1 - local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.15 (result i32) - local.get $2 + block $~lib/typedarray/EVERY<~lib/typedarray/Uint64Array,u64>|inlined.0 (result i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 + local.set $2 + local.get $3 + i32.load offset=4 local.set $4 - local.get $4 - i32.load offset=8 - i32.const 0 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 - i32.load offset=4 - local.set $6 - block $break|0 - i32.const 0 - local.set $7 - loop $repeat|0 - local.get $7 - local.get $4 - i32.lt_s - i32.eqz - br_if $break|0 + block $break|0 block - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.20 (result i32) + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Uint64Array#get:length + local.set $6 + end + loop $repeat|0 + block $continue|0 local.get $5 - local.set $8 - local.get $7 - local.set $9 local.get $6 - local.set $10 - local.get $8 - local.get $9 + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + i32.const 3 + global.set $~lib/argc + local.get $4 + local.get $5 + i32.const 3 + i32.shl + i32.add + i64.load + local.get $5 + local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$ijii) + end + if + br $continue|0 + end i32.const 0 - i32.shl - i32.add - local.get $10 - i32.add - i32.load8_u offset=8 + local.set $7 + local.get $3 + call $~lib/rt/pure/__release + local.get $7 + br $~lib/typedarray/EVERY<~lib/typedarray/Uint64Array,u64>|inlined.0 end - local.get $7 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$viii) + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|0 + unreachable end - local.get $7 - i32.const 1 - i32.add - local.set $7 - br $repeat|0 unreachable end - unreachable + i32.const 1 + local.set $6 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 end ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint8ClampedArray,u8> (; 309 ;) (type $FUNCSIG$v) - (local $0 i32) - i32.const 0 - global.set $std/typedarray/forEachCallCount - i32.const 0 - i32.const 3 - call $~lib/typedarray/Uint8ClampedArray#constructor - local.set $0 - local.get $0 - global.set $std/typedarray/forEachSelf + (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint64Array,u64>~anonymous|1 (; 315 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 + i64.const 2 + i64.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint64Array,u64> (; 316 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) i32.const 0 - global.get $std/typedarray/forEachValues + i32.const 3 + call $~lib/typedarray/Uint64Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - call $~lib/array/Array#__get - i32.const 255 - i32.and - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 - i32.const 1 - global.get $std/typedarray/forEachValues + i64.const 2 + call $~lib/typedarray/Uint64Array#__set + local.get $1 i32.const 1 - call $~lib/array/Array#__get - i32.const 255 - i32.and - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 - i32.const 2 - global.get $std/typedarray/forEachValues + i64.const 4 + call $~lib/typedarray/Uint64Array#__set + local.get $1 i32.const 2 - call $~lib/array/Array#__get - i32.const 255 - i32.and - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 - i32.const 103 - call $~lib/typedarray/Uint8ClampedArray#forEach - global.get $std/typedarray/forEachCallCount - i32.const 3 - i32.eq + i64.const 6 + call $~lib/typedarray/Uint64Array#__set + local.get $1 + i32.const 95 + call $~lib/typedarray/Uint64Array#every + local.set $2 + local.get $2 + i32.const 0 + i32.ne i32.eqz if - i32.const 920 - i32.const 8 - i32.const 430 + i32.const 0 + i32.const 24 + i32.const 406 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Int16Array,i16>~anonymous|0 (; 310 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - global.get $std/typedarray/forEachValues local.get $1 - call $~lib/array/Array#__get + i32.const 96 + call $~lib/typedarray/Uint64Array#every local.set $3 - local.get $0 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s local.get $3 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - i32.eq - i32.eqz - if - i32.const 752 - i32.const 8 - i32.const 425 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $1 - global.get $std/typedarray/forEachCallCount - i32.eq + i32.const 0 + i32.ne i32.eqz - if - i32.const 800 - i32.const 8 - i32.const 426 - i32.const 4 - call $~lib/env/abort - unreachable - end - global.get $std/typedarray/forEachSelf - local.get $2 - i32.eq i32.eqz if - i32.const 848 - i32.const 8 - i32.const 427 - i32.const 4 - call $~lib/env/abort + i32.const 0 + i32.const 24 + i32.const 409 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/forEachCallCount - i32.const 1 - i32.add - global.set $std/typedarray/forEachCallCount + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int16Array#forEach (; 311 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/builtins/isNaN (; 317 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) + local.get $0 + local.get $0 + f32.ne + ) + (func $~lib/math/NativeMathf.mod (; 318 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) + (local $8 f32) (local $9 i32) (local $10 i32) local.get $0 + i32.reinterpret_f32 local.set $2 local.get $1 + i32.reinterpret_f32 local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.7 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 1 - i32.shr_u - end - local.set $4 local.get $2 - i32.load + i32.const 23 + i32.shr_u + i32.const 255 + i32.and + local.set $4 + local.get $3 + i32.const 23 + i32.shr_u + i32.const 255 + i32.and local.set $5 local.get $2 - i32.load offset=4 + i32.const -2147483648 + i32.and local.set $6 - block $break|0 - i32.const 0 - local.set $7 - loop $repeat|0 - local.get $7 - local.get $4 - i32.lt_s - i32.eqz - br_if $break|0 - block - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.10 (result i32) - local.get $5 - local.set $8 - local.get $7 - local.set $9 - local.get $6 - local.set $10 - local.get $8 - local.get $9 - i32.const 1 - i32.shl - i32.add - local.get $10 - i32.add - i32.load16_s offset=8 - end - local.get $7 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$viii) - end - local.get $7 - i32.const 1 - i32.add - local.set $7 - br $repeat|0 - unreachable - end - unreachable - end - ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Int16Array,i16> (; 312 ;) (type $FUNCSIG$v) - (local $0 i32) - i32.const 0 - global.set $std/typedarray/forEachCallCount - i32.const 0 - i32.const 3 - call $~lib/typedarray/Int16Array#constructor - local.set $0 - local.get $0 - global.set $std/typedarray/forEachSelf - local.get $0 - i32.const 0 - global.get $std/typedarray/forEachValues - i32.const 0 - call $~lib/array/Array#__get - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 1 - global.get $std/typedarray/forEachValues + local.get $3 i32.const 1 - call $~lib/array/Array#__get - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 2 - global.get $std/typedarray/forEachValues - i32.const 2 - call $~lib/array/Array#__get - i32.const 16 i32.shl - i32.const 16 - i32.shr_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 104 - call $~lib/typedarray/Int16Array#forEach - global.get $std/typedarray/forEachCallCount - i32.const 3 + local.set $7 + local.get $7 + i32.const 0 i32.eq - i32.eqz - if - i32.const 920 - i32.const 8 - i32.const 430 - i32.const 2 - call $~lib/env/abort - unreachable + if (result i32) + i32.const 1 + else + local.get $4 + i32.const 255 + i32.eq + end + if (result i32) + i32.const 1 + else + local.get $1 + call $~lib/builtins/isNaN end - ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint16Array,u16>~anonymous|0 (; 313 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - global.get $std/typedarray/forEachValues - local.get $1 - call $~lib/array/Array#__get - local.set $3 - local.get $0 - i32.const 65535 - i32.and - local.get $3 - i32.const 65535 - i32.and - i32.eq - i32.eqz if - i32.const 752 - i32.const 8 - i32.const 425 - i32.const 4 - call $~lib/env/abort - unreachable + local.get $0 + local.get $1 + f32.mul + local.set $8 + local.get $8 + local.get $8 + f32.div + return end - local.get $1 - global.get $std/typedarray/forEachCallCount - i32.eq - i32.eqz + local.get $2 + i32.const 1 + i32.shl + local.set $9 + local.get $9 + local.get $7 + i32.le_u if - i32.const 800 - i32.const 8 - i32.const 426 - i32.const 4 - call $~lib/env/abort - unreachable + local.get $9 + local.get $7 + i32.eq + if + f32.const 0 + local.get $0 + f32.mul + return + end + local.get $0 + return end - global.get $std/typedarray/forEachSelf - local.get $2 - i32.eq + local.get $4 i32.eqz if - i32.const 848 - i32.const 8 - i32.const 427 - i32.const 4 - call $~lib/env/abort - unreachable - end - global.get $std/typedarray/forEachCallCount - i32.const 1 - i32.add - global.set $std/typedarray/forEachCallCount - ) - (func $~lib/typedarray/Uint16Array#forEach (; 314 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - local.get $0 - local.set $2 - local.get $1 - local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.7 (result i32) + local.get $4 local.get $2 + i32.const 9 + i32.shl + i32.clz + i32.sub local.set $4 + local.get $2 + i32.const 0 local.get $4 - i32.load offset=8 + i32.sub i32.const 1 + i32.add + i32.shl + local.set $2 + else + local.get $2 + i32.const -1 + i32.const 9 i32.shr_u + i32.and + local.set $2 + local.get $2 + i32.const 1 + i32.const 23 + i32.shl + i32.or + local.set $2 end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 - i32.load offset=4 - local.set $6 - block $break|0 + local.get $5 + i32.eqz + if + local.get $5 + local.get $3 + i32.const 9 + i32.shl + i32.clz + i32.sub + local.set $5 + local.get $3 i32.const 0 - local.set $7 - loop $repeat|0 - local.get $7 + local.get $5 + i32.sub + i32.const 1 + i32.add + i32.shl + local.set $3 + else + local.get $3 + i32.const -1 + i32.const 9 + i32.shr_u + i32.and + local.set $3 + local.get $3 + i32.const 1 + i32.const 23 + i32.shl + i32.or + local.set $3 + end + block $break|0 + loop $continue|0 local.get $4 - i32.lt_s - i32.eqz - br_if $break|0 - block - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.10 (result i32) - local.get $5 - local.set $8 - local.get $7 - local.set $9 - local.get $6 - local.set $10 - local.get $8 - local.get $9 - i32.const 1 - i32.shl - i32.add - local.get $10 - i32.add - i32.load16_u offset=8 - end - local.get $7 + local.get $5 + i32.gt_s + if local.get $2 local.get $3 - call_indirect (type $FUNCSIG$viii) + i32.ge_u + if + local.get $2 + local.get $3 + i32.eq + if + f32.const 0 + local.get $0 + f32.mul + return + end + local.get $2 + local.get $3 + i32.sub + local.set $2 + end + local.get $2 + i32.const 1 + i32.shl + local.set $2 + local.get $4 + i32.const 1 + i32.sub + local.set $4 + br $continue|0 end - local.get $7 - i32.const 1 - i32.add - local.set $7 - br $repeat|0 - unreachable end - unreachable - end - ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint16Array,u16> (; 315 ;) (type $FUNCSIG$v) - (local $0 i32) - i32.const 0 - global.set $std/typedarray/forEachCallCount - i32.const 0 - i32.const 3 - call $~lib/typedarray/Uint16Array#constructor - local.set $0 - local.get $0 - global.set $std/typedarray/forEachSelf - local.get $0 - i32.const 0 - global.get $std/typedarray/forEachValues - i32.const 0 - call $~lib/array/Array#__get - i32.const 65535 - i32.and - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 1 - global.get $std/typedarray/forEachValues - i32.const 1 - call $~lib/array/Array#__get - i32.const 65535 - i32.and - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 2 - global.get $std/typedarray/forEachValues - i32.const 2 - call $~lib/array/Array#__get - i32.const 65535 - i32.and - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 105 - call $~lib/typedarray/Uint16Array#forEach - global.get $std/typedarray/forEachCallCount - i32.const 3 - i32.eq - i32.eqz - if - i32.const 920 - i32.const 8 - i32.const 430 - i32.const 2 - call $~lib/env/abort - unreachable end - ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Int32Array,i32>~anonymous|0 (; 316 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - global.get $std/typedarray/forEachValues - local.get $1 - call $~lib/array/Array#__get - local.set $3 - local.get $0 + local.get $2 local.get $3 - i32.eq - i32.eqz + i32.ge_u if - i32.const 752 - i32.const 8 - i32.const 425 - i32.const 4 - call $~lib/env/abort - unreachable + local.get $2 + local.get $3 + i32.eq + if + f32.const 0 + local.get $0 + f32.mul + return + end + local.get $2 + local.get $3 + i32.sub + local.set $2 end - local.get $1 - global.get $std/typedarray/forEachCallCount - i32.eq - i32.eqz + local.get $2 + i32.const 8 + i32.shl + i32.clz + local.set $10 + local.get $4 + local.get $10 + i32.sub + local.set $4 + local.get $2 + local.get $10 + i32.shl + local.set $2 + local.get $4 + i32.const 0 + i32.gt_s if - i32.const 800 - i32.const 8 - i32.const 426 - i32.const 4 - call $~lib/env/abort - unreachable + local.get $2 + i32.const 1 + i32.const 23 + i32.shl + i32.sub + local.set $2 + local.get $2 + local.get $4 + i32.const 23 + i32.shl + i32.or + local.set $2 + else + local.get $2 + i32.const 0 + local.get $4 + i32.sub + i32.const 1 + i32.add + i32.shr_u + local.set $2 end - global.get $std/typedarray/forEachSelf local.get $2 - i32.eq - i32.eqz - if - i32.const 848 - i32.const 8 - i32.const 427 - i32.const 4 - call $~lib/env/abort - unreachable - end - global.get $std/typedarray/forEachCallCount - i32.const 1 - i32.add - global.set $std/typedarray/forEachCallCount + local.get $6 + i32.or + local.set $2 + local.get $2 + f32.reinterpret_i32 + ) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Float32Array,f32>~anonymous|0 (; 319 ;) (type $FUNCSIG$ifii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $0 + f32.const 2 + call $~lib/math/NativeMathf.mod + f32.const 0 + f32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Int32Array#forEach (; 317 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/typedarray/Float32Array#every (; 320 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - local.get $0 - local.set $2 - local.get $1 - local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.15 (result i32) - local.get $2 + block $~lib/typedarray/EVERY<~lib/typedarray/Float32Array,f32>|inlined.0 (result i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 + local.set $2 + local.get $3 + i32.load offset=4 local.set $4 - local.get $4 - i32.load offset=8 - i32.const 2 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 - i32.load offset=4 - local.set $6 - block $break|0 - i32.const 0 - local.set $7 - loop $repeat|0 - local.get $7 - local.get $4 - i32.lt_s - i32.eqz - br_if $break|0 + block $break|0 block - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.11 (result i32) + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Float32Array#get:length + local.set $6 + end + loop $repeat|0 + block $continue|0 local.get $5 - local.set $8 - local.get $7 - local.set $9 local.get $6 - local.set $10 - local.get $8 - local.get $9 - i32.const 2 - i32.shl - i32.add - local.get $10 - i32.add - i32.load offset=8 + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + i32.const 3 + global.set $~lib/argc + local.get $4 + local.get $5 + i32.const 2 + i32.shl + i32.add + f32.load + local.get $5 + local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$ifii) + end + if + br $continue|0 + end + i32.const 0 + local.set $7 + local.get $3 + call $~lib/rt/pure/__release + local.get $7 + br $~lib/typedarray/EVERY<~lib/typedarray/Float32Array,f32>|inlined.0 end - local.get $7 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$viii) + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|0 + unreachable end - local.get $7 - i32.const 1 - i32.add - local.set $7 - br $repeat|0 unreachable end - unreachable + i32.const 1 + local.set $6 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 end ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Int32Array,i32> (; 318 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Float32Array,f32>~anonymous|1 (; 321 ;) (type $FUNCSIG$ifii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $0 + f32.const 2 + f32.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Float32Array,f32> (; 322 ;) (type $FUNCSIG$v) (local $0 i32) - i32.const 0 - global.set $std/typedarray/forEachCallCount + (local $1 i32) + (local $2 i32) + (local $3 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Int32Array#constructor - local.set $0 - local.get $0 - global.set $std/typedarray/forEachSelf - local.get $0 - i32.const 0 - global.get $std/typedarray/forEachValues + call $~lib/typedarray/Float32Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - call $~lib/array/Array#__get - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 1 - global.get $std/typedarray/forEachValues + f32.const 2 + call $~lib/typedarray/Float32Array#__set + local.get $1 i32.const 1 - call $~lib/array/Array#__get - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 2 - global.get $std/typedarray/forEachValues + f32.const 4 + call $~lib/typedarray/Float32Array#__set + local.get $1 i32.const 2 - call $~lib/array/Array#__get - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 106 - call $~lib/typedarray/Int32Array#forEach - global.get $std/typedarray/forEachCallCount - i32.const 3 - i32.eq + f32.const 6 + call $~lib/typedarray/Float32Array#__set + local.get $1 + i32.const 97 + call $~lib/typedarray/Float32Array#every + local.set $2 + local.get $2 + i32.const 0 + i32.ne i32.eqz if - i32.const 920 - i32.const 8 - i32.const 430 + i32.const 0 + i32.const 24 + i32.const 406 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint32Array,u32>~anonymous|0 (; 319 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - global.get $std/typedarray/forEachValues local.get $1 - call $~lib/array/Array#__get + i32.const 98 + call $~lib/typedarray/Float32Array#every local.set $3 - local.get $0 local.get $3 - i32.eq + i32.const 0 + i32.ne + i32.eqz i32.eqz if - i32.const 752 - i32.const 8 - i32.const 425 - i32.const 4 - call $~lib/env/abort + i32.const 0 + i32.const 24 + i32.const 409 + i32.const 2 + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release local.get $1 - global.get $std/typedarray/forEachCallCount - i32.eq - i32.eqz + call $~lib/rt/pure/__release + ) + (func $~lib/builtins/isNaN (; 323 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + local.get $0 + f64.ne + ) + (func $~lib/math/NativeMath.mod (; 324 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (local $2 i64) + (local $3 i64) + (local $4 i64) + (local $5 i64) + (local $6 i64) + (local $7 i64) + (local $8 f64) + (local $9 i64) + (local $10 i64) + local.get $0 + i64.reinterpret_f64 + local.set $2 + local.get $1 + i64.reinterpret_f64 + local.set $3 + local.get $2 + i64.const 52 + i64.shr_u + i64.const 2047 + i64.and + local.set $4 + local.get $3 + i64.const 52 + i64.shr_u + i64.const 2047 + i64.and + local.set $5 + local.get $2 + i64.const 63 + i64.shr_u + local.set $6 + local.get $3 + i64.const 1 + i64.shl + local.set $7 + local.get $7 + i64.const 0 + i64.eq + if (result i32) + i32.const 1 + else + local.get $4 + i64.const 2047 + i64.eq + end + if (result i32) + i32.const 1 + else + local.get $1 + call $~lib/builtins/isNaN + end if - i32.const 800 - i32.const 8 - i32.const 426 - i32.const 4 - call $~lib/env/abort - unreachable + local.get $0 + local.get $1 + f64.mul + local.set $8 + local.get $8 + local.get $8 + f64.div + return end - global.get $std/typedarray/forEachSelf local.get $2 - i32.eq - i32.eqz + i64.const 1 + i64.shl + local.set $9 + local.get $9 + local.get $7 + i64.le_u if - i32.const 848 - i32.const 8 - i32.const 427 - i32.const 4 - call $~lib/env/abort - unreachable + local.get $9 + local.get $7 + i64.eq + if + f64.const 0 + local.get $0 + f64.mul + return + end + local.get $0 + return end - global.get $std/typedarray/forEachCallCount - i32.const 1 - i32.add - global.set $std/typedarray/forEachCallCount - ) - (func $~lib/typedarray/Uint32Array#forEach (; 320 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - local.get $0 - local.set $2 - local.get $1 - local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.7 (result i32) + local.get $4 + i64.eqz + if + local.get $4 local.get $2 + i64.const 12 + i64.shl + i64.clz + i64.sub local.set $4 + local.get $2 + i64.const 0 local.get $4 - i32.load offset=8 - i32.const 2 - i32.shr_u + i64.sub + i64.const 1 + i64.add + i64.shl + local.set $2 + else + local.get $2 + i64.const -1 + i64.const 12 + i64.shr_u + i64.and + local.set $2 + local.get $2 + i64.const 1 + i64.const 52 + i64.shl + i64.or + local.set $2 + end + local.get $5 + i64.eqz + if + local.get $5 + local.get $3 + i64.const 12 + i64.shl + i64.clz + i64.sub + local.set $5 + local.get $3 + i64.const 0 + local.get $5 + i64.sub + i64.const 1 + i64.add + i64.shl + local.set $3 + else + local.get $3 + i64.const -1 + i64.const 12 + i64.shr_u + i64.and + local.set $3 + local.get $3 + i64.const 1 + i64.const 52 + i64.shl + i64.or + local.set $3 end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 - i32.load offset=4 - local.set $6 block $break|0 - i32.const 0 - local.set $7 - loop $repeat|0 - local.get $7 + loop $continue|0 local.get $4 - i32.lt_s - i32.eqz - br_if $break|0 - block - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.10 (result i32) - local.get $5 - local.set $8 - local.get $7 - local.set $9 - local.get $6 - local.set $10 - local.get $8 - local.get $9 - i32.const 2 - i32.shl - i32.add - local.get $10 - i32.add - i32.load offset=8 - end - local.get $7 + local.get $5 + i64.gt_s + if local.get $2 local.get $3 - call_indirect (type $FUNCSIG$viii) + i64.ge_u + if + local.get $2 + local.get $3 + i64.eq + if + f64.const 0 + local.get $0 + f64.mul + return + end + local.get $2 + local.get $3 + i64.sub + local.set $2 + end + local.get $2 + i64.const 1 + i64.shl + local.set $2 + local.get $4 + i64.const 1 + i64.sub + local.set $4 + br $continue|0 end - local.get $7 - i32.const 1 - i32.add - local.set $7 - br $repeat|0 - unreachable end - unreachable end - ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint32Array,u32> (; 321 ;) (type $FUNCSIG$v) - (local $0 i32) - i32.const 0 - global.set $std/typedarray/forEachCallCount - i32.const 0 - i32.const 3 - call $~lib/typedarray/Uint32Array#constructor - local.set $0 - local.get $0 - global.set $std/typedarray/forEachSelf - local.get $0 - i32.const 0 - global.get $std/typedarray/forEachValues - i32.const 0 - call $~lib/array/Array#__get - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 1 - global.get $std/typedarray/forEachValues - i32.const 1 - call $~lib/array/Array#__get - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 2 - global.get $std/typedarray/forEachValues - i32.const 2 - call $~lib/array/Array#__get - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 107 - call $~lib/typedarray/Uint32Array#forEach - global.get $std/typedarray/forEachCallCount - i32.const 3 - i32.eq - i32.eqz + local.get $2 + local.get $3 + i64.ge_u if - i32.const 920 - i32.const 8 - i32.const 430 - i32.const 2 - call $~lib/env/abort - unreachable + local.get $2 + local.get $3 + i64.eq + if + f64.const 0 + local.get $0 + f64.mul + return + end + local.get $2 + local.get $3 + i64.sub + local.set $2 + end + local.get $2 + i64.const 11 + i64.shl + i64.clz + local.set $10 + local.get $4 + local.get $10 + i64.sub + local.set $4 + local.get $2 + local.get $10 + i64.shl + local.set $2 + local.get $4 + i64.const 0 + i64.gt_s + if + local.get $2 + i64.const 1 + i64.const 52 + i64.shl + i64.sub + local.set $2 + local.get $2 + local.get $4 + i64.const 52 + i64.shl + i64.or + local.set $2 + else + local.get $2 + i64.const 0 + local.get $4 + i64.sub + i64.const 1 + i64.add + i64.shr_u + local.set $2 end + local.get $2 + local.get $6 + i64.const 63 + i64.shl + i64.or + local.set $2 + local.get $2 + f64.reinterpret_i64 ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Int64Array,i64>~anonymous|0 (; 322 ;) (type $FUNCSIG$vjii) (param $0 i64) (param $1 i32) (param $2 i32) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Float64Array,f64>~anonymous|0 (; 325 ;) (type $FUNCSIG$idii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - global.get $std/typedarray/forEachValues - local.get $1 - call $~lib/array/Array#__get - local.set $3 + local.get $2 + call $~lib/rt/pure/__retain + drop local.get $0 - local.get $3 - i64.extend_i32_s - i64.eq - i32.eqz - if - i32.const 752 - i32.const 8 - i32.const 425 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $1 - global.get $std/typedarray/forEachCallCount - i32.eq - i32.eqz - if - i32.const 800 - i32.const 8 - i32.const 426 - i32.const 4 - call $~lib/env/abort - unreachable - end - global.get $std/typedarray/forEachSelf + f64.const 2 + call $~lib/math/NativeMath.mod + f64.const 0 + f64.eq + local.set $3 local.get $2 - i32.eq - i32.eqz - if - i32.const 848 - i32.const 8 - i32.const 427 - i32.const 4 - call $~lib/env/abort - unreachable - end - global.get $std/typedarray/forEachCallCount - i32.const 1 - i32.add - global.set $std/typedarray/forEachCallCount + call $~lib/rt/pure/__release + local.get $3 ) - (func $~lib/typedarray/Int64Array#forEach (; 323 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/typedarray/Float64Array#every (; 326 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - local.get $0 - local.set $2 - local.get $1 - local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.7 (result i32) - local.get $2 + block $~lib/typedarray/EVERY<~lib/typedarray/Float64Array,f64>|inlined.0 (result i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 + local.set $2 + local.get $3 + i32.load offset=4 local.set $4 - local.get $4 - i32.load offset=8 - i32.const 3 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 - i32.load offset=4 - local.set $6 - block $break|0 - i32.const 0 - local.set $7 - loop $repeat|0 - local.get $7 - local.get $4 - i32.lt_s - i32.eqz - br_if $break|0 + block $break|0 block - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.10 (result i64) + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Float64Array#get:length + local.set $6 + end + loop $repeat|0 + block $continue|0 local.get $5 - local.set $8 - local.get $7 - local.set $9 local.get $6 - local.set $10 - local.get $8 - local.get $9 - i32.const 3 - i32.shl - i32.add - local.get $10 - i32.add - i64.load offset=8 + i32.lt_s + i32.eqz + br_if $break|0 + block (result i32) + i32.const 3 + global.set $~lib/argc + local.get $4 + local.get $5 + i32.const 3 + i32.shl + i32.add + f64.load + local.get $5 + local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$idii) + end + if + br $continue|0 + end + i32.const 0 + local.set $7 + local.get $3 + call $~lib/rt/pure/__release + local.get $7 + br $~lib/typedarray/EVERY<~lib/typedarray/Float64Array,f64>|inlined.0 end - local.get $7 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$vjii) + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|0 + unreachable end - local.get $7 - i32.const 1 - i32.add - local.set $7 - br $repeat|0 unreachable end - unreachable + i32.const 1 + local.set $6 + local.get $3 + call $~lib/rt/pure/__release + local.get $6 end ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Int64Array,i64> (; 324 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Float64Array,f64>~anonymous|1 (; 327 ;) (type $FUNCSIG$idii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $0 + f64.const 2 + f64.eq + local.set $3 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + ) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Float64Array,f64> (; 328 ;) (type $FUNCSIG$v) (local $0 i32) - i32.const 0 - global.set $std/typedarray/forEachCallCount + (local $1 i32) + (local $2 i32) + (local $3 i32) i32.const 0 i32.const 3 - call $~lib/typedarray/Int64Array#constructor - local.set $0 - local.get $0 - global.set $std/typedarray/forEachSelf - local.get $0 - i32.const 0 - global.get $std/typedarray/forEachValues + call $~lib/typedarray/Float64Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.const 0 - call $~lib/array/Array#__get - i64.extend_i32_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 1 - global.get $std/typedarray/forEachValues + f64.const 2 + call $~lib/typedarray/Float64Array#__set + local.get $1 i32.const 1 - call $~lib/array/Array#__get - i64.extend_i32_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 2 - global.get $std/typedarray/forEachValues + f64.const 4 + call $~lib/typedarray/Float64Array#__set + local.get $1 i32.const 2 - call $~lib/array/Array#__get - i64.extend_i32_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 108 - call $~lib/typedarray/Int64Array#forEach - global.get $std/typedarray/forEachCallCount - i32.const 3 - i32.eq + f64.const 6 + call $~lib/typedarray/Float64Array#__set + local.get $1 + i32.const 99 + call $~lib/typedarray/Float64Array#every + local.set $2 + local.get $2 + i32.const 0 + i32.ne i32.eqz if - i32.const 920 - i32.const 8 - i32.const 430 + i32.const 0 + i32.const 24 + i32.const 406 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 100 + call $~lib/typedarray/Float64Array#every + local.set $3 + local.get $3 + i32.const 0 + i32.ne + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 409 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint64Array,u64>~anonymous|0 (; 325 ;) (type $FUNCSIG$vjii) (param $0 i64) (param $1 i32) (param $2 i32) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Int8Array,i8>~anonymous|0 (; 329 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop global.get $std/typedarray/forEachValues local.get $1 call $~lib/array/Array#__get local.set $3 local.get $0 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s local.get $3 - i64.extend_i32_s - i64.eq + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.eq i32.eqz if - i32.const 752 - i32.const 8 - i32.const 425 + i32.const 1144 + i32.const 24 + i32.const 436 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -15896,11 +16364,11 @@ i32.eq i32.eqz if - i32.const 800 - i32.const 8 - i32.const 426 + i32.const 1208 + i32.const 24 + i32.const 437 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/typedarray/forEachSelf @@ -15908,154 +16376,158 @@ i32.eq i32.eqz if - i32.const 848 - i32.const 8 - i32.const 427 + i32.const 1272 + i32.const 24 + i32.const 438 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/typedarray/forEachCallCount i32.const 1 i32.add global.set $std/typedarray/forEachCallCount + local.get $2 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint64Array#forEach (; 326 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/typedarray/Int8Array#forEach (; 330 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) local.get $0 - local.set $2 - local.get $1 + call $~lib/rt/pure/__retain local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.7 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 3 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 + local.get $1 + local.set $2 + local.get $3 i32.load offset=4 - local.set $6 + local.set $4 block $break|0 - i32.const 0 - local.set $7 + block + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Int8Array#get:length + local.set $6 + end loop $repeat|0 - local.get $7 - local.get $4 + local.get $5 + local.get $6 i32.lt_s i32.eqz br_if $break|0 - block - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.10 (result i64) - local.get $5 - local.set $8 - local.get $7 - local.set $9 - local.get $6 - local.set $10 - local.get $8 - local.get $9 - i32.const 3 - i32.shl - i32.add - local.get $10 - i32.add - i64.load offset=8 - end - local.get $7 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$vjii) - end - local.get $7 + i32.const 3 + global.set $~lib/argc + local.get $4 + local.get $5 + i32.const 0 + i32.shl + i32.add + i32.load8_s + local.get $5 + local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$viii) + local.get $5 i32.const 1 i32.add - local.set $7 + local.set $5 br $repeat|0 unreachable end unreachable end + local.get $3 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint64Array,u64> (; 327 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Int8Array,i8> (; 331 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 0 global.set $std/typedarray/forEachCallCount i32.const 0 i32.const 3 - call $~lib/typedarray/Uint64Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Int8Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 global.set $std/typedarray/forEachSelf - local.get $0 + local.get $1 i32.const 0 global.get $std/typedarray/forEachValues i32.const 0 call $~lib/array/Array#__get - i64.extend_i32_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + call $~lib/typedarray/Int8Array#__set + local.get $1 i32.const 1 global.get $std/typedarray/forEachValues i32.const 1 call $~lib/array/Array#__get - i64.extend_i32_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + call $~lib/typedarray/Int8Array#__set + local.get $1 i32.const 2 global.get $std/typedarray/forEachValues i32.const 2 call $~lib/array/Array#__get - i64.extend_i32_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 109 - call $~lib/typedarray/Uint64Array#forEach + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + call $~lib/typedarray/Int8Array#__set + local.get $1 + i32.const 101 + call $~lib/typedarray/Int8Array#forEach global.get $std/typedarray/forEachCallCount i32.const 3 i32.eq i32.eqz if - i32.const 920 - i32.const 8 - i32.const 430 + i32.const 1352 + i32.const 24 + i32.const 441 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Float32Array,f32>~anonymous|0 (; 328 ;) (type $FUNCSIG$vfii) (param $0 f32) (param $1 i32) (param $2 i32) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint8Array,u8>~anonymous|0 (; 332 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop global.get $std/typedarray/forEachValues local.get $1 call $~lib/array/Array#__get local.set $3 local.get $0 + i32.const 255 + i32.and local.get $3 - f32.convert_i32_s - f32.eq + i32.const 255 + i32.and + i32.eq i32.eqz if - i32.const 752 - i32.const 8 - i32.const 425 + i32.const 1144 + i32.const 24 + i32.const 436 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -16063,11 +16535,11 @@ i32.eq i32.eqz if - i32.const 800 - i32.const 8 - i32.const 426 + i32.const 1208 + i32.const 24 + i32.const 437 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/typedarray/forEachSelf @@ -16075,154 +16547,152 @@ i32.eq i32.eqz if - i32.const 848 - i32.const 8 - i32.const 427 + i32.const 1272 + i32.const 24 + i32.const 438 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/typedarray/forEachCallCount i32.const 1 i32.add global.set $std/typedarray/forEachCallCount + local.get $2 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Float32Array#forEach (; 329 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/typedarray/Uint8Array#forEach (; 333 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) local.get $0 - local.set $2 - local.get $1 + call $~lib/rt/pure/__retain local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.7 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 2 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 + local.get $1 + local.set $2 + local.get $3 i32.load offset=4 - local.set $6 + local.set $4 block $break|0 - i32.const 0 - local.set $7 + block + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Uint8Array#get:length + local.set $6 + end loop $repeat|0 - local.get $7 - local.get $4 + local.get $5 + local.get $6 i32.lt_s i32.eqz br_if $break|0 - block - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.10 (result f32) - local.get $5 - local.set $8 - local.get $7 - local.set $9 - local.get $6 - local.set $10 - local.get $8 - local.get $9 - i32.const 2 - i32.shl - i32.add - local.get $10 - i32.add - f32.load offset=8 - end - local.get $7 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$vfii) - end - local.get $7 + i32.const 3 + global.set $~lib/argc + local.get $4 + local.get $5 + i32.const 0 + i32.shl + i32.add + i32.load8_u + local.get $5 + local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$viii) + local.get $5 i32.const 1 i32.add - local.set $7 + local.set $5 br $repeat|0 unreachable end unreachable end + local.get $3 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Float32Array,f32> (; 330 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint8Array,u8> (; 334 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 0 global.set $std/typedarray/forEachCallCount i32.const 0 i32.const 3 - call $~lib/typedarray/Float32Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Uint8Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 global.set $std/typedarray/forEachSelf - local.get $0 + local.get $1 i32.const 0 global.get $std/typedarray/forEachValues i32.const 0 call $~lib/array/Array#__get - f32.convert_i32_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + i32.const 255 + i32.and + call $~lib/typedarray/Uint8Array#__set + local.get $1 i32.const 1 global.get $std/typedarray/forEachValues i32.const 1 call $~lib/array/Array#__get - f32.convert_i32_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + i32.const 255 + i32.and + call $~lib/typedarray/Uint8Array#__set + local.get $1 i32.const 2 global.get $std/typedarray/forEachValues i32.const 2 call $~lib/array/Array#__get - f32.convert_i32_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 110 - call $~lib/typedarray/Float32Array#forEach + i32.const 255 + i32.and + call $~lib/typedarray/Uint8Array#__set + local.get $1 + i32.const 102 + call $~lib/typedarray/Uint8Array#forEach global.get $std/typedarray/forEachCallCount i32.const 3 i32.eq i32.eqz if - i32.const 920 - i32.const 8 - i32.const 430 + i32.const 1352 + i32.const 24 + i32.const 441 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Float64Array,f64>~anonymous|0 (; 331 ;) (type $FUNCSIG$vdii) (param $0 f64) (param $1 i32) (param $2 i32) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 (; 335 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop global.get $std/typedarray/forEachValues local.get $1 call $~lib/array/Array#__get local.set $3 local.get $0 + i32.const 255 + i32.and local.get $3 - f64.convert_i32_s - f64.eq + i32.const 255 + i32.and + i32.eq i32.eqz if - i32.const 752 - i32.const 8 - i32.const 425 + i32.const 1144 + i32.const 24 + i32.const 436 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end local.get $1 @@ -16230,11 +16700,11 @@ i32.eq i32.eqz if - i32.const 800 - i32.const 8 - i32.const 426 + i32.const 1208 + i32.const 24 + i32.const 437 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/typedarray/forEachSelf @@ -16242,1271 +16712,1416 @@ i32.eq i32.eqz if - i32.const 848 - i32.const 8 - i32.const 427 + i32.const 1272 + i32.const 24 + i32.const 438 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $std/typedarray/forEachCallCount i32.const 1 i32.add global.set $std/typedarray/forEachCallCount + local.get $2 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Float64Array#forEach (; 332 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/typedarray/Uint8ClampedArray#forEach (; 336 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) local.get $0 - local.set $2 - local.get $1 + call $~lib/rt/pure/__retain local.set $3 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.10 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.load offset=8 - i32.const 3 - i32.shr_u - end - local.set $4 - local.get $2 - i32.load - local.set $5 - local.get $2 + local.get $1 + local.set $2 + local.get $3 i32.load offset=4 - local.set $6 + local.set $4 block $break|0 - i32.const 0 - local.set $7 + block + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Uint8ClampedArray#get:length + local.set $6 + end loop $repeat|0 - local.get $7 - local.get $4 + local.get $5 + local.get $6 i32.lt_s i32.eqz br_if $break|0 - block - i32.const 3 - global.set $~lib/argc - block $~lib/internal/arraybuffer/LOAD|inlined.22 (result f64) - local.get $5 - local.set $8 - local.get $7 - local.set $9 - local.get $6 - local.set $10 - local.get $8 - local.get $9 - i32.const 3 - i32.shl - i32.add - local.get $10 - i32.add - f64.load offset=8 - end - local.get $7 - local.get $2 - local.get $3 - call_indirect (type $FUNCSIG$vdii) - end - local.get $7 + i32.const 3 + global.set $~lib/argc + local.get $4 + local.get $5 + i32.const 0 + i32.shl + i32.add + i32.load8_u + local.get $5 + local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$viii) + local.get $5 i32.const 1 i32.add - local.set $7 + local.set $5 br $repeat|0 unreachable end unreachable end + local.get $3 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Float64Array,f64> (; 333 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint8ClampedArray,u8> (; 337 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 0 global.set $std/typedarray/forEachCallCount i32.const 0 i32.const 3 - call $~lib/typedarray/Float64Array#constructor - local.set $0 - local.get $0 + call $~lib/typedarray/Uint8ClampedArray#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 global.set $std/typedarray/forEachSelf - local.get $0 + local.get $1 i32.const 0 global.get $std/typedarray/forEachValues i32.const 0 call $~lib/array/Array#__get - f64.convert_i32_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + i32.const 255 + i32.and + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $1 i32.const 1 global.get $std/typedarray/forEachValues i32.const 1 call $~lib/array/Array#__get - f64.convert_i32_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 + i32.const 255 + i32.and + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $1 i32.const 2 global.get $std/typedarray/forEachValues i32.const 2 call $~lib/array/Array#__get - f64.convert_i32_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $0 - i32.const 111 - call $~lib/typedarray/Float64Array#forEach + i32.const 255 + i32.and + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $1 + i32.const 103 + call $~lib/typedarray/Uint8ClampedArray#forEach global.get $std/typedarray/forEachCallCount i32.const 3 i32.eq i32.eqz if - i32.const 920 - i32.const 8 - i32.const 430 + i32.const 1352 + i32.const 24 + i32.const 441 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int8Array#reverse (; 334 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Int16Array,i16>~anonymous|0 (; 338 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + global.get $std/typedarray/forEachValues + local.get $1 + call $~lib/array/Array#__get + local.set $3 + local.get $0 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + local.get $3 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + i32.eq + i32.eqz + if + i32.const 1144 + i32.const 24 + i32.const 436 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $1 + global.get $std/typedarray/forEachCallCount + i32.eq + i32.eqz + if + i32.const 1208 + i32.const 24 + i32.const 437 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + global.get $std/typedarray/forEachSelf + local.get $2 + i32.eq + i32.eqz + if + i32.const 1272 + i32.const 24 + i32.const 438 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + global.get $std/typedarray/forEachCallCount + i32.const 1 + i32.add + global.set $std/typedarray/forEachCallCount + local.get $2 + call $~lib/rt/pure/__release + ) + (func $~lib/typedarray/Int16Array#forEach (; 339 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) local.get $0 - local.set $1 + call $~lib/rt/pure/__retain + local.set $3 local.get $1 - i32.load local.set $2 - local.get $1 + local.get $3 i32.load offset=4 - local.set $3 + local.set $4 block $break|0 block i32.const 0 - local.set $4 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.17 (result i32) - local.get $1 - local.set $5 - local.get $5 - i32.load offset=8 - i32.const 0 - i32.shr_u - end - i32.const 1 - i32.sub local.set $5 - end - loop $repeat|0 - local.get $4 - local.get $5 - i32.lt_s - i32.eqz - br_if $break|0 - block - block $~lib/internal/arraybuffer/LOAD|inlined.12 (result i32) - local.get $2 - local.set $6 - local.get $4 - local.set $7 - local.get $3 - local.set $8 - local.get $6 - local.get $7 - i32.const 0 - i32.shl - i32.add - local.get $8 - i32.add - i32.load8_s offset=8 - end - local.set $8 - block $~lib/internal/arraybuffer/STORE|inlined.0 - local.get $2 - local.set $7 - local.get $4 - local.set $6 - block $~lib/internal/arraybuffer/LOAD|inlined.13 (result i32) - local.get $2 - local.set $9 - local.get $5 - local.set $10 - local.get $3 - local.set $11 - local.get $9 - local.get $10 - i32.const 0 - i32.shl - i32.add - local.get $11 - i32.add - i32.load8_s offset=8 - end - local.set $11 - local.get $3 - local.set $10 - local.get $7 - local.get $6 - i32.const 0 - i32.shl - i32.add - local.get $10 - i32.add - local.get $11 - i32.store8 offset=8 - end - block $~lib/internal/arraybuffer/STORE|inlined.1 - local.get $2 - local.set $10 - local.get $5 - local.set $11 - local.get $8 - local.set $6 - local.get $3 - local.set $7 - local.get $10 - local.get $11 - i32.const 0 - i32.shl - i32.add - local.get $7 - i32.add - local.get $6 - i32.store8 offset=8 - end - end - block - local.get $4 - i32.const 1 - i32.add - local.set $4 - local.get $5 - i32.const 1 - i32.sub - local.set $5 - end - br $repeat|0 - unreachable - end - unreachable - end - local.get $1 - ) - (func $std/typedarray/testArrayReverse<~lib/typedarray/Int8Array,i8> (; 335 ;) (type $FUNCSIG$v) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - global.get $std/typedarray/testArrayReverseValues - local.set $0 - i32.const 0 - i32.const 9 - call $~lib/typedarray/Int8Array#constructor - local.set $1 - i32.const 0 - i32.const 9 - call $~lib/typedarray/Int8Array#constructor - local.set $2 - i32.const 0 - local.set $3 - block $break|0 - i32.const 0 - local.set $3 - loop $repeat|0 - local.get $3 - i32.const 9 - i32.lt_s - i32.eqz - br_if $break|0 - block - local.get $1 - local.get $3 - local.get $0 - local.get $3 - call $~lib/array/Array#__get - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $2 - local.get $3 - local.get $0 - local.get $3 - call $~lib/array/Array#__get - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/internal/typedarray/TypedArray#__set - end - local.get $3 - i32.const 1 - i32.add - local.set $3 - br $repeat|0 - unreachable - end - unreachable - end - local.get $1 - call $~lib/typedarray/Int8Array#reverse - drop - block $break|1 - i32.const 0 - local.set $3 - loop $repeat|1 - local.get $3 - i32.const 9 - i32.lt_s - i32.eqz - br_if $break|1 - local.get $1 - local.get $3 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - local.get $0 - i32.const 8 local.get $3 - i32.sub - call $~lib/array/Array#__get - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.eq + call $~lib/typedarray/Int16Array#get:length + local.set $6 + end + loop $repeat|0 + local.get $5 + local.get $6 + i32.lt_s i32.eqz - if - i32.const 1056 - i32.const 8 - i32.const 461 - i32.const 4 - call $~lib/env/abort - unreachable - end + br_if $break|0 + i32.const 3 + global.set $~lib/argc + local.get $4 + local.get $5 + i32.const 1 + i32.shl + i32.add + i32.load16_s + local.get $5 local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$viii) + local.get $5 i32.const 1 i32.add - local.set $3 - br $repeat|1 + local.set $5 + br $repeat|0 unreachable end unreachable end - local.get $2 - i32.const 4 - i32.const 8 - call $~lib/typedarray/Int8Array#subarray - call $~lib/typedarray/Int8Array#reverse - local.set $4 - local.get $4 + local.get $3 + call $~lib/rt/pure/__release + ) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Int16Array,i16> (; 340 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 24 + global.set $std/typedarray/forEachCallCount + i32.const 0 + i32.const 3 + call $~lib/typedarray/Int16Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 + global.set $std/typedarray/forEachSelf + local.get $1 + i32.const 0 + global.get $std/typedarray/forEachValues + i32.const 0 + call $~lib/array/Array#__get + i32.const 16 i32.shl - i32.const 24 + i32.const 16 i32.shr_s - i32.const 8 + call $~lib/typedarray/Int16Array#__set + local.get $1 + i32.const 1 + global.get $std/typedarray/forEachValues + i32.const 1 + call $~lib/array/Array#__get + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + call $~lib/typedarray/Int16Array#__set + local.get $1 + i32.const 2 + global.get $std/typedarray/forEachValues + i32.const 2 + call $~lib/array/Array#__get + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + call $~lib/typedarray/Int16Array#__set + local.get $1 + i32.const 104 + call $~lib/typedarray/Int16Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 466 + i32.const 1352 + i32.const 24 + i32.const 441 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $4 - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.const 7 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + ) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint16Array,u16>~anonymous|0 (; 341 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + global.get $std/typedarray/forEachValues + local.get $1 + call $~lib/array/Array#__get + local.set $3 + local.get $0 + i32.const 65535 + i32.and + local.get $3 + i32.const 65535 + i32.and i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 467 - i32.const 2 - call $~lib/env/abort + i32.const 1144 + i32.const 24 + i32.const 436 + i32.const 4 + call $~lib/builtins/abort unreachable end - local.get $4 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.const 6 + local.get $1 + global.get $std/typedarray/forEachCallCount i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 468 - i32.const 2 - call $~lib/env/abort + i32.const 1208 + i32.const 24 + i32.const 437 + i32.const 4 + call $~lib/builtins/abort unreachable end - local.get $4 - i32.const 3 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.const 5 + global.get $std/typedarray/forEachSelf + local.get $2 i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 469 - i32.const 2 - call $~lib/env/abort + i32.const 1272 + i32.const 24 + i32.const 438 + i32.const 4 + call $~lib/builtins/abort unreachable end + global.get $std/typedarray/forEachCallCount + i32.const 1 + i32.add + global.set $std/typedarray/forEachCallCount + local.get $2 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint8Array#reverse (; 336 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/typedarray/Uint16Array#forEach (; 342 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) local.get $0 - local.set $1 + call $~lib/rt/pure/__retain + local.set $3 local.get $1 - i32.load local.set $2 - local.get $1 + local.get $3 i32.load offset=4 - local.set $3 + local.set $4 block $break|0 block i32.const 0 - local.set $4 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.16 (result i32) - local.get $1 - local.set $5 - local.get $5 - i32.load offset=8 - i32.const 0 - i32.shr_u - end - i32.const 1 - i32.sub local.set $5 + local.get $3 + call $~lib/typedarray/Uint16Array#get:length + local.set $6 end loop $repeat|0 - local.get $4 local.get $5 + local.get $6 i32.lt_s i32.eqz br_if $break|0 - block - block $~lib/internal/arraybuffer/LOAD|inlined.21 (result i32) - local.get $2 - local.set $6 - local.get $4 - local.set $7 - local.get $3 - local.set $8 - local.get $6 - local.get $7 - i32.const 0 - i32.shl - i32.add - local.get $8 - i32.add - i32.load8_u offset=8 - end - local.set $8 - block $~lib/internal/arraybuffer/STORE|inlined.0 - local.get $2 - local.set $7 - local.get $4 - local.set $6 - block $~lib/internal/arraybuffer/LOAD|inlined.22 (result i32) - local.get $2 - local.set $9 - local.get $5 - local.set $10 - local.get $3 - local.set $11 - local.get $9 - local.get $10 - i32.const 0 - i32.shl - i32.add - local.get $11 - i32.add - i32.load8_u offset=8 - end - local.set $11 - local.get $3 - local.set $10 - local.get $7 - local.get $6 - i32.const 0 - i32.shl - i32.add - local.get $10 - i32.add - local.get $11 - i32.store8 offset=8 - end - block $~lib/internal/arraybuffer/STORE|inlined.1 - local.get $2 - local.set $10 - local.get $5 - local.set $11 - local.get $8 - local.set $6 - local.get $3 - local.set $7 - local.get $10 - local.get $11 - i32.const 0 - i32.shl - i32.add - local.get $7 - i32.add - local.get $6 - i32.store8 offset=8 - end - end - block - local.get $4 - i32.const 1 - i32.add - local.set $4 - local.get $5 - i32.const 1 - i32.sub - local.set $5 - end + i32.const 3 + global.set $~lib/argc + local.get $4 + local.get $5 + i32.const 1 + i32.shl + i32.add + i32.load16_u + local.get $5 + local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$viii) + local.get $5 + i32.const 1 + i32.add + local.set $5 br $repeat|0 unreachable end unreachable end + local.get $3 + call $~lib/rt/pure/__release + ) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint16Array,u16> (; 343 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 0 + i32.const 3 + call $~lib/typedarray/Uint16Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 + global.set $std/typedarray/forEachSelf + local.get $1 + i32.const 0 + global.get $std/typedarray/forEachValues + i32.const 0 + call $~lib/array/Array#__get + i32.const 65535 + i32.and + call $~lib/typedarray/Uint16Array#__set + local.get $1 + i32.const 1 + global.get $std/typedarray/forEachValues + i32.const 1 + call $~lib/array/Array#__get + i32.const 65535 + i32.and + call $~lib/typedarray/Uint16Array#__set + local.get $1 + i32.const 2 + global.get $std/typedarray/forEachValues + i32.const 2 + call $~lib/array/Array#__get + i32.const 65535 + i32.and + call $~lib/typedarray/Uint16Array#__set + local.get $1 + i32.const 105 + call $~lib/typedarray/Uint16Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.eq + i32.eqz + if + i32.const 1352 + i32.const 24 + i32.const 441 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + ) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Int32Array,i32>~anonymous|0 (; 344 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + global.get $std/typedarray/forEachValues + local.get $1 + call $~lib/array/Array#__get + local.set $3 + local.get $0 + local.get $3 + i32.eq + i32.eqz + if + i32.const 1144 + i32.const 24 + i32.const 436 + i32.const 4 + call $~lib/builtins/abort + unreachable + end local.get $1 + global.get $std/typedarray/forEachCallCount + i32.eq + i32.eqz + if + i32.const 1208 + i32.const 24 + i32.const 437 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + global.get $std/typedarray/forEachSelf + local.get $2 + i32.eq + i32.eqz + if + i32.const 1272 + i32.const 24 + i32.const 438 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + global.get $std/typedarray/forEachCallCount + i32.const 1 + i32.add + global.set $std/typedarray/forEachCallCount + local.get $2 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint8Array#subarray (; 337 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/typedarray/Int32Array#forEach (; 345 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - (local $8 i32) local.get $0 + call $~lib/rt/pure/__retain local.set $3 local.get $1 + local.set $2 + local.get $3 + i32.load offset=4 local.set $4 - local.get $2 - local.set $5 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.17 (result i32) - local.get $3 - local.set $6 - local.get $6 - i32.load offset=8 - i32.const 0 - i32.shr_u - end - local.set $6 - local.get $4 - i32.const 0 - i32.lt_s - if - local.get $6 - local.get $4 - i32.add - local.tee $7 - i32.const 0 - local.tee $8 - local.get $7 - local.get $8 - i32.gt_s - select - local.set $4 - else - local.get $4 - local.tee $7 - local.get $6 - local.tee $8 - local.get $7 - local.get $8 - i32.lt_s - select - local.set $4 - end - local.get $5 - i32.const 0 - i32.lt_s - if - local.get $6 - local.get $5 - i32.add - local.tee $7 - local.get $4 - local.tee $8 - local.get $7 - local.get $8 - i32.gt_s - select - local.set $5 - else - local.get $5 - local.tee $7 - local.get $6 - local.tee $8 - local.get $7 - local.get $8 - i32.lt_s - select - local.tee $7 - local.get $4 - local.tee $8 - local.get $7 - local.get $8 - i32.gt_s - select - local.set $5 - end - block $~lib/memory/memory.allocate|inlined.5 (result i32) - i32.const 12 - local.set $7 - local.get $7 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.5 + block $break|0 + block + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Int32Array#get:length + local.set $6 + end + loop $repeat|0 + local.get $5 + local.get $6 + i32.lt_s + i32.eqz + br_if $break|0 + i32.const 3 + global.set $~lib/argc + local.get $4 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $5 + local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$viii) + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|0 + unreachable + end + unreachable end - local.set $7 - local.get $7 - local.get $3 - i32.load - i32.store - local.get $7 local.get $3 - i32.load offset=4 - local.get $4 - i32.const 0 - i32.shl - i32.add - i32.store offset=4 - local.get $7 - local.get $5 - local.get $4 - i32.sub - i32.const 0 - i32.shl - i32.store offset=8 - local.get $7 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint8Array,u8> (; 338 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Int32Array,i32> (; 346 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - global.get $std/typedarray/testArrayReverseValues - local.set $0 i32.const 0 - i32.const 9 - call $~lib/typedarray/Uint8Array#constructor + global.set $std/typedarray/forEachCallCount + i32.const 0 + i32.const 3 + call $~lib/typedarray/Int32Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain local.set $1 + local.get $1 + global.set $std/typedarray/forEachSelf + local.get $1 i32.const 0 - i32.const 9 - call $~lib/typedarray/Uint8Array#constructor - local.set $2 + global.get $std/typedarray/forEachValues i32.const 0 + call $~lib/array/Array#__get + call $~lib/typedarray/Int32Array#__set + local.get $1 + i32.const 1 + global.get $std/typedarray/forEachValues + i32.const 1 + call $~lib/array/Array#__get + call $~lib/typedarray/Int32Array#__set + local.get $1 + i32.const 2 + global.get $std/typedarray/forEachValues + i32.const 2 + call $~lib/array/Array#__get + call $~lib/typedarray/Int32Array#__set + local.get $1 + i32.const 106 + call $~lib/typedarray/Int32Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.eq + i32.eqz + if + i32.const 1352 + i32.const 24 + i32.const 441 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + ) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint32Array,u32>~anonymous|0 (; 347 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + global.get $std/typedarray/forEachValues + local.get $1 + call $~lib/array/Array#__get + local.set $3 + local.get $0 + local.get $3 + i32.eq + i32.eqz + if + i32.const 1144 + i32.const 24 + i32.const 436 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $1 + global.get $std/typedarray/forEachCallCount + i32.eq + i32.eqz + if + i32.const 1208 + i32.const 24 + i32.const 437 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + global.get $std/typedarray/forEachSelf + local.get $2 + i32.eq + i32.eqz + if + i32.const 1272 + i32.const 24 + i32.const 438 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + global.get $std/typedarray/forEachCallCount + i32.const 1 + i32.add + global.set $std/typedarray/forEachCallCount + local.get $2 + call $~lib/rt/pure/__release + ) + (func $~lib/typedarray/Uint32Array#forEach (; 348 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $0 + call $~lib/rt/pure/__retain local.set $3 + local.get $1 + local.set $2 + local.get $3 + i32.load offset=4 + local.set $4 block $break|0 - i32.const 0 - local.set $3 - loop $repeat|0 + block + i32.const 0 + local.set $5 local.get $3 - i32.const 9 + call $~lib/typedarray/Uint32Array#get:length + local.set $6 + end + loop $repeat|0 + local.get $5 + local.get $6 i32.lt_s i32.eqz br_if $break|0 - block - local.get $1 - local.get $3 - local.get $0 - local.get $3 - call $~lib/array/Array#__get - i32.const 255 - i32.and - call $~lib/internal/typedarray/TypedArray#__set - local.get $2 - local.get $3 - local.get $0 - local.get $3 - call $~lib/array/Array#__get - i32.const 255 - i32.and - call $~lib/internal/typedarray/TypedArray#__set - end + i32.const 3 + global.set $~lib/argc + local.get $4 + local.get $5 + i32.const 2 + i32.shl + i32.add + i32.load + local.get $5 local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$viii) + local.get $5 i32.const 1 i32.add - local.set $3 + local.set $5 br $repeat|0 unreachable end unreachable end + local.get $3 + call $~lib/rt/pure/__release + ) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint32Array,u32> (; 349 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 0 + i32.const 3 + call $~lib/typedarray/Uint32Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 + global.set $std/typedarray/forEachSelf + local.get $1 + i32.const 0 + global.get $std/typedarray/forEachValues + i32.const 0 + call $~lib/array/Array#__get + call $~lib/typedarray/Uint32Array#__set + local.get $1 + i32.const 1 + global.get $std/typedarray/forEachValues + i32.const 1 + call $~lib/array/Array#__get + call $~lib/typedarray/Uint32Array#__set + local.get $1 + i32.const 2 + global.get $std/typedarray/forEachValues + i32.const 2 + call $~lib/array/Array#__get + call $~lib/typedarray/Uint32Array#__set + local.get $1 + i32.const 107 + call $~lib/typedarray/Uint32Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.eq + i32.eqz + if + i32.const 1352 + i32.const 24 + i32.const 441 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/pure/__release local.get $1 - call $~lib/typedarray/Uint8Array#reverse + call $~lib/rt/pure/__release + ) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Int64Array,i64>~anonymous|0 (; 350 ;) (type $FUNCSIG$vjii) (param $0 i64) (param $1 i32) (param $2 i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain drop - block $break|1 - i32.const 0 - local.set $3 - loop $repeat|1 + global.get $std/typedarray/forEachValues + local.get $1 + call $~lib/array/Array#__get + local.set $3 + local.get $0 + local.get $3 + i64.extend_i32_s + i64.eq + i32.eqz + if + i32.const 1144 + i32.const 24 + i32.const 436 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $1 + global.get $std/typedarray/forEachCallCount + i32.eq + i32.eqz + if + i32.const 1208 + i32.const 24 + i32.const 437 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + global.get $std/typedarray/forEachSelf + local.get $2 + i32.eq + i32.eqz + if + i32.const 1272 + i32.const 24 + i32.const 438 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + global.get $std/typedarray/forEachCallCount + i32.const 1 + i32.add + global.set $std/typedarray/forEachCallCount + local.get $2 + call $~lib/rt/pure/__release + ) + (func $~lib/typedarray/Int64Array#forEach (; 351 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 + local.set $2 + local.get $3 + i32.load offset=4 + local.set $4 + block $break|0 + block + i32.const 0 + local.set $5 local.get $3 - i32.const 9 + call $~lib/typedarray/Int64Array#get:length + local.set $6 + end + loop $repeat|0 + local.get $5 + local.get $6 i32.lt_s i32.eqz - br_if $break|1 - local.get $1 - local.get $3 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and - local.get $0 - i32.const 8 - local.get $3 - i32.sub - call $~lib/array/Array#__get - i32.const 255 - i32.and - i32.eq - i32.eqz - if - i32.const 1056 - i32.const 8 - i32.const 461 - i32.const 4 - call $~lib/env/abort - unreachable - end + br_if $break|0 + i32.const 3 + global.set $~lib/argc + local.get $4 + local.get $5 + i32.const 3 + i32.shl + i32.add + i64.load + local.get $5 local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$vjii) + local.get $5 i32.const 1 i32.add - local.set $3 - br $repeat|1 + local.set $5 + br $repeat|0 unreachable end unreachable end - local.get $2 - i32.const 4 - i32.const 8 - call $~lib/typedarray/Uint8Array#subarray - call $~lib/typedarray/Uint8Array#reverse - local.set $4 - local.get $4 + local.get $3 + call $~lib/rt/pure/__release + ) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Int64Array,i64> (; 352 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and - i32.const 8 + global.set $std/typedarray/forEachCallCount + i32.const 0 + i32.const 3 + call $~lib/typedarray/Int64Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 + global.set $std/typedarray/forEachSelf + local.get $1 + i32.const 0 + global.get $std/typedarray/forEachValues + i32.const 0 + call $~lib/array/Array#__get + i64.extend_i32_s + call $~lib/typedarray/Int64Array#__set + local.get $1 + i32.const 1 + global.get $std/typedarray/forEachValues + i32.const 1 + call $~lib/array/Array#__get + i64.extend_i32_s + call $~lib/typedarray/Int64Array#__set + local.get $1 + i32.const 2 + global.get $std/typedarray/forEachValues + i32.const 2 + call $~lib/array/Array#__get + i64.extend_i32_s + call $~lib/typedarray/Int64Array#__set + local.get $1 + i32.const 108 + call $~lib/typedarray/Int64Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 466 + i32.const 1352 + i32.const 24 + i32.const 441 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $4 - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and - i32.const 7 - i32.eq + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + ) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint64Array,u64>~anonymous|0 (; 353 ;) (type $FUNCSIG$vjii) (param $0 i64) (param $1 i32) (param $2 i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + global.get $std/typedarray/forEachValues + local.get $1 + call $~lib/array/Array#__get + local.set $3 + local.get $0 + local.get $3 + i64.extend_i32_s + i64.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 467 - i32.const 2 - call $~lib/env/abort + i32.const 1144 + i32.const 24 + i32.const 436 + i32.const 4 + call $~lib/builtins/abort unreachable end - local.get $4 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and - i32.const 6 + local.get $1 + global.get $std/typedarray/forEachCallCount i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 468 - i32.const 2 - call $~lib/env/abort + i32.const 1208 + i32.const 24 + i32.const 437 + i32.const 4 + call $~lib/builtins/abort unreachable end - local.get $4 - i32.const 3 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and - i32.const 5 + global.get $std/typedarray/forEachSelf + local.get $2 i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 469 - i32.const 2 - call $~lib/env/abort + i32.const 1272 + i32.const 24 + i32.const 438 + i32.const 4 + call $~lib/builtins/abort unreachable end + global.get $std/typedarray/forEachCallCount + i32.const 1 + i32.add + global.set $std/typedarray/forEachCallCount + local.get $2 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint8ClampedArray#reverse (; 339 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/typedarray/Uint64Array#forEach (; 354 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) local.get $0 - local.set $1 + call $~lib/rt/pure/__retain + local.set $3 local.get $1 - i32.load local.set $2 - local.get $1 + local.get $3 i32.load offset=4 - local.set $3 + local.set $4 block $break|0 block i32.const 0 - local.set $4 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.18 (result i32) - local.get $1 - local.set $5 - local.get $5 - i32.load offset=8 - i32.const 0 - i32.shr_u - end - i32.const 1 - i32.sub local.set $5 + local.get $3 + call $~lib/typedarray/Uint64Array#get:length + local.set $6 end loop $repeat|0 - local.get $4 local.get $5 + local.get $6 i32.lt_s i32.eqz br_if $break|0 - block - block $~lib/internal/arraybuffer/LOAD|inlined.23 (result i32) - local.get $2 - local.set $6 - local.get $4 - local.set $7 - local.get $3 - local.set $8 - local.get $6 - local.get $7 - i32.const 0 - i32.shl - i32.add - local.get $8 - i32.add - i32.load8_u offset=8 - end - local.set $8 - block $~lib/internal/arraybuffer/STORE|inlined.2 - local.get $2 - local.set $7 - local.get $4 - local.set $6 - block $~lib/internal/arraybuffer/LOAD|inlined.24 (result i32) - local.get $2 - local.set $9 - local.get $5 - local.set $10 - local.get $3 - local.set $11 - local.get $9 - local.get $10 - i32.const 0 - i32.shl - i32.add - local.get $11 - i32.add - i32.load8_u offset=8 - end - local.set $11 - local.get $3 - local.set $10 - local.get $7 - local.get $6 - i32.const 0 - i32.shl - i32.add - local.get $10 - i32.add - local.get $11 - i32.store8 offset=8 - end - block $~lib/internal/arraybuffer/STORE|inlined.3 - local.get $2 - local.set $10 - local.get $5 - local.set $11 - local.get $8 - local.set $6 - local.get $3 - local.set $7 - local.get $10 - local.get $11 - i32.const 0 - i32.shl - i32.add - local.get $7 - i32.add - local.get $6 - i32.store8 offset=8 - end - end - block - local.get $4 - i32.const 1 - i32.add - local.set $4 - local.get $5 - i32.const 1 - i32.sub - local.set $5 - end + i32.const 3 + global.set $~lib/argc + local.get $4 + local.get $5 + i32.const 3 + i32.shl + i32.add + i64.load + local.get $5 + local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$vjii) + local.get $5 + i32.const 1 + i32.add + local.set $5 br $repeat|0 unreachable end unreachable end - local.get $1 + local.get $3 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint8ClampedArray#subarray (; 340 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - local.get $0 - local.set $3 + (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint64Array,u64> (; 355 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 0 + i32.const 3 + call $~lib/typedarray/Uint64Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 + global.set $std/typedarray/forEachSelf local.get $1 - local.set $4 - local.get $2 - local.set $5 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.19 (result i32) - local.get $3 - local.set $6 - local.get $6 - i32.load offset=8 - i32.const 0 - i32.shr_u - end - local.set $6 - local.get $4 i32.const 0 - i32.lt_s + global.get $std/typedarray/forEachValues + i32.const 0 + call $~lib/array/Array#__get + i64.extend_i32_s + call $~lib/typedarray/Uint64Array#__set + local.get $1 + i32.const 1 + global.get $std/typedarray/forEachValues + i32.const 1 + call $~lib/array/Array#__get + i64.extend_i32_s + call $~lib/typedarray/Uint64Array#__set + local.get $1 + i32.const 2 + global.get $std/typedarray/forEachValues + i32.const 2 + call $~lib/array/Array#__get + i64.extend_i32_s + call $~lib/typedarray/Uint64Array#__set + local.get $1 + i32.const 109 + call $~lib/typedarray/Uint64Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.eq + i32.eqz if - local.get $6 - local.get $4 - i32.add - local.tee $7 - i32.const 0 - local.tee $8 - local.get $7 - local.get $8 - i32.gt_s - select - local.set $4 - else - local.get $4 - local.tee $7 - local.get $6 - local.tee $8 - local.get $7 - local.get $8 - i32.lt_s - select - local.set $4 + i32.const 1352 + i32.const 24 + i32.const 441 + i32.const 2 + call $~lib/builtins/abort + unreachable end - local.get $5 - i32.const 0 - i32.lt_s + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + ) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Float32Array,f32>~anonymous|0 (; 356 ;) (type $FUNCSIG$vfii) (param $0 f32) (param $1 i32) (param $2 i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + global.get $std/typedarray/forEachValues + local.get $1 + call $~lib/array/Array#__get + local.set $3 + local.get $0 + local.get $3 + f32.convert_i32_s + f32.eq + i32.eqz if - local.get $6 - local.get $5 - i32.add - local.tee $7 - local.get $4 - local.tee $8 - local.get $7 - local.get $8 - i32.gt_s - select - local.set $5 - else - local.get $5 - local.tee $7 - local.get $6 - local.tee $8 - local.get $7 - local.get $8 - i32.lt_s - select - local.tee $7 - local.get $4 - local.tee $8 - local.get $7 - local.get $8 - i32.gt_s - select - local.set $5 + i32.const 1144 + i32.const 24 + i32.const 436 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $1 + global.get $std/typedarray/forEachCallCount + i32.eq + i32.eqz + if + i32.const 1208 + i32.const 24 + i32.const 437 + i32.const 4 + call $~lib/builtins/abort + unreachable end - block $~lib/memory/memory.allocate|inlined.6 (result i32) - i32.const 12 - local.set $7 - local.get $7 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.6 + global.get $std/typedarray/forEachSelf + local.get $2 + i32.eq + i32.eqz + if + i32.const 1272 + i32.const 24 + i32.const 438 + i32.const 4 + call $~lib/builtins/abort + unreachable end - local.set $7 - local.get $7 - local.get $3 - i32.load - i32.store - local.get $7 - local.get $3 - i32.load offset=4 - local.get $4 - i32.const 0 - i32.shl + global.get $std/typedarray/forEachCallCount + i32.const 1 i32.add - i32.store offset=4 - local.get $7 - local.get $5 - local.get $4 - i32.sub - i32.const 0 - i32.shl - i32.store offset=8 - local.get $7 + global.set $std/typedarray/forEachCallCount + local.get $2 + call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint8ClampedArray,u8> (; 341 ;) (type $FUNCSIG$v) - (local $0 i32) - (local $1 i32) + (func $~lib/typedarray/Float32Array#forEach (; 357 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - global.get $std/typedarray/testArrayReverseValues - local.set $0 - i32.const 0 - i32.const 9 - call $~lib/typedarray/Uint8ClampedArray#constructor - local.set $1 - i32.const 0 - i32.const 9 - call $~lib/typedarray/Uint8ClampedArray#constructor - local.set $2 - i32.const 0 + (local $5 i32) + (local $6 i32) + local.get $0 + call $~lib/rt/pure/__retain local.set $3 + local.get $1 + local.set $2 + local.get $3 + i32.load offset=4 + local.set $4 block $break|0 - i32.const 0 - local.set $3 - loop $repeat|0 + block + i32.const 0 + local.set $5 local.get $3 - i32.const 9 + call $~lib/typedarray/Float32Array#get:length + local.set $6 + end + loop $repeat|0 + local.get $5 + local.get $6 i32.lt_s i32.eqz br_if $break|0 - block - local.get $1 - local.get $3 - local.get $0 - local.get $3 - call $~lib/array/Array#__get - i32.const 255 - i32.and - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $2 - local.get $3 - local.get $0 - local.get $3 - call $~lib/array/Array#__get - i32.const 255 - i32.and - call $~lib/typedarray/Uint8ClampedArray#__set - end + i32.const 3 + global.set $~lib/argc + local.get $4 + local.get $5 + i32.const 2 + i32.shl + i32.add + f32.load + local.get $5 local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$vfii) + local.get $5 i32.const 1 i32.add - local.set $3 + local.set $5 br $repeat|0 unreachable end unreachable end + local.get $3 + call $~lib/rt/pure/__release + ) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Float32Array,f32> (; 358 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 0 + i32.const 3 + call $~lib/typedarray/Float32Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 + global.set $std/typedarray/forEachSelf local.get $1 - call $~lib/typedarray/Uint8ClampedArray#reverse - drop - block $break|1 - i32.const 0 - local.set $3 - loop $repeat|1 - local.get $3 - i32.const 9 - i32.lt_s - i32.eqz - br_if $break|1 - local.get $1 - local.get $3 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and - local.get $0 - i32.const 8 - local.get $3 - i32.sub - call $~lib/array/Array#__get - i32.const 255 - i32.and - i32.eq - i32.eqz - if - i32.const 1056 - i32.const 8 - i32.const 461 - i32.const 4 - call $~lib/env/abort - unreachable - end - local.get $3 - i32.const 1 - i32.add - local.set $3 - br $repeat|1 - unreachable - end - unreachable - end - local.get $2 - i32.const 4 - i32.const 8 - call $~lib/typedarray/Uint8ClampedArray#subarray - call $~lib/typedarray/Uint8ClampedArray#reverse - local.set $4 - local.get $4 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and - i32.const 8 + global.get $std/typedarray/forEachValues + i32.const 0 + call $~lib/array/Array#__get + f32.convert_i32_s + call $~lib/typedarray/Float32Array#__set + local.get $1 + i32.const 1 + global.get $std/typedarray/forEachValues + i32.const 1 + call $~lib/array/Array#__get + f32.convert_i32_s + call $~lib/typedarray/Float32Array#__set + local.get $1 + i32.const 2 + global.get $std/typedarray/forEachValues + i32.const 2 + call $~lib/array/Array#__get + f32.convert_i32_s + call $~lib/typedarray/Float32Array#__set + local.get $1 + i32.const 110 + call $~lib/typedarray/Float32Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 466 + i32.const 1352 + i32.const 24 + i32.const 441 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $4 - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and - i32.const 7 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + ) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Float64Array,f64>~anonymous|0 (; 359 ;) (type $FUNCSIG$vdii) (param $0 f64) (param $1 i32) (param $2 i32) + (local $3 i32) + local.get $2 + call $~lib/rt/pure/__retain + drop + global.get $std/typedarray/forEachValues + local.get $1 + call $~lib/array/Array#__get + local.set $3 + local.get $0 + local.get $3 + f64.convert_i32_s + f64.eq + i32.eqz + if + i32.const 1144 + i32.const 24 + i32.const 436 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $1 + global.get $std/typedarray/forEachCallCount i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 467 - i32.const 2 - call $~lib/env/abort + i32.const 1208 + i32.const 24 + i32.const 437 + i32.const 4 + call $~lib/builtins/abort unreachable end - local.get $4 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and - i32.const 6 + global.get $std/typedarray/forEachSelf + local.get $2 i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 468 - i32.const 2 - call $~lib/env/abort + i32.const 1272 + i32.const 24 + i32.const 438 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + global.get $std/typedarray/forEachCallCount + i32.const 1 + i32.add + global.set $std/typedarray/forEachCallCount + local.get $2 + call $~lib/rt/pure/__release + ) + (func $~lib/typedarray/Float64Array#forEach (; 360 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $3 + local.get $1 + local.set $2 + local.get $3 + i32.load offset=4 + local.set $4 + block $break|0 + block + i32.const 0 + local.set $5 + local.get $3 + call $~lib/typedarray/Float64Array#get:length + local.set $6 + end + loop $repeat|0 + local.get $5 + local.get $6 + i32.lt_s + i32.eqz + br_if $break|0 + i32.const 3 + global.set $~lib/argc + local.get $4 + local.get $5 + i32.const 3 + i32.shl + i32.add + f64.load + local.get $5 + local.get $3 + local.get $2 + call_indirect (type $FUNCSIG$vdii) + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|0 + unreachable + end unreachable end - local.get $4 + local.get $3 + call $~lib/rt/pure/__release + ) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Float64Array,f64> (; 361 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 0 + i32.const 3 + call $~lib/typedarray/Float64Array#constructor + local.tee $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 + global.set $std/typedarray/forEachSelf + local.get $1 + i32.const 0 + global.get $std/typedarray/forEachValues + i32.const 0 + call $~lib/array/Array#__get + f64.convert_i32_s + call $~lib/typedarray/Float64Array#__set + local.get $1 + i32.const 1 + global.get $std/typedarray/forEachValues + i32.const 1 + call $~lib/array/Array#__get + f64.convert_i32_s + call $~lib/typedarray/Float64Array#__set + local.get $1 + i32.const 2 + global.get $std/typedarray/forEachValues + i32.const 2 + call $~lib/array/Array#__get + f64.convert_i32_s + call $~lib/typedarray/Float64Array#__set + local.get $1 + i32.const 111 + call $~lib/typedarray/Float64Array#forEach + global.get $std/typedarray/forEachCallCount i32.const 3 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and - i32.const 5 i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 469 + i32.const 1352 + i32.const 24 + i32.const 441 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int16Array#reverse (; 342 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Int8Array#reverse (; 362 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -17514,424 +18129,253 @@ (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) local.get $0 + call $~lib/rt/pure/__retain local.set $1 local.get $1 - i32.load - local.set $2 - local.get $1 i32.load offset=4 - local.set $3 + local.set $2 block $break|0 block i32.const 0 - local.set $4 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.8 (result i32) - local.get $1 - local.set $5 - local.get $5 - i32.load offset=8 - i32.const 1 - i32.shr_u - end + local.set $3 + local.get $1 + call $~lib/typedarray/Int8Array#get:length i32.const 1 i32.sub - local.set $5 + local.set $4 end loop $repeat|0 + local.get $3 local.get $4 - local.get $5 i32.lt_s i32.eqz br_if $break|0 - block - block $~lib/internal/arraybuffer/LOAD|inlined.11 (result i32) - local.get $2 - local.set $6 - local.get $4 - local.set $7 - local.get $3 - local.set $8 - local.get $6 - local.get $7 - i32.const 1 - i32.shl - i32.add - local.get $8 - i32.add - i32.load16_s offset=8 - end - local.set $8 - block $~lib/internal/arraybuffer/STORE|inlined.0 - local.get $2 - local.set $7 - local.get $4 - local.set $6 - block $~lib/internal/arraybuffer/LOAD|inlined.12 (result i32) - local.get $2 - local.set $9 - local.get $5 - local.set $10 - local.get $3 - local.set $11 - local.get $9 - local.get $10 - i32.const 1 - i32.shl - i32.add - local.get $11 - i32.add - i32.load16_s offset=8 - end - local.set $11 - local.get $3 - local.set $10 - local.get $7 - local.get $6 - i32.const 1 - i32.shl - i32.add - local.get $10 - i32.add - local.get $11 - i32.store16 offset=8 - end - block $~lib/internal/arraybuffer/STORE|inlined.1 - local.get $2 - local.set $10 - local.get $5 - local.set $11 - local.get $8 - local.set $6 - local.get $3 - local.set $7 - local.get $10 - local.get $11 - i32.const 1 - i32.shl - i32.add - local.get $7 - i32.add - local.get $6 - i32.store16 offset=8 - end - end - block - local.get $4 - i32.const 1 - i32.add - local.set $4 - local.get $5 - i32.const 1 - i32.sub - local.set $5 - end - br $repeat|0 - unreachable - end - unreachable - end - local.get $1 - ) - (func $~lib/typedarray/Int16Array#subarray (; 343 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - local.get $0 - local.set $3 - local.get $1 - local.set $4 - local.get $2 - local.set $5 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.9 (result i32) - local.get $3 - local.set $6 - local.get $6 - i32.load offset=8 - i32.const 1 - i32.shr_u - end - local.set $6 - local.get $4 - i32.const 0 - i32.lt_s - if - local.get $6 - local.get $4 - i32.add - local.tee $7 - i32.const 0 - local.tee $8 - local.get $7 - local.get $8 - i32.gt_s - select - local.set $4 - else - local.get $4 - local.tee $7 - local.get $6 - local.tee $8 - local.get $7 - local.get $8 - i32.lt_s - select - local.set $4 - end - local.get $5 - i32.const 0 - i32.lt_s - if - local.get $6 - local.get $5 - i32.add - local.tee $7 - local.get $4 - local.tee $8 - local.get $7 - local.get $8 - i32.gt_s - select - local.set $5 - else - local.get $5 - local.tee $7 - local.get $6 - local.tee $8 - local.get $7 - local.get $8 - i32.lt_s - select - local.tee $7 - local.get $4 - local.tee $8 - local.get $7 - local.get $8 - i32.gt_s - select - local.set $5 - end - block $~lib/memory/memory.allocate|inlined.7 (result i32) - i32.const 12 - local.set $7 - local.get $7 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.7 - end - local.set $7 - local.get $7 - local.get $3 - i32.load - i32.store - local.get $7 - local.get $3 - i32.load offset=4 - local.get $4 - i32.const 1 - i32.shl - i32.add - i32.store offset=4 - local.get $7 - local.get $5 - local.get $4 - i32.sub - i32.const 1 - i32.shl - i32.store offset=8 - local.get $7 + local.get $2 + local.get $3 + i32.const 0 + i32.shl + i32.add + local.set $5 + local.get $2 + local.get $4 + i32.const 0 + i32.shl + i32.add + local.set $6 + local.get $5 + i32.load8_s + local.set $7 + local.get $5 + local.get $6 + i32.load8_s + i32.store8 + local.get $6 + local.get $7 + i32.store8 + block + local.get $3 + i32.const 1 + i32.add + local.set $3 + local.get $4 + i32.const 1 + i32.sub + local.set $4 + end + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 ) - (func $std/typedarray/testArrayReverse<~lib/typedarray/Int16Array,i16> (; 344 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayReverse<~lib/typedarray/Int8Array,i8> (; 363 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) global.get $std/typedarray/testArrayReverseValues + call $~lib/rt/pure/__retain local.set $0 i32.const 0 i32.const 9 - call $~lib/typedarray/Int16Array#constructor - local.set $1 + call $~lib/typedarray/Int8Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.set $2 i32.const 0 i32.const 9 - call $~lib/typedarray/Int16Array#constructor - local.set $2 + call $~lib/typedarray/Int8Array#constructor + local.tee $3 + call $~lib/rt/pure/__retain + local.set $4 i32.const 0 - local.set $3 + local.set $5 block $break|0 i32.const 0 - local.set $3 + local.set $5 loop $repeat|0 - local.get $3 + local.get $5 i32.const 9 i32.lt_s i32.eqz br_if $break|0 - block - local.get $1 - local.get $3 - local.get $0 - local.get $3 - call $~lib/array/Array#__get - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $2 - local.get $3 - local.get $0 - local.get $3 - call $~lib/array/Array#__get - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/internal/typedarray/TypedArray#__set - end - local.get $3 + local.get $2 + local.get $5 + local.get $0 + local.get $5 + call $~lib/array/Array#__get + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + call $~lib/typedarray/Int8Array#__set + local.get $4 + local.get $5 + local.get $0 + local.get $5 + call $~lib/array/Array#__get + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + call $~lib/typedarray/Int8Array#__set + local.get $5 i32.const 1 i32.add - local.set $3 + local.set $5 br $repeat|0 unreachable end unreachable end - local.get $1 - call $~lib/typedarray/Int16Array#reverse - drop + local.get $2 + call $~lib/typedarray/Int8Array#reverse + call $~lib/rt/pure/__release block $break|1 i32.const 0 - local.set $3 + local.set $5 loop $repeat|1 - local.get $3 + local.get $5 i32.const 9 i32.lt_s i32.eqz br_if $break|1 - local.get $1 - local.get $3 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s + local.get $2 + local.get $5 + call $~lib/typedarray/Int8Array#__get local.get $0 i32.const 8 - local.get $3 + local.get $5 i32.sub call $~lib/array/Array#__get - i32.const 16 + i32.const 24 i32.shl - i32.const 16 + i32.const 24 i32.shr_s i32.eq i32.eqz if - i32.const 1056 - i32.const 8 - i32.const 461 + i32.const 1512 + i32.const 24 + i32.const 471 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $3 + local.get $5 i32.const 1 i32.add - local.set $3 + local.set $5 br $repeat|1 unreachable end unreachable end - local.get $2 + local.get $4 i32.const 4 i32.const 8 - call $~lib/typedarray/Int16Array#subarray - call $~lib/typedarray/Int16Array#reverse - local.set $4 - local.get $4 + call $~lib/typedarray/Int8Array#subarray + local.tee $6 + call $~lib/typedarray/Int8Array#reverse + local.set $7 + local.get $7 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s + call $~lib/typedarray/Int8Array#__get i32.const 8 i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 466 + i32.const 1600 + i32.const 24 + i32.const 476 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $4 + local.get $7 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s + call $~lib/typedarray/Int8Array#__get i32.const 7 i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 467 + i32.const 1600 + i32.const 24 + i32.const 477 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $4 + local.get $7 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s + call $~lib/typedarray/Int8Array#__get i32.const 6 i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 468 + i32.const 1600 + i32.const 24 + i32.const 478 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $4 + local.get $7 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s + call $~lib/typedarray/Int8Array#__get i32.const 5 i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 469 + i32.const 1600 + i32.const 24 + i32.const 479 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint16Array#reverse (; 345 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Uint8Array#reverse (; 364 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -17939,121 +18383,59 @@ (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) local.get $0 + call $~lib/rt/pure/__retain local.set $1 local.get $1 - i32.load - local.set $2 - local.get $1 i32.load offset=4 - local.set $3 + local.set $2 block $break|0 block i32.const 0 - local.set $4 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.8 (result i32) - local.get $1 - local.set $5 - local.get $5 - i32.load offset=8 - i32.const 1 - i32.shr_u - end + local.set $3 + local.get $1 + call $~lib/typedarray/Uint8Array#get:length i32.const 1 i32.sub - local.set $5 + local.set $4 end loop $repeat|0 + local.get $3 local.get $4 - local.get $5 i32.lt_s i32.eqz br_if $break|0 + local.get $2 + local.get $3 + i32.const 0 + i32.shl + i32.add + local.set $5 + local.get $2 + local.get $4 + i32.const 0 + i32.shl + i32.add + local.set $6 + local.get $5 + i32.load8_u + local.set $7 + local.get $5 + local.get $6 + i32.load8_u + i32.store8 + local.get $6 + local.get $7 + i32.store8 block - block $~lib/internal/arraybuffer/LOAD|inlined.11 (result i32) - local.get $2 - local.set $6 - local.get $4 - local.set $7 - local.get $3 - local.set $8 - local.get $6 - local.get $7 - i32.const 1 - i32.shl - i32.add - local.get $8 - i32.add - i32.load16_u offset=8 - end - local.set $8 - block $~lib/internal/arraybuffer/STORE|inlined.0 - local.get $2 - local.set $7 - local.get $4 - local.set $6 - block $~lib/internal/arraybuffer/LOAD|inlined.12 (result i32) - local.get $2 - local.set $9 - local.get $5 - local.set $10 - local.get $3 - local.set $11 - local.get $9 - local.get $10 - i32.const 1 - i32.shl - i32.add - local.get $11 - i32.add - i32.load16_u offset=8 - end - local.set $11 - local.get $3 - local.set $10 - local.get $7 - local.get $6 - i32.const 1 - i32.shl - i32.add - local.get $10 - i32.add - local.get $11 - i32.store16 offset=8 - end - block $~lib/internal/arraybuffer/STORE|inlined.1 - local.get $2 - local.set $10 - local.get $5 - local.set $11 - local.get $8 - local.set $6 - local.get $3 - local.set $7 - local.get $10 - local.get $11 - i32.const 1 - i32.shl - i32.add - local.get $7 - i32.add - local.get $6 - i32.store16 offset=8 - end - end - block - local.get $4 + local.get $3 i32.const 1 i32.add - local.set $4 - local.get $5 + local.set $3 + local.get $4 i32.const 1 i32.sub - local.set $5 + local.set $4 end br $repeat|0 unreachable @@ -18062,32 +18444,28 @@ end local.get $1 ) - (func $~lib/typedarray/Uint16Array#subarray (; 346 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/typedarray/Uint8Array#subarray (; 365 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) (local $8 i32) - local.get $0 - local.set $3 - local.get $1 - local.set $4 - local.get $2 - local.set $5 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.9 (result i32) - local.get $3 - local.set $6 - local.get $6 - i32.load offset=8 - i32.const 1 - i32.shr_u - end + (local $9 i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + call $~lib/typedarray/Uint8Array#get:length local.set $6 local.get $4 i32.const 0 i32.lt_s - if + if (result i32) local.get $6 local.get $4 i32.add @@ -18098,7 +18476,6 @@ local.get $8 i32.gt_s select - local.set $4 else local.get $4 local.tee $7 @@ -18108,25 +18485,24 @@ local.get $8 i32.lt_s select - local.set $4 end - local.get $5 + local.set $4 + local.get $3 i32.const 0 i32.lt_s - if + if (result i32) local.get $6 - local.get $5 + local.get $3 i32.add local.tee $7 - local.get $4 + i32.const 0 local.tee $8 local.get $7 local.get $8 i32.gt_s select - local.set $5 else - local.get $5 + local.get $3 local.tee $7 local.get $6 local.tee $8 @@ -18134,213 +18510,243 @@ local.get $8 i32.lt_s select - local.tee $7 - local.get $4 - local.tee $8 - local.get $7 - local.get $8 - i32.gt_s - select - local.set $5 - end - block $~lib/memory/memory.allocate|inlined.8 (result i32) - i32.const 12 - local.set $7 - local.get $7 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.8 end + local.set $3 + local.get $3 + local.tee $7 + local.get $4 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + local.set $3 + i32.const 12 + i32.const 4 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.set $7 local.get $7 - local.get $3 - i32.load + local.tee $8 + block (result i32) + local.get $5 + i32.load + local.tee $9 + local.get $8 + i32.load + local.tee $8 + i32.ne + if + local.get $9 + call $~lib/rt/pure/__retain + drop + local.get $8 + call $~lib/rt/pure/__release + end + local.get $9 + end i32.store local.get $7 - local.get $3 + local.get $5 i32.load offset=4 local.get $4 - i32.const 1 + i32.const 0 i32.shl i32.add i32.store offset=4 local.get $7 - local.get $5 + local.get $3 local.get $4 i32.sub - i32.const 1 + i32.const 0 i32.shl i32.store offset=8 local.get $7 + local.set $9 + local.get $5 + call $~lib/rt/pure/__release + local.get $9 ) - (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint16Array,u16> (; 347 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint8Array,u8> (; 366 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) global.get $std/typedarray/testArrayReverseValues + call $~lib/rt/pure/__retain local.set $0 i32.const 0 i32.const 9 - call $~lib/typedarray/Uint16Array#constructor - local.set $1 + call $~lib/typedarray/Uint8Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.set $2 i32.const 0 i32.const 9 - call $~lib/typedarray/Uint16Array#constructor - local.set $2 + call $~lib/typedarray/Uint8Array#constructor + local.tee $3 + call $~lib/rt/pure/__retain + local.set $4 i32.const 0 - local.set $3 + local.set $5 block $break|0 i32.const 0 - local.set $3 + local.set $5 loop $repeat|0 - local.get $3 + local.get $5 i32.const 9 i32.lt_s i32.eqz br_if $break|0 - block - local.get $1 - local.get $3 - local.get $0 - local.get $3 - call $~lib/array/Array#__get - i32.const 65535 - i32.and - call $~lib/internal/typedarray/TypedArray#__set - local.get $2 - local.get $3 - local.get $0 - local.get $3 - call $~lib/array/Array#__get - i32.const 65535 - i32.and - call $~lib/internal/typedarray/TypedArray#__set - end - local.get $3 + local.get $2 + local.get $5 + local.get $0 + local.get $5 + call $~lib/array/Array#__get + i32.const 255 + i32.and + call $~lib/typedarray/Uint8Array#__set + local.get $4 + local.get $5 + local.get $0 + local.get $5 + call $~lib/array/Array#__get + i32.const 255 + i32.and + call $~lib/typedarray/Uint8Array#__set + local.get $5 i32.const 1 i32.add - local.set $3 + local.set $5 br $repeat|0 unreachable end unreachable end - local.get $1 - call $~lib/typedarray/Uint16Array#reverse - drop + local.get $2 + call $~lib/typedarray/Uint8Array#reverse + call $~lib/rt/pure/__release block $break|1 i32.const 0 - local.set $3 + local.set $5 loop $repeat|1 - local.get $3 + local.get $5 i32.const 9 i32.lt_s i32.eqz br_if $break|1 - local.get $1 - local.get $3 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 65535 - i32.and + local.get $2 + local.get $5 + call $~lib/typedarray/Uint8Array#__get local.get $0 i32.const 8 - local.get $3 + local.get $5 i32.sub call $~lib/array/Array#__get - i32.const 65535 + i32.const 255 i32.and i32.eq i32.eqz if - i32.const 1056 - i32.const 8 - i32.const 461 + i32.const 1512 + i32.const 24 + i32.const 471 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $3 + local.get $5 i32.const 1 i32.add - local.set $3 + local.set $5 br $repeat|1 unreachable end unreachable end - local.get $2 + local.get $4 i32.const 4 i32.const 8 - call $~lib/typedarray/Uint16Array#subarray - call $~lib/typedarray/Uint16Array#reverse - local.set $4 - local.get $4 + call $~lib/typedarray/Uint8Array#subarray + local.tee $6 + call $~lib/typedarray/Uint8Array#reverse + local.set $7 + local.get $7 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 65535 - i32.and + call $~lib/typedarray/Uint8Array#__get i32.const 8 i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 466 + i32.const 1600 + i32.const 24 + i32.const 476 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $4 + local.get $7 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 65535 - i32.and + call $~lib/typedarray/Uint8Array#__get i32.const 7 i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 467 + i32.const 1600 + i32.const 24 + i32.const 477 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $4 + local.get $7 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 65535 - i32.and + call $~lib/typedarray/Uint8Array#__get i32.const 6 i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 468 + i32.const 1600 + i32.const 24 + i32.const 478 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $4 + local.get $7 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 65535 - i32.and + call $~lib/typedarray/Uint8Array#__get i32.const 5 i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 469 + i32.const 1600 + i32.const 24 + i32.const 479 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int32Array#reverse (; 348 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Uint8ClampedArray#reverse (; 367 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -18348,121 +18754,59 @@ (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) local.get $0 + call $~lib/rt/pure/__retain local.set $1 - local.get $1 - i32.load - local.set $2 - local.get $1 - i32.load offset=4 - local.set $3 - block $break|0 - block - i32.const 0 - local.set $4 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.16 (result i32) - local.get $1 - local.set $5 - local.get $5 - i32.load offset=8 - i32.const 2 - i32.shr_u - end - i32.const 1 - i32.sub - local.set $5 - end - loop $repeat|0 - local.get $4 - local.get $5 - i32.lt_s - i32.eqz - br_if $break|0 - block - block $~lib/internal/arraybuffer/LOAD|inlined.12 (result i32) - local.get $2 - local.set $6 - local.get $4 - local.set $7 - local.get $3 - local.set $8 - local.get $6 - local.get $7 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.add - i32.load offset=8 - end - local.set $8 - block $~lib/internal/arraybuffer/STORE|inlined.3 - local.get $2 - local.set $7 - local.get $4 - local.set $6 - block $~lib/internal/arraybuffer/LOAD|inlined.13 (result i32) - local.get $2 - local.set $9 - local.get $5 - local.set $10 - local.get $3 - local.set $11 - local.get $9 - local.get $10 - i32.const 2 - i32.shl - i32.add - local.get $11 - i32.add - i32.load offset=8 - end - local.set $11 - local.get $3 - local.set $10 - local.get $7 - local.get $6 - i32.const 2 - i32.shl - i32.add - local.get $10 - i32.add - local.get $11 - i32.store offset=8 - end - block $~lib/internal/arraybuffer/STORE|inlined.4 - local.get $2 - local.set $10 - local.get $5 - local.set $11 - local.get $8 - local.set $6 - local.get $3 - local.set $7 - local.get $10 - local.get $11 - i32.const 2 - i32.shl - i32.add - local.get $7 - i32.add - local.get $6 - i32.store offset=8 - end - end + local.get $1 + i32.load offset=4 + local.set $2 + block $break|0 + block + i32.const 0 + local.set $3 + local.get $1 + call $~lib/typedarray/Uint8ClampedArray#get:length + i32.const 1 + i32.sub + local.set $4 + end + loop $repeat|0 + local.get $3 + local.get $4 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $2 + local.get $3 + i32.const 0 + i32.shl + i32.add + local.set $5 + local.get $2 + local.get $4 + i32.const 0 + i32.shl + i32.add + local.set $6 + local.get $5 + i32.load8_u + local.set $7 + local.get $5 + local.get $6 + i32.load8_u + i32.store8 + local.get $6 + local.get $7 + i32.store8 block - local.get $4 + local.get $3 i32.const 1 i32.add - local.set $4 - local.get $5 + local.set $3 + local.get $4 i32.const 1 i32.sub - local.set $5 + local.set $4 end br $repeat|0 unreachable @@ -18471,281 +18815,369 @@ end local.get $1 ) - (func $std/typedarray/testArrayReverse<~lib/typedarray/Int32Array,i32> (; 349 ;) (type $FUNCSIG$v) + (func $~lib/typedarray/Uint8ClampedArray#subarray (; 368 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + call $~lib/typedarray/Uint8ClampedArray#get:length + local.set $6 + local.get $4 + i32.const 0 + i32.lt_s + if (result i32) + local.get $6 + local.get $4 + i32.add + local.tee $7 + i32.const 0 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + else + local.get $4 + local.tee $7 + local.get $6 + local.tee $8 + local.get $7 + local.get $8 + i32.lt_s + select + end + local.set $4 + local.get $3 + i32.const 0 + i32.lt_s + if (result i32) + local.get $6 + local.get $3 + i32.add + local.tee $7 + i32.const 0 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + else + local.get $3 + local.tee $7 + local.get $6 + local.tee $8 + local.get $7 + local.get $8 + i32.lt_s + select + end + local.set $3 + local.get $3 + local.tee $7 + local.get $4 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + local.set $3 + i32.const 12 + i32.const 5 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $7 + local.get $7 + local.tee $8 + block (result i32) + local.get $5 + i32.load + local.tee $9 + local.get $8 + i32.load + local.tee $8 + i32.ne + if + local.get $9 + call $~lib/rt/pure/__retain + drop + local.get $8 + call $~lib/rt/pure/__release + end + local.get $9 + end + i32.store + local.get $7 + local.get $5 + i32.load offset=4 + local.get $4 + i32.const 0 + i32.shl + i32.add + i32.store offset=4 + local.get $7 + local.get $3 + local.get $4 + i32.sub + i32.const 0 + i32.shl + i32.store offset=8 + local.get $7 + local.set $9 + local.get $5 + call $~lib/rt/pure/__release + local.get $9 + ) + (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint8ClampedArray,u8> (; 369 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) global.get $std/typedarray/testArrayReverseValues + call $~lib/rt/pure/__retain local.set $0 i32.const 0 i32.const 9 - call $~lib/typedarray/Int32Array#constructor - local.set $1 + call $~lib/typedarray/Uint8ClampedArray#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.set $2 i32.const 0 i32.const 9 - call $~lib/typedarray/Int32Array#constructor - local.set $2 + call $~lib/typedarray/Uint8ClampedArray#constructor + local.tee $3 + call $~lib/rt/pure/__retain + local.set $4 i32.const 0 - local.set $3 + local.set $5 block $break|0 i32.const 0 - local.set $3 + local.set $5 loop $repeat|0 - local.get $3 + local.get $5 i32.const 9 i32.lt_s i32.eqz br_if $break|0 - block - local.get $1 - local.get $3 - local.get $0 - local.get $3 - call $~lib/array/Array#__get - call $~lib/internal/typedarray/TypedArray#__set - local.get $2 - local.get $3 - local.get $0 - local.get $3 - call $~lib/array/Array#__get - call $~lib/internal/typedarray/TypedArray#__set - end - local.get $3 + local.get $2 + local.get $5 + local.get $0 + local.get $5 + call $~lib/array/Array#__get + i32.const 255 + i32.and + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $4 + local.get $5 + local.get $0 + local.get $5 + call $~lib/array/Array#__get + i32.const 255 + i32.and + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $5 i32.const 1 i32.add - local.set $3 + local.set $5 br $repeat|0 unreachable end unreachable end - local.get $1 - call $~lib/typedarray/Int32Array#reverse - drop + local.get $2 + call $~lib/typedarray/Uint8ClampedArray#reverse + call $~lib/rt/pure/__release block $break|1 i32.const 0 - local.set $3 + local.set $5 loop $repeat|1 - local.get $3 + local.get $5 i32.const 9 i32.lt_s i32.eqz br_if $break|1 - local.get $1 - local.get $3 - call $~lib/internal/typedarray/TypedArray#__get + local.get $2 + local.get $5 + call $~lib/typedarray/Uint8ClampedArray#__get local.get $0 i32.const 8 - local.get $3 + local.get $5 i32.sub call $~lib/array/Array#__get + i32.const 255 + i32.and i32.eq i32.eqz if - i32.const 1056 - i32.const 8 - i32.const 461 + i32.const 1512 + i32.const 24 + i32.const 471 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $3 + local.get $5 i32.const 1 i32.add - local.set $3 + local.set $5 br $repeat|1 unreachable end unreachable end - local.get $2 + local.get $4 i32.const 4 i32.const 8 - call $~lib/typedarray/Int32Array#subarray - call $~lib/typedarray/Int32Array#reverse - local.set $4 - local.get $4 + call $~lib/typedarray/Uint8ClampedArray#subarray + local.tee $6 + call $~lib/typedarray/Uint8ClampedArray#reverse + local.set $7 + local.get $7 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Uint8ClampedArray#__get i32.const 8 i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 466 + i32.const 1600 + i32.const 24 + i32.const 476 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $4 + local.get $7 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Uint8ClampedArray#__get i32.const 7 i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 467 + i32.const 1600 + i32.const 24 + i32.const 477 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $4 + local.get $7 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Uint8ClampedArray#__get i32.const 6 i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 468 + i32.const 1600 + i32.const 24 + i32.const 478 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $4 + local.get $7 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Uint8ClampedArray#__get i32.const 5 i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 469 + i32.const 1600 + i32.const 24 + i32.const 479 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint32Array#reverse (; 350 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Int16Array#reverse (; 370 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) + (local $6 i32) + (local $7 i32) local.get $0 + call $~lib/rt/pure/__retain local.set $1 local.get $1 - i32.load - local.set $2 - local.get $1 i32.load offset=4 - local.set $3 + local.set $2 block $break|0 block i32.const 0 - local.set $4 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.8 (result i32) - local.get $1 - local.set $5 - local.get $5 - i32.load offset=8 - i32.const 2 - i32.shr_u - end + local.set $3 + local.get $1 + call $~lib/typedarray/Int16Array#get:length i32.const 1 i32.sub - local.set $5 + local.set $4 end loop $repeat|0 + local.get $3 local.get $4 - local.get $5 i32.lt_s i32.eqz br_if $break|0 + local.get $2 + local.get $3 + i32.const 1 + i32.shl + i32.add + local.set $5 + local.get $2 + local.get $4 + i32.const 1 + i32.shl + i32.add + local.set $6 + local.get $5 + i32.load16_s + local.set $7 + local.get $5 + local.get $6 + i32.load16_s + i32.store16 + local.get $6 + local.get $7 + i32.store16 block - block $~lib/internal/arraybuffer/LOAD|inlined.11 (result i32) - local.get $2 - local.set $6 - local.get $4 - local.set $7 - local.get $3 - local.set $8 - local.get $6 - local.get $7 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.add - i32.load offset=8 - end - local.set $8 - block $~lib/internal/arraybuffer/STORE|inlined.2 - local.get $2 - local.set $7 - local.get $4 - local.set $6 - block $~lib/internal/arraybuffer/LOAD|inlined.12 (result i32) - local.get $2 - local.set $9 - local.get $5 - local.set $10 - local.get $3 - local.set $11 - local.get $9 - local.get $10 - i32.const 2 - i32.shl - i32.add - local.get $11 - i32.add - i32.load offset=8 - end - local.set $11 - local.get $3 - local.set $10 - local.get $7 - local.get $6 - i32.const 2 - i32.shl - i32.add - local.get $10 - i32.add - local.get $11 - i32.store offset=8 - end - block $~lib/internal/arraybuffer/STORE|inlined.3 - local.get $2 - local.set $10 - local.get $5 - local.set $11 - local.get $8 - local.set $6 - local.get $3 - local.set $7 - local.get $10 - local.get $11 - i32.const 2 - i32.shl - i32.add - local.get $7 - i32.add - local.get $6 - i32.store offset=8 - end - end - block - local.get $4 + local.get $3 i32.const 1 i32.add - local.set $4 - local.get $5 + local.set $3 + local.get $4 i32.const 1 i32.sub - local.set $5 + local.set $4 end br $repeat|0 unreachable @@ -18754,32 +19186,28 @@ end local.get $1 ) - (func $~lib/typedarray/Uint32Array#subarray (; 351 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/typedarray/Int16Array#subarray (; 371 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) (local $8 i32) + (local $9 i32) local.get $0 - local.set $3 + call $~lib/rt/pure/__retain + local.set $5 local.get $1 local.set $4 local.get $2 - local.set $5 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.9 (result i32) - local.get $3 - local.set $6 - local.get $6 - i32.load offset=8 - i32.const 2 - i32.shr_u - end + local.set $3 + local.get $5 + call $~lib/typedarray/Int16Array#get:length local.set $6 local.get $4 i32.const 0 i32.lt_s - if + if (result i32) local.get $6 local.get $4 i32.add @@ -18790,7 +19218,6 @@ local.get $8 i32.gt_s select - local.set $4 else local.get $4 local.tee $7 @@ -18800,25 +19227,24 @@ local.get $8 i32.lt_s select - local.set $4 end - local.get $5 + local.set $4 + local.get $3 i32.const 0 i32.lt_s - if + if (result i32) local.get $6 - local.get $5 + local.get $3 i32.add local.tee $7 - local.get $4 + i32.const 0 local.tee $8 local.get $7 local.get $8 i32.gt_s select - local.set $5 else - local.get $5 + local.get $3 local.tee $7 local.get $6 local.tee $8 @@ -18826,197 +19252,249 @@ local.get $8 i32.lt_s select - local.tee $7 - local.get $4 - local.tee $8 - local.get $7 - local.get $8 - i32.gt_s - select - local.set $5 - end - block $~lib/memory/memory.allocate|inlined.9 (result i32) - i32.const 12 - local.set $7 - local.get $7 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.9 end + local.set $3 + local.get $3 + local.tee $7 + local.get $4 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + local.set $3 + i32.const 12 + i32.const 6 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.set $7 local.get $7 - local.get $3 - i32.load + local.tee $8 + block (result i32) + local.get $5 + i32.load + local.tee $9 + local.get $8 + i32.load + local.tee $8 + i32.ne + if + local.get $9 + call $~lib/rt/pure/__retain + drop + local.get $8 + call $~lib/rt/pure/__release + end + local.get $9 + end i32.store local.get $7 - local.get $3 + local.get $5 i32.load offset=4 local.get $4 - i32.const 2 + i32.const 1 i32.shl i32.add i32.store offset=4 local.get $7 - local.get $5 + local.get $3 local.get $4 i32.sub - i32.const 2 + i32.const 1 i32.shl i32.store offset=8 local.get $7 + local.set $9 + local.get $5 + call $~lib/rt/pure/__release + local.get $9 ) - (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint32Array,u32> (; 352 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayReverse<~lib/typedarray/Int16Array,i16> (; 372 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) global.get $std/typedarray/testArrayReverseValues + call $~lib/rt/pure/__retain local.set $0 i32.const 0 i32.const 9 - call $~lib/typedarray/Uint32Array#constructor - local.set $1 + call $~lib/typedarray/Int16Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.set $2 i32.const 0 i32.const 9 - call $~lib/typedarray/Uint32Array#constructor - local.set $2 + call $~lib/typedarray/Int16Array#constructor + local.tee $3 + call $~lib/rt/pure/__retain + local.set $4 i32.const 0 - local.set $3 + local.set $5 block $break|0 i32.const 0 - local.set $3 + local.set $5 loop $repeat|0 - local.get $3 + local.get $5 i32.const 9 i32.lt_s i32.eqz br_if $break|0 - block - local.get $1 - local.get $3 - local.get $0 - local.get $3 - call $~lib/array/Array#__get - call $~lib/internal/typedarray/TypedArray#__set - local.get $2 - local.get $3 - local.get $0 - local.get $3 - call $~lib/array/Array#__get - call $~lib/internal/typedarray/TypedArray#__set - end - local.get $3 + local.get $2 + local.get $5 + local.get $0 + local.get $5 + call $~lib/array/Array#__get + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + call $~lib/typedarray/Int16Array#__set + local.get $4 + local.get $5 + local.get $0 + local.get $5 + call $~lib/array/Array#__get + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + call $~lib/typedarray/Int16Array#__set + local.get $5 i32.const 1 i32.add - local.set $3 + local.set $5 br $repeat|0 unreachable end unreachable end - local.get $1 - call $~lib/typedarray/Uint32Array#reverse - drop + local.get $2 + call $~lib/typedarray/Int16Array#reverse + call $~lib/rt/pure/__release block $break|1 i32.const 0 - local.set $3 + local.set $5 loop $repeat|1 - local.get $3 + local.get $5 i32.const 9 i32.lt_s i32.eqz br_if $break|1 - local.get $1 - local.get $3 - call $~lib/internal/typedarray/TypedArray#__get + local.get $2 + local.get $5 + call $~lib/typedarray/Int16Array#__get local.get $0 i32.const 8 - local.get $3 + local.get $5 i32.sub call $~lib/array/Array#__get + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s i32.eq i32.eqz if - i32.const 1056 - i32.const 8 - i32.const 461 + i32.const 1512 + i32.const 24 + i32.const 471 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $3 + local.get $5 i32.const 1 i32.add - local.set $3 + local.set $5 br $repeat|1 unreachable end unreachable end - local.get $2 + local.get $4 i32.const 4 i32.const 8 - call $~lib/typedarray/Uint32Array#subarray - call $~lib/typedarray/Uint32Array#reverse - local.set $4 - local.get $4 + call $~lib/typedarray/Int16Array#subarray + local.tee $6 + call $~lib/typedarray/Int16Array#reverse + local.set $7 + local.get $7 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Int16Array#__get i32.const 8 i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 466 + i32.const 1600 + i32.const 24 + i32.const 476 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $4 + local.get $7 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Int16Array#__get i32.const 7 i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 467 + i32.const 1600 + i32.const 24 + i32.const 477 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $4 + local.get $7 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Int16Array#__get i32.const 6 i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 468 + i32.const 1600 + i32.const 24 + i32.const 478 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $4 + local.get $7 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/typedarray/Int16Array#__get i32.const 5 i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 469 + i32.const 1600 + i32.const 24 + i32.const 479 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int64Array#reverse (; 353 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Uint16Array#reverse (; 373 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -19024,122 +19502,59 @@ (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i64) - (local $10 i32) - (local $11 i32) - (local $12 i64) local.get $0 + call $~lib/rt/pure/__retain local.set $1 local.get $1 - i32.load - local.set $2 - local.get $1 i32.load offset=4 - local.set $3 + local.set $2 block $break|0 block i32.const 0 - local.set $4 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.8 (result i32) - local.get $1 - local.set $5 - local.get $5 - i32.load offset=8 - i32.const 3 - i32.shr_u - end + local.set $3 + local.get $1 + call $~lib/typedarray/Uint16Array#get:length i32.const 1 i32.sub - local.set $5 + local.set $4 end loop $repeat|0 + local.get $3 local.get $4 - local.get $5 i32.lt_s i32.eqz br_if $break|0 + local.get $2 + local.get $3 + i32.const 1 + i32.shl + i32.add + local.set $5 + local.get $2 + local.get $4 + i32.const 1 + i32.shl + i32.add + local.set $6 + local.get $5 + i32.load16_u + local.set $7 + local.get $5 + local.get $6 + i32.load16_u + i32.store16 + local.get $6 + local.get $7 + i32.store16 block - block $~lib/internal/arraybuffer/LOAD|inlined.11 (result i64) - local.get $2 - local.set $6 - local.get $4 - local.set $7 - local.get $3 - local.set $8 - local.get $6 - local.get $7 - i32.const 3 - i32.shl - i32.add - local.get $8 - i32.add - i64.load offset=8 - end - local.set $9 - block $~lib/internal/arraybuffer/STORE|inlined.2 - local.get $2 - local.set $8 - local.get $4 - local.set $7 - block $~lib/internal/arraybuffer/LOAD|inlined.12 (result i64) - local.get $2 - local.set $6 - local.get $5 - local.set $10 - local.get $3 - local.set $11 - local.get $6 - local.get $10 - i32.const 3 - i32.shl - i32.add - local.get $11 - i32.add - i64.load offset=8 - end - local.set $12 - local.get $3 - local.set $11 - local.get $8 - local.get $7 - i32.const 3 - i32.shl - i32.add - local.get $11 - i32.add - local.get $12 - i64.store offset=8 - end - block $~lib/internal/arraybuffer/STORE|inlined.3 - local.get $2 - local.set $11 - local.get $5 - local.set $7 - local.get $9 - local.set $12 - local.get $3 - local.set $8 - local.get $11 - local.get $7 - i32.const 3 - i32.shl - i32.add - local.get $8 - i32.add - local.get $12 - i64.store offset=8 - end - end - block - local.get $4 + local.get $3 i32.const 1 i32.add - local.set $4 - local.get $5 + local.set $3 + local.get $4 i32.const 1 i32.sub - local.set $5 + local.set $4 end br $repeat|0 unreachable @@ -19148,32 +19563,28 @@ end local.get $1 ) - (func $~lib/typedarray/Int64Array#subarray (; 354 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/typedarray/Uint16Array#subarray (; 374 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) (local $8 i32) + (local $9 i32) local.get $0 - local.set $3 + call $~lib/rt/pure/__retain + local.set $5 local.get $1 local.set $4 local.get $2 - local.set $5 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.9 (result i32) - local.get $3 - local.set $6 - local.get $6 - i32.load offset=8 - i32.const 3 - i32.shr_u - end + local.set $3 + local.get $5 + call $~lib/typedarray/Uint16Array#get:length local.set $6 local.get $4 i32.const 0 i32.lt_s - if + if (result i32) local.get $6 local.get $4 i32.add @@ -19184,7 +19595,6 @@ local.get $8 i32.gt_s select - local.set $4 else local.get $4 local.tee $7 @@ -19194,25 +19604,24 @@ local.get $8 i32.lt_s select - local.set $4 end - local.get $5 + local.set $4 + local.get $3 i32.const 0 i32.lt_s - if + if (result i32) local.get $6 - local.get $5 + local.get $3 i32.add local.tee $7 - local.get $4 + i32.const 0 local.tee $8 local.get $7 local.get $8 i32.gt_s select - local.set $5 else - local.get $5 + local.get $3 local.tee $7 local.get $6 local.tee $8 @@ -19220,200 +19629,243 @@ local.get $8 i32.lt_s select - local.tee $7 - local.get $4 - local.tee $8 - local.get $7 - local.get $8 - i32.gt_s - select - local.set $5 - end - block $~lib/memory/memory.allocate|inlined.10 (result i32) - i32.const 12 - local.set $7 - local.get $7 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.10 end + local.set $3 + local.get $3 + local.tee $7 + local.get $4 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + local.set $3 + i32.const 12 + i32.const 7 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.set $7 local.get $7 - local.get $3 - i32.load + local.tee $8 + block (result i32) + local.get $5 + i32.load + local.tee $9 + local.get $8 + i32.load + local.tee $8 + i32.ne + if + local.get $9 + call $~lib/rt/pure/__retain + drop + local.get $8 + call $~lib/rt/pure/__release + end + local.get $9 + end i32.store local.get $7 - local.get $3 + local.get $5 i32.load offset=4 local.get $4 - i32.const 3 + i32.const 1 i32.shl i32.add i32.store offset=4 local.get $7 - local.get $5 + local.get $3 local.get $4 i32.sub - i32.const 3 + i32.const 1 i32.shl i32.store offset=8 local.get $7 + local.set $9 + local.get $5 + call $~lib/rt/pure/__release + local.get $9 ) - (func $std/typedarray/testArrayReverse<~lib/typedarray/Int64Array,i64> (; 355 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint16Array,u16> (; 375 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) global.get $std/typedarray/testArrayReverseValues + call $~lib/rt/pure/__retain local.set $0 i32.const 0 i32.const 9 - call $~lib/typedarray/Int64Array#constructor - local.set $1 + call $~lib/typedarray/Uint16Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.set $2 i32.const 0 i32.const 9 - call $~lib/typedarray/Int64Array#constructor - local.set $2 + call $~lib/typedarray/Uint16Array#constructor + local.tee $3 + call $~lib/rt/pure/__retain + local.set $4 i32.const 0 - local.set $3 + local.set $5 block $break|0 i32.const 0 - local.set $3 + local.set $5 loop $repeat|0 - local.get $3 + local.get $5 i32.const 9 i32.lt_s i32.eqz br_if $break|0 - block - local.get $1 - local.get $3 - local.get $0 - local.get $3 - call $~lib/array/Array#__get - i64.extend_i32_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $2 - local.get $3 - local.get $0 - local.get $3 - call $~lib/array/Array#__get - i64.extend_i32_s - call $~lib/internal/typedarray/TypedArray#__set - end - local.get $3 + local.get $2 + local.get $5 + local.get $0 + local.get $5 + call $~lib/array/Array#__get + i32.const 65535 + i32.and + call $~lib/typedarray/Uint16Array#__set + local.get $4 + local.get $5 + local.get $0 + local.get $5 + call $~lib/array/Array#__get + i32.const 65535 + i32.and + call $~lib/typedarray/Uint16Array#__set + local.get $5 i32.const 1 i32.add - local.set $3 + local.set $5 br $repeat|0 unreachable end unreachable end - local.get $1 - call $~lib/typedarray/Int64Array#reverse - drop + local.get $2 + call $~lib/typedarray/Uint16Array#reverse + call $~lib/rt/pure/__release block $break|1 i32.const 0 - local.set $3 + local.set $5 loop $repeat|1 - local.get $3 + local.get $5 i32.const 9 i32.lt_s i32.eqz br_if $break|1 - local.get $1 - local.get $3 - call $~lib/internal/typedarray/TypedArray#__get + local.get $2 + local.get $5 + call $~lib/typedarray/Uint16Array#__get local.get $0 i32.const 8 - local.get $3 + local.get $5 i32.sub call $~lib/array/Array#__get - i64.extend_i32_s - i64.eq + i32.const 65535 + i32.and + i32.eq i32.eqz if - i32.const 1056 - i32.const 8 - i32.const 461 + i32.const 1512 + i32.const 24 + i32.const 471 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $3 + local.get $5 i32.const 1 i32.add - local.set $3 + local.set $5 br $repeat|1 unreachable end unreachable end - local.get $2 + local.get $4 i32.const 4 i32.const 8 - call $~lib/typedarray/Int64Array#subarray - call $~lib/typedarray/Int64Array#reverse - local.set $4 - local.get $4 + call $~lib/typedarray/Uint16Array#subarray + local.tee $6 + call $~lib/typedarray/Uint16Array#reverse + local.set $7 + local.get $7 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i64.const 8 - i64.eq + call $~lib/typedarray/Uint16Array#__get + i32.const 8 + i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 466 + i32.const 1600 + i32.const 24 + i32.const 476 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $4 + local.get $7 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - i64.const 7 - i64.eq + call $~lib/typedarray/Uint16Array#__get + i32.const 7 + i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 467 + i32.const 1600 + i32.const 24 + i32.const 477 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $4 + local.get $7 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - i64.const 6 - i64.eq + call $~lib/typedarray/Uint16Array#__get + i32.const 6 + i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 468 + i32.const 1600 + i32.const 24 + i32.const 478 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $4 + local.get $7 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__get - i64.const 5 - i64.eq + call $~lib/typedarray/Uint16Array#__get + i32.const 5 + i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 469 + i32.const 1600 + i32.const 24 + i32.const 479 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint64Array#reverse (; 356 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Int32Array#reverse (; 376 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -19421,122 +19873,59 @@ (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i64) - (local $10 i32) - (local $11 i32) - (local $12 i64) local.get $0 + call $~lib/rt/pure/__retain local.set $1 local.get $1 - i32.load - local.set $2 - local.get $1 i32.load offset=4 - local.set $3 + local.set $2 block $break|0 block i32.const 0 - local.set $4 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.8 (result i32) - local.get $1 - local.set $5 - local.get $5 - i32.load offset=8 - i32.const 3 - i32.shr_u - end + local.set $3 + local.get $1 + call $~lib/typedarray/Int32Array#get:length i32.const 1 i32.sub - local.set $5 + local.set $4 end loop $repeat|0 + local.get $3 local.get $4 - local.get $5 i32.lt_s i32.eqz br_if $break|0 + local.get $2 + local.get $3 + i32.const 2 + i32.shl + i32.add + local.set $5 + local.get $2 + local.get $4 + i32.const 2 + i32.shl + i32.add + local.set $6 + local.get $5 + i32.load + local.set $7 + local.get $5 + local.get $6 + i32.load + i32.store + local.get $6 + local.get $7 + i32.store block - block $~lib/internal/arraybuffer/LOAD|inlined.11 (result i64) - local.get $2 - local.set $6 - local.get $4 - local.set $7 - local.get $3 - local.set $8 - local.get $6 - local.get $7 - i32.const 3 - i32.shl - i32.add - local.get $8 - i32.add - i64.load offset=8 - end - local.set $9 - block $~lib/internal/arraybuffer/STORE|inlined.2 - local.get $2 - local.set $8 - local.get $4 - local.set $7 - block $~lib/internal/arraybuffer/LOAD|inlined.12 (result i64) - local.get $2 - local.set $6 - local.get $5 - local.set $10 - local.get $3 - local.set $11 - local.get $6 - local.get $10 - i32.const 3 - i32.shl - i32.add - local.get $11 - i32.add - i64.load offset=8 - end - local.set $12 - local.get $3 - local.set $11 - local.get $8 - local.get $7 - i32.const 3 - i32.shl - i32.add - local.get $11 - i32.add - local.get $12 - i64.store offset=8 - end - block $~lib/internal/arraybuffer/STORE|inlined.3 - local.get $2 - local.set $11 - local.get $5 - local.set $7 - local.get $9 - local.set $12 - local.get $3 - local.set $8 - local.get $11 - local.get $7 - i32.const 3 - i32.shl - i32.add - local.get $8 - i32.add - local.get $12 - i64.store offset=8 - end - end - block - local.get $4 + local.get $3 i32.const 1 i32.add - local.set $4 - local.get $5 + local.set $3 + local.get $4 i32.const 1 i32.sub - local.set $5 + local.set $4 end br $repeat|0 unreachable @@ -19545,272 +19934,180 @@ end local.get $1 ) - (func $~lib/typedarray/Uint64Array#subarray (; 357 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - local.get $0 - local.set $3 - local.get $1 - local.set $4 - local.get $2 - local.set $5 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.9 (result i32) - local.get $3 - local.set $6 - local.get $6 - i32.load offset=8 - i32.const 3 - i32.shr_u - end - local.set $6 - local.get $4 - i32.const 0 - i32.lt_s - if - local.get $6 - local.get $4 - i32.add - local.tee $7 - i32.const 0 - local.tee $8 - local.get $7 - local.get $8 - i32.gt_s - select - local.set $4 - else - local.get $4 - local.tee $7 - local.get $6 - local.tee $8 - local.get $7 - local.get $8 - i32.lt_s - select - local.set $4 - end - local.get $5 - i32.const 0 - i32.lt_s - if - local.get $6 - local.get $5 - i32.add - local.tee $7 - local.get $4 - local.tee $8 - local.get $7 - local.get $8 - i32.gt_s - select - local.set $5 - else - local.get $5 - local.tee $7 - local.get $6 - local.tee $8 - local.get $7 - local.get $8 - i32.lt_s - select - local.tee $7 - local.get $4 - local.tee $8 - local.get $7 - local.get $8 - i32.gt_s - select - local.set $5 - end - block $~lib/memory/memory.allocate|inlined.11 (result i32) - i32.const 12 - local.set $7 - local.get $7 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.11 - end - local.set $7 - local.get $7 - local.get $3 - i32.load - i32.store - local.get $7 - local.get $3 - i32.load offset=4 - local.get $4 - i32.const 3 - i32.shl - i32.add - i32.store offset=4 - local.get $7 - local.get $5 - local.get $4 - i32.sub - i32.const 3 - i32.shl - i32.store offset=8 - local.get $7 - ) - (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint64Array,u64> (; 358 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayReverse<~lib/typedarray/Int32Array,i32> (; 377 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) global.get $std/typedarray/testArrayReverseValues + call $~lib/rt/pure/__retain local.set $0 i32.const 0 i32.const 9 - call $~lib/typedarray/Uint64Array#constructor - local.set $1 + call $~lib/typedarray/Int32Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.set $2 i32.const 0 i32.const 9 - call $~lib/typedarray/Uint64Array#constructor - local.set $2 + call $~lib/typedarray/Int32Array#constructor + local.tee $3 + call $~lib/rt/pure/__retain + local.set $4 i32.const 0 - local.set $3 + local.set $5 block $break|0 i32.const 0 - local.set $3 + local.set $5 loop $repeat|0 - local.get $3 + local.get $5 i32.const 9 i32.lt_s i32.eqz br_if $break|0 - block - local.get $1 - local.get $3 - local.get $0 - local.get $3 - call $~lib/array/Array#__get - i64.extend_i32_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $2 - local.get $3 - local.get $0 - local.get $3 - call $~lib/array/Array#__get - i64.extend_i32_s - call $~lib/internal/typedarray/TypedArray#__set - end - local.get $3 + local.get $2 + local.get $5 + local.get $0 + local.get $5 + call $~lib/array/Array#__get + call $~lib/typedarray/Int32Array#__set + local.get $4 + local.get $5 + local.get $0 + local.get $5 + call $~lib/array/Array#__get + call $~lib/typedarray/Int32Array#__set + local.get $5 i32.const 1 i32.add - local.set $3 + local.set $5 br $repeat|0 unreachable end unreachable end - local.get $1 - call $~lib/typedarray/Uint64Array#reverse - drop + local.get $2 + call $~lib/typedarray/Int32Array#reverse + call $~lib/rt/pure/__release block $break|1 i32.const 0 - local.set $3 + local.set $5 loop $repeat|1 - local.get $3 + local.get $5 i32.const 9 i32.lt_s i32.eqz br_if $break|1 - local.get $1 - local.get $3 - call $~lib/internal/typedarray/TypedArray#__get + local.get $2 + local.get $5 + call $~lib/typedarray/Int32Array#__get local.get $0 i32.const 8 - local.get $3 + local.get $5 i32.sub call $~lib/array/Array#__get - i64.extend_i32_s - i64.eq + i32.eq i32.eqz if - i32.const 1056 - i32.const 8 - i32.const 461 + i32.const 1512 + i32.const 24 + i32.const 471 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $3 + local.get $5 i32.const 1 i32.add - local.set $3 + local.set $5 br $repeat|1 unreachable end unreachable end - local.get $2 + local.get $4 i32.const 4 i32.const 8 - call $~lib/typedarray/Uint64Array#subarray - call $~lib/typedarray/Uint64Array#reverse - local.set $4 - local.get $4 + call $~lib/typedarray/Int32Array#subarray + local.tee $6 + call $~lib/typedarray/Int32Array#reverse + local.set $7 + local.get $7 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i64.const 8 - i64.eq + call $~lib/typedarray/Int32Array#__get + i32.const 8 + i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 466 + i32.const 1600 + i32.const 24 + i32.const 476 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $4 + local.get $7 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - i64.const 7 - i64.eq + call $~lib/typedarray/Int32Array#__get + i32.const 7 + i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 467 + i32.const 1600 + i32.const 24 + i32.const 477 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $4 + local.get $7 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - i64.const 6 - i64.eq + call $~lib/typedarray/Int32Array#__get + i32.const 6 + i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 468 + i32.const 1600 + i32.const 24 + i32.const 478 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $4 + local.get $7 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__get - i64.const 5 - i64.eq + call $~lib/typedarray/Int32Array#__get + i32.const 5 + i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 469 + i32.const 1600 + i32.const 24 + i32.const 479 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Float32Array#reverse (; 359 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Uint32Array#reverse (; 378 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -19818,122 +20115,59 @@ (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 f32) - (local $10 i32) - (local $11 i32) - (local $12 f32) local.get $0 + call $~lib/rt/pure/__retain local.set $1 local.get $1 - i32.load - local.set $2 - local.get $1 i32.load offset=4 - local.set $3 + local.set $2 block $break|0 block i32.const 0 - local.set $4 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.8 (result i32) - local.get $1 - local.set $5 - local.get $5 - i32.load offset=8 - i32.const 2 - i32.shr_u - end + local.set $3 + local.get $1 + call $~lib/typedarray/Uint32Array#get:length i32.const 1 i32.sub - local.set $5 + local.set $4 end loop $repeat|0 + local.get $3 local.get $4 - local.get $5 i32.lt_s i32.eqz br_if $break|0 + local.get $2 + local.get $3 + i32.const 2 + i32.shl + i32.add + local.set $5 + local.get $2 + local.get $4 + i32.const 2 + i32.shl + i32.add + local.set $6 + local.get $5 + i32.load + local.set $7 + local.get $5 + local.get $6 + i32.load + i32.store + local.get $6 + local.get $7 + i32.store block - block $~lib/internal/arraybuffer/LOAD|inlined.11 (result f32) - local.get $2 - local.set $6 - local.get $4 - local.set $7 - local.get $3 - local.set $8 - local.get $6 - local.get $7 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.add - f32.load offset=8 - end - local.set $9 - block $~lib/internal/arraybuffer/STORE|inlined.2 - local.get $2 - local.set $8 - local.get $4 - local.set $7 - block $~lib/internal/arraybuffer/LOAD|inlined.12 (result f32) - local.get $2 - local.set $6 - local.get $5 - local.set $10 - local.get $3 - local.set $11 - local.get $6 - local.get $10 - i32.const 2 - i32.shl - i32.add - local.get $11 - i32.add - f32.load offset=8 - end - local.set $12 - local.get $3 - local.set $11 - local.get $8 - local.get $7 - i32.const 2 - i32.shl - i32.add - local.get $11 - i32.add - local.get $12 - f32.store offset=8 - end - block $~lib/internal/arraybuffer/STORE|inlined.3 - local.get $2 - local.set $11 - local.get $5 - local.set $7 - local.get $9 - local.set $12 - local.get $3 - local.set $8 - local.get $11 - local.get $7 - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.add - local.get $12 - f32.store offset=8 - end - end - block - local.get $4 + local.get $3 i32.const 1 i32.add - local.set $4 - local.get $5 + local.set $3 + local.get $4 i32.const 1 i32.sub - local.set $5 + local.set $4 end br $repeat|0 unreachable @@ -19942,32 +20176,28 @@ end local.get $1 ) - (func $~lib/typedarray/Float32Array#subarray (; 360 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/typedarray/Uint32Array#subarray (; 379 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) (local $8 i32) + (local $9 i32) local.get $0 - local.set $3 + call $~lib/rt/pure/__retain + local.set $5 local.get $1 local.set $4 local.get $2 - local.set $5 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.9 (result i32) - local.get $3 - local.set $6 - local.get $6 - i32.load offset=8 - i32.const 2 - i32.shr_u - end + local.set $3 + local.get $5 + call $~lib/typedarray/Uint32Array#get:length local.set $6 local.get $4 i32.const 0 i32.lt_s - if + if (result i32) local.get $6 local.get $4 i32.add @@ -19978,7 +20208,6 @@ local.get $8 i32.gt_s select - local.set $4 else local.get $4 local.tee $7 @@ -19988,25 +20217,24 @@ local.get $8 i32.lt_s select - local.set $4 end - local.get $5 + local.set $4 + local.get $3 i32.const 0 i32.lt_s - if + if (result i32) local.get $6 - local.get $5 + local.get $3 i32.add local.tee $7 - local.get $4 + i32.const 0 local.tee $8 local.get $7 local.get $8 i32.gt_s select - local.set $5 else - local.get $5 + local.get $3 local.tee $7 local.get $6 local.tee $8 @@ -20014,29 +20242,44 @@ local.get $8 i32.lt_s select - local.tee $7 - local.get $4 - local.tee $8 - local.get $7 - local.get $8 - i32.gt_s - select - local.set $5 end - block $~lib/memory/memory.allocate|inlined.12 (result i32) - i32.const 12 - local.set $7 - local.get $7 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.12 + local.set $3 + local.get $3 + local.tee $7 + local.get $4 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + local.set $3 + i32.const 12 + i32.const 9 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $7 + local.get $7 + local.tee $8 + block (result i32) + local.get $5 + i32.load + local.tee $9 + local.get $8 + i32.load + local.tee $8 + i32.ne + if + local.get $9 + call $~lib/rt/pure/__retain + drop + local.get $8 + call $~lib/rt/pure/__release + end + local.get $9 end - local.set $7 - local.get $7 - local.get $3 - i32.load i32.store local.get $7 - local.get $3 + local.get $5 i32.load offset=4 local.get $4 i32.const 2 @@ -20044,1625 +20287,2776 @@ i32.add i32.store offset=4 local.get $7 - local.get $5 + local.get $3 local.get $4 i32.sub i32.const 2 i32.shl i32.store offset=8 local.get $7 + local.set $9 + local.get $5 + call $~lib/rt/pure/__release + local.get $9 ) - (func $std/typedarray/testArrayReverse<~lib/typedarray/Float32Array,f32> (; 361 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint32Array,u32> (; 380 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) global.get $std/typedarray/testArrayReverseValues + call $~lib/rt/pure/__retain local.set $0 i32.const 0 i32.const 9 - call $~lib/typedarray/Float32Array#constructor - local.set $1 + call $~lib/typedarray/Uint32Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.set $2 i32.const 0 i32.const 9 - call $~lib/typedarray/Float32Array#constructor - local.set $2 + call $~lib/typedarray/Uint32Array#constructor + local.tee $3 + call $~lib/rt/pure/__retain + local.set $4 i32.const 0 - local.set $3 + local.set $5 block $break|0 i32.const 0 - local.set $3 + local.set $5 loop $repeat|0 - local.get $3 + local.get $5 i32.const 9 i32.lt_s i32.eqz br_if $break|0 - block - local.get $1 - local.get $3 - local.get $0 - local.get $3 - call $~lib/array/Array#__get - f32.convert_i32_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $2 - local.get $3 - local.get $0 - local.get $3 - call $~lib/array/Array#__get - f32.convert_i32_s - call $~lib/internal/typedarray/TypedArray#__set - end - local.get $3 + local.get $2 + local.get $5 + local.get $0 + local.get $5 + call $~lib/array/Array#__get + call $~lib/typedarray/Uint32Array#__set + local.get $4 + local.get $5 + local.get $0 + local.get $5 + call $~lib/array/Array#__get + call $~lib/typedarray/Uint32Array#__set + local.get $5 i32.const 1 i32.add - local.set $3 + local.set $5 br $repeat|0 unreachable end unreachable end - local.get $1 - call $~lib/typedarray/Float32Array#reverse - drop + local.get $2 + call $~lib/typedarray/Uint32Array#reverse + call $~lib/rt/pure/__release block $break|1 i32.const 0 - local.set $3 + local.set $5 loop $repeat|1 - local.get $3 + local.get $5 i32.const 9 i32.lt_s i32.eqz br_if $break|1 - local.get $1 - local.get $3 - call $~lib/internal/typedarray/TypedArray#__get + local.get $2 + local.get $5 + call $~lib/typedarray/Uint32Array#__get local.get $0 i32.const 8 - local.get $3 + local.get $5 i32.sub call $~lib/array/Array#__get - f32.convert_i32_s - f32.eq + i32.eq i32.eqz if - i32.const 1056 - i32.const 8 - i32.const 461 + i32.const 1512 + i32.const 24 + i32.const 471 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $3 + local.get $5 i32.const 1 i32.add - local.set $3 + local.set $5 br $repeat|1 unreachable end unreachable end - local.get $2 + local.get $4 i32.const 4 i32.const 8 - call $~lib/typedarray/Float32Array#subarray - call $~lib/typedarray/Float32Array#reverse - local.set $4 - local.get $4 + call $~lib/typedarray/Uint32Array#subarray + local.tee $6 + call $~lib/typedarray/Uint32Array#reverse + local.set $7 + local.get $7 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - f32.const 8 - f32.eq + call $~lib/typedarray/Uint32Array#__get + i32.const 8 + i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 466 + i32.const 1600 + i32.const 24 + i32.const 476 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $4 + local.get $7 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - f32.const 7 - f32.eq + call $~lib/typedarray/Uint32Array#__get + i32.const 7 + i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 467 + i32.const 1600 + i32.const 24 + i32.const 477 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $4 + local.get $7 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - f32.const 6 - f32.eq + call $~lib/typedarray/Uint32Array#__get + i32.const 6 + i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 468 + i32.const 1600 + i32.const 24 + i32.const 478 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $4 + local.get $7 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__get - f32.const 5 - f32.eq + call $~lib/typedarray/Uint32Array#__get + i32.const 5 + i32.eq i32.eqz if - i32.const 1128 - i32.const 8 - i32.const 469 + i32.const 1600 + i32.const 24 + i32.const 479 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Float64Array#reverse (; 362 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Int64Array#reverse (; 381 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 f64) - (local $10 i32) - (local $11 i32) - (local $12 f64) + (local $7 i64) local.get $0 + call $~lib/rt/pure/__retain local.set $1 local.get $1 - i32.load - local.set $2 - local.get $1 i32.load offset=4 - local.set $3 + local.set $2 block $break|0 block i32.const 0 - local.set $4 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.11 (result i32) - local.get $1 - local.set $5 - local.get $5 - i32.load offset=8 - i32.const 3 - i32.shr_u - end + local.set $3 + local.get $1 + call $~lib/typedarray/Int64Array#get:length i32.const 1 i32.sub - local.set $5 + local.set $4 end loop $repeat|0 + local.get $3 local.get $4 - local.get $5 i32.lt_s i32.eqz br_if $break|0 + local.get $2 + local.get $3 + i32.const 3 + i32.shl + i32.add + local.set $5 + local.get $2 + local.get $4 + i32.const 3 + i32.shl + i32.add + local.set $6 + local.get $5 + i64.load + local.set $7 + local.get $5 + local.get $6 + i64.load + i64.store + local.get $6 + local.get $7 + i64.store block - block $~lib/internal/arraybuffer/LOAD|inlined.23 (result f64) - local.get $2 - local.set $6 - local.get $4 - local.set $7 - local.get $3 - local.set $8 - local.get $6 - local.get $7 - i32.const 3 - i32.shl - i32.add - local.get $8 - i32.add - f64.load offset=8 - end - local.set $9 - block $~lib/internal/arraybuffer/STORE|inlined.14 - local.get $2 - local.set $8 - local.get $4 - local.set $7 - block $~lib/internal/arraybuffer/LOAD|inlined.24 (result f64) - local.get $2 - local.set $6 - local.get $5 - local.set $10 - local.get $3 - local.set $11 - local.get $6 - local.get $10 - i32.const 3 - i32.shl - i32.add - local.get $11 - i32.add - f64.load offset=8 - end - local.set $12 - local.get $3 - local.set $11 - local.get $8 - local.get $7 - i32.const 3 - i32.shl - i32.add - local.get $11 - i32.add - local.get $12 - f64.store offset=8 - end - block $~lib/internal/arraybuffer/STORE|inlined.15 - local.get $2 - local.set $11 - local.get $5 - local.set $7 - local.get $9 - local.set $12 - local.get $3 - local.set $8 - local.get $11 - local.get $7 - i32.const 3 - i32.shl - i32.add - local.get $8 - i32.add - local.get $12 - f64.store offset=8 - end - end - block - local.get $4 + local.get $3 i32.const 1 i32.add - local.set $4 - local.get $5 + local.set $3 + local.get $4 i32.const 1 i32.sub - local.set $5 + local.set $4 end br $repeat|0 unreachable end - unreachable + unreachable + end + local.get $1 + ) + (func $~lib/typedarray/Int64Array#subarray (; 382 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + call $~lib/typedarray/Int64Array#get:length + local.set $6 + local.get $4 + i32.const 0 + i32.lt_s + if (result i32) + local.get $6 + local.get $4 + i32.add + local.tee $7 + i32.const 0 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + else + local.get $4 + local.tee $7 + local.get $6 + local.tee $8 + local.get $7 + local.get $8 + i32.lt_s + select + end + local.set $4 + local.get $3 + i32.const 0 + i32.lt_s + if (result i32) + local.get $6 + local.get $3 + i32.add + local.tee $7 + i32.const 0 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + else + local.get $3 + local.tee $7 + local.get $6 + local.tee $8 + local.get $7 + local.get $8 + i32.lt_s + select + end + local.set $3 + local.get $3 + local.tee $7 + local.get $4 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + local.set $3 + i32.const 12 + i32.const 10 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $7 + local.get $7 + local.tee $8 + block (result i32) + local.get $5 + i32.load + local.tee $9 + local.get $8 + i32.load + local.tee $8 + i32.ne + if + local.get $9 + call $~lib/rt/pure/__retain + drop + local.get $8 + call $~lib/rt/pure/__release + end + local.get $9 end - local.get $1 + i32.store + local.get $7 + local.get $5 + i32.load offset=4 + local.get $4 + i32.const 3 + i32.shl + i32.add + i32.store offset=4 + local.get $7 + local.get $3 + local.get $4 + i32.sub + i32.const 3 + i32.shl + i32.store offset=8 + local.get $7 + local.set $9 + local.get $5 + call $~lib/rt/pure/__release + local.get $9 ) - (func $std/typedarray/testArrayReverse<~lib/typedarray/Float64Array,f64> (; 363 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayReverse<~lib/typedarray/Int64Array,i64> (; 383 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) global.get $std/typedarray/testArrayReverseValues + call $~lib/rt/pure/__retain local.set $0 i32.const 0 i32.const 9 - call $~lib/typedarray/Float64Array#constructor - local.set $1 + call $~lib/typedarray/Int64Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.set $2 i32.const 0 i32.const 9 - call $~lib/typedarray/Float64Array#constructor - local.set $2 + call $~lib/typedarray/Int64Array#constructor + local.tee $3 + call $~lib/rt/pure/__retain + local.set $4 i32.const 0 - local.set $3 + local.set $5 block $break|0 i32.const 0 - local.set $3 + local.set $5 loop $repeat|0 - local.get $3 + local.get $5 i32.const 9 i32.lt_s i32.eqz br_if $break|0 - block - local.get $1 - local.get $3 - local.get $0 - local.get $3 - call $~lib/array/Array#__get - f64.convert_i32_s - call $~lib/internal/typedarray/TypedArray#__set - local.get $2 - local.get $3 - local.get $0 - local.get $3 - call $~lib/array/Array#__get - f64.convert_i32_s - call $~lib/internal/typedarray/TypedArray#__set - end - local.get $3 + local.get $2 + local.get $5 + local.get $0 + local.get $5 + call $~lib/array/Array#__get + i64.extend_i32_s + call $~lib/typedarray/Int64Array#__set + local.get $4 + local.get $5 + local.get $0 + local.get $5 + call $~lib/array/Array#__get + i64.extend_i32_s + call $~lib/typedarray/Int64Array#__set + local.get $5 i32.const 1 i32.add - local.set $3 + local.set $5 br $repeat|0 unreachable end unreachable end - local.get $1 - call $~lib/typedarray/Float64Array#reverse - drop + local.get $2 + call $~lib/typedarray/Int64Array#reverse + call $~lib/rt/pure/__release block $break|1 i32.const 0 - local.set $3 + local.set $5 loop $repeat|1 - local.get $3 + local.get $5 i32.const 9 i32.lt_s i32.eqz br_if $break|1 - local.get $1 - local.get $3 - call $~lib/internal/typedarray/TypedArray#__get + local.get $2 + local.get $5 + call $~lib/typedarray/Int64Array#__get local.get $0 i32.const 8 - local.get $3 + local.get $5 i32.sub call $~lib/array/Array#__get - f64.convert_i32_s - f64.eq + i64.extend_i32_s + i64.eq i32.eqz if - i32.const 1056 - i32.const 8 - i32.const 461 + i32.const 1512 + i32.const 24 + i32.const 471 i32.const 4 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - local.get $3 + local.get $5 i32.const 1 i32.add - local.set $3 + local.set $5 br $repeat|1 unreachable end unreachable end - local.get $2 - i32.const 4 - i32.const 8 - call $~lib/typedarray/Float64Array#subarray - call $~lib/typedarray/Float64Array#reverse - local.set $4 - local.get $4 - i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - f64.const 8 - f64.eq - i32.eqz - if - i32.const 1128 - i32.const 8 - i32.const 466 - i32.const 2 - call $~lib/env/abort - unreachable - end - local.get $4 - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - f64.const 7 - f64.eq - i32.eqz - if - i32.const 1128 - i32.const 8 - i32.const 467 - i32.const 2 - call $~lib/env/abort - unreachable - end - local.get $4 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - f64.const 6 - f64.eq - i32.eqz - if - i32.const 1128 - i32.const 8 - i32.const 468 - i32.const 2 - call $~lib/env/abort - unreachable - end - local.get $4 - i32.const 3 - call $~lib/internal/typedarray/TypedArray#__get - f64.const 5 - f64.eq - i32.eqz - if - i32.const 1128 - i32.const 8 - i32.const 469 - i32.const 2 - call $~lib/env/abort - unreachable - end - ) - (func $start:std/typedarray (; 364 ;) (type $FUNCSIG$v) - (local $0 i32) - global.get $~lib/typedarray/Int8Array.BYTES_PER_ELEMENT - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 1 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $~lib/typedarray/Uint8Array.BYTES_PER_ELEMENT - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 2 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $~lib/typedarray/Uint8ClampedArray.BYTES_PER_ELEMENT - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 3 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $~lib/typedarray/Int16Array.BYTES_PER_ELEMENT - i32.const 2 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 4 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $~lib/typedarray/Uint16Array.BYTES_PER_ELEMENT - i32.const 2 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 5 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $~lib/typedarray/Int32Array.BYTES_PER_ELEMENT - i32.const 4 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 6 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $~lib/typedarray/Uint32Array.BYTES_PER_ELEMENT + local.get $4 i32.const 4 - i32.eq + i32.const 8 + call $~lib/typedarray/Int64Array#subarray + local.tee $6 + call $~lib/typedarray/Int64Array#reverse + local.set $7 + local.get $7 + i32.const 0 + call $~lib/typedarray/Int64Array#__get + i64.const 8 + i64.eq i32.eqz if - i32.const 0 - i32.const 8 - i32.const 7 - i32.const 0 - call $~lib/env/abort + i32.const 1600 + i32.const 24 + i32.const 476 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $~lib/typedarray/Int64Array.BYTES_PER_ELEMENT - i32.const 8 - i32.eq + local.get $7 + i32.const 1 + call $~lib/typedarray/Int64Array#__get + i64.const 7 + i64.eq i32.eqz if - i32.const 0 - i32.const 8 - i32.const 8 - i32.const 0 - call $~lib/env/abort + i32.const 1600 + i32.const 24 + i32.const 477 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $~lib/typedarray/Uint64Array.BYTES_PER_ELEMENT - i32.const 8 - i32.eq + local.get $7 + i32.const 2 + call $~lib/typedarray/Int64Array#__get + i64.const 6 + i64.eq i32.eqz if - i32.const 0 - i32.const 8 - i32.const 9 - i32.const 0 - call $~lib/env/abort + i32.const 1600 + i32.const 24 + i32.const 478 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $~lib/typedarray/Float32Array.BYTES_PER_ELEMENT - i32.const 4 - i32.eq + local.get $7 + i32.const 3 + call $~lib/typedarray/Int64Array#__get + i64.const 5 + i64.eq i32.eqz if - i32.const 0 - i32.const 8 - i32.const 10 - i32.const 0 - call $~lib/env/abort + i32.const 1600 + i32.const 24 + i32.const 479 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $~lib/typedarray/Float64Array.BYTES_PER_ELEMENT - i32.const 8 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 11 - i32.const 0 - call $~lib/env/abort + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release + ) + (func $~lib/typedarray/Uint64Array#reverse (; 384 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i64) + local.get $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 + i32.load offset=4 + local.set $2 + block $break|0 + block + i32.const 0 + local.set $3 + local.get $1 + call $~lib/typedarray/Uint64Array#get:length + i32.const 1 + i32.sub + local.set $4 + end + loop $repeat|0 + local.get $3 + local.get $4 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $2 + local.get $3 + i32.const 3 + i32.shl + i32.add + local.set $5 + local.get $2 + local.get $4 + i32.const 3 + i32.shl + i32.add + local.set $6 + local.get $5 + i64.load + local.set $7 + local.get $5 + local.get $6 + i64.load + i64.store + local.get $6 + local.get $7 + i64.store + block + local.get $3 + i32.const 1 + i32.add + local.set $3 + local.get $4 + i32.const 1 + i32.sub + local.set $4 + end + br $repeat|0 + unreachable + end unreachable end - call $start:~lib/allocator/arena + local.get $1 + ) + (func $~lib/typedarray/Uint64Array#subarray (; 385 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + call $~lib/typedarray/Uint64Array#get:length + local.set $6 + local.get $4 i32.const 0 - call $std/typedarray/testInstantiate - i32.const 5 - call $std/typedarray/testInstantiate + i32.lt_s + if (result i32) + local.get $6 + local.get $4 + i32.add + local.tee $7 + i32.const 0 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + else + local.get $4 + local.tee $7 + local.get $6 + local.tee $8 + local.get $7 + local.get $8 + i32.lt_s + select + end + local.set $4 + local.get $3 i32.const 0 + i32.lt_s + if (result i32) + local.get $6 + local.get $3 + i32.add + local.tee $7 + i32.const 0 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + else + local.get $3 + local.tee $7 + local.get $6 + local.tee $8 + local.get $7 + local.get $8 + i32.lt_s + select + end + local.set $3 + local.get $3 + local.tee $7 + local.get $4 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + local.set $3 + i32.const 12 + i32.const 11 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $7 + local.get $7 + local.tee $8 + block (result i32) + local.get $5 + i32.load + local.tee $9 + local.get $8 + i32.load + local.tee $8 + i32.ne + if + local.get $9 + call $~lib/rt/pure/__retain + drop + local.get $8 + call $~lib/rt/pure/__release + end + local.get $9 + end + i32.store + local.get $7 + local.get $5 + i32.load offset=4 + local.get $4 i32.const 3 - call $~lib/typedarray/Int32Array#constructor - global.set $std/typedarray/arr - global.get $std/typedarray/arr + i32.shl + i32.add + i32.store offset=4 + local.get $7 + local.get $3 + local.get $4 + i32.sub + i32.const 3 + i32.shl + i32.store offset=8 + local.get $7 + local.set $9 + local.get $5 + call $~lib/rt/pure/__release + local.get $9 + ) + (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint64Array,u64> (; 386 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + global.get $std/typedarray/testArrayReverseValues + call $~lib/rt/pure/__retain + local.set $0 + i32.const 0 + i32.const 9 + call $~lib/typedarray/Uint64Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.set $2 + i32.const 0 + i32.const 9 + call $~lib/typedarray/Uint64Array#constructor + local.tee $3 + call $~lib/rt/pure/__retain + local.set $4 i32.const 0 - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/arr - i32.const 1 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/arr - i32.const 2 - i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set - block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) - global.get $std/typedarray/arr - local.set $0 - local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u - end - i32.const 3 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 96 + local.set $5 + block $break|0 i32.const 0 - call $~lib/env/abort + local.set $5 + loop $repeat|0 + local.get $5 + i32.const 9 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $2 + local.get $5 + local.get $0 + local.get $5 + call $~lib/array/Array#__get + i64.extend_i32_s + call $~lib/typedarray/Uint64Array#__set + local.get $4 + local.get $5 + local.get $0 + local.get $5 + call $~lib/array/Array#__get + i64.extend_i32_s + call $~lib/typedarray/Uint64Array#__set + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|0 + unreachable + end unreachable end - global.get $std/typedarray/arr - i32.load offset=4 - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 97 + local.get $2 + call $~lib/typedarray/Uint64Array#reverse + call $~lib/rt/pure/__release + block $break|1 i32.const 0 - call $~lib/env/abort + local.set $5 + loop $repeat|1 + local.get $5 + i32.const 9 + i32.lt_s + i32.eqz + br_if $break|1 + local.get $2 + local.get $5 + call $~lib/typedarray/Uint64Array#__get + local.get $0 + i32.const 8 + local.get $5 + i32.sub + call $~lib/array/Array#__get + i64.extend_i32_s + i64.eq + i32.eqz + if + i32.const 1512 + i32.const 24 + i32.const 471 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|1 + unreachable + end unreachable end - global.get $std/typedarray/arr - i32.load offset=8 - i32.const 3 + local.get $4 i32.const 4 - i32.mul - i32.eq + i32.const 8 + call $~lib/typedarray/Uint64Array#subarray + local.tee $6 + call $~lib/typedarray/Uint64Array#reverse + local.set $7 + local.get $7 + i32.const 0 + call $~lib/typedarray/Uint64Array#__get + i64.const 8 + i64.eq i32.eqz if - i32.const 0 - i32.const 8 - i32.const 98 - i32.const 0 - call $~lib/env/abort + i32.const 1600 + i32.const 24 + i32.const 476 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/arr - i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get + local.get $7 i32.const 1 - i32.eq + call $~lib/typedarray/Uint64Array#__get + i64.const 7 + i64.eq i32.eqz if - i32.const 0 - i32.const 8 - i32.const 99 - i32.const 0 - call $~lib/env/abort + i32.const 1600 + i32.const 24 + i32.const 477 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/arr - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get + local.get $7 i32.const 2 - i32.eq + call $~lib/typedarray/Uint64Array#__get + i64.const 6 + i64.eq i32.eqz if - i32.const 0 - i32.const 8 - i32.const 100 - i32.const 0 - call $~lib/env/abort + i32.const 1600 + i32.const 24 + i32.const 478 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/arr - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get + local.get $7 i32.const 3 - i32.eq + call $~lib/typedarray/Uint64Array#__get + i64.const 5 + i64.eq i32.eqz if - i32.const 0 - i32.const 8 - i32.const 101 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/typedarray/arr - i32.const 1 - i32.const 2 - call $~lib/typedarray/Int32Array#subarray - global.set $std/typedarray/arr - block $~lib/internal/typedarray/TypedArray#get:length|inlined.3 (result i32) - global.get $std/typedarray/arr - local.set $0 - local.get $0 - i32.load offset=8 + i32.const 1600 + i32.const 24 + i32.const 479 i32.const 2 - i32.shr_u - end - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 104 - i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/arr + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release + ) + (func $~lib/typedarray/Float32Array#reverse (; 387 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 f32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 i32.load offset=4 - i32.const 1 - i32.const 4 - i32.mul - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 105 - i32.const 0 - call $~lib/env/abort + local.set $2 + block $break|0 + block + i32.const 0 + local.set $3 + local.get $1 + call $~lib/typedarray/Float32Array#get:length + i32.const 1 + i32.sub + local.set $4 + end + loop $repeat|0 + local.get $3 + local.get $4 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $2 + local.get $3 + i32.const 2 + i32.shl + i32.add + local.set $5 + local.get $2 + local.get $4 + i32.const 2 + i32.shl + i32.add + local.set $6 + local.get $5 + f32.load + local.set $7 + local.get $5 + local.get $6 + f32.load + f32.store + local.get $6 + local.get $7 + f32.store + block + local.get $3 + i32.const 1 + i32.add + local.set $3 + local.get $4 + i32.const 1 + i32.sub + local.set $4 + end + br $repeat|0 + unreachable + end unreachable end - global.get $std/typedarray/arr - i32.load offset=8 - i32.const 1 - i32.const 4 - i32.mul - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 106 + local.get $1 + ) + (func $~lib/typedarray/Float32Array#subarray (; 388 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + call $~lib/typedarray/Float32Array#get:length + local.set $6 + local.get $4 + i32.const 0 + i32.lt_s + if (result i32) + local.get $6 + local.get $4 + i32.add + local.tee $7 i32.const 0 - call $~lib/env/abort - unreachable + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + else + local.get $4 + local.tee $7 + local.get $6 + local.tee $8 + local.get $7 + local.get $8 + i32.lt_s + select end - global.get $std/typedarray/arr + local.set $4 + local.get $3 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 2 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 107 + i32.lt_s + if (result i32) + local.get $6 + local.get $3 + i32.add + local.tee $7 i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 0 - i32.const 8 - call $~lib/typedarray/Float64Array#constructor - global.set $std/typedarray/af64 - global.get $std/typedarray/af64 - i32.const 0 - f64.const 1 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/af64 - i32.const 1 - f64.const 2 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/af64 - i32.const 2 - f64.const 7 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/af64 - i32.const 3 - f64.const 6 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/af64 - i32.const 4 - f64.const 5 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/af64 - i32.const 5 - f64.const 4 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/af64 - i32.const 6 - f64.const 3 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/af64 - i32.const 7 - f64.const 8 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/af64 - i32.const 2 - i32.const 6 - call $~lib/typedarray/Float64Array#subarray - global.set $std/typedarray/af64 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.2 (result i32) - global.get $std/typedarray/af64 - local.set $0 - local.get $0 - i32.load offset=8 - i32.const 3 - i32.shr_u + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + else + local.get $3 + local.tee $7 + local.get $6 + local.tee $8 + local.get $7 + local.get $8 + i32.lt_s + select end - i32.const 4 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 121 - i32.const 0 - call $~lib/env/abort - unreachable + local.set $3 + local.get $3 + local.tee $7 + local.get $4 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + local.set $3 + i32.const 12 + i32.const 12 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $7 + local.get $7 + local.tee $8 + block (result i32) + local.get $5 + i32.load + local.tee $9 + local.get $8 + i32.load + local.tee $8 + i32.ne + if + local.get $9 + call $~lib/rt/pure/__retain + drop + local.get $8 + call $~lib/rt/pure/__release + end + local.get $9 end - global.get $std/typedarray/af64 + i32.store + local.get $7 + local.get $5 i32.load offset=4 + local.get $4 i32.const 2 - i32.const 8 - i32.mul - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 122 + i32.shl + i32.add + i32.store offset=4 + local.get $7 + local.get $3 + local.get $4 + i32.sub + i32.const 2 + i32.shl + i32.store offset=8 + local.get $7 + local.set $9 + local.get $5 + call $~lib/rt/pure/__release + local.get $9 + ) + (func $std/typedarray/testArrayReverse<~lib/typedarray/Float32Array,f32> (; 389 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + global.get $std/typedarray/testArrayReverseValues + call $~lib/rt/pure/__retain + local.set $0 + i32.const 0 + i32.const 9 + call $~lib/typedarray/Float32Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.set $2 + i32.const 0 + i32.const 9 + call $~lib/typedarray/Float32Array#constructor + local.tee $3 + call $~lib/rt/pure/__retain + local.set $4 + i32.const 0 + local.set $5 + block $break|0 i32.const 0 - call $~lib/env/abort + local.set $5 + loop $repeat|0 + local.get $5 + i32.const 9 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $2 + local.get $5 + local.get $0 + local.get $5 + call $~lib/array/Array#__get + f32.convert_i32_s + call $~lib/typedarray/Float32Array#__set + local.get $4 + local.get $5 + local.get $0 + local.get $5 + call $~lib/array/Array#__get + f32.convert_i32_s + call $~lib/typedarray/Float32Array#__set + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|0 + unreachable + end unreachable end - global.get $std/typedarray/af64 - i32.load offset=8 - i32.const 4 - i32.const 8 - i32.mul - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 123 + local.get $2 + call $~lib/typedarray/Float32Array#reverse + call $~lib/rt/pure/__release + block $break|1 i32.const 0 - call $~lib/env/abort + local.set $5 + loop $repeat|1 + local.get $5 + i32.const 9 + i32.lt_s + i32.eqz + br_if $break|1 + local.get $2 + local.get $5 + call $~lib/typedarray/Float32Array#__get + local.get $0 + i32.const 8 + local.get $5 + i32.sub + call $~lib/array/Array#__get + f32.convert_i32_s + f32.eq + i32.eqz + if + i32.const 1512 + i32.const 24 + i32.const 471 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|1 + unreachable + end unreachable end - block (result i32) - i32.const 0 - global.set $~lib/argc - global.get $std/typedarray/af64 - i32.const 0 - call $~lib/typedarray/Float64Array#sort|trampoline - end - drop - global.get $std/typedarray/af64 - i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - f64.const 4 - f64.eq - local.tee $0 - if (result i32) - global.get $std/typedarray/af64 - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - f64.const 5 - f64.eq - else - local.get $0 - end - local.tee $0 - if (result i32) - global.get $std/typedarray/af64 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - f64.const 6 - f64.eq - else - local.get $0 - end - local.tee $0 - if (result i32) - global.get $std/typedarray/af64 - i32.const 3 - call $~lib/internal/typedarray/TypedArray#__get - f64.const 7 - f64.eq - else - local.get $0 - end + local.get $4 + i32.const 4 + i32.const 8 + call $~lib/typedarray/Float32Array#subarray + local.tee $6 + call $~lib/typedarray/Float32Array#reverse + local.set $7 + local.get $7 + i32.const 0 + call $~lib/typedarray/Float32Array#__get + f32.const 8 + f32.eq i32.eqz if - i32.const 0 - i32.const 8 - i32.const 125 - i32.const 0 - call $~lib/env/abort + i32.const 1600 + i32.const 24 + i32.const 476 + i32.const 2 + call $~lib/builtins/abort unreachable end - i32.const 0 - i32.const 3 - call $~lib/typedarray/Uint8ClampedArray#constructor - global.set $std/typedarray/clampedArr - global.get $std/typedarray/clampedArr - i32.const 0 - i32.const -32 - call $~lib/typedarray/Uint8ClampedArray#__set - global.get $std/typedarray/clampedArr + local.get $7 i32.const 1 - i32.const 2 - call $~lib/typedarray/Uint8ClampedArray#__set - global.get $std/typedarray/clampedArr - i32.const 2 - i32.const 256 - call $~lib/typedarray/Uint8ClampedArray#__set - global.get $std/typedarray/clampedArr - i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and - i32.const 0 - i32.eq + call $~lib/typedarray/Float32Array#__get + f32.const 7 + f32.eq i32.eqz if - i32.const 0 - i32.const 8 - i32.const 132 - i32.const 0 - call $~lib/env/abort + i32.const 1600 + i32.const 24 + i32.const 477 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/clampedArr - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and + local.get $7 i32.const 2 - i32.eq + call $~lib/typedarray/Float32Array#__get + f32.const 6 + f32.eq i32.eqz if - i32.const 0 - i32.const 8 - i32.const 133 - i32.const 0 - call $~lib/env/abort + i32.const 1600 + i32.const 24 + i32.const 478 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/clampedArr - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and - i32.const 255 - i32.eq + local.get $7 + i32.const 3 + call $~lib/typedarray/Float32Array#__get + f32.const 5 + f32.eq i32.eqz if - i32.const 0 - i32.const 8 - i32.const 134 - i32.const 0 - call $~lib/env/abort + i32.const 1600 + i32.const 24 + i32.const 479 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release + ) + (func $~lib/typedarray/Float64Array#reverse (; 390 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 f64) + local.get $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $1 + i32.load offset=4 + local.set $2 + block $break|0 + block + i32.const 0 + local.set $3 + local.get $1 + call $~lib/typedarray/Float64Array#get:length + i32.const 1 + i32.sub + local.set $4 + end + loop $repeat|0 + local.get $3 + local.get $4 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $2 + local.get $3 + i32.const 3 + i32.shl + i32.add + local.set $5 + local.get $2 + local.get $4 + i32.const 3 + i32.shl + i32.add + local.set $6 + local.get $5 + f64.load + local.set $7 + local.get $5 + local.get $6 + f64.load + f64.store + local.get $6 + local.get $7 + f64.store + block + local.get $3 + i32.const 1 + i32.add + local.set $3 + local.get $4 + i32.const 1 + i32.sub + local.set $4 + end + br $repeat|0 + unreachable + end unreachable end + local.get $1 + ) + (func $std/typedarray/testArrayReverse<~lib/typedarray/Float64Array,f64> (; 391 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + global.get $std/typedarray/testArrayReverseValues + call $~lib/rt/pure/__retain + local.set $0 i32.const 0 - i32.const 5 - call $~lib/typedarray/Int8Array#constructor - global.set $std/typedarray/arr8 - global.get $std/typedarray/arr8 + i32.const 9 + call $~lib/typedarray/Float64Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.set $2 i32.const 0 - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/arr8 - i32.const 1 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/arr8 - i32.const 2 - i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/arr8 - i32.const 3 - i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/arr8 + i32.const 9 + call $~lib/typedarray/Float64Array#constructor + local.tee $3 + call $~lib/rt/pure/__retain + local.set $4 + i32.const 0 + local.set $5 + block $break|0 + i32.const 0 + local.set $5 + loop $repeat|0 + local.get $5 + i32.const 9 + i32.lt_s + i32.eqz + br_if $break|0 + local.get $2 + local.get $5 + local.get $0 + local.get $5 + call $~lib/array/Array#__get + f64.convert_i32_s + call $~lib/typedarray/Float64Array#__set + local.get $4 + local.get $5 + local.get $0 + local.get $5 + call $~lib/array/Array#__get + f64.convert_i32_s + call $~lib/typedarray/Float64Array#__set + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|0 + unreachable + end + unreachable + end + local.get $2 + call $~lib/typedarray/Float64Array#reverse + call $~lib/rt/pure/__release + block $break|1 + i32.const 0 + local.set $5 + loop $repeat|1 + local.get $5 + i32.const 9 + i32.lt_s + i32.eqz + br_if $break|1 + local.get $2 + local.get $5 + call $~lib/typedarray/Float64Array#__get + local.get $0 + i32.const 8 + local.get $5 + i32.sub + call $~lib/array/Array#__get + f64.convert_i32_s + f64.eq + i32.eqz + if + i32.const 1512 + i32.const 24 + i32.const 471 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|1 + unreachable + end + unreachable + end + local.get $4 i32.const 4 - i32.const 5 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/arr8 - i32.const 1 + i32.const 8 + call $~lib/typedarray/Float64Array#subarray + local.tee $6 + call $~lib/typedarray/Float64Array#reverse + local.set $7 + local.get $7 + i32.const 0 + call $~lib/typedarray/Float64Array#__get + f64.const 8 + f64.eq + i32.eqz + if + i32.const 1600 + i32.const 24 + i32.const 476 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $7 i32.const 1 - i32.const 3 - call $~lib/typedarray/Int8Array#fill - drop - global.get $std/typedarray/arr8 - i32.const 192 - call $std/typedarray/isInt8ArrayEqual + call $~lib/typedarray/Float64Array#__get + f64.const 7 + f64.eq i32.eqz if - i32.const 0 - i32.const 8 - i32.const 144 - i32.const 0 - call $~lib/env/abort + i32.const 1600 + i32.const 24 + i32.const 477 + i32.const 2 + call $~lib/builtins/abort unreachable end - block (result i32) - i32.const 1 - global.set $~lib/argc - global.get $std/typedarray/arr8 - i32.const 0 - i32.const 0 - i32.const 0 - call $~lib/typedarray/Int8Array#fill|trampoline + local.get $7 + i32.const 2 + call $~lib/typedarray/Float64Array#__get + f64.const 6 + f64.eq + i32.eqz + if + i32.const 1600 + i32.const 24 + i32.const 478 + i32.const 2 + call $~lib/builtins/abort + unreachable end - drop - global.get $std/typedarray/arr8 - i32.const 216 - call $std/typedarray/isInt8ArrayEqual + local.get $7 + i32.const 3 + call $~lib/typedarray/Float64Array#__get + f64.const 5 + f64.eq i32.eqz if - i32.const 0 - i32.const 8 - i32.const 147 - i32.const 0 - call $~lib/env/abort + i32.const 1600 + i32.const 24 + i32.const 479 + i32.const 2 + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/arr8 + local.get $1 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release + ) + (func $start:std/typedarray (; 392 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/typedarray/Int8Array.BYTES_PER_ELEMENT i32.const 1 - i32.const 0 - i32.const -3 - call $~lib/typedarray/Int8Array#fill - drop - global.get $std/typedarray/arr8 - i32.const 240 - call $std/typedarray/isInt8ArrayEqual + i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 150 + i32.const 24 + i32.const 1 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block (result i32) - i32.const 2 - global.set $~lib/argc - global.get $std/typedarray/arr8 - i32.const 2 - i32.const -2 - i32.const 0 - call $~lib/typedarray/Int8Array#fill|trampoline - end - drop - global.get $std/typedarray/arr8 - i32.const 264 - call $std/typedarray/isInt8ArrayEqual + global.get $~lib/typedarray/Uint8Array.BYTES_PER_ELEMENT + i32.const 1 + i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 153 + i32.const 24 + i32.const 2 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/arr8 - i32.const 0 + global.get $~lib/typedarray/Uint8ClampedArray.BYTES_PER_ELEMENT i32.const 1 - i32.const 0 - call $~lib/typedarray/Int8Array#fill - drop - global.get $std/typedarray/arr8 - i32.const 288 - call $std/typedarray/isInt8ArrayEqual + i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 156 + i32.const 24 + i32.const 3 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/arr8 - i32.const 1 - i32.const 4 - call $~lib/typedarray/Int8Array#subarray - global.set $std/typedarray/sub8 - block (result i32) - i32.const 1 - global.set $~lib/argc - global.get $std/typedarray/sub8 - i32.const 0 - i32.const 0 + global.get $~lib/typedarray/Int16Array.BYTES_PER_ELEMENT + i32.const 2 + i32.eq + i32.eqz + if i32.const 0 - call $~lib/typedarray/Int8Array#fill|trampoline - end - drop - block $~lib/internal/typedarray/TypedArray#get:length|inlined.6 (result i32) - global.get $std/typedarray/sub8 - local.set $0 - local.get $0 - i32.load offset=8 + i32.const 24 + i32.const 4 i32.const 0 - i32.shr_u + call $~lib/builtins/abort + unreachable end - i32.const 3 + global.get $~lib/typedarray/Uint16Array.BYTES_PER_ELEMENT + i32.const 2 i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 160 + i32.const 24 + i32.const 5 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/sub8 - i32.load offset=4 - i32.const 1 + global.get $~lib/typedarray/Int32Array.BYTES_PER_ELEMENT + i32.const 4 i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 161 + i32.const 24 + i32.const 6 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/sub8 - i32.load offset=8 - i32.const 3 + global.get $~lib/typedarray/Uint32Array.BYTES_PER_ELEMENT + i32.const 4 i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 162 + i32.const 24 + i32.const 7 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/sub8 - i32.const 312 - call $std/typedarray/isInt8ArrayEqual + global.get $~lib/typedarray/Int64Array.BYTES_PER_ELEMENT + i32.const 8 + i32.eq i32.eqz if i32.const 0 + i32.const 24 i32.const 8 - i32.const 163 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/arr8 - i32.const 336 - call $std/typedarray/isInt8ArrayEqual + global.get $~lib/typedarray/Uint64Array.BYTES_PER_ELEMENT + i32.const 8 + i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 164 + i32.const 24 + i32.const 9 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - i32.const 0 - i32.const 5 - call $~lib/typedarray/Int32Array#constructor - global.set $std/typedarray/arr32 - global.get $std/typedarray/arr32 - i32.const 0 - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/arr32 - i32.const 1 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/arr32 - i32.const 2 - i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/arr32 - i32.const 3 - i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/arr32 + global.get $~lib/typedarray/Float32Array.BYTES_PER_ELEMENT i32.const 4 - i32.const 5 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/arr32 - i32.const 1 - i32.const 1 - i32.const 3 - call $~lib/typedarray/Int32Array#fill - drop - global.get $std/typedarray/arr32 - i32.const 376 - call $std/typedarray/isInt32ArrayEqual + i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 174 + i32.const 24 + i32.const 10 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - block (result i32) - i32.const 1 - global.set $~lib/argc - global.get $std/typedarray/arr32 - i32.const 0 - i32.const 0 - i32.const 0 - call $~lib/typedarray/Int32Array#fill|trampoline - end - drop - global.get $std/typedarray/arr32 - i32.const 416 - call $std/typedarray/isInt32ArrayEqual + global.get $~lib/typedarray/Float64Array.BYTES_PER_ELEMENT + i32.const 8 + i32.eq i32.eqz if i32.const 0 - i32.const 8 - i32.const 177 + i32.const 24 + i32.const 11 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end - global.get $std/typedarray/arr32 - i32.const 1 i32.const 0 - i32.const -3 - call $~lib/typedarray/Int32Array#fill - drop - global.get $std/typedarray/arr32 - i32.const 456 - call $std/typedarray/isInt32ArrayEqual - i32.eqz - if + call $std/typedarray/testInstantiate + i32.const 5 + call $std/typedarray/testInstantiate + block i32.const 0 - i32.const 8 - i32.const 180 + i32.const 3 + call $~lib/typedarray/Int32Array#constructor + local.set $0 + local.get $0 i32.const 0 - call $~lib/env/abort - unreachable - end - block (result i32) + i32.const 1 + call $~lib/typedarray/Int32Array#__set + local.get $0 + i32.const 1 i32.const 2 - global.set $~lib/argc - global.get $std/typedarray/arr32 + call $~lib/typedarray/Int32Array#__set + local.get $0 i32.const 2 - i32.const -2 + i32.const 3 + call $~lib/typedarray/Int32Array#__set + local.get $0 + call $~lib/typedarray/Int32Array#get:length + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 95 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 0 - call $~lib/typedarray/Int32Array#fill|trampoline - end - drop - global.get $std/typedarray/arr32 - i32.const 496 - call $std/typedarray/isInt32ArrayEqual - i32.eqz - if + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 96 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/arraybuffer/ArrayBufferView#get:byteLength + i32.const 3 + i32.const 4 + i32.mul + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 97 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 i32.const 0 - i32.const 8 - i32.const 183 + call $~lib/typedarray/Int32Array#__get + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 98 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 1 + call $~lib/typedarray/Int32Array#__get + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 99 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 2 + call $~lib/typedarray/Int32Array#__get + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 100 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + block (result i32) + local.get $0 + i32.const 1 + i32.const 2 + call $~lib/typedarray/Int32Array#subarray + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + end + local.set $0 + local.get $0 + call $~lib/typedarray/Int32Array#get:length + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 103 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset + i32.const 1 + i32.const 4 + i32.mul + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/arraybuffer/ArrayBufferView#get:byteLength + i32.const 1 + i32.const 4 + i32.mul + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 105 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 i32.const 0 - call $~lib/env/abort - unreachable + call $~lib/typedarray/Int32Array#__get + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 106 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/pure/__release end - global.get $std/typedarray/arr32 - i32.const 0 - i32.const 1 - i32.const 0 - call $~lib/typedarray/Int32Array#fill - drop - global.get $std/typedarray/arr32 - i32.const 536 - call $std/typedarray/isInt32ArrayEqual - i32.eqz - if + block i32.const 0 i32.const 8 - i32.const 186 + call $~lib/typedarray/Float64Array#constructor + local.set $0 + local.get $0 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/typedarray/arr32 - i32.const 1 - i32.const 4 - call $~lib/typedarray/Int32Array#subarray - global.set $std/typedarray/sub32 - block (result i32) + f64.const 1 + call $~lib/typedarray/Float64Array#__set + local.get $0 i32.const 1 - global.set $~lib/argc - global.get $std/typedarray/sub32 - i32.const 0 - i32.const 0 - i32.const 0 - call $~lib/typedarray/Int32Array#fill|trampoline - end - drop - block $~lib/internal/typedarray/TypedArray#get:length|inlined.8 (result i32) - global.get $std/typedarray/sub32 + f64.const 2 + call $~lib/typedarray/Float64Array#__set + local.get $0 + i32.const 2 + f64.const 7 + call $~lib/typedarray/Float64Array#__set + local.get $0 + i32.const 3 + f64.const 6 + call $~lib/typedarray/Float64Array#__set + local.get $0 + i32.const 4 + f64.const 5 + call $~lib/typedarray/Float64Array#__set + local.get $0 + i32.const 5 + f64.const 4 + call $~lib/typedarray/Float64Array#__set + local.get $0 + i32.const 6 + f64.const 3 + call $~lib/typedarray/Float64Array#__set + local.get $0 + i32.const 7 + f64.const 8 + call $~lib/typedarray/Float64Array#__set + block (result i32) + local.get $0 + i32.const 2 + i32.const 6 + call $~lib/typedarray/Float64Array#subarray + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + end local.set $0 local.get $0 - i32.load offset=8 + call $~lib/typedarray/Float64Array#get:length + i32.const 4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 122 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 2 - i32.shr_u - end - i32.const 3 - i32.eq - i32.eqz - if - i32.const 0 i32.const 8 - i32.const 190 + i32.mul + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 123 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/arraybuffer/ArrayBufferView#get:byteLength + i32.const 4 + i32.const 8 + i32.mul + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 124 + i32.const 2 + call $~lib/builtins/abort + unreachable + end i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/typedarray/sub32 - i32.load offset=4 - i32.const 1 - i32.const 4 - i32.mul - i32.eq - i32.eqz - if + global.set $~lib/argc + local.get $0 i32.const 0 - i32.const 8 - i32.const 191 + call $~lib/typedarray/Float64Array#sort|trampoline + call $~lib/rt/pure/__release + local.get $0 i32.const 0 - call $~lib/env/abort - unreachable + call $~lib/typedarray/Float64Array#__get + f64.const 4 + f64.eq + if (result i32) + local.get $0 + i32.const 1 + call $~lib/typedarray/Float64Array#__get + f64.const 5 + f64.eq + else + i32.const 0 + end + if (result i32) + local.get $0 + i32.const 2 + call $~lib/typedarray/Float64Array#__get + f64.const 6 + f64.eq + else + i32.const 0 + end + if (result i32) + local.get $0 + i32.const 3 + call $~lib/typedarray/Float64Array#__get + f64.const 7 + f64.eq + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 126 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/pure/__release end - global.get $std/typedarray/sub32 - i32.load offset=8 - i32.const 3 - i32.const 4 - i32.mul - i32.eq - i32.eqz - if + block i32.const 0 - i32.const 8 - i32.const 192 + i32.const 3 + call $~lib/typedarray/Uint8ClampedArray#constructor + local.set $0 + local.get $0 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/typedarray/sub32 - i32.const 576 - call $std/typedarray/isInt32ArrayEqual - i32.eqz - if + i32.const -32 + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $0 + i32.const 1 + i32.const 2 + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $0 + i32.const 2 + i32.const 256 + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $0 i32.const 0 - i32.const 8 - i32.const 193 + call $~lib/typedarray/Uint8ClampedArray#__get i32.const 0 - call $~lib/env/abort - unreachable + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 135 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 1 + call $~lib/typedarray/Uint8ClampedArray#__get + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 136 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 2 + call $~lib/typedarray/Uint8ClampedArray#__get + i32.const 255 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 137 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/pure/__release end - global.get $std/typedarray/arr32 - i32.const 616 - call $std/typedarray/isInt32ArrayEqual - i32.eqz - if + block i32.const 0 - i32.const 8 - i32.const 194 + i32.const 5 + call $~lib/typedarray/Int8Array#constructor + local.set $0 + local.get $0 i32.const 0 - call $~lib/env/abort - unreachable - end - i32.const 0 - global.get $std/typedarray/MAX_F64LENGTH - call $~lib/typedarray/Float64Array#constructor - drop - i32.const 0 - i32.const 6 - call $~lib/typedarray/Int8Array#constructor - global.set $std/typedarray/multisubarr - global.get $std/typedarray/multisubarr - i32.const 0 - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/multisubarr - i32.const 1 - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/multisubarr - i32.const 2 - i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/multisubarr - i32.const 3 - i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/multisubarr - i32.const 4 - i32.const 5 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/multisubarr - i32.const 5 - i32.const 6 - call $~lib/internal/typedarray/TypedArray#__set - global.get $std/typedarray/multisubarr - i32.const 1 - i32.const 6 - call $~lib/typedarray/Int8Array#subarray - global.set $std/typedarray/multisubarr1 - global.get $std/typedarray/multisubarr1 - i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.const 2 - i32.eq - i32.eqz - if + i32.const 1 + call $~lib/typedarray/Int8Array#__set + local.get $0 + i32.const 1 + i32.const 2 + call $~lib/typedarray/Int8Array#__set + local.get $0 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Int8Array#__set + local.get $0 + i32.const 3 + i32.const 4 + call $~lib/typedarray/Int8Array#__set + local.get $0 + i32.const 4 + i32.const 5 + call $~lib/typedarray/Int8Array#__set + local.get $0 + i32.const 1 + i32.const 1 + i32.const 3 + call $~lib/typedarray/Int8Array#fill + call $~lib/rt/pure/__release + local.get $0 + i32.const 5 + i32.const 0 + i32.const 14 + i32.const 488 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $2 + call $std/typedarray/isInt8ArrayEqual + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 149 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 i32.const 0 - i32.const 8 - i32.const 211 i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/internal/typedarray/TypedArray#get:length|inlined.7 (result i32) - global.get $std/typedarray/multisubarr1 - local.set $0 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/typedarray/Int8Array#fill + call $~lib/rt/pure/__release local.get $0 - i32.load offset=8 + i32.const 5 i32.const 0 - i32.shr_u - end - i32.const 5 - i32.eq - i32.eqz - if + i32.const 14 + i32.const 560 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $3 + call $std/typedarray/isInt8ArrayEqual + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 152 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 1 i32.const 0 - i32.const 8 - i32.const 212 + i32.const -3 + call $~lib/typedarray/Int8Array#fill + call $~lib/rt/pure/__release + local.get $0 + i32.const 5 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/typedarray/multisubarr1 - i32.load offset=4 - i32.const 1 - i32.eq - i32.eqz - if + i32.const 14 + i32.const 584 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $4 + call $std/typedarray/isInt8ArrayEqual + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 155 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 2 + i32.const -2 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/typedarray/Int8Array#fill + call $~lib/rt/pure/__release + local.get $0 + i32.const 5 i32.const 0 - i32.const 8 - i32.const 213 + i32.const 14 + i32.const 608 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $5 + call $std/typedarray/isInt8ArrayEqual + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 158 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/typedarray/multisubarr1 - i32.load offset=8 - i32.const 5 - i32.eq - i32.eqz - if + i32.const 1 i32.const 0 - i32.const 8 - i32.const 214 + call $~lib/typedarray/Int8Array#fill + call $~lib/rt/pure/__release + local.get $0 + i32.const 5 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/typedarray/multisubarr1 - i32.const 1 - i32.const 5 - call $~lib/typedarray/Int8Array#subarray - global.set $std/typedarray/multisubarr2 - global.get $std/typedarray/multisubarr2 - i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.const 3 - i32.eq - i32.eqz - if + i32.const 14 + i32.const 632 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $6 + call $std/typedarray/isInt8ArrayEqual + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 161 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 1 + i32.const 4 + call $~lib/typedarray/Int8Array#subarray + local.set $1 + local.get $1 i32.const 0 - i32.const 8 - i32.const 217 i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/internal/typedarray/TypedArray#get:length|inlined.8 (result i32) - global.get $std/typedarray/multisubarr2 - local.set $0 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/typedarray/Int8Array#fill + call $~lib/rt/pure/__release + local.get $1 + call $~lib/typedarray/Int8Array#get:length + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 165 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 166 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + call $~lib/arraybuffer/ArrayBufferView#get:byteLength + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 167 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 3 + i32.const 0 + i32.const 14 + i32.const 656 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $8 + call $std/typedarray/isInt8ArrayEqual + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 168 + i32.const 2 + call $~lib/builtins/abort + unreachable + end local.get $0 - i32.load offset=8 + i32.const 5 i32.const 0 - i32.shr_u + i32.const 14 + i32.const 680 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $9 + call $std/typedarray/isInt8ArrayEqual + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 169 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $8 + call $~lib/rt/pure/__release + local.get $9 + call $~lib/rt/pure/__release end - i32.const 4 - i32.eq - i32.eqz - if + block i32.const 0 - i32.const 8 - i32.const 218 + i32.const 5 + call $~lib/typedarray/Int32Array#constructor + local.set $9 + local.get $9 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/typedarray/multisubarr2 - i32.load offset=4 - i32.const 2 - i32.eq - i32.eqz - if + i32.const 1 + call $~lib/typedarray/Int32Array#__set + local.get $9 + i32.const 1 + i32.const 2 + call $~lib/typedarray/Int32Array#__set + local.get $9 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Int32Array#__set + local.get $9 + i32.const 3 + i32.const 4 + call $~lib/typedarray/Int32Array#__set + local.get $9 + i32.const 4 + i32.const 5 + call $~lib/typedarray/Int32Array#__set + local.get $9 + i32.const 1 + i32.const 1 + i32.const 3 + call $~lib/typedarray/Int32Array#fill + call $~lib/rt/pure/__release + local.get $9 + i32.const 5 + i32.const 2 + i32.const 15 + i32.const 704 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $1 + call $std/typedarray/isInt32ArrayEqual + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 181 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $9 i32.const 0 - i32.const 8 - i32.const 219 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/typedarray/multisubarr2 - i32.load offset=8 - i32.const 4 - i32.eq - i32.eqz - if + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/typedarray/Int32Array#fill + call $~lib/rt/pure/__release + local.get $9 + i32.const 5 + i32.const 2 + i32.const 15 + i32.const 744 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $6 + call $std/typedarray/isInt32ArrayEqual + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 184 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $9 + i32.const 1 + i32.const 0 + i32.const -3 + call $~lib/typedarray/Int32Array#fill + call $~lib/rt/pure/__release + local.get $9 + i32.const 5 + i32.const 2 + i32.const 15 + i32.const 784 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $5 + call $std/typedarray/isInt32ArrayEqual + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 187 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $9 + i32.const 2 + i32.const -2 + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/typedarray/Int32Array#fill + call $~lib/rt/pure/__release + local.get $9 + i32.const 5 + i32.const 2 + i32.const 15 + i32.const 824 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $4 + call $std/typedarray/isInt32ArrayEqual + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 190 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $9 + i32.const 0 + i32.const 1 + i32.const 0 + call $~lib/typedarray/Int32Array#fill + call $~lib/rt/pure/__release + local.get $9 + i32.const 5 + i32.const 2 + i32.const 15 + i32.const 864 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $3 + call $std/typedarray/isInt32ArrayEqual + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 193 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $9 + i32.const 1 + i32.const 4 + call $~lib/typedarray/Int32Array#subarray + local.set $8 + local.get $8 i32.const 0 - i32.const 8 - i32.const 220 i32.const 0 - call $~lib/env/abort - unreachable + global.get $~lib/builtins/i32.MAX_VALUE + call $~lib/typedarray/Int32Array#fill + call $~lib/rt/pure/__release + local.get $8 + call $~lib/typedarray/Int32Array#get:length + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 197 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $8 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset + i32.const 1 + i32.const 4 + i32.mul + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 198 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $8 + call $~lib/arraybuffer/ArrayBufferView#get:byteLength + i32.const 3 + i32.const 4 + i32.mul + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 199 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $8 + i32.const 3 + i32.const 2 + i32.const 15 + i32.const 904 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $0 + call $std/typedarray/isInt32ArrayEqual + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 200 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $9 + i32.const 5 + i32.const 2 + i32.const 15 + i32.const 936 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $7 + call $std/typedarray/isInt32ArrayEqual + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 201 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $9 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $8 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release end - global.get $std/typedarray/multisubarr2 - i32.const 1 - i32.const 4 - call $~lib/typedarray/Int8Array#subarray - global.set $std/typedarray/multisubarr3 - global.get $std/typedarray/multisubarr3 - i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.const 4 - i32.eq - i32.eqz - if + block i32.const 0 - i32.const 8 - i32.const 223 + i32.const 6 + call $~lib/typedarray/Int8Array#constructor + local.set $7 + local.get $7 i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/internal/typedarray/TypedArray#get:length|inlined.9 (result i32) - global.get $std/typedarray/multisubarr3 + i32.const 1 + call $~lib/typedarray/Int8Array#__set + local.get $7 + i32.const 1 + i32.const 2 + call $~lib/typedarray/Int8Array#__set + local.get $7 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Int8Array#__set + local.get $7 + i32.const 3 + i32.const 4 + call $~lib/typedarray/Int8Array#__set + local.get $7 + i32.const 4 + i32.const 5 + call $~lib/typedarray/Int8Array#__set + local.get $7 + i32.const 5 + i32.const 6 + call $~lib/typedarray/Int8Array#__set + local.get $7 + i32.const 1 + i32.const 6 + call $~lib/typedarray/Int8Array#subarray local.set $0 local.get $0 - i32.load offset=8 - i32.const 0 - i32.shr_u - end - i32.const 3 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 224 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/typedarray/multisubarr3 - i32.load offset=4 - i32.const 3 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 225 i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/typedarray/multisubarr3 - i32.load offset=8 - i32.const 3 - i32.eq - i32.eqz - if + call $~lib/typedarray/Int8Array#__get + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 222 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/typedarray/Int8Array#get:length + i32.const 5 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 223 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 224 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/arraybuffer/ArrayBufferView#get:byteLength + i32.const 5 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 225 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 1 + i32.const 5 + call $~lib/typedarray/Int8Array#subarray + local.set $8 + local.get $8 i32.const 0 - i32.const 8 - i32.const 226 + call $~lib/typedarray/Int8Array#__get + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 228 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $8 + call $~lib/typedarray/Int8Array#get:length + i32.const 4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 229 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $8 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 230 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $8 + call $~lib/arraybuffer/ArrayBufferView#get:byteLength + i32.const 4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 231 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $8 + i32.const 1 + i32.const 4 + call $~lib/typedarray/Int8Array#subarray + local.set $3 + local.get $3 i32.const 0 - call $~lib/env/abort - unreachable + call $~lib/typedarray/Int8Array#__get + i32.const 4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 234 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $3 + call $~lib/typedarray/Int8Array#get:length + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 235 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $3 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 236 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $3 + call $~lib/arraybuffer/ArrayBufferView#get:byteLength + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 237 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $7 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $8 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release end call $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8> call $std/typedarray/testReduce<~lib/typedarray/Uint8Array,u8> @@ -21752,10 +23146,396 @@ call $std/typedarray/testArrayReverse<~lib/typedarray/Uint64Array,u64> call $std/typedarray/testArrayReverse<~lib/typedarray/Float32Array,f32> call $std/typedarray/testArrayReverse<~lib/typedarray/Float64Array,f64> + global.get $std/typedarray/forEachValues + call $~lib/rt/pure/__release + global.get $std/typedarray/testArrayReverseValues + call $~lib/rt/pure/__release ) - (func $start (; 365 ;) (type $FUNCSIG$v) + (func $start (; 393 ;) (type $FUNCSIG$v) + global.get $~lib/started + if + return + else + i32.const 1 + global.set $~lib/started + end call $start:std/typedarray ) - (func $null (; 366 ;) (type $FUNCSIG$v) + (func $~lib/array/Array#__visit_impl (; 394 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/array/Array#__visit_impl (; 395 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + nop + ) + (func $~lib/rt/pure/markGray (; 396 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members + end + ) + (func $~lib/rt/pure/scanBlack (; 397 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 398 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (; 399 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + ) + (func $~lib/rt/pure/__visit (; 400 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/pure/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 288 + i32.const 75 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/pure/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 288 + i32.const 86 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/pure/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 288 + i32.const 97 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + end + ) + (func $~lib/rt/__visit_members (; 401 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block $block$4$break + block + end + block $switch$1$leave + block $switch$1$default + block $switch$1$case$17 + block $switch$1$case$16 + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$case$4 $switch$1$case$4 $switch$1$case$4 $switch$1$case$4 $switch$1$case$4 $switch$1$case$4 $switch$1$case$4 $switch$1$case$4 $switch$1$case$4 $switch$1$case$4 $switch$1$case$4 $switch$1$case$16 $switch$1$case$17 $switch$1$default + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + br $block$4$break + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$4$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + local.get $0 + local.get $1 + call $~lib/array/Array#__visit_impl + block + br $block$4$break + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + end + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + ) + (func $null (; 402 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/switch.json b/tests/compiler/switch.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/switch.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/switch.optimized.wat b/tests/compiler/switch.optimized.wat index 2eb034e32c..36e820fc0e 100644 --- a/tests/compiler/switch.optimized.wat +++ b/tests/compiler/switch.optimized.wat @@ -2,13 +2,10 @@ (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\t\00\00\00s\00w\00i\00t\00c\00h\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $null) + (data (i32.const 8) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\00s\00w\00i\00t\00c\00h\00.\00t\00s") (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $switch/doSwitch (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) block $case4|0 @@ -23,10 +20,10 @@ local.get $0 i32.const 2 i32.eq - br_if $case4|0 local.get $0 i32.const 3 i32.eq + i32.or br_if $case4|0 br $case2|0 end @@ -48,10 +45,10 @@ local.get $0 i32.const 2 i32.eq - br_if $case2|0 local.get $0 i32.const 3 i32.eq + i32.or br_if $case2|0 br $break|0 end @@ -63,15 +60,35 @@ end i32.const 0 ) - (func $start:switch (; 3 ;) (type $FUNCSIG$v) + (func $switch/doSwitchBreakCase (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 1 + i32.ne + if + i32.const 2 + return + end + i32.const 1 + ) + (func $switch/doSwitchBreakDefault (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 1 + i32.eq + if + i32.const 1 + return + end + i32.const 2 + ) + (func $start:switch (; 5 ;) (type $FUNCSIG$v) i32.const 0 call $switch/doSwitch if i32.const 0 - i32.const 8 + i32.const 24 i32.const 10 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -80,10 +97,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 11 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2 @@ -92,10 +109,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 12 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 3 @@ -104,30 +121,30 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 13 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 4 call $switch/doSwitch if i32.const 0 - i32.const 8 + i32.const 24 i32.const 14 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 call $switch/doSwitch if i32.const 0 - i32.const 8 + i32.const 24 i32.const 24 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -136,10 +153,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 25 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2 @@ -148,10 +165,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 26 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 3 @@ -160,30 +177,30 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 27 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 4 call $switch/doSwitch if i32.const 0 - i32.const 8 + i32.const 24 i32.const 28 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 call $switch/doSwitchDefaultOmitted if i32.const 0 - i32.const 8 + i32.const 24 i32.const 38 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -192,10 +209,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 39 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2 @@ -204,10 +221,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 40 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 3 @@ -216,27 +233,171 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 41 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 4 call $switch/doSwitchDefaultOmitted if i32.const 0 - i32.const 8 + i32.const 24 i32.const 42 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort + unreachable + end + i32.const 0 + call $switch/doSwitchBreakCase + i32.const 2 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 51 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1 + call $switch/doSwitchBreakCase + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 52 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 2 + call $switch/doSwitchBreakCase + i32.const 2 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 53 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + call $switch/doSwitchBreakDefault + i32.const 2 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 62 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1 + call $switch/doSwitchBreakDefault + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 63 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 2 + call $switch/doSwitchBreakDefault + i32.const 2 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 64 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + call $switch/doSwitchBreakCase + i32.const 2 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 73 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1 + call $switch/doSwitchBreakCase + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 74 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 2 + call $switch/doSwitchBreakCase + i32.const 2 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 75 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + call $switch/doSwitchBreakDefault + i32.const 2 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 84 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1 + call $switch/doSwitchBreakDefault + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 85 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 2 + call $switch/doSwitchBreakDefault + i32.const 2 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 86 + i32.const 0 + call $~lib/builtins/abort unreachable end ) - (func $start (; 4 ;) (type $FUNCSIG$v) + (func $start (; 6 ;) (type $FUNCSIG$v) call $start:switch ) - (func $null (; 5 ;) (type $FUNCSIG$v) + (func $null (; 7 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/switch.untouched.wat b/tests/compiler/switch.untouched.wat index ce046aa220..39043235ca 100644 --- a/tests/compiler/switch.untouched.wat +++ b/tests/compiler/switch.untouched.wat @@ -2,14 +2,12 @@ (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\t\00\00\00s\00w\00i\00t\00c\00h\00.\00t\00s\00") + (data (i32.const 8) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\00s\00w\00i\00t\00c\00h\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/memory/HEAP_BASE i32 (i32.const 32)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $switch/doSwitch (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) @@ -176,10 +174,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 10 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -189,10 +187,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 11 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2 @@ -202,10 +200,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 12 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 3 @@ -215,10 +213,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 13 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 4 @@ -228,10 +226,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 14 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -241,10 +239,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 24 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -254,10 +252,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 25 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2 @@ -267,10 +265,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 26 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 3 @@ -280,10 +278,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 27 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 4 @@ -293,10 +291,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 28 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -306,10 +304,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 38 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -319,10 +317,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 39 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2 @@ -332,10 +330,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 40 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 3 @@ -345,10 +343,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 41 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 4 @@ -358,10 +356,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 42 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -371,10 +369,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 51 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -384,10 +382,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 52 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2 @@ -397,10 +395,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 53 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -410,10 +408,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 62 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -423,10 +421,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 63 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2 @@ -436,10 +434,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 64 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -449,10 +447,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 73 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -462,10 +460,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 74 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2 @@ -475,10 +473,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 75 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -488,10 +486,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 84 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -501,10 +499,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 85 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2 @@ -514,10 +512,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 86 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -527,10 +525,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 92 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -540,10 +538,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 93 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2 @@ -553,10 +551,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 94 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/ternary.json b/tests/compiler/ternary.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/ternary.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/ternary.optimized.wat b/tests/compiler/ternary.optimized.wat index 55ac7fbfba..56846df9d8 100644 --- a/tests/compiler/ternary.optimized.wat +++ b/tests/compiler/ternary.optimized.wat @@ -1,11 +1,8 @@ (module (type $FUNCSIG$v (func)) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $null) (global $ternary/a (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $start (; 0 ;) (type $FUNCSIG$v) i32.const 1 diff --git a/tests/compiler/ternary.untouched.wat b/tests/compiler/ternary.untouched.wat index 61a47091d6..e281029495 100644 --- a/tests/compiler/ternary.untouched.wat +++ b/tests/compiler/ternary.untouched.wat @@ -4,9 +4,7 @@ (table $0 1 funcref) (elem (i32.const 0) $null) (global $ternary/a (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $start:ternary (; 0 ;) (type $FUNCSIG$v) i32.const 1 diff --git a/tests/compiler/threads.json b/tests/compiler/threads.json index 32c45dde2b..b3cf3d479c 100644 --- a/tests/compiler/threads.json +++ b/tests/compiler/threads.json @@ -3,6 +3,7 @@ "threads" ], "asc_flags": [ + "--runtime none", "--memoryBase 8", "--sharedMemory 1" ] diff --git a/tests/compiler/threads.optimized.wat b/tests/compiler/threads.optimized.wat index 85fe9b4a28..c002c873cb 100644 --- a/tests/compiler/threads.optimized.wat +++ b/tests/compiler/threads.optimized.wat @@ -1,10 +1,7 @@ (module (type $FUNCSIG$v (func)) (memory $0 (shared 1 1)) - (table $0 1 funcref) - (elem (i32.const 0) $null) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $threads/testAtomic (; 0 ;) (type $FUNCSIG$v) i32.const 0 diff --git a/tests/compiler/threads.untouched.wat b/tests/compiler/threads.untouched.wat index 74598aa5b8..3b6ad104e8 100644 --- a/tests/compiler/threads.untouched.wat +++ b/tests/compiler/threads.untouched.wat @@ -4,9 +4,7 @@ (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/ASC_FEATURE_THREADS i32 (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $threads/testAtomic (; 0 ;) (type $FUNCSIG$v) i32.const 0 diff --git a/tests/compiler/typealias.json b/tests/compiler/typealias.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/typealias.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/typealias.optimized.wat b/tests/compiler/typealias.optimized.wat index f4a8304ebb..4a7b9bd96f 100644 --- a/tests/compiler/typealias.optimized.wat +++ b/tests/compiler/typealias.optimized.wat @@ -2,10 +2,7 @@ (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$v (func)) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $null) (export "memory" (memory $0)) - (export "table" (table $0)) (export "alias" (func $typealias/alias)) (func $typealias/alias (; 0 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 diff --git a/tests/compiler/typealias.untouched.wat b/tests/compiler/typealias.untouched.wat index 72e197e1ee..8cd06aa993 100644 --- a/tests/compiler/typealias.untouched.wat +++ b/tests/compiler/typealias.untouched.wat @@ -4,9 +4,7 @@ (memory $0 0) (table $0 1 funcref) (elem (i32.const 0) $null) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "alias" (func $typealias/alias)) (func $typealias/alias (; 0 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 diff --git a/tests/compiler/unary.json b/tests/compiler/unary.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/unary.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/unary.optimized.wat b/tests/compiler/unary.optimized.wat index 1e04efb779..38c2bba4f9 100644 --- a/tests/compiler/unary.optimized.wat +++ b/tests/compiler/unary.optimized.wat @@ -1,20 +1,17 @@ (module (type $FUNCSIG$v (func)) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $null) (global $unary/i (mut i32) (i32.const 0)) (global $unary/I (mut i64) (i64.const 0)) (global $unary/f (mut f32) (f32.const 0)) (global $unary/F (mut f64) (f64.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $start:unary (; 0 ;) (type $FUNCSIG$v) - (local $0 f32) - (local $1 f64) - (local $2 i32) - (local $3 i64) + (local $0 i32) + (local $1 i64) + (local $2 f32) + (local $3 f64) global.get $unary/i i32.const 1 i32.add @@ -59,18 +56,18 @@ i32.sub global.set $unary/i global.get $unary/i - local.tee $2 + local.tee $0 i32.const 1 i32.add global.set $unary/i - local.get $2 + local.get $0 global.set $unary/i global.get $unary/i - local.tee $2 + local.tee $0 i32.const 1 i32.sub global.set $unary/i - local.get $2 + local.get $0 global.set $unary/i global.get $unary/I i64.const 1 @@ -117,18 +114,18 @@ i64.sub global.set $unary/I global.get $unary/I - local.tee $3 + local.tee $1 i64.const 1 i64.add global.set $unary/I - local.get $3 + local.get $1 global.set $unary/I global.get $unary/I - local.tee $3 + local.tee $1 i64.const 1 i64.sub global.set $unary/I - local.get $3 + local.get $1 global.set $unary/I global.get $unary/f f32.const 1 @@ -156,11 +153,10 @@ f32.neg global.set $unary/f global.get $unary/f - local.tee $0 f32.const 0 f32.eq global.set $unary/i - local.get $0 + global.get $unary/f f32.const 1 f32.add global.set $unary/f @@ -169,18 +165,18 @@ f32.sub global.set $unary/f global.get $unary/f - local.tee $0 + local.tee $2 f32.const 1 f32.add global.set $unary/f - local.get $0 + local.get $2 global.set $unary/f global.get $unary/f - local.tee $0 + local.tee $2 f32.const 1 f32.sub global.set $unary/f - local.get $0 + local.get $2 global.set $unary/f global.get $unary/F f64.const 1 @@ -208,12 +204,11 @@ f64.neg global.set $unary/F global.get $unary/F - local.tee $1 f64.const 0 f64.eq i64.extend_i32_u global.set $unary/I - local.get $1 + global.get $unary/F f64.const 1 f64.add global.set $unary/F @@ -222,18 +217,18 @@ f64.sub global.set $unary/F global.get $unary/F - local.tee $1 + local.tee $3 f64.const 1 f64.add global.set $unary/F - local.get $1 + local.get $3 global.set $unary/F global.get $unary/F - local.tee $1 + local.tee $3 f64.const 1 f64.sub global.set $unary/F - local.get $1 + local.get $3 global.set $unary/F ) (func $start (; 1 ;) (type $FUNCSIG$v) diff --git a/tests/compiler/unary.untouched.wat b/tests/compiler/unary.untouched.wat index 2a3437b0d1..44abc69a76 100644 --- a/tests/compiler/unary.untouched.wat +++ b/tests/compiler/unary.untouched.wat @@ -7,9 +7,7 @@ (global $unary/I (mut i64) (i64.const 0)) (global $unary/f (mut f32) (f32.const 0)) (global $unary/F (mut f64) (f64.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $start:unary (; 0 ;) (type $FUNCSIG$v) (local $0 i32) diff --git a/tests/compiler/void.json b/tests/compiler/void.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/void.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/void.optimized.wat b/tests/compiler/void.optimized.wat index 86b388ad0a..e2acb0a3b8 100644 --- a/tests/compiler/void.optimized.wat +++ b/tests/compiler/void.optimized.wat @@ -1,10 +1,7 @@ (module (type $FUNCSIG$v (func)) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $start) (export "memory" (memory $0)) - (export "table" (table $0)) (func $start (; 0 ;) (type $FUNCSIG$v) nop ) diff --git a/tests/compiler/void.untouched.wat b/tests/compiler/void.untouched.wat index 8ee4c756ac..a46ab488c7 100644 --- a/tests/compiler/void.untouched.wat +++ b/tests/compiler/void.untouched.wat @@ -6,9 +6,7 @@ (elem (i32.const 0) $null) (global $void/u8Val1 (mut i32) (i32.const 1)) (global $void/u8Val2 (mut i32) (i32.const 255)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $void/anInt (; 0 ;) (type $FUNCSIG$i) (result i32) i32.const 2 diff --git a/tests/compiler/wasi.json b/tests/compiler/wasi.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/wasi.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/wasi.optimized.wat b/tests/compiler/wasi.optimized.wat index e04375f36b..3f8cc8ddba 100644 --- a/tests/compiler/wasi.optimized.wat +++ b/tests/compiler/wasi.optimized.wat @@ -1,12 +1,9 @@ (module (type $FUNCSIG$v (func)) (memory $0 1) - (data (i32.const 8) "\07\00\00\00w\00a\00s\00i\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $null) + (data (i32.const 8) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\00w\00a\00s\00i\00.\00t\00s") (global $wasi/sig (mut i32) (i32.const 1)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $start (; 0 ;) (type $FUNCSIG$v) i32.const 9 diff --git a/tests/compiler/wasi.ts b/tests/compiler/wasi.ts index cd42168ffb..c86ef137c3 100644 --- a/tests/compiler/wasi.ts +++ b/tests/compiler/wasi.ts @@ -1,7 +1,5 @@ import { dirent, rwevent, fdstat, filestat, iovec, clocksubscription, fdsubscription, signal, dirprestat } from "bindings/wasi"; - -const WASM32 = 1; -const WASM64 = 2; +import { Target } from "shared/target"; assert(offsetof("next") == 0); assert(offsetof("ino") == 8); @@ -33,10 +31,10 @@ assert(offsetof("ctim") == 48); assert(offsetof() == 56); assert(offsetof("buf") == 0); -if (ASC_TARGET == WASM32) { +if (ASC_TARGET == Target.WASM32) { assert(offsetof("buf_len") == 4); assert(offsetof() == 8); -} else if (ASC_TARGET == WASM64) { +} else if (ASC_TARGET == Target.WASM64) { assert(offsetof("buf_len") == 8); assert(offsetof() == 16); } else { @@ -58,10 +56,10 @@ assert(offsetof("fd") == 16); assert(offsetof() == 20); assert(offsetof("type") == 0); -if (ASC_TARGET == WASM32) { +if (ASC_TARGET == Target.WASM32) { assert(offsetof("name_len") == 4); assert(offsetof() == 8); -} else if (ASC_TARGET == WASM64) { +} else if (ASC_TARGET == Target.WASM64) { assert(offsetof("name_len") == 8); assert(offsetof() == 16); } else { diff --git a/tests/compiler/wasi.untouched.wat b/tests/compiler/wasi.untouched.wat index b71b5b7799..1375bdce22 100644 --- a/tests/compiler/wasi.untouched.wat +++ b/tests/compiler/wasi.untouched.wat @@ -1,18 +1,17 @@ (module (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\07\00\00\00w\00a\00s\00i\00.\00t\00s\00") + (data (i32.const 8) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\00w\00a\00s\00i\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) - (global $wasi/WASM32 i32 (i32.const 1)) - (global $wasi/WASM64 i32 (i32.const 2)) + (global $~lib/shared/target/Target.WASM32 i32 (i32.const 0)) + (global $~lib/shared/target/Target.WASM64 i32 (i32.const 1)) + (global $~lib/shared/target/Target.JS i32 (i32.const 2)) (global $~lib/ASC_TARGET i32 (i32.const 0)) (global $wasi/sig (mut i32) (i32.const 1)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 28)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $start:wasi (; 1 ;) (type $FUNCSIG$v) i32.const 0 @@ -21,10 +20,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 6 + i32.const 24 + i32.const 4 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 8 @@ -33,10 +32,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 7 + i32.const 24 + i32.const 5 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 16 @@ -45,10 +44,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 8 + i32.const 24 + i32.const 6 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 20 @@ -57,10 +56,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 9 + i32.const 24 + i32.const 7 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 24 @@ -69,10 +68,10 @@ i32.eqz if i32.const 0 + i32.const 24 i32.const 8 - i32.const 10 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -81,10 +80,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 12 + i32.const 24 + i32.const 10 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 8 @@ -93,10 +92,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 13 + i32.const 24 + i32.const 11 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 10 @@ -105,10 +104,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 14 + i32.const 24 + i32.const 12 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 16 @@ -117,10 +116,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 15 + i32.const 24 + i32.const 13 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 24 @@ -129,10 +128,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 16 + i32.const 24 + i32.const 14 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 32 @@ -141,10 +140,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 17 + i32.const 24 + i32.const 15 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -153,10 +152,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 19 + i32.const 24 + i32.const 17 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 2 @@ -165,10 +164,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 20 + i32.const 24 + i32.const 18 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 8 @@ -177,10 +176,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 21 + i32.const 24 + i32.const 19 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 16 @@ -189,10 +188,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 22 + i32.const 24 + i32.const 20 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 24 @@ -201,10 +200,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 23 + i32.const 24 + i32.const 21 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -213,10 +212,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 25 + i32.const 24 + i32.const 23 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 8 @@ -225,10 +224,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 26 + i32.const 24 + i32.const 24 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 16 @@ -237,10 +236,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 27 + i32.const 24 + i32.const 25 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 20 @@ -249,10 +248,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 28 + i32.const 24 + i32.const 26 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 24 @@ -261,10 +260,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 29 + i32.const 24 + i32.const 27 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 32 @@ -273,10 +272,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 30 + i32.const 24 + i32.const 28 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 40 @@ -285,10 +284,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 31 + i32.const 24 + i32.const 29 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 48 @@ -297,10 +296,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 32 + i32.const 24 + i32.const 30 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 56 @@ -309,10 +308,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 33 + i32.const 24 + i32.const 31 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -321,10 +320,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 35 + i32.const 24 + i32.const 33 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block @@ -334,10 +333,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 37 + i32.const 24 + i32.const 35 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 8 @@ -346,10 +345,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 38 + i32.const 24 + i32.const 36 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end end @@ -359,10 +358,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 46 + i32.const 24 + i32.const 44 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 8 @@ -371,10 +370,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 47 + i32.const 24 + i32.const 45 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 16 @@ -383,10 +382,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 48 + i32.const 24 + i32.const 46 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 24 @@ -395,10 +394,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 49 + i32.const 24 + i32.const 47 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 32 @@ -407,10 +406,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 50 + i32.const 24 + i32.const 48 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 40 @@ -419,10 +418,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 51 + i32.const 24 + i32.const 49 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 48 @@ -431,10 +430,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 52 + i32.const 24 + i32.const 50 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 56 @@ -443,10 +442,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 53 + i32.const 24 + i32.const 51 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -455,10 +454,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 55 + i32.const 24 + i32.const 53 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 8 @@ -467,10 +466,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 56 + i32.const 24 + i32.const 54 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 16 @@ -479,10 +478,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 57 + i32.const 24 + i32.const 55 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 20 @@ -491,10 +490,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 58 + i32.const 24 + i32.const 56 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 0 @@ -503,10 +502,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 60 + i32.const 24 + i32.const 58 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end block @@ -516,10 +515,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 62 + i32.const 24 + i32.const 60 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 8 @@ -528,10 +527,10 @@ i32.eqz if i32.const 0 - i32.const 8 - i32.const 63 + i32.const 24 + i32.const 61 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end end diff --git a/tests/compiler/while.json b/tests/compiler/while.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/while.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/while.optimized.wat b/tests/compiler/while.optimized.wat index 30cf03a39a..a6bdb945ce 100644 --- a/tests/compiler/while.optimized.wat +++ b/tests/compiler/while.optimized.wat @@ -1,16 +1,13 @@ (module (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\08\00\00\00w\00h\00i\00l\00e\00.\00t\00s") - (table $0 1 funcref) - (elem (i32.const 0) $null) + (data (i32.const 8) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00w\00h\00i\00l\00e\00.\00t\00s") (global $while/n (mut i32) (i32.const 10)) (global $while/m (mut i32) (i32.const 0)) (global $while/o (mut i32) (i32.const 0)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $start:while (; 1 ;) (type $FUNCSIG$v) (local $0 i32) @@ -31,10 +28,10 @@ global.get $while/n if i32.const 0 - i32.const 8 + i32.const 24 i32.const 8 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $while/m @@ -42,10 +39,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 9 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 10 @@ -80,10 +77,10 @@ global.get $while/n if i32.const 0 - i32.const 8 + i32.const 24 i32.const 21 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $while/o @@ -91,10 +88,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 22 i32.const 2 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end br $continue|1 @@ -103,10 +100,10 @@ global.get $while/n if i32.const 0 - i32.const 8 + i32.const 24 i32.const 24 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $while/m @@ -114,10 +111,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 25 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $while/o @@ -125,10 +122,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 26 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -142,15 +139,15 @@ i32.sub global.set $while/n local.get $0 - if + if (result i32) global.get $while/m i32.const 1 i32.add global.set $while/m global.get $while/m - local.set $0 + else + i32.const 0 end - local.get $0 br_if $continue|3 end global.get $while/n @@ -158,10 +155,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 31 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $while/m @@ -169,10 +166,10 @@ i32.ne if i32.const 0 - i32.const 8 + i32.const 24 i32.const 32 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/while.untouched.wat b/tests/compiler/while.untouched.wat index 1b84c40428..8fc14b6f14 100644 --- a/tests/compiler/while.untouched.wat +++ b/tests/compiler/while.untouched.wat @@ -1,17 +1,15 @@ (module (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\08\00\00\00w\00h\00i\00l\00e\00.\00t\00s\00") + (data (i32.const 8) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00w\00h\00i\00l\00e\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) (global $while/n (mut i32) (i32.const 10)) (global $while/m (mut i32) (i32.const 0)) (global $while/o (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 28)) (export "memory" (memory $0)) - (export "table" (table $0)) (start $start) (func $start:while (; 1 ;) (type $FUNCSIG$v) (local $0 i32) @@ -19,16 +17,14 @@ loop $continue|0 global.get $while/n if - block - global.get $while/n - i32.const 1 - i32.sub - global.set $while/n - global.get $while/m - i32.const 1 - i32.add - global.set $while/m - end + global.get $while/n + i32.const 1 + i32.sub + global.set $while/n + global.get $while/m + i32.const 1 + i32.add + global.set $while/m br $continue|0 end end @@ -39,10 +35,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 8 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $while/m @@ -51,10 +47,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 9 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 10 @@ -65,57 +61,53 @@ loop $continue|1 global.get $while/n if - block - global.get $while/n - i32.const 1 - i32.sub - global.set $while/n - global.get $while/m - i32.const 1 - i32.add - global.set $while/m - block $break|2 - loop $continue|2 + global.get $while/n + i32.const 1 + i32.sub + global.set $while/n + global.get $while/m + i32.const 1 + i32.add + global.set $while/m + block $break|2 + loop $continue|2 + global.get $while/n + if global.get $while/n - if - block - global.get $while/n - i32.const 1 - i32.sub - global.set $while/n - global.get $while/o - i32.const 1 - i32.add - global.set $while/o - end - br $continue|2 - end + i32.const 1 + i32.sub + global.set $while/n + global.get $while/o + i32.const 1 + i32.add + global.set $while/o + br $continue|2 end end - global.get $while/n + end + global.get $while/n + i32.const 0 + i32.eq + i32.eqz + if i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 21 - i32.const 2 - call $~lib/env/abort - unreachable - end - global.get $while/o - i32.const 9 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 22 - i32.const 2 - call $~lib/env/abort - unreachable - end + i32.const 24 + i32.const 21 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $while/o + i32.const 9 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 22 + i32.const 2 + call $~lib/builtins/abort + unreachable end br $continue|1 end @@ -127,10 +119,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 24 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $while/m @@ -139,10 +131,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 25 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $while/o @@ -151,10 +143,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 26 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end i32.const 1 @@ -171,7 +163,6 @@ global.set $while/n local.get $0 end - local.tee $0 if (result i32) global.get $while/m i32.const 1 @@ -179,7 +170,7 @@ global.set $while/m global.get $while/m else - local.get $0 + i32.const 0 end if nop @@ -193,10 +184,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 31 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end global.get $while/m @@ -205,10 +196,10 @@ i32.eqz if i32.const 0 - i32.const 8 + i32.const 24 i32.const 32 i32.const 0 - call $~lib/env/abort + call $~lib/builtins/abort unreachable end ) diff --git a/tests/compiler/wildcard-export.json b/tests/compiler/wildcard-export.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/wildcard-export.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/wildcard-export.optimized.wat b/tests/compiler/wildcard-export.optimized.wat index 1139e552a6..306f12dff1 100644 --- a/tests/compiler/wildcard-export.optimized.wat +++ b/tests/compiler/wildcard-export.optimized.wat @@ -1,12 +1,9 @@ (module (type $FUNCSIG$v (func)) (memory $0 0) - (table $0 1 funcref) - (elem (i32.const 0) $start) (global $export/a i32 (i32.const 1)) (global $export/b i32 (i32.const 2)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "a" (global $export/a)) (export "renamed_a" (global $export/a)) (export "renamed_b" (global $export/b)) diff --git a/tests/compiler/wildcard-export.untouched.wat b/tests/compiler/wildcard-export.untouched.wat index a1662de342..b86295da07 100644 --- a/tests/compiler/wildcard-export.untouched.wat +++ b/tests/compiler/wildcard-export.untouched.wat @@ -7,9 +7,7 @@ (global $export/a i32 (i32.const 1)) (global $export/b i32 (i32.const 2)) (global $export/c i32 (i32.const 3)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 8)) (export "memory" (memory $0)) - (export "table" (table $0)) (export "a" (global $export/a)) (export "renamed_a" (global $export/a)) (export "renamed_b" (global $export/b)) diff --git a/tests/parser/export-default.ts b/tests/parser/export-default.ts new file mode 100644 index 0000000000..5c00aae7af --- /dev/null +++ b/tests/parser/export-default.ts @@ -0,0 +1,6 @@ +export default function theFunction(): void {} +export default class TheClass {} +// not so ts-y: +export default enum TheEnum {} +export default namespace theNamespace {} +export default something; diff --git a/tests/parser/export-default.ts.fixture.ts b/tests/parser/export-default.ts.fixture.ts new file mode 100644 index 0000000000..d2832910ba --- /dev/null +++ b/tests/parser/export-default.ts.fixture.ts @@ -0,0 +1,7 @@ +export default function theFunction(): void {} +export default class TheClass {} +export default enum TheEnum {} +export default namespace theNamespace {} +export { + something as default +}; diff --git a/tests/runtime/.gitignore b/tests/runtime/.gitignore new file mode 100644 index 0000000000..4ef75906ec --- /dev/null +++ b/tests/runtime/.gitignore @@ -0,0 +1 @@ +!untouched.wasm diff --git a/tests/runtime/assembly/index.ts b/tests/runtime/assembly/index.ts new file mode 100644 index 0000000000..19456ac7fd --- /dev/null +++ b/tests/runtime/assembly/index.ts @@ -0,0 +1 @@ +export { __free }; diff --git a/tests/runtime/assembly/tsconfig.json b/tests/runtime/assembly/tsconfig.json new file mode 100644 index 0000000000..6e52b21c48 --- /dev/null +++ b/tests/runtime/assembly/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../../std/assembly.json", + "include": [ + "./**/*.ts" + ] +} diff --git a/tests/runtime/index.html b/tests/runtime/index.html new file mode 100644 index 0000000000..0264496e19 --- /dev/null +++ b/tests/runtime/index.html @@ -0,0 +1,237 @@ + + + + +

AssemblyScript Runtime Visualizer / TLSF

+

+ Notes: +

    +
  • It is expected that there is exactly one block on initialization. This is the remaining space (< 64K) within the last page after static data.
  • +
  • It is expected that if two adjacent blocks of size K are freed, the merged block doesn't go into the first level list for K*2 because its size is actually larger than that (K + OVERHEAD + K).
  • +
  • It is expected that if memory grows beyond 1GB, that even if all blocks are free'd there are at least two (or even three if the largest block is in the middle) remaining blocks, because a single block must not be larger than 1GB.
  • +
  • It is expected that after other operations have already been performed, being able to allocate 1GB can't be guaranteed anymore, even if there should be enough space left in absolute terms, if prior subdivision prevents it.
  • +
  • It is expected that the second level 0 in first level 0 isn't ever used due to alignment guarantees. Smallest block is 32 bytes (16 bytes overhead + 16 bytes payload if used, respectively linking information if free) in this implementation.
  • +
+

+

Implementation constants: ? bits alignment, ? bits first level, ? bits second level, ? B overhead

+ +

First level bitmap

+

The first level map is a bitmap determining whether free blocks exist in at least one of its respective second levels. In this implementation, the first bit indicates whether a small block (< 256B) exists. Each bit doubles the size.

+
+
+ +

Second level maps

+

Second level maps subdivide each first level into multiple lists of subsizes. Each one works similar to the first level bitmap.

+
+
+ +

Heads

+

The heads of the actual free lists, one per second level per first level. Values here are pointers into memory. Last item is the address of the special zero-size "used" tail block, which is usually the end of WASM memory minus block overhead.

+
+
+ +

Allocator

+

Chose a size to allocate. Annotated list indexes depend on implementation constants but match those of this implementation.

+

+   +

+

+ Small blocks: + + + + + + ... + + (δ ≙ block overhead) +

+

+ Common blocks: + + + + + + (e.g. allocate 3, free middle, check second level) +

+

+ Large blocks: + + + + + +

+

+ +

Segments

+

Allocations performed above are tracked here so you can free them again. Note that TLSF alone does not keep track of used blocks (unless free'd and put in a free list again). It is expected that adjacent free blocks become merged automatically.

+
+
diff --git a/tests/runtime/optimized.wat b/tests/runtime/optimized.wat new file mode 100644 index 0000000000..2743486a17 --- /dev/null +++ b/tests/runtime/optimized.wat @@ -0,0 +1,1457 @@ +(module + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (memory $0 1) + (data (i32.const 8) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e") + (data (i32.const 64) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s") + (data (i32.const 112) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e") + (data (i32.const 168) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s") + (data (i32.const 208) "\03\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10") + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) + (global $~lib/rt/__rtti_base i32 (i32.const 208)) + (export "memory" (memory $0)) + (export "__alloc" (func $~lib/rt/tlsf/__alloc)) + (export "__retain" (func $~lib/rt/pure/__retain)) + (export "__release" (func $~lib/rt/pure/__release)) + (export "__collect" (func $~lib/rt/pure/__collect)) + (export "__rtti_base" (global $~lib/rt/__rtti_base)) + (export "__free" (func $~lib/rt/tlsf/__free)) + (func $~lib/rt/tlsf/removeBlock (; 1 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + i32.const -4 + i32.and + local.tee $2 + i32.const 256 + i32.lt_u + if (result i32) + local.get $2 + i32.const 4 + i32.shr_u + local.set $4 + i32.const 0 + else + local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $3 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $4 + local.get $3 + i32.const 7 + i32.sub + end + local.set $3 + local.get $1 + i32.load offset=20 + local.set $2 + local.get $1 + i32.load offset=16 + local.tee $5 + if + local.get $5 + local.get $2 + i32.store offset=20 + end + local.get $2 + if + local.get $2 + local.get $5 + i32.store offset=16 + end + local.get $3 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + local.get $1 + i32.eq + if + local.get $3 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $2 + i32.store offset=96 + local.get $2 + i32.eqz + if + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.store offset=4 + local.get $1 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $3 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 2 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + local.get $1 + i32.load + local.set $3 + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.tee $5 + i32.const 1 + i32.and + if + local.get $3 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const -4 + i32.and + i32.add + local.tee $2 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $3 + i32.const 3 + i32.and + local.get $2 + i32.or + local.tee $3 + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.set $5 + end + end + local.get $3 + i32.const 2 + i32.and + if + local.get $1 + i32.const 4 + i32.sub + i32.load + local.tee $2 + i32.load + local.tee $6 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $3 + i32.const -4 + i32.and + i32.add + local.tee $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $2 + local.get $6 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $3 + i32.store + local.get $2 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $3 + i32.const -4 + i32.and + local.tee $2 + i32.const 256 + i32.lt_u + if (result i32) + local.get $2 + i32.const 4 + i32.shr_u + local.set $4 + i32.const 0 + else + local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $4 + local.get $2 + i32.const 7 + i32.sub + end + local.set $3 + local.get $3 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + local.set $2 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $2 + i32.store offset=20 + local.get $2 + if + local.get $2 + local.get $1 + i32.store offset=16 + end + local.get $3 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $1 + i32.store offset=96 + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $3 + i32.shl + i32.or + i32.store + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $3 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const 1 + local.get $4 + i32.shl + i32.or + i32.store offset=4 + ) + (func $~lib/rt/tlsf/addMemory (; 3 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + local.get $2 + block (result i32) + local.get $0 + i32.load offset=1568 + local.tee $2 + if + local.get $1 + i32.const 16 + i32.sub + local.get $2 + i32.eq + if + local.get $2 + i32.load + local.set $3 + local.get $1 + i32.const 16 + i32.sub + local.set $1 + end + end + local.get $1 + end + i32.sub + local.tee $2 + i32.const 48 + i32.lt_u + if + return + end + local.get $1 + local.get $3 + i32.const 2 + i32.and + local.get $2 + i32.const 32 + i32.sub + i32.const 1 + i32.or + i32.or + i32.store + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $2 + i32.add + i32.const 16 + i32.sub + local.tee $2 + i32.const 2 + i32.store + local.get $0 + local.get $2 + i32.store offset=1568 + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/tlsf/initializeRoot (; 4 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 1 + memory.size + local.tee $0 + i32.gt_s + if (result i32) + i32.const 1 + local.get $0 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + i32.const 240 + i32.const 0 + i32.store + i32.const 1808 + i32.const 0 + i32.store + i32.const 0 + local.set $0 + loop $repeat|0 + block $break|0 + local.get $0 + i32.const 23 + i32.ge_u + br_if $break|0 + local.get $0 + i32.const 2 + i32.shl + i32.const 240 + i32.add + i32.const 0 + i32.store offset=4 + i32.const 0 + local.set $1 + loop $repeat|1 + block $break|1 + local.get $1 + i32.const 16 + i32.ge_u + br_if $break|1 + local.get $0 + i32.const 4 + i32.shl + local.get $1 + i32.add + i32.const 2 + i32.shl + i32.const 240 + i32.add + i32.const 0 + i32.store offset=96 + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|1 + end + end + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + end + i32.const 240 + i32.const 1824 + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + i32.const 240 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 24 + i32.const 80 + i32.const 447 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const -16 + i32.and + local.tee $0 + i32.const 16 + local.get $0 + i32.const 16 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + i32.const 256 + i32.lt_u + if (result i32) + local.get $1 + i32.const 4 + i32.shr_u + local.set $1 + i32.const 0 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + local.get $1 + i32.add + i32.const 1 + i32.sub + local.set $1 + end + local.get $1 + i32.const 31 + local.get $1 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $1 + local.get $2 + i32.const 7 + i32.sub + end + local.tee $2 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=4 + i32.const -1 + local.get $1 + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $1 + i32.ctz + local.get $2 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=96 + else + local.get $0 + i32.load + i32.const -1 + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $0 + local.get $0 + local.get $1 + i32.ctz + local.tee $0 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + i32.ctz + local.get $0 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + else + i32.const 0 + end + end + ) + (func $~lib/rt/tlsf/growMemory (; 7 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + memory.size + local.tee $2 + local.get $1 + i32.const 65535 + i32.add + i32.const -65536 + i32.and + i32.const 16 + i32.shr_u + local.tee $1 + local.get $2 + local.get $1 + i32.gt_s + select + memory.grow + i32.const 0 + i32.lt_s + if + local.get $1 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + local.get $0 + local.get $2 + i32.const 16 + i32.shl + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + ) + (func $~lib/rt/tlsf/prepareBlock (; 8 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $1 + i32.load + local.tee $3 + i32.const -4 + i32.and + local.get $2 + i32.sub + local.tee $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $3 + i32.const 2 + i32.and + local.get $2 + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.tee $1 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const -2 + i32.and + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + i32.load + i32.const -3 + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.tee $3 + call $~lib/rt/tlsf/searchBlock + local.tee $2 + i32.eqz + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $3 + call $~lib/rt/tlsf/searchBlock + local.set $2 + end + local.get $2 + i32.const 0 + i32.store offset=4 + local.get $2 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $2 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $2 + ) + (func $~lib/rt/tlsf/__alloc (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + global.get $~lib/rt/tlsf/ROOT + local.tee $2 + if (result i32) + local.get $2 + else + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + end + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.tee $0 + local.get $1 + i32.store offset=8 + local.get $0 + i32.const 16 + i32.add + ) + (func $~lib/rt/pure/__retain (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + i32.const 236 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + local.tee $1 + local.get $1 + i32.load offset=4 + i32.const 1 + i32.add + i32.store offset=4 + end + local.get $0 + ) + (func $~lib/rt/tlsf/freeBlock (; 12 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + local.get $1 + local.get $1 + i32.load + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/__typeinfo (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 208 + i32.load + i32.gt_u + if + i32.const 128 + i32.const 184 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 3 + i32.shl + i32.const 212 + i32.add + i32.load + ) + (func $~lib/memory/memory.copy (; 14 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $2 + local.set $3 + local.get $0 + local.get $1 + i32.eq + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $1 + i32.lt_u + if + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|0 + local.get $0 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + br $continue|0 + end + end + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $1 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + br $continue|1 + end + end + end + loop $continue|2 + local.get $3 + if + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $4 + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + else + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|3 + local.get $0 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $3 + i32.const 8 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + loop $continue|5 + local.get $3 + if + local.get $0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + ) + (func $~lib/rt/tlsf/__free (; 15 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/growRoots (; 16 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/pure/CUR + global.get $~lib/rt/pure/ROOTS + local.tee $1 + i32.sub + local.tee $2 + i32.const 1 + i32.shl + local.tee $0 + i32.const 256 + local.get $0 + i32.const 256 + i32.gt_u + select + local.tee $3 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.tee $0 + local.get $1 + local.get $2 + call $~lib/memory/memory.copy + local.get $1 + if + local.get $1 + call $~lib/rt/tlsf/__free + end + local.get $0 + global.set $~lib/rt/pure/ROOTS + local.get $0 + local.get $2 + i32.add + global.set $~lib/rt/pure/CUR + local.get $0 + local.get $3 + i32.add + global.set $~lib/rt/pure/END + ) + (func $~lib/rt/pure/appendRoot (; 17 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/pure/CUR + local.tee $1 + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 4 + i32.add + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/decrement (; 18 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 268435455 + i32.and + local.tee $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/rt/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + if + local.get $0 + i32.const -2147483648 + i32.store offset=4 + else + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + else + local.get $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 16 + i32.and + if + local.get $0 + local.get $2 + i32.const 1 + i32.sub + local.get $1 + i32.const -268435456 + i32.and + i32.or + i32.store offset=4 + else + local.get $0 + local.get $2 + i32.const 1 + i32.sub + i32.const -1342177280 + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/appendRoot + end + end + end + ) + (func $~lib/rt/pure/__release (; 19 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + i32.const 236 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + end + ) + (func $~lib/rt/pure/markGray (; 20 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members + end + ) + (func $~lib/rt/pure/scanBlack (; 21 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 22 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const -1879048193 + i32.and + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + ) + (func $~lib/rt/pure/__collect (; 24 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/pure/ROOTS + local.tee $5 + local.tee $2 + local.set $3 + global.get $~lib/rt/pure/CUR + local.set $0 + loop $repeat|0 + block $break|0 + local.get $3 + local.get $0 + i32.ge_u + br_if $break|0 + local.get $3 + i32.load + local.tee $4 + i32.load offset=4 + local.tee $1 + i32.const 1879048192 + i32.and + i32.const 805306368 + i32.eq + if (result i32) + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + else + i32.const 0 + end + if + local.get $4 + call $~lib/rt/pure/markGray + local.get $2 + local.get $4 + i32.store + local.get $2 + i32.const 4 + i32.add + local.set $2 + else + i32.const 0 + local.get $1 + i32.const 268435455 + i32.and + i32.eqz + local.get $1 + i32.const 1879048192 + i32.and + select + if + global.get $~lib/rt/tlsf/ROOT + local.get $4 + call $~lib/rt/tlsf/freeBlock + else + local.get $4 + local.get $1 + i32.const 2147483647 + i32.and + i32.store offset=4 + end + end + local.get $3 + i32.const 4 + i32.add + local.set $3 + br $repeat|0 + end + end + local.get $2 + global.set $~lib/rt/pure/CUR + local.get $5 + local.set $0 + loop $repeat|1 + block $break|1 + local.get $0 + local.get $2 + i32.ge_u + br_if $break|1 + local.get $0 + i32.load + call $~lib/rt/pure/scan + local.get $0 + i32.const 4 + i32.add + local.set $0 + br $repeat|1 + end + end + local.get $5 + local.set $0 + loop $repeat|2 + block $break|2 + local.get $0 + local.get $2 + i32.ge_u + br_if $break|2 + local.get $0 + i32.load + local.tee $1 + local.get $1 + i32.load offset=4 + i32.const 2147483647 + i32.and + i32.store offset=4 + local.get $1 + call $~lib/rt/pure/collectWhite + local.get $0 + i32.const 4 + i32.add + local.set $0 + br $repeat|2 + end + end + local.get $5 + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/__visit (; 25 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + local.get $0 + i32.const 236 + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $0 + block $break|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + local.get $1 + i32.const 1 + i32.ne + if + local.get $1 + i32.const 2 + i32.eq + br_if $case1|0 + block $tablify|0 + local.get $1 + i32.const 3 + i32.sub + br_table $case2|0 $case3|0 $case4|0 $tablify|0 + end + br $break|0 + end + local.get $0 + call $~lib/rt/pure/decrement + br $break|0 + end + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $0 + call $~lib/rt/pure/markGray + br $break|0 + end + local.get $0 + call $~lib/rt/pure/scan + br $break|0 + end + local.get $0 + local.get $0 + i32.load offset=4 + local.tee $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $1 + i32.const 1879048192 + i32.and + if + local.get $0 + call $~lib/rt/pure/scanBlack + end + br $break|0 + end + local.get $0 + call $~lib/rt/pure/collectWhite + end + ) + (func $~lib/rt/__visit_members (; 26 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + block $switch$1$default + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$default + end + return + end + local.get $0 + i32.load + local.tee $0 + if + local.get $0 + local.get $1 + call $~lib/rt/pure/__visit + end + return + end + unreachable + ) + (func $null (; 27 ;) (type $FUNCSIG$v) + nop + ) +) diff --git a/tests/runtime/package-lock.json b/tests/runtime/package-lock.json new file mode 100644 index 0000000000..166100d470 --- /dev/null +++ b/tests/runtime/package-lock.json @@ -0,0 +1,213 @@ +{ + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, + "colors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", + "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=", + "dev": true + }, + "corser": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz", + "integrity": "sha1-jtolLsqrWEDc2XXOuQ2TcMgZ/4c=", + "dev": true + }, + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ecstatic": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/ecstatic/-/ecstatic-3.3.1.tgz", + "integrity": "sha512-/rrctvxZ78HMI/tPIsqdvFKHHscxR3IJuKrZI2ZoUgkt2SiufyLFBmcco+aqQBIu6P1qBsUNG3drAAGLx80vTQ==", + "dev": true, + "requires": { + "he": "^1.1.1", + "mime": "^1.6.0", + "minimist": "^1.1.0", + "url-join": "^2.0.5" + } + }, + "eventemitter3": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.0.tgz", + "integrity": "sha512-ivIvhpq/Y0uSjcHDcOIccjmYjGLcP09MFGE7ysAwkAvkXfpZlC985pH2/ui64DKazbTW/4kN3yqozUxlXzI6cA==", + "dev": true + }, + "follow-redirects": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.7.0.tgz", + "integrity": "sha512-m/pZQy4Gj287eNy94nivy5wchN3Kp+Q5WgUPNy5lJSZ3sgkVKSYV/ZChMAQVIgx1SqfZ2zBZtPA2YlXIWxxJOQ==", + "dev": true, + "requires": { + "debug": "^3.2.6" + } + }, + "he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true + }, + "http-proxy": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.17.0.tgz", + "integrity": "sha512-Taqn+3nNvYRfJ3bGvKfBSRwy1v6eePlm3oc/aWVxZp57DQr5Eq3xhKJi7Z4hZpS8PC3H4qI+Yly5EmFacGuA/g==", + "dev": true, + "requires": { + "eventemitter3": "^3.0.0", + "follow-redirects": "^1.0.0", + "requires-port": "^1.0.0" + } + }, + "http-server": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/http-server/-/http-server-0.11.1.tgz", + "integrity": "sha512-6JeGDGoujJLmhjiRGlt8yK8Z9Kl0vnl/dQoQZlc4oeqaUoAKQg94NILLfrY3oWzSyFaQCVNTcKE5PZ3cH8VP9w==", + "dev": true, + "requires": { + "colors": "1.0.3", + "corser": "~2.0.0", + "ecstatic": "^3.0.0", + "http-proxy": "^1.8.1", + "opener": "~1.4.0", + "optimist": "0.6.x", + "portfinder": "^1.0.13", + "union": "~0.4.3" + } + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + } + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, + "opener": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/opener/-/opener-1.4.3.tgz", + "integrity": "sha1-XG2ixdflgx6P+jlklQ+NZnSskLg=", + "dev": true + }, + "optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "dev": true, + "requires": { + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" + }, + "dependencies": { + "minimist": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", + "dev": true + } + } + }, + "portfinder": { + "version": "1.0.20", + "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.20.tgz", + "integrity": "sha512-Yxe4mTyDzTd59PZJY4ojZR8F+E5e97iq2ZOHPz3HDgSvYC5siNad2tLooQ5y5QHyQhc3xVqvyk/eNA3wuoa7Sw==", + "dev": true, + "requires": { + "async": "^1.5.2", + "debug": "^2.2.0", + "mkdirp": "0.5.x" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "qs": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-2.3.3.tgz", + "integrity": "sha1-6eha2+ddoLvkyOBHaghikPhjtAQ=", + "dev": true + }, + "requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", + "dev": true + }, + "union": { + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/union/-/union-0.4.6.tgz", + "integrity": "sha1-GY+9rrolTniLDvy2MLwR8kopWeA=", + "dev": true, + "requires": { + "qs": "~2.3.3" + } + }, + "url-join": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/url-join/-/url-join-2.0.5.tgz", + "integrity": "sha1-WvIvGMBSoACkjXuCxenC4v7tpyg=", + "dev": true + }, + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "dev": true + } + } +} diff --git a/tests/runtime/package.json b/tests/runtime/package.json new file mode 100644 index 0000000000..d12823bba5 --- /dev/null +++ b/tests/runtime/package.json @@ -0,0 +1,12 @@ +{ + "private": true, + "scripts": { + "server": "http-server . -o -c-1", + "build": "npm run build:untouched && npm run build:optimized", + "build:untouched": "node ../../bin/asc assembly/index.ts -t untouched.wat -b untouched.wasm --runtime full --validate --sourceMap --measure", + "build:optimized": "node ../../bin/asc assembly/index.ts -t optimized.wat -b optimized.wasm --runtime full --validate --sourceMap --measure --noAssert --optimize" + }, + "devDependencies": { + "http-server": "^0.11.1" + } +} diff --git a/tests/runtime/untouched.wasm b/tests/runtime/untouched.wasm new file mode 100644 index 0000000000..b00317d791 Binary files /dev/null and b/tests/runtime/untouched.wasm differ diff --git a/tests/runtime/untouched.wat b/tests/runtime/untouched.wat new file mode 100644 index 0000000000..628180b86e --- /dev/null +++ b/tests/runtime/untouched.wat @@ -0,0 +1,3608 @@ +(module + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (memory $0 1) + (data (i32.const 8) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") + (data (i32.const 56) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") + (data (i32.const 112) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s\00") + (data (i32.const 160) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 216) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s\00") + (data (i32.const 256) "\03\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00") + (table $0 1 funcref) + (elem (i32.const 0) $null) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $~lib/rt/pure/CUR (mut i32) (i32.const 0)) + (global $~lib/rt/pure/END (mut i32) (i32.const 0)) + (global $~lib/rt/pure/ROOTS (mut i32) (i32.const 0)) + (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/rt/__rtti_base i32 (i32.const 256)) + (global $~lib/heap/__heap_base i32 (i32.const 284)) + (export "memory" (memory $0)) + (export "__alloc" (func $~lib/rt/tlsf/__alloc)) + (export "__retain" (func $~lib/rt/pure/__retain)) + (export "__release" (func $~lib/rt/pure/__release)) + (export "__collect" (func $~lib/rt/pure/__collect)) + (export "__rtti_base" (global $~lib/rt/__rtti_base)) + (export "__free" (func $~lib/rt/tlsf/__free)) + (func $~lib/rt/tlsf/removeBlock (; 1 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 276 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $3 + local.get $3 + i32.const 16 + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 278 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 + i32.shr_u + local.set $5 + else + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $4 + local.get $3 + local.get $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) + local.get $5 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 291 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end + local.get $1 + block $~lib/rt/tlsf/GETHEAD|inlined.0 (result i32) + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + i32.eq + if + block $~lib/rt/tlsf/SETHEAD|inlined.1 + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + end + local.get $7 + i32.eqz + if + block $~lib/rt/tlsf/GETSL|inlined.0 (result i32) + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $9 + block $~lib/rt/tlsf/SETSL|inlined.1 + local.get $0 + local.set $8 + local.get $4 + local.set $11 + local.get $9 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $9 + local.set $10 + local.get $8 + local.get $11 + i32.const 2 + i32.shl + i32.add + local.get $10 + i32.store offset=4 + end + local.get $9 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end + end + end + ) + (func $~lib/rt/tlsf/insertBlock (; 2 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 204 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 206 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32) + local.get $1 + local.set $3 + local.get $3 + i32.const 16 + i32.add + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + local.get $5 + i32.const 1 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end + local.get $2 + i32.const 2 + i32.and + if + block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32) + local.get $1 + local.set $6 + local.get $6 + i32.const 4 + i32.sub + i32.load + end + local.set $6 + local.get $6 + i32.load + local.set $3 + local.get $3 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 227 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $7 + local.get $7 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $6 + call $~lib/rt/tlsf/removeBlock + local.get $6 + local.get $3 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $6 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 242 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.add + local.get $8 + i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 243 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $8 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 + end + local.get $9 + i32.const 23 + i32.lt_u + if (result i32) + local.get $10 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 259 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32) + local.get $0 + local.set $7 + local.get $9 + local.set $3 + local.get $10 + local.set $6 + local.get $7 + local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $11 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + block $~lib/rt/tlsf/SETHEAD|inlined.2 + local.get $0 + local.set $12 + local.get $9 + local.set $7 + local.get $10 + local.set $3 + local.get $1 + local.set $6 + local.get $12 + local.get $7 + i32.const 4 + i32.shl + local.get $3 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + end + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + block $~lib/rt/tlsf/SETSL|inlined.2 + local.get $0 + local.set $13 + local.get $9 + local.set $12 + block $~lib/rt/tlsf/GETSL|inlined.1 (result i32) + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + end + ) + (func $~lib/rt/tlsf/addMemory (; 3 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + local.get $2 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 385 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32) + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + end + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 395 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 407 + i32.const 4 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 16 + i32.mul + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.1 + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + end + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/initializeRoot (; 4 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + memory.size + local.set $1 + local.get $0 + i32.const 1572 + i32.add + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.const 0 + i32.store + block $~lib/rt/tlsf/SETTAIL|inlined.0 + local.get $3 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + end + block $break|0 + i32.const 0 + local.set $5 + loop $repeat|0 + local.get $5 + i32.const 23 + i32.lt_u + i32.eqz + br_if $break|0 + block $~lib/rt/tlsf/SETSL|inlined.0 + local.get $3 + local.set $7 + local.get $5 + local.set $6 + i32.const 0 + local.set $4 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store offset=4 + end + block $break|1 + i32.const 0 + local.set $7 + loop $repeat|1 + local.get $7 + i32.const 16 + i32.lt_u + i32.eqz + br_if $break|1 + block $~lib/rt/tlsf/SETHEAD|inlined.0 + local.get $3 + local.set $9 + local.get $5 + local.set $8 + local.get $7 + local.set $6 + i32.const 0 + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store offset=96 + end + local.get $7 + i32.const 1 + i32.add + local.set $7 + br $repeat|1 + unreachable + end + unreachable + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $repeat|0 + unreachable + end + unreachable + end + local.get $3 + local.get $0 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/prepareSize (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 72 + i32.const 24 + i32.const 447 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 337 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETSL|inlined.2 (result i32) + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + i32.const 0 + local.set $7 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $5 + local.get $5 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $5 + i32.ctz + local.set $2 + block $~lib/rt/tlsf/GETSL|inlined.3 (result i32) + local.get $0 + local.set $8 + local.get $2 + local.set $4 + local.get $8 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + end + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 350 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + else + block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32) + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + end + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (; 7 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + memory.size + local.set $2 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $3 + local.get $2 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + memory.grow + i32.const 0 + i32.lt_s + if + local.get $3 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + memory.size + local.set $7 + local.get $0 + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (; 8 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 364 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + end + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 477 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + end + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 479 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $2 + local.get $2 + i32.eqz + if + call $~lib/rt/tlsf/initializeRoot + global.get $~lib/rt/tlsf/ROOT + local.set $2 + end + local.get $2 + local.get $0 + call $~lib/rt/tlsf/allocateBlock + local.set $3 + local.get $3 + local.get $1 + i32.store offset=8 + local.get $3 + i32.const 16 + i32.add + ) + (func $~lib/rt/pure/increment (; 11 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 104 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 107 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/pure/__retain (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment + end + local.get $0 + ) + (func $~lib/rt/tlsf/freeBlock (; 13 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $2 + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 531 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/__typeinfo (; 14 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/rt/__rtti_base + local.set $1 + local.get $0 + local.get $1 + i32.load + i32.gt_u + if + i32.const 176 + i32.const 232 + i32.const 22 + i32.const 27 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 4 + i32.add + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/util/memory/memcpy (; 15 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + block $break|0 + loop $continue|0 + local.get $2 + if (result i32) + local.get $1 + i32.const 3 + i32.and + else + i32.const 0 + end + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $continue|0 + end + end + end + local.get $0 + i32.const 3 + i32.and + i32.const 0 + i32.eq + if + block $break|1 + loop $continue|1 + local.get $2 + i32.const 16 + i32.ge_u + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 8 + i32.add + i32.load + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 12 + i32.add + i32.load + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|1 + end + end + end + local.get $2 + i32.const 8 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + end + local.get $2 + i32.const 4 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.set $0 + local.get $1 + i32.const 4 + i32.add + local.set $1 + end + local.get $2 + i32.const 2 + i32.and + if + local.get $0 + local.get $1 + i32.load16_u + i32.store16 + local.get $0 + i32.const 2 + i32.add + local.set $0 + local.get $1 + i32.const 2 + i32.add + local.set $1 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + return + end + local.get $2 + i32.const 32 + i32.ge_u + if + block $break|2 + block $case2|2 + block $case1|2 + block $case0|2 + local.get $0 + i32.const 3 + i32.and + local.set $5 + local.get $5 + i32.const 1 + i32.eq + br_if $case0|2 + local.get $5 + i32.const 2 + i32.eq + br_if $case1|2 + local.get $5 + i32.const 3 + i32.eq + br_if $case2|2 + br $break|2 + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 3 + i32.sub + local.set $2 + block $break|3 + loop $continue|3 + local.get $2 + i32.const 17 + i32.ge_u + if + local.get $1 + i32.const 1 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 5 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 9 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 13 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|3 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + block $break|4 + loop $continue|4 + local.get $2 + i32.const 18 + i32.ge_u + if + local.get $1 + i32.const 2 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 6 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 10 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 14 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|4 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + block $break|5 + loop $continue|5 + local.get $2 + i32.const 19 + i32.ge_u + if + local.get $1 + i32.const 3 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 7 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 11 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 15 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|5 + end + end + end + br $break|2 + unreachable + end + unreachable + end + end + local.get $2 + i32.const 16 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 8 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 4 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 2 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + ) + (func $~lib/memory/memory.copy (; 16 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $4 + local.get $3 + i32.add + local.get $5 + i32.le_u + if (result i32) + i32.const 1 + else + local.get $5 + local.get $3 + i32.add + local.get $4 + i32.le_u + end + if + local.get $5 + local.get $4 + local.get $3 + call $~lib/util/memory/memcpy + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $5 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $3 + if + block (result i32) + local.get $5 + local.tee $6 + i32.const 1 + i32.add + local.set $5 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $3 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/rt/tlsf/__free (; 17 ;) (type $FUNCSIG$vi) (param $0 i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 561 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 562 + i32.const 2 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/pure/growRoots (; 18 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/pure/ROOTS + local.set $0 + global.get $~lib/rt/pure/CUR + local.get $0 + i32.sub + local.set $1 + local.get $1 + i32.const 2 + i32.mul + local.tee $2 + i32.const 64 + i32.const 2 + i32.shl + local.tee $3 + local.get $2 + local.get $3 + i32.gt_u + select + local.set $4 + local.get $4 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.set $5 + local.get $5 + local.get $0 + local.get $1 + call $~lib/memory/memory.copy + local.get $0 + if + local.get $0 + call $~lib/rt/tlsf/__free + end + local.get $5 + global.set $~lib/rt/pure/ROOTS + local.get $5 + local.get $1 + i32.add + global.set $~lib/rt/pure/CUR + local.get $5 + local.get $4 + i32.add + global.set $~lib/rt/pure/END + ) + (func $~lib/rt/pure/appendRoot (; 19 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + global.get $~lib/rt/pure/CUR + local.set $1 + local.get $1 + global.get $~lib/rt/pure/END + i32.ge_u + if + call $~lib/rt/pure/growRoots + global.get $~lib/rt/pure/CUR + local.set $1 + end + local.get $1 + local.get $0 + i32.store + local.get $1 + i32.const 4 + i32.add + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/decrement (; 20 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 115 + i32.const 13 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/rt/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $0 + i32.const -2147483648 + i32.const 0 + i32.or + i32.const 0 + i32.or + i32.store offset=4 + end + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 124 + i32.const 15 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + call $~lib/rt/__typeinfo + i32.const 16 + i32.and + i32.eqz + if + local.get $0 + i32.const -2147483648 + i32.const 805306368 + i32.or + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + if + local.get $0 + call $~lib/rt/pure/appendRoot + end + else + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + end + ) + (func $~lib/rt/pure/__release (; 21 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + end + ) + (func $~lib/rt/pure/markGray (; 22 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.ne + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 268435456 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 2 + call $~lib/rt/__visit_members + end + ) + (func $~lib/rt/pure/scanBlack (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 4 + call $~lib/rt/__visit_members + ) + (func $~lib/rt/pure/scan (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 268435456 + i32.eq + if + local.get $1 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + if + local.get $0 + call $~lib/rt/pure/scanBlack + else + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 536870912 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 3 + call $~lib/rt/__visit_members + end + end + ) + (func $~lib/rt/pure/collectWhite (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 1879048192 + i32.and + i32.const 536870912 + i32.eq + if (result i32) + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + else + i32.const 0 + end + if + local.get $0 + local.get $1 + i32.const 1879048192 + i32.const -1 + i32.xor + i32.and + i32.const 0 + i32.or + i32.store offset=4 + local.get $0 + i32.const 16 + i32.add + i32.const 5 + call $~lib/rt/__visit_members + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + end + ) + (func $~lib/rt/pure/__collect (; 26 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/pure/ROOTS + local.set $0 + local.get $0 + local.set $1 + block $break|0 + block + local.get $1 + local.set $2 + global.get $~lib/rt/pure/CUR + local.set $3 + end + loop $repeat|0 + local.get $2 + local.get $3 + i32.lt_u + i32.eqz + br_if $break|0 + local.get $2 + i32.load + local.set $4 + local.get $4 + i32.load offset=4 + local.set $5 + local.get $5 + i32.const 1879048192 + i32.and + i32.const 805306368 + i32.eq + if (result i32) + local.get $5 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + else + i32.const 0 + end + if + local.get $4 + call $~lib/rt/pure/markGray + local.get $1 + local.get $4 + i32.store + local.get $1 + i32.const 4 + i32.add + local.set $1 + else + local.get $5 + i32.const 1879048192 + i32.and + i32.const 0 + i32.eq + if (result i32) + local.get $5 + i32.const 268435455 + i32.and + i32.eqz + else + i32.const 0 + end + if + global.get $~lib/rt/tlsf/ROOT + local.get $4 + call $~lib/rt/tlsf/freeBlock + else + local.get $4 + local.get $5 + i32.const -2147483648 + i32.const -1 + i32.xor + i32.and + i32.store offset=4 + end + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + global.set $~lib/rt/pure/CUR + block $break|1 + local.get $0 + local.set $5 + loop $repeat|1 + local.get $5 + local.get $1 + i32.lt_u + i32.eqz + br_if $break|1 + local.get $5 + i32.load + call $~lib/rt/pure/scan + local.get $5 + i32.const 4 + i32.add + local.set $5 + br $repeat|1 + unreachable + end + unreachable + end + block $break|2 + local.get $0 + local.set $5 + loop $repeat|2 + local.get $5 + local.get $1 + i32.lt_u + i32.eqz + br_if $break|2 + local.get $5 + i32.load + local.set $4 + local.get $4 + local.get $4 + i32.load offset=4 + i32.const -2147483648 + i32.const -1 + i32.xor + i32.and + i32.store offset=4 + local.get $4 + call $~lib/rt/pure/collectWhite + local.get $5 + i32.const 4 + i32.add + local.set $5 + br $repeat|2 + unreachable + end + unreachable + end + local.get $0 + global.set $~lib/rt/pure/CUR + ) + (func $~lib/rt/pure/__visit (; 27 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + local.set $2 + block $break|0 + block $case5|0 + block $case4|0 + block $case3|0 + block $case2|0 + block $case1|0 + block $case0|0 + local.get $1 + local.set $3 + local.get $3 + i32.const 1 + i32.eq + br_if $case0|0 + local.get $3 + i32.const 2 + i32.eq + br_if $case1|0 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|0 + local.get $3 + i32.const 4 + i32.eq + br_if $case3|0 + local.get $3 + i32.const 5 + i32.eq + br_if $case4|0 + br $case5|0 + end + block + local.get $2 + call $~lib/rt/pure/decrement + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + i32.const 268435455 + i32.and + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 75 + i32.const 17 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.sub + i32.store offset=4 + local.get $2 + call $~lib/rt/pure/markGray + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/scan + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $3 + i32.const 1 + i32.add + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 86 + i32.const 6 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $3 + i32.const 1 + i32.add + i32.store offset=4 + local.get $3 + i32.const 1879048192 + i32.and + i32.const 0 + i32.ne + if + local.get $2 + call $~lib/rt/pure/scanBlack + end + br $break|0 + unreachable + end + unreachable + end + block + local.get $2 + call $~lib/rt/pure/collectWhite + br $break|0 + unreachable + end + unreachable + end + i32.const 0 + i32.eqz + if + i32.const 0 + i32.const 128 + i32.const 97 + i32.const 24 + call $~lib/builtins/abort + unreachable + end + end + ) + (func $~lib/rt/__visit_members (; 28 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + block + end + block $switch$1$leave + block $switch$1$default + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$default + end + block + block + return + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + block + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + end + return + unreachable + end + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + block + block + unreachable + unreachable + end + unreachable + unreachable + end + unreachable + end + ) + (func $null (; 29 ;) (type $FUNCSIG$v) + ) +) diff --git a/tslint.json b/tslint.json index dbd2c28b27..e075f8c784 100644 --- a/tslint.json +++ b/tslint.json @@ -7,12 +7,6 @@ "indent": { "options": ["spaces", 2] }, - "max-line-length": { - "options": [{ - "limit": 120, - "ignore-pattern": " *DiagnosticCode\\.[^ ]+,$" - }] - }, "member-access": { "options": ["no-public"] },